diff --git a/Podfile.lock b/Podfile.lock index 3e5669042..af86691dc 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,110 +1,324 @@ PODS: - - BoringSSL-GRPC (0.0.3): - - BoringSSL-GRPC/Implementation (= 0.0.3) - - BoringSSL-GRPC/Interface (= 0.0.3) - - BoringSSL-GRPC/Implementation (0.0.3): - - BoringSSL-GRPC/Interface (= 0.0.3) - - BoringSSL-GRPC/Interface (0.0.3) - - Firebase/Core (6.11.0): + - abseil/algorithm (0.20200225.0): + - abseil/algorithm/algorithm (= 0.20200225.0) + - abseil/algorithm/container (= 0.20200225.0) + - abseil/algorithm/algorithm (0.20200225.0): + - abseil/base/config + - abseil/algorithm/container (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/base (0.20200225.0): + - abseil/base/atomic_hook (= 0.20200225.0) + - abseil/base/base (= 0.20200225.0) + - abseil/base/base_internal (= 0.20200225.0) + - abseil/base/bits (= 0.20200225.0) + - abseil/base/config (= 0.20200225.0) + - abseil/base/core_headers (= 0.20200225.0) + - abseil/base/dynamic_annotations (= 0.20200225.0) + - abseil/base/endian (= 0.20200225.0) + - abseil/base/errno_saver (= 0.20200225.0) + - abseil/base/exponential_biased (= 0.20200225.0) + - abseil/base/log_severity (= 0.20200225.0) + - abseil/base/malloc_internal (= 0.20200225.0) + - abseil/base/periodic_sampler (= 0.20200225.0) + - abseil/base/pretty_function (= 0.20200225.0) + - abseil/base/raw_logging_internal (= 0.20200225.0) + - abseil/base/spinlock_wait (= 0.20200225.0) + - abseil/base/throw_delegate (= 0.20200225.0) + - abseil/base/atomic_hook (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/base (0.20200225.0): + - abseil/base/atomic_hook + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/base/spinlock_wait + - abseil/meta/type_traits + - abseil/base/base_internal (0.20200225.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/base/bits (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/config (0.20200225.0) + - abseil/base/core_headers (0.20200225.0): + - abseil/base/config + - abseil/base/dynamic_annotations (0.20200225.0) + - abseil/base/endian (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver (0.20200225.0): + - abseil/base/config + - abseil/base/exponential_biased (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal (0.20200225.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/base/periodic_sampler (0.20200225.0): + - abseil/base/core_headers + - abseil/base/exponential_biased + - abseil/base/pretty_function (0.20200225.0) + - abseil/base/raw_logging_internal (0.20200225.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/spinlock_wait (0.20200225.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/throw_delegate (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/container/compressed_tuple (0.20200225.0): + - abseil/utility/utility + - abseil/container/inlined_vector (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/inlined_vector_internal + - abseil/memory/memory + - abseil/container/inlined_vector_internal (0.20200225.0): + - abseil/base/core_headers + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/span + - abseil/memory (0.20200225.0): + - abseil/memory/memory (= 0.20200225.0) + - abseil/memory/memory (0.20200225.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/meta (0.20200225.0): + - abseil/meta/type_traits (= 0.20200225.0) + - abseil/meta/type_traits (0.20200225.0): + - abseil/base/config + - abseil/numeric/int128 (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/strings/internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/meta/type_traits + - abseil/strings/str_format (0.20200225.0): + - abseil/strings/str_format_internal + - abseil/strings/str_format_internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/span + - abseil/strings/strings (0.20200225.0): + - abseil/base/base + - abseil/base/bits + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/base/throw_delegate + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/internal + - abseil/time (0.20200225.0): + - abseil/time/internal (= 0.20200225.0) + - abseil/time/time (= 0.20200225.0) + - abseil/time/internal (0.20200225.0): + - abseil/time/internal/cctz (= 0.20200225.0) + - abseil/time/internal/cctz (0.20200225.0): + - abseil/time/internal/cctz/civil_time (= 0.20200225.0) + - abseil/time/internal/cctz/time_zone (= 0.20200225.0) + - abseil/time/internal/cctz/civil_time (0.20200225.0): + - abseil/base/config + - abseil/time/internal/cctz/time_zone (0.20200225.0): + - abseil/base/config + - abseil/time/internal/cctz/civil_time + - abseil/time/time (0.20200225.0): + - abseil/base/base + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/time/internal/cctz/civil_time + - abseil/time/internal/cctz/time_zone + - abseil/types (0.20200225.0): + - abseil/types/any (= 0.20200225.0) + - abseil/types/bad_any_cast (= 0.20200225.0) + - abseil/types/bad_any_cast_impl (= 0.20200225.0) + - abseil/types/bad_optional_access (= 0.20200225.0) + - abseil/types/bad_variant_access (= 0.20200225.0) + - abseil/types/compare (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - abseil/types/span (= 0.20200225.0) + - abseil/types/variant (= 0.20200225.0) + - abseil/types/any (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/bad_any_cast + - abseil/utility/utility + - abseil/types/bad_any_cast (0.20200225.0): + - abseil/base/config + - abseil/types/bad_any_cast_impl + - abseil/types/bad_any_cast_impl (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/types/bad_optional_access (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/types/bad_variant_access (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/types/compare (0.20200225.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/optional (0.20200225.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/bad_optional_access + - abseil/utility/utility + - abseil/types/span (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/meta/type_traits + - abseil/types/variant (0.20200225.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/bad_variant_access + - abseil/utility/utility + - abseil/utility/utility (0.20200225.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/meta/type_traits + - BoringSSL-GRPC (0.0.7): + - BoringSSL-GRPC/Implementation (= 0.0.7) + - BoringSSL-GRPC/Interface (= 0.0.7) + - BoringSSL-GRPC/Implementation (0.0.7): + - BoringSSL-GRPC/Interface (= 0.0.7) + - BoringSSL-GRPC/Interface (0.0.7) + - Firebase/Core (6.33.0): - Firebase/CoreOnly - - FirebaseAnalytics (= 6.1.3) - - Firebase/CoreOnly (6.11.0): - - FirebaseCore (= 6.3.2) - - Firebase/Firestore (6.11.0): + - FirebaseAnalytics (= 6.8.3) + - Firebase/CoreOnly (6.33.0): + - FirebaseCore (= 6.10.3) + - Firebase/Firestore (6.33.0): - Firebase/CoreOnly - - FirebaseFirestore (~> 1.6.1) - - FirebaseAnalytics (6.1.3): - - FirebaseCore (~> 6.3) - - FirebaseInstanceID (~> 4.2) - - GoogleAppMeasurement (= 6.1.3) - - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - - GoogleUtilities/MethodSwizzler (~> 6.0) - - GoogleUtilities/Network (~> 6.0) - - "GoogleUtilities/NSData+zlib (~> 6.0)" - - nanopb (~> 0.3.901) - - FirebaseAuthInterop (1.0.0) - - FirebaseCore (6.3.2): - - FirebaseCoreDiagnostics (~> 1.0) - - FirebaseCoreDiagnosticsInterop (~> 1.0) - - GoogleUtilities/Environment (~> 6.2) - - GoogleUtilities/Logger (~> 6.2) - - FirebaseCoreDiagnostics (1.1.1): - - FirebaseCoreDiagnosticsInterop (~> 1.0) - - GoogleDataTransportCCTSupport (~> 1.0) - - GoogleUtilities/Environment (~> 6.2) - - GoogleUtilities/Logger (~> 6.2) - - nanopb (~> 0.3.901) - - FirebaseCoreDiagnosticsInterop (1.0.0) - - FirebaseFirestore (1.6.1): - - FirebaseAuthInterop (~> 1.0) - - FirebaseCore (~> 6.2) - - FirebaseFirestore/abseil-cpp (= 1.6.1) - - "gRPC-C++ (= 0.0.9)" + - FirebaseFirestore (~> 1.18.0) + - FirebaseAnalytics (6.8.3): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleAppMeasurement (= 6.8.3) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/MethodSwizzler (~> 6.7) + - GoogleUtilities/Network (~> 6.7) + - "GoogleUtilities/NSData+zlib (~> 6.7)" + - nanopb (~> 1.30906.0) + - FirebaseCore (6.10.3): + - FirebaseCoreDiagnostics (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - FirebaseCoreDiagnostics (1.7.0): + - GoogleDataTransport (~> 7.4) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - nanopb (~> 1.30906.0) + - FirebaseFirestore (1.18.0): + - abseil/algorithm (= 0.20200225.0) + - abseil/base (= 0.20200225.0) + - abseil/memory (= 0.20200225.0) + - abseil/meta (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/time (= 0.20200225.0) + - abseil/types (= 0.20200225.0) + - FirebaseCore (~> 6.10) + - "gRPC-C++ (~> 1.28.0)" - leveldb-library (~> 1.22) - - nanopb (~> 0.3.901) - - Protobuf (>= 3.9.2, ~> 3.9) - - FirebaseFirestore/abseil-cpp (1.6.1): - - FirebaseAuthInterop (~> 1.0) - - FirebaseCore (~> 6.2) - - "gRPC-C++ (= 0.0.9)" - - leveldb-library (~> 1.22) - - nanopb (~> 0.3.901) - - Protobuf (>= 3.9.2, ~> 3.9) - - FirebaseInstanceID (4.2.7): - - FirebaseCore (~> 6.0) - - GoogleUtilities/Environment (~> 6.0) - - GoogleUtilities/UserDefaults (~> 6.0) - - GoogleAppMeasurement (6.1.3): - - GoogleUtilities/AppDelegateSwizzler (~> 6.0) - - GoogleUtilities/MethodSwizzler (~> 6.0) - - GoogleUtilities/Network (~> 6.0) - - "GoogleUtilities/NSData+zlib (~> 6.0)" - - nanopb (~> 0.3.901) - - GoogleDataTransport (3.0.1) - - GoogleDataTransportCCTSupport (1.2.1): - - GoogleDataTransport (~> 3.0) - - nanopb (~> 0.3.901) - - GoogleUtilities/AppDelegateSwizzler (6.3.1): + - nanopb (~> 1.30906.0) + - FirebaseInstallations (1.7.0): + - FirebaseCore (~> 6.10) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - PromisesObjC (~> 1.2) + - GoogleAppMeasurement (6.8.3): + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/MethodSwizzler (~> 6.7) + - GoogleUtilities/Network (~> 6.7) + - "GoogleUtilities/NSData+zlib (~> 6.7)" + - nanopb (~> 1.30906.0) + - GoogleDataTransport (7.4.0): + - nanopb (~> 1.30906.0) + - GoogleUtilities/AppDelegateSwizzler (6.7.2): - GoogleUtilities/Environment - GoogleUtilities/Logger - GoogleUtilities/Network - - GoogleUtilities/Environment (6.3.1) - - GoogleUtilities/Logger (6.3.1): + - GoogleUtilities/Environment (6.7.2): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (6.7.2): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (6.3.1): + - GoogleUtilities/MethodSwizzler (6.7.2): - GoogleUtilities/Logger - - GoogleUtilities/Network (6.3.1): + - GoogleUtilities/Network (6.7.2): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" - GoogleUtilities/Reachability - - "GoogleUtilities/NSData+zlib (6.3.1)" - - GoogleUtilities/Reachability (6.3.1): + - "GoogleUtilities/NSData+zlib (6.7.2)" + - GoogleUtilities/Reachability (6.7.2): - GoogleUtilities/Logger - - GoogleUtilities/UserDefaults (6.3.1): + - GoogleUtilities/UserDefaults (6.7.2): - GoogleUtilities/Logger - - "gRPC-C++ (0.0.9)": - - "gRPC-C++/Implementation (= 0.0.9)" - - "gRPC-C++/Interface (= 0.0.9)" - - "gRPC-C++/Implementation (0.0.9)": - - "gRPC-C++/Interface (= 0.0.9)" - - gRPC-Core (= 1.21.0) - - nanopb (~> 0.3) - - "gRPC-C++/Interface (0.0.9)" - - gRPC-Core (1.21.0): - - gRPC-Core/Implementation (= 1.21.0) - - gRPC-Core/Interface (= 1.21.0) - - gRPC-Core/Implementation (1.21.0): - - BoringSSL-GRPC (= 0.0.3) - - gRPC-Core/Interface (= 1.21.0) - - nanopb (~> 0.3) - - gRPC-Core/Interface (1.21.0) + - "gRPC-C++ (1.28.2)": + - "gRPC-C++/Implementation (= 1.28.2)" + - "gRPC-C++/Interface (= 1.28.2)" + - "gRPC-C++/Implementation (1.28.2)": + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - "gRPC-C++/Interface (= 1.28.2)" + - gRPC-Core (= 1.28.2) + - "gRPC-C++/Interface (1.28.2)" + - gRPC-Core (1.28.2): + - gRPC-Core/Implementation (= 1.28.2) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Implementation (1.28.2): + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - BoringSSL-GRPC (= 0.0.7) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Interface (1.28.2) - leveldb-library (1.22) - - nanopb (0.3.904): - - nanopb/decode (= 0.3.904) - - nanopb/encode (= 0.3.904) - - nanopb/decode (0.3.904) - - nanopb/encode (0.3.904) - - Protobuf (3.10.0) + - nanopb (1.30906.0): + - nanopb/decode (= 1.30906.0) + - nanopb/encode (= 1.30906.0) + - nanopb/decode (1.30906.0) + - nanopb/encode (1.30906.0) + - PromisesObjC (1.2.10) DEPENDENCIES: - Firebase/Core @@ -112,44 +326,40 @@ DEPENDENCIES: SPEC REPOS: trunk: + - abseil - BoringSSL-GRPC - Firebase - FirebaseAnalytics - - FirebaseAuthInterop - FirebaseCore - FirebaseCoreDiagnostics - - FirebaseCoreDiagnosticsInterop - FirebaseFirestore - - FirebaseInstanceID + - FirebaseInstallations - GoogleAppMeasurement - GoogleDataTransport - - GoogleDataTransportCCTSupport - GoogleUtilities - "gRPC-C++" - gRPC-Core - leveldb-library - nanopb - - Protobuf + - PromisesObjC SPEC CHECKSUMS: - BoringSSL-GRPC: db8764df3204ccea016e1c8dd15d9a9ad63ff318 - Firebase: bc9cfc7a96c73268656d5aaab453ff1b4b530e0e - FirebaseAnalytics: 0e3ecff2c5d86070f7d4325e21f1edabfbd558dc - FirebaseAuthInterop: 0ffa57668be100582bb7643d4fcb7615496c41fc - FirebaseCore: beeff42c07c30ea94702471d99db2089b594fbbd - FirebaseCoreDiagnostics: af29e43048607588c050889d19204f4d7b758c9f - FirebaseCoreDiagnosticsInterop: 6829da2b8d1fc795ff1bd99df751d3788035d2cb - FirebaseFirestore: bb8315fa13a15ea8977e940496b74ba6ad9071f2 - FirebaseInstanceID: ebd2ea79ee38db0cb5f5167b17a0d387e1cc7b6e - GoogleAppMeasurement: 434cc7be25e71dc04b8d0e3079125127b330e84a - GoogleDataTransport: 166f9b9f82cbf60a204e8fe2daa9db3e3ec1fb15 - GoogleDataTransportCCTSupport: f6ab1962e9dc05ab1fb938b795e5b310209edeec - GoogleUtilities: f895fde57977df4e0233edda0dbeac490e3703b6 - "gRPC-C++": 9dfe7b44821e7b3e44aacad2af29d2c21f7cde83 - gRPC-Core: c9aef9a261a1247e881b18059b84d597293c9947 + abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f + BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 + Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 + FirebaseAnalytics: 5dd088bd2e67bb9d13dbf792d1164ceaf3052193 + FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd + FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + FirebaseFirestore: adff4877869ca91a11250cc0989a6cd56bad163f + FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 + GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436 + GoogleDataTransport: b7f406340a291370045a270c599e53c6fa6ec20f + GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 + "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 + gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7 - nanopb: 06f6030d554e6473f5e172460173fcf80f5548f4 - Protobuf: a4dc852ad69c027ca2166ed287b856697814375b + nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc + PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151 PODFILE CHECKSUM: 08b990b6a0794354db9956ba6224a0f3aa758485 diff --git a/Pods/BoringSSL-GRPC/README.md b/Pods/BoringSSL-GRPC/README.md deleted file mode 100644 index b28e721c9..000000000 --- a/Pods/BoringSSL-GRPC/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# BoringSSL - -BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. - -Although BoringSSL is an open source project, it is not intended for general -use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing -so is likely to be frustrating because there are no guarantees of API or ABI -stability. - -Programs ship their own copies of BoringSSL when they use it and we update -everything as needed when deciding to make API changes. This allows us to -mostly avoid compromises in the name of compatibility. It works for us, but it -may not work for you. - -BoringSSL arose because Google used OpenSSL for many years in various ways and, -over time, built up a large number of patches that were maintained while -tracking upstream OpenSSL. As Google's product portfolio became more complex, -more copies of OpenSSL sprung up and the effort involved in maintaining all -these patches in multiple places was growing steadily. - -Currently BoringSSL is the SSL library in Chrome/Chromium, Android (but it's -not part of the NDK) and a number of other apps/programs. - -There are other files in this directory which might be helpful: - - * [PORTING.md](/PORTING.md): how to port OpenSSL-using code to BoringSSL. - * [BUILDING.md](/BUILDING.md): how to build BoringSSL - * [INCORPORATING.md](/INCORPORATING.md): how to incorporate BoringSSL into a project. - * [API-CONVENTIONS.md](/API-CONVENTIONS.md): general API conventions for BoringSSL consumers and developers. - * [STYLE.md](/STYLE.md): rules and guidelines for coding style. - * include/openssl: public headers with API documentation in comments. Also [available online](https://commondatastorage.googleapis.com/chromium-boringssl-docs/headers.html). - * [FUZZING.md](/FUZZING.md): information about fuzzing BoringSSL. - * [CONTRIBUTING.md](/CONTRIBUTING.md): how to contribute to BoringSSL. diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_d2i_fp.c b/Pods/BoringSSL-GRPC/crypto/asn1/a_d2i_fp.c deleted file mode 100644 index ab545992a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_d2i_fp.c +++ /dev/null @@ -1,297 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include -#include -#include - -static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb); - -#ifndef NO_OLD_ASN1 -# ifndef OPENSSL_NO_FP_API - -void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x) -{ - BIO *b; - void *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (NULL); - } - BIO_set_fp(b, in, BIO_NOCLOSE); - ret = ASN1_d2i_bio(xnew, d2i, b, x); - BIO_free(b); - return (ret); -} -# endif - -void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x) -{ - BUF_MEM *b = NULL; - const unsigned char *p; - void *ret = NULL; - int len; - - len = asn1_d2i_read_bio(in, &b); - if (len < 0) - goto err; - - p = (unsigned char *)b->data; - ret = d2i(x, &p, len); - err: - if (b != NULL) - BUF_MEM_free(b); - return (ret); -} - -#endif - -void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x) -{ - BUF_MEM *b = NULL; - const unsigned char *p; - void *ret = NULL; - int len; - - len = asn1_d2i_read_bio(in, &b); - if (len < 0) - goto err; - - p = (const unsigned char *)b->data; - ret = ASN1_item_d2i(x, &p, len, it); - err: - if (b != NULL) - BUF_MEM_free(b); - return (ret); -} - -#ifndef OPENSSL_NO_FP_API -void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x) -{ - BIO *b; - char *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (NULL); - } - BIO_set_fp(b, in, BIO_NOCLOSE); - ret = ASN1_item_d2i_bio(it, b, x); - BIO_free(b); - return (ret); -} -#endif - -typedef struct asn1_const_ctx_st - { - const unsigned char *p;/* work char pointer */ - int eos; /* end of sequence read for indefinite encoding */ - int error; /* error code to use when returning an error */ - int inf; /* constructed if 0x20, indefinite is 0x21 */ - int tag; /* tag from last 'get object' */ - int xclass; /* class from last 'get object' */ - long slen; /* length of last 'get object' */ - const unsigned char *max; /* largest value of p allowed */ - const unsigned char *q;/* temporary variable */ - const unsigned char **pp;/* variable */ - int line; /* used in error processing */ - } ASN1_const_CTX; - -#define HEADER_SIZE 8 -#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) -static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) -{ - BUF_MEM *b; - unsigned char *p; - int i; - ASN1_const_CTX c; - size_t want = HEADER_SIZE; - int eos = 0; - size_t off = 0; - size_t len = 0; - - b = BUF_MEM_new(); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - - ERR_clear_error(); - for (;;) { - if (want >= (len - off)) { - want -= (len - off); - - if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - goto err; - } - i = BIO_read(in, &(b->data[len]), want); - if ((i < 0) && ((len - off) == 0)) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); - goto err; - } - if (i > 0) { - if (len + i < len) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - len += i; - } - } - /* else data already loaded */ - - p = (unsigned char *)&(b->data[off]); - c.p = p; - c.inf = ASN1_get_object(&(c.p), &(c.slen), &(c.tag), &(c.xclass), - len - off); - if (c.inf & 0x80) { - uint32_t e; - - e = ERR_GET_REASON(ERR_peek_error()); - if (e != ASN1_R_TOO_LONG) - goto err; - else - ERR_clear_error(); /* clear error */ - } - i = c.p - p; /* header length */ - off += i; /* end of data */ - - if (c.inf & 1) { - /* no data body so go round again */ - eos++; - if (eos < 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_HEADER_TOO_LONG); - goto err; - } - want = HEADER_SIZE; - } else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC)) { - /* eos value, so go back and read another header */ - eos--; - if (eos <= 0) - break; - else - want = HEADER_SIZE; - } else { - /* suck in c.slen bytes of data */ - want = c.slen; - if (want > (len - off)) { - size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; - want -= (len - off); - if (want > INT_MAX /* BIO_read takes an int length */ || - len + want < len) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - while (want > 0) { - /* - * Read content in chunks of increasing size - * so we can return an error for EOF without - * having to allocate the entire content length - * in one go. - */ - size_t chunk = want > chunk_max ? chunk_max : want; - - if (!BUF_MEM_grow_clean(b, len + chunk)) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - goto err; - } - want -= chunk; - while (chunk > 0) { - i = BIO_read(in, &(b->data[len]), chunk); - if (i <= 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); - goto err; - } - /* - * This can't overflow because |len+want| didn't - * overflow. - */ - len += i; - chunk -= i; - } - if (chunk_max < INT_MAX/2) - chunk_max *= 2; - } - } - if (off + c.slen < off) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - off += c.slen; - if (eos <= 0) { - break; - } else - want = HEADER_SIZE; - } - } - - if (off > INT_MAX) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - - *pb = b; - return off; - err: - if (b != NULL) - BUF_MEM_free(b); - return -1; -} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_d2i_fp.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/asn1/a_d2i_fp.c.grpc_back deleted file mode 100644 index 3da6df9b0..000000000 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_d2i_fp.c.grpc_back +++ /dev/null @@ -1,297 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include -#include -#include - -static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb); - -#ifndef NO_OLD_ASN1 -# ifndef OPENSSL_NO_FP_API - -void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x) -{ - BIO *b; - void *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (NULL); - } - BIO_set_fp(b, in, BIO_NOCLOSE); - ret = ASN1_d2i_bio(xnew, d2i, b, x); - BIO_free(b); - return (ret); -} -# endif - -void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x) -{ - BUF_MEM *b = NULL; - const unsigned char *p; - void *ret = NULL; - int len; - - len = asn1_d2i_read_bio(in, &b); - if (len < 0) - goto err; - - p = (unsigned char *)b->data; - ret = d2i(x, &p, len); - err: - if (b != NULL) - BUF_MEM_free(b); - return (ret); -} - -#endif - -void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x) -{ - BUF_MEM *b = NULL; - const unsigned char *p; - void *ret = NULL; - int len; - - len = asn1_d2i_read_bio(in, &b); - if (len < 0) - goto err; - - p = (const unsigned char *)b->data; - ret = ASN1_item_d2i(x, &p, len, it); - err: - if (b != NULL) - BUF_MEM_free(b); - return (ret); -} - -#ifndef OPENSSL_NO_FP_API -void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x) -{ - BIO *b; - char *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (NULL); - } - BIO_set_fp(b, in, BIO_NOCLOSE); - ret = ASN1_item_d2i_bio(it, b, x); - BIO_free(b); - return (ret); -} -#endif - -typedef struct asn1_const_ctx_st - { - const unsigned char *p;/* work char pointer */ - int eos; /* end of sequence read for indefinite encoding */ - int error; /* error code to use when returning an error */ - int inf; /* constructed if 0x20, indefinite is 0x21 */ - int tag; /* tag from last 'get object' */ - int xclass; /* class from last 'get object' */ - long slen; /* length of last 'get object' */ - const unsigned char *max; /* largest value of p allowed */ - const unsigned char *q;/* temporary variable */ - const unsigned char **pp;/* variable */ - int line; /* used in error processing */ - } ASN1_const_CTX; - -#define HEADER_SIZE 8 -#define ASN1_CHUNK_INITIAL_SIZE (16 * 1024) -static int asn1_d2i_read_bio(BIO *in, BUF_MEM **pb) -{ - BUF_MEM *b; - unsigned char *p; - int i; - ASN1_const_CTX c; - size_t want = HEADER_SIZE; - int eos = 0; - size_t off = 0; - size_t len = 0; - - b = BUF_MEM_new(); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - - ERR_clear_error(); - for (;;) { - if (want >= (len - off)) { - want -= (len - off); - - if (len + want < len || !BUF_MEM_grow_clean(b, len + want)) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - goto err; - } - i = BIO_read(in, &(b->data[len]), want); - if ((i < 0) && ((len - off) == 0)) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); - goto err; - } - if (i > 0) { - if (len + i < len) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - len += i; - } - } - /* else data already loaded */ - - p = (unsigned char *)&(b->data[off]); - c.p = p; - c.inf = ASN1_get_object(&(c.p), &(c.slen), &(c.tag), &(c.xclass), - len - off); - if (c.inf & 0x80) { - uint32_t e; - - e = ERR_GET_REASON(ERR_peek_error()); - if (e != ASN1_R_TOO_LONG) - goto err; - else - ERR_clear_error(); /* clear error */ - } - i = c.p - p; /* header length */ - off += i; /* end of data */ - - if (c.inf & 1) { - /* no data body so go round again */ - eos++; - if (eos < 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_HEADER_TOO_LONG); - goto err; - } - want = HEADER_SIZE; - } else if (eos && (c.slen == 0) && (c.tag == V_ASN1_EOC)) { - /* eos value, so go back and read another header */ - eos--; - if (eos <= 0) - break; - else - want = HEADER_SIZE; - } else { - /* suck in c.slen bytes of data */ - want = c.slen; - if (want > (len - off)) { - size_t chunk_max = ASN1_CHUNK_INITIAL_SIZE; - want -= (len - off); - if (want > INT_MAX /* BIO_read takes an int length */ || - len + want < len) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - while (want > 0) { - /* - * Read content in chunks of increasing size - * so we can return an error for EOF without - * having to allocate the entire content length - * in one go. - */ - size_t chunk = want > chunk_max ? chunk_max : want; - - if (!BUF_MEM_grow_clean(b, len + chunk)) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - goto err; - } - want -= chunk; - while (chunk > 0) { - i = BIO_read(in, &(b->data[len]), chunk); - if (i <= 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); - goto err; - } - /* - * This can't overflow because |len+want| didn't - * overflow. - */ - len += i; - chunk -= i; - } - if (chunk_max < INT_MAX/2) - chunk_max *= 2; - } - } - if (off + c.slen < off) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - off += c.slen; - if (eos <= 0) { - break; - } else - want = HEADER_SIZE; - } - } - - if (off > INT_MAX) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); - goto err; - } - - *pb = b; - return off; - err: - if (b != NULL) - BUF_MEM_free(b); - return -1; -} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_i2d_fp.c b/Pods/BoringSSL-GRPC/crypto/asn1/a_i2d_fp.c deleted file mode 100644 index 61b6e6478..000000000 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_i2d_fp.c +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include -#include - -int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x) -{ - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (0); - } - BIO_set_fp(b, out, BIO_NOCLOSE); - ret = ASN1_i2d_bio(i2d, b, x); - BIO_free(b); - return (ret); -} - -int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, void *x) -{ - char *b; - unsigned char *p; - int i, j = 0, n, ret = 1; - - n = i2d(x, NULL); - if (n <= 0) - return 0; - - b = (char *)OPENSSL_malloc(n); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return (0); - } - - p = (unsigned char *)b; - i2d(x, &p); - - for (;;) { - i = BIO_write(out, &(b[j]), n); - if (i == n) - break; - if (i <= 0) { - ret = 0; - break; - } - j += i; - n -= i; - } - OPENSSL_free(b); - return (ret); -} - -int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) -{ - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (0); - } - BIO_set_fp(b, out, BIO_NOCLOSE); - ret = ASN1_item_i2d_bio(it, b, x); - BIO_free(b); - return (ret); -} - -int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) -{ - unsigned char *b = NULL; - int i, j = 0, n, ret = 1; - - n = ASN1_item_i2d(x, &b, it); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return (0); - } - - for (;;) { - i = BIO_write(out, &(b[j]), n); - if (i == n) - break; - if (i <= 0) { - ret = 0; - break; - } - j += i; - n -= i; - } - OPENSSL_free(b); - return (ret); -} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_i2d_fp.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/asn1/a_i2d_fp.c.grpc_back deleted file mode 100644 index 7b76d0c54..000000000 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_i2d_fp.c.grpc_back +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include -#include - -int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x) -{ - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (0); - } - BIO_set_fp(b, out, BIO_NOCLOSE); - ret = ASN1_i2d_bio(i2d, b, x); - BIO_free(b); - return (ret); -} - -int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, void *x) -{ - char *b; - unsigned char *p; - int i, j = 0, n, ret = 1; - - n = i2d(x, NULL); - if (n <= 0) - return 0; - - b = (char *)OPENSSL_malloc(n); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return (0); - } - - p = (unsigned char *)b; - i2d(x, &p); - - for (;;) { - i = BIO_write(out, &(b[j]), n); - if (i == n) - break; - if (i <= 0) { - ret = 0; - break; - } - j += i; - n -= i; - } - OPENSSL_free(b); - return (ret); -} - -int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) -{ - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); - return (0); - } - BIO_set_fp(b, out, BIO_NOCLOSE); - ret = ASN1_item_i2d_bio(it, b, x); - BIO_free(b); - return (ret); -} - -int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) -{ - unsigned char *b = NULL; - int i, j = 0, n, ret = 1; - - n = ASN1_item_i2d(x, &b, it); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return (0); - } - - for (;;) { - i = BIO_write(out, &(b[j]), n); - if (i == n) - break; - if (i <= 0) { - ret = 0; - break; - } - j += i; - n -= i; - } - OPENSSL_free(b); - return (ret); -} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_mbstr.c b/Pods/BoringSSL-GRPC/crypto/asn1/a_mbstr.c deleted file mode 100644 index 9bfdeba83..000000000 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_mbstr.c +++ /dev/null @@ -1,411 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include -#include - -#include "asn1_locl.h" - -static int traverse_string(const unsigned char *p, int len, int inform, - int (*rfunc) (uint32_t value, void *in), - void *arg); -static int in_utf8(uint32_t value, void *arg); -static int out_utf8(uint32_t value, void *arg); -static int type_str(uint32_t value, void *arg); -static int cpy_asc(uint32_t value, void *arg); -static int cpy_bmp(uint32_t value, void *arg); -static int cpy_univ(uint32_t value, void *arg); -static int cpy_utf8(uint32_t value, void *arg); -static int is_printable(uint32_t value); - -/* - * These functions take a string in UTF8, ASCII or multibyte form and a mask - * of permissible ASN1 string types. It then works out the minimal type - * (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and - * creates a string of the correct type with the supplied data. Yes this is - * horrible: it has to be :-( The 'ncopy' form checks minimum and maximum - * size limits too. - */ - -int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask) -{ - return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); -} - -int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask, - long minsize, long maxsize) -{ - int str_type; - int ret; - char free_out; - int outform, outlen = 0; - ASN1_STRING *dest; - unsigned char *p; - int nchar; - char strbuf[32]; - int (*cpyfunc) (uint32_t, void *) = NULL; - if (len == -1) - len = strlen((const char *)in); - if (!mask) - mask = DIRSTRING_TYPE; - - /* First do a string check and work out the number of characters */ - switch (inform) { - - case MBSTRING_BMP: - if (len & 1) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH); - return -1; - } - nchar = len >> 1; - break; - - case MBSTRING_UNIV: - if (len & 3) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH); - return -1; - } - nchar = len >> 2; - break; - - case MBSTRING_UTF8: - nchar = 0; - /* This counts the characters and does utf8 syntax checking */ - ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar); - if (ret < 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_UTF8STRING); - return -1; - } - break; - - case MBSTRING_ASC: - nchar = len; - break; - - default: - OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); - return -1; - } - - if ((minsize > 0) && (nchar < minsize)) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT); - BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize); - ERR_add_error_data(2, "minsize=", strbuf); - return -1; - } - - if ((maxsize > 0) && (nchar > maxsize)) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG); - BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize); - ERR_add_error_data(2, "maxsize=", strbuf); - return -1; - } - - /* Now work out minimal type (if any) */ - if (traverse_string(in, len, inform, type_str, &mask) < 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS); - return -1; - } - - /* Now work out output format and string type */ - outform = MBSTRING_ASC; - if (mask & B_ASN1_PRINTABLESTRING) - str_type = V_ASN1_PRINTABLESTRING; - else if (mask & B_ASN1_IA5STRING) - str_type = V_ASN1_IA5STRING; - else if (mask & B_ASN1_T61STRING) - str_type = V_ASN1_T61STRING; - else if (mask & B_ASN1_BMPSTRING) { - str_type = V_ASN1_BMPSTRING; - outform = MBSTRING_BMP; - } else if (mask & B_ASN1_UNIVERSALSTRING) { - str_type = V_ASN1_UNIVERSALSTRING; - outform = MBSTRING_UNIV; - } else { - str_type = V_ASN1_UTF8STRING; - outform = MBSTRING_UTF8; - } - if (!out) - return str_type; - if (*out) { - free_out = 0; - dest = *out; - if (dest->data) { - dest->length = 0; - OPENSSL_free(dest->data); - dest->data = NULL; - } - dest->type = str_type; - } else { - free_out = 1; - dest = ASN1_STRING_type_new(str_type); - if (!dest) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - *out = dest; - } - /* If both the same type just copy across */ - if (inform == outform) { - if (!ASN1_STRING_set(dest, in, len)) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - return str_type; - } - - /* Work out how much space the destination will need */ - switch (outform) { - case MBSTRING_ASC: - outlen = nchar; - cpyfunc = cpy_asc; - break; - - case MBSTRING_BMP: - outlen = nchar << 1; - cpyfunc = cpy_bmp; - break; - - case MBSTRING_UNIV: - outlen = nchar << 2; - cpyfunc = cpy_univ; - break; - - case MBSTRING_UTF8: - outlen = 0; - traverse_string(in, len, inform, out_utf8, &outlen); - cpyfunc = cpy_utf8; - break; - } - if (!(p = OPENSSL_malloc(outlen + 1))) { - if (free_out) - ASN1_STRING_free(dest); - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - dest->length = outlen; - dest->data = p; - p[outlen] = 0; - traverse_string(in, len, inform, cpyfunc, &p); - return str_type; -} - -/* - * This function traverses a string and passes the value of each character to - * an optional function along with a void * argument. - */ - -static int traverse_string(const unsigned char *p, int len, int inform, - int (*rfunc) (uint32_t value, void *in), - void *arg) -{ - uint32_t value; - int ret; - while (len) { - if (inform == MBSTRING_ASC) { - value = *p++; - len--; - } else if (inform == MBSTRING_BMP) { - value = *p++ << 8; - value |= *p++; - len -= 2; - } else if (inform == MBSTRING_UNIV) { - value = ((uint32_t)*p++) << 24; - value |= ((uint32_t)*p++) << 16; - value |= *p++ << 8; - value |= *p++; - len -= 4; - } else { - ret = UTF8_getc(p, len, &value); - if (ret < 0) - return -1; - len -= ret; - p += ret; - } - if (rfunc) { - ret = rfunc(value, arg); - if (ret <= 0) - return ret; - } - } - return 1; -} - -/* Various utility functions for traverse_string */ - -/* Just count number of characters */ - -static int in_utf8(uint32_t value, void *arg) -{ - int *nchar; - nchar = arg; - (*nchar)++; - return 1; -} - -/* Determine size of output as a UTF8 String */ - -static int out_utf8(uint32_t value, void *arg) -{ - int *outlen; - outlen = arg; - *outlen += UTF8_putc(NULL, -1, value); - return 1; -} - -/* - * Determine the "type" of a string: check each character against a supplied - * "mask". - */ - -static int type_str(uint32_t value, void *arg) -{ - unsigned long types; - types = *((unsigned long *)arg); - if ((types & B_ASN1_PRINTABLESTRING) && !is_printable(value)) - types &= ~B_ASN1_PRINTABLESTRING; - if ((types & B_ASN1_IA5STRING) && (value > 127)) - types &= ~B_ASN1_IA5STRING; - if ((types & B_ASN1_T61STRING) && (value > 0xff)) - types &= ~B_ASN1_T61STRING; - if ((types & B_ASN1_BMPSTRING) && (value > 0xffff)) - types &= ~B_ASN1_BMPSTRING; - if (!types) - return -1; - *((unsigned long *)arg) = types; - return 1; -} - -/* Copy one byte per character ASCII like strings */ - -static int cpy_asc(uint32_t value, void *arg) -{ - unsigned char **p, *q; - p = arg; - q = *p; - *q = (unsigned char)value; - (*p)++; - return 1; -} - -/* Copy two byte per character BMPStrings */ - -static int cpy_bmp(uint32_t value, void *arg) -{ - unsigned char **p, *q; - p = arg; - q = *p; - *q++ = (unsigned char)((value >> 8) & 0xff); - *q = (unsigned char)(value & 0xff); - *p += 2; - return 1; -} - -/* Copy four byte per character UniversalStrings */ - -static int cpy_univ(uint32_t value, void *arg) -{ - unsigned char **p, *q; - p = arg; - q = *p; - *q++ = (unsigned char)((value >> 24) & 0xff); - *q++ = (unsigned char)((value >> 16) & 0xff); - *q++ = (unsigned char)((value >> 8) & 0xff); - *q = (unsigned char)(value & 0xff); - *p += 4; - return 1; -} - -/* Copy to a UTF8String */ - -static int cpy_utf8(uint32_t value, void *arg) -{ - unsigned char **p; - int ret; - p = arg; - /* We already know there is enough room so pass 0xff as the length */ - ret = UTF8_putc(*p, 0xff, value); - *p += ret; - return 1; -} - -/* Return 1 if the character is permitted in a PrintableString */ -static int is_printable(uint32_t value) -{ - int ch; - if (value > 0x7f) - return 0; - ch = (int)value; - /* - * Note: we can't use 'isalnum' because certain accented characters may - * count as alphanumeric in some environments. - */ - if ((ch >= 'a') && (ch <= 'z')) - return 1; - if ((ch >= 'A') && (ch <= 'Z')) - return 1; - if ((ch >= '0') && (ch <= '9')) - return 1; - if ((ch == ' ') || strchr("'()+,-./:=?", ch)) - return 1; - return 0; -} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_mbstr.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/asn1/a_mbstr.c.grpc_back deleted file mode 100644 index a2789ed1e..000000000 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_mbstr.c.grpc_back +++ /dev/null @@ -1,411 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include -#include - -#include "asn1_locl.h" - -static int traverse_string(const unsigned char *p, int len, int inform, - int (*rfunc) (uint32_t value, void *in), - void *arg); -static int in_utf8(uint32_t value, void *arg); -static int out_utf8(uint32_t value, void *arg); -static int type_str(uint32_t value, void *arg); -static int cpy_asc(uint32_t value, void *arg); -static int cpy_bmp(uint32_t value, void *arg); -static int cpy_univ(uint32_t value, void *arg); -static int cpy_utf8(uint32_t value, void *arg); -static int is_printable(uint32_t value); - -/* - * These functions take a string in UTF8, ASCII or multibyte form and a mask - * of permissible ASN1 string types. It then works out the minimal type - * (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and - * creates a string of the correct type with the supplied data. Yes this is - * horrible: it has to be :-( The 'ncopy' form checks minimum and maximum - * size limits too. - */ - -int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask) -{ - return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); -} - -int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, - int inform, unsigned long mask, - long minsize, long maxsize) -{ - int str_type; - int ret; - char free_out; - int outform, outlen = 0; - ASN1_STRING *dest; - unsigned char *p; - int nchar; - char strbuf[32]; - int (*cpyfunc) (uint32_t, void *) = NULL; - if (len == -1) - len = strlen((const char *)in); - if (!mask) - mask = DIRSTRING_TYPE; - - /* First do a string check and work out the number of characters */ - switch (inform) { - - case MBSTRING_BMP: - if (len & 1) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_BMPSTRING_LENGTH); - return -1; - } - nchar = len >> 1; - break; - - case MBSTRING_UNIV: - if (len & 3) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_UNIVERSALSTRING_LENGTH); - return -1; - } - nchar = len >> 2; - break; - - case MBSTRING_UTF8: - nchar = 0; - /* This counts the characters and does utf8 syntax checking */ - ret = traverse_string(in, len, MBSTRING_UTF8, in_utf8, &nchar); - if (ret < 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_UTF8STRING); - return -1; - } - break; - - case MBSTRING_ASC: - nchar = len; - break; - - default: - OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); - return -1; - } - - if ((minsize > 0) && (nchar < minsize)) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT); - BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize); - ERR_add_error_data(2, "minsize=", strbuf); - return -1; - } - - if ((maxsize > 0) && (nchar > maxsize)) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG); - BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize); - ERR_add_error_data(2, "maxsize=", strbuf); - return -1; - } - - /* Now work out minimal type (if any) */ - if (traverse_string(in, len, inform, type_str, &mask) < 0) { - OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS); - return -1; - } - - /* Now work out output format and string type */ - outform = MBSTRING_ASC; - if (mask & B_ASN1_PRINTABLESTRING) - str_type = V_ASN1_PRINTABLESTRING; - else if (mask & B_ASN1_IA5STRING) - str_type = V_ASN1_IA5STRING; - else if (mask & B_ASN1_T61STRING) - str_type = V_ASN1_T61STRING; - else if (mask & B_ASN1_BMPSTRING) { - str_type = V_ASN1_BMPSTRING; - outform = MBSTRING_BMP; - } else if (mask & B_ASN1_UNIVERSALSTRING) { - str_type = V_ASN1_UNIVERSALSTRING; - outform = MBSTRING_UNIV; - } else { - str_type = V_ASN1_UTF8STRING; - outform = MBSTRING_UTF8; - } - if (!out) - return str_type; - if (*out) { - free_out = 0; - dest = *out; - if (dest->data) { - dest->length = 0; - OPENSSL_free(dest->data); - dest->data = NULL; - } - dest->type = str_type; - } else { - free_out = 1; - dest = ASN1_STRING_type_new(str_type); - if (!dest) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - *out = dest; - } - /* If both the same type just copy across */ - if (inform == outform) { - if (!ASN1_STRING_set(dest, in, len)) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - return str_type; - } - - /* Work out how much space the destination will need */ - switch (outform) { - case MBSTRING_ASC: - outlen = nchar; - cpyfunc = cpy_asc; - break; - - case MBSTRING_BMP: - outlen = nchar << 1; - cpyfunc = cpy_bmp; - break; - - case MBSTRING_UNIV: - outlen = nchar << 2; - cpyfunc = cpy_univ; - break; - - case MBSTRING_UTF8: - outlen = 0; - traverse_string(in, len, inform, out_utf8, &outlen); - cpyfunc = cpy_utf8; - break; - } - if (!(p = OPENSSL_malloc(outlen + 1))) { - if (free_out) - ASN1_STRING_free(dest); - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return -1; - } - dest->length = outlen; - dest->data = p; - p[outlen] = 0; - traverse_string(in, len, inform, cpyfunc, &p); - return str_type; -} - -/* - * This function traverses a string and passes the value of each character to - * an optional function along with a void * argument. - */ - -static int traverse_string(const unsigned char *p, int len, int inform, - int (*rfunc) (uint32_t value, void *in), - void *arg) -{ - uint32_t value; - int ret; - while (len) { - if (inform == MBSTRING_ASC) { - value = *p++; - len--; - } else if (inform == MBSTRING_BMP) { - value = *p++ << 8; - value |= *p++; - len -= 2; - } else if (inform == MBSTRING_UNIV) { - value = ((uint32_t)*p++) << 24; - value |= ((uint32_t)*p++) << 16; - value |= *p++ << 8; - value |= *p++; - len -= 4; - } else { - ret = UTF8_getc(p, len, &value); - if (ret < 0) - return -1; - len -= ret; - p += ret; - } - if (rfunc) { - ret = rfunc(value, arg); - if (ret <= 0) - return ret; - } - } - return 1; -} - -/* Various utility functions for traverse_string */ - -/* Just count number of characters */ - -static int in_utf8(uint32_t value, void *arg) -{ - int *nchar; - nchar = arg; - (*nchar)++; - return 1; -} - -/* Determine size of output as a UTF8 String */ - -static int out_utf8(uint32_t value, void *arg) -{ - int *outlen; - outlen = arg; - *outlen += UTF8_putc(NULL, -1, value); - return 1; -} - -/* - * Determine the "type" of a string: check each character against a supplied - * "mask". - */ - -static int type_str(uint32_t value, void *arg) -{ - unsigned long types; - types = *((unsigned long *)arg); - if ((types & B_ASN1_PRINTABLESTRING) && !is_printable(value)) - types &= ~B_ASN1_PRINTABLESTRING; - if ((types & B_ASN1_IA5STRING) && (value > 127)) - types &= ~B_ASN1_IA5STRING; - if ((types & B_ASN1_T61STRING) && (value > 0xff)) - types &= ~B_ASN1_T61STRING; - if ((types & B_ASN1_BMPSTRING) && (value > 0xffff)) - types &= ~B_ASN1_BMPSTRING; - if (!types) - return -1; - *((unsigned long *)arg) = types; - return 1; -} - -/* Copy one byte per character ASCII like strings */ - -static int cpy_asc(uint32_t value, void *arg) -{ - unsigned char **p, *q; - p = arg; - q = *p; - *q = (unsigned char)value; - (*p)++; - return 1; -} - -/* Copy two byte per character BMPStrings */ - -static int cpy_bmp(uint32_t value, void *arg) -{ - unsigned char **p, *q; - p = arg; - q = *p; - *q++ = (unsigned char)((value >> 8) & 0xff); - *q = (unsigned char)(value & 0xff); - *p += 2; - return 1; -} - -/* Copy four byte per character UniversalStrings */ - -static int cpy_univ(uint32_t value, void *arg) -{ - unsigned char **p, *q; - p = arg; - q = *p; - *q++ = (unsigned char)((value >> 24) & 0xff); - *q++ = (unsigned char)((value >> 16) & 0xff); - *q++ = (unsigned char)((value >> 8) & 0xff); - *q = (unsigned char)(value & 0xff); - *p += 4; - return 1; -} - -/* Copy to a UTF8String */ - -static int cpy_utf8(uint32_t value, void *arg) -{ - unsigned char **p; - int ret; - p = arg; - /* We already know there is enough room so pass 0xff as the length */ - ret = UTF8_putc(*p, 0xff, value); - *p += ret; - return 1; -} - -/* Return 1 if the character is permitted in a PrintableString */ -static int is_printable(uint32_t value) -{ - int ch; - if (value > 0x7f) - return 0; - ch = (int)value; - /* - * Note: we can't use 'isalnum' because certain accented characters may - * count as alphanumeric in some environments. - */ - if ((ch >= 'a') && (ch <= 'z')) - return 1; - if ((ch >= 'A') && (ch <= 'Z')) - return 1; - if ((ch >= '0') && (ch <= '9')) - return 1; - if ((ch == ' ') || strchr("'()+,-./:=?", ch)) - return 1; - return 0; -} diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/internal.h b/Pods/BoringSSL-GRPC/crypto/bytestring/internal.h deleted file mode 100644 index d46dfa979..000000000 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/internal.h +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_BYTESTRING_INTERNAL_H -#define OPENSSL_HEADER_BYTESTRING_INTERNAL_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// CBS_asn1_ber_to_der reads a BER element from |in|. If it finds -// indefinite-length elements or constructed strings then it converts the BER -// data to DER and sets |*out| and |*out_length| to describe a malloced buffer -// containing the DER data. Additionally, |*in| will be advanced over the BER -// element. -// -// If it doesn't find any indefinite-length elements or constructed strings then -// it sets |*out| to NULL and |*in| is unmodified. -// -// This function should successfully process any valid BER input, however it -// will not convert all of BER's deviations from DER. BER is ambiguous between -// implicitly-tagged SEQUENCEs of strings and implicitly-tagged constructed -// strings. Implicitly-tagged strings must be parsed with -// |CBS_get_ber_implicitly_tagged_string| instead of |CBS_get_asn1|. The caller -// must also account for BER variations in the contents of a primitive. -// -// It returns one on success and zero otherwise. -OPENSSL_EXPORT int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len); - -// CBS_get_asn1_implicit_string parses a BER string of primitive type -// |inner_tag| implicitly-tagged with |outer_tag|. It sets |out| to the -// contents. If concatenation was needed, it sets |*out_storage| to a buffer -// which the caller must release with |OPENSSL_free|. Otherwise, it sets -// |*out_storage| to NULL. -// -// This function does not parse all of BER. It requires the string be -// definite-length. Constructed strings are allowed, but all children of the -// outermost element must be primitive. The caller should use -// |CBS_asn1_ber_to_der| before running this function. -// -// It returns one on success and zero otherwise. -OPENSSL_EXPORT int CBS_get_asn1_implicit_string(CBS *in, CBS *out, - uint8_t **out_storage, - unsigned outer_tag, - unsigned inner_tag); - -// CBB_finish_i2d calls |CBB_finish| on |cbb| which must have been initialized -// with |CBB_init|. If |outp| is not NULL then the result is written to |*outp| -// and |*outp| is advanced just past the output. It returns the number of bytes -// in the result, whether written or not, or a negative value on error. On -// error, it calls |CBB_cleanup| on |cbb|. -// -// This function may be used to help implement legacy i2d ASN.1 functions. -int CBB_finish_i2d(CBB *cbb, uint8_t **outp); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_BYTESTRING_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/bytestring/internal.h.grpc_back deleted file mode 100644 index f6ac32cd9..000000000 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/internal.h.grpc_back +++ /dev/null @@ -1,75 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_BYTESTRING_INTERNAL_H -#define OPENSSL_HEADER_BYTESTRING_INTERNAL_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// CBS_asn1_ber_to_der reads a BER element from |in|. If it finds -// indefinite-length elements or constructed strings then it converts the BER -// data to DER and sets |*out| and |*out_length| to describe a malloced buffer -// containing the DER data. Additionally, |*in| will be advanced over the BER -// element. -// -// If it doesn't find any indefinite-length elements or constructed strings then -// it sets |*out| to NULL and |*in| is unmodified. -// -// This function should successfully process any valid BER input, however it -// will not convert all of BER's deviations from DER. BER is ambiguous between -// implicitly-tagged SEQUENCEs of strings and implicitly-tagged constructed -// strings. Implicitly-tagged strings must be parsed with -// |CBS_get_ber_implicitly_tagged_string| instead of |CBS_get_asn1|. The caller -// must also account for BER variations in the contents of a primitive. -// -// It returns one on success and zero otherwise. -OPENSSL_EXPORT int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len); - -// CBS_get_asn1_implicit_string parses a BER string of primitive type -// |inner_tag| implicitly-tagged with |outer_tag|. It sets |out| to the -// contents. If concatenation was needed, it sets |*out_storage| to a buffer -// which the caller must release with |OPENSSL_free|. Otherwise, it sets -// |*out_storage| to NULL. -// -// This function does not parse all of BER. It requires the string be -// definite-length. Constructed strings are allowed, but all children of the -// outermost element must be primitive. The caller should use -// |CBS_asn1_ber_to_der| before running this function. -// -// It returns one on success and zero otherwise. -OPENSSL_EXPORT int CBS_get_asn1_implicit_string(CBS *in, CBS *out, - uint8_t **out_storage, - unsigned outer_tag, - unsigned inner_tag); - -// CBB_finish_i2d calls |CBB_finish| on |cbb| which must have been initialized -// with |CBB_init|. If |outp| is not NULL then the result is written to |*outp| -// and |*outp| is advanced just past the output. It returns the number of bytes -// in the result, whether written or not, or a negative value on error. On -// error, it calls |CBB_cleanup| on |cbb|. -// -// This function may be used to help implement legacy i2d ASN.1 functions. -int CBB_finish_i2d(CBB *cbb, uint8_t **outp); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_BYTESTRING_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesccm.c b/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesccm.c deleted file mode 100644 index 2adbc0115..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesccm.c +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) 2018, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include -#include -#include - -#include "../fipsmodule/cipher/internal.h" - - -#define EVP_AEAD_AES_CCM_MAX_TAG_LEN 16 - -struct aead_aes_ccm_ctx { - union { - double align; - AES_KEY ks; - } ks; - CCM128_CONTEXT ccm; -}; - -static int aead_aes_ccm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, unsigned M, - unsigned L) { - assert(M == EVP_AEAD_max_overhead(ctx->aead)); - assert(M == EVP_AEAD_max_tag_len(ctx->aead)); - assert(15 - L == EVP_AEAD_nonce_length(ctx->aead)); - - if (key_len != EVP_AEAD_key_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); - return 0; // EVP_AEAD_CTX_init should catch this. - } - - if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { - tag_len = M; - } - - if (tag_len != M) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); - return 0; - } - - struct aead_aes_ccm_ctx *ccm_ctx = - OPENSSL_malloc(sizeof(struct aead_aes_ccm_ctx)); - if (ccm_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } - - block128_f block; - ctr128_f ctr = aes_ctr_set_key(&ccm_ctx->ks.ks, NULL, &block, key, key_len); - ctx->tag_len = tag_len; - if (!CRYPTO_ccm128_init(&ccm_ctx->ccm, &ccm_ctx->ks.ks, block, ctr, M, L)) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_INTERNAL_ERROR); - OPENSSL_free(ccm_ctx); - return 0; - } - - ctx->aead_state = ccm_ctx; - return 1; -} - -static void aead_aes_ccm_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static int aead_aes_ccm_seal_scatter( - const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ccm_ctx *ccm_ctx = ctx->aead_state; - - if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (max_out_tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - if (!CRYPTO_ccm128_encrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, out_tag, - ctx->tag_len, nonce, nonce_len, in, in_len, ad, - ad_len)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - *out_tag_len = ctx->tag_len; - return 1; -} - -static int aead_aes_ccm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *in_tag, size_t in_tag_len, - const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ccm_ctx *ccm_ctx = ctx->aead_state; - - if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - if (in_tag_len != ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - uint8_t tag[EVP_AEAD_AES_CCM_MAX_TAG_LEN]; - assert(ctx->tag_len <= EVP_AEAD_AES_CCM_MAX_TAG_LEN); - if (!CRYPTO_ccm128_decrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, tag, - ctx->tag_len, nonce, nonce_len, in, in_len, ad, - ad_len)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - return 1; -} - -static int aead_aes_ccm_bluetooth_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len) { - return aead_aes_ccm_init(ctx, key, key_len, tag_len, 4, 2); -} - -static const EVP_AEAD aead_aes_128_ccm_bluetooth = { - 16, // key length (AES-128) - 13, // nonce length - 4, // overhead - 4, // max tag length - 0, // seal_scatter_supports_extra_in - - aead_aes_ccm_bluetooth_init, - NULL /* init_with_direction */, - aead_aes_ccm_cleanup, - NULL /* open */, - aead_aes_ccm_seal_scatter, - aead_aes_ccm_open_gather, - NULL /* get_iv */, - NULL /* tag_len */, -}; - -const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth(void) { - return &aead_aes_128_ccm_bluetooth; -} - -static int aead_aes_ccm_bluetooth_8_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len) { - return aead_aes_ccm_init(ctx, key, key_len, tag_len, 8, 2); -} - -static const EVP_AEAD aead_aes_128_ccm_bluetooth_8 = { - 16, // key length (AES-128) - 13, // nonce length - 8, // overhead - 8, // max tag length - 0, // seal_scatter_supports_extra_in - - aead_aes_ccm_bluetooth_8_init, - NULL /* init_with_direction */, - aead_aes_ccm_cleanup, - NULL /* open */, - aead_aes_ccm_seal_scatter, - aead_aes_ccm_open_gather, - NULL /* get_iv */, - NULL /* tag_len */, -}; - -const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth_8(void) { - return &aead_aes_128_ccm_bluetooth_8; -} diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesccm.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesccm.c.grpc_back deleted file mode 100644 index 87f16dc6a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesccm.c.grpc_back +++ /dev/null @@ -1,203 +0,0 @@ -/* Copyright (c) 2018, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include -#include -#include - -#include "../fipsmodule/cipher/internal.h" - - -#define EVP_AEAD_AES_CCM_MAX_TAG_LEN 16 - -struct aead_aes_ccm_ctx { - union { - double align; - AES_KEY ks; - } ks; - CCM128_CONTEXT ccm; -}; - -static int aead_aes_ccm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, unsigned M, - unsigned L) { - assert(M == EVP_AEAD_max_overhead(ctx->aead)); - assert(M == EVP_AEAD_max_tag_len(ctx->aead)); - assert(15 - L == EVP_AEAD_nonce_length(ctx->aead)); - - if (key_len != EVP_AEAD_key_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); - return 0; // EVP_AEAD_CTX_init should catch this. - } - - if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { - tag_len = M; - } - - if (tag_len != M) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); - return 0; - } - - struct aead_aes_ccm_ctx *ccm_ctx = - OPENSSL_malloc(sizeof(struct aead_aes_ccm_ctx)); - if (ccm_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } - - block128_f block; - ctr128_f ctr = aes_ctr_set_key(&ccm_ctx->ks.ks, NULL, &block, key, key_len); - ctx->tag_len = tag_len; - if (!CRYPTO_ccm128_init(&ccm_ctx->ccm, &ccm_ctx->ks.ks, block, ctr, M, L)) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_INTERNAL_ERROR); - OPENSSL_free(ccm_ctx); - return 0; - } - - ctx->aead_state = ccm_ctx; - return 1; -} - -static void aead_aes_ccm_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static int aead_aes_ccm_seal_scatter( - const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ccm_ctx *ccm_ctx = ctx->aead_state; - - if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (max_out_tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - if (!CRYPTO_ccm128_encrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, out_tag, - ctx->tag_len, nonce, nonce_len, in, in_len, ad, - ad_len)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - *out_tag_len = ctx->tag_len; - return 1; -} - -static int aead_aes_ccm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *in_tag, size_t in_tag_len, - const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ccm_ctx *ccm_ctx = ctx->aead_state; - - if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - if (in_tag_len != ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - uint8_t tag[EVP_AEAD_AES_CCM_MAX_TAG_LEN]; - assert(ctx->tag_len <= EVP_AEAD_AES_CCM_MAX_TAG_LEN); - if (!CRYPTO_ccm128_decrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, tag, - ctx->tag_len, nonce, nonce_len, in, in_len, ad, - ad_len)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - return 1; -} - -static int aead_aes_ccm_bluetooth_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len) { - return aead_aes_ccm_init(ctx, key, key_len, tag_len, 4, 2); -} - -static const EVP_AEAD aead_aes_128_ccm_bluetooth = { - 16, // key length (AES-128) - 13, // nonce length - 4, // overhead - 4, // max tag length - 0, // seal_scatter_supports_extra_in - - aead_aes_ccm_bluetooth_init, - NULL /* init_with_direction */, - aead_aes_ccm_cleanup, - NULL /* open */, - aead_aes_ccm_seal_scatter, - aead_aes_ccm_open_gather, - NULL /* get_iv */, - NULL /* tag_len */, -}; - -const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth(void) { - return &aead_aes_128_ccm_bluetooth; -} - -static int aead_aes_ccm_bluetooth_8_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len) { - return aead_aes_ccm_init(ctx, key, key_len, tag_len, 8, 2); -} - -static const EVP_AEAD aead_aes_128_ccm_bluetooth_8 = { - 16, // key length (AES-128) - 13, // nonce length - 8, // overhead - 8, // max tag length - 0, // seal_scatter_supports_extra_in - - aead_aes_ccm_bluetooth_8_init, - NULL /* init_with_direction */, - aead_aes_ccm_cleanup, - NULL /* open */, - aead_aes_ccm_seal_scatter, - aead_aes_ccm_open_gather, - NULL /* get_iv */, - NULL /* tag_len */, -}; - -const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth_8(void) { - return &aead_aes_128_ccm_bluetooth_8; -} diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_chacha20poly1305.c b/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_chacha20poly1305.c deleted file mode 100644 index fb81ba001..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_chacha20poly1305.c +++ /dev/null @@ -1,326 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../fipsmodule/cipher/internal.h" -#include "../internal.h" - - -#define POLY1305_TAG_LEN 16 - -struct aead_chacha20_poly1305_ctx { - uint8_t key[32]; -}; - -// For convenience (the x86_64 calling convention allows only six parameters in -// registers), the final parameter for the assembly functions is both an input -// and output parameter. -union open_data { - struct { - alignas(16) uint8_t key[32]; - uint32_t counter; - uint8_t nonce[12]; - } in; - struct { - uint8_t tag[POLY1305_TAG_LEN]; - } out; -}; - -union seal_data { - struct { - alignas(16) uint8_t key[32]; - uint32_t counter; - uint8_t nonce[12]; - const uint8_t *extra_ciphertext; - size_t extra_ciphertext_len; - } in; - struct { - uint8_t tag[POLY1305_TAG_LEN]; - } out; -}; - -#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ - !defined(OPENSSL_WINDOWS) -static int asm_capable(void) { - const int sse41_capable = (OPENSSL_ia32cap_P[1] & (1 << 19)) != 0; - return sse41_capable; -} - -OPENSSL_COMPILE_ASSERT(sizeof(union open_data) == 48, wrong_open_data_size); -OPENSSL_COMPILE_ASSERT(sizeof(union seal_data) == 48 + 8 + 8, - wrong_seal_data_size); - -// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It decrypts -// |plaintext_len| bytes from |ciphertext| and writes them to |out_plaintext|. -// Additional input parameters are passed in |aead_data->in|. On exit, it will -// write calculated tag value to |aead_data->out.tag|, which the caller must -// check. -extern void chacha20_poly1305_open(uint8_t *out_plaintext, - const uint8_t *ciphertext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union open_data *aead_data); - -// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It encrypts -// |plaintext_len| bytes from |plaintext| and writes them to |out_ciphertext|. -// Additional input parameters are passed in |aead_data->in|. The calculated tag -// value is over the computed ciphertext concatenated with |extra_ciphertext| -// and written to |aead_data->out.tag|. -extern void chacha20_poly1305_seal(uint8_t *out_ciphertext, - const uint8_t *plaintext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union seal_data *aead_data); -#else -static int asm_capable(void) { return 0; } - - -static void chacha20_poly1305_open(uint8_t *out_plaintext, - const uint8_t *ciphertext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union open_data *aead_data) {} - -static void chacha20_poly1305_seal(uint8_t *out_ciphertext, - const uint8_t *plaintext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union seal_data *aead_data) {} -#endif - -static int aead_chacha20_poly1305_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len) { - struct aead_chacha20_poly1305_ctx *c20_ctx; - - if (tag_len == 0) { - tag_len = POLY1305_TAG_LEN; - } - - if (tag_len > POLY1305_TAG_LEN) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (key_len != sizeof(c20_ctx->key)) { - return 0; // internal error - EVP_AEAD_CTX_init should catch this. - } - - c20_ctx = OPENSSL_malloc(sizeof(struct aead_chacha20_poly1305_ctx)); - if (c20_ctx == NULL) { - return 0; - } - - OPENSSL_memcpy(c20_ctx->key, key, key_len); - ctx->aead_state = c20_ctx; - ctx->tag_len = tag_len; - - return 1; -} - -static void aead_chacha20_poly1305_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static void poly1305_update_length(poly1305_state *poly1305, size_t data_len) { - uint8_t length_bytes[8]; - - for (unsigned i = 0; i < sizeof(length_bytes); i++) { - length_bytes[i] = data_len; - data_len >>= 8; - } - - CRYPTO_poly1305_update(poly1305, length_bytes, sizeof(length_bytes)); -} - -// calc_tag fills |tag| with the authentication tag for the given inputs. -static void calc_tag(uint8_t tag[POLY1305_TAG_LEN], - const struct aead_chacha20_poly1305_ctx *c20_ctx, - const uint8_t nonce[12], const uint8_t *ad, size_t ad_len, - const uint8_t *ciphertext, size_t ciphertext_len, - const uint8_t *ciphertext_extra, - size_t ciphertext_extra_len) { - alignas(16) uint8_t poly1305_key[32]; - OPENSSL_memset(poly1305_key, 0, sizeof(poly1305_key)); - CRYPTO_chacha_20(poly1305_key, poly1305_key, sizeof(poly1305_key), - c20_ctx->key, nonce, 0); - - static const uint8_t padding[16] = { 0 }; // Padding is all zeros. - poly1305_state ctx; - CRYPTO_poly1305_init(&ctx, poly1305_key); - CRYPTO_poly1305_update(&ctx, ad, ad_len); - if (ad_len % 16 != 0) { - CRYPTO_poly1305_update(&ctx, padding, sizeof(padding) - (ad_len % 16)); - } - CRYPTO_poly1305_update(&ctx, ciphertext, ciphertext_len); - CRYPTO_poly1305_update(&ctx, ciphertext_extra, ciphertext_extra_len); - const size_t ciphertext_total = ciphertext_len + ciphertext_extra_len; - if (ciphertext_total % 16 != 0) { - CRYPTO_poly1305_update(&ctx, padding, - sizeof(padding) - (ciphertext_total % 16)); - } - poly1305_update_length(&ctx, ad_len); - poly1305_update_length(&ctx, ciphertext_total); - CRYPTO_poly1305_finish(&ctx, tag); -} - -static int aead_chacha20_poly1305_seal_scatter( - const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; - - if (extra_in_len + ctx->tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - if (max_out_tag_len < ctx->tag_len + extra_in_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - if (nonce_len != 12) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); - return 0; - } - - // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow - // individual operations that work on more than 256GB at a time. - // |in_len_64| is needed because, on 32-bit platforms, size_t is only - // 32-bits and this produces a warning because it's always false. - // Casting to uint64_t inside the conditional is not sufficient to stop - // the warning. - const uint64_t in_len_64 = in_len; - if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (max_out_tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - // The the extra input is given, it is expected to be very short and so is - // encrypted byte-by-byte first. - if (extra_in_len) { - static const size_t kChaChaBlockSize = 64; - uint32_t block_counter = 1 + (in_len / kChaChaBlockSize); - size_t offset = in_len % kChaChaBlockSize; - uint8_t block[64 /* kChaChaBlockSize */]; - - for (size_t done = 0; done < extra_in_len; block_counter++) { - memset(block, 0, sizeof(block)); - CRYPTO_chacha_20(block, block, sizeof(block), c20_ctx->key, nonce, - block_counter); - for (size_t i = offset; i < sizeof(block) && done < extra_in_len; - i++, done++) { - out_tag[done] = extra_in[done] ^ block[i]; - } - offset = 0; - } - } - - union seal_data data; - if (asm_capable()) { - OPENSSL_memcpy(data.in.key, c20_ctx->key, 32); - data.in.counter = 0; - OPENSSL_memcpy(data.in.nonce, nonce, 12); - data.in.extra_ciphertext = out_tag; - data.in.extra_ciphertext_len = extra_in_len; - chacha20_poly1305_seal(out, in, in_len, ad, ad_len, &data); - } else { - CRYPTO_chacha_20(out, in, in_len, c20_ctx->key, nonce, 1); - calc_tag(data.out.tag, c20_ctx, nonce, ad, ad_len, out, in_len, out_tag, - extra_in_len); - } - - OPENSSL_memcpy(out_tag + extra_in_len, data.out.tag, ctx->tag_len); - *out_tag_len = extra_in_len + ctx->tag_len; - return 1; -} - -static int aead_chacha20_poly1305_open_gather( - const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, - size_t in_tag_len, const uint8_t *ad, size_t ad_len) { - const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; - - if (nonce_len != 12) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); - return 0; - } - - if (in_tag_len != ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow - // individual operations that work on more than 256GB at a time. - // |in_len_64| is needed because, on 32-bit platforms, size_t is only - // 32-bits and this produces a warning because it's always false. - // Casting to uint64_t inside the conditional is not sufficient to stop - // the warning. - const uint64_t in_len_64 = in_len; - if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - union open_data data; - if (asm_capable()) { - OPENSSL_memcpy(data.in.key, c20_ctx->key, 32); - data.in.counter = 0; - OPENSSL_memcpy(data.in.nonce, nonce, 12); - chacha20_poly1305_open(out, in, in_len, ad, ad_len, &data); - } else { - calc_tag(data.out.tag, c20_ctx, nonce, ad, ad_len, in, in_len, NULL, 0); - CRYPTO_chacha_20(out, in, in_len, c20_ctx->key, nonce, 1); - } - - if (CRYPTO_memcmp(data.out.tag, in_tag, ctx->tag_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - return 1; -} - -static const EVP_AEAD aead_chacha20_poly1305 = { - 32, // key len - 12, // nonce len - POLY1305_TAG_LEN, // overhead - POLY1305_TAG_LEN, // max tag length - 1, // seal_scatter_supports_extra_in - - aead_chacha20_poly1305_init, - NULL, // init_with_direction - aead_chacha20_poly1305_cleanup, - NULL /* open */, - aead_chacha20_poly1305_seal_scatter, - aead_chacha20_poly1305_open_gather, - NULL, // get_iv - NULL, // tag_len -}; - -const EVP_AEAD *EVP_aead_chacha20_poly1305(void) { - return &aead_chacha20_poly1305; -} diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back deleted file mode 100644 index 64ab457e1..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back +++ /dev/null @@ -1,326 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../fipsmodule/cipher/internal.h" -#include "../internal.h" - - -#define POLY1305_TAG_LEN 16 - -struct aead_chacha20_poly1305_ctx { - uint8_t key[32]; -}; - -// For convenience (the x86_64 calling convention allows only six parameters in -// registers), the final parameter for the assembly functions is both an input -// and output parameter. -union open_data { - struct { - alignas(16) uint8_t key[32]; - uint32_t counter; - uint8_t nonce[12]; - } in; - struct { - uint8_t tag[POLY1305_TAG_LEN]; - } out; -}; - -union seal_data { - struct { - alignas(16) uint8_t key[32]; - uint32_t counter; - uint8_t nonce[12]; - const uint8_t *extra_ciphertext; - size_t extra_ciphertext_len; - } in; - struct { - uint8_t tag[POLY1305_TAG_LEN]; - } out; -}; - -#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ - !defined(OPENSSL_WINDOWS) -static int asm_capable(void) { - const int sse41_capable = (OPENSSL_ia32cap_P[1] & (1 << 19)) != 0; - return sse41_capable; -} - -OPENSSL_COMPILE_ASSERT(sizeof(union open_data) == 48, wrong_open_data_size); -OPENSSL_COMPILE_ASSERT(sizeof(union seal_data) == 48 + 8 + 8, - wrong_seal_data_size); - -// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It decrypts -// |plaintext_len| bytes from |ciphertext| and writes them to |out_plaintext|. -// Additional input parameters are passed in |aead_data->in|. On exit, it will -// write calculated tag value to |aead_data->out.tag|, which the caller must -// check. -extern void chacha20_poly1305_open(uint8_t *out_plaintext, - const uint8_t *ciphertext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union open_data *aead_data); - -// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It encrypts -// |plaintext_len| bytes from |plaintext| and writes them to |out_ciphertext|. -// Additional input parameters are passed in |aead_data->in|. The calculated tag -// value is over the computed ciphertext concatenated with |extra_ciphertext| -// and written to |aead_data->out.tag|. -extern void chacha20_poly1305_seal(uint8_t *out_ciphertext, - const uint8_t *plaintext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union seal_data *aead_data); -#else -static int asm_capable(void) { return 0; } - - -static void chacha20_poly1305_open(uint8_t *out_plaintext, - const uint8_t *ciphertext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union open_data *aead_data) {} - -static void chacha20_poly1305_seal(uint8_t *out_ciphertext, - const uint8_t *plaintext, - size_t plaintext_len, const uint8_t *ad, - size_t ad_len, union seal_data *aead_data) {} -#endif - -static int aead_chacha20_poly1305_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len) { - struct aead_chacha20_poly1305_ctx *c20_ctx; - - if (tag_len == 0) { - tag_len = POLY1305_TAG_LEN; - } - - if (tag_len > POLY1305_TAG_LEN) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (key_len != sizeof(c20_ctx->key)) { - return 0; // internal error - EVP_AEAD_CTX_init should catch this. - } - - c20_ctx = OPENSSL_malloc(sizeof(struct aead_chacha20_poly1305_ctx)); - if (c20_ctx == NULL) { - return 0; - } - - OPENSSL_memcpy(c20_ctx->key, key, key_len); - ctx->aead_state = c20_ctx; - ctx->tag_len = tag_len; - - return 1; -} - -static void aead_chacha20_poly1305_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static void poly1305_update_length(poly1305_state *poly1305, size_t data_len) { - uint8_t length_bytes[8]; - - for (unsigned i = 0; i < sizeof(length_bytes); i++) { - length_bytes[i] = data_len; - data_len >>= 8; - } - - CRYPTO_poly1305_update(poly1305, length_bytes, sizeof(length_bytes)); -} - -// calc_tag fills |tag| with the authentication tag for the given inputs. -static void calc_tag(uint8_t tag[POLY1305_TAG_LEN], - const struct aead_chacha20_poly1305_ctx *c20_ctx, - const uint8_t nonce[12], const uint8_t *ad, size_t ad_len, - const uint8_t *ciphertext, size_t ciphertext_len, - const uint8_t *ciphertext_extra, - size_t ciphertext_extra_len) { - alignas(16) uint8_t poly1305_key[32]; - OPENSSL_memset(poly1305_key, 0, sizeof(poly1305_key)); - CRYPTO_chacha_20(poly1305_key, poly1305_key, sizeof(poly1305_key), - c20_ctx->key, nonce, 0); - - static const uint8_t padding[16] = { 0 }; // Padding is all zeros. - poly1305_state ctx; - CRYPTO_poly1305_init(&ctx, poly1305_key); - CRYPTO_poly1305_update(&ctx, ad, ad_len); - if (ad_len % 16 != 0) { - CRYPTO_poly1305_update(&ctx, padding, sizeof(padding) - (ad_len % 16)); - } - CRYPTO_poly1305_update(&ctx, ciphertext, ciphertext_len); - CRYPTO_poly1305_update(&ctx, ciphertext_extra, ciphertext_extra_len); - const size_t ciphertext_total = ciphertext_len + ciphertext_extra_len; - if (ciphertext_total % 16 != 0) { - CRYPTO_poly1305_update(&ctx, padding, - sizeof(padding) - (ciphertext_total % 16)); - } - poly1305_update_length(&ctx, ad_len); - poly1305_update_length(&ctx, ciphertext_total); - CRYPTO_poly1305_finish(&ctx, tag); -} - -static int aead_chacha20_poly1305_seal_scatter( - const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; - - if (extra_in_len + ctx->tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - if (max_out_tag_len < ctx->tag_len + extra_in_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - if (nonce_len != 12) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); - return 0; - } - - // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow - // individual operations that work on more than 256GB at a time. - // |in_len_64| is needed because, on 32-bit platforms, size_t is only - // 32-bits and this produces a warning because it's always false. - // Casting to uint64_t inside the conditional is not sufficient to stop - // the warning. - const uint64_t in_len_64 = in_len; - if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (max_out_tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - // The the extra input is given, it is expected to be very short and so is - // encrypted byte-by-byte first. - if (extra_in_len) { - static const size_t kChaChaBlockSize = 64; - uint32_t block_counter = 1 + (in_len / kChaChaBlockSize); - size_t offset = in_len % kChaChaBlockSize; - uint8_t block[64 /* kChaChaBlockSize */]; - - for (size_t done = 0; done < extra_in_len; block_counter++) { - memset(block, 0, sizeof(block)); - CRYPTO_chacha_20(block, block, sizeof(block), c20_ctx->key, nonce, - block_counter); - for (size_t i = offset; i < sizeof(block) && done < extra_in_len; - i++, done++) { - out_tag[done] = extra_in[done] ^ block[i]; - } - offset = 0; - } - } - - union seal_data data; - if (asm_capable()) { - OPENSSL_memcpy(data.in.key, c20_ctx->key, 32); - data.in.counter = 0; - OPENSSL_memcpy(data.in.nonce, nonce, 12); - data.in.extra_ciphertext = out_tag; - data.in.extra_ciphertext_len = extra_in_len; - chacha20_poly1305_seal(out, in, in_len, ad, ad_len, &data); - } else { - CRYPTO_chacha_20(out, in, in_len, c20_ctx->key, nonce, 1); - calc_tag(data.out.tag, c20_ctx, nonce, ad, ad_len, out, in_len, out_tag, - extra_in_len); - } - - OPENSSL_memcpy(out_tag + extra_in_len, data.out.tag, ctx->tag_len); - *out_tag_len = extra_in_len + ctx->tag_len; - return 1; -} - -static int aead_chacha20_poly1305_open_gather( - const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, - size_t in_tag_len, const uint8_t *ad, size_t ad_len) { - const struct aead_chacha20_poly1305_ctx *c20_ctx = ctx->aead_state; - - if (nonce_len != 12) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); - return 0; - } - - if (in_tag_len != ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow - // individual operations that work on more than 256GB at a time. - // |in_len_64| is needed because, on 32-bit platforms, size_t is only - // 32-bits and this produces a warning because it's always false. - // Casting to uint64_t inside the conditional is not sufficient to stop - // the warning. - const uint64_t in_len_64 = in_len; - if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - union open_data data; - if (asm_capable()) { - OPENSSL_memcpy(data.in.key, c20_ctx->key, 32); - data.in.counter = 0; - OPENSSL_memcpy(data.in.nonce, nonce, 12); - chacha20_poly1305_open(out, in, in_len, ad, ad_len, &data); - } else { - calc_tag(data.out.tag, c20_ctx, nonce, ad, ad_len, in, in_len, NULL, 0); - CRYPTO_chacha_20(out, in, in_len, c20_ctx->key, nonce, 1); - } - - if (CRYPTO_memcmp(data.out.tag, in_tag, ctx->tag_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - return 1; -} - -static const EVP_AEAD aead_chacha20_poly1305 = { - 32, // key len - 12, // nonce len - POLY1305_TAG_LEN, // overhead - POLY1305_TAG_LEN, // max tag length - 1, // seal_scatter_supports_extra_in - - aead_chacha20_poly1305_init, - NULL, // init_with_direction - aead_chacha20_poly1305_cleanup, - NULL /* open */, - aead_chacha20_poly1305_seal_scatter, - aead_chacha20_poly1305_open_gather, - NULL, // get_iv - NULL, // tag_len -}; - -const EVP_AEAD *EVP_aead_chacha20_poly1305(void) { - return &aead_chacha20_poly1305; -} diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_ssl3.c b/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_ssl3.c deleted file mode 100644 index a4464e8a4..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_ssl3.c +++ /dev/null @@ -1,460 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../internal.h" -#include "../fipsmodule/cipher/internal.h" - - -typedef struct { - EVP_CIPHER_CTX cipher_ctx; - EVP_MD_CTX md_ctx; -} AEAD_SSL3_CTX; - -static int ssl3_mac(AEAD_SSL3_CTX *ssl3_ctx, uint8_t *out, unsigned *out_len, - const uint8_t *ad, size_t ad_len, const uint8_t *in, - size_t in_len) { - size_t md_size = EVP_MD_CTX_size(&ssl3_ctx->md_ctx); - size_t pad_len = (md_size == 20) ? 40 : 48; - - // To allow for CBC mode which changes cipher length, |ad| doesn't include the - // length for legacy ciphers. - uint8_t ad_extra[2]; - ad_extra[0] = (uint8_t)(in_len >> 8); - ad_extra[1] = (uint8_t)(in_len & 0xff); - - EVP_MD_CTX md_ctx; - EVP_MD_CTX_init(&md_ctx); - - uint8_t pad[48]; - uint8_t tmp[EVP_MAX_MD_SIZE]; - OPENSSL_memset(pad, 0x36, pad_len); - if (!EVP_MD_CTX_copy_ex(&md_ctx, &ssl3_ctx->md_ctx) || - !EVP_DigestUpdate(&md_ctx, pad, pad_len) || - !EVP_DigestUpdate(&md_ctx, ad, ad_len) || - !EVP_DigestUpdate(&md_ctx, ad_extra, sizeof(ad_extra)) || - !EVP_DigestUpdate(&md_ctx, in, in_len) || - !EVP_DigestFinal_ex(&md_ctx, tmp, NULL)) { - EVP_MD_CTX_cleanup(&md_ctx); - return 0; - } - - OPENSSL_memset(pad, 0x5c, pad_len); - if (!EVP_MD_CTX_copy_ex(&md_ctx, &ssl3_ctx->md_ctx) || - !EVP_DigestUpdate(&md_ctx, pad, pad_len) || - !EVP_DigestUpdate(&md_ctx, tmp, md_size) || - !EVP_DigestFinal_ex(&md_ctx, out, out_len)) { - EVP_MD_CTX_cleanup(&md_ctx); - return 0; - } - EVP_MD_CTX_cleanup(&md_ctx); - return 1; -} - -static void aead_ssl3_cleanup(EVP_AEAD_CTX *ctx) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - EVP_CIPHER_CTX_cleanup(&ssl3_ctx->cipher_ctx); - EVP_MD_CTX_cleanup(&ssl3_ctx->md_ctx); - OPENSSL_free(ssl3_ctx); - ctx->aead_state = NULL; -} - -static int aead_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, - size_t tag_len, enum evp_aead_direction_t dir, - const EVP_CIPHER *cipher, const EVP_MD *md) { - if (tag_len != EVP_AEAD_DEFAULT_TAG_LENGTH && - tag_len != EVP_MD_size(md)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_TAG_SIZE); - return 0; - } - - if (key_len != EVP_AEAD_key_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); - return 0; - } - - size_t mac_key_len = EVP_MD_size(md); - size_t enc_key_len = EVP_CIPHER_key_length(cipher); - assert(mac_key_len + enc_key_len + EVP_CIPHER_iv_length(cipher) == key_len); - - AEAD_SSL3_CTX *ssl3_ctx = OPENSSL_malloc(sizeof(AEAD_SSL3_CTX)); - if (ssl3_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } - EVP_CIPHER_CTX_init(&ssl3_ctx->cipher_ctx); - EVP_MD_CTX_init(&ssl3_ctx->md_ctx); - - ctx->aead_state = ssl3_ctx; - if (!EVP_CipherInit_ex(&ssl3_ctx->cipher_ctx, cipher, NULL, &key[mac_key_len], - &key[mac_key_len + enc_key_len], - dir == evp_aead_seal) || - !EVP_DigestInit_ex(&ssl3_ctx->md_ctx, md, NULL) || - !EVP_DigestUpdate(&ssl3_ctx->md_ctx, key, mac_key_len)) { - aead_ssl3_cleanup(ctx); - ctx->aead_state = NULL; - return 0; - } - EVP_CIPHER_CTX_set_padding(&ssl3_ctx->cipher_ctx, 0); - - return 1; -} - -static size_t aead_ssl3_tag_len(const EVP_AEAD_CTX *ctx, const size_t in_len, - const size_t extra_in_len) { - assert(extra_in_len == 0); - const AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX*)ctx->aead_state; - - const size_t digest_len = EVP_MD_CTX_size(&ssl3_ctx->md_ctx); - if (EVP_CIPHER_CTX_mode(&ssl3_ctx->cipher_ctx) != EVP_CIPH_CBC_MODE) { - // The NULL cipher. - return digest_len; - } - - const size_t block_size = EVP_CIPHER_CTX_block_size(&ssl3_ctx->cipher_ctx); - // An overflow of |in_len + digest_len| doesn't affect the result mod - // |block_size|, provided that |block_size| is a smaller power of two. - assert(block_size != 0 && (block_size & (block_size - 1)) == 0); - const size_t pad_len = block_size - ((in_len + digest_len) % block_size); - return digest_len + pad_len; -} - -static int aead_ssl3_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, - uint8_t *out_tag, size_t *out_tag_len, - const size_t max_out_tag_len, - const uint8_t *nonce, const size_t nonce_len, - const uint8_t *in, const size_t in_len, - const uint8_t *extra_in, - const size_t extra_in_len, const uint8_t *ad, - const size_t ad_len) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - - if (!ssl3_ctx->cipher_ctx.encrypt) { - // Unlike a normal AEAD, an SSL3 AEAD may only be used in one direction. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); - return 0; - } - - if (in_len > INT_MAX) { - // EVP_CIPHER takes int as input. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (max_out_tag_len < aead_ssl3_tag_len(ctx, in_len, extra_in_len)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - if (nonce_len != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_IV_TOO_LARGE); - return 0; - } - - if (ad_len != 11 - 2 /* length bytes */) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_AD_SIZE); - return 0; - } - - // Compute the MAC. This must be first in case the operation is being done - // in-place. - uint8_t mac[EVP_MAX_MD_SIZE]; - unsigned mac_len; - if (!ssl3_mac(ssl3_ctx, mac, &mac_len, ad, ad_len, in, in_len)) { - return 0; - } - - // Encrypt the input. - int len; - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, out, &len, in, - (int)in_len)) { - return 0; - } - - const size_t block_size = EVP_CIPHER_CTX_block_size(&ssl3_ctx->cipher_ctx); - - // Feed the MAC into the cipher in two steps. First complete the final partial - // block from encrypting the input and split the result between |out| and - // |out_tag|. Then encrypt the remainder. - - size_t early_mac_len = (block_size - (in_len % block_size)) % block_size; - if (early_mac_len != 0) { - assert(len + block_size - early_mac_len == in_len); - uint8_t buf[EVP_MAX_BLOCK_LENGTH]; - int buf_len; - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, buf, &buf_len, mac, - (int)early_mac_len)) { - return 0; - } - assert(buf_len == (int)block_size); - OPENSSL_memcpy(out + len, buf, block_size - early_mac_len); - OPENSSL_memcpy(out_tag, buf + block_size - early_mac_len, early_mac_len); - } - size_t tag_len = early_mac_len; - - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, out_tag + tag_len, &len, - mac + tag_len, mac_len - tag_len)) { - return 0; - } - tag_len += len; - - if (block_size > 1) { - assert(block_size <= 256); - assert(EVP_CIPHER_CTX_mode(&ssl3_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE); - - // Compute padding and feed that into the cipher. - uint8_t padding[256]; - size_t padding_len = block_size - ((in_len + mac_len) % block_size); - OPENSSL_memset(padding, 0, padding_len - 1); - padding[padding_len - 1] = padding_len - 1; - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, out_tag + tag_len, &len, padding, - (int)padding_len)) { - return 0; - } - tag_len += len; - } - - if (!EVP_EncryptFinal_ex(&ssl3_ctx->cipher_ctx, out_tag + tag_len, &len)) { - return 0; - } - tag_len += len; - assert(tag_len == aead_ssl3_tag_len(ctx, in_len, extra_in_len)); - - *out_tag_len = tag_len; - return 1; -} - -static int aead_ssl3_open(const EVP_AEAD_CTX *ctx, uint8_t *out, - size_t *out_len, size_t max_out_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *ad, size_t ad_len) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - - if (ssl3_ctx->cipher_ctx.encrypt) { - // Unlike a normal AEAD, an SSL3 AEAD may only be used in one direction. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); - return 0; - } - - size_t mac_len = EVP_MD_CTX_size(&ssl3_ctx->md_ctx); - if (in_len < mac_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - if (max_out_len < in_len) { - // This requires that the caller provide space for the MAC, even though it - // will always be removed on return. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - if (nonce_len != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (ad_len != 11 - 2 /* length bytes */) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_AD_SIZE); - return 0; - } - - if (in_len > INT_MAX) { - // EVP_CIPHER takes int as input. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - // Decrypt to get the plaintext + MAC + padding. - size_t total = 0; - int len; - if (!EVP_DecryptUpdate(&ssl3_ctx->cipher_ctx, out, &len, in, (int)in_len)) { - return 0; - } - total += len; - if (!EVP_DecryptFinal_ex(&ssl3_ctx->cipher_ctx, out + total, &len)) { - return 0; - } - total += len; - assert(total == in_len); - - // Remove CBC padding and MAC. This would normally be timing-sensitive, but - // SSLv3 CBC ciphers are already broken. Support will be removed eventually. - // https://www.openssl.org/~bodo/ssl-poodle.pdf - size_t data_len; - if (EVP_CIPHER_CTX_mode(&ssl3_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE) { - unsigned padding_length = out[total - 1]; - if (total < padding_length + 1 + mac_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - // The padding must be minimal. - if (padding_length + 1 > EVP_CIPHER_CTX_block_size(&ssl3_ctx->cipher_ctx)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - data_len = total - padding_length - 1 - mac_len; - } else { - data_len = total - mac_len; - } - - // Compute the MAC and compare against the one in the record. - uint8_t mac[EVP_MAX_MD_SIZE]; - if (!ssl3_mac(ssl3_ctx, mac, NULL, ad, ad_len, out, data_len)) { - return 0; - } - if (CRYPTO_memcmp(&out[data_len], mac, mac_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - *out_len = data_len; - return 1; -} - -static int aead_ssl3_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, - size_t *out_iv_len) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - const size_t iv_len = EVP_CIPHER_CTX_iv_length(&ssl3_ctx->cipher_ctx); - if (iv_len <= 1) { - return 0; - } - - *out_iv = ssl3_ctx->cipher_ctx.iv; - *out_iv_len = iv_len; - return 1; -} - -static int aead_aes_128_cbc_sha1_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), - EVP_sha1()); -} - -static int aead_aes_256_cbc_sha1_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), - EVP_sha1()); -} -static int aead_des_ede3_cbc_sha1_ssl3_init(EVP_AEAD_CTX *ctx, - const uint8_t *key, size_t key_len, - size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_des_ede3_cbc(), - EVP_sha1()); -} - -static int aead_null_sha1_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_enc_null(), - EVP_sha1()); -} - -static const EVP_AEAD aead_aes_128_cbc_sha1_ssl3 = { - SHA_DIGEST_LENGTH + 16 + 16, // key len (SHA1 + AES128 + IV) - 0, // nonce len - 16 + SHA_DIGEST_LENGTH, // overhead (padding + SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_aes_128_cbc_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - aead_ssl3_get_iv, - aead_ssl3_tag_len, -}; - -static const EVP_AEAD aead_aes_256_cbc_sha1_ssl3 = { - SHA_DIGEST_LENGTH + 32 + 16, // key len (SHA1 + AES256 + IV) - 0, // nonce len - 16 + SHA_DIGEST_LENGTH, // overhead (padding + SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_aes_256_cbc_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - aead_ssl3_get_iv, - aead_ssl3_tag_len, -}; - -static const EVP_AEAD aead_des_ede3_cbc_sha1_ssl3 = { - SHA_DIGEST_LENGTH + 24 + 8, // key len (SHA1 + 3DES + IV) - 0, // nonce len - 8 + SHA_DIGEST_LENGTH, // overhead (padding + SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_des_ede3_cbc_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - aead_ssl3_get_iv, - aead_ssl3_tag_len, -}; - -static const EVP_AEAD aead_null_sha1_ssl3 = { - SHA_DIGEST_LENGTH, // key len - 0, // nonce len - SHA_DIGEST_LENGTH, // overhead (SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_null_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - NULL, // get_iv - aead_ssl3_tag_len, -}; - -const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_ssl3(void) { - return &aead_aes_128_cbc_sha1_ssl3; -} - -const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_ssl3(void) { - return &aead_aes_256_cbc_sha1_ssl3; -} - -const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_ssl3(void) { - return &aead_des_ede3_cbc_sha1_ssl3; -} - -const EVP_AEAD *EVP_aead_null_sha1_ssl3(void) { return &aead_null_sha1_ssl3; } diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_ssl3.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_ssl3.c.grpc_back deleted file mode 100644 index 61f25cad1..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_ssl3.c.grpc_back +++ /dev/null @@ -1,460 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../internal.h" -#include "../fipsmodule/cipher/internal.h" - - -typedef struct { - EVP_CIPHER_CTX cipher_ctx; - EVP_MD_CTX md_ctx; -} AEAD_SSL3_CTX; - -static int ssl3_mac(AEAD_SSL3_CTX *ssl3_ctx, uint8_t *out, unsigned *out_len, - const uint8_t *ad, size_t ad_len, const uint8_t *in, - size_t in_len) { - size_t md_size = EVP_MD_CTX_size(&ssl3_ctx->md_ctx); - size_t pad_len = (md_size == 20) ? 40 : 48; - - // To allow for CBC mode which changes cipher length, |ad| doesn't include the - // length for legacy ciphers. - uint8_t ad_extra[2]; - ad_extra[0] = (uint8_t)(in_len >> 8); - ad_extra[1] = (uint8_t)(in_len & 0xff); - - EVP_MD_CTX md_ctx; - EVP_MD_CTX_init(&md_ctx); - - uint8_t pad[48]; - uint8_t tmp[EVP_MAX_MD_SIZE]; - OPENSSL_memset(pad, 0x36, pad_len); - if (!EVP_MD_CTX_copy_ex(&md_ctx, &ssl3_ctx->md_ctx) || - !EVP_DigestUpdate(&md_ctx, pad, pad_len) || - !EVP_DigestUpdate(&md_ctx, ad, ad_len) || - !EVP_DigestUpdate(&md_ctx, ad_extra, sizeof(ad_extra)) || - !EVP_DigestUpdate(&md_ctx, in, in_len) || - !EVP_DigestFinal_ex(&md_ctx, tmp, NULL)) { - EVP_MD_CTX_cleanup(&md_ctx); - return 0; - } - - OPENSSL_memset(pad, 0x5c, pad_len); - if (!EVP_MD_CTX_copy_ex(&md_ctx, &ssl3_ctx->md_ctx) || - !EVP_DigestUpdate(&md_ctx, pad, pad_len) || - !EVP_DigestUpdate(&md_ctx, tmp, md_size) || - !EVP_DigestFinal_ex(&md_ctx, out, out_len)) { - EVP_MD_CTX_cleanup(&md_ctx); - return 0; - } - EVP_MD_CTX_cleanup(&md_ctx); - return 1; -} - -static void aead_ssl3_cleanup(EVP_AEAD_CTX *ctx) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - EVP_CIPHER_CTX_cleanup(&ssl3_ctx->cipher_ctx); - EVP_MD_CTX_cleanup(&ssl3_ctx->md_ctx); - OPENSSL_free(ssl3_ctx); - ctx->aead_state = NULL; -} - -static int aead_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, - size_t tag_len, enum evp_aead_direction_t dir, - const EVP_CIPHER *cipher, const EVP_MD *md) { - if (tag_len != EVP_AEAD_DEFAULT_TAG_LENGTH && - tag_len != EVP_MD_size(md)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_TAG_SIZE); - return 0; - } - - if (key_len != EVP_AEAD_key_length(ctx->aead)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); - return 0; - } - - size_t mac_key_len = EVP_MD_size(md); - size_t enc_key_len = EVP_CIPHER_key_length(cipher); - assert(mac_key_len + enc_key_len + EVP_CIPHER_iv_length(cipher) == key_len); - - AEAD_SSL3_CTX *ssl3_ctx = OPENSSL_malloc(sizeof(AEAD_SSL3_CTX)); - if (ssl3_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } - EVP_CIPHER_CTX_init(&ssl3_ctx->cipher_ctx); - EVP_MD_CTX_init(&ssl3_ctx->md_ctx); - - ctx->aead_state = ssl3_ctx; - if (!EVP_CipherInit_ex(&ssl3_ctx->cipher_ctx, cipher, NULL, &key[mac_key_len], - &key[mac_key_len + enc_key_len], - dir == evp_aead_seal) || - !EVP_DigestInit_ex(&ssl3_ctx->md_ctx, md, NULL) || - !EVP_DigestUpdate(&ssl3_ctx->md_ctx, key, mac_key_len)) { - aead_ssl3_cleanup(ctx); - ctx->aead_state = NULL; - return 0; - } - EVP_CIPHER_CTX_set_padding(&ssl3_ctx->cipher_ctx, 0); - - return 1; -} - -static size_t aead_ssl3_tag_len(const EVP_AEAD_CTX *ctx, const size_t in_len, - const size_t extra_in_len) { - assert(extra_in_len == 0); - const AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX*)ctx->aead_state; - - const size_t digest_len = EVP_MD_CTX_size(&ssl3_ctx->md_ctx); - if (EVP_CIPHER_CTX_mode(&ssl3_ctx->cipher_ctx) != EVP_CIPH_CBC_MODE) { - // The NULL cipher. - return digest_len; - } - - const size_t block_size = EVP_CIPHER_CTX_block_size(&ssl3_ctx->cipher_ctx); - // An overflow of |in_len + digest_len| doesn't affect the result mod - // |block_size|, provided that |block_size| is a smaller power of two. - assert(block_size != 0 && (block_size & (block_size - 1)) == 0); - const size_t pad_len = block_size - ((in_len + digest_len) % block_size); - return digest_len + pad_len; -} - -static int aead_ssl3_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, - uint8_t *out_tag, size_t *out_tag_len, - const size_t max_out_tag_len, - const uint8_t *nonce, const size_t nonce_len, - const uint8_t *in, const size_t in_len, - const uint8_t *extra_in, - const size_t extra_in_len, const uint8_t *ad, - const size_t ad_len) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - - if (!ssl3_ctx->cipher_ctx.encrypt) { - // Unlike a normal AEAD, an SSL3 AEAD may only be used in one direction. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); - return 0; - } - - if (in_len > INT_MAX) { - // EVP_CIPHER takes int as input. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (max_out_tag_len < aead_ssl3_tag_len(ctx, in_len, extra_in_len)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - if (nonce_len != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_IV_TOO_LARGE); - return 0; - } - - if (ad_len != 11 - 2 /* length bytes */) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_AD_SIZE); - return 0; - } - - // Compute the MAC. This must be first in case the operation is being done - // in-place. - uint8_t mac[EVP_MAX_MD_SIZE]; - unsigned mac_len; - if (!ssl3_mac(ssl3_ctx, mac, &mac_len, ad, ad_len, in, in_len)) { - return 0; - } - - // Encrypt the input. - int len; - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, out, &len, in, - (int)in_len)) { - return 0; - } - - const size_t block_size = EVP_CIPHER_CTX_block_size(&ssl3_ctx->cipher_ctx); - - // Feed the MAC into the cipher in two steps. First complete the final partial - // block from encrypting the input and split the result between |out| and - // |out_tag|. Then encrypt the remainder. - - size_t early_mac_len = (block_size - (in_len % block_size)) % block_size; - if (early_mac_len != 0) { - assert(len + block_size - early_mac_len == in_len); - uint8_t buf[EVP_MAX_BLOCK_LENGTH]; - int buf_len; - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, buf, &buf_len, mac, - (int)early_mac_len)) { - return 0; - } - assert(buf_len == (int)block_size); - OPENSSL_memcpy(out + len, buf, block_size - early_mac_len); - OPENSSL_memcpy(out_tag, buf + block_size - early_mac_len, early_mac_len); - } - size_t tag_len = early_mac_len; - - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, out_tag + tag_len, &len, - mac + tag_len, mac_len - tag_len)) { - return 0; - } - tag_len += len; - - if (block_size > 1) { - assert(block_size <= 256); - assert(EVP_CIPHER_CTX_mode(&ssl3_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE); - - // Compute padding and feed that into the cipher. - uint8_t padding[256]; - size_t padding_len = block_size - ((in_len + mac_len) % block_size); - OPENSSL_memset(padding, 0, padding_len - 1); - padding[padding_len - 1] = padding_len - 1; - if (!EVP_EncryptUpdate(&ssl3_ctx->cipher_ctx, out_tag + tag_len, &len, padding, - (int)padding_len)) { - return 0; - } - tag_len += len; - } - - if (!EVP_EncryptFinal_ex(&ssl3_ctx->cipher_ctx, out_tag + tag_len, &len)) { - return 0; - } - tag_len += len; - assert(tag_len == aead_ssl3_tag_len(ctx, in_len, extra_in_len)); - - *out_tag_len = tag_len; - return 1; -} - -static int aead_ssl3_open(const EVP_AEAD_CTX *ctx, uint8_t *out, - size_t *out_len, size_t max_out_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *ad, size_t ad_len) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - - if (ssl3_ctx->cipher_ctx.encrypt) { - // Unlike a normal AEAD, an SSL3 AEAD may only be used in one direction. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_OPERATION); - return 0; - } - - size_t mac_len = EVP_MD_CTX_size(&ssl3_ctx->md_ctx); - if (in_len < mac_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - if (max_out_len < in_len) { - // This requires that the caller provide space for the MAC, even though it - // will always be removed on return. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - - if (nonce_len != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - if (ad_len != 11 - 2 /* length bytes */) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_AD_SIZE); - return 0; - } - - if (in_len > INT_MAX) { - // EVP_CIPHER takes int as input. - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - - // Decrypt to get the plaintext + MAC + padding. - size_t total = 0; - int len; - if (!EVP_DecryptUpdate(&ssl3_ctx->cipher_ctx, out, &len, in, (int)in_len)) { - return 0; - } - total += len; - if (!EVP_DecryptFinal_ex(&ssl3_ctx->cipher_ctx, out + total, &len)) { - return 0; - } - total += len; - assert(total == in_len); - - // Remove CBC padding and MAC. This would normally be timing-sensitive, but - // SSLv3 CBC ciphers are already broken. Support will be removed eventually. - // https://www.openssl.org/~bodo/ssl-poodle.pdf - size_t data_len; - if (EVP_CIPHER_CTX_mode(&ssl3_ctx->cipher_ctx) == EVP_CIPH_CBC_MODE) { - unsigned padding_length = out[total - 1]; - if (total < padding_length + 1 + mac_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - // The padding must be minimal. - if (padding_length + 1 > EVP_CIPHER_CTX_block_size(&ssl3_ctx->cipher_ctx)) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - data_len = total - padding_length - 1 - mac_len; - } else { - data_len = total - mac_len; - } - - // Compute the MAC and compare against the one in the record. - uint8_t mac[EVP_MAX_MD_SIZE]; - if (!ssl3_mac(ssl3_ctx, mac, NULL, ad, ad_len, out, data_len)) { - return 0; - } - if (CRYPTO_memcmp(&out[data_len], mac, mac_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - *out_len = data_len; - return 1; -} - -static int aead_ssl3_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, - size_t *out_iv_len) { - AEAD_SSL3_CTX *ssl3_ctx = (AEAD_SSL3_CTX *)ctx->aead_state; - const size_t iv_len = EVP_CIPHER_CTX_iv_length(&ssl3_ctx->cipher_ctx); - if (iv_len <= 1) { - return 0; - } - - *out_iv = ssl3_ctx->cipher_ctx.iv; - *out_iv_len = iv_len; - return 1; -} - -static int aead_aes_128_cbc_sha1_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_aes_128_cbc(), - EVP_sha1()); -} - -static int aead_aes_256_cbc_sha1_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_aes_256_cbc(), - EVP_sha1()); -} -static int aead_des_ede3_cbc_sha1_ssl3_init(EVP_AEAD_CTX *ctx, - const uint8_t *key, size_t key_len, - size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_des_ede3_cbc(), - EVP_sha1()); -} - -static int aead_null_sha1_ssl3_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t tag_len, - enum evp_aead_direction_t dir) { - return aead_ssl3_init(ctx, key, key_len, tag_len, dir, EVP_enc_null(), - EVP_sha1()); -} - -static const EVP_AEAD aead_aes_128_cbc_sha1_ssl3 = { - SHA_DIGEST_LENGTH + 16 + 16, // key len (SHA1 + AES128 + IV) - 0, // nonce len - 16 + SHA_DIGEST_LENGTH, // overhead (padding + SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_aes_128_cbc_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - aead_ssl3_get_iv, - aead_ssl3_tag_len, -}; - -static const EVP_AEAD aead_aes_256_cbc_sha1_ssl3 = { - SHA_DIGEST_LENGTH + 32 + 16, // key len (SHA1 + AES256 + IV) - 0, // nonce len - 16 + SHA_DIGEST_LENGTH, // overhead (padding + SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_aes_256_cbc_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - aead_ssl3_get_iv, - aead_ssl3_tag_len, -}; - -static const EVP_AEAD aead_des_ede3_cbc_sha1_ssl3 = { - SHA_DIGEST_LENGTH + 24 + 8, // key len (SHA1 + 3DES + IV) - 0, // nonce len - 8 + SHA_DIGEST_LENGTH, // overhead (padding + SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_des_ede3_cbc_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - aead_ssl3_get_iv, - aead_ssl3_tag_len, -}; - -static const EVP_AEAD aead_null_sha1_ssl3 = { - SHA_DIGEST_LENGTH, // key len - 0, // nonce len - SHA_DIGEST_LENGTH, // overhead (SHA1) - SHA_DIGEST_LENGTH, // max tag length - 0, // seal_scatter_supports_extra_in - - NULL, // init - aead_null_sha1_ssl3_init, - aead_ssl3_cleanup, - aead_ssl3_open, - aead_ssl3_seal_scatter, - NULL, // open_gather - NULL, // get_iv - aead_ssl3_tag_len, -}; - -const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_ssl3(void) { - return &aead_aes_128_cbc_sha1_ssl3; -} - -const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_ssl3(void) { - return &aead_aes_256_cbc_sha1_ssl3; -} - -const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_ssl3(void) { - return &aead_des_ede3_cbc_sha1_ssl3; -} - -const EVP_AEAD *EVP_aead_null_sha1_ssl3(void) { return &aead_null_sha1_ssl3; } diff --git a/Pods/BoringSSL-GRPC/crypto/cmac/cmac.c b/Pods/BoringSSL-GRPC/crypto/cmac/cmac.c deleted file mode 100644 index 5eed2e8c8..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cmac/cmac.c +++ /dev/null @@ -1,241 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2010 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include - -#include -#include -#include - -#include "../internal.h" - - -struct cmac_ctx_st { - EVP_CIPHER_CTX cipher_ctx; - // k1 and k2 are the CMAC subkeys. See - // https://tools.ietf.org/html/rfc4493#section-2.3 - uint8_t k1[AES_BLOCK_SIZE]; - uint8_t k2[AES_BLOCK_SIZE]; - // Last (possibly partial) scratch - uint8_t block[AES_BLOCK_SIZE]; - // block_used contains the number of valid bytes in |block|. - unsigned block_used; -}; - -static void CMAC_CTX_init(CMAC_CTX *ctx) { - EVP_CIPHER_CTX_init(&ctx->cipher_ctx); -} - -static void CMAC_CTX_cleanup(CMAC_CTX *ctx) { - EVP_CIPHER_CTX_cleanup(&ctx->cipher_ctx); - OPENSSL_cleanse(ctx->k1, sizeof(ctx->k1)); - OPENSSL_cleanse(ctx->k2, sizeof(ctx->k2)); - OPENSSL_cleanse(ctx->block, sizeof(ctx->block)); -} - -int AES_CMAC(uint8_t out[16], const uint8_t *key, size_t key_len, - const uint8_t *in, size_t in_len) { - const EVP_CIPHER *cipher; - switch (key_len) { - case 16: - cipher = EVP_aes_128_cbc(); - break; - case 32: - cipher = EVP_aes_256_cbc(); - break; - default: - return 0; - } - - size_t scratch_out_len; - CMAC_CTX ctx; - CMAC_CTX_init(&ctx); - - const int ok = CMAC_Init(&ctx, key, key_len, cipher, NULL /* engine */) && - CMAC_Update(&ctx, in, in_len) && - CMAC_Final(&ctx, out, &scratch_out_len); - - CMAC_CTX_cleanup(&ctx); - return ok; -} - -CMAC_CTX *CMAC_CTX_new(void) { - CMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx)); - if (ctx != NULL) { - CMAC_CTX_init(ctx); - } - return ctx; -} - -void CMAC_CTX_free(CMAC_CTX *ctx) { - if (ctx == NULL) { - return; - } - - CMAC_CTX_cleanup(ctx); - OPENSSL_free(ctx); -} - -// binary_field_mul_x treats the 128 bits at |in| as an element of GF(2¹²⁸) -// with a hard-coded reduction polynomial and sets |out| as x times the -// input. -// -// See https://tools.ietf.org/html/rfc4493#section-2.3 -static void binary_field_mul_x(uint8_t out[16], const uint8_t in[16]) { - unsigned i; - - // Shift |in| to left, including carry. - for (i = 0; i < 15; i++) { - out[i] = (in[i] << 1) | (in[i+1] >> 7); - } - - // If MSB set fixup with R. - const uint8_t carry = in[0] >> 7; - out[i] = (in[i] << 1) ^ ((0 - carry) & 0x87); -} - -static const uint8_t kZeroIV[AES_BLOCK_SIZE] = {0}; - -int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t key_len, - const EVP_CIPHER *cipher, ENGINE *engine) { - uint8_t scratch[AES_BLOCK_SIZE]; - - if (EVP_CIPHER_block_size(cipher) != AES_BLOCK_SIZE || - EVP_CIPHER_key_length(cipher) != key_len || - !EVP_EncryptInit_ex(&ctx->cipher_ctx, cipher, NULL, key, kZeroIV) || - !EVP_Cipher(&ctx->cipher_ctx, scratch, kZeroIV, AES_BLOCK_SIZE) || - // Reset context again ready for first data. - !EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV)) { - return 0; - } - - binary_field_mul_x(ctx->k1, scratch); - binary_field_mul_x(ctx->k2, ctx->k1); - ctx->block_used = 0; - - return 1; -} - -int CMAC_Reset(CMAC_CTX *ctx) { - ctx->block_used = 0; - return EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV); -} - -int CMAC_Update(CMAC_CTX *ctx, const uint8_t *in, size_t in_len) { - uint8_t scratch[AES_BLOCK_SIZE]; - - if (ctx->block_used > 0) { - size_t todo = AES_BLOCK_SIZE - ctx->block_used; - if (in_len < todo) { - todo = in_len; - } - - OPENSSL_memcpy(ctx->block + ctx->block_used, in, todo); - in += todo; - in_len -= todo; - ctx->block_used += todo; - - // If |in_len| is zero then either |ctx->block_used| is less than - // |AES_BLOCK_SIZE|, in which case we can stop here, or |ctx->block_used| - // is exactly |AES_BLOCK_SIZE| but there's no more data to process. In the - // latter case we don't want to process this block now because it might be - // the last block and that block is treated specially. - if (in_len == 0) { - return 1; - } - - assert(ctx->block_used == AES_BLOCK_SIZE); - - if (!EVP_Cipher(&ctx->cipher_ctx, scratch, ctx->block, AES_BLOCK_SIZE)) { - return 0; - } - } - - // Encrypt all but one of the remaining blocks. - while (in_len > AES_BLOCK_SIZE) { - if (!EVP_Cipher(&ctx->cipher_ctx, scratch, in, AES_BLOCK_SIZE)) { - return 0; - } - in += AES_BLOCK_SIZE; - in_len -= AES_BLOCK_SIZE; - } - - OPENSSL_memcpy(ctx->block, in, in_len); - ctx->block_used = in_len; - - return 1; -} - -int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len) { - *out_len = AES_BLOCK_SIZE; - if (out == NULL) { - return 1; - } - - const uint8_t *mask = ctx->k1; - - if (ctx->block_used != AES_BLOCK_SIZE) { - // If the last block is incomplete, terminate it with a single 'one' bit - // followed by zeros. - ctx->block[ctx->block_used] = 0x80; - OPENSSL_memset(ctx->block + ctx->block_used + 1, 0, - AES_BLOCK_SIZE - (ctx->block_used + 1)); - - mask = ctx->k2; - } - - unsigned i; - for (i = 0; i < AES_BLOCK_SIZE; i++) { - out[i] = ctx->block[i] ^ mask[i]; - } - - return EVP_Cipher(&ctx->cipher_ctx, out, out, AES_BLOCK_SIZE); -} diff --git a/Pods/BoringSSL-GRPC/crypto/cmac/cmac.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/cmac/cmac.c.grpc_back deleted file mode 100644 index fb4e69c7f..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cmac/cmac.c.grpc_back +++ /dev/null @@ -1,241 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2010 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include - -#include -#include -#include - -#include "../internal.h" - - -struct cmac_ctx_st { - EVP_CIPHER_CTX cipher_ctx; - // k1 and k2 are the CMAC subkeys. See - // https://tools.ietf.org/html/rfc4493#section-2.3 - uint8_t k1[AES_BLOCK_SIZE]; - uint8_t k2[AES_BLOCK_SIZE]; - // Last (possibly partial) scratch - uint8_t block[AES_BLOCK_SIZE]; - // block_used contains the number of valid bytes in |block|. - unsigned block_used; -}; - -static void CMAC_CTX_init(CMAC_CTX *ctx) { - EVP_CIPHER_CTX_init(&ctx->cipher_ctx); -} - -static void CMAC_CTX_cleanup(CMAC_CTX *ctx) { - EVP_CIPHER_CTX_cleanup(&ctx->cipher_ctx); - OPENSSL_cleanse(ctx->k1, sizeof(ctx->k1)); - OPENSSL_cleanse(ctx->k2, sizeof(ctx->k2)); - OPENSSL_cleanse(ctx->block, sizeof(ctx->block)); -} - -int AES_CMAC(uint8_t out[16], const uint8_t *key, size_t key_len, - const uint8_t *in, size_t in_len) { - const EVP_CIPHER *cipher; - switch (key_len) { - case 16: - cipher = EVP_aes_128_cbc(); - break; - case 32: - cipher = EVP_aes_256_cbc(); - break; - default: - return 0; - } - - size_t scratch_out_len; - CMAC_CTX ctx; - CMAC_CTX_init(&ctx); - - const int ok = CMAC_Init(&ctx, key, key_len, cipher, NULL /* engine */) && - CMAC_Update(&ctx, in, in_len) && - CMAC_Final(&ctx, out, &scratch_out_len); - - CMAC_CTX_cleanup(&ctx); - return ok; -} - -CMAC_CTX *CMAC_CTX_new(void) { - CMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx)); - if (ctx != NULL) { - CMAC_CTX_init(ctx); - } - return ctx; -} - -void CMAC_CTX_free(CMAC_CTX *ctx) { - if (ctx == NULL) { - return; - } - - CMAC_CTX_cleanup(ctx); - OPENSSL_free(ctx); -} - -// binary_field_mul_x treats the 128 bits at |in| as an element of GF(2¹²⁸) -// with a hard-coded reduction polynomial and sets |out| as x times the -// input. -// -// See https://tools.ietf.org/html/rfc4493#section-2.3 -static void binary_field_mul_x(uint8_t out[16], const uint8_t in[16]) { - unsigned i; - - // Shift |in| to left, including carry. - for (i = 0; i < 15; i++) { - out[i] = (in[i] << 1) | (in[i+1] >> 7); - } - - // If MSB set fixup with R. - const uint8_t carry = in[0] >> 7; - out[i] = (in[i] << 1) ^ ((0 - carry) & 0x87); -} - -static const uint8_t kZeroIV[AES_BLOCK_SIZE] = {0}; - -int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t key_len, - const EVP_CIPHER *cipher, ENGINE *engine) { - uint8_t scratch[AES_BLOCK_SIZE]; - - if (EVP_CIPHER_block_size(cipher) != AES_BLOCK_SIZE || - EVP_CIPHER_key_length(cipher) != key_len || - !EVP_EncryptInit_ex(&ctx->cipher_ctx, cipher, NULL, key, kZeroIV) || - !EVP_Cipher(&ctx->cipher_ctx, scratch, kZeroIV, AES_BLOCK_SIZE) || - // Reset context again ready for first data. - !EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV)) { - return 0; - } - - binary_field_mul_x(ctx->k1, scratch); - binary_field_mul_x(ctx->k2, ctx->k1); - ctx->block_used = 0; - - return 1; -} - -int CMAC_Reset(CMAC_CTX *ctx) { - ctx->block_used = 0; - return EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV); -} - -int CMAC_Update(CMAC_CTX *ctx, const uint8_t *in, size_t in_len) { - uint8_t scratch[AES_BLOCK_SIZE]; - - if (ctx->block_used > 0) { - size_t todo = AES_BLOCK_SIZE - ctx->block_used; - if (in_len < todo) { - todo = in_len; - } - - OPENSSL_memcpy(ctx->block + ctx->block_used, in, todo); - in += todo; - in_len -= todo; - ctx->block_used += todo; - - // If |in_len| is zero then either |ctx->block_used| is less than - // |AES_BLOCK_SIZE|, in which case we can stop here, or |ctx->block_used| - // is exactly |AES_BLOCK_SIZE| but there's no more data to process. In the - // latter case we don't want to process this block now because it might be - // the last block and that block is treated specially. - if (in_len == 0) { - return 1; - } - - assert(ctx->block_used == AES_BLOCK_SIZE); - - if (!EVP_Cipher(&ctx->cipher_ctx, scratch, ctx->block, AES_BLOCK_SIZE)) { - return 0; - } - } - - // Encrypt all but one of the remaining blocks. - while (in_len > AES_BLOCK_SIZE) { - if (!EVP_Cipher(&ctx->cipher_ctx, scratch, in, AES_BLOCK_SIZE)) { - return 0; - } - in += AES_BLOCK_SIZE; - in_len -= AES_BLOCK_SIZE; - } - - OPENSSL_memcpy(ctx->block, in, in_len); - ctx->block_used = in_len; - - return 1; -} - -int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len) { - *out_len = AES_BLOCK_SIZE; - if (out == NULL) { - return 1; - } - - const uint8_t *mask = ctx->k1; - - if (ctx->block_used != AES_BLOCK_SIZE) { - // If the last block is incomplete, terminate it with a single 'one' bit - // followed by zeros. - ctx->block[ctx->block_used] = 0x80; - OPENSSL_memset(ctx->block + ctx->block_used + 1, 0, - AES_BLOCK_SIZE - (ctx->block_used + 1)); - - mask = ctx->k2; - } - - unsigned i; - for (i = 0; i < AES_BLOCK_SIZE; i++) { - out[i] = ctx->block[i] ^ mask[i]; - } - - return EVP_Cipher(&ctx->cipher_ctx, out, out, AES_BLOCK_SIZE); -} diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-arm-linux.c b/Pods/BoringSSL-GRPC/crypto/cpu-arm-linux.c deleted file mode 100644 index 5c93d471b..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cpu-arm-linux.c +++ /dev/null @@ -1,363 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#if defined(OPENSSL_ARM) && !defined(OPENSSL_STATIC_ARMCAP) - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "internal.h" - - -#define AT_HWCAP 16 -#define AT_HWCAP2 26 - -#define HWCAP_NEON (1 << 12) - -// See /usr/include/asm/hwcap.h on an ARM installation for the source of -// these values. -#define HWCAP2_AES (1 << 0) -#define HWCAP2_PMULL (1 << 1) -#define HWCAP2_SHA1 (1 << 2) -#define HWCAP2_SHA2 (1 << 3) - -// |getauxval| is not available on Android until API level 20. Link it as a weak -// symbol and use other methods as fallback. -unsigned long getauxval(unsigned long type) __attribute__((weak)); - -static int open_eintr(const char *path, int flags) { - int ret; - do { - ret = open(path, flags); - } while (ret < 0 && errno == EINTR); - return ret; -} - -static ssize_t read_eintr(int fd, void *out, size_t len) { - ssize_t ret; - do { - ret = read(fd, out, len); - } while (ret < 0 && errno == EINTR); - return ret; -} - -// read_full reads exactly |len| bytes from |fd| to |out|. On error or end of -// file, it returns zero. -static int read_full(int fd, void *out, size_t len) { - char *outp = out; - while (len > 0) { - ssize_t ret = read_eintr(fd, outp, len); - if (ret <= 0) { - return 0; - } - outp += ret; - len -= ret; - } - return 1; -} - -// read_file opens |path| and reads until end-of-file. On success, it returns -// one and sets |*out_ptr| and |*out_len| to a newly-allocated buffer with the -// contents. Otherwise, it returns zero. -static int read_file(char **out_ptr, size_t *out_len, const char *path) { - int fd = open_eintr(path, O_RDONLY); - if (fd < 0) { - return 0; - } - - static const size_t kReadSize = 1024; - int ret = 0; - size_t cap = kReadSize, len = 0; - char *buf = OPENSSL_malloc(cap); - if (buf == NULL) { - goto err; - } - - for (;;) { - if (cap - len < kReadSize) { - size_t new_cap = cap * 2; - if (new_cap < cap) { - goto err; - } - char *new_buf = OPENSSL_realloc(buf, new_cap); - if (new_buf == NULL) { - goto err; - } - buf = new_buf; - cap = new_cap; - } - - ssize_t bytes_read = read_eintr(fd, buf + len, kReadSize); - if (bytes_read < 0) { - goto err; - } - if (bytes_read == 0) { - break; - } - len += bytes_read; - } - - *out_ptr = buf; - *out_len = len; - ret = 1; - buf = NULL; - -err: - OPENSSL_free(buf); - close(fd); - return ret; -} - -// getauxval_proc behaves like |getauxval| but reads from /proc/self/auxv. -static unsigned long getauxval_proc(unsigned long type) { - int fd = open_eintr("/proc/self/auxv", O_RDONLY); - if (fd < 0) { - return 0; - } - - struct { - unsigned long tag; - unsigned long value; - } entry; - - for (;;) { - if (!read_full(fd, &entry, sizeof(entry)) || - (entry.tag == 0 && entry.value == 0)) { - break; - } - if (entry.tag == type) { - close(fd); - return entry.value; - } - } - close(fd); - return 0; -} - -typedef struct { - const char *data; - size_t len; -} STRING_PIECE; - -static int STRING_PIECE_equals(const STRING_PIECE *a, const char *b) { - size_t b_len = strlen(b); - return a->len == b_len && OPENSSL_memcmp(a->data, b, b_len) == 0; -} - -// STRING_PIECE_split finds the first occurence of |sep| in |in| and, if found, -// sets |*out_left| and |*out_right| to |in| split before and after it. It -// returns one if |sep| was found and zero otherwise. -static int STRING_PIECE_split(STRING_PIECE *out_left, STRING_PIECE *out_right, - const STRING_PIECE *in, char sep) { - const char *p = OPENSSL_memchr(in->data, sep, in->len); - if (p == NULL) { - return 0; - } - // |out_left| or |out_right| may alias |in|, so make a copy. - STRING_PIECE in_copy = *in; - out_left->data = in_copy.data; - out_left->len = p - in_copy.data; - out_right->data = in_copy.data + out_left->len + 1; - out_right->len = in_copy.len - out_left->len - 1; - return 1; -} - -// STRING_PIECE_trim removes leading and trailing whitespace from |s|. -static void STRING_PIECE_trim(STRING_PIECE *s) { - while (s->len != 0 && (s->data[0] == ' ' || s->data[0] == '\t')) { - s->data++; - s->len--; - } - while (s->len != 0 && - (s->data[s->len - 1] == ' ' || s->data[s->len - 1] == '\t')) { - s->len--; - } -} - -// extract_cpuinfo_field extracts a /proc/cpuinfo field named |field| from -// |in|. If found, it sets |*out| to the value and returns one. Otherwise, it -// returns zero. -static int extract_cpuinfo_field(STRING_PIECE *out, const STRING_PIECE *in, - const char *field) { - // Process |in| one line at a time. - STRING_PIECE remaining = *in, line; - while (STRING_PIECE_split(&line, &remaining, &remaining, '\n')) { - STRING_PIECE key, value; - if (!STRING_PIECE_split(&key, &value, &line, ':')) { - continue; - } - STRING_PIECE_trim(&key); - if (STRING_PIECE_equals(&key, field)) { - STRING_PIECE_trim(&value); - *out = value; - return 1; - } - } - - return 0; -} - -static int cpuinfo_field_equals(const STRING_PIECE *cpuinfo, const char *field, - const char *value) { - STRING_PIECE extracted; - return extract_cpuinfo_field(&extracted, cpuinfo, field) && - STRING_PIECE_equals(&extracted, value); -} - -// has_list_item treats |list| as a space-separated list of items and returns -// one if |item| is contained in |list| and zero otherwise. -static int has_list_item(const STRING_PIECE *list, const char *item) { - STRING_PIECE remaining = *list, feature; - while (STRING_PIECE_split(&feature, &remaining, &remaining, ' ')) { - if (STRING_PIECE_equals(&feature, item)) { - return 1; - } - } - return 0; -} - -static unsigned long get_hwcap_cpuinfo(const STRING_PIECE *cpuinfo) { - if (cpuinfo_field_equals(cpuinfo, "CPU architecture", "8")) { - // This is a 32-bit ARM binary running on a 64-bit kernel. NEON is always - // available on ARMv8. Linux omits required features, so reading the - // "Features" line does not work. (For simplicity, use strict equality. We - // assume everything running on future ARM architectures will have a - // working |getauxval|.) - return HWCAP_NEON; - } - - STRING_PIECE features; - if (extract_cpuinfo_field(&features, cpuinfo, "Features") && - has_list_item(&features, "neon")) { - return HWCAP_NEON; - } - return 0; -} - -static unsigned long get_hwcap2_cpuinfo(const STRING_PIECE *cpuinfo) { - STRING_PIECE features; - if (!extract_cpuinfo_field(&features, cpuinfo, "Features")) { - return 0; - } - - unsigned long ret = 0; - if (has_list_item(&features, "aes")) { - ret |= HWCAP2_AES; - } - if (has_list_item(&features, "pmull")) { - ret |= HWCAP2_PMULL; - } - if (has_list_item(&features, "sha1")) { - ret |= HWCAP2_SHA1; - } - if (has_list_item(&features, "sha2")) { - ret |= HWCAP2_SHA2; - } - return ret; -} - -// has_broken_neon returns one if |in| matches a CPU known to have a broken -// NEON unit. See https://crbug.com/341598. -static int has_broken_neon(const STRING_PIECE *cpuinfo) { - return cpuinfo_field_equals(cpuinfo, "CPU implementer", "0x51") && - cpuinfo_field_equals(cpuinfo, "CPU architecture", "7") && - cpuinfo_field_equals(cpuinfo, "CPU variant", "0x1") && - cpuinfo_field_equals(cpuinfo, "CPU part", "0x04d") && - cpuinfo_field_equals(cpuinfo, "CPU revision", "0"); -} - -extern uint32_t OPENSSL_armcap_P; - -static int g_has_broken_neon, g_needs_hwcap2_workaround; - -void OPENSSL_cpuid_setup(void) { - char *cpuinfo_data; - size_t cpuinfo_len; - if (!read_file(&cpuinfo_data, &cpuinfo_len, "/proc/cpuinfo")) { - return; - } - STRING_PIECE cpuinfo; - cpuinfo.data = cpuinfo_data; - cpuinfo.len = cpuinfo_len; - - // |getauxval| is not available on Android until API level 20. If it is - // unavailable, read from /proc/self/auxv as a fallback. This is unreadable - // on some versions of Android, so further fall back to /proc/cpuinfo. - // - // See - // https://android.googlesource.com/platform/ndk/+/882ac8f3392858991a0e1af33b4b7387ec856bd2 - // and b/13679666 (Google-internal) for details. - unsigned long hwcap = 0; - if (getauxval != NULL) { - hwcap = getauxval(AT_HWCAP); - } - if (hwcap == 0) { - hwcap = getauxval_proc(AT_HWCAP); - } - if (hwcap == 0) { - hwcap = get_hwcap_cpuinfo(&cpuinfo); - } - - // Clear NEON support if known broken. - g_has_broken_neon = has_broken_neon(&cpuinfo); - if (g_has_broken_neon) { - hwcap &= ~HWCAP_NEON; - } - - // Matching OpenSSL, only report other features if NEON is present. - if (hwcap & HWCAP_NEON) { - OPENSSL_armcap_P |= ARMV7_NEON; - - // Some ARMv8 Android devices don't expose AT_HWCAP2. Fall back to - // /proc/cpuinfo. See https://crbug.com/596156. - unsigned long hwcap2 = 0; - if (getauxval != NULL) { - hwcap2 = getauxval(AT_HWCAP2); - } - if (hwcap2 == 0) { - hwcap2 = get_hwcap2_cpuinfo(&cpuinfo); - g_needs_hwcap2_workaround = hwcap2 != 0; - } - - if (hwcap2 & HWCAP2_AES) { - OPENSSL_armcap_P |= ARMV8_AES; - } - if (hwcap2 & HWCAP2_PMULL) { - OPENSSL_armcap_P |= ARMV8_PMULL; - } - if (hwcap2 & HWCAP2_SHA1) { - OPENSSL_armcap_P |= ARMV8_SHA1; - } - if (hwcap2 & HWCAP2_SHA2) { - OPENSSL_armcap_P |= ARMV8_SHA256; - } - } - - OPENSSL_free(cpuinfo_data); -} - -int CRYPTO_has_broken_NEON(void) { return g_has_broken_neon; } - -int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; } - -#endif // OPENSSL_ARM && !OPENSSL_STATIC_ARMCAP diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-arm-linux.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/cpu-arm-linux.c.grpc_back deleted file mode 100644 index 839b632b0..000000000 --- a/Pods/BoringSSL-GRPC/crypto/cpu-arm-linux.c.grpc_back +++ /dev/null @@ -1,363 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#if defined(OPENSSL_ARM) && !defined(OPENSSL_STATIC_ARMCAP) - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "internal.h" - - -#define AT_HWCAP 16 -#define AT_HWCAP2 26 - -#define HWCAP_NEON (1 << 12) - -// See /usr/include/asm/hwcap.h on an ARM installation for the source of -// these values. -#define HWCAP2_AES (1 << 0) -#define HWCAP2_PMULL (1 << 1) -#define HWCAP2_SHA1 (1 << 2) -#define HWCAP2_SHA2 (1 << 3) - -// |getauxval| is not available on Android until API level 20. Link it as a weak -// symbol and use other methods as fallback. -unsigned long getauxval(unsigned long type) __attribute__((weak)); - -static int open_eintr(const char *path, int flags) { - int ret; - do { - ret = open(path, flags); - } while (ret < 0 && errno == EINTR); - return ret; -} - -static ssize_t read_eintr(int fd, void *out, size_t len) { - ssize_t ret; - do { - ret = read(fd, out, len); - } while (ret < 0 && errno == EINTR); - return ret; -} - -// read_full reads exactly |len| bytes from |fd| to |out|. On error or end of -// file, it returns zero. -static int read_full(int fd, void *out, size_t len) { - char *outp = out; - while (len > 0) { - ssize_t ret = read_eintr(fd, outp, len); - if (ret <= 0) { - return 0; - } - outp += ret; - len -= ret; - } - return 1; -} - -// read_file opens |path| and reads until end-of-file. On success, it returns -// one and sets |*out_ptr| and |*out_len| to a newly-allocated buffer with the -// contents. Otherwise, it returns zero. -static int read_file(char **out_ptr, size_t *out_len, const char *path) { - int fd = open_eintr(path, O_RDONLY); - if (fd < 0) { - return 0; - } - - static const size_t kReadSize = 1024; - int ret = 0; - size_t cap = kReadSize, len = 0; - char *buf = OPENSSL_malloc(cap); - if (buf == NULL) { - goto err; - } - - for (;;) { - if (cap - len < kReadSize) { - size_t new_cap = cap * 2; - if (new_cap < cap) { - goto err; - } - char *new_buf = OPENSSL_realloc(buf, new_cap); - if (new_buf == NULL) { - goto err; - } - buf = new_buf; - cap = new_cap; - } - - ssize_t bytes_read = read_eintr(fd, buf + len, kReadSize); - if (bytes_read < 0) { - goto err; - } - if (bytes_read == 0) { - break; - } - len += bytes_read; - } - - *out_ptr = buf; - *out_len = len; - ret = 1; - buf = NULL; - -err: - OPENSSL_free(buf); - close(fd); - return ret; -} - -// getauxval_proc behaves like |getauxval| but reads from /proc/self/auxv. -static unsigned long getauxval_proc(unsigned long type) { - int fd = open_eintr("/proc/self/auxv", O_RDONLY); - if (fd < 0) { - return 0; - } - - struct { - unsigned long tag; - unsigned long value; - } entry; - - for (;;) { - if (!read_full(fd, &entry, sizeof(entry)) || - (entry.tag == 0 && entry.value == 0)) { - break; - } - if (entry.tag == type) { - close(fd); - return entry.value; - } - } - close(fd); - return 0; -} - -typedef struct { - const char *data; - size_t len; -} STRING_PIECE; - -static int STRING_PIECE_equals(const STRING_PIECE *a, const char *b) { - size_t b_len = strlen(b); - return a->len == b_len && OPENSSL_memcmp(a->data, b, b_len) == 0; -} - -// STRING_PIECE_split finds the first occurence of |sep| in |in| and, if found, -// sets |*out_left| and |*out_right| to |in| split before and after it. It -// returns one if |sep| was found and zero otherwise. -static int STRING_PIECE_split(STRING_PIECE *out_left, STRING_PIECE *out_right, - const STRING_PIECE *in, char sep) { - const char *p = OPENSSL_memchr(in->data, sep, in->len); - if (p == NULL) { - return 0; - } - // |out_left| or |out_right| may alias |in|, so make a copy. - STRING_PIECE in_copy = *in; - out_left->data = in_copy.data; - out_left->len = p - in_copy.data; - out_right->data = in_copy.data + out_left->len + 1; - out_right->len = in_copy.len - out_left->len - 1; - return 1; -} - -// STRING_PIECE_trim removes leading and trailing whitespace from |s|. -static void STRING_PIECE_trim(STRING_PIECE *s) { - while (s->len != 0 && (s->data[0] == ' ' || s->data[0] == '\t')) { - s->data++; - s->len--; - } - while (s->len != 0 && - (s->data[s->len - 1] == ' ' || s->data[s->len - 1] == '\t')) { - s->len--; - } -} - -// extract_cpuinfo_field extracts a /proc/cpuinfo field named |field| from -// |in|. If found, it sets |*out| to the value and returns one. Otherwise, it -// returns zero. -static int extract_cpuinfo_field(STRING_PIECE *out, const STRING_PIECE *in, - const char *field) { - // Process |in| one line at a time. - STRING_PIECE remaining = *in, line; - while (STRING_PIECE_split(&line, &remaining, &remaining, '\n')) { - STRING_PIECE key, value; - if (!STRING_PIECE_split(&key, &value, &line, ':')) { - continue; - } - STRING_PIECE_trim(&key); - if (STRING_PIECE_equals(&key, field)) { - STRING_PIECE_trim(&value); - *out = value; - return 1; - } - } - - return 0; -} - -static int cpuinfo_field_equals(const STRING_PIECE *cpuinfo, const char *field, - const char *value) { - STRING_PIECE extracted; - return extract_cpuinfo_field(&extracted, cpuinfo, field) && - STRING_PIECE_equals(&extracted, value); -} - -// has_list_item treats |list| as a space-separated list of items and returns -// one if |item| is contained in |list| and zero otherwise. -static int has_list_item(const STRING_PIECE *list, const char *item) { - STRING_PIECE remaining = *list, feature; - while (STRING_PIECE_split(&feature, &remaining, &remaining, ' ')) { - if (STRING_PIECE_equals(&feature, item)) { - return 1; - } - } - return 0; -} - -static unsigned long get_hwcap_cpuinfo(const STRING_PIECE *cpuinfo) { - if (cpuinfo_field_equals(cpuinfo, "CPU architecture", "8")) { - // This is a 32-bit ARM binary running on a 64-bit kernel. NEON is always - // available on ARMv8. Linux omits required features, so reading the - // "Features" line does not work. (For simplicity, use strict equality. We - // assume everything running on future ARM architectures will have a - // working |getauxval|.) - return HWCAP_NEON; - } - - STRING_PIECE features; - if (extract_cpuinfo_field(&features, cpuinfo, "Features") && - has_list_item(&features, "neon")) { - return HWCAP_NEON; - } - return 0; -} - -static unsigned long get_hwcap2_cpuinfo(const STRING_PIECE *cpuinfo) { - STRING_PIECE features; - if (!extract_cpuinfo_field(&features, cpuinfo, "Features")) { - return 0; - } - - unsigned long ret = 0; - if (has_list_item(&features, "aes")) { - ret |= HWCAP2_AES; - } - if (has_list_item(&features, "pmull")) { - ret |= HWCAP2_PMULL; - } - if (has_list_item(&features, "sha1")) { - ret |= HWCAP2_SHA1; - } - if (has_list_item(&features, "sha2")) { - ret |= HWCAP2_SHA2; - } - return ret; -} - -// has_broken_neon returns one if |in| matches a CPU known to have a broken -// NEON unit. See https://crbug.com/341598. -static int has_broken_neon(const STRING_PIECE *cpuinfo) { - return cpuinfo_field_equals(cpuinfo, "CPU implementer", "0x51") && - cpuinfo_field_equals(cpuinfo, "CPU architecture", "7") && - cpuinfo_field_equals(cpuinfo, "CPU variant", "0x1") && - cpuinfo_field_equals(cpuinfo, "CPU part", "0x04d") && - cpuinfo_field_equals(cpuinfo, "CPU revision", "0"); -} - -extern uint32_t OPENSSL_armcap_P; - -static int g_has_broken_neon, g_needs_hwcap2_workaround; - -void OPENSSL_cpuid_setup(void) { - char *cpuinfo_data; - size_t cpuinfo_len; - if (!read_file(&cpuinfo_data, &cpuinfo_len, "/proc/cpuinfo")) { - return; - } - STRING_PIECE cpuinfo; - cpuinfo.data = cpuinfo_data; - cpuinfo.len = cpuinfo_len; - - // |getauxval| is not available on Android until API level 20. If it is - // unavailable, read from /proc/self/auxv as a fallback. This is unreadable - // on some versions of Android, so further fall back to /proc/cpuinfo. - // - // See - // https://android.googlesource.com/platform/ndk/+/882ac8f3392858991a0e1af33b4b7387ec856bd2 - // and b/13679666 (Google-internal) for details. - unsigned long hwcap = 0; - if (getauxval != NULL) { - hwcap = getauxval(AT_HWCAP); - } - if (hwcap == 0) { - hwcap = getauxval_proc(AT_HWCAP); - } - if (hwcap == 0) { - hwcap = get_hwcap_cpuinfo(&cpuinfo); - } - - // Clear NEON support if known broken. - g_has_broken_neon = has_broken_neon(&cpuinfo); - if (g_has_broken_neon) { - hwcap &= ~HWCAP_NEON; - } - - // Matching OpenSSL, only report other features if NEON is present. - if (hwcap & HWCAP_NEON) { - OPENSSL_armcap_P |= ARMV7_NEON; - - // Some ARMv8 Android devices don't expose AT_HWCAP2. Fall back to - // /proc/cpuinfo. See https://crbug.com/596156. - unsigned long hwcap2 = 0; - if (getauxval != NULL) { - hwcap2 = getauxval(AT_HWCAP2); - } - if (hwcap2 == 0) { - hwcap2 = get_hwcap2_cpuinfo(&cpuinfo); - g_needs_hwcap2_workaround = hwcap2 != 0; - } - - if (hwcap2 & HWCAP2_AES) { - OPENSSL_armcap_P |= ARMV8_AES; - } - if (hwcap2 & HWCAP2_PMULL) { - OPENSSL_armcap_P |= ARMV8_PMULL; - } - if (hwcap2 & HWCAP2_SHA1) { - OPENSSL_armcap_P |= ARMV8_SHA1; - } - if (hwcap2 & HWCAP2_SHA2) { - OPENSSL_armcap_P |= ARMV8_SHA256; - } - } - - OPENSSL_free(cpuinfo_data); -} - -int CRYPTO_has_broken_NEON(void) { return g_has_broken_neon; } - -int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; } - -#endif // OPENSSL_ARM && !OPENSSL_STATIC_ARMCAP diff --git a/Pods/BoringSSL-GRPC/crypto/ecdh/ecdh.c b/Pods/BoringSSL-GRPC/crypto/ecdh/ecdh.c deleted file mode 100644 index 4ad46e1ed..000000000 --- a/Pods/BoringSSL-GRPC/crypto/ecdh/ecdh.c +++ /dev/null @@ -1,162 +0,0 @@ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * The Elliptic Curve Public-Key Crypto Library (ECC Code) included - * herein is developed by SUN MICROSYSTEMS, INC., and is contributed - * to the OpenSSL project. - * - * The ECC Code is licensed pursuant to the OpenSSL open source - * license provided below. - * - * The ECDH software is originally written by Douglas Stebila of - * Sun Microsystems Laboratories. - * - */ -/* ==================================================================== - * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include -#include - -#include -#include -#include -#include - -#include "../fipsmodule/ec/internal.h" -#include "../internal.h" - - -int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, - const EC_KEY *priv_key, - void *(*kdf)(const void *in, size_t inlen, void *out, - size_t *outlen)) { - if (priv_key->priv_key == NULL) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); - return -1; - } - const EC_SCALAR *const priv = &priv_key->priv_key->scalar; - - BN_CTX *ctx = BN_CTX_new(); - if (ctx == NULL) { - return -1; - } - BN_CTX_start(ctx); - - int ret = -1; - size_t buflen = 0; - uint8_t *buf = NULL; - - const EC_GROUP *const group = EC_KEY_get0_group(priv_key); - EC_POINT *tmp = EC_POINT_new(group); - if (tmp == NULL) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_MALLOC_FAILURE); - goto err; - } - - if (!ec_point_mul_scalar(group, tmp, NULL, pub_key, priv, ctx)) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); - goto err; - } - - BIGNUM *x = BN_CTX_get(ctx); - if (!x) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_MALLOC_FAILURE); - goto err; - } - - if (!EC_POINT_get_affine_coordinates_GFp(group, tmp, x, NULL, ctx)) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); - goto err; - } - - buflen = (EC_GROUP_get_degree(group) + 7) / 8; - buf = OPENSSL_malloc(buflen); - if (buf == NULL) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_MALLOC_FAILURE); - goto err; - } - - if (!BN_bn2bin_padded(buf, buflen, x)) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_INTERNAL_ERROR); - goto err; - } - - if (kdf != NULL) { - if (kdf(buf, buflen, out, &outlen) == NULL) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_KDF_FAILED); - goto err; - } - } else { - // no KDF, just copy as much as we can - if (buflen < outlen) { - outlen = buflen; - } - OPENSSL_memcpy(out, buf, outlen); - } - - if (outlen > INT_MAX) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_OVERFLOW); - goto err; - } - - ret = (int)outlen; - -err: - OPENSSL_free(buf); - EC_POINT_free(tmp); - BN_CTX_end(ctx); - BN_CTX_free(ctx); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/ecdh/ecdh.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/ecdh/ecdh.c.grpc_back deleted file mode 100644 index 7634ba590..000000000 --- a/Pods/BoringSSL-GRPC/crypto/ecdh/ecdh.c.grpc_back +++ /dev/null @@ -1,162 +0,0 @@ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * The Elliptic Curve Public-Key Crypto Library (ECC Code) included - * herein is developed by SUN MICROSYSTEMS, INC., and is contributed - * to the OpenSSL project. - * - * The ECC Code is licensed pursuant to the OpenSSL open source - * license provided below. - * - * The ECDH software is originally written by Douglas Stebila of - * Sun Microsystems Laboratories. - * - */ -/* ==================================================================== - * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include -#include - -#include -#include -#include -#include - -#include "../fipsmodule/ec/internal.h" -#include "../internal.h" - - -int ECDH_compute_key(void *out, size_t outlen, const EC_POINT *pub_key, - const EC_KEY *priv_key, - void *(*kdf)(const void *in, size_t inlen, void *out, - size_t *outlen)) { - if (priv_key->priv_key == NULL) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); - return -1; - } - const EC_SCALAR *const priv = &priv_key->priv_key->scalar; - - BN_CTX *ctx = BN_CTX_new(); - if (ctx == NULL) { - return -1; - } - BN_CTX_start(ctx); - - int ret = -1; - size_t buflen = 0; - uint8_t *buf = NULL; - - const EC_GROUP *const group = EC_KEY_get0_group(priv_key); - EC_POINT *tmp = EC_POINT_new(group); - if (tmp == NULL) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_MALLOC_FAILURE); - goto err; - } - - if (!ec_point_mul_scalar(group, tmp, NULL, pub_key, priv, ctx)) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); - goto err; - } - - BIGNUM *x = BN_CTX_get(ctx); - if (!x) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_MALLOC_FAILURE); - goto err; - } - - if (!EC_POINT_get_affine_coordinates_GFp(group, tmp, x, NULL, ctx)) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); - goto err; - } - - buflen = (EC_GROUP_get_degree(group) + 7) / 8; - buf = OPENSSL_malloc(buflen); - if (buf == NULL) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_MALLOC_FAILURE); - goto err; - } - - if (!BN_bn2bin_padded(buf, buflen, x)) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_INTERNAL_ERROR); - goto err; - } - - if (kdf != NULL) { - if (kdf(buf, buflen, out, &outlen) == NULL) { - OPENSSL_PUT_ERROR(ECDH, ECDH_R_KDF_FAILED); - goto err; - } - } else { - // no KDF, just copy as much as we can - if (buflen < outlen) { - outlen = buflen; - } - OPENSSL_memcpy(out, buf, outlen); - } - - if (outlen > INT_MAX) { - OPENSSL_PUT_ERROR(ECDH, ERR_R_OVERFLOW); - goto err; - } - - ret = (int)outlen; - -err: - OPENSSL_free(buf); - EC_POINT_free(tmp); - BN_CTX_end(ctx); - BN_CTX_free(ctx); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/err/internal.h b/Pods/BoringSSL-GRPC/crypto/err/internal.h deleted file mode 100644 index 094579234..000000000 --- a/Pods/BoringSSL-GRPC/crypto/err/internal.h +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H -#define OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// Private error queue functions. - -// ERR_SAVE_STATE contains a saved representation of the error queue. It is -// slightly more compact than |ERR_STATE| as the error queue will typically not -// contain |ERR_NUM_ERRORS| entries. -typedef struct err_save_state_st ERR_SAVE_STATE; - -// ERR_SAVE_STATE_free releases all memory associated with |state|. -OPENSSL_EXPORT void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state); - -// ERR_save_state returns a newly-allocated |ERR_SAVE_STATE| structure -// containing the current state of the error queue or NULL on allocation -// error. It should be released with |ERR_SAVE_STATE_free|. -OPENSSL_EXPORT ERR_SAVE_STATE *ERR_save_state(void); - -// ERR_restore_state clears the error queue and replaces it with |state|. -OPENSSL_EXPORT void ERR_restore_state(const ERR_SAVE_STATE *state); - - -#if defined(__cplusplus) -} // extern C - -extern "C++" { - -namespace bssl { - -BORINGSSL_MAKE_DELETER(ERR_SAVE_STATE, ERR_SAVE_STATE_free) - -} // namespace bssl - -} // extern C++ -#endif - -#endif // OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/err/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/err/internal.h.grpc_back deleted file mode 100644 index 3f2397c1c..000000000 --- a/Pods/BoringSSL-GRPC/crypto/err/internal.h.grpc_back +++ /dev/null @@ -1,58 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H -#define OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// Private error queue functions. - -// ERR_SAVE_STATE contains a saved representation of the error queue. It is -// slightly more compact than |ERR_STATE| as the error queue will typically not -// contain |ERR_NUM_ERRORS| entries. -typedef struct err_save_state_st ERR_SAVE_STATE; - -// ERR_SAVE_STATE_free releases all memory associated with |state|. -OPENSSL_EXPORT void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state); - -// ERR_save_state returns a newly-allocated |ERR_SAVE_STATE| structure -// containing the current state of the error queue or NULL on allocation -// error. It should be released with |ERR_SAVE_STATE_free|. -OPENSSL_EXPORT ERR_SAVE_STATE *ERR_save_state(void); - -// ERR_restore_state clears the error queue and replaces it with |state|. -OPENSSL_EXPORT void ERR_restore_state(const ERR_SAVE_STATE *state); - - -#if defined(__cplusplus) -} // extern C - -extern "C++" { - -namespace bssl { - -BORINGSSL_MAKE_DELETER(ERR_SAVE_STATE, ERR_SAVE_STATE_free) - -} // namespace bssl - -} // extern C++ -#endif - -#endif // OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/evp/internal.h b/Pods/BoringSSL-GRPC/crypto/evp/internal.h deleted file mode 100644 index cc92a2cd0..000000000 --- a/Pods/BoringSSL-GRPC/crypto/evp/internal.h +++ /dev/null @@ -1,252 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_EVP_INTERNAL_H -#define OPENSSL_HEADER_EVP_INTERNAL_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -struct evp_pkey_asn1_method_st { - int pkey_id; - uint8_t oid[9]; - uint8_t oid_len; - - // pub_decode decodes |params| and |key| as a SubjectPublicKeyInfo - // and writes the result into |out|. It returns one on success and zero on - // error. |params| is the AlgorithmIdentifier after the OBJECT IDENTIFIER - // type field, and |key| is the contents of the subjectPublicKey with the - // leading padding byte checked and removed. Although X.509 uses BIT STRINGs - // to represent SubjectPublicKeyInfo, every key type defined encodes the key - // as a byte string with the same conversion to BIT STRING. - int (*pub_decode)(EVP_PKEY *out, CBS *params, CBS *key); - - // pub_encode encodes |key| as a SubjectPublicKeyInfo and appends the result - // to |out|. It returns one on success and zero on error. - int (*pub_encode)(CBB *out, const EVP_PKEY *key); - - int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); - - // priv_decode decodes |params| and |key| as a PrivateKeyInfo and writes the - // result into |out|. It returns one on success and zero on error. |params| is - // the AlgorithmIdentifier after the OBJECT IDENTIFIER type field, and |key| - // is the contents of the OCTET STRING privateKey field. - int (*priv_decode)(EVP_PKEY *out, CBS *params, CBS *key); - - // priv_encode encodes |key| as a PrivateKeyInfo and appends the result to - // |out|. It returns one on success and zero on error. - int (*priv_encode)(CBB *out, const EVP_PKEY *key); - - // pkey_opaque returns 1 if the |pk| is opaque. Opaque keys are backed by - // custom implementations which do not expose key material and parameters. - int (*pkey_opaque)(const EVP_PKEY *pk); - - int (*pkey_size)(const EVP_PKEY *pk); - int (*pkey_bits)(const EVP_PKEY *pk); - - int (*param_missing)(const EVP_PKEY *pk); - int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); - int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); - - void (*pkey_free)(EVP_PKEY *pkey); -} /* EVP_PKEY_ASN1_METHOD */; - - -#define EVP_PKEY_OP_UNDEFINED 0 -#define EVP_PKEY_OP_KEYGEN (1 << 2) -#define EVP_PKEY_OP_SIGN (1 << 3) -#define EVP_PKEY_OP_VERIFY (1 << 4) -#define EVP_PKEY_OP_VERIFYRECOVER (1 << 5) -#define EVP_PKEY_OP_ENCRYPT (1 << 6) -#define EVP_PKEY_OP_DECRYPT (1 << 7) -#define EVP_PKEY_OP_DERIVE (1 << 8) - -#define EVP_PKEY_OP_TYPE_SIG \ - (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER) - -#define EVP_PKEY_OP_TYPE_CRYPT (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) - -#define EVP_PKEY_OP_TYPE_NOGEN \ - (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE) - -#define EVP_PKEY_OP_TYPE_GEN EVP_PKEY_OP_KEYGEN - -// EVP_PKEY_CTX_ctrl performs |cmd| on |ctx|. The |keytype| and |optype| -// arguments can be -1 to specify that any type and operation are acceptable, -// otherwise |keytype| must match the type of |ctx| and the bits of |optype| -// must intersect the operation flags set on |ctx|. -// -// The |p1| and |p2| arguments depend on the value of |cmd|. -// -// It returns one on success and zero on error. -OPENSSL_EXPORT int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, - int cmd, int p1, void *p2); - -#define EVP_PKEY_CTRL_MD 1 -#define EVP_PKEY_CTRL_GET_MD 2 - -// EVP_PKEY_CTRL_PEER_KEY is called with different values of |p1|: -// 0: Is called from |EVP_PKEY_derive_set_peer| and |p2| contains a peer key. -// If the return value is <= 0, the key is rejected. -// 1: Is called at the end of |EVP_PKEY_derive_set_peer| and |p2| contains a -// peer key. If the return value is <= 0, the key is rejected. -// 2: Is called with |p2| == NULL to test whether the peer's key was used. -// (EC)DH always return one in this case. -// 3: Is called with |p2| == NULL to set whether the peer's key was used. -// (EC)DH always return one in this case. This was only used for GOST. -#define EVP_PKEY_CTRL_PEER_KEY 3 - -// EVP_PKEY_ALG_CTRL is the base value from which key-type specific ctrl -// commands are numbered. -#define EVP_PKEY_ALG_CTRL 0x1000 - -#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) -#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 2) -#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 3) -#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 4) -#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 5) -#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 6) -#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 7) -#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 8) -#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 9) -#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 10) -#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 11) -#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) - -struct evp_pkey_ctx_st { - // Method associated with this operation - const EVP_PKEY_METHOD *pmeth; - // Engine that implements this method or NULL if builtin - ENGINE *engine; - // Key: may be NULL - EVP_PKEY *pkey; - // Peer key for key agreement, may be NULL - EVP_PKEY *peerkey; - // operation contains one of the |EVP_PKEY_OP_*| values. - int operation; - // Algorithm specific data - void *data; -} /* EVP_PKEY_CTX */; - -struct evp_pkey_method_st { - int pkey_id; - - int (*init)(EVP_PKEY_CTX *ctx); - int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src); - void (*cleanup)(EVP_PKEY_CTX *ctx); - - int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); - - int (*sign)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, - const uint8_t *tbs, size_t tbslen); - - int (*sign_message)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, - const uint8_t *tbs, size_t tbslen); - - int (*verify)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, - const uint8_t *tbs, size_t tbslen); - - int (*verify_message)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, - const uint8_t *tbs, size_t tbslen); - - int (*verify_recover)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len, - const uint8_t *sig, size_t sig_len); - - int (*encrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, - const uint8_t *in, size_t inlen); - - int (*decrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, - const uint8_t *in, size_t inlen); - - int (*derive)(EVP_PKEY_CTX *ctx, uint8_t *key, size_t *keylen); - - int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); -} /* EVP_PKEY_METHOD */; - -typedef struct { - union { - uint8_t priv[64]; - struct { - // Shift the location of the public key to align with where it is in the - // private key representation. - uint8_t pad[32]; - uint8_t value[32]; - } pub; - } key; - char has_private; -} ED25519_KEY; - -extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth; -extern const EVP_PKEY_ASN1_METHOD ec_asn1_meth; -extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth; -extern const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth; - -extern const EVP_PKEY_METHOD rsa_pkey_meth; -extern const EVP_PKEY_METHOD ec_pkey_meth; -extern const EVP_PKEY_METHOD ed25519_pkey_meth; - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_EVP_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/evp/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/evp/internal.h.grpc_back deleted file mode 100644 index 4aefa3526..000000000 --- a/Pods/BoringSSL-GRPC/crypto/evp/internal.h.grpc_back +++ /dev/null @@ -1,252 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_EVP_INTERNAL_H -#define OPENSSL_HEADER_EVP_INTERNAL_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -struct evp_pkey_asn1_method_st { - int pkey_id; - uint8_t oid[9]; - uint8_t oid_len; - - // pub_decode decodes |params| and |key| as a SubjectPublicKeyInfo - // and writes the result into |out|. It returns one on success and zero on - // error. |params| is the AlgorithmIdentifier after the OBJECT IDENTIFIER - // type field, and |key| is the contents of the subjectPublicKey with the - // leading padding byte checked and removed. Although X.509 uses BIT STRINGs - // to represent SubjectPublicKeyInfo, every key type defined encodes the key - // as a byte string with the same conversion to BIT STRING. - int (*pub_decode)(EVP_PKEY *out, CBS *params, CBS *key); - - // pub_encode encodes |key| as a SubjectPublicKeyInfo and appends the result - // to |out|. It returns one on success and zero on error. - int (*pub_encode)(CBB *out, const EVP_PKEY *key); - - int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); - - // priv_decode decodes |params| and |key| as a PrivateKeyInfo and writes the - // result into |out|. It returns one on success and zero on error. |params| is - // the AlgorithmIdentifier after the OBJECT IDENTIFIER type field, and |key| - // is the contents of the OCTET STRING privateKey field. - int (*priv_decode)(EVP_PKEY *out, CBS *params, CBS *key); - - // priv_encode encodes |key| as a PrivateKeyInfo and appends the result to - // |out|. It returns one on success and zero on error. - int (*priv_encode)(CBB *out, const EVP_PKEY *key); - - // pkey_opaque returns 1 if the |pk| is opaque. Opaque keys are backed by - // custom implementations which do not expose key material and parameters. - int (*pkey_opaque)(const EVP_PKEY *pk); - - int (*pkey_size)(const EVP_PKEY *pk); - int (*pkey_bits)(const EVP_PKEY *pk); - - int (*param_missing)(const EVP_PKEY *pk); - int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); - int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); - - void (*pkey_free)(EVP_PKEY *pkey); -} /* EVP_PKEY_ASN1_METHOD */; - - -#define EVP_PKEY_OP_UNDEFINED 0 -#define EVP_PKEY_OP_KEYGEN (1 << 2) -#define EVP_PKEY_OP_SIGN (1 << 3) -#define EVP_PKEY_OP_VERIFY (1 << 4) -#define EVP_PKEY_OP_VERIFYRECOVER (1 << 5) -#define EVP_PKEY_OP_ENCRYPT (1 << 6) -#define EVP_PKEY_OP_DECRYPT (1 << 7) -#define EVP_PKEY_OP_DERIVE (1 << 8) - -#define EVP_PKEY_OP_TYPE_SIG \ - (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER) - -#define EVP_PKEY_OP_TYPE_CRYPT (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) - -#define EVP_PKEY_OP_TYPE_NOGEN \ - (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE) - -#define EVP_PKEY_OP_TYPE_GEN EVP_PKEY_OP_KEYGEN - -// EVP_PKEY_CTX_ctrl performs |cmd| on |ctx|. The |keytype| and |optype| -// arguments can be -1 to specify that any type and operation are acceptable, -// otherwise |keytype| must match the type of |ctx| and the bits of |optype| -// must intersect the operation flags set on |ctx|. -// -// The |p1| and |p2| arguments depend on the value of |cmd|. -// -// It returns one on success and zero on error. -OPENSSL_EXPORT int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, - int cmd, int p1, void *p2); - -#define EVP_PKEY_CTRL_MD 1 -#define EVP_PKEY_CTRL_GET_MD 2 - -// EVP_PKEY_CTRL_PEER_KEY is called with different values of |p1|: -// 0: Is called from |EVP_PKEY_derive_set_peer| and |p2| contains a peer key. -// If the return value is <= 0, the key is rejected. -// 1: Is called at the end of |EVP_PKEY_derive_set_peer| and |p2| contains a -// peer key. If the return value is <= 0, the key is rejected. -// 2: Is called with |p2| == NULL to test whether the peer's key was used. -// (EC)DH always return one in this case. -// 3: Is called with |p2| == NULL to set whether the peer's key was used. -// (EC)DH always return one in this case. This was only used for GOST. -#define EVP_PKEY_CTRL_PEER_KEY 3 - -// EVP_PKEY_ALG_CTRL is the base value from which key-type specific ctrl -// commands are numbered. -#define EVP_PKEY_ALG_CTRL 0x1000 - -#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) -#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 2) -#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 3) -#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 4) -#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 5) -#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 6) -#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 7) -#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 8) -#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 9) -#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 10) -#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 11) -#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) - -struct evp_pkey_ctx_st { - // Method associated with this operation - const EVP_PKEY_METHOD *pmeth; - // Engine that implements this method or NULL if builtin - ENGINE *engine; - // Key: may be NULL - EVP_PKEY *pkey; - // Peer key for key agreement, may be NULL - EVP_PKEY *peerkey; - // operation contains one of the |EVP_PKEY_OP_*| values. - int operation; - // Algorithm specific data - void *data; -} /* EVP_PKEY_CTX */; - -struct evp_pkey_method_st { - int pkey_id; - - int (*init)(EVP_PKEY_CTX *ctx); - int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src); - void (*cleanup)(EVP_PKEY_CTX *ctx); - - int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); - - int (*sign)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, - const uint8_t *tbs, size_t tbslen); - - int (*sign_message)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, - const uint8_t *tbs, size_t tbslen); - - int (*verify)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, - const uint8_t *tbs, size_t tbslen); - - int (*verify_message)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, - const uint8_t *tbs, size_t tbslen); - - int (*verify_recover)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len, - const uint8_t *sig, size_t sig_len); - - int (*encrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, - const uint8_t *in, size_t inlen); - - int (*decrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, - const uint8_t *in, size_t inlen); - - int (*derive)(EVP_PKEY_CTX *ctx, uint8_t *key, size_t *keylen); - - int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); -} /* EVP_PKEY_METHOD */; - -typedef struct { - union { - uint8_t priv[64]; - struct { - // Shift the location of the public key to align with where it is in the - // private key representation. - uint8_t pad[32]; - uint8_t value[32]; - } pub; - } key; - char has_private; -} ED25519_KEY; - -extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth; -extern const EVP_PKEY_ASN1_METHOD ec_asn1_meth; -extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth; -extern const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth; - -extern const EVP_PKEY_METHOD rsa_pkey_meth; -extern const EVP_PKEY_METHOD ec_pkey_meth; -extern const EVP_PKEY_METHOD ed25519_pkey_meth; - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_EVP_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519.c b/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519.c deleted file mode 100644 index 9f4c72f48..000000000 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include "internal.h" - - -// Ed25519 has no parameters to copy. -static int pkey_ed25519_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { return 1; } - -static int pkey_ed25519_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig, - size_t *siglen, const uint8_t *tbs, - size_t tbslen) { - ED25519_KEY *key = ctx->pkey->pkey.ptr; - if (!key->has_private) { - OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); - return 0; - } - - *siglen = 64; - if (sig == NULL) { - return 1; - } - - return ED25519_sign(sig, tbs, tbslen, key->key.priv); -} - -static int pkey_ed25519_verify_message(EVP_PKEY_CTX *ctx, const uint8_t *sig, - size_t siglen, const uint8_t *tbs, - size_t tbslen) { - ED25519_KEY *key = ctx->pkey->pkey.ptr; - if (siglen != 64 || - !ED25519_verify(tbs, tbslen, sig, key->key.pub.value)) { - OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_SIGNATURE); - return 0; - } - - return 1; -} - -const EVP_PKEY_METHOD ed25519_pkey_meth = { - EVP_PKEY_ED25519, - NULL /* init */, - pkey_ed25519_copy, - NULL /* cleanup */, - NULL /* keygen */, - NULL /* sign */, - pkey_ed25519_sign_message, - NULL /* verify */, - pkey_ed25519_verify_message, - NULL /* verify_recover */, - NULL /* encrypt */, - NULL /* decrypt */, - NULL /* derive */, - NULL /* ctrl */, -}; diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519.c.grpc_back deleted file mode 100644 index 554a379c7..000000000 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519.c.grpc_back +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include "internal.h" - - -// Ed25519 has no parameters to copy. -static int pkey_ed25519_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { return 1; } - -static int pkey_ed25519_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig, - size_t *siglen, const uint8_t *tbs, - size_t tbslen) { - ED25519_KEY *key = ctx->pkey->pkey.ptr; - if (!key->has_private) { - OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); - return 0; - } - - *siglen = 64; - if (sig == NULL) { - return 1; - } - - return ED25519_sign(sig, tbs, tbslen, key->key.priv); -} - -static int pkey_ed25519_verify_message(EVP_PKEY_CTX *ctx, const uint8_t *sig, - size_t siglen, const uint8_t *tbs, - size_t tbslen) { - ED25519_KEY *key = ctx->pkey->pkey.ptr; - if (siglen != 64 || - !ED25519_verify(tbs, tbslen, sig, key->key.pub.value)) { - OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_SIGNATURE); - return 0; - } - - return 1; -} - -const EVP_PKEY_METHOD ed25519_pkey_meth = { - EVP_PKEY_ED25519, - NULL /* init */, - pkey_ed25519_copy, - NULL /* cleanup */, - NULL /* keygen */, - NULL /* sign */, - pkey_ed25519_sign_message, - NULL /* verify */, - pkey_ed25519_verify_message, - NULL /* verify_recover */, - NULL /* encrypt */, - NULL /* decrypt */, - NULL /* derive */, - NULL /* ctrl */, -}; diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519_asn1.c b/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519_asn1.c deleted file mode 100644 index 3c8897161..000000000 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519_asn1.c +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include -#include -#include - -#include "internal.h" -#include "../internal.h" - - -static void ed25519_free(EVP_PKEY *pkey) { - OPENSSL_free(pkey->pkey.ptr); - pkey->pkey.ptr = NULL; -} - -static int set_pubkey(EVP_PKEY *pkey, const uint8_t pubkey[32]) { - ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); - if (key == NULL) { - OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); - return 0; - } - key->has_private = 0; - OPENSSL_memcpy(key->key.pub.value, pubkey, 32); - - ed25519_free(pkey); - pkey->pkey.ptr = key; - return 1; -} - -static int set_privkey(EVP_PKEY *pkey, const uint8_t privkey[64]) { - ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); - if (key == NULL) { - OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); - return 0; - } - key->has_private = 1; - OPENSSL_memcpy(key->key.priv, privkey, 64); - - ed25519_free(pkey); - pkey->pkey.ptr = key; - return 1; -} - -static int ed25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { - // See draft-ietf-curdle-pkix-04, section 4. - - // The parameters must be omitted. Public keys have length 32. - if (CBS_len(params) != 0 || - CBS_len(key) != 32) { - OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); - return 0; - } - - return set_pubkey(out, CBS_data(key)); -} - -static int ed25519_pub_encode(CBB *out, const EVP_PKEY *pkey) { - const ED25519_KEY *key = pkey->pkey.ptr; - - // See draft-ietf-curdle-pkix-04, section 4. - CBB spki, algorithm, oid, key_bitstring; - if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || - !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || - !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || - !CBB_add_u8(&key_bitstring, 0 /* padding */) || - !CBB_add_bytes(&key_bitstring, key->key.pub.value, 32) || - !CBB_flush(out)) { - OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); - return 0; - } - - return 1; -} - -static int ed25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { - const ED25519_KEY *a_key = a->pkey.ptr; - const ED25519_KEY *b_key = b->pkey.ptr; - return OPENSSL_memcmp(a_key->key.pub.value, b_key->key.pub.value, 32) == 0; -} - -static int ed25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { - // See draft-ietf-curdle-pkix-04, section 7. - - // Parameters must be empty. The key is a 32-byte value wrapped in an extra - // OCTET STRING layer. - CBS inner; - if (CBS_len(params) != 0 || - !CBS_get_asn1(key, &inner, CBS_ASN1_OCTETSTRING) || - CBS_len(key) != 0 || - CBS_len(&inner) != 32) { - OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); - return 0; - } - - // The PKCS#8 encoding stores only the 32-byte seed, so we must recover the - // full representation which we use from it. - uint8_t pubkey[32], privkey[64]; - ED25519_keypair_from_seed(pubkey, privkey, CBS_data(&inner)); - return set_privkey(out, privkey); -} - -static int ed25519_priv_encode(CBB *out, const EVP_PKEY *pkey) { - ED25519_KEY *key = pkey->pkey.ptr; - if (!key->has_private) { - OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); - return 0; - } - - // See draft-ietf-curdle-pkix-04, section 7. - CBB pkcs8, algorithm, oid, private_key, inner; - if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1_uint64(&pkcs8, 0 /* version */) || - !CBB_add_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || - !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || - !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || - !CBB_add_asn1(&private_key, &inner, CBS_ASN1_OCTETSTRING) || - // The PKCS#8 encoding stores only the 32-byte seed which is the first 32 - // bytes of the private key. - !CBB_add_bytes(&inner, key->key.priv, 32) || - !CBB_flush(out)) { - OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); - return 0; - } - - return 1; -} - -static int ed25519_size(const EVP_PKEY *pkey) { return 64; } - -static int ed25519_bits(const EVP_PKEY *pkey) { return 256; } - -const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { - EVP_PKEY_ED25519, - {0x2b, 0x65, 0x70}, - 3, - ed25519_pub_decode, - ed25519_pub_encode, - ed25519_pub_cmp, - ed25519_priv_decode, - ed25519_priv_encode, - NULL /* pkey_opaque */, - ed25519_size, - ed25519_bits, - NULL /* param_missing */, - NULL /* param_copy */, - NULL /* param_cmp */, - ed25519_free, -}; - -EVP_PKEY *EVP_PKEY_new_ed25519_public(const uint8_t public_key[32]) { - EVP_PKEY *ret = EVP_PKEY_new(); - if (ret == NULL || - !EVP_PKEY_set_type(ret, EVP_PKEY_ED25519) || - !set_pubkey(ret, public_key)) { - EVP_PKEY_free(ret); - return NULL; - } - - return ret; -} - -EVP_PKEY *EVP_PKEY_new_ed25519_private(const uint8_t private_key[64]) { - EVP_PKEY *ret = EVP_PKEY_new(); - if (ret == NULL || - !EVP_PKEY_set_type(ret, EVP_PKEY_ED25519) || - !set_privkey(ret, private_key)) { - EVP_PKEY_free(ret); - return NULL; - } - - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519_asn1.c.grpc_back deleted file mode 100644 index 65b4112a7..000000000 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ed25519_asn1.c.grpc_back +++ /dev/null @@ -1,190 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include -#include -#include - -#include "internal.h" -#include "../internal.h" - - -static void ed25519_free(EVP_PKEY *pkey) { - OPENSSL_free(pkey->pkey.ptr); - pkey->pkey.ptr = NULL; -} - -static int set_pubkey(EVP_PKEY *pkey, const uint8_t pubkey[32]) { - ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); - if (key == NULL) { - OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); - return 0; - } - key->has_private = 0; - OPENSSL_memcpy(key->key.pub.value, pubkey, 32); - - ed25519_free(pkey); - pkey->pkey.ptr = key; - return 1; -} - -static int set_privkey(EVP_PKEY *pkey, const uint8_t privkey[64]) { - ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); - if (key == NULL) { - OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); - return 0; - } - key->has_private = 1; - OPENSSL_memcpy(key->key.priv, privkey, 64); - - ed25519_free(pkey); - pkey->pkey.ptr = key; - return 1; -} - -static int ed25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { - // See draft-ietf-curdle-pkix-04, section 4. - - // The parameters must be omitted. Public keys have length 32. - if (CBS_len(params) != 0 || - CBS_len(key) != 32) { - OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); - return 0; - } - - return set_pubkey(out, CBS_data(key)); -} - -static int ed25519_pub_encode(CBB *out, const EVP_PKEY *pkey) { - const ED25519_KEY *key = pkey->pkey.ptr; - - // See draft-ietf-curdle-pkix-04, section 4. - CBB spki, algorithm, oid, key_bitstring; - if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || - !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || - !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || - !CBB_add_u8(&key_bitstring, 0 /* padding */) || - !CBB_add_bytes(&key_bitstring, key->key.pub.value, 32) || - !CBB_flush(out)) { - OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); - return 0; - } - - return 1; -} - -static int ed25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { - const ED25519_KEY *a_key = a->pkey.ptr; - const ED25519_KEY *b_key = b->pkey.ptr; - return OPENSSL_memcmp(a_key->key.pub.value, b_key->key.pub.value, 32) == 0; -} - -static int ed25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { - // See draft-ietf-curdle-pkix-04, section 7. - - // Parameters must be empty. The key is a 32-byte value wrapped in an extra - // OCTET STRING layer. - CBS inner; - if (CBS_len(params) != 0 || - !CBS_get_asn1(key, &inner, CBS_ASN1_OCTETSTRING) || - CBS_len(key) != 0 || - CBS_len(&inner) != 32) { - OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); - return 0; - } - - // The PKCS#8 encoding stores only the 32-byte seed, so we must recover the - // full representation which we use from it. - uint8_t pubkey[32], privkey[64]; - ED25519_keypair_from_seed(pubkey, privkey, CBS_data(&inner)); - return set_privkey(out, privkey); -} - -static int ed25519_priv_encode(CBB *out, const EVP_PKEY *pkey) { - ED25519_KEY *key = pkey->pkey.ptr; - if (!key->has_private) { - OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); - return 0; - } - - // See draft-ietf-curdle-pkix-04, section 7. - CBB pkcs8, algorithm, oid, private_key, inner; - if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1_uint64(&pkcs8, 0 /* version */) || - !CBB_add_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || - !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || - !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || - !CBB_add_asn1(&private_key, &inner, CBS_ASN1_OCTETSTRING) || - // The PKCS#8 encoding stores only the 32-byte seed which is the first 32 - // bytes of the private key. - !CBB_add_bytes(&inner, key->key.priv, 32) || - !CBB_flush(out)) { - OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); - return 0; - } - - return 1; -} - -static int ed25519_size(const EVP_PKEY *pkey) { return 64; } - -static int ed25519_bits(const EVP_PKEY *pkey) { return 256; } - -const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { - EVP_PKEY_ED25519, - {0x2b, 0x65, 0x70}, - 3, - ed25519_pub_decode, - ed25519_pub_encode, - ed25519_pub_cmp, - ed25519_priv_decode, - ed25519_priv_encode, - NULL /* pkey_opaque */, - ed25519_size, - ed25519_bits, - NULL /* param_missing */, - NULL /* param_copy */, - NULL /* param_cmp */, - ed25519_free, -}; - -EVP_PKEY *EVP_PKEY_new_ed25519_public(const uint8_t public_key[32]) { - EVP_PKEY *ret = EVP_PKEY_new(); - if (ret == NULL || - !EVP_PKEY_set_type(ret, EVP_PKEY_ED25519) || - !set_pubkey(ret, public_key)) { - EVP_PKEY_free(ret); - return NULL; - } - - return ret; -} - -EVP_PKEY *EVP_PKEY_new_ed25519_private(const uint8_t private_key[64]) { - EVP_PKEY *ret = EVP_PKEY_new(); - if (ret == NULL || - !EVP_PKEY_set_type(ret, EVP_PKEY_ED25519) || - !set_privkey(ret, private_key)) { - EVP_PKEY_free(ret); - return NULL; - } - - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/aes.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/aes.c deleted file mode 100644 index af000890e..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/aes.c +++ /dev/null @@ -1,1100 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include - -#include - -#include "internal.h" -#include "../modes/internal.h" - - -#if defined(OPENSSL_NO_ASM) || \ - (!defined(OPENSSL_X86) && !defined(OPENSSL_X86_64) && !defined(OPENSSL_ARM)) - -// Te0[x] = S [x].[02, 01, 01, 03]; -// Te1[x] = S [x].[03, 02, 01, 01]; -// Te2[x] = S [x].[01, 03, 02, 01]; -// Te3[x] = S [x].[01, 01, 03, 02]; -// -// Td0[x] = Si[x].[0e, 09, 0d, 0b]; -// Td1[x] = Si[x].[0b, 0e, 09, 0d]; -// Td2[x] = Si[x].[0d, 0b, 0e, 09]; -// Td3[x] = Si[x].[09, 0d, 0b, 0e]; -// Td4[x] = Si[x].[01]; - -static const uint32_t Te0[256] = { - 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, 0xfff2f20dU, - 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, 0x60303050U, 0x02010103U, - 0xce6767a9U, 0x562b2b7dU, 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, - 0xec76769aU, 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, - 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, 0x41adadecU, - 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, 0x239c9cbfU, 0x53a4a4f7U, - 0xe4727296U, 0x9bc0c05bU, 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, - 0x4c26266aU, 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, - 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, 0xe2717193U, - 0xabd8d873U, 0x62313153U, 0x2a15153fU, 0x0804040cU, 0x95c7c752U, - 0x46232365U, 0x9dc3c35eU, 0x30181828U, 0x379696a1U, 0x0a05050fU, - 0x2f9a9ab5U, 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, - 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, 0x1209091bU, - 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, 0x361b1b2dU, 0xdc6e6eb2U, - 0xb45a5aeeU, 0x5ba0a0fbU, 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, - 0x7db3b3ceU, 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, - 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, 0x40202060U, - 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, 0xd46a6abeU, 0x8dcbcb46U, - 0x67bebed9U, 0x7239394bU, 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, - 0x85cfcf4aU, 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, - 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, 0x8a4545cfU, - 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, 0xa05050f0U, 0x783c3c44U, - 0x259f9fbaU, 0x4ba8a8e3U, 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, - 0x058f8f8aU, 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, - 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, 0x20101030U, - 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, 0x81cdcd4cU, 0x180c0c14U, - 0x26131335U, 0xc3ecec2fU, 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, - 0x2e171739U, 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, - 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, 0xc06060a0U, - 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, 0x44222266U, 0x542a2a7eU, - 0x3b9090abU, 0x0b888883U, 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, - 0x2814143cU, 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, - 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, 0x924949dbU, - 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, 0x9fc2c25dU, 0xbdd3d36eU, - 0x43acacefU, 0xc46262a6U, 0x399191a8U, 0x319595a4U, 0xd3e4e437U, - 0xf279798bU, 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, - 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, 0xd86c6cb4U, - 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, 0xca6565afU, 0xf47a7a8eU, - 0x47aeaee9U, 0x10080818U, 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, - 0x5c2e2e72U, 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, - 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, 0x964b4bddU, - 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, 0xe0707090U, 0x7c3e3e42U, - 0x71b5b5c4U, 0xcc6666aaU, 0x904848d8U, 0x06030305U, 0xf7f6f601U, - 0x1c0e0e12U, 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, - 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, 0xd9e1e138U, - 0xebf8f813U, 0x2b9898b3U, 0x22111133U, 0xd26969bbU, 0xa9d9d970U, - 0x078e8e89U, 0x339494a7U, 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, - 0xc9e9e920U, 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, - 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, 0x65bfbfdaU, - 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, 0x824141c3U, 0x299999b0U, - 0x5a2d2d77U, 0x1e0f0f11U, 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, - 0x2c16163aU, }; - -static const uint32_t Te1[256] = { - 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, 0x0dfff2f2U, - 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, 0x50603030U, 0x03020101U, - 0xa9ce6767U, 0x7d562b2bU, 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, - 0x9aec7676U, 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, - 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, 0xec41adadU, - 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, 0xbf239c9cU, 0xf753a4a4U, - 0x96e47272U, 0x5b9bc0c0U, 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, - 0x6a4c2626U, 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, - 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, 0x93e27171U, - 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, 0x0c080404U, 0x5295c7c7U, - 0x65462323U, 0x5e9dc3c3U, 0x28301818U, 0xa1379696U, 0x0f0a0505U, - 0xb52f9a9aU, 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, - 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, 0x1b120909U, - 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, 0x2d361b1bU, 0xb2dc6e6eU, - 0xeeb45a5aU, 0xfb5ba0a0U, 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, - 0xce7db3b3U, 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, - 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, 0x60402020U, - 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, 0xbed46a6aU, 0x468dcbcbU, - 0xd967bebeU, 0x4b723939U, 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, - 0x4a85cfcfU, 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, - 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, 0xcf8a4545U, - 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, 0xf0a05050U, 0x44783c3cU, - 0xba259f9fU, 0xe34ba8a8U, 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, - 0x8a058f8fU, 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, - 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, 0x30201010U, - 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, 0x4c81cdcdU, 0x14180c0cU, - 0x35261313U, 0x2fc3ececU, 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, - 0x392e1717U, 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, - 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, 0xa0c06060U, - 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, 0x66442222U, 0x7e542a2aU, - 0xab3b9090U, 0x830b8888U, 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, - 0x3c281414U, 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, - 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, 0xdb924949U, - 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, 0x5d9fc2c2U, 0x6ebdd3d3U, - 0xef43acacU, 0xa6c46262U, 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, - 0x8bf27979U, 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, - 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, 0xb4d86c6cU, - 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, 0xafca6565U, 0x8ef47a7aU, - 0xe947aeaeU, 0x18100808U, 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, - 0x725c2e2eU, 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, - 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, 0xdd964b4bU, - 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, 0x90e07070U, 0x427c3e3eU, - 0xc471b5b5U, 0xaacc6666U, 0xd8904848U, 0x05060303U, 0x01f7f6f6U, - 0x121c0e0eU, 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, - 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, 0x38d9e1e1U, - 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, 0xbbd26969U, 0x70a9d9d9U, - 0x89078e8eU, 0xa7339494U, 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, - 0x20c9e9e9U, 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, - 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, 0xda65bfbfU, - 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, 0xc3824141U, 0xb0299999U, - 0x775a2d2dU, 0x111e0f0fU, 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, - 0x3a2c1616U, }; - -static const uint32_t Te2[256] = { - 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, 0xf20dfff2U, - 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, 0x30506030U, 0x01030201U, - 0x67a9ce67U, 0x2b7d562bU, 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, - 0x769aec76U, 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, - 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, 0xadec41adU, - 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, 0x9cbf239cU, 0xa4f753a4U, - 0x7296e472U, 0xc05b9bc0U, 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, - 0x266a4c26U, 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, - 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, 0x7193e271U, - 0xd873abd8U, 0x31536231U, 0x153f2a15U, 0x040c0804U, 0xc75295c7U, - 0x23654623U, 0xc35e9dc3U, 0x18283018U, 0x96a13796U, 0x050f0a05U, - 0x9ab52f9aU, 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, - 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, 0x091b1209U, - 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, 0x1b2d361bU, 0x6eb2dc6eU, - 0x5aeeb45aU, 0xa0fb5ba0U, 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, - 0xb3ce7db3U, 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, - 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, 0x20604020U, - 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, 0x6abed46aU, 0xcb468dcbU, - 0xbed967beU, 0x394b7239U, 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, - 0xcf4a85cfU, 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, - 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, 0x45cf8a45U, - 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, 0x50f0a050U, 0x3c44783cU, - 0x9fba259fU, 0xa8e34ba8U, 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, - 0x8f8a058fU, 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, - 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, 0x10302010U, - 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, 0xcd4c81cdU, 0x0c14180cU, - 0x13352613U, 0xec2fc3ecU, 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, - 0x17392e17U, 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, - 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, 0x60a0c060U, - 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, 0x22664422U, 0x2a7e542aU, - 0x90ab3b90U, 0x88830b88U, 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, - 0x143c2814U, 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, - 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, 0x49db9249U, - 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, 0xc25d9fc2U, 0xd36ebdd3U, - 0xacef43acU, 0x62a6c462U, 0x91a83991U, 0x95a43195U, 0xe437d3e4U, - 0x798bf279U, 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, - 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, 0x6cb4d86cU, - 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, 0x65afca65U, 0x7a8ef47aU, - 0xaee947aeU, 0x08181008U, 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, - 0x2e725c2eU, 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, - 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, 0x4bdd964bU, - 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, 0x7090e070U, 0x3e427c3eU, - 0xb5c471b5U, 0x66aacc66U, 0x48d89048U, 0x03050603U, 0xf601f7f6U, - 0x0e121c0eU, 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, - 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, 0xe138d9e1U, - 0xf813ebf8U, 0x98b32b98U, 0x11332211U, 0x69bbd269U, 0xd970a9d9U, - 0x8e89078eU, 0x94a73394U, 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, - 0xe920c9e9U, 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, - 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, 0xbfda65bfU, - 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, 0x41c38241U, 0x99b02999U, - 0x2d775a2dU, 0x0f111e0fU, 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, - 0x163a2c16U, }; - -static const uint32_t Te3[256] = { - 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, 0xf2f20dffU, - 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, 0x30305060U, 0x01010302U, - 0x6767a9ceU, 0x2b2b7d56U, 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, - 0x76769aecU, 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, - 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, 0xadadec41U, - 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, 0x9c9cbf23U, 0xa4a4f753U, - 0x727296e4U, 0xc0c05b9bU, 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, - 0x26266a4cU, 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, - 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, 0x717193e2U, - 0xd8d873abU, 0x31315362U, 0x15153f2aU, 0x04040c08U, 0xc7c75295U, - 0x23236546U, 0xc3c35e9dU, 0x18182830U, 0x9696a137U, 0x05050f0aU, - 0x9a9ab52fU, 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, - 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, 0x09091b12U, - 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, 0x1b1b2d36U, 0x6e6eb2dcU, - 0x5a5aeeb4U, 0xa0a0fb5bU, 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, - 0xb3b3ce7dU, 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, - 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, 0x20206040U, - 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, 0x6a6abed4U, 0xcbcb468dU, - 0xbebed967U, 0x39394b72U, 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, - 0xcfcf4a85U, 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, - 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, 0x4545cf8aU, - 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, 0x5050f0a0U, 0x3c3c4478U, - 0x9f9fba25U, 0xa8a8e34bU, 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, - 0x8f8f8a05U, 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, - 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, 0x10103020U, - 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, 0xcdcd4c81U, 0x0c0c1418U, - 0x13133526U, 0xecec2fc3U, 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, - 0x1717392eU, 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, - 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, 0x6060a0c0U, - 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, 0x22226644U, 0x2a2a7e54U, - 0x9090ab3bU, 0x8888830bU, 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, - 0x14143c28U, 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, - 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, 0x4949db92U, - 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, 0xc2c25d9fU, 0xd3d36ebdU, - 0xacacef43U, 0x6262a6c4U, 0x9191a839U, 0x9595a431U, 0xe4e437d3U, - 0x79798bf2U, 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, - 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, 0x6c6cb4d8U, - 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, 0x6565afcaU, 0x7a7a8ef4U, - 0xaeaee947U, 0x08081810U, 0xbabad56fU, 0x787888f0U, 0x25256f4aU, - 0x2e2e725cU, 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, - 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, 0x4b4bdd96U, - 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, 0x707090e0U, 0x3e3e427cU, - 0xb5b5c471U, 0x6666aaccU, 0x4848d890U, 0x03030506U, 0xf6f601f7U, - 0x0e0e121cU, 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, - 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, 0xe1e138d9U, - 0xf8f813ebU, 0x9898b32bU, 0x11113322U, 0x6969bbd2U, 0xd9d970a9U, - 0x8e8e8907U, 0x9494a733U, 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, - 0xe9e920c9U, 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, - 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, 0xbfbfda65U, - 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, 0x4141c382U, 0x9999b029U, - 0x2d2d775aU, 0x0f0f111eU, 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, - 0x16163a2cU, }; - -static const uint32_t Td0[256] = { - 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, 0x3bab6bcbU, - 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, 0x2030fa55U, 0xad766df6U, - 0x88cc7691U, 0xf5024c25U, 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, - 0xb562a38fU, 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, - 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, 0x038f5fe7U, - 0x15929c95U, 0xbf6d7aebU, 0x955259daU, 0xd4be832dU, 0x587421d3U, - 0x49e06929U, 0x8ec9c844U, 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, - 0x27b971ddU, 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, - 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, 0xb16477e0U, - 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, 0x70486858U, 0x8f45fd19U, - 0x94de6c87U, 0x527bf8b7U, 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, - 0x6655ab2aU, 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, - 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, 0x8acf1c2bU, - 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, 0x65daf4cdU, 0x0605bed5U, - 0xd134621fU, 0xc4a6fe8aU, 0x342e539dU, 0xa2f355a0U, 0x058ae132U, - 0xa4f6eb75U, 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, - 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, 0x91548db5U, - 0x71c45d05U, 0x0406d46fU, 0x605015ffU, 0x1998fb24U, 0xd6bde997U, - 0x894043ccU, 0x67d99e77U, 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, - 0x79c8eedbU, 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, - 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, 0xfd0efffbU, - 0x0f853856U, 0x3daed51eU, 0x362d3927U, 0x0a0fd964U, 0x685ca621U, - 0x9b5b54d1U, 0x24362e3aU, 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, - 0x1b9b919eU, 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, - 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, 0x0e090d0bU, - 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, 0x57f11985U, 0xaf75074cU, - 0xee99ddbbU, 0xa37f60fdU, 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, - 0x5bfb7e34U, 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, - 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, 0x854a247dU, - 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, 0x1d9e2f4bU, 0xdcb230f3U, - 0x0d8652ecU, 0x77c1e3d0U, 0x2bb3166cU, 0xa970b999U, 0x119448faU, - 0x47e96422U, 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, - 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, 0xa6f581cfU, - 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, 0x2c3a9de4U, 0x5078920dU, - 0x6a5fcc9bU, 0x547e4662U, 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, - 0x82c3aff5U, 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, - 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, 0xcd267809U, - 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, 0xe6956e65U, 0xaaffe67eU, - 0x21bccf08U, 0xef15e8e6U, 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, - 0x29b07cd6U, 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, - 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, 0xf104984aU, - 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, 0x764dd68dU, 0x43efb04dU, - 0xccaa4d54U, 0xe49604dfU, 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, - 0x4665517fU, 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, - 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, 0x9ad7618cU, - 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, 0xcea927eeU, 0xb761c935U, - 0xe11ce5edU, 0x7a47b13cU, 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, - 0x73c737bfU, 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, - 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, 0x161dc372U, - 0xbce2250cU, 0x283c498bU, 0xff0d9541U, 0x39a80171U, 0x080cb3deU, - 0xd8b4e49cU, 0x6456c190U, 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, - 0xd0b85742U, }; - -static const uint32_t Td1[256] = { - 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, 0xcb3bab6bU, - 0xf11f9d45U, 0xabacfa58U, 0x934be303U, 0x552030faU, 0xf6ad766dU, - 0x9188cc76U, 0x25f5024cU, 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, - 0x8fb562a3U, 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, - 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, 0xe7038f5fU, - 0x9515929cU, 0xebbf6d7aU, 0xda955259U, 0x2dd4be83U, 0xd3587421U, - 0x2949e069U, 0x448ec9c8U, 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, - 0xdd27b971U, 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, - 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, 0xe0b16477U, - 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, 0x58704868U, 0x198f45fdU, - 0x8794de6cU, 0xb7527bf8U, 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, - 0x2a6655abU, 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, - 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, 0x2b8acf1cU, - 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, 0xcd65daf4U, 0xd50605beU, - 0x1fd13462U, 0x8ac4a6feU, 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, - 0x75a4f6ebU, 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, - 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, 0xb591548dU, - 0x0571c45dU, 0x6f0406d4U, 0xff605015U, 0x241998fbU, 0x97d6bde9U, - 0xcc894043U, 0x7767d99eU, 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, - 0xdb79c8eeU, 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, - 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, 0xfbfd0effU, - 0x560f8538U, 0x1e3daed5U, 0x27362d39U, 0x640a0fd9U, 0x21685ca6U, - 0xd19b5b54U, 0x3a24362eU, 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, - 0x9e1b9b91U, 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, - 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, 0x0b0e090dU, - 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, 0x8557f119U, 0x4caf7507U, - 0xbbee99ddU, 0xfda37f60U, 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, - 0x345bfb7eU, 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, - 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, 0x7d854a24U, - 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, 0x4b1d9e2fU, 0xf3dcb230U, - 0xec0d8652U, 0xd077c1e3U, 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, - 0x2247e964U, 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, - 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, 0xcfa6f581U, - 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, 0xe42c3a9dU, 0x0d507892U, - 0x9b6a5fccU, 0x62547e46U, 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, - 0xf582c3afU, 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, - 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, 0x09cd2678U, - 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, 0x65e6956eU, 0x7eaaffe6U, - 0x0821bccfU, 0xe6ef15e8U, 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, - 0xd629b07cU, 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, - 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, 0x4af10498U, - 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, 0x8d764dd6U, 0x4d43efb0U, - 0x54ccaa4dU, 0xdfe49604U, 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, - 0x7f466551U, 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, - 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, 0x8c9ad761U, - 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, 0xeecea927U, 0x35b761c9U, - 0xede11ce5U, 0x3c7a47b1U, 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, - 0xbf73c737U, 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, - 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, 0x72161dc3U, - 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, 0x7139a801U, 0xde080cb3U, - 0x9cd8b4e4U, 0x906456c1U, 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, - 0x42d0b857U, }; - -static const uint32_t Td2[256] = { - 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, 0x6bcb3babU, - 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, 0xfa552030U, 0x6df6ad76U, - 0x769188ccU, 0x4c25f502U, 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, - 0xa38fb562U, 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, - 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, 0x5fe7038fU, - 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, 0x832dd4beU, 0x21d35874U, - 0x692949e0U, 0xc8448ec9U, 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, - 0x71dd27b9U, 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, - 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, 0x77e0b164U, - 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, 0x68587048U, 0xfd198f45U, - 0x6c8794deU, 0xf8b7527bU, 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, - 0xab2a6655U, 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, - 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, 0x1c2b8acfU, - 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, 0xf4cd65daU, 0xbed50605U, - 0x621fd134U, 0xfe8ac4a6U, 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, - 0xeb75a4f6U, 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, - 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, 0x8db59154U, - 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, 0xfb241998U, 0xe997d6bdU, - 0x43cc8940U, 0x9e7767d9U, 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, - 0xeedb79c8U, 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, - 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, 0xfffbfd0eU, - 0x38560f85U, 0xd51e3daeU, 0x3927362dU, 0xd9640a0fU, 0xa621685cU, - 0x54d19b5bU, 0x2e3a2436U, 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, - 0x919e1b9bU, 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, - 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, 0x0d0b0e09U, - 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, 0x198557f1U, 0x074caf75U, - 0xddbbee99U, 0x60fda37fU, 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, - 0x7e345bfbU, 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, - 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, 0x247d854aU, - 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, 0x2f4b1d9eU, 0x30f3dcb2U, - 0x52ec0d86U, 0xe3d077c1U, 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, - 0x642247e9U, 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, - 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, 0x81cfa6f5U, - 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, 0x9de42c3aU, 0x920d5078U, - 0xcc9b6a5fU, 0x4662547eU, 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, - 0xaff582c3U, 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, - 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, 0x7809cd26U, - 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, 0x6e65e695U, 0xe67eaaffU, - 0xcf0821bcU, 0xe8e6ef15U, 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, - 0x7cd629b0U, 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, - 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, 0x984af104U, - 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, 0xd68d764dU, 0xb04d43efU, - 0x4d54ccaaU, 0x04dfe496U, 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, - 0x517f4665U, 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, - 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, 0x618c9ad7U, - 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, 0x27eecea9U, 0xc935b761U, - 0xe5ede11cU, 0xb13c7a47U, 0xdf599cd2U, 0x733f55f2U, 0xce791814U, - 0x37bf73c7U, 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, - 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, 0xc372161dU, - 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, 0x017139a8U, 0xb3de080cU, - 0xe49cd8b4U, 0xc1906456U, 0x84617bcbU, 0xb670d532U, 0x5c74486cU, - 0x5742d0b8U, }; - -static const uint32_t Td3[256] = { - 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, 0xab6bcb3bU, - 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, 0x30fa5520U, 0x766df6adU, - 0xcc769188U, 0x024c25f5U, 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, - 0x62a38fb5U, 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, - 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, 0x8f5fe703U, - 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, 0xbe832dd4U, 0x7421d358U, - 0xe0692949U, 0xc9c8448eU, 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, - 0xb971dd27U, 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, - 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, 0x6477e0b1U, - 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, 0x48685870U, 0x45fd198fU, - 0xde6c8794U, 0x7bf8b752U, 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, - 0x55ab2a66U, 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, - 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, 0xcf1c2b8aU, - 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, 0xdaf4cd65U, 0x05bed506U, - 0x34621fd1U, 0xa6fe8ac4U, 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, - 0xf6eb75a4U, 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, - 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, 0x548db591U, - 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, 0x98fb2419U, 0xbde997d6U, - 0x4043cc89U, 0xd99e7767U, 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, - 0xc8eedb79U, 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, - 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, 0x0efffbfdU, - 0x8538560fU, 0xaed51e3dU, 0x2d392736U, 0x0fd9640aU, 0x5ca62168U, - 0x5b54d19bU, 0x362e3a24U, 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, - 0x9b919e1bU, 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, - 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, 0x090d0b0eU, - 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, 0xf1198557U, 0x75074cafU, - 0x99ddbbeeU, 0x7f60fda3U, 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, - 0xfb7e345bU, 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, - 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, 0x4a247d85U, - 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, 0x9e2f4b1dU, 0xb230f3dcU, - 0x8652ec0dU, 0xc1e3d077U, 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, - 0xe9642247U, 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, - 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, 0xf581cfa6U, - 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, 0x3a9de42cU, 0x78920d50U, - 0x5fcc9b6aU, 0x7e466254U, 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, - 0xc3aff582U, 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, - 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, 0x267809cdU, - 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, 0x956e65e6U, 0xffe67eaaU, - 0xbccf0821U, 0x15e8e6efU, 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, - 0xb07cd629U, 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, - 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, 0x04984af1U, - 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, 0x4dd68d76U, 0xefb04d43U, - 0xaa4d54ccU, 0x9604dfe4U, 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, - 0x65517f46U, 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, - 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, 0xd7618c9aU, - 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, 0xa927eeceU, 0x61c935b7U, - 0x1ce5ede1U, 0x47b13c7aU, 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, - 0xc737bf73U, 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, - 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, 0x1dc37216U, - 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, 0xa8017139U, 0x0cb3de08U, - 0xb4e49cd8U, 0x56c19064U, 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, - 0xb85742d0U, }; - -static const uint8_t Td4[256] = { - 0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U, 0xbfU, 0x40U, 0xa3U, - 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU, 0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, - 0xffU, 0x87U, 0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU, 0x54U, - 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU, 0xeeU, 0x4cU, 0x95U, 0x0bU, - 0x42U, 0xfaU, 0xc3U, 0x4eU, 0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, - 0xb2U, 0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U, 0x72U, 0xf8U, - 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U, 0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, - 0x65U, 0xb6U, 0x92U, 0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU, - 0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U, 0x90U, 0xd8U, 0xabU, - 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU, 0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, - 0x45U, 0x06U, 0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U, 0xc1U, - 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU, 0x3aU, 0x91U, 0x11U, 0x41U, - 0x4fU, 0x67U, 0xdcU, 0xeaU, 0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, - 0x73U, 0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U, 0xe2U, 0xf9U, - 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU, 0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, - 0x29U, 0xc5U, 0x89U, 0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU, - 0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U, 0x9aU, 0xdbU, 0xc0U, - 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U, 0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, - 0xc7U, 0x31U, 0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU, 0x60U, - 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU, 0x2dU, 0xe5U, 0x7aU, 0x9fU, - 0x93U, 0xc9U, 0x9cU, 0xefU, 0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, - 0xb0U, 0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U, 0x17U, 0x2bU, - 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U, 0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, - 0x21U, 0x0cU, 0x7dU, }; - -static const uint32_t rcon[] = { - 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, - 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000, - // for 128-bit blocks, Rijndael never uses more than 10 rcon values -}; - -int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - uint32_t *rk; - int i = 0; - uint32_t temp; - - if (!key || !aeskey) { - return -1; - } - - switch (bits) { - case 128: - aeskey->rounds = 10; - break; - case 192: - aeskey->rounds = 12; - break; - case 256: - aeskey->rounds = 14; - break; - default: - return -2; - } - - rk = aeskey->rd_key; - - rk[0] = GETU32(key); - rk[1] = GETU32(key + 4); - rk[2] = GETU32(key + 8); - rk[3] = GETU32(key + 12); - if (bits == 128) { - while (1) { - temp = rk[3]; - rk[4] = rk[0] ^ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^ - (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^ - (Te0[(temp) & 0xff] & 0x0000ff00) ^ - (Te1[(temp >> 24)] & 0x000000ff) ^ rcon[i]; - rk[5] = rk[1] ^ rk[4]; - rk[6] = rk[2] ^ rk[5]; - rk[7] = rk[3] ^ rk[6]; - if (++i == 10) { - return 0; - } - rk += 4; - } - } - rk[4] = GETU32(key + 16); - rk[5] = GETU32(key + 20); - if (bits == 192) { - while (1) { - temp = rk[5]; - rk[6] = rk[0] ^ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^ - (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^ - (Te0[(temp) & 0xff] & 0x0000ff00) ^ - (Te1[(temp >> 24)] & 0x000000ff) ^ rcon[i]; - rk[7] = rk[1] ^ rk[6]; - rk[8] = rk[2] ^ rk[7]; - rk[9] = rk[3] ^ rk[8]; - if (++i == 8) { - return 0; - } - rk[10] = rk[4] ^ rk[9]; - rk[11] = rk[5] ^ rk[10]; - rk += 6; - } - } - rk[6] = GETU32(key + 24); - rk[7] = GETU32(key + 28); - if (bits == 256) { - while (1) { - temp = rk[7]; - rk[8] = rk[0] ^ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^ - (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^ - (Te0[(temp) & 0xff] & 0x0000ff00) ^ - (Te1[(temp >> 24)] & 0x000000ff) ^ rcon[i]; - rk[9] = rk[1] ^ rk[8]; - rk[10] = rk[2] ^ rk[9]; - rk[11] = rk[3] ^ rk[10]; - if (++i == 7) { - return 0; - } - temp = rk[11]; - rk[12] = rk[4] ^ (Te2[(temp >> 24)] & 0xff000000) ^ - (Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(temp >> 8) & 0xff] & 0x0000ff00) ^ - (Te1[(temp) & 0xff] & 0x000000ff); - rk[13] = rk[5] ^ rk[12]; - rk[14] = rk[6] ^ rk[13]; - rk[15] = rk[7] ^ rk[14]; - - rk += 8; - } - } - return 0; -} - -int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - uint32_t *rk; - int i, j, status; - uint32_t temp; - - // first, start with an encryption schedule - status = AES_set_encrypt_key(key, bits, aeskey); - if (status < 0) { - return status; - } - - rk = aeskey->rd_key; - - // invert the order of the round keys: - for (i = 0, j = 4 * aeskey->rounds; i < j; i += 4, j -= 4) { - temp = rk[i]; - rk[i] = rk[j]; - rk[j] = temp; - temp = rk[i + 1]; - rk[i + 1] = rk[j + 1]; - rk[j + 1] = temp; - temp = rk[i + 2]; - rk[i + 2] = rk[j + 2]; - rk[j + 2] = temp; - temp = rk[i + 3]; - rk[i + 3] = rk[j + 3]; - rk[j + 3] = temp; - } - // apply the inverse MixColumn transform to all round keys but the first and - // the last: - for (i = 1; i < (int)aeskey->rounds; i++) { - rk += 4; - rk[0] = - Td0[Te1[(rk[0] >> 24)] & 0xff] ^ Td1[Te1[(rk[0] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[0] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[0]) & 0xff] & 0xff]; - rk[1] = - Td0[Te1[(rk[1] >> 24)] & 0xff] ^ Td1[Te1[(rk[1] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[1] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[1]) & 0xff] & 0xff]; - rk[2] = - Td0[Te1[(rk[2] >> 24)] & 0xff] ^ Td1[Te1[(rk[2] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[2] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[2]) & 0xff] & 0xff]; - rk[3] = - Td0[Te1[(rk[3] >> 24)] & 0xff] ^ Td1[Te1[(rk[3] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[3] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[3]) & 0xff] & 0xff]; - } - return 0; -} - -void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - const uint32_t *rk; - uint32_t s0, s1, s2, s3, t0, t1, t2, t3; -#ifndef FULL_UNROLL - int r; -#endif // ?FULL_UNROLL - - assert(in && out && key); - rk = key->rd_key; - - // map byte array block to cipher state - // and add initial round key: - s0 = GETU32(in) ^ rk[0]; - s1 = GETU32(in + 4) ^ rk[1]; - s2 = GETU32(in + 8) ^ rk[2]; - s3 = GETU32(in + 12) ^ rk[3]; -#ifdef FULL_UNROLL - // round 1: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[4]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[5]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[6]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[7]; - // round 2: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[8]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[9]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[10]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[11]; - // round 3: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[12]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[13]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[14]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[15]; - // round 4: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[16]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[17]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[18]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[19]; - // round 5: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[20]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[21]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[22]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[23]; - // round 6: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[24]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[25]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[26]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[27]; - // round 7: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[28]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[29]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[30]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[31]; - // round 8: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[32]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[33]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[34]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[35]; - // round 9: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[36]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[37]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[38]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[39]; - if (key->rounds > 10) { - // round 10: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[40]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[41]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[42]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[43]; - // round 11: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[44]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[45]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[46]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[47]; - if (key->rounds > 12) { - // round 12: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[48]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[49]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[50]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[51]; - // round 13: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[52]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[53]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[54]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[55]; - } - } - rk += key->rounds << 2; -#else // !FULL_UNROLL - // Nr - 1 full rounds: - r = key->rounds >> 1; - for (;;) { - t0 = Te0[(s0 >> 24)] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[(s3) & 0xff] ^ rk[4]; - t1 = Te0[(s1 >> 24)] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[(s0) & 0xff] ^ rk[5]; - t2 = Te0[(s2 >> 24)] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[(s1) & 0xff] ^ rk[6]; - t3 = Te0[(s3 >> 24)] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[(s2) & 0xff] ^ rk[7]; - - rk += 8; - if (--r == 0) { - break; - } - - s0 = Te0[(t0 >> 24)] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[(t3) & 0xff] ^ rk[0]; - s1 = Te0[(t1 >> 24)] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[(t0) & 0xff] ^ rk[1]; - s2 = Te0[(t2 >> 24)] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[(t1) & 0xff] ^ rk[2]; - s3 = Te0[(t3 >> 24)] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[(t2) & 0xff] ^ rk[3]; - } -#endif // ?FULL_UNROLL - // apply last round and map cipher state to byte array block: - s0 = (Te2[(t0 >> 24)] & 0xff000000) ^ (Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t2 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t3) & 0xff] & 0x000000ff) ^ - rk[0]; - PUTU32(out, s0); - s1 = (Te2[(t1 >> 24)] & 0xff000000) ^ (Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t3 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t0) & 0xff] & 0x000000ff) ^ - rk[1]; - PUTU32(out + 4, s1); - s2 = (Te2[(t2 >> 24)] & 0xff000000) ^ (Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t0 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t1) & 0xff] & 0x000000ff) ^ - rk[2]; - PUTU32(out + 8, s2); - s3 = (Te2[(t3 >> 24)] & 0xff000000) ^ (Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t1 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t2) & 0xff] & 0x000000ff) ^ - rk[3]; - PUTU32(out + 12, s3); -} - -void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - const uint32_t *rk; - uint32_t s0, s1, s2, s3, t0, t1, t2, t3; -#ifndef FULL_UNROLL - int r; -#endif // ?FULL_UNROLL - - assert(in && out && key); - rk = key->rd_key; - - // map byte array block to cipher state - // and add initial round key: - s0 = GETU32(in) ^ rk[0]; - s1 = GETU32(in + 4) ^ rk[1]; - s2 = GETU32(in + 8) ^ rk[2]; - s3 = GETU32(in + 12) ^ rk[3]; -#ifdef FULL_UNROLL - // round 1: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[4]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[5]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[6]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[7]; - // round 2: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[8]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[9]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[10]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[11]; - // round 3: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[12]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[13]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[14]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[15]; - // round 4: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[16]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[17]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[18]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[19]; - // round 5: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[20]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[21]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[22]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[23]; - // round 6: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[24]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[25]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[26]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[27]; - // round 7: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[28]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[29]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[30]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[31]; - // round 8: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[32]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[33]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[34]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[35]; - // round 9: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[36]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[37]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[38]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[39]; - if (key->rounds > 10) { - // round 10: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[40]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[41]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[42]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[43]; - // round 11: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[44]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[45]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[46]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[47]; - if (key->rounds > 12) { - // round 12: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[48]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[49]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[50]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[51]; - // round 13: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[52]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[53]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[54]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[55]; - } - } - rk += key->rounds << 2; -#else // !FULL_UNROLL - // Nr - 1 full rounds: - r = key->rounds >> 1; - for (;;) { - t0 = Td0[(s0 >> 24)] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[(s1) & 0xff] ^ rk[4]; - t1 = Td0[(s1 >> 24)] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[(s2) & 0xff] ^ rk[5]; - t2 = Td0[(s2 >> 24)] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[(s3) & 0xff] ^ rk[6]; - t3 = Td0[(s3 >> 24)] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[(s0) & 0xff] ^ rk[7]; - - rk += 8; - if (--r == 0) { - break; - } - - s0 = Td0[(t0 >> 24)] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[(t1) & 0xff] ^ rk[0]; - s1 = Td0[(t1 >> 24)] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[(t2) & 0xff] ^ rk[1]; - s2 = Td0[(t2 >> 24)] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[(t3) & 0xff] ^ rk[2]; - s3 = Td0[(t3 >> 24)] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[(t0) & 0xff] ^ rk[3]; - } -#endif // ?FULL_UNROLL - // apply last round and - // map cipher state to byte array block: - s0 = ((uint32_t)Td4[(t0 >> 24)] << 24) ^ - ((uint32_t)Td4[(t3 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t2 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t1) & 0xff]) ^ rk[0]; - PUTU32(out, s0); - s1 = ((uint32_t)Td4[(t1 >> 24)] << 24) ^ - ((uint32_t)Td4[(t0 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t3 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t2) & 0xff]) ^ rk[1]; - PUTU32(out + 4, s1); - s2 = ((uint32_t)Td4[(t2 >> 24)] << 24) ^ - ((uint32_t)Td4[(t1 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t0 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t3) & 0xff]) ^ rk[2]; - PUTU32(out + 8, s2); - s3 = ((uint32_t)Td4[(t3 >> 24)] << 24) ^ - ((uint32_t)Td4[(t2 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t1 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t0) & 0xff]) ^ rk[3]; - PUTU32(out + 12, s3); -} - -#else - -// In this case several functions are provided by asm code. However, one cannot -// control asm symbol visibility with command line flags and such so they are -// always hidden and wrapped by these C functions, which can be so -// controlled. - -void asm_AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - if (hwaes_capable()) { - aes_hw_encrypt(in, out, key); - } else { - asm_AES_encrypt(in, out, key); - } -} - -void asm_AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - if (hwaes_capable()) { - aes_hw_decrypt(in, out, key); - } else { - asm_AES_decrypt(in, out, key); - } -} - -int asm_AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey); -int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - if (hwaes_capable()) { - return aes_hw_set_encrypt_key(key, bits, aeskey); - } else { - return asm_AES_set_encrypt_key(key, bits, aeskey); - } -} - -int asm_AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey); -int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - if (hwaes_capable()) { - return aes_hw_set_decrypt_key(key, bits, aeskey); - } else { - return asm_AES_set_decrypt_key(key, bits, aeskey); - } -} - -#endif // OPENSSL_NO_ASM || (!OPENSSL_X86 && !OPENSSL_X86_64 && !OPENSSL_ARM) diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/aes.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/aes.c.grpc_back deleted file mode 100644 index a988b3959..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/aes.c.grpc_back +++ /dev/null @@ -1,1100 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include - -#include - -#include "internal.h" -#include "../modes/internal.h" - - -#if defined(OPENSSL_NO_ASM) || \ - (!defined(OPENSSL_X86) && !defined(OPENSSL_X86_64) && !defined(OPENSSL_ARM)) - -// Te0[x] = S [x].[02, 01, 01, 03]; -// Te1[x] = S [x].[03, 02, 01, 01]; -// Te2[x] = S [x].[01, 03, 02, 01]; -// Te3[x] = S [x].[01, 01, 03, 02]; -// -// Td0[x] = Si[x].[0e, 09, 0d, 0b]; -// Td1[x] = Si[x].[0b, 0e, 09, 0d]; -// Td2[x] = Si[x].[0d, 0b, 0e, 09]; -// Td3[x] = Si[x].[09, 0d, 0b, 0e]; -// Td4[x] = Si[x].[01]; - -static const uint32_t Te0[256] = { - 0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU, 0xfff2f20dU, - 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U, 0x60303050U, 0x02010103U, - 0xce6767a9U, 0x562b2b7dU, 0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, - 0xec76769aU, 0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U, - 0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU, 0x41adadecU, - 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU, 0x239c9cbfU, 0x53a4a4f7U, - 0xe4727296U, 0x9bc0c05bU, 0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, - 0x4c26266aU, 0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU, - 0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U, 0xe2717193U, - 0xabd8d873U, 0x62313153U, 0x2a15153fU, 0x0804040cU, 0x95c7c752U, - 0x46232365U, 0x9dc3c35eU, 0x30181828U, 0x379696a1U, 0x0a05050fU, - 0x2f9a9ab5U, 0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU, - 0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU, 0x1209091bU, - 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU, 0x361b1b2dU, 0xdc6e6eb2U, - 0xb45a5aeeU, 0x5ba0a0fbU, 0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, - 0x7db3b3ceU, 0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U, - 0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU, 0x40202060U, - 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU, 0xd46a6abeU, 0x8dcbcb46U, - 0x67bebed9U, 0x7239394bU, 0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, - 0x85cfcf4aU, 0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U, - 0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U, 0x8a4545cfU, - 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U, 0xa05050f0U, 0x783c3c44U, - 0x259f9fbaU, 0x4ba8a8e3U, 0xa25151f3U, 0x5da3a3feU, 0x804040c0U, - 0x058f8f8aU, 0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U, - 0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U, 0x20101030U, - 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU, 0x81cdcd4cU, 0x180c0c14U, - 0x26131335U, 0xc3ecec2fU, 0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, - 0x2e171739U, 0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U, - 0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U, 0xc06060a0U, - 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU, 0x44222266U, 0x542a2a7eU, - 0x3b9090abU, 0x0b888883U, 0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, - 0x2814143cU, 0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U, - 0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU, 0x924949dbU, - 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U, 0x9fc2c25dU, 0xbdd3d36eU, - 0x43acacefU, 0xc46262a6U, 0x399191a8U, 0x319595a4U, 0xd3e4e437U, - 0xf279798bU, 0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U, - 0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U, 0xd86c6cb4U, - 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U, 0xca6565afU, 0xf47a7a8eU, - 0x47aeaee9U, 0x10080818U, 0x6fbabad5U, 0xf0787888U, 0x4a25256fU, - 0x5c2e2e72U, 0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U, - 0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U, 0x964b4bddU, - 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U, 0xe0707090U, 0x7c3e3e42U, - 0x71b5b5c4U, 0xcc6666aaU, 0x904848d8U, 0x06030305U, 0xf7f6f601U, - 0x1c0e0e12U, 0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U, - 0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U, 0xd9e1e138U, - 0xebf8f813U, 0x2b9898b3U, 0x22111133U, 0xd26969bbU, 0xa9d9d970U, - 0x078e8e89U, 0x339494a7U, 0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, - 0xc9e9e920U, 0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU, - 0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U, 0x65bfbfdaU, - 0xd7e6e631U, 0x844242c6U, 0xd06868b8U, 0x824141c3U, 0x299999b0U, - 0x5a2d2d77U, 0x1e0f0f11U, 0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, - 0x2c16163aU, }; - -static const uint32_t Te1[256] = { - 0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU, 0x0dfff2f2U, - 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U, 0x50603030U, 0x03020101U, - 0xa9ce6767U, 0x7d562b2bU, 0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, - 0x9aec7676U, 0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU, - 0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U, 0xec41adadU, - 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU, 0xbf239c9cU, 0xf753a4a4U, - 0x96e47272U, 0x5b9bc0c0U, 0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, - 0x6a4c2626U, 0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU, - 0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U, 0x93e27171U, - 0x73abd8d8U, 0x53623131U, 0x3f2a1515U, 0x0c080404U, 0x5295c7c7U, - 0x65462323U, 0x5e9dc3c3U, 0x28301818U, 0xa1379696U, 0x0f0a0505U, - 0xb52f9a9aU, 0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U, - 0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U, 0x1b120909U, - 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU, 0x2d361b1bU, 0xb2dc6e6eU, - 0xeeb45a5aU, 0xfb5ba0a0U, 0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, - 0xce7db3b3U, 0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U, - 0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU, 0x60402020U, - 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU, 0xbed46a6aU, 0x468dcbcbU, - 0xd967bebeU, 0x4b723939U, 0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, - 0x4a85cfcfU, 0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU, - 0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U, 0xcf8a4545U, - 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU, 0xf0a05050U, 0x44783c3cU, - 0xba259f9fU, 0xe34ba8a8U, 0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, - 0x8a058f8fU, 0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U, - 0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U, 0x30201010U, - 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U, 0x4c81cdcdU, 0x14180c0cU, - 0x35261313U, 0x2fc3ececU, 0xe1be5f5fU, 0xa2359797U, 0xcc884444U, - 0x392e1717U, 0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU, - 0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U, 0xa0c06060U, - 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU, 0x66442222U, 0x7e542a2aU, - 0xab3b9090U, 0x830b8888U, 0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, - 0x3c281414U, 0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU, - 0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU, 0xdb924949U, - 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU, 0x5d9fc2c2U, 0x6ebdd3d3U, - 0xef43acacU, 0xa6c46262U, 0xa8399191U, 0xa4319595U, 0x37d3e4e4U, - 0x8bf27979U, 0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU, - 0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U, 0xb4d86c6cU, - 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU, 0xafca6565U, 0x8ef47a7aU, - 0xe947aeaeU, 0x18100808U, 0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, - 0x725c2e2eU, 0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U, - 0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU, 0xdd964b4bU, - 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU, 0x90e07070U, 0x427c3e3eU, - 0xc471b5b5U, 0xaacc6666U, 0xd8904848U, 0x05060303U, 0x01f7f6f6U, - 0x121c0e0eU, 0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U, - 0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU, 0x38d9e1e1U, - 0x13ebf8f8U, 0xb32b9898U, 0x33221111U, 0xbbd26969U, 0x70a9d9d9U, - 0x89078e8eU, 0xa7339494U, 0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, - 0x20c9e9e9U, 0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU, - 0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU, 0xda65bfbfU, - 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U, 0xc3824141U, 0xb0299999U, - 0x775a2d2dU, 0x111e0f0fU, 0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, - 0x3a2c1616U, }; - -static const uint32_t Te2[256] = { - 0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU, 0xf20dfff2U, - 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U, 0x30506030U, 0x01030201U, - 0x67a9ce67U, 0x2b7d562bU, 0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, - 0x769aec76U, 0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU, - 0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U, 0xadec41adU, - 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU, 0x9cbf239cU, 0xa4f753a4U, - 0x7296e472U, 0xc05b9bc0U, 0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, - 0x266a4c26U, 0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU, - 0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U, 0x7193e271U, - 0xd873abd8U, 0x31536231U, 0x153f2a15U, 0x040c0804U, 0xc75295c7U, - 0x23654623U, 0xc35e9dc3U, 0x18283018U, 0x96a13796U, 0x050f0a05U, - 0x9ab52f9aU, 0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U, - 0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U, 0x091b1209U, - 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU, 0x1b2d361bU, 0x6eb2dc6eU, - 0x5aeeb45aU, 0xa0fb5ba0U, 0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, - 0xb3ce7db3U, 0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U, - 0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU, 0x20604020U, - 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU, 0x6abed46aU, 0xcb468dcbU, - 0xbed967beU, 0x394b7239U, 0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, - 0xcf4a85cfU, 0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU, - 0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U, 0x45cf8a45U, - 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU, 0x50f0a050U, 0x3c44783cU, - 0x9fba259fU, 0xa8e34ba8U, 0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, - 0x8f8a058fU, 0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U, - 0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U, 0x10302010U, - 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U, 0xcd4c81cdU, 0x0c14180cU, - 0x13352613U, 0xec2fc3ecU, 0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, - 0x17392e17U, 0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU, - 0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U, 0x60a0c060U, - 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU, 0x22664422U, 0x2a7e542aU, - 0x90ab3b90U, 0x88830b88U, 0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, - 0x143c2814U, 0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU, - 0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU, 0x49db9249U, - 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU, 0xc25d9fc2U, 0xd36ebdd3U, - 0xacef43acU, 0x62a6c462U, 0x91a83991U, 0x95a43195U, 0xe437d3e4U, - 0x798bf279U, 0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU, - 0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U, 0x6cb4d86cU, - 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU, 0x65afca65U, 0x7a8ef47aU, - 0xaee947aeU, 0x08181008U, 0xbad56fbaU, 0x7888f078U, 0x256f4a25U, - 0x2e725c2eU, 0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U, - 0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU, 0x4bdd964bU, - 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU, 0x7090e070U, 0x3e427c3eU, - 0xb5c471b5U, 0x66aacc66U, 0x48d89048U, 0x03050603U, 0xf601f7f6U, - 0x0e121c0eU, 0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U, - 0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU, 0xe138d9e1U, - 0xf813ebf8U, 0x98b32b98U, 0x11332211U, 0x69bbd269U, 0xd970a9d9U, - 0x8e89078eU, 0x94a73394U, 0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, - 0xe920c9e9U, 0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU, - 0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU, 0xbfda65bfU, - 0xe631d7e6U, 0x42c68442U, 0x68b8d068U, 0x41c38241U, 0x99b02999U, - 0x2d775a2dU, 0x0f111e0fU, 0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, - 0x163a2c16U, }; - -static const uint32_t Te3[256] = { - 0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U, 0xf2f20dffU, - 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U, 0x30305060U, 0x01010302U, - 0x6767a9ceU, 0x2b2b7d56U, 0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, - 0x76769aecU, 0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU, - 0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU, 0xadadec41U, - 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U, 0x9c9cbf23U, 0xa4a4f753U, - 0x727296e4U, 0xc0c05b9bU, 0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, - 0x26266a4cU, 0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U, - 0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U, 0x717193e2U, - 0xd8d873abU, 0x31315362U, 0x15153f2aU, 0x04040c08U, 0xc7c75295U, - 0x23236546U, 0xc3c35e9dU, 0x18182830U, 0x9696a137U, 0x05050f0aU, - 0x9a9ab52fU, 0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU, - 0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU, 0x09091b12U, - 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U, 0x1b1b2d36U, 0x6e6eb2dcU, - 0x5a5aeeb4U, 0xa0a0fb5bU, 0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, - 0xb3b3ce7dU, 0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U, - 0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U, 0x20206040U, - 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U, 0x6a6abed4U, 0xcbcb468dU, - 0xbebed967U, 0x39394b72U, 0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, - 0xcfcf4a85U, 0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU, - 0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U, 0x4545cf8aU, - 0xf9f910e9U, 0x02020604U, 0x7f7f81feU, 0x5050f0a0U, 0x3c3c4478U, - 0x9f9fba25U, 0xa8a8e34bU, 0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, - 0x8f8f8a05U, 0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U, - 0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U, 0x10103020U, - 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU, 0xcdcd4c81U, 0x0c0c1418U, - 0x13133526U, 0xecec2fc3U, 0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, - 0x1717392eU, 0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU, - 0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U, 0x6060a0c0U, - 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U, 0x22226644U, 0x2a2a7e54U, - 0x9090ab3bU, 0x8888830bU, 0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, - 0x14143c28U, 0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU, - 0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U, 0x4949db92U, - 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U, 0xc2c25d9fU, 0xd3d36ebdU, - 0xacacef43U, 0x6262a6c4U, 0x9191a839U, 0x9595a431U, 0xe4e437d3U, - 0x79798bf2U, 0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU, - 0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U, 0x6c6cb4d8U, - 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU, 0x6565afcaU, 0x7a7a8ef4U, - 0xaeaee947U, 0x08081810U, 0xbabad56fU, 0x787888f0U, 0x25256f4aU, - 0x2e2e725cU, 0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U, - 0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU, 0x4b4bdd96U, - 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU, 0x707090e0U, 0x3e3e427cU, - 0xb5b5c471U, 0x6666aaccU, 0x4848d890U, 0x03030506U, 0xf6f601f7U, - 0x0e0e121cU, 0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U, - 0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U, 0xe1e138d9U, - 0xf8f813ebU, 0x9898b32bU, 0x11113322U, 0x6969bbd2U, 0xd9d970a9U, - 0x8e8e8907U, 0x9494a733U, 0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, - 0xe9e920c9U, 0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U, - 0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU, 0xbfbfda65U, - 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U, 0x4141c382U, 0x9999b029U, - 0x2d2d775aU, 0x0f0f111eU, 0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, - 0x16163a2cU, }; - -static const uint32_t Td0[256] = { - 0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U, 0x3bab6bcbU, - 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U, 0x2030fa55U, 0xad766df6U, - 0x88cc7691U, 0xf5024c25U, 0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, - 0xb562a38fU, 0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U, - 0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U, 0x038f5fe7U, - 0x15929c95U, 0xbf6d7aebU, 0x955259daU, 0xd4be832dU, 0x587421d3U, - 0x49e06929U, 0x8ec9c844U, 0x75c2896aU, 0xf48e7978U, 0x99583e6bU, - 0x27b971ddU, 0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U, - 0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U, 0xb16477e0U, - 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U, 0x70486858U, 0x8f45fd19U, - 0x94de6c87U, 0x527bf8b7U, 0xab73d323U, 0x724b02e2U, 0xe31f8f57U, - 0x6655ab2aU, 0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U, - 0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU, 0x8acf1c2bU, - 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U, 0x65daf4cdU, 0x0605bed5U, - 0xd134621fU, 0xc4a6fe8aU, 0x342e539dU, 0xa2f355a0U, 0x058ae132U, - 0xa4f6eb75U, 0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U, - 0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U, 0x91548db5U, - 0x71c45d05U, 0x0406d46fU, 0x605015ffU, 0x1998fb24U, 0xd6bde997U, - 0x894043ccU, 0x67d99e77U, 0xb0e842bdU, 0x07898b88U, 0xe7195b38U, - 0x79c8eedbU, 0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U, - 0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU, 0xfd0efffbU, - 0x0f853856U, 0x3daed51eU, 0x362d3927U, 0x0a0fd964U, 0x685ca621U, - 0x9b5b54d1U, 0x24362e3aU, 0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, - 0x1b9b919eU, 0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U, - 0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU, 0x0e090d0bU, - 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U, 0x57f11985U, 0xaf75074cU, - 0xee99ddbbU, 0xa37f60fdU, 0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, - 0x5bfb7e34U, 0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U, - 0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U, 0x854a247dU, - 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU, 0x1d9e2f4bU, 0xdcb230f3U, - 0x0d8652ecU, 0x77c1e3d0U, 0x2bb3166cU, 0xa970b999U, 0x119448faU, - 0x47e96422U, 0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU, - 0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U, 0xa6f581cfU, - 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U, 0x2c3a9de4U, 0x5078920dU, - 0x6a5fcc9bU, 0x547e4662U, 0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, - 0x82c3aff5U, 0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U, - 0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU, 0xcd267809U, - 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U, 0xe6956e65U, 0xaaffe67eU, - 0x21bccf08U, 0xef15e8e6U, 0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, - 0x29b07cd6U, 0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U, - 0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U, 0xf104984aU, - 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU, 0x764dd68dU, 0x43efb04dU, - 0xccaa4d54U, 0xe49604dfU, 0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, - 0x4665517fU, 0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU, - 0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U, 0x9ad7618cU, - 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U, 0xcea927eeU, 0xb761c935U, - 0xe11ce5edU, 0x7a47b13cU, 0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, - 0x73c737bfU, 0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U, - 0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU, 0x161dc372U, - 0xbce2250cU, 0x283c498bU, 0xff0d9541U, 0x39a80171U, 0x080cb3deU, - 0xd8b4e49cU, 0x6456c190U, 0x7bcb8461U, 0xd532b670U, 0x486c5c74U, - 0xd0b85742U, }; - -static const uint32_t Td1[256] = { - 0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU, 0xcb3bab6bU, - 0xf11f9d45U, 0xabacfa58U, 0x934be303U, 0x552030faU, 0xf6ad766dU, - 0x9188cc76U, 0x25f5024cU, 0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, - 0x8fb562a3U, 0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U, - 0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U, 0xe7038f5fU, - 0x9515929cU, 0xebbf6d7aU, 0xda955259U, 0x2dd4be83U, 0xd3587421U, - 0x2949e069U, 0x448ec9c8U, 0x6a75c289U, 0x78f48e79U, 0x6b99583eU, - 0xdd27b971U, 0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU, - 0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU, 0xe0b16477U, - 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU, 0x58704868U, 0x198f45fdU, - 0x8794de6cU, 0xb7527bf8U, 0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, - 0x2a6655abU, 0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U, - 0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U, 0x2b8acf1cU, - 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U, 0xcd65daf4U, 0xd50605beU, - 0x1fd13462U, 0x8ac4a6feU, 0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, - 0x75a4f6ebU, 0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U, - 0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU, 0xb591548dU, - 0x0571c45dU, 0x6f0406d4U, 0xff605015U, 0x241998fbU, 0x97d6bde9U, - 0xcc894043U, 0x7767d99eU, 0xbdb0e842U, 0x8807898bU, 0x38e7195bU, - 0xdb79c8eeU, 0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U, - 0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U, 0xfbfd0effU, - 0x560f8538U, 0x1e3daed5U, 0x27362d39U, 0x640a0fd9U, 0x21685ca6U, - 0xd19b5b54U, 0x3a24362eU, 0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, - 0x9e1b9b91U, 0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU, - 0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U, 0x0b0e090dU, - 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U, 0x8557f119U, 0x4caf7507U, - 0xbbee99ddU, 0xfda37f60U, 0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, - 0x345bfb7eU, 0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U, - 0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U, 0x7d854a24U, - 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U, 0x4b1d9e2fU, 0xf3dcb230U, - 0xec0d8652U, 0xd077c1e3U, 0x6c2bb316U, 0x99a970b9U, 0xfa119448U, - 0x2247e964U, 0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U, - 0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU, 0xcfa6f581U, - 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU, 0xe42c3a9dU, 0x0d507892U, - 0x9b6a5fccU, 0x62547e46U, 0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, - 0xf582c3afU, 0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U, - 0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU, 0x09cd2678U, - 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU, 0x65e6956eU, 0x7eaaffe6U, - 0x0821bccfU, 0xe6ef15e8U, 0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, - 0xd629b07cU, 0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U, - 0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U, 0x4af10498U, - 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U, 0x8d764dd6U, 0x4d43efb0U, - 0x54ccaa4dU, 0xdfe49604U, 0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, - 0x7f466551U, 0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U, - 0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U, 0x8c9ad761U, - 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU, 0xeecea927U, 0x35b761c9U, - 0xede11ce5U, 0x3c7a47b1U, 0x599cd2dfU, 0x3f55f273U, 0x791814ceU, - 0xbf73c737U, 0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU, - 0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U, 0x72161dc3U, - 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U, 0x7139a801U, 0xde080cb3U, - 0x9cd8b4e4U, 0x906456c1U, 0x617bcb84U, 0x70d532b6U, 0x74486c5cU, - 0x42d0b857U, }; - -static const uint32_t Td2[256] = { - 0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U, 0x6bcb3babU, - 0x45f11f9dU, 0x58abacfaU, 0x03934be3U, 0xfa552030U, 0x6df6ad76U, - 0x769188ccU, 0x4c25f502U, 0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, - 0xa38fb562U, 0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU, - 0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U, 0x5fe7038fU, - 0x9c951592U, 0x7aebbf6dU, 0x59da9552U, 0x832dd4beU, 0x21d35874U, - 0x692949e0U, 0xc8448ec9U, 0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, - 0x71dd27b9U, 0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU, - 0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U, 0x77e0b164U, - 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U, 0x68587048U, 0xfd198f45U, - 0x6c8794deU, 0xf8b7527bU, 0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, - 0xab2a6655U, 0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U, - 0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U, 0x1c2b8acfU, - 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U, 0xf4cd65daU, 0xbed50605U, - 0x621fd134U, 0xfe8ac4a6U, 0x539d342eU, 0x55a0a2f3U, 0xe132058aU, - 0xeb75a4f6U, 0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU, - 0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U, 0x8db59154U, - 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U, 0xfb241998U, 0xe997d6bdU, - 0x43cc8940U, 0x9e7767d9U, 0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, - 0xeedb79c8U, 0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U, - 0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU, 0xfffbfd0eU, - 0x38560f85U, 0xd51e3daeU, 0x3927362dU, 0xd9640a0fU, 0xa621685cU, - 0x54d19b5bU, 0x2e3a2436U, 0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, - 0x919e1b9bU, 0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U, - 0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU, 0x0d0b0e09U, - 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU, 0x198557f1U, 0x074caf75U, - 0xddbbee99U, 0x60fda37fU, 0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, - 0x7e345bfbU, 0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U, - 0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U, 0x247d854aU, - 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U, 0x2f4b1d9eU, 0x30f3dcb2U, - 0x52ec0d86U, 0xe3d077c1U, 0x166c2bb3U, 0xb999a970U, 0x48fa1194U, - 0x642247e9U, 0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U, - 0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U, 0x81cfa6f5U, - 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU, 0x9de42c3aU, 0x920d5078U, - 0xcc9b6a5fU, 0x4662547eU, 0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, - 0xaff582c3U, 0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U, - 0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU, 0x7809cd26U, - 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU, 0x6e65e695U, 0xe67eaaffU, - 0xcf0821bcU, 0xe8e6ef15U, 0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, - 0x7cd629b0U, 0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U, - 0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U, 0x984af104U, - 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U, 0xd68d764dU, 0xb04d43efU, - 0x4d54ccaaU, 0x04dfe496U, 0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, - 0x517f4665U, 0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU, - 0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U, 0x618c9ad7U, - 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U, 0x27eecea9U, 0xc935b761U, - 0xe5ede11cU, 0xb13c7a47U, 0xdf599cd2U, 0x733f55f2U, 0xce791814U, - 0x37bf73c7U, 0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U, - 0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U, 0xc372161dU, - 0x250cbce2U, 0x498b283cU, 0x9541ff0dU, 0x017139a8U, 0xb3de080cU, - 0xe49cd8b4U, 0xc1906456U, 0x84617bcbU, 0xb670d532U, 0x5c74486cU, - 0x5742d0b8U, }; - -static const uint32_t Td3[256] = { - 0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU, 0xab6bcb3bU, - 0x9d45f11fU, 0xfa58abacU, 0xe303934bU, 0x30fa5520U, 0x766df6adU, - 0xcc769188U, 0x024c25f5U, 0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, - 0x62a38fb5U, 0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU, - 0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU, 0x8f5fe703U, - 0x929c9515U, 0x6d7aebbfU, 0x5259da95U, 0xbe832dd4U, 0x7421d358U, - 0xe0692949U, 0xc9c8448eU, 0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, - 0xb971dd27U, 0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU, - 0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U, 0x6477e0b1U, - 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U, 0x48685870U, 0x45fd198fU, - 0xde6c8794U, 0x7bf8b752U, 0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, - 0x55ab2a66U, 0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U, - 0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU, 0xcf1c2b8aU, - 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU, 0xdaf4cd65U, 0x05bed506U, - 0x34621fd1U, 0xa6fe8ac4U, 0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, - 0xf6eb75a4U, 0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU, - 0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU, 0x548db591U, - 0xc45d0571U, 0x06d46f04U, 0x5015ff60U, 0x98fb2419U, 0xbde997d6U, - 0x4043cc89U, 0xd99e7767U, 0xe842bdb0U, 0x898b8807U, 0x195b38e7U, - 0xc8eedb79U, 0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U, - 0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU, 0x0efffbfdU, - 0x8538560fU, 0xaed51e3dU, 0x2d392736U, 0x0fd9640aU, 0x5ca62168U, - 0x5b54d19bU, 0x362e3a24U, 0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, - 0x9b919e1bU, 0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU, - 0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U, 0x090d0b0eU, - 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U, 0xf1198557U, 0x75074cafU, - 0x99ddbbeeU, 0x7f60fda3U, 0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, - 0xfb7e345bU, 0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U, - 0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U, 0x4a247d85U, - 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U, 0x9e2f4b1dU, 0xb230f3dcU, - 0x8652ec0dU, 0xc1e3d077U, 0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, - 0xe9642247U, 0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U, - 0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U, 0xf581cfa6U, - 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU, 0x3a9de42cU, 0x78920d50U, - 0x5fcc9b6aU, 0x7e466254U, 0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, - 0xc3aff582U, 0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU, - 0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU, 0x267809cdU, - 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U, 0x956e65e6U, 0xffe67eaaU, - 0xbccf0821U, 0x15e8e6efU, 0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, - 0xb07cd629U, 0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U, - 0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U, 0x04984af1U, - 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U, 0x4dd68d76U, 0xefb04d43U, - 0xaa4d54ccU, 0x9604dfe4U, 0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, - 0x65517f46U, 0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU, - 0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU, 0xd7618c9aU, - 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU, 0xa927eeceU, 0x61c935b7U, - 0x1ce5ede1U, 0x47b13c7aU, 0xd2df599cU, 0xf2733f55U, 0x14ce7918U, - 0xc737bf73U, 0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U, - 0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U, 0x1dc37216U, - 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU, 0xa8017139U, 0x0cb3de08U, - 0xb4e49cd8U, 0x56c19064U, 0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, - 0xb85742d0U, }; - -static const uint8_t Td4[256] = { - 0x52U, 0x09U, 0x6aU, 0xd5U, 0x30U, 0x36U, 0xa5U, 0x38U, 0xbfU, 0x40U, 0xa3U, - 0x9eU, 0x81U, 0xf3U, 0xd7U, 0xfbU, 0x7cU, 0xe3U, 0x39U, 0x82U, 0x9bU, 0x2fU, - 0xffU, 0x87U, 0x34U, 0x8eU, 0x43U, 0x44U, 0xc4U, 0xdeU, 0xe9U, 0xcbU, 0x54U, - 0x7bU, 0x94U, 0x32U, 0xa6U, 0xc2U, 0x23U, 0x3dU, 0xeeU, 0x4cU, 0x95U, 0x0bU, - 0x42U, 0xfaU, 0xc3U, 0x4eU, 0x08U, 0x2eU, 0xa1U, 0x66U, 0x28U, 0xd9U, 0x24U, - 0xb2U, 0x76U, 0x5bU, 0xa2U, 0x49U, 0x6dU, 0x8bU, 0xd1U, 0x25U, 0x72U, 0xf8U, - 0xf6U, 0x64U, 0x86U, 0x68U, 0x98U, 0x16U, 0xd4U, 0xa4U, 0x5cU, 0xccU, 0x5dU, - 0x65U, 0xb6U, 0x92U, 0x6cU, 0x70U, 0x48U, 0x50U, 0xfdU, 0xedU, 0xb9U, 0xdaU, - 0x5eU, 0x15U, 0x46U, 0x57U, 0xa7U, 0x8dU, 0x9dU, 0x84U, 0x90U, 0xd8U, 0xabU, - 0x00U, 0x8cU, 0xbcU, 0xd3U, 0x0aU, 0xf7U, 0xe4U, 0x58U, 0x05U, 0xb8U, 0xb3U, - 0x45U, 0x06U, 0xd0U, 0x2cU, 0x1eU, 0x8fU, 0xcaU, 0x3fU, 0x0fU, 0x02U, 0xc1U, - 0xafU, 0xbdU, 0x03U, 0x01U, 0x13U, 0x8aU, 0x6bU, 0x3aU, 0x91U, 0x11U, 0x41U, - 0x4fU, 0x67U, 0xdcU, 0xeaU, 0x97U, 0xf2U, 0xcfU, 0xceU, 0xf0U, 0xb4U, 0xe6U, - 0x73U, 0x96U, 0xacU, 0x74U, 0x22U, 0xe7U, 0xadU, 0x35U, 0x85U, 0xe2U, 0xf9U, - 0x37U, 0xe8U, 0x1cU, 0x75U, 0xdfU, 0x6eU, 0x47U, 0xf1U, 0x1aU, 0x71U, 0x1dU, - 0x29U, 0xc5U, 0x89U, 0x6fU, 0xb7U, 0x62U, 0x0eU, 0xaaU, 0x18U, 0xbeU, 0x1bU, - 0xfcU, 0x56U, 0x3eU, 0x4bU, 0xc6U, 0xd2U, 0x79U, 0x20U, 0x9aU, 0xdbU, 0xc0U, - 0xfeU, 0x78U, 0xcdU, 0x5aU, 0xf4U, 0x1fU, 0xddU, 0xa8U, 0x33U, 0x88U, 0x07U, - 0xc7U, 0x31U, 0xb1U, 0x12U, 0x10U, 0x59U, 0x27U, 0x80U, 0xecU, 0x5fU, 0x60U, - 0x51U, 0x7fU, 0xa9U, 0x19U, 0xb5U, 0x4aU, 0x0dU, 0x2dU, 0xe5U, 0x7aU, 0x9fU, - 0x93U, 0xc9U, 0x9cU, 0xefU, 0xa0U, 0xe0U, 0x3bU, 0x4dU, 0xaeU, 0x2aU, 0xf5U, - 0xb0U, 0xc8U, 0xebU, 0xbbU, 0x3cU, 0x83U, 0x53U, 0x99U, 0x61U, 0x17U, 0x2bU, - 0x04U, 0x7eU, 0xbaU, 0x77U, 0xd6U, 0x26U, 0xe1U, 0x69U, 0x14U, 0x63U, 0x55U, - 0x21U, 0x0cU, 0x7dU, }; - -static const uint32_t rcon[] = { - 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, - 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000, - // for 128-bit blocks, Rijndael never uses more than 10 rcon values -}; - -int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - uint32_t *rk; - int i = 0; - uint32_t temp; - - if (!key || !aeskey) { - return -1; - } - - switch (bits) { - case 128: - aeskey->rounds = 10; - break; - case 192: - aeskey->rounds = 12; - break; - case 256: - aeskey->rounds = 14; - break; - default: - return -2; - } - - rk = aeskey->rd_key; - - rk[0] = GETU32(key); - rk[1] = GETU32(key + 4); - rk[2] = GETU32(key + 8); - rk[3] = GETU32(key + 12); - if (bits == 128) { - while (1) { - temp = rk[3]; - rk[4] = rk[0] ^ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^ - (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^ - (Te0[(temp) & 0xff] & 0x0000ff00) ^ - (Te1[(temp >> 24)] & 0x000000ff) ^ rcon[i]; - rk[5] = rk[1] ^ rk[4]; - rk[6] = rk[2] ^ rk[5]; - rk[7] = rk[3] ^ rk[6]; - if (++i == 10) { - return 0; - } - rk += 4; - } - } - rk[4] = GETU32(key + 16); - rk[5] = GETU32(key + 20); - if (bits == 192) { - while (1) { - temp = rk[5]; - rk[6] = rk[0] ^ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^ - (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^ - (Te0[(temp) & 0xff] & 0x0000ff00) ^ - (Te1[(temp >> 24)] & 0x000000ff) ^ rcon[i]; - rk[7] = rk[1] ^ rk[6]; - rk[8] = rk[2] ^ rk[7]; - rk[9] = rk[3] ^ rk[8]; - if (++i == 8) { - return 0; - } - rk[10] = rk[4] ^ rk[9]; - rk[11] = rk[5] ^ rk[10]; - rk += 6; - } - } - rk[6] = GETU32(key + 24); - rk[7] = GETU32(key + 28); - if (bits == 256) { - while (1) { - temp = rk[7]; - rk[8] = rk[0] ^ (Te2[(temp >> 16) & 0xff] & 0xff000000) ^ - (Te3[(temp >> 8) & 0xff] & 0x00ff0000) ^ - (Te0[(temp) & 0xff] & 0x0000ff00) ^ - (Te1[(temp >> 24)] & 0x000000ff) ^ rcon[i]; - rk[9] = rk[1] ^ rk[8]; - rk[10] = rk[2] ^ rk[9]; - rk[11] = rk[3] ^ rk[10]; - if (++i == 7) { - return 0; - } - temp = rk[11]; - rk[12] = rk[4] ^ (Te2[(temp >> 24)] & 0xff000000) ^ - (Te3[(temp >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(temp >> 8) & 0xff] & 0x0000ff00) ^ - (Te1[(temp) & 0xff] & 0x000000ff); - rk[13] = rk[5] ^ rk[12]; - rk[14] = rk[6] ^ rk[13]; - rk[15] = rk[7] ^ rk[14]; - - rk += 8; - } - } - return 0; -} - -int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - uint32_t *rk; - int i, j, status; - uint32_t temp; - - // first, start with an encryption schedule - status = AES_set_encrypt_key(key, bits, aeskey); - if (status < 0) { - return status; - } - - rk = aeskey->rd_key; - - // invert the order of the round keys: - for (i = 0, j = 4 * aeskey->rounds; i < j; i += 4, j -= 4) { - temp = rk[i]; - rk[i] = rk[j]; - rk[j] = temp; - temp = rk[i + 1]; - rk[i + 1] = rk[j + 1]; - rk[j + 1] = temp; - temp = rk[i + 2]; - rk[i + 2] = rk[j + 2]; - rk[j + 2] = temp; - temp = rk[i + 3]; - rk[i + 3] = rk[j + 3]; - rk[j + 3] = temp; - } - // apply the inverse MixColumn transform to all round keys but the first and - // the last: - for (i = 1; i < (int)aeskey->rounds; i++) { - rk += 4; - rk[0] = - Td0[Te1[(rk[0] >> 24)] & 0xff] ^ Td1[Te1[(rk[0] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[0] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[0]) & 0xff] & 0xff]; - rk[1] = - Td0[Te1[(rk[1] >> 24)] & 0xff] ^ Td1[Te1[(rk[1] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[1] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[1]) & 0xff] & 0xff]; - rk[2] = - Td0[Te1[(rk[2] >> 24)] & 0xff] ^ Td1[Te1[(rk[2] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[2] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[2]) & 0xff] & 0xff]; - rk[3] = - Td0[Te1[(rk[3] >> 24)] & 0xff] ^ Td1[Te1[(rk[3] >> 16) & 0xff] & 0xff] ^ - Td2[Te1[(rk[3] >> 8) & 0xff] & 0xff] ^ Td3[Te1[(rk[3]) & 0xff] & 0xff]; - } - return 0; -} - -void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - const uint32_t *rk; - uint32_t s0, s1, s2, s3, t0, t1, t2, t3; -#ifndef FULL_UNROLL - int r; -#endif // ?FULL_UNROLL - - assert(in && out && key); - rk = key->rd_key; - - // map byte array block to cipher state - // and add initial round key: - s0 = GETU32(in) ^ rk[0]; - s1 = GETU32(in + 4) ^ rk[1]; - s2 = GETU32(in + 8) ^ rk[2]; - s3 = GETU32(in + 12) ^ rk[3]; -#ifdef FULL_UNROLL - // round 1: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[4]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[5]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[6]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[7]; - // round 2: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[8]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[9]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[10]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[11]; - // round 3: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[12]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[13]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[14]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[15]; - // round 4: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[16]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[17]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[18]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[19]; - // round 5: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[20]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[21]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[22]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[23]; - // round 6: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[24]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[25]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[26]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[27]; - // round 7: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[28]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[29]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[30]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[31]; - // round 8: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[32]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[33]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[34]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[35]; - // round 9: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[36]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[37]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[38]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[39]; - if (key->rounds > 10) { - // round 10: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[40]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[41]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[42]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[43]; - // round 11: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[44]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[45]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[46]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[47]; - if (key->rounds > 12) { - // round 12: - s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[t3 & 0xff] ^ rk[48]; - s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[t0 & 0xff] ^ rk[49]; - s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[t1 & 0xff] ^ rk[50]; - s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[t2 & 0xff] ^ rk[51]; - // round 13: - t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[s3 & 0xff] ^ rk[52]; - t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[s0 & 0xff] ^ rk[53]; - t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[s1 & 0xff] ^ rk[54]; - t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[s2 & 0xff] ^ rk[55]; - } - } - rk += key->rounds << 2; -#else // !FULL_UNROLL - // Nr - 1 full rounds: - r = key->rounds >> 1; - for (;;) { - t0 = Te0[(s0 >> 24)] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ - Te3[(s3) & 0xff] ^ rk[4]; - t1 = Te0[(s1 >> 24)] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ - Te3[(s0) & 0xff] ^ rk[5]; - t2 = Te0[(s2 >> 24)] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ - Te3[(s1) & 0xff] ^ rk[6]; - t3 = Te0[(s3 >> 24)] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ - Te3[(s2) & 0xff] ^ rk[7]; - - rk += 8; - if (--r == 0) { - break; - } - - s0 = Te0[(t0 >> 24)] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ - Te3[(t3) & 0xff] ^ rk[0]; - s1 = Te0[(t1 >> 24)] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ - Te3[(t0) & 0xff] ^ rk[1]; - s2 = Te0[(t2 >> 24)] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ - Te3[(t1) & 0xff] ^ rk[2]; - s3 = Te0[(t3 >> 24)] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ - Te3[(t2) & 0xff] ^ rk[3]; - } -#endif // ?FULL_UNROLL - // apply last round and map cipher state to byte array block: - s0 = (Te2[(t0 >> 24)] & 0xff000000) ^ (Te3[(t1 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t2 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t3) & 0xff] & 0x000000ff) ^ - rk[0]; - PUTU32(out, s0); - s1 = (Te2[(t1 >> 24)] & 0xff000000) ^ (Te3[(t2 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t3 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t0) & 0xff] & 0x000000ff) ^ - rk[1]; - PUTU32(out + 4, s1); - s2 = (Te2[(t2 >> 24)] & 0xff000000) ^ (Te3[(t3 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t0 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t1) & 0xff] & 0x000000ff) ^ - rk[2]; - PUTU32(out + 8, s2); - s3 = (Te2[(t3 >> 24)] & 0xff000000) ^ (Te3[(t0 >> 16) & 0xff] & 0x00ff0000) ^ - (Te0[(t1 >> 8) & 0xff] & 0x0000ff00) ^ (Te1[(t2) & 0xff] & 0x000000ff) ^ - rk[3]; - PUTU32(out + 12, s3); -} - -void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - const uint32_t *rk; - uint32_t s0, s1, s2, s3, t0, t1, t2, t3; -#ifndef FULL_UNROLL - int r; -#endif // ?FULL_UNROLL - - assert(in && out && key); - rk = key->rd_key; - - // map byte array block to cipher state - // and add initial round key: - s0 = GETU32(in) ^ rk[0]; - s1 = GETU32(in + 4) ^ rk[1]; - s2 = GETU32(in + 8) ^ rk[2]; - s3 = GETU32(in + 12) ^ rk[3]; -#ifdef FULL_UNROLL - // round 1: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[4]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[5]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[6]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[7]; - // round 2: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[8]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[9]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[10]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[11]; - // round 3: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[12]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[13]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[14]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[15]; - // round 4: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[16]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[17]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[18]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[19]; - // round 5: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[20]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[21]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[22]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[23]; - // round 6: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[24]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[25]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[26]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[27]; - // round 7: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[28]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[29]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[30]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[31]; - // round 8: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[32]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[33]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[34]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[35]; - // round 9: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[36]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[37]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[38]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[39]; - if (key->rounds > 10) { - // round 10: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[40]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[41]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[42]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[43]; - // round 11: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[44]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[45]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[46]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[47]; - if (key->rounds > 12) { - // round 12: - s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[t1 & 0xff] ^ rk[48]; - s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[t2 & 0xff] ^ rk[49]; - s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[t3 & 0xff] ^ rk[50]; - s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[t0 & 0xff] ^ rk[51]; - // round 13: - t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[s1 & 0xff] ^ rk[52]; - t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[s2 & 0xff] ^ rk[53]; - t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[s3 & 0xff] ^ rk[54]; - t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[s0 & 0xff] ^ rk[55]; - } - } - rk += key->rounds << 2; -#else // !FULL_UNROLL - // Nr - 1 full rounds: - r = key->rounds >> 1; - for (;;) { - t0 = Td0[(s0 >> 24)] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ - Td3[(s1) & 0xff] ^ rk[4]; - t1 = Td0[(s1 >> 24)] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ - Td3[(s2) & 0xff] ^ rk[5]; - t2 = Td0[(s2 >> 24)] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ - Td3[(s3) & 0xff] ^ rk[6]; - t3 = Td0[(s3 >> 24)] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ - Td3[(s0) & 0xff] ^ rk[7]; - - rk += 8; - if (--r == 0) { - break; - } - - s0 = Td0[(t0 >> 24)] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ - Td3[(t1) & 0xff] ^ rk[0]; - s1 = Td0[(t1 >> 24)] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ - Td3[(t2) & 0xff] ^ rk[1]; - s2 = Td0[(t2 >> 24)] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ - Td3[(t3) & 0xff] ^ rk[2]; - s3 = Td0[(t3 >> 24)] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ - Td3[(t0) & 0xff] ^ rk[3]; - } -#endif // ?FULL_UNROLL - // apply last round and - // map cipher state to byte array block: - s0 = ((uint32_t)Td4[(t0 >> 24)] << 24) ^ - ((uint32_t)Td4[(t3 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t2 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t1) & 0xff]) ^ rk[0]; - PUTU32(out, s0); - s1 = ((uint32_t)Td4[(t1 >> 24)] << 24) ^ - ((uint32_t)Td4[(t0 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t3 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t2) & 0xff]) ^ rk[1]; - PUTU32(out + 4, s1); - s2 = ((uint32_t)Td4[(t2 >> 24)] << 24) ^ - ((uint32_t)Td4[(t1 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t0 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t3) & 0xff]) ^ rk[2]; - PUTU32(out + 8, s2); - s3 = ((uint32_t)Td4[(t3 >> 24)] << 24) ^ - ((uint32_t)Td4[(t2 >> 16) & 0xff] << 16) ^ - ((uint32_t)Td4[(t1 >> 8) & 0xff] << 8) ^ - ((uint32_t)Td4[(t0) & 0xff]) ^ rk[3]; - PUTU32(out + 12, s3); -} - -#else - -// In this case several functions are provided by asm code. However, one cannot -// control asm symbol visibility with command line flags and such so they are -// always hidden and wrapped by these C functions, which can be so -// controlled. - -void asm_AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - if (hwaes_capable()) { - aes_hw_encrypt(in, out, key); - } else { - asm_AES_encrypt(in, out, key); - } -} - -void asm_AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - if (hwaes_capable()) { - aes_hw_decrypt(in, out, key); - } else { - asm_AES_decrypt(in, out, key); - } -} - -int asm_AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey); -int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - if (hwaes_capable()) { - return aes_hw_set_encrypt_key(key, bits, aeskey); - } else { - return asm_AES_set_encrypt_key(key, bits, aeskey); - } -} - -int asm_AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey); -int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { - if (hwaes_capable()) { - return aes_hw_set_decrypt_key(key, bits, aeskey); - } else { - return asm_AES_set_decrypt_key(key, bits, aeskey); - } -} - -#endif // OPENSSL_NO_ASM || (!OPENSSL_X86 && !OPENSSL_X86_64 && !OPENSSL_ARM) diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/internal.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/internal.h deleted file mode 100644 index d72c738e1..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/internal.h +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_AES_INTERNAL_H -#define OPENSSL_HEADER_AES_INTERNAL_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -#if !defined(OPENSSL_NO_ASM) && (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define HWAES - -static int hwaes_capable(void) { - return CRYPTO_is_ARMv8_AES_capable(); -} -#endif // !NO_ASM && (AES || AARCH64) - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_PPC64LE) -#define HWAES - -static int hwaes_capable(void) { - return CRYPTO_is_PPC64LE_vcrypto_capable(); -} -#endif // !NO_ASM && PPC64LE - - -#if defined(HWAES) - -int aes_hw_set_encrypt_key(const uint8_t *user_key, const int bits, - AES_KEY *key); -int aes_hw_set_decrypt_key(const uint8_t *user_key, const int bits, - AES_KEY *key); -void aes_hw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void aes_hw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, const int enc); -void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, const uint8_t ivec[16]); - -#else - -// If HWAES isn't defined then we provide dummy functions for each of the hwaes -// functions. -static int hwaes_capable(void) { return 0; } - -static int aes_hw_set_encrypt_key(const uint8_t *user_key, int bits, - AES_KEY *key) { - abort(); -} - -static int aes_hw_set_decrypt_key(const uint8_t *user_key, int bits, - AES_KEY *key) { - abort(); -} - -static void aes_hw_encrypt(const uint8_t *in, uint8_t *out, - const AES_KEY *key) { - abort(); -} - -static void aes_hw_decrypt(const uint8_t *in, uint8_t *out, - const AES_KEY *key) { - abort(); -} - -static void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc) { - abort(); -} - -static void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, - size_t len, const AES_KEY *key, - const uint8_t ivec[16]) { - abort(); -} - -#endif // !HWAES - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_AES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/internal.h.grpc_back deleted file mode 100644 index 45db9eec6..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/internal.h.grpc_back +++ /dev/null @@ -1,100 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_AES_INTERNAL_H -#define OPENSSL_HEADER_AES_INTERNAL_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -#if !defined(OPENSSL_NO_ASM) && (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define HWAES - -static int hwaes_capable(void) { - return CRYPTO_is_ARMv8_AES_capable(); -} -#endif // !NO_ASM && (AES || AARCH64) - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_PPC64LE) -#define HWAES - -static int hwaes_capable(void) { - return CRYPTO_is_PPC64LE_vcrypto_capable(); -} -#endif // !NO_ASM && PPC64LE - - -#if defined(HWAES) - -int aes_hw_set_encrypt_key(const uint8_t *user_key, const int bits, - AES_KEY *key); -int aes_hw_set_decrypt_key(const uint8_t *user_key, const int bits, - AES_KEY *key); -void aes_hw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void aes_hw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, const int enc); -void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, const uint8_t ivec[16]); - -#else - -// If HWAES isn't defined then we provide dummy functions for each of the hwaes -// functions. -static int hwaes_capable(void) { return 0; } - -static int aes_hw_set_encrypt_key(const uint8_t *user_key, int bits, - AES_KEY *key) { - abort(); -} - -static int aes_hw_set_decrypt_key(const uint8_t *user_key, int bits, - AES_KEY *key) { - abort(); -} - -static void aes_hw_encrypt(const uint8_t *in, uint8_t *out, - const AES_KEY *key) { - abort(); -} - -static void aes_hw_decrypt(const uint8_t *in, uint8_t *out, - const AES_KEY *key) { - abort(); -} - -static void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc) { - abort(); -} - -static void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, - size_t len, const AES_KEY *key, - const uint8_t ivec[16]) { - abort(); -} - -#endif // !HWAES - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_AES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/key_wrap.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/key_wrap.c deleted file mode 100644 index a19cfbef3..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/key_wrap.c +++ /dev/null @@ -1,138 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include - -#include - -#include "../../internal.h" - - -// kDefaultIV is the default IV value given in RFC 3394, 2.2.3.1. -static const uint8_t kDefaultIV[] = { - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, -}; - -static const unsigned kBound = 6; - -int AES_wrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, - const uint8_t *in, size_t in_len) { - // See RFC 3394, section 2.2.1. - - if (in_len > INT_MAX - 8 || in_len < 8 || in_len % 8 != 0) { - return -1; - } - - if (iv == NULL) { - iv = kDefaultIV; - } - - OPENSSL_memmove(out + 8, in, in_len); - uint8_t A[AES_BLOCK_SIZE]; - OPENSSL_memcpy(A, iv, 8); - - size_t n = in_len / 8; - - for (unsigned j = 0; j < kBound; j++) { - for (size_t i = 1; i <= n; i++) { - OPENSSL_memcpy(A + 8, out + 8 * i, 8); - AES_encrypt(A, A, key); - - uint32_t t = (uint32_t)(n * j + i); - A[7] ^= t & 0xff; - A[6] ^= (t >> 8) & 0xff; - A[5] ^= (t >> 16) & 0xff; - A[4] ^= (t >> 24) & 0xff; - OPENSSL_memcpy(out + 8 * i, A + 8, 8); - } - } - - OPENSSL_memcpy(out, A, 8); - return (int)in_len + 8; -} - -int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, - const uint8_t *in, size_t in_len) { - // See RFC 3394, section 2.2.2. - - if (in_len > INT_MAX || in_len < 16 || in_len % 8 != 0) { - return -1; - } - - if (iv == NULL) { - iv = kDefaultIV; - } - - uint8_t A[AES_BLOCK_SIZE]; - OPENSSL_memcpy(A, in, 8); - OPENSSL_memmove(out, in + 8, in_len - 8); - - size_t n = (in_len / 8) - 1; - - for (unsigned j = kBound - 1; j < kBound; j--) { - for (size_t i = n; i > 0; i--) { - uint32_t t = (uint32_t)(n * j + i); - A[7] ^= t & 0xff; - A[6] ^= (t >> 8) & 0xff; - A[5] ^= (t >> 16) & 0xff; - A[4] ^= (t >> 24) & 0xff; - OPENSSL_memcpy(A + 8, out + 8 * (i - 1), 8); - AES_decrypt(A, A, key); - OPENSSL_memcpy(out + 8 * (i - 1), A + 8, 8); - } - } - - if (CRYPTO_memcmp(A, iv, 8) != 0) { - return -1; - } - - return (int)in_len - 8; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/key_wrap.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/key_wrap.c.grpc_back deleted file mode 100644 index feee0c72c..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/key_wrap.c.grpc_back +++ /dev/null @@ -1,138 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include - -#include - -#include "../../internal.h" - - -// kDefaultIV is the default IV value given in RFC 3394, 2.2.3.1. -static const uint8_t kDefaultIV[] = { - 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, -}; - -static const unsigned kBound = 6; - -int AES_wrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, - const uint8_t *in, size_t in_len) { - // See RFC 3394, section 2.2.1. - - if (in_len > INT_MAX - 8 || in_len < 8 || in_len % 8 != 0) { - return -1; - } - - if (iv == NULL) { - iv = kDefaultIV; - } - - OPENSSL_memmove(out + 8, in, in_len); - uint8_t A[AES_BLOCK_SIZE]; - OPENSSL_memcpy(A, iv, 8); - - size_t n = in_len / 8; - - for (unsigned j = 0; j < kBound; j++) { - for (size_t i = 1; i <= n; i++) { - OPENSSL_memcpy(A + 8, out + 8 * i, 8); - AES_encrypt(A, A, key); - - uint32_t t = (uint32_t)(n * j + i); - A[7] ^= t & 0xff; - A[6] ^= (t >> 8) & 0xff; - A[5] ^= (t >> 16) & 0xff; - A[4] ^= (t >> 24) & 0xff; - OPENSSL_memcpy(out + 8 * i, A + 8, 8); - } - } - - OPENSSL_memcpy(out, A, 8); - return (int)in_len + 8; -} - -int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, - const uint8_t *in, size_t in_len) { - // See RFC 3394, section 2.2.2. - - if (in_len > INT_MAX || in_len < 16 || in_len % 8 != 0) { - return -1; - } - - if (iv == NULL) { - iv = kDefaultIV; - } - - uint8_t A[AES_BLOCK_SIZE]; - OPENSSL_memcpy(A, in, 8); - OPENSSL_memmove(out, in + 8, in_len - 8); - - size_t n = (in_len / 8) - 1; - - for (unsigned j = kBound - 1; j < kBound; j--) { - for (size_t i = n; i > 0; i--) { - uint32_t t = (uint32_t)(n * j + i); - A[7] ^= t & 0xff; - A[6] ^= (t >> 8) & 0xff; - A[5] ^= (t >> 16) & 0xff; - A[4] ^= (t >> 24) & 0xff; - OPENSSL_memcpy(A + 8, out + 8 * (i - 1), 8); - AES_decrypt(A, A, key); - OPENSSL_memcpy(out + 8 * (i - 1), A + 8, 8); - } - } - - if (CRYPTO_memcmp(A, iv, 8) != 0) { - return -1; - } - - return (int)in_len - 8; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/ctx.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/ctx.c deleted file mode 100644 index 30d9c87a0..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/ctx.c +++ /dev/null @@ -1,303 +0,0 @@ -/* Written by Ulf Moeller for the OpenSSL project. */ -/* ==================================================================== - * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - - -#include - -#include - -#include -#include - -#include "../../internal.h" - - -// How many bignums are in each "pool item"; -#define BN_CTX_POOL_SIZE 16 -// The stack frame info is resizing, set a first-time expansion size; -#define BN_CTX_START_FRAMES 32 - -// A bundle of bignums that can be linked with other bundles -typedef struct bignum_pool_item { - // The bignum values - BIGNUM vals[BN_CTX_POOL_SIZE]; - // Linked-list admin - struct bignum_pool_item *prev, *next; -} BN_POOL_ITEM; - - -typedef struct bignum_pool { - // Linked-list admin - BN_POOL_ITEM *head, *current, *tail; - // Stack depth and allocation size - unsigned used, size; -} BN_POOL; - -static void BN_POOL_init(BN_POOL *); -static void BN_POOL_finish(BN_POOL *); -static BIGNUM *BN_POOL_get(BN_POOL *); -static void BN_POOL_release(BN_POOL *, unsigned int); - - -// BN_STACK - -// A wrapper to manage the "stack frames" -typedef struct bignum_ctx_stack { - // Array of indexes into the bignum stack - unsigned int *indexes; - // Number of stack frames, and the size of the allocated array - unsigned int depth, size; -} BN_STACK; - -static void BN_STACK_init(BN_STACK *); -static void BN_STACK_finish(BN_STACK *); -static int BN_STACK_push(BN_STACK *, unsigned int); -static unsigned int BN_STACK_pop(BN_STACK *); - - -// BN_CTX - -// The opaque BN_CTX type -struct bignum_ctx { - // The bignum bundles - BN_POOL pool; - // The "stack frames", if you will - BN_STACK stack; - // The number of bignums currently assigned - unsigned int used; - // Depth of stack overflow - int err_stack; - // Block "gets" until an "end" (compatibility behaviour) - int too_many; -}; - -BN_CTX *BN_CTX_new(void) { - BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX)); - if (!ret) { - OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); - return NULL; - } - - // Initialise the structure - BN_POOL_init(&ret->pool); - BN_STACK_init(&ret->stack); - ret->used = 0; - ret->err_stack = 0; - ret->too_many = 0; - return ret; -} - -void BN_CTX_free(BN_CTX *ctx) { - if (ctx == NULL) { - return; - } - - BN_STACK_finish(&ctx->stack); - BN_POOL_finish(&ctx->pool); - OPENSSL_free(ctx); -} - -void BN_CTX_start(BN_CTX *ctx) { - // If we're already overflowing ... - if (ctx->err_stack || ctx->too_many) { - ctx->err_stack++; - } else if (!BN_STACK_push(&ctx->stack, ctx->used)) { - // (Try to) get a new frame pointer - OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); - ctx->err_stack++; - } -} - -BIGNUM *BN_CTX_get(BN_CTX *ctx) { - BIGNUM *ret; - if (ctx->err_stack || ctx->too_many) { - return NULL; - } - - ret = BN_POOL_get(&ctx->pool); - if (ret == NULL) { - // Setting too_many prevents repeated "get" attempts from - // cluttering the error stack. - ctx->too_many = 1; - OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); - return NULL; - } - - // OK, make sure the returned bignum is "zero" - BN_zero(ret); - ctx->used++; - return ret; -} - -void BN_CTX_end(BN_CTX *ctx) { - if (ctx->err_stack) { - ctx->err_stack--; - } else { - unsigned int fp = BN_STACK_pop(&ctx->stack); - // Does this stack frame have anything to release? - if (fp < ctx->used) { - BN_POOL_release(&ctx->pool, ctx->used - fp); - } - - ctx->used = fp; - // Unjam "too_many" in case "get" had failed - ctx->too_many = 0; - } -} - - -// BN_STACK - -static void BN_STACK_init(BN_STACK *st) { - st->indexes = NULL; - st->depth = st->size = 0; -} - -static void BN_STACK_finish(BN_STACK *st) { - OPENSSL_free(st->indexes); -} - -static int BN_STACK_push(BN_STACK *st, unsigned int idx) { - if (st->depth == st->size) { - // Need to expand - unsigned int newsize = - (st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES); - unsigned int *newitems = OPENSSL_malloc(newsize * sizeof(unsigned int)); - if (!newitems) { - return 0; - } - if (st->depth) { - OPENSSL_memcpy(newitems, st->indexes, st->depth * sizeof(unsigned int)); - } - OPENSSL_free(st->indexes); - st->indexes = newitems; - st->size = newsize; - } - - st->indexes[(st->depth)++] = idx; - return 1; -} - -static unsigned int BN_STACK_pop(BN_STACK *st) { - return st->indexes[--(st->depth)]; -} - - -static void BN_POOL_init(BN_POOL *p) { - p->head = p->current = p->tail = NULL; - p->used = p->size = 0; -} - -static void BN_POOL_finish(BN_POOL *p) { - while (p->head) { - for (size_t i = 0; i < BN_CTX_POOL_SIZE; i++) { - BN_clear_free(&p->head->vals[i]); - } - - p->current = p->head->next; - OPENSSL_free(p->head); - p->head = p->current; - } -} - -static BIGNUM *BN_POOL_get(BN_POOL *p) { - if (p->used == p->size) { - BN_POOL_ITEM *item = OPENSSL_malloc(sizeof(BN_POOL_ITEM)); - if (!item) { - return NULL; - } - - // Initialise the structure - for (size_t i = 0; i < BN_CTX_POOL_SIZE; i++) { - BN_init(&item->vals[i]); - } - - item->prev = p->tail; - item->next = NULL; - // Link it in - if (!p->head) { - p->head = p->current = p->tail = item; - } else { - p->tail->next = item; - p->tail = item; - p->current = item; - } - - p->size += BN_CTX_POOL_SIZE; - p->used++; - // Return the first bignum from the new pool - return item->vals; - } - - if (!p->used) { - p->current = p->head; - } else if ((p->used % BN_CTX_POOL_SIZE) == 0) { - p->current = p->current->next; - } - - return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE); -} - -static void BN_POOL_release(BN_POOL *p, unsigned int num) { - unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; - p->used -= num; - - while (num--) { - if (!offset) { - offset = BN_CTX_POOL_SIZE - 1; - p->current = p->current->prev; - } else { - offset--; - } - } -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/ctx.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/ctx.c.grpc_back deleted file mode 100644 index af50de939..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/ctx.c.grpc_back +++ /dev/null @@ -1,303 +0,0 @@ -/* Written by Ulf Moeller for the OpenSSL project. */ -/* ==================================================================== - * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - - -#include - -#include - -#include -#include - -#include "../../internal.h" - - -// How many bignums are in each "pool item"; -#define BN_CTX_POOL_SIZE 16 -// The stack frame info is resizing, set a first-time expansion size; -#define BN_CTX_START_FRAMES 32 - -// A bundle of bignums that can be linked with other bundles -typedef struct bignum_pool_item { - // The bignum values - BIGNUM vals[BN_CTX_POOL_SIZE]; - // Linked-list admin - struct bignum_pool_item *prev, *next; -} BN_POOL_ITEM; - - -typedef struct bignum_pool { - // Linked-list admin - BN_POOL_ITEM *head, *current, *tail; - // Stack depth and allocation size - unsigned used, size; -} BN_POOL; - -static void BN_POOL_init(BN_POOL *); -static void BN_POOL_finish(BN_POOL *); -static BIGNUM *BN_POOL_get(BN_POOL *); -static void BN_POOL_release(BN_POOL *, unsigned int); - - -// BN_STACK - -// A wrapper to manage the "stack frames" -typedef struct bignum_ctx_stack { - // Array of indexes into the bignum stack - unsigned int *indexes; - // Number of stack frames, and the size of the allocated array - unsigned int depth, size; -} BN_STACK; - -static void BN_STACK_init(BN_STACK *); -static void BN_STACK_finish(BN_STACK *); -static int BN_STACK_push(BN_STACK *, unsigned int); -static unsigned int BN_STACK_pop(BN_STACK *); - - -// BN_CTX - -// The opaque BN_CTX type -struct bignum_ctx { - // The bignum bundles - BN_POOL pool; - // The "stack frames", if you will - BN_STACK stack; - // The number of bignums currently assigned - unsigned int used; - // Depth of stack overflow - int err_stack; - // Block "gets" until an "end" (compatibility behaviour) - int too_many; -}; - -BN_CTX *BN_CTX_new(void) { - BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX)); - if (!ret) { - OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); - return NULL; - } - - // Initialise the structure - BN_POOL_init(&ret->pool); - BN_STACK_init(&ret->stack); - ret->used = 0; - ret->err_stack = 0; - ret->too_many = 0; - return ret; -} - -void BN_CTX_free(BN_CTX *ctx) { - if (ctx == NULL) { - return; - } - - BN_STACK_finish(&ctx->stack); - BN_POOL_finish(&ctx->pool); - OPENSSL_free(ctx); -} - -void BN_CTX_start(BN_CTX *ctx) { - // If we're already overflowing ... - if (ctx->err_stack || ctx->too_many) { - ctx->err_stack++; - } else if (!BN_STACK_push(&ctx->stack, ctx->used)) { - // (Try to) get a new frame pointer - OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); - ctx->err_stack++; - } -} - -BIGNUM *BN_CTX_get(BN_CTX *ctx) { - BIGNUM *ret; - if (ctx->err_stack || ctx->too_many) { - return NULL; - } - - ret = BN_POOL_get(&ctx->pool); - if (ret == NULL) { - // Setting too_many prevents repeated "get" attempts from - // cluttering the error stack. - ctx->too_many = 1; - OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); - return NULL; - } - - // OK, make sure the returned bignum is "zero" - BN_zero(ret); - ctx->used++; - return ret; -} - -void BN_CTX_end(BN_CTX *ctx) { - if (ctx->err_stack) { - ctx->err_stack--; - } else { - unsigned int fp = BN_STACK_pop(&ctx->stack); - // Does this stack frame have anything to release? - if (fp < ctx->used) { - BN_POOL_release(&ctx->pool, ctx->used - fp); - } - - ctx->used = fp; - // Unjam "too_many" in case "get" had failed - ctx->too_many = 0; - } -} - - -// BN_STACK - -static void BN_STACK_init(BN_STACK *st) { - st->indexes = NULL; - st->depth = st->size = 0; -} - -static void BN_STACK_finish(BN_STACK *st) { - OPENSSL_free(st->indexes); -} - -static int BN_STACK_push(BN_STACK *st, unsigned int idx) { - if (st->depth == st->size) { - // Need to expand - unsigned int newsize = - (st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES); - unsigned int *newitems = OPENSSL_malloc(newsize * sizeof(unsigned int)); - if (!newitems) { - return 0; - } - if (st->depth) { - OPENSSL_memcpy(newitems, st->indexes, st->depth * sizeof(unsigned int)); - } - OPENSSL_free(st->indexes); - st->indexes = newitems; - st->size = newsize; - } - - st->indexes[(st->depth)++] = idx; - return 1; -} - -static unsigned int BN_STACK_pop(BN_STACK *st) { - return st->indexes[--(st->depth)]; -} - - -static void BN_POOL_init(BN_POOL *p) { - p->head = p->current = p->tail = NULL; - p->used = p->size = 0; -} - -static void BN_POOL_finish(BN_POOL *p) { - while (p->head) { - for (size_t i = 0; i < BN_CTX_POOL_SIZE; i++) { - BN_clear_free(&p->head->vals[i]); - } - - p->current = p->head->next; - OPENSSL_free(p->head); - p->head = p->current; - } -} - -static BIGNUM *BN_POOL_get(BN_POOL *p) { - if (p->used == p->size) { - BN_POOL_ITEM *item = OPENSSL_malloc(sizeof(BN_POOL_ITEM)); - if (!item) { - return NULL; - } - - // Initialise the structure - for (size_t i = 0; i < BN_CTX_POOL_SIZE; i++) { - BN_init(&item->vals[i]); - } - - item->prev = p->tail; - item->next = NULL; - // Link it in - if (!p->head) { - p->head = p->current = p->tail = item; - } else { - p->tail->next = item; - p->tail = item; - p->current = item; - } - - p->size += BN_CTX_POOL_SIZE; - p->used++; - // Return the first bignum from the new pool - return item->vals; - } - - if (!p->used) { - p->current = p->head; - } else if ((p->used % BN_CTX_POOL_SIZE) == 0) { - p->current = p->current->next; - } - - return p->current->vals + ((p->used++) % BN_CTX_POOL_SIZE); -} - -static void BN_POOL_release(BN_POOL *p, unsigned int num) { - unsigned int offset = (p->used - 1) % BN_CTX_POOL_SIZE; - p->used -= num; - - while (num--) { - if (!offset) { - offset = BN_CTX_POOL_SIZE - 1; - p->current = p->current->prev; - } else { - offset--; - } - } -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/gcd.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/gcd.c deleted file mode 100644 index 7cd752d04..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/gcd.c +++ /dev/null @@ -1,683 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include - -#include - -#include "internal.h" - - -static BN_ULONG word_is_odd_mask(BN_ULONG a) { return (BN_ULONG)0 - (a & 1); } - -static void maybe_rshift1_words(BN_ULONG *a, BN_ULONG mask, BN_ULONG *tmp, - size_t num) { - bn_rshift1_words(tmp, a, num); - bn_select_words(a, mask, tmp, a, num); -} - -static void maybe_rshift1_words_carry(BN_ULONG *a, BN_ULONG carry, - BN_ULONG mask, BN_ULONG *tmp, - size_t num) { - maybe_rshift1_words(a, mask, tmp, num); - if (num != 0) { - carry &= mask; - a[num - 1] |= carry << (BN_BITS2-1); - } -} - -static BN_ULONG maybe_add_words(BN_ULONG *a, BN_ULONG mask, const BN_ULONG *b, - BN_ULONG *tmp, size_t num) { - BN_ULONG carry = bn_add_words(tmp, a, b, num); - bn_select_words(a, mask, tmp, a, num); - return carry & mask; -} - -static int bn_gcd_consttime(BIGNUM *r, unsigned *out_shift, const BIGNUM *x, - const BIGNUM *y, BN_CTX *ctx) { - size_t width = x->width > y->width ? x->width : y->width; - if (width == 0) { - *out_shift = 0; - BN_zero(r); - return 1; - } - - // This is a constant-time implementation of Stein's algorithm (binary GCD). - int ret = 0; - BN_CTX_start(ctx); - BIGNUM *u = BN_CTX_get(ctx); - BIGNUM *v = BN_CTX_get(ctx); - BIGNUM *tmp = BN_CTX_get(ctx); - if (u == NULL || v == NULL || tmp == NULL || - !BN_copy(u, x) || - !BN_copy(v, y) || - !bn_resize_words(u, width) || - !bn_resize_words(v, width) || - !bn_resize_words(tmp, width)) { - goto err; - } - - // Each loop iteration halves at least one of |u| and |v|. Thus we need at - // most the combined bit width of inputs for at least one value to be zero. - unsigned x_bits = x->width * BN_BITS2, y_bits = y->width * BN_BITS2; - unsigned num_iters = x_bits + y_bits; - if (num_iters < x_bits) { - OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); - goto err; - } - - unsigned shift = 0; - for (unsigned i = 0; i < num_iters; i++) { - BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); - - // If both |u| and |v| are odd, subtract the smaller from the larger. - BN_ULONG u_less_than_v = - (BN_ULONG)0 - bn_sub_words(tmp->d, u->d, v->d, width); - bn_select_words(u->d, both_odd & ~u_less_than_v, tmp->d, u->d, width); - bn_sub_words(tmp->d, v->d, u->d, width); - bn_select_words(v->d, both_odd & u_less_than_v, tmp->d, v->d, width); - - // At least one of |u| and |v| is now even. - BN_ULONG u_is_odd = word_is_odd_mask(u->d[0]); - BN_ULONG v_is_odd = word_is_odd_mask(v->d[0]); - assert(!(u_is_odd & v_is_odd)); - - // If both are even, the final GCD gains a factor of two. - shift += 1 & (~u_is_odd & ~v_is_odd); - - // Halve any which are even. - maybe_rshift1_words(u->d, ~u_is_odd, tmp->d, width); - maybe_rshift1_words(v->d, ~v_is_odd, tmp->d, width); - } - - // One of |u| or |v| is zero at this point. The algorithm usually makes |u| - // zero, unless |y| was already zero on input. Fix this by combining the - // values. - assert(BN_is_zero(u) || BN_is_zero(v)); - for (size_t i = 0; i < width; i++) { - v->d[i] |= u->d[i]; - } - - *out_shift = shift; - ret = bn_set_words(r, v->d, width); - -err: - BN_CTX_end(ctx); - return ret; -} - -int BN_gcd(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) { - unsigned shift; - return bn_gcd_consttime(r, &shift, x, y, ctx) && - BN_lshift(r, r, shift); -} - -int bn_is_relatively_prime(int *out_relatively_prime, const BIGNUM *x, - const BIGNUM *y, BN_CTX *ctx) { - int ret = 0; - BN_CTX_start(ctx); - unsigned shift; - BIGNUM *gcd = BN_CTX_get(ctx); - if (gcd == NULL || - !bn_gcd_consttime(gcd, &shift, x, y, ctx)) { - goto err; - } - - // Check that 2^|shift| * |gcd| is one. - if (gcd->width == 0) { - *out_relatively_prime = 0; - } else { - BN_ULONG mask = shift | (gcd->d[0] ^ 1); - for (int i = 1; i < gcd->width; i++) { - mask |= gcd->d[i]; - } - *out_relatively_prime = mask == 0; - } - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} - -int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { - BN_CTX_start(ctx); - unsigned shift; - BIGNUM *gcd = BN_CTX_get(ctx); - int ret = gcd != NULL && - bn_mul_consttime(r, a, b, ctx) && - bn_gcd_consttime(gcd, &shift, a, b, ctx) && - bn_div_consttime(r, NULL, r, gcd, ctx) && - bn_rshift_secret_shift(r, r, shift, ctx); - BN_CTX_end(ctx); - return ret; -} - -int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, const BIGNUM *a, - const BIGNUM *n, BN_CTX *ctx) { - *out_no_inverse = 0; - if (BN_is_negative(a) || BN_ucmp(a, n) >= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); - return 0; - } - if (BN_is_zero(a)) { - if (BN_is_one(n)) { - BN_zero(r); - return 1; - } - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - return 0; - } - - // This is a constant-time implementation of the extended binary GCD - // algorithm. It is adapted from the Handbook of Applied Cryptography, section - // 14.4.3, algorithm 14.51, and modified to bound coefficients and avoid - // negative numbers. - // - // For more details and proof of correctness, see - // https://github.com/mit-plv/fiat-crypto/pull/333. In particular, see |step| - // and |mod_inverse_consttime| for the algorithm in Gallina and see - // |mod_inverse_consttime_spec| for the correctness result. - - if (!BN_is_odd(a) && !BN_is_odd(n)) { - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - return 0; - } - - // This function exists to compute the RSA private exponent, where |a| is one - // word. We'll thus use |a_width| when available. - size_t n_width = n->width, a_width = a->width; - if (a_width > n_width) { - a_width = n_width; - } - - int ret = 0; - BN_CTX_start(ctx); - BIGNUM *u = BN_CTX_get(ctx); - BIGNUM *v = BN_CTX_get(ctx); - BIGNUM *A = BN_CTX_get(ctx); - BIGNUM *B = BN_CTX_get(ctx); - BIGNUM *C = BN_CTX_get(ctx); - BIGNUM *D = BN_CTX_get(ctx); - BIGNUM *tmp = BN_CTX_get(ctx); - BIGNUM *tmp2 = BN_CTX_get(ctx); - if (u == NULL || v == NULL || A == NULL || B == NULL || C == NULL || - D == NULL || tmp == NULL || tmp2 == NULL || - !BN_copy(u, a) || - !BN_copy(v, n) || - !BN_one(A) || - !BN_one(D) || - // For convenience, size |u| and |v| equivalently. - !bn_resize_words(u, n_width) || - !bn_resize_words(v, n_width) || - // |A| and |C| are bounded by |m|. - !bn_resize_words(A, n_width) || - !bn_resize_words(C, n_width) || - // |B| and |D| are bounded by |a|. - !bn_resize_words(B, a_width) || - !bn_resize_words(D, a_width) || - // |tmp| and |tmp2| may be used at either size. - !bn_resize_words(tmp, n_width) || - !bn_resize_words(tmp2, n_width)) { - goto err; - } - - // Each loop iteration halves at least one of |u| and |v|. Thus we need at - // most the combined bit width of inputs for at least one value to be zero. - unsigned a_bits = a_width * BN_BITS2, n_bits = n_width * BN_BITS2; - unsigned num_iters = a_bits + n_bits; - if (num_iters < a_bits) { - OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); - goto err; - } - - // Before and after each loop iteration, the following hold: - // - // u = A*a - B*n - // v = D*n - C*a - // 0 < u <= a - // 0 <= v <= n - // 0 <= A < n - // 0 <= B <= a - // 0 <= C < n - // 0 <= D <= a - // - // After each loop iteration, u and v only get smaller, and at least one of - // them shrinks by at least a factor of two. - for (unsigned i = 0; i < num_iters; i++) { - BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); - - // If both |u| and |v| are odd, subtract the smaller from the larger. - BN_ULONG v_less_than_u = - (BN_ULONG)0 - bn_sub_words(tmp->d, v->d, u->d, n_width); - bn_select_words(v->d, both_odd & ~v_less_than_u, tmp->d, v->d, n_width); - bn_sub_words(tmp->d, u->d, v->d, n_width); - bn_select_words(u->d, both_odd & v_less_than_u, tmp->d, u->d, n_width); - - // If we updated one of the values, update the corresponding coefficient. - BN_ULONG carry = bn_add_words(tmp->d, A->d, C->d, n_width); - carry -= bn_sub_words(tmp2->d, tmp->d, n->d, n_width); - bn_select_words(tmp->d, carry, tmp->d, tmp2->d, n_width); - bn_select_words(A->d, both_odd & v_less_than_u, tmp->d, A->d, n_width); - bn_select_words(C->d, both_odd & ~v_less_than_u, tmp->d, C->d, n_width); - - bn_add_words(tmp->d, B->d, D->d, a_width); - bn_sub_words(tmp2->d, tmp->d, a->d, a_width); - bn_select_words(tmp->d, carry, tmp->d, tmp2->d, a_width); - bn_select_words(B->d, both_odd & v_less_than_u, tmp->d, B->d, a_width); - bn_select_words(D->d, both_odd & ~v_less_than_u, tmp->d, D->d, a_width); - - // Our loop invariants hold at this point. Additionally, exactly one of |u| - // and |v| is now even. - BN_ULONG u_is_even = ~word_is_odd_mask(u->d[0]); - BN_ULONG v_is_even = ~word_is_odd_mask(v->d[0]); - assert(u_is_even != v_is_even); - - // Halve the even one and adjust the corresponding coefficient. - maybe_rshift1_words(u->d, u_is_even, tmp->d, n_width); - BN_ULONG A_or_B_is_odd = - word_is_odd_mask(A->d[0]) | word_is_odd_mask(B->d[0]); - BN_ULONG A_carry = - maybe_add_words(A->d, A_or_B_is_odd & u_is_even, n->d, tmp->d, n_width); - BN_ULONG B_carry = - maybe_add_words(B->d, A_or_B_is_odd & u_is_even, a->d, tmp->d, a_width); - maybe_rshift1_words_carry(A->d, A_carry, u_is_even, tmp->d, n_width); - maybe_rshift1_words_carry(B->d, B_carry, u_is_even, tmp->d, a_width); - - maybe_rshift1_words(v->d, v_is_even, tmp->d, n_width); - BN_ULONG C_or_D_is_odd = - word_is_odd_mask(C->d[0]) | word_is_odd_mask(D->d[0]); - BN_ULONG C_carry = - maybe_add_words(C->d, C_or_D_is_odd & v_is_even, n->d, tmp->d, n_width); - BN_ULONG D_carry = - maybe_add_words(D->d, C_or_D_is_odd & v_is_even, a->d, tmp->d, a_width); - maybe_rshift1_words_carry(C->d, C_carry, v_is_even, tmp->d, n_width); - maybe_rshift1_words_carry(D->d, D_carry, v_is_even, tmp->d, a_width); - } - - assert(BN_is_zero(v)); - if (!BN_is_one(u)) { - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - goto err; - } - - ret = BN_copy(r, A) != NULL; - -err: - BN_CTX_end(ctx); - return ret; -} - -int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, - const BIGNUM *n, BN_CTX *ctx) { - *out_no_inverse = 0; - - if (!BN_is_odd(n)) { - OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); - return 0; - } - - if (BN_is_negative(a) || BN_cmp(a, n) >= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); - return 0; - } - - BIGNUM *A, *B, *X, *Y; - int ret = 0; - int sign; - - BN_CTX_start(ctx); - A = BN_CTX_get(ctx); - B = BN_CTX_get(ctx); - X = BN_CTX_get(ctx); - Y = BN_CTX_get(ctx); - if (Y == NULL) { - goto err; - } - - BIGNUM *R = out; - - BN_zero(Y); - if (!BN_one(X) || BN_copy(B, a) == NULL || BN_copy(A, n) == NULL) { - goto err; - } - A->neg = 0; - sign = -1; - // From B = a mod |n|, A = |n| it follows that - // - // 0 <= B < A, - // -sign*X*a == B (mod |n|), - // sign*Y*a == A (mod |n|). - - // Binary inversion algorithm; requires odd modulus. This is faster than the - // general algorithm if the modulus is sufficiently small (about 400 .. 500 - // bits on 32-bit systems, but much more on 64-bit systems) - int shift; - - while (!BN_is_zero(B)) { - // 0 < B < |n|, - // 0 < A <= |n|, - // (1) -sign*X*a == B (mod |n|), - // (2) sign*Y*a == A (mod |n|) - - // Now divide B by the maximum possible power of two in the integers, - // and divide X by the same value mod |n|. - // When we're done, (1) still holds. - shift = 0; - while (!BN_is_bit_set(B, shift)) { - // note that 0 < B - shift++; - - if (BN_is_odd(X)) { - if (!BN_uadd(X, X, n)) { - goto err; - } - } - // now X is even, so we can easily divide it by two - if (!BN_rshift1(X, X)) { - goto err; - } - } - if (shift > 0) { - if (!BN_rshift(B, B, shift)) { - goto err; - } - } - - // Same for A and Y. Afterwards, (2) still holds. - shift = 0; - while (!BN_is_bit_set(A, shift)) { - // note that 0 < A - shift++; - - if (BN_is_odd(Y)) { - if (!BN_uadd(Y, Y, n)) { - goto err; - } - } - // now Y is even - if (!BN_rshift1(Y, Y)) { - goto err; - } - } - if (shift > 0) { - if (!BN_rshift(A, A, shift)) { - goto err; - } - } - - // We still have (1) and (2). - // Both A and B are odd. - // The following computations ensure that - // - // 0 <= B < |n|, - // 0 < A < |n|, - // (1) -sign*X*a == B (mod |n|), - // (2) sign*Y*a == A (mod |n|), - // - // and that either A or B is even in the next iteration. - if (BN_ucmp(B, A) >= 0) { - // -sign*(X + Y)*a == B - A (mod |n|) - if (!BN_uadd(X, X, Y)) { - goto err; - } - // NB: we could use BN_mod_add_quick(X, X, Y, n), but that - // actually makes the algorithm slower - if (!BN_usub(B, B, A)) { - goto err; - } - } else { - // sign*(X + Y)*a == A - B (mod |n|) - if (!BN_uadd(Y, Y, X)) { - goto err; - } - // as above, BN_mod_add_quick(Y, Y, X, n) would slow things down - if (!BN_usub(A, A, B)) { - goto err; - } - } - } - - if (!BN_is_one(A)) { - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - goto err; - } - - // The while loop (Euclid's algorithm) ends when - // A == gcd(a,n); - // we have - // sign*Y*a == A (mod |n|), - // where Y is non-negative. - - if (sign < 0) { - if (!BN_sub(Y, n, Y)) { - goto err; - } - } - // Now Y*a == A (mod |n|). - - // Y*a == 1 (mod |n|) - if (!Y->neg && BN_ucmp(Y, n) < 0) { - if (!BN_copy(R, Y)) { - goto err; - } - } else { - if (!BN_nnmod(R, Y, n, ctx)) { - goto err; - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} - -BIGNUM *BN_mod_inverse(BIGNUM *out, const BIGNUM *a, const BIGNUM *n, - BN_CTX *ctx) { - BIGNUM *new_out = NULL; - if (out == NULL) { - new_out = BN_new(); - if (new_out == NULL) { - OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); - return NULL; - } - out = new_out; - } - - int ok = 0; - BIGNUM *a_reduced = NULL; - if (a->neg || BN_ucmp(a, n) >= 0) { - a_reduced = BN_dup(a); - if (a_reduced == NULL) { - goto err; - } - if (!BN_nnmod(a_reduced, a_reduced, n, ctx)) { - goto err; - } - a = a_reduced; - } - - int no_inverse; - if (!BN_is_odd(n)) { - if (!bn_mod_inverse_consttime(out, &no_inverse, a, n, ctx)) { - goto err; - } - } else if (!BN_mod_inverse_odd(out, &no_inverse, a, n, ctx)) { - goto err; - } - - ok = 1; - -err: - if (!ok) { - BN_free(new_out); - out = NULL; - } - BN_free(a_reduced); - return out; -} - -int BN_mod_inverse_blinded(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, - const BN_MONT_CTX *mont, BN_CTX *ctx) { - *out_no_inverse = 0; - - if (BN_is_negative(a) || BN_cmp(a, &mont->N) >= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); - return 0; - } - - int ret = 0; - BIGNUM blinding_factor; - BN_init(&blinding_factor); - - if (!BN_rand_range_ex(&blinding_factor, 1, &mont->N) || - !BN_mod_mul_montgomery(out, &blinding_factor, a, mont, ctx) || - !BN_mod_inverse_odd(out, out_no_inverse, out, &mont->N, ctx) || - !BN_mod_mul_montgomery(out, &blinding_factor, out, mont, ctx)) { - OPENSSL_PUT_ERROR(BN, ERR_R_BN_LIB); - goto err; - } - - ret = 1; - -err: - BN_free(&blinding_factor); - return ret; -} - -int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p) { - BN_CTX_start(ctx); - BIGNUM *p_minus_2 = BN_CTX_get(ctx); - int ok = p_minus_2 != NULL && - BN_copy(p_minus_2, p) && - BN_sub_word(p_minus_2, 2) && - BN_mod_exp_mont(out, a, p_minus_2, p, ctx, mont_p); - BN_CTX_end(ctx); - return ok; -} - -int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p) { - BN_CTX_start(ctx); - BIGNUM *p_minus_2 = BN_CTX_get(ctx); - int ok = p_minus_2 != NULL && - BN_copy(p_minus_2, p) && - BN_sub_word(p_minus_2, 2) && - BN_mod_exp_mont_consttime(out, a, p_minus_2, p, ctx, mont_p); - BN_CTX_end(ctx); - return ok; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/gcd.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/gcd.c.grpc_back deleted file mode 100644 index 7868b4078..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/gcd.c.grpc_back +++ /dev/null @@ -1,683 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include - -#include - -#include "internal.h" - - -static BN_ULONG word_is_odd_mask(BN_ULONG a) { return (BN_ULONG)0 - (a & 1); } - -static void maybe_rshift1_words(BN_ULONG *a, BN_ULONG mask, BN_ULONG *tmp, - size_t num) { - bn_rshift1_words(tmp, a, num); - bn_select_words(a, mask, tmp, a, num); -} - -static void maybe_rshift1_words_carry(BN_ULONG *a, BN_ULONG carry, - BN_ULONG mask, BN_ULONG *tmp, - size_t num) { - maybe_rshift1_words(a, mask, tmp, num); - if (num != 0) { - carry &= mask; - a[num - 1] |= carry << (BN_BITS2-1); - } -} - -static BN_ULONG maybe_add_words(BN_ULONG *a, BN_ULONG mask, const BN_ULONG *b, - BN_ULONG *tmp, size_t num) { - BN_ULONG carry = bn_add_words(tmp, a, b, num); - bn_select_words(a, mask, tmp, a, num); - return carry & mask; -} - -static int bn_gcd_consttime(BIGNUM *r, unsigned *out_shift, const BIGNUM *x, - const BIGNUM *y, BN_CTX *ctx) { - size_t width = x->width > y->width ? x->width : y->width; - if (width == 0) { - *out_shift = 0; - BN_zero(r); - return 1; - } - - // This is a constant-time implementation of Stein's algorithm (binary GCD). - int ret = 0; - BN_CTX_start(ctx); - BIGNUM *u = BN_CTX_get(ctx); - BIGNUM *v = BN_CTX_get(ctx); - BIGNUM *tmp = BN_CTX_get(ctx); - if (u == NULL || v == NULL || tmp == NULL || - !BN_copy(u, x) || - !BN_copy(v, y) || - !bn_resize_words(u, width) || - !bn_resize_words(v, width) || - !bn_resize_words(tmp, width)) { - goto err; - } - - // Each loop iteration halves at least one of |u| and |v|. Thus we need at - // most the combined bit width of inputs for at least one value to be zero. - unsigned x_bits = x->width * BN_BITS2, y_bits = y->width * BN_BITS2; - unsigned num_iters = x_bits + y_bits; - if (num_iters < x_bits) { - OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); - goto err; - } - - unsigned shift = 0; - for (unsigned i = 0; i < num_iters; i++) { - BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); - - // If both |u| and |v| are odd, subtract the smaller from the larger. - BN_ULONG u_less_than_v = - (BN_ULONG)0 - bn_sub_words(tmp->d, u->d, v->d, width); - bn_select_words(u->d, both_odd & ~u_less_than_v, tmp->d, u->d, width); - bn_sub_words(tmp->d, v->d, u->d, width); - bn_select_words(v->d, both_odd & u_less_than_v, tmp->d, v->d, width); - - // At least one of |u| and |v| is now even. - BN_ULONG u_is_odd = word_is_odd_mask(u->d[0]); - BN_ULONG v_is_odd = word_is_odd_mask(v->d[0]); - assert(!(u_is_odd & v_is_odd)); - - // If both are even, the final GCD gains a factor of two. - shift += 1 & (~u_is_odd & ~v_is_odd); - - // Halve any which are even. - maybe_rshift1_words(u->d, ~u_is_odd, tmp->d, width); - maybe_rshift1_words(v->d, ~v_is_odd, tmp->d, width); - } - - // One of |u| or |v| is zero at this point. The algorithm usually makes |u| - // zero, unless |y| was already zero on input. Fix this by combining the - // values. - assert(BN_is_zero(u) || BN_is_zero(v)); - for (size_t i = 0; i < width; i++) { - v->d[i] |= u->d[i]; - } - - *out_shift = shift; - ret = bn_set_words(r, v->d, width); - -err: - BN_CTX_end(ctx); - return ret; -} - -int BN_gcd(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) { - unsigned shift; - return bn_gcd_consttime(r, &shift, x, y, ctx) && - BN_lshift(r, r, shift); -} - -int bn_is_relatively_prime(int *out_relatively_prime, const BIGNUM *x, - const BIGNUM *y, BN_CTX *ctx) { - int ret = 0; - BN_CTX_start(ctx); - unsigned shift; - BIGNUM *gcd = BN_CTX_get(ctx); - if (gcd == NULL || - !bn_gcd_consttime(gcd, &shift, x, y, ctx)) { - goto err; - } - - // Check that 2^|shift| * |gcd| is one. - if (gcd->width == 0) { - *out_relatively_prime = 0; - } else { - BN_ULONG mask = shift | (gcd->d[0] ^ 1); - for (int i = 1; i < gcd->width; i++) { - mask |= gcd->d[i]; - } - *out_relatively_prime = mask == 0; - } - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} - -int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { - BN_CTX_start(ctx); - unsigned shift; - BIGNUM *gcd = BN_CTX_get(ctx); - int ret = gcd != NULL && - bn_mul_consttime(r, a, b, ctx) && - bn_gcd_consttime(gcd, &shift, a, b, ctx) && - bn_div_consttime(r, NULL, r, gcd, ctx) && - bn_rshift_secret_shift(r, r, shift, ctx); - BN_CTX_end(ctx); - return ret; -} - -int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, const BIGNUM *a, - const BIGNUM *n, BN_CTX *ctx) { - *out_no_inverse = 0; - if (BN_is_negative(a) || BN_ucmp(a, n) >= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); - return 0; - } - if (BN_is_zero(a)) { - if (BN_is_one(n)) { - BN_zero(r); - return 1; - } - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - return 0; - } - - // This is a constant-time implementation of the extended binary GCD - // algorithm. It is adapted from the Handbook of Applied Cryptography, section - // 14.4.3, algorithm 14.51, and modified to bound coefficients and avoid - // negative numbers. - // - // For more details and proof of correctness, see - // https://github.com/mit-plv/fiat-crypto/pull/333. In particular, see |step| - // and |mod_inverse_consttime| for the algorithm in Gallina and see - // |mod_inverse_consttime_spec| for the correctness result. - - if (!BN_is_odd(a) && !BN_is_odd(n)) { - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - return 0; - } - - // This function exists to compute the RSA private exponent, where |a| is one - // word. We'll thus use |a_width| when available. - size_t n_width = n->width, a_width = a->width; - if (a_width > n_width) { - a_width = n_width; - } - - int ret = 0; - BN_CTX_start(ctx); - BIGNUM *u = BN_CTX_get(ctx); - BIGNUM *v = BN_CTX_get(ctx); - BIGNUM *A = BN_CTX_get(ctx); - BIGNUM *B = BN_CTX_get(ctx); - BIGNUM *C = BN_CTX_get(ctx); - BIGNUM *D = BN_CTX_get(ctx); - BIGNUM *tmp = BN_CTX_get(ctx); - BIGNUM *tmp2 = BN_CTX_get(ctx); - if (u == NULL || v == NULL || A == NULL || B == NULL || C == NULL || - D == NULL || tmp == NULL || tmp2 == NULL || - !BN_copy(u, a) || - !BN_copy(v, n) || - !BN_one(A) || - !BN_one(D) || - // For convenience, size |u| and |v| equivalently. - !bn_resize_words(u, n_width) || - !bn_resize_words(v, n_width) || - // |A| and |C| are bounded by |m|. - !bn_resize_words(A, n_width) || - !bn_resize_words(C, n_width) || - // |B| and |D| are bounded by |a|. - !bn_resize_words(B, a_width) || - !bn_resize_words(D, a_width) || - // |tmp| and |tmp2| may be used at either size. - !bn_resize_words(tmp, n_width) || - !bn_resize_words(tmp2, n_width)) { - goto err; - } - - // Each loop iteration halves at least one of |u| and |v|. Thus we need at - // most the combined bit width of inputs for at least one value to be zero. - unsigned a_bits = a_width * BN_BITS2, n_bits = n_width * BN_BITS2; - unsigned num_iters = a_bits + n_bits; - if (num_iters < a_bits) { - OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); - goto err; - } - - // Before and after each loop iteration, the following hold: - // - // u = A*a - B*n - // v = D*n - C*a - // 0 < u <= a - // 0 <= v <= n - // 0 <= A < n - // 0 <= B <= a - // 0 <= C < n - // 0 <= D <= a - // - // After each loop iteration, u and v only get smaller, and at least one of - // them shrinks by at least a factor of two. - for (unsigned i = 0; i < num_iters; i++) { - BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); - - // If both |u| and |v| are odd, subtract the smaller from the larger. - BN_ULONG v_less_than_u = - (BN_ULONG)0 - bn_sub_words(tmp->d, v->d, u->d, n_width); - bn_select_words(v->d, both_odd & ~v_less_than_u, tmp->d, v->d, n_width); - bn_sub_words(tmp->d, u->d, v->d, n_width); - bn_select_words(u->d, both_odd & v_less_than_u, tmp->d, u->d, n_width); - - // If we updated one of the values, update the corresponding coefficient. - BN_ULONG carry = bn_add_words(tmp->d, A->d, C->d, n_width); - carry -= bn_sub_words(tmp2->d, tmp->d, n->d, n_width); - bn_select_words(tmp->d, carry, tmp->d, tmp2->d, n_width); - bn_select_words(A->d, both_odd & v_less_than_u, tmp->d, A->d, n_width); - bn_select_words(C->d, both_odd & ~v_less_than_u, tmp->d, C->d, n_width); - - bn_add_words(tmp->d, B->d, D->d, a_width); - bn_sub_words(tmp2->d, tmp->d, a->d, a_width); - bn_select_words(tmp->d, carry, tmp->d, tmp2->d, a_width); - bn_select_words(B->d, both_odd & v_less_than_u, tmp->d, B->d, a_width); - bn_select_words(D->d, both_odd & ~v_less_than_u, tmp->d, D->d, a_width); - - // Our loop invariants hold at this point. Additionally, exactly one of |u| - // and |v| is now even. - BN_ULONG u_is_even = ~word_is_odd_mask(u->d[0]); - BN_ULONG v_is_even = ~word_is_odd_mask(v->d[0]); - assert(u_is_even != v_is_even); - - // Halve the even one and adjust the corresponding coefficient. - maybe_rshift1_words(u->d, u_is_even, tmp->d, n_width); - BN_ULONG A_or_B_is_odd = - word_is_odd_mask(A->d[0]) | word_is_odd_mask(B->d[0]); - BN_ULONG A_carry = - maybe_add_words(A->d, A_or_B_is_odd & u_is_even, n->d, tmp->d, n_width); - BN_ULONG B_carry = - maybe_add_words(B->d, A_or_B_is_odd & u_is_even, a->d, tmp->d, a_width); - maybe_rshift1_words_carry(A->d, A_carry, u_is_even, tmp->d, n_width); - maybe_rshift1_words_carry(B->d, B_carry, u_is_even, tmp->d, a_width); - - maybe_rshift1_words(v->d, v_is_even, tmp->d, n_width); - BN_ULONG C_or_D_is_odd = - word_is_odd_mask(C->d[0]) | word_is_odd_mask(D->d[0]); - BN_ULONG C_carry = - maybe_add_words(C->d, C_or_D_is_odd & v_is_even, n->d, tmp->d, n_width); - BN_ULONG D_carry = - maybe_add_words(D->d, C_or_D_is_odd & v_is_even, a->d, tmp->d, a_width); - maybe_rshift1_words_carry(C->d, C_carry, v_is_even, tmp->d, n_width); - maybe_rshift1_words_carry(D->d, D_carry, v_is_even, tmp->d, a_width); - } - - assert(BN_is_zero(v)); - if (!BN_is_one(u)) { - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - goto err; - } - - ret = BN_copy(r, A) != NULL; - -err: - BN_CTX_end(ctx); - return ret; -} - -int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, - const BIGNUM *n, BN_CTX *ctx) { - *out_no_inverse = 0; - - if (!BN_is_odd(n)) { - OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); - return 0; - } - - if (BN_is_negative(a) || BN_cmp(a, n) >= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); - return 0; - } - - BIGNUM *A, *B, *X, *Y; - int ret = 0; - int sign; - - BN_CTX_start(ctx); - A = BN_CTX_get(ctx); - B = BN_CTX_get(ctx); - X = BN_CTX_get(ctx); - Y = BN_CTX_get(ctx); - if (Y == NULL) { - goto err; - } - - BIGNUM *R = out; - - BN_zero(Y); - if (!BN_one(X) || BN_copy(B, a) == NULL || BN_copy(A, n) == NULL) { - goto err; - } - A->neg = 0; - sign = -1; - // From B = a mod |n|, A = |n| it follows that - // - // 0 <= B < A, - // -sign*X*a == B (mod |n|), - // sign*Y*a == A (mod |n|). - - // Binary inversion algorithm; requires odd modulus. This is faster than the - // general algorithm if the modulus is sufficiently small (about 400 .. 500 - // bits on 32-bit systems, but much more on 64-bit systems) - int shift; - - while (!BN_is_zero(B)) { - // 0 < B < |n|, - // 0 < A <= |n|, - // (1) -sign*X*a == B (mod |n|), - // (2) sign*Y*a == A (mod |n|) - - // Now divide B by the maximum possible power of two in the integers, - // and divide X by the same value mod |n|. - // When we're done, (1) still holds. - shift = 0; - while (!BN_is_bit_set(B, shift)) { - // note that 0 < B - shift++; - - if (BN_is_odd(X)) { - if (!BN_uadd(X, X, n)) { - goto err; - } - } - // now X is even, so we can easily divide it by two - if (!BN_rshift1(X, X)) { - goto err; - } - } - if (shift > 0) { - if (!BN_rshift(B, B, shift)) { - goto err; - } - } - - // Same for A and Y. Afterwards, (2) still holds. - shift = 0; - while (!BN_is_bit_set(A, shift)) { - // note that 0 < A - shift++; - - if (BN_is_odd(Y)) { - if (!BN_uadd(Y, Y, n)) { - goto err; - } - } - // now Y is even - if (!BN_rshift1(Y, Y)) { - goto err; - } - } - if (shift > 0) { - if (!BN_rshift(A, A, shift)) { - goto err; - } - } - - // We still have (1) and (2). - // Both A and B are odd. - // The following computations ensure that - // - // 0 <= B < |n|, - // 0 < A < |n|, - // (1) -sign*X*a == B (mod |n|), - // (2) sign*Y*a == A (mod |n|), - // - // and that either A or B is even in the next iteration. - if (BN_ucmp(B, A) >= 0) { - // -sign*(X + Y)*a == B - A (mod |n|) - if (!BN_uadd(X, X, Y)) { - goto err; - } - // NB: we could use BN_mod_add_quick(X, X, Y, n), but that - // actually makes the algorithm slower - if (!BN_usub(B, B, A)) { - goto err; - } - } else { - // sign*(X + Y)*a == A - B (mod |n|) - if (!BN_uadd(Y, Y, X)) { - goto err; - } - // as above, BN_mod_add_quick(Y, Y, X, n) would slow things down - if (!BN_usub(A, A, B)) { - goto err; - } - } - } - - if (!BN_is_one(A)) { - *out_no_inverse = 1; - OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); - goto err; - } - - // The while loop (Euclid's algorithm) ends when - // A == gcd(a,n); - // we have - // sign*Y*a == A (mod |n|), - // where Y is non-negative. - - if (sign < 0) { - if (!BN_sub(Y, n, Y)) { - goto err; - } - } - // Now Y*a == A (mod |n|). - - // Y*a == 1 (mod |n|) - if (!Y->neg && BN_ucmp(Y, n) < 0) { - if (!BN_copy(R, Y)) { - goto err; - } - } else { - if (!BN_nnmod(R, Y, n, ctx)) { - goto err; - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} - -BIGNUM *BN_mod_inverse(BIGNUM *out, const BIGNUM *a, const BIGNUM *n, - BN_CTX *ctx) { - BIGNUM *new_out = NULL; - if (out == NULL) { - new_out = BN_new(); - if (new_out == NULL) { - OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); - return NULL; - } - out = new_out; - } - - int ok = 0; - BIGNUM *a_reduced = NULL; - if (a->neg || BN_ucmp(a, n) >= 0) { - a_reduced = BN_dup(a); - if (a_reduced == NULL) { - goto err; - } - if (!BN_nnmod(a_reduced, a_reduced, n, ctx)) { - goto err; - } - a = a_reduced; - } - - int no_inverse; - if (!BN_is_odd(n)) { - if (!bn_mod_inverse_consttime(out, &no_inverse, a, n, ctx)) { - goto err; - } - } else if (!BN_mod_inverse_odd(out, &no_inverse, a, n, ctx)) { - goto err; - } - - ok = 1; - -err: - if (!ok) { - BN_free(new_out); - out = NULL; - } - BN_free(a_reduced); - return out; -} - -int BN_mod_inverse_blinded(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, - const BN_MONT_CTX *mont, BN_CTX *ctx) { - *out_no_inverse = 0; - - if (BN_is_negative(a) || BN_cmp(a, &mont->N) >= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); - return 0; - } - - int ret = 0; - BIGNUM blinding_factor; - BN_init(&blinding_factor); - - if (!BN_rand_range_ex(&blinding_factor, 1, &mont->N) || - !BN_mod_mul_montgomery(out, &blinding_factor, a, mont, ctx) || - !BN_mod_inverse_odd(out, out_no_inverse, out, &mont->N, ctx) || - !BN_mod_mul_montgomery(out, &blinding_factor, out, mont, ctx)) { - OPENSSL_PUT_ERROR(BN, ERR_R_BN_LIB); - goto err; - } - - ret = 1; - -err: - BN_free(&blinding_factor); - return ret; -} - -int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p) { - BN_CTX_start(ctx); - BIGNUM *p_minus_2 = BN_CTX_get(ctx); - int ok = p_minus_2 != NULL && - BN_copy(p_minus_2, p) && - BN_sub_word(p_minus_2, 2) && - BN_mod_exp_mont(out, a, p_minus_2, p, ctx, mont_p); - BN_CTX_end(ctx); - return ok; -} - -int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p) { - BN_CTX_start(ctx); - BIGNUM *p_minus_2 = BN_CTX_get(ctx); - int ok = p_minus_2 != NULL && - BN_copy(p_minus_2, p) && - BN_sub_word(p_minus_2, 2) && - BN_mod_exp_mont_consttime(out, a, p_minus_2, p, ctx, mont_p); - BN_CTX_end(ctx); - return ok; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/internal.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/internal.h deleted file mode 100644 index f02d668c6..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/internal.h +++ /dev/null @@ -1,573 +0,0 @@ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the Eric Young open source - * license provided above. - * - * The binary polynomial arithmetic software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#ifndef OPENSSL_HEADER_BN_INTERNAL_H -#define OPENSSL_HEADER_BN_INTERNAL_H - -#include - -#if defined(OPENSSL_X86_64) && defined(_MSC_VER) -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#pragma intrinsic(__umulh, _umul128) -#endif - -#include "../../internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(OPENSSL_64_BIT) - -#if defined(BORINGSSL_HAS_UINT128) -// MSVC doesn't support two-word integers on 64-bit. -#define BN_ULLONG uint128_t -#if defined(BORINGSSL_CAN_DIVIDE_UINT128) -#define BN_CAN_DIVIDE_ULLONG -#endif -#endif - -#define BN_BITS2 64 -#define BN_BYTES 8 -#define BN_BITS4 32 -#define BN_MASK2 (0xffffffffffffffffUL) -#define BN_MASK2l (0xffffffffUL) -#define BN_MASK2h (0xffffffff00000000UL) -#define BN_MASK2h1 (0xffffffff80000000UL) -#define BN_MONT_CTX_N0_LIMBS 1 -#define BN_DEC_CONV (10000000000000000000UL) -#define BN_DEC_NUM 19 -#define TOBN(hi, lo) ((BN_ULONG)(hi) << 32 | (lo)) - -#elif defined(OPENSSL_32_BIT) - -#define BN_ULLONG uint64_t -#define BN_CAN_DIVIDE_ULLONG -#define BN_BITS2 32 -#define BN_BYTES 4 -#define BN_BITS4 16 -#define BN_MASK2 (0xffffffffUL) -#define BN_MASK2l (0xffffUL) -#define BN_MASK2h1 (0xffff8000UL) -#define BN_MASK2h (0xffff0000UL) -// On some 32-bit platforms, Montgomery multiplication is done using 64-bit -// arithmetic with SIMD instructions. On such platforms, |BN_MONT_CTX::n0| -// needs to be two words long. Only certain 32-bit platforms actually make use -// of n0[1] and shorter R value would suffice for the others. However, -// currently only the assembly files know which is which. -#define BN_MONT_CTX_N0_LIMBS 2 -#define BN_DEC_CONV (1000000000UL) -#define BN_DEC_NUM 9 -#define TOBN(hi, lo) (lo), (hi) - -#else -#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" -#endif - - -#define STATIC_BIGNUM(x) \ - { \ - (BN_ULONG *)(x), sizeof(x) / sizeof(BN_ULONG), \ - sizeof(x) / sizeof(BN_ULONG), 0, BN_FLG_STATIC_DATA \ - } - -#if defined(BN_ULLONG) -#define Lw(t) ((BN_ULONG)(t)) -#define Hw(t) ((BN_ULONG)((t) >> BN_BITS2)) -#endif - -// bn_minimal_width returns the minimal value of |bn->top| which fits the -// value of |bn|. -int bn_minimal_width(const BIGNUM *bn); - -// bn_set_minimal_width sets |bn->width| to |bn_minimal_width(bn)|. If |bn| is -// zero, |bn->neg| is set to zero. -void bn_set_minimal_width(BIGNUM *bn); - -// bn_wexpand ensures that |bn| has at least |words| works of space without -// altering its value. It returns one on success or zero on allocation -// failure. -int bn_wexpand(BIGNUM *bn, size_t words); - -// bn_expand acts the same as |bn_wexpand|, but takes a number of bits rather -// than a number of words. -int bn_expand(BIGNUM *bn, size_t bits); - -// bn_resize_words adjusts |bn->top| to be |words|. It returns one on success -// and zero on allocation error or if |bn|'s value is too large. -OPENSSL_EXPORT int bn_resize_words(BIGNUM *bn, size_t words); - -// bn_select_words sets |r| to |a| if |mask| is all ones or |b| if |mask| is -// all zeros. -void bn_select_words(BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, - const BN_ULONG *b, size_t num); - -// bn_set_words sets |bn| to the value encoded in the |num| words in |words|, -// least significant word first. -int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num); - -// bn_fits_in_words returns one if |bn| may be represented in |num| words, plus -// a sign bit, and zero otherwise. -int bn_fits_in_words(const BIGNUM *bn, size_t num); - -// bn_copy_words copies the value of |bn| to |out| and returns one if the value -// is representable in |num| words. Otherwise, it returns zero. -int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn); - -// bn_mul_add_words multiples |ap| by |w|, adds the result to |rp|, and places -// the result in |rp|. |ap| and |rp| must both be |num| words long. It returns -// the carry word of the operation. |ap| and |rp| may be equal but otherwise may -// not alias. -BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, - BN_ULONG w); - -// bn_mul_words multiples |ap| by |w| and places the result in |rp|. |ap| and -// |rp| must both be |num| words long. It returns the carry word of the -// operation. |ap| and |rp| may be equal but otherwise may not alias. -BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w); - -// bn_sqr_words sets |rp[2*i]| and |rp[2*i+1]| to |ap[i]|'s square, for all |i| -// up to |num|. |ap| is an array of |num| words and |rp| an array of |2*num| -// words. |ap| and |rp| may not alias. -// -// This gives the contribution of the |ap[i]*ap[i]| terms when squaring |ap|. -void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num); - -// bn_add_words adds |ap| to |bp| and places the result in |rp|, each of which -// are |num| words long. It returns the carry bit, which is one if the operation -// overflowed and zero otherwise. Any pair of |ap|, |bp|, and |rp| may be equal -// to each other but otherwise may not alias. -BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - size_t num); - -// bn_sub_words subtracts |bp| from |ap| and places the result in |rp|. It -// returns the borrow bit, which is one if the computation underflowed and zero -// otherwise. Any pair of |ap|, |bp|, and |rp| may be equal to each other but -// otherwise may not alias. -BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - size_t num); - -// bn_mul_comba4 sets |r| to the product of |a| and |b|. -void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]); - -// bn_mul_comba8 sets |r| to the product of |a| and |b|. -void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]); - -// bn_sqr_comba8 sets |r| to |a|^2. -void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[4]); - -// bn_sqr_comba4 sets |r| to |a|^2. -void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]); - -// bn_less_than_words returns one if |a| < |b| and zero otherwise, where |a| -// and |b| both are |len| words long. It runs in constant time. -int bn_less_than_words(const BN_ULONG *a, const BN_ULONG *b, size_t len); - -// bn_in_range_words returns one if |min_inclusive| <= |a| < |max_exclusive|, -// where |a| and |max_exclusive| both are |len| words long. |a| and -// |max_exclusive| are treated as secret. -int bn_in_range_words(const BN_ULONG *a, BN_ULONG min_inclusive, - const BN_ULONG *max_exclusive, size_t len); - -// bn_rand_range_words sets |out| to a uniformly distributed random number from -// |min_inclusive| to |max_exclusive|. Both |out| and |max_exclusive| are |len| -// words long. -// -// This function runs in time independent of the result, but |min_inclusive| and -// |max_exclusive| are public data. (Information about the range is unavoidably -// leaked by how many iterations it took to select a number.) -int bn_rand_range_words(BN_ULONG *out, BN_ULONG min_inclusive, - const BN_ULONG *max_exclusive, size_t len, - const uint8_t additional_data[32]); - -// bn_range_secret_range behaves like |BN_rand_range_ex|, but treats -// |max_exclusive| as secret. Because of this constraint, the distribution of -// values returned is more complex. -// -// Rather than repeatedly generating values until one is in range, which would -// leak information, it generates one value. If the value is in range, it sets -// |*out_is_uniform| to one. Otherwise, it sets |*out_is_uniform| to zero, -// fixing up the value to force it in range. -// -// The subset of calls to |bn_rand_secret_range| which set |*out_is_uniform| to -// one are uniformly distributed in the target range. Calls overall are not. -// This function is intended for use in situations where the extra values are -// still usable and where the number of iterations needed to reach the target -// number of uniform outputs may be blinded for negligible probabilities of -// timing leaks. -// -// Although this function treats |max_exclusive| as secret, it treats the number -// of bits in |max_exclusive| as public. -int bn_rand_secret_range(BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, - const BIGNUM *max_exclusive); - -int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - const BN_ULONG *np, const BN_ULONG *n0, int num); - -uint64_t bn_mont_n0(const BIGNUM *n); - -// bn_mod_exp_base_2_consttime calculates r = 2**p (mod n). |p| must be larger -// than log_2(n); i.e. 2**p must be larger than |n|. |n| must be positive and -// odd. |p| and the bit width of |n| are assumed public, but |n| is otherwise -// treated as secret. -int bn_mod_exp_base_2_consttime(BIGNUM *r, unsigned p, const BIGNUM *n, - BN_CTX *ctx); - -#if defined(OPENSSL_X86_64) && defined(_MSC_VER) -#define BN_UMULT_LOHI(low, high, a, b) ((low) = _umul128((a), (b), &(high))) -#endif - -#if !defined(BN_ULLONG) && !defined(BN_UMULT_LOHI) -#error "Either BN_ULLONG or BN_UMULT_LOHI must be defined on every platform." -#endif - -// bn_jacobi returns the Jacobi symbol of |a| and |b| (which is -1, 0 or 1), or -// -2 on error. -int bn_jacobi(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - -// bn_is_bit_set_words returns one if bit |bit| is set in |a| and zero -// otherwise. -int bn_is_bit_set_words(const BN_ULONG *a, size_t num, unsigned bit); - -// bn_one_to_montgomery sets |r| to one in Montgomery form. It returns one on -// success and zero on error. This function treats the bit width of the modulus -// as public. -int bn_one_to_montgomery(BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx); - -// bn_less_than_montgomery_R returns one if |bn| is less than the Montgomery R -// value for |mont| and zero otherwise. -int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont); - -// bn_mod_u16_consttime returns |bn| mod |d|, ignoring |bn|'s sign bit. It runs -// in time independent of the value of |bn|, but it treats |d| as public. -OPENSSL_EXPORT uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d); - -// bn_odd_number_is_obviously_composite returns one if |bn| is divisible by one -// of the first several odd primes and zero otherwise. -int bn_odd_number_is_obviously_composite(const BIGNUM *bn); - -// bn_rshift1_words sets |r| to |a| >> 1, where both arrays are |num| bits wide. -void bn_rshift1_words(BN_ULONG *r, const BN_ULONG *a, size_t num); - -// bn_rshift_secret_shift behaves like |BN_rshift| but runs in time independent -// of both |a| and |n|. -OPENSSL_EXPORT int bn_rshift_secret_shift(BIGNUM *r, const BIGNUM *a, - unsigned n, BN_CTX *ctx); - - -// Constant-time non-modular arithmetic. -// -// The following functions implement non-modular arithmetic in constant-time -// and pessimally set |r->width| to the largest possible word size. -// -// Note this means that, e.g., repeatedly multiplying by one will cause widths -// to increase without bound. The corresponding public API functions minimize -// their outputs to avoid regressing calculator consumers. - -// bn_uadd_consttime behaves like |BN_uadd|, but it pessimally sets -// |r->width| = |a->width| + |b->width| + 1. -int bn_uadd_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); - -// bn_usub_consttime behaves like |BN_usub|, but it pessimally sets -// |r->width| = |a->width|. -int bn_usub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); - -// bn_abs_sub_consttime sets |r| to the absolute value of |a| - |b|, treating -// both inputs as secret. It returns one on success and zero on error. -OPENSSL_EXPORT int bn_abs_sub_consttime(BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx); - -// bn_mul_consttime behaves like |BN_mul|, but it rejects negative inputs and -// pessimally sets |r->width| to |a->width| + |b->width|, to avoid leaking -// information about |a| and |b|. -int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - -// bn_sqrt_consttime behaves like |BN_sqrt|, but it pessimally sets |r->width| -// to 2*|a->width|, to avoid leaking information about |a| and |b|. -int bn_sqr_consttime(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); - -// bn_div_consttime behaves like |BN_div|, but it rejects negative inputs and -// treats both inputs, including their magnitudes, as secret. It is, as a -// result, much slower than |BN_div| and should only be used for rare operations -// where Montgomery reduction is not available. -// -// Note that |quotient->width| will be set pessimally to |numerator->width|. -OPENSSL_EXPORT int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, - const BIGNUM *numerator, - const BIGNUM *divisor, BN_CTX *ctx); - -// bn_is_relatively_prime checks whether GCD(|x|, |y|) is one. On success, it -// returns one and sets |*out_relatively_prime| to one if the GCD was one and -// zero otherwise. On error, it returns zero. -OPENSSL_EXPORT int bn_is_relatively_prime(int *out_relatively_prime, - const BIGNUM *x, const BIGNUM *y, - BN_CTX *ctx); - -// bn_lcm_consttime sets |r| to LCM(|a|, |b|). It returns one and success and -// zero on error. |a| and |b| are both treated as secret. -OPENSSL_EXPORT int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - BN_CTX *ctx); - - -// Constant-time modular arithmetic. -// -// The following functions implement basic constant-time modular arithmetic. - -// bn_mod_add_consttime acts like |BN_mod_add_quick| but takes a |BN_CTX|. -int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m, BN_CTX *ctx); - -// bn_mod_sub_consttime acts like |BN_mod_sub_quick| but takes a |BN_CTX|. -int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m, BN_CTX *ctx); - -// bn_mod_lshift1_consttime acts like |BN_mod_lshift1_quick| but takes a -// |BN_CTX|. -int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, - BN_CTX *ctx); - -// bn_mod_lshift_consttime acts like |BN_mod_lshift_quick| but takes a |BN_CTX|. -int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, - BN_CTX *ctx); - -// bn_mod_inverse_consttime sets |r| to |a|^-1, mod |n|. |a| must be non- -// negative and less than |n|. It returns one on success and zero on error. On -// failure, if the failure was caused by |a| having no inverse mod |n| then -// |*out_no_inverse| will be set to one; otherwise it will be set to zero. -// -// This function treats both |a| and |n| as secret, provided they are both non- -// zero and the inverse exists. It should only be used for even moduli where -// none of the less general implementations are applicable. -OPENSSL_EXPORT int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, - const BIGNUM *a, const BIGNUM *n, - BN_CTX *ctx); - -// bn_mod_inverse_prime sets |out| to the modular inverse of |a| modulo |p|, -// computed with Fermat's Little Theorem. It returns one on success and zero on -// error. If |mont_p| is NULL, one will be computed temporarily. -int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p); - -// bn_mod_inverse_secret_prime behaves like |bn_mod_inverse_prime| but uses -// |BN_mod_exp_mont_consttime| instead of |BN_mod_exp_mont| in hopes of -// protecting the exponent. -int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p); - - -// Low-level operations for small numbers. -// -// The following functions implement algorithms suitable for use with scalars -// and field elements in elliptic curves. They rely on the number being small -// both to stack-allocate various temporaries and because they do not implement -// optimizations useful for the larger values used in RSA. - -// BN_SMALL_MAX_WORDS is the largest size input these functions handle. This -// limit allows temporaries to be more easily stack-allocated. This limit is set -// to accommodate P-521. -#if defined(OPENSSL_32_BIT) -#define BN_SMALL_MAX_WORDS 17 -#else -#define BN_SMALL_MAX_WORDS 9 -#endif - -// bn_mul_small sets |r| to |a|*|b|. |num_r| must be |num_a| + |num_b|. |r| may -// not alias with |a| or |b|. This function returns one on success and zero if -// lengths are inconsistent. -int bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, - const BN_ULONG *b, size_t num_b); - -// bn_sqr_small sets |r| to |a|^2. |num_a| must be at most |BN_SMALL_MAX_WORDS|. -// |num_r| must be |num_a|*2. |r| and |a| may not alias. This function returns -// one on success and zero on programmer error. -int bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a); - -// In the following functions, the modulus must be at most |BN_SMALL_MAX_WORDS| -// words long. - -// bn_to_montgomery_small sets |r| to |a| translated to the Montgomery domain. -// |num_a| and |num_r| must be the length of the modulus, which is -// |mont->N.top|. |a| must be fully reduced. This function returns one on -// success and zero if lengths are inconsistent. |r| and |a| may alias. -int bn_to_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont); - -// bn_from_montgomery_small sets |r| to |a| translated out of the Montgomery -// domain. |num_r| must be the length of the modulus, which is |mont->N.top|. -// |a| must be at most |mont->N.top| * R and |num_a| must be at most 2 * -// |mont->N.top|. This function returns one on success and zero if lengths are -// inconsistent. |r| and |a| may alias. -int bn_from_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont); - -// bn_one_to_montgomery_small sets |r| to one in Montgomery form. It returns one -// on success and zero on error. |num_r| must be the length of the modulus, -// which is |mont->N.top|. This function treats the bit width of the modulus as -// public. -int bn_one_to_montgomery_small(BN_ULONG *r, size_t num_r, - const BN_MONT_CTX *mont); - -// bn_mod_mul_montgomery_small sets |r| to |a| * |b| mod |mont->N|. Both inputs -// and outputs are in the Montgomery domain. |num_r| must be the length of the -// modulus, which is |mont->N.top|. This function returns one on success and -// zero on internal error or inconsistent lengths. Any two of |r|, |a|, and |b| -// may alias. -// -// This function requires |a| * |b| < N * R, where N is the modulus and R is the -// Montgomery divisor, 2^(N.top * BN_BITS2). This should generally be satisfied -// by ensuring |a| and |b| are fully reduced, however ECDSA has one computation -// which requires the more general bound. -int bn_mod_mul_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *b, size_t num_b, - const BN_MONT_CTX *mont); - -// bn_mod_exp_mont_small sets |r| to |a|^|p| mod |mont->N|. It returns one on -// success and zero on programmer or internal error. Both inputs and outputs are -// in the Montgomery domain. |num_r| and |num_a| must be |mont->N.top|, which -// must be at most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced. This -// function runs in time independent of |a|, but |p| and |mont->N| are public -// values. -// -// Note this function differs from |BN_mod_exp_mont| which uses Montgomery -// reduction but takes input and output outside the Montgomery domain. Combine -// this function with |bn_from_montgomery_small| and |bn_to_montgomery_small| -// if necessary. -int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *p, size_t num_p, - const BN_MONT_CTX *mont); - -// bn_mod_inverse_prime_mont_small sets |r| to |a|^-1 mod |mont->N|. |mont->N| -// must be a prime. |num_r| and |num_a| must be |mont->N.top|, which must be at -// most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced. This function runs in -// time independent of |a|, but |mont->N| is a public value. -int bn_mod_inverse_prime_mont_small(BN_ULONG *r, size_t num_r, - const BN_ULONG *a, size_t num_a, - const BN_MONT_CTX *mont); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_BN_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/internal.h.grpc_back deleted file mode 100644 index a8ad129d0..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/internal.h.grpc_back +++ /dev/null @@ -1,573 +0,0 @@ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the Eric Young open source - * license provided above. - * - * The binary polynomial arithmetic software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#ifndef OPENSSL_HEADER_BN_INTERNAL_H -#define OPENSSL_HEADER_BN_INTERNAL_H - -#include - -#if defined(OPENSSL_X86_64) && defined(_MSC_VER) -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#pragma intrinsic(__umulh, _umul128) -#endif - -#include "../../internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - -#if defined(OPENSSL_64_BIT) - -#if defined(BORINGSSL_HAS_UINT128) -// MSVC doesn't support two-word integers on 64-bit. -#define BN_ULLONG uint128_t -#if defined(BORINGSSL_CAN_DIVIDE_UINT128) -#define BN_CAN_DIVIDE_ULLONG -#endif -#endif - -#define BN_BITS2 64 -#define BN_BYTES 8 -#define BN_BITS4 32 -#define BN_MASK2 (0xffffffffffffffffUL) -#define BN_MASK2l (0xffffffffUL) -#define BN_MASK2h (0xffffffff00000000UL) -#define BN_MASK2h1 (0xffffffff80000000UL) -#define BN_MONT_CTX_N0_LIMBS 1 -#define BN_DEC_CONV (10000000000000000000UL) -#define BN_DEC_NUM 19 -#define TOBN(hi, lo) ((BN_ULONG)(hi) << 32 | (lo)) - -#elif defined(OPENSSL_32_BIT) - -#define BN_ULLONG uint64_t -#define BN_CAN_DIVIDE_ULLONG -#define BN_BITS2 32 -#define BN_BYTES 4 -#define BN_BITS4 16 -#define BN_MASK2 (0xffffffffUL) -#define BN_MASK2l (0xffffUL) -#define BN_MASK2h1 (0xffff8000UL) -#define BN_MASK2h (0xffff0000UL) -// On some 32-bit platforms, Montgomery multiplication is done using 64-bit -// arithmetic with SIMD instructions. On such platforms, |BN_MONT_CTX::n0| -// needs to be two words long. Only certain 32-bit platforms actually make use -// of n0[1] and shorter R value would suffice for the others. However, -// currently only the assembly files know which is which. -#define BN_MONT_CTX_N0_LIMBS 2 -#define BN_DEC_CONV (1000000000UL) -#define BN_DEC_NUM 9 -#define TOBN(hi, lo) (lo), (hi) - -#else -#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" -#endif - - -#define STATIC_BIGNUM(x) \ - { \ - (BN_ULONG *)(x), sizeof(x) / sizeof(BN_ULONG), \ - sizeof(x) / sizeof(BN_ULONG), 0, BN_FLG_STATIC_DATA \ - } - -#if defined(BN_ULLONG) -#define Lw(t) ((BN_ULONG)(t)) -#define Hw(t) ((BN_ULONG)((t) >> BN_BITS2)) -#endif - -// bn_minimal_width returns the minimal value of |bn->top| which fits the -// value of |bn|. -int bn_minimal_width(const BIGNUM *bn); - -// bn_set_minimal_width sets |bn->width| to |bn_minimal_width(bn)|. If |bn| is -// zero, |bn->neg| is set to zero. -void bn_set_minimal_width(BIGNUM *bn); - -// bn_wexpand ensures that |bn| has at least |words| works of space without -// altering its value. It returns one on success or zero on allocation -// failure. -int bn_wexpand(BIGNUM *bn, size_t words); - -// bn_expand acts the same as |bn_wexpand|, but takes a number of bits rather -// than a number of words. -int bn_expand(BIGNUM *bn, size_t bits); - -// bn_resize_words adjusts |bn->top| to be |words|. It returns one on success -// and zero on allocation error or if |bn|'s value is too large. -OPENSSL_EXPORT int bn_resize_words(BIGNUM *bn, size_t words); - -// bn_select_words sets |r| to |a| if |mask| is all ones or |b| if |mask| is -// all zeros. -void bn_select_words(BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, - const BN_ULONG *b, size_t num); - -// bn_set_words sets |bn| to the value encoded in the |num| words in |words|, -// least significant word first. -int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num); - -// bn_fits_in_words returns one if |bn| may be represented in |num| words, plus -// a sign bit, and zero otherwise. -int bn_fits_in_words(const BIGNUM *bn, size_t num); - -// bn_copy_words copies the value of |bn| to |out| and returns one if the value -// is representable in |num| words. Otherwise, it returns zero. -int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn); - -// bn_mul_add_words multiples |ap| by |w|, adds the result to |rp|, and places -// the result in |rp|. |ap| and |rp| must both be |num| words long. It returns -// the carry word of the operation. |ap| and |rp| may be equal but otherwise may -// not alias. -BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, - BN_ULONG w); - -// bn_mul_words multiples |ap| by |w| and places the result in |rp|. |ap| and -// |rp| must both be |num| words long. It returns the carry word of the -// operation. |ap| and |rp| may be equal but otherwise may not alias. -BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w); - -// bn_sqr_words sets |rp[2*i]| and |rp[2*i+1]| to |ap[i]|'s square, for all |i| -// up to |num|. |ap| is an array of |num| words and |rp| an array of |2*num| -// words. |ap| and |rp| may not alias. -// -// This gives the contribution of the |ap[i]*ap[i]| terms when squaring |ap|. -void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num); - -// bn_add_words adds |ap| to |bp| and places the result in |rp|, each of which -// are |num| words long. It returns the carry bit, which is one if the operation -// overflowed and zero otherwise. Any pair of |ap|, |bp|, and |rp| may be equal -// to each other but otherwise may not alias. -BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - size_t num); - -// bn_sub_words subtracts |bp| from |ap| and places the result in |rp|. It -// returns the borrow bit, which is one if the computation underflowed and zero -// otherwise. Any pair of |ap|, |bp|, and |rp| may be equal to each other but -// otherwise may not alias. -BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - size_t num); - -// bn_mul_comba4 sets |r| to the product of |a| and |b|. -void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]); - -// bn_mul_comba8 sets |r| to the product of |a| and |b|. -void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]); - -// bn_sqr_comba8 sets |r| to |a|^2. -void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[4]); - -// bn_sqr_comba4 sets |r| to |a|^2. -void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]); - -// bn_less_than_words returns one if |a| < |b| and zero otherwise, where |a| -// and |b| both are |len| words long. It runs in constant time. -int bn_less_than_words(const BN_ULONG *a, const BN_ULONG *b, size_t len); - -// bn_in_range_words returns one if |min_inclusive| <= |a| < |max_exclusive|, -// where |a| and |max_exclusive| both are |len| words long. |a| and -// |max_exclusive| are treated as secret. -int bn_in_range_words(const BN_ULONG *a, BN_ULONG min_inclusive, - const BN_ULONG *max_exclusive, size_t len); - -// bn_rand_range_words sets |out| to a uniformly distributed random number from -// |min_inclusive| to |max_exclusive|. Both |out| and |max_exclusive| are |len| -// words long. -// -// This function runs in time independent of the result, but |min_inclusive| and -// |max_exclusive| are public data. (Information about the range is unavoidably -// leaked by how many iterations it took to select a number.) -int bn_rand_range_words(BN_ULONG *out, BN_ULONG min_inclusive, - const BN_ULONG *max_exclusive, size_t len, - const uint8_t additional_data[32]); - -// bn_range_secret_range behaves like |BN_rand_range_ex|, but treats -// |max_exclusive| as secret. Because of this constraint, the distribution of -// values returned is more complex. -// -// Rather than repeatedly generating values until one is in range, which would -// leak information, it generates one value. If the value is in range, it sets -// |*out_is_uniform| to one. Otherwise, it sets |*out_is_uniform| to zero, -// fixing up the value to force it in range. -// -// The subset of calls to |bn_rand_secret_range| which set |*out_is_uniform| to -// one are uniformly distributed in the target range. Calls overall are not. -// This function is intended for use in situations where the extra values are -// still usable and where the number of iterations needed to reach the target -// number of uniform outputs may be blinded for negligible probabilities of -// timing leaks. -// -// Although this function treats |max_exclusive| as secret, it treats the number -// of bits in |max_exclusive| as public. -int bn_rand_secret_range(BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, - const BIGNUM *max_exclusive); - -int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, - const BN_ULONG *np, const BN_ULONG *n0, int num); - -uint64_t bn_mont_n0(const BIGNUM *n); - -// bn_mod_exp_base_2_consttime calculates r = 2**p (mod n). |p| must be larger -// than log_2(n); i.e. 2**p must be larger than |n|. |n| must be positive and -// odd. |p| and the bit width of |n| are assumed public, but |n| is otherwise -// treated as secret. -int bn_mod_exp_base_2_consttime(BIGNUM *r, unsigned p, const BIGNUM *n, - BN_CTX *ctx); - -#if defined(OPENSSL_X86_64) && defined(_MSC_VER) -#define BN_UMULT_LOHI(low, high, a, b) ((low) = _umul128((a), (b), &(high))) -#endif - -#if !defined(BN_ULLONG) && !defined(BN_UMULT_LOHI) -#error "Either BN_ULLONG or BN_UMULT_LOHI must be defined on every platform." -#endif - -// bn_jacobi returns the Jacobi symbol of |a| and |b| (which is -1, 0 or 1), or -// -2 on error. -int bn_jacobi(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - -// bn_is_bit_set_words returns one if bit |bit| is set in |a| and zero -// otherwise. -int bn_is_bit_set_words(const BN_ULONG *a, size_t num, unsigned bit); - -// bn_one_to_montgomery sets |r| to one in Montgomery form. It returns one on -// success and zero on error. This function treats the bit width of the modulus -// as public. -int bn_one_to_montgomery(BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx); - -// bn_less_than_montgomery_R returns one if |bn| is less than the Montgomery R -// value for |mont| and zero otherwise. -int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont); - -// bn_mod_u16_consttime returns |bn| mod |d|, ignoring |bn|'s sign bit. It runs -// in time independent of the value of |bn|, but it treats |d| as public. -OPENSSL_EXPORT uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d); - -// bn_odd_number_is_obviously_composite returns one if |bn| is divisible by one -// of the first several odd primes and zero otherwise. -int bn_odd_number_is_obviously_composite(const BIGNUM *bn); - -// bn_rshift1_words sets |r| to |a| >> 1, where both arrays are |num| bits wide. -void bn_rshift1_words(BN_ULONG *r, const BN_ULONG *a, size_t num); - -// bn_rshift_secret_shift behaves like |BN_rshift| but runs in time independent -// of both |a| and |n|. -OPENSSL_EXPORT int bn_rshift_secret_shift(BIGNUM *r, const BIGNUM *a, - unsigned n, BN_CTX *ctx); - - -// Constant-time non-modular arithmetic. -// -// The following functions implement non-modular arithmetic in constant-time -// and pessimally set |r->width| to the largest possible word size. -// -// Note this means that, e.g., repeatedly multiplying by one will cause widths -// to increase without bound. The corresponding public API functions minimize -// their outputs to avoid regressing calculator consumers. - -// bn_uadd_consttime behaves like |BN_uadd|, but it pessimally sets -// |r->width| = |a->width| + |b->width| + 1. -int bn_uadd_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); - -// bn_usub_consttime behaves like |BN_usub|, but it pessimally sets -// |r->width| = |a->width|. -int bn_usub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); - -// bn_abs_sub_consttime sets |r| to the absolute value of |a| - |b|, treating -// both inputs as secret. It returns one on success and zero on error. -OPENSSL_EXPORT int bn_abs_sub_consttime(BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx); - -// bn_mul_consttime behaves like |BN_mul|, but it rejects negative inputs and -// pessimally sets |r->width| to |a->width| + |b->width|, to avoid leaking -// information about |a| and |b|. -int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - -// bn_sqrt_consttime behaves like |BN_sqrt|, but it pessimally sets |r->width| -// to 2*|a->width|, to avoid leaking information about |a| and |b|. -int bn_sqr_consttime(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); - -// bn_div_consttime behaves like |BN_div|, but it rejects negative inputs and -// treats both inputs, including their magnitudes, as secret. It is, as a -// result, much slower than |BN_div| and should only be used for rare operations -// where Montgomery reduction is not available. -// -// Note that |quotient->width| will be set pessimally to |numerator->width|. -OPENSSL_EXPORT int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, - const BIGNUM *numerator, - const BIGNUM *divisor, BN_CTX *ctx); - -// bn_is_relatively_prime checks whether GCD(|x|, |y|) is one. On success, it -// returns one and sets |*out_relatively_prime| to one if the GCD was one and -// zero otherwise. On error, it returns zero. -OPENSSL_EXPORT int bn_is_relatively_prime(int *out_relatively_prime, - const BIGNUM *x, const BIGNUM *y, - BN_CTX *ctx); - -// bn_lcm_consttime sets |r| to LCM(|a|, |b|). It returns one and success and -// zero on error. |a| and |b| are both treated as secret. -OPENSSL_EXPORT int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - BN_CTX *ctx); - - -// Constant-time modular arithmetic. -// -// The following functions implement basic constant-time modular arithmetic. - -// bn_mod_add_consttime acts like |BN_mod_add_quick| but takes a |BN_CTX|. -int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m, BN_CTX *ctx); - -// bn_mod_sub_consttime acts like |BN_mod_sub_quick| but takes a |BN_CTX|. -int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, - const BIGNUM *m, BN_CTX *ctx); - -// bn_mod_lshift1_consttime acts like |BN_mod_lshift1_quick| but takes a -// |BN_CTX|. -int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, - BN_CTX *ctx); - -// bn_mod_lshift_consttime acts like |BN_mod_lshift_quick| but takes a |BN_CTX|. -int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, - BN_CTX *ctx); - -// bn_mod_inverse_consttime sets |r| to |a|^-1, mod |n|. |a| must be non- -// negative and less than |n|. It returns one on success and zero on error. On -// failure, if the failure was caused by |a| having no inverse mod |n| then -// |*out_no_inverse| will be set to one; otherwise it will be set to zero. -// -// This function treats both |a| and |n| as secret, provided they are both non- -// zero and the inverse exists. It should only be used for even moduli where -// none of the less general implementations are applicable. -OPENSSL_EXPORT int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, - const BIGNUM *a, const BIGNUM *n, - BN_CTX *ctx); - -// bn_mod_inverse_prime sets |out| to the modular inverse of |a| modulo |p|, -// computed with Fermat's Little Theorem. It returns one on success and zero on -// error. If |mont_p| is NULL, one will be computed temporarily. -int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p); - -// bn_mod_inverse_secret_prime behaves like |bn_mod_inverse_prime| but uses -// |BN_mod_exp_mont_consttime| instead of |BN_mod_exp_mont| in hopes of -// protecting the exponent. -int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, - BN_CTX *ctx, const BN_MONT_CTX *mont_p); - - -// Low-level operations for small numbers. -// -// The following functions implement algorithms suitable for use with scalars -// and field elements in elliptic curves. They rely on the number being small -// both to stack-allocate various temporaries and because they do not implement -// optimizations useful for the larger values used in RSA. - -// BN_SMALL_MAX_WORDS is the largest size input these functions handle. This -// limit allows temporaries to be more easily stack-allocated. This limit is set -// to accommodate P-521. -#if defined(OPENSSL_32_BIT) -#define BN_SMALL_MAX_WORDS 17 -#else -#define BN_SMALL_MAX_WORDS 9 -#endif - -// bn_mul_small sets |r| to |a|*|b|. |num_r| must be |num_a| + |num_b|. |r| may -// not alias with |a| or |b|. This function returns one on success and zero if -// lengths are inconsistent. -int bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, - const BN_ULONG *b, size_t num_b); - -// bn_sqr_small sets |r| to |a|^2. |num_a| must be at most |BN_SMALL_MAX_WORDS|. -// |num_r| must be |num_a|*2. |r| and |a| may not alias. This function returns -// one on success and zero on programmer error. -int bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a); - -// In the following functions, the modulus must be at most |BN_SMALL_MAX_WORDS| -// words long. - -// bn_to_montgomery_small sets |r| to |a| translated to the Montgomery domain. -// |num_a| and |num_r| must be the length of the modulus, which is -// |mont->N.top|. |a| must be fully reduced. This function returns one on -// success and zero if lengths are inconsistent. |r| and |a| may alias. -int bn_to_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont); - -// bn_from_montgomery_small sets |r| to |a| translated out of the Montgomery -// domain. |num_r| must be the length of the modulus, which is |mont->N.top|. -// |a| must be at most |mont->N.top| * R and |num_a| must be at most 2 * -// |mont->N.top|. This function returns one on success and zero if lengths are -// inconsistent. |r| and |a| may alias. -int bn_from_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont); - -// bn_one_to_montgomery_small sets |r| to one in Montgomery form. It returns one -// on success and zero on error. |num_r| must be the length of the modulus, -// which is |mont->N.top|. This function treats the bit width of the modulus as -// public. -int bn_one_to_montgomery_small(BN_ULONG *r, size_t num_r, - const BN_MONT_CTX *mont); - -// bn_mod_mul_montgomery_small sets |r| to |a| * |b| mod |mont->N|. Both inputs -// and outputs are in the Montgomery domain. |num_r| must be the length of the -// modulus, which is |mont->N.top|. This function returns one on success and -// zero on internal error or inconsistent lengths. Any two of |r|, |a|, and |b| -// may alias. -// -// This function requires |a| * |b| < N * R, where N is the modulus and R is the -// Montgomery divisor, 2^(N.top * BN_BITS2). This should generally be satisfied -// by ensuring |a| and |b| are fully reduced, however ECDSA has one computation -// which requires the more general bound. -int bn_mod_mul_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *b, size_t num_b, - const BN_MONT_CTX *mont); - -// bn_mod_exp_mont_small sets |r| to |a|^|p| mod |mont->N|. It returns one on -// success and zero on programmer or internal error. Both inputs and outputs are -// in the Montgomery domain. |num_r| and |num_a| must be |mont->N.top|, which -// must be at most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced. This -// function runs in time independent of |a|, but |p| and |mont->N| are public -// values. -// -// Note this function differs from |BN_mod_exp_mont| which uses Montgomery -// reduction but takes input and output outside the Montgomery domain. Combine -// this function with |bn_from_montgomery_small| and |bn_to_montgomery_small| -// if necessary. -int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *p, size_t num_p, - const BN_MONT_CTX *mont); - -// bn_mod_inverse_prime_mont_small sets |r| to |a|^-1 mod |mont->N|. |mont->N| -// must be a prime. |num_r| and |num_a| must be |mont->N.top|, which must be at -// most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced. This function runs in -// time independent of |a|, but |mont->N| is a public value. -int bn_mod_inverse_prime_mont_small(BN_ULONG *r, size_t num_r, - const BN_ULONG *a, size_t num_a, - const BN_MONT_CTX *mont); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_BN_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/prime.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/prime.c deleted file mode 100644 index 62f052153..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/prime.c +++ /dev/null @@ -1,1154 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include -#include - -#include "internal.h" -#include "../../internal.h" - - -// The quick sieve algorithm approach to weeding out primes is Philip -// Zimmermann's, as implemented in PGP. I have had a read of his comments and -// implemented my own version. - -#define NUMPRIMES 2048 - -// primes contains all the primes that fit into a uint16_t. -static const uint16_t primes[NUMPRIMES] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, - 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, - 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, - 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, - 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, - 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, - 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, - 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, - 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, - 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, - 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, - 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, - 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, - 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, - 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, - 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, - 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, - 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, - 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, - 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, - 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, - 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, - 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, - 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, - 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, - 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, - 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, - 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, - 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, - 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, - 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, - 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, - 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, - 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, - 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, - 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, - 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, - 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, - 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, - 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, - 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, - 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, - 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, - 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, - 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, - 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, - 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, - 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, - 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, - 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, - 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, - 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, - 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, - 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, - 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, - 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, - 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, - 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, - 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, - 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, - 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, - 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, - 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, - 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, - 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, - 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, - 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, - 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, - 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, - 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, - 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, - 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, - 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, - 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, - 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, - 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, - 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, - 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, - 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, - 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, - 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, - 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, - 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, - 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, - 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, - 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, - 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, - 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, - 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, - 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, - 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, - 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, - 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, - 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, - 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, - 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, - 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, - 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, - 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, - 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, - 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, - 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, - 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, - 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, - 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, - 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, - 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, - 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, - 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, - 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, - 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, - 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, - 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, - 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, - 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, - 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, - 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, - 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, - 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, - 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, - 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, - 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, - 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, - 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, - 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, - 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, - 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, - 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, - 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, - 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, - 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, - 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, - 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, - 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, - 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, - 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, - 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, - 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, - 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, - 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, - 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, - 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, - 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, - 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, - 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, - 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, - 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, - 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, - 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, - 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, - 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, - 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, - 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, - 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, - 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, - 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, - 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, - 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, - 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, - 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, - 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, - 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, - 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, - 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, - 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, - 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, - 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, - 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, - 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, - 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, - 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, - 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, - 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, - 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, - 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, - 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, - 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, - 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, - 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, - 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, - 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, - 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, - 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, - 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, - 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, - 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, - 17851, 17863, -}; - -// BN_prime_checks_for_size returns the number of Miller-Rabin iterations -// necessary for a 'bits'-bit prime, in order to maintain an error rate greater -// than the security level for an RSA prime of that many bits (calculated using -// the FIPS SP 800-57 security level and 186-4 Section F.1; original paper: -// Damgaard, Landrock, Pomerance: Average case error estimates for the strong -// probable prime test. -- Math. Comp. 61 (1993) 177-194) -static int BN_prime_checks_for_size(int bits) { - if (bits >= 3747) { - return 3; - } - if (bits >= 1345) { - return 4; - } - if (bits >= 476) { - return 5; - } - if (bits >= 400) { - return 6; - } - if (bits >= 308) { - return 8; - } - if (bits >= 205) { - return 13; - } - if (bits >= 155) { - return 19; - } - return 28; -} - -// BN_PRIME_CHECKS_BLINDED is the iteration count for blinding the constant-time -// primality test. See |BN_primality_test| for details. This number is selected -// so that, for a candidate N-bit RSA prime, picking |BN_PRIME_CHECKS_BLINDED| -// random N-bit numbers will have at least |BN_prime_checks_for_size(N)| values -// in range with high probability. -// -// The following Python script computes the blinding factor needed for the -// corresponding iteration count. -/* -import math - -# We choose candidate RSA primes between sqrt(2)/2 * 2^N and 2^N and select -# witnesses by generating random N-bit numbers. Thus the probability of -# selecting one in range is at least sqrt(2)/2. -p = math.sqrt(2) / 2 - -# Target around 2^-8 probability of the blinding being insufficient given that -# key generation is a one-time, noisy operation. -epsilon = 2**-8 - -def choose(a, b): - r = 1 - for i in xrange(b): - r *= a - i - r /= (i + 1) - return r - -def failure_rate(min_uniform, iterations): - """ Returns the probability that, for |iterations| candidate witnesses, fewer - than |min_uniform| of them will be uniform. """ - prob = 0.0 - for i in xrange(min_uniform): - prob += (choose(iterations, i) * - p**i * (1-p)**(iterations - i)) - return prob - -for min_uniform in (3, 4, 5, 6, 8, 13, 19, 28): - # Find the smallest number of iterations under the target failure rate. - iterations = min_uniform - while True: - prob = failure_rate(min_uniform, iterations) - if prob < epsilon: - print min_uniform, iterations, prob - break - iterations += 1 - -Output: - 3 9 0.00368894873911 - 4 11 0.00363319494662 - 5 13 0.00336215573898 - 6 15 0.00300145783158 - 8 19 0.00225214119331 - 13 27 0.00385610026955 - 19 38 0.0021410539126 - 28 52 0.00325405801769 - -16 iterations suffices for 400-bit primes and larger (6 uniform samples needed), -which is already well below the minimum acceptable key size for RSA. -*/ -#define BN_PRIME_CHECKS_BLINDED 16 - -static int probable_prime(BIGNUM *rnd, int bits); -static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, - const BIGNUM *rem, BN_CTX *ctx); -static int probable_prime_dh_safe(BIGNUM *rnd, int bits, const BIGNUM *add, - const BIGNUM *rem, BN_CTX *ctx); - -void BN_GENCB_set(BN_GENCB *callback, - int (*f)(int event, int n, struct bn_gencb_st *), - void *arg) { - callback->callback = f; - callback->arg = arg; -} - -int BN_GENCB_call(BN_GENCB *callback, int event, int n) { - if (!callback) { - return 1; - } - - return callback->callback(event, n, callback); -} - -int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, - const BIGNUM *rem, BN_GENCB *cb) { - BIGNUM *t; - int found = 0; - int i, j, c1 = 0; - BN_CTX *ctx; - int checks = BN_prime_checks_for_size(bits); - - if (bits < 2) { - // There are no prime numbers this small. - OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); - return 0; - } else if (bits == 2 && safe) { - // The smallest safe prime (7) is three bits. - OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); - return 0; - } - - ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } - BN_CTX_start(ctx); - t = BN_CTX_get(ctx); - if (!t) { - goto err; - } - -loop: - // make a random number and set the top and bottom bits - if (add == NULL) { - if (!probable_prime(ret, bits)) { - goto err; - } - } else { - if (safe) { - if (!probable_prime_dh_safe(ret, bits, add, rem, ctx)) { - goto err; - } - } else { - if (!probable_prime_dh(ret, bits, add, rem, ctx)) { - goto err; - } - } - } - - if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, c1++)) { - // aborted - goto err; - } - - if (!safe) { - i = BN_is_prime_fasttest_ex(ret, checks, ctx, 0, cb); - if (i == -1) { - goto err; - } else if (i == 0) { - goto loop; - } - } else { - // for "safe prime" generation, check that (p-1)/2 is prime. Since a prime - // is odd, We just need to divide by 2 - if (!BN_rshift1(t, ret)) { - goto err; - } - - for (i = 0; i < checks; i++) { - j = BN_is_prime_fasttest_ex(ret, 1, ctx, 0, NULL); - if (j == -1) { - goto err; - } else if (j == 0) { - goto loop; - } - - j = BN_is_prime_fasttest_ex(t, 1, ctx, 0, NULL); - if (j == -1) { - goto err; - } else if (j == 0) { - goto loop; - } - - if (!BN_GENCB_call(cb, i, c1 - 1)) { - goto err; - } - // We have a safe prime test pass - } - } - - // we have a prime :-) - found = 1; - -err: - if (ctx != NULL) { - BN_CTX_end(ctx); - BN_CTX_free(ctx); - } - - return found; -} - -// The following functions use a Barrett reduction variant to avoid leaking the -// numerator. See http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html -// -// We use 32-bit numerator and 16-bit divisor for simplicity. This allows -// computing |m| and |q| without architecture-specific code. - -// mod_u16 returns |n| mod |d|. |p| and |m| are the "magic numbers" for |d| (see -// reference). For proof of correctness in Coq, see -// https://github.com/davidben/fiat-crypto/blob/barrett/src/Arithmetic/BarrettReduction/RidiculousFish.v -// Note the Coq version of |mod_u16| additionally includes the computation of -// |p| and |m| from |bn_mod_u16_consttime| below. -static uint16_t mod_u16(uint32_t n, uint16_t d, uint32_t p, uint32_t m) { - // Compute floor(n/d) per steps 3 through 5. - uint32_t q = ((uint64_t)m * n) >> 32; - // Note there is a typo in the reference. We right-shift by one, not two. - uint32_t t = ((n - q) >> 1) + q; - t = t >> (p - 1); - - // Multiply and subtract to get the remainder. - n -= d * t; - assert(n < d); - return n; -} - -// shift_and_add_mod_u16 returns |r| * 2^32 + |a| mod |d|. |p| and |m| are the -// "magic numbers" for |d| (see reference). -static uint16_t shift_and_add_mod_u16(uint16_t r, uint32_t a, uint16_t d, - uint32_t p, uint32_t m) { - // Incorporate |a| in two 16-bit chunks. - uint32_t t = r; - t <<= 16; - t |= a >> 16; - t = mod_u16(t, d, p, m); - - t <<= 16; - t |= a & 0xffff; - t = mod_u16(t, d, p, m); - return t; -} - -uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d) { - if (d <= 1) { - return 0; - } - - // Compute the "magic numbers" for |d|. See steps 1 and 2. - // This computes p = ceil(log_2(d)). - uint32_t p = BN_num_bits_word(d - 1); - // This operation is not constant-time, but |p| and |d| are public values. - // Note that |p| is at most 16, so the computation fits in |uint64_t|. - assert(p <= 16); - uint32_t m = ((UINT64_C(1) << (32 + p)) + d - 1) / d; - - uint16_t ret = 0; - for (int i = bn->width - 1; i >= 0; i--) { -#if BN_BITS2 == 32 - ret = shift_and_add_mod_u16(ret, bn->d[i], d, p, m); -#elif BN_BITS2 == 64 - ret = shift_and_add_mod_u16(ret, bn->d[i] >> 32, d, p, m); - ret = shift_and_add_mod_u16(ret, bn->d[i] & 0xffffffff, d, p, m); -#else -#error "Unknown BN_ULONG size" -#endif - } - return ret; -} - -static int bn_trial_division(uint16_t *out, const BIGNUM *bn) { - for (int i = 1; i < NUMPRIMES; i++) { - if (bn_mod_u16_consttime(bn, primes[i]) == 0) { - *out = primes[i]; - return 1; - } - } - return 0; -} - -int bn_odd_number_is_obviously_composite(const BIGNUM *bn) { - uint16_t prime; - return bn_trial_division(&prime, bn) && !BN_is_word(bn, prime); -} - -int BN_primality_test(int *is_probably_prime, const BIGNUM *w, - int iterations, BN_CTX *ctx, int do_trial_division, - BN_GENCB *cb) { - *is_probably_prime = 0; - - // To support RSA key generation, this function should treat |w| as secret if - // it is a large prime. Composite numbers are discarded, so they may return - // early. - - if (BN_cmp(w, BN_value_one()) <= 0) { - return 1; - } - - if (!BN_is_odd(w)) { - // The only even prime is two. - *is_probably_prime = BN_is_word(w, 2); - return 1; - } - - // Miller-Rabin does not work for three. - if (BN_is_word(w, 3)) { - *is_probably_prime = 1; - return 1; - } - - if (do_trial_division) { - // Perform additional trial division checks to discard small primes. - uint16_t prime; - if (bn_trial_division(&prime, w)) { - *is_probably_prime = BN_is_word(w, prime); - return 1; - } - if (!BN_GENCB_call(cb, 1, -1)) { - return 0; - } - } - - if (iterations == BN_prime_checks) { - iterations = BN_prime_checks_for_size(BN_num_bits(w)); - } - - // See C.3.1 from FIPS 186-4. - int ret = 0; - BN_MONT_CTX *mont = NULL; - BN_CTX_start(ctx); - BIGNUM *w1 = BN_CTX_get(ctx); - if (w1 == NULL || - !bn_usub_consttime(w1, w, BN_value_one())) { - goto err; - } - - // Write w1 as m * 2^a (Steps 1 and 2). - int w_len = BN_num_bits(w); - int a = BN_count_low_zero_bits(w1); - BIGNUM *m = BN_CTX_get(ctx); - if (m == NULL || - !bn_rshift_secret_shift(m, w1, a, ctx)) { - goto err; - } - - // Montgomery setup for computations mod w. Additionally, compute 1 and w - 1 - // in the Montgomery domain for later comparisons. - BIGNUM *b = BN_CTX_get(ctx); - BIGNUM *z = BN_CTX_get(ctx); - BIGNUM *one_mont = BN_CTX_get(ctx); - BIGNUM *w1_mont = BN_CTX_get(ctx); - mont = BN_MONT_CTX_new_for_modulus(w, ctx); - if (b == NULL || z == NULL || one_mont == NULL || w1_mont == NULL || - mont == NULL || - !bn_one_to_montgomery(one_mont, mont, ctx) || - // w - 1 is -1 mod w, so we can compute it in the Montgomery domain, -R, - // with a subtraction. (|one_mont| cannot be zero.) - !bn_usub_consttime(w1_mont, w, one_mont)) { - goto err; - } - - // The following loop performs in inner iteration of the Miller-Rabin - // Primality test (Step 4). - // - // The algorithm as specified in FIPS 186-4 leaks information on |w|, the RSA - // private key. Instead, we run through each iteration unconditionally, - // performing modular multiplications, masking off any effects to behave - // equivalently to the specified algorithm. - // - // We also blind the number of values of |b| we try. Steps 4.1–4.2 say to - // discard out-of-range values. To avoid leaking information on |w|, we use - // |bn_rand_secret_range| which, rather than discarding bad values, adjusts - // them to be in range. Though not uniformly selected, these adjusted values - // are still usable as Rabin-Miller checks. - // - // Rabin-Miller is already probabilistic, so we could reach the desired - // confidence levels by just suitably increasing the iteration count. However, - // to align with FIPS 186-4, we use a more pessimal analysis: we do not count - // the non-uniform values towards the iteration count. As a result, this - // function is more complex and has more timing risk than necessary. - // - // We count both total iterations and uniform ones and iterate until we've - // reached at least |BN_PRIME_CHECKS_BLINDED| and |iterations|, respectively. - // If the latter is large enough, it will be the limiting factor with high - // probability and we won't leak information. - // - // Note this blinding does not impact most calls when picking primes because - // composites are rejected early. Only the two secret primes see extra work. - - crypto_word_t uniform_iterations = 0; - // Using |constant_time_lt_w| seems to prevent the compiler from optimizing - // this into two jumps. - for (int i = 1; (i <= BN_PRIME_CHECKS_BLINDED) | - constant_time_lt_w(uniform_iterations, iterations); - i++) { - int is_uniform; - if (// Step 4.1-4.2 - !bn_rand_secret_range(b, &is_uniform, 2, w1) || - // Step 4.3 - !BN_mod_exp_mont_consttime(z, b, m, w, ctx, mont)) { - goto err; - } - uniform_iterations += is_uniform; - - // loop_done is all ones if the loop has completed and all zeros otherwise. - crypto_word_t loop_done = 0; - // next_iteration is all ones if we should continue to the next iteration - // (|b| is not a composite witness for |w|). This is equivalent to going to - // step 4.7 in the original algorithm. - crypto_word_t next_iteration = 0; - - // Step 4.4. If z = 1 or z = w-1, mask off the loop and continue to the next - // iteration (go to step 4.7). - loop_done = BN_equal_consttime(z, BN_value_one()) | - BN_equal_consttime(z, w1); - loop_done = 0 - loop_done; // Make it all zeros or all ones. - next_iteration = loop_done; // Go to step 4.7 if |loop_done|. - - // Step 4.5. We use Montgomery-encoding for better performance and to avoid - // timing leaks. - if (!BN_to_montgomery(z, z, mont, ctx)) { - goto err; - } - - // To avoid leaking |a|, we run the loop to |w_len| and mask off all - // iterations once |j| = |a|. - for (int j = 1; j < w_len; j++) { - loop_done |= constant_time_eq_int(j, a); - - // Step 4.5.1. - if (!BN_mod_mul_montgomery(z, z, z, mont, ctx)) { - goto err; - } - - // Step 4.5.2. If z = w-1 and the loop is not done, run through the next - // iteration. - crypto_word_t z_is_w1_mont = BN_equal_consttime(z, w1_mont) & ~loop_done; - z_is_w1_mont = 0 - z_is_w1_mont; // Make it all zeros or all ones. - loop_done |= z_is_w1_mont; - next_iteration |= z_is_w1_mont; // Go to step 4.7 if |z_is_w1_mont|. - - // Step 4.5.3. If z = 1 and the loop is not done, w is composite and we - // may exit in variable time. - if (BN_equal_consttime(z, one_mont) & ~loop_done) { - assert(!next_iteration); - break; - } - } - - if (!next_iteration) { - // Step 4.6. We did not see z = w-1 before z = 1, so w must be composite. - // (For any prime, the value of z immediately preceding 1 must be -1. - // There are no non-trivial square roots of 1 modulo a prime.) - *is_probably_prime = 0; - ret = 1; - goto err; - } - - // Step 4.7 - if (!BN_GENCB_call(cb, 1, i)) { - goto err; - } - } - - assert(uniform_iterations >= (crypto_word_t)iterations); - *is_probably_prime = 1; - ret = 1; - -err: - BN_MONT_CTX_free(mont); - BN_CTX_end(ctx); - return ret; -} - -int BN_is_prime_ex(const BIGNUM *candidate, int checks, BN_CTX *ctx, BN_GENCB *cb) { - return BN_is_prime_fasttest_ex(candidate, checks, ctx, 0, cb); -} - -int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx, - int do_trial_division, BN_GENCB *cb) { - int is_probably_prime; - if (!BN_primality_test(&is_probably_prime, a, checks, ctx, do_trial_division, - cb)) { - return -1; - } - return is_probably_prime; -} - -int BN_enhanced_miller_rabin_primality_test( - enum bn_primality_result_t *out_result, const BIGNUM *w, int iterations, - BN_CTX *ctx, BN_GENCB *cb) { - // Enhanced Miller-Rabin is only valid on odd integers greater than 3. - if (!BN_is_odd(w) || BN_cmp_word(w, 3) <= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INVALID_INPUT); - return 0; - } - - if (iterations == BN_prime_checks) { - iterations = BN_prime_checks_for_size(BN_num_bits(w)); - } - - int ret = 0; - BN_MONT_CTX *mont = NULL; - - BN_CTX_start(ctx); - - BIGNUM *w1 = BN_CTX_get(ctx); - if (w1 == NULL || - !BN_copy(w1, w) || - !BN_sub_word(w1, 1)) { - goto err; - } - - // Write w1 as m*2^a (Steps 1 and 2). - int a = 0; - while (!BN_is_bit_set(w1, a)) { - a++; - } - BIGNUM *m = BN_CTX_get(ctx); - if (m == NULL || - !BN_rshift(m, w1, a)) { - goto err; - } - - BIGNUM *b = BN_CTX_get(ctx); - BIGNUM *g = BN_CTX_get(ctx); - BIGNUM *z = BN_CTX_get(ctx); - BIGNUM *x = BN_CTX_get(ctx); - BIGNUM *x1 = BN_CTX_get(ctx); - if (b == NULL || - g == NULL || - z == NULL || - x == NULL || - x1 == NULL) { - goto err; - } - - // Montgomery setup for computations mod w - mont = BN_MONT_CTX_new_for_modulus(w, ctx); - if (mont == NULL) { - goto err; - } - - // The following loop performs in inner iteration of the Enhanced Miller-Rabin - // Primality test (Step 4). - for (int i = 1; i <= iterations; i++) { - // Step 4.1-4.2 - if (!BN_rand_range_ex(b, 2, w1)) { - goto err; - } - - // Step 4.3-4.4 - if (!BN_gcd(g, b, w, ctx)) { - goto err; - } - if (BN_cmp_word(g, 1) > 0) { - *out_result = bn_composite; - ret = 1; - goto err; - } - - // Step 4.5 - if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) { - goto err; - } - - // Step 4.6 - if (BN_is_one(z) || BN_cmp(z, w1) == 0) { - goto loop; - } - - // Step 4.7 - for (int j = 1; j < a; j++) { - if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { - goto err; - } - if (BN_cmp(z, w1) == 0) { - goto loop; - } - if (BN_is_one(z)) { - goto composite; - } - } - - // Step 4.8-4.9 - if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { - goto err; - } - - // Step 4.10-4.11 - if (!BN_is_one(z) && !BN_copy(x, z)) { - goto err; - } - - composite: - // Step 4.12-4.14 - if (!BN_copy(x1, x) || - !BN_sub_word(x1, 1) || - !BN_gcd(g, x1, w, ctx)) { - goto err; - } - if (BN_cmp_word(g, 1) > 0) { - *out_result = bn_composite; - } else { - *out_result = bn_non_prime_power_composite; - } - - ret = 1; - goto err; - - loop: - // Step 4.15 - if (!BN_GENCB_call(cb, 1, i)) { - goto err; - } - } - - *out_result = bn_probably_prime; - ret = 1; - -err: - BN_MONT_CTX_free(mont); - BN_CTX_end(ctx); - - return ret; -} - -static int probable_prime(BIGNUM *rnd, int bits) { - int i; - uint16_t mods[NUMPRIMES]; - BN_ULONG delta; - BN_ULONG maxdelta = BN_MASK2 - primes[NUMPRIMES - 1]; - char is_single_word = bits <= BN_BITS2; - -again: - if (!BN_rand(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD)) { - return 0; - } - - // we now have a random number 'rnd' to test. - for (i = 1; i < NUMPRIMES; i++) { - mods[i] = bn_mod_u16_consttime(rnd, primes[i]); - } - // If bits is so small that it fits into a single word then we - // additionally don't want to exceed that many bits. - if (is_single_word) { - BN_ULONG size_limit; - if (bits == BN_BITS2) { - // Avoid undefined behavior. - size_limit = ~((BN_ULONG)0) - BN_get_word(rnd); - } else { - size_limit = (((BN_ULONG)1) << bits) - BN_get_word(rnd) - 1; - } - if (size_limit < maxdelta) { - maxdelta = size_limit; - } - } - delta = 0; - -loop: - if (is_single_word) { - BN_ULONG rnd_word = BN_get_word(rnd); - - // In the case that the candidate prime is a single word then - // we check that: - // 1) It's greater than primes[i] because we shouldn't reject - // 3 as being a prime number because it's a multiple of - // three. - // 2) That it's not a multiple of a known prime. We don't - // check that rnd-1 is also coprime to all the known - // primes because there aren't many small primes where - // that's true. - for (i = 1; i < NUMPRIMES && primes[i] < rnd_word; i++) { - if ((mods[i] + delta) % primes[i] == 0) { - delta += 2; - if (delta > maxdelta) { - goto again; - } - goto loop; - } - } - } else { - for (i = 1; i < NUMPRIMES; i++) { - // check that rnd is not a prime and also - // that gcd(rnd-1,primes) == 1 (except for 2) - if (((mods[i] + delta) % primes[i]) <= 1) { - delta += 2; - if (delta > maxdelta) { - goto again; - } - goto loop; - } - } - } - - if (!BN_add_word(rnd, delta)) { - return 0; - } - if (BN_num_bits(rnd) != (unsigned)bits) { - goto again; - } - - return 1; -} - -static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, - const BIGNUM *rem, BN_CTX *ctx) { - int i, ret = 0; - BIGNUM *t1; - - BN_CTX_start(ctx); - if ((t1 = BN_CTX_get(ctx)) == NULL) { - goto err; - } - - if (!BN_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { - goto err; - } - - // we need ((rnd-rem) % add) == 0 - - if (!BN_mod(t1, rnd, add, ctx)) { - goto err; - } - if (!BN_sub(rnd, rnd, t1)) { - goto err; - } - if (rem == NULL) { - if (!BN_add_word(rnd, 1)) { - goto err; - } - } else { - if (!BN_add(rnd, rnd, rem)) { - goto err; - } - } - // we now have a random number 'rand' to test. - -loop: - for (i = 1; i < NUMPRIMES; i++) { - // check that rnd is a prime - if (bn_mod_u16_consttime(rnd, primes[i]) <= 1) { - if (!BN_add(rnd, rnd, add)) { - goto err; - } - goto loop; - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} - -static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd, - const BIGNUM *rem, BN_CTX *ctx) { - int i, ret = 0; - BIGNUM *t1, *qadd, *q; - - bits--; - BN_CTX_start(ctx); - t1 = BN_CTX_get(ctx); - q = BN_CTX_get(ctx); - qadd = BN_CTX_get(ctx); - if (qadd == NULL) { - goto err; - } - - if (!BN_rshift1(qadd, padd)) { - goto err; - } - - if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { - goto err; - } - - // we need ((rnd-rem) % add) == 0 - if (!BN_mod(t1, q, qadd, ctx)) { - goto err; - } - - if (!BN_sub(q, q, t1)) { - goto err; - } - - if (rem == NULL) { - if (!BN_add_word(q, 1)) { - goto err; - } - } else { - if (!BN_rshift1(t1, rem)) { - goto err; - } - if (!BN_add(q, q, t1)) { - goto err; - } - } - - // we now have a random number 'rand' to test. - if (!BN_lshift1(p, q)) { - goto err; - } - if (!BN_add_word(p, 1)) { - goto err; - } - -loop: - for (i = 1; i < NUMPRIMES; i++) { - // check that p and q are prime - // check that for p and q - // gcd(p-1,primes) == 1 (except for 2) - if (bn_mod_u16_consttime(p, primes[i]) == 0 || - bn_mod_u16_consttime(q, primes[i]) == 0) { - if (!BN_add(p, p, padd)) { - goto err; - } - if (!BN_add(q, q, qadd)) { - goto err; - } - goto loop; - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/prime.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/prime.c.grpc_back deleted file mode 100644 index 35b1034df..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/prime.c.grpc_back +++ /dev/null @@ -1,1154 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include -#include - -#include "internal.h" -#include "../../internal.h" - - -// The quick sieve algorithm approach to weeding out primes is Philip -// Zimmermann's, as implemented in PGP. I have had a read of his comments and -// implemented my own version. - -#define NUMPRIMES 2048 - -// primes contains all the primes that fit into a uint16_t. -static const uint16_t primes[NUMPRIMES] = { - 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, - 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, - 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, - 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, - 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, - 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, - 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, - 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, - 461, 463, 467, 479, 487, 491, 499, 503, 509, 521, 523, - 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 601, - 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, - 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, - 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, - 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, - 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, - 983, 991, 997, 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, - 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, 1103, 1109, 1117, - 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, - 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, - 1291, 1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, - 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, - 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, 1523, 1531, - 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, 1607, - 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, - 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, - 1783, 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, - 1873, 1877, 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, - 1973, 1979, 1987, 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, - 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, 2111, 2113, - 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, 2203, 2207, 2213, - 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, - 2297, 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, - 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, 2437, 2441, 2447, - 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, 2549, 2551, - 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, 2659, - 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, - 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, - 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, - 2897, 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, - 2999, 3001, 3011, 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, - 3083, 3089, 3109, 3119, 3121, 3137, 3163, 3167, 3169, 3181, 3187, - 3191, 3203, 3209, 3217, 3221, 3229, 3251, 3253, 3257, 3259, 3271, - 3299, 3301, 3307, 3313, 3319, 3323, 3329, 3331, 3343, 3347, 3359, - 3361, 3371, 3373, 3389, 3391, 3407, 3413, 3433, 3449, 3457, 3461, - 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, 3529, 3533, 3539, - 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, 3613, 3617, - 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, 3701, - 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, - 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, - 3907, 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, - 4001, 4003, 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, - 4079, 4091, 4093, 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, - 4159, 4177, 4201, 4211, 4217, 4219, 4229, 4231, 4241, 4243, 4253, - 4259, 4261, 4271, 4273, 4283, 4289, 4297, 4327, 4337, 4339, 4349, - 4357, 4363, 4373, 4391, 4397, 4409, 4421, 4423, 4441, 4447, 4451, - 4457, 4463, 4481, 4483, 4493, 4507, 4513, 4517, 4519, 4523, 4547, - 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, 4637, 4639, 4643, - 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, 4723, 4729, - 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, 4817, - 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, - 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, - 5011, 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, - 5107, 5113, 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, - 5227, 5231, 5233, 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, - 5323, 5333, 5347, 5351, 5381, 5387, 5393, 5399, 5407, 5413, 5417, - 5419, 5431, 5437, 5441, 5443, 5449, 5471, 5477, 5479, 5483, 5501, - 5503, 5507, 5519, 5521, 5527, 5531, 5557, 5563, 5569, 5573, 5581, - 5591, 5623, 5639, 5641, 5647, 5651, 5653, 5657, 5659, 5669, 5683, - 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, 5749, 5779, 5783, - 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, 5851, 5857, - 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, 5953, - 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, - 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, - 6173, 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, - 6269, 6271, 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, - 6343, 6353, 6359, 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, - 6449, 6451, 6469, 6473, 6481, 6491, 6521, 6529, 6547, 6551, 6553, - 6563, 6569, 6571, 6577, 6581, 6599, 6607, 6619, 6637, 6653, 6659, - 6661, 6673, 6679, 6689, 6691, 6701, 6703, 6709, 6719, 6733, 6737, - 6761, 6763, 6779, 6781, 6791, 6793, 6803, 6823, 6827, 6829, 6833, - 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, 6911, 6917, 6947, - 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, 7001, 7013, - 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, 7127, - 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, - 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, - 7349, 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, - 7481, 7487, 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, - 7549, 7559, 7561, 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, - 7639, 7643, 7649, 7669, 7673, 7681, 7687, 7691, 7699, 7703, 7717, - 7723, 7727, 7741, 7753, 7757, 7759, 7789, 7793, 7817, 7823, 7829, - 7841, 7853, 7867, 7873, 7877, 7879, 7883, 7901, 7907, 7919, 7927, - 7933, 7937, 7949, 7951, 7963, 7993, 8009, 8011, 8017, 8039, 8053, - 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, 8117, 8123, 8147, - 8161, 8167, 8171, 8179, 8191, 8209, 8219, 8221, 8231, 8233, 8237, - 8243, 8263, 8269, 8273, 8287, 8291, 8293, 8297, 8311, 8317, 8329, - 8353, 8363, 8369, 8377, 8387, 8389, 8419, 8423, 8429, 8431, 8443, - 8447, 8461, 8467, 8501, 8513, 8521, 8527, 8537, 8539, 8543, 8563, - 8573, 8581, 8597, 8599, 8609, 8623, 8627, 8629, 8641, 8647, 8663, - 8669, 8677, 8681, 8689, 8693, 8699, 8707, 8713, 8719, 8731, 8737, - 8741, 8747, 8753, 8761, 8779, 8783, 8803, 8807, 8819, 8821, 8831, - 8837, 8839, 8849, 8861, 8863, 8867, 8887, 8893, 8923, 8929, 8933, - 8941, 8951, 8963, 8969, 8971, 8999, 9001, 9007, 9011, 9013, 9029, - 9041, 9043, 9049, 9059, 9067, 9091, 9103, 9109, 9127, 9133, 9137, - 9151, 9157, 9161, 9173, 9181, 9187, 9199, 9203, 9209, 9221, 9227, - 9239, 9241, 9257, 9277, 9281, 9283, 9293, 9311, 9319, 9323, 9337, - 9341, 9343, 9349, 9371, 9377, 9391, 9397, 9403, 9413, 9419, 9421, - 9431, 9433, 9437, 9439, 9461, 9463, 9467, 9473, 9479, 9491, 9497, - 9511, 9521, 9533, 9539, 9547, 9551, 9587, 9601, 9613, 9619, 9623, - 9629, 9631, 9643, 9649, 9661, 9677, 9679, 9689, 9697, 9719, 9721, - 9733, 9739, 9743, 9749, 9767, 9769, 9781, 9787, 9791, 9803, 9811, - 9817, 9829, 9833, 9839, 9851, 9857, 9859, 9871, 9883, 9887, 9901, - 9907, 9923, 9929, 9931, 9941, 9949, 9967, 9973, 10007, 10009, 10037, - 10039, 10061, 10067, 10069, 10079, 10091, 10093, 10099, 10103, 10111, 10133, - 10139, 10141, 10151, 10159, 10163, 10169, 10177, 10181, 10193, 10211, 10223, - 10243, 10247, 10253, 10259, 10267, 10271, 10273, 10289, 10301, 10303, 10313, - 10321, 10331, 10333, 10337, 10343, 10357, 10369, 10391, 10399, 10427, 10429, - 10433, 10453, 10457, 10459, 10463, 10477, 10487, 10499, 10501, 10513, 10529, - 10531, 10559, 10567, 10589, 10597, 10601, 10607, 10613, 10627, 10631, 10639, - 10651, 10657, 10663, 10667, 10687, 10691, 10709, 10711, 10723, 10729, 10733, - 10739, 10753, 10771, 10781, 10789, 10799, 10831, 10837, 10847, 10853, 10859, - 10861, 10867, 10883, 10889, 10891, 10903, 10909, 10937, 10939, 10949, 10957, - 10973, 10979, 10987, 10993, 11003, 11027, 11047, 11057, 11059, 11069, 11071, - 11083, 11087, 11093, 11113, 11117, 11119, 11131, 11149, 11159, 11161, 11171, - 11173, 11177, 11197, 11213, 11239, 11243, 11251, 11257, 11261, 11273, 11279, - 11287, 11299, 11311, 11317, 11321, 11329, 11351, 11353, 11369, 11383, 11393, - 11399, 11411, 11423, 11437, 11443, 11447, 11467, 11471, 11483, 11489, 11491, - 11497, 11503, 11519, 11527, 11549, 11551, 11579, 11587, 11593, 11597, 11617, - 11621, 11633, 11657, 11677, 11681, 11689, 11699, 11701, 11717, 11719, 11731, - 11743, 11777, 11779, 11783, 11789, 11801, 11807, 11813, 11821, 11827, 11831, - 11833, 11839, 11863, 11867, 11887, 11897, 11903, 11909, 11923, 11927, 11933, - 11939, 11941, 11953, 11959, 11969, 11971, 11981, 11987, 12007, 12011, 12037, - 12041, 12043, 12049, 12071, 12073, 12097, 12101, 12107, 12109, 12113, 12119, - 12143, 12149, 12157, 12161, 12163, 12197, 12203, 12211, 12227, 12239, 12241, - 12251, 12253, 12263, 12269, 12277, 12281, 12289, 12301, 12323, 12329, 12343, - 12347, 12373, 12377, 12379, 12391, 12401, 12409, 12413, 12421, 12433, 12437, - 12451, 12457, 12473, 12479, 12487, 12491, 12497, 12503, 12511, 12517, 12527, - 12539, 12541, 12547, 12553, 12569, 12577, 12583, 12589, 12601, 12611, 12613, - 12619, 12637, 12641, 12647, 12653, 12659, 12671, 12689, 12697, 12703, 12713, - 12721, 12739, 12743, 12757, 12763, 12781, 12791, 12799, 12809, 12821, 12823, - 12829, 12841, 12853, 12889, 12893, 12899, 12907, 12911, 12917, 12919, 12923, - 12941, 12953, 12959, 12967, 12973, 12979, 12983, 13001, 13003, 13007, 13009, - 13033, 13037, 13043, 13049, 13063, 13093, 13099, 13103, 13109, 13121, 13127, - 13147, 13151, 13159, 13163, 13171, 13177, 13183, 13187, 13217, 13219, 13229, - 13241, 13249, 13259, 13267, 13291, 13297, 13309, 13313, 13327, 13331, 13337, - 13339, 13367, 13381, 13397, 13399, 13411, 13417, 13421, 13441, 13451, 13457, - 13463, 13469, 13477, 13487, 13499, 13513, 13523, 13537, 13553, 13567, 13577, - 13591, 13597, 13613, 13619, 13627, 13633, 13649, 13669, 13679, 13681, 13687, - 13691, 13693, 13697, 13709, 13711, 13721, 13723, 13729, 13751, 13757, 13759, - 13763, 13781, 13789, 13799, 13807, 13829, 13831, 13841, 13859, 13873, 13877, - 13879, 13883, 13901, 13903, 13907, 13913, 13921, 13931, 13933, 13963, 13967, - 13997, 13999, 14009, 14011, 14029, 14033, 14051, 14057, 14071, 14081, 14083, - 14087, 14107, 14143, 14149, 14153, 14159, 14173, 14177, 14197, 14207, 14221, - 14243, 14249, 14251, 14281, 14293, 14303, 14321, 14323, 14327, 14341, 14347, - 14369, 14387, 14389, 14401, 14407, 14411, 14419, 14423, 14431, 14437, 14447, - 14449, 14461, 14479, 14489, 14503, 14519, 14533, 14537, 14543, 14549, 14551, - 14557, 14561, 14563, 14591, 14593, 14621, 14627, 14629, 14633, 14639, 14653, - 14657, 14669, 14683, 14699, 14713, 14717, 14723, 14731, 14737, 14741, 14747, - 14753, 14759, 14767, 14771, 14779, 14783, 14797, 14813, 14821, 14827, 14831, - 14843, 14851, 14867, 14869, 14879, 14887, 14891, 14897, 14923, 14929, 14939, - 14947, 14951, 14957, 14969, 14983, 15013, 15017, 15031, 15053, 15061, 15073, - 15077, 15083, 15091, 15101, 15107, 15121, 15131, 15137, 15139, 15149, 15161, - 15173, 15187, 15193, 15199, 15217, 15227, 15233, 15241, 15259, 15263, 15269, - 15271, 15277, 15287, 15289, 15299, 15307, 15313, 15319, 15329, 15331, 15349, - 15359, 15361, 15373, 15377, 15383, 15391, 15401, 15413, 15427, 15439, 15443, - 15451, 15461, 15467, 15473, 15493, 15497, 15511, 15527, 15541, 15551, 15559, - 15569, 15581, 15583, 15601, 15607, 15619, 15629, 15641, 15643, 15647, 15649, - 15661, 15667, 15671, 15679, 15683, 15727, 15731, 15733, 15737, 15739, 15749, - 15761, 15767, 15773, 15787, 15791, 15797, 15803, 15809, 15817, 15823, 15859, - 15877, 15881, 15887, 15889, 15901, 15907, 15913, 15919, 15923, 15937, 15959, - 15971, 15973, 15991, 16001, 16007, 16033, 16057, 16061, 16063, 16067, 16069, - 16073, 16087, 16091, 16097, 16103, 16111, 16127, 16139, 16141, 16183, 16187, - 16189, 16193, 16217, 16223, 16229, 16231, 16249, 16253, 16267, 16273, 16301, - 16319, 16333, 16339, 16349, 16361, 16363, 16369, 16381, 16411, 16417, 16421, - 16427, 16433, 16447, 16451, 16453, 16477, 16481, 16487, 16493, 16519, 16529, - 16547, 16553, 16561, 16567, 16573, 16603, 16607, 16619, 16631, 16633, 16649, - 16651, 16657, 16661, 16673, 16691, 16693, 16699, 16703, 16729, 16741, 16747, - 16759, 16763, 16787, 16811, 16823, 16829, 16831, 16843, 16871, 16879, 16883, - 16889, 16901, 16903, 16921, 16927, 16931, 16937, 16943, 16963, 16979, 16981, - 16987, 16993, 17011, 17021, 17027, 17029, 17033, 17041, 17047, 17053, 17077, - 17093, 17099, 17107, 17117, 17123, 17137, 17159, 17167, 17183, 17189, 17191, - 17203, 17207, 17209, 17231, 17239, 17257, 17291, 17293, 17299, 17317, 17321, - 17327, 17333, 17341, 17351, 17359, 17377, 17383, 17387, 17389, 17393, 17401, - 17417, 17419, 17431, 17443, 17449, 17467, 17471, 17477, 17483, 17489, 17491, - 17497, 17509, 17519, 17539, 17551, 17569, 17573, 17579, 17581, 17597, 17599, - 17609, 17623, 17627, 17657, 17659, 17669, 17681, 17683, 17707, 17713, 17729, - 17737, 17747, 17749, 17761, 17783, 17789, 17791, 17807, 17827, 17837, 17839, - 17851, 17863, -}; - -// BN_prime_checks_for_size returns the number of Miller-Rabin iterations -// necessary for a 'bits'-bit prime, in order to maintain an error rate greater -// than the security level for an RSA prime of that many bits (calculated using -// the FIPS SP 800-57 security level and 186-4 Section F.1; original paper: -// Damgaard, Landrock, Pomerance: Average case error estimates for the strong -// probable prime test. -- Math. Comp. 61 (1993) 177-194) -static int BN_prime_checks_for_size(int bits) { - if (bits >= 3747) { - return 3; - } - if (bits >= 1345) { - return 4; - } - if (bits >= 476) { - return 5; - } - if (bits >= 400) { - return 6; - } - if (bits >= 308) { - return 8; - } - if (bits >= 205) { - return 13; - } - if (bits >= 155) { - return 19; - } - return 28; -} - -// BN_PRIME_CHECKS_BLINDED is the iteration count for blinding the constant-time -// primality test. See |BN_primality_test| for details. This number is selected -// so that, for a candidate N-bit RSA prime, picking |BN_PRIME_CHECKS_BLINDED| -// random N-bit numbers will have at least |BN_prime_checks_for_size(N)| values -// in range with high probability. -// -// The following Python script computes the blinding factor needed for the -// corresponding iteration count. -/* -import math - -# We choose candidate RSA primes between sqrt(2)/2 * 2^N and 2^N and select -# witnesses by generating random N-bit numbers. Thus the probability of -# selecting one in range is at least sqrt(2)/2. -p = math.sqrt(2) / 2 - -# Target around 2^-8 probability of the blinding being insufficient given that -# key generation is a one-time, noisy operation. -epsilon = 2**-8 - -def choose(a, b): - r = 1 - for i in xrange(b): - r *= a - i - r /= (i + 1) - return r - -def failure_rate(min_uniform, iterations): - """ Returns the probability that, for |iterations| candidate witnesses, fewer - than |min_uniform| of them will be uniform. """ - prob = 0.0 - for i in xrange(min_uniform): - prob += (choose(iterations, i) * - p**i * (1-p)**(iterations - i)) - return prob - -for min_uniform in (3, 4, 5, 6, 8, 13, 19, 28): - # Find the smallest number of iterations under the target failure rate. - iterations = min_uniform - while True: - prob = failure_rate(min_uniform, iterations) - if prob < epsilon: - print min_uniform, iterations, prob - break - iterations += 1 - -Output: - 3 9 0.00368894873911 - 4 11 0.00363319494662 - 5 13 0.00336215573898 - 6 15 0.00300145783158 - 8 19 0.00225214119331 - 13 27 0.00385610026955 - 19 38 0.0021410539126 - 28 52 0.00325405801769 - -16 iterations suffices for 400-bit primes and larger (6 uniform samples needed), -which is already well below the minimum acceptable key size for RSA. -*/ -#define BN_PRIME_CHECKS_BLINDED 16 - -static int probable_prime(BIGNUM *rnd, int bits); -static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, - const BIGNUM *rem, BN_CTX *ctx); -static int probable_prime_dh_safe(BIGNUM *rnd, int bits, const BIGNUM *add, - const BIGNUM *rem, BN_CTX *ctx); - -void BN_GENCB_set(BN_GENCB *callback, - int (*f)(int event, int n, struct bn_gencb_st *), - void *arg) { - callback->callback = f; - callback->arg = arg; -} - -int BN_GENCB_call(BN_GENCB *callback, int event, int n) { - if (!callback) { - return 1; - } - - return callback->callback(event, n, callback); -} - -int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, - const BIGNUM *rem, BN_GENCB *cb) { - BIGNUM *t; - int found = 0; - int i, j, c1 = 0; - BN_CTX *ctx; - int checks = BN_prime_checks_for_size(bits); - - if (bits < 2) { - // There are no prime numbers this small. - OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); - return 0; - } else if (bits == 2 && safe) { - // The smallest safe prime (7) is three bits. - OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); - return 0; - } - - ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } - BN_CTX_start(ctx); - t = BN_CTX_get(ctx); - if (!t) { - goto err; - } - -loop: - // make a random number and set the top and bottom bits - if (add == NULL) { - if (!probable_prime(ret, bits)) { - goto err; - } - } else { - if (safe) { - if (!probable_prime_dh_safe(ret, bits, add, rem, ctx)) { - goto err; - } - } else { - if (!probable_prime_dh(ret, bits, add, rem, ctx)) { - goto err; - } - } - } - - if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, c1++)) { - // aborted - goto err; - } - - if (!safe) { - i = BN_is_prime_fasttest_ex(ret, checks, ctx, 0, cb); - if (i == -1) { - goto err; - } else if (i == 0) { - goto loop; - } - } else { - // for "safe prime" generation, check that (p-1)/2 is prime. Since a prime - // is odd, We just need to divide by 2 - if (!BN_rshift1(t, ret)) { - goto err; - } - - for (i = 0; i < checks; i++) { - j = BN_is_prime_fasttest_ex(ret, 1, ctx, 0, NULL); - if (j == -1) { - goto err; - } else if (j == 0) { - goto loop; - } - - j = BN_is_prime_fasttest_ex(t, 1, ctx, 0, NULL); - if (j == -1) { - goto err; - } else if (j == 0) { - goto loop; - } - - if (!BN_GENCB_call(cb, i, c1 - 1)) { - goto err; - } - // We have a safe prime test pass - } - } - - // we have a prime :-) - found = 1; - -err: - if (ctx != NULL) { - BN_CTX_end(ctx); - BN_CTX_free(ctx); - } - - return found; -} - -// The following functions use a Barrett reduction variant to avoid leaking the -// numerator. See http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html -// -// We use 32-bit numerator and 16-bit divisor for simplicity. This allows -// computing |m| and |q| without architecture-specific code. - -// mod_u16 returns |n| mod |d|. |p| and |m| are the "magic numbers" for |d| (see -// reference). For proof of correctness in Coq, see -// https://github.com/davidben/fiat-crypto/blob/barrett/src/Arithmetic/BarrettReduction/RidiculousFish.v -// Note the Coq version of |mod_u16| additionally includes the computation of -// |p| and |m| from |bn_mod_u16_consttime| below. -static uint16_t mod_u16(uint32_t n, uint16_t d, uint32_t p, uint32_t m) { - // Compute floor(n/d) per steps 3 through 5. - uint32_t q = ((uint64_t)m * n) >> 32; - // Note there is a typo in the reference. We right-shift by one, not two. - uint32_t t = ((n - q) >> 1) + q; - t = t >> (p - 1); - - // Multiply and subtract to get the remainder. - n -= d * t; - assert(n < d); - return n; -} - -// shift_and_add_mod_u16 returns |r| * 2^32 + |a| mod |d|. |p| and |m| are the -// "magic numbers" for |d| (see reference). -static uint16_t shift_and_add_mod_u16(uint16_t r, uint32_t a, uint16_t d, - uint32_t p, uint32_t m) { - // Incorporate |a| in two 16-bit chunks. - uint32_t t = r; - t <<= 16; - t |= a >> 16; - t = mod_u16(t, d, p, m); - - t <<= 16; - t |= a & 0xffff; - t = mod_u16(t, d, p, m); - return t; -} - -uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d) { - if (d <= 1) { - return 0; - } - - // Compute the "magic numbers" for |d|. See steps 1 and 2. - // This computes p = ceil(log_2(d)). - uint32_t p = BN_num_bits_word(d - 1); - // This operation is not constant-time, but |p| and |d| are public values. - // Note that |p| is at most 16, so the computation fits in |uint64_t|. - assert(p <= 16); - uint32_t m = ((UINT64_C(1) << (32 + p)) + d - 1) / d; - - uint16_t ret = 0; - for (int i = bn->width - 1; i >= 0; i--) { -#if BN_BITS2 == 32 - ret = shift_and_add_mod_u16(ret, bn->d[i], d, p, m); -#elif BN_BITS2 == 64 - ret = shift_and_add_mod_u16(ret, bn->d[i] >> 32, d, p, m); - ret = shift_and_add_mod_u16(ret, bn->d[i] & 0xffffffff, d, p, m); -#else -#error "Unknown BN_ULONG size" -#endif - } - return ret; -} - -static int bn_trial_division(uint16_t *out, const BIGNUM *bn) { - for (int i = 1; i < NUMPRIMES; i++) { - if (bn_mod_u16_consttime(bn, primes[i]) == 0) { - *out = primes[i]; - return 1; - } - } - return 0; -} - -int bn_odd_number_is_obviously_composite(const BIGNUM *bn) { - uint16_t prime; - return bn_trial_division(&prime, bn) && !BN_is_word(bn, prime); -} - -int BN_primality_test(int *is_probably_prime, const BIGNUM *w, - int iterations, BN_CTX *ctx, int do_trial_division, - BN_GENCB *cb) { - *is_probably_prime = 0; - - // To support RSA key generation, this function should treat |w| as secret if - // it is a large prime. Composite numbers are discarded, so they may return - // early. - - if (BN_cmp(w, BN_value_one()) <= 0) { - return 1; - } - - if (!BN_is_odd(w)) { - // The only even prime is two. - *is_probably_prime = BN_is_word(w, 2); - return 1; - } - - // Miller-Rabin does not work for three. - if (BN_is_word(w, 3)) { - *is_probably_prime = 1; - return 1; - } - - if (do_trial_division) { - // Perform additional trial division checks to discard small primes. - uint16_t prime; - if (bn_trial_division(&prime, w)) { - *is_probably_prime = BN_is_word(w, prime); - return 1; - } - if (!BN_GENCB_call(cb, 1, -1)) { - return 0; - } - } - - if (iterations == BN_prime_checks) { - iterations = BN_prime_checks_for_size(BN_num_bits(w)); - } - - // See C.3.1 from FIPS 186-4. - int ret = 0; - BN_MONT_CTX *mont = NULL; - BN_CTX_start(ctx); - BIGNUM *w1 = BN_CTX_get(ctx); - if (w1 == NULL || - !bn_usub_consttime(w1, w, BN_value_one())) { - goto err; - } - - // Write w1 as m * 2^a (Steps 1 and 2). - int w_len = BN_num_bits(w); - int a = BN_count_low_zero_bits(w1); - BIGNUM *m = BN_CTX_get(ctx); - if (m == NULL || - !bn_rshift_secret_shift(m, w1, a, ctx)) { - goto err; - } - - // Montgomery setup for computations mod w. Additionally, compute 1 and w - 1 - // in the Montgomery domain for later comparisons. - BIGNUM *b = BN_CTX_get(ctx); - BIGNUM *z = BN_CTX_get(ctx); - BIGNUM *one_mont = BN_CTX_get(ctx); - BIGNUM *w1_mont = BN_CTX_get(ctx); - mont = BN_MONT_CTX_new_for_modulus(w, ctx); - if (b == NULL || z == NULL || one_mont == NULL || w1_mont == NULL || - mont == NULL || - !bn_one_to_montgomery(one_mont, mont, ctx) || - // w - 1 is -1 mod w, so we can compute it in the Montgomery domain, -R, - // with a subtraction. (|one_mont| cannot be zero.) - !bn_usub_consttime(w1_mont, w, one_mont)) { - goto err; - } - - // The following loop performs in inner iteration of the Miller-Rabin - // Primality test (Step 4). - // - // The algorithm as specified in FIPS 186-4 leaks information on |w|, the RSA - // private key. Instead, we run through each iteration unconditionally, - // performing modular multiplications, masking off any effects to behave - // equivalently to the specified algorithm. - // - // We also blind the number of values of |b| we try. Steps 4.1–4.2 say to - // discard out-of-range values. To avoid leaking information on |w|, we use - // |bn_rand_secret_range| which, rather than discarding bad values, adjusts - // them to be in range. Though not uniformly selected, these adjusted values - // are still usable as Rabin-Miller checks. - // - // Rabin-Miller is already probabilistic, so we could reach the desired - // confidence levels by just suitably increasing the iteration count. However, - // to align with FIPS 186-4, we use a more pessimal analysis: we do not count - // the non-uniform values towards the iteration count. As a result, this - // function is more complex and has more timing risk than necessary. - // - // We count both total iterations and uniform ones and iterate until we've - // reached at least |BN_PRIME_CHECKS_BLINDED| and |iterations|, respectively. - // If the latter is large enough, it will be the limiting factor with high - // probability and we won't leak information. - // - // Note this blinding does not impact most calls when picking primes because - // composites are rejected early. Only the two secret primes see extra work. - - crypto_word_t uniform_iterations = 0; - // Using |constant_time_lt_w| seems to prevent the compiler from optimizing - // this into two jumps. - for (int i = 1; (i <= BN_PRIME_CHECKS_BLINDED) | - constant_time_lt_w(uniform_iterations, iterations); - i++) { - int is_uniform; - if (// Step 4.1-4.2 - !bn_rand_secret_range(b, &is_uniform, 2, w1) || - // Step 4.3 - !BN_mod_exp_mont_consttime(z, b, m, w, ctx, mont)) { - goto err; - } - uniform_iterations += is_uniform; - - // loop_done is all ones if the loop has completed and all zeros otherwise. - crypto_word_t loop_done = 0; - // next_iteration is all ones if we should continue to the next iteration - // (|b| is not a composite witness for |w|). This is equivalent to going to - // step 4.7 in the original algorithm. - crypto_word_t next_iteration = 0; - - // Step 4.4. If z = 1 or z = w-1, mask off the loop and continue to the next - // iteration (go to step 4.7). - loop_done = BN_equal_consttime(z, BN_value_one()) | - BN_equal_consttime(z, w1); - loop_done = 0 - loop_done; // Make it all zeros or all ones. - next_iteration = loop_done; // Go to step 4.7 if |loop_done|. - - // Step 4.5. We use Montgomery-encoding for better performance and to avoid - // timing leaks. - if (!BN_to_montgomery(z, z, mont, ctx)) { - goto err; - } - - // To avoid leaking |a|, we run the loop to |w_len| and mask off all - // iterations once |j| = |a|. - for (int j = 1; j < w_len; j++) { - loop_done |= constant_time_eq_int(j, a); - - // Step 4.5.1. - if (!BN_mod_mul_montgomery(z, z, z, mont, ctx)) { - goto err; - } - - // Step 4.5.2. If z = w-1 and the loop is not done, run through the next - // iteration. - crypto_word_t z_is_w1_mont = BN_equal_consttime(z, w1_mont) & ~loop_done; - z_is_w1_mont = 0 - z_is_w1_mont; // Make it all zeros or all ones. - loop_done |= z_is_w1_mont; - next_iteration |= z_is_w1_mont; // Go to step 4.7 if |z_is_w1_mont|. - - // Step 4.5.3. If z = 1 and the loop is not done, w is composite and we - // may exit in variable time. - if (BN_equal_consttime(z, one_mont) & ~loop_done) { - assert(!next_iteration); - break; - } - } - - if (!next_iteration) { - // Step 4.6. We did not see z = w-1 before z = 1, so w must be composite. - // (For any prime, the value of z immediately preceding 1 must be -1. - // There are no non-trivial square roots of 1 modulo a prime.) - *is_probably_prime = 0; - ret = 1; - goto err; - } - - // Step 4.7 - if (!BN_GENCB_call(cb, 1, i)) { - goto err; - } - } - - assert(uniform_iterations >= (crypto_word_t)iterations); - *is_probably_prime = 1; - ret = 1; - -err: - BN_MONT_CTX_free(mont); - BN_CTX_end(ctx); - return ret; -} - -int BN_is_prime_ex(const BIGNUM *candidate, int checks, BN_CTX *ctx, BN_GENCB *cb) { - return BN_is_prime_fasttest_ex(candidate, checks, ctx, 0, cb); -} - -int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx, - int do_trial_division, BN_GENCB *cb) { - int is_probably_prime; - if (!BN_primality_test(&is_probably_prime, a, checks, ctx, do_trial_division, - cb)) { - return -1; - } - return is_probably_prime; -} - -int BN_enhanced_miller_rabin_primality_test( - enum bn_primality_result_t *out_result, const BIGNUM *w, int iterations, - BN_CTX *ctx, BN_GENCB *cb) { - // Enhanced Miller-Rabin is only valid on odd integers greater than 3. - if (!BN_is_odd(w) || BN_cmp_word(w, 3) <= 0) { - OPENSSL_PUT_ERROR(BN, BN_R_INVALID_INPUT); - return 0; - } - - if (iterations == BN_prime_checks) { - iterations = BN_prime_checks_for_size(BN_num_bits(w)); - } - - int ret = 0; - BN_MONT_CTX *mont = NULL; - - BN_CTX_start(ctx); - - BIGNUM *w1 = BN_CTX_get(ctx); - if (w1 == NULL || - !BN_copy(w1, w) || - !BN_sub_word(w1, 1)) { - goto err; - } - - // Write w1 as m*2^a (Steps 1 and 2). - int a = 0; - while (!BN_is_bit_set(w1, a)) { - a++; - } - BIGNUM *m = BN_CTX_get(ctx); - if (m == NULL || - !BN_rshift(m, w1, a)) { - goto err; - } - - BIGNUM *b = BN_CTX_get(ctx); - BIGNUM *g = BN_CTX_get(ctx); - BIGNUM *z = BN_CTX_get(ctx); - BIGNUM *x = BN_CTX_get(ctx); - BIGNUM *x1 = BN_CTX_get(ctx); - if (b == NULL || - g == NULL || - z == NULL || - x == NULL || - x1 == NULL) { - goto err; - } - - // Montgomery setup for computations mod w - mont = BN_MONT_CTX_new_for_modulus(w, ctx); - if (mont == NULL) { - goto err; - } - - // The following loop performs in inner iteration of the Enhanced Miller-Rabin - // Primality test (Step 4). - for (int i = 1; i <= iterations; i++) { - // Step 4.1-4.2 - if (!BN_rand_range_ex(b, 2, w1)) { - goto err; - } - - // Step 4.3-4.4 - if (!BN_gcd(g, b, w, ctx)) { - goto err; - } - if (BN_cmp_word(g, 1) > 0) { - *out_result = bn_composite; - ret = 1; - goto err; - } - - // Step 4.5 - if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) { - goto err; - } - - // Step 4.6 - if (BN_is_one(z) || BN_cmp(z, w1) == 0) { - goto loop; - } - - // Step 4.7 - for (int j = 1; j < a; j++) { - if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { - goto err; - } - if (BN_cmp(z, w1) == 0) { - goto loop; - } - if (BN_is_one(z)) { - goto composite; - } - } - - // Step 4.8-4.9 - if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { - goto err; - } - - // Step 4.10-4.11 - if (!BN_is_one(z) && !BN_copy(x, z)) { - goto err; - } - - composite: - // Step 4.12-4.14 - if (!BN_copy(x1, x) || - !BN_sub_word(x1, 1) || - !BN_gcd(g, x1, w, ctx)) { - goto err; - } - if (BN_cmp_word(g, 1) > 0) { - *out_result = bn_composite; - } else { - *out_result = bn_non_prime_power_composite; - } - - ret = 1; - goto err; - - loop: - // Step 4.15 - if (!BN_GENCB_call(cb, 1, i)) { - goto err; - } - } - - *out_result = bn_probably_prime; - ret = 1; - -err: - BN_MONT_CTX_free(mont); - BN_CTX_end(ctx); - - return ret; -} - -static int probable_prime(BIGNUM *rnd, int bits) { - int i; - uint16_t mods[NUMPRIMES]; - BN_ULONG delta; - BN_ULONG maxdelta = BN_MASK2 - primes[NUMPRIMES - 1]; - char is_single_word = bits <= BN_BITS2; - -again: - if (!BN_rand(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD)) { - return 0; - } - - // we now have a random number 'rnd' to test. - for (i = 1; i < NUMPRIMES; i++) { - mods[i] = bn_mod_u16_consttime(rnd, primes[i]); - } - // If bits is so small that it fits into a single word then we - // additionally don't want to exceed that many bits. - if (is_single_word) { - BN_ULONG size_limit; - if (bits == BN_BITS2) { - // Avoid undefined behavior. - size_limit = ~((BN_ULONG)0) - BN_get_word(rnd); - } else { - size_limit = (((BN_ULONG)1) << bits) - BN_get_word(rnd) - 1; - } - if (size_limit < maxdelta) { - maxdelta = size_limit; - } - } - delta = 0; - -loop: - if (is_single_word) { - BN_ULONG rnd_word = BN_get_word(rnd); - - // In the case that the candidate prime is a single word then - // we check that: - // 1) It's greater than primes[i] because we shouldn't reject - // 3 as being a prime number because it's a multiple of - // three. - // 2) That it's not a multiple of a known prime. We don't - // check that rnd-1 is also coprime to all the known - // primes because there aren't many small primes where - // that's true. - for (i = 1; i < NUMPRIMES && primes[i] < rnd_word; i++) { - if ((mods[i] + delta) % primes[i] == 0) { - delta += 2; - if (delta > maxdelta) { - goto again; - } - goto loop; - } - } - } else { - for (i = 1; i < NUMPRIMES; i++) { - // check that rnd is not a prime and also - // that gcd(rnd-1,primes) == 1 (except for 2) - if (((mods[i] + delta) % primes[i]) <= 1) { - delta += 2; - if (delta > maxdelta) { - goto again; - } - goto loop; - } - } - } - - if (!BN_add_word(rnd, delta)) { - return 0; - } - if (BN_num_bits(rnd) != (unsigned)bits) { - goto again; - } - - return 1; -} - -static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, - const BIGNUM *rem, BN_CTX *ctx) { - int i, ret = 0; - BIGNUM *t1; - - BN_CTX_start(ctx); - if ((t1 = BN_CTX_get(ctx)) == NULL) { - goto err; - } - - if (!BN_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { - goto err; - } - - // we need ((rnd-rem) % add) == 0 - - if (!BN_mod(t1, rnd, add, ctx)) { - goto err; - } - if (!BN_sub(rnd, rnd, t1)) { - goto err; - } - if (rem == NULL) { - if (!BN_add_word(rnd, 1)) { - goto err; - } - } else { - if (!BN_add(rnd, rnd, rem)) { - goto err; - } - } - // we now have a random number 'rand' to test. - -loop: - for (i = 1; i < NUMPRIMES; i++) { - // check that rnd is a prime - if (bn_mod_u16_consttime(rnd, primes[i]) <= 1) { - if (!BN_add(rnd, rnd, add)) { - goto err; - } - goto loop; - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} - -static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd, - const BIGNUM *rem, BN_CTX *ctx) { - int i, ret = 0; - BIGNUM *t1, *qadd, *q; - - bits--; - BN_CTX_start(ctx); - t1 = BN_CTX_get(ctx); - q = BN_CTX_get(ctx); - qadd = BN_CTX_get(ctx); - if (qadd == NULL) { - goto err; - } - - if (!BN_rshift1(qadd, padd)) { - goto err; - } - - if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { - goto err; - } - - // we need ((rnd-rem) % add) == 0 - if (!BN_mod(t1, q, qadd, ctx)) { - goto err; - } - - if (!BN_sub(q, q, t1)) { - goto err; - } - - if (rem == NULL) { - if (!BN_add_word(q, 1)) { - goto err; - } - } else { - if (!BN_rshift1(t1, rem)) { - goto err; - } - if (!BN_add(q, q, t1)) { - goto err; - } - } - - // we now have a random number 'rand' to test. - if (!BN_lshift1(p, q)) { - goto err; - } - if (!BN_add_word(p, 1)) { - goto err; - } - -loop: - for (i = 1; i < NUMPRIMES; i++) { - // check that p and q are prime - // check that for p and q - // gcd(p-1,primes) == 1 (except for 2) - if (bn_mod_u16_consttime(p, primes[i]) == 0 || - bn_mod_u16_consttime(q, primes[i]) == 0) { - if (!BN_add(p, p, padd)) { - goto err; - } - if (!BN_add(q, q, qadd)) { - goto err; - } - goto loop; - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.h deleted file mode 100644 index 49c5fc0ef..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2012, Intel Corporation. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - * - * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) - * (1) Intel Corporation, Israel Development Center, Haifa, Israel - * (2) University of Haifa, Israel - */ - -#ifndef OPENSSL_HEADER_BN_RSAZ_EXP_H -#define OPENSSL_HEADER_BN_RSAZ_EXP_H - -#include - -// RSAZ_1024_mod_exp_avx2 sets |result| to |base_norm| raised to |exponent| -// modulo |m_norm|. |base_norm| must be fully-reduced and |exponent| must have -// the high bit set (it is 1024 bits wide). |RR| and |k0| must be |RR| and |n0|, -// respectively, extracted from |m_norm|'s |BN_MONT_CTX|. -void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], const BN_ULONG base_norm[16], - const BN_ULONG exponent[16], - const BN_ULONG m_norm[16], const BN_ULONG RR[16], - BN_ULONG k0); - -// rsaz_avx2_eligible returns one if |RSAZ_1024_mod_exp_avx2| should be used and -// zero otherwise. -int rsaz_avx2_eligible(void); - -#endif // OPENSSL_HEADER_BN_RSAZ_EXP_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back deleted file mode 100644 index af973a5c7..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2012, Intel Corporation. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - * - * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) - * (1) Intel Corporation, Israel Development Center, Haifa, Israel - * (2) University of Haifa, Israel - */ - -#ifndef OPENSSL_HEADER_BN_RSAZ_EXP_H -#define OPENSSL_HEADER_BN_RSAZ_EXP_H - -#include - -// RSAZ_1024_mod_exp_avx2 sets |result| to |base_norm| raised to |exponent| -// modulo |m_norm|. |base_norm| must be fully-reduced and |exponent| must have -// the high bit set (it is 1024 bits wide). |RR| and |k0| must be |RR| and |n0|, -// respectively, extracted from |m_norm|'s |BN_MONT_CTX|. -void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], const BN_ULONG base_norm[16], - const BN_ULONG exponent[16], - const BN_ULONG m_norm[16], const BN_ULONG RR[16], - BN_ULONG k0); - -// rsaz_avx2_eligible returns one if |RSAZ_1024_mod_exp_avx2| should be used and -// zero otherwise. -int rsaz_avx2_eligible(void); - -#endif // OPENSSL_HEADER_BN_RSAZ_EXP_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_aes.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_aes.c deleted file mode 100644 index 553078853..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_aes.c +++ /dev/null @@ -1,1437 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../../internal.h" -#include "../aes/internal.h" -#include "../modes/internal.h" -#include "../delocate.h" - -#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) -#include -#endif - - -OPENSSL_MSVC_PRAGMA(warning(disable: 4702)) // Unreachable code. - -typedef struct { - union { - double align; - AES_KEY ks; - } ks; - block128_f block; - union { - cbc128_f cbc; - ctr128_f ctr; - } stream; -} EVP_AES_KEY; - -typedef struct { - union { - double align; - AES_KEY ks; - } ks; // AES key schedule to use - int key_set; // Set if key initialised - int iv_set; // Set if an iv is set - GCM128_CONTEXT gcm; - uint8_t *iv; // Temporary IV store - int ivlen; // IV length - int taglen; - int iv_gen; // It is OK to generate IVs - ctr128_f ctr; -} EVP_AES_GCM_CTX; - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -#define VPAES -static char vpaes_capable(void) { - return (OPENSSL_ia32cap_P[1] & (1 << (41 - 32))) != 0; -} - -#if defined(OPENSSL_X86_64) -#define BSAES -static char bsaes_capable(void) { - return vpaes_capable(); -} -#endif - -#elif !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) - -#if defined(OPENSSL_ARM) && __ARM_MAX_ARCH__ >= 7 -#define BSAES -static char bsaes_capable(void) { - return CRYPTO_is_NEON_capable(); -} -#endif - -#endif - - -#if defined(BSAES) -// On platforms where BSAES gets defined (just above), then these functions are -// provided by asm. -void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t ivec[16], int enc); -void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, const uint8_t ivec[16]); -#else -static char bsaes_capable(void) { - return 0; -} - -// On other platforms, bsaes_capable() will always return false and so the -// following will never be called. -static void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t ivec[16], int enc) { - abort(); -} - -static void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, - size_t len, const AES_KEY *key, - const uint8_t ivec[16]) { - abort(); -} -#endif - -#if defined(VPAES) -// On platforms where VPAES gets defined (just above), then these functions are -// provided by asm. -int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); -int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); - -void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); - -void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc); -#else -static char vpaes_capable(void) { - return 0; -} - -// On other platforms, vpaes_capable() will always return false and so the -// following will never be called. -static int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, - AES_KEY *key) { - abort(); -} -static int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, - AES_KEY *key) { - abort(); -} -static void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - abort(); -} -static void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - abort(); -} -static void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc) { - abort(); -} -#endif - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -int aesni_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); -int aesni_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); - -void aesni_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void aesni_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); - -void aesni_ecb_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, int enc); -void aesni_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc); - -#else - -// On other platforms, aesni_capable() will always return false and so the -// following will never be called. -static void aesni_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - abort(); -} -static int aesni_set_encrypt_key(const uint8_t *userKey, int bits, - AES_KEY *key) { - abort(); -} -static void aesni_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, - size_t blocks, const void *key, - const uint8_t *ivec) { - abort(); -} - -#endif - -static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - int ret, mode; - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - mode = ctx->cipher->flags & EVP_CIPH_MODE_MASK; - if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) { - if (hwaes_capable()) { - ret = aes_hw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)aes_hw_decrypt; - dat->stream.cbc = NULL; - if (mode == EVP_CIPH_CBC_MODE) { - dat->stream.cbc = (cbc128_f)aes_hw_cbc_encrypt; - } - } else if (bsaes_capable() && mode == EVP_CIPH_CBC_MODE) { - ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_decrypt; - dat->stream.cbc = (cbc128_f)bsaes_cbc_encrypt; - } else if (vpaes_capable()) { - ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)vpaes_decrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)vpaes_cbc_encrypt : NULL; - } else { - ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_decrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)AES_cbc_encrypt : NULL; - } - } else if (hwaes_capable()) { - ret = aes_hw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)aes_hw_encrypt; - dat->stream.cbc = NULL; - if (mode == EVP_CIPH_CBC_MODE) { - dat->stream.cbc = (cbc128_f)aes_hw_cbc_encrypt; - } else if (mode == EVP_CIPH_CTR_MODE) { - dat->stream.ctr = (ctr128_f)aes_hw_ctr32_encrypt_blocks; - } - } else if (bsaes_capable() && mode == EVP_CIPH_CTR_MODE) { - ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_encrypt; - dat->stream.ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; - } else if (vpaes_capable()) { - ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)vpaes_encrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)vpaes_cbc_encrypt : NULL; - } else { - ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_encrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)AES_cbc_encrypt : NULL; - } - - if (ret < 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_AES_KEY_SETUP_FAILED); - return 0; - } - - return 1; -} - -static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - if (dat->stream.cbc) { - (*dat->stream.cbc)(in, out, len, &dat->ks, ctx->iv, ctx->encrypt); - } else if (ctx->encrypt) { - CRYPTO_cbc128_encrypt(in, out, len, &dat->ks, ctx->iv, dat->block); - } else { - CRYPTO_cbc128_decrypt(in, out, len, &dat->ks, ctx->iv, dat->block); - } - - return 1; -} - -static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - size_t bl = ctx->cipher->block_size; - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - if (len < bl) { - return 1; - } - - len -= bl; - for (size_t i = 0; i <= len; i += bl) { - (*dat->block)(in + i, out + i, &dat->ks); - } - - return 1; -} - -static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - if (dat->stream.ctr) { - CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks, ctx->iv, ctx->buf, - &ctx->num, dat->stream.ctr); - } else { - CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, ctx->buf, &ctx->num, - dat->block); - } - return 1; -} - -static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - CRYPTO_ofb128_encrypt(in, out, len, &dat->ks, ctx->iv, &ctx->num, dat->block); - return 1; -} - -static char aesni_capable(void); - -ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_CONTEXT *gcm_ctx, - block128_f *out_block, const uint8_t *key, - size_t key_bytes) { - if (aesni_capable()) { - aesni_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)aesni_encrypt, 1); - } - if (out_block) { - *out_block = (block128_f) aesni_encrypt; - } - return (ctr128_f)aesni_ctr32_encrypt_blocks; - } - - if (hwaes_capable()) { - aes_hw_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)aes_hw_encrypt, 0); - } - if (out_block) { - *out_block = (block128_f) aes_hw_encrypt; - } - return (ctr128_f)aes_hw_ctr32_encrypt_blocks; - } - - if (bsaes_capable()) { - AES_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)AES_encrypt, 0); - } - if (out_block) { - *out_block = (block128_f) AES_encrypt; - } - return (ctr128_f)bsaes_ctr32_encrypt_blocks; - } - - if (vpaes_capable()) { - vpaes_set_encrypt_key(key, key_bytes * 8, aes_key); - if (out_block) { - *out_block = (block128_f) vpaes_encrypt; - } - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)vpaes_encrypt, 0); - } - return NULL; - } - - AES_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)AES_encrypt, 0); - } - if (out_block) { - *out_block = (block128_f) AES_encrypt; - } - return NULL; -} - -static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - EVP_AES_GCM_CTX *gctx = ctx->cipher_data; - if (!iv && !key) { - return 1; - } - if (key) { - gctx->ctr = - aes_ctr_set_key(&gctx->ks.ks, &gctx->gcm, NULL, key, ctx->key_len); - // If we have an iv can set it directly, otherwise use saved IV. - if (iv == NULL && gctx->iv_set) { - iv = gctx->iv; - } - if (iv) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - gctx->iv_set = 1; - } - gctx->key_set = 1; - } else { - // If key set use IV, otherwise copy - if (gctx->key_set) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - } else { - OPENSSL_memcpy(gctx->iv, iv, gctx->ivlen); - } - gctx->iv_set = 1; - gctx->iv_gen = 0; - } - return 1; -} - -static void aes_gcm_cleanup(EVP_CIPHER_CTX *c) { - EVP_AES_GCM_CTX *gctx = c->cipher_data; - OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm)); - if (gctx->iv != c->iv) { - OPENSSL_free(gctx->iv); - } -} - -// increment counter (64-bit int) by 1 -static void ctr64_inc(uint8_t *counter) { - int n = 8; - uint8_t c; - - do { - --n; - c = counter[n]; - ++c; - counter[n] = c; - if (c) { - return; - } - } while (n); -} - -static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { - EVP_AES_GCM_CTX *gctx = c->cipher_data; - switch (type) { - case EVP_CTRL_INIT: - gctx->key_set = 0; - gctx->iv_set = 0; - gctx->ivlen = c->cipher->iv_len; - gctx->iv = c->iv; - gctx->taglen = -1; - gctx->iv_gen = 0; - return 1; - - case EVP_CTRL_GCM_SET_IVLEN: - if (arg <= 0) { - return 0; - } - - // Allocate memory for IV if needed - if (arg > EVP_MAX_IV_LENGTH && arg > gctx->ivlen) { - if (gctx->iv != c->iv) { - OPENSSL_free(gctx->iv); - } - gctx->iv = OPENSSL_malloc(arg); - if (!gctx->iv) { - return 0; - } - } - gctx->ivlen = arg; - return 1; - - case EVP_CTRL_GCM_SET_TAG: - if (arg <= 0 || arg > 16 || c->encrypt) { - return 0; - } - OPENSSL_memcpy(c->buf, ptr, arg); - gctx->taglen = arg; - return 1; - - case EVP_CTRL_GCM_GET_TAG: - if (arg <= 0 || arg > 16 || !c->encrypt || gctx->taglen < 0) { - return 0; - } - OPENSSL_memcpy(ptr, c->buf, arg); - return 1; - - case EVP_CTRL_GCM_SET_IV_FIXED: - // Special case: -1 length restores whole IV - if (arg == -1) { - OPENSSL_memcpy(gctx->iv, ptr, gctx->ivlen); - gctx->iv_gen = 1; - return 1; - } - // Fixed field must be at least 4 bytes and invocation field - // at least 8. - if (arg < 4 || (gctx->ivlen - arg) < 8) { - return 0; - } - if (arg) { - OPENSSL_memcpy(gctx->iv, ptr, arg); - } - if (c->encrypt && !RAND_bytes(gctx->iv + arg, gctx->ivlen - arg)) { - return 0; - } - gctx->iv_gen = 1; - return 1; - - case EVP_CTRL_GCM_IV_GEN: - if (gctx->iv_gen == 0 || gctx->key_set == 0) { - return 0; - } - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); - if (arg <= 0 || arg > gctx->ivlen) { - arg = gctx->ivlen; - } - OPENSSL_memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); - // Invocation field will be at least 8 bytes in size and - // so no need to check wrap around or increment more than - // last 8 bytes. - ctr64_inc(gctx->iv + gctx->ivlen - 8); - gctx->iv_set = 1; - return 1; - - case EVP_CTRL_GCM_SET_IV_INV: - if (gctx->iv_gen == 0 || gctx->key_set == 0 || c->encrypt) { - return 0; - } - OPENSSL_memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); - gctx->iv_set = 1; - return 1; - - case EVP_CTRL_COPY: { - EVP_CIPHER_CTX *out = ptr; - EVP_AES_GCM_CTX *gctx_out = out->cipher_data; - if (gctx->iv == c->iv) { - gctx_out->iv = out->iv; - } else { - gctx_out->iv = OPENSSL_malloc(gctx->ivlen); - if (!gctx_out->iv) { - return 0; - } - OPENSSL_memcpy(gctx_out->iv, gctx->iv, gctx->ivlen); - } - return 1; - } - - default: - return -1; - } -} - -static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_GCM_CTX *gctx = ctx->cipher_data; - - // If not set up, return error - if (!gctx->key_set) { - return -1; - } - if (!gctx->iv_set) { - return -1; - } - - if (in) { - if (out == NULL) { - if (!CRYPTO_gcm128_aad(&gctx->gcm, in, len)) { - return -1; - } - } else if (ctx->encrypt) { - if (gctx->ctr) { - if (!CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, - gctx->ctr)) { - return -1; - } - } else { - if (!CRYPTO_gcm128_encrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { - return -1; - } - } - } else { - if (gctx->ctr) { - if (!CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, - gctx->ctr)) { - return -1; - } - } else { - if (!CRYPTO_gcm128_decrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { - return -1; - } - } - } - return len; - } else { - if (!ctx->encrypt) { - if (gctx->taglen < 0 || - !CRYPTO_gcm128_finish(&gctx->gcm, ctx->buf, gctx->taglen)) { - return -1; - } - gctx->iv_set = 0; - return 0; - } - CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, 16); - gctx->taglen = 16; - // Don't reuse the IV - gctx->iv_set = 0; - return 0; - } -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_cbc_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_cbc; - out->block_size = 16; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aes_init_key; - out->cipher = aes_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ctr_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ctr; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aes_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ecb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ecb; - out->block_size = 16; - out->key_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aes_init_key; - out->cipher = aes_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ofb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ofb128; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aes_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_gcm_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_gcm; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aes_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_cbc_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_cbc; - out->block_size = 16; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aes_init_key; - out->cipher = aes_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ctr_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ctr; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aes_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ecb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ecb; - out->block_size = 16; - out->key_len = 24; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aes_init_key; - out->cipher = aes_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_gcm_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_gcm; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aes_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_cbc_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_cbc; - out->block_size = 16; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aes_init_key; - out->cipher = aes_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ctr_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ctr; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aes_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ecb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ecb; - out->block_size = 16; - out->key_len = 32; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aes_init_key; - out->cipher = aes_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ofb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ofb128; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aes_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_gcm_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_gcm; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aes_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) - -// AES-NI section. - -static char aesni_capable(void) { - return (OPENSSL_ia32cap_P[1] & (1 << (57 - 32))) != 0; -} - -static int aesni_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - int ret, mode; - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - mode = ctx->cipher->flags & EVP_CIPH_MODE_MASK; - if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) { - ret = aesni_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data); - dat->block = (block128_f)aesni_decrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)aesni_cbc_encrypt : NULL; - } else { - ret = aesni_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data); - dat->block = (block128_f)aesni_encrypt; - if (mode == EVP_CIPH_CBC_MODE) { - dat->stream.cbc = (cbc128_f)aesni_cbc_encrypt; - } else if (mode == EVP_CIPH_CTR_MODE) { - dat->stream.ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; - } else { - dat->stream.cbc = NULL; - } - } - - if (ret < 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_AES_KEY_SETUP_FAILED); - return 0; - } - - return 1; -} - -static int aesni_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, - const uint8_t *in, size_t len) { - aesni_cbc_encrypt(in, out, len, ctx->cipher_data, ctx->iv, ctx->encrypt); - - return 1; -} - -static int aesni_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, - const uint8_t *in, size_t len) { - size_t bl = ctx->cipher->block_size; - - if (len < bl) { - return 1; - } - - aesni_ecb_encrypt(in, out, len, ctx->cipher_data, ctx->encrypt); - - return 1; -} - -static int aesni_gcm_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - EVP_AES_GCM_CTX *gctx = ctx->cipher_data; - if (!iv && !key) { - return 1; - } - if (key) { - aesni_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks); - CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)aesni_encrypt, 1); - gctx->ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; - // If we have an iv can set it directly, otherwise use - // saved IV. - if (iv == NULL && gctx->iv_set) { - iv = gctx->iv; - } - if (iv) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - gctx->iv_set = 1; - } - gctx->key_set = 1; - } else { - // If key set use IV, otherwise copy - if (gctx->key_set) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - } else { - OPENSSL_memcpy(gctx->iv, iv, gctx->ivlen); - } - gctx->iv_set = 1; - gctx->iv_gen = 0; - } - return 1; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_cbc) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_cbc; - out->block_size = 16; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aesni_init_key; - out->cipher = aesni_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_ctr) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ctr; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aesni_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_ecb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ecb; - out->block_size = 16; - out->key_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aesni_init_key; - out->cipher = aesni_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_ofb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ofb128; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aesni_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_gcm) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_gcm; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aesni_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_cbc) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_cbc; - out->block_size = 16; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aesni_init_key; - out->cipher = aesni_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_ctr) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ctr; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aesni_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_ecb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ecb; - out->block_size = 16; - out->key_len = 24; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aesni_init_key; - out->cipher = aesni_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_gcm) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_gcm; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aesni_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_cbc) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_cbc; - out->block_size = 16; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aesni_init_key; - out->cipher = aesni_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_ctr) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ctr; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aesni_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_ecb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ecb; - out->block_size = 16; - out->key_len = 32; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aesni_init_key; - out->cipher = aesni_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_ofb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ofb128; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aesni_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_gcm) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_gcm; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_CUSTOM_COPY | - EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aesni_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -#define EVP_CIPHER_FUNCTION(keybits, mode) \ - const EVP_CIPHER *EVP_aes_##keybits##_##mode(void) { \ - if (aesni_capable()) { \ - return aesni_##keybits##_##mode(); \ - } else { \ - return aes_##keybits##_##mode##_generic(); \ - } \ - } - -#else // ^^^ OPENSSL_X86_64 || OPENSSL_X86 - -static char aesni_capable(void) { - return 0; -} - -#define EVP_CIPHER_FUNCTION(keybits, mode) \ - const EVP_CIPHER *EVP_aes_##keybits##_##mode(void) { \ - return aes_##keybits##_##mode##_generic(); \ - } - -#endif - -EVP_CIPHER_FUNCTION(128, cbc) -EVP_CIPHER_FUNCTION(128, ctr) -EVP_CIPHER_FUNCTION(128, ecb) -EVP_CIPHER_FUNCTION(128, ofb) -EVP_CIPHER_FUNCTION(128, gcm) - -EVP_CIPHER_FUNCTION(192, cbc) -EVP_CIPHER_FUNCTION(192, ctr) -EVP_CIPHER_FUNCTION(192, ecb) -EVP_CIPHER_FUNCTION(192, gcm) - -EVP_CIPHER_FUNCTION(256, cbc) -EVP_CIPHER_FUNCTION(256, ctr) -EVP_CIPHER_FUNCTION(256, ecb) -EVP_CIPHER_FUNCTION(256, ofb) -EVP_CIPHER_FUNCTION(256, gcm) - - -#define EVP_AEAD_AES_GCM_TAG_LEN 16 - -struct aead_aes_gcm_ctx { - union { - double align; - AES_KEY ks; - } ks; - GCM128_CONTEXT gcm; - ctr128_f ctr; -}; - -struct aead_aes_gcm_tls12_ctx { - struct aead_aes_gcm_ctx gcm_ctx; - uint64_t min_next_nonce; -}; - -static int aead_aes_gcm_init_impl(struct aead_aes_gcm_ctx *gcm_ctx, - size_t *out_tag_len, const uint8_t *key, - size_t key_len, size_t tag_len) { - const size_t key_bits = key_len * 8; - - if (key_bits != 128 && key_bits != 256) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); - return 0; // EVP_AEAD_CTX_init should catch this. - } - - if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { - tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - } - - if (tag_len > EVP_AEAD_AES_GCM_TAG_LEN) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); - return 0; - } - - gcm_ctx->ctr = - aes_ctr_set_key(&gcm_ctx->ks.ks, &gcm_ctx->gcm, NULL, key, key_len); - *out_tag_len = tag_len; - return 1; -} - -static int aead_aes_gcm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t requested_tag_len) { - struct aead_aes_gcm_ctx *gcm_ctx; - gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_ctx)); - if (gcm_ctx == NULL) { - return 0; - } - - size_t actual_tag_len; - if (!aead_aes_gcm_init_impl(gcm_ctx, &actual_tag_len, key, key_len, - requested_tag_len)) { - OPENSSL_free(gcm_ctx); - return 0; - } - - ctx->aead_state = gcm_ctx; - ctx->tag_len = actual_tag_len; - return 1; -} - -static void aead_aes_gcm_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static int aead_aes_gcm_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, - uint8_t *out_tag, size_t *out_tag_len, - size_t max_out_tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *extra_in, - size_t extra_in_len, - const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state; - GCM128_CONTEXT gcm; - - if (extra_in_len + ctx->tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - if (max_out_tag_len < extra_in_len + ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - if (nonce_len == 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - const AES_KEY *key = &gcm_ctx->ks.ks; - - OPENSSL_memcpy(&gcm, &gcm_ctx->gcm, sizeof(gcm)); - CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); - - if (ad_len > 0 && !CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { - return 0; - } - - if (gcm_ctx->ctr) { - if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, in, out, in_len, - gcm_ctx->ctr)) { - return 0; - } - } else { - if (!CRYPTO_gcm128_encrypt(&gcm, key, in, out, in_len)) { - return 0; - } - } - - if (extra_in_len) { - if (gcm_ctx->ctr) { - if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, extra_in, out_tag, - extra_in_len, gcm_ctx->ctr)) { - return 0; - } - } else { - if (!CRYPTO_gcm128_encrypt(&gcm, key, extra_in, out_tag, extra_in_len)) { - return 0; - } - } - } - - CRYPTO_gcm128_tag(&gcm, out_tag + extra_in_len, ctx->tag_len); - *out_tag_len = ctx->tag_len + extra_in_len; - - return 1; -} - -static int aead_aes_gcm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *in_tag, size_t in_tag_len, - const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state; - uint8_t tag[EVP_AEAD_AES_GCM_TAG_LEN]; - GCM128_CONTEXT gcm; - - if (nonce_len == 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - if (in_tag_len != ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - const AES_KEY *key = &gcm_ctx->ks.ks; - - OPENSSL_memcpy(&gcm, &gcm_ctx->gcm, sizeof(gcm)); - CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); - - if (!CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { - return 0; - } - - if (gcm_ctx->ctr) { - if (!CRYPTO_gcm128_decrypt_ctr32(&gcm, key, in, out, in_len, - gcm_ctx->ctr)) { - return 0; - } - } else { - if (!CRYPTO_gcm128_decrypt(&gcm, key, in, out, in_len)) { - return 0; - } - } - - CRYPTO_gcm128_tag(&gcm, tag, ctx->tag_len); - if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - return 1; -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 16; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_init; - out->cleanup = aead_aes_gcm_cleanup; - out->seal_scatter = aead_aes_gcm_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 32; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_init; - out->cleanup = aead_aes_gcm_cleanup; - out->seal_scatter = aead_aes_gcm_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -static int aead_aes_gcm_tls12_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t requested_tag_len) { - struct aead_aes_gcm_tls12_ctx *gcm_ctx; - gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_tls12_ctx)); - if (gcm_ctx == NULL) { - return 0; - } - - gcm_ctx->min_next_nonce = 0; - - size_t actual_tag_len; - if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len, - requested_tag_len)) { - OPENSSL_free(gcm_ctx); - return 0; - } - - ctx->aead_state = gcm_ctx; - ctx->tag_len = actual_tag_len; - return 1; -} - -static void aead_aes_gcm_tls12_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static int aead_aes_gcm_tls12_seal_scatter( - const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - struct aead_aes_gcm_tls12_ctx *gcm_ctx = ctx->aead_state; - if (nonce_len != 12) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); - return 0; - } - - // The given nonces must be strictly monotonically increasing. - uint64_t given_counter; - OPENSSL_memcpy(&given_counter, nonce + nonce_len - sizeof(given_counter), - sizeof(given_counter)); - given_counter = CRYPTO_bswap8(given_counter); - if (given_counter == UINT64_MAX || - given_counter < gcm_ctx->min_next_nonce) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE); - return 0; - } - - gcm_ctx->min_next_nonce = given_counter + 1; - - return aead_aes_gcm_seal_scatter(ctx, out, out_tag, out_tag_len, - max_out_tag_len, nonce, nonce_len, in, - in_len, extra_in, extra_in_len, ad, ad_len); -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm_tls12) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 16; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_tls12_init; - out->cleanup = aead_aes_gcm_tls12_cleanup; - out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm_tls12) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 32; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_tls12_init; - out->cleanup = aead_aes_gcm_tls12_cleanup; - out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -int EVP_has_aes_hardware(void) { -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) - return aesni_capable() && crypto_gcm_clmul_enabled(); -#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) - return hwaes_capable() && CRYPTO_is_ARMv8_PMULL_capable(); -#else - return 0; -#endif -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_aes.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_aes.c.grpc_back deleted file mode 100644 index 8377f0c1d..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_aes.c.grpc_back +++ /dev/null @@ -1,1437 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../../internal.h" -#include "../aes/internal.h" -#include "../modes/internal.h" -#include "../delocate.h" - -#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) -#include -#endif - - -OPENSSL_MSVC_PRAGMA(warning(disable: 4702)) // Unreachable code. - -typedef struct { - union { - double align; - AES_KEY ks; - } ks; - block128_f block; - union { - cbc128_f cbc; - ctr128_f ctr; - } stream; -} EVP_AES_KEY; - -typedef struct { - union { - double align; - AES_KEY ks; - } ks; // AES key schedule to use - int key_set; // Set if key initialised - int iv_set; // Set if an iv is set - GCM128_CONTEXT gcm; - uint8_t *iv; // Temporary IV store - int ivlen; // IV length - int taglen; - int iv_gen; // It is OK to generate IVs - ctr128_f ctr; -} EVP_AES_GCM_CTX; - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -#define VPAES -static char vpaes_capable(void) { - return (OPENSSL_ia32cap_P[1] & (1 << (41 - 32))) != 0; -} - -#if defined(OPENSSL_X86_64) -#define BSAES -static char bsaes_capable(void) { - return vpaes_capable(); -} -#endif - -#elif !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) - -#if defined(OPENSSL_ARM) && __ARM_MAX_ARCH__ >= 7 -#define BSAES -static char bsaes_capable(void) { - return CRYPTO_is_NEON_capable(); -} -#endif - -#endif - - -#if defined(BSAES) -// On platforms where BSAES gets defined (just above), then these functions are -// provided by asm. -void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t ivec[16], int enc); -void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, const uint8_t ivec[16]); -#else -static char bsaes_capable(void) { - return 0; -} - -// On other platforms, bsaes_capable() will always return false and so the -// following will never be called. -static void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t ivec[16], int enc) { - abort(); -} - -static void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, - size_t len, const AES_KEY *key, - const uint8_t ivec[16]) { - abort(); -} -#endif - -#if defined(VPAES) -// On platforms where VPAES gets defined (just above), then these functions are -// provided by asm. -int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); -int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); - -void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); - -void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc); -#else -static char vpaes_capable(void) { - return 0; -} - -// On other platforms, vpaes_capable() will always return false and so the -// following will never be called. -static int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, - AES_KEY *key) { - abort(); -} -static int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, - AES_KEY *key) { - abort(); -} -static void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - abort(); -} -static void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - abort(); -} -static void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc) { - abort(); -} -#endif - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -int aesni_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); -int aesni_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); - -void aesni_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); -void aesni_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); - -void aesni_ecb_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, int enc); -void aesni_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, - const AES_KEY *key, uint8_t *ivec, int enc); - -#else - -// On other platforms, aesni_capable() will always return false and so the -// following will never be called. -static void aesni_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { - abort(); -} -static int aesni_set_encrypt_key(const uint8_t *userKey, int bits, - AES_KEY *key) { - abort(); -} -static void aesni_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, - size_t blocks, const void *key, - const uint8_t *ivec) { - abort(); -} - -#endif - -static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - int ret, mode; - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - mode = ctx->cipher->flags & EVP_CIPH_MODE_MASK; - if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) { - if (hwaes_capable()) { - ret = aes_hw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)aes_hw_decrypt; - dat->stream.cbc = NULL; - if (mode == EVP_CIPH_CBC_MODE) { - dat->stream.cbc = (cbc128_f)aes_hw_cbc_encrypt; - } - } else if (bsaes_capable() && mode == EVP_CIPH_CBC_MODE) { - ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_decrypt; - dat->stream.cbc = (cbc128_f)bsaes_cbc_encrypt; - } else if (vpaes_capable()) { - ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)vpaes_decrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)vpaes_cbc_encrypt : NULL; - } else { - ret = AES_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_decrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)AES_cbc_encrypt : NULL; - } - } else if (hwaes_capable()) { - ret = aes_hw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)aes_hw_encrypt; - dat->stream.cbc = NULL; - if (mode == EVP_CIPH_CBC_MODE) { - dat->stream.cbc = (cbc128_f)aes_hw_cbc_encrypt; - } else if (mode == EVP_CIPH_CTR_MODE) { - dat->stream.ctr = (ctr128_f)aes_hw_ctr32_encrypt_blocks; - } - } else if (bsaes_capable() && mode == EVP_CIPH_CTR_MODE) { - ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_encrypt; - dat->stream.ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; - } else if (vpaes_capable()) { - ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)vpaes_encrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)vpaes_cbc_encrypt : NULL; - } else { - ret = AES_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); - dat->block = (block128_f)AES_encrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)AES_cbc_encrypt : NULL; - } - - if (ret < 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_AES_KEY_SETUP_FAILED); - return 0; - } - - return 1; -} - -static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - if (dat->stream.cbc) { - (*dat->stream.cbc)(in, out, len, &dat->ks, ctx->iv, ctx->encrypt); - } else if (ctx->encrypt) { - CRYPTO_cbc128_encrypt(in, out, len, &dat->ks, ctx->iv, dat->block); - } else { - CRYPTO_cbc128_decrypt(in, out, len, &dat->ks, ctx->iv, dat->block); - } - - return 1; -} - -static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - size_t bl = ctx->cipher->block_size; - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - if (len < bl) { - return 1; - } - - len -= bl; - for (size_t i = 0; i <= len; i += bl) { - (*dat->block)(in + i, out + i, &dat->ks); - } - - return 1; -} - -static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - if (dat->stream.ctr) { - CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks, ctx->iv, ctx->buf, - &ctx->num, dat->stream.ctr); - } else { - CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, ctx->buf, &ctx->num, - dat->block); - } - return 1; -} - -static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - CRYPTO_ofb128_encrypt(in, out, len, &dat->ks, ctx->iv, &ctx->num, dat->block); - return 1; -} - -static char aesni_capable(void); - -ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_CONTEXT *gcm_ctx, - block128_f *out_block, const uint8_t *key, - size_t key_bytes) { - if (aesni_capable()) { - aesni_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)aesni_encrypt, 1); - } - if (out_block) { - *out_block = (block128_f) aesni_encrypt; - } - return (ctr128_f)aesni_ctr32_encrypt_blocks; - } - - if (hwaes_capable()) { - aes_hw_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)aes_hw_encrypt, 0); - } - if (out_block) { - *out_block = (block128_f) aes_hw_encrypt; - } - return (ctr128_f)aes_hw_ctr32_encrypt_blocks; - } - - if (bsaes_capable()) { - AES_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)AES_encrypt, 0); - } - if (out_block) { - *out_block = (block128_f) AES_encrypt; - } - return (ctr128_f)bsaes_ctr32_encrypt_blocks; - } - - if (vpaes_capable()) { - vpaes_set_encrypt_key(key, key_bytes * 8, aes_key); - if (out_block) { - *out_block = (block128_f) vpaes_encrypt; - } - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)vpaes_encrypt, 0); - } - return NULL; - } - - AES_set_encrypt_key(key, key_bytes * 8, aes_key); - if (gcm_ctx != NULL) { - CRYPTO_gcm128_init(gcm_ctx, aes_key, (block128_f)AES_encrypt, 0); - } - if (out_block) { - *out_block = (block128_f) AES_encrypt; - } - return NULL; -} - -static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - EVP_AES_GCM_CTX *gctx = ctx->cipher_data; - if (!iv && !key) { - return 1; - } - if (key) { - gctx->ctr = - aes_ctr_set_key(&gctx->ks.ks, &gctx->gcm, NULL, key, ctx->key_len); - // If we have an iv can set it directly, otherwise use saved IV. - if (iv == NULL && gctx->iv_set) { - iv = gctx->iv; - } - if (iv) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - gctx->iv_set = 1; - } - gctx->key_set = 1; - } else { - // If key set use IV, otherwise copy - if (gctx->key_set) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - } else { - OPENSSL_memcpy(gctx->iv, iv, gctx->ivlen); - } - gctx->iv_set = 1; - gctx->iv_gen = 0; - } - return 1; -} - -static void aes_gcm_cleanup(EVP_CIPHER_CTX *c) { - EVP_AES_GCM_CTX *gctx = c->cipher_data; - OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm)); - if (gctx->iv != c->iv) { - OPENSSL_free(gctx->iv); - } -} - -// increment counter (64-bit int) by 1 -static void ctr64_inc(uint8_t *counter) { - int n = 8; - uint8_t c; - - do { - --n; - c = counter[n]; - ++c; - counter[n] = c; - if (c) { - return; - } - } while (n); -} - -static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { - EVP_AES_GCM_CTX *gctx = c->cipher_data; - switch (type) { - case EVP_CTRL_INIT: - gctx->key_set = 0; - gctx->iv_set = 0; - gctx->ivlen = c->cipher->iv_len; - gctx->iv = c->iv; - gctx->taglen = -1; - gctx->iv_gen = 0; - return 1; - - case EVP_CTRL_GCM_SET_IVLEN: - if (arg <= 0) { - return 0; - } - - // Allocate memory for IV if needed - if (arg > EVP_MAX_IV_LENGTH && arg > gctx->ivlen) { - if (gctx->iv != c->iv) { - OPENSSL_free(gctx->iv); - } - gctx->iv = OPENSSL_malloc(arg); - if (!gctx->iv) { - return 0; - } - } - gctx->ivlen = arg; - return 1; - - case EVP_CTRL_GCM_SET_TAG: - if (arg <= 0 || arg > 16 || c->encrypt) { - return 0; - } - OPENSSL_memcpy(c->buf, ptr, arg); - gctx->taglen = arg; - return 1; - - case EVP_CTRL_GCM_GET_TAG: - if (arg <= 0 || arg > 16 || !c->encrypt || gctx->taglen < 0) { - return 0; - } - OPENSSL_memcpy(ptr, c->buf, arg); - return 1; - - case EVP_CTRL_GCM_SET_IV_FIXED: - // Special case: -1 length restores whole IV - if (arg == -1) { - OPENSSL_memcpy(gctx->iv, ptr, gctx->ivlen); - gctx->iv_gen = 1; - return 1; - } - // Fixed field must be at least 4 bytes and invocation field - // at least 8. - if (arg < 4 || (gctx->ivlen - arg) < 8) { - return 0; - } - if (arg) { - OPENSSL_memcpy(gctx->iv, ptr, arg); - } - if (c->encrypt && !RAND_bytes(gctx->iv + arg, gctx->ivlen - arg)) { - return 0; - } - gctx->iv_gen = 1; - return 1; - - case EVP_CTRL_GCM_IV_GEN: - if (gctx->iv_gen == 0 || gctx->key_set == 0) { - return 0; - } - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); - if (arg <= 0 || arg > gctx->ivlen) { - arg = gctx->ivlen; - } - OPENSSL_memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); - // Invocation field will be at least 8 bytes in size and - // so no need to check wrap around or increment more than - // last 8 bytes. - ctr64_inc(gctx->iv + gctx->ivlen - 8); - gctx->iv_set = 1; - return 1; - - case EVP_CTRL_GCM_SET_IV_INV: - if (gctx->iv_gen == 0 || gctx->key_set == 0 || c->encrypt) { - return 0; - } - OPENSSL_memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); - gctx->iv_set = 1; - return 1; - - case EVP_CTRL_COPY: { - EVP_CIPHER_CTX *out = ptr; - EVP_AES_GCM_CTX *gctx_out = out->cipher_data; - if (gctx->iv == c->iv) { - gctx_out->iv = out->iv; - } else { - gctx_out->iv = OPENSSL_malloc(gctx->ivlen); - if (!gctx_out->iv) { - return 0; - } - OPENSSL_memcpy(gctx_out->iv, gctx->iv, gctx->ivlen); - } - return 1; - } - - default: - return -1; - } -} - -static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, - size_t len) { - EVP_AES_GCM_CTX *gctx = ctx->cipher_data; - - // If not set up, return error - if (!gctx->key_set) { - return -1; - } - if (!gctx->iv_set) { - return -1; - } - - if (in) { - if (out == NULL) { - if (!CRYPTO_gcm128_aad(&gctx->gcm, in, len)) { - return -1; - } - } else if (ctx->encrypt) { - if (gctx->ctr) { - if (!CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, - gctx->ctr)) { - return -1; - } - } else { - if (!CRYPTO_gcm128_encrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { - return -1; - } - } - } else { - if (gctx->ctr) { - if (!CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, - gctx->ctr)) { - return -1; - } - } else { - if (!CRYPTO_gcm128_decrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { - return -1; - } - } - } - return len; - } else { - if (!ctx->encrypt) { - if (gctx->taglen < 0 || - !CRYPTO_gcm128_finish(&gctx->gcm, ctx->buf, gctx->taglen)) { - return -1; - } - gctx->iv_set = 0; - return 0; - } - CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, 16); - gctx->taglen = 16; - // Don't reuse the IV - gctx->iv_set = 0; - return 0; - } -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_cbc_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_cbc; - out->block_size = 16; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aes_init_key; - out->cipher = aes_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ctr_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ctr; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aes_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ecb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ecb; - out->block_size = 16; - out->key_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aes_init_key; - out->cipher = aes_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ofb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ofb128; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aes_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_gcm_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_gcm; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aes_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_cbc_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_cbc; - out->block_size = 16; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aes_init_key; - out->cipher = aes_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ctr_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ctr; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aes_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ecb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ecb; - out->block_size = 16; - out->key_len = 24; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aes_init_key; - out->cipher = aes_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_gcm_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_gcm; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aes_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_cbc_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_cbc; - out->block_size = 16; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aes_init_key; - out->cipher = aes_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ctr_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ctr; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aes_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ecb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ecb; - out->block_size = 16; - out->key_len = 32; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aes_init_key; - out->cipher = aes_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ofb_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ofb128; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aes_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_gcm_generic) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_gcm; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aes_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) - -// AES-NI section. - -static char aesni_capable(void) { - return (OPENSSL_ia32cap_P[1] & (1 << (57 - 32))) != 0; -} - -static int aesni_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - int ret, mode; - EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; - - mode = ctx->cipher->flags & EVP_CIPH_MODE_MASK; - if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) { - ret = aesni_set_decrypt_key(key, ctx->key_len * 8, ctx->cipher_data); - dat->block = (block128_f)aesni_decrypt; - dat->stream.cbc = - mode == EVP_CIPH_CBC_MODE ? (cbc128_f)aesni_cbc_encrypt : NULL; - } else { - ret = aesni_set_encrypt_key(key, ctx->key_len * 8, ctx->cipher_data); - dat->block = (block128_f)aesni_encrypt; - if (mode == EVP_CIPH_CBC_MODE) { - dat->stream.cbc = (cbc128_f)aesni_cbc_encrypt; - } else if (mode == EVP_CIPH_CTR_MODE) { - dat->stream.ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; - } else { - dat->stream.cbc = NULL; - } - } - - if (ret < 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_AES_KEY_SETUP_FAILED); - return 0; - } - - return 1; -} - -static int aesni_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, - const uint8_t *in, size_t len) { - aesni_cbc_encrypt(in, out, len, ctx->cipher_data, ctx->iv, ctx->encrypt); - - return 1; -} - -static int aesni_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, - const uint8_t *in, size_t len) { - size_t bl = ctx->cipher->block_size; - - if (len < bl) { - return 1; - } - - aesni_ecb_encrypt(in, out, len, ctx->cipher_data, ctx->encrypt); - - return 1; -} - -static int aesni_gcm_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { - EVP_AES_GCM_CTX *gctx = ctx->cipher_data; - if (!iv && !key) { - return 1; - } - if (key) { - aesni_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks); - CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f)aesni_encrypt, 1); - gctx->ctr = (ctr128_f)aesni_ctr32_encrypt_blocks; - // If we have an iv can set it directly, otherwise use - // saved IV. - if (iv == NULL && gctx->iv_set) { - iv = gctx->iv; - } - if (iv) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - gctx->iv_set = 1; - } - gctx->key_set = 1; - } else { - // If key set use IV, otherwise copy - if (gctx->key_set) { - CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); - } else { - OPENSSL_memcpy(gctx->iv, iv, gctx->ivlen); - } - gctx->iv_set = 1; - gctx->iv_gen = 0; - } - return 1; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_cbc) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_cbc; - out->block_size = 16; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aesni_init_key; - out->cipher = aesni_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_ctr) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ctr; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aesni_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_ecb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ecb; - out->block_size = 16; - out->key_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aesni_init_key; - out->cipher = aesni_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_ofb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_ofb128; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aesni_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_128_gcm) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_128_gcm; - out->block_size = 1; - out->key_len = 16; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aesni_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_cbc) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_cbc; - out->block_size = 16; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aesni_init_key; - out->cipher = aesni_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_ctr) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ctr; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aesni_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_ecb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_ecb; - out->block_size = 16; - out->key_len = 24; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aesni_init_key; - out->cipher = aesni_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_192_gcm) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_192_gcm; - out->block_size = 1; - out->key_len = 24; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aesni_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_cbc) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_cbc; - out->block_size = 16; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CBC_MODE; - out->init = aesni_init_key; - out->cipher = aesni_cbc_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_ctr) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ctr; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_CTR_MODE; - out->init = aesni_init_key; - out->cipher = aes_ctr_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_ecb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ecb; - out->block_size = 16; - out->key_len = 32; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_ECB_MODE; - out->init = aesni_init_key; - out->cipher = aesni_ecb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_ofb) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_ofb128; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 16; - out->ctx_size = sizeof(EVP_AES_KEY); - out->flags = EVP_CIPH_OFB_MODE; - out->init = aesni_init_key; - out->cipher = aes_ofb_cipher; -} - -DEFINE_LOCAL_DATA(EVP_CIPHER, aesni_256_gcm) { - memset(out, 0, sizeof(EVP_CIPHER)); - - out->nid = NID_aes_256_gcm; - out->block_size = 1; - out->key_len = 32; - out->iv_len = 12; - out->ctx_size = sizeof(EVP_AES_GCM_CTX); - out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | - EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | - EVP_CIPH_CTRL_INIT | EVP_CIPH_CUSTOM_COPY | - EVP_CIPH_FLAG_AEAD_CIPHER; - out->init = aesni_gcm_init_key; - out->cipher = aes_gcm_cipher; - out->cleanup = aes_gcm_cleanup; - out->ctrl = aes_gcm_ctrl; -} - -#define EVP_CIPHER_FUNCTION(keybits, mode) \ - const EVP_CIPHER *EVP_aes_##keybits##_##mode(void) { \ - if (aesni_capable()) { \ - return aesni_##keybits##_##mode(); \ - } else { \ - return aes_##keybits##_##mode##_generic(); \ - } \ - } - -#else // ^^^ OPENSSL_X86_64 || OPENSSL_X86 - -static char aesni_capable(void) { - return 0; -} - -#define EVP_CIPHER_FUNCTION(keybits, mode) \ - const EVP_CIPHER *EVP_aes_##keybits##_##mode(void) { \ - return aes_##keybits##_##mode##_generic(); \ - } - -#endif - -EVP_CIPHER_FUNCTION(128, cbc) -EVP_CIPHER_FUNCTION(128, ctr) -EVP_CIPHER_FUNCTION(128, ecb) -EVP_CIPHER_FUNCTION(128, ofb) -EVP_CIPHER_FUNCTION(128, gcm) - -EVP_CIPHER_FUNCTION(192, cbc) -EVP_CIPHER_FUNCTION(192, ctr) -EVP_CIPHER_FUNCTION(192, ecb) -EVP_CIPHER_FUNCTION(192, gcm) - -EVP_CIPHER_FUNCTION(256, cbc) -EVP_CIPHER_FUNCTION(256, ctr) -EVP_CIPHER_FUNCTION(256, ecb) -EVP_CIPHER_FUNCTION(256, ofb) -EVP_CIPHER_FUNCTION(256, gcm) - - -#define EVP_AEAD_AES_GCM_TAG_LEN 16 - -struct aead_aes_gcm_ctx { - union { - double align; - AES_KEY ks; - } ks; - GCM128_CONTEXT gcm; - ctr128_f ctr; -}; - -struct aead_aes_gcm_tls12_ctx { - struct aead_aes_gcm_ctx gcm_ctx; - uint64_t min_next_nonce; -}; - -static int aead_aes_gcm_init_impl(struct aead_aes_gcm_ctx *gcm_ctx, - size_t *out_tag_len, const uint8_t *key, - size_t key_len, size_t tag_len) { - const size_t key_bits = key_len * 8; - - if (key_bits != 128 && key_bits != 256) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); - return 0; // EVP_AEAD_CTX_init should catch this. - } - - if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { - tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - } - - if (tag_len > EVP_AEAD_AES_GCM_TAG_LEN) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); - return 0; - } - - gcm_ctx->ctr = - aes_ctr_set_key(&gcm_ctx->ks.ks, &gcm_ctx->gcm, NULL, key, key_len); - *out_tag_len = tag_len; - return 1; -} - -static int aead_aes_gcm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t requested_tag_len) { - struct aead_aes_gcm_ctx *gcm_ctx; - gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_ctx)); - if (gcm_ctx == NULL) { - return 0; - } - - size_t actual_tag_len; - if (!aead_aes_gcm_init_impl(gcm_ctx, &actual_tag_len, key, key_len, - requested_tag_len)) { - OPENSSL_free(gcm_ctx); - return 0; - } - - ctx->aead_state = gcm_ctx; - ctx->tag_len = actual_tag_len; - return 1; -} - -static void aead_aes_gcm_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static int aead_aes_gcm_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, - uint8_t *out_tag, size_t *out_tag_len, - size_t max_out_tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *extra_in, - size_t extra_in_len, - const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state; - GCM128_CONTEXT gcm; - - if (extra_in_len + ctx->tag_len < ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); - return 0; - } - if (max_out_tag_len < extra_in_len + ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); - return 0; - } - if (nonce_len == 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - const AES_KEY *key = &gcm_ctx->ks.ks; - - OPENSSL_memcpy(&gcm, &gcm_ctx->gcm, sizeof(gcm)); - CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); - - if (ad_len > 0 && !CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { - return 0; - } - - if (gcm_ctx->ctr) { - if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, in, out, in_len, - gcm_ctx->ctr)) { - return 0; - } - } else { - if (!CRYPTO_gcm128_encrypt(&gcm, key, in, out, in_len)) { - return 0; - } - } - - if (extra_in_len) { - if (gcm_ctx->ctr) { - if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, extra_in, out_tag, - extra_in_len, gcm_ctx->ctr)) { - return 0; - } - } else { - if (!CRYPTO_gcm128_encrypt(&gcm, key, extra_in, out_tag, extra_in_len)) { - return 0; - } - } - } - - CRYPTO_gcm128_tag(&gcm, out_tag + extra_in_len, ctx->tag_len); - *out_tag_len = ctx->tag_len + extra_in_len; - - return 1; -} - -static int aead_aes_gcm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, - const uint8_t *in_tag, size_t in_tag_len, - const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_ctx *gcm_ctx = ctx->aead_state; - uint8_t tag[EVP_AEAD_AES_GCM_TAG_LEN]; - GCM128_CONTEXT gcm; - - if (nonce_len == 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); - return 0; - } - - if (in_tag_len != ctx->tag_len) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - const AES_KEY *key = &gcm_ctx->ks.ks; - - OPENSSL_memcpy(&gcm, &gcm_ctx->gcm, sizeof(gcm)); - CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); - - if (!CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { - return 0; - } - - if (gcm_ctx->ctr) { - if (!CRYPTO_gcm128_decrypt_ctr32(&gcm, key, in, out, in_len, - gcm_ctx->ctr)) { - return 0; - } - } else { - if (!CRYPTO_gcm128_decrypt(&gcm, key, in, out, in_len)) { - return 0; - } - } - - CRYPTO_gcm128_tag(&gcm, tag, ctx->tag_len); - if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); - return 0; - } - - return 1; -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 16; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_init; - out->cleanup = aead_aes_gcm_cleanup; - out->seal_scatter = aead_aes_gcm_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 32; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_init; - out->cleanup = aead_aes_gcm_cleanup; - out->seal_scatter = aead_aes_gcm_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -static int aead_aes_gcm_tls12_init(EVP_AEAD_CTX *ctx, const uint8_t *key, - size_t key_len, size_t requested_tag_len) { - struct aead_aes_gcm_tls12_ctx *gcm_ctx; - gcm_ctx = OPENSSL_malloc(sizeof(struct aead_aes_gcm_tls12_ctx)); - if (gcm_ctx == NULL) { - return 0; - } - - gcm_ctx->min_next_nonce = 0; - - size_t actual_tag_len; - if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len, - requested_tag_len)) { - OPENSSL_free(gcm_ctx); - return 0; - } - - ctx->aead_state = gcm_ctx; - ctx->tag_len = actual_tag_len; - return 1; -} - -static void aead_aes_gcm_tls12_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} - -static int aead_aes_gcm_tls12_seal_scatter( - const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, - size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - struct aead_aes_gcm_tls12_ctx *gcm_ctx = ctx->aead_state; - if (nonce_len != 12) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); - return 0; - } - - // The given nonces must be strictly monotonically increasing. - uint64_t given_counter; - OPENSSL_memcpy(&given_counter, nonce + nonce_len - sizeof(given_counter), - sizeof(given_counter)); - given_counter = CRYPTO_bswap8(given_counter); - if (given_counter == UINT64_MAX || - given_counter < gcm_ctx->min_next_nonce) { - OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE); - return 0; - } - - gcm_ctx->min_next_nonce = given_counter + 1; - - return aead_aes_gcm_seal_scatter(ctx, out, out_tag, out_tag_len, - max_out_tag_len, nonce, nonce_len, in, - in_len, extra_in, extra_in_len, ad, ad_len); -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm_tls12) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 16; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_tls12_init; - out->cleanup = aead_aes_gcm_tls12_cleanup; - out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm_tls12) { - memset(out, 0, sizeof(EVP_AEAD)); - - out->key_len = 32; - out->nonce_len = 12; - out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; - out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; - out->seal_scatter_supports_extra_in = 1; - - out->init = aead_aes_gcm_tls12_init; - out->cleanup = aead_aes_gcm_tls12_cleanup; - out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; - out->open_gather = aead_aes_gcm_open_gather; -} - -int EVP_has_aes_hardware(void) { -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) - return aesni_capable() && crypto_gcm_clmul_enabled(); -#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) - return hwaes_capable() && CRYPTO_is_ARMv8_PMULL_capable(); -#else - return 0; -#endif -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/internal.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/internal.h deleted file mode 100644 index 806f5b535..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/internal.h +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_CIPHER_INTERNAL_H -#define OPENSSL_HEADER_CIPHER_INTERNAL_H - -#include - -#include -#include - -#include "../../internal.h" -#include "../modes/internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -// EVP_CIPH_MODE_MASK contains the bits of |flags| that represent the mode. -#define EVP_CIPH_MODE_MASK 0x3f - -// EVP_AEAD represents a specific AEAD algorithm. -struct evp_aead_st { - uint8_t key_len; - uint8_t nonce_len; - uint8_t overhead; - uint8_t max_tag_len; - int seal_scatter_supports_extra_in; - - // init initialises an |EVP_AEAD_CTX|. If this call returns zero then - // |cleanup| will not be called for that context. - int (*init)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, - size_t tag_len); - int (*init_with_direction)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, - size_t tag_len, enum evp_aead_direction_t dir); - void (*cleanup)(EVP_AEAD_CTX *); - - int (*open)(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, - size_t max_out_len, const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, const uint8_t *ad, - size_t ad_len); - - int (*seal_scatter)(const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, - const uint8_t *nonce, size_t nonce_len, const uint8_t *in, - size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len); - - int (*open_gather)(const EVP_AEAD_CTX *ctx, uint8_t *out, - const uint8_t *nonce, size_t nonce_len, const uint8_t *in, - size_t in_len, const uint8_t *in_tag, size_t in_tag_len, - const uint8_t *ad, size_t ad_len); - - int (*get_iv)(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, - size_t *out_len); - - size_t (*tag_len)(const EVP_AEAD_CTX *ctx, size_t in_Len, - size_t extra_in_len); -}; - -// aes_ctr_set_key initialises |*aes_key| using |key_bytes| bytes from |key|, -// where |key_bytes| must either be 16, 24 or 32. If not NULL, |*out_block| is -// set to a function that encrypts single blocks. If not NULL, |*gcm_ctx| is -// initialised to do GHASH with the given key. It returns a function for -// optimised CTR-mode, or NULL if CTR-mode should be built using -// |*out_block|. -ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_CONTEXT *gcm_ctx, - block128_f *out_block, const uint8_t *key, - size_t key_bytes); - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CIPHER_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/internal.h.grpc_back deleted file mode 100644 index 7b5f23f0c..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/internal.h.grpc_back +++ /dev/null @@ -1,129 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_CIPHER_INTERNAL_H -#define OPENSSL_HEADER_CIPHER_INTERNAL_H - -#include - -#include -#include - -#include "../../internal.h" -#include "../modes/internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -// EVP_CIPH_MODE_MASK contains the bits of |flags| that represent the mode. -#define EVP_CIPH_MODE_MASK 0x3f - -// EVP_AEAD represents a specific AEAD algorithm. -struct evp_aead_st { - uint8_t key_len; - uint8_t nonce_len; - uint8_t overhead; - uint8_t max_tag_len; - int seal_scatter_supports_extra_in; - - // init initialises an |EVP_AEAD_CTX|. If this call returns zero then - // |cleanup| will not be called for that context. - int (*init)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, - size_t tag_len); - int (*init_with_direction)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, - size_t tag_len, enum evp_aead_direction_t dir); - void (*cleanup)(EVP_AEAD_CTX *); - - int (*open)(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, - size_t max_out_len, const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t in_len, const uint8_t *ad, - size_t ad_len); - - int (*seal_scatter)(const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, - size_t *out_tag_len, size_t max_out_tag_len, - const uint8_t *nonce, size_t nonce_len, const uint8_t *in, - size_t in_len, const uint8_t *extra_in, - size_t extra_in_len, const uint8_t *ad, size_t ad_len); - - int (*open_gather)(const EVP_AEAD_CTX *ctx, uint8_t *out, - const uint8_t *nonce, size_t nonce_len, const uint8_t *in, - size_t in_len, const uint8_t *in_tag, size_t in_tag_len, - const uint8_t *ad, size_t ad_len); - - int (*get_iv)(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, - size_t *out_len); - - size_t (*tag_len)(const EVP_AEAD_CTX *ctx, size_t in_Len, - size_t extra_in_len); -}; - -// aes_ctr_set_key initialises |*aes_key| using |key_bytes| bytes from |key|, -// where |key_bytes| must either be 16, 24 or 32. If not NULL, |*out_block| is -// set to a function that encrypts single blocks. If not NULL, |*gcm_ctx| is -// initialised to do GHASH with the given key. It returns a function for -// optimised CTR-mode, or NULL if CTR-mode should be built using -// |*out_block|. -ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_CONTEXT *gcm_ctx, - block128_f *out_block, const uint8_t *key, - size_t key_bytes); - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CIPHER_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_montgomery.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_montgomery.c deleted file mode 100644 index aaa1d9fe5..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_montgomery.c +++ /dev/null @@ -1,270 +0,0 @@ -/* Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#include - -#include -#include -#include - -#include "../bn/internal.h" -#include "../delocate.h" -#include "internal.h" - - -int ec_GFp_mont_group_init(EC_GROUP *group) { - int ok; - - ok = ec_GFp_simple_group_init(group); - group->mont = NULL; - return ok; -} - -void ec_GFp_mont_group_finish(EC_GROUP *group) { - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - ec_GFp_simple_group_finish(group); -} - -int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, - const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - int ret = 0; - - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - group->mont = BN_MONT_CTX_new_for_modulus(p, ctx); - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - goto err; - } - - ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); - - if (!ret) { - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - } - -err: - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_mod_mul_montgomery(r, a, b, group->mont, ctx); -} - -int ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_mod_mul_montgomery(r, a, a, group->mont, ctx); -} - -int ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_to_montgomery(r, a, group->mont, ctx); -} - -int ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_from_montgomery(r, a, group->mont, ctx); -} - -static int ec_GFp_mont_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, - BN_CTX *ctx) { - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } - - BN_CTX *new_ctx = NULL; - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - int ret = 0; - - BN_CTX_start(ctx); - - if (BN_cmp(&point->Z, &group->one) == 0) { - // |point| is already affine. - if (x != NULL && !BN_from_montgomery(x, &point->X, group->mont, ctx)) { - goto err; - } - if (y != NULL && !BN_from_montgomery(y, &point->Y, group->mont, ctx)) { - goto err; - } - } else { - // transform (X, Y, Z) into (x, y) := (X/Z^2, Y/Z^3) - - BIGNUM *Z_1 = BN_CTX_get(ctx); - BIGNUM *Z_2 = BN_CTX_get(ctx); - BIGNUM *Z_3 = BN_CTX_get(ctx); - if (Z_1 == NULL || - Z_2 == NULL || - Z_3 == NULL) { - goto err; - } - - // The straightforward way to calculate the inverse of a Montgomery-encoded - // value where the result is Montgomery-encoded is: - // - // |BN_from_montgomery| + invert + |BN_to_montgomery|. - // - // This is equivalent, but more efficient, because |BN_from_montgomery| - // is more efficient (at least in theory) than |BN_to_montgomery|, since it - // doesn't have to do the multiplication before the reduction. - // - // Use Fermat's Little Theorem instead of |BN_mod_inverse_odd| since this - // inversion may be done as the final step of private key operations. - // Unfortunately, this is suboptimal for ECDSA verification. - if (!BN_from_montgomery(Z_1, &point->Z, group->mont, ctx) || - !BN_from_montgomery(Z_1, Z_1, group->mont, ctx) || - !bn_mod_inverse_prime(Z_1, Z_1, &group->field, ctx, group->mont)) { - goto err; - } - - if (!BN_mod_mul_montgomery(Z_2, Z_1, Z_1, group->mont, ctx)) { - goto err; - } - - // Instead of using |BN_from_montgomery| to convert the |x| coordinate - // and then calling |BN_from_montgomery| again to convert the |y| - // coordinate below, convert the common factor |Z_2| once now, saving one - // reduction. - if (!BN_from_montgomery(Z_2, Z_2, group->mont, ctx)) { - goto err; - } - - if (x != NULL) { - if (!BN_mod_mul_montgomery(x, &point->X, Z_2, group->mont, ctx)) { - goto err; - } - } - - if (y != NULL) { - if (!BN_mod_mul_montgomery(Z_3, Z_2, Z_1, group->mont, ctx) || - !BN_mod_mul_montgomery(y, &point->Y, Z_3, group->mont, ctx)) { - goto err; - } - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_mont_method) { - out->group_init = ec_GFp_mont_group_init; - out->group_finish = ec_GFp_mont_group_finish; - out->group_set_curve = ec_GFp_mont_group_set_curve; - out->point_get_affine_coordinates = ec_GFp_mont_point_get_affine_coordinates; - out->mul = ec_wNAF_mul /* XXX: Not constant time. */; - out->mul_public = ec_wNAF_mul; - out->field_mul = ec_GFp_mont_field_mul; - out->field_sqr = ec_GFp_mont_field_sqr; - out->field_encode = ec_GFp_mont_field_encode; - out->field_decode = ec_GFp_mont_field_decode; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back deleted file mode 100644 index 165c06f19..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back +++ /dev/null @@ -1,270 +0,0 @@ -/* Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#include - -#include -#include -#include - -#include "../bn/internal.h" -#include "../delocate.h" -#include "internal.h" - - -int ec_GFp_mont_group_init(EC_GROUP *group) { - int ok; - - ok = ec_GFp_simple_group_init(group); - group->mont = NULL; - return ok; -} - -void ec_GFp_mont_group_finish(EC_GROUP *group) { - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - ec_GFp_simple_group_finish(group); -} - -int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, - const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - int ret = 0; - - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - group->mont = BN_MONT_CTX_new_for_modulus(p, ctx); - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - goto err; - } - - ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); - - if (!ret) { - BN_MONT_CTX_free(group->mont); - group->mont = NULL; - } - -err: - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_mont_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_mod_mul_montgomery(r, a, b, group->mont, ctx); -} - -int ec_GFp_mont_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_mod_mul_montgomery(r, a, a, group->mont, ctx); -} - -int ec_GFp_mont_field_encode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_to_montgomery(r, a, group->mont, ctx); -} - -int ec_GFp_mont_field_decode(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - if (group->mont == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); - return 0; - } - - return BN_from_montgomery(r, a, group->mont, ctx); -} - -static int ec_GFp_mont_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, - BN_CTX *ctx) { - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } - - BN_CTX *new_ctx = NULL; - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - int ret = 0; - - BN_CTX_start(ctx); - - if (BN_cmp(&point->Z, &group->one) == 0) { - // |point| is already affine. - if (x != NULL && !BN_from_montgomery(x, &point->X, group->mont, ctx)) { - goto err; - } - if (y != NULL && !BN_from_montgomery(y, &point->Y, group->mont, ctx)) { - goto err; - } - } else { - // transform (X, Y, Z) into (x, y) := (X/Z^2, Y/Z^3) - - BIGNUM *Z_1 = BN_CTX_get(ctx); - BIGNUM *Z_2 = BN_CTX_get(ctx); - BIGNUM *Z_3 = BN_CTX_get(ctx); - if (Z_1 == NULL || - Z_2 == NULL || - Z_3 == NULL) { - goto err; - } - - // The straightforward way to calculate the inverse of a Montgomery-encoded - // value where the result is Montgomery-encoded is: - // - // |BN_from_montgomery| + invert + |BN_to_montgomery|. - // - // This is equivalent, but more efficient, because |BN_from_montgomery| - // is more efficient (at least in theory) than |BN_to_montgomery|, since it - // doesn't have to do the multiplication before the reduction. - // - // Use Fermat's Little Theorem instead of |BN_mod_inverse_odd| since this - // inversion may be done as the final step of private key operations. - // Unfortunately, this is suboptimal for ECDSA verification. - if (!BN_from_montgomery(Z_1, &point->Z, group->mont, ctx) || - !BN_from_montgomery(Z_1, Z_1, group->mont, ctx) || - !bn_mod_inverse_prime(Z_1, Z_1, &group->field, ctx, group->mont)) { - goto err; - } - - if (!BN_mod_mul_montgomery(Z_2, Z_1, Z_1, group->mont, ctx)) { - goto err; - } - - // Instead of using |BN_from_montgomery| to convert the |x| coordinate - // and then calling |BN_from_montgomery| again to convert the |y| - // coordinate below, convert the common factor |Z_2| once now, saving one - // reduction. - if (!BN_from_montgomery(Z_2, Z_2, group->mont, ctx)) { - goto err; - } - - if (x != NULL) { - if (!BN_mod_mul_montgomery(x, &point->X, Z_2, group->mont, ctx)) { - goto err; - } - } - - if (y != NULL) { - if (!BN_mod_mul_montgomery(Z_3, Z_2, Z_1, group->mont, ctx) || - !BN_mod_mul_montgomery(y, &point->Y, Z_3, group->mont, ctx)) { - goto err; - } - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_mont_method) { - out->group_init = ec_GFp_mont_group_init; - out->group_finish = ec_GFp_mont_group_finish; - out->group_set_curve = ec_GFp_mont_group_set_curve; - out->point_get_affine_coordinates = ec_GFp_mont_point_get_affine_coordinates; - out->mul = ec_wNAF_mul /* XXX: Not constant time. */; - out->mul_public = ec_wNAF_mul; - out->field_mul = ec_GFp_mont_field_mul; - out->field_sqr = ec_GFp_mont_field_sqr; - out->field_encode = ec_GFp_mont_field_encode; - out->field_decode = ec_GFp_mont_field_decode; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/internal.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/internal.h deleted file mode 100644 index cbd43cccc..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/internal.h +++ /dev/null @@ -1,337 +0,0 @@ -/* Originally written by Bodo Moeller for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#ifndef OPENSSL_HEADER_EC_INTERNAL_H -#define OPENSSL_HEADER_EC_INTERNAL_H - -#include - -#include -#include -#include -#include - -#include "../bn/internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -// Cap the size of all field elements and scalars, including custom curves, to -// 66 bytes, large enough to fit secp521r1 and brainpoolP512r1, which appear to -// be the largest fields anyone plausibly uses. -#define EC_MAX_SCALAR_BYTES 66 -#define EC_MAX_SCALAR_WORDS ((66 + BN_BYTES - 1) / BN_BYTES) - -OPENSSL_COMPILE_ASSERT(EC_MAX_SCALAR_WORDS <= BN_SMALL_MAX_WORDS, - bn_small_functions_applicable); - -// An EC_SCALAR is an integer fully reduced modulo the order. Only the first -// |order->width| words are used. An |EC_SCALAR| is specific to an |EC_GROUP| -// and must not be mixed between groups. -typedef union { - // bytes is the representation of the scalar in little-endian order. - uint8_t bytes[EC_MAX_SCALAR_BYTES]; - BN_ULONG words[EC_MAX_SCALAR_WORDS]; -} EC_SCALAR; - -struct ec_method_st { - int (*group_init)(EC_GROUP *); - void (*group_finish)(EC_GROUP *); - int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); - int (*point_get_affine_coordinates)(const EC_GROUP *, const EC_POINT *, - BIGNUM *x, BIGNUM *y, BN_CTX *); - - // Computes |r = g_scalar*generator + p_scalar*p| if |g_scalar| and |p_scalar| - // are both non-null. Computes |r = g_scalar*generator| if |p_scalar| is null. - // Computes |r = p_scalar*p| if g_scalar is null. At least one of |g_scalar| - // and |p_scalar| must be non-null, and |p| must be non-null if |p_scalar| is - // non-null. - int (*mul)(const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx); - // mul_public performs the same computation as mul. It further assumes that - // the inputs are public so there is no concern about leaking their values - // through timing. - int (*mul_public)(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx); - - // 'field_mul' and 'field_sqr' can be used by 'add' and 'dbl' so that the - // same implementations of point operations can be used with different - // optimized implementations of expensive field operations: - int (*field_mul)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); - - int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); // e.g. to Montgomery - int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); // e.g. from Montgomery -} /* EC_METHOD */; - -const EC_METHOD *EC_GFp_mont_method(void); - -struct ec_group_st { - const EC_METHOD *meth; - - // Unlike all other |EC_POINT|s, |generator| does not own |generator->group| - // to avoid a reference cycle. - EC_POINT *generator; - BIGNUM order; - - int curve_name; // optional NID for named curve - - BN_MONT_CTX *order_mont; // data for ECDSA inverse - - // The following members are handled by the method functions, - // even if they appear generic - - BIGNUM field; // For curves over GF(p), this is the modulus. - - BIGNUM a, b; // Curve coefficients. - - int a_is_minus3; // enable optimized point arithmetics for special case - - CRYPTO_refcount_t references; - - BN_MONT_CTX *mont; // Montgomery structure. - - BIGNUM one; // The value one. -} /* EC_GROUP */; - -struct ec_point_st { - // group is an owning reference to |group|, unless this is - // |group->generator|. - EC_GROUP *group; - - BIGNUM X; - BIGNUM Y; - BIGNUM Z; // Jacobian projective coordinates: - // (X, Y, Z) represents (X/Z^2, Y/Z^3) if Z != 0 -} /* EC_POINT */; - -EC_GROUP *ec_group_new(const EC_METHOD *meth); - -// ec_bignum_to_scalar converts |in| to an |EC_SCALAR| and writes it to -// |*out|. It returns one on success and zero if |in| is out of range. -OPENSSL_EXPORT int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in); - -// ec_bignum_to_scalar_unchecked behaves like |ec_bignum_to_scalar| but does not -// check |in| is fully reduced. -int ec_bignum_to_scalar_unchecked(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in); - -// ec_random_nonzero_scalar sets |out| to a uniformly selected random value from -// 1 to |group->order| - 1. It returns one on success and zero on error. -int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, - const uint8_t additional_data[32]); - -// ec_point_mul_scalar sets |r| to generator * |g_scalar| + |p| * -// |p_scalar|. Unlike other functions which take |EC_SCALAR|, |g_scalar| and -// |p_scalar| need not be fully reduced. They need only contain as many bits as -// the order. -int ec_point_mul_scalar(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx); - -// ec_point_mul_scalar_public performs the same computation as -// ec_point_mul_scalar. It further assumes that the inputs are public so -// there is no concern about leaking their values through timing. -OPENSSL_EXPORT int ec_point_mul_scalar_public( - const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx); - -// ec_compute_wNAF writes the modified width-(w+1) Non-Adjacent Form (wNAF) of -// |scalar| to |out| and returns one on success or zero on internal error. |out| -// must have room for |bits| + 1 elements, each of which will be either zero or -// odd with an absolute value less than 2^w satisfying -// scalar = \sum_j out[j]*2^j -// where at most one of any w+1 consecutive digits is non-zero -// with the exception that the most significant digit may be only -// w-1 zeros away from that next non-zero digit. -int ec_compute_wNAF(const EC_GROUP *group, int8_t *out, const EC_SCALAR *scalar, - size_t bits, int w); - -int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx); - -// method functions in simple.c -int ec_GFp_simple_group_init(EC_GROUP *); -void ec_GFp_simple_group_finish(EC_GROUP *); -int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, - BIGNUM *b, BN_CTX *); -unsigned ec_GFp_simple_group_get_degree(const EC_GROUP *); -int ec_GFp_simple_point_init(EC_POINT *); -void ec_GFp_simple_point_finish(EC_POINT *); -int ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *); -int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *); -int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, const BIGNUM *y, - BN_CTX *); -int ec_GFp_simple_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, - const EC_POINT *b, BN_CTX *); -int ec_GFp_simple_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, - BN_CTX *); -int ec_GFp_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); -int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *); -int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); -int ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, - BN_CTX *); -int ec_GFp_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); -int ec_GFp_simple_points_make_affine(const EC_GROUP *, size_t num, - EC_POINT * [], BN_CTX *); -int ec_GFp_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -int ec_GFp_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); - -// method functions in montgomery.c -int ec_GFp_mont_group_init(EC_GROUP *); -int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -void ec_GFp_mont_group_finish(EC_GROUP *); -int ec_GFp_mont_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -int ec_GFp_mont_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); -int ec_GFp_mont_field_encode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); -int ec_GFp_mont_field_decode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); - -void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, uint8_t in); - -const EC_METHOD *EC_GFp_nistp224_method(void); -const EC_METHOD *EC_GFp_nistp256_method(void); - -// EC_GFp_nistz256_method is a GFp method using montgomery multiplication, with -// x86-64 optimized P256. See http://eprint.iacr.org/2013/816. -const EC_METHOD *EC_GFp_nistz256_method(void); - -// An EC_WRAPPED_SCALAR is an |EC_SCALAR| with a parallel |BIGNUM| -// representation. It exists to support the |EC_KEY_get0_private_key| API. -typedef struct { - BIGNUM bignum; - EC_SCALAR scalar; -} EC_WRAPPED_SCALAR; - -struct ec_key_st { - EC_GROUP *group; - - EC_POINT *pub_key; - EC_WRAPPED_SCALAR *priv_key; - - // fixed_k may contain a specific value of 'k', to be used in ECDSA signing. - // This is only for the FIPS power-on tests. - BIGNUM *fixed_k; - - unsigned int enc_flag; - point_conversion_form_t conv_form; - - CRYPTO_refcount_t references; - - ECDSA_METHOD *ecdsa_meth; - - CRYPTO_EX_DATA ex_data; -} /* EC_KEY */; - -struct built_in_curve { - int nid; - const uint8_t *oid; - uint8_t oid_len; - // comment is a human-readable string describing the curve. - const char *comment; - // param_len is the number of bytes needed to store a field element. - uint8_t param_len; - // params points to an array of 6*|param_len| bytes which hold the field - // elements of the following (in big-endian order): prime, a, b, generator x, - // generator y, order. - const uint8_t *params; - const EC_METHOD *method; -}; - -#define OPENSSL_NUM_BUILT_IN_CURVES 4 - -struct built_in_curves { - struct built_in_curve curves[OPENSSL_NUM_BUILT_IN_CURVES]; -}; - -// OPENSSL_built_in_curves returns a pointer to static information about -// standard curves. The array is terminated with an entry where |nid| is -// |NID_undef|. -const struct built_in_curves *OPENSSL_built_in_curves(void); - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_EC_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/internal.h.grpc_back deleted file mode 100644 index c198cc292..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/internal.h.grpc_back +++ /dev/null @@ -1,337 +0,0 @@ -/* Originally written by Bodo Moeller for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#ifndef OPENSSL_HEADER_EC_INTERNAL_H -#define OPENSSL_HEADER_EC_INTERNAL_H - -#include - -#include -#include -#include -#include - -#include "../bn/internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -// Cap the size of all field elements and scalars, including custom curves, to -// 66 bytes, large enough to fit secp521r1 and brainpoolP512r1, which appear to -// be the largest fields anyone plausibly uses. -#define EC_MAX_SCALAR_BYTES 66 -#define EC_MAX_SCALAR_WORDS ((66 + BN_BYTES - 1) / BN_BYTES) - -OPENSSL_COMPILE_ASSERT(EC_MAX_SCALAR_WORDS <= BN_SMALL_MAX_WORDS, - bn_small_functions_applicable); - -// An EC_SCALAR is an integer fully reduced modulo the order. Only the first -// |order->width| words are used. An |EC_SCALAR| is specific to an |EC_GROUP| -// and must not be mixed between groups. -typedef union { - // bytes is the representation of the scalar in little-endian order. - uint8_t bytes[EC_MAX_SCALAR_BYTES]; - BN_ULONG words[EC_MAX_SCALAR_WORDS]; -} EC_SCALAR; - -struct ec_method_st { - int (*group_init)(EC_GROUP *); - void (*group_finish)(EC_GROUP *); - int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); - int (*point_get_affine_coordinates)(const EC_GROUP *, const EC_POINT *, - BIGNUM *x, BIGNUM *y, BN_CTX *); - - // Computes |r = g_scalar*generator + p_scalar*p| if |g_scalar| and |p_scalar| - // are both non-null. Computes |r = g_scalar*generator| if |p_scalar| is null. - // Computes |r = p_scalar*p| if g_scalar is null. At least one of |g_scalar| - // and |p_scalar| must be non-null, and |p| must be non-null if |p_scalar| is - // non-null. - int (*mul)(const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx); - // mul_public performs the same computation as mul. It further assumes that - // the inputs are public so there is no concern about leaking their values - // through timing. - int (*mul_public)(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx); - - // 'field_mul' and 'field_sqr' can be used by 'add' and 'dbl' so that the - // same implementations of point operations can be used with different - // optimized implementations of expensive field operations: - int (*field_mul)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, BN_CTX *); - - int (*field_encode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); // e.g. to Montgomery - int (*field_decode)(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); // e.g. from Montgomery -} /* EC_METHOD */; - -const EC_METHOD *EC_GFp_mont_method(void); - -struct ec_group_st { - const EC_METHOD *meth; - - // Unlike all other |EC_POINT|s, |generator| does not own |generator->group| - // to avoid a reference cycle. - EC_POINT *generator; - BIGNUM order; - - int curve_name; // optional NID for named curve - - BN_MONT_CTX *order_mont; // data for ECDSA inverse - - // The following members are handled by the method functions, - // even if they appear generic - - BIGNUM field; // For curves over GF(p), this is the modulus. - - BIGNUM a, b; // Curve coefficients. - - int a_is_minus3; // enable optimized point arithmetics for special case - - CRYPTO_refcount_t references; - - BN_MONT_CTX *mont; // Montgomery structure. - - BIGNUM one; // The value one. -} /* EC_GROUP */; - -struct ec_point_st { - // group is an owning reference to |group|, unless this is - // |group->generator|. - EC_GROUP *group; - - BIGNUM X; - BIGNUM Y; - BIGNUM Z; // Jacobian projective coordinates: - // (X, Y, Z) represents (X/Z^2, Y/Z^3) if Z != 0 -} /* EC_POINT */; - -EC_GROUP *ec_group_new(const EC_METHOD *meth); - -// ec_bignum_to_scalar converts |in| to an |EC_SCALAR| and writes it to -// |*out|. It returns one on success and zero if |in| is out of range. -OPENSSL_EXPORT int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in); - -// ec_bignum_to_scalar_unchecked behaves like |ec_bignum_to_scalar| but does not -// check |in| is fully reduced. -int ec_bignum_to_scalar_unchecked(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in); - -// ec_random_nonzero_scalar sets |out| to a uniformly selected random value from -// 1 to |group->order| - 1. It returns one on success and zero on error. -int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, - const uint8_t additional_data[32]); - -// ec_point_mul_scalar sets |r| to generator * |g_scalar| + |p| * -// |p_scalar|. Unlike other functions which take |EC_SCALAR|, |g_scalar| and -// |p_scalar| need not be fully reduced. They need only contain as many bits as -// the order. -int ec_point_mul_scalar(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx); - -// ec_point_mul_scalar_public performs the same computation as -// ec_point_mul_scalar. It further assumes that the inputs are public so -// there is no concern about leaking their values through timing. -OPENSSL_EXPORT int ec_point_mul_scalar_public( - const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx); - -// ec_compute_wNAF writes the modified width-(w+1) Non-Adjacent Form (wNAF) of -// |scalar| to |out| and returns one on success or zero on internal error. |out| -// must have room for |bits| + 1 elements, each of which will be either zero or -// odd with an absolute value less than 2^w satisfying -// scalar = \sum_j out[j]*2^j -// where at most one of any w+1 consecutive digits is non-zero -// with the exception that the most significant digit may be only -// w-1 zeros away from that next non-zero digit. -int ec_compute_wNAF(const EC_GROUP *group, int8_t *out, const EC_SCALAR *scalar, - size_t bits, int w); - -int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx); - -// method functions in simple.c -int ec_GFp_simple_group_init(EC_GROUP *); -void ec_GFp_simple_group_finish(EC_GROUP *); -int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, - BIGNUM *b, BN_CTX *); -unsigned ec_GFp_simple_group_get_degree(const EC_GROUP *); -int ec_GFp_simple_point_init(EC_POINT *); -void ec_GFp_simple_point_finish(EC_POINT *); -int ec_GFp_simple_point_copy(EC_POINT *, const EC_POINT *); -int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_POINT *); -int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_POINT *, - const BIGNUM *x, const BIGNUM *y, - BN_CTX *); -int ec_GFp_simple_add(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, - const EC_POINT *b, BN_CTX *); -int ec_GFp_simple_dbl(const EC_GROUP *, EC_POINT *r, const EC_POINT *a, - BN_CTX *); -int ec_GFp_simple_invert(const EC_GROUP *, EC_POINT *, BN_CTX *); -int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_POINT *); -int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_POINT *, BN_CTX *); -int ec_GFp_simple_cmp(const EC_GROUP *, const EC_POINT *a, const EC_POINT *b, - BN_CTX *); -int ec_GFp_simple_make_affine(const EC_GROUP *, EC_POINT *, BN_CTX *); -int ec_GFp_simple_points_make_affine(const EC_GROUP *, size_t num, - EC_POINT * [], BN_CTX *); -int ec_GFp_simple_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -int ec_GFp_simple_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); - -// method functions in montgomery.c -int ec_GFp_mont_group_init(EC_GROUP *); -int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -void ec_GFp_mont_group_finish(EC_GROUP *); -int ec_GFp_mont_field_mul(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *); -int ec_GFp_mont_field_sqr(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); -int ec_GFp_mont_field_encode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); -int ec_GFp_mont_field_decode(const EC_GROUP *, BIGNUM *r, const BIGNUM *a, - BN_CTX *); - -void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, uint8_t in); - -const EC_METHOD *EC_GFp_nistp224_method(void); -const EC_METHOD *EC_GFp_nistp256_method(void); - -// EC_GFp_nistz256_method is a GFp method using montgomery multiplication, with -// x86-64 optimized P256. See http://eprint.iacr.org/2013/816. -const EC_METHOD *EC_GFp_nistz256_method(void); - -// An EC_WRAPPED_SCALAR is an |EC_SCALAR| with a parallel |BIGNUM| -// representation. It exists to support the |EC_KEY_get0_private_key| API. -typedef struct { - BIGNUM bignum; - EC_SCALAR scalar; -} EC_WRAPPED_SCALAR; - -struct ec_key_st { - EC_GROUP *group; - - EC_POINT *pub_key; - EC_WRAPPED_SCALAR *priv_key; - - // fixed_k may contain a specific value of 'k', to be used in ECDSA signing. - // This is only for the FIPS power-on tests. - BIGNUM *fixed_k; - - unsigned int enc_flag; - point_conversion_form_t conv_form; - - CRYPTO_refcount_t references; - - ECDSA_METHOD *ecdsa_meth; - - CRYPTO_EX_DATA ex_data; -} /* EC_KEY */; - -struct built_in_curve { - int nid; - const uint8_t *oid; - uint8_t oid_len; - // comment is a human-readable string describing the curve. - const char *comment; - // param_len is the number of bytes needed to store a field element. - uint8_t param_len; - // params points to an array of 6*|param_len| bytes which hold the field - // elements of the following (in big-endian order): prime, a, b, generator x, - // generator y, order. - const uint8_t *params; - const EC_METHOD *method; -}; - -#define OPENSSL_NUM_BUILT_IN_CURVES 4 - -struct built_in_curves { - struct built_in_curve curves[OPENSSL_NUM_BUILT_IN_CURVES]; -}; - -// OPENSSL_built_in_curves returns a pointer to static information about -// standard curves. The array is terminated with an entry where |nid| is -// |NID_undef|. -const struct built_in_curves *OPENSSL_built_in_curves(void); - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_EC_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64-table.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64-table.h deleted file mode 100644 index bcb05f674..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64-table.h +++ /dev/null @@ -1,9503 +0,0 @@ -/* Copyright (c) 2015, Intel Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -// This is the precomputed constant time access table for the code in -// p256-x86_64.c, for the default generator. The table consists of 37 -// subtables, each subtable contains 64 affine points. The affine points are -// encoded as eight uint64's, four for the x coordinate and four for the y. -// Both values are in little-endian order. There are 37 tables because a -// signed, 6-bit wNAF form of the scalar is used and ceil(256/(6 + 1)) = 37. -// Within each table there are 64 values because the 6-bit wNAF value can take -// 64 values, ignoring the sign bit, which is implemented by performing a -// negation of the affine point when required. We would like to align it to 2MB -// in order to increase the chances of using a large page but that appears to -// lead to invalid ELF files being produced. - -// This file is generated by make_p256-x86_64-table.go. - -static const alignas(4096) BN_ULONG - ecp_nistz256_precomputed[37][64 * sizeof(P256_POINT_AFFINE) / - sizeof(BN_ULONG)] = { - {TOBN(0x79e730d4, 0x18a9143c), TOBN(0x75ba95fc, 0x5fedb601), - TOBN(0x79fb732b, 0x77622510), TOBN(0x18905f76, 0xa53755c6), - TOBN(0xddf25357, 0xce95560a), TOBN(0x8b4ab8e4, 0xba19e45c), - TOBN(0xd2e88688, 0xdd21f325), TOBN(0x8571ff18, 0x25885d85), - TOBN(0x850046d4, 0x10ddd64d), TOBN(0xaa6ae3c1, 0xa433827d), - TOBN(0x73220503, 0x8d1490d9), TOBN(0xf6bb32e4, 0x3dcf3a3b), - TOBN(0x2f3648d3, 0x61bee1a5), TOBN(0x152cd7cb, 0xeb236ff8), - TOBN(0x19a8fb0e, 0x92042dbe), TOBN(0x78c57751, 0x0a5b8a3b), - TOBN(0xffac3f90, 0x4eebc127), TOBN(0xb027f84a, 0x087d81fb), - TOBN(0x66ad77dd, 0x87cbbc98), TOBN(0x26936a3f, 0xb6ff747e), - TOBN(0xb04c5c1f, 0xc983a7eb), TOBN(0x583e47ad, 0x0861fe1a), - TOBN(0x78820831, 0x1a2ee98e), TOBN(0xd5f06a29, 0xe587cc07), - TOBN(0x74b0b50d, 0x46918dcc), TOBN(0x4650a6ed, 0xc623c173), - TOBN(0x0cdaacac, 0xe8100af2), TOBN(0x577362f5, 0x41b0176b), - TOBN(0x2d96f24c, 0xe4cbaba6), TOBN(0x17628471, 0xfad6f447), - TOBN(0x6b6c36de, 0xe5ddd22e), TOBN(0x84b14c39, 0x4c5ab863), - TOBN(0xbe1b8aae, 0xc45c61f5), TOBN(0x90ec649a, 0x94b9537d), - TOBN(0x941cb5aa, 0xd076c20c), TOBN(0xc9079605, 0x890523c8), - TOBN(0xeb309b4a, 0xe7ba4f10), TOBN(0x73c568ef, 0xe5eb882b), - TOBN(0x3540a987, 0x7e7a1f68), TOBN(0x73a076bb, 0x2dd1e916), - TOBN(0x40394737, 0x3e77664a), TOBN(0x55ae744f, 0x346cee3e), - TOBN(0xd50a961a, 0x5b17a3ad), TOBN(0x13074b59, 0x54213673), - TOBN(0x93d36220, 0xd377e44b), TOBN(0x299c2b53, 0xadff14b5), - TOBN(0xf424d44c, 0xef639f11), TOBN(0xa4c9916d, 0x4a07f75f), - TOBN(0x0746354e, 0xa0173b4f), TOBN(0x2bd20213, 0xd23c00f7), - TOBN(0xf43eaab5, 0x0c23bb08), TOBN(0x13ba5119, 0xc3123e03), - TOBN(0x2847d030, 0x3f5b9d4d), TOBN(0x6742f2f2, 0x5da67bdd), - TOBN(0xef933bdc, 0x77c94195), TOBN(0xeaedd915, 0x6e240867), - TOBN(0x27f14cd1, 0x9499a78f), TOBN(0x462ab5c5, 0x6f9b3455), - TOBN(0x8f90f02a, 0xf02cfc6b), TOBN(0xb763891e, 0xb265230d), - TOBN(0xf59da3a9, 0x532d4977), TOBN(0x21e3327d, 0xcf9eba15), - TOBN(0x123c7b84, 0xbe60bbf0), TOBN(0x56ec12f2, 0x7706df76), - TOBN(0x75c96e8f, 0x264e20e8), TOBN(0xabe6bfed, 0x59a7a841), - TOBN(0x2cc09c04, 0x44c8eb00), TOBN(0xe05b3080, 0xf0c4e16b), - TOBN(0x1eb7777a, 0xa45f3314), TOBN(0x56af7bed, 0xce5d45e3), - TOBN(0x2b6e019a, 0x88b12f1a), TOBN(0x086659cd, 0xfd835f9b), - TOBN(0x2c18dbd1, 0x9dc21ec8), TOBN(0x98f9868a, 0x0fcf8139), - TOBN(0x737d2cd6, 0x48250b49), TOBN(0xcc61c947, 0x24b3428f), - TOBN(0x0c2b4078, 0x80dd9e76), TOBN(0xc43a8991, 0x383fbe08), - TOBN(0x5f7d2d65, 0x779be5d2), TOBN(0x78719a54, 0xeb3b4ab5), - TOBN(0xea7d260a, 0x6245e404), TOBN(0x9de40795, 0x6e7fdfe0), - TOBN(0x1ff3a415, 0x8dac1ab5), TOBN(0x3e7090f1, 0x649c9073), - TOBN(0x1a768561, 0x2b944e88), TOBN(0x250f939e, 0xe57f61c8), - TOBN(0x0c0daa89, 0x1ead643d), TOBN(0x68930023, 0xe125b88e), - TOBN(0x04b71aa7, 0xd2697768), TOBN(0xabdedef5, 0xca345a33), - TOBN(0x2409d29d, 0xee37385e), TOBN(0x4ee1df77, 0xcb83e156), - TOBN(0x0cac12d9, 0x1cbb5b43), TOBN(0x170ed2f6, 0xca895637), - TOBN(0x28228cfa, 0x8ade6d66), TOBN(0x7ff57c95, 0x53238aca), - TOBN(0xccc42563, 0x4b2ed709), TOBN(0x0e356769, 0x856fd30d), - TOBN(0xbcbcd43f, 0x559e9811), TOBN(0x738477ac, 0x5395b759), - TOBN(0x35752b90, 0xc00ee17f), TOBN(0x68748390, 0x742ed2e3), - TOBN(0x7cd06422, 0xbd1f5bc1), TOBN(0xfbc08769, 0xc9e7b797), - TOBN(0xa242a35b, 0xb0cf664a), TOBN(0x126e48f7, 0x7f9707e3), - TOBN(0x1717bf54, 0xc6832660), TOBN(0xfaae7332, 0xfd12c72e), - TOBN(0x27b52db7, 0x995d586b), TOBN(0xbe29569e, 0x832237c2), - TOBN(0xe8e4193e, 0x2a65e7db), TOBN(0x152706dc, 0x2eaa1bbb), - TOBN(0x72bcd8b7, 0xbc60055b), TOBN(0x03cc23ee, 0x56e27e4b), - TOBN(0xee337424, 0xe4819370), TOBN(0xe2aa0e43, 0x0ad3da09), - TOBN(0x40b8524f, 0x6383c45d), TOBN(0xd7663554, 0x42a41b25), - TOBN(0x64efa6de, 0x778a4797), TOBN(0x2042170a, 0x7079adf4), - TOBN(0x808b0b65, 0x0bc6fb80), TOBN(0x5882e075, 0x3ffe2e6b), - TOBN(0xd5ef2f7c, 0x2c83f549), TOBN(0x54d63c80, 0x9103b723), - TOBN(0xf2f11bd6, 0x52a23f9b), TOBN(0x3670c319, 0x4b0b6587), - TOBN(0x55c4623b, 0xb1580e9e), TOBN(0x64edf7b2, 0x01efe220), - TOBN(0x97091dcb, 0xd53c5c9d), TOBN(0xf17624b6, 0xac0a177b), - TOBN(0xb0f13975, 0x2cfe2dff), TOBN(0xc1a35c0a, 0x6c7a574e), - TOBN(0x227d3146, 0x93e79987), TOBN(0x0575bf30, 0xe89cb80e), - TOBN(0x2f4e247f, 0x0d1883bb), TOBN(0xebd51226, 0x3274c3d0), - TOBN(0x5f3e51c8, 0x56ada97a), TOBN(0x4afc964d, 0x8f8b403e), - TOBN(0xa6f247ab, 0x412e2979), TOBN(0x675abd1b, 0x6f80ebda), - TOBN(0x66a2bd72, 0x5e485a1d), TOBN(0x4b2a5caf, 0x8f4f0b3c), - TOBN(0x2626927f, 0x1b847bba), TOBN(0x6c6fc7d9, 0x0502394d), - TOBN(0xfea912ba, 0xa5659ae8), TOBN(0x68363aba, 0x25e1a16e), - TOBN(0xb8842277, 0x752c41ac), TOBN(0xfe545c28, 0x2897c3fc), - TOBN(0x2d36e9e7, 0xdc4c696b), TOBN(0x5806244a, 0xfba977c5), - TOBN(0x85665e9b, 0xe39508c1), TOBN(0xf720ee25, 0x6d12597b), - TOBN(0x8a979129, 0xd2337a31), TOBN(0x5916868f, 0x0f862bdc), - TOBN(0x048099d9, 0x5dd283ba), TOBN(0xe2d1eeb6, 0xfe5bfb4e), - TOBN(0x82ef1c41, 0x7884005d), TOBN(0xa2d4ec17, 0xffffcbae), - TOBN(0x9161c53f, 0x8aa95e66), TOBN(0x5ee104e1, 0xc5fee0d0), - TOBN(0x562e4cec, 0xc135b208), TOBN(0x74e1b265, 0x4783f47d), - TOBN(0x6d2a506c, 0x5a3f3b30), TOBN(0xecead9f4, 0xc16762fc), - TOBN(0xf29dd4b2, 0xe286e5b9), TOBN(0x1b0fadc0, 0x83bb3c61), - TOBN(0x7a75023e, 0x7fac29a4), TOBN(0xc086d5f1, 0xc9477fa3), - TOBN(0x0fc61135, 0x2f6f3076), TOBN(0xc99ffa23, 0xe3912a9a), - TOBN(0x6a0b0685, 0xd2f8ba3d), TOBN(0xfdc777e8, 0xe93358a4), - TOBN(0x94a787bb, 0x35415f04), TOBN(0x640c2d6a, 0x4d23fea4), - TOBN(0x9de917da, 0x153a35b5), TOBN(0x793e8d07, 0x5d5cd074), - TOBN(0xf4f87653, 0x2de45068), TOBN(0x37c7a7e8, 0x9e2e1f6e), - TOBN(0xd0825fa2, 0xa3584069), TOBN(0xaf2cea7c, 0x1727bf42), - TOBN(0x0360a4fb, 0x9e4785a9), TOBN(0xe5fda49c, 0x27299f4a), - TOBN(0x48068e13, 0x71ac2f71), TOBN(0x83d0687b, 0x9077666f), - TOBN(0x6d3883b2, 0x15d02819), TOBN(0x6d0d7550, 0x40dd9a35), - TOBN(0x61d7cbf9, 0x1d2b469f), TOBN(0xf97b232f, 0x2efc3115), - TOBN(0xa551d750, 0xb24bcbc7), TOBN(0x11ea4949, 0x88a1e356), - TOBN(0x7669f031, 0x93cb7501), TOBN(0x595dc55e, 0xca737b8a), - TOBN(0xa4a319ac, 0xd837879f), TOBN(0x6fc1b49e, 0xed6b67b0), - TOBN(0xe3959933, 0x32f1f3af), TOBN(0x966742eb, 0x65432a2e), - TOBN(0x4b8dc9fe, 0xb4966228), TOBN(0x96cc6312, 0x43f43950), - TOBN(0x12068859, 0xc9b731ee), TOBN(0x7b948dc3, 0x56f79968), - TOBN(0x61e4ad32, 0xed1f8008), TOBN(0xe6c9267a, 0xd8b17538), - TOBN(0x1ac7c5eb, 0x857ff6fb), TOBN(0x994baaa8, 0x55f2fb10), - TOBN(0x84cf14e1, 0x1d248018), TOBN(0x5a39898b, 0x628ac508), - TOBN(0x14fde97b, 0x5fa944f5), TOBN(0xed178030, 0xd12e5ac7), - TOBN(0x042c2af4, 0x97e2feb4), TOBN(0xd36a42d7, 0xaebf7313), - TOBN(0x49d2c9eb, 0x084ffdd7), TOBN(0x9f8aa54b, 0x2ef7c76a), - TOBN(0x9200b7ba, 0x09895e70), TOBN(0x3bd0c66f, 0xddb7fb58), - TOBN(0x2d97d108, 0x78eb4cbb), TOBN(0x2d431068, 0xd84bde31), - TOBN(0x4b523eb7, 0x172ccd1f), TOBN(0x7323cb28, 0x30a6a892), - TOBN(0x97082ec0, 0xcfe153eb), TOBN(0xe97f6b6a, 0xf2aadb97), - TOBN(0x1d3d393e, 0xd1a83da1), TOBN(0xa6a7f9c7, 0x804b2a68), - TOBN(0x4a688b48, 0x2d0cb71e), TOBN(0xa9b4cc5f, 0x40585278), - TOBN(0x5e5db46a, 0xcb66e132), TOBN(0xf1be963a, 0x0d925880), - TOBN(0x944a7027, 0x0317b9e2), TOBN(0xe266f959, 0x48603d48), - TOBN(0x98db6673, 0x5c208899), TOBN(0x90472447, 0xa2fb18a3), - TOBN(0x8a966939, 0x777c619f), TOBN(0x3798142a, 0x2a3be21b), - TOBN(0xb4241cb1, 0x3298b343), TOBN(0xa3a14e49, 0xb44f65a1), - TOBN(0xc5f4d6cd, 0x3ac77acd), TOBN(0xd0288cb5, 0x52b6fc3c), - TOBN(0xd5cc8c2f, 0x1c040abc), TOBN(0xb675511e, 0x06bf9b4a), - TOBN(0xd667da37, 0x9b3aa441), TOBN(0x460d45ce, 0x51601f72), - TOBN(0xe2f73c69, 0x6755ff89), TOBN(0xdd3cf7e7, 0x473017e6), - TOBN(0x8ef5689d, 0x3cf7600d), TOBN(0x948dc4f8, 0xb1fc87b4), - TOBN(0xd9e9fe81, 0x4ea53299), TOBN(0x2d921ca2, 0x98eb6028), - TOBN(0xfaecedfd, 0x0c9803fc), TOBN(0xf38ae891, 0x4d7b4745), - TOBN(0xd8c5fccf, 0xc5e3a3d8), TOBN(0xbefd904c, 0x4079dfbf), - TOBN(0xbc6d6a58, 0xfead0197), TOBN(0x39227077, 0x695532a4), - TOBN(0x09e23e6d, 0xdbef42f5), TOBN(0x7e449b64, 0x480a9908), - TOBN(0x7b969c1a, 0xad9a2e40), TOBN(0x6231d792, 0x9591c2a4), - TOBN(0x87151456, 0x0f664534), TOBN(0x85ceae7c, 0x4b68f103), - TOBN(0xac09c4ae, 0x65578ab9), TOBN(0x33ec6868, 0xf044b10c), - TOBN(0x6ac4832b, 0x3a8ec1f1), TOBN(0x5509d128, 0x5847d5ef), - TOBN(0xf909604f, 0x763f1574), TOBN(0xb16c4303, 0xc32f63c4), - TOBN(0xb6ab2014, 0x7ca23cd3), TOBN(0xcaa7a5c6, 0xa391849d), - TOBN(0x5b0673a3, 0x75678d94), TOBN(0xc982ddd4, 0xdd303e64), - TOBN(0xfd7b000b, 0x5db6f971), TOBN(0xbba2cb1f, 0x6f876f92), - TOBN(0xc77332a3, 0x3c569426), TOBN(0xa159100c, 0x570d74f8), - TOBN(0xfd16847f, 0xdec67ef5), TOBN(0x742ee464, 0x233e76b7), - TOBN(0x0b8e4134, 0xefc2b4c8), TOBN(0xca640b86, 0x42a3e521), - TOBN(0x653a0190, 0x8ceb6aa9), TOBN(0x313c300c, 0x547852d5), - TOBN(0x24e4ab12, 0x6b237af7), TOBN(0x2ba90162, 0x8bb47af8), - TOBN(0x3d5e58d6, 0xa8219bb7), TOBN(0xc691d0bd, 0x1b06c57f), - TOBN(0x0ae4cb10, 0xd257576e), TOBN(0x3569656c, 0xd54a3dc3), - TOBN(0xe5ebaebd, 0x94cda03a), TOBN(0x934e82d3, 0x162bfe13), - TOBN(0x450ac0ba, 0xe251a0c6), TOBN(0x480b9e11, 0xdd6da526), - TOBN(0x00467bc5, 0x8cce08b5), TOBN(0xb636458c, 0x7f178d55), - TOBN(0xc5748bae, 0xa677d806), TOBN(0x2763a387, 0xdfa394eb), - TOBN(0xa12b448a, 0x7d3cebb6), TOBN(0xe7adda3e, 0x6f20d850), - TOBN(0xf63ebce5, 0x1558462c), TOBN(0x58b36143, 0x620088a8), - TOBN(0x8a2cc3ca, 0x4d63c0ee), TOBN(0x51233117, 0x0fe948ce), - TOBN(0x7463fd85, 0x222ef33b), TOBN(0xadf0c7dc, 0x7c603d6c), - TOBN(0x0ec32d3b, 0xfe7765e5), TOBN(0xccaab359, 0xbf380409), - TOBN(0xbdaa84d6, 0x8e59319c), TOBN(0xd9a4c280, 0x9c80c34d), - TOBN(0xa9d89488, 0xa059c142), TOBN(0x6f5ae714, 0xff0b9346), - TOBN(0x068f237d, 0x16fb3664), TOBN(0x5853e4c4, 0x363186ac), - TOBN(0xe2d87d23, 0x63c52f98), TOBN(0x2ec4a766, 0x81828876), - TOBN(0x47b864fa, 0xe14e7b1c), TOBN(0x0c0bc0e5, 0x69192408), - TOBN(0xe4d7681d, 0xb82e9f3e), TOBN(0x83200f0b, 0xdf25e13c), - TOBN(0x8909984c, 0x66f27280), TOBN(0x462d7b00, 0x75f73227), - TOBN(0xd90ba188, 0xf2651798), TOBN(0x74c6e18c, 0x36ab1c34), - TOBN(0xab256ea3, 0x5ef54359), TOBN(0x03466612, 0xd1aa702f), - TOBN(0x624d6049, 0x2ed22e91), TOBN(0x6fdfe0b5, 0x6f072822), - TOBN(0xeeca1115, 0x39ce2271), TOBN(0x98100a4f, 0xdb01614f), - TOBN(0xb6b0daa2, 0xa35c628f), TOBN(0xb6f94d2e, 0xc87e9a47), - TOBN(0xc6773259, 0x1d57d9ce), TOBN(0xf70bfeec, 0x03884a7b), - TOBN(0x5fb35ccf, 0xed2bad01), TOBN(0xa155cbe3, 0x1da6a5c7), - TOBN(0xc2e2594c, 0x30a92f8f), TOBN(0x649c89ce, 0x5bfafe43), - TOBN(0xd158667d, 0xe9ff257a), TOBN(0x9b359611, 0xf32c50ae), - TOBN(0x4b00b20b, 0x906014cf), TOBN(0xf3a8cfe3, 0x89bc7d3d), - TOBN(0x4ff23ffd, 0x248a7d06), TOBN(0x80c5bfb4, 0x878873fa), - TOBN(0xb7d9ad90, 0x05745981), TOBN(0x179c85db, 0x3db01994), - TOBN(0xba41b062, 0x61a6966c), TOBN(0x4d82d052, 0xeadce5a8), - TOBN(0x9e91cd3b, 0xa5e6a318), TOBN(0x47795f4f, 0x95b2dda0), - TOBN(0xecfd7c1f, 0xd55a897c), TOBN(0x009194ab, 0xb29110fb), - TOBN(0x5f0e2046, 0xe381d3b0), TOBN(0x5f3425f6, 0xa98dd291), - TOBN(0xbfa06687, 0x730d50da), TOBN(0x0423446c, 0x4b083b7f), - TOBN(0x397a247d, 0xd69d3417), TOBN(0xeb629f90, 0x387ba42a), - TOBN(0x1ee426cc, 0xd5cd79bf), TOBN(0x0032940b, 0x946c6e18), - TOBN(0x1b1e8ae0, 0x57477f58), TOBN(0xe94f7d34, 0x6d823278), - TOBN(0xc747cb96, 0x782ba21a), TOBN(0xc5254469, 0xf72b33a5), - TOBN(0x772ef6de, 0xc7f80c81), TOBN(0xd73acbfe, 0x2cd9e6b5), - TOBN(0x4075b5b1, 0x49ee90d9), TOBN(0x785c339a, 0xa06e9eba), - TOBN(0xa1030d5b, 0xabf825e0), TOBN(0xcec684c3, 0xa42931dc), - TOBN(0x42ab62c9, 0xc1586e63), TOBN(0x45431d66, 0x5ab43f2b), - TOBN(0x57c8b2c0, 0x55f7835d), TOBN(0x033da338, 0xc1b7f865), - TOBN(0x283c7513, 0xcaa76097), TOBN(0x0a624fa9, 0x36c83906), - TOBN(0x6b20afec, 0x715af2c7), TOBN(0x4b969974, 0xeba78bfd), - TOBN(0x220755cc, 0xd921d60e), TOBN(0x9b944e10, 0x7baeca13), - TOBN(0x04819d51, 0x5ded93d4), TOBN(0x9bbff86e, 0x6dddfd27), - TOBN(0x6b344130, 0x77adc612), TOBN(0xa7496529, 0xbbd803a0), - TOBN(0x1a1baaa7, 0x6d8805bd), TOBN(0xc8403902, 0x470343ad), - TOBN(0x39f59f66, 0x175adff1), TOBN(0x0b26d7fb, 0xb7d8c5b7), - TOBN(0xa875f5ce, 0x529d75e3), TOBN(0x85efc7e9, 0x41325cc2), - TOBN(0x21950b42, 0x1ff6acd3), TOBN(0xffe70484, 0x53dc6909), - TOBN(0xff4cd0b2, 0x28766127), TOBN(0xabdbe608, 0x4fb7db2b), - TOBN(0x837c9228, 0x5e1109e8), TOBN(0x26147d27, 0xf4645b5a), - TOBN(0x4d78f592, 0xf7818ed8), TOBN(0xd394077e, 0xf247fa36), - TOBN(0x0fb9c2d0, 0x488c171a), TOBN(0xa78bfbaa, 0x13685278), - TOBN(0xedfbe268, 0xd5b1fa6a), TOBN(0x0dceb8db, 0x2b7eaba7), - TOBN(0xbf9e8089, 0x9ae2b710), TOBN(0xefde7ae6, 0xa4449c96), - TOBN(0x43b7716b, 0xcc143a46), TOBN(0xd7d34194, 0xc3628c13), - TOBN(0x508cec1c, 0x3b3f64c9), TOBN(0xe20bc0ba, 0x1e5edf3f), - TOBN(0xda1deb85, 0x2f4318d4), TOBN(0xd20ebe0d, 0x5c3fa443), - TOBN(0x370b4ea7, 0x73241ea3), TOBN(0x61f1511c, 0x5e1a5f65), - TOBN(0x99a5e23d, 0x82681c62), TOBN(0xd731e383, 0xa2f54c2d), - TOBN(0x2692f36e, 0x83445904), TOBN(0x2e0ec469, 0xaf45f9c0), - TOBN(0x905a3201, 0xc67528b7), TOBN(0x88f77f34, 0xd0e5e542), - TOBN(0xf67a8d29, 0x5864687c), TOBN(0x23b92eae, 0x22df3562), - TOBN(0x5c27014b, 0x9bbec39e), TOBN(0x7ef2f226, 0x9c0f0f8d), - TOBN(0x97359638, 0x546c4d8d), TOBN(0x5f9c3fc4, 0x92f24679), - TOBN(0x912e8bed, 0xa8c8acd9), TOBN(0xec3a318d, 0x306634b0), - TOBN(0x80167f41, 0xc31cb264), TOBN(0x3db82f6f, 0x522113f2), - TOBN(0xb155bcd2, 0xdcafe197), TOBN(0xfba1da59, 0x43465283), - TOBN(0xa0425b8e, 0xb212cf53), TOBN(0x4f2e512e, 0xf8557c5f), - TOBN(0xc1286ff9, 0x25c4d56c), TOBN(0xbb8a0fea, 0xee26c851), - TOBN(0xc28f70d2, 0xe7d6107e), TOBN(0x7ee0c444, 0xe76265aa), - TOBN(0x3df277a4, 0x1d1936b1), TOBN(0x1a556e3f, 0xea9595eb), - TOBN(0x258bbbf9, 0xe7305683), TOBN(0x31eea5bf, 0x07ef5be6), - TOBN(0x0deb0e4a, 0x46c814c1), TOBN(0x5cee8449, 0xa7b730dd), - TOBN(0xeab495c5, 0xa0182bde), TOBN(0xee759f87, 0x9e27a6b4), - TOBN(0xc2cf6a68, 0x80e518ca), TOBN(0x25e8013f, 0xf14cf3f4), - TOBN(0x8fc44140, 0x7e8d7a14), TOBN(0xbb1ff3ca, 0x9556f36a), - TOBN(0x6a844385, 0x14600044), TOBN(0xba3f0c4a, 0x7451ae63), - TOBN(0xdfcac25b, 0x1f9af32a), TOBN(0x01e0db86, 0xb1f2214b), - TOBN(0x4e9a5bc2, 0xa4b596ac), TOBN(0x83927681, 0x026c2c08), - TOBN(0x3ec832e7, 0x7acaca28), TOBN(0x1bfeea57, 0xc7385b29), - TOBN(0x068212e3, 0xfd1eaf38), TOBN(0xc1329830, 0x6acf8ccc), - TOBN(0xb909f2db, 0x2aac9e59), TOBN(0x5748060d, 0xb661782a), - TOBN(0xc5ab2632, 0xc79b7a01), TOBN(0xda44c6c6, 0x00017626), - TOBN(0xf26c00e8, 0xa7ea82f0), TOBN(0x99cac80d, 0xe4299aaf), - TOBN(0xd66fe3b6, 0x7ed78be1), TOBN(0x305f725f, 0x648d02cd), - TOBN(0x33ed1bc4, 0x623fb21b), TOBN(0xfa70533e, 0x7a6319ad), - TOBN(0x17ab562d, 0xbe5ffb3e), TOBN(0x06374994, 0x56674741), - TOBN(0x69d44ed6, 0x5c46aa8e), TOBN(0x2100d5d3, 0xa8d063d1), - TOBN(0xcb9727ea, 0xa2d17c36), TOBN(0x4c2bab1b, 0x8add53b7), - TOBN(0xa084e90c, 0x15426704), TOBN(0x778afcd3, 0xa837ebea), - TOBN(0x6651f701, 0x7ce477f8), TOBN(0xa0624998, 0x46fb7a8b), - TOBN(0xdc1e6828, 0xed8a6e19), TOBN(0x33fc2336, 0x4189d9c7), - TOBN(0x026f8fe2, 0x671c39bc), TOBN(0xd40c4ccd, 0xbc6f9915), - TOBN(0xafa135bb, 0xf80e75ca), TOBN(0x12c651a0, 0x22adff2c), - TOBN(0xc40a04bd, 0x4f51ad96), TOBN(0x04820109, 0xbbe4e832), - TOBN(0x3667eb1a, 0x7f4c04cc), TOBN(0x59556621, 0xa9404f84), - TOBN(0x71cdf653, 0x7eceb50a), TOBN(0x994a44a6, 0x9b8335fa), - TOBN(0xd7faf819, 0xdbeb9b69), TOBN(0x473c5680, 0xeed4350d), - TOBN(0xb6658466, 0xda44bba2), TOBN(0x0d1bc780, 0x872bdbf3), - TOBN(0xe535f175, 0xa1962f91), TOBN(0x6ed7e061, 0xed58f5a7), - TOBN(0x177aa4c0, 0x2089a233), TOBN(0x0dbcb03a, 0xe539b413), - TOBN(0xe3dc424e, 0xbb32e38e), TOBN(0x6472e5ef, 0x6806701e), - TOBN(0xdd47ff98, 0x814be9ee), TOBN(0x6b60cfff, 0x35ace009), - TOBN(0xb8d3d931, 0x9ff91fe5), TOBN(0x039c4800, 0xf0518eed), - TOBN(0x95c37632, 0x9182cb26), TOBN(0x0763a434, 0x82fc568d), - TOBN(0x707c04d5, 0x383e76ba), TOBN(0xac98b930, 0x824e8197), - TOBN(0x92bf7c8f, 0x91230de0), TOBN(0x90876a01, 0x40959b70), - TOBN(0xdb6d96f3, 0x05968b80), TOBN(0x380a0913, 0x089f73b9), - TOBN(0x7da70b83, 0xc2c61e01), TOBN(0x95fb8394, 0x569b38c7), - TOBN(0x9a3c6512, 0x80edfe2f), TOBN(0x8f726bb9, 0x8faeaf82), - TOBN(0x8010a4a0, 0x78424bf8), TOBN(0x29672044, 0x0e844970)}, - {TOBN(0x63c5cb81, 0x7a2ad62a), TOBN(0x7ef2b6b9, 0xac62ff54), - TOBN(0x3749bba4, 0xb3ad9db5), TOBN(0xad311f2c, 0x46d5a617), - TOBN(0xb77a8087, 0xc2ff3b6d), TOBN(0xb46feaf3, 0x367834ff), - TOBN(0xf8aa266d, 0x75d6b138), TOBN(0xfa38d320, 0xec008188), - TOBN(0x486d8ffa, 0x696946fc), TOBN(0x50fbc6d8, 0xb9cba56d), - TOBN(0x7e3d423e, 0x90f35a15), TOBN(0x7c3da195, 0xc0dd962c), - TOBN(0xe673fdb0, 0x3cfd5d8b), TOBN(0x0704b7c2, 0x889dfca5), - TOBN(0xf6ce581f, 0xf52305aa), TOBN(0x399d49eb, 0x914d5e53), - TOBN(0x380a496d, 0x6ec293cd), TOBN(0x733dbda7, 0x8e7051f5), - TOBN(0x037e388d, 0xb849140a), TOBN(0xee4b32b0, 0x5946dbf6), - TOBN(0xb1c4fda9, 0xcae368d1), TOBN(0x5001a7b0, 0xfdb0b2f3), - TOBN(0x6df59374, 0x2e3ac46e), TOBN(0x4af675f2, 0x39b3e656), - TOBN(0x44e38110, 0x39949296), TOBN(0x5b63827b, 0x361db1b5), - TOBN(0x3e5323ed, 0x206eaff5), TOBN(0x942370d2, 0xc21f4290), - TOBN(0xf2caaf2e, 0xe0d985a1), TOBN(0x192cc64b, 0x7239846d), - TOBN(0x7c0b8f47, 0xae6312f8), TOBN(0x7dc61f91, 0x96620108), - TOBN(0xb830fb5b, 0xc2da7de9), TOBN(0xd0e643df, 0x0ff8d3be), - TOBN(0x31ee77ba, 0x188a9641), TOBN(0x4e8aa3aa, 0xbcf6d502), - TOBN(0xf9fb6532, 0x9a49110f), TOBN(0xd18317f6, 0x2dd6b220), - TOBN(0x7e3ced41, 0x52c3ea5a), TOBN(0x0d296a14, 0x7d579c4a), - TOBN(0x35d6a53e, 0xed4c3717), TOBN(0x9f8240cf, 0x3d0ed2a3), - TOBN(0x8c0d4d05, 0xe5543aa5), TOBN(0x45d5bbfb, 0xdd33b4b4), - TOBN(0xfa04cc73, 0x137fd28e), TOBN(0x862ac6ef, 0xc73b3ffd), - TOBN(0x403ff9f5, 0x31f51ef2), TOBN(0x34d5e0fc, 0xbc73f5a2), - TOBN(0xf2526820, 0x08913f4f), TOBN(0xea20ed61, 0xeac93d95), - TOBN(0x51ed38b4, 0x6ca6b26c), TOBN(0x8662dcbc, 0xea4327b0), - TOBN(0x6daf295c, 0x725d2aaa), TOBN(0xbad2752f, 0x8e52dcda), - TOBN(0x2210e721, 0x0b17dacc), TOBN(0xa37f7912, 0xd51e8232), - TOBN(0x4f7081e1, 0x44cc3add), TOBN(0xd5ffa1d6, 0x87be82cf), - TOBN(0x89890b6c, 0x0edd6472), TOBN(0xada26e1a, 0x3ed17863), - TOBN(0x276f2715, 0x63483caa), TOBN(0xe6924cd9, 0x2f6077fd), - TOBN(0x05a7fe98, 0x0a466e3c), TOBN(0xf1c794b0, 0xb1902d1f), - TOBN(0xe5213688, 0x82a8042c), TOBN(0xd931cfaf, 0xcd278298), - TOBN(0x069a0ae0, 0xf597a740), TOBN(0x0adbb3f3, 0xeb59107c), - TOBN(0x983e951e, 0x5eaa8eb8), TOBN(0xe663a8b5, 0x11b48e78), - TOBN(0x1631cc0d, 0x8a03f2c5), TOBN(0x7577c11e, 0x11e271e2), - TOBN(0x33b2385c, 0x08369a90), TOBN(0x2990c59b, 0x190eb4f8), - TOBN(0x819a6145, 0xc68eac80), TOBN(0x7a786d62, 0x2ec4a014), - TOBN(0x33faadbe, 0x20ac3a8d), TOBN(0x31a21781, 0x5aba2d30), - TOBN(0x209d2742, 0xdba4f565), TOBN(0xdb2ce9e3, 0x55aa0fbb), - TOBN(0x8cef334b, 0x168984df), TOBN(0xe81dce17, 0x33879638), - TOBN(0xf6e6949c, 0x263720f0), TOBN(0x5c56feaf, 0xf593cbec), - TOBN(0x8bff5601, 0xfde58c84), TOBN(0x74e24117, 0x2eccb314), - TOBN(0xbcf01b61, 0x4c9a8a78), TOBN(0xa233e35e, 0x544c9868), - TOBN(0xb3156bf3, 0x8bd7aff1), TOBN(0x1b5ee4cb, 0x1d81b146), - TOBN(0x7ba1ac41, 0xd628a915), TOBN(0x8f3a8f9c, 0xfd89699e), - TOBN(0x7329b9c9, 0xa0748be7), TOBN(0x1d391c95, 0xa92e621f), - TOBN(0xe51e6b21, 0x4d10a837), TOBN(0xd255f53a, 0x4947b435), - TOBN(0x07669e04, 0xf1788ee3), TOBN(0xc14f27af, 0xa86938a2), - TOBN(0x8b47a334, 0xe93a01c0), TOBN(0xff627438, 0xd9366808), - TOBN(0x7a0985d8, 0xca2a5965), TOBN(0x3d9a5542, 0xd6e9b9b3), - TOBN(0xc23eb80b, 0x4cf972e8), TOBN(0x5c1c33bb, 0x4fdf72fd), - TOBN(0x0c4a58d4, 0x74a86108), TOBN(0xf8048a8f, 0xee4c5d90), - TOBN(0xe3c7c924, 0xe86d4c80), TOBN(0x28c889de, 0x056a1e60), - TOBN(0x57e2662e, 0xb214a040), TOBN(0xe8c48e98, 0x37e10347), - TOBN(0x87742862, 0x80ac748a), TOBN(0xf1c24022, 0x186b06f2), - TOBN(0xac2dd4c3, 0x5f74040a), TOBN(0x409aeb71, 0xfceac957), - TOBN(0x4fbad782, 0x55c4ec23), TOBN(0xb359ed61, 0x8a7b76ec), - TOBN(0x12744926, 0xed6f4a60), TOBN(0xe21e8d7f, 0x4b912de3), - TOBN(0xe2575a59, 0xfc705a59), TOBN(0x72f1d4de, 0xed2dbc0e), - TOBN(0x3d2b24b9, 0xeb7926b8), TOBN(0xbff88cb3, 0xcdbe5509), - TOBN(0xd0f399af, 0xe4dd640b), TOBN(0x3c5fe130, 0x2f76ed45), - TOBN(0x6f3562f4, 0x3764fb3d), TOBN(0x7b5af318, 0x3151b62d), - TOBN(0xd5bd0bc7, 0xd79ce5f3), TOBN(0xfdaf6b20, 0xec66890f), - TOBN(0x735c67ec, 0x6063540c), TOBN(0x50b259c2, 0xe5f9cb8f), - TOBN(0xb8734f9a, 0x3f99c6ab), TOBN(0xf8cc13d5, 0xa3a7bc85), - TOBN(0x80c1b305, 0xc5217659), TOBN(0xfe5364d4, 0x4ec12a54), - TOBN(0xbd87045e, 0x681345fe), TOBN(0x7f8efeb1, 0x582f897f), - TOBN(0xe8cbf1e5, 0xd5923359), TOBN(0xdb0cea9d, 0x539b9fb0), - TOBN(0x0c5b34cf, 0x49859b98), TOBN(0x5e583c56, 0xa4403cc6), - TOBN(0x11fc1a2d, 0xd48185b7), TOBN(0xc93fbc7e, 0x6e521787), - TOBN(0x47e7a058, 0x05105b8b), TOBN(0x7b4d4d58, 0xdb8260c8), - TOBN(0xe33930b0, 0x46eb842a), TOBN(0x8e844a9a, 0x7bdae56d), - TOBN(0x34ef3a9e, 0x13f7fdfc), TOBN(0xb3768f82, 0x636ca176), - TOBN(0x2821f4e0, 0x4e09e61c), TOBN(0x414dc3a1, 0xa0c7cddc), - TOBN(0xd5379437, 0x54945fcd), TOBN(0x151b6eef, 0xb3555ff1), - TOBN(0xb31bd613, 0x6339c083), TOBN(0x39ff8155, 0xdfb64701), - TOBN(0x7c3388d2, 0xe29604ab), TOBN(0x1e19084b, 0xa6b10442), - TOBN(0x17cf54c0, 0xeccd47ef), TOBN(0x89693385, 0x4a5dfb30), - TOBN(0x69d023fb, 0x47daf9f6), TOBN(0x9222840b, 0x7d91d959), - TOBN(0x439108f5, 0x803bac62), TOBN(0x0b7dd91d, 0x379bd45f), - TOBN(0xd651e827, 0xca63c581), TOBN(0x5c5d75f6, 0x509c104f), - TOBN(0x7d5fc738, 0x1f2dc308), TOBN(0x20faa7bf, 0xd98454be), - TOBN(0x95374bee, 0xa517b031), TOBN(0xf036b9b1, 0x642692ac), - TOBN(0xc5106109, 0x39842194), TOBN(0xb7e2353e, 0x49d05295), - TOBN(0xfc8c1d5c, 0xefb42ee0), TOBN(0xe04884eb, 0x08ce811c), - TOBN(0xf1f75d81, 0x7419f40e), TOBN(0x5b0ac162, 0xa995c241), - TOBN(0x120921bb, 0xc4c55646), TOBN(0x713520c2, 0x8d33cf97), - TOBN(0xb4a65a5c, 0xe98c5100), TOBN(0x6cec871d, 0x2ddd0f5a), - TOBN(0x251f0b7f, 0x9ba2e78b), TOBN(0x224a8434, 0xce3a2a5f), - TOBN(0x26827f61, 0x25f5c46f), TOBN(0x6a22bedc, 0x48545ec0), - TOBN(0x25ae5fa0, 0xb1bb5cdc), TOBN(0xd693682f, 0xfcb9b98f), - TOBN(0x32027fe8, 0x91e5d7d3), TOBN(0xf14b7d17, 0x73a07678), - TOBN(0xf88497b3, 0xc0dfdd61), TOBN(0xf7c2eec0, 0x2a8c4f48), - TOBN(0xaa5573f4, 0x3756e621), TOBN(0xc013a240, 0x1825b948), - TOBN(0x1c03b345, 0x63878572), TOBN(0xa0472bea, 0x653a4184), - TOBN(0xf4222e27, 0x0ac69a80), TOBN(0x34096d25, 0xf51e54f6), - TOBN(0x00a648cb, 0x8fffa591), TOBN(0x4e87acdc, 0x69b6527f), - TOBN(0x0575e037, 0xe285ccb4), TOBN(0x188089e4, 0x50ddcf52), - TOBN(0xaa96c9a8, 0x870ff719), TOBN(0x74a56cd8, 0x1fc7e369), - TOBN(0x41d04ee2, 0x1726931a), TOBN(0x0bbbb2c8, 0x3660ecfd), - TOBN(0xa6ef6de5, 0x24818e18), TOBN(0xe421cc51, 0xe7d57887), - TOBN(0xf127d208, 0xbea87be6), TOBN(0x16a475d3, 0xb1cdd682), - TOBN(0x9db1b684, 0x439b63f7), TOBN(0x5359b3db, 0xf0f113b6), - TOBN(0xdfccf1de, 0x8bf06e31), TOBN(0x1fdf8f44, 0xdd383901), - TOBN(0x10775cad, 0x5017e7d2), TOBN(0xdfc3a597, 0x58d11eef), - TOBN(0x6ec9c8a0, 0xb1ecff10), TOBN(0xee6ed6cc, 0x28400549), - TOBN(0xb5ad7bae, 0x1b4f8d73), TOBN(0x61b4f11d, 0xe00aaab9), - TOBN(0x7b32d69b, 0xd4eff2d7), TOBN(0x88ae6771, 0x4288b60f), - TOBN(0x159461b4, 0x37a1e723), TOBN(0x1f3d4789, 0x570aae8c), - TOBN(0x869118c0, 0x7f9871da), TOBN(0x35fbda78, 0xf635e278), - TOBN(0x738f3641, 0xe1541dac), TOBN(0x6794b13a, 0xc0dae45f), - TOBN(0x065064ac, 0x09cc0917), TOBN(0x27c53729, 0xc68540fd), - TOBN(0x0d2d4c8e, 0xef227671), TOBN(0xd23a9f80, 0xa1785a04), - TOBN(0x98c59528, 0x52650359), TOBN(0xfa09ad01, 0x74a1acad), - TOBN(0x082d5a29, 0x0b55bf5c), TOBN(0xa40f1c67, 0x419b8084), - TOBN(0x3a5c752e, 0xdcc18770), TOBN(0x4baf1f2f, 0x8825c3a5), - TOBN(0xebd63f74, 0x21b153ed), TOBN(0xa2383e47, 0xb2f64723), - TOBN(0xe7bf620a, 0x2646d19a), TOBN(0x56cb44ec, 0x03c83ffd), - TOBN(0xaf7267c9, 0x4f6be9f1), TOBN(0x8b2dfd7b, 0xc06bb5e9), - TOBN(0xb87072f2, 0xa672c5c7), TOBN(0xeacb11c8, 0x0d53c5e2), - TOBN(0x22dac29d, 0xff435932), TOBN(0x37bdb99d, 0x4408693c), - TOBN(0xf6e62fb6, 0x2899c20f), TOBN(0x3535d512, 0x447ece24), - TOBN(0xfbdc6b88, 0xff577ce3), TOBN(0x726693bd, 0x190575f2), - TOBN(0x6772b0e5, 0xab4b35a2), TOBN(0x1d8b6001, 0xf5eeaacf), - TOBN(0x728f7ce4, 0x795b9580), TOBN(0x4a20ed2a, 0x41fb81da), - TOBN(0x9f685cd4, 0x4fec01e6), TOBN(0x3ed7ddcc, 0xa7ff50ad), - TOBN(0x460fd264, 0x0c2d97fd), TOBN(0x3a241426, 0xeb82f4f9), - TOBN(0x17d1df2c, 0x6a8ea820), TOBN(0xb2b50d3b, 0xf22cc254), - TOBN(0x03856cba, 0xb7291426), TOBN(0x87fd26ae, 0x04f5ee39), - TOBN(0x9cb696cc, 0x02bee4ba), TOBN(0x53121804, 0x06820fd6), - TOBN(0xa5dfc269, 0x0212e985), TOBN(0x666f7ffa, 0x160f9a09), - TOBN(0xc503cd33, 0xbccd9617), TOBN(0x365dede4, 0xba7730a3), - TOBN(0x798c6355, 0x5ddb0786), TOBN(0xa6c3200e, 0xfc9cd3bc), - TOBN(0x060ffb2c, 0xe5e35efd), TOBN(0x99a4e25b, 0x5555a1c1), - TOBN(0x11d95375, 0xf70b3751), TOBN(0x0a57354a, 0x160e1bf6), - TOBN(0xecb3ae4b, 0xf8e4b065), TOBN(0x07a834c4, 0x2e53022b), - TOBN(0x1cd300b3, 0x8692ed96), TOBN(0x16a6f792, 0x61ee14ec), - TOBN(0x8f1063c6, 0x6a8649ed), TOBN(0xfbcdfcfe, 0x869f3e14), - TOBN(0x2cfb97c1, 0x00a7b3ec), TOBN(0xcea49b3c, 0x7130c2f1), - TOBN(0x462d044f, 0xe9d96488), TOBN(0x4b53d52e, 0x8182a0c1), - TOBN(0x84b6ddd3, 0x0391e9e9), TOBN(0x80ab7b48, 0xb1741a09), - TOBN(0xec0e15d4, 0x27d3317f), TOBN(0x8dfc1ddb, 0x1a64671e), - TOBN(0x93cc5d5f, 0xd49c5b92), TOBN(0xc995d53d, 0x3674a331), - TOBN(0x302e41ec, 0x090090ae), TOBN(0x2278a0cc, 0xedb06830), - TOBN(0x1d025932, 0xfbc99690), TOBN(0x0c32fbd2, 0xb80d68da), - TOBN(0xd79146da, 0xf341a6c1), TOBN(0xae0ba139, 0x1bef68a0), - TOBN(0xc6b8a563, 0x8d774b3a), TOBN(0x1cf307bd, 0x880ba4d7), - TOBN(0xc033bdc7, 0x19803511), TOBN(0xa9f97b3b, 0x8888c3be), - TOBN(0x3d68aebc, 0x85c6d05e), TOBN(0xc3b88a9d, 0x193919eb), - TOBN(0x2d300748, 0xc48b0ee3), TOBN(0x7506bc7c, 0x07a746c1), - TOBN(0xfc48437c, 0x6e6d57f3), TOBN(0x5bd71587, 0xcfeaa91a), - TOBN(0xa4ed0408, 0xc1bc5225), TOBN(0xd0b946db, 0x2719226d), - TOBN(0x109ecd62, 0x758d2d43), TOBN(0x75c8485a, 0x2751759b), - TOBN(0xb0b75f49, 0x9ce4177a), TOBN(0x4fa61a1e, 0x79c10c3d), - TOBN(0xc062d300, 0xa167fcd7), TOBN(0x4df3874c, 0x750f0fa8), - TOBN(0x29ae2cf9, 0x83dfedc9), TOBN(0xf8437134, 0x8d87631a), - TOBN(0xaf571711, 0x7429c8d2), TOBN(0x18d15867, 0x146d9272), - TOBN(0x83053ecf, 0x69769bb7), TOBN(0xc55eb856, 0xc479ab82), - TOBN(0x5ef7791c, 0x21b0f4b2), TOBN(0xaa5956ba, 0x3d491525), - TOBN(0x407a96c2, 0x9fe20eba), TOBN(0xf27168bb, 0xe52a5ad3), - TOBN(0x43b60ab3, 0xbf1d9d89), TOBN(0xe45c51ef, 0x710e727a), - TOBN(0xdfca5276, 0x099b4221), TOBN(0x8dc6407c, 0x2557a159), - TOBN(0x0ead8335, 0x91035895), TOBN(0x0a9db957, 0x9c55dc32), - TOBN(0xe40736d3, 0xdf61bc76), TOBN(0x13a619c0, 0x3f778cdb), - TOBN(0x6dd921a4, 0xc56ea28f), TOBN(0x76a52433, 0x2fa647b4), - TOBN(0x23591891, 0xac5bdc5d), TOBN(0xff4a1a72, 0xbac7dc01), - TOBN(0x9905e261, 0x62df8453), TOBN(0x3ac045df, 0xe63b265f), - TOBN(0x8a3f341b, 0xad53dba7), TOBN(0x8ec269cc, 0x837b625a), - TOBN(0xd71a2782, 0x3ae31189), TOBN(0x8fb4f9a3, 0x55e96120), - TOBN(0x804af823, 0xff9875cf), TOBN(0x23224f57, 0x5d442a9b), - TOBN(0x1c4d3b9e, 0xecc62679), TOBN(0x91da22fb, 0xa0e7ddb1), - TOBN(0xa370324d, 0x6c04a661), TOBN(0x9710d3b6, 0x5e376d17), - TOBN(0xed8c98f0, 0x3044e357), TOBN(0xc364ebbe, 0x6422701c), - TOBN(0x347f5d51, 0x7733d61c), TOBN(0xd55644b9, 0xcea826c3), - TOBN(0x80c6e0ad, 0x55a25548), TOBN(0x0aa7641d, 0x844220a7), - TOBN(0x1438ec81, 0x31810660), TOBN(0x9dfa6507, 0xde4b4043), - TOBN(0x10b515d8, 0xcc3e0273), TOBN(0x1b6066dd, 0x28d8cfb2), - TOBN(0xd3b04591, 0x9c9efebd), TOBN(0x425d4bdf, 0xa21c1ff4), - TOBN(0x5fe5af19, 0xd57607d3), TOBN(0xbbf773f7, 0x54481084), - TOBN(0x8435bd69, 0x94b03ed1), TOBN(0xd9ad1de3, 0x634cc546), - TOBN(0x2cf423fc, 0x00e420ca), TOBN(0xeed26d80, 0xa03096dd), - TOBN(0xd7f60be7, 0xa4db09d2), TOBN(0xf47f569d, 0x960622f7), - TOBN(0xe5925fd7, 0x7296c729), TOBN(0xeff2db26, 0x26ca2715), - TOBN(0xa6fcd014, 0xb913e759), TOBN(0x53da4786, 0x8ff4de93), - TOBN(0x14616d79, 0xc32068e1), TOBN(0xb187d664, 0xccdf352e), - TOBN(0xf7afb650, 0x1dc90b59), TOBN(0x8170e943, 0x7daa1b26), - TOBN(0xc8e3bdd8, 0x700c0a84), TOBN(0x6e8d345f, 0x6482bdfa), - TOBN(0x84cfbfa1, 0xc5c5ea50), TOBN(0xd3baf14c, 0x67960681), - TOBN(0x26398403, 0x0dd50942), TOBN(0xe4b7839c, 0x4716a663), - TOBN(0xd5f1f794, 0xe7de6dc0), TOBN(0x5cd0f4d4, 0x622aa7ce), - TOBN(0x5295f3f1, 0x59acfeec), TOBN(0x8d933552, 0x953e0607), - TOBN(0xc7db8ec5, 0x776c5722), TOBN(0xdc467e62, 0x2b5f290c), - TOBN(0xd4297e70, 0x4ff425a9), TOBN(0x4be924c1, 0x0cf7bb72), - TOBN(0x0d5dc5ae, 0xa1892131), TOBN(0x8bf8a8e3, 0xa705c992), - TOBN(0x73a0b064, 0x7a305ac5), TOBN(0x00c9ca4e, 0x9a8c77a8), - TOBN(0x5dfee80f, 0x83774bdd), TOBN(0x63131602, 0x85734485), - TOBN(0xa1b524ae, 0x914a69a9), TOBN(0xebc2ffaf, 0xd4e300d7), - TOBN(0x52c93db7, 0x7cfa46a5), TOBN(0x71e6161f, 0x21653b50), - TOBN(0x3574fc57, 0xa4bc580a), TOBN(0xc09015dd, 0xe1bc1253), - TOBN(0x4b7b47b2, 0xd174d7aa), TOBN(0x4072d8e8, 0xf3a15d04), - TOBN(0xeeb7d47f, 0xd6fa07ed), TOBN(0x6f2b9ff9, 0xedbdafb1), - TOBN(0x18c51615, 0x3760fe8a), TOBN(0x7a96e6bf, 0xf06c6c13), - TOBN(0x4d7a0410, 0x0ea2d071), TOBN(0xa1914e9b, 0x0be2a5ce), - TOBN(0x5726e357, 0xd8a3c5cf), TOBN(0x1197ecc3, 0x2abb2b13), - TOBN(0x6c0d7f7f, 0x31ae88dd), TOBN(0x15b20d1a, 0xfdbb3efe), - TOBN(0xcd06aa26, 0x70584039), TOBN(0x2277c969, 0xa7dc9747), - TOBN(0xbca69587, 0x7855d815), TOBN(0x899ea238, 0x5188b32a), - TOBN(0x37d9228b, 0x760c1c9d), TOBN(0xc7efbb11, 0x9b5c18da), - TOBN(0x7f0d1bc8, 0x19f6dbc5), TOBN(0x4875384b, 0x07e6905b), - TOBN(0xc7c50baa, 0x3ba8cd86), TOBN(0xb0ce40fb, 0xc2905de0), - TOBN(0x70840673, 0x7a231952), TOBN(0xa912a262, 0xcf43de26), - TOBN(0x9c38ddcc, 0xeb5b76c1), TOBN(0x746f5285, 0x26fc0ab4), - TOBN(0x52a63a50, 0xd62c269f), TOBN(0x60049c55, 0x99458621), - TOBN(0xe7f48f82, 0x3c2f7c9e), TOBN(0x6bd99043, 0x917d5cf3), - TOBN(0xeb1317a8, 0x8701f469), TOBN(0xbd3fe2ed, 0x9a449fe0), - TOBN(0x421e79ca, 0x12ef3d36), TOBN(0x9ee3c36c, 0x3e7ea5de), - TOBN(0xe48198b5, 0xcdff36f7), TOBN(0xaff4f967, 0xc6b82228), - TOBN(0x15e19dd0, 0xc47adb7e), TOBN(0x45699b23, 0x032e7dfa), - TOBN(0x40680c8b, 0x1fae026a), TOBN(0x5a347a48, 0x550dbf4d), - TOBN(0xe652533b, 0x3cef0d7d), TOBN(0xd94f7b18, 0x2bbb4381), - TOBN(0x838752be, 0x0e80f500), TOBN(0x8e6e2488, 0x9e9c9bfb), - TOBN(0xc9751697, 0x16caca6a), TOBN(0x866c49d8, 0x38531ad9), - TOBN(0xc917e239, 0x7151ade1), TOBN(0x2d016ec1, 0x6037c407), - TOBN(0xa407ccc9, 0x00eac3f9), TOBN(0x835f6280, 0xe2ed4748), - TOBN(0xcc54c347, 0x1cc98e0d), TOBN(0x0e969937, 0xdcb572eb), - TOBN(0x1b16c8e8, 0x8f30c9cb), TOBN(0xa606ae75, 0x373c4661), - TOBN(0x47aa689b, 0x35502cab), TOBN(0xf89014ae, 0x4d9bb64f), - TOBN(0x202f6a9c, 0x31c71f7b), TOBN(0x01f95aa3, 0x296ffe5c), - TOBN(0x5fc06014, 0x53cec3a3), TOBN(0xeb991237, 0x5f498a45), - TOBN(0xae9a935e, 0x5d91ba87), TOBN(0xc6ac6281, 0x0b564a19), - TOBN(0x8a8fe81c, 0x3bd44e69), TOBN(0x7c8b467f, 0x9dd11d45), - TOBN(0xf772251f, 0xea5b8e69), TOBN(0xaeecb3bd, 0xc5b75fbc), - TOBN(0x1aca3331, 0x887ff0e5), TOBN(0xbe5d49ff, 0x19f0a131), - TOBN(0x582c13aa, 0xe5c8646f), TOBN(0xdbaa12e8, 0x20e19980), - TOBN(0x8f40f31a, 0xf7abbd94), TOBN(0x1f13f5a8, 0x1dfc7663), - TOBN(0x5d81f1ee, 0xaceb4fc0), TOBN(0x36256002, 0x5e6f0f42), - TOBN(0x4b67d6d7, 0x751370c8), TOBN(0x2608b698, 0x03e80589), - TOBN(0xcfc0d2fc, 0x05268301), TOBN(0xa6943d39, 0x40309212), - TOBN(0x192a90c2, 0x1fd0e1c2), TOBN(0xb209f113, 0x37f1dc76), - TOBN(0xefcc5e06, 0x97bf1298), TOBN(0xcbdb6730, 0x219d639e), - TOBN(0xd009c116, 0xb81e8c6f), TOBN(0xa3ffdde3, 0x1a7ce2e5), - TOBN(0xc53fbaaa, 0xa914d3ba), TOBN(0x836d500f, 0x88df85ee), - TOBN(0xd98dc71b, 0x66ee0751), TOBN(0x5a3d7005, 0x714516fd), - TOBN(0x21d3634d, 0x39eedbba), TOBN(0x35cd2e68, 0x0455a46d), - TOBN(0xc8cafe65, 0xf9d7eb0c), TOBN(0xbda3ce9e, 0x00cefb3e), - TOBN(0xddc17a60, 0x2c9cf7a4), TOBN(0x01572ee4, 0x7bcb8773), - TOBN(0xa92b2b01, 0x8c7548df), TOBN(0x732fd309, 0xa84600e3), - TOBN(0xe22109c7, 0x16543a40), TOBN(0x9acafd36, 0xfede3c6c), - TOBN(0xfb206852, 0x6824e614), TOBN(0x2a4544a9, 0xda25dca0), - TOBN(0x25985262, 0x91d60b06), TOBN(0x281b7be9, 0x28753545), - TOBN(0xec667b1a, 0x90f13b27), TOBN(0x33a83aff, 0x940e2eb4), - TOBN(0x80009862, 0xd5d721d5), TOBN(0x0c3357a3, 0x5bd3a182), - TOBN(0x27f3a83b, 0x7aa2cda4), TOBN(0xb58ae74e, 0xf6f83085), - TOBN(0x2a911a81, 0x2e6dad6b), TOBN(0xde286051, 0xf43d6c5b), - TOBN(0x4bdccc41, 0xf996c4d8), TOBN(0xe7312ec0, 0x0ae1e24e)}, - {TOBN(0xf8d112e7, 0x6e6485b3), TOBN(0x4d3e24db, 0x771c52f8), - TOBN(0x48e3ee41, 0x684a2f6d), TOBN(0x7161957d, 0x21d95551), - TOBN(0x19631283, 0xcdb12a6c), TOBN(0xbf3fa882, 0x2e50e164), - TOBN(0xf6254b63, 0x3166cc73), TOBN(0x3aefa7ae, 0xaee8cc38), - TOBN(0x79b0fe62, 0x3b36f9fd), TOBN(0x26543b23, 0xfde19fc0), - TOBN(0x136e64a0, 0x958482ef), TOBN(0x23f63771, 0x9b095825), - TOBN(0x14cfd596, 0xb6a1142e), TOBN(0x5ea6aac6, 0x335aac0b), - TOBN(0x86a0e8bd, 0xf3081dd5), TOBN(0x5fb89d79, 0x003dc12a), - TOBN(0xf615c33a, 0xf72e34d4), TOBN(0x0bd9ea40, 0x110eec35), - TOBN(0x1c12bc5b, 0xc1dea34e), TOBN(0x686584c9, 0x49ae4699), - TOBN(0x13ad95d3, 0x8c97b942), TOBN(0x4609561a, 0x4e5c7562), - TOBN(0x9e94a4ae, 0xf2737f89), TOBN(0xf57594c6, 0x371c78b6), - TOBN(0x0f0165fc, 0xe3779ee3), TOBN(0xe00e7f9d, 0xbd495d9e), - TOBN(0x1fa4efa2, 0x20284e7a), TOBN(0x4564bade, 0x47ac6219), - TOBN(0x90e6312a, 0xc4708e8e), TOBN(0x4f5725fb, 0xa71e9adf), - TOBN(0xe95f55ae, 0x3d684b9f), TOBN(0x47f7ccb1, 0x1e94b415), - TOBN(0x7322851b, 0x8d946581), TOBN(0xf0d13133, 0xbdf4a012), - TOBN(0xa3510f69, 0x6584dae0), TOBN(0x03a7c171, 0x3c9f6c6d), - TOBN(0x5be97f38, 0xe475381a), TOBN(0xca1ba422, 0x85823334), - TOBN(0xf83cc5c7, 0x0be17dda), TOBN(0x158b1494, 0x0b918c0f), - TOBN(0xda3a77e5, 0x522e6b69), TOBN(0x69c908c3, 0xbbcd6c18), - TOBN(0x1f1b9e48, 0xd924fd56), TOBN(0x37c64e36, 0xaa4bb3f7), - TOBN(0x5a4fdbdf, 0xee478d7d), TOBN(0xba75c8bc, 0x0193f7a0), - TOBN(0x84bc1e84, 0x56cd16df), TOBN(0x1fb08f08, 0x46fad151), - TOBN(0x8a7cabf9, 0x842e9f30), TOBN(0xa331d4bf, 0x5eab83af), - TOBN(0xd272cfba, 0x017f2a6a), TOBN(0x27560abc, 0x83aba0e3), - TOBN(0x94b83387, 0x0e3a6b75), TOBN(0x25c6aea2, 0x6b9f50f5), - TOBN(0x803d691d, 0xb5fdf6d0), TOBN(0x03b77509, 0xe6333514), - TOBN(0x36178903, 0x61a341c1), TOBN(0x3604dc60, 0x0cfd6142), - TOBN(0x022295eb, 0x8533316c), TOBN(0x3dbde4ac, 0x44af2922), - TOBN(0x898afc5d, 0x1c7eef69), TOBN(0x58896805, 0xd14f4fa1), - TOBN(0x05002160, 0x203c21ca), TOBN(0x6f0d1f30, 0x40ef730b), - TOBN(0x8e8c44d4, 0x196224f8), TOBN(0x75a4ab95, 0x374d079d), - TOBN(0x79085ecc, 0x7d48f123), TOBN(0x56f04d31, 0x1bf65ad8), - TOBN(0xe220bf1c, 0xbda602b2), TOBN(0x73ee1742, 0xf9612c69), - TOBN(0x76008fc8, 0x084fd06b), TOBN(0x4000ef9f, 0xf11380d1), - TOBN(0x48201b4b, 0x12cfe297), TOBN(0x3eee129c, 0x292f74e5), - TOBN(0xe1fe114e, 0xc9e874e8), TOBN(0x899b055c, 0x92c5fc41), - TOBN(0x4e477a64, 0x3a39c8cf), TOBN(0x82f09efe, 0x78963cc9), - TOBN(0x6fd3fd8f, 0xd333f863), TOBN(0x85132b2a, 0xdc949c63), - TOBN(0x7e06a3ab, 0x516eb17b), TOBN(0x73bec06f, 0xd2c7372b), - TOBN(0xe4f74f55, 0xba896da6), TOBN(0xbb4afef8, 0x8e9eb40f), - TOBN(0x2d75bec8, 0xe61d66b0), TOBN(0x02bda4b4, 0xef29300b), - TOBN(0x8bbaa8de, 0x026baa5a), TOBN(0xff54befd, 0xa07f4440), - TOBN(0xbd9b8b1d, 0xbe7a2af3), TOBN(0xec51caa9, 0x4fb74a72), - TOBN(0xb9937a4b, 0x63879697), TOBN(0x7c9a9d20, 0xec2687d5), - TOBN(0x1773e44f, 0x6ef5f014), TOBN(0x8abcf412, 0xe90c6900), - TOBN(0x387bd022, 0x8142161e), TOBN(0x50393755, 0xfcb6ff2a), - TOBN(0x9813fd56, 0xed6def63), TOBN(0x53cf6482, 0x7d53106c), - TOBN(0x991a35bd, 0x431f7ac1), TOBN(0xf1e274dd, 0x63e65faf), - TOBN(0xf63ffa3c, 0x44cc7880), TOBN(0x411a426b, 0x7c256981), - TOBN(0xb698b9fd, 0x93a420e0), TOBN(0x89fdddc0, 0xae53f8fe), - TOBN(0x766e0722, 0x32398baa), TOBN(0x205fee42, 0x5cfca031), - TOBN(0xa49f5341, 0x7a029cf2), TOBN(0xa88c68b8, 0x4023890d), - TOBN(0xbc275041, 0x7337aaa8), TOBN(0x9ed364ad, 0x0eb384f4), - TOBN(0xe0816f85, 0x29aba92f), TOBN(0x2e9e1941, 0x04e38a88), - TOBN(0x57eef44a, 0x3dafd2d5), TOBN(0x35d1fae5, 0x97ed98d8), - TOBN(0x50628c09, 0x2307f9b1), TOBN(0x09d84aae, 0xd6cba5c6), - TOBN(0x67071bc7, 0x88aaa691), TOBN(0x2dea57a9, 0xafe6cb03), - TOBN(0xdfe11bb4, 0x3d78ac01), TOBN(0x7286418c, 0x7fd7aa51), - TOBN(0xfabf7709, 0x77f7195a), TOBN(0x8ec86167, 0xadeb838f), - TOBN(0xea1285a8, 0xbb4f012d), TOBN(0xd6883503, 0x9a3eab3f), - TOBN(0xee5d24f8, 0x309004c2), TOBN(0xa96e4b76, 0x13ffe95e), - TOBN(0x0cdffe12, 0xbd223ea4), TOBN(0x8f5c2ee5, 0xb6739a53), - TOBN(0x5cb4aaa5, 0xdd968198), TOBN(0xfa131c52, 0x72413a6c), - TOBN(0x53d46a90, 0x9536d903), TOBN(0xb270f0d3, 0x48606d8e), - TOBN(0x518c7564, 0xa053a3bc), TOBN(0x088254b7, 0x1a86caef), - TOBN(0xb3ba8cb4, 0x0ab5efd0), TOBN(0x5c59900e, 0x4605945d), - TOBN(0xecace1dd, 0xa1887395), TOBN(0x40960f36, 0x932a65de), - TOBN(0x9611ff5c, 0x3aa95529), TOBN(0xc58215b0, 0x7c1e5a36), - TOBN(0xd48c9b58, 0xf0e1a524), TOBN(0xb406856b, 0xf590dfb8), - TOBN(0xc7605e04, 0x9cd95662), TOBN(0x0dd036ee, 0xa33ecf82), - TOBN(0xa50171ac, 0xc33156b3), TOBN(0xf09d24ea, 0x4a80172e), - TOBN(0x4e1f72c6, 0x76dc8eef), TOBN(0xe60caadc, 0x5e3d44ee), - TOBN(0x006ef8a6, 0x979b1d8f), TOBN(0x60908a1c, 0x97788d26), - TOBN(0x6e08f95b, 0x266feec0), TOBN(0x618427c2, 0x22e8c94e), - TOBN(0x3d613339, 0x59145a65), TOBN(0xcd9bc368, 0xfa406337), - TOBN(0x82d11be3, 0x2d8a52a0), TOBN(0xf6877b27, 0x97a1c590), - TOBN(0x837a819b, 0xf5cbdb25), TOBN(0x2a4fd1d8, 0xde090249), - TOBN(0x622a7de7, 0x74990e5f), TOBN(0x840fa5a0, 0x7945511b), - TOBN(0x30b974be, 0x6558842d), TOBN(0x70df8c64, 0x17f3d0a6), - TOBN(0x7c803520, 0x7542e46d), TOBN(0x7251fe7f, 0xe4ecc823), - TOBN(0xe59134cb, 0x5e9aac9a), TOBN(0x11bb0934, 0xf0045d71), - TOBN(0x53e5d9b5, 0xdbcb1d4e), TOBN(0x8d97a905, 0x92defc91), - TOBN(0xfe289327, 0x7946d3f9), TOBN(0xe132bd24, 0x07472273), - TOBN(0xeeeb510c, 0x1eb6ae86), TOBN(0x777708c5, 0xf0595067), - TOBN(0x18e2c8cd, 0x1297029e), TOBN(0x2c61095c, 0xbbf9305e), - TOBN(0xe466c258, 0x6b85d6d9), TOBN(0x8ac06c36, 0xda1ea530), - TOBN(0xa365dc39, 0xa1304668), TOBN(0xe4a9c885, 0x07f89606), - TOBN(0x65a4898f, 0xacc7228d), TOBN(0x3e2347ff, 0x84ca8303), - TOBN(0xa5f6fb77, 0xea7d23a3), TOBN(0x2fac257d, 0x672a71cd), - TOBN(0x6908bef8, 0x7e6a44d3), TOBN(0x8ff87566, 0x891d3d7a), - TOBN(0xe58e90b3, 0x6b0cf82e), TOBN(0x6438d246, 0x2615b5e7), - TOBN(0x07b1f8fc, 0x669c145a), TOBN(0xb0d8b2da, 0x36f1e1cb), - TOBN(0x54d5dadb, 0xd9184c4d), TOBN(0x3dbb18d5, 0xf93d9976), - TOBN(0x0a3e0f56, 0xd1147d47), TOBN(0x2afa8c8d, 0xa0a48609), - TOBN(0x275353e8, 0xbc36742c), TOBN(0x898f427e, 0xeea0ed90), - TOBN(0x26f4947e, 0x3e477b00), TOBN(0x8ad8848a, 0x308741e3), - TOBN(0x6c703c38, 0xd74a2a46), TOBN(0x5e3e05a9, 0x9ba17ba2), - TOBN(0xc1fa6f66, 0x4ab9a9e4), TOBN(0x474a2d9a, 0x3841d6ec), - TOBN(0x871239ad, 0x653ae326), TOBN(0x14bcf72a, 0xa74cbb43), - TOBN(0x8737650e, 0x20d4c083), TOBN(0x3df86536, 0x110ed4af), - TOBN(0xd2d86fe7, 0xb53ca555), TOBN(0x688cb00d, 0xabd5d538), - TOBN(0xcf81bda3, 0x1ad38468), TOBN(0x7ccfe3cc, 0xf01167b6), - TOBN(0xcf4f47e0, 0x6c4c1fe6), TOBN(0x557e1f1a, 0x298bbb79), - TOBN(0xf93b974f, 0x30d45a14), TOBN(0x174a1d2d, 0x0baf97c4), - TOBN(0x7a003b30, 0xc51fbf53), TOBN(0xd8940991, 0xee68b225), - TOBN(0x5b0aa7b7, 0x1c0f4173), TOBN(0x975797c9, 0xa20a7153), - TOBN(0x26e08c07, 0xe3533d77), TOBN(0xd7222e6a, 0x2e341c99), - TOBN(0x9d60ec3d, 0x8d2dc4ed), TOBN(0xbdfe0d8f, 0x7c476cf8), - TOBN(0x1fe59ab6, 0x1d056605), TOBN(0xa9ea9df6, 0x86a8551f), - TOBN(0x8489941e, 0x47fb8d8c), TOBN(0xfeb874eb, 0x4a7f1b10), - TOBN(0xfe5fea86, 0x7ee0d98f), TOBN(0x201ad34b, 0xdbf61864), - TOBN(0x45d8fe47, 0x37c031d4), TOBN(0xd5f49fae, 0x795f0822), - TOBN(0xdb0fb291, 0xc7f4a40c), TOBN(0x2e69d9c1, 0x730ddd92), - TOBN(0x754e1054, 0x49d76987), TOBN(0x8a24911d, 0x7662db87), - TOBN(0x61fc1810, 0x60a71676), TOBN(0xe852d1a8, 0xf66a8ad1), - TOBN(0x172bbd65, 0x6417231e), TOBN(0x0d6de7bd, 0x3babb11f), - TOBN(0x6fde6f88, 0xc8e347f8), TOBN(0x1c587547, 0x9bd99cc3), - TOBN(0x78e54ed0, 0x34076950), TOBN(0x97f0f334, 0x796e83ba), - TOBN(0xe4dbe1ce, 0x4924867a), TOBN(0xbd5f51b0, 0x60b84917), - TOBN(0x37530040, 0x3cb09a79), TOBN(0xdb3fe0f8, 0xff1743d8), - TOBN(0xed7894d8, 0x556fa9db), TOBN(0xfa262169, 0x23412fbf), - TOBN(0x563be0db, 0xba7b9291), TOBN(0x6ca8b8c0, 0x0c9fb234), - TOBN(0xed406aa9, 0xbd763802), TOBN(0xc21486a0, 0x65303da1), - TOBN(0x61ae291e, 0xc7e62ec4), TOBN(0x622a0492, 0xdf99333e), - TOBN(0x7fd80c9d, 0xbb7a8ee0), TOBN(0xdc2ed3bc, 0x6c01aedb), - TOBN(0x35c35a12, 0x08be74ec), TOBN(0xd540cb1a, 0x469f671f), - TOBN(0xd16ced4e, 0xcf84f6c7), TOBN(0x8561fb9c, 0x2d090f43), - TOBN(0x7e693d79, 0x6f239db4), TOBN(0xa736f928, 0x77bd0d94), - TOBN(0x07b4d929, 0x2c1950ee), TOBN(0xda177543, 0x56dc11b3), - TOBN(0xa5dfbbaa, 0x7a6a878e), TOBN(0x1c70cb29, 0x4decb08a), - TOBN(0xfba28c8b, 0x6f0f7c50), TOBN(0xa8eba2b8, 0x854dcc6d), - TOBN(0x5ff8e89a, 0x36b78642), TOBN(0x070c1c8e, 0xf6873adf), - TOBN(0xbbd3c371, 0x6484d2e4), TOBN(0xfb78318f, 0x0d414129), - TOBN(0x2621a39c, 0x6ad93b0b), TOBN(0x979d74c2, 0xa9e917f7), - TOBN(0xfc195647, 0x61fb0428), TOBN(0x4d78954a, 0xbee624d4), - TOBN(0xb94896e0, 0xb8ae86fd), TOBN(0x6667ac0c, 0xc91c8b13), - TOBN(0x9f180512, 0x43bcf832), TOBN(0xfbadf8b7, 0xa0010137), - TOBN(0xc69b4089, 0xb3ba8aa7), TOBN(0xfac4bacd, 0xe687ce85), - TOBN(0x9164088d, 0x977eab40), TOBN(0x51f4c5b6, 0x2760b390), - TOBN(0xd238238f, 0x340dd553), TOBN(0x358566c3, 0xdb1d31c9), - TOBN(0x3a5ad69e, 0x5068f5ff), TOBN(0xf31435fc, 0xdaff6b06), - TOBN(0xae549a5b, 0xd6debff0), TOBN(0x59e5f0b7, 0x75e01331), - TOBN(0x5d492fb8, 0x98559acf), TOBN(0x96018c2e, 0x4db79b50), - TOBN(0x55f4a48f, 0x609f66aa), TOBN(0x1943b3af, 0x4900a14f), - TOBN(0xc22496df, 0x15a40d39), TOBN(0xb2a44684, 0x4c20f7c5), - TOBN(0x76a35afa, 0x3b98404c), TOBN(0xbec75725, 0xff5d1b77), - TOBN(0xb67aa163, 0xbea06444), TOBN(0x27e95bb2, 0xf724b6f2), - TOBN(0x3c20e3e9, 0xd238c8ab), TOBN(0x1213754e, 0xddd6ae17), - TOBN(0x8c431020, 0x716e0f74), TOBN(0x6679c82e, 0xffc095c2), - TOBN(0x2eb3adf4, 0xd0ac2932), TOBN(0x2cc970d3, 0x01bb7a76), - TOBN(0x70c71f2f, 0x740f0e66), TOBN(0x545c616b, 0x2b6b23cc), - TOBN(0x4528cfcb, 0xb40a8bd7), TOBN(0xff839633, 0x2ab27722), - TOBN(0x049127d9, 0x025ac99a), TOBN(0xd314d4a0, 0x2b63e33b), - TOBN(0xc8c310e7, 0x28d84519), TOBN(0x0fcb8983, 0xb3bc84ba), - TOBN(0x2cc52261, 0x38634818), TOBN(0x501814f4, 0xb44c2e0b), - TOBN(0xf7e181aa, 0x54dfdba3), TOBN(0xcfd58ff0, 0xe759718c), - TOBN(0xf90cdb14, 0xd3b507a8), TOBN(0x57bd478e, 0xc50bdad8), - TOBN(0x29c197e2, 0x50e5f9aa), TOBN(0x4db6eef8, 0xe40bc855), - TOBN(0x2cc8f21a, 0xd1fc0654), TOBN(0xc71cc963, 0x81269d73), - TOBN(0xecfbb204, 0x077f49f9), TOBN(0xdde92571, 0xca56b793), - TOBN(0x9abed6a3, 0xf97ad8f7), TOBN(0xe6c19d3f, 0x924de3bd), - TOBN(0x8dce92f4, 0xa140a800), TOBN(0x85f44d1e, 0x1337af07), - TOBN(0x5953c08b, 0x09d64c52), TOBN(0xa1b5e49f, 0xf5df9749), - TOBN(0x336a8fb8, 0x52735f7d), TOBN(0xb332b6db, 0x9add676b), - TOBN(0x558b88a0, 0xb4511aa4), TOBN(0x09788752, 0xdbd5cc55), - TOBN(0x16b43b9c, 0xd8cd52bd), TOBN(0x7f0bc5a0, 0xc2a2696b), - TOBN(0x146e12d4, 0xc11f61ef), TOBN(0x9ce10754, 0x3a83e79e), - TOBN(0x08ec73d9, 0x6cbfca15), TOBN(0x09ff29ad, 0x5b49653f), - TOBN(0xe31b72bd, 0xe7da946e), TOBN(0xebf9eb3b, 0xee80a4f2), - TOBN(0xd1aabd08, 0x17598ce4), TOBN(0x18b5fef4, 0x53f37e80), - TOBN(0xd5d5cdd3, 0x5958cd79), TOBN(0x3580a1b5, 0x1d373114), - TOBN(0xa36e4c91, 0xfa935726), TOBN(0xa38c534d, 0xef20d760), - TOBN(0x7088e40a, 0x2ff5845b), TOBN(0xe5bb40bd, 0xbd78177f), - TOBN(0x4f06a7a8, 0x857f9920), TOBN(0xe3cc3e50, 0xe968f05d), - TOBN(0x1d68b7fe, 0xe5682d26), TOBN(0x5206f76f, 0xaec7f87c), - TOBN(0x41110530, 0x041951ab), TOBN(0x58ec52c1, 0xd4b5a71a), - TOBN(0xf3488f99, 0x0f75cf9a), TOBN(0xf411951f, 0xba82d0d5), - TOBN(0x27ee75be, 0x618895ab), TOBN(0xeae060d4, 0x6d8aab14), - TOBN(0x9ae1df73, 0x7fb54dc2), TOBN(0x1f3e391b, 0x25963649), - TOBN(0x242ec32a, 0xfe055081), TOBN(0x5bd450ef, 0x8491c9bd), - TOBN(0x367efc67, 0x981eb389), TOBN(0xed7e1928, 0x3a0550d5), - TOBN(0x362e776b, 0xab3ce75c), TOBN(0xe890e308, 0x1f24c523), - TOBN(0xb961b682, 0xfeccef76), TOBN(0x8b8e11f5, 0x8bba6d92), - TOBN(0x8f2ccc4c, 0x2b2375c4), TOBN(0x0d7f7a52, 0xe2f86cfa), - TOBN(0xfd94d30a, 0x9efe5633), TOBN(0x2d8d246b, 0x5451f934), - TOBN(0x2234c6e3, 0x244e6a00), TOBN(0xde2b5b0d, 0xddec8c50), - TOBN(0x2ce53c5a, 0xbf776f5b), TOBN(0x6f724071, 0x60357b05), - TOBN(0xb2593717, 0x71bf3f7a), TOBN(0x87d2501c, 0x440c4a9f), - TOBN(0x440552e1, 0x87b05340), TOBN(0xb7bf7cc8, 0x21624c32), - TOBN(0x4155a6ce, 0x22facddb), TOBN(0x5a4228cb, 0x889837ef), - TOBN(0xef87d6d6, 0xfd4fd671), TOBN(0xa233687e, 0xc2daa10e), - TOBN(0x75622244, 0x03c0eb96), TOBN(0x7632d184, 0x8bf19be6), - TOBN(0x05d0f8e9, 0x40735ff4), TOBN(0x3a3e6e13, 0xc00931f1), - TOBN(0x31ccde6a, 0xdafe3f18), TOBN(0xf381366a, 0xcfe51207), - TOBN(0x24c222a9, 0x60167d92), TOBN(0x62f9d6f8, 0x7529f18c), - TOBN(0x412397c0, 0x0353b114), TOBN(0x334d89dc, 0xef808043), - TOBN(0xd9ec63ba, 0x2a4383ce), TOBN(0xcec8e937, 0x5cf92ba0), - TOBN(0xfb8b4288, 0xc8be74c0), TOBN(0x67d6912f, 0x105d4391), - TOBN(0x7b996c46, 0x1b913149), TOBN(0x36aae2ef, 0x3a4e02da), - TOBN(0xb68aa003, 0x972de594), TOBN(0x284ec70d, 0x4ec6d545), - TOBN(0xf3d2b2d0, 0x61391d54), TOBN(0x69c5d5d6, 0xfe114e92), - TOBN(0xbe0f00b5, 0xb4482dff), TOBN(0xe1596fa5, 0xf5bf33c5), - TOBN(0x10595b56, 0x96a71cba), TOBN(0x944938b2, 0xfdcadeb7), - TOBN(0xa282da4c, 0xfccd8471), TOBN(0x98ec05f3, 0x0d37bfe1), - TOBN(0xe171ce1b, 0x0698304a), TOBN(0x2d691444, 0x21bdf79b), - TOBN(0xd0cd3b74, 0x1b21dec1), TOBN(0x712ecd8b, 0x16a15f71), - TOBN(0x8d4c00a7, 0x00fd56e1), TOBN(0x02ec9692, 0xf9527c18), - TOBN(0x21c44937, 0x4a3e42e1), TOBN(0x9176fbab, 0x1392ae0a), - TOBN(0x8726f1ba, 0x44b7b618), TOBN(0xb4d7aae9, 0xf1de491c), - TOBN(0xf91df7b9, 0x07b582c0), TOBN(0x7e116c30, 0xef60aa3a), - TOBN(0x99270f81, 0x466265d7), TOBN(0xb15b6fe2, 0x4df7adf0), - TOBN(0xfe33b2d3, 0xf9738f7f), TOBN(0x48553ab9, 0xd6d70f95), - TOBN(0x2cc72ac8, 0xc21e94db), TOBN(0x795ac38d, 0xbdc0bbee), - TOBN(0x0a1be449, 0x2e40478f), TOBN(0x81bd3394, 0x052bde55), - TOBN(0x63c8dbe9, 0x56b3c4f2), TOBN(0x017a99cf, 0x904177cc), - TOBN(0x947bbddb, 0x4d010fc1), TOBN(0xacf9b00b, 0xbb2c9b21), - TOBN(0x2970bc8d, 0x47173611), TOBN(0x1a4cbe08, 0xac7d756f), - TOBN(0x06d9f4aa, 0x67d541a2), TOBN(0xa3e8b689, 0x59c2cf44), - TOBN(0xaad066da, 0x4d88f1dd), TOBN(0xc604f165, 0x7ad35dea), - TOBN(0x7edc0720, 0x4478ca67), TOBN(0xa10dfae0, 0xba02ce06), - TOBN(0xeceb1c76, 0xaf36f4e4), TOBN(0x994b2292, 0xaf3f8f48), - TOBN(0xbf9ed77b, 0x77c8a68c), TOBN(0x74f544ea, 0x51744c9d), - TOBN(0x82d05bb9, 0x8113a757), TOBN(0x4ef2d2b4, 0x8a9885e4), - TOBN(0x1e332be5, 0x1aa7865f), TOBN(0x22b76b18, 0x290d1a52), - TOBN(0x308a2310, 0x44351683), TOBN(0x9d861896, 0xa3f22840), - TOBN(0x5959ddcd, 0x841ed947), TOBN(0x0def0c94, 0x154b73bf), - TOBN(0xf0105417, 0x4c7c15e0), TOBN(0x539bfb02, 0x3a277c32), - TOBN(0xe699268e, 0xf9dccf5f), TOBN(0x9f5796a5, 0x0247a3bd), - TOBN(0x8b839de8, 0x4f157269), TOBN(0xc825c1e5, 0x7a30196b), - TOBN(0x6ef0aabc, 0xdc8a5a91), TOBN(0xf4a8ce6c, 0x498b7fe6), - TOBN(0x1cce35a7, 0x70cbac78), TOBN(0x83488e9b, 0xf6b23958), - TOBN(0x0341a070, 0xd76cb011), TOBN(0xda6c9d06, 0xae1b2658), - TOBN(0xb701fb30, 0xdd648c52), TOBN(0x994ca02c, 0x52fb9fd1), - TOBN(0x06933117, 0x6f563086), TOBN(0x3d2b8100, 0x17856bab), - TOBN(0xe89f48c8, 0x5963a46e), TOBN(0x658ab875, 0xa99e61c7), - TOBN(0x6e296f87, 0x4b8517b4), TOBN(0x36c4fcdc, 0xfc1bc656), - TOBN(0xde5227a1, 0xa3906def), TOBN(0x9fe95f57, 0x62418945), - TOBN(0x20c91e81, 0xfdd96cde), TOBN(0x5adbe47e, 0xda4480de), - TOBN(0xa009370f, 0x396de2b6), TOBN(0x98583d4b, 0xf0ecc7bd), - TOBN(0xf44f6b57, 0xe51d0672), TOBN(0x03d6b078, 0x556b1984), - TOBN(0x27dbdd93, 0xb0b64912), TOBN(0x9b3a3434, 0x15687b09), - TOBN(0x0dba6461, 0x51ec20a9), TOBN(0xec93db7f, 0xff28187c), - TOBN(0x00ff8c24, 0x66e48bdd), TOBN(0x2514f2f9, 0x11ccd78e), - TOBN(0xeba11f4f, 0xe1250603), TOBN(0x8a22cd41, 0x243fa156), - TOBN(0xa4e58df4, 0xb283e4c6), TOBN(0x78c29859, 0x8b39783f), - TOBN(0x5235aee2, 0xa5259809), TOBN(0xc16284b5, 0x0e0227dd), - TOBN(0xa5f57916, 0x1338830d), TOBN(0x6d4b8a6b, 0xd2123fca), - TOBN(0x236ea68a, 0xf9c546f8), TOBN(0xc1d36873, 0xfa608d36), - TOBN(0xcd76e495, 0x8d436d13), TOBN(0xd4d9c221, 0x8fb080af), - TOBN(0x665c1728, 0xe8ad3fb5), TOBN(0xcf1ebe4d, 0xb3d572e0), - TOBN(0xa7a8746a, 0x584c5e20), TOBN(0x267e4ea1, 0xb9dc7035), - TOBN(0x593a15cf, 0xb9548c9b), TOBN(0x5e6e2135, 0x4bd012f3), - TOBN(0xdf31cc6a, 0x8c8f936e), TOBN(0x8af84d04, 0xb5c241dc), - TOBN(0x63990a6f, 0x345efb86), TOBN(0x6fef4e61, 0xb9b962cb)}, - {TOBN(0xf6368f09, 0x25722608), TOBN(0x131260db, 0x131cf5c6), - TOBN(0x40eb353b, 0xfab4f7ac), TOBN(0x85c78880, 0x37eee829), - TOBN(0x4c1581ff, 0xc3bdf24e), TOBN(0x5bff75cb, 0xf5c3c5a8), - TOBN(0x35e8c83f, 0xa14e6f40), TOBN(0xb81d1c0f, 0x0295e0ca), - TOBN(0xfcde7cc8, 0xf43a730f), TOBN(0xe89b6f3c, 0x33ab590e), - TOBN(0xc823f529, 0xad03240b), TOBN(0x82b79afe, 0x98bea5db), - TOBN(0x568f2856, 0x962fe5de), TOBN(0x0c590adb, 0x60c591f3), - TOBN(0x1fc74a14, 0x4a28a858), TOBN(0x3b662498, 0xb3203f4c), - TOBN(0x91e3cf0d, 0x6c39765a), TOBN(0xa2db3acd, 0xac3cca0b), - TOBN(0x288f2f08, 0xcb953b50), TOBN(0x2414582c, 0xcf43cf1a), - TOBN(0x8dec8bbc, 0x60eee9a8), TOBN(0x54c79f02, 0x729aa042), - TOBN(0xd81cd5ec, 0x6532f5d5), TOBN(0xa672303a, 0xcf82e15f), - TOBN(0x376aafa8, 0x719c0563), TOBN(0xcd8ad2dc, 0xbc5fc79f), - TOBN(0x303fdb9f, 0xcb750cd3), TOBN(0x14ff052f, 0x4418b08e), - TOBN(0xf75084cf, 0x3e2d6520), TOBN(0x7ebdf0f8, 0x144ed509), - TOBN(0xf43bf0f2, 0xd3f25b98), TOBN(0x86ad71cf, 0xa354d837), - TOBN(0xb827fe92, 0x26f43572), TOBN(0xdfd3ab5b, 0x5d824758), - TOBN(0x315dd23a, 0x539094c1), TOBN(0x85c0e37a, 0x66623d68), - TOBN(0x575c7972, 0x7be19ae0), TOBN(0x616a3396, 0xdf0d36b5), - TOBN(0xa1ebb3c8, 0x26b1ff7e), TOBN(0x635b9485, 0x140ad453), - TOBN(0x92bf3cda, 0xda430c0b), TOBN(0x4702850e, 0x3a96dac6), - TOBN(0xc91cf0a5, 0x15ac326a), TOBN(0x95de4f49, 0xab8c25e4), - TOBN(0xb01bad09, 0xe265c17c), TOBN(0x24e45464, 0x087b3881), - TOBN(0xd43e583c, 0xe1fac5ca), TOBN(0xe17cb318, 0x6ead97a6), - TOBN(0x6cc39243, 0x74dcec46), TOBN(0x33cfc02d, 0x54c2b73f), - TOBN(0x82917844, 0xf26cd99c), TOBN(0x8819dd95, 0xd1773f89), - TOBN(0x09572aa6, 0x0871f427), TOBN(0x8e0cf365, 0xf6f01c34), - TOBN(0x7fa52988, 0xbff1f5af), TOBN(0x4eb357ea, 0xe75e8e50), - TOBN(0xd9d0c8c4, 0x868af75d), TOBN(0xd7325cff, 0x45c8c7ea), - TOBN(0xab471996, 0xcc81ecb0), TOBN(0xff5d55f3, 0x611824ed), - TOBN(0xbe314541, 0x1977a0ee), TOBN(0x5085c4c5, 0x722038c6), - TOBN(0x2d5335bf, 0xf94bb495), TOBN(0x894ad8a6, 0xc8e2a082), - TOBN(0x5c3e2341, 0xada35438), TOBN(0xf4a9fc89, 0x049b8c4e), - TOBN(0xbeeb355a, 0x9f17cf34), TOBN(0x3f311e0e, 0x6c91fe10), - TOBN(0xc2d20038, 0x92ab9891), TOBN(0x257bdcc1, 0x3e8ce9a9), - TOBN(0x1b2d9789, 0x88c53bee), TOBN(0x927ce89a, 0xcdba143a), - TOBN(0xb0a32cca, 0x523db280), TOBN(0x5c889f8a, 0x50d43783), - TOBN(0x503e04b3, 0x4897d16f), TOBN(0x8cdb6e78, 0x08f5f2e8), - TOBN(0x6ab91cf0, 0x179c8e74), TOBN(0xd8874e52, 0x48211d60), - TOBN(0xf948d4d5, 0xea851200), TOBN(0x4076d41e, 0xe6f9840a), - TOBN(0xc20e263c, 0x47b517ea), TOBN(0x79a448fd, 0x30685e5e), - TOBN(0xe55f6f78, 0xf90631a0), TOBN(0x88a790b1, 0xa79e6346), - TOBN(0x62160c7d, 0x80969fe8), TOBN(0x54f92fd4, 0x41491bb9), - TOBN(0xa6645c23, 0x5c957526), TOBN(0xf44cc5ae, 0xbea3ce7b), - TOBN(0xf7628327, 0x8b1e68b7), TOBN(0xc731ad7a, 0x303f29d3), - TOBN(0xfe5a9ca9, 0x57d03ecb), TOBN(0x96c0d50c, 0x41bc97a7), - TOBN(0xc4669fe7, 0x9b4f7f24), TOBN(0xfdd781d8, 0x3d9967ef), - TOBN(0x7892c7c3, 0x5d2c208d), TOBN(0x8bf64f7c, 0xae545cb3), - TOBN(0xc01f862c, 0x467be912), TOBN(0xf4c85ee9, 0xc73d30cc), - TOBN(0x1fa6f4be, 0x6ab83ec7), TOBN(0xa07a3c1c, 0x4e3e3cf9), - TOBN(0x87f8ef45, 0x0c00beb3), TOBN(0x30e2c2b3, 0x000d4c3e), - TOBN(0x1aa00b94, 0xfe08bf5b), TOBN(0x32c133aa, 0x9224ef52), - TOBN(0x38df16bb, 0x32e5685d), TOBN(0x68a9e069, 0x58e6f544), - TOBN(0x495aaff7, 0xcdc5ebc6), TOBN(0xf894a645, 0x378b135f), - TOBN(0xf316350a, 0x09e27ecf), TOBN(0xeced201e, 0x58f7179d), - TOBN(0x2eec273c, 0xe97861ba), TOBN(0x47ec2cae, 0xd693be2e), - TOBN(0xfa4c97c4, 0xf68367ce), TOBN(0xe4f47d0b, 0xbe5a5755), - TOBN(0x17de815d, 0xb298a979), TOBN(0xd7eca659, 0xc177dc7d), - TOBN(0x20fdbb71, 0x49ded0a3), TOBN(0x4cb2aad4, 0xfb34d3c5), - TOBN(0x2cf31d28, 0x60858a33), TOBN(0x3b6873ef, 0xa24aa40f), - TOBN(0x540234b2, 0x2c11bb37), TOBN(0x2d0366dd, 0xed4c74a3), - TOBN(0xf9a968da, 0xeec5f25d), TOBN(0x36601068, 0x67b63142), - TOBN(0x07cd6d2c, 0x68d7b6d4), TOBN(0xa8f74f09, 0x0c842942), - TOBN(0xe2751404, 0x7768b1ee), TOBN(0x4b5f7e89, 0xfe62aee4), - TOBN(0xc6a77177, 0x89070d26), TOBN(0xa1f28e4e, 0xdd1c8bc7), - TOBN(0xea5f4f06, 0x469e1f17), TOBN(0x78fc242a, 0xfbdb78e0), - TOBN(0xc9c7c592, 0x8b0588f1), TOBN(0xb6b7a0fd, 0x1535921e), - TOBN(0xcc5bdb91, 0xbde5ae35), TOBN(0xb42c485e, 0x12ff1864), - TOBN(0xa1113e13, 0xdbab98aa), TOBN(0xde9d469b, 0xa17b1024), - TOBN(0x23f48b37, 0xc0462d3a), TOBN(0x3752e537, 0x7c5c078d), - TOBN(0xe3a86add, 0x15544eb9), TOBN(0xf013aea7, 0x80fba279), - TOBN(0x8b5bb76c, 0xf22001b5), TOBN(0xe617ba14, 0xf02891ab), - TOBN(0xd39182a6, 0x936219d3), TOBN(0x5ce1f194, 0xae51cb19), - TOBN(0xc78f8598, 0xbf07a74c), TOBN(0x6d7158f2, 0x22cbf1bc), - TOBN(0x3b846b21, 0xe300ce18), TOBN(0x35fba630, 0x2d11275d), - TOBN(0x5fe25c36, 0xa0239b9b), TOBN(0xd8beb35d, 0xdf05d940), - TOBN(0x4db02bb0, 0x1f7e320d), TOBN(0x0641c364, 0x6da320ea), - TOBN(0x6d95fa5d, 0x821389a3), TOBN(0x92699748, 0x8fcd8e3d), - TOBN(0x316fef17, 0xceb6c143), TOBN(0x67fcb841, 0xd933762b), - TOBN(0xbb837e35, 0x118b17f8), TOBN(0x4b92552f, 0x9fd24821), - TOBN(0xae6bc70e, 0x46aca793), TOBN(0x1cf0b0e4, 0xe579311b), - TOBN(0x8dc631be, 0x5802f716), TOBN(0x099bdc6f, 0xbddbee4d), - TOBN(0xcc352bb2, 0x0caf8b05), TOBN(0xf74d505a, 0x72d63df2), - TOBN(0xb9876d4b, 0x91c4f408), TOBN(0x1ce18473, 0x9e229b2d), - TOBN(0x49507597, 0x83abdb4a), TOBN(0x850fbcb6, 0xdee84b18), - TOBN(0x6325236e, 0x609e67dc), TOBN(0x04d831d9, 0x9336c6d8), - TOBN(0x8deaae3b, 0xfa12d45d), TOBN(0xe425f8ce, 0x4746e246), - TOBN(0x8004c175, 0x24f5f31e), TOBN(0xaca16d8f, 0xad62c3b7), - TOBN(0x0dc15a6a, 0x9152f934), TOBN(0xf1235e5d, 0xed0e12c1), - TOBN(0xc33c06ec, 0xda477dac), TOBN(0x76be8732, 0xb2ea0006), - TOBN(0xcf3f7831, 0x0c0cd313), TOBN(0x3c524553, 0xa614260d), - TOBN(0x31a756f8, 0xcab22d15), TOBN(0x03ee10d1, 0x77827a20), - TOBN(0xd1e059b2, 0x1994ef20), TOBN(0x2a653b69, 0x638ae318), - TOBN(0x70d5eb58, 0x2f699010), TOBN(0x279739f7, 0x09f5f84a), - TOBN(0x5da4663c, 0x8b799336), TOBN(0xfdfdf14d, 0x203c37eb), - TOBN(0x32d8a9dc, 0xa1dbfb2d), TOBN(0xab40cff0, 0x77d48f9b), - TOBN(0xc018b383, 0xd20b42d5), TOBN(0xf9a810ef, 0x9f78845f), - TOBN(0x40af3753, 0xbdba9df0), TOBN(0xb90bdcfc, 0x131dfdf9), - TOBN(0x18720591, 0xf01ab782), TOBN(0xc823f211, 0x6af12a88), - TOBN(0xa51b80f3, 0x0dc14401), TOBN(0xde248f77, 0xfb2dfbe3), - TOBN(0xef5a44e5, 0x0cafe751), TOBN(0x73997c9c, 0xd4dcd221), - TOBN(0x32fd86d1, 0xde854024), TOBN(0xd5b53adc, 0xa09b84bb), - TOBN(0x008d7a11, 0xdcedd8d1), TOBN(0x406bd1c8, 0x74b32c84), - TOBN(0x5d4472ff, 0x05dde8b1), TOBN(0x2e25f2cd, 0xfce2b32f), - TOBN(0xbec0dd5e, 0x29dfc254), TOBN(0x4455fcf6, 0x2b98b267), - TOBN(0x0b4d43a5, 0xc72df2ad), TOBN(0xea70e6be, 0x48a75397), - TOBN(0x2aad6169, 0x5820f3bf), TOBN(0xf410d2dd, 0x9e37f68f), - TOBN(0x70fb7dba, 0x7be5ac83), TOBN(0x636bb645, 0x36ec3eec), - TOBN(0x27104ea3, 0x9754e21c), TOBN(0xbc87a3e6, 0x8d63c373), - TOBN(0x483351d7, 0x4109db9a), TOBN(0x0fa724e3, 0x60134da7), - TOBN(0x9ff44c29, 0xb0720b16), TOBN(0x2dd0cf13, 0x06aceead), - TOBN(0x5942758c, 0xe26929a6), TOBN(0x96c5db92, 0xb766a92b), - TOBN(0xcec7d4c0, 0x5f18395e), TOBN(0xd3f22744, 0x1f80d032), - TOBN(0x7a68b37a, 0xcb86075b), TOBN(0x074764dd, 0xafef92db), - TOBN(0xded1e950, 0x7bc7f389), TOBN(0xc580c850, 0xb9756460), - TOBN(0xaeeec2a4, 0x7da48157), TOBN(0x3f0b4e7f, 0x82c587b3), - TOBN(0x231c6de8, 0xa9f19c53), TOBN(0x5717bd73, 0x6974e34e), - TOBN(0xd9e1d216, 0xf1508fa9), TOBN(0x9f112361, 0xdadaa124), - TOBN(0x80145e31, 0x823b7348), TOBN(0x4dd8f0d5, 0xac634069), - TOBN(0xe3d82fc7, 0x2297c258), TOBN(0x276fcfee, 0x9cee7431), - TOBN(0x8eb61b5e, 0x2bc0aea9), TOBN(0x4f668fd5, 0xde329431), - TOBN(0x03a32ab1, 0x38e4b87e), TOBN(0xe1374517, 0x73d0ef0b), - TOBN(0x1a46f7e6, 0x853ac983), TOBN(0xc3bdf42e, 0x68e78a57), - TOBN(0xacf20785, 0x2ea96dd1), TOBN(0xa10649b9, 0xf1638460), - TOBN(0xf2369f0b, 0x879fbbed), TOBN(0x0ff0ae86, 0xda9d1869), - TOBN(0x5251d759, 0x56766f45), TOBN(0x4984d8c0, 0x2be8d0fc), - TOBN(0x7ecc95a6, 0xd21008f0), TOBN(0x29bd54a0, 0x3a1a1c49), - TOBN(0xab9828c5, 0xd26c50f3), TOBN(0x32c0087c, 0x51d0d251), - TOBN(0x9bac3ce6, 0x0c1cdb26), TOBN(0xcd94d947, 0x557ca205), - TOBN(0x1b1bd598, 0x9db1fdcd), TOBN(0x0eda0108, 0xa3d8b149), - TOBN(0x95066610, 0x56152fcc), TOBN(0xc2f037e6, 0xe7192b33), - TOBN(0xdeffb41a, 0xc92e05a4), TOBN(0x1105f6c2, 0xc2f6c62e), - TOBN(0x68e73500, 0x8733913c), TOBN(0xcce86163, 0x3f3adc40), - TOBN(0xf407a942, 0x38a278e9), TOBN(0xd13c1b9d, 0x2ab21292), - TOBN(0x93ed7ec7, 0x1c74cf5c), TOBN(0x8887dc48, 0xf1a4c1b4), - TOBN(0x3830ff30, 0x4b3a11f1), TOBN(0x358c5a3c, 0x58937cb6), - TOBN(0x027dc404, 0x89022829), TOBN(0x40e93977, 0x3b798f79), - TOBN(0x90ad3337, 0x38be6ead), TOBN(0x9c23f6bc, 0xf34c0a5d), - TOBN(0xd1711a35, 0xfbffd8bb), TOBN(0x60fcfb49, 0x1949d3dd), - TOBN(0x09c8ef4b, 0x7825d93a), TOBN(0x24233cff, 0xa0a8c968), - TOBN(0x67ade46c, 0xe6d982af), TOBN(0xebb6bf3e, 0xe7544d7c), - TOBN(0xd6b9ba76, 0x3d8bd087), TOBN(0x46fe382d, 0x4dc61280), - TOBN(0xbd39a7e8, 0xb5bdbd75), TOBN(0xab381331, 0xb8f228fe), - TOBN(0x0709a77c, 0xce1c4300), TOBN(0x6a247e56, 0xf337ceac), - TOBN(0x8f34f21b, 0x636288be), TOBN(0x9dfdca74, 0xc8a7c305), - TOBN(0x6decfd1b, 0xea919e04), TOBN(0xcdf2688d, 0x8e1991f8), - TOBN(0xe607df44, 0xd0f8a67e), TOBN(0xd985df4b, 0x0b58d010), - TOBN(0x57f834c5, 0x0c24f8f4), TOBN(0xe976ef56, 0xa0bf01ae), - TOBN(0x536395ac, 0xa1c32373), TOBN(0x351027aa, 0x734c0a13), - TOBN(0xd2f1b5d6, 0x5e6bd5bc), TOBN(0x2b539e24, 0x223debed), - TOBN(0xd4994cec, 0x0eaa1d71), TOBN(0x2a83381d, 0x661dcf65), - TOBN(0x5f1aed2f, 0x7b54c740), TOBN(0x0bea3fa5, 0xd6dda5ee), - TOBN(0x9d4fb684, 0x36cc6134), TOBN(0x8eb9bbf3, 0xc0a443dd), - TOBN(0xfc500e2e, 0x383b7d2a), TOBN(0x7aad621c, 0x5b775257), - TOBN(0x69284d74, 0x0a8f7cc0), TOBN(0xe820c2ce, 0x07562d65), - TOBN(0xbf9531b9, 0x499758ee), TOBN(0x73e95ca5, 0x6ee0cc2d), - TOBN(0xf61790ab, 0xfbaf50a5), TOBN(0xdf55e76b, 0x684e0750), - TOBN(0xec516da7, 0xf176b005), TOBN(0x575553bb, 0x7a2dddc7), - TOBN(0x37c87ca3, 0x553afa73), TOBN(0x315f3ffc, 0x4d55c251), - TOBN(0xe846442a, 0xaf3e5d35), TOBN(0x61b91149, 0x6495ff28), - TOBN(0x23cc95d3, 0xfa326dc3), TOBN(0x1df4da1f, 0x18fc2cea), - TOBN(0x24bf9adc, 0xd0a37d59), TOBN(0xb6710053, 0x320d6e1e), - TOBN(0x96f9667e, 0x618344d1), TOBN(0xcc7ce042, 0xa06445af), - TOBN(0xa02d8514, 0xd68dbc3a), TOBN(0x4ea109e4, 0x280b5a5b), - TOBN(0x5741a7ac, 0xb40961bf), TOBN(0x4ada5937, 0x6aa56bfa), - TOBN(0x7feb9145, 0x02b765d1), TOBN(0x561e97be, 0xe6ad1582), - TOBN(0xbbc4a5b6, 0xda3982f5), TOBN(0x0c2659ed, 0xb546f468), - TOBN(0xb8e7e6aa, 0x59612d20), TOBN(0xd83dfe20, 0xac19e8e0), - TOBN(0x8530c45f, 0xb835398c), TOBN(0x6106a8bf, 0xb38a41c2), - TOBN(0x21e8f9a6, 0x35f5dcdb), TOBN(0x39707137, 0xcae498ed), - TOBN(0x70c23834, 0xd8249f00), TOBN(0x9f14b58f, 0xab2537a0), - TOBN(0xd043c365, 0x5f61c0c2), TOBN(0xdc5926d6, 0x09a194a7), - TOBN(0xddec0339, 0x8e77738a), TOBN(0xd07a63ef, 0xfba46426), - TOBN(0x2e58e79c, 0xee7f6e86), TOBN(0xe59b0459, 0xff32d241), - TOBN(0xc5ec84e5, 0x20fa0338), TOBN(0x97939ac8, 0xeaff5ace), - TOBN(0x0310a4e3, 0xb4a38313), TOBN(0x9115fba2, 0x8f9d9885), - TOBN(0x8dd710c2, 0x5fadf8c3), TOBN(0x66be38a2, 0xce19c0e2), - TOBN(0xd42a279c, 0x4cfe5022), TOBN(0x597bb530, 0x0e24e1b8), - TOBN(0x3cde86b7, 0xc153ca7f), TOBN(0xa8d30fb3, 0x707d63bd), - TOBN(0xac905f92, 0xbd60d21e), TOBN(0x98e7ffb6, 0x7b9a54ab), - TOBN(0xd7147df8, 0xe9726a30), TOBN(0xb5e216ff, 0xafce3533), - TOBN(0xb550b799, 0x2ff1ec40), TOBN(0x6b613b87, 0xa1e953fd), - TOBN(0x87b88dba, 0x792d5610), TOBN(0x2ee1270a, 0xa190fbe1), - TOBN(0x02f4e2dc, 0x2ef581da), TOBN(0x016530e4, 0xeff82a95), - TOBN(0xcbb93dfd, 0x8fd6ee89), TOBN(0x16d3d986, 0x46848fff), - TOBN(0x600eff24, 0x1da47adf), TOBN(0x1b9754a0, 0x0ad47a71), - TOBN(0x8f9266df, 0x70c33b98), TOBN(0xaadc87ae, 0xdf34186e), - TOBN(0x0d2ce8e1, 0x4ad24132), TOBN(0x8a47cbfc, 0x19946eba), - TOBN(0x47feeb66, 0x62b5f3af), TOBN(0xcefab561, 0x0abb3734), - TOBN(0x449de60e, 0x19f35cb1), TOBN(0x39f8db14, 0x157f0eb9), - TOBN(0xffaecc5b, 0x3c61bfd6), TOBN(0xa5a4d41d, 0x41216703), - TOBN(0x7f8fabed, 0x224e1cc2), TOBN(0x0d5a8186, 0x871ad953), - TOBN(0xf10774f7, 0xd22da9a9), TOBN(0x45b8a678, 0xcc8a9b0d), - TOBN(0xd9c2e722, 0xbdc32cff), TOBN(0xbf71b5f5, 0x337202a5), - TOBN(0x95c57f2f, 0x69fc4db9), TOBN(0xb6dad34c, 0x765d01e1), - TOBN(0x7e0bd13f, 0xcb904635), TOBN(0x61751253, 0x763a588c), - TOBN(0xd85c2997, 0x81af2c2d), TOBN(0xc0f7d9c4, 0x81b9d7da), - TOBN(0x838a34ae, 0x08533e8d), TOBN(0x15c4cb08, 0x311d8311), - TOBN(0x97f83285, 0x8e121e14), TOBN(0xeea7dc1e, 0x85000a5f), - TOBN(0x0c6059b6, 0x5d256274), TOBN(0xec9beace, 0xb95075c0), - TOBN(0x173daad7, 0x1df97828), TOBN(0xbf851cb5, 0xa8937877), - TOBN(0xb083c594, 0x01646f3c), TOBN(0x3bad30cf, 0x50c6d352), - TOBN(0xfeb2b202, 0x496bbcea), TOBN(0x3cf9fd4f, 0x18a1e8ba), - TOBN(0xd26de7ff, 0x1c066029), TOBN(0x39c81e9e, 0x4e9ed4f8), - TOBN(0xd8be0cb9, 0x7b390d35), TOBN(0x01df2bbd, 0x964aab27), - TOBN(0x3e8c1a65, 0xc3ef64f8), TOBN(0x567291d1, 0x716ed1dd), - TOBN(0x95499c6c, 0x5f5406d3), TOBN(0x71fdda39, 0x5ba8e23f), - TOBN(0xcfeb320e, 0xd5096ece), TOBN(0xbe7ba92b, 0xca66dd16), - TOBN(0x4608d36b, 0xc6fb5a7d), TOBN(0xe3eea15a, 0x6d2dd0e0), - TOBN(0x75b0a3eb, 0x8f97a36a), TOBN(0xf59814cc, 0x1c83de1e), - TOBN(0x56c9c5b0, 0x1c33c23f), TOBN(0xa96c1da4, 0x6faa4136), - TOBN(0x46bf2074, 0xde316551), TOBN(0x3b866e7b, 0x1f756c8f), - TOBN(0x727727d8, 0x1495ed6b), TOBN(0xb2394243, 0xb682dce7), - TOBN(0x8ab8454e, 0x758610f3), TOBN(0xc243ce84, 0x857d72a4), - TOBN(0x7b320d71, 0xdbbf370f), TOBN(0xff9afa37, 0x78e0f7ca), - TOBN(0x0119d1e0, 0xea7b523f), TOBN(0xb997f8cb, 0x058c7d42), - TOBN(0x285bcd2a, 0x37bbb184), TOBN(0x51dcec49, 0xa45d1fa6), - TOBN(0x6ade3b64, 0xe29634cb), TOBN(0x080c94a7, 0x26b86ef1), - TOBN(0xba583db1, 0x2283fbe3), TOBN(0x902bddc8, 0x5a9315ed), - TOBN(0x07c1ccb3, 0x86964bec), TOBN(0x78f4eacf, 0xb6258301), - TOBN(0x4bdf3a49, 0x56f90823), TOBN(0xba0f5080, 0x741d777b), - TOBN(0x091d71c3, 0xf38bf760), TOBN(0x9633d50f, 0x9b625b02), - TOBN(0x03ecb743, 0xb8c9de61), TOBN(0xb4751254, 0x5de74720), - TOBN(0x9f9defc9, 0x74ce1cb2), TOBN(0x774a4f6a, 0x00bd32ef), - TOBN(0xaca385f7, 0x73848f22), TOBN(0x53dad716, 0xf3f8558e), - TOBN(0xab7b34b0, 0x93c471f9), TOBN(0xf530e069, 0x19644bc7), - TOBN(0x3d9fb1ff, 0xdd59d31a), TOBN(0x4382e0df, 0x08daa795), - TOBN(0x165c6f4b, 0xd5cc88d7), TOBN(0xeaa392d5, 0x4a18c900), - TOBN(0x94203c67, 0x648024ee), TOBN(0x188763f2, 0x8c2fabcd), - TOBN(0xa80f87ac, 0xbbaec835), TOBN(0x632c96e0, 0xf29d8d54), - TOBN(0x29b0a60e, 0x4c00a95e), TOBN(0x2ef17f40, 0xe011e9fa), - TOBN(0xf6c0e1d1, 0x15b77223), TOBN(0xaaec2c62, 0x14b04e32), - TOBN(0xd35688d8, 0x3d84e58c), TOBN(0x2af5094c, 0x958571db), - TOBN(0x4fff7e19, 0x760682a6), TOBN(0x4cb27077, 0xe39a407c), - TOBN(0x0f59c547, 0x4ff0e321), TOBN(0x169f34a6, 0x1b34c8ff), - TOBN(0x2bff1096, 0x52bc1ba7), TOBN(0xa25423b7, 0x83583544), - TOBN(0x5d55d5d5, 0x0ac8b782), TOBN(0xff6622ec, 0x2db3c892), - TOBN(0x48fce741, 0x6b8bb642), TOBN(0x31d6998c, 0x69d7e3dc), - TOBN(0xdbaf8004, 0xcadcaed0), TOBN(0x801b0142, 0xd81d053c), - TOBN(0x94b189fc, 0x59630ec6), TOBN(0x120e9934, 0xaf762c8e), - TOBN(0x53a29aa4, 0xfdc6a404), TOBN(0x19d8e01e, 0xa1909948), - TOBN(0x3cfcabf1, 0xd7e89681), TOBN(0x3321a50d, 0x4e132d37), - TOBN(0xd0496863, 0xe9a86111), TOBN(0x8c0cde61, 0x06a3bc65), - TOBN(0xaf866c49, 0xfc9f8eef), TOBN(0x2066350e, 0xff7f5141), - TOBN(0x4f8a4689, 0xe56ddfbd), TOBN(0xea1b0c07, 0xfe32983a), - TOBN(0x2b317462, 0x873cb8cb), TOBN(0x658deddc, 0x2d93229f), - TOBN(0x65efaf4d, 0x0f64ef58), TOBN(0xfe43287d, 0x730cc7a8), - TOBN(0xaebc0c72, 0x3d047d70), TOBN(0x92efa539, 0xd92d26c9), - TOBN(0x06e78457, 0x94b56526), TOBN(0x415cb80f, 0x0961002d), - TOBN(0x89e5c565, 0x76dcb10f), TOBN(0x8bbb6982, 0xff9259fe), - TOBN(0x4fe8795b, 0x9abc2668), TOBN(0xb5d4f534, 0x1e678fb1), - TOBN(0x6601f3be, 0x7b7da2b9), TOBN(0x98da59e2, 0xa13d6805), - TOBN(0x190d8ea6, 0x01799a52), TOBN(0xa20cec41, 0xb86d2952), - TOBN(0x3062ffb2, 0x7fff2a7c), TOBN(0x741b32e5, 0x79f19d37), - TOBN(0xf80d8181, 0x4eb57d47), TOBN(0x7a2d0ed4, 0x16aef06b), - TOBN(0x09735fb0, 0x1cecb588), TOBN(0x1641caaa, 0xc6061f5b)}, - {TOBN(0x7f99824f, 0x20151427), TOBN(0x206828b6, 0x92430206), - TOBN(0xaa9097d7, 0xe1112357), TOBN(0xacf9a2f2, 0x09e414ec), - TOBN(0xdbdac9da, 0x27915356), TOBN(0x7e0734b7, 0x001efee3), - TOBN(0x54fab5bb, 0xd2b288e2), TOBN(0x4c630fc4, 0xf62dd09c), - TOBN(0x8537107a, 0x1ac2703b), TOBN(0xb49258d8, 0x6bc857b5), - TOBN(0x57df14de, 0xbcdaccd1), TOBN(0x24ab68d7, 0xc4ae8529), - TOBN(0x7ed8b5d4, 0x734e59d0), TOBN(0x5f8740c8, 0xc495cc80), - TOBN(0x84aedd5a, 0x291db9b3), TOBN(0x80b360f8, 0x4fb995be), - TOBN(0xae915f5d, 0x5fa067d1), TOBN(0x4134b57f, 0x9668960c), - TOBN(0xbd3656d6, 0xa48edaac), TOBN(0xdac1e3e4, 0xfc1d7436), - TOBN(0x674ff869, 0xd81fbb26), TOBN(0x449ed3ec, 0xb26c33d4), - TOBN(0x85138705, 0xd94203e8), TOBN(0xccde538b, 0xbeeb6f4a), - TOBN(0x55d5c68d, 0xa61a76fa), TOBN(0x598b441d, 0xca1554dc), - TOBN(0xd39923b9, 0x773b279c), TOBN(0x33331d3c, 0x36bf9efc), - TOBN(0x2d4c848e, 0x298de399), TOBN(0xcfdb8e77, 0xa1a27f56), - TOBN(0x94c855ea, 0x57b8ab70), TOBN(0xdcdb9dae, 0x6f7879ba), - TOBN(0x7bdff8c2, 0x019f2a59), TOBN(0xb3ce5bb3, 0xcb4fbc74), - TOBN(0xea907f68, 0x8a9173dd), TOBN(0x6cd3d0d3, 0x95a75439), - TOBN(0x92ecc4d6, 0xefed021c), TOBN(0x09a9f9b0, 0x6a77339a), - TOBN(0x87ca6b15, 0x7188c64a), TOBN(0x10c29968, 0x44899158), - TOBN(0x5859a229, 0xed6e82ef), TOBN(0x16f338e3, 0x65ebaf4e), - TOBN(0x0cd31387, 0x5ead67ae), TOBN(0x1c73d228, 0x54ef0bb4), - TOBN(0x4cb55131, 0x74a5c8c7), TOBN(0x01cd2970, 0x7f69ad6a), - TOBN(0xa04d00dd, 0xe966f87e), TOBN(0xd96fe447, 0x0b7b0321), - TOBN(0x342ac06e, 0x88fbd381), TOBN(0x02cd4a84, 0x5c35a493), - TOBN(0xe8fa89de, 0x54f1bbcd), TOBN(0x341d6367, 0x2575ed4c), - TOBN(0xebe357fb, 0xd238202b), TOBN(0x600b4d1a, 0xa984ead9), - TOBN(0xc35c9f44, 0x52436ea0), TOBN(0x96fe0a39, 0xa370751b), - TOBN(0x4c4f0736, 0x7f636a38), TOBN(0x9f943fb7, 0x0e76d5cb), - TOBN(0xb03510ba, 0xa8b68b8b), TOBN(0xc246780a, 0x9ed07a1f), - TOBN(0x3c051415, 0x6d549fc2), TOBN(0xc2953f31, 0x607781ca), - TOBN(0x955e2c69, 0xd8d95413), TOBN(0xb300fadc, 0x7bd282e3), - TOBN(0x81fe7b50, 0x87e9189f), TOBN(0xdb17375c, 0xf42dda27), - TOBN(0x22f7d896, 0xcf0a5904), TOBN(0xa0e57c5a, 0xebe348e6), - TOBN(0xa61011d3, 0xf40e3c80), TOBN(0xb1189321, 0x8db705c5), - TOBN(0x4ed9309e, 0x50fedec3), TOBN(0xdcf14a10, 0x4d6d5c1d), - TOBN(0x056c265b, 0x55691342), TOBN(0xe8e08504, 0x91049dc7), - TOBN(0x131329f5, 0xc9bae20a), TOBN(0x96c8b3e8, 0xd9dccdb4), - TOBN(0x8c5ff838, 0xfb4ee6b4), TOBN(0xfc5a9aeb, 0x41e8ccf0), - TOBN(0x7417b764, 0xfae050c6), TOBN(0x0953c3d7, 0x00452080), - TOBN(0x21372682, 0x38dfe7e8), TOBN(0xea417e15, 0x2bb79d4b), - TOBN(0x59641f1c, 0x76e7cf2d), TOBN(0x271e3059, 0xea0bcfcc), - TOBN(0x624c7dfd, 0x7253ecbd), TOBN(0x2f552e25, 0x4fca6186), - TOBN(0xcbf84ecd, 0x4d866e9c), TOBN(0x73967709, 0xf68d4610), - TOBN(0xa14b1163, 0xc27901b4), TOBN(0xfd9236e0, 0x899b8bf3), - TOBN(0x42b091ec, 0xcbc6da0a), TOBN(0xbb1dac6f, 0x5ad1d297), - TOBN(0x80e61d53, 0xa91cf76e), TOBN(0x4110a412, 0xd31f1ee7), - TOBN(0x2d87c3ba, 0x13efcf77), TOBN(0x1f374bb4, 0xdf450d76), - TOBN(0x5e78e2f2, 0x0d188dab), TOBN(0xe3968ed0, 0xf4b885ef), - TOBN(0x46c0568e, 0x7314570f), TOBN(0x31616338, 0x01170521), - TOBN(0x18e1e7e2, 0x4f0c8afe), TOBN(0x4caa75ff, 0xdeea78da), - TOBN(0x82db67f2, 0x7c5d8a51), TOBN(0x36a44d86, 0x6f505370), - TOBN(0xd72c5bda, 0x0333974f), TOBN(0x5db516ae, 0x27a70146), - TOBN(0x34705281, 0x210ef921), TOBN(0xbff17a8f, 0x0c9c38e5), - TOBN(0x78f4814e, 0x12476da1), TOBN(0xc1e16613, 0x33c16980), - TOBN(0x9e5b386f, 0x424d4bca), TOBN(0x4c274e87, 0xc85740de), - TOBN(0xb6a9b88d, 0x6c2f5226), TOBN(0x14d1b944, 0x550d7ca8), - TOBN(0x580c85fc, 0x1fc41709), TOBN(0xc1da368b, 0x54c6d519), - TOBN(0x2b0785ce, 0xd5113cf7), TOBN(0x0670f633, 0x5a34708f), - TOBN(0x46e23767, 0x15cc3f88), TOBN(0x1b480cfa, 0x50c72c8f), - TOBN(0x20288602, 0x4147519a), TOBN(0xd0981eac, 0x26b372f0), - TOBN(0xa9d4a7ca, 0xa785ebc8), TOBN(0xd953c50d, 0xdbdf58e9), - TOBN(0x9d6361cc, 0xfd590f8f), TOBN(0x72e9626b, 0x44e6c917), - TOBN(0x7fd96110, 0x22eb64cf), TOBN(0x863ebb7e, 0x9eb288f3), - TOBN(0x6e6ab761, 0x6aca8ee7), TOBN(0x97d10b39, 0xd7b40358), - TOBN(0x1687d377, 0x1e5feb0d), TOBN(0xc83e50e4, 0x8265a27a), - TOBN(0x8f75a9fe, 0xc954b313), TOBN(0xcc2e8f47, 0x310d1f61), - TOBN(0xf5ba81c5, 0x6557d0e0), TOBN(0x25f9680c, 0x3eaf6207), - TOBN(0xf95c6609, 0x4354080b), TOBN(0x5225bfa5, 0x7bf2fe1c), - TOBN(0xc5c004e2, 0x5c7d98fa), TOBN(0x3561bf1c, 0x019aaf60), - TOBN(0x5e6f9f17, 0xba151474), TOBN(0xdec2f934, 0xb04f6eca), - TOBN(0x64e368a1, 0x269acb1e), TOBN(0x1332d9e4, 0x0cdda493), - TOBN(0x60d6cf69, 0xdf23de05), TOBN(0x66d17da2, 0x009339a0), - TOBN(0x9fcac985, 0x0a693923), TOBN(0xbcf057fc, 0xed7c6a6d), - TOBN(0xc3c5c8c5, 0xf0b5662c), TOBN(0x25318dd8, 0xdcba4f24), - TOBN(0x60e8cb75, 0x082b69ff), TOBN(0x7c23b3ee, 0x1e728c01), - TOBN(0x15e10a0a, 0x097e4403), TOBN(0xcb3d0a86, 0x19854665), - TOBN(0x88d8e211, 0xd67d4826), TOBN(0xb39af66e, 0x0b9d2839), - TOBN(0xa5f94588, 0xbd475ca8), TOBN(0xe06b7966, 0xc077b80b), - TOBN(0xfedb1485, 0xda27c26c), TOBN(0xd290d33a, 0xfe0fd5e0), - TOBN(0xa40bcc47, 0xf34fb0fa), TOBN(0xb4760cc8, 0x1fb1ab09), - TOBN(0x8fca0993, 0xa273bfe3), TOBN(0x13e4fe07, 0xf70b213c), - TOBN(0x3bcdb992, 0xfdb05163), TOBN(0x8c484b11, 0x0c2b19b6), - TOBN(0x1acb815f, 0xaaf2e3e2), TOBN(0xc6905935, 0xb89ff1b4), - TOBN(0xb2ad6f9d, 0x586e74e1), TOBN(0x488883ad, 0x67b80484), - TOBN(0x758aa2c7, 0x369c3ddb), TOBN(0x8ab74e69, 0x9f9afd31), - TOBN(0x10fc2d28, 0x5e21beb1), TOBN(0x3484518a, 0x318c42f9), - TOBN(0x377427dc, 0x53cf40c3), TOBN(0x9de0781a, 0x391bc1d9), - TOBN(0x8faee858, 0x693807e1), TOBN(0xa3865327, 0x4e81ccc7), - TOBN(0x02c30ff2, 0x6f835b84), TOBN(0xb604437b, 0x0d3d38d4), - TOBN(0xb3fc8a98, 0x5ca1823d), TOBN(0xb82f7ec9, 0x03be0324), - TOBN(0xee36d761, 0xcf684a33), TOBN(0x5a01df0e, 0x9f29bf7d), - TOBN(0x686202f3, 0x1306583d), TOBN(0x05b10da0, 0x437c622e), - TOBN(0xbf9aaa0f, 0x076a7bc8), TOBN(0x25e94efb, 0x8f8f4e43), - TOBN(0x8a35c9b7, 0xfa3dc26d), TOBN(0xe0e5fb93, 0x96ff03c5), - TOBN(0xa77e3843, 0xebc394ce), TOBN(0xcede6595, 0x8361de60), - TOBN(0xd27c22f6, 0xa1993545), TOBN(0xab01cc36, 0x24d671ba), - TOBN(0x63fa2877, 0xa169c28e), TOBN(0x925ef904, 0x2eb08376), - TOBN(0x3b2fa3cf, 0x53aa0b32), TOBN(0xb27beb5b, 0x71c49d7a), - TOBN(0xb60e1834, 0xd105e27f), TOBN(0xd6089788, 0x4f68570d), - TOBN(0x23094ce0, 0xd6fbc2ac), TOBN(0x738037a1, 0x815ff551), - TOBN(0xda73b1bb, 0x6bef119c), TOBN(0xdcf6c430, 0xeef506ba), - TOBN(0x00e4fe7b, 0xe3ef104a), TOBN(0xebdd9a2c, 0x0a065628), - TOBN(0x853a81c3, 0x8792043e), TOBN(0x22ad6ece, 0xb3b59108), - TOBN(0x9fb813c0, 0x39cd297d), TOBN(0x8ec7e16e, 0x05bda5d9), - TOBN(0x2834797c, 0x0d104b96), TOBN(0xcc11a2e7, 0x7c511510), - TOBN(0x96ca5a53, 0x96ee6380), TOBN(0x054c8655, 0xcea38742), - TOBN(0xb5946852, 0xd54dfa7d), TOBN(0x97c422e7, 0x1f4ab207), - TOBN(0xbf907509, 0x0c22b540), TOBN(0x2cde42aa, 0xb7c267d4), - TOBN(0xba18f9ed, 0x5ab0d693), TOBN(0x3ba62aa6, 0x6e4660d9), - TOBN(0xb24bf97b, 0xab9ea96a), TOBN(0x5d039642, 0xe3b60e32), - TOBN(0x4e6a4506, 0x7c4d9bd5), TOBN(0x666c5b9e, 0x7ed4a6a4), - TOBN(0xfa3fdcd9, 0x8edbd7cc), TOBN(0x4660bb87, 0xc6ccd753), - TOBN(0x9ae90820, 0x21e6b64f), TOBN(0x8a56a713, 0xb36bfb3f), - TOBN(0xabfce096, 0x5726d47f), TOBN(0x9eed01b2, 0x0b1a9a7f), - TOBN(0x30e9cad4, 0x4eb74a37), TOBN(0x7b2524cc, 0x53e9666d), - TOBN(0x6a29683b, 0x8f4b002f), TOBN(0xc2200d7a, 0x41f4fc20), - TOBN(0xcf3af47a, 0x3a338acc), TOBN(0x6539a4fb, 0xe7128975), - TOBN(0xcec31c14, 0xc33c7fcf), TOBN(0x7eb6799b, 0xc7be322b), - TOBN(0x119ef4e9, 0x6646f623), TOBN(0x7b7a26a5, 0x54d7299b), - TOBN(0xcb37f08d, 0x403f46f2), TOBN(0x94b8fc43, 0x1a0ec0c7), - TOBN(0xbb8514e3, 0xc332142f), TOBN(0xf3ed2c33, 0xe80d2a7a), - TOBN(0x8d2080af, 0xb639126c), TOBN(0xf7b6be60, 0xe3553ade), - TOBN(0x3950aa9f, 0x1c7e2b09), TOBN(0x847ff958, 0x6410f02b), - TOBN(0x877b7cf5, 0x678a31b0), TOBN(0xd50301ae, 0x3998b620), - TOBN(0x734257c5, 0xc00fb396), TOBN(0xf9fb18a0, 0x04e672a6), - TOBN(0xff8bd8eb, 0xe8758851), TOBN(0x1e64e4c6, 0x5d99ba44), - TOBN(0x4b8eaedf, 0x7dfd93b7), TOBN(0xba2f2a98, 0x04e76b8c), - TOBN(0x7d790cba, 0xe8053433), TOBN(0xc8e725a0, 0x3d2c9585), - TOBN(0x58c5c476, 0xcdd8f5ed), TOBN(0xd106b952, 0xefa9fe1d), - TOBN(0x3c5c775b, 0x0eff13a9), TOBN(0x242442ba, 0xe057b930), - TOBN(0xe9f458d4, 0xc9b70cbd), TOBN(0x69b71448, 0xa3cdb89a), - TOBN(0x41ee46f6, 0x0e2ed742), TOBN(0x573f1045, 0x40067493), - TOBN(0xb1e154ff, 0x9d54c304), TOBN(0x2ad0436a, 0x8d3a7502), - TOBN(0xee4aaa2d, 0x431a8121), TOBN(0xcd38b3ab, 0x886f11ed), - TOBN(0x57d49ea6, 0x034a0eb7), TOBN(0xd2b773bd, 0xf7e85e58), - TOBN(0x4a559ac4, 0x9b5c1f14), TOBN(0xc444be1a, 0x3e54df2b), - TOBN(0x13aad704, 0xeda41891), TOBN(0xcd927bec, 0x5eb5c788), - TOBN(0xeb3c8516, 0xe48c8a34), TOBN(0x1b7ac812, 0x4b546669), - TOBN(0x1815f896, 0x594df8ec), TOBN(0x87c6a79c, 0x79227865), - TOBN(0xae02a2f0, 0x9b56ddbd), TOBN(0x1339b5ac, 0x8a2f1cf3), - TOBN(0xf2b569c7, 0x839dff0d), TOBN(0xb0b9e864, 0xfee9a43d), - TOBN(0x4ff8ca41, 0x77bb064e), TOBN(0x145a2812, 0xfd249f63), - TOBN(0x3ab7beac, 0xf86f689a), TOBN(0x9bafec27, 0x01d35f5e), - TOBN(0x28054c65, 0x4265aa91), TOBN(0xa4b18304, 0x035efe42), - TOBN(0x6887b0e6, 0x9639dec7), TOBN(0xf4b8f6ad, 0x3d52aea5), - TOBN(0xfb9293cc, 0x971a8a13), TOBN(0x3f159e5d, 0x4c934d07), - TOBN(0x2c50e9b1, 0x09acbc29), TOBN(0x08eb65e6, 0x7154d129), - TOBN(0x4feff589, 0x30b75c3e), TOBN(0x0bb82fe2, 0x94491c93), - TOBN(0xd8ac377a, 0x89af62bb), TOBN(0xd7b51490, 0x9685e49f), - TOBN(0xabca9a7b, 0x04497f19), TOBN(0x1b35ed0a, 0x1a7ad13f), - TOBN(0x6b601e21, 0x3ec86ed6), TOBN(0xda91fcb9, 0xce0c76f1), - TOBN(0x9e28507b, 0xd7ab27e1), TOBN(0x7c19a555, 0x63945b7b), - TOBN(0x6b43f0a1, 0xaafc9827), TOBN(0x443b4fbd, 0x3aa55b91), - TOBN(0x962b2e65, 0x6962c88f), TOBN(0x139da8d4, 0xce0db0ca), - TOBN(0xb93f05dd, 0x1b8d6c4f), TOBN(0x779cdff7, 0x180b9824), - TOBN(0xbba23fdd, 0xae57c7b7), TOBN(0x345342f2, 0x1b932522), - TOBN(0xfd9c80fe, 0x556d4aa3), TOBN(0xa03907ba, 0x6525bb61), - TOBN(0x38b010e1, 0xff218933), TOBN(0xc066b654, 0xaa52117b), - TOBN(0x8e141920, 0x94f2e6ea), TOBN(0x66a27dca, 0x0d32f2b2), - TOBN(0x69c7f993, 0x048b3717), TOBN(0xbf5a989a, 0xb178ae1c), - TOBN(0x49fa9058, 0x564f1d6b), TOBN(0x27ec6e15, 0xd31fde4e), - TOBN(0x4cce0373, 0x7276e7fc), TOBN(0x64086d79, 0x89d6bf02), - TOBN(0x5a72f046, 0x4ccdd979), TOBN(0x909c3566, 0x47775631), - TOBN(0x1c07bc6b, 0x75dd7125), TOBN(0xb4c6bc97, 0x87a0428d), - TOBN(0x507ece52, 0xfdeb6b9d), TOBN(0xfca56512, 0xb2c95432), - TOBN(0x15d97181, 0xd0e8bd06), TOBN(0x384dd317, 0xc6bb46ea), - TOBN(0x5441ea20, 0x3952b624), TOBN(0xbcf70dee, 0x4e7dc2fb), - TOBN(0x372b016e, 0x6628e8c3), TOBN(0x07a0d667, 0xb60a7522), - TOBN(0xcf05751b, 0x0a344ee2), TOBN(0x0ec09a48, 0x118bdeec), - TOBN(0x6e4b3d4e, 0xd83dce46), TOBN(0x43a6316d, 0x99d2fc6e), - TOBN(0xa99d8989, 0x56cf044c), TOBN(0x7c7f4454, 0xae3e5fb7), - TOBN(0xb2e6b121, 0xfbabbe92), TOBN(0x281850fb, 0xe1330076), - TOBN(0x093581ec, 0x97890015), TOBN(0x69b1dded, 0x75ff77f5), - TOBN(0x7cf0b18f, 0xab105105), TOBN(0x953ced31, 0xa89ccfef), - TOBN(0x3151f85f, 0xeb914009), TOBN(0x3c9f1b87, 0x88ed48ad), - TOBN(0xc9aba1a1, 0x4a7eadcb), TOBN(0x928e7501, 0x522e71cf), - TOBN(0xeaede727, 0x3a2e4f83), TOBN(0x467e10d1, 0x1ce3bbd3), - TOBN(0xf3442ac3, 0xb955dcf0), TOBN(0xba96307d, 0xd3d5e527), - TOBN(0xf763a10e, 0xfd77f474), TOBN(0x5d744bd0, 0x6a6e1ff0), - TOBN(0xd287282a, 0xa777899e), TOBN(0xe20eda8f, 0xd03f3cde), - TOBN(0x6a7e75bb, 0x50b07d31), TOBN(0x0b7e2a94, 0x6f379de4), - TOBN(0x31cb64ad, 0x19f593cf), TOBN(0x7b1a9e4f, 0x1e76ef1d), - TOBN(0xe18c9c9d, 0xb62d609c), TOBN(0x439bad6d, 0xe779a650), - TOBN(0x219d9066, 0xe032f144), TOBN(0x1db632b8, 0xe8b2ec6a), - TOBN(0xff0d0fd4, 0xfda12f78), TOBN(0x56fb4c2d, 0x2a25d265), - TOBN(0x5f4e2ee1, 0x255a03f1), TOBN(0x61cd6af2, 0xe96af176), - TOBN(0xe0317ba8, 0xd068bc97), TOBN(0x927d6bab, 0x264b988e), - TOBN(0xa18f07e0, 0xe90fb21e), TOBN(0x00fd2b80, 0xbba7fca1), - TOBN(0x20387f27, 0x95cd67b5), TOBN(0x5b89a4e7, 0xd39707f7), - TOBN(0x8f83ad3f, 0x894407ce), TOBN(0xa0025b94, 0x6c226132), - TOBN(0xc79563c7, 0xf906c13b), TOBN(0x5f548f31, 0x4e7bb025), - TOBN(0x2b4c6b8f, 0xeac6d113), TOBN(0xa67e3f9c, 0x0e813c76), - TOBN(0x3982717c, 0x3fe1f4b9), TOBN(0x58865819, 0x26d8050e), - TOBN(0x99f3640c, 0xf7f06f20), TOBN(0xdc610216, 0x2a66ebc2), - TOBN(0x52f2c175, 0x767a1e08), TOBN(0x05660e1a, 0x5999871b), - TOBN(0x6b0f1762, 0x6d3c4693), TOBN(0xf0e7d627, 0x37ed7bea), - TOBN(0xc51758c7, 0xb75b226d), TOBN(0x40a88628, 0x1f91613b), - TOBN(0x889dbaa7, 0xbbb38ce0), TOBN(0xe0404b65, 0xbddcad81), - TOBN(0xfebccd3a, 0x8bc9671f), TOBN(0xfbf9a357, 0xee1f5375), - TOBN(0x5dc169b0, 0x28f33398), TOBN(0xb07ec11d, 0x72e90f65), - TOBN(0xae7f3b4a, 0xfaab1eb1), TOBN(0xd970195e, 0x5f17538a), - TOBN(0x52b05cbe, 0x0181e640), TOBN(0xf5debd62, 0x2643313d), - TOBN(0x76148154, 0x5df31f82), TOBN(0x23e03b33, 0x3a9e13c5), - TOBN(0xff758949, 0x4fde0c1f), TOBN(0xbf8a1abe, 0xe5b6ec20), - TOBN(0x702278fb, 0x87e1db6c), TOBN(0xc447ad7a, 0x35ed658f), - TOBN(0x48d4aa38, 0x03d0ccf2), TOBN(0x80acb338, 0x819a7c03), - TOBN(0x9bc7c89e, 0x6e17cecc), TOBN(0x46736b8b, 0x03be1d82), - TOBN(0xd65d7b60, 0xc0432f96), TOBN(0xddebe7a3, 0xdeb5442f), - TOBN(0x79a25307, 0x7dff69a2), TOBN(0x37a56d94, 0x02cf3122), - TOBN(0x8bab8aed, 0xf2350d0a), TOBN(0x13c3f276, 0x037b0d9a), - TOBN(0xc664957c, 0x44c65cae), TOBN(0x88b44089, 0xc2e71a88), - TOBN(0xdb88e5a3, 0x5cb02664), TOBN(0x5d4c0bf1, 0x8686c72e), - TOBN(0xea3d9b62, 0xa682d53e), TOBN(0x9b605ef4, 0x0b2ad431), - TOBN(0x71bac202, 0xc69645d0), TOBN(0xa115f03a, 0x6a1b66e7), - TOBN(0xfe2c563a, 0x158f4dc4), TOBN(0xf715b3a0, 0x4d12a78c), - TOBN(0x8f7f0a48, 0xd413213a), TOBN(0x2035806d, 0xc04becdb), - TOBN(0xecd34a99, 0x5d8587f5), TOBN(0x4d8c3079, 0x9f6d3a71), - TOBN(0x1b2a2a67, 0x8d95a8f6), TOBN(0xc58c9d7d, 0xf2110d0d), - TOBN(0xdeee81d5, 0xcf8fba3f), TOBN(0xa42be3c0, 0x0c7cdf68), - TOBN(0x2126f742, 0xd43b5eaa), TOBN(0x054a0766, 0xdfa59b85), - TOBN(0x9d0d5e36, 0x126bfd45), TOBN(0xa1f8fbd7, 0x384f8a8f), - TOBN(0x317680f5, 0xd563fccc), TOBN(0x48ca5055, 0xf280a928), - TOBN(0xe00b81b2, 0x27b578cf), TOBN(0x10aad918, 0x2994a514), - TOBN(0xd9e07b62, 0xb7bdc953), TOBN(0x9f0f6ff2, 0x5bc086dd), - TOBN(0x09d1ccff, 0x655eee77), TOBN(0x45475f79, 0x5bef7df1), - TOBN(0x3faa28fa, 0x86f702cc), TOBN(0x92e60905, 0x0f021f07), - TOBN(0xe9e62968, 0x7f8fa8c6), TOBN(0xbd71419a, 0xf036ea2c), - TOBN(0x171ee1cc, 0x6028da9a), TOBN(0x5352fe1a, 0xc251f573), - TOBN(0xf8ff236e, 0x3fa997f4), TOBN(0xd831b6c9, 0xa5749d5f), - TOBN(0x7c872e1d, 0xe350e2c2), TOBN(0xc56240d9, 0x1e0ce403), - TOBN(0xf9deb077, 0x6974f5cb), TOBN(0x7d50ba87, 0x961c3728), - TOBN(0xd6f89426, 0x5a3a2518), TOBN(0xcf817799, 0xc6303d43), - TOBN(0x510a0471, 0x619e5696), TOBN(0xab049ff6, 0x3a5e307b), - TOBN(0xe4cdf9b0, 0xfeb13ec7), TOBN(0xd5e97117, 0x9d8ff90c), - TOBN(0xf6f64d06, 0x9afa96af), TOBN(0x00d0bf5e, 0x9d2012a2), - TOBN(0xe63f301f, 0x358bcdc0), TOBN(0x07689e99, 0x0a9d47f8), - TOBN(0x1f689e2f, 0x4f43d43a), TOBN(0x4d542a16, 0x90920904), - TOBN(0xaea293d5, 0x9ca0a707), TOBN(0xd061fe45, 0x8ac68065), - TOBN(0x1033bf1b, 0x0090008c), TOBN(0x29749558, 0xc08a6db6), - TOBN(0x74b5fc59, 0xc1d5d034), TOBN(0xf712e9f6, 0x67e215e0), - TOBN(0xfd520cbd, 0x860200e6), TOBN(0x0229acb4, 0x3ea22588), - TOBN(0x9cd1e14c, 0xfff0c82e), TOBN(0x87684b62, 0x59c69e73), - TOBN(0xda85e61c, 0x96ccb989), TOBN(0x2d5dbb02, 0xa3d06493), - TOBN(0xf22ad33a, 0xe86b173c), TOBN(0xe8e41ea5, 0xa79ff0e3), - TOBN(0x01d2d725, 0xdd0d0c10), TOBN(0x31f39088, 0x032d28f9), - TOBN(0x7b3f71e1, 0x7829839e), TOBN(0x0cf691b4, 0x4502ae58), - TOBN(0xef658dbd, 0xbefc6115), TOBN(0xa5cd6ee5, 0xb3ab5314), - TOBN(0x206c8d7b, 0x5f1d2347), TOBN(0x794645ba, 0x4cc2253a), - TOBN(0xd517d8ff, 0x58389e08), TOBN(0x4fa20dee, 0x9f847288), - TOBN(0xeba072d8, 0xd797770a), TOBN(0x7360c91d, 0xbf429e26), - TOBN(0x7200a3b3, 0x80af8279), TOBN(0x6a1c9150, 0x82dadce3), - TOBN(0x0ee6d3a7, 0xc35d8794), TOBN(0x042e6558, 0x0356bae5), - TOBN(0x9f59698d, 0x643322fd), TOBN(0x9379ae15, 0x50a61967), - TOBN(0x64b9ae62, 0xfcc9981e), TOBN(0xaed3d631, 0x6d2934c6), - TOBN(0x2454b302, 0x5e4e65eb), TOBN(0xab09f647, 0xf9950428)}, - {TOBN(0xb2083a12, 0x22248acc), TOBN(0x1f6ec0ef, 0x3264e366), - TOBN(0x5659b704, 0x5afdee28), TOBN(0x7a823a40, 0xe6430bb5), - TOBN(0x24592a04, 0xe1900a79), TOBN(0xcde09d4a, 0xc9ee6576), - TOBN(0x52b6463f, 0x4b5ea54a), TOBN(0x1efe9ed3, 0xd3ca65a7), - TOBN(0xe27a6dbe, 0x305406dd), TOBN(0x8eb7dc7f, 0xdd5d1957), - TOBN(0xf54a6876, 0x387d4d8f), TOBN(0x9c479409, 0xc7762de4), - TOBN(0xbe4d5b5d, 0x99b30778), TOBN(0x25380c56, 0x6e793682), - TOBN(0x602d37f3, 0xdac740e3), TOBN(0x140deabe, 0x1566e4ae), - TOBN(0x4481d067, 0xafd32acf), TOBN(0xd8f0fcca, 0xe1f71ccf), - TOBN(0xd208dd0c, 0xb596f2da), TOBN(0xd049d730, 0x9aad93f9), - TOBN(0xc79f263d, 0x42ab580e), TOBN(0x09411bb1, 0x23f707b4), - TOBN(0x8cfde1ff, 0x835e0eda), TOBN(0x72707490, 0x90f03402), - TOBN(0xeaee6126, 0xc49a861e), TOBN(0x024f3b65, 0xe14f0d06), - TOBN(0x51a3f1e8, 0xc69bfc17), TOBN(0xc3c3a8e9, 0xa7686381), - TOBN(0x3400752c, 0xb103d4c8), TOBN(0x02bc4613, 0x9218b36b), - TOBN(0xc67f75eb, 0x7651504a), TOBN(0xd6848b56, 0xd02aebfa), - TOBN(0xbd9802e6, 0xc30fa92b), TOBN(0x5a70d96d, 0x9a552784), - TOBN(0x9085c4ea, 0x3f83169b), TOBN(0xfa9423bb, 0x06908228), - TOBN(0x2ffebe12, 0xfe97a5b9), TOBN(0x85da6049, 0x71b99118), - TOBN(0x9cbc2f7f, 0x63178846), TOBN(0xfd96bc70, 0x9153218e), - TOBN(0x958381db, 0x1782269b), TOBN(0xae34bf79, 0x2597e550), - TOBN(0xbb5c6064, 0x5f385153), TOBN(0x6f0e96af, 0xe3088048), - TOBN(0xbf6a0215, 0x77884456), TOBN(0xb3b5688c, 0x69310ea7), - TOBN(0x17c94295, 0x04fad2de), TOBN(0xe020f0e5, 0x17896d4d), - TOBN(0x730ba0ab, 0x0976505f), TOBN(0x567f6813, 0x095e2ec5), - TOBN(0x47062010, 0x6331ab71), TOBN(0x72cfa977, 0x41d22b9f), - TOBN(0x33e55ead, 0x8a2373da), TOBN(0xa8d0d5f4, 0x7ba45a68), - TOBN(0xba1d8f9c, 0x03029d15), TOBN(0x8f34f1cc, 0xfc55b9f3), - TOBN(0xcca4428d, 0xbbe5a1a9), TOBN(0x8187fd5f, 0x3126bd67), - TOBN(0x0036973a, 0x48105826), TOBN(0xa39b6663, 0xb8bd61a0), - TOBN(0x6d42deef, 0x2d65a808), TOBN(0x4969044f, 0x94636b19), - TOBN(0xf611ee47, 0xdd5d564c), TOBN(0x7b2f3a49, 0xd2873077), - TOBN(0x94157d45, 0x300eb294), TOBN(0x2b2a656e, 0x169c1494), - TOBN(0xc000dd76, 0xd3a47aa9), TOBN(0xa2864e4f, 0xa6243ea4), - TOBN(0x82716c47, 0xdb89842e), TOBN(0x12dfd7d7, 0x61479fb7), - TOBN(0x3b9a2c56, 0xe0b2f6dc), TOBN(0x46be862a, 0xd7f85d67), - TOBN(0x03b0d8dd, 0x0f82b214), TOBN(0x460c34f9, 0xf103cbc6), - TOBN(0xf32e5c03, 0x18d79e19), TOBN(0x8b8888ba, 0xa84117f8), - TOBN(0x8f3c37dc, 0xc0722677), TOBN(0x10d21be9, 0x1c1c0f27), - TOBN(0xd47c8468, 0xe0f7a0c6), TOBN(0x9bf02213, 0xadecc0e0), - TOBN(0x0baa7d12, 0x42b48b99), TOBN(0x1bcb665d, 0x48424096), - TOBN(0x8b847cd6, 0xebfb5cfb), TOBN(0x87c2ae56, 0x9ad4d10d), - TOBN(0xf1cbb122, 0x0de36726), TOBN(0xe7043c68, 0x3fdfbd21), - TOBN(0x4bd0826a, 0x4e79d460), TOBN(0x11f5e598, 0x4bd1a2cb), - TOBN(0x97554160, 0xb7fe7b6e), TOBN(0x7d16189a, 0x400a3fb2), - TOBN(0xd73e9bea, 0xe328ca1e), TOBN(0x0dd04b97, 0xe793d8cc), - TOBN(0xa9c83c9b, 0x506db8cc), TOBN(0x5cd47aae, 0xcf38814c), - TOBN(0x26fc430d, 0xb64b45e6), TOBN(0x079b5499, 0xd818ea84), - TOBN(0xebb01102, 0xc1c24a3b), TOBN(0xca24e568, 0x1c161c1a), - TOBN(0x103eea69, 0x36f00a4a), TOBN(0x9ad76ee8, 0x76176c7b), - TOBN(0x97451fc2, 0x538e0ff7), TOBN(0x94f89809, 0x6604b3b0), - TOBN(0x6311436e, 0x3249cfd7), TOBN(0x27b4a7bd, 0x41224f69), - TOBN(0x03b5d21a, 0xe0ac2941), TOBN(0x279b0254, 0xc2d31937), - TOBN(0x3307c052, 0xcac992d0), TOBN(0x6aa7cb92, 0xefa8b1f3), - TOBN(0x5a182580, 0x0d37c7a5), TOBN(0x13380c37, 0x342d5422), - TOBN(0x92ac2d66, 0xd5d2ef92), TOBN(0x035a70c9, 0x030c63c6), - TOBN(0xc16025dd, 0x4ce4f152), TOBN(0x1f419a71, 0xf9df7c06), - TOBN(0x6d5b2214, 0x91e4bb14), TOBN(0xfc43c6cc, 0x839fb4ce), - TOBN(0x49f06591, 0x925d6b2d), TOBN(0x4b37d9d3, 0x62186598), - TOBN(0x8c54a971, 0xd01b1629), TOBN(0xe1a9c29f, 0x51d50e05), - TOBN(0x5109b785, 0x71ba1861), TOBN(0x48b22d5c, 0xd0c8f93d), - TOBN(0xe8fa84a7, 0x8633bb93), TOBN(0x53fba6ba, 0x5aebbd08), - TOBN(0x7ff27df3, 0xe5eea7d8), TOBN(0x521c8796, 0x68ca7158), - TOBN(0xb9d5133b, 0xce6f1a05), TOBN(0x2d50cd53, 0xfd0ebee4), - TOBN(0xc82115d6, 0xc5a3ef16), TOBN(0x993eff9d, 0xba079221), - TOBN(0xe4da2c5e, 0x4b5da81c), TOBN(0x9a89dbdb, 0x8033fd85), - TOBN(0x60819ebf, 0x2b892891), TOBN(0x53902b21, 0x5d14a4d5), - TOBN(0x6ac35051, 0xd7fda421), TOBN(0xcc6ab885, 0x61c83284), - TOBN(0x14eba133, 0xf74cff17), TOBN(0x240aaa03, 0xecb813f2), - TOBN(0xcfbb6540, 0x6f665bee), TOBN(0x084b1fe4, 0xa425ad73), - TOBN(0x009d5d16, 0xd081f6a6), TOBN(0x35304fe8, 0xeef82c90), - TOBN(0xf20346d5, 0xaa9eaa22), TOBN(0x0ada9f07, 0xac1c91e3), - TOBN(0xa6e21678, 0x968a6144), TOBN(0x54c1f77c, 0x07b31a1e), - TOBN(0xd6bb787e, 0x5781fbe1), TOBN(0x61bd2ee0, 0xe31f1c4a), - TOBN(0xf25aa1e9, 0x781105fc), TOBN(0x9cf2971f, 0x7b2f8e80), - TOBN(0x26d15412, 0xcdff919b), TOBN(0x01db4ebe, 0x34bc896e), - TOBN(0x7d9b3e23, 0xb40df1cf), TOBN(0x59337373, 0x94e971b4), - TOBN(0xbf57bd14, 0x669cf921), TOBN(0x865daedf, 0x0c1a1064), - TOBN(0x3eb70bd3, 0x83279125), TOBN(0xbc3d5b9f, 0x34ecdaab), - TOBN(0x91e3ed7e, 0x5f755caf), TOBN(0x49699f54, 0xd41e6f02), - TOBN(0x185770e1, 0xd4a7a15b), TOBN(0x08f3587a, 0xeaac87e7), - TOBN(0x352018db, 0x473133ea), TOBN(0x674ce719, 0x04fd30fc), - TOBN(0x7b8d9835, 0x088b3e0e), TOBN(0x7a0356a9, 0x5d0d47a1), - TOBN(0x9d9e7659, 0x6474a3c4), TOBN(0x61ea48a7, 0xff66966c), - TOBN(0x30417758, 0x0f3e4834), TOBN(0xfdbb21c2, 0x17a9afcb), - TOBN(0x756fa17f, 0x2f9a67b3), TOBN(0x2a6b2421, 0xa245c1a8), - TOBN(0x64be2794, 0x4af02291), TOBN(0xade465c6, 0x2a5804fe), - TOBN(0x8dffbd39, 0xa6f08fd7), TOBN(0xc4efa84c, 0xaa14403b), - TOBN(0xa1b91b2a, 0x442b0f5c), TOBN(0xb748e317, 0xcf997736), - TOBN(0x8d1b62bf, 0xcee90e16), TOBN(0x907ae271, 0x0b2078c0), - TOBN(0xdf31534b, 0x0c9bcddd), TOBN(0x043fb054, 0x39adce83), - TOBN(0x99031043, 0xd826846a), TOBN(0x61a9c0d6, 0xb144f393), - TOBN(0xdab48046, 0x47718427), TOBN(0xdf17ff9b, 0x6e830f8b), - TOBN(0x408d7ee8, 0xe49a1347), TOBN(0x6ac71e23, 0x91c1d4ae), - TOBN(0xc8cbb9fd, 0x1defd73c), TOBN(0x19840657, 0xbbbbfec5), - TOBN(0x39db1cb5, 0x9e7ef8ea), TOBN(0x78aa8296, 0x64105f30), - TOBN(0xa3d9b7f0, 0xa3738c29), TOBN(0x0a2f235a, 0xbc3250a3), - TOBN(0x55e506f6, 0x445e4caf), TOBN(0x0974f73d, 0x33475f7a), - TOBN(0xd37dbba3, 0x5ba2f5a8), TOBN(0x542c6e63, 0x6af40066), - TOBN(0x26d99b53, 0xc5d73e2c), TOBN(0x06060d7d, 0x6c3ca33e), - TOBN(0xcdbef1c2, 0x065fef4a), TOBN(0x77e60f7d, 0xfd5b92e3), - TOBN(0xd7c549f0, 0x26708350), TOBN(0x201b3ad0, 0x34f121bf), - TOBN(0x5fcac2a1, 0x0334fc14), TOBN(0x8a9a9e09, 0x344552f6), - TOBN(0x7dd8a1d3, 0x97653082), TOBN(0x5fc0738f, 0x79d4f289), - TOBN(0x787d244d, 0x17d2d8c3), TOBN(0xeffc6345, 0x70830684), - TOBN(0x5ddb96dd, 0xe4f73ae5), TOBN(0x8efb14b1, 0x172549a5), - TOBN(0x6eb73eee, 0x2245ae7a), TOBN(0xbca4061e, 0xea11f13e), - TOBN(0xb577421d, 0x30b01f5d), TOBN(0xaa688b24, 0x782e152c), - TOBN(0x67608e71, 0xbd3502ba), TOBN(0x4ef41f24, 0xb4de75a0), - TOBN(0xb08dde5e, 0xfd6125e5), TOBN(0xde484825, 0xa409543f), - TOBN(0x1f198d98, 0x65cc2295), TOBN(0x428a3771, 0x6e0edfa2), - TOBN(0x4f9697a2, 0xadf35fc7), TOBN(0x01a43c79, 0xf7cac3c7), - TOBN(0xb05d7059, 0x0fd3659a), TOBN(0x8927f30c, 0xbb7f2d9a), - TOBN(0x4023d1ac, 0x8cf984d3), TOBN(0x32125ed3, 0x02897a45), - TOBN(0xfb572dad, 0x3d414205), TOBN(0x73000ef2, 0xe3fa82a9), - TOBN(0x4c0868e9, 0xf10a5581), TOBN(0x5b61fc67, 0x6b0b3ca5), - TOBN(0xc1258d5b, 0x7cae440c), TOBN(0x21c08b41, 0x402b7531), - TOBN(0xf61a8955, 0xde932321), TOBN(0x3568faf8, 0x2d1408af), - TOBN(0x71b15e99, 0x9ecf965b), TOBN(0xf14ed248, 0xe917276f), - TOBN(0xc6f4caa1, 0x820cf9e2), TOBN(0x681b20b2, 0x18d83c7e), - TOBN(0x6cde738d, 0xc6c01120), TOBN(0x71db0813, 0xae70e0db), - TOBN(0x95fc0644, 0x74afe18c), TOBN(0x34619053, 0x129e2be7), - TOBN(0x80615cea, 0xdb2a3b15), TOBN(0x0a49a19e, 0xdb4c7073), - TOBN(0x0e1b84c8, 0x8fd2d367), TOBN(0xd74bf462, 0x033fb8aa), - TOBN(0x889f6d65, 0x533ef217), TOBN(0x7158c7e4, 0xc3ca2e87), - TOBN(0xfb670dfb, 0xdc2b4167), TOBN(0x75910a01, 0x844c257f), - TOBN(0xf336bf07, 0xcf88577d), TOBN(0x22245250, 0xe45e2ace), - TOBN(0x2ed92e8d, 0x7ca23d85), TOBN(0x29f8be4c, 0x2b812f58), - TOBN(0xdd9ebaa7, 0x076fe12b), TOBN(0x3f2400cb, 0xae1537f9), - TOBN(0x1aa93528, 0x17bdfb46), TOBN(0xc0f98430, 0x67883b41), - TOBN(0x5590ede1, 0x0170911d), TOBN(0x7562f5bb, 0x34d4b17f), - TOBN(0xe1fa1df2, 0x1826b8d2), TOBN(0xb40b796a, 0x6bd80d59), - TOBN(0xd65bf197, 0x3467ba92), TOBN(0x8c9b46db, 0xf70954b0), - TOBN(0x97c8a0f3, 0x0e78f15d), TOBN(0xa8f3a69a, 0x85a4c961), - TOBN(0x4242660f, 0x61e4ce9b), TOBN(0xbf06aab3, 0x6ea6790c), - TOBN(0xc6706f8e, 0xec986416), TOBN(0x9e56dec1, 0x9a9fc225), - TOBN(0x527c46f4, 0x9a9898d9), TOBN(0xd799e77b, 0x5633cdef), - TOBN(0x24eacc16, 0x7d9e4297), TOBN(0xabb61cea, 0x6b1cb734), - TOBN(0xbee2e8a7, 0xf778443c), TOBN(0x3bb42bf1, 0x29de2fe6), - TOBN(0xcbed86a1, 0x3003bb6f), TOBN(0xd3918e6c, 0xd781cdf6), - TOBN(0x4bee3271, 0x9a5103f1), TOBN(0x5243efc6, 0xf50eac06), - TOBN(0xb8e122cb, 0x6adcc119), TOBN(0x1b7faa84, 0xc0b80a08), - TOBN(0x32c3d1bd, 0x6dfcd08c), TOBN(0x129dec4e, 0x0be427de), - TOBN(0x98ab679c, 0x1d263c83), TOBN(0xafc83cb7, 0xcef64eff), - TOBN(0x85eb6088, 0x2fa6be76), TOBN(0x892585fb, 0x1328cbfe), - TOBN(0xc154d3ed, 0xcf618dda), TOBN(0xc44f601b, 0x3abaf26e), - TOBN(0x7bf57d0b, 0x2be1fdfd), TOBN(0xa833bd2d, 0x21137fee), - TOBN(0x9353af36, 0x2db591a8), TOBN(0xc76f26dc, 0x5562a056), - TOBN(0x1d87e47d, 0x3fdf5a51), TOBN(0x7afb5f93, 0x55c9cab0), - TOBN(0x91bbf58f, 0x89e0586e), TOBN(0x7c72c018, 0x0d843709), - TOBN(0xa9a5aafb, 0x99b5c3dc), TOBN(0xa48a0f1d, 0x3844aeb0), - TOBN(0x7178b7dd, 0xb667e482), TOBN(0x453985e9, 0x6e23a59a), - TOBN(0x4a54c860, 0x01b25dd8), TOBN(0x0dd37f48, 0xfb897c8a), - TOBN(0x5f8aa610, 0x0ea90cd9), TOBN(0xc8892c68, 0x16d5830d), - TOBN(0xeb4befc0, 0xef514ca5), TOBN(0x478eb679, 0xe72c9ee6), - TOBN(0x9bca20da, 0xdbc40d5f), TOBN(0xf015de21, 0xdde4f64a), - TOBN(0xaa6a4de0, 0xeaf4b8a5), TOBN(0x68cfd9ca, 0x4bc60e32), - TOBN(0x668a4b01, 0x7fd15e70), TOBN(0xd9f0694a, 0xf27dc09d), - TOBN(0xf6c3cad5, 0xba708bcd), TOBN(0x5cd2ba69, 0x5bb95c2a), - TOBN(0xaa28c1d3, 0x33c0a58f), TOBN(0x23e274e3, 0xabc77870), - TOBN(0x44c3692d, 0xdfd20a4a), TOBN(0x091c5fd3, 0x81a66653), - TOBN(0x6c0bb691, 0x09a0757d), TOBN(0x9072e8b9, 0x667343ea), - TOBN(0x31d40eb0, 0x80848bec), TOBN(0x95bd480a, 0x79fd36cc), - TOBN(0x01a77c61, 0x65ed43f5), TOBN(0xafccd127, 0x2e0d40bf), - TOBN(0xeccfc82d, 0x1cc1884b), TOBN(0xc85ac201, 0x5d4753b4), - TOBN(0xc7a6caac, 0x658e099f), TOBN(0xcf46369e, 0x04b27390), - TOBN(0xe2e7d049, 0x506467ea), TOBN(0x481b63a2, 0x37cdeccc), - TOBN(0x4029abd8, 0xed80143a), TOBN(0x28bfe3c7, 0xbcb00b88), - TOBN(0x3bec1009, 0x0643d84a), TOBN(0x885f3668, 0xabd11041), - TOBN(0xdb02432c, 0xf83a34d6), TOBN(0x32f7b360, 0x719ceebe), - TOBN(0xf06c7837, 0xdad1fe7a), TOBN(0x60a157a9, 0x5441a0b0), - TOBN(0x704970e9, 0xe2d47550), TOBN(0xcd2bd553, 0x271b9020), - TOBN(0xff57f82f, 0x33e24a0b), TOBN(0x9cbee23f, 0xf2565079), - TOBN(0x16353427, 0xeb5f5825), TOBN(0x276feec4, 0xe948d662), - TOBN(0xd1b62bc6, 0xda10032b), TOBN(0x718351dd, 0xf0e72a53), - TOBN(0x93452076, 0x2420e7ba), TOBN(0x96368fff, 0x3a00118d), - TOBN(0x00ce2d26, 0x150a49e4), TOBN(0x0c28b636, 0x3f04706b), - TOBN(0xbad65a46, 0x58b196d0), TOBN(0x6c8455fc, 0xec9f8b7c), - TOBN(0xe90c895f, 0x2d71867e), TOBN(0x5c0be31b, 0xedf9f38c), - TOBN(0x2a37a15e, 0xd8f6ec04), TOBN(0x239639e7, 0x8cd85251), - TOBN(0xd8975315, 0x9c7c4c6b), TOBN(0x603aa3c0, 0xd7409af7), - TOBN(0xb8d53d0c, 0x007132fb), TOBN(0x68d12af7, 0xa6849238), - TOBN(0xbe0607e7, 0xbf5d9279), TOBN(0x9aa50055, 0xaada74ce), - TOBN(0xe81079cb, 0xba7e8ccb), TOBN(0x610c71d1, 0xa5f4ff5e), - TOBN(0x9e2ee1a7, 0x5aa07093), TOBN(0xca84004b, 0xa75da47c), - TOBN(0x074d3951, 0x3de75401), TOBN(0xf938f756, 0xbb311592), - TOBN(0x96197618, 0x00a43421), TOBN(0x39a25362, 0x07bc78c8), - TOBN(0x278f710a, 0x0a171276), TOBN(0xb28446ea, 0x8d1a8f08), - TOBN(0x184781bf, 0xe3b6a661), TOBN(0x7751cb1d, 0xe6d279f7), - TOBN(0xf8ff95d6, 0xc59eb662), TOBN(0x186d90b7, 0x58d3dea7), - TOBN(0x0e4bb6c1, 0xdfb4f754), TOBN(0x5c5cf56b, 0x2b2801dc), - TOBN(0xc561e452, 0x1f54564d), TOBN(0xb4fb8c60, 0xf0dd7f13), - TOBN(0xf8849630, 0x33ff98c7), TOBN(0x9619fffa, 0xcf17769c), - TOBN(0xf8090bf6, 0x1bfdd80a), TOBN(0x14d9a149, 0x422cfe63), - TOBN(0xb354c360, 0x6f6df9ea), TOBN(0xdbcf770d, 0x218f17ea), - TOBN(0x207db7c8, 0x79eb3480), TOBN(0x213dbda8, 0x559b6a26), - TOBN(0xac4c200b, 0x29fc81b3), TOBN(0xebc3e09f, 0x171d87c1), - TOBN(0x91799530, 0x1481aa9e), TOBN(0x051b92e1, 0x92e114fa), - TOBN(0xdf8f92e9, 0xecb5537f), TOBN(0x44b1b2cc, 0x290c7483), - TOBN(0xa711455a, 0x2adeb016), TOBN(0x964b6856, 0x81a10c2c), - TOBN(0x4f159d99, 0xcec03623), TOBN(0x05532225, 0xef3271ea), - TOBN(0xb231bea3, 0xc5ee4849), TOBN(0x57a54f50, 0x7094f103), - TOBN(0x3e2d421d, 0x9598b352), TOBN(0xe865a49c, 0x67412ab4), - TOBN(0xd2998a25, 0x1cc3a912), TOBN(0x5d092808, 0x0c74d65d), - TOBN(0x73f45908, 0x4088567a), TOBN(0xeb6b280e, 0x1f214a61), - TOBN(0x8c9adc34, 0xcaf0c13d), TOBN(0x39d12938, 0xf561fb80), - TOBN(0xb2dc3a5e, 0xbc6edfb4), TOBN(0x7485b1b1, 0xfe4d210e), - TOBN(0x062e0400, 0xe186ae72), TOBN(0x91e32d5c, 0x6eeb3b88), - TOBN(0x6df574d7, 0x4be59224), TOBN(0xebc88ccc, 0x716d55f3), - TOBN(0x26c2e6d0, 0xcad6ed33), TOBN(0xc6e21e7d, 0x0d3e8b10), - TOBN(0x2cc5840e, 0x5bcc36bb), TOBN(0x9292445e, 0x7da74f69), - TOBN(0x8be8d321, 0x4e5193a8), TOBN(0x3ec23629, 0x8df06413), - TOBN(0xc7e9ae85, 0xb134defa), TOBN(0x6073b1d0, 0x1bb2d475), - TOBN(0xb9ad615e, 0x2863c00d), TOBN(0x9e29493d, 0x525f4ac4), - TOBN(0xc32b1dea, 0x4e9acf4f), TOBN(0x3e1f01c8, 0xa50db88d), - TOBN(0xb05d70ea, 0x04da916c), TOBN(0x714b0d0a, 0xd865803e), - TOBN(0x4bd493fc, 0x9920cb5e), TOBN(0x5b44b1f7, 0x92c7a3ac), - TOBN(0xa2a77293, 0xbcec9235), TOBN(0x5ee06e87, 0xcd378553), - TOBN(0xceff8173, 0xda621607), TOBN(0x2bb03e4c, 0x99f5d290), - TOBN(0x2945106a, 0xa6f734ac), TOBN(0xb5056604, 0xd25c4732), - TOBN(0x5945920c, 0xe079afee), TOBN(0x686e17a0, 0x6789831f), - TOBN(0x5966bee8, 0xb74a5ae5), TOBN(0x38a673a2, 0x1e258d46), - TOBN(0xbd1cc1f2, 0x83141c95), TOBN(0x3b2ecf4f, 0x0e96e486), - TOBN(0xcd3aa896, 0x74e5fc78), TOBN(0x415ec10c, 0x2482fa7a), - TOBN(0x15234419, 0x80503380), TOBN(0x513d917a, 0xd314b392), - TOBN(0xb0b52f4e, 0x63caecae), TOBN(0x07bf22ad, 0x2dc7780b), - TOBN(0xe761e8a1, 0xe4306839), TOBN(0x1b3be962, 0x5dd7feaa), - TOBN(0x4fe728de, 0x74c778f1), TOBN(0xf1fa0bda, 0x5e0070f6), - TOBN(0x85205a31, 0x6ec3f510), TOBN(0x2c7e4a14, 0xd2980475), - TOBN(0xde3c19c0, 0x6f30ebfd), TOBN(0xdb1c1f38, 0xd4b7e644), - TOBN(0xfe291a75, 0x5dce364a), TOBN(0xb7b22a3c, 0x058f5be3), - TOBN(0x2cd2c302, 0x37fea38c), TOBN(0x2930967a, 0x2e17be17), - TOBN(0x87f009de, 0x0c061c65), TOBN(0xcb014aac, 0xedc6ed44), - TOBN(0x49bd1cb4, 0x3bafb1eb), TOBN(0x81bd8b5c, 0x282d3688), - TOBN(0x1cdab87e, 0xf01a17af), TOBN(0x21f37ac4, 0xe710063b), - TOBN(0x5a6c5676, 0x42fc8193), TOBN(0xf4753e70, 0x56a6015c), - TOBN(0x020f795e, 0xa15b0a44), TOBN(0x8f37c8d7, 0x8958a958), - TOBN(0x63b7e89b, 0xa4b675b5), TOBN(0xb4fb0c0c, 0x0fc31aea), - TOBN(0xed95e639, 0xa7ff1f2e), TOBN(0x9880f5a3, 0x619614fb), - TOBN(0xdeb6ff02, 0x947151ab), TOBN(0x5bc5118c, 0xa868dcdb), - TOBN(0xd8da2055, 0x4c20cea5), TOBN(0xcac2776e, 0x14c4d69a), - TOBN(0xcccb22c1, 0x622d599b), TOBN(0xa4ddb653, 0x68a9bb50), - TOBN(0x2c4ff151, 0x1b4941b4), TOBN(0xe1ff19b4, 0x6efba588), - TOBN(0x35034363, 0xc48345e0), TOBN(0x45542e3d, 0x1e29dfc4), - TOBN(0xf197cb91, 0x349f7aed), TOBN(0x3b2b5a00, 0x8fca8420), - TOBN(0x7c175ee8, 0x23aaf6d8), TOBN(0x54dcf421, 0x35af32b6), - TOBN(0x0ba14307, 0x27d6561e), TOBN(0x879d5ee4, 0xd175b1e2), - TOBN(0xc7c43673, 0x99807db5), TOBN(0x77a54455, 0x9cd55bcd), - TOBN(0xe6c2ff13, 0x0105c072), TOBN(0x18f7a99f, 0x8dda7da4), - TOBN(0x4c301820, 0x0e2d35c1), TOBN(0x06a53ca0, 0xd9cc6c82), - TOBN(0xaa21cc1e, 0xf1aa1d9e), TOBN(0x32414334, 0x4a75b1e8), - TOBN(0x2a6d1328, 0x0ebe9fdc), TOBN(0x16bd173f, 0x98a4755a), - TOBN(0xfbb9b245, 0x2133ffd9), TOBN(0x39a8b2f1, 0x830f1a20), - TOBN(0x484bc97d, 0xd5a1f52a), TOBN(0xd6aebf56, 0xa40eddf8), - TOBN(0x32257acb, 0x76ccdac6), TOBN(0xaf4d36ec, 0x1586ff27), - TOBN(0x8eaa8863, 0xf8de7dd1), TOBN(0x0045d5cf, 0x88647c16)}, - {TOBN(0xa6f3d574, 0xc005979d), TOBN(0xc2072b42, 0x6a40e350), - TOBN(0xfca5c156, 0x8de2ecf9), TOBN(0xa8c8bf5b, 0xa515344e), - TOBN(0x97aee555, 0x114df14a), TOBN(0xd4374a4d, 0xfdc5ec6b), - TOBN(0x754cc28f, 0x2ca85418), TOBN(0x71cb9e27, 0xd3c41f78), - TOBN(0x89105079, 0x03605c39), TOBN(0xf0843d9e, 0xa142c96c), - TOBN(0xf3744934, 0x16923684), TOBN(0x732caa2f, 0xfa0a2893), - TOBN(0xb2e8c270, 0x61160170), TOBN(0xc32788cc, 0x437fbaa3), - TOBN(0x39cd818e, 0xa6eda3ac), TOBN(0xe2e94239, 0x9e2b2e07), - TOBN(0x6967d39b, 0x0260e52a), TOBN(0xd42585cc, 0x90653325), - TOBN(0x0d9bd605, 0x21ca7954), TOBN(0x4fa20877, 0x81ed57b3), - TOBN(0x60c1eff8, 0xe34a0bbe), TOBN(0x56b0040c, 0x84f6ef64), - TOBN(0x28be2b24, 0xb1af8483), TOBN(0xb2278163, 0xf5531614), - TOBN(0x8df27545, 0x5922ac1c), TOBN(0xa7b3ef5c, 0xa52b3f63), - TOBN(0x8e77b214, 0x71de57c4), TOBN(0x31682c10, 0x834c008b), - TOBN(0xc76824f0, 0x4bd55d31), TOBN(0xb6d1c086, 0x17b61c71), - TOBN(0x31db0903, 0xc2a5089d), TOBN(0x9c092172, 0x184e5d3f), - TOBN(0xdd7ced5b, 0xc00cc638), TOBN(0x1a2015eb, 0x61278fc2), - TOBN(0x2e8e5288, 0x6a37f8d6), TOBN(0xc457786f, 0xe79933ad), - TOBN(0xb3fe4cce, 0x2c51211a), TOBN(0xad9b10b2, 0x24c20498), - TOBN(0x90d87a4f, 0xd28db5e5), TOBN(0x698cd105, 0x3aca2fc3), - TOBN(0x4f112d07, 0xe91b536d), TOBN(0xceb982f2, 0x9eba09d6), - TOBN(0x3c157b2c, 0x197c396f), TOBN(0xe23c2d41, 0x7b66eb24), - TOBN(0x480c57d9, 0x3f330d37), TOBN(0xb3a4c8a1, 0x79108deb), - TOBN(0x702388de, 0xcb199ce5), TOBN(0x0b019211, 0xb944a8d4), - TOBN(0x24f2a692, 0x840bb336), TOBN(0x7c353bdc, 0xa669fa7b), - TOBN(0xda20d6fc, 0xdec9c300), TOBN(0x625fbe2f, 0xa13a4f17), - TOBN(0xa2b1b61a, 0xdbc17328), TOBN(0x008965bf, 0xa9515621), - TOBN(0x49690939, 0xc620ff46), TOBN(0x182dd27d, 0x8717e91c), - TOBN(0x5ace5035, 0xea6c3997), TOBN(0x54259aaa, 0xc2610bef), - TOBN(0xef18bb3f, 0x3c80dd39), TOBN(0x6910b95b, 0x5fc3fa39), - TOBN(0xfce2f510, 0x43e09aee), TOBN(0xced56c9f, 0xa7675665), - TOBN(0x10e265ac, 0xd872db61), TOBN(0x6982812e, 0xae9fce69), - TOBN(0x29be11c6, 0xce800998), TOBN(0x72bb1752, 0xb90360d9), - TOBN(0x2c193197, 0x5a4ad590), TOBN(0x2ba2f548, 0x9fc1dbc0), - TOBN(0x7fe4eebb, 0xe490ebe0), TOBN(0x12a0a4cd, 0x7fae11c0), - TOBN(0x7197cf81, 0xe903ba37), TOBN(0xcf7d4aa8, 0xde1c6dd8), - TOBN(0x92af6bf4, 0x3fd5684c), TOBN(0x2b26eecf, 0x80360aa1), - TOBN(0xbd960f30, 0x00546a82), TOBN(0x407b3c43, 0xf59ad8fe), - TOBN(0x86cae5fe, 0x249c82ba), TOBN(0x9e0faec7, 0x2463744c), - TOBN(0x87f551e8, 0x94916272), TOBN(0x033f9344, 0x6ceb0615), - TOBN(0x1e5eb0d1, 0x8be82e84), TOBN(0x89967f0e, 0x7a582fef), - TOBN(0xbcf687d5, 0xa6e921fa), TOBN(0xdfee4cf3, 0xd37a09ba), - TOBN(0x94f06965, 0xb493c465), TOBN(0x638b9a1c, 0x7635c030), - TOBN(0x76667864, 0x66f05e9f), TOBN(0xccaf6808, 0xc04da725), - TOBN(0xca2eb690, 0x768fccfc), TOBN(0xf402d37d, 0xb835b362), - TOBN(0x0efac0d0, 0xe2fdfcce), TOBN(0xefc9cdef, 0xb638d990), - TOBN(0x2af12b72, 0xd1669a8b), TOBN(0x33c536bc, 0x5774ccbd), - TOBN(0x30b21909, 0xfb34870e), TOBN(0xc38fa2f7, 0x7df25aca), - TOBN(0x74c5f02b, 0xbf81f3f5), TOBN(0x0525a5ae, 0xaf7e4581), - TOBN(0x88d2aaba, 0x433c54ae), TOBN(0xed9775db, 0x806a56c5), - TOBN(0xd320738a, 0xc0edb37d), TOBN(0x25fdb6ee, 0x66cc1f51), - TOBN(0xac661d17, 0x10600d76), TOBN(0x931ec1f3, 0xbdd1ed76), - TOBN(0x65c11d62, 0x19ee43f1), TOBN(0x5cd57c3e, 0x60829d97), - TOBN(0xd26c91a3, 0x984be6e8), TOBN(0xf08d9309, 0x8b0c53bd), - TOBN(0x94bc9e5b, 0xc016e4ea), TOBN(0xd3916839, 0x11d43d2b), - TOBN(0x886c5ad7, 0x73701155), TOBN(0xe0377626, 0x20b00715), - TOBN(0x7f01c9ec, 0xaa80ba59), TOBN(0x3083411a, 0x68538e51), - TOBN(0x970370f1, 0xe88128af), TOBN(0x625cc3db, 0x91dec14b), - TOBN(0xfef9666c, 0x01ac3107), TOBN(0xb2a8d577, 0xd5057ac3), - TOBN(0xb0f26299, 0x92be5df7), TOBN(0xf579c8e5, 0x00353924), - TOBN(0xb8fa3d93, 0x1341ed7a), TOBN(0x4223272c, 0xa7b59d49), - TOBN(0x3dcb1947, 0x83b8c4a4), TOBN(0x4e413c01, 0xed1302e4), - TOBN(0x6d999127, 0xe17e44ce), TOBN(0xee86bf75, 0x33b3adfb), - TOBN(0xf6902fe6, 0x25aa96ca), TOBN(0xb73540e4, 0xe5aae47d), - TOBN(0x32801d7b, 0x1b4a158c), TOBN(0xe571c99e, 0x27e2a369), - TOBN(0x40cb76c0, 0x10d9f197), TOBN(0xc308c289, 0x3167c0ae), - TOBN(0xa6ef9dd3, 0xeb7958f2), TOBN(0xa7226dfc, 0x300879b1), - TOBN(0x6cd0b362, 0x7edf0636), TOBN(0x4efbce6c, 0x7bc37eed), - TOBN(0x75f92a05, 0x8d699021), TOBN(0x586d4c79, 0x772566e3), - TOBN(0x378ca5f1, 0x761ad23a), TOBN(0x650d86fc, 0x1465a8ac), - TOBN(0x7a4ed457, 0x842ba251), TOBN(0x6b65e3e6, 0x42234933), - TOBN(0xaf1543b7, 0x31aad657), TOBN(0xa4cefe98, 0xcbfec369), - TOBN(0xb587da90, 0x9f47befb), TOBN(0x6562e9fb, 0x41312d13), - TOBN(0xa691ea59, 0xeff1cefe), TOBN(0xcc30477a, 0x05fc4cf6), - TOBN(0xa1632461, 0x0b0ffd3d), TOBN(0xa1f16f3b, 0x5b355956), - TOBN(0x5b148d53, 0x4224ec24), TOBN(0xdc834e7b, 0xf977012a), - TOBN(0x7bfc5e75, 0xb2c69dbc), TOBN(0x3aa77a29, 0x03c3da6c), - TOBN(0xde0df03c, 0xca910271), TOBN(0xcbd5ca4a, 0x7806dc55), - TOBN(0xe1ca5807, 0x6db476cb), TOBN(0xfde15d62, 0x5f37a31e), - TOBN(0xf49af520, 0xf41af416), TOBN(0x96c5c5b1, 0x7d342db5), - TOBN(0x155c43b7, 0xeb4ceb9b), TOBN(0x2e993010, 0x4e77371a), - TOBN(0x1d2987da, 0x675d43af), TOBN(0xef2bc1c0, 0x8599fd72), - TOBN(0x96894b7b, 0x9342f6b2), TOBN(0x201eadf2, 0x7c8e71f0), - TOBN(0xf3479d9f, 0x4a1f3efc), TOBN(0xe0f8a742, 0x702a9704), - TOBN(0xeafd44b6, 0xb3eba40c), TOBN(0xf9739f29, 0xc1c1e0d0), - TOBN(0x0091471a, 0x619d505e), TOBN(0xc15f9c96, 0x9d7c263e), - TOBN(0x5be47285, 0x83afbe33), TOBN(0xa3b6d6af, 0x04f1e092), - TOBN(0xe76526b9, 0x751a9d11), TOBN(0x2ec5b26d, 0x9a4ae4d2), - TOBN(0xeb66f4d9, 0x02f6fb8d), TOBN(0x4063c561, 0x96912164), - TOBN(0xeb7050c1, 0x80ef3000), TOBN(0x288d1c33, 0xeaa5b3f0), - TOBN(0xe87c68d6, 0x07806fd8), TOBN(0xb2f7f9d5, 0x4bbbf50f), - TOBN(0x25972f3a, 0xac8d6627), TOBN(0xf8547774, 0x10e8c13b), - TOBN(0xcc50ef6c, 0x872b4a60), TOBN(0xab2a34a4, 0x4613521b), - TOBN(0x39c5c190, 0x983e15d1), TOBN(0x61dde5df, 0x59905512), - TOBN(0xe417f621, 0x9f2275f3), TOBN(0x0750c8b6, 0x451d894b), - TOBN(0x75b04ab9, 0x78b0bdaa), TOBN(0x3bfd9fd4, 0x458589bd), - TOBN(0xf1013e30, 0xee9120b6), TOBN(0x2b51af93, 0x23a4743e), - TOBN(0xea96ffae, 0x48d14d9e), TOBN(0x71dc0dbe, 0x698a1d32), - TOBN(0x914962d2, 0x0180cca4), TOBN(0x1ae60677, 0xc3568963), - TOBN(0x8cf227b1, 0x437bc444), TOBN(0xc650c83b, 0xc9962c7a), - TOBN(0x23c2c7dd, 0xfe7ccfc4), TOBN(0xf925c89d, 0x1b929d48), - TOBN(0x4460f74b, 0x06783c33), TOBN(0xac2c8d49, 0xa590475a), - TOBN(0xfb40b407, 0xb807bba0), TOBN(0x9d1e362d, 0x69ff8f3a), - TOBN(0xa33e9681, 0xcbef64a4), TOBN(0x67ece5fa, 0x332fb4b2), - TOBN(0x6900a99b, 0x739f10e3), TOBN(0xc3341ca9, 0xff525925), - TOBN(0xee18a626, 0xa9e2d041), TOBN(0xa5a83685, 0x29580ddd), - TOBN(0xf3470c81, 0x9d7de3cd), TOBN(0xedf02586, 0x2062cf9c), - TOBN(0xf43522fa, 0xc010edb0), TOBN(0x30314135, 0x13a4b1ae), - TOBN(0xc792e02a, 0xdb22b94b), TOBN(0x993d8ae9, 0xa1eaa45b), - TOBN(0x8aad6cd3, 0xcd1e1c63), TOBN(0x89529ca7, 0xc5ce688a), - TOBN(0x2ccee3aa, 0xe572a253), TOBN(0xe02b6438, 0x02a21efb), - TOBN(0xa7091b6e, 0xc9430358), TOBN(0x06d1b1fa, 0x9d7db504), - TOBN(0x58846d32, 0xc4744733), TOBN(0x40517c71, 0x379f9e34), - TOBN(0x2f65655f, 0x130ef6ca), TOBN(0x526e4488, 0xf1f3503f), - TOBN(0x8467bd17, 0x7ee4a976), TOBN(0x1d9dc913, 0x921363d1), - TOBN(0xd8d24c33, 0xb069e041), TOBN(0x5eb5da0a, 0x2cdf7f51), - TOBN(0x1c0f3cb1, 0x197b994f), TOBN(0x3c95a6c5, 0x2843eae9), - TOBN(0x7766ffc9, 0xa6097ea5), TOBN(0x7bea4093, 0xd723b867), - TOBN(0xb48e1f73, 0x4db378f9), TOBN(0x70025b00, 0xe37b77ac), - TOBN(0x943dc8e7, 0xaf24ad46), TOBN(0xb98a15ac, 0x16d00a85), - TOBN(0x3adc38ba, 0x2743b004), TOBN(0xb1c7f4f7, 0x334415ee), - TOBN(0xea43df8f, 0x1e62d05a), TOBN(0x32618905, 0x9d76a3b6), - TOBN(0x2fbd0bb5, 0xa23a0f46), TOBN(0x5bc971db, 0x6a01918c), - TOBN(0x7801d94a, 0xb4743f94), TOBN(0xb94df65e, 0x676ae22b), - TOBN(0xaafcbfab, 0xaf95894c), TOBN(0x7b9bdc07, 0x276b2241), - TOBN(0xeaf98362, 0x5bdda48b), TOBN(0x5977faf2, 0xa3fcb4df), - TOBN(0xbed042ef, 0x052c4b5b), TOBN(0x9fe87f71, 0x067591f0), - TOBN(0xc89c73ca, 0x22f24ec7), TOBN(0x7d37fa9e, 0xe64a9f1b), - TOBN(0x2710841a, 0x15562627), TOBN(0x2c01a613, 0xc243b034), - TOBN(0x1d135c56, 0x2bc68609), TOBN(0xc2ca1715, 0x8b03f1f6), - TOBN(0xc9966c2d, 0x3eb81d82), TOBN(0xc02abf4a, 0x8f6df13e), - TOBN(0x77b34bd7, 0x8f72b43b), TOBN(0xaff6218f, 0x360c82b0), - TOBN(0x0aa5726c, 0x8d55b9d2), TOBN(0xdc0adbe9, 0x99e9bffb), - TOBN(0x9097549c, 0xefb9e72a), TOBN(0x16755712, 0x9dfb3111), - TOBN(0xdd8bf984, 0xf26847f9), TOBN(0xbcb8e387, 0xdfb30cb7), - TOBN(0xc1fd32a7, 0x5171ef9c), TOBN(0x977f3fc7, 0x389b363f), - TOBN(0x116eaf2b, 0xf4babda0), TOBN(0xfeab68bd, 0xf7113c8e), - TOBN(0xd1e3f064, 0xb7def526), TOBN(0x1ac30885, 0xe0b3fa02), - TOBN(0x1c5a6e7b, 0x40142d9d), TOBN(0x839b5603, 0x30921c0b), - TOBN(0x48f301fa, 0x36a116a3), TOBN(0x380e1107, 0xcfd9ee6d), - TOBN(0x7945ead8, 0x58854be1), TOBN(0x4111c12e, 0xcbd4d49d), - TOBN(0xece3b1ec, 0x3a29c2ef), TOBN(0x6356d404, 0x8d3616f5), - TOBN(0x9f0d6a8f, 0x594d320e), TOBN(0x0989316d, 0xf651ccd2), - TOBN(0x6c32117a, 0x0f8fdde4), TOBN(0x9abe5cc5, 0xa26a9bbc), - TOBN(0xcff560fb, 0x9723f671), TOBN(0x21b2a12d, 0x7f3d593c), - TOBN(0xe4cb18da, 0x24ba0696), TOBN(0x186e2220, 0xc3543384), - TOBN(0x722f64e0, 0x88312c29), TOBN(0x94282a99, 0x17dc7752), - TOBN(0x62467bbf, 0x5a85ee89), TOBN(0xf435c650, 0xf10076a0), - TOBN(0xc9ff1539, 0x43b3a50b), TOBN(0x7132130c, 0x1a53efbc), - TOBN(0x31bfe063, 0xf7b0c5b7), TOBN(0xb0179a7d, 0x4ea994cc), - TOBN(0x12d064b3, 0xc85f455b), TOBN(0x47259328, 0x8f6e0062), - TOBN(0xf64e590b, 0xb875d6d9), TOBN(0x22dd6225, 0xad92bcc7), - TOBN(0xb658038e, 0xb9c3bd6d), TOBN(0x00cdb0d6, 0xfbba27c8), - TOBN(0x0c681337, 0x1062c45d), TOBN(0xd8515b8c, 0x2d33407d), - TOBN(0xcb8f699e, 0x8cbb5ecf), TOBN(0x8c4347f8, 0xc608d7d8), - TOBN(0x2c11850a, 0xbb3e00db), TOBN(0x20a8dafd, 0xecb49d19), - TOBN(0xbd781480, 0x45ee2f40), TOBN(0x75e354af, 0x416b60cf), - TOBN(0xde0b58a1, 0x8d49a8c4), TOBN(0xe40e94e2, 0xfa359536), - TOBN(0xbd4fa59f, 0x62accd76), TOBN(0x05cf466a, 0x8c762837), - TOBN(0xb5abda99, 0x448c277b), TOBN(0x5a9e01bf, 0x48b13740), - TOBN(0x9d457798, 0x326aad8d), TOBN(0xbdef4954, 0xc396f7e7), - TOBN(0x6fb274a2, 0xc253e292), TOBN(0x2800bf0a, 0x1cfe53e7), - TOBN(0x22426d31, 0x44438fd4), TOBN(0xef233923, 0x5e259f9a), - TOBN(0x4188503c, 0x03f66264), TOBN(0x9e5e7f13, 0x7f9fdfab), - TOBN(0x565eb76c, 0x5fcc1aba), TOBN(0xea632548, 0x59b5bff8), - TOBN(0x5587c087, 0xaab6d3fa), TOBN(0x92b639ea, 0x6ce39c1b), - TOBN(0x0706e782, 0x953b135c), TOBN(0x7308912e, 0x425268ef), - TOBN(0x599e92c7, 0x090e7469), TOBN(0x83b90f52, 0x9bc35e75), - TOBN(0x4750b3d0, 0x244975b3), TOBN(0xf3a44358, 0x11965d72), - TOBN(0x179c6774, 0x9c8dc751), TOBN(0xff18cdfe, 0xd23d9ff0), - TOBN(0xc4013833, 0x2028e247), TOBN(0x96e280e2, 0xf3bfbc79), - TOBN(0xf60417bd, 0xd0880a84), TOBN(0x263c9f3d, 0x2a568151), - TOBN(0x36be15b3, 0x2d2ce811), TOBN(0x846dc0c2, 0xf8291d21), - TOBN(0x5cfa0ecb, 0x789fcfdb), TOBN(0x45a0beed, 0xd7535b9a), - TOBN(0xec8e9f07, 0x96d69af1), TOBN(0x31a7c5b8, 0x599ab6dc), - TOBN(0xd36d45ef, 0xf9e2e09f), TOBN(0x3cf49ef1, 0xdcee954b), - TOBN(0x6be34cf3, 0x086cff9b), TOBN(0x88dbd491, 0x39a3360f), - TOBN(0x1e96b8cc, 0x0dbfbd1d), TOBN(0xc1e5f7bf, 0xcb7e2552), - TOBN(0x0547b214, 0x28819d98), TOBN(0xc770dd9c, 0x7aea9dcb), - TOBN(0xaef0d4c7, 0x041d68c8), TOBN(0xcc2b9818, 0x13cb9ba8), - TOBN(0x7fc7bc76, 0xfe86c607), TOBN(0x6b7b9337, 0x502a9a95), - TOBN(0x1948dc27, 0xd14dab63), TOBN(0x249dd198, 0xdae047be), - TOBN(0xe8356584, 0xa981a202), TOBN(0x3531dd18, 0x3a893387), - TOBN(0x1be11f90, 0xc85c7209), TOBN(0x93d2fe1e, 0xe2a52b5a), - TOBN(0x8225bfe2, 0xec6d6b97), TOBN(0x9cf6d6f4, 0xbd0aa5de), - TOBN(0x911459cb, 0x54779f5f), TOBN(0x5649cddb, 0x86aeb1f3), - TOBN(0x32133579, 0x3f26ce5a), TOBN(0xc289a102, 0x550f431e), - TOBN(0x559dcfda, 0x73b84c6f), TOBN(0x84973819, 0xee3ac4d7), - TOBN(0xb51e55e6, 0xf2606a82), TOBN(0xe25f7061, 0x90f2fb57), - TOBN(0xacef6c2a, 0xb1a4e37c), TOBN(0x864e359d, 0x5dcf2706), - TOBN(0x479e6b18, 0x7ce57316), TOBN(0x2cab2500, 0x3a96b23d), - TOBN(0xed489862, 0x8ef16df7), TOBN(0x2056538c, 0xef3758b5), - TOBN(0xa7df865e, 0xf15d3101), TOBN(0x80c5533a, 0x61b553d7), - TOBN(0x366e1997, 0x4ed14294), TOBN(0x6620741f, 0xb3c0bcd6), - TOBN(0x21d1d9c4, 0xedc45418), TOBN(0x005b859e, 0xc1cc4a9d), - TOBN(0xdf01f630, 0xa1c462f0), TOBN(0x15d06cf3, 0xf26820c7), - TOBN(0x9f7f24ee, 0x3484be47), TOBN(0x2ff33e96, 0x4a0c902f), - TOBN(0x00bdf457, 0x5a0bc453), TOBN(0x2378dfaf, 0x1aa238db), - TOBN(0x272420ec, 0x856720f2), TOBN(0x2ad9d95b, 0x96797291), - TOBN(0xd1242cc6, 0x768a1558), TOBN(0x2e287f8b, 0x5cc86aa8), - TOBN(0x796873d0, 0x990cecaa), TOBN(0xade55f81, 0x675d4080), - TOBN(0x2645eea3, 0x21f0cd84), TOBN(0x7a1efa0f, 0xb4e17d02), - TOBN(0xf6858420, 0x037cc061), TOBN(0x682e05f0, 0xd5d43e12), - TOBN(0x59c36994, 0x27218710), TOBN(0x85cbba4d, 0x3f7cd2fc), - TOBN(0x726f9729, 0x7a3cd22a), TOBN(0x9f8cd5dc, 0x4a628397), - TOBN(0x17b93ab9, 0xc23165ed), TOBN(0xff5f5dbf, 0x122823d4), - TOBN(0xc1e4e4b5, 0x654a446d), TOBN(0xd1a9496f, 0x677257ba), - TOBN(0x6387ba94, 0xde766a56), TOBN(0x23608bc8, 0x521ec74a), - TOBN(0x16a522d7, 0x6688c4d4), TOBN(0x9d6b4282, 0x07373abd), - TOBN(0xa62f07ac, 0xb42efaa3), TOBN(0xf73e00f7, 0xe3b90180), - TOBN(0x36175fec, 0x49421c3e), TOBN(0xc4e44f9b, 0x3dcf2678), - TOBN(0x76df436b, 0x7220f09f), TOBN(0x172755fb, 0x3aa8b6cf), - TOBN(0xbab89d57, 0x446139cc), TOBN(0x0a0a6e02, 0x5fe0208f), - TOBN(0xcdbb63e2, 0x11e5d399), TOBN(0x33ecaa12, 0xa8977f0b), - TOBN(0x59598b21, 0xf7c42664), TOBN(0xb3e91b32, 0xab65d08a), - TOBN(0x035822ee, 0xf4502526), TOBN(0x1dcf0176, 0x720a82a9), - TOBN(0x50f8598f, 0x3d589e02), TOBN(0xdf0478ff, 0xb1d63d2c), - TOBN(0x8b8068bd, 0x1571cd07), TOBN(0x30c3aa4f, 0xd79670cd), - TOBN(0x25e8fd4b, 0x941ade7f), TOBN(0x3d1debdc, 0x32790011), - TOBN(0x65b6dcbd, 0x3a3f9ff0), TOBN(0x282736a4, 0x793de69c), - TOBN(0xef69a0c3, 0xd41d3bd3), TOBN(0xb533b8c9, 0x07a26bde), - TOBN(0xe2801d97, 0xdb2edf9f), TOBN(0xdc4a8269, 0xe1877af0), - TOBN(0x6c1c5851, 0x3d590dbe), TOBN(0x84632f6b, 0xee4e9357), - TOBN(0xd36d36b7, 0x79b33374), TOBN(0xb46833e3, 0x9bbca2e6), - TOBN(0x37893913, 0xf7fc0586), TOBN(0x385315f7, 0x66bf4719), - TOBN(0x72c56293, 0xb31855dc), TOBN(0xd1416d4e, 0x849061fe), - TOBN(0xbeb3ab78, 0x51047213), TOBN(0x447f6e61, 0xf040c996), - TOBN(0xd06d310d, 0x638b1d0c), TOBN(0xe28a413f, 0xbad1522e), - TOBN(0x685a76cb, 0x82003f86), TOBN(0x610d07f7, 0x0bcdbca3), - TOBN(0x6ff66021, 0x9ca4c455), TOBN(0x7df39b87, 0xcea10eec), - TOBN(0xb9255f96, 0xe22db218), TOBN(0x8cc6d9eb, 0x08a34c44), - TOBN(0xcd4ffb86, 0x859f9276), TOBN(0x8fa15eb2, 0x50d07335), - TOBN(0xdf553845, 0xcf2c24b5), TOBN(0x89f66a9f, 0x52f9c3ba), - TOBN(0x8f22b5b9, 0xe4a7ceb3), TOBN(0xaffef809, 0x0e134686), - TOBN(0x3e53e1c6, 0x8eb8fac2), TOBN(0x93c1e4eb, 0x28aec98e), - TOBN(0xb6b91ec5, 0x32a43bcb), TOBN(0x2dbfa947, 0xb2d74a51), - TOBN(0xe065d190, 0xca84bad7), TOBN(0xfb13919f, 0xad58e65c), - TOBN(0x3c41718b, 0xf1cb6e31), TOBN(0x688969f0, 0x06d05c3f), - TOBN(0xd4f94ce7, 0x21264d45), TOBN(0xfdfb65e9, 0x7367532b), - TOBN(0x5b1be8b1, 0x0945a39d), TOBN(0x229f789c, 0x2b8baf3b), - TOBN(0xd8f41f3e, 0x6f49f15d), TOBN(0x678ce828, 0x907f0792), - TOBN(0xc69ace82, 0xfca6e867), TOBN(0x106451ae, 0xd01dcc89), - TOBN(0x1bb4f7f0, 0x19fc32d2), TOBN(0x64633dfc, 0xb00c52d2), - TOBN(0x8f13549a, 0xad9ea445), TOBN(0x99a3bf50, 0xfb323705), - TOBN(0x0c9625a2, 0x534d4dbc), TOBN(0x45b8f1d1, 0xc2a2fea3), - TOBN(0x76ec21a1, 0xa530fc1a), TOBN(0x4bac9c2a, 0x9e5bd734), - TOBN(0x5996d76a, 0x7b4e3587), TOBN(0x0045cdee, 0x1182d9e3), - TOBN(0x1aee24b9, 0x1207f13d), TOBN(0x66452e97, 0x97345a41), - TOBN(0x16e5b054, 0x9f950cd0), TOBN(0x9cc72fb1, 0xd7fdd075), - TOBN(0x6edd61e7, 0x66249663), TOBN(0xde4caa4d, 0xf043cccb), - TOBN(0x11b1f57a, 0x55c7ac17), TOBN(0x779cbd44, 0x1a85e24d), - TOBN(0x78030f86, 0xe46081e7), TOBN(0xfd4a6032, 0x8e20f643), - TOBN(0xcc7a6488, 0x0a750c0f), TOBN(0x39bacfe3, 0x4e548e83), - TOBN(0x3d418c76, 0x0c110f05), TOBN(0x3e4daa4c, 0xb1f11588), - TOBN(0x2733e7b5, 0x5ffc69ff), TOBN(0x46f147bc, 0x92053127), - TOBN(0x885b2434, 0xd722df94), TOBN(0x6a444f65, 0xe6fc6b7c)}, - {TOBN(0x7a1a465a, 0xc3f16ea8), TOBN(0x115a461d, 0xb2f1d11c), - TOBN(0x4767dd95, 0x6c68a172), TOBN(0x3392f2eb, 0xd13a4698), - TOBN(0xc7a99ccd, 0xe526cdc7), TOBN(0x8e537fdc, 0x22292b81), - TOBN(0x76d8cf69, 0xa6d39198), TOBN(0xffc5ff43, 0x2446852d), - TOBN(0x97b14f7e, 0xa90567e6), TOBN(0x513257b7, 0xb6ae5cb7), - TOBN(0x85454a3c, 0x9f10903d), TOBN(0xd8d2c9ad, 0x69bc3724), - TOBN(0x38da9324, 0x6b29cb44), TOBN(0xb540a21d, 0x77c8cbac), - TOBN(0x9bbfe435, 0x01918e42), TOBN(0xfffa707a, 0x56c3614e), - TOBN(0x0ce4e3f1, 0xd4e353b7), TOBN(0x062d8a14, 0xef46b0a0), - TOBN(0x6408d5ab, 0x574b73fd), TOBN(0xbc41d1c9, 0xd3273ffd), - TOBN(0x3538e1e7, 0x6be77800), TOBN(0x71fe8b37, 0xc5655031), - TOBN(0x1cd91621, 0x6b9b331a), TOBN(0xad825d0b, 0xbb388f73), - TOBN(0x56c2e05b, 0x1cb76219), TOBN(0x0ec0bf91, 0x71567e7e), - TOBN(0xe7076f86, 0x61c4c910), TOBN(0xd67b085b, 0xbabc04d9), - TOBN(0x9fb90459, 0x5e93a96a), TOBN(0x7526c1ea, 0xfbdc249a), - TOBN(0x0d44d367, 0xecdd0bb7), TOBN(0x95399917, 0x9dc0d695), - TOBN(0x61360ee9, 0x9e240d18), TOBN(0x057cdcac, 0xb4b94466), - TOBN(0xe7667cd1, 0x2fe5325c), TOBN(0x1fa297b5, 0x21974e3b), - TOBN(0xfa4081e7, 0xdb083d76), TOBN(0x31993be6, 0xf206bd15), - TOBN(0x8949269b, 0x14c19f8c), TOBN(0x21468d72, 0xa9d92357), - TOBN(0x2ccbc583, 0xa4c506ec), TOBN(0x957ed188, 0xd1acfe97), - TOBN(0x8baed833, 0x12f1aea2), TOBN(0xef2a6cb4, 0x8325362d), - TOBN(0x130dde42, 0x8e195c43), TOBN(0xc842025a, 0x0e6050c6), - TOBN(0x2da972a7, 0x08686a5d), TOBN(0xb52999a1, 0xe508b4a8), - TOBN(0xd9f090b9, 0x10a5a8bd), TOBN(0xca91d249, 0x096864da), - TOBN(0x8e6a93be, 0x3f67dbc1), TOBN(0xacae6fba, 0xf5f4764c), - TOBN(0x1563c6e0, 0xd21411a0), TOBN(0x28fa787f, 0xda0a4ad8), - TOBN(0xd524491c, 0x908c8030), TOBN(0x1257ba0e, 0x4c795f07), - TOBN(0x83f49167, 0xceca9754), TOBN(0x426d2cf6, 0x4b7939a0), - TOBN(0x2555e355, 0x723fd0bf), TOBN(0xa96e6d06, 0xc4f144e2), - TOBN(0x4768a8dd, 0x87880e61), TOBN(0x15543815, 0xe508e4d5), - TOBN(0x09d7e772, 0xb1b65e15), TOBN(0x63439dd6, 0xac302fa0), - TOBN(0xb93f802f, 0xc14e35c2), TOBN(0x71735b7c, 0x4341333c), - TOBN(0x03a25104, 0x16d4f362), TOBN(0x3f4d069b, 0xbf433c8e), - TOBN(0x0d83ae01, 0xf78f5a7c), TOBN(0x50a8ffbe, 0x7c4eed07), - TOBN(0xc74f8906, 0x76e10f83), TOBN(0x7d080966, 0x9ddaf8e1), - TOBN(0xb11df8e1, 0x698e04cc), TOBN(0x877be203, 0x169005c8), - TOBN(0x32749e8c, 0x4f3c6179), TOBN(0x2dbc9d0a, 0x7853fc05), - TOBN(0x187d4f93, 0x9454d937), TOBN(0xe682ce9d, 0xb4800e1b), - TOBN(0xa9129ad8, 0x165e68e8), TOBN(0x0fe29735, 0xbe7f785b), - TOBN(0x5303f40c, 0x5b9e02b7), TOBN(0xa37c9692, 0x35ee04e8), - TOBN(0x5f46cc20, 0x34d6632b), TOBN(0x55ef72b2, 0x96ac545b), - TOBN(0xabec5c1f, 0x7b91b062), TOBN(0x0a79e1c7, 0xbb33e821), - TOBN(0xbb04b428, 0x3a9f4117), TOBN(0x0de1f28f, 0xfd2a475a), - TOBN(0x31019ccf, 0x3a4434b4), TOBN(0xa3458111, 0x1a7954dc), - TOBN(0xa9dac80d, 0xe34972a7), TOBN(0xb043d054, 0x74f6b8dd), - TOBN(0x021c319e, 0x11137b1a), TOBN(0x00a754ce, 0xed5cc03f), - TOBN(0x0aa2c794, 0xcbea5ad4), TOBN(0x093e67f4, 0x70c015b6), - TOBN(0x72cdfee9, 0xc97e3f6b), TOBN(0xc10bcab4, 0xb6da7461), - TOBN(0x3b02d2fc, 0xb59806b9), TOBN(0x85185e89, 0xa1de6f47), - TOBN(0x39e6931f, 0x0eb6c4d4), TOBN(0x4d4440bd, 0xd4fa5b04), - TOBN(0x5418786e, 0x34be7eb8), TOBN(0x6380e521, 0x9d7259bc), - TOBN(0x20ac0351, 0xd598d710), TOBN(0x272c4166, 0xcb3a4da4), - TOBN(0xdb82fe1a, 0xca71de1f), TOBN(0x746e79f2, 0xd8f54b0f), - TOBN(0x6e7fc736, 0x4b573e9b), TOBN(0x75d03f46, 0xfd4b5040), - TOBN(0x5c1cc36d, 0x0b98d87b), TOBN(0x513ba3f1, 0x1f472da1), - TOBN(0x79d0af26, 0xabb177dd), TOBN(0xf82ab568, 0x7891d564), - TOBN(0x2b6768a9, 0x72232173), TOBN(0xefbb3bb0, 0x8c1f6619), - TOBN(0xb29c11db, 0xa6d18358), TOBN(0x519e2797, 0xb0916d3a), - TOBN(0xd4dc18f0, 0x9188e290), TOBN(0x648e86e3, 0x98b0ca7f), - TOBN(0x859d3145, 0x983c38b5), TOBN(0xb14f176c, 0x637abc8b), - TOBN(0x2793fb9d, 0xcaff7be6), TOBN(0xebe5a55f, 0x35a66a5a), - TOBN(0x7cec1dcd, 0x9f87dc59), TOBN(0x7c595cd3, 0xfbdbf560), - TOBN(0x5b543b22, 0x26eb3257), TOBN(0x69080646, 0xc4c935fd), - TOBN(0x7f2e4403, 0x81e9ede3), TOBN(0x243c3894, 0xcaf6df0a), - TOBN(0x7c605bb1, 0x1c073b11), TOBN(0xcd06a541, 0xba6a4a62), - TOBN(0x29168949, 0x49d4e2e5), TOBN(0x33649d07, 0x4af66880), - TOBN(0xbfc0c885, 0xe9a85035), TOBN(0xb4e52113, 0xfc410f4b), - TOBN(0xdca3b706, 0x78a6513b), TOBN(0x92ea4a2a, 0x9edb1943), - TOBN(0x02642216, 0xdb6e2dd8), TOBN(0x9b45d0b4, 0x9fd57894), - TOBN(0x114e70db, 0xc69d11ae), TOBN(0x1477dd19, 0x4c57595f), - TOBN(0xbc2208b4, 0xec77c272), TOBN(0x95c5b4d7, 0xdb68f59c), - TOBN(0xb8c4fc63, 0x42e532b7), TOBN(0x386ba422, 0x9ae35290), - TOBN(0xfb5dda42, 0xd201ecbc), TOBN(0x2353dc8b, 0xa0e38fd6), - TOBN(0x9a0b85ea, 0x68f7e978), TOBN(0x96ec5682, 0x2ad6d11f), - TOBN(0x5e279d6c, 0xe5f6886d), TOBN(0xd3fe03cd, 0x3cb1914d), - TOBN(0xfe541fa4, 0x7ea67c77), TOBN(0x952bd2af, 0xe3ea810c), - TOBN(0x791fef56, 0x8d01d374), TOBN(0xa3a1c621, 0x0f11336e), - TOBN(0x5ad0d5a9, 0xc7ec6d79), TOBN(0xff7038af, 0x3225c342), - TOBN(0x003c6689, 0xbc69601b), TOBN(0x25059bc7, 0x45e8747d), - TOBN(0xfa4965b2, 0xf2086fbf), TOBN(0xf6840ea6, 0x86916078), - TOBN(0xd7ac7620, 0x70081d6c), TOBN(0xe600da31, 0xb5328645), - TOBN(0x01916f63, 0x529b8a80), TOBN(0xe80e4858, 0x2d7d6f3e), - TOBN(0x29eb0fe8, 0xd664ca7c), TOBN(0xf017637b, 0xe7b43b0c), - TOBN(0x9a75c806, 0x76cb2566), TOBN(0x8f76acb1, 0xb24892d9), - TOBN(0x7ae7b9cc, 0x1f08fe45), TOBN(0x19ef7329, 0x6a4907d8), - TOBN(0x2db4ab71, 0x5f228bf0), TOBN(0xf3cdea39, 0x817032d7), - TOBN(0x0b1f482e, 0xdcabe3c0), TOBN(0x3baf76b4, 0xbb86325c), - TOBN(0xd49065e0, 0x10089465), TOBN(0x3bab5d29, 0x8e77c596), - TOBN(0x7636c3a6, 0x193dbd95), TOBN(0xdef5d294, 0xb246e499), - TOBN(0xb22c58b9, 0x286b2475), TOBN(0xa0b93939, 0xcd80862b), - TOBN(0x3002c83a, 0xf0992388), TOBN(0x6de01f9b, 0xeacbe14c), - TOBN(0x6aac688e, 0xadd70482), TOBN(0x708de92a, 0x7b4a4e8a), - TOBN(0x75b6dd73, 0x758a6eef), TOBN(0xea4bf352, 0x725b3c43), - TOBN(0x10041f2c, 0x87912868), TOBN(0xb1b1be95, 0xef09297a), - TOBN(0x19ae23c5, 0xa9f3860a), TOBN(0xc4f0f839, 0x515dcf4b), - TOBN(0x3c7ecca3, 0x97f6306a), TOBN(0x744c44ae, 0x68a3a4b0), - TOBN(0x69cd13a0, 0xb3a1d8a2), TOBN(0x7cad0a1e, 0x5256b578), - TOBN(0xea653fcd, 0x33791d9e), TOBN(0x9cc2a05d, 0x74b2e05f), - TOBN(0x73b391dc, 0xfd7affa2), TOBN(0xddb7091e, 0xb6b05442), - TOBN(0xc71e27bf, 0x8538a5c6), TOBN(0x195c63dd, 0x89abff17), - TOBN(0xfd315285, 0x1b71e3da), TOBN(0x9cbdfda7, 0xfa680fa0), - TOBN(0x9db876ca, 0x849d7eab), TOBN(0xebe2764b, 0x3c273271), - TOBN(0x663357e3, 0xf208dcea), TOBN(0x8c5bd833, 0x565b1b70), - TOBN(0xccc3b4f5, 0x9837fc0d), TOBN(0x9b641ba8, 0xa79cf00f), - TOBN(0x7428243d, 0xdfdf3990), TOBN(0x83a594c4, 0x020786b1), - TOBN(0xb712451a, 0x526c4502), TOBN(0x9d39438e, 0x6adb3f93), - TOBN(0xfdb261e3, 0xe9ff0ccd), TOBN(0x80344e3c, 0xe07af4c3), - TOBN(0x75900d7c, 0x2fa4f126), TOBN(0x08a3b865, 0x5c99a232), - TOBN(0x2478b6bf, 0xdb25e0c3), TOBN(0x482cc2c2, 0x71db2edf), - TOBN(0x37df7e64, 0x5f321bb8), TOBN(0x8a93821b, 0x9a8005b4), - TOBN(0x3fa2f10c, 0xcc8c1958), TOBN(0x0d332218, 0x2c269d0a), - TOBN(0x20ab8119, 0xe246b0e6), TOBN(0xb39781e4, 0xd349fd17), - TOBN(0xd293231e, 0xb31aa100), TOBN(0x4b779c97, 0xbb032168), - TOBN(0x4b3f19e1, 0xc8470500), TOBN(0x45b7efe9, 0x0c4c869d), - TOBN(0xdb84f38a, 0xa1a6bbcc), TOBN(0x3b59cb15, 0xb2fddbc1), - TOBN(0xba5514df, 0x3fd165e8), TOBN(0x499fd6a9, 0x061f8811), - TOBN(0x72cd1fe0, 0xbfef9f00), TOBN(0x120a4bb9, 0x79ad7e8a), - TOBN(0xf2ffd095, 0x5f4a5ac5), TOBN(0xcfd174f1, 0x95a7a2f0), - TOBN(0xd42301ba, 0x9d17baf1), TOBN(0xd2fa487a, 0x77f22089), - TOBN(0x9cb09efe, 0xb1dc77e1), TOBN(0xe9566939, 0x21c99682), - TOBN(0x8c546901, 0x6c6067bb), TOBN(0xfd378574, 0x61c24456), - TOBN(0x2b6a6cbe, 0x81796b33), TOBN(0x62d550f6, 0x58e87f8b), - TOBN(0x1b763e1c, 0x7f1b01b4), TOBN(0x4b93cfea, 0x1b1b5e12), - TOBN(0xb9345238, 0x1d531696), TOBN(0x57201c00, 0x88cdde69), - TOBN(0xdde92251, 0x9a86afc7), TOBN(0xe3043895, 0xbd35cea8), - TOBN(0x7608c1e1, 0x8555970d), TOBN(0x8267dfa9, 0x2535935e), - TOBN(0xd4c60a57, 0x322ea38b), TOBN(0xe0bf7977, 0x804ef8b5), - TOBN(0x1a0dab28, 0xc06fece4), TOBN(0xd405991e, 0x94e7b49d), - TOBN(0xc542b6d2, 0x706dab28), TOBN(0xcb228da3, 0xa91618fb), - TOBN(0x224e4164, 0x107d1cea), TOBN(0xeb9fdab3, 0xd0f5d8f1), - TOBN(0xc02ba386, 0x0d6e41cd), TOBN(0x676a72c5, 0x9b1f7146), - TOBN(0xffd6dd98, 0x4d6cb00b), TOBN(0xcef9c5ca, 0xde2e8d7c), - TOBN(0xa1bbf5d7, 0x641c7936), TOBN(0x1b95b230, 0xee8f772e), - TOBN(0xf765a92e, 0xe8ac25b1), TOBN(0xceb04cfc, 0x3a18b7c6), - TOBN(0x27944cef, 0x0acc8966), TOBN(0xcbb3c957, 0x434c1004), - TOBN(0x9c9971a1, 0xa43ff93c), TOBN(0x5bc2db17, 0xa1e358a9), - TOBN(0x45b4862e, 0xa8d9bc82), TOBN(0x70ebfbfb, 0x2201e052), - TOBN(0xafdf64c7, 0x92871591), TOBN(0xea5bcae6, 0xb42d0219), - TOBN(0xde536c55, 0x2ad8f03c), TOBN(0xcd6c3f4d, 0xa76aa33c), - TOBN(0xbeb5f623, 0x0bca6de3), TOBN(0xdd20dd99, 0xb1e706fd), - TOBN(0x90b3ff9d, 0xac9059d4), TOBN(0x2d7b2902, 0x7ccccc4e), - TOBN(0x8a090a59, 0xce98840f), TOBN(0xa5d947e0, 0x8410680a), - TOBN(0x49ae346a, 0x923379a5), TOBN(0x7dbc84f9, 0xb28a3156), - TOBN(0xfd40d916, 0x54a1aff2), TOBN(0xabf318ba, 0x3a78fb9b), - TOBN(0x50152ed8, 0x3029f95e), TOBN(0x9fc1dd77, 0xc58ad7fa), - TOBN(0x5fa57915, 0x13595c17), TOBN(0xb9504668, 0x8f62b3a9), - TOBN(0x907b5b24, 0xff3055b0), TOBN(0x2e995e35, 0x9a84f125), - TOBN(0x87dacf69, 0x7e9bbcfb), TOBN(0x95d0c1d6, 0xe86d96e3), - TOBN(0x65726e3c, 0x2d95a75c), TOBN(0x2c3c9001, 0xacd27f21), - TOBN(0x1deab561, 0x6c973f57), TOBN(0x108b7e2c, 0xa5221643), - TOBN(0x5fee9859, 0xc4ef79d4), TOBN(0xbd62b88a, 0x40d4b8c6), - TOBN(0xb4dd29c4, 0x197c75d6), TOBN(0x266a6df2, 0xb7076feb), - TOBN(0x9512d0ea, 0x4bf2df11), TOBN(0x1320c24f, 0x6b0cc9ec), - TOBN(0x6bb1e0e1, 0x01a59596), TOBN(0x8317c5bb, 0xeff9aaac), - TOBN(0x65bb405e, 0x385aa6c9), TOBN(0x613439c1, 0x8f07988f), - TOBN(0xd730049f, 0x16a66e91), TOBN(0xe97f2820, 0xfa1b0e0d), - TOBN(0x4131e003, 0x304c28ea), TOBN(0x820ab732, 0x526bac62), - TOBN(0xb2ac9ef9, 0x28714423), TOBN(0x54ecfffa, 0xadb10cb2), - TOBN(0x8781476e, 0xf886a4cc), TOBN(0x4b2c87b5, 0xdb2f8d49), - TOBN(0xe857cd20, 0x0a44295d), TOBN(0x707d7d21, 0x58c6b044), - TOBN(0xae8521f9, 0xf596757c), TOBN(0x87448f03, 0x67b2b714), - TOBN(0x13a9bc45, 0x5ebcd58d), TOBN(0x79bcced9, 0x9122d3c1), - TOBN(0x3c644247, 0x9e076642), TOBN(0x0cf22778, 0x2df4767d), - TOBN(0x5e61aee4, 0x71d444b6), TOBN(0x211236bf, 0xc5084a1d), - TOBN(0x7e15bc9a, 0x4fd3eaf6), TOBN(0x68df2c34, 0xab622bf5), - TOBN(0x9e674f0f, 0x59bf4f36), TOBN(0xf883669b, 0xd7f34d73), - TOBN(0xc48ac1b8, 0x31497b1d), TOBN(0x323b925d, 0x5106703b), - TOBN(0x22156f42, 0x74082008), TOBN(0xeffc521a, 0xc8482bcb), - TOBN(0x5c6831bf, 0x12173479), TOBN(0xcaa2528f, 0xc4739490), - TOBN(0x84d2102a, 0x8f1b3c4d), TOBN(0xcf64dfc1, 0x2d9bec0d), - TOBN(0x433febad, 0x78a546ef), TOBN(0x1f621ec3, 0x7b73cef1), - TOBN(0x6aecd627, 0x37338615), TOBN(0x162082ab, 0x01d8edf6), - TOBN(0x833a8119, 0x19e86b66), TOBN(0x6023a251, 0xd299b5db), - TOBN(0xf5bb0c3a, 0xbbf04b89), TOBN(0x6735eb69, 0xae749a44), - TOBN(0xd0e058c5, 0x4713de3b), TOBN(0xfdf2593e, 0x2c3d4ccd), - TOBN(0x1b8f414e, 0xfdd23667), TOBN(0xdd52aaca, 0xfa2015ee), - TOBN(0x3e31b517, 0xbd9625ff), TOBN(0x5ec9322d, 0x8db5918c), - TOBN(0xbc73ac85, 0xa96f5294), TOBN(0x82aa5bf3, 0x61a0666a), - TOBN(0x49755810, 0xbf08ac42), TOBN(0xd21cdfd5, 0x891cedfc), - TOBN(0x918cb57b, 0x67f8be10), TOBN(0x365d1a7c, 0x56ffa726), - TOBN(0x2435c504, 0x6532de93), TOBN(0xc0fc5e10, 0x2674cd02), - TOBN(0x6e51fcf8, 0x9cbbb142), TOBN(0x1d436e5a, 0xafc50692), - TOBN(0x766bffff, 0x3fbcae22), TOBN(0x3148c2fd, 0xfd55d3b8), - TOBN(0x52c7fdc9, 0x233222fa), TOBN(0x89ff1092, 0xe419fb6b), - TOBN(0x3cd6db99, 0x25254977), TOBN(0x2e85a161, 0x1cf12ca7), - TOBN(0xadd2547c, 0xdc810bc9), TOBN(0xea3f458f, 0x9d257c22), - TOBN(0x642c1fbe, 0x27d6b19b), TOBN(0xed07e6b5, 0x140481a6), - TOBN(0x6ada1d42, 0x86d2e0f8), TOBN(0xe5920122, 0x0e8a9fd5), - TOBN(0x02c936af, 0x708c1b49), TOBN(0x60f30fee, 0x2b4bfaff), - TOBN(0x6637ad06, 0x858e6a61), TOBN(0xce4c7767, 0x3fd374d0), - TOBN(0x39d54b2d, 0x7188defb), TOBN(0xa8c9d250, 0xf56a6b66), - TOBN(0x58fc0f5e, 0xb24fe1dc), TOBN(0x9eaf9dee, 0x6b73f24c), - TOBN(0xa90d588b, 0x33650705), TOBN(0xde5b62c5, 0xaf2ec729), - TOBN(0x5c72cfae, 0xd3c2b36e), TOBN(0x868c19d5, 0x034435da), - TOBN(0x88605f93, 0xe17ee145), TOBN(0xaa60c4ee, 0x77a5d5b1), - TOBN(0xbcf5bfd2, 0x3b60c472), TOBN(0xaf4ef13c, 0xeb1d3049), - TOBN(0x373f44fc, 0xe13895c9), TOBN(0xf29b382f, 0x0cbc9822), - TOBN(0x1bfcb853, 0x73efaef6), TOBN(0xcf56ac9c, 0xa8c96f40), - TOBN(0xd7adf109, 0x7a191e24), TOBN(0x98035f44, 0xbf8a8dc2), - TOBN(0xf40a71b9, 0x1e750c84), TOBN(0xc57f7b0c, 0x5dc6c469), - TOBN(0x49a0e79c, 0x6fbc19c1), TOBN(0x6b0f5889, 0xa48ebdb8), - TOBN(0x5d3fd084, 0xa07c4e9f), TOBN(0xc3830111, 0xab27de14), - TOBN(0x0e4929fe, 0x33e08dcc), TOBN(0xf4a5ad24, 0x40bb73a3), - TOBN(0xde86c2bf, 0x490f97ca), TOBN(0x288f09c6, 0x67a1ce18), - TOBN(0x364bb886, 0x1844478d), TOBN(0x7840fa42, 0xceedb040), - TOBN(0x1269fdd2, 0x5a631b37), TOBN(0x94761f1e, 0xa47c8b7d), - TOBN(0xfc0c2e17, 0x481c6266), TOBN(0x85e16ea2, 0x3daa5fa7), - TOBN(0xccd86033, 0x92491048), TOBN(0x0c2f6963, 0xf4d402d7), - TOBN(0x6336f7df, 0xdf6a865c), TOBN(0x0a2a463c, 0xb5c02a87), - TOBN(0xb0e29be7, 0xbf2f12ee), TOBN(0xf0a22002, 0x66bad988), - TOBN(0x27f87e03, 0x9123c1d7), TOBN(0x21669c55, 0x328a8c98), - TOBN(0x186b9803, 0x92f14529), TOBN(0xd3d056cc, 0x63954df3), - TOBN(0x2f03fd58, 0x175a46f6), TOBN(0x63e34ebe, 0x11558558), - TOBN(0xe13fedee, 0x5b80cfa5), TOBN(0xe872a120, 0xd401dbd1), - TOBN(0x52657616, 0xe8a9d667), TOBN(0xbc8da4b6, 0xe08d6693), - TOBN(0x370fb9bb, 0x1b703e75), TOBN(0x6773b186, 0xd4338363), - TOBN(0x18dad378, 0xecef7bff), TOBN(0xaac787ed, 0x995677da), - TOBN(0x4801ea8b, 0x0437164b), TOBN(0xf430ad20, 0x73fe795e), - TOBN(0xb164154d, 0x8ee5eb73), TOBN(0x0884ecd8, 0x108f7c0e), - TOBN(0x0e6ec096, 0x5f520698), TOBN(0x640631fe, 0x44f7b8d9), - TOBN(0x92fd34fc, 0xa35a68b9), TOBN(0x9c5a4b66, 0x4d40cf4e), - TOBN(0x949454bf, 0x80b6783d), TOBN(0x80e701fe, 0x3a320a10), - TOBN(0x8d1a564a, 0x1a0a39b2), TOBN(0x1436d53d, 0x320587db), - TOBN(0xf5096e6d, 0x6556c362), TOBN(0xbc23a3c0, 0xe2455d7e), - TOBN(0x3a7aee54, 0x807230f9), TOBN(0x9ba1cfa6, 0x22ae82fd), - TOBN(0x833a057a, 0x99c5d706), TOBN(0x8be85f4b, 0x842315c9), - TOBN(0xd083179a, 0x66a72f12), TOBN(0x2fc77d5d, 0xcdcc73cd), - TOBN(0x22b88a80, 0x5616ee30), TOBN(0xfb09548f, 0xe7ab1083), - TOBN(0x8ad6ab0d, 0x511270cd), TOBN(0x61f6c57a, 0x6924d9ab), - TOBN(0xa0f7bf72, 0x90aecb08), TOBN(0x849f87c9, 0x0df784a4), - TOBN(0x27c79c15, 0xcfaf1d03), TOBN(0xbbf9f675, 0xc463face), - TOBN(0x91502c65, 0x765ba543), TOBN(0x18ce3cac, 0x42ea60dd), - TOBN(0xe5cee6ac, 0x6e43ecb3), TOBN(0x63e4e910, 0x68f2aeeb), - TOBN(0x26234fa3, 0xc85932ee), TOBN(0x96883e8b, 0x4c90c44d), - TOBN(0x29b9e738, 0xa18a50f6), TOBN(0xbfc62b2a, 0x3f0420df), - TOBN(0xd22a7d90, 0x6d3e1fa9), TOBN(0x17115618, 0xfe05b8a3), - TOBN(0x2a0c9926, 0xbb2b9c01), TOBN(0xc739fcc6, 0xe07e76a2), - TOBN(0x540e9157, 0x165e439a), TOBN(0x06353a62, 0x6a9063d8), - TOBN(0x84d95594, 0x61e927a3), TOBN(0x013b9b26, 0xe2e0be7f), - TOBN(0x4feaec3b, 0x973497f1), TOBN(0x15c0f94e, 0x093ebc2d), - TOBN(0x6af5f227, 0x33af0583), TOBN(0x0c2af206, 0xc61f3340), - TOBN(0xd25dbdf1, 0x4457397c), TOBN(0x2e8ed017, 0xcabcbae0), - TOBN(0xe3010938, 0xc2815306), TOBN(0xbaa99337, 0xe8c6cd68), - TOBN(0x08513182, 0x3b0ec7de), TOBN(0x1e1b822b, 0x58df05df), - TOBN(0x5c14842f, 0xa5c3b683), TOBN(0x98fe977e, 0x3eba34ce), - TOBN(0xfd2316c2, 0x0d5e8873), TOBN(0xe48d839a, 0xbd0d427d), - TOBN(0x495b2218, 0x623fc961), TOBN(0x24ee56e7, 0xb46fba5e), - TOBN(0x9184a55b, 0x91e4de58), TOBN(0xa7488ca5, 0xdfdea288), - TOBN(0xa723862e, 0xa8dcc943), TOBN(0x92d762b2, 0x849dc0fc), - TOBN(0x3c444a12, 0x091ff4a9), TOBN(0x581113fa, 0x0cada274), - TOBN(0xb9de0a45, 0x30d8eae2), TOBN(0x5e0fcd85, 0xdf6b41ea), - TOBN(0x6233ea68, 0xc094dbb5), TOBN(0xb77d062e, 0xd968d410), - TOBN(0x3e719bbc, 0x58b3002d), TOBN(0x68e7dd3d, 0x3dc49d58), - TOBN(0x8d825740, 0x013a5e58), TOBN(0x21311747, 0x3c9e3c1b), - TOBN(0x0cb0a2a7, 0x7c99b6ab), TOBN(0x5c48a3b3, 0xc2f888f2)}, - {TOBN(0xc7913e91, 0x991724f3), TOBN(0x5eda799c, 0x39cbd686), - TOBN(0xddb595c7, 0x63d4fc1e), TOBN(0x6b63b80b, 0xac4fed54), - TOBN(0x6ea0fc69, 0x7e5fb516), TOBN(0x737708ba, 0xd0f1c964), - TOBN(0x9628745f, 0x11a92ca5), TOBN(0x61f37958, 0x9a86967a), - TOBN(0x9af39b2c, 0xaa665072), TOBN(0x78322fa4, 0xefd324ef), - TOBN(0x3d153394, 0xc327bd31), TOBN(0x81d5f271, 0x3129dab0), - TOBN(0xc72e0c42, 0xf48027f5), TOBN(0xaa40cdbc, 0x8536e717), - TOBN(0xf45a657a, 0x2d369d0f), TOBN(0xb03bbfc4, 0xea7f74e6), - TOBN(0x46a8c418, 0x0d738ded), TOBN(0x6f1a5bb0, 0xe0de5729), - TOBN(0xf10230b9, 0x8ba81675), TOBN(0x32c6f30c, 0x112b33d4), - TOBN(0x7559129d, 0xd8fffb62), TOBN(0x6a281b47, 0xb459bf05), - TOBN(0x77c1bd3a, 0xfa3b6776), TOBN(0x0709b380, 0x7829973a), - TOBN(0x8c26b232, 0xa3326505), TOBN(0x38d69272, 0xee1d41bf), - TOBN(0x0459453e, 0xffe32afa), TOBN(0xce8143ad, 0x7cb3ea87), - TOBN(0x932ec1fa, 0x7e6ab666), TOBN(0x6cd2d230, 0x22286264), - TOBN(0x459a46fe, 0x6736f8ed), TOBN(0x50bf0d00, 0x9eca85bb), - TOBN(0x0b825852, 0x877a21ec), TOBN(0x300414a7, 0x0f537a94), - TOBN(0x3f1cba40, 0x21a9a6a2), TOBN(0x50824eee, 0x76943c00), - TOBN(0xa0dbfcec, 0xf83cba5d), TOBN(0xf9538148, 0x93b4f3c0), - TOBN(0x61744162, 0x48f24dd7), TOBN(0x5322d64d, 0xe4fb09dd), - TOBN(0x57447384, 0x3d9325f3), TOBN(0xa9bef2d0, 0xf371cb84), - TOBN(0x77d2188b, 0xa61e36c5), TOBN(0xbbd6a7d7, 0xc602df72), - TOBN(0xba3aa902, 0x8f61bc0b), TOBN(0xf49085ed, 0x6ed0b6a1), - TOBN(0x8bc625d6, 0xae6e8298), TOBN(0x832b0b1d, 0xa2e9c01d), - TOBN(0xa337c447, 0xf1f0ced1), TOBN(0x800cc793, 0x9492dd2b), - TOBN(0x4b93151d, 0xbea08efa), TOBN(0x820cf3f8, 0xde0a741e), - TOBN(0xff1982dc, 0x1c0f7d13), TOBN(0xef921960, 0x84dde6ca), - TOBN(0x1ad7d972, 0x45f96ee3), TOBN(0x319c8dbe, 0x29dea0c7), - TOBN(0xd3ea3871, 0x7b82b99b), TOBN(0x75922d4d, 0x470eb624), - TOBN(0x8f66ec54, 0x3b95d466), TOBN(0x66e673cc, 0xbee1e346), - TOBN(0x6afe67c4, 0xb5f2b89a), TOBN(0x3de9c1e6, 0x290e5cd3), - TOBN(0x8c278bb6, 0x310a2ada), TOBN(0x420fa384, 0x0bdb323b), - TOBN(0x0ae1d63b, 0x0eb919b0), TOBN(0xd74ee51d, 0xa74b9620), - TOBN(0x395458d0, 0xa674290c), TOBN(0x324c930f, 0x4620a510), - TOBN(0x2d1f4d19, 0xfbac27d4), TOBN(0x4086e8ca, 0x9bedeeac), - TOBN(0x0cdd211b, 0x9b679ab8), TOBN(0x5970167d, 0x7090fec4), - TOBN(0x3420f2c9, 0xfaf1fc63), TOBN(0x616d333a, 0x328c8bb4), - TOBN(0x7d65364c, 0x57f1fe4a), TOBN(0x9343e877, 0x55e5c73a), - TOBN(0x5795176b, 0xe970e78c), TOBN(0xa36ccebf, 0x60533627), - TOBN(0xfc7c7380, 0x09cdfc1b), TOBN(0xb39a2afe, 0xb3fec326), - TOBN(0xb7ff1ba1, 0x6224408a), TOBN(0xcc856e92, 0x247cfc5e), - TOBN(0x01f102e7, 0xc18bc493), TOBN(0x4613ab74, 0x2091c727), - TOBN(0xaa25e89c, 0xc420bf2b), TOBN(0x00a53176, 0x90337ec2), - TOBN(0xd2be9f43, 0x7d025fc7), TOBN(0x3316fb85, 0x6e6fe3dc), - TOBN(0x27520af5, 0x9ac50814), TOBN(0xfdf95e78, 0x9a8e4223), - TOBN(0xb7e7df2a, 0x56bec5a0), TOBN(0xf7022f7d, 0xdf159e5d), - TOBN(0x93eeeab1, 0xcac1fe8f), TOBN(0x8040188c, 0x37451168), - TOBN(0x7ee8aa8a, 0xd967dce6), TOBN(0xfa0e79e7, 0x3abc9299), - TOBN(0x67332cfc, 0x2064cfd1), TOBN(0x339c31de, 0xb0651934), - TOBN(0x719b28d5, 0x2a3bcbea), TOBN(0xee74c82b, 0x9d6ae5c6), - TOBN(0x0927d05e, 0xbaf28ee6), TOBN(0x82cecf2c, 0x9d719028), - TOBN(0x0b0d353e, 0xddb30289), TOBN(0xfe4bb977, 0xfddb2e29), - TOBN(0xbb5bb990, 0x640bfd9e), TOBN(0xd226e277, 0x82f62108), - TOBN(0x4bf00985, 0x02ffdd56), TOBN(0x7756758a, 0x2ca1b1b5), - TOBN(0xc32b62a3, 0x5285fe91), TOBN(0xedbc546a, 0x8c9cd140), - TOBN(0x1e47a013, 0xaf5cb008), TOBN(0xbca7e720, 0x073ce8f2), - TOBN(0xe10b2ab8, 0x17a91cae), TOBN(0xb89aab65, 0x08e27f63), - TOBN(0x7b3074a7, 0xdba3ddf9), TOBN(0x1c20ce09, 0x330c2972), - TOBN(0x6b9917b4, 0x5fcf7e33), TOBN(0xe6793743, 0x945ceb42), - TOBN(0x18fc2215, 0x5c633d19), TOBN(0xad1adb3c, 0xc7485474), - TOBN(0x646f9679, 0x6424c49b), TOBN(0xf888dfe8, 0x67c241c9), - TOBN(0xe12d4b93, 0x24f68b49), TOBN(0x9a6b62d8, 0xa571df20), - TOBN(0x81b4b26d, 0x179483cb), TOBN(0x666f9632, 0x9511fae2), - TOBN(0xd281b3e4, 0xd53aa51f), TOBN(0x7f96a765, 0x7f3dbd16), - TOBN(0xa7f8b5bf, 0x074a30ce), TOBN(0xd7f52107, 0x005a32e6), - TOBN(0x6f9e0907, 0x50237ed4), TOBN(0x2f21da47, 0x8096fa2b), - TOBN(0xf3e19cb4, 0xeec863a0), TOBN(0xd18f77fd, 0x9527620a), - TOBN(0x9505c81c, 0x407c1cf8), TOBN(0x9998db4e, 0x1b6ec284), - TOBN(0x7e3389e5, 0xc247d44d), TOBN(0x12507141, 0x3f4f3d80), - TOBN(0xd4ba0110, 0x4a78a6c7), TOBN(0x312874a0, 0x767720be), - TOBN(0xded059a6, 0x75944370), TOBN(0xd6123d90, 0x3b2c0bdd), - TOBN(0xa56b717b, 0x51c108e3), TOBN(0x9bb7940e, 0x070623e9), - TOBN(0x794e2d59, 0x84ac066c), TOBN(0xf5954a92, 0xe68c69a0), - TOBN(0x28c52458, 0x4fd99dcc), TOBN(0x60e639fc, 0xb1012517), - TOBN(0xc2e60125, 0x7de79248), TOBN(0xe9ef6404, 0xf12fc6d7), - TOBN(0x4c4f2808, 0x2a3b5d32), TOBN(0x865ad32e, 0xc768eb8a), - TOBN(0xac02331b, 0x13fb70b6), TOBN(0x037b44c1, 0x95599b27), - TOBN(0x1a860fc4, 0x60bd082c), TOBN(0xa2e25745, 0xc980cd01), - TOBN(0xee3387a8, 0x1da0263e), TOBN(0x931bfb95, 0x2d10f3d6), - TOBN(0x5b687270, 0xa1f24a32), TOBN(0xf140e65d, 0xca494b86), - TOBN(0x4f4ddf91, 0xb2f1ac7a), TOBN(0xf99eaabb, 0x760fee27), - TOBN(0x57f4008a, 0x49c228e5), TOBN(0x090be440, 0x1cf713bb), - TOBN(0xac91fbe4, 0x5004f022), TOBN(0xd838c2c2, 0x569e1af6), - TOBN(0xd6c7d20b, 0x0f1daaa5), TOBN(0xaa063ac1, 0x1bbb02c0), - TOBN(0x0938a422, 0x59558a78), TOBN(0x5343c669, 0x8435da2f), - TOBN(0x96f67b18, 0x034410dc), TOBN(0x7cc1e424, 0x84510804), - TOBN(0x86a1543f, 0x16dfbb7d), TOBN(0x921fa942, 0x5b5bd592), - TOBN(0x9dcccb6e, 0xb33dd03c), TOBN(0x8581ddd9, 0xb843f51e), - TOBN(0x54935fcb, 0x81d73c9e), TOBN(0x6d07e979, 0x0a5e97ab), - TOBN(0x4dc7b30a, 0xcf3a6bab), TOBN(0x147ab1f3, 0x170bee11), - TOBN(0x0aaf8e3d, 0x9fafdee4), TOBN(0xfab3dbcb, 0x538a8b95), - TOBN(0x405df4b3, 0x6ef13871), TOBN(0xf1f4e9cb, 0x088d5a49), - TOBN(0x9bcd24d3, 0x66b33f1d), TOBN(0x3b97b820, 0x5ce445c0), - TOBN(0xe2926549, 0xba93ff61), TOBN(0xd9c341ce, 0x4dafe616), - TOBN(0xfb30a76e, 0x16efb6f3), TOBN(0xdf24b8ca, 0x605b953c), - TOBN(0x8bd52afe, 0xc2fffb9f), TOBN(0xbbac5ff7, 0xe19d0b96), - TOBN(0x43c01b87, 0x459afccd), TOBN(0x6bd45143, 0xb7432652), - TOBN(0x84734530, 0x55b5d78e), TOBN(0x81088fdb, 0x1554ba7d), - TOBN(0xada0a52c, 0x1e269375), TOBN(0xf9f037c4, 0x2dc5ec10), - TOBN(0xc0660607, 0x94bfbc11), TOBN(0xc0a630bb, 0xc9c40d2f), - TOBN(0x5efc797e, 0xab64c31e), TOBN(0xffdb1dab, 0x74507144), - TOBN(0xf6124287, 0x1ca6790c), TOBN(0xe9609d81, 0xe69bf1bf), - TOBN(0xdb898595, 0x00d24fc9), TOBN(0x9c750333, 0xe51fb417), - TOBN(0x51830a91, 0xfef7bbde), TOBN(0x0ce67dc8, 0x945f585c), - TOBN(0x9a730ed4, 0x4763eb50), TOBN(0x24a0e221, 0xc1ab0d66), - TOBN(0x643b6393, 0x648748f3), TOBN(0x1982daa1, 0x6d3c6291), - TOBN(0x6f00a9f7, 0x8bbc5549), TOBN(0x7a1783e1, 0x7f36384e), - TOBN(0xe8346323, 0xde977f50), TOBN(0x91ab688d, 0xb245502a), - TOBN(0x331ab6b5, 0x6d0bdd66), TOBN(0x0a6ef32e, 0x64b71229), - TOBN(0x1028150e, 0xfe7c352f), TOBN(0x27e04350, 0xce7b39d3), - TOBN(0x2a3c8acd, 0xc1070c82), TOBN(0xfb2034d3, 0x80c9feef), - TOBN(0x2d729621, 0x709f3729), TOBN(0x8df290bf, 0x62cb4549), - TOBN(0x02f99f33, 0xfc2e4326), TOBN(0x3b30076d, 0x5eddf032), - TOBN(0xbb21f8cf, 0x0c652fb5), TOBN(0x314fb49e, 0xed91cf7b), - TOBN(0xa013eca5, 0x2f700750), TOBN(0x2b9e3c23, 0x712a4575), - TOBN(0xe5355557, 0xaf30fbb0), TOBN(0x1ada3516, 0x7c77e771), - TOBN(0x45f6ecb2, 0x7b135670), TOBN(0xe85d19df, 0x7cfc202e), - TOBN(0x0f1b50c7, 0x58d1be9f), TOBN(0x5ebf2c0a, 0xead2e344), - TOBN(0x1531fe4e, 0xabc199c9), TOBN(0xc7032592, 0x56bab0ae), - TOBN(0x16ab2e48, 0x6c1fec54), TOBN(0x0f87fda8, 0x04280188), - TOBN(0xdc9f46fc, 0x609e4a74), TOBN(0x2a44a143, 0xba667f91), - TOBN(0xbc3d8b95, 0xb4d83436), TOBN(0xa01e4bd0, 0xc7bd2958), - TOBN(0x7b182932, 0x73483c90), TOBN(0xa79c6aa1, 0xa7c7b598), - TOBN(0xbf3983c6, 0xeaaac07e), TOBN(0x8f18181e, 0x96e0d4e6), - TOBN(0x8553d37c, 0x051af62b), TOBN(0xe9a998eb, 0x0bf94496), - TOBN(0xe0844f9f, 0xb0d59aa1), TOBN(0x983fd558, 0xe6afb813), - TOBN(0x9670c0ca, 0x65d69804), TOBN(0x732b22de, 0x6ea5ff2d), - TOBN(0xd7640ba9, 0x5fd8623b), TOBN(0x9f619163, 0xa6351782), - TOBN(0x0bfc27ee, 0xacee5043), TOBN(0xae419e73, 0x2eb10f02), - TOBN(0x19c028d1, 0x8943fb05), TOBN(0x71f01cf7, 0xff13aa2a), - TOBN(0x7790737e, 0x8887a132), TOBN(0x67513309, 0x66318410), - TOBN(0x9819e8a3, 0x7ddb795e), TOBN(0xfecb8ef5, 0xdad100b2), - TOBN(0x59f74a22, 0x3021926a), TOBN(0xb7c28a49, 0x6f9b4c1c), - TOBN(0xed1a733f, 0x912ad0ab), TOBN(0x42a910af, 0x01a5659c), - TOBN(0x3842c6e0, 0x7bd68cab), TOBN(0x2b57fa38, 0x76d70ac8), - TOBN(0x8a6707a8, 0x3c53aaeb), TOBN(0x62c1c510, 0x65b4db18), - TOBN(0x8de2c1fb, 0xb2d09dc7), TOBN(0xc3dfed12, 0x266bd23b), - TOBN(0x927d039b, 0xd5b27db6), TOBN(0x2fb2f0f1, 0x103243da), - TOBN(0xf855a07b, 0x80be7399), TOBN(0xed9327ce, 0x1f9f27a8), - TOBN(0xa0bd99c7, 0x729bdef7), TOBN(0x2b67125e, 0x28250d88), - TOBN(0x784b26e8, 0x8670ced7), TOBN(0xe3dfe41f, 0xc31bd3b4), - TOBN(0x9e353a06, 0xbcc85cbc), TOBN(0x302e2909, 0x60178a9d), - TOBN(0x860abf11, 0xa6eac16e), TOBN(0x76447000, 0xaa2b3aac), - TOBN(0x46ff9d19, 0x850afdab), TOBN(0x35bdd6a5, 0xfdb2d4c1), - TOBN(0xe82594b0, 0x7e5c9ce9), TOBN(0x0f379e53, 0x20af346e), - TOBN(0x608b31e3, 0xbc65ad4a), TOBN(0x710c6b12, 0x267c4826), - TOBN(0x51c966f9, 0x71954cf1), TOBN(0xb1cec793, 0x0d0aa215), - TOBN(0x1f155989, 0x86bd23a8), TOBN(0xae2ff99c, 0xf9452e86), - TOBN(0xd8dd953c, 0x340ceaa2), TOBN(0x26355275, 0x2e2e9333), - TOBN(0x15d4e5f9, 0x8586f06d), TOBN(0xd6bf94a8, 0xf7cab546), - TOBN(0x33c59a0a, 0xb76a9af0), TOBN(0x52740ab3, 0xba095af7), - TOBN(0xc444de8a, 0x24389ca0), TOBN(0xcc6f9863, 0x706da0cb), - TOBN(0xb5a741a7, 0x6b2515cf), TOBN(0x71c41601, 0x9585c749), - TOBN(0x78350d4f, 0xe683de97), TOBN(0x31d61524, 0x63d0b5f5), - TOBN(0x7a0cc5e1, 0xfbce090b), TOBN(0xaac927ed, 0xfbcb2a5b), - TOBN(0xe920de49, 0x20d84c35), TOBN(0x8c06a0b6, 0x22b4de26), - TOBN(0xd34dd58b, 0xafe7ddf3), TOBN(0x55851fed, 0xc1e6e55b), - TOBN(0xd1395616, 0x960696e7), TOBN(0x940304b2, 0x5f22705f), - TOBN(0x6f43f861, 0xb0a2a860), TOBN(0xcf121282, 0x0e7cc981), - TOBN(0x12186212, 0x0ab64a96), TOBN(0x09215b9a, 0xb789383c), - TOBN(0x311eb305, 0x37387c09), TOBN(0xc5832fce, 0xf03ee760), - TOBN(0x30358f58, 0x32f7ea19), TOBN(0xe01d3c34, 0x91d53551), - TOBN(0x1ca5ee41, 0xda48ea80), TOBN(0x34e71e8e, 0xcf4fa4c1), - TOBN(0x312abd25, 0x7af1e1c7), TOBN(0xe3afcdeb, 0x2153f4a5), - TOBN(0x9d5c84d7, 0x00235e9a), TOBN(0x0308d3f4, 0x8c4c836f), - TOBN(0xc0a66b04, 0x89332de5), TOBN(0x610dd399, 0x89e566ef), - TOBN(0xf8eea460, 0xd1ac1635), TOBN(0x84cbb3fb, 0x20a2c0df), - TOBN(0x40afb488, 0xe74a48c5), TOBN(0x29738198, 0xd326b150), - TOBN(0x2a17747f, 0xa6d74081), TOBN(0x60ea4c05, 0x55a26214), - TOBN(0x53514bb4, 0x1f88c5fe), TOBN(0xedd64567, 0x7e83426c), - TOBN(0xd5d6cbec, 0x96460b25), TOBN(0xa12fd0ce, 0x68dc115e), - TOBN(0xc5bc3ed2, 0x697840ea), TOBN(0x969876a8, 0xa6331e31), - TOBN(0x60c36217, 0x472ff580), TOBN(0xf4229705, 0x4ad41393), - TOBN(0x4bd99ef0, 0xa03b8b92), TOBN(0x501c7317, 0xc144f4f6), - TOBN(0x159009b3, 0x18464945), TOBN(0x6d5e594c, 0x74c5c6be), - TOBN(0x2d587011, 0x321a3660), TOBN(0xd1e184b1, 0x3898d022), - TOBN(0x5ba04752, 0x4c6a7e04), TOBN(0x47fa1e2b, 0x45550b65), - TOBN(0x9419daf0, 0x48c0a9a5), TOBN(0x66362953, 0x7c243236), - TOBN(0xcd0744b1, 0x5cb12a88), TOBN(0x561b6f9a, 0x2b646188), - TOBN(0x599415a5, 0x66c2c0c0), TOBN(0xbe3f0859, 0x0f83f09a), - TOBN(0x9141c5be, 0xb92041b8), TOBN(0x01ae38c7, 0x26477d0d), - TOBN(0xca8b71f3, 0xd12c7a94), TOBN(0xfab5b31f, 0x765c70db), - TOBN(0x76ae7492, 0x487443e9), TOBN(0x8595a310, 0x990d1349), - TOBN(0xf8dbeda8, 0x7d460a37), TOBN(0x7f7ad082, 0x1e45a38f), - TOBN(0xed1d4db6, 0x1059705a), TOBN(0xa3dd492a, 0xe6b9c697), - TOBN(0x4b92ee3a, 0x6eb38bd5), TOBN(0xbab2609d, 0x67cc0bb7), - TOBN(0x7fc4fe89, 0x6e70ee82), TOBN(0xeff2c56e, 0x13e6b7e3), - TOBN(0x9b18959e, 0x34d26fca), TOBN(0x2517ab66, 0x889d6b45), - TOBN(0xf167b4e0, 0xbdefdd4f), TOBN(0x69958465, 0xf366e401), - TOBN(0x5aa368ab, 0xa73bbec0), TOBN(0x12148709, 0x7b240c21), - TOBN(0x378c3233, 0x18969006), TOBN(0xcb4d73ce, 0xe1fe53d1), - TOBN(0x5f50a80e, 0x130c4361), TOBN(0xd67f5951, 0x7ef5212b), - TOBN(0xf145e21e, 0x9e70c72e), TOBN(0xb2e52e29, 0x5566d2fb), - TOBN(0x44eaba4a, 0x032397f5), TOBN(0x5e56937b, 0x7e31a7de), - TOBN(0x68dcf517, 0x456c61e1), TOBN(0xbc2e954a, 0xa8b0a388), - TOBN(0xe3552fa7, 0x60a8b755), TOBN(0x03442dae, 0x73ad0cde), - TOBN(0x37ffe747, 0xceb26210), TOBN(0x983545e8, 0x787baef9), - TOBN(0x8b8c8535, 0x86a3de31), TOBN(0xc621dbcb, 0xfacd46db), - TOBN(0x82e442e9, 0x59266fbb), TOBN(0xa3514c37, 0x339d471c), - TOBN(0x3a11b771, 0x62cdad96), TOBN(0xf0cb3b3c, 0xecf9bdf0), - TOBN(0x3fcbdbce, 0x478e2135), TOBN(0x7547b5cf, 0xbda35342), - TOBN(0xa97e81f1, 0x8a677af6), TOBN(0xc8c2bf83, 0x28817987), - TOBN(0xdf07eaaf, 0x45580985), TOBN(0xc68d1f05, 0xc93b45cb), - TOBN(0x106aa2fe, 0xc77b4cac), TOBN(0x4c1d8afc, 0x04a7ae86), - TOBN(0xdb41c3fd, 0x9eb45ab2), TOBN(0x5b234b5b, 0xd4b22e74), - TOBN(0xda253dec, 0xf215958a), TOBN(0x67e0606e, 0xa04edfa0), - TOBN(0xabbbf070, 0xef751b11), TOBN(0xf352f175, 0xf6f06dce), - TOBN(0xdfc4b6af, 0x6839f6b4), TOBN(0x53ddf9a8, 0x9959848e), - TOBN(0xda49c379, 0xc21520b0), TOBN(0x90864ff0, 0xdbd5d1b6), - TOBN(0x2f055d23, 0x5f49c7f7), TOBN(0xe51e4e6a, 0xa796b2d8), - TOBN(0xc361a67f, 0x5c9dc340), TOBN(0x5ad53c37, 0xbca7c620), - TOBN(0xda1d6588, 0x32c756d0), TOBN(0xad60d911, 0x8bb67e13), - TOBN(0xd6c47bdf, 0x0eeec8c6), TOBN(0x4a27fec1, 0x078a1821), - TOBN(0x081f7415, 0xc3099524), TOBN(0x8effdf0b, 0x82cd8060), - TOBN(0xdb70ec1c, 0x65842df8), TOBN(0x8821b358, 0xd319a901), - TOBN(0x72ee56ee, 0xde42b529), TOBN(0x5bb39592, 0x236e4286), - TOBN(0xd1183316, 0xfd6f7140), TOBN(0xf9fadb5b, 0xbd8e81f7), - TOBN(0x701d5e0c, 0x5a02d962), TOBN(0xfdee4dbf, 0x1b601324), - TOBN(0xbed17407, 0x35d7620e), TOBN(0x04e3c2c3, 0xf48c0012), - TOBN(0x9ee29da7, 0x3455449a), TOBN(0x562cdef4, 0x91a836c4), - TOBN(0x8f682a5f, 0x47701097), TOBN(0x617125d8, 0xff88d0c2), - TOBN(0x948fda24, 0x57bb86dd), TOBN(0x348abb8f, 0x289f7286), - TOBN(0xeb10eab5, 0x99d94bbd), TOBN(0xd51ba28e, 0x4684d160), - TOBN(0xabe0e51c, 0x30c8f41a), TOBN(0x66588b45, 0x13254f4a), - TOBN(0x147ebf01, 0xfad097a5), TOBN(0x49883ea8, 0x610e815d), - TOBN(0xe44d60ba, 0x8a11de56), TOBN(0xa970de6e, 0x827a7a6d), - TOBN(0x2be41424, 0x5e17fc19), TOBN(0xd833c657, 0x01214057), - TOBN(0x1375813b, 0x363e723f), TOBN(0x6820bb88, 0xe6a52e9b), - TOBN(0x7e7f6970, 0xd875d56a), TOBN(0xd6a0a9ac, 0x51fbf6bf), - TOBN(0x54ba8790, 0xa3083c12), TOBN(0xebaeb23d, 0x6ae7eb64), - TOBN(0xa8685c3a, 0xb99a907a), TOBN(0xf1e74550, 0x026bf40b), - TOBN(0x7b73a027, 0xc802cd9e), TOBN(0x9a8a927c, 0x4fef4635), - TOBN(0xe1b6f60c, 0x08191224), TOBN(0xc4126ebb, 0xde4ec091), - TOBN(0xe1dff4dc, 0x4ae38d84), TOBN(0xde3f57db, 0x4f2ef985), - TOBN(0x34964337, 0xd446a1dd), TOBN(0x7bf217a0, 0x859e77f6), - TOBN(0x8ff10527, 0x8e1d13f5), TOBN(0xa304ef03, 0x74eeae27), - TOBN(0xfc6f5e47, 0xd19dfa5a), TOBN(0xdb007de3, 0x7fad982b), - TOBN(0x28205ad1, 0x613715f5), TOBN(0x251e6729, 0x7889529e), - TOBN(0x72705184, 0x1ae98e78), TOBN(0xf818537d, 0x271cac32), - TOBN(0xc8a15b7e, 0xb7f410f5), TOBN(0xc474356f, 0x81f62393), - TOBN(0x92dbdc5a, 0xc242316b), TOBN(0xabe060ac, 0xdbf4aff5), - TOBN(0x6e8c38fe, 0x909a8ec6), TOBN(0x43e514e5, 0x6116cb94), - TOBN(0x2078fa38, 0x07d784f9), TOBN(0x1161a880, 0xf4b5b357), - TOBN(0x5283ce79, 0x13adea3d), TOBN(0x0756c3e6, 0xcc6a910b), - TOBN(0x60bcfe01, 0xaaa79697), TOBN(0x04a73b29, 0x56391db1), - TOBN(0xdd8dad47, 0x189b45a0), TOBN(0xbfac0dd0, 0x48d5b8d9), - TOBN(0x34ab3af5, 0x7d3d2ec2), TOBN(0x6fa2fc2d, 0x207bd3af), - TOBN(0x9ff40092, 0x66550ded), TOBN(0x719b3e87, 0x1fd5b913), - TOBN(0xa573a496, 0x6d17fbc7), TOBN(0x0cd1a70a, 0x73d2b24e), - TOBN(0x34e2c5ca, 0xb2676937), TOBN(0xe7050b06, 0xbf669f21), - TOBN(0xfbe948b6, 0x1ede9046), TOBN(0xa0530051, 0x97662659), - TOBN(0x58cbd4ed, 0xf10124c5), TOBN(0xde2646e4, 0xdd6c06c8), - TOBN(0x332f8108, 0x8cad38c0), TOBN(0x471b7e90, 0x6bd68ae2), - TOBN(0x56ac3fb2, 0x0d8e27a3), TOBN(0xb54660db, 0x136b4b0d), - TOBN(0x123a1e11, 0xa6fd8de4), TOBN(0x44dbffea, 0xa37799ef), - TOBN(0x4540b977, 0xce6ac17c), TOBN(0x495173a8, 0xaf60acef)}, - {TOBN(0x9ebb284d, 0x391c2a82), TOBN(0xbcdd4863, 0x158308e8), - TOBN(0x006f16ec, 0x83f1edca), TOBN(0xa13e2c37, 0x695dc6c8), - TOBN(0x2ab756f0, 0x4a057a87), TOBN(0xa8765500, 0xa6b48f98), - TOBN(0x4252face, 0x68651c44), TOBN(0xa52b540b, 0xe1765e02), - TOBN(0x4f922fc5, 0x16a0d2bb), TOBN(0x0d5cc16c, 0x1a623499), - TOBN(0x9241cf3a, 0x57c62c8b), TOBN(0x2f5e6961, 0xfd1b667f), - TOBN(0x5c15c70b, 0xf5a01797), TOBN(0x3d20b44d, 0x60956192), - TOBN(0x04911b37, 0x071fdb52), TOBN(0xf648f916, 0x8d6f0f7b), - TOBN(0x6dc1acaf, 0xe60b7cf7), TOBN(0x25860a50, 0x84a9d869), - TOBN(0x56fc6f09, 0xe7ba8ac4), TOBN(0x828c5bd0, 0x6148d29e), - TOBN(0xac6b435e, 0xdc55ae5f), TOBN(0xa527f56c, 0xc0117411), - TOBN(0x94d5045e, 0xfd24342c), TOBN(0x2c4c0a35, 0x70b67c0d), - TOBN(0x027cc8b8, 0xfac61d9a), TOBN(0x7d25e062, 0xe3c6fe8a), - TOBN(0xe08805bf, 0xe5bff503), TOBN(0x13271e6c, 0x6ff632f7), - TOBN(0x55dca6c0, 0x232f76a5), TOBN(0x8957c32d, 0x701ef426), - TOBN(0xee728bcb, 0xa10a5178), TOBN(0x5ea60411, 0xb62c5173), - TOBN(0xfc4e964e, 0xd0b8892b), TOBN(0x9ea17683, 0x9301bb74), - TOBN(0x6265c5ae, 0xfcc48626), TOBN(0xe60cf82e, 0xbb3e9102), - TOBN(0x57adf797, 0xd4df5531), TOBN(0x235b59a1, 0x8deeefe2), - TOBN(0x60adcf58, 0x3f306eb1), TOBN(0x105c2753, 0x3d09492d), - TOBN(0x4090914b, 0xb5def996), TOBN(0x1cb69c83, 0x233dd1e7), - TOBN(0xc1e9c1d3, 0x9b3d5e76), TOBN(0x1f3338ed, 0xfccf6012), - TOBN(0xb1e95d0d, 0x2f5378a8), TOBN(0xacf4c2c7, 0x2f00cd21), - TOBN(0x6e984240, 0xeb5fe290), TOBN(0xd66c038d, 0x248088ae), - TOBN(0x804d264a, 0xf94d70cf), TOBN(0xbdb802ef, 0x7314bf7e), - TOBN(0x8fb54de2, 0x4333ed02), TOBN(0x740461e0, 0x285635d9), - TOBN(0x4113b2c8, 0x365e9383), TOBN(0xea762c83, 0x3fdef652), - TOBN(0x4eec6e2e, 0x47b956c1), TOBN(0xa3d814be, 0x65620fa4), - TOBN(0x9ad5462b, 0xb4d8bc50), TOBN(0x181c0b16, 0xa9195770), - TOBN(0xebd4fe1c, 0x78412a68), TOBN(0xae0341bc, 0xc0dff48c), - TOBN(0xb6bc45cf, 0x7003e866), TOBN(0xf11a6dea, 0x8a24a41b), - TOBN(0x5407151a, 0xd04c24c2), TOBN(0x62c9d27d, 0xda5b7b68), - TOBN(0x2e964235, 0x88cceff6), TOBN(0x8594c54f, 0x8b07ed69), - TOBN(0x1578e73c, 0xc84d0d0d), TOBN(0x7b4e1055, 0xff532868), - TOBN(0xa348c0d5, 0xb5ec995a), TOBN(0xbf4b9d55, 0x14289a54), - TOBN(0x9ba155a6, 0x58fbd777), TOBN(0x186ed7a8, 0x1a84491d), - TOBN(0xd4992b30, 0x614c0900), TOBN(0xda98d121, 0xbd00c24b), - TOBN(0x7f534dc8, 0x7ec4bfa1), TOBN(0x4a5ff674, 0x37dc34bc), - TOBN(0x68c196b8, 0x1d7ea1d7), TOBN(0x38cf2893, 0x80a6d208), - TOBN(0xfd56cd09, 0xe3cbbd6e), TOBN(0xec72e27e, 0x4205a5b6), - TOBN(0x15ea68f5, 0xa44f77f7), TOBN(0x7aa5f9fd, 0xb43c52bc), - TOBN(0x86ff676f, 0x94f0e609), TOBN(0xa4cde963, 0x2e2d432b), - TOBN(0x8cafa0c0, 0xeee470af), TOBN(0x84137d0e, 0x8a3f5ec8), - TOBN(0xebb40411, 0xfaa31231), TOBN(0xa239c13f, 0x6f7f7ccf), - TOBN(0x32865719, 0xa8afd30b), TOBN(0x86798328, 0x8a826dce), - TOBN(0xdf04e891, 0xc4a8fbe0), TOBN(0xbb6b6e1b, 0xebf56ad3), - TOBN(0x0a695b11, 0x471f1ff0), TOBN(0xd76c3389, 0xbe15baf0), - TOBN(0x018edb95, 0xbe96c43e), TOBN(0xf2beaaf4, 0x90794158), - TOBN(0x152db09e, 0xc3076a27), TOBN(0x5e82908e, 0xe416545d), - TOBN(0xa2c41272, 0x356d6f2e), TOBN(0xdc9c9642, 0x31fd74e1), - TOBN(0x66ceb88d, 0x519bf615), TOBN(0xe29ecd76, 0x05a2274e), - TOBN(0x3a0473c4, 0xbf5e2fa0), TOBN(0x6b6eb671, 0x64284e67), - TOBN(0xe8b97932, 0xb88756dd), TOBN(0xed4e8652, 0xf17e3e61), - TOBN(0xc2dd1499, 0x3ee1c4a4), TOBN(0xc0aaee17, 0x597f8c0e), - TOBN(0x15c4edb9, 0x6c168af3), TOBN(0x6563c7bf, 0xb39ae875), - TOBN(0xadfadb6f, 0x20adb436), TOBN(0xad55e8c9, 0x9a042ac0), - TOBN(0x975a1ed8, 0xb76da1f5), TOBN(0x10dfa466, 0xa58acb94), - TOBN(0x8dd7f7e3, 0xac060282), TOBN(0x6813e66a, 0x572a051e), - TOBN(0xb4ccae1e, 0x350cb901), TOBN(0xb653d656, 0x50cb7822), - TOBN(0x42484710, 0xdfab3b87), TOBN(0xcd7ee537, 0x9b670fd0), - TOBN(0x0a50b12e, 0x523b8bf6), TOBN(0x8009eb5b, 0x8f910c1b), - TOBN(0xf535af82, 0x4a167588), TOBN(0x0f835f9c, 0xfb2a2abd), - TOBN(0xf59b2931, 0x2afceb62), TOBN(0xc797df2a, 0x169d383f), - TOBN(0xeb3f5fb0, 0x66ac02b0), TOBN(0x029d4c6f, 0xdaa2d0ca), - TOBN(0xd4059bc1, 0xafab4bc5), TOBN(0x833f5c6f, 0x56783247), - TOBN(0xb5346630, 0x8d2d3605), TOBN(0x83387891, 0xd34d8433), - TOBN(0xd973b30f, 0xadd9419a), TOBN(0xbcca1099, 0xafe3fce8), - TOBN(0x08178315, 0x0809aac6), TOBN(0x01b7f21a, 0x540f0f11), - TOBN(0x65c29219, 0x909523c8), TOBN(0xa62f648f, 0xa3a1c741), - TOBN(0x88598d4f, 0x60c9e55a), TOBN(0xbce9141b, 0x0e4f347a), - TOBN(0x9af97d84, 0x35f9b988), TOBN(0x0210da62, 0x320475b6), - TOBN(0x3c076e22, 0x9191476c), TOBN(0x7520dbd9, 0x44fc7834), - TOBN(0x6a6b2cfe, 0xc1ab1bbd), TOBN(0xef8a65be, 0xdc650938), - TOBN(0x72855540, 0x805d7bc4), TOBN(0xda389396, 0xed11fdfd), - TOBN(0xa9d5bd36, 0x74660876), TOBN(0x11d67c54, 0xb45dff35), - TOBN(0x6af7d148, 0xa4f5da94), TOBN(0xbb8d4c3f, 0xc0bbeb31), - TOBN(0x87a7ebd1, 0xe0a1b12a), TOBN(0x1e4ef88d, 0x770ba95f), - TOBN(0x8c33345c, 0xdc2ae9cb), TOBN(0xcecf1276, 0x01cc8403), - TOBN(0x687c012e, 0x1b39b80f), TOBN(0xfd90d0ad, 0x35c33ba4), - TOBN(0xa3ef5a67, 0x5c9661c2), TOBN(0x368fc88e, 0xe017429e), - TOBN(0xd30c6761, 0x196a2fa2), TOBN(0x931b9817, 0xbd5b312e), - TOBN(0xba01000c, 0x72f54a31), TOBN(0xa203d2c8, 0x66eaa541), - TOBN(0xf2abdee0, 0x98939db3), TOBN(0xe37d6c2c, 0x3e606c02), - TOBN(0xf2921574, 0x521ff643), TOBN(0x2781b3c4, 0xd7e2fca3), - TOBN(0x664300b0, 0x7850ec06), TOBN(0xac5a38b9, 0x7d3a10cf), - TOBN(0x9233188d, 0xe34ab39d), TOBN(0xe77057e4, 0x5072cbb9), - TOBN(0xbcf0c042, 0xb59e78df), TOBN(0x4cfc91e8, 0x1d97de52), - TOBN(0x4661a26c, 0x3ee0ca4a), TOBN(0x5620a4c1, 0xfb8507bc), - TOBN(0x4b44d4aa, 0x049f842c), TOBN(0xceabc5d5, 0x1540e82b), - TOBN(0x306710fd, 0x15c6f156), TOBN(0xbe5ae52b, 0x63db1d72), - TOBN(0x06f1e7e6, 0x334957f1), TOBN(0x57e388f0, 0x31144a70), - TOBN(0xfb69bb2f, 0xdf96447b), TOBN(0x0f78ebd3, 0x73e38a12), - TOBN(0xb8222605, 0x2b7ce542), TOBN(0xe6d4ce99, 0x7472bde1), - TOBN(0x53e16ebe, 0x09d2f4da), TOBN(0x180ff42e, 0x53b92b2e), - TOBN(0xc59bcc02, 0x2c34a1c6), TOBN(0x3803d6f9, 0x422c46c2), - TOBN(0x18aff74f, 0x5c14a8a2), TOBN(0x55aebf80, 0x10a08b28), - TOBN(0x66097d58, 0x7135593f), TOBN(0x32e6eff7, 0x2be570cd), - TOBN(0x584e6a10, 0x2a8c860d), TOBN(0xcd185890, 0xa2eb4163), - TOBN(0x7ceae99d, 0x6d97e134), TOBN(0xd42c6b70, 0xdd8447ce), - TOBN(0x59ddbb4a, 0xb8c50273), TOBN(0x03c612df, 0x3cf34e1e), - TOBN(0x84b9ca15, 0x04b6c5a0), TOBN(0x35216f39, 0x18f0e3a3), - TOBN(0x3ec2d2bc, 0xbd986c00), TOBN(0x8bf546d9, 0xd19228fe), - TOBN(0xd1c655a4, 0x4cd623c3), TOBN(0x366ce718, 0x502b8e5a), - TOBN(0x2cfc84b4, 0xeea0bfe7), TOBN(0xe01d5cee, 0xcf443e8e), - TOBN(0x8ec045d9, 0x036520f8), TOBN(0xdfb3c3d1, 0x92d40e98), - TOBN(0x0bac4cce, 0xcc559a04), TOBN(0x35eccae5, 0x240ea6b1), - TOBN(0x180b32db, 0xf8a5a0ac), TOBN(0x547972a5, 0xeb699700), - TOBN(0xa3765801, 0xca26bca0), TOBN(0x57e09d0e, 0xa647f25a), - TOBN(0xb956970e, 0x2fdd23cc), TOBN(0xb80288bc, 0x5682e971), - TOBN(0xe6e6d91e, 0x9ae86ebc), TOBN(0x0564c83f, 0x8c9f1939), - TOBN(0x551932a2, 0x39560368), TOBN(0xe893752b, 0x049c28e2), - TOBN(0x0b03cee5, 0xa6a158c3), TOBN(0xe12d656b, 0x04964263), - TOBN(0x4b47554e, 0x63e3bc1d), TOBN(0xc719b6a2, 0x45044ff7), - TOBN(0x4f24d30a, 0xe48daa07), TOBN(0xa3f37556, 0xc8c1edc3), - TOBN(0x9a47bf76, 0x0700d360), TOBN(0xbb1a1824, 0x822ae4e2), - TOBN(0x22e275a3, 0x89f1fb4c), TOBN(0x72b1aa23, 0x9968c5f5), - TOBN(0xa75feaca, 0xbe063f64), TOBN(0x9b392f43, 0xbce47a09), - TOBN(0xd4241509, 0x1ad07aca), TOBN(0x4b0c591b, 0x8d26cd0f), - TOBN(0x2d42ddfd, 0x92f1169a), TOBN(0x63aeb1ac, 0x4cbf2392), - TOBN(0x1de9e877, 0x0691a2af), TOBN(0xebe79af7, 0xd98021da), - TOBN(0xcfdf2a4e, 0x40e50acf), TOBN(0xf0a98ad7, 0xaf01d665), - TOBN(0xefb640bf, 0x1831be1f), TOBN(0x6fe8bd2f, 0x80e9ada0), - TOBN(0x94c103a1, 0x6cafbc91), TOBN(0x170f8759, 0x8308e08c), - TOBN(0x5de2d2ab, 0x9780ff4f), TOBN(0x666466bc, 0x45b201f2), - TOBN(0x58af2010, 0xf5b343bc), TOBN(0x0f2e400a, 0xf2f142fe), - TOBN(0x3483bfde, 0xa85f4bdf), TOBN(0xf0b1d093, 0x03bfeaa9), - TOBN(0x2ea01b95, 0xc7081603), TOBN(0xe943e4c9, 0x3dba1097), - TOBN(0x47be92ad, 0xb438f3a6), TOBN(0x00bb7742, 0xe5bf6636), - TOBN(0x136b7083, 0x824297b4), TOBN(0x9d0e5580, 0x5584455f), - TOBN(0xab48cedc, 0xf1c7d69e), TOBN(0x53a9e481, 0x2a256e76), - TOBN(0x0402b0e0, 0x65eb2413), TOBN(0xdadbbb84, 0x8fc407a7), - TOBN(0xa65cd5a4, 0x8d7f5492), TOBN(0x21d44293, 0x74bae294), - TOBN(0x66917ce6, 0x3b5f1cc4), TOBN(0x37ae52ea, 0xce872e62), - TOBN(0xbb087b72, 0x2905f244), TOBN(0x12077086, 0x1e6af74f), - TOBN(0x4b644e49, 0x1058edea), TOBN(0x827510e3, 0xb638ca1d), - TOBN(0x8cf2b704, 0x6038591c), TOBN(0xffc8b47a, 0xfe635063), - TOBN(0x3ae220e6, 0x1b4d5e63), TOBN(0xbd864742, 0x9d961b4b), - TOBN(0x610c107e, 0x9bd16bed), TOBN(0x4270352a, 0x1127147b), - TOBN(0x7d17ffe6, 0x64cfc50e), TOBN(0x50dee01a, 0x1e36cb42), - TOBN(0x068a7622, 0x35dc5f9a), TOBN(0x9a08d536, 0xdf53f62c), - TOBN(0x4ed71457, 0x6be5f7de), TOBN(0xd93006f8, 0xc2263c9e), - TOBN(0xe073694c, 0xcacacb36), TOBN(0x2ff7a5b4, 0x3ae118ab), - TOBN(0x3cce53f1, 0xcd871236), TOBN(0xf156a39d, 0xc2aa6d52), - TOBN(0x9cc5f271, 0xb198d76d), TOBN(0xbc615b6f, 0x81383d39), - TOBN(0xa54538e8, 0xde3eee6b), TOBN(0x58c77538, 0xab910d91), - TOBN(0x31e5bdbc, 0x58d278bd), TOBN(0x3cde4adf, 0xb963acae), - TOBN(0xb1881fd2, 0x5302169c), TOBN(0x8ca60fa0, 0xa989ed8b), - TOBN(0xa1999458, 0xff96a0ee), TOBN(0xc1141f03, 0xac6c283d), - TOBN(0x7677408d, 0x6dfafed3), TOBN(0x33a01653, 0x39661588), - TOBN(0x3c9c15ec, 0x0b726fa0), TOBN(0x090cfd93, 0x6c9b56da), - TOBN(0xe34f4bae, 0xa3c40af5), TOBN(0x3469eadb, 0xd21129f1), - TOBN(0xcc51674a, 0x1e207ce8), TOBN(0x1e293b24, 0xc83b1ef9), - TOBN(0x17173d13, 0x1e6c0bb4), TOBN(0x19004695, 0x90776d35), - TOBN(0xe7980e34, 0x6de6f922), TOBN(0x873554cb, 0xf4dd9a22), - TOBN(0x0316c627, 0xcbf18a51), TOBN(0x4d93651b, 0x3032c081), - TOBN(0x207f2771, 0x3946834d), TOBN(0x2c08d7b4, 0x30cdbf80), - TOBN(0x137a4fb4, 0x86df2a61), TOBN(0xa1ed9c07, 0xecf7b4a2), - TOBN(0xb2e460e2, 0x7bd042ff), TOBN(0xb7f5e2fa, 0x5f62f5ec), - TOBN(0x7aa6ec6b, 0xcc2423b7), TOBN(0x75ce0a7f, 0xba63eea7), - TOBN(0x67a45fb1, 0xf250a6e1), TOBN(0x93bc919c, 0xe53cdc9f), - TOBN(0x9271f56f, 0x871942df), TOBN(0x2372ff6f, 0x7859ad66), - TOBN(0x5f4c2b96, 0x33cb1a78), TOBN(0xe3e29101, 0x5838aa83), - TOBN(0xa7ed1611, 0xe4e8110c), TOBN(0x2a2d70d5, 0x330198ce), - TOBN(0xbdf132e8, 0x6720efe0), TOBN(0xe61a8962, 0x66a471bf), - TOBN(0x796d3a85, 0x825808bd), TOBN(0x51dc3cb7, 0x3fd6e902), - TOBN(0x643c768a, 0x916219d1), TOBN(0x36cd7685, 0xa2ad7d32), - TOBN(0xe3db9d05, 0xb22922a4), TOBN(0x6494c87e, 0xdba29660), - TOBN(0xf0ac91df, 0xbcd2ebc7), TOBN(0x4deb57a0, 0x45107f8d), - TOBN(0x42271f59, 0xc3d12a73), TOBN(0x5f71687c, 0xa5c2c51d), - TOBN(0xcb1f50c6, 0x05797bcb), TOBN(0x29ed0ed9, 0xd6d34eb0), - TOBN(0xe5fe5b47, 0x4683c2eb), TOBN(0x4956eeb5, 0x97447c46), - TOBN(0x5b163a43, 0x71207167), TOBN(0x93fa2fed, 0x0248c5ef), - TOBN(0x67930af2, 0x31f63950), TOBN(0xa77797c1, 0x14caa2c9), - TOBN(0x526e80ee, 0x27ac7e62), TOBN(0xe1e6e626, 0x58b28aec), - TOBN(0x636178b0, 0xb3c9fef0), TOBN(0xaf7752e0, 0x6d5f90be), - TOBN(0x94ecaf18, 0xeece51cf), TOBN(0x2864d0ed, 0xca806e1f), - TOBN(0x6de2e383, 0x97c69134), TOBN(0x5a42c316, 0xeb291293), - TOBN(0xc7779219, 0x6a60bae0), TOBN(0xa24de346, 0x6b7599d1), - TOBN(0x49d374aa, 0xb75d4941), TOBN(0x98900586, 0x2d501ff0), - TOBN(0x9f16d40e, 0xeb7974cf), TOBN(0x1033860b, 0xcdd8c115), - TOBN(0xb6c69ac8, 0x2094cec3), TOBN(0x9976fb88, 0x403b770c), - TOBN(0x1dea026c, 0x4859590d), TOBN(0xb6acbb46, 0x8562d1fd), - TOBN(0x7cd6c461, 0x44569d85), TOBN(0xc3190a36, 0x97f0891d), - TOBN(0xc6f53195, 0x48d5a17d), TOBN(0x7d919966, 0xd749abc8), - TOBN(0x65104837, 0xdd1c8a20), TOBN(0x7e5410c8, 0x2f683419), - TOBN(0x958c3ca8, 0xbe94022e), TOBN(0x605c3197, 0x6145dac2), - TOBN(0x3fc07501, 0x01683d54), TOBN(0x1d7127c5, 0x595b1234), - TOBN(0x10b8f87c, 0x9481277f), TOBN(0x677db2a8, 0xe65a1adb), - TOBN(0xec2fccaa, 0xddce3345), TOBN(0x2a6811b7, 0x012a4350), - TOBN(0x96760ff1, 0xac598bdc), TOBN(0x054d652a, 0xd1bf4128), - TOBN(0x0a1151d4, 0x92a21005), TOBN(0xad7f3971, 0x33110fdf), - TOBN(0x8c95928c, 0x1960100f), TOBN(0x6c91c825, 0x7bf03362), - TOBN(0xc8c8b2a2, 0xce309f06), TOBN(0xfdb27b59, 0xca27204b), - TOBN(0xd223eaa5, 0x0848e32e), TOBN(0xb93e4b2e, 0xe7bfaf1e), - TOBN(0xc5308ae6, 0x44aa3ded), TOBN(0x317a666a, 0xc015d573), - TOBN(0xc888ce23, 0x1a979707), TOBN(0xf141c1e6, 0x0d5c4958), - TOBN(0xb53b7de5, 0x61906373), TOBN(0x858dbade, 0xeb999595), - TOBN(0x8cbb47b2, 0xa59e5c36), TOBN(0x660318b3, 0xdcf4e842), - TOBN(0xbd161ccd, 0x12ba4b7a), TOBN(0xf399daab, 0xf8c8282a), - TOBN(0x1587633a, 0xeeb2130d), TOBN(0xa465311a, 0xda38dd7d), - TOBN(0x5f75eec8, 0x64d3779b), TOBN(0x3c5d0476, 0xad64c171), - TOBN(0x87410371, 0x2a914428), TOBN(0x8096a891, 0x90e2fc29), - TOBN(0xd3d2ae9d, 0x23b3ebc2), TOBN(0x90bdd6db, 0xa580cfd6), - TOBN(0x52dbb7f3, 0xc5b01f6c), TOBN(0xe68eded4, 0xe102a2dc), - TOBN(0x17785b77, 0x99eb6df0), TOBN(0x26c3cc51, 0x7386b779), - TOBN(0x345ed988, 0x6417a48e), TOBN(0xe990b4e4, 0x07d6ef31), - TOBN(0x0f456b7e, 0x2586abba), TOBN(0x239ca6a5, 0x59c96e9a), - TOBN(0xe327459c, 0xe2eb4206), TOBN(0x3a4c3313, 0xa002b90a), - TOBN(0x2a114806, 0xf6a3f6fb), TOBN(0xad5cad2f, 0x85c251dd), - TOBN(0x92c1f613, 0xf5a784d3), TOBN(0xec7bfacf, 0x349766d5), - TOBN(0x04b3cd33, 0x3e23cb3b), TOBN(0x3979fe84, 0xc5a64b2d), - TOBN(0x192e2720, 0x7e589106), TOBN(0xa60c43d1, 0xa15b527f), - TOBN(0x2dae9082, 0xbe7cf3a6), TOBN(0xcc86ba92, 0xbc967274), - TOBN(0xf28a2ce8, 0xaea0a8a9), TOBN(0x404ca6d9, 0x6ee988b3), - TOBN(0xfd7e9c5d, 0x005921b8), TOBN(0xf56297f1, 0x44e79bf9), - TOBN(0xa163b460, 0x0d75ddc2), TOBN(0x30b23616, 0xa1f2be87), - TOBN(0x4b070d21, 0xbfe50e2b), TOBN(0x7ef8cfd0, 0xe1bfede1), - TOBN(0xadba0011, 0x2aac4ae0), TOBN(0x2a3e7d01, 0xb9ebd033), - TOBN(0x995277ec, 0xe38d9d1c), TOBN(0xb500249e, 0x9c5d2de3), - TOBN(0x8912b820, 0xf13ca8c9), TOBN(0xc8798114, 0x877793af), - TOBN(0x19e6125d, 0xec3f1dec), TOBN(0x07b1f040, 0x911178da), - TOBN(0xd93ededa, 0x904a6738), TOBN(0x55187a5a, 0x0bebedcd), - TOBN(0xf7d04722, 0xeb329d41), TOBN(0xf449099e, 0xf170b391), - TOBN(0xfd317a69, 0xca99f828), TOBN(0x50c3db2b, 0x34a4976d), - TOBN(0xe9ba7784, 0x3757b392), TOBN(0x326caefd, 0xaa3ca05a), - TOBN(0x78e5293b, 0xf1e593d4), TOBN(0x7842a937, 0x0d98fd13), - TOBN(0xe694bf96, 0x5f96b10d), TOBN(0x373a9df6, 0x06a8cd05), - TOBN(0x997d1e51, 0xe8f0c7fc), TOBN(0x1d019790, 0x63fd972e), - TOBN(0x0064d858, 0x5499fb32), TOBN(0x7b67bad9, 0x77a8aeb7), - TOBN(0x1d3eb977, 0x2d08eec5), TOBN(0x5fc047a6, 0xcbabae1d), - TOBN(0x0577d159, 0xe54a64bb), TOBN(0x8862201b, 0xc43497e4), - TOBN(0xad6b4e28, 0x2ce0608d), TOBN(0x8b687b7d, 0x0b167aac), - TOBN(0x6ed4d367, 0x8b2ecfa9), TOBN(0x24dfe62d, 0xa90c3c38), - TOBN(0xa1862e10, 0x3fe5c42b), TOBN(0x1ca73dca, 0xd5732a9f), - TOBN(0x35f038b7, 0x76bb87ad), TOBN(0x674976ab, 0xf242b81f), - TOBN(0x4f2bde7e, 0xb0fd90cd), TOBN(0x6efc172e, 0xa7fdf092), - TOBN(0x3806b69b, 0x92222f1f), TOBN(0x5a2459ca, 0x6cf7ae70), - TOBN(0x6789f69c, 0xa85217ee), TOBN(0x5f232b5e, 0xe3dc85ac), - TOBN(0x660e3ec5, 0x48e9e516), TOBN(0x124b4e47, 0x3197eb31), - TOBN(0x10a0cb13, 0xaafcca23), TOBN(0x7bd63ba4, 0x8213224f), - TOBN(0xaffad7cc, 0x290a7f4f), TOBN(0x6b409c9e, 0x0286b461), - TOBN(0x58ab809f, 0xffa407af), TOBN(0xc3122eed, 0xc68ac073), - TOBN(0x17bf9e50, 0x4ef24d7e), TOBN(0x5d929794, 0x3e2a5811), - TOBN(0x519bc867, 0x02902e01), TOBN(0x76bba5da, 0x39c8a851), - TOBN(0xe9f9669c, 0xda94951e), TOBN(0x4b6af58d, 0x66b8d418), - TOBN(0xfa321074, 0x17d426a4), TOBN(0xc78e66a9, 0x9dde6027), - TOBN(0x0516c083, 0x4a53b964), TOBN(0xfc659d38, 0xff602330), - TOBN(0x0ab55e5c, 0x58c5c897), TOBN(0x985099b2, 0x838bc5df), - TOBN(0x061d9efc, 0xc52fc238), TOBN(0x712b2728, 0x6ac1da3f), - TOBN(0xfb658149, 0x9283fe08), TOBN(0x4954ac94, 0xb8aaa2f7), - TOBN(0x85c0ada4, 0x7fb2e74f), TOBN(0xee8ba98e, 0xb89926b0), - TOBN(0xe4f9d37d, 0x23d1af5b), TOBN(0x14ccdbf9, 0xba9b015e), - TOBN(0xb674481b, 0x7bfe7178), TOBN(0x4e1debae, 0x65405868), - TOBN(0x061b2821, 0xc48c867d), TOBN(0x69c15b35, 0x513b30ea), - TOBN(0x3b4a1666, 0x36871088), TOBN(0xe5e29f5d, 0x1220b1ff), - TOBN(0x4b82bb35, 0x233d9f4d), TOBN(0x4e076333, 0x18cdc675)}, - {TOBN(0x0d53f5c7, 0xa3e6fced), TOBN(0xe8cbbdd5, 0xf45fbdeb), - TOBN(0xf85c01df, 0x13339a70), TOBN(0x0ff71880, 0x142ceb81), - TOBN(0x4c4e8774, 0xbd70437a), TOBN(0x5fb32891, 0xba0bda6a), - TOBN(0x1cdbebd2, 0xf18bd26e), TOBN(0x2f9526f1, 0x03a9d522), - TOBN(0x40ce3051, 0x92c4d684), TOBN(0x8b04d725, 0x7612efcd), - TOBN(0xb9dcda36, 0x6f9cae20), TOBN(0x0edc4d24, 0xf058856c), - TOBN(0x64f2e6bf, 0x85427900), TOBN(0x3de81295, 0xdc09dfea), - TOBN(0xd41b4487, 0x379bf26c), TOBN(0x50b62c6d, 0x6df135a9), - TOBN(0xd4f8e3b4, 0xc72dfe67), TOBN(0xc416b0f6, 0x90e19fdf), - TOBN(0x18b9098d, 0x4c13bd35), TOBN(0xac11118a, 0x15b8cb9e), - TOBN(0xf598a318, 0xf0062841), TOBN(0xbfe0602f, 0x89f356f4), - TOBN(0x7ae3637e, 0x30177a0c), TOBN(0x34097747, 0x61136537), - TOBN(0x0db2fb5e, 0xd005832a), TOBN(0x5f5efd3b, 0x91042e4f), - TOBN(0x8c4ffdc6, 0xed70f8ca), TOBN(0xe4645d0b, 0xb52da9cc), - TOBN(0x9596f58b, 0xc9001d1f), TOBN(0x52c8f0bc, 0x4e117205), - TOBN(0xfd4aa0d2, 0xe398a084), TOBN(0x815bfe3a, 0x104f49de), - TOBN(0x97e5443f, 0x23885e5f), TOBN(0xf72f8f99, 0xe8433aab), - TOBN(0xbd00b154, 0xe4d4e604), TOBN(0xd0b35e6a, 0xe5e173ff), - TOBN(0x57b2a048, 0x9164722d), TOBN(0x3e3c665b, 0x88761ec8), - TOBN(0x6bdd1397, 0x3da83832), TOBN(0x3c8b1a1e, 0x73dafe3b), - TOBN(0x4497ace6, 0x54317cac), TOBN(0xbe600ab9, 0x521771b3), - TOBN(0xb42e409e, 0xb0dfe8b8), TOBN(0x386a67d7, 0x3942310f), - TOBN(0x25548d8d, 0x4431cc28), TOBN(0xa7cff142, 0x985dc524), - TOBN(0x4d60f5a1, 0x93c4be32), TOBN(0x83ebd5c8, 0xd071c6e1), - TOBN(0xba3a80a7, 0xb1fd2b0b), TOBN(0x9b3ad396, 0x5bec33e8), - TOBN(0xb3868d61, 0x79743fb3), TOBN(0xcfd169fc, 0xfdb462fa), - TOBN(0xd3b499d7, 0x9ce0a6af), TOBN(0x55dc1cf1, 0xe42d3ff8), - TOBN(0x04fb9e6c, 0xc6c3e1b2), TOBN(0x47e6961d, 0x6f69a474), - TOBN(0x54eb3acc, 0xe548b37b), TOBN(0xb38e7542, 0x84d40549), - TOBN(0x8c3daa51, 0x7b341b4f), TOBN(0x2f6928ec, 0x690bf7fa), - TOBN(0x0496b323, 0x86ce6c41), TOBN(0x01be1c55, 0x10adadcd), - TOBN(0xc04e67e7, 0x4bb5faf9), TOBN(0x3cbaf678, 0xe15c9985), - TOBN(0x8cd12145, 0x50ca4247), TOBN(0xba1aa47a, 0xe7dd30aa), - TOBN(0x2f81ddf1, 0xe58fee24), TOBN(0x03452936, 0xeec9b0e8), - TOBN(0x8bdc3b81, 0x243aea96), TOBN(0x9a2919af, 0x15c3d0e5), - TOBN(0x9ea640ec, 0x10948361), TOBN(0x5ac86d5b, 0x6e0bcccf), - TOBN(0xf892d918, 0xc36cf440), TOBN(0xaed3e837, 0xc939719c), - TOBN(0xb07b08d2, 0xc0218b64), TOBN(0x6f1bcbba, 0xce9790dd), - TOBN(0x4a84d6ed, 0x60919b8e), TOBN(0xd8900791, 0x8ac1f9eb), - TOBN(0xf84941aa, 0x0dd5daef), TOBN(0xb22fe40a, 0x67fd62c5), - TOBN(0x97e15ba2, 0x157f2db3), TOBN(0xbda2fc8f, 0x8e28ca9c), - TOBN(0x5d050da4, 0x37b9f454), TOBN(0x3d57eb57, 0x2379d72e), - TOBN(0xe9b5eba2, 0xfb5ee997), TOBN(0x01648ca2, 0xe11538ca), - TOBN(0x32bb76f6, 0xf6327974), TOBN(0x338f14b8, 0xff3f4bb7), - TOBN(0x524d226a, 0xd7ab9a2d), TOBN(0x9c00090d, 0x7dfae958), - TOBN(0x0ba5f539, 0x8751d8c2), TOBN(0x8afcbcdd, 0x3ab8262d), - TOBN(0x57392729, 0xe99d043b), TOBN(0xef51263b, 0xaebc943a), - TOBN(0x9feace93, 0x20862935), TOBN(0x639efc03, 0xb06c817b), - TOBN(0x1fe054b3, 0x66b4be7a), TOBN(0x3f25a9de, 0x84a37a1e), - TOBN(0xf39ef1ad, 0x78d75cd9), TOBN(0xd7b58f49, 0x5062c1b5), - TOBN(0x6f74f9a9, 0xff563436), TOBN(0xf718ff29, 0xe8af51e7), - TOBN(0x5234d313, 0x15e97fec), TOBN(0xb6a8e2b1, 0x292f1c0a), - TOBN(0xa7f53aa8, 0x327720c1), TOBN(0x956ca322, 0xba092cc8), - TOBN(0x8f03d64a, 0x28746c4d), TOBN(0x51fe1782, 0x66d0d392), - TOBN(0xd19b34db, 0x3c832c80), TOBN(0x60dccc5c, 0x6da2e3b4), - TOBN(0x245dd62e, 0x0a104ccc), TOBN(0xa7ab1de1, 0x620b21fd), - TOBN(0xb293ae0b, 0x3893d123), TOBN(0xf7b75783, 0xb15ee71c), - TOBN(0x5aa3c614, 0x42a9468b), TOBN(0xd686123c, 0xdb15d744), - TOBN(0x8c616891, 0xa7ab4116), TOBN(0x6fcd72c8, 0xa4e6a459), - TOBN(0xac219110, 0x77e5fad7), TOBN(0xfb6a20e7, 0x704fa46b), - TOBN(0xe839be7d, 0x341d81dc), TOBN(0xcddb6889, 0x32148379), - TOBN(0xda6211a1, 0xf7026ead), TOBN(0xf3b2575f, 0xf4d1cc5e), - TOBN(0x40cfc8f6, 0xa7a73ae6), TOBN(0x83879a5e, 0x61d5b483), - TOBN(0xc5acb1ed, 0x41a50ebc), TOBN(0x59a60cc8, 0x3c07d8fa), - TOBN(0x1b73bdce, 0xb1876262), TOBN(0x2b0d79f0, 0x12af4ee9), - TOBN(0x8bcf3b0b, 0xd46e1d07), TOBN(0x17d6af9d, 0xe45d152f), - TOBN(0x73520461, 0x6d736451), TOBN(0x43cbbd97, 0x56b0bf5a), - TOBN(0xb0833a5b, 0xd5999b9d), TOBN(0x702614f0, 0xeb72e398), - TOBN(0x0aadf01a, 0x59c3e9f8), TOBN(0x40200e77, 0xce6b3d16), - TOBN(0xda22bdd3, 0xdeddafad), TOBN(0x76dedaf4, 0x310d72e1), - TOBN(0x49ef807c, 0x4bc2e88f), TOBN(0x6ba81291, 0x146dd5a5), - TOBN(0xa1a4077a, 0x7d8d59e9), TOBN(0x87b6a2e7, 0x802db349), - TOBN(0xd5679997, 0x1b4e598e), TOBN(0xf499ef1f, 0x06fe4b1d), - TOBN(0x3978d3ae, 0xfcb267c5), TOBN(0xb582b557, 0x235786d0), - TOBN(0x32b3b2ca, 0x1715cb07), TOBN(0x4c3de6a2, 0x8480241d), - TOBN(0x63b5ffed, 0xcb571ecd), TOBN(0xeaf53900, 0xed2fe9a9), - TOBN(0xdec98d4a, 0xc3b81990), TOBN(0x1cb83722, 0x9e0cc8fe), - TOBN(0xfe0b0491, 0xd2b427b9), TOBN(0x0f2386ac, 0xe983a66c), - TOBN(0x930c4d1e, 0xb3291213), TOBN(0xa2f82b2e, 0x59a62ae4), - TOBN(0x77233853, 0xf93e89e3), TOBN(0x7f8063ac, 0x11777c7f), - TOBN(0xff0eb567, 0x59ad2877), TOBN(0x6f454642, 0x9865c754), - TOBN(0xe6fe701a, 0x236e9a84), TOBN(0xc586ef16, 0x06e40fc3), - TOBN(0x3f62b6e0, 0x24bafad9), TOBN(0xc8b42bd2, 0x64da906a), - TOBN(0xc98e1eb4, 0xda3276a0), TOBN(0x30d0e5fc, 0x06cbf852), - TOBN(0x1b6b2ae1, 0xe8b4dfd4), TOBN(0xd754d5c7, 0x8301cbac), - TOBN(0x66097629, 0x112a39ac), TOBN(0xf86b5999, 0x93ba4ab9), - TOBN(0x26c9dea7, 0x99f9d581), TOBN(0x0473b1a8, 0xc2fafeaa), - TOBN(0x1469af55, 0x3b2505a5), TOBN(0x227d16d7, 0xd6a43323), - TOBN(0x3316f73c, 0xad3d97f9), TOBN(0x52bf3bb5, 0x1f137455), - TOBN(0x953eafeb, 0x09954e7c), TOBN(0xa721dfed, 0xdd732411), - TOBN(0xb4929821, 0x141d4579), TOBN(0x3411321c, 0xaa3bd435), - TOBN(0xafb355aa, 0x17fa6015), TOBN(0xb4e7ef4a, 0x18e42f0e), - TOBN(0x604ac97c, 0x59371000), TOBN(0xe1c48c70, 0x7f759c18), - TOBN(0x3f62ecc5, 0xa5db6b65), TOBN(0x0a78b173, 0x38a21495), - TOBN(0x6be1819d, 0xbcc8ad94), TOBN(0x70dc04f6, 0xd89c3400), - TOBN(0x462557b4, 0xa6b4840a), TOBN(0x544c6ade, 0x60bd21c0), - TOBN(0x6a00f24e, 0x907a544b), TOBN(0xa7520dcb, 0x313da210), - TOBN(0xfe939b75, 0x11e4994b), TOBN(0x918b6ba6, 0xbc275d70), - TOBN(0xd3e5e0fc, 0x644be892), TOBN(0x707a9816, 0xfdaf6c42), - TOBN(0x60145567, 0xf15c13fe), TOBN(0x4818ebaa, 0xe130a54a), - TOBN(0x28aad3ad, 0x58d2f767), TOBN(0xdc5267fd, 0xd7e7c773), - TOBN(0x4919cc88, 0xc3afcc98), TOBN(0xaa2e6ab0, 0x2db8cd4b), - TOBN(0xd46fec04, 0xd0c63eaa), TOBN(0xa1cb92c5, 0x19ffa832), - TOBN(0x678dd178, 0xe43a631f), TOBN(0xfb5ae1cd, 0x3dc788b3), - TOBN(0x68b4fb90, 0x6e77de04), TOBN(0x7992bcf0, 0xf06dbb97), - TOBN(0x896e6a13, 0xc417c01d), TOBN(0x8d96332c, 0xb956be01), - TOBN(0x902fc93a, 0x413aa2b9), TOBN(0x99a4d915, 0xfc98c8a5), - TOBN(0x52c29407, 0x565f1137), TOBN(0x4072690f, 0x21e4f281), - TOBN(0x36e607cf, 0x02ff6072), TOBN(0xa47d2ca9, 0x8ad98cdc), - TOBN(0xbf471d1e, 0xf5f56609), TOBN(0xbcf86623, 0xf264ada0), - TOBN(0xb70c0687, 0xaa9e5cb6), TOBN(0xc98124f2, 0x17401c6c), - TOBN(0x8189635f, 0xd4a61435), TOBN(0xd28fb8af, 0xa9d98ea6), - TOBN(0xb9a67c2a, 0x40c251f8), TOBN(0x88cd5d87, 0xa2da44be), - TOBN(0x437deb96, 0xe09b5423), TOBN(0x150467db, 0x64287dc1), - TOBN(0xe161debb, 0xcdabb839), TOBN(0xa79e9742, 0xf1839a3e), - TOBN(0xbb8dd3c2, 0x652d202b), TOBN(0x7b3e67f7, 0xe9f97d96), - TOBN(0x5aa5d78f, 0xb1cb6ac9), TOBN(0xffa13e8e, 0xca1d0d45), - TOBN(0x369295dd, 0x2ba5bf95), TOBN(0xd68bd1f8, 0x39aff05e), - TOBN(0xaf0d86f9, 0x26d783f2), TOBN(0x543a59b3, 0xfc3aafc1), - TOBN(0x3fcf81d2, 0x7b7da97c), TOBN(0xc990a056, 0xd25dee46), - TOBN(0x3e6775b8, 0x519cce2c), TOBN(0xfc9af71f, 0xae13d863), - TOBN(0x774a4a6f, 0x47c1605c), TOBN(0x46ba4245, 0x2fd205e8), - TOBN(0xa06feea4, 0xd3fd524d), TOBN(0x1e724641, 0x6de1acc2), - TOBN(0xf53816f1, 0x334e2b42), TOBN(0x49e5918e, 0x922f0024), - TOBN(0x439530b6, 0x65c7322d), TOBN(0xcf12cc01, 0xb3c1b3fb), - TOBN(0xc70b0186, 0x0172f685), TOBN(0xb915ee22, 0x1b58391d), - TOBN(0x9afdf03b, 0xa317db24), TOBN(0x87dec659, 0x17b8ffc4), - TOBN(0x7f46597b, 0xe4d3d050), TOBN(0x80a1c1ed, 0x006500e7), - TOBN(0x84902a96, 0x78bf030e), TOBN(0xfb5e9c9a, 0x50560148), - TOBN(0x6dae0a92, 0x63362426), TOBN(0xdcaeecf4, 0xa9e30c40), - TOBN(0xc0d887bb, 0x518d0c6b), TOBN(0x99181152, 0xcb985b9d), - TOBN(0xad186898, 0xef7bc381), TOBN(0x18168ffb, 0x9ee46201), - TOBN(0x9a04cdaa, 0x2502753c), TOBN(0xbb279e26, 0x51407c41), - TOBN(0xeacb03aa, 0xf23564e5), TOBN(0x18336582, 0x71e61016), - TOBN(0x8684b8c4, 0xeb809877), TOBN(0xb336e18d, 0xea0e672e), - TOBN(0xefb601f0, 0x34ee5867), TOBN(0x2733edbe, 0x1341cfd1), - TOBN(0xb15e809a, 0x26025c3c), TOBN(0xe6e981a6, 0x9350df88), - TOBN(0x92376237, 0x8502fd8e), TOBN(0x4791f216, 0x0c12be9b), - TOBN(0xb7256789, 0x25f02425), TOBN(0xec863194, 0x7a974443), - TOBN(0x7c0ce882, 0xfb41cc52), TOBN(0xc266ff7e, 0xf25c07f2), - TOBN(0x3d4da8c3, 0x017025f3), TOBN(0xefcf628c, 0xfb9579b4), - TOBN(0x5c4d0016, 0x1f3716ec), TOBN(0x9c27ebc4, 0x6801116e), - TOBN(0x5eba0ea1, 0x1da1767e), TOBN(0xfe151452, 0x47004c57), - TOBN(0x3ace6df6, 0x8c2373b7), TOBN(0x75c3dffe, 0x5dbc37ac), - TOBN(0x3dc32a73, 0xddc925fc), TOBN(0xb679c841, 0x2f65ee0b), - TOBN(0x715a3295, 0x451cbfeb), TOBN(0xd9889768, 0xf76e9a29), - TOBN(0xec20ce7f, 0xb28ad247), TOBN(0xe99146c4, 0x00894d79), - TOBN(0x71457d7c, 0x9f5e3ea7), TOBN(0x097b2662, 0x38030031), - TOBN(0xdb7f6ae6, 0xcf9f82a8), TOBN(0x319decb9, 0x438f473a), - TOBN(0xa63ab386, 0x283856c3), TOBN(0x13e3172f, 0xb06a361b), - TOBN(0x2959f8dc, 0x7d5a006c), TOBN(0x2dbc27c6, 0x75fba752), - TOBN(0xc1227ab2, 0x87c22c9e), TOBN(0x06f61f75, 0x71a268b2), - TOBN(0x1b6bb971, 0x04779ce2), TOBN(0xaca83812, 0x0aadcb1d), - TOBN(0x297ae0bc, 0xaeaab2d5), TOBN(0xa5c14ee7, 0x5bfb9f13), - TOBN(0xaa00c583, 0xf17a62c7), TOBN(0x39eb962c, 0x173759f6), - TOBN(0x1eeba1d4, 0x86c9a88f), TOBN(0x0ab6c37a, 0xdf016c5e), - TOBN(0xa2a147db, 0xa28a0749), TOBN(0x246c20d6, 0xee519165), - TOBN(0x5068d1b1, 0xd3810715), TOBN(0xb1e7018c, 0x748160b9), - TOBN(0x03f5b1fa, 0xf380ff62), TOBN(0xef7fb1dd, 0xf3cb2c1e), - TOBN(0xeab539a8, 0xfc91a7da), TOBN(0x83ddb707, 0xf3f9b561), - TOBN(0xc550e211, 0xfe7df7a4), TOBN(0xa7cd07f2, 0x063f6f40), - TOBN(0xb0de3635, 0x2976879c), TOBN(0xb5f83f85, 0xe55741da), - TOBN(0x4ea9d25e, 0xf3d8ac3d), TOBN(0x6fe2066f, 0x62819f02), - TOBN(0x4ab2b9c2, 0xcef4a564), TOBN(0x1e155d96, 0x5ffa2de3), - TOBN(0x0eb0a19b, 0xc3a72d00), TOBN(0x4037665b, 0x8513c31b), - TOBN(0x2fb2b6bf, 0x04c64637), TOBN(0x45c34d6e, 0x08cdc639), - TOBN(0x56f1e10f, 0xf01fd796), TOBN(0x4dfb8101, 0xfe3667b8), - TOBN(0xe0eda253, 0x9021d0c0), TOBN(0x7a94e9ff, 0x8a06c6ab), - TOBN(0x2d3bb0d9, 0xbb9aa882), TOBN(0xea20e4e5, 0xec05fd10), - TOBN(0xed7eeb5f, 0x1a1ca64e), TOBN(0x2fa6b43c, 0xc6327cbd), - TOBN(0xb577e3cf, 0x3aa91121), TOBN(0x8c6bd5ea, 0x3a34079b), - TOBN(0xd7e5ba39, 0x60e02fc0), TOBN(0xf16dd2c3, 0x90141bf8), - TOBN(0xb57276d9, 0x80101b98), TOBN(0x760883fd, 0xb82f0f66), - TOBN(0x89d7de75, 0x4bc3eff3), TOBN(0x03b60643, 0x5dc2ab40), - TOBN(0xcd6e53df, 0xe05beeac), TOBN(0xf2f1e862, 0xbc3325cd), - TOBN(0xdd0f7921, 0x774f03c3), TOBN(0x97ca7221, 0x4552cc1b), - TOBN(0x5a0d6afe, 0x1cd19f72), TOBN(0xa20915dc, 0xf183fbeb), - TOBN(0x9fda4b40, 0x832c403c), TOBN(0x32738edd, 0xbe425442), - TOBN(0x469a1df6, 0xb5eccf1a), TOBN(0x4b5aff42, 0x28bbe1f0), - TOBN(0x31359d7f, 0x570dfc93), TOBN(0xa18be235, 0xf0088628), - TOBN(0xa5b30fba, 0xb00ed3a9), TOBN(0x34c61374, 0x73cdf8be), - TOBN(0x2c5c5f46, 0xabc56797), TOBN(0x5cecf93d, 0xb82a8ae2), - TOBN(0x7d3dbe41, 0xa968fbf0), TOBN(0xd23d4583, 0x1a5c7f3d), - TOBN(0xf28f69a0, 0xc087a9c7), TOBN(0xc2d75471, 0x474471ca), - TOBN(0x36ec9f4a, 0x4eb732ec), TOBN(0x6c943bbd, 0xb1ca6bed), - TOBN(0xd64535e1, 0xf2457892), TOBN(0x8b84a8ea, 0xf7e2ac06), - TOBN(0xe0936cd3, 0x2499dd5f), TOBN(0x12053d7e, 0x0ed04e57), - TOBN(0x4bdd0076, 0xe4305d9d), TOBN(0x34a527b9, 0x1f67f0a2), - TOBN(0xe79a4af0, 0x9cec46ea), TOBN(0xb15347a1, 0x658b9bc7), - TOBN(0x6bd2796f, 0x35af2f75), TOBN(0xac957990, 0x4051c435), - TOBN(0x2669dda3, 0xc33a655d), TOBN(0x5d503c2e, 0x88514aa3), - TOBN(0xdfa11337, 0x3753dd41), TOBN(0x3f054673, 0x0b754f78), - TOBN(0xbf185677, 0x496125bd), TOBN(0xfb0023c8, 0x3775006c), - TOBN(0xfa0f072f, 0x3a037899), TOBN(0x4222b6eb, 0x0e4aea57), - TOBN(0x3dde5e76, 0x7866d25a), TOBN(0xb6eb04f8, 0x4837aa6f), - TOBN(0x5315591a, 0x2cf1cdb8), TOBN(0x6dfb4f41, 0x2d4e683c), - TOBN(0x7e923ea4, 0x48ee1f3a), TOBN(0x9604d9f7, 0x05a2afd5), - TOBN(0xbe1d4a33, 0x40ea4948), TOBN(0x5b45f1f4, 0xb44cbd2f), - TOBN(0x5faf8376, 0x4acc757e), TOBN(0xa7cf9ab8, 0x63d68ff7), - TOBN(0x8ad62f69, 0xdf0e404b), TOBN(0xd65f33c2, 0x12bdafdf), - TOBN(0xc365de15, 0xa377b14e), TOBN(0x6bf5463b, 0x8e39f60c), - TOBN(0x62030d2d, 0x2ce68148), TOBN(0xd95867ef, 0xe6f843a8), - TOBN(0xd39a0244, 0xef5ab017), TOBN(0x0bd2d8c1, 0x4ab55d12), - TOBN(0xc9503db3, 0x41639169), TOBN(0x2d4e25b0, 0xf7660c8a), - TOBN(0x760cb3b5, 0xe224c5d7), TOBN(0xfa3baf8c, 0x68616919), - TOBN(0x9fbca113, 0x8d142552), TOBN(0x1ab18bf1, 0x7669ebf5), - TOBN(0x55e6f53e, 0x9bdf25dd), TOBN(0x04cc0bf3, 0xcb6cd154), - TOBN(0x595bef49, 0x95e89080), TOBN(0xfe9459a8, 0x104a9ac1), - TOBN(0xad2d89ca, 0xcce9bb32), TOBN(0xddea65e1, 0xf7de8285), - TOBN(0x62ed8c35, 0xb351bd4b), TOBN(0x4150ff36, 0x0c0e19a7), - TOBN(0x86e3c801, 0x345f4e47), TOBN(0x3bf21f71, 0x203a266c), - TOBN(0x7ae110d4, 0x855b1f13), TOBN(0x5d6aaf6a, 0x07262517), - TOBN(0x1e0f12e1, 0x813d28f1), TOBN(0x6000e11d, 0x7ad7a523), - TOBN(0xc7d8deef, 0xc744a17b), TOBN(0x1e990b48, 0x14c05a00), - TOBN(0x68fddaee, 0x93e976d5), TOBN(0x696241d1, 0x46610d63), - TOBN(0xb204e7c3, 0x893dda88), TOBN(0x8bccfa65, 0x6a3a6946), - TOBN(0xb59425b4, 0xc5cd1411), TOBN(0x701b4042, 0xff3658b1), - TOBN(0xe3e56bca, 0x4784cf93), TOBN(0x27de5f15, 0x8fe68d60), - TOBN(0x4ab9cfce, 0xf8d53f19), TOBN(0xddb10311, 0xa40a730d), - TOBN(0x6fa73cd1, 0x4eee0a8a), TOBN(0xfd548748, 0x5249719d), - TOBN(0x49d66316, 0xa8123ef0), TOBN(0x73c32db4, 0xe7f95438), - TOBN(0x2e2ed209, 0x0d9e7854), TOBN(0xf98a9329, 0x9d9f0507), - TOBN(0xc5d33cf6, 0x0c6aa20a), TOBN(0x9a32ba14, 0x75279bb2), - TOBN(0x7e3202cb, 0x774a7307), TOBN(0x64ed4bc4, 0xe8c42dbd), - TOBN(0xc20f1a06, 0xd4caed0d), TOBN(0xb8021407, 0x171d22b3), - TOBN(0xd426ca04, 0xd13268d7), TOBN(0x92377007, 0x25f4d126), - TOBN(0x4204cbc3, 0x71f21a85), TOBN(0x18461b7a, 0xf82369ba), - TOBN(0xc0c07d31, 0x3fc858f9), TOBN(0x5deb5a50, 0xe2bab569), - TOBN(0xd5959d46, 0xd5eea89e), TOBN(0xfdff8424, 0x08437f4b), - TOBN(0xf21071e4, 0x3cfe254f), TOBN(0x72417696, 0x95468321), - TOBN(0x5d8288b9, 0x102cae3e), TOBN(0x2d143e3d, 0xf1965dff), - TOBN(0x00c9a376, 0xa078d847), TOBN(0x6fc0da31, 0x26028731), - TOBN(0xa2baeadf, 0xe45083a2), TOBN(0x66bc7218, 0x5e5b4bcd), - TOBN(0x2c826442, 0xd04b8e7f), TOBN(0xc19f5451, 0x6c4b586b), - TOBN(0x60182c49, 0x5b7eeed5), TOBN(0xd9954ecd, 0x7aa9dfa1), - TOBN(0xa403a8ec, 0xc73884ad), TOBN(0x7fb17de2, 0x9bb39041), - TOBN(0x694b64c5, 0xabb020e8), TOBN(0x3d18c184, 0x19c4eec7), - TOBN(0x9c4673ef, 0x1c4793e5), TOBN(0xc7b8aeb5, 0x056092e6), - TOBN(0x3aa1ca43, 0xf0f8c16b), TOBN(0x224ed5ec, 0xd679b2f6), - TOBN(0x0d56eeaf, 0x55a205c9), TOBN(0xbfe115ba, 0x4b8e028b), - TOBN(0x97e60849, 0x3927f4fe), TOBN(0xf91fbf94, 0x759aa7c5), - TOBN(0x985af769, 0x6be90a51), TOBN(0xc1277b78, 0x78ccb823), - TOBN(0x395b656e, 0xe7a75952), TOBN(0x00df7de0, 0x928da5f5), - TOBN(0x09c23175, 0x4ca4454f), TOBN(0x4ec971f4, 0x7aa2d3c1), - TOBN(0x45c3c507, 0xe75d9ccc), TOBN(0x63b7be8a, 0x3dc90306), - TOBN(0x37e09c66, 0x5db44bdc), TOBN(0x50d60da1, 0x6841c6a2), - TOBN(0x6f9b65ee, 0x08df1b12), TOBN(0x38734879, 0x7ff089df), - TOBN(0x9c331a66, 0x3fe8013d), TOBN(0x017f5de9, 0x5f42fcc8), - TOBN(0x43077866, 0xe8e57567), TOBN(0xc9f781ce, 0xf9fcdb18), - TOBN(0x38131dda, 0x9b12e174), TOBN(0x25d84aa3, 0x8a03752a), - TOBN(0x45e09e09, 0x4d0c0ce2), TOBN(0x1564008b, 0x92bebba5), - TOBN(0xf7e8ad31, 0xa87284c7), TOBN(0xb7c4b46c, 0x97e7bbaa), - TOBN(0x3e22a7b3, 0x97acf4ec), TOBN(0x0426c400, 0x5ea8b640), - TOBN(0x5e3295a6, 0x4e969285), TOBN(0x22aabc59, 0xa6a45670), - TOBN(0xb929714c, 0x5f5942bc), TOBN(0x9a6168bd, 0xfa3182ed), - TOBN(0x2216a665, 0x104152ba), TOBN(0x46908d03, 0xb6926368)}, - {TOBN(0xa9f5d874, 0x5a1251fb), TOBN(0x967747a8, 0xc72725c7), - TOBN(0x195c33e5, 0x31ffe89e), TOBN(0x609d210f, 0xe964935e), - TOBN(0xcafd6ca8, 0x2fe12227), TOBN(0xaf9b5b96, 0x0426469d), - TOBN(0x2e9ee04c, 0x5693183c), TOBN(0x1084a333, 0xc8146fef), - TOBN(0x96649933, 0xaed1d1f7), TOBN(0x566eaff3, 0x50563090), - TOBN(0x345057f0, 0xad2e39cf), TOBN(0x148ff65b, 0x1f832124), - TOBN(0x042e89d4, 0xcf94cf0d), TOBN(0x319bec84, 0x520c58b3), - TOBN(0x2a267626, 0x5361aa0d), TOBN(0xc86fa302, 0x8fbc87ad), - TOBN(0xfc83d2ab, 0x5c8b06d5), TOBN(0xb1a785a2, 0xfe4eac46), - TOBN(0xb99315bc, 0x846f7779), TOBN(0xcf31d816, 0xef9ea505), - TOBN(0x2391fe6a, 0x15d7dc85), TOBN(0x2f132b04, 0xb4016b33), - TOBN(0x29547fe3, 0x181cb4c7), TOBN(0xdb66d8a6, 0x650155a1), - TOBN(0x6b66d7e1, 0xadc1696f), TOBN(0x98ebe593, 0x0acd72d0), - TOBN(0x65f24550, 0xcc1b7435), TOBN(0xce231393, 0xb4b9a5ec), - TOBN(0x234a22d4, 0xdb067df9), TOBN(0x98dda095, 0xcaff9b00), - TOBN(0x1bbc75a0, 0x6100c9c1), TOBN(0x1560a9c8, 0x939cf695), - TOBN(0xcf006d3e, 0x99e0925f), TOBN(0x2dd74a96, 0x6322375a), - TOBN(0xc58b446a, 0xb56af5ba), TOBN(0x50292683, 0xe0b9b4f1), - TOBN(0xe2c34cb4, 0x1aeaffa3), TOBN(0x8b17203f, 0x9b9587c1), - TOBN(0x6d559207, 0xead1350c), TOBN(0x2b66a215, 0xfb7f9604), - TOBN(0x0850325e, 0xfe51bf74), TOBN(0x9c4f579e, 0x5e460094), - TOBN(0x5c87b92a, 0x76da2f25), TOBN(0x889de4e0, 0x6febef33), - TOBN(0x6900ec06, 0x646083ce), TOBN(0xbe2a0335, 0xbfe12773), - TOBN(0xadd1da35, 0xc5344110), TOBN(0x757568b7, 0xb802cd20), - TOBN(0x75559779, 0x00f7e6c8), TOBN(0x38e8b94f, 0x0facd2f0), - TOBN(0xfea1f3af, 0x03fde375), TOBN(0x5e11a1d8, 0x75881dfc), - TOBN(0xb3a6b02e, 0xc1e2f2ef), TOBN(0x193d2bbb, 0xc605a6c5), - TOBN(0x325ffeee, 0x339a0b2d), TOBN(0x27b6a724, 0x9e0c8846), - TOBN(0xe4050f1c, 0xf1c367ca), TOBN(0x9bc85a9b, 0xc90fbc7d), - TOBN(0xa373c4a2, 0xe1a11032), TOBN(0xb64232b7, 0xad0393a9), - TOBN(0xf5577eb0, 0x167dad29), TOBN(0x1604f301, 0x94b78ab2), - TOBN(0x0baa94af, 0xe829348b), TOBN(0x77fbd8dd, 0x41654342), - TOBN(0xdab50ea5, 0xb964e39a), TOBN(0xd4c29e3c, 0xd0d3c76e), - TOBN(0x80dae67c, 0x56d11964), TOBN(0x7307a8bf, 0xe5ffcc2f), - TOBN(0x65bbc1aa, 0x91708c3b), TOBN(0xa151e62c, 0x28bf0eeb), - TOBN(0x6cb53381, 0x6fa34db7), TOBN(0x5139e05c, 0xa29403a8), - TOBN(0x6ff651b4, 0x94a7cd2e), TOBN(0x5671ffd1, 0x0699336c), - TOBN(0x6f5fd2cc, 0x979a896a), TOBN(0x11e893a8, 0xd8148cef), - TOBN(0x988906a1, 0x65cf7b10), TOBN(0x81b67178, 0xc50d8485), - TOBN(0x7c0deb35, 0x8a35b3de), TOBN(0x423ac855, 0xc1d29799), - TOBN(0xaf580d87, 0xdac50b74), TOBN(0x28b2b89f, 0x5869734c), - TOBN(0x99a3b936, 0x874e28fb), TOBN(0xbb2c9190, 0x25f3f73a), - TOBN(0x199f6918, 0x84a9d5b7), TOBN(0x7ebe2325, 0x7e770374), - TOBN(0xf442e107, 0x0738efe2), TOBN(0xcf9f3f56, 0xcf9082d2), - TOBN(0x719f69e1, 0x09618708), TOBN(0xcc9e8364, 0xc183f9b1), - TOBN(0xec203a95, 0x366a21af), TOBN(0x6aec5d6d, 0x068b141f), - TOBN(0xee2df78a, 0x994f04e9), TOBN(0xb39ccae8, 0x271245b0), - TOBN(0xb875a4a9, 0x97e43f4f), TOBN(0x507dfe11, 0xdb2cea98), - TOBN(0x4fbf81cb, 0x489b03e9), TOBN(0xdb86ec5b, 0x6ec414fa), - TOBN(0xfad444f9, 0xf51b3ae5), TOBN(0xca7d33d6, 0x1914e3fe), - TOBN(0xa9c32f5c, 0x0ae6c4d0), TOBN(0xa9ca1d1e, 0x73969568), - TOBN(0x98043c31, 0x1aa7467e), TOBN(0xe832e75c, 0xe21b5ac6), - TOBN(0x314b7aea, 0x5232123d), TOBN(0x08307c8c, 0x65ae86db), - TOBN(0x06e7165c, 0xaa4668ed), TOBN(0xb170458b, 0xb4d3ec39), - TOBN(0x4d2e3ec6, 0xc19bb986), TOBN(0xc5f34846, 0xae0304ed), - TOBN(0x917695a0, 0x6c9f9722), TOBN(0x6c7f7317, 0x4cab1c0a), - TOBN(0x6295940e, 0x9d6d2e8b), TOBN(0xd318b8c1, 0x549f7c97), - TOBN(0x22453204, 0x97713885), TOBN(0x468d834b, 0xa8a440fe), - TOBN(0xd81fe5b2, 0xbfba796e), TOBN(0x152364db, 0x6d71f116), - TOBN(0xbb8c7c59, 0xb5b66e53), TOBN(0x0b12c61b, 0x2641a192), - TOBN(0x31f14802, 0xfcf0a7fd), TOBN(0x42fd0789, 0x5488b01e), - TOBN(0x71d78d6d, 0x9952b498), TOBN(0x8eb572d9, 0x07ac5201), - TOBN(0xe0a2a44c, 0x4d194a88), TOBN(0xd2b63fd9, 0xba017e66), - TOBN(0x78efc6c8, 0xf888aefc), TOBN(0xb76f6bda, 0x4a881a11), - TOBN(0x187f314b, 0xb46c2397), TOBN(0x004cf566, 0x5ded2819), - TOBN(0xa9ea5704, 0x38764d34), TOBN(0xbba45217, 0x78084709), - TOBN(0x06474571, 0x1171121e), TOBN(0xad7b7eb1, 0xe7c9b671), - TOBN(0xdacfbc40, 0x730f7507), TOBN(0x178cd8c6, 0xc7ad7bd1), - TOBN(0xbf0be101, 0xb2a67238), TOBN(0x3556d367, 0xaf9c14f2), - TOBN(0x104b7831, 0xa5662075), TOBN(0x58ca59bb, 0x79d9e60a), - TOBN(0x4bc45392, 0xa569a73b), TOBN(0x517a52e8, 0x5698f6c9), - TOBN(0x85643da5, 0xaeadd755), TOBN(0x1aed0cd5, 0x2a581b84), - TOBN(0xb9b4ff84, 0x80af1372), TOBN(0x244c3113, 0xf1ba5d1f), - TOBN(0x2a5dacbe, 0xf5f98d31), TOBN(0x2c3323e8, 0x4375bc2a), - TOBN(0x17a3ab4a, 0x5594b1dd), TOBN(0xa1928bfb, 0xceb4797e), - TOBN(0xe83af245, 0xe4886a19), TOBN(0x8979d546, 0x72b5a74a), - TOBN(0xa0f726bc, 0x19f9e967), TOBN(0xd9d03152, 0xe8fbbf4e), - TOBN(0xcfd6f51d, 0xb7707d40), TOBN(0x633084d9, 0x63f6e6e0), - TOBN(0xedcd9cdc, 0x55667eaf), TOBN(0x73b7f92b, 0x2e44d56f), - TOBN(0xfb2e39b6, 0x4e962b14), TOBN(0x7d408f6e, 0xf671fcbf), - TOBN(0xcc634ddc, 0x164a89bb), TOBN(0x74a42bb2, 0x3ef3bd05), - TOBN(0x1280dbb2, 0x428decbb), TOBN(0x6103f6bb, 0x402c8596), - TOBN(0xfa2bf581, 0x355a5752), TOBN(0x562f96a8, 0x00946674), - TOBN(0x4e4ca16d, 0x6da0223b), TOBN(0xfe47819f, 0x28d3aa25), - TOBN(0x9eea3075, 0xf8dfcf8a), TOBN(0xa284f0aa, 0x95669825), - TOBN(0xb3fca250, 0x867d3fd8), TOBN(0x20757b5f, 0x269d691e), - TOBN(0xf2c24020, 0x93b8a5de), TOBN(0xd3f93359, 0xebc06da6), - TOBN(0x1178293e, 0xb2739c33), TOBN(0xd2a3e770, 0xbcd686e5), - TOBN(0xa76f49f4, 0xcd941534), TOBN(0x0d37406b, 0xe3c71c0e), - TOBN(0x172d9397, 0x3b97f7e3), TOBN(0xec17e239, 0xbd7fd0de), - TOBN(0xe3290551, 0x6f496ba2), TOBN(0x6a693172, 0x36ad50e7), - TOBN(0xc4e539a2, 0x83e7eff5), TOBN(0x752737e7, 0x18e1b4cf), - TOBN(0xa2f7932c, 0x68af43ee), TOBN(0x5502468e, 0x703d00bd), - TOBN(0xe5dc978f, 0x2fb061f5), TOBN(0xc9a1904a, 0x28c815ad), - TOBN(0xd3af538d, 0x470c56a4), TOBN(0x159abc5f, 0x193d8ced), - TOBN(0x2a37245f, 0x20108ef3), TOBN(0xfa17081e, 0x223f7178), - TOBN(0x27b0fb2b, 0x10c8c0f5), TOBN(0x2102c3ea, 0x40650547), - TOBN(0x594564df, 0x8ac3bfa7), TOBN(0x98102033, 0x509dad96), - TOBN(0x6989643f, 0xf1d18a13), TOBN(0x35eebd91, 0xd7fc5af0), - TOBN(0x078d096a, 0xfaeaafd8), TOBN(0xb7a89341, 0xdef3de98), - TOBN(0x2a206e8d, 0xecf2a73a), TOBN(0x066a6397, 0x8e551994), - TOBN(0x3a6a088a, 0xb98d53a2), TOBN(0x0ce7c67c, 0x2d1124aa), - TOBN(0x48cec671, 0x759a113c), TOBN(0xe3b373d3, 0x4f6f67fa), - TOBN(0x5455d479, 0xfd36727b), TOBN(0xe5a428ee, 0xa13c0d81), - TOBN(0xb853dbc8, 0x1c86682b), TOBN(0xb78d2727, 0xb8d02b2a), - TOBN(0xaaf69bed, 0x8ebc329a), TOBN(0xdb6b40b3, 0x293b2148), - TOBN(0xe42ea77d, 0xb8c4961f), TOBN(0xb1a12f7c, 0x20e5e0ab), - TOBN(0xa0ec5274, 0x79e8b05e), TOBN(0x68027391, 0xfab60a80), - TOBN(0x6bfeea5f, 0x16b1bd5e), TOBN(0xf957e420, 0x4de30ad3), - TOBN(0xcbaf664e, 0x6a353b9e), TOBN(0x5c873312, 0x26d14feb), - TOBN(0x4e87f98c, 0xb65f57cb), TOBN(0xdb60a621, 0x5e0cdd41), - TOBN(0x67c16865, 0xa6881440), TOBN(0x1093ef1a, 0x46ab52aa), - TOBN(0xc095afb5, 0x3f4ece64), TOBN(0x6a6bb02e, 0x7604551a), - TOBN(0x55d44b4e, 0x0b26b8cd), TOBN(0xe5f9a999, 0xf971268a), - TOBN(0xc08ec425, 0x11a7de84), TOBN(0x83568095, 0xfda469dd), - TOBN(0x737bfba1, 0x6c6c90a2), TOBN(0x1cb9c4a0, 0xbe229831), - TOBN(0x93bccbba, 0xbb2eec64), TOBN(0xa0c23b64, 0xda03adbe), - TOBN(0x5f7aa00a, 0xe0e86ac4), TOBN(0x470b941e, 0xfc1401e6), - TOBN(0x5ad8d679, 0x9df43574), TOBN(0x4ccfb8a9, 0x0f65d810), - TOBN(0x1bce80e3, 0xaa7fbd81), TOBN(0x273291ad, 0x9508d20a), - TOBN(0xf5c4b46b, 0x42a92806), TOBN(0x810684ec, 0xa86ab44a), - TOBN(0x4591640b, 0xca0bc9f8), TOBN(0xb5efcdfc, 0x5c4b6054), - TOBN(0x16fc8907, 0x6e9edd12), TOBN(0xe29d0b50, 0xd4d792f9), - TOBN(0xa45fd01c, 0x9b03116d), TOBN(0x85035235, 0xc81765a4), - TOBN(0x1fe2a9b2, 0xb4b4b67c), TOBN(0xc1d10df0, 0xe8020604), - TOBN(0x9d64abfc, 0xbc8058d8), TOBN(0x8943b9b2, 0x712a0fbb), - TOBN(0x90eed914, 0x3b3def04), TOBN(0x85ab3aa2, 0x4ce775ff), - TOBN(0x605fd4ca, 0x7bbc9040), TOBN(0x8b34a564, 0xe2c75dfb), - TOBN(0x41ffc94a, 0x10358560), TOBN(0x2d8a5072, 0x9e5c28aa), - TOBN(0xe915a0fc, 0x4cc7eb15), TOBN(0xe9efab05, 0x8f6d0f5d), - TOBN(0xdbab47a9, 0xd19e9b91), TOBN(0x8cfed745, 0x0276154c), - TOBN(0x154357ae, 0x2cfede0d), TOBN(0x520630df, 0x19f5a4ef), - TOBN(0x25759f7c, 0xe382360f), TOBN(0xb6db05c9, 0x88bf5857), - TOBN(0x2917d61d, 0x6c58d46c), TOBN(0x14f8e491, 0xfd20cb7a), - TOBN(0xb68a727a, 0x11c20340), TOBN(0x0386f86f, 0xaf7ccbb6), - TOBN(0x5c8bc6cc, 0xfee09a20), TOBN(0x7d76ff4a, 0xbb7eea35), - TOBN(0xa7bdebe7, 0xdb15be7a), TOBN(0x67a08054, 0xd89f0302), - TOBN(0x56bf0ea9, 0xc1193364), TOBN(0xc8244467, 0x62837ebe), - TOBN(0x32bd8e8b, 0x20d841b8), TOBN(0x127a0548, 0xdbb8a54f), - TOBN(0x83dd4ca6, 0x63b20236), TOBN(0x87714718, 0x203491fa), - TOBN(0x4dabcaaa, 0xaa8a5288), TOBN(0x91cc0c8a, 0xaf23a1c9), - TOBN(0x34c72c6a, 0x3f220e0c), TOBN(0xbcc20bdf, 0x1232144a), - TOBN(0x6e2f42da, 0xa20ede1b), TOBN(0xc441f00c, 0x74a00515), - TOBN(0xbf46a5b6, 0x734b8c4b), TOBN(0x57409503, 0x7b56c9a4), - TOBN(0x9f735261, 0xe4585d45), TOBN(0x9231faed, 0x6734e642), - TOBN(0x1158a176, 0xbe70ee6c), TOBN(0x35f1068d, 0x7c3501bf), - TOBN(0x6beef900, 0xa2d26115), TOBN(0x649406f2, 0xef0afee3), - TOBN(0x3f43a60a, 0xbc2420a1), TOBN(0x509002a7, 0xd5aee4ac), - TOBN(0xb46836a5, 0x3ff3571b), TOBN(0x24f98b78, 0x837927c1), - TOBN(0x6254256a, 0x4533c716), TOBN(0xf27abb0b, 0xd07ee196), - TOBN(0xd7cf64fc, 0x5c6d5bfd), TOBN(0x6915c751, 0xf0cd7a77), - TOBN(0xd9f59012, 0x8798f534), TOBN(0x772b0da8, 0xf81d8b5f), - TOBN(0x1244260c, 0x2e03fa69), TOBN(0x36cf0e3a, 0x3be1a374), - TOBN(0x6e7c1633, 0xef06b960), TOBN(0xa71a4c55, 0x671f90f6), - TOBN(0x7a941251, 0x33c673db), TOBN(0xc0bea510, 0x73e8c131), - TOBN(0x61a8a699, 0xd4f6c734), TOBN(0x25e78c88, 0x341ed001), - TOBN(0x5c18acf8, 0x8e2f7d90), TOBN(0xfdbf33d7, 0x77be32cd), - TOBN(0x0a085cd7, 0xd2eb5ee9), TOBN(0x2d702cfb, 0xb3201115), - TOBN(0xb6e0ebdb, 0x85c88ce8), TOBN(0x23a3ce3c, 0x1e01d617), - TOBN(0x3041618e, 0x567333ac), TOBN(0x9dd0fd8f, 0x157edb6b), - TOBN(0x27f74702, 0xb57872b8), TOBN(0x2ef26b4f, 0x657d5fe1), - TOBN(0x95426f0a, 0x57cf3d40), TOBN(0x847e2ad1, 0x65a6067a), - TOBN(0xd474d9a0, 0x09996a74), TOBN(0x16a56acd, 0x2a26115c), - TOBN(0x02a615c3, 0xd16f4d43), TOBN(0xcc3fc965, 0xaadb85b7), - TOBN(0x386bda73, 0xce07d1b0), TOBN(0xd82910c2, 0x58ad4178), - TOBN(0x124f82cf, 0xcd2617f4), TOBN(0xcc2f5e8d, 0xef691770), - TOBN(0x82702550, 0xb8c30ccc), TOBN(0x7b856aea, 0x1a8e575a), - TOBN(0xbb822fef, 0xb1ab9459), TOBN(0x085928bc, 0xec24e38e), - TOBN(0x5d0402ec, 0xba8f4b4d), TOBN(0xc07cd4ba, 0x00b4d58b), - TOBN(0x5d8dffd5, 0x29227e7a), TOBN(0x61d44d0c, 0x31bf386f), - TOBN(0xe486dc2b, 0x135e6f4d), TOBN(0x680962eb, 0xe79410ef), - TOBN(0xa61bd343, 0xf10088b5), TOBN(0x6aa76076, 0xe2e28686), - TOBN(0x80463d11, 0x8fb98871), TOBN(0xcb26f5c3, 0xbbc76aff), - TOBN(0xd4ab8edd, 0xfbe03614), TOBN(0xc8eb579b, 0xc0cf2dee), - TOBN(0xcc004c15, 0xc93bae41), TOBN(0x46fbae5d, 0x3aeca3b2), - TOBN(0x671235cf, 0x0f1e9ab1), TOBN(0xadfba934, 0x9ec285c1), - TOBN(0x88ded013, 0xf216c980), TOBN(0xc8ac4fb8, 0xf79e0bc1), - TOBN(0xa29b89c6, 0xfb97a237), TOBN(0xb697b780, 0x9922d8e7), - TOBN(0x3142c639, 0xddb945b5), TOBN(0x447b06c7, 0xe094c3a9), - TOBN(0xcdcb3642, 0x72266c90), TOBN(0x633aad08, 0xa9385046), - TOBN(0xa36c936b, 0xb57c6477), TOBN(0x871f8b64, 0xe94dbcc6), - TOBN(0x28d0fb62, 0xa591a67b), TOBN(0x9d40e081, 0xc1d926f5), - TOBN(0x3111eaf6, 0xf2d84b5a), TOBN(0x228993f9, 0xa565b644), - TOBN(0x0ccbf592, 0x2c83188b), TOBN(0xf87b30ab, 0x3df3e197), - TOBN(0xb8658b31, 0x7642bca8), TOBN(0x1a032d7f, 0x52800f17), - TOBN(0x051dcae5, 0x79bf9445), TOBN(0xeba6b8ee, 0x54a2e253), - TOBN(0x5c8b9cad, 0xd4485692), TOBN(0x84bda40e, 0x8986e9be), - TOBN(0xd16d16a4, 0x2f0db448), TOBN(0x8ec80050, 0xa14d4188), - TOBN(0xb2b26107, 0x98fa7aaa), TOBN(0x41209ee4, 0xf073aa4e), - TOBN(0xf1570359, 0xf2d6b19b), TOBN(0xcbe6868c, 0xfc577caf), - TOBN(0x186c4bdc, 0x32c04dd3), TOBN(0xa6c35fae, 0xcfeee397), - TOBN(0xb4a1b312, 0xf086c0cf), TOBN(0xe0a5ccc6, 0xd9461fe2), - TOBN(0xc32278aa, 0x1536189f), TOBN(0x1126c55f, 0xba6df571), - TOBN(0x0f71a602, 0xb194560e), TOBN(0x8b2d7405, 0x324bd6e1), - TOBN(0x8481939e, 0x3738be71), TOBN(0xb5090b1a, 0x1a4d97a9), - TOBN(0x116c65a3, 0xf05ba915), TOBN(0x21863ad3, 0xaae448aa), - TOBN(0xd24e2679, 0xa7aae5d3), TOBN(0x7076013d, 0x0de5c1c4), - TOBN(0x2d50f8ba, 0xbb05b629), TOBN(0x73c1abe2, 0x6e66efbb), - TOBN(0xefd4b422, 0xf2488af7), TOBN(0xe4105d02, 0x663ba575), - TOBN(0x7eb60a8b, 0x53a69457), TOBN(0x62210008, 0xc945973b), - TOBN(0xfb255478, 0x77a50ec6), TOBN(0xbf0392f7, 0x0a37a72c), - TOBN(0xa0a7a19c, 0x4be18e7a), TOBN(0x90d8ea16, 0x25b1e0af), - TOBN(0x7582a293, 0xef953f57), TOBN(0x90a64d05, 0xbdc5465a), - TOBN(0xca79c497, 0xe2510717), TOBN(0x560dbb7c, 0x18cb641f), - TOBN(0x1d8e3286, 0x4b66abfb), TOBN(0xd26f52e5, 0x59030900), - TOBN(0x1ee3f643, 0x5584941a), TOBN(0x6d3b3730, 0x569f5958), - TOBN(0x9ff2a62f, 0x4789dba5), TOBN(0x91fcb815, 0x72b5c9b7), - TOBN(0xf446cb7d, 0x6c8f9a0e), TOBN(0x48f625c1, 0x39b7ecb5), - TOBN(0xbabae801, 0x1c6219b8), TOBN(0xe7a562d9, 0x28ac2f23), - TOBN(0xe1b48732, 0x26e20588), TOBN(0x06ee1cad, 0x775af051), - TOBN(0xda29ae43, 0xfaff79f7), TOBN(0xc141a412, 0x652ee9e0), - TOBN(0x1e127f6f, 0x195f4bd0), TOBN(0x29c6ab4f, 0x072f34f8), - TOBN(0x7b7c1477, 0x30448112), TOBN(0x82b51af1, 0xe4a38656), - TOBN(0x2bf2028a, 0x2f315010), TOBN(0xc9a4a01f, 0x6ea88cd4), - TOBN(0xf63e95d8, 0x257e5818), TOBN(0xdd8efa10, 0xb4519b16), - TOBN(0xed8973e0, 0x0da910bf), TOBN(0xed49d077, 0x5c0fe4a9), - TOBN(0xac3aac5e, 0xb7caee1e), TOBN(0x1033898d, 0xa7f4da57), - TOBN(0x42145c0e, 0x5c6669b9), TOBN(0x42daa688, 0xc1aa2aa0), - TOBN(0x629cc15c, 0x1a1d885a), TOBN(0x25572ec0, 0xf4b76817), - TOBN(0x8312e435, 0x9c8f8f28), TOBN(0x8107f8cd, 0x81965490), - TOBN(0x516ff3a3, 0x6fa6110c), TOBN(0x74fb1eb1, 0xfb93561f), - TOBN(0x6c0c9047, 0x8457522b), TOBN(0xcfd32104, 0x6bb8bdc6), - TOBN(0x2d6884a2, 0xcc80ad57), TOBN(0x7c27fc35, 0x86a9b637), - TOBN(0x3461baed, 0xadf4e8cd), TOBN(0x1d56251a, 0x617242f0), - TOBN(0x0b80d209, 0xc955bef4), TOBN(0xdf02cad2, 0x06adb047), - TOBN(0xf0d7cb91, 0x5ec74fee), TOBN(0xd2503375, 0x1111ba44), - TOBN(0x9671755e, 0xdf53cb36), TOBN(0x54dcb612, 0x3368551b), - TOBN(0x66d69aac, 0xc8a025a4), TOBN(0x6be946c6, 0xe77ef445), - TOBN(0x719946d1, 0xa995e094), TOBN(0x65e848f6, 0xe51e04d8), - TOBN(0xe62f3300, 0x6a1e3113), TOBN(0x1541c7c1, 0x501de503), - TOBN(0x4daac9fa, 0xf4acfade), TOBN(0x0e585897, 0x44cd0b71), - TOBN(0x544fd869, 0x0a51cd77), TOBN(0x60fc20ed, 0x0031016d), - TOBN(0x58b404ec, 0xa4276867), TOBN(0x46f6c3cc, 0x34f34993), - TOBN(0x477ca007, 0xc636e5bd), TOBN(0x8018f5e5, 0x7c458b47), - TOBN(0xa1202270, 0xe47b668f), TOBN(0xcef48ccd, 0xee14f203), - TOBN(0x23f98bae, 0x62ff9b4d), TOBN(0x55acc035, 0xc589eddd), - TOBN(0x3fe712af, 0x64db4444), TOBN(0x19e9d634, 0xbecdd480), - TOBN(0xe08bc047, 0xa930978a), TOBN(0x2dbf24ec, 0xa1280733), - TOBN(0x3c0ae38c, 0x2cd706b2), TOBN(0x5b012a5b, 0x359017b9), - TOBN(0x3943c38c, 0x72e0f5ae), TOBN(0x786167ea, 0x57176fa3), - TOBN(0xe5f9897d, 0x594881dc), TOBN(0x6b5efad8, 0xcfb820c1), - TOBN(0xb2179093, 0xd55018de), TOBN(0x39ad7d32, 0x0bac56ce), - TOBN(0xb55122e0, 0x2cfc0e81), TOBN(0x117c4661, 0xf6d89daa), - TOBN(0x362d01e1, 0xcb64fa09), TOBN(0x6a309b4e, 0x3e9c4ddd), - TOBN(0xfa979fb7, 0xabea49b1), TOBN(0xb4b1d27d, 0x10e2c6c5), - TOBN(0xbd61c2c4, 0x23afde7a), TOBN(0xeb6614f8, 0x9786d358), - TOBN(0x4a5d816b, 0x7f6f7459), TOBN(0xe431a44f, 0x09360e7b), - TOBN(0x8c27a032, 0xc309914c), TOBN(0xcea5d68a, 0xcaede3d8), - TOBN(0x3668f665, 0x3a0a3f95), TOBN(0x89369416, 0x7ceba27b), - TOBN(0x89981fad, 0xe4728fe9), TOBN(0x7102c8a0, 0x8a093562), - TOBN(0xbb80310e, 0x235d21c8), TOBN(0x505e55d1, 0xbefb7f7b), - TOBN(0xa0a90811, 0x12958a67), TOBN(0xd67e106a, 0x4d851fef), - TOBN(0xb84011a9, 0x431dd80e), TOBN(0xeb7c7cca, 0x73306cd9), - TOBN(0x20fadd29, 0xd1b3b730), TOBN(0x83858b5b, 0xfe37b3d3), - TOBN(0xbf4cd193, 0xb6251d5c), TOBN(0x1cca1fd3, 0x1352d952), - TOBN(0xc66157a4, 0x90fbc051), TOBN(0x7990a638, 0x89b98636)}, - {TOBN(0xe5aa692a, 0x87dec0e1), TOBN(0x010ded8d, 0xf7b39d00), - TOBN(0x7b1b80c8, 0x54cfa0b5), TOBN(0x66beb876, 0xa0f8ea28), - TOBN(0x50d7f531, 0x3476cd0e), TOBN(0xa63d0e65, 0xb08d3949), - TOBN(0x1a09eea9, 0x53479fc6), TOBN(0x82ae9891, 0xf499e742), - TOBN(0xab58b910, 0x5ca7d866), TOBN(0x582967e2, 0x3adb3b34), - TOBN(0x89ae4447, 0xcceac0bc), TOBN(0x919c667c, 0x7bf56af5), - TOBN(0x9aec17b1, 0x60f5dcd7), TOBN(0xec697b9f, 0xddcaadbc), - TOBN(0x0b98f341, 0x463467f5), TOBN(0xb187f1f7, 0xa967132f), - TOBN(0x90fe7a1d, 0x214aeb18), TOBN(0x1506af3c, 0x741432f7), - TOBN(0xbb5565f9, 0xe591a0c4), TOBN(0x10d41a77, 0xb44f1bc3), - TOBN(0xa09d65e4, 0xa84bde96), TOBN(0x42f060d8, 0xf20a6a1c), - TOBN(0x652a3bfd, 0xf27f9ce7), TOBN(0xb6bdb65c, 0x3b3d739f), - TOBN(0xeb5ddcb6, 0xec7fae9f), TOBN(0x995f2714, 0xefb66e5a), - TOBN(0xdee95d8e, 0x69445d52), TOBN(0x1b6c2d46, 0x09e27620), - TOBN(0x32621c31, 0x8129d716), TOBN(0xb03909f1, 0x0958c1aa), - TOBN(0x8c468ef9, 0x1af4af63), TOBN(0x162c429f, 0xfba5cdf6), - TOBN(0x2f682343, 0x753b9371), TOBN(0x29cab45a, 0x5f1f9cd7), - TOBN(0x571623ab, 0xb245db96), TOBN(0xc507db09, 0x3fd79999), - TOBN(0x4e2ef652, 0xaf036c32), TOBN(0x86f0cc78, 0x05018e5c), - TOBN(0xc10a73d4, 0xab8be350), TOBN(0x6519b397, 0x7e826327), - TOBN(0xe8cb5eef, 0x9c053df7), TOBN(0x8de25b37, 0xb300ea6f), - TOBN(0xdb03fa92, 0xc849cffb), TOBN(0x242e43a7, 0xe84169bb), - TOBN(0xe4fa51f4, 0xdd6f958e), TOBN(0x6925a77f, 0xf4445a8d), - TOBN(0xe6e72a50, 0xe90d8949), TOBN(0xc66648e3, 0x2b1f6390), - TOBN(0xb2ab1957, 0x173e460c), TOBN(0x1bbbce75, 0x30704590), - TOBN(0xc0a90dbd, 0xdb1c7162), TOBN(0x505e399e, 0x15cdd65d), - TOBN(0x68434dcb, 0x57797ab7), TOBN(0x60ad35ba, 0x6a2ca8e8), - TOBN(0x4bfdb1e0, 0xde3336c1), TOBN(0xbbef99eb, 0xd8b39015), - TOBN(0x6c3b96f3, 0x1711ebec), TOBN(0x2da40f1f, 0xce98fdc4), - TOBN(0xb99774d3, 0x57b4411f), TOBN(0x87c8bdf4, 0x15b65bb6), - TOBN(0xda3a89e3, 0xc2eef12d), TOBN(0xde95bb9b, 0x3c7471f3), - TOBN(0x600f225b, 0xd812c594), TOBN(0x54907c5d, 0x2b75a56b), - TOBN(0xa93cc5f0, 0x8db60e35), TOBN(0x743e3cd6, 0xfa833319), - TOBN(0x7dad5c41, 0xf81683c9), TOBN(0x70c1e7d9, 0x9c34107e), - TOBN(0x0edc4a39, 0xa6be0907), TOBN(0x36d47035, 0x86d0b7d3), - TOBN(0x8c76da03, 0x272bfa60), TOBN(0x0b4a07ea, 0x0f08a414), - TOBN(0x699e4d29, 0x45c1dd53), TOBN(0xcadc5898, 0x231debb5), - TOBN(0xdf49fcc7, 0xa77f00e0), TOBN(0x93057bbf, 0xa73e5a0e), - TOBN(0x2f8b7ecd, 0x027a4cd1), TOBN(0x114734b3, 0xc614011a), - TOBN(0xe7a01db7, 0x67677c68), TOBN(0x89d9be5e, 0x7e273f4f), - TOBN(0xd225cb2e, 0x089808ef), TOBN(0xf1f7a27d, 0xd59e4107), - TOBN(0x53afc761, 0x8211b9c9), TOBN(0x0361bc67, 0xe6819159), - TOBN(0x2a865d0b, 0x7f071426), TOBN(0x6a3c1810, 0xe7072567), - TOBN(0x3e3bca1e, 0x0d6bcabd), TOBN(0xa1b02bc1, 0x408591bc), - TOBN(0xe0deee59, 0x31fba239), TOBN(0xf47424d3, 0x98bd91d1), - TOBN(0x0f8886f4, 0x071a3c1d), TOBN(0x3f7d41e8, 0xa819233b), - TOBN(0x708623c2, 0xcf6eb998), TOBN(0x86bb49af, 0x609a287f), - TOBN(0x942bb249, 0x63c90762), TOBN(0x0ef6eea5, 0x55a9654b), - TOBN(0x5f6d2d72, 0x36f5defe), TOBN(0xfa9922dc, 0x56f99176), - TOBN(0x6c8c5ece, 0xf78ce0c7), TOBN(0x7b44589d, 0xbe09b55e), - TOBN(0xe11b3bca, 0x9ea83770), TOBN(0xd7fa2c7f, 0x2ab71547), - TOBN(0x2a3dd6fa, 0x2a1ddcc0), TOBN(0x09acb430, 0x5a7b7707), - TOBN(0x4add4a2e, 0x649d4e57), TOBN(0xcd53a2b0, 0x1917526e), - TOBN(0xc5262330, 0x20b44ac4), TOBN(0x4028746a, 0xbaa2c31d), - TOBN(0x51318390, 0x64291d4c), TOBN(0xbf48f151, 0xee5ad909), - TOBN(0xcce57f59, 0x7b185681), TOBN(0x7c3ac1b0, 0x4854d442), - TOBN(0x65587dc3, 0xc093c171), TOBN(0xae7acb24, 0x24f42b65), - TOBN(0x5a338adb, 0x955996cb), TOBN(0xc8e65675, 0x6051f91b), - TOBN(0x66711fba, 0x28b8d0b1), TOBN(0x15d74137, 0xb6c10a90), - TOBN(0x70cdd7eb, 0x3a232a80), TOBN(0xc9e2f07f, 0x6191ed24), - TOBN(0xa80d1db6, 0xf79588c0), TOBN(0xfa52fc69, 0xb55768cc), - TOBN(0x0b4df1ae, 0x7f54438a), TOBN(0x0cadd1a7, 0xf9b46a4f), - TOBN(0xb40ea6b3, 0x1803dd6f), TOBN(0x488e4fa5, 0x55eaae35), - TOBN(0x9f047d55, 0x382e4e16), TOBN(0xc9b5b7e0, 0x2f6e0c98), - TOBN(0x6b1bd2d3, 0x95762649), TOBN(0xa9604ee7, 0xc7aea3f6), - TOBN(0x3646ff27, 0x6dc6f896), TOBN(0x9bf0e7f5, 0x2860bad1), - TOBN(0x2d92c821, 0x7cb44b92), TOBN(0xa2f5ce63, 0xaea9c182), - TOBN(0xd0a2afb1, 0x9154a5fd), TOBN(0x482e474c, 0x95801da6), - TOBN(0xc19972d0, 0xb611c24b), TOBN(0x1d468e65, 0x60a8f351), - TOBN(0xeb758069, 0x7bcf6421), TOBN(0xec9dd0ee, 0x88fbc491), - TOBN(0x5b59d2bf, 0x956c2e32), TOBN(0x73dc6864, 0xdcddf94e), - TOBN(0xfd5e2321, 0xbcee7665), TOBN(0xa7b4f8ef, 0x5e9a06c4), - TOBN(0xfba918dd, 0x7280f855), TOBN(0xbbaac260, 0x8baec688), - TOBN(0xa3b3f00f, 0x33400f42), TOBN(0x3d2dba29, 0x66f2e6e4), - TOBN(0xb6f71a94, 0x98509375), TOBN(0x8f33031f, 0xcea423cc), - TOBN(0x009b8dd0, 0x4807e6fb), TOBN(0x5163cfe5, 0x5cdb954c), - TOBN(0x03cc8f17, 0xcf41c6e8), TOBN(0xf1f03c2a, 0x037b925c), - TOBN(0xc39c19cc, 0x66d2427c), TOBN(0x823d24ba, 0x7b6c18e4), - TOBN(0x32ef9013, 0x901f0b4f), TOBN(0x684360f1, 0xf8941c2e), - TOBN(0x0ebaff52, 0x2c28092e), TOBN(0x7891e4e3, 0x256c932f), - TOBN(0x51264319, 0xac445e3d), TOBN(0x553432e7, 0x8ea74381), - TOBN(0xe6eeaa69, 0x67e9c50a), TOBN(0x27ced284, 0x62e628c7), - TOBN(0x3f96d375, 0x7a4afa57), TOBN(0xde0a14c3, 0xe484c150), - TOBN(0x364a24eb, 0x38bd9923), TOBN(0x1df18da0, 0xe5177422), - TOBN(0x174e8f82, 0xd8d38a9b), TOBN(0x2e97c600, 0xe7de1391), - TOBN(0xc5709850, 0xa1c175dd), TOBN(0x969041a0, 0x32ae5035), - TOBN(0xcbfd533b, 0x76a2086b), TOBN(0xd6bba71b, 0xd7c2e8fe), - TOBN(0xb2d58ee6, 0x099dfb67), TOBN(0x3a8b342d, 0x064a85d9), - TOBN(0x3bc07649, 0x522f9be3), TOBN(0x690c075b, 0xdf1f49a8), - TOBN(0x80e1aee8, 0x3854ec42), TOBN(0x2a7dbf44, 0x17689dc7), - TOBN(0xc004fc0e, 0x3faf4078), TOBN(0xb2f02e9e, 0xdf11862c), - TOBN(0xf10a5e0f, 0xa0a1b7b3), TOBN(0x30aca623, 0x8936ec80), - TOBN(0xf83cbf05, 0x02f40d9a), TOBN(0x4681c468, 0x2c318a4d), - TOBN(0x98575618, 0x0e9c2674), TOBN(0xbe79d046, 0x1847092e), - TOBN(0xaf1e480a, 0x78bd01e0), TOBN(0x6dd359e4, 0x72a51db9), - TOBN(0x62ce3821, 0xe3afbab6), TOBN(0xc5cee5b6, 0x17733199), - TOBN(0xe08b30d4, 0x6ffd9fbb), TOBN(0x6e5bc699, 0x36c610b7), - TOBN(0xf343cff2, 0x9ce262cf), TOBN(0xca2e4e35, 0x68b914c1), - TOBN(0x011d64c0, 0x16de36c5), TOBN(0xe0b10fdd, 0x42e2b829), - TOBN(0x78942981, 0x6685aaf8), TOBN(0xe7511708, 0x230ede97), - TOBN(0x671ed8fc, 0x3b922bf8), TOBN(0xe4d8c0a0, 0x4c29b133), - TOBN(0x87eb1239, 0x3b6e99c4), TOBN(0xaff3974c, 0x8793beba), - TOBN(0x03749405, 0x2c18df9b), TOBN(0xc5c3a293, 0x91007139), - TOBN(0x6a77234f, 0xe37a0b95), TOBN(0x02c29a21, 0xb661c96b), - TOBN(0xc3aaf1d6, 0x141ecf61), TOBN(0x9195509e, 0x3bb22f53), - TOBN(0x29597404, 0x22d51357), TOBN(0x1b083822, 0x537bed60), - TOBN(0xcd7d6e35, 0xe07289f0), TOBN(0x1f94c48c, 0x6dd86eff), - TOBN(0xc8bb1f82, 0xeb0f9cfa), TOBN(0x9ee0b7e6, 0x1b2eb97d), - TOBN(0x5a52fe2e, 0x34d74e31), TOBN(0xa352c310, 0x3bf79ab6), - TOBN(0x97ff6c5a, 0xabfeeb8f), TOBN(0xbfbe8fef, 0xf5c97305), - TOBN(0xd6081ce6, 0xa7904608), TOBN(0x1f812f3a, 0xc4fca249), - TOBN(0x9b24bc9a, 0xb9e5e200), TOBN(0x91022c67, 0x38012ee8), - TOBN(0xe83d9c5d, 0x30a713a1), TOBN(0x4876e3f0, 0x84ef0f93), - TOBN(0xc9777029, 0xc1fbf928), TOBN(0xef7a6bb3, 0xbce7d2a4), - TOBN(0xb8067228, 0xdfa2a659), TOBN(0xd5cd3398, 0xd877a48f), - TOBN(0xbea4fd8f, 0x025d0f3f), TOBN(0xd67d2e35, 0x2eae7c2b), - TOBN(0x184de7d7, 0xcc5f4394), TOBN(0xb5551b5c, 0x4536e142), - TOBN(0x2e89b212, 0xd34aa60a), TOBN(0x14a96fea, 0xf50051d5), - TOBN(0x4e21ef74, 0x0d12bb0b), TOBN(0xc522f020, 0x60b9677e), - TOBN(0x8b12e467, 0x2df7731d), TOBN(0x39f80382, 0x7b326d31), - TOBN(0xdfb8630c, 0x39024a94), TOBN(0xaacb96a8, 0x97319452), - TOBN(0xd68a3961, 0xeda3867c), TOBN(0x0c58e2b0, 0x77c4ffca), - TOBN(0x3d545d63, 0x4da919fa), TOBN(0xef79b69a, 0xf15e2289), - TOBN(0x54bc3d3d, 0x808bab10), TOBN(0xc8ab3007, 0x45f82c37), - TOBN(0xc12738b6, 0x7c4a658a), TOBN(0xb3c47639, 0x40e72182), - TOBN(0x3b77be46, 0x8798e44f), TOBN(0xdc047df2, 0x17a7f85f), - TOBN(0x2439d4c5, 0x5e59d92d), TOBN(0xcedca475, 0xe8e64d8d), - TOBN(0xa724cd0d, 0x87ca9b16), TOBN(0x35e4fd59, 0xa5540dfe), - TOBN(0xf8c1ff18, 0xe4bcf6b1), TOBN(0x856d6285, 0x295018fa), - TOBN(0x433f665c, 0x3263c949), TOBN(0xa6a76dd6, 0xa1f21409), - TOBN(0x17d32334, 0xcc7b4f79), TOBN(0xa1d03122, 0x06720e4a), - TOBN(0xadb6661d, 0x81d9bed5), TOBN(0xf0d6fb02, 0x11db15d1), - TOBN(0x7fd11ad5, 0x1fb747d2), TOBN(0xab50f959, 0x3033762b), - TOBN(0x2a7e711b, 0xfbefaf5a), TOBN(0xc7393278, 0x3fef2bbf), - TOBN(0xe29fa244, 0x0df6f9be), TOBN(0x9092757b, 0x71efd215), - TOBN(0xee60e311, 0x4f3d6fd9), TOBN(0x338542d4, 0x0acfb78b), - TOBN(0x44a23f08, 0x38961a0f), TOBN(0x1426eade, 0x986987ca), - TOBN(0x36e6ee2e, 0x4a863cc6), TOBN(0x48059420, 0x628b8b79), - TOBN(0x30303ad8, 0x7396e1de), TOBN(0x5c8bdc48, 0x38c5aad1), - TOBN(0x3e40e11f, 0x5c8f5066), TOBN(0xabd6e768, 0x8d246bbd), - TOBN(0x68aa40bb, 0x23330a01), TOBN(0xd23f5ee4, 0xc34eafa0), - TOBN(0x3bbee315, 0x5de02c21), TOBN(0x18dd4397, 0xd1d8dd06), - TOBN(0x3ba1939a, 0x122d7b44), TOBN(0xe6d3b40a, 0xa33870d6), - TOBN(0x8e620f70, 0x1c4fe3f8), TOBN(0xf6bba1a5, 0xd3a50cbf), - TOBN(0x4a78bde5, 0xcfc0aee0), TOBN(0x847edc46, 0xc08c50bd), - TOBN(0xbaa2439c, 0xad63c9b2), TOBN(0xceb4a728, 0x10fc2acb), - TOBN(0xa419e40e, 0x26da033d), TOBN(0x6cc3889d, 0x03e02683), - TOBN(0x1cd28559, 0xfdccf725), TOBN(0x0fd7e0f1, 0x8d13d208), - TOBN(0x01b9733b, 0x1f0df9d4), TOBN(0x8cc2c5f3, 0xa2b5e4f3), - TOBN(0x43053bfa, 0x3a304fd4), TOBN(0x8e87665c, 0x0a9f1aa7), - TOBN(0x087f29ec, 0xd73dc965), TOBN(0x15ace455, 0x3e9023db), - TOBN(0x2370e309, 0x2bce28b4), TOBN(0xf9723442, 0xb6b1e84a), - TOBN(0xbeee662e, 0xb72d9f26), TOBN(0xb19396de, 0xf0e47109), - TOBN(0x85b1fa73, 0xe13289d0), TOBN(0x436cf77e, 0x54e58e32), - TOBN(0x0ec833b3, 0xe990ef77), TOBN(0x7373e3ed, 0x1b11fc25), - TOBN(0xbe0eda87, 0x0fc332ce), TOBN(0xced04970, 0x8d7ea856), - TOBN(0xf85ff785, 0x7e977ca0), TOBN(0xb66ee8da, 0xdfdd5d2b), - TOBN(0xf5e37950, 0x905af461), TOBN(0x587b9090, 0x966d487c), - TOBN(0x6a198a1b, 0x32ba0127), TOBN(0xa7720e07, 0x141615ac), - TOBN(0xa23f3499, 0x996ef2f2), TOBN(0xef5f64b4, 0x470bcb3d), - TOBN(0xa526a962, 0x92b8c559), TOBN(0x0c14aac0, 0x69740a0f), - TOBN(0x0d41a9e3, 0xa6bdc0a5), TOBN(0x97d52106, 0x9c48aef4), - TOBN(0xcf16bd30, 0x3e7c253b), TOBN(0xcc834b1a, 0x47fdedc1), - TOBN(0x7362c6e5, 0x373aab2e), TOBN(0x264ed85e, 0xc5f590ff), - TOBN(0x7a46d9c0, 0x66d41870), TOBN(0xa50c20b1, 0x4787ba09), - TOBN(0x185e7e51, 0xe3d44635), TOBN(0xb3b3e080, 0x31e2d8dc), - TOBN(0xbed1e558, 0xa179e9d9), TOBN(0x2daa3f79, 0x74a76781), - TOBN(0x4372baf2, 0x3a40864f), TOBN(0x46900c54, 0x4fe75cb5), - TOBN(0xb95f171e, 0xf76765d0), TOBN(0x4ad726d2, 0x95c87502), - TOBN(0x2ec769da, 0x4d7c99bd), TOBN(0x5e2ddd19, 0xc36cdfa8), - TOBN(0xc22117fc, 0xa93e6dea), TOBN(0xe8a2583b, 0x93771123), - TOBN(0xbe2f6089, 0xfa08a3a2), TOBN(0x4809d5ed, 0x8f0e1112), - TOBN(0x3b414aa3, 0xda7a095e), TOBN(0x9049acf1, 0x26f5aadd), - TOBN(0x78d46a4d, 0x6be8b84a), TOBN(0xd66b1963, 0xb732b9b3), - TOBN(0x5c2ac2a0, 0xde6e9555), TOBN(0xcf52d098, 0xb5bd8770), - TOBN(0x15a15fa6, 0x0fd28921), TOBN(0x56ccb81e, 0x8b27536d), - TOBN(0x0f0d8ab8, 0x9f4ccbb8), TOBN(0xed5f44d2, 0xdb221729), - TOBN(0x43141988, 0x00bed10c), TOBN(0xc94348a4, 0x1d735b8b), - TOBN(0x79f3e9c4, 0x29ef8479), TOBN(0x4c13a4e3, 0x614c693f), - TOBN(0x32c9af56, 0x8e143a14), TOBN(0xbc517799, 0xe29ac5c4), - TOBN(0x05e17992, 0x2774856f), TOBN(0x6e52fb05, 0x6c1bf55f), - TOBN(0xaeda4225, 0xe4f19e16), TOBN(0x70f4728a, 0xaf5ccb26), - TOBN(0x5d2118d1, 0xb2947f22), TOBN(0xc827ea16, 0x281d6fb9), - TOBN(0x8412328d, 0x8cf0eabd), TOBN(0x45ee9fb2, 0x03ef9dcf), - TOBN(0x8e700421, 0xbb937d63), TOBN(0xdf8ff2d5, 0xcc4b37a6), - TOBN(0xa4c0d5b2, 0x5ced7b68), TOBN(0x6537c1ef, 0xc7308f59), - TOBN(0x25ce6a26, 0x3b37f8e8), TOBN(0x170e9a9b, 0xdeebc6ce), - TOBN(0xdd037952, 0x8728d72c), TOBN(0x445b0e55, 0x850154bc), - TOBN(0x4b7d0e06, 0x83a7337b), TOBN(0x1e3416d4, 0xffecf249), - TOBN(0x24840eff, 0x66a2b71f), TOBN(0xd0d9a50a, 0xb37cc26d), - TOBN(0xe2198150, 0x6fe28ef7), TOBN(0x3cc5ef16, 0x23324c7f), - TOBN(0x220f3455, 0x769b5263), TOBN(0xe2ade2f1, 0xa10bf475), - TOBN(0x28cd20fa, 0x458d3671), TOBN(0x1549722c, 0x2dc4847b), - TOBN(0x6dd01e55, 0x591941e3), TOBN(0x0e6fbcea, 0x27128ccb), - TOBN(0xae1a1e6b, 0x3bef0262), TOBN(0xfa8c472c, 0x8f54e103), - TOBN(0x7539c0a8, 0x72c052ec), TOBN(0xd7b27369, 0x5a3490e9), - TOBN(0x143fe1f1, 0x71684349), TOBN(0x36b4722e, 0x32e19b97), - TOBN(0xdc059227, 0x90980aff), TOBN(0x175c9c88, 0x9e13d674), - TOBN(0xa7de5b22, 0x6e6bfdb1), TOBN(0x5ea5b7b2, 0xbedb4b46), - TOBN(0xd5570191, 0xd34a6e44), TOBN(0xfcf60d2e, 0xa24ff7e6), - TOBN(0x614a392d, 0x677819e1), TOBN(0x7be74c7e, 0xaa5a29e8), - TOBN(0xab50fece, 0x63c85f3f), TOBN(0xaca2e2a9, 0x46cab337), - TOBN(0x7f700388, 0x122a6fe3), TOBN(0xdb69f703, 0x882a04a8), - TOBN(0x9a77935d, 0xcf7aed57), TOBN(0xdf16207c, 0x8d91c86f), - TOBN(0x2fca49ab, 0x63ed9998), TOBN(0xa3125c44, 0xa77ddf96), - TOBN(0x05dd8a86, 0x24344072), TOBN(0xa023dda2, 0xfec3fb56), - TOBN(0x421b41fc, 0x0c743032), TOBN(0x4f2120c1, 0x5e438639), - TOBN(0xfb7cae51, 0xc83c1b07), TOBN(0xb2370caa, 0xcac2171a), - TOBN(0x2eb2d962, 0x6cc820fb), TOBN(0x59feee5c, 0xb85a44bf), - TOBN(0x94620fca, 0x5b6598f0), TOBN(0x6b922cae, 0x7e314051), - TOBN(0xff8745ad, 0x106bed4e), TOBN(0x546e71f5, 0xdfa1e9ab), - TOBN(0x935c1e48, 0x1ec29487), TOBN(0x9509216c, 0x4d936530), - TOBN(0xc7ca3067, 0x85c9a2db), TOBN(0xd6ae5152, 0x6be8606f), - TOBN(0x09dbcae6, 0xe14c651d), TOBN(0xc9536e23, 0x9bc32f96), - TOBN(0xa90535a9, 0x34521b03), TOBN(0xf39c526c, 0x878756ff), - TOBN(0x383172ec, 0x8aedf03c), TOBN(0x20a8075e, 0xefe0c034), - TOBN(0xf22f9c62, 0x64026422), TOBN(0x8dd10780, 0x24b9d076), - TOBN(0x944c742a, 0x3bef2950), TOBN(0x55b9502e, 0x88a2b00b), - TOBN(0xa59e14b4, 0x86a09817), TOBN(0xa39dd3ac, 0x47bb4071), - TOBN(0x55137f66, 0x3be0592f), TOBN(0x07fcafd4, 0xc9e63f5b), - TOBN(0x963652ee, 0x346eb226), TOBN(0x7dfab085, 0xec2facb7), - TOBN(0x273bf2b8, 0x691add26), TOBN(0x30d74540, 0xf2b46c44), - TOBN(0x05e8e73e, 0xf2c2d065), TOBN(0xff9b8a00, 0xd42eeac9), - TOBN(0x2fcbd205, 0x97209d22), TOBN(0xeb740ffa, 0xde14ea2c), - TOBN(0xc71ff913, 0xa8aef518), TOBN(0x7bfc74bb, 0xfff4cfa2), - TOBN(0x1716680c, 0xb6b36048), TOBN(0x121b2cce, 0x9ef79af1), - TOBN(0xbff3c836, 0xa01eb3d3), TOBN(0x50eb1c6a, 0x5f79077b), - TOBN(0xa48c32d6, 0xa004bbcf), TOBN(0x47a59316, 0x7d64f61d), - TOBN(0x6068147f, 0x93102016), TOBN(0x12c5f654, 0x94d12576), - TOBN(0xefb071a7, 0xc9bc6b91), TOBN(0x7c2da0c5, 0x6e23ea95), - TOBN(0xf4fd45b6, 0xd4a1dd5d), TOBN(0x3e7ad9b6, 0x9122b13c), - TOBN(0x342ca118, 0xe6f57a48), TOBN(0x1c2e94a7, 0x06f8288f), - TOBN(0x99e68f07, 0x5a97d231), TOBN(0x7c80de97, 0x4d838758), - TOBN(0xbce0f5d0, 0x05872727), TOBN(0xbe5d95c2, 0x19c4d016), - TOBN(0x921d5cb1, 0x9c2492ee), TOBN(0x42192dc1, 0x404d6fb3), - TOBN(0x4c84dcd1, 0x32f988d3), TOBN(0xde26d61f, 0xa17b8e85), - TOBN(0xc466dcb6, 0x137c7408), TOBN(0x9a38d7b6, 0x36a266da), - TOBN(0x7ef5cb06, 0x83bebf1b), TOBN(0xe5cdcbbf, 0x0fd014e3), - TOBN(0x30aa376d, 0xf65965a0), TOBN(0x60fe88c2, 0xebb3e95e), - TOBN(0x33fd0b61, 0x66ee6f20), TOBN(0x8827dcdb, 0x3f41f0a0), - TOBN(0xbf8a9d24, 0x0c56c690), TOBN(0x40265dad, 0xddb7641d), - TOBN(0x522b05bf, 0x3a6b662b), TOBN(0x466d1dfe, 0xb1478c9b), - TOBN(0xaa616962, 0x1484469b), TOBN(0x0db60549, 0x02df8f9f), - TOBN(0xc37bca02, 0x3cb8bf51), TOBN(0x5effe346, 0x21371ce8), - TOBN(0xe8f65264, 0xff112c32), TOBN(0x8a9c736d, 0x7b971fb2), - TOBN(0xa4f19470, 0x7b75080d), TOBN(0xfc3f2c5a, 0x8839c59b), - TOBN(0x1d6c777e, 0x5aeb49c2), TOBN(0xf3db034d, 0xda1addfe), - TOBN(0xd76fee5a, 0x5535affc), TOBN(0x0853ac70, 0xb92251fd), - TOBN(0x37e3d594, 0x8b2a29d5), TOBN(0x28f1f457, 0x4de00ddb), - TOBN(0x8083c1b5, 0xf42c328b), TOBN(0xd8ef1d8f, 0xe493c73b), - TOBN(0x96fb6260, 0x41dc61bd), TOBN(0xf74e8a9d, 0x27ee2f8a), - TOBN(0x7c605a80, 0x2c946a5d), TOBN(0xeed48d65, 0x3839ccfd), - TOBN(0x9894344f, 0x3a29467a), TOBN(0xde81e949, 0xc51eba6d), - TOBN(0xdaea066b, 0xa5e5c2f2), TOBN(0x3fc8a614, 0x08c8c7b3), - TOBN(0x7adff88f, 0x06d0de9f), TOBN(0xbbc11cf5, 0x3b75ce0a), - TOBN(0x9fbb7acc, 0xfbbc87d5), TOBN(0xa1458e26, 0x7badfde2)}, - {TOBN(0x1cb43668, 0xe039c256), TOBN(0x5f26fb8b, 0x7c17fd5d), - TOBN(0xeee426af, 0x79aa062b), TOBN(0x072002d0, 0xd78fbf04), - TOBN(0x4c9ca237, 0xe84fb7e3), TOBN(0xb401d8a1, 0x0c82133d), - TOBN(0xaaa52592, 0x6d7e4181), TOBN(0xe9430833, 0x73dbb152), - TOBN(0xf92dda31, 0xbe24319a), TOBN(0x03f7d28b, 0xe095a8e7), - TOBN(0xa52fe840, 0x98782185), TOBN(0x276ddafe, 0x29c24dbc), - TOBN(0x80cd5496, 0x1d7a64eb), TOBN(0xe4360889, 0x7f1dbe42), - TOBN(0x2f81a877, 0x8438d2d5), TOBN(0x7e4d52a8, 0x85169036), - TOBN(0x19e3d5b1, 0x1d59715d), TOBN(0xc7eaa762, 0xd788983e), - TOBN(0xe5a730b0, 0xabf1f248), TOBN(0xfbab8084, 0xfae3fd83), - TOBN(0x65e50d21, 0x53765b2f), TOBN(0xbdd4e083, 0xfa127f3d), - TOBN(0x9cf3c074, 0x397b1b10), TOBN(0x59f8090c, 0xb1b59fd3), - TOBN(0x7b15fd9d, 0x615faa8f), TOBN(0x8fa1eb40, 0x968554ed), - TOBN(0x7bb4447e, 0x7aa44882), TOBN(0x2bb2d0d1, 0x029fff32), - TOBN(0x075e2a64, 0x6caa6d2f), TOBN(0x8eb879de, 0x22e7351b), - TOBN(0xbcd5624e, 0x9a506c62), TOBN(0x218eaef0, 0xa87e24dc), - TOBN(0x37e56847, 0x44ddfa35), TOBN(0x9ccfc5c5, 0xdab3f747), - TOBN(0x9ac1df3f, 0x1ee96cf4), TOBN(0x0c0571a1, 0x3b480b8f), - TOBN(0x2fbeb3d5, 0x4b3a7b3c), TOBN(0x35c03669, 0x5dcdbb99), - TOBN(0x52a0f5dc, 0xb2415b3a), TOBN(0xd57759b4, 0x4413ed9a), - TOBN(0x1fe647d8, 0x3d30a2c5), TOBN(0x0857f77e, 0xf78a81dc), - TOBN(0x11d5a334, 0x131a4a9b), TOBN(0xc0a94af9, 0x29d393f5), - TOBN(0xbc3a5c0b, 0xdaa6ec1a), TOBN(0xba9fe493, 0x88d2d7ed), - TOBN(0xbb4335b4, 0xbb614797), TOBN(0x991c4d68, 0x72f83533), - TOBN(0x53258c28, 0xd2f01cb3), TOBN(0x93d6eaa3, 0xd75db0b1), - TOBN(0x419a2b0d, 0xe87d0db4), TOBN(0xa1e48f03, 0xd8fe8493), - TOBN(0xf747faf6, 0xc508b23a), TOBN(0xf137571a, 0x35d53549), - TOBN(0x9f5e58e2, 0xfcf9b838), TOBN(0xc7186cee, 0xa7fd3cf5), - TOBN(0x77b868ce, 0xe978a1d3), TOBN(0xe3a68b33, 0x7ab92d04), - TOBN(0x51029794, 0x87a5b862), TOBN(0x5f0606c3, 0x3a61d41d), - TOBN(0x2814be27, 0x6f9326f1), TOBN(0x2f521c14, 0xc6fe3c2e), - TOBN(0x17464d7d, 0xacdf7351), TOBN(0x10f5f9d3, 0x777f7e44), - TOBN(0xce8e616b, 0x269fb37d), TOBN(0xaaf73804, 0x7de62de5), - TOBN(0xaba11175, 0x4fdd4153), TOBN(0x515759ba, 0x3770b49b), - TOBN(0x8b09ebf8, 0xaa423a61), TOBN(0x592245a1, 0xcd41fb92), - TOBN(0x1cba8ec1, 0x9b4c8936), TOBN(0xa87e91e3, 0xaf36710e), - TOBN(0x1fd84ce4, 0x3d34a2e3), TOBN(0xee3759ce, 0xb43b5d61), - TOBN(0x895bc78c, 0x619186c7), TOBN(0xf19c3809, 0xcbb9725a), - TOBN(0xc0be21aa, 0xde744b1f), TOBN(0xa7d222b0, 0x60f8056b), - TOBN(0x74be6157, 0xb23efe11), TOBN(0x6fab2b4f, 0x0cd68253), - TOBN(0xad33ea5f, 0x4bf1d725), TOBN(0x9c1d8ee2, 0x4f6c950f), - TOBN(0x544ee78a, 0xa377af06), TOBN(0x54f489bb, 0x94a113e1), - TOBN(0x8f11d634, 0x992fb7e8), TOBN(0x0169a7aa, 0xa2a44347), - TOBN(0x1d49d4af, 0x95020e00), TOBN(0x95945722, 0xe08e120b), - TOBN(0xb6e33878, 0xa4d32282), TOBN(0xe36e029d, 0x48020ae7), - TOBN(0xe05847fb, 0x37a9b750), TOBN(0xf876812c, 0xb29e3819), - TOBN(0x84ad138e, 0xd23a17f0), TOBN(0x6d7b4480, 0xf0b3950e), - TOBN(0xdfa8aef4, 0x2fd67ae0), TOBN(0x8d3eea24, 0x52333af6), - TOBN(0x0d052075, 0xb15d5acc), TOBN(0xc6d9c79f, 0xbd815bc4), - TOBN(0x8dcafd88, 0xdfa36cf2), TOBN(0x908ccbe2, 0x38aa9070), - TOBN(0x638722c4, 0xba35afce), TOBN(0x5a3da8b0, 0xfd6abf0b), - TOBN(0x2dce252c, 0xc9c335c1), TOBN(0x84e7f0de, 0x65aa799b), - TOBN(0x2101a522, 0xb99a72cb), TOBN(0x06de6e67, 0x87618016), - TOBN(0x5ff8c7cd, 0xe6f3653e), TOBN(0x0a821ab5, 0xc7a6754a), - TOBN(0x7e3fa52b, 0x7cb0b5a2), TOBN(0xa7fb121c, 0xc9048790), - TOBN(0x1a725020, 0x06ce053a), TOBN(0xb490a31f, 0x04e929b0), - TOBN(0xe17be47d, 0x62dd61ad), TOBN(0x781a961c, 0x6be01371), - TOBN(0x1063bfd3, 0xdae3cbba), TOBN(0x35647406, 0x7f73c9ba), - TOBN(0xf50e957b, 0x2736a129), TOBN(0xa6313702, 0xed13f256), - TOBN(0x9436ee65, 0x3a19fcc5), TOBN(0xcf2bdb29, 0xe7a4c8b6), - TOBN(0xb06b1244, 0xc5f95cd8), TOBN(0xda8c8af0, 0xf4ab95f4), - TOBN(0x1bae59c2, 0xb9e5836d), TOBN(0x07d51e7e, 0x3acffffc), - TOBN(0x01e15e6a, 0xc2ccbcda), TOBN(0x3bc1923f, 0x8528c3e0), - TOBN(0x43324577, 0xa49fead4), TOBN(0x61a1b884, 0x2aa7a711), - TOBN(0xf9a86e08, 0x700230ef), TOBN(0x0af585a1, 0xbd19adf8), - TOBN(0x7645f361, 0xf55ad8f2), TOBN(0x6e676223, 0x46c3614c), - TOBN(0x23cb257c, 0x4e774d3f), TOBN(0x82a38513, 0xac102d1b), - TOBN(0x9bcddd88, 0x7b126aa5), TOBN(0xe716998b, 0xeefd3ee4), - TOBN(0x4239d571, 0xfb167583), TOBN(0xdd011c78, 0xd16c8f8a), - TOBN(0x271c2895, 0x69a27519), TOBN(0x9ce0a3b7, 0xd2d64b6a), - TOBN(0x8c977289, 0xd5ec6738), TOBN(0xa3b49f9a, 0x8840ef6b), - TOBN(0x808c14c9, 0x9a453419), TOBN(0x5c00295b, 0x0cf0a2d5), - TOBN(0x524414fb, 0x1d4bcc76), TOBN(0xb07691d2, 0x459a88f1), - TOBN(0x77f43263, 0xf70d110f), TOBN(0x64ada5e0, 0xb7abf9f3), - TOBN(0xafd0f94e, 0x5b544cf5), TOBN(0xb4a13a15, 0xfd2713fe), - TOBN(0xb99b7d6e, 0x250c74f4), TOBN(0x097f2f73, 0x20324e45), - TOBN(0x994b37d8, 0xaffa8208), TOBN(0xc3c31b0b, 0xdc29aafc), - TOBN(0x3da74651, 0x7a3a607f), TOBN(0xd8e1b8c1, 0xfe6955d6), - TOBN(0x716e1815, 0xc8418682), TOBN(0x541d487f, 0x7dc91d97), - TOBN(0x48a04669, 0xc6996982), TOBN(0xf39cab15, 0x83a6502e), - TOBN(0x025801a0, 0xe68db055), TOBN(0xf3569758, 0xba3338d5), - TOBN(0xb0c8c0aa, 0xee2afa84), TOBN(0x4f6985d3, 0xfb6562d1), - TOBN(0x351f1f15, 0x132ed17a), TOBN(0x510ed0b4, 0xc04365fe), - TOBN(0xa3f98138, 0xe5b1f066), TOBN(0xbc9d95d6, 0x32df03dc), - TOBN(0xa83ccf6e, 0x19abd09e), TOBN(0x0b4097c1, 0x4ff17edb), - TOBN(0x58a5c478, 0xd64a06ce), TOBN(0x2ddcc3fd, 0x544a58fd), - TOBN(0xd449503d, 0x9e8153b8), TOBN(0x3324fd02, 0x7774179b), - TOBN(0xaf5d47c8, 0xdbd9120c), TOBN(0xeb860162, 0x34fa94db), - TOBN(0x5817bdd1, 0x972f07f4), TOBN(0xe5579e2e, 0xd27bbceb), - TOBN(0x86847a1f, 0x5f11e5a6), TOBN(0xb39ed255, 0x7c3cf048), - TOBN(0xe1076417, 0xa2f62e55), TOBN(0x6b9ab38f, 0x1bcf82a2), - TOBN(0x4bb7c319, 0x7aeb29f9), TOBN(0xf6d17da3, 0x17227a46), - TOBN(0xab53ddbd, 0x0f968c00), TOBN(0xa03da7ec, 0x000c880b), - TOBN(0x7b239624, 0x6a9ad24d), TOBN(0x612c0401, 0x01ec60d0), - TOBN(0x70d10493, 0x109f5df1), TOBN(0xfbda4030, 0x80af7550), - TOBN(0x30b93f95, 0xc6b9a9b3), TOBN(0x0c74ec71, 0x007d9418), - TOBN(0x94175564, 0x6edb951f), TOBN(0x5f4a9d78, 0x7f22c282), - TOBN(0xb7870895, 0xb38d1196), TOBN(0xbc593df3, 0xa228ce7c), - TOBN(0xc78c5bd4, 0x6af3641a), TOBN(0x7802200b, 0x3d9b3dcc), - TOBN(0x0dc73f32, 0x8be33304), TOBN(0x847ed87d, 0x61ffb79a), - TOBN(0xf85c974e, 0x6d671192), TOBN(0x1e14100a, 0xde16f60f), - TOBN(0x45cb0d5a, 0x95c38797), TOBN(0x18923bba, 0x9b022da4), - TOBN(0xef2be899, 0xbbe7e86e), TOBN(0x4a1510ee, 0x216067bf), - TOBN(0xd98c8154, 0x84d5ce3e), TOBN(0x1af777f0, 0xf92a2b90), - TOBN(0x9fbcb400, 0x4ef65724), TOBN(0x3e04a4c9, 0x3c0ca6fe), - TOBN(0xfb3e2cb5, 0x55002994), TOBN(0x1f3a93c5, 0x5363ecab), - TOBN(0x1fe00efe, 0x3923555b), TOBN(0x744bedd9, 0x1e1751ea), - TOBN(0x3fb2db59, 0x6ab69357), TOBN(0x8dbd7365, 0xf5e6618b), - TOBN(0x99d53099, 0xdf1ea40e), TOBN(0xb3f24a0b, 0x57d61e64), - TOBN(0xd088a198, 0x596eb812), TOBN(0x22c8361b, 0x5762940b), - TOBN(0x66f01f97, 0xf9c0d95c), TOBN(0x88461172, 0x8e43cdae), - TOBN(0x11599a7f, 0xb72b15c3), TOBN(0x135a7536, 0x420d95cc), - TOBN(0x2dcdf0f7, 0x5f7ae2f6), TOBN(0x15fc6e1d, 0xd7fa6da2), - TOBN(0x81ca829a, 0xd1d441b6), TOBN(0x84c10cf8, 0x04a106b6), - TOBN(0xa9b26c95, 0xa73fbbd0), TOBN(0x7f24e0cb, 0x4d8f6ee8), - TOBN(0x48b45937, 0x1e25a043), TOBN(0xf8a74fca, 0x036f3dfe), - TOBN(0x1ed46585, 0xc9f84296), TOBN(0x7fbaa8fb, 0x3bc278b0), - TOBN(0xa8e96cd4, 0x6c4fcbd0), TOBN(0x940a1202, 0x73b60a5f), - TOBN(0x34aae120, 0x55a4aec8), TOBN(0x550e9a74, 0xdbd742f0), - TOBN(0x794456d7, 0x228c68ab), TOBN(0x492f8868, 0xa4e25ec6), - TOBN(0x682915ad, 0xb2d8f398), TOBN(0xf13b51cc, 0x5b84c953), - TOBN(0xcda90ab8, 0x5bb917d6), TOBN(0x4b615560, 0x4ea3dee1), - TOBN(0x578b4e85, 0x0a52c1c8), TOBN(0xeab1a695, 0x20b75fc4), - TOBN(0x60c14f3c, 0xaa0bb3c6), TOBN(0x220f448a, 0xb8216094), - TOBN(0x4fe7ee31, 0xb0e63d34), TOBN(0xf4600572, 0xa9e54fab), - TOBN(0xc0493334, 0xd5e7b5a4), TOBN(0x8589fb92, 0x06d54831), - TOBN(0xaa70f5cc, 0x6583553a), TOBN(0x0879094a, 0xe25649e5), - TOBN(0xcc904507, 0x10044652), TOBN(0xebb0696d, 0x02541c4f), - TOBN(0x5a171fde, 0xb9718710), TOBN(0x38f1bed8, 0xf374a9f5), - TOBN(0xc8c582e1, 0xba39bdc1), TOBN(0xfc457b0a, 0x908cc0ce), - TOBN(0x9a187fd4, 0x883841e2), TOBN(0x8ec25b39, 0x38725381), - TOBN(0x2553ed05, 0x96f84395), TOBN(0x095c7661, 0x6f6c6897), - TOBN(0x917ac85c, 0x4bdc5610), TOBN(0xb2885fe4, 0x179eb301), - TOBN(0x5fc65547, 0x8b78bdcc), TOBN(0x4a9fc893, 0xe59e4699), - TOBN(0xbb7ff0cd, 0x3ce299af), TOBN(0x195be9b3, 0xadf38b20), - TOBN(0x6a929c87, 0xd38ddb8f), TOBN(0x55fcc99c, 0xb21a51b9), - TOBN(0x2b695b4c, 0x721a4593), TOBN(0xed1e9a15, 0x768eaac2), - TOBN(0xfb63d71c, 0x7489f914), TOBN(0xf98ba31c, 0x78118910), - TOBN(0x80291373, 0x9b128eb4), TOBN(0x7801214e, 0xd448af4a), - TOBN(0xdbd2e22b, 0x55418dd3), TOBN(0xeffb3c0d, 0xd3998242), - TOBN(0xdfa6077c, 0xc7bf3827), TOBN(0xf2165bcb, 0x47f8238f), - TOBN(0xfe37cf68, 0x8564d554), TOBN(0xe5f825c4, 0x0a81fb98), - TOBN(0x43cc4f67, 0xffed4d6f), TOBN(0xbc609578, 0xb50a34b0), - TOBN(0x8aa8fcf9, 0x5041faf1), TOBN(0x5659f053, 0x651773b6), - TOBN(0xe87582c3, 0x6044d63b), TOBN(0xa6089409, 0x0cdb0ca0), - TOBN(0x8c993e0f, 0xbfb2bcf6), TOBN(0xfc64a719, 0x45985cfc), - TOBN(0x15c4da80, 0x83dbedba), TOBN(0x804ae112, 0x2be67df7), - TOBN(0xda4c9658, 0xa23defde), TOBN(0x12002ddd, 0x5156e0d3), - TOBN(0xe68eae89, 0x5dd21b96), TOBN(0x8b99f28b, 0xcf44624d), - TOBN(0x0ae00808, 0x1ec8897a), TOBN(0xdd0a9303, 0x6712f76e), - TOBN(0x96237522, 0x4e233de4), TOBN(0x192445b1, 0x2b36a8a5), - TOBN(0xabf9ff74, 0x023993d9), TOBN(0x21f37bf4, 0x2aad4a8f), - TOBN(0x340a4349, 0xf8bd2bbd), TOBN(0x1d902cd9, 0x4868195d), - TOBN(0x3d27bbf1, 0xe5fdb6f1), TOBN(0x7a5ab088, 0x124f9f1c), - TOBN(0xc466ab06, 0xf7a09e03), TOBN(0x2f8a1977, 0x31f2c123), - TOBN(0xda355dc7, 0x041b6657), TOBN(0xcb840d12, 0x8ece2a7c), - TOBN(0xb600ad9f, 0x7db32675), TOBN(0x78fea133, 0x07a06f1b), - TOBN(0x5d032269, 0xb31f6094), TOBN(0x07753ef5, 0x83ec37aa), - TOBN(0x03485aed, 0x9c0bea78), TOBN(0x41bb3989, 0xbc3f4524), - TOBN(0x09403761, 0x697f726d), TOBN(0x6109beb3, 0xdf394820), - TOBN(0x804111ea, 0x3b6d1145), TOBN(0xb6271ea9, 0xa8582654), - TOBN(0x619615e6, 0x24e66562), TOBN(0xa2554945, 0xd7b6ad9c), - TOBN(0xd9c4985e, 0x99bfe35f), TOBN(0x9770ccc0, 0x7b51cdf6), - TOBN(0x7c327013, 0x92881832), TOBN(0x8777d45f, 0x286b26d1), - TOBN(0x9bbeda22, 0xd847999d), TOBN(0x03aa33b6, 0xc3525d32), - TOBN(0x4b7b96d4, 0x28a959a1), TOBN(0xbb3786e5, 0x31e5d234), - TOBN(0xaeb5d3ce, 0x6961f247), TOBN(0x20aa85af, 0x02f93d3f), - TOBN(0x9cd1ad3d, 0xd7a7ae4f), TOBN(0xbf6688f0, 0x781adaa8), - TOBN(0xb1b40e86, 0x7469cead), TOBN(0x1904c524, 0x309fca48), - TOBN(0x9b7312af, 0x4b54bbc7), TOBN(0xbe24bf8f, 0x593affa2), - TOBN(0xbe5e0790, 0xbd98764b), TOBN(0xa0f45f17, 0xa26e299e), - TOBN(0x4af0d2c2, 0x6b8fe4c7), TOBN(0xef170db1, 0x8ae8a3e6), - TOBN(0x0e8d61a0, 0x29e0ccc1), TOBN(0xcd53e87e, 0x60ad36ca), - TOBN(0x328c6623, 0xc8173822), TOBN(0x7ee1767d, 0xa496be55), - TOBN(0x89f13259, 0x648945af), TOBN(0x9e45a5fd, 0x25c8009c), - TOBN(0xaf2febd9, 0x1f61ab8c), TOBN(0x43f6bc86, 0x8a275385), - TOBN(0x87792348, 0xf2142e79), TOBN(0x17d89259, 0xc6e6238a), - TOBN(0x7536d2f6, 0x4a839d9b), TOBN(0x1f428fce, 0x76a1fbdc), - TOBN(0x1c109601, 0x0db06dfe), TOBN(0xbfc16bc1, 0x50a3a3cc), - TOBN(0xf9cbd9ec, 0x9b30f41b), TOBN(0x5b5da0d6, 0x00138cce), - TOBN(0xec1d0a48, 0x56ef96a7), TOBN(0xb47eb848, 0x982bf842), - TOBN(0x66deae32, 0xec3f700d), TOBN(0x4e43c42c, 0xaa1181e0), - TOBN(0xa1d72a31, 0xd1a4aa2a), TOBN(0x440d4668, 0xc004f3ce), - TOBN(0x0d6a2d3b, 0x45fe8a7a), TOBN(0x820e52e2, 0xfb128365), - TOBN(0x29ac5fcf, 0x25e51b09), TOBN(0x180cd2bf, 0x2023d159), - TOBN(0xa9892171, 0xa1ebf90e), TOBN(0xf97c4c87, 0x7c132181), - TOBN(0x9f1dc724, 0xc03dbb7e), TOBN(0xae043765, 0x018cbbe4), - TOBN(0xfb0b2a36, 0x0767d153), TOBN(0xa8e2f4d6, 0x249cbaeb), - TOBN(0x172a5247, 0xd95ea168), TOBN(0x1758fada, 0x2970764a), - TOBN(0xac803a51, 0x1d978169), TOBN(0x299cfe2e, 0xde77e01b), - TOBN(0x652a1e17, 0xb0a98927), TOBN(0x2e26e1d1, 0x20014495), - TOBN(0x7ae0af9f, 0x7175b56a), TOBN(0xc2e22a80, 0xd64b9f95), - TOBN(0x4d0ff9fb, 0xd90a060a), TOBN(0x496a27db, 0xbaf38085), - TOBN(0x32305401, 0xda776bcf), TOBN(0xb8cdcef6, 0x725f209e), - TOBN(0x61ba0f37, 0x436a0bba), TOBN(0x263fa108, 0x76860049), - TOBN(0x92beb98e, 0xda3542cf), TOBN(0xa2d4d14a, 0xd5849538), - TOBN(0x989b9d68, 0x12e9a1bc), TOBN(0x61d9075c, 0x5f6e3268), - TOBN(0x352c6aa9, 0x99ace638), TOBN(0xde4e4a55, 0x920f43ff), - TOBN(0xe5e4144a, 0xd673c017), TOBN(0x667417ae, 0x6f6e05ea), - TOBN(0x613416ae, 0xdcd1bd56), TOBN(0x5eb36201, 0x86693711), - TOBN(0x2d7bc504, 0x3a1aa914), TOBN(0x175a1299, 0x76dc5975), - TOBN(0xe900e0f2, 0x3fc8125c), TOBN(0x569ef68c, 0x11198875), - TOBN(0x9012db63, 0x63a113b4), TOBN(0xe3bd3f56, 0x98835766), - TOBN(0xa5c94a52, 0x76412dea), TOBN(0xad9e2a09, 0xaa735e5c), - TOBN(0x405a984c, 0x508b65e9), TOBN(0xbde4a1d1, 0x6df1a0d1), - TOBN(0x1a9433a1, 0xdfba80da), TOBN(0xe9192ff9, 0x9440ad2e), - TOBN(0x9f649696, 0x5099fe92), TOBN(0x25ddb65c, 0x0b27a54a), - TOBN(0x178279dd, 0xc590da61), TOBN(0x5479a999, 0xfbde681a), - TOBN(0xd0e84e05, 0x013fe162), TOBN(0xbe11dc92, 0x632d471b), - TOBN(0xdf0b0c45, 0xfc0e089f), TOBN(0x04fb15b0, 0x4c144025), - TOBN(0xa61d5fc2, 0x13c99927), TOBN(0xa033e9e0, 0x3de2eb35), - TOBN(0xf8185d5c, 0xb8dacbb4), TOBN(0x9a88e265, 0x8644549d), - TOBN(0xf717af62, 0x54671ff6), TOBN(0x4bd4241b, 0x5fa58603), - TOBN(0x06fba40b, 0xe67773c0), TOBN(0xc1d933d2, 0x6a2847e9), - TOBN(0xf4f5acf3, 0x689e2c70), TOBN(0x92aab0e7, 0x46bafd31), - TOBN(0x798d76aa, 0x3473f6e5), TOBN(0xcc6641db, 0x93141934), - TOBN(0xcae27757, 0xd31e535e), TOBN(0x04cc43b6, 0x87c2ee11), - TOBN(0x8d1f9675, 0x2e029ffa), TOBN(0xc2150672, 0xe4cc7a2c), - TOBN(0x3b03c1e0, 0x8d68b013), TOBN(0xa9d6816f, 0xedf298f3), - TOBN(0x1bfbb529, 0xa2804464), TOBN(0x95a52fae, 0x5db22125), - TOBN(0x55b32160, 0x0e1cb64e), TOBN(0x004828f6, 0x7e7fc9fe), - TOBN(0x13394b82, 0x1bb0fb93), TOBN(0xb6293a2d, 0x35f1a920), - TOBN(0xde35ef21, 0xd145d2d9), TOBN(0xbe6225b3, 0xbb8fa603), - TOBN(0x00fc8f6b, 0x32cf252d), TOBN(0xa28e52e6, 0x117cf8c2), - TOBN(0x9d1dc89b, 0x4c371e6d), TOBN(0xcebe0675, 0x36ef0f28), - TOBN(0x5de05d09, 0xa4292f81), TOBN(0xa8303593, 0x353e3083), - TOBN(0xa1715b0a, 0x7e37a9bb), TOBN(0x8c56f61e, 0x2b8faec3), - TOBN(0x52507431, 0x33c9b102), TOBN(0x0130cefc, 0xa44431f0), - TOBN(0x56039fa0, 0xbd865cfb), TOBN(0x4b03e578, 0xbc5f1dd7), - TOBN(0x40edf2e4, 0xbabe7224), TOBN(0xc752496d, 0x3a1988f6), - TOBN(0xd1572d3b, 0x564beb6b), TOBN(0x0db1d110, 0x39a1c608), - TOBN(0x568d1934, 0x16f60126), TOBN(0x05ae9668, 0xf354af33), - TOBN(0x19de6d37, 0xc92544f2), TOBN(0xcc084353, 0xa35837d5), - TOBN(0xcbb6869c, 0x1a514ece), TOBN(0xb633e728, 0x2e1d1066), - TOBN(0xf15dd69f, 0x936c581c), TOBN(0x96e7b8ce, 0x7439c4f9), - TOBN(0x5e676f48, 0x2e448a5b), TOBN(0xb2ca7d5b, 0xfd916bbb), - TOBN(0xd55a2541, 0xf5024025), TOBN(0x47bc5769, 0xe4c2d937), - TOBN(0x7d31b92a, 0x0362189f), TOBN(0x83f3086e, 0xef7816f9), - TOBN(0xf9f46d94, 0xb587579a), TOBN(0xec2d22d8, 0x30e76c5f), - TOBN(0x27d57461, 0xb000ffcf), TOBN(0xbb7e65f9, 0x364ffc2c), - TOBN(0x7c7c9477, 0x6652a220), TOBN(0x61618f89, 0xd696c981), - TOBN(0x5021701d, 0x89effff3), TOBN(0xf2c8ff8e, 0x7c314163), - TOBN(0x2da413ad, 0x8efb4d3e), TOBN(0x937b5adf, 0xce176d95), - TOBN(0x22867d34, 0x2a67d51c), TOBN(0x262b9b10, 0x18eb3ac9), - TOBN(0x4e314fe4, 0xc43ff28b), TOBN(0x76476627, 0x6a664e7a), - TOBN(0x3e90e40b, 0xb7a565c2), TOBN(0x8588993a, 0xc1acf831), - TOBN(0xd7b501d6, 0x8f938829), TOBN(0x996627ee, 0x3edd7d4c), - TOBN(0x37d44a62, 0x90cd34c7), TOBN(0xa8327499, 0xf3833e8d), - TOBN(0x2e18917d, 0x4bf50353), TOBN(0x85dd726b, 0x556765fb), - TOBN(0x54fe65d6, 0x93d5ab66), TOBN(0x3ddbaced, 0x915c25fe), - TOBN(0xa799d9a4, 0x12f22e85), TOBN(0xe2a24867, 0x6d06f6bc), - TOBN(0xf4f1ee56, 0x43ca1637), TOBN(0xfda2828b, 0x61ece30a), - TOBN(0x758c1a3e, 0xa2dee7a6), TOBN(0xdcde2f3c, 0x734b2284), - TOBN(0xaba445d2, 0x4eaba6ad), TOBN(0x35aaf668, 0x76cee0a7), - TOBN(0x7e0b04a9, 0xe5aa049a), TOBN(0xe74083ad, 0x91103e84), - TOBN(0xbeb183ce, 0x40afecc3), TOBN(0x6b89de9f, 0xea043f7a)}, - {TOBN(0x0e299d23, 0xfe67ba66), TOBN(0x91450760, 0x93cf2f34), - TOBN(0xf45b5ea9, 0x97fcf913), TOBN(0x5be00843, 0x8bd7ddda), - TOBN(0x358c3e05, 0xd53ff04d), TOBN(0xbf7ccdc3, 0x5de91ef7), - TOBN(0xad684dbf, 0xb69ec1a0), TOBN(0x367e7cf2, 0x801fd997), - TOBN(0x0ca1f3b7, 0xb0dc8595), TOBN(0x27de4608, 0x9f1d9f2e), - TOBN(0x1af3bf39, 0xbadd82a7), TOBN(0x79356a79, 0x65862448), - TOBN(0xc0602345, 0xf5f9a052), TOBN(0x1a8b0f89, 0x139a42f9), - TOBN(0xb53eee42, 0x844d40fc), TOBN(0x93b0bfe5, 0x4e5b6368), - TOBN(0x5434dd02, 0xc024789c), TOBN(0x90dca9ea, 0x41b57bfc), - TOBN(0x8aa898e2, 0x243398df), TOBN(0xf607c834, 0x894a94bb), - TOBN(0xbb07be97, 0xc2c99b76), TOBN(0x6576ba67, 0x18c29302), - TOBN(0x3d79efcc, 0xe703a88c), TOBN(0xf259ced7, 0xb6a0d106), - TOBN(0x0f893a5d, 0xc8de610b), TOBN(0xe8c515fb, 0x67e223ce), - TOBN(0x7774bfa6, 0x4ead6dc5), TOBN(0x89d20f95, 0x925c728f), - TOBN(0x7a1e0966, 0x098583ce), TOBN(0xa2eedb94, 0x93f2a7d7), - TOBN(0x1b282097, 0x4c304d4a), TOBN(0x0842e3da, 0xc077282d), - TOBN(0xe4d972a3, 0x3b9e2d7b), TOBN(0x7cc60b27, 0xc48218ff), - TOBN(0x8fc70838, 0x84149d91), TOBN(0x5c04346f, 0x2f461ecc), - TOBN(0xebe9fdf2, 0x614650a9), TOBN(0x5e35b537, 0xc1f666ac), - TOBN(0x645613d1, 0x88babc83), TOBN(0x88cace3a, 0xc5e1c93e), - TOBN(0x209ca375, 0x3de92e23), TOBN(0xccb03cc8, 0x5fbbb6e3), - TOBN(0xccb90f03, 0xd7b1487e), TOBN(0xfa9c2a38, 0xc710941f), - TOBN(0x756c3823, 0x6724ceed), TOBN(0x3a902258, 0x192d0323), - TOBN(0xb150e519, 0xea5e038e), TOBN(0xdcba2865, 0xc7427591), - TOBN(0xe549237f, 0x78890732), TOBN(0xc443bef9, 0x53fcb4d9), - TOBN(0x9884d8a6, 0xeb3480d6), TOBN(0x8a35b6a1, 0x3048b186), - TOBN(0xb4e44716, 0x65e9a90a), TOBN(0x45bf380d, 0x653006c0), - TOBN(0x8f3f820d, 0x4fe9ae3b), TOBN(0x244a35a0, 0x979a3b71), - TOBN(0xa1010e9d, 0x74cd06ff), TOBN(0x9c17c7df, 0xaca3eeac), - TOBN(0x74c86cd3, 0x8063aa2b), TOBN(0x8595c4b3, 0x734614ff), - TOBN(0xa3de00ca, 0x990f62cc), TOBN(0xd9bed213, 0xca0c3be5), - TOBN(0x7886078a, 0xdf8ce9f5), TOBN(0xddb27ce3, 0x5cd44444), - TOBN(0xed374a66, 0x58926ddd), TOBN(0x138b2d49, 0x908015b8), - TOBN(0x886c6579, 0xde1f7ab8), TOBN(0x888b9aa0, 0xc3020b7a), - TOBN(0xd3ec034e, 0x3a96e355), TOBN(0xba65b0b8, 0xf30fbe9a), - TOBN(0x064c8e50, 0xff21367a), TOBN(0x1f508ea4, 0x0b04b46e), - TOBN(0x98561a49, 0x747c866c), TOBN(0xbbb1e5fe, 0x0518a062), - TOBN(0x20ff4e8b, 0xecdc3608), TOBN(0x7f55cded, 0x20184027), - TOBN(0x8d73ec95, 0xf38c85f0), TOBN(0x5b589fdf, 0x8bc3b8c3), - TOBN(0xbe95dd98, 0x0f12b66f), TOBN(0xf5bd1a09, 0x0e338e01), - TOBN(0x65163ae5, 0x5e915918), TOBN(0x6158d6d9, 0x86f8a46b), - TOBN(0x8466b538, 0xeeebf99c), TOBN(0xca8761f6, 0xbca477ef), - TOBN(0xaf3449c2, 0x9ebbc601), TOBN(0xef3b0f41, 0xe0c3ae2f), - TOBN(0xaa6c577d, 0x5de63752), TOBN(0xe9166601, 0x64682a51), - TOBN(0x5a3097be, 0xfc15aa1e), TOBN(0x40d12548, 0xb54b0745), - TOBN(0x5bad4706, 0x519a5f12), TOBN(0xed03f717, 0xa439dee6), - TOBN(0x0794bb6c, 0x4a02c499), TOBN(0xf725083d, 0xcffe71d2), - TOBN(0x2cad7519, 0x0f3adcaf), TOBN(0x7f68ea1c, 0x43729310), - TOBN(0xe747c8c7, 0xb7ffd977), TOBN(0xec104c35, 0x80761a22), - TOBN(0x8395ebaf, 0x5a3ffb83), TOBN(0xfb3261f4, 0xe4b63db7), - TOBN(0x53544960, 0xd883e544), TOBN(0x13520d70, 0x8cc2eeb8), - TOBN(0x08f6337b, 0xd3d65f99), TOBN(0x83997db2, 0x781cf95b), - TOBN(0xce6ff106, 0x0dbd2c01), TOBN(0x4f8eea6b, 0x1f9ce934), - TOBN(0x546f7c4b, 0x0e993921), TOBN(0x6236a324, 0x5e753fc7), - TOBN(0x65a41f84, 0xa16022e9), TOBN(0x0c18d878, 0x43d1dbb2), - TOBN(0x73c55640, 0x2d4cef9c), TOBN(0xa0428108, 0x70444c74), - TOBN(0x68e4f15e, 0x9afdfb3c), TOBN(0x49a56143, 0x5bdfb6df), - TOBN(0xa9bc1bd4, 0x5f823d97), TOBN(0xbceb5970, 0xea111c2a), - TOBN(0x366b455f, 0xb269bbc4), TOBN(0x7cd85e1e, 0xe9bc5d62), - TOBN(0xc743c41c, 0x4f18b086), TOBN(0xa4b40990, 0x95294fb9), - TOBN(0x9c7c581d, 0x26ee8382), TOBN(0xcf17dcc5, 0x359d638e), - TOBN(0xee8273ab, 0xb728ae3d), TOBN(0x1d112926, 0xf821f047), - TOBN(0x11498477, 0x50491a74), TOBN(0x687fa761, 0xfde0dfb9), - TOBN(0x2c258022, 0x7ea435ab), TOBN(0x6b8bdb94, 0x91ce7e3f), - TOBN(0x4c5b5dc9, 0x3bf834aa), TOBN(0x04371819, 0x4f6c7e4b), - TOBN(0xc284e00a, 0x3736bcad), TOBN(0x0d881118, 0x21ae8f8d), - TOBN(0xf9cf0f82, 0xf48c8e33), TOBN(0xa11fd075, 0xa1bf40db), - TOBN(0xdceab0de, 0xdc2733e5), TOBN(0xc560a8b5, 0x8e986bd7), - TOBN(0x48dd1fe2, 0x3929d097), TOBN(0x3885b290, 0x92f188f1), - TOBN(0x0f2ae613, 0xda6fcdac), TOBN(0x9054303e, 0xb662a46c), - TOBN(0xb6871e44, 0x0738042a), TOBN(0x98e6a977, 0xbdaf6449), - TOBN(0xd8bc0650, 0xd1c9df1b), TOBN(0xef3d6451, 0x36e098f9), - TOBN(0x03fbae82, 0xb6d72d28), TOBN(0x77ca9db1, 0xf5d84080), - TOBN(0x8a112cff, 0xa58efc1c), TOBN(0x518d761c, 0xc564cb4a), - TOBN(0x69b5740e, 0xf0d1b5ce), TOBN(0x717039cc, 0xe9eb1785), - TOBN(0x3fe29f90, 0x22f53382), TOBN(0x8e54ba56, 0x6bc7c95c), - TOBN(0x9c806d8a, 0xf7f91d0f), TOBN(0x3b61b0f1, 0xa82a5728), - TOBN(0x4640032d, 0x94d76754), TOBN(0x273eb5de, 0x47d834c6), - TOBN(0x2988abf7, 0x7b4e4d53), TOBN(0xb7ce66bf, 0xde401777), - TOBN(0x9fba6b32, 0x715071b3), TOBN(0x82413c24, 0xad3a1a98), - TOBN(0x5b7fc8c4, 0xe0e8ad93), TOBN(0xb5679aee, 0x5fab868d), - TOBN(0xb1f9d2fa, 0x2b3946f3), TOBN(0x458897dc, 0x5685b50a), - TOBN(0x1e98c930, 0x89d0caf3), TOBN(0x39564c5f, 0x78642e92), - TOBN(0x1b77729a, 0x0dbdaf18), TOBN(0xf9170722, 0x579e82e6), - TOBN(0x680c0317, 0xe4515fa5), TOBN(0xf85cff84, 0xfb0c790f), - TOBN(0xc7a82aab, 0x6d2e0765), TOBN(0x7446bca9, 0x35c82b32), - TOBN(0x5de607aa, 0x6d63184f), TOBN(0x7c1a46a8, 0x262803a6), - TOBN(0xd218313d, 0xaebe8035), TOBN(0x92113ffd, 0xc73c51f8), - TOBN(0x4b38e083, 0x12e7e46c), TOBN(0x69d0a37a, 0x56126bd5), - TOBN(0xfb3f324b, 0x73c07e04), TOBN(0xa0c22f67, 0x8fda7267), - TOBN(0x8f2c0051, 0x4d2c7d8f), TOBN(0xbc45ced3, 0xcbe2cae5), - TOBN(0xe1c6cf07, 0xa8f0f277), TOBN(0xbc392312, 0x1eb99a98), - TOBN(0x75537b7e, 0x3cc8ac85), TOBN(0x8d725f57, 0xdd02753b), - TOBN(0xfd05ff64, 0xb737df2f), TOBN(0x55fe8712, 0xf6d2531d), - TOBN(0x57ce04a9, 0x6ab6b01c), TOBN(0x69a02a89, 0x7cd93724), - TOBN(0x4f82ac35, 0xcf86699b), TOBN(0x8242d3ad, 0x9cb4b232), - TOBN(0x713d0f65, 0xd62105e5), TOBN(0xbb222bfa, 0x2d29be61), - TOBN(0xf2f9a79e, 0x6cfbef09), TOBN(0xfc24d8d3, 0xd5d6782f), - TOBN(0x5db77085, 0xd4129967), TOBN(0xdb81c3cc, 0xdc3c2a43), - TOBN(0x9d655fc0, 0x05d8d9a3), TOBN(0x3f5d057a, 0x54298026), - TOBN(0x1157f56d, 0x88c54694), TOBN(0xb26baba5, 0x9b09573e), - TOBN(0x2cab03b0, 0x22adffd1), TOBN(0x60a412c8, 0xdd69f383), - TOBN(0xed76e98b, 0x54b25039), TOBN(0xd4ee67d3, 0x687e714d), - TOBN(0x87739648, 0x7b00b594), TOBN(0xce419775, 0xc9ef709b), - TOBN(0x40f76f85, 0x1c203a40), TOBN(0x30d352d6, 0xeafd8f91), - TOBN(0xaf196d3d, 0x95578dd2), TOBN(0xea4bb3d7, 0x77cc3f3d), - TOBN(0x42a5bd03, 0xb98e782b), TOBN(0xac958c40, 0x0624920d), - TOBN(0xb838134c, 0xfc56fcc8), TOBN(0x86ec4ccf, 0x89572e5e), - TOBN(0x69c43526, 0x9be47be0), TOBN(0x323b7dd8, 0xcb28fea1), - TOBN(0xfa5538ba, 0x3a6c67e5), TOBN(0xef921d70, 0x1d378e46), - TOBN(0xf92961fc, 0x3c4b880e), TOBN(0x3f6f914e, 0x98940a67), - TOBN(0xa990eb0a, 0xfef0ff39), TOBN(0xa6c2920f, 0xf0eeff9c), - TOBN(0xca804166, 0x51b8d9a3), TOBN(0x42531bc9, 0x0ffb0db1), - TOBN(0x72ce4718, 0xaa82e7ce), TOBN(0x6e199913, 0xdf574741), - TOBN(0xd5f1b13d, 0xd5d36946), TOBN(0x8255dc65, 0xf68f0194), - TOBN(0xdc9df4cd, 0x8710d230), TOBN(0x3453c20f, 0x138c1988), - TOBN(0x9af98dc0, 0x89a6ef01), TOBN(0x4dbcc3f0, 0x9857df85), - TOBN(0x34805601, 0x5c1ad924), TOBN(0x40448da5, 0xd0493046), - TOBN(0xf629926d, 0x4ee343e2), TOBN(0x6343f1bd, 0x90e8a301), - TOBN(0xefc93491, 0x40815b3f), TOBN(0xf882a423, 0xde8f66fb), - TOBN(0x3a12d5f4, 0xe7db9f57), TOBN(0x7dfba38a, 0x3c384c27), - TOBN(0x7a904bfd, 0x6fc660b1), TOBN(0xeb6c5db3, 0x2773b21c), - TOBN(0xc350ee66, 0x1cdfe049), TOBN(0x9baac0ce, 0x44540f29), - TOBN(0xbc57b6ab, 0xa5ec6aad), TOBN(0x167ce8c3, 0x0a7c1baa), - TOBN(0xb23a03a5, 0x53fb2b56), TOBN(0x6ce141e7, 0x4e057f78), - TOBN(0x796525c3, 0x89e490d9), TOBN(0x0bc95725, 0xa31a7e75), - TOBN(0x1ec56791, 0x1220fd06), TOBN(0x716e3a3c, 0x408b0bd6), - TOBN(0x31cd6bf7, 0xe8ebeba9), TOBN(0xa7326ca6, 0xbee6b670), - TOBN(0x3d9f851c, 0xcd090c43), TOBN(0x561e8f13, 0xf12c3988), - TOBN(0x50490b6a, 0x904b7be4), TOBN(0x61690ce1, 0x0410737b), - TOBN(0x299e9a37, 0x0f009052), TOBN(0x258758f0, 0xf026092e), - TOBN(0x9fa255f3, 0xfdfcdc0f), TOBN(0xdbc9fb1f, 0xc0e1bcd2), - TOBN(0x35f9dd6e, 0x24651840), TOBN(0xdca45a84, 0xa5c59abc), - TOBN(0x103d396f, 0xecca4938), TOBN(0x4532da0a, 0xb97b3f29), - TOBN(0xc4135ea5, 0x1999a6bf), TOBN(0x3aa9505a, 0x5e6bf2ee), - TOBN(0xf77cef06, 0x3f5be093), TOBN(0x97d1a0f8, 0xa943152e), - TOBN(0x2cb0ebba, 0x2e1c21dd), TOBN(0xf41b29fc, 0x2c6797c4), - TOBN(0xc6e17321, 0xb300101f), TOBN(0x4422b0e9, 0xd0d79a89), - TOBN(0x49e4901c, 0x92f1bfc4), TOBN(0x06ab1f8f, 0xe1e10ed9), - TOBN(0x84d35577, 0xdb2926b8), TOBN(0xca349d39, 0x356e8ec2), - TOBN(0x70b63d32, 0x343bf1a9), TOBN(0x8fd3bd28, 0x37d1a6b1), - TOBN(0x0454879c, 0x316865b4), TOBN(0xee959ff6, 0xc458efa2), - TOBN(0x0461dcf8, 0x9706dc3f), TOBN(0x737db0e2, 0x164e4b2e), - TOBN(0x09262680, 0x2f8843c8), TOBN(0x54498bbc, 0x7745e6f6), - TOBN(0x359473fa, 0xa29e24af), TOBN(0xfcc3c454, 0x70aa87a1), - TOBN(0xfd2c4bf5, 0x00573ace), TOBN(0xb65b514e, 0x28dd1965), - TOBN(0xe46ae7cf, 0x2193e393), TOBN(0x60e9a4e1, 0xf5444d97), - TOBN(0xe7594e96, 0x00ff38ed), TOBN(0x43d84d2f, 0x0a0e0f02), - TOBN(0x8b6db141, 0xee398a21), TOBN(0xb88a56ae, 0xe3bcc5be), - TOBN(0x0a1aa52f, 0x373460ea), TOBN(0x20da1a56, 0x160bb19b), - TOBN(0xfb54999d, 0x65bf0384), TOBN(0x71a14d24, 0x5d5a180e), - TOBN(0xbc44db7b, 0x21737b04), TOBN(0xd84fcb18, 0x01dd8e92), - TOBN(0x80de937b, 0xfa44b479), TOBN(0x53505499, 0x5c98fd4f), - TOBN(0x1edb12ab, 0x28f08727), TOBN(0x4c58b582, 0xa5f3ef53), - TOBN(0xbfb236d8, 0x8327f246), TOBN(0xc3a3bfaa, 0x4d7df320), - TOBN(0xecd96c59, 0xb96024f2), TOBN(0xfc293a53, 0x7f4e0433), - TOBN(0x5341352b, 0x5acf6e10), TOBN(0xc50343fd, 0xafe652c3), - TOBN(0x4af3792d, 0x18577a7f), TOBN(0xe1a4c617, 0xaf16823d), - TOBN(0x9b26d0cd, 0x33425d0a), TOBN(0x306399ed, 0x9b7bc47f), - TOBN(0x2a792f33, 0x706bb20b), TOBN(0x31219614, 0x98111055), - TOBN(0x864ec064, 0x87f5d28b), TOBN(0x11392d91, 0x962277fd), - TOBN(0xb5aa7942, 0xbb6aed5f), TOBN(0x080094dc, 0x47e799d9), - TOBN(0x4afa588c, 0x208ba19b), TOBN(0xd3e7570f, 0x8512f284), - TOBN(0xcbae64e6, 0x02f5799a), TOBN(0xdeebe7ef, 0x514b9492), - TOBN(0x30300f98, 0xe5c298ff), TOBN(0x17f561be, 0x3678361f), - TOBN(0xf52ff312, 0x98cb9a16), TOBN(0x6233c3bc, 0x5562d490), - TOBN(0x7bfa15a1, 0x92e3a2cb), TOBN(0x961bcfd1, 0xe6365119), - TOBN(0x3bdd29bf, 0x2c8c53b1), TOBN(0x739704df, 0x822844ba), - TOBN(0x7dacfb58, 0x7e7b754b), TOBN(0x23360791, 0xa806c9b9), - TOBN(0xe7eb88c9, 0x23504452), TOBN(0x2983e996, 0x852c1783), - TOBN(0xdd4ae529, 0x958d881d), TOBN(0x026bae03, 0x262c7b3c), - TOBN(0x3a6f9193, 0x960b52d1), TOBN(0xd0980f90, 0x92696cfb), - TOBN(0x4c1f428c, 0xd5f30851), TOBN(0x94dfed27, 0x2a4f6630), - TOBN(0x4df53772, 0xfc5d48a4), TOBN(0xdd2d5a2f, 0x933260ce), - TOBN(0x574115bd, 0xd44cc7a5), TOBN(0x4ba6b20d, 0xbd12533a), - TOBN(0x30e93cb8, 0x243057c9), TOBN(0x794c486a, 0x14de320e), - TOBN(0xe925d4ce, 0xf21496e4), TOBN(0xf951d198, 0xec696331), - TOBN(0x9810e2de, 0x3e8d812f), TOBN(0xd0a47259, 0x389294ab), - TOBN(0x513ba2b5, 0x0e3bab66), TOBN(0x462caff5, 0xabad306f), - TOBN(0xe2dc6d59, 0xaf04c49e), TOBN(0x1aeb8750, 0xe0b84b0b), - TOBN(0xc034f12f, 0x2f7d0ca2), TOBN(0x6d2e8128, 0xe06acf2f), - TOBN(0x801f4f83, 0x21facc2f), TOBN(0xa1170c03, 0xf40ef607), - TOBN(0xfe0a1d4f, 0x7805a99c), TOBN(0xbde56a36, 0xcc26aba5), - TOBN(0x5b1629d0, 0x35531f40), TOBN(0xac212c2b, 0x9afa6108), - TOBN(0x30a06bf3, 0x15697be5), TOBN(0x6f0545dc, 0x2c63c7c1), - TOBN(0x5d8cb842, 0x7ccdadaf), TOBN(0xd52e379b, 0xac7015bb), - TOBN(0xc4f56147, 0xf462c23e), TOBN(0xd44a4298, 0x46bc24b0), - TOBN(0xbc73d23a, 0xe2856d4f), TOBN(0x61cedd8c, 0x0832bcdf), - TOBN(0x60953556, 0x99f241d7), TOBN(0xee4adbd7, 0x001a349d), - TOBN(0x0b35bf6a, 0xaa89e491), TOBN(0x7f0076f4, 0x136f7546), - TOBN(0xd19a18ba, 0x9264da3d), TOBN(0x6eb2d2cd, 0x62a7a28b), - TOBN(0xcdba941f, 0x8761c971), TOBN(0x1550518b, 0xa3be4a5d), - TOBN(0xd0e8e2f0, 0x57d0b70c), TOBN(0xeea8612e, 0xcd133ba3), - TOBN(0x814670f0, 0x44416aec), TOBN(0x424db6c3, 0x30775061), - TOBN(0xd96039d1, 0x16213fd1), TOBN(0xc61e7fa5, 0x18a3478f), - TOBN(0xa805bdcc, 0xcb0c5021), TOBN(0xbdd6f3a8, 0x0cc616dd), - TOBN(0x06009667, 0x5d97f7e2), TOBN(0x31db0fc1, 0xaf0bf4b6), - TOBN(0x23680ed4, 0x5491627a), TOBN(0xb99a3c66, 0x7d741fb1), - TOBN(0xe9bb5f55, 0x36b1ff92), TOBN(0x29738577, 0x512b388d), - TOBN(0xdb8a2ce7, 0x50fcf263), TOBN(0x385346d4, 0x6c4f7b47), - TOBN(0xbe86c5ef, 0x31631f9e), TOBN(0xbf91da21, 0x03a57a29), - TOBN(0xc3b1f796, 0x7b23f821), TOBN(0x0f7d00d2, 0x770db354), - TOBN(0x8ffc6c3b, 0xd8fe79da), TOBN(0xcc5e8c40, 0xd525c996), - TOBN(0x4640991d, 0xcfff632a), TOBN(0x64d97e8c, 0x67112528), - TOBN(0xc232d973, 0x02f1cd1e), TOBN(0xce87eacb, 0x1dd212a4), - TOBN(0x6e4c8c73, 0xe69802f7), TOBN(0x12ef0290, 0x1fffddbd), - TOBN(0x941ec74e, 0x1bcea6e2), TOBN(0xd0b54024, 0x3cb92cbb), - TOBN(0x809fb9d4, 0x7e8f9d05), TOBN(0x3bf16159, 0xf2992aae), - TOBN(0xad40f279, 0xf8a7a838), TOBN(0x11aea631, 0x05615660), - TOBN(0xbf52e6f1, 0xa01f6fa1), TOBN(0xef046995, 0x3dc2aec9), - TOBN(0x785dbec9, 0xd8080711), TOBN(0xe1aec60a, 0x9fdedf76), - TOBN(0xece797b5, 0xfa21c126), TOBN(0xc66e898f, 0x05e52732), - TOBN(0x39bb69c4, 0x08811fdb), TOBN(0x8bfe1ef8, 0x2fc7f082), - TOBN(0xc8e7a393, 0x174f4138), TOBN(0xfba8ad1d, 0xd58d1f98), - TOBN(0xbc21d0ce, 0xbfd2fd5b), TOBN(0x0b839a82, 0x6ee60d61), - TOBN(0xaacf7658, 0xafd22253), TOBN(0xb526bed8, 0xaae396b3), - TOBN(0xccc1bbc2, 0x38564464), TOBN(0x9e3ff947, 0x8c45bc73), - TOBN(0xcde9bca3, 0x58188a78), TOBN(0x138b8ee0, 0xd73bf8f7), - TOBN(0x5c7e234c, 0x4123c489), TOBN(0x66e69368, 0xfa643297), - TOBN(0x0629eeee, 0x39a15fa3), TOBN(0x95fab881, 0xa9e2a927), - TOBN(0xb2497007, 0xeafbb1e1), TOBN(0xd75c9ce6, 0xe75b7a93), - TOBN(0x3558352d, 0xefb68d78), TOBN(0xa2f26699, 0x223f6396), - TOBN(0xeb911ecf, 0xe469b17a), TOBN(0x62545779, 0xe72d3ec2), - TOBN(0x8ea47de7, 0x82cb113f), TOBN(0xebe4b086, 0x4e1fa98d), - TOBN(0xec2d5ed7, 0x8cdfedb1), TOBN(0xa535c077, 0xfe211a74), - TOBN(0x9678109b, 0x11d244c5), TOBN(0xf17c8bfb, 0xbe299a76), - TOBN(0xb651412e, 0xfb11fbc4), TOBN(0xea0b5482, 0x94ab3f65), - TOBN(0xd8dffd95, 0x0cf78243), TOBN(0x2e719e57, 0xce0361d4), - TOBN(0x9007f085, 0x304ddc5b), TOBN(0x095e8c6d, 0x4daba2ea), - TOBN(0x5a33cdb4, 0x3f9d28a9), TOBN(0x85b95cd8, 0xe2283003), - TOBN(0xbcd6c819, 0xb9744733), TOBN(0x29c5f538, 0xfc7f5783), - TOBN(0x6c49b2fa, 0xd59038e4), TOBN(0x68349cc1, 0x3bbe1018), - TOBN(0xcc490c1d, 0x21830ee5), TOBN(0x36f9c4ee, 0xe9bfa297), - TOBN(0x58fd7294, 0x48de1a94), TOBN(0xaadb13a8, 0x4e8f2cdc), - TOBN(0x515eaaa0, 0x81313dba), TOBN(0xc76bb468, 0xc2152dd8), - TOBN(0x357f8d75, 0xa653dbf8), TOBN(0xe4d8c4d1, 0xb14ac143), - TOBN(0xbdb8e675, 0xb055cb40), TOBN(0x898f8e7b, 0x977b5167), - TOBN(0xecc65651, 0xb82fb863), TOBN(0x56544814, 0x6d88f01f), - TOBN(0xb0928e95, 0x263a75a9), TOBN(0xcfb6836f, 0x1a22fcda), - TOBN(0x651d14db, 0x3f3bd37c), TOBN(0x1d3837fb, 0xb6ad4664), - TOBN(0x7c5fb538, 0xff4f94ab), TOBN(0x7243c712, 0x6d7fb8f2), - TOBN(0xef13d60c, 0xa85c5287), TOBN(0x18cfb7c7, 0x4bb8dd1b), - TOBN(0x82f9bfe6, 0x72908219), TOBN(0x35c4592b, 0x9d5144ab), - TOBN(0x52734f37, 0x9cf4b42f), TOBN(0x6bac55e7, 0x8c60ddc4), - TOBN(0xb5cd811e, 0x94dea0f6), TOBN(0x259ecae4, 0xe18cc1a3), - TOBN(0x6a0e836e, 0x15e660f8), TOBN(0x6c639ea6, 0x0e02bff2), - TOBN(0x8721b8cb, 0x7e1026fd), TOBN(0x9e73b50b, 0x63261942), - TOBN(0xb8c70974, 0x77f01da3), TOBN(0x1839e6a6, 0x8268f57f), - TOBN(0x571b9415, 0x5150b805), TOBN(0x1892389e, 0xf92c7097), - TOBN(0x8d69c18e, 0x4a084b95), TOBN(0x7014c512, 0xbe5b495c), - TOBN(0x4780db36, 0x1b07523c), TOBN(0x2f6219ce, 0x2c1c64fa), - TOBN(0xc38b81b0, 0x602c105a), TOBN(0xab4f4f20, 0x5dc8e360), - TOBN(0x20d3c982, 0xcf7d62d2), TOBN(0x1f36e29d, 0x23ba8150), - TOBN(0x48ae0bf0, 0x92763f9e), TOBN(0x7a527e6b, 0x1d3a7007), - TOBN(0xb4a89097, 0x581a85e3), TOBN(0x1f1a520f, 0xdc158be5), - TOBN(0xf98db37d, 0x167d726e), TOBN(0x8802786e, 0x1113e862)}, - {TOBN(0xefb2149e, 0x36f09ab0), TOBN(0x03f163ca, 0x4a10bb5b), - TOBN(0xd0297045, 0x06e20998), TOBN(0x56f0af00, 0x1b5a3bab), - TOBN(0x7af4cfec, 0x70880e0d), TOBN(0x7332a66f, 0xbe3d913f), - TOBN(0x32e6c84a, 0x7eceb4bd), TOBN(0xedc4a79a, 0x9c228f55), - TOBN(0xc37c7dd0, 0xc55c4496), TOBN(0xa6a96357, 0x25bbabd2), - TOBN(0x5b7e63f2, 0xadd7f363), TOBN(0x9dce3782, 0x2e73f1df), - TOBN(0xe1e5a16a, 0xb2b91f71), TOBN(0xe4489823, 0x5ba0163c), - TOBN(0xf2759c32, 0xf6e515ad), TOBN(0xa5e2f1f8, 0x8615eecf), - TOBN(0x74519be7, 0xabded551), TOBN(0x03d358b8, 0xc8b74410), - TOBN(0x4d00b10b, 0x0e10d9a9), TOBN(0x6392b0b1, 0x28da52b7), - TOBN(0x6744a298, 0x0b75c904), TOBN(0xc305b0ae, 0xa8f7f96c), - TOBN(0x042e421d, 0x182cf932), TOBN(0xf6fc5d50, 0x9e4636ca), - TOBN(0x795847c9, 0xd64cc78c), TOBN(0x6c50621b, 0x9b6cb27b), - TOBN(0x07099bf8, 0xdf8022ab), TOBN(0x48f862eb, 0xc04eda1d), - TOBN(0xd12732ed, 0xe1603c16), TOBN(0x19a80e0f, 0x5c9a9450), - TOBN(0xe2257f54, 0xb429b4fc), TOBN(0x66d3b2c6, 0x45460515), - TOBN(0x6ca4f87e, 0x822e37be), TOBN(0x73f237b4, 0x253bda4e), - TOBN(0xf747f3a2, 0x41190aeb), TOBN(0xf06fa36f, 0x804cf284), - TOBN(0x0a6bbb6e, 0xfc621c12), TOBN(0x5d624b64, 0x40b80ec6), - TOBN(0x4b072425, 0x7ba556f3), TOBN(0x7fa0c354, 0x3e2d20a8), - TOBN(0xe921fa31, 0xe3229d41), TOBN(0xa929c652, 0x94531bd4), - TOBN(0x84156027, 0xa6d38209), TOBN(0xf3d69f73, 0x6bdb97bd), - TOBN(0x8906d19a, 0x16833631), TOBN(0x68a34c2e, 0x03d51be3), - TOBN(0xcb59583b, 0x0e511cd8), TOBN(0x99ce6bfd, 0xfdc132a8), - TOBN(0x3facdaaa, 0xffcdb463), TOBN(0x658bbc1a, 0x34a38b08), - TOBN(0x12a801f8, 0xf1a9078d), TOBN(0x1567bcf9, 0x6ab855de), - TOBN(0xe08498e0, 0x3572359b), TOBN(0xcf0353e5, 0x8659e68b), - TOBN(0xbb86e9c8, 0x7d23807c), TOBN(0xbc08728d, 0x2198e8a2), - TOBN(0x8de2b7bc, 0x453cadd6), TOBN(0x203900a7, 0xbc0bc1f8), - TOBN(0xbcd86e47, 0xa6abd3af), TOBN(0x911cac12, 0x8502effb), - TOBN(0x2d550242, 0xec965469), TOBN(0x0e9f7692, 0x29e0017e), - TOBN(0x633f078f, 0x65979885), TOBN(0xfb87d449, 0x4cf751ef), - TOBN(0xe1790e4b, 0xfc25419a), TOBN(0x36467203, 0x4bff3cfd), - TOBN(0xc8db6386, 0x25b6e83f), TOBN(0x6cc69f23, 0x6cad6fd2), - TOBN(0x0219e45a, 0x6bc68bb9), TOBN(0xe43d79b6, 0x297f7334), - TOBN(0x7d445368, 0x465dc97c), TOBN(0x4b9eea32, 0x2a0b949a), - TOBN(0x1b96c6ba, 0x6102d021), TOBN(0xeaafac78, 0x2f4461ea), - TOBN(0xd4b85c41, 0xc49f19a8), TOBN(0x275c28e4, 0xcf538875), - TOBN(0x35451a9d, 0xdd2e54e0), TOBN(0x6991adb5, 0x0605618b), - TOBN(0x5b8b4bcd, 0x7b36cd24), TOBN(0x372a4f8c, 0x56f37216), - TOBN(0xc890bd73, 0xa6a5da60), TOBN(0x6f083da0, 0xdc4c9ff0), - TOBN(0xf4e14d94, 0xf0536e57), TOBN(0xf9ee1eda, 0xaaec8243), - TOBN(0x571241ec, 0x8bdcf8e7), TOBN(0xa5db8271, 0x0b041e26), - TOBN(0x9a0b9a99, 0xe3fff040), TOBN(0xcaaf21dd, 0x7c271202), - TOBN(0xb4e2b2e1, 0x4f0dd2e8), TOBN(0xe77e7c4f, 0x0a377ac7), - TOBN(0x69202c3f, 0x0d7a2198), TOBN(0xf759b7ff, 0x28200eb8), - TOBN(0xc87526ed, 0xdcfe314e), TOBN(0xeb84c524, 0x53d5cf99), - TOBN(0xb1b52ace, 0x515138b6), TOBN(0x5aa7ff8c, 0x23fca3f4), - TOBN(0xff0b13c3, 0xb9791a26), TOBN(0x960022da, 0xcdd58b16), - TOBN(0xdbd55c92, 0x57aad2de), TOBN(0x3baaaaa3, 0xf30fe619), - TOBN(0x9a4b2346, 0x0d881efd), TOBN(0x506416c0, 0x46325e2a), - TOBN(0x91381e76, 0x035c18d4), TOBN(0xb3bb68be, 0xf27817b0), - TOBN(0x15bfb8bf, 0x5116f937), TOBN(0x7c64a586, 0xc1268943), - TOBN(0x71e25cc3, 0x8419a2c8), TOBN(0x9fd6b0c4, 0x8335f463), - TOBN(0x4bf0ba3c, 0xe8ee0e0e), TOBN(0x6f6fba60, 0x298c21fa), - TOBN(0x57d57b39, 0xae66bee0), TOBN(0x292d5130, 0x22672544), - TOBN(0xf451105d, 0xbab093b3), TOBN(0x012f59b9, 0x02839986), - TOBN(0x8a915802, 0x3474a89c), TOBN(0x048c919c, 0x2de03e97), - TOBN(0xc476a2b5, 0x91071cd5), TOBN(0x791ed89a, 0x034970a5), - TOBN(0x89bd9042, 0xe1b7994b), TOBN(0x8eaf5179, 0xa1057ffd), - TOBN(0x6066e2a2, 0xd551ee10), TOBN(0x87a8f1d8, 0x727e09a6), - TOBN(0x00d08bab, 0x2c01148d), TOBN(0x6da8e4f1, 0x424f33fe), - TOBN(0x466d17f0, 0xcf9a4e71), TOBN(0xff502010, 0x3bf5cb19), - TOBN(0xdccf97d8, 0xd062ecc0), TOBN(0x80c0d9af, 0x81d80ac4), - TOBN(0xe87771d8, 0x033f2876), TOBN(0xb0186ec6, 0x7d5cc3db), - TOBN(0x58e8bb80, 0x3bc9bc1d), TOBN(0x4d1395cc, 0x6f6ef60e), - TOBN(0xa73c62d6, 0x186244a0), TOBN(0x918e5f23, 0x110a5b53), - TOBN(0xed4878ca, 0x741b7eab), TOBN(0x3038d71a, 0xdbe03e51), - TOBN(0x840204b7, 0xa93c3246), TOBN(0x21ab6069, 0xa0b9b4cd), - TOBN(0xf5fa6e2b, 0xb1d64218), TOBN(0x1de6ad0e, 0xf3d56191), - TOBN(0x570aaa88, 0xff1929c7), TOBN(0xc6df4c6b, 0x640e87b5), - TOBN(0xde8a74f2, 0xc65f0ccc), TOBN(0x8b972fd5, 0xe6f6cc01), - TOBN(0x3fff36b6, 0x0b846531), TOBN(0xba7e45e6, 0x10a5e475), - TOBN(0x84a1d10e, 0x4145b6c5), TOBN(0xf1f7f91a, 0x5e046d9d), - TOBN(0x0317a692, 0x44de90d7), TOBN(0x951a1d4a, 0xf199c15e), - TOBN(0x91f78046, 0xc9d73deb), TOBN(0x74c82828, 0xfab8224f), - TOBN(0xaa6778fc, 0xe7560b90), TOBN(0xb4073e61, 0xa7e824ce), - TOBN(0xff0d693c, 0xd642eba8), TOBN(0x7ce2e57a, 0x5dccef38), - TOBN(0x89c2c789, 0x1df1ad46), TOBN(0x83a06922, 0x098346fd), - TOBN(0x2d715d72, 0xda2fc177), TOBN(0x7b6dd71d, 0x85b6cf1d), - TOBN(0xc60a6d0a, 0x73fa9cb0), TOBN(0xedd3992e, 0x328bf5a9), - TOBN(0xc380ddd0, 0x832c8c82), TOBN(0xd182d410, 0xa2a0bf50), - TOBN(0x7d9d7438, 0xd9a528db), TOBN(0xe8b1a0e9, 0xcaf53994), - TOBN(0xddd6e5fe, 0x0e19987c), TOBN(0xacb8df03, 0x190b059d), - TOBN(0x53703a32, 0x8300129f), TOBN(0x1f637662, 0x68c43bfd), - TOBN(0xbcbd1913, 0x00e54051), TOBN(0x812fcc62, 0x7bf5a8c5), - TOBN(0x3f969d5f, 0x29fb85da), TOBN(0x72f4e00a, 0x694759e8), - TOBN(0x426b6e52, 0x790726b7), TOBN(0x617bbc87, 0x3bdbb209), - TOBN(0x511f8bb9, 0x97aee317), TOBN(0x812a4096, 0xe81536a8), - TOBN(0x137dfe59, 0x3ac09b9b), TOBN(0x0682238f, 0xba8c9a7a), - TOBN(0x7072ead6, 0xaeccb4bd), TOBN(0x6a34e9aa, 0x692ba633), - TOBN(0xc82eaec2, 0x6fff9d33), TOBN(0xfb753512, 0x1d4d2b62), - TOBN(0x1a0445ff, 0x1d7aadab), TOBN(0x65d38260, 0xd5f6a67c), - TOBN(0x6e62fb08, 0x91cfb26f), TOBN(0xef1e0fa5, 0x5c7d91d6), - TOBN(0x47e7c7ba, 0x33db72cd), TOBN(0x017cbc09, 0xfa7c74b2), - TOBN(0x3c931590, 0xf50a503c), TOBN(0xcac54f60, 0x616baa42), - TOBN(0x9b6cd380, 0xb2369f0f), TOBN(0x97d3a70d, 0x23c76151), - TOBN(0x5f9dd6fc, 0x9862a9c6), TOBN(0x044c4ab2, 0x12312f51), - TOBN(0x035ea0fd, 0x834a2ddc), TOBN(0x49e6b862, 0xcc7b826d), - TOBN(0xb03d6883, 0x62fce490), TOBN(0x62f2497a, 0xb37e36e9), - TOBN(0x04b005b6, 0xc6458293), TOBN(0x36bb5276, 0xe8d10af7), - TOBN(0xacf2dc13, 0x8ee617b8), TOBN(0x470d2d35, 0xb004b3d4), - TOBN(0x06790832, 0xfeeb1b77), TOBN(0x2bb75c39, 0x85657f9c), - TOBN(0xd70bd4ed, 0xc0f60004), TOBN(0xfe797ecc, 0x219b018b), - TOBN(0x9b5bec2a, 0x753aebcc), TOBN(0xdaf9f3dc, 0xc939eca5), - TOBN(0xd6bc6833, 0xd095ad09), TOBN(0x98abdd51, 0xdaa4d2fc), - TOBN(0xd9840a31, 0x8d168be5), TOBN(0xcf7c10e0, 0x2325a23c), - TOBN(0xa5c02aa0, 0x7e6ecfaf), TOBN(0x2462e7e6, 0xb5bfdf18), - TOBN(0xab2d8a8b, 0xa0cc3f12), TOBN(0x68dd485d, 0xbc672a29), - TOBN(0x72039752, 0x596f2cd3), TOBN(0x5d3eea67, 0xa0cf3d8d), - TOBN(0x810a1a81, 0xe6602671), TOBN(0x8f144a40, 0x14026c0c), - TOBN(0xbc753a6d, 0x76b50f85), TOBN(0xc4dc21e8, 0x645cd4a4), - TOBN(0xc5262dea, 0x521d0378), TOBN(0x802b8e0e, 0x05011c6f), - TOBN(0x1ba19cbb, 0x0b4c19ea), TOBN(0x21db64b5, 0xebf0aaec), - TOBN(0x1f394ee9, 0x70342f9d), TOBN(0x93a10aee, 0x1bc44a14), - TOBN(0xa7eed31b, 0x3efd0baa), TOBN(0x6e7c824e, 0x1d154e65), - TOBN(0xee23fa81, 0x9966e7ee), TOBN(0x64ec4aa8, 0x05b7920d), - TOBN(0x2d44462d, 0x2d90aad4), TOBN(0xf44dd195, 0xdf277ad5), - TOBN(0x8d6471f1, 0xbb46b6a1), TOBN(0x1e65d313, 0xfd885090), - TOBN(0x33a800f5, 0x13a977b4), TOBN(0xaca9d721, 0x0797e1ef), - TOBN(0x9a5a85a0, 0xfcff6a17), TOBN(0x9970a3f3, 0x1eca7cee), - TOBN(0xbb9f0d6b, 0xc9504be3), TOBN(0xe0c504be, 0xadd24ee2), - TOBN(0x7e09d956, 0x77fcc2f4), TOBN(0xef1a5227, 0x65bb5fc4), - TOBN(0x145d4fb1, 0x8b9286aa), TOBN(0x66fd0c5d, 0x6649028b), - TOBN(0x98857ceb, 0x1bf4581c), TOBN(0xe635e186, 0xaca7b166), - TOBN(0x278ddd22, 0x659722ac), TOBN(0xa0903c4c, 0x1db68007), - TOBN(0x366e4589, 0x48f21402), TOBN(0x31b49c14, 0xb96abda2), - TOBN(0x329c4b09, 0xe0403190), TOBN(0x97197ca3, 0xd29f43fe), - TOBN(0x8073dd1e, 0x274983d8), TOBN(0xda1a3bde, 0x55717c8f), - TOBN(0xfd3d4da2, 0x0361f9d1), TOBN(0x1332d081, 0x4c7de1ce), - TOBN(0x9b7ef7a3, 0xaa6d0e10), TOBN(0x17db2e73, 0xf54f1c4a), - TOBN(0xaf3dffae, 0x4cd35567), TOBN(0xaaa2f406, 0xe56f4e71), - TOBN(0x8966759e, 0x7ace3fc7), TOBN(0x9594eacf, 0x45a8d8c6), - TOBN(0x8de3bd8b, 0x91834e0e), TOBN(0xafe4ca53, 0x548c0421), - TOBN(0xfdd7e856, 0xe6ee81c6), TOBN(0x8f671beb, 0x6b891a3a), - TOBN(0xf7a58f2b, 0xfae63829), TOBN(0x9ab186fb, 0x9c11ac9f), - TOBN(0x8d6eb369, 0x10b5be76), TOBN(0x046b7739, 0xfb040bcd), - TOBN(0xccb4529f, 0xcb73de88), TOBN(0x1df0fefc, 0xcf26be03), - TOBN(0xad7757a6, 0xbcfcd027), TOBN(0xa8786c75, 0xbb3165ca), - TOBN(0xe9db1e34, 0x7e99a4d9), TOBN(0x99ee86df, 0xb06c504b), - TOBN(0x5b7c2ddd, 0xc15c9f0a), TOBN(0xdf87a734, 0x4295989e), - TOBN(0x59ece47c, 0x03d08fda), TOBN(0xb074d3dd, 0xad5fc702), - TOBN(0x20407903, 0x51a03776), TOBN(0x2bb1f77b, 0x2a608007), - TOBN(0x25c58f4f, 0xe1153185), TOBN(0xe6df62f6, 0x766e6447), - TOBN(0xefb3d1be, 0xed51275a), TOBN(0x5de47dc7, 0x2f0f483f), - TOBN(0x7932d98e, 0x97c2bedf), TOBN(0xd5c11927, 0x0219f8a1), - TOBN(0x9d751200, 0xa73a294e), TOBN(0x5f88434a, 0x9dc20172), - TOBN(0xd28d9fd3, 0xa26f506a), TOBN(0xa890cd31, 0x9d1dcd48), - TOBN(0x0aebaec1, 0x70f4d3b4), TOBN(0xfd1a1369, 0x0ffc8d00), - TOBN(0xb9d9c240, 0x57d57838), TOBN(0x45929d26, 0x68bac361), - TOBN(0x5a2cd060, 0x25b15ca6), TOBN(0x4b3c83e1, 0x6e474446), - TOBN(0x1aac7578, 0xee1e5134), TOBN(0xa418f5d6, 0xc91e2f41), - TOBN(0x6936fc8a, 0x213ed68b), TOBN(0x860ae7ed, 0x510a5224), - TOBN(0x63660335, 0xdef09b53), TOBN(0x641b2897, 0xcd79c98d), - TOBN(0x29bd38e1, 0x01110f35), TOBN(0x79c26f42, 0x648b1937), - TOBN(0x64dae519, 0x9d9164f4), TOBN(0xd85a2310, 0x0265c273), - TOBN(0x7173dd5d, 0x4b07e2b1), TOBN(0xd144c4cb, 0x8d9ea221), - TOBN(0xe8b04ea4, 0x1105ab14), TOBN(0x92dda542, 0xfe80d8f1), - TOBN(0xe9982fa8, 0xcf03dce6), TOBN(0x8b5ea965, 0x1a22cffc), - TOBN(0xf7f4ea7f, 0x3fad88c4), TOBN(0x62db773e, 0x6a5ba95c), - TOBN(0xd20f02fb, 0x93f24567), TOBN(0xfd46c69a, 0x315257ca), - TOBN(0x0ac74cc7, 0x8bcab987), TOBN(0x46f31c01, 0x5ceca2f5), - TOBN(0x40aedb59, 0x888b219e), TOBN(0xe50ecc37, 0xe1fccd02), - TOBN(0x1bcd9dad, 0x911f816c), TOBN(0x583cc1ec, 0x8db9b00c), - TOBN(0xf3cd2e66, 0xa483bf11), TOBN(0xfa08a6f5, 0xb1b2c169), - TOBN(0xf375e245, 0x4be9fa28), TOBN(0x99a7ffec, 0x5b6d011f), - TOBN(0x6a3ebddb, 0xc4ae62da), TOBN(0x6cea00ae, 0x374aef5d), - TOBN(0xab5fb98d, 0x9d4d05bc), TOBN(0x7cba1423, 0xd560f252), - TOBN(0x49b2cc21, 0x208490de), TOBN(0x1ca66ec3, 0xbcfb2879), - TOBN(0x7f1166b7, 0x1b6fb16f), TOBN(0xfff63e08, 0x65fe5db3), - TOBN(0xb8345abe, 0x8b2610be), TOBN(0xb732ed80, 0x39de3df4), - TOBN(0x0e24ed50, 0x211c32b4), TOBN(0xd10d8a69, 0x848ff27d), - TOBN(0xc1074398, 0xed4de248), TOBN(0xd7cedace, 0x10488927), - TOBN(0xa4aa6bf8, 0x85673e13), TOBN(0xb46bae91, 0x6daf30af), - TOBN(0x07088472, 0xfcef7ad8), TOBN(0x61151608, 0xd4b35e97), - TOBN(0xbcfe8f26, 0xdde29986), TOBN(0xeb84c4c7, 0xd5a34c79), - TOBN(0xc1eec55c, 0x164e1214), TOBN(0x891be86d, 0xa147bb03), - TOBN(0x9fab4d10, 0x0ba96835), TOBN(0xbf01e9b8, 0xa5c1ae9f), - TOBN(0x6b4de139, 0xb186ebc0), TOBN(0xd5c74c26, 0x85b91bca), - TOBN(0x5086a99c, 0xc2d93854), TOBN(0xeed62a7b, 0xa7a9dfbc), - TOBN(0x8778ed6f, 0x76b7618a), TOBN(0xbff750a5, 0x03b66062), - TOBN(0x4cb7be22, 0xb65186db), TOBN(0x369dfbf0, 0xcc3a6d13), - TOBN(0xc7dab26c, 0x7191a321), TOBN(0x9edac3f9, 0x40ed718e), - TOBN(0xbc142b36, 0xd0cfd183), TOBN(0xc8af82f6, 0x7c991693), - TOBN(0xb3d1e4d8, 0x97ce0b2a), TOBN(0xe6d7c87f, 0xc3a55cdf), - TOBN(0x35846b95, 0x68b81afe), TOBN(0x018d12af, 0xd3c239d8), - TOBN(0x2b2c6208, 0x01206e15), TOBN(0xe0e42453, 0xa3b882c6), - TOBN(0x854470a3, 0xa50162d5), TOBN(0x08157478, 0x7017a62a), - TOBN(0x18bd3fb4, 0x820357c7), TOBN(0x992039ae, 0x6f1458ad), - TOBN(0x9a1df3c5, 0x25b44aa1), TOBN(0x2d780357, 0xed3d5281), - TOBN(0x58cf7e4d, 0xc77ad4d4), TOBN(0xd49a7998, 0xf9df4fc4), - TOBN(0x4465a8b5, 0x1d71205e), TOBN(0xa0ee0ea6, 0x649254aa), - TOBN(0x4b5eeecf, 0xab7bd771), TOBN(0x6c873073, 0x35c262b9), - TOBN(0xdc5bd648, 0x3c9d61e7), TOBN(0x233d6d54, 0x321460d2), - TOBN(0xd20c5626, 0xfc195bcc), TOBN(0x25445958, 0x04d78b63), - TOBN(0xe03fcb3d, 0x17ec8ef3), TOBN(0x54b690d1, 0x46b8f781), - TOBN(0x82fa2c8a, 0x21230646), TOBN(0xf51aabb9, 0x084f418c), - TOBN(0xff4fbec1, 0x1a30ba43), TOBN(0x6a5acf73, 0x743c9df7), - TOBN(0x1da2b357, 0xd635b4d5), TOBN(0xc3de68dd, 0xecd5c1da), - TOBN(0xa689080b, 0xd61af0dd), TOBN(0xdea5938a, 0xd665bf99), - TOBN(0x0231d71a, 0xfe637294), TOBN(0x01968aa6, 0xa5a81cd8), - TOBN(0x11252d50, 0x048e63b5), TOBN(0xc446bc52, 0x6ca007e9), - TOBN(0xef8c50a6, 0x96d6134b), TOBN(0x9361fbf5, 0x9e09a05c), - TOBN(0xf17f85a6, 0xdca3291a), TOBN(0xb178d548, 0xff251a21), - TOBN(0x87f6374b, 0xa4df3915), TOBN(0x566ce1bf, 0x2fd5d608), - TOBN(0x425cba4d, 0x7de35102), TOBN(0x6b745f8f, 0x58c5d5e2), - TOBN(0x88402af6, 0x63122edf), TOBN(0x3190f9ed, 0x3b989a89), - TOBN(0x4ad3d387, 0xebba3156), TOBN(0xef385ad9, 0xc7c469a5), - TOBN(0xb08281de, 0x3f642c29), TOBN(0x20be0888, 0x910ffb88), - TOBN(0xf353dd4a, 0xd5292546), TOBN(0x3f1627de, 0x8377a262), - TOBN(0xa5faa013, 0xeefcd638), TOBN(0x8f3bf626, 0x74cc77c3), - TOBN(0x32618f65, 0xa348f55e), TOBN(0x5787c0dc, 0x9fefeb9e), - TOBN(0xf1673aa2, 0xd9a23e44), TOBN(0x88dfa993, 0x4e10690d), - TOBN(0x1ced1b36, 0x2bf91108), TOBN(0x9193ceca, 0x3af48649), - TOBN(0xfb34327d, 0x2d738fc5), TOBN(0x6697b037, 0x975fee6c), - TOBN(0x2f485da0, 0xc04079a5), TOBN(0x2cdf5735, 0x2feaa1ac), - TOBN(0x76944420, 0xbd55659e), TOBN(0x7973e32b, 0x4376090c), - TOBN(0x86bb4fe1, 0x163b591a), TOBN(0x10441aed, 0xc196f0ca), - TOBN(0x3b431f4a, 0x045ad915), TOBN(0x6c11b437, 0xa4afacb1), - TOBN(0x30b0c7db, 0x71fdbbd8), TOBN(0xb642931f, 0xeda65acd), - TOBN(0x4baae6e8, 0x9c92b235), TOBN(0xa73bbd0e, 0x6b3993a1), - TOBN(0xd06d60ec, 0x693dd031), TOBN(0x03cab91b, 0x7156881c), - TOBN(0xd615862f, 0x1db3574b), TOBN(0x485b0185, 0x64bb061a), - TOBN(0x27434988, 0xa0181e06), TOBN(0x2cd61ad4, 0xc1c0c757), - TOBN(0x3effed5a, 0x2ff9f403), TOBN(0x8dc98d8b, 0x62239029), - TOBN(0x2206021e, 0x1f17b70d), TOBN(0xafbec0ca, 0xbf510015), - TOBN(0x9fed7164, 0x80130dfa), TOBN(0x306dc2b5, 0x8a02dcf5), - TOBN(0x48f06620, 0xfeb10fc0), TOBN(0x78d1e1d5, 0x5a57cf51), - TOBN(0xadef8c5a, 0x192ef710), TOBN(0x88afbd4b, 0x3b7431f9), - TOBN(0x7e1f7407, 0x64250c9e), TOBN(0x6e31318d, 0xb58bec07), - TOBN(0xfd4fc4b8, 0x24f89b4e), TOBN(0x65a5dd88, 0x48c36a2a), - TOBN(0x4f1eccff, 0xf024baa7), TOBN(0x22a21cf2, 0xcba94650), - TOBN(0x95d29dee, 0x42a554f7), TOBN(0x828983a5, 0x002ec4ba), - TOBN(0x8112a1f7, 0x8badb73d), TOBN(0x79ea8897, 0xa27c1839), - TOBN(0x8969a5a7, 0xd065fd83), TOBN(0xf49af791, 0xb262a0bc), - TOBN(0xfcdea8b6, 0xaf2b5127), TOBN(0x10e913e1, 0x564c2dbc), - TOBN(0x51239d14, 0xbc21ef51), TOBN(0xe51c3ceb, 0x4ce57292), - TOBN(0x795ff068, 0x47bbcc3b), TOBN(0x86b46e1e, 0xbd7e11e6), - TOBN(0x0ea6ba23, 0x80041ef4), TOBN(0xd72fe505, 0x6262342e), - TOBN(0x8abc6dfd, 0x31d294d4), TOBN(0xbbe017a2, 0x1278c2c9), - TOBN(0xb1fcfa09, 0xb389328a), TOBN(0x322fbc62, 0xd01771b5), - TOBN(0x04c0d063, 0x60b045bf), TOBN(0xdb652edc, 0x10e52d01), - TOBN(0x50ef932c, 0x03ec6627), TOBN(0xde1b3b2d, 0xc1ee50e3), - TOBN(0x5ab7bdc5, 0xdc37a90d), TOBN(0xfea67213, 0x31e33a96), - TOBN(0x6482b5cb, 0x4f2999aa), TOBN(0x38476cc6, 0xb8cbf0dd), - TOBN(0x93ebfacb, 0x173405bb), TOBN(0x15cdafe7, 0xe52369ec), - TOBN(0xd42d5ba4, 0xd935b7db), TOBN(0x648b6004, 0x1c99a4cd), - TOBN(0x785101bd, 0xa3b5545b), TOBN(0x4bf2c38a, 0x9dd67faf), - TOBN(0xb1aadc63, 0x4442449c), TOBN(0xe0e9921a, 0x33ad4fb8), - TOBN(0x5c552313, 0xaa686d82), TOBN(0xdee635fa, 0x465d866c), - TOBN(0xbc3c224a, 0x18ee6e8a), TOBN(0xeed748a6, 0xed42e02f), - TOBN(0xe70f930a, 0xd474cd08), TOBN(0x774ea6ec, 0xfff24adf), - TOBN(0x03e2de1c, 0xf3480d4a), TOBN(0xf0d8edc7, 0xbc8acf1a), - TOBN(0xf23e3303, 0x68295a9c), TOBN(0xfadd5f68, 0xc546a97d), - TOBN(0x895597ad, 0x96f8acb1), TOBN(0xbddd49d5, 0x671bdae2), - TOBN(0x16fcd528, 0x21dd43f4), TOBN(0xa5a45412, 0x6619141a)}, - {TOBN(0x8ce9b6bf, 0xc360e25a), TOBN(0xe6425195, 0x075a1a78), - TOBN(0x9dc756a8, 0x481732f4), TOBN(0x83c0440f, 0x5432b57a), - TOBN(0xc670b3f1, 0xd720281f), TOBN(0x2205910e, 0xd135e051), - TOBN(0xded14b0e, 0xdb052be7), TOBN(0x697b3d27, 0xc568ea39), - TOBN(0x2e599b9a, 0xfb3ff9ed), TOBN(0x28c2e0ab, 0x17f6515c), - TOBN(0x1cbee4fd, 0x474da449), TOBN(0x071279a4, 0x4f364452), - TOBN(0x97abff66, 0x01fbe855), TOBN(0x3ee394e8, 0x5fda51c4), - TOBN(0x190385f6, 0x67597c0b), TOBN(0x6e9fccc6, 0xa27ee34b), - TOBN(0x0b89de93, 0x14092ebb), TOBN(0xf17256bd, 0x428e240c), - TOBN(0xcf89a7f3, 0x93d2f064), TOBN(0x4f57841e, 0xe1ed3b14), - TOBN(0x4ee14405, 0xe708d855), TOBN(0x856aae72, 0x03f1c3d0), - TOBN(0xc8e5424f, 0xbdd7eed5), TOBN(0x3333e4ef, 0x73ab4270), - TOBN(0x3bc77ade, 0xdda492f8), TOBN(0xc11a3aea, 0x78297205), - TOBN(0x5e89a3e7, 0x34931b4c), TOBN(0x17512e2e, 0x9f5694bb), - TOBN(0x5dc349f3, 0x177bf8b6), TOBN(0x232ea4ba, 0x08c7ff3e), - TOBN(0x9c4f9d16, 0xf511145d), TOBN(0xccf109a3, 0x33b379c3), - TOBN(0xe75e7a88, 0xa1f25897), TOBN(0x7ac6961f, 0xa1b5d4d8), - TOBN(0xe3e10773, 0x08f3ed5c), TOBN(0x208a54ec, 0x0a892dfb), - TOBN(0xbe826e19, 0x78660710), TOBN(0x0cf70a97, 0x237df2c8), - TOBN(0x418a7340, 0xed704da5), TOBN(0xa3eeb9a9, 0x08ca33fd), - TOBN(0x49d96233, 0x169bca96), TOBN(0x04d286d4, 0x2da6aafb), - TOBN(0xc09606ec, 0xa0c2fa94), TOBN(0x8869d0d5, 0x23ff0fb3), - TOBN(0xa99937e5, 0xd0150d65), TOBN(0xa92e2503, 0x240c14c9), - TOBN(0x656bf945, 0x108e2d49), TOBN(0x152a733a, 0xa2f59e2b), - TOBN(0xb4323d58, 0x8434a920), TOBN(0xc0af8e93, 0x622103c5), - TOBN(0x667518ef, 0x938dbf9a), TOBN(0xa1843073, 0x83a9cdf2), - TOBN(0x350a94aa, 0x5447ab80), TOBN(0xe5e5a325, 0xc75a3d61), - TOBN(0x74ba507f, 0x68411a9e), TOBN(0x10581fc1, 0x594f70c5), - TOBN(0x60e28570, 0x80eb24a9), TOBN(0x7bedfb4d, 0x488e0cfd), - TOBN(0x721ebbd7, 0xc259cdb8), TOBN(0x0b0da855, 0xbc6390a9), - TOBN(0x2b4d04db, 0xde314c70), TOBN(0xcdbf1fbc, 0x6c32e846), - TOBN(0x33833eab, 0xb162fc9e), TOBN(0x9939b48b, 0xb0dd3ab7), - TOBN(0x5aaa98a7, 0xcb0c9c8c), TOBN(0x75105f30, 0x81c4375c), - TOBN(0xceee5057, 0x5ef1c90f), TOBN(0xb31e065f, 0xc23a17bf), - TOBN(0x5364d275, 0xd4b6d45a), TOBN(0xd363f3ad, 0x62ec8996), - TOBN(0xb5d21239, 0x4391c65b), TOBN(0x84564765, 0xebb41b47), - TOBN(0x20d18ecc, 0x37107c78), TOBN(0xacff3b6b, 0x570c2a66), - TOBN(0x22f975d9, 0x9bd0d845), TOBN(0xef0a0c46, 0xba178fa0), - TOBN(0x1a419651, 0x76b6028e), TOBN(0xc49ec674, 0x248612d4), - TOBN(0x5b6ac4f2, 0x7338af55), TOBN(0x06145e62, 0x7bee5a36), - TOBN(0x33e95d07, 0xe75746b5), TOBN(0x1c1e1f6d, 0xc40c78be), - TOBN(0x967833ef, 0x222ff8e2), TOBN(0x4bedcf6a, 0xb49180ad), - TOBN(0x6b37e9c1, 0x3d7a4c8a), TOBN(0x2748887c, 0x6ddfe760), - TOBN(0xf7055123, 0xaa3a5bbc), TOBN(0x954ff225, 0x7bbb8e74), - TOBN(0xc42b8ab1, 0x97c3dfb9), TOBN(0x55a549b0, 0xcf168154), - TOBN(0xad6748e7, 0xc1b50692), TOBN(0x2775780f, 0x6fc5cbcb), - TOBN(0x4eab80b8, 0xe1c9d7c8), TOBN(0x8c69dae1, 0x3fdbcd56), - TOBN(0x47e6b4fb, 0x9969eace), TOBN(0x002f1085, 0xa705cb5a), - TOBN(0x4e23ca44, 0x6d3fea55), TOBN(0xb4ae9c86, 0xf4810568), - TOBN(0x47bfb91b, 0x2a62f27d), TOBN(0x60deb4c9, 0xd9bac28c), - TOBN(0xa892d894, 0x7de6c34c), TOBN(0x4ee68259, 0x4494587d), - TOBN(0x914ee14e, 0x1a3f8a5b), TOBN(0xbb113eaa, 0x28700385), - TOBN(0x81ca03b9, 0x2115b4c9), TOBN(0x7c163d38, 0x8908cad1), - TOBN(0xc912a118, 0xaa18179a), TOBN(0xe09ed750, 0x886e3081), - TOBN(0xa676e3fa, 0x26f516ca), TOBN(0x753cacf7, 0x8e732f91), - TOBN(0x51592aea, 0x833da8b4), TOBN(0xc626f42f, 0x4cbea8aa), - TOBN(0xef9dc899, 0xa7b56eaf), TOBN(0x00c0e52c, 0x34ef7316), - TOBN(0x5b1e4e24, 0xfe818a86), TOBN(0x9d31e20d, 0xc538be47), - TOBN(0x22eb932d, 0x3ed68974), TOBN(0xe44bbc08, 0x7c4e87c4), - TOBN(0x4121086e, 0x0dde9aef), TOBN(0x8e6b9cff, 0x134f4345), - TOBN(0x96892c1f, 0x711b0eb9), TOBN(0xb905f2c8, 0x780ab954), - TOBN(0xace26309, 0xa20792db), TOBN(0xec8ac9b3, 0x0684e126), - TOBN(0x486ad8b6, 0xb40a2447), TOBN(0x60121fc1, 0x9fe3fb24), - TOBN(0x5626fccf, 0x1a8e3b3f), TOBN(0x4e568622, 0x6ad1f394), - TOBN(0xda7aae0d, 0x196aa5a1), TOBN(0xe0df8c77, 0x1041b5fb), - TOBN(0x451465d9, 0x26b318b7), TOBN(0xc29b6e55, 0x7ab136e9), - TOBN(0x2c2ab48b, 0x71148463), TOBN(0xb5738de3, 0x64454a76), - TOBN(0x54ccf9a0, 0x5a03abe4), TOBN(0x377c0296, 0x0427d58e), - TOBN(0x73f5f0b9, 0x2bb39c1f), TOBN(0x14373f2c, 0xe608d8c5), - TOBN(0xdcbfd314, 0x00fbb805), TOBN(0xdf18fb20, 0x83afdcfb), - TOBN(0x81a57f42, 0x42b3523f), TOBN(0xe958532d, 0x87f650fb), - TOBN(0xaa8dc8b6, 0x8b0a7d7c), TOBN(0x1b75dfb7, 0x150166be), - TOBN(0x90e4f7c9, 0x2d7d1413), TOBN(0x67e2d6b5, 0x9834f597), - TOBN(0x4fd4f4f9, 0xa808c3e8), TOBN(0xaf8237e0, 0xd5281ec1), - TOBN(0x25ab5fdc, 0x84687cee), TOBN(0xc5ded6b1, 0xa5b26c09), - TOBN(0x8e4a5aec, 0xc8ea7650), TOBN(0x23b73e5c, 0x14cc417f), - TOBN(0x2bfb4318, 0x3037bf52), TOBN(0xb61e6db5, 0x78c725d7), - TOBN(0x8efd4060, 0xbbb3e5d7), TOBN(0x2e014701, 0xdbac488e), - TOBN(0xac75cf9a, 0x360aa449), TOBN(0xb70cfd05, 0x79634d08), - TOBN(0xa591536d, 0xfffb15ef), TOBN(0xb2c37582, 0xd07c106c), - TOBN(0xb4293fdc, 0xf50225f9), TOBN(0xc52e175c, 0xb0e12b03), - TOBN(0xf649c3ba, 0xd0a8bf64), TOBN(0x745a8fef, 0xeb8ae3c6), - TOBN(0x30d7e5a3, 0x58321bc3), TOBN(0xb1732be7, 0x0bc4df48), - TOBN(0x1f217993, 0xe9ea5058), TOBN(0xf7a71cde, 0x3e4fd745), - TOBN(0x86cc533e, 0x894c5bbb), TOBN(0x6915c7d9, 0x69d83082), - TOBN(0xa6aa2d05, 0x5815c244), TOBN(0xaeeee592, 0x49b22ce5), - TOBN(0x89e39d13, 0x78135486), TOBN(0x3a275c1f, 0x16b76f2f), - TOBN(0xdb6bcc1b, 0xe036e8f5), TOBN(0x4df69b21, 0x5e4709f5), - TOBN(0xa188b250, 0x2d0f39aa), TOBN(0x622118bb, 0x15a85947), - TOBN(0x2ebf520f, 0xfde0f4fa), TOBN(0xa40e9f29, 0x4860e539), - TOBN(0x7b6a51eb, 0x22b57f0f), TOBN(0x849a33b9, 0x7e80644a), - TOBN(0x50e5d16f, 0x1cf095fe), TOBN(0xd754b54e, 0xec55f002), - TOBN(0x5cfbbb22, 0x236f4a98), TOBN(0x0b0c59e9, 0x066800bb), - TOBN(0x4ac69a8f, 0x5a9a7774), TOBN(0x2b33f804, 0xd6bec948), - TOBN(0xb3729295, 0x32e6c466), TOBN(0x68956d0f, 0x4e599c73), - TOBN(0xa47a249f, 0x155c31cc), TOBN(0x24d80f0d, 0xe1ce284e), - TOBN(0xcd821dfb, 0x988baf01), TOBN(0xe6331a7d, 0xdbb16647), - TOBN(0x1eb8ad33, 0x094cb960), TOBN(0x593cca38, 0xc91bbca5), - TOBN(0x384aac8d, 0x26567456), TOBN(0x40fa0309, 0xc04b6490), - TOBN(0x97834cd6, 0xdab6c8f6), TOBN(0x68a7318d, 0x3f91e55f), - TOBN(0xa00fd04e, 0xfc4d3157), TOBN(0xb56f8ab2, 0x2bf3bdea), - TOBN(0x014f5648, 0x4fa57172), TOBN(0x948c5860, 0x450abdb3), - TOBN(0x342b5df0, 0x0ebd4f08), TOBN(0x3e5168cd, 0x0e82938e), - TOBN(0x7aedc1ce, 0xb0df5dd0), TOBN(0x6bbbc6d9, 0xe5732516), - TOBN(0xc7bfd486, 0x605daaa6), TOBN(0x46fd72b7, 0xbb9a6c9e), - TOBN(0xe4847fb1, 0xa124fb89), TOBN(0x75959cbd, 0xa2d8ffbc), - TOBN(0x42579f65, 0xc8a588ee), TOBN(0x368c92e6, 0xb80b499d), - TOBN(0xea4ef6cd, 0x999a5df1), TOBN(0xaa73bb7f, 0x936fe604), - TOBN(0xf347a70d, 0x6457d188), TOBN(0x86eda86b, 0x8b7a388b), - TOBN(0xb7cdff06, 0x0ccd6013), TOBN(0xbeb1b6c7, 0xd0053fb2), - TOBN(0x0b022387, 0x99240a9f), TOBN(0x1bbb384f, 0x776189b2), - TOBN(0x8695e71e, 0x9066193a), TOBN(0x2eb50097, 0x06ffac7e), - TOBN(0x0654a9c0, 0x4a7d2caa), TOBN(0x6f3fb3d1, 0xa5aaa290), - TOBN(0x835db041, 0xff476e8f), TOBN(0x540b8b0b, 0xc42295e4), - TOBN(0xa5c73ac9, 0x05e214f5), TOBN(0x9a74075a, 0x56a0b638), - TOBN(0x2e4b1090, 0xce9e680b), TOBN(0x57a5b479, 0x6b8d9afa), - TOBN(0x0dca48e7, 0x26bfe65c), TOBN(0x097e391c, 0x7290c307), - TOBN(0x683c462e, 0x6669e72e), TOBN(0xf505be1e, 0x062559ac), - TOBN(0x5fbe3ea1, 0xe3a3035a), TOBN(0x6431ebf6, 0x9cd50da8), - TOBN(0xfd169d5c, 0x1f6407f2), TOBN(0x8d838a95, 0x60fce6b8), - TOBN(0x2a2bfa7f, 0x650006f0), TOBN(0xdfd7dad3, 0x50c0fbb2), - TOBN(0x92452495, 0xccf9ad96), TOBN(0x183bf494, 0xd95635f9), - TOBN(0x02d5df43, 0x4a7bd989), TOBN(0x505385cc, 0xa5431095), - TOBN(0xdd98e67d, 0xfd43f53e), TOBN(0xd61e1a6c, 0x500c34a9), - TOBN(0x5a4b46c6, 0x4a8a3d62), TOBN(0x8469c4d0, 0x247743d2), - TOBN(0x2bb3a13d, 0x88f7e433), TOBN(0x62b23a10, 0x01be5849), - TOBN(0xe83596b4, 0xa63d1a4c), TOBN(0x454e7fea, 0x7d183f3e), - TOBN(0x643fce61, 0x17afb01c), TOBN(0x4e65e5e6, 0x1c4c3638), - TOBN(0x41d85ea1, 0xef74c45b), TOBN(0x2cfbfa66, 0xae328506), - TOBN(0x98b078f5, 0x3ada7da9), TOBN(0xd985fe37, 0xec752fbb), - TOBN(0xeece68fe, 0x5a0148b4), TOBN(0x6f9a55c7, 0x2d78136d), - TOBN(0x232dccc4, 0xd2b729ce), TOBN(0xa27e0dfd, 0x90aafbc4), - TOBN(0x96474452, 0x12b4603e), TOBN(0xa876c551, 0x6b706d14), - TOBN(0xdf145fcf, 0x69a9d412), TOBN(0xe2ab75b7, 0x2d479c34), - TOBN(0x12df9a76, 0x1a23ff97), TOBN(0xc6138992, 0x5d359d10), - TOBN(0x6e51c7ae, 0xfa835f22), TOBN(0x69a79cb1, 0xc0fcc4d9), - TOBN(0xf57f350d, 0x594cc7e1), TOBN(0x3079ca63, 0x3350ab79), - TOBN(0x226fb614, 0x9aff594a), TOBN(0x35afec02, 0x6d59a62b), - TOBN(0x9bee46f4, 0x06ed2c6e), TOBN(0x58da1735, 0x7d939a57), - TOBN(0x44c50402, 0x8fd1797e), TOBN(0xd8853e7c, 0x5ccea6ca), - TOBN(0x4065508d, 0xa35fcd5f), TOBN(0x8965df8c, 0x495ccaeb), - TOBN(0x0f2da850, 0x12e1a962), TOBN(0xee471b94, 0xc1cf1cc4), - TOBN(0xcef19bc8, 0x0a08fb75), TOBN(0x704958f5, 0x81de3591), - TOBN(0x2867f8b2, 0x3aef4f88), TOBN(0x8d749384, 0xea9f9a5f), - TOBN(0x1b385537, 0x8c9049f4), TOBN(0x5be948f3, 0x7b92d8b6), - TOBN(0xd96f725d, 0xb6e2bd6b), TOBN(0x37a222bc, 0x958c454d), - TOBN(0xe7c61abb, 0x8809bf61), TOBN(0x46f07fbc, 0x1346f18d), - TOBN(0xfb567a7a, 0xe87c0d1c), TOBN(0x84a461c8, 0x7ef3d07a), - TOBN(0x0a5adce6, 0xd9278d98), TOBN(0x24d94813, 0x9dfc73e1), - TOBN(0x4f3528b6, 0x054321c3), TOBN(0x2e03fdde, 0x692ea706), - TOBN(0x10e60619, 0x47b533c0), TOBN(0x1a8bc73f, 0x2ca3c055), - TOBN(0xae58d4b2, 0x1bb62b8f), TOBN(0xb2045a73, 0x584a24e3), - TOBN(0x3ab3d5af, 0xbd76e195), TOBN(0x478dd1ad, 0x6938a810), - TOBN(0x6ffab393, 0x6ee3d5cb), TOBN(0xdfb693db, 0x22b361e4), - TOBN(0xf9694496, 0x51dbf1a7), TOBN(0xcab4b4ef, 0x08a2e762), - TOBN(0xe8c92f25, 0xd39bba9a), TOBN(0x850e61bc, 0xf1464d96), - TOBN(0xb7e830e3, 0xdc09508b), TOBN(0xfaf6d2cf, 0x74317655), - TOBN(0x72606ceb, 0xdf690355), TOBN(0x48bb92b3, 0xd0c3ded6), - TOBN(0x65b75484, 0x5c7cf892), TOBN(0xf6cd7ac9, 0xd5d5f01f), - TOBN(0xc2c30a59, 0x96401d69), TOBN(0x91268650, 0xed921878), - TOBN(0x380bf913, 0xb78c558f), TOBN(0x43c0baeb, 0xc8afdaa9), - TOBN(0x377f61d5, 0x54f169d3), TOBN(0xf8da07e3, 0xae5ff20b), - TOBN(0xb676c49d, 0xa8a90ea8), TOBN(0x81c1ff2b, 0x83a29b21), - TOBN(0x383297ac, 0x2ad8d276), TOBN(0x3001122f, 0xba89f982), - TOBN(0xe1d794be, 0x6718e448), TOBN(0x246c1482, 0x7c3e6e13), - TOBN(0x56646ef8, 0x5d26b5ef), TOBN(0x80f5091e, 0x88069cdd), - TOBN(0xc5992e2f, 0x724bdd38), TOBN(0x02e915b4, 0x8471e8c7), - TOBN(0x96ff320a, 0x0d0ff2a9), TOBN(0xbf886487, 0x4384d1a0), - TOBN(0xbbe1e6a6, 0xc93f72d6), TOBN(0xd5f75d12, 0xcad800ea), - TOBN(0xfa40a09f, 0xe7acf117), TOBN(0x32c8cdd5, 0x7581a355), - TOBN(0x74221992, 0x7023c499), TOBN(0xa8afe5d7, 0x38ec3901), - TOBN(0x5691afcb, 0xa90e83f0), TOBN(0x41bcaa03, 0x0b8f8eac), - TOBN(0xe38b5ff9, 0x8d2668d5), TOBN(0x0715281a, 0x7ad81965), - TOBN(0x1bc8fc7c, 0x03c6ce11), TOBN(0xcbbee6e2, 0x8b650436), - TOBN(0x06b00fe8, 0x0cdb9808), TOBN(0x17d6e066, 0xfe3ed315), - TOBN(0x2e9d38c6, 0x4d0b5018), TOBN(0xab8bfd56, 0x844dcaef), - TOBN(0x42894a59, 0x513aed8b), TOBN(0xf77f3b6d, 0x314bd07a), - TOBN(0xbbdecb8f, 0x8e42b582), TOBN(0xf10e2fa8, 0xd2390fe6), - TOBN(0xefb95022, 0x62a2f201), TOBN(0x4d59ea50, 0x50ee32b0), - TOBN(0xd87f7728, 0x6da789a8), TOBN(0xcf98a2cf, 0xf79492c4), - TOBN(0xf9577239, 0x720943c2), TOBN(0xba044cf5, 0x3990b9d0), - TOBN(0x5aa8e823, 0x95f2884a), TOBN(0x834de6ed, 0x0278a0af), - TOBN(0xc8e1ee9a, 0x5f25bd12), TOBN(0x9259ceaa, 0x6f7ab271), - TOBN(0x7e6d97a2, 0x77d00b76), TOBN(0x5c0c6eea, 0xa437832a), - TOBN(0x5232c20f, 0x5606b81d), TOBN(0xabd7b375, 0x0d991ee5), - TOBN(0x4d2bfe35, 0x8632d951), TOBN(0x78f85146, 0x98ed9364), - TOBN(0x951873f0, 0xf30c3282), TOBN(0x0da8ac80, 0xa789230b), - TOBN(0x3ac7789c, 0x5398967f), TOBN(0xa69b8f7f, 0xbdda0fb5), - TOBN(0xe5db7717, 0x6add8545), TOBN(0x1b71cb66, 0x72c49b66), - TOBN(0xd8560739, 0x68421d77), TOBN(0x03840fe8, 0x83e3afea), - TOBN(0xb391dad5, 0x1ec69977), TOBN(0xae243fb9, 0x307f6726), - TOBN(0xc88ac87b, 0xe8ca160c), TOBN(0x5174cced, 0x4ce355f4), - TOBN(0x98a35966, 0xe58ba37d), TOBN(0xfdcc8da2, 0x7817335d), - TOBN(0x5b752830, 0x83fbc7bf), TOBN(0x68e419d4, 0xd9c96984), - TOBN(0x409a39f4, 0x02a40380), TOBN(0x88940faf, 0x1fe977bc), - TOBN(0xc640a94b, 0x8f8edea6), TOBN(0x1e22cd17, 0xed11547d), - TOBN(0xe28568ce, 0x59ffc3e2), TOBN(0x60aa1b55, 0xc1dee4e7), - TOBN(0xc67497c8, 0x837cb363), TOBN(0x06fb438a, 0x105a2bf2), - TOBN(0x30357ec4, 0x500d8e20), TOBN(0x1ad9095d, 0x0670db10), - TOBN(0x7f589a05, 0xc73b7cfd), TOBN(0xf544607d, 0x880d6d28), - TOBN(0x17ba93b1, 0xa20ef103), TOBN(0xad859130, 0x6ba6577b), - TOBN(0x65c91cf6, 0x6fa214a0), TOBN(0xd7d49c6c, 0x27990da5), - TOBN(0xecd9ec8d, 0x20bb569d), TOBN(0xbd4b2502, 0xeeffbc33), - TOBN(0x2056ca5a, 0x6bed0467), TOBN(0x7916a1f7, 0x5b63728c), - TOBN(0xd4f9497d, 0x53a4f566), TOBN(0x89734664, 0x97b56810), - TOBN(0xf8e1da74, 0x0494a621), TOBN(0x82546a93, 0x8d011c68), - TOBN(0x1f3acb19, 0xc61ac162), TOBN(0x52f8fa9c, 0xabad0d3e), - TOBN(0x15356523, 0xb4b7ea43), TOBN(0x5a16ad61, 0xae608125), - TOBN(0xb0bcb87f, 0x4faed184), TOBN(0x5f236b1d, 0x5029f45f), - TOBN(0xd42c7607, 0x0bc6b1fc), TOBN(0xc644324e, 0x68aefce3), - TOBN(0x8e191d59, 0x5c5d8446), TOBN(0xc0208077, 0x13ae1979), - TOBN(0xadcaee55, 0x3ba59cc7), TOBN(0x20ed6d6b, 0xa2cb81ba), - TOBN(0x0952ba19, 0xb6efcffc), TOBN(0x60f12d68, 0x97c0b87c), - TOBN(0x4ee2c7c4, 0x9caa30bc), TOBN(0x767238b7, 0x97fbff4e), - TOBN(0xebc73921, 0x501b5d92), TOBN(0x3279e3df, 0xc2a37737), - TOBN(0x9fc12bc8, 0x6d197543), TOBN(0xfa94dc6f, 0x0a40db4e), - TOBN(0x7392b41a, 0x530ccbbd), TOBN(0x87c82146, 0xea823525), - TOBN(0xa52f984c, 0x05d98d0c), TOBN(0x2ae57d73, 0x5ef6974c), - TOBN(0x9377f7bf, 0x3042a6dd), TOBN(0xb1a007c0, 0x19647a64), - TOBN(0xfaa9079a, 0x0cca9767), TOBN(0x3d81a25b, 0xf68f72d5), - TOBN(0x752067f8, 0xff81578e), TOBN(0x78622150, 0x9045447d), - TOBN(0xc0c22fcf, 0x0505aa6f), TOBN(0x1030f0a6, 0x6bed1c77), - TOBN(0x31f29f15, 0x1f0bd739), TOBN(0x2d7989c7, 0xe6debe85), - TOBN(0x5c070e72, 0x8e677e98), TOBN(0x0a817bd3, 0x06e81fd5), - TOBN(0xc110d830, 0xb0f2ac95), TOBN(0x48d0995a, 0xab20e64e), - TOBN(0x0f3e00e1, 0x7729cd9a), TOBN(0x2a570c20, 0xdd556946), - TOBN(0x912dbcfd, 0x4e86214d), TOBN(0x2d014ee2, 0xcf615498), - TOBN(0x55e2b1e6, 0x3530d76e), TOBN(0xc5135ae4, 0xfd0fd6d1), - TOBN(0x0066273a, 0xd4f3049f), TOBN(0xbb8e9893, 0xe7087477), - TOBN(0x2dba1ddb, 0x14c6e5fd), TOBN(0xdba37886, 0x51f57e6c), - TOBN(0x5aaee0a6, 0x5a72f2cf), TOBN(0x1208bfbf, 0x7bea5642), - TOBN(0xf5c6aa3b, 0x67872c37), TOBN(0xd726e083, 0x43f93224), - TOBN(0x1854daa5, 0x061f1658), TOBN(0xc0016df1, 0xdf0cd2b3), - TOBN(0xc2a3f23e, 0x833d50de), TOBN(0x73b681d2, 0xbbbd3017), - TOBN(0x2f046dc4, 0x3ac343c0), TOBN(0x9c847e7d, 0x85716421), - TOBN(0xe1e13c91, 0x0917eed4), TOBN(0x3fc9eebd, 0x63a1b9c6), - TOBN(0x0f816a72, 0x7fe02299), TOBN(0x6335ccc2, 0x294f3319), - TOBN(0x3820179f, 0x4745c5be), TOBN(0xe647b782, 0x922f066e), - TOBN(0xc22e49de, 0x02cafb8a), TOBN(0x299bc2ff, 0xfcc2eccc), - TOBN(0x9a8feea2, 0x6e0e8282), TOBN(0xa627278b, 0xfe893205), - TOBN(0xa7e19733, 0x7933e47b), TOBN(0xf4ff6b13, 0x2e766402), - TOBN(0xa4d8be0a, 0x98440d9f), TOBN(0x658f5c2f, 0x38938808), - TOBN(0x90b75677, 0xc95b3b3e), TOBN(0xfa044269, 0x3137b6ff), - TOBN(0x077b039b, 0x43c47c29), TOBN(0xcca95dd3, 0x8a6445b2), - TOBN(0x0b498ba4, 0x2333fc4c), TOBN(0x274f8e68, 0xf736a1b1), - TOBN(0x6ca348fd, 0x5f1d4b2e), TOBN(0x24d3be78, 0xa8f10199), - TOBN(0x8535f858, 0xca14f530), TOBN(0xa6e7f163, 0x5b982e51), - TOBN(0x847c8512, 0x36e1bf62), TOBN(0xf6a7c58e, 0x03448418), - TOBN(0x583f3703, 0xf9374ab6), TOBN(0x864f9195, 0x6e564145), - TOBN(0x33bc3f48, 0x22526d50), TOBN(0x9f323c80, 0x1262a496), - TOBN(0xaa97a7ae, 0x3f046a9a), TOBN(0x70da183e, 0xdf8a039a), - TOBN(0x5b68f71c, 0x52aa0ba6), TOBN(0x9be0fe51, 0x21459c2d), - TOBN(0xc1e17eb6, 0xcbc613e5), TOBN(0x33131d55, 0x497ea61c), - TOBN(0x2f69d39e, 0xaf7eded5), TOBN(0x73c2f434, 0xde6af11b), - TOBN(0x4ca52493, 0xa4a375fa), TOBN(0x5f06787c, 0xb833c5c2), - TOBN(0x814e091f, 0x3e6e71cf), TOBN(0x76451f57, 0x8b746666)}, - {TOBN(0x80f9bdef, 0x694db7e0), TOBN(0xedca8787, 0xb9fcddc6), - TOBN(0x51981c34, 0x03b8dce1), TOBN(0x4274dcf1, 0x70e10ba1), - TOBN(0xf72743b8, 0x6def6d1a), TOBN(0xd25b1670, 0xebdb1866), - TOBN(0xc4491e8c, 0x050c6f58), TOBN(0x2be2b2ab, 0x87fbd7f5), - TOBN(0x3e0e5c9d, 0xd111f8ec), TOBN(0xbcc33f8d, 0xb7c4e760), - TOBN(0x702f9a91, 0xbd392a51), TOBN(0x7da4a795, 0xc132e92d), - TOBN(0x1a0b0ae3, 0x0bb1151b), TOBN(0x54febac8, 0x02e32251), - TOBN(0xea3a5082, 0x694e9e78), TOBN(0xe58ffec1, 0xe4fe40b8), - TOBN(0xf85592fc, 0xd1e0cf9e), TOBN(0xdea75f0d, 0xc0e7b2e8), - TOBN(0xc04215cf, 0xc135584e), TOBN(0x174fc727, 0x2f57092a), - TOBN(0xe7277877, 0xeb930bea), TOBN(0x504caccb, 0x5eb02a5a), - TOBN(0xf9fe08f7, 0xf5241b9b), TOBN(0xe7fb62f4, 0x8d5ca954), - TOBN(0xfbb8349d, 0x29c4120b), TOBN(0x9f94391f, 0xc0d0d915), - TOBN(0xc4074fa7, 0x5410ba51), TOBN(0xa66adbf6, 0x150a5911), - TOBN(0xc164543c, 0x34bfca38), TOBN(0xe0f27560, 0xb9e1ccfc), - TOBN(0x99da0f53, 0xe820219c), TOBN(0xe8234498, 0xc6b4997a), - TOBN(0xcfb88b76, 0x9d4c5423), TOBN(0x9e56eb10, 0xb0521c49), - TOBN(0x418e0b5e, 0xbe8700a1), TOBN(0x00cbaad6, 0xf93cb58a), - TOBN(0xe923fbde, 0xd92a5e67), TOBN(0xca4979ac, 0x1f347f11), - TOBN(0x89162d85, 0x6bc0585b), TOBN(0xdd6254af, 0xac3c70e3), - TOBN(0x7b23c513, 0x516e19e4), TOBN(0x56e2e847, 0xc5c4d593), - TOBN(0x9f727d73, 0x5ce71ef6), TOBN(0x5b6304a6, 0xf79a44c5), - TOBN(0x6638a736, 0x3ab7e433), TOBN(0x1adea470, 0xfe742f83), - TOBN(0xe054b854, 0x5b7fc19f), TOBN(0xf935381a, 0xba1d0698), - TOBN(0x546eab2d, 0x799e9a74), TOBN(0x96239e0e, 0xa949f729), - TOBN(0xca274c6b, 0x7090055a), TOBN(0x835142c3, 0x9020c9b0), - TOBN(0xa405667a, 0xa2e8807f), TOBN(0x29f2c085, 0x1aa3d39e), - TOBN(0xcc555d64, 0x42fc72f5), TOBN(0xe856e0e7, 0xfbeacb3c), - TOBN(0xb5504f9d, 0x918e4936), TOBN(0x65035ef6, 0xb2513982), - TOBN(0x0553a0c2, 0x6f4d9cb9), TOBN(0x6cb10d56, 0xbea85509), - TOBN(0x48d957b7, 0xa242da11), TOBN(0x16a4d3dd, 0x672b7268), - TOBN(0x3d7e637c, 0x8502a96b), TOBN(0x27c7032b, 0x730d463b), - TOBN(0xbdc02b18, 0xe4136a14), TOBN(0xbacf969d, 0x678e32bf), - TOBN(0xc98d89a3, 0xdd9c3c03), TOBN(0x7b92420a, 0x23becc4f), - TOBN(0xd4b41f78, 0xc64d565c), TOBN(0x9f969d00, 0x10f28295), - TOBN(0xec7f7f76, 0xb13d051a), TOBN(0x08945e1e, 0xa92da585), - TOBN(0x55366b7d, 0x5846426f), TOBN(0xe7d09e89, 0x247d441d), - TOBN(0x510b404d, 0x736fbf48), TOBN(0x7fa003d0, 0xe784bd7d), - TOBN(0x25f7614f, 0x17fd9596), TOBN(0x49e0e0a1, 0x35cb98db), - TOBN(0x2c65957b, 0x2e83a76a), TOBN(0x5d40da8d, 0xcddbe0f8), - TOBN(0xf2b8c405, 0x050bad24), TOBN(0x8918426d, 0xc2aa4823), - TOBN(0x2aeab3dd, 0xa38365a7), TOBN(0x72031717, 0x7c91b690), - TOBN(0x8b00d699, 0x60a94120), TOBN(0x478a255d, 0xe99eaeec), - TOBN(0xbf656a5f, 0x6f60aafd), TOBN(0xdfd7cb75, 0x5dee77b3), - TOBN(0x37f68bb4, 0xa595939d), TOBN(0x03556479, 0x28740217), - TOBN(0x8e740e7c, 0x84ad7612), TOBN(0xd89bc843, 0x9044695f), - TOBN(0xf7f3da5d, 0x85a9184d), TOBN(0x562563bb, 0x9fc0b074), - TOBN(0x06d2e6aa, 0xf88a888e), TOBN(0x612d8643, 0x161fbe7c), - TOBN(0x465edba7, 0xf64085e7), TOBN(0xb230f304, 0x29aa8511), - TOBN(0x53388426, 0xcda2d188), TOBN(0x90885735, 0x4b666649), - TOBN(0x6f02ff9a, 0x652f54f6), TOBN(0x65c82294, 0x5fae2bf0), - TOBN(0x7816ade0, 0x62f5eee3), TOBN(0xdcdbdf43, 0xfcc56d70), - TOBN(0x9fb3bba3, 0x54530bb2), TOBN(0xbde3ef77, 0xcb0869ea), - TOBN(0x89bc9046, 0x0b431163), TOBN(0x4d03d7d2, 0xe4819a35), - TOBN(0x33ae4f9e, 0x43b6a782), TOBN(0x216db307, 0x9c88a686), - TOBN(0x91dd88e0, 0x00ffedd9), TOBN(0xb280da9f, 0x12bd4840), - TOBN(0x32a7cb8a, 0x1635e741), TOBN(0xfe14008a, 0x78be02a7), - TOBN(0x3fafb334, 0x1b7ae030), TOBN(0x7fd508e7, 0x5add0ce9), - TOBN(0x72c83219, 0xd607ad51), TOBN(0x0f229c0a, 0x8d40964a), - TOBN(0x1be2c336, 0x1c878da2), TOBN(0xe0c96742, 0xeab2ab86), - TOBN(0x458f8691, 0x3e538cd7), TOBN(0xa7001f6c, 0x8e08ad53), - TOBN(0x52b8c6e6, 0xbf5d15ff), TOBN(0x548234a4, 0x011215dd), - TOBN(0xff5a9d2d, 0x3d5b4045), TOBN(0xb0ffeeb6, 0x4a904190), - TOBN(0x55a3aca4, 0x48607f8b), TOBN(0x8cbd665c, 0x30a0672a), - TOBN(0x87f834e0, 0x42583068), TOBN(0x02da2aeb, 0xf3f6e683), - TOBN(0x6b763e5d, 0x05c12248), TOBN(0x7230378f, 0x65a8aefc), - TOBN(0x93bd80b5, 0x71e8e5ca), TOBN(0x53ab041c, 0xb3b62524), - TOBN(0x1b860513, 0x6c9c552e), TOBN(0xe84d402c, 0xd5524e66), - TOBN(0xa37f3573, 0xf37f5937), TOBN(0xeb0f6c7d, 0xd1e4fca5), - TOBN(0x2965a554, 0xac8ab0fc), TOBN(0x17fbf56c, 0x274676ac), - TOBN(0x2e2f6bd9, 0xacf7d720), TOBN(0x41fc8f88, 0x10224766), - TOBN(0x517a14b3, 0x85d53bef), TOBN(0xdae327a5, 0x7d76a7d1), - TOBN(0x6ad0a065, 0xc4818267), TOBN(0x33aa189b, 0x37c1bbc1), - TOBN(0x64970b52, 0x27392a92), TOBN(0x21699a1c, 0x2d1535ea), - TOBN(0xcd20779c, 0xc2d7a7fd), TOBN(0xe3186059, 0x99c83cf2), - TOBN(0x9b69440b, 0x72c0b8c7), TOBN(0xa81497d7, 0x7b9e0e4d), - TOBN(0x515d5c89, 0x1f5f82dc), TOBN(0x9a7f67d7, 0x6361079e), - TOBN(0xa8da81e3, 0x11a35330), TOBN(0xe44990c4, 0x4b18be1b), - TOBN(0xc7d5ed95, 0xaf103e59), TOBN(0xece8aba7, 0x8dac9261), - TOBN(0xbe82b099, 0x9394b8d3), TOBN(0x6830f09a, 0x16adfe83), - TOBN(0x250a29b4, 0x88172d01), TOBN(0x8b20bd65, 0xcaff9e02), - TOBN(0xb8a7661e, 0xe8a6329a), TOBN(0x4520304d, 0xd3fce920), - TOBN(0xae45da1f, 0x2b47f7ef), TOBN(0xe07f5288, 0x5bffc540), - TOBN(0xf7997009, 0x3464f874), TOBN(0x2244c2cd, 0xa6fa1f38), - TOBN(0x43c41ac1, 0x94d7d9b1), TOBN(0x5bafdd82, 0xc82e7f17), - TOBN(0xdf0614c1, 0x5fda0fca), TOBN(0x74b043a7, 0xa8ae37ad), - TOBN(0x3ba6afa1, 0x9e71734c), TOBN(0x15d5437e, 0x9c450f2e), - TOBN(0x4a5883fe, 0x67e242b1), TOBN(0x5143bdc2, 0x2c1953c2), - TOBN(0x542b8b53, 0xfc5e8920), TOBN(0x363bf9a8, 0x9a9cee08), - TOBN(0x02375f10, 0xc3486e08), TOBN(0x2037543b, 0x8c5e70d2), - TOBN(0x7109bccc, 0x625640b4), TOBN(0xcbc1051e, 0x8bc62c3b), - TOBN(0xf8455fed, 0x803f26ea), TOBN(0x6badceab, 0xeb372424), - TOBN(0xa2a9ce7c, 0x6b53f5f9), TOBN(0x64246595, 0x1b176d99), - TOBN(0xb1298d36, 0xb95c081b), TOBN(0x53505bb8, 0x1d9a9ee6), - TOBN(0x3f6f9e61, 0xf2ba70b0), TOBN(0xd07e16c9, 0x8afad453), - TOBN(0x9f1694bb, 0xe7eb4a6a), TOBN(0xdfebced9, 0x3cb0bc8e), - TOBN(0x92d3dcdc, 0x53868c8b), TOBN(0x174311a2, 0x386107a6), - TOBN(0x4109e07c, 0x689b4e64), TOBN(0x30e4587f, 0x2df3dcb6), - TOBN(0x841aea31, 0x0811b3b2), TOBN(0x6144d41d, 0x0cce43ea), - TOBN(0x464c4581, 0x2a9a7803), TOBN(0xd03d371f, 0x3e158930), - TOBN(0xc676d7f2, 0xb1f3390b), TOBN(0x9f7a1b8c, 0xa5b61272), - TOBN(0x4ebebfc9, 0xc2e127a9), TOBN(0x4602500c, 0x5dd997bf), - TOBN(0x7f09771c, 0x4711230f), TOBN(0x058eb37c, 0x020f09c1), - TOBN(0xab693d4b, 0xfee5e38b), TOBN(0x9289eb1f, 0x4653cbc0), - TOBN(0xbecf46ab, 0xd51b9cf5), TOBN(0xd2aa9c02, 0x9f0121af), - TOBN(0x36aaf7d2, 0xe90dc274), TOBN(0x909e4ea0, 0x48b95a3c), - TOBN(0xe6b70496, 0x6f32dbdb), TOBN(0x672188a0, 0x8b030b3e), - TOBN(0xeeffe5b3, 0xcfb617e2), TOBN(0x87e947de, 0x7c82709e), - TOBN(0xa44d2b39, 0x1770f5a7), TOBN(0xe4d4d791, 0x0e44eb82), - TOBN(0x42e69d1e, 0x3f69712a), TOBN(0xbf11c4d6, 0xac6a820e), - TOBN(0xb5e7f3e5, 0x42c4224c), TOBN(0xd6b4e81c, 0x449d941c), - TOBN(0x5d72bd16, 0x5450e878), TOBN(0x6a61e28a, 0xee25ac54), - TOBN(0x33272094, 0xe6f1cd95), TOBN(0x7512f30d, 0x0d18673f), - TOBN(0x32f7a4ca, 0x5afc1464), TOBN(0x2f095656, 0x6bbb977b), - TOBN(0x586f47ca, 0xa8226200), TOBN(0x02c868ad, 0x1ac07369), - TOBN(0x4ef2b845, 0xc613acbe), TOBN(0x43d7563e, 0x0386054c), - TOBN(0x54da9dc7, 0xab952578), TOBN(0xb5423df2, 0x26e84d0b), - TOBN(0xa8b64eeb, 0x9b872042), TOBN(0xac205782, 0x5990f6df), - TOBN(0x4ff696eb, 0x21f4c77a), TOBN(0x1a79c3e4, 0xaab273af), - TOBN(0x29bc922e, 0x9436b3f1), TOBN(0xff807ef8, 0xd6d9a27a), - TOBN(0x82acea3d, 0x778f22a0), TOBN(0xfb10b2e8, 0x5b5e7469), - TOBN(0xc0b16980, 0x2818ee7d), TOBN(0x011afff4, 0xc91c1a2f), - TOBN(0x95a6d126, 0xad124418), TOBN(0x31c081a5, 0xe72e295f), - TOBN(0x36bb283a, 0xf2f4db75), TOBN(0xd115540f, 0x7acef462), - TOBN(0xc7f3a8f8, 0x33f6746c), TOBN(0x21e46f65, 0xfea990ca), - TOBN(0x915fd5c5, 0xcaddb0a9), TOBN(0xbd41f016, 0x78614555), - TOBN(0x346f4434, 0x426ffb58), TOBN(0x80559436, 0x14dbc204), - TOBN(0xf3dd20fe, 0x5a969b7f), TOBN(0x9d59e956, 0xe899a39a), - TOBN(0xf1b0971c, 0x8ad4cf4b), TOBN(0x03448860, 0x2ffb8fb8), - TOBN(0xf071ac3c, 0x65340ba4), TOBN(0x408d0596, 0xb27fd758), - TOBN(0xe7c78ea4, 0x98c364b0), TOBN(0xa4aac4a5, 0x051e8ab5), - TOBN(0xb9e1d560, 0x485d9002), TOBN(0x9acd518a, 0x88844455), - TOBN(0xe4ca688f, 0xd06f56c0), TOBN(0xa48af70d, 0xdf027972), - TOBN(0x691f0f04, 0x5e9a609d), TOBN(0xa9dd82cd, 0xee61270e), - TOBN(0x8903ca63, 0xa0ef18d3), TOBN(0x9fb7ee35, 0x3d6ca3bd), - TOBN(0xa7b4a09c, 0xabf47d03), TOBN(0x4cdada01, 0x1c67de8e), - TOBN(0x52003749, 0x9355a244), TOBN(0xe77fd2b6, 0x4f2151a9), - TOBN(0x695d6cf6, 0x66b4efcb), TOBN(0xc5a0cacf, 0xda2cfe25), - TOBN(0x104efe5c, 0xef811865), TOBN(0xf52813e8, 0x9ea5cc3d), - TOBN(0x855683dc, 0x40b58dbc), TOBN(0x0338ecde, 0x175fcb11), - TOBN(0xf9a05637, 0x74921592), TOBN(0xb4f1261d, 0xb9bb9d31), - TOBN(0x551429b7, 0x4e9c5459), TOBN(0xbe182e6f, 0x6ea71f53), - TOBN(0xd3a3b07c, 0xdfc50573), TOBN(0x9ba1afda, 0x62be8d44), - TOBN(0x9bcfd2cb, 0x52ab65d3), TOBN(0xdf11d547, 0xa9571802), - TOBN(0x099403ee, 0x02a2404a), TOBN(0x497406f4, 0x21088a71), - TOBN(0x99479409, 0x5004ae71), TOBN(0xbdb42078, 0xa812c362), - TOBN(0x2b72a30f, 0xd8828442), TOBN(0x283add27, 0xfcb5ed1c), - TOBN(0xf7c0e200, 0x66a40015), TOBN(0x3e3be641, 0x08b295ef), - TOBN(0xac127dc1, 0xe038a675), TOBN(0x729deff3, 0x8c5c6320), - TOBN(0xb7df8fd4, 0xa90d2c53), TOBN(0x9b74b0ec, 0x681e7cd3), - TOBN(0x5cb5a623, 0xdab407e5), TOBN(0xcdbd3615, 0x76b340c6), - TOBN(0xa184415a, 0x7d28392c), TOBN(0xc184c1d8, 0xe96f7830), - TOBN(0xc3204f19, 0x81d3a80f), TOBN(0xfde0c841, 0xc8e02432), - TOBN(0x78203b3e, 0x8149e0c1), TOBN(0x5904bdbb, 0x08053a73), - TOBN(0x30fc1dd1, 0x101b6805), TOBN(0x43c223bc, 0x49aa6d49), - TOBN(0x9ed67141, 0x7a174087), TOBN(0x311469a0, 0xd5997008), - TOBN(0xb189b684, 0x5e43fc61), TOBN(0xf3282375, 0xe0d3ab57), - TOBN(0x4fa34b67, 0xb1181da8), TOBN(0x621ed0b2, 0x99ee52b8), - TOBN(0x9b178de1, 0xad990676), TOBN(0xd51de67b, 0x56d54065), - TOBN(0x2a2c27c4, 0x7538c201), TOBN(0x33856ec8, 0x38a40f5c), - TOBN(0x2522fc15, 0xbe6cdcde), TOBN(0x1e603f33, 0x9f0c6f89), - TOBN(0x7994edc3, 0x103e30a6), TOBN(0x033a00db, 0x220c853e), - TOBN(0xd3cfa409, 0xf7bb7fd7), TOBN(0x70f8781e, 0x462d18f6), - TOBN(0xbbd82980, 0x687fe295), TOBN(0x6eef4c32, 0x595669f3), - TOBN(0x86a9303b, 0x2f7e85c3), TOBN(0x5fce4621, 0x71988f9b), - TOBN(0x5b935bf6, 0xc138acb5), TOBN(0x30ea7d67, 0x25661212), - TOBN(0xef1eb5f4, 0xe51ab9a2), TOBN(0x0587c98a, 0xae067c78), - TOBN(0xb3ce1b3c, 0x77ca9ca6), TOBN(0x2a553d4d, 0x54b5f057), - TOBN(0xc7898236, 0x4da29ec2), TOBN(0xdbdd5d13, 0xb9c57316), - TOBN(0xc57d6e6b, 0x2cd80d47), TOBN(0x80b460cf, 0xfe9e7391), - TOBN(0x98648cab, 0xf963c31e), TOBN(0x67f9f633, 0xcc4d32fd), - TOBN(0x0af42a9d, 0xfdf7c687), TOBN(0x55f292a3, 0x0b015ea7), - TOBN(0x89e468b2, 0xcd21ab3d), TOBN(0xe504f022, 0xc393d392), - TOBN(0xab21e1d4, 0xa5013af9), TOBN(0xe3283f78, 0xc2c28acb), - TOBN(0xf38b35f6, 0x226bf99f), TOBN(0xe8354274, 0x0e291e69), - TOBN(0x61673a15, 0xb20c162d), TOBN(0xc101dc75, 0xb04fbdbe), - TOBN(0x8323b4c2, 0x255bd617), TOBN(0x6c969693, 0x6c2a9154), - TOBN(0xc6e65860, 0x62679387), TOBN(0x8e01db0c, 0xb8c88e23), - TOBN(0x33c42873, 0x893a5559), TOBN(0x7630f04b, 0x47a3e149), - TOBN(0xb5d80805, 0xddcf35f8), TOBN(0x582ca080, 0x77dfe732), - TOBN(0x2c7156e1, 0x0b1894a0), TOBN(0x92034001, 0xd81c68c0), - TOBN(0xed225d00, 0xc8b115b5), TOBN(0x237f9c22, 0x83b907f2), - TOBN(0x0ea2f32f, 0x4470e2c0), TOBN(0xb725f7c1, 0x58be4e95), - TOBN(0x0f1dcafa, 0xb1ae5463), TOBN(0x59ed5187, 0x1ba2fc04), - TOBN(0xf6e0f316, 0xd0115d4d), TOBN(0x5180b12f, 0xd3691599), - TOBN(0x157e32c9, 0x527f0a41), TOBN(0x7b0b081d, 0xa8e0ecc0), - TOBN(0x6dbaaa8a, 0xbf4f0dd0), TOBN(0x99b289c7, 0x4d252696), - TOBN(0x79b7755e, 0xdbf864fe), TOBN(0x6974e2b1, 0x76cad3ab), - TOBN(0x35dbbee2, 0x06ddd657), TOBN(0xe7cbdd11, 0x2ff3a96d), - TOBN(0x88381968, 0x076be758), TOBN(0x2d737e72, 0x08c91f5d), - TOBN(0x5f83ab62, 0x86ec3776), TOBN(0x98aa649d, 0x945fa7a1), - TOBN(0xf477ec37, 0x72ef0933), TOBN(0x66f52b1e, 0x098c17b1), - TOBN(0x9eec58fb, 0xd803738b), TOBN(0x91aaade7, 0xe4e86aa4), - TOBN(0x6b1ae617, 0xa5b51492), TOBN(0x63272121, 0xbbc45974), - TOBN(0x7e0e28f0, 0x862c5129), TOBN(0x0a8f79a9, 0x3321a4a0), - TOBN(0xe26d1664, 0x5041c88f), TOBN(0x0571b805, 0x53233e3a), - TOBN(0xd1b0ccde, 0xc9520711), TOBN(0x55a9e4ed, 0x3c8b84bf), - TOBN(0x9426bd39, 0xa1fef314), TOBN(0x4f5f638e, 0x6eb93f2b), - TOBN(0xba2a1ed3, 0x2bf9341b), TOBN(0xd63c1321, 0x4d42d5a9), - TOBN(0xd2964a89, 0x316dc7c5), TOBN(0xd1759606, 0xca511851), - TOBN(0xd8a9201f, 0xf9e6ed35), TOBN(0xb7b5ee45, 0x6736925a), - TOBN(0x0a83fbbc, 0x99581af7), TOBN(0x3076bc40, 0x64eeb051), - TOBN(0x5511c98c, 0x02dec312), TOBN(0x270de898, 0x238dcb78), - TOBN(0x2cf4cf9c, 0x539c08c9), TOBN(0xa70cb65e, 0x38d3b06e), - TOBN(0xb12ec10e, 0xcfe57bbd), TOBN(0x82c7b656, 0x35a0c2b5), - TOBN(0xddc7d5cd, 0x161c67bd), TOBN(0xe32e8985, 0xae3a32cc), - TOBN(0x7aba9444, 0xd11a5529), TOBN(0xe964ed02, 0x2427fa1a), - TOBN(0x1528392d, 0x24a1770a), TOBN(0xa152ce2c, 0x12c72fcd), - TOBN(0x714553a4, 0x8ec07649), TOBN(0x18b4c290, 0x459dd453), - TOBN(0xea32b714, 0x7b64b110), TOBN(0xb871bfa5, 0x2e6f07a2), - TOBN(0xb67112e5, 0x9e2e3c9b), TOBN(0xfbf250e5, 0x44aa90f6), - TOBN(0xf77aedb8, 0xbd539006), TOBN(0x3b0cdf9a, 0xd172a66f), - TOBN(0xedf69fea, 0xf8c51187), TOBN(0x05bb67ec, 0x741e4da7), - TOBN(0x47df0f32, 0x08114345), TOBN(0x56facb07, 0xbb9792b1), - TOBN(0xf3e007e9, 0x8f6229e4), TOBN(0x62d103f4, 0x526fba0f), - TOBN(0x4f33bef7, 0xb0339d79), TOBN(0x9841357b, 0xb59bfec1), - TOBN(0xfa8dbb59, 0xc34e6705), TOBN(0xc3c7180b, 0x7fdaa84c), - TOBN(0xf95872fc, 0xa4108537), TOBN(0x8750cc3b, 0x932a3e5a), - TOBN(0xb61cc69d, 0xb7275d7d), TOBN(0xffa0168b, 0x2e59b2e9), - TOBN(0xca032abc, 0x6ecbb493), TOBN(0x1d86dbd3, 0x2c9082d8), - TOBN(0xae1e0b67, 0xe28ef5ba), TOBN(0x2c9a4699, 0xcb18e169), - TOBN(0x0ecd0e33, 0x1e6bbd20), TOBN(0x571b360e, 0xaf5e81d2), - TOBN(0xcd9fea58, 0x101c1d45), TOBN(0x6651788e, 0x18880452), - TOBN(0xa9972635, 0x1f8dd446), TOBN(0x44bed022, 0xe37281d0), - TOBN(0x094b2b2d, 0x33da525d), TOBN(0xf193678e, 0x13144fd8), - TOBN(0xb8ab5ba4, 0xf4c1061d), TOBN(0x4343b5fa, 0xdccbe0f4), - TOBN(0xa8702371, 0x63812713), TOBN(0x47bf6d2d, 0xf7611d93), - TOBN(0x46729b8c, 0xbd21e1d7), TOBN(0x7484d4e0, 0xd629e77d), - TOBN(0x830e6eea, 0x60dbac1f), TOBN(0x23d8c484, 0xda06a2f7), - TOBN(0x896714b0, 0x50ca535b), TOBN(0xdc8d3644, 0xebd97a9b), - TOBN(0x106ef9fa, 0xb12177b4), TOBN(0xf79bf464, 0x534d5d9c), - TOBN(0x2537a349, 0xa6ab360b), TOBN(0xc7c54253, 0xa00c744f), - TOBN(0xb3c7a047, 0xe5911a76), TOBN(0x61ffa5c8, 0x647f1ee7), - TOBN(0x15aed36f, 0x8f56ab42), TOBN(0x6a0d41b0, 0xa3ff9ac9), - TOBN(0x68f469f5, 0xcc30d357), TOBN(0xbe9adf81, 0x6b72be96), - TOBN(0x1cd926fe, 0x903ad461), TOBN(0x7e89e38f, 0xcaca441b), - TOBN(0xf0f82de5, 0xfacf69d4), TOBN(0x363b7e76, 0x4775344c), - TOBN(0x6894f312, 0xb2e36d04), TOBN(0x3c6cb4fe, 0x11d1c9a5), - TOBN(0x85d9c339, 0x4008e1f2), TOBN(0x5e9a85ea, 0x249f326c), - TOBN(0xdc35c60a, 0x678c5e06), TOBN(0xc08b944f, 0x9f86fba9), - TOBN(0xde40c02c, 0x89f71f0f), TOBN(0xad8f3e31, 0xff3da3c0), - TOBN(0x3ea5096b, 0x42125ded), TOBN(0x13879cbf, 0xa7379183), - TOBN(0x6f4714a5, 0x6b306a0b), TOBN(0x359c2ea6, 0x67646c5e), - TOBN(0xfacf8943, 0x07726368), TOBN(0x07a58935, 0x65ff431e), - TOBN(0x24d661d1, 0x68754ab0), TOBN(0x801fce1d, 0x6f429a76), - TOBN(0xc068a85f, 0xa58ce769), TOBN(0xedc35c54, 0x5d5eca2b), - TOBN(0xea31276f, 0xa3f660d1), TOBN(0xa0184ebe, 0xb8fc7167), - TOBN(0x0f20f21a, 0x1d8db0ae), TOBN(0xd96d095f, 0x56c35e12), - TOBN(0xedf402b5, 0xf8c2a25b), TOBN(0x1bb772b9, 0x059204b6), - TOBN(0x50cbeae2, 0x19b4e34c), TOBN(0x93109d80, 0x3fa0845a), - TOBN(0x54f7ccf7, 0x8ef59fb5), TOBN(0x3b438fe2, 0x88070963), - TOBN(0x9e28c659, 0x31f3ba9b), TOBN(0x9cc31b46, 0xead9da92), - TOBN(0x3c2f0ba9, 0xb733aa5f), TOBN(0xdece47cb, 0xf05af235), - TOBN(0xf8e3f715, 0xa2ac82a5), TOBN(0xc97ba641, 0x2203f18a), - TOBN(0xc3af5504, 0x09c11060), TOBN(0x56ea2c05, 0x46af512d), - TOBN(0xfac28daf, 0xf3f28146), TOBN(0x87fab43a, 0x959ef494)}, - {TOBN(0x09891641, 0xd4c5105f), TOBN(0x1ae80f8e, 0x6d7fbd65), - TOBN(0x9d67225f, 0xbee6bdb0), TOBN(0x3b433b59, 0x7fc4d860), - TOBN(0x44e66db6, 0x93e85638), TOBN(0xf7b59252, 0xe3e9862f), - TOBN(0xdb785157, 0x665c32ec), TOBN(0x702fefd7, 0xae362f50), - TOBN(0x3754475d, 0x0fefb0c3), TOBN(0xd48fb56b, 0x46d7c35d), - TOBN(0xa070b633, 0x363798a4), TOBN(0xae89f3d2, 0x8fdb98e6), - TOBN(0x970b89c8, 0x6363d14c), TOBN(0x89817521, 0x67abd27d), - TOBN(0x9bf7d474, 0x44d5a021), TOBN(0xb3083baf, 0xcac72aee), - TOBN(0x389741de, 0xbe949a44), TOBN(0x638e9388, 0x546a4fa5), - TOBN(0x3fe6419c, 0xa0047bdc), TOBN(0x7047f648, 0xaaea57ca), - TOBN(0x54e48a90, 0x41fbab17), TOBN(0xda8e0b28, 0x576bdba2), - TOBN(0xe807eebc, 0xc72afddc), TOBN(0x07d3336d, 0xf42577bf), - TOBN(0x62a8c244, 0xbfe20925), TOBN(0x91c19ac3, 0x8fdce867), - TOBN(0x5a96a5d5, 0xdd387063), TOBN(0x61d587d4, 0x21d324f6), - TOBN(0xe87673a2, 0xa37173ea), TOBN(0x23848008, 0x53778b65), - TOBN(0x10f8441e, 0x05bab43e), TOBN(0xfa11fe12, 0x4621efbe), - TOBN(0x047b772e, 0x81685d7b), TOBN(0x23f27d81, 0xbf34a976), - TOBN(0xc27608e2, 0x915f48ef), TOBN(0x3b0b43fa, 0xa521d5c3), - TOBN(0x7613fb26, 0x63ca7284), TOBN(0x7f5729b4, 0x1d4db837), - TOBN(0x87b14898, 0x583b526b), TOBN(0x00b732a6, 0xbbadd3d1), - TOBN(0x8e02f426, 0x2048e396), TOBN(0x436b50b6, 0x383d9de4), - TOBN(0xf78d3481, 0x471e85ad), TOBN(0x8b01ea6a, 0xd005c8d6), - TOBN(0xd3c7afee, 0x97015c07), TOBN(0x46cdf1a9, 0x4e3ba2ae), - TOBN(0x7a42e501, 0x83d3a1d2), TOBN(0xd54b5268, 0xb541dff4), - TOBN(0x3f24cf30, 0x4e23e9bc), TOBN(0x4387f816, 0x126e3624), - TOBN(0x26a46a03, 0x3b0b6d61), TOBN(0xaf1bc845, 0x8b2d777c), - TOBN(0x25c401ba, 0x527de79c), TOBN(0x0e1346d4, 0x4261bbb6), - TOBN(0x4b96c44b, 0x287b4bc7), TOBN(0x658493c7, 0x5254562f), - TOBN(0x23f949fe, 0xb8a24a20), TOBN(0x17ebfed1, 0xf52ca53f), - TOBN(0x9b691bbe, 0xbcfb4853), TOBN(0x5617ff6b, 0x6278a05d), - TOBN(0x241b34c5, 0xe3c99ebd), TOBN(0xfc64242e, 0x1784156a), - TOBN(0x4206482f, 0x695d67df), TOBN(0xb967ce0e, 0xee27c011), - TOBN(0x65db3751, 0x21c80b5d), TOBN(0x2e7a563c, 0xa31ecca0), - TOBN(0xe56ffc4e, 0x5238a07e), TOBN(0x3d6c2966, 0x32ced854), - TOBN(0xe99d7d1a, 0xaf70b885), TOBN(0xafc3bad9, 0x2d686459), - TOBN(0x9c78bf46, 0x0cc8ba5b), TOBN(0x5a439519, 0x18955aa3), - TOBN(0xf8b517a8, 0x5fe4e314), TOBN(0xe60234d0, 0xfcb8906f), - TOBN(0xffe542ac, 0xf2061b23), TOBN(0x287e191f, 0x6b4cb59c), - TOBN(0x21857ddc, 0x09d877d8), TOBN(0x1c23478c, 0x14678941), - TOBN(0xbbf0c056, 0xb6e05ea4), TOBN(0x82da4b53, 0xb01594fe), - TOBN(0xf7526791, 0xfadb8608), TOBN(0x049e832d, 0x7b74cdf6), - TOBN(0xa43581cc, 0xc2b90a34), TOBN(0x73639eb8, 0x9360b10c), - TOBN(0x4fba331f, 0xe1e4a71b), TOBN(0x6ffd6b93, 0x8072f919), - TOBN(0x6e53271c, 0x65679032), TOBN(0x67206444, 0xf14272ce), - TOBN(0xc0f734a3, 0xb2335834), TOBN(0x9526205a, 0x90ef6860), - TOBN(0xcb8be717, 0x04e2bb0d), TOBN(0x2418871e, 0x02f383fa), - TOBN(0xd7177681, 0x4082c157), TOBN(0xcc914ad0, 0x29c20073), - TOBN(0xf186c1eb, 0xe587e728), TOBN(0x6fdb3c22, 0x61bcd5fd), - TOBN(0x30d014a6, 0xf2f9f8e9), TOBN(0x963ece23, 0x4fec49d2), - TOBN(0x862025c5, 0x9605a8d9), TOBN(0x39874445, 0x19f8929a), - TOBN(0x01b6ff65, 0x12bf476a), TOBN(0x598a64d8, 0x09cf7d91), - TOBN(0xd7ec7749, 0x93be56ca), TOBN(0x10899785, 0xcbb33615), - TOBN(0xb8a092fd, 0x02eee3ad), TOBN(0xa86b3d35, 0x30145270), - TOBN(0x323d98c6, 0x8512b675), TOBN(0x4b8bc785, 0x62ebb40f), - TOBN(0x7d301f54, 0x413f9cde), TOBN(0xa5e4fb4f, 0x2bab5664), - TOBN(0x1d2b252d, 0x1cbfec23), TOBN(0xfcd576bb, 0xe177120d), - TOBN(0x04427d3e, 0x83731a34), TOBN(0x2bb9028e, 0xed836e8e), - TOBN(0xb36acff8, 0xb612ca7c), TOBN(0xb88fe5ef, 0xd3d9c73a), - TOBN(0xbe2a6bc6, 0xedea4eb3), TOBN(0x43b93133, 0x488eec77), - TOBN(0xf41ff566, 0xb17106e1), TOBN(0x469e9172, 0x654efa32), - TOBN(0xb4480f04, 0x41c23fa3), TOBN(0xb4712eb0, 0xc1989a2e), - TOBN(0x3ccbba0f, 0x93a29ca7), TOBN(0x6e205c14, 0xd619428c), - TOBN(0x90db7957, 0xb3641686), TOBN(0x0432691d, 0x45ac8b4e), - TOBN(0x07a759ac, 0xf64e0350), TOBN(0x0514d89c, 0x9c972517), - TOBN(0x1701147f, 0xa8e67fc3), TOBN(0x9e2e0b8b, 0xab2085be), - TOBN(0xd5651824, 0xac284e57), TOBN(0x890d4325, 0x74893664), - TOBN(0x8a7c5e6e, 0xc55e68a3), TOBN(0xbf12e90b, 0x4339c85a), - TOBN(0x31846b85, 0xf922b655), TOBN(0x9a54ce4d, 0x0bf4d700), - TOBN(0xd7f4e83a, 0xf1a14295), TOBN(0x916f955c, 0xb285d4f9), - TOBN(0xe57bb0e0, 0x99ffdaba), TOBN(0x28a43034, 0xeab0d152), - TOBN(0x0a36ffa2, 0xb8a9cef8), TOBN(0x5517407e, 0xb9ec051a), - TOBN(0x9c796096, 0xea68e672), TOBN(0x853db5fb, 0xfb3c77fb), - TOBN(0x21474ba9, 0xe864a51a), TOBN(0x6c267699, 0x6e8a1b8b), - TOBN(0x7c823626, 0x94120a28), TOBN(0xe61e9a48, 0x8383a5db), - TOBN(0x7dd75003, 0x9f84216d), TOBN(0xab020d07, 0xad43cd85), - TOBN(0x9437ae48, 0xda12c659), TOBN(0x6449c2eb, 0xe65452ad), - TOBN(0xcc7c4c1c, 0x2cf9d7c1), TOBN(0x1320886a, 0xee95e5ab), - TOBN(0xbb7b9056, 0xbeae170c), TOBN(0xc8a5b250, 0xdbc0d662), - TOBN(0x4ed81432, 0xc11d2303), TOBN(0x7da66912, 0x1f03769f), - TOBN(0x3ac7a5fd, 0x84539828), TOBN(0x14dada94, 0x3bccdd02), - TOBN(0x8b84c321, 0x7ef6b0d1), TOBN(0x52a9477a, 0x7c933f22), - TOBN(0x5ef6728a, 0xfd440b82), TOBN(0x5c3bd859, 0x6ce4bd5e), - TOBN(0x918b80f5, 0xf22c2d3e), TOBN(0x368d5040, 0xb7bb6cc5), - TOBN(0xb66142a1, 0x2695a11c), TOBN(0x60ac583a, 0xeb19ea70), - TOBN(0x317cbb98, 0x0eab2437), TOBN(0x8cc08c55, 0x5e2654c8), - TOBN(0xfe2d6520, 0xe6d8307f), TOBN(0xe9f147f3, 0x57428993), - TOBN(0x5f9c7d14, 0xd2fd6cf1), TOBN(0xa3ecd064, 0x2d4fcbb0), - TOBN(0xad83fef0, 0x8e7341f7), TOBN(0x643f23a0, 0x3a63115c), - TOBN(0xd38a78ab, 0xe65ab743), TOBN(0xbf7c75b1, 0x35edc89c), - TOBN(0x3dd8752e, 0x530df568), TOBN(0xf85c4a76, 0xe308c682), - TOBN(0x4c9955b2, 0xe68acf37), TOBN(0xa544df3d, 0xab32af85), - TOBN(0x4b8ec3f5, 0xa25cf493), TOBN(0x4d8f2764, 0x1a622feb), - TOBN(0x7bb4f7aa, 0xf0dcbc49), TOBN(0x7de551f9, 0x70bbb45b), - TOBN(0xcfd0f3e4, 0x9f2ca2e5), TOBN(0xece58709, 0x1f5c76ef), - TOBN(0x32920edd, 0x167d79ae), TOBN(0x039df8a2, 0xfa7d7ec1), - TOBN(0xf46206c0, 0xbb30af91), TOBN(0x1ff5e2f5, 0x22676b59), - TOBN(0x11f4a039, 0x6ea51d66), TOBN(0x506c1445, 0x807d7a26), - TOBN(0x60da5705, 0x755a9b24), TOBN(0x8fc8cc32, 0x1f1a319e), - TOBN(0x83642d4d, 0x9433d67d), TOBN(0x7fa5cb8f, 0x6a7dd296), - TOBN(0x576591db, 0x9b7bde07), TOBN(0x13173d25, 0x419716fb), - TOBN(0xea30599d, 0xd5b340ff), TOBN(0xfc6b5297, 0xb0fe76c5), - TOBN(0x1c6968c8, 0xab8f5adc), TOBN(0xf723c7f5, 0x901c928d), - TOBN(0x4203c321, 0x9773d402), TOBN(0xdf7c6aa3, 0x1b51dd47), - TOBN(0x3d49e37a, 0x552be23c), TOBN(0x57febee8, 0x0b5a6e87), - TOBN(0xc5ecbee4, 0x7bd8e739), TOBN(0x79d44994, 0xae63bf75), - TOBN(0x168bd00f, 0x38fb8923), TOBN(0x75d48ee4, 0xd0533130), - TOBN(0x554f77aa, 0xdb5cdf33), TOBN(0x3396e896, 0x3c696769), - TOBN(0x2fdddbf2, 0xd3fd674e), TOBN(0xbbb8f6ee, 0x99d0e3e5), - TOBN(0x51b90651, 0xcbae2f70), TOBN(0xefc4bc05, 0x93aaa8eb), - TOBN(0x8ecd8689, 0xdd1df499), TOBN(0x1aee99a8, 0x22f367a5), - TOBN(0x95d485b9, 0xae8274c5), TOBN(0x6c14d445, 0x7d30b39c), - TOBN(0xbafea90b, 0xbcc1ef81), TOBN(0x7c5f317a, 0xa459a2ed), - TOBN(0x01211075, 0x4ef44227), TOBN(0xa17bed6e, 0xdc20f496), - TOBN(0x0cdfe424, 0x819853cd), TOBN(0x13793298, 0xf71e2ce7), - TOBN(0x3c1f3078, 0xdbbe307b), TOBN(0x6dd1c20e, 0x76ee9936), - TOBN(0x23ee4b57, 0x423caa20), TOBN(0x4ac3793b, 0x8efb840e), - TOBN(0x934438eb, 0xed1f8ca0), TOBN(0x3e546658, 0x4ebb25a2), - TOBN(0xc415af0e, 0xc069896f), TOBN(0xc13eddb0, 0x9a5aa43d), - TOBN(0x7a04204f, 0xd49eb8f6), TOBN(0xd0d5bdfc, 0xd74f1670), - TOBN(0x3697e286, 0x56fc0558), TOBN(0x10207371, 0x01cebade), - TOBN(0x5f87e690, 0x0647a82b), TOBN(0x908e0ed4, 0x8f40054f), - TOBN(0xa9f633d4, 0x79853803), TOBN(0x8ed13c9a, 0x4a28b252), - TOBN(0x3e2ef676, 0x1f460f64), TOBN(0x53930b9b, 0x36d06336), - TOBN(0x347073ac, 0x8fc4979b), TOBN(0x84380e0e, 0x5ecd5597), - TOBN(0xe3b22c6b, 0xc4fe3c39), TOBN(0xba4a8153, 0x6c7bebdf), - TOBN(0xf23ab6b7, 0x25693459), TOBN(0x53bc3770, 0x14922b11), - TOBN(0x4645c8ab, 0x5afc60db), TOBN(0xaa022355, 0x20b9f2a3), - TOBN(0x52a2954c, 0xce0fc507), TOBN(0x8c2731bb, 0x7ce1c2e7), - TOBN(0xf39608ab, 0x18a0339d), TOBN(0xac7a658d, 0x3735436c), - TOBN(0xb22c2b07, 0xcd992b4f), TOBN(0x4e83daec, 0xf40dcfd4), - TOBN(0x8a34c7be, 0x2f39ea3e), TOBN(0xef0c005f, 0xb0a56d2e), - TOBN(0x62731f6a, 0x6edd8038), TOBN(0x5721d740, 0x4e3cb075), - TOBN(0x1ea41511, 0xfbeeee1b), TOBN(0xd1ef5e73, 0xef1d0c05), - TOBN(0x42feefd1, 0x73c07d35), TOBN(0xe530a00a, 0x8a329493), - TOBN(0x5d55b7fe, 0xf15ebfb0), TOBN(0x549de03c, 0xd322491a), - TOBN(0xf7b5f602, 0x745b3237), TOBN(0x3632a3a2, 0x1ab6e2b6), - TOBN(0x0d3bba89, 0x0ef59f78), TOBN(0x0dfc6443, 0xc9e52b9a), - TOBN(0x1dc79699, 0x72631447), TOBN(0xef033917, 0xb3be20b1), - TOBN(0x0c92735d, 0xb1383948), TOBN(0xc1fc29a2, 0xc0dd7d7d), - TOBN(0x6485b697, 0x403ed068), TOBN(0x13bfaab3, 0xaac93bdc), - TOBN(0x410dc6a9, 0x0deeaf52), TOBN(0xb003fb02, 0x4c641c15), - TOBN(0x1384978c, 0x5bc504c4), TOBN(0x37640487, 0x864a6a77), - TOBN(0x05991bc6, 0x222a77da), TOBN(0x62260a57, 0x5e47eb11), - TOBN(0xc7af6613, 0xf21b432c), TOBN(0x22f3acc9, 0xab4953e9), - TOBN(0x52934922, 0x8e41d155), TOBN(0x4d024568, 0x3ac059ef), - TOBN(0xb0201755, 0x4d884411), TOBN(0xce8055cf, 0xa59a178f), - TOBN(0xcd77d1af, 0xf6204549), TOBN(0xa0a00a3e, 0xc7066759), - TOBN(0x471071ef, 0x0272c229), TOBN(0x009bcf6b, 0xd3c4b6b0), - TOBN(0x2a2638a8, 0x22305177), TOBN(0xd51d59df, 0x41645bbf), - TOBN(0xa81142fd, 0xc0a7a3c0), TOBN(0xa17eca6d, 0x4c7063ee), - TOBN(0x0bb887ed, 0x60d9dcec), TOBN(0xd6d28e51, 0x20ad2455), - TOBN(0xebed6308, 0xa67102ba), TOBN(0x042c3114, 0x8bffa408), - TOBN(0xfd099ac5, 0x8aa68e30), TOBN(0x7a6a3d7c, 0x1483513e), - TOBN(0xffcc6b75, 0xba2d8f0c), TOBN(0x54dacf96, 0x1e78b954), - TOBN(0xf645696f, 0xa4a9af89), TOBN(0x3a411940, 0x06ac98ec), - TOBN(0x41b8b3f6, 0x22a67a20), TOBN(0x2d0b1e0f, 0x99dec626), - TOBN(0x27c89192, 0x40be34e8), TOBN(0xc7162b37, 0x91907f35), - TOBN(0x90188ec1, 0xa956702b), TOBN(0xca132f7d, 0xdf93769c), - TOBN(0x3ece44f9, 0x0e2025b4), TOBN(0x67aaec69, 0x0c62f14c), - TOBN(0xad741418, 0x22e3cc11), TOBN(0xcf9b75c3, 0x7ff9a50e), - TOBN(0x02fa2b16, 0x4d348272), TOBN(0xbd99d61a, 0x9959d56d), - TOBN(0xbc4f19db, 0x18762916), TOBN(0xcc7cce50, 0x49c1ac80), - TOBN(0x4d59ebaa, 0xd846bd83), TOBN(0x8775a9dc, 0xa9202849), - TOBN(0x07ec4ae1, 0x6e1f4ca9), TOBN(0x27eb5875, 0xba893f11), - TOBN(0x00284d51, 0x662cc565), TOBN(0x82353a6b, 0x0db4138d), - TOBN(0xd9c7aaaa, 0xaa32a594), TOBN(0xf5528b5e, 0xa5669c47), - TOBN(0xf3220231, 0x2f23c5ff), TOBN(0xe3e8147a, 0x6affa3a1), - TOBN(0xfb423d5c, 0x202ddda0), TOBN(0x3d6414ac, 0x6b871bd4), - TOBN(0x586f82e1, 0xa51a168a), TOBN(0xb712c671, 0x48ae5448), - TOBN(0x9a2e4bd1, 0x76233eb8), TOBN(0x0188223a, 0x78811ca9), - TOBN(0x553c5e21, 0xf7c18de1), TOBN(0x7682e451, 0xb27bb286), - TOBN(0x3ed036b3, 0x0e51e929), TOBN(0xf487211b, 0xec9cb34f), - TOBN(0x0d094277, 0x0c24efc8), TOBN(0x0349fd04, 0xbef737a4), - TOBN(0x6d1c9dd2, 0x514cdd28), TOBN(0x29c135ff, 0x30da9521), - TOBN(0xea6e4508, 0xf78b0b6f), TOBN(0x176f5dd2, 0x678c143c), - TOBN(0x08148418, 0x4be21e65), TOBN(0x27f7525c, 0xe7df38c4), - TOBN(0x1fb70e09, 0x748ab1a4), TOBN(0x9cba50a0, 0x5efe4433), - TOBN(0x7846c7a6, 0x15f75af2), TOBN(0x2a7c2c57, 0x5ee73ea8), - TOBN(0x42e566a4, 0x3f0a449a), TOBN(0x45474c3b, 0xad90fc3d), - TOBN(0x7447be3d, 0x8b61d057), TOBN(0x3e9d1cf1, 0x3a4ec092), - TOBN(0x1603e453, 0xf380a6e6), TOBN(0x0b86e431, 0x9b1437c2), - TOBN(0x7a4173f2, 0xef29610a), TOBN(0x8fa729a7, 0xf03d57f7), - TOBN(0x3e186f6e, 0x6c9c217e), TOBN(0xbe1d3079, 0x91919524), - TOBN(0x92a62a70, 0x153d4fb1), TOBN(0x32ed3e34, 0xd68c2f71), - TOBN(0xd785027f, 0x9eb1a8b7), TOBN(0xbc37eb77, 0xc5b22fe8), - TOBN(0x466b34f0, 0xb9d6a191), TOBN(0x008a89af, 0x9a05f816), - TOBN(0x19b028fb, 0x7d42c10a), TOBN(0x7fe8c92f, 0x49b3f6b8), - TOBN(0x58907cc0, 0xa5a0ade3), TOBN(0xb3154f51, 0x559d1a7c), - TOBN(0x5066efb6, 0xd9790ed6), TOBN(0xa77a0cbc, 0xa6aa793b), - TOBN(0x1a915f3c, 0x223e042e), TOBN(0x1c5def04, 0x69c5874b), - TOBN(0x0e830078, 0x73b6c1da), TOBN(0x55cf85d2, 0xfcd8557a), - TOBN(0x0f7c7c76, 0x0460f3b1), TOBN(0x87052acb, 0x46e58063), - TOBN(0x09212b80, 0x907eae66), TOBN(0x3cb068e0, 0x4d721c89), - TOBN(0xa87941ae, 0xdd45ac1c), TOBN(0xde8d5c0d, 0x0daa0dbb), - TOBN(0xda421fdc, 0xe3502e6e), TOBN(0xc8944201, 0x4d89a084), - TOBN(0x7307ba5e, 0xf0c24bfb), TOBN(0xda212beb, 0x20bde0ef), - TOBN(0xea2da24b, 0xf82ce682), TOBN(0x058d3816, 0x07f71fe4), - TOBN(0x35a02462, 0x5ffad8de), TOBN(0xcd7b05dc, 0xaadcefab), - TOBN(0xd442f8ed, 0x1d9f54ec), TOBN(0x8be3d618, 0xb2d3b5ca), - TOBN(0xe2220ed0, 0xe06b2ce2), TOBN(0x82699a5f, 0x1b0da4c0), - TOBN(0x3ff106f5, 0x71c0c3a7), TOBN(0x8f580f5a, 0x0d34180c), - TOBN(0x4ebb120e, 0x22d7d375), TOBN(0x5e5782cc, 0xe9513675), - TOBN(0x2275580c, 0x99c82a70), TOBN(0xe8359fbf, 0x15ea8c4c), - TOBN(0x53b48db8, 0x7b415e70), TOBN(0xaacf2240, 0x100c6014), - TOBN(0x9faaccf5, 0xe4652f1d), TOBN(0xbd6fdd2a, 0xd56157b2), - TOBN(0xa4f4fb1f, 0x6261ec50), TOBN(0x244e55ad, 0x476bcd52), - TOBN(0x881c9305, 0x047d320b), TOBN(0x1ca983d5, 0x6181263f), - TOBN(0x354e9a44, 0x278fb8ee), TOBN(0xad2dbc0f, 0x396e4964), - TOBN(0x723f3aa2, 0x9268b3de), TOBN(0x0d1ca29a, 0xe6e0609a), - TOBN(0x794866aa, 0x6cf44252), TOBN(0x0b59f3e3, 0x01af87ed), - TOBN(0xe234e5ff, 0x7f4a6c51), TOBN(0xa8768fd2, 0x61dc2f7e), - TOBN(0xdafc7332, 0x0a94d81f), TOBN(0xd7f84282, 0x06938ce1), - TOBN(0xae0b3c0e, 0x0546063e), TOBN(0x7fbadcb2, 0x5d61abc6), - TOBN(0xd5d7a2c9, 0x369ac400), TOBN(0xa5978d09, 0xae67d10c), - TOBN(0x290f211e, 0x4f85eaac), TOBN(0xe61e2ad1, 0xfacac681), - TOBN(0xae125225, 0x388384cd), TOBN(0xa7fb68e9, 0xccfde30f), - TOBN(0x7a59b936, 0x3daed4c2), TOBN(0x80a9aa40, 0x2606f789), - TOBN(0xb40c1ea5, 0xf6a6d90a), TOBN(0x948364d3, 0x514d5885), - TOBN(0x062ebc60, 0x70985182), TOBN(0xa6db5b0e, 0x33310895), - TOBN(0x64a12175, 0xe329c2f5), TOBN(0xc5f25bd2, 0x90ea237e), - TOBN(0x7915c524, 0x2d0a4c23), TOBN(0xeb5d26e4, 0x6bb3cc52), - TOBN(0x369a9116, 0xc09e2c92), TOBN(0x0c527f92, 0xcf182cf8), - TOBN(0x9e591938, 0x2aede0ac), TOBN(0xb2922208, 0x6cc34939), - TOBN(0x3c9d8962, 0x99a34361), TOBN(0x3c81836d, 0xc1905fe6), - TOBN(0x4bfeb57f, 0xa001ec5a), TOBN(0xe993f5bb, 0xa0dc5dba), - TOBN(0x47884109, 0x724a1380), TOBN(0x8a0369ab, 0x32fe9a04), - TOBN(0xea068d60, 0x8c927db8), TOBN(0xbf5f37cf, 0x94655741), - TOBN(0x47d402a2, 0x04b6c7ea), TOBN(0x4551c295, 0x6af259cb), - TOBN(0x698b71e7, 0xed77ee8b), TOBN(0xbddf7bd0, 0xf309d5c7), - TOBN(0x6201c22c, 0x34e780ca), TOBN(0xab04f7d8, 0x4c295ef4), - TOBN(0x1c947294, 0x4313a8ce), TOBN(0xe532e4ac, 0x92ca4cfe), - TOBN(0x89738f80, 0xd0a7a97a), TOBN(0xec088c88, 0xa580fd5b), - TOBN(0x612b1ecc, 0x42ce9e51), TOBN(0x8f9840fd, 0xb25fdd2a), - TOBN(0x3cda78c0, 0x01e7f839), TOBN(0x546b3d3a, 0xece05480), - TOBN(0x271719a9, 0x80d30916), TOBN(0x45497107, 0x584c20c4), - TOBN(0xaf8f9478, 0x5bc78608), TOBN(0x28c7d484, 0x277e2a4c), - TOBN(0xfce01767, 0x88a2ffe4), TOBN(0xdc506a35, 0x28e169a5), - TOBN(0x0ea10861, 0x7af9c93a), TOBN(0x1ed24361, 0x03fa0e08), - TOBN(0x96eaaa92, 0xa3d694e7), TOBN(0xc0f43b4d, 0xef50bc74), - TOBN(0xce6aa58c, 0x64114db4), TOBN(0x8218e8ea, 0x7c000fd4), - TOBN(0xac815dfb, 0x185f8844), TOBN(0xcd7e90cb, 0x1557abfb), - TOBN(0x23d16655, 0xafbfecdf), TOBN(0x80f3271f, 0x085cac4a), - TOBN(0x7fc39aa7, 0xd0e62f47), TOBN(0x88d519d1, 0x460a48e5), - TOBN(0x59559ac4, 0xd28f101e), TOBN(0x7981d9e9, 0xca9ae816), - TOBN(0x5c38652c, 0x9ac38203), TOBN(0x86eaf87f, 0x57657fe5), - TOBN(0x568fc472, 0xe21f5416), TOBN(0x2afff39c, 0xe7e597b5), - TOBN(0x3adbbb07, 0x256d4eab), TOBN(0x22598692, 0x8285ab89), - TOBN(0x35f8112a, 0x041caefe), TOBN(0x95df02e3, 0xa5064c8b), - TOBN(0x4d63356e, 0xc7004bf3), TOBN(0x230a08f4, 0xdb83c7de), - TOBN(0xca27b270, 0x8709a7b7), TOBN(0x0d1c4cc4, 0xcb9abd2d), - TOBN(0x8a0bc66e, 0x7550fee8), TOBN(0x369cd4c7, 0x9cf7247e), - TOBN(0x75562e84, 0x92b5b7e7), TOBN(0x8fed0da0, 0x5802af7b), - TOBN(0x6a7091c2, 0xe48fb889), TOBN(0x26882c13, 0x7b8a9d06), - TOBN(0xa2498663, 0x1b82a0e2), TOBN(0x844ed736, 0x3518152d), - TOBN(0x282f476f, 0xd86e27c7), TOBN(0xa04edaca, 0x04afefdc), - TOBN(0x8b256ebc, 0x6119e34d), TOBN(0x56a413e9, 0x0787d78b)}, - {TOBN(0x82ee061d, 0x5a74be50), TOBN(0xe41781c4, 0xdea16ff5), - TOBN(0xe0b0c81e, 0x99bfc8a2), TOBN(0x624f4d69, 0x0b547e2d), - TOBN(0x3a83545d, 0xbdcc9ae4), TOBN(0x2573dbb6, 0x409b1e8e), - TOBN(0x482960c4, 0xa6c93539), TOBN(0xf01059ad, 0x5ae18798), - TOBN(0x715c9f97, 0x3112795f), TOBN(0xe8244437, 0x984e6ee1), - TOBN(0x55cb4858, 0xecb66bcd), TOBN(0x7c136735, 0xabaffbee), - TOBN(0x54661595, 0x5dbec38e), TOBN(0x51c0782c, 0x388ad153), - TOBN(0x9ba4c53a, 0xc6e0952f), TOBN(0x27e6782a, 0x1b21dfa8), - TOBN(0x682f903d, 0x4ed2dbc2), TOBN(0x0eba59c8, 0x7c3b2d83), - TOBN(0x8e9dc84d, 0x9c7e9335), TOBN(0x5f9b21b0, 0x0eb226d7), - TOBN(0xe33bd394, 0xaf267bae), TOBN(0xaa86cc25, 0xbe2e15ae), - TOBN(0x4f0bf67d, 0x6a8ec500), TOBN(0x5846aa44, 0xf9630658), - TOBN(0xfeb09740, 0xe2c2bf15), TOBN(0x627a2205, 0xa9e99704), - TOBN(0xec8d73d0, 0xc2fbc565), TOBN(0x223eed8f, 0xc20c8de8), - TOBN(0x1ee32583, 0xa8363b49), TOBN(0x1a0b6cb9, 0xc9c2b0a6), - TOBN(0x49f7c3d2, 0x90dbc85c), TOBN(0xa8dfbb97, 0x1ef4c1ac), - TOBN(0xafb34d4c, 0x65c7c2ab), TOBN(0x1d4610e7, 0xe2c5ea84), - TOBN(0x893f6d1b, 0x973c4ab5), TOBN(0xa3cdd7e9, 0x945ba5c4), - TOBN(0x60514983, 0x064417ee), TOBN(0x1459b23c, 0xad6bdf2b), - TOBN(0x23b2c341, 0x5cf726c3), TOBN(0x3a829635, 0x32d6354a), - TOBN(0x294f901f, 0xab192c18), TOBN(0xec5fcbfe, 0x7030164f), - TOBN(0xe2e2fcb7, 0xe2246ba6), TOBN(0x1e7c88b3, 0x221a1a0c), - TOBN(0x72c7dd93, 0xc92d88c5), TOBN(0x41c2148e, 0x1106fb59), - TOBN(0x547dd4f5, 0xa0f60f14), TOBN(0xed9b52b2, 0x63960f31), - TOBN(0x6c8349eb, 0xb0a5b358), TOBN(0xb154c5c2, 0x9e7e2ed6), - TOBN(0xcad5eccf, 0xeda462db), TOBN(0xf2d6dbe4, 0x2de66b69), - TOBN(0x426aedf3, 0x8665e5b2), TOBN(0x488a8513, 0x7b7f5723), - TOBN(0x15cc43b3, 0x8bcbb386), TOBN(0x27ad0af3, 0xd791d879), - TOBN(0xc16c236e, 0x846e364f), TOBN(0x7f33527c, 0xdea50ca0), - TOBN(0xc4810775, 0x0926b86d), TOBN(0x6c2a3609, 0x0598e70c), - TOBN(0xa6755e52, 0xf024e924), TOBN(0xe0fa07a4, 0x9db4afca), - TOBN(0x15c3ce7d, 0x66831790), TOBN(0x5b4ef350, 0xa6cbb0d6), - TOBN(0x2c4aafc4, 0xb6205969), TOBN(0x42563f02, 0xf6c7854f), - TOBN(0x016aced5, 0x1d983b48), TOBN(0xfeb356d8, 0x99949755), - TOBN(0x8c2a2c81, 0xd1a39bd7), TOBN(0x8f44340f, 0xe6934ae9), - TOBN(0x148cf91c, 0x447904da), TOBN(0x7340185f, 0x0f51a926), - TOBN(0x2f8f00fb, 0x7409ab46), TOBN(0x057e78e6, 0x80e289b2), - TOBN(0x03e5022c, 0xa888e5d1), TOBN(0x3c87111a, 0x9dede4e2), - TOBN(0x5b9b0e1c, 0x7809460b), TOBN(0xe751c852, 0x71c9abc7), - TOBN(0x8b944e28, 0xc7cc1dc9), TOBN(0x4f201ffa, 0x1d3cfa08), - TOBN(0x02fc905c, 0x3e6721ce), TOBN(0xd52d70da, 0xd0b3674c), - TOBN(0x5dc2e5ca, 0x18810da4), TOBN(0xa984b273, 0x5c69dd99), - TOBN(0x63b92527, 0x84de5ca4), TOBN(0x2f1c9872, 0xc852dec4), - TOBN(0x18b03593, 0xc2e3de09), TOBN(0x19d70b01, 0x9813dc2f), - TOBN(0x42806b2d, 0xa6dc1d29), TOBN(0xd3030009, 0xf871e144), - TOBN(0xa1feb333, 0xaaf49276), TOBN(0xb5583b9e, 0xc70bc04b), - TOBN(0x1db0be78, 0x95695f20), TOBN(0xfc841811, 0x89d012b5), - TOBN(0x6409f272, 0x05f61643), TOBN(0x40d34174, 0xd5883128), - TOBN(0xd79196f5, 0x67419833), TOBN(0x6059e252, 0x863b7b08), - TOBN(0x84da1817, 0x1c56700c), TOBN(0x5758ee56, 0xb28d3ec4), - TOBN(0x7da2771d, 0x013b0ea6), TOBN(0xfddf524b, 0x54c5e9b9), - TOBN(0x7df4faf8, 0x24305d80), TOBN(0x58f5c1bf, 0x3a97763f), - TOBN(0xa5af37f1, 0x7c696042), TOBN(0xd4cba22c, 0x4a2538de), - TOBN(0x211cb995, 0x9ea42600), TOBN(0xcd105f41, 0x7b069889), - TOBN(0xb1e1cf19, 0xddb81e74), TOBN(0x472f2d89, 0x5157b8ca), - TOBN(0x086fb008, 0xee9db885), TOBN(0x365cd570, 0x0f26d131), - TOBN(0x284b02bb, 0xa2be7053), TOBN(0xdcbbf7c6, 0x7ab9a6d6), - TOBN(0x4425559c, 0x20f7a530), TOBN(0x961f2dfa, 0x188767c8), - TOBN(0xe2fd9435, 0x70dc80c4), TOBN(0x104d6b63, 0xf0784120), - TOBN(0x7f592bc1, 0x53567122), TOBN(0xf6bc1246, 0xf688ad77), - TOBN(0x05214c05, 0x0f15dde9), TOBN(0xa47a76a8, 0x0d5f2b82), - TOBN(0xbb254d30, 0x62e82b62), TOBN(0x11a05fe0, 0x3ec955ee), - TOBN(0x7eaff46e, 0x9d529b36), TOBN(0x55ab1301, 0x8f9e3df6), - TOBN(0xc463e371, 0x99317698), TOBN(0xfd251438, 0xccda47ad), - TOBN(0xca9c3547, 0x23d695ea), TOBN(0x48ce626e, 0x16e589b5), - TOBN(0x6b5b64c7, 0xb187d086), TOBN(0xd02e1794, 0xb2207948), - TOBN(0x8b58e98f, 0x7198111d), TOBN(0x90ca6305, 0xdcf9c3cc), - TOBN(0x5691fe72, 0xf34089b0), TOBN(0x60941af1, 0xfc7c80ff), - TOBN(0xa09bc0a2, 0x22eb51e5), TOBN(0xc0bb7244, 0xaa9cf09a), - TOBN(0x36a8077f, 0x80159f06), TOBN(0x8b5c989e, 0xdddc560e), - TOBN(0x19d2f316, 0x512e1f43), TOBN(0x02eac554, 0xad08ff62), - TOBN(0x012ab84c, 0x07d20b4e), TOBN(0x37d1e115, 0xd6d4e4e1), - TOBN(0xb6443e1a, 0xab7b19a8), TOBN(0xf08d067e, 0xdef8cd45), - TOBN(0x63adf3e9, 0x685e03da), TOBN(0xcf15a10e, 0x4792b916), - TOBN(0xf44bcce5, 0xb738a425), TOBN(0xebe131d5, 0x9636b2fd), - TOBN(0x94068841, 0x7850d605), TOBN(0x09684eaa, 0xb40d749d), - TOBN(0x8c3c669c, 0x72ba075b), TOBN(0x89f78b55, 0xba469015), - TOBN(0x5706aade, 0x3e9f8ba8), TOBN(0x6d8bd565, 0xb32d7ed7), - TOBN(0x25f4e63b, 0x805f08d6), TOBN(0x7f48200d, 0xc3bcc1b5), - TOBN(0x4e801968, 0xb025d847), TOBN(0x74afac04, 0x87cbe0a8), - TOBN(0x43ed2c2b, 0x7e63d690), TOBN(0xefb6bbf0, 0x0223cdb8), - TOBN(0x4fec3cae, 0x2884d3fe), TOBN(0x065ecce6, 0xd75e25a4), - TOBN(0x6c2294ce, 0x69f79071), TOBN(0x0d9a8e5f, 0x044b8666), - TOBN(0x5009f238, 0x17b69d8f), TOBN(0x3c29f8fe, 0xc5dfdaf7), - TOBN(0x9067528f, 0xebae68c4), TOBN(0x5b385632, 0x30c5ba21), - TOBN(0x540df119, 0x1fdd1aec), TOBN(0xcf37825b, 0xcfba4c78), - TOBN(0x77eff980, 0xbeb11454), TOBN(0x40a1a991, 0x60c1b066), - TOBN(0xe8018980, 0xf889a1c7), TOBN(0xb9c52ae9, 0x76c24be0), - TOBN(0x05fbbcce, 0x45650ef4), TOBN(0xae000f10, 0x8aa29ac7), - TOBN(0x884b7172, 0x4f04c470), TOBN(0x7cd4fde2, 0x19bb5c25), - TOBN(0x6477b22a, 0xe8840869), TOBN(0xa8868859, 0x5fbd0686), - TOBN(0xf23cc02e, 0x1116dfba), TOBN(0x76cd563f, 0xd87d7776), - TOBN(0xe2a37598, 0xa9d82abf), TOBN(0x5f188ccb, 0xe6c170f5), - TOBN(0x81682200, 0x5066b087), TOBN(0xda22c212, 0xc7155ada), - TOBN(0x151e5d3a, 0xfbddb479), TOBN(0x4b606b84, 0x6d715b99), - TOBN(0x4a73b54b, 0xf997cb2e), TOBN(0x9a1bfe43, 0x3ecd8b66), - TOBN(0x1c312809, 0x2a67d48a), TOBN(0xcd6a671e, 0x031fa9e2), - TOBN(0xbec3312a, 0x0e43a34a), TOBN(0x1d935639, 0x55ef47d3), - TOBN(0x5ea02489, 0x8fea73ea), TOBN(0x8247b364, 0xa035afb2), - TOBN(0xb58300a6, 0x5265b54c), TOBN(0x3286662f, 0x722c7148), - TOBN(0xb77fd76b, 0xb4ec4c20), TOBN(0xf0a12fa7, 0x0f3fe3fd), - TOBN(0xf845bbf5, 0x41d8c7e8), TOBN(0xe4d969ca, 0x5ec10aa8), - TOBN(0x4c0053b7, 0x43e232a3), TOBN(0xdc7a3fac, 0x37f8a45a), - TOBN(0x3c4261c5, 0x20d81c8f), TOBN(0xfd4b3453, 0xb00eab00), - TOBN(0x76d48f86, 0xd36e3062), TOBN(0x626c5277, 0xa143ff02), - TOBN(0x538174de, 0xaf76f42e), TOBN(0x2267aa86, 0x6407ceac), - TOBN(0xfad76351, 0x72e572d5), TOBN(0xab861af7, 0xba7330eb), - TOBN(0xa0a1c8c7, 0x418d8657), TOBN(0x988821cb, 0x20289a52), - TOBN(0x79732522, 0xcccc18ad), TOBN(0xaadf3f8d, 0xf1a6e027), - TOBN(0xf7382c93, 0x17c2354d), TOBN(0x5ce1680c, 0xd818b689), - TOBN(0x359ebbfc, 0xd9ecbee9), TOBN(0x4330689c, 0x1cae62ac), - TOBN(0xb55ce5b4, 0xc51ac38a), TOBN(0x7921dfea, 0xfe238ee8), - TOBN(0x3972bef8, 0x271d1ca5), TOBN(0x3e423bc7, 0xe8aabd18), - TOBN(0x57b09f3f, 0x44a3e5e3), TOBN(0x5da886ae, 0x7b444d66), - TOBN(0x68206634, 0xa9964375), TOBN(0x356a2fa3, 0x699cd0ff), - TOBN(0xaf0faa24, 0xdba515e9), TOBN(0x536e1f5c, 0xb321d79a), - TOBN(0xd3b9913a, 0x5c04e4ea), TOBN(0xd549dcfe, 0xd6f11513), - TOBN(0xee227bf5, 0x79fd1d94), TOBN(0x9f35afee, 0xb43f2c67), - TOBN(0xd2638d24, 0xf1314f53), TOBN(0x62baf948, 0xcabcd822), - TOBN(0x5542de29, 0x4ef48db0), TOBN(0xb3eb6a04, 0xfc5f6bb2), - TOBN(0x23c110ae, 0x1208e16a), TOBN(0x1a4d15b5, 0xf8363e24), - TOBN(0x30716844, 0x164be00b), TOBN(0xa8e24824, 0xf6f4690d), - TOBN(0x548773a2, 0x90b170cf), TOBN(0xa1bef331, 0x42f191f4), - TOBN(0x70f418d0, 0x9247aa97), TOBN(0xea06028e, 0x48be9147), - TOBN(0xe13122f3, 0xdbfb894e), TOBN(0xbe9b79f6, 0xce274b18), - TOBN(0x85a49de5, 0xca58aadf), TOBN(0x24957758, 0x11487351), - TOBN(0x111def61, 0xbb939099), TOBN(0x1d6a974a, 0x26d13694), - TOBN(0x4474b4ce, 0xd3fc253b), TOBN(0x3a1485e6, 0x4c5db15e), - TOBN(0xe79667b4, 0x147c15b4), TOBN(0xe34f553b, 0x7bc61301), - TOBN(0x032b80f8, 0x17094381), TOBN(0x55d8bafd, 0x723eaa21), - TOBN(0x5a987995, 0xf1c0e74e), TOBN(0x5a9b292e, 0xebba289c), - TOBN(0x413cd4b2, 0xeb4c8251), TOBN(0x98b5d243, 0xd162db0a), - TOBN(0xbb47bf66, 0x68342520), TOBN(0x08d68949, 0xbaa862d1), - TOBN(0x11f349c7, 0xe906abcd), TOBN(0x454ce985, 0xed7bf00e), - TOBN(0xacab5c9e, 0xb55b803b), TOBN(0xb03468ea, 0x31e3c16d), - TOBN(0x5c24213d, 0xd273bf12), TOBN(0x211538eb, 0x71587887), - TOBN(0x198e4a2f, 0x731dea2d), TOBN(0xd5856cf2, 0x74ed7b2a), - TOBN(0x86a632eb, 0x13a664fe), TOBN(0x932cd909, 0xbda41291), - TOBN(0x850e95d4, 0xc0c4ddc0), TOBN(0xc0f422f8, 0x347fc2c9), - TOBN(0xe68cbec4, 0x86076bcb), TOBN(0xf9e7c0c0, 0xcd6cd286), - TOBN(0x65994ddb, 0x0f5f27ca), TOBN(0xe85461fb, 0xa80d59ff), - TOBN(0xff05481a, 0x66601023), TOBN(0xc665427a, 0xfc9ebbfb), - TOBN(0xb0571a69, 0x7587fd52), TOBN(0x935289f8, 0x8d49efce), - TOBN(0x61becc60, 0xea420688), TOBN(0xb22639d9, 0x13a786af), - TOBN(0x1a8e6220, 0x361ecf90), TOBN(0x001f23e0, 0x25506463), - TOBN(0xe4ae9b5d, 0x0a5c2b79), TOBN(0xebc9cdad, 0xd8149db5), - TOBN(0xb33164a1, 0x934aa728), TOBN(0x750eb00e, 0xae9b60f3), - TOBN(0x5a91615b, 0x9b9cfbfd), TOBN(0x97015cbf, 0xef45f7f6), - TOBN(0xb462c4a5, 0xbf5151df), TOBN(0x21adcc41, 0xb07118f2), - TOBN(0xd60c545b, 0x043fa42c), TOBN(0xfc21aa54, 0xe96be1ab), - TOBN(0xe84bc32f, 0x4e51ea80), TOBN(0x3dae45f0, 0x259b5d8d), - TOBN(0xbb73c7eb, 0xc38f1b5e), TOBN(0xe405a74a, 0xe8ae617d), - TOBN(0xbb1ae9c6, 0x9f1c56bd), TOBN(0x8c176b98, 0x49f196a4), - TOBN(0xc448f311, 0x6875092b), TOBN(0xb5afe3de, 0x9f976033), - TOBN(0xa8dafd49, 0x145813e5), TOBN(0x687fc4d9, 0xe2b34226), - TOBN(0xf2dfc92d, 0x4c7ff57f), TOBN(0x004e3fc1, 0x401f1b46), - TOBN(0x5afddab6, 0x1430c9ab), TOBN(0x0bdd41d3, 0x2238e997), - TOBN(0xf0947430, 0x418042ae), TOBN(0x71f9adda, 0xcdddc4cb), - TOBN(0x7090c016, 0xc52dd907), TOBN(0xd9bdf44d, 0x29e2047f), - TOBN(0xe6f1fe80, 0x1b1011a6), TOBN(0xb63accbc, 0xd9acdc78), - TOBN(0xcfc7e235, 0x1272a95b), TOBN(0x0c667717, 0xa6276ac8), - TOBN(0x3c0d3709, 0xe2d7eef7), TOBN(0x5add2b06, 0x9a685b3e), - TOBN(0x363ad32d, 0x14ea5d65), TOBN(0xf8e01f06, 0x8d7dd506), - TOBN(0xc9ea2213, 0x75b4aac6), TOBN(0xed2a2bf9, 0x0d353466), - TOBN(0x439d79b5, 0xe9d3a7c3), TOBN(0x8e0ee5a6, 0x81b7f34b), - TOBN(0xcf3dacf5, 0x1dc4ba75), TOBN(0x1d3d1773, 0xeb3310c7), - TOBN(0xa8e67112, 0x7747ae83), TOBN(0x31f43160, 0x197d6b40), - TOBN(0x0521ccee, 0xcd961400), TOBN(0x67246f11, 0xf6535768), - TOBN(0x702fcc5a, 0xef0c3133), TOBN(0x247cc45d, 0x7e16693b), - TOBN(0xfd484e49, 0xc729b749), TOBN(0x522cef7d, 0xb218320f), - TOBN(0xe56ef405, 0x59ab93b3), TOBN(0x225fba11, 0x9f181071), - TOBN(0x33bd6595, 0x15330ed0), TOBN(0xc4be69d5, 0x1ddb32f7), - TOBN(0x264c7668, 0x0448087c), TOBN(0xac30903f, 0x71432dae), - TOBN(0x3851b266, 0x00f9bf47), TOBN(0x400ed311, 0x6cdd6d03), - TOBN(0x045e79fe, 0xf8fd2424), TOBN(0xfdfd974a, 0xfa6da98b), - TOBN(0x45c9f641, 0x0c1e673a), TOBN(0x76f2e733, 0x5b2c5168), - TOBN(0x1adaebb5, 0x2a601753), TOBN(0xb286514c, 0xc57c2d49), - TOBN(0xd8769670, 0x1e0bfd24), TOBN(0x950c547e, 0x04478922), - TOBN(0xd1d41969, 0xe5d32bfe), TOBN(0x30bc1472, 0x750d6c3e), - TOBN(0x8f3679fe, 0xe0e27f3a), TOBN(0x8f64a7dc, 0xa4a6ee0c), - TOBN(0x2fe59937, 0x633dfb1f), TOBN(0xea82c395, 0x977f2547), - TOBN(0xcbdfdf1a, 0x661ea646), TOBN(0xc7ccc591, 0xb9085451), - TOBN(0x82177962, 0x81761e13), TOBN(0xda57596f, 0x9196885c), - TOBN(0xbc17e849, 0x28ffbd70), TOBN(0x1e6e0a41, 0x2671d36f), - TOBN(0x61ae872c, 0x4152fcf5), TOBN(0x441c87b0, 0x9e77e754), - TOBN(0xd0799dd5, 0xa34dff09), TOBN(0x766b4e44, 0x88a6b171), - TOBN(0xdc06a512, 0x11f1c792), TOBN(0xea02ae93, 0x4be35c3e), - TOBN(0xe5ca4d6d, 0xe90c469e), TOBN(0x4df4368e, 0x56e4ff5c), - TOBN(0x7817acab, 0x4baef62e), TOBN(0x9f5a2202, 0xa85b91e8), - TOBN(0x9666ebe6, 0x6ce57610), TOBN(0x32ad31f3, 0xf73bfe03), - TOBN(0x628330a4, 0x25bcf4d6), TOBN(0xea950593, 0x515056e6), - TOBN(0x59811c89, 0xe1332156), TOBN(0xc89cf1fe, 0x8c11b2d7), - TOBN(0x75b63913, 0x04e60cc0), TOBN(0xce811e8d, 0x4625d375), - TOBN(0x030e43fc, 0x2d26e562), TOBN(0xfbb30b4b, 0x608d36a0), - TOBN(0x634ff82c, 0x48528118), TOBN(0x7c6fe085, 0xcd285911), - TOBN(0x7f2830c0, 0x99358f28), TOBN(0x2e60a95e, 0x665e6c09), - TOBN(0x08407d3d, 0x9b785dbf), TOBN(0x530889ab, 0xa759bce7), - TOBN(0xf228e0e6, 0x52f61239), TOBN(0x2b6d1461, 0x6879be3c), - TOBN(0xe6902c04, 0x51a7bbf7), TOBN(0x30ad99f0, 0x76f24a64), - TOBN(0x66d9317a, 0x98bc6da0), TOBN(0xf4f877f3, 0xcb596ac0), - TOBN(0xb05ff62d, 0x4c44f119), TOBN(0x4555f536, 0xe9b77416), - TOBN(0xc7c0d059, 0x8caed63b), TOBN(0x0cd2b7ce, 0xc358b2a9), - TOBN(0x3f33287b, 0x46945fa3), TOBN(0xf8785b20, 0xd67c8791), - TOBN(0xc54a7a61, 0x9637bd08), TOBN(0x54d4598c, 0x18be79d7), - TOBN(0x889e5acb, 0xc46d7ce1), TOBN(0x9a515bb7, 0x8b085877), - TOBN(0xfac1a03d, 0x0b7a5050), TOBN(0x7d3e738a, 0xf2926035), - TOBN(0x861cc2ce, 0x2a6cb0eb), TOBN(0x6f2e2955, 0x8f7adc79), - TOBN(0x61c4d451, 0x33016376), TOBN(0xd9fd2c80, 0x5ad59090), - TOBN(0xe5a83738, 0xb2b836a1), TOBN(0x855b41a0, 0x7c0d6622), - TOBN(0x186fe317, 0x7cc19af1), TOBN(0x6465c1ff, 0xfdd99acb), - TOBN(0x46e5c23f, 0x6974b99e), TOBN(0x75a7cf8b, 0xa2717cbe), - TOBN(0x4d2ebc3f, 0x062be658), TOBN(0x094b4447, 0x5f209c98), - TOBN(0x4af285ed, 0xb940cb5a), TOBN(0x6706d792, 0x7cc82f10), - TOBN(0xc8c8776c, 0x030526fa), TOBN(0xfa8e6f76, 0xa0da9140), - TOBN(0x77ea9d34, 0x591ee4f0), TOBN(0x5f46e337, 0x40274166), - TOBN(0x1bdf98bb, 0xea671457), TOBN(0xd7c08b46, 0x862a1fe2), - TOBN(0x46cc303c, 0x1c08ad63), TOBN(0x99543440, 0x4c845e7b), - TOBN(0x1b8fbdb5, 0x48f36bf7), TOBN(0x5b82c392, 0x8c8273a7), - TOBN(0x08f712c4, 0x928435d5), TOBN(0x071cf0f1, 0x79330380), - TOBN(0xc74c2d24, 0xa8da054a), TOBN(0xcb0e7201, 0x43c46b5c), - TOBN(0x0ad7337a, 0xc0b7eff3), TOBN(0x8552225e, 0xc5e48b3c), - TOBN(0xe6f78b0c, 0x73f13a5f), TOBN(0x5e70062e, 0x82349cbe), - TOBN(0x6b8d5048, 0xe7073969), TOBN(0x392d2a29, 0xc33cb3d2), - TOBN(0xee4f727c, 0x4ecaa20f), TOBN(0xa068c99e, 0x2ccde707), - TOBN(0xfcd5651f, 0xb87a2913), TOBN(0xea3e3c15, 0x3cc252f0), - TOBN(0x777d92df, 0x3b6cd3e4), TOBN(0x7a414143, 0xc5a732e7), - TOBN(0xa895951a, 0xa71ff493), TOBN(0xfe980c92, 0xbbd37cf6), - TOBN(0x45bd5e64, 0xdecfeeff), TOBN(0x910dc2a9, 0xa44c43e9), - TOBN(0xcb403f26, 0xcca9f54d), TOBN(0x928bbdfb, 0x9303f6db), - TOBN(0x3c37951e, 0xa9eee67c), TOBN(0x3bd61a52, 0xf79961c3), - TOBN(0x09a238e6, 0x395c9a79), TOBN(0x6940ca2d, 0x61eb352d), - TOBN(0x7d1e5c5e, 0xc1875631), TOBN(0x1e19742c, 0x1e1b20d1), - TOBN(0x4633d908, 0x23fc2e6e), TOBN(0xa76e29a9, 0x08959149), - TOBN(0x61069d9c, 0x84ed7da5), TOBN(0x0baa11cf, 0x5dbcad51), - TOBN(0xd01eec64, 0x961849da), TOBN(0x93b75f1f, 0xaf3d8c28), - TOBN(0x57bc4f9f, 0x1ca2ee44), TOBN(0x5a26322d, 0x00e00558), - TOBN(0x1888d658, 0x61a023ef), TOBN(0x1d72aab4, 0xb9e5246e), - TOBN(0xa9a26348, 0xe5563ec0), TOBN(0xa0971963, 0xc3439a43), - TOBN(0x567dd54b, 0xadb9b5b7), TOBN(0x73fac1a1, 0xc45a524b), - TOBN(0x8fe97ef7, 0xfe38e608), TOBN(0x608748d2, 0x3f384f48), - TOBN(0xb0571794, 0xc486094f), TOBN(0x869254a3, 0x8bf3a8d6), - TOBN(0x148a8dd1, 0x310b0e25), TOBN(0x99ab9f3f, 0x9aa3f7d8), - TOBN(0x0927c68a, 0x6706c02e), TOBN(0x22b5e76c, 0x69790e6c), - TOBN(0x6c325260, 0x6c71376c), TOBN(0x53a57690, 0x09ef6657), - TOBN(0x8d63f852, 0xedffcf3a), TOBN(0xb4d2ed04, 0x3c0a6f55), - TOBN(0xdb3aa8de, 0x12519b9e), TOBN(0x5d38e9c4, 0x1e0a569a), - TOBN(0x871528bf, 0x303747e2), TOBN(0xa208e77c, 0xf5b5c18d), - TOBN(0x9d129c88, 0xca6bf923), TOBN(0xbcbf197f, 0xbf02839f), - TOBN(0x9b9bf030, 0x27323194), TOBN(0x3b055a8b, 0x339ca59d), - TOBN(0xb46b2312, 0x0f669520), TOBN(0x19789f1f, 0x497e5f24), - TOBN(0x9c499468, 0xaaf01801), TOBN(0x72ee1190, 0x8b69d59c), - TOBN(0x8bd39595, 0xacf4c079), TOBN(0x3ee11ece, 0x8e0cd048), - TOBN(0xebde86ec, 0x1ed66f18), TOBN(0x225d906b, 0xd61fce43), - TOBN(0x5cab07d6, 0xe8bed74d), TOBN(0x16e4617f, 0x27855ab7), - TOBN(0x6568aadd, 0xb2fbc3dd), TOBN(0xedb5484f, 0x8aeddf5b), - TOBN(0x878f20e8, 0x6dcf2fad), TOBN(0x3516497c, 0x615f5699)}, - {TOBN(0xef0a3fec, 0xfa181e69), TOBN(0x9ea02f81, 0x30d69a98), - TOBN(0xb2e9cf8e, 0x66eab95d), TOBN(0x520f2beb, 0x24720021), - TOBN(0x621c540a, 0x1df84361), TOBN(0x12037721, 0x71fa6d5d), - TOBN(0x6e3c7b51, 0x0ff5f6ff), TOBN(0x817a069b, 0xabb2bef3), - TOBN(0x83572fb6, 0xb294cda6), TOBN(0x6ce9bf75, 0xb9039f34), - TOBN(0x20e012f0, 0x095cbb21), TOBN(0xa0aecc1b, 0xd063f0da), - TOBN(0x57c21c3a, 0xf02909e5), TOBN(0xc7d59ecf, 0x48ce9cdc), - TOBN(0x2732b844, 0x8ae336f8), TOBN(0x056e3723, 0x3f4f85f4), - TOBN(0x8a10b531, 0x89e800ca), TOBN(0x50fe0c17, 0x145208fd), - TOBN(0x9e43c0d3, 0xb714ba37), TOBN(0x427d200e, 0x34189acc), - TOBN(0x05dee24f, 0xe616e2c0), TOBN(0x9c25f4c8, 0xee1854c1), - TOBN(0x4d3222a5, 0x8f342a73), TOBN(0x0807804f, 0xa027c952), - TOBN(0xc222653a, 0x4f0d56f3), TOBN(0x961e4047, 0xca28b805), - TOBN(0x2c03f8b0, 0x4a73434b), TOBN(0x4c966787, 0xab712a19), - TOBN(0xcc196c42, 0x864fee42), TOBN(0xc1be93da, 0x5b0ece5c), - TOBN(0xa87d9f22, 0xc131c159), TOBN(0x2bb6d593, 0xdce45655), - TOBN(0x22c49ec9, 0xb809b7ce), TOBN(0x8a41486b, 0xe2c72c2c), - TOBN(0x813b9420, 0xfea0bf36), TOBN(0xb3d36ee9, 0xa66dac69), - TOBN(0x6fddc08a, 0x328cc987), TOBN(0x0a3bcd2c, 0x3a326461), - TOBN(0x7103c49d, 0xd810dbba), TOBN(0xf9d81a28, 0x4b78a4c4), - TOBN(0x3de865ad, 0xe4d55941), TOBN(0xdedafa5e, 0x30384087), - TOBN(0x6f414abb, 0x4ef18b9b), TOBN(0x9ee9ea42, 0xfaee5268), - TOBN(0x260faa16, 0x37a55a4a), TOBN(0xeb19a514, 0x015f93b9), - TOBN(0x51d7ebd2, 0x9e9c3598), TOBN(0x523fc56d, 0x1932178e), - TOBN(0x501d070c, 0xb98fe684), TOBN(0xd60fbe9a, 0x124a1458), - TOBN(0xa45761c8, 0x92bc6b3f), TOBN(0xf5384858, 0xfe6f27cb), - TOBN(0x4b0271f7, 0xb59e763b), TOBN(0x3d4606a9, 0x5b5a8e5e), - TOBN(0x1eda5d9b, 0x05a48292), TOBN(0xda7731d0, 0xe6fec446), - TOBN(0xa3e33693, 0x90d45871), TOBN(0xe9764040, 0x06166d8d), - TOBN(0xb5c33682, 0x89a90403), TOBN(0x4bd17983, 0x72f1d637), - TOBN(0xa616679e, 0xd5d2c53a), TOBN(0x5ec4bcd8, 0xfdcf3b87), - TOBN(0xae6d7613, 0xb66a694e), TOBN(0x7460fc76, 0xe3fc27e5), - TOBN(0x70469b82, 0x95caabee), TOBN(0xde024ca5, 0x889501e3), - TOBN(0x6bdadc06, 0x076ed265), TOBN(0x0cb1236b, 0x5a0ef8b2), - TOBN(0x4065ddbf, 0x0972ebf9), TOBN(0xf1dd3875, 0x22aca432), - TOBN(0xa88b97cf, 0x744aff76), TOBN(0xd1359afd, 0xfe8e3d24), - TOBN(0x52a3ba2b, 0x91502cf3), TOBN(0x2c3832a8, 0x084db75d), - TOBN(0x04a12ddd, 0xde30b1c9), TOBN(0x7802eabc, 0xe31fd60c), - TOBN(0x33707327, 0xa37fddab), TOBN(0x65d6f2ab, 0xfaafa973), - TOBN(0x3525c5b8, 0x11e6f91a), TOBN(0x76aeb0c9, 0x5f46530b), - TOBN(0xe8815ff6, 0x2f93a675), TOBN(0xa6ec9684, 0x05f48679), - TOBN(0x6dcbb556, 0x358ae884), TOBN(0x0af61472, 0xe19e3873), - TOBN(0x72334372, 0xa5f696be), TOBN(0xc65e57ea, 0x6f22fb70), - TOBN(0x268da30c, 0x946cea90), TOBN(0x136a8a87, 0x65681b2a), - TOBN(0xad5e81dc, 0x0f9f44d4), TOBN(0xf09a6960, 0x2c46585a), - TOBN(0xd1649164, 0xc447d1b1), TOBN(0x3b4b36c8, 0x879dc8b1), - TOBN(0x20d4177b, 0x3b6b234c), TOBN(0x096a2505, 0x1730d9d0), - TOBN(0x0611b9b8, 0xef80531d), TOBN(0xba904b3b, 0x64bb495d), - TOBN(0x1192d9d4, 0x93a3147a), TOBN(0x9f30a5dc, 0x9a565545), - TOBN(0x90b1f9cb, 0x6ef07212), TOBN(0x29958546, 0x0d87fc13), - TOBN(0xd3323eff, 0xc17db9ba), TOBN(0xcb18548c, 0xcb1644a8), - TOBN(0x18a306d4, 0x4f49ffbc), TOBN(0x28d658f1, 0x4c2e8684), - TOBN(0x44ba60cd, 0xa99f8c71), TOBN(0x67b7abdb, 0x4bf742ff), - TOBN(0x66310f9c, 0x914b3f99), TOBN(0xae430a32, 0xf412c161), - TOBN(0x1e6776d3, 0x88ace52f), TOBN(0x4bc0fa24, 0x52d7067d), - TOBN(0x03c286aa, 0x8f07cd1b), TOBN(0x4cb8f38c, 0xa985b2c1), - TOBN(0x83ccbe80, 0x8c3bff36), TOBN(0x005a0bd2, 0x5263e575), - TOBN(0x460d7dda, 0x259bdcd1), TOBN(0x4a1c5642, 0xfa5cab6b), - TOBN(0x2b7bdbb9, 0x9fe4fc88), TOBN(0x09418e28, 0xcc97bbb5), - TOBN(0xd8274fb4, 0xa12321ae), TOBN(0xb137007d, 0x5c87b64e), - TOBN(0x80531fe1, 0xc63c4962), TOBN(0x50541e89, 0x981fdb25), - TOBN(0xdc1291a1, 0xfd4c2b6b), TOBN(0xc0693a17, 0xa6df4fca), - TOBN(0xb2c4604e, 0x0117f203), TOBN(0x245f1963, 0x0a99b8d0), - TOBN(0xaedc20aa, 0xc6212c44), TOBN(0xb1ed4e56, 0x520f52a8), - TOBN(0xfe48f575, 0xf8547be3), TOBN(0x0a7033cd, 0xa9e45f98), - TOBN(0x4b45d3a9, 0x18c50100), TOBN(0xb2a6cd6a, 0xa61d41da), - TOBN(0x60bbb4f5, 0x57933c6b), TOBN(0xa7538ebd, 0x2b0d7ffc), - TOBN(0x9ea3ab8d, 0x8cd626b6), TOBN(0x8273a484, 0x3601625a), - TOBN(0x88859845, 0x0168e508), TOBN(0x8cbc9bb2, 0x99a94abd), - TOBN(0x713ac792, 0xfab0a671), TOBN(0xa3995b19, 0x6c9ebffc), - TOBN(0xe711668e, 0x1239e152), TOBN(0x56892558, 0xbbb8dff4), - TOBN(0x8bfc7dab, 0xdbf17963), TOBN(0x5b59fe5a, 0xb3de1253), - TOBN(0x7e3320eb, 0x34a9f7ae), TOBN(0xe5e8cf72, 0xd751efe4), - TOBN(0x7ea003bc, 0xd9be2f37), TOBN(0xc0f551a0, 0xb6c08ef7), - TOBN(0x56606268, 0x038f6725), TOBN(0x1dd38e35, 0x6d92d3b6), - TOBN(0x07dfce7c, 0xc3cbd686), TOBN(0x4e549e04, 0x651c5da8), - TOBN(0x4058f93b, 0x08b19340), TOBN(0xc2fae6f4, 0xcac6d89d), - TOBN(0x4bad8a8c, 0x8f159cc7), TOBN(0x0ddba4b3, 0xcb0b601c), - TOBN(0xda4fc7b5, 0x1dd95f8c), TOBN(0x1d163cd7, 0xcea5c255), - TOBN(0x30707d06, 0x274a8c4c), TOBN(0x79d9e008, 0x2802e9ce), - TOBN(0x02a29ebf, 0xe6ddd505), TOBN(0x37064e74, 0xb50bed1a), - TOBN(0x3f6bae65, 0xa7327d57), TOBN(0x3846f5f1, 0xf83920bc), - TOBN(0x87c37491, 0x60df1b9b), TOBN(0x4cfb2895, 0x2d1da29f), - TOBN(0x10a478ca, 0x4ed1743c), TOBN(0x390c6030, 0x3edd47c6), - TOBN(0x8f3e5312, 0x8c0a78de), TOBN(0xccd02bda, 0x1e85df70), - TOBN(0xd6c75c03, 0xa61b6582), TOBN(0x0762921c, 0xfc0eebd1), - TOBN(0xd34d0823, 0xd85010c0), TOBN(0xd73aaacb, 0x0044cf1f), - TOBN(0xfb4159bb, 0xa3b5e78a), TOBN(0x2287c7f7, 0xe5826f3f), - TOBN(0x4aeaf742, 0x580b1a01), TOBN(0xf080415d, 0x60423b79), - TOBN(0xe12622cd, 0xa7dea144), TOBN(0x49ea4996, 0x59d62472), - TOBN(0xb42991ef, 0x571f3913), TOBN(0x0610f214, 0xf5b25a8a), - TOBN(0x47adc585, 0x30b79e8f), TOBN(0xf90e3df6, 0x07a065a2), - TOBN(0x5d0a5deb, 0x43e2e034), TOBN(0x53fb5a34, 0x444024aa), - TOBN(0xa8628c68, 0x6b0c9f7f), TOBN(0x9c69c29c, 0xac563656), - TOBN(0x5a231feb, 0xbace47b6), TOBN(0xbdce0289, 0x9ea5a2ec), - TOBN(0x05da1fac, 0x9463853e), TOBN(0x96812c52, 0x509e78aa), - TOBN(0xd3fb5771, 0x57151692), TOBN(0xeb2721f8, 0xd98e1c44), - TOBN(0xc0506087, 0x32399be1), TOBN(0xda5a5511, 0xd979d8b8), - TOBN(0x737ed55d, 0xc6f56780), TOBN(0xe20d3004, 0x0dc7a7f4), - TOBN(0x02ce7301, 0xf5941a03), TOBN(0x91ef5215, 0xed30f83a), - TOBN(0x28727fc1, 0x4092d85f), TOBN(0x72d223c6, 0x5c49e41a), - TOBN(0xa7cf30a2, 0xba6a4d81), TOBN(0x7c086209, 0xb030d87d), - TOBN(0x04844c7d, 0xfc588b09), TOBN(0x728cd499, 0x5874bbb0), - TOBN(0xcc1281ee, 0xe84c0495), TOBN(0x0769b5ba, 0xec31958f), - TOBN(0x665c228b, 0xf99c2471), TOBN(0xf2d8a11b, 0x191eb110), - TOBN(0x4594f494, 0xd36d7024), TOBN(0x482ded8b, 0xcdcb25a1), - TOBN(0xc958a9d8, 0xdadd4885), TOBN(0x7004477e, 0xf1d2b547), - TOBN(0x0a45f6ef, 0x2a0af550), TOBN(0x4fc739d6, 0x2f8d6351), - TOBN(0x75cdaf27, 0x786f08a9), TOBN(0x8700bb26, 0x42c2737f), - TOBN(0x855a7141, 0x1c4e2670), TOBN(0x810188c1, 0x15076fef), - TOBN(0xc251d0c9, 0xabcd3297), TOBN(0xae4c8967, 0xf48108eb), - TOBN(0xbd146de7, 0x18ceed30), TOBN(0xf9d4f07a, 0xc986bced), - TOBN(0x5ad98ed5, 0x83fa1e08), TOBN(0x7780d33e, 0xbeabd1fb), - TOBN(0xe330513c, 0x903b1196), TOBN(0xba11de9e, 0xa47bc8c4), - TOBN(0x684334da, 0x02c2d064), TOBN(0x7ecf360d, 0xa48de23b), - TOBN(0x57a1b474, 0x0a9089d8), TOBN(0xf28fa439, 0xff36734c), - TOBN(0xf2a482cb, 0xea4570b3), TOBN(0xee65d68b, 0xa5ebcee9), - TOBN(0x988d0036, 0xb9694cd5), TOBN(0x53edd0e9, 0x37885d32), - TOBN(0xe37e3307, 0xbeb9bc6d), TOBN(0xe9abb907, 0x9f5c6768), - TOBN(0x4396ccd5, 0x51f2160f), TOBN(0x2500888c, 0x47336da6), - TOBN(0x383f9ed9, 0x926fce43), TOBN(0x809dd1c7, 0x04da2930), - TOBN(0x30f6f596, 0x8a4cb227), TOBN(0x0d700c7f, 0x73a56b38), - TOBN(0x1825ea33, 0xab64a065), TOBN(0xaab9b735, 0x1338df80), - TOBN(0x1516100d, 0x9b63f57f), TOBN(0x2574395a, 0x27a6a634), - TOBN(0xb5560fb6, 0x700a1acd), TOBN(0xe823fd73, 0xfd999681), - TOBN(0xda915d1f, 0x6cb4e1ba), TOBN(0x0d030118, 0x6ebe00a3), - TOBN(0x744fb0c9, 0x89fca8cd), TOBN(0x970d01db, 0xf9da0e0b), - TOBN(0x0ad8c564, 0x7931d76f), TOBN(0xb15737bf, 0xf659b96a), - TOBN(0xdc9933e8, 0xa8b484e7), TOBN(0xb2fdbdf9, 0x7a26dec7), - TOBN(0x2349e9a4, 0x9f1f0136), TOBN(0x7860368e, 0x70fddddb), - TOBN(0xd93d2c1c, 0xf9ad3e18), TOBN(0x6d6c5f17, 0x689f4e79), - TOBN(0x7a544d91, 0xb24ff1b6), TOBN(0x3e12a5eb, 0xfe16cd8c), - TOBN(0x543574e9, 0xa56b872f), TOBN(0xa1ad550c, 0xfcf68ea2), - TOBN(0x689e37d2, 0x3f560ef7), TOBN(0x8c54b9ca, 0xc9d47a8b), - TOBN(0x46d40a4a, 0x088ac342), TOBN(0xec450c7c, 0x1576c6d0), - TOBN(0xb589e31c, 0x1f9689e9), TOBN(0xdacf2602, 0xb8781718), - TOBN(0xa89237c6, 0xc8cb6b42), TOBN(0x1326fc93, 0xb96ef381), - TOBN(0x55d56c6d, 0xb5f07825), TOBN(0xacba2eea, 0x7449e22d), - TOBN(0x74e0887a, 0x633c3000), TOBN(0xcb6cd172, 0xd7cbcf71), - TOBN(0x309e81de, 0xc36cf1be), TOBN(0x07a18a6d, 0x60ae399b), - TOBN(0xb36c2679, 0x9edce57e), TOBN(0x52b892f4, 0xdf001d41), - TOBN(0xd884ae5d, 0x16a1f2c6), TOBN(0x9b329424, 0xefcc370a), - TOBN(0x3120daf2, 0xbd2e21df), TOBN(0x55298d2d, 0x02470a99), - TOBN(0x0b78af6c, 0xa05db32e), TOBN(0x5c76a331, 0x601f5636), - TOBN(0xaae861ff, 0xf8a4f29c), TOBN(0x70dc9240, 0xd68f8d49), - TOBN(0x960e649f, 0x81b1321c), TOBN(0x3d2c801b, 0x8792e4ce), - TOBN(0xf479f772, 0x42521876), TOBN(0x0bed93bc, 0x416c79b1), - TOBN(0xa67fbc05, 0x263e5bc9), TOBN(0x01e8e630, 0x521db049), - TOBN(0x76f26738, 0xc6f3431e), TOBN(0xe609cb02, 0xe3267541), - TOBN(0xb10cff2d, 0x818c877c), TOBN(0x1f0e75ce, 0x786a13cb), - TOBN(0xf4fdca64, 0x1158544d), TOBN(0x5d777e89, 0x6cb71ed0), - TOBN(0x3c233737, 0xa9aa4755), TOBN(0x7b453192, 0xe527ab40), - TOBN(0xdb59f688, 0x39f05ffe), TOBN(0x8f4f4be0, 0x6d82574e), - TOBN(0xcce3450c, 0xee292d1b), TOBN(0xaa448a12, 0x61ccd086), - TOBN(0xabce91b3, 0xf7914967), TOBN(0x4537f09b, 0x1908a5ed), - TOBN(0xa812421e, 0xf51042e7), TOBN(0xfaf5cebc, 0xec0b3a34), - TOBN(0x730ffd87, 0x4ca6b39a), TOBN(0x70fb72ed, 0x02efd342), - TOBN(0xeb4735f9, 0xd75c8edb), TOBN(0xc11f2157, 0xc278aa51), - TOBN(0xc459f635, 0xbf3bfebf), TOBN(0x3a1ff0b4, 0x6bd9601f), - TOBN(0xc9d12823, 0xc420cb73), TOBN(0x3e9af3e2, 0x3c2915a3), - TOBN(0xe0c82c72, 0xb41c3440), TOBN(0x175239e5, 0xe3039a5f), - TOBN(0xe1084b8a, 0x558795a3), TOBN(0x328d0a1d, 0xd01e5c60), - TOBN(0x0a495f2e, 0xd3788a04), TOBN(0x25d8ff16, 0x66c11a9f), - TOBN(0xf5155f05, 0x9ed692d6), TOBN(0x954fa107, 0x4f425fe4), - TOBN(0xd16aabf2, 0xe98aaa99), TOBN(0x90cd8ba0, 0x96b0f88a), - TOBN(0x957f4782, 0xc154026a), TOBN(0x54ee0734, 0x52af56d2), - TOBN(0xbcf89e54, 0x45b4147a), TOBN(0x3d102f21, 0x9a52816c), - TOBN(0x6808517e, 0x39b62e77), TOBN(0x92e25421, 0x69169ad8), - TOBN(0xd721d871, 0xbb608558), TOBN(0x60e4ebae, 0xf6d4ff9b), - TOBN(0x0ba10819, 0x41f2763e), TOBN(0xca2e45be, 0x51ee3247), - TOBN(0x66d172ec, 0x2bfd7a5f), TOBN(0x528a8f2f, 0x74d0b12d), - TOBN(0xe17f1e38, 0xdabe70dc), TOBN(0x1d5d7316, 0x9f93983c), - TOBN(0x51b2184a, 0xdf423e31), TOBN(0xcb417291, 0xaedb1a10), - TOBN(0x2054ca93, 0x625bcab9), TOBN(0x54396860, 0xa98998f0), - TOBN(0x4e53f6c4, 0xa54ae57e), TOBN(0x0ffeb590, 0xee648e9d), - TOBN(0xfbbdaadc, 0x6afaf6bc), TOBN(0xf88ae796, 0xaa3bfb8a), - TOBN(0x209f1d44, 0xd2359ed9), TOBN(0xac68dd03, 0xf3544ce2), - TOBN(0xf378da47, 0xfd51e569), TOBN(0xe1abd860, 0x2cc80097), - TOBN(0x23ca18d9, 0x343b6e3a), TOBN(0x480797e8, 0xb40a1bae), - TOBN(0xd1f0c717, 0x533f3e67), TOBN(0x44896970, 0x06e6cdfc), - TOBN(0x8ca21055, 0x52a82e8d), TOBN(0xb2caf785, 0x78460cdc), - TOBN(0x4c1b7b62, 0xe9037178), TOBN(0xefc09d2c, 0xdb514b58), - TOBN(0x5f2df9ee, 0x9113be5c), TOBN(0x2fbda78f, 0xb3f9271c), - TOBN(0xe09a81af, 0x8f83fc54), TOBN(0x06b13866, 0x8afb5141), - TOBN(0x38f6480f, 0x43e3865d), TOBN(0x72dd77a8, 0x1ddf47d9), - TOBN(0xf2a8e971, 0x4c205ff7), TOBN(0x46d449d8, 0x9d088ad8), - TOBN(0x926619ea, 0x185d706f), TOBN(0xe47e02eb, 0xc7dd7f62), - TOBN(0xe7f120a7, 0x8cbc2031), TOBN(0xc18bef00, 0x998d4ac9), - TOBN(0x18f37a9c, 0x6bdf22da), TOBN(0xefbc432f, 0x90dc82df), - TOBN(0xc52cef8e, 0x5d703651), TOBN(0x82887ba0, 0xd99881a5), - TOBN(0x7cec9dda, 0xb920ec1d), TOBN(0xd0d7e8c3, 0xec3e8d3b), - TOBN(0x445bc395, 0x4ca88747), TOBN(0xedeaa2e0, 0x9fd53535), - TOBN(0x461b1d93, 0x6cc87475), TOBN(0xd92a52e2, 0x6d2383bd), - TOBN(0xfabccb59, 0xd7903546), TOBN(0x6111a761, 0x3d14b112), - TOBN(0x0ae584fe, 0xb3d5f612), TOBN(0x5ea69b8d, 0x60e828ec), - TOBN(0x6c078985, 0x54087030), TOBN(0x649cab04, 0xac4821fe), - TOBN(0x25ecedcf, 0x8bdce214), TOBN(0xb5622f72, 0x86af7361), - TOBN(0x0e1227aa, 0x7038b9e2), TOBN(0xd0efb273, 0xac20fa77), - TOBN(0x817ff88b, 0x79df975b), TOBN(0x856bf286, 0x1999503e), - TOBN(0xb4d5351f, 0x5038ec46), TOBN(0x740a52c5, 0xfc42af6e), - TOBN(0x2e38bb15, 0x2cbb1a3f), TOBN(0xc3eb99fe, 0x17a83429), - TOBN(0xca4fcbf1, 0xdd66bb74), TOBN(0x880784d6, 0xcde5e8fc), - TOBN(0xddc84c1c, 0xb4e7a0be), TOBN(0x8780510d, 0xbd15a72f), - TOBN(0x44bcf1af, 0x81ec30e1), TOBN(0x141e50a8, 0x0a61073e), - TOBN(0x0d955718, 0x47be87ae), TOBN(0x68a61417, 0xf76a4372), - TOBN(0xf57e7e87, 0xc607c3d3), TOBN(0x043afaf8, 0x5252f332), - TOBN(0xcc14e121, 0x1552a4d2), TOBN(0xb6dee692, 0xbb4d4ab4), - TOBN(0xb6ab74c8, 0xa03816a4), TOBN(0x84001ae4, 0x6f394a29), - TOBN(0x5bed8344, 0xd795fb45), TOBN(0x57326e7d, 0xb79f55a5), - TOBN(0xc9533ce0, 0x4accdffc), TOBN(0x53473caf, 0x3993fa04), - TOBN(0x7906eb93, 0xa13df4c8), TOBN(0xa73e51f6, 0x97cbe46f), - TOBN(0xd1ab3ae1, 0x0ae4ccf8), TOBN(0x25614508, 0x8a5b3dbc), - TOBN(0x61eff962, 0x11a71b27), TOBN(0xdf71412b, 0x6bb7fa39), - TOBN(0xb31ba6b8, 0x2bd7f3ef), TOBN(0xb0b9c415, 0x69180d29), - TOBN(0xeec14552, 0x014cdde5), TOBN(0x702c624b, 0x227b4bbb), - TOBN(0x2b15e8c2, 0xd3e988f3), TOBN(0xee3bcc6d, 0xa4f7fd04), - TOBN(0x9d00822a, 0x42ac6c85), TOBN(0x2db0cea6, 0x1df9f2b7), - TOBN(0xd7cad2ab, 0x42de1e58), TOBN(0x346ed526, 0x2d6fbb61), - TOBN(0xb3962995, 0x1a2faf09), TOBN(0x2fa8a580, 0x7c25612e), - TOBN(0x30ae04da, 0x7cf56490), TOBN(0x75662908, 0x0eea3961), - TOBN(0x3609f5c5, 0x3d080847), TOBN(0xcb081d39, 0x5241d4f6), - TOBN(0xb4fb3810, 0x77961a63), TOBN(0xc20c5984, 0x2abb66fc), - TOBN(0x3d40aa7c, 0xf902f245), TOBN(0x9cb12736, 0x4e536b1e), - TOBN(0x5eda24da, 0x99b3134f), TOBN(0xafbd9c69, 0x5cd011af), - TOBN(0x9a16e30a, 0xc7088c7d), TOBN(0x5ab65710, 0x3207389f), - TOBN(0x1b09547f, 0xe7407a53), TOBN(0x2322f9d7, 0x4fdc6eab), - TOBN(0xc0f2f22d, 0x7430de4d), TOBN(0x19382696, 0xe68ca9a9), - TOBN(0x17f1eff1, 0x918e5868), TOBN(0xe3b5b635, 0x586f4204), - TOBN(0x146ef980, 0x3fbc4341), TOBN(0x359f2c80, 0x5b5eed4e), - TOBN(0x9f35744e, 0x7482e41d), TOBN(0x9a9ac3ec, 0xf3b224c2), - TOBN(0x9161a6fe, 0x91fc50ae), TOBN(0x89ccc66b, 0xc613fa7c), - TOBN(0x89268b14, 0xc732f15a), TOBN(0x7cd6f4e2, 0xb467ed03), - TOBN(0xfbf79869, 0xce56b40e), TOBN(0xf93e094c, 0xc02dde98), - TOBN(0xefe0c3a8, 0xedee2cd7), TOBN(0x90f3ffc0, 0xb268fd42), - TOBN(0x81a7fd56, 0x08241aed), TOBN(0x95ab7ad8, 0x00b1afe8), - TOBN(0x40127056, 0x3e310d52), TOBN(0xd3ffdeb1, 0x09d9fc43), - TOBN(0xc8f85c91, 0xd11a8594), TOBN(0x2e74d258, 0x31cf6db8), - TOBN(0x829c7ca3, 0x02b5dfd0), TOBN(0xe389cfbe, 0x69143c86), - TOBN(0xd01b6405, 0x941768d8), TOBN(0x45103995, 0x03bf825d), - TOBN(0xcc4ee166, 0x56cd17e2), TOBN(0xbea3c283, 0xba037e79), - TOBN(0x4e1ac06e, 0xd9a47520), TOBN(0xfbfe18aa, 0xaf852404), - TOBN(0x5615f8e2, 0x8087648a), TOBN(0x7301e47e, 0xb9d150d9), - TOBN(0x79f9f9dd, 0xb299b977), TOBN(0x76697a7b, 0xa5b78314), - TOBN(0x10d67468, 0x7d7c90e7), TOBN(0x7afffe03, 0x937210b5), - TOBN(0x5aef3e4b, 0x28c22cee), TOBN(0xefb0ecd8, 0x09fd55ae), - TOBN(0x4cea7132, 0x0d2a5d6a), TOBN(0x9cfb5fa1, 0x01db6357), - TOBN(0x395e0b57, 0xf36e1ac5), TOBN(0x008fa9ad, 0x36cafb7d), - TOBN(0x8f6cdf70, 0x5308c4db), TOBN(0x51527a37, 0x95ed2477), - TOBN(0xba0dee30, 0x5bd21311), TOBN(0x6ed41b22, 0x909c90d7), - TOBN(0xc5f6b758, 0x7c8696d3), TOBN(0x0db8eaa8, 0x3ce83a80), - TOBN(0xd297fe37, 0xb24b4b6f), TOBN(0xfe58afe8, 0x522d1f0d), - TOBN(0x97358736, 0x8c98dbd9), TOBN(0x6bc226ca, 0x9454a527), - TOBN(0xa12b384e, 0xce53c2d0), TOBN(0x779d897d, 0x5e4606da), - TOBN(0xa53e47b0, 0x73ec12b0), TOBN(0x462dbbba, 0x5756f1ad), - TOBN(0x69fe09f2, 0xcafe37b6), TOBN(0x273d1ebf, 0xecce2e17), - TOBN(0x8ac1d538, 0x3cf607fd), TOBN(0x8035f7ff, 0x12e10c25)}, - {TOBN(0x854d34c7, 0x7e6c5520), TOBN(0xc27df9ef, 0xdcb9ea58), - TOBN(0x405f2369, 0xd686666d), TOBN(0x29d1febf, 0x0417aa85), - TOBN(0x9846819e, 0x93470afe), TOBN(0x3e6a9669, 0xe2a27f9e), - TOBN(0x24d008a2, 0xe31e6504), TOBN(0xdba7cecf, 0x9cb7680a), - TOBN(0xecaff541, 0x338d6e43), TOBN(0x56f7dd73, 0x4541d5cc), - TOBN(0xb5d426de, 0x96bc88ca), TOBN(0x48d94f6b, 0x9ed3a2c3), - TOBN(0x6354a3bb, 0x2ef8279c), TOBN(0xd575465b, 0x0b1867f2), - TOBN(0xef99b0ff, 0x95225151), TOBN(0xf3e19d88, 0xf94500d8), - TOBN(0x92a83268, 0xe32dd620), TOBN(0x913ec99f, 0x627849a2), - TOBN(0xedd8fdfa, 0x2c378882), TOBN(0xaf96f33e, 0xee6f8cfe), - TOBN(0xc06737e5, 0xdc3fa8a5), TOBN(0x236bb531, 0xb0b03a1d), - TOBN(0x33e59f29, 0x89f037b0), TOBN(0x13f9b5a7, 0xd9a12a53), - TOBN(0x0d0df6ce, 0x51efb310), TOBN(0xcb5b2eb4, 0x958df5be), - TOBN(0xd6459e29, 0x36158e59), TOBN(0x82aae2b9, 0x1466e336), - TOBN(0xfb658a39, 0x411aa636), TOBN(0x7152ecc5, 0xd4c0a933), - TOBN(0xf10c758a, 0x49f026b7), TOBN(0xf4837f97, 0xcb09311f), - TOBN(0xddfb02c4, 0xc753c45f), TOBN(0x18ca81b6, 0xf9c840fe), - TOBN(0x846fd09a, 0xb0f8a3e6), TOBN(0xb1162add, 0xe7733dbc), - TOBN(0x7070ad20, 0x236e3ab6), TOBN(0xf88cdaf5, 0xb2a56326), - TOBN(0x05fc8719, 0x997cbc7a), TOBN(0x442cd452, 0x4b665272), - TOBN(0x7807f364, 0xb71698f5), TOBN(0x6ba418d2, 0x9f7b605e), - TOBN(0xfd20b00f, 0xa03b2cbb), TOBN(0x883eca37, 0xda54386f), - TOBN(0xff0be43f, 0xf3437f24), TOBN(0xe910b432, 0xa48bb33c), - TOBN(0x4963a128, 0x329df765), TOBN(0xac1dd556, 0xbe2fe6f7), - TOBN(0x557610f9, 0x24a0a3fc), TOBN(0x38e17bf4, 0xe881c3f9), - TOBN(0x6ba84faf, 0xed0dac99), TOBN(0xd4a222c3, 0x59eeb918), - TOBN(0xc79c1dbe, 0x13f542b6), TOBN(0x1fc65e0d, 0xe425d457), - TOBN(0xeffb754f, 0x1debb779), TOBN(0x638d8fd0, 0x9e08af60), - TOBN(0x994f523a, 0x626332d5), TOBN(0x7bc38833, 0x5561bb44), - TOBN(0x005ed4b0, 0x3d845ea2), TOBN(0xd39d3ee1, 0xc2a1f08a), - TOBN(0x6561fdd3, 0xe7676b0d), TOBN(0x620e35ff, 0xfb706017), - TOBN(0x36ce424f, 0xf264f9a8), TOBN(0xc4c3419f, 0xda2681f7), - TOBN(0xfb6afd2f, 0x69beb6e8), TOBN(0x3a50b993, 0x6d700d03), - TOBN(0xc840b2ad, 0x0c83a14f), TOBN(0x573207be, 0x54085bef), - TOBN(0x5af882e3, 0x09fe7e5b), TOBN(0x957678a4, 0x3b40a7e1), - TOBN(0x172d4bdd, 0x543056e2), TOBN(0x9c1b26b4, 0x0df13c0a), - TOBN(0x1c30861c, 0xf405ff06), TOBN(0xebac86bd, 0x486e828b), - TOBN(0xe791a971, 0x636933fc), TOBN(0x50e7c2be, 0x7aeee947), - TOBN(0xc3d4a095, 0xfa90d767), TOBN(0xae60eb7b, 0xe670ab7b), - TOBN(0x17633a64, 0x397b056d), TOBN(0x93a21f33, 0x105012aa), - TOBN(0x663c370b, 0xabb88643), TOBN(0x91df36d7, 0x22e21599), - TOBN(0x183ba835, 0x8b761671), TOBN(0x381eea1d, 0x728f3bf1), - TOBN(0xb9b2f1ba, 0x39966e6c), TOBN(0x7c464a28, 0xe7295492), - TOBN(0x0fd5f70a, 0x09b26b7f), TOBN(0xa9aba1f9, 0xfbe009df), - TOBN(0x857c1f22, 0x369b87ad), TOBN(0x3c00e5d9, 0x32fca556), - TOBN(0x1ad74cab, 0x90b06466), TOBN(0xa7112386, 0x550faaf2), - TOBN(0x7435e198, 0x6d9bd5f5), TOBN(0x2dcc7e38, 0x59c3463f), - TOBN(0xdc7df748, 0xca7bd4b2), TOBN(0x13cd4c08, 0x9dec2f31), - TOBN(0x0d3b5df8, 0xe3237710), TOBN(0x0dadb26e, 0xcbd2f7b0), - TOBN(0x9f5966ab, 0xe4aa082b), TOBN(0x666ec8de, 0x350e966e), - TOBN(0x1bfd1ed5, 0xee524216), TOBN(0xcd93c59b, 0x41dab0b6), - TOBN(0x658a8435, 0xd186d6ba), TOBN(0x1b7d34d2, 0x159d1195), - TOBN(0x5936e460, 0x22caf46b), TOBN(0x6a45dd8f, 0x9a96fe4f), - TOBN(0xf7925434, 0xb98f474e), TOBN(0x41410412, 0x0053ef15), - TOBN(0x71cf8d12, 0x41de97bf), TOBN(0xb8547b61, 0xbd80bef4), - TOBN(0xb47d3970, 0xc4db0037), TOBN(0xf1bcd328, 0xfef20dff), - TOBN(0x31a92e09, 0x10caad67), TOBN(0x1f591960, 0x5531a1e1), - TOBN(0x3bb852e0, 0x5f4fc840), TOBN(0x63e297ca, 0x93a72c6c), - TOBN(0x3c2b0b2e, 0x49abad67), TOBN(0x6ec405fc, 0xed3db0d9), - TOBN(0xdc14a530, 0x7fef1d40), TOBN(0xccd19846, 0x280896fc), - TOBN(0x00f83176, 0x9bb81648), TOBN(0xd69eb485, 0x653120d0), - TOBN(0xd17d75f4, 0x4ccabc62), TOBN(0x34a07f82, 0xb749fcb1), - TOBN(0x2c3af787, 0xbbfb5554), TOBN(0xb06ed4d0, 0x62e283f8), - TOBN(0x5722889f, 0xa19213a0), TOBN(0x162b085e, 0xdcf3c7b4), - TOBN(0xbcaecb31, 0xe0dd3eca), TOBN(0xc6237fbc, 0xe52f13a5), - TOBN(0xcc2b6b03, 0x27bac297), TOBN(0x2ae1cac5, 0xb917f54a), - TOBN(0x474807d4, 0x7845ae4f), TOBN(0xfec7dd92, 0xce5972e0), - TOBN(0xc3bd2541, 0x1d7915bb), TOBN(0x66f85dc4, 0xd94907ca), - TOBN(0xd981b888, 0xbdbcf0ca), TOBN(0xd75f5da6, 0xdf279e9f), - TOBN(0x128bbf24, 0x7054e934), TOBN(0x3c6ff6e5, 0x81db134b), - TOBN(0x795b7cf4, 0x047d26e4), TOBN(0xf370f7b8, 0x5049ec37), - TOBN(0xc6712d4d, 0xced945af), TOBN(0xdf30b5ec, 0x095642bc), - TOBN(0x9b034c62, 0x4896246e), TOBN(0x5652c016, 0xee90bbd1), - TOBN(0xeb38636f, 0x87fedb73), TOBN(0x5e32f847, 0x0135a613), - TOBN(0x0703b312, 0xcf933c83), TOBN(0xd05bb76e, 0x1a7f47e6), - TOBN(0x825e4f0c, 0x949c2415), TOBN(0x569e5622, 0x7250d6f8), - TOBN(0xbbe9eb3a, 0x6568013e), TOBN(0x8dbd203f, 0x22f243fc), - TOBN(0x9dbd7694, 0xb342734a), TOBN(0x8f6d12f8, 0x46afa984), - TOBN(0xb98610a2, 0xc9eade29), TOBN(0xbab4f323, 0x47dd0f18), - TOBN(0x5779737b, 0x671c0d46), TOBN(0x10b6a7c6, 0xd3e0a42a), - TOBN(0xfb19ddf3, 0x3035b41c), TOBN(0xd336343f, 0x99c45895), - TOBN(0x61fe4938, 0x54c857e5), TOBN(0xc4d506be, 0xae4e57d5), - TOBN(0x3cd8c8cb, 0xbbc33f75), TOBN(0x7281f08a, 0x9262c77d), - TOBN(0x083f4ea6, 0xf11a2823), TOBN(0x8895041e, 0x9fba2e33), - TOBN(0xfcdfea49, 0x9c438edf), TOBN(0x7678dcc3, 0x91edba44), - TOBN(0xf07b3b87, 0xe2ba50f0), TOBN(0xc13888ef, 0x43948c1b), - TOBN(0xc2135ad4, 0x1140af42), TOBN(0x8e5104f3, 0x926ed1a7), - TOBN(0xf24430cb, 0x88f6695f), TOBN(0x0ce0637b, 0x6d73c120), - TOBN(0xb2db01e6, 0xfe631e8f), TOBN(0x1c5563d7, 0xd7bdd24b), - TOBN(0x8daea3ba, 0x369ad44f), TOBN(0x000c81b6, 0x8187a9f9), - TOBN(0x5f48a951, 0xaae1fd9a), TOBN(0xe35626c7, 0x8d5aed8a), - TOBN(0x20952763, 0x0498c622), TOBN(0x76d17634, 0x773aa504), - TOBN(0x36d90dda, 0xeb300f7a), TOBN(0x9dcf7dfc, 0xedb5e801), - TOBN(0x645cb268, 0x74d5244c), TOBN(0xa127ee79, 0x348e3aa2), - TOBN(0x488acc53, 0x575f1dbb), TOBN(0x95037e85, 0x80e6161e), - TOBN(0x57e59283, 0x292650d0), TOBN(0xabe67d99, 0x14938216), - TOBN(0x3c7f944b, 0x3f8e1065), TOBN(0xed908cb6, 0x330e8924), - TOBN(0x08ee8fd5, 0x6f530136), TOBN(0x2227b7d5, 0xd7ffc169), - TOBN(0x4f55c893, 0xb5cd6dd5), TOBN(0x82225e11, 0xa62796e8), - TOBN(0x5c6cead1, 0xcb18e12c), TOBN(0x4381ae0c, 0x84f5a51a), - TOBN(0x345913d3, 0x7fafa4c8), TOBN(0x3d918082, 0x0491aac0), - TOBN(0x9347871f, 0x3e69264c), TOBN(0xbea9dd3c, 0xb4f4f0cd), - TOBN(0xbda5d067, 0x3eadd3e7), TOBN(0x0033c1b8, 0x0573bcd8), - TOBN(0x25589379, 0x5da2486c), TOBN(0xcb89ee5b, 0x86abbee7), - TOBN(0x8fe0a8f3, 0x22532e5d), TOBN(0xb6410ff0, 0x727dfc4c), - TOBN(0x619b9d58, 0x226726db), TOBN(0x5ec25669, 0x7a2b2dc7), - TOBN(0xaf4d2e06, 0x4c3beb01), TOBN(0x852123d0, 0x7acea556), - TOBN(0x0e9470fa, 0xf783487a), TOBN(0x75a7ea04, 0x5664b3eb), - TOBN(0x4ad78f35, 0x6798e4ba), TOBN(0x9214e6e5, 0xc7d0e091), - TOBN(0xc420b488, 0xb1290403), TOBN(0x64049e0a, 0xfc295749), - TOBN(0x03ef5af1, 0x3ae9841f), TOBN(0xdbe4ca19, 0xb0b662a6), - TOBN(0x46845c5f, 0xfa453458), TOBN(0xf8dabf19, 0x10b66722), - TOBN(0xb650f0aa, 0xcce2793b), TOBN(0x71db851e, 0xc5ec47c1), - TOBN(0x3eb78f3e, 0x3b234fa9), TOBN(0xb0c60f35, 0xfc0106ce), - TOBN(0x05427121, 0x774eadbd), TOBN(0x25367faf, 0xce323863), - TOBN(0x7541b5c9, 0xcd086976), TOBN(0x4ff069e2, 0xdc507ad1), - TOBN(0x74145256, 0x8776e667), TOBN(0x6e76142c, 0xb23c6bb5), - TOBN(0xdbf30712, 0x1b3a8a87), TOBN(0x60e7363e, 0x98450836), - TOBN(0x5741450e, 0xb7366d80), TOBN(0xe4ee14ca, 0x4837dbdf), - TOBN(0xa765eb9b, 0x69d4316f), TOBN(0x04548dca, 0x8ef43825), - TOBN(0x9c9f4e4c, 0x5ae888eb), TOBN(0x733abb51, 0x56e9ac99), - TOBN(0xdaad3c20, 0xba6ac029), TOBN(0x9b8dd3d3, 0x2ba3e38e), - TOBN(0xa9bb4c92, 0x0bc5d11a), TOBN(0xf20127a7, 0x9c5f88a3), - TOBN(0x4f52b06e, 0x161d3cb8), TOBN(0x26c1ff09, 0x6afaf0a6), - TOBN(0x32670d2f, 0x7189e71f), TOBN(0xc6438748, 0x5ecf91e7), - TOBN(0x15758e57, 0xdb757a21), TOBN(0x427d09f8, 0x290a9ce5), - TOBN(0x846a308f, 0x38384a7a), TOBN(0xaac3acb4, 0xb0732b99), - TOBN(0x9e941009, 0x17845819), TOBN(0x95cba111, 0xa7ce5e03), - TOBN(0x6f3d4f7f, 0xb00009c4), TOBN(0xb8396c27, 0x8ff28b5f), - TOBN(0xb1a9ae43, 0x1c97975d), TOBN(0x9d7ba8af, 0xe5d9fed5), - TOBN(0x338cf09f, 0x34f485b6), TOBN(0xbc0ddacc, 0x64122516), - TOBN(0xa450da12, 0x05d471fe), TOBN(0x4c3a6250, 0x628dd8c9), - TOBN(0x69c7d103, 0xd1295837), TOBN(0xa2893e50, 0x3807eb2f), - TOBN(0xd6e1e1de, 0xbdb41491), TOBN(0xc630745b, 0x5e138235), - TOBN(0xc892109e, 0x48661ae1), TOBN(0x8d17e7eb, 0xea2b2674), - TOBN(0x00ec0f87, 0xc328d6b5), TOBN(0x6d858645, 0xf079ff9e), - TOBN(0x6cdf243e, 0x19115ead), TOBN(0x1ce1393e, 0x4bac4fcf), - TOBN(0x2c960ed0, 0x9c29f25b), TOBN(0x59be4d8e, 0x9d388a05), - TOBN(0x0d46e06c, 0xd0def72b), TOBN(0xb923db5d, 0xe0342748), - TOBN(0xf7d3aacd, 0x936d4a3d), TOBN(0x558519cc, 0x0b0b099e), - TOBN(0x3ea8ebf8, 0x827097ef), TOBN(0x259353db, 0xd054f55d), - TOBN(0x84c89abc, 0x6d2ed089), TOBN(0x5c548b69, 0x8e096a7c), - TOBN(0xd587f616, 0x994b995d), TOBN(0x4d1531f6, 0xa5845601), - TOBN(0x792ab31e, 0x451fd9f0), TOBN(0xc8b57bb2, 0x65adf6ca), - TOBN(0x68440fcb, 0x1cd5ad73), TOBN(0xb9c860e6, 0x6144da4f), - TOBN(0x2ab286aa, 0x8462beb8), TOBN(0xcc6b8fff, 0xef46797f), - TOBN(0xac820da4, 0x20c8a471), TOBN(0x69ae05a1, 0x77ff7faf), - TOBN(0xb9163f39, 0xbfb5da77), TOBN(0xbd03e590, 0x2c73ab7a), - TOBN(0x7e862b5e, 0xb2940d9e), TOBN(0x3c663d86, 0x4b9af564), - TOBN(0xd8309031, 0xbde3033d), TOBN(0x298231b2, 0xd42c5bc6), - TOBN(0x42090d2c, 0x552ad093), TOBN(0xa4799d1c, 0xff854695), - TOBN(0x0a88b5d6, 0xd31f0d00), TOBN(0xf8b40825, 0xa2f26b46), - TOBN(0xec29b1ed, 0xf1bd7218), TOBN(0xd491c53b, 0x4b24c86e), - TOBN(0xd2fe588f, 0x3395ea65), TOBN(0x6f3764f7, 0x4456ef15), - TOBN(0xdb43116d, 0xcdc34800), TOBN(0xcdbcd456, 0xc1e33955), - TOBN(0xefdb5540, 0x74ab286b), TOBN(0x948c7a51, 0xd18c5d7c), - TOBN(0xeb81aa37, 0x7378058e), TOBN(0x41c746a1, 0x04411154), - TOBN(0xa10c73bc, 0xfb828ac7), TOBN(0x6439be91, 0x9d972b29), - TOBN(0x4bf3b4b0, 0x43a2fbad), TOBN(0x39e6dadf, 0x82b5e840), - TOBN(0x4f716408, 0x6397bd4c), TOBN(0x0f7de568, 0x7f1eeccb), - TOBN(0x5865c5a1, 0xd2ffbfc1), TOBN(0xf74211fa, 0x4ccb6451), - TOBN(0x66368a88, 0xc0b32558), TOBN(0x5b539dc2, 0x9ad7812e), - TOBN(0x579483d0, 0x2f3af6f6), TOBN(0x52132078, 0x99934ece), - TOBN(0x50b9650f, 0xdcc9e983), TOBN(0xca989ec9, 0xaee42b8a), - TOBN(0x6a44c829, 0xd6f62f99), TOBN(0x8f06a309, 0x4c2a7c0c), - TOBN(0x4ea2b3a0, 0x98a0cb0a), TOBN(0x5c547b70, 0xbeee8364), - TOBN(0x461d40e1, 0x682afe11), TOBN(0x9e0fc77a, 0x7b41c0a8), - TOBN(0x79e4aefd, 0xe20d5d36), TOBN(0x2916e520, 0x32dd9f63), - TOBN(0xf59e52e8, 0x3f883faf), TOBN(0x396f9639, 0x2b868d35), - TOBN(0xc902a9df, 0x4ca19881), TOBN(0x0fc96822, 0xdb2401a6), - TOBN(0x41237587, 0x66f1c68d), TOBN(0x10fc6de3, 0xfb476c0d), - TOBN(0xf8b6b579, 0x841f5d90), TOBN(0x2ba8446c, 0xfa24f44a), - TOBN(0xa237b920, 0xef4a9975), TOBN(0x60bb6004, 0x2330435f), - TOBN(0xd6f4ab5a, 0xcfb7e7b5), TOBN(0xb2ac5097, 0x83435391), - TOBN(0xf036ee2f, 0xb0d1ea67), TOBN(0xae779a6a, 0x74c56230), - TOBN(0x59bff8c8, 0xab838ae6), TOBN(0xcd83ca99, 0x9b38e6f0), - TOBN(0xbb27bef5, 0xe33deed3), TOBN(0xe6356f6f, 0x001892a8), - TOBN(0xbf3be6cc, 0x7adfbd3e), TOBN(0xaecbc81c, 0x33d1ac9d), - TOBN(0xe4feb909, 0xe6e861dc), TOBN(0x90a247a4, 0x53f5f801), - TOBN(0x01c50acb, 0x27346e57), TOBN(0xce29242e, 0x461acc1b), - TOBN(0x04dd214a, 0x2f998a91), TOBN(0x271ee9b1, 0xd4baf27b), - TOBN(0x7e3027d1, 0xe8c26722), TOBN(0x21d1645c, 0x1820dce5), - TOBN(0x086f242c, 0x7501779c), TOBN(0xf0061407, 0xfa0e8009), - TOBN(0xf23ce477, 0x60187129), TOBN(0x05bbdedb, 0x0fde9bd0), - TOBN(0x682f4832, 0x25d98473), TOBN(0xf207fe85, 0x5c658427), - TOBN(0xb6fdd7ba, 0x4166ffa1), TOBN(0x0c314056, 0x9eed799d), - TOBN(0x0db8048f, 0x4107e28f), TOBN(0x74ed3871, 0x41216840), - TOBN(0x74489f8f, 0x56a3c06e), TOBN(0x1e1c005b, 0x12777134), - TOBN(0xdb332a73, 0xf37ec3c3), TOBN(0xc65259bd, 0xdd59eba0), - TOBN(0x2291709c, 0xdb4d3257), TOBN(0x9a793b25, 0xbd389390), - TOBN(0xf39fe34b, 0xe43756f0), TOBN(0x2f76bdce, 0x9afb56c9), - TOBN(0x9f37867a, 0x61208b27), TOBN(0xea1d4307, 0x089972c3), - TOBN(0x8c595330, 0x8bdf623a), TOBN(0x5f5accda, 0x8441fb7d), - TOBN(0xfafa9418, 0x32ddfd95), TOBN(0x6ad40c5a, 0x0fde9be7), - TOBN(0x43faba89, 0xaeca8709), TOBN(0xc64a7cf1, 0x2c248a9d), - TOBN(0x16620252, 0x72637a76), TOBN(0xaee1c791, 0x22b8d1bb), - TOBN(0xf0f798fd, 0x21a843b2), TOBN(0x56e4ed4d, 0x8d005cb1), - TOBN(0x355f7780, 0x1f0d8abe), TOBN(0x197b04cf, 0x34522326), - TOBN(0x41f9b31f, 0xfd42c13f), TOBN(0x5ef7feb2, 0xb40f933d), - TOBN(0x27326f42, 0x5d60bad4), TOBN(0x027ecdb2, 0x8c92cf89), - TOBN(0x04aae4d1, 0x4e3352fe), TOBN(0x08414d2f, 0x73591b90), - TOBN(0x5ed6124e, 0xb7da7d60), TOBN(0xb985b931, 0x4d13d4ec), - TOBN(0xa592d3ab, 0x96bf36f9), TOBN(0x012dbed5, 0xbbdf51df), - TOBN(0xa57963c0, 0xdf6c177d), TOBN(0x010ec869, 0x87ca29cf), - TOBN(0xba1700f6, 0xbf926dff), TOBN(0x7c9fdbd1, 0xf4bf6bc2), - TOBN(0xdc18dc8f, 0x64da11f5), TOBN(0xa6074b7a, 0xd938ae75), - TOBN(0x14270066, 0xe84f44a4), TOBN(0x99998d38, 0xd27b954e), - TOBN(0xc1be8ab2, 0xb4f38e9a), TOBN(0x8bb55bbf, 0x15c01016), - TOBN(0xf73472b4, 0x0ea2ab30), TOBN(0xd365a340, 0xf73d68dd), - TOBN(0xc01a7168, 0x19c2e1eb), TOBN(0x32f49e37, 0x34061719), - TOBN(0xb73c57f1, 0x01d8b4d6), TOBN(0x03c8423c, 0x26b47700), - TOBN(0x321d0bc8, 0xa4d8826a), TOBN(0x6004213c, 0x4bc0e638), - TOBN(0xf78c64a1, 0xc1c06681), TOBN(0x16e0a16f, 0xef018e50), - TOBN(0x31cbdf91, 0xdb42b2b3), TOBN(0xf8f4ffce, 0xe0d36f58), - TOBN(0xcdcc71cd, 0x4cc5e3e0), TOBN(0xd55c7cfa, 0xa129e3e0), - TOBN(0xccdb6ba0, 0x0fb2cbf1), TOBN(0x6aba0005, 0xc4bce3cb), - TOBN(0x501cdb30, 0xd232cfc4), TOBN(0x9ddcf12e, 0xd58a3cef), - TOBN(0x02d2cf9c, 0x87e09149), TOBN(0xdc5d7ec7, 0x2c976257), - TOBN(0x6447986e, 0x0b50d7dd), TOBN(0x88fdbaf7, 0x807f112a), - TOBN(0x58c9822a, 0xb00ae9f6), TOBN(0x6abfb950, 0x6d3d27e0), - TOBN(0xd0a74487, 0x8a429f4f), TOBN(0x0649712b, 0xdb516609), - TOBN(0xb826ba57, 0xe769b5df), TOBN(0x82335df2, 0x1fc7aaf2), - TOBN(0x2389f067, 0x5c93d995), TOBN(0x59ac367a, 0x68677be6), - TOBN(0xa77985ff, 0x21d9951b), TOBN(0x038956fb, 0x85011cce), - TOBN(0x608e48cb, 0xbb734e37), TOBN(0xc08c0bf2, 0x2be5b26f), - TOBN(0x17bbdd3b, 0xf9b1a0d9), TOBN(0xeac7d898, 0x10483319), - TOBN(0xc95c4baf, 0xbc1a6dea), TOBN(0xfdd0e2bf, 0x172aafdb), - TOBN(0x40373cbc, 0x8235c41a), TOBN(0x14303f21, 0xfb6f41d5), - TOBN(0xba063621, 0x0408f237), TOBN(0xcad3b09a, 0xecd2d1ed), - TOBN(0x4667855a, 0x52abb6a2), TOBN(0xba9157dc, 0xaa8b417b), - TOBN(0xfe7f3507, 0x4f013efb), TOBN(0x1b112c4b, 0xaa38c4a2), - TOBN(0xa1406a60, 0x9ba64345), TOBN(0xe53cba33, 0x6993c80b), - TOBN(0x45466063, 0xded40d23), TOBN(0x3d5f1f4d, 0x54908e25), - TOBN(0x9ebefe62, 0x403c3c31), TOBN(0x274ea0b5, 0x0672a624), - TOBN(0xff818d99, 0x451d1b71), TOBN(0x80e82643, 0x8f79cf79), - TOBN(0xa165df13, 0x73ce37f5), TOBN(0xa744ef4f, 0xfe3a21fd), - TOBN(0x73f1e7f5, 0xcf551396), TOBN(0xc616898e, 0x868c676b), - TOBN(0x671c28c7, 0x8c442c36), TOBN(0xcfe5e558, 0x5e0a317d), - TOBN(0x1242d818, 0x7051f476), TOBN(0x56fad2a6, 0x14f03442), - TOBN(0x262068bc, 0x0a44d0f6), TOBN(0xdfa2cd6e, 0xce6edf4e), - TOBN(0x0f43813a, 0xd15d1517), TOBN(0x61214cb2, 0x377d44f5), - TOBN(0xd399aa29, 0xc639b35f), TOBN(0x42136d71, 0x54c51c19), - TOBN(0x9774711b, 0x08417221), TOBN(0x0a5546b3, 0x52545a57), - TOBN(0x80624c41, 0x1150582d), TOBN(0x9ec5c418, 0xfbc555bc), - TOBN(0x2c87dcad, 0x771849f1), TOBN(0xb0c932c5, 0x01d7bf6f), - TOBN(0x6aa5cd3e, 0x89116eb2), TOBN(0xd378c25a, 0x51ca7bd3), - TOBN(0xc612a0da, 0x9e6e3e31), TOBN(0x0417a54d, 0xb68ad5d0), - TOBN(0x00451e4a, 0x22c6edb8), TOBN(0x9fbfe019, 0xb42827ce), - TOBN(0x2fa92505, 0xba9384a2), TOBN(0x21b8596e, 0x64ad69c1), - TOBN(0x8f4fcc49, 0x983b35a6), TOBN(0xde093760, 0x72754672), - TOBN(0x2f14ccc8, 0xf7bffe6d), TOBN(0x27566bff, 0x5d94263d), - TOBN(0xb5b4e9c6, 0x2df3ec30), TOBN(0x94f1d7d5, 0x3e6ea6ba), - TOBN(0x97b7851a, 0xaaca5e9b), TOBN(0x518aa521, 0x56713b97), - TOBN(0x3357e8c7, 0x150a61f6), TOBN(0x7842e7e2, 0xec2c2b69), - TOBN(0x8dffaf65, 0x6868a548), TOBN(0xd963bd82, 0xe068fc81), - TOBN(0x64da5c8b, 0x65917733), TOBN(0x927090ff, 0x7b247328)}, - {TOBN(0x214bc9a7, 0xd298c241), TOBN(0xe3b697ba, 0x56807cfd), - TOBN(0xef1c7802, 0x4564eadb), TOBN(0xdde8cdcf, 0xb48149c5), - TOBN(0x946bf0a7, 0x5a4d2604), TOBN(0x27154d7f, 0x6c1538af), - TOBN(0x95cc9230, 0xde5b1fcc), TOBN(0xd88519e9, 0x66864f82), - TOBN(0xb828dd1a, 0x7cb1282c), TOBN(0xa08d7626, 0xbe46973a), - TOBN(0x6baf8d40, 0xe708d6b2), TOBN(0x72571fa1, 0x4daeb3f3), - TOBN(0x85b1732f, 0xf22dfd98), TOBN(0x87ab01a7, 0x0087108d), - TOBN(0xaaaafea8, 0x5988207a), TOBN(0xccc832f8, 0x69f00755), - TOBN(0x964d950e, 0x36ff3bf0), TOBN(0x8ad20f6f, 0xf0b34638), - TOBN(0x4d9177b3, 0xb5d7585f), TOBN(0xcf839760, 0xef3f019f), - TOBN(0x582fc5b3, 0x8288c545), TOBN(0x2f8e4e9b, 0x13116bd1), - TOBN(0xf91e1b2f, 0x332120ef), TOBN(0xcf568724, 0x2a17dd23), - TOBN(0x488f1185, 0xca8d9d1a), TOBN(0xadf2c77d, 0xd987ded2), - TOBN(0x5f3039f0, 0x60c46124), TOBN(0xe5d70b75, 0x71e095f4), - TOBN(0x82d58650, 0x6260e70f), TOBN(0x39d75ea7, 0xf750d105), - TOBN(0x8cf3d0b1, 0x75bac364), TOBN(0xf3a7564d, 0x21d01329), - TOBN(0x182f04cd, 0x2f52d2a7), TOBN(0x4fde149a, 0xe2df565a), - TOBN(0xb80c5eec, 0xa79fb2f7), TOBN(0xab491d7b, 0x22ddc897), - TOBN(0x99d76c18, 0xc6312c7f), TOBN(0xca0d5f3d, 0x6aa41a57), - TOBN(0x71207325, 0xd15363a0), TOBN(0xe82aa265, 0xbeb252c2), - TOBN(0x94ab4700, 0xec3128c2), TOBN(0x6c76d862, 0x8e383f49), - TOBN(0xdc36b150, 0xc03024eb), TOBN(0xfb439477, 0x53daac69), - TOBN(0xfc68764a, 0x8dc79623), TOBN(0x5b86995d, 0xb440fbb2), - TOBN(0xd66879bf, 0xccc5ee0d), TOBN(0x05228942, 0x95aa8bd3), - TOBN(0xb51a40a5, 0x1e6a75c1), TOBN(0x24327c76, 0x0ea7d817), - TOBN(0x06630182, 0x07774597), TOBN(0xd6fdbec3, 0x97fa7164), - TOBN(0x20c99dfb, 0x13c90f48), TOBN(0xd6ac5273, 0x686ef263), - TOBN(0xc6a50bdc, 0xfef64eeb), TOBN(0xcd87b281, 0x86fdfc32), - TOBN(0xb24aa43e, 0x3fcd3efc), TOBN(0xdd26c034, 0xb8088e9a), - TOBN(0xa5ef4dc9, 0xbd3d46ea), TOBN(0xa2f99d58, 0x8a4c6a6f), - TOBN(0xddabd355, 0x2f1da46c), TOBN(0x72c3f8ce, 0x1afacdd1), - TOBN(0xd90c4eee, 0x92d40578), TOBN(0xd28bb41f, 0xca623b94), - TOBN(0x50fc0711, 0x745edc11), TOBN(0x9dd9ad7d, 0x3dc87558), - TOBN(0xce6931fb, 0xb49d1e64), TOBN(0x6c77a0a2, 0xc98bd0f9), - TOBN(0x62b9a629, 0x6baf7cb1), TOBN(0xcf065f91, 0xccf72d22), - TOBN(0x7203cce9, 0x79639071), TOBN(0x09ae4885, 0xf9cb732f), - TOBN(0x5e7c3bec, 0xee8314f3), TOBN(0x1c068aed, 0xdbea298f), - TOBN(0x08d381f1, 0x7c80acec), TOBN(0x03b56be8, 0xe330495b), - TOBN(0xaeffb8f2, 0x9222882d), TOBN(0x95ff38f6, 0xc4af8bf7), - TOBN(0x50e32d35, 0x1fc57d8c), TOBN(0x6635be52, 0x17b444f0), - TOBN(0x04d15276, 0xa5177900), TOBN(0x4e1dbb47, 0xf6858752), - TOBN(0x5b475622, 0xc615796c), TOBN(0xa6fa0387, 0x691867bf), - TOBN(0xed7f5d56, 0x2844c6d0), TOBN(0xc633cf9b, 0x03a2477d), - TOBN(0xf6be5c40, 0x2d3721d6), TOBN(0xaf312eb7, 0xe9fd68e6), - TOBN(0x242792d2, 0xe7417ce1), TOBN(0xff42bc71, 0x970ee7f5), - TOBN(0x1ff4dc6d, 0x5c67a41e), TOBN(0x77709b7b, 0x20882a58), - TOBN(0x3554731d, 0xbe217f2c), TOBN(0x2af2a8cd, 0x5bb72177), - TOBN(0x58eee769, 0x591dd059), TOBN(0xbb2930c9, 0x4bba6477), - TOBN(0x863ee047, 0x7d930cfc), TOBN(0x4c262ad1, 0x396fd1f4), - TOBN(0xf4765bc8, 0x039af7e1), TOBN(0x2519834b, 0x5ba104f6), - TOBN(0x7cd61b4c, 0xd105f961), TOBN(0xa5415da5, 0xd63bca54), - TOBN(0x778280a0, 0x88a1f17c), TOBN(0xc4968949, 0x2329512c), - TOBN(0x174a9126, 0xcecdaa7a), TOBN(0xfc8c7e0e, 0x0b13247b), - TOBN(0x29c110d2, 0x3484c1c4), TOBN(0xf8eb8757, 0x831dfc3b), - TOBN(0x022f0212, 0xc0067452), TOBN(0x3f6f69ee, 0x7b9b926c), - TOBN(0x09032da0, 0xef42daf4), TOBN(0x79f00ade, 0x83f80de4), - TOBN(0x6210db71, 0x81236c97), TOBN(0x74f7685b, 0x3ee0781f), - TOBN(0x4df7da7b, 0xa3e41372), TOBN(0x2aae38b1, 0xb1a1553e), - TOBN(0x1688e222, 0xf6dd9d1b), TOBN(0x57695448, 0x5b8b6487), - TOBN(0x478d2127, 0x4b2edeaa), TOBN(0xb2818fa5, 0x1e85956a), - TOBN(0x1e6addda, 0xf176f2c0), TOBN(0x01ca4604, 0xe2572658), - TOBN(0x0a404ded, 0x85342ffb), TOBN(0x8cf60f96, 0x441838d6), - TOBN(0x9bbc691c, 0xc9071c4a), TOBN(0xfd588744, 0x34442803), - TOBN(0x97101c85, 0x809c0d81), TOBN(0xa7fb754c, 0x8c456f7f), - TOBN(0xc95f3c5c, 0xd51805e1), TOBN(0xab4ccd39, 0xb299dca8), - TOBN(0x3e03d20b, 0x47eaf500), TOBN(0xfa3165c1, 0xd7b80893), - TOBN(0x005e8b54, 0xe160e552), TOBN(0xdc4972ba, 0x9019d11f), - TOBN(0x21a6972e, 0x0c9a4a7a), TOBN(0xa52c258f, 0x37840fd7), - TOBN(0xf8559ff4, 0xc1e99d81), TOBN(0x08e1a7d6, 0xa3c617c0), - TOBN(0xb398fd43, 0x248c6ba7), TOBN(0x6ffedd91, 0xd1283794), - TOBN(0x8a6a59d2, 0xd629d208), TOBN(0xa9d141d5, 0x3490530e), - TOBN(0x42f6fc18, 0x38505989), TOBN(0x09bf250d, 0x479d94ee), - TOBN(0x223ad3b1, 0xb3822790), TOBN(0x6c5926c0, 0x93b8971c), - TOBN(0x609efc7e, 0x75f7fa62), TOBN(0x45d66a6d, 0x1ec2d989), - TOBN(0x4422d663, 0x987d2792), TOBN(0x4a73caad, 0x3eb31d2b), - TOBN(0xf06c2ac1, 0xa32cb9e6), TOBN(0xd9445c5f, 0x91aeba84), - TOBN(0x6af7a1d5, 0xaf71013f), TOBN(0xe68216e5, 0x0bedc946), - TOBN(0xf4cba30b, 0xd27370a0), TOBN(0x7981afbf, 0x870421cc), - TOBN(0x02496a67, 0x9449f0e1), TOBN(0x86cfc4be, 0x0a47edae), - TOBN(0x3073c936, 0xb1feca22), TOBN(0xf5694612, 0x03f8f8fb), - TOBN(0xd063b723, 0x901515ea), TOBN(0x4c6c77a5, 0x749cf038), - TOBN(0x6361e360, 0xab9e5059), TOBN(0x596cf171, 0xa76a37c0), - TOBN(0x800f53fa, 0x6530ae7a), TOBN(0x0f5e631e, 0x0792a7a6), - TOBN(0x5cc29c24, 0xefdb81c9), TOBN(0xa269e868, 0x3f9c40ba), - TOBN(0xec14f9e1, 0x2cb7191e), TOBN(0x78ea1bd8, 0xe5b08ea6), - TOBN(0x3c65aa9b, 0x46332bb9), TOBN(0x84cc22b3, 0xbf80ce25), - TOBN(0x0098e9e9, 0xd49d5bf1), TOBN(0xcd4ec1c6, 0x19087da4), - TOBN(0x3c9d07c5, 0xaef6e357), TOBN(0x839a0268, 0x9f8f64b8), - TOBN(0xc5e9eb62, 0xc6d8607f), TOBN(0x759689f5, 0x6aa995e4), - TOBN(0x70464669, 0xbbb48317), TOBN(0x921474bf, 0xe402417d), - TOBN(0xcabe135b, 0x2a354c8c), TOBN(0xd51e52d2, 0x812fa4b5), - TOBN(0xec741096, 0x53311fe8), TOBN(0x4f774535, 0xb864514b), - TOBN(0xbcadd671, 0x5bde48f8), TOBN(0xc9703873, 0x2189bc7d), - TOBN(0x5d45299e, 0xc709ee8a), TOBN(0xd1287ee2, 0x845aaff8), - TOBN(0x7d1f8874, 0xdb1dbf1f), TOBN(0xea46588b, 0x990c88d6), - TOBN(0x60ba649a, 0x84368313), TOBN(0xd5fdcbce, 0x60d543ae), - TOBN(0x90b46d43, 0x810d5ab0), TOBN(0x6739d8f9, 0x04d7e5cc), - TOBN(0x021c1a58, 0x0d337c33), TOBN(0x00a61162, 0x68e67c40), - TOBN(0x95ef413b, 0x379f0a1f), TOBN(0xfe126605, 0xe9e2ab95), - TOBN(0x67578b85, 0x2f5f199c), TOBN(0xf5c00329, 0x2cb84913), - TOBN(0xf7956430, 0x37577dd8), TOBN(0x83b82af4, 0x29c5fe88), - TOBN(0x9c1bea26, 0xcdbdc132), TOBN(0x589fa086, 0x9c04339e), - TOBN(0x033e9538, 0xb13799df), TOBN(0x85fa8b21, 0xd295d034), - TOBN(0xdf17f73f, 0xbd9ddcca), TOBN(0xf32bd122, 0xddb66334), - TOBN(0x55ef88a7, 0x858b044c), TOBN(0x1f0d69c2, 0x5aa9e397), - TOBN(0x55fd9cc3, 0x40d85559), TOBN(0xc774df72, 0x7785ddb2), - TOBN(0x5dcce9f6, 0xd3bd2e1c), TOBN(0xeb30da20, 0xa85dfed0), - TOBN(0x5ed7f5bb, 0xd3ed09c4), TOBN(0x7d42a35c, 0x82a9c1bd), - TOBN(0xcf3de995, 0x9890272d), TOBN(0x75f3432a, 0x3e713a10), - TOBN(0x5e13479f, 0xe28227b8), TOBN(0xb8561ea9, 0xfefacdc8), - TOBN(0xa6a297a0, 0x8332aafd), TOBN(0x9b0d8bb5, 0x73809b62), - TOBN(0xd2fa1cfd, 0x0c63036f), TOBN(0x7a16eb55, 0xbd64bda8), - TOBN(0x3f5cf5f6, 0x78e62ddc), TOBN(0x2267c454, 0x07fd752b), - TOBN(0x5e361b6b, 0x5e437bbe), TOBN(0x95c59501, 0x8354e075), - TOBN(0xec725f85, 0xf2b254d9), TOBN(0x844b617d, 0x2cb52b4e), - TOBN(0xed8554f5, 0xcf425fb5), TOBN(0xab67703e, 0x2af9f312), - TOBN(0x4cc34ec1, 0x3cf48283), TOBN(0xb09daa25, 0x9c8a705e), - TOBN(0xd1e9d0d0, 0x5b7d4f84), TOBN(0x4df6ef64, 0xdb38929d), - TOBN(0xe16b0763, 0xaa21ba46), TOBN(0xc6b1d178, 0xa293f8fb), - TOBN(0x0ff5b602, 0xd520aabf), TOBN(0x94d671bd, 0xc339397a), - TOBN(0x7c7d98cf, 0x4f5792fa), TOBN(0x7c5e0d67, 0x11215261), - TOBN(0x9b19a631, 0xa7c5a6d4), TOBN(0xc8511a62, 0x7a45274d), - TOBN(0x0c16621c, 0xa5a60d99), TOBN(0xf7fbab88, 0xcf5e48cb), - TOBN(0xab1e6ca2, 0xf7ddee08), TOBN(0x83bd08ce, 0xe7867f3c), - TOBN(0xf7e48e8a, 0x2ac13e27), TOBN(0x4494f6df, 0x4eb1a9f5), - TOBN(0xedbf84eb, 0x981f0a62), TOBN(0x49badc32, 0x536438f0), - TOBN(0x50bea541, 0x004f7571), TOBN(0xbac67d10, 0xdf1c94ee), - TOBN(0x253d73a1, 0xb727bc31), TOBN(0xb3d01cf2, 0x30686e28), - TOBN(0x51b77b1b, 0x55fd0b8b), TOBN(0xa099d183, 0xfeec3173), - TOBN(0x202b1fb7, 0x670e72b7), TOBN(0xadc88b33, 0xa8e1635f), - TOBN(0x34e8216a, 0xf989d905), TOBN(0xc2e68d20, 0x29b58d01), - TOBN(0x11f81c92, 0x6fe55a93), TOBN(0x15f1462a, 0x8f296f40), - TOBN(0x1915d375, 0xea3d62f2), TOBN(0xa17765a3, 0x01c8977d), - TOBN(0x7559710a, 0xe47b26f6), TOBN(0xe0bd29c8, 0x535077a5), - TOBN(0x615f976d, 0x08d84858), TOBN(0x370dfe85, 0x69ced5c1), - TOBN(0xbbc7503c, 0xa734fa56), TOBN(0xfbb9f1ec, 0x91ac4574), - TOBN(0x95d7ec53, 0x060dd7ef), TOBN(0xeef2dacd, 0x6e657979), - TOBN(0x54511af3, 0xe2a08235), TOBN(0x1e324aa4, 0x1f4aea3d), - TOBN(0x550e7e71, 0xe6e67671), TOBN(0xbccd5190, 0xbf52faf7), - TOBN(0xf880d316, 0x223cc62a), TOBN(0x0d402c7e, 0x2b32eb5d), - TOBN(0xa40bc039, 0x306a5a3b), TOBN(0x4e0a41fd, 0x96783a1b), - TOBN(0xa1e8d39a, 0x0253cdd4), TOBN(0x6480be26, 0xc7388638), - TOBN(0xee365e1d, 0x2285f382), TOBN(0x188d8d8f, 0xec0b5c36), - TOBN(0x34ef1a48, 0x1f0f4d82), TOBN(0x1a8f43e1, 0xa487d29a), - TOBN(0x8168226d, 0x77aefb3a), TOBN(0xf69a751e, 0x1e72c253), - TOBN(0x8e04359a, 0xe9594df1), TOBN(0x475ffd7d, 0xd14c0467), - TOBN(0xb5a2c2b1, 0x3844e95c), TOBN(0x85caf647, 0xdd12ef94), - TOBN(0x1ecd2a9f, 0xf1063d00), TOBN(0x1dd2e229, 0x23843311), - TOBN(0x38f0e09d, 0x73d17244), TOBN(0x3ede7746, 0x8fc653f1), - TOBN(0xae4459f5, 0xdc20e21c), TOBN(0x00db2ffa, 0x6a8599ea), - TOBN(0x11682c39, 0x30cfd905), TOBN(0x4934d074, 0xa5c112a6), - TOBN(0xbdf063c5, 0x568bfe95), TOBN(0x779a440a, 0x016c441a), - TOBN(0x0c23f218, 0x97d6fbdc), TOBN(0xd3a5cd87, 0xe0776aac), - TOBN(0xcee37f72, 0xd712e8db), TOBN(0xfb28c70d, 0x26f74e8d), - TOBN(0xffe0c728, 0xb61301a0), TOBN(0xa6282168, 0xd3724354), - TOBN(0x7ff4cb00, 0x768ffedc), TOBN(0xc51b3088, 0x03b02de9), - TOBN(0xa5a8147c, 0x3902dda5), TOBN(0x35d2f706, 0xfe6973b4), - TOBN(0x5ac2efcf, 0xc257457e), TOBN(0x933f48d4, 0x8700611b), - TOBN(0xc365af88, 0x4912beb2), TOBN(0x7f5a4de6, 0x162edf94), - TOBN(0xc646ba7c, 0x0c32f34b), TOBN(0x632c6af3, 0xb2091074), - TOBN(0x58d4f2e3, 0x753e43a9), TOBN(0x70e1d217, 0x24d4e23f), - TOBN(0xb24bf729, 0xafede6a6), TOBN(0x7f4a94d8, 0x710c8b60), - TOBN(0xaad90a96, 0x8d4faa6a), TOBN(0xd9ed0b32, 0xb066b690), - TOBN(0x52fcd37b, 0x78b6dbfd), TOBN(0x0b64615e, 0x8bd2b431), - TOBN(0x228e2048, 0xcfb9fad5), TOBN(0xbeaa386d, 0x240b76bd), - TOBN(0x2d6681c8, 0x90dad7bc), TOBN(0x3e553fc3, 0x06d38f5e), - TOBN(0xf27cdb9b, 0x9d5f9750), TOBN(0x3e85c52a, 0xd28c5b0e), - TOBN(0x190795af, 0x5247c39b), TOBN(0x547831eb, 0xbddd6828), - TOBN(0xf327a227, 0x4a82f424), TOBN(0x36919c78, 0x7e47f89d), - TOBN(0xe4783919, 0x43c7392c), TOBN(0xf101b9aa, 0x2316fefe), - TOBN(0xbcdc9e9c, 0x1c5009d2), TOBN(0xfb55ea13, 0x9cd18345), - TOBN(0xf5b5e231, 0xa3ce77c7), TOBN(0xde6b4527, 0xd2f2cb3d), - TOBN(0x10f6a333, 0x9bb26f5f), TOBN(0x1e85db8e, 0x044d85b6), - TOBN(0xc3697a08, 0x94197e54), TOBN(0x65e18cc0, 0xa7cb4ea8), - TOBN(0xa38c4f50, 0xa471fe6e), TOBN(0xf031747a, 0x2f13439c), - TOBN(0x53c4a6ba, 0xc007318b), TOBN(0xa8da3ee5, 0x1deccb3d), - TOBN(0x0555b31c, 0x558216b1), TOBN(0x90c7810c, 0x2f79e6c2), - TOBN(0x9b669f4d, 0xfe8eed3c), TOBN(0x70398ec8, 0xe0fac126), - TOBN(0xa96a449e, 0xf701b235), TOBN(0x0ceecdb3, 0xeb94f395), - TOBN(0x285fc368, 0xd0cb7431), TOBN(0x0d37bb52, 0x16a18c64), - TOBN(0x05110d38, 0xb880d2dd), TOBN(0xa60f177b, 0x65930d57), - TOBN(0x7da34a67, 0xf36235f5), TOBN(0x47f5e17c, 0x183816b9), - TOBN(0xc7664b57, 0xdb394af4), TOBN(0x39ba215d, 0x7036f789), - TOBN(0x46d2ca0e, 0x2f27b472), TOBN(0xc42647ee, 0xf73a84b7), - TOBN(0x44bc7545, 0x64488f1d), TOBN(0xaa922708, 0xf4cf85d5), - TOBN(0x721a01d5, 0x53e4df63), TOBN(0x649c0c51, 0x5db46ced), - TOBN(0x6bf0d64e, 0x3cffcb6c), TOBN(0xe3bf93fe, 0x50f71d96), - TOBN(0x75044558, 0xbcc194a0), TOBN(0x16ae3372, 0x6afdc554), - TOBN(0xbfc01adf, 0x5ca48f3f), TOBN(0x64352f06, 0xe22a9b84), - TOBN(0xcee54da1, 0xc1099e4a), TOBN(0xbbda54e8, 0xfa1b89c0), - TOBN(0x166a3df5, 0x6f6e55fb), TOBN(0x1ca44a24, 0x20176f88), - TOBN(0x936afd88, 0xdfb7b5ff), TOBN(0xe34c2437, 0x8611d4a0), - TOBN(0x7effbb75, 0x86142103), TOBN(0x6704ba1b, 0x1f34fc4d), - TOBN(0x7c2a468f, 0x10c1b122), TOBN(0x36b3a610, 0x8c6aace9), - TOBN(0xabfcc0a7, 0x75a0d050), TOBN(0x066f9197, 0x3ce33e32), - TOBN(0xce905ef4, 0x29fe09be), TOBN(0x89ee25ba, 0xa8376351), - TOBN(0x2a3ede22, 0xfd29dc76), TOBN(0x7fd32ed9, 0x36f17260), - TOBN(0x0cadcf68, 0x284b4126), TOBN(0x63422f08, 0xa7951fc8), - TOBN(0x562b24f4, 0x0807e199), TOBN(0xfe9ce5d1, 0x22ad4490), - TOBN(0xc2f51b10, 0x0db2b1b4), TOBN(0xeb3613ff, 0xe4541d0d), - TOBN(0xbd2c4a05, 0x2680813b), TOBN(0x527aa55d, 0x561b08d6), - TOBN(0xa9f8a40e, 0xa7205558), TOBN(0xe3eea56f, 0x243d0bec), - TOBN(0x7b853817, 0xa0ff58b3), TOBN(0xb67d3f65, 0x1a69e627), - TOBN(0x0b76bbb9, 0xa869b5d6), TOBN(0xa3afeb82, 0x546723ed), - TOBN(0x5f24416d, 0x3e554892), TOBN(0x8413b53d, 0x430e2a45), - TOBN(0x99c56aee, 0x9032a2a0), TOBN(0x09432bf6, 0xeec367b1), - TOBN(0x552850c6, 0xdaf0ecc1), TOBN(0x49ebce55, 0x5bc92048), - TOBN(0xdfb66ba6, 0x54811307), TOBN(0x1b84f797, 0x6f298597), - TOBN(0x79590481, 0x8d1d7a0d), TOBN(0xd9fabe03, 0x3a6fa556), - TOBN(0xa40f9c59, 0xba9e5d35), TOBN(0xcb1771c1, 0xf6247577), - TOBN(0x542a47ca, 0xe9a6312b), TOBN(0xa34b3560, 0x552dd8c5), - TOBN(0xfdf94de0, 0x0d794716), TOBN(0xd46124a9, 0x9c623094), - TOBN(0x56b7435d, 0x68afe8b4), TOBN(0x27f20540, 0x6c0d8ea1), - TOBN(0x12b77e14, 0x73186898), TOBN(0xdbc3dd46, 0x7479490f), - TOBN(0x951a9842, 0xc03b0c05), TOBN(0x8b1b3bb3, 0x7921bc96), - TOBN(0xa573b346, 0x2b202e0a), TOBN(0x77e4665d, 0x47254d56), - TOBN(0x08b70dfc, 0xd23e3984), TOBN(0xab86e8bc, 0xebd14236), - TOBN(0xaa3e07f8, 0x57114ba7), TOBN(0x5ac71689, 0xab0ef4f2), - TOBN(0x88fca384, 0x0139d9af), TOBN(0x72733f88, 0x76644af0), - TOBN(0xf122f72a, 0x65d74f4a), TOBN(0x13931577, 0xa5626c7a), - TOBN(0xd5b5d9eb, 0x70f8d5a4), TOBN(0x375adde7, 0xd7bbb228), - TOBN(0x31e88b86, 0x0c1c0b32), TOBN(0xd1f568c4, 0x173edbaa), - TOBN(0x1592fc83, 0x5459df02), TOBN(0x2beac0fb, 0x0fcd9a7e), - TOBN(0xb0a6fdb8, 0x1b473b0a), TOBN(0xe3224c6f, 0x0fe8fc48), - TOBN(0x680bd00e, 0xe87edf5b), TOBN(0x30385f02, 0x20e77cf5), - TOBN(0xe9ab98c0, 0x4d42d1b2), TOBN(0x72d191d2, 0xd3816d77), - TOBN(0x1564daca, 0x0917d9e5), TOBN(0x394eab59, 0x1f8fed7f), - TOBN(0xa209aa8d, 0x7fbb3896), TOBN(0x5564f3b9, 0xbe6ac98e), - TOBN(0xead21d05, 0xd73654ef), TOBN(0x68d1a9c4, 0x13d78d74), - TOBN(0x61e01708, 0x6d4973a0), TOBN(0x83da3500, 0x46e6d32a), - TOBN(0x6a3dfca4, 0x68ae0118), TOBN(0xa1b9a4c9, 0xd02da069), - TOBN(0x0b2ff9c7, 0xebab8302), TOBN(0x98af07c3, 0x944ba436), - TOBN(0x85997326, 0x995f0f9f), TOBN(0x467fade0, 0x71b58bc6), - TOBN(0x47e4495a, 0xbd625a2b), TOBN(0xfdd2d01d, 0x33c3b8cd), - TOBN(0x2c38ae28, 0xc693f9fa), TOBN(0x48622329, 0x348f7999), - TOBN(0x97bf738e, 0x2161f583), TOBN(0x15ee2fa7, 0x565e8cc9), - TOBN(0xa1a5c845, 0x5777e189), TOBN(0xcc10bee0, 0x456f2829), - TOBN(0x8ad95c56, 0xda762bd5), TOBN(0x152e2214, 0xe9d91da8), - TOBN(0x975b0e72, 0x7cb23c74), TOBN(0xfd5d7670, 0xa90c66df), - TOBN(0xb5b5b8ad, 0x225ffc53), TOBN(0xab6dff73, 0xfaded2ae), - TOBN(0xebd56781, 0x6f4cbe9d), TOBN(0x0ed8b249, 0x6a574bd7), - TOBN(0x41c246fe, 0x81a881fa), TOBN(0x91564805, 0xc3db9c70), - TOBN(0xd7c12b08, 0x5b862809), TOBN(0x1facd1f1, 0x55858d7b), - TOBN(0x7693747c, 0xaf09e92a), TOBN(0x3b69dcba, 0x189a425f), - TOBN(0x0be28e9f, 0x967365ef), TOBN(0x57300eb2, 0xe801f5c9), - TOBN(0x93b8ac6a, 0xd583352f), TOBN(0xa2cf1f89, 0xcd05b2b7), - TOBN(0x7c0c9b74, 0x4dcc40cc), TOBN(0xfee38c45, 0xada523fb), - TOBN(0xb49a4dec, 0x1099cc4d), TOBN(0x325c377f, 0x69f069c6), - TOBN(0xe12458ce, 0x476cc9ff), TOBN(0x580e0b6c, 0xc6d4cb63), - TOBN(0xd561c8b7, 0x9072289b), TOBN(0x0377f264, 0xa619e6da), - TOBN(0x26685362, 0x88e591a5), TOBN(0xa453a7bd, 0x7523ca2b), - TOBN(0x8a9536d2, 0xc1df4533), TOBN(0xc8e50f2f, 0xbe972f79), - TOBN(0xd433e50f, 0x6d3549cf), TOBN(0x6f33696f, 0xfacd665e), - TOBN(0x695bfdac, 0xce11fcb4), TOBN(0x810ee252, 0xaf7c9860), - TOBN(0x65450fe1, 0x7159bb2c), TOBN(0xf7dfbebe, 0x758b357b), - TOBN(0x2b057e74, 0xd69fea72), TOBN(0xd485717a, 0x92731745)}, - {TOBN(0x896c42e8, 0xee36860c), TOBN(0xdaf04dfd, 0x4113c22d), - TOBN(0x1adbb7b7, 0x44104213), TOBN(0xe5fd5fa1, 0x1fd394ea), - TOBN(0x68235d94, 0x1a4e0551), TOBN(0x6772cfbe, 0x18d10151), - TOBN(0x276071e3, 0x09984523), TOBN(0xe4e879de, 0x5a56ba98), - TOBN(0xaaafafb0, 0x285b9491), TOBN(0x01a0be88, 0x1e4c705e), - TOBN(0xff1d4f5d, 0x2ad9caab), TOBN(0x6e349a4a, 0xc37a233f), - TOBN(0xcf1c1246, 0x4a1c6a16), TOBN(0xd99e6b66, 0x29383260), - TOBN(0xea3d4366, 0x5f6d5471), TOBN(0x36974d04, 0xff8cc89b), - TOBN(0xc26c49a1, 0xcfe89d80), TOBN(0xb42c026d, 0xda9c8371), - TOBN(0xca6c013a, 0xdad066d2), TOBN(0xfb8f7228, 0x56a4f3ee), - TOBN(0x08b579ec, 0xd850935b), TOBN(0x34c1a74c, 0xd631e1b3), - TOBN(0xcb5fe596, 0xac198534), TOBN(0x39ff21f6, 0xe1f24f25), - TOBN(0x27f29e14, 0x8f929057), TOBN(0x7a64ae06, 0xc0c853df), - TOBN(0x256cd183, 0x58e9c5ce), TOBN(0x9d9cce82, 0xded092a5), - TOBN(0xcc6e5979, 0x6e93b7c7), TOBN(0xe1e47092, 0x31bb9e27), - TOBN(0xb70b3083, 0xaa9e29a0), TOBN(0xbf181a75, 0x3785e644), - TOBN(0xf53f2c65, 0x8ead09f7), TOBN(0x1335e1d5, 0x9780d14d), - TOBN(0x69cc20e0, 0xcd1b66bc), TOBN(0x9b670a37, 0xbbe0bfc8), - TOBN(0xce53dc81, 0x28efbeed), TOBN(0x0c74e77c, 0x8326a6e5), - TOBN(0x3604e0d2, 0xb88e9a63), TOBN(0xbab38fca, 0x13dc2248), - TOBN(0x8ed6e8c8, 0x5c0a3f1e), TOBN(0xbcad2492, 0x7c87c37f), - TOBN(0xfdfb62bb, 0x9ee3b78d), TOBN(0xeba8e477, 0xcbceba46), - TOBN(0x37d38cb0, 0xeeaede4b), TOBN(0x0bc498e8, 0x7976deb6), - TOBN(0xb2944c04, 0x6b6147fb), TOBN(0x8b123f35, 0xf71f9609), - TOBN(0xa155dcc7, 0xde79dc24), TOBN(0xf1168a32, 0x558f69cd), - TOBN(0xbac21595, 0x0d1850df), TOBN(0x15c8295b, 0xb204c848), - TOBN(0xf661aa36, 0x7d8184ff), TOBN(0xc396228e, 0x30447bdb), - TOBN(0x11cd5143, 0xbde4a59e), TOBN(0xe3a26e3b, 0x6beab5e6), - TOBN(0xd3b3a13f, 0x1402b9d0), TOBN(0x573441c3, 0x2c7bc863), - TOBN(0x4b301ec4, 0x578c3e6e), TOBN(0xc26fc9c4, 0x0adaf57e), - TOBN(0x96e71bfd, 0x7493cea3), TOBN(0xd05d4b3f, 0x1af81456), - TOBN(0xdaca2a8a, 0x6a8c608f), TOBN(0x53ef07f6, 0x0725b276), - TOBN(0x07a5fbd2, 0x7824fc56), TOBN(0x34675218, 0x13289077), - TOBN(0x5bf69fd5, 0xe0c48349), TOBN(0xa613ddd3, 0xb6aa7875), - TOBN(0x7f78c19c, 0x5450d866), TOBN(0x46f4409c, 0x8f84a481), - TOBN(0x9f1d1928, 0x90fce239), TOBN(0x016c4168, 0xb2ce44b9), - TOBN(0xbae023f0, 0xc7435978), TOBN(0xb152c888, 0x20e30e19), - TOBN(0x9c241645, 0xe3fa6faf), TOBN(0x735d95c1, 0x84823e60), - TOBN(0x03197573, 0x03955317), TOBN(0x0b4b02a9, 0xf03b4995), - TOBN(0x076bf559, 0x70274600), TOBN(0x32c5cc53, 0xaaf57508), - TOBN(0xe8af6d1f, 0x60624129), TOBN(0xb7bc5d64, 0x9a5e2b5e), - TOBN(0x3814b048, 0x5f082d72), TOBN(0x76f267f2, 0xce19677a), - TOBN(0x626c630f, 0xb36eed93), TOBN(0x55230cd7, 0x3bf56803), - TOBN(0x78837949, 0xce2736a0), TOBN(0x0d792d60, 0xaa6c55f1), - TOBN(0x0318dbfd, 0xd5c7c5d2), TOBN(0xb38f8da7, 0x072b342d), - TOBN(0x3569bddc, 0x7b8de38a), TOBN(0xf25b5887, 0xa1c94842), - TOBN(0xb2d5b284, 0x2946ad60), TOBN(0x854f29ad, 0xe9d1707e), - TOBN(0xaa5159dc, 0x2c6a4509), TOBN(0x899f94c0, 0x57189837), - TOBN(0xcf6adc51, 0xf4a55b03), TOBN(0x261762de, 0x35e3b2d5), - TOBN(0x4cc43012, 0x04827b51), TOBN(0xcd22a113, 0xc6021442), - TOBN(0xce2fd61a, 0x247c9569), TOBN(0x59a50973, 0xd152beca), - TOBN(0x6c835a11, 0x63a716d4), TOBN(0xc26455ed, 0x187dedcf), - TOBN(0x27f536e0, 0x49ce89e7), TOBN(0x18908539, 0xcc890cb5), - TOBN(0x308909ab, 0xd83c2aa1), TOBN(0xecd3142b, 0x1ab73bd3), - TOBN(0x6a85bf59, 0xb3f5ab84), TOBN(0x3c320a68, 0xf2bea4c6), - TOBN(0xad8dc538, 0x6da4541f), TOBN(0xeaf34eb0, 0xb7c41186), - TOBN(0x1c780129, 0x977c97c4), TOBN(0x5ff9beeb, 0xc57eb9fa), - TOBN(0xa24d0524, 0xc822c478), TOBN(0xfd8eec2a, 0x461cd415), - TOBN(0xfbde194e, 0xf027458c), TOBN(0xb4ff5319, 0x1d1be115), - TOBN(0x63f874d9, 0x4866d6f4), TOBN(0x35c75015, 0xb21ad0c9), - TOBN(0xa6b5c9d6, 0x46ac49d2), TOBN(0x42c77c0b, 0x83137aa9), - TOBN(0x24d000fc, 0x68225a38), TOBN(0x0f63cfc8, 0x2fe1e907), - TOBN(0x22d1b01b, 0xc6441f95), TOBN(0x7d38f719, 0xec8e448f), - TOBN(0x9b33fa5f, 0x787fb1ba), TOBN(0x94dcfda1, 0x190158df), - TOBN(0xc47cb339, 0x5f6d4a09), TOBN(0x6b4f355c, 0xee52b826), - TOBN(0x3d100f5d, 0xf51b930a), TOBN(0xf4512fac, 0x9f668f69), - TOBN(0x546781d5, 0x206c4c74), TOBN(0xd021d4d4, 0xcb4d2e48), - TOBN(0x494a54c2, 0xca085c2d), TOBN(0xf1dbaca4, 0x520850a8), - TOBN(0x63c79326, 0x490a1aca), TOBN(0xcb64dd9c, 0x41526b02), - TOBN(0xbb772591, 0xa2979258), TOBN(0x3f582970, 0x48d97846), - TOBN(0xd66b70d1, 0x7c213ba7), TOBN(0xc28febb5, 0xe8a0ced4), - TOBN(0x6b911831, 0xc10338c1), TOBN(0x0d54e389, 0xbf0126f3), - TOBN(0x7048d460, 0x4af206ee), TOBN(0x786c88f6, 0x77e97cb9), - TOBN(0xd4375ae1, 0xac64802e), TOBN(0x469bcfe1, 0xd53ec11c), - TOBN(0xfc9b340d, 0x47062230), TOBN(0xe743bb57, 0xc5b4a3ac), - TOBN(0xfe00b4aa, 0x59ef45ac), TOBN(0x29a4ef23, 0x59edf188), - TOBN(0x40242efe, 0xb483689b), TOBN(0x2575d3f6, 0x513ac262), - TOBN(0xf30037c8, 0x0ca6db72), TOBN(0xc9fcce82, 0x98864be2), - TOBN(0x84a112ff, 0x0149362d), TOBN(0x95e57582, 0x1c4ae971), - TOBN(0x1fa4b1a8, 0x945cf86c), TOBN(0x4525a734, 0x0b024a2f), - TOBN(0xe76c8b62, 0x8f338360), TOBN(0x483ff593, 0x28edf32b), - TOBN(0x67e8e90a, 0x298b1aec), TOBN(0x9caab338, 0x736d9a21), - TOBN(0x5c09d2fd, 0x66892709), TOBN(0x2496b4dc, 0xb55a1d41), - TOBN(0x93f5fb1a, 0xe24a4394), TOBN(0x08c75049, 0x6fa8f6c1), - TOBN(0xcaead1c2, 0xc905d85f), TOBN(0xe9d7f790, 0x0733ae57), - TOBN(0x24c9a65c, 0xf07cdd94), TOBN(0x7389359c, 0xa4b55931), - TOBN(0xf58709b7, 0x367e45f7), TOBN(0x1f203067, 0xcb7e7adc), - TOBN(0x82444bff, 0xc7b72818), TOBN(0x07303b35, 0xbaac8033), - TOBN(0x1e1ee4e4, 0xd13b7ea1), TOBN(0xe6489b24, 0xe0e74180), - TOBN(0xa5f2c610, 0x7e70ef70), TOBN(0xa1655412, 0xbdd10894), - TOBN(0x555ebefb, 0x7af4194e), TOBN(0x533c1c3c, 0x8e89bd9c), - TOBN(0x735b9b57, 0x89895856), TOBN(0x15fb3cd2, 0x567f5c15), - TOBN(0x057fed45, 0x526f09fd), TOBN(0xe8a4f10c, 0x8128240a), - TOBN(0x9332efc4, 0xff2bfd8d), TOBN(0x214e77a0, 0xbd35aa31), - TOBN(0x32896d73, 0x14faa40e), TOBN(0x767867ec, 0x01e5f186), - TOBN(0xc9adf8f1, 0x17a1813e), TOBN(0xcb6cda78, 0x54741795), - TOBN(0xb7521b6d, 0x349d51aa), TOBN(0xf56b5a9e, 0xe3c7b8e9), - TOBN(0xc6f1e5c9, 0x32a096df), TOBN(0x083667c4, 0xa3635024), - TOBN(0x365ea135, 0x18087f2f), TOBN(0xf1b8eaac, 0xd136e45d), - TOBN(0xc8a0e484, 0x73aec989), TOBN(0xd75a324b, 0x142c9259), - TOBN(0xb7b4d001, 0x01dae185), TOBN(0x45434e0b, 0x9b7a94bc), - TOBN(0xf54339af, 0xfbd8cb0b), TOBN(0xdcc4569e, 0xe98ef49e), - TOBN(0x7789318a, 0x09a51299), TOBN(0x81b4d206, 0xb2b025d8), - TOBN(0xf64aa418, 0xfae85792), TOBN(0x3e50258f, 0xacd7baf7), - TOBN(0xdce84cdb, 0x2996864b), TOBN(0xa2e67089, 0x1f485fa4), - TOBN(0xb28b2bb6, 0x534c6a5a), TOBN(0x31a7ec6b, 0xc94b9d39), - TOBN(0x1d217766, 0xd6bc20da), TOBN(0x4acdb5ec, 0x86761190), - TOBN(0x68726328, 0x73701063), TOBN(0x4d24ee7c, 0x2128c29b), - TOBN(0xc072ebd3, 0xa19fd868), TOBN(0x612e481c, 0xdb8ddd3b), - TOBN(0xb4e1d754, 0x1a64d852), TOBN(0x00ef95ac, 0xc4c6c4ab), - TOBN(0x1536d2ed, 0xaa0a6c46), TOBN(0x61294086, 0x43774790), - TOBN(0x54af25e8, 0x343fda10), TOBN(0x9ff9d98d, 0xfd25d6f2), - TOBN(0x0746af7c, 0x468b8835), TOBN(0x977a31cb, 0x730ecea7), - TOBN(0xa5096b80, 0xc2cf4a81), TOBN(0xaa986833, 0x6458c37a), - TOBN(0x6af29bf3, 0xa6bd9d34), TOBN(0x6a62fe9b, 0x33c5d854), - TOBN(0x50e6c304, 0xb7133b5e), TOBN(0x04b60159, 0x7d6e6848), - TOBN(0x4cd296df, 0x5579bea4), TOBN(0x10e35ac8, 0x5ceedaf1), - TOBN(0x04c4c5fd, 0xe3bcc5b1), TOBN(0x95f9ee8a, 0x89412cf9), - TOBN(0x2c9459ee, 0x82b6eb0f), TOBN(0x2e845765, 0x95c2aadd), - TOBN(0x774a84ae, 0xd327fcfe), TOBN(0xd8c93722, 0x0368d476), - TOBN(0x0dbd5748, 0xf83e8a3b), TOBN(0xa579aa96, 0x8d2495f3), - TOBN(0x535996a0, 0xae496e9b), TOBN(0x07afbfe9, 0xb7f9bcc2), - TOBN(0x3ac1dc6d, 0x5b7bd293), TOBN(0x3b592cff, 0x7022323d), - TOBN(0xba0deb98, 0x9c0a3e76), TOBN(0x18e78e9f, 0x4b197acb), - TOBN(0x211cde10, 0x296c36ef), TOBN(0x7ee89672, 0x82c4da77), - TOBN(0xb617d270, 0xa57836da), TOBN(0xf0cd9c31, 0x9cb7560b), - TOBN(0x01fdcbf7, 0xe455fe90), TOBN(0x3fb53cbb, 0x7e7334f3), - TOBN(0x781e2ea4, 0x4e7de4ec), TOBN(0x8adab3ad, 0x0b384fd0), - TOBN(0x129eee2f, 0x53d64829), TOBN(0x7a471e17, 0xa261492b), - TOBN(0xe4f9adb9, 0xe4cb4a2c), TOBN(0x3d359f6f, 0x97ba2c2d), - TOBN(0x346c6786, 0x0aacd697), TOBN(0x92b444c3, 0x75c2f8a8), - TOBN(0xc79fa117, 0xd85df44e), TOBN(0x56782372, 0x398ddf31), - TOBN(0x60e690f2, 0xbbbab3b8), TOBN(0x4851f8ae, 0x8b04816b), - TOBN(0xc72046ab, 0x9c92e4d2), TOBN(0x518c74a1, 0x7cf3136b), - TOBN(0xff4eb50a, 0xf9877d4c), TOBN(0x14578d90, 0xa919cabb), - TOBN(0x8218f8c4, 0xac5eb2b6), TOBN(0xa3ccc547, 0x542016e4), - TOBN(0x025bf48e, 0x327f8349), TOBN(0xf3e97346, 0xf43cb641), - TOBN(0xdc2bafdf, 0x500f1085), TOBN(0x57167876, 0x2f063055), - TOBN(0x5bd914b9, 0x411925a6), TOBN(0x7c078d48, 0xa1123de5), - TOBN(0xee6bf835, 0x182b165d), TOBN(0xb11b5e5b, 0xba519727), - TOBN(0xe33ea76c, 0x1eea7b85), TOBN(0x2352b461, 0x92d4f85e), - TOBN(0xf101d334, 0xafe115bb), TOBN(0xfabc1294, 0x889175a3), - TOBN(0x7f6bcdc0, 0x5233f925), TOBN(0xe0a802db, 0xe77fec55), - TOBN(0xbdb47b75, 0x8069b659), TOBN(0x1c5e12de, 0xf98fbd74), - TOBN(0x869c58c6, 0x4b8457ee), TOBN(0xa5360f69, 0x4f7ea9f7), - TOBN(0xe576c09f, 0xf460b38f), TOBN(0x6b70d548, 0x22b7fb36), - TOBN(0x3fd237f1, 0x3bfae315), TOBN(0x33797852, 0xcbdff369), - TOBN(0x97df25f5, 0x25b516f9), TOBN(0x46f388f2, 0xba38ad2d), - TOBN(0x656c4658, 0x89d8ddbb), TOBN(0x8830b26e, 0x70f38ee8), - TOBN(0x4320fd5c, 0xde1212b0), TOBN(0xc34f30cf, 0xe4a2edb2), - TOBN(0xabb131a3, 0x56ab64b8), TOBN(0x7f77f0cc, 0xd99c5d26), - TOBN(0x66856a37, 0xbf981d94), TOBN(0x19e76d09, 0x738bd76e), - TOBN(0xe76c8ac3, 0x96238f39), TOBN(0xc0a482be, 0xa830b366), - TOBN(0xb7b8eaff, 0x0b4eb499), TOBN(0x8ecd83bc, 0x4bfb4865), - TOBN(0x971b2cb7, 0xa2f3776f), TOBN(0xb42176a4, 0xf4b88adf), - TOBN(0xb9617df5, 0xbe1fa446), TOBN(0x8b32d508, 0xcd031bd2), - TOBN(0x1c6bd47d, 0x53b618c0), TOBN(0xc424f46c, 0x6a227923), - TOBN(0x7303ffde, 0xdd92d964), TOBN(0xe9712878, 0x71b5abf2), - TOBN(0x8f48a632, 0xf815561d), TOBN(0x85f48ff5, 0xd3c055d1), - TOBN(0x222a1427, 0x7525684f), TOBN(0xd0d841a0, 0x67360cc3), - TOBN(0x4245a926, 0x0b9267c6), TOBN(0xc78913f1, 0xcf07f863), - TOBN(0xaa844c8e, 0x4d0d9e24), TOBN(0xa42ad522, 0x3d5f9017), - TOBN(0xbd371749, 0xa2c989d5), TOBN(0x928292df, 0xe1f5e78e), - TOBN(0x493b383e, 0x0a1ea6da), TOBN(0x5136fd8d, 0x13aee529), - TOBN(0x860c44b1, 0xf2c34a99), TOBN(0x3b00aca4, 0xbf5855ac), - TOBN(0xabf6aaa0, 0xfaaf37be), TOBN(0x65f43682, 0x2a53ec08), - TOBN(0x1d9a5801, 0xa11b12e1), TOBN(0x78a7ab2c, 0xe20ed475), - TOBN(0x0de1067e, 0x9a41e0d5), TOBN(0x30473f5f, 0x305023ea), - TOBN(0xdd3ae09d, 0x169c7d97), TOBN(0x5cd5baa4, 0xcfaef9cd), - TOBN(0x5cd7440b, 0x65a44803), TOBN(0xdc13966a, 0x47f364de), - TOBN(0x077b2be8, 0x2b8357c1), TOBN(0x0cb1b4c5, 0xe9d57c2a), - TOBN(0x7a4ceb32, 0x05ff363e), TOBN(0xf310fa4d, 0xca35a9ef), - TOBN(0xdbb7b352, 0xf97f68c6), TOBN(0x0c773b50, 0x0b02cf58), - TOBN(0xea2e4821, 0x3c1f96d9), TOBN(0xffb357b0, 0xeee01815), - TOBN(0xb9c924cd, 0xe0f28039), TOBN(0x0b36c95a, 0x46a3fbe4), - TOBN(0x1faaaea4, 0x5e46db6c), TOBN(0xcae575c3, 0x1928aaff), - TOBN(0x7f671302, 0xa70dab86), TOBN(0xfcbd12a9, 0x71c58cfc), - TOBN(0xcbef9acf, 0xbee0cb92), TOBN(0x573da0b9, 0xf8c1b583), - TOBN(0x4752fcfe, 0x0d41d550), TOBN(0xe7eec0e3, 0x2155cffe), - TOBN(0x0fc39fcb, 0x545ae248), TOBN(0x522cb8d1, 0x8065f44e), - TOBN(0x263c962a, 0x70cbb96c), TOBN(0xe034362a, 0xbcd124a9), - TOBN(0xf120db28, 0x3c2ae58d), TOBN(0xb9a38d49, 0xfef6d507), - TOBN(0xb1fd2a82, 0x1ff140fd), TOBN(0xbd162f30, 0x20aee7e0), - TOBN(0x4e17a5d4, 0xcb251949), TOBN(0x2aebcb83, 0x4f7e1c3d), - TOBN(0x608eb25f, 0x937b0527), TOBN(0xf42e1e47, 0xeb7d9997), - TOBN(0xeba699c4, 0xb8a53a29), TOBN(0x1f921c71, 0xe091b536), - TOBN(0xcce29e7b, 0x5b26bbd5), TOBN(0x7a8ef5ed, 0x3b61a680), - TOBN(0xe5ef8043, 0xba1f1c7e), TOBN(0x16ea8217, 0x18158dda), - TOBN(0x01778a2b, 0x599ff0f9), TOBN(0x68a923d7, 0x8104fc6b), - TOBN(0x5bfa44df, 0xda694ff3), TOBN(0x4f7199db, 0xf7667f12), - TOBN(0xc06d8ff6, 0xe46f2a79), TOBN(0x08b5dead, 0xe9f8131d), - TOBN(0x02519a59, 0xabb4ce7c), TOBN(0xc4f710bc, 0xb42aec3e), - TOBN(0x3d77b057, 0x78bde41a), TOBN(0x6474bf80, 0xb4186b5a), - TOBN(0x048b3f67, 0x88c65741), TOBN(0xc64519de, 0x03c7c154), - TOBN(0xdf073846, 0x0edfcc4f), TOBN(0x319aa737, 0x48f1aa6b), - TOBN(0x8b9f8a02, 0xca909f77), TOBN(0x90258139, 0x7580bfef), - TOBN(0xd8bfd3ca, 0xc0c22719), TOBN(0xc60209e4, 0xc9ca151e), - TOBN(0x7a744ab5, 0xd9a1a69c), TOBN(0x6de5048b, 0x14937f8f), - TOBN(0x171938d8, 0xe115ac04), TOBN(0x7df70940, 0x1c6b16d2), - TOBN(0xa6aeb663, 0x7f8e94e7), TOBN(0xc130388e, 0x2a2cf094), - TOBN(0x1850be84, 0x77f54e6e), TOBN(0x9f258a72, 0x65d60fe5), - TOBN(0xff7ff0c0, 0x6c9146d6), TOBN(0x039aaf90, 0xe63a830b), - TOBN(0x38f27a73, 0x9460342f), TOBN(0x4703148c, 0x3f795f8a), - TOBN(0x1bb5467b, 0x9681a97e), TOBN(0x00931ba5, 0xecaeb594), - TOBN(0xcdb6719d, 0x786f337c), TOBN(0xd9c01cd2, 0xe704397d), - TOBN(0x0f4a3f20, 0x555c2fef), TOBN(0x00452509, 0x7c0af223), - TOBN(0x54a58047, 0x84db8e76), TOBN(0x3bacf1aa, 0x93c8aa06), - TOBN(0x11ca957c, 0xf7919422), TOBN(0x50641053, 0x78cdaa40), - TOBN(0x7a303874, 0x9f7144ae), TOBN(0x170c963f, 0x43d4acfd), - TOBN(0x5e148149, 0x58ddd3ef), TOBN(0xa7bde582, 0x9e72dba8), - TOBN(0x0769da8b, 0x6fa68750), TOBN(0xfa64e532, 0x572e0249), - TOBN(0xfcaadf9d, 0x2619ad31), TOBN(0x87882daa, 0xa7b349cd), - TOBN(0x9f6eb731, 0x6c67a775), TOBN(0xcb10471a, 0xefc5d0b1), - TOBN(0xb433750c, 0xe1b806b2), TOBN(0x19c5714d, 0x57b1ae7e), - TOBN(0xc0dc8b7b, 0xed03fd3f), TOBN(0xdd03344f, 0x31bc194e), - TOBN(0xa66c52a7, 0x8c6320b5), TOBN(0x8bc82ce3, 0xd0b6fd93), - TOBN(0xf8e13501, 0xb35f1341), TOBN(0xe53156dd, 0x25a43e42), - TOBN(0xd3adf27e, 0x4daeb85c), TOBN(0xb81d8379, 0xbbeddeb5), - TOBN(0x1b0b546e, 0x2e435867), TOBN(0x9020eb94, 0xeba5dd60), - TOBN(0x37d91161, 0x8210cb9d), TOBN(0x4c596b31, 0x5c91f1cf), - TOBN(0xb228a90f, 0x0e0b040d), TOBN(0xbaf02d82, 0x45ff897f), - TOBN(0x2aac79e6, 0x00fa6122), TOBN(0x24828817, 0x8e36f557), - TOBN(0xb9521d31, 0x113ec356), TOBN(0x9e48861e, 0x15eff1f8), - TOBN(0x2aa1d412, 0xe0d41715), TOBN(0x71f86203, 0x53f131b8), - TOBN(0xf60da8da, 0x3fd19408), TOBN(0x4aa716dc, 0x278d9d99), - TOBN(0x394531f7, 0xa8c51c90), TOBN(0xb560b0e8, 0xf59db51c), - TOBN(0xa28fc992, 0xfa34bdad), TOBN(0xf024fa14, 0x9cd4f8bd), - TOBN(0x5cf530f7, 0x23a9d0d3), TOBN(0x615ca193, 0xe28c9b56), - TOBN(0x6d2a483d, 0x6f73c51e), TOBN(0xa4cb2412, 0xea0dc2dd), - TOBN(0x50663c41, 0x1eb917ff), TOBN(0x3d3a74cf, 0xeade299e), - TOBN(0x29b3990f, 0x4a7a9202), TOBN(0xa9bccf59, 0xa7b15c3d), - TOBN(0x66a3ccdc, 0xa5df9208), TOBN(0x48027c14, 0x43f2f929), - TOBN(0xd385377c, 0x40b557f0), TOBN(0xe001c366, 0xcd684660), - TOBN(0x1b18ed6b, 0xe2183a27), TOBN(0x879738d8, 0x63210329), - TOBN(0xa687c74b, 0xbda94882), TOBN(0xd1bbcc48, 0xa684b299), - TOBN(0xaf6f1112, 0x863b3724), TOBN(0x6943d1b4, 0x2c8ce9f8), - TOBN(0xe044a3bb, 0x098cafb4), TOBN(0x27ed2310, 0x60d48caf), - TOBN(0x542b5675, 0x3a31b84d), TOBN(0xcbf3dd50, 0xfcddbed7), - TOBN(0x25031f16, 0x41b1d830), TOBN(0xa7ec851d, 0xcb0c1e27), - TOBN(0xac1c8fe0, 0xb5ae75db), TOBN(0xb24c7557, 0x08c52120), - TOBN(0x57f811dc, 0x1d4636c3), TOBN(0xf8436526, 0x681a9939), - TOBN(0x1f6bc6d9, 0x9c81adb3), TOBN(0x840f8ac3, 0x5b7d80d4), - TOBN(0x731a9811, 0xf4387f1a), TOBN(0x7c501cd3, 0xb5156880), - TOBN(0xa5ca4a07, 0xdfe68867), TOBN(0xf123d8f0, 0x5fcea120), - TOBN(0x1fbb0e71, 0xd607039e), TOBN(0x2b70e215, 0xcd3a4546), - TOBN(0x32d2f01d, 0x53324091), TOBN(0xb796ff08, 0x180ab19b), - TOBN(0x32d87a86, 0x3c57c4aa), TOBN(0x2aed9caf, 0xb7c49a27), - TOBN(0x9fb35eac, 0x31630d98), TOBN(0x338e8cdf, 0x5c3e20a3), - TOBN(0x80f16182, 0x66cde8db), TOBN(0x4e159980, 0x2d72fd36), - TOBN(0xd7b8f13b, 0x9b6e5072), TOBN(0xf5213907, 0x3b7b5dc1), - TOBN(0x4d431f1d, 0x8ce4396e), TOBN(0x37a1a680, 0xa7ed2142), - TOBN(0xbf375696, 0xd01aaf6b), TOBN(0xaa1c0c54, 0xe63aab66), - TOBN(0x3014368b, 0x4ed80940), TOBN(0x67e6d056, 0x7a6fcedd), - TOBN(0x7c208c49, 0xca97579f), TOBN(0xfe3d7a81, 0xa23597f6), - TOBN(0x5e203202, 0x7e096ae2), TOBN(0xb1f3e1e7, 0x24b39366), - TOBN(0x26da26f3, 0x2fdcdffc), TOBN(0x79422f1d, 0x6097be83)}, - {TOBN(0x263a2cfb, 0x9db3b381), TOBN(0x9c3a2dee, 0xd4df0a4b), - TOBN(0x728d06e9, 0x7d04e61f), TOBN(0x8b1adfbc, 0x42449325), - TOBN(0x6ec1d939, 0x7e053a1b), TOBN(0xee2be5c7, 0x66daf707), - TOBN(0x80ba1e14, 0x810ac7ab), TOBN(0xdd2ae778, 0xf530f174), - TOBN(0x0435d97a, 0x205b9d8b), TOBN(0x6eb8f064, 0x056756d4), - TOBN(0xd5e88a8b, 0xb6f8210e), TOBN(0x070ef12d, 0xec9fd9ea), - TOBN(0x4d849505, 0x3bcc876a), TOBN(0x12a75338, 0xa7404ce3), - TOBN(0xd22b49e1, 0xb8a1db5e), TOBN(0xec1f2051, 0x14bfa5ad), - TOBN(0xadbaeb79, 0xb6828f36), TOBN(0x9d7a0258, 0x01bd5b9e), - TOBN(0xeda01e0d, 0x1e844b0c), TOBN(0x4b625175, 0x887edfc9), - TOBN(0x14109fdd, 0x9669b621), TOBN(0x88a2ca56, 0xf6f87b98), - TOBN(0xfe2eb788, 0x170df6bc), TOBN(0x0cea06f4, 0xffa473f9), - TOBN(0x43ed81b5, 0xc4e83d33), TOBN(0xd9f35879, 0x5efd488b), - TOBN(0x164a620f, 0x9deb4d0f), TOBN(0xc6927bdb, 0xac6a7394), - TOBN(0x45c28df7, 0x9f9e0f03), TOBN(0x2868661e, 0xfcd7e1a9), - TOBN(0x7cf4e8d0, 0xffa348f1), TOBN(0x6bd4c284, 0x398538e0), - TOBN(0x2618a091, 0x289a8619), TOBN(0xef796e60, 0x6671b173), - TOBN(0x664e46e5, 0x9090c632), TOBN(0xa38062d4, 0x1e66f8fb), - TOBN(0x6c744a20, 0x0573274e), TOBN(0xd07b67e4, 0xa9271394), - TOBN(0x391223b2, 0x6bdc0e20), TOBN(0xbe2d93f1, 0xeb0a05a7), - TOBN(0xf23e2e53, 0x3f36d141), TOBN(0xe84bb3d4, 0x4dfca442), - TOBN(0xb804a48d, 0x6b7c023a), TOBN(0x1e16a8fa, 0x76431c3b), - TOBN(0x1b5452ad, 0xddd472e0), TOBN(0x7d405ee7, 0x0d1ee127), - TOBN(0x50fc6f1d, 0xffa27599), TOBN(0x351ac53c, 0xbf391b35), - TOBN(0x7efa14b8, 0x4444896b), TOBN(0x64974d2f, 0xf94027fb), - TOBN(0xefdcd0e8, 0xde84487d), TOBN(0x8c45b260, 0x2b48989b), - TOBN(0xa8fcbbc2, 0xd8463487), TOBN(0xd1b2b3f7, 0x3fbc476c), - TOBN(0x21d005b7, 0xc8f443c0), TOBN(0x518f2e67, 0x40c0139c), - TOBN(0x56036e8c, 0x06d75fc1), TOBN(0x2dcf7bb7, 0x3249a89f), - TOBN(0x81dd1d3d, 0xe245e7dd), TOBN(0xf578dc4b, 0xebd6e2a7), - TOBN(0x4c028903, 0xdf2ce7a0), TOBN(0xaee36288, 0x9c39afac), - TOBN(0xdc847c31, 0x146404ab), TOBN(0x6304c0d8, 0xa4e97818), - TOBN(0xae51dca2, 0xa91f6791), TOBN(0x2abe4190, 0x9baa9efc), - TOBN(0xd9d2e2f4, 0x559c7ac1), TOBN(0xe82f4b51, 0xfc9f773a), - TOBN(0xa7713027, 0x4073e81c), TOBN(0xc0276fac, 0xfbb596fc), - TOBN(0x1d819fc9, 0xa684f70c), TOBN(0x29b47fdd, 0xc9f7b1e0), - TOBN(0x358de103, 0x459b1940), TOBN(0xec881c59, 0x5b013e93), - TOBN(0x51574c93, 0x49532ad3), TOBN(0x2db1d445, 0xb37b46de), - TOBN(0xc6445b87, 0xdf239fd8), TOBN(0xc718af75, 0x151d24ee), - TOBN(0xaea1c4a4, 0xf43c6259), TOBN(0x40c0e5d7, 0x70be02f7), - TOBN(0x6a4590f4, 0x721b33f2), TOBN(0x2124f1fb, 0xfedf04ea), - TOBN(0xf8e53cde, 0x9745efe7), TOBN(0xe7e10432, 0x65f046d9), - TOBN(0xc3fca28e, 0xe4d0c7e6), TOBN(0x847e339a, 0x87253b1b), - TOBN(0x9b595348, 0x3743e643), TOBN(0xcb6a0a0b, 0x4fd12fc5), - TOBN(0xfb6836c3, 0x27d02dcc), TOBN(0x5ad00982, 0x7a68bcc2), - TOBN(0x1b24b44c, 0x005e912d), TOBN(0xcc83d20f, 0x811fdcfe), - TOBN(0x36527ec1, 0x666fba0c), TOBN(0x69948197, 0x14754635), - TOBN(0xfcdcb1a8, 0x556da9c2), TOBN(0xa5934267, 0x81a732b2), - TOBN(0xec1214ed, 0xa714181d), TOBN(0x609ac13b, 0x6067b341), - TOBN(0xff4b4c97, 0xa545df1f), TOBN(0xa1240501, 0x34d2076b), - TOBN(0x6efa0c23, 0x1409ca97), TOBN(0x254cc1a8, 0x20638c43), - TOBN(0xd4e363af, 0xdcfb46cd), TOBN(0x62c2adc3, 0x03942a27), - TOBN(0xc67b9df0, 0x56e46483), TOBN(0xa55abb20, 0x63736356), - TOBN(0xab93c098, 0xc551bc52), TOBN(0x382b49f9, 0xb15fe64b), - TOBN(0x9ec221ad, 0x4dff8d47), TOBN(0x79caf615, 0x437df4d6), - TOBN(0x5f13dc64, 0xbb456509), TOBN(0xe4c589d9, 0x191f0714), - TOBN(0x27b6a8ab, 0x3fd40e09), TOBN(0xe455842e, 0x77313ea9), - TOBN(0x8b51d1e2, 0x1f55988b), TOBN(0x5716dd73, 0x062bbbfc), - TOBN(0x633c11e5, 0x4e8bf3de), TOBN(0x9a0e77b6, 0x1b85be3b), - TOBN(0x56510729, 0x0911cca6), TOBN(0x27e76495, 0xefa6590f), - TOBN(0xe4ac8b33, 0x070d3aab), TOBN(0x2643672b, 0x9a2cd5e5), - TOBN(0x52eff79b, 0x1cfc9173), TOBN(0x665ca49b, 0x90a7c13f), - TOBN(0x5a8dda59, 0xb3efb998), TOBN(0x8a5b922d, 0x052f1341), - TOBN(0xae9ebbab, 0x3cf9a530), TOBN(0x35986e7b, 0xf56da4d7), - TOBN(0x3a636b5c, 0xff3513cc), TOBN(0xbb0cf8ba, 0x3198f7dd), - TOBN(0xb8d40522, 0x41f16f86), TOBN(0x760575d8, 0xde13a7bf), - TOBN(0x36f74e16, 0x9f7aa181), TOBN(0x163a3ecf, 0xf509ed1c), - TOBN(0x6aead61f, 0x3c40a491), TOBN(0x158c95fc, 0xdfe8fcaa), - TOBN(0xa3991b6e, 0x13cda46f), TOBN(0x79482415, 0x342faed0), - TOBN(0xf3ba5bde, 0x666b5970), TOBN(0x1d52e6bc, 0xb26ab6dd), - TOBN(0x768ba1e7, 0x8608dd3d), TOBN(0x4930db2a, 0xea076586), - TOBN(0xd9575714, 0xe7dc1afa), TOBN(0x1fc7bf7d, 0xf7c58817), - TOBN(0x6b47accd, 0xd9eee96c), TOBN(0x0ca277fb, 0xe58cec37), - TOBN(0x113fe413, 0xe702c42a), TOBN(0xdd1764ee, 0xc47cbe51), - TOBN(0x041e7cde, 0x7b3ed739), TOBN(0x50cb7459, 0x5ce9e1c0), - TOBN(0x35568513, 0x2925b212), TOBN(0x7cff95c4, 0x001b081c), - TOBN(0x63ee4cbd, 0x8088b454), TOBN(0xdb7f32f7, 0x9a9e0c8a), - TOBN(0xb377d418, 0x6b2447cb), TOBN(0xe3e982aa, 0xd370219b), - TOBN(0x06ccc1e4, 0xc2a2a593), TOBN(0x72c36865, 0x0773f24f), - TOBN(0xa13b4da7, 0x95859423), TOBN(0x8bbf1d33, 0x75040c8f), - TOBN(0x726f0973, 0xda50c991), TOBN(0x48afcd5b, 0x822d6ee2), - TOBN(0xe5fc718b, 0x20fd7771), TOBN(0xb9e8e77d, 0xfd0807a1), - TOBN(0x7f5e0f44, 0x99a7703d), TOBN(0x6972930e, 0x618e36f3), - TOBN(0x2b7c77b8, 0x23807bbe), TOBN(0xe5b82405, 0xcb27ff50), - TOBN(0xba8b8be3, 0xbd379062), TOBN(0xd64b7a1d, 0x2dce4a92), - TOBN(0x040a73c5, 0xb2952e37), TOBN(0x0a9e252e, 0xd438aeca), - TOBN(0xdd43956b, 0xc39d3bcb), TOBN(0x1a31ca00, 0xb32b2d63), - TOBN(0xd67133b8, 0x5c417a18), TOBN(0xd08e4790, 0x2ef442c8), - TOBN(0x98cb1ae9, 0x255c0980), TOBN(0x4bd86381, 0x2b4a739f), - TOBN(0x5a5c31e1, 0x1e4a45a1), TOBN(0x1e5d55fe, 0x9cb0db2f), - TOBN(0x74661b06, 0x8ff5cc29), TOBN(0x026b389f, 0x0eb8a4f4), - TOBN(0x536b21a4, 0x58848c24), TOBN(0x2e5bf8ec, 0x81dc72b0), - TOBN(0x03c187d0, 0xad886aac), TOBN(0x5c16878a, 0xb771b645), - TOBN(0xb07dfc6f, 0xc74045ab), TOBN(0x2c6360bf, 0x7800caed), - TOBN(0x24295bb5, 0xb9c972a3), TOBN(0xc9e6f88e, 0x7c9a6dba), - TOBN(0x90ffbf24, 0x92a79aa6), TOBN(0xde29d50a, 0x41c26ac2), - TOBN(0x9f0af483, 0xd309cbe6), TOBN(0x5b020d8a, 0xe0bced4f), - TOBN(0x606e986d, 0xb38023e3), TOBN(0xad8f2c9d, 0x1abc6933), - TOBN(0x19292e1d, 0xe7400e93), TOBN(0xfe3e18a9, 0x52be5e4d), - TOBN(0xe8e9771d, 0x2e0680bf), TOBN(0x8c5bec98, 0xc54db063), - TOBN(0x2af9662a, 0x74a55d1f), TOBN(0xe3fbf28f, 0x046f66d8), - TOBN(0xa3a72ab4, 0xd4dc4794), TOBN(0x09779f45, 0x5c7c2dd8), - TOBN(0xd893bdaf, 0xc3d19d8d), TOBN(0xd5a75094, 0x57d6a6df), - TOBN(0x8cf8fef9, 0x952e6255), TOBN(0x3da67cfb, 0xda9a8aff), - TOBN(0x4c23f62a, 0x2c160dcd), TOBN(0x34e6c5e3, 0x8f90eaef), - TOBN(0x35865519, 0xa9a65d5a), TOBN(0x07c48aae, 0x8fd38a3d), - TOBN(0xb7e7aeda, 0x50068527), TOBN(0x2c09ef23, 0x1c90936a), - TOBN(0x31ecfeb6, 0xe879324c), TOBN(0xa0871f6b, 0xfb0ec938), - TOBN(0xb1f0fb68, 0xd84d835d), TOBN(0xc90caf39, 0x861dc1e6), - TOBN(0x12e5b046, 0x7594f8d7), TOBN(0x26897ae2, 0x65012b92), - TOBN(0xbcf68a08, 0xa4d6755d), TOBN(0x403ee41c, 0x0991fbda), - TOBN(0x733e343e, 0x3bbf17e8), TOBN(0xd2c7980d, 0x679b3d65), - TOBN(0x33056232, 0xd2e11305), TOBN(0x966be492, 0xf3c07a6f), - TOBN(0x6a8878ff, 0xbb15509d), TOBN(0xff221101, 0x0a9b59a4), - TOBN(0x6c9f564a, 0xabe30129), TOBN(0xc6f2c940, 0x336e64cf), - TOBN(0x0fe75262, 0x8b0c8022), TOBN(0xbe0267e9, 0x6ae8db87), - TOBN(0x22e192f1, 0x93bc042b), TOBN(0xf085b534, 0xb237c458), - TOBN(0xa0d192bd, 0x832c4168), TOBN(0x7a76e9e3, 0xbdf6271d), - TOBN(0x52a882fa, 0xb88911b5), TOBN(0xc85345e4, 0xb4db0eb5), - TOBN(0xa3be02a6, 0x81a7c3ff), TOBN(0x51889c8c, 0xf0ec0469), - TOBN(0x9d031369, 0xa5e829e5), TOBN(0xcbb4c6fc, 0x1607aa41), - TOBN(0x75ac59a6, 0x241d84c1), TOBN(0xc043f2bf, 0x8829e0ee), - TOBN(0x82a38f75, 0x8ea5e185), TOBN(0x8bda40b9, 0xd87cbd9f), - TOBN(0x9e65e75e, 0x2d8fc601), TOBN(0x3d515f74, 0xa35690b3), - TOBN(0x534acf4f, 0xda79e5ac), TOBN(0x68b83b3a, 0x8630215f), - TOBN(0x5c748b2e, 0xd085756e), TOBN(0xb0317258, 0xe5d37cb2), - TOBN(0x6735841a, 0xc5ccc2c4), TOBN(0x7d7dc96b, 0x3d9d5069), - TOBN(0xa147e410, 0xfd1754bd), TOBN(0x65296e94, 0xd399ddd5), - TOBN(0xf6b5b2d0, 0xbc8fa5bc), TOBN(0x8a5ead67, 0x500c277b), - TOBN(0x214625e6, 0xdfa08a5d), TOBN(0x51fdfedc, 0x959cf047), - TOBN(0x6bc9430b, 0x289fca32), TOBN(0xe36ff0cf, 0x9d9bdc3f), - TOBN(0x2fe187cb, 0x58ea0ede), TOBN(0xed66af20, 0x5a900b3f), - TOBN(0x00e0968b, 0x5fa9f4d6), TOBN(0x2d4066ce, 0x37a362e7), - TOBN(0xa99a9748, 0xbd07e772), TOBN(0x710989c0, 0x06a4f1d0), - TOBN(0xd5dedf35, 0xce40cbd8), TOBN(0xab55c5f0, 0x1743293d), - TOBN(0x766f1144, 0x8aa24e2c), TOBN(0x94d874f8, 0x605fbcb4), - TOBN(0xa365f0e8, 0xa518001b), TOBN(0xee605eb6, 0x9d04ef0f), - TOBN(0x5a3915cd, 0xba8d4d25), TOBN(0x44c0e1b8, 0xb5113472), - TOBN(0xcbb024e8, 0x8b6740dc), TOBN(0x89087a53, 0xee1d4f0c), - TOBN(0xa88fa05c, 0x1fc4e372), TOBN(0x8bf395cb, 0xaf8b3af2), - TOBN(0x1e71c9a1, 0xdeb8568b), TOBN(0xa35daea0, 0x80fb3d32), - TOBN(0xe8b6f266, 0x2cf8fb81), TOBN(0x6d51afe8, 0x9490696a), - TOBN(0x81beac6e, 0x51803a19), TOBN(0xe3d24b7f, 0x86219080), - TOBN(0x727cfd9d, 0xdf6f463c), TOBN(0x8c6865ca, 0x72284ee8), - TOBN(0x32c88b7d, 0xb743f4ef), TOBN(0x3793909b, 0xe7d11dce), - TOBN(0xd398f922, 0x2ff2ebe8), TOBN(0x2c70ca44, 0xe5e49796), - TOBN(0xdf4d9929, 0xcb1131b1), TOBN(0x7826f298, 0x25888e79), - TOBN(0x4d3a112c, 0xf1d8740a), TOBN(0x00384cb6, 0x270afa8b), - TOBN(0xcb64125b, 0x3ab48095), TOBN(0x3451c256, 0x62d05106), - TOBN(0xd73d577d, 0xa4955845), TOBN(0x39570c16, 0xbf9f4433), - TOBN(0xd7dfaad3, 0xadecf263), TOBN(0xf1c3d8d1, 0xdc76e102), - TOBN(0x5e774a58, 0x54c6a836), TOBN(0xdad4b672, 0x3e92d47b), - TOBN(0xbe7e990f, 0xf0d796a0), TOBN(0x5fc62478, 0xdf0e8b02), - TOBN(0x8aae8bf4, 0x030c00ad), TOBN(0x3d2db93b, 0x9004ba0f), - TOBN(0xe48c8a79, 0xd85d5ddc), TOBN(0xe907caa7, 0x6bb07f34), - TOBN(0x58db343a, 0xa39eaed5), TOBN(0x0ea6e007, 0xadaf5724), - TOBN(0xe00df169, 0xd23233f3), TOBN(0x3e322796, 0x77cb637f), - TOBN(0x1f897c0e, 0x1da0cf6c), TOBN(0xa651f5d8, 0x31d6bbdd), - TOBN(0xdd61af19, 0x1a230c76), TOBN(0xbd527272, 0xcdaa5e4a), - TOBN(0xca753636, 0xd0abcd7e), TOBN(0x78bdd37c, 0x370bd8dc), - TOBN(0xc23916c2, 0x17cd93fe), TOBN(0x65b97a4d, 0xdadce6e2), - TOBN(0xe04ed4eb, 0x174e42f8), TOBN(0x1491ccaa, 0xbb21480a), - TOBN(0x145a8280, 0x23196332), TOBN(0x3c3862d7, 0x587b479a), - TOBN(0x9f4a88a3, 0x01dcd0ed), TOBN(0x4da2b7ef, 0x3ea12f1f), - TOBN(0xf8e7ae33, 0xb126e48e), TOBN(0x404a0b32, 0xf494e237), - TOBN(0x9beac474, 0xc55acadb), TOBN(0x4ee5cf3b, 0xcbec9fd9), - TOBN(0x336b33b9, 0x7df3c8c3), TOBN(0xbd905fe3, 0xb76808fd), - TOBN(0x8f436981, 0xaa45c16a), TOBN(0x255c5bfa, 0x3dd27b62), - TOBN(0x71965cbf, 0xc3dd9b4d), TOBN(0xce23edbf, 0xfc068a87), - TOBN(0xb78d4725, 0x745b029b), TOBN(0x74610713, 0xcefdd9bd), - TOBN(0x7116f75f, 0x1266bf52), TOBN(0x02046722, 0x18e49bb6), - TOBN(0xdf43df9f, 0x3d6f19e3), TOBN(0xef1bc7d0, 0xe685cb2f), - TOBN(0xcddb27c1, 0x7078c432), TOBN(0xe1961b9c, 0xb77fedb7), - TOBN(0x1edc2f5c, 0xc2290570), TOBN(0x2c3fefca, 0x19cbd886), - TOBN(0xcf880a36, 0xc2af389a), TOBN(0x96c610fd, 0xbda71cea), - TOBN(0xf03977a9, 0x32aa8463), TOBN(0x8eb7763f, 0x8586d90a), - TOBN(0x3f342454, 0x2a296e77), TOBN(0xc8718683, 0x42837a35), - TOBN(0x7dc71090, 0x6a09c731), TOBN(0x54778ffb, 0x51b816db), - TOBN(0x6b33bfec, 0xaf06defd), TOBN(0xfe3c105f, 0x8592b70b), - TOBN(0xf937fda4, 0x61da6114), TOBN(0x3c13e651, 0x4c266ad7), - TOBN(0xe363a829, 0x855938e8), TOBN(0x2eeb5d9e, 0x9de54b72), - TOBN(0xbeb93b0e, 0x20ccfab9), TOBN(0x3dffbb5f, 0x25e61a25), - TOBN(0x7f655e43, 0x1acc093d), TOBN(0x0cb6cc3d, 0x3964ce61), - TOBN(0x6ab283a1, 0xe5e9b460), TOBN(0x55d787c5, 0xa1c7e72d), - TOBN(0x4d2efd47, 0xdeadbf02), TOBN(0x11e80219, 0xac459068), - TOBN(0x810c7626, 0x71f311f0), TOBN(0xfa17ef8d, 0x4ab6ef53), - TOBN(0xaf47fd25, 0x93e43bff), TOBN(0x5cb5ff3f, 0x0be40632), - TOBN(0x54687106, 0x8ee61da3), TOBN(0x7764196e, 0xb08afd0f), - TOBN(0x831ab3ed, 0xf0290a8f), TOBN(0xcae81966, 0xcb47c387), - TOBN(0xaad7dece, 0x184efb4f), TOBN(0xdcfc53b3, 0x4749110e), - TOBN(0x6698f23c, 0x4cb632f9), TOBN(0xc42a1ad6, 0xb91f8067), - TOBN(0xb116a81d, 0x6284180a), TOBN(0xebedf5f8, 0xe901326f), - TOBN(0xf2274c9f, 0x97e3e044), TOBN(0x42018520, 0x11d09fc9), - TOBN(0x56a65f17, 0xd18e6e23), TOBN(0x2ea61e2a, 0x352b683c), - TOBN(0x27d291bc, 0x575eaa94), TOBN(0x9e7bc721, 0xb8ff522d), - TOBN(0x5f7268bf, 0xa7f04d6f), TOBN(0x5868c73f, 0xaba41748), - TOBN(0x9f85c2db, 0x7be0eead), TOBN(0x511e7842, 0xff719135), - TOBN(0x5a06b1e9, 0xc5ea90d7), TOBN(0x0c19e283, 0x26fab631), - TOBN(0x8af8f0cf, 0xe9206c55), TOBN(0x89389cb4, 0x3553c06a), - TOBN(0x39dbed97, 0xf65f8004), TOBN(0x0621b037, 0xc508991d), - TOBN(0x1c52e635, 0x96e78cc4), TOBN(0x5385c8b2, 0x0c06b4a8), - TOBN(0xd84ddfdb, 0xb0e87d03), TOBN(0xc49dfb66, 0x934bafad), - TOBN(0x7071e170, 0x59f70772), TOBN(0x3a073a84, 0x3a1db56b), - TOBN(0x03494903, 0x3b8af190), TOBN(0x7d882de3, 0xd32920f0), - TOBN(0x91633f0a, 0xb2cf8940), TOBN(0x72b0b178, 0x6f948f51), - TOBN(0x2d28dc30, 0x782653c8), TOBN(0x88829849, 0xdb903a05), - TOBN(0xb8095d0c, 0x6a19d2bb), TOBN(0x4b9e7f0c, 0x86f782cb), - TOBN(0x7af73988, 0x2d907064), TOBN(0xd12be0fe, 0x8b32643c), - TOBN(0x358ed23d, 0x0e165dc3), TOBN(0x3d47ce62, 0x4e2378ce), - TOBN(0x7e2bb0b9, 0xfeb8a087), TOBN(0x3246e8ae, 0xe29e10b9), - TOBN(0x459f4ec7, 0x03ce2b4d), TOBN(0xe9b4ca1b, 0xbbc077cf), - TOBN(0x2613b4f2, 0x0e9940c1), TOBN(0xfc598bb9, 0x047d1eb1), - TOBN(0x9744c62b, 0x45036099), TOBN(0xa9dee742, 0x167c65d8), - TOBN(0x0c511525, 0xdabe1943), TOBN(0xda110554, 0x93c6c624), - TOBN(0xae00a52c, 0x651a3be2), TOBN(0xcda5111d, 0x884449a6), - TOBN(0x063c06f4, 0xff33bed1), TOBN(0x73baaf9a, 0x0d3d76b4), - TOBN(0x52fb0c9d, 0x7fc63668), TOBN(0x6886c9dd, 0x0c039cde), - TOBN(0x602bd599, 0x55b22351), TOBN(0xb00cab02, 0x360c7c13), - TOBN(0x8cb616bc, 0x81b69442), TOBN(0x41486700, 0xb55c3cee), - TOBN(0x71093281, 0xf49ba278), TOBN(0xad956d9c, 0x64a50710), - TOBN(0x9561f28b, 0x638a7e81), TOBN(0x54155cdf, 0x5980ddc3), - TOBN(0xb2db4a96, 0xd26f247a), TOBN(0x9d774e4e, 0x4787d100), - TOBN(0x1a9e6e2e, 0x078637d2), TOBN(0x1c363e2d, 0x5e0ae06a), - TOBN(0x7493483e, 0xe9cfa354), TOBN(0x76843cb3, 0x7f74b98d), - TOBN(0xbaca6591, 0xd4b66947), TOBN(0xb452ce98, 0x04460a8c), - TOBN(0x6830d246, 0x43768f55), TOBN(0xf4197ed8, 0x7dff12df), - TOBN(0x6521b472, 0x400dd0f7), TOBN(0x59f5ca8f, 0x4b1e7093), - TOBN(0x6feff11b, 0x080338ae), TOBN(0x0ada31f6, 0xa29ca3c6), - TOBN(0x24794eb6, 0x94a2c215), TOBN(0xd83a43ab, 0x05a57ab4), - TOBN(0x264a543a, 0x2a6f89fe), TOBN(0x2c2a3868, 0xdd5ec7c2), - TOBN(0xd3373940, 0x8439d9b2), TOBN(0x715ea672, 0x0acd1f11), - TOBN(0x42c1d235, 0xe7e6cc19), TOBN(0x81ce6e96, 0xb990585c), - TOBN(0x04e5dfe0, 0xd809c7bd), TOBN(0xd7b2580c, 0x8f1050ab), - TOBN(0x6d91ad78, 0xd8a4176f), TOBN(0x0af556ee, 0x4e2e897c), - TOBN(0x162a8b73, 0x921de0ac), TOBN(0x52ac9c22, 0x7ea78400), - TOBN(0xee2a4eea, 0xefce2174), TOBN(0xbe61844e, 0x6d637f79), - TOBN(0x0491f1bc, 0x789a283b), TOBN(0x72d3ac3d, 0x880836f4), - TOBN(0xaa1c5ea3, 0x88e5402d), TOBN(0x1b192421, 0xd5cc473d), - TOBN(0x5c0b9998, 0x9dc84cac), TOBN(0xb0a8482d, 0x9c6e75b8), - TOBN(0x639961d0, 0x3a191ce2), TOBN(0xda3bc865, 0x6d837930), - TOBN(0xca990653, 0x056e6f8f), TOBN(0x84861c41, 0x64d133a7), - TOBN(0x8b403276, 0x746abe40), TOBN(0xb7b4d51a, 0xebf8e303), - TOBN(0x05b43211, 0x220a255d), TOBN(0xc997152c, 0x02419e6e), - TOBN(0x76ff47b6, 0x630c2fea), TOBN(0x50518677, 0x281fdade), - TOBN(0x3283b8ba, 0xcf902b0b), TOBN(0x8d4b4eb5, 0x37db303b), - TOBN(0xcc89f42d, 0x755011bc), TOBN(0xb43d74bb, 0xdd09d19b), - TOBN(0x65746bc9, 0x8adba350), TOBN(0x364eaf8c, 0xb51c1927), - TOBN(0x13c76596, 0x10ad72ec), TOBN(0x30045121, 0xf8d40c20), - TOBN(0x6d2d99b7, 0xea7b979b), TOBN(0xcd78cd74, 0xe6fb3bcd), - TOBN(0x11e45a9e, 0x86cffbfe), TOBN(0x78a61cf4, 0x637024f6), - TOBN(0xd06bc872, 0x3d502295), TOBN(0xf1376854, 0x458cb288), - TOBN(0xb9db26a1, 0x342f8586), TOBN(0xf33effcf, 0x4beee09e), - TOBN(0xd7e0c4cd, 0xb30cfb3a), TOBN(0x6d09b8c1, 0x6c9db4c8), - TOBN(0x40ba1a42, 0x07c8d9df), TOBN(0x6fd495f7, 0x1c52c66d), - TOBN(0xfb0e169f, 0x275264da), TOBN(0x80c2b746, 0xe57d8362), - TOBN(0xedd987f7, 0x49ad7222), TOBN(0xfdc229af, 0x4398ec7b)}, - {TOBN(0xb0d1ed84, 0x52666a58), TOBN(0x4bcb6e00, 0xe6a9c3c2), - TOBN(0x3c57411c, 0x26906408), TOBN(0xcfc20755, 0x13556400), - TOBN(0xa08b1c50, 0x5294dba3), TOBN(0xa30ba286, 0x8b7dd31e), - TOBN(0xd70ba90e, 0x991eca74), TOBN(0x094e142c, 0xe762c2b9), - TOBN(0xb81d783e, 0x979f3925), TOBN(0x1efd130a, 0xaf4c89a7), - TOBN(0x525c2144, 0xfd1bf7fa), TOBN(0x4b296904, 0x1b265a9e), - TOBN(0xed8e9634, 0xb9db65b6), TOBN(0x35c82e32, 0x03599d8a), - TOBN(0xdaa7a54f, 0x403563f3), TOBN(0x9df088ad, 0x022c38ab), - TOBN(0xe5cfb066, 0xbb3fd30a), TOBN(0x429169da, 0xeff0354e), - TOBN(0x809cf852, 0x3524e36c), TOBN(0x136f4fb3, 0x0155be1d), - TOBN(0x4826af01, 0x1fbba712), TOBN(0x6ef0f0b4, 0x506ba1a1), - TOBN(0xd9928b31, 0x77aea73e), TOBN(0xe2bf6af2, 0x5eaa244e), - TOBN(0x8d084f12, 0x4237b64b), TOBN(0x688ebe99, 0xe3ecfd07), - TOBN(0x57b8a70c, 0xf6845dd8), TOBN(0x808fc59c, 0x5da4a325), - TOBN(0xa9032b2b, 0xa3585862), TOBN(0xb66825d5, 0xedf29386), - TOBN(0xb5a5a8db, 0x431ec29b), TOBN(0xbb143a98, 0x3a1e8dc8), - TOBN(0x35ee94ce, 0x12ae381b), TOBN(0x3a7f176c, 0x86ccda90), - TOBN(0xc63a657e, 0x4606eaca), TOBN(0x9ae5a380, 0x43cd04df), - TOBN(0x9bec8d15, 0xed251b46), TOBN(0x1f5d6d30, 0xcaca5e64), - TOBN(0x347b3b35, 0x9ff20f07), TOBN(0x4d65f034, 0xf7e4b286), - TOBN(0x9e93ba24, 0xf111661e), TOBN(0xedced484, 0xb105eb04), - TOBN(0x96dc9ba1, 0xf424b578), TOBN(0xbf8f66b7, 0xe83e9069), - TOBN(0x872d4df4, 0xd7ed8216), TOBN(0xbf07f377, 0x8e2cbecf), - TOBN(0x4281d899, 0x98e73754), TOBN(0xfec85fbb, 0x8aab8708), - TOBN(0x9a3c0dee, 0xa5ba5b0b), TOBN(0xe6a116ce, 0x42d05299), - TOBN(0xae9775fe, 0xe9b02d42), TOBN(0x72b05200, 0xa1545cb6), - TOBN(0xbc506f7d, 0x31a3b4ea), TOBN(0xe5893078, 0x8bbd9b32), - TOBN(0xc8bc5f37, 0xe4b12a97), TOBN(0x6b000c06, 0x4a73b671), - TOBN(0x13b5bf22, 0x765fa7d0), TOBN(0x59805bf0, 0x1d6a5370), - TOBN(0x67a5e29d, 0x4280db98), TOBN(0x4f53916f, 0x776b1ce3), - TOBN(0x714ff61f, 0x33ddf626), TOBN(0x4206238e, 0xa085d103), - TOBN(0x1c50d4b7, 0xe5809ee3), TOBN(0x999f450d, 0x85f8eb1d), - TOBN(0x658a6051, 0xe4c79e9b), TOBN(0x1394cb73, 0xc66a9fea), - TOBN(0x27f31ed5, 0xc6be7b23), TOBN(0xf4c88f36, 0x5aa6f8fe), - TOBN(0x0fb0721f, 0x4aaa499e), TOBN(0x68b3a7d5, 0xe3fb2a6b), - TOBN(0xa788097d, 0x3a92851d), TOBN(0x060e7f8a, 0xe96f4913), - TOBN(0x82eebe73, 0x1a3a93bc), TOBN(0x42bbf465, 0xa21adc1a), - TOBN(0xc10b6fa4, 0xef030efd), TOBN(0x247aa4c7, 0x87b097bb), - TOBN(0x8b8dc632, 0xf60c77da), TOBN(0x6ffbc26a, 0xc223523e), - TOBN(0xa4f6ff11, 0x344579cf), TOBN(0x5825653c, 0x980250f6), - TOBN(0xb2dd097e, 0xbc1aa2b9), TOBN(0x07889393, 0x37a0333a), - TOBN(0x1cf55e71, 0x37a0db38), TOBN(0x2648487f, 0x792c1613), - TOBN(0xdad01336, 0x3fcef261), TOBN(0x6239c81d, 0x0eabf129), - TOBN(0x8ee761de, 0x9d276be2), TOBN(0x406a7a34, 0x1eda6ad3), - TOBN(0x4bf367ba, 0x4a493b31), TOBN(0x54f20a52, 0x9bf7f026), - TOBN(0xb696e062, 0x9795914b), TOBN(0xcddab96d, 0x8bf236ac), - TOBN(0x4ff2c70a, 0xed25ea13), TOBN(0xfa1d09eb, 0x81cbbbe7), - TOBN(0x88fc8c87, 0x468544c5), TOBN(0x847a670d, 0x696b3317), - TOBN(0xf133421e, 0x64bcb626), TOBN(0xaea638c8, 0x26dee0b5), - TOBN(0xd6e7680b, 0xb310346c), TOBN(0xe06f4097, 0xd5d4ced3), - TOBN(0x09961452, 0x7512a30b), TOBN(0xf3d867fd, 0xe589a59a), - TOBN(0x2e73254f, 0x52d0c180), TOBN(0x9063d8a3, 0x333c74ac), - TOBN(0xeda6c595, 0xd314e7bc), TOBN(0x2ee7464b, 0x467899ed), - TOBN(0x1cef423c, 0x0a1ed5d3), TOBN(0x217e76ea, 0x69cc7613), - TOBN(0x27ccce1f, 0xe7cda917), TOBN(0x12d8016b, 0x8a893f16), - TOBN(0xbcd6de84, 0x9fc74f6b), TOBN(0xfa5817e2, 0xf3144e61), - TOBN(0x1f354164, 0x0821ee4c), TOBN(0x1583eab4, 0x0bc61992), - TOBN(0x7490caf6, 0x1d72879f), TOBN(0x998ad9f3, 0xf76ae7b2), - TOBN(0x1e181950, 0xa41157f7), TOBN(0xa9d7e1e6, 0xe8da3a7e), - TOBN(0x963784eb, 0x8426b95f), TOBN(0x0ee4ed6e, 0x542e2a10), - TOBN(0xb79d4cc5, 0xac751e7b), TOBN(0x93f96472, 0xfd4211bd), - TOBN(0x8c72d3d2, 0xc8de4fc6), TOBN(0x7b69cbf5, 0xdf44f064), - TOBN(0x3da90ca2, 0xf4bf94e1), TOBN(0x1a5325f8, 0xf12894e2), - TOBN(0x0a437f6c, 0x7917d60b), TOBN(0x9be70486, 0x96c9cb5d), - TOBN(0xb4d880bf, 0xe1dc5c05), TOBN(0xd738adda, 0xeebeeb57), - TOBN(0x6f0119d3, 0xdf0fe6a3), TOBN(0x5c686e55, 0x66eaaf5a), - TOBN(0x9cb10b50, 0xdfd0b7ec), TOBN(0xbdd0264b, 0x6a497c21), - TOBN(0xfc093514, 0x8c546c96), TOBN(0x58a947fa, 0x79dbf42a), - TOBN(0xc0b48d4e, 0x49ccd6d7), TOBN(0xff8fb02c, 0x88bd5580), - TOBN(0xc75235e9, 0x07d473b2), TOBN(0x4fab1ac5, 0xa2188af3), - TOBN(0x030fa3bc, 0x97576ec0), TOBN(0xe8c946e8, 0x0b7e7d2f), - TOBN(0x40a5c9cc, 0x70305600), TOBN(0x6d8260a9, 0xc8b013b4), - TOBN(0x0368304f, 0x70bba85c), TOBN(0xad090da1, 0xa4a0d311), - TOBN(0x7170e870, 0x2415eec1), TOBN(0xbfba35fe, 0x8461ea47), - TOBN(0x6279019a, 0xc1e91938), TOBN(0xa47638f3, 0x1afc415f), - TOBN(0x36c65cbb, 0xbcba0e0f), TOBN(0x02160efb, 0x034e2c48), - TOBN(0xe6c51073, 0x615cd9e4), TOBN(0x498ec047, 0xf1243c06), - TOBN(0x3e5a8809, 0xb17b3d8c), TOBN(0x5cd99e61, 0x0cc565f1), - TOBN(0x81e312df, 0x7851dafe), TOBN(0xf156f5ba, 0xa79061e2), - TOBN(0x80d62b71, 0x880c590e), TOBN(0xbec9746f, 0x0a39faa1), - TOBN(0x1d98a9c1, 0xc8ed1f7a), TOBN(0x09e43bb5, 0xa81d5ff2), - TOBN(0xd5f00f68, 0x0da0794a), TOBN(0x412050d9, 0x661aa836), - TOBN(0xa89f7c4e, 0x90747e40), TOBN(0x6dc05ebb, 0xb62a3686), - TOBN(0xdf4de847, 0x308e3353), TOBN(0x53868fbb, 0x9fb53bb9), - TOBN(0x2b09d2c3, 0xcfdcf7dd), TOBN(0x41a9fce3, 0x723fcab4), - TOBN(0x73d905f7, 0x07f57ca3), TOBN(0x080f9fb1, 0xac8e1555), - TOBN(0x7c088e84, 0x9ba7a531), TOBN(0x07d35586, 0xed9a147f), - TOBN(0x602846ab, 0xaf48c336), TOBN(0x7320fd32, 0x0ccf0e79), - TOBN(0xaa780798, 0xb18bd1ff), TOBN(0x52c2e300, 0xafdd2905), - TOBN(0xf27ea3d6, 0x434267cd), TOBN(0x8b96d16d, 0x15605b5f), - TOBN(0x7bb31049, 0x4b45706b), TOBN(0xe7f58b8e, 0x743d25f8), - TOBN(0xe9b5e45b, 0x87f30076), TOBN(0xd19448d6, 0x5d053d5a), - TOBN(0x1ecc8cb9, 0xd3210a04), TOBN(0x6bc7d463, 0xdafb5269), - TOBN(0x3e59b10a, 0x67c3489f), TOBN(0x1769788c, 0x65641e1b), - TOBN(0x8a53b82d, 0xbd6cb838), TOBN(0x7066d6e6, 0x236d5f22), - TOBN(0x03aa1c61, 0x6908536e), TOBN(0xc971da0d, 0x66ae9809), - TOBN(0x01b3a86b, 0xc49a2fac), TOBN(0x3b8420c0, 0x3092e77a), - TOBN(0x02057300, 0x7d6fb556), TOBN(0x6941b2a1, 0xbff40a87), - TOBN(0x140b6308, 0x0658ff2a), TOBN(0x87804363, 0x3424ab36), - TOBN(0x0253bd51, 0x5751e299), TOBN(0xc75bcd76, 0x449c3e3a), - TOBN(0x92eb4090, 0x7f8f875d), TOBN(0x9c9d754e, 0x56c26bbf), - TOBN(0x158cea61, 0x8110bbe7), TOBN(0x62a6b802, 0x745f91ea), - TOBN(0xa79c41aa, 0xc6e7394b), TOBN(0x445b6a83, 0xad57ef10), - TOBN(0x0c5277eb, 0x6ea6f40c), TOBN(0x319fe96b, 0x88633365), - TOBN(0x0b0fc61f, 0x385f63cb), TOBN(0x41250c84, 0x22bdd127), - TOBN(0x67d153f1, 0x09e942c2), TOBN(0x60920d08, 0xc021ad5d), - TOBN(0x229f5746, 0x724d81a5), TOBN(0xb7ffb892, 0x5bba3299), - TOBN(0x518c51a1, 0xde413032), TOBN(0x2a9bfe77, 0x3c2fd94c), - TOBN(0xcbcde239, 0x3191f4fd), TOBN(0x43093e16, 0xd3d6ada1), - TOBN(0x184579f3, 0x58769606), TOBN(0x2c94a8b3, 0xd236625c), - TOBN(0x6922b9c0, 0x5c437d8e), TOBN(0x3d4ae423, 0xd8d9f3c8), - TOBN(0xf72c31c1, 0x2e7090a2), TOBN(0x4ac3f5f3, 0xd76a55bd), - TOBN(0x342508fc, 0x6b6af991), TOBN(0x0d527100, 0x1b5cebbd), - TOBN(0xb84740d0, 0xdd440dd7), TOBN(0x748ef841, 0x780162fd), - TOBN(0xa8dbfe0e, 0xdfc6fafb), TOBN(0xeadfdf05, 0xf7300f27), - TOBN(0x7d06555f, 0xfeba4ec9), TOBN(0x12c56f83, 0x9e25fa97), - TOBN(0x77f84203, 0xd39b8c34), TOBN(0xed8b1be6, 0x3125eddb), - TOBN(0x5bbf2441, 0xf6e39dc5), TOBN(0xb00f6ee6, 0x6a5d678a), - TOBN(0xba456ecf, 0x57d0ea99), TOBN(0xdcae0f58, 0x17e06c43), - TOBN(0x01643de4, 0x0f5b4baa), TOBN(0x2c324341, 0xd161b9be), - TOBN(0x80177f55, 0xe126d468), TOBN(0xed325f1f, 0x76748e09), - TOBN(0x6116004a, 0xcfa9bdc2), TOBN(0x2d8607e6, 0x3a9fb468), - TOBN(0x0e573e27, 0x6009d660), TOBN(0x3a525d2e, 0x8d10c5a1), - TOBN(0xd26cb45c, 0x3b9009a0), TOBN(0xb6b0cdc0, 0xde9d7448), - TOBN(0x949c9976, 0xe1337c26), TOBN(0x6faadebd, 0xd73d68e5), - TOBN(0x9e158614, 0xf1b768d9), TOBN(0x22dfa557, 0x9cc4f069), - TOBN(0xccd6da17, 0xbe93c6d6), TOBN(0x24866c61, 0xa504f5b9), - TOBN(0x2121353c, 0x8d694da1), TOBN(0x1c6ca580, 0x0140b8c6), - TOBN(0xc245ad8c, 0xe964021e), TOBN(0xb83bffba, 0x032b82b3), - TOBN(0xfaa220c6, 0x47ef9898), TOBN(0x7e8d3ac6, 0x982c948a), - TOBN(0x1faa2091, 0xbc2d124a), TOBN(0xbd54c3dd, 0x05b15ff4), - TOBN(0x386bf3ab, 0xc87c6fb7), TOBN(0xfb2b0563, 0xfdeb6f66), - TOBN(0x4e77c557, 0x5b45afb4), TOBN(0xe9ded649, 0xefb8912d), - TOBN(0x7ec9bbf5, 0x42f6e557), TOBN(0x2570dfff, 0x62671f00), - TOBN(0x2b3bfb78, 0x88e084bd), TOBN(0xa024b238, 0xf37fe5b4), - TOBN(0x44e7dc04, 0x95649aee), TOBN(0x498ca255, 0x5e7ec1d8), - TOBN(0x3bc766ea, 0xaaa07e86), TOBN(0x0db6facb, 0xf3608586), - TOBN(0xbadd2549, 0xbdc259c8), TOBN(0x95af3c6e, 0x041c649f), - TOBN(0xb36a928c, 0x02e30afb), TOBN(0x9b5356ad, 0x008a88b8), - TOBN(0x4b67a5f1, 0xcf1d9e9d), TOBN(0xc6542e47, 0xa5d8d8ce), - TOBN(0x73061fe8, 0x7adfb6cc), TOBN(0xcc826fd3, 0x98678141), - TOBN(0x00e758b1, 0x3c80515a), TOBN(0x6afe3247, 0x41485083), - TOBN(0x0fcb08b9, 0xb6ae8a75), TOBN(0xb8cf388d, 0x4acf51e1), - TOBN(0x344a5560, 0x6961b9d6), TOBN(0x1a6778b8, 0x6a97fd0c), - TOBN(0xd840fdc1, 0xecc4c7e3), TOBN(0xde9fe47d, 0x16db68cc), - TOBN(0xe95f89de, 0xa3e216aa), TOBN(0x84f1a6a4, 0x9594a8be), - TOBN(0x7ddc7d72, 0x5a7b162b), TOBN(0xc5cfda19, 0xadc817a3), - TOBN(0x80a5d350, 0x78b58d46), TOBN(0x93365b13, 0x82978f19), - TOBN(0x2e44d225, 0x26a1fc90), TOBN(0x0d6d10d2, 0x4d70705d), - TOBN(0xd94b6b10, 0xd70c45f4), TOBN(0x0f201022, 0xb216c079), - TOBN(0xcec966c5, 0x658fde41), TOBN(0xa8d2bc7d, 0x7e27601d), - TOBN(0xbfcce3e1, 0xff230be7), TOBN(0x3394ff6b, 0x0033ffb5), - TOBN(0xd890c509, 0x8132c9af), TOBN(0xaac4b0eb, 0x361e7868), - TOBN(0x5194ded3, 0xe82d15aa), TOBN(0x4550bd2e, 0x23ae6b7d), - TOBN(0x3fda318e, 0xea5399d4), TOBN(0xd989bffa, 0x91638b80), - TOBN(0x5ea124d0, 0xa14aa12d), TOBN(0x1fb1b899, 0x3667b944), - TOBN(0x95ec7969, 0x44c44d6a), TOBN(0x91df144a, 0x57e86137), - TOBN(0x915fd620, 0x73adac44), TOBN(0x8f01732d, 0x59a83801), - TOBN(0xec579d25, 0x3aa0a633), TOBN(0x06de5e7c, 0xc9d6d59c), - TOBN(0xc132f958, 0xb1ef8010), TOBN(0x29476f96, 0xe65c1a02), - TOBN(0x336a77c0, 0xd34c3565), TOBN(0xef1105b2, 0x1b9f1e9e), - TOBN(0x63e6d08b, 0xf9e08002), TOBN(0x9aff2f21, 0xc613809e), - TOBN(0xb5754f85, 0x3a80e75d), TOBN(0xde71853e, 0x6bbda681), - TOBN(0x86f041df, 0x8197fd7a), TOBN(0x8b332e08, 0x127817fa), - TOBN(0x05d99be8, 0xb9c20cda), TOBN(0x89f7aad5, 0xd5cd0c98), - TOBN(0x7ef936fe, 0x5bb94183), TOBN(0x92ca0753, 0xb05cd7f2), - TOBN(0x9d65db11, 0x74a1e035), TOBN(0x02628cc8, 0x13eaea92), - TOBN(0xf2d9e242, 0x49e4fbf2), TOBN(0x94fdfd9b, 0xe384f8b7), - TOBN(0x65f56054, 0x63428c6b), TOBN(0x2f7205b2, 0x90b409a5), - TOBN(0xf778bb78, 0xff45ae11), TOBN(0xa13045be, 0xc5ee53b2), - TOBN(0xe00a14ff, 0x03ef77fe), TOBN(0x689cd59f, 0xffef8bef), - TOBN(0x3578f0ed, 0x1e9ade22), TOBN(0xe99f3ec0, 0x6268b6a8), - TOBN(0xa2057d91, 0xea1b3c3e), TOBN(0x2d1a7053, 0xb8823a4a), - TOBN(0xabbb336a, 0x2cca451e), TOBN(0xcd2466e3, 0x2218bb5d), - TOBN(0x3ac1f42f, 0xc8cb762d), TOBN(0x7e312aae, 0x7690211f), - TOBN(0xebb9bd73, 0x45d07450), TOBN(0x207c4b82, 0x46c2213f), - TOBN(0x99d425c1, 0x375913ec), TOBN(0x94e45e96, 0x67908220), - TOBN(0xc08f3087, 0xcd67dbf6), TOBN(0xa5670fbe, 0xc0887056), - TOBN(0x6717b64a, 0x66f5b8fc), TOBN(0xd5a56aea, 0x786fec28), - TOBN(0xa8c3f55f, 0xc0ff4952), TOBN(0xa77fefae, 0x457ac49b), - TOBN(0x29882d7c, 0x98379d44), TOBN(0xd000bdfb, 0x509edc8a), - TOBN(0xc6f95979, 0xe66fe464), TOBN(0x504a6115, 0xfa61bde0), - TOBN(0x56b3b871, 0xeffea31a), TOBN(0x2d3de26d, 0xf0c21a54), - TOBN(0x21dbff31, 0x834753bf), TOBN(0xe67ecf49, 0x69269d86), - TOBN(0x7a176952, 0x151fe690), TOBN(0x03515804, 0x7f2adb5f), - TOBN(0xee794b15, 0xd1b62a8d), TOBN(0xf004ceec, 0xaae454e6), - TOBN(0x0897ea7c, 0xf0386fac), TOBN(0x3b62ff12, 0xd1fca751), - TOBN(0x154181df, 0x1b7a04ec), TOBN(0x2008e04a, 0xfb5847ec), - TOBN(0xd147148e, 0x41dbd772), TOBN(0x2b419f73, 0x22942654), - TOBN(0x669f30d3, 0xe9c544f7), TOBN(0x52a2c223, 0xc8540149), - TOBN(0x5da9ee14, 0x634dfb02), TOBN(0x5f074ff0, 0xf47869f3), - TOBN(0x74ee878d, 0xa3933acc), TOBN(0xe6510651, 0x4fe35ed1), - TOBN(0xb3eb9482, 0xf1012e7a), TOBN(0x51013cc0, 0xa8a566ae), - TOBN(0xdd5e9243, 0x47c00d3b), TOBN(0x7fde089d, 0x946bb0e5), - TOBN(0x030754fe, 0xc731b4b3), TOBN(0x12a136a4, 0x99fda062), - TOBN(0x7c1064b8, 0x5a1a35bc), TOBN(0xbf1f5763, 0x446c84ef), - TOBN(0xed29a56d, 0xa16d4b34), TOBN(0x7fba9d09, 0xdca21c4f), - TOBN(0x66d7ac00, 0x6d8de486), TOBN(0x60061987, 0x73a2a5e1), - TOBN(0x8b400f86, 0x9da28ff0), TOBN(0x3133f708, 0x43c4599c), - TOBN(0x9911c9b8, 0xee28cb0d), TOBN(0xcd7e2874, 0x8e0af61d), - TOBN(0x5a85f0f2, 0x72ed91fc), TOBN(0x85214f31, 0x9cd4a373), - TOBN(0x881fe5be, 0x1925253c), TOBN(0xd8dc98e0, 0x91e8bc76), - TOBN(0x7120affe, 0x585cc3a2), TOBN(0x724952ed, 0x735bf97a), - TOBN(0x5581e7dc, 0x3eb34581), TOBN(0x5cbff4f2, 0xe52ee57d), - TOBN(0x8d320a0e, 0x87d8cc7b), TOBN(0x9beaa7f3, 0xf1d280d0), - TOBN(0x7a0b9571, 0x9beec704), TOBN(0x9126332e, 0x5b7f0057), - TOBN(0x01fbc1b4, 0x8ed3bd6d), TOBN(0x35bb2c12, 0xd945eb24), - TOBN(0x6404694e, 0x9a8ae255), TOBN(0xb6092eec, 0x8d6abfb3), - TOBN(0x4d76143f, 0xcc058865), TOBN(0x7b0a5af2, 0x6e249922), - TOBN(0x8aef9440, 0x6a50d353), TOBN(0xe11e4bcc, 0x64f0e07a), - TOBN(0x4472993a, 0xa14a90fa), TOBN(0x7706e20c, 0xba0c51d4), - TOBN(0xf403292f, 0x1532672d), TOBN(0x52573bfa, 0x21829382), - TOBN(0x6a7bb6a9, 0x3b5bdb83), TOBN(0x08da65c0, 0xa4a72318), - TOBN(0xc58d22aa, 0x63eb065f), TOBN(0x1717596c, 0x1b15d685), - TOBN(0x112df0d0, 0xb266d88b), TOBN(0xf688ae97, 0x5941945a), - TOBN(0x487386e3, 0x7c292cac), TOBN(0x42f3b50d, 0x57d6985c), - TOBN(0x6da4f998, 0x6a90fc34), TOBN(0xc8f257d3, 0x65ca8a8d), - TOBN(0xc2feabca, 0x6951f762), TOBN(0xe1bc81d0, 0x74c323ac), - TOBN(0x1bc68f67, 0x251a2a12), TOBN(0x10d86587, 0xbe8a70dc), - TOBN(0xd648af7f, 0xf0f84d2e), TOBN(0xf0aa9ebc, 0x6a43ac92), - TOBN(0x69e3be04, 0x27596893), TOBN(0xb6bb02a6, 0x45bf452b), - TOBN(0x0875c11a, 0xf4c698c8), TOBN(0x6652b5c7, 0xbece3794), - TOBN(0x7b3755fd, 0x4f5c0499), TOBN(0x6ea16558, 0xb5532b38), - TOBN(0xd1c69889, 0xa2e96ef7), TOBN(0x9c773c3a, 0x61ed8f48), - TOBN(0x2b653a40, 0x9b323abc), TOBN(0xe26605e1, 0xf0e1d791), - TOBN(0x45d41064, 0x4a87157a), TOBN(0x8f9a78b7, 0xcbbce616), - TOBN(0xcf1e44aa, 0xc407eddd), TOBN(0x81ddd1d8, 0xa35b964f), - TOBN(0x473e339e, 0xfd083999), TOBN(0x6c94bdde, 0x8e796802), - TOBN(0x5a304ada, 0x8545d185), TOBN(0x82ae44ea, 0x738bb8cb), - TOBN(0x628a35e3, 0xdf87e10e), TOBN(0xd3624f3d, 0xa15b9fe3), - TOBN(0xcc44209b, 0x14be4254), TOBN(0x7d0efcbc, 0xbdbc2ea5), - TOBN(0x1f603362, 0x04c37bbe), TOBN(0x21f363f5, 0x56a5852c), - TOBN(0xa1503d1c, 0xa8501550), TOBN(0x2251e0e1, 0xd8ab10bb), - TOBN(0xde129c96, 0x6961c51c), TOBN(0x1f7246a4, 0x81910f68), - TOBN(0x2eb744ee, 0x5f2591f2), TOBN(0x3c47d33f, 0x5e627157), - TOBN(0x4d6d62c9, 0x22f3bd68), TOBN(0x6120a64b, 0xcb8df856), - TOBN(0x3a9ac6c0, 0x7b5d07df), TOBN(0xa92b9558, 0x7ef39783), - TOBN(0xe128a134, 0xab3a9b4f), TOBN(0x41c18807, 0xb1252f05), - TOBN(0xfc7ed089, 0x80ba9b1c), TOBN(0xac8dc6de, 0xc532a9dd), - TOBN(0xbf829cef, 0x55246809), TOBN(0x101b784f, 0x5b4ee80f), - TOBN(0xc09945bb, 0xb6f11603), TOBN(0x57b09dbe, 0x41d2801e), - TOBN(0xfba5202f, 0xa97534a8), TOBN(0x7fd8ae5f, 0xc17b9614), - TOBN(0xa50ba666, 0x78308435), TOBN(0x9572f77c, 0xd3868c4d), - TOBN(0x0cef7bfd, 0x2dd7aab0), TOBN(0xe7958e08, 0x2c7c79ff), - TOBN(0x81262e42, 0x25346689), TOBN(0x716da290, 0xb07c7004), - TOBN(0x35f911ea, 0xb7950ee3), TOBN(0x6fd72969, 0x261d21b5), - TOBN(0x52389803, 0x08b640d3), TOBN(0x5b0026ee, 0x887f12a1), - TOBN(0x20e21660, 0x742e9311), TOBN(0x0ef6d541, 0x5ff77ff7), - TOBN(0x969127f0, 0xf9c41135), TOBN(0xf21d60c9, 0x68a64993), - TOBN(0x656e5d0c, 0xe541875c), TOBN(0xf1e0f84e, 0xa1d3c233), - TOBN(0x9bcca359, 0x06002d60), TOBN(0xbe2da60c, 0x06191552), - TOBN(0x5da8bbae, 0x61181ec3), TOBN(0x9f04b823, 0x65806f19), - TOBN(0xf1604a7d, 0xd4b79bb8), TOBN(0xaee806fb, 0x52c878c8), - TOBN(0x34144f11, 0x8d47b8e8), TOBN(0x72edf52b, 0x949f9054), - TOBN(0xebfca84e, 0x2127015a), TOBN(0x9051d0c0, 0x9cb7cef3), - TOBN(0x86e8fe58, 0x296deec8), TOBN(0x33b28188, 0x41010d74)}, - {TOBN(0x01079383, 0x171b445f), TOBN(0x9bcf21e3, 0x8131ad4c), - TOBN(0x8cdfe205, 0xc93987e8), TOBN(0xe63f4152, 0xc92e8c8f), - TOBN(0x729462a9, 0x30add43d), TOBN(0x62ebb143, 0xc980f05a), - TOBN(0x4f3954e5, 0x3b06e968), TOBN(0xfe1d75ad, 0x242cf6b1), - TOBN(0x5f95c6c7, 0xaf8685c8), TOBN(0xd4c1c8ce, 0x2f8f01aa), - TOBN(0xc44bbe32, 0x2574692a), TOBN(0xb8003478, 0xd4a4a068), - TOBN(0x7c8fc6e5, 0x2eca3cdb), TOBN(0xea1db16b, 0xec04d399), - TOBN(0xb05bc82e, 0x8f2bc5cf), TOBN(0x763d517f, 0xf44793d2), - TOBN(0x4451c1b8, 0x08bd98d0), TOBN(0x644b1cd4, 0x6575f240), - TOBN(0x6907eb33, 0x7375d270), TOBN(0x56c8bebd, 0xfa2286bd), - TOBN(0xc713d2ac, 0xc4632b46), TOBN(0x17da427a, 0xafd60242), - TOBN(0x313065b7, 0xc95c7546), TOBN(0xf8239898, 0xbf17a3de), - TOBN(0xf3b7963f, 0x4c830320), TOBN(0x842c7aa0, 0x903203e3), - TOBN(0xaf22ca0a, 0xe7327afb), TOBN(0x38e13092, 0x967609b6), - TOBN(0x73b8fb62, 0x757558f1), TOBN(0x3cc3e831, 0xf7eca8c1), - TOBN(0xe4174474, 0xf6331627), TOBN(0xa77989ca, 0xc3c40234), - TOBN(0xe5fd17a1, 0x44a081e0), TOBN(0xd797fb7d, 0xb70e296a), - TOBN(0x2b472b30, 0x481f719c), TOBN(0x0e632a98, 0xfe6f8c52), - TOBN(0x89ccd116, 0xc5f0c284), TOBN(0xf51088af, 0x2d987c62), - TOBN(0x2a2bccda, 0x4c2de6cf), TOBN(0x810f9efe, 0xf679f0f9), - TOBN(0xb0f394b9, 0x7ffe4b3e), TOBN(0x0b691d21, 0xe5fa5d21), - TOBN(0xb0bd7747, 0x9dfbbc75), TOBN(0xd2830fda, 0xfaf78b00), - TOBN(0xf78c249c, 0x52434f57), TOBN(0x4b1f7545, 0x98096dab), - TOBN(0x73bf6f94, 0x8ff8c0b3), TOBN(0x34aef03d, 0x454e134c), - TOBN(0xf8d151f4, 0xb7ac7ec5), TOBN(0xd6ceb95a, 0xe50da7d5), - TOBN(0xa1b492b0, 0xdc3a0eb8), TOBN(0x75157b69, 0xb3dd2863), - TOBN(0xe2c4c74e, 0xc5413d62), TOBN(0xbe329ff7, 0xbc5fc4c7), - TOBN(0x835a2aea, 0x60fa9dda), TOBN(0xf117f5ad, 0x7445cb87), - TOBN(0xae8317f4, 0xb0166f7a), TOBN(0xfbd3e3f7, 0xceec74e6), - TOBN(0xfdb516ac, 0xe0874bfd), TOBN(0x3d846019, 0xc681f3a3), - TOBN(0x0b12ee5c, 0x7c1620b0), TOBN(0xba68b4dd, 0x2b63c501), - TOBN(0xac03cd32, 0x6668c51e), TOBN(0x2a6279f7, 0x4e0bcb5b), - TOBN(0x17bd69b0, 0x6ae85c10), TOBN(0x72946979, 0x1dfdd3a6), - TOBN(0xd9a03268, 0x2c078bec), TOBN(0x41c6a658, 0xbfd68a52), - TOBN(0xcdea1024, 0x0e023900), TOBN(0xbaeec121, 0xb10d144d), - TOBN(0x5a600e74, 0x058ab8dc), TOBN(0x1333af21, 0xbb89ccdd), - TOBN(0xdf25eae0, 0x3aaba1f1), TOBN(0x2cada16e, 0x3b7144cf), - TOBN(0x657ee27d, 0x71ab98bc), TOBN(0x99088b4c, 0x7a6fc96e), - TOBN(0x05d5c0a0, 0x3549dbd4), TOBN(0x42cbdf8f, 0xf158c3ac), - TOBN(0x3fb6b3b0, 0x87edd685), TOBN(0x22071cf6, 0x86f064d0), - TOBN(0xd2d6721f, 0xff2811e5), TOBN(0xdb81b703, 0xfe7fae8c), - TOBN(0x3cfb74ef, 0xd3f1f7bb), TOBN(0x0cdbcd76, 0x16cdeb5d), - TOBN(0x4f39642a, 0x566a808c), TOBN(0x02b74454, 0x340064d6), - TOBN(0xfabbadca, 0x0528fa6f), TOBN(0xe4c3074c, 0xd3fc0bb6), - TOBN(0xb32cb8b0, 0xb796d219), TOBN(0xc3e95f4f, 0x34741dd9), - TOBN(0x87212125, 0x68edf6f5), TOBN(0x7a03aee4, 0xa2b9cb8e), - TOBN(0x0cd3c376, 0xf53a89aa), TOBN(0x0d8af9b1, 0x948a28dc), - TOBN(0xcf86a3f4, 0x902ab04f), TOBN(0x8aacb62a, 0x7f42002d), - TOBN(0x106985eb, 0xf62ffd52), TOBN(0xe670b54e, 0x5797bf10), - TOBN(0x4b405209, 0xc5e30aef), TOBN(0x12c97a20, 0x4365b5e9), - TOBN(0x104646ce, 0x1fe32093), TOBN(0x13cb4ff6, 0x3907a8c9), - TOBN(0x8b9f30d1, 0xd46e726b), TOBN(0xe1985e21, 0xaba0f499), - TOBN(0xc573dea9, 0x10a230cd), TOBN(0x24f46a93, 0xcd30f947), - TOBN(0xf2623fcf, 0xabe2010a), TOBN(0x3f278cb2, 0x73f00e4f), - TOBN(0xed55c67d, 0x50b920eb), TOBN(0xf1cb9a2d, 0x8e760571), - TOBN(0x7c50d109, 0x0895b709), TOBN(0x4207cf07, 0x190d4369), - TOBN(0x3b027e81, 0xc4127fe1), TOBN(0xa9f8b9ad, 0x3ae9c566), - TOBN(0x5ab10851, 0xacbfbba5), TOBN(0xa747d648, 0x569556f5), - TOBN(0xcc172b5c, 0x2ba97bf7), TOBN(0x15e0f77d, 0xbcfa3324), - TOBN(0xa345b797, 0x7686279d), TOBN(0x5a723480, 0xe38003d3), - TOBN(0xfd8e139f, 0x8f5fcda8), TOBN(0xf3e558c4, 0xbdee5bfd), - TOBN(0xd76cbaf4, 0xe33f9f77), TOBN(0x3a4c97a4, 0x71771969), - TOBN(0xda27e84b, 0xf6dce6a7), TOBN(0xff373d96, 0x13e6c2d1), - TOBN(0xf115193c, 0xd759a6e9), TOBN(0x3f9b7025, 0x63d2262c), - TOBN(0xd9764a31, 0x317cd062), TOBN(0x30779d8e, 0x199f8332), - TOBN(0xd8074106, 0x16b11b0b), TOBN(0x7917ab9f, 0x78aeaed8), - TOBN(0xb67a9cbe, 0x28fb1d8e), TOBN(0x2e313563, 0x136eda33), - TOBN(0x010b7069, 0xa371a86c), TOBN(0x44d90fa2, 0x6744e6b7), - TOBN(0x68190867, 0xd6b3e243), TOBN(0x9fe6cd9d, 0x59048c48), - TOBN(0xb900b028, 0x95731538), TOBN(0xa012062f, 0x32cae04f), - TOBN(0x8107c8bc, 0x9399d082), TOBN(0x47e8c54a, 0x41df12e2), - TOBN(0x14ba5117, 0xb6ef3f73), TOBN(0x22260bea, 0x81362f0b), - TOBN(0x90ea261e, 0x1a18cc20), TOBN(0x2192999f, 0x2321d636), - TOBN(0xef64d314, 0xe311b6a0), TOBN(0xd7401e4c, 0x3b54a1f5), - TOBN(0x19019983, 0x6fbca2ba), TOBN(0x46ad3293, 0x8fbffc4b), - TOBN(0xa142d3f6, 0x3786bf40), TOBN(0xeb5cbc26, 0xb67039fc), - TOBN(0x9cb0ae6c, 0x252bd479), TOBN(0x05e0f88a, 0x12b5848f), - TOBN(0x78f6d2b2, 0xa5c97663), TOBN(0x6f6e149b, 0xc162225c), - TOBN(0xe602235c, 0xde601a89), TOBN(0xd17bbe98, 0xf373be1f), - TOBN(0xcaf49a5b, 0xa8471827), TOBN(0x7e1a0a85, 0x18aaa116), - TOBN(0x6c833196, 0x270580c3), TOBN(0x1e233839, 0xf1c98a14), - TOBN(0x67b2f7b4, 0xae34e0a5), TOBN(0x47ac8745, 0xd8ce7289), - TOBN(0x2b74779a, 0x100dd467), TOBN(0x274a4337, 0x4ee50d09), - TOBN(0x603dcf13, 0x83608bc9), TOBN(0xcd9da6c3, 0xc89e8388), - TOBN(0x2660199f, 0x355116ac), TOBN(0xcc38bb59, 0xb6d18eed), - TOBN(0x3075f31f, 0x2f4bc071), TOBN(0x9774457f, 0x265dc57e), - TOBN(0x06a6a9c8, 0xc6db88bb), TOBN(0x6429d07f, 0x4ec98e04), - TOBN(0x8d05e57b, 0x05ecaa8b), TOBN(0x20f140b1, 0x7872ea7b), - TOBN(0xdf8c0f09, 0xca494693), TOBN(0x48d3a020, 0xf252e909), - TOBN(0x4c5c29af, 0x57b14b12), TOBN(0x7e6fa37d, 0xbf47ad1c), - TOBN(0x66e7b506, 0x49a0c938), TOBN(0xb72c0d48, 0x6be5f41f), - TOBN(0x6a6242b8, 0xb2359412), TOBN(0xcd35c774, 0x8e859480), - TOBN(0x12536fea, 0x87baa627), TOBN(0x58c1fec1, 0xf72aa680), - TOBN(0x6c29b637, 0x601e5dc9), TOBN(0x9e3c3c1c, 0xde9e01b9), - TOBN(0xefc8127b, 0x2bcfe0b0), TOBN(0x35107102, 0x2a12f50d), - TOBN(0x6ccd6cb1, 0x4879b397), TOBN(0xf792f804, 0xf8a82f21), - TOBN(0x509d4804, 0xa9b46402), TOBN(0xedddf85d, 0xc10f0850), - TOBN(0x928410dc, 0x4b6208aa), TOBN(0xf6229c46, 0x391012dc), - TOBN(0xc5a7c41e, 0x7727b9b6), TOBN(0x289e4e4b, 0xaa444842), - TOBN(0x049ba1d9, 0xe9a947ea), TOBN(0x44f9e47f, 0x83c8debc), - TOBN(0xfa77a1fe, 0x611f8b8e), TOBN(0xfd2e416a, 0xf518f427), - TOBN(0xc5fffa70, 0x114ebac3), TOBN(0xfe57c4e9, 0x5d89697b), - TOBN(0xfdd053ac, 0xb1aaf613), TOBN(0x31df210f, 0xea585a45), - TOBN(0x318cc10e, 0x24985034), TOBN(0x1a38efd1, 0x5f1d6130), - TOBN(0xbf86f237, 0x0b1e9e21), TOBN(0xb258514d, 0x1dbe88aa), - TOBN(0x1e38a588, 0x90c1baf9), TOBN(0x2936a01e, 0xbdb9b692), - TOBN(0xd576de98, 0x6dd5b20c), TOBN(0xb586bf71, 0x70f98ecf), - TOBN(0xcccf0f12, 0xc42d2fd7), TOBN(0x8717e61c, 0xfb35bd7b), - TOBN(0x8b1e5722, 0x35e6fc06), TOBN(0x3477728f, 0x0b3e13d5), - TOBN(0x150c294d, 0xaa8a7372), TOBN(0xc0291d43, 0x3bfa528a), - TOBN(0xc6c8bc67, 0xcec5a196), TOBN(0xdeeb31e4, 0x5c2e8a7c), - TOBN(0xba93e244, 0xfb6e1c51), TOBN(0xb9f8b71b, 0x2e28e156), - TOBN(0xce65a287, 0x968a2ab9), TOBN(0xe3c5ce69, 0x46bbcb1f), - TOBN(0xf8c835b9, 0xe7ae3f30), TOBN(0x16bbee26, 0xff72b82b), - TOBN(0x665e2017, 0xfd42cd22), TOBN(0x1e139970, 0xf8b1d2a0), - TOBN(0x125cda29, 0x79204932), TOBN(0x7aee94a5, 0x49c3bee5), - TOBN(0x68c70160, 0x89821a66), TOBN(0xf7c37678, 0x8f981669), - TOBN(0xd90829fc, 0x48cc3645), TOBN(0x346af049, 0xd70addfc), - TOBN(0x2057b232, 0x370bf29c), TOBN(0xf90c73ce, 0x42e650ee), - TOBN(0xe03386ea, 0xa126ab90), TOBN(0x0e266e7e, 0x975a087b), - TOBN(0x80578eb9, 0x0fca65d9), TOBN(0x7e2989ea, 0x16af45b8), - TOBN(0x7438212d, 0xcac75a4e), TOBN(0x38c7ca39, 0x4fef36b8), - TOBN(0x8650c494, 0xd402676a), TOBN(0x26ab5a66, 0xf72c7c48), - TOBN(0x4e6cb426, 0xce3a464e), TOBN(0xf8f99896, 0x2b72f841), - TOBN(0x8c318491, 0x1a335cc8), TOBN(0x563459ba, 0x6a5913e4), - TOBN(0x1b920d61, 0xc7b32919), TOBN(0x805ab8b6, 0xa02425ad), - TOBN(0x2ac512da, 0x8d006086), TOBN(0x6ca4846a, 0xbcf5c0fd), - TOBN(0xafea51d8, 0xac2138d7), TOBN(0xcb647545, 0x344cd443), - TOBN(0x0429ee8f, 0xbd7d9040), TOBN(0xee66a2de, 0x819b9c96), - TOBN(0x54f9ec25, 0xdea7d744), TOBN(0x2ffea642, 0x671721bb), - TOBN(0x4f19dbd1, 0x114344ea), TOBN(0x04304536, 0xfd0dbc8b), - TOBN(0x014b50aa, 0x29ec7f91), TOBN(0xb5fc22fe, 0xbb06014d), - TOBN(0x60d963a9, 0x1ee682e0), TOBN(0xdf48abc0, 0xfe85c727), - TOBN(0x0cadba13, 0x2e707c2d), TOBN(0xde608d3a, 0xa645aeff), - TOBN(0x05f1c28b, 0xedafd883), TOBN(0x3c362ede, 0xbd94de1f), - TOBN(0x8dd0629d, 0x13593e41), TOBN(0x0a5e736f, 0x766d6eaf), - TOBN(0xbfa92311, 0xf68cf9d1), TOBN(0xa4f9ef87, 0xc1797556), - TOBN(0x10d75a1f, 0x5601c209), TOBN(0x651c374c, 0x09b07361), - TOBN(0x49950b58, 0x88b5cead), TOBN(0x0ef00058, 0x6fa9dbaa), - TOBN(0xf51ddc26, 0x4e15f33a), TOBN(0x1f8b5ca6, 0x2ef46140), - TOBN(0x343ac0a3, 0xee9523f0), TOBN(0xbb75eab2, 0x975ea978), - TOBN(0x1bccf332, 0x107387f4), TOBN(0x790f9259, 0x9ab0062e), - TOBN(0xf1a363ad, 0x1e4f6a5f), TOBN(0x06e08b84, 0x62519a50), - TOBN(0x60915187, 0x7265f1ee), TOBN(0x6a80ca34, 0x93ae985e), - TOBN(0x81b29768, 0xaaba4864), TOBN(0xb13cabf2, 0x8d52a7d6), - TOBN(0xb5c36348, 0x8ead03f1), TOBN(0xc932ad95, 0x81c7c1c0), - TOBN(0x5452708e, 0xcae1e27b), TOBN(0x9dac4269, 0x1b0df648), - TOBN(0x233e3f0c, 0xdfcdb8bc), TOBN(0xe6ceccdf, 0xec540174), - TOBN(0xbd0d845e, 0x95081181), TOBN(0xcc8a7920, 0x699355d5), - TOBN(0x111c0f6d, 0xc3b375a8), TOBN(0xfd95bc6b, 0xfd51e0dc), - TOBN(0x4a106a26, 0x6888523a), TOBN(0x4d142bd6, 0xcb01a06d), - TOBN(0x79bfd289, 0xadb9b397), TOBN(0x0bdbfb94, 0xe9863914), - TOBN(0x29d8a229, 0x1660f6a6), TOBN(0x7f6abcd6, 0x551c042d), - TOBN(0x13039deb, 0x0ac3ffe8), TOBN(0xa01be628, 0xec8523fb), - TOBN(0x6ea34103, 0x0ca1c328), TOBN(0xc74114bd, 0xb903928e), - TOBN(0x8aa4ff4e, 0x9e9144b0), TOBN(0x7064091f, 0x7f9a4b17), - TOBN(0xa3f4f521, 0xe447f2c4), TOBN(0x81b8da7a, 0x604291f0), - TOBN(0xd680bc46, 0x7d5926de), TOBN(0x84f21fd5, 0x34a1202f), - TOBN(0x1d1e3181, 0x4e9df3d8), TOBN(0x1ca4861a, 0x39ab8d34), - TOBN(0x809ddeec, 0x5b19aa4a), TOBN(0x59f72f7e, 0x4d329366), - TOBN(0xa2f93f41, 0x386d5087), TOBN(0x40bf739c, 0xdd67d64f), - TOBN(0xb4494205, 0x66702158), TOBN(0xc33c65be, 0x73b1e178), - TOBN(0xcdcd657c, 0x38ca6153), TOBN(0x97f4519a, 0xdc791976), - TOBN(0xcc7c7f29, 0xcd6e1f39), TOBN(0x38de9cfb, 0x7e3c3932), - TOBN(0xe448eba3, 0x7b793f85), TOBN(0xe9f8dbf9, 0xf067e914), - TOBN(0xc0390266, 0xf114ae87), TOBN(0x39ed75a7, 0xcd6a8e2a), - TOBN(0xadb14848, 0x7ffba390), TOBN(0x67f8cb8b, 0x6af9bc09), - TOBN(0x322c3848, 0x9c7476db), TOBN(0xa320fecf, 0x52a538d6), - TOBN(0xe0493002, 0xb2aced2b), TOBN(0xdfba1809, 0x616bd430), - TOBN(0x531c4644, 0xc331be70), TOBN(0xbc04d32e, 0x90d2e450), - TOBN(0x1805a0d1, 0x0f9f142d), TOBN(0x2c44a0c5, 0x47ee5a23), - TOBN(0x31875a43, 0x3989b4e3), TOBN(0x6b1949fd, 0x0c063481), - TOBN(0x2dfb9e08, 0xbe0f4492), TOBN(0x3ff0da03, 0xe9d5e517), - TOBN(0x03dbe9a1, 0xf79466a8), TOBN(0x0b87bcd0, 0x15ea9932), - TOBN(0xeb64fc83, 0xab1f58ab), TOBN(0x6d9598da, 0x817edc8a), - TOBN(0x699cff66, 0x1d3b67e5), TOBN(0x645c0f29, 0x92635853), - TOBN(0x253cdd82, 0xeabaf21c), TOBN(0x82b9602a, 0x2241659e), - TOBN(0x2cae07ec, 0x2d9f7091), TOBN(0xbe4c720c, 0x8b48cd9b), - TOBN(0x6ce5bc03, 0x6f08d6c9), TOBN(0x36e8a997, 0xaf10bf40), - TOBN(0x83422d21, 0x3e10ff12), TOBN(0x7b26d3eb, 0xbcc12494), - TOBN(0xb240d2d0, 0xc9469ad6), TOBN(0xc4a11b4d, 0x30afa05b), - TOBN(0x4b604ace, 0xdd6ba286), TOBN(0x18486600, 0x3ee2864c), - TOBN(0x5869d6ba, 0x8d9ce5be), TOBN(0x0d8f68c5, 0xff4bfb0d), - TOBN(0xb69f210b, 0x5700cf73), TOBN(0x61f6653a, 0x6d37c135), - TOBN(0xff3d432b, 0x5aff5a48), TOBN(0x0d81c4b9, 0x72ba3a69), - TOBN(0xee879ae9, 0xfa1899ef), TOBN(0xbac7e2a0, 0x2d6acafd), - TOBN(0xd6d93f6c, 0x1c664399), TOBN(0x4c288de1, 0x5bcb135d), - TOBN(0x83031dab, 0x9dab7cbf), TOBN(0xfe23feb0, 0x3abbf5f0), - TOBN(0x9f1b2466, 0xcdedca85), TOBN(0x140bb710, 0x1a09538c), - TOBN(0xac8ae851, 0x5e11115d), TOBN(0x0d63ff67, 0x6f03f59e), - TOBN(0x755e5551, 0x7d234afb), TOBN(0x61c2db4e, 0x7e208fc1), - TOBN(0xaa9859ce, 0xf28a4b5d), TOBN(0xbdd6d4fc, 0x34af030f), - TOBN(0xd1c4a26d, 0x3be01cb1), TOBN(0x9ba14ffc, 0x243aa07c), - TOBN(0xf95cd3a9, 0xb2503502), TOBN(0xe379bc06, 0x7d2a93ab), - TOBN(0x3efc18e9, 0xd4ca8d68), TOBN(0x083558ec, 0x80bb412a), - TOBN(0xd903b940, 0x9645a968), TOBN(0xa499f0b6, 0x9ba6054f), - TOBN(0x208b573c, 0xb8349abe), TOBN(0x3baab3e5, 0x30b4fc1c), - TOBN(0x87e978ba, 0xcb524990), TOBN(0x3524194e, 0xccdf0e80), - TOBN(0x62711725, 0x7d4bcc42), TOBN(0xe90a3d9b, 0xb90109ba), - TOBN(0x3b1bdd57, 0x1323e1e0), TOBN(0xb78e9bd5, 0x5eae1599), - TOBN(0x0794b746, 0x9e03d278), TOBN(0x80178605, 0xd70e6297), - TOBN(0x171792f8, 0x99c97855), TOBN(0x11b393ee, 0xf5a86b5c), - TOBN(0x48ef6582, 0xd8884f27), TOBN(0xbd44737a, 0xbf19ba5f), - TOBN(0x8698de4c, 0xa42062c6), TOBN(0x8975eb80, 0x61ce9c54), - TOBN(0xd50e57c7, 0xd7fe71f3), TOBN(0x15342190, 0xbc97ce38), - TOBN(0x51bda2de, 0x4df07b63), TOBN(0xba12aeae, 0x200eb87d), - TOBN(0xabe135d2, 0xa9b4f8f6), TOBN(0x04619d65, 0xfad6d99c), - TOBN(0x4a6683a7, 0x7994937c), TOBN(0x7a778c8b, 0x6f94f09a), - TOBN(0x8c508623, 0x20a71b89), TOBN(0x241a2aed, 0x1c229165), - TOBN(0x352be595, 0xaaf83a99), TOBN(0x9fbfee7f, 0x1562bac8), - TOBN(0xeaf658b9, 0x5c4017e3), TOBN(0x1dc7f9e0, 0x15120b86), - TOBN(0xd84f13dd, 0x4c034d6f), TOBN(0x283dd737, 0xeaea3038), - TOBN(0x197f2609, 0xcd85d6a2), TOBN(0x6ebbc345, 0xfae60177), - TOBN(0xb80f031b, 0x4e12fede), TOBN(0xde55d0c2, 0x07a2186b), - TOBN(0x1fb3e37f, 0x24dcdd5a), TOBN(0x8d602da5, 0x7ed191fb), - TOBN(0x108fb056, 0x76023e0d), TOBN(0x70178c71, 0x459c20c0), - TOBN(0xfad5a386, 0x3fe54cf0), TOBN(0xa4a3ec4f, 0x02bbb475), - TOBN(0x1aa5ec20, 0x919d94d7), TOBN(0x5d3b63b5, 0xa81e4ab3), - TOBN(0x7fa733d8, 0x5ad3d2af), TOBN(0xfbc586dd, 0xd1ac7a37), - TOBN(0x282925de, 0x40779614), TOBN(0xfe0ffffb, 0xe74a242a), - TOBN(0x3f39e67f, 0x906151e5), TOBN(0xcea27f5f, 0x55e10649), - TOBN(0xdca1d4e1, 0xc17cf7b7), TOBN(0x0c326d12, 0x2fe2362d), - TOBN(0x05f7ac33, 0x7dd35df3), TOBN(0x0c3b7639, 0xc396dbdf), - TOBN(0x0912f5ac, 0x03b7db1c), TOBN(0x9dea4b70, 0x5c9ed4a9), - TOBN(0x475e6e53, 0xaae3f639), TOBN(0xfaba0e7c, 0xfc278bac), - TOBN(0x16f9e221, 0x9490375f), TOBN(0xaebf9746, 0xa5a7ed0a), - TOBN(0x45f9af3f, 0xf41ad5d6), TOBN(0x03c4623c, 0xb2e99224), - TOBN(0x82c5bb5c, 0xb3cf56aa), TOBN(0x64311819, 0x34567ed3), - TOBN(0xec57f211, 0x8be489ac), TOBN(0x2821895d, 0xb9a1104b), - TOBN(0x610dc875, 0x6064e007), TOBN(0x8e526f3f, 0x5b20d0fe), - TOBN(0x6e71ca77, 0x5b645aee), TOBN(0x3d1dcb9f, 0x800e10ff), - TOBN(0x36b51162, 0x189cf6de), TOBN(0x2c5a3e30, 0x6bb17353), - TOBN(0xc186cd3e, 0x2a6c6fbf), TOBN(0xa74516fa, 0x4bf97906), - TOBN(0x5b4b8f4b, 0x279d6901), TOBN(0x0c4e57b4, 0x2b573743), - TOBN(0x75fdb229, 0xb6e386b6), TOBN(0xb46793fd, 0x99deac27), - TOBN(0xeeec47ea, 0xcf712629), TOBN(0xe965f3c4, 0xcbc3b2dd), - TOBN(0x8dd1fb83, 0x425c6559), TOBN(0x7fc00ee6, 0x0af06fda), - TOBN(0xe98c9225, 0x33d956df), TOBN(0x0f1ef335, 0x4fbdc8a2), - TOBN(0x2abb5145, 0xb79b8ea2), TOBN(0x40fd2945, 0xbdbff288), - TOBN(0x6a814ac4, 0xd7185db7), TOBN(0xc4329d6f, 0xc084609a), - TOBN(0xc9ba7b52, 0xed1be45d), TOBN(0x891dd20d, 0xe4cd2c74), - TOBN(0x5a4d4a7f, 0x824139b1), TOBN(0x66c17716, 0xb873c710), - TOBN(0x5e5bc141, 0x2843c4e0), TOBN(0xd5ac4817, 0xb97eb5bf), - TOBN(0xc0f8af54, 0x450c95c7), TOBN(0xc91b3fa0, 0x318406c5), - TOBN(0x360c340a, 0xab9d97f8), TOBN(0xfb57bd07, 0x90a2d611), - TOBN(0x4339ae3c, 0xa6a6f7e5), TOBN(0x9c1fcd2a, 0x2feb8a10), - TOBN(0x972bcca9, 0xc7ea7432), TOBN(0x1b0b924c, 0x308076f6), - TOBN(0x80b2814a, 0x2a5b4ca5), TOBN(0x2f78f55b, 0x61ef3b29), - TOBN(0xf838744a, 0xc18a414f), TOBN(0xc611eaae, 0x903d0a86), - TOBN(0x94dabc16, 0x2a453f55), TOBN(0xe6f2e3da, 0x14efb279), - TOBN(0x5b7a6017, 0x9320dc3c), TOBN(0x692e382f, 0x8df6b5a4), - TOBN(0x3f5e15e0, 0x2d40fa90), TOBN(0xc87883ae, 0x643dd318), - TOBN(0x511053e4, 0x53544774), TOBN(0x834d0ecc, 0x3adba2bc), - TOBN(0x4215d7f7, 0xbae371f5), TOBN(0xfcfd57bf, 0x6c8663bc), - TOBN(0xded2383d, 0xd6901b1d), TOBN(0x3b49fbb4, 0xb5587dc3), - TOBN(0xfd44a08d, 0x07625f62), TOBN(0x3ee4d65b, 0x9de9b762)}, - {TOBN(0x64e5137d, 0x0d63d1fa), TOBN(0x658fc052, 0x02a9d89f), - TOBN(0x48894874, 0x50436309), TOBN(0xe9ae30f8, 0xd598da61), - TOBN(0x2ed710d1, 0x818baf91), TOBN(0xe27e9e06, 0x8b6a0c20), - TOBN(0x1e28dcfb, 0x1c1a6b44), TOBN(0x883acb64, 0xd6ac57dc), - TOBN(0x8735728d, 0xc2c6ff70), TOBN(0x79d6122f, 0xc5dc2235), - TOBN(0x23f5d003, 0x19e277f9), TOBN(0x7ee84e25, 0xdded8cc7), - TOBN(0x91a8afb0, 0x63cd880a), TOBN(0x3f3ea7c6, 0x3574af60), - TOBN(0x0cfcdc84, 0x02de7f42), TOBN(0x62d0792f, 0xb31aa152), - TOBN(0x8e1b4e43, 0x8a5807ce), TOBN(0xad283893, 0xe4109a7e), - TOBN(0xc30cc9cb, 0xafd59dda), TOBN(0xf65f36c6, 0x3d8d8093), - TOBN(0xdf31469e, 0xa60d32b2), TOBN(0xee93df4b, 0x3e8191c8), - TOBN(0x9c1017c5, 0x355bdeb5), TOBN(0xd2623185, 0x8616aa28), - TOBN(0xb02c83f9, 0xdec31a21), TOBN(0x988c8b23, 0x6ad9d573), - TOBN(0x53e983ae, 0xa57be365), TOBN(0xe968734d, 0x646f834e), - TOBN(0x9137ea8f, 0x5da6309b), TOBN(0x10f3a624, 0xc1f1ce16), - TOBN(0x782a9ea2, 0xca440921), TOBN(0xdf94739e, 0x5b46f1b5), - TOBN(0x9f9be006, 0xcce85c9b), TOBN(0x360e70d6, 0xa4c7c2d3), - TOBN(0x2cd5beea, 0xaefa1e60), TOBN(0x64cf63c0, 0x8c3d2b6d), - TOBN(0xfb107fa3, 0xe1cf6f90), TOBN(0xb7e937c6, 0xd5e044e6), - TOBN(0x74e8ca78, 0xce34db9f), TOBN(0x4f8b36c1, 0x3e210bd0), - TOBN(0x1df165a4, 0x34a35ea8), TOBN(0x3418e0f7, 0x4d4412f6), - TOBN(0x5af1f8af, 0x518836c3), TOBN(0x42ceef4d, 0x130e1965), - TOBN(0x5560ca0b, 0x543a1957), TOBN(0xc33761e5, 0x886cb123), - TOBN(0x66624b1f, 0xfe98ed30), TOBN(0xf772f4bf, 0x1090997d), - TOBN(0xf4e540bb, 0x4885d410), TOBN(0x7287f810, 0x9ba5f8d7), - TOBN(0x22d0d865, 0xde98dfb1), TOBN(0x49ff51a1, 0xbcfbb8a3), - TOBN(0xb6b6fa53, 0x6bc3012e), TOBN(0x3d31fd72, 0x170d541d), - TOBN(0x8018724f, 0x4b0f4966), TOBN(0x79e7399f, 0x87dbde07), - TOBN(0x56f8410e, 0xf4f8b16a), TOBN(0x97241afe, 0xc47b266a), - TOBN(0x0a406b8e, 0x6d9c87c1), TOBN(0x803f3e02, 0xcd42ab1b), - TOBN(0x7f0309a8, 0x04dbec69), TOBN(0xa83b85f7, 0x3bbad05f), - TOBN(0xc6097273, 0xad8e197f), TOBN(0xc097440e, 0x5067adc1), - TOBN(0x730eafb6, 0x3524ff16), TOBN(0xd7f9b51e, 0x823fc6ce), - TOBN(0x27bd0d32, 0x443e4ac0), TOBN(0x40c59ad9, 0x4d66f217), - TOBN(0x6c33136f, 0x17c387a4), TOBN(0x5043b8d5, 0xeb86804d), - TOBN(0x74970312, 0x675a73c9), TOBN(0x838fdb31, 0xf16669b6), - TOBN(0xc507b6dd, 0x418e7ddd), TOBN(0x39888d93, 0x472f19d6), - TOBN(0x7eae26be, 0x0c27eb4d), TOBN(0x17b53ed3, 0xfbabb884), - TOBN(0xfc27021b, 0x2b01ae4f), TOBN(0x88462e87, 0xcf488682), - TOBN(0xbee096ec, 0x215e2d87), TOBN(0xeb2fea9a, 0xd242e29b), - TOBN(0x5d985b5f, 0xb821fc28), TOBN(0x89d2e197, 0xdc1e2ad2), - TOBN(0x55b566b8, 0x9030ba62), TOBN(0xe3fd41b5, 0x4f41b1c6), - TOBN(0xb738ac2e, 0xb9a96d61), TOBN(0x7f8567ca, 0x369443f4), - TOBN(0x8698622d, 0xf803a440), TOBN(0x2b586236, 0x8fe2f4dc), - TOBN(0xbbcc00c7, 0x56b95bce), TOBN(0x5ec03906, 0x616da680), - TOBN(0x79162ee6, 0x72214252), TOBN(0x43132b63, 0x86a892d2), - TOBN(0x4bdd3ff2, 0x2f3263bf), TOBN(0xd5b3733c, 0x9cd0a142), - TOBN(0x592eaa82, 0x44415ccb), TOBN(0x663e8924, 0x8d5474ea), - TOBN(0x8058a25e, 0x5236344e), TOBN(0x82e8df9d, 0xbda76ee6), - TOBN(0xdcf6efd8, 0x11cc3d22), TOBN(0x00089cda, 0x3b4ab529), - TOBN(0x91d3a071, 0xbd38a3db), TOBN(0x4ea97fc0, 0xef72b925), - TOBN(0x0c9fc15b, 0xea3edf75), TOBN(0x5a6297cd, 0xa4348ed3), - TOBN(0x0d38ab35, 0xce7c42d4), TOBN(0x9fd493ef, 0x82feab10), - TOBN(0x46056b6d, 0x82111b45), TOBN(0xda11dae1, 0x73efc5c3), - TOBN(0xdc740278, 0x5545a7fb), TOBN(0xbdb2601c, 0x40d507e6), - TOBN(0x121dfeeb, 0x7066fa58), TOBN(0x214369a8, 0x39ae8c2a), - TOBN(0x195709cb, 0x06e0956c), TOBN(0x4c9d254f, 0x010cd34b), - TOBN(0xf51e13f7, 0x0471a532), TOBN(0xe19d6791, 0x1e73054d), - TOBN(0xf702a628, 0xdb5c7be3), TOBN(0xc7141218, 0xb24dde05), - TOBN(0xdc18233c, 0xf29b2e2e), TOBN(0x3a6bd1e8, 0x85342dba), - TOBN(0x3f747fa0, 0xb311898c), TOBN(0xe2a272e4, 0xcd0eac65), - TOBN(0x4bba5851, 0xf914d0bc), TOBN(0x7a1a9660, 0xc4a43ee3), - TOBN(0xe5a367ce, 0xa1c8cde9), TOBN(0x9d958ba9, 0x7271abe3), - TOBN(0xf3ff7eb6, 0x3d1615cd), TOBN(0xa2280dce, 0xf5ae20b0), - TOBN(0x56dba5c1, 0xcf640147), TOBN(0xea5a2e3d, 0x5e83d118), - TOBN(0x04cd6b6d, 0xda24c511), TOBN(0x1c0f4671, 0xe854d214), - TOBN(0x91a6b7a9, 0x69565381), TOBN(0xdc966240, 0xdecf1f5b), - TOBN(0x1b22d21c, 0xfcf5d009), TOBN(0x2a05f641, 0x9021dbd5), - TOBN(0x8c0ed566, 0xd4312483), TOBN(0x5179a95d, 0x643e216f), - TOBN(0xcc185fec, 0x17044493), TOBN(0xb3063339, 0x54991a21), - TOBN(0xd801ecdb, 0x0081a726), TOBN(0x0149b0c6, 0x4fa89bbb), - TOBN(0xafe9065a, 0x4391b6b9), TOBN(0xedc92786, 0xd633f3a3), - TOBN(0xe408c24a, 0xae6a8e13), TOBN(0x85833fde, 0x9f3897ab), - TOBN(0x43800e7e, 0xd81a0715), TOBN(0xde08e346, 0xb44ffc5f), - TOBN(0x7094184c, 0xcdeff2e0), TOBN(0x49f9387b, 0x165eaed1), - TOBN(0x635d6129, 0x777c468a), TOBN(0x8c0dcfd1, 0x538c2dd8), - TOBN(0xd6d9d9e3, 0x7a6a308b), TOBN(0x62375830, 0x4c2767d3), - TOBN(0x874a8bc6, 0xf38cbeb6), TOBN(0xd94d3f1a, 0xccb6fd9e), - TOBN(0x92a9735b, 0xba21f248), TOBN(0x272ad0e5, 0x6cd1efb0), - TOBN(0x7437b69c, 0x05b03284), TOBN(0xe7f04702, 0x6948c225), - TOBN(0x8a56c04a, 0xcba2ecec), TOBN(0x0c181270, 0xe3a73e41), - TOBN(0x6cb34e9d, 0x03e93725), TOBN(0xf77c8713, 0x496521a9), - TOBN(0x94569183, 0xfa7f9f90), TOBN(0xf2e7aa4c, 0x8c9707ad), - TOBN(0xced2c9ba, 0x26c1c9a3), TOBN(0x9109fe96, 0x40197507), - TOBN(0x9ae868a9, 0xe9adfe1c), TOBN(0x3984403d, 0x314e39bb), - TOBN(0xb5875720, 0xf2fe378f), TOBN(0x33f901e0, 0xba44a628), - TOBN(0xea1125fe, 0x3652438c), TOBN(0xae9ec4e6, 0x9dd1f20b), - TOBN(0x1e740d9e, 0xbebf7fbd), TOBN(0x6dbd3ddc, 0x42dbe79c), - TOBN(0x62082aec, 0xedd36776), TOBN(0xf612c478, 0xe9859039), - TOBN(0xa493b201, 0x032f7065), TOBN(0xebd4d8f2, 0x4ff9b211), - TOBN(0x3f23a0aa, 0xaac4cb32), TOBN(0xea3aadb7, 0x15ed4005), - TOBN(0xacf17ea4, 0xafa27e63), TOBN(0x56125c1a, 0xc11fd66c), - TOBN(0x266344a4, 0x3794f8dc), TOBN(0xdcca923a, 0x483c5c36), - TOBN(0x2d6b6bbf, 0x3f9d10a0), TOBN(0xb320c5ca, 0x81d9bdf3), - TOBN(0x620e28ff, 0x47b50a95), TOBN(0x933e3b01, 0xcef03371), - TOBN(0xf081bf85, 0x99100153), TOBN(0x183be9a0, 0xc3a8c8d6), - TOBN(0x4e3ddc5a, 0xd6bbe24d), TOBN(0xc6c74630, 0x53843795), - TOBN(0x78193dd7, 0x65ec2d4c), TOBN(0xb8df26cc, 0xcd3c89b2), - TOBN(0x98dbe399, 0x5a483f8d), TOBN(0x72d8a957, 0x7dd3313a), - TOBN(0x65087294, 0xab0bd375), TOBN(0xfcd89248, 0x7c259d16), - TOBN(0x8a9443d7, 0x7613aa81), TOBN(0x80100800, 0x85fe6584), - TOBN(0x70fc4dbc, 0x7fb10288), TOBN(0xf58280d3, 0xe86beee8), - TOBN(0x14fdd82f, 0x7c978c38), TOBN(0xdf1204c1, 0x0de44d7b), - TOBN(0xa08a1c84, 0x4160252f), TOBN(0x591554ca, 0xc17646a5), - TOBN(0x214a37d6, 0xa05bd525), TOBN(0x48d5f09b, 0x07957b3c), - TOBN(0x0247cdcb, 0xd7109bc9), TOBN(0x40f9e4bb, 0x30599ce7), - TOBN(0xc325fa03, 0xf46ad2ec), TOBN(0x00f766cf, 0xc3e3f9ee), - TOBN(0xab556668, 0xd43a4577), TOBN(0x68d30a61, 0x3ee03b93), - TOBN(0x7ddc81ea, 0x77b46a08), TOBN(0xcf5a6477, 0xc7480699), - TOBN(0x43a8cb34, 0x6633f683), TOBN(0x1b867e6b, 0x92363c60), - TOBN(0x43921114, 0x1f60558e), TOBN(0xcdbcdd63, 0x2f41450e), - TOBN(0x7fc04601, 0xcc630e8b), TOBN(0xea7c66d5, 0x97038b43), - TOBN(0x7259b8a5, 0x04e99fd8), TOBN(0x98a8dd12, 0x4785549a), - TOBN(0x0e459a7c, 0x840552e1), TOBN(0xcdfcf4d0, 0x4bb0909e), - TOBN(0x34a86db2, 0x53758da7), TOBN(0xe643bb83, 0xeac997e1), - TOBN(0x96400bd7, 0x530c5b7e), TOBN(0x9f97af87, 0xb41c8b52), - TOBN(0x34fc8820, 0xfbeee3f9), TOBN(0x93e53490, 0x49091afd), - TOBN(0x764b9be5, 0x9a31f35c), TOBN(0x71f37864, 0x57e3d924), - TOBN(0x02fb34e0, 0x943aa75e), TOBN(0xa18c9c58, 0xab8ff6e4), - TOBN(0x080f31b1, 0x33cf0d19), TOBN(0x5c9682db, 0x083518a7), - TOBN(0x873d4ca6, 0xb709c3de), TOBN(0x64a84262, 0x3575b8f0), - TOBN(0x6275da1f, 0x020154bb), TOBN(0x97678caa, 0xd17cf1ab), - TOBN(0x8779795f, 0x951a95c3), TOBN(0xdd35b163, 0x50fccc08), - TOBN(0x32709627, 0x33d8f031), TOBN(0x3c5ab10a, 0x498dd85c), - TOBN(0xb6c185c3, 0x41dca566), TOBN(0x7de7feda, 0xd8622aa3), - TOBN(0x99e84d92, 0x901b6dfb), TOBN(0x30a02b0e, 0x7c4ad288), - TOBN(0xc7c81daa, 0x2fd3cf36), TOBN(0xd1319547, 0xdf89e59f), - TOBN(0xb2be8184, 0xcd496733), TOBN(0xd5f449eb, 0x93d3412b), - TOBN(0x7ea41b1b, 0x25fe531d), TOBN(0xf9797432, 0x6a1d5646), - TOBN(0x86067f72, 0x2bde501a), TOBN(0xf91481c0, 0x0c85e89c), - TOBN(0xca8ee465, 0xf8b05bc6), TOBN(0x1844e1cf, 0x02e83cda), - TOBN(0xca82114a, 0xb4dbe33b), TOBN(0x0f9f8769, 0x4eabfde2), - TOBN(0x4936b1c0, 0x38b27fe2), TOBN(0x63b6359b, 0xaba402df), - TOBN(0x40c0ea2f, 0x656bdbab), TOBN(0x9c992a89, 0x6580c39c), - TOBN(0x600e8f15, 0x2a60aed1), TOBN(0xeb089ca4, 0xe0bf49df), - TOBN(0x9c233d7d, 0x2d42d99a), TOBN(0x648d3f95, 0x4c6bc2fa), - TOBN(0xdcc383a8, 0xe1add3f3), TOBN(0xf42c0c6a, 0x4f64a348), - TOBN(0x2abd176f, 0x0030dbdb), TOBN(0x4de501a3, 0x7d6c215e), - TOBN(0x4a107c1f, 0x4b9a64bc), TOBN(0xa77f0ad3, 0x2496cd59), - TOBN(0xfb78ac62, 0x7688dffb), TOBN(0x7025a2ca, 0x67937d8e), - TOBN(0xfde8b2d1, 0xd1a8f4e7), TOBN(0xf5b3da47, 0x7354927c), - TOBN(0xe48606a3, 0xd9205735), TOBN(0xac477cc6, 0xe177b917), - TOBN(0xfb1f73d2, 0xa883239a), TOBN(0xe12572f6, 0xcc8b8357), - TOBN(0x9d355e9c, 0xfb1f4f86), TOBN(0x89b795f8, 0xd9f3ec6e), - TOBN(0x27be56f1, 0xb54398dc), TOBN(0x1890efd7, 0x3fedeed5), - TOBN(0x62f77f1f, 0x9c6d0140), TOBN(0x7ef0e314, 0x596f0ee4), - TOBN(0x50ca6631, 0xcc61dab3), TOBN(0x4a39801d, 0xf4866e4f), - TOBN(0x66c8d032, 0xae363b39), TOBN(0x22c591e5, 0x2ead66aa), - TOBN(0x954ba308, 0xde02a53e), TOBN(0x2a6c060f, 0xd389f357), - TOBN(0xe6cfcde8, 0xfbf40b66), TOBN(0x8e02fc56, 0xc6340ce1), - TOBN(0xe4957795, 0x73adb4ba), TOBN(0x7b86122c, 0xa7b03805), - TOBN(0x63f83512, 0x0c8e6fa6), TOBN(0x83660ea0, 0x057d7804), - TOBN(0xbad79105, 0x21ba473c), TOBN(0xb6c50bee, 0xded5389d), - TOBN(0xee2caf4d, 0xaa7c9bc0), TOBN(0xd97b8de4, 0x8c4e98a7), - TOBN(0xa9f63e70, 0xab3bbddb), TOBN(0x3898aabf, 0x2597815a), - TOBN(0x7659af89, 0xac15b3d9), TOBN(0xedf7725b, 0x703ce784), - TOBN(0x25470fab, 0xe085116b), TOBN(0x04a43375, 0x87285310), - TOBN(0x4e39187e, 0xe2bfd52f), TOBN(0x36166b44, 0x7d9ebc74), - TOBN(0x92ad433c, 0xfd4b322c), TOBN(0x726aa817, 0xba79ab51), - TOBN(0xf96eacd8, 0xc1db15eb), TOBN(0xfaf71e91, 0x0476be63), - TOBN(0xdd69a640, 0x641fad98), TOBN(0xb7995918, 0x29622559), - TOBN(0x03c6daa5, 0xde4199dc), TOBN(0x92cadc97, 0xad545eb4), - TOBN(0x1028238b, 0x256534e4), TOBN(0x73e80ce6, 0x8595409a), - TOBN(0x690d4c66, 0xd05dc59b), TOBN(0xc95f7b8f, 0x981dee80), - TOBN(0xf4337014, 0xd856ac25), TOBN(0x441bd9dd, 0xac524dca), - TOBN(0x640b3d85, 0x5f0499f5), TOBN(0x39cf84a9, 0xd5fda182), - TOBN(0x04e7b055, 0xb2aa95a0), TOBN(0x29e33f0a, 0x0ddf1860), - TOBN(0x082e74b5, 0x423f6b43), TOBN(0x217edeb9, 0x0aaa2b0f), - TOBN(0x58b83f35, 0x83cbea55), TOBN(0xc485ee4d, 0xbc185d70), - TOBN(0x833ff03b, 0x1e5f6992), TOBN(0xb5b9b9cc, 0xcf0c0dd5), - TOBN(0x7caaee8e, 0x4e9e8a50), TOBN(0x462e907b, 0x6269dafd), - TOBN(0x6ed5cee9, 0xfbe791c6), TOBN(0x68ca3259, 0xed430790), - TOBN(0x2b72bdf2, 0x13b5ba88), TOBN(0x60294c8a, 0x35ef0ac4), - TOBN(0x9c3230ed, 0x19b99b08), TOBN(0x560fff17, 0x6c2589aa), - TOBN(0x552b8487, 0xd6770374), TOBN(0xa373202d, 0x9a56f685), - TOBN(0xd3e7f907, 0x45f175d9), TOBN(0x3c2f315f, 0xd080d810), - TOBN(0x1130e9dd, 0x7b9520e8), TOBN(0xc078f9e2, 0x0af037b5), - TOBN(0x38cd2ec7, 0x1e9c104c), TOBN(0x0f684368, 0xc472fe92), - TOBN(0xd3f1b5ed, 0x6247e7ef), TOBN(0xb32d33a9, 0x396dfe21), - TOBN(0x46f59cf4, 0x4a9aa2c2), TOBN(0x69cd5168, 0xff0f7e41), - TOBN(0x3f59da0f, 0x4b3234da), TOBN(0xcf0b0235, 0xb4579ebe), - TOBN(0x6d1cbb25, 0x6d2476c7), TOBN(0x4f0837e6, 0x9dc30f08), - TOBN(0x9a4075bb, 0x906f6e98), TOBN(0x253bb434, 0xc761e7d1), - TOBN(0xde2e645f, 0x6e73af10), TOBN(0xb89a4060, 0x0c5f131c), - TOBN(0xd12840c5, 0xb8cc037f), TOBN(0x3d093a5b, 0x7405bb47), - TOBN(0x6202c253, 0x206348b8), TOBN(0xbf5d57fc, 0xc55a3ca7), - TOBN(0x89f6c90c, 0x8c3bef48), TOBN(0x23ac7623, 0x5a0a960a), - TOBN(0xdfbd3d6b, 0x552b42ab), TOBN(0x3ef22458, 0x132061f6), - TOBN(0xd74e9bda, 0xc97e6516), TOBN(0x88779360, 0xc230f49e), - TOBN(0xa6ec1de3, 0x1e74ea49), TOBN(0x581dcee5, 0x3fb645a2), - TOBN(0xbaef2391, 0x8f483f14), TOBN(0x6d2dddfc, 0xd137d13b), - TOBN(0x54cde50e, 0xd2743a42), TOBN(0x89a34fc5, 0xe4d97e67), - TOBN(0x13f1f5b3, 0x12e08ce5), TOBN(0xa80540b8, 0xa7f0b2ca), - TOBN(0x854bcf77, 0x01982805), TOBN(0xb8653ffd, 0x233bea04), - TOBN(0x8e7b8787, 0x02b0b4c9), TOBN(0x2675261f, 0x9acb170a), - TOBN(0x061a9d90, 0x930c14e5), TOBN(0xb59b30e0, 0xdef0abea), - TOBN(0x1dc19ea6, 0x0200ec7d), TOBN(0xb6f4a3f9, 0x0bce132b), - TOBN(0xb8d5de90, 0xf13e27e0), TOBN(0xbaee5ef0, 0x1fade16f), - TOBN(0x6f406aaa, 0xe4c6cf38), TOBN(0xab4cfe06, 0xd1369815), - TOBN(0x0dcffe87, 0xefd550c6), TOBN(0x9d4f59c7, 0x75ff7d39), - TOBN(0xb02553b1, 0x51deb6ad), TOBN(0x812399a4, 0xb1877749), - TOBN(0xce90f71f, 0xca6006e1), TOBN(0xc32363a6, 0xb02b6e77), - TOBN(0x02284fbe, 0xdc36c64d), TOBN(0x86c81e31, 0xa7e1ae61), - TOBN(0x2576c7e5, 0xb909d94a), TOBN(0x8b6f7d02, 0x818b2bb0), - TOBN(0xeca3ed07, 0x56faa38a), TOBN(0xa3790e6c, 0x9305bb54), - TOBN(0xd784eeda, 0x7bc73061), TOBN(0xbd56d369, 0x6dd50614), - TOBN(0xd6575949, 0x229a8aa9), TOBN(0xdcca8f47, 0x4595ec28), - TOBN(0x814305c1, 0x06ab4fe6), TOBN(0xc8c39768, 0x24f43f16), - TOBN(0xe2a45f36, 0x523f2b36), TOBN(0x995c6493, 0x920d93bb), - TOBN(0xf8afdab7, 0x90f1632b), TOBN(0x79ebbecd, 0x1c295954), - TOBN(0xc7bb3ddb, 0x79592f48), TOBN(0x67216a7b, 0x5f88e998), - TOBN(0xd91f098b, 0xbc01193e), TOBN(0xf7d928a5, 0xb1db83fc), - TOBN(0x55e38417, 0xe991f600), TOBN(0x2a91113e, 0x2981a934), - TOBN(0xcbc9d648, 0x06b13bde), TOBN(0xb011b6ac, 0x0755ff44), - TOBN(0x6f4cb518, 0x045ec613), TOBN(0x522d2d31, 0xc2f5930a), - TOBN(0x5acae1af, 0x382e65de), TOBN(0x57643067, 0x27bc966f), - TOBN(0x5e12705d, 0x1c7193f0), TOBN(0xf0f32f47, 0x3be8858e), - TOBN(0x785c3d7d, 0x96c6dfc7), TOBN(0xd75b4a20, 0xbf31795d), - TOBN(0x91acf17b, 0x342659d4), TOBN(0xe596ea34, 0x44f0378f), - TOBN(0x4515708f, 0xce52129d), TOBN(0x17387e1e, 0x79f2f585), - TOBN(0x72cfd2e9, 0x49dee168), TOBN(0x1ae05223, 0x3e2af239), - TOBN(0x009e75be, 0x1d94066a), TOBN(0x6cca31c7, 0x38abf413), - TOBN(0xb50bd61d, 0x9bc49908), TOBN(0x4a9b4a8c, 0xf5e2bc1e), - TOBN(0xeb6cc5f7, 0x946f83ac), TOBN(0x27da93fc, 0xebffab28), - TOBN(0xea314c96, 0x4821c8c5), TOBN(0x8de49ded, 0xa83c15f4), - TOBN(0x7a64cf20, 0x7af33004), TOBN(0x45f1bfeb, 0xc9627e10), - TOBN(0x878b0626, 0x54b9df60), TOBN(0x5e4fdc3c, 0xa95c0b33), - TOBN(0xe54a37ca, 0xc2035d8e), TOBN(0x9087cda9, 0x80f20b8c), - TOBN(0x36f61c23, 0x8319ade4), TOBN(0x766f287a, 0xde8cfdf8), - TOBN(0x48821948, 0x346f3705), TOBN(0x49a7b853, 0x16e4f4a2), - TOBN(0xb9b3f8a7, 0x5cedadfd), TOBN(0x8f562815, 0x8db2a815), - TOBN(0xc0b7d554, 0x01f68f95), TOBN(0x12971e27, 0x688a208e), - TOBN(0xc9f8b696, 0xd0ff34fc), TOBN(0x20824de2, 0x1222718c), - TOBN(0x7213cf9f, 0x0c95284d), TOBN(0xe2ad741b, 0xdc158240), - TOBN(0x0ee3a6df, 0x54043ccf), TOBN(0x16ff479b, 0xd84412b3), - TOBN(0xf6c74ee0, 0xdfc98af0), TOBN(0xa78a169f, 0x52fcd2fb), - TOBN(0xd8ae8746, 0x99c930e9), TOBN(0x1d33e858, 0x49e117a5), - TOBN(0x7581fcb4, 0x6624759f), TOBN(0xde50644f, 0x5bedc01d), - TOBN(0xbeec5d00, 0xcaf3155e), TOBN(0x672d66ac, 0xbc73e75f), - TOBN(0x86b9d8c6, 0x270b01db), TOBN(0xd249ef83, 0x50f55b79), - TOBN(0x6131d6d4, 0x73978fe3), TOBN(0xcc4e4542, 0x754b00a1), - TOBN(0x4e05df05, 0x57dfcfe9), TOBN(0x94b29cdd, 0x51ef6bf0), - TOBN(0xe4530cff, 0x9bc7edf2), TOBN(0x8ac236fd, 0xd3da65f3), - TOBN(0x0faf7d5f, 0xc8eb0b48), TOBN(0x4d2de14c, 0x660eb039), - TOBN(0xc006bba7, 0x60430e54), TOBN(0x10a2d0d6, 0xda3289ab), - TOBN(0x9c037a5d, 0xd7979c59), TOBN(0x04d1f3d3, 0xa116d944), - TOBN(0x9ff22473, 0x8a0983cd), TOBN(0x28e25b38, 0xc883cabb), - TOBN(0xe968dba5, 0x47a58995), TOBN(0x2c80b505, 0x774eebdf), - TOBN(0xee763b71, 0x4a953beb), TOBN(0x502e223f, 0x1642e7f6), - TOBN(0x6fe4b641, 0x61d5e722), TOBN(0x9d37c5b0, 0xdbef5316), - TOBN(0x0115ed70, 0xf8330bc7), TOBN(0x139850e6, 0x75a72789), - TOBN(0x27d7faec, 0xffceccc2), TOBN(0x3016a860, 0x4fd9f7f6), - TOBN(0xc492ec64, 0x4cd8f64c), TOBN(0x58a2d790, 0x279d7b51), - TOBN(0x0ced1fc5, 0x1fc75256), TOBN(0x3e658aed, 0x8f433017), - TOBN(0x0b61942e, 0x05da59eb), TOBN(0xba3d60a3, 0x0ddc3722), - TOBN(0x7c311cd1, 0x742e7f87), TOBN(0x6473ffee, 0xf6b01b6e)}, - {TOBN(0x8303604f, 0x692ac542), TOBN(0xf079ffe1, 0x227b91d3), - TOBN(0x19f63e63, 0x15aaf9bd), TOBN(0xf99ee565, 0xf1f344fb), - TOBN(0x8a1d661f, 0xd6219199), TOBN(0x8c883bc6, 0xd48ce41c), - TOBN(0x1065118f, 0x3c74d904), TOBN(0x713889ee, 0x0faf8b1b), - TOBN(0x972b3f8f, 0x81a1b3be), TOBN(0x4f3ce145, 0xce2764a0), - TOBN(0xe2d0f1cc, 0x28c4f5f7), TOBN(0xdeee0c0d, 0xc7f3985b), - TOBN(0x7df4adc0, 0xd39e25c3), TOBN(0x40619820, 0xc467a080), - TOBN(0x440ebc93, 0x61cf5a58), TOBN(0x527729a6, 0x422ad600), - TOBN(0xca6c0937, 0xb1b76ba6), TOBN(0x1a2eab85, 0x4d2026dc), - TOBN(0xb1715e15, 0x19d9ae0a), TOBN(0xf1ad9199, 0xbac4a026), - TOBN(0x35b3dfb8, 0x07ea7b0e), TOBN(0xedf5496f, 0x3ed9eb89), - TOBN(0x8932e5ff, 0x2d6d08ab), TOBN(0xf314874e, 0x25bd2731), - TOBN(0xefb26a75, 0x3f73f449), TOBN(0x1d1c94f8, 0x8d44fc79), - TOBN(0x49f0fbc5, 0x3bc0dc4d), TOBN(0xb747ea0b, 0x3698a0d0), - TOBN(0x5218c3fe, 0x228d291e), TOBN(0x35b804b5, 0x43c129d6), - TOBN(0xfac859b8, 0xd1acc516), TOBN(0x6c10697d, 0x95d6e668), - TOBN(0xc38e438f, 0x0876fd4e), TOBN(0x45f0c307, 0x83d2f383), - TOBN(0x203cc2ec, 0xb10934cb), TOBN(0x6a8f2439, 0x2c9d46ee), - TOBN(0xf16b431b, 0x65ccde7b), TOBN(0x41e2cd18, 0x27e76a6f), - TOBN(0xb9c8cf8f, 0x4e3484d7), TOBN(0x64426efd, 0x8315244a), - TOBN(0x1c0a8e44, 0xfc94dea3), TOBN(0x34c8cdbf, 0xdad6a0b0), - TOBN(0x919c3840, 0x04113cef), TOBN(0xfd32fba4, 0x15490ffa), - TOBN(0x58d190f6, 0x795dcfb7), TOBN(0xfef01b03, 0x83588baf), - TOBN(0x9e6d1d63, 0xca1fc1c0), TOBN(0x53173f96, 0xf0a41ac9), - TOBN(0x2b1d402a, 0xba16f73b), TOBN(0x2fb31014, 0x8cf9b9fc), - TOBN(0x2d51e60e, 0x446ef7bf), TOBN(0xc731021b, 0xb91e1745), - TOBN(0x9d3b4724, 0x4fee99d4), TOBN(0x4bca48b6, 0xfac5c1ea), - TOBN(0x70f5f514, 0xbbea9af7), TOBN(0x751f55a5, 0x974c283a), - TOBN(0x6e30251a, 0xcb452fdb), TOBN(0x31ee6965, 0x50f30650), - TOBN(0xb0b3e508, 0x933548d9), TOBN(0xb8949a4f, 0xf4b0ef5b), - TOBN(0x208b8326, 0x3c88f3bd), TOBN(0xab147c30, 0xdb1d9989), - TOBN(0xed6515fd, 0x44d4df03), TOBN(0x17a12f75, 0xe72eb0c5), - TOBN(0x3b59796d, 0x36cf69db), TOBN(0x1219eee9, 0x56670c18), - TOBN(0xfe3341f7, 0x7a070d8e), TOBN(0x9b70130b, 0xa327f90c), - TOBN(0x36a32462, 0x0ae18e0e), TOBN(0x2021a623, 0x46c0a638), - TOBN(0x251b5817, 0xc62eb0d4), TOBN(0x87bfbcdf, 0x4c762293), - TOBN(0xf78ab505, 0xcdd61d64), TOBN(0x8c7a53fc, 0xc8c18857), - TOBN(0xa653ce6f, 0x16147515), TOBN(0x9c923aa5, 0xea7d52d5), - TOBN(0xc24709cb, 0x5c18871f), TOBN(0x7d53bec8, 0x73b3cc74), - TOBN(0x59264aff, 0xfdd1d4c4), TOBN(0x5555917e, 0x240da582), - TOBN(0xcae8bbda, 0x548f5a0e), TOBN(0x1910eaba, 0x3bbfbbe1), - TOBN(0xae579685, 0x7677afc3), TOBN(0x49ea61f1, 0x73ff0b5c), - TOBN(0x78655478, 0x4f7c3922), TOBN(0x95d337cd, 0x20c68eef), - TOBN(0x68f1e1e5, 0xdf779ab9), TOBN(0x14b491b0, 0xb5cf69a8), - TOBN(0x7a6cbbe0, 0x28e3fe89), TOBN(0xe7e1fee4, 0xc5aac0eb), - TOBN(0x7f47eda5, 0x697e5140), TOBN(0x4f450137, 0xb454921f), - TOBN(0xdb625f84, 0x95cd8185), TOBN(0x74be0ba1, 0xcdb2e583), - TOBN(0xaee4fd7c, 0xdd5e6de4), TOBN(0x4251437d, 0xe8101739), - TOBN(0x686d72a0, 0xac620366), TOBN(0x4be3fb9c, 0xb6d59344), - TOBN(0x6e8b44e7, 0xa1eb75b9), TOBN(0x84e39da3, 0x91a5c10c), - TOBN(0x37cc1490, 0xb38f0409), TOBN(0x02951943, 0x2c2ade82), - TOBN(0x9b688783, 0x1190a2d8), TOBN(0x25627d14, 0x231182ba), - TOBN(0x6eb550aa, 0x658a6d87), TOBN(0x1405aaa7, 0xcf9c7325), - TOBN(0xd147142e, 0x5c8748c9), TOBN(0x7f637e4f, 0x53ede0e0), - TOBN(0xf8ca2776, 0x14ffad2c), TOBN(0xe58fb1bd, 0xbafb6791), - TOBN(0x17158c23, 0xbf8f93fc), TOBN(0x7f15b373, 0x0a4a4655), - TOBN(0x39d4add2, 0xd842ca72), TOBN(0xa71e4391, 0x3ed96305), - TOBN(0x5bb09cbe, 0x6700be14), TOBN(0x68d69d54, 0xd8befcf6), - TOBN(0xa45f5367, 0x37183bcf), TOBN(0x7152b7bb, 0x3370dff7), - TOBN(0xcf887baa, 0xbf12525b), TOBN(0xe7ac7bdd, 0xd6d1e3cd), - TOBN(0x25914f78, 0x81fdad90), TOBN(0xcf638f56, 0x0d2cf6ab), - TOBN(0xb90bc03f, 0xcc054de5), TOBN(0x932811a7, 0x18b06350), - TOBN(0x2f00b330, 0x9bbd11ff), TOBN(0x76108a6f, 0xb4044974), - TOBN(0x801bb9e0, 0xa851d266), TOBN(0x0dd099be, 0xbf8990c1), - TOBN(0x58c5aaaa, 0xabe32986), TOBN(0x0fe9dd2a, 0x50d59c27), - TOBN(0x84951ff4, 0x8d307305), TOBN(0x6c23f829, 0x86529b78), - TOBN(0x50bb2218, 0x0b136a79), TOBN(0x7e2174de, 0x77a20996), - TOBN(0x6f00a4b9, 0xc0bb4da6), TOBN(0x89a25a17, 0xefdde8da), - TOBN(0xf728a27e, 0xc11ee01d), TOBN(0xf900553a, 0xe5f10dfb), - TOBN(0x189a83c8, 0x02ec893c), TOBN(0x3ca5bdc1, 0x23f66d77), - TOBN(0x98781537, 0x97eada9f), TOBN(0x59c50ab3, 0x10256230), - TOBN(0x346042d9, 0x323c69b3), TOBN(0x1b715a6d, 0x2c460449), - TOBN(0xa41dd476, 0x6ae06e0b), TOBN(0xcdd7888e, 0x9d42e25f), - TOBN(0x0f395f74, 0x56b25a20), TOBN(0xeadfe0ae, 0x8700e27e), - TOBN(0xb09d52a9, 0x69950093), TOBN(0x3525d9cb, 0x327f8d40), - TOBN(0xb8235a94, 0x67df886a), TOBN(0x77e4b0dd, 0x035faec2), - TOBN(0x115eb20a, 0x517d7061), TOBN(0x77fe3433, 0x6c2df683), - TOBN(0x6870ddc7, 0xcdc6fc67), TOBN(0xb1610588, 0x0b87de83), - TOBN(0x343584ca, 0xd9c4ddbe), TOBN(0xb3164f1c, 0x3d754be2), - TOBN(0x0731ed3a, 0xc1e6c894), TOBN(0x26327dec, 0x4f6b904c), - TOBN(0x9d49c6de, 0x97b5cd32), TOBN(0x40835dae, 0xb5eceecd), - TOBN(0xc66350ed, 0xd9ded7fe), TOBN(0x8aeebb5c, 0x7a678804), - TOBN(0x51d42fb7, 0x5b8ee9ec), TOBN(0xd7a17bdd, 0x8e3ca118), - TOBN(0x40d7511a, 0x2ef4400e), TOBN(0xc48990ac, 0x875a66f4), - TOBN(0x8de07d2a, 0x2199e347), TOBN(0xbee75556, 0x2a39e051), - TOBN(0x56918786, 0x916e51dc), TOBN(0xeb191313, 0x4a2d89ec), - TOBN(0x6679610d, 0x37d341ed), TOBN(0x434fbb41, 0x56d51c2b), - TOBN(0xe54b7ee7, 0xd7492dba), TOBN(0xaa33a79a, 0x59021493), - TOBN(0x49fc5054, 0xe4bd6d3d), TOBN(0x09540f04, 0x5ab551d0), - TOBN(0x8acc9085, 0x4942d3a6), TOBN(0x231af02f, 0x2d28323b), - TOBN(0x93458cac, 0x0992c163), TOBN(0x1fef8e71, 0x888e3bb4), - TOBN(0x27578da5, 0xbe8c268c), TOBN(0xcc8be792, 0xe805ec00), - TOBN(0x29267bae, 0xc61c3855), TOBN(0xebff429d, 0x58c1fd3b), - TOBN(0x22d886c0, 0x8c0b93b8), TOBN(0xca5e00b2, 0x2ddb8953), - TOBN(0xcf330117, 0xc3fed8b7), TOBN(0xd49ac6fa, 0x819c01f6), - TOBN(0x6ddaa6bd, 0x3c0fbd54), TOBN(0x91743068, 0x8049a2cf), - TOBN(0xd67f981e, 0xaff2ef81), TOBN(0xc3654d35, 0x2818ae80), - TOBN(0x81d05044, 0x1b2aa892), TOBN(0x2db067bf, 0x3d099328), - TOBN(0xe7c79e86, 0x703dcc97), TOBN(0xe66f9b37, 0xe133e215), - TOBN(0xcdf119a6, 0xe39a7a5c), TOBN(0x47c60de3, 0x876f1b61), - TOBN(0x6e405939, 0xd860f1b2), TOBN(0x3e9a1dbc, 0xf5ed4d4a), - TOBN(0x3f23619e, 0xc9b6bcbd), TOBN(0x5ee790cf, 0x734e4497), - TOBN(0xf0a834b1, 0x5bdaf9bb), TOBN(0x02cedda7, 0x4ca295f0), - TOBN(0x4619aa2b, 0xcb8e378c), TOBN(0xe5613244, 0xcc987ea4), - TOBN(0x0bc022cc, 0x76b23a50), TOBN(0x4a2793ad, 0x0a6c21ce), - TOBN(0x38328780, 0x89cac3f5), TOBN(0x29176f1b, 0xcba26d56), - TOBN(0x06296187, 0x4f6f59eb), TOBN(0x86e9bca9, 0x8bdc658e), - TOBN(0x2ca9c4d3, 0x57e30402), TOBN(0x5438b216, 0x516a09bb), - TOBN(0x0a6a063c, 0x7672765a), TOBN(0x37a3ce64, 0x0547b9bf), - TOBN(0x42c099c8, 0x98b1a633), TOBN(0xb5ab800d, 0x05ee6961), - TOBN(0xf1963f59, 0x11a5acd6), TOBN(0xbaee6157, 0x46201063), - TOBN(0x36d9a649, 0xa596210a), TOBN(0xaed04363, 0x1ba7138c), - TOBN(0xcf817d1c, 0xa4a82b76), TOBN(0x5586960e, 0xf3806be9), - TOBN(0x7ab67c89, 0x09dc6bb5), TOBN(0x52ace7a0, 0x114fe7eb), - TOBN(0xcd987618, 0xcbbc9b70), TOBN(0x4f06fd5a, 0x604ca5e1), - TOBN(0x90af14ca, 0x6dbde133), TOBN(0x1afe4322, 0x948a3264), - TOBN(0xa70d2ca6, 0xc44b2c6c), TOBN(0xab726799, 0x0ef87dfe), - TOBN(0x310f64dc, 0x2e696377), TOBN(0x49b42e68, 0x4c8126a0), - TOBN(0x0ea444c3, 0xcea0b176), TOBN(0x53a8ddf7, 0xcb269182), - TOBN(0xf3e674eb, 0xbbba9dcb), TOBN(0x0d2878a8, 0xd8669d33), - TOBN(0x04b935d5, 0xd019b6a3), TOBN(0xbb5cf88e, 0x406f1e46), - TOBN(0xa1912d16, 0x5b57c111), TOBN(0x9803fc21, 0x19ebfd78), - TOBN(0x4f231c9e, 0xc07764a9), TOBN(0xd93286ee, 0xb75bd055), - TOBN(0x83a9457d, 0x8ee6c9de), TOBN(0x04695915, 0x6087ec90), - TOBN(0x14c6dd8a, 0x58d6cd46), TOBN(0x9cb633b5, 0x8e6634d2), - TOBN(0xc1305047, 0xf81bc328), TOBN(0x12ede0e2, 0x26a177e5), - TOBN(0x332cca62, 0x065a6f4f), TOBN(0xc3a47ecd, 0x67be487b), - TOBN(0x741eb187, 0x0f47ed1c), TOBN(0x99e66e58, 0xe7598b14), - TOBN(0x6f0544ca, 0x63d0ff12), TOBN(0xe5efc784, 0xb610a05f), - TOBN(0xf72917b1, 0x7cad7b47), TOBN(0x3ff6ea20, 0xf2cac0c0), - TOBN(0xcc23791b, 0xf21db8b7), TOBN(0x7dac70b1, 0xd7d93565), - TOBN(0x682cda1d, 0x694bdaad), TOBN(0xeb88bb8c, 0x1023516d), - TOBN(0xc4c634b4, 0xdfdbeb1b), TOBN(0x22f5ca72, 0xb4ee4dea), - TOBN(0x1045a368, 0xe6524821), TOBN(0xed9e8a3f, 0x052b18b2), - TOBN(0x9b7f2cb1, 0xb961f49a), TOBN(0x7fee2ec1, 0x7b009670), - TOBN(0x350d8754, 0x22507a6d), TOBN(0x561bd711, 0x4db55f1d), - TOBN(0x4c189ccc, 0x320bbcaf), TOBN(0x568434cf, 0xdf1de48c), - TOBN(0x6af1b00e, 0x0fa8f128), TOBN(0xf0ba9d02, 0x8907583c), - TOBN(0x735a4004, 0x32ff9f60), TOBN(0x3dd8e4b6, 0xc25dcf33), - TOBN(0xf2230f16, 0x42c74cef), TOBN(0xd8117623, 0x013fa8ad), - TOBN(0x36822876, 0xf51fe76e), TOBN(0x8a6811cc, 0x11d62589), - TOBN(0xc3fc7e65, 0x46225718), TOBN(0xb7df2c9f, 0xc82fdbcd), - TOBN(0x3b1d4e52, 0xdd7b205b), TOBN(0xb6959478, 0x47a2e414), - TOBN(0x05e4d793, 0xefa91148), TOBN(0xb47ed446, 0xfd2e9675), - TOBN(0x1a7098b9, 0x04c9d9bf), TOBN(0x661e2881, 0x1b793048), - TOBN(0xb1a16966, 0xb01ee461), TOBN(0xbc521308, 0x2954746f), - TOBN(0xc909a0fc, 0x2477de50), TOBN(0xd80bb41c, 0x7dbd51ef), - TOBN(0xa85be7ec, 0x53294905), TOBN(0x6d465b18, 0x83958f97), - TOBN(0x16f6f330, 0xfb6840fd), TOBN(0xfaaeb214, 0x3401e6c8), - TOBN(0xaf83d30f, 0xccb5b4f8), TOBN(0x22885739, 0x266dec4b), - TOBN(0x51b4367c, 0x7bc467df), TOBN(0x926562e3, 0xd842d27a), - TOBN(0xdfcb6614, 0x0fea14a6), TOBN(0xeb394dae, 0xf2734cd9), - TOBN(0x3eeae5d2, 0x11c0be98), TOBN(0xb1e6ed11, 0x814e8165), - TOBN(0x191086bc, 0xe52bce1c), TOBN(0x14b74cc6, 0xa75a04da), - TOBN(0x63cf1186, 0x8c060985), TOBN(0x071047de, 0x2dbd7f7c), - TOBN(0x4e433b8b, 0xce0942ca), TOBN(0xecbac447, 0xd8fec61d), - TOBN(0x8f0ed0e2, 0xebf3232f), TOBN(0xfff80f9e, 0xc52a2edd), - TOBN(0xad9ab433, 0x75b55fdb), TOBN(0x73ca7820, 0xe42e0c11), - TOBN(0x6dace0a0, 0xe6251b46), TOBN(0x89bc6b5c, 0x4c0d932d), - TOBN(0x3438cd77, 0x095da19a), TOBN(0x2f24a939, 0x8d48bdfb), - TOBN(0x99b47e46, 0x766561b7), TOBN(0x736600e6, 0x0ed0322a), - TOBN(0x06a47cb1, 0x638e1865), TOBN(0x927c1c2d, 0xcb136000), - TOBN(0x29542337, 0x0cc5df69), TOBN(0x99b37c02, 0x09d649a9), - TOBN(0xc5f0043c, 0x6aefdb27), TOBN(0x6cdd9987, 0x1be95c27), - TOBN(0x69850931, 0x390420d2), TOBN(0x299c40ac, 0x0983efa4), - TOBN(0x3a05e778, 0xaf39aead), TOBN(0x84274408, 0x43a45193), - TOBN(0x6bcd0fb9, 0x91a711a0), TOBN(0x461592c8, 0x9f52ab17), - TOBN(0xb49302b4, 0xda3c6ed6), TOBN(0xc51fddc7, 0x330d7067), - TOBN(0x94babeb6, 0xda50d531), TOBN(0x521b840d, 0xa6a7b9da), - TOBN(0x5305151e, 0x404bdc89), TOBN(0x1bcde201, 0xd0d07449), - TOBN(0xf427a78b, 0x3b76a59a), TOBN(0xf84841ce, 0x07791a1b), - TOBN(0xebd314be, 0xbf91ed1c), TOBN(0x8e61d34c, 0xbf172943), - TOBN(0x1d5dc451, 0x5541b892), TOBN(0xb186ee41, 0xfc9d9e54), - TOBN(0x9d9f345e, 0xd5bf610d), TOBN(0x3e7ba65d, 0xf6acca9f), - TOBN(0x9dda787a, 0xa8369486), TOBN(0x09f9dab7, 0x8eb5ba53), - TOBN(0x5afb2033, 0xd6481bc3), TOBN(0x76f4ce30, 0xafa62104), - TOBN(0xa8fa00cf, 0xf4f066b5), TOBN(0x89ab5143, 0x461dafc2), - TOBN(0x44339ed7, 0xa3389998), TOBN(0x2ff862f1, 0xbc214903), - TOBN(0x2c88f985, 0xb05556e3), TOBN(0xcd96058e, 0x3467081e), - TOBN(0x7d6a4176, 0xedc637ea), TOBN(0xe1743d09, 0x36a5acdc), - TOBN(0x66fd72e2, 0x7eb37726), TOBN(0xf7fa264e, 0x1481a037), - TOBN(0x9fbd3bde, 0x45f4aa79), TOBN(0xed1e0147, 0x767c3e22), - TOBN(0x7621f979, 0x82e7abe2), TOBN(0x19eedc72, 0x45f633f8), - TOBN(0xe69b155e, 0x6137bf3a), TOBN(0xa0ad13ce, 0x414ee94e), - TOBN(0x93e3d524, 0x1c0e651a), TOBN(0xab1a6e2a, 0x02ce227e), - TOBN(0xe7af1797, 0x4ab27eca), TOBN(0x245446de, 0xbd444f39), - TOBN(0x59e22a21, 0x56c07613), TOBN(0x43deafce, 0xf4275498), - TOBN(0x10834ccb, 0x67fd0946), TOBN(0xa75841e5, 0x47406edf), - TOBN(0xebd6a677, 0x7b0ac93d), TOBN(0xa6e37b0d, 0x78f5e0d7), - TOBN(0x2516c096, 0x76f5492b), TOBN(0x1e4bf888, 0x9ac05f3a), - TOBN(0xcdb42ce0, 0x4df0ba2b), TOBN(0x935d5cfd, 0x5062341b), - TOBN(0x8a303333, 0x82acac20), TOBN(0x429438c4, 0x5198b00e), - TOBN(0x1d083bc9, 0x049d33fa), TOBN(0x58b82dda, 0x946f67ff), - TOBN(0xac3e2db8, 0x67a1d6a3), TOBN(0x62e6bead, 0x1798aac8), - TOBN(0xfc85980f, 0xde46c58c), TOBN(0xa7f69379, 0x69c8d7be), - TOBN(0x23557927, 0x837b35ec), TOBN(0x06a933d8, 0xe0790c0c), - TOBN(0x827c0e9b, 0x077ff55d), TOBN(0x53977798, 0xbb26e680), - TOBN(0x59530874, 0x1d9cb54f), TOBN(0xcca3f449, 0x4aac53ef), - TOBN(0x11dc5c87, 0xa07eda0f), TOBN(0xc138bccf, 0xfd6400c8), - TOBN(0x549680d3, 0x13e5da72), TOBN(0xc93eed82, 0x4540617e), - TOBN(0xfd3db157, 0x4d0b75c0), TOBN(0x9716eb42, 0x6386075b), - TOBN(0x0639605c, 0x817b2c16), TOBN(0x09915109, 0xf1e4f201), - TOBN(0x35c9a928, 0x5cca6c3b), TOBN(0xb25f7d1a, 0x3505c900), - TOBN(0xeb9f7d20, 0x630480c4), TOBN(0xc3c7b8c6, 0x2a1a501c), - TOBN(0x3f99183c, 0x5a1f8e24), TOBN(0xfdb118fa, 0x9dd255f0), - TOBN(0xb9b18b90, 0xc27f62a6), TOBN(0xe8f732f7, 0x396ec191), - TOBN(0x524a2d91, 0x0be786ab), TOBN(0x5d32adef, 0x0ac5a0f5), - TOBN(0x9b53d4d6, 0x9725f694), TOBN(0x032a76c6, 0x0510ba89), - TOBN(0x840391a3, 0xebeb1544), TOBN(0x44b7b88c, 0x3ed73ac3), - TOBN(0xd24bae7a, 0x256cb8b3), TOBN(0x7ceb151a, 0xe394cb12), - TOBN(0xbd6b66d0, 0x5bc1e6a8), TOBN(0xec70cecb, 0x090f07bf), - TOBN(0x270644ed, 0x7d937589), TOBN(0xee9e1a3d, 0x5f1dccfe), - TOBN(0xb0d40a84, 0x745b98d2), TOBN(0xda429a21, 0x2556ed40), - TOBN(0xf676eced, 0x85148cb9), TOBN(0x5a22d40c, 0xded18936), - TOBN(0x3bc4b9e5, 0x70e8a4ce), TOBN(0xbfd1445b, 0x9eae0379), - TOBN(0xf23f2c0c, 0x1a0bd47e), TOBN(0xa9c0bb31, 0xe1845531), - TOBN(0x9ddc4d60, 0x0a4c3f6b), TOBN(0xbdfaad79, 0x2c15ef44), - TOBN(0xce55a236, 0x7f484acc), TOBN(0x08653ca7, 0x055b1f15), - TOBN(0x2efa8724, 0x538873a3), TOBN(0x09299e5d, 0xace1c7e7), - TOBN(0x07afab66, 0xade332ba), TOBN(0x9be1fdf6, 0x92dd71b7), - TOBN(0xa49b5d59, 0x5758b11c), TOBN(0x0b852893, 0xc8654f40), - TOBN(0xb63ef6f4, 0x52379447), TOBN(0xd4957d29, 0x105e690c), - TOBN(0x7d484363, 0x646559b0), TOBN(0xf4a8273c, 0x49788a8e), - TOBN(0xee406cb8, 0x34ce54a9), TOBN(0x1e1c260f, 0xf86fda9b), - TOBN(0xe150e228, 0xcf6a4a81), TOBN(0x1fa3b6a3, 0x1b488772), - TOBN(0x1e6ff110, 0xc5a9c15b), TOBN(0xc6133b91, 0x8ad6aa47), - TOBN(0x8ac5d55c, 0x9dffa978), TOBN(0xba1d1c1d, 0x5f3965f2), - TOBN(0xf969f4e0, 0x7732b52f), TOBN(0xfceecdb5, 0xa5172a07), - TOBN(0xb0120a5f, 0x10f2b8f5), TOBN(0xc83a6cdf, 0x5c4c2f63), - TOBN(0x4d47a491, 0xf8f9c213), TOBN(0xd9e1cce5, 0xd3f1bbd5), - TOBN(0x0d91bc7c, 0xaba7e372), TOBN(0xfcdc74c8, 0xdfd1a2db), - TOBN(0x05efa800, 0x374618e5), TOBN(0x11216969, 0x15a7925e), - TOBN(0xd4c89823, 0xf6021c5d), TOBN(0x880d5e84, 0xeff14423), - TOBN(0x6523bc5a, 0x6dcd1396), TOBN(0xd1acfdfc, 0x113c978b), - TOBN(0xb0c164e8, 0xbbb66840), TOBN(0xf7f4301e, 0x72b58459), - TOBN(0xc29ad4a6, 0xa638e8ec), TOBN(0xf5ab8961, 0x46b78699), - TOBN(0x9dbd7974, 0x0e954750), TOBN(0x0121de88, 0x64f9d2c6), - TOBN(0x2e597b42, 0xd985232e), TOBN(0x55b6c3c5, 0x53451777), - TOBN(0xbb53e547, 0x519cb9fb), TOBN(0xf134019f, 0x8428600d), - TOBN(0x5a473176, 0xe081791a), TOBN(0x2f3e2263, 0x35fb0c08), - TOBN(0xb28c3017, 0x73d273b0), TOBN(0xccd21076, 0x7721ef9a), - TOBN(0x054cc292, 0xb650dc39), TOBN(0x662246de, 0x6188045e), - TOBN(0x904b52fa, 0x6b83c0d1), TOBN(0xa72df267, 0x97e9cd46), - TOBN(0x886b43cd, 0x899725e4), TOBN(0x2b651688, 0xd849ff22), - TOBN(0x60479b79, 0x02f34533), TOBN(0x5e354c14, 0x0c77c148), - TOBN(0xb4bb7581, 0xa8537c78), TOBN(0x188043d7, 0xefe1495f), - TOBN(0x9ba12f42, 0x8c1d5026), TOBN(0x2e0c8a26, 0x93d4aaab), - TOBN(0xbdba7b8b, 0xaa57c450), TOBN(0x140c9ad6, 0x9bbdafef), - TOBN(0x2067aa42, 0x25ac0f18), TOBN(0xf7b1295b, 0x04d1fbf3), - TOBN(0x14829111, 0xa4b04824), TOBN(0x2ce3f192, 0x33bd5e91), - TOBN(0x9c7a1d55, 0x8f2e1b72), TOBN(0xfe932286, 0x302aa243), - TOBN(0x497ca7b4, 0xd4be9554), TOBN(0xb8e821b8, 0xe0547a6e), - TOBN(0xfb2838be, 0x67e573e0), TOBN(0x05891db9, 0x4084c44b), - TOBN(0x91311373, 0x96c1c2c5), TOBN(0x6aebfa3f, 0xd958444b), - TOBN(0xac9cdce9, 0xe56e55c1), TOBN(0x7148ced3, 0x2caa46d0), - TOBN(0x2e10c7ef, 0xb61fe8eb), TOBN(0x9fd835da, 0xff97cf4d)}, - {TOBN(0xa36da109, 0x081e9387), TOBN(0xfb9780d7, 0x8c935828), - TOBN(0xd5940332, 0xe540b015), TOBN(0xc9d7b51b, 0xe0f466fa), - TOBN(0xfaadcd41, 0xd6d9f671), TOBN(0xba6c1e28, 0xb1a2ac17), - TOBN(0x066a7833, 0xed201e5f), TOBN(0x19d99719, 0xf90f462b), - TOBN(0xf431f462, 0x060b5f61), TOBN(0xa56f46b4, 0x7bd057c2), - TOBN(0x348dca6c, 0x47e1bf65), TOBN(0x9a38783e, 0x41bcf1ff), - TOBN(0x7a5d33a9, 0xda710718), TOBN(0x5a779987, 0x2e0aeaf6), - TOBN(0xca87314d, 0x2d29d187), TOBN(0xfa0edc3e, 0xc687d733), - TOBN(0x9df33621, 0x6a31e09b), TOBN(0xde89e44d, 0xc1350e35), - TOBN(0x29214871, 0x4ca0cf52), TOBN(0xdf379672, 0x0b88a538), - TOBN(0xc92a510a, 0x2591d61b), TOBN(0x79aa87d7, 0x585b447b), - TOBN(0xf67db604, 0xe5287f77), TOBN(0x1697c8bf, 0x5efe7a80), - TOBN(0x1c894849, 0xcb198ac7), TOBN(0xa884a93d, 0x0f264665), - TOBN(0x2da964ef, 0x9b200678), TOBN(0x3c351b87, 0x009834e6), - TOBN(0xafb2ef9f, 0xe2c4b44b), TOBN(0x580f6c47, 0x3326790c), - TOBN(0xb8480521, 0x0b02264a), TOBN(0x8ba6f9e2, 0x42a194e2), - TOBN(0xfc87975f, 0x8fb54738), TOBN(0x35160788, 0x27c3ead3), - TOBN(0x834116d2, 0xb74a085a), TOBN(0x53c99a73, 0xa62fe996), - TOBN(0x87585be0, 0x5b81c51b), TOBN(0x925bafa8, 0xbe0852b7), - TOBN(0x76a4fafd, 0xa84d19a7), TOBN(0x39a45982, 0x585206d4), - TOBN(0x499b6ab6, 0x5eb03c0e), TOBN(0xf19b7954, 0x72bc3fde), - TOBN(0xa86b5b9c, 0x6e3a80d2), TOBN(0xe4377508, 0x6d42819f), - TOBN(0xc1663650, 0xbb3ee8a3), TOBN(0x75eb14fc, 0xb132075f), - TOBN(0xa8ccc906, 0x7ad834f6), TOBN(0xea6a2474, 0xe6e92ffd), - TOBN(0x9d72fd95, 0x0f8d6758), TOBN(0xcb84e101, 0x408c07dd), - TOBN(0xb9114bfd, 0xa5e23221), TOBN(0x358b5fe2, 0xe94e742c), - TOBN(0x1c0577ec, 0x95f40e75), TOBN(0xf0155451, 0x3d73f3d6), - TOBN(0x9d55cd67, 0xbd1b9b66), TOBN(0x63e86e78, 0xaf8d63c7), - TOBN(0x39d934ab, 0xd3c095f1), TOBN(0x04b261be, 0xe4b76d71), - TOBN(0x1d2e6970, 0xe73e6984), TOBN(0x879fb23b, 0x5e5fcb11), - TOBN(0x11506c72, 0xdfd75490), TOBN(0x3a97d085, 0x61bcf1c1), - TOBN(0x43201d82, 0xbf5e7007), TOBN(0x7f0ac52f, 0x798232a7), - TOBN(0x2715cbc4, 0x6eb564d4), TOBN(0x8d6c752c, 0x9e570e29), - TOBN(0xf80247c8, 0x9ef5fd5d), TOBN(0xc3c66b46, 0xd53eb514), - TOBN(0x9666b401, 0x0f87de56), TOBN(0xce62c06f, 0xc6c603b5), - TOBN(0xae7b4c60, 0x7e4fc942), TOBN(0x38ac0b77, 0x663a9c19), - TOBN(0xcb4d20ee, 0x4b049136), TOBN(0x8b63bf12, 0x356a4613), - TOBN(0x1221aef6, 0x70e08128), TOBN(0xe62d8c51, 0x4acb6b16), - TOBN(0x71f64a67, 0x379e7896), TOBN(0xb25237a2, 0xcafd7fa5), - TOBN(0xf077bd98, 0x3841ba6a), TOBN(0xc4ac0244, 0x3cd16e7e), - TOBN(0x548ba869, 0x21fea4ca), TOBN(0xd36d0817, 0xf3dfdac1), - TOBN(0x09d8d71f, 0xf4685faf), TOBN(0x8eff66be, 0xc52c459a), - TOBN(0x182faee7, 0x0b57235e), TOBN(0xee3c39b1, 0x0106712b), - TOBN(0x5107331f, 0xc0fcdcb0), TOBN(0x669fb9dc, 0xa51054ba), - TOBN(0xb25101fb, 0x319d7682), TOBN(0xb0293129, 0x0a982fee), - TOBN(0x51c1c9b9, 0x0261b344), TOBN(0x0e008c5b, 0xbfd371fa), - TOBN(0xd866dd1c, 0x0278ca33), TOBN(0x666f76a6, 0xe5aa53b1), - TOBN(0xe5cfb779, 0x6013a2cf), TOBN(0x1d3a1aad, 0xa3521836), - TOBN(0xcedd2531, 0x73faa485), TOBN(0xc8ee6c4f, 0xc0a76878), - TOBN(0xddbccfc9, 0x2a11667d), TOBN(0x1a418ea9, 0x1c2f695a), - TOBN(0xdb11bd92, 0x51f73971), TOBN(0x3e4b3c82, 0xda2ed89f), - TOBN(0x9a44f3f4, 0xe73e0319), TOBN(0xd1e3de0f, 0x303431af), - TOBN(0x3c5604ff, 0x50f75f9c), TOBN(0x1d8eddf3, 0x7e752b22), - TOBN(0x0ef074dd, 0x3c9a1118), TOBN(0xd0ffc172, 0xccb86d7b), - TOBN(0xabd1ece3, 0x037d90f2), TOBN(0xe3f307d6, 0x6055856c), - TOBN(0x422f9328, 0x7e4c6daf), TOBN(0x902aac66, 0x334879a0), - TOBN(0xb6a1e7bf, 0x94cdfade), TOBN(0x6c97e1ed, 0x7fc6d634), - TOBN(0x662ad24d, 0xa2fb63f8), TOBN(0xf81be1b9, 0xa5928405), - TOBN(0x86d765e4, 0xd14b4206), TOBN(0xbecc2e0e, 0x8fa0db65), - TOBN(0xa28838e0, 0xb17fc76c), TOBN(0xe49a602a, 0xe37cf24e), - TOBN(0x76b4131a, 0x567193ec), TOBN(0xaf3c305a, 0xe5f6e70b), - TOBN(0x9587bd39, 0x031eebdd), TOBN(0x5709def8, 0x71bbe831), - TOBN(0x57059983, 0x0eb2b669), TOBN(0x4d80ce1b, 0x875b7029), - TOBN(0x838a7da8, 0x0364ac16), TOBN(0x2f431d23, 0xbe1c83ab), - TOBN(0xe56812a6, 0xf9294dd3), TOBN(0xb448d01f, 0x9b4b0d77), - TOBN(0xf3ae6061, 0x04e8305c), TOBN(0x2bead645, 0x94d8c63e), - TOBN(0x0a85434d, 0x84fd8b07), TOBN(0x537b983f, 0xf7a9dee5), - TOBN(0xedcc5f18, 0xef55bd85), TOBN(0x2041af62, 0x21c6cf8b), - TOBN(0x8e52874c, 0xb940c71e), TOBN(0x211935a9, 0xdb5f4b3a), - TOBN(0x94350492, 0x301b1dc3), TOBN(0x33d2646d, 0x29958620), - TOBN(0x16b0d64b, 0xef911404), TOBN(0x9d1f25ea, 0x9a3c5ef4), - TOBN(0x20f200eb, 0x4a352c78), TOBN(0x43929f2c, 0x4bd0b428), - TOBN(0xa5656667, 0xc7196e29), TOBN(0x7992c2f0, 0x9391be48), - TOBN(0xaaa97cbd, 0x9ee0cd6e), TOBN(0x51b0310c, 0x3dc8c9bf), - TOBN(0x237f8acf, 0xdd9f22cb), TOBN(0xbb1d81a1, 0xb585d584), - TOBN(0x8d5d85f5, 0x8c416388), TOBN(0x0d6e5a5a, 0x42fe474f), - TOBN(0xe7812766, 0x38235d4e), TOBN(0x1c62bd67, 0x496e3298), - TOBN(0x8378660c, 0x3f175bc8), TOBN(0x4d04e189, 0x17afdd4d), - TOBN(0x32a81601, 0x85a8068c), TOBN(0xdb58e4e1, 0x92b29a85), - TOBN(0xe8a65b86, 0xc70d8a3b), TOBN(0x5f0e6f4e, 0x98a0403b), - TOBN(0x08129684, 0x69ed2370), TOBN(0x34dc30bd, 0x0871ee26), - TOBN(0x3a5ce948, 0x7c9c5b05), TOBN(0x7d487b80, 0x43a90c87), - TOBN(0x4089ba37, 0xdd0e7179), TOBN(0x45f80191, 0xb4041811), - TOBN(0x1c3e1058, 0x98747ba5), TOBN(0x98c4e13a, 0x6e1ae592), - TOBN(0xd44636e6, 0xe82c9f9e), TOBN(0x711db87c, 0xc33a1043), - TOBN(0x6f431263, 0xaa8aec05), TOBN(0x43ff120d, 0x2744a4aa), - TOBN(0xd3bd892f, 0xae77779b), TOBN(0xf0fe0cc9, 0x8cdc9f82), - TOBN(0xca5f7fe6, 0xf1c5b1bc), TOBN(0xcc63a682, 0x44929a72), - TOBN(0xc7eaba0c, 0x09dbe19a), TOBN(0x2f3585ad, 0x6b5c73c2), - TOBN(0x8ab8924b, 0x0ae50c30), TOBN(0x17fcd27a, 0x638b30ba), - TOBN(0xaf414d34, 0x10b3d5a5), TOBN(0x09c107d2, 0x2a9accf1), - TOBN(0x15dac49f, 0x946a6242), TOBN(0xaec3df2a, 0xd707d642), - TOBN(0x2c2492b7, 0x3f894ae0), TOBN(0xf59df3e5, 0xb75f18ce), - TOBN(0x7cb740d2, 0x8f53cad0), TOBN(0x3eb585fb, 0xc4f01294), - TOBN(0x17da0c86, 0x32c7f717), TOBN(0xeb8c795b, 0xaf943f4c), - TOBN(0x4ee23fb5, 0xf67c51d2), TOBN(0xef187575, 0x68889949), - TOBN(0xa6b4bdb2, 0x0389168b), TOBN(0xc4ecd258, 0xea577d03), - TOBN(0x3a63782b, 0x55743082), TOBN(0x6f678f4c, 0xc72f08cd), - TOBN(0x553511cf, 0x65e58dd8), TOBN(0xd53b4e3e, 0xd402c0cd), - TOBN(0x37de3e29, 0xa037c14c), TOBN(0x86b6c516, 0xc05712aa), - TOBN(0x2834da3e, 0xb38dff6f), TOBN(0xbe012c52, 0xea636be8), - TOBN(0x292d238c, 0x61dd37f8), TOBN(0x0e54523f, 0x8f8142db), - TOBN(0xe31eb436, 0x036a05d8), TOBN(0x83e3cdff, 0x1e93c0ff), - TOBN(0x3fd2fe0f, 0x50821ddf), TOBN(0xc8e19b0d, 0xff9eb33b), - TOBN(0xc8cc943f, 0xb569a5fe), TOBN(0xad0090d4, 0xd4342d75), - TOBN(0x82090b4b, 0xcaeca000), TOBN(0xca39687f, 0x1bd410eb), - TOBN(0xe7bb0df7, 0x65959d77), TOBN(0x39d78218, 0x9c964999), - TOBN(0xd87f62e8, 0xb2415451), TOBN(0xe5efb774, 0xbed76108), - TOBN(0x3ea011a4, 0xe822f0d0), TOBN(0xbc647ad1, 0x5a8704f8), - TOBN(0xbb315b35, 0x50c6820f), TOBN(0x863dec3d, 0xb7e76bec), - TOBN(0x01ff5d3a, 0xf017bfc7), TOBN(0x20054439, 0x976b8229), - TOBN(0x067fca37, 0x0bbd0d3b), TOBN(0xf63dde64, 0x7f5e3d0f), - TOBN(0x22dbefb3, 0x2a4c94e9), TOBN(0xafbff0fe, 0x96f8278a), - TOBN(0x80aea0b1, 0x3503793d), TOBN(0xb2238029, 0x5f06cd29), - TOBN(0x65703e57, 0x8ec3feca), TOBN(0x06c38314, 0x393e7053), - TOBN(0xa0b751eb, 0x7c6734c4), TOBN(0xd2e8a435, 0xc59f0f1e), - TOBN(0x147d9052, 0x5e9ca895), TOBN(0x2f4dd31e, 0x972072df), - TOBN(0xa16fda8e, 0xe6c6755c), TOBN(0xc66826ff, 0xcf196558), - TOBN(0x1f1a76a3, 0x0cf43895), TOBN(0xa9d604e0, 0x83c3097b), - TOBN(0xe1908309, 0x66390e0e), TOBN(0xa50bf753, 0xb3c85eff), - TOBN(0x0696bdde, 0xf6a70251), TOBN(0x548b801b, 0x3c6ab16a), - TOBN(0x37fcf704, 0xa4d08762), TOBN(0x090b3def, 0xdff76c4e), - TOBN(0x87e8cb89, 0x69cb9158), TOBN(0x44a90744, 0x995ece43), - TOBN(0xf85395f4, 0x0ad9fbf5), TOBN(0x49b0f6c5, 0x4fb0c82d), - TOBN(0x75d9bc15, 0xadf7cccf), TOBN(0x81a3e5d6, 0xdfa1e1b0), - TOBN(0x8c39e444, 0x249bc17e), TOBN(0xf37dccb2, 0x8ea7fd43), - TOBN(0xda654873, 0x907fba12), TOBN(0x35daa6da, 0x4a372904), - TOBN(0x0564cfc6, 0x6283a6c5), TOBN(0xd09fa4f6, 0x4a9395bf), - TOBN(0x688e9ec9, 0xaeb19a36), TOBN(0xd913f1ce, 0xc7bfbfb4), - TOBN(0x797b9a3c, 0x61c2faa6), TOBN(0x2f979bec, 0x6a0a9c12), - TOBN(0xb5969d0f, 0x359679ec), TOBN(0xebcf523d, 0x079b0460), - TOBN(0xfd6b0008, 0x10fab870), TOBN(0x3f2edcda, 0x9373a39c), - TOBN(0x0d64f9a7, 0x6f568431), TOBN(0xf848c27c, 0x02f8898c), - TOBN(0xf418ade1, 0x260b5bd5), TOBN(0xc1f3e323, 0x6973dee8), - TOBN(0x46e9319c, 0x26c185dd), TOBN(0x6d85b7d8, 0x546f0ac4), - TOBN(0x427965f2, 0x247f9d57), TOBN(0xb519b636, 0xb0035f48), - TOBN(0x6b6163a9, 0xab87d59c), TOBN(0xff9f58c3, 0x39caaa11), - TOBN(0x4ac39cde, 0x3177387b), TOBN(0x5f6557c2, 0x873e77f9), - TOBN(0x67504006, 0x36a83041), TOBN(0x9b1c96ca, 0x75ef196c), - TOBN(0xf34283de, 0xb08c7940), TOBN(0x7ea09644, 0x1128c316), - TOBN(0xb510b3b5, 0x6aa39dff), TOBN(0x59b43da2, 0x9f8e4d8c), - TOBN(0xa8ce31fd, 0x9e4c4b9f), TOBN(0x0e20be26, 0xc1303c01), - TOBN(0x18187182, 0xe8ee47c9), TOBN(0xd9687cdb, 0x7db98101), - TOBN(0x7a520e4d, 0xa1e14ff6), TOBN(0x429808ba, 0x8836d572), - TOBN(0xa37ca60d, 0x4944b663), TOBN(0xf901f7a9, 0xa3f91ae5), - TOBN(0xe4e3e76e, 0x9e36e3b1), TOBN(0x9aa219cf, 0x29d93250), - TOBN(0x347fe275, 0x056a2512), TOBN(0xa4d643d9, 0xde65d95c), - TOBN(0x9669d396, 0x699fc3ed), TOBN(0xb598dee2, 0xcf8c6bbe), - TOBN(0x682ac1e5, 0xdda9e5c6), TOBN(0x4e0d3c72, 0xcaa9fc95), - TOBN(0x17faaade, 0x772bea44), TOBN(0x5ef8428c, 0xab0009c8), - TOBN(0xcc4ce47a, 0x460ff016), TOBN(0xda6d12bf, 0x725281cb), - TOBN(0x44c67848, 0x0223aad2), TOBN(0x6e342afa, 0x36256e28), - TOBN(0x1400bb0b, 0x93a37c04), TOBN(0x62b1bc9b, 0xdd10bd96), - TOBN(0x7251adeb, 0x0dac46b7), TOBN(0x7d33b92e, 0x7be4ef51), - TOBN(0x28b2a94b, 0xe61fa29a), TOBN(0x4b2be13f, 0x06422233), - TOBN(0x36d6d062, 0x330d8d37), TOBN(0x5ef80e1e, 0xb28ca005), - TOBN(0x174d4699, 0x6d16768e), TOBN(0x9fc4ff6a, 0x628bf217), - TOBN(0x77705a94, 0x154e490d), TOBN(0x9d96dd28, 0x8d2d997a), - TOBN(0x77e2d9d8, 0xce5d72c4), TOBN(0x9d06c5a4, 0xc11c714f), - TOBN(0x02aa5136, 0x79e4a03e), TOBN(0x1386b3c2, 0x030ff28b), - TOBN(0xfe82e8a6, 0xfb283f61), TOBN(0x7df203e5, 0xf3abc3fb), - TOBN(0xeec7c351, 0x3a4d3622), TOBN(0xf7d17dbf, 0xdf762761), - TOBN(0xc3956e44, 0x522055f0), TOBN(0xde3012db, 0x8fa748db), - TOBN(0xca9fcb63, 0xbf1dcc14), TOBN(0xa56d9dcf, 0xbe4e2f3a), - TOBN(0xb86186b6, 0x8bcec9c2), TOBN(0x7cf24df9, 0x680b9f06), - TOBN(0xc46b45ea, 0xc0d29281), TOBN(0xfff42bc5, 0x07b10e12), - TOBN(0x12263c40, 0x4d289427), TOBN(0x3d5f1899, 0xb4848ec4), - TOBN(0x11f97010, 0xd040800c), TOBN(0xb4c5f529, 0x300feb20), - TOBN(0xcc543f8f, 0xde94fdcb), TOBN(0xe96af739, 0xc7c2f05e), - TOBN(0xaa5e0036, 0x882692e1), TOBN(0x09c75b68, 0x950d4ae9), - TOBN(0x62f63df2, 0xb5932a7a), TOBN(0x2658252e, 0xde0979ad), - TOBN(0x2a19343f, 0xb5e69631), TOBN(0x718c7501, 0x525b666b), - TOBN(0x26a42d69, 0xea40dc3a), TOBN(0xdc84ad22, 0xaecc018f), - TOBN(0x25c36c7b, 0x3270f04a), TOBN(0x46ba6d47, 0x50fa72ed), - TOBN(0x6c37d1c5, 0x93e58a8e), TOBN(0xa2394731, 0x120c088c), - TOBN(0xc3be4263, 0xcb6e86da), TOBN(0x2c417d36, 0x7126d038), - TOBN(0x5b70f9c5, 0x8b6f8efa), TOBN(0x671a2faa, 0x37718536), - TOBN(0xd3ced3c6, 0xb539c92b), TOBN(0xe56f1bd9, 0xa31203c2), - TOBN(0x8b096ec4, 0x9ff3c8eb), TOBN(0x2deae432, 0x43491cea), - TOBN(0x2465c6eb, 0x17943794), TOBN(0x5d267e66, 0x20586843), - TOBN(0x9d3d116d, 0xb07159d0), TOBN(0xae07a67f, 0xc1896210), - TOBN(0x8fc84d87, 0xbb961579), TOBN(0x30009e49, 0x1c1f8dd6), - TOBN(0x8a8caf22, 0xe3132819), TOBN(0xcffa197c, 0xf23ab4ff), - TOBN(0x58103a44, 0x205dd687), TOBN(0x57b796c3, 0x0ded67a2), - TOBN(0x0b9c3a6c, 0xa1779ad7), TOBN(0xa33cfe2e, 0x357c09c5), - TOBN(0x2ea29315, 0x3db4a57e), TOBN(0x91959695, 0x8ebeb52e), - TOBN(0x118db9a6, 0xe546c879), TOBN(0x8e996df4, 0x6295c8d6), - TOBN(0xdd990484, 0x55ec806b), TOBN(0x24f291ca, 0x165c1035), - TOBN(0xcca523bb, 0x440e2229), TOBN(0x324673a2, 0x73ef4d04), - TOBN(0xaf3adf34, 0x3e11ec39), TOBN(0x6136d7f1, 0xdc5968d3), - TOBN(0x7a7b2899, 0xb053a927), TOBN(0x3eaa2661, 0xae067ecd), - TOBN(0x8549b9c8, 0x02779cd9), TOBN(0x061d7940, 0xc53385ea), - TOBN(0x3e0ba883, 0xf06d18bd), TOBN(0x4ba6de53, 0xb2700843), - TOBN(0xb966b668, 0x591a9e4d), TOBN(0x93f67567, 0x7f4fa0ed), - TOBN(0x5a02711b, 0x4347237b), TOBN(0xbc041e2f, 0xe794608e), - TOBN(0x55af10f5, 0x70f73d8c), TOBN(0xd2d4d4f7, 0xbb7564f7), - TOBN(0xd7d27a89, 0xb3e93ce7), TOBN(0xf7b5a875, 0x5d3a2c1b), - TOBN(0xb29e68a0, 0x255b218a), TOBN(0xb533837e, 0x8af76754), - TOBN(0xd1b05a73, 0x579fab2e), TOBN(0xb41055a1, 0xecd74385), - TOBN(0xb2369274, 0x445e9115), TOBN(0x2972a7c4, 0xf520274e), - TOBN(0x6c08334e, 0xf678e68a), TOBN(0x4e4160f0, 0x99b057ed), - TOBN(0x3cfe11b8, 0x52ccb69a), TOBN(0x2fd1823a, 0x21c8f772), - TOBN(0xdf7f072f, 0x3298f055), TOBN(0x8c0566f9, 0xfec74a6e), - TOBN(0xe549e019, 0x5bb4d041), TOBN(0x7c3930ba, 0x9208d850), - TOBN(0xe07141fc, 0xaaa2902b), TOBN(0x539ad799, 0xe4f69ad3), - TOBN(0xa6453f94, 0x813f9ffd), TOBN(0xc58d3c48, 0x375bc2f7), - TOBN(0xb3326fad, 0x5dc64e96), TOBN(0x3aafcaa9, 0xb240e354), - TOBN(0x1d1b0903, 0xaca1e7a9), TOBN(0x4ceb9767, 0x1211b8a0), - TOBN(0xeca83e49, 0xe32a858e), TOBN(0x4c32892e, 0xae907bad), - TOBN(0xd5b42ab6, 0x2eb9b494), TOBN(0x7fde3ee2, 0x1eabae1b), - TOBN(0x13b5ab09, 0xcaf54957), TOBN(0xbfb028be, 0xe5f5d5d5), - TOBN(0x928a0650, 0x2003e2c0), TOBN(0x90793aac, 0x67476843), - TOBN(0x5e942e79, 0xc81710a0), TOBN(0x557e4a36, 0x27ccadd4), - TOBN(0x72a2bc56, 0x4bcf6d0c), TOBN(0x09ee5f43, 0x26d7b80c), - TOBN(0x6b70dbe9, 0xd4292f19), TOBN(0x56f74c26, 0x63f16b18), - TOBN(0xc23db0f7, 0x35fbb42a), TOBN(0xb606bdf6, 0x6ae10040), - TOBN(0x1eb15d4d, 0x044573ac), TOBN(0x7dc3cf86, 0x556b0ba4), - TOBN(0x97af9a33, 0xc60df6f7), TOBN(0x0b1ef85c, 0xa716ce8c), - TOBN(0x2922f884, 0xc96958be), TOBN(0x7c32fa94, 0x35690963), - TOBN(0x2d7f667c, 0xeaa00061), TOBN(0xeaaf7c17, 0x3547365c), - TOBN(0x1eb4de46, 0x87032d58), TOBN(0xc54f3d83, 0x5e2c79e0), - TOBN(0x07818df4, 0x5d04ef23), TOBN(0x55faa9c8, 0x673d41b4), - TOBN(0xced64f6f, 0x89b95355), TOBN(0x4860d2ea, 0xb7415c84), - TOBN(0x5fdb9bd2, 0x050ebad3), TOBN(0xdb53e0cc, 0x6685a5bf), - TOBN(0xb830c031, 0x9feb6593), TOBN(0xdd87f310, 0x6accff17), - TOBN(0x2303ebab, 0x9f555c10), TOBN(0x94603695, 0x287e7065), - TOBN(0xf88311c3, 0x2e83358c), TOBN(0x508dd9b4, 0xeefb0178), - TOBN(0x7ca23706, 0x2dba8652), TOBN(0x62aac5a3, 0x0047abe5), - TOBN(0x9a61d2a0, 0x8b1ea7b3), TOBN(0xd495ab63, 0xae8b1485), - TOBN(0x38740f84, 0x87052f99), TOBN(0x178ebe5b, 0xb2974eea), - TOBN(0x030bbcca, 0x5b36d17f), TOBN(0xb5e4cce3, 0xaaf86eea), - TOBN(0xb51a0220, 0x68f8e9e0), TOBN(0xa4348796, 0x09eb3e75), - TOBN(0xbe592309, 0xeef1a752), TOBN(0x5d7162d7, 0x6f2aa1ed), - TOBN(0xaebfb5ed, 0x0f007dd2), TOBN(0x255e14b2, 0xc89edd22), - TOBN(0xba85e072, 0x0303b697), TOBN(0xc5d17e25, 0xf05720ff), - TOBN(0x02b58d6e, 0x5128ebb6), TOBN(0x2c80242d, 0xd754e113), - TOBN(0x919fca5f, 0xabfae1ca), TOBN(0x937afaac, 0x1a21459b), - TOBN(0x9e0ca91c, 0x1f66a4d2), TOBN(0x194cc7f3, 0x23ec1331), - TOBN(0xad25143a, 0x8aa11690), TOBN(0xbe40ad8d, 0x09b59e08), - TOBN(0x37d60d9b, 0xe750860a), TOBN(0x6c53b008, 0xc6bf434c), - TOBN(0xb572415d, 0x1356eb80), TOBN(0xb8bf9da3, 0x9578ded8), - TOBN(0x22658e36, 0x5e8fb38b), TOBN(0x9b70ce22, 0x5af8cb22), - TOBN(0x7c00018a, 0x829a8180), TOBN(0x84329f93, 0xb81ed295), - TOBN(0x7c343ea2, 0x5f3cea83), TOBN(0x38f8655f, 0x67586536), - TOBN(0xa661a0d0, 0x1d3ec517), TOBN(0x98744652, 0x512321ae), - TOBN(0x084ca591, 0xeca92598), TOBN(0xa9bb9dc9, 0x1dcb3feb), - TOBN(0x14c54355, 0x78b4c240), TOBN(0x5ed62a3b, 0x610cafdc), - TOBN(0x07512f37, 0x1b38846b), TOBN(0x571bb70a, 0xb0e38161), - TOBN(0xb556b95b, 0x2da705d2), TOBN(0x3ef8ada6, 0xb1a08f98), - TOBN(0x85302ca7, 0xddecfbe5), TOBN(0x0e530573, 0x943105cd), - TOBN(0x60554d55, 0x21a9255d), TOBN(0x63a32fa1, 0xf2f3802a), - TOBN(0x35c8c5b0, 0xcd477875), TOBN(0x97f458ea, 0x6ad42da1), - TOBN(0x832d7080, 0xeb6b242d), TOBN(0xd30bd023, 0x3b71e246), - TOBN(0x7027991b, 0xbe31139d), TOBN(0x68797e91, 0x462e4e53), - TOBN(0x423fe20a, 0x6b4e185a), TOBN(0x82f2c67e, 0x42d9b707), - TOBN(0x25c81768, 0x4cf7811b), TOBN(0xbd53005e, 0x045bb95d)}, - {TOBN(0xe5f649be, 0x9d8e68fd), TOBN(0xdb0f0533, 0x1b044320), - TOBN(0xf6fde9b3, 0xe0c33398), TOBN(0x92f4209b, 0x66c8cfae), - TOBN(0xe9d1afcc, 0x1a739d4b), TOBN(0x09aea75f, 0xa28ab8de), - TOBN(0x14375fb5, 0xeac6f1d0), TOBN(0x6420b560, 0x708f7aa5), - TOBN(0x9eae499c, 0x6254dc41), TOBN(0x7e293924, 0x7a837e7e), - TOBN(0x74aec08c, 0x090524a7), TOBN(0xf82b9219, 0x8d6f55f2), - TOBN(0x493c962e, 0x1402cec5), TOBN(0x9f17ca17, 0xfa2f30e7), - TOBN(0xbcd783e8, 0xe9b879cb), TOBN(0xea3d8c14, 0x5a6f145f), - TOBN(0xdede15e7, 0x5e0dee6e), TOBN(0x74f24872, 0xdc628aa2), - TOBN(0xd3e9c4fe, 0x7861bb93), TOBN(0x56d4822a, 0x6187b2e0), - TOBN(0xb66417cf, 0xc59826f9), TOBN(0xca260969, 0x2408169e), - TOBN(0xedf69d06, 0xc79ef885), TOBN(0x00031f8a, 0xdc7d138f), - TOBN(0x103c46e6, 0x0ebcf726), TOBN(0x4482b831, 0x6231470e), - TOBN(0x6f6dfaca, 0x487c2109), TOBN(0x2e0ace97, 0x62e666ef), - TOBN(0x3246a9d3, 0x1f8d1f42), TOBN(0x1b1e83f1, 0x574944d2), - TOBN(0x13dfa63a, 0xa57f334b), TOBN(0x0cf8daed, 0x9f025d81), - TOBN(0x30d78ea8, 0x00ee11c1), TOBN(0xeb053cd4, 0xb5e3dd75), - TOBN(0x9b65b13e, 0xd58c43c5), TOBN(0xc3ad49bd, 0xbd151663), - TOBN(0x99fd8e41, 0xb6427990), TOBN(0x12cf15bd, 0x707eae1e), - TOBN(0x29ad4f1b, 0x1aabb71e), TOBN(0x5143e74d, 0x07545d0e), - TOBN(0x30266336, 0xc88bdee1), TOBN(0x25f29306, 0x5876767c), - TOBN(0x9c078571, 0xc6731996), TOBN(0xc88690b2, 0xed552951), - TOBN(0x274f2c2d, 0x852705b4), TOBN(0xb0bf8d44, 0x4e09552d), - TOBN(0x7628beeb, 0x986575d1), TOBN(0x407be238, 0x7f864651), - TOBN(0x0e5e3049, 0xa639fc6b), TOBN(0xe75c35d9, 0x86003625), - TOBN(0x0cf35bd8, 0x5dcc1646), TOBN(0x8bcaced2, 0x6c26273a), - TOBN(0xe22ecf1d, 0xb5536742), TOBN(0x013dd897, 0x1a9e068b), - TOBN(0x17f411cb, 0x8a7909c5), TOBN(0x5757ac98, 0x861dd506), - TOBN(0x85de1f0d, 0x1e935abb), TOBN(0xdefd10b4, 0x154de37a), - TOBN(0xb8d9e392, 0x369cebb5), TOBN(0x54d5ef9b, 0x761324be), - TOBN(0x4d6341ba, 0x74f17e26), TOBN(0xc0a0e3c8, 0x78c1dde4), - TOBN(0xa6d77581, 0x87d918fd), TOBN(0x66876015, 0x02ca3a13), - TOBN(0xc7313e9c, 0xf36658f0), TOBN(0xc433ef1c, 0x71f8057e), - TOBN(0x85326246, 0x1b6a835a), TOBN(0xc8f05398, 0x7c86394c), - TOBN(0xff398cdf, 0xe983c4a1), TOBN(0xbf5e8162, 0x03b7b931), - TOBN(0x93193c46, 0xb7b9045b), TOBN(0x1e4ebf5d, 0xa4a6e46b), - TOBN(0xf9942a60, 0x43a24fe7), TOBN(0x29c1191e, 0xffb3492b), - TOBN(0x9f662449, 0x902fde05), TOBN(0xc792a7ac, 0x6713c32d), - TOBN(0x2fd88ad8, 0xb737982c), TOBN(0x7e3a0319, 0xa21e60e3), - TOBN(0x09b0de44, 0x7383591a), TOBN(0x6df141ee, 0x8310a456), - TOBN(0xaec1a039, 0xe6d6f471), TOBN(0x14b2ba0f, 0x1198d12e), - TOBN(0xebc1a160, 0x3aeee5ac), TOBN(0x401f4836, 0xe0b964ce), - TOBN(0x2ee43796, 0x4fd03f66), TOBN(0x3fdb4e49, 0xdd8f3f12), - TOBN(0x6ef267f6, 0x29380f18), TOBN(0x3e8e9670, 0x8da64d16), - TOBN(0xbc19180c, 0x207674f1), TOBN(0x112e09a7, 0x33ae8fdb), - TOBN(0x99667554, 0x6aaeb71e), TOBN(0x79432af1, 0xe101b1c7), - TOBN(0xd5eb558f, 0xde2ddec6), TOBN(0x81392d1f, 0x5357753f), - TOBN(0xa7a76b97, 0x3ae1158a), TOBN(0x416fbbff, 0x4a899991), - TOBN(0x9e65fdfd, 0x0d4a9dcf), TOBN(0x7bc29e48, 0x944ddf12), - TOBN(0xbc1a92d9, 0x3c856866), TOBN(0x273c6905, 0x6e98dfe2), - TOBN(0x69fce418, 0xcdfaa6b8), TOBN(0x606bd823, 0x5061c69f), - TOBN(0x42d495a0, 0x6af75e27), TOBN(0x8ed3d505, 0x6d873a1f), - TOBN(0xaf552841, 0x6ab25b6a), TOBN(0xc6c0ffc7, 0x2b1a4523), - TOBN(0xab18827b, 0x21c99e03), TOBN(0x060e8648, 0x9034691b), - TOBN(0x5207f90f, 0x93c7f398), TOBN(0x9f4a96cb, 0x82f8d10b), - TOBN(0xdd71cd79, 0x3ad0f9e3), TOBN(0x84f435d2, 0xfc3a54f5), - TOBN(0x4b03c55b, 0x8e33787f), TOBN(0xef42f975, 0xa6384673), - TOBN(0xff7304f7, 0x5051b9f0), TOBN(0x18aca1dc, 0x741c87c2), - TOBN(0x56f120a7, 0x2d4bfe80), TOBN(0xfd823b3d, 0x053e732c), - TOBN(0x11bccfe4, 0x7537ca16), TOBN(0xdf6c9c74, 0x1b5a996b), - TOBN(0xee7332c7, 0x904fc3fa), TOBN(0x14a23f45, 0xc7e3636a), - TOBN(0xc38659c3, 0xf091d9aa), TOBN(0x4a995e5d, 0xb12d8540), - TOBN(0x20a53bec, 0xf3a5598a), TOBN(0x56534b17, 0xb1eaa995), - TOBN(0x9ed3dca4, 0xbf04e03c), TOBN(0x716c563a, 0xd8d56268), - TOBN(0x27ba77a4, 0x1d6178e7), TOBN(0xe4c80c40, 0x68a1ff8e), - TOBN(0x75011099, 0x0a13f63d), TOBN(0x7bf33521, 0xa61d46f3), - TOBN(0x0aff218e, 0x10b365bb), TOBN(0x81021804, 0x0fd7ea75), - TOBN(0x05a3fd8a, 0xa4b3a925), TOBN(0xb829e75f, 0x9b3db4e6), - TOBN(0x6bdc75a5, 0x4d53e5fb), TOBN(0x04a5dc02, 0xd52717e3), - TOBN(0x86af502f, 0xe9a42ec2), TOBN(0x8867e8fb, 0x2630e382), - TOBN(0xbf845c6e, 0xbec9889b), TOBN(0x54f491f2, 0xcb47c98d), - TOBN(0xa3091fba, 0x790c2a12), TOBN(0xd7f6fd78, 0xc20f708b), - TOBN(0xa569ac30, 0xacde5e17), TOBN(0xd0f996d0, 0x6852b4d7), - TOBN(0xe51d4bb5, 0x4609ae54), TOBN(0x3fa37d17, 0x0daed061), - TOBN(0x62a88684, 0x34b8fb41), TOBN(0x99a2acbd, 0x9efb64f1), - TOBN(0xb75c1a5e, 0x6448e1f2), TOBN(0xfa99951a, 0x42b5a069), - TOBN(0x6d956e89, 0x2f3b26e7), TOBN(0xf4709860, 0xda875247), - TOBN(0x3ad15179, 0x2482dda3), TOBN(0xd64110e3, 0x017d82f0), - TOBN(0x14928d2c, 0xfad414e4), TOBN(0x2b155f58, 0x2ed02b24), - TOBN(0x481a141b, 0xcb821bf1), TOBN(0x12e3c770, 0x4f81f5da), - TOBN(0xe49c5de5, 0x9fff8381), TOBN(0x11053232, 0x5bbec894), - TOBN(0xa0d051cc, 0x454d88c4), TOBN(0x4f6db89c, 0x1f8e531b), - TOBN(0x34fe3fd6, 0xca563a44), TOBN(0x7f5c2215, 0x58da8ab9), - TOBN(0x8445016d, 0x9474f0a1), TOBN(0x17d34d61, 0xcb7d8a0a), - TOBN(0x8e9d3910, 0x1c474019), TOBN(0xcaff2629, 0xd52ceefb), - TOBN(0xf9cf3e32, 0xc1622c2b), TOBN(0xd4b95e3c, 0xe9071a05), - TOBN(0xfbbca61f, 0x1594438c), TOBN(0x1eb6e6a6, 0x04aadedf), - TOBN(0x853027f4, 0x68e14940), TOBN(0x221d322a, 0xdfabda9c), - TOBN(0xed8ea9f6, 0xb7cb179a), TOBN(0xdc7b764d, 0xb7934dcc), - TOBN(0xfcb13940, 0x5e09180d), TOBN(0x6629a6bf, 0xb47dc2dd), - TOBN(0xbfc55e4e, 0x9f5a915e), TOBN(0xb1db9d37, 0x6204441e), - TOBN(0xf82d68cf, 0x930c5f53), TOBN(0x17d3a142, 0xcbb605b1), - TOBN(0xdd5944ea, 0x308780f2), TOBN(0xdc8de761, 0x3845f5e4), - TOBN(0x6beaba7d, 0x7624d7a3), TOBN(0x1e709afd, 0x304df11e), - TOBN(0x95364376, 0x02170456), TOBN(0xbf204b3a, 0xc8f94b64), - TOBN(0x4e53af7c, 0x5680ca68), TOBN(0x0526074a, 0xe0c67574), - TOBN(0x95d8cef8, 0xecd92af6), TOBN(0xe6b9fa7a, 0x6cd1745a), - TOBN(0x3d546d3d, 0xa325c3e4), TOBN(0x1f57691d, 0x9ae93aae), - TOBN(0xe891f3fe, 0x9d2e1a33), TOBN(0xd430093f, 0xac063d35), - TOBN(0xeda59b12, 0x5513a327), TOBN(0xdc2134f3, 0x5536f18f), - TOBN(0xaa51fe2c, 0x5c210286), TOBN(0x3f68aaee, 0x1cab658c), - TOBN(0x5a23a00b, 0xf9357292), TOBN(0x9a626f39, 0x7efdabed), - TOBN(0xfe2b3bf3, 0x199d78e3), TOBN(0xb7a2af77, 0x71bbc345), - TOBN(0x3d19827a, 0x1e59802c), TOBN(0x823bbc15, 0xb487a51c), - TOBN(0x856139f2, 0x99d0a422), TOBN(0x9ac3df65, 0xf456c6fb), - TOBN(0xaddf65c6, 0x701f8bd6), TOBN(0x149f321e, 0x3758df87), - TOBN(0xb1ecf714, 0x721b7eba), TOBN(0xe17df098, 0x31a3312a), - TOBN(0xdb2fd6ec, 0xd5c4d581), TOBN(0xfd02996f, 0x8fcea1b3), - TOBN(0xe29fa63e, 0x7882f14f), TOBN(0xc9f6dc35, 0x07c6cadc), - TOBN(0x46f22d6f, 0xb882bed0), TOBN(0x1a45755b, 0xd118e52c), - TOBN(0x9f2c7c27, 0x7c4608cf), TOBN(0x7ccbdf32, 0x568012c2), - TOBN(0xfcb0aedd, 0x61729b0e), TOBN(0x7ca2ca9e, 0xf7d75dbf), - TOBN(0xf58fecb1, 0x6f640f62), TOBN(0xe274b92b, 0x39f51946), - TOBN(0x7f4dfc04, 0x6288af44), TOBN(0x0a91f32a, 0xeac329e5), - TOBN(0x43ad274b, 0xd6aaba31), TOBN(0x719a1640, 0x0f6884f9), - TOBN(0x685d29f6, 0xdaf91e20), TOBN(0x5ec1cc33, 0x27e49d52), - TOBN(0x38f4de96, 0x3b54a059), TOBN(0x0e0015e5, 0xefbcfdb3), - TOBN(0x177d23d9, 0x4dbb8da6), TOBN(0x98724aa2, 0x97a617ad), - TOBN(0x30f0885b, 0xfdb6558e), TOBN(0xf9f7a28a, 0xc7899a96), - TOBN(0xd2ae8ac8, 0x872dc112), TOBN(0xfa0642ca, 0x73c3c459), - TOBN(0x15296981, 0xe7dfc8d6), TOBN(0x67cd4450, 0x1fb5b94a), - TOBN(0x0ec71cf1, 0x0eddfd37), TOBN(0xc7e5eeb3, 0x9a8eddc7), - TOBN(0x02ac8e3d, 0x81d95028), TOBN(0x0088f172, 0x70b0e35d), - TOBN(0xec041fab, 0xe1881fe3), TOBN(0x62cf71b8, 0xd99e7faa), - TOBN(0x5043dea7, 0xe0f222c2), TOBN(0x309d42ac, 0x72e65142), - TOBN(0x94fe9ddd, 0x9216cd30), TOBN(0xd6539c7d, 0x0f87feec), - TOBN(0x03c5a57c, 0x432ac7d7), TOBN(0x72692cf0, 0x327fda10), - TOBN(0xec28c85f, 0x280698de), TOBN(0x2331fb46, 0x7ec283b1), - TOBN(0xd34bfa32, 0x2867e633), TOBN(0x78709a82, 0x0a9cc815), - TOBN(0xb7fe6964, 0x875e2fa5), TOBN(0x25cc064f, 0x9e98bfb5), - TOBN(0x9eb0151c, 0x493a65c5), TOBN(0x5fb5d941, 0x53182464), - TOBN(0x69e6f130, 0xf04618e2), TOBN(0xa8ecec22, 0xf89c8ab6), - TOBN(0xcd6ac88b, 0xb96209bd), TOBN(0x65fa8cdb, 0xb3e1c9e0), - TOBN(0xa47d22f5, 0x4a8d8eac), TOBN(0x83895cdf, 0x8d33f963), - TOBN(0xa8adca59, 0xb56cd3d1), TOBN(0x10c8350b, 0xdaf38232), - TOBN(0x2b161fb3, 0xa5080a9f), TOBN(0xbe7f5c64, 0x3af65b3a), - TOBN(0x2c754039, 0x97403a11), TOBN(0x94626cf7, 0x121b96af), - TOBN(0x431de7c4, 0x6a983ec2), TOBN(0x3780dd3a, 0x52cc3df7), - TOBN(0xe28a0e46, 0x2baf8e3b), TOBN(0xabe68aad, 0x51d299ae), - TOBN(0x603eb8f9, 0x647a2408), TOBN(0x14c61ed6, 0x5c750981), - TOBN(0x88b34414, 0xc53352e7), TOBN(0x5a34889c, 0x1337d46e), - TOBN(0x612c1560, 0xf95f2bc8), TOBN(0x8a3f8441, 0xd4807a3a), - TOBN(0x680d9e97, 0x5224da68), TOBN(0x60cd6e88, 0xc3eb00e9), - TOBN(0x3875a98e, 0x9a6bc375), TOBN(0xdc80f924, 0x4fd554c2), - TOBN(0x6c4b3415, 0x6ac77407), TOBN(0xa1e5ea8f, 0x25420681), - TOBN(0x541bfa14, 0x4607a458), TOBN(0x5dbc7e7a, 0x96d7fbf9), - TOBN(0x646a851b, 0x31590a47), TOBN(0x039e85ba, 0x15ee6df8), - TOBN(0xd19fa231, 0xd7b43fc0), TOBN(0x84bc8be8, 0x299a0e04), - TOBN(0x2b9d2936, 0xf20df03a), TOBN(0x24054382, 0x8608d472), - TOBN(0x76b6ba04, 0x9149202a), TOBN(0xb21c3831, 0x3670e7b7), - TOBN(0xddd93059, 0xd6fdee10), TOBN(0x9da47ad3, 0x78488e71), - TOBN(0x99cc1dfd, 0xa0fcfb25), TOBN(0x42abde10, 0x64696954), - TOBN(0x14cc15fc, 0x17eab9fe), TOBN(0xd6e863e4, 0xd3e70972), - TOBN(0x29a7765c, 0x6432112c), TOBN(0x88660001, 0x5b0774d8), - TOBN(0x3729175a, 0x2c088eae), TOBN(0x13afbcae, 0x8230b8d4), - TOBN(0x44768151, 0x915f4379), TOBN(0xf086431a, 0xd8d22812), - TOBN(0x37461955, 0xc298b974), TOBN(0x905fb5f0, 0xf8711e04), - TOBN(0x787abf3a, 0xfe969d18), TOBN(0x392167c2, 0x6f6a494e), - TOBN(0xfc7a0d2d, 0x28c511da), TOBN(0xf127c7dc, 0xb66a262d), - TOBN(0xf9c4bb95, 0xfd63fdf0), TOBN(0x90016589, 0x3913ef46), - TOBN(0x74d2a73c, 0x11aa600d), TOBN(0x2f5379bd, 0x9fb5ab52), - TOBN(0xe49e53a4, 0x7fb70068), TOBN(0x68dd39e5, 0x404aa9a7), - TOBN(0xb9b0cf57, 0x2ecaa9c3), TOBN(0xba0e103b, 0xe824826b), - TOBN(0x60c2198b, 0x4631a3c4), TOBN(0xc5ff84ab, 0xfa8966a2), - TOBN(0x2d6ebe22, 0xac95aff8), TOBN(0x1c9bb6db, 0xb5a46d09), - TOBN(0x419062da, 0x53ee4f8d), TOBN(0x7b9042d0, 0xbb97efef), - TOBN(0x0f87f080, 0x830cf6bd), TOBN(0x4861d19a, 0x6ec8a6c6), - TOBN(0xd3a0daa1, 0x202f01aa), TOBN(0xb0111674, 0xf25afbd5), - TOBN(0x6d00d6cf, 0x1afb20d9), TOBN(0x13695000, 0x40671bc5), - TOBN(0x913ab0dc, 0x2485ea9b), TOBN(0x1f2bed06, 0x9eef61ac), - TOBN(0x850c8217, 0x6d799e20), TOBN(0x93415f37, 0x3271c2de), - TOBN(0x5afb06e9, 0x6c4f5910), TOBN(0x688a52df, 0xc4e9e421), - TOBN(0x30495ba3, 0xe2a9a6db), TOBN(0x4601303d, 0x58f9268b), - TOBN(0xbe3b0dad, 0x7eb0f04f), TOBN(0x4ea47250, 0x4456936d), - TOBN(0x8caf8798, 0xd33fd3e7), TOBN(0x1ccd8a89, 0xeb433708), - TOBN(0x9effe3e8, 0x87fd50ad), TOBN(0xbe240a56, 0x6b29c4df), - TOBN(0xec4ffd98, 0xca0e7ebd), TOBN(0xf586783a, 0xe748616e), - TOBN(0xa5b00d8f, 0xc77baa99), TOBN(0x0acada29, 0xb4f34c9c), - TOBN(0x36dad67d, 0x0fe723ac), TOBN(0x1d8e53a5, 0x39c36c1e), - TOBN(0xe4dd342d, 0x1f4bea41), TOBN(0x64fd5e35, 0xebc9e4e0), - TOBN(0x96f01f90, 0x57908805), TOBN(0xb5b9ea3d, 0x5ed480dd), - TOBN(0x366c5dc2, 0x3efd2dd0), TOBN(0xed2fe305, 0x6e9dfa27), - TOBN(0x4575e892, 0x6e9197e2), TOBN(0x11719c09, 0xab502a5d), - TOBN(0x264c7bec, 0xe81f213f), TOBN(0x741b9241, 0x55f5c457), - TOBN(0x78ac7b68, 0x49a5f4f4), TOBN(0xf91d70a2, 0x9fc45b7d), - TOBN(0x39b05544, 0xb0f5f355), TOBN(0x11f06bce, 0xeef930d9), - TOBN(0xdb84d25d, 0x038d05e1), TOBN(0x04838ee5, 0xbacc1d51), - TOBN(0x9da3ce86, 0x9e8ee00b), TOBN(0xc3412057, 0xc36eda1f), - TOBN(0xae80b913, 0x64d9c2f4), TOBN(0x7468bac3, 0xa010a8ff), - TOBN(0xdfd20037, 0x37359d41), TOBN(0x1a0f5ab8, 0x15efeacc), - TOBN(0x7c25ad2f, 0x659d0ce0), TOBN(0x4011bcbb, 0x6785cff1), - TOBN(0x128b9912, 0x7e2192c7), TOBN(0xa549d8e1, 0x13ccb0e8), - TOBN(0x805588d8, 0xc85438b1), TOBN(0x5680332d, 0xbc25cb27), - TOBN(0xdcd1bc96, 0x1a4bfdf4), TOBN(0x779ff428, 0x706f6566), - TOBN(0x8bbee998, 0xf059987a), TOBN(0xf6ce8cf2, 0xcc686de7), - TOBN(0xf8ad3c4a, 0x953cfdb2), TOBN(0xd1d426d9, 0x2205da36), - TOBN(0xb3c0f13f, 0xc781a241), TOBN(0x3e89360e, 0xd75362a8), - TOBN(0xccd05863, 0xc8a91184), TOBN(0x9bd0c9b7, 0xefa8a7f4), - TOBN(0x97ee4d53, 0x8a912a4b), TOBN(0xde5e15f8, 0xbcf518fd), - TOBN(0x6a055bf8, 0xc467e1e0), TOBN(0x10be4b4b, 0x1587e256), - TOBN(0xd90c14f2, 0x668621c9), TOBN(0xd5518f51, 0xab9c92c1), - TOBN(0x8e6a0100, 0xd6d47b3c), TOBN(0xcbe980dd, 0x66716175), - TOBN(0x500d3f10, 0xddd83683), TOBN(0x3b6cb35d, 0x99cac73c), - TOBN(0x53730c8b, 0x6083d550), TOBN(0xcf159767, 0xdf0a1987), - TOBN(0x84bfcf53, 0x43ad73b3), TOBN(0x1b528c20, 0x4f035a94), - TOBN(0x4294edf7, 0x33eeac69), TOBN(0xb6283e83, 0x817f3240), - TOBN(0xc3fdc959, 0x0a5f25b1), TOBN(0xefaf8aa5, 0x5844ee22), - TOBN(0xde269ba5, 0xdbdde4de), TOBN(0xe3347160, 0xc56133bf), - TOBN(0xc1184219, 0x8d9ea9f8), TOBN(0x090de5db, 0xf3fc1ab5), - TOBN(0x404c37b1, 0x0bf22cda), TOBN(0x7de20ec8, 0xf5618894), - TOBN(0x754c588e, 0xecdaecab), TOBN(0x6ca4b0ed, 0x88342743), - TOBN(0x76f08bdd, 0xf4a938ec), TOBN(0xd182de89, 0x91493ccb), - TOBN(0xd652c53e, 0xc8a4186a), TOBN(0xb3e878db, 0x946d8e33), - TOBN(0x088453c0, 0x5f37663c), TOBN(0x5cd9daaa, 0xb407748b), - TOBN(0xa1f5197f, 0x586d5e72), TOBN(0x47500be8, 0xc443ca59), - TOBN(0x78ef35b2, 0xe2652424), TOBN(0x09c5d26f, 0x6dd7767d), - TOBN(0x7175a79a, 0xa74d3f7b), TOBN(0x0428fd8d, 0xcf5ea459), - TOBN(0x511cb97c, 0xa5d1746d), TOBN(0x36363939, 0xe71d1278), - TOBN(0xcf2df955, 0x10350bf4), TOBN(0xb3817439, 0x60aae782), - TOBN(0xa748c0e4, 0x3e688809), TOBN(0x98021fbf, 0xd7a5a006), - TOBN(0x9076a70c, 0x0e367a98), TOBN(0xbea1bc15, 0x0f62b7c2), - TOBN(0x2645a68c, 0x30fe0343), TOBN(0xacaffa78, 0x699dc14f), - TOBN(0xf4469964, 0x457bf9c4), TOBN(0x0db6407b, 0x0d2ead83), - TOBN(0x68d56cad, 0xb2c6f3eb), TOBN(0x3b512e73, 0xf376356c), - TOBN(0xe43b0e1f, 0xfce10408), TOBN(0x89ddc003, 0x5a5e257d), - TOBN(0xb0ae0d12, 0x0362e5b3), TOBN(0x07f983c7, 0xb0519161), - TOBN(0xc2e94d15, 0x5d5231e7), TOBN(0xcff22aed, 0x0b4f9513), - TOBN(0xb02588dd, 0x6ad0b0b5), TOBN(0xb967d1ac, 0x11d0dcd5), - TOBN(0x8dac6bc6, 0xcf777b6c), TOBN(0x0062bdbd, 0x4c6d1959), - TOBN(0x53da71b5, 0x0ef5cc85), TOBN(0x07012c7d, 0x4006f14f), - TOBN(0x4617f962, 0xac47800d), TOBN(0x53365f2b, 0xc102ed75), - TOBN(0xb422efcb, 0x4ab8c9d3), TOBN(0x195cb26b, 0x34af31c9), - TOBN(0x3a926e29, 0x05f2c4ce), TOBN(0xbd2bdecb, 0x9856966c), - TOBN(0x5d16ab3a, 0x85527015), TOBN(0x9f81609e, 0x4486c231), - TOBN(0xd8b96b2c, 0xda350002), TOBN(0xbd054690, 0xfa1b7d36), - TOBN(0xdc90ebf5, 0xe71d79bc), TOBN(0xf241b6f9, 0x08964e4e), - TOBN(0x7c838643, 0x2fe3cd4c), TOBN(0xe0f33acb, 0xb4bc633c), - TOBN(0xb4a9ecec, 0x3d139f1f), TOBN(0x05ce69cd, 0xdc4a1f49), - TOBN(0xa19d1b16, 0xf5f98aaf), TOBN(0x45bb71d6, 0x6f23e0ef), - TOBN(0x33789fcd, 0x46cdfdd3), TOBN(0x9b8e2978, 0xcee040ca), - TOBN(0x9c69b246, 0xae0a6828), TOBN(0xba533d24, 0x7078d5aa), - TOBN(0x7a2e42c0, 0x7bb4fbdb), TOBN(0xcfb4879a, 0x7035385c), - TOBN(0x8c3dd30b, 0x3281705b), TOBN(0x7e361c6c, 0x404fe081), - TOBN(0x7b21649c, 0x3f604edf), TOBN(0x5dbf6a3f, 0xe52ffe47), - TOBN(0xc41b7c23, 0x4b54d9bf), TOBN(0x1374e681, 0x3511c3d9), - TOBN(0x1863bf16, 0xc1b2b758), TOBN(0x90e78507, 0x1e9e6a96), - TOBN(0xab4bf98d, 0x5d86f174), TOBN(0xd74e0bd3, 0x85e96fe4), - TOBN(0x8afde39f, 0xcac5d344), TOBN(0x90946dbc, 0xbd91b847), - TOBN(0xf5b42358, 0xfe1a838c), TOBN(0x05aae6c5, 0x620ac9d8), - TOBN(0x8e193bd8, 0xa1ce5a0b), TOBN(0x8f710571, 0x4dabfd72), - TOBN(0x8d8fdd48, 0x182caaac), TOBN(0x8c4aeefa, 0x040745cf), - TOBN(0x73c6c30a, 0xf3b93e6d), TOBN(0x991241f3, 0x16f42011), - TOBN(0xa0158eea, 0xe457a477), TOBN(0xd19857db, 0xee6ddc05), - TOBN(0xb3265224, 0x18c41671), TOBN(0x3ffdfc7e, 0x3c2c0d58), - TOBN(0x3a3a5254, 0x26ee7cda), TOBN(0x341b0869, 0xdf02c3a8), - TOBN(0xa023bf42, 0x723bbfc8), TOBN(0x3d15002a, 0x14452691)}, - {TOBN(0x5ef7324c, 0x85edfa30), TOBN(0x25976554, 0x87d4f3da), - TOBN(0x352f5bc0, 0xdcb50c86), TOBN(0x8f6927b0, 0x4832a96c), - TOBN(0xd08ee1ba, 0x55f2f94c), TOBN(0x6a996f99, 0x344b45fa), - TOBN(0xe133cb8d, 0xa8aa455d), TOBN(0x5d0721ec, 0x758dc1f7), - TOBN(0x6ba7a920, 0x79e5fb67), TOBN(0xe1331feb, 0x70aa725e), - TOBN(0x5080ccf5, 0x7df5d837), TOBN(0xe4cae01d, 0x7ff72e21), - TOBN(0xd9243ee6, 0x0412a77d), TOBN(0x06ff7cac, 0xdf449025), - TOBN(0xbe75f7cd, 0x23ef5a31), TOBN(0xbc957822, 0x0ddef7a8), - TOBN(0x8cf7230c, 0xb0ce1c55), TOBN(0x5b534d05, 0x0bbfb607), - TOBN(0xee1ef113, 0x0e16363b), TOBN(0x27e0aa7a, 0xb4999e82), - TOBN(0xce1dac2d, 0x79362c41), TOBN(0x67920c90, 0x91bb6cb0), - TOBN(0x1e648d63, 0x2223df24), TOBN(0x0f7d9eef, 0xe32e8f28), - TOBN(0x6943f39a, 0xfa833834), TOBN(0x22951722, 0xa6328562), - TOBN(0x81d63dd5, 0x4170fc10), TOBN(0x9f5fa58f, 0xaecc2e6d), - TOBN(0xb66c8725, 0xe77d9a3b), TOBN(0x11235cea, 0x6384ebe0), - TOBN(0x06a8c118, 0x5845e24a), TOBN(0x0137b286, 0xebd093b1), - TOBN(0xc589e1ce, 0x44ace150), TOBN(0xe0f8d3d9, 0x4381e97c), - TOBN(0x59e99b11, 0x62c5a4b8), TOBN(0x90d262f7, 0xfd0ec9f9), - TOBN(0xfbc854c9, 0x283e13c9), TOBN(0x2d04fde7, 0xaedc7085), - TOBN(0x057d7765, 0x47dcbecb), TOBN(0x8dbdf591, 0x9a76fa5f), - TOBN(0xd0150695, 0x0de1e578), TOBN(0x2e1463e7, 0xe9f72bc6), - TOBN(0xffa68441, 0x1b39eca5), TOBN(0x673c8530, 0x7c037f2f), - TOBN(0xd0d6a600, 0x747f91da), TOBN(0xb08d43e1, 0xc9cb78e9), - TOBN(0x0fc0c644, 0x27b5cef5), TOBN(0x5c1d160a, 0xa60a2fd6), - TOBN(0xf98cae53, 0x28c8e13b), TOBN(0x375f10c4, 0xb2eddcd1), - TOBN(0xd4eb8b7f, 0x5cce06ad), TOBN(0xb4669f45, 0x80a2e1ef), - TOBN(0xd593f9d0, 0x5bbd8699), TOBN(0x5528a4c9, 0xe7976d13), - TOBN(0x3923e095, 0x1c7e28d3), TOBN(0xb9293790, 0x3f6bb577), - TOBN(0xdb567d6a, 0xc42bd6d2), TOBN(0x6df86468, 0xbb1f96ae), - TOBN(0x0efe5b1a, 0x4843b28e), TOBN(0x961bbb05, 0x6379b240), - TOBN(0xb6caf5f0, 0x70a6a26b), TOBN(0x70686c0d, 0x328e6e39), - TOBN(0x80da06cf, 0x895fc8d3), TOBN(0x804d8810, 0xb363fdc9), - TOBN(0xbe22877b, 0x207f1670), TOBN(0x9b0dd188, 0x4e615291), - TOBN(0x625ae8dc, 0x97a3c2bf), TOBN(0x08584ef7, 0x439b86e8), - TOBN(0xde7190a5, 0xdcd898ff), TOBN(0x26286c40, 0x2058ee3d), - TOBN(0x3db0b217, 0x5f87b1c1), TOBN(0xcc334771, 0x102a6db5), - TOBN(0xd99de954, 0x2f770fb1), TOBN(0x97c1c620, 0x4cd7535e), - TOBN(0xd3b6c448, 0x3f09cefc), TOBN(0xd725af15, 0x5a63b4f8), - TOBN(0x0c95d24f, 0xc01e20ec), TOBN(0xdfd37494, 0x9ae7121f), - TOBN(0x7d6ddb72, 0xec77b7ec), TOBN(0xfe079d3b, 0x0353a4ae), - TOBN(0x3066e70a, 0x2e6ac8d2), TOBN(0x9c6b5a43, 0x106e5c05), - TOBN(0x52d3c6f5, 0xede59b8c), TOBN(0x30d6a5c3, 0xfccec9ae), - TOBN(0xedec7c22, 0x4fc0a9ef), TOBN(0x190ff083, 0x95c16ced), - TOBN(0xbe12ec8f, 0x94de0fde), TOBN(0x0d131ab8, 0x852d3433), - TOBN(0x42ace07e, 0x85701291), TOBN(0x94793ed9, 0x194061a8), - TOBN(0x30e83ed6, 0xd7f4a485), TOBN(0x9eec7269, 0xf9eeff4d), - TOBN(0x90acba59, 0x0c9d8005), TOBN(0x5feca458, 0x1e79b9d1), - TOBN(0x8fbe5427, 0x1d506a1e), TOBN(0xa32b2c8e, 0x2439cfa7), - TOBN(0x1671c173, 0x73dd0b4e), TOBN(0x37a28214, 0x44a054c6), - TOBN(0x81760a1b, 0x4e8b53f1), TOBN(0xa6c04224, 0xf9f93b9e), - TOBN(0x18784b34, 0xcf671e3c), TOBN(0x81bbecd2, 0xcda9b994), - TOBN(0x38831979, 0xb2ab3848), TOBN(0xef54feb7, 0xf2e03c2d), - TOBN(0xcf197ca7, 0xfb8088fa), TOBN(0x01427247, 0x4ddc96c5), - TOBN(0xa2d2550a, 0x30777176), TOBN(0x53469898, 0x4d0cf71d), - TOBN(0x6ce937b8, 0x3a2aaac6), TOBN(0xe9f91dc3, 0x5af38d9b), - TOBN(0x2598ad83, 0xc8bf2899), TOBN(0x8e706ac9, 0xb5536c16), - TOBN(0x40dc7495, 0xf688dc98), TOBN(0x26490cd7, 0x124c4afc), - TOBN(0xe651ec84, 0x1f18775c), TOBN(0x393ea6c3, 0xb4fdaf4a), - TOBN(0x1e1f3343, 0x7f338e0d), TOBN(0x39fb832b, 0x6053e7b5), - TOBN(0x46e702da, 0x619e14d5), TOBN(0x859cacd1, 0xcdeef6e0), - TOBN(0x63b99ce7, 0x4462007d), TOBN(0xb8ab48a5, 0x4cb5f5b7), - TOBN(0x9ec673d2, 0xf55edde7), TOBN(0xd1567f74, 0x8cfaefda), - TOBN(0x46381b6b, 0x0887bcec), TOBN(0x694497ce, 0xe178f3c2), - TOBN(0x5e6525e3, 0x1e6266cb), TOBN(0x5931de26, 0x697d6413), - TOBN(0x87f8df7c, 0x0e58d493), TOBN(0xb1ae5ed0, 0x58b73f12), - TOBN(0xc368f784, 0xdea0c34d), TOBN(0x9bd0a120, 0x859a91a0), - TOBN(0xb00d88b7, 0xcc863c68), TOBN(0x3a1cc11e, 0x3d1f4d65), - TOBN(0xea38e0e7, 0x0aa85593), TOBN(0x37f13e98, 0x7dc4aee8), - TOBN(0x10d38667, 0xbc947bad), TOBN(0x738e07ce, 0x2a36ee2e), - TOBN(0xc93470cd, 0xc577fcac), TOBN(0xdee1b616, 0x2782470d), - TOBN(0x36a25e67, 0x2e793d12), TOBN(0xd6aa6cae, 0xe0f186da), - TOBN(0x474d0fd9, 0x80e07af7), TOBN(0xf7cdc47d, 0xba8a5cd4), - TOBN(0x28af6d9d, 0xab15247f), TOBN(0x7c789c10, 0x493a537f), - TOBN(0x7ac9b110, 0x23a334e7), TOBN(0x0236ac09, 0x12c9c277), - TOBN(0xa7e5bd25, 0x1d7a5144), TOBN(0x098b9c2a, 0xf13ec4ec), - TOBN(0x3639daca, 0xd3f0abca), TOBN(0x642da81a, 0xa23960f9), - TOBN(0x7d2e5c05, 0x4f7269b1), TOBN(0xfcf30777, 0xe287c385), - TOBN(0x10edc84f, 0xf2a46f21), TOBN(0x35441757, 0x4f43fa36), - TOBN(0xf1327899, 0xfd703431), TOBN(0xa438d7a6, 0x16dd587a), - TOBN(0x65c34c57, 0xe9c8352d), TOBN(0xa728edab, 0x5cc5a24e), - TOBN(0xaed78abc, 0x42531689), TOBN(0x0a51a0e8, 0x010963ef), - TOBN(0x5776fa0a, 0xd717d9b3), TOBN(0xf356c239, 0x7dd3428b), - TOBN(0x29903fff, 0x8d3a3dac), TOBN(0x409597fa, 0x3d94491f), - TOBN(0x4cd7a5ff, 0xbf4a56a4), TOBN(0xe5096474, 0x8adab462), - TOBN(0xa97b5126, 0x5c3427b0), TOBN(0x6401405c, 0xd282c9bd), - TOBN(0x3629f8d7, 0x222c5c45), TOBN(0xb1c02c16, 0xe8d50aed), - TOBN(0xbea2ed75, 0xd9635bc9), TOBN(0x226790c7, 0x6e24552f), - TOBN(0x3c33f2a3, 0x65f1d066), TOBN(0x2a43463e, 0x6dfccc2e), - TOBN(0x8cc3453a, 0xdb483761), TOBN(0xe7cc6085, 0x65d5672b), - TOBN(0x277ed6cb, 0xde3efc87), TOBN(0x19f2f368, 0x69234eaf), - TOBN(0x9aaf4317, 0x5c0b800b), TOBN(0x1f1e7c89, 0x8b6da6e2), - TOBN(0x6cfb4715, 0xb94ec75e), TOBN(0xd590dd5f, 0x453118c2), - TOBN(0x14e49da1, 0x1f17a34c), TOBN(0x5420ab39, 0x235a1456), - TOBN(0xb7637241, 0x2f50363b), TOBN(0x7b15d623, 0xc3fabb6e), - TOBN(0xa0ef40b1, 0xe274e49c), TOBN(0x5cf50744, 0x96b1860a), - TOBN(0xd6583fbf, 0x66afe5a4), TOBN(0x44240510, 0xf47e3e9a), - TOBN(0x99254343, 0x11b2d595), TOBN(0xf1367499, 0xeec8df57), - TOBN(0x3cb12c61, 0x3e73dd05), TOBN(0xd248c033, 0x7dac102a), - TOBN(0xcf154f13, 0xa77739f5), TOBN(0xbf4288cb, 0x23d2af42), - TOBN(0xaa64c9b6, 0x32e4a1cf), TOBN(0xee8c07a8, 0xc8a208f3), - TOBN(0xe10d4999, 0x6fe8393f), TOBN(0x0f809a3f, 0xe91f3a32), - TOBN(0x61096d1c, 0x802f63c8), TOBN(0x289e1462, 0x57750d3d), - TOBN(0xed06167e, 0x9889feea), TOBN(0xd5c9c0e2, 0xe0993909), - TOBN(0x46fca0d8, 0x56508ac6), TOBN(0x91826047, 0x4f1b8e83), - TOBN(0x4f2c877a, 0x9a4a2751), TOBN(0x71bd0072, 0xcae6fead), - TOBN(0x38df8dcc, 0x06aa1941), TOBN(0x5a074b4c, 0x63beeaa8), - TOBN(0xd6d65934, 0xc1cec8ed), TOBN(0xa6ecb49e, 0xaabc03bd), - TOBN(0xaade91c2, 0xde8a8415), TOBN(0xcfb0efdf, 0x691136e0), - TOBN(0x11af45ee, 0x23ab3495), TOBN(0xa132df88, 0x0b77463d), - TOBN(0x8923c15c, 0x815d06f4), TOBN(0xc3ceb3f5, 0x0d61a436), - TOBN(0xaf52291d, 0xe88fb1da), TOBN(0xea057974, 0x1da12179), - TOBN(0xb0d7218c, 0xd2fef720), TOBN(0x6c0899c9, 0x8e1d8845), - TOBN(0x98157504, 0x752ddad7), TOBN(0xd60bd74f, 0xa1a68a97), - TOBN(0x7047a3a9, 0xf658fb99), TOBN(0x1f5d86d6, 0x5f8511e4), - TOBN(0xb8a4bc42, 0x4b5a6d88), TOBN(0x69eb2c33, 0x1abefa7d), - TOBN(0x95bf39e8, 0x13c9c510), TOBN(0xf571960a, 0xd48aab43), - TOBN(0x7e8cfbcf, 0x704e23c6), TOBN(0xc71b7d22, 0x28aaa65b), - TOBN(0xa041b2bd, 0x245e3c83), TOBN(0x69b98834, 0xd21854ff), - TOBN(0x89d227a3, 0x963bfeec), TOBN(0x99947aaa, 0xde7da7cb), - TOBN(0x1d9ee9db, 0xee68a9b1), TOBN(0x0a08f003, 0x698ec368), - TOBN(0xe9ea4094, 0x78ef2487), TOBN(0xc8d2d415, 0x02cfec26), - TOBN(0xc52f9a6e, 0xb7dcf328), TOBN(0x0ed489e3, 0x85b6a937), - TOBN(0x9b94986b, 0xbef3366e), TOBN(0x0de59c70, 0xedddddb8), - TOBN(0xffdb748c, 0xeadddbe2), TOBN(0x9b9784bb, 0x8266ea40), - TOBN(0x142b5502, 0x1a93507a), TOBN(0xb4cd1187, 0x8d3c06cf), - TOBN(0xdf70e76a, 0x91ec3f40), TOBN(0x484e81ad, 0x4e7553c2), - TOBN(0x830f87b5, 0x272e9d6e), TOBN(0xea1c93e5, 0xc6ff514a), - TOBN(0x67cc2adc, 0xc4192a8e), TOBN(0xc77e27e2, 0x42f4535a), - TOBN(0x9cdbab36, 0xd2b713c5), TOBN(0x86274ea0, 0xcf7b0cd3), - TOBN(0x784680f3, 0x09af826b), TOBN(0xbfcc837a, 0x0c72dea3), - TOBN(0xa8bdfe9d, 0xd6529b73), TOBN(0x708aa228, 0x63a88002), - TOBN(0x6c7a9a54, 0xc91d45b9), TOBN(0xdf1a38bb, 0xfd004f56), - TOBN(0x2e8c9a26, 0xb8bad853), TOBN(0x2d52cea3, 0x3723eae7), - TOBN(0x054d6d81, 0x56ca2830), TOBN(0xa3317d14, 0x9a8dc411), - TOBN(0xa08662fe, 0xfd4ddeda), TOBN(0xed2a153a, 0xb55d792b), - TOBN(0x7035c16a, 0xbfc6e944), TOBN(0xb6bc5834, 0x00171cf3), - TOBN(0xe27152b3, 0x83d102b6), TOBN(0xfe695a47, 0x0646b848), - TOBN(0xa5bb09d8, 0x916e6d37), TOBN(0xb4269d64, 0x0d17015e), - TOBN(0x8d8156a1, 0x0a1d2285), TOBN(0xfeef6c51, 0x46d26d72), - TOBN(0x9dac57c8, 0x4c5434a7), TOBN(0x0282e5be, 0x59d39e31), - TOBN(0xedfff181, 0x721c486d), TOBN(0x301baf10, 0xbc58824e), - TOBN(0x8136a6aa, 0x00570031), TOBN(0x55aaf78c, 0x1cddde68), - TOBN(0x26829371, 0x59c63952), TOBN(0x3a3bd274, 0x8bc25baf), - TOBN(0xecdf8657, 0xb7e52dc3), TOBN(0x2dd8c087, 0xfd78e6c8), - TOBN(0x20553274, 0xf5531461), TOBN(0x8b4a1281, 0x5d95499b), - TOBN(0xe2c8763a, 0x1a80f9d2), TOBN(0xd1dbe32b, 0x4ddec758), - TOBN(0xaf12210d, 0x30c34169), TOBN(0xba74a953, 0x78baa533), - TOBN(0x3d133c6e, 0xa438f254), TOBN(0xa431531a, 0x201bef5b), - TOBN(0x15295e22, 0xf669d7ec), TOBN(0xca374f64, 0x357fb515), - TOBN(0x8a8406ff, 0xeaa3fdb3), TOBN(0x106ae448, 0xdf3f2da8), - TOBN(0x8f9b0a90, 0x33c8e9a1), TOBN(0x234645e2, 0x71ad5885), - TOBN(0x3d083224, 0x1c0aed14), TOBN(0xf10a7d3e, 0x7a942d46), - TOBN(0x7c11deee, 0x40d5c9be), TOBN(0xb2bae7ff, 0xba84ed98), - TOBN(0x93e97139, 0xaad58ddd), TOBN(0x3d872796, 0x3f6d1fa3), - TOBN(0x483aca81, 0x8569ff13), TOBN(0x8b89a5fb, 0x9a600f72), - TOBN(0x4cbc27c3, 0xc06f2b86), TOBN(0x22130713, 0x63ad9c0b), - TOBN(0xb5358b1e, 0x48ac2840), TOBN(0x18311294, 0xecba9477), - TOBN(0xda58f990, 0xa6946b43), TOBN(0x3098baf9, 0x9ab41819), - TOBN(0x66c4c158, 0x4198da52), TOBN(0xab4fc17c, 0x146bfd1b), - TOBN(0x2f0a4c3c, 0xbf36a908), TOBN(0x2ae9e34b, 0x58cf7838), - TOBN(0xf411529e, 0x3fa11b1f), TOBN(0x21e43677, 0x974af2b4), - TOBN(0x7c20958e, 0xc230793b), TOBN(0x710ea885, 0x16e840f3), - TOBN(0xfc0b21fc, 0xc5dc67cf), TOBN(0x08d51647, 0x88405718), - TOBN(0xd955c21f, 0xcfe49eb7), TOBN(0x9722a5d5, 0x56dd4a1f), - TOBN(0xc9ef50e2, 0xc861baa5), TOBN(0xc0c21a5d, 0x9505ac3e), - TOBN(0xaf6b9a33, 0x8b7c063f), TOBN(0xc6370339, 0x2f4779c1), - TOBN(0x22df99c7, 0x638167c3), TOBN(0xfe6ffe76, 0x795db30c), - TOBN(0x2b822d33, 0xa4854989), TOBN(0xfef031dd, 0x30563aa5), - TOBN(0x16b09f82, 0xd57c667f), TOBN(0xc70312ce, 0xcc0b76f1), - TOBN(0xbf04a9e6, 0xc9118aec), TOBN(0x82fcb419, 0x3409d133), - TOBN(0x1a8ab385, 0xab45d44d), TOBN(0xfba07222, 0x617b83a3), - TOBN(0xb05f50dd, 0x58e81b52), TOBN(0x1d8db553, 0x21ce5aff), - TOBN(0x3097b8d4, 0xe344a873), TOBN(0x7d8d116d, 0xfe36d53e), - TOBN(0x6db22f58, 0x7875e750), TOBN(0x2dc5e373, 0x43e144ea), - TOBN(0xc05f32e6, 0xe799eb95), TOBN(0xe9e5f4df, 0x6899e6ec), - TOBN(0xbdc3bd68, 0x1fab23d5), TOBN(0xb72b8ab7, 0x73af60e6), - TOBN(0x8db27ae0, 0x2cecc84a), TOBN(0x600016d8, 0x7bdb871c), - TOBN(0x42a44b13, 0xd7c46f58), TOBN(0xb8919727, 0xc3a77d39), - TOBN(0xcfc6bbbd, 0xdafd6088), TOBN(0x1a740146, 0x6bd20d39), - TOBN(0x8c747abd, 0x98c41072), TOBN(0x4c91e765, 0xbdf68ea1), - TOBN(0x7c95e5ca, 0x08819a78), TOBN(0xcf48b729, 0xc9587921), - TOBN(0x091c7c5f, 0xdebbcc7d), TOBN(0x6f287404, 0xf0e05149), - TOBN(0xf83b5ac2, 0x26cd44ec), TOBN(0x88ae32a6, 0xcfea250e), - TOBN(0x6ac5047a, 0x1d06ebc5), TOBN(0xc7e550b4, 0xd434f781), - TOBN(0x61ab1cf2, 0x5c727bd2), TOBN(0x2e4badb1, 0x1cf915b0), - TOBN(0x1b4dadec, 0xf69d3920), TOBN(0xe61b1ca6, 0xf14c1dfe), - TOBN(0x90b479cc, 0xbd6bd51f), TOBN(0x8024e401, 0x8045ec30), - TOBN(0xcab29ca3, 0x25ef0e62), TOBN(0x4f2e9416, 0x49e4ebc0), - TOBN(0x45eb40ec, 0x0ccced58), TOBN(0x25cd4b9c, 0x0da44f98), - TOBN(0x43e06458, 0x871812c6), TOBN(0x99f80d55, 0x16cef651), - TOBN(0x571340c9, 0xce6dc153), TOBN(0x138d5117, 0xd8665521), - TOBN(0xacdb45bc, 0x4e07014d), TOBN(0x2f34bb38, 0x84b60b91), - TOBN(0xf44a4fd2, 0x2ae8921e), TOBN(0xb039288e, 0x892ba1e2), - TOBN(0x9da50174, 0xb1c180b2), TOBN(0x6b70ab66, 0x1693dc87), - TOBN(0x7e9babc9, 0xe7057481), TOBN(0x4581ddef, 0x9c80dc41), - TOBN(0x0c890da9, 0x51294682), TOBN(0x0b5629d3, 0x3f4736e5), - TOBN(0x2340c79e, 0xb06f5b41), TOBN(0xa42e84ce, 0x4e243469), - TOBN(0xf9a20135, 0x045a71a9), TOBN(0xefbfb415, 0xd27b6fb6), - TOBN(0x25ebea23, 0x9d33cd6f), TOBN(0x9caedb88, 0xaa6c0af8), - TOBN(0x53dc7e9a, 0xd9ce6f96), TOBN(0x3897f9fd, 0x51e0b15a), - TOBN(0xf51cb1f8, 0x8e5d788e), TOBN(0x1aec7ba8, 0xe1d490ee), - TOBN(0x265991e0, 0xcc58cb3c), TOBN(0x9f306e8c, 0x9fc3ad31), - TOBN(0x5fed006e, 0x5040a0ac), TOBN(0xca9d5043, 0xfb476f2e), - TOBN(0xa19c06e8, 0xbeea7a23), TOBN(0xd2865801, 0x0edabb63), - TOBN(0xdb92293f, 0x6967469a), TOBN(0x2894d839, 0x8d8a8ed8), - TOBN(0x87c9e406, 0xbbc77122), TOBN(0x8671c6f1, 0x2ea3a26a), - TOBN(0xe42df8d6, 0xd7de9853), TOBN(0x2e3ce346, 0xb1f2bcc7), - TOBN(0xda601dfc, 0x899d50cf), TOBN(0xbfc913de, 0xfb1b598f), - TOBN(0x81c4909f, 0xe61f7908), TOBN(0x192e304f, 0x9bbc7b29), - TOBN(0xc3ed8738, 0xc104b338), TOBN(0xedbe9e47, 0x783f5d61), - TOBN(0x0c06e9be, 0x2db30660), TOBN(0xda3e613f, 0xc0eb7d8e), - TOBN(0xd8fa3e97, 0x322e096e), TOBN(0xfebd91e8, 0xd336e247), - TOBN(0x8f13ccc4, 0xdf655a49), TOBN(0xa9e00dfc, 0x5eb20210), - TOBN(0x84631d0f, 0xc656b6ea), TOBN(0x93a058cd, 0xd8c0d947), - TOBN(0x6846904a, 0x67bd3448), TOBN(0x4a3d4e1a, 0xf394fd5c), - TOBN(0xc102c1a5, 0xdb225f52), TOBN(0xe3455bba, 0xfc4f5e9a), - TOBN(0x6b36985b, 0x4b9ad1ce), TOBN(0xa9818536, 0x5bb7f793), - TOBN(0x6c25e1d0, 0x48b1a416), TOBN(0x1381dd53, 0x3c81bee7), - TOBN(0xd2a30d61, 0x7a4a7620), TOBN(0xc8412926, 0x39b8944c), - TOBN(0x3c1c6fbe, 0x7a97c33a), TOBN(0x941e541d, 0x938664e7), - TOBN(0x417499e8, 0x4a34f239), TOBN(0x15fdb83c, 0xb90402d5), - TOBN(0xb75f46bf, 0x433aa832), TOBN(0xb61e15af, 0x63215db1), - TOBN(0xaabe59d4, 0xa127f89a), TOBN(0x5d541e0c, 0x07e816da), - TOBN(0xaaba0659, 0xa618b692), TOBN(0x55327733, 0x17266026), - TOBN(0xaf53a0fc, 0x95f57552), TOBN(0x32947650, 0x6cacb0c9), - TOBN(0x253ff58d, 0xc821be01), TOBN(0xb0309531, 0xa06f1146), - TOBN(0x59bbbdf5, 0x05c2e54d), TOBN(0x158f27ad, 0x26e8dd22), - TOBN(0xcc5b7ffb, 0x397e1e53), TOBN(0xae03f65b, 0x7fc1e50d), - TOBN(0xa9784ebd, 0x9c95f0f9), TOBN(0x5ed9deb2, 0x24640771), - TOBN(0x31244af7, 0x035561c4), TOBN(0x87332f3a, 0x7ee857de), - TOBN(0x09e16e9e, 0x2b9e0d88), TOBN(0x52d910f4, 0x56a06049), - TOBN(0x507ed477, 0xa9592f48), TOBN(0x85cb917b, 0x2365d678), - TOBN(0xf8511c93, 0x4c8998d1), TOBN(0x2186a3f1, 0x730ea58f), - TOBN(0x50189626, 0xb2029db0), TOBN(0x9137a6d9, 0x02ceb75a), - TOBN(0x2fe17f37, 0x748bc82c), TOBN(0x87c2e931, 0x80469f8c), - TOBN(0x850f71cd, 0xbf891aa2), TOBN(0x0ca1b89b, 0x75ec3d8d), - TOBN(0x516c43aa, 0x5e1cd3cd), TOBN(0x89397808, 0x9a887c28), - TOBN(0x0059c699, 0xddea1f9f), TOBN(0x7737d6fa, 0x8e6868f7), - TOBN(0x6d93746a, 0x60f1524b), TOBN(0x36985e55, 0xba052aa7), - TOBN(0x41b1d322, 0xed923ea5), TOBN(0x3429759f, 0x25852a11), - TOBN(0xbeca6ec3, 0x092e9f41), TOBN(0x3a238c66, 0x62256bbd), - TOBN(0xd82958ea, 0x70ad487d), TOBN(0x4ac8aaf9, 0x65610d93), - TOBN(0x3fa101b1, 0x5e4ccab0), TOBN(0x9bf430f2, 0x9de14bfb), - TOBN(0xa10f5cc6, 0x6531899d), TOBN(0x590005fb, 0xea8ce17d), - TOBN(0xc437912f, 0x24544cb6), TOBN(0x9987b71a, 0xd79ac2e3), - TOBN(0x13e3d9dd, 0xc058a212), TOBN(0x00075aac, 0xd2de9606), - TOBN(0x80ab508b, 0x6cac8369), TOBN(0x87842be7, 0xf54f6c89), - TOBN(0xa7ad663d, 0x6bc532a4), TOBN(0x67813de7, 0x78a91bc8), - TOBN(0x5dcb61ce, 0xc3427239), TOBN(0x5f3c7cf0, 0xc56934d9), - TOBN(0xc079e0fb, 0xe3191591), TOBN(0xe40896bd, 0xb01aada7), - TOBN(0x8d466791, 0x0492d25f), TOBN(0x8aeb30c9, 0xe7408276), - TOBN(0xe9437495, 0x9287aacc), TOBN(0x23d4708d, 0x79fe03d4), - TOBN(0x8cda9cf2, 0xd0c05199), TOBN(0x502fbc22, 0xfae78454), - TOBN(0xc0bda9df, 0xf572a182), TOBN(0x5f9b71b8, 0x6158b372), - TOBN(0xe0f33a59, 0x2b82dd07), TOBN(0x76302735, 0x9523032e), - TOBN(0x7fe1a721, 0xc4505a32), TOBN(0x7b6e3e82, 0xf796409f)}, - {TOBN(0xe3417bc0, 0x35d0b34a), TOBN(0x440b386b, 0x8327c0a7), - TOBN(0x8fb7262d, 0xac0362d1), TOBN(0x2c41114c, 0xe0cdf943), - TOBN(0x2ba5cef1, 0xad95a0b1), TOBN(0xc09b37a8, 0x67d54362), - TOBN(0x26d6cdd2, 0x01e486c9), TOBN(0x20477abf, 0x42ff9297), - TOBN(0xa004dcb3, 0x292a9287), TOBN(0xddc15cf6, 0x77b092c7), - TOBN(0x083a8464, 0x806c0605), TOBN(0x4a68df70, 0x3db997b0), - TOBN(0x9c134e45, 0x05bf7dd0), TOBN(0xa4e63d39, 0x8ccf7f8c), - TOBN(0xa6e6517f, 0x41b5f8af), TOBN(0xaa8b9342, 0xad7bc1cc), - TOBN(0x126f35b5, 0x1e706ad9), TOBN(0xb99cebb4, 0xc3a9ebdf), - TOBN(0xa75389af, 0xbf608d90), TOBN(0x76113c4f, 0xc6c89858), - TOBN(0x80de8eb0, 0x97e2b5aa), TOBN(0x7e1022cc, 0x63b91304), - TOBN(0x3bdab605, 0x6ccc066c), TOBN(0x33cbb144, 0xb2edf900), - TOBN(0xc4176471, 0x7af715d2), TOBN(0xe2f7f594, 0xd0134a96), - TOBN(0x2c1873ef, 0xa41ec956), TOBN(0xe4e7b4f6, 0x77821304), - TOBN(0xe5c8ff97, 0x88d5374a), TOBN(0x2b915e63, 0x80823d5b), - TOBN(0xea6bc755, 0xb2ee8fe2), TOBN(0x6657624c, 0xe7112651), - TOBN(0x157af101, 0xdace5aca), TOBN(0xc4fdbcf2, 0x11a6a267), - TOBN(0xdaddf340, 0xc49c8609), TOBN(0x97e49f52, 0xe9604a65), - TOBN(0x9be8e790, 0x937e2ad5), TOBN(0x846e2508, 0x326e17f1), - TOBN(0x3f38007a, 0x0bbbc0dc), TOBN(0xcf03603f, 0xb11e16d6), - TOBN(0xd6f800e0, 0x7442f1d5), TOBN(0x475607d1, 0x66e0e3ab), - TOBN(0x82807f16, 0xb7c64047), TOBN(0x8858e1e3, 0xa749883d), - TOBN(0x5859120b, 0x8231ee10), TOBN(0x1b80e7eb, 0x638a1ece), - TOBN(0xcb72525a, 0xc6aa73a4), TOBN(0xa7cdea3d, 0x844423ac), - TOBN(0x5ed0c007, 0xf8ae7c38), TOBN(0x6db07a5c, 0x3d740192), - TOBN(0xbe5e9c2a, 0x5fe36db3), TOBN(0xd5b9d57a, 0x76e95046), - TOBN(0x54ac32e7, 0x8eba20f2), TOBN(0xef11ca8f, 0x71b9a352), - TOBN(0x305e373e, 0xff98a658), TOBN(0xffe5a100, 0x823eb667), - TOBN(0x57477b11, 0xe51732d2), TOBN(0xdfd6eb28, 0x2538fc0e), - TOBN(0x5c43b0cc, 0x3b39eec5), TOBN(0x6af12778, 0xcb36cc57), - TOBN(0x70b0852d, 0x06c425ae), TOBN(0x6df92f8c, 0x5c221b9b), - TOBN(0x6c8d4f9e, 0xce826d9c), TOBN(0xf59aba7b, 0xb49359c3), - TOBN(0x5c8ed8d5, 0xda64309d), TOBN(0x61a6de56, 0x91b30704), - TOBN(0xd6b52f6a, 0x2f9b5808), TOBN(0x0eee4194, 0x98c958a7), - TOBN(0xcddd9aab, 0x771e4caa), TOBN(0x83965dfd, 0x78bc21be), - TOBN(0x02affce3, 0xb3b504f5), TOBN(0x30847a21, 0x561c8291), - TOBN(0xd2eb2cf1, 0x52bfda05), TOBN(0xe0e4c4e9, 0x6197b98c), - TOBN(0x1d35076c, 0xf8a1726f), TOBN(0x6c06085b, 0x2db11e3d), - TOBN(0x15c0c4d7, 0x4463ba14), TOBN(0x9d292f83, 0x0030238c), - TOBN(0x1311ee8b, 0x3727536d), TOBN(0xfeea86ef, 0xbeaedc1e), - TOBN(0xb9d18cd3, 0x66131e2e), TOBN(0xf31d974f, 0x80fe2682), - TOBN(0xb6e49e0f, 0xe4160289), TOBN(0x7c48ec0b, 0x08e92799), - TOBN(0x818111d8, 0xd1989aa7), TOBN(0xb34fa0aa, 0xebf926f9), - TOBN(0xdb5fe2f5, 0xa245474a), TOBN(0xf80a6ebb, 0x3c7ca756), - TOBN(0xa7f96054, 0xafa05dd8), TOBN(0x26dfcf21, 0xfcaf119e), - TOBN(0xe20ef2e3, 0x0564bb59), TOBN(0xef4dca50, 0x61cb02b8), - TOBN(0xcda7838a, 0x65d30672), TOBN(0x8b08d534, 0xfd657e86), - TOBN(0x4c5b4395, 0x46d595c8), TOBN(0x39b58725, 0x425cb836), - TOBN(0x8ea61059, 0x3de9abe3), TOBN(0x40434881, 0x9cdc03be), - TOBN(0x9b261245, 0xcfedce8c), TOBN(0x78c318b4, 0xcf5234a1), - TOBN(0x510bcf16, 0xfde24c99), TOBN(0x2a77cb75, 0xa2c2ff5d), - TOBN(0x9c895c2b, 0x27960fb4), TOBN(0xd30ce975, 0xb0eda42b), - TOBN(0xfda85393, 0x1a62cc26), TOBN(0x23c69b96, 0x50c0e052), - TOBN(0xa227df15, 0xbfc633f3), TOBN(0x2ac78848, 0x1bae7d48), - TOBN(0x487878f9, 0x187d073d), TOBN(0x6c2be919, 0x967f807d), - TOBN(0x765861d8, 0x336e6d8f), TOBN(0x88b8974c, 0xce528a43), - TOBN(0x09521177, 0xff57d051), TOBN(0x2ff38037, 0xfb6a1961), - TOBN(0xfc0aba74, 0xa3d76ad4), TOBN(0x7c764803, 0x25a7ec17), - TOBN(0x7532d75f, 0x48879bc8), TOBN(0xea7eacc0, 0x58ce6bc1), - TOBN(0xc82176b4, 0x8e896c16), TOBN(0x9a30e0b2, 0x2c750fed), - TOBN(0xc37e2c2e, 0x421d3aa4), TOBN(0xf926407c, 0xe84fa840), - TOBN(0x18abc03d, 0x1454e41c), TOBN(0x26605ecd, 0x3f7af644), - TOBN(0x242341a6, 0xd6a5eabf), TOBN(0x1edb84f4, 0x216b668e), - TOBN(0xd836edb8, 0x04010102), TOBN(0x5b337ce7, 0x945e1d8c), - TOBN(0xd2075c77, 0xc055dc14), TOBN(0x2a0ffa25, 0x81d89cdf), - TOBN(0x8ce815ea, 0x6ffdcbaf), TOBN(0xa3428878, 0xfb648867), - TOBN(0x277699cf, 0x884655fb), TOBN(0xfa5b5bd6, 0x364d3e41), - TOBN(0x01f680c6, 0x441e1cb7), TOBN(0x3fd61e66, 0xb70a7d67), - TOBN(0x666ba2dc, 0xcc78cf66), TOBN(0xb3018174, 0x6fdbff77), - TOBN(0x8d4dd0db, 0x168d4668), TOBN(0x259455d0, 0x1dab3a2a), - TOBN(0xf58564c5, 0xcde3acec), TOBN(0x77141925, 0x13adb276), - TOBN(0x527d725d, 0x8a303f65), TOBN(0x55deb6c9, 0xe6f38f7b), - TOBN(0xfd5bb657, 0xb1fa70fb), TOBN(0xfa07f50f, 0xd8073a00), - TOBN(0xf72e3aa7, 0xbca02500), TOBN(0xf68f895d, 0x9975740d), - TOBN(0x30112060, 0x5cae2a6a), TOBN(0x01bd7218, 0x02874842), - TOBN(0x3d423891, 0x7ce47bd3), TOBN(0xa66663c1, 0x789544f6), - TOBN(0x864d05d7, 0x3272d838), TOBN(0xe22924f9, 0xfa6295c5), - TOBN(0x8189593f, 0x6c2fda32), TOBN(0x330d7189, 0xb184b544), - TOBN(0x79efa62c, 0xbde1f714), TOBN(0x35771c94, 0xe5cb1a63), - TOBN(0x2f4826b8, 0x641c8332), TOBN(0x00a894fb, 0xc8cee854), - TOBN(0xb4b9a39b, 0x36194d40), TOBN(0xe857a7c5, 0x77612601), - TOBN(0xf4209dd2, 0x4ecf2f58), TOBN(0x82b9e66d, 0x5a033487), - TOBN(0xc1e36934, 0xe4e8b9dd), TOBN(0xd2372c9d, 0xa42377d7), - TOBN(0x51dc94c7, 0x0e3ae43b), TOBN(0x4c57761e, 0x04474f6f), - TOBN(0xdcdacd0a, 0x1058a318), TOBN(0x369cf3f5, 0x78053a9a), - TOBN(0xc6c3de50, 0x31c68de2), TOBN(0x4653a576, 0x3c4b6d9f), - TOBN(0x1688dd5a, 0xaa4e5c97), TOBN(0x5be80aa1, 0xb7ab3c74), - TOBN(0x70cefe7c, 0xbc65c283), TOBN(0x57f95f13, 0x06867091), - TOBN(0xa39114e2, 0x4415503b), TOBN(0xc08ff7c6, 0x4cbb17e9), - TOBN(0x1eff674d, 0xd7dec966), TOBN(0x6d4690af, 0x53376f63), - TOBN(0xff6fe32e, 0xea74237b), TOBN(0xc436d17e, 0xcd57508e), - TOBN(0x15aa28e1, 0xedcc40fe), TOBN(0x0d769c04, 0x581bbb44), - TOBN(0xc240b6de, 0x34eaacda), TOBN(0xd9e116e8, 0x2ba0f1de), - TOBN(0xcbe45ec7, 0x79438e55), TOBN(0x91787c9d, 0x96f752d7), - TOBN(0x897f532b, 0xf129ac2f), TOBN(0xd307b7c8, 0x5a36e22c), - TOBN(0x91940675, 0x749fb8f3), TOBN(0xd14f95d0, 0x157fdb28), - TOBN(0xfe51d029, 0x6ae55043), TOBN(0x8931e98f, 0x44a87de1), - TOBN(0xe57f1cc6, 0x09e4fee2), TOBN(0x0d063b67, 0x4e072d92), - TOBN(0x70a998b9, 0xed0e4316), TOBN(0xe74a736b, 0x306aca46), - TOBN(0xecf0fbf2, 0x4fda97c7), TOBN(0xa40f65cb, 0x3e178d93), - TOBN(0x16253604, 0x16df4285), TOBN(0xb0c9babb, 0xd0c56ae2), - TOBN(0x73032b19, 0xcfc5cfc3), TOBN(0xe497e5c3, 0x09752056), - TOBN(0x12096bb4, 0x164bda96), TOBN(0x1ee42419, 0xa0b74da1), - TOBN(0x8fc36243, 0x403826ba), TOBN(0x0c8f0069, 0xdc09e660), - TOBN(0x8667e981, 0xc27253c9), TOBN(0x05a6aefb, 0x92b36a45), - TOBN(0xa62c4b36, 0x9cb7bb46), TOBN(0x8394f375, 0x11f7027b), - TOBN(0x747bc79c, 0x5f109d0f), TOBN(0xcad88a76, 0x5b8cc60a), - TOBN(0x80c5a66b, 0x58f09e68), TOBN(0xe753d451, 0xf6127eac), - TOBN(0xc44b74a1, 0x5b0ec6f5), TOBN(0x47989fe4, 0x5289b2b8), - TOBN(0x745f8484, 0x58d6fc73), TOBN(0xec362a6f, 0xf61c70ab), - TOBN(0x070c98a7, 0xb3a8ad41), TOBN(0x73a20fc0, 0x7b63db51), - TOBN(0xed2c2173, 0xf44c35f4), TOBN(0x8a56149d, 0x9acc9dca), - TOBN(0x98f17881, 0x9ac6e0f4), TOBN(0x360fdeaf, 0xa413b5ed), - TOBN(0x0625b8f4, 0xa300b0fd), TOBN(0xf1f4d76a, 0x5b3222d3), - TOBN(0x9d6f5109, 0x587f76b8), TOBN(0x8b4ee08d, 0x2317fdb5), - TOBN(0x88089bb7, 0x8c68b095), TOBN(0x95570e9a, 0x5808d9b9), - TOBN(0xa395c36f, 0x35d33ae7), TOBN(0x200ea123, 0x50bb5a94), - TOBN(0x20c789bd, 0x0bafe84b), TOBN(0x243ef52d, 0x0919276a), - TOBN(0x3934c577, 0xe23ae233), TOBN(0xb93807af, 0xa460d1ec), - TOBN(0xb72a53b1, 0xf8fa76a4), TOBN(0xd8914cb0, 0xc3ca4491), - TOBN(0x2e128494, 0x3fb42622), TOBN(0x3b2700ac, 0x500907d5), - TOBN(0xf370fb09, 0x1a95ec63), TOBN(0xf8f30be2, 0x31b6dfbd), - TOBN(0xf2b2f8d2, 0x69e55f15), TOBN(0x1fead851, 0xcc1323e9), - TOBN(0xfa366010, 0xd9e5eef6), TOBN(0x64d487b0, 0xe316107e), - TOBN(0x4c076b86, 0xd23ddc82), TOBN(0x03fd344c, 0x7e0143f0), - TOBN(0xa95362ff, 0x317af2c5), TOBN(0x0add3db7, 0xe18b7a4f), - TOBN(0x9c673e3f, 0x8260e01b), TOBN(0xfbeb49e5, 0x54a1cc91), - TOBN(0x91351bf2, 0x92f2e433), TOBN(0xc755e7ec, 0x851141eb), - TOBN(0xc9a95139, 0x29607745), TOBN(0x0ca07420, 0xa26f2b28), - TOBN(0xcb2790e7, 0x4bc6f9dd), TOBN(0x345bbb58, 0xadcaffc0), - TOBN(0xc65ea38c, 0xbe0f27a2), TOBN(0x67c24d7c, 0x641fcb56), - TOBN(0x2c25f0a7, 0xa9e2c757), TOBN(0x93f5cdb0, 0x16f16c49), - TOBN(0x2ca5a9d7, 0xc5ee30a1), TOBN(0xd1593635, 0xb909b729), - TOBN(0x804ce9f3, 0xdadeff48), TOBN(0xec464751, 0xb07c30c3), - TOBN(0x89d65ff3, 0x9e49af6a), TOBN(0xf2d6238a, 0x6f3d01bc), - TOBN(0x1095561e, 0x0bced843), TOBN(0x51789e12, 0xc8a13fd8), - TOBN(0xd633f929, 0x763231df), TOBN(0x46df9f7d, 0xe7cbddef), - TOBN(0x01c889c0, 0xcb265da8), TOBN(0xfce1ad10, 0xaf4336d2), - TOBN(0x8d110df6, 0xfc6a0a7e), TOBN(0xdd431b98, 0x6da425dc), - TOBN(0xcdc4aeab, 0x1834aabe), TOBN(0x84deb124, 0x8439b7fc), - TOBN(0x8796f169, 0x3c2a5998), TOBN(0x9b9247b4, 0x7947190d), - TOBN(0x55b9d9a5, 0x11597014), TOBN(0x7e9dd70d, 0x7b1566ee), - TOBN(0x94ad78f7, 0xcbcd5e64), TOBN(0x0359ac17, 0x9bd4c032), - TOBN(0x3b11baaf, 0x7cc222ae), TOBN(0xa6a6e284, 0xba78e812), - TOBN(0x8392053f, 0x24cea1a0), TOBN(0xc97bce4a, 0x33621491), - TOBN(0x7eb1db34, 0x35399ee9), TOBN(0x473f78ef, 0xece81ad1), - TOBN(0x41d72fe0, 0xf63d3d0d), TOBN(0xe620b880, 0xafab62fc), - TOBN(0x92096bc9, 0x93158383), TOBN(0x41a21357, 0x8f896f6c), - TOBN(0x1b5ee2fa, 0xc7dcfcab), TOBN(0x650acfde, 0x9546e007), - TOBN(0xc081b749, 0xb1b02e07), TOBN(0xda9e41a0, 0xf9eca03d), - TOBN(0x013ba727, 0x175a54ab), TOBN(0xca0cd190, 0xea5d8d10), - TOBN(0x85ea52c0, 0x95fd96a9), TOBN(0x2c591b9f, 0xbc5c3940), - TOBN(0x6fb4d4e4, 0x2bad4d5f), TOBN(0xfa4c3590, 0xfef0059b), - TOBN(0x6a10218a, 0xf5122294), TOBN(0x9a78a81a, 0xa85751d1), - TOBN(0x04f20579, 0xa98e84e7), TOBN(0xfe1242c0, 0x4997e5b5), - TOBN(0xe77a273b, 0xca21e1e4), TOBN(0xfcc8b1ef, 0x9411939d), - TOBN(0xe20ea302, 0x92d0487a), TOBN(0x1442dbec, 0x294b91fe), - TOBN(0x1f7a4afe, 0xbb6b0e8f), TOBN(0x1700ef74, 0x6889c318), - TOBN(0xf5bbffc3, 0x70f1fc62), TOBN(0x3b31d4b6, 0x69c79cca), - TOBN(0xe8bc2aab, 0xa7f6340d), TOBN(0xb0b08ab4, 0xa725e10a), - TOBN(0x44f05701, 0xae340050), TOBN(0xba4b3016, 0x1cf0c569), - TOBN(0x5aa29f83, 0xfbe19a51), TOBN(0x1b9ed428, 0xb71d752e), - TOBN(0x1666e54e, 0xeb4819f5), TOBN(0x616cdfed, 0x9e18b75b), - TOBN(0x112ed5be, 0x3ee27b0b), TOBN(0xfbf28319, 0x44c7de4d), - TOBN(0xd685ec85, 0xe0e60d84), TOBN(0x68037e30, 0x1db7ee78), - TOBN(0x5b65bdcd, 0x003c4d6e), TOBN(0x33e7363a, 0x93e29a6a), - TOBN(0x995b3a61, 0x08d0756c), TOBN(0xd727f85c, 0x2faf134b), - TOBN(0xfac6edf7, 0x1d337823), TOBN(0x99b9aa50, 0x0439b8b4), - TOBN(0x722eb104, 0xe2b4e075), TOBN(0x49987295, 0x437c4926), - TOBN(0xb1e4c0e4, 0x46a9b82d), TOBN(0xd0cb3197, 0x57a006f5), - TOBN(0xf3de0f7d, 0xd7808c56), TOBN(0xb5c54d8f, 0x51f89772), - TOBN(0x500a114a, 0xadbd31aa), TOBN(0x9afaaaa6, 0x295f6cab), - TOBN(0x94705e21, 0x04cf667a), TOBN(0xfc2a811b, 0x9d3935d7), - TOBN(0x560b0280, 0x6d09267c), TOBN(0xf19ed119, 0xf780e53b), - TOBN(0xf0227c09, 0x067b6269), TOBN(0x967b8533, 0x5caef599), - TOBN(0x155b9243, 0x68efeebc), TOBN(0xcd6d34f5, 0xc497bae6), - TOBN(0x1dd8d5d3, 0x6cceb370), TOBN(0x2aeac579, 0xa78d7bf9), - TOBN(0x5d65017d, 0x70b67a62), TOBN(0x70c8e44f, 0x17c53f67), - TOBN(0xd1fc0950, 0x86a34d09), TOBN(0xe0fca256, 0xe7134907), - TOBN(0xe24fa29c, 0x80fdd315), TOBN(0x2c4acd03, 0xd87499ad), - TOBN(0xbaaf7517, 0x3b5a9ba6), TOBN(0xb9cbe1f6, 0x12e51a51), - TOBN(0xd88edae3, 0x5e154897), TOBN(0xe4309c3c, 0x77b66ca0), - TOBN(0xf5555805, 0xf67f3746), TOBN(0x85fc37ba, 0xa36401ff), - TOBN(0xdf86e2ca, 0xd9499a53), TOBN(0x6270b2a3, 0xecbc955b), - TOBN(0xafae64f5, 0x974ad33b), TOBN(0x04d85977, 0xfe7b2df1), - TOBN(0x2a3db3ff, 0x4ab03f73), TOBN(0x0b87878a, 0x8702740a), - TOBN(0x6d263f01, 0x5a061732), TOBN(0xc25430ce, 0xa32a1901), - TOBN(0xf7ebab3d, 0xdb155018), TOBN(0x3a86f693, 0x63a9b78e), - TOBN(0x349ae368, 0xda9f3804), TOBN(0x470f07fe, 0xa164349c), - TOBN(0xd52f4cc9, 0x8562baa5), TOBN(0xc74a9e86, 0x2b290df3), - TOBN(0xd3a1aa35, 0x43471a24), TOBN(0x239446be, 0xb8194511), - TOBN(0xbec2dd00, 0x81dcd44d), TOBN(0xca3d7f0f, 0xc42ac82d), - TOBN(0x1f3db085, 0xfdaf4520), TOBN(0xbb6d3e80, 0x4549daf2), - TOBN(0xf5969d8a, 0x19ad5c42), TOBN(0x7052b13d, 0xdbfd1511), - TOBN(0x11890d1b, 0x682b9060), TOBN(0xa71d3883, 0xac34452c), - TOBN(0xa438055b, 0x783805b4), TOBN(0x43241277, 0x4725b23e), - TOBN(0xf20cf96e, 0x4901bbed), TOBN(0x6419c710, 0xf432a2bb), - TOBN(0x57a0fbb9, 0xdfa9cd7d), TOBN(0x589111e4, 0x00daa249), - TOBN(0x19809a33, 0x7b60554e), TOBN(0xea5f8887, 0xede283a4), - TOBN(0x2d713802, 0x503bfd35), TOBN(0x151bb0af, 0x585d2a53), - TOBN(0x40b08f74, 0x43b30ca8), TOBN(0xe10b5bba, 0xd9934583), - TOBN(0xe8a546d6, 0xb51110ad), TOBN(0x1dd50e66, 0x28e0b6c5), - TOBN(0x292e9d54, 0xcff2b821), TOBN(0x3882555d, 0x47281760), - TOBN(0x134838f8, 0x3724d6e3), TOBN(0xf2c679e0, 0x22ddcda1), - TOBN(0x40ee8815, 0x6d2a5768), TOBN(0x7f227bd2, 0x1c1e7e2d), - TOBN(0x487ba134, 0xd04ff443), TOBN(0x76e2ff3d, 0xc614e54b), - TOBN(0x36b88d6f, 0xa3177ec7), TOBN(0xbf731d51, 0x2328fff5), - TOBN(0x758caea2, 0x49ba158e), TOBN(0x5ab8ff4c, 0x02938188), - TOBN(0x33e16056, 0x35edc56d), TOBN(0x5a69d349, 0x7e940d79), - TOBN(0x6c4fd001, 0x03866dcb), TOBN(0x20a38f57, 0x4893cdef), - TOBN(0xfbf3e790, 0xfac3a15b), TOBN(0x6ed7ea2e, 0x7a4f8e6b), - TOBN(0xa663eb4f, 0xbc3aca86), TOBN(0x22061ea5, 0x080d53f7), - TOBN(0x2480dfe6, 0xf546783f), TOBN(0xd38bc6da, 0x5a0a641e), - TOBN(0xfb093cd1, 0x2ede8965), TOBN(0x89654db4, 0xacb455cf), - TOBN(0x413cbf9a, 0x26e1adee), TOBN(0x291f3764, 0x373294d4), - TOBN(0x00797257, 0x648083fe), TOBN(0x25f504d3, 0x208cc341), - TOBN(0x635a8e5e, 0xc3a0ee43), TOBN(0x70aaebca, 0x679898ff), - TOBN(0x9ee9f547, 0x5dc63d56), TOBN(0xce987966, 0xffb34d00), - TOBN(0xf9f86b19, 0x5e26310a), TOBN(0x9e435484, 0x382a8ca8), - TOBN(0x253bcb81, 0xc2352fe4), TOBN(0xa4eac8b0, 0x4474b571), - TOBN(0xc1b97512, 0xc1ad8cf8), TOBN(0x193b4e9e, 0x99e0b697), - TOBN(0x939d2716, 0x01e85df0), TOBN(0x4fb265b3, 0xcd44eafd), - TOBN(0x321e7dcd, 0xe51e1ae2), TOBN(0x8e3a8ca6, 0xe3d8b096), - TOBN(0x8de46cb0, 0x52604998), TOBN(0x91099ad8, 0x39072aa7), - TOBN(0x2617f91c, 0x93aa96b8), TOBN(0x0fc8716b, 0x7fca2e13), - TOBN(0xa7106f5e, 0x95328723), TOBN(0xd1c9c40b, 0x262e6522), - TOBN(0xb9bafe86, 0x42b7c094), TOBN(0x1873439d, 0x1543c021), - TOBN(0xe1baa5de, 0x5cbefd5d), TOBN(0xa363fc5e, 0x521e8aff), - TOBN(0xefe6320d, 0xf862eaac), TOBN(0x14419c63, 0x22c647dc), - TOBN(0x0e06707c, 0x4e46d428), TOBN(0xcb6c834f, 0x4a178f8f), - TOBN(0x0f993a45, 0xd30f917c), TOBN(0xd4c4b049, 0x9879afee), - TOBN(0xb6142a1e, 0x70500063), TOBN(0x7c9b41c3, 0xa5d9d605), - TOBN(0xbc00fc2f, 0x2f8ba2c7), TOBN(0x0966eb2f, 0x7c67aa28), - TOBN(0x13f7b516, 0x5a786972), TOBN(0x3bfb7557, 0x8a2fbba0), - TOBN(0x131c4f23, 0x5a2b9620), TOBN(0xbff3ed27, 0x6faf46be), - TOBN(0x9b4473d1, 0x7e172323), TOBN(0x421e8878, 0x339f6246), - TOBN(0x0fa8587a, 0x25a41632), TOBN(0xc0814124, 0xa35b6c93), - TOBN(0x2b18a9f5, 0x59ebb8db), TOBN(0x264e3357, 0x76edb29c), - TOBN(0xaf245ccd, 0xc87c51e2), TOBN(0x16b3015b, 0x501e6214), - TOBN(0xbb31c560, 0x0a3882ce), TOBN(0x6961bb94, 0xfec11e04), - TOBN(0x3b825b8d, 0xeff7a3a0), TOBN(0xbec33738, 0xb1df7326), - TOBN(0x68ad747c, 0x99604a1f), TOBN(0xd154c934, 0x9a3bd499), - TOBN(0xac33506f, 0x1cc7a906), TOBN(0x73bb5392, 0x6c560e8f), - TOBN(0x6428fcbe, 0x263e3944), TOBN(0xc11828d5, 0x1c387434), - TOBN(0x3cd04be1, 0x3e4b12ff), TOBN(0xc3aad9f9, 0x2d88667c), - TOBN(0xc52ddcf8, 0x248120cf), TOBN(0x985a892e, 0x2a389532), - TOBN(0xfbb4b21b, 0x3bb85fa0), TOBN(0xf95375e0, 0x8dfc6269), - TOBN(0xfb4fb06c, 0x7ee2acea), TOBN(0x6785426e, 0x309c4d1f), - TOBN(0x659b17c8, 0xd8ceb147), TOBN(0x9b649eee, 0xb70a5554), - TOBN(0x6b7fa0b5, 0xac6bc634), TOBN(0xd99fe2c7, 0x1d6e732f), - TOBN(0x30e6e762, 0x8d3abba2), TOBN(0x18fee6e7, 0xa797b799), - TOBN(0x5c9d360d, 0xc696464d), TOBN(0xe3baeb48, 0x27bfde12), - TOBN(0x2bf5db47, 0xf23206d5), TOBN(0x2f6d3420, 0x1d260152), - TOBN(0x17b87653, 0x3f8ff89a), TOBN(0x5157c30c, 0x378fa458), - TOBN(0x7517c5c5, 0x2d4fb936), TOBN(0xef22f7ac, 0xe6518cdc), - TOBN(0xdeb483e6, 0xbf847a64), TOBN(0xf5084558, 0x92e0fa89)}, - {TOBN(0xab9659d8, 0xdf7304d4), TOBN(0xb71bcf1b, 0xff210e8e), - TOBN(0xa9a2438b, 0xd73fbd60), TOBN(0x4595cd1f, 0x5d11b4de), - TOBN(0x9c0d329a, 0x4835859d), TOBN(0x4a0f0d2d, 0x7dbb6e56), - TOBN(0xc6038e5e, 0xdf928a4e), TOBN(0xc9429621, 0x8f5ad154), - TOBN(0x91213462, 0xf23f2d92), TOBN(0x6cab71bd, 0x60b94078), - TOBN(0x6bdd0a63, 0x176cde20), TOBN(0x54c9b20c, 0xee4d54bc), - TOBN(0x3cd2d8aa, 0x9f2ac02f), TOBN(0x03f8e617, 0x206eedb0), - TOBN(0xc7f68e16, 0x93086434), TOBN(0x831469c5, 0x92dd3db9), - TOBN(0x8521df24, 0x8f981354), TOBN(0x587e23ec, 0x3588a259), - TOBN(0xcbedf281, 0xd7a0992c), TOBN(0x06930a55, 0x38961407), - TOBN(0x09320deb, 0xbe5bbe21), TOBN(0xa7ffa5b5, 0x2491817f), - TOBN(0xe6c8b4d9, 0x09065160), TOBN(0xac4f3992, 0xfff6d2a9), - TOBN(0x7aa7a158, 0x3ae9c1bd), TOBN(0xe0af6d98, 0xe37ce240), - TOBN(0xe54342d9, 0x28ab38b4), TOBN(0xe8b75007, 0x0a1c98ca), - TOBN(0xefce86af, 0xe02358f2), TOBN(0x31b8b856, 0xea921228), - TOBN(0x052a1912, 0x0a1c67fc), TOBN(0xb4069ea4, 0xe3aead59), - TOBN(0x3232d6e2, 0x7fa03cb3), TOBN(0xdb938e5b, 0x0fdd7d88), - TOBN(0x04c1d2cd, 0x2ccbfc5d), TOBN(0xd2f45c12, 0xaf3a580f), - TOBN(0x592620b5, 0x7883e614), TOBN(0x5fd27e68, 0xbe7c5f26), - TOBN(0x139e45a9, 0x1567e1e3), TOBN(0x2cc71d2d, 0x44d8aaaf), - TOBN(0x4a9090cd, 0xe36d0757), TOBN(0xf722d7b1, 0xd9a29382), - TOBN(0xfb7fb04c, 0x04b48ddf), TOBN(0x628ad2a7, 0xebe16f43), - TOBN(0xcd3fbfb5, 0x20226040), TOBN(0x6c34ecb1, 0x5104b6c4), - TOBN(0x30c0754e, 0xc903c188), TOBN(0xec336b08, 0x2d23cab0), - TOBN(0x473d62a2, 0x1e206ee5), TOBN(0xf1e27480, 0x8c49a633), - TOBN(0x87ab956c, 0xe9f6b2c3), TOBN(0x61830b48, 0x62b606ea), - TOBN(0x67cd6846, 0xe78e815f), TOBN(0xfe40139f, 0x4c02082a), - TOBN(0x52bbbfcb, 0x952ec365), TOBN(0x74c11642, 0x6b9836ab), - TOBN(0x9f51439e, 0x558df019), TOBN(0x230da4ba, 0xac712b27), - TOBN(0x518919e3, 0x55185a24), TOBN(0x4dcefcdd, 0x84b78f50), - TOBN(0xa7d90fb2, 0xa47d4c5a), TOBN(0x55ac9abf, 0xb30e009e), - TOBN(0xfd2fc359, 0x74eed273), TOBN(0xb72d824c, 0xdbea8faf), - TOBN(0xce721a74, 0x4513e2ca), TOBN(0x0b418612, 0x38240b2c), - TOBN(0x05199968, 0xd5baa450), TOBN(0xeb1757ed, 0x2b0e8c25), - TOBN(0x6ebc3e28, 0x3dfac6d5), TOBN(0xb2431e2e, 0x48a237f5), - TOBN(0x2acb5e23, 0x52f61499), TOBN(0x5558a2a7, 0xe06c936b), - TOBN(0xd213f923, 0xcbb13d1b), TOBN(0x98799f42, 0x5bfb9bfe), - TOBN(0x1ae8ddc9, 0x701144a9), TOBN(0x0b8b3bb6, 0x4c5595ee), - TOBN(0x0ea9ef2e, 0x3ecebb21), TOBN(0x17cb6c4b, 0x3671f9a7), - TOBN(0x47ef464f, 0x726f1d1f), TOBN(0x171b9484, 0x6943a276), - TOBN(0x51a4ae2d, 0x7ef0329c), TOBN(0x08509222, 0x91c4402a), - TOBN(0x64a61d35, 0xafd45bbc), TOBN(0x38f096fe, 0x3035a851), - TOBN(0xc7468b74, 0xa1dec027), TOBN(0xe8cf10e7, 0x4fc7dcba), - TOBN(0xea35ff40, 0xf4a06353), TOBN(0x0b4c0dfa, 0x8b77dd66), - TOBN(0x779b8552, 0xde7e5c19), TOBN(0xfab28609, 0xc1c0256c), - TOBN(0x64f58eee, 0xabd4743d), TOBN(0x4e8ef838, 0x7b6cc93b), - TOBN(0xee650d26, 0x4cb1bf3d), TOBN(0x4c1f9d09, 0x73dedf61), - TOBN(0xaef7c9d7, 0xbfb70ced), TOBN(0x1ec0507e, 0x1641de1e), - TOBN(0xcd7e5cc7, 0xcde45079), TOBN(0xde173c9a, 0x516ac9e4), - TOBN(0x517a8494, 0xc170315c), TOBN(0x438fd905, 0x91d8e8fb), - TOBN(0x5145c506, 0xc7d9630b), TOBN(0x6457a87b, 0xf47d4d75), - TOBN(0xd31646bf, 0x0d9a80e8), TOBN(0x453add2b, 0xcef3aabe), - TOBN(0xc9941109, 0xa607419d), TOBN(0xfaa71e62, 0xbb6bca80), - TOBN(0x34158c13, 0x07c431f3), TOBN(0x594abebc, 0x992bc47a), - TOBN(0x6dfea691, 0xeb78399f), TOBN(0x48aafb35, 0x3f42cba4), - TOBN(0xedcd65af, 0x077c04f0), TOBN(0x1a29a366, 0xe884491a), - TOBN(0x023a40e5, 0x1c21f2bf), TOBN(0xf99a513c, 0xa5057aee), - TOBN(0xa3fe7e25, 0xbcab072e), TOBN(0x8568d2e1, 0x40e32bcf), - TOBN(0x904594eb, 0xd3f69d9f), TOBN(0x181a9733, 0x07affab1), - TOBN(0xe4d68d76, 0xb6e330f4), TOBN(0x87a6dafb, 0xc75a7fc1), - TOBN(0x549db2b5, 0xef7d9289), TOBN(0x2480d4a8, 0x197f015a), - TOBN(0x61d5590b, 0xc40493b6), TOBN(0x3a55b52e, 0x6f780331), - TOBN(0x40eb8115, 0x309eadb0), TOBN(0xdea7de5a, 0x92e5c625), - TOBN(0x64d631f0, 0xcc6a3d5a), TOBN(0x9d5e9d7c, 0x93e8dd61), - TOBN(0xf297bef5, 0x206d3ffc), TOBN(0x23d5e033, 0x7d808bd4), - TOBN(0x4a4f6912, 0xd24cf5ba), TOBN(0xe4d8163b, 0x09cdaa8a), - TOBN(0x0e0de9ef, 0xd3082e8e), TOBN(0x4fe1246c, 0x0192f360), - TOBN(0x1f900150, 0x4b8eee0a), TOBN(0x5219da81, 0xf1da391b), - TOBN(0x7bf6a5c1, 0xf7ea25aa), TOBN(0xd165e6bf, 0xfbb07d5f), - TOBN(0xe3539361, 0x89e78671), TOBN(0xa3fcac89, 0x2bac4219), - TOBN(0xdfab6fd4, 0xf0baa8ab), TOBN(0x5a4adac1, 0xe2c1c2e5), - TOBN(0x6cd75e31, 0x40d85849), TOBN(0xce263fea, 0x19b39181), - TOBN(0xcb6803d3, 0x07032c72), TOBN(0x7f40d5ce, 0x790968c8), - TOBN(0xa6de86bd, 0xdce978f0), TOBN(0x25547c4f, 0x368f751c), - TOBN(0xb1e685fd, 0x65fb2a9e), TOBN(0xce69336f, 0x1eb9179c), - TOBN(0xb15d1c27, 0x12504442), TOBN(0xb7df465c, 0xb911a06b), - TOBN(0xb8d804a3, 0x315980cd), TOBN(0x693bc492, 0xfa3bebf7), - TOBN(0x3578aeee, 0x2253c504), TOBN(0x158de498, 0xcd2474a2), - TOBN(0x1331f5c7, 0xcfda8368), TOBN(0xd2d7bbb3, 0x78d7177e), - TOBN(0xdf61133a, 0xf3c1e46e), TOBN(0x5836ce7d, 0xd30e7be8), - TOBN(0x83084f19, 0x94f834cb), TOBN(0xd35653d4, 0x429ed782), - TOBN(0xa542f16f, 0x59e58243), TOBN(0xc2b52f65, 0x0470a22d), - TOBN(0xe3b6221b, 0x18f23d96), TOBN(0xcb05abac, 0x3f5252b4), - TOBN(0xca00938b, 0x87d61402), TOBN(0x2f186cdd, 0x411933e4), - TOBN(0xe042ece5, 0x9a29a5c5), TOBN(0xb19b3c07, 0x3b6c8402), - TOBN(0xc97667c7, 0x19d92684), TOBN(0xb5624622, 0xebc66372), - TOBN(0x0cb96e65, 0x3c04fa02), TOBN(0x83a7176c, 0x8eaa39aa), - TOBN(0x2033561d, 0xeaa1633f), TOBN(0x45a9d086, 0x4533df73), - TOBN(0xe0542c1d, 0x3dc090bc), TOBN(0x82c996ef, 0xaa59c167), - TOBN(0xe3f735e8, 0x0ee7fc4d), TOBN(0x7b179393, 0x7c35db79), - TOBN(0xb6419e25, 0xf8c5dbfd), TOBN(0x4d9d7a1e, 0x1f327b04), - TOBN(0x979f6f9b, 0x298dfca8), TOBN(0xc7c5dff1, 0x8de9366a), - TOBN(0x1b7a588d, 0x04c82bdd), TOBN(0x68005534, 0xf8319dfd), - TOBN(0xde8a55b5, 0xd8eb9580), TOBN(0x5ea886da, 0x8d5bca81), - TOBN(0xe8530a01, 0x252a0b4d), TOBN(0x1bffb4fe, 0x35eaa0a1), - TOBN(0x2ad828b1, 0xd8e99563), TOBN(0x7de96ef5, 0x95f9cd87), - TOBN(0x4abb2d0c, 0xd77d970c), TOBN(0x03cfb933, 0xd33ef9cb), - TOBN(0xb0547c01, 0x8b211fe9), TOBN(0x2fe64809, 0xa56ed1c6), - TOBN(0xcb7d5624, 0xc2ac98cc), TOBN(0x2a1372c0, 0x1a393e33), - TOBN(0xc8d1ec1c, 0x29660521), TOBN(0xf3d31b04, 0xb37ac3e9), - TOBN(0xa29ae9df, 0x5ece6e7c), TOBN(0x0603ac8f, 0x0facfb55), - TOBN(0xcfe85b7a, 0xdda233a5), TOBN(0xe618919f, 0xbd75f0b8), - TOBN(0xf555a3d2, 0x99bf1603), TOBN(0x1f43afc9, 0xf184255a), - TOBN(0xdcdaf341, 0x319a3e02), TOBN(0xd3b117ef, 0x03903a39), - TOBN(0xe095da13, 0x65d1d131), TOBN(0x86f16367, 0xc37ad03e), - TOBN(0x5f37389e, 0x462cd8dd), TOBN(0xc103fa04, 0xd67a60e6), - TOBN(0x57c34344, 0xf4b478f0), TOBN(0xce91edd8, 0xe117c98d), - TOBN(0x001777b0, 0x231fc12e), TOBN(0x11ae47f2, 0xb207bccb), - TOBN(0xd983cf8d, 0x20f8a242), TOBN(0x7aff5b1d, 0xf22e1ad8), - TOBN(0x68fd11d0, 0x7fc4feb3), TOBN(0x5d53ae90, 0xb0f1c3e1), - TOBN(0x50fb7905, 0xec041803), TOBN(0x85e3c977, 0x14404888), - TOBN(0x0e67faed, 0xac628d8f), TOBN(0x2e865150, 0x6668532c), - TOBN(0x15acaaa4, 0x6a67a6b0), TOBN(0xf4cdee25, 0xb25cec41), - TOBN(0x49ee565a, 0xe4c6701e), TOBN(0x2a04ca66, 0xfc7d63d8), - TOBN(0xeb105018, 0xef0543fb), TOBN(0xf709a4f5, 0xd1b0d81d), - TOBN(0x5b906ee6, 0x2915d333), TOBN(0xf4a87412, 0x96f1f0ab), - TOBN(0xb6b82fa7, 0x4d82f4c2), TOBN(0x90725a60, 0x6804efb3), - TOBN(0xbc82ec46, 0xadc3425e), TOBN(0xb7b80581, 0x2787843e), - TOBN(0xdf46d91c, 0xdd1fc74c), TOBN(0xdc1c62cb, 0xe783a6c4), - TOBN(0x59d1b9f3, 0x1a04cbba), TOBN(0xd87f6f72, 0x95e40764), - TOBN(0x02b4cfc1, 0x317f4a76), TOBN(0x8d2703eb, 0x91036bce), - TOBN(0x98206cc6, 0xa5e72a56), TOBN(0x57be9ed1, 0xcf53fb0f), - TOBN(0x09374571, 0xef0b17ac), TOBN(0x74b2655e, 0xd9181b38), - TOBN(0xc8f80ea8, 0x89935d0e), TOBN(0xc0d9e942, 0x91529936), - TOBN(0x19686041, 0x1e84e0e5), TOBN(0xa5db84d3, 0xaea34c93), - TOBN(0xf9d5bb19, 0x7073a732), TOBN(0xb8d2fe56, 0x6bcfd7c0), - TOBN(0x45775f36, 0xf3eb82fa), TOBN(0x8cb20ccc, 0xfdff8b58), - TOBN(0x1659b65f, 0x8374c110), TOBN(0xb8b4a422, 0x330c789a), - TOBN(0x75e3c3ea, 0x6fe8208b), TOBN(0xbd74b9e4, 0x286e78fe), - TOBN(0x0be2e81b, 0xd7d93a1a), TOBN(0x7ed06e27, 0xdd0a5aae), - TOBN(0x721f5a58, 0x6be8b800), TOBN(0x428299d1, 0xd846db28), - TOBN(0x95cb8e6b, 0x5be88ed3), TOBN(0xc3186b23, 0x1c034e11), - TOBN(0xa6312c9e, 0x8977d99b), TOBN(0xbe944331, 0x83f531e7), - TOBN(0x8232c0c2, 0x18d3b1d4), TOBN(0x617aae8b, 0xe1247b73), - TOBN(0x40153fc4, 0x282aec3b), TOBN(0xc6063d2f, 0xf7b8f823), - TOBN(0x68f10e58, 0x3304f94c), TOBN(0x31efae74, 0xee676346), - TOBN(0xbadb6c6d, 0x40a9b97c), TOBN(0x14702c63, 0x4f666256), - TOBN(0xdeb954f1, 0x5184b2e3), TOBN(0x5184a526, 0x94b6ca40), - TOBN(0xfff05337, 0x003c32ea), TOBN(0x5aa374dd, 0x205974c7), - TOBN(0x9a763854, 0x4b0dd71a), TOBN(0x459cd27f, 0xdeb947ec), - TOBN(0xa6e28161, 0x459c2b92), TOBN(0x2f020fa8, 0x75ee8ef5), - TOBN(0xb132ec2d, 0x30b06310), TOBN(0xc3e15899, 0xbc6a4530), - TOBN(0xdc5f53fe, 0xaa3f451a), TOBN(0x3a3c7f23, 0xc2d9acac), - TOBN(0x2ec2f892, 0x6b27e58b), TOBN(0x68466ee7, 0xd742799f), - TOBN(0x98324dd4, 0x1fa26613), TOBN(0xa2dc6dab, 0xbdc29d63), - TOBN(0xf9675faa, 0xd712d657), TOBN(0x813994be, 0x21fd8d15), - TOBN(0x5ccbb722, 0xfd4f7553), TOBN(0x5135ff8b, 0xf3a36b20), - TOBN(0x44be28af, 0x69559df5), TOBN(0x40b65bed, 0x9d41bf30), - TOBN(0xd98bf2a4, 0x3734e520), TOBN(0x5e3abbe3, 0x209bdcba), - TOBN(0x77c76553, 0xbc945b35), TOBN(0x5331c093, 0xc6ef14aa), - TOBN(0x518ffe29, 0x76b60c80), TOBN(0x2285593b, 0x7ace16f8), - TOBN(0xab1f64cc, 0xbe2b9784), TOBN(0xe8f2c0d9, 0xab2421b6), - TOBN(0x617d7174, 0xc1df065c), TOBN(0xafeeb5ab, 0x5f6578fa), - TOBN(0x16ff1329, 0x263b54a8), TOBN(0x45c55808, 0xc990dce3), - TOBN(0x42eab6c0, 0xecc8c177), TOBN(0x799ea9b5, 0x5982ecaa), - TOBN(0xf65da244, 0xb607ef8e), TOBN(0x8ab226ce, 0x32a3fc2c), - TOBN(0x745741e5, 0x7ea973dc), TOBN(0x5c00ca70, 0x20888f2e), - TOBN(0x7cdce3cf, 0x45fd9cf1), TOBN(0x8a741ef1, 0x5507f872), - TOBN(0x47c51c2f, 0x196b4cec), TOBN(0x70d08e43, 0xc97ea618), - TOBN(0x930da15c, 0x15b18a2b), TOBN(0x33b6c678, 0x2f610514), - TOBN(0xc662e4f8, 0x07ac9794), TOBN(0x1eccf050, 0xba06cb79), - TOBN(0x1ff08623, 0xe7d954e5), TOBN(0x6ef2c5fb, 0x24cf71c3), - TOBN(0xb2c063d2, 0x67978453), TOBN(0xa0cf3796, 0x1d654af8), - TOBN(0x7cb242ea, 0x7ebdaa37), TOBN(0x206e0b10, 0xb86747e0), - TOBN(0x481dae5f, 0xd5ecfefc), TOBN(0x07084fd8, 0xc2bff8fc), - TOBN(0x8040a01a, 0xea324596), TOBN(0x4c646980, 0xd4de4036), - TOBN(0x9eb8ab4e, 0xd65abfc3), TOBN(0xe01cb91f, 0x13541ec7), - TOBN(0x8f029adb, 0xfd695012), TOBN(0x9ae28483, 0x3c7569ec), - TOBN(0xa5614c9e, 0xa66d80a1), TOBN(0x680a3e44, 0x75f5f911), - TOBN(0x0c07b14d, 0xceba4fc1), TOBN(0x891c285b, 0xa13071c1), - TOBN(0xcac67ceb, 0x799ece3c), TOBN(0x29b910a9, 0x41e07e27), - TOBN(0x66bdb409, 0xf2e43123), TOBN(0x06f8b137, 0x7ac9ecbe), - TOBN(0x5981fafd, 0x38547090), TOBN(0x19ab8b9f, 0x85e3415d), - TOBN(0xfc28c194, 0xc7e31b27), TOBN(0x843be0aa, 0x6fbcbb42), - TOBN(0xf3b1ed43, 0xa6db836c), TOBN(0x2a1330e4, 0x01a45c05), - TOBN(0x4f19f3c5, 0x95c1a377), TOBN(0xa85f39d0, 0x44b5ee33), - TOBN(0x3da18e6d, 0x4ae52834), TOBN(0x5a403b39, 0x7423dcb0), - TOBN(0xbb555e0a, 0xf2374aef), TOBN(0x2ad599c4, 0x1e8ca111), - TOBN(0x1b3a2fb9, 0x014b3bf8), TOBN(0x73092684, 0xf66d5007), - TOBN(0x079f1426, 0xc4340102), TOBN(0x1827cf81, 0x8fddf4de), - TOBN(0xc83605f6, 0xf10ff927), TOBN(0xd3871451, 0x23739fc6), - TOBN(0x6d163450, 0xcac1c2cc), TOBN(0x6b521296, 0xa2ec1ac5), - TOBN(0x0606c4f9, 0x6e3cb4a5), TOBN(0xe47d3f41, 0x778abff7), - TOBN(0x425a8d5e, 0xbe8e3a45), TOBN(0x53ea9e97, 0xa6102160), - TOBN(0x477a106e, 0x39cbb688), TOBN(0x532401d2, 0xf3386d32), - TOBN(0x8e564f64, 0xb1b9b421), TOBN(0xca9b8388, 0x81dad33f), - TOBN(0xb1422b4e, 0x2093913e), TOBN(0x533d2f92, 0x69bc8112), - TOBN(0x3fa017be, 0xebe7b2c7), TOBN(0xb2767c4a, 0xcaf197c6), - TOBN(0xc925ff87, 0xaedbae9f), TOBN(0x7daf0eb9, 0x36880a54), - TOBN(0x9284ddf5, 0x9c4d0e71), TOBN(0x1581cf93, 0x316f8cf5), - TOBN(0x3eeca887, 0x3ac1f452), TOBN(0xb417fce9, 0xfb6aeffe), - TOBN(0xa5918046, 0xeefb8dc3), TOBN(0x73d318ac, 0x02209400), - TOBN(0xe800400f, 0x728693e5), TOBN(0xe87d814b, 0x339927ed), - TOBN(0x93e94d3b, 0x57ea9910), TOBN(0xff8a35b6, 0x2245fb69), - TOBN(0x043853d7, 0x7f200d34), TOBN(0x470f1e68, 0x0f653ce1), - TOBN(0x81ac05bd, 0x59a06379), TOBN(0xa14052c2, 0x03930c29), - TOBN(0x6b72fab5, 0x26bc2797), TOBN(0x13670d16, 0x99f16771), - TOBN(0x00170052, 0x1e3e48d1), TOBN(0x978fe401, 0xb7adf678), - TOBN(0x55ecfb92, 0xd41c5dd4), TOBN(0x5ff8e247, 0xc7b27da5), - TOBN(0xe7518272, 0x013fb606), TOBN(0x5768d7e5, 0x2f547a3c), - TOBN(0xbb24eaa3, 0x60017a5f), TOBN(0x6b18e6e4, 0x9c64ce9b), - TOBN(0xc225c655, 0x103dde07), TOBN(0xfc3672ae, 0x7592f7ea), - TOBN(0x9606ad77, 0xd06283a1), TOBN(0x542fc650, 0xe4d59d99), - TOBN(0xabb57c49, 0x2a40e7c2), TOBN(0xac948f13, 0xa8db9f55), - TOBN(0x6d4c9682, 0xb04465c3), TOBN(0xe3d062fa, 0x6468bd15), - TOBN(0xa51729ac, 0x5f318d7e), TOBN(0x1fc87df6, 0x9eb6fc95), - TOBN(0x63d146a8, 0x0591f652), TOBN(0xa861b8f7, 0x589621aa), - TOBN(0x59f5f15a, 0xce31348c), TOBN(0x8f663391, 0x440da6da), - TOBN(0xcfa778ac, 0xb591ffa3), TOBN(0x027ca9c5, 0x4cdfebce), - TOBN(0xbe8e05a5, 0x444ea6b3), TOBN(0x8aab4e69, 0xa78d8254), - TOBN(0x2437f04f, 0xb474d6b8), TOBN(0x6597ffd4, 0x045b3855), - TOBN(0xbb0aea4e, 0xca47ecaa), TOBN(0x568aae83, 0x85c7ebfc), - TOBN(0x0e966e64, 0xc73b2383), TOBN(0x49eb3447, 0xd17d8762), - TOBN(0xde107821, 0x8da05dab), TOBN(0x443d8baa, 0x016b7236), - TOBN(0x163b63a5, 0xea7610d6), TOBN(0xe47e4185, 0xce1ca979), - TOBN(0xae648b65, 0x80baa132), TOBN(0xebf53de2, 0x0e0d5b64), - TOBN(0x8d3bfcb4, 0xd3c8c1ca), TOBN(0x0d914ef3, 0x5d04b309), - TOBN(0x55ef6415, 0x3de7d395), TOBN(0xbde1666f, 0x26b850e8), - TOBN(0xdbe1ca6e, 0xd449ab19), TOBN(0x8902b322, 0xe89a2672), - TOBN(0xb1674b7e, 0xdacb7a53), TOBN(0x8e9faf6e, 0xf52523ff), - TOBN(0x6ba535da, 0x9a85788b), TOBN(0xd21f03ae, 0xbd0626d4), - TOBN(0x099f8c47, 0xe873dc64), TOBN(0xcda8564d, 0x018ec97e), - TOBN(0x3e8d7a5c, 0xde92c68c), TOBN(0x78e035a1, 0x73323cc4), - TOBN(0x3ef26275, 0xf880ff7c), TOBN(0xa4ee3dff, 0x273eedaa), - TOBN(0x58823507, 0xaf4e18f8), TOBN(0x967ec9b5, 0x0672f328), - TOBN(0x9ded19d9, 0x559d3186), TOBN(0x5e2ab3de, 0x6cdce39c), - TOBN(0xabad6e4d, 0x11c226df), TOBN(0xf9783f43, 0x87723014), - TOBN(0x9a49a0cf, 0x1a885719), TOBN(0xfc0c1a5a, 0x90da9dbf), - TOBN(0x8bbaec49, 0x571d92ac), TOBN(0x569e85fe, 0x4692517f), - TOBN(0x8333b014, 0xa14ea4af), TOBN(0x32f2a62f, 0x12e5c5ad), - TOBN(0x98c2ce3a, 0x06d89b85), TOBN(0xb90741aa, 0x2ff77a08), - TOBN(0x2530defc, 0x01f795a2), TOBN(0xd6e5ba0b, 0x84b3c199), - TOBN(0x7d8e8451, 0x12e4c936), TOBN(0xae419f7d, 0xbd0be17b), - TOBN(0xa583fc8c, 0x22262bc9), TOBN(0x6b842ac7, 0x91bfe2bd), - TOBN(0x33cef4e9, 0x440d6827), TOBN(0x5f69f4de, 0xef81fb14), - TOBN(0xf16cf6f6, 0x234fbb92), TOBN(0x76ae3fc3, 0xd9e7e158), - TOBN(0x4e89f6c2, 0xe9740b33), TOBN(0x677bc85d, 0x4962d6a1), - TOBN(0x6c6d8a7f, 0x68d10d15), TOBN(0x5f9a7224, 0x0257b1cd), - TOBN(0x7096b916, 0x4ad85961), TOBN(0x5f8c47f7, 0xe657ab4a), - TOBN(0xde57d7d0, 0xf7461d7e), TOBN(0x7eb6094d, 0x80ce5ee2), - TOBN(0x0b1e1dfd, 0x34190547), TOBN(0x8a394f43, 0xf05dd150), - TOBN(0x0a9eb24d, 0x97df44e6), TOBN(0x78ca06bf, 0x87675719), - TOBN(0x6f0b3462, 0x6ffeec22), TOBN(0x9d91bcea, 0x36cdd8fb), - TOBN(0xac83363c, 0xa105be47), TOBN(0x81ba76c1, 0x069710e3), - TOBN(0x3d1b24cb, 0x28c682c6), TOBN(0x27f25228, 0x8612575b), - TOBN(0xb587c779, 0xe8e66e98), TOBN(0x7b0c03e9, 0x405eb1fe), - TOBN(0xfdf0d030, 0x15b548e7), TOBN(0xa8be76e0, 0x38b36af7), - TOBN(0x4cdab04a, 0x4f310c40), TOBN(0x6287223e, 0xf47ecaec), - TOBN(0x678e6055, 0x8b399320), TOBN(0x61fe3fa6, 0xc01e4646), - TOBN(0xc482866b, 0x03261a5e), TOBN(0xdfcf45b8, 0x5c2f244a), - TOBN(0x8fab9a51, 0x2f684b43), TOBN(0xf796c654, 0xc7220a66), - TOBN(0x1d90707e, 0xf5afa58f), TOBN(0x2c421d97, 0x4fdbe0de), - TOBN(0xc4f4cda3, 0xaf2ebc2f), TOBN(0xa0af843d, 0xcb4efe24), - TOBN(0x53b857c1, 0x9ccd10b1), TOBN(0xddc9d1eb, 0x914d3e04), - TOBN(0x7bdec8bb, 0x62771deb), TOBN(0x829277aa, 0x91c5aa81), - TOBN(0x7af18dd6, 0x832391ae), TOBN(0x1740f316, 0xc71a84ca)}, - {TOBN(0x8928e99a, 0xeeaf8c49), TOBN(0xee7aa73d, 0x6e24d728), - TOBN(0x4c5007c2, 0xe72b156c), TOBN(0x5fcf57c5, 0xed408a1d), - TOBN(0x9f719e39, 0xb6057604), TOBN(0x7d343c01, 0xc2868bbf), - TOBN(0x2cca254b, 0x7e103e2d), TOBN(0xe6eb38a9, 0xf131bea2), - TOBN(0xb33e624f, 0x8be762b4), TOBN(0x2a9ee4d1, 0x058e3413), - TOBN(0x968e6369, 0x67d805fa), TOBN(0x9848949b, 0x7db8bfd7), - TOBN(0x5308d7e5, 0xd23a8417), TOBN(0x892f3b1d, 0xf3e29da5), - TOBN(0xc95c139e, 0x3dee471f), TOBN(0x8631594d, 0xd757e089), - TOBN(0xe0c82a3c, 0xde918dcc), TOBN(0x2e7b5994, 0x26fdcf4b), - TOBN(0x82c50249, 0x32cb1b2d), TOBN(0xea613a9d, 0x7657ae07), - TOBN(0xc2eb5f6c, 0xf1fdc9f7), TOBN(0xb6eae8b8, 0x879fe682), - TOBN(0x253dfee0, 0x591cbc7f), TOBN(0x000da713, 0x3e1290e6), - TOBN(0x1083e2ea, 0x1f095615), TOBN(0x0a28ad77, 0x14e68c33), - TOBN(0x6bfc0252, 0x3d8818be), TOBN(0xb585113a, 0xf35850cd), - TOBN(0x7d935f0b, 0x30df8aa1), TOBN(0xaddda07c, 0x4ab7e3ac), - TOBN(0x92c34299, 0x552f00cb), TOBN(0xc33ed1de, 0x2909df6c), - TOBN(0x22c2195d, 0x80e87766), TOBN(0x9e99e6d8, 0x9ddf4ac0), - TOBN(0x09642e4e, 0x65e74934), TOBN(0x2610ffa2, 0xff1ff241), - TOBN(0x4d1d47d4, 0x751c8159), TOBN(0x697b4985, 0xaf3a9363), - TOBN(0x0318ca46, 0x87477c33), TOBN(0xa90cb565, 0x9441eff3), - TOBN(0x58bb3848, 0x36f024cb), TOBN(0x85be1f77, 0x36016168), - TOBN(0x6c59587c, 0xdc7e07f1), TOBN(0x191be071, 0xaf1d8f02), - TOBN(0xbf169fa5, 0xcca5e55c), TOBN(0x3864ba3c, 0xf7d04eac), - TOBN(0x915e367f, 0x8d7d05db), TOBN(0xb48a876d, 0xa6549e5d), - TOBN(0xef89c656, 0x580e40a2), TOBN(0xf194ed8c, 0x728068bc), - TOBN(0x74528045, 0xa47990c9), TOBN(0xf53fc7d7, 0x5e1a4649), - TOBN(0xbec5ae9b, 0x78593e7d), TOBN(0x2cac4ee3, 0x41db65d7), - TOBN(0xa8c1eb24, 0x04a3d39b), TOBN(0x53b7d634, 0x03f8f3ef), - TOBN(0x2dc40d48, 0x3e07113c), TOBN(0x6e4a5d39, 0x7d8b63ae), - TOBN(0x5582a94b, 0x79684c2b), TOBN(0x932b33d4, 0x622da26c), - TOBN(0xf534f651, 0x0dbbf08d), TOBN(0x211d07c9, 0x64c23a52), - TOBN(0x0eeece0f, 0xee5bdc9b), TOBN(0xdf178168, 0xf7015558), - TOBN(0xd4294635, 0x0a712229), TOBN(0x93cbe448, 0x09273f8c), - TOBN(0x00b095ef, 0x8f13bc83), TOBN(0xbb741972, 0x8798978c), - TOBN(0x9d7309a2, 0x56dbe6e7), TOBN(0xe578ec56, 0x5a5d39ec), - TOBN(0x3961151b, 0x851f9a31), TOBN(0x2da7715d, 0xe5709eb4), - TOBN(0x867f3017, 0x53dfabf0), TOBN(0x728d2078, 0xb8e39259), - TOBN(0x5c75a0cd, 0x815d9958), TOBN(0xf84867a6, 0x16603be1), - TOBN(0xc865b13d, 0x70e35b1c), TOBN(0x02414468, 0x19b03e2c), - TOBN(0xe46041da, 0xac1f3121), TOBN(0x7c9017ad, 0x6f028a7c), - TOBN(0xabc96de9, 0x0a482873), TOBN(0x4265d6b1, 0xb77e54d4), - TOBN(0x68c38e79, 0xa57d88e7), TOBN(0xd461d766, 0x9ce82de3), - TOBN(0x817a9ec5, 0x64a7e489), TOBN(0xcc5675cd, 0xa0def5f2), - TOBN(0x9a00e785, 0x985d494e), TOBN(0xc626833f, 0x1b03514a), - TOBN(0xabe7905a, 0x83cdd60e), TOBN(0x50602fb5, 0xa1170184), - TOBN(0x689886cd, 0xb023642a), TOBN(0xd568d090, 0xa6e1fb00), - TOBN(0x5b1922c7, 0x0259217f), TOBN(0x93831cd9, 0xc43141e4), - TOBN(0xdfca3587, 0x0c95f86e), TOBN(0xdec2057a, 0x568ae828), - TOBN(0xc44ea599, 0xf98a759a), TOBN(0x55a0a7a2, 0xf7c23c1d), - TOBN(0xd5ffb6e6, 0x94c4f687), TOBN(0x3563cce2, 0x12848478), - TOBN(0x812b3517, 0xe7b1fbe1), TOBN(0x8a7dc979, 0x4f7338e0), - TOBN(0x211ecee9, 0x52d048db), TOBN(0x2eea4056, 0xc86ea3b8), - TOBN(0xd8cb68a7, 0xba772b34), TOBN(0xe16ed341, 0x5f4e2541), - TOBN(0x9b32f6a6, 0x0fec14db), TOBN(0xeee376f7, 0x391698be), - TOBN(0xe9a7aa17, 0x83674c02), TOBN(0x65832f97, 0x5843022a), - TOBN(0x29f3a8da, 0x5ba4990f), TOBN(0x79a59c3a, 0xfb8e3216), - TOBN(0x9cdc4d2e, 0xbd19bb16), TOBN(0xc6c7cfd0, 0xb3262d86), - TOBN(0xd4ce14d0, 0x969c0b47), TOBN(0x1fa352b7, 0x13e56128), - TOBN(0x383d55b8, 0x973db6d3), TOBN(0x71836850, 0xe8e5b7bf), - TOBN(0xc7714596, 0xe6bb571f), TOBN(0x259df31f, 0x2d5b2dd2), - TOBN(0x568f8925, 0x913cc16d), TOBN(0x18bc5b6d, 0xe1a26f5a), - TOBN(0xdfa413be, 0xf5f499ae), TOBN(0xf8835dec, 0xc3f0ae84), - TOBN(0xb6e60bd8, 0x65a40ab0), TOBN(0x65596439, 0x194b377e), - TOBN(0xbcd85625, 0x92084a69), TOBN(0x5ce433b9, 0x4f23ede0), - TOBN(0xe8e8f04f, 0x6ad65143), TOBN(0x11511827, 0xd6e14af6), - TOBN(0x3d390a10, 0x8295c0c7), TOBN(0x71e29ee4, 0x621eba16), - TOBN(0xa588fc09, 0x63717b46), TOBN(0x02be02fe, 0xe06ad4a2), - TOBN(0x931558c6, 0x04c22b22), TOBN(0xbb4d4bd6, 0x12f3c849), - TOBN(0x54a4f496, 0x20efd662), TOBN(0x92ba6d20, 0xc5952d14), - TOBN(0x2db8ea1e, 0xcc9784c2), TOBN(0x81cc10ca, 0x4b353644), - TOBN(0x40b570ad, 0x4b4d7f6c), TOBN(0x5c9f1d96, 0x84a1dcd2), - TOBN(0x01379f81, 0x3147e797), TOBN(0xe5c6097b, 0x2bd499f5), - TOBN(0x40dcafa6, 0x328e5e20), TOBN(0xf7b5244a, 0x54815550), - TOBN(0xb9a4f118, 0x47bfc978), TOBN(0x0ea0e79f, 0xd25825b1), - TOBN(0xa50f96eb, 0x646c7ecf), TOBN(0xeb811493, 0x446dea9d), - TOBN(0x2af04677, 0xdfabcf69), TOBN(0xbe3a068f, 0xc713f6e8), - TOBN(0x860d523d, 0x42e06189), TOBN(0xbf077941, 0x4e3aff13), - TOBN(0x0b616dca, 0xc1b20650), TOBN(0xe66dd6d1, 0x2131300d), - TOBN(0xd4a0fd67, 0xff99abde), TOBN(0xc9903550, 0xc7aac50d), - TOBN(0x022ecf8b, 0x7c46b2d7), TOBN(0x3333b1e8, 0x3abf92af), - TOBN(0x11cc113c, 0x6c491c14), TOBN(0x05976688, 0x80dd3f88), - TOBN(0xf5b4d9e7, 0x29d932ed), TOBN(0xe982aad8, 0xa2c38b6d), - TOBN(0x6f925347, 0x8be0dcf0), TOBN(0x700080ae, 0x65ca53f2), - TOBN(0xd8131156, 0x443ca77f), TOBN(0xe92d6942, 0xec51f984), - TOBN(0xd2a08af8, 0x85dfe9ae), TOBN(0xd825d9a5, 0x4d2a86ca), - TOBN(0x2c53988d, 0x39dff020), TOBN(0xf38b135a, 0x430cdc40), - TOBN(0x0c918ae0, 0x62a7150b), TOBN(0xf31fd8de, 0x0c340e9b), - TOBN(0xafa0e7ae, 0x4dbbf02e), TOBN(0x5847fb2a, 0x5eba6239), - TOBN(0x6b1647dc, 0xdccbac8b), TOBN(0xb642aa78, 0x06f485c8), - TOBN(0x873f3765, 0x7038ecdf), TOBN(0x2ce5e865, 0xfa49d3fe), - TOBN(0xea223788, 0xc98c4400), TOBN(0x8104a8cd, 0xf1fa5279), - TOBN(0xbcf7cc7a, 0x06becfd7), TOBN(0x49424316, 0xc8f974ae), - TOBN(0xc0da65e7, 0x84d6365d), TOBN(0xbcb7443f, 0x8f759fb8), - TOBN(0x35c712b1, 0x7ae81930), TOBN(0x80428dff, 0x4c6e08ab), - TOBN(0xf19dafef, 0xa4faf843), TOBN(0xced8538d, 0xffa9855f), - TOBN(0x20ac409c, 0xbe3ac7ce), TOBN(0x358c1fb6, 0x882da71e), - TOBN(0xafa9c0e5, 0xfd349961), TOBN(0x2b2cfa51, 0x8421c2fc), - TOBN(0x2a80db17, 0xf3a28d38), TOBN(0xa8aba539, 0x5d138e7e), - TOBN(0x52012d1d, 0x6e96eb8d), TOBN(0x65d8dea0, 0xcbaf9622), - TOBN(0x57735447, 0xb264f56c), TOBN(0xbeebef3f, 0x1b6c8da2), - TOBN(0xfc346d98, 0xce785254), TOBN(0xd50e8d72, 0xbb64a161), - TOBN(0xc03567c7, 0x49794add), TOBN(0x15a76065, 0x752c7ef6), - TOBN(0x59f3a222, 0x961f23d6), TOBN(0x378e4438, 0x73ecc0b0), - TOBN(0xc74be434, 0x5a82fde4), TOBN(0xae509af2, 0xd8b9cf34), - TOBN(0x4a61ee46, 0x577f44a1), TOBN(0xe09b748c, 0xb611deeb), - TOBN(0xc0481b2c, 0xf5f7b884), TOBN(0x35626678, 0x61acfa6b), - TOBN(0x37f4c518, 0xbf8d21e6), TOBN(0x22d96531, 0xb205a76d), - TOBN(0x37fb85e1, 0x954073c0), TOBN(0xbceafe4f, 0x65b3a567), - TOBN(0xefecdef7, 0xbe42a582), TOBN(0xd3fc6080, 0x65046be6), - TOBN(0xc9af13c8, 0x09e8dba9), TOBN(0x1e6c9847, 0x641491ff), - TOBN(0x3b574925, 0xd30c31f7), TOBN(0xb7eb72ba, 0xac2a2122), - TOBN(0x776a0dac, 0xef0859e7), TOBN(0x06fec314, 0x21900942), - TOBN(0x2464bc10, 0xf8c22049), TOBN(0x9bfbcce7, 0x875ebf69), - TOBN(0xd7a88e2a, 0x4336326b), TOBN(0xda05261c, 0x5bc2acfa), - TOBN(0xc29f5bdc, 0xeba7efc8), TOBN(0x471237ca, 0x25dbbf2e), - TOBN(0xa72773f2, 0x2975f127), TOBN(0xdc744e8e, 0x04d0b326), - TOBN(0x38a7ed16, 0xa56edb73), TOBN(0x64357e37, 0x2c007e70), - TOBN(0xa167d15b, 0x5080b400), TOBN(0x07b41164, 0x23de4be1), - TOBN(0xb2d91e32, 0x74c89883), TOBN(0x3c162821, 0x2882e7ed), - TOBN(0xad6b36ba, 0x7503e482), TOBN(0x48434e8e, 0x0ea34331), - TOBN(0x79f4f24f, 0x2c7ae0b9), TOBN(0xc46fbf81, 0x1939b44a), - TOBN(0x76fefae8, 0x56595eb1), TOBN(0x417b66ab, 0xcd5f29c7), - TOBN(0x5f2332b2, 0xc5ceec20), TOBN(0xd69661ff, 0xe1a1cae2), - TOBN(0x5ede7e52, 0x9b0286e6), TOBN(0x9d062529, 0xe276b993), - TOBN(0x324794b0, 0x7e50122b), TOBN(0xdd744f8b, 0x4af07ca5), - TOBN(0x30a12f08, 0xd63fc97b), TOBN(0x39650f1a, 0x76626d9d), - TOBN(0x101b47f7, 0x1fa38477), TOBN(0x3d815f19, 0xd4dc124f), - TOBN(0x1569ae95, 0xb26eb58a), TOBN(0xc3cde188, 0x95fb1887), - TOBN(0x54e9f37b, 0xf9539a48), TOBN(0xb0100e06, 0x7408c1a5), - TOBN(0x821d9811, 0xea580cbb), TOBN(0x8af52d35, 0x86e50c56), - TOBN(0xdfbd9d47, 0xdbbf698b), TOBN(0x2961a1ea, 0x03dc1c73), - TOBN(0x203d38f8, 0xe76a5df8), TOBN(0x08a53a68, 0x6def707a), - TOBN(0x26eefb48, 0x1bee45d4), TOBN(0xb3cee346, 0x3c688036), - TOBN(0x463c5315, 0xc42f2469), TOBN(0x19d84d2e, 0x81378162), - TOBN(0x22d7c3c5, 0x1c4d349f), TOBN(0x65965844, 0x163d59c5), - TOBN(0xcf198c56, 0xb8abceae), TOBN(0x6fb1fb1b, 0x628559d5), - TOBN(0x8bbffd06, 0x07bf8fe3), TOBN(0x46259c58, 0x3467734b), - TOBN(0xd8953cea, 0x35f7f0d3), TOBN(0x1f0bece2, 0xd65b0ff1), - TOBN(0xf7d5b4b3, 0xf3c72914), TOBN(0x29e8ea95, 0x3cb53389), - TOBN(0x4a365626, 0x836b6d46), TOBN(0xe849f910, 0xea174fde), - TOBN(0x7ec62fbb, 0xf4737f21), TOBN(0xd8dba5ab, 0x6209f5ac), - TOBN(0x24b5d7a9, 0xa5f9adbe), TOBN(0x707d28f7, 0xa61dc768), - TOBN(0x7711460b, 0xcaa999ea), TOBN(0xba7b174d, 0x1c92e4cc), - TOBN(0x3c4bab66, 0x18d4bf2d), TOBN(0xb8f0c980, 0xeb8bd279), - TOBN(0x024bea9a, 0x324b4737), TOBN(0xfba9e423, 0x32a83bca), - TOBN(0x6e635643, 0xa232dced), TOBN(0x99619367, 0x2571c8ba), - TOBN(0xe8c9f357, 0x54b7032b), TOBN(0xf936b3ba, 0x2442d54a), - TOBN(0x2263f0f0, 0x8290c65a), TOBN(0x48989780, 0xee2c7fdb), - TOBN(0xadc5d55a, 0x13d4f95e), TOBN(0x737cff85, 0xad9b8500), - TOBN(0x271c557b, 0x8a73f43d), TOBN(0xbed617a4, 0xe18bc476), - TOBN(0x66245401, 0x7dfd8ab2), TOBN(0xae7b89ae, 0x3a2870aa), - TOBN(0x1b555f53, 0x23a7e545), TOBN(0x6791e247, 0xbe057e4c), - TOBN(0x860136ad, 0x324fa34d), TOBN(0xea111447, 0x4cbeae28), - TOBN(0x023a4270, 0xbedd3299), TOBN(0x3d5c3a7f, 0xc1c35c34), - TOBN(0xb0f6db67, 0x8d0412d2), TOBN(0xd92625e2, 0xfcdc6b9a), - TOBN(0x92ae5ccc, 0x4e28a982), TOBN(0xea251c36, 0x47a3ce7e), - TOBN(0x9d658932, 0x790691bf), TOBN(0xed610589, 0x06b736ae), - TOBN(0x712c2f04, 0xc0d63b6e), TOBN(0x5cf06fd5, 0xc63d488f), - TOBN(0x97363fac, 0xd9588e41), TOBN(0x1f9bf762, 0x2b93257e), - TOBN(0xa9d1ffc4, 0x667acace), TOBN(0x1cf4a1aa, 0x0a061ecf), - TOBN(0x40e48a49, 0xdc1818d0), TOBN(0x0643ff39, 0xa3621ab0), - TOBN(0x5768640c, 0xe39ef639), TOBN(0x1fc099ea, 0x04d86854), - TOBN(0x9130b9c3, 0xeccd28fd), TOBN(0xd743cbd2, 0x7eec54ab), - TOBN(0x052b146f, 0xe5b475b6), TOBN(0x058d9a82, 0x900a7d1f), - TOBN(0x65e02292, 0x91262b72), TOBN(0x96f924f9, 0xbb0edf03), - TOBN(0x5cfa59c8, 0xfe206842), TOBN(0xf6037004, 0x5eafa720), - TOBN(0x5f30699e, 0x18d7dd96), TOBN(0x381e8782, 0xcbab2495), - TOBN(0x91669b46, 0xdd8be949), TOBN(0xb40606f5, 0x26aae8ef), - TOBN(0x2812b839, 0xfc6751a4), TOBN(0x16196214, 0xfba800ef), - TOBN(0x4398d5ca, 0x4c1a2875), TOBN(0x720c00ee, 0x653d8349), - TOBN(0xc2699eb0, 0xd820007c), TOBN(0x880ee660, 0xa39b5825), - TOBN(0x70694694, 0x471f6984), TOBN(0xf7d16ea8, 0xe3dda99a), - TOBN(0x28d675b2, 0xc0519a23), TOBN(0x9ebf94fe, 0x4f6952e3), - TOBN(0xf28bb767, 0xa2294a8a), TOBN(0x85512b4d, 0xfe0af3f5), - TOBN(0x18958ba8, 0x99b16a0d), TOBN(0x95c2430c, 0xba7548a7), - TOBN(0xb30d1b10, 0xa16be615), TOBN(0xe3ebbb97, 0x85bfb74c), - TOBN(0xa3273cfe, 0x18549fdb), TOBN(0xf6e200bf, 0x4fcdb792), - TOBN(0x54a76e18, 0x83aba56c), TOBN(0x73ec66f6, 0x89ef6aa2), - TOBN(0x8d17add7, 0xd1b9a305), TOBN(0xa959c5b9, 0xb7ae1b9d), - TOBN(0x88643522, 0x6bcc094a), TOBN(0xcc5616c4, 0xd7d429b9), - TOBN(0xa6dada01, 0xe6a33f7c), TOBN(0xc6217a07, 0x9d4e70ad), - TOBN(0xd619a818, 0x09c15b7c), TOBN(0xea06b329, 0x0e80c854), - TOBN(0x174811ce, 0xa5f5e7b9), TOBN(0x66dfc310, 0x787c65f4), - TOBN(0x4ea7bd69, 0x3316ab54), TOBN(0xc12c4acb, 0x1dcc0f70), - TOBN(0xe4308d1a, 0x1e407dd9), TOBN(0xe8a3587c, 0x91afa997), - TOBN(0xea296c12, 0xab77b7a5), TOBN(0xb5ad49e4, 0x673c0d52), - TOBN(0x40f9b2b2, 0x7006085a), TOBN(0xa88ff340, 0x87bf6ec2), - TOBN(0x978603b1, 0x4e3066a6), TOBN(0xb3f99fc2, 0xb5e486e2), - TOBN(0x07b53f5e, 0xb2e63645), TOBN(0xbe57e547, 0x84c84232), - TOBN(0xd779c216, 0x7214d5cf), TOBN(0x617969cd, 0x029a3aca), - TOBN(0xd17668cd, 0x8a7017a0), TOBN(0x77b4d19a, 0xbe9b7ee8), - TOBN(0x58fd0e93, 0x9c161776), TOBN(0xa8c4f4ef, 0xd5968a72), - TOBN(0x296071cc, 0x67b3de77), TOBN(0xae3c0b8e, 0x634f7905), - TOBN(0x67e440c2, 0x8a7100c9), TOBN(0xbb8c3c1b, 0xeb4b9b42), - TOBN(0x6d71e8ea, 0xc51b3583), TOBN(0x7591f5af, 0x9525e642), - TOBN(0xf73a2f7b, 0x13f509f3), TOBN(0x618487aa, 0x5619ac9b), - TOBN(0x3a72e5f7, 0x9d61718a), TOBN(0x00413bcc, 0x7592d28c), - TOBN(0x7d9b11d3, 0x963c35cf), TOBN(0x77623bcf, 0xb90a46ed), - TOBN(0xdeef273b, 0xdcdd2a50), TOBN(0x4a741f9b, 0x0601846e), - TOBN(0x33b89e51, 0x0ec6e929), TOBN(0xcb02319f, 0x8b7f22cd), - TOBN(0xbbe1500d, 0x084bae24), TOBN(0x2f0ae8d7, 0x343d2693), - TOBN(0xacffb5f2, 0x7cdef811), TOBN(0xaa0c030a, 0x263fb94f), - TOBN(0x6eef0d61, 0xa0f442de), TOBN(0xf92e1817, 0x27b139d3), - TOBN(0x1ae6deb7, 0x0ad8bc28), TOBN(0xa89e38dc, 0xc0514130), - TOBN(0x81eeb865, 0xd2fdca23), TOBN(0x5a15ee08, 0xcc8ef895), - TOBN(0x768fa10a, 0x01905614), TOBN(0xeff5b8ef, 0x880ee19b), - TOBN(0xf0c0cabb, 0xcb1c8a0e), TOBN(0x2e1ee9cd, 0xb8c838f9), - TOBN(0x0587d8b8, 0x8a4a14c0), TOBN(0xf6f27896, 0x2ff698e5), - TOBN(0xed38ef1c, 0x89ee6256), TOBN(0xf44ee1fe, 0x6b353b45), - TOBN(0x9115c0c7, 0x70e903b3), TOBN(0xc78ec0a1, 0x818f31df), - TOBN(0x6c003324, 0xb7dccbc6), TOBN(0xd96dd1f3, 0x163bbc25), - TOBN(0x33aa82dd, 0x5cedd805), TOBN(0x123aae4f, 0x7f7eb2f1), - TOBN(0x1723fcf5, 0xa26262cd), TOBN(0x1f7f4d5d, 0x0060ebd5), - TOBN(0xf19c5c01, 0xb2eaa3af), TOBN(0x2ccb9b14, 0x9790accf), - TOBN(0x1f9c1cad, 0x52324aa6), TOBN(0x63200526, 0x7247df54), - TOBN(0x5732fe42, 0xbac96f82), TOBN(0x52fe771f, 0x01a1c384), - TOBN(0x546ca13d, 0xb1001684), TOBN(0xb56b4eee, 0xa1709f75), - TOBN(0x266545a9, 0xd5db8672), TOBN(0xed971c90, 0x1e8f3cfb), - TOBN(0x4e7d8691, 0xe3a07b29), TOBN(0x7570d9ec, 0xe4b696b9), - TOBN(0xdc5fa067, 0x7bc7e9ae), TOBN(0x68b44caf, 0xc82c4844), - TOBN(0x519d34b3, 0xbf44da80), TOBN(0x283834f9, 0x5ab32e66), - TOBN(0x6e608797, 0x6278a000), TOBN(0x1e62960e, 0x627312f6), - TOBN(0x9b87b27b, 0xe6901c55), TOBN(0x80e78538, 0x24fdbc1f), - TOBN(0xbbbc0951, 0x2facc27d), TOBN(0x06394239, 0xac143b5a), - TOBN(0x35bb4a40, 0x376c1944), TOBN(0x7cb62694, 0x63da1511), - TOBN(0xafd29161, 0xb7148a3b), TOBN(0xa6f9d9ed, 0x4e2ea2ee), - TOBN(0x15dc2ca2, 0x880dd212), TOBN(0x903c3813, 0xa61139a9), - TOBN(0x2aa7b46d, 0x6c0f8785), TOBN(0x36ce2871, 0x901c60ff), - TOBN(0xc683b028, 0xe10d9c12), TOBN(0x7573baa2, 0x032f33d3), - TOBN(0x87a9b1f6, 0x67a31b58), TOBN(0xfd3ed11a, 0xf4ffae12), - TOBN(0x83dcaa9a, 0x0cb2748e), TOBN(0x8239f018, 0x5d6fdf16), - TOBN(0xba67b49c, 0x72753941), TOBN(0x2beec455, 0xc321cb36), - TOBN(0x88015606, 0x3f8b84ce), TOBN(0x76417083, 0x8d38c86f), - TOBN(0x054f1ca7, 0x598953dd), TOBN(0xc939e110, 0x4e8e7429), - TOBN(0x9b1ac2b3, 0x5a914f2f), TOBN(0x39e35ed3, 0xe74b8f9c), - TOBN(0xd0debdb2, 0x781b2fb0), TOBN(0x1585638f, 0x2d997ba2), - TOBN(0x9c4b646e, 0x9e2fce99), TOBN(0x68a21081, 0x1e80857f), - TOBN(0x06d54e44, 0x3643b52a), TOBN(0xde8d6d63, 0x0d8eb843), - TOBN(0x70321563, 0x42146a0a), TOBN(0x8ba826f2, 0x5eaa3622), - TOBN(0x227a58bd, 0x86138787), TOBN(0x43b6c03c, 0x10281d37), - TOBN(0x6326afbb, 0xb54dde39), TOBN(0x744e5e8a, 0xdb6f2d5f), - TOBN(0x48b2a99a, 0xcff158e1), TOBN(0xa93c8fa0, 0xef87918f), - TOBN(0x2182f956, 0xde058c5c), TOBN(0x216235d2, 0x936f9e7a), - TOBN(0xace0c0db, 0xd2e31e67), TOBN(0xc96449bf, 0xf23ac3e7), - TOBN(0x7e9a2874, 0x170693bd), TOBN(0xa28e14fd, 0xa45e6335), - TOBN(0x5757f6b3, 0x56427344), TOBN(0x822e4556, 0xacf8edf9), - TOBN(0x2b7a6ee2, 0xe6a285cd), TOBN(0x5866f211, 0xa9df3af0), - TOBN(0x40dde2dd, 0xf845b844), TOBN(0x986c3726, 0x110e5e49), - TOBN(0x73680c2a, 0xf7172277), TOBN(0x57b94f0f, 0x0cccb244), - TOBN(0xbdff7267, 0x2d438ca7), TOBN(0xbad1ce11, 0xcf4663fd), - TOBN(0x9813ed9d, 0xd8f71cae), TOBN(0xf43272a6, 0x961fdaa6), - TOBN(0xbeff0119, 0xbd6d1637), TOBN(0xfebc4f91, 0x30361978), - TOBN(0x02b37a95, 0x2f41deff), TOBN(0x0e44a59a, 0xe63b89b7), - TOBN(0x673257dc, 0x143ff951), TOBN(0x19c02205, 0xd752baf4), - TOBN(0x46c23069, 0xc4b7d692), TOBN(0x2e6392c3, 0xfd1502ac), - TOBN(0x6057b1a2, 0x1b220846), TOBN(0xe51ff946, 0x0c1b5b63)}, - {TOBN(0x6e85cb51, 0x566c5c43), TOBN(0xcff9c919, 0x3597f046), - TOBN(0x9354e90c, 0x4994d94a), TOBN(0xe0a39332, 0x2147927d), - TOBN(0x8427fac1, 0x0dc1eb2b), TOBN(0x88cfd8c2, 0x2ff319fa), - TOBN(0xe2d4e684, 0x01965274), TOBN(0xfa2e067d, 0x67aaa746), - TOBN(0xb6d92a7f, 0x3e5f9f11), TOBN(0x9afe153a, 0xd6cb3b8e), - TOBN(0x4d1a6dd7, 0xddf800bd), TOBN(0xf6c13cc0, 0xcaf17e19), - TOBN(0x15f6c58e, 0x325fc3ee), TOBN(0x71095400, 0xa31dc3b2), - TOBN(0x168e7c07, 0xafa3d3e7), TOBN(0x3f8417a1, 0x94c7ae2d), - TOBN(0xec234772, 0x813b230d), TOBN(0x634d0f5f, 0x17344427), - TOBN(0x11548ab1, 0xd77fc56a), TOBN(0x7fab1750, 0xce06af77), - TOBN(0xb62c10a7, 0x4f7c4f83), TOBN(0xa7d2edc4, 0x220a67d9), - TOBN(0x1c404170, 0x921209a0), TOBN(0x0b9815a0, 0xface59f0), - TOBN(0x2842589b, 0x319540c3), TOBN(0x18490f59, 0xa283d6f8), - TOBN(0xa2731f84, 0xdaae9fcb), TOBN(0x3db6d960, 0xc3683ba0), - TOBN(0xc85c63bb, 0x14611069), TOBN(0xb19436af, 0x0788bf05), - TOBN(0x905459df, 0x347460d2), TOBN(0x73f6e094, 0xe11a7db1), - TOBN(0xdc7f938e, 0xb6357f37), TOBN(0xc5d00f79, 0x2bd8aa62), - TOBN(0xc878dcb9, 0x2ca979fc), TOBN(0x37e83ed9, 0xeb023a99), - TOBN(0x6b23e273, 0x1560bf3d), TOBN(0x1086e459, 0x1d0fae61), - TOBN(0x78248316, 0x9a9414bd), TOBN(0x1b956bc0, 0xf0ea9ea1), - TOBN(0x7b85bb91, 0xc31b9c38), TOBN(0x0c5aa90b, 0x48ef57b5), - TOBN(0xdedeb169, 0xaf3bab6f), TOBN(0xe610ad73, 0x2d373685), - TOBN(0xf13870df, 0x02ba8e15), TOBN(0x0337edb6, 0x8ca7f771), - TOBN(0xe4acf747, 0xb62c036c), TOBN(0xd921d576, 0xb6b94e81), - TOBN(0xdbc86439, 0x2c422f7a), TOBN(0xfb635362, 0xed348898), - TOBN(0x83084668, 0xc45bfcd1), TOBN(0xc357c9e3, 0x2b315e11), - TOBN(0xb173b540, 0x5b2e5b8c), TOBN(0x7e946931, 0xe102b9a4), - TOBN(0x17c890eb, 0x7b0fb199), TOBN(0xec225a83, 0xd61b662b), - TOBN(0xf306a3c8, 0xee3c76cb), TOBN(0x3cf11623, 0xd32a1f6e), - TOBN(0xe6d5ab64, 0x6863e956), TOBN(0x3b8a4cbe, 0x5c005c26), - TOBN(0xdcd529a5, 0x9ce6bb27), TOBN(0xc4afaa52, 0x04d4b16f), - TOBN(0xb0624a26, 0x7923798d), TOBN(0x85e56df6, 0x6b307fab), - TOBN(0x0281893c, 0x2bf29698), TOBN(0x91fc19a4, 0xd7ce7603), - TOBN(0x75a5dca3, 0xad9a558f), TOBN(0x40ceb3fa, 0x4d50bf77), - TOBN(0x1baf6060, 0xbc9ba369), TOBN(0x927e1037, 0x597888c2), - TOBN(0xd936bf19, 0x86a34c07), TOBN(0xd4cf10c1, 0xc34ae980), - TOBN(0x3a3e5334, 0x859dd614), TOBN(0x9c475b5b, 0x18d0c8ee), - TOBN(0x63080d1f, 0x07cd51d5), TOBN(0xc9c0d0a6, 0xb88b4326), - TOBN(0x1ac98691, 0xc234296f), TOBN(0x2a0a83a4, 0x94887fb6), - TOBN(0x56511427, 0x0cea9cf2), TOBN(0x5230a6e8, 0xa24802f5), - TOBN(0xf7a2bf0f, 0x72e3d5c1), TOBN(0x37717446, 0x4f21439e), - TOBN(0xfedcbf25, 0x9ce30334), TOBN(0xe0030a78, 0x7ce202f9), - TOBN(0x6f2d9ebf, 0x1202e9ca), TOBN(0xe79dde6c, 0x75e6e591), - TOBN(0xf52072af, 0xf1dac4f8), TOBN(0x6c8d087e, 0xbb9b404d), - TOBN(0xad0fc73d, 0xbce913af), TOBN(0x909e587b, 0x458a07cb), - TOBN(0x1300da84, 0xd4f00c8a), TOBN(0x425cd048, 0xb54466ac), - TOBN(0xb59cb9be, 0x90e9d8bf), TOBN(0x991616db, 0x3e431b0e), - TOBN(0xd3aa117a, 0x531aecff), TOBN(0x91af92d3, 0x59f4dc3b), - TOBN(0x9b1ec292, 0xe93fda29), TOBN(0x76bb6c17, 0xe97d91bc), - TOBN(0x7509d95f, 0xaface1e6), TOBN(0x3653fe47, 0xbe855ae3), - TOBN(0x73180b28, 0x0f680e75), TOBN(0x75eefd1b, 0xeeb6c26c), - TOBN(0xa4cdf29f, 0xb66d4236), TOBN(0x2d70a997, 0x6b5821d8), - TOBN(0x7a3ee207, 0x20445c36), TOBN(0x71d1ac82, 0x59877174), - TOBN(0x0fc539f7, 0x949f73e9), TOBN(0xd05cf3d7, 0x982e3081), - TOBN(0x8758e20b, 0x7b1c7129), TOBN(0xffadcc20, 0x569e61f2), - TOBN(0xb05d3a2f, 0x59544c2d), TOBN(0xbe16f5c1, 0x9fff5e53), - TOBN(0x73cf65b8, 0xaad58135), TOBN(0x622c2119, 0x037aa5be), - TOBN(0x79373b3f, 0x646fd6a0), TOBN(0x0e029db5, 0x0d3978cf), - TOBN(0x8bdfc437, 0x94fba037), TOBN(0xaefbd687, 0x620797a6), - TOBN(0x3fa5382b, 0xbd30d38e), TOBN(0x7627cfbf, 0x585d7464), - TOBN(0xb2330fef, 0x4e4ca463), TOBN(0xbcef7287, 0x3566cc63), - TOBN(0xd161d2ca, 0xcf780900), TOBN(0x135dc539, 0x5b54827d), - TOBN(0x638f052e, 0x27bf1bc6), TOBN(0x10a224f0, 0x07dfa06c), - TOBN(0xe973586d, 0x6d3321da), TOBN(0x8b0c5738, 0x26152c8f), - TOBN(0x07ef4f2a, 0x34606074), TOBN(0x80fe7fe8, 0xa0f7047a), - TOBN(0x3d1a8152, 0xe1a0e306), TOBN(0x32cf43d8, 0x88da5222), - TOBN(0xbf89a95f, 0x5f02ffe6), TOBN(0x3d9eb9a4, 0x806ad3ea), - TOBN(0x012c17bb, 0x79c8e55e), TOBN(0xfdcd1a74, 0x99c81dac), - TOBN(0x7043178b, 0xb9556098), TOBN(0x4090a1df, 0x801c3886), - TOBN(0x759800ff, 0x9b67b912), TOBN(0x3e5c0304, 0x232620c8), - TOBN(0x4b9d3c4b, 0x70dceeca), TOBN(0xbb2d3c15, 0x181f648e), - TOBN(0xf981d837, 0x6e33345c), TOBN(0xb626289b, 0x0cf2297a), - TOBN(0x766ac659, 0x8baebdcf), TOBN(0x1a28ae09, 0x75df01e5), - TOBN(0xb71283da, 0x375876d8), TOBN(0x4865a96d, 0x607b9800), - TOBN(0x25dd1bcd, 0x237936b2), TOBN(0x332f4f4b, 0x60417494), - TOBN(0xd0923d68, 0x370a2147), TOBN(0x497f5dfb, 0xdc842203), - TOBN(0x9dc74cbd, 0x32be5e0f), TOBN(0x7475bcb7, 0x17a01375), - TOBN(0x438477c9, 0x50d872b1), TOBN(0xcec67879, 0xffe1d63d), - TOBN(0x9b006014, 0xd8578c70), TOBN(0xc9ad99a8, 0x78bb6b8b), - TOBN(0x6799008e, 0x11fb3806), TOBN(0xcfe81435, 0xcd44cab3), - TOBN(0xa2ee1582, 0x2f4fb344), TOBN(0xb8823450, 0x483fa6eb), - TOBN(0x622d323d, 0x652c7749), TOBN(0xd8474a98, 0xbeb0a15b), - TOBN(0xe43c154d, 0x5d1c00d0), TOBN(0x7fd581d9, 0x0e3e7aac), - TOBN(0x2b44c619, 0x2525ddf8), TOBN(0x67a033eb, 0xb8ae9739), - TOBN(0x113ffec1, 0x9ef2d2e4), TOBN(0x1bf6767e, 0xd5a0ea7f), - TOBN(0x57fff75e, 0x03714c0a), TOBN(0xa23c422e, 0x0a23e9ee), - TOBN(0xdd5f6b2d, 0x540f83af), TOBN(0xc2c2c27e, 0x55ea46a7), - TOBN(0xeb6b4246, 0x672a1208), TOBN(0xd13599f7, 0xae634f7a), - TOBN(0xcf914b5c, 0xd7b32c6e), TOBN(0x61a5a640, 0xeaf61814), - TOBN(0x8dc3df8b, 0x208a1bbb), TOBN(0xef627fd6, 0xb6d79aa5), - TOBN(0x44232ffc, 0xc4c86bc8), TOBN(0xe6f9231b, 0x061539fe), - TOBN(0x1d04f25a, 0x958b9533), TOBN(0x180cf934, 0x49e8c885), - TOBN(0x89689595, 0x9884aaf7), TOBN(0xb1959be3, 0x07b348a6), - TOBN(0x96250e57, 0x3c147c87), TOBN(0xae0efb3a, 0xdd0c61f8), - TOBN(0xed00745e, 0xca8c325e), TOBN(0x3c911696, 0xecff3f70), - TOBN(0x73acbc65, 0x319ad41d), TOBN(0x7b01a020, 0xf0b1c7ef), - TOBN(0xea32b293, 0x63a1483f), TOBN(0x89eabe71, 0x7a248f96), - TOBN(0x9c6231d3, 0x343157e5), TOBN(0x93a375e5, 0xdf3c546d), - TOBN(0xe76e9343, 0x6a2afe69), TOBN(0xc4f89100, 0xe166c88e), - TOBN(0x248efd0d, 0x4f872093), TOBN(0xae0eb3ea, 0x8fe0ea61), - TOBN(0xaf89790d, 0x9d79046e), TOBN(0x4d650f2d, 0x6cee0976), - TOBN(0xa3935d9a, 0x43071eca), TOBN(0x66fcd2c9, 0x283b0bfe), - TOBN(0x0e665eb5, 0x696605f1), TOBN(0xe77e5d07, 0xa54cd38d), - TOBN(0x90ee050a, 0x43d950cf), TOBN(0x86ddebda, 0xd32e69b5), - TOBN(0x6ad94a3d, 0xfddf7415), TOBN(0xf7fa1309, 0x3f6e8d5a), - TOBN(0xc4831d1d, 0xe9957f75), TOBN(0x7de28501, 0xd5817447), - TOBN(0x6f1d7078, 0x9e2aeb6b), TOBN(0xba2b9ff4, 0xf67a53c2), - TOBN(0x36963767, 0xdf9defc3), TOBN(0x479deed3, 0x0d38022c), - TOBN(0xd2edb89b, 0x3a8631e8), TOBN(0x8de855de, 0x7a213746), - TOBN(0xb2056cb7, 0xb00c5f11), TOBN(0xdeaefbd0, 0x2c9b85e4), - TOBN(0x03f39a8d, 0xd150892d), TOBN(0x37b84686, 0x218b7985), - TOBN(0x36296dd8, 0xb7375f1a), TOBN(0x472cd4b1, 0xb78e898e), - TOBN(0x15dff651, 0xe9f05de9), TOBN(0xd4045069, 0x2ce98ba9), - TOBN(0x8466a7ae, 0x9b38024c), TOBN(0xb910e700, 0xe5a6b5ef), - TOBN(0xae1c56ea, 0xb3aa8f0d), TOBN(0xbab2a507, 0x7eee74a6), - TOBN(0x0dca11e2, 0x4b4c4620), TOBN(0xfd896e2e, 0x4c47d1f4), - TOBN(0xeb45ae53, 0x308fbd93), TOBN(0x46cd5a2e, 0x02c36fda), - TOBN(0x6a3d4e90, 0xbaa48385), TOBN(0xdd55e62e, 0x9dbe9960), - TOBN(0xa1406aa0, 0x2a81ede7), TOBN(0x6860dd14, 0xf9274ea7), - TOBN(0xcfdcb0c2, 0x80414f86), TOBN(0xff410b10, 0x22f94327), - TOBN(0x5a33cc38, 0x49ad467b), TOBN(0xefb48b6c, 0x0a7335f1), - TOBN(0x14fb54a4, 0xb153a360), TOBN(0x604aa9d2, 0xb52469cc), - TOBN(0x5e9dc486, 0x754e48e9), TOBN(0x693cb455, 0x37471e8e), - TOBN(0xfb2fd7cd, 0x8d3b37b6), TOBN(0x63345e16, 0xcf09ff07), - TOBN(0x9910ba6b, 0x23a5d896), TOBN(0x1fe19e35, 0x7fe4364e), - TOBN(0x6e1da8c3, 0x9a33c677), TOBN(0x15b4488b, 0x29fd9fd0), - TOBN(0x1f439254, 0x1a1f22bf), TOBN(0x920a8a70, 0xab8163e8), - TOBN(0x3fd1b249, 0x07e5658e), TOBN(0xf2c4f79c, 0xb6ec839b), - TOBN(0x1abbc3d0, 0x4aa38d1b), TOBN(0x3b0db35c, 0xb5d9510e), - TOBN(0x1754ac78, 0x3e60dec0), TOBN(0x53272fd7, 0xea099b33), - TOBN(0x5fb0494f, 0x07a8e107), TOBN(0x4a89e137, 0x6a8191fa), - TOBN(0xa113b7f6, 0x3c4ad544), TOBN(0x88a2e909, 0x6cb9897b), - TOBN(0x17d55de3, 0xb44a3f84), TOBN(0xacb2f344, 0x17c6c690), - TOBN(0x32088168, 0x10232390), TOBN(0xf2e8a61f, 0x6c733bf7), - TOBN(0xa774aab6, 0x9c2d7652), TOBN(0xfb5307e3, 0xed95c5bc), - TOBN(0xa05c73c2, 0x4981f110), TOBN(0x1baae31c, 0xa39458c9), - TOBN(0x1def185b, 0xcbea62e7), TOBN(0xe8ac9eae, 0xeaf63059), - TOBN(0x098a8cfd, 0x9921851c), TOBN(0xd959c3f1, 0x3abe2f5b), - TOBN(0xa4f19525, 0x20e40ae5), TOBN(0x320789e3, 0x07a24aa1), - TOBN(0x259e6927, 0x7392b2bc), TOBN(0x58f6c667, 0x1918668b), - TOBN(0xce1db2bb, 0xc55d2d8b), TOBN(0x41d58bb7, 0xf4f6ca56), - TOBN(0x7650b680, 0x8f877614), TOBN(0x905e16ba, 0xf4c349ed), - TOBN(0xed415140, 0xf661acac), TOBN(0x3b8784f0, 0xcb2270af), - TOBN(0x3bc280ac, 0x8a402cba), TOBN(0xd53f7146, 0x0937921a), - TOBN(0xc03c8ee5, 0xe5681e83), TOBN(0x62126105, 0xf6ac9e4a), - TOBN(0x9503a53f, 0x936b1a38), TOBN(0x3d45e2d4, 0x782fecbd), - TOBN(0x69a5c439, 0x76e8ae98), TOBN(0xb53b2eeb, 0xbfb4b00e), - TOBN(0xf1674712, 0x72386c89), TOBN(0x30ca34a2, 0x4268bce4), - TOBN(0x7f1ed86c, 0x78341730), TOBN(0x8ef5beb8, 0xb525e248), - TOBN(0xbbc489fd, 0xb74fbf38), TOBN(0x38a92a0e, 0x91a0b382), - TOBN(0x7a77ba3f, 0x22433ccf), TOBN(0xde8362d6, 0xa29f05a9), - TOBN(0x7f6a30ea, 0x61189afc), TOBN(0x693b5505, 0x59ef114f), - TOBN(0x50266bc0, 0xcd1797a1), TOBN(0xea17b47e, 0xf4b7af2d), - TOBN(0xd6c4025c, 0x3df9483e), TOBN(0x8cbb9d9f, 0xa37b18c9), - TOBN(0x91cbfd9c, 0x4d8424cf), TOBN(0xdb7048f1, 0xab1c3506), - TOBN(0x9eaf641f, 0x028206a3), TOBN(0xf986f3f9, 0x25bdf6ce), - TOBN(0x262143b5, 0x224c08dc), TOBN(0x2bbb09b4, 0x81b50c91), - TOBN(0xc16ed709, 0xaca8c84f), TOBN(0xa6210d9d, 0xb2850ca8), - TOBN(0x6d8df67a, 0x09cb54d6), TOBN(0x91eef6e0, 0x500919a4), - TOBN(0x90f61381, 0x0f132857), TOBN(0x9acede47, 0xf8d5028b), - TOBN(0x844d1b71, 0x90b771c3), TOBN(0x563b71e4, 0xba6426be), - TOBN(0x2efa2e83, 0xbdb802ff), TOBN(0x3410cbab, 0xab5b4a41), - TOBN(0x555b2d26, 0x30da84dd), TOBN(0xd0711ae9, 0xee1cc29a), - TOBN(0xcf3e8c60, 0x2f547792), TOBN(0x03d7d5de, 0xdc678b35), - TOBN(0x071a2fa8, 0xced806b8), TOBN(0x222e6134, 0x697f1478), - TOBN(0xdc16fd5d, 0xabfcdbbf), TOBN(0x44912ebf, 0x121b53b8), - TOBN(0xac943674, 0x2496c27c), TOBN(0x8ea3176c, 0x1ffc26b0), - TOBN(0xb6e224ac, 0x13debf2c), TOBN(0x524cc235, 0xf372a832), - TOBN(0xd706e1d8, 0x9f6f1b18), TOBN(0x2552f005, 0x44cce35b), - TOBN(0x8c8326c2, 0xa88e31fc), TOBN(0xb5468b2c, 0xf9552047), - TOBN(0xce683e88, 0x3ff90f2b), TOBN(0x77947bdf, 0x2f0a5423), - TOBN(0xd0a1b28b, 0xed56e328), TOBN(0xaee35253, 0xc20134ac), - TOBN(0x7e98367d, 0x3567962f), TOBN(0x379ed61f, 0x8188bffb), - TOBN(0x73bba348, 0xfaf130a1), TOBN(0x6c1f75e1, 0x904ed734), - TOBN(0x18956642, 0x3b4a79fc), TOBN(0xf20bc83d, 0x54ef4493), - TOBN(0x836d425d, 0x9111eca1), TOBN(0xe5b5c318, 0x009a8dcf), - TOBN(0x3360b25d, 0x13221bc5), TOBN(0x707baad2, 0x6b3eeaf7), - TOBN(0xd7279ed8, 0x743a95a1), TOBN(0x7450a875, 0x969e809f), - TOBN(0x32b6bd53, 0xe5d0338f), TOBN(0x1e77f7af, 0x2b883bbc), - TOBN(0x90da12cc, 0x1063ecd0), TOBN(0xe2697b58, 0xc315be47), - TOBN(0x2771a5bd, 0xda85d534), TOBN(0x53e78c1f, 0xff980eea), - TOBN(0xadf1cf84, 0x900385e7), TOBN(0x7d3b14f6, 0xc9387b62), - TOBN(0x170e74b0, 0xcb8f2bd2), TOBN(0x2d50b486, 0x827fa993), - TOBN(0xcdbe8c9a, 0xf6f32bab), TOBN(0x55e906b0, 0xc3b93ab8), - TOBN(0x747f22fc, 0x8fe280d1), TOBN(0xcd8e0de5, 0xb2e114ab), - TOBN(0x5ab7dbeb, 0xe10b68b0), TOBN(0x9dc63a9c, 0xa480d4b2), - TOBN(0x78d4bc3b, 0x4be1495f), TOBN(0x25eb3db8, 0x9359122d), - TOBN(0x3f8ac05b, 0x0809cbdc), TOBN(0xbf4187bb, 0xd37c702f), - TOBN(0x84cea069, 0x1416a6a5), TOBN(0x8f860c79, 0x43ef881c), - TOBN(0x41311f8a, 0x38038a5d), TOBN(0xe78c2ec0, 0xfc612067), - TOBN(0x494d2e81, 0x5ad73581), TOBN(0xb4cc9e00, 0x59604097), - TOBN(0xff558aec, 0xf3612cba), TOBN(0x35beef7a, 0x9e36c39e), - TOBN(0x1845c7cf, 0xdbcf41b9), TOBN(0x5703662a, 0xaea997c0), - TOBN(0x8b925afe, 0xe402f6d8), TOBN(0xd0a1b1ae, 0x4dd72162), - TOBN(0x9f47b375, 0x03c41c4b), TOBN(0xa023829b, 0x0391d042), - TOBN(0x5f5045c3, 0x503b8b0a), TOBN(0x123c2688, 0x98c010e5), - TOBN(0x324ec0cc, 0x36ba06ee), TOBN(0xface3115, 0x3dd2cc0c), - TOBN(0xb364f3be, 0xf333e91f), TOBN(0xef8aff73, 0x28e832b0), - TOBN(0x1e9bad04, 0x2d05841b), TOBN(0x42f0e3df, 0x356a21e2), - TOBN(0xa3270bcb, 0x4add627e), TOBN(0xb09a8158, 0xd322e711), - TOBN(0x86e326a1, 0x0fee104a), TOBN(0xad7788f8, 0x3703f65d), - TOBN(0x7e765430, 0x47bc4833), TOBN(0x6cee582b, 0x2b9b893a), - TOBN(0x9cd2a167, 0xe8f55a7b), TOBN(0xefbee3c6, 0xd9e4190d), - TOBN(0x33ee7185, 0xd40c2e9d), TOBN(0x844cc9c5, 0xa380b548), - TOBN(0x323f8ecd, 0x66926e04), TOBN(0x0001e38f, 0x8110c1ba), - TOBN(0x8dbcac12, 0xfc6a7f07), TOBN(0xd65e1d58, 0x0cec0827), - TOBN(0xd2cd4141, 0xbe76ca2d), TOBN(0x7895cf5c, 0xe892f33a), - TOBN(0x956d230d, 0x367139d2), TOBN(0xa91abd3e, 0xd012c4c1), - TOBN(0x34fa4883, 0x87eb36bf), TOBN(0xc5f07102, 0x914b8fb4), - TOBN(0x90f0e579, 0xadb9c95f), TOBN(0xfe6ea8cb, 0x28888195), - TOBN(0x7b9b5065, 0xedfa9284), TOBN(0x6c510bd2, 0x2b8c8d65), - TOBN(0xd7b8ebef, 0xcbe8aafd), TOBN(0xedb3af98, 0x96b1da07), - TOBN(0x28ff779d, 0x6295d426), TOBN(0x0c4f6ac7, 0x3fa3ad7b), - TOBN(0xec44d054, 0x8b8e2604), TOBN(0x9b32a66d, 0x8b0050e1), - TOBN(0x1f943366, 0xf0476ce2), TOBN(0x7554d953, 0xa602c7b4), - TOBN(0xbe35aca6, 0x524f2809), TOBN(0xb6881229, 0xfd4edbea), - TOBN(0xe8cd0c8f, 0x508efb63), TOBN(0x9eb5b5c8, 0x6abcefc7), - TOBN(0xf5621f5f, 0xb441ab4f), TOBN(0x79e6c046, 0xb76a2b22), - TOBN(0x74a4792c, 0xe37a1f69), TOBN(0xcbd252cb, 0x03542b60), - TOBN(0x785f65d5, 0xb3c20bd3), TOBN(0x8dea6143, 0x4fabc60c), - TOBN(0x45e21446, 0xde673629), TOBN(0x57f7aa1e, 0x703c2d21), - TOBN(0xa0e99b7f, 0x98c868c7), TOBN(0x4e42f66d, 0x8b641676), - TOBN(0x602884dc, 0x91077896), TOBN(0xa0d690cf, 0xc2c9885b), - TOBN(0xfeb4da33, 0x3b9a5187), TOBN(0x5f789598, 0x153c87ee), - TOBN(0x2192dd47, 0x52b16dba), TOBN(0xdeefc0e6, 0x3524c1b1), - TOBN(0x465ea76e, 0xe4383693), TOBN(0x79401711, 0x361b8d98), - TOBN(0xa5f9ace9, 0xf21a15cb), TOBN(0x73d26163, 0xefee9aeb), - TOBN(0xcca844b3, 0xe677016c), TOBN(0x6c122b07, 0x57eaee06), - TOBN(0xb782dce7, 0x15f09690), TOBN(0x508b9b12, 0x2dfc0fc9), - TOBN(0x9015ab4b, 0x65d89fc6), TOBN(0x5e79dab7, 0xd6d5bb0f), - TOBN(0x64f021f0, 0x6c775aa2), TOBN(0xdf09d8cc, 0x37c7eca1), - TOBN(0x9a761367, 0xef2fa506), TOBN(0xed4ca476, 0x5b81eec6), - TOBN(0x262ede36, 0x10bbb8b5), TOBN(0x0737ce83, 0x0641ada3), - TOBN(0x4c94288a, 0xe9831ccc), TOBN(0x487fc1ce, 0x8065e635), - TOBN(0xb13d7ab3, 0xb8bb3659), TOBN(0xdea5df3e, 0x855e4120), - TOBN(0xb9a18573, 0x85eb0244), TOBN(0x1a1b8ea3, 0xa7cfe0a3), - TOBN(0x3b837119, 0x67b0867c), TOBN(0x8d5e0d08, 0x9d364520), - TOBN(0x52dccc1e, 0xd930f0e3), TOBN(0xefbbcec7, 0xbf20bbaf), - TOBN(0x99cffcab, 0x0263ad10), TOBN(0xd8199e6d, 0xfcd18f8a), - TOBN(0x64e2773f, 0xe9f10617), TOBN(0x0079e8e1, 0x08704848), - TOBN(0x1169989f, 0x8a342283), TOBN(0x8097799c, 0xa83012e6), - TOBN(0xece966cb, 0x8a6a9001), TOBN(0x93b3afef, 0x072ac7fc), - TOBN(0xe6893a2a, 0x2db3d5ba), TOBN(0x263dc462, 0x89bf4fdc), - TOBN(0x8852dfc9, 0xe0396673), TOBN(0x7ac70895, 0x3af362b6), - TOBN(0xbb9cce4d, 0x5c2f342b), TOBN(0xbf80907a, 0xb52d7aae), - TOBN(0x97f3d3cd, 0x2161bcd0), TOBN(0xb25b0834, 0x0962744d), - TOBN(0xc5b18ea5, 0x6c3a1dda), TOBN(0xfe4ec7eb, 0x06c92317), - TOBN(0xb787b890, 0xad1c4afe), TOBN(0xdccd9a92, 0x0ede801a), - TOBN(0x9ac6ddda, 0xdb58da1f), TOBN(0x22bbc12f, 0xb8cae6ee), - TOBN(0xc6f8bced, 0x815c4a43), TOBN(0x8105a92c, 0xf96480c7), - TOBN(0x0dc3dbf3, 0x7a859d51), TOBN(0xe3ec7ce6, 0x3041196b), - TOBN(0xd9f64b25, 0x0d1067c9), TOBN(0xf2321321, 0x3d1f8dd8), - TOBN(0x8b5c619c, 0x76497ee8), TOBN(0x5d2b0ac6, 0xc717370e), - TOBN(0x98204cb6, 0x4fcf68e1), TOBN(0x0bdec211, 0x62bc6792), - TOBN(0x6973ccef, 0xa63b1011), TOBN(0xf9e3fa97, 0xe0de1ac5), - TOBN(0x5efb693e, 0x3d0e0c8b), TOBN(0x037248e9, 0xd2d4fcb4)}, - {TOBN(0x80802dc9, 0x1ec34f9e), TOBN(0xd8772d35, 0x33810603), - TOBN(0x3f06d66c, 0x530cb4f3), TOBN(0x7be5ed0d, 0xc475c129), - TOBN(0xcb9e3c19, 0x31e82b10), TOBN(0xc63d2857, 0xc9ff6b4c), - TOBN(0xb92118c6, 0x92a1b45e), TOBN(0x0aec4414, 0x7285bbca), - TOBN(0xfc189ae7, 0x1e29a3ef), TOBN(0xcbe906f0, 0x4c93302e), - TOBN(0xd0107914, 0xceaae10e), TOBN(0xb7a23f34, 0xb68e19f8), - TOBN(0xe9d875c2, 0xefd2119d), TOBN(0x03198c6e, 0xfcadc9c8), - TOBN(0x65591bf6, 0x4da17113), TOBN(0x3cf0bbf8, 0x3d443038), - TOBN(0xae485bb7, 0x2b724759), TOBN(0x945353e1, 0xb2d4c63a), - TOBN(0x82159d07, 0xde7d6f2c), TOBN(0x389caef3, 0x4ec5b109), - TOBN(0x4a8ebb53, 0xdb65ef14), TOBN(0x2dc2cb7e, 0xdd99de43), - TOBN(0x816fa3ed, 0x83f2405f), TOBN(0x73429bb9, 0xc14208a3), - TOBN(0xb618d590, 0xb01e6e27), TOBN(0x047e2ccd, 0xe180b2dc), - TOBN(0xd1b299b5, 0x04aea4a9), TOBN(0x412c9e1e, 0x9fa403a4), - TOBN(0x88d28a36, 0x79407552), TOBN(0x49c50136, 0xf332b8e3), - TOBN(0x3a1b6fcc, 0xe668de19), TOBN(0x178851bc, 0x75122b97), - TOBN(0xb1e13752, 0xfb85fa4c), TOBN(0xd61257ce, 0x383c8ce9), - TOBN(0xd43da670, 0xd2f74dae), TOBN(0xa35aa23f, 0xbf846bbb), - TOBN(0x5e74235d, 0x4421fc83), TOBN(0xf6df8ee0, 0xc363473b), - TOBN(0x34d7f52a, 0x3c4aa158), TOBN(0x50d05aab, 0x9bc6d22e), - TOBN(0x8c56e735, 0xa64785f4), TOBN(0xbc56637b, 0x5f29cd07), - TOBN(0x53b2bb80, 0x3ee35067), TOBN(0x50235a0f, 0xdc919270), - TOBN(0x191ab6d8, 0xf2c4aa65), TOBN(0xc3475831, 0x8396023b), - TOBN(0x80400ba5, 0xf0f805ba), TOBN(0x8881065b, 0x5ec0f80f), - TOBN(0xc370e522, 0xcc1b5e83), TOBN(0xde2d4ad1, 0x860b8bfb), - TOBN(0xad364df0, 0x67b256df), TOBN(0x8f12502e, 0xe0138997), - TOBN(0x503fa0dc, 0x7783920a), TOBN(0xe80014ad, 0xc0bc866a), - TOBN(0x3f89b744, 0xd3064ba6), TOBN(0x03511dcd, 0xcba5dba5), - TOBN(0x197dd46d, 0x95a7b1a2), TOBN(0x9c4e7ad6, 0x3c6341fb), - TOBN(0x426eca29, 0x484c2ece), TOBN(0x9211e489, 0xde7f4f8a), - TOBN(0x14997f6e, 0xc78ef1f4), TOBN(0x2b2c0910, 0x06574586), - TOBN(0x17286a6e, 0x1c3eede8), TOBN(0x25f92e47, 0x0f60e018), - TOBN(0x805c5646, 0x31890a36), TOBN(0x703ef600, 0x57feea5b), - TOBN(0x389f747c, 0xaf3c3030), TOBN(0xe0e5daeb, 0x54dd3739), - TOBN(0xfe24a4c3, 0xc9c9f155), TOBN(0x7e4bf176, 0xb5393962), - TOBN(0x37183de2, 0xaf20bf29), TOBN(0x4a1bd7b5, 0xf95a8c3b), - TOBN(0xa83b9699, 0x46191d3d), TOBN(0x281fc8dd, 0x7b87f257), - TOBN(0xb18e2c13, 0x54107588), TOBN(0x6372def7, 0x9b2bafe8), - TOBN(0xdaf4bb48, 0x0d8972ca), TOBN(0x3f2dd4b7, 0x56167a3f), - TOBN(0x1eace32d, 0x84310cf4), TOBN(0xe3bcefaf, 0xe42700aa), - TOBN(0x5fe5691e, 0xd785e73d), TOBN(0xa5db5ab6, 0x2ea60467), - TOBN(0x02e23d41, 0xdfc6514a), TOBN(0x35e8048e, 0xe03c3665), - TOBN(0x3f8b118f, 0x1adaa0f8), TOBN(0x28ec3b45, 0x84ce1a5a), - TOBN(0xe8cacc6e, 0x2c6646b8), TOBN(0x1343d185, 0xdbd0e40f), - TOBN(0xe5d7f844, 0xcaaa358c), TOBN(0x1a1db7e4, 0x9924182a), - TOBN(0xd64cd42d, 0x9c875d9a), TOBN(0xb37b515f, 0x042eeec8), - TOBN(0x4d4dd409, 0x7b165fbe), TOBN(0xfc322ed9, 0xe206eff3), - TOBN(0x7dee4102, 0x59b7e17e), TOBN(0x55a481c0, 0x8236ca00), - TOBN(0x8c885312, 0xc23fc975), TOBN(0x15715806, 0x05d6297b), - TOBN(0xa078868e, 0xf78edd39), TOBN(0x956b31e0, 0x03c45e52), - TOBN(0x470275d5, 0xff7b33a6), TOBN(0xc8d5dc3a, 0x0c7e673f), - TOBN(0x419227b4, 0x7e2f2598), TOBN(0x8b37b634, 0x4c14a975), - TOBN(0xd0667ed6, 0x8b11888c), TOBN(0x5e0e8c3e, 0x803e25dc), - TOBN(0x34e5d0dc, 0xb987a24a), TOBN(0x9f40ac3b, 0xae920323), - TOBN(0x5463de95, 0x34e0f63a), TOBN(0xa128bf92, 0x6b6328f9), - TOBN(0x491ccd7c, 0xda64f1b7), TOBN(0x7ef1ec27, 0xc47bde35), - TOBN(0xa857240f, 0xa36a2737), TOBN(0x35dc1366, 0x63621bc1), - TOBN(0x7a3a6453, 0xd4fb6897), TOBN(0x80f1a439, 0xc929319d), - TOBN(0xfc18274b, 0xf8cb0ba0), TOBN(0xb0b53766, 0x8078c5eb), - TOBN(0xfb0d4924, 0x1e01d0ef), TOBN(0x50d7c67d, 0x372ab09c), - TOBN(0xb4e370af, 0x3aeac968), TOBN(0xe4f7fee9, 0xc4b63266), - TOBN(0xb4acd4c2, 0xe3ac5664), TOBN(0xf8910bd2, 0xceb38cbf), - TOBN(0x1c3ae50c, 0xc9c0726e), TOBN(0x15309569, 0xd97b40bf), - TOBN(0x70884b7f, 0xfd5a5a1b), TOBN(0x3890896a, 0xef8314cd), - TOBN(0x58e1515c, 0xa5618c93), TOBN(0xe665432b, 0x77d942d1), - TOBN(0xb32181bf, 0xb6f767a8), TOBN(0x753794e8, 0x3a604110), - TOBN(0x09afeb7c, 0xe8c0dbcc), TOBN(0x31e02613, 0x598673a3), - TOBN(0x5d98e557, 0x7d46db00), TOBN(0xfc21fb8c, 0x9d985b28), - TOBN(0xc9040116, 0xb0843e0b), TOBN(0x53b1b3a8, 0x69b04531), - TOBN(0xdd1649f0, 0x85d7d830), TOBN(0xbb3bcc87, 0xcb7427e8), - TOBN(0x77261100, 0xc93dce83), TOBN(0x7e79da61, 0xa1922a2a), - TOBN(0x587a2b02, 0xf3149ce8), TOBN(0x147e1384, 0xde92ec83), - TOBN(0x484c83d3, 0xaf077f30), TOBN(0xea78f844, 0x0658b53a), - TOBN(0x912076c2, 0x027aec53), TOBN(0xf34714e3, 0x93c8177d), - TOBN(0x37ef5d15, 0xc2376c84), TOBN(0x8315b659, 0x3d1aa783), - TOBN(0x3a75c484, 0xef852a90), TOBN(0x0ba0c58a, 0x16086bd4), - TOBN(0x29688d7a, 0x529a6d48), TOBN(0x9c7f250d, 0xc2f19203), - TOBN(0x123042fb, 0x682e2df9), TOBN(0x2b7587e7, 0xad8121bc), - TOBN(0x30fc0233, 0xe0182a65), TOBN(0xb82ecf87, 0xe3e1128a), - TOBN(0x71682861, 0x93fb098f), TOBN(0x043e21ae, 0x85e9e6a7), - TOBN(0xab5b49d6, 0x66c834ea), TOBN(0x3be43e18, 0x47414287), - TOBN(0xf40fb859, 0x219a2a47), TOBN(0x0e6559e9, 0xcc58df3c), - TOBN(0xfe1dfe8e, 0x0c6615b4), TOBN(0x14abc8fd, 0x56459d70), - TOBN(0x7be0fa8e, 0x05de0386), TOBN(0x8e63ef68, 0xe9035c7c), - TOBN(0x116401b4, 0x53b31e91), TOBN(0x0cba7ad4, 0x4436b4d8), - TOBN(0x9151f9a0, 0x107afd66), TOBN(0xafaca8d0, 0x1f0ee4c4), - TOBN(0x75fe5c1d, 0x9ee9761c), TOBN(0x3497a16b, 0xf0c0588f), - TOBN(0x3ee2bebd, 0x0304804c), TOBN(0xa8fb9a60, 0xc2c990b9), - TOBN(0xd14d32fe, 0x39251114), TOBN(0x36bf25bc, 0xcac73366), - TOBN(0xc9562c66, 0xdba7495c), TOBN(0x324d301b, 0x46ad348b), - TOBN(0x9f46620c, 0xd670407e), TOBN(0x0ea8d4f1, 0xe3733a01), - TOBN(0xd396d532, 0xb0c324e0), TOBN(0x5b211a0e, 0x03c317cd), - TOBN(0x090d7d20, 0x5ffe7b37), TOBN(0x3b7f3efb, 0x1747d2da), - TOBN(0xa2cb525f, 0xb54fc519), TOBN(0x6e220932, 0xf66a971e), - TOBN(0xddc160df, 0xb486d440), TOBN(0x7fcfec46, 0x3fe13465), - TOBN(0x83da7e4e, 0x76e4c151), TOBN(0xd6fa48a1, 0xd8d302b5), - TOBN(0xc6304f26, 0x5872cd88), TOBN(0x806c1d3c, 0x278b90a1), - TOBN(0x3553e725, 0xcaf0bc1c), TOBN(0xff59e603, 0xbb9d8d5c), - TOBN(0xa4550f32, 0x7a0b85dd), TOBN(0xdec5720a, 0x93ecc217), - TOBN(0x0b88b741, 0x69d62213), TOBN(0x7212f245, 0x5b365955), - TOBN(0x20764111, 0xb5cae787), TOBN(0x13cb7f58, 0x1dfd3124), - TOBN(0x2dca77da, 0x1175aefb), TOBN(0xeb75466b, 0xffaae775), - TOBN(0x74d76f3b, 0xdb6cff32), TOBN(0x7440f37a, 0x61fcda9a), - TOBN(0x1bb3ac92, 0xb525028b), TOBN(0x20fbf8f7, 0xa1975f29), - TOBN(0x982692e1, 0xdf83097f), TOBN(0x28738f6c, 0x554b0800), - TOBN(0xdc703717, 0xa2ce2f2f), TOBN(0x7913b93c, 0x40814194), - TOBN(0x04924593, 0x1fe89636), TOBN(0x7b98443f, 0xf78834a6), - TOBN(0x11c6ab01, 0x5114a5a1), TOBN(0x60deb383, 0xffba5f4c), - TOBN(0x4caa54c6, 0x01a982e6), TOBN(0x1dd35e11, 0x3491cd26), - TOBN(0x973c315f, 0x7cbd6b05), TOBN(0xcab00775, 0x52494724), - TOBN(0x04659b1f, 0x6565e15a), TOBN(0xbf30f529, 0x8c8fb026), - TOBN(0xfc21641b, 0xa8a0de37), TOBN(0xe9c7a366, 0xfa5e5114), - TOBN(0xdb849ca5, 0x52f03ad8), TOBN(0xc7e8dbe9, 0x024e35c0), - TOBN(0xa1a2bbac, 0xcfc3c789), TOBN(0xbf733e7d, 0x9c26f262), - TOBN(0x882ffbf5, 0xb8444823), TOBN(0xb7224e88, 0x6bf8483b), - TOBN(0x53023b8b, 0x65bef640), TOBN(0xaabfec91, 0xd4d5f8cd), - TOBN(0xa40e1510, 0x079ea1bd), TOBN(0x1ad9addc, 0xd05d5d26), - TOBN(0xdb3f2eab, 0x13e68d4f), TOBN(0x1cff1ae2, 0x640f803f), - TOBN(0xe0e7b749, 0xd4cee117), TOBN(0x8e9f275b, 0x4036d909), - TOBN(0xce34e31d, 0x8f4d4c38), TOBN(0x22b37f69, 0xd75130fc), - TOBN(0x83e0f1fd, 0xb4014604), TOBN(0xa8ce9919, 0x89415078), - TOBN(0x82375b75, 0x41792efe), TOBN(0x4f59bf5c, 0x97d4515b), - TOBN(0xac4f324f, 0x923a277d), TOBN(0xd9bc9b7d, 0x650f3406), - TOBN(0xc6fa87d1, 0x8a39bc51), TOBN(0x82588530, 0x5ccc108f), - TOBN(0x5ced3c9f, 0x82e4c634), TOBN(0x8efb8314, 0x3a4464f8), - TOBN(0xe706381b, 0x7a1dca25), TOBN(0x6cd15a3c, 0x5a2a412b), - TOBN(0x9347a8fd, 0xbfcd8fb5), TOBN(0x31db2eef, 0x6e54cd22), - TOBN(0xc4aeb11e, 0xf8d8932f), TOBN(0x11e7c1ed, 0x344411af), - TOBN(0x2653050c, 0xdc9a151e), TOBN(0x9edbfc08, 0x3bb0a859), - TOBN(0x926c81c7, 0xfd5691e7), TOBN(0x9c1b2342, 0x6f39019a), - TOBN(0x64a81c8b, 0x7f8474b9), TOBN(0x90657c07, 0x01761819), - TOBN(0x390b3331, 0x55e0375a), TOBN(0xc676c626, 0xb6ebc47d), - TOBN(0x51623247, 0xb7d6dee8), TOBN(0x0948d927, 0x79659313), - TOBN(0x99700161, 0xe9ab35ed), TOBN(0x06cc32b4, 0x8ddde408), - TOBN(0x6f2fd664, 0x061ef338), TOBN(0x1606fa02, 0xc202e9ed), - TOBN(0x55388bc1, 0x929ba99b), TOBN(0xc4428c5e, 0x1e81df69), - TOBN(0xce2028ae, 0xf91b0b2a), TOBN(0xce870a23, 0xf03dfd3f), - TOBN(0x66ec2c87, 0x0affe8ed), TOBN(0xb205fb46, 0x284d0c00), - TOBN(0xbf5dffe7, 0x44cefa48), TOBN(0xb6fc37a8, 0xa19876d7), - TOBN(0xbecfa84c, 0x08b72863), TOBN(0xd7205ff5, 0x2576374f), - TOBN(0x80330d32, 0x8887de41), TOBN(0x5de0df0c, 0x869ea534), - TOBN(0x13f42753, 0x3c56ea17), TOBN(0xeb1f6069, 0x452b1a78), - TOBN(0x50474396, 0xe30ea15c), TOBN(0x575816a1, 0xc1494125), - TOBN(0xbe1ce55b, 0xfe6bb38f), TOBN(0xb901a948, 0x96ae30f7), - TOBN(0xe5af0f08, 0xd8fc3548), TOBN(0x5010b5d0, 0xd73bfd08), - TOBN(0x993d2880, 0x53fe655a), TOBN(0x99f2630b, 0x1c1309fd), - TOBN(0xd8677baf, 0xb4e3b76f), TOBN(0x14e51ddc, 0xb840784b), - TOBN(0x326c750c, 0xbf0092ce), TOBN(0xc83d306b, 0xf528320f), - TOBN(0xc4456715, 0x77d4715c), TOBN(0xd30019f9, 0x6b703235), - TOBN(0x207ccb2e, 0xd669e986), TOBN(0x57c824af, 0xf6dbfc28), - TOBN(0xf0eb532f, 0xd8f92a23), TOBN(0x4a557fd4, 0x9bb98fd2), - TOBN(0xa57acea7, 0xc1e6199a), TOBN(0x0c663820, 0x8b94b1ed), - TOBN(0x9b42be8f, 0xf83a9266), TOBN(0xc7741c97, 0x0101bd45), - TOBN(0x95770c11, 0x07bd9ceb), TOBN(0x1f50250a, 0x8b2e0744), - TOBN(0xf762eec8, 0x1477b654), TOBN(0xc65b900e, 0x15efe59a), - TOBN(0x88c96148, 0x9546a897), TOBN(0x7e8025b3, 0xc30b4d7c), - TOBN(0xae4065ef, 0x12045cf9), TOBN(0x6fcb2caf, 0x9ccce8bd), - TOBN(0x1fa0ba4e, 0xf2cf6525), TOBN(0xf683125d, 0xcb72c312), - TOBN(0xa01da4ea, 0xe312410e), TOBN(0x67e28677, 0x6cd8e830), - TOBN(0xabd95752, 0x98fb3f07), TOBN(0x05f11e11, 0xeef649a5), - TOBN(0xba47faef, 0x9d3472c2), TOBN(0x3adff697, 0xc77d1345), - TOBN(0x4761fa04, 0xdd15afee), TOBN(0x64f1f61a, 0xb9e69462), - TOBN(0xfa691fab, 0x9bfb9093), TOBN(0x3df8ae8f, 0xa1133dfe), - TOBN(0xcd5f8967, 0x58cc710d), TOBN(0xfbb88d50, 0x16c7fe79), - TOBN(0x8e011b4c, 0xe88c50d1), TOBN(0x7532e807, 0xa8771c4f), - TOBN(0x64c78a48, 0xe2278ee4), TOBN(0x0b283e83, 0x3845072a), - TOBN(0x98a6f291, 0x49e69274), TOBN(0xb96e9668, 0x1868b21c), - TOBN(0x38f0adc2, 0xb1a8908e), TOBN(0x90afcff7, 0x1feb829d), - TOBN(0x9915a383, 0x210b0856), TOBN(0xa5a80602, 0xdef04889), - TOBN(0x800e9af9, 0x7c64d509), TOBN(0x81382d0b, 0xb8996f6f), - TOBN(0x490eba53, 0x81927e27), TOBN(0x46c63b32, 0x4af50182), - TOBN(0x784c5fd9, 0xd3ad62ce), TOBN(0xe4fa1870, 0xf8ae8736), - TOBN(0x4ec9d0bc, 0xd7466b25), TOBN(0x84ddbe1a, 0xdb235c65), - TOBN(0x5e2645ee, 0x163c1688), TOBN(0x570bd00e, 0x00eba747), - TOBN(0xfa51b629, 0x128bfa0f), TOBN(0x92fce1bd, 0x6c1d3b68), - TOBN(0x3e7361dc, 0xb66778b1), TOBN(0x9c7d249d, 0x5561d2bb), - TOBN(0xa40b28bf, 0x0bbc6229), TOBN(0x1c83c05e, 0xdfd91497), - TOBN(0x5f9f5154, 0xf083df05), TOBN(0xbac38b3c, 0xeee66c9d), - TOBN(0xf71db7e3, 0xec0dfcfd), TOBN(0xf2ecda8e, 0x8b0a8416), - TOBN(0x52fddd86, 0x7812aa66), TOBN(0x2896ef10, 0x4e6f4272), - TOBN(0xff27186a, 0x0fe9a745), TOBN(0x08249fcd, 0x49ca70db), - TOBN(0x7425a2e6, 0x441cac49), TOBN(0xf4a0885a, 0xece5ff57), - TOBN(0x6e2cb731, 0x7d7ead58), TOBN(0xf96cf7d6, 0x1898d104), - TOBN(0xafe67c9d, 0x4f2c9a89), TOBN(0x89895a50, 0x1c7bf5bc), - TOBN(0xdc7cb8e5, 0x573cecfa), TOBN(0x66497eae, 0xd15f03e6), - TOBN(0x6bc0de69, 0x3f084420), TOBN(0x323b9b36, 0xacd532b0), - TOBN(0xcfed390a, 0x0115a3c1), TOBN(0x9414c40b, 0x2d65ca0e), - TOBN(0x641406bd, 0x2f530c78), TOBN(0x29369a44, 0x833438f2), - TOBN(0x996884f5, 0x903fa271), TOBN(0xe6da0fd2, 0xb9da921e), - TOBN(0xa6f2f269, 0x5db01e54), TOBN(0x1ee3e9bd, 0x6876214e), - TOBN(0xa26e181c, 0xe27a9497), TOBN(0x36d254e4, 0x8e215e04), - TOBN(0x42f32a6c, 0x252cabca), TOBN(0x99481487, 0x80b57614), - TOBN(0x4c4dfe69, 0x40d9cae1), TOBN(0x05869580, 0x11a10f09), - TOBN(0xca287b57, 0x3491b64b), TOBN(0x77862d5d, 0x3fd4a53b), - TOBN(0xbf94856e, 0x50349126), TOBN(0x2be30bd1, 0x71c5268f), - TOBN(0x10393f19, 0xcbb650a6), TOBN(0x639531fe, 0x778cf9fd), - TOBN(0x02556a11, 0xb2935359), TOBN(0xda38aa96, 0xaf8c126e), - TOBN(0x47dbe6c2, 0x0960167f), TOBN(0x37bbabb6, 0x501901cd), - TOBN(0xb6e979e0, 0x2c947778), TOBN(0xd69a5175, 0x7a1a1dc6), - TOBN(0xc3ed5095, 0x9d9faf0c), TOBN(0x4dd9c096, 0x1d5fa5f0), - TOBN(0xa0c4304d, 0x64f16ea8), TOBN(0x8b1cac16, 0x7e718623), - TOBN(0x0b576546, 0x7c67f03e), TOBN(0x559cf5ad, 0xcbd88c01), - TOBN(0x074877bb, 0x0e2af19a), TOBN(0x1f717ec1, 0xa1228c92), - TOBN(0x70bcb800, 0x326e8920), TOBN(0xec6e2c5c, 0x4f312804), - TOBN(0x426aea7d, 0x3fca4752), TOBN(0xf12c0949, 0x2211f62a), - TOBN(0x24beecd8, 0x7be7b6b5), TOBN(0xb77eaf4c, 0x36d7a27d), - TOBN(0x154c2781, 0xfda78fd3), TOBN(0x848a83b0, 0x264eeabe), - TOBN(0x81287ef0, 0x4ffe2bc4), TOBN(0x7b6d88c6, 0xb6b6fc2a), - TOBN(0x805fb947, 0xce417d99), TOBN(0x4b93dcc3, 0x8b916cc4), - TOBN(0x72e65bb3, 0x21273323), TOBN(0xbcc1badd, 0x6ea9886e), - TOBN(0x0e223011, 0x4bc5ee85), TOBN(0xa561be74, 0xc18ee1e4), - TOBN(0x762fd2d4, 0xa6bcf1f1), TOBN(0x50e6a5a4, 0x95231489), - TOBN(0xca96001f, 0xa00b500b), TOBN(0x5c098cfc, 0x5d7dcdf5), - TOBN(0xa64e2d2e, 0x8c446a85), TOBN(0xbae9bcf1, 0x971f3c62), - TOBN(0x4ec22683, 0x8435a2c5), TOBN(0x8ceaed6c, 0x4bad4643), - TOBN(0xe9f8fb47, 0xccccf4e3), TOBN(0xbd4f3fa4, 0x1ce3b21e), - TOBN(0xd79fb110, 0xa3db3292), TOBN(0xe28a37da, 0xb536c66a), - TOBN(0x279ce87b, 0x8e49e6a9), TOBN(0x70ccfe8d, 0xfdcec8e3), - TOBN(0x2193e4e0, 0x3ba464b2), TOBN(0x0f39d60e, 0xaca9a398), - TOBN(0x7d7932af, 0xf82c12ab), TOBN(0xd8ff50ed, 0x91e7e0f7), - TOBN(0xea961058, 0xfa28a7e0), TOBN(0xc726cf25, 0x0bf5ec74), - TOBN(0xe74d55c8, 0xdb229666), TOBN(0x0bd9abbf, 0xa57f5799), - TOBN(0x7479ef07, 0x4dfc47b3), TOBN(0xd9c65fc3, 0x0c52f91d), - TOBN(0x8e0283fe, 0x36a8bde2), TOBN(0xa32a8b5e, 0x7d4b7280), - TOBN(0x6a677c61, 0x12e83233), TOBN(0x0fbb3512, 0xdcc9bf28), - TOBN(0x562e8ea5, 0x0d780f61), TOBN(0x0db8b22b, 0x1dc4e89c), - TOBN(0x0a6fd1fb, 0x89be0144), TOBN(0x8c77d246, 0xca57113b), - TOBN(0x4639075d, 0xff09c91c), TOBN(0x5b47b17f, 0x5060824c), - TOBN(0x58aea2b0, 0x16287b52), TOBN(0xa1343520, 0xd0cd8eb0), - TOBN(0x6148b4d0, 0xc5d58573), TOBN(0xdd2b6170, 0x291c68ae), - TOBN(0xa61b3929, 0x1da3b3b7), TOBN(0x5f946d79, 0x08c4ac10), - TOBN(0x4105d4a5, 0x7217d583), TOBN(0x5061da3d, 0x25e6de5e), - TOBN(0x3113940d, 0xec1b4991), TOBN(0xf12195e1, 0x36f485ae), - TOBN(0xa7507fb2, 0x731a2ee0), TOBN(0x95057a8e, 0x6e9e196e), - TOBN(0xa3c2c911, 0x2e130136), TOBN(0x97dfbb36, 0x33c60d15), - TOBN(0xcaf3c581, 0xb300ee2b), TOBN(0x77f25d90, 0xf4bac8b8), - TOBN(0xdb1c4f98, 0x6d840cd6), TOBN(0x471d62c0, 0xe634288c), - TOBN(0x8ec2f85e, 0xcec8a161), TOBN(0x41f37cbc, 0xfa6f4ae2), - TOBN(0x6793a20f, 0x4b709985), TOBN(0x7a7bd33b, 0xefa8985b), - TOBN(0x2c6a3fbd, 0x938e6446), TOBN(0x19042619, 0x2a8d47c1), - TOBN(0x16848667, 0xcc36975f), TOBN(0x02acf168, 0x9d5f1dfb), - TOBN(0x62d41ad4, 0x613baa94), TOBN(0xb56fbb92, 0x9f684670), - TOBN(0xce610d0d, 0xe9e40569), TOBN(0x7b99c65f, 0x35489fef), - TOBN(0x0c88ad1b, 0x3df18b97), TOBN(0x81b7d9be, 0x5d0e9edb), - TOBN(0xd85218c0, 0xc716cc0a), TOBN(0xf4b5ff90, 0x85691c49), - TOBN(0xa4fd666b, 0xce356ac6), TOBN(0x17c72895, 0x4b327a7a), - TOBN(0xf93d5085, 0xda6be7de), TOBN(0xff71530e, 0x3301d34e), - TOBN(0x4cd96442, 0xd8f448e8), TOBN(0x9283d331, 0x2ed18ffa), - TOBN(0x4d33dd99, 0x2a849870), TOBN(0xa716964b, 0x41576335), - TOBN(0xff5e3a9b, 0x179be0e5), TOBN(0x5b9d6b1b, 0x83b13632), - TOBN(0x3b8bd7d4, 0xa52f313b), TOBN(0xc9dd95a0, 0x637a4660), - TOBN(0x30035962, 0x0b3e218f), TOBN(0xce1481a3, 0xc7b28a3c), - TOBN(0xab41b43a, 0x43228d83), TOBN(0x24ae1c30, 0x4ad63f99), - TOBN(0x8e525f1a, 0x46a51229), TOBN(0x14af860f, 0xcd26d2b4), - TOBN(0xd6baef61, 0x3f714aa1), TOBN(0xf51865ad, 0xeb78795e), - TOBN(0xd3e21fce, 0xe6a9d694), TOBN(0x82ceb1dd, 0x8a37b527)}}; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back deleted file mode 100644 index bcb05f674..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back +++ /dev/null @@ -1,9503 +0,0 @@ -/* Copyright (c) 2015, Intel Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -// This is the precomputed constant time access table for the code in -// p256-x86_64.c, for the default generator. The table consists of 37 -// subtables, each subtable contains 64 affine points. The affine points are -// encoded as eight uint64's, four for the x coordinate and four for the y. -// Both values are in little-endian order. There are 37 tables because a -// signed, 6-bit wNAF form of the scalar is used and ceil(256/(6 + 1)) = 37. -// Within each table there are 64 values because the 6-bit wNAF value can take -// 64 values, ignoring the sign bit, which is implemented by performing a -// negation of the affine point when required. We would like to align it to 2MB -// in order to increase the chances of using a large page but that appears to -// lead to invalid ELF files being produced. - -// This file is generated by make_p256-x86_64-table.go. - -static const alignas(4096) BN_ULONG - ecp_nistz256_precomputed[37][64 * sizeof(P256_POINT_AFFINE) / - sizeof(BN_ULONG)] = { - {TOBN(0x79e730d4, 0x18a9143c), TOBN(0x75ba95fc, 0x5fedb601), - TOBN(0x79fb732b, 0x77622510), TOBN(0x18905f76, 0xa53755c6), - TOBN(0xddf25357, 0xce95560a), TOBN(0x8b4ab8e4, 0xba19e45c), - TOBN(0xd2e88688, 0xdd21f325), TOBN(0x8571ff18, 0x25885d85), - TOBN(0x850046d4, 0x10ddd64d), TOBN(0xaa6ae3c1, 0xa433827d), - TOBN(0x73220503, 0x8d1490d9), TOBN(0xf6bb32e4, 0x3dcf3a3b), - TOBN(0x2f3648d3, 0x61bee1a5), TOBN(0x152cd7cb, 0xeb236ff8), - TOBN(0x19a8fb0e, 0x92042dbe), TOBN(0x78c57751, 0x0a5b8a3b), - TOBN(0xffac3f90, 0x4eebc127), TOBN(0xb027f84a, 0x087d81fb), - TOBN(0x66ad77dd, 0x87cbbc98), TOBN(0x26936a3f, 0xb6ff747e), - TOBN(0xb04c5c1f, 0xc983a7eb), TOBN(0x583e47ad, 0x0861fe1a), - TOBN(0x78820831, 0x1a2ee98e), TOBN(0xd5f06a29, 0xe587cc07), - TOBN(0x74b0b50d, 0x46918dcc), TOBN(0x4650a6ed, 0xc623c173), - TOBN(0x0cdaacac, 0xe8100af2), TOBN(0x577362f5, 0x41b0176b), - TOBN(0x2d96f24c, 0xe4cbaba6), TOBN(0x17628471, 0xfad6f447), - TOBN(0x6b6c36de, 0xe5ddd22e), TOBN(0x84b14c39, 0x4c5ab863), - TOBN(0xbe1b8aae, 0xc45c61f5), TOBN(0x90ec649a, 0x94b9537d), - TOBN(0x941cb5aa, 0xd076c20c), TOBN(0xc9079605, 0x890523c8), - TOBN(0xeb309b4a, 0xe7ba4f10), TOBN(0x73c568ef, 0xe5eb882b), - TOBN(0x3540a987, 0x7e7a1f68), TOBN(0x73a076bb, 0x2dd1e916), - TOBN(0x40394737, 0x3e77664a), TOBN(0x55ae744f, 0x346cee3e), - TOBN(0xd50a961a, 0x5b17a3ad), TOBN(0x13074b59, 0x54213673), - TOBN(0x93d36220, 0xd377e44b), TOBN(0x299c2b53, 0xadff14b5), - TOBN(0xf424d44c, 0xef639f11), TOBN(0xa4c9916d, 0x4a07f75f), - TOBN(0x0746354e, 0xa0173b4f), TOBN(0x2bd20213, 0xd23c00f7), - TOBN(0xf43eaab5, 0x0c23bb08), TOBN(0x13ba5119, 0xc3123e03), - TOBN(0x2847d030, 0x3f5b9d4d), TOBN(0x6742f2f2, 0x5da67bdd), - TOBN(0xef933bdc, 0x77c94195), TOBN(0xeaedd915, 0x6e240867), - TOBN(0x27f14cd1, 0x9499a78f), TOBN(0x462ab5c5, 0x6f9b3455), - TOBN(0x8f90f02a, 0xf02cfc6b), TOBN(0xb763891e, 0xb265230d), - TOBN(0xf59da3a9, 0x532d4977), TOBN(0x21e3327d, 0xcf9eba15), - TOBN(0x123c7b84, 0xbe60bbf0), TOBN(0x56ec12f2, 0x7706df76), - TOBN(0x75c96e8f, 0x264e20e8), TOBN(0xabe6bfed, 0x59a7a841), - TOBN(0x2cc09c04, 0x44c8eb00), TOBN(0xe05b3080, 0xf0c4e16b), - TOBN(0x1eb7777a, 0xa45f3314), TOBN(0x56af7bed, 0xce5d45e3), - TOBN(0x2b6e019a, 0x88b12f1a), TOBN(0x086659cd, 0xfd835f9b), - TOBN(0x2c18dbd1, 0x9dc21ec8), TOBN(0x98f9868a, 0x0fcf8139), - TOBN(0x737d2cd6, 0x48250b49), TOBN(0xcc61c947, 0x24b3428f), - TOBN(0x0c2b4078, 0x80dd9e76), TOBN(0xc43a8991, 0x383fbe08), - TOBN(0x5f7d2d65, 0x779be5d2), TOBN(0x78719a54, 0xeb3b4ab5), - TOBN(0xea7d260a, 0x6245e404), TOBN(0x9de40795, 0x6e7fdfe0), - TOBN(0x1ff3a415, 0x8dac1ab5), TOBN(0x3e7090f1, 0x649c9073), - TOBN(0x1a768561, 0x2b944e88), TOBN(0x250f939e, 0xe57f61c8), - TOBN(0x0c0daa89, 0x1ead643d), TOBN(0x68930023, 0xe125b88e), - TOBN(0x04b71aa7, 0xd2697768), TOBN(0xabdedef5, 0xca345a33), - TOBN(0x2409d29d, 0xee37385e), TOBN(0x4ee1df77, 0xcb83e156), - TOBN(0x0cac12d9, 0x1cbb5b43), TOBN(0x170ed2f6, 0xca895637), - TOBN(0x28228cfa, 0x8ade6d66), TOBN(0x7ff57c95, 0x53238aca), - TOBN(0xccc42563, 0x4b2ed709), TOBN(0x0e356769, 0x856fd30d), - TOBN(0xbcbcd43f, 0x559e9811), TOBN(0x738477ac, 0x5395b759), - TOBN(0x35752b90, 0xc00ee17f), TOBN(0x68748390, 0x742ed2e3), - TOBN(0x7cd06422, 0xbd1f5bc1), TOBN(0xfbc08769, 0xc9e7b797), - TOBN(0xa242a35b, 0xb0cf664a), TOBN(0x126e48f7, 0x7f9707e3), - TOBN(0x1717bf54, 0xc6832660), TOBN(0xfaae7332, 0xfd12c72e), - TOBN(0x27b52db7, 0x995d586b), TOBN(0xbe29569e, 0x832237c2), - TOBN(0xe8e4193e, 0x2a65e7db), TOBN(0x152706dc, 0x2eaa1bbb), - TOBN(0x72bcd8b7, 0xbc60055b), TOBN(0x03cc23ee, 0x56e27e4b), - TOBN(0xee337424, 0xe4819370), TOBN(0xe2aa0e43, 0x0ad3da09), - TOBN(0x40b8524f, 0x6383c45d), TOBN(0xd7663554, 0x42a41b25), - TOBN(0x64efa6de, 0x778a4797), TOBN(0x2042170a, 0x7079adf4), - TOBN(0x808b0b65, 0x0bc6fb80), TOBN(0x5882e075, 0x3ffe2e6b), - TOBN(0xd5ef2f7c, 0x2c83f549), TOBN(0x54d63c80, 0x9103b723), - TOBN(0xf2f11bd6, 0x52a23f9b), TOBN(0x3670c319, 0x4b0b6587), - TOBN(0x55c4623b, 0xb1580e9e), TOBN(0x64edf7b2, 0x01efe220), - TOBN(0x97091dcb, 0xd53c5c9d), TOBN(0xf17624b6, 0xac0a177b), - TOBN(0xb0f13975, 0x2cfe2dff), TOBN(0xc1a35c0a, 0x6c7a574e), - TOBN(0x227d3146, 0x93e79987), TOBN(0x0575bf30, 0xe89cb80e), - TOBN(0x2f4e247f, 0x0d1883bb), TOBN(0xebd51226, 0x3274c3d0), - TOBN(0x5f3e51c8, 0x56ada97a), TOBN(0x4afc964d, 0x8f8b403e), - TOBN(0xa6f247ab, 0x412e2979), TOBN(0x675abd1b, 0x6f80ebda), - TOBN(0x66a2bd72, 0x5e485a1d), TOBN(0x4b2a5caf, 0x8f4f0b3c), - TOBN(0x2626927f, 0x1b847bba), TOBN(0x6c6fc7d9, 0x0502394d), - TOBN(0xfea912ba, 0xa5659ae8), TOBN(0x68363aba, 0x25e1a16e), - TOBN(0xb8842277, 0x752c41ac), TOBN(0xfe545c28, 0x2897c3fc), - TOBN(0x2d36e9e7, 0xdc4c696b), TOBN(0x5806244a, 0xfba977c5), - TOBN(0x85665e9b, 0xe39508c1), TOBN(0xf720ee25, 0x6d12597b), - TOBN(0x8a979129, 0xd2337a31), TOBN(0x5916868f, 0x0f862bdc), - TOBN(0x048099d9, 0x5dd283ba), TOBN(0xe2d1eeb6, 0xfe5bfb4e), - TOBN(0x82ef1c41, 0x7884005d), TOBN(0xa2d4ec17, 0xffffcbae), - TOBN(0x9161c53f, 0x8aa95e66), TOBN(0x5ee104e1, 0xc5fee0d0), - TOBN(0x562e4cec, 0xc135b208), TOBN(0x74e1b265, 0x4783f47d), - TOBN(0x6d2a506c, 0x5a3f3b30), TOBN(0xecead9f4, 0xc16762fc), - TOBN(0xf29dd4b2, 0xe286e5b9), TOBN(0x1b0fadc0, 0x83bb3c61), - TOBN(0x7a75023e, 0x7fac29a4), TOBN(0xc086d5f1, 0xc9477fa3), - TOBN(0x0fc61135, 0x2f6f3076), TOBN(0xc99ffa23, 0xe3912a9a), - TOBN(0x6a0b0685, 0xd2f8ba3d), TOBN(0xfdc777e8, 0xe93358a4), - TOBN(0x94a787bb, 0x35415f04), TOBN(0x640c2d6a, 0x4d23fea4), - TOBN(0x9de917da, 0x153a35b5), TOBN(0x793e8d07, 0x5d5cd074), - TOBN(0xf4f87653, 0x2de45068), TOBN(0x37c7a7e8, 0x9e2e1f6e), - TOBN(0xd0825fa2, 0xa3584069), TOBN(0xaf2cea7c, 0x1727bf42), - TOBN(0x0360a4fb, 0x9e4785a9), TOBN(0xe5fda49c, 0x27299f4a), - TOBN(0x48068e13, 0x71ac2f71), TOBN(0x83d0687b, 0x9077666f), - TOBN(0x6d3883b2, 0x15d02819), TOBN(0x6d0d7550, 0x40dd9a35), - TOBN(0x61d7cbf9, 0x1d2b469f), TOBN(0xf97b232f, 0x2efc3115), - TOBN(0xa551d750, 0xb24bcbc7), TOBN(0x11ea4949, 0x88a1e356), - TOBN(0x7669f031, 0x93cb7501), TOBN(0x595dc55e, 0xca737b8a), - TOBN(0xa4a319ac, 0xd837879f), TOBN(0x6fc1b49e, 0xed6b67b0), - TOBN(0xe3959933, 0x32f1f3af), TOBN(0x966742eb, 0x65432a2e), - TOBN(0x4b8dc9fe, 0xb4966228), TOBN(0x96cc6312, 0x43f43950), - TOBN(0x12068859, 0xc9b731ee), TOBN(0x7b948dc3, 0x56f79968), - TOBN(0x61e4ad32, 0xed1f8008), TOBN(0xe6c9267a, 0xd8b17538), - TOBN(0x1ac7c5eb, 0x857ff6fb), TOBN(0x994baaa8, 0x55f2fb10), - TOBN(0x84cf14e1, 0x1d248018), TOBN(0x5a39898b, 0x628ac508), - TOBN(0x14fde97b, 0x5fa944f5), TOBN(0xed178030, 0xd12e5ac7), - TOBN(0x042c2af4, 0x97e2feb4), TOBN(0xd36a42d7, 0xaebf7313), - TOBN(0x49d2c9eb, 0x084ffdd7), TOBN(0x9f8aa54b, 0x2ef7c76a), - TOBN(0x9200b7ba, 0x09895e70), TOBN(0x3bd0c66f, 0xddb7fb58), - TOBN(0x2d97d108, 0x78eb4cbb), TOBN(0x2d431068, 0xd84bde31), - TOBN(0x4b523eb7, 0x172ccd1f), TOBN(0x7323cb28, 0x30a6a892), - TOBN(0x97082ec0, 0xcfe153eb), TOBN(0xe97f6b6a, 0xf2aadb97), - TOBN(0x1d3d393e, 0xd1a83da1), TOBN(0xa6a7f9c7, 0x804b2a68), - TOBN(0x4a688b48, 0x2d0cb71e), TOBN(0xa9b4cc5f, 0x40585278), - TOBN(0x5e5db46a, 0xcb66e132), TOBN(0xf1be963a, 0x0d925880), - TOBN(0x944a7027, 0x0317b9e2), TOBN(0xe266f959, 0x48603d48), - TOBN(0x98db6673, 0x5c208899), TOBN(0x90472447, 0xa2fb18a3), - TOBN(0x8a966939, 0x777c619f), TOBN(0x3798142a, 0x2a3be21b), - TOBN(0xb4241cb1, 0x3298b343), TOBN(0xa3a14e49, 0xb44f65a1), - TOBN(0xc5f4d6cd, 0x3ac77acd), TOBN(0xd0288cb5, 0x52b6fc3c), - TOBN(0xd5cc8c2f, 0x1c040abc), TOBN(0xb675511e, 0x06bf9b4a), - TOBN(0xd667da37, 0x9b3aa441), TOBN(0x460d45ce, 0x51601f72), - TOBN(0xe2f73c69, 0x6755ff89), TOBN(0xdd3cf7e7, 0x473017e6), - TOBN(0x8ef5689d, 0x3cf7600d), TOBN(0x948dc4f8, 0xb1fc87b4), - TOBN(0xd9e9fe81, 0x4ea53299), TOBN(0x2d921ca2, 0x98eb6028), - TOBN(0xfaecedfd, 0x0c9803fc), TOBN(0xf38ae891, 0x4d7b4745), - TOBN(0xd8c5fccf, 0xc5e3a3d8), TOBN(0xbefd904c, 0x4079dfbf), - TOBN(0xbc6d6a58, 0xfead0197), TOBN(0x39227077, 0x695532a4), - TOBN(0x09e23e6d, 0xdbef42f5), TOBN(0x7e449b64, 0x480a9908), - TOBN(0x7b969c1a, 0xad9a2e40), TOBN(0x6231d792, 0x9591c2a4), - TOBN(0x87151456, 0x0f664534), TOBN(0x85ceae7c, 0x4b68f103), - TOBN(0xac09c4ae, 0x65578ab9), TOBN(0x33ec6868, 0xf044b10c), - TOBN(0x6ac4832b, 0x3a8ec1f1), TOBN(0x5509d128, 0x5847d5ef), - TOBN(0xf909604f, 0x763f1574), TOBN(0xb16c4303, 0xc32f63c4), - TOBN(0xb6ab2014, 0x7ca23cd3), TOBN(0xcaa7a5c6, 0xa391849d), - TOBN(0x5b0673a3, 0x75678d94), TOBN(0xc982ddd4, 0xdd303e64), - TOBN(0xfd7b000b, 0x5db6f971), TOBN(0xbba2cb1f, 0x6f876f92), - TOBN(0xc77332a3, 0x3c569426), TOBN(0xa159100c, 0x570d74f8), - TOBN(0xfd16847f, 0xdec67ef5), TOBN(0x742ee464, 0x233e76b7), - TOBN(0x0b8e4134, 0xefc2b4c8), TOBN(0xca640b86, 0x42a3e521), - TOBN(0x653a0190, 0x8ceb6aa9), TOBN(0x313c300c, 0x547852d5), - TOBN(0x24e4ab12, 0x6b237af7), TOBN(0x2ba90162, 0x8bb47af8), - TOBN(0x3d5e58d6, 0xa8219bb7), TOBN(0xc691d0bd, 0x1b06c57f), - TOBN(0x0ae4cb10, 0xd257576e), TOBN(0x3569656c, 0xd54a3dc3), - TOBN(0xe5ebaebd, 0x94cda03a), TOBN(0x934e82d3, 0x162bfe13), - TOBN(0x450ac0ba, 0xe251a0c6), TOBN(0x480b9e11, 0xdd6da526), - TOBN(0x00467bc5, 0x8cce08b5), TOBN(0xb636458c, 0x7f178d55), - TOBN(0xc5748bae, 0xa677d806), TOBN(0x2763a387, 0xdfa394eb), - TOBN(0xa12b448a, 0x7d3cebb6), TOBN(0xe7adda3e, 0x6f20d850), - TOBN(0xf63ebce5, 0x1558462c), TOBN(0x58b36143, 0x620088a8), - TOBN(0x8a2cc3ca, 0x4d63c0ee), TOBN(0x51233117, 0x0fe948ce), - TOBN(0x7463fd85, 0x222ef33b), TOBN(0xadf0c7dc, 0x7c603d6c), - TOBN(0x0ec32d3b, 0xfe7765e5), TOBN(0xccaab359, 0xbf380409), - TOBN(0xbdaa84d6, 0x8e59319c), TOBN(0xd9a4c280, 0x9c80c34d), - TOBN(0xa9d89488, 0xa059c142), TOBN(0x6f5ae714, 0xff0b9346), - TOBN(0x068f237d, 0x16fb3664), TOBN(0x5853e4c4, 0x363186ac), - TOBN(0xe2d87d23, 0x63c52f98), TOBN(0x2ec4a766, 0x81828876), - TOBN(0x47b864fa, 0xe14e7b1c), TOBN(0x0c0bc0e5, 0x69192408), - TOBN(0xe4d7681d, 0xb82e9f3e), TOBN(0x83200f0b, 0xdf25e13c), - TOBN(0x8909984c, 0x66f27280), TOBN(0x462d7b00, 0x75f73227), - TOBN(0xd90ba188, 0xf2651798), TOBN(0x74c6e18c, 0x36ab1c34), - TOBN(0xab256ea3, 0x5ef54359), TOBN(0x03466612, 0xd1aa702f), - TOBN(0x624d6049, 0x2ed22e91), TOBN(0x6fdfe0b5, 0x6f072822), - TOBN(0xeeca1115, 0x39ce2271), TOBN(0x98100a4f, 0xdb01614f), - TOBN(0xb6b0daa2, 0xa35c628f), TOBN(0xb6f94d2e, 0xc87e9a47), - TOBN(0xc6773259, 0x1d57d9ce), TOBN(0xf70bfeec, 0x03884a7b), - TOBN(0x5fb35ccf, 0xed2bad01), TOBN(0xa155cbe3, 0x1da6a5c7), - TOBN(0xc2e2594c, 0x30a92f8f), TOBN(0x649c89ce, 0x5bfafe43), - TOBN(0xd158667d, 0xe9ff257a), TOBN(0x9b359611, 0xf32c50ae), - TOBN(0x4b00b20b, 0x906014cf), TOBN(0xf3a8cfe3, 0x89bc7d3d), - TOBN(0x4ff23ffd, 0x248a7d06), TOBN(0x80c5bfb4, 0x878873fa), - TOBN(0xb7d9ad90, 0x05745981), TOBN(0x179c85db, 0x3db01994), - TOBN(0xba41b062, 0x61a6966c), TOBN(0x4d82d052, 0xeadce5a8), - TOBN(0x9e91cd3b, 0xa5e6a318), TOBN(0x47795f4f, 0x95b2dda0), - TOBN(0xecfd7c1f, 0xd55a897c), TOBN(0x009194ab, 0xb29110fb), - TOBN(0x5f0e2046, 0xe381d3b0), TOBN(0x5f3425f6, 0xa98dd291), - TOBN(0xbfa06687, 0x730d50da), TOBN(0x0423446c, 0x4b083b7f), - TOBN(0x397a247d, 0xd69d3417), TOBN(0xeb629f90, 0x387ba42a), - TOBN(0x1ee426cc, 0xd5cd79bf), TOBN(0x0032940b, 0x946c6e18), - TOBN(0x1b1e8ae0, 0x57477f58), TOBN(0xe94f7d34, 0x6d823278), - TOBN(0xc747cb96, 0x782ba21a), TOBN(0xc5254469, 0xf72b33a5), - TOBN(0x772ef6de, 0xc7f80c81), TOBN(0xd73acbfe, 0x2cd9e6b5), - TOBN(0x4075b5b1, 0x49ee90d9), TOBN(0x785c339a, 0xa06e9eba), - TOBN(0xa1030d5b, 0xabf825e0), TOBN(0xcec684c3, 0xa42931dc), - TOBN(0x42ab62c9, 0xc1586e63), TOBN(0x45431d66, 0x5ab43f2b), - TOBN(0x57c8b2c0, 0x55f7835d), TOBN(0x033da338, 0xc1b7f865), - TOBN(0x283c7513, 0xcaa76097), TOBN(0x0a624fa9, 0x36c83906), - TOBN(0x6b20afec, 0x715af2c7), TOBN(0x4b969974, 0xeba78bfd), - TOBN(0x220755cc, 0xd921d60e), TOBN(0x9b944e10, 0x7baeca13), - TOBN(0x04819d51, 0x5ded93d4), TOBN(0x9bbff86e, 0x6dddfd27), - TOBN(0x6b344130, 0x77adc612), TOBN(0xa7496529, 0xbbd803a0), - TOBN(0x1a1baaa7, 0x6d8805bd), TOBN(0xc8403902, 0x470343ad), - TOBN(0x39f59f66, 0x175adff1), TOBN(0x0b26d7fb, 0xb7d8c5b7), - TOBN(0xa875f5ce, 0x529d75e3), TOBN(0x85efc7e9, 0x41325cc2), - TOBN(0x21950b42, 0x1ff6acd3), TOBN(0xffe70484, 0x53dc6909), - TOBN(0xff4cd0b2, 0x28766127), TOBN(0xabdbe608, 0x4fb7db2b), - TOBN(0x837c9228, 0x5e1109e8), TOBN(0x26147d27, 0xf4645b5a), - TOBN(0x4d78f592, 0xf7818ed8), TOBN(0xd394077e, 0xf247fa36), - TOBN(0x0fb9c2d0, 0x488c171a), TOBN(0xa78bfbaa, 0x13685278), - TOBN(0xedfbe268, 0xd5b1fa6a), TOBN(0x0dceb8db, 0x2b7eaba7), - TOBN(0xbf9e8089, 0x9ae2b710), TOBN(0xefde7ae6, 0xa4449c96), - TOBN(0x43b7716b, 0xcc143a46), TOBN(0xd7d34194, 0xc3628c13), - TOBN(0x508cec1c, 0x3b3f64c9), TOBN(0xe20bc0ba, 0x1e5edf3f), - TOBN(0xda1deb85, 0x2f4318d4), TOBN(0xd20ebe0d, 0x5c3fa443), - TOBN(0x370b4ea7, 0x73241ea3), TOBN(0x61f1511c, 0x5e1a5f65), - TOBN(0x99a5e23d, 0x82681c62), TOBN(0xd731e383, 0xa2f54c2d), - TOBN(0x2692f36e, 0x83445904), TOBN(0x2e0ec469, 0xaf45f9c0), - TOBN(0x905a3201, 0xc67528b7), TOBN(0x88f77f34, 0xd0e5e542), - TOBN(0xf67a8d29, 0x5864687c), TOBN(0x23b92eae, 0x22df3562), - TOBN(0x5c27014b, 0x9bbec39e), TOBN(0x7ef2f226, 0x9c0f0f8d), - TOBN(0x97359638, 0x546c4d8d), TOBN(0x5f9c3fc4, 0x92f24679), - TOBN(0x912e8bed, 0xa8c8acd9), TOBN(0xec3a318d, 0x306634b0), - TOBN(0x80167f41, 0xc31cb264), TOBN(0x3db82f6f, 0x522113f2), - TOBN(0xb155bcd2, 0xdcafe197), TOBN(0xfba1da59, 0x43465283), - TOBN(0xa0425b8e, 0xb212cf53), TOBN(0x4f2e512e, 0xf8557c5f), - TOBN(0xc1286ff9, 0x25c4d56c), TOBN(0xbb8a0fea, 0xee26c851), - TOBN(0xc28f70d2, 0xe7d6107e), TOBN(0x7ee0c444, 0xe76265aa), - TOBN(0x3df277a4, 0x1d1936b1), TOBN(0x1a556e3f, 0xea9595eb), - TOBN(0x258bbbf9, 0xe7305683), TOBN(0x31eea5bf, 0x07ef5be6), - TOBN(0x0deb0e4a, 0x46c814c1), TOBN(0x5cee8449, 0xa7b730dd), - TOBN(0xeab495c5, 0xa0182bde), TOBN(0xee759f87, 0x9e27a6b4), - TOBN(0xc2cf6a68, 0x80e518ca), TOBN(0x25e8013f, 0xf14cf3f4), - TOBN(0x8fc44140, 0x7e8d7a14), TOBN(0xbb1ff3ca, 0x9556f36a), - TOBN(0x6a844385, 0x14600044), TOBN(0xba3f0c4a, 0x7451ae63), - TOBN(0xdfcac25b, 0x1f9af32a), TOBN(0x01e0db86, 0xb1f2214b), - TOBN(0x4e9a5bc2, 0xa4b596ac), TOBN(0x83927681, 0x026c2c08), - TOBN(0x3ec832e7, 0x7acaca28), TOBN(0x1bfeea57, 0xc7385b29), - TOBN(0x068212e3, 0xfd1eaf38), TOBN(0xc1329830, 0x6acf8ccc), - TOBN(0xb909f2db, 0x2aac9e59), TOBN(0x5748060d, 0xb661782a), - TOBN(0xc5ab2632, 0xc79b7a01), TOBN(0xda44c6c6, 0x00017626), - TOBN(0xf26c00e8, 0xa7ea82f0), TOBN(0x99cac80d, 0xe4299aaf), - TOBN(0xd66fe3b6, 0x7ed78be1), TOBN(0x305f725f, 0x648d02cd), - TOBN(0x33ed1bc4, 0x623fb21b), TOBN(0xfa70533e, 0x7a6319ad), - TOBN(0x17ab562d, 0xbe5ffb3e), TOBN(0x06374994, 0x56674741), - TOBN(0x69d44ed6, 0x5c46aa8e), TOBN(0x2100d5d3, 0xa8d063d1), - TOBN(0xcb9727ea, 0xa2d17c36), TOBN(0x4c2bab1b, 0x8add53b7), - TOBN(0xa084e90c, 0x15426704), TOBN(0x778afcd3, 0xa837ebea), - TOBN(0x6651f701, 0x7ce477f8), TOBN(0xa0624998, 0x46fb7a8b), - TOBN(0xdc1e6828, 0xed8a6e19), TOBN(0x33fc2336, 0x4189d9c7), - TOBN(0x026f8fe2, 0x671c39bc), TOBN(0xd40c4ccd, 0xbc6f9915), - TOBN(0xafa135bb, 0xf80e75ca), TOBN(0x12c651a0, 0x22adff2c), - TOBN(0xc40a04bd, 0x4f51ad96), TOBN(0x04820109, 0xbbe4e832), - TOBN(0x3667eb1a, 0x7f4c04cc), TOBN(0x59556621, 0xa9404f84), - TOBN(0x71cdf653, 0x7eceb50a), TOBN(0x994a44a6, 0x9b8335fa), - TOBN(0xd7faf819, 0xdbeb9b69), TOBN(0x473c5680, 0xeed4350d), - TOBN(0xb6658466, 0xda44bba2), TOBN(0x0d1bc780, 0x872bdbf3), - TOBN(0xe535f175, 0xa1962f91), TOBN(0x6ed7e061, 0xed58f5a7), - TOBN(0x177aa4c0, 0x2089a233), TOBN(0x0dbcb03a, 0xe539b413), - TOBN(0xe3dc424e, 0xbb32e38e), TOBN(0x6472e5ef, 0x6806701e), - TOBN(0xdd47ff98, 0x814be9ee), TOBN(0x6b60cfff, 0x35ace009), - TOBN(0xb8d3d931, 0x9ff91fe5), TOBN(0x039c4800, 0xf0518eed), - TOBN(0x95c37632, 0x9182cb26), TOBN(0x0763a434, 0x82fc568d), - TOBN(0x707c04d5, 0x383e76ba), TOBN(0xac98b930, 0x824e8197), - TOBN(0x92bf7c8f, 0x91230de0), TOBN(0x90876a01, 0x40959b70), - TOBN(0xdb6d96f3, 0x05968b80), TOBN(0x380a0913, 0x089f73b9), - TOBN(0x7da70b83, 0xc2c61e01), TOBN(0x95fb8394, 0x569b38c7), - TOBN(0x9a3c6512, 0x80edfe2f), TOBN(0x8f726bb9, 0x8faeaf82), - TOBN(0x8010a4a0, 0x78424bf8), TOBN(0x29672044, 0x0e844970)}, - {TOBN(0x63c5cb81, 0x7a2ad62a), TOBN(0x7ef2b6b9, 0xac62ff54), - TOBN(0x3749bba4, 0xb3ad9db5), TOBN(0xad311f2c, 0x46d5a617), - TOBN(0xb77a8087, 0xc2ff3b6d), TOBN(0xb46feaf3, 0x367834ff), - TOBN(0xf8aa266d, 0x75d6b138), TOBN(0xfa38d320, 0xec008188), - TOBN(0x486d8ffa, 0x696946fc), TOBN(0x50fbc6d8, 0xb9cba56d), - TOBN(0x7e3d423e, 0x90f35a15), TOBN(0x7c3da195, 0xc0dd962c), - TOBN(0xe673fdb0, 0x3cfd5d8b), TOBN(0x0704b7c2, 0x889dfca5), - TOBN(0xf6ce581f, 0xf52305aa), TOBN(0x399d49eb, 0x914d5e53), - TOBN(0x380a496d, 0x6ec293cd), TOBN(0x733dbda7, 0x8e7051f5), - TOBN(0x037e388d, 0xb849140a), TOBN(0xee4b32b0, 0x5946dbf6), - TOBN(0xb1c4fda9, 0xcae368d1), TOBN(0x5001a7b0, 0xfdb0b2f3), - TOBN(0x6df59374, 0x2e3ac46e), TOBN(0x4af675f2, 0x39b3e656), - TOBN(0x44e38110, 0x39949296), TOBN(0x5b63827b, 0x361db1b5), - TOBN(0x3e5323ed, 0x206eaff5), TOBN(0x942370d2, 0xc21f4290), - TOBN(0xf2caaf2e, 0xe0d985a1), TOBN(0x192cc64b, 0x7239846d), - TOBN(0x7c0b8f47, 0xae6312f8), TOBN(0x7dc61f91, 0x96620108), - TOBN(0xb830fb5b, 0xc2da7de9), TOBN(0xd0e643df, 0x0ff8d3be), - TOBN(0x31ee77ba, 0x188a9641), TOBN(0x4e8aa3aa, 0xbcf6d502), - TOBN(0xf9fb6532, 0x9a49110f), TOBN(0xd18317f6, 0x2dd6b220), - TOBN(0x7e3ced41, 0x52c3ea5a), TOBN(0x0d296a14, 0x7d579c4a), - TOBN(0x35d6a53e, 0xed4c3717), TOBN(0x9f8240cf, 0x3d0ed2a3), - TOBN(0x8c0d4d05, 0xe5543aa5), TOBN(0x45d5bbfb, 0xdd33b4b4), - TOBN(0xfa04cc73, 0x137fd28e), TOBN(0x862ac6ef, 0xc73b3ffd), - TOBN(0x403ff9f5, 0x31f51ef2), TOBN(0x34d5e0fc, 0xbc73f5a2), - TOBN(0xf2526820, 0x08913f4f), TOBN(0xea20ed61, 0xeac93d95), - TOBN(0x51ed38b4, 0x6ca6b26c), TOBN(0x8662dcbc, 0xea4327b0), - TOBN(0x6daf295c, 0x725d2aaa), TOBN(0xbad2752f, 0x8e52dcda), - TOBN(0x2210e721, 0x0b17dacc), TOBN(0xa37f7912, 0xd51e8232), - TOBN(0x4f7081e1, 0x44cc3add), TOBN(0xd5ffa1d6, 0x87be82cf), - TOBN(0x89890b6c, 0x0edd6472), TOBN(0xada26e1a, 0x3ed17863), - TOBN(0x276f2715, 0x63483caa), TOBN(0xe6924cd9, 0x2f6077fd), - TOBN(0x05a7fe98, 0x0a466e3c), TOBN(0xf1c794b0, 0xb1902d1f), - TOBN(0xe5213688, 0x82a8042c), TOBN(0xd931cfaf, 0xcd278298), - TOBN(0x069a0ae0, 0xf597a740), TOBN(0x0adbb3f3, 0xeb59107c), - TOBN(0x983e951e, 0x5eaa8eb8), TOBN(0xe663a8b5, 0x11b48e78), - TOBN(0x1631cc0d, 0x8a03f2c5), TOBN(0x7577c11e, 0x11e271e2), - TOBN(0x33b2385c, 0x08369a90), TOBN(0x2990c59b, 0x190eb4f8), - TOBN(0x819a6145, 0xc68eac80), TOBN(0x7a786d62, 0x2ec4a014), - TOBN(0x33faadbe, 0x20ac3a8d), TOBN(0x31a21781, 0x5aba2d30), - TOBN(0x209d2742, 0xdba4f565), TOBN(0xdb2ce9e3, 0x55aa0fbb), - TOBN(0x8cef334b, 0x168984df), TOBN(0xe81dce17, 0x33879638), - TOBN(0xf6e6949c, 0x263720f0), TOBN(0x5c56feaf, 0xf593cbec), - TOBN(0x8bff5601, 0xfde58c84), TOBN(0x74e24117, 0x2eccb314), - TOBN(0xbcf01b61, 0x4c9a8a78), TOBN(0xa233e35e, 0x544c9868), - TOBN(0xb3156bf3, 0x8bd7aff1), TOBN(0x1b5ee4cb, 0x1d81b146), - TOBN(0x7ba1ac41, 0xd628a915), TOBN(0x8f3a8f9c, 0xfd89699e), - TOBN(0x7329b9c9, 0xa0748be7), TOBN(0x1d391c95, 0xa92e621f), - TOBN(0xe51e6b21, 0x4d10a837), TOBN(0xd255f53a, 0x4947b435), - TOBN(0x07669e04, 0xf1788ee3), TOBN(0xc14f27af, 0xa86938a2), - TOBN(0x8b47a334, 0xe93a01c0), TOBN(0xff627438, 0xd9366808), - TOBN(0x7a0985d8, 0xca2a5965), TOBN(0x3d9a5542, 0xd6e9b9b3), - TOBN(0xc23eb80b, 0x4cf972e8), TOBN(0x5c1c33bb, 0x4fdf72fd), - TOBN(0x0c4a58d4, 0x74a86108), TOBN(0xf8048a8f, 0xee4c5d90), - TOBN(0xe3c7c924, 0xe86d4c80), TOBN(0x28c889de, 0x056a1e60), - TOBN(0x57e2662e, 0xb214a040), TOBN(0xe8c48e98, 0x37e10347), - TOBN(0x87742862, 0x80ac748a), TOBN(0xf1c24022, 0x186b06f2), - TOBN(0xac2dd4c3, 0x5f74040a), TOBN(0x409aeb71, 0xfceac957), - TOBN(0x4fbad782, 0x55c4ec23), TOBN(0xb359ed61, 0x8a7b76ec), - TOBN(0x12744926, 0xed6f4a60), TOBN(0xe21e8d7f, 0x4b912de3), - TOBN(0xe2575a59, 0xfc705a59), TOBN(0x72f1d4de, 0xed2dbc0e), - TOBN(0x3d2b24b9, 0xeb7926b8), TOBN(0xbff88cb3, 0xcdbe5509), - TOBN(0xd0f399af, 0xe4dd640b), TOBN(0x3c5fe130, 0x2f76ed45), - TOBN(0x6f3562f4, 0x3764fb3d), TOBN(0x7b5af318, 0x3151b62d), - TOBN(0xd5bd0bc7, 0xd79ce5f3), TOBN(0xfdaf6b20, 0xec66890f), - TOBN(0x735c67ec, 0x6063540c), TOBN(0x50b259c2, 0xe5f9cb8f), - TOBN(0xb8734f9a, 0x3f99c6ab), TOBN(0xf8cc13d5, 0xa3a7bc85), - TOBN(0x80c1b305, 0xc5217659), TOBN(0xfe5364d4, 0x4ec12a54), - TOBN(0xbd87045e, 0x681345fe), TOBN(0x7f8efeb1, 0x582f897f), - TOBN(0xe8cbf1e5, 0xd5923359), TOBN(0xdb0cea9d, 0x539b9fb0), - TOBN(0x0c5b34cf, 0x49859b98), TOBN(0x5e583c56, 0xa4403cc6), - TOBN(0x11fc1a2d, 0xd48185b7), TOBN(0xc93fbc7e, 0x6e521787), - TOBN(0x47e7a058, 0x05105b8b), TOBN(0x7b4d4d58, 0xdb8260c8), - TOBN(0xe33930b0, 0x46eb842a), TOBN(0x8e844a9a, 0x7bdae56d), - TOBN(0x34ef3a9e, 0x13f7fdfc), TOBN(0xb3768f82, 0x636ca176), - TOBN(0x2821f4e0, 0x4e09e61c), TOBN(0x414dc3a1, 0xa0c7cddc), - TOBN(0xd5379437, 0x54945fcd), TOBN(0x151b6eef, 0xb3555ff1), - TOBN(0xb31bd613, 0x6339c083), TOBN(0x39ff8155, 0xdfb64701), - TOBN(0x7c3388d2, 0xe29604ab), TOBN(0x1e19084b, 0xa6b10442), - TOBN(0x17cf54c0, 0xeccd47ef), TOBN(0x89693385, 0x4a5dfb30), - TOBN(0x69d023fb, 0x47daf9f6), TOBN(0x9222840b, 0x7d91d959), - TOBN(0x439108f5, 0x803bac62), TOBN(0x0b7dd91d, 0x379bd45f), - TOBN(0xd651e827, 0xca63c581), TOBN(0x5c5d75f6, 0x509c104f), - TOBN(0x7d5fc738, 0x1f2dc308), TOBN(0x20faa7bf, 0xd98454be), - TOBN(0x95374bee, 0xa517b031), TOBN(0xf036b9b1, 0x642692ac), - TOBN(0xc5106109, 0x39842194), TOBN(0xb7e2353e, 0x49d05295), - TOBN(0xfc8c1d5c, 0xefb42ee0), TOBN(0xe04884eb, 0x08ce811c), - TOBN(0xf1f75d81, 0x7419f40e), TOBN(0x5b0ac162, 0xa995c241), - TOBN(0x120921bb, 0xc4c55646), TOBN(0x713520c2, 0x8d33cf97), - TOBN(0xb4a65a5c, 0xe98c5100), TOBN(0x6cec871d, 0x2ddd0f5a), - TOBN(0x251f0b7f, 0x9ba2e78b), TOBN(0x224a8434, 0xce3a2a5f), - TOBN(0x26827f61, 0x25f5c46f), TOBN(0x6a22bedc, 0x48545ec0), - TOBN(0x25ae5fa0, 0xb1bb5cdc), TOBN(0xd693682f, 0xfcb9b98f), - TOBN(0x32027fe8, 0x91e5d7d3), TOBN(0xf14b7d17, 0x73a07678), - TOBN(0xf88497b3, 0xc0dfdd61), TOBN(0xf7c2eec0, 0x2a8c4f48), - TOBN(0xaa5573f4, 0x3756e621), TOBN(0xc013a240, 0x1825b948), - TOBN(0x1c03b345, 0x63878572), TOBN(0xa0472bea, 0x653a4184), - TOBN(0xf4222e27, 0x0ac69a80), TOBN(0x34096d25, 0xf51e54f6), - TOBN(0x00a648cb, 0x8fffa591), TOBN(0x4e87acdc, 0x69b6527f), - TOBN(0x0575e037, 0xe285ccb4), TOBN(0x188089e4, 0x50ddcf52), - TOBN(0xaa96c9a8, 0x870ff719), TOBN(0x74a56cd8, 0x1fc7e369), - TOBN(0x41d04ee2, 0x1726931a), TOBN(0x0bbbb2c8, 0x3660ecfd), - TOBN(0xa6ef6de5, 0x24818e18), TOBN(0xe421cc51, 0xe7d57887), - TOBN(0xf127d208, 0xbea87be6), TOBN(0x16a475d3, 0xb1cdd682), - TOBN(0x9db1b684, 0x439b63f7), TOBN(0x5359b3db, 0xf0f113b6), - TOBN(0xdfccf1de, 0x8bf06e31), TOBN(0x1fdf8f44, 0xdd383901), - TOBN(0x10775cad, 0x5017e7d2), TOBN(0xdfc3a597, 0x58d11eef), - TOBN(0x6ec9c8a0, 0xb1ecff10), TOBN(0xee6ed6cc, 0x28400549), - TOBN(0xb5ad7bae, 0x1b4f8d73), TOBN(0x61b4f11d, 0xe00aaab9), - TOBN(0x7b32d69b, 0xd4eff2d7), TOBN(0x88ae6771, 0x4288b60f), - TOBN(0x159461b4, 0x37a1e723), TOBN(0x1f3d4789, 0x570aae8c), - TOBN(0x869118c0, 0x7f9871da), TOBN(0x35fbda78, 0xf635e278), - TOBN(0x738f3641, 0xe1541dac), TOBN(0x6794b13a, 0xc0dae45f), - TOBN(0x065064ac, 0x09cc0917), TOBN(0x27c53729, 0xc68540fd), - TOBN(0x0d2d4c8e, 0xef227671), TOBN(0xd23a9f80, 0xa1785a04), - TOBN(0x98c59528, 0x52650359), TOBN(0xfa09ad01, 0x74a1acad), - TOBN(0x082d5a29, 0x0b55bf5c), TOBN(0xa40f1c67, 0x419b8084), - TOBN(0x3a5c752e, 0xdcc18770), TOBN(0x4baf1f2f, 0x8825c3a5), - TOBN(0xebd63f74, 0x21b153ed), TOBN(0xa2383e47, 0xb2f64723), - TOBN(0xe7bf620a, 0x2646d19a), TOBN(0x56cb44ec, 0x03c83ffd), - TOBN(0xaf7267c9, 0x4f6be9f1), TOBN(0x8b2dfd7b, 0xc06bb5e9), - TOBN(0xb87072f2, 0xa672c5c7), TOBN(0xeacb11c8, 0x0d53c5e2), - TOBN(0x22dac29d, 0xff435932), TOBN(0x37bdb99d, 0x4408693c), - TOBN(0xf6e62fb6, 0x2899c20f), TOBN(0x3535d512, 0x447ece24), - TOBN(0xfbdc6b88, 0xff577ce3), TOBN(0x726693bd, 0x190575f2), - TOBN(0x6772b0e5, 0xab4b35a2), TOBN(0x1d8b6001, 0xf5eeaacf), - TOBN(0x728f7ce4, 0x795b9580), TOBN(0x4a20ed2a, 0x41fb81da), - TOBN(0x9f685cd4, 0x4fec01e6), TOBN(0x3ed7ddcc, 0xa7ff50ad), - TOBN(0x460fd264, 0x0c2d97fd), TOBN(0x3a241426, 0xeb82f4f9), - TOBN(0x17d1df2c, 0x6a8ea820), TOBN(0xb2b50d3b, 0xf22cc254), - TOBN(0x03856cba, 0xb7291426), TOBN(0x87fd26ae, 0x04f5ee39), - TOBN(0x9cb696cc, 0x02bee4ba), TOBN(0x53121804, 0x06820fd6), - TOBN(0xa5dfc269, 0x0212e985), TOBN(0x666f7ffa, 0x160f9a09), - TOBN(0xc503cd33, 0xbccd9617), TOBN(0x365dede4, 0xba7730a3), - TOBN(0x798c6355, 0x5ddb0786), TOBN(0xa6c3200e, 0xfc9cd3bc), - TOBN(0x060ffb2c, 0xe5e35efd), TOBN(0x99a4e25b, 0x5555a1c1), - TOBN(0x11d95375, 0xf70b3751), TOBN(0x0a57354a, 0x160e1bf6), - TOBN(0xecb3ae4b, 0xf8e4b065), TOBN(0x07a834c4, 0x2e53022b), - TOBN(0x1cd300b3, 0x8692ed96), TOBN(0x16a6f792, 0x61ee14ec), - TOBN(0x8f1063c6, 0x6a8649ed), TOBN(0xfbcdfcfe, 0x869f3e14), - TOBN(0x2cfb97c1, 0x00a7b3ec), TOBN(0xcea49b3c, 0x7130c2f1), - TOBN(0x462d044f, 0xe9d96488), TOBN(0x4b53d52e, 0x8182a0c1), - TOBN(0x84b6ddd3, 0x0391e9e9), TOBN(0x80ab7b48, 0xb1741a09), - TOBN(0xec0e15d4, 0x27d3317f), TOBN(0x8dfc1ddb, 0x1a64671e), - TOBN(0x93cc5d5f, 0xd49c5b92), TOBN(0xc995d53d, 0x3674a331), - TOBN(0x302e41ec, 0x090090ae), TOBN(0x2278a0cc, 0xedb06830), - TOBN(0x1d025932, 0xfbc99690), TOBN(0x0c32fbd2, 0xb80d68da), - TOBN(0xd79146da, 0xf341a6c1), TOBN(0xae0ba139, 0x1bef68a0), - TOBN(0xc6b8a563, 0x8d774b3a), TOBN(0x1cf307bd, 0x880ba4d7), - TOBN(0xc033bdc7, 0x19803511), TOBN(0xa9f97b3b, 0x8888c3be), - TOBN(0x3d68aebc, 0x85c6d05e), TOBN(0xc3b88a9d, 0x193919eb), - TOBN(0x2d300748, 0xc48b0ee3), TOBN(0x7506bc7c, 0x07a746c1), - TOBN(0xfc48437c, 0x6e6d57f3), TOBN(0x5bd71587, 0xcfeaa91a), - TOBN(0xa4ed0408, 0xc1bc5225), TOBN(0xd0b946db, 0x2719226d), - TOBN(0x109ecd62, 0x758d2d43), TOBN(0x75c8485a, 0x2751759b), - TOBN(0xb0b75f49, 0x9ce4177a), TOBN(0x4fa61a1e, 0x79c10c3d), - TOBN(0xc062d300, 0xa167fcd7), TOBN(0x4df3874c, 0x750f0fa8), - TOBN(0x29ae2cf9, 0x83dfedc9), TOBN(0xf8437134, 0x8d87631a), - TOBN(0xaf571711, 0x7429c8d2), TOBN(0x18d15867, 0x146d9272), - TOBN(0x83053ecf, 0x69769bb7), TOBN(0xc55eb856, 0xc479ab82), - TOBN(0x5ef7791c, 0x21b0f4b2), TOBN(0xaa5956ba, 0x3d491525), - TOBN(0x407a96c2, 0x9fe20eba), TOBN(0xf27168bb, 0xe52a5ad3), - TOBN(0x43b60ab3, 0xbf1d9d89), TOBN(0xe45c51ef, 0x710e727a), - TOBN(0xdfca5276, 0x099b4221), TOBN(0x8dc6407c, 0x2557a159), - TOBN(0x0ead8335, 0x91035895), TOBN(0x0a9db957, 0x9c55dc32), - TOBN(0xe40736d3, 0xdf61bc76), TOBN(0x13a619c0, 0x3f778cdb), - TOBN(0x6dd921a4, 0xc56ea28f), TOBN(0x76a52433, 0x2fa647b4), - TOBN(0x23591891, 0xac5bdc5d), TOBN(0xff4a1a72, 0xbac7dc01), - TOBN(0x9905e261, 0x62df8453), TOBN(0x3ac045df, 0xe63b265f), - TOBN(0x8a3f341b, 0xad53dba7), TOBN(0x8ec269cc, 0x837b625a), - TOBN(0xd71a2782, 0x3ae31189), TOBN(0x8fb4f9a3, 0x55e96120), - TOBN(0x804af823, 0xff9875cf), TOBN(0x23224f57, 0x5d442a9b), - TOBN(0x1c4d3b9e, 0xecc62679), TOBN(0x91da22fb, 0xa0e7ddb1), - TOBN(0xa370324d, 0x6c04a661), TOBN(0x9710d3b6, 0x5e376d17), - TOBN(0xed8c98f0, 0x3044e357), TOBN(0xc364ebbe, 0x6422701c), - TOBN(0x347f5d51, 0x7733d61c), TOBN(0xd55644b9, 0xcea826c3), - TOBN(0x80c6e0ad, 0x55a25548), TOBN(0x0aa7641d, 0x844220a7), - TOBN(0x1438ec81, 0x31810660), TOBN(0x9dfa6507, 0xde4b4043), - TOBN(0x10b515d8, 0xcc3e0273), TOBN(0x1b6066dd, 0x28d8cfb2), - TOBN(0xd3b04591, 0x9c9efebd), TOBN(0x425d4bdf, 0xa21c1ff4), - TOBN(0x5fe5af19, 0xd57607d3), TOBN(0xbbf773f7, 0x54481084), - TOBN(0x8435bd69, 0x94b03ed1), TOBN(0xd9ad1de3, 0x634cc546), - TOBN(0x2cf423fc, 0x00e420ca), TOBN(0xeed26d80, 0xa03096dd), - TOBN(0xd7f60be7, 0xa4db09d2), TOBN(0xf47f569d, 0x960622f7), - TOBN(0xe5925fd7, 0x7296c729), TOBN(0xeff2db26, 0x26ca2715), - TOBN(0xa6fcd014, 0xb913e759), TOBN(0x53da4786, 0x8ff4de93), - TOBN(0x14616d79, 0xc32068e1), TOBN(0xb187d664, 0xccdf352e), - TOBN(0xf7afb650, 0x1dc90b59), TOBN(0x8170e943, 0x7daa1b26), - TOBN(0xc8e3bdd8, 0x700c0a84), TOBN(0x6e8d345f, 0x6482bdfa), - TOBN(0x84cfbfa1, 0xc5c5ea50), TOBN(0xd3baf14c, 0x67960681), - TOBN(0x26398403, 0x0dd50942), TOBN(0xe4b7839c, 0x4716a663), - TOBN(0xd5f1f794, 0xe7de6dc0), TOBN(0x5cd0f4d4, 0x622aa7ce), - TOBN(0x5295f3f1, 0x59acfeec), TOBN(0x8d933552, 0x953e0607), - TOBN(0xc7db8ec5, 0x776c5722), TOBN(0xdc467e62, 0x2b5f290c), - TOBN(0xd4297e70, 0x4ff425a9), TOBN(0x4be924c1, 0x0cf7bb72), - TOBN(0x0d5dc5ae, 0xa1892131), TOBN(0x8bf8a8e3, 0xa705c992), - TOBN(0x73a0b064, 0x7a305ac5), TOBN(0x00c9ca4e, 0x9a8c77a8), - TOBN(0x5dfee80f, 0x83774bdd), TOBN(0x63131602, 0x85734485), - TOBN(0xa1b524ae, 0x914a69a9), TOBN(0xebc2ffaf, 0xd4e300d7), - TOBN(0x52c93db7, 0x7cfa46a5), TOBN(0x71e6161f, 0x21653b50), - TOBN(0x3574fc57, 0xa4bc580a), TOBN(0xc09015dd, 0xe1bc1253), - TOBN(0x4b7b47b2, 0xd174d7aa), TOBN(0x4072d8e8, 0xf3a15d04), - TOBN(0xeeb7d47f, 0xd6fa07ed), TOBN(0x6f2b9ff9, 0xedbdafb1), - TOBN(0x18c51615, 0x3760fe8a), TOBN(0x7a96e6bf, 0xf06c6c13), - TOBN(0x4d7a0410, 0x0ea2d071), TOBN(0xa1914e9b, 0x0be2a5ce), - TOBN(0x5726e357, 0xd8a3c5cf), TOBN(0x1197ecc3, 0x2abb2b13), - TOBN(0x6c0d7f7f, 0x31ae88dd), TOBN(0x15b20d1a, 0xfdbb3efe), - TOBN(0xcd06aa26, 0x70584039), TOBN(0x2277c969, 0xa7dc9747), - TOBN(0xbca69587, 0x7855d815), TOBN(0x899ea238, 0x5188b32a), - TOBN(0x37d9228b, 0x760c1c9d), TOBN(0xc7efbb11, 0x9b5c18da), - TOBN(0x7f0d1bc8, 0x19f6dbc5), TOBN(0x4875384b, 0x07e6905b), - TOBN(0xc7c50baa, 0x3ba8cd86), TOBN(0xb0ce40fb, 0xc2905de0), - TOBN(0x70840673, 0x7a231952), TOBN(0xa912a262, 0xcf43de26), - TOBN(0x9c38ddcc, 0xeb5b76c1), TOBN(0x746f5285, 0x26fc0ab4), - TOBN(0x52a63a50, 0xd62c269f), TOBN(0x60049c55, 0x99458621), - TOBN(0xe7f48f82, 0x3c2f7c9e), TOBN(0x6bd99043, 0x917d5cf3), - TOBN(0xeb1317a8, 0x8701f469), TOBN(0xbd3fe2ed, 0x9a449fe0), - TOBN(0x421e79ca, 0x12ef3d36), TOBN(0x9ee3c36c, 0x3e7ea5de), - TOBN(0xe48198b5, 0xcdff36f7), TOBN(0xaff4f967, 0xc6b82228), - TOBN(0x15e19dd0, 0xc47adb7e), TOBN(0x45699b23, 0x032e7dfa), - TOBN(0x40680c8b, 0x1fae026a), TOBN(0x5a347a48, 0x550dbf4d), - TOBN(0xe652533b, 0x3cef0d7d), TOBN(0xd94f7b18, 0x2bbb4381), - TOBN(0x838752be, 0x0e80f500), TOBN(0x8e6e2488, 0x9e9c9bfb), - TOBN(0xc9751697, 0x16caca6a), TOBN(0x866c49d8, 0x38531ad9), - TOBN(0xc917e239, 0x7151ade1), TOBN(0x2d016ec1, 0x6037c407), - TOBN(0xa407ccc9, 0x00eac3f9), TOBN(0x835f6280, 0xe2ed4748), - TOBN(0xcc54c347, 0x1cc98e0d), TOBN(0x0e969937, 0xdcb572eb), - TOBN(0x1b16c8e8, 0x8f30c9cb), TOBN(0xa606ae75, 0x373c4661), - TOBN(0x47aa689b, 0x35502cab), TOBN(0xf89014ae, 0x4d9bb64f), - TOBN(0x202f6a9c, 0x31c71f7b), TOBN(0x01f95aa3, 0x296ffe5c), - TOBN(0x5fc06014, 0x53cec3a3), TOBN(0xeb991237, 0x5f498a45), - TOBN(0xae9a935e, 0x5d91ba87), TOBN(0xc6ac6281, 0x0b564a19), - TOBN(0x8a8fe81c, 0x3bd44e69), TOBN(0x7c8b467f, 0x9dd11d45), - TOBN(0xf772251f, 0xea5b8e69), TOBN(0xaeecb3bd, 0xc5b75fbc), - TOBN(0x1aca3331, 0x887ff0e5), TOBN(0xbe5d49ff, 0x19f0a131), - TOBN(0x582c13aa, 0xe5c8646f), TOBN(0xdbaa12e8, 0x20e19980), - TOBN(0x8f40f31a, 0xf7abbd94), TOBN(0x1f13f5a8, 0x1dfc7663), - TOBN(0x5d81f1ee, 0xaceb4fc0), TOBN(0x36256002, 0x5e6f0f42), - TOBN(0x4b67d6d7, 0x751370c8), TOBN(0x2608b698, 0x03e80589), - TOBN(0xcfc0d2fc, 0x05268301), TOBN(0xa6943d39, 0x40309212), - TOBN(0x192a90c2, 0x1fd0e1c2), TOBN(0xb209f113, 0x37f1dc76), - TOBN(0xefcc5e06, 0x97bf1298), TOBN(0xcbdb6730, 0x219d639e), - TOBN(0xd009c116, 0xb81e8c6f), TOBN(0xa3ffdde3, 0x1a7ce2e5), - TOBN(0xc53fbaaa, 0xa914d3ba), TOBN(0x836d500f, 0x88df85ee), - TOBN(0xd98dc71b, 0x66ee0751), TOBN(0x5a3d7005, 0x714516fd), - TOBN(0x21d3634d, 0x39eedbba), TOBN(0x35cd2e68, 0x0455a46d), - TOBN(0xc8cafe65, 0xf9d7eb0c), TOBN(0xbda3ce9e, 0x00cefb3e), - TOBN(0xddc17a60, 0x2c9cf7a4), TOBN(0x01572ee4, 0x7bcb8773), - TOBN(0xa92b2b01, 0x8c7548df), TOBN(0x732fd309, 0xa84600e3), - TOBN(0xe22109c7, 0x16543a40), TOBN(0x9acafd36, 0xfede3c6c), - TOBN(0xfb206852, 0x6824e614), TOBN(0x2a4544a9, 0xda25dca0), - TOBN(0x25985262, 0x91d60b06), TOBN(0x281b7be9, 0x28753545), - TOBN(0xec667b1a, 0x90f13b27), TOBN(0x33a83aff, 0x940e2eb4), - TOBN(0x80009862, 0xd5d721d5), TOBN(0x0c3357a3, 0x5bd3a182), - TOBN(0x27f3a83b, 0x7aa2cda4), TOBN(0xb58ae74e, 0xf6f83085), - TOBN(0x2a911a81, 0x2e6dad6b), TOBN(0xde286051, 0xf43d6c5b), - TOBN(0x4bdccc41, 0xf996c4d8), TOBN(0xe7312ec0, 0x0ae1e24e)}, - {TOBN(0xf8d112e7, 0x6e6485b3), TOBN(0x4d3e24db, 0x771c52f8), - TOBN(0x48e3ee41, 0x684a2f6d), TOBN(0x7161957d, 0x21d95551), - TOBN(0x19631283, 0xcdb12a6c), TOBN(0xbf3fa882, 0x2e50e164), - TOBN(0xf6254b63, 0x3166cc73), TOBN(0x3aefa7ae, 0xaee8cc38), - TOBN(0x79b0fe62, 0x3b36f9fd), TOBN(0x26543b23, 0xfde19fc0), - TOBN(0x136e64a0, 0x958482ef), TOBN(0x23f63771, 0x9b095825), - TOBN(0x14cfd596, 0xb6a1142e), TOBN(0x5ea6aac6, 0x335aac0b), - TOBN(0x86a0e8bd, 0xf3081dd5), TOBN(0x5fb89d79, 0x003dc12a), - TOBN(0xf615c33a, 0xf72e34d4), TOBN(0x0bd9ea40, 0x110eec35), - TOBN(0x1c12bc5b, 0xc1dea34e), TOBN(0x686584c9, 0x49ae4699), - TOBN(0x13ad95d3, 0x8c97b942), TOBN(0x4609561a, 0x4e5c7562), - TOBN(0x9e94a4ae, 0xf2737f89), TOBN(0xf57594c6, 0x371c78b6), - TOBN(0x0f0165fc, 0xe3779ee3), TOBN(0xe00e7f9d, 0xbd495d9e), - TOBN(0x1fa4efa2, 0x20284e7a), TOBN(0x4564bade, 0x47ac6219), - TOBN(0x90e6312a, 0xc4708e8e), TOBN(0x4f5725fb, 0xa71e9adf), - TOBN(0xe95f55ae, 0x3d684b9f), TOBN(0x47f7ccb1, 0x1e94b415), - TOBN(0x7322851b, 0x8d946581), TOBN(0xf0d13133, 0xbdf4a012), - TOBN(0xa3510f69, 0x6584dae0), TOBN(0x03a7c171, 0x3c9f6c6d), - TOBN(0x5be97f38, 0xe475381a), TOBN(0xca1ba422, 0x85823334), - TOBN(0xf83cc5c7, 0x0be17dda), TOBN(0x158b1494, 0x0b918c0f), - TOBN(0xda3a77e5, 0x522e6b69), TOBN(0x69c908c3, 0xbbcd6c18), - TOBN(0x1f1b9e48, 0xd924fd56), TOBN(0x37c64e36, 0xaa4bb3f7), - TOBN(0x5a4fdbdf, 0xee478d7d), TOBN(0xba75c8bc, 0x0193f7a0), - TOBN(0x84bc1e84, 0x56cd16df), TOBN(0x1fb08f08, 0x46fad151), - TOBN(0x8a7cabf9, 0x842e9f30), TOBN(0xa331d4bf, 0x5eab83af), - TOBN(0xd272cfba, 0x017f2a6a), TOBN(0x27560abc, 0x83aba0e3), - TOBN(0x94b83387, 0x0e3a6b75), TOBN(0x25c6aea2, 0x6b9f50f5), - TOBN(0x803d691d, 0xb5fdf6d0), TOBN(0x03b77509, 0xe6333514), - TOBN(0x36178903, 0x61a341c1), TOBN(0x3604dc60, 0x0cfd6142), - TOBN(0x022295eb, 0x8533316c), TOBN(0x3dbde4ac, 0x44af2922), - TOBN(0x898afc5d, 0x1c7eef69), TOBN(0x58896805, 0xd14f4fa1), - TOBN(0x05002160, 0x203c21ca), TOBN(0x6f0d1f30, 0x40ef730b), - TOBN(0x8e8c44d4, 0x196224f8), TOBN(0x75a4ab95, 0x374d079d), - TOBN(0x79085ecc, 0x7d48f123), TOBN(0x56f04d31, 0x1bf65ad8), - TOBN(0xe220bf1c, 0xbda602b2), TOBN(0x73ee1742, 0xf9612c69), - TOBN(0x76008fc8, 0x084fd06b), TOBN(0x4000ef9f, 0xf11380d1), - TOBN(0x48201b4b, 0x12cfe297), TOBN(0x3eee129c, 0x292f74e5), - TOBN(0xe1fe114e, 0xc9e874e8), TOBN(0x899b055c, 0x92c5fc41), - TOBN(0x4e477a64, 0x3a39c8cf), TOBN(0x82f09efe, 0x78963cc9), - TOBN(0x6fd3fd8f, 0xd333f863), TOBN(0x85132b2a, 0xdc949c63), - TOBN(0x7e06a3ab, 0x516eb17b), TOBN(0x73bec06f, 0xd2c7372b), - TOBN(0xe4f74f55, 0xba896da6), TOBN(0xbb4afef8, 0x8e9eb40f), - TOBN(0x2d75bec8, 0xe61d66b0), TOBN(0x02bda4b4, 0xef29300b), - TOBN(0x8bbaa8de, 0x026baa5a), TOBN(0xff54befd, 0xa07f4440), - TOBN(0xbd9b8b1d, 0xbe7a2af3), TOBN(0xec51caa9, 0x4fb74a72), - TOBN(0xb9937a4b, 0x63879697), TOBN(0x7c9a9d20, 0xec2687d5), - TOBN(0x1773e44f, 0x6ef5f014), TOBN(0x8abcf412, 0xe90c6900), - TOBN(0x387bd022, 0x8142161e), TOBN(0x50393755, 0xfcb6ff2a), - TOBN(0x9813fd56, 0xed6def63), TOBN(0x53cf6482, 0x7d53106c), - TOBN(0x991a35bd, 0x431f7ac1), TOBN(0xf1e274dd, 0x63e65faf), - TOBN(0xf63ffa3c, 0x44cc7880), TOBN(0x411a426b, 0x7c256981), - TOBN(0xb698b9fd, 0x93a420e0), TOBN(0x89fdddc0, 0xae53f8fe), - TOBN(0x766e0722, 0x32398baa), TOBN(0x205fee42, 0x5cfca031), - TOBN(0xa49f5341, 0x7a029cf2), TOBN(0xa88c68b8, 0x4023890d), - TOBN(0xbc275041, 0x7337aaa8), TOBN(0x9ed364ad, 0x0eb384f4), - TOBN(0xe0816f85, 0x29aba92f), TOBN(0x2e9e1941, 0x04e38a88), - TOBN(0x57eef44a, 0x3dafd2d5), TOBN(0x35d1fae5, 0x97ed98d8), - TOBN(0x50628c09, 0x2307f9b1), TOBN(0x09d84aae, 0xd6cba5c6), - TOBN(0x67071bc7, 0x88aaa691), TOBN(0x2dea57a9, 0xafe6cb03), - TOBN(0xdfe11bb4, 0x3d78ac01), TOBN(0x7286418c, 0x7fd7aa51), - TOBN(0xfabf7709, 0x77f7195a), TOBN(0x8ec86167, 0xadeb838f), - TOBN(0xea1285a8, 0xbb4f012d), TOBN(0xd6883503, 0x9a3eab3f), - TOBN(0xee5d24f8, 0x309004c2), TOBN(0xa96e4b76, 0x13ffe95e), - TOBN(0x0cdffe12, 0xbd223ea4), TOBN(0x8f5c2ee5, 0xb6739a53), - TOBN(0x5cb4aaa5, 0xdd968198), TOBN(0xfa131c52, 0x72413a6c), - TOBN(0x53d46a90, 0x9536d903), TOBN(0xb270f0d3, 0x48606d8e), - TOBN(0x518c7564, 0xa053a3bc), TOBN(0x088254b7, 0x1a86caef), - TOBN(0xb3ba8cb4, 0x0ab5efd0), TOBN(0x5c59900e, 0x4605945d), - TOBN(0xecace1dd, 0xa1887395), TOBN(0x40960f36, 0x932a65de), - TOBN(0x9611ff5c, 0x3aa95529), TOBN(0xc58215b0, 0x7c1e5a36), - TOBN(0xd48c9b58, 0xf0e1a524), TOBN(0xb406856b, 0xf590dfb8), - TOBN(0xc7605e04, 0x9cd95662), TOBN(0x0dd036ee, 0xa33ecf82), - TOBN(0xa50171ac, 0xc33156b3), TOBN(0xf09d24ea, 0x4a80172e), - TOBN(0x4e1f72c6, 0x76dc8eef), TOBN(0xe60caadc, 0x5e3d44ee), - TOBN(0x006ef8a6, 0x979b1d8f), TOBN(0x60908a1c, 0x97788d26), - TOBN(0x6e08f95b, 0x266feec0), TOBN(0x618427c2, 0x22e8c94e), - TOBN(0x3d613339, 0x59145a65), TOBN(0xcd9bc368, 0xfa406337), - TOBN(0x82d11be3, 0x2d8a52a0), TOBN(0xf6877b27, 0x97a1c590), - TOBN(0x837a819b, 0xf5cbdb25), TOBN(0x2a4fd1d8, 0xde090249), - TOBN(0x622a7de7, 0x74990e5f), TOBN(0x840fa5a0, 0x7945511b), - TOBN(0x30b974be, 0x6558842d), TOBN(0x70df8c64, 0x17f3d0a6), - TOBN(0x7c803520, 0x7542e46d), TOBN(0x7251fe7f, 0xe4ecc823), - TOBN(0xe59134cb, 0x5e9aac9a), TOBN(0x11bb0934, 0xf0045d71), - TOBN(0x53e5d9b5, 0xdbcb1d4e), TOBN(0x8d97a905, 0x92defc91), - TOBN(0xfe289327, 0x7946d3f9), TOBN(0xe132bd24, 0x07472273), - TOBN(0xeeeb510c, 0x1eb6ae86), TOBN(0x777708c5, 0xf0595067), - TOBN(0x18e2c8cd, 0x1297029e), TOBN(0x2c61095c, 0xbbf9305e), - TOBN(0xe466c258, 0x6b85d6d9), TOBN(0x8ac06c36, 0xda1ea530), - TOBN(0xa365dc39, 0xa1304668), TOBN(0xe4a9c885, 0x07f89606), - TOBN(0x65a4898f, 0xacc7228d), TOBN(0x3e2347ff, 0x84ca8303), - TOBN(0xa5f6fb77, 0xea7d23a3), TOBN(0x2fac257d, 0x672a71cd), - TOBN(0x6908bef8, 0x7e6a44d3), TOBN(0x8ff87566, 0x891d3d7a), - TOBN(0xe58e90b3, 0x6b0cf82e), TOBN(0x6438d246, 0x2615b5e7), - TOBN(0x07b1f8fc, 0x669c145a), TOBN(0xb0d8b2da, 0x36f1e1cb), - TOBN(0x54d5dadb, 0xd9184c4d), TOBN(0x3dbb18d5, 0xf93d9976), - TOBN(0x0a3e0f56, 0xd1147d47), TOBN(0x2afa8c8d, 0xa0a48609), - TOBN(0x275353e8, 0xbc36742c), TOBN(0x898f427e, 0xeea0ed90), - TOBN(0x26f4947e, 0x3e477b00), TOBN(0x8ad8848a, 0x308741e3), - TOBN(0x6c703c38, 0xd74a2a46), TOBN(0x5e3e05a9, 0x9ba17ba2), - TOBN(0xc1fa6f66, 0x4ab9a9e4), TOBN(0x474a2d9a, 0x3841d6ec), - TOBN(0x871239ad, 0x653ae326), TOBN(0x14bcf72a, 0xa74cbb43), - TOBN(0x8737650e, 0x20d4c083), TOBN(0x3df86536, 0x110ed4af), - TOBN(0xd2d86fe7, 0xb53ca555), TOBN(0x688cb00d, 0xabd5d538), - TOBN(0xcf81bda3, 0x1ad38468), TOBN(0x7ccfe3cc, 0xf01167b6), - TOBN(0xcf4f47e0, 0x6c4c1fe6), TOBN(0x557e1f1a, 0x298bbb79), - TOBN(0xf93b974f, 0x30d45a14), TOBN(0x174a1d2d, 0x0baf97c4), - TOBN(0x7a003b30, 0xc51fbf53), TOBN(0xd8940991, 0xee68b225), - TOBN(0x5b0aa7b7, 0x1c0f4173), TOBN(0x975797c9, 0xa20a7153), - TOBN(0x26e08c07, 0xe3533d77), TOBN(0xd7222e6a, 0x2e341c99), - TOBN(0x9d60ec3d, 0x8d2dc4ed), TOBN(0xbdfe0d8f, 0x7c476cf8), - TOBN(0x1fe59ab6, 0x1d056605), TOBN(0xa9ea9df6, 0x86a8551f), - TOBN(0x8489941e, 0x47fb8d8c), TOBN(0xfeb874eb, 0x4a7f1b10), - TOBN(0xfe5fea86, 0x7ee0d98f), TOBN(0x201ad34b, 0xdbf61864), - TOBN(0x45d8fe47, 0x37c031d4), TOBN(0xd5f49fae, 0x795f0822), - TOBN(0xdb0fb291, 0xc7f4a40c), TOBN(0x2e69d9c1, 0x730ddd92), - TOBN(0x754e1054, 0x49d76987), TOBN(0x8a24911d, 0x7662db87), - TOBN(0x61fc1810, 0x60a71676), TOBN(0xe852d1a8, 0xf66a8ad1), - TOBN(0x172bbd65, 0x6417231e), TOBN(0x0d6de7bd, 0x3babb11f), - TOBN(0x6fde6f88, 0xc8e347f8), TOBN(0x1c587547, 0x9bd99cc3), - TOBN(0x78e54ed0, 0x34076950), TOBN(0x97f0f334, 0x796e83ba), - TOBN(0xe4dbe1ce, 0x4924867a), TOBN(0xbd5f51b0, 0x60b84917), - TOBN(0x37530040, 0x3cb09a79), TOBN(0xdb3fe0f8, 0xff1743d8), - TOBN(0xed7894d8, 0x556fa9db), TOBN(0xfa262169, 0x23412fbf), - TOBN(0x563be0db, 0xba7b9291), TOBN(0x6ca8b8c0, 0x0c9fb234), - TOBN(0xed406aa9, 0xbd763802), TOBN(0xc21486a0, 0x65303da1), - TOBN(0x61ae291e, 0xc7e62ec4), TOBN(0x622a0492, 0xdf99333e), - TOBN(0x7fd80c9d, 0xbb7a8ee0), TOBN(0xdc2ed3bc, 0x6c01aedb), - TOBN(0x35c35a12, 0x08be74ec), TOBN(0xd540cb1a, 0x469f671f), - TOBN(0xd16ced4e, 0xcf84f6c7), TOBN(0x8561fb9c, 0x2d090f43), - TOBN(0x7e693d79, 0x6f239db4), TOBN(0xa736f928, 0x77bd0d94), - TOBN(0x07b4d929, 0x2c1950ee), TOBN(0xda177543, 0x56dc11b3), - TOBN(0xa5dfbbaa, 0x7a6a878e), TOBN(0x1c70cb29, 0x4decb08a), - TOBN(0xfba28c8b, 0x6f0f7c50), TOBN(0xa8eba2b8, 0x854dcc6d), - TOBN(0x5ff8e89a, 0x36b78642), TOBN(0x070c1c8e, 0xf6873adf), - TOBN(0xbbd3c371, 0x6484d2e4), TOBN(0xfb78318f, 0x0d414129), - TOBN(0x2621a39c, 0x6ad93b0b), TOBN(0x979d74c2, 0xa9e917f7), - TOBN(0xfc195647, 0x61fb0428), TOBN(0x4d78954a, 0xbee624d4), - TOBN(0xb94896e0, 0xb8ae86fd), TOBN(0x6667ac0c, 0xc91c8b13), - TOBN(0x9f180512, 0x43bcf832), TOBN(0xfbadf8b7, 0xa0010137), - TOBN(0xc69b4089, 0xb3ba8aa7), TOBN(0xfac4bacd, 0xe687ce85), - TOBN(0x9164088d, 0x977eab40), TOBN(0x51f4c5b6, 0x2760b390), - TOBN(0xd238238f, 0x340dd553), TOBN(0x358566c3, 0xdb1d31c9), - TOBN(0x3a5ad69e, 0x5068f5ff), TOBN(0xf31435fc, 0xdaff6b06), - TOBN(0xae549a5b, 0xd6debff0), TOBN(0x59e5f0b7, 0x75e01331), - TOBN(0x5d492fb8, 0x98559acf), TOBN(0x96018c2e, 0x4db79b50), - TOBN(0x55f4a48f, 0x609f66aa), TOBN(0x1943b3af, 0x4900a14f), - TOBN(0xc22496df, 0x15a40d39), TOBN(0xb2a44684, 0x4c20f7c5), - TOBN(0x76a35afa, 0x3b98404c), TOBN(0xbec75725, 0xff5d1b77), - TOBN(0xb67aa163, 0xbea06444), TOBN(0x27e95bb2, 0xf724b6f2), - TOBN(0x3c20e3e9, 0xd238c8ab), TOBN(0x1213754e, 0xddd6ae17), - TOBN(0x8c431020, 0x716e0f74), TOBN(0x6679c82e, 0xffc095c2), - TOBN(0x2eb3adf4, 0xd0ac2932), TOBN(0x2cc970d3, 0x01bb7a76), - TOBN(0x70c71f2f, 0x740f0e66), TOBN(0x545c616b, 0x2b6b23cc), - TOBN(0x4528cfcb, 0xb40a8bd7), TOBN(0xff839633, 0x2ab27722), - TOBN(0x049127d9, 0x025ac99a), TOBN(0xd314d4a0, 0x2b63e33b), - TOBN(0xc8c310e7, 0x28d84519), TOBN(0x0fcb8983, 0xb3bc84ba), - TOBN(0x2cc52261, 0x38634818), TOBN(0x501814f4, 0xb44c2e0b), - TOBN(0xf7e181aa, 0x54dfdba3), TOBN(0xcfd58ff0, 0xe759718c), - TOBN(0xf90cdb14, 0xd3b507a8), TOBN(0x57bd478e, 0xc50bdad8), - TOBN(0x29c197e2, 0x50e5f9aa), TOBN(0x4db6eef8, 0xe40bc855), - TOBN(0x2cc8f21a, 0xd1fc0654), TOBN(0xc71cc963, 0x81269d73), - TOBN(0xecfbb204, 0x077f49f9), TOBN(0xdde92571, 0xca56b793), - TOBN(0x9abed6a3, 0xf97ad8f7), TOBN(0xe6c19d3f, 0x924de3bd), - TOBN(0x8dce92f4, 0xa140a800), TOBN(0x85f44d1e, 0x1337af07), - TOBN(0x5953c08b, 0x09d64c52), TOBN(0xa1b5e49f, 0xf5df9749), - TOBN(0x336a8fb8, 0x52735f7d), TOBN(0xb332b6db, 0x9add676b), - TOBN(0x558b88a0, 0xb4511aa4), TOBN(0x09788752, 0xdbd5cc55), - TOBN(0x16b43b9c, 0xd8cd52bd), TOBN(0x7f0bc5a0, 0xc2a2696b), - TOBN(0x146e12d4, 0xc11f61ef), TOBN(0x9ce10754, 0x3a83e79e), - TOBN(0x08ec73d9, 0x6cbfca15), TOBN(0x09ff29ad, 0x5b49653f), - TOBN(0xe31b72bd, 0xe7da946e), TOBN(0xebf9eb3b, 0xee80a4f2), - TOBN(0xd1aabd08, 0x17598ce4), TOBN(0x18b5fef4, 0x53f37e80), - TOBN(0xd5d5cdd3, 0x5958cd79), TOBN(0x3580a1b5, 0x1d373114), - TOBN(0xa36e4c91, 0xfa935726), TOBN(0xa38c534d, 0xef20d760), - TOBN(0x7088e40a, 0x2ff5845b), TOBN(0xe5bb40bd, 0xbd78177f), - TOBN(0x4f06a7a8, 0x857f9920), TOBN(0xe3cc3e50, 0xe968f05d), - TOBN(0x1d68b7fe, 0xe5682d26), TOBN(0x5206f76f, 0xaec7f87c), - TOBN(0x41110530, 0x041951ab), TOBN(0x58ec52c1, 0xd4b5a71a), - TOBN(0xf3488f99, 0x0f75cf9a), TOBN(0xf411951f, 0xba82d0d5), - TOBN(0x27ee75be, 0x618895ab), TOBN(0xeae060d4, 0x6d8aab14), - TOBN(0x9ae1df73, 0x7fb54dc2), TOBN(0x1f3e391b, 0x25963649), - TOBN(0x242ec32a, 0xfe055081), TOBN(0x5bd450ef, 0x8491c9bd), - TOBN(0x367efc67, 0x981eb389), TOBN(0xed7e1928, 0x3a0550d5), - TOBN(0x362e776b, 0xab3ce75c), TOBN(0xe890e308, 0x1f24c523), - TOBN(0xb961b682, 0xfeccef76), TOBN(0x8b8e11f5, 0x8bba6d92), - TOBN(0x8f2ccc4c, 0x2b2375c4), TOBN(0x0d7f7a52, 0xe2f86cfa), - TOBN(0xfd94d30a, 0x9efe5633), TOBN(0x2d8d246b, 0x5451f934), - TOBN(0x2234c6e3, 0x244e6a00), TOBN(0xde2b5b0d, 0xddec8c50), - TOBN(0x2ce53c5a, 0xbf776f5b), TOBN(0x6f724071, 0x60357b05), - TOBN(0xb2593717, 0x71bf3f7a), TOBN(0x87d2501c, 0x440c4a9f), - TOBN(0x440552e1, 0x87b05340), TOBN(0xb7bf7cc8, 0x21624c32), - TOBN(0x4155a6ce, 0x22facddb), TOBN(0x5a4228cb, 0x889837ef), - TOBN(0xef87d6d6, 0xfd4fd671), TOBN(0xa233687e, 0xc2daa10e), - TOBN(0x75622244, 0x03c0eb96), TOBN(0x7632d184, 0x8bf19be6), - TOBN(0x05d0f8e9, 0x40735ff4), TOBN(0x3a3e6e13, 0xc00931f1), - TOBN(0x31ccde6a, 0xdafe3f18), TOBN(0xf381366a, 0xcfe51207), - TOBN(0x24c222a9, 0x60167d92), TOBN(0x62f9d6f8, 0x7529f18c), - TOBN(0x412397c0, 0x0353b114), TOBN(0x334d89dc, 0xef808043), - TOBN(0xd9ec63ba, 0x2a4383ce), TOBN(0xcec8e937, 0x5cf92ba0), - TOBN(0xfb8b4288, 0xc8be74c0), TOBN(0x67d6912f, 0x105d4391), - TOBN(0x7b996c46, 0x1b913149), TOBN(0x36aae2ef, 0x3a4e02da), - TOBN(0xb68aa003, 0x972de594), TOBN(0x284ec70d, 0x4ec6d545), - TOBN(0xf3d2b2d0, 0x61391d54), TOBN(0x69c5d5d6, 0xfe114e92), - TOBN(0xbe0f00b5, 0xb4482dff), TOBN(0xe1596fa5, 0xf5bf33c5), - TOBN(0x10595b56, 0x96a71cba), TOBN(0x944938b2, 0xfdcadeb7), - TOBN(0xa282da4c, 0xfccd8471), TOBN(0x98ec05f3, 0x0d37bfe1), - TOBN(0xe171ce1b, 0x0698304a), TOBN(0x2d691444, 0x21bdf79b), - TOBN(0xd0cd3b74, 0x1b21dec1), TOBN(0x712ecd8b, 0x16a15f71), - TOBN(0x8d4c00a7, 0x00fd56e1), TOBN(0x02ec9692, 0xf9527c18), - TOBN(0x21c44937, 0x4a3e42e1), TOBN(0x9176fbab, 0x1392ae0a), - TOBN(0x8726f1ba, 0x44b7b618), TOBN(0xb4d7aae9, 0xf1de491c), - TOBN(0xf91df7b9, 0x07b582c0), TOBN(0x7e116c30, 0xef60aa3a), - TOBN(0x99270f81, 0x466265d7), TOBN(0xb15b6fe2, 0x4df7adf0), - TOBN(0xfe33b2d3, 0xf9738f7f), TOBN(0x48553ab9, 0xd6d70f95), - TOBN(0x2cc72ac8, 0xc21e94db), TOBN(0x795ac38d, 0xbdc0bbee), - TOBN(0x0a1be449, 0x2e40478f), TOBN(0x81bd3394, 0x052bde55), - TOBN(0x63c8dbe9, 0x56b3c4f2), TOBN(0x017a99cf, 0x904177cc), - TOBN(0x947bbddb, 0x4d010fc1), TOBN(0xacf9b00b, 0xbb2c9b21), - TOBN(0x2970bc8d, 0x47173611), TOBN(0x1a4cbe08, 0xac7d756f), - TOBN(0x06d9f4aa, 0x67d541a2), TOBN(0xa3e8b689, 0x59c2cf44), - TOBN(0xaad066da, 0x4d88f1dd), TOBN(0xc604f165, 0x7ad35dea), - TOBN(0x7edc0720, 0x4478ca67), TOBN(0xa10dfae0, 0xba02ce06), - TOBN(0xeceb1c76, 0xaf36f4e4), TOBN(0x994b2292, 0xaf3f8f48), - TOBN(0xbf9ed77b, 0x77c8a68c), TOBN(0x74f544ea, 0x51744c9d), - TOBN(0x82d05bb9, 0x8113a757), TOBN(0x4ef2d2b4, 0x8a9885e4), - TOBN(0x1e332be5, 0x1aa7865f), TOBN(0x22b76b18, 0x290d1a52), - TOBN(0x308a2310, 0x44351683), TOBN(0x9d861896, 0xa3f22840), - TOBN(0x5959ddcd, 0x841ed947), TOBN(0x0def0c94, 0x154b73bf), - TOBN(0xf0105417, 0x4c7c15e0), TOBN(0x539bfb02, 0x3a277c32), - TOBN(0xe699268e, 0xf9dccf5f), TOBN(0x9f5796a5, 0x0247a3bd), - TOBN(0x8b839de8, 0x4f157269), TOBN(0xc825c1e5, 0x7a30196b), - TOBN(0x6ef0aabc, 0xdc8a5a91), TOBN(0xf4a8ce6c, 0x498b7fe6), - TOBN(0x1cce35a7, 0x70cbac78), TOBN(0x83488e9b, 0xf6b23958), - TOBN(0x0341a070, 0xd76cb011), TOBN(0xda6c9d06, 0xae1b2658), - TOBN(0xb701fb30, 0xdd648c52), TOBN(0x994ca02c, 0x52fb9fd1), - TOBN(0x06933117, 0x6f563086), TOBN(0x3d2b8100, 0x17856bab), - TOBN(0xe89f48c8, 0x5963a46e), TOBN(0x658ab875, 0xa99e61c7), - TOBN(0x6e296f87, 0x4b8517b4), TOBN(0x36c4fcdc, 0xfc1bc656), - TOBN(0xde5227a1, 0xa3906def), TOBN(0x9fe95f57, 0x62418945), - TOBN(0x20c91e81, 0xfdd96cde), TOBN(0x5adbe47e, 0xda4480de), - TOBN(0xa009370f, 0x396de2b6), TOBN(0x98583d4b, 0xf0ecc7bd), - TOBN(0xf44f6b57, 0xe51d0672), TOBN(0x03d6b078, 0x556b1984), - TOBN(0x27dbdd93, 0xb0b64912), TOBN(0x9b3a3434, 0x15687b09), - TOBN(0x0dba6461, 0x51ec20a9), TOBN(0xec93db7f, 0xff28187c), - TOBN(0x00ff8c24, 0x66e48bdd), TOBN(0x2514f2f9, 0x11ccd78e), - TOBN(0xeba11f4f, 0xe1250603), TOBN(0x8a22cd41, 0x243fa156), - TOBN(0xa4e58df4, 0xb283e4c6), TOBN(0x78c29859, 0x8b39783f), - TOBN(0x5235aee2, 0xa5259809), TOBN(0xc16284b5, 0x0e0227dd), - TOBN(0xa5f57916, 0x1338830d), TOBN(0x6d4b8a6b, 0xd2123fca), - TOBN(0x236ea68a, 0xf9c546f8), TOBN(0xc1d36873, 0xfa608d36), - TOBN(0xcd76e495, 0x8d436d13), TOBN(0xd4d9c221, 0x8fb080af), - TOBN(0x665c1728, 0xe8ad3fb5), TOBN(0xcf1ebe4d, 0xb3d572e0), - TOBN(0xa7a8746a, 0x584c5e20), TOBN(0x267e4ea1, 0xb9dc7035), - TOBN(0x593a15cf, 0xb9548c9b), TOBN(0x5e6e2135, 0x4bd012f3), - TOBN(0xdf31cc6a, 0x8c8f936e), TOBN(0x8af84d04, 0xb5c241dc), - TOBN(0x63990a6f, 0x345efb86), TOBN(0x6fef4e61, 0xb9b962cb)}, - {TOBN(0xf6368f09, 0x25722608), TOBN(0x131260db, 0x131cf5c6), - TOBN(0x40eb353b, 0xfab4f7ac), TOBN(0x85c78880, 0x37eee829), - TOBN(0x4c1581ff, 0xc3bdf24e), TOBN(0x5bff75cb, 0xf5c3c5a8), - TOBN(0x35e8c83f, 0xa14e6f40), TOBN(0xb81d1c0f, 0x0295e0ca), - TOBN(0xfcde7cc8, 0xf43a730f), TOBN(0xe89b6f3c, 0x33ab590e), - TOBN(0xc823f529, 0xad03240b), TOBN(0x82b79afe, 0x98bea5db), - TOBN(0x568f2856, 0x962fe5de), TOBN(0x0c590adb, 0x60c591f3), - TOBN(0x1fc74a14, 0x4a28a858), TOBN(0x3b662498, 0xb3203f4c), - TOBN(0x91e3cf0d, 0x6c39765a), TOBN(0xa2db3acd, 0xac3cca0b), - TOBN(0x288f2f08, 0xcb953b50), TOBN(0x2414582c, 0xcf43cf1a), - TOBN(0x8dec8bbc, 0x60eee9a8), TOBN(0x54c79f02, 0x729aa042), - TOBN(0xd81cd5ec, 0x6532f5d5), TOBN(0xa672303a, 0xcf82e15f), - TOBN(0x376aafa8, 0x719c0563), TOBN(0xcd8ad2dc, 0xbc5fc79f), - TOBN(0x303fdb9f, 0xcb750cd3), TOBN(0x14ff052f, 0x4418b08e), - TOBN(0xf75084cf, 0x3e2d6520), TOBN(0x7ebdf0f8, 0x144ed509), - TOBN(0xf43bf0f2, 0xd3f25b98), TOBN(0x86ad71cf, 0xa354d837), - TOBN(0xb827fe92, 0x26f43572), TOBN(0xdfd3ab5b, 0x5d824758), - TOBN(0x315dd23a, 0x539094c1), TOBN(0x85c0e37a, 0x66623d68), - TOBN(0x575c7972, 0x7be19ae0), TOBN(0x616a3396, 0xdf0d36b5), - TOBN(0xa1ebb3c8, 0x26b1ff7e), TOBN(0x635b9485, 0x140ad453), - TOBN(0x92bf3cda, 0xda430c0b), TOBN(0x4702850e, 0x3a96dac6), - TOBN(0xc91cf0a5, 0x15ac326a), TOBN(0x95de4f49, 0xab8c25e4), - TOBN(0xb01bad09, 0xe265c17c), TOBN(0x24e45464, 0x087b3881), - TOBN(0xd43e583c, 0xe1fac5ca), TOBN(0xe17cb318, 0x6ead97a6), - TOBN(0x6cc39243, 0x74dcec46), TOBN(0x33cfc02d, 0x54c2b73f), - TOBN(0x82917844, 0xf26cd99c), TOBN(0x8819dd95, 0xd1773f89), - TOBN(0x09572aa6, 0x0871f427), TOBN(0x8e0cf365, 0xf6f01c34), - TOBN(0x7fa52988, 0xbff1f5af), TOBN(0x4eb357ea, 0xe75e8e50), - TOBN(0xd9d0c8c4, 0x868af75d), TOBN(0xd7325cff, 0x45c8c7ea), - TOBN(0xab471996, 0xcc81ecb0), TOBN(0xff5d55f3, 0x611824ed), - TOBN(0xbe314541, 0x1977a0ee), TOBN(0x5085c4c5, 0x722038c6), - TOBN(0x2d5335bf, 0xf94bb495), TOBN(0x894ad8a6, 0xc8e2a082), - TOBN(0x5c3e2341, 0xada35438), TOBN(0xf4a9fc89, 0x049b8c4e), - TOBN(0xbeeb355a, 0x9f17cf34), TOBN(0x3f311e0e, 0x6c91fe10), - TOBN(0xc2d20038, 0x92ab9891), TOBN(0x257bdcc1, 0x3e8ce9a9), - TOBN(0x1b2d9789, 0x88c53bee), TOBN(0x927ce89a, 0xcdba143a), - TOBN(0xb0a32cca, 0x523db280), TOBN(0x5c889f8a, 0x50d43783), - TOBN(0x503e04b3, 0x4897d16f), TOBN(0x8cdb6e78, 0x08f5f2e8), - TOBN(0x6ab91cf0, 0x179c8e74), TOBN(0xd8874e52, 0x48211d60), - TOBN(0xf948d4d5, 0xea851200), TOBN(0x4076d41e, 0xe6f9840a), - TOBN(0xc20e263c, 0x47b517ea), TOBN(0x79a448fd, 0x30685e5e), - TOBN(0xe55f6f78, 0xf90631a0), TOBN(0x88a790b1, 0xa79e6346), - TOBN(0x62160c7d, 0x80969fe8), TOBN(0x54f92fd4, 0x41491bb9), - TOBN(0xa6645c23, 0x5c957526), TOBN(0xf44cc5ae, 0xbea3ce7b), - TOBN(0xf7628327, 0x8b1e68b7), TOBN(0xc731ad7a, 0x303f29d3), - TOBN(0xfe5a9ca9, 0x57d03ecb), TOBN(0x96c0d50c, 0x41bc97a7), - TOBN(0xc4669fe7, 0x9b4f7f24), TOBN(0xfdd781d8, 0x3d9967ef), - TOBN(0x7892c7c3, 0x5d2c208d), TOBN(0x8bf64f7c, 0xae545cb3), - TOBN(0xc01f862c, 0x467be912), TOBN(0xf4c85ee9, 0xc73d30cc), - TOBN(0x1fa6f4be, 0x6ab83ec7), TOBN(0xa07a3c1c, 0x4e3e3cf9), - TOBN(0x87f8ef45, 0x0c00beb3), TOBN(0x30e2c2b3, 0x000d4c3e), - TOBN(0x1aa00b94, 0xfe08bf5b), TOBN(0x32c133aa, 0x9224ef52), - TOBN(0x38df16bb, 0x32e5685d), TOBN(0x68a9e069, 0x58e6f544), - TOBN(0x495aaff7, 0xcdc5ebc6), TOBN(0xf894a645, 0x378b135f), - TOBN(0xf316350a, 0x09e27ecf), TOBN(0xeced201e, 0x58f7179d), - TOBN(0x2eec273c, 0xe97861ba), TOBN(0x47ec2cae, 0xd693be2e), - TOBN(0xfa4c97c4, 0xf68367ce), TOBN(0xe4f47d0b, 0xbe5a5755), - TOBN(0x17de815d, 0xb298a979), TOBN(0xd7eca659, 0xc177dc7d), - TOBN(0x20fdbb71, 0x49ded0a3), TOBN(0x4cb2aad4, 0xfb34d3c5), - TOBN(0x2cf31d28, 0x60858a33), TOBN(0x3b6873ef, 0xa24aa40f), - TOBN(0x540234b2, 0x2c11bb37), TOBN(0x2d0366dd, 0xed4c74a3), - TOBN(0xf9a968da, 0xeec5f25d), TOBN(0x36601068, 0x67b63142), - TOBN(0x07cd6d2c, 0x68d7b6d4), TOBN(0xa8f74f09, 0x0c842942), - TOBN(0xe2751404, 0x7768b1ee), TOBN(0x4b5f7e89, 0xfe62aee4), - TOBN(0xc6a77177, 0x89070d26), TOBN(0xa1f28e4e, 0xdd1c8bc7), - TOBN(0xea5f4f06, 0x469e1f17), TOBN(0x78fc242a, 0xfbdb78e0), - TOBN(0xc9c7c592, 0x8b0588f1), TOBN(0xb6b7a0fd, 0x1535921e), - TOBN(0xcc5bdb91, 0xbde5ae35), TOBN(0xb42c485e, 0x12ff1864), - TOBN(0xa1113e13, 0xdbab98aa), TOBN(0xde9d469b, 0xa17b1024), - TOBN(0x23f48b37, 0xc0462d3a), TOBN(0x3752e537, 0x7c5c078d), - TOBN(0xe3a86add, 0x15544eb9), TOBN(0xf013aea7, 0x80fba279), - TOBN(0x8b5bb76c, 0xf22001b5), TOBN(0xe617ba14, 0xf02891ab), - TOBN(0xd39182a6, 0x936219d3), TOBN(0x5ce1f194, 0xae51cb19), - TOBN(0xc78f8598, 0xbf07a74c), TOBN(0x6d7158f2, 0x22cbf1bc), - TOBN(0x3b846b21, 0xe300ce18), TOBN(0x35fba630, 0x2d11275d), - TOBN(0x5fe25c36, 0xa0239b9b), TOBN(0xd8beb35d, 0xdf05d940), - TOBN(0x4db02bb0, 0x1f7e320d), TOBN(0x0641c364, 0x6da320ea), - TOBN(0x6d95fa5d, 0x821389a3), TOBN(0x92699748, 0x8fcd8e3d), - TOBN(0x316fef17, 0xceb6c143), TOBN(0x67fcb841, 0xd933762b), - TOBN(0xbb837e35, 0x118b17f8), TOBN(0x4b92552f, 0x9fd24821), - TOBN(0xae6bc70e, 0x46aca793), TOBN(0x1cf0b0e4, 0xe579311b), - TOBN(0x8dc631be, 0x5802f716), TOBN(0x099bdc6f, 0xbddbee4d), - TOBN(0xcc352bb2, 0x0caf8b05), TOBN(0xf74d505a, 0x72d63df2), - TOBN(0xb9876d4b, 0x91c4f408), TOBN(0x1ce18473, 0x9e229b2d), - TOBN(0x49507597, 0x83abdb4a), TOBN(0x850fbcb6, 0xdee84b18), - TOBN(0x6325236e, 0x609e67dc), TOBN(0x04d831d9, 0x9336c6d8), - TOBN(0x8deaae3b, 0xfa12d45d), TOBN(0xe425f8ce, 0x4746e246), - TOBN(0x8004c175, 0x24f5f31e), TOBN(0xaca16d8f, 0xad62c3b7), - TOBN(0x0dc15a6a, 0x9152f934), TOBN(0xf1235e5d, 0xed0e12c1), - TOBN(0xc33c06ec, 0xda477dac), TOBN(0x76be8732, 0xb2ea0006), - TOBN(0xcf3f7831, 0x0c0cd313), TOBN(0x3c524553, 0xa614260d), - TOBN(0x31a756f8, 0xcab22d15), TOBN(0x03ee10d1, 0x77827a20), - TOBN(0xd1e059b2, 0x1994ef20), TOBN(0x2a653b69, 0x638ae318), - TOBN(0x70d5eb58, 0x2f699010), TOBN(0x279739f7, 0x09f5f84a), - TOBN(0x5da4663c, 0x8b799336), TOBN(0xfdfdf14d, 0x203c37eb), - TOBN(0x32d8a9dc, 0xa1dbfb2d), TOBN(0xab40cff0, 0x77d48f9b), - TOBN(0xc018b383, 0xd20b42d5), TOBN(0xf9a810ef, 0x9f78845f), - TOBN(0x40af3753, 0xbdba9df0), TOBN(0xb90bdcfc, 0x131dfdf9), - TOBN(0x18720591, 0xf01ab782), TOBN(0xc823f211, 0x6af12a88), - TOBN(0xa51b80f3, 0x0dc14401), TOBN(0xde248f77, 0xfb2dfbe3), - TOBN(0xef5a44e5, 0x0cafe751), TOBN(0x73997c9c, 0xd4dcd221), - TOBN(0x32fd86d1, 0xde854024), TOBN(0xd5b53adc, 0xa09b84bb), - TOBN(0x008d7a11, 0xdcedd8d1), TOBN(0x406bd1c8, 0x74b32c84), - TOBN(0x5d4472ff, 0x05dde8b1), TOBN(0x2e25f2cd, 0xfce2b32f), - TOBN(0xbec0dd5e, 0x29dfc254), TOBN(0x4455fcf6, 0x2b98b267), - TOBN(0x0b4d43a5, 0xc72df2ad), TOBN(0xea70e6be, 0x48a75397), - TOBN(0x2aad6169, 0x5820f3bf), TOBN(0xf410d2dd, 0x9e37f68f), - TOBN(0x70fb7dba, 0x7be5ac83), TOBN(0x636bb645, 0x36ec3eec), - TOBN(0x27104ea3, 0x9754e21c), TOBN(0xbc87a3e6, 0x8d63c373), - TOBN(0x483351d7, 0x4109db9a), TOBN(0x0fa724e3, 0x60134da7), - TOBN(0x9ff44c29, 0xb0720b16), TOBN(0x2dd0cf13, 0x06aceead), - TOBN(0x5942758c, 0xe26929a6), TOBN(0x96c5db92, 0xb766a92b), - TOBN(0xcec7d4c0, 0x5f18395e), TOBN(0xd3f22744, 0x1f80d032), - TOBN(0x7a68b37a, 0xcb86075b), TOBN(0x074764dd, 0xafef92db), - TOBN(0xded1e950, 0x7bc7f389), TOBN(0xc580c850, 0xb9756460), - TOBN(0xaeeec2a4, 0x7da48157), TOBN(0x3f0b4e7f, 0x82c587b3), - TOBN(0x231c6de8, 0xa9f19c53), TOBN(0x5717bd73, 0x6974e34e), - TOBN(0xd9e1d216, 0xf1508fa9), TOBN(0x9f112361, 0xdadaa124), - TOBN(0x80145e31, 0x823b7348), TOBN(0x4dd8f0d5, 0xac634069), - TOBN(0xe3d82fc7, 0x2297c258), TOBN(0x276fcfee, 0x9cee7431), - TOBN(0x8eb61b5e, 0x2bc0aea9), TOBN(0x4f668fd5, 0xde329431), - TOBN(0x03a32ab1, 0x38e4b87e), TOBN(0xe1374517, 0x73d0ef0b), - TOBN(0x1a46f7e6, 0x853ac983), TOBN(0xc3bdf42e, 0x68e78a57), - TOBN(0xacf20785, 0x2ea96dd1), TOBN(0xa10649b9, 0xf1638460), - TOBN(0xf2369f0b, 0x879fbbed), TOBN(0x0ff0ae86, 0xda9d1869), - TOBN(0x5251d759, 0x56766f45), TOBN(0x4984d8c0, 0x2be8d0fc), - TOBN(0x7ecc95a6, 0xd21008f0), TOBN(0x29bd54a0, 0x3a1a1c49), - TOBN(0xab9828c5, 0xd26c50f3), TOBN(0x32c0087c, 0x51d0d251), - TOBN(0x9bac3ce6, 0x0c1cdb26), TOBN(0xcd94d947, 0x557ca205), - TOBN(0x1b1bd598, 0x9db1fdcd), TOBN(0x0eda0108, 0xa3d8b149), - TOBN(0x95066610, 0x56152fcc), TOBN(0xc2f037e6, 0xe7192b33), - TOBN(0xdeffb41a, 0xc92e05a4), TOBN(0x1105f6c2, 0xc2f6c62e), - TOBN(0x68e73500, 0x8733913c), TOBN(0xcce86163, 0x3f3adc40), - TOBN(0xf407a942, 0x38a278e9), TOBN(0xd13c1b9d, 0x2ab21292), - TOBN(0x93ed7ec7, 0x1c74cf5c), TOBN(0x8887dc48, 0xf1a4c1b4), - TOBN(0x3830ff30, 0x4b3a11f1), TOBN(0x358c5a3c, 0x58937cb6), - TOBN(0x027dc404, 0x89022829), TOBN(0x40e93977, 0x3b798f79), - TOBN(0x90ad3337, 0x38be6ead), TOBN(0x9c23f6bc, 0xf34c0a5d), - TOBN(0xd1711a35, 0xfbffd8bb), TOBN(0x60fcfb49, 0x1949d3dd), - TOBN(0x09c8ef4b, 0x7825d93a), TOBN(0x24233cff, 0xa0a8c968), - TOBN(0x67ade46c, 0xe6d982af), TOBN(0xebb6bf3e, 0xe7544d7c), - TOBN(0xd6b9ba76, 0x3d8bd087), TOBN(0x46fe382d, 0x4dc61280), - TOBN(0xbd39a7e8, 0xb5bdbd75), TOBN(0xab381331, 0xb8f228fe), - TOBN(0x0709a77c, 0xce1c4300), TOBN(0x6a247e56, 0xf337ceac), - TOBN(0x8f34f21b, 0x636288be), TOBN(0x9dfdca74, 0xc8a7c305), - TOBN(0x6decfd1b, 0xea919e04), TOBN(0xcdf2688d, 0x8e1991f8), - TOBN(0xe607df44, 0xd0f8a67e), TOBN(0xd985df4b, 0x0b58d010), - TOBN(0x57f834c5, 0x0c24f8f4), TOBN(0xe976ef56, 0xa0bf01ae), - TOBN(0x536395ac, 0xa1c32373), TOBN(0x351027aa, 0x734c0a13), - TOBN(0xd2f1b5d6, 0x5e6bd5bc), TOBN(0x2b539e24, 0x223debed), - TOBN(0xd4994cec, 0x0eaa1d71), TOBN(0x2a83381d, 0x661dcf65), - TOBN(0x5f1aed2f, 0x7b54c740), TOBN(0x0bea3fa5, 0xd6dda5ee), - TOBN(0x9d4fb684, 0x36cc6134), TOBN(0x8eb9bbf3, 0xc0a443dd), - TOBN(0xfc500e2e, 0x383b7d2a), TOBN(0x7aad621c, 0x5b775257), - TOBN(0x69284d74, 0x0a8f7cc0), TOBN(0xe820c2ce, 0x07562d65), - TOBN(0xbf9531b9, 0x499758ee), TOBN(0x73e95ca5, 0x6ee0cc2d), - TOBN(0xf61790ab, 0xfbaf50a5), TOBN(0xdf55e76b, 0x684e0750), - TOBN(0xec516da7, 0xf176b005), TOBN(0x575553bb, 0x7a2dddc7), - TOBN(0x37c87ca3, 0x553afa73), TOBN(0x315f3ffc, 0x4d55c251), - TOBN(0xe846442a, 0xaf3e5d35), TOBN(0x61b91149, 0x6495ff28), - TOBN(0x23cc95d3, 0xfa326dc3), TOBN(0x1df4da1f, 0x18fc2cea), - TOBN(0x24bf9adc, 0xd0a37d59), TOBN(0xb6710053, 0x320d6e1e), - TOBN(0x96f9667e, 0x618344d1), TOBN(0xcc7ce042, 0xa06445af), - TOBN(0xa02d8514, 0xd68dbc3a), TOBN(0x4ea109e4, 0x280b5a5b), - TOBN(0x5741a7ac, 0xb40961bf), TOBN(0x4ada5937, 0x6aa56bfa), - TOBN(0x7feb9145, 0x02b765d1), TOBN(0x561e97be, 0xe6ad1582), - TOBN(0xbbc4a5b6, 0xda3982f5), TOBN(0x0c2659ed, 0xb546f468), - TOBN(0xb8e7e6aa, 0x59612d20), TOBN(0xd83dfe20, 0xac19e8e0), - TOBN(0x8530c45f, 0xb835398c), TOBN(0x6106a8bf, 0xb38a41c2), - TOBN(0x21e8f9a6, 0x35f5dcdb), TOBN(0x39707137, 0xcae498ed), - TOBN(0x70c23834, 0xd8249f00), TOBN(0x9f14b58f, 0xab2537a0), - TOBN(0xd043c365, 0x5f61c0c2), TOBN(0xdc5926d6, 0x09a194a7), - TOBN(0xddec0339, 0x8e77738a), TOBN(0xd07a63ef, 0xfba46426), - TOBN(0x2e58e79c, 0xee7f6e86), TOBN(0xe59b0459, 0xff32d241), - TOBN(0xc5ec84e5, 0x20fa0338), TOBN(0x97939ac8, 0xeaff5ace), - TOBN(0x0310a4e3, 0xb4a38313), TOBN(0x9115fba2, 0x8f9d9885), - TOBN(0x8dd710c2, 0x5fadf8c3), TOBN(0x66be38a2, 0xce19c0e2), - TOBN(0xd42a279c, 0x4cfe5022), TOBN(0x597bb530, 0x0e24e1b8), - TOBN(0x3cde86b7, 0xc153ca7f), TOBN(0xa8d30fb3, 0x707d63bd), - TOBN(0xac905f92, 0xbd60d21e), TOBN(0x98e7ffb6, 0x7b9a54ab), - TOBN(0xd7147df8, 0xe9726a30), TOBN(0xb5e216ff, 0xafce3533), - TOBN(0xb550b799, 0x2ff1ec40), TOBN(0x6b613b87, 0xa1e953fd), - TOBN(0x87b88dba, 0x792d5610), TOBN(0x2ee1270a, 0xa190fbe1), - TOBN(0x02f4e2dc, 0x2ef581da), TOBN(0x016530e4, 0xeff82a95), - TOBN(0xcbb93dfd, 0x8fd6ee89), TOBN(0x16d3d986, 0x46848fff), - TOBN(0x600eff24, 0x1da47adf), TOBN(0x1b9754a0, 0x0ad47a71), - TOBN(0x8f9266df, 0x70c33b98), TOBN(0xaadc87ae, 0xdf34186e), - TOBN(0x0d2ce8e1, 0x4ad24132), TOBN(0x8a47cbfc, 0x19946eba), - TOBN(0x47feeb66, 0x62b5f3af), TOBN(0xcefab561, 0x0abb3734), - TOBN(0x449de60e, 0x19f35cb1), TOBN(0x39f8db14, 0x157f0eb9), - TOBN(0xffaecc5b, 0x3c61bfd6), TOBN(0xa5a4d41d, 0x41216703), - TOBN(0x7f8fabed, 0x224e1cc2), TOBN(0x0d5a8186, 0x871ad953), - TOBN(0xf10774f7, 0xd22da9a9), TOBN(0x45b8a678, 0xcc8a9b0d), - TOBN(0xd9c2e722, 0xbdc32cff), TOBN(0xbf71b5f5, 0x337202a5), - TOBN(0x95c57f2f, 0x69fc4db9), TOBN(0xb6dad34c, 0x765d01e1), - TOBN(0x7e0bd13f, 0xcb904635), TOBN(0x61751253, 0x763a588c), - TOBN(0xd85c2997, 0x81af2c2d), TOBN(0xc0f7d9c4, 0x81b9d7da), - TOBN(0x838a34ae, 0x08533e8d), TOBN(0x15c4cb08, 0x311d8311), - TOBN(0x97f83285, 0x8e121e14), TOBN(0xeea7dc1e, 0x85000a5f), - TOBN(0x0c6059b6, 0x5d256274), TOBN(0xec9beace, 0xb95075c0), - TOBN(0x173daad7, 0x1df97828), TOBN(0xbf851cb5, 0xa8937877), - TOBN(0xb083c594, 0x01646f3c), TOBN(0x3bad30cf, 0x50c6d352), - TOBN(0xfeb2b202, 0x496bbcea), TOBN(0x3cf9fd4f, 0x18a1e8ba), - TOBN(0xd26de7ff, 0x1c066029), TOBN(0x39c81e9e, 0x4e9ed4f8), - TOBN(0xd8be0cb9, 0x7b390d35), TOBN(0x01df2bbd, 0x964aab27), - TOBN(0x3e8c1a65, 0xc3ef64f8), TOBN(0x567291d1, 0x716ed1dd), - TOBN(0x95499c6c, 0x5f5406d3), TOBN(0x71fdda39, 0x5ba8e23f), - TOBN(0xcfeb320e, 0xd5096ece), TOBN(0xbe7ba92b, 0xca66dd16), - TOBN(0x4608d36b, 0xc6fb5a7d), TOBN(0xe3eea15a, 0x6d2dd0e0), - TOBN(0x75b0a3eb, 0x8f97a36a), TOBN(0xf59814cc, 0x1c83de1e), - TOBN(0x56c9c5b0, 0x1c33c23f), TOBN(0xa96c1da4, 0x6faa4136), - TOBN(0x46bf2074, 0xde316551), TOBN(0x3b866e7b, 0x1f756c8f), - TOBN(0x727727d8, 0x1495ed6b), TOBN(0xb2394243, 0xb682dce7), - TOBN(0x8ab8454e, 0x758610f3), TOBN(0xc243ce84, 0x857d72a4), - TOBN(0x7b320d71, 0xdbbf370f), TOBN(0xff9afa37, 0x78e0f7ca), - TOBN(0x0119d1e0, 0xea7b523f), TOBN(0xb997f8cb, 0x058c7d42), - TOBN(0x285bcd2a, 0x37bbb184), TOBN(0x51dcec49, 0xa45d1fa6), - TOBN(0x6ade3b64, 0xe29634cb), TOBN(0x080c94a7, 0x26b86ef1), - TOBN(0xba583db1, 0x2283fbe3), TOBN(0x902bddc8, 0x5a9315ed), - TOBN(0x07c1ccb3, 0x86964bec), TOBN(0x78f4eacf, 0xb6258301), - TOBN(0x4bdf3a49, 0x56f90823), TOBN(0xba0f5080, 0x741d777b), - TOBN(0x091d71c3, 0xf38bf760), TOBN(0x9633d50f, 0x9b625b02), - TOBN(0x03ecb743, 0xb8c9de61), TOBN(0xb4751254, 0x5de74720), - TOBN(0x9f9defc9, 0x74ce1cb2), TOBN(0x774a4f6a, 0x00bd32ef), - TOBN(0xaca385f7, 0x73848f22), TOBN(0x53dad716, 0xf3f8558e), - TOBN(0xab7b34b0, 0x93c471f9), TOBN(0xf530e069, 0x19644bc7), - TOBN(0x3d9fb1ff, 0xdd59d31a), TOBN(0x4382e0df, 0x08daa795), - TOBN(0x165c6f4b, 0xd5cc88d7), TOBN(0xeaa392d5, 0x4a18c900), - TOBN(0x94203c67, 0x648024ee), TOBN(0x188763f2, 0x8c2fabcd), - TOBN(0xa80f87ac, 0xbbaec835), TOBN(0x632c96e0, 0xf29d8d54), - TOBN(0x29b0a60e, 0x4c00a95e), TOBN(0x2ef17f40, 0xe011e9fa), - TOBN(0xf6c0e1d1, 0x15b77223), TOBN(0xaaec2c62, 0x14b04e32), - TOBN(0xd35688d8, 0x3d84e58c), TOBN(0x2af5094c, 0x958571db), - TOBN(0x4fff7e19, 0x760682a6), TOBN(0x4cb27077, 0xe39a407c), - TOBN(0x0f59c547, 0x4ff0e321), TOBN(0x169f34a6, 0x1b34c8ff), - TOBN(0x2bff1096, 0x52bc1ba7), TOBN(0xa25423b7, 0x83583544), - TOBN(0x5d55d5d5, 0x0ac8b782), TOBN(0xff6622ec, 0x2db3c892), - TOBN(0x48fce741, 0x6b8bb642), TOBN(0x31d6998c, 0x69d7e3dc), - TOBN(0xdbaf8004, 0xcadcaed0), TOBN(0x801b0142, 0xd81d053c), - TOBN(0x94b189fc, 0x59630ec6), TOBN(0x120e9934, 0xaf762c8e), - TOBN(0x53a29aa4, 0xfdc6a404), TOBN(0x19d8e01e, 0xa1909948), - TOBN(0x3cfcabf1, 0xd7e89681), TOBN(0x3321a50d, 0x4e132d37), - TOBN(0xd0496863, 0xe9a86111), TOBN(0x8c0cde61, 0x06a3bc65), - TOBN(0xaf866c49, 0xfc9f8eef), TOBN(0x2066350e, 0xff7f5141), - TOBN(0x4f8a4689, 0xe56ddfbd), TOBN(0xea1b0c07, 0xfe32983a), - TOBN(0x2b317462, 0x873cb8cb), TOBN(0x658deddc, 0x2d93229f), - TOBN(0x65efaf4d, 0x0f64ef58), TOBN(0xfe43287d, 0x730cc7a8), - TOBN(0xaebc0c72, 0x3d047d70), TOBN(0x92efa539, 0xd92d26c9), - TOBN(0x06e78457, 0x94b56526), TOBN(0x415cb80f, 0x0961002d), - TOBN(0x89e5c565, 0x76dcb10f), TOBN(0x8bbb6982, 0xff9259fe), - TOBN(0x4fe8795b, 0x9abc2668), TOBN(0xb5d4f534, 0x1e678fb1), - TOBN(0x6601f3be, 0x7b7da2b9), TOBN(0x98da59e2, 0xa13d6805), - TOBN(0x190d8ea6, 0x01799a52), TOBN(0xa20cec41, 0xb86d2952), - TOBN(0x3062ffb2, 0x7fff2a7c), TOBN(0x741b32e5, 0x79f19d37), - TOBN(0xf80d8181, 0x4eb57d47), TOBN(0x7a2d0ed4, 0x16aef06b), - TOBN(0x09735fb0, 0x1cecb588), TOBN(0x1641caaa, 0xc6061f5b)}, - {TOBN(0x7f99824f, 0x20151427), TOBN(0x206828b6, 0x92430206), - TOBN(0xaa9097d7, 0xe1112357), TOBN(0xacf9a2f2, 0x09e414ec), - TOBN(0xdbdac9da, 0x27915356), TOBN(0x7e0734b7, 0x001efee3), - TOBN(0x54fab5bb, 0xd2b288e2), TOBN(0x4c630fc4, 0xf62dd09c), - TOBN(0x8537107a, 0x1ac2703b), TOBN(0xb49258d8, 0x6bc857b5), - TOBN(0x57df14de, 0xbcdaccd1), TOBN(0x24ab68d7, 0xc4ae8529), - TOBN(0x7ed8b5d4, 0x734e59d0), TOBN(0x5f8740c8, 0xc495cc80), - TOBN(0x84aedd5a, 0x291db9b3), TOBN(0x80b360f8, 0x4fb995be), - TOBN(0xae915f5d, 0x5fa067d1), TOBN(0x4134b57f, 0x9668960c), - TOBN(0xbd3656d6, 0xa48edaac), TOBN(0xdac1e3e4, 0xfc1d7436), - TOBN(0x674ff869, 0xd81fbb26), TOBN(0x449ed3ec, 0xb26c33d4), - TOBN(0x85138705, 0xd94203e8), TOBN(0xccde538b, 0xbeeb6f4a), - TOBN(0x55d5c68d, 0xa61a76fa), TOBN(0x598b441d, 0xca1554dc), - TOBN(0xd39923b9, 0x773b279c), TOBN(0x33331d3c, 0x36bf9efc), - TOBN(0x2d4c848e, 0x298de399), TOBN(0xcfdb8e77, 0xa1a27f56), - TOBN(0x94c855ea, 0x57b8ab70), TOBN(0xdcdb9dae, 0x6f7879ba), - TOBN(0x7bdff8c2, 0x019f2a59), TOBN(0xb3ce5bb3, 0xcb4fbc74), - TOBN(0xea907f68, 0x8a9173dd), TOBN(0x6cd3d0d3, 0x95a75439), - TOBN(0x92ecc4d6, 0xefed021c), TOBN(0x09a9f9b0, 0x6a77339a), - TOBN(0x87ca6b15, 0x7188c64a), TOBN(0x10c29968, 0x44899158), - TOBN(0x5859a229, 0xed6e82ef), TOBN(0x16f338e3, 0x65ebaf4e), - TOBN(0x0cd31387, 0x5ead67ae), TOBN(0x1c73d228, 0x54ef0bb4), - TOBN(0x4cb55131, 0x74a5c8c7), TOBN(0x01cd2970, 0x7f69ad6a), - TOBN(0xa04d00dd, 0xe966f87e), TOBN(0xd96fe447, 0x0b7b0321), - TOBN(0x342ac06e, 0x88fbd381), TOBN(0x02cd4a84, 0x5c35a493), - TOBN(0xe8fa89de, 0x54f1bbcd), TOBN(0x341d6367, 0x2575ed4c), - TOBN(0xebe357fb, 0xd238202b), TOBN(0x600b4d1a, 0xa984ead9), - TOBN(0xc35c9f44, 0x52436ea0), TOBN(0x96fe0a39, 0xa370751b), - TOBN(0x4c4f0736, 0x7f636a38), TOBN(0x9f943fb7, 0x0e76d5cb), - TOBN(0xb03510ba, 0xa8b68b8b), TOBN(0xc246780a, 0x9ed07a1f), - TOBN(0x3c051415, 0x6d549fc2), TOBN(0xc2953f31, 0x607781ca), - TOBN(0x955e2c69, 0xd8d95413), TOBN(0xb300fadc, 0x7bd282e3), - TOBN(0x81fe7b50, 0x87e9189f), TOBN(0xdb17375c, 0xf42dda27), - TOBN(0x22f7d896, 0xcf0a5904), TOBN(0xa0e57c5a, 0xebe348e6), - TOBN(0xa61011d3, 0xf40e3c80), TOBN(0xb1189321, 0x8db705c5), - TOBN(0x4ed9309e, 0x50fedec3), TOBN(0xdcf14a10, 0x4d6d5c1d), - TOBN(0x056c265b, 0x55691342), TOBN(0xe8e08504, 0x91049dc7), - TOBN(0x131329f5, 0xc9bae20a), TOBN(0x96c8b3e8, 0xd9dccdb4), - TOBN(0x8c5ff838, 0xfb4ee6b4), TOBN(0xfc5a9aeb, 0x41e8ccf0), - TOBN(0x7417b764, 0xfae050c6), TOBN(0x0953c3d7, 0x00452080), - TOBN(0x21372682, 0x38dfe7e8), TOBN(0xea417e15, 0x2bb79d4b), - TOBN(0x59641f1c, 0x76e7cf2d), TOBN(0x271e3059, 0xea0bcfcc), - TOBN(0x624c7dfd, 0x7253ecbd), TOBN(0x2f552e25, 0x4fca6186), - TOBN(0xcbf84ecd, 0x4d866e9c), TOBN(0x73967709, 0xf68d4610), - TOBN(0xa14b1163, 0xc27901b4), TOBN(0xfd9236e0, 0x899b8bf3), - TOBN(0x42b091ec, 0xcbc6da0a), TOBN(0xbb1dac6f, 0x5ad1d297), - TOBN(0x80e61d53, 0xa91cf76e), TOBN(0x4110a412, 0xd31f1ee7), - TOBN(0x2d87c3ba, 0x13efcf77), TOBN(0x1f374bb4, 0xdf450d76), - TOBN(0x5e78e2f2, 0x0d188dab), TOBN(0xe3968ed0, 0xf4b885ef), - TOBN(0x46c0568e, 0x7314570f), TOBN(0x31616338, 0x01170521), - TOBN(0x18e1e7e2, 0x4f0c8afe), TOBN(0x4caa75ff, 0xdeea78da), - TOBN(0x82db67f2, 0x7c5d8a51), TOBN(0x36a44d86, 0x6f505370), - TOBN(0xd72c5bda, 0x0333974f), TOBN(0x5db516ae, 0x27a70146), - TOBN(0x34705281, 0x210ef921), TOBN(0xbff17a8f, 0x0c9c38e5), - TOBN(0x78f4814e, 0x12476da1), TOBN(0xc1e16613, 0x33c16980), - TOBN(0x9e5b386f, 0x424d4bca), TOBN(0x4c274e87, 0xc85740de), - TOBN(0xb6a9b88d, 0x6c2f5226), TOBN(0x14d1b944, 0x550d7ca8), - TOBN(0x580c85fc, 0x1fc41709), TOBN(0xc1da368b, 0x54c6d519), - TOBN(0x2b0785ce, 0xd5113cf7), TOBN(0x0670f633, 0x5a34708f), - TOBN(0x46e23767, 0x15cc3f88), TOBN(0x1b480cfa, 0x50c72c8f), - TOBN(0x20288602, 0x4147519a), TOBN(0xd0981eac, 0x26b372f0), - TOBN(0xa9d4a7ca, 0xa785ebc8), TOBN(0xd953c50d, 0xdbdf58e9), - TOBN(0x9d6361cc, 0xfd590f8f), TOBN(0x72e9626b, 0x44e6c917), - TOBN(0x7fd96110, 0x22eb64cf), TOBN(0x863ebb7e, 0x9eb288f3), - TOBN(0x6e6ab761, 0x6aca8ee7), TOBN(0x97d10b39, 0xd7b40358), - TOBN(0x1687d377, 0x1e5feb0d), TOBN(0xc83e50e4, 0x8265a27a), - TOBN(0x8f75a9fe, 0xc954b313), TOBN(0xcc2e8f47, 0x310d1f61), - TOBN(0xf5ba81c5, 0x6557d0e0), TOBN(0x25f9680c, 0x3eaf6207), - TOBN(0xf95c6609, 0x4354080b), TOBN(0x5225bfa5, 0x7bf2fe1c), - TOBN(0xc5c004e2, 0x5c7d98fa), TOBN(0x3561bf1c, 0x019aaf60), - TOBN(0x5e6f9f17, 0xba151474), TOBN(0xdec2f934, 0xb04f6eca), - TOBN(0x64e368a1, 0x269acb1e), TOBN(0x1332d9e4, 0x0cdda493), - TOBN(0x60d6cf69, 0xdf23de05), TOBN(0x66d17da2, 0x009339a0), - TOBN(0x9fcac985, 0x0a693923), TOBN(0xbcf057fc, 0xed7c6a6d), - TOBN(0xc3c5c8c5, 0xf0b5662c), TOBN(0x25318dd8, 0xdcba4f24), - TOBN(0x60e8cb75, 0x082b69ff), TOBN(0x7c23b3ee, 0x1e728c01), - TOBN(0x15e10a0a, 0x097e4403), TOBN(0xcb3d0a86, 0x19854665), - TOBN(0x88d8e211, 0xd67d4826), TOBN(0xb39af66e, 0x0b9d2839), - TOBN(0xa5f94588, 0xbd475ca8), TOBN(0xe06b7966, 0xc077b80b), - TOBN(0xfedb1485, 0xda27c26c), TOBN(0xd290d33a, 0xfe0fd5e0), - TOBN(0xa40bcc47, 0xf34fb0fa), TOBN(0xb4760cc8, 0x1fb1ab09), - TOBN(0x8fca0993, 0xa273bfe3), TOBN(0x13e4fe07, 0xf70b213c), - TOBN(0x3bcdb992, 0xfdb05163), TOBN(0x8c484b11, 0x0c2b19b6), - TOBN(0x1acb815f, 0xaaf2e3e2), TOBN(0xc6905935, 0xb89ff1b4), - TOBN(0xb2ad6f9d, 0x586e74e1), TOBN(0x488883ad, 0x67b80484), - TOBN(0x758aa2c7, 0x369c3ddb), TOBN(0x8ab74e69, 0x9f9afd31), - TOBN(0x10fc2d28, 0x5e21beb1), TOBN(0x3484518a, 0x318c42f9), - TOBN(0x377427dc, 0x53cf40c3), TOBN(0x9de0781a, 0x391bc1d9), - TOBN(0x8faee858, 0x693807e1), TOBN(0xa3865327, 0x4e81ccc7), - TOBN(0x02c30ff2, 0x6f835b84), TOBN(0xb604437b, 0x0d3d38d4), - TOBN(0xb3fc8a98, 0x5ca1823d), TOBN(0xb82f7ec9, 0x03be0324), - TOBN(0xee36d761, 0xcf684a33), TOBN(0x5a01df0e, 0x9f29bf7d), - TOBN(0x686202f3, 0x1306583d), TOBN(0x05b10da0, 0x437c622e), - TOBN(0xbf9aaa0f, 0x076a7bc8), TOBN(0x25e94efb, 0x8f8f4e43), - TOBN(0x8a35c9b7, 0xfa3dc26d), TOBN(0xe0e5fb93, 0x96ff03c5), - TOBN(0xa77e3843, 0xebc394ce), TOBN(0xcede6595, 0x8361de60), - TOBN(0xd27c22f6, 0xa1993545), TOBN(0xab01cc36, 0x24d671ba), - TOBN(0x63fa2877, 0xa169c28e), TOBN(0x925ef904, 0x2eb08376), - TOBN(0x3b2fa3cf, 0x53aa0b32), TOBN(0xb27beb5b, 0x71c49d7a), - TOBN(0xb60e1834, 0xd105e27f), TOBN(0xd6089788, 0x4f68570d), - TOBN(0x23094ce0, 0xd6fbc2ac), TOBN(0x738037a1, 0x815ff551), - TOBN(0xda73b1bb, 0x6bef119c), TOBN(0xdcf6c430, 0xeef506ba), - TOBN(0x00e4fe7b, 0xe3ef104a), TOBN(0xebdd9a2c, 0x0a065628), - TOBN(0x853a81c3, 0x8792043e), TOBN(0x22ad6ece, 0xb3b59108), - TOBN(0x9fb813c0, 0x39cd297d), TOBN(0x8ec7e16e, 0x05bda5d9), - TOBN(0x2834797c, 0x0d104b96), TOBN(0xcc11a2e7, 0x7c511510), - TOBN(0x96ca5a53, 0x96ee6380), TOBN(0x054c8655, 0xcea38742), - TOBN(0xb5946852, 0xd54dfa7d), TOBN(0x97c422e7, 0x1f4ab207), - TOBN(0xbf907509, 0x0c22b540), TOBN(0x2cde42aa, 0xb7c267d4), - TOBN(0xba18f9ed, 0x5ab0d693), TOBN(0x3ba62aa6, 0x6e4660d9), - TOBN(0xb24bf97b, 0xab9ea96a), TOBN(0x5d039642, 0xe3b60e32), - TOBN(0x4e6a4506, 0x7c4d9bd5), TOBN(0x666c5b9e, 0x7ed4a6a4), - TOBN(0xfa3fdcd9, 0x8edbd7cc), TOBN(0x4660bb87, 0xc6ccd753), - TOBN(0x9ae90820, 0x21e6b64f), TOBN(0x8a56a713, 0xb36bfb3f), - TOBN(0xabfce096, 0x5726d47f), TOBN(0x9eed01b2, 0x0b1a9a7f), - TOBN(0x30e9cad4, 0x4eb74a37), TOBN(0x7b2524cc, 0x53e9666d), - TOBN(0x6a29683b, 0x8f4b002f), TOBN(0xc2200d7a, 0x41f4fc20), - TOBN(0xcf3af47a, 0x3a338acc), TOBN(0x6539a4fb, 0xe7128975), - TOBN(0xcec31c14, 0xc33c7fcf), TOBN(0x7eb6799b, 0xc7be322b), - TOBN(0x119ef4e9, 0x6646f623), TOBN(0x7b7a26a5, 0x54d7299b), - TOBN(0xcb37f08d, 0x403f46f2), TOBN(0x94b8fc43, 0x1a0ec0c7), - TOBN(0xbb8514e3, 0xc332142f), TOBN(0xf3ed2c33, 0xe80d2a7a), - TOBN(0x8d2080af, 0xb639126c), TOBN(0xf7b6be60, 0xe3553ade), - TOBN(0x3950aa9f, 0x1c7e2b09), TOBN(0x847ff958, 0x6410f02b), - TOBN(0x877b7cf5, 0x678a31b0), TOBN(0xd50301ae, 0x3998b620), - TOBN(0x734257c5, 0xc00fb396), TOBN(0xf9fb18a0, 0x04e672a6), - TOBN(0xff8bd8eb, 0xe8758851), TOBN(0x1e64e4c6, 0x5d99ba44), - TOBN(0x4b8eaedf, 0x7dfd93b7), TOBN(0xba2f2a98, 0x04e76b8c), - TOBN(0x7d790cba, 0xe8053433), TOBN(0xc8e725a0, 0x3d2c9585), - TOBN(0x58c5c476, 0xcdd8f5ed), TOBN(0xd106b952, 0xefa9fe1d), - TOBN(0x3c5c775b, 0x0eff13a9), TOBN(0x242442ba, 0xe057b930), - TOBN(0xe9f458d4, 0xc9b70cbd), TOBN(0x69b71448, 0xa3cdb89a), - TOBN(0x41ee46f6, 0x0e2ed742), TOBN(0x573f1045, 0x40067493), - TOBN(0xb1e154ff, 0x9d54c304), TOBN(0x2ad0436a, 0x8d3a7502), - TOBN(0xee4aaa2d, 0x431a8121), TOBN(0xcd38b3ab, 0x886f11ed), - TOBN(0x57d49ea6, 0x034a0eb7), TOBN(0xd2b773bd, 0xf7e85e58), - TOBN(0x4a559ac4, 0x9b5c1f14), TOBN(0xc444be1a, 0x3e54df2b), - TOBN(0x13aad704, 0xeda41891), TOBN(0xcd927bec, 0x5eb5c788), - TOBN(0xeb3c8516, 0xe48c8a34), TOBN(0x1b7ac812, 0x4b546669), - TOBN(0x1815f896, 0x594df8ec), TOBN(0x87c6a79c, 0x79227865), - TOBN(0xae02a2f0, 0x9b56ddbd), TOBN(0x1339b5ac, 0x8a2f1cf3), - TOBN(0xf2b569c7, 0x839dff0d), TOBN(0xb0b9e864, 0xfee9a43d), - TOBN(0x4ff8ca41, 0x77bb064e), TOBN(0x145a2812, 0xfd249f63), - TOBN(0x3ab7beac, 0xf86f689a), TOBN(0x9bafec27, 0x01d35f5e), - TOBN(0x28054c65, 0x4265aa91), TOBN(0xa4b18304, 0x035efe42), - TOBN(0x6887b0e6, 0x9639dec7), TOBN(0xf4b8f6ad, 0x3d52aea5), - TOBN(0xfb9293cc, 0x971a8a13), TOBN(0x3f159e5d, 0x4c934d07), - TOBN(0x2c50e9b1, 0x09acbc29), TOBN(0x08eb65e6, 0x7154d129), - TOBN(0x4feff589, 0x30b75c3e), TOBN(0x0bb82fe2, 0x94491c93), - TOBN(0xd8ac377a, 0x89af62bb), TOBN(0xd7b51490, 0x9685e49f), - TOBN(0xabca9a7b, 0x04497f19), TOBN(0x1b35ed0a, 0x1a7ad13f), - TOBN(0x6b601e21, 0x3ec86ed6), TOBN(0xda91fcb9, 0xce0c76f1), - TOBN(0x9e28507b, 0xd7ab27e1), TOBN(0x7c19a555, 0x63945b7b), - TOBN(0x6b43f0a1, 0xaafc9827), TOBN(0x443b4fbd, 0x3aa55b91), - TOBN(0x962b2e65, 0x6962c88f), TOBN(0x139da8d4, 0xce0db0ca), - TOBN(0xb93f05dd, 0x1b8d6c4f), TOBN(0x779cdff7, 0x180b9824), - TOBN(0xbba23fdd, 0xae57c7b7), TOBN(0x345342f2, 0x1b932522), - TOBN(0xfd9c80fe, 0x556d4aa3), TOBN(0xa03907ba, 0x6525bb61), - TOBN(0x38b010e1, 0xff218933), TOBN(0xc066b654, 0xaa52117b), - TOBN(0x8e141920, 0x94f2e6ea), TOBN(0x66a27dca, 0x0d32f2b2), - TOBN(0x69c7f993, 0x048b3717), TOBN(0xbf5a989a, 0xb178ae1c), - TOBN(0x49fa9058, 0x564f1d6b), TOBN(0x27ec6e15, 0xd31fde4e), - TOBN(0x4cce0373, 0x7276e7fc), TOBN(0x64086d79, 0x89d6bf02), - TOBN(0x5a72f046, 0x4ccdd979), TOBN(0x909c3566, 0x47775631), - TOBN(0x1c07bc6b, 0x75dd7125), TOBN(0xb4c6bc97, 0x87a0428d), - TOBN(0x507ece52, 0xfdeb6b9d), TOBN(0xfca56512, 0xb2c95432), - TOBN(0x15d97181, 0xd0e8bd06), TOBN(0x384dd317, 0xc6bb46ea), - TOBN(0x5441ea20, 0x3952b624), TOBN(0xbcf70dee, 0x4e7dc2fb), - TOBN(0x372b016e, 0x6628e8c3), TOBN(0x07a0d667, 0xb60a7522), - TOBN(0xcf05751b, 0x0a344ee2), TOBN(0x0ec09a48, 0x118bdeec), - TOBN(0x6e4b3d4e, 0xd83dce46), TOBN(0x43a6316d, 0x99d2fc6e), - TOBN(0xa99d8989, 0x56cf044c), TOBN(0x7c7f4454, 0xae3e5fb7), - TOBN(0xb2e6b121, 0xfbabbe92), TOBN(0x281850fb, 0xe1330076), - TOBN(0x093581ec, 0x97890015), TOBN(0x69b1dded, 0x75ff77f5), - TOBN(0x7cf0b18f, 0xab105105), TOBN(0x953ced31, 0xa89ccfef), - TOBN(0x3151f85f, 0xeb914009), TOBN(0x3c9f1b87, 0x88ed48ad), - TOBN(0xc9aba1a1, 0x4a7eadcb), TOBN(0x928e7501, 0x522e71cf), - TOBN(0xeaede727, 0x3a2e4f83), TOBN(0x467e10d1, 0x1ce3bbd3), - TOBN(0xf3442ac3, 0xb955dcf0), TOBN(0xba96307d, 0xd3d5e527), - TOBN(0xf763a10e, 0xfd77f474), TOBN(0x5d744bd0, 0x6a6e1ff0), - TOBN(0xd287282a, 0xa777899e), TOBN(0xe20eda8f, 0xd03f3cde), - TOBN(0x6a7e75bb, 0x50b07d31), TOBN(0x0b7e2a94, 0x6f379de4), - TOBN(0x31cb64ad, 0x19f593cf), TOBN(0x7b1a9e4f, 0x1e76ef1d), - TOBN(0xe18c9c9d, 0xb62d609c), TOBN(0x439bad6d, 0xe779a650), - TOBN(0x219d9066, 0xe032f144), TOBN(0x1db632b8, 0xe8b2ec6a), - TOBN(0xff0d0fd4, 0xfda12f78), TOBN(0x56fb4c2d, 0x2a25d265), - TOBN(0x5f4e2ee1, 0x255a03f1), TOBN(0x61cd6af2, 0xe96af176), - TOBN(0xe0317ba8, 0xd068bc97), TOBN(0x927d6bab, 0x264b988e), - TOBN(0xa18f07e0, 0xe90fb21e), TOBN(0x00fd2b80, 0xbba7fca1), - TOBN(0x20387f27, 0x95cd67b5), TOBN(0x5b89a4e7, 0xd39707f7), - TOBN(0x8f83ad3f, 0x894407ce), TOBN(0xa0025b94, 0x6c226132), - TOBN(0xc79563c7, 0xf906c13b), TOBN(0x5f548f31, 0x4e7bb025), - TOBN(0x2b4c6b8f, 0xeac6d113), TOBN(0xa67e3f9c, 0x0e813c76), - TOBN(0x3982717c, 0x3fe1f4b9), TOBN(0x58865819, 0x26d8050e), - TOBN(0x99f3640c, 0xf7f06f20), TOBN(0xdc610216, 0x2a66ebc2), - TOBN(0x52f2c175, 0x767a1e08), TOBN(0x05660e1a, 0x5999871b), - TOBN(0x6b0f1762, 0x6d3c4693), TOBN(0xf0e7d627, 0x37ed7bea), - TOBN(0xc51758c7, 0xb75b226d), TOBN(0x40a88628, 0x1f91613b), - TOBN(0x889dbaa7, 0xbbb38ce0), TOBN(0xe0404b65, 0xbddcad81), - TOBN(0xfebccd3a, 0x8bc9671f), TOBN(0xfbf9a357, 0xee1f5375), - TOBN(0x5dc169b0, 0x28f33398), TOBN(0xb07ec11d, 0x72e90f65), - TOBN(0xae7f3b4a, 0xfaab1eb1), TOBN(0xd970195e, 0x5f17538a), - TOBN(0x52b05cbe, 0x0181e640), TOBN(0xf5debd62, 0x2643313d), - TOBN(0x76148154, 0x5df31f82), TOBN(0x23e03b33, 0x3a9e13c5), - TOBN(0xff758949, 0x4fde0c1f), TOBN(0xbf8a1abe, 0xe5b6ec20), - TOBN(0x702278fb, 0x87e1db6c), TOBN(0xc447ad7a, 0x35ed658f), - TOBN(0x48d4aa38, 0x03d0ccf2), TOBN(0x80acb338, 0x819a7c03), - TOBN(0x9bc7c89e, 0x6e17cecc), TOBN(0x46736b8b, 0x03be1d82), - TOBN(0xd65d7b60, 0xc0432f96), TOBN(0xddebe7a3, 0xdeb5442f), - TOBN(0x79a25307, 0x7dff69a2), TOBN(0x37a56d94, 0x02cf3122), - TOBN(0x8bab8aed, 0xf2350d0a), TOBN(0x13c3f276, 0x037b0d9a), - TOBN(0xc664957c, 0x44c65cae), TOBN(0x88b44089, 0xc2e71a88), - TOBN(0xdb88e5a3, 0x5cb02664), TOBN(0x5d4c0bf1, 0x8686c72e), - TOBN(0xea3d9b62, 0xa682d53e), TOBN(0x9b605ef4, 0x0b2ad431), - TOBN(0x71bac202, 0xc69645d0), TOBN(0xa115f03a, 0x6a1b66e7), - TOBN(0xfe2c563a, 0x158f4dc4), TOBN(0xf715b3a0, 0x4d12a78c), - TOBN(0x8f7f0a48, 0xd413213a), TOBN(0x2035806d, 0xc04becdb), - TOBN(0xecd34a99, 0x5d8587f5), TOBN(0x4d8c3079, 0x9f6d3a71), - TOBN(0x1b2a2a67, 0x8d95a8f6), TOBN(0xc58c9d7d, 0xf2110d0d), - TOBN(0xdeee81d5, 0xcf8fba3f), TOBN(0xa42be3c0, 0x0c7cdf68), - TOBN(0x2126f742, 0xd43b5eaa), TOBN(0x054a0766, 0xdfa59b85), - TOBN(0x9d0d5e36, 0x126bfd45), TOBN(0xa1f8fbd7, 0x384f8a8f), - TOBN(0x317680f5, 0xd563fccc), TOBN(0x48ca5055, 0xf280a928), - TOBN(0xe00b81b2, 0x27b578cf), TOBN(0x10aad918, 0x2994a514), - TOBN(0xd9e07b62, 0xb7bdc953), TOBN(0x9f0f6ff2, 0x5bc086dd), - TOBN(0x09d1ccff, 0x655eee77), TOBN(0x45475f79, 0x5bef7df1), - TOBN(0x3faa28fa, 0x86f702cc), TOBN(0x92e60905, 0x0f021f07), - TOBN(0xe9e62968, 0x7f8fa8c6), TOBN(0xbd71419a, 0xf036ea2c), - TOBN(0x171ee1cc, 0x6028da9a), TOBN(0x5352fe1a, 0xc251f573), - TOBN(0xf8ff236e, 0x3fa997f4), TOBN(0xd831b6c9, 0xa5749d5f), - TOBN(0x7c872e1d, 0xe350e2c2), TOBN(0xc56240d9, 0x1e0ce403), - TOBN(0xf9deb077, 0x6974f5cb), TOBN(0x7d50ba87, 0x961c3728), - TOBN(0xd6f89426, 0x5a3a2518), TOBN(0xcf817799, 0xc6303d43), - TOBN(0x510a0471, 0x619e5696), TOBN(0xab049ff6, 0x3a5e307b), - TOBN(0xe4cdf9b0, 0xfeb13ec7), TOBN(0xd5e97117, 0x9d8ff90c), - TOBN(0xf6f64d06, 0x9afa96af), TOBN(0x00d0bf5e, 0x9d2012a2), - TOBN(0xe63f301f, 0x358bcdc0), TOBN(0x07689e99, 0x0a9d47f8), - TOBN(0x1f689e2f, 0x4f43d43a), TOBN(0x4d542a16, 0x90920904), - TOBN(0xaea293d5, 0x9ca0a707), TOBN(0xd061fe45, 0x8ac68065), - TOBN(0x1033bf1b, 0x0090008c), TOBN(0x29749558, 0xc08a6db6), - TOBN(0x74b5fc59, 0xc1d5d034), TOBN(0xf712e9f6, 0x67e215e0), - TOBN(0xfd520cbd, 0x860200e6), TOBN(0x0229acb4, 0x3ea22588), - TOBN(0x9cd1e14c, 0xfff0c82e), TOBN(0x87684b62, 0x59c69e73), - TOBN(0xda85e61c, 0x96ccb989), TOBN(0x2d5dbb02, 0xa3d06493), - TOBN(0xf22ad33a, 0xe86b173c), TOBN(0xe8e41ea5, 0xa79ff0e3), - TOBN(0x01d2d725, 0xdd0d0c10), TOBN(0x31f39088, 0x032d28f9), - TOBN(0x7b3f71e1, 0x7829839e), TOBN(0x0cf691b4, 0x4502ae58), - TOBN(0xef658dbd, 0xbefc6115), TOBN(0xa5cd6ee5, 0xb3ab5314), - TOBN(0x206c8d7b, 0x5f1d2347), TOBN(0x794645ba, 0x4cc2253a), - TOBN(0xd517d8ff, 0x58389e08), TOBN(0x4fa20dee, 0x9f847288), - TOBN(0xeba072d8, 0xd797770a), TOBN(0x7360c91d, 0xbf429e26), - TOBN(0x7200a3b3, 0x80af8279), TOBN(0x6a1c9150, 0x82dadce3), - TOBN(0x0ee6d3a7, 0xc35d8794), TOBN(0x042e6558, 0x0356bae5), - TOBN(0x9f59698d, 0x643322fd), TOBN(0x9379ae15, 0x50a61967), - TOBN(0x64b9ae62, 0xfcc9981e), TOBN(0xaed3d631, 0x6d2934c6), - TOBN(0x2454b302, 0x5e4e65eb), TOBN(0xab09f647, 0xf9950428)}, - {TOBN(0xb2083a12, 0x22248acc), TOBN(0x1f6ec0ef, 0x3264e366), - TOBN(0x5659b704, 0x5afdee28), TOBN(0x7a823a40, 0xe6430bb5), - TOBN(0x24592a04, 0xe1900a79), TOBN(0xcde09d4a, 0xc9ee6576), - TOBN(0x52b6463f, 0x4b5ea54a), TOBN(0x1efe9ed3, 0xd3ca65a7), - TOBN(0xe27a6dbe, 0x305406dd), TOBN(0x8eb7dc7f, 0xdd5d1957), - TOBN(0xf54a6876, 0x387d4d8f), TOBN(0x9c479409, 0xc7762de4), - TOBN(0xbe4d5b5d, 0x99b30778), TOBN(0x25380c56, 0x6e793682), - TOBN(0x602d37f3, 0xdac740e3), TOBN(0x140deabe, 0x1566e4ae), - TOBN(0x4481d067, 0xafd32acf), TOBN(0xd8f0fcca, 0xe1f71ccf), - TOBN(0xd208dd0c, 0xb596f2da), TOBN(0xd049d730, 0x9aad93f9), - TOBN(0xc79f263d, 0x42ab580e), TOBN(0x09411bb1, 0x23f707b4), - TOBN(0x8cfde1ff, 0x835e0eda), TOBN(0x72707490, 0x90f03402), - TOBN(0xeaee6126, 0xc49a861e), TOBN(0x024f3b65, 0xe14f0d06), - TOBN(0x51a3f1e8, 0xc69bfc17), TOBN(0xc3c3a8e9, 0xa7686381), - TOBN(0x3400752c, 0xb103d4c8), TOBN(0x02bc4613, 0x9218b36b), - TOBN(0xc67f75eb, 0x7651504a), TOBN(0xd6848b56, 0xd02aebfa), - TOBN(0xbd9802e6, 0xc30fa92b), TOBN(0x5a70d96d, 0x9a552784), - TOBN(0x9085c4ea, 0x3f83169b), TOBN(0xfa9423bb, 0x06908228), - TOBN(0x2ffebe12, 0xfe97a5b9), TOBN(0x85da6049, 0x71b99118), - TOBN(0x9cbc2f7f, 0x63178846), TOBN(0xfd96bc70, 0x9153218e), - TOBN(0x958381db, 0x1782269b), TOBN(0xae34bf79, 0x2597e550), - TOBN(0xbb5c6064, 0x5f385153), TOBN(0x6f0e96af, 0xe3088048), - TOBN(0xbf6a0215, 0x77884456), TOBN(0xb3b5688c, 0x69310ea7), - TOBN(0x17c94295, 0x04fad2de), TOBN(0xe020f0e5, 0x17896d4d), - TOBN(0x730ba0ab, 0x0976505f), TOBN(0x567f6813, 0x095e2ec5), - TOBN(0x47062010, 0x6331ab71), TOBN(0x72cfa977, 0x41d22b9f), - TOBN(0x33e55ead, 0x8a2373da), TOBN(0xa8d0d5f4, 0x7ba45a68), - TOBN(0xba1d8f9c, 0x03029d15), TOBN(0x8f34f1cc, 0xfc55b9f3), - TOBN(0xcca4428d, 0xbbe5a1a9), TOBN(0x8187fd5f, 0x3126bd67), - TOBN(0x0036973a, 0x48105826), TOBN(0xa39b6663, 0xb8bd61a0), - TOBN(0x6d42deef, 0x2d65a808), TOBN(0x4969044f, 0x94636b19), - TOBN(0xf611ee47, 0xdd5d564c), TOBN(0x7b2f3a49, 0xd2873077), - TOBN(0x94157d45, 0x300eb294), TOBN(0x2b2a656e, 0x169c1494), - TOBN(0xc000dd76, 0xd3a47aa9), TOBN(0xa2864e4f, 0xa6243ea4), - TOBN(0x82716c47, 0xdb89842e), TOBN(0x12dfd7d7, 0x61479fb7), - TOBN(0x3b9a2c56, 0xe0b2f6dc), TOBN(0x46be862a, 0xd7f85d67), - TOBN(0x03b0d8dd, 0x0f82b214), TOBN(0x460c34f9, 0xf103cbc6), - TOBN(0xf32e5c03, 0x18d79e19), TOBN(0x8b8888ba, 0xa84117f8), - TOBN(0x8f3c37dc, 0xc0722677), TOBN(0x10d21be9, 0x1c1c0f27), - TOBN(0xd47c8468, 0xe0f7a0c6), TOBN(0x9bf02213, 0xadecc0e0), - TOBN(0x0baa7d12, 0x42b48b99), TOBN(0x1bcb665d, 0x48424096), - TOBN(0x8b847cd6, 0xebfb5cfb), TOBN(0x87c2ae56, 0x9ad4d10d), - TOBN(0xf1cbb122, 0x0de36726), TOBN(0xe7043c68, 0x3fdfbd21), - TOBN(0x4bd0826a, 0x4e79d460), TOBN(0x11f5e598, 0x4bd1a2cb), - TOBN(0x97554160, 0xb7fe7b6e), TOBN(0x7d16189a, 0x400a3fb2), - TOBN(0xd73e9bea, 0xe328ca1e), TOBN(0x0dd04b97, 0xe793d8cc), - TOBN(0xa9c83c9b, 0x506db8cc), TOBN(0x5cd47aae, 0xcf38814c), - TOBN(0x26fc430d, 0xb64b45e6), TOBN(0x079b5499, 0xd818ea84), - TOBN(0xebb01102, 0xc1c24a3b), TOBN(0xca24e568, 0x1c161c1a), - TOBN(0x103eea69, 0x36f00a4a), TOBN(0x9ad76ee8, 0x76176c7b), - TOBN(0x97451fc2, 0x538e0ff7), TOBN(0x94f89809, 0x6604b3b0), - TOBN(0x6311436e, 0x3249cfd7), TOBN(0x27b4a7bd, 0x41224f69), - TOBN(0x03b5d21a, 0xe0ac2941), TOBN(0x279b0254, 0xc2d31937), - TOBN(0x3307c052, 0xcac992d0), TOBN(0x6aa7cb92, 0xefa8b1f3), - TOBN(0x5a182580, 0x0d37c7a5), TOBN(0x13380c37, 0x342d5422), - TOBN(0x92ac2d66, 0xd5d2ef92), TOBN(0x035a70c9, 0x030c63c6), - TOBN(0xc16025dd, 0x4ce4f152), TOBN(0x1f419a71, 0xf9df7c06), - TOBN(0x6d5b2214, 0x91e4bb14), TOBN(0xfc43c6cc, 0x839fb4ce), - TOBN(0x49f06591, 0x925d6b2d), TOBN(0x4b37d9d3, 0x62186598), - TOBN(0x8c54a971, 0xd01b1629), TOBN(0xe1a9c29f, 0x51d50e05), - TOBN(0x5109b785, 0x71ba1861), TOBN(0x48b22d5c, 0xd0c8f93d), - TOBN(0xe8fa84a7, 0x8633bb93), TOBN(0x53fba6ba, 0x5aebbd08), - TOBN(0x7ff27df3, 0xe5eea7d8), TOBN(0x521c8796, 0x68ca7158), - TOBN(0xb9d5133b, 0xce6f1a05), TOBN(0x2d50cd53, 0xfd0ebee4), - TOBN(0xc82115d6, 0xc5a3ef16), TOBN(0x993eff9d, 0xba079221), - TOBN(0xe4da2c5e, 0x4b5da81c), TOBN(0x9a89dbdb, 0x8033fd85), - TOBN(0x60819ebf, 0x2b892891), TOBN(0x53902b21, 0x5d14a4d5), - TOBN(0x6ac35051, 0xd7fda421), TOBN(0xcc6ab885, 0x61c83284), - TOBN(0x14eba133, 0xf74cff17), TOBN(0x240aaa03, 0xecb813f2), - TOBN(0xcfbb6540, 0x6f665bee), TOBN(0x084b1fe4, 0xa425ad73), - TOBN(0x009d5d16, 0xd081f6a6), TOBN(0x35304fe8, 0xeef82c90), - TOBN(0xf20346d5, 0xaa9eaa22), TOBN(0x0ada9f07, 0xac1c91e3), - TOBN(0xa6e21678, 0x968a6144), TOBN(0x54c1f77c, 0x07b31a1e), - TOBN(0xd6bb787e, 0x5781fbe1), TOBN(0x61bd2ee0, 0xe31f1c4a), - TOBN(0xf25aa1e9, 0x781105fc), TOBN(0x9cf2971f, 0x7b2f8e80), - TOBN(0x26d15412, 0xcdff919b), TOBN(0x01db4ebe, 0x34bc896e), - TOBN(0x7d9b3e23, 0xb40df1cf), TOBN(0x59337373, 0x94e971b4), - TOBN(0xbf57bd14, 0x669cf921), TOBN(0x865daedf, 0x0c1a1064), - TOBN(0x3eb70bd3, 0x83279125), TOBN(0xbc3d5b9f, 0x34ecdaab), - TOBN(0x91e3ed7e, 0x5f755caf), TOBN(0x49699f54, 0xd41e6f02), - TOBN(0x185770e1, 0xd4a7a15b), TOBN(0x08f3587a, 0xeaac87e7), - TOBN(0x352018db, 0x473133ea), TOBN(0x674ce719, 0x04fd30fc), - TOBN(0x7b8d9835, 0x088b3e0e), TOBN(0x7a0356a9, 0x5d0d47a1), - TOBN(0x9d9e7659, 0x6474a3c4), TOBN(0x61ea48a7, 0xff66966c), - TOBN(0x30417758, 0x0f3e4834), TOBN(0xfdbb21c2, 0x17a9afcb), - TOBN(0x756fa17f, 0x2f9a67b3), TOBN(0x2a6b2421, 0xa245c1a8), - TOBN(0x64be2794, 0x4af02291), TOBN(0xade465c6, 0x2a5804fe), - TOBN(0x8dffbd39, 0xa6f08fd7), TOBN(0xc4efa84c, 0xaa14403b), - TOBN(0xa1b91b2a, 0x442b0f5c), TOBN(0xb748e317, 0xcf997736), - TOBN(0x8d1b62bf, 0xcee90e16), TOBN(0x907ae271, 0x0b2078c0), - TOBN(0xdf31534b, 0x0c9bcddd), TOBN(0x043fb054, 0x39adce83), - TOBN(0x99031043, 0xd826846a), TOBN(0x61a9c0d6, 0xb144f393), - TOBN(0xdab48046, 0x47718427), TOBN(0xdf17ff9b, 0x6e830f8b), - TOBN(0x408d7ee8, 0xe49a1347), TOBN(0x6ac71e23, 0x91c1d4ae), - TOBN(0xc8cbb9fd, 0x1defd73c), TOBN(0x19840657, 0xbbbbfec5), - TOBN(0x39db1cb5, 0x9e7ef8ea), TOBN(0x78aa8296, 0x64105f30), - TOBN(0xa3d9b7f0, 0xa3738c29), TOBN(0x0a2f235a, 0xbc3250a3), - TOBN(0x55e506f6, 0x445e4caf), TOBN(0x0974f73d, 0x33475f7a), - TOBN(0xd37dbba3, 0x5ba2f5a8), TOBN(0x542c6e63, 0x6af40066), - TOBN(0x26d99b53, 0xc5d73e2c), TOBN(0x06060d7d, 0x6c3ca33e), - TOBN(0xcdbef1c2, 0x065fef4a), TOBN(0x77e60f7d, 0xfd5b92e3), - TOBN(0xd7c549f0, 0x26708350), TOBN(0x201b3ad0, 0x34f121bf), - TOBN(0x5fcac2a1, 0x0334fc14), TOBN(0x8a9a9e09, 0x344552f6), - TOBN(0x7dd8a1d3, 0x97653082), TOBN(0x5fc0738f, 0x79d4f289), - TOBN(0x787d244d, 0x17d2d8c3), TOBN(0xeffc6345, 0x70830684), - TOBN(0x5ddb96dd, 0xe4f73ae5), TOBN(0x8efb14b1, 0x172549a5), - TOBN(0x6eb73eee, 0x2245ae7a), TOBN(0xbca4061e, 0xea11f13e), - TOBN(0xb577421d, 0x30b01f5d), TOBN(0xaa688b24, 0x782e152c), - TOBN(0x67608e71, 0xbd3502ba), TOBN(0x4ef41f24, 0xb4de75a0), - TOBN(0xb08dde5e, 0xfd6125e5), TOBN(0xde484825, 0xa409543f), - TOBN(0x1f198d98, 0x65cc2295), TOBN(0x428a3771, 0x6e0edfa2), - TOBN(0x4f9697a2, 0xadf35fc7), TOBN(0x01a43c79, 0xf7cac3c7), - TOBN(0xb05d7059, 0x0fd3659a), TOBN(0x8927f30c, 0xbb7f2d9a), - TOBN(0x4023d1ac, 0x8cf984d3), TOBN(0x32125ed3, 0x02897a45), - TOBN(0xfb572dad, 0x3d414205), TOBN(0x73000ef2, 0xe3fa82a9), - TOBN(0x4c0868e9, 0xf10a5581), TOBN(0x5b61fc67, 0x6b0b3ca5), - TOBN(0xc1258d5b, 0x7cae440c), TOBN(0x21c08b41, 0x402b7531), - TOBN(0xf61a8955, 0xde932321), TOBN(0x3568faf8, 0x2d1408af), - TOBN(0x71b15e99, 0x9ecf965b), TOBN(0xf14ed248, 0xe917276f), - TOBN(0xc6f4caa1, 0x820cf9e2), TOBN(0x681b20b2, 0x18d83c7e), - TOBN(0x6cde738d, 0xc6c01120), TOBN(0x71db0813, 0xae70e0db), - TOBN(0x95fc0644, 0x74afe18c), TOBN(0x34619053, 0x129e2be7), - TOBN(0x80615cea, 0xdb2a3b15), TOBN(0x0a49a19e, 0xdb4c7073), - TOBN(0x0e1b84c8, 0x8fd2d367), TOBN(0xd74bf462, 0x033fb8aa), - TOBN(0x889f6d65, 0x533ef217), TOBN(0x7158c7e4, 0xc3ca2e87), - TOBN(0xfb670dfb, 0xdc2b4167), TOBN(0x75910a01, 0x844c257f), - TOBN(0xf336bf07, 0xcf88577d), TOBN(0x22245250, 0xe45e2ace), - TOBN(0x2ed92e8d, 0x7ca23d85), TOBN(0x29f8be4c, 0x2b812f58), - TOBN(0xdd9ebaa7, 0x076fe12b), TOBN(0x3f2400cb, 0xae1537f9), - TOBN(0x1aa93528, 0x17bdfb46), TOBN(0xc0f98430, 0x67883b41), - TOBN(0x5590ede1, 0x0170911d), TOBN(0x7562f5bb, 0x34d4b17f), - TOBN(0xe1fa1df2, 0x1826b8d2), TOBN(0xb40b796a, 0x6bd80d59), - TOBN(0xd65bf197, 0x3467ba92), TOBN(0x8c9b46db, 0xf70954b0), - TOBN(0x97c8a0f3, 0x0e78f15d), TOBN(0xa8f3a69a, 0x85a4c961), - TOBN(0x4242660f, 0x61e4ce9b), TOBN(0xbf06aab3, 0x6ea6790c), - TOBN(0xc6706f8e, 0xec986416), TOBN(0x9e56dec1, 0x9a9fc225), - TOBN(0x527c46f4, 0x9a9898d9), TOBN(0xd799e77b, 0x5633cdef), - TOBN(0x24eacc16, 0x7d9e4297), TOBN(0xabb61cea, 0x6b1cb734), - TOBN(0xbee2e8a7, 0xf778443c), TOBN(0x3bb42bf1, 0x29de2fe6), - TOBN(0xcbed86a1, 0x3003bb6f), TOBN(0xd3918e6c, 0xd781cdf6), - TOBN(0x4bee3271, 0x9a5103f1), TOBN(0x5243efc6, 0xf50eac06), - TOBN(0xb8e122cb, 0x6adcc119), TOBN(0x1b7faa84, 0xc0b80a08), - TOBN(0x32c3d1bd, 0x6dfcd08c), TOBN(0x129dec4e, 0x0be427de), - TOBN(0x98ab679c, 0x1d263c83), TOBN(0xafc83cb7, 0xcef64eff), - TOBN(0x85eb6088, 0x2fa6be76), TOBN(0x892585fb, 0x1328cbfe), - TOBN(0xc154d3ed, 0xcf618dda), TOBN(0xc44f601b, 0x3abaf26e), - TOBN(0x7bf57d0b, 0x2be1fdfd), TOBN(0xa833bd2d, 0x21137fee), - TOBN(0x9353af36, 0x2db591a8), TOBN(0xc76f26dc, 0x5562a056), - TOBN(0x1d87e47d, 0x3fdf5a51), TOBN(0x7afb5f93, 0x55c9cab0), - TOBN(0x91bbf58f, 0x89e0586e), TOBN(0x7c72c018, 0x0d843709), - TOBN(0xa9a5aafb, 0x99b5c3dc), TOBN(0xa48a0f1d, 0x3844aeb0), - TOBN(0x7178b7dd, 0xb667e482), TOBN(0x453985e9, 0x6e23a59a), - TOBN(0x4a54c860, 0x01b25dd8), TOBN(0x0dd37f48, 0xfb897c8a), - TOBN(0x5f8aa610, 0x0ea90cd9), TOBN(0xc8892c68, 0x16d5830d), - TOBN(0xeb4befc0, 0xef514ca5), TOBN(0x478eb679, 0xe72c9ee6), - TOBN(0x9bca20da, 0xdbc40d5f), TOBN(0xf015de21, 0xdde4f64a), - TOBN(0xaa6a4de0, 0xeaf4b8a5), TOBN(0x68cfd9ca, 0x4bc60e32), - TOBN(0x668a4b01, 0x7fd15e70), TOBN(0xd9f0694a, 0xf27dc09d), - TOBN(0xf6c3cad5, 0xba708bcd), TOBN(0x5cd2ba69, 0x5bb95c2a), - TOBN(0xaa28c1d3, 0x33c0a58f), TOBN(0x23e274e3, 0xabc77870), - TOBN(0x44c3692d, 0xdfd20a4a), TOBN(0x091c5fd3, 0x81a66653), - TOBN(0x6c0bb691, 0x09a0757d), TOBN(0x9072e8b9, 0x667343ea), - TOBN(0x31d40eb0, 0x80848bec), TOBN(0x95bd480a, 0x79fd36cc), - TOBN(0x01a77c61, 0x65ed43f5), TOBN(0xafccd127, 0x2e0d40bf), - TOBN(0xeccfc82d, 0x1cc1884b), TOBN(0xc85ac201, 0x5d4753b4), - TOBN(0xc7a6caac, 0x658e099f), TOBN(0xcf46369e, 0x04b27390), - TOBN(0xe2e7d049, 0x506467ea), TOBN(0x481b63a2, 0x37cdeccc), - TOBN(0x4029abd8, 0xed80143a), TOBN(0x28bfe3c7, 0xbcb00b88), - TOBN(0x3bec1009, 0x0643d84a), TOBN(0x885f3668, 0xabd11041), - TOBN(0xdb02432c, 0xf83a34d6), TOBN(0x32f7b360, 0x719ceebe), - TOBN(0xf06c7837, 0xdad1fe7a), TOBN(0x60a157a9, 0x5441a0b0), - TOBN(0x704970e9, 0xe2d47550), TOBN(0xcd2bd553, 0x271b9020), - TOBN(0xff57f82f, 0x33e24a0b), TOBN(0x9cbee23f, 0xf2565079), - TOBN(0x16353427, 0xeb5f5825), TOBN(0x276feec4, 0xe948d662), - TOBN(0xd1b62bc6, 0xda10032b), TOBN(0x718351dd, 0xf0e72a53), - TOBN(0x93452076, 0x2420e7ba), TOBN(0x96368fff, 0x3a00118d), - TOBN(0x00ce2d26, 0x150a49e4), TOBN(0x0c28b636, 0x3f04706b), - TOBN(0xbad65a46, 0x58b196d0), TOBN(0x6c8455fc, 0xec9f8b7c), - TOBN(0xe90c895f, 0x2d71867e), TOBN(0x5c0be31b, 0xedf9f38c), - TOBN(0x2a37a15e, 0xd8f6ec04), TOBN(0x239639e7, 0x8cd85251), - TOBN(0xd8975315, 0x9c7c4c6b), TOBN(0x603aa3c0, 0xd7409af7), - TOBN(0xb8d53d0c, 0x007132fb), TOBN(0x68d12af7, 0xa6849238), - TOBN(0xbe0607e7, 0xbf5d9279), TOBN(0x9aa50055, 0xaada74ce), - TOBN(0xe81079cb, 0xba7e8ccb), TOBN(0x610c71d1, 0xa5f4ff5e), - TOBN(0x9e2ee1a7, 0x5aa07093), TOBN(0xca84004b, 0xa75da47c), - TOBN(0x074d3951, 0x3de75401), TOBN(0xf938f756, 0xbb311592), - TOBN(0x96197618, 0x00a43421), TOBN(0x39a25362, 0x07bc78c8), - TOBN(0x278f710a, 0x0a171276), TOBN(0xb28446ea, 0x8d1a8f08), - TOBN(0x184781bf, 0xe3b6a661), TOBN(0x7751cb1d, 0xe6d279f7), - TOBN(0xf8ff95d6, 0xc59eb662), TOBN(0x186d90b7, 0x58d3dea7), - TOBN(0x0e4bb6c1, 0xdfb4f754), TOBN(0x5c5cf56b, 0x2b2801dc), - TOBN(0xc561e452, 0x1f54564d), TOBN(0xb4fb8c60, 0xf0dd7f13), - TOBN(0xf8849630, 0x33ff98c7), TOBN(0x9619fffa, 0xcf17769c), - TOBN(0xf8090bf6, 0x1bfdd80a), TOBN(0x14d9a149, 0x422cfe63), - TOBN(0xb354c360, 0x6f6df9ea), TOBN(0xdbcf770d, 0x218f17ea), - TOBN(0x207db7c8, 0x79eb3480), TOBN(0x213dbda8, 0x559b6a26), - TOBN(0xac4c200b, 0x29fc81b3), TOBN(0xebc3e09f, 0x171d87c1), - TOBN(0x91799530, 0x1481aa9e), TOBN(0x051b92e1, 0x92e114fa), - TOBN(0xdf8f92e9, 0xecb5537f), TOBN(0x44b1b2cc, 0x290c7483), - TOBN(0xa711455a, 0x2adeb016), TOBN(0x964b6856, 0x81a10c2c), - TOBN(0x4f159d99, 0xcec03623), TOBN(0x05532225, 0xef3271ea), - TOBN(0xb231bea3, 0xc5ee4849), TOBN(0x57a54f50, 0x7094f103), - TOBN(0x3e2d421d, 0x9598b352), TOBN(0xe865a49c, 0x67412ab4), - TOBN(0xd2998a25, 0x1cc3a912), TOBN(0x5d092808, 0x0c74d65d), - TOBN(0x73f45908, 0x4088567a), TOBN(0xeb6b280e, 0x1f214a61), - TOBN(0x8c9adc34, 0xcaf0c13d), TOBN(0x39d12938, 0xf561fb80), - TOBN(0xb2dc3a5e, 0xbc6edfb4), TOBN(0x7485b1b1, 0xfe4d210e), - TOBN(0x062e0400, 0xe186ae72), TOBN(0x91e32d5c, 0x6eeb3b88), - TOBN(0x6df574d7, 0x4be59224), TOBN(0xebc88ccc, 0x716d55f3), - TOBN(0x26c2e6d0, 0xcad6ed33), TOBN(0xc6e21e7d, 0x0d3e8b10), - TOBN(0x2cc5840e, 0x5bcc36bb), TOBN(0x9292445e, 0x7da74f69), - TOBN(0x8be8d321, 0x4e5193a8), TOBN(0x3ec23629, 0x8df06413), - TOBN(0xc7e9ae85, 0xb134defa), TOBN(0x6073b1d0, 0x1bb2d475), - TOBN(0xb9ad615e, 0x2863c00d), TOBN(0x9e29493d, 0x525f4ac4), - TOBN(0xc32b1dea, 0x4e9acf4f), TOBN(0x3e1f01c8, 0xa50db88d), - TOBN(0xb05d70ea, 0x04da916c), TOBN(0x714b0d0a, 0xd865803e), - TOBN(0x4bd493fc, 0x9920cb5e), TOBN(0x5b44b1f7, 0x92c7a3ac), - TOBN(0xa2a77293, 0xbcec9235), TOBN(0x5ee06e87, 0xcd378553), - TOBN(0xceff8173, 0xda621607), TOBN(0x2bb03e4c, 0x99f5d290), - TOBN(0x2945106a, 0xa6f734ac), TOBN(0xb5056604, 0xd25c4732), - TOBN(0x5945920c, 0xe079afee), TOBN(0x686e17a0, 0x6789831f), - TOBN(0x5966bee8, 0xb74a5ae5), TOBN(0x38a673a2, 0x1e258d46), - TOBN(0xbd1cc1f2, 0x83141c95), TOBN(0x3b2ecf4f, 0x0e96e486), - TOBN(0xcd3aa896, 0x74e5fc78), TOBN(0x415ec10c, 0x2482fa7a), - TOBN(0x15234419, 0x80503380), TOBN(0x513d917a, 0xd314b392), - TOBN(0xb0b52f4e, 0x63caecae), TOBN(0x07bf22ad, 0x2dc7780b), - TOBN(0xe761e8a1, 0xe4306839), TOBN(0x1b3be962, 0x5dd7feaa), - TOBN(0x4fe728de, 0x74c778f1), TOBN(0xf1fa0bda, 0x5e0070f6), - TOBN(0x85205a31, 0x6ec3f510), TOBN(0x2c7e4a14, 0xd2980475), - TOBN(0xde3c19c0, 0x6f30ebfd), TOBN(0xdb1c1f38, 0xd4b7e644), - TOBN(0xfe291a75, 0x5dce364a), TOBN(0xb7b22a3c, 0x058f5be3), - TOBN(0x2cd2c302, 0x37fea38c), TOBN(0x2930967a, 0x2e17be17), - TOBN(0x87f009de, 0x0c061c65), TOBN(0xcb014aac, 0xedc6ed44), - TOBN(0x49bd1cb4, 0x3bafb1eb), TOBN(0x81bd8b5c, 0x282d3688), - TOBN(0x1cdab87e, 0xf01a17af), TOBN(0x21f37ac4, 0xe710063b), - TOBN(0x5a6c5676, 0x42fc8193), TOBN(0xf4753e70, 0x56a6015c), - TOBN(0x020f795e, 0xa15b0a44), TOBN(0x8f37c8d7, 0x8958a958), - TOBN(0x63b7e89b, 0xa4b675b5), TOBN(0xb4fb0c0c, 0x0fc31aea), - TOBN(0xed95e639, 0xa7ff1f2e), TOBN(0x9880f5a3, 0x619614fb), - TOBN(0xdeb6ff02, 0x947151ab), TOBN(0x5bc5118c, 0xa868dcdb), - TOBN(0xd8da2055, 0x4c20cea5), TOBN(0xcac2776e, 0x14c4d69a), - TOBN(0xcccb22c1, 0x622d599b), TOBN(0xa4ddb653, 0x68a9bb50), - TOBN(0x2c4ff151, 0x1b4941b4), TOBN(0xe1ff19b4, 0x6efba588), - TOBN(0x35034363, 0xc48345e0), TOBN(0x45542e3d, 0x1e29dfc4), - TOBN(0xf197cb91, 0x349f7aed), TOBN(0x3b2b5a00, 0x8fca8420), - TOBN(0x7c175ee8, 0x23aaf6d8), TOBN(0x54dcf421, 0x35af32b6), - TOBN(0x0ba14307, 0x27d6561e), TOBN(0x879d5ee4, 0xd175b1e2), - TOBN(0xc7c43673, 0x99807db5), TOBN(0x77a54455, 0x9cd55bcd), - TOBN(0xe6c2ff13, 0x0105c072), TOBN(0x18f7a99f, 0x8dda7da4), - TOBN(0x4c301820, 0x0e2d35c1), TOBN(0x06a53ca0, 0xd9cc6c82), - TOBN(0xaa21cc1e, 0xf1aa1d9e), TOBN(0x32414334, 0x4a75b1e8), - TOBN(0x2a6d1328, 0x0ebe9fdc), TOBN(0x16bd173f, 0x98a4755a), - TOBN(0xfbb9b245, 0x2133ffd9), TOBN(0x39a8b2f1, 0x830f1a20), - TOBN(0x484bc97d, 0xd5a1f52a), TOBN(0xd6aebf56, 0xa40eddf8), - TOBN(0x32257acb, 0x76ccdac6), TOBN(0xaf4d36ec, 0x1586ff27), - TOBN(0x8eaa8863, 0xf8de7dd1), TOBN(0x0045d5cf, 0x88647c16)}, - {TOBN(0xa6f3d574, 0xc005979d), TOBN(0xc2072b42, 0x6a40e350), - TOBN(0xfca5c156, 0x8de2ecf9), TOBN(0xa8c8bf5b, 0xa515344e), - TOBN(0x97aee555, 0x114df14a), TOBN(0xd4374a4d, 0xfdc5ec6b), - TOBN(0x754cc28f, 0x2ca85418), TOBN(0x71cb9e27, 0xd3c41f78), - TOBN(0x89105079, 0x03605c39), TOBN(0xf0843d9e, 0xa142c96c), - TOBN(0xf3744934, 0x16923684), TOBN(0x732caa2f, 0xfa0a2893), - TOBN(0xb2e8c270, 0x61160170), TOBN(0xc32788cc, 0x437fbaa3), - TOBN(0x39cd818e, 0xa6eda3ac), TOBN(0xe2e94239, 0x9e2b2e07), - TOBN(0x6967d39b, 0x0260e52a), TOBN(0xd42585cc, 0x90653325), - TOBN(0x0d9bd605, 0x21ca7954), TOBN(0x4fa20877, 0x81ed57b3), - TOBN(0x60c1eff8, 0xe34a0bbe), TOBN(0x56b0040c, 0x84f6ef64), - TOBN(0x28be2b24, 0xb1af8483), TOBN(0xb2278163, 0xf5531614), - TOBN(0x8df27545, 0x5922ac1c), TOBN(0xa7b3ef5c, 0xa52b3f63), - TOBN(0x8e77b214, 0x71de57c4), TOBN(0x31682c10, 0x834c008b), - TOBN(0xc76824f0, 0x4bd55d31), TOBN(0xb6d1c086, 0x17b61c71), - TOBN(0x31db0903, 0xc2a5089d), TOBN(0x9c092172, 0x184e5d3f), - TOBN(0xdd7ced5b, 0xc00cc638), TOBN(0x1a2015eb, 0x61278fc2), - TOBN(0x2e8e5288, 0x6a37f8d6), TOBN(0xc457786f, 0xe79933ad), - TOBN(0xb3fe4cce, 0x2c51211a), TOBN(0xad9b10b2, 0x24c20498), - TOBN(0x90d87a4f, 0xd28db5e5), TOBN(0x698cd105, 0x3aca2fc3), - TOBN(0x4f112d07, 0xe91b536d), TOBN(0xceb982f2, 0x9eba09d6), - TOBN(0x3c157b2c, 0x197c396f), TOBN(0xe23c2d41, 0x7b66eb24), - TOBN(0x480c57d9, 0x3f330d37), TOBN(0xb3a4c8a1, 0x79108deb), - TOBN(0x702388de, 0xcb199ce5), TOBN(0x0b019211, 0xb944a8d4), - TOBN(0x24f2a692, 0x840bb336), TOBN(0x7c353bdc, 0xa669fa7b), - TOBN(0xda20d6fc, 0xdec9c300), TOBN(0x625fbe2f, 0xa13a4f17), - TOBN(0xa2b1b61a, 0xdbc17328), TOBN(0x008965bf, 0xa9515621), - TOBN(0x49690939, 0xc620ff46), TOBN(0x182dd27d, 0x8717e91c), - TOBN(0x5ace5035, 0xea6c3997), TOBN(0x54259aaa, 0xc2610bef), - TOBN(0xef18bb3f, 0x3c80dd39), TOBN(0x6910b95b, 0x5fc3fa39), - TOBN(0xfce2f510, 0x43e09aee), TOBN(0xced56c9f, 0xa7675665), - TOBN(0x10e265ac, 0xd872db61), TOBN(0x6982812e, 0xae9fce69), - TOBN(0x29be11c6, 0xce800998), TOBN(0x72bb1752, 0xb90360d9), - TOBN(0x2c193197, 0x5a4ad590), TOBN(0x2ba2f548, 0x9fc1dbc0), - TOBN(0x7fe4eebb, 0xe490ebe0), TOBN(0x12a0a4cd, 0x7fae11c0), - TOBN(0x7197cf81, 0xe903ba37), TOBN(0xcf7d4aa8, 0xde1c6dd8), - TOBN(0x92af6bf4, 0x3fd5684c), TOBN(0x2b26eecf, 0x80360aa1), - TOBN(0xbd960f30, 0x00546a82), TOBN(0x407b3c43, 0xf59ad8fe), - TOBN(0x86cae5fe, 0x249c82ba), TOBN(0x9e0faec7, 0x2463744c), - TOBN(0x87f551e8, 0x94916272), TOBN(0x033f9344, 0x6ceb0615), - TOBN(0x1e5eb0d1, 0x8be82e84), TOBN(0x89967f0e, 0x7a582fef), - TOBN(0xbcf687d5, 0xa6e921fa), TOBN(0xdfee4cf3, 0xd37a09ba), - TOBN(0x94f06965, 0xb493c465), TOBN(0x638b9a1c, 0x7635c030), - TOBN(0x76667864, 0x66f05e9f), TOBN(0xccaf6808, 0xc04da725), - TOBN(0xca2eb690, 0x768fccfc), TOBN(0xf402d37d, 0xb835b362), - TOBN(0x0efac0d0, 0xe2fdfcce), TOBN(0xefc9cdef, 0xb638d990), - TOBN(0x2af12b72, 0xd1669a8b), TOBN(0x33c536bc, 0x5774ccbd), - TOBN(0x30b21909, 0xfb34870e), TOBN(0xc38fa2f7, 0x7df25aca), - TOBN(0x74c5f02b, 0xbf81f3f5), TOBN(0x0525a5ae, 0xaf7e4581), - TOBN(0x88d2aaba, 0x433c54ae), TOBN(0xed9775db, 0x806a56c5), - TOBN(0xd320738a, 0xc0edb37d), TOBN(0x25fdb6ee, 0x66cc1f51), - TOBN(0xac661d17, 0x10600d76), TOBN(0x931ec1f3, 0xbdd1ed76), - TOBN(0x65c11d62, 0x19ee43f1), TOBN(0x5cd57c3e, 0x60829d97), - TOBN(0xd26c91a3, 0x984be6e8), TOBN(0xf08d9309, 0x8b0c53bd), - TOBN(0x94bc9e5b, 0xc016e4ea), TOBN(0xd3916839, 0x11d43d2b), - TOBN(0x886c5ad7, 0x73701155), TOBN(0xe0377626, 0x20b00715), - TOBN(0x7f01c9ec, 0xaa80ba59), TOBN(0x3083411a, 0x68538e51), - TOBN(0x970370f1, 0xe88128af), TOBN(0x625cc3db, 0x91dec14b), - TOBN(0xfef9666c, 0x01ac3107), TOBN(0xb2a8d577, 0xd5057ac3), - TOBN(0xb0f26299, 0x92be5df7), TOBN(0xf579c8e5, 0x00353924), - TOBN(0xb8fa3d93, 0x1341ed7a), TOBN(0x4223272c, 0xa7b59d49), - TOBN(0x3dcb1947, 0x83b8c4a4), TOBN(0x4e413c01, 0xed1302e4), - TOBN(0x6d999127, 0xe17e44ce), TOBN(0xee86bf75, 0x33b3adfb), - TOBN(0xf6902fe6, 0x25aa96ca), TOBN(0xb73540e4, 0xe5aae47d), - TOBN(0x32801d7b, 0x1b4a158c), TOBN(0xe571c99e, 0x27e2a369), - TOBN(0x40cb76c0, 0x10d9f197), TOBN(0xc308c289, 0x3167c0ae), - TOBN(0xa6ef9dd3, 0xeb7958f2), TOBN(0xa7226dfc, 0x300879b1), - TOBN(0x6cd0b362, 0x7edf0636), TOBN(0x4efbce6c, 0x7bc37eed), - TOBN(0x75f92a05, 0x8d699021), TOBN(0x586d4c79, 0x772566e3), - TOBN(0x378ca5f1, 0x761ad23a), TOBN(0x650d86fc, 0x1465a8ac), - TOBN(0x7a4ed457, 0x842ba251), TOBN(0x6b65e3e6, 0x42234933), - TOBN(0xaf1543b7, 0x31aad657), TOBN(0xa4cefe98, 0xcbfec369), - TOBN(0xb587da90, 0x9f47befb), TOBN(0x6562e9fb, 0x41312d13), - TOBN(0xa691ea59, 0xeff1cefe), TOBN(0xcc30477a, 0x05fc4cf6), - TOBN(0xa1632461, 0x0b0ffd3d), TOBN(0xa1f16f3b, 0x5b355956), - TOBN(0x5b148d53, 0x4224ec24), TOBN(0xdc834e7b, 0xf977012a), - TOBN(0x7bfc5e75, 0xb2c69dbc), TOBN(0x3aa77a29, 0x03c3da6c), - TOBN(0xde0df03c, 0xca910271), TOBN(0xcbd5ca4a, 0x7806dc55), - TOBN(0xe1ca5807, 0x6db476cb), TOBN(0xfde15d62, 0x5f37a31e), - TOBN(0xf49af520, 0xf41af416), TOBN(0x96c5c5b1, 0x7d342db5), - TOBN(0x155c43b7, 0xeb4ceb9b), TOBN(0x2e993010, 0x4e77371a), - TOBN(0x1d2987da, 0x675d43af), TOBN(0xef2bc1c0, 0x8599fd72), - TOBN(0x96894b7b, 0x9342f6b2), TOBN(0x201eadf2, 0x7c8e71f0), - TOBN(0xf3479d9f, 0x4a1f3efc), TOBN(0xe0f8a742, 0x702a9704), - TOBN(0xeafd44b6, 0xb3eba40c), TOBN(0xf9739f29, 0xc1c1e0d0), - TOBN(0x0091471a, 0x619d505e), TOBN(0xc15f9c96, 0x9d7c263e), - TOBN(0x5be47285, 0x83afbe33), TOBN(0xa3b6d6af, 0x04f1e092), - TOBN(0xe76526b9, 0x751a9d11), TOBN(0x2ec5b26d, 0x9a4ae4d2), - TOBN(0xeb66f4d9, 0x02f6fb8d), TOBN(0x4063c561, 0x96912164), - TOBN(0xeb7050c1, 0x80ef3000), TOBN(0x288d1c33, 0xeaa5b3f0), - TOBN(0xe87c68d6, 0x07806fd8), TOBN(0xb2f7f9d5, 0x4bbbf50f), - TOBN(0x25972f3a, 0xac8d6627), TOBN(0xf8547774, 0x10e8c13b), - TOBN(0xcc50ef6c, 0x872b4a60), TOBN(0xab2a34a4, 0x4613521b), - TOBN(0x39c5c190, 0x983e15d1), TOBN(0x61dde5df, 0x59905512), - TOBN(0xe417f621, 0x9f2275f3), TOBN(0x0750c8b6, 0x451d894b), - TOBN(0x75b04ab9, 0x78b0bdaa), TOBN(0x3bfd9fd4, 0x458589bd), - TOBN(0xf1013e30, 0xee9120b6), TOBN(0x2b51af93, 0x23a4743e), - TOBN(0xea96ffae, 0x48d14d9e), TOBN(0x71dc0dbe, 0x698a1d32), - TOBN(0x914962d2, 0x0180cca4), TOBN(0x1ae60677, 0xc3568963), - TOBN(0x8cf227b1, 0x437bc444), TOBN(0xc650c83b, 0xc9962c7a), - TOBN(0x23c2c7dd, 0xfe7ccfc4), TOBN(0xf925c89d, 0x1b929d48), - TOBN(0x4460f74b, 0x06783c33), TOBN(0xac2c8d49, 0xa590475a), - TOBN(0xfb40b407, 0xb807bba0), TOBN(0x9d1e362d, 0x69ff8f3a), - TOBN(0xa33e9681, 0xcbef64a4), TOBN(0x67ece5fa, 0x332fb4b2), - TOBN(0x6900a99b, 0x739f10e3), TOBN(0xc3341ca9, 0xff525925), - TOBN(0xee18a626, 0xa9e2d041), TOBN(0xa5a83685, 0x29580ddd), - TOBN(0xf3470c81, 0x9d7de3cd), TOBN(0xedf02586, 0x2062cf9c), - TOBN(0xf43522fa, 0xc010edb0), TOBN(0x30314135, 0x13a4b1ae), - TOBN(0xc792e02a, 0xdb22b94b), TOBN(0x993d8ae9, 0xa1eaa45b), - TOBN(0x8aad6cd3, 0xcd1e1c63), TOBN(0x89529ca7, 0xc5ce688a), - TOBN(0x2ccee3aa, 0xe572a253), TOBN(0xe02b6438, 0x02a21efb), - TOBN(0xa7091b6e, 0xc9430358), TOBN(0x06d1b1fa, 0x9d7db504), - TOBN(0x58846d32, 0xc4744733), TOBN(0x40517c71, 0x379f9e34), - TOBN(0x2f65655f, 0x130ef6ca), TOBN(0x526e4488, 0xf1f3503f), - TOBN(0x8467bd17, 0x7ee4a976), TOBN(0x1d9dc913, 0x921363d1), - TOBN(0xd8d24c33, 0xb069e041), TOBN(0x5eb5da0a, 0x2cdf7f51), - TOBN(0x1c0f3cb1, 0x197b994f), TOBN(0x3c95a6c5, 0x2843eae9), - TOBN(0x7766ffc9, 0xa6097ea5), TOBN(0x7bea4093, 0xd723b867), - TOBN(0xb48e1f73, 0x4db378f9), TOBN(0x70025b00, 0xe37b77ac), - TOBN(0x943dc8e7, 0xaf24ad46), TOBN(0xb98a15ac, 0x16d00a85), - TOBN(0x3adc38ba, 0x2743b004), TOBN(0xb1c7f4f7, 0x334415ee), - TOBN(0xea43df8f, 0x1e62d05a), TOBN(0x32618905, 0x9d76a3b6), - TOBN(0x2fbd0bb5, 0xa23a0f46), TOBN(0x5bc971db, 0x6a01918c), - TOBN(0x7801d94a, 0xb4743f94), TOBN(0xb94df65e, 0x676ae22b), - TOBN(0xaafcbfab, 0xaf95894c), TOBN(0x7b9bdc07, 0x276b2241), - TOBN(0xeaf98362, 0x5bdda48b), TOBN(0x5977faf2, 0xa3fcb4df), - TOBN(0xbed042ef, 0x052c4b5b), TOBN(0x9fe87f71, 0x067591f0), - TOBN(0xc89c73ca, 0x22f24ec7), TOBN(0x7d37fa9e, 0xe64a9f1b), - TOBN(0x2710841a, 0x15562627), TOBN(0x2c01a613, 0xc243b034), - TOBN(0x1d135c56, 0x2bc68609), TOBN(0xc2ca1715, 0x8b03f1f6), - TOBN(0xc9966c2d, 0x3eb81d82), TOBN(0xc02abf4a, 0x8f6df13e), - TOBN(0x77b34bd7, 0x8f72b43b), TOBN(0xaff6218f, 0x360c82b0), - TOBN(0x0aa5726c, 0x8d55b9d2), TOBN(0xdc0adbe9, 0x99e9bffb), - TOBN(0x9097549c, 0xefb9e72a), TOBN(0x16755712, 0x9dfb3111), - TOBN(0xdd8bf984, 0xf26847f9), TOBN(0xbcb8e387, 0xdfb30cb7), - TOBN(0xc1fd32a7, 0x5171ef9c), TOBN(0x977f3fc7, 0x389b363f), - TOBN(0x116eaf2b, 0xf4babda0), TOBN(0xfeab68bd, 0xf7113c8e), - TOBN(0xd1e3f064, 0xb7def526), TOBN(0x1ac30885, 0xe0b3fa02), - TOBN(0x1c5a6e7b, 0x40142d9d), TOBN(0x839b5603, 0x30921c0b), - TOBN(0x48f301fa, 0x36a116a3), TOBN(0x380e1107, 0xcfd9ee6d), - TOBN(0x7945ead8, 0x58854be1), TOBN(0x4111c12e, 0xcbd4d49d), - TOBN(0xece3b1ec, 0x3a29c2ef), TOBN(0x6356d404, 0x8d3616f5), - TOBN(0x9f0d6a8f, 0x594d320e), TOBN(0x0989316d, 0xf651ccd2), - TOBN(0x6c32117a, 0x0f8fdde4), TOBN(0x9abe5cc5, 0xa26a9bbc), - TOBN(0xcff560fb, 0x9723f671), TOBN(0x21b2a12d, 0x7f3d593c), - TOBN(0xe4cb18da, 0x24ba0696), TOBN(0x186e2220, 0xc3543384), - TOBN(0x722f64e0, 0x88312c29), TOBN(0x94282a99, 0x17dc7752), - TOBN(0x62467bbf, 0x5a85ee89), TOBN(0xf435c650, 0xf10076a0), - TOBN(0xc9ff1539, 0x43b3a50b), TOBN(0x7132130c, 0x1a53efbc), - TOBN(0x31bfe063, 0xf7b0c5b7), TOBN(0xb0179a7d, 0x4ea994cc), - TOBN(0x12d064b3, 0xc85f455b), TOBN(0x47259328, 0x8f6e0062), - TOBN(0xf64e590b, 0xb875d6d9), TOBN(0x22dd6225, 0xad92bcc7), - TOBN(0xb658038e, 0xb9c3bd6d), TOBN(0x00cdb0d6, 0xfbba27c8), - TOBN(0x0c681337, 0x1062c45d), TOBN(0xd8515b8c, 0x2d33407d), - TOBN(0xcb8f699e, 0x8cbb5ecf), TOBN(0x8c4347f8, 0xc608d7d8), - TOBN(0x2c11850a, 0xbb3e00db), TOBN(0x20a8dafd, 0xecb49d19), - TOBN(0xbd781480, 0x45ee2f40), TOBN(0x75e354af, 0x416b60cf), - TOBN(0xde0b58a1, 0x8d49a8c4), TOBN(0xe40e94e2, 0xfa359536), - TOBN(0xbd4fa59f, 0x62accd76), TOBN(0x05cf466a, 0x8c762837), - TOBN(0xb5abda99, 0x448c277b), TOBN(0x5a9e01bf, 0x48b13740), - TOBN(0x9d457798, 0x326aad8d), TOBN(0xbdef4954, 0xc396f7e7), - TOBN(0x6fb274a2, 0xc253e292), TOBN(0x2800bf0a, 0x1cfe53e7), - TOBN(0x22426d31, 0x44438fd4), TOBN(0xef233923, 0x5e259f9a), - TOBN(0x4188503c, 0x03f66264), TOBN(0x9e5e7f13, 0x7f9fdfab), - TOBN(0x565eb76c, 0x5fcc1aba), TOBN(0xea632548, 0x59b5bff8), - TOBN(0x5587c087, 0xaab6d3fa), TOBN(0x92b639ea, 0x6ce39c1b), - TOBN(0x0706e782, 0x953b135c), TOBN(0x7308912e, 0x425268ef), - TOBN(0x599e92c7, 0x090e7469), TOBN(0x83b90f52, 0x9bc35e75), - TOBN(0x4750b3d0, 0x244975b3), TOBN(0xf3a44358, 0x11965d72), - TOBN(0x179c6774, 0x9c8dc751), TOBN(0xff18cdfe, 0xd23d9ff0), - TOBN(0xc4013833, 0x2028e247), TOBN(0x96e280e2, 0xf3bfbc79), - TOBN(0xf60417bd, 0xd0880a84), TOBN(0x263c9f3d, 0x2a568151), - TOBN(0x36be15b3, 0x2d2ce811), TOBN(0x846dc0c2, 0xf8291d21), - TOBN(0x5cfa0ecb, 0x789fcfdb), TOBN(0x45a0beed, 0xd7535b9a), - TOBN(0xec8e9f07, 0x96d69af1), TOBN(0x31a7c5b8, 0x599ab6dc), - TOBN(0xd36d45ef, 0xf9e2e09f), TOBN(0x3cf49ef1, 0xdcee954b), - TOBN(0x6be34cf3, 0x086cff9b), TOBN(0x88dbd491, 0x39a3360f), - TOBN(0x1e96b8cc, 0x0dbfbd1d), TOBN(0xc1e5f7bf, 0xcb7e2552), - TOBN(0x0547b214, 0x28819d98), TOBN(0xc770dd9c, 0x7aea9dcb), - TOBN(0xaef0d4c7, 0x041d68c8), TOBN(0xcc2b9818, 0x13cb9ba8), - TOBN(0x7fc7bc76, 0xfe86c607), TOBN(0x6b7b9337, 0x502a9a95), - TOBN(0x1948dc27, 0xd14dab63), TOBN(0x249dd198, 0xdae047be), - TOBN(0xe8356584, 0xa981a202), TOBN(0x3531dd18, 0x3a893387), - TOBN(0x1be11f90, 0xc85c7209), TOBN(0x93d2fe1e, 0xe2a52b5a), - TOBN(0x8225bfe2, 0xec6d6b97), TOBN(0x9cf6d6f4, 0xbd0aa5de), - TOBN(0x911459cb, 0x54779f5f), TOBN(0x5649cddb, 0x86aeb1f3), - TOBN(0x32133579, 0x3f26ce5a), TOBN(0xc289a102, 0x550f431e), - TOBN(0x559dcfda, 0x73b84c6f), TOBN(0x84973819, 0xee3ac4d7), - TOBN(0xb51e55e6, 0xf2606a82), TOBN(0xe25f7061, 0x90f2fb57), - TOBN(0xacef6c2a, 0xb1a4e37c), TOBN(0x864e359d, 0x5dcf2706), - TOBN(0x479e6b18, 0x7ce57316), TOBN(0x2cab2500, 0x3a96b23d), - TOBN(0xed489862, 0x8ef16df7), TOBN(0x2056538c, 0xef3758b5), - TOBN(0xa7df865e, 0xf15d3101), TOBN(0x80c5533a, 0x61b553d7), - TOBN(0x366e1997, 0x4ed14294), TOBN(0x6620741f, 0xb3c0bcd6), - TOBN(0x21d1d9c4, 0xedc45418), TOBN(0x005b859e, 0xc1cc4a9d), - TOBN(0xdf01f630, 0xa1c462f0), TOBN(0x15d06cf3, 0xf26820c7), - TOBN(0x9f7f24ee, 0x3484be47), TOBN(0x2ff33e96, 0x4a0c902f), - TOBN(0x00bdf457, 0x5a0bc453), TOBN(0x2378dfaf, 0x1aa238db), - TOBN(0x272420ec, 0x856720f2), TOBN(0x2ad9d95b, 0x96797291), - TOBN(0xd1242cc6, 0x768a1558), TOBN(0x2e287f8b, 0x5cc86aa8), - TOBN(0x796873d0, 0x990cecaa), TOBN(0xade55f81, 0x675d4080), - TOBN(0x2645eea3, 0x21f0cd84), TOBN(0x7a1efa0f, 0xb4e17d02), - TOBN(0xf6858420, 0x037cc061), TOBN(0x682e05f0, 0xd5d43e12), - TOBN(0x59c36994, 0x27218710), TOBN(0x85cbba4d, 0x3f7cd2fc), - TOBN(0x726f9729, 0x7a3cd22a), TOBN(0x9f8cd5dc, 0x4a628397), - TOBN(0x17b93ab9, 0xc23165ed), TOBN(0xff5f5dbf, 0x122823d4), - TOBN(0xc1e4e4b5, 0x654a446d), TOBN(0xd1a9496f, 0x677257ba), - TOBN(0x6387ba94, 0xde766a56), TOBN(0x23608bc8, 0x521ec74a), - TOBN(0x16a522d7, 0x6688c4d4), TOBN(0x9d6b4282, 0x07373abd), - TOBN(0xa62f07ac, 0xb42efaa3), TOBN(0xf73e00f7, 0xe3b90180), - TOBN(0x36175fec, 0x49421c3e), TOBN(0xc4e44f9b, 0x3dcf2678), - TOBN(0x76df436b, 0x7220f09f), TOBN(0x172755fb, 0x3aa8b6cf), - TOBN(0xbab89d57, 0x446139cc), TOBN(0x0a0a6e02, 0x5fe0208f), - TOBN(0xcdbb63e2, 0x11e5d399), TOBN(0x33ecaa12, 0xa8977f0b), - TOBN(0x59598b21, 0xf7c42664), TOBN(0xb3e91b32, 0xab65d08a), - TOBN(0x035822ee, 0xf4502526), TOBN(0x1dcf0176, 0x720a82a9), - TOBN(0x50f8598f, 0x3d589e02), TOBN(0xdf0478ff, 0xb1d63d2c), - TOBN(0x8b8068bd, 0x1571cd07), TOBN(0x30c3aa4f, 0xd79670cd), - TOBN(0x25e8fd4b, 0x941ade7f), TOBN(0x3d1debdc, 0x32790011), - TOBN(0x65b6dcbd, 0x3a3f9ff0), TOBN(0x282736a4, 0x793de69c), - TOBN(0xef69a0c3, 0xd41d3bd3), TOBN(0xb533b8c9, 0x07a26bde), - TOBN(0xe2801d97, 0xdb2edf9f), TOBN(0xdc4a8269, 0xe1877af0), - TOBN(0x6c1c5851, 0x3d590dbe), TOBN(0x84632f6b, 0xee4e9357), - TOBN(0xd36d36b7, 0x79b33374), TOBN(0xb46833e3, 0x9bbca2e6), - TOBN(0x37893913, 0xf7fc0586), TOBN(0x385315f7, 0x66bf4719), - TOBN(0x72c56293, 0xb31855dc), TOBN(0xd1416d4e, 0x849061fe), - TOBN(0xbeb3ab78, 0x51047213), TOBN(0x447f6e61, 0xf040c996), - TOBN(0xd06d310d, 0x638b1d0c), TOBN(0xe28a413f, 0xbad1522e), - TOBN(0x685a76cb, 0x82003f86), TOBN(0x610d07f7, 0x0bcdbca3), - TOBN(0x6ff66021, 0x9ca4c455), TOBN(0x7df39b87, 0xcea10eec), - TOBN(0xb9255f96, 0xe22db218), TOBN(0x8cc6d9eb, 0x08a34c44), - TOBN(0xcd4ffb86, 0x859f9276), TOBN(0x8fa15eb2, 0x50d07335), - TOBN(0xdf553845, 0xcf2c24b5), TOBN(0x89f66a9f, 0x52f9c3ba), - TOBN(0x8f22b5b9, 0xe4a7ceb3), TOBN(0xaffef809, 0x0e134686), - TOBN(0x3e53e1c6, 0x8eb8fac2), TOBN(0x93c1e4eb, 0x28aec98e), - TOBN(0xb6b91ec5, 0x32a43bcb), TOBN(0x2dbfa947, 0xb2d74a51), - TOBN(0xe065d190, 0xca84bad7), TOBN(0xfb13919f, 0xad58e65c), - TOBN(0x3c41718b, 0xf1cb6e31), TOBN(0x688969f0, 0x06d05c3f), - TOBN(0xd4f94ce7, 0x21264d45), TOBN(0xfdfb65e9, 0x7367532b), - TOBN(0x5b1be8b1, 0x0945a39d), TOBN(0x229f789c, 0x2b8baf3b), - TOBN(0xd8f41f3e, 0x6f49f15d), TOBN(0x678ce828, 0x907f0792), - TOBN(0xc69ace82, 0xfca6e867), TOBN(0x106451ae, 0xd01dcc89), - TOBN(0x1bb4f7f0, 0x19fc32d2), TOBN(0x64633dfc, 0xb00c52d2), - TOBN(0x8f13549a, 0xad9ea445), TOBN(0x99a3bf50, 0xfb323705), - TOBN(0x0c9625a2, 0x534d4dbc), TOBN(0x45b8f1d1, 0xc2a2fea3), - TOBN(0x76ec21a1, 0xa530fc1a), TOBN(0x4bac9c2a, 0x9e5bd734), - TOBN(0x5996d76a, 0x7b4e3587), TOBN(0x0045cdee, 0x1182d9e3), - TOBN(0x1aee24b9, 0x1207f13d), TOBN(0x66452e97, 0x97345a41), - TOBN(0x16e5b054, 0x9f950cd0), TOBN(0x9cc72fb1, 0xd7fdd075), - TOBN(0x6edd61e7, 0x66249663), TOBN(0xde4caa4d, 0xf043cccb), - TOBN(0x11b1f57a, 0x55c7ac17), TOBN(0x779cbd44, 0x1a85e24d), - TOBN(0x78030f86, 0xe46081e7), TOBN(0xfd4a6032, 0x8e20f643), - TOBN(0xcc7a6488, 0x0a750c0f), TOBN(0x39bacfe3, 0x4e548e83), - TOBN(0x3d418c76, 0x0c110f05), TOBN(0x3e4daa4c, 0xb1f11588), - TOBN(0x2733e7b5, 0x5ffc69ff), TOBN(0x46f147bc, 0x92053127), - TOBN(0x885b2434, 0xd722df94), TOBN(0x6a444f65, 0xe6fc6b7c)}, - {TOBN(0x7a1a465a, 0xc3f16ea8), TOBN(0x115a461d, 0xb2f1d11c), - TOBN(0x4767dd95, 0x6c68a172), TOBN(0x3392f2eb, 0xd13a4698), - TOBN(0xc7a99ccd, 0xe526cdc7), TOBN(0x8e537fdc, 0x22292b81), - TOBN(0x76d8cf69, 0xa6d39198), TOBN(0xffc5ff43, 0x2446852d), - TOBN(0x97b14f7e, 0xa90567e6), TOBN(0x513257b7, 0xb6ae5cb7), - TOBN(0x85454a3c, 0x9f10903d), TOBN(0xd8d2c9ad, 0x69bc3724), - TOBN(0x38da9324, 0x6b29cb44), TOBN(0xb540a21d, 0x77c8cbac), - TOBN(0x9bbfe435, 0x01918e42), TOBN(0xfffa707a, 0x56c3614e), - TOBN(0x0ce4e3f1, 0xd4e353b7), TOBN(0x062d8a14, 0xef46b0a0), - TOBN(0x6408d5ab, 0x574b73fd), TOBN(0xbc41d1c9, 0xd3273ffd), - TOBN(0x3538e1e7, 0x6be77800), TOBN(0x71fe8b37, 0xc5655031), - TOBN(0x1cd91621, 0x6b9b331a), TOBN(0xad825d0b, 0xbb388f73), - TOBN(0x56c2e05b, 0x1cb76219), TOBN(0x0ec0bf91, 0x71567e7e), - TOBN(0xe7076f86, 0x61c4c910), TOBN(0xd67b085b, 0xbabc04d9), - TOBN(0x9fb90459, 0x5e93a96a), TOBN(0x7526c1ea, 0xfbdc249a), - TOBN(0x0d44d367, 0xecdd0bb7), TOBN(0x95399917, 0x9dc0d695), - TOBN(0x61360ee9, 0x9e240d18), TOBN(0x057cdcac, 0xb4b94466), - TOBN(0xe7667cd1, 0x2fe5325c), TOBN(0x1fa297b5, 0x21974e3b), - TOBN(0xfa4081e7, 0xdb083d76), TOBN(0x31993be6, 0xf206bd15), - TOBN(0x8949269b, 0x14c19f8c), TOBN(0x21468d72, 0xa9d92357), - TOBN(0x2ccbc583, 0xa4c506ec), TOBN(0x957ed188, 0xd1acfe97), - TOBN(0x8baed833, 0x12f1aea2), TOBN(0xef2a6cb4, 0x8325362d), - TOBN(0x130dde42, 0x8e195c43), TOBN(0xc842025a, 0x0e6050c6), - TOBN(0x2da972a7, 0x08686a5d), TOBN(0xb52999a1, 0xe508b4a8), - TOBN(0xd9f090b9, 0x10a5a8bd), TOBN(0xca91d249, 0x096864da), - TOBN(0x8e6a93be, 0x3f67dbc1), TOBN(0xacae6fba, 0xf5f4764c), - TOBN(0x1563c6e0, 0xd21411a0), TOBN(0x28fa787f, 0xda0a4ad8), - TOBN(0xd524491c, 0x908c8030), TOBN(0x1257ba0e, 0x4c795f07), - TOBN(0x83f49167, 0xceca9754), TOBN(0x426d2cf6, 0x4b7939a0), - TOBN(0x2555e355, 0x723fd0bf), TOBN(0xa96e6d06, 0xc4f144e2), - TOBN(0x4768a8dd, 0x87880e61), TOBN(0x15543815, 0xe508e4d5), - TOBN(0x09d7e772, 0xb1b65e15), TOBN(0x63439dd6, 0xac302fa0), - TOBN(0xb93f802f, 0xc14e35c2), TOBN(0x71735b7c, 0x4341333c), - TOBN(0x03a25104, 0x16d4f362), TOBN(0x3f4d069b, 0xbf433c8e), - TOBN(0x0d83ae01, 0xf78f5a7c), TOBN(0x50a8ffbe, 0x7c4eed07), - TOBN(0xc74f8906, 0x76e10f83), TOBN(0x7d080966, 0x9ddaf8e1), - TOBN(0xb11df8e1, 0x698e04cc), TOBN(0x877be203, 0x169005c8), - TOBN(0x32749e8c, 0x4f3c6179), TOBN(0x2dbc9d0a, 0x7853fc05), - TOBN(0x187d4f93, 0x9454d937), TOBN(0xe682ce9d, 0xb4800e1b), - TOBN(0xa9129ad8, 0x165e68e8), TOBN(0x0fe29735, 0xbe7f785b), - TOBN(0x5303f40c, 0x5b9e02b7), TOBN(0xa37c9692, 0x35ee04e8), - TOBN(0x5f46cc20, 0x34d6632b), TOBN(0x55ef72b2, 0x96ac545b), - TOBN(0xabec5c1f, 0x7b91b062), TOBN(0x0a79e1c7, 0xbb33e821), - TOBN(0xbb04b428, 0x3a9f4117), TOBN(0x0de1f28f, 0xfd2a475a), - TOBN(0x31019ccf, 0x3a4434b4), TOBN(0xa3458111, 0x1a7954dc), - TOBN(0xa9dac80d, 0xe34972a7), TOBN(0xb043d054, 0x74f6b8dd), - TOBN(0x021c319e, 0x11137b1a), TOBN(0x00a754ce, 0xed5cc03f), - TOBN(0x0aa2c794, 0xcbea5ad4), TOBN(0x093e67f4, 0x70c015b6), - TOBN(0x72cdfee9, 0xc97e3f6b), TOBN(0xc10bcab4, 0xb6da7461), - TOBN(0x3b02d2fc, 0xb59806b9), TOBN(0x85185e89, 0xa1de6f47), - TOBN(0x39e6931f, 0x0eb6c4d4), TOBN(0x4d4440bd, 0xd4fa5b04), - TOBN(0x5418786e, 0x34be7eb8), TOBN(0x6380e521, 0x9d7259bc), - TOBN(0x20ac0351, 0xd598d710), TOBN(0x272c4166, 0xcb3a4da4), - TOBN(0xdb82fe1a, 0xca71de1f), TOBN(0x746e79f2, 0xd8f54b0f), - TOBN(0x6e7fc736, 0x4b573e9b), TOBN(0x75d03f46, 0xfd4b5040), - TOBN(0x5c1cc36d, 0x0b98d87b), TOBN(0x513ba3f1, 0x1f472da1), - TOBN(0x79d0af26, 0xabb177dd), TOBN(0xf82ab568, 0x7891d564), - TOBN(0x2b6768a9, 0x72232173), TOBN(0xefbb3bb0, 0x8c1f6619), - TOBN(0xb29c11db, 0xa6d18358), TOBN(0x519e2797, 0xb0916d3a), - TOBN(0xd4dc18f0, 0x9188e290), TOBN(0x648e86e3, 0x98b0ca7f), - TOBN(0x859d3145, 0x983c38b5), TOBN(0xb14f176c, 0x637abc8b), - TOBN(0x2793fb9d, 0xcaff7be6), TOBN(0xebe5a55f, 0x35a66a5a), - TOBN(0x7cec1dcd, 0x9f87dc59), TOBN(0x7c595cd3, 0xfbdbf560), - TOBN(0x5b543b22, 0x26eb3257), TOBN(0x69080646, 0xc4c935fd), - TOBN(0x7f2e4403, 0x81e9ede3), TOBN(0x243c3894, 0xcaf6df0a), - TOBN(0x7c605bb1, 0x1c073b11), TOBN(0xcd06a541, 0xba6a4a62), - TOBN(0x29168949, 0x49d4e2e5), TOBN(0x33649d07, 0x4af66880), - TOBN(0xbfc0c885, 0xe9a85035), TOBN(0xb4e52113, 0xfc410f4b), - TOBN(0xdca3b706, 0x78a6513b), TOBN(0x92ea4a2a, 0x9edb1943), - TOBN(0x02642216, 0xdb6e2dd8), TOBN(0x9b45d0b4, 0x9fd57894), - TOBN(0x114e70db, 0xc69d11ae), TOBN(0x1477dd19, 0x4c57595f), - TOBN(0xbc2208b4, 0xec77c272), TOBN(0x95c5b4d7, 0xdb68f59c), - TOBN(0xb8c4fc63, 0x42e532b7), TOBN(0x386ba422, 0x9ae35290), - TOBN(0xfb5dda42, 0xd201ecbc), TOBN(0x2353dc8b, 0xa0e38fd6), - TOBN(0x9a0b85ea, 0x68f7e978), TOBN(0x96ec5682, 0x2ad6d11f), - TOBN(0x5e279d6c, 0xe5f6886d), TOBN(0xd3fe03cd, 0x3cb1914d), - TOBN(0xfe541fa4, 0x7ea67c77), TOBN(0x952bd2af, 0xe3ea810c), - TOBN(0x791fef56, 0x8d01d374), TOBN(0xa3a1c621, 0x0f11336e), - TOBN(0x5ad0d5a9, 0xc7ec6d79), TOBN(0xff7038af, 0x3225c342), - TOBN(0x003c6689, 0xbc69601b), TOBN(0x25059bc7, 0x45e8747d), - TOBN(0xfa4965b2, 0xf2086fbf), TOBN(0xf6840ea6, 0x86916078), - TOBN(0xd7ac7620, 0x70081d6c), TOBN(0xe600da31, 0xb5328645), - TOBN(0x01916f63, 0x529b8a80), TOBN(0xe80e4858, 0x2d7d6f3e), - TOBN(0x29eb0fe8, 0xd664ca7c), TOBN(0xf017637b, 0xe7b43b0c), - TOBN(0x9a75c806, 0x76cb2566), TOBN(0x8f76acb1, 0xb24892d9), - TOBN(0x7ae7b9cc, 0x1f08fe45), TOBN(0x19ef7329, 0x6a4907d8), - TOBN(0x2db4ab71, 0x5f228bf0), TOBN(0xf3cdea39, 0x817032d7), - TOBN(0x0b1f482e, 0xdcabe3c0), TOBN(0x3baf76b4, 0xbb86325c), - TOBN(0xd49065e0, 0x10089465), TOBN(0x3bab5d29, 0x8e77c596), - TOBN(0x7636c3a6, 0x193dbd95), TOBN(0xdef5d294, 0xb246e499), - TOBN(0xb22c58b9, 0x286b2475), TOBN(0xa0b93939, 0xcd80862b), - TOBN(0x3002c83a, 0xf0992388), TOBN(0x6de01f9b, 0xeacbe14c), - TOBN(0x6aac688e, 0xadd70482), TOBN(0x708de92a, 0x7b4a4e8a), - TOBN(0x75b6dd73, 0x758a6eef), TOBN(0xea4bf352, 0x725b3c43), - TOBN(0x10041f2c, 0x87912868), TOBN(0xb1b1be95, 0xef09297a), - TOBN(0x19ae23c5, 0xa9f3860a), TOBN(0xc4f0f839, 0x515dcf4b), - TOBN(0x3c7ecca3, 0x97f6306a), TOBN(0x744c44ae, 0x68a3a4b0), - TOBN(0x69cd13a0, 0xb3a1d8a2), TOBN(0x7cad0a1e, 0x5256b578), - TOBN(0xea653fcd, 0x33791d9e), TOBN(0x9cc2a05d, 0x74b2e05f), - TOBN(0x73b391dc, 0xfd7affa2), TOBN(0xddb7091e, 0xb6b05442), - TOBN(0xc71e27bf, 0x8538a5c6), TOBN(0x195c63dd, 0x89abff17), - TOBN(0xfd315285, 0x1b71e3da), TOBN(0x9cbdfda7, 0xfa680fa0), - TOBN(0x9db876ca, 0x849d7eab), TOBN(0xebe2764b, 0x3c273271), - TOBN(0x663357e3, 0xf208dcea), TOBN(0x8c5bd833, 0x565b1b70), - TOBN(0xccc3b4f5, 0x9837fc0d), TOBN(0x9b641ba8, 0xa79cf00f), - TOBN(0x7428243d, 0xdfdf3990), TOBN(0x83a594c4, 0x020786b1), - TOBN(0xb712451a, 0x526c4502), TOBN(0x9d39438e, 0x6adb3f93), - TOBN(0xfdb261e3, 0xe9ff0ccd), TOBN(0x80344e3c, 0xe07af4c3), - TOBN(0x75900d7c, 0x2fa4f126), TOBN(0x08a3b865, 0x5c99a232), - TOBN(0x2478b6bf, 0xdb25e0c3), TOBN(0x482cc2c2, 0x71db2edf), - TOBN(0x37df7e64, 0x5f321bb8), TOBN(0x8a93821b, 0x9a8005b4), - TOBN(0x3fa2f10c, 0xcc8c1958), TOBN(0x0d332218, 0x2c269d0a), - TOBN(0x20ab8119, 0xe246b0e6), TOBN(0xb39781e4, 0xd349fd17), - TOBN(0xd293231e, 0xb31aa100), TOBN(0x4b779c97, 0xbb032168), - TOBN(0x4b3f19e1, 0xc8470500), TOBN(0x45b7efe9, 0x0c4c869d), - TOBN(0xdb84f38a, 0xa1a6bbcc), TOBN(0x3b59cb15, 0xb2fddbc1), - TOBN(0xba5514df, 0x3fd165e8), TOBN(0x499fd6a9, 0x061f8811), - TOBN(0x72cd1fe0, 0xbfef9f00), TOBN(0x120a4bb9, 0x79ad7e8a), - TOBN(0xf2ffd095, 0x5f4a5ac5), TOBN(0xcfd174f1, 0x95a7a2f0), - TOBN(0xd42301ba, 0x9d17baf1), TOBN(0xd2fa487a, 0x77f22089), - TOBN(0x9cb09efe, 0xb1dc77e1), TOBN(0xe9566939, 0x21c99682), - TOBN(0x8c546901, 0x6c6067bb), TOBN(0xfd378574, 0x61c24456), - TOBN(0x2b6a6cbe, 0x81796b33), TOBN(0x62d550f6, 0x58e87f8b), - TOBN(0x1b763e1c, 0x7f1b01b4), TOBN(0x4b93cfea, 0x1b1b5e12), - TOBN(0xb9345238, 0x1d531696), TOBN(0x57201c00, 0x88cdde69), - TOBN(0xdde92251, 0x9a86afc7), TOBN(0xe3043895, 0xbd35cea8), - TOBN(0x7608c1e1, 0x8555970d), TOBN(0x8267dfa9, 0x2535935e), - TOBN(0xd4c60a57, 0x322ea38b), TOBN(0xe0bf7977, 0x804ef8b5), - TOBN(0x1a0dab28, 0xc06fece4), TOBN(0xd405991e, 0x94e7b49d), - TOBN(0xc542b6d2, 0x706dab28), TOBN(0xcb228da3, 0xa91618fb), - TOBN(0x224e4164, 0x107d1cea), TOBN(0xeb9fdab3, 0xd0f5d8f1), - TOBN(0xc02ba386, 0x0d6e41cd), TOBN(0x676a72c5, 0x9b1f7146), - TOBN(0xffd6dd98, 0x4d6cb00b), TOBN(0xcef9c5ca, 0xde2e8d7c), - TOBN(0xa1bbf5d7, 0x641c7936), TOBN(0x1b95b230, 0xee8f772e), - TOBN(0xf765a92e, 0xe8ac25b1), TOBN(0xceb04cfc, 0x3a18b7c6), - TOBN(0x27944cef, 0x0acc8966), TOBN(0xcbb3c957, 0x434c1004), - TOBN(0x9c9971a1, 0xa43ff93c), TOBN(0x5bc2db17, 0xa1e358a9), - TOBN(0x45b4862e, 0xa8d9bc82), TOBN(0x70ebfbfb, 0x2201e052), - TOBN(0xafdf64c7, 0x92871591), TOBN(0xea5bcae6, 0xb42d0219), - TOBN(0xde536c55, 0x2ad8f03c), TOBN(0xcd6c3f4d, 0xa76aa33c), - TOBN(0xbeb5f623, 0x0bca6de3), TOBN(0xdd20dd99, 0xb1e706fd), - TOBN(0x90b3ff9d, 0xac9059d4), TOBN(0x2d7b2902, 0x7ccccc4e), - TOBN(0x8a090a59, 0xce98840f), TOBN(0xa5d947e0, 0x8410680a), - TOBN(0x49ae346a, 0x923379a5), TOBN(0x7dbc84f9, 0xb28a3156), - TOBN(0xfd40d916, 0x54a1aff2), TOBN(0xabf318ba, 0x3a78fb9b), - TOBN(0x50152ed8, 0x3029f95e), TOBN(0x9fc1dd77, 0xc58ad7fa), - TOBN(0x5fa57915, 0x13595c17), TOBN(0xb9504668, 0x8f62b3a9), - TOBN(0x907b5b24, 0xff3055b0), TOBN(0x2e995e35, 0x9a84f125), - TOBN(0x87dacf69, 0x7e9bbcfb), TOBN(0x95d0c1d6, 0xe86d96e3), - TOBN(0x65726e3c, 0x2d95a75c), TOBN(0x2c3c9001, 0xacd27f21), - TOBN(0x1deab561, 0x6c973f57), TOBN(0x108b7e2c, 0xa5221643), - TOBN(0x5fee9859, 0xc4ef79d4), TOBN(0xbd62b88a, 0x40d4b8c6), - TOBN(0xb4dd29c4, 0x197c75d6), TOBN(0x266a6df2, 0xb7076feb), - TOBN(0x9512d0ea, 0x4bf2df11), TOBN(0x1320c24f, 0x6b0cc9ec), - TOBN(0x6bb1e0e1, 0x01a59596), TOBN(0x8317c5bb, 0xeff9aaac), - TOBN(0x65bb405e, 0x385aa6c9), TOBN(0x613439c1, 0x8f07988f), - TOBN(0xd730049f, 0x16a66e91), TOBN(0xe97f2820, 0xfa1b0e0d), - TOBN(0x4131e003, 0x304c28ea), TOBN(0x820ab732, 0x526bac62), - TOBN(0xb2ac9ef9, 0x28714423), TOBN(0x54ecfffa, 0xadb10cb2), - TOBN(0x8781476e, 0xf886a4cc), TOBN(0x4b2c87b5, 0xdb2f8d49), - TOBN(0xe857cd20, 0x0a44295d), TOBN(0x707d7d21, 0x58c6b044), - TOBN(0xae8521f9, 0xf596757c), TOBN(0x87448f03, 0x67b2b714), - TOBN(0x13a9bc45, 0x5ebcd58d), TOBN(0x79bcced9, 0x9122d3c1), - TOBN(0x3c644247, 0x9e076642), TOBN(0x0cf22778, 0x2df4767d), - TOBN(0x5e61aee4, 0x71d444b6), TOBN(0x211236bf, 0xc5084a1d), - TOBN(0x7e15bc9a, 0x4fd3eaf6), TOBN(0x68df2c34, 0xab622bf5), - TOBN(0x9e674f0f, 0x59bf4f36), TOBN(0xf883669b, 0xd7f34d73), - TOBN(0xc48ac1b8, 0x31497b1d), TOBN(0x323b925d, 0x5106703b), - TOBN(0x22156f42, 0x74082008), TOBN(0xeffc521a, 0xc8482bcb), - TOBN(0x5c6831bf, 0x12173479), TOBN(0xcaa2528f, 0xc4739490), - TOBN(0x84d2102a, 0x8f1b3c4d), TOBN(0xcf64dfc1, 0x2d9bec0d), - TOBN(0x433febad, 0x78a546ef), TOBN(0x1f621ec3, 0x7b73cef1), - TOBN(0x6aecd627, 0x37338615), TOBN(0x162082ab, 0x01d8edf6), - TOBN(0x833a8119, 0x19e86b66), TOBN(0x6023a251, 0xd299b5db), - TOBN(0xf5bb0c3a, 0xbbf04b89), TOBN(0x6735eb69, 0xae749a44), - TOBN(0xd0e058c5, 0x4713de3b), TOBN(0xfdf2593e, 0x2c3d4ccd), - TOBN(0x1b8f414e, 0xfdd23667), TOBN(0xdd52aaca, 0xfa2015ee), - TOBN(0x3e31b517, 0xbd9625ff), TOBN(0x5ec9322d, 0x8db5918c), - TOBN(0xbc73ac85, 0xa96f5294), TOBN(0x82aa5bf3, 0x61a0666a), - TOBN(0x49755810, 0xbf08ac42), TOBN(0xd21cdfd5, 0x891cedfc), - TOBN(0x918cb57b, 0x67f8be10), TOBN(0x365d1a7c, 0x56ffa726), - TOBN(0x2435c504, 0x6532de93), TOBN(0xc0fc5e10, 0x2674cd02), - TOBN(0x6e51fcf8, 0x9cbbb142), TOBN(0x1d436e5a, 0xafc50692), - TOBN(0x766bffff, 0x3fbcae22), TOBN(0x3148c2fd, 0xfd55d3b8), - TOBN(0x52c7fdc9, 0x233222fa), TOBN(0x89ff1092, 0xe419fb6b), - TOBN(0x3cd6db99, 0x25254977), TOBN(0x2e85a161, 0x1cf12ca7), - TOBN(0xadd2547c, 0xdc810bc9), TOBN(0xea3f458f, 0x9d257c22), - TOBN(0x642c1fbe, 0x27d6b19b), TOBN(0xed07e6b5, 0x140481a6), - TOBN(0x6ada1d42, 0x86d2e0f8), TOBN(0xe5920122, 0x0e8a9fd5), - TOBN(0x02c936af, 0x708c1b49), TOBN(0x60f30fee, 0x2b4bfaff), - TOBN(0x6637ad06, 0x858e6a61), TOBN(0xce4c7767, 0x3fd374d0), - TOBN(0x39d54b2d, 0x7188defb), TOBN(0xa8c9d250, 0xf56a6b66), - TOBN(0x58fc0f5e, 0xb24fe1dc), TOBN(0x9eaf9dee, 0x6b73f24c), - TOBN(0xa90d588b, 0x33650705), TOBN(0xde5b62c5, 0xaf2ec729), - TOBN(0x5c72cfae, 0xd3c2b36e), TOBN(0x868c19d5, 0x034435da), - TOBN(0x88605f93, 0xe17ee145), TOBN(0xaa60c4ee, 0x77a5d5b1), - TOBN(0xbcf5bfd2, 0x3b60c472), TOBN(0xaf4ef13c, 0xeb1d3049), - TOBN(0x373f44fc, 0xe13895c9), TOBN(0xf29b382f, 0x0cbc9822), - TOBN(0x1bfcb853, 0x73efaef6), TOBN(0xcf56ac9c, 0xa8c96f40), - TOBN(0xd7adf109, 0x7a191e24), TOBN(0x98035f44, 0xbf8a8dc2), - TOBN(0xf40a71b9, 0x1e750c84), TOBN(0xc57f7b0c, 0x5dc6c469), - TOBN(0x49a0e79c, 0x6fbc19c1), TOBN(0x6b0f5889, 0xa48ebdb8), - TOBN(0x5d3fd084, 0xa07c4e9f), TOBN(0xc3830111, 0xab27de14), - TOBN(0x0e4929fe, 0x33e08dcc), TOBN(0xf4a5ad24, 0x40bb73a3), - TOBN(0xde86c2bf, 0x490f97ca), TOBN(0x288f09c6, 0x67a1ce18), - TOBN(0x364bb886, 0x1844478d), TOBN(0x7840fa42, 0xceedb040), - TOBN(0x1269fdd2, 0x5a631b37), TOBN(0x94761f1e, 0xa47c8b7d), - TOBN(0xfc0c2e17, 0x481c6266), TOBN(0x85e16ea2, 0x3daa5fa7), - TOBN(0xccd86033, 0x92491048), TOBN(0x0c2f6963, 0xf4d402d7), - TOBN(0x6336f7df, 0xdf6a865c), TOBN(0x0a2a463c, 0xb5c02a87), - TOBN(0xb0e29be7, 0xbf2f12ee), TOBN(0xf0a22002, 0x66bad988), - TOBN(0x27f87e03, 0x9123c1d7), TOBN(0x21669c55, 0x328a8c98), - TOBN(0x186b9803, 0x92f14529), TOBN(0xd3d056cc, 0x63954df3), - TOBN(0x2f03fd58, 0x175a46f6), TOBN(0x63e34ebe, 0x11558558), - TOBN(0xe13fedee, 0x5b80cfa5), TOBN(0xe872a120, 0xd401dbd1), - TOBN(0x52657616, 0xe8a9d667), TOBN(0xbc8da4b6, 0xe08d6693), - TOBN(0x370fb9bb, 0x1b703e75), TOBN(0x6773b186, 0xd4338363), - TOBN(0x18dad378, 0xecef7bff), TOBN(0xaac787ed, 0x995677da), - TOBN(0x4801ea8b, 0x0437164b), TOBN(0xf430ad20, 0x73fe795e), - TOBN(0xb164154d, 0x8ee5eb73), TOBN(0x0884ecd8, 0x108f7c0e), - TOBN(0x0e6ec096, 0x5f520698), TOBN(0x640631fe, 0x44f7b8d9), - TOBN(0x92fd34fc, 0xa35a68b9), TOBN(0x9c5a4b66, 0x4d40cf4e), - TOBN(0x949454bf, 0x80b6783d), TOBN(0x80e701fe, 0x3a320a10), - TOBN(0x8d1a564a, 0x1a0a39b2), TOBN(0x1436d53d, 0x320587db), - TOBN(0xf5096e6d, 0x6556c362), TOBN(0xbc23a3c0, 0xe2455d7e), - TOBN(0x3a7aee54, 0x807230f9), TOBN(0x9ba1cfa6, 0x22ae82fd), - TOBN(0x833a057a, 0x99c5d706), TOBN(0x8be85f4b, 0x842315c9), - TOBN(0xd083179a, 0x66a72f12), TOBN(0x2fc77d5d, 0xcdcc73cd), - TOBN(0x22b88a80, 0x5616ee30), TOBN(0xfb09548f, 0xe7ab1083), - TOBN(0x8ad6ab0d, 0x511270cd), TOBN(0x61f6c57a, 0x6924d9ab), - TOBN(0xa0f7bf72, 0x90aecb08), TOBN(0x849f87c9, 0x0df784a4), - TOBN(0x27c79c15, 0xcfaf1d03), TOBN(0xbbf9f675, 0xc463face), - TOBN(0x91502c65, 0x765ba543), TOBN(0x18ce3cac, 0x42ea60dd), - TOBN(0xe5cee6ac, 0x6e43ecb3), TOBN(0x63e4e910, 0x68f2aeeb), - TOBN(0x26234fa3, 0xc85932ee), TOBN(0x96883e8b, 0x4c90c44d), - TOBN(0x29b9e738, 0xa18a50f6), TOBN(0xbfc62b2a, 0x3f0420df), - TOBN(0xd22a7d90, 0x6d3e1fa9), TOBN(0x17115618, 0xfe05b8a3), - TOBN(0x2a0c9926, 0xbb2b9c01), TOBN(0xc739fcc6, 0xe07e76a2), - TOBN(0x540e9157, 0x165e439a), TOBN(0x06353a62, 0x6a9063d8), - TOBN(0x84d95594, 0x61e927a3), TOBN(0x013b9b26, 0xe2e0be7f), - TOBN(0x4feaec3b, 0x973497f1), TOBN(0x15c0f94e, 0x093ebc2d), - TOBN(0x6af5f227, 0x33af0583), TOBN(0x0c2af206, 0xc61f3340), - TOBN(0xd25dbdf1, 0x4457397c), TOBN(0x2e8ed017, 0xcabcbae0), - TOBN(0xe3010938, 0xc2815306), TOBN(0xbaa99337, 0xe8c6cd68), - TOBN(0x08513182, 0x3b0ec7de), TOBN(0x1e1b822b, 0x58df05df), - TOBN(0x5c14842f, 0xa5c3b683), TOBN(0x98fe977e, 0x3eba34ce), - TOBN(0xfd2316c2, 0x0d5e8873), TOBN(0xe48d839a, 0xbd0d427d), - TOBN(0x495b2218, 0x623fc961), TOBN(0x24ee56e7, 0xb46fba5e), - TOBN(0x9184a55b, 0x91e4de58), TOBN(0xa7488ca5, 0xdfdea288), - TOBN(0xa723862e, 0xa8dcc943), TOBN(0x92d762b2, 0x849dc0fc), - TOBN(0x3c444a12, 0x091ff4a9), TOBN(0x581113fa, 0x0cada274), - TOBN(0xb9de0a45, 0x30d8eae2), TOBN(0x5e0fcd85, 0xdf6b41ea), - TOBN(0x6233ea68, 0xc094dbb5), TOBN(0xb77d062e, 0xd968d410), - TOBN(0x3e719bbc, 0x58b3002d), TOBN(0x68e7dd3d, 0x3dc49d58), - TOBN(0x8d825740, 0x013a5e58), TOBN(0x21311747, 0x3c9e3c1b), - TOBN(0x0cb0a2a7, 0x7c99b6ab), TOBN(0x5c48a3b3, 0xc2f888f2)}, - {TOBN(0xc7913e91, 0x991724f3), TOBN(0x5eda799c, 0x39cbd686), - TOBN(0xddb595c7, 0x63d4fc1e), TOBN(0x6b63b80b, 0xac4fed54), - TOBN(0x6ea0fc69, 0x7e5fb516), TOBN(0x737708ba, 0xd0f1c964), - TOBN(0x9628745f, 0x11a92ca5), TOBN(0x61f37958, 0x9a86967a), - TOBN(0x9af39b2c, 0xaa665072), TOBN(0x78322fa4, 0xefd324ef), - TOBN(0x3d153394, 0xc327bd31), TOBN(0x81d5f271, 0x3129dab0), - TOBN(0xc72e0c42, 0xf48027f5), TOBN(0xaa40cdbc, 0x8536e717), - TOBN(0xf45a657a, 0x2d369d0f), TOBN(0xb03bbfc4, 0xea7f74e6), - TOBN(0x46a8c418, 0x0d738ded), TOBN(0x6f1a5bb0, 0xe0de5729), - TOBN(0xf10230b9, 0x8ba81675), TOBN(0x32c6f30c, 0x112b33d4), - TOBN(0x7559129d, 0xd8fffb62), TOBN(0x6a281b47, 0xb459bf05), - TOBN(0x77c1bd3a, 0xfa3b6776), TOBN(0x0709b380, 0x7829973a), - TOBN(0x8c26b232, 0xa3326505), TOBN(0x38d69272, 0xee1d41bf), - TOBN(0x0459453e, 0xffe32afa), TOBN(0xce8143ad, 0x7cb3ea87), - TOBN(0x932ec1fa, 0x7e6ab666), TOBN(0x6cd2d230, 0x22286264), - TOBN(0x459a46fe, 0x6736f8ed), TOBN(0x50bf0d00, 0x9eca85bb), - TOBN(0x0b825852, 0x877a21ec), TOBN(0x300414a7, 0x0f537a94), - TOBN(0x3f1cba40, 0x21a9a6a2), TOBN(0x50824eee, 0x76943c00), - TOBN(0xa0dbfcec, 0xf83cba5d), TOBN(0xf9538148, 0x93b4f3c0), - TOBN(0x61744162, 0x48f24dd7), TOBN(0x5322d64d, 0xe4fb09dd), - TOBN(0x57447384, 0x3d9325f3), TOBN(0xa9bef2d0, 0xf371cb84), - TOBN(0x77d2188b, 0xa61e36c5), TOBN(0xbbd6a7d7, 0xc602df72), - TOBN(0xba3aa902, 0x8f61bc0b), TOBN(0xf49085ed, 0x6ed0b6a1), - TOBN(0x8bc625d6, 0xae6e8298), TOBN(0x832b0b1d, 0xa2e9c01d), - TOBN(0xa337c447, 0xf1f0ced1), TOBN(0x800cc793, 0x9492dd2b), - TOBN(0x4b93151d, 0xbea08efa), TOBN(0x820cf3f8, 0xde0a741e), - TOBN(0xff1982dc, 0x1c0f7d13), TOBN(0xef921960, 0x84dde6ca), - TOBN(0x1ad7d972, 0x45f96ee3), TOBN(0x319c8dbe, 0x29dea0c7), - TOBN(0xd3ea3871, 0x7b82b99b), TOBN(0x75922d4d, 0x470eb624), - TOBN(0x8f66ec54, 0x3b95d466), TOBN(0x66e673cc, 0xbee1e346), - TOBN(0x6afe67c4, 0xb5f2b89a), TOBN(0x3de9c1e6, 0x290e5cd3), - TOBN(0x8c278bb6, 0x310a2ada), TOBN(0x420fa384, 0x0bdb323b), - TOBN(0x0ae1d63b, 0x0eb919b0), TOBN(0xd74ee51d, 0xa74b9620), - TOBN(0x395458d0, 0xa674290c), TOBN(0x324c930f, 0x4620a510), - TOBN(0x2d1f4d19, 0xfbac27d4), TOBN(0x4086e8ca, 0x9bedeeac), - TOBN(0x0cdd211b, 0x9b679ab8), TOBN(0x5970167d, 0x7090fec4), - TOBN(0x3420f2c9, 0xfaf1fc63), TOBN(0x616d333a, 0x328c8bb4), - TOBN(0x7d65364c, 0x57f1fe4a), TOBN(0x9343e877, 0x55e5c73a), - TOBN(0x5795176b, 0xe970e78c), TOBN(0xa36ccebf, 0x60533627), - TOBN(0xfc7c7380, 0x09cdfc1b), TOBN(0xb39a2afe, 0xb3fec326), - TOBN(0xb7ff1ba1, 0x6224408a), TOBN(0xcc856e92, 0x247cfc5e), - TOBN(0x01f102e7, 0xc18bc493), TOBN(0x4613ab74, 0x2091c727), - TOBN(0xaa25e89c, 0xc420bf2b), TOBN(0x00a53176, 0x90337ec2), - TOBN(0xd2be9f43, 0x7d025fc7), TOBN(0x3316fb85, 0x6e6fe3dc), - TOBN(0x27520af5, 0x9ac50814), TOBN(0xfdf95e78, 0x9a8e4223), - TOBN(0xb7e7df2a, 0x56bec5a0), TOBN(0xf7022f7d, 0xdf159e5d), - TOBN(0x93eeeab1, 0xcac1fe8f), TOBN(0x8040188c, 0x37451168), - TOBN(0x7ee8aa8a, 0xd967dce6), TOBN(0xfa0e79e7, 0x3abc9299), - TOBN(0x67332cfc, 0x2064cfd1), TOBN(0x339c31de, 0xb0651934), - TOBN(0x719b28d5, 0x2a3bcbea), TOBN(0xee74c82b, 0x9d6ae5c6), - TOBN(0x0927d05e, 0xbaf28ee6), TOBN(0x82cecf2c, 0x9d719028), - TOBN(0x0b0d353e, 0xddb30289), TOBN(0xfe4bb977, 0xfddb2e29), - TOBN(0xbb5bb990, 0x640bfd9e), TOBN(0xd226e277, 0x82f62108), - TOBN(0x4bf00985, 0x02ffdd56), TOBN(0x7756758a, 0x2ca1b1b5), - TOBN(0xc32b62a3, 0x5285fe91), TOBN(0xedbc546a, 0x8c9cd140), - TOBN(0x1e47a013, 0xaf5cb008), TOBN(0xbca7e720, 0x073ce8f2), - TOBN(0xe10b2ab8, 0x17a91cae), TOBN(0xb89aab65, 0x08e27f63), - TOBN(0x7b3074a7, 0xdba3ddf9), TOBN(0x1c20ce09, 0x330c2972), - TOBN(0x6b9917b4, 0x5fcf7e33), TOBN(0xe6793743, 0x945ceb42), - TOBN(0x18fc2215, 0x5c633d19), TOBN(0xad1adb3c, 0xc7485474), - TOBN(0x646f9679, 0x6424c49b), TOBN(0xf888dfe8, 0x67c241c9), - TOBN(0xe12d4b93, 0x24f68b49), TOBN(0x9a6b62d8, 0xa571df20), - TOBN(0x81b4b26d, 0x179483cb), TOBN(0x666f9632, 0x9511fae2), - TOBN(0xd281b3e4, 0xd53aa51f), TOBN(0x7f96a765, 0x7f3dbd16), - TOBN(0xa7f8b5bf, 0x074a30ce), TOBN(0xd7f52107, 0x005a32e6), - TOBN(0x6f9e0907, 0x50237ed4), TOBN(0x2f21da47, 0x8096fa2b), - TOBN(0xf3e19cb4, 0xeec863a0), TOBN(0xd18f77fd, 0x9527620a), - TOBN(0x9505c81c, 0x407c1cf8), TOBN(0x9998db4e, 0x1b6ec284), - TOBN(0x7e3389e5, 0xc247d44d), TOBN(0x12507141, 0x3f4f3d80), - TOBN(0xd4ba0110, 0x4a78a6c7), TOBN(0x312874a0, 0x767720be), - TOBN(0xded059a6, 0x75944370), TOBN(0xd6123d90, 0x3b2c0bdd), - TOBN(0xa56b717b, 0x51c108e3), TOBN(0x9bb7940e, 0x070623e9), - TOBN(0x794e2d59, 0x84ac066c), TOBN(0xf5954a92, 0xe68c69a0), - TOBN(0x28c52458, 0x4fd99dcc), TOBN(0x60e639fc, 0xb1012517), - TOBN(0xc2e60125, 0x7de79248), TOBN(0xe9ef6404, 0xf12fc6d7), - TOBN(0x4c4f2808, 0x2a3b5d32), TOBN(0x865ad32e, 0xc768eb8a), - TOBN(0xac02331b, 0x13fb70b6), TOBN(0x037b44c1, 0x95599b27), - TOBN(0x1a860fc4, 0x60bd082c), TOBN(0xa2e25745, 0xc980cd01), - TOBN(0xee3387a8, 0x1da0263e), TOBN(0x931bfb95, 0x2d10f3d6), - TOBN(0x5b687270, 0xa1f24a32), TOBN(0xf140e65d, 0xca494b86), - TOBN(0x4f4ddf91, 0xb2f1ac7a), TOBN(0xf99eaabb, 0x760fee27), - TOBN(0x57f4008a, 0x49c228e5), TOBN(0x090be440, 0x1cf713bb), - TOBN(0xac91fbe4, 0x5004f022), TOBN(0xd838c2c2, 0x569e1af6), - TOBN(0xd6c7d20b, 0x0f1daaa5), TOBN(0xaa063ac1, 0x1bbb02c0), - TOBN(0x0938a422, 0x59558a78), TOBN(0x5343c669, 0x8435da2f), - TOBN(0x96f67b18, 0x034410dc), TOBN(0x7cc1e424, 0x84510804), - TOBN(0x86a1543f, 0x16dfbb7d), TOBN(0x921fa942, 0x5b5bd592), - TOBN(0x9dcccb6e, 0xb33dd03c), TOBN(0x8581ddd9, 0xb843f51e), - TOBN(0x54935fcb, 0x81d73c9e), TOBN(0x6d07e979, 0x0a5e97ab), - TOBN(0x4dc7b30a, 0xcf3a6bab), TOBN(0x147ab1f3, 0x170bee11), - TOBN(0x0aaf8e3d, 0x9fafdee4), TOBN(0xfab3dbcb, 0x538a8b95), - TOBN(0x405df4b3, 0x6ef13871), TOBN(0xf1f4e9cb, 0x088d5a49), - TOBN(0x9bcd24d3, 0x66b33f1d), TOBN(0x3b97b820, 0x5ce445c0), - TOBN(0xe2926549, 0xba93ff61), TOBN(0xd9c341ce, 0x4dafe616), - TOBN(0xfb30a76e, 0x16efb6f3), TOBN(0xdf24b8ca, 0x605b953c), - TOBN(0x8bd52afe, 0xc2fffb9f), TOBN(0xbbac5ff7, 0xe19d0b96), - TOBN(0x43c01b87, 0x459afccd), TOBN(0x6bd45143, 0xb7432652), - TOBN(0x84734530, 0x55b5d78e), TOBN(0x81088fdb, 0x1554ba7d), - TOBN(0xada0a52c, 0x1e269375), TOBN(0xf9f037c4, 0x2dc5ec10), - TOBN(0xc0660607, 0x94bfbc11), TOBN(0xc0a630bb, 0xc9c40d2f), - TOBN(0x5efc797e, 0xab64c31e), TOBN(0xffdb1dab, 0x74507144), - TOBN(0xf6124287, 0x1ca6790c), TOBN(0xe9609d81, 0xe69bf1bf), - TOBN(0xdb898595, 0x00d24fc9), TOBN(0x9c750333, 0xe51fb417), - TOBN(0x51830a91, 0xfef7bbde), TOBN(0x0ce67dc8, 0x945f585c), - TOBN(0x9a730ed4, 0x4763eb50), TOBN(0x24a0e221, 0xc1ab0d66), - TOBN(0x643b6393, 0x648748f3), TOBN(0x1982daa1, 0x6d3c6291), - TOBN(0x6f00a9f7, 0x8bbc5549), TOBN(0x7a1783e1, 0x7f36384e), - TOBN(0xe8346323, 0xde977f50), TOBN(0x91ab688d, 0xb245502a), - TOBN(0x331ab6b5, 0x6d0bdd66), TOBN(0x0a6ef32e, 0x64b71229), - TOBN(0x1028150e, 0xfe7c352f), TOBN(0x27e04350, 0xce7b39d3), - TOBN(0x2a3c8acd, 0xc1070c82), TOBN(0xfb2034d3, 0x80c9feef), - TOBN(0x2d729621, 0x709f3729), TOBN(0x8df290bf, 0x62cb4549), - TOBN(0x02f99f33, 0xfc2e4326), TOBN(0x3b30076d, 0x5eddf032), - TOBN(0xbb21f8cf, 0x0c652fb5), TOBN(0x314fb49e, 0xed91cf7b), - TOBN(0xa013eca5, 0x2f700750), TOBN(0x2b9e3c23, 0x712a4575), - TOBN(0xe5355557, 0xaf30fbb0), TOBN(0x1ada3516, 0x7c77e771), - TOBN(0x45f6ecb2, 0x7b135670), TOBN(0xe85d19df, 0x7cfc202e), - TOBN(0x0f1b50c7, 0x58d1be9f), TOBN(0x5ebf2c0a, 0xead2e344), - TOBN(0x1531fe4e, 0xabc199c9), TOBN(0xc7032592, 0x56bab0ae), - TOBN(0x16ab2e48, 0x6c1fec54), TOBN(0x0f87fda8, 0x04280188), - TOBN(0xdc9f46fc, 0x609e4a74), TOBN(0x2a44a143, 0xba667f91), - TOBN(0xbc3d8b95, 0xb4d83436), TOBN(0xa01e4bd0, 0xc7bd2958), - TOBN(0x7b182932, 0x73483c90), TOBN(0xa79c6aa1, 0xa7c7b598), - TOBN(0xbf3983c6, 0xeaaac07e), TOBN(0x8f18181e, 0x96e0d4e6), - TOBN(0x8553d37c, 0x051af62b), TOBN(0xe9a998eb, 0x0bf94496), - TOBN(0xe0844f9f, 0xb0d59aa1), TOBN(0x983fd558, 0xe6afb813), - TOBN(0x9670c0ca, 0x65d69804), TOBN(0x732b22de, 0x6ea5ff2d), - TOBN(0xd7640ba9, 0x5fd8623b), TOBN(0x9f619163, 0xa6351782), - TOBN(0x0bfc27ee, 0xacee5043), TOBN(0xae419e73, 0x2eb10f02), - TOBN(0x19c028d1, 0x8943fb05), TOBN(0x71f01cf7, 0xff13aa2a), - TOBN(0x7790737e, 0x8887a132), TOBN(0x67513309, 0x66318410), - TOBN(0x9819e8a3, 0x7ddb795e), TOBN(0xfecb8ef5, 0xdad100b2), - TOBN(0x59f74a22, 0x3021926a), TOBN(0xb7c28a49, 0x6f9b4c1c), - TOBN(0xed1a733f, 0x912ad0ab), TOBN(0x42a910af, 0x01a5659c), - TOBN(0x3842c6e0, 0x7bd68cab), TOBN(0x2b57fa38, 0x76d70ac8), - TOBN(0x8a6707a8, 0x3c53aaeb), TOBN(0x62c1c510, 0x65b4db18), - TOBN(0x8de2c1fb, 0xb2d09dc7), TOBN(0xc3dfed12, 0x266bd23b), - TOBN(0x927d039b, 0xd5b27db6), TOBN(0x2fb2f0f1, 0x103243da), - TOBN(0xf855a07b, 0x80be7399), TOBN(0xed9327ce, 0x1f9f27a8), - TOBN(0xa0bd99c7, 0x729bdef7), TOBN(0x2b67125e, 0x28250d88), - TOBN(0x784b26e8, 0x8670ced7), TOBN(0xe3dfe41f, 0xc31bd3b4), - TOBN(0x9e353a06, 0xbcc85cbc), TOBN(0x302e2909, 0x60178a9d), - TOBN(0x860abf11, 0xa6eac16e), TOBN(0x76447000, 0xaa2b3aac), - TOBN(0x46ff9d19, 0x850afdab), TOBN(0x35bdd6a5, 0xfdb2d4c1), - TOBN(0xe82594b0, 0x7e5c9ce9), TOBN(0x0f379e53, 0x20af346e), - TOBN(0x608b31e3, 0xbc65ad4a), TOBN(0x710c6b12, 0x267c4826), - TOBN(0x51c966f9, 0x71954cf1), TOBN(0xb1cec793, 0x0d0aa215), - TOBN(0x1f155989, 0x86bd23a8), TOBN(0xae2ff99c, 0xf9452e86), - TOBN(0xd8dd953c, 0x340ceaa2), TOBN(0x26355275, 0x2e2e9333), - TOBN(0x15d4e5f9, 0x8586f06d), TOBN(0xd6bf94a8, 0xf7cab546), - TOBN(0x33c59a0a, 0xb76a9af0), TOBN(0x52740ab3, 0xba095af7), - TOBN(0xc444de8a, 0x24389ca0), TOBN(0xcc6f9863, 0x706da0cb), - TOBN(0xb5a741a7, 0x6b2515cf), TOBN(0x71c41601, 0x9585c749), - TOBN(0x78350d4f, 0xe683de97), TOBN(0x31d61524, 0x63d0b5f5), - TOBN(0x7a0cc5e1, 0xfbce090b), TOBN(0xaac927ed, 0xfbcb2a5b), - TOBN(0xe920de49, 0x20d84c35), TOBN(0x8c06a0b6, 0x22b4de26), - TOBN(0xd34dd58b, 0xafe7ddf3), TOBN(0x55851fed, 0xc1e6e55b), - TOBN(0xd1395616, 0x960696e7), TOBN(0x940304b2, 0x5f22705f), - TOBN(0x6f43f861, 0xb0a2a860), TOBN(0xcf121282, 0x0e7cc981), - TOBN(0x12186212, 0x0ab64a96), TOBN(0x09215b9a, 0xb789383c), - TOBN(0x311eb305, 0x37387c09), TOBN(0xc5832fce, 0xf03ee760), - TOBN(0x30358f58, 0x32f7ea19), TOBN(0xe01d3c34, 0x91d53551), - TOBN(0x1ca5ee41, 0xda48ea80), TOBN(0x34e71e8e, 0xcf4fa4c1), - TOBN(0x312abd25, 0x7af1e1c7), TOBN(0xe3afcdeb, 0x2153f4a5), - TOBN(0x9d5c84d7, 0x00235e9a), TOBN(0x0308d3f4, 0x8c4c836f), - TOBN(0xc0a66b04, 0x89332de5), TOBN(0x610dd399, 0x89e566ef), - TOBN(0xf8eea460, 0xd1ac1635), TOBN(0x84cbb3fb, 0x20a2c0df), - TOBN(0x40afb488, 0xe74a48c5), TOBN(0x29738198, 0xd326b150), - TOBN(0x2a17747f, 0xa6d74081), TOBN(0x60ea4c05, 0x55a26214), - TOBN(0x53514bb4, 0x1f88c5fe), TOBN(0xedd64567, 0x7e83426c), - TOBN(0xd5d6cbec, 0x96460b25), TOBN(0xa12fd0ce, 0x68dc115e), - TOBN(0xc5bc3ed2, 0x697840ea), TOBN(0x969876a8, 0xa6331e31), - TOBN(0x60c36217, 0x472ff580), TOBN(0xf4229705, 0x4ad41393), - TOBN(0x4bd99ef0, 0xa03b8b92), TOBN(0x501c7317, 0xc144f4f6), - TOBN(0x159009b3, 0x18464945), TOBN(0x6d5e594c, 0x74c5c6be), - TOBN(0x2d587011, 0x321a3660), TOBN(0xd1e184b1, 0x3898d022), - TOBN(0x5ba04752, 0x4c6a7e04), TOBN(0x47fa1e2b, 0x45550b65), - TOBN(0x9419daf0, 0x48c0a9a5), TOBN(0x66362953, 0x7c243236), - TOBN(0xcd0744b1, 0x5cb12a88), TOBN(0x561b6f9a, 0x2b646188), - TOBN(0x599415a5, 0x66c2c0c0), TOBN(0xbe3f0859, 0x0f83f09a), - TOBN(0x9141c5be, 0xb92041b8), TOBN(0x01ae38c7, 0x26477d0d), - TOBN(0xca8b71f3, 0xd12c7a94), TOBN(0xfab5b31f, 0x765c70db), - TOBN(0x76ae7492, 0x487443e9), TOBN(0x8595a310, 0x990d1349), - TOBN(0xf8dbeda8, 0x7d460a37), TOBN(0x7f7ad082, 0x1e45a38f), - TOBN(0xed1d4db6, 0x1059705a), TOBN(0xa3dd492a, 0xe6b9c697), - TOBN(0x4b92ee3a, 0x6eb38bd5), TOBN(0xbab2609d, 0x67cc0bb7), - TOBN(0x7fc4fe89, 0x6e70ee82), TOBN(0xeff2c56e, 0x13e6b7e3), - TOBN(0x9b18959e, 0x34d26fca), TOBN(0x2517ab66, 0x889d6b45), - TOBN(0xf167b4e0, 0xbdefdd4f), TOBN(0x69958465, 0xf366e401), - TOBN(0x5aa368ab, 0xa73bbec0), TOBN(0x12148709, 0x7b240c21), - TOBN(0x378c3233, 0x18969006), TOBN(0xcb4d73ce, 0xe1fe53d1), - TOBN(0x5f50a80e, 0x130c4361), TOBN(0xd67f5951, 0x7ef5212b), - TOBN(0xf145e21e, 0x9e70c72e), TOBN(0xb2e52e29, 0x5566d2fb), - TOBN(0x44eaba4a, 0x032397f5), TOBN(0x5e56937b, 0x7e31a7de), - TOBN(0x68dcf517, 0x456c61e1), TOBN(0xbc2e954a, 0xa8b0a388), - TOBN(0xe3552fa7, 0x60a8b755), TOBN(0x03442dae, 0x73ad0cde), - TOBN(0x37ffe747, 0xceb26210), TOBN(0x983545e8, 0x787baef9), - TOBN(0x8b8c8535, 0x86a3de31), TOBN(0xc621dbcb, 0xfacd46db), - TOBN(0x82e442e9, 0x59266fbb), TOBN(0xa3514c37, 0x339d471c), - TOBN(0x3a11b771, 0x62cdad96), TOBN(0xf0cb3b3c, 0xecf9bdf0), - TOBN(0x3fcbdbce, 0x478e2135), TOBN(0x7547b5cf, 0xbda35342), - TOBN(0xa97e81f1, 0x8a677af6), TOBN(0xc8c2bf83, 0x28817987), - TOBN(0xdf07eaaf, 0x45580985), TOBN(0xc68d1f05, 0xc93b45cb), - TOBN(0x106aa2fe, 0xc77b4cac), TOBN(0x4c1d8afc, 0x04a7ae86), - TOBN(0xdb41c3fd, 0x9eb45ab2), TOBN(0x5b234b5b, 0xd4b22e74), - TOBN(0xda253dec, 0xf215958a), TOBN(0x67e0606e, 0xa04edfa0), - TOBN(0xabbbf070, 0xef751b11), TOBN(0xf352f175, 0xf6f06dce), - TOBN(0xdfc4b6af, 0x6839f6b4), TOBN(0x53ddf9a8, 0x9959848e), - TOBN(0xda49c379, 0xc21520b0), TOBN(0x90864ff0, 0xdbd5d1b6), - TOBN(0x2f055d23, 0x5f49c7f7), TOBN(0xe51e4e6a, 0xa796b2d8), - TOBN(0xc361a67f, 0x5c9dc340), TOBN(0x5ad53c37, 0xbca7c620), - TOBN(0xda1d6588, 0x32c756d0), TOBN(0xad60d911, 0x8bb67e13), - TOBN(0xd6c47bdf, 0x0eeec8c6), TOBN(0x4a27fec1, 0x078a1821), - TOBN(0x081f7415, 0xc3099524), TOBN(0x8effdf0b, 0x82cd8060), - TOBN(0xdb70ec1c, 0x65842df8), TOBN(0x8821b358, 0xd319a901), - TOBN(0x72ee56ee, 0xde42b529), TOBN(0x5bb39592, 0x236e4286), - TOBN(0xd1183316, 0xfd6f7140), TOBN(0xf9fadb5b, 0xbd8e81f7), - TOBN(0x701d5e0c, 0x5a02d962), TOBN(0xfdee4dbf, 0x1b601324), - TOBN(0xbed17407, 0x35d7620e), TOBN(0x04e3c2c3, 0xf48c0012), - TOBN(0x9ee29da7, 0x3455449a), TOBN(0x562cdef4, 0x91a836c4), - TOBN(0x8f682a5f, 0x47701097), TOBN(0x617125d8, 0xff88d0c2), - TOBN(0x948fda24, 0x57bb86dd), TOBN(0x348abb8f, 0x289f7286), - TOBN(0xeb10eab5, 0x99d94bbd), TOBN(0xd51ba28e, 0x4684d160), - TOBN(0xabe0e51c, 0x30c8f41a), TOBN(0x66588b45, 0x13254f4a), - TOBN(0x147ebf01, 0xfad097a5), TOBN(0x49883ea8, 0x610e815d), - TOBN(0xe44d60ba, 0x8a11de56), TOBN(0xa970de6e, 0x827a7a6d), - TOBN(0x2be41424, 0x5e17fc19), TOBN(0xd833c657, 0x01214057), - TOBN(0x1375813b, 0x363e723f), TOBN(0x6820bb88, 0xe6a52e9b), - TOBN(0x7e7f6970, 0xd875d56a), TOBN(0xd6a0a9ac, 0x51fbf6bf), - TOBN(0x54ba8790, 0xa3083c12), TOBN(0xebaeb23d, 0x6ae7eb64), - TOBN(0xa8685c3a, 0xb99a907a), TOBN(0xf1e74550, 0x026bf40b), - TOBN(0x7b73a027, 0xc802cd9e), TOBN(0x9a8a927c, 0x4fef4635), - TOBN(0xe1b6f60c, 0x08191224), TOBN(0xc4126ebb, 0xde4ec091), - TOBN(0xe1dff4dc, 0x4ae38d84), TOBN(0xde3f57db, 0x4f2ef985), - TOBN(0x34964337, 0xd446a1dd), TOBN(0x7bf217a0, 0x859e77f6), - TOBN(0x8ff10527, 0x8e1d13f5), TOBN(0xa304ef03, 0x74eeae27), - TOBN(0xfc6f5e47, 0xd19dfa5a), TOBN(0xdb007de3, 0x7fad982b), - TOBN(0x28205ad1, 0x613715f5), TOBN(0x251e6729, 0x7889529e), - TOBN(0x72705184, 0x1ae98e78), TOBN(0xf818537d, 0x271cac32), - TOBN(0xc8a15b7e, 0xb7f410f5), TOBN(0xc474356f, 0x81f62393), - TOBN(0x92dbdc5a, 0xc242316b), TOBN(0xabe060ac, 0xdbf4aff5), - TOBN(0x6e8c38fe, 0x909a8ec6), TOBN(0x43e514e5, 0x6116cb94), - TOBN(0x2078fa38, 0x07d784f9), TOBN(0x1161a880, 0xf4b5b357), - TOBN(0x5283ce79, 0x13adea3d), TOBN(0x0756c3e6, 0xcc6a910b), - TOBN(0x60bcfe01, 0xaaa79697), TOBN(0x04a73b29, 0x56391db1), - TOBN(0xdd8dad47, 0x189b45a0), TOBN(0xbfac0dd0, 0x48d5b8d9), - TOBN(0x34ab3af5, 0x7d3d2ec2), TOBN(0x6fa2fc2d, 0x207bd3af), - TOBN(0x9ff40092, 0x66550ded), TOBN(0x719b3e87, 0x1fd5b913), - TOBN(0xa573a496, 0x6d17fbc7), TOBN(0x0cd1a70a, 0x73d2b24e), - TOBN(0x34e2c5ca, 0xb2676937), TOBN(0xe7050b06, 0xbf669f21), - TOBN(0xfbe948b6, 0x1ede9046), TOBN(0xa0530051, 0x97662659), - TOBN(0x58cbd4ed, 0xf10124c5), TOBN(0xde2646e4, 0xdd6c06c8), - TOBN(0x332f8108, 0x8cad38c0), TOBN(0x471b7e90, 0x6bd68ae2), - TOBN(0x56ac3fb2, 0x0d8e27a3), TOBN(0xb54660db, 0x136b4b0d), - TOBN(0x123a1e11, 0xa6fd8de4), TOBN(0x44dbffea, 0xa37799ef), - TOBN(0x4540b977, 0xce6ac17c), TOBN(0x495173a8, 0xaf60acef)}, - {TOBN(0x9ebb284d, 0x391c2a82), TOBN(0xbcdd4863, 0x158308e8), - TOBN(0x006f16ec, 0x83f1edca), TOBN(0xa13e2c37, 0x695dc6c8), - TOBN(0x2ab756f0, 0x4a057a87), TOBN(0xa8765500, 0xa6b48f98), - TOBN(0x4252face, 0x68651c44), TOBN(0xa52b540b, 0xe1765e02), - TOBN(0x4f922fc5, 0x16a0d2bb), TOBN(0x0d5cc16c, 0x1a623499), - TOBN(0x9241cf3a, 0x57c62c8b), TOBN(0x2f5e6961, 0xfd1b667f), - TOBN(0x5c15c70b, 0xf5a01797), TOBN(0x3d20b44d, 0x60956192), - TOBN(0x04911b37, 0x071fdb52), TOBN(0xf648f916, 0x8d6f0f7b), - TOBN(0x6dc1acaf, 0xe60b7cf7), TOBN(0x25860a50, 0x84a9d869), - TOBN(0x56fc6f09, 0xe7ba8ac4), TOBN(0x828c5bd0, 0x6148d29e), - TOBN(0xac6b435e, 0xdc55ae5f), TOBN(0xa527f56c, 0xc0117411), - TOBN(0x94d5045e, 0xfd24342c), TOBN(0x2c4c0a35, 0x70b67c0d), - TOBN(0x027cc8b8, 0xfac61d9a), TOBN(0x7d25e062, 0xe3c6fe8a), - TOBN(0xe08805bf, 0xe5bff503), TOBN(0x13271e6c, 0x6ff632f7), - TOBN(0x55dca6c0, 0x232f76a5), TOBN(0x8957c32d, 0x701ef426), - TOBN(0xee728bcb, 0xa10a5178), TOBN(0x5ea60411, 0xb62c5173), - TOBN(0xfc4e964e, 0xd0b8892b), TOBN(0x9ea17683, 0x9301bb74), - TOBN(0x6265c5ae, 0xfcc48626), TOBN(0xe60cf82e, 0xbb3e9102), - TOBN(0x57adf797, 0xd4df5531), TOBN(0x235b59a1, 0x8deeefe2), - TOBN(0x60adcf58, 0x3f306eb1), TOBN(0x105c2753, 0x3d09492d), - TOBN(0x4090914b, 0xb5def996), TOBN(0x1cb69c83, 0x233dd1e7), - TOBN(0xc1e9c1d3, 0x9b3d5e76), TOBN(0x1f3338ed, 0xfccf6012), - TOBN(0xb1e95d0d, 0x2f5378a8), TOBN(0xacf4c2c7, 0x2f00cd21), - TOBN(0x6e984240, 0xeb5fe290), TOBN(0xd66c038d, 0x248088ae), - TOBN(0x804d264a, 0xf94d70cf), TOBN(0xbdb802ef, 0x7314bf7e), - TOBN(0x8fb54de2, 0x4333ed02), TOBN(0x740461e0, 0x285635d9), - TOBN(0x4113b2c8, 0x365e9383), TOBN(0xea762c83, 0x3fdef652), - TOBN(0x4eec6e2e, 0x47b956c1), TOBN(0xa3d814be, 0x65620fa4), - TOBN(0x9ad5462b, 0xb4d8bc50), TOBN(0x181c0b16, 0xa9195770), - TOBN(0xebd4fe1c, 0x78412a68), TOBN(0xae0341bc, 0xc0dff48c), - TOBN(0xb6bc45cf, 0x7003e866), TOBN(0xf11a6dea, 0x8a24a41b), - TOBN(0x5407151a, 0xd04c24c2), TOBN(0x62c9d27d, 0xda5b7b68), - TOBN(0x2e964235, 0x88cceff6), TOBN(0x8594c54f, 0x8b07ed69), - TOBN(0x1578e73c, 0xc84d0d0d), TOBN(0x7b4e1055, 0xff532868), - TOBN(0xa348c0d5, 0xb5ec995a), TOBN(0xbf4b9d55, 0x14289a54), - TOBN(0x9ba155a6, 0x58fbd777), TOBN(0x186ed7a8, 0x1a84491d), - TOBN(0xd4992b30, 0x614c0900), TOBN(0xda98d121, 0xbd00c24b), - TOBN(0x7f534dc8, 0x7ec4bfa1), TOBN(0x4a5ff674, 0x37dc34bc), - TOBN(0x68c196b8, 0x1d7ea1d7), TOBN(0x38cf2893, 0x80a6d208), - TOBN(0xfd56cd09, 0xe3cbbd6e), TOBN(0xec72e27e, 0x4205a5b6), - TOBN(0x15ea68f5, 0xa44f77f7), TOBN(0x7aa5f9fd, 0xb43c52bc), - TOBN(0x86ff676f, 0x94f0e609), TOBN(0xa4cde963, 0x2e2d432b), - TOBN(0x8cafa0c0, 0xeee470af), TOBN(0x84137d0e, 0x8a3f5ec8), - TOBN(0xebb40411, 0xfaa31231), TOBN(0xa239c13f, 0x6f7f7ccf), - TOBN(0x32865719, 0xa8afd30b), TOBN(0x86798328, 0x8a826dce), - TOBN(0xdf04e891, 0xc4a8fbe0), TOBN(0xbb6b6e1b, 0xebf56ad3), - TOBN(0x0a695b11, 0x471f1ff0), TOBN(0xd76c3389, 0xbe15baf0), - TOBN(0x018edb95, 0xbe96c43e), TOBN(0xf2beaaf4, 0x90794158), - TOBN(0x152db09e, 0xc3076a27), TOBN(0x5e82908e, 0xe416545d), - TOBN(0xa2c41272, 0x356d6f2e), TOBN(0xdc9c9642, 0x31fd74e1), - TOBN(0x66ceb88d, 0x519bf615), TOBN(0xe29ecd76, 0x05a2274e), - TOBN(0x3a0473c4, 0xbf5e2fa0), TOBN(0x6b6eb671, 0x64284e67), - TOBN(0xe8b97932, 0xb88756dd), TOBN(0xed4e8652, 0xf17e3e61), - TOBN(0xc2dd1499, 0x3ee1c4a4), TOBN(0xc0aaee17, 0x597f8c0e), - TOBN(0x15c4edb9, 0x6c168af3), TOBN(0x6563c7bf, 0xb39ae875), - TOBN(0xadfadb6f, 0x20adb436), TOBN(0xad55e8c9, 0x9a042ac0), - TOBN(0x975a1ed8, 0xb76da1f5), TOBN(0x10dfa466, 0xa58acb94), - TOBN(0x8dd7f7e3, 0xac060282), TOBN(0x6813e66a, 0x572a051e), - TOBN(0xb4ccae1e, 0x350cb901), TOBN(0xb653d656, 0x50cb7822), - TOBN(0x42484710, 0xdfab3b87), TOBN(0xcd7ee537, 0x9b670fd0), - TOBN(0x0a50b12e, 0x523b8bf6), TOBN(0x8009eb5b, 0x8f910c1b), - TOBN(0xf535af82, 0x4a167588), TOBN(0x0f835f9c, 0xfb2a2abd), - TOBN(0xf59b2931, 0x2afceb62), TOBN(0xc797df2a, 0x169d383f), - TOBN(0xeb3f5fb0, 0x66ac02b0), TOBN(0x029d4c6f, 0xdaa2d0ca), - TOBN(0xd4059bc1, 0xafab4bc5), TOBN(0x833f5c6f, 0x56783247), - TOBN(0xb5346630, 0x8d2d3605), TOBN(0x83387891, 0xd34d8433), - TOBN(0xd973b30f, 0xadd9419a), TOBN(0xbcca1099, 0xafe3fce8), - TOBN(0x08178315, 0x0809aac6), TOBN(0x01b7f21a, 0x540f0f11), - TOBN(0x65c29219, 0x909523c8), TOBN(0xa62f648f, 0xa3a1c741), - TOBN(0x88598d4f, 0x60c9e55a), TOBN(0xbce9141b, 0x0e4f347a), - TOBN(0x9af97d84, 0x35f9b988), TOBN(0x0210da62, 0x320475b6), - TOBN(0x3c076e22, 0x9191476c), TOBN(0x7520dbd9, 0x44fc7834), - TOBN(0x6a6b2cfe, 0xc1ab1bbd), TOBN(0xef8a65be, 0xdc650938), - TOBN(0x72855540, 0x805d7bc4), TOBN(0xda389396, 0xed11fdfd), - TOBN(0xa9d5bd36, 0x74660876), TOBN(0x11d67c54, 0xb45dff35), - TOBN(0x6af7d148, 0xa4f5da94), TOBN(0xbb8d4c3f, 0xc0bbeb31), - TOBN(0x87a7ebd1, 0xe0a1b12a), TOBN(0x1e4ef88d, 0x770ba95f), - TOBN(0x8c33345c, 0xdc2ae9cb), TOBN(0xcecf1276, 0x01cc8403), - TOBN(0x687c012e, 0x1b39b80f), TOBN(0xfd90d0ad, 0x35c33ba4), - TOBN(0xa3ef5a67, 0x5c9661c2), TOBN(0x368fc88e, 0xe017429e), - TOBN(0xd30c6761, 0x196a2fa2), TOBN(0x931b9817, 0xbd5b312e), - TOBN(0xba01000c, 0x72f54a31), TOBN(0xa203d2c8, 0x66eaa541), - TOBN(0xf2abdee0, 0x98939db3), TOBN(0xe37d6c2c, 0x3e606c02), - TOBN(0xf2921574, 0x521ff643), TOBN(0x2781b3c4, 0xd7e2fca3), - TOBN(0x664300b0, 0x7850ec06), TOBN(0xac5a38b9, 0x7d3a10cf), - TOBN(0x9233188d, 0xe34ab39d), TOBN(0xe77057e4, 0x5072cbb9), - TOBN(0xbcf0c042, 0xb59e78df), TOBN(0x4cfc91e8, 0x1d97de52), - TOBN(0x4661a26c, 0x3ee0ca4a), TOBN(0x5620a4c1, 0xfb8507bc), - TOBN(0x4b44d4aa, 0x049f842c), TOBN(0xceabc5d5, 0x1540e82b), - TOBN(0x306710fd, 0x15c6f156), TOBN(0xbe5ae52b, 0x63db1d72), - TOBN(0x06f1e7e6, 0x334957f1), TOBN(0x57e388f0, 0x31144a70), - TOBN(0xfb69bb2f, 0xdf96447b), TOBN(0x0f78ebd3, 0x73e38a12), - TOBN(0xb8222605, 0x2b7ce542), TOBN(0xe6d4ce99, 0x7472bde1), - TOBN(0x53e16ebe, 0x09d2f4da), TOBN(0x180ff42e, 0x53b92b2e), - TOBN(0xc59bcc02, 0x2c34a1c6), TOBN(0x3803d6f9, 0x422c46c2), - TOBN(0x18aff74f, 0x5c14a8a2), TOBN(0x55aebf80, 0x10a08b28), - TOBN(0x66097d58, 0x7135593f), TOBN(0x32e6eff7, 0x2be570cd), - TOBN(0x584e6a10, 0x2a8c860d), TOBN(0xcd185890, 0xa2eb4163), - TOBN(0x7ceae99d, 0x6d97e134), TOBN(0xd42c6b70, 0xdd8447ce), - TOBN(0x59ddbb4a, 0xb8c50273), TOBN(0x03c612df, 0x3cf34e1e), - TOBN(0x84b9ca15, 0x04b6c5a0), TOBN(0x35216f39, 0x18f0e3a3), - TOBN(0x3ec2d2bc, 0xbd986c00), TOBN(0x8bf546d9, 0xd19228fe), - TOBN(0xd1c655a4, 0x4cd623c3), TOBN(0x366ce718, 0x502b8e5a), - TOBN(0x2cfc84b4, 0xeea0bfe7), TOBN(0xe01d5cee, 0xcf443e8e), - TOBN(0x8ec045d9, 0x036520f8), TOBN(0xdfb3c3d1, 0x92d40e98), - TOBN(0x0bac4cce, 0xcc559a04), TOBN(0x35eccae5, 0x240ea6b1), - TOBN(0x180b32db, 0xf8a5a0ac), TOBN(0x547972a5, 0xeb699700), - TOBN(0xa3765801, 0xca26bca0), TOBN(0x57e09d0e, 0xa647f25a), - TOBN(0xb956970e, 0x2fdd23cc), TOBN(0xb80288bc, 0x5682e971), - TOBN(0xe6e6d91e, 0x9ae86ebc), TOBN(0x0564c83f, 0x8c9f1939), - TOBN(0x551932a2, 0x39560368), TOBN(0xe893752b, 0x049c28e2), - TOBN(0x0b03cee5, 0xa6a158c3), TOBN(0xe12d656b, 0x04964263), - TOBN(0x4b47554e, 0x63e3bc1d), TOBN(0xc719b6a2, 0x45044ff7), - TOBN(0x4f24d30a, 0xe48daa07), TOBN(0xa3f37556, 0xc8c1edc3), - TOBN(0x9a47bf76, 0x0700d360), TOBN(0xbb1a1824, 0x822ae4e2), - TOBN(0x22e275a3, 0x89f1fb4c), TOBN(0x72b1aa23, 0x9968c5f5), - TOBN(0xa75feaca, 0xbe063f64), TOBN(0x9b392f43, 0xbce47a09), - TOBN(0xd4241509, 0x1ad07aca), TOBN(0x4b0c591b, 0x8d26cd0f), - TOBN(0x2d42ddfd, 0x92f1169a), TOBN(0x63aeb1ac, 0x4cbf2392), - TOBN(0x1de9e877, 0x0691a2af), TOBN(0xebe79af7, 0xd98021da), - TOBN(0xcfdf2a4e, 0x40e50acf), TOBN(0xf0a98ad7, 0xaf01d665), - TOBN(0xefb640bf, 0x1831be1f), TOBN(0x6fe8bd2f, 0x80e9ada0), - TOBN(0x94c103a1, 0x6cafbc91), TOBN(0x170f8759, 0x8308e08c), - TOBN(0x5de2d2ab, 0x9780ff4f), TOBN(0x666466bc, 0x45b201f2), - TOBN(0x58af2010, 0xf5b343bc), TOBN(0x0f2e400a, 0xf2f142fe), - TOBN(0x3483bfde, 0xa85f4bdf), TOBN(0xf0b1d093, 0x03bfeaa9), - TOBN(0x2ea01b95, 0xc7081603), TOBN(0xe943e4c9, 0x3dba1097), - TOBN(0x47be92ad, 0xb438f3a6), TOBN(0x00bb7742, 0xe5bf6636), - TOBN(0x136b7083, 0x824297b4), TOBN(0x9d0e5580, 0x5584455f), - TOBN(0xab48cedc, 0xf1c7d69e), TOBN(0x53a9e481, 0x2a256e76), - TOBN(0x0402b0e0, 0x65eb2413), TOBN(0xdadbbb84, 0x8fc407a7), - TOBN(0xa65cd5a4, 0x8d7f5492), TOBN(0x21d44293, 0x74bae294), - TOBN(0x66917ce6, 0x3b5f1cc4), TOBN(0x37ae52ea, 0xce872e62), - TOBN(0xbb087b72, 0x2905f244), TOBN(0x12077086, 0x1e6af74f), - TOBN(0x4b644e49, 0x1058edea), TOBN(0x827510e3, 0xb638ca1d), - TOBN(0x8cf2b704, 0x6038591c), TOBN(0xffc8b47a, 0xfe635063), - TOBN(0x3ae220e6, 0x1b4d5e63), TOBN(0xbd864742, 0x9d961b4b), - TOBN(0x610c107e, 0x9bd16bed), TOBN(0x4270352a, 0x1127147b), - TOBN(0x7d17ffe6, 0x64cfc50e), TOBN(0x50dee01a, 0x1e36cb42), - TOBN(0x068a7622, 0x35dc5f9a), TOBN(0x9a08d536, 0xdf53f62c), - TOBN(0x4ed71457, 0x6be5f7de), TOBN(0xd93006f8, 0xc2263c9e), - TOBN(0xe073694c, 0xcacacb36), TOBN(0x2ff7a5b4, 0x3ae118ab), - TOBN(0x3cce53f1, 0xcd871236), TOBN(0xf156a39d, 0xc2aa6d52), - TOBN(0x9cc5f271, 0xb198d76d), TOBN(0xbc615b6f, 0x81383d39), - TOBN(0xa54538e8, 0xde3eee6b), TOBN(0x58c77538, 0xab910d91), - TOBN(0x31e5bdbc, 0x58d278bd), TOBN(0x3cde4adf, 0xb963acae), - TOBN(0xb1881fd2, 0x5302169c), TOBN(0x8ca60fa0, 0xa989ed8b), - TOBN(0xa1999458, 0xff96a0ee), TOBN(0xc1141f03, 0xac6c283d), - TOBN(0x7677408d, 0x6dfafed3), TOBN(0x33a01653, 0x39661588), - TOBN(0x3c9c15ec, 0x0b726fa0), TOBN(0x090cfd93, 0x6c9b56da), - TOBN(0xe34f4bae, 0xa3c40af5), TOBN(0x3469eadb, 0xd21129f1), - TOBN(0xcc51674a, 0x1e207ce8), TOBN(0x1e293b24, 0xc83b1ef9), - TOBN(0x17173d13, 0x1e6c0bb4), TOBN(0x19004695, 0x90776d35), - TOBN(0xe7980e34, 0x6de6f922), TOBN(0x873554cb, 0xf4dd9a22), - TOBN(0x0316c627, 0xcbf18a51), TOBN(0x4d93651b, 0x3032c081), - TOBN(0x207f2771, 0x3946834d), TOBN(0x2c08d7b4, 0x30cdbf80), - TOBN(0x137a4fb4, 0x86df2a61), TOBN(0xa1ed9c07, 0xecf7b4a2), - TOBN(0xb2e460e2, 0x7bd042ff), TOBN(0xb7f5e2fa, 0x5f62f5ec), - TOBN(0x7aa6ec6b, 0xcc2423b7), TOBN(0x75ce0a7f, 0xba63eea7), - TOBN(0x67a45fb1, 0xf250a6e1), TOBN(0x93bc919c, 0xe53cdc9f), - TOBN(0x9271f56f, 0x871942df), TOBN(0x2372ff6f, 0x7859ad66), - TOBN(0x5f4c2b96, 0x33cb1a78), TOBN(0xe3e29101, 0x5838aa83), - TOBN(0xa7ed1611, 0xe4e8110c), TOBN(0x2a2d70d5, 0x330198ce), - TOBN(0xbdf132e8, 0x6720efe0), TOBN(0xe61a8962, 0x66a471bf), - TOBN(0x796d3a85, 0x825808bd), TOBN(0x51dc3cb7, 0x3fd6e902), - TOBN(0x643c768a, 0x916219d1), TOBN(0x36cd7685, 0xa2ad7d32), - TOBN(0xe3db9d05, 0xb22922a4), TOBN(0x6494c87e, 0xdba29660), - TOBN(0xf0ac91df, 0xbcd2ebc7), TOBN(0x4deb57a0, 0x45107f8d), - TOBN(0x42271f59, 0xc3d12a73), TOBN(0x5f71687c, 0xa5c2c51d), - TOBN(0xcb1f50c6, 0x05797bcb), TOBN(0x29ed0ed9, 0xd6d34eb0), - TOBN(0xe5fe5b47, 0x4683c2eb), TOBN(0x4956eeb5, 0x97447c46), - TOBN(0x5b163a43, 0x71207167), TOBN(0x93fa2fed, 0x0248c5ef), - TOBN(0x67930af2, 0x31f63950), TOBN(0xa77797c1, 0x14caa2c9), - TOBN(0x526e80ee, 0x27ac7e62), TOBN(0xe1e6e626, 0x58b28aec), - TOBN(0x636178b0, 0xb3c9fef0), TOBN(0xaf7752e0, 0x6d5f90be), - TOBN(0x94ecaf18, 0xeece51cf), TOBN(0x2864d0ed, 0xca806e1f), - TOBN(0x6de2e383, 0x97c69134), TOBN(0x5a42c316, 0xeb291293), - TOBN(0xc7779219, 0x6a60bae0), TOBN(0xa24de346, 0x6b7599d1), - TOBN(0x49d374aa, 0xb75d4941), TOBN(0x98900586, 0x2d501ff0), - TOBN(0x9f16d40e, 0xeb7974cf), TOBN(0x1033860b, 0xcdd8c115), - TOBN(0xb6c69ac8, 0x2094cec3), TOBN(0x9976fb88, 0x403b770c), - TOBN(0x1dea026c, 0x4859590d), TOBN(0xb6acbb46, 0x8562d1fd), - TOBN(0x7cd6c461, 0x44569d85), TOBN(0xc3190a36, 0x97f0891d), - TOBN(0xc6f53195, 0x48d5a17d), TOBN(0x7d919966, 0xd749abc8), - TOBN(0x65104837, 0xdd1c8a20), TOBN(0x7e5410c8, 0x2f683419), - TOBN(0x958c3ca8, 0xbe94022e), TOBN(0x605c3197, 0x6145dac2), - TOBN(0x3fc07501, 0x01683d54), TOBN(0x1d7127c5, 0x595b1234), - TOBN(0x10b8f87c, 0x9481277f), TOBN(0x677db2a8, 0xe65a1adb), - TOBN(0xec2fccaa, 0xddce3345), TOBN(0x2a6811b7, 0x012a4350), - TOBN(0x96760ff1, 0xac598bdc), TOBN(0x054d652a, 0xd1bf4128), - TOBN(0x0a1151d4, 0x92a21005), TOBN(0xad7f3971, 0x33110fdf), - TOBN(0x8c95928c, 0x1960100f), TOBN(0x6c91c825, 0x7bf03362), - TOBN(0xc8c8b2a2, 0xce309f06), TOBN(0xfdb27b59, 0xca27204b), - TOBN(0xd223eaa5, 0x0848e32e), TOBN(0xb93e4b2e, 0xe7bfaf1e), - TOBN(0xc5308ae6, 0x44aa3ded), TOBN(0x317a666a, 0xc015d573), - TOBN(0xc888ce23, 0x1a979707), TOBN(0xf141c1e6, 0x0d5c4958), - TOBN(0xb53b7de5, 0x61906373), TOBN(0x858dbade, 0xeb999595), - TOBN(0x8cbb47b2, 0xa59e5c36), TOBN(0x660318b3, 0xdcf4e842), - TOBN(0xbd161ccd, 0x12ba4b7a), TOBN(0xf399daab, 0xf8c8282a), - TOBN(0x1587633a, 0xeeb2130d), TOBN(0xa465311a, 0xda38dd7d), - TOBN(0x5f75eec8, 0x64d3779b), TOBN(0x3c5d0476, 0xad64c171), - TOBN(0x87410371, 0x2a914428), TOBN(0x8096a891, 0x90e2fc29), - TOBN(0xd3d2ae9d, 0x23b3ebc2), TOBN(0x90bdd6db, 0xa580cfd6), - TOBN(0x52dbb7f3, 0xc5b01f6c), TOBN(0xe68eded4, 0xe102a2dc), - TOBN(0x17785b77, 0x99eb6df0), TOBN(0x26c3cc51, 0x7386b779), - TOBN(0x345ed988, 0x6417a48e), TOBN(0xe990b4e4, 0x07d6ef31), - TOBN(0x0f456b7e, 0x2586abba), TOBN(0x239ca6a5, 0x59c96e9a), - TOBN(0xe327459c, 0xe2eb4206), TOBN(0x3a4c3313, 0xa002b90a), - TOBN(0x2a114806, 0xf6a3f6fb), TOBN(0xad5cad2f, 0x85c251dd), - TOBN(0x92c1f613, 0xf5a784d3), TOBN(0xec7bfacf, 0x349766d5), - TOBN(0x04b3cd33, 0x3e23cb3b), TOBN(0x3979fe84, 0xc5a64b2d), - TOBN(0x192e2720, 0x7e589106), TOBN(0xa60c43d1, 0xa15b527f), - TOBN(0x2dae9082, 0xbe7cf3a6), TOBN(0xcc86ba92, 0xbc967274), - TOBN(0xf28a2ce8, 0xaea0a8a9), TOBN(0x404ca6d9, 0x6ee988b3), - TOBN(0xfd7e9c5d, 0x005921b8), TOBN(0xf56297f1, 0x44e79bf9), - TOBN(0xa163b460, 0x0d75ddc2), TOBN(0x30b23616, 0xa1f2be87), - TOBN(0x4b070d21, 0xbfe50e2b), TOBN(0x7ef8cfd0, 0xe1bfede1), - TOBN(0xadba0011, 0x2aac4ae0), TOBN(0x2a3e7d01, 0xb9ebd033), - TOBN(0x995277ec, 0xe38d9d1c), TOBN(0xb500249e, 0x9c5d2de3), - TOBN(0x8912b820, 0xf13ca8c9), TOBN(0xc8798114, 0x877793af), - TOBN(0x19e6125d, 0xec3f1dec), TOBN(0x07b1f040, 0x911178da), - TOBN(0xd93ededa, 0x904a6738), TOBN(0x55187a5a, 0x0bebedcd), - TOBN(0xf7d04722, 0xeb329d41), TOBN(0xf449099e, 0xf170b391), - TOBN(0xfd317a69, 0xca99f828), TOBN(0x50c3db2b, 0x34a4976d), - TOBN(0xe9ba7784, 0x3757b392), TOBN(0x326caefd, 0xaa3ca05a), - TOBN(0x78e5293b, 0xf1e593d4), TOBN(0x7842a937, 0x0d98fd13), - TOBN(0xe694bf96, 0x5f96b10d), TOBN(0x373a9df6, 0x06a8cd05), - TOBN(0x997d1e51, 0xe8f0c7fc), TOBN(0x1d019790, 0x63fd972e), - TOBN(0x0064d858, 0x5499fb32), TOBN(0x7b67bad9, 0x77a8aeb7), - TOBN(0x1d3eb977, 0x2d08eec5), TOBN(0x5fc047a6, 0xcbabae1d), - TOBN(0x0577d159, 0xe54a64bb), TOBN(0x8862201b, 0xc43497e4), - TOBN(0xad6b4e28, 0x2ce0608d), TOBN(0x8b687b7d, 0x0b167aac), - TOBN(0x6ed4d367, 0x8b2ecfa9), TOBN(0x24dfe62d, 0xa90c3c38), - TOBN(0xa1862e10, 0x3fe5c42b), TOBN(0x1ca73dca, 0xd5732a9f), - TOBN(0x35f038b7, 0x76bb87ad), TOBN(0x674976ab, 0xf242b81f), - TOBN(0x4f2bde7e, 0xb0fd90cd), TOBN(0x6efc172e, 0xa7fdf092), - TOBN(0x3806b69b, 0x92222f1f), TOBN(0x5a2459ca, 0x6cf7ae70), - TOBN(0x6789f69c, 0xa85217ee), TOBN(0x5f232b5e, 0xe3dc85ac), - TOBN(0x660e3ec5, 0x48e9e516), TOBN(0x124b4e47, 0x3197eb31), - TOBN(0x10a0cb13, 0xaafcca23), TOBN(0x7bd63ba4, 0x8213224f), - TOBN(0xaffad7cc, 0x290a7f4f), TOBN(0x6b409c9e, 0x0286b461), - TOBN(0x58ab809f, 0xffa407af), TOBN(0xc3122eed, 0xc68ac073), - TOBN(0x17bf9e50, 0x4ef24d7e), TOBN(0x5d929794, 0x3e2a5811), - TOBN(0x519bc867, 0x02902e01), TOBN(0x76bba5da, 0x39c8a851), - TOBN(0xe9f9669c, 0xda94951e), TOBN(0x4b6af58d, 0x66b8d418), - TOBN(0xfa321074, 0x17d426a4), TOBN(0xc78e66a9, 0x9dde6027), - TOBN(0x0516c083, 0x4a53b964), TOBN(0xfc659d38, 0xff602330), - TOBN(0x0ab55e5c, 0x58c5c897), TOBN(0x985099b2, 0x838bc5df), - TOBN(0x061d9efc, 0xc52fc238), TOBN(0x712b2728, 0x6ac1da3f), - TOBN(0xfb658149, 0x9283fe08), TOBN(0x4954ac94, 0xb8aaa2f7), - TOBN(0x85c0ada4, 0x7fb2e74f), TOBN(0xee8ba98e, 0xb89926b0), - TOBN(0xe4f9d37d, 0x23d1af5b), TOBN(0x14ccdbf9, 0xba9b015e), - TOBN(0xb674481b, 0x7bfe7178), TOBN(0x4e1debae, 0x65405868), - TOBN(0x061b2821, 0xc48c867d), TOBN(0x69c15b35, 0x513b30ea), - TOBN(0x3b4a1666, 0x36871088), TOBN(0xe5e29f5d, 0x1220b1ff), - TOBN(0x4b82bb35, 0x233d9f4d), TOBN(0x4e076333, 0x18cdc675)}, - {TOBN(0x0d53f5c7, 0xa3e6fced), TOBN(0xe8cbbdd5, 0xf45fbdeb), - TOBN(0xf85c01df, 0x13339a70), TOBN(0x0ff71880, 0x142ceb81), - TOBN(0x4c4e8774, 0xbd70437a), TOBN(0x5fb32891, 0xba0bda6a), - TOBN(0x1cdbebd2, 0xf18bd26e), TOBN(0x2f9526f1, 0x03a9d522), - TOBN(0x40ce3051, 0x92c4d684), TOBN(0x8b04d725, 0x7612efcd), - TOBN(0xb9dcda36, 0x6f9cae20), TOBN(0x0edc4d24, 0xf058856c), - TOBN(0x64f2e6bf, 0x85427900), TOBN(0x3de81295, 0xdc09dfea), - TOBN(0xd41b4487, 0x379bf26c), TOBN(0x50b62c6d, 0x6df135a9), - TOBN(0xd4f8e3b4, 0xc72dfe67), TOBN(0xc416b0f6, 0x90e19fdf), - TOBN(0x18b9098d, 0x4c13bd35), TOBN(0xac11118a, 0x15b8cb9e), - TOBN(0xf598a318, 0xf0062841), TOBN(0xbfe0602f, 0x89f356f4), - TOBN(0x7ae3637e, 0x30177a0c), TOBN(0x34097747, 0x61136537), - TOBN(0x0db2fb5e, 0xd005832a), TOBN(0x5f5efd3b, 0x91042e4f), - TOBN(0x8c4ffdc6, 0xed70f8ca), TOBN(0xe4645d0b, 0xb52da9cc), - TOBN(0x9596f58b, 0xc9001d1f), TOBN(0x52c8f0bc, 0x4e117205), - TOBN(0xfd4aa0d2, 0xe398a084), TOBN(0x815bfe3a, 0x104f49de), - TOBN(0x97e5443f, 0x23885e5f), TOBN(0xf72f8f99, 0xe8433aab), - TOBN(0xbd00b154, 0xe4d4e604), TOBN(0xd0b35e6a, 0xe5e173ff), - TOBN(0x57b2a048, 0x9164722d), TOBN(0x3e3c665b, 0x88761ec8), - TOBN(0x6bdd1397, 0x3da83832), TOBN(0x3c8b1a1e, 0x73dafe3b), - TOBN(0x4497ace6, 0x54317cac), TOBN(0xbe600ab9, 0x521771b3), - TOBN(0xb42e409e, 0xb0dfe8b8), TOBN(0x386a67d7, 0x3942310f), - TOBN(0x25548d8d, 0x4431cc28), TOBN(0xa7cff142, 0x985dc524), - TOBN(0x4d60f5a1, 0x93c4be32), TOBN(0x83ebd5c8, 0xd071c6e1), - TOBN(0xba3a80a7, 0xb1fd2b0b), TOBN(0x9b3ad396, 0x5bec33e8), - TOBN(0xb3868d61, 0x79743fb3), TOBN(0xcfd169fc, 0xfdb462fa), - TOBN(0xd3b499d7, 0x9ce0a6af), TOBN(0x55dc1cf1, 0xe42d3ff8), - TOBN(0x04fb9e6c, 0xc6c3e1b2), TOBN(0x47e6961d, 0x6f69a474), - TOBN(0x54eb3acc, 0xe548b37b), TOBN(0xb38e7542, 0x84d40549), - TOBN(0x8c3daa51, 0x7b341b4f), TOBN(0x2f6928ec, 0x690bf7fa), - TOBN(0x0496b323, 0x86ce6c41), TOBN(0x01be1c55, 0x10adadcd), - TOBN(0xc04e67e7, 0x4bb5faf9), TOBN(0x3cbaf678, 0xe15c9985), - TOBN(0x8cd12145, 0x50ca4247), TOBN(0xba1aa47a, 0xe7dd30aa), - TOBN(0x2f81ddf1, 0xe58fee24), TOBN(0x03452936, 0xeec9b0e8), - TOBN(0x8bdc3b81, 0x243aea96), TOBN(0x9a2919af, 0x15c3d0e5), - TOBN(0x9ea640ec, 0x10948361), TOBN(0x5ac86d5b, 0x6e0bcccf), - TOBN(0xf892d918, 0xc36cf440), TOBN(0xaed3e837, 0xc939719c), - TOBN(0xb07b08d2, 0xc0218b64), TOBN(0x6f1bcbba, 0xce9790dd), - TOBN(0x4a84d6ed, 0x60919b8e), TOBN(0xd8900791, 0x8ac1f9eb), - TOBN(0xf84941aa, 0x0dd5daef), TOBN(0xb22fe40a, 0x67fd62c5), - TOBN(0x97e15ba2, 0x157f2db3), TOBN(0xbda2fc8f, 0x8e28ca9c), - TOBN(0x5d050da4, 0x37b9f454), TOBN(0x3d57eb57, 0x2379d72e), - TOBN(0xe9b5eba2, 0xfb5ee997), TOBN(0x01648ca2, 0xe11538ca), - TOBN(0x32bb76f6, 0xf6327974), TOBN(0x338f14b8, 0xff3f4bb7), - TOBN(0x524d226a, 0xd7ab9a2d), TOBN(0x9c00090d, 0x7dfae958), - TOBN(0x0ba5f539, 0x8751d8c2), TOBN(0x8afcbcdd, 0x3ab8262d), - TOBN(0x57392729, 0xe99d043b), TOBN(0xef51263b, 0xaebc943a), - TOBN(0x9feace93, 0x20862935), TOBN(0x639efc03, 0xb06c817b), - TOBN(0x1fe054b3, 0x66b4be7a), TOBN(0x3f25a9de, 0x84a37a1e), - TOBN(0xf39ef1ad, 0x78d75cd9), TOBN(0xd7b58f49, 0x5062c1b5), - TOBN(0x6f74f9a9, 0xff563436), TOBN(0xf718ff29, 0xe8af51e7), - TOBN(0x5234d313, 0x15e97fec), TOBN(0xb6a8e2b1, 0x292f1c0a), - TOBN(0xa7f53aa8, 0x327720c1), TOBN(0x956ca322, 0xba092cc8), - TOBN(0x8f03d64a, 0x28746c4d), TOBN(0x51fe1782, 0x66d0d392), - TOBN(0xd19b34db, 0x3c832c80), TOBN(0x60dccc5c, 0x6da2e3b4), - TOBN(0x245dd62e, 0x0a104ccc), TOBN(0xa7ab1de1, 0x620b21fd), - TOBN(0xb293ae0b, 0x3893d123), TOBN(0xf7b75783, 0xb15ee71c), - TOBN(0x5aa3c614, 0x42a9468b), TOBN(0xd686123c, 0xdb15d744), - TOBN(0x8c616891, 0xa7ab4116), TOBN(0x6fcd72c8, 0xa4e6a459), - TOBN(0xac219110, 0x77e5fad7), TOBN(0xfb6a20e7, 0x704fa46b), - TOBN(0xe839be7d, 0x341d81dc), TOBN(0xcddb6889, 0x32148379), - TOBN(0xda6211a1, 0xf7026ead), TOBN(0xf3b2575f, 0xf4d1cc5e), - TOBN(0x40cfc8f6, 0xa7a73ae6), TOBN(0x83879a5e, 0x61d5b483), - TOBN(0xc5acb1ed, 0x41a50ebc), TOBN(0x59a60cc8, 0x3c07d8fa), - TOBN(0x1b73bdce, 0xb1876262), TOBN(0x2b0d79f0, 0x12af4ee9), - TOBN(0x8bcf3b0b, 0xd46e1d07), TOBN(0x17d6af9d, 0xe45d152f), - TOBN(0x73520461, 0x6d736451), TOBN(0x43cbbd97, 0x56b0bf5a), - TOBN(0xb0833a5b, 0xd5999b9d), TOBN(0x702614f0, 0xeb72e398), - TOBN(0x0aadf01a, 0x59c3e9f8), TOBN(0x40200e77, 0xce6b3d16), - TOBN(0xda22bdd3, 0xdeddafad), TOBN(0x76dedaf4, 0x310d72e1), - TOBN(0x49ef807c, 0x4bc2e88f), TOBN(0x6ba81291, 0x146dd5a5), - TOBN(0xa1a4077a, 0x7d8d59e9), TOBN(0x87b6a2e7, 0x802db349), - TOBN(0xd5679997, 0x1b4e598e), TOBN(0xf499ef1f, 0x06fe4b1d), - TOBN(0x3978d3ae, 0xfcb267c5), TOBN(0xb582b557, 0x235786d0), - TOBN(0x32b3b2ca, 0x1715cb07), TOBN(0x4c3de6a2, 0x8480241d), - TOBN(0x63b5ffed, 0xcb571ecd), TOBN(0xeaf53900, 0xed2fe9a9), - TOBN(0xdec98d4a, 0xc3b81990), TOBN(0x1cb83722, 0x9e0cc8fe), - TOBN(0xfe0b0491, 0xd2b427b9), TOBN(0x0f2386ac, 0xe983a66c), - TOBN(0x930c4d1e, 0xb3291213), TOBN(0xa2f82b2e, 0x59a62ae4), - TOBN(0x77233853, 0xf93e89e3), TOBN(0x7f8063ac, 0x11777c7f), - TOBN(0xff0eb567, 0x59ad2877), TOBN(0x6f454642, 0x9865c754), - TOBN(0xe6fe701a, 0x236e9a84), TOBN(0xc586ef16, 0x06e40fc3), - TOBN(0x3f62b6e0, 0x24bafad9), TOBN(0xc8b42bd2, 0x64da906a), - TOBN(0xc98e1eb4, 0xda3276a0), TOBN(0x30d0e5fc, 0x06cbf852), - TOBN(0x1b6b2ae1, 0xe8b4dfd4), TOBN(0xd754d5c7, 0x8301cbac), - TOBN(0x66097629, 0x112a39ac), TOBN(0xf86b5999, 0x93ba4ab9), - TOBN(0x26c9dea7, 0x99f9d581), TOBN(0x0473b1a8, 0xc2fafeaa), - TOBN(0x1469af55, 0x3b2505a5), TOBN(0x227d16d7, 0xd6a43323), - TOBN(0x3316f73c, 0xad3d97f9), TOBN(0x52bf3bb5, 0x1f137455), - TOBN(0x953eafeb, 0x09954e7c), TOBN(0xa721dfed, 0xdd732411), - TOBN(0xb4929821, 0x141d4579), TOBN(0x3411321c, 0xaa3bd435), - TOBN(0xafb355aa, 0x17fa6015), TOBN(0xb4e7ef4a, 0x18e42f0e), - TOBN(0x604ac97c, 0x59371000), TOBN(0xe1c48c70, 0x7f759c18), - TOBN(0x3f62ecc5, 0xa5db6b65), TOBN(0x0a78b173, 0x38a21495), - TOBN(0x6be1819d, 0xbcc8ad94), TOBN(0x70dc04f6, 0xd89c3400), - TOBN(0x462557b4, 0xa6b4840a), TOBN(0x544c6ade, 0x60bd21c0), - TOBN(0x6a00f24e, 0x907a544b), TOBN(0xa7520dcb, 0x313da210), - TOBN(0xfe939b75, 0x11e4994b), TOBN(0x918b6ba6, 0xbc275d70), - TOBN(0xd3e5e0fc, 0x644be892), TOBN(0x707a9816, 0xfdaf6c42), - TOBN(0x60145567, 0xf15c13fe), TOBN(0x4818ebaa, 0xe130a54a), - TOBN(0x28aad3ad, 0x58d2f767), TOBN(0xdc5267fd, 0xd7e7c773), - TOBN(0x4919cc88, 0xc3afcc98), TOBN(0xaa2e6ab0, 0x2db8cd4b), - TOBN(0xd46fec04, 0xd0c63eaa), TOBN(0xa1cb92c5, 0x19ffa832), - TOBN(0x678dd178, 0xe43a631f), TOBN(0xfb5ae1cd, 0x3dc788b3), - TOBN(0x68b4fb90, 0x6e77de04), TOBN(0x7992bcf0, 0xf06dbb97), - TOBN(0x896e6a13, 0xc417c01d), TOBN(0x8d96332c, 0xb956be01), - TOBN(0x902fc93a, 0x413aa2b9), TOBN(0x99a4d915, 0xfc98c8a5), - TOBN(0x52c29407, 0x565f1137), TOBN(0x4072690f, 0x21e4f281), - TOBN(0x36e607cf, 0x02ff6072), TOBN(0xa47d2ca9, 0x8ad98cdc), - TOBN(0xbf471d1e, 0xf5f56609), TOBN(0xbcf86623, 0xf264ada0), - TOBN(0xb70c0687, 0xaa9e5cb6), TOBN(0xc98124f2, 0x17401c6c), - TOBN(0x8189635f, 0xd4a61435), TOBN(0xd28fb8af, 0xa9d98ea6), - TOBN(0xb9a67c2a, 0x40c251f8), TOBN(0x88cd5d87, 0xa2da44be), - TOBN(0x437deb96, 0xe09b5423), TOBN(0x150467db, 0x64287dc1), - TOBN(0xe161debb, 0xcdabb839), TOBN(0xa79e9742, 0xf1839a3e), - TOBN(0xbb8dd3c2, 0x652d202b), TOBN(0x7b3e67f7, 0xe9f97d96), - TOBN(0x5aa5d78f, 0xb1cb6ac9), TOBN(0xffa13e8e, 0xca1d0d45), - TOBN(0x369295dd, 0x2ba5bf95), TOBN(0xd68bd1f8, 0x39aff05e), - TOBN(0xaf0d86f9, 0x26d783f2), TOBN(0x543a59b3, 0xfc3aafc1), - TOBN(0x3fcf81d2, 0x7b7da97c), TOBN(0xc990a056, 0xd25dee46), - TOBN(0x3e6775b8, 0x519cce2c), TOBN(0xfc9af71f, 0xae13d863), - TOBN(0x774a4a6f, 0x47c1605c), TOBN(0x46ba4245, 0x2fd205e8), - TOBN(0xa06feea4, 0xd3fd524d), TOBN(0x1e724641, 0x6de1acc2), - TOBN(0xf53816f1, 0x334e2b42), TOBN(0x49e5918e, 0x922f0024), - TOBN(0x439530b6, 0x65c7322d), TOBN(0xcf12cc01, 0xb3c1b3fb), - TOBN(0xc70b0186, 0x0172f685), TOBN(0xb915ee22, 0x1b58391d), - TOBN(0x9afdf03b, 0xa317db24), TOBN(0x87dec659, 0x17b8ffc4), - TOBN(0x7f46597b, 0xe4d3d050), TOBN(0x80a1c1ed, 0x006500e7), - TOBN(0x84902a96, 0x78bf030e), TOBN(0xfb5e9c9a, 0x50560148), - TOBN(0x6dae0a92, 0x63362426), TOBN(0xdcaeecf4, 0xa9e30c40), - TOBN(0xc0d887bb, 0x518d0c6b), TOBN(0x99181152, 0xcb985b9d), - TOBN(0xad186898, 0xef7bc381), TOBN(0x18168ffb, 0x9ee46201), - TOBN(0x9a04cdaa, 0x2502753c), TOBN(0xbb279e26, 0x51407c41), - TOBN(0xeacb03aa, 0xf23564e5), TOBN(0x18336582, 0x71e61016), - TOBN(0x8684b8c4, 0xeb809877), TOBN(0xb336e18d, 0xea0e672e), - TOBN(0xefb601f0, 0x34ee5867), TOBN(0x2733edbe, 0x1341cfd1), - TOBN(0xb15e809a, 0x26025c3c), TOBN(0xe6e981a6, 0x9350df88), - TOBN(0x92376237, 0x8502fd8e), TOBN(0x4791f216, 0x0c12be9b), - TOBN(0xb7256789, 0x25f02425), TOBN(0xec863194, 0x7a974443), - TOBN(0x7c0ce882, 0xfb41cc52), TOBN(0xc266ff7e, 0xf25c07f2), - TOBN(0x3d4da8c3, 0x017025f3), TOBN(0xefcf628c, 0xfb9579b4), - TOBN(0x5c4d0016, 0x1f3716ec), TOBN(0x9c27ebc4, 0x6801116e), - TOBN(0x5eba0ea1, 0x1da1767e), TOBN(0xfe151452, 0x47004c57), - TOBN(0x3ace6df6, 0x8c2373b7), TOBN(0x75c3dffe, 0x5dbc37ac), - TOBN(0x3dc32a73, 0xddc925fc), TOBN(0xb679c841, 0x2f65ee0b), - TOBN(0x715a3295, 0x451cbfeb), TOBN(0xd9889768, 0xf76e9a29), - TOBN(0xec20ce7f, 0xb28ad247), TOBN(0xe99146c4, 0x00894d79), - TOBN(0x71457d7c, 0x9f5e3ea7), TOBN(0x097b2662, 0x38030031), - TOBN(0xdb7f6ae6, 0xcf9f82a8), TOBN(0x319decb9, 0x438f473a), - TOBN(0xa63ab386, 0x283856c3), TOBN(0x13e3172f, 0xb06a361b), - TOBN(0x2959f8dc, 0x7d5a006c), TOBN(0x2dbc27c6, 0x75fba752), - TOBN(0xc1227ab2, 0x87c22c9e), TOBN(0x06f61f75, 0x71a268b2), - TOBN(0x1b6bb971, 0x04779ce2), TOBN(0xaca83812, 0x0aadcb1d), - TOBN(0x297ae0bc, 0xaeaab2d5), TOBN(0xa5c14ee7, 0x5bfb9f13), - TOBN(0xaa00c583, 0xf17a62c7), TOBN(0x39eb962c, 0x173759f6), - TOBN(0x1eeba1d4, 0x86c9a88f), TOBN(0x0ab6c37a, 0xdf016c5e), - TOBN(0xa2a147db, 0xa28a0749), TOBN(0x246c20d6, 0xee519165), - TOBN(0x5068d1b1, 0xd3810715), TOBN(0xb1e7018c, 0x748160b9), - TOBN(0x03f5b1fa, 0xf380ff62), TOBN(0xef7fb1dd, 0xf3cb2c1e), - TOBN(0xeab539a8, 0xfc91a7da), TOBN(0x83ddb707, 0xf3f9b561), - TOBN(0xc550e211, 0xfe7df7a4), TOBN(0xa7cd07f2, 0x063f6f40), - TOBN(0xb0de3635, 0x2976879c), TOBN(0xb5f83f85, 0xe55741da), - TOBN(0x4ea9d25e, 0xf3d8ac3d), TOBN(0x6fe2066f, 0x62819f02), - TOBN(0x4ab2b9c2, 0xcef4a564), TOBN(0x1e155d96, 0x5ffa2de3), - TOBN(0x0eb0a19b, 0xc3a72d00), TOBN(0x4037665b, 0x8513c31b), - TOBN(0x2fb2b6bf, 0x04c64637), TOBN(0x45c34d6e, 0x08cdc639), - TOBN(0x56f1e10f, 0xf01fd796), TOBN(0x4dfb8101, 0xfe3667b8), - TOBN(0xe0eda253, 0x9021d0c0), TOBN(0x7a94e9ff, 0x8a06c6ab), - TOBN(0x2d3bb0d9, 0xbb9aa882), TOBN(0xea20e4e5, 0xec05fd10), - TOBN(0xed7eeb5f, 0x1a1ca64e), TOBN(0x2fa6b43c, 0xc6327cbd), - TOBN(0xb577e3cf, 0x3aa91121), TOBN(0x8c6bd5ea, 0x3a34079b), - TOBN(0xd7e5ba39, 0x60e02fc0), TOBN(0xf16dd2c3, 0x90141bf8), - TOBN(0xb57276d9, 0x80101b98), TOBN(0x760883fd, 0xb82f0f66), - TOBN(0x89d7de75, 0x4bc3eff3), TOBN(0x03b60643, 0x5dc2ab40), - TOBN(0xcd6e53df, 0xe05beeac), TOBN(0xf2f1e862, 0xbc3325cd), - TOBN(0xdd0f7921, 0x774f03c3), TOBN(0x97ca7221, 0x4552cc1b), - TOBN(0x5a0d6afe, 0x1cd19f72), TOBN(0xa20915dc, 0xf183fbeb), - TOBN(0x9fda4b40, 0x832c403c), TOBN(0x32738edd, 0xbe425442), - TOBN(0x469a1df6, 0xb5eccf1a), TOBN(0x4b5aff42, 0x28bbe1f0), - TOBN(0x31359d7f, 0x570dfc93), TOBN(0xa18be235, 0xf0088628), - TOBN(0xa5b30fba, 0xb00ed3a9), TOBN(0x34c61374, 0x73cdf8be), - TOBN(0x2c5c5f46, 0xabc56797), TOBN(0x5cecf93d, 0xb82a8ae2), - TOBN(0x7d3dbe41, 0xa968fbf0), TOBN(0xd23d4583, 0x1a5c7f3d), - TOBN(0xf28f69a0, 0xc087a9c7), TOBN(0xc2d75471, 0x474471ca), - TOBN(0x36ec9f4a, 0x4eb732ec), TOBN(0x6c943bbd, 0xb1ca6bed), - TOBN(0xd64535e1, 0xf2457892), TOBN(0x8b84a8ea, 0xf7e2ac06), - TOBN(0xe0936cd3, 0x2499dd5f), TOBN(0x12053d7e, 0x0ed04e57), - TOBN(0x4bdd0076, 0xe4305d9d), TOBN(0x34a527b9, 0x1f67f0a2), - TOBN(0xe79a4af0, 0x9cec46ea), TOBN(0xb15347a1, 0x658b9bc7), - TOBN(0x6bd2796f, 0x35af2f75), TOBN(0xac957990, 0x4051c435), - TOBN(0x2669dda3, 0xc33a655d), TOBN(0x5d503c2e, 0x88514aa3), - TOBN(0xdfa11337, 0x3753dd41), TOBN(0x3f054673, 0x0b754f78), - TOBN(0xbf185677, 0x496125bd), TOBN(0xfb0023c8, 0x3775006c), - TOBN(0xfa0f072f, 0x3a037899), TOBN(0x4222b6eb, 0x0e4aea57), - TOBN(0x3dde5e76, 0x7866d25a), TOBN(0xb6eb04f8, 0x4837aa6f), - TOBN(0x5315591a, 0x2cf1cdb8), TOBN(0x6dfb4f41, 0x2d4e683c), - TOBN(0x7e923ea4, 0x48ee1f3a), TOBN(0x9604d9f7, 0x05a2afd5), - TOBN(0xbe1d4a33, 0x40ea4948), TOBN(0x5b45f1f4, 0xb44cbd2f), - TOBN(0x5faf8376, 0x4acc757e), TOBN(0xa7cf9ab8, 0x63d68ff7), - TOBN(0x8ad62f69, 0xdf0e404b), TOBN(0xd65f33c2, 0x12bdafdf), - TOBN(0xc365de15, 0xa377b14e), TOBN(0x6bf5463b, 0x8e39f60c), - TOBN(0x62030d2d, 0x2ce68148), TOBN(0xd95867ef, 0xe6f843a8), - TOBN(0xd39a0244, 0xef5ab017), TOBN(0x0bd2d8c1, 0x4ab55d12), - TOBN(0xc9503db3, 0x41639169), TOBN(0x2d4e25b0, 0xf7660c8a), - TOBN(0x760cb3b5, 0xe224c5d7), TOBN(0xfa3baf8c, 0x68616919), - TOBN(0x9fbca113, 0x8d142552), TOBN(0x1ab18bf1, 0x7669ebf5), - TOBN(0x55e6f53e, 0x9bdf25dd), TOBN(0x04cc0bf3, 0xcb6cd154), - TOBN(0x595bef49, 0x95e89080), TOBN(0xfe9459a8, 0x104a9ac1), - TOBN(0xad2d89ca, 0xcce9bb32), TOBN(0xddea65e1, 0xf7de8285), - TOBN(0x62ed8c35, 0xb351bd4b), TOBN(0x4150ff36, 0x0c0e19a7), - TOBN(0x86e3c801, 0x345f4e47), TOBN(0x3bf21f71, 0x203a266c), - TOBN(0x7ae110d4, 0x855b1f13), TOBN(0x5d6aaf6a, 0x07262517), - TOBN(0x1e0f12e1, 0x813d28f1), TOBN(0x6000e11d, 0x7ad7a523), - TOBN(0xc7d8deef, 0xc744a17b), TOBN(0x1e990b48, 0x14c05a00), - TOBN(0x68fddaee, 0x93e976d5), TOBN(0x696241d1, 0x46610d63), - TOBN(0xb204e7c3, 0x893dda88), TOBN(0x8bccfa65, 0x6a3a6946), - TOBN(0xb59425b4, 0xc5cd1411), TOBN(0x701b4042, 0xff3658b1), - TOBN(0xe3e56bca, 0x4784cf93), TOBN(0x27de5f15, 0x8fe68d60), - TOBN(0x4ab9cfce, 0xf8d53f19), TOBN(0xddb10311, 0xa40a730d), - TOBN(0x6fa73cd1, 0x4eee0a8a), TOBN(0xfd548748, 0x5249719d), - TOBN(0x49d66316, 0xa8123ef0), TOBN(0x73c32db4, 0xe7f95438), - TOBN(0x2e2ed209, 0x0d9e7854), TOBN(0xf98a9329, 0x9d9f0507), - TOBN(0xc5d33cf6, 0x0c6aa20a), TOBN(0x9a32ba14, 0x75279bb2), - TOBN(0x7e3202cb, 0x774a7307), TOBN(0x64ed4bc4, 0xe8c42dbd), - TOBN(0xc20f1a06, 0xd4caed0d), TOBN(0xb8021407, 0x171d22b3), - TOBN(0xd426ca04, 0xd13268d7), TOBN(0x92377007, 0x25f4d126), - TOBN(0x4204cbc3, 0x71f21a85), TOBN(0x18461b7a, 0xf82369ba), - TOBN(0xc0c07d31, 0x3fc858f9), TOBN(0x5deb5a50, 0xe2bab569), - TOBN(0xd5959d46, 0xd5eea89e), TOBN(0xfdff8424, 0x08437f4b), - TOBN(0xf21071e4, 0x3cfe254f), TOBN(0x72417696, 0x95468321), - TOBN(0x5d8288b9, 0x102cae3e), TOBN(0x2d143e3d, 0xf1965dff), - TOBN(0x00c9a376, 0xa078d847), TOBN(0x6fc0da31, 0x26028731), - TOBN(0xa2baeadf, 0xe45083a2), TOBN(0x66bc7218, 0x5e5b4bcd), - TOBN(0x2c826442, 0xd04b8e7f), TOBN(0xc19f5451, 0x6c4b586b), - TOBN(0x60182c49, 0x5b7eeed5), TOBN(0xd9954ecd, 0x7aa9dfa1), - TOBN(0xa403a8ec, 0xc73884ad), TOBN(0x7fb17de2, 0x9bb39041), - TOBN(0x694b64c5, 0xabb020e8), TOBN(0x3d18c184, 0x19c4eec7), - TOBN(0x9c4673ef, 0x1c4793e5), TOBN(0xc7b8aeb5, 0x056092e6), - TOBN(0x3aa1ca43, 0xf0f8c16b), TOBN(0x224ed5ec, 0xd679b2f6), - TOBN(0x0d56eeaf, 0x55a205c9), TOBN(0xbfe115ba, 0x4b8e028b), - TOBN(0x97e60849, 0x3927f4fe), TOBN(0xf91fbf94, 0x759aa7c5), - TOBN(0x985af769, 0x6be90a51), TOBN(0xc1277b78, 0x78ccb823), - TOBN(0x395b656e, 0xe7a75952), TOBN(0x00df7de0, 0x928da5f5), - TOBN(0x09c23175, 0x4ca4454f), TOBN(0x4ec971f4, 0x7aa2d3c1), - TOBN(0x45c3c507, 0xe75d9ccc), TOBN(0x63b7be8a, 0x3dc90306), - TOBN(0x37e09c66, 0x5db44bdc), TOBN(0x50d60da1, 0x6841c6a2), - TOBN(0x6f9b65ee, 0x08df1b12), TOBN(0x38734879, 0x7ff089df), - TOBN(0x9c331a66, 0x3fe8013d), TOBN(0x017f5de9, 0x5f42fcc8), - TOBN(0x43077866, 0xe8e57567), TOBN(0xc9f781ce, 0xf9fcdb18), - TOBN(0x38131dda, 0x9b12e174), TOBN(0x25d84aa3, 0x8a03752a), - TOBN(0x45e09e09, 0x4d0c0ce2), TOBN(0x1564008b, 0x92bebba5), - TOBN(0xf7e8ad31, 0xa87284c7), TOBN(0xb7c4b46c, 0x97e7bbaa), - TOBN(0x3e22a7b3, 0x97acf4ec), TOBN(0x0426c400, 0x5ea8b640), - TOBN(0x5e3295a6, 0x4e969285), TOBN(0x22aabc59, 0xa6a45670), - TOBN(0xb929714c, 0x5f5942bc), TOBN(0x9a6168bd, 0xfa3182ed), - TOBN(0x2216a665, 0x104152ba), TOBN(0x46908d03, 0xb6926368)}, - {TOBN(0xa9f5d874, 0x5a1251fb), TOBN(0x967747a8, 0xc72725c7), - TOBN(0x195c33e5, 0x31ffe89e), TOBN(0x609d210f, 0xe964935e), - TOBN(0xcafd6ca8, 0x2fe12227), TOBN(0xaf9b5b96, 0x0426469d), - TOBN(0x2e9ee04c, 0x5693183c), TOBN(0x1084a333, 0xc8146fef), - TOBN(0x96649933, 0xaed1d1f7), TOBN(0x566eaff3, 0x50563090), - TOBN(0x345057f0, 0xad2e39cf), TOBN(0x148ff65b, 0x1f832124), - TOBN(0x042e89d4, 0xcf94cf0d), TOBN(0x319bec84, 0x520c58b3), - TOBN(0x2a267626, 0x5361aa0d), TOBN(0xc86fa302, 0x8fbc87ad), - TOBN(0xfc83d2ab, 0x5c8b06d5), TOBN(0xb1a785a2, 0xfe4eac46), - TOBN(0xb99315bc, 0x846f7779), TOBN(0xcf31d816, 0xef9ea505), - TOBN(0x2391fe6a, 0x15d7dc85), TOBN(0x2f132b04, 0xb4016b33), - TOBN(0x29547fe3, 0x181cb4c7), TOBN(0xdb66d8a6, 0x650155a1), - TOBN(0x6b66d7e1, 0xadc1696f), TOBN(0x98ebe593, 0x0acd72d0), - TOBN(0x65f24550, 0xcc1b7435), TOBN(0xce231393, 0xb4b9a5ec), - TOBN(0x234a22d4, 0xdb067df9), TOBN(0x98dda095, 0xcaff9b00), - TOBN(0x1bbc75a0, 0x6100c9c1), TOBN(0x1560a9c8, 0x939cf695), - TOBN(0xcf006d3e, 0x99e0925f), TOBN(0x2dd74a96, 0x6322375a), - TOBN(0xc58b446a, 0xb56af5ba), TOBN(0x50292683, 0xe0b9b4f1), - TOBN(0xe2c34cb4, 0x1aeaffa3), TOBN(0x8b17203f, 0x9b9587c1), - TOBN(0x6d559207, 0xead1350c), TOBN(0x2b66a215, 0xfb7f9604), - TOBN(0x0850325e, 0xfe51bf74), TOBN(0x9c4f579e, 0x5e460094), - TOBN(0x5c87b92a, 0x76da2f25), TOBN(0x889de4e0, 0x6febef33), - TOBN(0x6900ec06, 0x646083ce), TOBN(0xbe2a0335, 0xbfe12773), - TOBN(0xadd1da35, 0xc5344110), TOBN(0x757568b7, 0xb802cd20), - TOBN(0x75559779, 0x00f7e6c8), TOBN(0x38e8b94f, 0x0facd2f0), - TOBN(0xfea1f3af, 0x03fde375), TOBN(0x5e11a1d8, 0x75881dfc), - TOBN(0xb3a6b02e, 0xc1e2f2ef), TOBN(0x193d2bbb, 0xc605a6c5), - TOBN(0x325ffeee, 0x339a0b2d), TOBN(0x27b6a724, 0x9e0c8846), - TOBN(0xe4050f1c, 0xf1c367ca), TOBN(0x9bc85a9b, 0xc90fbc7d), - TOBN(0xa373c4a2, 0xe1a11032), TOBN(0xb64232b7, 0xad0393a9), - TOBN(0xf5577eb0, 0x167dad29), TOBN(0x1604f301, 0x94b78ab2), - TOBN(0x0baa94af, 0xe829348b), TOBN(0x77fbd8dd, 0x41654342), - TOBN(0xdab50ea5, 0xb964e39a), TOBN(0xd4c29e3c, 0xd0d3c76e), - TOBN(0x80dae67c, 0x56d11964), TOBN(0x7307a8bf, 0xe5ffcc2f), - TOBN(0x65bbc1aa, 0x91708c3b), TOBN(0xa151e62c, 0x28bf0eeb), - TOBN(0x6cb53381, 0x6fa34db7), TOBN(0x5139e05c, 0xa29403a8), - TOBN(0x6ff651b4, 0x94a7cd2e), TOBN(0x5671ffd1, 0x0699336c), - TOBN(0x6f5fd2cc, 0x979a896a), TOBN(0x11e893a8, 0xd8148cef), - TOBN(0x988906a1, 0x65cf7b10), TOBN(0x81b67178, 0xc50d8485), - TOBN(0x7c0deb35, 0x8a35b3de), TOBN(0x423ac855, 0xc1d29799), - TOBN(0xaf580d87, 0xdac50b74), TOBN(0x28b2b89f, 0x5869734c), - TOBN(0x99a3b936, 0x874e28fb), TOBN(0xbb2c9190, 0x25f3f73a), - TOBN(0x199f6918, 0x84a9d5b7), TOBN(0x7ebe2325, 0x7e770374), - TOBN(0xf442e107, 0x0738efe2), TOBN(0xcf9f3f56, 0xcf9082d2), - TOBN(0x719f69e1, 0x09618708), TOBN(0xcc9e8364, 0xc183f9b1), - TOBN(0xec203a95, 0x366a21af), TOBN(0x6aec5d6d, 0x068b141f), - TOBN(0xee2df78a, 0x994f04e9), TOBN(0xb39ccae8, 0x271245b0), - TOBN(0xb875a4a9, 0x97e43f4f), TOBN(0x507dfe11, 0xdb2cea98), - TOBN(0x4fbf81cb, 0x489b03e9), TOBN(0xdb86ec5b, 0x6ec414fa), - TOBN(0xfad444f9, 0xf51b3ae5), TOBN(0xca7d33d6, 0x1914e3fe), - TOBN(0xa9c32f5c, 0x0ae6c4d0), TOBN(0xa9ca1d1e, 0x73969568), - TOBN(0x98043c31, 0x1aa7467e), TOBN(0xe832e75c, 0xe21b5ac6), - TOBN(0x314b7aea, 0x5232123d), TOBN(0x08307c8c, 0x65ae86db), - TOBN(0x06e7165c, 0xaa4668ed), TOBN(0xb170458b, 0xb4d3ec39), - TOBN(0x4d2e3ec6, 0xc19bb986), TOBN(0xc5f34846, 0xae0304ed), - TOBN(0x917695a0, 0x6c9f9722), TOBN(0x6c7f7317, 0x4cab1c0a), - TOBN(0x6295940e, 0x9d6d2e8b), TOBN(0xd318b8c1, 0x549f7c97), - TOBN(0x22453204, 0x97713885), TOBN(0x468d834b, 0xa8a440fe), - TOBN(0xd81fe5b2, 0xbfba796e), TOBN(0x152364db, 0x6d71f116), - TOBN(0xbb8c7c59, 0xb5b66e53), TOBN(0x0b12c61b, 0x2641a192), - TOBN(0x31f14802, 0xfcf0a7fd), TOBN(0x42fd0789, 0x5488b01e), - TOBN(0x71d78d6d, 0x9952b498), TOBN(0x8eb572d9, 0x07ac5201), - TOBN(0xe0a2a44c, 0x4d194a88), TOBN(0xd2b63fd9, 0xba017e66), - TOBN(0x78efc6c8, 0xf888aefc), TOBN(0xb76f6bda, 0x4a881a11), - TOBN(0x187f314b, 0xb46c2397), TOBN(0x004cf566, 0x5ded2819), - TOBN(0xa9ea5704, 0x38764d34), TOBN(0xbba45217, 0x78084709), - TOBN(0x06474571, 0x1171121e), TOBN(0xad7b7eb1, 0xe7c9b671), - TOBN(0xdacfbc40, 0x730f7507), TOBN(0x178cd8c6, 0xc7ad7bd1), - TOBN(0xbf0be101, 0xb2a67238), TOBN(0x3556d367, 0xaf9c14f2), - TOBN(0x104b7831, 0xa5662075), TOBN(0x58ca59bb, 0x79d9e60a), - TOBN(0x4bc45392, 0xa569a73b), TOBN(0x517a52e8, 0x5698f6c9), - TOBN(0x85643da5, 0xaeadd755), TOBN(0x1aed0cd5, 0x2a581b84), - TOBN(0xb9b4ff84, 0x80af1372), TOBN(0x244c3113, 0xf1ba5d1f), - TOBN(0x2a5dacbe, 0xf5f98d31), TOBN(0x2c3323e8, 0x4375bc2a), - TOBN(0x17a3ab4a, 0x5594b1dd), TOBN(0xa1928bfb, 0xceb4797e), - TOBN(0xe83af245, 0xe4886a19), TOBN(0x8979d546, 0x72b5a74a), - TOBN(0xa0f726bc, 0x19f9e967), TOBN(0xd9d03152, 0xe8fbbf4e), - TOBN(0xcfd6f51d, 0xb7707d40), TOBN(0x633084d9, 0x63f6e6e0), - TOBN(0xedcd9cdc, 0x55667eaf), TOBN(0x73b7f92b, 0x2e44d56f), - TOBN(0xfb2e39b6, 0x4e962b14), TOBN(0x7d408f6e, 0xf671fcbf), - TOBN(0xcc634ddc, 0x164a89bb), TOBN(0x74a42bb2, 0x3ef3bd05), - TOBN(0x1280dbb2, 0x428decbb), TOBN(0x6103f6bb, 0x402c8596), - TOBN(0xfa2bf581, 0x355a5752), TOBN(0x562f96a8, 0x00946674), - TOBN(0x4e4ca16d, 0x6da0223b), TOBN(0xfe47819f, 0x28d3aa25), - TOBN(0x9eea3075, 0xf8dfcf8a), TOBN(0xa284f0aa, 0x95669825), - TOBN(0xb3fca250, 0x867d3fd8), TOBN(0x20757b5f, 0x269d691e), - TOBN(0xf2c24020, 0x93b8a5de), TOBN(0xd3f93359, 0xebc06da6), - TOBN(0x1178293e, 0xb2739c33), TOBN(0xd2a3e770, 0xbcd686e5), - TOBN(0xa76f49f4, 0xcd941534), TOBN(0x0d37406b, 0xe3c71c0e), - TOBN(0x172d9397, 0x3b97f7e3), TOBN(0xec17e239, 0xbd7fd0de), - TOBN(0xe3290551, 0x6f496ba2), TOBN(0x6a693172, 0x36ad50e7), - TOBN(0xc4e539a2, 0x83e7eff5), TOBN(0x752737e7, 0x18e1b4cf), - TOBN(0xa2f7932c, 0x68af43ee), TOBN(0x5502468e, 0x703d00bd), - TOBN(0xe5dc978f, 0x2fb061f5), TOBN(0xc9a1904a, 0x28c815ad), - TOBN(0xd3af538d, 0x470c56a4), TOBN(0x159abc5f, 0x193d8ced), - TOBN(0x2a37245f, 0x20108ef3), TOBN(0xfa17081e, 0x223f7178), - TOBN(0x27b0fb2b, 0x10c8c0f5), TOBN(0x2102c3ea, 0x40650547), - TOBN(0x594564df, 0x8ac3bfa7), TOBN(0x98102033, 0x509dad96), - TOBN(0x6989643f, 0xf1d18a13), TOBN(0x35eebd91, 0xd7fc5af0), - TOBN(0x078d096a, 0xfaeaafd8), TOBN(0xb7a89341, 0xdef3de98), - TOBN(0x2a206e8d, 0xecf2a73a), TOBN(0x066a6397, 0x8e551994), - TOBN(0x3a6a088a, 0xb98d53a2), TOBN(0x0ce7c67c, 0x2d1124aa), - TOBN(0x48cec671, 0x759a113c), TOBN(0xe3b373d3, 0x4f6f67fa), - TOBN(0x5455d479, 0xfd36727b), TOBN(0xe5a428ee, 0xa13c0d81), - TOBN(0xb853dbc8, 0x1c86682b), TOBN(0xb78d2727, 0xb8d02b2a), - TOBN(0xaaf69bed, 0x8ebc329a), TOBN(0xdb6b40b3, 0x293b2148), - TOBN(0xe42ea77d, 0xb8c4961f), TOBN(0xb1a12f7c, 0x20e5e0ab), - TOBN(0xa0ec5274, 0x79e8b05e), TOBN(0x68027391, 0xfab60a80), - TOBN(0x6bfeea5f, 0x16b1bd5e), TOBN(0xf957e420, 0x4de30ad3), - TOBN(0xcbaf664e, 0x6a353b9e), TOBN(0x5c873312, 0x26d14feb), - TOBN(0x4e87f98c, 0xb65f57cb), TOBN(0xdb60a621, 0x5e0cdd41), - TOBN(0x67c16865, 0xa6881440), TOBN(0x1093ef1a, 0x46ab52aa), - TOBN(0xc095afb5, 0x3f4ece64), TOBN(0x6a6bb02e, 0x7604551a), - TOBN(0x55d44b4e, 0x0b26b8cd), TOBN(0xe5f9a999, 0xf971268a), - TOBN(0xc08ec425, 0x11a7de84), TOBN(0x83568095, 0xfda469dd), - TOBN(0x737bfba1, 0x6c6c90a2), TOBN(0x1cb9c4a0, 0xbe229831), - TOBN(0x93bccbba, 0xbb2eec64), TOBN(0xa0c23b64, 0xda03adbe), - TOBN(0x5f7aa00a, 0xe0e86ac4), TOBN(0x470b941e, 0xfc1401e6), - TOBN(0x5ad8d679, 0x9df43574), TOBN(0x4ccfb8a9, 0x0f65d810), - TOBN(0x1bce80e3, 0xaa7fbd81), TOBN(0x273291ad, 0x9508d20a), - TOBN(0xf5c4b46b, 0x42a92806), TOBN(0x810684ec, 0xa86ab44a), - TOBN(0x4591640b, 0xca0bc9f8), TOBN(0xb5efcdfc, 0x5c4b6054), - TOBN(0x16fc8907, 0x6e9edd12), TOBN(0xe29d0b50, 0xd4d792f9), - TOBN(0xa45fd01c, 0x9b03116d), TOBN(0x85035235, 0xc81765a4), - TOBN(0x1fe2a9b2, 0xb4b4b67c), TOBN(0xc1d10df0, 0xe8020604), - TOBN(0x9d64abfc, 0xbc8058d8), TOBN(0x8943b9b2, 0x712a0fbb), - TOBN(0x90eed914, 0x3b3def04), TOBN(0x85ab3aa2, 0x4ce775ff), - TOBN(0x605fd4ca, 0x7bbc9040), TOBN(0x8b34a564, 0xe2c75dfb), - TOBN(0x41ffc94a, 0x10358560), TOBN(0x2d8a5072, 0x9e5c28aa), - TOBN(0xe915a0fc, 0x4cc7eb15), TOBN(0xe9efab05, 0x8f6d0f5d), - TOBN(0xdbab47a9, 0xd19e9b91), TOBN(0x8cfed745, 0x0276154c), - TOBN(0x154357ae, 0x2cfede0d), TOBN(0x520630df, 0x19f5a4ef), - TOBN(0x25759f7c, 0xe382360f), TOBN(0xb6db05c9, 0x88bf5857), - TOBN(0x2917d61d, 0x6c58d46c), TOBN(0x14f8e491, 0xfd20cb7a), - TOBN(0xb68a727a, 0x11c20340), TOBN(0x0386f86f, 0xaf7ccbb6), - TOBN(0x5c8bc6cc, 0xfee09a20), TOBN(0x7d76ff4a, 0xbb7eea35), - TOBN(0xa7bdebe7, 0xdb15be7a), TOBN(0x67a08054, 0xd89f0302), - TOBN(0x56bf0ea9, 0xc1193364), TOBN(0xc8244467, 0x62837ebe), - TOBN(0x32bd8e8b, 0x20d841b8), TOBN(0x127a0548, 0xdbb8a54f), - TOBN(0x83dd4ca6, 0x63b20236), TOBN(0x87714718, 0x203491fa), - TOBN(0x4dabcaaa, 0xaa8a5288), TOBN(0x91cc0c8a, 0xaf23a1c9), - TOBN(0x34c72c6a, 0x3f220e0c), TOBN(0xbcc20bdf, 0x1232144a), - TOBN(0x6e2f42da, 0xa20ede1b), TOBN(0xc441f00c, 0x74a00515), - TOBN(0xbf46a5b6, 0x734b8c4b), TOBN(0x57409503, 0x7b56c9a4), - TOBN(0x9f735261, 0xe4585d45), TOBN(0x9231faed, 0x6734e642), - TOBN(0x1158a176, 0xbe70ee6c), TOBN(0x35f1068d, 0x7c3501bf), - TOBN(0x6beef900, 0xa2d26115), TOBN(0x649406f2, 0xef0afee3), - TOBN(0x3f43a60a, 0xbc2420a1), TOBN(0x509002a7, 0xd5aee4ac), - TOBN(0xb46836a5, 0x3ff3571b), TOBN(0x24f98b78, 0x837927c1), - TOBN(0x6254256a, 0x4533c716), TOBN(0xf27abb0b, 0xd07ee196), - TOBN(0xd7cf64fc, 0x5c6d5bfd), TOBN(0x6915c751, 0xf0cd7a77), - TOBN(0xd9f59012, 0x8798f534), TOBN(0x772b0da8, 0xf81d8b5f), - TOBN(0x1244260c, 0x2e03fa69), TOBN(0x36cf0e3a, 0x3be1a374), - TOBN(0x6e7c1633, 0xef06b960), TOBN(0xa71a4c55, 0x671f90f6), - TOBN(0x7a941251, 0x33c673db), TOBN(0xc0bea510, 0x73e8c131), - TOBN(0x61a8a699, 0xd4f6c734), TOBN(0x25e78c88, 0x341ed001), - TOBN(0x5c18acf8, 0x8e2f7d90), TOBN(0xfdbf33d7, 0x77be32cd), - TOBN(0x0a085cd7, 0xd2eb5ee9), TOBN(0x2d702cfb, 0xb3201115), - TOBN(0xb6e0ebdb, 0x85c88ce8), TOBN(0x23a3ce3c, 0x1e01d617), - TOBN(0x3041618e, 0x567333ac), TOBN(0x9dd0fd8f, 0x157edb6b), - TOBN(0x27f74702, 0xb57872b8), TOBN(0x2ef26b4f, 0x657d5fe1), - TOBN(0x95426f0a, 0x57cf3d40), TOBN(0x847e2ad1, 0x65a6067a), - TOBN(0xd474d9a0, 0x09996a74), TOBN(0x16a56acd, 0x2a26115c), - TOBN(0x02a615c3, 0xd16f4d43), TOBN(0xcc3fc965, 0xaadb85b7), - TOBN(0x386bda73, 0xce07d1b0), TOBN(0xd82910c2, 0x58ad4178), - TOBN(0x124f82cf, 0xcd2617f4), TOBN(0xcc2f5e8d, 0xef691770), - TOBN(0x82702550, 0xb8c30ccc), TOBN(0x7b856aea, 0x1a8e575a), - TOBN(0xbb822fef, 0xb1ab9459), TOBN(0x085928bc, 0xec24e38e), - TOBN(0x5d0402ec, 0xba8f4b4d), TOBN(0xc07cd4ba, 0x00b4d58b), - TOBN(0x5d8dffd5, 0x29227e7a), TOBN(0x61d44d0c, 0x31bf386f), - TOBN(0xe486dc2b, 0x135e6f4d), TOBN(0x680962eb, 0xe79410ef), - TOBN(0xa61bd343, 0xf10088b5), TOBN(0x6aa76076, 0xe2e28686), - TOBN(0x80463d11, 0x8fb98871), TOBN(0xcb26f5c3, 0xbbc76aff), - TOBN(0xd4ab8edd, 0xfbe03614), TOBN(0xc8eb579b, 0xc0cf2dee), - TOBN(0xcc004c15, 0xc93bae41), TOBN(0x46fbae5d, 0x3aeca3b2), - TOBN(0x671235cf, 0x0f1e9ab1), TOBN(0xadfba934, 0x9ec285c1), - TOBN(0x88ded013, 0xf216c980), TOBN(0xc8ac4fb8, 0xf79e0bc1), - TOBN(0xa29b89c6, 0xfb97a237), TOBN(0xb697b780, 0x9922d8e7), - TOBN(0x3142c639, 0xddb945b5), TOBN(0x447b06c7, 0xe094c3a9), - TOBN(0xcdcb3642, 0x72266c90), TOBN(0x633aad08, 0xa9385046), - TOBN(0xa36c936b, 0xb57c6477), TOBN(0x871f8b64, 0xe94dbcc6), - TOBN(0x28d0fb62, 0xa591a67b), TOBN(0x9d40e081, 0xc1d926f5), - TOBN(0x3111eaf6, 0xf2d84b5a), TOBN(0x228993f9, 0xa565b644), - TOBN(0x0ccbf592, 0x2c83188b), TOBN(0xf87b30ab, 0x3df3e197), - TOBN(0xb8658b31, 0x7642bca8), TOBN(0x1a032d7f, 0x52800f17), - TOBN(0x051dcae5, 0x79bf9445), TOBN(0xeba6b8ee, 0x54a2e253), - TOBN(0x5c8b9cad, 0xd4485692), TOBN(0x84bda40e, 0x8986e9be), - TOBN(0xd16d16a4, 0x2f0db448), TOBN(0x8ec80050, 0xa14d4188), - TOBN(0xb2b26107, 0x98fa7aaa), TOBN(0x41209ee4, 0xf073aa4e), - TOBN(0xf1570359, 0xf2d6b19b), TOBN(0xcbe6868c, 0xfc577caf), - TOBN(0x186c4bdc, 0x32c04dd3), TOBN(0xa6c35fae, 0xcfeee397), - TOBN(0xb4a1b312, 0xf086c0cf), TOBN(0xe0a5ccc6, 0xd9461fe2), - TOBN(0xc32278aa, 0x1536189f), TOBN(0x1126c55f, 0xba6df571), - TOBN(0x0f71a602, 0xb194560e), TOBN(0x8b2d7405, 0x324bd6e1), - TOBN(0x8481939e, 0x3738be71), TOBN(0xb5090b1a, 0x1a4d97a9), - TOBN(0x116c65a3, 0xf05ba915), TOBN(0x21863ad3, 0xaae448aa), - TOBN(0xd24e2679, 0xa7aae5d3), TOBN(0x7076013d, 0x0de5c1c4), - TOBN(0x2d50f8ba, 0xbb05b629), TOBN(0x73c1abe2, 0x6e66efbb), - TOBN(0xefd4b422, 0xf2488af7), TOBN(0xe4105d02, 0x663ba575), - TOBN(0x7eb60a8b, 0x53a69457), TOBN(0x62210008, 0xc945973b), - TOBN(0xfb255478, 0x77a50ec6), TOBN(0xbf0392f7, 0x0a37a72c), - TOBN(0xa0a7a19c, 0x4be18e7a), TOBN(0x90d8ea16, 0x25b1e0af), - TOBN(0x7582a293, 0xef953f57), TOBN(0x90a64d05, 0xbdc5465a), - TOBN(0xca79c497, 0xe2510717), TOBN(0x560dbb7c, 0x18cb641f), - TOBN(0x1d8e3286, 0x4b66abfb), TOBN(0xd26f52e5, 0x59030900), - TOBN(0x1ee3f643, 0x5584941a), TOBN(0x6d3b3730, 0x569f5958), - TOBN(0x9ff2a62f, 0x4789dba5), TOBN(0x91fcb815, 0x72b5c9b7), - TOBN(0xf446cb7d, 0x6c8f9a0e), TOBN(0x48f625c1, 0x39b7ecb5), - TOBN(0xbabae801, 0x1c6219b8), TOBN(0xe7a562d9, 0x28ac2f23), - TOBN(0xe1b48732, 0x26e20588), TOBN(0x06ee1cad, 0x775af051), - TOBN(0xda29ae43, 0xfaff79f7), TOBN(0xc141a412, 0x652ee9e0), - TOBN(0x1e127f6f, 0x195f4bd0), TOBN(0x29c6ab4f, 0x072f34f8), - TOBN(0x7b7c1477, 0x30448112), TOBN(0x82b51af1, 0xe4a38656), - TOBN(0x2bf2028a, 0x2f315010), TOBN(0xc9a4a01f, 0x6ea88cd4), - TOBN(0xf63e95d8, 0x257e5818), TOBN(0xdd8efa10, 0xb4519b16), - TOBN(0xed8973e0, 0x0da910bf), TOBN(0xed49d077, 0x5c0fe4a9), - TOBN(0xac3aac5e, 0xb7caee1e), TOBN(0x1033898d, 0xa7f4da57), - TOBN(0x42145c0e, 0x5c6669b9), TOBN(0x42daa688, 0xc1aa2aa0), - TOBN(0x629cc15c, 0x1a1d885a), TOBN(0x25572ec0, 0xf4b76817), - TOBN(0x8312e435, 0x9c8f8f28), TOBN(0x8107f8cd, 0x81965490), - TOBN(0x516ff3a3, 0x6fa6110c), TOBN(0x74fb1eb1, 0xfb93561f), - TOBN(0x6c0c9047, 0x8457522b), TOBN(0xcfd32104, 0x6bb8bdc6), - TOBN(0x2d6884a2, 0xcc80ad57), TOBN(0x7c27fc35, 0x86a9b637), - TOBN(0x3461baed, 0xadf4e8cd), TOBN(0x1d56251a, 0x617242f0), - TOBN(0x0b80d209, 0xc955bef4), TOBN(0xdf02cad2, 0x06adb047), - TOBN(0xf0d7cb91, 0x5ec74fee), TOBN(0xd2503375, 0x1111ba44), - TOBN(0x9671755e, 0xdf53cb36), TOBN(0x54dcb612, 0x3368551b), - TOBN(0x66d69aac, 0xc8a025a4), TOBN(0x6be946c6, 0xe77ef445), - TOBN(0x719946d1, 0xa995e094), TOBN(0x65e848f6, 0xe51e04d8), - TOBN(0xe62f3300, 0x6a1e3113), TOBN(0x1541c7c1, 0x501de503), - TOBN(0x4daac9fa, 0xf4acfade), TOBN(0x0e585897, 0x44cd0b71), - TOBN(0x544fd869, 0x0a51cd77), TOBN(0x60fc20ed, 0x0031016d), - TOBN(0x58b404ec, 0xa4276867), TOBN(0x46f6c3cc, 0x34f34993), - TOBN(0x477ca007, 0xc636e5bd), TOBN(0x8018f5e5, 0x7c458b47), - TOBN(0xa1202270, 0xe47b668f), TOBN(0xcef48ccd, 0xee14f203), - TOBN(0x23f98bae, 0x62ff9b4d), TOBN(0x55acc035, 0xc589eddd), - TOBN(0x3fe712af, 0x64db4444), TOBN(0x19e9d634, 0xbecdd480), - TOBN(0xe08bc047, 0xa930978a), TOBN(0x2dbf24ec, 0xa1280733), - TOBN(0x3c0ae38c, 0x2cd706b2), TOBN(0x5b012a5b, 0x359017b9), - TOBN(0x3943c38c, 0x72e0f5ae), TOBN(0x786167ea, 0x57176fa3), - TOBN(0xe5f9897d, 0x594881dc), TOBN(0x6b5efad8, 0xcfb820c1), - TOBN(0xb2179093, 0xd55018de), TOBN(0x39ad7d32, 0x0bac56ce), - TOBN(0xb55122e0, 0x2cfc0e81), TOBN(0x117c4661, 0xf6d89daa), - TOBN(0x362d01e1, 0xcb64fa09), TOBN(0x6a309b4e, 0x3e9c4ddd), - TOBN(0xfa979fb7, 0xabea49b1), TOBN(0xb4b1d27d, 0x10e2c6c5), - TOBN(0xbd61c2c4, 0x23afde7a), TOBN(0xeb6614f8, 0x9786d358), - TOBN(0x4a5d816b, 0x7f6f7459), TOBN(0xe431a44f, 0x09360e7b), - TOBN(0x8c27a032, 0xc309914c), TOBN(0xcea5d68a, 0xcaede3d8), - TOBN(0x3668f665, 0x3a0a3f95), TOBN(0x89369416, 0x7ceba27b), - TOBN(0x89981fad, 0xe4728fe9), TOBN(0x7102c8a0, 0x8a093562), - TOBN(0xbb80310e, 0x235d21c8), TOBN(0x505e55d1, 0xbefb7f7b), - TOBN(0xa0a90811, 0x12958a67), TOBN(0xd67e106a, 0x4d851fef), - TOBN(0xb84011a9, 0x431dd80e), TOBN(0xeb7c7cca, 0x73306cd9), - TOBN(0x20fadd29, 0xd1b3b730), TOBN(0x83858b5b, 0xfe37b3d3), - TOBN(0xbf4cd193, 0xb6251d5c), TOBN(0x1cca1fd3, 0x1352d952), - TOBN(0xc66157a4, 0x90fbc051), TOBN(0x7990a638, 0x89b98636)}, - {TOBN(0xe5aa692a, 0x87dec0e1), TOBN(0x010ded8d, 0xf7b39d00), - TOBN(0x7b1b80c8, 0x54cfa0b5), TOBN(0x66beb876, 0xa0f8ea28), - TOBN(0x50d7f531, 0x3476cd0e), TOBN(0xa63d0e65, 0xb08d3949), - TOBN(0x1a09eea9, 0x53479fc6), TOBN(0x82ae9891, 0xf499e742), - TOBN(0xab58b910, 0x5ca7d866), TOBN(0x582967e2, 0x3adb3b34), - TOBN(0x89ae4447, 0xcceac0bc), TOBN(0x919c667c, 0x7bf56af5), - TOBN(0x9aec17b1, 0x60f5dcd7), TOBN(0xec697b9f, 0xddcaadbc), - TOBN(0x0b98f341, 0x463467f5), TOBN(0xb187f1f7, 0xa967132f), - TOBN(0x90fe7a1d, 0x214aeb18), TOBN(0x1506af3c, 0x741432f7), - TOBN(0xbb5565f9, 0xe591a0c4), TOBN(0x10d41a77, 0xb44f1bc3), - TOBN(0xa09d65e4, 0xa84bde96), TOBN(0x42f060d8, 0xf20a6a1c), - TOBN(0x652a3bfd, 0xf27f9ce7), TOBN(0xb6bdb65c, 0x3b3d739f), - TOBN(0xeb5ddcb6, 0xec7fae9f), TOBN(0x995f2714, 0xefb66e5a), - TOBN(0xdee95d8e, 0x69445d52), TOBN(0x1b6c2d46, 0x09e27620), - TOBN(0x32621c31, 0x8129d716), TOBN(0xb03909f1, 0x0958c1aa), - TOBN(0x8c468ef9, 0x1af4af63), TOBN(0x162c429f, 0xfba5cdf6), - TOBN(0x2f682343, 0x753b9371), TOBN(0x29cab45a, 0x5f1f9cd7), - TOBN(0x571623ab, 0xb245db96), TOBN(0xc507db09, 0x3fd79999), - TOBN(0x4e2ef652, 0xaf036c32), TOBN(0x86f0cc78, 0x05018e5c), - TOBN(0xc10a73d4, 0xab8be350), TOBN(0x6519b397, 0x7e826327), - TOBN(0xe8cb5eef, 0x9c053df7), TOBN(0x8de25b37, 0xb300ea6f), - TOBN(0xdb03fa92, 0xc849cffb), TOBN(0x242e43a7, 0xe84169bb), - TOBN(0xe4fa51f4, 0xdd6f958e), TOBN(0x6925a77f, 0xf4445a8d), - TOBN(0xe6e72a50, 0xe90d8949), TOBN(0xc66648e3, 0x2b1f6390), - TOBN(0xb2ab1957, 0x173e460c), TOBN(0x1bbbce75, 0x30704590), - TOBN(0xc0a90dbd, 0xdb1c7162), TOBN(0x505e399e, 0x15cdd65d), - TOBN(0x68434dcb, 0x57797ab7), TOBN(0x60ad35ba, 0x6a2ca8e8), - TOBN(0x4bfdb1e0, 0xde3336c1), TOBN(0xbbef99eb, 0xd8b39015), - TOBN(0x6c3b96f3, 0x1711ebec), TOBN(0x2da40f1f, 0xce98fdc4), - TOBN(0xb99774d3, 0x57b4411f), TOBN(0x87c8bdf4, 0x15b65bb6), - TOBN(0xda3a89e3, 0xc2eef12d), TOBN(0xde95bb9b, 0x3c7471f3), - TOBN(0x600f225b, 0xd812c594), TOBN(0x54907c5d, 0x2b75a56b), - TOBN(0xa93cc5f0, 0x8db60e35), TOBN(0x743e3cd6, 0xfa833319), - TOBN(0x7dad5c41, 0xf81683c9), TOBN(0x70c1e7d9, 0x9c34107e), - TOBN(0x0edc4a39, 0xa6be0907), TOBN(0x36d47035, 0x86d0b7d3), - TOBN(0x8c76da03, 0x272bfa60), TOBN(0x0b4a07ea, 0x0f08a414), - TOBN(0x699e4d29, 0x45c1dd53), TOBN(0xcadc5898, 0x231debb5), - TOBN(0xdf49fcc7, 0xa77f00e0), TOBN(0x93057bbf, 0xa73e5a0e), - TOBN(0x2f8b7ecd, 0x027a4cd1), TOBN(0x114734b3, 0xc614011a), - TOBN(0xe7a01db7, 0x67677c68), TOBN(0x89d9be5e, 0x7e273f4f), - TOBN(0xd225cb2e, 0x089808ef), TOBN(0xf1f7a27d, 0xd59e4107), - TOBN(0x53afc761, 0x8211b9c9), TOBN(0x0361bc67, 0xe6819159), - TOBN(0x2a865d0b, 0x7f071426), TOBN(0x6a3c1810, 0xe7072567), - TOBN(0x3e3bca1e, 0x0d6bcabd), TOBN(0xa1b02bc1, 0x408591bc), - TOBN(0xe0deee59, 0x31fba239), TOBN(0xf47424d3, 0x98bd91d1), - TOBN(0x0f8886f4, 0x071a3c1d), TOBN(0x3f7d41e8, 0xa819233b), - TOBN(0x708623c2, 0xcf6eb998), TOBN(0x86bb49af, 0x609a287f), - TOBN(0x942bb249, 0x63c90762), TOBN(0x0ef6eea5, 0x55a9654b), - TOBN(0x5f6d2d72, 0x36f5defe), TOBN(0xfa9922dc, 0x56f99176), - TOBN(0x6c8c5ece, 0xf78ce0c7), TOBN(0x7b44589d, 0xbe09b55e), - TOBN(0xe11b3bca, 0x9ea83770), TOBN(0xd7fa2c7f, 0x2ab71547), - TOBN(0x2a3dd6fa, 0x2a1ddcc0), TOBN(0x09acb430, 0x5a7b7707), - TOBN(0x4add4a2e, 0x649d4e57), TOBN(0xcd53a2b0, 0x1917526e), - TOBN(0xc5262330, 0x20b44ac4), TOBN(0x4028746a, 0xbaa2c31d), - TOBN(0x51318390, 0x64291d4c), TOBN(0xbf48f151, 0xee5ad909), - TOBN(0xcce57f59, 0x7b185681), TOBN(0x7c3ac1b0, 0x4854d442), - TOBN(0x65587dc3, 0xc093c171), TOBN(0xae7acb24, 0x24f42b65), - TOBN(0x5a338adb, 0x955996cb), TOBN(0xc8e65675, 0x6051f91b), - TOBN(0x66711fba, 0x28b8d0b1), TOBN(0x15d74137, 0xb6c10a90), - TOBN(0x70cdd7eb, 0x3a232a80), TOBN(0xc9e2f07f, 0x6191ed24), - TOBN(0xa80d1db6, 0xf79588c0), TOBN(0xfa52fc69, 0xb55768cc), - TOBN(0x0b4df1ae, 0x7f54438a), TOBN(0x0cadd1a7, 0xf9b46a4f), - TOBN(0xb40ea6b3, 0x1803dd6f), TOBN(0x488e4fa5, 0x55eaae35), - TOBN(0x9f047d55, 0x382e4e16), TOBN(0xc9b5b7e0, 0x2f6e0c98), - TOBN(0x6b1bd2d3, 0x95762649), TOBN(0xa9604ee7, 0xc7aea3f6), - TOBN(0x3646ff27, 0x6dc6f896), TOBN(0x9bf0e7f5, 0x2860bad1), - TOBN(0x2d92c821, 0x7cb44b92), TOBN(0xa2f5ce63, 0xaea9c182), - TOBN(0xd0a2afb1, 0x9154a5fd), TOBN(0x482e474c, 0x95801da6), - TOBN(0xc19972d0, 0xb611c24b), TOBN(0x1d468e65, 0x60a8f351), - TOBN(0xeb758069, 0x7bcf6421), TOBN(0xec9dd0ee, 0x88fbc491), - TOBN(0x5b59d2bf, 0x956c2e32), TOBN(0x73dc6864, 0xdcddf94e), - TOBN(0xfd5e2321, 0xbcee7665), TOBN(0xa7b4f8ef, 0x5e9a06c4), - TOBN(0xfba918dd, 0x7280f855), TOBN(0xbbaac260, 0x8baec688), - TOBN(0xa3b3f00f, 0x33400f42), TOBN(0x3d2dba29, 0x66f2e6e4), - TOBN(0xb6f71a94, 0x98509375), TOBN(0x8f33031f, 0xcea423cc), - TOBN(0x009b8dd0, 0x4807e6fb), TOBN(0x5163cfe5, 0x5cdb954c), - TOBN(0x03cc8f17, 0xcf41c6e8), TOBN(0xf1f03c2a, 0x037b925c), - TOBN(0xc39c19cc, 0x66d2427c), TOBN(0x823d24ba, 0x7b6c18e4), - TOBN(0x32ef9013, 0x901f0b4f), TOBN(0x684360f1, 0xf8941c2e), - TOBN(0x0ebaff52, 0x2c28092e), TOBN(0x7891e4e3, 0x256c932f), - TOBN(0x51264319, 0xac445e3d), TOBN(0x553432e7, 0x8ea74381), - TOBN(0xe6eeaa69, 0x67e9c50a), TOBN(0x27ced284, 0x62e628c7), - TOBN(0x3f96d375, 0x7a4afa57), TOBN(0xde0a14c3, 0xe484c150), - TOBN(0x364a24eb, 0x38bd9923), TOBN(0x1df18da0, 0xe5177422), - TOBN(0x174e8f82, 0xd8d38a9b), TOBN(0x2e97c600, 0xe7de1391), - TOBN(0xc5709850, 0xa1c175dd), TOBN(0x969041a0, 0x32ae5035), - TOBN(0xcbfd533b, 0x76a2086b), TOBN(0xd6bba71b, 0xd7c2e8fe), - TOBN(0xb2d58ee6, 0x099dfb67), TOBN(0x3a8b342d, 0x064a85d9), - TOBN(0x3bc07649, 0x522f9be3), TOBN(0x690c075b, 0xdf1f49a8), - TOBN(0x80e1aee8, 0x3854ec42), TOBN(0x2a7dbf44, 0x17689dc7), - TOBN(0xc004fc0e, 0x3faf4078), TOBN(0xb2f02e9e, 0xdf11862c), - TOBN(0xf10a5e0f, 0xa0a1b7b3), TOBN(0x30aca623, 0x8936ec80), - TOBN(0xf83cbf05, 0x02f40d9a), TOBN(0x4681c468, 0x2c318a4d), - TOBN(0x98575618, 0x0e9c2674), TOBN(0xbe79d046, 0x1847092e), - TOBN(0xaf1e480a, 0x78bd01e0), TOBN(0x6dd359e4, 0x72a51db9), - TOBN(0x62ce3821, 0xe3afbab6), TOBN(0xc5cee5b6, 0x17733199), - TOBN(0xe08b30d4, 0x6ffd9fbb), TOBN(0x6e5bc699, 0x36c610b7), - TOBN(0xf343cff2, 0x9ce262cf), TOBN(0xca2e4e35, 0x68b914c1), - TOBN(0x011d64c0, 0x16de36c5), TOBN(0xe0b10fdd, 0x42e2b829), - TOBN(0x78942981, 0x6685aaf8), TOBN(0xe7511708, 0x230ede97), - TOBN(0x671ed8fc, 0x3b922bf8), TOBN(0xe4d8c0a0, 0x4c29b133), - TOBN(0x87eb1239, 0x3b6e99c4), TOBN(0xaff3974c, 0x8793beba), - TOBN(0x03749405, 0x2c18df9b), TOBN(0xc5c3a293, 0x91007139), - TOBN(0x6a77234f, 0xe37a0b95), TOBN(0x02c29a21, 0xb661c96b), - TOBN(0xc3aaf1d6, 0x141ecf61), TOBN(0x9195509e, 0x3bb22f53), - TOBN(0x29597404, 0x22d51357), TOBN(0x1b083822, 0x537bed60), - TOBN(0xcd7d6e35, 0xe07289f0), TOBN(0x1f94c48c, 0x6dd86eff), - TOBN(0xc8bb1f82, 0xeb0f9cfa), TOBN(0x9ee0b7e6, 0x1b2eb97d), - TOBN(0x5a52fe2e, 0x34d74e31), TOBN(0xa352c310, 0x3bf79ab6), - TOBN(0x97ff6c5a, 0xabfeeb8f), TOBN(0xbfbe8fef, 0xf5c97305), - TOBN(0xd6081ce6, 0xa7904608), TOBN(0x1f812f3a, 0xc4fca249), - TOBN(0x9b24bc9a, 0xb9e5e200), TOBN(0x91022c67, 0x38012ee8), - TOBN(0xe83d9c5d, 0x30a713a1), TOBN(0x4876e3f0, 0x84ef0f93), - TOBN(0xc9777029, 0xc1fbf928), TOBN(0xef7a6bb3, 0xbce7d2a4), - TOBN(0xb8067228, 0xdfa2a659), TOBN(0xd5cd3398, 0xd877a48f), - TOBN(0xbea4fd8f, 0x025d0f3f), TOBN(0xd67d2e35, 0x2eae7c2b), - TOBN(0x184de7d7, 0xcc5f4394), TOBN(0xb5551b5c, 0x4536e142), - TOBN(0x2e89b212, 0xd34aa60a), TOBN(0x14a96fea, 0xf50051d5), - TOBN(0x4e21ef74, 0x0d12bb0b), TOBN(0xc522f020, 0x60b9677e), - TOBN(0x8b12e467, 0x2df7731d), TOBN(0x39f80382, 0x7b326d31), - TOBN(0xdfb8630c, 0x39024a94), TOBN(0xaacb96a8, 0x97319452), - TOBN(0xd68a3961, 0xeda3867c), TOBN(0x0c58e2b0, 0x77c4ffca), - TOBN(0x3d545d63, 0x4da919fa), TOBN(0xef79b69a, 0xf15e2289), - TOBN(0x54bc3d3d, 0x808bab10), TOBN(0xc8ab3007, 0x45f82c37), - TOBN(0xc12738b6, 0x7c4a658a), TOBN(0xb3c47639, 0x40e72182), - TOBN(0x3b77be46, 0x8798e44f), TOBN(0xdc047df2, 0x17a7f85f), - TOBN(0x2439d4c5, 0x5e59d92d), TOBN(0xcedca475, 0xe8e64d8d), - TOBN(0xa724cd0d, 0x87ca9b16), TOBN(0x35e4fd59, 0xa5540dfe), - TOBN(0xf8c1ff18, 0xe4bcf6b1), TOBN(0x856d6285, 0x295018fa), - TOBN(0x433f665c, 0x3263c949), TOBN(0xa6a76dd6, 0xa1f21409), - TOBN(0x17d32334, 0xcc7b4f79), TOBN(0xa1d03122, 0x06720e4a), - TOBN(0xadb6661d, 0x81d9bed5), TOBN(0xf0d6fb02, 0x11db15d1), - TOBN(0x7fd11ad5, 0x1fb747d2), TOBN(0xab50f959, 0x3033762b), - TOBN(0x2a7e711b, 0xfbefaf5a), TOBN(0xc7393278, 0x3fef2bbf), - TOBN(0xe29fa244, 0x0df6f9be), TOBN(0x9092757b, 0x71efd215), - TOBN(0xee60e311, 0x4f3d6fd9), TOBN(0x338542d4, 0x0acfb78b), - TOBN(0x44a23f08, 0x38961a0f), TOBN(0x1426eade, 0x986987ca), - TOBN(0x36e6ee2e, 0x4a863cc6), TOBN(0x48059420, 0x628b8b79), - TOBN(0x30303ad8, 0x7396e1de), TOBN(0x5c8bdc48, 0x38c5aad1), - TOBN(0x3e40e11f, 0x5c8f5066), TOBN(0xabd6e768, 0x8d246bbd), - TOBN(0x68aa40bb, 0x23330a01), TOBN(0xd23f5ee4, 0xc34eafa0), - TOBN(0x3bbee315, 0x5de02c21), TOBN(0x18dd4397, 0xd1d8dd06), - TOBN(0x3ba1939a, 0x122d7b44), TOBN(0xe6d3b40a, 0xa33870d6), - TOBN(0x8e620f70, 0x1c4fe3f8), TOBN(0xf6bba1a5, 0xd3a50cbf), - TOBN(0x4a78bde5, 0xcfc0aee0), TOBN(0x847edc46, 0xc08c50bd), - TOBN(0xbaa2439c, 0xad63c9b2), TOBN(0xceb4a728, 0x10fc2acb), - TOBN(0xa419e40e, 0x26da033d), TOBN(0x6cc3889d, 0x03e02683), - TOBN(0x1cd28559, 0xfdccf725), TOBN(0x0fd7e0f1, 0x8d13d208), - TOBN(0x01b9733b, 0x1f0df9d4), TOBN(0x8cc2c5f3, 0xa2b5e4f3), - TOBN(0x43053bfa, 0x3a304fd4), TOBN(0x8e87665c, 0x0a9f1aa7), - TOBN(0x087f29ec, 0xd73dc965), TOBN(0x15ace455, 0x3e9023db), - TOBN(0x2370e309, 0x2bce28b4), TOBN(0xf9723442, 0xb6b1e84a), - TOBN(0xbeee662e, 0xb72d9f26), TOBN(0xb19396de, 0xf0e47109), - TOBN(0x85b1fa73, 0xe13289d0), TOBN(0x436cf77e, 0x54e58e32), - TOBN(0x0ec833b3, 0xe990ef77), TOBN(0x7373e3ed, 0x1b11fc25), - TOBN(0xbe0eda87, 0x0fc332ce), TOBN(0xced04970, 0x8d7ea856), - TOBN(0xf85ff785, 0x7e977ca0), TOBN(0xb66ee8da, 0xdfdd5d2b), - TOBN(0xf5e37950, 0x905af461), TOBN(0x587b9090, 0x966d487c), - TOBN(0x6a198a1b, 0x32ba0127), TOBN(0xa7720e07, 0x141615ac), - TOBN(0xa23f3499, 0x996ef2f2), TOBN(0xef5f64b4, 0x470bcb3d), - TOBN(0xa526a962, 0x92b8c559), TOBN(0x0c14aac0, 0x69740a0f), - TOBN(0x0d41a9e3, 0xa6bdc0a5), TOBN(0x97d52106, 0x9c48aef4), - TOBN(0xcf16bd30, 0x3e7c253b), TOBN(0xcc834b1a, 0x47fdedc1), - TOBN(0x7362c6e5, 0x373aab2e), TOBN(0x264ed85e, 0xc5f590ff), - TOBN(0x7a46d9c0, 0x66d41870), TOBN(0xa50c20b1, 0x4787ba09), - TOBN(0x185e7e51, 0xe3d44635), TOBN(0xb3b3e080, 0x31e2d8dc), - TOBN(0xbed1e558, 0xa179e9d9), TOBN(0x2daa3f79, 0x74a76781), - TOBN(0x4372baf2, 0x3a40864f), TOBN(0x46900c54, 0x4fe75cb5), - TOBN(0xb95f171e, 0xf76765d0), TOBN(0x4ad726d2, 0x95c87502), - TOBN(0x2ec769da, 0x4d7c99bd), TOBN(0x5e2ddd19, 0xc36cdfa8), - TOBN(0xc22117fc, 0xa93e6dea), TOBN(0xe8a2583b, 0x93771123), - TOBN(0xbe2f6089, 0xfa08a3a2), TOBN(0x4809d5ed, 0x8f0e1112), - TOBN(0x3b414aa3, 0xda7a095e), TOBN(0x9049acf1, 0x26f5aadd), - TOBN(0x78d46a4d, 0x6be8b84a), TOBN(0xd66b1963, 0xb732b9b3), - TOBN(0x5c2ac2a0, 0xde6e9555), TOBN(0xcf52d098, 0xb5bd8770), - TOBN(0x15a15fa6, 0x0fd28921), TOBN(0x56ccb81e, 0x8b27536d), - TOBN(0x0f0d8ab8, 0x9f4ccbb8), TOBN(0xed5f44d2, 0xdb221729), - TOBN(0x43141988, 0x00bed10c), TOBN(0xc94348a4, 0x1d735b8b), - TOBN(0x79f3e9c4, 0x29ef8479), TOBN(0x4c13a4e3, 0x614c693f), - TOBN(0x32c9af56, 0x8e143a14), TOBN(0xbc517799, 0xe29ac5c4), - TOBN(0x05e17992, 0x2774856f), TOBN(0x6e52fb05, 0x6c1bf55f), - TOBN(0xaeda4225, 0xe4f19e16), TOBN(0x70f4728a, 0xaf5ccb26), - TOBN(0x5d2118d1, 0xb2947f22), TOBN(0xc827ea16, 0x281d6fb9), - TOBN(0x8412328d, 0x8cf0eabd), TOBN(0x45ee9fb2, 0x03ef9dcf), - TOBN(0x8e700421, 0xbb937d63), TOBN(0xdf8ff2d5, 0xcc4b37a6), - TOBN(0xa4c0d5b2, 0x5ced7b68), TOBN(0x6537c1ef, 0xc7308f59), - TOBN(0x25ce6a26, 0x3b37f8e8), TOBN(0x170e9a9b, 0xdeebc6ce), - TOBN(0xdd037952, 0x8728d72c), TOBN(0x445b0e55, 0x850154bc), - TOBN(0x4b7d0e06, 0x83a7337b), TOBN(0x1e3416d4, 0xffecf249), - TOBN(0x24840eff, 0x66a2b71f), TOBN(0xd0d9a50a, 0xb37cc26d), - TOBN(0xe2198150, 0x6fe28ef7), TOBN(0x3cc5ef16, 0x23324c7f), - TOBN(0x220f3455, 0x769b5263), TOBN(0xe2ade2f1, 0xa10bf475), - TOBN(0x28cd20fa, 0x458d3671), TOBN(0x1549722c, 0x2dc4847b), - TOBN(0x6dd01e55, 0x591941e3), TOBN(0x0e6fbcea, 0x27128ccb), - TOBN(0xae1a1e6b, 0x3bef0262), TOBN(0xfa8c472c, 0x8f54e103), - TOBN(0x7539c0a8, 0x72c052ec), TOBN(0xd7b27369, 0x5a3490e9), - TOBN(0x143fe1f1, 0x71684349), TOBN(0x36b4722e, 0x32e19b97), - TOBN(0xdc059227, 0x90980aff), TOBN(0x175c9c88, 0x9e13d674), - TOBN(0xa7de5b22, 0x6e6bfdb1), TOBN(0x5ea5b7b2, 0xbedb4b46), - TOBN(0xd5570191, 0xd34a6e44), TOBN(0xfcf60d2e, 0xa24ff7e6), - TOBN(0x614a392d, 0x677819e1), TOBN(0x7be74c7e, 0xaa5a29e8), - TOBN(0xab50fece, 0x63c85f3f), TOBN(0xaca2e2a9, 0x46cab337), - TOBN(0x7f700388, 0x122a6fe3), TOBN(0xdb69f703, 0x882a04a8), - TOBN(0x9a77935d, 0xcf7aed57), TOBN(0xdf16207c, 0x8d91c86f), - TOBN(0x2fca49ab, 0x63ed9998), TOBN(0xa3125c44, 0xa77ddf96), - TOBN(0x05dd8a86, 0x24344072), TOBN(0xa023dda2, 0xfec3fb56), - TOBN(0x421b41fc, 0x0c743032), TOBN(0x4f2120c1, 0x5e438639), - TOBN(0xfb7cae51, 0xc83c1b07), TOBN(0xb2370caa, 0xcac2171a), - TOBN(0x2eb2d962, 0x6cc820fb), TOBN(0x59feee5c, 0xb85a44bf), - TOBN(0x94620fca, 0x5b6598f0), TOBN(0x6b922cae, 0x7e314051), - TOBN(0xff8745ad, 0x106bed4e), TOBN(0x546e71f5, 0xdfa1e9ab), - TOBN(0x935c1e48, 0x1ec29487), TOBN(0x9509216c, 0x4d936530), - TOBN(0xc7ca3067, 0x85c9a2db), TOBN(0xd6ae5152, 0x6be8606f), - TOBN(0x09dbcae6, 0xe14c651d), TOBN(0xc9536e23, 0x9bc32f96), - TOBN(0xa90535a9, 0x34521b03), TOBN(0xf39c526c, 0x878756ff), - TOBN(0x383172ec, 0x8aedf03c), TOBN(0x20a8075e, 0xefe0c034), - TOBN(0xf22f9c62, 0x64026422), TOBN(0x8dd10780, 0x24b9d076), - TOBN(0x944c742a, 0x3bef2950), TOBN(0x55b9502e, 0x88a2b00b), - TOBN(0xa59e14b4, 0x86a09817), TOBN(0xa39dd3ac, 0x47bb4071), - TOBN(0x55137f66, 0x3be0592f), TOBN(0x07fcafd4, 0xc9e63f5b), - TOBN(0x963652ee, 0x346eb226), TOBN(0x7dfab085, 0xec2facb7), - TOBN(0x273bf2b8, 0x691add26), TOBN(0x30d74540, 0xf2b46c44), - TOBN(0x05e8e73e, 0xf2c2d065), TOBN(0xff9b8a00, 0xd42eeac9), - TOBN(0x2fcbd205, 0x97209d22), TOBN(0xeb740ffa, 0xde14ea2c), - TOBN(0xc71ff913, 0xa8aef518), TOBN(0x7bfc74bb, 0xfff4cfa2), - TOBN(0x1716680c, 0xb6b36048), TOBN(0x121b2cce, 0x9ef79af1), - TOBN(0xbff3c836, 0xa01eb3d3), TOBN(0x50eb1c6a, 0x5f79077b), - TOBN(0xa48c32d6, 0xa004bbcf), TOBN(0x47a59316, 0x7d64f61d), - TOBN(0x6068147f, 0x93102016), TOBN(0x12c5f654, 0x94d12576), - TOBN(0xefb071a7, 0xc9bc6b91), TOBN(0x7c2da0c5, 0x6e23ea95), - TOBN(0xf4fd45b6, 0xd4a1dd5d), TOBN(0x3e7ad9b6, 0x9122b13c), - TOBN(0x342ca118, 0xe6f57a48), TOBN(0x1c2e94a7, 0x06f8288f), - TOBN(0x99e68f07, 0x5a97d231), TOBN(0x7c80de97, 0x4d838758), - TOBN(0xbce0f5d0, 0x05872727), TOBN(0xbe5d95c2, 0x19c4d016), - TOBN(0x921d5cb1, 0x9c2492ee), TOBN(0x42192dc1, 0x404d6fb3), - TOBN(0x4c84dcd1, 0x32f988d3), TOBN(0xde26d61f, 0xa17b8e85), - TOBN(0xc466dcb6, 0x137c7408), TOBN(0x9a38d7b6, 0x36a266da), - TOBN(0x7ef5cb06, 0x83bebf1b), TOBN(0xe5cdcbbf, 0x0fd014e3), - TOBN(0x30aa376d, 0xf65965a0), TOBN(0x60fe88c2, 0xebb3e95e), - TOBN(0x33fd0b61, 0x66ee6f20), TOBN(0x8827dcdb, 0x3f41f0a0), - TOBN(0xbf8a9d24, 0x0c56c690), TOBN(0x40265dad, 0xddb7641d), - TOBN(0x522b05bf, 0x3a6b662b), TOBN(0x466d1dfe, 0xb1478c9b), - TOBN(0xaa616962, 0x1484469b), TOBN(0x0db60549, 0x02df8f9f), - TOBN(0xc37bca02, 0x3cb8bf51), TOBN(0x5effe346, 0x21371ce8), - TOBN(0xe8f65264, 0xff112c32), TOBN(0x8a9c736d, 0x7b971fb2), - TOBN(0xa4f19470, 0x7b75080d), TOBN(0xfc3f2c5a, 0x8839c59b), - TOBN(0x1d6c777e, 0x5aeb49c2), TOBN(0xf3db034d, 0xda1addfe), - TOBN(0xd76fee5a, 0x5535affc), TOBN(0x0853ac70, 0xb92251fd), - TOBN(0x37e3d594, 0x8b2a29d5), TOBN(0x28f1f457, 0x4de00ddb), - TOBN(0x8083c1b5, 0xf42c328b), TOBN(0xd8ef1d8f, 0xe493c73b), - TOBN(0x96fb6260, 0x41dc61bd), TOBN(0xf74e8a9d, 0x27ee2f8a), - TOBN(0x7c605a80, 0x2c946a5d), TOBN(0xeed48d65, 0x3839ccfd), - TOBN(0x9894344f, 0x3a29467a), TOBN(0xde81e949, 0xc51eba6d), - TOBN(0xdaea066b, 0xa5e5c2f2), TOBN(0x3fc8a614, 0x08c8c7b3), - TOBN(0x7adff88f, 0x06d0de9f), TOBN(0xbbc11cf5, 0x3b75ce0a), - TOBN(0x9fbb7acc, 0xfbbc87d5), TOBN(0xa1458e26, 0x7badfde2)}, - {TOBN(0x1cb43668, 0xe039c256), TOBN(0x5f26fb8b, 0x7c17fd5d), - TOBN(0xeee426af, 0x79aa062b), TOBN(0x072002d0, 0xd78fbf04), - TOBN(0x4c9ca237, 0xe84fb7e3), TOBN(0xb401d8a1, 0x0c82133d), - TOBN(0xaaa52592, 0x6d7e4181), TOBN(0xe9430833, 0x73dbb152), - TOBN(0xf92dda31, 0xbe24319a), TOBN(0x03f7d28b, 0xe095a8e7), - TOBN(0xa52fe840, 0x98782185), TOBN(0x276ddafe, 0x29c24dbc), - TOBN(0x80cd5496, 0x1d7a64eb), TOBN(0xe4360889, 0x7f1dbe42), - TOBN(0x2f81a877, 0x8438d2d5), TOBN(0x7e4d52a8, 0x85169036), - TOBN(0x19e3d5b1, 0x1d59715d), TOBN(0xc7eaa762, 0xd788983e), - TOBN(0xe5a730b0, 0xabf1f248), TOBN(0xfbab8084, 0xfae3fd83), - TOBN(0x65e50d21, 0x53765b2f), TOBN(0xbdd4e083, 0xfa127f3d), - TOBN(0x9cf3c074, 0x397b1b10), TOBN(0x59f8090c, 0xb1b59fd3), - TOBN(0x7b15fd9d, 0x615faa8f), TOBN(0x8fa1eb40, 0x968554ed), - TOBN(0x7bb4447e, 0x7aa44882), TOBN(0x2bb2d0d1, 0x029fff32), - TOBN(0x075e2a64, 0x6caa6d2f), TOBN(0x8eb879de, 0x22e7351b), - TOBN(0xbcd5624e, 0x9a506c62), TOBN(0x218eaef0, 0xa87e24dc), - TOBN(0x37e56847, 0x44ddfa35), TOBN(0x9ccfc5c5, 0xdab3f747), - TOBN(0x9ac1df3f, 0x1ee96cf4), TOBN(0x0c0571a1, 0x3b480b8f), - TOBN(0x2fbeb3d5, 0x4b3a7b3c), TOBN(0x35c03669, 0x5dcdbb99), - TOBN(0x52a0f5dc, 0xb2415b3a), TOBN(0xd57759b4, 0x4413ed9a), - TOBN(0x1fe647d8, 0x3d30a2c5), TOBN(0x0857f77e, 0xf78a81dc), - TOBN(0x11d5a334, 0x131a4a9b), TOBN(0xc0a94af9, 0x29d393f5), - TOBN(0xbc3a5c0b, 0xdaa6ec1a), TOBN(0xba9fe493, 0x88d2d7ed), - TOBN(0xbb4335b4, 0xbb614797), TOBN(0x991c4d68, 0x72f83533), - TOBN(0x53258c28, 0xd2f01cb3), TOBN(0x93d6eaa3, 0xd75db0b1), - TOBN(0x419a2b0d, 0xe87d0db4), TOBN(0xa1e48f03, 0xd8fe8493), - TOBN(0xf747faf6, 0xc508b23a), TOBN(0xf137571a, 0x35d53549), - TOBN(0x9f5e58e2, 0xfcf9b838), TOBN(0xc7186cee, 0xa7fd3cf5), - TOBN(0x77b868ce, 0xe978a1d3), TOBN(0xe3a68b33, 0x7ab92d04), - TOBN(0x51029794, 0x87a5b862), TOBN(0x5f0606c3, 0x3a61d41d), - TOBN(0x2814be27, 0x6f9326f1), TOBN(0x2f521c14, 0xc6fe3c2e), - TOBN(0x17464d7d, 0xacdf7351), TOBN(0x10f5f9d3, 0x777f7e44), - TOBN(0xce8e616b, 0x269fb37d), TOBN(0xaaf73804, 0x7de62de5), - TOBN(0xaba11175, 0x4fdd4153), TOBN(0x515759ba, 0x3770b49b), - TOBN(0x8b09ebf8, 0xaa423a61), TOBN(0x592245a1, 0xcd41fb92), - TOBN(0x1cba8ec1, 0x9b4c8936), TOBN(0xa87e91e3, 0xaf36710e), - TOBN(0x1fd84ce4, 0x3d34a2e3), TOBN(0xee3759ce, 0xb43b5d61), - TOBN(0x895bc78c, 0x619186c7), TOBN(0xf19c3809, 0xcbb9725a), - TOBN(0xc0be21aa, 0xde744b1f), TOBN(0xa7d222b0, 0x60f8056b), - TOBN(0x74be6157, 0xb23efe11), TOBN(0x6fab2b4f, 0x0cd68253), - TOBN(0xad33ea5f, 0x4bf1d725), TOBN(0x9c1d8ee2, 0x4f6c950f), - TOBN(0x544ee78a, 0xa377af06), TOBN(0x54f489bb, 0x94a113e1), - TOBN(0x8f11d634, 0x992fb7e8), TOBN(0x0169a7aa, 0xa2a44347), - TOBN(0x1d49d4af, 0x95020e00), TOBN(0x95945722, 0xe08e120b), - TOBN(0xb6e33878, 0xa4d32282), TOBN(0xe36e029d, 0x48020ae7), - TOBN(0xe05847fb, 0x37a9b750), TOBN(0xf876812c, 0xb29e3819), - TOBN(0x84ad138e, 0xd23a17f0), TOBN(0x6d7b4480, 0xf0b3950e), - TOBN(0xdfa8aef4, 0x2fd67ae0), TOBN(0x8d3eea24, 0x52333af6), - TOBN(0x0d052075, 0xb15d5acc), TOBN(0xc6d9c79f, 0xbd815bc4), - TOBN(0x8dcafd88, 0xdfa36cf2), TOBN(0x908ccbe2, 0x38aa9070), - TOBN(0x638722c4, 0xba35afce), TOBN(0x5a3da8b0, 0xfd6abf0b), - TOBN(0x2dce252c, 0xc9c335c1), TOBN(0x84e7f0de, 0x65aa799b), - TOBN(0x2101a522, 0xb99a72cb), TOBN(0x06de6e67, 0x87618016), - TOBN(0x5ff8c7cd, 0xe6f3653e), TOBN(0x0a821ab5, 0xc7a6754a), - TOBN(0x7e3fa52b, 0x7cb0b5a2), TOBN(0xa7fb121c, 0xc9048790), - TOBN(0x1a725020, 0x06ce053a), TOBN(0xb490a31f, 0x04e929b0), - TOBN(0xe17be47d, 0x62dd61ad), TOBN(0x781a961c, 0x6be01371), - TOBN(0x1063bfd3, 0xdae3cbba), TOBN(0x35647406, 0x7f73c9ba), - TOBN(0xf50e957b, 0x2736a129), TOBN(0xa6313702, 0xed13f256), - TOBN(0x9436ee65, 0x3a19fcc5), TOBN(0xcf2bdb29, 0xe7a4c8b6), - TOBN(0xb06b1244, 0xc5f95cd8), TOBN(0xda8c8af0, 0xf4ab95f4), - TOBN(0x1bae59c2, 0xb9e5836d), TOBN(0x07d51e7e, 0x3acffffc), - TOBN(0x01e15e6a, 0xc2ccbcda), TOBN(0x3bc1923f, 0x8528c3e0), - TOBN(0x43324577, 0xa49fead4), TOBN(0x61a1b884, 0x2aa7a711), - TOBN(0xf9a86e08, 0x700230ef), TOBN(0x0af585a1, 0xbd19adf8), - TOBN(0x7645f361, 0xf55ad8f2), TOBN(0x6e676223, 0x46c3614c), - TOBN(0x23cb257c, 0x4e774d3f), TOBN(0x82a38513, 0xac102d1b), - TOBN(0x9bcddd88, 0x7b126aa5), TOBN(0xe716998b, 0xeefd3ee4), - TOBN(0x4239d571, 0xfb167583), TOBN(0xdd011c78, 0xd16c8f8a), - TOBN(0x271c2895, 0x69a27519), TOBN(0x9ce0a3b7, 0xd2d64b6a), - TOBN(0x8c977289, 0xd5ec6738), TOBN(0xa3b49f9a, 0x8840ef6b), - TOBN(0x808c14c9, 0x9a453419), TOBN(0x5c00295b, 0x0cf0a2d5), - TOBN(0x524414fb, 0x1d4bcc76), TOBN(0xb07691d2, 0x459a88f1), - TOBN(0x77f43263, 0xf70d110f), TOBN(0x64ada5e0, 0xb7abf9f3), - TOBN(0xafd0f94e, 0x5b544cf5), TOBN(0xb4a13a15, 0xfd2713fe), - TOBN(0xb99b7d6e, 0x250c74f4), TOBN(0x097f2f73, 0x20324e45), - TOBN(0x994b37d8, 0xaffa8208), TOBN(0xc3c31b0b, 0xdc29aafc), - TOBN(0x3da74651, 0x7a3a607f), TOBN(0xd8e1b8c1, 0xfe6955d6), - TOBN(0x716e1815, 0xc8418682), TOBN(0x541d487f, 0x7dc91d97), - TOBN(0x48a04669, 0xc6996982), TOBN(0xf39cab15, 0x83a6502e), - TOBN(0x025801a0, 0xe68db055), TOBN(0xf3569758, 0xba3338d5), - TOBN(0xb0c8c0aa, 0xee2afa84), TOBN(0x4f6985d3, 0xfb6562d1), - TOBN(0x351f1f15, 0x132ed17a), TOBN(0x510ed0b4, 0xc04365fe), - TOBN(0xa3f98138, 0xe5b1f066), TOBN(0xbc9d95d6, 0x32df03dc), - TOBN(0xa83ccf6e, 0x19abd09e), TOBN(0x0b4097c1, 0x4ff17edb), - TOBN(0x58a5c478, 0xd64a06ce), TOBN(0x2ddcc3fd, 0x544a58fd), - TOBN(0xd449503d, 0x9e8153b8), TOBN(0x3324fd02, 0x7774179b), - TOBN(0xaf5d47c8, 0xdbd9120c), TOBN(0xeb860162, 0x34fa94db), - TOBN(0x5817bdd1, 0x972f07f4), TOBN(0xe5579e2e, 0xd27bbceb), - TOBN(0x86847a1f, 0x5f11e5a6), TOBN(0xb39ed255, 0x7c3cf048), - TOBN(0xe1076417, 0xa2f62e55), TOBN(0x6b9ab38f, 0x1bcf82a2), - TOBN(0x4bb7c319, 0x7aeb29f9), TOBN(0xf6d17da3, 0x17227a46), - TOBN(0xab53ddbd, 0x0f968c00), TOBN(0xa03da7ec, 0x000c880b), - TOBN(0x7b239624, 0x6a9ad24d), TOBN(0x612c0401, 0x01ec60d0), - TOBN(0x70d10493, 0x109f5df1), TOBN(0xfbda4030, 0x80af7550), - TOBN(0x30b93f95, 0xc6b9a9b3), TOBN(0x0c74ec71, 0x007d9418), - TOBN(0x94175564, 0x6edb951f), TOBN(0x5f4a9d78, 0x7f22c282), - TOBN(0xb7870895, 0xb38d1196), TOBN(0xbc593df3, 0xa228ce7c), - TOBN(0xc78c5bd4, 0x6af3641a), TOBN(0x7802200b, 0x3d9b3dcc), - TOBN(0x0dc73f32, 0x8be33304), TOBN(0x847ed87d, 0x61ffb79a), - TOBN(0xf85c974e, 0x6d671192), TOBN(0x1e14100a, 0xde16f60f), - TOBN(0x45cb0d5a, 0x95c38797), TOBN(0x18923bba, 0x9b022da4), - TOBN(0xef2be899, 0xbbe7e86e), TOBN(0x4a1510ee, 0x216067bf), - TOBN(0xd98c8154, 0x84d5ce3e), TOBN(0x1af777f0, 0xf92a2b90), - TOBN(0x9fbcb400, 0x4ef65724), TOBN(0x3e04a4c9, 0x3c0ca6fe), - TOBN(0xfb3e2cb5, 0x55002994), TOBN(0x1f3a93c5, 0x5363ecab), - TOBN(0x1fe00efe, 0x3923555b), TOBN(0x744bedd9, 0x1e1751ea), - TOBN(0x3fb2db59, 0x6ab69357), TOBN(0x8dbd7365, 0xf5e6618b), - TOBN(0x99d53099, 0xdf1ea40e), TOBN(0xb3f24a0b, 0x57d61e64), - TOBN(0xd088a198, 0x596eb812), TOBN(0x22c8361b, 0x5762940b), - TOBN(0x66f01f97, 0xf9c0d95c), TOBN(0x88461172, 0x8e43cdae), - TOBN(0x11599a7f, 0xb72b15c3), TOBN(0x135a7536, 0x420d95cc), - TOBN(0x2dcdf0f7, 0x5f7ae2f6), TOBN(0x15fc6e1d, 0xd7fa6da2), - TOBN(0x81ca829a, 0xd1d441b6), TOBN(0x84c10cf8, 0x04a106b6), - TOBN(0xa9b26c95, 0xa73fbbd0), TOBN(0x7f24e0cb, 0x4d8f6ee8), - TOBN(0x48b45937, 0x1e25a043), TOBN(0xf8a74fca, 0x036f3dfe), - TOBN(0x1ed46585, 0xc9f84296), TOBN(0x7fbaa8fb, 0x3bc278b0), - TOBN(0xa8e96cd4, 0x6c4fcbd0), TOBN(0x940a1202, 0x73b60a5f), - TOBN(0x34aae120, 0x55a4aec8), TOBN(0x550e9a74, 0xdbd742f0), - TOBN(0x794456d7, 0x228c68ab), TOBN(0x492f8868, 0xa4e25ec6), - TOBN(0x682915ad, 0xb2d8f398), TOBN(0xf13b51cc, 0x5b84c953), - TOBN(0xcda90ab8, 0x5bb917d6), TOBN(0x4b615560, 0x4ea3dee1), - TOBN(0x578b4e85, 0x0a52c1c8), TOBN(0xeab1a695, 0x20b75fc4), - TOBN(0x60c14f3c, 0xaa0bb3c6), TOBN(0x220f448a, 0xb8216094), - TOBN(0x4fe7ee31, 0xb0e63d34), TOBN(0xf4600572, 0xa9e54fab), - TOBN(0xc0493334, 0xd5e7b5a4), TOBN(0x8589fb92, 0x06d54831), - TOBN(0xaa70f5cc, 0x6583553a), TOBN(0x0879094a, 0xe25649e5), - TOBN(0xcc904507, 0x10044652), TOBN(0xebb0696d, 0x02541c4f), - TOBN(0x5a171fde, 0xb9718710), TOBN(0x38f1bed8, 0xf374a9f5), - TOBN(0xc8c582e1, 0xba39bdc1), TOBN(0xfc457b0a, 0x908cc0ce), - TOBN(0x9a187fd4, 0x883841e2), TOBN(0x8ec25b39, 0x38725381), - TOBN(0x2553ed05, 0x96f84395), TOBN(0x095c7661, 0x6f6c6897), - TOBN(0x917ac85c, 0x4bdc5610), TOBN(0xb2885fe4, 0x179eb301), - TOBN(0x5fc65547, 0x8b78bdcc), TOBN(0x4a9fc893, 0xe59e4699), - TOBN(0xbb7ff0cd, 0x3ce299af), TOBN(0x195be9b3, 0xadf38b20), - TOBN(0x6a929c87, 0xd38ddb8f), TOBN(0x55fcc99c, 0xb21a51b9), - TOBN(0x2b695b4c, 0x721a4593), TOBN(0xed1e9a15, 0x768eaac2), - TOBN(0xfb63d71c, 0x7489f914), TOBN(0xf98ba31c, 0x78118910), - TOBN(0x80291373, 0x9b128eb4), TOBN(0x7801214e, 0xd448af4a), - TOBN(0xdbd2e22b, 0x55418dd3), TOBN(0xeffb3c0d, 0xd3998242), - TOBN(0xdfa6077c, 0xc7bf3827), TOBN(0xf2165bcb, 0x47f8238f), - TOBN(0xfe37cf68, 0x8564d554), TOBN(0xe5f825c4, 0x0a81fb98), - TOBN(0x43cc4f67, 0xffed4d6f), TOBN(0xbc609578, 0xb50a34b0), - TOBN(0x8aa8fcf9, 0x5041faf1), TOBN(0x5659f053, 0x651773b6), - TOBN(0xe87582c3, 0x6044d63b), TOBN(0xa6089409, 0x0cdb0ca0), - TOBN(0x8c993e0f, 0xbfb2bcf6), TOBN(0xfc64a719, 0x45985cfc), - TOBN(0x15c4da80, 0x83dbedba), TOBN(0x804ae112, 0x2be67df7), - TOBN(0xda4c9658, 0xa23defde), TOBN(0x12002ddd, 0x5156e0d3), - TOBN(0xe68eae89, 0x5dd21b96), TOBN(0x8b99f28b, 0xcf44624d), - TOBN(0x0ae00808, 0x1ec8897a), TOBN(0xdd0a9303, 0x6712f76e), - TOBN(0x96237522, 0x4e233de4), TOBN(0x192445b1, 0x2b36a8a5), - TOBN(0xabf9ff74, 0x023993d9), TOBN(0x21f37bf4, 0x2aad4a8f), - TOBN(0x340a4349, 0xf8bd2bbd), TOBN(0x1d902cd9, 0x4868195d), - TOBN(0x3d27bbf1, 0xe5fdb6f1), TOBN(0x7a5ab088, 0x124f9f1c), - TOBN(0xc466ab06, 0xf7a09e03), TOBN(0x2f8a1977, 0x31f2c123), - TOBN(0xda355dc7, 0x041b6657), TOBN(0xcb840d12, 0x8ece2a7c), - TOBN(0xb600ad9f, 0x7db32675), TOBN(0x78fea133, 0x07a06f1b), - TOBN(0x5d032269, 0xb31f6094), TOBN(0x07753ef5, 0x83ec37aa), - TOBN(0x03485aed, 0x9c0bea78), TOBN(0x41bb3989, 0xbc3f4524), - TOBN(0x09403761, 0x697f726d), TOBN(0x6109beb3, 0xdf394820), - TOBN(0x804111ea, 0x3b6d1145), TOBN(0xb6271ea9, 0xa8582654), - TOBN(0x619615e6, 0x24e66562), TOBN(0xa2554945, 0xd7b6ad9c), - TOBN(0xd9c4985e, 0x99bfe35f), TOBN(0x9770ccc0, 0x7b51cdf6), - TOBN(0x7c327013, 0x92881832), TOBN(0x8777d45f, 0x286b26d1), - TOBN(0x9bbeda22, 0xd847999d), TOBN(0x03aa33b6, 0xc3525d32), - TOBN(0x4b7b96d4, 0x28a959a1), TOBN(0xbb3786e5, 0x31e5d234), - TOBN(0xaeb5d3ce, 0x6961f247), TOBN(0x20aa85af, 0x02f93d3f), - TOBN(0x9cd1ad3d, 0xd7a7ae4f), TOBN(0xbf6688f0, 0x781adaa8), - TOBN(0xb1b40e86, 0x7469cead), TOBN(0x1904c524, 0x309fca48), - TOBN(0x9b7312af, 0x4b54bbc7), TOBN(0xbe24bf8f, 0x593affa2), - TOBN(0xbe5e0790, 0xbd98764b), TOBN(0xa0f45f17, 0xa26e299e), - TOBN(0x4af0d2c2, 0x6b8fe4c7), TOBN(0xef170db1, 0x8ae8a3e6), - TOBN(0x0e8d61a0, 0x29e0ccc1), TOBN(0xcd53e87e, 0x60ad36ca), - TOBN(0x328c6623, 0xc8173822), TOBN(0x7ee1767d, 0xa496be55), - TOBN(0x89f13259, 0x648945af), TOBN(0x9e45a5fd, 0x25c8009c), - TOBN(0xaf2febd9, 0x1f61ab8c), TOBN(0x43f6bc86, 0x8a275385), - TOBN(0x87792348, 0xf2142e79), TOBN(0x17d89259, 0xc6e6238a), - TOBN(0x7536d2f6, 0x4a839d9b), TOBN(0x1f428fce, 0x76a1fbdc), - TOBN(0x1c109601, 0x0db06dfe), TOBN(0xbfc16bc1, 0x50a3a3cc), - TOBN(0xf9cbd9ec, 0x9b30f41b), TOBN(0x5b5da0d6, 0x00138cce), - TOBN(0xec1d0a48, 0x56ef96a7), TOBN(0xb47eb848, 0x982bf842), - TOBN(0x66deae32, 0xec3f700d), TOBN(0x4e43c42c, 0xaa1181e0), - TOBN(0xa1d72a31, 0xd1a4aa2a), TOBN(0x440d4668, 0xc004f3ce), - TOBN(0x0d6a2d3b, 0x45fe8a7a), TOBN(0x820e52e2, 0xfb128365), - TOBN(0x29ac5fcf, 0x25e51b09), TOBN(0x180cd2bf, 0x2023d159), - TOBN(0xa9892171, 0xa1ebf90e), TOBN(0xf97c4c87, 0x7c132181), - TOBN(0x9f1dc724, 0xc03dbb7e), TOBN(0xae043765, 0x018cbbe4), - TOBN(0xfb0b2a36, 0x0767d153), TOBN(0xa8e2f4d6, 0x249cbaeb), - TOBN(0x172a5247, 0xd95ea168), TOBN(0x1758fada, 0x2970764a), - TOBN(0xac803a51, 0x1d978169), TOBN(0x299cfe2e, 0xde77e01b), - TOBN(0x652a1e17, 0xb0a98927), TOBN(0x2e26e1d1, 0x20014495), - TOBN(0x7ae0af9f, 0x7175b56a), TOBN(0xc2e22a80, 0xd64b9f95), - TOBN(0x4d0ff9fb, 0xd90a060a), TOBN(0x496a27db, 0xbaf38085), - TOBN(0x32305401, 0xda776bcf), TOBN(0xb8cdcef6, 0x725f209e), - TOBN(0x61ba0f37, 0x436a0bba), TOBN(0x263fa108, 0x76860049), - TOBN(0x92beb98e, 0xda3542cf), TOBN(0xa2d4d14a, 0xd5849538), - TOBN(0x989b9d68, 0x12e9a1bc), TOBN(0x61d9075c, 0x5f6e3268), - TOBN(0x352c6aa9, 0x99ace638), TOBN(0xde4e4a55, 0x920f43ff), - TOBN(0xe5e4144a, 0xd673c017), TOBN(0x667417ae, 0x6f6e05ea), - TOBN(0x613416ae, 0xdcd1bd56), TOBN(0x5eb36201, 0x86693711), - TOBN(0x2d7bc504, 0x3a1aa914), TOBN(0x175a1299, 0x76dc5975), - TOBN(0xe900e0f2, 0x3fc8125c), TOBN(0x569ef68c, 0x11198875), - TOBN(0x9012db63, 0x63a113b4), TOBN(0xe3bd3f56, 0x98835766), - TOBN(0xa5c94a52, 0x76412dea), TOBN(0xad9e2a09, 0xaa735e5c), - TOBN(0x405a984c, 0x508b65e9), TOBN(0xbde4a1d1, 0x6df1a0d1), - TOBN(0x1a9433a1, 0xdfba80da), TOBN(0xe9192ff9, 0x9440ad2e), - TOBN(0x9f649696, 0x5099fe92), TOBN(0x25ddb65c, 0x0b27a54a), - TOBN(0x178279dd, 0xc590da61), TOBN(0x5479a999, 0xfbde681a), - TOBN(0xd0e84e05, 0x013fe162), TOBN(0xbe11dc92, 0x632d471b), - TOBN(0xdf0b0c45, 0xfc0e089f), TOBN(0x04fb15b0, 0x4c144025), - TOBN(0xa61d5fc2, 0x13c99927), TOBN(0xa033e9e0, 0x3de2eb35), - TOBN(0xf8185d5c, 0xb8dacbb4), TOBN(0x9a88e265, 0x8644549d), - TOBN(0xf717af62, 0x54671ff6), TOBN(0x4bd4241b, 0x5fa58603), - TOBN(0x06fba40b, 0xe67773c0), TOBN(0xc1d933d2, 0x6a2847e9), - TOBN(0xf4f5acf3, 0x689e2c70), TOBN(0x92aab0e7, 0x46bafd31), - TOBN(0x798d76aa, 0x3473f6e5), TOBN(0xcc6641db, 0x93141934), - TOBN(0xcae27757, 0xd31e535e), TOBN(0x04cc43b6, 0x87c2ee11), - TOBN(0x8d1f9675, 0x2e029ffa), TOBN(0xc2150672, 0xe4cc7a2c), - TOBN(0x3b03c1e0, 0x8d68b013), TOBN(0xa9d6816f, 0xedf298f3), - TOBN(0x1bfbb529, 0xa2804464), TOBN(0x95a52fae, 0x5db22125), - TOBN(0x55b32160, 0x0e1cb64e), TOBN(0x004828f6, 0x7e7fc9fe), - TOBN(0x13394b82, 0x1bb0fb93), TOBN(0xb6293a2d, 0x35f1a920), - TOBN(0xde35ef21, 0xd145d2d9), TOBN(0xbe6225b3, 0xbb8fa603), - TOBN(0x00fc8f6b, 0x32cf252d), TOBN(0xa28e52e6, 0x117cf8c2), - TOBN(0x9d1dc89b, 0x4c371e6d), TOBN(0xcebe0675, 0x36ef0f28), - TOBN(0x5de05d09, 0xa4292f81), TOBN(0xa8303593, 0x353e3083), - TOBN(0xa1715b0a, 0x7e37a9bb), TOBN(0x8c56f61e, 0x2b8faec3), - TOBN(0x52507431, 0x33c9b102), TOBN(0x0130cefc, 0xa44431f0), - TOBN(0x56039fa0, 0xbd865cfb), TOBN(0x4b03e578, 0xbc5f1dd7), - TOBN(0x40edf2e4, 0xbabe7224), TOBN(0xc752496d, 0x3a1988f6), - TOBN(0xd1572d3b, 0x564beb6b), TOBN(0x0db1d110, 0x39a1c608), - TOBN(0x568d1934, 0x16f60126), TOBN(0x05ae9668, 0xf354af33), - TOBN(0x19de6d37, 0xc92544f2), TOBN(0xcc084353, 0xa35837d5), - TOBN(0xcbb6869c, 0x1a514ece), TOBN(0xb633e728, 0x2e1d1066), - TOBN(0xf15dd69f, 0x936c581c), TOBN(0x96e7b8ce, 0x7439c4f9), - TOBN(0x5e676f48, 0x2e448a5b), TOBN(0xb2ca7d5b, 0xfd916bbb), - TOBN(0xd55a2541, 0xf5024025), TOBN(0x47bc5769, 0xe4c2d937), - TOBN(0x7d31b92a, 0x0362189f), TOBN(0x83f3086e, 0xef7816f9), - TOBN(0xf9f46d94, 0xb587579a), TOBN(0xec2d22d8, 0x30e76c5f), - TOBN(0x27d57461, 0xb000ffcf), TOBN(0xbb7e65f9, 0x364ffc2c), - TOBN(0x7c7c9477, 0x6652a220), TOBN(0x61618f89, 0xd696c981), - TOBN(0x5021701d, 0x89effff3), TOBN(0xf2c8ff8e, 0x7c314163), - TOBN(0x2da413ad, 0x8efb4d3e), TOBN(0x937b5adf, 0xce176d95), - TOBN(0x22867d34, 0x2a67d51c), TOBN(0x262b9b10, 0x18eb3ac9), - TOBN(0x4e314fe4, 0xc43ff28b), TOBN(0x76476627, 0x6a664e7a), - TOBN(0x3e90e40b, 0xb7a565c2), TOBN(0x8588993a, 0xc1acf831), - TOBN(0xd7b501d6, 0x8f938829), TOBN(0x996627ee, 0x3edd7d4c), - TOBN(0x37d44a62, 0x90cd34c7), TOBN(0xa8327499, 0xf3833e8d), - TOBN(0x2e18917d, 0x4bf50353), TOBN(0x85dd726b, 0x556765fb), - TOBN(0x54fe65d6, 0x93d5ab66), TOBN(0x3ddbaced, 0x915c25fe), - TOBN(0xa799d9a4, 0x12f22e85), TOBN(0xe2a24867, 0x6d06f6bc), - TOBN(0xf4f1ee56, 0x43ca1637), TOBN(0xfda2828b, 0x61ece30a), - TOBN(0x758c1a3e, 0xa2dee7a6), TOBN(0xdcde2f3c, 0x734b2284), - TOBN(0xaba445d2, 0x4eaba6ad), TOBN(0x35aaf668, 0x76cee0a7), - TOBN(0x7e0b04a9, 0xe5aa049a), TOBN(0xe74083ad, 0x91103e84), - TOBN(0xbeb183ce, 0x40afecc3), TOBN(0x6b89de9f, 0xea043f7a)}, - {TOBN(0x0e299d23, 0xfe67ba66), TOBN(0x91450760, 0x93cf2f34), - TOBN(0xf45b5ea9, 0x97fcf913), TOBN(0x5be00843, 0x8bd7ddda), - TOBN(0x358c3e05, 0xd53ff04d), TOBN(0xbf7ccdc3, 0x5de91ef7), - TOBN(0xad684dbf, 0xb69ec1a0), TOBN(0x367e7cf2, 0x801fd997), - TOBN(0x0ca1f3b7, 0xb0dc8595), TOBN(0x27de4608, 0x9f1d9f2e), - TOBN(0x1af3bf39, 0xbadd82a7), TOBN(0x79356a79, 0x65862448), - TOBN(0xc0602345, 0xf5f9a052), TOBN(0x1a8b0f89, 0x139a42f9), - TOBN(0xb53eee42, 0x844d40fc), TOBN(0x93b0bfe5, 0x4e5b6368), - TOBN(0x5434dd02, 0xc024789c), TOBN(0x90dca9ea, 0x41b57bfc), - TOBN(0x8aa898e2, 0x243398df), TOBN(0xf607c834, 0x894a94bb), - TOBN(0xbb07be97, 0xc2c99b76), TOBN(0x6576ba67, 0x18c29302), - TOBN(0x3d79efcc, 0xe703a88c), TOBN(0xf259ced7, 0xb6a0d106), - TOBN(0x0f893a5d, 0xc8de610b), TOBN(0xe8c515fb, 0x67e223ce), - TOBN(0x7774bfa6, 0x4ead6dc5), TOBN(0x89d20f95, 0x925c728f), - TOBN(0x7a1e0966, 0x098583ce), TOBN(0xa2eedb94, 0x93f2a7d7), - TOBN(0x1b282097, 0x4c304d4a), TOBN(0x0842e3da, 0xc077282d), - TOBN(0xe4d972a3, 0x3b9e2d7b), TOBN(0x7cc60b27, 0xc48218ff), - TOBN(0x8fc70838, 0x84149d91), TOBN(0x5c04346f, 0x2f461ecc), - TOBN(0xebe9fdf2, 0x614650a9), TOBN(0x5e35b537, 0xc1f666ac), - TOBN(0x645613d1, 0x88babc83), TOBN(0x88cace3a, 0xc5e1c93e), - TOBN(0x209ca375, 0x3de92e23), TOBN(0xccb03cc8, 0x5fbbb6e3), - TOBN(0xccb90f03, 0xd7b1487e), TOBN(0xfa9c2a38, 0xc710941f), - TOBN(0x756c3823, 0x6724ceed), TOBN(0x3a902258, 0x192d0323), - TOBN(0xb150e519, 0xea5e038e), TOBN(0xdcba2865, 0xc7427591), - TOBN(0xe549237f, 0x78890732), TOBN(0xc443bef9, 0x53fcb4d9), - TOBN(0x9884d8a6, 0xeb3480d6), TOBN(0x8a35b6a1, 0x3048b186), - TOBN(0xb4e44716, 0x65e9a90a), TOBN(0x45bf380d, 0x653006c0), - TOBN(0x8f3f820d, 0x4fe9ae3b), TOBN(0x244a35a0, 0x979a3b71), - TOBN(0xa1010e9d, 0x74cd06ff), TOBN(0x9c17c7df, 0xaca3eeac), - TOBN(0x74c86cd3, 0x8063aa2b), TOBN(0x8595c4b3, 0x734614ff), - TOBN(0xa3de00ca, 0x990f62cc), TOBN(0xd9bed213, 0xca0c3be5), - TOBN(0x7886078a, 0xdf8ce9f5), TOBN(0xddb27ce3, 0x5cd44444), - TOBN(0xed374a66, 0x58926ddd), TOBN(0x138b2d49, 0x908015b8), - TOBN(0x886c6579, 0xde1f7ab8), TOBN(0x888b9aa0, 0xc3020b7a), - TOBN(0xd3ec034e, 0x3a96e355), TOBN(0xba65b0b8, 0xf30fbe9a), - TOBN(0x064c8e50, 0xff21367a), TOBN(0x1f508ea4, 0x0b04b46e), - TOBN(0x98561a49, 0x747c866c), TOBN(0xbbb1e5fe, 0x0518a062), - TOBN(0x20ff4e8b, 0xecdc3608), TOBN(0x7f55cded, 0x20184027), - TOBN(0x8d73ec95, 0xf38c85f0), TOBN(0x5b589fdf, 0x8bc3b8c3), - TOBN(0xbe95dd98, 0x0f12b66f), TOBN(0xf5bd1a09, 0x0e338e01), - TOBN(0x65163ae5, 0x5e915918), TOBN(0x6158d6d9, 0x86f8a46b), - TOBN(0x8466b538, 0xeeebf99c), TOBN(0xca8761f6, 0xbca477ef), - TOBN(0xaf3449c2, 0x9ebbc601), TOBN(0xef3b0f41, 0xe0c3ae2f), - TOBN(0xaa6c577d, 0x5de63752), TOBN(0xe9166601, 0x64682a51), - TOBN(0x5a3097be, 0xfc15aa1e), TOBN(0x40d12548, 0xb54b0745), - TOBN(0x5bad4706, 0x519a5f12), TOBN(0xed03f717, 0xa439dee6), - TOBN(0x0794bb6c, 0x4a02c499), TOBN(0xf725083d, 0xcffe71d2), - TOBN(0x2cad7519, 0x0f3adcaf), TOBN(0x7f68ea1c, 0x43729310), - TOBN(0xe747c8c7, 0xb7ffd977), TOBN(0xec104c35, 0x80761a22), - TOBN(0x8395ebaf, 0x5a3ffb83), TOBN(0xfb3261f4, 0xe4b63db7), - TOBN(0x53544960, 0xd883e544), TOBN(0x13520d70, 0x8cc2eeb8), - TOBN(0x08f6337b, 0xd3d65f99), TOBN(0x83997db2, 0x781cf95b), - TOBN(0xce6ff106, 0x0dbd2c01), TOBN(0x4f8eea6b, 0x1f9ce934), - TOBN(0x546f7c4b, 0x0e993921), TOBN(0x6236a324, 0x5e753fc7), - TOBN(0x65a41f84, 0xa16022e9), TOBN(0x0c18d878, 0x43d1dbb2), - TOBN(0x73c55640, 0x2d4cef9c), TOBN(0xa0428108, 0x70444c74), - TOBN(0x68e4f15e, 0x9afdfb3c), TOBN(0x49a56143, 0x5bdfb6df), - TOBN(0xa9bc1bd4, 0x5f823d97), TOBN(0xbceb5970, 0xea111c2a), - TOBN(0x366b455f, 0xb269bbc4), TOBN(0x7cd85e1e, 0xe9bc5d62), - TOBN(0xc743c41c, 0x4f18b086), TOBN(0xa4b40990, 0x95294fb9), - TOBN(0x9c7c581d, 0x26ee8382), TOBN(0xcf17dcc5, 0x359d638e), - TOBN(0xee8273ab, 0xb728ae3d), TOBN(0x1d112926, 0xf821f047), - TOBN(0x11498477, 0x50491a74), TOBN(0x687fa761, 0xfde0dfb9), - TOBN(0x2c258022, 0x7ea435ab), TOBN(0x6b8bdb94, 0x91ce7e3f), - TOBN(0x4c5b5dc9, 0x3bf834aa), TOBN(0x04371819, 0x4f6c7e4b), - TOBN(0xc284e00a, 0x3736bcad), TOBN(0x0d881118, 0x21ae8f8d), - TOBN(0xf9cf0f82, 0xf48c8e33), TOBN(0xa11fd075, 0xa1bf40db), - TOBN(0xdceab0de, 0xdc2733e5), TOBN(0xc560a8b5, 0x8e986bd7), - TOBN(0x48dd1fe2, 0x3929d097), TOBN(0x3885b290, 0x92f188f1), - TOBN(0x0f2ae613, 0xda6fcdac), TOBN(0x9054303e, 0xb662a46c), - TOBN(0xb6871e44, 0x0738042a), TOBN(0x98e6a977, 0xbdaf6449), - TOBN(0xd8bc0650, 0xd1c9df1b), TOBN(0xef3d6451, 0x36e098f9), - TOBN(0x03fbae82, 0xb6d72d28), TOBN(0x77ca9db1, 0xf5d84080), - TOBN(0x8a112cff, 0xa58efc1c), TOBN(0x518d761c, 0xc564cb4a), - TOBN(0x69b5740e, 0xf0d1b5ce), TOBN(0x717039cc, 0xe9eb1785), - TOBN(0x3fe29f90, 0x22f53382), TOBN(0x8e54ba56, 0x6bc7c95c), - TOBN(0x9c806d8a, 0xf7f91d0f), TOBN(0x3b61b0f1, 0xa82a5728), - TOBN(0x4640032d, 0x94d76754), TOBN(0x273eb5de, 0x47d834c6), - TOBN(0x2988abf7, 0x7b4e4d53), TOBN(0xb7ce66bf, 0xde401777), - TOBN(0x9fba6b32, 0x715071b3), TOBN(0x82413c24, 0xad3a1a98), - TOBN(0x5b7fc8c4, 0xe0e8ad93), TOBN(0xb5679aee, 0x5fab868d), - TOBN(0xb1f9d2fa, 0x2b3946f3), TOBN(0x458897dc, 0x5685b50a), - TOBN(0x1e98c930, 0x89d0caf3), TOBN(0x39564c5f, 0x78642e92), - TOBN(0x1b77729a, 0x0dbdaf18), TOBN(0xf9170722, 0x579e82e6), - TOBN(0x680c0317, 0xe4515fa5), TOBN(0xf85cff84, 0xfb0c790f), - TOBN(0xc7a82aab, 0x6d2e0765), TOBN(0x7446bca9, 0x35c82b32), - TOBN(0x5de607aa, 0x6d63184f), TOBN(0x7c1a46a8, 0x262803a6), - TOBN(0xd218313d, 0xaebe8035), TOBN(0x92113ffd, 0xc73c51f8), - TOBN(0x4b38e083, 0x12e7e46c), TOBN(0x69d0a37a, 0x56126bd5), - TOBN(0xfb3f324b, 0x73c07e04), TOBN(0xa0c22f67, 0x8fda7267), - TOBN(0x8f2c0051, 0x4d2c7d8f), TOBN(0xbc45ced3, 0xcbe2cae5), - TOBN(0xe1c6cf07, 0xa8f0f277), TOBN(0xbc392312, 0x1eb99a98), - TOBN(0x75537b7e, 0x3cc8ac85), TOBN(0x8d725f57, 0xdd02753b), - TOBN(0xfd05ff64, 0xb737df2f), TOBN(0x55fe8712, 0xf6d2531d), - TOBN(0x57ce04a9, 0x6ab6b01c), TOBN(0x69a02a89, 0x7cd93724), - TOBN(0x4f82ac35, 0xcf86699b), TOBN(0x8242d3ad, 0x9cb4b232), - TOBN(0x713d0f65, 0xd62105e5), TOBN(0xbb222bfa, 0x2d29be61), - TOBN(0xf2f9a79e, 0x6cfbef09), TOBN(0xfc24d8d3, 0xd5d6782f), - TOBN(0x5db77085, 0xd4129967), TOBN(0xdb81c3cc, 0xdc3c2a43), - TOBN(0x9d655fc0, 0x05d8d9a3), TOBN(0x3f5d057a, 0x54298026), - TOBN(0x1157f56d, 0x88c54694), TOBN(0xb26baba5, 0x9b09573e), - TOBN(0x2cab03b0, 0x22adffd1), TOBN(0x60a412c8, 0xdd69f383), - TOBN(0xed76e98b, 0x54b25039), TOBN(0xd4ee67d3, 0x687e714d), - TOBN(0x87739648, 0x7b00b594), TOBN(0xce419775, 0xc9ef709b), - TOBN(0x40f76f85, 0x1c203a40), TOBN(0x30d352d6, 0xeafd8f91), - TOBN(0xaf196d3d, 0x95578dd2), TOBN(0xea4bb3d7, 0x77cc3f3d), - TOBN(0x42a5bd03, 0xb98e782b), TOBN(0xac958c40, 0x0624920d), - TOBN(0xb838134c, 0xfc56fcc8), TOBN(0x86ec4ccf, 0x89572e5e), - TOBN(0x69c43526, 0x9be47be0), TOBN(0x323b7dd8, 0xcb28fea1), - TOBN(0xfa5538ba, 0x3a6c67e5), TOBN(0xef921d70, 0x1d378e46), - TOBN(0xf92961fc, 0x3c4b880e), TOBN(0x3f6f914e, 0x98940a67), - TOBN(0xa990eb0a, 0xfef0ff39), TOBN(0xa6c2920f, 0xf0eeff9c), - TOBN(0xca804166, 0x51b8d9a3), TOBN(0x42531bc9, 0x0ffb0db1), - TOBN(0x72ce4718, 0xaa82e7ce), TOBN(0x6e199913, 0xdf574741), - TOBN(0xd5f1b13d, 0xd5d36946), TOBN(0x8255dc65, 0xf68f0194), - TOBN(0xdc9df4cd, 0x8710d230), TOBN(0x3453c20f, 0x138c1988), - TOBN(0x9af98dc0, 0x89a6ef01), TOBN(0x4dbcc3f0, 0x9857df85), - TOBN(0x34805601, 0x5c1ad924), TOBN(0x40448da5, 0xd0493046), - TOBN(0xf629926d, 0x4ee343e2), TOBN(0x6343f1bd, 0x90e8a301), - TOBN(0xefc93491, 0x40815b3f), TOBN(0xf882a423, 0xde8f66fb), - TOBN(0x3a12d5f4, 0xe7db9f57), TOBN(0x7dfba38a, 0x3c384c27), - TOBN(0x7a904bfd, 0x6fc660b1), TOBN(0xeb6c5db3, 0x2773b21c), - TOBN(0xc350ee66, 0x1cdfe049), TOBN(0x9baac0ce, 0x44540f29), - TOBN(0xbc57b6ab, 0xa5ec6aad), TOBN(0x167ce8c3, 0x0a7c1baa), - TOBN(0xb23a03a5, 0x53fb2b56), TOBN(0x6ce141e7, 0x4e057f78), - TOBN(0x796525c3, 0x89e490d9), TOBN(0x0bc95725, 0xa31a7e75), - TOBN(0x1ec56791, 0x1220fd06), TOBN(0x716e3a3c, 0x408b0bd6), - TOBN(0x31cd6bf7, 0xe8ebeba9), TOBN(0xa7326ca6, 0xbee6b670), - TOBN(0x3d9f851c, 0xcd090c43), TOBN(0x561e8f13, 0xf12c3988), - TOBN(0x50490b6a, 0x904b7be4), TOBN(0x61690ce1, 0x0410737b), - TOBN(0x299e9a37, 0x0f009052), TOBN(0x258758f0, 0xf026092e), - TOBN(0x9fa255f3, 0xfdfcdc0f), TOBN(0xdbc9fb1f, 0xc0e1bcd2), - TOBN(0x35f9dd6e, 0x24651840), TOBN(0xdca45a84, 0xa5c59abc), - TOBN(0x103d396f, 0xecca4938), TOBN(0x4532da0a, 0xb97b3f29), - TOBN(0xc4135ea5, 0x1999a6bf), TOBN(0x3aa9505a, 0x5e6bf2ee), - TOBN(0xf77cef06, 0x3f5be093), TOBN(0x97d1a0f8, 0xa943152e), - TOBN(0x2cb0ebba, 0x2e1c21dd), TOBN(0xf41b29fc, 0x2c6797c4), - TOBN(0xc6e17321, 0xb300101f), TOBN(0x4422b0e9, 0xd0d79a89), - TOBN(0x49e4901c, 0x92f1bfc4), TOBN(0x06ab1f8f, 0xe1e10ed9), - TOBN(0x84d35577, 0xdb2926b8), TOBN(0xca349d39, 0x356e8ec2), - TOBN(0x70b63d32, 0x343bf1a9), TOBN(0x8fd3bd28, 0x37d1a6b1), - TOBN(0x0454879c, 0x316865b4), TOBN(0xee959ff6, 0xc458efa2), - TOBN(0x0461dcf8, 0x9706dc3f), TOBN(0x737db0e2, 0x164e4b2e), - TOBN(0x09262680, 0x2f8843c8), TOBN(0x54498bbc, 0x7745e6f6), - TOBN(0x359473fa, 0xa29e24af), TOBN(0xfcc3c454, 0x70aa87a1), - TOBN(0xfd2c4bf5, 0x00573ace), TOBN(0xb65b514e, 0x28dd1965), - TOBN(0xe46ae7cf, 0x2193e393), TOBN(0x60e9a4e1, 0xf5444d97), - TOBN(0xe7594e96, 0x00ff38ed), TOBN(0x43d84d2f, 0x0a0e0f02), - TOBN(0x8b6db141, 0xee398a21), TOBN(0xb88a56ae, 0xe3bcc5be), - TOBN(0x0a1aa52f, 0x373460ea), TOBN(0x20da1a56, 0x160bb19b), - TOBN(0xfb54999d, 0x65bf0384), TOBN(0x71a14d24, 0x5d5a180e), - TOBN(0xbc44db7b, 0x21737b04), TOBN(0xd84fcb18, 0x01dd8e92), - TOBN(0x80de937b, 0xfa44b479), TOBN(0x53505499, 0x5c98fd4f), - TOBN(0x1edb12ab, 0x28f08727), TOBN(0x4c58b582, 0xa5f3ef53), - TOBN(0xbfb236d8, 0x8327f246), TOBN(0xc3a3bfaa, 0x4d7df320), - TOBN(0xecd96c59, 0xb96024f2), TOBN(0xfc293a53, 0x7f4e0433), - TOBN(0x5341352b, 0x5acf6e10), TOBN(0xc50343fd, 0xafe652c3), - TOBN(0x4af3792d, 0x18577a7f), TOBN(0xe1a4c617, 0xaf16823d), - TOBN(0x9b26d0cd, 0x33425d0a), TOBN(0x306399ed, 0x9b7bc47f), - TOBN(0x2a792f33, 0x706bb20b), TOBN(0x31219614, 0x98111055), - TOBN(0x864ec064, 0x87f5d28b), TOBN(0x11392d91, 0x962277fd), - TOBN(0xb5aa7942, 0xbb6aed5f), TOBN(0x080094dc, 0x47e799d9), - TOBN(0x4afa588c, 0x208ba19b), TOBN(0xd3e7570f, 0x8512f284), - TOBN(0xcbae64e6, 0x02f5799a), TOBN(0xdeebe7ef, 0x514b9492), - TOBN(0x30300f98, 0xe5c298ff), TOBN(0x17f561be, 0x3678361f), - TOBN(0xf52ff312, 0x98cb9a16), TOBN(0x6233c3bc, 0x5562d490), - TOBN(0x7bfa15a1, 0x92e3a2cb), TOBN(0x961bcfd1, 0xe6365119), - TOBN(0x3bdd29bf, 0x2c8c53b1), TOBN(0x739704df, 0x822844ba), - TOBN(0x7dacfb58, 0x7e7b754b), TOBN(0x23360791, 0xa806c9b9), - TOBN(0xe7eb88c9, 0x23504452), TOBN(0x2983e996, 0x852c1783), - TOBN(0xdd4ae529, 0x958d881d), TOBN(0x026bae03, 0x262c7b3c), - TOBN(0x3a6f9193, 0x960b52d1), TOBN(0xd0980f90, 0x92696cfb), - TOBN(0x4c1f428c, 0xd5f30851), TOBN(0x94dfed27, 0x2a4f6630), - TOBN(0x4df53772, 0xfc5d48a4), TOBN(0xdd2d5a2f, 0x933260ce), - TOBN(0x574115bd, 0xd44cc7a5), TOBN(0x4ba6b20d, 0xbd12533a), - TOBN(0x30e93cb8, 0x243057c9), TOBN(0x794c486a, 0x14de320e), - TOBN(0xe925d4ce, 0xf21496e4), TOBN(0xf951d198, 0xec696331), - TOBN(0x9810e2de, 0x3e8d812f), TOBN(0xd0a47259, 0x389294ab), - TOBN(0x513ba2b5, 0x0e3bab66), TOBN(0x462caff5, 0xabad306f), - TOBN(0xe2dc6d59, 0xaf04c49e), TOBN(0x1aeb8750, 0xe0b84b0b), - TOBN(0xc034f12f, 0x2f7d0ca2), TOBN(0x6d2e8128, 0xe06acf2f), - TOBN(0x801f4f83, 0x21facc2f), TOBN(0xa1170c03, 0xf40ef607), - TOBN(0xfe0a1d4f, 0x7805a99c), TOBN(0xbde56a36, 0xcc26aba5), - TOBN(0x5b1629d0, 0x35531f40), TOBN(0xac212c2b, 0x9afa6108), - TOBN(0x30a06bf3, 0x15697be5), TOBN(0x6f0545dc, 0x2c63c7c1), - TOBN(0x5d8cb842, 0x7ccdadaf), TOBN(0xd52e379b, 0xac7015bb), - TOBN(0xc4f56147, 0xf462c23e), TOBN(0xd44a4298, 0x46bc24b0), - TOBN(0xbc73d23a, 0xe2856d4f), TOBN(0x61cedd8c, 0x0832bcdf), - TOBN(0x60953556, 0x99f241d7), TOBN(0xee4adbd7, 0x001a349d), - TOBN(0x0b35bf6a, 0xaa89e491), TOBN(0x7f0076f4, 0x136f7546), - TOBN(0xd19a18ba, 0x9264da3d), TOBN(0x6eb2d2cd, 0x62a7a28b), - TOBN(0xcdba941f, 0x8761c971), TOBN(0x1550518b, 0xa3be4a5d), - TOBN(0xd0e8e2f0, 0x57d0b70c), TOBN(0xeea8612e, 0xcd133ba3), - TOBN(0x814670f0, 0x44416aec), TOBN(0x424db6c3, 0x30775061), - TOBN(0xd96039d1, 0x16213fd1), TOBN(0xc61e7fa5, 0x18a3478f), - TOBN(0xa805bdcc, 0xcb0c5021), TOBN(0xbdd6f3a8, 0x0cc616dd), - TOBN(0x06009667, 0x5d97f7e2), TOBN(0x31db0fc1, 0xaf0bf4b6), - TOBN(0x23680ed4, 0x5491627a), TOBN(0xb99a3c66, 0x7d741fb1), - TOBN(0xe9bb5f55, 0x36b1ff92), TOBN(0x29738577, 0x512b388d), - TOBN(0xdb8a2ce7, 0x50fcf263), TOBN(0x385346d4, 0x6c4f7b47), - TOBN(0xbe86c5ef, 0x31631f9e), TOBN(0xbf91da21, 0x03a57a29), - TOBN(0xc3b1f796, 0x7b23f821), TOBN(0x0f7d00d2, 0x770db354), - TOBN(0x8ffc6c3b, 0xd8fe79da), TOBN(0xcc5e8c40, 0xd525c996), - TOBN(0x4640991d, 0xcfff632a), TOBN(0x64d97e8c, 0x67112528), - TOBN(0xc232d973, 0x02f1cd1e), TOBN(0xce87eacb, 0x1dd212a4), - TOBN(0x6e4c8c73, 0xe69802f7), TOBN(0x12ef0290, 0x1fffddbd), - TOBN(0x941ec74e, 0x1bcea6e2), TOBN(0xd0b54024, 0x3cb92cbb), - TOBN(0x809fb9d4, 0x7e8f9d05), TOBN(0x3bf16159, 0xf2992aae), - TOBN(0xad40f279, 0xf8a7a838), TOBN(0x11aea631, 0x05615660), - TOBN(0xbf52e6f1, 0xa01f6fa1), TOBN(0xef046995, 0x3dc2aec9), - TOBN(0x785dbec9, 0xd8080711), TOBN(0xe1aec60a, 0x9fdedf76), - TOBN(0xece797b5, 0xfa21c126), TOBN(0xc66e898f, 0x05e52732), - TOBN(0x39bb69c4, 0x08811fdb), TOBN(0x8bfe1ef8, 0x2fc7f082), - TOBN(0xc8e7a393, 0x174f4138), TOBN(0xfba8ad1d, 0xd58d1f98), - TOBN(0xbc21d0ce, 0xbfd2fd5b), TOBN(0x0b839a82, 0x6ee60d61), - TOBN(0xaacf7658, 0xafd22253), TOBN(0xb526bed8, 0xaae396b3), - TOBN(0xccc1bbc2, 0x38564464), TOBN(0x9e3ff947, 0x8c45bc73), - TOBN(0xcde9bca3, 0x58188a78), TOBN(0x138b8ee0, 0xd73bf8f7), - TOBN(0x5c7e234c, 0x4123c489), TOBN(0x66e69368, 0xfa643297), - TOBN(0x0629eeee, 0x39a15fa3), TOBN(0x95fab881, 0xa9e2a927), - TOBN(0xb2497007, 0xeafbb1e1), TOBN(0xd75c9ce6, 0xe75b7a93), - TOBN(0x3558352d, 0xefb68d78), TOBN(0xa2f26699, 0x223f6396), - TOBN(0xeb911ecf, 0xe469b17a), TOBN(0x62545779, 0xe72d3ec2), - TOBN(0x8ea47de7, 0x82cb113f), TOBN(0xebe4b086, 0x4e1fa98d), - TOBN(0xec2d5ed7, 0x8cdfedb1), TOBN(0xa535c077, 0xfe211a74), - TOBN(0x9678109b, 0x11d244c5), TOBN(0xf17c8bfb, 0xbe299a76), - TOBN(0xb651412e, 0xfb11fbc4), TOBN(0xea0b5482, 0x94ab3f65), - TOBN(0xd8dffd95, 0x0cf78243), TOBN(0x2e719e57, 0xce0361d4), - TOBN(0x9007f085, 0x304ddc5b), TOBN(0x095e8c6d, 0x4daba2ea), - TOBN(0x5a33cdb4, 0x3f9d28a9), TOBN(0x85b95cd8, 0xe2283003), - TOBN(0xbcd6c819, 0xb9744733), TOBN(0x29c5f538, 0xfc7f5783), - TOBN(0x6c49b2fa, 0xd59038e4), TOBN(0x68349cc1, 0x3bbe1018), - TOBN(0xcc490c1d, 0x21830ee5), TOBN(0x36f9c4ee, 0xe9bfa297), - TOBN(0x58fd7294, 0x48de1a94), TOBN(0xaadb13a8, 0x4e8f2cdc), - TOBN(0x515eaaa0, 0x81313dba), TOBN(0xc76bb468, 0xc2152dd8), - TOBN(0x357f8d75, 0xa653dbf8), TOBN(0xe4d8c4d1, 0xb14ac143), - TOBN(0xbdb8e675, 0xb055cb40), TOBN(0x898f8e7b, 0x977b5167), - TOBN(0xecc65651, 0xb82fb863), TOBN(0x56544814, 0x6d88f01f), - TOBN(0xb0928e95, 0x263a75a9), TOBN(0xcfb6836f, 0x1a22fcda), - TOBN(0x651d14db, 0x3f3bd37c), TOBN(0x1d3837fb, 0xb6ad4664), - TOBN(0x7c5fb538, 0xff4f94ab), TOBN(0x7243c712, 0x6d7fb8f2), - TOBN(0xef13d60c, 0xa85c5287), TOBN(0x18cfb7c7, 0x4bb8dd1b), - TOBN(0x82f9bfe6, 0x72908219), TOBN(0x35c4592b, 0x9d5144ab), - TOBN(0x52734f37, 0x9cf4b42f), TOBN(0x6bac55e7, 0x8c60ddc4), - TOBN(0xb5cd811e, 0x94dea0f6), TOBN(0x259ecae4, 0xe18cc1a3), - TOBN(0x6a0e836e, 0x15e660f8), TOBN(0x6c639ea6, 0x0e02bff2), - TOBN(0x8721b8cb, 0x7e1026fd), TOBN(0x9e73b50b, 0x63261942), - TOBN(0xb8c70974, 0x77f01da3), TOBN(0x1839e6a6, 0x8268f57f), - TOBN(0x571b9415, 0x5150b805), TOBN(0x1892389e, 0xf92c7097), - TOBN(0x8d69c18e, 0x4a084b95), TOBN(0x7014c512, 0xbe5b495c), - TOBN(0x4780db36, 0x1b07523c), TOBN(0x2f6219ce, 0x2c1c64fa), - TOBN(0xc38b81b0, 0x602c105a), TOBN(0xab4f4f20, 0x5dc8e360), - TOBN(0x20d3c982, 0xcf7d62d2), TOBN(0x1f36e29d, 0x23ba8150), - TOBN(0x48ae0bf0, 0x92763f9e), TOBN(0x7a527e6b, 0x1d3a7007), - TOBN(0xb4a89097, 0x581a85e3), TOBN(0x1f1a520f, 0xdc158be5), - TOBN(0xf98db37d, 0x167d726e), TOBN(0x8802786e, 0x1113e862)}, - {TOBN(0xefb2149e, 0x36f09ab0), TOBN(0x03f163ca, 0x4a10bb5b), - TOBN(0xd0297045, 0x06e20998), TOBN(0x56f0af00, 0x1b5a3bab), - TOBN(0x7af4cfec, 0x70880e0d), TOBN(0x7332a66f, 0xbe3d913f), - TOBN(0x32e6c84a, 0x7eceb4bd), TOBN(0xedc4a79a, 0x9c228f55), - TOBN(0xc37c7dd0, 0xc55c4496), TOBN(0xa6a96357, 0x25bbabd2), - TOBN(0x5b7e63f2, 0xadd7f363), TOBN(0x9dce3782, 0x2e73f1df), - TOBN(0xe1e5a16a, 0xb2b91f71), TOBN(0xe4489823, 0x5ba0163c), - TOBN(0xf2759c32, 0xf6e515ad), TOBN(0xa5e2f1f8, 0x8615eecf), - TOBN(0x74519be7, 0xabded551), TOBN(0x03d358b8, 0xc8b74410), - TOBN(0x4d00b10b, 0x0e10d9a9), TOBN(0x6392b0b1, 0x28da52b7), - TOBN(0x6744a298, 0x0b75c904), TOBN(0xc305b0ae, 0xa8f7f96c), - TOBN(0x042e421d, 0x182cf932), TOBN(0xf6fc5d50, 0x9e4636ca), - TOBN(0x795847c9, 0xd64cc78c), TOBN(0x6c50621b, 0x9b6cb27b), - TOBN(0x07099bf8, 0xdf8022ab), TOBN(0x48f862eb, 0xc04eda1d), - TOBN(0xd12732ed, 0xe1603c16), TOBN(0x19a80e0f, 0x5c9a9450), - TOBN(0xe2257f54, 0xb429b4fc), TOBN(0x66d3b2c6, 0x45460515), - TOBN(0x6ca4f87e, 0x822e37be), TOBN(0x73f237b4, 0x253bda4e), - TOBN(0xf747f3a2, 0x41190aeb), TOBN(0xf06fa36f, 0x804cf284), - TOBN(0x0a6bbb6e, 0xfc621c12), TOBN(0x5d624b64, 0x40b80ec6), - TOBN(0x4b072425, 0x7ba556f3), TOBN(0x7fa0c354, 0x3e2d20a8), - TOBN(0xe921fa31, 0xe3229d41), TOBN(0xa929c652, 0x94531bd4), - TOBN(0x84156027, 0xa6d38209), TOBN(0xf3d69f73, 0x6bdb97bd), - TOBN(0x8906d19a, 0x16833631), TOBN(0x68a34c2e, 0x03d51be3), - TOBN(0xcb59583b, 0x0e511cd8), TOBN(0x99ce6bfd, 0xfdc132a8), - TOBN(0x3facdaaa, 0xffcdb463), TOBN(0x658bbc1a, 0x34a38b08), - TOBN(0x12a801f8, 0xf1a9078d), TOBN(0x1567bcf9, 0x6ab855de), - TOBN(0xe08498e0, 0x3572359b), TOBN(0xcf0353e5, 0x8659e68b), - TOBN(0xbb86e9c8, 0x7d23807c), TOBN(0xbc08728d, 0x2198e8a2), - TOBN(0x8de2b7bc, 0x453cadd6), TOBN(0x203900a7, 0xbc0bc1f8), - TOBN(0xbcd86e47, 0xa6abd3af), TOBN(0x911cac12, 0x8502effb), - TOBN(0x2d550242, 0xec965469), TOBN(0x0e9f7692, 0x29e0017e), - TOBN(0x633f078f, 0x65979885), TOBN(0xfb87d449, 0x4cf751ef), - TOBN(0xe1790e4b, 0xfc25419a), TOBN(0x36467203, 0x4bff3cfd), - TOBN(0xc8db6386, 0x25b6e83f), TOBN(0x6cc69f23, 0x6cad6fd2), - TOBN(0x0219e45a, 0x6bc68bb9), TOBN(0xe43d79b6, 0x297f7334), - TOBN(0x7d445368, 0x465dc97c), TOBN(0x4b9eea32, 0x2a0b949a), - TOBN(0x1b96c6ba, 0x6102d021), TOBN(0xeaafac78, 0x2f4461ea), - TOBN(0xd4b85c41, 0xc49f19a8), TOBN(0x275c28e4, 0xcf538875), - TOBN(0x35451a9d, 0xdd2e54e0), TOBN(0x6991adb5, 0x0605618b), - TOBN(0x5b8b4bcd, 0x7b36cd24), TOBN(0x372a4f8c, 0x56f37216), - TOBN(0xc890bd73, 0xa6a5da60), TOBN(0x6f083da0, 0xdc4c9ff0), - TOBN(0xf4e14d94, 0xf0536e57), TOBN(0xf9ee1eda, 0xaaec8243), - TOBN(0x571241ec, 0x8bdcf8e7), TOBN(0xa5db8271, 0x0b041e26), - TOBN(0x9a0b9a99, 0xe3fff040), TOBN(0xcaaf21dd, 0x7c271202), - TOBN(0xb4e2b2e1, 0x4f0dd2e8), TOBN(0xe77e7c4f, 0x0a377ac7), - TOBN(0x69202c3f, 0x0d7a2198), TOBN(0xf759b7ff, 0x28200eb8), - TOBN(0xc87526ed, 0xdcfe314e), TOBN(0xeb84c524, 0x53d5cf99), - TOBN(0xb1b52ace, 0x515138b6), TOBN(0x5aa7ff8c, 0x23fca3f4), - TOBN(0xff0b13c3, 0xb9791a26), TOBN(0x960022da, 0xcdd58b16), - TOBN(0xdbd55c92, 0x57aad2de), TOBN(0x3baaaaa3, 0xf30fe619), - TOBN(0x9a4b2346, 0x0d881efd), TOBN(0x506416c0, 0x46325e2a), - TOBN(0x91381e76, 0x035c18d4), TOBN(0xb3bb68be, 0xf27817b0), - TOBN(0x15bfb8bf, 0x5116f937), TOBN(0x7c64a586, 0xc1268943), - TOBN(0x71e25cc3, 0x8419a2c8), TOBN(0x9fd6b0c4, 0x8335f463), - TOBN(0x4bf0ba3c, 0xe8ee0e0e), TOBN(0x6f6fba60, 0x298c21fa), - TOBN(0x57d57b39, 0xae66bee0), TOBN(0x292d5130, 0x22672544), - TOBN(0xf451105d, 0xbab093b3), TOBN(0x012f59b9, 0x02839986), - TOBN(0x8a915802, 0x3474a89c), TOBN(0x048c919c, 0x2de03e97), - TOBN(0xc476a2b5, 0x91071cd5), TOBN(0x791ed89a, 0x034970a5), - TOBN(0x89bd9042, 0xe1b7994b), TOBN(0x8eaf5179, 0xa1057ffd), - TOBN(0x6066e2a2, 0xd551ee10), TOBN(0x87a8f1d8, 0x727e09a6), - TOBN(0x00d08bab, 0x2c01148d), TOBN(0x6da8e4f1, 0x424f33fe), - TOBN(0x466d17f0, 0xcf9a4e71), TOBN(0xff502010, 0x3bf5cb19), - TOBN(0xdccf97d8, 0xd062ecc0), TOBN(0x80c0d9af, 0x81d80ac4), - TOBN(0xe87771d8, 0x033f2876), TOBN(0xb0186ec6, 0x7d5cc3db), - TOBN(0x58e8bb80, 0x3bc9bc1d), TOBN(0x4d1395cc, 0x6f6ef60e), - TOBN(0xa73c62d6, 0x186244a0), TOBN(0x918e5f23, 0x110a5b53), - TOBN(0xed4878ca, 0x741b7eab), TOBN(0x3038d71a, 0xdbe03e51), - TOBN(0x840204b7, 0xa93c3246), TOBN(0x21ab6069, 0xa0b9b4cd), - TOBN(0xf5fa6e2b, 0xb1d64218), TOBN(0x1de6ad0e, 0xf3d56191), - TOBN(0x570aaa88, 0xff1929c7), TOBN(0xc6df4c6b, 0x640e87b5), - TOBN(0xde8a74f2, 0xc65f0ccc), TOBN(0x8b972fd5, 0xe6f6cc01), - TOBN(0x3fff36b6, 0x0b846531), TOBN(0xba7e45e6, 0x10a5e475), - TOBN(0x84a1d10e, 0x4145b6c5), TOBN(0xf1f7f91a, 0x5e046d9d), - TOBN(0x0317a692, 0x44de90d7), TOBN(0x951a1d4a, 0xf199c15e), - TOBN(0x91f78046, 0xc9d73deb), TOBN(0x74c82828, 0xfab8224f), - TOBN(0xaa6778fc, 0xe7560b90), TOBN(0xb4073e61, 0xa7e824ce), - TOBN(0xff0d693c, 0xd642eba8), TOBN(0x7ce2e57a, 0x5dccef38), - TOBN(0x89c2c789, 0x1df1ad46), TOBN(0x83a06922, 0x098346fd), - TOBN(0x2d715d72, 0xda2fc177), TOBN(0x7b6dd71d, 0x85b6cf1d), - TOBN(0xc60a6d0a, 0x73fa9cb0), TOBN(0xedd3992e, 0x328bf5a9), - TOBN(0xc380ddd0, 0x832c8c82), TOBN(0xd182d410, 0xa2a0bf50), - TOBN(0x7d9d7438, 0xd9a528db), TOBN(0xe8b1a0e9, 0xcaf53994), - TOBN(0xddd6e5fe, 0x0e19987c), TOBN(0xacb8df03, 0x190b059d), - TOBN(0x53703a32, 0x8300129f), TOBN(0x1f637662, 0x68c43bfd), - TOBN(0xbcbd1913, 0x00e54051), TOBN(0x812fcc62, 0x7bf5a8c5), - TOBN(0x3f969d5f, 0x29fb85da), TOBN(0x72f4e00a, 0x694759e8), - TOBN(0x426b6e52, 0x790726b7), TOBN(0x617bbc87, 0x3bdbb209), - TOBN(0x511f8bb9, 0x97aee317), TOBN(0x812a4096, 0xe81536a8), - TOBN(0x137dfe59, 0x3ac09b9b), TOBN(0x0682238f, 0xba8c9a7a), - TOBN(0x7072ead6, 0xaeccb4bd), TOBN(0x6a34e9aa, 0x692ba633), - TOBN(0xc82eaec2, 0x6fff9d33), TOBN(0xfb753512, 0x1d4d2b62), - TOBN(0x1a0445ff, 0x1d7aadab), TOBN(0x65d38260, 0xd5f6a67c), - TOBN(0x6e62fb08, 0x91cfb26f), TOBN(0xef1e0fa5, 0x5c7d91d6), - TOBN(0x47e7c7ba, 0x33db72cd), TOBN(0x017cbc09, 0xfa7c74b2), - TOBN(0x3c931590, 0xf50a503c), TOBN(0xcac54f60, 0x616baa42), - TOBN(0x9b6cd380, 0xb2369f0f), TOBN(0x97d3a70d, 0x23c76151), - TOBN(0x5f9dd6fc, 0x9862a9c6), TOBN(0x044c4ab2, 0x12312f51), - TOBN(0x035ea0fd, 0x834a2ddc), TOBN(0x49e6b862, 0xcc7b826d), - TOBN(0xb03d6883, 0x62fce490), TOBN(0x62f2497a, 0xb37e36e9), - TOBN(0x04b005b6, 0xc6458293), TOBN(0x36bb5276, 0xe8d10af7), - TOBN(0xacf2dc13, 0x8ee617b8), TOBN(0x470d2d35, 0xb004b3d4), - TOBN(0x06790832, 0xfeeb1b77), TOBN(0x2bb75c39, 0x85657f9c), - TOBN(0xd70bd4ed, 0xc0f60004), TOBN(0xfe797ecc, 0x219b018b), - TOBN(0x9b5bec2a, 0x753aebcc), TOBN(0xdaf9f3dc, 0xc939eca5), - TOBN(0xd6bc6833, 0xd095ad09), TOBN(0x98abdd51, 0xdaa4d2fc), - TOBN(0xd9840a31, 0x8d168be5), TOBN(0xcf7c10e0, 0x2325a23c), - TOBN(0xa5c02aa0, 0x7e6ecfaf), TOBN(0x2462e7e6, 0xb5bfdf18), - TOBN(0xab2d8a8b, 0xa0cc3f12), TOBN(0x68dd485d, 0xbc672a29), - TOBN(0x72039752, 0x596f2cd3), TOBN(0x5d3eea67, 0xa0cf3d8d), - TOBN(0x810a1a81, 0xe6602671), TOBN(0x8f144a40, 0x14026c0c), - TOBN(0xbc753a6d, 0x76b50f85), TOBN(0xc4dc21e8, 0x645cd4a4), - TOBN(0xc5262dea, 0x521d0378), TOBN(0x802b8e0e, 0x05011c6f), - TOBN(0x1ba19cbb, 0x0b4c19ea), TOBN(0x21db64b5, 0xebf0aaec), - TOBN(0x1f394ee9, 0x70342f9d), TOBN(0x93a10aee, 0x1bc44a14), - TOBN(0xa7eed31b, 0x3efd0baa), TOBN(0x6e7c824e, 0x1d154e65), - TOBN(0xee23fa81, 0x9966e7ee), TOBN(0x64ec4aa8, 0x05b7920d), - TOBN(0x2d44462d, 0x2d90aad4), TOBN(0xf44dd195, 0xdf277ad5), - TOBN(0x8d6471f1, 0xbb46b6a1), TOBN(0x1e65d313, 0xfd885090), - TOBN(0x33a800f5, 0x13a977b4), TOBN(0xaca9d721, 0x0797e1ef), - TOBN(0x9a5a85a0, 0xfcff6a17), TOBN(0x9970a3f3, 0x1eca7cee), - TOBN(0xbb9f0d6b, 0xc9504be3), TOBN(0xe0c504be, 0xadd24ee2), - TOBN(0x7e09d956, 0x77fcc2f4), TOBN(0xef1a5227, 0x65bb5fc4), - TOBN(0x145d4fb1, 0x8b9286aa), TOBN(0x66fd0c5d, 0x6649028b), - TOBN(0x98857ceb, 0x1bf4581c), TOBN(0xe635e186, 0xaca7b166), - TOBN(0x278ddd22, 0x659722ac), TOBN(0xa0903c4c, 0x1db68007), - TOBN(0x366e4589, 0x48f21402), TOBN(0x31b49c14, 0xb96abda2), - TOBN(0x329c4b09, 0xe0403190), TOBN(0x97197ca3, 0xd29f43fe), - TOBN(0x8073dd1e, 0x274983d8), TOBN(0xda1a3bde, 0x55717c8f), - TOBN(0xfd3d4da2, 0x0361f9d1), TOBN(0x1332d081, 0x4c7de1ce), - TOBN(0x9b7ef7a3, 0xaa6d0e10), TOBN(0x17db2e73, 0xf54f1c4a), - TOBN(0xaf3dffae, 0x4cd35567), TOBN(0xaaa2f406, 0xe56f4e71), - TOBN(0x8966759e, 0x7ace3fc7), TOBN(0x9594eacf, 0x45a8d8c6), - TOBN(0x8de3bd8b, 0x91834e0e), TOBN(0xafe4ca53, 0x548c0421), - TOBN(0xfdd7e856, 0xe6ee81c6), TOBN(0x8f671beb, 0x6b891a3a), - TOBN(0xf7a58f2b, 0xfae63829), TOBN(0x9ab186fb, 0x9c11ac9f), - TOBN(0x8d6eb369, 0x10b5be76), TOBN(0x046b7739, 0xfb040bcd), - TOBN(0xccb4529f, 0xcb73de88), TOBN(0x1df0fefc, 0xcf26be03), - TOBN(0xad7757a6, 0xbcfcd027), TOBN(0xa8786c75, 0xbb3165ca), - TOBN(0xe9db1e34, 0x7e99a4d9), TOBN(0x99ee86df, 0xb06c504b), - TOBN(0x5b7c2ddd, 0xc15c9f0a), TOBN(0xdf87a734, 0x4295989e), - TOBN(0x59ece47c, 0x03d08fda), TOBN(0xb074d3dd, 0xad5fc702), - TOBN(0x20407903, 0x51a03776), TOBN(0x2bb1f77b, 0x2a608007), - TOBN(0x25c58f4f, 0xe1153185), TOBN(0xe6df62f6, 0x766e6447), - TOBN(0xefb3d1be, 0xed51275a), TOBN(0x5de47dc7, 0x2f0f483f), - TOBN(0x7932d98e, 0x97c2bedf), TOBN(0xd5c11927, 0x0219f8a1), - TOBN(0x9d751200, 0xa73a294e), TOBN(0x5f88434a, 0x9dc20172), - TOBN(0xd28d9fd3, 0xa26f506a), TOBN(0xa890cd31, 0x9d1dcd48), - TOBN(0x0aebaec1, 0x70f4d3b4), TOBN(0xfd1a1369, 0x0ffc8d00), - TOBN(0xb9d9c240, 0x57d57838), TOBN(0x45929d26, 0x68bac361), - TOBN(0x5a2cd060, 0x25b15ca6), TOBN(0x4b3c83e1, 0x6e474446), - TOBN(0x1aac7578, 0xee1e5134), TOBN(0xa418f5d6, 0xc91e2f41), - TOBN(0x6936fc8a, 0x213ed68b), TOBN(0x860ae7ed, 0x510a5224), - TOBN(0x63660335, 0xdef09b53), TOBN(0x641b2897, 0xcd79c98d), - TOBN(0x29bd38e1, 0x01110f35), TOBN(0x79c26f42, 0x648b1937), - TOBN(0x64dae519, 0x9d9164f4), TOBN(0xd85a2310, 0x0265c273), - TOBN(0x7173dd5d, 0x4b07e2b1), TOBN(0xd144c4cb, 0x8d9ea221), - TOBN(0xe8b04ea4, 0x1105ab14), TOBN(0x92dda542, 0xfe80d8f1), - TOBN(0xe9982fa8, 0xcf03dce6), TOBN(0x8b5ea965, 0x1a22cffc), - TOBN(0xf7f4ea7f, 0x3fad88c4), TOBN(0x62db773e, 0x6a5ba95c), - TOBN(0xd20f02fb, 0x93f24567), TOBN(0xfd46c69a, 0x315257ca), - TOBN(0x0ac74cc7, 0x8bcab987), TOBN(0x46f31c01, 0x5ceca2f5), - TOBN(0x40aedb59, 0x888b219e), TOBN(0xe50ecc37, 0xe1fccd02), - TOBN(0x1bcd9dad, 0x911f816c), TOBN(0x583cc1ec, 0x8db9b00c), - TOBN(0xf3cd2e66, 0xa483bf11), TOBN(0xfa08a6f5, 0xb1b2c169), - TOBN(0xf375e245, 0x4be9fa28), TOBN(0x99a7ffec, 0x5b6d011f), - TOBN(0x6a3ebddb, 0xc4ae62da), TOBN(0x6cea00ae, 0x374aef5d), - TOBN(0xab5fb98d, 0x9d4d05bc), TOBN(0x7cba1423, 0xd560f252), - TOBN(0x49b2cc21, 0x208490de), TOBN(0x1ca66ec3, 0xbcfb2879), - TOBN(0x7f1166b7, 0x1b6fb16f), TOBN(0xfff63e08, 0x65fe5db3), - TOBN(0xb8345abe, 0x8b2610be), TOBN(0xb732ed80, 0x39de3df4), - TOBN(0x0e24ed50, 0x211c32b4), TOBN(0xd10d8a69, 0x848ff27d), - TOBN(0xc1074398, 0xed4de248), TOBN(0xd7cedace, 0x10488927), - TOBN(0xa4aa6bf8, 0x85673e13), TOBN(0xb46bae91, 0x6daf30af), - TOBN(0x07088472, 0xfcef7ad8), TOBN(0x61151608, 0xd4b35e97), - TOBN(0xbcfe8f26, 0xdde29986), TOBN(0xeb84c4c7, 0xd5a34c79), - TOBN(0xc1eec55c, 0x164e1214), TOBN(0x891be86d, 0xa147bb03), - TOBN(0x9fab4d10, 0x0ba96835), TOBN(0xbf01e9b8, 0xa5c1ae9f), - TOBN(0x6b4de139, 0xb186ebc0), TOBN(0xd5c74c26, 0x85b91bca), - TOBN(0x5086a99c, 0xc2d93854), TOBN(0xeed62a7b, 0xa7a9dfbc), - TOBN(0x8778ed6f, 0x76b7618a), TOBN(0xbff750a5, 0x03b66062), - TOBN(0x4cb7be22, 0xb65186db), TOBN(0x369dfbf0, 0xcc3a6d13), - TOBN(0xc7dab26c, 0x7191a321), TOBN(0x9edac3f9, 0x40ed718e), - TOBN(0xbc142b36, 0xd0cfd183), TOBN(0xc8af82f6, 0x7c991693), - TOBN(0xb3d1e4d8, 0x97ce0b2a), TOBN(0xe6d7c87f, 0xc3a55cdf), - TOBN(0x35846b95, 0x68b81afe), TOBN(0x018d12af, 0xd3c239d8), - TOBN(0x2b2c6208, 0x01206e15), TOBN(0xe0e42453, 0xa3b882c6), - TOBN(0x854470a3, 0xa50162d5), TOBN(0x08157478, 0x7017a62a), - TOBN(0x18bd3fb4, 0x820357c7), TOBN(0x992039ae, 0x6f1458ad), - TOBN(0x9a1df3c5, 0x25b44aa1), TOBN(0x2d780357, 0xed3d5281), - TOBN(0x58cf7e4d, 0xc77ad4d4), TOBN(0xd49a7998, 0xf9df4fc4), - TOBN(0x4465a8b5, 0x1d71205e), TOBN(0xa0ee0ea6, 0x649254aa), - TOBN(0x4b5eeecf, 0xab7bd771), TOBN(0x6c873073, 0x35c262b9), - TOBN(0xdc5bd648, 0x3c9d61e7), TOBN(0x233d6d54, 0x321460d2), - TOBN(0xd20c5626, 0xfc195bcc), TOBN(0x25445958, 0x04d78b63), - TOBN(0xe03fcb3d, 0x17ec8ef3), TOBN(0x54b690d1, 0x46b8f781), - TOBN(0x82fa2c8a, 0x21230646), TOBN(0xf51aabb9, 0x084f418c), - TOBN(0xff4fbec1, 0x1a30ba43), TOBN(0x6a5acf73, 0x743c9df7), - TOBN(0x1da2b357, 0xd635b4d5), TOBN(0xc3de68dd, 0xecd5c1da), - TOBN(0xa689080b, 0xd61af0dd), TOBN(0xdea5938a, 0xd665bf99), - TOBN(0x0231d71a, 0xfe637294), TOBN(0x01968aa6, 0xa5a81cd8), - TOBN(0x11252d50, 0x048e63b5), TOBN(0xc446bc52, 0x6ca007e9), - TOBN(0xef8c50a6, 0x96d6134b), TOBN(0x9361fbf5, 0x9e09a05c), - TOBN(0xf17f85a6, 0xdca3291a), TOBN(0xb178d548, 0xff251a21), - TOBN(0x87f6374b, 0xa4df3915), TOBN(0x566ce1bf, 0x2fd5d608), - TOBN(0x425cba4d, 0x7de35102), TOBN(0x6b745f8f, 0x58c5d5e2), - TOBN(0x88402af6, 0x63122edf), TOBN(0x3190f9ed, 0x3b989a89), - TOBN(0x4ad3d387, 0xebba3156), TOBN(0xef385ad9, 0xc7c469a5), - TOBN(0xb08281de, 0x3f642c29), TOBN(0x20be0888, 0x910ffb88), - TOBN(0xf353dd4a, 0xd5292546), TOBN(0x3f1627de, 0x8377a262), - TOBN(0xa5faa013, 0xeefcd638), TOBN(0x8f3bf626, 0x74cc77c3), - TOBN(0x32618f65, 0xa348f55e), TOBN(0x5787c0dc, 0x9fefeb9e), - TOBN(0xf1673aa2, 0xd9a23e44), TOBN(0x88dfa993, 0x4e10690d), - TOBN(0x1ced1b36, 0x2bf91108), TOBN(0x9193ceca, 0x3af48649), - TOBN(0xfb34327d, 0x2d738fc5), TOBN(0x6697b037, 0x975fee6c), - TOBN(0x2f485da0, 0xc04079a5), TOBN(0x2cdf5735, 0x2feaa1ac), - TOBN(0x76944420, 0xbd55659e), TOBN(0x7973e32b, 0x4376090c), - TOBN(0x86bb4fe1, 0x163b591a), TOBN(0x10441aed, 0xc196f0ca), - TOBN(0x3b431f4a, 0x045ad915), TOBN(0x6c11b437, 0xa4afacb1), - TOBN(0x30b0c7db, 0x71fdbbd8), TOBN(0xb642931f, 0xeda65acd), - TOBN(0x4baae6e8, 0x9c92b235), TOBN(0xa73bbd0e, 0x6b3993a1), - TOBN(0xd06d60ec, 0x693dd031), TOBN(0x03cab91b, 0x7156881c), - TOBN(0xd615862f, 0x1db3574b), TOBN(0x485b0185, 0x64bb061a), - TOBN(0x27434988, 0xa0181e06), TOBN(0x2cd61ad4, 0xc1c0c757), - TOBN(0x3effed5a, 0x2ff9f403), TOBN(0x8dc98d8b, 0x62239029), - TOBN(0x2206021e, 0x1f17b70d), TOBN(0xafbec0ca, 0xbf510015), - TOBN(0x9fed7164, 0x80130dfa), TOBN(0x306dc2b5, 0x8a02dcf5), - TOBN(0x48f06620, 0xfeb10fc0), TOBN(0x78d1e1d5, 0x5a57cf51), - TOBN(0xadef8c5a, 0x192ef710), TOBN(0x88afbd4b, 0x3b7431f9), - TOBN(0x7e1f7407, 0x64250c9e), TOBN(0x6e31318d, 0xb58bec07), - TOBN(0xfd4fc4b8, 0x24f89b4e), TOBN(0x65a5dd88, 0x48c36a2a), - TOBN(0x4f1eccff, 0xf024baa7), TOBN(0x22a21cf2, 0xcba94650), - TOBN(0x95d29dee, 0x42a554f7), TOBN(0x828983a5, 0x002ec4ba), - TOBN(0x8112a1f7, 0x8badb73d), TOBN(0x79ea8897, 0xa27c1839), - TOBN(0x8969a5a7, 0xd065fd83), TOBN(0xf49af791, 0xb262a0bc), - TOBN(0xfcdea8b6, 0xaf2b5127), TOBN(0x10e913e1, 0x564c2dbc), - TOBN(0x51239d14, 0xbc21ef51), TOBN(0xe51c3ceb, 0x4ce57292), - TOBN(0x795ff068, 0x47bbcc3b), TOBN(0x86b46e1e, 0xbd7e11e6), - TOBN(0x0ea6ba23, 0x80041ef4), TOBN(0xd72fe505, 0x6262342e), - TOBN(0x8abc6dfd, 0x31d294d4), TOBN(0xbbe017a2, 0x1278c2c9), - TOBN(0xb1fcfa09, 0xb389328a), TOBN(0x322fbc62, 0xd01771b5), - TOBN(0x04c0d063, 0x60b045bf), TOBN(0xdb652edc, 0x10e52d01), - TOBN(0x50ef932c, 0x03ec6627), TOBN(0xde1b3b2d, 0xc1ee50e3), - TOBN(0x5ab7bdc5, 0xdc37a90d), TOBN(0xfea67213, 0x31e33a96), - TOBN(0x6482b5cb, 0x4f2999aa), TOBN(0x38476cc6, 0xb8cbf0dd), - TOBN(0x93ebfacb, 0x173405bb), TOBN(0x15cdafe7, 0xe52369ec), - TOBN(0xd42d5ba4, 0xd935b7db), TOBN(0x648b6004, 0x1c99a4cd), - TOBN(0x785101bd, 0xa3b5545b), TOBN(0x4bf2c38a, 0x9dd67faf), - TOBN(0xb1aadc63, 0x4442449c), TOBN(0xe0e9921a, 0x33ad4fb8), - TOBN(0x5c552313, 0xaa686d82), TOBN(0xdee635fa, 0x465d866c), - TOBN(0xbc3c224a, 0x18ee6e8a), TOBN(0xeed748a6, 0xed42e02f), - TOBN(0xe70f930a, 0xd474cd08), TOBN(0x774ea6ec, 0xfff24adf), - TOBN(0x03e2de1c, 0xf3480d4a), TOBN(0xf0d8edc7, 0xbc8acf1a), - TOBN(0xf23e3303, 0x68295a9c), TOBN(0xfadd5f68, 0xc546a97d), - TOBN(0x895597ad, 0x96f8acb1), TOBN(0xbddd49d5, 0x671bdae2), - TOBN(0x16fcd528, 0x21dd43f4), TOBN(0xa5a45412, 0x6619141a)}, - {TOBN(0x8ce9b6bf, 0xc360e25a), TOBN(0xe6425195, 0x075a1a78), - TOBN(0x9dc756a8, 0x481732f4), TOBN(0x83c0440f, 0x5432b57a), - TOBN(0xc670b3f1, 0xd720281f), TOBN(0x2205910e, 0xd135e051), - TOBN(0xded14b0e, 0xdb052be7), TOBN(0x697b3d27, 0xc568ea39), - TOBN(0x2e599b9a, 0xfb3ff9ed), TOBN(0x28c2e0ab, 0x17f6515c), - TOBN(0x1cbee4fd, 0x474da449), TOBN(0x071279a4, 0x4f364452), - TOBN(0x97abff66, 0x01fbe855), TOBN(0x3ee394e8, 0x5fda51c4), - TOBN(0x190385f6, 0x67597c0b), TOBN(0x6e9fccc6, 0xa27ee34b), - TOBN(0x0b89de93, 0x14092ebb), TOBN(0xf17256bd, 0x428e240c), - TOBN(0xcf89a7f3, 0x93d2f064), TOBN(0x4f57841e, 0xe1ed3b14), - TOBN(0x4ee14405, 0xe708d855), TOBN(0x856aae72, 0x03f1c3d0), - TOBN(0xc8e5424f, 0xbdd7eed5), TOBN(0x3333e4ef, 0x73ab4270), - TOBN(0x3bc77ade, 0xdda492f8), TOBN(0xc11a3aea, 0x78297205), - TOBN(0x5e89a3e7, 0x34931b4c), TOBN(0x17512e2e, 0x9f5694bb), - TOBN(0x5dc349f3, 0x177bf8b6), TOBN(0x232ea4ba, 0x08c7ff3e), - TOBN(0x9c4f9d16, 0xf511145d), TOBN(0xccf109a3, 0x33b379c3), - TOBN(0xe75e7a88, 0xa1f25897), TOBN(0x7ac6961f, 0xa1b5d4d8), - TOBN(0xe3e10773, 0x08f3ed5c), TOBN(0x208a54ec, 0x0a892dfb), - TOBN(0xbe826e19, 0x78660710), TOBN(0x0cf70a97, 0x237df2c8), - TOBN(0x418a7340, 0xed704da5), TOBN(0xa3eeb9a9, 0x08ca33fd), - TOBN(0x49d96233, 0x169bca96), TOBN(0x04d286d4, 0x2da6aafb), - TOBN(0xc09606ec, 0xa0c2fa94), TOBN(0x8869d0d5, 0x23ff0fb3), - TOBN(0xa99937e5, 0xd0150d65), TOBN(0xa92e2503, 0x240c14c9), - TOBN(0x656bf945, 0x108e2d49), TOBN(0x152a733a, 0xa2f59e2b), - TOBN(0xb4323d58, 0x8434a920), TOBN(0xc0af8e93, 0x622103c5), - TOBN(0x667518ef, 0x938dbf9a), TOBN(0xa1843073, 0x83a9cdf2), - TOBN(0x350a94aa, 0x5447ab80), TOBN(0xe5e5a325, 0xc75a3d61), - TOBN(0x74ba507f, 0x68411a9e), TOBN(0x10581fc1, 0x594f70c5), - TOBN(0x60e28570, 0x80eb24a9), TOBN(0x7bedfb4d, 0x488e0cfd), - TOBN(0x721ebbd7, 0xc259cdb8), TOBN(0x0b0da855, 0xbc6390a9), - TOBN(0x2b4d04db, 0xde314c70), TOBN(0xcdbf1fbc, 0x6c32e846), - TOBN(0x33833eab, 0xb162fc9e), TOBN(0x9939b48b, 0xb0dd3ab7), - TOBN(0x5aaa98a7, 0xcb0c9c8c), TOBN(0x75105f30, 0x81c4375c), - TOBN(0xceee5057, 0x5ef1c90f), TOBN(0xb31e065f, 0xc23a17bf), - TOBN(0x5364d275, 0xd4b6d45a), TOBN(0xd363f3ad, 0x62ec8996), - TOBN(0xb5d21239, 0x4391c65b), TOBN(0x84564765, 0xebb41b47), - TOBN(0x20d18ecc, 0x37107c78), TOBN(0xacff3b6b, 0x570c2a66), - TOBN(0x22f975d9, 0x9bd0d845), TOBN(0xef0a0c46, 0xba178fa0), - TOBN(0x1a419651, 0x76b6028e), TOBN(0xc49ec674, 0x248612d4), - TOBN(0x5b6ac4f2, 0x7338af55), TOBN(0x06145e62, 0x7bee5a36), - TOBN(0x33e95d07, 0xe75746b5), TOBN(0x1c1e1f6d, 0xc40c78be), - TOBN(0x967833ef, 0x222ff8e2), TOBN(0x4bedcf6a, 0xb49180ad), - TOBN(0x6b37e9c1, 0x3d7a4c8a), TOBN(0x2748887c, 0x6ddfe760), - TOBN(0xf7055123, 0xaa3a5bbc), TOBN(0x954ff225, 0x7bbb8e74), - TOBN(0xc42b8ab1, 0x97c3dfb9), TOBN(0x55a549b0, 0xcf168154), - TOBN(0xad6748e7, 0xc1b50692), TOBN(0x2775780f, 0x6fc5cbcb), - TOBN(0x4eab80b8, 0xe1c9d7c8), TOBN(0x8c69dae1, 0x3fdbcd56), - TOBN(0x47e6b4fb, 0x9969eace), TOBN(0x002f1085, 0xa705cb5a), - TOBN(0x4e23ca44, 0x6d3fea55), TOBN(0xb4ae9c86, 0xf4810568), - TOBN(0x47bfb91b, 0x2a62f27d), TOBN(0x60deb4c9, 0xd9bac28c), - TOBN(0xa892d894, 0x7de6c34c), TOBN(0x4ee68259, 0x4494587d), - TOBN(0x914ee14e, 0x1a3f8a5b), TOBN(0xbb113eaa, 0x28700385), - TOBN(0x81ca03b9, 0x2115b4c9), TOBN(0x7c163d38, 0x8908cad1), - TOBN(0xc912a118, 0xaa18179a), TOBN(0xe09ed750, 0x886e3081), - TOBN(0xa676e3fa, 0x26f516ca), TOBN(0x753cacf7, 0x8e732f91), - TOBN(0x51592aea, 0x833da8b4), TOBN(0xc626f42f, 0x4cbea8aa), - TOBN(0xef9dc899, 0xa7b56eaf), TOBN(0x00c0e52c, 0x34ef7316), - TOBN(0x5b1e4e24, 0xfe818a86), TOBN(0x9d31e20d, 0xc538be47), - TOBN(0x22eb932d, 0x3ed68974), TOBN(0xe44bbc08, 0x7c4e87c4), - TOBN(0x4121086e, 0x0dde9aef), TOBN(0x8e6b9cff, 0x134f4345), - TOBN(0x96892c1f, 0x711b0eb9), TOBN(0xb905f2c8, 0x780ab954), - TOBN(0xace26309, 0xa20792db), TOBN(0xec8ac9b3, 0x0684e126), - TOBN(0x486ad8b6, 0xb40a2447), TOBN(0x60121fc1, 0x9fe3fb24), - TOBN(0x5626fccf, 0x1a8e3b3f), TOBN(0x4e568622, 0x6ad1f394), - TOBN(0xda7aae0d, 0x196aa5a1), TOBN(0xe0df8c77, 0x1041b5fb), - TOBN(0x451465d9, 0x26b318b7), TOBN(0xc29b6e55, 0x7ab136e9), - TOBN(0x2c2ab48b, 0x71148463), TOBN(0xb5738de3, 0x64454a76), - TOBN(0x54ccf9a0, 0x5a03abe4), TOBN(0x377c0296, 0x0427d58e), - TOBN(0x73f5f0b9, 0x2bb39c1f), TOBN(0x14373f2c, 0xe608d8c5), - TOBN(0xdcbfd314, 0x00fbb805), TOBN(0xdf18fb20, 0x83afdcfb), - TOBN(0x81a57f42, 0x42b3523f), TOBN(0xe958532d, 0x87f650fb), - TOBN(0xaa8dc8b6, 0x8b0a7d7c), TOBN(0x1b75dfb7, 0x150166be), - TOBN(0x90e4f7c9, 0x2d7d1413), TOBN(0x67e2d6b5, 0x9834f597), - TOBN(0x4fd4f4f9, 0xa808c3e8), TOBN(0xaf8237e0, 0xd5281ec1), - TOBN(0x25ab5fdc, 0x84687cee), TOBN(0xc5ded6b1, 0xa5b26c09), - TOBN(0x8e4a5aec, 0xc8ea7650), TOBN(0x23b73e5c, 0x14cc417f), - TOBN(0x2bfb4318, 0x3037bf52), TOBN(0xb61e6db5, 0x78c725d7), - TOBN(0x8efd4060, 0xbbb3e5d7), TOBN(0x2e014701, 0xdbac488e), - TOBN(0xac75cf9a, 0x360aa449), TOBN(0xb70cfd05, 0x79634d08), - TOBN(0xa591536d, 0xfffb15ef), TOBN(0xb2c37582, 0xd07c106c), - TOBN(0xb4293fdc, 0xf50225f9), TOBN(0xc52e175c, 0xb0e12b03), - TOBN(0xf649c3ba, 0xd0a8bf64), TOBN(0x745a8fef, 0xeb8ae3c6), - TOBN(0x30d7e5a3, 0x58321bc3), TOBN(0xb1732be7, 0x0bc4df48), - TOBN(0x1f217993, 0xe9ea5058), TOBN(0xf7a71cde, 0x3e4fd745), - TOBN(0x86cc533e, 0x894c5bbb), TOBN(0x6915c7d9, 0x69d83082), - TOBN(0xa6aa2d05, 0x5815c244), TOBN(0xaeeee592, 0x49b22ce5), - TOBN(0x89e39d13, 0x78135486), TOBN(0x3a275c1f, 0x16b76f2f), - TOBN(0xdb6bcc1b, 0xe036e8f5), TOBN(0x4df69b21, 0x5e4709f5), - TOBN(0xa188b250, 0x2d0f39aa), TOBN(0x622118bb, 0x15a85947), - TOBN(0x2ebf520f, 0xfde0f4fa), TOBN(0xa40e9f29, 0x4860e539), - TOBN(0x7b6a51eb, 0x22b57f0f), TOBN(0x849a33b9, 0x7e80644a), - TOBN(0x50e5d16f, 0x1cf095fe), TOBN(0xd754b54e, 0xec55f002), - TOBN(0x5cfbbb22, 0x236f4a98), TOBN(0x0b0c59e9, 0x066800bb), - TOBN(0x4ac69a8f, 0x5a9a7774), TOBN(0x2b33f804, 0xd6bec948), - TOBN(0xb3729295, 0x32e6c466), TOBN(0x68956d0f, 0x4e599c73), - TOBN(0xa47a249f, 0x155c31cc), TOBN(0x24d80f0d, 0xe1ce284e), - TOBN(0xcd821dfb, 0x988baf01), TOBN(0xe6331a7d, 0xdbb16647), - TOBN(0x1eb8ad33, 0x094cb960), TOBN(0x593cca38, 0xc91bbca5), - TOBN(0x384aac8d, 0x26567456), TOBN(0x40fa0309, 0xc04b6490), - TOBN(0x97834cd6, 0xdab6c8f6), TOBN(0x68a7318d, 0x3f91e55f), - TOBN(0xa00fd04e, 0xfc4d3157), TOBN(0xb56f8ab2, 0x2bf3bdea), - TOBN(0x014f5648, 0x4fa57172), TOBN(0x948c5860, 0x450abdb3), - TOBN(0x342b5df0, 0x0ebd4f08), TOBN(0x3e5168cd, 0x0e82938e), - TOBN(0x7aedc1ce, 0xb0df5dd0), TOBN(0x6bbbc6d9, 0xe5732516), - TOBN(0xc7bfd486, 0x605daaa6), TOBN(0x46fd72b7, 0xbb9a6c9e), - TOBN(0xe4847fb1, 0xa124fb89), TOBN(0x75959cbd, 0xa2d8ffbc), - TOBN(0x42579f65, 0xc8a588ee), TOBN(0x368c92e6, 0xb80b499d), - TOBN(0xea4ef6cd, 0x999a5df1), TOBN(0xaa73bb7f, 0x936fe604), - TOBN(0xf347a70d, 0x6457d188), TOBN(0x86eda86b, 0x8b7a388b), - TOBN(0xb7cdff06, 0x0ccd6013), TOBN(0xbeb1b6c7, 0xd0053fb2), - TOBN(0x0b022387, 0x99240a9f), TOBN(0x1bbb384f, 0x776189b2), - TOBN(0x8695e71e, 0x9066193a), TOBN(0x2eb50097, 0x06ffac7e), - TOBN(0x0654a9c0, 0x4a7d2caa), TOBN(0x6f3fb3d1, 0xa5aaa290), - TOBN(0x835db041, 0xff476e8f), TOBN(0x540b8b0b, 0xc42295e4), - TOBN(0xa5c73ac9, 0x05e214f5), TOBN(0x9a74075a, 0x56a0b638), - TOBN(0x2e4b1090, 0xce9e680b), TOBN(0x57a5b479, 0x6b8d9afa), - TOBN(0x0dca48e7, 0x26bfe65c), TOBN(0x097e391c, 0x7290c307), - TOBN(0x683c462e, 0x6669e72e), TOBN(0xf505be1e, 0x062559ac), - TOBN(0x5fbe3ea1, 0xe3a3035a), TOBN(0x6431ebf6, 0x9cd50da8), - TOBN(0xfd169d5c, 0x1f6407f2), TOBN(0x8d838a95, 0x60fce6b8), - TOBN(0x2a2bfa7f, 0x650006f0), TOBN(0xdfd7dad3, 0x50c0fbb2), - TOBN(0x92452495, 0xccf9ad96), TOBN(0x183bf494, 0xd95635f9), - TOBN(0x02d5df43, 0x4a7bd989), TOBN(0x505385cc, 0xa5431095), - TOBN(0xdd98e67d, 0xfd43f53e), TOBN(0xd61e1a6c, 0x500c34a9), - TOBN(0x5a4b46c6, 0x4a8a3d62), TOBN(0x8469c4d0, 0x247743d2), - TOBN(0x2bb3a13d, 0x88f7e433), TOBN(0x62b23a10, 0x01be5849), - TOBN(0xe83596b4, 0xa63d1a4c), TOBN(0x454e7fea, 0x7d183f3e), - TOBN(0x643fce61, 0x17afb01c), TOBN(0x4e65e5e6, 0x1c4c3638), - TOBN(0x41d85ea1, 0xef74c45b), TOBN(0x2cfbfa66, 0xae328506), - TOBN(0x98b078f5, 0x3ada7da9), TOBN(0xd985fe37, 0xec752fbb), - TOBN(0xeece68fe, 0x5a0148b4), TOBN(0x6f9a55c7, 0x2d78136d), - TOBN(0x232dccc4, 0xd2b729ce), TOBN(0xa27e0dfd, 0x90aafbc4), - TOBN(0x96474452, 0x12b4603e), TOBN(0xa876c551, 0x6b706d14), - TOBN(0xdf145fcf, 0x69a9d412), TOBN(0xe2ab75b7, 0x2d479c34), - TOBN(0x12df9a76, 0x1a23ff97), TOBN(0xc6138992, 0x5d359d10), - TOBN(0x6e51c7ae, 0xfa835f22), TOBN(0x69a79cb1, 0xc0fcc4d9), - TOBN(0xf57f350d, 0x594cc7e1), TOBN(0x3079ca63, 0x3350ab79), - TOBN(0x226fb614, 0x9aff594a), TOBN(0x35afec02, 0x6d59a62b), - TOBN(0x9bee46f4, 0x06ed2c6e), TOBN(0x58da1735, 0x7d939a57), - TOBN(0x44c50402, 0x8fd1797e), TOBN(0xd8853e7c, 0x5ccea6ca), - TOBN(0x4065508d, 0xa35fcd5f), TOBN(0x8965df8c, 0x495ccaeb), - TOBN(0x0f2da850, 0x12e1a962), TOBN(0xee471b94, 0xc1cf1cc4), - TOBN(0xcef19bc8, 0x0a08fb75), TOBN(0x704958f5, 0x81de3591), - TOBN(0x2867f8b2, 0x3aef4f88), TOBN(0x8d749384, 0xea9f9a5f), - TOBN(0x1b385537, 0x8c9049f4), TOBN(0x5be948f3, 0x7b92d8b6), - TOBN(0xd96f725d, 0xb6e2bd6b), TOBN(0x37a222bc, 0x958c454d), - TOBN(0xe7c61abb, 0x8809bf61), TOBN(0x46f07fbc, 0x1346f18d), - TOBN(0xfb567a7a, 0xe87c0d1c), TOBN(0x84a461c8, 0x7ef3d07a), - TOBN(0x0a5adce6, 0xd9278d98), TOBN(0x24d94813, 0x9dfc73e1), - TOBN(0x4f3528b6, 0x054321c3), TOBN(0x2e03fdde, 0x692ea706), - TOBN(0x10e60619, 0x47b533c0), TOBN(0x1a8bc73f, 0x2ca3c055), - TOBN(0xae58d4b2, 0x1bb62b8f), TOBN(0xb2045a73, 0x584a24e3), - TOBN(0x3ab3d5af, 0xbd76e195), TOBN(0x478dd1ad, 0x6938a810), - TOBN(0x6ffab393, 0x6ee3d5cb), TOBN(0xdfb693db, 0x22b361e4), - TOBN(0xf9694496, 0x51dbf1a7), TOBN(0xcab4b4ef, 0x08a2e762), - TOBN(0xe8c92f25, 0xd39bba9a), TOBN(0x850e61bc, 0xf1464d96), - TOBN(0xb7e830e3, 0xdc09508b), TOBN(0xfaf6d2cf, 0x74317655), - TOBN(0x72606ceb, 0xdf690355), TOBN(0x48bb92b3, 0xd0c3ded6), - TOBN(0x65b75484, 0x5c7cf892), TOBN(0xf6cd7ac9, 0xd5d5f01f), - TOBN(0xc2c30a59, 0x96401d69), TOBN(0x91268650, 0xed921878), - TOBN(0x380bf913, 0xb78c558f), TOBN(0x43c0baeb, 0xc8afdaa9), - TOBN(0x377f61d5, 0x54f169d3), TOBN(0xf8da07e3, 0xae5ff20b), - TOBN(0xb676c49d, 0xa8a90ea8), TOBN(0x81c1ff2b, 0x83a29b21), - TOBN(0x383297ac, 0x2ad8d276), TOBN(0x3001122f, 0xba89f982), - TOBN(0xe1d794be, 0x6718e448), TOBN(0x246c1482, 0x7c3e6e13), - TOBN(0x56646ef8, 0x5d26b5ef), TOBN(0x80f5091e, 0x88069cdd), - TOBN(0xc5992e2f, 0x724bdd38), TOBN(0x02e915b4, 0x8471e8c7), - TOBN(0x96ff320a, 0x0d0ff2a9), TOBN(0xbf886487, 0x4384d1a0), - TOBN(0xbbe1e6a6, 0xc93f72d6), TOBN(0xd5f75d12, 0xcad800ea), - TOBN(0xfa40a09f, 0xe7acf117), TOBN(0x32c8cdd5, 0x7581a355), - TOBN(0x74221992, 0x7023c499), TOBN(0xa8afe5d7, 0x38ec3901), - TOBN(0x5691afcb, 0xa90e83f0), TOBN(0x41bcaa03, 0x0b8f8eac), - TOBN(0xe38b5ff9, 0x8d2668d5), TOBN(0x0715281a, 0x7ad81965), - TOBN(0x1bc8fc7c, 0x03c6ce11), TOBN(0xcbbee6e2, 0x8b650436), - TOBN(0x06b00fe8, 0x0cdb9808), TOBN(0x17d6e066, 0xfe3ed315), - TOBN(0x2e9d38c6, 0x4d0b5018), TOBN(0xab8bfd56, 0x844dcaef), - TOBN(0x42894a59, 0x513aed8b), TOBN(0xf77f3b6d, 0x314bd07a), - TOBN(0xbbdecb8f, 0x8e42b582), TOBN(0xf10e2fa8, 0xd2390fe6), - TOBN(0xefb95022, 0x62a2f201), TOBN(0x4d59ea50, 0x50ee32b0), - TOBN(0xd87f7728, 0x6da789a8), TOBN(0xcf98a2cf, 0xf79492c4), - TOBN(0xf9577239, 0x720943c2), TOBN(0xba044cf5, 0x3990b9d0), - TOBN(0x5aa8e823, 0x95f2884a), TOBN(0x834de6ed, 0x0278a0af), - TOBN(0xc8e1ee9a, 0x5f25bd12), TOBN(0x9259ceaa, 0x6f7ab271), - TOBN(0x7e6d97a2, 0x77d00b76), TOBN(0x5c0c6eea, 0xa437832a), - TOBN(0x5232c20f, 0x5606b81d), TOBN(0xabd7b375, 0x0d991ee5), - TOBN(0x4d2bfe35, 0x8632d951), TOBN(0x78f85146, 0x98ed9364), - TOBN(0x951873f0, 0xf30c3282), TOBN(0x0da8ac80, 0xa789230b), - TOBN(0x3ac7789c, 0x5398967f), TOBN(0xa69b8f7f, 0xbdda0fb5), - TOBN(0xe5db7717, 0x6add8545), TOBN(0x1b71cb66, 0x72c49b66), - TOBN(0xd8560739, 0x68421d77), TOBN(0x03840fe8, 0x83e3afea), - TOBN(0xb391dad5, 0x1ec69977), TOBN(0xae243fb9, 0x307f6726), - TOBN(0xc88ac87b, 0xe8ca160c), TOBN(0x5174cced, 0x4ce355f4), - TOBN(0x98a35966, 0xe58ba37d), TOBN(0xfdcc8da2, 0x7817335d), - TOBN(0x5b752830, 0x83fbc7bf), TOBN(0x68e419d4, 0xd9c96984), - TOBN(0x409a39f4, 0x02a40380), TOBN(0x88940faf, 0x1fe977bc), - TOBN(0xc640a94b, 0x8f8edea6), TOBN(0x1e22cd17, 0xed11547d), - TOBN(0xe28568ce, 0x59ffc3e2), TOBN(0x60aa1b55, 0xc1dee4e7), - TOBN(0xc67497c8, 0x837cb363), TOBN(0x06fb438a, 0x105a2bf2), - TOBN(0x30357ec4, 0x500d8e20), TOBN(0x1ad9095d, 0x0670db10), - TOBN(0x7f589a05, 0xc73b7cfd), TOBN(0xf544607d, 0x880d6d28), - TOBN(0x17ba93b1, 0xa20ef103), TOBN(0xad859130, 0x6ba6577b), - TOBN(0x65c91cf6, 0x6fa214a0), TOBN(0xd7d49c6c, 0x27990da5), - TOBN(0xecd9ec8d, 0x20bb569d), TOBN(0xbd4b2502, 0xeeffbc33), - TOBN(0x2056ca5a, 0x6bed0467), TOBN(0x7916a1f7, 0x5b63728c), - TOBN(0xd4f9497d, 0x53a4f566), TOBN(0x89734664, 0x97b56810), - TOBN(0xf8e1da74, 0x0494a621), TOBN(0x82546a93, 0x8d011c68), - TOBN(0x1f3acb19, 0xc61ac162), TOBN(0x52f8fa9c, 0xabad0d3e), - TOBN(0x15356523, 0xb4b7ea43), TOBN(0x5a16ad61, 0xae608125), - TOBN(0xb0bcb87f, 0x4faed184), TOBN(0x5f236b1d, 0x5029f45f), - TOBN(0xd42c7607, 0x0bc6b1fc), TOBN(0xc644324e, 0x68aefce3), - TOBN(0x8e191d59, 0x5c5d8446), TOBN(0xc0208077, 0x13ae1979), - TOBN(0xadcaee55, 0x3ba59cc7), TOBN(0x20ed6d6b, 0xa2cb81ba), - TOBN(0x0952ba19, 0xb6efcffc), TOBN(0x60f12d68, 0x97c0b87c), - TOBN(0x4ee2c7c4, 0x9caa30bc), TOBN(0x767238b7, 0x97fbff4e), - TOBN(0xebc73921, 0x501b5d92), TOBN(0x3279e3df, 0xc2a37737), - TOBN(0x9fc12bc8, 0x6d197543), TOBN(0xfa94dc6f, 0x0a40db4e), - TOBN(0x7392b41a, 0x530ccbbd), TOBN(0x87c82146, 0xea823525), - TOBN(0xa52f984c, 0x05d98d0c), TOBN(0x2ae57d73, 0x5ef6974c), - TOBN(0x9377f7bf, 0x3042a6dd), TOBN(0xb1a007c0, 0x19647a64), - TOBN(0xfaa9079a, 0x0cca9767), TOBN(0x3d81a25b, 0xf68f72d5), - TOBN(0x752067f8, 0xff81578e), TOBN(0x78622150, 0x9045447d), - TOBN(0xc0c22fcf, 0x0505aa6f), TOBN(0x1030f0a6, 0x6bed1c77), - TOBN(0x31f29f15, 0x1f0bd739), TOBN(0x2d7989c7, 0xe6debe85), - TOBN(0x5c070e72, 0x8e677e98), TOBN(0x0a817bd3, 0x06e81fd5), - TOBN(0xc110d830, 0xb0f2ac95), TOBN(0x48d0995a, 0xab20e64e), - TOBN(0x0f3e00e1, 0x7729cd9a), TOBN(0x2a570c20, 0xdd556946), - TOBN(0x912dbcfd, 0x4e86214d), TOBN(0x2d014ee2, 0xcf615498), - TOBN(0x55e2b1e6, 0x3530d76e), TOBN(0xc5135ae4, 0xfd0fd6d1), - TOBN(0x0066273a, 0xd4f3049f), TOBN(0xbb8e9893, 0xe7087477), - TOBN(0x2dba1ddb, 0x14c6e5fd), TOBN(0xdba37886, 0x51f57e6c), - TOBN(0x5aaee0a6, 0x5a72f2cf), TOBN(0x1208bfbf, 0x7bea5642), - TOBN(0xf5c6aa3b, 0x67872c37), TOBN(0xd726e083, 0x43f93224), - TOBN(0x1854daa5, 0x061f1658), TOBN(0xc0016df1, 0xdf0cd2b3), - TOBN(0xc2a3f23e, 0x833d50de), TOBN(0x73b681d2, 0xbbbd3017), - TOBN(0x2f046dc4, 0x3ac343c0), TOBN(0x9c847e7d, 0x85716421), - TOBN(0xe1e13c91, 0x0917eed4), TOBN(0x3fc9eebd, 0x63a1b9c6), - TOBN(0x0f816a72, 0x7fe02299), TOBN(0x6335ccc2, 0x294f3319), - TOBN(0x3820179f, 0x4745c5be), TOBN(0xe647b782, 0x922f066e), - TOBN(0xc22e49de, 0x02cafb8a), TOBN(0x299bc2ff, 0xfcc2eccc), - TOBN(0x9a8feea2, 0x6e0e8282), TOBN(0xa627278b, 0xfe893205), - TOBN(0xa7e19733, 0x7933e47b), TOBN(0xf4ff6b13, 0x2e766402), - TOBN(0xa4d8be0a, 0x98440d9f), TOBN(0x658f5c2f, 0x38938808), - TOBN(0x90b75677, 0xc95b3b3e), TOBN(0xfa044269, 0x3137b6ff), - TOBN(0x077b039b, 0x43c47c29), TOBN(0xcca95dd3, 0x8a6445b2), - TOBN(0x0b498ba4, 0x2333fc4c), TOBN(0x274f8e68, 0xf736a1b1), - TOBN(0x6ca348fd, 0x5f1d4b2e), TOBN(0x24d3be78, 0xa8f10199), - TOBN(0x8535f858, 0xca14f530), TOBN(0xa6e7f163, 0x5b982e51), - TOBN(0x847c8512, 0x36e1bf62), TOBN(0xf6a7c58e, 0x03448418), - TOBN(0x583f3703, 0xf9374ab6), TOBN(0x864f9195, 0x6e564145), - TOBN(0x33bc3f48, 0x22526d50), TOBN(0x9f323c80, 0x1262a496), - TOBN(0xaa97a7ae, 0x3f046a9a), TOBN(0x70da183e, 0xdf8a039a), - TOBN(0x5b68f71c, 0x52aa0ba6), TOBN(0x9be0fe51, 0x21459c2d), - TOBN(0xc1e17eb6, 0xcbc613e5), TOBN(0x33131d55, 0x497ea61c), - TOBN(0x2f69d39e, 0xaf7eded5), TOBN(0x73c2f434, 0xde6af11b), - TOBN(0x4ca52493, 0xa4a375fa), TOBN(0x5f06787c, 0xb833c5c2), - TOBN(0x814e091f, 0x3e6e71cf), TOBN(0x76451f57, 0x8b746666)}, - {TOBN(0x80f9bdef, 0x694db7e0), TOBN(0xedca8787, 0xb9fcddc6), - TOBN(0x51981c34, 0x03b8dce1), TOBN(0x4274dcf1, 0x70e10ba1), - TOBN(0xf72743b8, 0x6def6d1a), TOBN(0xd25b1670, 0xebdb1866), - TOBN(0xc4491e8c, 0x050c6f58), TOBN(0x2be2b2ab, 0x87fbd7f5), - TOBN(0x3e0e5c9d, 0xd111f8ec), TOBN(0xbcc33f8d, 0xb7c4e760), - TOBN(0x702f9a91, 0xbd392a51), TOBN(0x7da4a795, 0xc132e92d), - TOBN(0x1a0b0ae3, 0x0bb1151b), TOBN(0x54febac8, 0x02e32251), - TOBN(0xea3a5082, 0x694e9e78), TOBN(0xe58ffec1, 0xe4fe40b8), - TOBN(0xf85592fc, 0xd1e0cf9e), TOBN(0xdea75f0d, 0xc0e7b2e8), - TOBN(0xc04215cf, 0xc135584e), TOBN(0x174fc727, 0x2f57092a), - TOBN(0xe7277877, 0xeb930bea), TOBN(0x504caccb, 0x5eb02a5a), - TOBN(0xf9fe08f7, 0xf5241b9b), TOBN(0xe7fb62f4, 0x8d5ca954), - TOBN(0xfbb8349d, 0x29c4120b), TOBN(0x9f94391f, 0xc0d0d915), - TOBN(0xc4074fa7, 0x5410ba51), TOBN(0xa66adbf6, 0x150a5911), - TOBN(0xc164543c, 0x34bfca38), TOBN(0xe0f27560, 0xb9e1ccfc), - TOBN(0x99da0f53, 0xe820219c), TOBN(0xe8234498, 0xc6b4997a), - TOBN(0xcfb88b76, 0x9d4c5423), TOBN(0x9e56eb10, 0xb0521c49), - TOBN(0x418e0b5e, 0xbe8700a1), TOBN(0x00cbaad6, 0xf93cb58a), - TOBN(0xe923fbde, 0xd92a5e67), TOBN(0xca4979ac, 0x1f347f11), - TOBN(0x89162d85, 0x6bc0585b), TOBN(0xdd6254af, 0xac3c70e3), - TOBN(0x7b23c513, 0x516e19e4), TOBN(0x56e2e847, 0xc5c4d593), - TOBN(0x9f727d73, 0x5ce71ef6), TOBN(0x5b6304a6, 0xf79a44c5), - TOBN(0x6638a736, 0x3ab7e433), TOBN(0x1adea470, 0xfe742f83), - TOBN(0xe054b854, 0x5b7fc19f), TOBN(0xf935381a, 0xba1d0698), - TOBN(0x546eab2d, 0x799e9a74), TOBN(0x96239e0e, 0xa949f729), - TOBN(0xca274c6b, 0x7090055a), TOBN(0x835142c3, 0x9020c9b0), - TOBN(0xa405667a, 0xa2e8807f), TOBN(0x29f2c085, 0x1aa3d39e), - TOBN(0xcc555d64, 0x42fc72f5), TOBN(0xe856e0e7, 0xfbeacb3c), - TOBN(0xb5504f9d, 0x918e4936), TOBN(0x65035ef6, 0xb2513982), - TOBN(0x0553a0c2, 0x6f4d9cb9), TOBN(0x6cb10d56, 0xbea85509), - TOBN(0x48d957b7, 0xa242da11), TOBN(0x16a4d3dd, 0x672b7268), - TOBN(0x3d7e637c, 0x8502a96b), TOBN(0x27c7032b, 0x730d463b), - TOBN(0xbdc02b18, 0xe4136a14), TOBN(0xbacf969d, 0x678e32bf), - TOBN(0xc98d89a3, 0xdd9c3c03), TOBN(0x7b92420a, 0x23becc4f), - TOBN(0xd4b41f78, 0xc64d565c), TOBN(0x9f969d00, 0x10f28295), - TOBN(0xec7f7f76, 0xb13d051a), TOBN(0x08945e1e, 0xa92da585), - TOBN(0x55366b7d, 0x5846426f), TOBN(0xe7d09e89, 0x247d441d), - TOBN(0x510b404d, 0x736fbf48), TOBN(0x7fa003d0, 0xe784bd7d), - TOBN(0x25f7614f, 0x17fd9596), TOBN(0x49e0e0a1, 0x35cb98db), - TOBN(0x2c65957b, 0x2e83a76a), TOBN(0x5d40da8d, 0xcddbe0f8), - TOBN(0xf2b8c405, 0x050bad24), TOBN(0x8918426d, 0xc2aa4823), - TOBN(0x2aeab3dd, 0xa38365a7), TOBN(0x72031717, 0x7c91b690), - TOBN(0x8b00d699, 0x60a94120), TOBN(0x478a255d, 0xe99eaeec), - TOBN(0xbf656a5f, 0x6f60aafd), TOBN(0xdfd7cb75, 0x5dee77b3), - TOBN(0x37f68bb4, 0xa595939d), TOBN(0x03556479, 0x28740217), - TOBN(0x8e740e7c, 0x84ad7612), TOBN(0xd89bc843, 0x9044695f), - TOBN(0xf7f3da5d, 0x85a9184d), TOBN(0x562563bb, 0x9fc0b074), - TOBN(0x06d2e6aa, 0xf88a888e), TOBN(0x612d8643, 0x161fbe7c), - TOBN(0x465edba7, 0xf64085e7), TOBN(0xb230f304, 0x29aa8511), - TOBN(0x53388426, 0xcda2d188), TOBN(0x90885735, 0x4b666649), - TOBN(0x6f02ff9a, 0x652f54f6), TOBN(0x65c82294, 0x5fae2bf0), - TOBN(0x7816ade0, 0x62f5eee3), TOBN(0xdcdbdf43, 0xfcc56d70), - TOBN(0x9fb3bba3, 0x54530bb2), TOBN(0xbde3ef77, 0xcb0869ea), - TOBN(0x89bc9046, 0x0b431163), TOBN(0x4d03d7d2, 0xe4819a35), - TOBN(0x33ae4f9e, 0x43b6a782), TOBN(0x216db307, 0x9c88a686), - TOBN(0x91dd88e0, 0x00ffedd9), TOBN(0xb280da9f, 0x12bd4840), - TOBN(0x32a7cb8a, 0x1635e741), TOBN(0xfe14008a, 0x78be02a7), - TOBN(0x3fafb334, 0x1b7ae030), TOBN(0x7fd508e7, 0x5add0ce9), - TOBN(0x72c83219, 0xd607ad51), TOBN(0x0f229c0a, 0x8d40964a), - TOBN(0x1be2c336, 0x1c878da2), TOBN(0xe0c96742, 0xeab2ab86), - TOBN(0x458f8691, 0x3e538cd7), TOBN(0xa7001f6c, 0x8e08ad53), - TOBN(0x52b8c6e6, 0xbf5d15ff), TOBN(0x548234a4, 0x011215dd), - TOBN(0xff5a9d2d, 0x3d5b4045), TOBN(0xb0ffeeb6, 0x4a904190), - TOBN(0x55a3aca4, 0x48607f8b), TOBN(0x8cbd665c, 0x30a0672a), - TOBN(0x87f834e0, 0x42583068), TOBN(0x02da2aeb, 0xf3f6e683), - TOBN(0x6b763e5d, 0x05c12248), TOBN(0x7230378f, 0x65a8aefc), - TOBN(0x93bd80b5, 0x71e8e5ca), TOBN(0x53ab041c, 0xb3b62524), - TOBN(0x1b860513, 0x6c9c552e), TOBN(0xe84d402c, 0xd5524e66), - TOBN(0xa37f3573, 0xf37f5937), TOBN(0xeb0f6c7d, 0xd1e4fca5), - TOBN(0x2965a554, 0xac8ab0fc), TOBN(0x17fbf56c, 0x274676ac), - TOBN(0x2e2f6bd9, 0xacf7d720), TOBN(0x41fc8f88, 0x10224766), - TOBN(0x517a14b3, 0x85d53bef), TOBN(0xdae327a5, 0x7d76a7d1), - TOBN(0x6ad0a065, 0xc4818267), TOBN(0x33aa189b, 0x37c1bbc1), - TOBN(0x64970b52, 0x27392a92), TOBN(0x21699a1c, 0x2d1535ea), - TOBN(0xcd20779c, 0xc2d7a7fd), TOBN(0xe3186059, 0x99c83cf2), - TOBN(0x9b69440b, 0x72c0b8c7), TOBN(0xa81497d7, 0x7b9e0e4d), - TOBN(0x515d5c89, 0x1f5f82dc), TOBN(0x9a7f67d7, 0x6361079e), - TOBN(0xa8da81e3, 0x11a35330), TOBN(0xe44990c4, 0x4b18be1b), - TOBN(0xc7d5ed95, 0xaf103e59), TOBN(0xece8aba7, 0x8dac9261), - TOBN(0xbe82b099, 0x9394b8d3), TOBN(0x6830f09a, 0x16adfe83), - TOBN(0x250a29b4, 0x88172d01), TOBN(0x8b20bd65, 0xcaff9e02), - TOBN(0xb8a7661e, 0xe8a6329a), TOBN(0x4520304d, 0xd3fce920), - TOBN(0xae45da1f, 0x2b47f7ef), TOBN(0xe07f5288, 0x5bffc540), - TOBN(0xf7997009, 0x3464f874), TOBN(0x2244c2cd, 0xa6fa1f38), - TOBN(0x43c41ac1, 0x94d7d9b1), TOBN(0x5bafdd82, 0xc82e7f17), - TOBN(0xdf0614c1, 0x5fda0fca), TOBN(0x74b043a7, 0xa8ae37ad), - TOBN(0x3ba6afa1, 0x9e71734c), TOBN(0x15d5437e, 0x9c450f2e), - TOBN(0x4a5883fe, 0x67e242b1), TOBN(0x5143bdc2, 0x2c1953c2), - TOBN(0x542b8b53, 0xfc5e8920), TOBN(0x363bf9a8, 0x9a9cee08), - TOBN(0x02375f10, 0xc3486e08), TOBN(0x2037543b, 0x8c5e70d2), - TOBN(0x7109bccc, 0x625640b4), TOBN(0xcbc1051e, 0x8bc62c3b), - TOBN(0xf8455fed, 0x803f26ea), TOBN(0x6badceab, 0xeb372424), - TOBN(0xa2a9ce7c, 0x6b53f5f9), TOBN(0x64246595, 0x1b176d99), - TOBN(0xb1298d36, 0xb95c081b), TOBN(0x53505bb8, 0x1d9a9ee6), - TOBN(0x3f6f9e61, 0xf2ba70b0), TOBN(0xd07e16c9, 0x8afad453), - TOBN(0x9f1694bb, 0xe7eb4a6a), TOBN(0xdfebced9, 0x3cb0bc8e), - TOBN(0x92d3dcdc, 0x53868c8b), TOBN(0x174311a2, 0x386107a6), - TOBN(0x4109e07c, 0x689b4e64), TOBN(0x30e4587f, 0x2df3dcb6), - TOBN(0x841aea31, 0x0811b3b2), TOBN(0x6144d41d, 0x0cce43ea), - TOBN(0x464c4581, 0x2a9a7803), TOBN(0xd03d371f, 0x3e158930), - TOBN(0xc676d7f2, 0xb1f3390b), TOBN(0x9f7a1b8c, 0xa5b61272), - TOBN(0x4ebebfc9, 0xc2e127a9), TOBN(0x4602500c, 0x5dd997bf), - TOBN(0x7f09771c, 0x4711230f), TOBN(0x058eb37c, 0x020f09c1), - TOBN(0xab693d4b, 0xfee5e38b), TOBN(0x9289eb1f, 0x4653cbc0), - TOBN(0xbecf46ab, 0xd51b9cf5), TOBN(0xd2aa9c02, 0x9f0121af), - TOBN(0x36aaf7d2, 0xe90dc274), TOBN(0x909e4ea0, 0x48b95a3c), - TOBN(0xe6b70496, 0x6f32dbdb), TOBN(0x672188a0, 0x8b030b3e), - TOBN(0xeeffe5b3, 0xcfb617e2), TOBN(0x87e947de, 0x7c82709e), - TOBN(0xa44d2b39, 0x1770f5a7), TOBN(0xe4d4d791, 0x0e44eb82), - TOBN(0x42e69d1e, 0x3f69712a), TOBN(0xbf11c4d6, 0xac6a820e), - TOBN(0xb5e7f3e5, 0x42c4224c), TOBN(0xd6b4e81c, 0x449d941c), - TOBN(0x5d72bd16, 0x5450e878), TOBN(0x6a61e28a, 0xee25ac54), - TOBN(0x33272094, 0xe6f1cd95), TOBN(0x7512f30d, 0x0d18673f), - TOBN(0x32f7a4ca, 0x5afc1464), TOBN(0x2f095656, 0x6bbb977b), - TOBN(0x586f47ca, 0xa8226200), TOBN(0x02c868ad, 0x1ac07369), - TOBN(0x4ef2b845, 0xc613acbe), TOBN(0x43d7563e, 0x0386054c), - TOBN(0x54da9dc7, 0xab952578), TOBN(0xb5423df2, 0x26e84d0b), - TOBN(0xa8b64eeb, 0x9b872042), TOBN(0xac205782, 0x5990f6df), - TOBN(0x4ff696eb, 0x21f4c77a), TOBN(0x1a79c3e4, 0xaab273af), - TOBN(0x29bc922e, 0x9436b3f1), TOBN(0xff807ef8, 0xd6d9a27a), - TOBN(0x82acea3d, 0x778f22a0), TOBN(0xfb10b2e8, 0x5b5e7469), - TOBN(0xc0b16980, 0x2818ee7d), TOBN(0x011afff4, 0xc91c1a2f), - TOBN(0x95a6d126, 0xad124418), TOBN(0x31c081a5, 0xe72e295f), - TOBN(0x36bb283a, 0xf2f4db75), TOBN(0xd115540f, 0x7acef462), - TOBN(0xc7f3a8f8, 0x33f6746c), TOBN(0x21e46f65, 0xfea990ca), - TOBN(0x915fd5c5, 0xcaddb0a9), TOBN(0xbd41f016, 0x78614555), - TOBN(0x346f4434, 0x426ffb58), TOBN(0x80559436, 0x14dbc204), - TOBN(0xf3dd20fe, 0x5a969b7f), TOBN(0x9d59e956, 0xe899a39a), - TOBN(0xf1b0971c, 0x8ad4cf4b), TOBN(0x03448860, 0x2ffb8fb8), - TOBN(0xf071ac3c, 0x65340ba4), TOBN(0x408d0596, 0xb27fd758), - TOBN(0xe7c78ea4, 0x98c364b0), TOBN(0xa4aac4a5, 0x051e8ab5), - TOBN(0xb9e1d560, 0x485d9002), TOBN(0x9acd518a, 0x88844455), - TOBN(0xe4ca688f, 0xd06f56c0), TOBN(0xa48af70d, 0xdf027972), - TOBN(0x691f0f04, 0x5e9a609d), TOBN(0xa9dd82cd, 0xee61270e), - TOBN(0x8903ca63, 0xa0ef18d3), TOBN(0x9fb7ee35, 0x3d6ca3bd), - TOBN(0xa7b4a09c, 0xabf47d03), TOBN(0x4cdada01, 0x1c67de8e), - TOBN(0x52003749, 0x9355a244), TOBN(0xe77fd2b6, 0x4f2151a9), - TOBN(0x695d6cf6, 0x66b4efcb), TOBN(0xc5a0cacf, 0xda2cfe25), - TOBN(0x104efe5c, 0xef811865), TOBN(0xf52813e8, 0x9ea5cc3d), - TOBN(0x855683dc, 0x40b58dbc), TOBN(0x0338ecde, 0x175fcb11), - TOBN(0xf9a05637, 0x74921592), TOBN(0xb4f1261d, 0xb9bb9d31), - TOBN(0x551429b7, 0x4e9c5459), TOBN(0xbe182e6f, 0x6ea71f53), - TOBN(0xd3a3b07c, 0xdfc50573), TOBN(0x9ba1afda, 0x62be8d44), - TOBN(0x9bcfd2cb, 0x52ab65d3), TOBN(0xdf11d547, 0xa9571802), - TOBN(0x099403ee, 0x02a2404a), TOBN(0x497406f4, 0x21088a71), - TOBN(0x99479409, 0x5004ae71), TOBN(0xbdb42078, 0xa812c362), - TOBN(0x2b72a30f, 0xd8828442), TOBN(0x283add27, 0xfcb5ed1c), - TOBN(0xf7c0e200, 0x66a40015), TOBN(0x3e3be641, 0x08b295ef), - TOBN(0xac127dc1, 0xe038a675), TOBN(0x729deff3, 0x8c5c6320), - TOBN(0xb7df8fd4, 0xa90d2c53), TOBN(0x9b74b0ec, 0x681e7cd3), - TOBN(0x5cb5a623, 0xdab407e5), TOBN(0xcdbd3615, 0x76b340c6), - TOBN(0xa184415a, 0x7d28392c), TOBN(0xc184c1d8, 0xe96f7830), - TOBN(0xc3204f19, 0x81d3a80f), TOBN(0xfde0c841, 0xc8e02432), - TOBN(0x78203b3e, 0x8149e0c1), TOBN(0x5904bdbb, 0x08053a73), - TOBN(0x30fc1dd1, 0x101b6805), TOBN(0x43c223bc, 0x49aa6d49), - TOBN(0x9ed67141, 0x7a174087), TOBN(0x311469a0, 0xd5997008), - TOBN(0xb189b684, 0x5e43fc61), TOBN(0xf3282375, 0xe0d3ab57), - TOBN(0x4fa34b67, 0xb1181da8), TOBN(0x621ed0b2, 0x99ee52b8), - TOBN(0x9b178de1, 0xad990676), TOBN(0xd51de67b, 0x56d54065), - TOBN(0x2a2c27c4, 0x7538c201), TOBN(0x33856ec8, 0x38a40f5c), - TOBN(0x2522fc15, 0xbe6cdcde), TOBN(0x1e603f33, 0x9f0c6f89), - TOBN(0x7994edc3, 0x103e30a6), TOBN(0x033a00db, 0x220c853e), - TOBN(0xd3cfa409, 0xf7bb7fd7), TOBN(0x70f8781e, 0x462d18f6), - TOBN(0xbbd82980, 0x687fe295), TOBN(0x6eef4c32, 0x595669f3), - TOBN(0x86a9303b, 0x2f7e85c3), TOBN(0x5fce4621, 0x71988f9b), - TOBN(0x5b935bf6, 0xc138acb5), TOBN(0x30ea7d67, 0x25661212), - TOBN(0xef1eb5f4, 0xe51ab9a2), TOBN(0x0587c98a, 0xae067c78), - TOBN(0xb3ce1b3c, 0x77ca9ca6), TOBN(0x2a553d4d, 0x54b5f057), - TOBN(0xc7898236, 0x4da29ec2), TOBN(0xdbdd5d13, 0xb9c57316), - TOBN(0xc57d6e6b, 0x2cd80d47), TOBN(0x80b460cf, 0xfe9e7391), - TOBN(0x98648cab, 0xf963c31e), TOBN(0x67f9f633, 0xcc4d32fd), - TOBN(0x0af42a9d, 0xfdf7c687), TOBN(0x55f292a3, 0x0b015ea7), - TOBN(0x89e468b2, 0xcd21ab3d), TOBN(0xe504f022, 0xc393d392), - TOBN(0xab21e1d4, 0xa5013af9), TOBN(0xe3283f78, 0xc2c28acb), - TOBN(0xf38b35f6, 0x226bf99f), TOBN(0xe8354274, 0x0e291e69), - TOBN(0x61673a15, 0xb20c162d), TOBN(0xc101dc75, 0xb04fbdbe), - TOBN(0x8323b4c2, 0x255bd617), TOBN(0x6c969693, 0x6c2a9154), - TOBN(0xc6e65860, 0x62679387), TOBN(0x8e01db0c, 0xb8c88e23), - TOBN(0x33c42873, 0x893a5559), TOBN(0x7630f04b, 0x47a3e149), - TOBN(0xb5d80805, 0xddcf35f8), TOBN(0x582ca080, 0x77dfe732), - TOBN(0x2c7156e1, 0x0b1894a0), TOBN(0x92034001, 0xd81c68c0), - TOBN(0xed225d00, 0xc8b115b5), TOBN(0x237f9c22, 0x83b907f2), - TOBN(0x0ea2f32f, 0x4470e2c0), TOBN(0xb725f7c1, 0x58be4e95), - TOBN(0x0f1dcafa, 0xb1ae5463), TOBN(0x59ed5187, 0x1ba2fc04), - TOBN(0xf6e0f316, 0xd0115d4d), TOBN(0x5180b12f, 0xd3691599), - TOBN(0x157e32c9, 0x527f0a41), TOBN(0x7b0b081d, 0xa8e0ecc0), - TOBN(0x6dbaaa8a, 0xbf4f0dd0), TOBN(0x99b289c7, 0x4d252696), - TOBN(0x79b7755e, 0xdbf864fe), TOBN(0x6974e2b1, 0x76cad3ab), - TOBN(0x35dbbee2, 0x06ddd657), TOBN(0xe7cbdd11, 0x2ff3a96d), - TOBN(0x88381968, 0x076be758), TOBN(0x2d737e72, 0x08c91f5d), - TOBN(0x5f83ab62, 0x86ec3776), TOBN(0x98aa649d, 0x945fa7a1), - TOBN(0xf477ec37, 0x72ef0933), TOBN(0x66f52b1e, 0x098c17b1), - TOBN(0x9eec58fb, 0xd803738b), TOBN(0x91aaade7, 0xe4e86aa4), - TOBN(0x6b1ae617, 0xa5b51492), TOBN(0x63272121, 0xbbc45974), - TOBN(0x7e0e28f0, 0x862c5129), TOBN(0x0a8f79a9, 0x3321a4a0), - TOBN(0xe26d1664, 0x5041c88f), TOBN(0x0571b805, 0x53233e3a), - TOBN(0xd1b0ccde, 0xc9520711), TOBN(0x55a9e4ed, 0x3c8b84bf), - TOBN(0x9426bd39, 0xa1fef314), TOBN(0x4f5f638e, 0x6eb93f2b), - TOBN(0xba2a1ed3, 0x2bf9341b), TOBN(0xd63c1321, 0x4d42d5a9), - TOBN(0xd2964a89, 0x316dc7c5), TOBN(0xd1759606, 0xca511851), - TOBN(0xd8a9201f, 0xf9e6ed35), TOBN(0xb7b5ee45, 0x6736925a), - TOBN(0x0a83fbbc, 0x99581af7), TOBN(0x3076bc40, 0x64eeb051), - TOBN(0x5511c98c, 0x02dec312), TOBN(0x270de898, 0x238dcb78), - TOBN(0x2cf4cf9c, 0x539c08c9), TOBN(0xa70cb65e, 0x38d3b06e), - TOBN(0xb12ec10e, 0xcfe57bbd), TOBN(0x82c7b656, 0x35a0c2b5), - TOBN(0xddc7d5cd, 0x161c67bd), TOBN(0xe32e8985, 0xae3a32cc), - TOBN(0x7aba9444, 0xd11a5529), TOBN(0xe964ed02, 0x2427fa1a), - TOBN(0x1528392d, 0x24a1770a), TOBN(0xa152ce2c, 0x12c72fcd), - TOBN(0x714553a4, 0x8ec07649), TOBN(0x18b4c290, 0x459dd453), - TOBN(0xea32b714, 0x7b64b110), TOBN(0xb871bfa5, 0x2e6f07a2), - TOBN(0xb67112e5, 0x9e2e3c9b), TOBN(0xfbf250e5, 0x44aa90f6), - TOBN(0xf77aedb8, 0xbd539006), TOBN(0x3b0cdf9a, 0xd172a66f), - TOBN(0xedf69fea, 0xf8c51187), TOBN(0x05bb67ec, 0x741e4da7), - TOBN(0x47df0f32, 0x08114345), TOBN(0x56facb07, 0xbb9792b1), - TOBN(0xf3e007e9, 0x8f6229e4), TOBN(0x62d103f4, 0x526fba0f), - TOBN(0x4f33bef7, 0xb0339d79), TOBN(0x9841357b, 0xb59bfec1), - TOBN(0xfa8dbb59, 0xc34e6705), TOBN(0xc3c7180b, 0x7fdaa84c), - TOBN(0xf95872fc, 0xa4108537), TOBN(0x8750cc3b, 0x932a3e5a), - TOBN(0xb61cc69d, 0xb7275d7d), TOBN(0xffa0168b, 0x2e59b2e9), - TOBN(0xca032abc, 0x6ecbb493), TOBN(0x1d86dbd3, 0x2c9082d8), - TOBN(0xae1e0b67, 0xe28ef5ba), TOBN(0x2c9a4699, 0xcb18e169), - TOBN(0x0ecd0e33, 0x1e6bbd20), TOBN(0x571b360e, 0xaf5e81d2), - TOBN(0xcd9fea58, 0x101c1d45), TOBN(0x6651788e, 0x18880452), - TOBN(0xa9972635, 0x1f8dd446), TOBN(0x44bed022, 0xe37281d0), - TOBN(0x094b2b2d, 0x33da525d), TOBN(0xf193678e, 0x13144fd8), - TOBN(0xb8ab5ba4, 0xf4c1061d), TOBN(0x4343b5fa, 0xdccbe0f4), - TOBN(0xa8702371, 0x63812713), TOBN(0x47bf6d2d, 0xf7611d93), - TOBN(0x46729b8c, 0xbd21e1d7), TOBN(0x7484d4e0, 0xd629e77d), - TOBN(0x830e6eea, 0x60dbac1f), TOBN(0x23d8c484, 0xda06a2f7), - TOBN(0x896714b0, 0x50ca535b), TOBN(0xdc8d3644, 0xebd97a9b), - TOBN(0x106ef9fa, 0xb12177b4), TOBN(0xf79bf464, 0x534d5d9c), - TOBN(0x2537a349, 0xa6ab360b), TOBN(0xc7c54253, 0xa00c744f), - TOBN(0xb3c7a047, 0xe5911a76), TOBN(0x61ffa5c8, 0x647f1ee7), - TOBN(0x15aed36f, 0x8f56ab42), TOBN(0x6a0d41b0, 0xa3ff9ac9), - TOBN(0x68f469f5, 0xcc30d357), TOBN(0xbe9adf81, 0x6b72be96), - TOBN(0x1cd926fe, 0x903ad461), TOBN(0x7e89e38f, 0xcaca441b), - TOBN(0xf0f82de5, 0xfacf69d4), TOBN(0x363b7e76, 0x4775344c), - TOBN(0x6894f312, 0xb2e36d04), TOBN(0x3c6cb4fe, 0x11d1c9a5), - TOBN(0x85d9c339, 0x4008e1f2), TOBN(0x5e9a85ea, 0x249f326c), - TOBN(0xdc35c60a, 0x678c5e06), TOBN(0xc08b944f, 0x9f86fba9), - TOBN(0xde40c02c, 0x89f71f0f), TOBN(0xad8f3e31, 0xff3da3c0), - TOBN(0x3ea5096b, 0x42125ded), TOBN(0x13879cbf, 0xa7379183), - TOBN(0x6f4714a5, 0x6b306a0b), TOBN(0x359c2ea6, 0x67646c5e), - TOBN(0xfacf8943, 0x07726368), TOBN(0x07a58935, 0x65ff431e), - TOBN(0x24d661d1, 0x68754ab0), TOBN(0x801fce1d, 0x6f429a76), - TOBN(0xc068a85f, 0xa58ce769), TOBN(0xedc35c54, 0x5d5eca2b), - TOBN(0xea31276f, 0xa3f660d1), TOBN(0xa0184ebe, 0xb8fc7167), - TOBN(0x0f20f21a, 0x1d8db0ae), TOBN(0xd96d095f, 0x56c35e12), - TOBN(0xedf402b5, 0xf8c2a25b), TOBN(0x1bb772b9, 0x059204b6), - TOBN(0x50cbeae2, 0x19b4e34c), TOBN(0x93109d80, 0x3fa0845a), - TOBN(0x54f7ccf7, 0x8ef59fb5), TOBN(0x3b438fe2, 0x88070963), - TOBN(0x9e28c659, 0x31f3ba9b), TOBN(0x9cc31b46, 0xead9da92), - TOBN(0x3c2f0ba9, 0xb733aa5f), TOBN(0xdece47cb, 0xf05af235), - TOBN(0xf8e3f715, 0xa2ac82a5), TOBN(0xc97ba641, 0x2203f18a), - TOBN(0xc3af5504, 0x09c11060), TOBN(0x56ea2c05, 0x46af512d), - TOBN(0xfac28daf, 0xf3f28146), TOBN(0x87fab43a, 0x959ef494)}, - {TOBN(0x09891641, 0xd4c5105f), TOBN(0x1ae80f8e, 0x6d7fbd65), - TOBN(0x9d67225f, 0xbee6bdb0), TOBN(0x3b433b59, 0x7fc4d860), - TOBN(0x44e66db6, 0x93e85638), TOBN(0xf7b59252, 0xe3e9862f), - TOBN(0xdb785157, 0x665c32ec), TOBN(0x702fefd7, 0xae362f50), - TOBN(0x3754475d, 0x0fefb0c3), TOBN(0xd48fb56b, 0x46d7c35d), - TOBN(0xa070b633, 0x363798a4), TOBN(0xae89f3d2, 0x8fdb98e6), - TOBN(0x970b89c8, 0x6363d14c), TOBN(0x89817521, 0x67abd27d), - TOBN(0x9bf7d474, 0x44d5a021), TOBN(0xb3083baf, 0xcac72aee), - TOBN(0x389741de, 0xbe949a44), TOBN(0x638e9388, 0x546a4fa5), - TOBN(0x3fe6419c, 0xa0047bdc), TOBN(0x7047f648, 0xaaea57ca), - TOBN(0x54e48a90, 0x41fbab17), TOBN(0xda8e0b28, 0x576bdba2), - TOBN(0xe807eebc, 0xc72afddc), TOBN(0x07d3336d, 0xf42577bf), - TOBN(0x62a8c244, 0xbfe20925), TOBN(0x91c19ac3, 0x8fdce867), - TOBN(0x5a96a5d5, 0xdd387063), TOBN(0x61d587d4, 0x21d324f6), - TOBN(0xe87673a2, 0xa37173ea), TOBN(0x23848008, 0x53778b65), - TOBN(0x10f8441e, 0x05bab43e), TOBN(0xfa11fe12, 0x4621efbe), - TOBN(0x047b772e, 0x81685d7b), TOBN(0x23f27d81, 0xbf34a976), - TOBN(0xc27608e2, 0x915f48ef), TOBN(0x3b0b43fa, 0xa521d5c3), - TOBN(0x7613fb26, 0x63ca7284), TOBN(0x7f5729b4, 0x1d4db837), - TOBN(0x87b14898, 0x583b526b), TOBN(0x00b732a6, 0xbbadd3d1), - TOBN(0x8e02f426, 0x2048e396), TOBN(0x436b50b6, 0x383d9de4), - TOBN(0xf78d3481, 0x471e85ad), TOBN(0x8b01ea6a, 0xd005c8d6), - TOBN(0xd3c7afee, 0x97015c07), TOBN(0x46cdf1a9, 0x4e3ba2ae), - TOBN(0x7a42e501, 0x83d3a1d2), TOBN(0xd54b5268, 0xb541dff4), - TOBN(0x3f24cf30, 0x4e23e9bc), TOBN(0x4387f816, 0x126e3624), - TOBN(0x26a46a03, 0x3b0b6d61), TOBN(0xaf1bc845, 0x8b2d777c), - TOBN(0x25c401ba, 0x527de79c), TOBN(0x0e1346d4, 0x4261bbb6), - TOBN(0x4b96c44b, 0x287b4bc7), TOBN(0x658493c7, 0x5254562f), - TOBN(0x23f949fe, 0xb8a24a20), TOBN(0x17ebfed1, 0xf52ca53f), - TOBN(0x9b691bbe, 0xbcfb4853), TOBN(0x5617ff6b, 0x6278a05d), - TOBN(0x241b34c5, 0xe3c99ebd), TOBN(0xfc64242e, 0x1784156a), - TOBN(0x4206482f, 0x695d67df), TOBN(0xb967ce0e, 0xee27c011), - TOBN(0x65db3751, 0x21c80b5d), TOBN(0x2e7a563c, 0xa31ecca0), - TOBN(0xe56ffc4e, 0x5238a07e), TOBN(0x3d6c2966, 0x32ced854), - TOBN(0xe99d7d1a, 0xaf70b885), TOBN(0xafc3bad9, 0x2d686459), - TOBN(0x9c78bf46, 0x0cc8ba5b), TOBN(0x5a439519, 0x18955aa3), - TOBN(0xf8b517a8, 0x5fe4e314), TOBN(0xe60234d0, 0xfcb8906f), - TOBN(0xffe542ac, 0xf2061b23), TOBN(0x287e191f, 0x6b4cb59c), - TOBN(0x21857ddc, 0x09d877d8), TOBN(0x1c23478c, 0x14678941), - TOBN(0xbbf0c056, 0xb6e05ea4), TOBN(0x82da4b53, 0xb01594fe), - TOBN(0xf7526791, 0xfadb8608), TOBN(0x049e832d, 0x7b74cdf6), - TOBN(0xa43581cc, 0xc2b90a34), TOBN(0x73639eb8, 0x9360b10c), - TOBN(0x4fba331f, 0xe1e4a71b), TOBN(0x6ffd6b93, 0x8072f919), - TOBN(0x6e53271c, 0x65679032), TOBN(0x67206444, 0xf14272ce), - TOBN(0xc0f734a3, 0xb2335834), TOBN(0x9526205a, 0x90ef6860), - TOBN(0xcb8be717, 0x04e2bb0d), TOBN(0x2418871e, 0x02f383fa), - TOBN(0xd7177681, 0x4082c157), TOBN(0xcc914ad0, 0x29c20073), - TOBN(0xf186c1eb, 0xe587e728), TOBN(0x6fdb3c22, 0x61bcd5fd), - TOBN(0x30d014a6, 0xf2f9f8e9), TOBN(0x963ece23, 0x4fec49d2), - TOBN(0x862025c5, 0x9605a8d9), TOBN(0x39874445, 0x19f8929a), - TOBN(0x01b6ff65, 0x12bf476a), TOBN(0x598a64d8, 0x09cf7d91), - TOBN(0xd7ec7749, 0x93be56ca), TOBN(0x10899785, 0xcbb33615), - TOBN(0xb8a092fd, 0x02eee3ad), TOBN(0xa86b3d35, 0x30145270), - TOBN(0x323d98c6, 0x8512b675), TOBN(0x4b8bc785, 0x62ebb40f), - TOBN(0x7d301f54, 0x413f9cde), TOBN(0xa5e4fb4f, 0x2bab5664), - TOBN(0x1d2b252d, 0x1cbfec23), TOBN(0xfcd576bb, 0xe177120d), - TOBN(0x04427d3e, 0x83731a34), TOBN(0x2bb9028e, 0xed836e8e), - TOBN(0xb36acff8, 0xb612ca7c), TOBN(0xb88fe5ef, 0xd3d9c73a), - TOBN(0xbe2a6bc6, 0xedea4eb3), TOBN(0x43b93133, 0x488eec77), - TOBN(0xf41ff566, 0xb17106e1), TOBN(0x469e9172, 0x654efa32), - TOBN(0xb4480f04, 0x41c23fa3), TOBN(0xb4712eb0, 0xc1989a2e), - TOBN(0x3ccbba0f, 0x93a29ca7), TOBN(0x6e205c14, 0xd619428c), - TOBN(0x90db7957, 0xb3641686), TOBN(0x0432691d, 0x45ac8b4e), - TOBN(0x07a759ac, 0xf64e0350), TOBN(0x0514d89c, 0x9c972517), - TOBN(0x1701147f, 0xa8e67fc3), TOBN(0x9e2e0b8b, 0xab2085be), - TOBN(0xd5651824, 0xac284e57), TOBN(0x890d4325, 0x74893664), - TOBN(0x8a7c5e6e, 0xc55e68a3), TOBN(0xbf12e90b, 0x4339c85a), - TOBN(0x31846b85, 0xf922b655), TOBN(0x9a54ce4d, 0x0bf4d700), - TOBN(0xd7f4e83a, 0xf1a14295), TOBN(0x916f955c, 0xb285d4f9), - TOBN(0xe57bb0e0, 0x99ffdaba), TOBN(0x28a43034, 0xeab0d152), - TOBN(0x0a36ffa2, 0xb8a9cef8), TOBN(0x5517407e, 0xb9ec051a), - TOBN(0x9c796096, 0xea68e672), TOBN(0x853db5fb, 0xfb3c77fb), - TOBN(0x21474ba9, 0xe864a51a), TOBN(0x6c267699, 0x6e8a1b8b), - TOBN(0x7c823626, 0x94120a28), TOBN(0xe61e9a48, 0x8383a5db), - TOBN(0x7dd75003, 0x9f84216d), TOBN(0xab020d07, 0xad43cd85), - TOBN(0x9437ae48, 0xda12c659), TOBN(0x6449c2eb, 0xe65452ad), - TOBN(0xcc7c4c1c, 0x2cf9d7c1), TOBN(0x1320886a, 0xee95e5ab), - TOBN(0xbb7b9056, 0xbeae170c), TOBN(0xc8a5b250, 0xdbc0d662), - TOBN(0x4ed81432, 0xc11d2303), TOBN(0x7da66912, 0x1f03769f), - TOBN(0x3ac7a5fd, 0x84539828), TOBN(0x14dada94, 0x3bccdd02), - TOBN(0x8b84c321, 0x7ef6b0d1), TOBN(0x52a9477a, 0x7c933f22), - TOBN(0x5ef6728a, 0xfd440b82), TOBN(0x5c3bd859, 0x6ce4bd5e), - TOBN(0x918b80f5, 0xf22c2d3e), TOBN(0x368d5040, 0xb7bb6cc5), - TOBN(0xb66142a1, 0x2695a11c), TOBN(0x60ac583a, 0xeb19ea70), - TOBN(0x317cbb98, 0x0eab2437), TOBN(0x8cc08c55, 0x5e2654c8), - TOBN(0xfe2d6520, 0xe6d8307f), TOBN(0xe9f147f3, 0x57428993), - TOBN(0x5f9c7d14, 0xd2fd6cf1), TOBN(0xa3ecd064, 0x2d4fcbb0), - TOBN(0xad83fef0, 0x8e7341f7), TOBN(0x643f23a0, 0x3a63115c), - TOBN(0xd38a78ab, 0xe65ab743), TOBN(0xbf7c75b1, 0x35edc89c), - TOBN(0x3dd8752e, 0x530df568), TOBN(0xf85c4a76, 0xe308c682), - TOBN(0x4c9955b2, 0xe68acf37), TOBN(0xa544df3d, 0xab32af85), - TOBN(0x4b8ec3f5, 0xa25cf493), TOBN(0x4d8f2764, 0x1a622feb), - TOBN(0x7bb4f7aa, 0xf0dcbc49), TOBN(0x7de551f9, 0x70bbb45b), - TOBN(0xcfd0f3e4, 0x9f2ca2e5), TOBN(0xece58709, 0x1f5c76ef), - TOBN(0x32920edd, 0x167d79ae), TOBN(0x039df8a2, 0xfa7d7ec1), - TOBN(0xf46206c0, 0xbb30af91), TOBN(0x1ff5e2f5, 0x22676b59), - TOBN(0x11f4a039, 0x6ea51d66), TOBN(0x506c1445, 0x807d7a26), - TOBN(0x60da5705, 0x755a9b24), TOBN(0x8fc8cc32, 0x1f1a319e), - TOBN(0x83642d4d, 0x9433d67d), TOBN(0x7fa5cb8f, 0x6a7dd296), - TOBN(0x576591db, 0x9b7bde07), TOBN(0x13173d25, 0x419716fb), - TOBN(0xea30599d, 0xd5b340ff), TOBN(0xfc6b5297, 0xb0fe76c5), - TOBN(0x1c6968c8, 0xab8f5adc), TOBN(0xf723c7f5, 0x901c928d), - TOBN(0x4203c321, 0x9773d402), TOBN(0xdf7c6aa3, 0x1b51dd47), - TOBN(0x3d49e37a, 0x552be23c), TOBN(0x57febee8, 0x0b5a6e87), - TOBN(0xc5ecbee4, 0x7bd8e739), TOBN(0x79d44994, 0xae63bf75), - TOBN(0x168bd00f, 0x38fb8923), TOBN(0x75d48ee4, 0xd0533130), - TOBN(0x554f77aa, 0xdb5cdf33), TOBN(0x3396e896, 0x3c696769), - TOBN(0x2fdddbf2, 0xd3fd674e), TOBN(0xbbb8f6ee, 0x99d0e3e5), - TOBN(0x51b90651, 0xcbae2f70), TOBN(0xefc4bc05, 0x93aaa8eb), - TOBN(0x8ecd8689, 0xdd1df499), TOBN(0x1aee99a8, 0x22f367a5), - TOBN(0x95d485b9, 0xae8274c5), TOBN(0x6c14d445, 0x7d30b39c), - TOBN(0xbafea90b, 0xbcc1ef81), TOBN(0x7c5f317a, 0xa459a2ed), - TOBN(0x01211075, 0x4ef44227), TOBN(0xa17bed6e, 0xdc20f496), - TOBN(0x0cdfe424, 0x819853cd), TOBN(0x13793298, 0xf71e2ce7), - TOBN(0x3c1f3078, 0xdbbe307b), TOBN(0x6dd1c20e, 0x76ee9936), - TOBN(0x23ee4b57, 0x423caa20), TOBN(0x4ac3793b, 0x8efb840e), - TOBN(0x934438eb, 0xed1f8ca0), TOBN(0x3e546658, 0x4ebb25a2), - TOBN(0xc415af0e, 0xc069896f), TOBN(0xc13eddb0, 0x9a5aa43d), - TOBN(0x7a04204f, 0xd49eb8f6), TOBN(0xd0d5bdfc, 0xd74f1670), - TOBN(0x3697e286, 0x56fc0558), TOBN(0x10207371, 0x01cebade), - TOBN(0x5f87e690, 0x0647a82b), TOBN(0x908e0ed4, 0x8f40054f), - TOBN(0xa9f633d4, 0x79853803), TOBN(0x8ed13c9a, 0x4a28b252), - TOBN(0x3e2ef676, 0x1f460f64), TOBN(0x53930b9b, 0x36d06336), - TOBN(0x347073ac, 0x8fc4979b), TOBN(0x84380e0e, 0x5ecd5597), - TOBN(0xe3b22c6b, 0xc4fe3c39), TOBN(0xba4a8153, 0x6c7bebdf), - TOBN(0xf23ab6b7, 0x25693459), TOBN(0x53bc3770, 0x14922b11), - TOBN(0x4645c8ab, 0x5afc60db), TOBN(0xaa022355, 0x20b9f2a3), - TOBN(0x52a2954c, 0xce0fc507), TOBN(0x8c2731bb, 0x7ce1c2e7), - TOBN(0xf39608ab, 0x18a0339d), TOBN(0xac7a658d, 0x3735436c), - TOBN(0xb22c2b07, 0xcd992b4f), TOBN(0x4e83daec, 0xf40dcfd4), - TOBN(0x8a34c7be, 0x2f39ea3e), TOBN(0xef0c005f, 0xb0a56d2e), - TOBN(0x62731f6a, 0x6edd8038), TOBN(0x5721d740, 0x4e3cb075), - TOBN(0x1ea41511, 0xfbeeee1b), TOBN(0xd1ef5e73, 0xef1d0c05), - TOBN(0x42feefd1, 0x73c07d35), TOBN(0xe530a00a, 0x8a329493), - TOBN(0x5d55b7fe, 0xf15ebfb0), TOBN(0x549de03c, 0xd322491a), - TOBN(0xf7b5f602, 0x745b3237), TOBN(0x3632a3a2, 0x1ab6e2b6), - TOBN(0x0d3bba89, 0x0ef59f78), TOBN(0x0dfc6443, 0xc9e52b9a), - TOBN(0x1dc79699, 0x72631447), TOBN(0xef033917, 0xb3be20b1), - TOBN(0x0c92735d, 0xb1383948), TOBN(0xc1fc29a2, 0xc0dd7d7d), - TOBN(0x6485b697, 0x403ed068), TOBN(0x13bfaab3, 0xaac93bdc), - TOBN(0x410dc6a9, 0x0deeaf52), TOBN(0xb003fb02, 0x4c641c15), - TOBN(0x1384978c, 0x5bc504c4), TOBN(0x37640487, 0x864a6a77), - TOBN(0x05991bc6, 0x222a77da), TOBN(0x62260a57, 0x5e47eb11), - TOBN(0xc7af6613, 0xf21b432c), TOBN(0x22f3acc9, 0xab4953e9), - TOBN(0x52934922, 0x8e41d155), TOBN(0x4d024568, 0x3ac059ef), - TOBN(0xb0201755, 0x4d884411), TOBN(0xce8055cf, 0xa59a178f), - TOBN(0xcd77d1af, 0xf6204549), TOBN(0xa0a00a3e, 0xc7066759), - TOBN(0x471071ef, 0x0272c229), TOBN(0x009bcf6b, 0xd3c4b6b0), - TOBN(0x2a2638a8, 0x22305177), TOBN(0xd51d59df, 0x41645bbf), - TOBN(0xa81142fd, 0xc0a7a3c0), TOBN(0xa17eca6d, 0x4c7063ee), - TOBN(0x0bb887ed, 0x60d9dcec), TOBN(0xd6d28e51, 0x20ad2455), - TOBN(0xebed6308, 0xa67102ba), TOBN(0x042c3114, 0x8bffa408), - TOBN(0xfd099ac5, 0x8aa68e30), TOBN(0x7a6a3d7c, 0x1483513e), - TOBN(0xffcc6b75, 0xba2d8f0c), TOBN(0x54dacf96, 0x1e78b954), - TOBN(0xf645696f, 0xa4a9af89), TOBN(0x3a411940, 0x06ac98ec), - TOBN(0x41b8b3f6, 0x22a67a20), TOBN(0x2d0b1e0f, 0x99dec626), - TOBN(0x27c89192, 0x40be34e8), TOBN(0xc7162b37, 0x91907f35), - TOBN(0x90188ec1, 0xa956702b), TOBN(0xca132f7d, 0xdf93769c), - TOBN(0x3ece44f9, 0x0e2025b4), TOBN(0x67aaec69, 0x0c62f14c), - TOBN(0xad741418, 0x22e3cc11), TOBN(0xcf9b75c3, 0x7ff9a50e), - TOBN(0x02fa2b16, 0x4d348272), TOBN(0xbd99d61a, 0x9959d56d), - TOBN(0xbc4f19db, 0x18762916), TOBN(0xcc7cce50, 0x49c1ac80), - TOBN(0x4d59ebaa, 0xd846bd83), TOBN(0x8775a9dc, 0xa9202849), - TOBN(0x07ec4ae1, 0x6e1f4ca9), TOBN(0x27eb5875, 0xba893f11), - TOBN(0x00284d51, 0x662cc565), TOBN(0x82353a6b, 0x0db4138d), - TOBN(0xd9c7aaaa, 0xaa32a594), TOBN(0xf5528b5e, 0xa5669c47), - TOBN(0xf3220231, 0x2f23c5ff), TOBN(0xe3e8147a, 0x6affa3a1), - TOBN(0xfb423d5c, 0x202ddda0), TOBN(0x3d6414ac, 0x6b871bd4), - TOBN(0x586f82e1, 0xa51a168a), TOBN(0xb712c671, 0x48ae5448), - TOBN(0x9a2e4bd1, 0x76233eb8), TOBN(0x0188223a, 0x78811ca9), - TOBN(0x553c5e21, 0xf7c18de1), TOBN(0x7682e451, 0xb27bb286), - TOBN(0x3ed036b3, 0x0e51e929), TOBN(0xf487211b, 0xec9cb34f), - TOBN(0x0d094277, 0x0c24efc8), TOBN(0x0349fd04, 0xbef737a4), - TOBN(0x6d1c9dd2, 0x514cdd28), TOBN(0x29c135ff, 0x30da9521), - TOBN(0xea6e4508, 0xf78b0b6f), TOBN(0x176f5dd2, 0x678c143c), - TOBN(0x08148418, 0x4be21e65), TOBN(0x27f7525c, 0xe7df38c4), - TOBN(0x1fb70e09, 0x748ab1a4), TOBN(0x9cba50a0, 0x5efe4433), - TOBN(0x7846c7a6, 0x15f75af2), TOBN(0x2a7c2c57, 0x5ee73ea8), - TOBN(0x42e566a4, 0x3f0a449a), TOBN(0x45474c3b, 0xad90fc3d), - TOBN(0x7447be3d, 0x8b61d057), TOBN(0x3e9d1cf1, 0x3a4ec092), - TOBN(0x1603e453, 0xf380a6e6), TOBN(0x0b86e431, 0x9b1437c2), - TOBN(0x7a4173f2, 0xef29610a), TOBN(0x8fa729a7, 0xf03d57f7), - TOBN(0x3e186f6e, 0x6c9c217e), TOBN(0xbe1d3079, 0x91919524), - TOBN(0x92a62a70, 0x153d4fb1), TOBN(0x32ed3e34, 0xd68c2f71), - TOBN(0xd785027f, 0x9eb1a8b7), TOBN(0xbc37eb77, 0xc5b22fe8), - TOBN(0x466b34f0, 0xb9d6a191), TOBN(0x008a89af, 0x9a05f816), - TOBN(0x19b028fb, 0x7d42c10a), TOBN(0x7fe8c92f, 0x49b3f6b8), - TOBN(0x58907cc0, 0xa5a0ade3), TOBN(0xb3154f51, 0x559d1a7c), - TOBN(0x5066efb6, 0xd9790ed6), TOBN(0xa77a0cbc, 0xa6aa793b), - TOBN(0x1a915f3c, 0x223e042e), TOBN(0x1c5def04, 0x69c5874b), - TOBN(0x0e830078, 0x73b6c1da), TOBN(0x55cf85d2, 0xfcd8557a), - TOBN(0x0f7c7c76, 0x0460f3b1), TOBN(0x87052acb, 0x46e58063), - TOBN(0x09212b80, 0x907eae66), TOBN(0x3cb068e0, 0x4d721c89), - TOBN(0xa87941ae, 0xdd45ac1c), TOBN(0xde8d5c0d, 0x0daa0dbb), - TOBN(0xda421fdc, 0xe3502e6e), TOBN(0xc8944201, 0x4d89a084), - TOBN(0x7307ba5e, 0xf0c24bfb), TOBN(0xda212beb, 0x20bde0ef), - TOBN(0xea2da24b, 0xf82ce682), TOBN(0x058d3816, 0x07f71fe4), - TOBN(0x35a02462, 0x5ffad8de), TOBN(0xcd7b05dc, 0xaadcefab), - TOBN(0xd442f8ed, 0x1d9f54ec), TOBN(0x8be3d618, 0xb2d3b5ca), - TOBN(0xe2220ed0, 0xe06b2ce2), TOBN(0x82699a5f, 0x1b0da4c0), - TOBN(0x3ff106f5, 0x71c0c3a7), TOBN(0x8f580f5a, 0x0d34180c), - TOBN(0x4ebb120e, 0x22d7d375), TOBN(0x5e5782cc, 0xe9513675), - TOBN(0x2275580c, 0x99c82a70), TOBN(0xe8359fbf, 0x15ea8c4c), - TOBN(0x53b48db8, 0x7b415e70), TOBN(0xaacf2240, 0x100c6014), - TOBN(0x9faaccf5, 0xe4652f1d), TOBN(0xbd6fdd2a, 0xd56157b2), - TOBN(0xa4f4fb1f, 0x6261ec50), TOBN(0x244e55ad, 0x476bcd52), - TOBN(0x881c9305, 0x047d320b), TOBN(0x1ca983d5, 0x6181263f), - TOBN(0x354e9a44, 0x278fb8ee), TOBN(0xad2dbc0f, 0x396e4964), - TOBN(0x723f3aa2, 0x9268b3de), TOBN(0x0d1ca29a, 0xe6e0609a), - TOBN(0x794866aa, 0x6cf44252), TOBN(0x0b59f3e3, 0x01af87ed), - TOBN(0xe234e5ff, 0x7f4a6c51), TOBN(0xa8768fd2, 0x61dc2f7e), - TOBN(0xdafc7332, 0x0a94d81f), TOBN(0xd7f84282, 0x06938ce1), - TOBN(0xae0b3c0e, 0x0546063e), TOBN(0x7fbadcb2, 0x5d61abc6), - TOBN(0xd5d7a2c9, 0x369ac400), TOBN(0xa5978d09, 0xae67d10c), - TOBN(0x290f211e, 0x4f85eaac), TOBN(0xe61e2ad1, 0xfacac681), - TOBN(0xae125225, 0x388384cd), TOBN(0xa7fb68e9, 0xccfde30f), - TOBN(0x7a59b936, 0x3daed4c2), TOBN(0x80a9aa40, 0x2606f789), - TOBN(0xb40c1ea5, 0xf6a6d90a), TOBN(0x948364d3, 0x514d5885), - TOBN(0x062ebc60, 0x70985182), TOBN(0xa6db5b0e, 0x33310895), - TOBN(0x64a12175, 0xe329c2f5), TOBN(0xc5f25bd2, 0x90ea237e), - TOBN(0x7915c524, 0x2d0a4c23), TOBN(0xeb5d26e4, 0x6bb3cc52), - TOBN(0x369a9116, 0xc09e2c92), TOBN(0x0c527f92, 0xcf182cf8), - TOBN(0x9e591938, 0x2aede0ac), TOBN(0xb2922208, 0x6cc34939), - TOBN(0x3c9d8962, 0x99a34361), TOBN(0x3c81836d, 0xc1905fe6), - TOBN(0x4bfeb57f, 0xa001ec5a), TOBN(0xe993f5bb, 0xa0dc5dba), - TOBN(0x47884109, 0x724a1380), TOBN(0x8a0369ab, 0x32fe9a04), - TOBN(0xea068d60, 0x8c927db8), TOBN(0xbf5f37cf, 0x94655741), - TOBN(0x47d402a2, 0x04b6c7ea), TOBN(0x4551c295, 0x6af259cb), - TOBN(0x698b71e7, 0xed77ee8b), TOBN(0xbddf7bd0, 0xf309d5c7), - TOBN(0x6201c22c, 0x34e780ca), TOBN(0xab04f7d8, 0x4c295ef4), - TOBN(0x1c947294, 0x4313a8ce), TOBN(0xe532e4ac, 0x92ca4cfe), - TOBN(0x89738f80, 0xd0a7a97a), TOBN(0xec088c88, 0xa580fd5b), - TOBN(0x612b1ecc, 0x42ce9e51), TOBN(0x8f9840fd, 0xb25fdd2a), - TOBN(0x3cda78c0, 0x01e7f839), TOBN(0x546b3d3a, 0xece05480), - TOBN(0x271719a9, 0x80d30916), TOBN(0x45497107, 0x584c20c4), - TOBN(0xaf8f9478, 0x5bc78608), TOBN(0x28c7d484, 0x277e2a4c), - TOBN(0xfce01767, 0x88a2ffe4), TOBN(0xdc506a35, 0x28e169a5), - TOBN(0x0ea10861, 0x7af9c93a), TOBN(0x1ed24361, 0x03fa0e08), - TOBN(0x96eaaa92, 0xa3d694e7), TOBN(0xc0f43b4d, 0xef50bc74), - TOBN(0xce6aa58c, 0x64114db4), TOBN(0x8218e8ea, 0x7c000fd4), - TOBN(0xac815dfb, 0x185f8844), TOBN(0xcd7e90cb, 0x1557abfb), - TOBN(0x23d16655, 0xafbfecdf), TOBN(0x80f3271f, 0x085cac4a), - TOBN(0x7fc39aa7, 0xd0e62f47), TOBN(0x88d519d1, 0x460a48e5), - TOBN(0x59559ac4, 0xd28f101e), TOBN(0x7981d9e9, 0xca9ae816), - TOBN(0x5c38652c, 0x9ac38203), TOBN(0x86eaf87f, 0x57657fe5), - TOBN(0x568fc472, 0xe21f5416), TOBN(0x2afff39c, 0xe7e597b5), - TOBN(0x3adbbb07, 0x256d4eab), TOBN(0x22598692, 0x8285ab89), - TOBN(0x35f8112a, 0x041caefe), TOBN(0x95df02e3, 0xa5064c8b), - TOBN(0x4d63356e, 0xc7004bf3), TOBN(0x230a08f4, 0xdb83c7de), - TOBN(0xca27b270, 0x8709a7b7), TOBN(0x0d1c4cc4, 0xcb9abd2d), - TOBN(0x8a0bc66e, 0x7550fee8), TOBN(0x369cd4c7, 0x9cf7247e), - TOBN(0x75562e84, 0x92b5b7e7), TOBN(0x8fed0da0, 0x5802af7b), - TOBN(0x6a7091c2, 0xe48fb889), TOBN(0x26882c13, 0x7b8a9d06), - TOBN(0xa2498663, 0x1b82a0e2), TOBN(0x844ed736, 0x3518152d), - TOBN(0x282f476f, 0xd86e27c7), TOBN(0xa04edaca, 0x04afefdc), - TOBN(0x8b256ebc, 0x6119e34d), TOBN(0x56a413e9, 0x0787d78b)}, - {TOBN(0x82ee061d, 0x5a74be50), TOBN(0xe41781c4, 0xdea16ff5), - TOBN(0xe0b0c81e, 0x99bfc8a2), TOBN(0x624f4d69, 0x0b547e2d), - TOBN(0x3a83545d, 0xbdcc9ae4), TOBN(0x2573dbb6, 0x409b1e8e), - TOBN(0x482960c4, 0xa6c93539), TOBN(0xf01059ad, 0x5ae18798), - TOBN(0x715c9f97, 0x3112795f), TOBN(0xe8244437, 0x984e6ee1), - TOBN(0x55cb4858, 0xecb66bcd), TOBN(0x7c136735, 0xabaffbee), - TOBN(0x54661595, 0x5dbec38e), TOBN(0x51c0782c, 0x388ad153), - TOBN(0x9ba4c53a, 0xc6e0952f), TOBN(0x27e6782a, 0x1b21dfa8), - TOBN(0x682f903d, 0x4ed2dbc2), TOBN(0x0eba59c8, 0x7c3b2d83), - TOBN(0x8e9dc84d, 0x9c7e9335), TOBN(0x5f9b21b0, 0x0eb226d7), - TOBN(0xe33bd394, 0xaf267bae), TOBN(0xaa86cc25, 0xbe2e15ae), - TOBN(0x4f0bf67d, 0x6a8ec500), TOBN(0x5846aa44, 0xf9630658), - TOBN(0xfeb09740, 0xe2c2bf15), TOBN(0x627a2205, 0xa9e99704), - TOBN(0xec8d73d0, 0xc2fbc565), TOBN(0x223eed8f, 0xc20c8de8), - TOBN(0x1ee32583, 0xa8363b49), TOBN(0x1a0b6cb9, 0xc9c2b0a6), - TOBN(0x49f7c3d2, 0x90dbc85c), TOBN(0xa8dfbb97, 0x1ef4c1ac), - TOBN(0xafb34d4c, 0x65c7c2ab), TOBN(0x1d4610e7, 0xe2c5ea84), - TOBN(0x893f6d1b, 0x973c4ab5), TOBN(0xa3cdd7e9, 0x945ba5c4), - TOBN(0x60514983, 0x064417ee), TOBN(0x1459b23c, 0xad6bdf2b), - TOBN(0x23b2c341, 0x5cf726c3), TOBN(0x3a829635, 0x32d6354a), - TOBN(0x294f901f, 0xab192c18), TOBN(0xec5fcbfe, 0x7030164f), - TOBN(0xe2e2fcb7, 0xe2246ba6), TOBN(0x1e7c88b3, 0x221a1a0c), - TOBN(0x72c7dd93, 0xc92d88c5), TOBN(0x41c2148e, 0x1106fb59), - TOBN(0x547dd4f5, 0xa0f60f14), TOBN(0xed9b52b2, 0x63960f31), - TOBN(0x6c8349eb, 0xb0a5b358), TOBN(0xb154c5c2, 0x9e7e2ed6), - TOBN(0xcad5eccf, 0xeda462db), TOBN(0xf2d6dbe4, 0x2de66b69), - TOBN(0x426aedf3, 0x8665e5b2), TOBN(0x488a8513, 0x7b7f5723), - TOBN(0x15cc43b3, 0x8bcbb386), TOBN(0x27ad0af3, 0xd791d879), - TOBN(0xc16c236e, 0x846e364f), TOBN(0x7f33527c, 0xdea50ca0), - TOBN(0xc4810775, 0x0926b86d), TOBN(0x6c2a3609, 0x0598e70c), - TOBN(0xa6755e52, 0xf024e924), TOBN(0xe0fa07a4, 0x9db4afca), - TOBN(0x15c3ce7d, 0x66831790), TOBN(0x5b4ef350, 0xa6cbb0d6), - TOBN(0x2c4aafc4, 0xb6205969), TOBN(0x42563f02, 0xf6c7854f), - TOBN(0x016aced5, 0x1d983b48), TOBN(0xfeb356d8, 0x99949755), - TOBN(0x8c2a2c81, 0xd1a39bd7), TOBN(0x8f44340f, 0xe6934ae9), - TOBN(0x148cf91c, 0x447904da), TOBN(0x7340185f, 0x0f51a926), - TOBN(0x2f8f00fb, 0x7409ab46), TOBN(0x057e78e6, 0x80e289b2), - TOBN(0x03e5022c, 0xa888e5d1), TOBN(0x3c87111a, 0x9dede4e2), - TOBN(0x5b9b0e1c, 0x7809460b), TOBN(0xe751c852, 0x71c9abc7), - TOBN(0x8b944e28, 0xc7cc1dc9), TOBN(0x4f201ffa, 0x1d3cfa08), - TOBN(0x02fc905c, 0x3e6721ce), TOBN(0xd52d70da, 0xd0b3674c), - TOBN(0x5dc2e5ca, 0x18810da4), TOBN(0xa984b273, 0x5c69dd99), - TOBN(0x63b92527, 0x84de5ca4), TOBN(0x2f1c9872, 0xc852dec4), - TOBN(0x18b03593, 0xc2e3de09), TOBN(0x19d70b01, 0x9813dc2f), - TOBN(0x42806b2d, 0xa6dc1d29), TOBN(0xd3030009, 0xf871e144), - TOBN(0xa1feb333, 0xaaf49276), TOBN(0xb5583b9e, 0xc70bc04b), - TOBN(0x1db0be78, 0x95695f20), TOBN(0xfc841811, 0x89d012b5), - TOBN(0x6409f272, 0x05f61643), TOBN(0x40d34174, 0xd5883128), - TOBN(0xd79196f5, 0x67419833), TOBN(0x6059e252, 0x863b7b08), - TOBN(0x84da1817, 0x1c56700c), TOBN(0x5758ee56, 0xb28d3ec4), - TOBN(0x7da2771d, 0x013b0ea6), TOBN(0xfddf524b, 0x54c5e9b9), - TOBN(0x7df4faf8, 0x24305d80), TOBN(0x58f5c1bf, 0x3a97763f), - TOBN(0xa5af37f1, 0x7c696042), TOBN(0xd4cba22c, 0x4a2538de), - TOBN(0x211cb995, 0x9ea42600), TOBN(0xcd105f41, 0x7b069889), - TOBN(0xb1e1cf19, 0xddb81e74), TOBN(0x472f2d89, 0x5157b8ca), - TOBN(0x086fb008, 0xee9db885), TOBN(0x365cd570, 0x0f26d131), - TOBN(0x284b02bb, 0xa2be7053), TOBN(0xdcbbf7c6, 0x7ab9a6d6), - TOBN(0x4425559c, 0x20f7a530), TOBN(0x961f2dfa, 0x188767c8), - TOBN(0xe2fd9435, 0x70dc80c4), TOBN(0x104d6b63, 0xf0784120), - TOBN(0x7f592bc1, 0x53567122), TOBN(0xf6bc1246, 0xf688ad77), - TOBN(0x05214c05, 0x0f15dde9), TOBN(0xa47a76a8, 0x0d5f2b82), - TOBN(0xbb254d30, 0x62e82b62), TOBN(0x11a05fe0, 0x3ec955ee), - TOBN(0x7eaff46e, 0x9d529b36), TOBN(0x55ab1301, 0x8f9e3df6), - TOBN(0xc463e371, 0x99317698), TOBN(0xfd251438, 0xccda47ad), - TOBN(0xca9c3547, 0x23d695ea), TOBN(0x48ce626e, 0x16e589b5), - TOBN(0x6b5b64c7, 0xb187d086), TOBN(0xd02e1794, 0xb2207948), - TOBN(0x8b58e98f, 0x7198111d), TOBN(0x90ca6305, 0xdcf9c3cc), - TOBN(0x5691fe72, 0xf34089b0), TOBN(0x60941af1, 0xfc7c80ff), - TOBN(0xa09bc0a2, 0x22eb51e5), TOBN(0xc0bb7244, 0xaa9cf09a), - TOBN(0x36a8077f, 0x80159f06), TOBN(0x8b5c989e, 0xdddc560e), - TOBN(0x19d2f316, 0x512e1f43), TOBN(0x02eac554, 0xad08ff62), - TOBN(0x012ab84c, 0x07d20b4e), TOBN(0x37d1e115, 0xd6d4e4e1), - TOBN(0xb6443e1a, 0xab7b19a8), TOBN(0xf08d067e, 0xdef8cd45), - TOBN(0x63adf3e9, 0x685e03da), TOBN(0xcf15a10e, 0x4792b916), - TOBN(0xf44bcce5, 0xb738a425), TOBN(0xebe131d5, 0x9636b2fd), - TOBN(0x94068841, 0x7850d605), TOBN(0x09684eaa, 0xb40d749d), - TOBN(0x8c3c669c, 0x72ba075b), TOBN(0x89f78b55, 0xba469015), - TOBN(0x5706aade, 0x3e9f8ba8), TOBN(0x6d8bd565, 0xb32d7ed7), - TOBN(0x25f4e63b, 0x805f08d6), TOBN(0x7f48200d, 0xc3bcc1b5), - TOBN(0x4e801968, 0xb025d847), TOBN(0x74afac04, 0x87cbe0a8), - TOBN(0x43ed2c2b, 0x7e63d690), TOBN(0xefb6bbf0, 0x0223cdb8), - TOBN(0x4fec3cae, 0x2884d3fe), TOBN(0x065ecce6, 0xd75e25a4), - TOBN(0x6c2294ce, 0x69f79071), TOBN(0x0d9a8e5f, 0x044b8666), - TOBN(0x5009f238, 0x17b69d8f), TOBN(0x3c29f8fe, 0xc5dfdaf7), - TOBN(0x9067528f, 0xebae68c4), TOBN(0x5b385632, 0x30c5ba21), - TOBN(0x540df119, 0x1fdd1aec), TOBN(0xcf37825b, 0xcfba4c78), - TOBN(0x77eff980, 0xbeb11454), TOBN(0x40a1a991, 0x60c1b066), - TOBN(0xe8018980, 0xf889a1c7), TOBN(0xb9c52ae9, 0x76c24be0), - TOBN(0x05fbbcce, 0x45650ef4), TOBN(0xae000f10, 0x8aa29ac7), - TOBN(0x884b7172, 0x4f04c470), TOBN(0x7cd4fde2, 0x19bb5c25), - TOBN(0x6477b22a, 0xe8840869), TOBN(0xa8868859, 0x5fbd0686), - TOBN(0xf23cc02e, 0x1116dfba), TOBN(0x76cd563f, 0xd87d7776), - TOBN(0xe2a37598, 0xa9d82abf), TOBN(0x5f188ccb, 0xe6c170f5), - TOBN(0x81682200, 0x5066b087), TOBN(0xda22c212, 0xc7155ada), - TOBN(0x151e5d3a, 0xfbddb479), TOBN(0x4b606b84, 0x6d715b99), - TOBN(0x4a73b54b, 0xf997cb2e), TOBN(0x9a1bfe43, 0x3ecd8b66), - TOBN(0x1c312809, 0x2a67d48a), TOBN(0xcd6a671e, 0x031fa9e2), - TOBN(0xbec3312a, 0x0e43a34a), TOBN(0x1d935639, 0x55ef47d3), - TOBN(0x5ea02489, 0x8fea73ea), TOBN(0x8247b364, 0xa035afb2), - TOBN(0xb58300a6, 0x5265b54c), TOBN(0x3286662f, 0x722c7148), - TOBN(0xb77fd76b, 0xb4ec4c20), TOBN(0xf0a12fa7, 0x0f3fe3fd), - TOBN(0xf845bbf5, 0x41d8c7e8), TOBN(0xe4d969ca, 0x5ec10aa8), - TOBN(0x4c0053b7, 0x43e232a3), TOBN(0xdc7a3fac, 0x37f8a45a), - TOBN(0x3c4261c5, 0x20d81c8f), TOBN(0xfd4b3453, 0xb00eab00), - TOBN(0x76d48f86, 0xd36e3062), TOBN(0x626c5277, 0xa143ff02), - TOBN(0x538174de, 0xaf76f42e), TOBN(0x2267aa86, 0x6407ceac), - TOBN(0xfad76351, 0x72e572d5), TOBN(0xab861af7, 0xba7330eb), - TOBN(0xa0a1c8c7, 0x418d8657), TOBN(0x988821cb, 0x20289a52), - TOBN(0x79732522, 0xcccc18ad), TOBN(0xaadf3f8d, 0xf1a6e027), - TOBN(0xf7382c93, 0x17c2354d), TOBN(0x5ce1680c, 0xd818b689), - TOBN(0x359ebbfc, 0xd9ecbee9), TOBN(0x4330689c, 0x1cae62ac), - TOBN(0xb55ce5b4, 0xc51ac38a), TOBN(0x7921dfea, 0xfe238ee8), - TOBN(0x3972bef8, 0x271d1ca5), TOBN(0x3e423bc7, 0xe8aabd18), - TOBN(0x57b09f3f, 0x44a3e5e3), TOBN(0x5da886ae, 0x7b444d66), - TOBN(0x68206634, 0xa9964375), TOBN(0x356a2fa3, 0x699cd0ff), - TOBN(0xaf0faa24, 0xdba515e9), TOBN(0x536e1f5c, 0xb321d79a), - TOBN(0xd3b9913a, 0x5c04e4ea), TOBN(0xd549dcfe, 0xd6f11513), - TOBN(0xee227bf5, 0x79fd1d94), TOBN(0x9f35afee, 0xb43f2c67), - TOBN(0xd2638d24, 0xf1314f53), TOBN(0x62baf948, 0xcabcd822), - TOBN(0x5542de29, 0x4ef48db0), TOBN(0xb3eb6a04, 0xfc5f6bb2), - TOBN(0x23c110ae, 0x1208e16a), TOBN(0x1a4d15b5, 0xf8363e24), - TOBN(0x30716844, 0x164be00b), TOBN(0xa8e24824, 0xf6f4690d), - TOBN(0x548773a2, 0x90b170cf), TOBN(0xa1bef331, 0x42f191f4), - TOBN(0x70f418d0, 0x9247aa97), TOBN(0xea06028e, 0x48be9147), - TOBN(0xe13122f3, 0xdbfb894e), TOBN(0xbe9b79f6, 0xce274b18), - TOBN(0x85a49de5, 0xca58aadf), TOBN(0x24957758, 0x11487351), - TOBN(0x111def61, 0xbb939099), TOBN(0x1d6a974a, 0x26d13694), - TOBN(0x4474b4ce, 0xd3fc253b), TOBN(0x3a1485e6, 0x4c5db15e), - TOBN(0xe79667b4, 0x147c15b4), TOBN(0xe34f553b, 0x7bc61301), - TOBN(0x032b80f8, 0x17094381), TOBN(0x55d8bafd, 0x723eaa21), - TOBN(0x5a987995, 0xf1c0e74e), TOBN(0x5a9b292e, 0xebba289c), - TOBN(0x413cd4b2, 0xeb4c8251), TOBN(0x98b5d243, 0xd162db0a), - TOBN(0xbb47bf66, 0x68342520), TOBN(0x08d68949, 0xbaa862d1), - TOBN(0x11f349c7, 0xe906abcd), TOBN(0x454ce985, 0xed7bf00e), - TOBN(0xacab5c9e, 0xb55b803b), TOBN(0xb03468ea, 0x31e3c16d), - TOBN(0x5c24213d, 0xd273bf12), TOBN(0x211538eb, 0x71587887), - TOBN(0x198e4a2f, 0x731dea2d), TOBN(0xd5856cf2, 0x74ed7b2a), - TOBN(0x86a632eb, 0x13a664fe), TOBN(0x932cd909, 0xbda41291), - TOBN(0x850e95d4, 0xc0c4ddc0), TOBN(0xc0f422f8, 0x347fc2c9), - TOBN(0xe68cbec4, 0x86076bcb), TOBN(0xf9e7c0c0, 0xcd6cd286), - TOBN(0x65994ddb, 0x0f5f27ca), TOBN(0xe85461fb, 0xa80d59ff), - TOBN(0xff05481a, 0x66601023), TOBN(0xc665427a, 0xfc9ebbfb), - TOBN(0xb0571a69, 0x7587fd52), TOBN(0x935289f8, 0x8d49efce), - TOBN(0x61becc60, 0xea420688), TOBN(0xb22639d9, 0x13a786af), - TOBN(0x1a8e6220, 0x361ecf90), TOBN(0x001f23e0, 0x25506463), - TOBN(0xe4ae9b5d, 0x0a5c2b79), TOBN(0xebc9cdad, 0xd8149db5), - TOBN(0xb33164a1, 0x934aa728), TOBN(0x750eb00e, 0xae9b60f3), - TOBN(0x5a91615b, 0x9b9cfbfd), TOBN(0x97015cbf, 0xef45f7f6), - TOBN(0xb462c4a5, 0xbf5151df), TOBN(0x21adcc41, 0xb07118f2), - TOBN(0xd60c545b, 0x043fa42c), TOBN(0xfc21aa54, 0xe96be1ab), - TOBN(0xe84bc32f, 0x4e51ea80), TOBN(0x3dae45f0, 0x259b5d8d), - TOBN(0xbb73c7eb, 0xc38f1b5e), TOBN(0xe405a74a, 0xe8ae617d), - TOBN(0xbb1ae9c6, 0x9f1c56bd), TOBN(0x8c176b98, 0x49f196a4), - TOBN(0xc448f311, 0x6875092b), TOBN(0xb5afe3de, 0x9f976033), - TOBN(0xa8dafd49, 0x145813e5), TOBN(0x687fc4d9, 0xe2b34226), - TOBN(0xf2dfc92d, 0x4c7ff57f), TOBN(0x004e3fc1, 0x401f1b46), - TOBN(0x5afddab6, 0x1430c9ab), TOBN(0x0bdd41d3, 0x2238e997), - TOBN(0xf0947430, 0x418042ae), TOBN(0x71f9adda, 0xcdddc4cb), - TOBN(0x7090c016, 0xc52dd907), TOBN(0xd9bdf44d, 0x29e2047f), - TOBN(0xe6f1fe80, 0x1b1011a6), TOBN(0xb63accbc, 0xd9acdc78), - TOBN(0xcfc7e235, 0x1272a95b), TOBN(0x0c667717, 0xa6276ac8), - TOBN(0x3c0d3709, 0xe2d7eef7), TOBN(0x5add2b06, 0x9a685b3e), - TOBN(0x363ad32d, 0x14ea5d65), TOBN(0xf8e01f06, 0x8d7dd506), - TOBN(0xc9ea2213, 0x75b4aac6), TOBN(0xed2a2bf9, 0x0d353466), - TOBN(0x439d79b5, 0xe9d3a7c3), TOBN(0x8e0ee5a6, 0x81b7f34b), - TOBN(0xcf3dacf5, 0x1dc4ba75), TOBN(0x1d3d1773, 0xeb3310c7), - TOBN(0xa8e67112, 0x7747ae83), TOBN(0x31f43160, 0x197d6b40), - TOBN(0x0521ccee, 0xcd961400), TOBN(0x67246f11, 0xf6535768), - TOBN(0x702fcc5a, 0xef0c3133), TOBN(0x247cc45d, 0x7e16693b), - TOBN(0xfd484e49, 0xc729b749), TOBN(0x522cef7d, 0xb218320f), - TOBN(0xe56ef405, 0x59ab93b3), TOBN(0x225fba11, 0x9f181071), - TOBN(0x33bd6595, 0x15330ed0), TOBN(0xc4be69d5, 0x1ddb32f7), - TOBN(0x264c7668, 0x0448087c), TOBN(0xac30903f, 0x71432dae), - TOBN(0x3851b266, 0x00f9bf47), TOBN(0x400ed311, 0x6cdd6d03), - TOBN(0x045e79fe, 0xf8fd2424), TOBN(0xfdfd974a, 0xfa6da98b), - TOBN(0x45c9f641, 0x0c1e673a), TOBN(0x76f2e733, 0x5b2c5168), - TOBN(0x1adaebb5, 0x2a601753), TOBN(0xb286514c, 0xc57c2d49), - TOBN(0xd8769670, 0x1e0bfd24), TOBN(0x950c547e, 0x04478922), - TOBN(0xd1d41969, 0xe5d32bfe), TOBN(0x30bc1472, 0x750d6c3e), - TOBN(0x8f3679fe, 0xe0e27f3a), TOBN(0x8f64a7dc, 0xa4a6ee0c), - TOBN(0x2fe59937, 0x633dfb1f), TOBN(0xea82c395, 0x977f2547), - TOBN(0xcbdfdf1a, 0x661ea646), TOBN(0xc7ccc591, 0xb9085451), - TOBN(0x82177962, 0x81761e13), TOBN(0xda57596f, 0x9196885c), - TOBN(0xbc17e849, 0x28ffbd70), TOBN(0x1e6e0a41, 0x2671d36f), - TOBN(0x61ae872c, 0x4152fcf5), TOBN(0x441c87b0, 0x9e77e754), - TOBN(0xd0799dd5, 0xa34dff09), TOBN(0x766b4e44, 0x88a6b171), - TOBN(0xdc06a512, 0x11f1c792), TOBN(0xea02ae93, 0x4be35c3e), - TOBN(0xe5ca4d6d, 0xe90c469e), TOBN(0x4df4368e, 0x56e4ff5c), - TOBN(0x7817acab, 0x4baef62e), TOBN(0x9f5a2202, 0xa85b91e8), - TOBN(0x9666ebe6, 0x6ce57610), TOBN(0x32ad31f3, 0xf73bfe03), - TOBN(0x628330a4, 0x25bcf4d6), TOBN(0xea950593, 0x515056e6), - TOBN(0x59811c89, 0xe1332156), TOBN(0xc89cf1fe, 0x8c11b2d7), - TOBN(0x75b63913, 0x04e60cc0), TOBN(0xce811e8d, 0x4625d375), - TOBN(0x030e43fc, 0x2d26e562), TOBN(0xfbb30b4b, 0x608d36a0), - TOBN(0x634ff82c, 0x48528118), TOBN(0x7c6fe085, 0xcd285911), - TOBN(0x7f2830c0, 0x99358f28), TOBN(0x2e60a95e, 0x665e6c09), - TOBN(0x08407d3d, 0x9b785dbf), TOBN(0x530889ab, 0xa759bce7), - TOBN(0xf228e0e6, 0x52f61239), TOBN(0x2b6d1461, 0x6879be3c), - TOBN(0xe6902c04, 0x51a7bbf7), TOBN(0x30ad99f0, 0x76f24a64), - TOBN(0x66d9317a, 0x98bc6da0), TOBN(0xf4f877f3, 0xcb596ac0), - TOBN(0xb05ff62d, 0x4c44f119), TOBN(0x4555f536, 0xe9b77416), - TOBN(0xc7c0d059, 0x8caed63b), TOBN(0x0cd2b7ce, 0xc358b2a9), - TOBN(0x3f33287b, 0x46945fa3), TOBN(0xf8785b20, 0xd67c8791), - TOBN(0xc54a7a61, 0x9637bd08), TOBN(0x54d4598c, 0x18be79d7), - TOBN(0x889e5acb, 0xc46d7ce1), TOBN(0x9a515bb7, 0x8b085877), - TOBN(0xfac1a03d, 0x0b7a5050), TOBN(0x7d3e738a, 0xf2926035), - TOBN(0x861cc2ce, 0x2a6cb0eb), TOBN(0x6f2e2955, 0x8f7adc79), - TOBN(0x61c4d451, 0x33016376), TOBN(0xd9fd2c80, 0x5ad59090), - TOBN(0xe5a83738, 0xb2b836a1), TOBN(0x855b41a0, 0x7c0d6622), - TOBN(0x186fe317, 0x7cc19af1), TOBN(0x6465c1ff, 0xfdd99acb), - TOBN(0x46e5c23f, 0x6974b99e), TOBN(0x75a7cf8b, 0xa2717cbe), - TOBN(0x4d2ebc3f, 0x062be658), TOBN(0x094b4447, 0x5f209c98), - TOBN(0x4af285ed, 0xb940cb5a), TOBN(0x6706d792, 0x7cc82f10), - TOBN(0xc8c8776c, 0x030526fa), TOBN(0xfa8e6f76, 0xa0da9140), - TOBN(0x77ea9d34, 0x591ee4f0), TOBN(0x5f46e337, 0x40274166), - TOBN(0x1bdf98bb, 0xea671457), TOBN(0xd7c08b46, 0x862a1fe2), - TOBN(0x46cc303c, 0x1c08ad63), TOBN(0x99543440, 0x4c845e7b), - TOBN(0x1b8fbdb5, 0x48f36bf7), TOBN(0x5b82c392, 0x8c8273a7), - TOBN(0x08f712c4, 0x928435d5), TOBN(0x071cf0f1, 0x79330380), - TOBN(0xc74c2d24, 0xa8da054a), TOBN(0xcb0e7201, 0x43c46b5c), - TOBN(0x0ad7337a, 0xc0b7eff3), TOBN(0x8552225e, 0xc5e48b3c), - TOBN(0xe6f78b0c, 0x73f13a5f), TOBN(0x5e70062e, 0x82349cbe), - TOBN(0x6b8d5048, 0xe7073969), TOBN(0x392d2a29, 0xc33cb3d2), - TOBN(0xee4f727c, 0x4ecaa20f), TOBN(0xa068c99e, 0x2ccde707), - TOBN(0xfcd5651f, 0xb87a2913), TOBN(0xea3e3c15, 0x3cc252f0), - TOBN(0x777d92df, 0x3b6cd3e4), TOBN(0x7a414143, 0xc5a732e7), - TOBN(0xa895951a, 0xa71ff493), TOBN(0xfe980c92, 0xbbd37cf6), - TOBN(0x45bd5e64, 0xdecfeeff), TOBN(0x910dc2a9, 0xa44c43e9), - TOBN(0xcb403f26, 0xcca9f54d), TOBN(0x928bbdfb, 0x9303f6db), - TOBN(0x3c37951e, 0xa9eee67c), TOBN(0x3bd61a52, 0xf79961c3), - TOBN(0x09a238e6, 0x395c9a79), TOBN(0x6940ca2d, 0x61eb352d), - TOBN(0x7d1e5c5e, 0xc1875631), TOBN(0x1e19742c, 0x1e1b20d1), - TOBN(0x4633d908, 0x23fc2e6e), TOBN(0xa76e29a9, 0x08959149), - TOBN(0x61069d9c, 0x84ed7da5), TOBN(0x0baa11cf, 0x5dbcad51), - TOBN(0xd01eec64, 0x961849da), TOBN(0x93b75f1f, 0xaf3d8c28), - TOBN(0x57bc4f9f, 0x1ca2ee44), TOBN(0x5a26322d, 0x00e00558), - TOBN(0x1888d658, 0x61a023ef), TOBN(0x1d72aab4, 0xb9e5246e), - TOBN(0xa9a26348, 0xe5563ec0), TOBN(0xa0971963, 0xc3439a43), - TOBN(0x567dd54b, 0xadb9b5b7), TOBN(0x73fac1a1, 0xc45a524b), - TOBN(0x8fe97ef7, 0xfe38e608), TOBN(0x608748d2, 0x3f384f48), - TOBN(0xb0571794, 0xc486094f), TOBN(0x869254a3, 0x8bf3a8d6), - TOBN(0x148a8dd1, 0x310b0e25), TOBN(0x99ab9f3f, 0x9aa3f7d8), - TOBN(0x0927c68a, 0x6706c02e), TOBN(0x22b5e76c, 0x69790e6c), - TOBN(0x6c325260, 0x6c71376c), TOBN(0x53a57690, 0x09ef6657), - TOBN(0x8d63f852, 0xedffcf3a), TOBN(0xb4d2ed04, 0x3c0a6f55), - TOBN(0xdb3aa8de, 0x12519b9e), TOBN(0x5d38e9c4, 0x1e0a569a), - TOBN(0x871528bf, 0x303747e2), TOBN(0xa208e77c, 0xf5b5c18d), - TOBN(0x9d129c88, 0xca6bf923), TOBN(0xbcbf197f, 0xbf02839f), - TOBN(0x9b9bf030, 0x27323194), TOBN(0x3b055a8b, 0x339ca59d), - TOBN(0xb46b2312, 0x0f669520), TOBN(0x19789f1f, 0x497e5f24), - TOBN(0x9c499468, 0xaaf01801), TOBN(0x72ee1190, 0x8b69d59c), - TOBN(0x8bd39595, 0xacf4c079), TOBN(0x3ee11ece, 0x8e0cd048), - TOBN(0xebde86ec, 0x1ed66f18), TOBN(0x225d906b, 0xd61fce43), - TOBN(0x5cab07d6, 0xe8bed74d), TOBN(0x16e4617f, 0x27855ab7), - TOBN(0x6568aadd, 0xb2fbc3dd), TOBN(0xedb5484f, 0x8aeddf5b), - TOBN(0x878f20e8, 0x6dcf2fad), TOBN(0x3516497c, 0x615f5699)}, - {TOBN(0xef0a3fec, 0xfa181e69), TOBN(0x9ea02f81, 0x30d69a98), - TOBN(0xb2e9cf8e, 0x66eab95d), TOBN(0x520f2beb, 0x24720021), - TOBN(0x621c540a, 0x1df84361), TOBN(0x12037721, 0x71fa6d5d), - TOBN(0x6e3c7b51, 0x0ff5f6ff), TOBN(0x817a069b, 0xabb2bef3), - TOBN(0x83572fb6, 0xb294cda6), TOBN(0x6ce9bf75, 0xb9039f34), - TOBN(0x20e012f0, 0x095cbb21), TOBN(0xa0aecc1b, 0xd063f0da), - TOBN(0x57c21c3a, 0xf02909e5), TOBN(0xc7d59ecf, 0x48ce9cdc), - TOBN(0x2732b844, 0x8ae336f8), TOBN(0x056e3723, 0x3f4f85f4), - TOBN(0x8a10b531, 0x89e800ca), TOBN(0x50fe0c17, 0x145208fd), - TOBN(0x9e43c0d3, 0xb714ba37), TOBN(0x427d200e, 0x34189acc), - TOBN(0x05dee24f, 0xe616e2c0), TOBN(0x9c25f4c8, 0xee1854c1), - TOBN(0x4d3222a5, 0x8f342a73), TOBN(0x0807804f, 0xa027c952), - TOBN(0xc222653a, 0x4f0d56f3), TOBN(0x961e4047, 0xca28b805), - TOBN(0x2c03f8b0, 0x4a73434b), TOBN(0x4c966787, 0xab712a19), - TOBN(0xcc196c42, 0x864fee42), TOBN(0xc1be93da, 0x5b0ece5c), - TOBN(0xa87d9f22, 0xc131c159), TOBN(0x2bb6d593, 0xdce45655), - TOBN(0x22c49ec9, 0xb809b7ce), TOBN(0x8a41486b, 0xe2c72c2c), - TOBN(0x813b9420, 0xfea0bf36), TOBN(0xb3d36ee9, 0xa66dac69), - TOBN(0x6fddc08a, 0x328cc987), TOBN(0x0a3bcd2c, 0x3a326461), - TOBN(0x7103c49d, 0xd810dbba), TOBN(0xf9d81a28, 0x4b78a4c4), - TOBN(0x3de865ad, 0xe4d55941), TOBN(0xdedafa5e, 0x30384087), - TOBN(0x6f414abb, 0x4ef18b9b), TOBN(0x9ee9ea42, 0xfaee5268), - TOBN(0x260faa16, 0x37a55a4a), TOBN(0xeb19a514, 0x015f93b9), - TOBN(0x51d7ebd2, 0x9e9c3598), TOBN(0x523fc56d, 0x1932178e), - TOBN(0x501d070c, 0xb98fe684), TOBN(0xd60fbe9a, 0x124a1458), - TOBN(0xa45761c8, 0x92bc6b3f), TOBN(0xf5384858, 0xfe6f27cb), - TOBN(0x4b0271f7, 0xb59e763b), TOBN(0x3d4606a9, 0x5b5a8e5e), - TOBN(0x1eda5d9b, 0x05a48292), TOBN(0xda7731d0, 0xe6fec446), - TOBN(0xa3e33693, 0x90d45871), TOBN(0xe9764040, 0x06166d8d), - TOBN(0xb5c33682, 0x89a90403), TOBN(0x4bd17983, 0x72f1d637), - TOBN(0xa616679e, 0xd5d2c53a), TOBN(0x5ec4bcd8, 0xfdcf3b87), - TOBN(0xae6d7613, 0xb66a694e), TOBN(0x7460fc76, 0xe3fc27e5), - TOBN(0x70469b82, 0x95caabee), TOBN(0xde024ca5, 0x889501e3), - TOBN(0x6bdadc06, 0x076ed265), TOBN(0x0cb1236b, 0x5a0ef8b2), - TOBN(0x4065ddbf, 0x0972ebf9), TOBN(0xf1dd3875, 0x22aca432), - TOBN(0xa88b97cf, 0x744aff76), TOBN(0xd1359afd, 0xfe8e3d24), - TOBN(0x52a3ba2b, 0x91502cf3), TOBN(0x2c3832a8, 0x084db75d), - TOBN(0x04a12ddd, 0xde30b1c9), TOBN(0x7802eabc, 0xe31fd60c), - TOBN(0x33707327, 0xa37fddab), TOBN(0x65d6f2ab, 0xfaafa973), - TOBN(0x3525c5b8, 0x11e6f91a), TOBN(0x76aeb0c9, 0x5f46530b), - TOBN(0xe8815ff6, 0x2f93a675), TOBN(0xa6ec9684, 0x05f48679), - TOBN(0x6dcbb556, 0x358ae884), TOBN(0x0af61472, 0xe19e3873), - TOBN(0x72334372, 0xa5f696be), TOBN(0xc65e57ea, 0x6f22fb70), - TOBN(0x268da30c, 0x946cea90), TOBN(0x136a8a87, 0x65681b2a), - TOBN(0xad5e81dc, 0x0f9f44d4), TOBN(0xf09a6960, 0x2c46585a), - TOBN(0xd1649164, 0xc447d1b1), TOBN(0x3b4b36c8, 0x879dc8b1), - TOBN(0x20d4177b, 0x3b6b234c), TOBN(0x096a2505, 0x1730d9d0), - TOBN(0x0611b9b8, 0xef80531d), TOBN(0xba904b3b, 0x64bb495d), - TOBN(0x1192d9d4, 0x93a3147a), TOBN(0x9f30a5dc, 0x9a565545), - TOBN(0x90b1f9cb, 0x6ef07212), TOBN(0x29958546, 0x0d87fc13), - TOBN(0xd3323eff, 0xc17db9ba), TOBN(0xcb18548c, 0xcb1644a8), - TOBN(0x18a306d4, 0x4f49ffbc), TOBN(0x28d658f1, 0x4c2e8684), - TOBN(0x44ba60cd, 0xa99f8c71), TOBN(0x67b7abdb, 0x4bf742ff), - TOBN(0x66310f9c, 0x914b3f99), TOBN(0xae430a32, 0xf412c161), - TOBN(0x1e6776d3, 0x88ace52f), TOBN(0x4bc0fa24, 0x52d7067d), - TOBN(0x03c286aa, 0x8f07cd1b), TOBN(0x4cb8f38c, 0xa985b2c1), - TOBN(0x83ccbe80, 0x8c3bff36), TOBN(0x005a0bd2, 0x5263e575), - TOBN(0x460d7dda, 0x259bdcd1), TOBN(0x4a1c5642, 0xfa5cab6b), - TOBN(0x2b7bdbb9, 0x9fe4fc88), TOBN(0x09418e28, 0xcc97bbb5), - TOBN(0xd8274fb4, 0xa12321ae), TOBN(0xb137007d, 0x5c87b64e), - TOBN(0x80531fe1, 0xc63c4962), TOBN(0x50541e89, 0x981fdb25), - TOBN(0xdc1291a1, 0xfd4c2b6b), TOBN(0xc0693a17, 0xa6df4fca), - TOBN(0xb2c4604e, 0x0117f203), TOBN(0x245f1963, 0x0a99b8d0), - TOBN(0xaedc20aa, 0xc6212c44), TOBN(0xb1ed4e56, 0x520f52a8), - TOBN(0xfe48f575, 0xf8547be3), TOBN(0x0a7033cd, 0xa9e45f98), - TOBN(0x4b45d3a9, 0x18c50100), TOBN(0xb2a6cd6a, 0xa61d41da), - TOBN(0x60bbb4f5, 0x57933c6b), TOBN(0xa7538ebd, 0x2b0d7ffc), - TOBN(0x9ea3ab8d, 0x8cd626b6), TOBN(0x8273a484, 0x3601625a), - TOBN(0x88859845, 0x0168e508), TOBN(0x8cbc9bb2, 0x99a94abd), - TOBN(0x713ac792, 0xfab0a671), TOBN(0xa3995b19, 0x6c9ebffc), - TOBN(0xe711668e, 0x1239e152), TOBN(0x56892558, 0xbbb8dff4), - TOBN(0x8bfc7dab, 0xdbf17963), TOBN(0x5b59fe5a, 0xb3de1253), - TOBN(0x7e3320eb, 0x34a9f7ae), TOBN(0xe5e8cf72, 0xd751efe4), - TOBN(0x7ea003bc, 0xd9be2f37), TOBN(0xc0f551a0, 0xb6c08ef7), - TOBN(0x56606268, 0x038f6725), TOBN(0x1dd38e35, 0x6d92d3b6), - TOBN(0x07dfce7c, 0xc3cbd686), TOBN(0x4e549e04, 0x651c5da8), - TOBN(0x4058f93b, 0x08b19340), TOBN(0xc2fae6f4, 0xcac6d89d), - TOBN(0x4bad8a8c, 0x8f159cc7), TOBN(0x0ddba4b3, 0xcb0b601c), - TOBN(0xda4fc7b5, 0x1dd95f8c), TOBN(0x1d163cd7, 0xcea5c255), - TOBN(0x30707d06, 0x274a8c4c), TOBN(0x79d9e008, 0x2802e9ce), - TOBN(0x02a29ebf, 0xe6ddd505), TOBN(0x37064e74, 0xb50bed1a), - TOBN(0x3f6bae65, 0xa7327d57), TOBN(0x3846f5f1, 0xf83920bc), - TOBN(0x87c37491, 0x60df1b9b), TOBN(0x4cfb2895, 0x2d1da29f), - TOBN(0x10a478ca, 0x4ed1743c), TOBN(0x390c6030, 0x3edd47c6), - TOBN(0x8f3e5312, 0x8c0a78de), TOBN(0xccd02bda, 0x1e85df70), - TOBN(0xd6c75c03, 0xa61b6582), TOBN(0x0762921c, 0xfc0eebd1), - TOBN(0xd34d0823, 0xd85010c0), TOBN(0xd73aaacb, 0x0044cf1f), - TOBN(0xfb4159bb, 0xa3b5e78a), TOBN(0x2287c7f7, 0xe5826f3f), - TOBN(0x4aeaf742, 0x580b1a01), TOBN(0xf080415d, 0x60423b79), - TOBN(0xe12622cd, 0xa7dea144), TOBN(0x49ea4996, 0x59d62472), - TOBN(0xb42991ef, 0x571f3913), TOBN(0x0610f214, 0xf5b25a8a), - TOBN(0x47adc585, 0x30b79e8f), TOBN(0xf90e3df6, 0x07a065a2), - TOBN(0x5d0a5deb, 0x43e2e034), TOBN(0x53fb5a34, 0x444024aa), - TOBN(0xa8628c68, 0x6b0c9f7f), TOBN(0x9c69c29c, 0xac563656), - TOBN(0x5a231feb, 0xbace47b6), TOBN(0xbdce0289, 0x9ea5a2ec), - TOBN(0x05da1fac, 0x9463853e), TOBN(0x96812c52, 0x509e78aa), - TOBN(0xd3fb5771, 0x57151692), TOBN(0xeb2721f8, 0xd98e1c44), - TOBN(0xc0506087, 0x32399be1), TOBN(0xda5a5511, 0xd979d8b8), - TOBN(0x737ed55d, 0xc6f56780), TOBN(0xe20d3004, 0x0dc7a7f4), - TOBN(0x02ce7301, 0xf5941a03), TOBN(0x91ef5215, 0xed30f83a), - TOBN(0x28727fc1, 0x4092d85f), TOBN(0x72d223c6, 0x5c49e41a), - TOBN(0xa7cf30a2, 0xba6a4d81), TOBN(0x7c086209, 0xb030d87d), - TOBN(0x04844c7d, 0xfc588b09), TOBN(0x728cd499, 0x5874bbb0), - TOBN(0xcc1281ee, 0xe84c0495), TOBN(0x0769b5ba, 0xec31958f), - TOBN(0x665c228b, 0xf99c2471), TOBN(0xf2d8a11b, 0x191eb110), - TOBN(0x4594f494, 0xd36d7024), TOBN(0x482ded8b, 0xcdcb25a1), - TOBN(0xc958a9d8, 0xdadd4885), TOBN(0x7004477e, 0xf1d2b547), - TOBN(0x0a45f6ef, 0x2a0af550), TOBN(0x4fc739d6, 0x2f8d6351), - TOBN(0x75cdaf27, 0x786f08a9), TOBN(0x8700bb26, 0x42c2737f), - TOBN(0x855a7141, 0x1c4e2670), TOBN(0x810188c1, 0x15076fef), - TOBN(0xc251d0c9, 0xabcd3297), TOBN(0xae4c8967, 0xf48108eb), - TOBN(0xbd146de7, 0x18ceed30), TOBN(0xf9d4f07a, 0xc986bced), - TOBN(0x5ad98ed5, 0x83fa1e08), TOBN(0x7780d33e, 0xbeabd1fb), - TOBN(0xe330513c, 0x903b1196), TOBN(0xba11de9e, 0xa47bc8c4), - TOBN(0x684334da, 0x02c2d064), TOBN(0x7ecf360d, 0xa48de23b), - TOBN(0x57a1b474, 0x0a9089d8), TOBN(0xf28fa439, 0xff36734c), - TOBN(0xf2a482cb, 0xea4570b3), TOBN(0xee65d68b, 0xa5ebcee9), - TOBN(0x988d0036, 0xb9694cd5), TOBN(0x53edd0e9, 0x37885d32), - TOBN(0xe37e3307, 0xbeb9bc6d), TOBN(0xe9abb907, 0x9f5c6768), - TOBN(0x4396ccd5, 0x51f2160f), TOBN(0x2500888c, 0x47336da6), - TOBN(0x383f9ed9, 0x926fce43), TOBN(0x809dd1c7, 0x04da2930), - TOBN(0x30f6f596, 0x8a4cb227), TOBN(0x0d700c7f, 0x73a56b38), - TOBN(0x1825ea33, 0xab64a065), TOBN(0xaab9b735, 0x1338df80), - TOBN(0x1516100d, 0x9b63f57f), TOBN(0x2574395a, 0x27a6a634), - TOBN(0xb5560fb6, 0x700a1acd), TOBN(0xe823fd73, 0xfd999681), - TOBN(0xda915d1f, 0x6cb4e1ba), TOBN(0x0d030118, 0x6ebe00a3), - TOBN(0x744fb0c9, 0x89fca8cd), TOBN(0x970d01db, 0xf9da0e0b), - TOBN(0x0ad8c564, 0x7931d76f), TOBN(0xb15737bf, 0xf659b96a), - TOBN(0xdc9933e8, 0xa8b484e7), TOBN(0xb2fdbdf9, 0x7a26dec7), - TOBN(0x2349e9a4, 0x9f1f0136), TOBN(0x7860368e, 0x70fddddb), - TOBN(0xd93d2c1c, 0xf9ad3e18), TOBN(0x6d6c5f17, 0x689f4e79), - TOBN(0x7a544d91, 0xb24ff1b6), TOBN(0x3e12a5eb, 0xfe16cd8c), - TOBN(0x543574e9, 0xa56b872f), TOBN(0xa1ad550c, 0xfcf68ea2), - TOBN(0x689e37d2, 0x3f560ef7), TOBN(0x8c54b9ca, 0xc9d47a8b), - TOBN(0x46d40a4a, 0x088ac342), TOBN(0xec450c7c, 0x1576c6d0), - TOBN(0xb589e31c, 0x1f9689e9), TOBN(0xdacf2602, 0xb8781718), - TOBN(0xa89237c6, 0xc8cb6b42), TOBN(0x1326fc93, 0xb96ef381), - TOBN(0x55d56c6d, 0xb5f07825), TOBN(0xacba2eea, 0x7449e22d), - TOBN(0x74e0887a, 0x633c3000), TOBN(0xcb6cd172, 0xd7cbcf71), - TOBN(0x309e81de, 0xc36cf1be), TOBN(0x07a18a6d, 0x60ae399b), - TOBN(0xb36c2679, 0x9edce57e), TOBN(0x52b892f4, 0xdf001d41), - TOBN(0xd884ae5d, 0x16a1f2c6), TOBN(0x9b329424, 0xefcc370a), - TOBN(0x3120daf2, 0xbd2e21df), TOBN(0x55298d2d, 0x02470a99), - TOBN(0x0b78af6c, 0xa05db32e), TOBN(0x5c76a331, 0x601f5636), - TOBN(0xaae861ff, 0xf8a4f29c), TOBN(0x70dc9240, 0xd68f8d49), - TOBN(0x960e649f, 0x81b1321c), TOBN(0x3d2c801b, 0x8792e4ce), - TOBN(0xf479f772, 0x42521876), TOBN(0x0bed93bc, 0x416c79b1), - TOBN(0xa67fbc05, 0x263e5bc9), TOBN(0x01e8e630, 0x521db049), - TOBN(0x76f26738, 0xc6f3431e), TOBN(0xe609cb02, 0xe3267541), - TOBN(0xb10cff2d, 0x818c877c), TOBN(0x1f0e75ce, 0x786a13cb), - TOBN(0xf4fdca64, 0x1158544d), TOBN(0x5d777e89, 0x6cb71ed0), - TOBN(0x3c233737, 0xa9aa4755), TOBN(0x7b453192, 0xe527ab40), - TOBN(0xdb59f688, 0x39f05ffe), TOBN(0x8f4f4be0, 0x6d82574e), - TOBN(0xcce3450c, 0xee292d1b), TOBN(0xaa448a12, 0x61ccd086), - TOBN(0xabce91b3, 0xf7914967), TOBN(0x4537f09b, 0x1908a5ed), - TOBN(0xa812421e, 0xf51042e7), TOBN(0xfaf5cebc, 0xec0b3a34), - TOBN(0x730ffd87, 0x4ca6b39a), TOBN(0x70fb72ed, 0x02efd342), - TOBN(0xeb4735f9, 0xd75c8edb), TOBN(0xc11f2157, 0xc278aa51), - TOBN(0xc459f635, 0xbf3bfebf), TOBN(0x3a1ff0b4, 0x6bd9601f), - TOBN(0xc9d12823, 0xc420cb73), TOBN(0x3e9af3e2, 0x3c2915a3), - TOBN(0xe0c82c72, 0xb41c3440), TOBN(0x175239e5, 0xe3039a5f), - TOBN(0xe1084b8a, 0x558795a3), TOBN(0x328d0a1d, 0xd01e5c60), - TOBN(0x0a495f2e, 0xd3788a04), TOBN(0x25d8ff16, 0x66c11a9f), - TOBN(0xf5155f05, 0x9ed692d6), TOBN(0x954fa107, 0x4f425fe4), - TOBN(0xd16aabf2, 0xe98aaa99), TOBN(0x90cd8ba0, 0x96b0f88a), - TOBN(0x957f4782, 0xc154026a), TOBN(0x54ee0734, 0x52af56d2), - TOBN(0xbcf89e54, 0x45b4147a), TOBN(0x3d102f21, 0x9a52816c), - TOBN(0x6808517e, 0x39b62e77), TOBN(0x92e25421, 0x69169ad8), - TOBN(0xd721d871, 0xbb608558), TOBN(0x60e4ebae, 0xf6d4ff9b), - TOBN(0x0ba10819, 0x41f2763e), TOBN(0xca2e45be, 0x51ee3247), - TOBN(0x66d172ec, 0x2bfd7a5f), TOBN(0x528a8f2f, 0x74d0b12d), - TOBN(0xe17f1e38, 0xdabe70dc), TOBN(0x1d5d7316, 0x9f93983c), - TOBN(0x51b2184a, 0xdf423e31), TOBN(0xcb417291, 0xaedb1a10), - TOBN(0x2054ca93, 0x625bcab9), TOBN(0x54396860, 0xa98998f0), - TOBN(0x4e53f6c4, 0xa54ae57e), TOBN(0x0ffeb590, 0xee648e9d), - TOBN(0xfbbdaadc, 0x6afaf6bc), TOBN(0xf88ae796, 0xaa3bfb8a), - TOBN(0x209f1d44, 0xd2359ed9), TOBN(0xac68dd03, 0xf3544ce2), - TOBN(0xf378da47, 0xfd51e569), TOBN(0xe1abd860, 0x2cc80097), - TOBN(0x23ca18d9, 0x343b6e3a), TOBN(0x480797e8, 0xb40a1bae), - TOBN(0xd1f0c717, 0x533f3e67), TOBN(0x44896970, 0x06e6cdfc), - TOBN(0x8ca21055, 0x52a82e8d), TOBN(0xb2caf785, 0x78460cdc), - TOBN(0x4c1b7b62, 0xe9037178), TOBN(0xefc09d2c, 0xdb514b58), - TOBN(0x5f2df9ee, 0x9113be5c), TOBN(0x2fbda78f, 0xb3f9271c), - TOBN(0xe09a81af, 0x8f83fc54), TOBN(0x06b13866, 0x8afb5141), - TOBN(0x38f6480f, 0x43e3865d), TOBN(0x72dd77a8, 0x1ddf47d9), - TOBN(0xf2a8e971, 0x4c205ff7), TOBN(0x46d449d8, 0x9d088ad8), - TOBN(0x926619ea, 0x185d706f), TOBN(0xe47e02eb, 0xc7dd7f62), - TOBN(0xe7f120a7, 0x8cbc2031), TOBN(0xc18bef00, 0x998d4ac9), - TOBN(0x18f37a9c, 0x6bdf22da), TOBN(0xefbc432f, 0x90dc82df), - TOBN(0xc52cef8e, 0x5d703651), TOBN(0x82887ba0, 0xd99881a5), - TOBN(0x7cec9dda, 0xb920ec1d), TOBN(0xd0d7e8c3, 0xec3e8d3b), - TOBN(0x445bc395, 0x4ca88747), TOBN(0xedeaa2e0, 0x9fd53535), - TOBN(0x461b1d93, 0x6cc87475), TOBN(0xd92a52e2, 0x6d2383bd), - TOBN(0xfabccb59, 0xd7903546), TOBN(0x6111a761, 0x3d14b112), - TOBN(0x0ae584fe, 0xb3d5f612), TOBN(0x5ea69b8d, 0x60e828ec), - TOBN(0x6c078985, 0x54087030), TOBN(0x649cab04, 0xac4821fe), - TOBN(0x25ecedcf, 0x8bdce214), TOBN(0xb5622f72, 0x86af7361), - TOBN(0x0e1227aa, 0x7038b9e2), TOBN(0xd0efb273, 0xac20fa77), - TOBN(0x817ff88b, 0x79df975b), TOBN(0x856bf286, 0x1999503e), - TOBN(0xb4d5351f, 0x5038ec46), TOBN(0x740a52c5, 0xfc42af6e), - TOBN(0x2e38bb15, 0x2cbb1a3f), TOBN(0xc3eb99fe, 0x17a83429), - TOBN(0xca4fcbf1, 0xdd66bb74), TOBN(0x880784d6, 0xcde5e8fc), - TOBN(0xddc84c1c, 0xb4e7a0be), TOBN(0x8780510d, 0xbd15a72f), - TOBN(0x44bcf1af, 0x81ec30e1), TOBN(0x141e50a8, 0x0a61073e), - TOBN(0x0d955718, 0x47be87ae), TOBN(0x68a61417, 0xf76a4372), - TOBN(0xf57e7e87, 0xc607c3d3), TOBN(0x043afaf8, 0x5252f332), - TOBN(0xcc14e121, 0x1552a4d2), TOBN(0xb6dee692, 0xbb4d4ab4), - TOBN(0xb6ab74c8, 0xa03816a4), TOBN(0x84001ae4, 0x6f394a29), - TOBN(0x5bed8344, 0xd795fb45), TOBN(0x57326e7d, 0xb79f55a5), - TOBN(0xc9533ce0, 0x4accdffc), TOBN(0x53473caf, 0x3993fa04), - TOBN(0x7906eb93, 0xa13df4c8), TOBN(0xa73e51f6, 0x97cbe46f), - TOBN(0xd1ab3ae1, 0x0ae4ccf8), TOBN(0x25614508, 0x8a5b3dbc), - TOBN(0x61eff962, 0x11a71b27), TOBN(0xdf71412b, 0x6bb7fa39), - TOBN(0xb31ba6b8, 0x2bd7f3ef), TOBN(0xb0b9c415, 0x69180d29), - TOBN(0xeec14552, 0x014cdde5), TOBN(0x702c624b, 0x227b4bbb), - TOBN(0x2b15e8c2, 0xd3e988f3), TOBN(0xee3bcc6d, 0xa4f7fd04), - TOBN(0x9d00822a, 0x42ac6c85), TOBN(0x2db0cea6, 0x1df9f2b7), - TOBN(0xd7cad2ab, 0x42de1e58), TOBN(0x346ed526, 0x2d6fbb61), - TOBN(0xb3962995, 0x1a2faf09), TOBN(0x2fa8a580, 0x7c25612e), - TOBN(0x30ae04da, 0x7cf56490), TOBN(0x75662908, 0x0eea3961), - TOBN(0x3609f5c5, 0x3d080847), TOBN(0xcb081d39, 0x5241d4f6), - TOBN(0xb4fb3810, 0x77961a63), TOBN(0xc20c5984, 0x2abb66fc), - TOBN(0x3d40aa7c, 0xf902f245), TOBN(0x9cb12736, 0x4e536b1e), - TOBN(0x5eda24da, 0x99b3134f), TOBN(0xafbd9c69, 0x5cd011af), - TOBN(0x9a16e30a, 0xc7088c7d), TOBN(0x5ab65710, 0x3207389f), - TOBN(0x1b09547f, 0xe7407a53), TOBN(0x2322f9d7, 0x4fdc6eab), - TOBN(0xc0f2f22d, 0x7430de4d), TOBN(0x19382696, 0xe68ca9a9), - TOBN(0x17f1eff1, 0x918e5868), TOBN(0xe3b5b635, 0x586f4204), - TOBN(0x146ef980, 0x3fbc4341), TOBN(0x359f2c80, 0x5b5eed4e), - TOBN(0x9f35744e, 0x7482e41d), TOBN(0x9a9ac3ec, 0xf3b224c2), - TOBN(0x9161a6fe, 0x91fc50ae), TOBN(0x89ccc66b, 0xc613fa7c), - TOBN(0x89268b14, 0xc732f15a), TOBN(0x7cd6f4e2, 0xb467ed03), - TOBN(0xfbf79869, 0xce56b40e), TOBN(0xf93e094c, 0xc02dde98), - TOBN(0xefe0c3a8, 0xedee2cd7), TOBN(0x90f3ffc0, 0xb268fd42), - TOBN(0x81a7fd56, 0x08241aed), TOBN(0x95ab7ad8, 0x00b1afe8), - TOBN(0x40127056, 0x3e310d52), TOBN(0xd3ffdeb1, 0x09d9fc43), - TOBN(0xc8f85c91, 0xd11a8594), TOBN(0x2e74d258, 0x31cf6db8), - TOBN(0x829c7ca3, 0x02b5dfd0), TOBN(0xe389cfbe, 0x69143c86), - TOBN(0xd01b6405, 0x941768d8), TOBN(0x45103995, 0x03bf825d), - TOBN(0xcc4ee166, 0x56cd17e2), TOBN(0xbea3c283, 0xba037e79), - TOBN(0x4e1ac06e, 0xd9a47520), TOBN(0xfbfe18aa, 0xaf852404), - TOBN(0x5615f8e2, 0x8087648a), TOBN(0x7301e47e, 0xb9d150d9), - TOBN(0x79f9f9dd, 0xb299b977), TOBN(0x76697a7b, 0xa5b78314), - TOBN(0x10d67468, 0x7d7c90e7), TOBN(0x7afffe03, 0x937210b5), - TOBN(0x5aef3e4b, 0x28c22cee), TOBN(0xefb0ecd8, 0x09fd55ae), - TOBN(0x4cea7132, 0x0d2a5d6a), TOBN(0x9cfb5fa1, 0x01db6357), - TOBN(0x395e0b57, 0xf36e1ac5), TOBN(0x008fa9ad, 0x36cafb7d), - TOBN(0x8f6cdf70, 0x5308c4db), TOBN(0x51527a37, 0x95ed2477), - TOBN(0xba0dee30, 0x5bd21311), TOBN(0x6ed41b22, 0x909c90d7), - TOBN(0xc5f6b758, 0x7c8696d3), TOBN(0x0db8eaa8, 0x3ce83a80), - TOBN(0xd297fe37, 0xb24b4b6f), TOBN(0xfe58afe8, 0x522d1f0d), - TOBN(0x97358736, 0x8c98dbd9), TOBN(0x6bc226ca, 0x9454a527), - TOBN(0xa12b384e, 0xce53c2d0), TOBN(0x779d897d, 0x5e4606da), - TOBN(0xa53e47b0, 0x73ec12b0), TOBN(0x462dbbba, 0x5756f1ad), - TOBN(0x69fe09f2, 0xcafe37b6), TOBN(0x273d1ebf, 0xecce2e17), - TOBN(0x8ac1d538, 0x3cf607fd), TOBN(0x8035f7ff, 0x12e10c25)}, - {TOBN(0x854d34c7, 0x7e6c5520), TOBN(0xc27df9ef, 0xdcb9ea58), - TOBN(0x405f2369, 0xd686666d), TOBN(0x29d1febf, 0x0417aa85), - TOBN(0x9846819e, 0x93470afe), TOBN(0x3e6a9669, 0xe2a27f9e), - TOBN(0x24d008a2, 0xe31e6504), TOBN(0xdba7cecf, 0x9cb7680a), - TOBN(0xecaff541, 0x338d6e43), TOBN(0x56f7dd73, 0x4541d5cc), - TOBN(0xb5d426de, 0x96bc88ca), TOBN(0x48d94f6b, 0x9ed3a2c3), - TOBN(0x6354a3bb, 0x2ef8279c), TOBN(0xd575465b, 0x0b1867f2), - TOBN(0xef99b0ff, 0x95225151), TOBN(0xf3e19d88, 0xf94500d8), - TOBN(0x92a83268, 0xe32dd620), TOBN(0x913ec99f, 0x627849a2), - TOBN(0xedd8fdfa, 0x2c378882), TOBN(0xaf96f33e, 0xee6f8cfe), - TOBN(0xc06737e5, 0xdc3fa8a5), TOBN(0x236bb531, 0xb0b03a1d), - TOBN(0x33e59f29, 0x89f037b0), TOBN(0x13f9b5a7, 0xd9a12a53), - TOBN(0x0d0df6ce, 0x51efb310), TOBN(0xcb5b2eb4, 0x958df5be), - TOBN(0xd6459e29, 0x36158e59), TOBN(0x82aae2b9, 0x1466e336), - TOBN(0xfb658a39, 0x411aa636), TOBN(0x7152ecc5, 0xd4c0a933), - TOBN(0xf10c758a, 0x49f026b7), TOBN(0xf4837f97, 0xcb09311f), - TOBN(0xddfb02c4, 0xc753c45f), TOBN(0x18ca81b6, 0xf9c840fe), - TOBN(0x846fd09a, 0xb0f8a3e6), TOBN(0xb1162add, 0xe7733dbc), - TOBN(0x7070ad20, 0x236e3ab6), TOBN(0xf88cdaf5, 0xb2a56326), - TOBN(0x05fc8719, 0x997cbc7a), TOBN(0x442cd452, 0x4b665272), - TOBN(0x7807f364, 0xb71698f5), TOBN(0x6ba418d2, 0x9f7b605e), - TOBN(0xfd20b00f, 0xa03b2cbb), TOBN(0x883eca37, 0xda54386f), - TOBN(0xff0be43f, 0xf3437f24), TOBN(0xe910b432, 0xa48bb33c), - TOBN(0x4963a128, 0x329df765), TOBN(0xac1dd556, 0xbe2fe6f7), - TOBN(0x557610f9, 0x24a0a3fc), TOBN(0x38e17bf4, 0xe881c3f9), - TOBN(0x6ba84faf, 0xed0dac99), TOBN(0xd4a222c3, 0x59eeb918), - TOBN(0xc79c1dbe, 0x13f542b6), TOBN(0x1fc65e0d, 0xe425d457), - TOBN(0xeffb754f, 0x1debb779), TOBN(0x638d8fd0, 0x9e08af60), - TOBN(0x994f523a, 0x626332d5), TOBN(0x7bc38833, 0x5561bb44), - TOBN(0x005ed4b0, 0x3d845ea2), TOBN(0xd39d3ee1, 0xc2a1f08a), - TOBN(0x6561fdd3, 0xe7676b0d), TOBN(0x620e35ff, 0xfb706017), - TOBN(0x36ce424f, 0xf264f9a8), TOBN(0xc4c3419f, 0xda2681f7), - TOBN(0xfb6afd2f, 0x69beb6e8), TOBN(0x3a50b993, 0x6d700d03), - TOBN(0xc840b2ad, 0x0c83a14f), TOBN(0x573207be, 0x54085bef), - TOBN(0x5af882e3, 0x09fe7e5b), TOBN(0x957678a4, 0x3b40a7e1), - TOBN(0x172d4bdd, 0x543056e2), TOBN(0x9c1b26b4, 0x0df13c0a), - TOBN(0x1c30861c, 0xf405ff06), TOBN(0xebac86bd, 0x486e828b), - TOBN(0xe791a971, 0x636933fc), TOBN(0x50e7c2be, 0x7aeee947), - TOBN(0xc3d4a095, 0xfa90d767), TOBN(0xae60eb7b, 0xe670ab7b), - TOBN(0x17633a64, 0x397b056d), TOBN(0x93a21f33, 0x105012aa), - TOBN(0x663c370b, 0xabb88643), TOBN(0x91df36d7, 0x22e21599), - TOBN(0x183ba835, 0x8b761671), TOBN(0x381eea1d, 0x728f3bf1), - TOBN(0xb9b2f1ba, 0x39966e6c), TOBN(0x7c464a28, 0xe7295492), - TOBN(0x0fd5f70a, 0x09b26b7f), TOBN(0xa9aba1f9, 0xfbe009df), - TOBN(0x857c1f22, 0x369b87ad), TOBN(0x3c00e5d9, 0x32fca556), - TOBN(0x1ad74cab, 0x90b06466), TOBN(0xa7112386, 0x550faaf2), - TOBN(0x7435e198, 0x6d9bd5f5), TOBN(0x2dcc7e38, 0x59c3463f), - TOBN(0xdc7df748, 0xca7bd4b2), TOBN(0x13cd4c08, 0x9dec2f31), - TOBN(0x0d3b5df8, 0xe3237710), TOBN(0x0dadb26e, 0xcbd2f7b0), - TOBN(0x9f5966ab, 0xe4aa082b), TOBN(0x666ec8de, 0x350e966e), - TOBN(0x1bfd1ed5, 0xee524216), TOBN(0xcd93c59b, 0x41dab0b6), - TOBN(0x658a8435, 0xd186d6ba), TOBN(0x1b7d34d2, 0x159d1195), - TOBN(0x5936e460, 0x22caf46b), TOBN(0x6a45dd8f, 0x9a96fe4f), - TOBN(0xf7925434, 0xb98f474e), TOBN(0x41410412, 0x0053ef15), - TOBN(0x71cf8d12, 0x41de97bf), TOBN(0xb8547b61, 0xbd80bef4), - TOBN(0xb47d3970, 0xc4db0037), TOBN(0xf1bcd328, 0xfef20dff), - TOBN(0x31a92e09, 0x10caad67), TOBN(0x1f591960, 0x5531a1e1), - TOBN(0x3bb852e0, 0x5f4fc840), TOBN(0x63e297ca, 0x93a72c6c), - TOBN(0x3c2b0b2e, 0x49abad67), TOBN(0x6ec405fc, 0xed3db0d9), - TOBN(0xdc14a530, 0x7fef1d40), TOBN(0xccd19846, 0x280896fc), - TOBN(0x00f83176, 0x9bb81648), TOBN(0xd69eb485, 0x653120d0), - TOBN(0xd17d75f4, 0x4ccabc62), TOBN(0x34a07f82, 0xb749fcb1), - TOBN(0x2c3af787, 0xbbfb5554), TOBN(0xb06ed4d0, 0x62e283f8), - TOBN(0x5722889f, 0xa19213a0), TOBN(0x162b085e, 0xdcf3c7b4), - TOBN(0xbcaecb31, 0xe0dd3eca), TOBN(0xc6237fbc, 0xe52f13a5), - TOBN(0xcc2b6b03, 0x27bac297), TOBN(0x2ae1cac5, 0xb917f54a), - TOBN(0x474807d4, 0x7845ae4f), TOBN(0xfec7dd92, 0xce5972e0), - TOBN(0xc3bd2541, 0x1d7915bb), TOBN(0x66f85dc4, 0xd94907ca), - TOBN(0xd981b888, 0xbdbcf0ca), TOBN(0xd75f5da6, 0xdf279e9f), - TOBN(0x128bbf24, 0x7054e934), TOBN(0x3c6ff6e5, 0x81db134b), - TOBN(0x795b7cf4, 0x047d26e4), TOBN(0xf370f7b8, 0x5049ec37), - TOBN(0xc6712d4d, 0xced945af), TOBN(0xdf30b5ec, 0x095642bc), - TOBN(0x9b034c62, 0x4896246e), TOBN(0x5652c016, 0xee90bbd1), - TOBN(0xeb38636f, 0x87fedb73), TOBN(0x5e32f847, 0x0135a613), - TOBN(0x0703b312, 0xcf933c83), TOBN(0xd05bb76e, 0x1a7f47e6), - TOBN(0x825e4f0c, 0x949c2415), TOBN(0x569e5622, 0x7250d6f8), - TOBN(0xbbe9eb3a, 0x6568013e), TOBN(0x8dbd203f, 0x22f243fc), - TOBN(0x9dbd7694, 0xb342734a), TOBN(0x8f6d12f8, 0x46afa984), - TOBN(0xb98610a2, 0xc9eade29), TOBN(0xbab4f323, 0x47dd0f18), - TOBN(0x5779737b, 0x671c0d46), TOBN(0x10b6a7c6, 0xd3e0a42a), - TOBN(0xfb19ddf3, 0x3035b41c), TOBN(0xd336343f, 0x99c45895), - TOBN(0x61fe4938, 0x54c857e5), TOBN(0xc4d506be, 0xae4e57d5), - TOBN(0x3cd8c8cb, 0xbbc33f75), TOBN(0x7281f08a, 0x9262c77d), - TOBN(0x083f4ea6, 0xf11a2823), TOBN(0x8895041e, 0x9fba2e33), - TOBN(0xfcdfea49, 0x9c438edf), TOBN(0x7678dcc3, 0x91edba44), - TOBN(0xf07b3b87, 0xe2ba50f0), TOBN(0xc13888ef, 0x43948c1b), - TOBN(0xc2135ad4, 0x1140af42), TOBN(0x8e5104f3, 0x926ed1a7), - TOBN(0xf24430cb, 0x88f6695f), TOBN(0x0ce0637b, 0x6d73c120), - TOBN(0xb2db01e6, 0xfe631e8f), TOBN(0x1c5563d7, 0xd7bdd24b), - TOBN(0x8daea3ba, 0x369ad44f), TOBN(0x000c81b6, 0x8187a9f9), - TOBN(0x5f48a951, 0xaae1fd9a), TOBN(0xe35626c7, 0x8d5aed8a), - TOBN(0x20952763, 0x0498c622), TOBN(0x76d17634, 0x773aa504), - TOBN(0x36d90dda, 0xeb300f7a), TOBN(0x9dcf7dfc, 0xedb5e801), - TOBN(0x645cb268, 0x74d5244c), TOBN(0xa127ee79, 0x348e3aa2), - TOBN(0x488acc53, 0x575f1dbb), TOBN(0x95037e85, 0x80e6161e), - TOBN(0x57e59283, 0x292650d0), TOBN(0xabe67d99, 0x14938216), - TOBN(0x3c7f944b, 0x3f8e1065), TOBN(0xed908cb6, 0x330e8924), - TOBN(0x08ee8fd5, 0x6f530136), TOBN(0x2227b7d5, 0xd7ffc169), - TOBN(0x4f55c893, 0xb5cd6dd5), TOBN(0x82225e11, 0xa62796e8), - TOBN(0x5c6cead1, 0xcb18e12c), TOBN(0x4381ae0c, 0x84f5a51a), - TOBN(0x345913d3, 0x7fafa4c8), TOBN(0x3d918082, 0x0491aac0), - TOBN(0x9347871f, 0x3e69264c), TOBN(0xbea9dd3c, 0xb4f4f0cd), - TOBN(0xbda5d067, 0x3eadd3e7), TOBN(0x0033c1b8, 0x0573bcd8), - TOBN(0x25589379, 0x5da2486c), TOBN(0xcb89ee5b, 0x86abbee7), - TOBN(0x8fe0a8f3, 0x22532e5d), TOBN(0xb6410ff0, 0x727dfc4c), - TOBN(0x619b9d58, 0x226726db), TOBN(0x5ec25669, 0x7a2b2dc7), - TOBN(0xaf4d2e06, 0x4c3beb01), TOBN(0x852123d0, 0x7acea556), - TOBN(0x0e9470fa, 0xf783487a), TOBN(0x75a7ea04, 0x5664b3eb), - TOBN(0x4ad78f35, 0x6798e4ba), TOBN(0x9214e6e5, 0xc7d0e091), - TOBN(0xc420b488, 0xb1290403), TOBN(0x64049e0a, 0xfc295749), - TOBN(0x03ef5af1, 0x3ae9841f), TOBN(0xdbe4ca19, 0xb0b662a6), - TOBN(0x46845c5f, 0xfa453458), TOBN(0xf8dabf19, 0x10b66722), - TOBN(0xb650f0aa, 0xcce2793b), TOBN(0x71db851e, 0xc5ec47c1), - TOBN(0x3eb78f3e, 0x3b234fa9), TOBN(0xb0c60f35, 0xfc0106ce), - TOBN(0x05427121, 0x774eadbd), TOBN(0x25367faf, 0xce323863), - TOBN(0x7541b5c9, 0xcd086976), TOBN(0x4ff069e2, 0xdc507ad1), - TOBN(0x74145256, 0x8776e667), TOBN(0x6e76142c, 0xb23c6bb5), - TOBN(0xdbf30712, 0x1b3a8a87), TOBN(0x60e7363e, 0x98450836), - TOBN(0x5741450e, 0xb7366d80), TOBN(0xe4ee14ca, 0x4837dbdf), - TOBN(0xa765eb9b, 0x69d4316f), TOBN(0x04548dca, 0x8ef43825), - TOBN(0x9c9f4e4c, 0x5ae888eb), TOBN(0x733abb51, 0x56e9ac99), - TOBN(0xdaad3c20, 0xba6ac029), TOBN(0x9b8dd3d3, 0x2ba3e38e), - TOBN(0xa9bb4c92, 0x0bc5d11a), TOBN(0xf20127a7, 0x9c5f88a3), - TOBN(0x4f52b06e, 0x161d3cb8), TOBN(0x26c1ff09, 0x6afaf0a6), - TOBN(0x32670d2f, 0x7189e71f), TOBN(0xc6438748, 0x5ecf91e7), - TOBN(0x15758e57, 0xdb757a21), TOBN(0x427d09f8, 0x290a9ce5), - TOBN(0x846a308f, 0x38384a7a), TOBN(0xaac3acb4, 0xb0732b99), - TOBN(0x9e941009, 0x17845819), TOBN(0x95cba111, 0xa7ce5e03), - TOBN(0x6f3d4f7f, 0xb00009c4), TOBN(0xb8396c27, 0x8ff28b5f), - TOBN(0xb1a9ae43, 0x1c97975d), TOBN(0x9d7ba8af, 0xe5d9fed5), - TOBN(0x338cf09f, 0x34f485b6), TOBN(0xbc0ddacc, 0x64122516), - TOBN(0xa450da12, 0x05d471fe), TOBN(0x4c3a6250, 0x628dd8c9), - TOBN(0x69c7d103, 0xd1295837), TOBN(0xa2893e50, 0x3807eb2f), - TOBN(0xd6e1e1de, 0xbdb41491), TOBN(0xc630745b, 0x5e138235), - TOBN(0xc892109e, 0x48661ae1), TOBN(0x8d17e7eb, 0xea2b2674), - TOBN(0x00ec0f87, 0xc328d6b5), TOBN(0x6d858645, 0xf079ff9e), - TOBN(0x6cdf243e, 0x19115ead), TOBN(0x1ce1393e, 0x4bac4fcf), - TOBN(0x2c960ed0, 0x9c29f25b), TOBN(0x59be4d8e, 0x9d388a05), - TOBN(0x0d46e06c, 0xd0def72b), TOBN(0xb923db5d, 0xe0342748), - TOBN(0xf7d3aacd, 0x936d4a3d), TOBN(0x558519cc, 0x0b0b099e), - TOBN(0x3ea8ebf8, 0x827097ef), TOBN(0x259353db, 0xd054f55d), - TOBN(0x84c89abc, 0x6d2ed089), TOBN(0x5c548b69, 0x8e096a7c), - TOBN(0xd587f616, 0x994b995d), TOBN(0x4d1531f6, 0xa5845601), - TOBN(0x792ab31e, 0x451fd9f0), TOBN(0xc8b57bb2, 0x65adf6ca), - TOBN(0x68440fcb, 0x1cd5ad73), TOBN(0xb9c860e6, 0x6144da4f), - TOBN(0x2ab286aa, 0x8462beb8), TOBN(0xcc6b8fff, 0xef46797f), - TOBN(0xac820da4, 0x20c8a471), TOBN(0x69ae05a1, 0x77ff7faf), - TOBN(0xb9163f39, 0xbfb5da77), TOBN(0xbd03e590, 0x2c73ab7a), - TOBN(0x7e862b5e, 0xb2940d9e), TOBN(0x3c663d86, 0x4b9af564), - TOBN(0xd8309031, 0xbde3033d), TOBN(0x298231b2, 0xd42c5bc6), - TOBN(0x42090d2c, 0x552ad093), TOBN(0xa4799d1c, 0xff854695), - TOBN(0x0a88b5d6, 0xd31f0d00), TOBN(0xf8b40825, 0xa2f26b46), - TOBN(0xec29b1ed, 0xf1bd7218), TOBN(0xd491c53b, 0x4b24c86e), - TOBN(0xd2fe588f, 0x3395ea65), TOBN(0x6f3764f7, 0x4456ef15), - TOBN(0xdb43116d, 0xcdc34800), TOBN(0xcdbcd456, 0xc1e33955), - TOBN(0xefdb5540, 0x74ab286b), TOBN(0x948c7a51, 0xd18c5d7c), - TOBN(0xeb81aa37, 0x7378058e), TOBN(0x41c746a1, 0x04411154), - TOBN(0xa10c73bc, 0xfb828ac7), TOBN(0x6439be91, 0x9d972b29), - TOBN(0x4bf3b4b0, 0x43a2fbad), TOBN(0x39e6dadf, 0x82b5e840), - TOBN(0x4f716408, 0x6397bd4c), TOBN(0x0f7de568, 0x7f1eeccb), - TOBN(0x5865c5a1, 0xd2ffbfc1), TOBN(0xf74211fa, 0x4ccb6451), - TOBN(0x66368a88, 0xc0b32558), TOBN(0x5b539dc2, 0x9ad7812e), - TOBN(0x579483d0, 0x2f3af6f6), TOBN(0x52132078, 0x99934ece), - TOBN(0x50b9650f, 0xdcc9e983), TOBN(0xca989ec9, 0xaee42b8a), - TOBN(0x6a44c829, 0xd6f62f99), TOBN(0x8f06a309, 0x4c2a7c0c), - TOBN(0x4ea2b3a0, 0x98a0cb0a), TOBN(0x5c547b70, 0xbeee8364), - TOBN(0x461d40e1, 0x682afe11), TOBN(0x9e0fc77a, 0x7b41c0a8), - TOBN(0x79e4aefd, 0xe20d5d36), TOBN(0x2916e520, 0x32dd9f63), - TOBN(0xf59e52e8, 0x3f883faf), TOBN(0x396f9639, 0x2b868d35), - TOBN(0xc902a9df, 0x4ca19881), TOBN(0x0fc96822, 0xdb2401a6), - TOBN(0x41237587, 0x66f1c68d), TOBN(0x10fc6de3, 0xfb476c0d), - TOBN(0xf8b6b579, 0x841f5d90), TOBN(0x2ba8446c, 0xfa24f44a), - TOBN(0xa237b920, 0xef4a9975), TOBN(0x60bb6004, 0x2330435f), - TOBN(0xd6f4ab5a, 0xcfb7e7b5), TOBN(0xb2ac5097, 0x83435391), - TOBN(0xf036ee2f, 0xb0d1ea67), TOBN(0xae779a6a, 0x74c56230), - TOBN(0x59bff8c8, 0xab838ae6), TOBN(0xcd83ca99, 0x9b38e6f0), - TOBN(0xbb27bef5, 0xe33deed3), TOBN(0xe6356f6f, 0x001892a8), - TOBN(0xbf3be6cc, 0x7adfbd3e), TOBN(0xaecbc81c, 0x33d1ac9d), - TOBN(0xe4feb909, 0xe6e861dc), TOBN(0x90a247a4, 0x53f5f801), - TOBN(0x01c50acb, 0x27346e57), TOBN(0xce29242e, 0x461acc1b), - TOBN(0x04dd214a, 0x2f998a91), TOBN(0x271ee9b1, 0xd4baf27b), - TOBN(0x7e3027d1, 0xe8c26722), TOBN(0x21d1645c, 0x1820dce5), - TOBN(0x086f242c, 0x7501779c), TOBN(0xf0061407, 0xfa0e8009), - TOBN(0xf23ce477, 0x60187129), TOBN(0x05bbdedb, 0x0fde9bd0), - TOBN(0x682f4832, 0x25d98473), TOBN(0xf207fe85, 0x5c658427), - TOBN(0xb6fdd7ba, 0x4166ffa1), TOBN(0x0c314056, 0x9eed799d), - TOBN(0x0db8048f, 0x4107e28f), TOBN(0x74ed3871, 0x41216840), - TOBN(0x74489f8f, 0x56a3c06e), TOBN(0x1e1c005b, 0x12777134), - TOBN(0xdb332a73, 0xf37ec3c3), TOBN(0xc65259bd, 0xdd59eba0), - TOBN(0x2291709c, 0xdb4d3257), TOBN(0x9a793b25, 0xbd389390), - TOBN(0xf39fe34b, 0xe43756f0), TOBN(0x2f76bdce, 0x9afb56c9), - TOBN(0x9f37867a, 0x61208b27), TOBN(0xea1d4307, 0x089972c3), - TOBN(0x8c595330, 0x8bdf623a), TOBN(0x5f5accda, 0x8441fb7d), - TOBN(0xfafa9418, 0x32ddfd95), TOBN(0x6ad40c5a, 0x0fde9be7), - TOBN(0x43faba89, 0xaeca8709), TOBN(0xc64a7cf1, 0x2c248a9d), - TOBN(0x16620252, 0x72637a76), TOBN(0xaee1c791, 0x22b8d1bb), - TOBN(0xf0f798fd, 0x21a843b2), TOBN(0x56e4ed4d, 0x8d005cb1), - TOBN(0x355f7780, 0x1f0d8abe), TOBN(0x197b04cf, 0x34522326), - TOBN(0x41f9b31f, 0xfd42c13f), TOBN(0x5ef7feb2, 0xb40f933d), - TOBN(0x27326f42, 0x5d60bad4), TOBN(0x027ecdb2, 0x8c92cf89), - TOBN(0x04aae4d1, 0x4e3352fe), TOBN(0x08414d2f, 0x73591b90), - TOBN(0x5ed6124e, 0xb7da7d60), TOBN(0xb985b931, 0x4d13d4ec), - TOBN(0xa592d3ab, 0x96bf36f9), TOBN(0x012dbed5, 0xbbdf51df), - TOBN(0xa57963c0, 0xdf6c177d), TOBN(0x010ec869, 0x87ca29cf), - TOBN(0xba1700f6, 0xbf926dff), TOBN(0x7c9fdbd1, 0xf4bf6bc2), - TOBN(0xdc18dc8f, 0x64da11f5), TOBN(0xa6074b7a, 0xd938ae75), - TOBN(0x14270066, 0xe84f44a4), TOBN(0x99998d38, 0xd27b954e), - TOBN(0xc1be8ab2, 0xb4f38e9a), TOBN(0x8bb55bbf, 0x15c01016), - TOBN(0xf73472b4, 0x0ea2ab30), TOBN(0xd365a340, 0xf73d68dd), - TOBN(0xc01a7168, 0x19c2e1eb), TOBN(0x32f49e37, 0x34061719), - TOBN(0xb73c57f1, 0x01d8b4d6), TOBN(0x03c8423c, 0x26b47700), - TOBN(0x321d0bc8, 0xa4d8826a), TOBN(0x6004213c, 0x4bc0e638), - TOBN(0xf78c64a1, 0xc1c06681), TOBN(0x16e0a16f, 0xef018e50), - TOBN(0x31cbdf91, 0xdb42b2b3), TOBN(0xf8f4ffce, 0xe0d36f58), - TOBN(0xcdcc71cd, 0x4cc5e3e0), TOBN(0xd55c7cfa, 0xa129e3e0), - TOBN(0xccdb6ba0, 0x0fb2cbf1), TOBN(0x6aba0005, 0xc4bce3cb), - TOBN(0x501cdb30, 0xd232cfc4), TOBN(0x9ddcf12e, 0xd58a3cef), - TOBN(0x02d2cf9c, 0x87e09149), TOBN(0xdc5d7ec7, 0x2c976257), - TOBN(0x6447986e, 0x0b50d7dd), TOBN(0x88fdbaf7, 0x807f112a), - TOBN(0x58c9822a, 0xb00ae9f6), TOBN(0x6abfb950, 0x6d3d27e0), - TOBN(0xd0a74487, 0x8a429f4f), TOBN(0x0649712b, 0xdb516609), - TOBN(0xb826ba57, 0xe769b5df), TOBN(0x82335df2, 0x1fc7aaf2), - TOBN(0x2389f067, 0x5c93d995), TOBN(0x59ac367a, 0x68677be6), - TOBN(0xa77985ff, 0x21d9951b), TOBN(0x038956fb, 0x85011cce), - TOBN(0x608e48cb, 0xbb734e37), TOBN(0xc08c0bf2, 0x2be5b26f), - TOBN(0x17bbdd3b, 0xf9b1a0d9), TOBN(0xeac7d898, 0x10483319), - TOBN(0xc95c4baf, 0xbc1a6dea), TOBN(0xfdd0e2bf, 0x172aafdb), - TOBN(0x40373cbc, 0x8235c41a), TOBN(0x14303f21, 0xfb6f41d5), - TOBN(0xba063621, 0x0408f237), TOBN(0xcad3b09a, 0xecd2d1ed), - TOBN(0x4667855a, 0x52abb6a2), TOBN(0xba9157dc, 0xaa8b417b), - TOBN(0xfe7f3507, 0x4f013efb), TOBN(0x1b112c4b, 0xaa38c4a2), - TOBN(0xa1406a60, 0x9ba64345), TOBN(0xe53cba33, 0x6993c80b), - TOBN(0x45466063, 0xded40d23), TOBN(0x3d5f1f4d, 0x54908e25), - TOBN(0x9ebefe62, 0x403c3c31), TOBN(0x274ea0b5, 0x0672a624), - TOBN(0xff818d99, 0x451d1b71), TOBN(0x80e82643, 0x8f79cf79), - TOBN(0xa165df13, 0x73ce37f5), TOBN(0xa744ef4f, 0xfe3a21fd), - TOBN(0x73f1e7f5, 0xcf551396), TOBN(0xc616898e, 0x868c676b), - TOBN(0x671c28c7, 0x8c442c36), TOBN(0xcfe5e558, 0x5e0a317d), - TOBN(0x1242d818, 0x7051f476), TOBN(0x56fad2a6, 0x14f03442), - TOBN(0x262068bc, 0x0a44d0f6), TOBN(0xdfa2cd6e, 0xce6edf4e), - TOBN(0x0f43813a, 0xd15d1517), TOBN(0x61214cb2, 0x377d44f5), - TOBN(0xd399aa29, 0xc639b35f), TOBN(0x42136d71, 0x54c51c19), - TOBN(0x9774711b, 0x08417221), TOBN(0x0a5546b3, 0x52545a57), - TOBN(0x80624c41, 0x1150582d), TOBN(0x9ec5c418, 0xfbc555bc), - TOBN(0x2c87dcad, 0x771849f1), TOBN(0xb0c932c5, 0x01d7bf6f), - TOBN(0x6aa5cd3e, 0x89116eb2), TOBN(0xd378c25a, 0x51ca7bd3), - TOBN(0xc612a0da, 0x9e6e3e31), TOBN(0x0417a54d, 0xb68ad5d0), - TOBN(0x00451e4a, 0x22c6edb8), TOBN(0x9fbfe019, 0xb42827ce), - TOBN(0x2fa92505, 0xba9384a2), TOBN(0x21b8596e, 0x64ad69c1), - TOBN(0x8f4fcc49, 0x983b35a6), TOBN(0xde093760, 0x72754672), - TOBN(0x2f14ccc8, 0xf7bffe6d), TOBN(0x27566bff, 0x5d94263d), - TOBN(0xb5b4e9c6, 0x2df3ec30), TOBN(0x94f1d7d5, 0x3e6ea6ba), - TOBN(0x97b7851a, 0xaaca5e9b), TOBN(0x518aa521, 0x56713b97), - TOBN(0x3357e8c7, 0x150a61f6), TOBN(0x7842e7e2, 0xec2c2b69), - TOBN(0x8dffaf65, 0x6868a548), TOBN(0xd963bd82, 0xe068fc81), - TOBN(0x64da5c8b, 0x65917733), TOBN(0x927090ff, 0x7b247328)}, - {TOBN(0x214bc9a7, 0xd298c241), TOBN(0xe3b697ba, 0x56807cfd), - TOBN(0xef1c7802, 0x4564eadb), TOBN(0xdde8cdcf, 0xb48149c5), - TOBN(0x946bf0a7, 0x5a4d2604), TOBN(0x27154d7f, 0x6c1538af), - TOBN(0x95cc9230, 0xde5b1fcc), TOBN(0xd88519e9, 0x66864f82), - TOBN(0xb828dd1a, 0x7cb1282c), TOBN(0xa08d7626, 0xbe46973a), - TOBN(0x6baf8d40, 0xe708d6b2), TOBN(0x72571fa1, 0x4daeb3f3), - TOBN(0x85b1732f, 0xf22dfd98), TOBN(0x87ab01a7, 0x0087108d), - TOBN(0xaaaafea8, 0x5988207a), TOBN(0xccc832f8, 0x69f00755), - TOBN(0x964d950e, 0x36ff3bf0), TOBN(0x8ad20f6f, 0xf0b34638), - TOBN(0x4d9177b3, 0xb5d7585f), TOBN(0xcf839760, 0xef3f019f), - TOBN(0x582fc5b3, 0x8288c545), TOBN(0x2f8e4e9b, 0x13116bd1), - TOBN(0xf91e1b2f, 0x332120ef), TOBN(0xcf568724, 0x2a17dd23), - TOBN(0x488f1185, 0xca8d9d1a), TOBN(0xadf2c77d, 0xd987ded2), - TOBN(0x5f3039f0, 0x60c46124), TOBN(0xe5d70b75, 0x71e095f4), - TOBN(0x82d58650, 0x6260e70f), TOBN(0x39d75ea7, 0xf750d105), - TOBN(0x8cf3d0b1, 0x75bac364), TOBN(0xf3a7564d, 0x21d01329), - TOBN(0x182f04cd, 0x2f52d2a7), TOBN(0x4fde149a, 0xe2df565a), - TOBN(0xb80c5eec, 0xa79fb2f7), TOBN(0xab491d7b, 0x22ddc897), - TOBN(0x99d76c18, 0xc6312c7f), TOBN(0xca0d5f3d, 0x6aa41a57), - TOBN(0x71207325, 0xd15363a0), TOBN(0xe82aa265, 0xbeb252c2), - TOBN(0x94ab4700, 0xec3128c2), TOBN(0x6c76d862, 0x8e383f49), - TOBN(0xdc36b150, 0xc03024eb), TOBN(0xfb439477, 0x53daac69), - TOBN(0xfc68764a, 0x8dc79623), TOBN(0x5b86995d, 0xb440fbb2), - TOBN(0xd66879bf, 0xccc5ee0d), TOBN(0x05228942, 0x95aa8bd3), - TOBN(0xb51a40a5, 0x1e6a75c1), TOBN(0x24327c76, 0x0ea7d817), - TOBN(0x06630182, 0x07774597), TOBN(0xd6fdbec3, 0x97fa7164), - TOBN(0x20c99dfb, 0x13c90f48), TOBN(0xd6ac5273, 0x686ef263), - TOBN(0xc6a50bdc, 0xfef64eeb), TOBN(0xcd87b281, 0x86fdfc32), - TOBN(0xb24aa43e, 0x3fcd3efc), TOBN(0xdd26c034, 0xb8088e9a), - TOBN(0xa5ef4dc9, 0xbd3d46ea), TOBN(0xa2f99d58, 0x8a4c6a6f), - TOBN(0xddabd355, 0x2f1da46c), TOBN(0x72c3f8ce, 0x1afacdd1), - TOBN(0xd90c4eee, 0x92d40578), TOBN(0xd28bb41f, 0xca623b94), - TOBN(0x50fc0711, 0x745edc11), TOBN(0x9dd9ad7d, 0x3dc87558), - TOBN(0xce6931fb, 0xb49d1e64), TOBN(0x6c77a0a2, 0xc98bd0f9), - TOBN(0x62b9a629, 0x6baf7cb1), TOBN(0xcf065f91, 0xccf72d22), - TOBN(0x7203cce9, 0x79639071), TOBN(0x09ae4885, 0xf9cb732f), - TOBN(0x5e7c3bec, 0xee8314f3), TOBN(0x1c068aed, 0xdbea298f), - TOBN(0x08d381f1, 0x7c80acec), TOBN(0x03b56be8, 0xe330495b), - TOBN(0xaeffb8f2, 0x9222882d), TOBN(0x95ff38f6, 0xc4af8bf7), - TOBN(0x50e32d35, 0x1fc57d8c), TOBN(0x6635be52, 0x17b444f0), - TOBN(0x04d15276, 0xa5177900), TOBN(0x4e1dbb47, 0xf6858752), - TOBN(0x5b475622, 0xc615796c), TOBN(0xa6fa0387, 0x691867bf), - TOBN(0xed7f5d56, 0x2844c6d0), TOBN(0xc633cf9b, 0x03a2477d), - TOBN(0xf6be5c40, 0x2d3721d6), TOBN(0xaf312eb7, 0xe9fd68e6), - TOBN(0x242792d2, 0xe7417ce1), TOBN(0xff42bc71, 0x970ee7f5), - TOBN(0x1ff4dc6d, 0x5c67a41e), TOBN(0x77709b7b, 0x20882a58), - TOBN(0x3554731d, 0xbe217f2c), TOBN(0x2af2a8cd, 0x5bb72177), - TOBN(0x58eee769, 0x591dd059), TOBN(0xbb2930c9, 0x4bba6477), - TOBN(0x863ee047, 0x7d930cfc), TOBN(0x4c262ad1, 0x396fd1f4), - TOBN(0xf4765bc8, 0x039af7e1), TOBN(0x2519834b, 0x5ba104f6), - TOBN(0x7cd61b4c, 0xd105f961), TOBN(0xa5415da5, 0xd63bca54), - TOBN(0x778280a0, 0x88a1f17c), TOBN(0xc4968949, 0x2329512c), - TOBN(0x174a9126, 0xcecdaa7a), TOBN(0xfc8c7e0e, 0x0b13247b), - TOBN(0x29c110d2, 0x3484c1c4), TOBN(0xf8eb8757, 0x831dfc3b), - TOBN(0x022f0212, 0xc0067452), TOBN(0x3f6f69ee, 0x7b9b926c), - TOBN(0x09032da0, 0xef42daf4), TOBN(0x79f00ade, 0x83f80de4), - TOBN(0x6210db71, 0x81236c97), TOBN(0x74f7685b, 0x3ee0781f), - TOBN(0x4df7da7b, 0xa3e41372), TOBN(0x2aae38b1, 0xb1a1553e), - TOBN(0x1688e222, 0xf6dd9d1b), TOBN(0x57695448, 0x5b8b6487), - TOBN(0x478d2127, 0x4b2edeaa), TOBN(0xb2818fa5, 0x1e85956a), - TOBN(0x1e6addda, 0xf176f2c0), TOBN(0x01ca4604, 0xe2572658), - TOBN(0x0a404ded, 0x85342ffb), TOBN(0x8cf60f96, 0x441838d6), - TOBN(0x9bbc691c, 0xc9071c4a), TOBN(0xfd588744, 0x34442803), - TOBN(0x97101c85, 0x809c0d81), TOBN(0xa7fb754c, 0x8c456f7f), - TOBN(0xc95f3c5c, 0xd51805e1), TOBN(0xab4ccd39, 0xb299dca8), - TOBN(0x3e03d20b, 0x47eaf500), TOBN(0xfa3165c1, 0xd7b80893), - TOBN(0x005e8b54, 0xe160e552), TOBN(0xdc4972ba, 0x9019d11f), - TOBN(0x21a6972e, 0x0c9a4a7a), TOBN(0xa52c258f, 0x37840fd7), - TOBN(0xf8559ff4, 0xc1e99d81), TOBN(0x08e1a7d6, 0xa3c617c0), - TOBN(0xb398fd43, 0x248c6ba7), TOBN(0x6ffedd91, 0xd1283794), - TOBN(0x8a6a59d2, 0xd629d208), TOBN(0xa9d141d5, 0x3490530e), - TOBN(0x42f6fc18, 0x38505989), TOBN(0x09bf250d, 0x479d94ee), - TOBN(0x223ad3b1, 0xb3822790), TOBN(0x6c5926c0, 0x93b8971c), - TOBN(0x609efc7e, 0x75f7fa62), TOBN(0x45d66a6d, 0x1ec2d989), - TOBN(0x4422d663, 0x987d2792), TOBN(0x4a73caad, 0x3eb31d2b), - TOBN(0xf06c2ac1, 0xa32cb9e6), TOBN(0xd9445c5f, 0x91aeba84), - TOBN(0x6af7a1d5, 0xaf71013f), TOBN(0xe68216e5, 0x0bedc946), - TOBN(0xf4cba30b, 0xd27370a0), TOBN(0x7981afbf, 0x870421cc), - TOBN(0x02496a67, 0x9449f0e1), TOBN(0x86cfc4be, 0x0a47edae), - TOBN(0x3073c936, 0xb1feca22), TOBN(0xf5694612, 0x03f8f8fb), - TOBN(0xd063b723, 0x901515ea), TOBN(0x4c6c77a5, 0x749cf038), - TOBN(0x6361e360, 0xab9e5059), TOBN(0x596cf171, 0xa76a37c0), - TOBN(0x800f53fa, 0x6530ae7a), TOBN(0x0f5e631e, 0x0792a7a6), - TOBN(0x5cc29c24, 0xefdb81c9), TOBN(0xa269e868, 0x3f9c40ba), - TOBN(0xec14f9e1, 0x2cb7191e), TOBN(0x78ea1bd8, 0xe5b08ea6), - TOBN(0x3c65aa9b, 0x46332bb9), TOBN(0x84cc22b3, 0xbf80ce25), - TOBN(0x0098e9e9, 0xd49d5bf1), TOBN(0xcd4ec1c6, 0x19087da4), - TOBN(0x3c9d07c5, 0xaef6e357), TOBN(0x839a0268, 0x9f8f64b8), - TOBN(0xc5e9eb62, 0xc6d8607f), TOBN(0x759689f5, 0x6aa995e4), - TOBN(0x70464669, 0xbbb48317), TOBN(0x921474bf, 0xe402417d), - TOBN(0xcabe135b, 0x2a354c8c), TOBN(0xd51e52d2, 0x812fa4b5), - TOBN(0xec741096, 0x53311fe8), TOBN(0x4f774535, 0xb864514b), - TOBN(0xbcadd671, 0x5bde48f8), TOBN(0xc9703873, 0x2189bc7d), - TOBN(0x5d45299e, 0xc709ee8a), TOBN(0xd1287ee2, 0x845aaff8), - TOBN(0x7d1f8874, 0xdb1dbf1f), TOBN(0xea46588b, 0x990c88d6), - TOBN(0x60ba649a, 0x84368313), TOBN(0xd5fdcbce, 0x60d543ae), - TOBN(0x90b46d43, 0x810d5ab0), TOBN(0x6739d8f9, 0x04d7e5cc), - TOBN(0x021c1a58, 0x0d337c33), TOBN(0x00a61162, 0x68e67c40), - TOBN(0x95ef413b, 0x379f0a1f), TOBN(0xfe126605, 0xe9e2ab95), - TOBN(0x67578b85, 0x2f5f199c), TOBN(0xf5c00329, 0x2cb84913), - TOBN(0xf7956430, 0x37577dd8), TOBN(0x83b82af4, 0x29c5fe88), - TOBN(0x9c1bea26, 0xcdbdc132), TOBN(0x589fa086, 0x9c04339e), - TOBN(0x033e9538, 0xb13799df), TOBN(0x85fa8b21, 0xd295d034), - TOBN(0xdf17f73f, 0xbd9ddcca), TOBN(0xf32bd122, 0xddb66334), - TOBN(0x55ef88a7, 0x858b044c), TOBN(0x1f0d69c2, 0x5aa9e397), - TOBN(0x55fd9cc3, 0x40d85559), TOBN(0xc774df72, 0x7785ddb2), - TOBN(0x5dcce9f6, 0xd3bd2e1c), TOBN(0xeb30da20, 0xa85dfed0), - TOBN(0x5ed7f5bb, 0xd3ed09c4), TOBN(0x7d42a35c, 0x82a9c1bd), - TOBN(0xcf3de995, 0x9890272d), TOBN(0x75f3432a, 0x3e713a10), - TOBN(0x5e13479f, 0xe28227b8), TOBN(0xb8561ea9, 0xfefacdc8), - TOBN(0xa6a297a0, 0x8332aafd), TOBN(0x9b0d8bb5, 0x73809b62), - TOBN(0xd2fa1cfd, 0x0c63036f), TOBN(0x7a16eb55, 0xbd64bda8), - TOBN(0x3f5cf5f6, 0x78e62ddc), TOBN(0x2267c454, 0x07fd752b), - TOBN(0x5e361b6b, 0x5e437bbe), TOBN(0x95c59501, 0x8354e075), - TOBN(0xec725f85, 0xf2b254d9), TOBN(0x844b617d, 0x2cb52b4e), - TOBN(0xed8554f5, 0xcf425fb5), TOBN(0xab67703e, 0x2af9f312), - TOBN(0x4cc34ec1, 0x3cf48283), TOBN(0xb09daa25, 0x9c8a705e), - TOBN(0xd1e9d0d0, 0x5b7d4f84), TOBN(0x4df6ef64, 0xdb38929d), - TOBN(0xe16b0763, 0xaa21ba46), TOBN(0xc6b1d178, 0xa293f8fb), - TOBN(0x0ff5b602, 0xd520aabf), TOBN(0x94d671bd, 0xc339397a), - TOBN(0x7c7d98cf, 0x4f5792fa), TOBN(0x7c5e0d67, 0x11215261), - TOBN(0x9b19a631, 0xa7c5a6d4), TOBN(0xc8511a62, 0x7a45274d), - TOBN(0x0c16621c, 0xa5a60d99), TOBN(0xf7fbab88, 0xcf5e48cb), - TOBN(0xab1e6ca2, 0xf7ddee08), TOBN(0x83bd08ce, 0xe7867f3c), - TOBN(0xf7e48e8a, 0x2ac13e27), TOBN(0x4494f6df, 0x4eb1a9f5), - TOBN(0xedbf84eb, 0x981f0a62), TOBN(0x49badc32, 0x536438f0), - TOBN(0x50bea541, 0x004f7571), TOBN(0xbac67d10, 0xdf1c94ee), - TOBN(0x253d73a1, 0xb727bc31), TOBN(0xb3d01cf2, 0x30686e28), - TOBN(0x51b77b1b, 0x55fd0b8b), TOBN(0xa099d183, 0xfeec3173), - TOBN(0x202b1fb7, 0x670e72b7), TOBN(0xadc88b33, 0xa8e1635f), - TOBN(0x34e8216a, 0xf989d905), TOBN(0xc2e68d20, 0x29b58d01), - TOBN(0x11f81c92, 0x6fe55a93), TOBN(0x15f1462a, 0x8f296f40), - TOBN(0x1915d375, 0xea3d62f2), TOBN(0xa17765a3, 0x01c8977d), - TOBN(0x7559710a, 0xe47b26f6), TOBN(0xe0bd29c8, 0x535077a5), - TOBN(0x615f976d, 0x08d84858), TOBN(0x370dfe85, 0x69ced5c1), - TOBN(0xbbc7503c, 0xa734fa56), TOBN(0xfbb9f1ec, 0x91ac4574), - TOBN(0x95d7ec53, 0x060dd7ef), TOBN(0xeef2dacd, 0x6e657979), - TOBN(0x54511af3, 0xe2a08235), TOBN(0x1e324aa4, 0x1f4aea3d), - TOBN(0x550e7e71, 0xe6e67671), TOBN(0xbccd5190, 0xbf52faf7), - TOBN(0xf880d316, 0x223cc62a), TOBN(0x0d402c7e, 0x2b32eb5d), - TOBN(0xa40bc039, 0x306a5a3b), TOBN(0x4e0a41fd, 0x96783a1b), - TOBN(0xa1e8d39a, 0x0253cdd4), TOBN(0x6480be26, 0xc7388638), - TOBN(0xee365e1d, 0x2285f382), TOBN(0x188d8d8f, 0xec0b5c36), - TOBN(0x34ef1a48, 0x1f0f4d82), TOBN(0x1a8f43e1, 0xa487d29a), - TOBN(0x8168226d, 0x77aefb3a), TOBN(0xf69a751e, 0x1e72c253), - TOBN(0x8e04359a, 0xe9594df1), TOBN(0x475ffd7d, 0xd14c0467), - TOBN(0xb5a2c2b1, 0x3844e95c), TOBN(0x85caf647, 0xdd12ef94), - TOBN(0x1ecd2a9f, 0xf1063d00), TOBN(0x1dd2e229, 0x23843311), - TOBN(0x38f0e09d, 0x73d17244), TOBN(0x3ede7746, 0x8fc653f1), - TOBN(0xae4459f5, 0xdc20e21c), TOBN(0x00db2ffa, 0x6a8599ea), - TOBN(0x11682c39, 0x30cfd905), TOBN(0x4934d074, 0xa5c112a6), - TOBN(0xbdf063c5, 0x568bfe95), TOBN(0x779a440a, 0x016c441a), - TOBN(0x0c23f218, 0x97d6fbdc), TOBN(0xd3a5cd87, 0xe0776aac), - TOBN(0xcee37f72, 0xd712e8db), TOBN(0xfb28c70d, 0x26f74e8d), - TOBN(0xffe0c728, 0xb61301a0), TOBN(0xa6282168, 0xd3724354), - TOBN(0x7ff4cb00, 0x768ffedc), TOBN(0xc51b3088, 0x03b02de9), - TOBN(0xa5a8147c, 0x3902dda5), TOBN(0x35d2f706, 0xfe6973b4), - TOBN(0x5ac2efcf, 0xc257457e), TOBN(0x933f48d4, 0x8700611b), - TOBN(0xc365af88, 0x4912beb2), TOBN(0x7f5a4de6, 0x162edf94), - TOBN(0xc646ba7c, 0x0c32f34b), TOBN(0x632c6af3, 0xb2091074), - TOBN(0x58d4f2e3, 0x753e43a9), TOBN(0x70e1d217, 0x24d4e23f), - TOBN(0xb24bf729, 0xafede6a6), TOBN(0x7f4a94d8, 0x710c8b60), - TOBN(0xaad90a96, 0x8d4faa6a), TOBN(0xd9ed0b32, 0xb066b690), - TOBN(0x52fcd37b, 0x78b6dbfd), TOBN(0x0b64615e, 0x8bd2b431), - TOBN(0x228e2048, 0xcfb9fad5), TOBN(0xbeaa386d, 0x240b76bd), - TOBN(0x2d6681c8, 0x90dad7bc), TOBN(0x3e553fc3, 0x06d38f5e), - TOBN(0xf27cdb9b, 0x9d5f9750), TOBN(0x3e85c52a, 0xd28c5b0e), - TOBN(0x190795af, 0x5247c39b), TOBN(0x547831eb, 0xbddd6828), - TOBN(0xf327a227, 0x4a82f424), TOBN(0x36919c78, 0x7e47f89d), - TOBN(0xe4783919, 0x43c7392c), TOBN(0xf101b9aa, 0x2316fefe), - TOBN(0xbcdc9e9c, 0x1c5009d2), TOBN(0xfb55ea13, 0x9cd18345), - TOBN(0xf5b5e231, 0xa3ce77c7), TOBN(0xde6b4527, 0xd2f2cb3d), - TOBN(0x10f6a333, 0x9bb26f5f), TOBN(0x1e85db8e, 0x044d85b6), - TOBN(0xc3697a08, 0x94197e54), TOBN(0x65e18cc0, 0xa7cb4ea8), - TOBN(0xa38c4f50, 0xa471fe6e), TOBN(0xf031747a, 0x2f13439c), - TOBN(0x53c4a6ba, 0xc007318b), TOBN(0xa8da3ee5, 0x1deccb3d), - TOBN(0x0555b31c, 0x558216b1), TOBN(0x90c7810c, 0x2f79e6c2), - TOBN(0x9b669f4d, 0xfe8eed3c), TOBN(0x70398ec8, 0xe0fac126), - TOBN(0xa96a449e, 0xf701b235), TOBN(0x0ceecdb3, 0xeb94f395), - TOBN(0x285fc368, 0xd0cb7431), TOBN(0x0d37bb52, 0x16a18c64), - TOBN(0x05110d38, 0xb880d2dd), TOBN(0xa60f177b, 0x65930d57), - TOBN(0x7da34a67, 0xf36235f5), TOBN(0x47f5e17c, 0x183816b9), - TOBN(0xc7664b57, 0xdb394af4), TOBN(0x39ba215d, 0x7036f789), - TOBN(0x46d2ca0e, 0x2f27b472), TOBN(0xc42647ee, 0xf73a84b7), - TOBN(0x44bc7545, 0x64488f1d), TOBN(0xaa922708, 0xf4cf85d5), - TOBN(0x721a01d5, 0x53e4df63), TOBN(0x649c0c51, 0x5db46ced), - TOBN(0x6bf0d64e, 0x3cffcb6c), TOBN(0xe3bf93fe, 0x50f71d96), - TOBN(0x75044558, 0xbcc194a0), TOBN(0x16ae3372, 0x6afdc554), - TOBN(0xbfc01adf, 0x5ca48f3f), TOBN(0x64352f06, 0xe22a9b84), - TOBN(0xcee54da1, 0xc1099e4a), TOBN(0xbbda54e8, 0xfa1b89c0), - TOBN(0x166a3df5, 0x6f6e55fb), TOBN(0x1ca44a24, 0x20176f88), - TOBN(0x936afd88, 0xdfb7b5ff), TOBN(0xe34c2437, 0x8611d4a0), - TOBN(0x7effbb75, 0x86142103), TOBN(0x6704ba1b, 0x1f34fc4d), - TOBN(0x7c2a468f, 0x10c1b122), TOBN(0x36b3a610, 0x8c6aace9), - TOBN(0xabfcc0a7, 0x75a0d050), TOBN(0x066f9197, 0x3ce33e32), - TOBN(0xce905ef4, 0x29fe09be), TOBN(0x89ee25ba, 0xa8376351), - TOBN(0x2a3ede22, 0xfd29dc76), TOBN(0x7fd32ed9, 0x36f17260), - TOBN(0x0cadcf68, 0x284b4126), TOBN(0x63422f08, 0xa7951fc8), - TOBN(0x562b24f4, 0x0807e199), TOBN(0xfe9ce5d1, 0x22ad4490), - TOBN(0xc2f51b10, 0x0db2b1b4), TOBN(0xeb3613ff, 0xe4541d0d), - TOBN(0xbd2c4a05, 0x2680813b), TOBN(0x527aa55d, 0x561b08d6), - TOBN(0xa9f8a40e, 0xa7205558), TOBN(0xe3eea56f, 0x243d0bec), - TOBN(0x7b853817, 0xa0ff58b3), TOBN(0xb67d3f65, 0x1a69e627), - TOBN(0x0b76bbb9, 0xa869b5d6), TOBN(0xa3afeb82, 0x546723ed), - TOBN(0x5f24416d, 0x3e554892), TOBN(0x8413b53d, 0x430e2a45), - TOBN(0x99c56aee, 0x9032a2a0), TOBN(0x09432bf6, 0xeec367b1), - TOBN(0x552850c6, 0xdaf0ecc1), TOBN(0x49ebce55, 0x5bc92048), - TOBN(0xdfb66ba6, 0x54811307), TOBN(0x1b84f797, 0x6f298597), - TOBN(0x79590481, 0x8d1d7a0d), TOBN(0xd9fabe03, 0x3a6fa556), - TOBN(0xa40f9c59, 0xba9e5d35), TOBN(0xcb1771c1, 0xf6247577), - TOBN(0x542a47ca, 0xe9a6312b), TOBN(0xa34b3560, 0x552dd8c5), - TOBN(0xfdf94de0, 0x0d794716), TOBN(0xd46124a9, 0x9c623094), - TOBN(0x56b7435d, 0x68afe8b4), TOBN(0x27f20540, 0x6c0d8ea1), - TOBN(0x12b77e14, 0x73186898), TOBN(0xdbc3dd46, 0x7479490f), - TOBN(0x951a9842, 0xc03b0c05), TOBN(0x8b1b3bb3, 0x7921bc96), - TOBN(0xa573b346, 0x2b202e0a), TOBN(0x77e4665d, 0x47254d56), - TOBN(0x08b70dfc, 0xd23e3984), TOBN(0xab86e8bc, 0xebd14236), - TOBN(0xaa3e07f8, 0x57114ba7), TOBN(0x5ac71689, 0xab0ef4f2), - TOBN(0x88fca384, 0x0139d9af), TOBN(0x72733f88, 0x76644af0), - TOBN(0xf122f72a, 0x65d74f4a), TOBN(0x13931577, 0xa5626c7a), - TOBN(0xd5b5d9eb, 0x70f8d5a4), TOBN(0x375adde7, 0xd7bbb228), - TOBN(0x31e88b86, 0x0c1c0b32), TOBN(0xd1f568c4, 0x173edbaa), - TOBN(0x1592fc83, 0x5459df02), TOBN(0x2beac0fb, 0x0fcd9a7e), - TOBN(0xb0a6fdb8, 0x1b473b0a), TOBN(0xe3224c6f, 0x0fe8fc48), - TOBN(0x680bd00e, 0xe87edf5b), TOBN(0x30385f02, 0x20e77cf5), - TOBN(0xe9ab98c0, 0x4d42d1b2), TOBN(0x72d191d2, 0xd3816d77), - TOBN(0x1564daca, 0x0917d9e5), TOBN(0x394eab59, 0x1f8fed7f), - TOBN(0xa209aa8d, 0x7fbb3896), TOBN(0x5564f3b9, 0xbe6ac98e), - TOBN(0xead21d05, 0xd73654ef), TOBN(0x68d1a9c4, 0x13d78d74), - TOBN(0x61e01708, 0x6d4973a0), TOBN(0x83da3500, 0x46e6d32a), - TOBN(0x6a3dfca4, 0x68ae0118), TOBN(0xa1b9a4c9, 0xd02da069), - TOBN(0x0b2ff9c7, 0xebab8302), TOBN(0x98af07c3, 0x944ba436), - TOBN(0x85997326, 0x995f0f9f), TOBN(0x467fade0, 0x71b58bc6), - TOBN(0x47e4495a, 0xbd625a2b), TOBN(0xfdd2d01d, 0x33c3b8cd), - TOBN(0x2c38ae28, 0xc693f9fa), TOBN(0x48622329, 0x348f7999), - TOBN(0x97bf738e, 0x2161f583), TOBN(0x15ee2fa7, 0x565e8cc9), - TOBN(0xa1a5c845, 0x5777e189), TOBN(0xcc10bee0, 0x456f2829), - TOBN(0x8ad95c56, 0xda762bd5), TOBN(0x152e2214, 0xe9d91da8), - TOBN(0x975b0e72, 0x7cb23c74), TOBN(0xfd5d7670, 0xa90c66df), - TOBN(0xb5b5b8ad, 0x225ffc53), TOBN(0xab6dff73, 0xfaded2ae), - TOBN(0xebd56781, 0x6f4cbe9d), TOBN(0x0ed8b249, 0x6a574bd7), - TOBN(0x41c246fe, 0x81a881fa), TOBN(0x91564805, 0xc3db9c70), - TOBN(0xd7c12b08, 0x5b862809), TOBN(0x1facd1f1, 0x55858d7b), - TOBN(0x7693747c, 0xaf09e92a), TOBN(0x3b69dcba, 0x189a425f), - TOBN(0x0be28e9f, 0x967365ef), TOBN(0x57300eb2, 0xe801f5c9), - TOBN(0x93b8ac6a, 0xd583352f), TOBN(0xa2cf1f89, 0xcd05b2b7), - TOBN(0x7c0c9b74, 0x4dcc40cc), TOBN(0xfee38c45, 0xada523fb), - TOBN(0xb49a4dec, 0x1099cc4d), TOBN(0x325c377f, 0x69f069c6), - TOBN(0xe12458ce, 0x476cc9ff), TOBN(0x580e0b6c, 0xc6d4cb63), - TOBN(0xd561c8b7, 0x9072289b), TOBN(0x0377f264, 0xa619e6da), - TOBN(0x26685362, 0x88e591a5), TOBN(0xa453a7bd, 0x7523ca2b), - TOBN(0x8a9536d2, 0xc1df4533), TOBN(0xc8e50f2f, 0xbe972f79), - TOBN(0xd433e50f, 0x6d3549cf), TOBN(0x6f33696f, 0xfacd665e), - TOBN(0x695bfdac, 0xce11fcb4), TOBN(0x810ee252, 0xaf7c9860), - TOBN(0x65450fe1, 0x7159bb2c), TOBN(0xf7dfbebe, 0x758b357b), - TOBN(0x2b057e74, 0xd69fea72), TOBN(0xd485717a, 0x92731745)}, - {TOBN(0x896c42e8, 0xee36860c), TOBN(0xdaf04dfd, 0x4113c22d), - TOBN(0x1adbb7b7, 0x44104213), TOBN(0xe5fd5fa1, 0x1fd394ea), - TOBN(0x68235d94, 0x1a4e0551), TOBN(0x6772cfbe, 0x18d10151), - TOBN(0x276071e3, 0x09984523), TOBN(0xe4e879de, 0x5a56ba98), - TOBN(0xaaafafb0, 0x285b9491), TOBN(0x01a0be88, 0x1e4c705e), - TOBN(0xff1d4f5d, 0x2ad9caab), TOBN(0x6e349a4a, 0xc37a233f), - TOBN(0xcf1c1246, 0x4a1c6a16), TOBN(0xd99e6b66, 0x29383260), - TOBN(0xea3d4366, 0x5f6d5471), TOBN(0x36974d04, 0xff8cc89b), - TOBN(0xc26c49a1, 0xcfe89d80), TOBN(0xb42c026d, 0xda9c8371), - TOBN(0xca6c013a, 0xdad066d2), TOBN(0xfb8f7228, 0x56a4f3ee), - TOBN(0x08b579ec, 0xd850935b), TOBN(0x34c1a74c, 0xd631e1b3), - TOBN(0xcb5fe596, 0xac198534), TOBN(0x39ff21f6, 0xe1f24f25), - TOBN(0x27f29e14, 0x8f929057), TOBN(0x7a64ae06, 0xc0c853df), - TOBN(0x256cd183, 0x58e9c5ce), TOBN(0x9d9cce82, 0xded092a5), - TOBN(0xcc6e5979, 0x6e93b7c7), TOBN(0xe1e47092, 0x31bb9e27), - TOBN(0xb70b3083, 0xaa9e29a0), TOBN(0xbf181a75, 0x3785e644), - TOBN(0xf53f2c65, 0x8ead09f7), TOBN(0x1335e1d5, 0x9780d14d), - TOBN(0x69cc20e0, 0xcd1b66bc), TOBN(0x9b670a37, 0xbbe0bfc8), - TOBN(0xce53dc81, 0x28efbeed), TOBN(0x0c74e77c, 0x8326a6e5), - TOBN(0x3604e0d2, 0xb88e9a63), TOBN(0xbab38fca, 0x13dc2248), - TOBN(0x8ed6e8c8, 0x5c0a3f1e), TOBN(0xbcad2492, 0x7c87c37f), - TOBN(0xfdfb62bb, 0x9ee3b78d), TOBN(0xeba8e477, 0xcbceba46), - TOBN(0x37d38cb0, 0xeeaede4b), TOBN(0x0bc498e8, 0x7976deb6), - TOBN(0xb2944c04, 0x6b6147fb), TOBN(0x8b123f35, 0xf71f9609), - TOBN(0xa155dcc7, 0xde79dc24), TOBN(0xf1168a32, 0x558f69cd), - TOBN(0xbac21595, 0x0d1850df), TOBN(0x15c8295b, 0xb204c848), - TOBN(0xf661aa36, 0x7d8184ff), TOBN(0xc396228e, 0x30447bdb), - TOBN(0x11cd5143, 0xbde4a59e), TOBN(0xe3a26e3b, 0x6beab5e6), - TOBN(0xd3b3a13f, 0x1402b9d0), TOBN(0x573441c3, 0x2c7bc863), - TOBN(0x4b301ec4, 0x578c3e6e), TOBN(0xc26fc9c4, 0x0adaf57e), - TOBN(0x96e71bfd, 0x7493cea3), TOBN(0xd05d4b3f, 0x1af81456), - TOBN(0xdaca2a8a, 0x6a8c608f), TOBN(0x53ef07f6, 0x0725b276), - TOBN(0x07a5fbd2, 0x7824fc56), TOBN(0x34675218, 0x13289077), - TOBN(0x5bf69fd5, 0xe0c48349), TOBN(0xa613ddd3, 0xb6aa7875), - TOBN(0x7f78c19c, 0x5450d866), TOBN(0x46f4409c, 0x8f84a481), - TOBN(0x9f1d1928, 0x90fce239), TOBN(0x016c4168, 0xb2ce44b9), - TOBN(0xbae023f0, 0xc7435978), TOBN(0xb152c888, 0x20e30e19), - TOBN(0x9c241645, 0xe3fa6faf), TOBN(0x735d95c1, 0x84823e60), - TOBN(0x03197573, 0x03955317), TOBN(0x0b4b02a9, 0xf03b4995), - TOBN(0x076bf559, 0x70274600), TOBN(0x32c5cc53, 0xaaf57508), - TOBN(0xe8af6d1f, 0x60624129), TOBN(0xb7bc5d64, 0x9a5e2b5e), - TOBN(0x3814b048, 0x5f082d72), TOBN(0x76f267f2, 0xce19677a), - TOBN(0x626c630f, 0xb36eed93), TOBN(0x55230cd7, 0x3bf56803), - TOBN(0x78837949, 0xce2736a0), TOBN(0x0d792d60, 0xaa6c55f1), - TOBN(0x0318dbfd, 0xd5c7c5d2), TOBN(0xb38f8da7, 0x072b342d), - TOBN(0x3569bddc, 0x7b8de38a), TOBN(0xf25b5887, 0xa1c94842), - TOBN(0xb2d5b284, 0x2946ad60), TOBN(0x854f29ad, 0xe9d1707e), - TOBN(0xaa5159dc, 0x2c6a4509), TOBN(0x899f94c0, 0x57189837), - TOBN(0xcf6adc51, 0xf4a55b03), TOBN(0x261762de, 0x35e3b2d5), - TOBN(0x4cc43012, 0x04827b51), TOBN(0xcd22a113, 0xc6021442), - TOBN(0xce2fd61a, 0x247c9569), TOBN(0x59a50973, 0xd152beca), - TOBN(0x6c835a11, 0x63a716d4), TOBN(0xc26455ed, 0x187dedcf), - TOBN(0x27f536e0, 0x49ce89e7), TOBN(0x18908539, 0xcc890cb5), - TOBN(0x308909ab, 0xd83c2aa1), TOBN(0xecd3142b, 0x1ab73bd3), - TOBN(0x6a85bf59, 0xb3f5ab84), TOBN(0x3c320a68, 0xf2bea4c6), - TOBN(0xad8dc538, 0x6da4541f), TOBN(0xeaf34eb0, 0xb7c41186), - TOBN(0x1c780129, 0x977c97c4), TOBN(0x5ff9beeb, 0xc57eb9fa), - TOBN(0xa24d0524, 0xc822c478), TOBN(0xfd8eec2a, 0x461cd415), - TOBN(0xfbde194e, 0xf027458c), TOBN(0xb4ff5319, 0x1d1be115), - TOBN(0x63f874d9, 0x4866d6f4), TOBN(0x35c75015, 0xb21ad0c9), - TOBN(0xa6b5c9d6, 0x46ac49d2), TOBN(0x42c77c0b, 0x83137aa9), - TOBN(0x24d000fc, 0x68225a38), TOBN(0x0f63cfc8, 0x2fe1e907), - TOBN(0x22d1b01b, 0xc6441f95), TOBN(0x7d38f719, 0xec8e448f), - TOBN(0x9b33fa5f, 0x787fb1ba), TOBN(0x94dcfda1, 0x190158df), - TOBN(0xc47cb339, 0x5f6d4a09), TOBN(0x6b4f355c, 0xee52b826), - TOBN(0x3d100f5d, 0xf51b930a), TOBN(0xf4512fac, 0x9f668f69), - TOBN(0x546781d5, 0x206c4c74), TOBN(0xd021d4d4, 0xcb4d2e48), - TOBN(0x494a54c2, 0xca085c2d), TOBN(0xf1dbaca4, 0x520850a8), - TOBN(0x63c79326, 0x490a1aca), TOBN(0xcb64dd9c, 0x41526b02), - TOBN(0xbb772591, 0xa2979258), TOBN(0x3f582970, 0x48d97846), - TOBN(0xd66b70d1, 0x7c213ba7), TOBN(0xc28febb5, 0xe8a0ced4), - TOBN(0x6b911831, 0xc10338c1), TOBN(0x0d54e389, 0xbf0126f3), - TOBN(0x7048d460, 0x4af206ee), TOBN(0x786c88f6, 0x77e97cb9), - TOBN(0xd4375ae1, 0xac64802e), TOBN(0x469bcfe1, 0xd53ec11c), - TOBN(0xfc9b340d, 0x47062230), TOBN(0xe743bb57, 0xc5b4a3ac), - TOBN(0xfe00b4aa, 0x59ef45ac), TOBN(0x29a4ef23, 0x59edf188), - TOBN(0x40242efe, 0xb483689b), TOBN(0x2575d3f6, 0x513ac262), - TOBN(0xf30037c8, 0x0ca6db72), TOBN(0xc9fcce82, 0x98864be2), - TOBN(0x84a112ff, 0x0149362d), TOBN(0x95e57582, 0x1c4ae971), - TOBN(0x1fa4b1a8, 0x945cf86c), TOBN(0x4525a734, 0x0b024a2f), - TOBN(0xe76c8b62, 0x8f338360), TOBN(0x483ff593, 0x28edf32b), - TOBN(0x67e8e90a, 0x298b1aec), TOBN(0x9caab338, 0x736d9a21), - TOBN(0x5c09d2fd, 0x66892709), TOBN(0x2496b4dc, 0xb55a1d41), - TOBN(0x93f5fb1a, 0xe24a4394), TOBN(0x08c75049, 0x6fa8f6c1), - TOBN(0xcaead1c2, 0xc905d85f), TOBN(0xe9d7f790, 0x0733ae57), - TOBN(0x24c9a65c, 0xf07cdd94), TOBN(0x7389359c, 0xa4b55931), - TOBN(0xf58709b7, 0x367e45f7), TOBN(0x1f203067, 0xcb7e7adc), - TOBN(0x82444bff, 0xc7b72818), TOBN(0x07303b35, 0xbaac8033), - TOBN(0x1e1ee4e4, 0xd13b7ea1), TOBN(0xe6489b24, 0xe0e74180), - TOBN(0xa5f2c610, 0x7e70ef70), TOBN(0xa1655412, 0xbdd10894), - TOBN(0x555ebefb, 0x7af4194e), TOBN(0x533c1c3c, 0x8e89bd9c), - TOBN(0x735b9b57, 0x89895856), TOBN(0x15fb3cd2, 0x567f5c15), - TOBN(0x057fed45, 0x526f09fd), TOBN(0xe8a4f10c, 0x8128240a), - TOBN(0x9332efc4, 0xff2bfd8d), TOBN(0x214e77a0, 0xbd35aa31), - TOBN(0x32896d73, 0x14faa40e), TOBN(0x767867ec, 0x01e5f186), - TOBN(0xc9adf8f1, 0x17a1813e), TOBN(0xcb6cda78, 0x54741795), - TOBN(0xb7521b6d, 0x349d51aa), TOBN(0xf56b5a9e, 0xe3c7b8e9), - TOBN(0xc6f1e5c9, 0x32a096df), TOBN(0x083667c4, 0xa3635024), - TOBN(0x365ea135, 0x18087f2f), TOBN(0xf1b8eaac, 0xd136e45d), - TOBN(0xc8a0e484, 0x73aec989), TOBN(0xd75a324b, 0x142c9259), - TOBN(0xb7b4d001, 0x01dae185), TOBN(0x45434e0b, 0x9b7a94bc), - TOBN(0xf54339af, 0xfbd8cb0b), TOBN(0xdcc4569e, 0xe98ef49e), - TOBN(0x7789318a, 0x09a51299), TOBN(0x81b4d206, 0xb2b025d8), - TOBN(0xf64aa418, 0xfae85792), TOBN(0x3e50258f, 0xacd7baf7), - TOBN(0xdce84cdb, 0x2996864b), TOBN(0xa2e67089, 0x1f485fa4), - TOBN(0xb28b2bb6, 0x534c6a5a), TOBN(0x31a7ec6b, 0xc94b9d39), - TOBN(0x1d217766, 0xd6bc20da), TOBN(0x4acdb5ec, 0x86761190), - TOBN(0x68726328, 0x73701063), TOBN(0x4d24ee7c, 0x2128c29b), - TOBN(0xc072ebd3, 0xa19fd868), TOBN(0x612e481c, 0xdb8ddd3b), - TOBN(0xb4e1d754, 0x1a64d852), TOBN(0x00ef95ac, 0xc4c6c4ab), - TOBN(0x1536d2ed, 0xaa0a6c46), TOBN(0x61294086, 0x43774790), - TOBN(0x54af25e8, 0x343fda10), TOBN(0x9ff9d98d, 0xfd25d6f2), - TOBN(0x0746af7c, 0x468b8835), TOBN(0x977a31cb, 0x730ecea7), - TOBN(0xa5096b80, 0xc2cf4a81), TOBN(0xaa986833, 0x6458c37a), - TOBN(0x6af29bf3, 0xa6bd9d34), TOBN(0x6a62fe9b, 0x33c5d854), - TOBN(0x50e6c304, 0xb7133b5e), TOBN(0x04b60159, 0x7d6e6848), - TOBN(0x4cd296df, 0x5579bea4), TOBN(0x10e35ac8, 0x5ceedaf1), - TOBN(0x04c4c5fd, 0xe3bcc5b1), TOBN(0x95f9ee8a, 0x89412cf9), - TOBN(0x2c9459ee, 0x82b6eb0f), TOBN(0x2e845765, 0x95c2aadd), - TOBN(0x774a84ae, 0xd327fcfe), TOBN(0xd8c93722, 0x0368d476), - TOBN(0x0dbd5748, 0xf83e8a3b), TOBN(0xa579aa96, 0x8d2495f3), - TOBN(0x535996a0, 0xae496e9b), TOBN(0x07afbfe9, 0xb7f9bcc2), - TOBN(0x3ac1dc6d, 0x5b7bd293), TOBN(0x3b592cff, 0x7022323d), - TOBN(0xba0deb98, 0x9c0a3e76), TOBN(0x18e78e9f, 0x4b197acb), - TOBN(0x211cde10, 0x296c36ef), TOBN(0x7ee89672, 0x82c4da77), - TOBN(0xb617d270, 0xa57836da), TOBN(0xf0cd9c31, 0x9cb7560b), - TOBN(0x01fdcbf7, 0xe455fe90), TOBN(0x3fb53cbb, 0x7e7334f3), - TOBN(0x781e2ea4, 0x4e7de4ec), TOBN(0x8adab3ad, 0x0b384fd0), - TOBN(0x129eee2f, 0x53d64829), TOBN(0x7a471e17, 0xa261492b), - TOBN(0xe4f9adb9, 0xe4cb4a2c), TOBN(0x3d359f6f, 0x97ba2c2d), - TOBN(0x346c6786, 0x0aacd697), TOBN(0x92b444c3, 0x75c2f8a8), - TOBN(0xc79fa117, 0xd85df44e), TOBN(0x56782372, 0x398ddf31), - TOBN(0x60e690f2, 0xbbbab3b8), TOBN(0x4851f8ae, 0x8b04816b), - TOBN(0xc72046ab, 0x9c92e4d2), TOBN(0x518c74a1, 0x7cf3136b), - TOBN(0xff4eb50a, 0xf9877d4c), TOBN(0x14578d90, 0xa919cabb), - TOBN(0x8218f8c4, 0xac5eb2b6), TOBN(0xa3ccc547, 0x542016e4), - TOBN(0x025bf48e, 0x327f8349), TOBN(0xf3e97346, 0xf43cb641), - TOBN(0xdc2bafdf, 0x500f1085), TOBN(0x57167876, 0x2f063055), - TOBN(0x5bd914b9, 0x411925a6), TOBN(0x7c078d48, 0xa1123de5), - TOBN(0xee6bf835, 0x182b165d), TOBN(0xb11b5e5b, 0xba519727), - TOBN(0xe33ea76c, 0x1eea7b85), TOBN(0x2352b461, 0x92d4f85e), - TOBN(0xf101d334, 0xafe115bb), TOBN(0xfabc1294, 0x889175a3), - TOBN(0x7f6bcdc0, 0x5233f925), TOBN(0xe0a802db, 0xe77fec55), - TOBN(0xbdb47b75, 0x8069b659), TOBN(0x1c5e12de, 0xf98fbd74), - TOBN(0x869c58c6, 0x4b8457ee), TOBN(0xa5360f69, 0x4f7ea9f7), - TOBN(0xe576c09f, 0xf460b38f), TOBN(0x6b70d548, 0x22b7fb36), - TOBN(0x3fd237f1, 0x3bfae315), TOBN(0x33797852, 0xcbdff369), - TOBN(0x97df25f5, 0x25b516f9), TOBN(0x46f388f2, 0xba38ad2d), - TOBN(0x656c4658, 0x89d8ddbb), TOBN(0x8830b26e, 0x70f38ee8), - TOBN(0x4320fd5c, 0xde1212b0), TOBN(0xc34f30cf, 0xe4a2edb2), - TOBN(0xabb131a3, 0x56ab64b8), TOBN(0x7f77f0cc, 0xd99c5d26), - TOBN(0x66856a37, 0xbf981d94), TOBN(0x19e76d09, 0x738bd76e), - TOBN(0xe76c8ac3, 0x96238f39), TOBN(0xc0a482be, 0xa830b366), - TOBN(0xb7b8eaff, 0x0b4eb499), TOBN(0x8ecd83bc, 0x4bfb4865), - TOBN(0x971b2cb7, 0xa2f3776f), TOBN(0xb42176a4, 0xf4b88adf), - TOBN(0xb9617df5, 0xbe1fa446), TOBN(0x8b32d508, 0xcd031bd2), - TOBN(0x1c6bd47d, 0x53b618c0), TOBN(0xc424f46c, 0x6a227923), - TOBN(0x7303ffde, 0xdd92d964), TOBN(0xe9712878, 0x71b5abf2), - TOBN(0x8f48a632, 0xf815561d), TOBN(0x85f48ff5, 0xd3c055d1), - TOBN(0x222a1427, 0x7525684f), TOBN(0xd0d841a0, 0x67360cc3), - TOBN(0x4245a926, 0x0b9267c6), TOBN(0xc78913f1, 0xcf07f863), - TOBN(0xaa844c8e, 0x4d0d9e24), TOBN(0xa42ad522, 0x3d5f9017), - TOBN(0xbd371749, 0xa2c989d5), TOBN(0x928292df, 0xe1f5e78e), - TOBN(0x493b383e, 0x0a1ea6da), TOBN(0x5136fd8d, 0x13aee529), - TOBN(0x860c44b1, 0xf2c34a99), TOBN(0x3b00aca4, 0xbf5855ac), - TOBN(0xabf6aaa0, 0xfaaf37be), TOBN(0x65f43682, 0x2a53ec08), - TOBN(0x1d9a5801, 0xa11b12e1), TOBN(0x78a7ab2c, 0xe20ed475), - TOBN(0x0de1067e, 0x9a41e0d5), TOBN(0x30473f5f, 0x305023ea), - TOBN(0xdd3ae09d, 0x169c7d97), TOBN(0x5cd5baa4, 0xcfaef9cd), - TOBN(0x5cd7440b, 0x65a44803), TOBN(0xdc13966a, 0x47f364de), - TOBN(0x077b2be8, 0x2b8357c1), TOBN(0x0cb1b4c5, 0xe9d57c2a), - TOBN(0x7a4ceb32, 0x05ff363e), TOBN(0xf310fa4d, 0xca35a9ef), - TOBN(0xdbb7b352, 0xf97f68c6), TOBN(0x0c773b50, 0x0b02cf58), - TOBN(0xea2e4821, 0x3c1f96d9), TOBN(0xffb357b0, 0xeee01815), - TOBN(0xb9c924cd, 0xe0f28039), TOBN(0x0b36c95a, 0x46a3fbe4), - TOBN(0x1faaaea4, 0x5e46db6c), TOBN(0xcae575c3, 0x1928aaff), - TOBN(0x7f671302, 0xa70dab86), TOBN(0xfcbd12a9, 0x71c58cfc), - TOBN(0xcbef9acf, 0xbee0cb92), TOBN(0x573da0b9, 0xf8c1b583), - TOBN(0x4752fcfe, 0x0d41d550), TOBN(0xe7eec0e3, 0x2155cffe), - TOBN(0x0fc39fcb, 0x545ae248), TOBN(0x522cb8d1, 0x8065f44e), - TOBN(0x263c962a, 0x70cbb96c), TOBN(0xe034362a, 0xbcd124a9), - TOBN(0xf120db28, 0x3c2ae58d), TOBN(0xb9a38d49, 0xfef6d507), - TOBN(0xb1fd2a82, 0x1ff140fd), TOBN(0xbd162f30, 0x20aee7e0), - TOBN(0x4e17a5d4, 0xcb251949), TOBN(0x2aebcb83, 0x4f7e1c3d), - TOBN(0x608eb25f, 0x937b0527), TOBN(0xf42e1e47, 0xeb7d9997), - TOBN(0xeba699c4, 0xb8a53a29), TOBN(0x1f921c71, 0xe091b536), - TOBN(0xcce29e7b, 0x5b26bbd5), TOBN(0x7a8ef5ed, 0x3b61a680), - TOBN(0xe5ef8043, 0xba1f1c7e), TOBN(0x16ea8217, 0x18158dda), - TOBN(0x01778a2b, 0x599ff0f9), TOBN(0x68a923d7, 0x8104fc6b), - TOBN(0x5bfa44df, 0xda694ff3), TOBN(0x4f7199db, 0xf7667f12), - TOBN(0xc06d8ff6, 0xe46f2a79), TOBN(0x08b5dead, 0xe9f8131d), - TOBN(0x02519a59, 0xabb4ce7c), TOBN(0xc4f710bc, 0xb42aec3e), - TOBN(0x3d77b057, 0x78bde41a), TOBN(0x6474bf80, 0xb4186b5a), - TOBN(0x048b3f67, 0x88c65741), TOBN(0xc64519de, 0x03c7c154), - TOBN(0xdf073846, 0x0edfcc4f), TOBN(0x319aa737, 0x48f1aa6b), - TOBN(0x8b9f8a02, 0xca909f77), TOBN(0x90258139, 0x7580bfef), - TOBN(0xd8bfd3ca, 0xc0c22719), TOBN(0xc60209e4, 0xc9ca151e), - TOBN(0x7a744ab5, 0xd9a1a69c), TOBN(0x6de5048b, 0x14937f8f), - TOBN(0x171938d8, 0xe115ac04), TOBN(0x7df70940, 0x1c6b16d2), - TOBN(0xa6aeb663, 0x7f8e94e7), TOBN(0xc130388e, 0x2a2cf094), - TOBN(0x1850be84, 0x77f54e6e), TOBN(0x9f258a72, 0x65d60fe5), - TOBN(0xff7ff0c0, 0x6c9146d6), TOBN(0x039aaf90, 0xe63a830b), - TOBN(0x38f27a73, 0x9460342f), TOBN(0x4703148c, 0x3f795f8a), - TOBN(0x1bb5467b, 0x9681a97e), TOBN(0x00931ba5, 0xecaeb594), - TOBN(0xcdb6719d, 0x786f337c), TOBN(0xd9c01cd2, 0xe704397d), - TOBN(0x0f4a3f20, 0x555c2fef), TOBN(0x00452509, 0x7c0af223), - TOBN(0x54a58047, 0x84db8e76), TOBN(0x3bacf1aa, 0x93c8aa06), - TOBN(0x11ca957c, 0xf7919422), TOBN(0x50641053, 0x78cdaa40), - TOBN(0x7a303874, 0x9f7144ae), TOBN(0x170c963f, 0x43d4acfd), - TOBN(0x5e148149, 0x58ddd3ef), TOBN(0xa7bde582, 0x9e72dba8), - TOBN(0x0769da8b, 0x6fa68750), TOBN(0xfa64e532, 0x572e0249), - TOBN(0xfcaadf9d, 0x2619ad31), TOBN(0x87882daa, 0xa7b349cd), - TOBN(0x9f6eb731, 0x6c67a775), TOBN(0xcb10471a, 0xefc5d0b1), - TOBN(0xb433750c, 0xe1b806b2), TOBN(0x19c5714d, 0x57b1ae7e), - TOBN(0xc0dc8b7b, 0xed03fd3f), TOBN(0xdd03344f, 0x31bc194e), - TOBN(0xa66c52a7, 0x8c6320b5), TOBN(0x8bc82ce3, 0xd0b6fd93), - TOBN(0xf8e13501, 0xb35f1341), TOBN(0xe53156dd, 0x25a43e42), - TOBN(0xd3adf27e, 0x4daeb85c), TOBN(0xb81d8379, 0xbbeddeb5), - TOBN(0x1b0b546e, 0x2e435867), TOBN(0x9020eb94, 0xeba5dd60), - TOBN(0x37d91161, 0x8210cb9d), TOBN(0x4c596b31, 0x5c91f1cf), - TOBN(0xb228a90f, 0x0e0b040d), TOBN(0xbaf02d82, 0x45ff897f), - TOBN(0x2aac79e6, 0x00fa6122), TOBN(0x24828817, 0x8e36f557), - TOBN(0xb9521d31, 0x113ec356), TOBN(0x9e48861e, 0x15eff1f8), - TOBN(0x2aa1d412, 0xe0d41715), TOBN(0x71f86203, 0x53f131b8), - TOBN(0xf60da8da, 0x3fd19408), TOBN(0x4aa716dc, 0x278d9d99), - TOBN(0x394531f7, 0xa8c51c90), TOBN(0xb560b0e8, 0xf59db51c), - TOBN(0xa28fc992, 0xfa34bdad), TOBN(0xf024fa14, 0x9cd4f8bd), - TOBN(0x5cf530f7, 0x23a9d0d3), TOBN(0x615ca193, 0xe28c9b56), - TOBN(0x6d2a483d, 0x6f73c51e), TOBN(0xa4cb2412, 0xea0dc2dd), - TOBN(0x50663c41, 0x1eb917ff), TOBN(0x3d3a74cf, 0xeade299e), - TOBN(0x29b3990f, 0x4a7a9202), TOBN(0xa9bccf59, 0xa7b15c3d), - TOBN(0x66a3ccdc, 0xa5df9208), TOBN(0x48027c14, 0x43f2f929), - TOBN(0xd385377c, 0x40b557f0), TOBN(0xe001c366, 0xcd684660), - TOBN(0x1b18ed6b, 0xe2183a27), TOBN(0x879738d8, 0x63210329), - TOBN(0xa687c74b, 0xbda94882), TOBN(0xd1bbcc48, 0xa684b299), - TOBN(0xaf6f1112, 0x863b3724), TOBN(0x6943d1b4, 0x2c8ce9f8), - TOBN(0xe044a3bb, 0x098cafb4), TOBN(0x27ed2310, 0x60d48caf), - TOBN(0x542b5675, 0x3a31b84d), TOBN(0xcbf3dd50, 0xfcddbed7), - TOBN(0x25031f16, 0x41b1d830), TOBN(0xa7ec851d, 0xcb0c1e27), - TOBN(0xac1c8fe0, 0xb5ae75db), TOBN(0xb24c7557, 0x08c52120), - TOBN(0x57f811dc, 0x1d4636c3), TOBN(0xf8436526, 0x681a9939), - TOBN(0x1f6bc6d9, 0x9c81adb3), TOBN(0x840f8ac3, 0x5b7d80d4), - TOBN(0x731a9811, 0xf4387f1a), TOBN(0x7c501cd3, 0xb5156880), - TOBN(0xa5ca4a07, 0xdfe68867), TOBN(0xf123d8f0, 0x5fcea120), - TOBN(0x1fbb0e71, 0xd607039e), TOBN(0x2b70e215, 0xcd3a4546), - TOBN(0x32d2f01d, 0x53324091), TOBN(0xb796ff08, 0x180ab19b), - TOBN(0x32d87a86, 0x3c57c4aa), TOBN(0x2aed9caf, 0xb7c49a27), - TOBN(0x9fb35eac, 0x31630d98), TOBN(0x338e8cdf, 0x5c3e20a3), - TOBN(0x80f16182, 0x66cde8db), TOBN(0x4e159980, 0x2d72fd36), - TOBN(0xd7b8f13b, 0x9b6e5072), TOBN(0xf5213907, 0x3b7b5dc1), - TOBN(0x4d431f1d, 0x8ce4396e), TOBN(0x37a1a680, 0xa7ed2142), - TOBN(0xbf375696, 0xd01aaf6b), TOBN(0xaa1c0c54, 0xe63aab66), - TOBN(0x3014368b, 0x4ed80940), TOBN(0x67e6d056, 0x7a6fcedd), - TOBN(0x7c208c49, 0xca97579f), TOBN(0xfe3d7a81, 0xa23597f6), - TOBN(0x5e203202, 0x7e096ae2), TOBN(0xb1f3e1e7, 0x24b39366), - TOBN(0x26da26f3, 0x2fdcdffc), TOBN(0x79422f1d, 0x6097be83)}, - {TOBN(0x263a2cfb, 0x9db3b381), TOBN(0x9c3a2dee, 0xd4df0a4b), - TOBN(0x728d06e9, 0x7d04e61f), TOBN(0x8b1adfbc, 0x42449325), - TOBN(0x6ec1d939, 0x7e053a1b), TOBN(0xee2be5c7, 0x66daf707), - TOBN(0x80ba1e14, 0x810ac7ab), TOBN(0xdd2ae778, 0xf530f174), - TOBN(0x0435d97a, 0x205b9d8b), TOBN(0x6eb8f064, 0x056756d4), - TOBN(0xd5e88a8b, 0xb6f8210e), TOBN(0x070ef12d, 0xec9fd9ea), - TOBN(0x4d849505, 0x3bcc876a), TOBN(0x12a75338, 0xa7404ce3), - TOBN(0xd22b49e1, 0xb8a1db5e), TOBN(0xec1f2051, 0x14bfa5ad), - TOBN(0xadbaeb79, 0xb6828f36), TOBN(0x9d7a0258, 0x01bd5b9e), - TOBN(0xeda01e0d, 0x1e844b0c), TOBN(0x4b625175, 0x887edfc9), - TOBN(0x14109fdd, 0x9669b621), TOBN(0x88a2ca56, 0xf6f87b98), - TOBN(0xfe2eb788, 0x170df6bc), TOBN(0x0cea06f4, 0xffa473f9), - TOBN(0x43ed81b5, 0xc4e83d33), TOBN(0xd9f35879, 0x5efd488b), - TOBN(0x164a620f, 0x9deb4d0f), TOBN(0xc6927bdb, 0xac6a7394), - TOBN(0x45c28df7, 0x9f9e0f03), TOBN(0x2868661e, 0xfcd7e1a9), - TOBN(0x7cf4e8d0, 0xffa348f1), TOBN(0x6bd4c284, 0x398538e0), - TOBN(0x2618a091, 0x289a8619), TOBN(0xef796e60, 0x6671b173), - TOBN(0x664e46e5, 0x9090c632), TOBN(0xa38062d4, 0x1e66f8fb), - TOBN(0x6c744a20, 0x0573274e), TOBN(0xd07b67e4, 0xa9271394), - TOBN(0x391223b2, 0x6bdc0e20), TOBN(0xbe2d93f1, 0xeb0a05a7), - TOBN(0xf23e2e53, 0x3f36d141), TOBN(0xe84bb3d4, 0x4dfca442), - TOBN(0xb804a48d, 0x6b7c023a), TOBN(0x1e16a8fa, 0x76431c3b), - TOBN(0x1b5452ad, 0xddd472e0), TOBN(0x7d405ee7, 0x0d1ee127), - TOBN(0x50fc6f1d, 0xffa27599), TOBN(0x351ac53c, 0xbf391b35), - TOBN(0x7efa14b8, 0x4444896b), TOBN(0x64974d2f, 0xf94027fb), - TOBN(0xefdcd0e8, 0xde84487d), TOBN(0x8c45b260, 0x2b48989b), - TOBN(0xa8fcbbc2, 0xd8463487), TOBN(0xd1b2b3f7, 0x3fbc476c), - TOBN(0x21d005b7, 0xc8f443c0), TOBN(0x518f2e67, 0x40c0139c), - TOBN(0x56036e8c, 0x06d75fc1), TOBN(0x2dcf7bb7, 0x3249a89f), - TOBN(0x81dd1d3d, 0xe245e7dd), TOBN(0xf578dc4b, 0xebd6e2a7), - TOBN(0x4c028903, 0xdf2ce7a0), TOBN(0xaee36288, 0x9c39afac), - TOBN(0xdc847c31, 0x146404ab), TOBN(0x6304c0d8, 0xa4e97818), - TOBN(0xae51dca2, 0xa91f6791), TOBN(0x2abe4190, 0x9baa9efc), - TOBN(0xd9d2e2f4, 0x559c7ac1), TOBN(0xe82f4b51, 0xfc9f773a), - TOBN(0xa7713027, 0x4073e81c), TOBN(0xc0276fac, 0xfbb596fc), - TOBN(0x1d819fc9, 0xa684f70c), TOBN(0x29b47fdd, 0xc9f7b1e0), - TOBN(0x358de103, 0x459b1940), TOBN(0xec881c59, 0x5b013e93), - TOBN(0x51574c93, 0x49532ad3), TOBN(0x2db1d445, 0xb37b46de), - TOBN(0xc6445b87, 0xdf239fd8), TOBN(0xc718af75, 0x151d24ee), - TOBN(0xaea1c4a4, 0xf43c6259), TOBN(0x40c0e5d7, 0x70be02f7), - TOBN(0x6a4590f4, 0x721b33f2), TOBN(0x2124f1fb, 0xfedf04ea), - TOBN(0xf8e53cde, 0x9745efe7), TOBN(0xe7e10432, 0x65f046d9), - TOBN(0xc3fca28e, 0xe4d0c7e6), TOBN(0x847e339a, 0x87253b1b), - TOBN(0x9b595348, 0x3743e643), TOBN(0xcb6a0a0b, 0x4fd12fc5), - TOBN(0xfb6836c3, 0x27d02dcc), TOBN(0x5ad00982, 0x7a68bcc2), - TOBN(0x1b24b44c, 0x005e912d), TOBN(0xcc83d20f, 0x811fdcfe), - TOBN(0x36527ec1, 0x666fba0c), TOBN(0x69948197, 0x14754635), - TOBN(0xfcdcb1a8, 0x556da9c2), TOBN(0xa5934267, 0x81a732b2), - TOBN(0xec1214ed, 0xa714181d), TOBN(0x609ac13b, 0x6067b341), - TOBN(0xff4b4c97, 0xa545df1f), TOBN(0xa1240501, 0x34d2076b), - TOBN(0x6efa0c23, 0x1409ca97), TOBN(0x254cc1a8, 0x20638c43), - TOBN(0xd4e363af, 0xdcfb46cd), TOBN(0x62c2adc3, 0x03942a27), - TOBN(0xc67b9df0, 0x56e46483), TOBN(0xa55abb20, 0x63736356), - TOBN(0xab93c098, 0xc551bc52), TOBN(0x382b49f9, 0xb15fe64b), - TOBN(0x9ec221ad, 0x4dff8d47), TOBN(0x79caf615, 0x437df4d6), - TOBN(0x5f13dc64, 0xbb456509), TOBN(0xe4c589d9, 0x191f0714), - TOBN(0x27b6a8ab, 0x3fd40e09), TOBN(0xe455842e, 0x77313ea9), - TOBN(0x8b51d1e2, 0x1f55988b), TOBN(0x5716dd73, 0x062bbbfc), - TOBN(0x633c11e5, 0x4e8bf3de), TOBN(0x9a0e77b6, 0x1b85be3b), - TOBN(0x56510729, 0x0911cca6), TOBN(0x27e76495, 0xefa6590f), - TOBN(0xe4ac8b33, 0x070d3aab), TOBN(0x2643672b, 0x9a2cd5e5), - TOBN(0x52eff79b, 0x1cfc9173), TOBN(0x665ca49b, 0x90a7c13f), - TOBN(0x5a8dda59, 0xb3efb998), TOBN(0x8a5b922d, 0x052f1341), - TOBN(0xae9ebbab, 0x3cf9a530), TOBN(0x35986e7b, 0xf56da4d7), - TOBN(0x3a636b5c, 0xff3513cc), TOBN(0xbb0cf8ba, 0x3198f7dd), - TOBN(0xb8d40522, 0x41f16f86), TOBN(0x760575d8, 0xde13a7bf), - TOBN(0x36f74e16, 0x9f7aa181), TOBN(0x163a3ecf, 0xf509ed1c), - TOBN(0x6aead61f, 0x3c40a491), TOBN(0x158c95fc, 0xdfe8fcaa), - TOBN(0xa3991b6e, 0x13cda46f), TOBN(0x79482415, 0x342faed0), - TOBN(0xf3ba5bde, 0x666b5970), TOBN(0x1d52e6bc, 0xb26ab6dd), - TOBN(0x768ba1e7, 0x8608dd3d), TOBN(0x4930db2a, 0xea076586), - TOBN(0xd9575714, 0xe7dc1afa), TOBN(0x1fc7bf7d, 0xf7c58817), - TOBN(0x6b47accd, 0xd9eee96c), TOBN(0x0ca277fb, 0xe58cec37), - TOBN(0x113fe413, 0xe702c42a), TOBN(0xdd1764ee, 0xc47cbe51), - TOBN(0x041e7cde, 0x7b3ed739), TOBN(0x50cb7459, 0x5ce9e1c0), - TOBN(0x35568513, 0x2925b212), TOBN(0x7cff95c4, 0x001b081c), - TOBN(0x63ee4cbd, 0x8088b454), TOBN(0xdb7f32f7, 0x9a9e0c8a), - TOBN(0xb377d418, 0x6b2447cb), TOBN(0xe3e982aa, 0xd370219b), - TOBN(0x06ccc1e4, 0xc2a2a593), TOBN(0x72c36865, 0x0773f24f), - TOBN(0xa13b4da7, 0x95859423), TOBN(0x8bbf1d33, 0x75040c8f), - TOBN(0x726f0973, 0xda50c991), TOBN(0x48afcd5b, 0x822d6ee2), - TOBN(0xe5fc718b, 0x20fd7771), TOBN(0xb9e8e77d, 0xfd0807a1), - TOBN(0x7f5e0f44, 0x99a7703d), TOBN(0x6972930e, 0x618e36f3), - TOBN(0x2b7c77b8, 0x23807bbe), TOBN(0xe5b82405, 0xcb27ff50), - TOBN(0xba8b8be3, 0xbd379062), TOBN(0xd64b7a1d, 0x2dce4a92), - TOBN(0x040a73c5, 0xb2952e37), TOBN(0x0a9e252e, 0xd438aeca), - TOBN(0xdd43956b, 0xc39d3bcb), TOBN(0x1a31ca00, 0xb32b2d63), - TOBN(0xd67133b8, 0x5c417a18), TOBN(0xd08e4790, 0x2ef442c8), - TOBN(0x98cb1ae9, 0x255c0980), TOBN(0x4bd86381, 0x2b4a739f), - TOBN(0x5a5c31e1, 0x1e4a45a1), TOBN(0x1e5d55fe, 0x9cb0db2f), - TOBN(0x74661b06, 0x8ff5cc29), TOBN(0x026b389f, 0x0eb8a4f4), - TOBN(0x536b21a4, 0x58848c24), TOBN(0x2e5bf8ec, 0x81dc72b0), - TOBN(0x03c187d0, 0xad886aac), TOBN(0x5c16878a, 0xb771b645), - TOBN(0xb07dfc6f, 0xc74045ab), TOBN(0x2c6360bf, 0x7800caed), - TOBN(0x24295bb5, 0xb9c972a3), TOBN(0xc9e6f88e, 0x7c9a6dba), - TOBN(0x90ffbf24, 0x92a79aa6), TOBN(0xde29d50a, 0x41c26ac2), - TOBN(0x9f0af483, 0xd309cbe6), TOBN(0x5b020d8a, 0xe0bced4f), - TOBN(0x606e986d, 0xb38023e3), TOBN(0xad8f2c9d, 0x1abc6933), - TOBN(0x19292e1d, 0xe7400e93), TOBN(0xfe3e18a9, 0x52be5e4d), - TOBN(0xe8e9771d, 0x2e0680bf), TOBN(0x8c5bec98, 0xc54db063), - TOBN(0x2af9662a, 0x74a55d1f), TOBN(0xe3fbf28f, 0x046f66d8), - TOBN(0xa3a72ab4, 0xd4dc4794), TOBN(0x09779f45, 0x5c7c2dd8), - TOBN(0xd893bdaf, 0xc3d19d8d), TOBN(0xd5a75094, 0x57d6a6df), - TOBN(0x8cf8fef9, 0x952e6255), TOBN(0x3da67cfb, 0xda9a8aff), - TOBN(0x4c23f62a, 0x2c160dcd), TOBN(0x34e6c5e3, 0x8f90eaef), - TOBN(0x35865519, 0xa9a65d5a), TOBN(0x07c48aae, 0x8fd38a3d), - TOBN(0xb7e7aeda, 0x50068527), TOBN(0x2c09ef23, 0x1c90936a), - TOBN(0x31ecfeb6, 0xe879324c), TOBN(0xa0871f6b, 0xfb0ec938), - TOBN(0xb1f0fb68, 0xd84d835d), TOBN(0xc90caf39, 0x861dc1e6), - TOBN(0x12e5b046, 0x7594f8d7), TOBN(0x26897ae2, 0x65012b92), - TOBN(0xbcf68a08, 0xa4d6755d), TOBN(0x403ee41c, 0x0991fbda), - TOBN(0x733e343e, 0x3bbf17e8), TOBN(0xd2c7980d, 0x679b3d65), - TOBN(0x33056232, 0xd2e11305), TOBN(0x966be492, 0xf3c07a6f), - TOBN(0x6a8878ff, 0xbb15509d), TOBN(0xff221101, 0x0a9b59a4), - TOBN(0x6c9f564a, 0xabe30129), TOBN(0xc6f2c940, 0x336e64cf), - TOBN(0x0fe75262, 0x8b0c8022), TOBN(0xbe0267e9, 0x6ae8db87), - TOBN(0x22e192f1, 0x93bc042b), TOBN(0xf085b534, 0xb237c458), - TOBN(0xa0d192bd, 0x832c4168), TOBN(0x7a76e9e3, 0xbdf6271d), - TOBN(0x52a882fa, 0xb88911b5), TOBN(0xc85345e4, 0xb4db0eb5), - TOBN(0xa3be02a6, 0x81a7c3ff), TOBN(0x51889c8c, 0xf0ec0469), - TOBN(0x9d031369, 0xa5e829e5), TOBN(0xcbb4c6fc, 0x1607aa41), - TOBN(0x75ac59a6, 0x241d84c1), TOBN(0xc043f2bf, 0x8829e0ee), - TOBN(0x82a38f75, 0x8ea5e185), TOBN(0x8bda40b9, 0xd87cbd9f), - TOBN(0x9e65e75e, 0x2d8fc601), TOBN(0x3d515f74, 0xa35690b3), - TOBN(0x534acf4f, 0xda79e5ac), TOBN(0x68b83b3a, 0x8630215f), - TOBN(0x5c748b2e, 0xd085756e), TOBN(0xb0317258, 0xe5d37cb2), - TOBN(0x6735841a, 0xc5ccc2c4), TOBN(0x7d7dc96b, 0x3d9d5069), - TOBN(0xa147e410, 0xfd1754bd), TOBN(0x65296e94, 0xd399ddd5), - TOBN(0xf6b5b2d0, 0xbc8fa5bc), TOBN(0x8a5ead67, 0x500c277b), - TOBN(0x214625e6, 0xdfa08a5d), TOBN(0x51fdfedc, 0x959cf047), - TOBN(0x6bc9430b, 0x289fca32), TOBN(0xe36ff0cf, 0x9d9bdc3f), - TOBN(0x2fe187cb, 0x58ea0ede), TOBN(0xed66af20, 0x5a900b3f), - TOBN(0x00e0968b, 0x5fa9f4d6), TOBN(0x2d4066ce, 0x37a362e7), - TOBN(0xa99a9748, 0xbd07e772), TOBN(0x710989c0, 0x06a4f1d0), - TOBN(0xd5dedf35, 0xce40cbd8), TOBN(0xab55c5f0, 0x1743293d), - TOBN(0x766f1144, 0x8aa24e2c), TOBN(0x94d874f8, 0x605fbcb4), - TOBN(0xa365f0e8, 0xa518001b), TOBN(0xee605eb6, 0x9d04ef0f), - TOBN(0x5a3915cd, 0xba8d4d25), TOBN(0x44c0e1b8, 0xb5113472), - TOBN(0xcbb024e8, 0x8b6740dc), TOBN(0x89087a53, 0xee1d4f0c), - TOBN(0xa88fa05c, 0x1fc4e372), TOBN(0x8bf395cb, 0xaf8b3af2), - TOBN(0x1e71c9a1, 0xdeb8568b), TOBN(0xa35daea0, 0x80fb3d32), - TOBN(0xe8b6f266, 0x2cf8fb81), TOBN(0x6d51afe8, 0x9490696a), - TOBN(0x81beac6e, 0x51803a19), TOBN(0xe3d24b7f, 0x86219080), - TOBN(0x727cfd9d, 0xdf6f463c), TOBN(0x8c6865ca, 0x72284ee8), - TOBN(0x32c88b7d, 0xb743f4ef), TOBN(0x3793909b, 0xe7d11dce), - TOBN(0xd398f922, 0x2ff2ebe8), TOBN(0x2c70ca44, 0xe5e49796), - TOBN(0xdf4d9929, 0xcb1131b1), TOBN(0x7826f298, 0x25888e79), - TOBN(0x4d3a112c, 0xf1d8740a), TOBN(0x00384cb6, 0x270afa8b), - TOBN(0xcb64125b, 0x3ab48095), TOBN(0x3451c256, 0x62d05106), - TOBN(0xd73d577d, 0xa4955845), TOBN(0x39570c16, 0xbf9f4433), - TOBN(0xd7dfaad3, 0xadecf263), TOBN(0xf1c3d8d1, 0xdc76e102), - TOBN(0x5e774a58, 0x54c6a836), TOBN(0xdad4b672, 0x3e92d47b), - TOBN(0xbe7e990f, 0xf0d796a0), TOBN(0x5fc62478, 0xdf0e8b02), - TOBN(0x8aae8bf4, 0x030c00ad), TOBN(0x3d2db93b, 0x9004ba0f), - TOBN(0xe48c8a79, 0xd85d5ddc), TOBN(0xe907caa7, 0x6bb07f34), - TOBN(0x58db343a, 0xa39eaed5), TOBN(0x0ea6e007, 0xadaf5724), - TOBN(0xe00df169, 0xd23233f3), TOBN(0x3e322796, 0x77cb637f), - TOBN(0x1f897c0e, 0x1da0cf6c), TOBN(0xa651f5d8, 0x31d6bbdd), - TOBN(0xdd61af19, 0x1a230c76), TOBN(0xbd527272, 0xcdaa5e4a), - TOBN(0xca753636, 0xd0abcd7e), TOBN(0x78bdd37c, 0x370bd8dc), - TOBN(0xc23916c2, 0x17cd93fe), TOBN(0x65b97a4d, 0xdadce6e2), - TOBN(0xe04ed4eb, 0x174e42f8), TOBN(0x1491ccaa, 0xbb21480a), - TOBN(0x145a8280, 0x23196332), TOBN(0x3c3862d7, 0x587b479a), - TOBN(0x9f4a88a3, 0x01dcd0ed), TOBN(0x4da2b7ef, 0x3ea12f1f), - TOBN(0xf8e7ae33, 0xb126e48e), TOBN(0x404a0b32, 0xf494e237), - TOBN(0x9beac474, 0xc55acadb), TOBN(0x4ee5cf3b, 0xcbec9fd9), - TOBN(0x336b33b9, 0x7df3c8c3), TOBN(0xbd905fe3, 0xb76808fd), - TOBN(0x8f436981, 0xaa45c16a), TOBN(0x255c5bfa, 0x3dd27b62), - TOBN(0x71965cbf, 0xc3dd9b4d), TOBN(0xce23edbf, 0xfc068a87), - TOBN(0xb78d4725, 0x745b029b), TOBN(0x74610713, 0xcefdd9bd), - TOBN(0x7116f75f, 0x1266bf52), TOBN(0x02046722, 0x18e49bb6), - TOBN(0xdf43df9f, 0x3d6f19e3), TOBN(0xef1bc7d0, 0xe685cb2f), - TOBN(0xcddb27c1, 0x7078c432), TOBN(0xe1961b9c, 0xb77fedb7), - TOBN(0x1edc2f5c, 0xc2290570), TOBN(0x2c3fefca, 0x19cbd886), - TOBN(0xcf880a36, 0xc2af389a), TOBN(0x96c610fd, 0xbda71cea), - TOBN(0xf03977a9, 0x32aa8463), TOBN(0x8eb7763f, 0x8586d90a), - TOBN(0x3f342454, 0x2a296e77), TOBN(0xc8718683, 0x42837a35), - TOBN(0x7dc71090, 0x6a09c731), TOBN(0x54778ffb, 0x51b816db), - TOBN(0x6b33bfec, 0xaf06defd), TOBN(0xfe3c105f, 0x8592b70b), - TOBN(0xf937fda4, 0x61da6114), TOBN(0x3c13e651, 0x4c266ad7), - TOBN(0xe363a829, 0x855938e8), TOBN(0x2eeb5d9e, 0x9de54b72), - TOBN(0xbeb93b0e, 0x20ccfab9), TOBN(0x3dffbb5f, 0x25e61a25), - TOBN(0x7f655e43, 0x1acc093d), TOBN(0x0cb6cc3d, 0x3964ce61), - TOBN(0x6ab283a1, 0xe5e9b460), TOBN(0x55d787c5, 0xa1c7e72d), - TOBN(0x4d2efd47, 0xdeadbf02), TOBN(0x11e80219, 0xac459068), - TOBN(0x810c7626, 0x71f311f0), TOBN(0xfa17ef8d, 0x4ab6ef53), - TOBN(0xaf47fd25, 0x93e43bff), TOBN(0x5cb5ff3f, 0x0be40632), - TOBN(0x54687106, 0x8ee61da3), TOBN(0x7764196e, 0xb08afd0f), - TOBN(0x831ab3ed, 0xf0290a8f), TOBN(0xcae81966, 0xcb47c387), - TOBN(0xaad7dece, 0x184efb4f), TOBN(0xdcfc53b3, 0x4749110e), - TOBN(0x6698f23c, 0x4cb632f9), TOBN(0xc42a1ad6, 0xb91f8067), - TOBN(0xb116a81d, 0x6284180a), TOBN(0xebedf5f8, 0xe901326f), - TOBN(0xf2274c9f, 0x97e3e044), TOBN(0x42018520, 0x11d09fc9), - TOBN(0x56a65f17, 0xd18e6e23), TOBN(0x2ea61e2a, 0x352b683c), - TOBN(0x27d291bc, 0x575eaa94), TOBN(0x9e7bc721, 0xb8ff522d), - TOBN(0x5f7268bf, 0xa7f04d6f), TOBN(0x5868c73f, 0xaba41748), - TOBN(0x9f85c2db, 0x7be0eead), TOBN(0x511e7842, 0xff719135), - TOBN(0x5a06b1e9, 0xc5ea90d7), TOBN(0x0c19e283, 0x26fab631), - TOBN(0x8af8f0cf, 0xe9206c55), TOBN(0x89389cb4, 0x3553c06a), - TOBN(0x39dbed97, 0xf65f8004), TOBN(0x0621b037, 0xc508991d), - TOBN(0x1c52e635, 0x96e78cc4), TOBN(0x5385c8b2, 0x0c06b4a8), - TOBN(0xd84ddfdb, 0xb0e87d03), TOBN(0xc49dfb66, 0x934bafad), - TOBN(0x7071e170, 0x59f70772), TOBN(0x3a073a84, 0x3a1db56b), - TOBN(0x03494903, 0x3b8af190), TOBN(0x7d882de3, 0xd32920f0), - TOBN(0x91633f0a, 0xb2cf8940), TOBN(0x72b0b178, 0x6f948f51), - TOBN(0x2d28dc30, 0x782653c8), TOBN(0x88829849, 0xdb903a05), - TOBN(0xb8095d0c, 0x6a19d2bb), TOBN(0x4b9e7f0c, 0x86f782cb), - TOBN(0x7af73988, 0x2d907064), TOBN(0xd12be0fe, 0x8b32643c), - TOBN(0x358ed23d, 0x0e165dc3), TOBN(0x3d47ce62, 0x4e2378ce), - TOBN(0x7e2bb0b9, 0xfeb8a087), TOBN(0x3246e8ae, 0xe29e10b9), - TOBN(0x459f4ec7, 0x03ce2b4d), TOBN(0xe9b4ca1b, 0xbbc077cf), - TOBN(0x2613b4f2, 0x0e9940c1), TOBN(0xfc598bb9, 0x047d1eb1), - TOBN(0x9744c62b, 0x45036099), TOBN(0xa9dee742, 0x167c65d8), - TOBN(0x0c511525, 0xdabe1943), TOBN(0xda110554, 0x93c6c624), - TOBN(0xae00a52c, 0x651a3be2), TOBN(0xcda5111d, 0x884449a6), - TOBN(0x063c06f4, 0xff33bed1), TOBN(0x73baaf9a, 0x0d3d76b4), - TOBN(0x52fb0c9d, 0x7fc63668), TOBN(0x6886c9dd, 0x0c039cde), - TOBN(0x602bd599, 0x55b22351), TOBN(0xb00cab02, 0x360c7c13), - TOBN(0x8cb616bc, 0x81b69442), TOBN(0x41486700, 0xb55c3cee), - TOBN(0x71093281, 0xf49ba278), TOBN(0xad956d9c, 0x64a50710), - TOBN(0x9561f28b, 0x638a7e81), TOBN(0x54155cdf, 0x5980ddc3), - TOBN(0xb2db4a96, 0xd26f247a), TOBN(0x9d774e4e, 0x4787d100), - TOBN(0x1a9e6e2e, 0x078637d2), TOBN(0x1c363e2d, 0x5e0ae06a), - TOBN(0x7493483e, 0xe9cfa354), TOBN(0x76843cb3, 0x7f74b98d), - TOBN(0xbaca6591, 0xd4b66947), TOBN(0xb452ce98, 0x04460a8c), - TOBN(0x6830d246, 0x43768f55), TOBN(0xf4197ed8, 0x7dff12df), - TOBN(0x6521b472, 0x400dd0f7), TOBN(0x59f5ca8f, 0x4b1e7093), - TOBN(0x6feff11b, 0x080338ae), TOBN(0x0ada31f6, 0xa29ca3c6), - TOBN(0x24794eb6, 0x94a2c215), TOBN(0xd83a43ab, 0x05a57ab4), - TOBN(0x264a543a, 0x2a6f89fe), TOBN(0x2c2a3868, 0xdd5ec7c2), - TOBN(0xd3373940, 0x8439d9b2), TOBN(0x715ea672, 0x0acd1f11), - TOBN(0x42c1d235, 0xe7e6cc19), TOBN(0x81ce6e96, 0xb990585c), - TOBN(0x04e5dfe0, 0xd809c7bd), TOBN(0xd7b2580c, 0x8f1050ab), - TOBN(0x6d91ad78, 0xd8a4176f), TOBN(0x0af556ee, 0x4e2e897c), - TOBN(0x162a8b73, 0x921de0ac), TOBN(0x52ac9c22, 0x7ea78400), - TOBN(0xee2a4eea, 0xefce2174), TOBN(0xbe61844e, 0x6d637f79), - TOBN(0x0491f1bc, 0x789a283b), TOBN(0x72d3ac3d, 0x880836f4), - TOBN(0xaa1c5ea3, 0x88e5402d), TOBN(0x1b192421, 0xd5cc473d), - TOBN(0x5c0b9998, 0x9dc84cac), TOBN(0xb0a8482d, 0x9c6e75b8), - TOBN(0x639961d0, 0x3a191ce2), TOBN(0xda3bc865, 0x6d837930), - TOBN(0xca990653, 0x056e6f8f), TOBN(0x84861c41, 0x64d133a7), - TOBN(0x8b403276, 0x746abe40), TOBN(0xb7b4d51a, 0xebf8e303), - TOBN(0x05b43211, 0x220a255d), TOBN(0xc997152c, 0x02419e6e), - TOBN(0x76ff47b6, 0x630c2fea), TOBN(0x50518677, 0x281fdade), - TOBN(0x3283b8ba, 0xcf902b0b), TOBN(0x8d4b4eb5, 0x37db303b), - TOBN(0xcc89f42d, 0x755011bc), TOBN(0xb43d74bb, 0xdd09d19b), - TOBN(0x65746bc9, 0x8adba350), TOBN(0x364eaf8c, 0xb51c1927), - TOBN(0x13c76596, 0x10ad72ec), TOBN(0x30045121, 0xf8d40c20), - TOBN(0x6d2d99b7, 0xea7b979b), TOBN(0xcd78cd74, 0xe6fb3bcd), - TOBN(0x11e45a9e, 0x86cffbfe), TOBN(0x78a61cf4, 0x637024f6), - TOBN(0xd06bc872, 0x3d502295), TOBN(0xf1376854, 0x458cb288), - TOBN(0xb9db26a1, 0x342f8586), TOBN(0xf33effcf, 0x4beee09e), - TOBN(0xd7e0c4cd, 0xb30cfb3a), TOBN(0x6d09b8c1, 0x6c9db4c8), - TOBN(0x40ba1a42, 0x07c8d9df), TOBN(0x6fd495f7, 0x1c52c66d), - TOBN(0xfb0e169f, 0x275264da), TOBN(0x80c2b746, 0xe57d8362), - TOBN(0xedd987f7, 0x49ad7222), TOBN(0xfdc229af, 0x4398ec7b)}, - {TOBN(0xb0d1ed84, 0x52666a58), TOBN(0x4bcb6e00, 0xe6a9c3c2), - TOBN(0x3c57411c, 0x26906408), TOBN(0xcfc20755, 0x13556400), - TOBN(0xa08b1c50, 0x5294dba3), TOBN(0xa30ba286, 0x8b7dd31e), - TOBN(0xd70ba90e, 0x991eca74), TOBN(0x094e142c, 0xe762c2b9), - TOBN(0xb81d783e, 0x979f3925), TOBN(0x1efd130a, 0xaf4c89a7), - TOBN(0x525c2144, 0xfd1bf7fa), TOBN(0x4b296904, 0x1b265a9e), - TOBN(0xed8e9634, 0xb9db65b6), TOBN(0x35c82e32, 0x03599d8a), - TOBN(0xdaa7a54f, 0x403563f3), TOBN(0x9df088ad, 0x022c38ab), - TOBN(0xe5cfb066, 0xbb3fd30a), TOBN(0x429169da, 0xeff0354e), - TOBN(0x809cf852, 0x3524e36c), TOBN(0x136f4fb3, 0x0155be1d), - TOBN(0x4826af01, 0x1fbba712), TOBN(0x6ef0f0b4, 0x506ba1a1), - TOBN(0xd9928b31, 0x77aea73e), TOBN(0xe2bf6af2, 0x5eaa244e), - TOBN(0x8d084f12, 0x4237b64b), TOBN(0x688ebe99, 0xe3ecfd07), - TOBN(0x57b8a70c, 0xf6845dd8), TOBN(0x808fc59c, 0x5da4a325), - TOBN(0xa9032b2b, 0xa3585862), TOBN(0xb66825d5, 0xedf29386), - TOBN(0xb5a5a8db, 0x431ec29b), TOBN(0xbb143a98, 0x3a1e8dc8), - TOBN(0x35ee94ce, 0x12ae381b), TOBN(0x3a7f176c, 0x86ccda90), - TOBN(0xc63a657e, 0x4606eaca), TOBN(0x9ae5a380, 0x43cd04df), - TOBN(0x9bec8d15, 0xed251b46), TOBN(0x1f5d6d30, 0xcaca5e64), - TOBN(0x347b3b35, 0x9ff20f07), TOBN(0x4d65f034, 0xf7e4b286), - TOBN(0x9e93ba24, 0xf111661e), TOBN(0xedced484, 0xb105eb04), - TOBN(0x96dc9ba1, 0xf424b578), TOBN(0xbf8f66b7, 0xe83e9069), - TOBN(0x872d4df4, 0xd7ed8216), TOBN(0xbf07f377, 0x8e2cbecf), - TOBN(0x4281d899, 0x98e73754), TOBN(0xfec85fbb, 0x8aab8708), - TOBN(0x9a3c0dee, 0xa5ba5b0b), TOBN(0xe6a116ce, 0x42d05299), - TOBN(0xae9775fe, 0xe9b02d42), TOBN(0x72b05200, 0xa1545cb6), - TOBN(0xbc506f7d, 0x31a3b4ea), TOBN(0xe5893078, 0x8bbd9b32), - TOBN(0xc8bc5f37, 0xe4b12a97), TOBN(0x6b000c06, 0x4a73b671), - TOBN(0x13b5bf22, 0x765fa7d0), TOBN(0x59805bf0, 0x1d6a5370), - TOBN(0x67a5e29d, 0x4280db98), TOBN(0x4f53916f, 0x776b1ce3), - TOBN(0x714ff61f, 0x33ddf626), TOBN(0x4206238e, 0xa085d103), - TOBN(0x1c50d4b7, 0xe5809ee3), TOBN(0x999f450d, 0x85f8eb1d), - TOBN(0x658a6051, 0xe4c79e9b), TOBN(0x1394cb73, 0xc66a9fea), - TOBN(0x27f31ed5, 0xc6be7b23), TOBN(0xf4c88f36, 0x5aa6f8fe), - TOBN(0x0fb0721f, 0x4aaa499e), TOBN(0x68b3a7d5, 0xe3fb2a6b), - TOBN(0xa788097d, 0x3a92851d), TOBN(0x060e7f8a, 0xe96f4913), - TOBN(0x82eebe73, 0x1a3a93bc), TOBN(0x42bbf465, 0xa21adc1a), - TOBN(0xc10b6fa4, 0xef030efd), TOBN(0x247aa4c7, 0x87b097bb), - TOBN(0x8b8dc632, 0xf60c77da), TOBN(0x6ffbc26a, 0xc223523e), - TOBN(0xa4f6ff11, 0x344579cf), TOBN(0x5825653c, 0x980250f6), - TOBN(0xb2dd097e, 0xbc1aa2b9), TOBN(0x07889393, 0x37a0333a), - TOBN(0x1cf55e71, 0x37a0db38), TOBN(0x2648487f, 0x792c1613), - TOBN(0xdad01336, 0x3fcef261), TOBN(0x6239c81d, 0x0eabf129), - TOBN(0x8ee761de, 0x9d276be2), TOBN(0x406a7a34, 0x1eda6ad3), - TOBN(0x4bf367ba, 0x4a493b31), TOBN(0x54f20a52, 0x9bf7f026), - TOBN(0xb696e062, 0x9795914b), TOBN(0xcddab96d, 0x8bf236ac), - TOBN(0x4ff2c70a, 0xed25ea13), TOBN(0xfa1d09eb, 0x81cbbbe7), - TOBN(0x88fc8c87, 0x468544c5), TOBN(0x847a670d, 0x696b3317), - TOBN(0xf133421e, 0x64bcb626), TOBN(0xaea638c8, 0x26dee0b5), - TOBN(0xd6e7680b, 0xb310346c), TOBN(0xe06f4097, 0xd5d4ced3), - TOBN(0x09961452, 0x7512a30b), TOBN(0xf3d867fd, 0xe589a59a), - TOBN(0x2e73254f, 0x52d0c180), TOBN(0x9063d8a3, 0x333c74ac), - TOBN(0xeda6c595, 0xd314e7bc), TOBN(0x2ee7464b, 0x467899ed), - TOBN(0x1cef423c, 0x0a1ed5d3), TOBN(0x217e76ea, 0x69cc7613), - TOBN(0x27ccce1f, 0xe7cda917), TOBN(0x12d8016b, 0x8a893f16), - TOBN(0xbcd6de84, 0x9fc74f6b), TOBN(0xfa5817e2, 0xf3144e61), - TOBN(0x1f354164, 0x0821ee4c), TOBN(0x1583eab4, 0x0bc61992), - TOBN(0x7490caf6, 0x1d72879f), TOBN(0x998ad9f3, 0xf76ae7b2), - TOBN(0x1e181950, 0xa41157f7), TOBN(0xa9d7e1e6, 0xe8da3a7e), - TOBN(0x963784eb, 0x8426b95f), TOBN(0x0ee4ed6e, 0x542e2a10), - TOBN(0xb79d4cc5, 0xac751e7b), TOBN(0x93f96472, 0xfd4211bd), - TOBN(0x8c72d3d2, 0xc8de4fc6), TOBN(0x7b69cbf5, 0xdf44f064), - TOBN(0x3da90ca2, 0xf4bf94e1), TOBN(0x1a5325f8, 0xf12894e2), - TOBN(0x0a437f6c, 0x7917d60b), TOBN(0x9be70486, 0x96c9cb5d), - TOBN(0xb4d880bf, 0xe1dc5c05), TOBN(0xd738adda, 0xeebeeb57), - TOBN(0x6f0119d3, 0xdf0fe6a3), TOBN(0x5c686e55, 0x66eaaf5a), - TOBN(0x9cb10b50, 0xdfd0b7ec), TOBN(0xbdd0264b, 0x6a497c21), - TOBN(0xfc093514, 0x8c546c96), TOBN(0x58a947fa, 0x79dbf42a), - TOBN(0xc0b48d4e, 0x49ccd6d7), TOBN(0xff8fb02c, 0x88bd5580), - TOBN(0xc75235e9, 0x07d473b2), TOBN(0x4fab1ac5, 0xa2188af3), - TOBN(0x030fa3bc, 0x97576ec0), TOBN(0xe8c946e8, 0x0b7e7d2f), - TOBN(0x40a5c9cc, 0x70305600), TOBN(0x6d8260a9, 0xc8b013b4), - TOBN(0x0368304f, 0x70bba85c), TOBN(0xad090da1, 0xa4a0d311), - TOBN(0x7170e870, 0x2415eec1), TOBN(0xbfba35fe, 0x8461ea47), - TOBN(0x6279019a, 0xc1e91938), TOBN(0xa47638f3, 0x1afc415f), - TOBN(0x36c65cbb, 0xbcba0e0f), TOBN(0x02160efb, 0x034e2c48), - TOBN(0xe6c51073, 0x615cd9e4), TOBN(0x498ec047, 0xf1243c06), - TOBN(0x3e5a8809, 0xb17b3d8c), TOBN(0x5cd99e61, 0x0cc565f1), - TOBN(0x81e312df, 0x7851dafe), TOBN(0xf156f5ba, 0xa79061e2), - TOBN(0x80d62b71, 0x880c590e), TOBN(0xbec9746f, 0x0a39faa1), - TOBN(0x1d98a9c1, 0xc8ed1f7a), TOBN(0x09e43bb5, 0xa81d5ff2), - TOBN(0xd5f00f68, 0x0da0794a), TOBN(0x412050d9, 0x661aa836), - TOBN(0xa89f7c4e, 0x90747e40), TOBN(0x6dc05ebb, 0xb62a3686), - TOBN(0xdf4de847, 0x308e3353), TOBN(0x53868fbb, 0x9fb53bb9), - TOBN(0x2b09d2c3, 0xcfdcf7dd), TOBN(0x41a9fce3, 0x723fcab4), - TOBN(0x73d905f7, 0x07f57ca3), TOBN(0x080f9fb1, 0xac8e1555), - TOBN(0x7c088e84, 0x9ba7a531), TOBN(0x07d35586, 0xed9a147f), - TOBN(0x602846ab, 0xaf48c336), TOBN(0x7320fd32, 0x0ccf0e79), - TOBN(0xaa780798, 0xb18bd1ff), TOBN(0x52c2e300, 0xafdd2905), - TOBN(0xf27ea3d6, 0x434267cd), TOBN(0x8b96d16d, 0x15605b5f), - TOBN(0x7bb31049, 0x4b45706b), TOBN(0xe7f58b8e, 0x743d25f8), - TOBN(0xe9b5e45b, 0x87f30076), TOBN(0xd19448d6, 0x5d053d5a), - TOBN(0x1ecc8cb9, 0xd3210a04), TOBN(0x6bc7d463, 0xdafb5269), - TOBN(0x3e59b10a, 0x67c3489f), TOBN(0x1769788c, 0x65641e1b), - TOBN(0x8a53b82d, 0xbd6cb838), TOBN(0x7066d6e6, 0x236d5f22), - TOBN(0x03aa1c61, 0x6908536e), TOBN(0xc971da0d, 0x66ae9809), - TOBN(0x01b3a86b, 0xc49a2fac), TOBN(0x3b8420c0, 0x3092e77a), - TOBN(0x02057300, 0x7d6fb556), TOBN(0x6941b2a1, 0xbff40a87), - TOBN(0x140b6308, 0x0658ff2a), TOBN(0x87804363, 0x3424ab36), - TOBN(0x0253bd51, 0x5751e299), TOBN(0xc75bcd76, 0x449c3e3a), - TOBN(0x92eb4090, 0x7f8f875d), TOBN(0x9c9d754e, 0x56c26bbf), - TOBN(0x158cea61, 0x8110bbe7), TOBN(0x62a6b802, 0x745f91ea), - TOBN(0xa79c41aa, 0xc6e7394b), TOBN(0x445b6a83, 0xad57ef10), - TOBN(0x0c5277eb, 0x6ea6f40c), TOBN(0x319fe96b, 0x88633365), - TOBN(0x0b0fc61f, 0x385f63cb), TOBN(0x41250c84, 0x22bdd127), - TOBN(0x67d153f1, 0x09e942c2), TOBN(0x60920d08, 0xc021ad5d), - TOBN(0x229f5746, 0x724d81a5), TOBN(0xb7ffb892, 0x5bba3299), - TOBN(0x518c51a1, 0xde413032), TOBN(0x2a9bfe77, 0x3c2fd94c), - TOBN(0xcbcde239, 0x3191f4fd), TOBN(0x43093e16, 0xd3d6ada1), - TOBN(0x184579f3, 0x58769606), TOBN(0x2c94a8b3, 0xd236625c), - TOBN(0x6922b9c0, 0x5c437d8e), TOBN(0x3d4ae423, 0xd8d9f3c8), - TOBN(0xf72c31c1, 0x2e7090a2), TOBN(0x4ac3f5f3, 0xd76a55bd), - TOBN(0x342508fc, 0x6b6af991), TOBN(0x0d527100, 0x1b5cebbd), - TOBN(0xb84740d0, 0xdd440dd7), TOBN(0x748ef841, 0x780162fd), - TOBN(0xa8dbfe0e, 0xdfc6fafb), TOBN(0xeadfdf05, 0xf7300f27), - TOBN(0x7d06555f, 0xfeba4ec9), TOBN(0x12c56f83, 0x9e25fa97), - TOBN(0x77f84203, 0xd39b8c34), TOBN(0xed8b1be6, 0x3125eddb), - TOBN(0x5bbf2441, 0xf6e39dc5), TOBN(0xb00f6ee6, 0x6a5d678a), - TOBN(0xba456ecf, 0x57d0ea99), TOBN(0xdcae0f58, 0x17e06c43), - TOBN(0x01643de4, 0x0f5b4baa), TOBN(0x2c324341, 0xd161b9be), - TOBN(0x80177f55, 0xe126d468), TOBN(0xed325f1f, 0x76748e09), - TOBN(0x6116004a, 0xcfa9bdc2), TOBN(0x2d8607e6, 0x3a9fb468), - TOBN(0x0e573e27, 0x6009d660), TOBN(0x3a525d2e, 0x8d10c5a1), - TOBN(0xd26cb45c, 0x3b9009a0), TOBN(0xb6b0cdc0, 0xde9d7448), - TOBN(0x949c9976, 0xe1337c26), TOBN(0x6faadebd, 0xd73d68e5), - TOBN(0x9e158614, 0xf1b768d9), TOBN(0x22dfa557, 0x9cc4f069), - TOBN(0xccd6da17, 0xbe93c6d6), TOBN(0x24866c61, 0xa504f5b9), - TOBN(0x2121353c, 0x8d694da1), TOBN(0x1c6ca580, 0x0140b8c6), - TOBN(0xc245ad8c, 0xe964021e), TOBN(0xb83bffba, 0x032b82b3), - TOBN(0xfaa220c6, 0x47ef9898), TOBN(0x7e8d3ac6, 0x982c948a), - TOBN(0x1faa2091, 0xbc2d124a), TOBN(0xbd54c3dd, 0x05b15ff4), - TOBN(0x386bf3ab, 0xc87c6fb7), TOBN(0xfb2b0563, 0xfdeb6f66), - TOBN(0x4e77c557, 0x5b45afb4), TOBN(0xe9ded649, 0xefb8912d), - TOBN(0x7ec9bbf5, 0x42f6e557), TOBN(0x2570dfff, 0x62671f00), - TOBN(0x2b3bfb78, 0x88e084bd), TOBN(0xa024b238, 0xf37fe5b4), - TOBN(0x44e7dc04, 0x95649aee), TOBN(0x498ca255, 0x5e7ec1d8), - TOBN(0x3bc766ea, 0xaaa07e86), TOBN(0x0db6facb, 0xf3608586), - TOBN(0xbadd2549, 0xbdc259c8), TOBN(0x95af3c6e, 0x041c649f), - TOBN(0xb36a928c, 0x02e30afb), TOBN(0x9b5356ad, 0x008a88b8), - TOBN(0x4b67a5f1, 0xcf1d9e9d), TOBN(0xc6542e47, 0xa5d8d8ce), - TOBN(0x73061fe8, 0x7adfb6cc), TOBN(0xcc826fd3, 0x98678141), - TOBN(0x00e758b1, 0x3c80515a), TOBN(0x6afe3247, 0x41485083), - TOBN(0x0fcb08b9, 0xb6ae8a75), TOBN(0xb8cf388d, 0x4acf51e1), - TOBN(0x344a5560, 0x6961b9d6), TOBN(0x1a6778b8, 0x6a97fd0c), - TOBN(0xd840fdc1, 0xecc4c7e3), TOBN(0xde9fe47d, 0x16db68cc), - TOBN(0xe95f89de, 0xa3e216aa), TOBN(0x84f1a6a4, 0x9594a8be), - TOBN(0x7ddc7d72, 0x5a7b162b), TOBN(0xc5cfda19, 0xadc817a3), - TOBN(0x80a5d350, 0x78b58d46), TOBN(0x93365b13, 0x82978f19), - TOBN(0x2e44d225, 0x26a1fc90), TOBN(0x0d6d10d2, 0x4d70705d), - TOBN(0xd94b6b10, 0xd70c45f4), TOBN(0x0f201022, 0xb216c079), - TOBN(0xcec966c5, 0x658fde41), TOBN(0xa8d2bc7d, 0x7e27601d), - TOBN(0xbfcce3e1, 0xff230be7), TOBN(0x3394ff6b, 0x0033ffb5), - TOBN(0xd890c509, 0x8132c9af), TOBN(0xaac4b0eb, 0x361e7868), - TOBN(0x5194ded3, 0xe82d15aa), TOBN(0x4550bd2e, 0x23ae6b7d), - TOBN(0x3fda318e, 0xea5399d4), TOBN(0xd989bffa, 0x91638b80), - TOBN(0x5ea124d0, 0xa14aa12d), TOBN(0x1fb1b899, 0x3667b944), - TOBN(0x95ec7969, 0x44c44d6a), TOBN(0x91df144a, 0x57e86137), - TOBN(0x915fd620, 0x73adac44), TOBN(0x8f01732d, 0x59a83801), - TOBN(0xec579d25, 0x3aa0a633), TOBN(0x06de5e7c, 0xc9d6d59c), - TOBN(0xc132f958, 0xb1ef8010), TOBN(0x29476f96, 0xe65c1a02), - TOBN(0x336a77c0, 0xd34c3565), TOBN(0xef1105b2, 0x1b9f1e9e), - TOBN(0x63e6d08b, 0xf9e08002), TOBN(0x9aff2f21, 0xc613809e), - TOBN(0xb5754f85, 0x3a80e75d), TOBN(0xde71853e, 0x6bbda681), - TOBN(0x86f041df, 0x8197fd7a), TOBN(0x8b332e08, 0x127817fa), - TOBN(0x05d99be8, 0xb9c20cda), TOBN(0x89f7aad5, 0xd5cd0c98), - TOBN(0x7ef936fe, 0x5bb94183), TOBN(0x92ca0753, 0xb05cd7f2), - TOBN(0x9d65db11, 0x74a1e035), TOBN(0x02628cc8, 0x13eaea92), - TOBN(0xf2d9e242, 0x49e4fbf2), TOBN(0x94fdfd9b, 0xe384f8b7), - TOBN(0x65f56054, 0x63428c6b), TOBN(0x2f7205b2, 0x90b409a5), - TOBN(0xf778bb78, 0xff45ae11), TOBN(0xa13045be, 0xc5ee53b2), - TOBN(0xe00a14ff, 0x03ef77fe), TOBN(0x689cd59f, 0xffef8bef), - TOBN(0x3578f0ed, 0x1e9ade22), TOBN(0xe99f3ec0, 0x6268b6a8), - TOBN(0xa2057d91, 0xea1b3c3e), TOBN(0x2d1a7053, 0xb8823a4a), - TOBN(0xabbb336a, 0x2cca451e), TOBN(0xcd2466e3, 0x2218bb5d), - TOBN(0x3ac1f42f, 0xc8cb762d), TOBN(0x7e312aae, 0x7690211f), - TOBN(0xebb9bd73, 0x45d07450), TOBN(0x207c4b82, 0x46c2213f), - TOBN(0x99d425c1, 0x375913ec), TOBN(0x94e45e96, 0x67908220), - TOBN(0xc08f3087, 0xcd67dbf6), TOBN(0xa5670fbe, 0xc0887056), - TOBN(0x6717b64a, 0x66f5b8fc), TOBN(0xd5a56aea, 0x786fec28), - TOBN(0xa8c3f55f, 0xc0ff4952), TOBN(0xa77fefae, 0x457ac49b), - TOBN(0x29882d7c, 0x98379d44), TOBN(0xd000bdfb, 0x509edc8a), - TOBN(0xc6f95979, 0xe66fe464), TOBN(0x504a6115, 0xfa61bde0), - TOBN(0x56b3b871, 0xeffea31a), TOBN(0x2d3de26d, 0xf0c21a54), - TOBN(0x21dbff31, 0x834753bf), TOBN(0xe67ecf49, 0x69269d86), - TOBN(0x7a176952, 0x151fe690), TOBN(0x03515804, 0x7f2adb5f), - TOBN(0xee794b15, 0xd1b62a8d), TOBN(0xf004ceec, 0xaae454e6), - TOBN(0x0897ea7c, 0xf0386fac), TOBN(0x3b62ff12, 0xd1fca751), - TOBN(0x154181df, 0x1b7a04ec), TOBN(0x2008e04a, 0xfb5847ec), - TOBN(0xd147148e, 0x41dbd772), TOBN(0x2b419f73, 0x22942654), - TOBN(0x669f30d3, 0xe9c544f7), TOBN(0x52a2c223, 0xc8540149), - TOBN(0x5da9ee14, 0x634dfb02), TOBN(0x5f074ff0, 0xf47869f3), - TOBN(0x74ee878d, 0xa3933acc), TOBN(0xe6510651, 0x4fe35ed1), - TOBN(0xb3eb9482, 0xf1012e7a), TOBN(0x51013cc0, 0xa8a566ae), - TOBN(0xdd5e9243, 0x47c00d3b), TOBN(0x7fde089d, 0x946bb0e5), - TOBN(0x030754fe, 0xc731b4b3), TOBN(0x12a136a4, 0x99fda062), - TOBN(0x7c1064b8, 0x5a1a35bc), TOBN(0xbf1f5763, 0x446c84ef), - TOBN(0xed29a56d, 0xa16d4b34), TOBN(0x7fba9d09, 0xdca21c4f), - TOBN(0x66d7ac00, 0x6d8de486), TOBN(0x60061987, 0x73a2a5e1), - TOBN(0x8b400f86, 0x9da28ff0), TOBN(0x3133f708, 0x43c4599c), - TOBN(0x9911c9b8, 0xee28cb0d), TOBN(0xcd7e2874, 0x8e0af61d), - TOBN(0x5a85f0f2, 0x72ed91fc), TOBN(0x85214f31, 0x9cd4a373), - TOBN(0x881fe5be, 0x1925253c), TOBN(0xd8dc98e0, 0x91e8bc76), - TOBN(0x7120affe, 0x585cc3a2), TOBN(0x724952ed, 0x735bf97a), - TOBN(0x5581e7dc, 0x3eb34581), TOBN(0x5cbff4f2, 0xe52ee57d), - TOBN(0x8d320a0e, 0x87d8cc7b), TOBN(0x9beaa7f3, 0xf1d280d0), - TOBN(0x7a0b9571, 0x9beec704), TOBN(0x9126332e, 0x5b7f0057), - TOBN(0x01fbc1b4, 0x8ed3bd6d), TOBN(0x35bb2c12, 0xd945eb24), - TOBN(0x6404694e, 0x9a8ae255), TOBN(0xb6092eec, 0x8d6abfb3), - TOBN(0x4d76143f, 0xcc058865), TOBN(0x7b0a5af2, 0x6e249922), - TOBN(0x8aef9440, 0x6a50d353), TOBN(0xe11e4bcc, 0x64f0e07a), - TOBN(0x4472993a, 0xa14a90fa), TOBN(0x7706e20c, 0xba0c51d4), - TOBN(0xf403292f, 0x1532672d), TOBN(0x52573bfa, 0x21829382), - TOBN(0x6a7bb6a9, 0x3b5bdb83), TOBN(0x08da65c0, 0xa4a72318), - TOBN(0xc58d22aa, 0x63eb065f), TOBN(0x1717596c, 0x1b15d685), - TOBN(0x112df0d0, 0xb266d88b), TOBN(0xf688ae97, 0x5941945a), - TOBN(0x487386e3, 0x7c292cac), TOBN(0x42f3b50d, 0x57d6985c), - TOBN(0x6da4f998, 0x6a90fc34), TOBN(0xc8f257d3, 0x65ca8a8d), - TOBN(0xc2feabca, 0x6951f762), TOBN(0xe1bc81d0, 0x74c323ac), - TOBN(0x1bc68f67, 0x251a2a12), TOBN(0x10d86587, 0xbe8a70dc), - TOBN(0xd648af7f, 0xf0f84d2e), TOBN(0xf0aa9ebc, 0x6a43ac92), - TOBN(0x69e3be04, 0x27596893), TOBN(0xb6bb02a6, 0x45bf452b), - TOBN(0x0875c11a, 0xf4c698c8), TOBN(0x6652b5c7, 0xbece3794), - TOBN(0x7b3755fd, 0x4f5c0499), TOBN(0x6ea16558, 0xb5532b38), - TOBN(0xd1c69889, 0xa2e96ef7), TOBN(0x9c773c3a, 0x61ed8f48), - TOBN(0x2b653a40, 0x9b323abc), TOBN(0xe26605e1, 0xf0e1d791), - TOBN(0x45d41064, 0x4a87157a), TOBN(0x8f9a78b7, 0xcbbce616), - TOBN(0xcf1e44aa, 0xc407eddd), TOBN(0x81ddd1d8, 0xa35b964f), - TOBN(0x473e339e, 0xfd083999), TOBN(0x6c94bdde, 0x8e796802), - TOBN(0x5a304ada, 0x8545d185), TOBN(0x82ae44ea, 0x738bb8cb), - TOBN(0x628a35e3, 0xdf87e10e), TOBN(0xd3624f3d, 0xa15b9fe3), - TOBN(0xcc44209b, 0x14be4254), TOBN(0x7d0efcbc, 0xbdbc2ea5), - TOBN(0x1f603362, 0x04c37bbe), TOBN(0x21f363f5, 0x56a5852c), - TOBN(0xa1503d1c, 0xa8501550), TOBN(0x2251e0e1, 0xd8ab10bb), - TOBN(0xde129c96, 0x6961c51c), TOBN(0x1f7246a4, 0x81910f68), - TOBN(0x2eb744ee, 0x5f2591f2), TOBN(0x3c47d33f, 0x5e627157), - TOBN(0x4d6d62c9, 0x22f3bd68), TOBN(0x6120a64b, 0xcb8df856), - TOBN(0x3a9ac6c0, 0x7b5d07df), TOBN(0xa92b9558, 0x7ef39783), - TOBN(0xe128a134, 0xab3a9b4f), TOBN(0x41c18807, 0xb1252f05), - TOBN(0xfc7ed089, 0x80ba9b1c), TOBN(0xac8dc6de, 0xc532a9dd), - TOBN(0xbf829cef, 0x55246809), TOBN(0x101b784f, 0x5b4ee80f), - TOBN(0xc09945bb, 0xb6f11603), TOBN(0x57b09dbe, 0x41d2801e), - TOBN(0xfba5202f, 0xa97534a8), TOBN(0x7fd8ae5f, 0xc17b9614), - TOBN(0xa50ba666, 0x78308435), TOBN(0x9572f77c, 0xd3868c4d), - TOBN(0x0cef7bfd, 0x2dd7aab0), TOBN(0xe7958e08, 0x2c7c79ff), - TOBN(0x81262e42, 0x25346689), TOBN(0x716da290, 0xb07c7004), - TOBN(0x35f911ea, 0xb7950ee3), TOBN(0x6fd72969, 0x261d21b5), - TOBN(0x52389803, 0x08b640d3), TOBN(0x5b0026ee, 0x887f12a1), - TOBN(0x20e21660, 0x742e9311), TOBN(0x0ef6d541, 0x5ff77ff7), - TOBN(0x969127f0, 0xf9c41135), TOBN(0xf21d60c9, 0x68a64993), - TOBN(0x656e5d0c, 0xe541875c), TOBN(0xf1e0f84e, 0xa1d3c233), - TOBN(0x9bcca359, 0x06002d60), TOBN(0xbe2da60c, 0x06191552), - TOBN(0x5da8bbae, 0x61181ec3), TOBN(0x9f04b823, 0x65806f19), - TOBN(0xf1604a7d, 0xd4b79bb8), TOBN(0xaee806fb, 0x52c878c8), - TOBN(0x34144f11, 0x8d47b8e8), TOBN(0x72edf52b, 0x949f9054), - TOBN(0xebfca84e, 0x2127015a), TOBN(0x9051d0c0, 0x9cb7cef3), - TOBN(0x86e8fe58, 0x296deec8), TOBN(0x33b28188, 0x41010d74)}, - {TOBN(0x01079383, 0x171b445f), TOBN(0x9bcf21e3, 0x8131ad4c), - TOBN(0x8cdfe205, 0xc93987e8), TOBN(0xe63f4152, 0xc92e8c8f), - TOBN(0x729462a9, 0x30add43d), TOBN(0x62ebb143, 0xc980f05a), - TOBN(0x4f3954e5, 0x3b06e968), TOBN(0xfe1d75ad, 0x242cf6b1), - TOBN(0x5f95c6c7, 0xaf8685c8), TOBN(0xd4c1c8ce, 0x2f8f01aa), - TOBN(0xc44bbe32, 0x2574692a), TOBN(0xb8003478, 0xd4a4a068), - TOBN(0x7c8fc6e5, 0x2eca3cdb), TOBN(0xea1db16b, 0xec04d399), - TOBN(0xb05bc82e, 0x8f2bc5cf), TOBN(0x763d517f, 0xf44793d2), - TOBN(0x4451c1b8, 0x08bd98d0), TOBN(0x644b1cd4, 0x6575f240), - TOBN(0x6907eb33, 0x7375d270), TOBN(0x56c8bebd, 0xfa2286bd), - TOBN(0xc713d2ac, 0xc4632b46), TOBN(0x17da427a, 0xafd60242), - TOBN(0x313065b7, 0xc95c7546), TOBN(0xf8239898, 0xbf17a3de), - TOBN(0xf3b7963f, 0x4c830320), TOBN(0x842c7aa0, 0x903203e3), - TOBN(0xaf22ca0a, 0xe7327afb), TOBN(0x38e13092, 0x967609b6), - TOBN(0x73b8fb62, 0x757558f1), TOBN(0x3cc3e831, 0xf7eca8c1), - TOBN(0xe4174474, 0xf6331627), TOBN(0xa77989ca, 0xc3c40234), - TOBN(0xe5fd17a1, 0x44a081e0), TOBN(0xd797fb7d, 0xb70e296a), - TOBN(0x2b472b30, 0x481f719c), TOBN(0x0e632a98, 0xfe6f8c52), - TOBN(0x89ccd116, 0xc5f0c284), TOBN(0xf51088af, 0x2d987c62), - TOBN(0x2a2bccda, 0x4c2de6cf), TOBN(0x810f9efe, 0xf679f0f9), - TOBN(0xb0f394b9, 0x7ffe4b3e), TOBN(0x0b691d21, 0xe5fa5d21), - TOBN(0xb0bd7747, 0x9dfbbc75), TOBN(0xd2830fda, 0xfaf78b00), - TOBN(0xf78c249c, 0x52434f57), TOBN(0x4b1f7545, 0x98096dab), - TOBN(0x73bf6f94, 0x8ff8c0b3), TOBN(0x34aef03d, 0x454e134c), - TOBN(0xf8d151f4, 0xb7ac7ec5), TOBN(0xd6ceb95a, 0xe50da7d5), - TOBN(0xa1b492b0, 0xdc3a0eb8), TOBN(0x75157b69, 0xb3dd2863), - TOBN(0xe2c4c74e, 0xc5413d62), TOBN(0xbe329ff7, 0xbc5fc4c7), - TOBN(0x835a2aea, 0x60fa9dda), TOBN(0xf117f5ad, 0x7445cb87), - TOBN(0xae8317f4, 0xb0166f7a), TOBN(0xfbd3e3f7, 0xceec74e6), - TOBN(0xfdb516ac, 0xe0874bfd), TOBN(0x3d846019, 0xc681f3a3), - TOBN(0x0b12ee5c, 0x7c1620b0), TOBN(0xba68b4dd, 0x2b63c501), - TOBN(0xac03cd32, 0x6668c51e), TOBN(0x2a6279f7, 0x4e0bcb5b), - TOBN(0x17bd69b0, 0x6ae85c10), TOBN(0x72946979, 0x1dfdd3a6), - TOBN(0xd9a03268, 0x2c078bec), TOBN(0x41c6a658, 0xbfd68a52), - TOBN(0xcdea1024, 0x0e023900), TOBN(0xbaeec121, 0xb10d144d), - TOBN(0x5a600e74, 0x058ab8dc), TOBN(0x1333af21, 0xbb89ccdd), - TOBN(0xdf25eae0, 0x3aaba1f1), TOBN(0x2cada16e, 0x3b7144cf), - TOBN(0x657ee27d, 0x71ab98bc), TOBN(0x99088b4c, 0x7a6fc96e), - TOBN(0x05d5c0a0, 0x3549dbd4), TOBN(0x42cbdf8f, 0xf158c3ac), - TOBN(0x3fb6b3b0, 0x87edd685), TOBN(0x22071cf6, 0x86f064d0), - TOBN(0xd2d6721f, 0xff2811e5), TOBN(0xdb81b703, 0xfe7fae8c), - TOBN(0x3cfb74ef, 0xd3f1f7bb), TOBN(0x0cdbcd76, 0x16cdeb5d), - TOBN(0x4f39642a, 0x566a808c), TOBN(0x02b74454, 0x340064d6), - TOBN(0xfabbadca, 0x0528fa6f), TOBN(0xe4c3074c, 0xd3fc0bb6), - TOBN(0xb32cb8b0, 0xb796d219), TOBN(0xc3e95f4f, 0x34741dd9), - TOBN(0x87212125, 0x68edf6f5), TOBN(0x7a03aee4, 0xa2b9cb8e), - TOBN(0x0cd3c376, 0xf53a89aa), TOBN(0x0d8af9b1, 0x948a28dc), - TOBN(0xcf86a3f4, 0x902ab04f), TOBN(0x8aacb62a, 0x7f42002d), - TOBN(0x106985eb, 0xf62ffd52), TOBN(0xe670b54e, 0x5797bf10), - TOBN(0x4b405209, 0xc5e30aef), TOBN(0x12c97a20, 0x4365b5e9), - TOBN(0x104646ce, 0x1fe32093), TOBN(0x13cb4ff6, 0x3907a8c9), - TOBN(0x8b9f30d1, 0xd46e726b), TOBN(0xe1985e21, 0xaba0f499), - TOBN(0xc573dea9, 0x10a230cd), TOBN(0x24f46a93, 0xcd30f947), - TOBN(0xf2623fcf, 0xabe2010a), TOBN(0x3f278cb2, 0x73f00e4f), - TOBN(0xed55c67d, 0x50b920eb), TOBN(0xf1cb9a2d, 0x8e760571), - TOBN(0x7c50d109, 0x0895b709), TOBN(0x4207cf07, 0x190d4369), - TOBN(0x3b027e81, 0xc4127fe1), TOBN(0xa9f8b9ad, 0x3ae9c566), - TOBN(0x5ab10851, 0xacbfbba5), TOBN(0xa747d648, 0x569556f5), - TOBN(0xcc172b5c, 0x2ba97bf7), TOBN(0x15e0f77d, 0xbcfa3324), - TOBN(0xa345b797, 0x7686279d), TOBN(0x5a723480, 0xe38003d3), - TOBN(0xfd8e139f, 0x8f5fcda8), TOBN(0xf3e558c4, 0xbdee5bfd), - TOBN(0xd76cbaf4, 0xe33f9f77), TOBN(0x3a4c97a4, 0x71771969), - TOBN(0xda27e84b, 0xf6dce6a7), TOBN(0xff373d96, 0x13e6c2d1), - TOBN(0xf115193c, 0xd759a6e9), TOBN(0x3f9b7025, 0x63d2262c), - TOBN(0xd9764a31, 0x317cd062), TOBN(0x30779d8e, 0x199f8332), - TOBN(0xd8074106, 0x16b11b0b), TOBN(0x7917ab9f, 0x78aeaed8), - TOBN(0xb67a9cbe, 0x28fb1d8e), TOBN(0x2e313563, 0x136eda33), - TOBN(0x010b7069, 0xa371a86c), TOBN(0x44d90fa2, 0x6744e6b7), - TOBN(0x68190867, 0xd6b3e243), TOBN(0x9fe6cd9d, 0x59048c48), - TOBN(0xb900b028, 0x95731538), TOBN(0xa012062f, 0x32cae04f), - TOBN(0x8107c8bc, 0x9399d082), TOBN(0x47e8c54a, 0x41df12e2), - TOBN(0x14ba5117, 0xb6ef3f73), TOBN(0x22260bea, 0x81362f0b), - TOBN(0x90ea261e, 0x1a18cc20), TOBN(0x2192999f, 0x2321d636), - TOBN(0xef64d314, 0xe311b6a0), TOBN(0xd7401e4c, 0x3b54a1f5), - TOBN(0x19019983, 0x6fbca2ba), TOBN(0x46ad3293, 0x8fbffc4b), - TOBN(0xa142d3f6, 0x3786bf40), TOBN(0xeb5cbc26, 0xb67039fc), - TOBN(0x9cb0ae6c, 0x252bd479), TOBN(0x05e0f88a, 0x12b5848f), - TOBN(0x78f6d2b2, 0xa5c97663), TOBN(0x6f6e149b, 0xc162225c), - TOBN(0xe602235c, 0xde601a89), TOBN(0xd17bbe98, 0xf373be1f), - TOBN(0xcaf49a5b, 0xa8471827), TOBN(0x7e1a0a85, 0x18aaa116), - TOBN(0x6c833196, 0x270580c3), TOBN(0x1e233839, 0xf1c98a14), - TOBN(0x67b2f7b4, 0xae34e0a5), TOBN(0x47ac8745, 0xd8ce7289), - TOBN(0x2b74779a, 0x100dd467), TOBN(0x274a4337, 0x4ee50d09), - TOBN(0x603dcf13, 0x83608bc9), TOBN(0xcd9da6c3, 0xc89e8388), - TOBN(0x2660199f, 0x355116ac), TOBN(0xcc38bb59, 0xb6d18eed), - TOBN(0x3075f31f, 0x2f4bc071), TOBN(0x9774457f, 0x265dc57e), - TOBN(0x06a6a9c8, 0xc6db88bb), TOBN(0x6429d07f, 0x4ec98e04), - TOBN(0x8d05e57b, 0x05ecaa8b), TOBN(0x20f140b1, 0x7872ea7b), - TOBN(0xdf8c0f09, 0xca494693), TOBN(0x48d3a020, 0xf252e909), - TOBN(0x4c5c29af, 0x57b14b12), TOBN(0x7e6fa37d, 0xbf47ad1c), - TOBN(0x66e7b506, 0x49a0c938), TOBN(0xb72c0d48, 0x6be5f41f), - TOBN(0x6a6242b8, 0xb2359412), TOBN(0xcd35c774, 0x8e859480), - TOBN(0x12536fea, 0x87baa627), TOBN(0x58c1fec1, 0xf72aa680), - TOBN(0x6c29b637, 0x601e5dc9), TOBN(0x9e3c3c1c, 0xde9e01b9), - TOBN(0xefc8127b, 0x2bcfe0b0), TOBN(0x35107102, 0x2a12f50d), - TOBN(0x6ccd6cb1, 0x4879b397), TOBN(0xf792f804, 0xf8a82f21), - TOBN(0x509d4804, 0xa9b46402), TOBN(0xedddf85d, 0xc10f0850), - TOBN(0x928410dc, 0x4b6208aa), TOBN(0xf6229c46, 0x391012dc), - TOBN(0xc5a7c41e, 0x7727b9b6), TOBN(0x289e4e4b, 0xaa444842), - TOBN(0x049ba1d9, 0xe9a947ea), TOBN(0x44f9e47f, 0x83c8debc), - TOBN(0xfa77a1fe, 0x611f8b8e), TOBN(0xfd2e416a, 0xf518f427), - TOBN(0xc5fffa70, 0x114ebac3), TOBN(0xfe57c4e9, 0x5d89697b), - TOBN(0xfdd053ac, 0xb1aaf613), TOBN(0x31df210f, 0xea585a45), - TOBN(0x318cc10e, 0x24985034), TOBN(0x1a38efd1, 0x5f1d6130), - TOBN(0xbf86f237, 0x0b1e9e21), TOBN(0xb258514d, 0x1dbe88aa), - TOBN(0x1e38a588, 0x90c1baf9), TOBN(0x2936a01e, 0xbdb9b692), - TOBN(0xd576de98, 0x6dd5b20c), TOBN(0xb586bf71, 0x70f98ecf), - TOBN(0xcccf0f12, 0xc42d2fd7), TOBN(0x8717e61c, 0xfb35bd7b), - TOBN(0x8b1e5722, 0x35e6fc06), TOBN(0x3477728f, 0x0b3e13d5), - TOBN(0x150c294d, 0xaa8a7372), TOBN(0xc0291d43, 0x3bfa528a), - TOBN(0xc6c8bc67, 0xcec5a196), TOBN(0xdeeb31e4, 0x5c2e8a7c), - TOBN(0xba93e244, 0xfb6e1c51), TOBN(0xb9f8b71b, 0x2e28e156), - TOBN(0xce65a287, 0x968a2ab9), TOBN(0xe3c5ce69, 0x46bbcb1f), - TOBN(0xf8c835b9, 0xe7ae3f30), TOBN(0x16bbee26, 0xff72b82b), - TOBN(0x665e2017, 0xfd42cd22), TOBN(0x1e139970, 0xf8b1d2a0), - TOBN(0x125cda29, 0x79204932), TOBN(0x7aee94a5, 0x49c3bee5), - TOBN(0x68c70160, 0x89821a66), TOBN(0xf7c37678, 0x8f981669), - TOBN(0xd90829fc, 0x48cc3645), TOBN(0x346af049, 0xd70addfc), - TOBN(0x2057b232, 0x370bf29c), TOBN(0xf90c73ce, 0x42e650ee), - TOBN(0xe03386ea, 0xa126ab90), TOBN(0x0e266e7e, 0x975a087b), - TOBN(0x80578eb9, 0x0fca65d9), TOBN(0x7e2989ea, 0x16af45b8), - TOBN(0x7438212d, 0xcac75a4e), TOBN(0x38c7ca39, 0x4fef36b8), - TOBN(0x8650c494, 0xd402676a), TOBN(0x26ab5a66, 0xf72c7c48), - TOBN(0x4e6cb426, 0xce3a464e), TOBN(0xf8f99896, 0x2b72f841), - TOBN(0x8c318491, 0x1a335cc8), TOBN(0x563459ba, 0x6a5913e4), - TOBN(0x1b920d61, 0xc7b32919), TOBN(0x805ab8b6, 0xa02425ad), - TOBN(0x2ac512da, 0x8d006086), TOBN(0x6ca4846a, 0xbcf5c0fd), - TOBN(0xafea51d8, 0xac2138d7), TOBN(0xcb647545, 0x344cd443), - TOBN(0x0429ee8f, 0xbd7d9040), TOBN(0xee66a2de, 0x819b9c96), - TOBN(0x54f9ec25, 0xdea7d744), TOBN(0x2ffea642, 0x671721bb), - TOBN(0x4f19dbd1, 0x114344ea), TOBN(0x04304536, 0xfd0dbc8b), - TOBN(0x014b50aa, 0x29ec7f91), TOBN(0xb5fc22fe, 0xbb06014d), - TOBN(0x60d963a9, 0x1ee682e0), TOBN(0xdf48abc0, 0xfe85c727), - TOBN(0x0cadba13, 0x2e707c2d), TOBN(0xde608d3a, 0xa645aeff), - TOBN(0x05f1c28b, 0xedafd883), TOBN(0x3c362ede, 0xbd94de1f), - TOBN(0x8dd0629d, 0x13593e41), TOBN(0x0a5e736f, 0x766d6eaf), - TOBN(0xbfa92311, 0xf68cf9d1), TOBN(0xa4f9ef87, 0xc1797556), - TOBN(0x10d75a1f, 0x5601c209), TOBN(0x651c374c, 0x09b07361), - TOBN(0x49950b58, 0x88b5cead), TOBN(0x0ef00058, 0x6fa9dbaa), - TOBN(0xf51ddc26, 0x4e15f33a), TOBN(0x1f8b5ca6, 0x2ef46140), - TOBN(0x343ac0a3, 0xee9523f0), TOBN(0xbb75eab2, 0x975ea978), - TOBN(0x1bccf332, 0x107387f4), TOBN(0x790f9259, 0x9ab0062e), - TOBN(0xf1a363ad, 0x1e4f6a5f), TOBN(0x06e08b84, 0x62519a50), - TOBN(0x60915187, 0x7265f1ee), TOBN(0x6a80ca34, 0x93ae985e), - TOBN(0x81b29768, 0xaaba4864), TOBN(0xb13cabf2, 0x8d52a7d6), - TOBN(0xb5c36348, 0x8ead03f1), TOBN(0xc932ad95, 0x81c7c1c0), - TOBN(0x5452708e, 0xcae1e27b), TOBN(0x9dac4269, 0x1b0df648), - TOBN(0x233e3f0c, 0xdfcdb8bc), TOBN(0xe6ceccdf, 0xec540174), - TOBN(0xbd0d845e, 0x95081181), TOBN(0xcc8a7920, 0x699355d5), - TOBN(0x111c0f6d, 0xc3b375a8), TOBN(0xfd95bc6b, 0xfd51e0dc), - TOBN(0x4a106a26, 0x6888523a), TOBN(0x4d142bd6, 0xcb01a06d), - TOBN(0x79bfd289, 0xadb9b397), TOBN(0x0bdbfb94, 0xe9863914), - TOBN(0x29d8a229, 0x1660f6a6), TOBN(0x7f6abcd6, 0x551c042d), - TOBN(0x13039deb, 0x0ac3ffe8), TOBN(0xa01be628, 0xec8523fb), - TOBN(0x6ea34103, 0x0ca1c328), TOBN(0xc74114bd, 0xb903928e), - TOBN(0x8aa4ff4e, 0x9e9144b0), TOBN(0x7064091f, 0x7f9a4b17), - TOBN(0xa3f4f521, 0xe447f2c4), TOBN(0x81b8da7a, 0x604291f0), - TOBN(0xd680bc46, 0x7d5926de), TOBN(0x84f21fd5, 0x34a1202f), - TOBN(0x1d1e3181, 0x4e9df3d8), TOBN(0x1ca4861a, 0x39ab8d34), - TOBN(0x809ddeec, 0x5b19aa4a), TOBN(0x59f72f7e, 0x4d329366), - TOBN(0xa2f93f41, 0x386d5087), TOBN(0x40bf739c, 0xdd67d64f), - TOBN(0xb4494205, 0x66702158), TOBN(0xc33c65be, 0x73b1e178), - TOBN(0xcdcd657c, 0x38ca6153), TOBN(0x97f4519a, 0xdc791976), - TOBN(0xcc7c7f29, 0xcd6e1f39), TOBN(0x38de9cfb, 0x7e3c3932), - TOBN(0xe448eba3, 0x7b793f85), TOBN(0xe9f8dbf9, 0xf067e914), - TOBN(0xc0390266, 0xf114ae87), TOBN(0x39ed75a7, 0xcd6a8e2a), - TOBN(0xadb14848, 0x7ffba390), TOBN(0x67f8cb8b, 0x6af9bc09), - TOBN(0x322c3848, 0x9c7476db), TOBN(0xa320fecf, 0x52a538d6), - TOBN(0xe0493002, 0xb2aced2b), TOBN(0xdfba1809, 0x616bd430), - TOBN(0x531c4644, 0xc331be70), TOBN(0xbc04d32e, 0x90d2e450), - TOBN(0x1805a0d1, 0x0f9f142d), TOBN(0x2c44a0c5, 0x47ee5a23), - TOBN(0x31875a43, 0x3989b4e3), TOBN(0x6b1949fd, 0x0c063481), - TOBN(0x2dfb9e08, 0xbe0f4492), TOBN(0x3ff0da03, 0xe9d5e517), - TOBN(0x03dbe9a1, 0xf79466a8), TOBN(0x0b87bcd0, 0x15ea9932), - TOBN(0xeb64fc83, 0xab1f58ab), TOBN(0x6d9598da, 0x817edc8a), - TOBN(0x699cff66, 0x1d3b67e5), TOBN(0x645c0f29, 0x92635853), - TOBN(0x253cdd82, 0xeabaf21c), TOBN(0x82b9602a, 0x2241659e), - TOBN(0x2cae07ec, 0x2d9f7091), TOBN(0xbe4c720c, 0x8b48cd9b), - TOBN(0x6ce5bc03, 0x6f08d6c9), TOBN(0x36e8a997, 0xaf10bf40), - TOBN(0x83422d21, 0x3e10ff12), TOBN(0x7b26d3eb, 0xbcc12494), - TOBN(0xb240d2d0, 0xc9469ad6), TOBN(0xc4a11b4d, 0x30afa05b), - TOBN(0x4b604ace, 0xdd6ba286), TOBN(0x18486600, 0x3ee2864c), - TOBN(0x5869d6ba, 0x8d9ce5be), TOBN(0x0d8f68c5, 0xff4bfb0d), - TOBN(0xb69f210b, 0x5700cf73), TOBN(0x61f6653a, 0x6d37c135), - TOBN(0xff3d432b, 0x5aff5a48), TOBN(0x0d81c4b9, 0x72ba3a69), - TOBN(0xee879ae9, 0xfa1899ef), TOBN(0xbac7e2a0, 0x2d6acafd), - TOBN(0xd6d93f6c, 0x1c664399), TOBN(0x4c288de1, 0x5bcb135d), - TOBN(0x83031dab, 0x9dab7cbf), TOBN(0xfe23feb0, 0x3abbf5f0), - TOBN(0x9f1b2466, 0xcdedca85), TOBN(0x140bb710, 0x1a09538c), - TOBN(0xac8ae851, 0x5e11115d), TOBN(0x0d63ff67, 0x6f03f59e), - TOBN(0x755e5551, 0x7d234afb), TOBN(0x61c2db4e, 0x7e208fc1), - TOBN(0xaa9859ce, 0xf28a4b5d), TOBN(0xbdd6d4fc, 0x34af030f), - TOBN(0xd1c4a26d, 0x3be01cb1), TOBN(0x9ba14ffc, 0x243aa07c), - TOBN(0xf95cd3a9, 0xb2503502), TOBN(0xe379bc06, 0x7d2a93ab), - TOBN(0x3efc18e9, 0xd4ca8d68), TOBN(0x083558ec, 0x80bb412a), - TOBN(0xd903b940, 0x9645a968), TOBN(0xa499f0b6, 0x9ba6054f), - TOBN(0x208b573c, 0xb8349abe), TOBN(0x3baab3e5, 0x30b4fc1c), - TOBN(0x87e978ba, 0xcb524990), TOBN(0x3524194e, 0xccdf0e80), - TOBN(0x62711725, 0x7d4bcc42), TOBN(0xe90a3d9b, 0xb90109ba), - TOBN(0x3b1bdd57, 0x1323e1e0), TOBN(0xb78e9bd5, 0x5eae1599), - TOBN(0x0794b746, 0x9e03d278), TOBN(0x80178605, 0xd70e6297), - TOBN(0x171792f8, 0x99c97855), TOBN(0x11b393ee, 0xf5a86b5c), - TOBN(0x48ef6582, 0xd8884f27), TOBN(0xbd44737a, 0xbf19ba5f), - TOBN(0x8698de4c, 0xa42062c6), TOBN(0x8975eb80, 0x61ce9c54), - TOBN(0xd50e57c7, 0xd7fe71f3), TOBN(0x15342190, 0xbc97ce38), - TOBN(0x51bda2de, 0x4df07b63), TOBN(0xba12aeae, 0x200eb87d), - TOBN(0xabe135d2, 0xa9b4f8f6), TOBN(0x04619d65, 0xfad6d99c), - TOBN(0x4a6683a7, 0x7994937c), TOBN(0x7a778c8b, 0x6f94f09a), - TOBN(0x8c508623, 0x20a71b89), TOBN(0x241a2aed, 0x1c229165), - TOBN(0x352be595, 0xaaf83a99), TOBN(0x9fbfee7f, 0x1562bac8), - TOBN(0xeaf658b9, 0x5c4017e3), TOBN(0x1dc7f9e0, 0x15120b86), - TOBN(0xd84f13dd, 0x4c034d6f), TOBN(0x283dd737, 0xeaea3038), - TOBN(0x197f2609, 0xcd85d6a2), TOBN(0x6ebbc345, 0xfae60177), - TOBN(0xb80f031b, 0x4e12fede), TOBN(0xde55d0c2, 0x07a2186b), - TOBN(0x1fb3e37f, 0x24dcdd5a), TOBN(0x8d602da5, 0x7ed191fb), - TOBN(0x108fb056, 0x76023e0d), TOBN(0x70178c71, 0x459c20c0), - TOBN(0xfad5a386, 0x3fe54cf0), TOBN(0xa4a3ec4f, 0x02bbb475), - TOBN(0x1aa5ec20, 0x919d94d7), TOBN(0x5d3b63b5, 0xa81e4ab3), - TOBN(0x7fa733d8, 0x5ad3d2af), TOBN(0xfbc586dd, 0xd1ac7a37), - TOBN(0x282925de, 0x40779614), TOBN(0xfe0ffffb, 0xe74a242a), - TOBN(0x3f39e67f, 0x906151e5), TOBN(0xcea27f5f, 0x55e10649), - TOBN(0xdca1d4e1, 0xc17cf7b7), TOBN(0x0c326d12, 0x2fe2362d), - TOBN(0x05f7ac33, 0x7dd35df3), TOBN(0x0c3b7639, 0xc396dbdf), - TOBN(0x0912f5ac, 0x03b7db1c), TOBN(0x9dea4b70, 0x5c9ed4a9), - TOBN(0x475e6e53, 0xaae3f639), TOBN(0xfaba0e7c, 0xfc278bac), - TOBN(0x16f9e221, 0x9490375f), TOBN(0xaebf9746, 0xa5a7ed0a), - TOBN(0x45f9af3f, 0xf41ad5d6), TOBN(0x03c4623c, 0xb2e99224), - TOBN(0x82c5bb5c, 0xb3cf56aa), TOBN(0x64311819, 0x34567ed3), - TOBN(0xec57f211, 0x8be489ac), TOBN(0x2821895d, 0xb9a1104b), - TOBN(0x610dc875, 0x6064e007), TOBN(0x8e526f3f, 0x5b20d0fe), - TOBN(0x6e71ca77, 0x5b645aee), TOBN(0x3d1dcb9f, 0x800e10ff), - TOBN(0x36b51162, 0x189cf6de), TOBN(0x2c5a3e30, 0x6bb17353), - TOBN(0xc186cd3e, 0x2a6c6fbf), TOBN(0xa74516fa, 0x4bf97906), - TOBN(0x5b4b8f4b, 0x279d6901), TOBN(0x0c4e57b4, 0x2b573743), - TOBN(0x75fdb229, 0xb6e386b6), TOBN(0xb46793fd, 0x99deac27), - TOBN(0xeeec47ea, 0xcf712629), TOBN(0xe965f3c4, 0xcbc3b2dd), - TOBN(0x8dd1fb83, 0x425c6559), TOBN(0x7fc00ee6, 0x0af06fda), - TOBN(0xe98c9225, 0x33d956df), TOBN(0x0f1ef335, 0x4fbdc8a2), - TOBN(0x2abb5145, 0xb79b8ea2), TOBN(0x40fd2945, 0xbdbff288), - TOBN(0x6a814ac4, 0xd7185db7), TOBN(0xc4329d6f, 0xc084609a), - TOBN(0xc9ba7b52, 0xed1be45d), TOBN(0x891dd20d, 0xe4cd2c74), - TOBN(0x5a4d4a7f, 0x824139b1), TOBN(0x66c17716, 0xb873c710), - TOBN(0x5e5bc141, 0x2843c4e0), TOBN(0xd5ac4817, 0xb97eb5bf), - TOBN(0xc0f8af54, 0x450c95c7), TOBN(0xc91b3fa0, 0x318406c5), - TOBN(0x360c340a, 0xab9d97f8), TOBN(0xfb57bd07, 0x90a2d611), - TOBN(0x4339ae3c, 0xa6a6f7e5), TOBN(0x9c1fcd2a, 0x2feb8a10), - TOBN(0x972bcca9, 0xc7ea7432), TOBN(0x1b0b924c, 0x308076f6), - TOBN(0x80b2814a, 0x2a5b4ca5), TOBN(0x2f78f55b, 0x61ef3b29), - TOBN(0xf838744a, 0xc18a414f), TOBN(0xc611eaae, 0x903d0a86), - TOBN(0x94dabc16, 0x2a453f55), TOBN(0xe6f2e3da, 0x14efb279), - TOBN(0x5b7a6017, 0x9320dc3c), TOBN(0x692e382f, 0x8df6b5a4), - TOBN(0x3f5e15e0, 0x2d40fa90), TOBN(0xc87883ae, 0x643dd318), - TOBN(0x511053e4, 0x53544774), TOBN(0x834d0ecc, 0x3adba2bc), - TOBN(0x4215d7f7, 0xbae371f5), TOBN(0xfcfd57bf, 0x6c8663bc), - TOBN(0xded2383d, 0xd6901b1d), TOBN(0x3b49fbb4, 0xb5587dc3), - TOBN(0xfd44a08d, 0x07625f62), TOBN(0x3ee4d65b, 0x9de9b762)}, - {TOBN(0x64e5137d, 0x0d63d1fa), TOBN(0x658fc052, 0x02a9d89f), - TOBN(0x48894874, 0x50436309), TOBN(0xe9ae30f8, 0xd598da61), - TOBN(0x2ed710d1, 0x818baf91), TOBN(0xe27e9e06, 0x8b6a0c20), - TOBN(0x1e28dcfb, 0x1c1a6b44), TOBN(0x883acb64, 0xd6ac57dc), - TOBN(0x8735728d, 0xc2c6ff70), TOBN(0x79d6122f, 0xc5dc2235), - TOBN(0x23f5d003, 0x19e277f9), TOBN(0x7ee84e25, 0xdded8cc7), - TOBN(0x91a8afb0, 0x63cd880a), TOBN(0x3f3ea7c6, 0x3574af60), - TOBN(0x0cfcdc84, 0x02de7f42), TOBN(0x62d0792f, 0xb31aa152), - TOBN(0x8e1b4e43, 0x8a5807ce), TOBN(0xad283893, 0xe4109a7e), - TOBN(0xc30cc9cb, 0xafd59dda), TOBN(0xf65f36c6, 0x3d8d8093), - TOBN(0xdf31469e, 0xa60d32b2), TOBN(0xee93df4b, 0x3e8191c8), - TOBN(0x9c1017c5, 0x355bdeb5), TOBN(0xd2623185, 0x8616aa28), - TOBN(0xb02c83f9, 0xdec31a21), TOBN(0x988c8b23, 0x6ad9d573), - TOBN(0x53e983ae, 0xa57be365), TOBN(0xe968734d, 0x646f834e), - TOBN(0x9137ea8f, 0x5da6309b), TOBN(0x10f3a624, 0xc1f1ce16), - TOBN(0x782a9ea2, 0xca440921), TOBN(0xdf94739e, 0x5b46f1b5), - TOBN(0x9f9be006, 0xcce85c9b), TOBN(0x360e70d6, 0xa4c7c2d3), - TOBN(0x2cd5beea, 0xaefa1e60), TOBN(0x64cf63c0, 0x8c3d2b6d), - TOBN(0xfb107fa3, 0xe1cf6f90), TOBN(0xb7e937c6, 0xd5e044e6), - TOBN(0x74e8ca78, 0xce34db9f), TOBN(0x4f8b36c1, 0x3e210bd0), - TOBN(0x1df165a4, 0x34a35ea8), TOBN(0x3418e0f7, 0x4d4412f6), - TOBN(0x5af1f8af, 0x518836c3), TOBN(0x42ceef4d, 0x130e1965), - TOBN(0x5560ca0b, 0x543a1957), TOBN(0xc33761e5, 0x886cb123), - TOBN(0x66624b1f, 0xfe98ed30), TOBN(0xf772f4bf, 0x1090997d), - TOBN(0xf4e540bb, 0x4885d410), TOBN(0x7287f810, 0x9ba5f8d7), - TOBN(0x22d0d865, 0xde98dfb1), TOBN(0x49ff51a1, 0xbcfbb8a3), - TOBN(0xb6b6fa53, 0x6bc3012e), TOBN(0x3d31fd72, 0x170d541d), - TOBN(0x8018724f, 0x4b0f4966), TOBN(0x79e7399f, 0x87dbde07), - TOBN(0x56f8410e, 0xf4f8b16a), TOBN(0x97241afe, 0xc47b266a), - TOBN(0x0a406b8e, 0x6d9c87c1), TOBN(0x803f3e02, 0xcd42ab1b), - TOBN(0x7f0309a8, 0x04dbec69), TOBN(0xa83b85f7, 0x3bbad05f), - TOBN(0xc6097273, 0xad8e197f), TOBN(0xc097440e, 0x5067adc1), - TOBN(0x730eafb6, 0x3524ff16), TOBN(0xd7f9b51e, 0x823fc6ce), - TOBN(0x27bd0d32, 0x443e4ac0), TOBN(0x40c59ad9, 0x4d66f217), - TOBN(0x6c33136f, 0x17c387a4), TOBN(0x5043b8d5, 0xeb86804d), - TOBN(0x74970312, 0x675a73c9), TOBN(0x838fdb31, 0xf16669b6), - TOBN(0xc507b6dd, 0x418e7ddd), TOBN(0x39888d93, 0x472f19d6), - TOBN(0x7eae26be, 0x0c27eb4d), TOBN(0x17b53ed3, 0xfbabb884), - TOBN(0xfc27021b, 0x2b01ae4f), TOBN(0x88462e87, 0xcf488682), - TOBN(0xbee096ec, 0x215e2d87), TOBN(0xeb2fea9a, 0xd242e29b), - TOBN(0x5d985b5f, 0xb821fc28), TOBN(0x89d2e197, 0xdc1e2ad2), - TOBN(0x55b566b8, 0x9030ba62), TOBN(0xe3fd41b5, 0x4f41b1c6), - TOBN(0xb738ac2e, 0xb9a96d61), TOBN(0x7f8567ca, 0x369443f4), - TOBN(0x8698622d, 0xf803a440), TOBN(0x2b586236, 0x8fe2f4dc), - TOBN(0xbbcc00c7, 0x56b95bce), TOBN(0x5ec03906, 0x616da680), - TOBN(0x79162ee6, 0x72214252), TOBN(0x43132b63, 0x86a892d2), - TOBN(0x4bdd3ff2, 0x2f3263bf), TOBN(0xd5b3733c, 0x9cd0a142), - TOBN(0x592eaa82, 0x44415ccb), TOBN(0x663e8924, 0x8d5474ea), - TOBN(0x8058a25e, 0x5236344e), TOBN(0x82e8df9d, 0xbda76ee6), - TOBN(0xdcf6efd8, 0x11cc3d22), TOBN(0x00089cda, 0x3b4ab529), - TOBN(0x91d3a071, 0xbd38a3db), TOBN(0x4ea97fc0, 0xef72b925), - TOBN(0x0c9fc15b, 0xea3edf75), TOBN(0x5a6297cd, 0xa4348ed3), - TOBN(0x0d38ab35, 0xce7c42d4), TOBN(0x9fd493ef, 0x82feab10), - TOBN(0x46056b6d, 0x82111b45), TOBN(0xda11dae1, 0x73efc5c3), - TOBN(0xdc740278, 0x5545a7fb), TOBN(0xbdb2601c, 0x40d507e6), - TOBN(0x121dfeeb, 0x7066fa58), TOBN(0x214369a8, 0x39ae8c2a), - TOBN(0x195709cb, 0x06e0956c), TOBN(0x4c9d254f, 0x010cd34b), - TOBN(0xf51e13f7, 0x0471a532), TOBN(0xe19d6791, 0x1e73054d), - TOBN(0xf702a628, 0xdb5c7be3), TOBN(0xc7141218, 0xb24dde05), - TOBN(0xdc18233c, 0xf29b2e2e), TOBN(0x3a6bd1e8, 0x85342dba), - TOBN(0x3f747fa0, 0xb311898c), TOBN(0xe2a272e4, 0xcd0eac65), - TOBN(0x4bba5851, 0xf914d0bc), TOBN(0x7a1a9660, 0xc4a43ee3), - TOBN(0xe5a367ce, 0xa1c8cde9), TOBN(0x9d958ba9, 0x7271abe3), - TOBN(0xf3ff7eb6, 0x3d1615cd), TOBN(0xa2280dce, 0xf5ae20b0), - TOBN(0x56dba5c1, 0xcf640147), TOBN(0xea5a2e3d, 0x5e83d118), - TOBN(0x04cd6b6d, 0xda24c511), TOBN(0x1c0f4671, 0xe854d214), - TOBN(0x91a6b7a9, 0x69565381), TOBN(0xdc966240, 0xdecf1f5b), - TOBN(0x1b22d21c, 0xfcf5d009), TOBN(0x2a05f641, 0x9021dbd5), - TOBN(0x8c0ed566, 0xd4312483), TOBN(0x5179a95d, 0x643e216f), - TOBN(0xcc185fec, 0x17044493), TOBN(0xb3063339, 0x54991a21), - TOBN(0xd801ecdb, 0x0081a726), TOBN(0x0149b0c6, 0x4fa89bbb), - TOBN(0xafe9065a, 0x4391b6b9), TOBN(0xedc92786, 0xd633f3a3), - TOBN(0xe408c24a, 0xae6a8e13), TOBN(0x85833fde, 0x9f3897ab), - TOBN(0x43800e7e, 0xd81a0715), TOBN(0xde08e346, 0xb44ffc5f), - TOBN(0x7094184c, 0xcdeff2e0), TOBN(0x49f9387b, 0x165eaed1), - TOBN(0x635d6129, 0x777c468a), TOBN(0x8c0dcfd1, 0x538c2dd8), - TOBN(0xd6d9d9e3, 0x7a6a308b), TOBN(0x62375830, 0x4c2767d3), - TOBN(0x874a8bc6, 0xf38cbeb6), TOBN(0xd94d3f1a, 0xccb6fd9e), - TOBN(0x92a9735b, 0xba21f248), TOBN(0x272ad0e5, 0x6cd1efb0), - TOBN(0x7437b69c, 0x05b03284), TOBN(0xe7f04702, 0x6948c225), - TOBN(0x8a56c04a, 0xcba2ecec), TOBN(0x0c181270, 0xe3a73e41), - TOBN(0x6cb34e9d, 0x03e93725), TOBN(0xf77c8713, 0x496521a9), - TOBN(0x94569183, 0xfa7f9f90), TOBN(0xf2e7aa4c, 0x8c9707ad), - TOBN(0xced2c9ba, 0x26c1c9a3), TOBN(0x9109fe96, 0x40197507), - TOBN(0x9ae868a9, 0xe9adfe1c), TOBN(0x3984403d, 0x314e39bb), - TOBN(0xb5875720, 0xf2fe378f), TOBN(0x33f901e0, 0xba44a628), - TOBN(0xea1125fe, 0x3652438c), TOBN(0xae9ec4e6, 0x9dd1f20b), - TOBN(0x1e740d9e, 0xbebf7fbd), TOBN(0x6dbd3ddc, 0x42dbe79c), - TOBN(0x62082aec, 0xedd36776), TOBN(0xf612c478, 0xe9859039), - TOBN(0xa493b201, 0x032f7065), TOBN(0xebd4d8f2, 0x4ff9b211), - TOBN(0x3f23a0aa, 0xaac4cb32), TOBN(0xea3aadb7, 0x15ed4005), - TOBN(0xacf17ea4, 0xafa27e63), TOBN(0x56125c1a, 0xc11fd66c), - TOBN(0x266344a4, 0x3794f8dc), TOBN(0xdcca923a, 0x483c5c36), - TOBN(0x2d6b6bbf, 0x3f9d10a0), TOBN(0xb320c5ca, 0x81d9bdf3), - TOBN(0x620e28ff, 0x47b50a95), TOBN(0x933e3b01, 0xcef03371), - TOBN(0xf081bf85, 0x99100153), TOBN(0x183be9a0, 0xc3a8c8d6), - TOBN(0x4e3ddc5a, 0xd6bbe24d), TOBN(0xc6c74630, 0x53843795), - TOBN(0x78193dd7, 0x65ec2d4c), TOBN(0xb8df26cc, 0xcd3c89b2), - TOBN(0x98dbe399, 0x5a483f8d), TOBN(0x72d8a957, 0x7dd3313a), - TOBN(0x65087294, 0xab0bd375), TOBN(0xfcd89248, 0x7c259d16), - TOBN(0x8a9443d7, 0x7613aa81), TOBN(0x80100800, 0x85fe6584), - TOBN(0x70fc4dbc, 0x7fb10288), TOBN(0xf58280d3, 0xe86beee8), - TOBN(0x14fdd82f, 0x7c978c38), TOBN(0xdf1204c1, 0x0de44d7b), - TOBN(0xa08a1c84, 0x4160252f), TOBN(0x591554ca, 0xc17646a5), - TOBN(0x214a37d6, 0xa05bd525), TOBN(0x48d5f09b, 0x07957b3c), - TOBN(0x0247cdcb, 0xd7109bc9), TOBN(0x40f9e4bb, 0x30599ce7), - TOBN(0xc325fa03, 0xf46ad2ec), TOBN(0x00f766cf, 0xc3e3f9ee), - TOBN(0xab556668, 0xd43a4577), TOBN(0x68d30a61, 0x3ee03b93), - TOBN(0x7ddc81ea, 0x77b46a08), TOBN(0xcf5a6477, 0xc7480699), - TOBN(0x43a8cb34, 0x6633f683), TOBN(0x1b867e6b, 0x92363c60), - TOBN(0x43921114, 0x1f60558e), TOBN(0xcdbcdd63, 0x2f41450e), - TOBN(0x7fc04601, 0xcc630e8b), TOBN(0xea7c66d5, 0x97038b43), - TOBN(0x7259b8a5, 0x04e99fd8), TOBN(0x98a8dd12, 0x4785549a), - TOBN(0x0e459a7c, 0x840552e1), TOBN(0xcdfcf4d0, 0x4bb0909e), - TOBN(0x34a86db2, 0x53758da7), TOBN(0xe643bb83, 0xeac997e1), - TOBN(0x96400bd7, 0x530c5b7e), TOBN(0x9f97af87, 0xb41c8b52), - TOBN(0x34fc8820, 0xfbeee3f9), TOBN(0x93e53490, 0x49091afd), - TOBN(0x764b9be5, 0x9a31f35c), TOBN(0x71f37864, 0x57e3d924), - TOBN(0x02fb34e0, 0x943aa75e), TOBN(0xa18c9c58, 0xab8ff6e4), - TOBN(0x080f31b1, 0x33cf0d19), TOBN(0x5c9682db, 0x083518a7), - TOBN(0x873d4ca6, 0xb709c3de), TOBN(0x64a84262, 0x3575b8f0), - TOBN(0x6275da1f, 0x020154bb), TOBN(0x97678caa, 0xd17cf1ab), - TOBN(0x8779795f, 0x951a95c3), TOBN(0xdd35b163, 0x50fccc08), - TOBN(0x32709627, 0x33d8f031), TOBN(0x3c5ab10a, 0x498dd85c), - TOBN(0xb6c185c3, 0x41dca566), TOBN(0x7de7feda, 0xd8622aa3), - TOBN(0x99e84d92, 0x901b6dfb), TOBN(0x30a02b0e, 0x7c4ad288), - TOBN(0xc7c81daa, 0x2fd3cf36), TOBN(0xd1319547, 0xdf89e59f), - TOBN(0xb2be8184, 0xcd496733), TOBN(0xd5f449eb, 0x93d3412b), - TOBN(0x7ea41b1b, 0x25fe531d), TOBN(0xf9797432, 0x6a1d5646), - TOBN(0x86067f72, 0x2bde501a), TOBN(0xf91481c0, 0x0c85e89c), - TOBN(0xca8ee465, 0xf8b05bc6), TOBN(0x1844e1cf, 0x02e83cda), - TOBN(0xca82114a, 0xb4dbe33b), TOBN(0x0f9f8769, 0x4eabfde2), - TOBN(0x4936b1c0, 0x38b27fe2), TOBN(0x63b6359b, 0xaba402df), - TOBN(0x40c0ea2f, 0x656bdbab), TOBN(0x9c992a89, 0x6580c39c), - TOBN(0x600e8f15, 0x2a60aed1), TOBN(0xeb089ca4, 0xe0bf49df), - TOBN(0x9c233d7d, 0x2d42d99a), TOBN(0x648d3f95, 0x4c6bc2fa), - TOBN(0xdcc383a8, 0xe1add3f3), TOBN(0xf42c0c6a, 0x4f64a348), - TOBN(0x2abd176f, 0x0030dbdb), TOBN(0x4de501a3, 0x7d6c215e), - TOBN(0x4a107c1f, 0x4b9a64bc), TOBN(0xa77f0ad3, 0x2496cd59), - TOBN(0xfb78ac62, 0x7688dffb), TOBN(0x7025a2ca, 0x67937d8e), - TOBN(0xfde8b2d1, 0xd1a8f4e7), TOBN(0xf5b3da47, 0x7354927c), - TOBN(0xe48606a3, 0xd9205735), TOBN(0xac477cc6, 0xe177b917), - TOBN(0xfb1f73d2, 0xa883239a), TOBN(0xe12572f6, 0xcc8b8357), - TOBN(0x9d355e9c, 0xfb1f4f86), TOBN(0x89b795f8, 0xd9f3ec6e), - TOBN(0x27be56f1, 0xb54398dc), TOBN(0x1890efd7, 0x3fedeed5), - TOBN(0x62f77f1f, 0x9c6d0140), TOBN(0x7ef0e314, 0x596f0ee4), - TOBN(0x50ca6631, 0xcc61dab3), TOBN(0x4a39801d, 0xf4866e4f), - TOBN(0x66c8d032, 0xae363b39), TOBN(0x22c591e5, 0x2ead66aa), - TOBN(0x954ba308, 0xde02a53e), TOBN(0x2a6c060f, 0xd389f357), - TOBN(0xe6cfcde8, 0xfbf40b66), TOBN(0x8e02fc56, 0xc6340ce1), - TOBN(0xe4957795, 0x73adb4ba), TOBN(0x7b86122c, 0xa7b03805), - TOBN(0x63f83512, 0x0c8e6fa6), TOBN(0x83660ea0, 0x057d7804), - TOBN(0xbad79105, 0x21ba473c), TOBN(0xb6c50bee, 0xded5389d), - TOBN(0xee2caf4d, 0xaa7c9bc0), TOBN(0xd97b8de4, 0x8c4e98a7), - TOBN(0xa9f63e70, 0xab3bbddb), TOBN(0x3898aabf, 0x2597815a), - TOBN(0x7659af89, 0xac15b3d9), TOBN(0xedf7725b, 0x703ce784), - TOBN(0x25470fab, 0xe085116b), TOBN(0x04a43375, 0x87285310), - TOBN(0x4e39187e, 0xe2bfd52f), TOBN(0x36166b44, 0x7d9ebc74), - TOBN(0x92ad433c, 0xfd4b322c), TOBN(0x726aa817, 0xba79ab51), - TOBN(0xf96eacd8, 0xc1db15eb), TOBN(0xfaf71e91, 0x0476be63), - TOBN(0xdd69a640, 0x641fad98), TOBN(0xb7995918, 0x29622559), - TOBN(0x03c6daa5, 0xde4199dc), TOBN(0x92cadc97, 0xad545eb4), - TOBN(0x1028238b, 0x256534e4), TOBN(0x73e80ce6, 0x8595409a), - TOBN(0x690d4c66, 0xd05dc59b), TOBN(0xc95f7b8f, 0x981dee80), - TOBN(0xf4337014, 0xd856ac25), TOBN(0x441bd9dd, 0xac524dca), - TOBN(0x640b3d85, 0x5f0499f5), TOBN(0x39cf84a9, 0xd5fda182), - TOBN(0x04e7b055, 0xb2aa95a0), TOBN(0x29e33f0a, 0x0ddf1860), - TOBN(0x082e74b5, 0x423f6b43), TOBN(0x217edeb9, 0x0aaa2b0f), - TOBN(0x58b83f35, 0x83cbea55), TOBN(0xc485ee4d, 0xbc185d70), - TOBN(0x833ff03b, 0x1e5f6992), TOBN(0xb5b9b9cc, 0xcf0c0dd5), - TOBN(0x7caaee8e, 0x4e9e8a50), TOBN(0x462e907b, 0x6269dafd), - TOBN(0x6ed5cee9, 0xfbe791c6), TOBN(0x68ca3259, 0xed430790), - TOBN(0x2b72bdf2, 0x13b5ba88), TOBN(0x60294c8a, 0x35ef0ac4), - TOBN(0x9c3230ed, 0x19b99b08), TOBN(0x560fff17, 0x6c2589aa), - TOBN(0x552b8487, 0xd6770374), TOBN(0xa373202d, 0x9a56f685), - TOBN(0xd3e7f907, 0x45f175d9), TOBN(0x3c2f315f, 0xd080d810), - TOBN(0x1130e9dd, 0x7b9520e8), TOBN(0xc078f9e2, 0x0af037b5), - TOBN(0x38cd2ec7, 0x1e9c104c), TOBN(0x0f684368, 0xc472fe92), - TOBN(0xd3f1b5ed, 0x6247e7ef), TOBN(0xb32d33a9, 0x396dfe21), - TOBN(0x46f59cf4, 0x4a9aa2c2), TOBN(0x69cd5168, 0xff0f7e41), - TOBN(0x3f59da0f, 0x4b3234da), TOBN(0xcf0b0235, 0xb4579ebe), - TOBN(0x6d1cbb25, 0x6d2476c7), TOBN(0x4f0837e6, 0x9dc30f08), - TOBN(0x9a4075bb, 0x906f6e98), TOBN(0x253bb434, 0xc761e7d1), - TOBN(0xde2e645f, 0x6e73af10), TOBN(0xb89a4060, 0x0c5f131c), - TOBN(0xd12840c5, 0xb8cc037f), TOBN(0x3d093a5b, 0x7405bb47), - TOBN(0x6202c253, 0x206348b8), TOBN(0xbf5d57fc, 0xc55a3ca7), - TOBN(0x89f6c90c, 0x8c3bef48), TOBN(0x23ac7623, 0x5a0a960a), - TOBN(0xdfbd3d6b, 0x552b42ab), TOBN(0x3ef22458, 0x132061f6), - TOBN(0xd74e9bda, 0xc97e6516), TOBN(0x88779360, 0xc230f49e), - TOBN(0xa6ec1de3, 0x1e74ea49), TOBN(0x581dcee5, 0x3fb645a2), - TOBN(0xbaef2391, 0x8f483f14), TOBN(0x6d2dddfc, 0xd137d13b), - TOBN(0x54cde50e, 0xd2743a42), TOBN(0x89a34fc5, 0xe4d97e67), - TOBN(0x13f1f5b3, 0x12e08ce5), TOBN(0xa80540b8, 0xa7f0b2ca), - TOBN(0x854bcf77, 0x01982805), TOBN(0xb8653ffd, 0x233bea04), - TOBN(0x8e7b8787, 0x02b0b4c9), TOBN(0x2675261f, 0x9acb170a), - TOBN(0x061a9d90, 0x930c14e5), TOBN(0xb59b30e0, 0xdef0abea), - TOBN(0x1dc19ea6, 0x0200ec7d), TOBN(0xb6f4a3f9, 0x0bce132b), - TOBN(0xb8d5de90, 0xf13e27e0), TOBN(0xbaee5ef0, 0x1fade16f), - TOBN(0x6f406aaa, 0xe4c6cf38), TOBN(0xab4cfe06, 0xd1369815), - TOBN(0x0dcffe87, 0xefd550c6), TOBN(0x9d4f59c7, 0x75ff7d39), - TOBN(0xb02553b1, 0x51deb6ad), TOBN(0x812399a4, 0xb1877749), - TOBN(0xce90f71f, 0xca6006e1), TOBN(0xc32363a6, 0xb02b6e77), - TOBN(0x02284fbe, 0xdc36c64d), TOBN(0x86c81e31, 0xa7e1ae61), - TOBN(0x2576c7e5, 0xb909d94a), TOBN(0x8b6f7d02, 0x818b2bb0), - TOBN(0xeca3ed07, 0x56faa38a), TOBN(0xa3790e6c, 0x9305bb54), - TOBN(0xd784eeda, 0x7bc73061), TOBN(0xbd56d369, 0x6dd50614), - TOBN(0xd6575949, 0x229a8aa9), TOBN(0xdcca8f47, 0x4595ec28), - TOBN(0x814305c1, 0x06ab4fe6), TOBN(0xc8c39768, 0x24f43f16), - TOBN(0xe2a45f36, 0x523f2b36), TOBN(0x995c6493, 0x920d93bb), - TOBN(0xf8afdab7, 0x90f1632b), TOBN(0x79ebbecd, 0x1c295954), - TOBN(0xc7bb3ddb, 0x79592f48), TOBN(0x67216a7b, 0x5f88e998), - TOBN(0xd91f098b, 0xbc01193e), TOBN(0xf7d928a5, 0xb1db83fc), - TOBN(0x55e38417, 0xe991f600), TOBN(0x2a91113e, 0x2981a934), - TOBN(0xcbc9d648, 0x06b13bde), TOBN(0xb011b6ac, 0x0755ff44), - TOBN(0x6f4cb518, 0x045ec613), TOBN(0x522d2d31, 0xc2f5930a), - TOBN(0x5acae1af, 0x382e65de), TOBN(0x57643067, 0x27bc966f), - TOBN(0x5e12705d, 0x1c7193f0), TOBN(0xf0f32f47, 0x3be8858e), - TOBN(0x785c3d7d, 0x96c6dfc7), TOBN(0xd75b4a20, 0xbf31795d), - TOBN(0x91acf17b, 0x342659d4), TOBN(0xe596ea34, 0x44f0378f), - TOBN(0x4515708f, 0xce52129d), TOBN(0x17387e1e, 0x79f2f585), - TOBN(0x72cfd2e9, 0x49dee168), TOBN(0x1ae05223, 0x3e2af239), - TOBN(0x009e75be, 0x1d94066a), TOBN(0x6cca31c7, 0x38abf413), - TOBN(0xb50bd61d, 0x9bc49908), TOBN(0x4a9b4a8c, 0xf5e2bc1e), - TOBN(0xeb6cc5f7, 0x946f83ac), TOBN(0x27da93fc, 0xebffab28), - TOBN(0xea314c96, 0x4821c8c5), TOBN(0x8de49ded, 0xa83c15f4), - TOBN(0x7a64cf20, 0x7af33004), TOBN(0x45f1bfeb, 0xc9627e10), - TOBN(0x878b0626, 0x54b9df60), TOBN(0x5e4fdc3c, 0xa95c0b33), - TOBN(0xe54a37ca, 0xc2035d8e), TOBN(0x9087cda9, 0x80f20b8c), - TOBN(0x36f61c23, 0x8319ade4), TOBN(0x766f287a, 0xde8cfdf8), - TOBN(0x48821948, 0x346f3705), TOBN(0x49a7b853, 0x16e4f4a2), - TOBN(0xb9b3f8a7, 0x5cedadfd), TOBN(0x8f562815, 0x8db2a815), - TOBN(0xc0b7d554, 0x01f68f95), TOBN(0x12971e27, 0x688a208e), - TOBN(0xc9f8b696, 0xd0ff34fc), TOBN(0x20824de2, 0x1222718c), - TOBN(0x7213cf9f, 0x0c95284d), TOBN(0xe2ad741b, 0xdc158240), - TOBN(0x0ee3a6df, 0x54043ccf), TOBN(0x16ff479b, 0xd84412b3), - TOBN(0xf6c74ee0, 0xdfc98af0), TOBN(0xa78a169f, 0x52fcd2fb), - TOBN(0xd8ae8746, 0x99c930e9), TOBN(0x1d33e858, 0x49e117a5), - TOBN(0x7581fcb4, 0x6624759f), TOBN(0xde50644f, 0x5bedc01d), - TOBN(0xbeec5d00, 0xcaf3155e), TOBN(0x672d66ac, 0xbc73e75f), - TOBN(0x86b9d8c6, 0x270b01db), TOBN(0xd249ef83, 0x50f55b79), - TOBN(0x6131d6d4, 0x73978fe3), TOBN(0xcc4e4542, 0x754b00a1), - TOBN(0x4e05df05, 0x57dfcfe9), TOBN(0x94b29cdd, 0x51ef6bf0), - TOBN(0xe4530cff, 0x9bc7edf2), TOBN(0x8ac236fd, 0xd3da65f3), - TOBN(0x0faf7d5f, 0xc8eb0b48), TOBN(0x4d2de14c, 0x660eb039), - TOBN(0xc006bba7, 0x60430e54), TOBN(0x10a2d0d6, 0xda3289ab), - TOBN(0x9c037a5d, 0xd7979c59), TOBN(0x04d1f3d3, 0xa116d944), - TOBN(0x9ff22473, 0x8a0983cd), TOBN(0x28e25b38, 0xc883cabb), - TOBN(0xe968dba5, 0x47a58995), TOBN(0x2c80b505, 0x774eebdf), - TOBN(0xee763b71, 0x4a953beb), TOBN(0x502e223f, 0x1642e7f6), - TOBN(0x6fe4b641, 0x61d5e722), TOBN(0x9d37c5b0, 0xdbef5316), - TOBN(0x0115ed70, 0xf8330bc7), TOBN(0x139850e6, 0x75a72789), - TOBN(0x27d7faec, 0xffceccc2), TOBN(0x3016a860, 0x4fd9f7f6), - TOBN(0xc492ec64, 0x4cd8f64c), TOBN(0x58a2d790, 0x279d7b51), - TOBN(0x0ced1fc5, 0x1fc75256), TOBN(0x3e658aed, 0x8f433017), - TOBN(0x0b61942e, 0x05da59eb), TOBN(0xba3d60a3, 0x0ddc3722), - TOBN(0x7c311cd1, 0x742e7f87), TOBN(0x6473ffee, 0xf6b01b6e)}, - {TOBN(0x8303604f, 0x692ac542), TOBN(0xf079ffe1, 0x227b91d3), - TOBN(0x19f63e63, 0x15aaf9bd), TOBN(0xf99ee565, 0xf1f344fb), - TOBN(0x8a1d661f, 0xd6219199), TOBN(0x8c883bc6, 0xd48ce41c), - TOBN(0x1065118f, 0x3c74d904), TOBN(0x713889ee, 0x0faf8b1b), - TOBN(0x972b3f8f, 0x81a1b3be), TOBN(0x4f3ce145, 0xce2764a0), - TOBN(0xe2d0f1cc, 0x28c4f5f7), TOBN(0xdeee0c0d, 0xc7f3985b), - TOBN(0x7df4adc0, 0xd39e25c3), TOBN(0x40619820, 0xc467a080), - TOBN(0x440ebc93, 0x61cf5a58), TOBN(0x527729a6, 0x422ad600), - TOBN(0xca6c0937, 0xb1b76ba6), TOBN(0x1a2eab85, 0x4d2026dc), - TOBN(0xb1715e15, 0x19d9ae0a), TOBN(0xf1ad9199, 0xbac4a026), - TOBN(0x35b3dfb8, 0x07ea7b0e), TOBN(0xedf5496f, 0x3ed9eb89), - TOBN(0x8932e5ff, 0x2d6d08ab), TOBN(0xf314874e, 0x25bd2731), - TOBN(0xefb26a75, 0x3f73f449), TOBN(0x1d1c94f8, 0x8d44fc79), - TOBN(0x49f0fbc5, 0x3bc0dc4d), TOBN(0xb747ea0b, 0x3698a0d0), - TOBN(0x5218c3fe, 0x228d291e), TOBN(0x35b804b5, 0x43c129d6), - TOBN(0xfac859b8, 0xd1acc516), TOBN(0x6c10697d, 0x95d6e668), - TOBN(0xc38e438f, 0x0876fd4e), TOBN(0x45f0c307, 0x83d2f383), - TOBN(0x203cc2ec, 0xb10934cb), TOBN(0x6a8f2439, 0x2c9d46ee), - TOBN(0xf16b431b, 0x65ccde7b), TOBN(0x41e2cd18, 0x27e76a6f), - TOBN(0xb9c8cf8f, 0x4e3484d7), TOBN(0x64426efd, 0x8315244a), - TOBN(0x1c0a8e44, 0xfc94dea3), TOBN(0x34c8cdbf, 0xdad6a0b0), - TOBN(0x919c3840, 0x04113cef), TOBN(0xfd32fba4, 0x15490ffa), - TOBN(0x58d190f6, 0x795dcfb7), TOBN(0xfef01b03, 0x83588baf), - TOBN(0x9e6d1d63, 0xca1fc1c0), TOBN(0x53173f96, 0xf0a41ac9), - TOBN(0x2b1d402a, 0xba16f73b), TOBN(0x2fb31014, 0x8cf9b9fc), - TOBN(0x2d51e60e, 0x446ef7bf), TOBN(0xc731021b, 0xb91e1745), - TOBN(0x9d3b4724, 0x4fee99d4), TOBN(0x4bca48b6, 0xfac5c1ea), - TOBN(0x70f5f514, 0xbbea9af7), TOBN(0x751f55a5, 0x974c283a), - TOBN(0x6e30251a, 0xcb452fdb), TOBN(0x31ee6965, 0x50f30650), - TOBN(0xb0b3e508, 0x933548d9), TOBN(0xb8949a4f, 0xf4b0ef5b), - TOBN(0x208b8326, 0x3c88f3bd), TOBN(0xab147c30, 0xdb1d9989), - TOBN(0xed6515fd, 0x44d4df03), TOBN(0x17a12f75, 0xe72eb0c5), - TOBN(0x3b59796d, 0x36cf69db), TOBN(0x1219eee9, 0x56670c18), - TOBN(0xfe3341f7, 0x7a070d8e), TOBN(0x9b70130b, 0xa327f90c), - TOBN(0x36a32462, 0x0ae18e0e), TOBN(0x2021a623, 0x46c0a638), - TOBN(0x251b5817, 0xc62eb0d4), TOBN(0x87bfbcdf, 0x4c762293), - TOBN(0xf78ab505, 0xcdd61d64), TOBN(0x8c7a53fc, 0xc8c18857), - TOBN(0xa653ce6f, 0x16147515), TOBN(0x9c923aa5, 0xea7d52d5), - TOBN(0xc24709cb, 0x5c18871f), TOBN(0x7d53bec8, 0x73b3cc74), - TOBN(0x59264aff, 0xfdd1d4c4), TOBN(0x5555917e, 0x240da582), - TOBN(0xcae8bbda, 0x548f5a0e), TOBN(0x1910eaba, 0x3bbfbbe1), - TOBN(0xae579685, 0x7677afc3), TOBN(0x49ea61f1, 0x73ff0b5c), - TOBN(0x78655478, 0x4f7c3922), TOBN(0x95d337cd, 0x20c68eef), - TOBN(0x68f1e1e5, 0xdf779ab9), TOBN(0x14b491b0, 0xb5cf69a8), - TOBN(0x7a6cbbe0, 0x28e3fe89), TOBN(0xe7e1fee4, 0xc5aac0eb), - TOBN(0x7f47eda5, 0x697e5140), TOBN(0x4f450137, 0xb454921f), - TOBN(0xdb625f84, 0x95cd8185), TOBN(0x74be0ba1, 0xcdb2e583), - TOBN(0xaee4fd7c, 0xdd5e6de4), TOBN(0x4251437d, 0xe8101739), - TOBN(0x686d72a0, 0xac620366), TOBN(0x4be3fb9c, 0xb6d59344), - TOBN(0x6e8b44e7, 0xa1eb75b9), TOBN(0x84e39da3, 0x91a5c10c), - TOBN(0x37cc1490, 0xb38f0409), TOBN(0x02951943, 0x2c2ade82), - TOBN(0x9b688783, 0x1190a2d8), TOBN(0x25627d14, 0x231182ba), - TOBN(0x6eb550aa, 0x658a6d87), TOBN(0x1405aaa7, 0xcf9c7325), - TOBN(0xd147142e, 0x5c8748c9), TOBN(0x7f637e4f, 0x53ede0e0), - TOBN(0xf8ca2776, 0x14ffad2c), TOBN(0xe58fb1bd, 0xbafb6791), - TOBN(0x17158c23, 0xbf8f93fc), TOBN(0x7f15b373, 0x0a4a4655), - TOBN(0x39d4add2, 0xd842ca72), TOBN(0xa71e4391, 0x3ed96305), - TOBN(0x5bb09cbe, 0x6700be14), TOBN(0x68d69d54, 0xd8befcf6), - TOBN(0xa45f5367, 0x37183bcf), TOBN(0x7152b7bb, 0x3370dff7), - TOBN(0xcf887baa, 0xbf12525b), TOBN(0xe7ac7bdd, 0xd6d1e3cd), - TOBN(0x25914f78, 0x81fdad90), TOBN(0xcf638f56, 0x0d2cf6ab), - TOBN(0xb90bc03f, 0xcc054de5), TOBN(0x932811a7, 0x18b06350), - TOBN(0x2f00b330, 0x9bbd11ff), TOBN(0x76108a6f, 0xb4044974), - TOBN(0x801bb9e0, 0xa851d266), TOBN(0x0dd099be, 0xbf8990c1), - TOBN(0x58c5aaaa, 0xabe32986), TOBN(0x0fe9dd2a, 0x50d59c27), - TOBN(0x84951ff4, 0x8d307305), TOBN(0x6c23f829, 0x86529b78), - TOBN(0x50bb2218, 0x0b136a79), TOBN(0x7e2174de, 0x77a20996), - TOBN(0x6f00a4b9, 0xc0bb4da6), TOBN(0x89a25a17, 0xefdde8da), - TOBN(0xf728a27e, 0xc11ee01d), TOBN(0xf900553a, 0xe5f10dfb), - TOBN(0x189a83c8, 0x02ec893c), TOBN(0x3ca5bdc1, 0x23f66d77), - TOBN(0x98781537, 0x97eada9f), TOBN(0x59c50ab3, 0x10256230), - TOBN(0x346042d9, 0x323c69b3), TOBN(0x1b715a6d, 0x2c460449), - TOBN(0xa41dd476, 0x6ae06e0b), TOBN(0xcdd7888e, 0x9d42e25f), - TOBN(0x0f395f74, 0x56b25a20), TOBN(0xeadfe0ae, 0x8700e27e), - TOBN(0xb09d52a9, 0x69950093), TOBN(0x3525d9cb, 0x327f8d40), - TOBN(0xb8235a94, 0x67df886a), TOBN(0x77e4b0dd, 0x035faec2), - TOBN(0x115eb20a, 0x517d7061), TOBN(0x77fe3433, 0x6c2df683), - TOBN(0x6870ddc7, 0xcdc6fc67), TOBN(0xb1610588, 0x0b87de83), - TOBN(0x343584ca, 0xd9c4ddbe), TOBN(0xb3164f1c, 0x3d754be2), - TOBN(0x0731ed3a, 0xc1e6c894), TOBN(0x26327dec, 0x4f6b904c), - TOBN(0x9d49c6de, 0x97b5cd32), TOBN(0x40835dae, 0xb5eceecd), - TOBN(0xc66350ed, 0xd9ded7fe), TOBN(0x8aeebb5c, 0x7a678804), - TOBN(0x51d42fb7, 0x5b8ee9ec), TOBN(0xd7a17bdd, 0x8e3ca118), - TOBN(0x40d7511a, 0x2ef4400e), TOBN(0xc48990ac, 0x875a66f4), - TOBN(0x8de07d2a, 0x2199e347), TOBN(0xbee75556, 0x2a39e051), - TOBN(0x56918786, 0x916e51dc), TOBN(0xeb191313, 0x4a2d89ec), - TOBN(0x6679610d, 0x37d341ed), TOBN(0x434fbb41, 0x56d51c2b), - TOBN(0xe54b7ee7, 0xd7492dba), TOBN(0xaa33a79a, 0x59021493), - TOBN(0x49fc5054, 0xe4bd6d3d), TOBN(0x09540f04, 0x5ab551d0), - TOBN(0x8acc9085, 0x4942d3a6), TOBN(0x231af02f, 0x2d28323b), - TOBN(0x93458cac, 0x0992c163), TOBN(0x1fef8e71, 0x888e3bb4), - TOBN(0x27578da5, 0xbe8c268c), TOBN(0xcc8be792, 0xe805ec00), - TOBN(0x29267bae, 0xc61c3855), TOBN(0xebff429d, 0x58c1fd3b), - TOBN(0x22d886c0, 0x8c0b93b8), TOBN(0xca5e00b2, 0x2ddb8953), - TOBN(0xcf330117, 0xc3fed8b7), TOBN(0xd49ac6fa, 0x819c01f6), - TOBN(0x6ddaa6bd, 0x3c0fbd54), TOBN(0x91743068, 0x8049a2cf), - TOBN(0xd67f981e, 0xaff2ef81), TOBN(0xc3654d35, 0x2818ae80), - TOBN(0x81d05044, 0x1b2aa892), TOBN(0x2db067bf, 0x3d099328), - TOBN(0xe7c79e86, 0x703dcc97), TOBN(0xe66f9b37, 0xe133e215), - TOBN(0xcdf119a6, 0xe39a7a5c), TOBN(0x47c60de3, 0x876f1b61), - TOBN(0x6e405939, 0xd860f1b2), TOBN(0x3e9a1dbc, 0xf5ed4d4a), - TOBN(0x3f23619e, 0xc9b6bcbd), TOBN(0x5ee790cf, 0x734e4497), - TOBN(0xf0a834b1, 0x5bdaf9bb), TOBN(0x02cedda7, 0x4ca295f0), - TOBN(0x4619aa2b, 0xcb8e378c), TOBN(0xe5613244, 0xcc987ea4), - TOBN(0x0bc022cc, 0x76b23a50), TOBN(0x4a2793ad, 0x0a6c21ce), - TOBN(0x38328780, 0x89cac3f5), TOBN(0x29176f1b, 0xcba26d56), - TOBN(0x06296187, 0x4f6f59eb), TOBN(0x86e9bca9, 0x8bdc658e), - TOBN(0x2ca9c4d3, 0x57e30402), TOBN(0x5438b216, 0x516a09bb), - TOBN(0x0a6a063c, 0x7672765a), TOBN(0x37a3ce64, 0x0547b9bf), - TOBN(0x42c099c8, 0x98b1a633), TOBN(0xb5ab800d, 0x05ee6961), - TOBN(0xf1963f59, 0x11a5acd6), TOBN(0xbaee6157, 0x46201063), - TOBN(0x36d9a649, 0xa596210a), TOBN(0xaed04363, 0x1ba7138c), - TOBN(0xcf817d1c, 0xa4a82b76), TOBN(0x5586960e, 0xf3806be9), - TOBN(0x7ab67c89, 0x09dc6bb5), TOBN(0x52ace7a0, 0x114fe7eb), - TOBN(0xcd987618, 0xcbbc9b70), TOBN(0x4f06fd5a, 0x604ca5e1), - TOBN(0x90af14ca, 0x6dbde133), TOBN(0x1afe4322, 0x948a3264), - TOBN(0xa70d2ca6, 0xc44b2c6c), TOBN(0xab726799, 0x0ef87dfe), - TOBN(0x310f64dc, 0x2e696377), TOBN(0x49b42e68, 0x4c8126a0), - TOBN(0x0ea444c3, 0xcea0b176), TOBN(0x53a8ddf7, 0xcb269182), - TOBN(0xf3e674eb, 0xbbba9dcb), TOBN(0x0d2878a8, 0xd8669d33), - TOBN(0x04b935d5, 0xd019b6a3), TOBN(0xbb5cf88e, 0x406f1e46), - TOBN(0xa1912d16, 0x5b57c111), TOBN(0x9803fc21, 0x19ebfd78), - TOBN(0x4f231c9e, 0xc07764a9), TOBN(0xd93286ee, 0xb75bd055), - TOBN(0x83a9457d, 0x8ee6c9de), TOBN(0x04695915, 0x6087ec90), - TOBN(0x14c6dd8a, 0x58d6cd46), TOBN(0x9cb633b5, 0x8e6634d2), - TOBN(0xc1305047, 0xf81bc328), TOBN(0x12ede0e2, 0x26a177e5), - TOBN(0x332cca62, 0x065a6f4f), TOBN(0xc3a47ecd, 0x67be487b), - TOBN(0x741eb187, 0x0f47ed1c), TOBN(0x99e66e58, 0xe7598b14), - TOBN(0x6f0544ca, 0x63d0ff12), TOBN(0xe5efc784, 0xb610a05f), - TOBN(0xf72917b1, 0x7cad7b47), TOBN(0x3ff6ea20, 0xf2cac0c0), - TOBN(0xcc23791b, 0xf21db8b7), TOBN(0x7dac70b1, 0xd7d93565), - TOBN(0x682cda1d, 0x694bdaad), TOBN(0xeb88bb8c, 0x1023516d), - TOBN(0xc4c634b4, 0xdfdbeb1b), TOBN(0x22f5ca72, 0xb4ee4dea), - TOBN(0x1045a368, 0xe6524821), TOBN(0xed9e8a3f, 0x052b18b2), - TOBN(0x9b7f2cb1, 0xb961f49a), TOBN(0x7fee2ec1, 0x7b009670), - TOBN(0x350d8754, 0x22507a6d), TOBN(0x561bd711, 0x4db55f1d), - TOBN(0x4c189ccc, 0x320bbcaf), TOBN(0x568434cf, 0xdf1de48c), - TOBN(0x6af1b00e, 0x0fa8f128), TOBN(0xf0ba9d02, 0x8907583c), - TOBN(0x735a4004, 0x32ff9f60), TOBN(0x3dd8e4b6, 0xc25dcf33), - TOBN(0xf2230f16, 0x42c74cef), TOBN(0xd8117623, 0x013fa8ad), - TOBN(0x36822876, 0xf51fe76e), TOBN(0x8a6811cc, 0x11d62589), - TOBN(0xc3fc7e65, 0x46225718), TOBN(0xb7df2c9f, 0xc82fdbcd), - TOBN(0x3b1d4e52, 0xdd7b205b), TOBN(0xb6959478, 0x47a2e414), - TOBN(0x05e4d793, 0xefa91148), TOBN(0xb47ed446, 0xfd2e9675), - TOBN(0x1a7098b9, 0x04c9d9bf), TOBN(0x661e2881, 0x1b793048), - TOBN(0xb1a16966, 0xb01ee461), TOBN(0xbc521308, 0x2954746f), - TOBN(0xc909a0fc, 0x2477de50), TOBN(0xd80bb41c, 0x7dbd51ef), - TOBN(0xa85be7ec, 0x53294905), TOBN(0x6d465b18, 0x83958f97), - TOBN(0x16f6f330, 0xfb6840fd), TOBN(0xfaaeb214, 0x3401e6c8), - TOBN(0xaf83d30f, 0xccb5b4f8), TOBN(0x22885739, 0x266dec4b), - TOBN(0x51b4367c, 0x7bc467df), TOBN(0x926562e3, 0xd842d27a), - TOBN(0xdfcb6614, 0x0fea14a6), TOBN(0xeb394dae, 0xf2734cd9), - TOBN(0x3eeae5d2, 0x11c0be98), TOBN(0xb1e6ed11, 0x814e8165), - TOBN(0x191086bc, 0xe52bce1c), TOBN(0x14b74cc6, 0xa75a04da), - TOBN(0x63cf1186, 0x8c060985), TOBN(0x071047de, 0x2dbd7f7c), - TOBN(0x4e433b8b, 0xce0942ca), TOBN(0xecbac447, 0xd8fec61d), - TOBN(0x8f0ed0e2, 0xebf3232f), TOBN(0xfff80f9e, 0xc52a2edd), - TOBN(0xad9ab433, 0x75b55fdb), TOBN(0x73ca7820, 0xe42e0c11), - TOBN(0x6dace0a0, 0xe6251b46), TOBN(0x89bc6b5c, 0x4c0d932d), - TOBN(0x3438cd77, 0x095da19a), TOBN(0x2f24a939, 0x8d48bdfb), - TOBN(0x99b47e46, 0x766561b7), TOBN(0x736600e6, 0x0ed0322a), - TOBN(0x06a47cb1, 0x638e1865), TOBN(0x927c1c2d, 0xcb136000), - TOBN(0x29542337, 0x0cc5df69), TOBN(0x99b37c02, 0x09d649a9), - TOBN(0xc5f0043c, 0x6aefdb27), TOBN(0x6cdd9987, 0x1be95c27), - TOBN(0x69850931, 0x390420d2), TOBN(0x299c40ac, 0x0983efa4), - TOBN(0x3a05e778, 0xaf39aead), TOBN(0x84274408, 0x43a45193), - TOBN(0x6bcd0fb9, 0x91a711a0), TOBN(0x461592c8, 0x9f52ab17), - TOBN(0xb49302b4, 0xda3c6ed6), TOBN(0xc51fddc7, 0x330d7067), - TOBN(0x94babeb6, 0xda50d531), TOBN(0x521b840d, 0xa6a7b9da), - TOBN(0x5305151e, 0x404bdc89), TOBN(0x1bcde201, 0xd0d07449), - TOBN(0xf427a78b, 0x3b76a59a), TOBN(0xf84841ce, 0x07791a1b), - TOBN(0xebd314be, 0xbf91ed1c), TOBN(0x8e61d34c, 0xbf172943), - TOBN(0x1d5dc451, 0x5541b892), TOBN(0xb186ee41, 0xfc9d9e54), - TOBN(0x9d9f345e, 0xd5bf610d), TOBN(0x3e7ba65d, 0xf6acca9f), - TOBN(0x9dda787a, 0xa8369486), TOBN(0x09f9dab7, 0x8eb5ba53), - TOBN(0x5afb2033, 0xd6481bc3), TOBN(0x76f4ce30, 0xafa62104), - TOBN(0xa8fa00cf, 0xf4f066b5), TOBN(0x89ab5143, 0x461dafc2), - TOBN(0x44339ed7, 0xa3389998), TOBN(0x2ff862f1, 0xbc214903), - TOBN(0x2c88f985, 0xb05556e3), TOBN(0xcd96058e, 0x3467081e), - TOBN(0x7d6a4176, 0xedc637ea), TOBN(0xe1743d09, 0x36a5acdc), - TOBN(0x66fd72e2, 0x7eb37726), TOBN(0xf7fa264e, 0x1481a037), - TOBN(0x9fbd3bde, 0x45f4aa79), TOBN(0xed1e0147, 0x767c3e22), - TOBN(0x7621f979, 0x82e7abe2), TOBN(0x19eedc72, 0x45f633f8), - TOBN(0xe69b155e, 0x6137bf3a), TOBN(0xa0ad13ce, 0x414ee94e), - TOBN(0x93e3d524, 0x1c0e651a), TOBN(0xab1a6e2a, 0x02ce227e), - TOBN(0xe7af1797, 0x4ab27eca), TOBN(0x245446de, 0xbd444f39), - TOBN(0x59e22a21, 0x56c07613), TOBN(0x43deafce, 0xf4275498), - TOBN(0x10834ccb, 0x67fd0946), TOBN(0xa75841e5, 0x47406edf), - TOBN(0xebd6a677, 0x7b0ac93d), TOBN(0xa6e37b0d, 0x78f5e0d7), - TOBN(0x2516c096, 0x76f5492b), TOBN(0x1e4bf888, 0x9ac05f3a), - TOBN(0xcdb42ce0, 0x4df0ba2b), TOBN(0x935d5cfd, 0x5062341b), - TOBN(0x8a303333, 0x82acac20), TOBN(0x429438c4, 0x5198b00e), - TOBN(0x1d083bc9, 0x049d33fa), TOBN(0x58b82dda, 0x946f67ff), - TOBN(0xac3e2db8, 0x67a1d6a3), TOBN(0x62e6bead, 0x1798aac8), - TOBN(0xfc85980f, 0xde46c58c), TOBN(0xa7f69379, 0x69c8d7be), - TOBN(0x23557927, 0x837b35ec), TOBN(0x06a933d8, 0xe0790c0c), - TOBN(0x827c0e9b, 0x077ff55d), TOBN(0x53977798, 0xbb26e680), - TOBN(0x59530874, 0x1d9cb54f), TOBN(0xcca3f449, 0x4aac53ef), - TOBN(0x11dc5c87, 0xa07eda0f), TOBN(0xc138bccf, 0xfd6400c8), - TOBN(0x549680d3, 0x13e5da72), TOBN(0xc93eed82, 0x4540617e), - TOBN(0xfd3db157, 0x4d0b75c0), TOBN(0x9716eb42, 0x6386075b), - TOBN(0x0639605c, 0x817b2c16), TOBN(0x09915109, 0xf1e4f201), - TOBN(0x35c9a928, 0x5cca6c3b), TOBN(0xb25f7d1a, 0x3505c900), - TOBN(0xeb9f7d20, 0x630480c4), TOBN(0xc3c7b8c6, 0x2a1a501c), - TOBN(0x3f99183c, 0x5a1f8e24), TOBN(0xfdb118fa, 0x9dd255f0), - TOBN(0xb9b18b90, 0xc27f62a6), TOBN(0xe8f732f7, 0x396ec191), - TOBN(0x524a2d91, 0x0be786ab), TOBN(0x5d32adef, 0x0ac5a0f5), - TOBN(0x9b53d4d6, 0x9725f694), TOBN(0x032a76c6, 0x0510ba89), - TOBN(0x840391a3, 0xebeb1544), TOBN(0x44b7b88c, 0x3ed73ac3), - TOBN(0xd24bae7a, 0x256cb8b3), TOBN(0x7ceb151a, 0xe394cb12), - TOBN(0xbd6b66d0, 0x5bc1e6a8), TOBN(0xec70cecb, 0x090f07bf), - TOBN(0x270644ed, 0x7d937589), TOBN(0xee9e1a3d, 0x5f1dccfe), - TOBN(0xb0d40a84, 0x745b98d2), TOBN(0xda429a21, 0x2556ed40), - TOBN(0xf676eced, 0x85148cb9), TOBN(0x5a22d40c, 0xded18936), - TOBN(0x3bc4b9e5, 0x70e8a4ce), TOBN(0xbfd1445b, 0x9eae0379), - TOBN(0xf23f2c0c, 0x1a0bd47e), TOBN(0xa9c0bb31, 0xe1845531), - TOBN(0x9ddc4d60, 0x0a4c3f6b), TOBN(0xbdfaad79, 0x2c15ef44), - TOBN(0xce55a236, 0x7f484acc), TOBN(0x08653ca7, 0x055b1f15), - TOBN(0x2efa8724, 0x538873a3), TOBN(0x09299e5d, 0xace1c7e7), - TOBN(0x07afab66, 0xade332ba), TOBN(0x9be1fdf6, 0x92dd71b7), - TOBN(0xa49b5d59, 0x5758b11c), TOBN(0x0b852893, 0xc8654f40), - TOBN(0xb63ef6f4, 0x52379447), TOBN(0xd4957d29, 0x105e690c), - TOBN(0x7d484363, 0x646559b0), TOBN(0xf4a8273c, 0x49788a8e), - TOBN(0xee406cb8, 0x34ce54a9), TOBN(0x1e1c260f, 0xf86fda9b), - TOBN(0xe150e228, 0xcf6a4a81), TOBN(0x1fa3b6a3, 0x1b488772), - TOBN(0x1e6ff110, 0xc5a9c15b), TOBN(0xc6133b91, 0x8ad6aa47), - TOBN(0x8ac5d55c, 0x9dffa978), TOBN(0xba1d1c1d, 0x5f3965f2), - TOBN(0xf969f4e0, 0x7732b52f), TOBN(0xfceecdb5, 0xa5172a07), - TOBN(0xb0120a5f, 0x10f2b8f5), TOBN(0xc83a6cdf, 0x5c4c2f63), - TOBN(0x4d47a491, 0xf8f9c213), TOBN(0xd9e1cce5, 0xd3f1bbd5), - TOBN(0x0d91bc7c, 0xaba7e372), TOBN(0xfcdc74c8, 0xdfd1a2db), - TOBN(0x05efa800, 0x374618e5), TOBN(0x11216969, 0x15a7925e), - TOBN(0xd4c89823, 0xf6021c5d), TOBN(0x880d5e84, 0xeff14423), - TOBN(0x6523bc5a, 0x6dcd1396), TOBN(0xd1acfdfc, 0x113c978b), - TOBN(0xb0c164e8, 0xbbb66840), TOBN(0xf7f4301e, 0x72b58459), - TOBN(0xc29ad4a6, 0xa638e8ec), TOBN(0xf5ab8961, 0x46b78699), - TOBN(0x9dbd7974, 0x0e954750), TOBN(0x0121de88, 0x64f9d2c6), - TOBN(0x2e597b42, 0xd985232e), TOBN(0x55b6c3c5, 0x53451777), - TOBN(0xbb53e547, 0x519cb9fb), TOBN(0xf134019f, 0x8428600d), - TOBN(0x5a473176, 0xe081791a), TOBN(0x2f3e2263, 0x35fb0c08), - TOBN(0xb28c3017, 0x73d273b0), TOBN(0xccd21076, 0x7721ef9a), - TOBN(0x054cc292, 0xb650dc39), TOBN(0x662246de, 0x6188045e), - TOBN(0x904b52fa, 0x6b83c0d1), TOBN(0xa72df267, 0x97e9cd46), - TOBN(0x886b43cd, 0x899725e4), TOBN(0x2b651688, 0xd849ff22), - TOBN(0x60479b79, 0x02f34533), TOBN(0x5e354c14, 0x0c77c148), - TOBN(0xb4bb7581, 0xa8537c78), TOBN(0x188043d7, 0xefe1495f), - TOBN(0x9ba12f42, 0x8c1d5026), TOBN(0x2e0c8a26, 0x93d4aaab), - TOBN(0xbdba7b8b, 0xaa57c450), TOBN(0x140c9ad6, 0x9bbdafef), - TOBN(0x2067aa42, 0x25ac0f18), TOBN(0xf7b1295b, 0x04d1fbf3), - TOBN(0x14829111, 0xa4b04824), TOBN(0x2ce3f192, 0x33bd5e91), - TOBN(0x9c7a1d55, 0x8f2e1b72), TOBN(0xfe932286, 0x302aa243), - TOBN(0x497ca7b4, 0xd4be9554), TOBN(0xb8e821b8, 0xe0547a6e), - TOBN(0xfb2838be, 0x67e573e0), TOBN(0x05891db9, 0x4084c44b), - TOBN(0x91311373, 0x96c1c2c5), TOBN(0x6aebfa3f, 0xd958444b), - TOBN(0xac9cdce9, 0xe56e55c1), TOBN(0x7148ced3, 0x2caa46d0), - TOBN(0x2e10c7ef, 0xb61fe8eb), TOBN(0x9fd835da, 0xff97cf4d)}, - {TOBN(0xa36da109, 0x081e9387), TOBN(0xfb9780d7, 0x8c935828), - TOBN(0xd5940332, 0xe540b015), TOBN(0xc9d7b51b, 0xe0f466fa), - TOBN(0xfaadcd41, 0xd6d9f671), TOBN(0xba6c1e28, 0xb1a2ac17), - TOBN(0x066a7833, 0xed201e5f), TOBN(0x19d99719, 0xf90f462b), - TOBN(0xf431f462, 0x060b5f61), TOBN(0xa56f46b4, 0x7bd057c2), - TOBN(0x348dca6c, 0x47e1bf65), TOBN(0x9a38783e, 0x41bcf1ff), - TOBN(0x7a5d33a9, 0xda710718), TOBN(0x5a779987, 0x2e0aeaf6), - TOBN(0xca87314d, 0x2d29d187), TOBN(0xfa0edc3e, 0xc687d733), - TOBN(0x9df33621, 0x6a31e09b), TOBN(0xde89e44d, 0xc1350e35), - TOBN(0x29214871, 0x4ca0cf52), TOBN(0xdf379672, 0x0b88a538), - TOBN(0xc92a510a, 0x2591d61b), TOBN(0x79aa87d7, 0x585b447b), - TOBN(0xf67db604, 0xe5287f77), TOBN(0x1697c8bf, 0x5efe7a80), - TOBN(0x1c894849, 0xcb198ac7), TOBN(0xa884a93d, 0x0f264665), - TOBN(0x2da964ef, 0x9b200678), TOBN(0x3c351b87, 0x009834e6), - TOBN(0xafb2ef9f, 0xe2c4b44b), TOBN(0x580f6c47, 0x3326790c), - TOBN(0xb8480521, 0x0b02264a), TOBN(0x8ba6f9e2, 0x42a194e2), - TOBN(0xfc87975f, 0x8fb54738), TOBN(0x35160788, 0x27c3ead3), - TOBN(0x834116d2, 0xb74a085a), TOBN(0x53c99a73, 0xa62fe996), - TOBN(0x87585be0, 0x5b81c51b), TOBN(0x925bafa8, 0xbe0852b7), - TOBN(0x76a4fafd, 0xa84d19a7), TOBN(0x39a45982, 0x585206d4), - TOBN(0x499b6ab6, 0x5eb03c0e), TOBN(0xf19b7954, 0x72bc3fde), - TOBN(0xa86b5b9c, 0x6e3a80d2), TOBN(0xe4377508, 0x6d42819f), - TOBN(0xc1663650, 0xbb3ee8a3), TOBN(0x75eb14fc, 0xb132075f), - TOBN(0xa8ccc906, 0x7ad834f6), TOBN(0xea6a2474, 0xe6e92ffd), - TOBN(0x9d72fd95, 0x0f8d6758), TOBN(0xcb84e101, 0x408c07dd), - TOBN(0xb9114bfd, 0xa5e23221), TOBN(0x358b5fe2, 0xe94e742c), - TOBN(0x1c0577ec, 0x95f40e75), TOBN(0xf0155451, 0x3d73f3d6), - TOBN(0x9d55cd67, 0xbd1b9b66), TOBN(0x63e86e78, 0xaf8d63c7), - TOBN(0x39d934ab, 0xd3c095f1), TOBN(0x04b261be, 0xe4b76d71), - TOBN(0x1d2e6970, 0xe73e6984), TOBN(0x879fb23b, 0x5e5fcb11), - TOBN(0x11506c72, 0xdfd75490), TOBN(0x3a97d085, 0x61bcf1c1), - TOBN(0x43201d82, 0xbf5e7007), TOBN(0x7f0ac52f, 0x798232a7), - TOBN(0x2715cbc4, 0x6eb564d4), TOBN(0x8d6c752c, 0x9e570e29), - TOBN(0xf80247c8, 0x9ef5fd5d), TOBN(0xc3c66b46, 0xd53eb514), - TOBN(0x9666b401, 0x0f87de56), TOBN(0xce62c06f, 0xc6c603b5), - TOBN(0xae7b4c60, 0x7e4fc942), TOBN(0x38ac0b77, 0x663a9c19), - TOBN(0xcb4d20ee, 0x4b049136), TOBN(0x8b63bf12, 0x356a4613), - TOBN(0x1221aef6, 0x70e08128), TOBN(0xe62d8c51, 0x4acb6b16), - TOBN(0x71f64a67, 0x379e7896), TOBN(0xb25237a2, 0xcafd7fa5), - TOBN(0xf077bd98, 0x3841ba6a), TOBN(0xc4ac0244, 0x3cd16e7e), - TOBN(0x548ba869, 0x21fea4ca), TOBN(0xd36d0817, 0xf3dfdac1), - TOBN(0x09d8d71f, 0xf4685faf), TOBN(0x8eff66be, 0xc52c459a), - TOBN(0x182faee7, 0x0b57235e), TOBN(0xee3c39b1, 0x0106712b), - TOBN(0x5107331f, 0xc0fcdcb0), TOBN(0x669fb9dc, 0xa51054ba), - TOBN(0xb25101fb, 0x319d7682), TOBN(0xb0293129, 0x0a982fee), - TOBN(0x51c1c9b9, 0x0261b344), TOBN(0x0e008c5b, 0xbfd371fa), - TOBN(0xd866dd1c, 0x0278ca33), TOBN(0x666f76a6, 0xe5aa53b1), - TOBN(0xe5cfb779, 0x6013a2cf), TOBN(0x1d3a1aad, 0xa3521836), - TOBN(0xcedd2531, 0x73faa485), TOBN(0xc8ee6c4f, 0xc0a76878), - TOBN(0xddbccfc9, 0x2a11667d), TOBN(0x1a418ea9, 0x1c2f695a), - TOBN(0xdb11bd92, 0x51f73971), TOBN(0x3e4b3c82, 0xda2ed89f), - TOBN(0x9a44f3f4, 0xe73e0319), TOBN(0xd1e3de0f, 0x303431af), - TOBN(0x3c5604ff, 0x50f75f9c), TOBN(0x1d8eddf3, 0x7e752b22), - TOBN(0x0ef074dd, 0x3c9a1118), TOBN(0xd0ffc172, 0xccb86d7b), - TOBN(0xabd1ece3, 0x037d90f2), TOBN(0xe3f307d6, 0x6055856c), - TOBN(0x422f9328, 0x7e4c6daf), TOBN(0x902aac66, 0x334879a0), - TOBN(0xb6a1e7bf, 0x94cdfade), TOBN(0x6c97e1ed, 0x7fc6d634), - TOBN(0x662ad24d, 0xa2fb63f8), TOBN(0xf81be1b9, 0xa5928405), - TOBN(0x86d765e4, 0xd14b4206), TOBN(0xbecc2e0e, 0x8fa0db65), - TOBN(0xa28838e0, 0xb17fc76c), TOBN(0xe49a602a, 0xe37cf24e), - TOBN(0x76b4131a, 0x567193ec), TOBN(0xaf3c305a, 0xe5f6e70b), - TOBN(0x9587bd39, 0x031eebdd), TOBN(0x5709def8, 0x71bbe831), - TOBN(0x57059983, 0x0eb2b669), TOBN(0x4d80ce1b, 0x875b7029), - TOBN(0x838a7da8, 0x0364ac16), TOBN(0x2f431d23, 0xbe1c83ab), - TOBN(0xe56812a6, 0xf9294dd3), TOBN(0xb448d01f, 0x9b4b0d77), - TOBN(0xf3ae6061, 0x04e8305c), TOBN(0x2bead645, 0x94d8c63e), - TOBN(0x0a85434d, 0x84fd8b07), TOBN(0x537b983f, 0xf7a9dee5), - TOBN(0xedcc5f18, 0xef55bd85), TOBN(0x2041af62, 0x21c6cf8b), - TOBN(0x8e52874c, 0xb940c71e), TOBN(0x211935a9, 0xdb5f4b3a), - TOBN(0x94350492, 0x301b1dc3), TOBN(0x33d2646d, 0x29958620), - TOBN(0x16b0d64b, 0xef911404), TOBN(0x9d1f25ea, 0x9a3c5ef4), - TOBN(0x20f200eb, 0x4a352c78), TOBN(0x43929f2c, 0x4bd0b428), - TOBN(0xa5656667, 0xc7196e29), TOBN(0x7992c2f0, 0x9391be48), - TOBN(0xaaa97cbd, 0x9ee0cd6e), TOBN(0x51b0310c, 0x3dc8c9bf), - TOBN(0x237f8acf, 0xdd9f22cb), TOBN(0xbb1d81a1, 0xb585d584), - TOBN(0x8d5d85f5, 0x8c416388), TOBN(0x0d6e5a5a, 0x42fe474f), - TOBN(0xe7812766, 0x38235d4e), TOBN(0x1c62bd67, 0x496e3298), - TOBN(0x8378660c, 0x3f175bc8), TOBN(0x4d04e189, 0x17afdd4d), - TOBN(0x32a81601, 0x85a8068c), TOBN(0xdb58e4e1, 0x92b29a85), - TOBN(0xe8a65b86, 0xc70d8a3b), TOBN(0x5f0e6f4e, 0x98a0403b), - TOBN(0x08129684, 0x69ed2370), TOBN(0x34dc30bd, 0x0871ee26), - TOBN(0x3a5ce948, 0x7c9c5b05), TOBN(0x7d487b80, 0x43a90c87), - TOBN(0x4089ba37, 0xdd0e7179), TOBN(0x45f80191, 0xb4041811), - TOBN(0x1c3e1058, 0x98747ba5), TOBN(0x98c4e13a, 0x6e1ae592), - TOBN(0xd44636e6, 0xe82c9f9e), TOBN(0x711db87c, 0xc33a1043), - TOBN(0x6f431263, 0xaa8aec05), TOBN(0x43ff120d, 0x2744a4aa), - TOBN(0xd3bd892f, 0xae77779b), TOBN(0xf0fe0cc9, 0x8cdc9f82), - TOBN(0xca5f7fe6, 0xf1c5b1bc), TOBN(0xcc63a682, 0x44929a72), - TOBN(0xc7eaba0c, 0x09dbe19a), TOBN(0x2f3585ad, 0x6b5c73c2), - TOBN(0x8ab8924b, 0x0ae50c30), TOBN(0x17fcd27a, 0x638b30ba), - TOBN(0xaf414d34, 0x10b3d5a5), TOBN(0x09c107d2, 0x2a9accf1), - TOBN(0x15dac49f, 0x946a6242), TOBN(0xaec3df2a, 0xd707d642), - TOBN(0x2c2492b7, 0x3f894ae0), TOBN(0xf59df3e5, 0xb75f18ce), - TOBN(0x7cb740d2, 0x8f53cad0), TOBN(0x3eb585fb, 0xc4f01294), - TOBN(0x17da0c86, 0x32c7f717), TOBN(0xeb8c795b, 0xaf943f4c), - TOBN(0x4ee23fb5, 0xf67c51d2), TOBN(0xef187575, 0x68889949), - TOBN(0xa6b4bdb2, 0x0389168b), TOBN(0xc4ecd258, 0xea577d03), - TOBN(0x3a63782b, 0x55743082), TOBN(0x6f678f4c, 0xc72f08cd), - TOBN(0x553511cf, 0x65e58dd8), TOBN(0xd53b4e3e, 0xd402c0cd), - TOBN(0x37de3e29, 0xa037c14c), TOBN(0x86b6c516, 0xc05712aa), - TOBN(0x2834da3e, 0xb38dff6f), TOBN(0xbe012c52, 0xea636be8), - TOBN(0x292d238c, 0x61dd37f8), TOBN(0x0e54523f, 0x8f8142db), - TOBN(0xe31eb436, 0x036a05d8), TOBN(0x83e3cdff, 0x1e93c0ff), - TOBN(0x3fd2fe0f, 0x50821ddf), TOBN(0xc8e19b0d, 0xff9eb33b), - TOBN(0xc8cc943f, 0xb569a5fe), TOBN(0xad0090d4, 0xd4342d75), - TOBN(0x82090b4b, 0xcaeca000), TOBN(0xca39687f, 0x1bd410eb), - TOBN(0xe7bb0df7, 0x65959d77), TOBN(0x39d78218, 0x9c964999), - TOBN(0xd87f62e8, 0xb2415451), TOBN(0xe5efb774, 0xbed76108), - TOBN(0x3ea011a4, 0xe822f0d0), TOBN(0xbc647ad1, 0x5a8704f8), - TOBN(0xbb315b35, 0x50c6820f), TOBN(0x863dec3d, 0xb7e76bec), - TOBN(0x01ff5d3a, 0xf017bfc7), TOBN(0x20054439, 0x976b8229), - TOBN(0x067fca37, 0x0bbd0d3b), TOBN(0xf63dde64, 0x7f5e3d0f), - TOBN(0x22dbefb3, 0x2a4c94e9), TOBN(0xafbff0fe, 0x96f8278a), - TOBN(0x80aea0b1, 0x3503793d), TOBN(0xb2238029, 0x5f06cd29), - TOBN(0x65703e57, 0x8ec3feca), TOBN(0x06c38314, 0x393e7053), - TOBN(0xa0b751eb, 0x7c6734c4), TOBN(0xd2e8a435, 0xc59f0f1e), - TOBN(0x147d9052, 0x5e9ca895), TOBN(0x2f4dd31e, 0x972072df), - TOBN(0xa16fda8e, 0xe6c6755c), TOBN(0xc66826ff, 0xcf196558), - TOBN(0x1f1a76a3, 0x0cf43895), TOBN(0xa9d604e0, 0x83c3097b), - TOBN(0xe1908309, 0x66390e0e), TOBN(0xa50bf753, 0xb3c85eff), - TOBN(0x0696bdde, 0xf6a70251), TOBN(0x548b801b, 0x3c6ab16a), - TOBN(0x37fcf704, 0xa4d08762), TOBN(0x090b3def, 0xdff76c4e), - TOBN(0x87e8cb89, 0x69cb9158), TOBN(0x44a90744, 0x995ece43), - TOBN(0xf85395f4, 0x0ad9fbf5), TOBN(0x49b0f6c5, 0x4fb0c82d), - TOBN(0x75d9bc15, 0xadf7cccf), TOBN(0x81a3e5d6, 0xdfa1e1b0), - TOBN(0x8c39e444, 0x249bc17e), TOBN(0xf37dccb2, 0x8ea7fd43), - TOBN(0xda654873, 0x907fba12), TOBN(0x35daa6da, 0x4a372904), - TOBN(0x0564cfc6, 0x6283a6c5), TOBN(0xd09fa4f6, 0x4a9395bf), - TOBN(0x688e9ec9, 0xaeb19a36), TOBN(0xd913f1ce, 0xc7bfbfb4), - TOBN(0x797b9a3c, 0x61c2faa6), TOBN(0x2f979bec, 0x6a0a9c12), - TOBN(0xb5969d0f, 0x359679ec), TOBN(0xebcf523d, 0x079b0460), - TOBN(0xfd6b0008, 0x10fab870), TOBN(0x3f2edcda, 0x9373a39c), - TOBN(0x0d64f9a7, 0x6f568431), TOBN(0xf848c27c, 0x02f8898c), - TOBN(0xf418ade1, 0x260b5bd5), TOBN(0xc1f3e323, 0x6973dee8), - TOBN(0x46e9319c, 0x26c185dd), TOBN(0x6d85b7d8, 0x546f0ac4), - TOBN(0x427965f2, 0x247f9d57), TOBN(0xb519b636, 0xb0035f48), - TOBN(0x6b6163a9, 0xab87d59c), TOBN(0xff9f58c3, 0x39caaa11), - TOBN(0x4ac39cde, 0x3177387b), TOBN(0x5f6557c2, 0x873e77f9), - TOBN(0x67504006, 0x36a83041), TOBN(0x9b1c96ca, 0x75ef196c), - TOBN(0xf34283de, 0xb08c7940), TOBN(0x7ea09644, 0x1128c316), - TOBN(0xb510b3b5, 0x6aa39dff), TOBN(0x59b43da2, 0x9f8e4d8c), - TOBN(0xa8ce31fd, 0x9e4c4b9f), TOBN(0x0e20be26, 0xc1303c01), - TOBN(0x18187182, 0xe8ee47c9), TOBN(0xd9687cdb, 0x7db98101), - TOBN(0x7a520e4d, 0xa1e14ff6), TOBN(0x429808ba, 0x8836d572), - TOBN(0xa37ca60d, 0x4944b663), TOBN(0xf901f7a9, 0xa3f91ae5), - TOBN(0xe4e3e76e, 0x9e36e3b1), TOBN(0x9aa219cf, 0x29d93250), - TOBN(0x347fe275, 0x056a2512), TOBN(0xa4d643d9, 0xde65d95c), - TOBN(0x9669d396, 0x699fc3ed), TOBN(0xb598dee2, 0xcf8c6bbe), - TOBN(0x682ac1e5, 0xdda9e5c6), TOBN(0x4e0d3c72, 0xcaa9fc95), - TOBN(0x17faaade, 0x772bea44), TOBN(0x5ef8428c, 0xab0009c8), - TOBN(0xcc4ce47a, 0x460ff016), TOBN(0xda6d12bf, 0x725281cb), - TOBN(0x44c67848, 0x0223aad2), TOBN(0x6e342afa, 0x36256e28), - TOBN(0x1400bb0b, 0x93a37c04), TOBN(0x62b1bc9b, 0xdd10bd96), - TOBN(0x7251adeb, 0x0dac46b7), TOBN(0x7d33b92e, 0x7be4ef51), - TOBN(0x28b2a94b, 0xe61fa29a), TOBN(0x4b2be13f, 0x06422233), - TOBN(0x36d6d062, 0x330d8d37), TOBN(0x5ef80e1e, 0xb28ca005), - TOBN(0x174d4699, 0x6d16768e), TOBN(0x9fc4ff6a, 0x628bf217), - TOBN(0x77705a94, 0x154e490d), TOBN(0x9d96dd28, 0x8d2d997a), - TOBN(0x77e2d9d8, 0xce5d72c4), TOBN(0x9d06c5a4, 0xc11c714f), - TOBN(0x02aa5136, 0x79e4a03e), TOBN(0x1386b3c2, 0x030ff28b), - TOBN(0xfe82e8a6, 0xfb283f61), TOBN(0x7df203e5, 0xf3abc3fb), - TOBN(0xeec7c351, 0x3a4d3622), TOBN(0xf7d17dbf, 0xdf762761), - TOBN(0xc3956e44, 0x522055f0), TOBN(0xde3012db, 0x8fa748db), - TOBN(0xca9fcb63, 0xbf1dcc14), TOBN(0xa56d9dcf, 0xbe4e2f3a), - TOBN(0xb86186b6, 0x8bcec9c2), TOBN(0x7cf24df9, 0x680b9f06), - TOBN(0xc46b45ea, 0xc0d29281), TOBN(0xfff42bc5, 0x07b10e12), - TOBN(0x12263c40, 0x4d289427), TOBN(0x3d5f1899, 0xb4848ec4), - TOBN(0x11f97010, 0xd040800c), TOBN(0xb4c5f529, 0x300feb20), - TOBN(0xcc543f8f, 0xde94fdcb), TOBN(0xe96af739, 0xc7c2f05e), - TOBN(0xaa5e0036, 0x882692e1), TOBN(0x09c75b68, 0x950d4ae9), - TOBN(0x62f63df2, 0xb5932a7a), TOBN(0x2658252e, 0xde0979ad), - TOBN(0x2a19343f, 0xb5e69631), TOBN(0x718c7501, 0x525b666b), - TOBN(0x26a42d69, 0xea40dc3a), TOBN(0xdc84ad22, 0xaecc018f), - TOBN(0x25c36c7b, 0x3270f04a), TOBN(0x46ba6d47, 0x50fa72ed), - TOBN(0x6c37d1c5, 0x93e58a8e), TOBN(0xa2394731, 0x120c088c), - TOBN(0xc3be4263, 0xcb6e86da), TOBN(0x2c417d36, 0x7126d038), - TOBN(0x5b70f9c5, 0x8b6f8efa), TOBN(0x671a2faa, 0x37718536), - TOBN(0xd3ced3c6, 0xb539c92b), TOBN(0xe56f1bd9, 0xa31203c2), - TOBN(0x8b096ec4, 0x9ff3c8eb), TOBN(0x2deae432, 0x43491cea), - TOBN(0x2465c6eb, 0x17943794), TOBN(0x5d267e66, 0x20586843), - TOBN(0x9d3d116d, 0xb07159d0), TOBN(0xae07a67f, 0xc1896210), - TOBN(0x8fc84d87, 0xbb961579), TOBN(0x30009e49, 0x1c1f8dd6), - TOBN(0x8a8caf22, 0xe3132819), TOBN(0xcffa197c, 0xf23ab4ff), - TOBN(0x58103a44, 0x205dd687), TOBN(0x57b796c3, 0x0ded67a2), - TOBN(0x0b9c3a6c, 0xa1779ad7), TOBN(0xa33cfe2e, 0x357c09c5), - TOBN(0x2ea29315, 0x3db4a57e), TOBN(0x91959695, 0x8ebeb52e), - TOBN(0x118db9a6, 0xe546c879), TOBN(0x8e996df4, 0x6295c8d6), - TOBN(0xdd990484, 0x55ec806b), TOBN(0x24f291ca, 0x165c1035), - TOBN(0xcca523bb, 0x440e2229), TOBN(0x324673a2, 0x73ef4d04), - TOBN(0xaf3adf34, 0x3e11ec39), TOBN(0x6136d7f1, 0xdc5968d3), - TOBN(0x7a7b2899, 0xb053a927), TOBN(0x3eaa2661, 0xae067ecd), - TOBN(0x8549b9c8, 0x02779cd9), TOBN(0x061d7940, 0xc53385ea), - TOBN(0x3e0ba883, 0xf06d18bd), TOBN(0x4ba6de53, 0xb2700843), - TOBN(0xb966b668, 0x591a9e4d), TOBN(0x93f67567, 0x7f4fa0ed), - TOBN(0x5a02711b, 0x4347237b), TOBN(0xbc041e2f, 0xe794608e), - TOBN(0x55af10f5, 0x70f73d8c), TOBN(0xd2d4d4f7, 0xbb7564f7), - TOBN(0xd7d27a89, 0xb3e93ce7), TOBN(0xf7b5a875, 0x5d3a2c1b), - TOBN(0xb29e68a0, 0x255b218a), TOBN(0xb533837e, 0x8af76754), - TOBN(0xd1b05a73, 0x579fab2e), TOBN(0xb41055a1, 0xecd74385), - TOBN(0xb2369274, 0x445e9115), TOBN(0x2972a7c4, 0xf520274e), - TOBN(0x6c08334e, 0xf678e68a), TOBN(0x4e4160f0, 0x99b057ed), - TOBN(0x3cfe11b8, 0x52ccb69a), TOBN(0x2fd1823a, 0x21c8f772), - TOBN(0xdf7f072f, 0x3298f055), TOBN(0x8c0566f9, 0xfec74a6e), - TOBN(0xe549e019, 0x5bb4d041), TOBN(0x7c3930ba, 0x9208d850), - TOBN(0xe07141fc, 0xaaa2902b), TOBN(0x539ad799, 0xe4f69ad3), - TOBN(0xa6453f94, 0x813f9ffd), TOBN(0xc58d3c48, 0x375bc2f7), - TOBN(0xb3326fad, 0x5dc64e96), TOBN(0x3aafcaa9, 0xb240e354), - TOBN(0x1d1b0903, 0xaca1e7a9), TOBN(0x4ceb9767, 0x1211b8a0), - TOBN(0xeca83e49, 0xe32a858e), TOBN(0x4c32892e, 0xae907bad), - TOBN(0xd5b42ab6, 0x2eb9b494), TOBN(0x7fde3ee2, 0x1eabae1b), - TOBN(0x13b5ab09, 0xcaf54957), TOBN(0xbfb028be, 0xe5f5d5d5), - TOBN(0x928a0650, 0x2003e2c0), TOBN(0x90793aac, 0x67476843), - TOBN(0x5e942e79, 0xc81710a0), TOBN(0x557e4a36, 0x27ccadd4), - TOBN(0x72a2bc56, 0x4bcf6d0c), TOBN(0x09ee5f43, 0x26d7b80c), - TOBN(0x6b70dbe9, 0xd4292f19), TOBN(0x56f74c26, 0x63f16b18), - TOBN(0xc23db0f7, 0x35fbb42a), TOBN(0xb606bdf6, 0x6ae10040), - TOBN(0x1eb15d4d, 0x044573ac), TOBN(0x7dc3cf86, 0x556b0ba4), - TOBN(0x97af9a33, 0xc60df6f7), TOBN(0x0b1ef85c, 0xa716ce8c), - TOBN(0x2922f884, 0xc96958be), TOBN(0x7c32fa94, 0x35690963), - TOBN(0x2d7f667c, 0xeaa00061), TOBN(0xeaaf7c17, 0x3547365c), - TOBN(0x1eb4de46, 0x87032d58), TOBN(0xc54f3d83, 0x5e2c79e0), - TOBN(0x07818df4, 0x5d04ef23), TOBN(0x55faa9c8, 0x673d41b4), - TOBN(0xced64f6f, 0x89b95355), TOBN(0x4860d2ea, 0xb7415c84), - TOBN(0x5fdb9bd2, 0x050ebad3), TOBN(0xdb53e0cc, 0x6685a5bf), - TOBN(0xb830c031, 0x9feb6593), TOBN(0xdd87f310, 0x6accff17), - TOBN(0x2303ebab, 0x9f555c10), TOBN(0x94603695, 0x287e7065), - TOBN(0xf88311c3, 0x2e83358c), TOBN(0x508dd9b4, 0xeefb0178), - TOBN(0x7ca23706, 0x2dba8652), TOBN(0x62aac5a3, 0x0047abe5), - TOBN(0x9a61d2a0, 0x8b1ea7b3), TOBN(0xd495ab63, 0xae8b1485), - TOBN(0x38740f84, 0x87052f99), TOBN(0x178ebe5b, 0xb2974eea), - TOBN(0x030bbcca, 0x5b36d17f), TOBN(0xb5e4cce3, 0xaaf86eea), - TOBN(0xb51a0220, 0x68f8e9e0), TOBN(0xa4348796, 0x09eb3e75), - TOBN(0xbe592309, 0xeef1a752), TOBN(0x5d7162d7, 0x6f2aa1ed), - TOBN(0xaebfb5ed, 0x0f007dd2), TOBN(0x255e14b2, 0xc89edd22), - TOBN(0xba85e072, 0x0303b697), TOBN(0xc5d17e25, 0xf05720ff), - TOBN(0x02b58d6e, 0x5128ebb6), TOBN(0x2c80242d, 0xd754e113), - TOBN(0x919fca5f, 0xabfae1ca), TOBN(0x937afaac, 0x1a21459b), - TOBN(0x9e0ca91c, 0x1f66a4d2), TOBN(0x194cc7f3, 0x23ec1331), - TOBN(0xad25143a, 0x8aa11690), TOBN(0xbe40ad8d, 0x09b59e08), - TOBN(0x37d60d9b, 0xe750860a), TOBN(0x6c53b008, 0xc6bf434c), - TOBN(0xb572415d, 0x1356eb80), TOBN(0xb8bf9da3, 0x9578ded8), - TOBN(0x22658e36, 0x5e8fb38b), TOBN(0x9b70ce22, 0x5af8cb22), - TOBN(0x7c00018a, 0x829a8180), TOBN(0x84329f93, 0xb81ed295), - TOBN(0x7c343ea2, 0x5f3cea83), TOBN(0x38f8655f, 0x67586536), - TOBN(0xa661a0d0, 0x1d3ec517), TOBN(0x98744652, 0x512321ae), - TOBN(0x084ca591, 0xeca92598), TOBN(0xa9bb9dc9, 0x1dcb3feb), - TOBN(0x14c54355, 0x78b4c240), TOBN(0x5ed62a3b, 0x610cafdc), - TOBN(0x07512f37, 0x1b38846b), TOBN(0x571bb70a, 0xb0e38161), - TOBN(0xb556b95b, 0x2da705d2), TOBN(0x3ef8ada6, 0xb1a08f98), - TOBN(0x85302ca7, 0xddecfbe5), TOBN(0x0e530573, 0x943105cd), - TOBN(0x60554d55, 0x21a9255d), TOBN(0x63a32fa1, 0xf2f3802a), - TOBN(0x35c8c5b0, 0xcd477875), TOBN(0x97f458ea, 0x6ad42da1), - TOBN(0x832d7080, 0xeb6b242d), TOBN(0xd30bd023, 0x3b71e246), - TOBN(0x7027991b, 0xbe31139d), TOBN(0x68797e91, 0x462e4e53), - TOBN(0x423fe20a, 0x6b4e185a), TOBN(0x82f2c67e, 0x42d9b707), - TOBN(0x25c81768, 0x4cf7811b), TOBN(0xbd53005e, 0x045bb95d)}, - {TOBN(0xe5f649be, 0x9d8e68fd), TOBN(0xdb0f0533, 0x1b044320), - TOBN(0xf6fde9b3, 0xe0c33398), TOBN(0x92f4209b, 0x66c8cfae), - TOBN(0xe9d1afcc, 0x1a739d4b), TOBN(0x09aea75f, 0xa28ab8de), - TOBN(0x14375fb5, 0xeac6f1d0), TOBN(0x6420b560, 0x708f7aa5), - TOBN(0x9eae499c, 0x6254dc41), TOBN(0x7e293924, 0x7a837e7e), - TOBN(0x74aec08c, 0x090524a7), TOBN(0xf82b9219, 0x8d6f55f2), - TOBN(0x493c962e, 0x1402cec5), TOBN(0x9f17ca17, 0xfa2f30e7), - TOBN(0xbcd783e8, 0xe9b879cb), TOBN(0xea3d8c14, 0x5a6f145f), - TOBN(0xdede15e7, 0x5e0dee6e), TOBN(0x74f24872, 0xdc628aa2), - TOBN(0xd3e9c4fe, 0x7861bb93), TOBN(0x56d4822a, 0x6187b2e0), - TOBN(0xb66417cf, 0xc59826f9), TOBN(0xca260969, 0x2408169e), - TOBN(0xedf69d06, 0xc79ef885), TOBN(0x00031f8a, 0xdc7d138f), - TOBN(0x103c46e6, 0x0ebcf726), TOBN(0x4482b831, 0x6231470e), - TOBN(0x6f6dfaca, 0x487c2109), TOBN(0x2e0ace97, 0x62e666ef), - TOBN(0x3246a9d3, 0x1f8d1f42), TOBN(0x1b1e83f1, 0x574944d2), - TOBN(0x13dfa63a, 0xa57f334b), TOBN(0x0cf8daed, 0x9f025d81), - TOBN(0x30d78ea8, 0x00ee11c1), TOBN(0xeb053cd4, 0xb5e3dd75), - TOBN(0x9b65b13e, 0xd58c43c5), TOBN(0xc3ad49bd, 0xbd151663), - TOBN(0x99fd8e41, 0xb6427990), TOBN(0x12cf15bd, 0x707eae1e), - TOBN(0x29ad4f1b, 0x1aabb71e), TOBN(0x5143e74d, 0x07545d0e), - TOBN(0x30266336, 0xc88bdee1), TOBN(0x25f29306, 0x5876767c), - TOBN(0x9c078571, 0xc6731996), TOBN(0xc88690b2, 0xed552951), - TOBN(0x274f2c2d, 0x852705b4), TOBN(0xb0bf8d44, 0x4e09552d), - TOBN(0x7628beeb, 0x986575d1), TOBN(0x407be238, 0x7f864651), - TOBN(0x0e5e3049, 0xa639fc6b), TOBN(0xe75c35d9, 0x86003625), - TOBN(0x0cf35bd8, 0x5dcc1646), TOBN(0x8bcaced2, 0x6c26273a), - TOBN(0xe22ecf1d, 0xb5536742), TOBN(0x013dd897, 0x1a9e068b), - TOBN(0x17f411cb, 0x8a7909c5), TOBN(0x5757ac98, 0x861dd506), - TOBN(0x85de1f0d, 0x1e935abb), TOBN(0xdefd10b4, 0x154de37a), - TOBN(0xb8d9e392, 0x369cebb5), TOBN(0x54d5ef9b, 0x761324be), - TOBN(0x4d6341ba, 0x74f17e26), TOBN(0xc0a0e3c8, 0x78c1dde4), - TOBN(0xa6d77581, 0x87d918fd), TOBN(0x66876015, 0x02ca3a13), - TOBN(0xc7313e9c, 0xf36658f0), TOBN(0xc433ef1c, 0x71f8057e), - TOBN(0x85326246, 0x1b6a835a), TOBN(0xc8f05398, 0x7c86394c), - TOBN(0xff398cdf, 0xe983c4a1), TOBN(0xbf5e8162, 0x03b7b931), - TOBN(0x93193c46, 0xb7b9045b), TOBN(0x1e4ebf5d, 0xa4a6e46b), - TOBN(0xf9942a60, 0x43a24fe7), TOBN(0x29c1191e, 0xffb3492b), - TOBN(0x9f662449, 0x902fde05), TOBN(0xc792a7ac, 0x6713c32d), - TOBN(0x2fd88ad8, 0xb737982c), TOBN(0x7e3a0319, 0xa21e60e3), - TOBN(0x09b0de44, 0x7383591a), TOBN(0x6df141ee, 0x8310a456), - TOBN(0xaec1a039, 0xe6d6f471), TOBN(0x14b2ba0f, 0x1198d12e), - TOBN(0xebc1a160, 0x3aeee5ac), TOBN(0x401f4836, 0xe0b964ce), - TOBN(0x2ee43796, 0x4fd03f66), TOBN(0x3fdb4e49, 0xdd8f3f12), - TOBN(0x6ef267f6, 0x29380f18), TOBN(0x3e8e9670, 0x8da64d16), - TOBN(0xbc19180c, 0x207674f1), TOBN(0x112e09a7, 0x33ae8fdb), - TOBN(0x99667554, 0x6aaeb71e), TOBN(0x79432af1, 0xe101b1c7), - TOBN(0xd5eb558f, 0xde2ddec6), TOBN(0x81392d1f, 0x5357753f), - TOBN(0xa7a76b97, 0x3ae1158a), TOBN(0x416fbbff, 0x4a899991), - TOBN(0x9e65fdfd, 0x0d4a9dcf), TOBN(0x7bc29e48, 0x944ddf12), - TOBN(0xbc1a92d9, 0x3c856866), TOBN(0x273c6905, 0x6e98dfe2), - TOBN(0x69fce418, 0xcdfaa6b8), TOBN(0x606bd823, 0x5061c69f), - TOBN(0x42d495a0, 0x6af75e27), TOBN(0x8ed3d505, 0x6d873a1f), - TOBN(0xaf552841, 0x6ab25b6a), TOBN(0xc6c0ffc7, 0x2b1a4523), - TOBN(0xab18827b, 0x21c99e03), TOBN(0x060e8648, 0x9034691b), - TOBN(0x5207f90f, 0x93c7f398), TOBN(0x9f4a96cb, 0x82f8d10b), - TOBN(0xdd71cd79, 0x3ad0f9e3), TOBN(0x84f435d2, 0xfc3a54f5), - TOBN(0x4b03c55b, 0x8e33787f), TOBN(0xef42f975, 0xa6384673), - TOBN(0xff7304f7, 0x5051b9f0), TOBN(0x18aca1dc, 0x741c87c2), - TOBN(0x56f120a7, 0x2d4bfe80), TOBN(0xfd823b3d, 0x053e732c), - TOBN(0x11bccfe4, 0x7537ca16), TOBN(0xdf6c9c74, 0x1b5a996b), - TOBN(0xee7332c7, 0x904fc3fa), TOBN(0x14a23f45, 0xc7e3636a), - TOBN(0xc38659c3, 0xf091d9aa), TOBN(0x4a995e5d, 0xb12d8540), - TOBN(0x20a53bec, 0xf3a5598a), TOBN(0x56534b17, 0xb1eaa995), - TOBN(0x9ed3dca4, 0xbf04e03c), TOBN(0x716c563a, 0xd8d56268), - TOBN(0x27ba77a4, 0x1d6178e7), TOBN(0xe4c80c40, 0x68a1ff8e), - TOBN(0x75011099, 0x0a13f63d), TOBN(0x7bf33521, 0xa61d46f3), - TOBN(0x0aff218e, 0x10b365bb), TOBN(0x81021804, 0x0fd7ea75), - TOBN(0x05a3fd8a, 0xa4b3a925), TOBN(0xb829e75f, 0x9b3db4e6), - TOBN(0x6bdc75a5, 0x4d53e5fb), TOBN(0x04a5dc02, 0xd52717e3), - TOBN(0x86af502f, 0xe9a42ec2), TOBN(0x8867e8fb, 0x2630e382), - TOBN(0xbf845c6e, 0xbec9889b), TOBN(0x54f491f2, 0xcb47c98d), - TOBN(0xa3091fba, 0x790c2a12), TOBN(0xd7f6fd78, 0xc20f708b), - TOBN(0xa569ac30, 0xacde5e17), TOBN(0xd0f996d0, 0x6852b4d7), - TOBN(0xe51d4bb5, 0x4609ae54), TOBN(0x3fa37d17, 0x0daed061), - TOBN(0x62a88684, 0x34b8fb41), TOBN(0x99a2acbd, 0x9efb64f1), - TOBN(0xb75c1a5e, 0x6448e1f2), TOBN(0xfa99951a, 0x42b5a069), - TOBN(0x6d956e89, 0x2f3b26e7), TOBN(0xf4709860, 0xda875247), - TOBN(0x3ad15179, 0x2482dda3), TOBN(0xd64110e3, 0x017d82f0), - TOBN(0x14928d2c, 0xfad414e4), TOBN(0x2b155f58, 0x2ed02b24), - TOBN(0x481a141b, 0xcb821bf1), TOBN(0x12e3c770, 0x4f81f5da), - TOBN(0xe49c5de5, 0x9fff8381), TOBN(0x11053232, 0x5bbec894), - TOBN(0xa0d051cc, 0x454d88c4), TOBN(0x4f6db89c, 0x1f8e531b), - TOBN(0x34fe3fd6, 0xca563a44), TOBN(0x7f5c2215, 0x58da8ab9), - TOBN(0x8445016d, 0x9474f0a1), TOBN(0x17d34d61, 0xcb7d8a0a), - TOBN(0x8e9d3910, 0x1c474019), TOBN(0xcaff2629, 0xd52ceefb), - TOBN(0xf9cf3e32, 0xc1622c2b), TOBN(0xd4b95e3c, 0xe9071a05), - TOBN(0xfbbca61f, 0x1594438c), TOBN(0x1eb6e6a6, 0x04aadedf), - TOBN(0x853027f4, 0x68e14940), TOBN(0x221d322a, 0xdfabda9c), - TOBN(0xed8ea9f6, 0xb7cb179a), TOBN(0xdc7b764d, 0xb7934dcc), - TOBN(0xfcb13940, 0x5e09180d), TOBN(0x6629a6bf, 0xb47dc2dd), - TOBN(0xbfc55e4e, 0x9f5a915e), TOBN(0xb1db9d37, 0x6204441e), - TOBN(0xf82d68cf, 0x930c5f53), TOBN(0x17d3a142, 0xcbb605b1), - TOBN(0xdd5944ea, 0x308780f2), TOBN(0xdc8de761, 0x3845f5e4), - TOBN(0x6beaba7d, 0x7624d7a3), TOBN(0x1e709afd, 0x304df11e), - TOBN(0x95364376, 0x02170456), TOBN(0xbf204b3a, 0xc8f94b64), - TOBN(0x4e53af7c, 0x5680ca68), TOBN(0x0526074a, 0xe0c67574), - TOBN(0x95d8cef8, 0xecd92af6), TOBN(0xe6b9fa7a, 0x6cd1745a), - TOBN(0x3d546d3d, 0xa325c3e4), TOBN(0x1f57691d, 0x9ae93aae), - TOBN(0xe891f3fe, 0x9d2e1a33), TOBN(0xd430093f, 0xac063d35), - TOBN(0xeda59b12, 0x5513a327), TOBN(0xdc2134f3, 0x5536f18f), - TOBN(0xaa51fe2c, 0x5c210286), TOBN(0x3f68aaee, 0x1cab658c), - TOBN(0x5a23a00b, 0xf9357292), TOBN(0x9a626f39, 0x7efdabed), - TOBN(0xfe2b3bf3, 0x199d78e3), TOBN(0xb7a2af77, 0x71bbc345), - TOBN(0x3d19827a, 0x1e59802c), TOBN(0x823bbc15, 0xb487a51c), - TOBN(0x856139f2, 0x99d0a422), TOBN(0x9ac3df65, 0xf456c6fb), - TOBN(0xaddf65c6, 0x701f8bd6), TOBN(0x149f321e, 0x3758df87), - TOBN(0xb1ecf714, 0x721b7eba), TOBN(0xe17df098, 0x31a3312a), - TOBN(0xdb2fd6ec, 0xd5c4d581), TOBN(0xfd02996f, 0x8fcea1b3), - TOBN(0xe29fa63e, 0x7882f14f), TOBN(0xc9f6dc35, 0x07c6cadc), - TOBN(0x46f22d6f, 0xb882bed0), TOBN(0x1a45755b, 0xd118e52c), - TOBN(0x9f2c7c27, 0x7c4608cf), TOBN(0x7ccbdf32, 0x568012c2), - TOBN(0xfcb0aedd, 0x61729b0e), TOBN(0x7ca2ca9e, 0xf7d75dbf), - TOBN(0xf58fecb1, 0x6f640f62), TOBN(0xe274b92b, 0x39f51946), - TOBN(0x7f4dfc04, 0x6288af44), TOBN(0x0a91f32a, 0xeac329e5), - TOBN(0x43ad274b, 0xd6aaba31), TOBN(0x719a1640, 0x0f6884f9), - TOBN(0x685d29f6, 0xdaf91e20), TOBN(0x5ec1cc33, 0x27e49d52), - TOBN(0x38f4de96, 0x3b54a059), TOBN(0x0e0015e5, 0xefbcfdb3), - TOBN(0x177d23d9, 0x4dbb8da6), TOBN(0x98724aa2, 0x97a617ad), - TOBN(0x30f0885b, 0xfdb6558e), TOBN(0xf9f7a28a, 0xc7899a96), - TOBN(0xd2ae8ac8, 0x872dc112), TOBN(0xfa0642ca, 0x73c3c459), - TOBN(0x15296981, 0xe7dfc8d6), TOBN(0x67cd4450, 0x1fb5b94a), - TOBN(0x0ec71cf1, 0x0eddfd37), TOBN(0xc7e5eeb3, 0x9a8eddc7), - TOBN(0x02ac8e3d, 0x81d95028), TOBN(0x0088f172, 0x70b0e35d), - TOBN(0xec041fab, 0xe1881fe3), TOBN(0x62cf71b8, 0xd99e7faa), - TOBN(0x5043dea7, 0xe0f222c2), TOBN(0x309d42ac, 0x72e65142), - TOBN(0x94fe9ddd, 0x9216cd30), TOBN(0xd6539c7d, 0x0f87feec), - TOBN(0x03c5a57c, 0x432ac7d7), TOBN(0x72692cf0, 0x327fda10), - TOBN(0xec28c85f, 0x280698de), TOBN(0x2331fb46, 0x7ec283b1), - TOBN(0xd34bfa32, 0x2867e633), TOBN(0x78709a82, 0x0a9cc815), - TOBN(0xb7fe6964, 0x875e2fa5), TOBN(0x25cc064f, 0x9e98bfb5), - TOBN(0x9eb0151c, 0x493a65c5), TOBN(0x5fb5d941, 0x53182464), - TOBN(0x69e6f130, 0xf04618e2), TOBN(0xa8ecec22, 0xf89c8ab6), - TOBN(0xcd6ac88b, 0xb96209bd), TOBN(0x65fa8cdb, 0xb3e1c9e0), - TOBN(0xa47d22f5, 0x4a8d8eac), TOBN(0x83895cdf, 0x8d33f963), - TOBN(0xa8adca59, 0xb56cd3d1), TOBN(0x10c8350b, 0xdaf38232), - TOBN(0x2b161fb3, 0xa5080a9f), TOBN(0xbe7f5c64, 0x3af65b3a), - TOBN(0x2c754039, 0x97403a11), TOBN(0x94626cf7, 0x121b96af), - TOBN(0x431de7c4, 0x6a983ec2), TOBN(0x3780dd3a, 0x52cc3df7), - TOBN(0xe28a0e46, 0x2baf8e3b), TOBN(0xabe68aad, 0x51d299ae), - TOBN(0x603eb8f9, 0x647a2408), TOBN(0x14c61ed6, 0x5c750981), - TOBN(0x88b34414, 0xc53352e7), TOBN(0x5a34889c, 0x1337d46e), - TOBN(0x612c1560, 0xf95f2bc8), TOBN(0x8a3f8441, 0xd4807a3a), - TOBN(0x680d9e97, 0x5224da68), TOBN(0x60cd6e88, 0xc3eb00e9), - TOBN(0x3875a98e, 0x9a6bc375), TOBN(0xdc80f924, 0x4fd554c2), - TOBN(0x6c4b3415, 0x6ac77407), TOBN(0xa1e5ea8f, 0x25420681), - TOBN(0x541bfa14, 0x4607a458), TOBN(0x5dbc7e7a, 0x96d7fbf9), - TOBN(0x646a851b, 0x31590a47), TOBN(0x039e85ba, 0x15ee6df8), - TOBN(0xd19fa231, 0xd7b43fc0), TOBN(0x84bc8be8, 0x299a0e04), - TOBN(0x2b9d2936, 0xf20df03a), TOBN(0x24054382, 0x8608d472), - TOBN(0x76b6ba04, 0x9149202a), TOBN(0xb21c3831, 0x3670e7b7), - TOBN(0xddd93059, 0xd6fdee10), TOBN(0x9da47ad3, 0x78488e71), - TOBN(0x99cc1dfd, 0xa0fcfb25), TOBN(0x42abde10, 0x64696954), - TOBN(0x14cc15fc, 0x17eab9fe), TOBN(0xd6e863e4, 0xd3e70972), - TOBN(0x29a7765c, 0x6432112c), TOBN(0x88660001, 0x5b0774d8), - TOBN(0x3729175a, 0x2c088eae), TOBN(0x13afbcae, 0x8230b8d4), - TOBN(0x44768151, 0x915f4379), TOBN(0xf086431a, 0xd8d22812), - TOBN(0x37461955, 0xc298b974), TOBN(0x905fb5f0, 0xf8711e04), - TOBN(0x787abf3a, 0xfe969d18), TOBN(0x392167c2, 0x6f6a494e), - TOBN(0xfc7a0d2d, 0x28c511da), TOBN(0xf127c7dc, 0xb66a262d), - TOBN(0xf9c4bb95, 0xfd63fdf0), TOBN(0x90016589, 0x3913ef46), - TOBN(0x74d2a73c, 0x11aa600d), TOBN(0x2f5379bd, 0x9fb5ab52), - TOBN(0xe49e53a4, 0x7fb70068), TOBN(0x68dd39e5, 0x404aa9a7), - TOBN(0xb9b0cf57, 0x2ecaa9c3), TOBN(0xba0e103b, 0xe824826b), - TOBN(0x60c2198b, 0x4631a3c4), TOBN(0xc5ff84ab, 0xfa8966a2), - TOBN(0x2d6ebe22, 0xac95aff8), TOBN(0x1c9bb6db, 0xb5a46d09), - TOBN(0x419062da, 0x53ee4f8d), TOBN(0x7b9042d0, 0xbb97efef), - TOBN(0x0f87f080, 0x830cf6bd), TOBN(0x4861d19a, 0x6ec8a6c6), - TOBN(0xd3a0daa1, 0x202f01aa), TOBN(0xb0111674, 0xf25afbd5), - TOBN(0x6d00d6cf, 0x1afb20d9), TOBN(0x13695000, 0x40671bc5), - TOBN(0x913ab0dc, 0x2485ea9b), TOBN(0x1f2bed06, 0x9eef61ac), - TOBN(0x850c8217, 0x6d799e20), TOBN(0x93415f37, 0x3271c2de), - TOBN(0x5afb06e9, 0x6c4f5910), TOBN(0x688a52df, 0xc4e9e421), - TOBN(0x30495ba3, 0xe2a9a6db), TOBN(0x4601303d, 0x58f9268b), - TOBN(0xbe3b0dad, 0x7eb0f04f), TOBN(0x4ea47250, 0x4456936d), - TOBN(0x8caf8798, 0xd33fd3e7), TOBN(0x1ccd8a89, 0xeb433708), - TOBN(0x9effe3e8, 0x87fd50ad), TOBN(0xbe240a56, 0x6b29c4df), - TOBN(0xec4ffd98, 0xca0e7ebd), TOBN(0xf586783a, 0xe748616e), - TOBN(0xa5b00d8f, 0xc77baa99), TOBN(0x0acada29, 0xb4f34c9c), - TOBN(0x36dad67d, 0x0fe723ac), TOBN(0x1d8e53a5, 0x39c36c1e), - TOBN(0xe4dd342d, 0x1f4bea41), TOBN(0x64fd5e35, 0xebc9e4e0), - TOBN(0x96f01f90, 0x57908805), TOBN(0xb5b9ea3d, 0x5ed480dd), - TOBN(0x366c5dc2, 0x3efd2dd0), TOBN(0xed2fe305, 0x6e9dfa27), - TOBN(0x4575e892, 0x6e9197e2), TOBN(0x11719c09, 0xab502a5d), - TOBN(0x264c7bec, 0xe81f213f), TOBN(0x741b9241, 0x55f5c457), - TOBN(0x78ac7b68, 0x49a5f4f4), TOBN(0xf91d70a2, 0x9fc45b7d), - TOBN(0x39b05544, 0xb0f5f355), TOBN(0x11f06bce, 0xeef930d9), - TOBN(0xdb84d25d, 0x038d05e1), TOBN(0x04838ee5, 0xbacc1d51), - TOBN(0x9da3ce86, 0x9e8ee00b), TOBN(0xc3412057, 0xc36eda1f), - TOBN(0xae80b913, 0x64d9c2f4), TOBN(0x7468bac3, 0xa010a8ff), - TOBN(0xdfd20037, 0x37359d41), TOBN(0x1a0f5ab8, 0x15efeacc), - TOBN(0x7c25ad2f, 0x659d0ce0), TOBN(0x4011bcbb, 0x6785cff1), - TOBN(0x128b9912, 0x7e2192c7), TOBN(0xa549d8e1, 0x13ccb0e8), - TOBN(0x805588d8, 0xc85438b1), TOBN(0x5680332d, 0xbc25cb27), - TOBN(0xdcd1bc96, 0x1a4bfdf4), TOBN(0x779ff428, 0x706f6566), - TOBN(0x8bbee998, 0xf059987a), TOBN(0xf6ce8cf2, 0xcc686de7), - TOBN(0xf8ad3c4a, 0x953cfdb2), TOBN(0xd1d426d9, 0x2205da36), - TOBN(0xb3c0f13f, 0xc781a241), TOBN(0x3e89360e, 0xd75362a8), - TOBN(0xccd05863, 0xc8a91184), TOBN(0x9bd0c9b7, 0xefa8a7f4), - TOBN(0x97ee4d53, 0x8a912a4b), TOBN(0xde5e15f8, 0xbcf518fd), - TOBN(0x6a055bf8, 0xc467e1e0), TOBN(0x10be4b4b, 0x1587e256), - TOBN(0xd90c14f2, 0x668621c9), TOBN(0xd5518f51, 0xab9c92c1), - TOBN(0x8e6a0100, 0xd6d47b3c), TOBN(0xcbe980dd, 0x66716175), - TOBN(0x500d3f10, 0xddd83683), TOBN(0x3b6cb35d, 0x99cac73c), - TOBN(0x53730c8b, 0x6083d550), TOBN(0xcf159767, 0xdf0a1987), - TOBN(0x84bfcf53, 0x43ad73b3), TOBN(0x1b528c20, 0x4f035a94), - TOBN(0x4294edf7, 0x33eeac69), TOBN(0xb6283e83, 0x817f3240), - TOBN(0xc3fdc959, 0x0a5f25b1), TOBN(0xefaf8aa5, 0x5844ee22), - TOBN(0xde269ba5, 0xdbdde4de), TOBN(0xe3347160, 0xc56133bf), - TOBN(0xc1184219, 0x8d9ea9f8), TOBN(0x090de5db, 0xf3fc1ab5), - TOBN(0x404c37b1, 0x0bf22cda), TOBN(0x7de20ec8, 0xf5618894), - TOBN(0x754c588e, 0xecdaecab), TOBN(0x6ca4b0ed, 0x88342743), - TOBN(0x76f08bdd, 0xf4a938ec), TOBN(0xd182de89, 0x91493ccb), - TOBN(0xd652c53e, 0xc8a4186a), TOBN(0xb3e878db, 0x946d8e33), - TOBN(0x088453c0, 0x5f37663c), TOBN(0x5cd9daaa, 0xb407748b), - TOBN(0xa1f5197f, 0x586d5e72), TOBN(0x47500be8, 0xc443ca59), - TOBN(0x78ef35b2, 0xe2652424), TOBN(0x09c5d26f, 0x6dd7767d), - TOBN(0x7175a79a, 0xa74d3f7b), TOBN(0x0428fd8d, 0xcf5ea459), - TOBN(0x511cb97c, 0xa5d1746d), TOBN(0x36363939, 0xe71d1278), - TOBN(0xcf2df955, 0x10350bf4), TOBN(0xb3817439, 0x60aae782), - TOBN(0xa748c0e4, 0x3e688809), TOBN(0x98021fbf, 0xd7a5a006), - TOBN(0x9076a70c, 0x0e367a98), TOBN(0xbea1bc15, 0x0f62b7c2), - TOBN(0x2645a68c, 0x30fe0343), TOBN(0xacaffa78, 0x699dc14f), - TOBN(0xf4469964, 0x457bf9c4), TOBN(0x0db6407b, 0x0d2ead83), - TOBN(0x68d56cad, 0xb2c6f3eb), TOBN(0x3b512e73, 0xf376356c), - TOBN(0xe43b0e1f, 0xfce10408), TOBN(0x89ddc003, 0x5a5e257d), - TOBN(0xb0ae0d12, 0x0362e5b3), TOBN(0x07f983c7, 0xb0519161), - TOBN(0xc2e94d15, 0x5d5231e7), TOBN(0xcff22aed, 0x0b4f9513), - TOBN(0xb02588dd, 0x6ad0b0b5), TOBN(0xb967d1ac, 0x11d0dcd5), - TOBN(0x8dac6bc6, 0xcf777b6c), TOBN(0x0062bdbd, 0x4c6d1959), - TOBN(0x53da71b5, 0x0ef5cc85), TOBN(0x07012c7d, 0x4006f14f), - TOBN(0x4617f962, 0xac47800d), TOBN(0x53365f2b, 0xc102ed75), - TOBN(0xb422efcb, 0x4ab8c9d3), TOBN(0x195cb26b, 0x34af31c9), - TOBN(0x3a926e29, 0x05f2c4ce), TOBN(0xbd2bdecb, 0x9856966c), - TOBN(0x5d16ab3a, 0x85527015), TOBN(0x9f81609e, 0x4486c231), - TOBN(0xd8b96b2c, 0xda350002), TOBN(0xbd054690, 0xfa1b7d36), - TOBN(0xdc90ebf5, 0xe71d79bc), TOBN(0xf241b6f9, 0x08964e4e), - TOBN(0x7c838643, 0x2fe3cd4c), TOBN(0xe0f33acb, 0xb4bc633c), - TOBN(0xb4a9ecec, 0x3d139f1f), TOBN(0x05ce69cd, 0xdc4a1f49), - TOBN(0xa19d1b16, 0xf5f98aaf), TOBN(0x45bb71d6, 0x6f23e0ef), - TOBN(0x33789fcd, 0x46cdfdd3), TOBN(0x9b8e2978, 0xcee040ca), - TOBN(0x9c69b246, 0xae0a6828), TOBN(0xba533d24, 0x7078d5aa), - TOBN(0x7a2e42c0, 0x7bb4fbdb), TOBN(0xcfb4879a, 0x7035385c), - TOBN(0x8c3dd30b, 0x3281705b), TOBN(0x7e361c6c, 0x404fe081), - TOBN(0x7b21649c, 0x3f604edf), TOBN(0x5dbf6a3f, 0xe52ffe47), - TOBN(0xc41b7c23, 0x4b54d9bf), TOBN(0x1374e681, 0x3511c3d9), - TOBN(0x1863bf16, 0xc1b2b758), TOBN(0x90e78507, 0x1e9e6a96), - TOBN(0xab4bf98d, 0x5d86f174), TOBN(0xd74e0bd3, 0x85e96fe4), - TOBN(0x8afde39f, 0xcac5d344), TOBN(0x90946dbc, 0xbd91b847), - TOBN(0xf5b42358, 0xfe1a838c), TOBN(0x05aae6c5, 0x620ac9d8), - TOBN(0x8e193bd8, 0xa1ce5a0b), TOBN(0x8f710571, 0x4dabfd72), - TOBN(0x8d8fdd48, 0x182caaac), TOBN(0x8c4aeefa, 0x040745cf), - TOBN(0x73c6c30a, 0xf3b93e6d), TOBN(0x991241f3, 0x16f42011), - TOBN(0xa0158eea, 0xe457a477), TOBN(0xd19857db, 0xee6ddc05), - TOBN(0xb3265224, 0x18c41671), TOBN(0x3ffdfc7e, 0x3c2c0d58), - TOBN(0x3a3a5254, 0x26ee7cda), TOBN(0x341b0869, 0xdf02c3a8), - TOBN(0xa023bf42, 0x723bbfc8), TOBN(0x3d15002a, 0x14452691)}, - {TOBN(0x5ef7324c, 0x85edfa30), TOBN(0x25976554, 0x87d4f3da), - TOBN(0x352f5bc0, 0xdcb50c86), TOBN(0x8f6927b0, 0x4832a96c), - TOBN(0xd08ee1ba, 0x55f2f94c), TOBN(0x6a996f99, 0x344b45fa), - TOBN(0xe133cb8d, 0xa8aa455d), TOBN(0x5d0721ec, 0x758dc1f7), - TOBN(0x6ba7a920, 0x79e5fb67), TOBN(0xe1331feb, 0x70aa725e), - TOBN(0x5080ccf5, 0x7df5d837), TOBN(0xe4cae01d, 0x7ff72e21), - TOBN(0xd9243ee6, 0x0412a77d), TOBN(0x06ff7cac, 0xdf449025), - TOBN(0xbe75f7cd, 0x23ef5a31), TOBN(0xbc957822, 0x0ddef7a8), - TOBN(0x8cf7230c, 0xb0ce1c55), TOBN(0x5b534d05, 0x0bbfb607), - TOBN(0xee1ef113, 0x0e16363b), TOBN(0x27e0aa7a, 0xb4999e82), - TOBN(0xce1dac2d, 0x79362c41), TOBN(0x67920c90, 0x91bb6cb0), - TOBN(0x1e648d63, 0x2223df24), TOBN(0x0f7d9eef, 0xe32e8f28), - TOBN(0x6943f39a, 0xfa833834), TOBN(0x22951722, 0xa6328562), - TOBN(0x81d63dd5, 0x4170fc10), TOBN(0x9f5fa58f, 0xaecc2e6d), - TOBN(0xb66c8725, 0xe77d9a3b), TOBN(0x11235cea, 0x6384ebe0), - TOBN(0x06a8c118, 0x5845e24a), TOBN(0x0137b286, 0xebd093b1), - TOBN(0xc589e1ce, 0x44ace150), TOBN(0xe0f8d3d9, 0x4381e97c), - TOBN(0x59e99b11, 0x62c5a4b8), TOBN(0x90d262f7, 0xfd0ec9f9), - TOBN(0xfbc854c9, 0x283e13c9), TOBN(0x2d04fde7, 0xaedc7085), - TOBN(0x057d7765, 0x47dcbecb), TOBN(0x8dbdf591, 0x9a76fa5f), - TOBN(0xd0150695, 0x0de1e578), TOBN(0x2e1463e7, 0xe9f72bc6), - TOBN(0xffa68441, 0x1b39eca5), TOBN(0x673c8530, 0x7c037f2f), - TOBN(0xd0d6a600, 0x747f91da), TOBN(0xb08d43e1, 0xc9cb78e9), - TOBN(0x0fc0c644, 0x27b5cef5), TOBN(0x5c1d160a, 0xa60a2fd6), - TOBN(0xf98cae53, 0x28c8e13b), TOBN(0x375f10c4, 0xb2eddcd1), - TOBN(0xd4eb8b7f, 0x5cce06ad), TOBN(0xb4669f45, 0x80a2e1ef), - TOBN(0xd593f9d0, 0x5bbd8699), TOBN(0x5528a4c9, 0xe7976d13), - TOBN(0x3923e095, 0x1c7e28d3), TOBN(0xb9293790, 0x3f6bb577), - TOBN(0xdb567d6a, 0xc42bd6d2), TOBN(0x6df86468, 0xbb1f96ae), - TOBN(0x0efe5b1a, 0x4843b28e), TOBN(0x961bbb05, 0x6379b240), - TOBN(0xb6caf5f0, 0x70a6a26b), TOBN(0x70686c0d, 0x328e6e39), - TOBN(0x80da06cf, 0x895fc8d3), TOBN(0x804d8810, 0xb363fdc9), - TOBN(0xbe22877b, 0x207f1670), TOBN(0x9b0dd188, 0x4e615291), - TOBN(0x625ae8dc, 0x97a3c2bf), TOBN(0x08584ef7, 0x439b86e8), - TOBN(0xde7190a5, 0xdcd898ff), TOBN(0x26286c40, 0x2058ee3d), - TOBN(0x3db0b217, 0x5f87b1c1), TOBN(0xcc334771, 0x102a6db5), - TOBN(0xd99de954, 0x2f770fb1), TOBN(0x97c1c620, 0x4cd7535e), - TOBN(0xd3b6c448, 0x3f09cefc), TOBN(0xd725af15, 0x5a63b4f8), - TOBN(0x0c95d24f, 0xc01e20ec), TOBN(0xdfd37494, 0x9ae7121f), - TOBN(0x7d6ddb72, 0xec77b7ec), TOBN(0xfe079d3b, 0x0353a4ae), - TOBN(0x3066e70a, 0x2e6ac8d2), TOBN(0x9c6b5a43, 0x106e5c05), - TOBN(0x52d3c6f5, 0xede59b8c), TOBN(0x30d6a5c3, 0xfccec9ae), - TOBN(0xedec7c22, 0x4fc0a9ef), TOBN(0x190ff083, 0x95c16ced), - TOBN(0xbe12ec8f, 0x94de0fde), TOBN(0x0d131ab8, 0x852d3433), - TOBN(0x42ace07e, 0x85701291), TOBN(0x94793ed9, 0x194061a8), - TOBN(0x30e83ed6, 0xd7f4a485), TOBN(0x9eec7269, 0xf9eeff4d), - TOBN(0x90acba59, 0x0c9d8005), TOBN(0x5feca458, 0x1e79b9d1), - TOBN(0x8fbe5427, 0x1d506a1e), TOBN(0xa32b2c8e, 0x2439cfa7), - TOBN(0x1671c173, 0x73dd0b4e), TOBN(0x37a28214, 0x44a054c6), - TOBN(0x81760a1b, 0x4e8b53f1), TOBN(0xa6c04224, 0xf9f93b9e), - TOBN(0x18784b34, 0xcf671e3c), TOBN(0x81bbecd2, 0xcda9b994), - TOBN(0x38831979, 0xb2ab3848), TOBN(0xef54feb7, 0xf2e03c2d), - TOBN(0xcf197ca7, 0xfb8088fa), TOBN(0x01427247, 0x4ddc96c5), - TOBN(0xa2d2550a, 0x30777176), TOBN(0x53469898, 0x4d0cf71d), - TOBN(0x6ce937b8, 0x3a2aaac6), TOBN(0xe9f91dc3, 0x5af38d9b), - TOBN(0x2598ad83, 0xc8bf2899), TOBN(0x8e706ac9, 0xb5536c16), - TOBN(0x40dc7495, 0xf688dc98), TOBN(0x26490cd7, 0x124c4afc), - TOBN(0xe651ec84, 0x1f18775c), TOBN(0x393ea6c3, 0xb4fdaf4a), - TOBN(0x1e1f3343, 0x7f338e0d), TOBN(0x39fb832b, 0x6053e7b5), - TOBN(0x46e702da, 0x619e14d5), TOBN(0x859cacd1, 0xcdeef6e0), - TOBN(0x63b99ce7, 0x4462007d), TOBN(0xb8ab48a5, 0x4cb5f5b7), - TOBN(0x9ec673d2, 0xf55edde7), TOBN(0xd1567f74, 0x8cfaefda), - TOBN(0x46381b6b, 0x0887bcec), TOBN(0x694497ce, 0xe178f3c2), - TOBN(0x5e6525e3, 0x1e6266cb), TOBN(0x5931de26, 0x697d6413), - TOBN(0x87f8df7c, 0x0e58d493), TOBN(0xb1ae5ed0, 0x58b73f12), - TOBN(0xc368f784, 0xdea0c34d), TOBN(0x9bd0a120, 0x859a91a0), - TOBN(0xb00d88b7, 0xcc863c68), TOBN(0x3a1cc11e, 0x3d1f4d65), - TOBN(0xea38e0e7, 0x0aa85593), TOBN(0x37f13e98, 0x7dc4aee8), - TOBN(0x10d38667, 0xbc947bad), TOBN(0x738e07ce, 0x2a36ee2e), - TOBN(0xc93470cd, 0xc577fcac), TOBN(0xdee1b616, 0x2782470d), - TOBN(0x36a25e67, 0x2e793d12), TOBN(0xd6aa6cae, 0xe0f186da), - TOBN(0x474d0fd9, 0x80e07af7), TOBN(0xf7cdc47d, 0xba8a5cd4), - TOBN(0x28af6d9d, 0xab15247f), TOBN(0x7c789c10, 0x493a537f), - TOBN(0x7ac9b110, 0x23a334e7), TOBN(0x0236ac09, 0x12c9c277), - TOBN(0xa7e5bd25, 0x1d7a5144), TOBN(0x098b9c2a, 0xf13ec4ec), - TOBN(0x3639daca, 0xd3f0abca), TOBN(0x642da81a, 0xa23960f9), - TOBN(0x7d2e5c05, 0x4f7269b1), TOBN(0xfcf30777, 0xe287c385), - TOBN(0x10edc84f, 0xf2a46f21), TOBN(0x35441757, 0x4f43fa36), - TOBN(0xf1327899, 0xfd703431), TOBN(0xa438d7a6, 0x16dd587a), - TOBN(0x65c34c57, 0xe9c8352d), TOBN(0xa728edab, 0x5cc5a24e), - TOBN(0xaed78abc, 0x42531689), TOBN(0x0a51a0e8, 0x010963ef), - TOBN(0x5776fa0a, 0xd717d9b3), TOBN(0xf356c239, 0x7dd3428b), - TOBN(0x29903fff, 0x8d3a3dac), TOBN(0x409597fa, 0x3d94491f), - TOBN(0x4cd7a5ff, 0xbf4a56a4), TOBN(0xe5096474, 0x8adab462), - TOBN(0xa97b5126, 0x5c3427b0), TOBN(0x6401405c, 0xd282c9bd), - TOBN(0x3629f8d7, 0x222c5c45), TOBN(0xb1c02c16, 0xe8d50aed), - TOBN(0xbea2ed75, 0xd9635bc9), TOBN(0x226790c7, 0x6e24552f), - TOBN(0x3c33f2a3, 0x65f1d066), TOBN(0x2a43463e, 0x6dfccc2e), - TOBN(0x8cc3453a, 0xdb483761), TOBN(0xe7cc6085, 0x65d5672b), - TOBN(0x277ed6cb, 0xde3efc87), TOBN(0x19f2f368, 0x69234eaf), - TOBN(0x9aaf4317, 0x5c0b800b), TOBN(0x1f1e7c89, 0x8b6da6e2), - TOBN(0x6cfb4715, 0xb94ec75e), TOBN(0xd590dd5f, 0x453118c2), - TOBN(0x14e49da1, 0x1f17a34c), TOBN(0x5420ab39, 0x235a1456), - TOBN(0xb7637241, 0x2f50363b), TOBN(0x7b15d623, 0xc3fabb6e), - TOBN(0xa0ef40b1, 0xe274e49c), TOBN(0x5cf50744, 0x96b1860a), - TOBN(0xd6583fbf, 0x66afe5a4), TOBN(0x44240510, 0xf47e3e9a), - TOBN(0x99254343, 0x11b2d595), TOBN(0xf1367499, 0xeec8df57), - TOBN(0x3cb12c61, 0x3e73dd05), TOBN(0xd248c033, 0x7dac102a), - TOBN(0xcf154f13, 0xa77739f5), TOBN(0xbf4288cb, 0x23d2af42), - TOBN(0xaa64c9b6, 0x32e4a1cf), TOBN(0xee8c07a8, 0xc8a208f3), - TOBN(0xe10d4999, 0x6fe8393f), TOBN(0x0f809a3f, 0xe91f3a32), - TOBN(0x61096d1c, 0x802f63c8), TOBN(0x289e1462, 0x57750d3d), - TOBN(0xed06167e, 0x9889feea), TOBN(0xd5c9c0e2, 0xe0993909), - TOBN(0x46fca0d8, 0x56508ac6), TOBN(0x91826047, 0x4f1b8e83), - TOBN(0x4f2c877a, 0x9a4a2751), TOBN(0x71bd0072, 0xcae6fead), - TOBN(0x38df8dcc, 0x06aa1941), TOBN(0x5a074b4c, 0x63beeaa8), - TOBN(0xd6d65934, 0xc1cec8ed), TOBN(0xa6ecb49e, 0xaabc03bd), - TOBN(0xaade91c2, 0xde8a8415), TOBN(0xcfb0efdf, 0x691136e0), - TOBN(0x11af45ee, 0x23ab3495), TOBN(0xa132df88, 0x0b77463d), - TOBN(0x8923c15c, 0x815d06f4), TOBN(0xc3ceb3f5, 0x0d61a436), - TOBN(0xaf52291d, 0xe88fb1da), TOBN(0xea057974, 0x1da12179), - TOBN(0xb0d7218c, 0xd2fef720), TOBN(0x6c0899c9, 0x8e1d8845), - TOBN(0x98157504, 0x752ddad7), TOBN(0xd60bd74f, 0xa1a68a97), - TOBN(0x7047a3a9, 0xf658fb99), TOBN(0x1f5d86d6, 0x5f8511e4), - TOBN(0xb8a4bc42, 0x4b5a6d88), TOBN(0x69eb2c33, 0x1abefa7d), - TOBN(0x95bf39e8, 0x13c9c510), TOBN(0xf571960a, 0xd48aab43), - TOBN(0x7e8cfbcf, 0x704e23c6), TOBN(0xc71b7d22, 0x28aaa65b), - TOBN(0xa041b2bd, 0x245e3c83), TOBN(0x69b98834, 0xd21854ff), - TOBN(0x89d227a3, 0x963bfeec), TOBN(0x99947aaa, 0xde7da7cb), - TOBN(0x1d9ee9db, 0xee68a9b1), TOBN(0x0a08f003, 0x698ec368), - TOBN(0xe9ea4094, 0x78ef2487), TOBN(0xc8d2d415, 0x02cfec26), - TOBN(0xc52f9a6e, 0xb7dcf328), TOBN(0x0ed489e3, 0x85b6a937), - TOBN(0x9b94986b, 0xbef3366e), TOBN(0x0de59c70, 0xedddddb8), - TOBN(0xffdb748c, 0xeadddbe2), TOBN(0x9b9784bb, 0x8266ea40), - TOBN(0x142b5502, 0x1a93507a), TOBN(0xb4cd1187, 0x8d3c06cf), - TOBN(0xdf70e76a, 0x91ec3f40), TOBN(0x484e81ad, 0x4e7553c2), - TOBN(0x830f87b5, 0x272e9d6e), TOBN(0xea1c93e5, 0xc6ff514a), - TOBN(0x67cc2adc, 0xc4192a8e), TOBN(0xc77e27e2, 0x42f4535a), - TOBN(0x9cdbab36, 0xd2b713c5), TOBN(0x86274ea0, 0xcf7b0cd3), - TOBN(0x784680f3, 0x09af826b), TOBN(0xbfcc837a, 0x0c72dea3), - TOBN(0xa8bdfe9d, 0xd6529b73), TOBN(0x708aa228, 0x63a88002), - TOBN(0x6c7a9a54, 0xc91d45b9), TOBN(0xdf1a38bb, 0xfd004f56), - TOBN(0x2e8c9a26, 0xb8bad853), TOBN(0x2d52cea3, 0x3723eae7), - TOBN(0x054d6d81, 0x56ca2830), TOBN(0xa3317d14, 0x9a8dc411), - TOBN(0xa08662fe, 0xfd4ddeda), TOBN(0xed2a153a, 0xb55d792b), - TOBN(0x7035c16a, 0xbfc6e944), TOBN(0xb6bc5834, 0x00171cf3), - TOBN(0xe27152b3, 0x83d102b6), TOBN(0xfe695a47, 0x0646b848), - TOBN(0xa5bb09d8, 0x916e6d37), TOBN(0xb4269d64, 0x0d17015e), - TOBN(0x8d8156a1, 0x0a1d2285), TOBN(0xfeef6c51, 0x46d26d72), - TOBN(0x9dac57c8, 0x4c5434a7), TOBN(0x0282e5be, 0x59d39e31), - TOBN(0xedfff181, 0x721c486d), TOBN(0x301baf10, 0xbc58824e), - TOBN(0x8136a6aa, 0x00570031), TOBN(0x55aaf78c, 0x1cddde68), - TOBN(0x26829371, 0x59c63952), TOBN(0x3a3bd274, 0x8bc25baf), - TOBN(0xecdf8657, 0xb7e52dc3), TOBN(0x2dd8c087, 0xfd78e6c8), - TOBN(0x20553274, 0xf5531461), TOBN(0x8b4a1281, 0x5d95499b), - TOBN(0xe2c8763a, 0x1a80f9d2), TOBN(0xd1dbe32b, 0x4ddec758), - TOBN(0xaf12210d, 0x30c34169), TOBN(0xba74a953, 0x78baa533), - TOBN(0x3d133c6e, 0xa438f254), TOBN(0xa431531a, 0x201bef5b), - TOBN(0x15295e22, 0xf669d7ec), TOBN(0xca374f64, 0x357fb515), - TOBN(0x8a8406ff, 0xeaa3fdb3), TOBN(0x106ae448, 0xdf3f2da8), - TOBN(0x8f9b0a90, 0x33c8e9a1), TOBN(0x234645e2, 0x71ad5885), - TOBN(0x3d083224, 0x1c0aed14), TOBN(0xf10a7d3e, 0x7a942d46), - TOBN(0x7c11deee, 0x40d5c9be), TOBN(0xb2bae7ff, 0xba84ed98), - TOBN(0x93e97139, 0xaad58ddd), TOBN(0x3d872796, 0x3f6d1fa3), - TOBN(0x483aca81, 0x8569ff13), TOBN(0x8b89a5fb, 0x9a600f72), - TOBN(0x4cbc27c3, 0xc06f2b86), TOBN(0x22130713, 0x63ad9c0b), - TOBN(0xb5358b1e, 0x48ac2840), TOBN(0x18311294, 0xecba9477), - TOBN(0xda58f990, 0xa6946b43), TOBN(0x3098baf9, 0x9ab41819), - TOBN(0x66c4c158, 0x4198da52), TOBN(0xab4fc17c, 0x146bfd1b), - TOBN(0x2f0a4c3c, 0xbf36a908), TOBN(0x2ae9e34b, 0x58cf7838), - TOBN(0xf411529e, 0x3fa11b1f), TOBN(0x21e43677, 0x974af2b4), - TOBN(0x7c20958e, 0xc230793b), TOBN(0x710ea885, 0x16e840f3), - TOBN(0xfc0b21fc, 0xc5dc67cf), TOBN(0x08d51647, 0x88405718), - TOBN(0xd955c21f, 0xcfe49eb7), TOBN(0x9722a5d5, 0x56dd4a1f), - TOBN(0xc9ef50e2, 0xc861baa5), TOBN(0xc0c21a5d, 0x9505ac3e), - TOBN(0xaf6b9a33, 0x8b7c063f), TOBN(0xc6370339, 0x2f4779c1), - TOBN(0x22df99c7, 0x638167c3), TOBN(0xfe6ffe76, 0x795db30c), - TOBN(0x2b822d33, 0xa4854989), TOBN(0xfef031dd, 0x30563aa5), - TOBN(0x16b09f82, 0xd57c667f), TOBN(0xc70312ce, 0xcc0b76f1), - TOBN(0xbf04a9e6, 0xc9118aec), TOBN(0x82fcb419, 0x3409d133), - TOBN(0x1a8ab385, 0xab45d44d), TOBN(0xfba07222, 0x617b83a3), - TOBN(0xb05f50dd, 0x58e81b52), TOBN(0x1d8db553, 0x21ce5aff), - TOBN(0x3097b8d4, 0xe344a873), TOBN(0x7d8d116d, 0xfe36d53e), - TOBN(0x6db22f58, 0x7875e750), TOBN(0x2dc5e373, 0x43e144ea), - TOBN(0xc05f32e6, 0xe799eb95), TOBN(0xe9e5f4df, 0x6899e6ec), - TOBN(0xbdc3bd68, 0x1fab23d5), TOBN(0xb72b8ab7, 0x73af60e6), - TOBN(0x8db27ae0, 0x2cecc84a), TOBN(0x600016d8, 0x7bdb871c), - TOBN(0x42a44b13, 0xd7c46f58), TOBN(0xb8919727, 0xc3a77d39), - TOBN(0xcfc6bbbd, 0xdafd6088), TOBN(0x1a740146, 0x6bd20d39), - TOBN(0x8c747abd, 0x98c41072), TOBN(0x4c91e765, 0xbdf68ea1), - TOBN(0x7c95e5ca, 0x08819a78), TOBN(0xcf48b729, 0xc9587921), - TOBN(0x091c7c5f, 0xdebbcc7d), TOBN(0x6f287404, 0xf0e05149), - TOBN(0xf83b5ac2, 0x26cd44ec), TOBN(0x88ae32a6, 0xcfea250e), - TOBN(0x6ac5047a, 0x1d06ebc5), TOBN(0xc7e550b4, 0xd434f781), - TOBN(0x61ab1cf2, 0x5c727bd2), TOBN(0x2e4badb1, 0x1cf915b0), - TOBN(0x1b4dadec, 0xf69d3920), TOBN(0xe61b1ca6, 0xf14c1dfe), - TOBN(0x90b479cc, 0xbd6bd51f), TOBN(0x8024e401, 0x8045ec30), - TOBN(0xcab29ca3, 0x25ef0e62), TOBN(0x4f2e9416, 0x49e4ebc0), - TOBN(0x45eb40ec, 0x0ccced58), TOBN(0x25cd4b9c, 0x0da44f98), - TOBN(0x43e06458, 0x871812c6), TOBN(0x99f80d55, 0x16cef651), - TOBN(0x571340c9, 0xce6dc153), TOBN(0x138d5117, 0xd8665521), - TOBN(0xacdb45bc, 0x4e07014d), TOBN(0x2f34bb38, 0x84b60b91), - TOBN(0xf44a4fd2, 0x2ae8921e), TOBN(0xb039288e, 0x892ba1e2), - TOBN(0x9da50174, 0xb1c180b2), TOBN(0x6b70ab66, 0x1693dc87), - TOBN(0x7e9babc9, 0xe7057481), TOBN(0x4581ddef, 0x9c80dc41), - TOBN(0x0c890da9, 0x51294682), TOBN(0x0b5629d3, 0x3f4736e5), - TOBN(0x2340c79e, 0xb06f5b41), TOBN(0xa42e84ce, 0x4e243469), - TOBN(0xf9a20135, 0x045a71a9), TOBN(0xefbfb415, 0xd27b6fb6), - TOBN(0x25ebea23, 0x9d33cd6f), TOBN(0x9caedb88, 0xaa6c0af8), - TOBN(0x53dc7e9a, 0xd9ce6f96), TOBN(0x3897f9fd, 0x51e0b15a), - TOBN(0xf51cb1f8, 0x8e5d788e), TOBN(0x1aec7ba8, 0xe1d490ee), - TOBN(0x265991e0, 0xcc58cb3c), TOBN(0x9f306e8c, 0x9fc3ad31), - TOBN(0x5fed006e, 0x5040a0ac), TOBN(0xca9d5043, 0xfb476f2e), - TOBN(0xa19c06e8, 0xbeea7a23), TOBN(0xd2865801, 0x0edabb63), - TOBN(0xdb92293f, 0x6967469a), TOBN(0x2894d839, 0x8d8a8ed8), - TOBN(0x87c9e406, 0xbbc77122), TOBN(0x8671c6f1, 0x2ea3a26a), - TOBN(0xe42df8d6, 0xd7de9853), TOBN(0x2e3ce346, 0xb1f2bcc7), - TOBN(0xda601dfc, 0x899d50cf), TOBN(0xbfc913de, 0xfb1b598f), - TOBN(0x81c4909f, 0xe61f7908), TOBN(0x192e304f, 0x9bbc7b29), - TOBN(0xc3ed8738, 0xc104b338), TOBN(0xedbe9e47, 0x783f5d61), - TOBN(0x0c06e9be, 0x2db30660), TOBN(0xda3e613f, 0xc0eb7d8e), - TOBN(0xd8fa3e97, 0x322e096e), TOBN(0xfebd91e8, 0xd336e247), - TOBN(0x8f13ccc4, 0xdf655a49), TOBN(0xa9e00dfc, 0x5eb20210), - TOBN(0x84631d0f, 0xc656b6ea), TOBN(0x93a058cd, 0xd8c0d947), - TOBN(0x6846904a, 0x67bd3448), TOBN(0x4a3d4e1a, 0xf394fd5c), - TOBN(0xc102c1a5, 0xdb225f52), TOBN(0xe3455bba, 0xfc4f5e9a), - TOBN(0x6b36985b, 0x4b9ad1ce), TOBN(0xa9818536, 0x5bb7f793), - TOBN(0x6c25e1d0, 0x48b1a416), TOBN(0x1381dd53, 0x3c81bee7), - TOBN(0xd2a30d61, 0x7a4a7620), TOBN(0xc8412926, 0x39b8944c), - TOBN(0x3c1c6fbe, 0x7a97c33a), TOBN(0x941e541d, 0x938664e7), - TOBN(0x417499e8, 0x4a34f239), TOBN(0x15fdb83c, 0xb90402d5), - TOBN(0xb75f46bf, 0x433aa832), TOBN(0xb61e15af, 0x63215db1), - TOBN(0xaabe59d4, 0xa127f89a), TOBN(0x5d541e0c, 0x07e816da), - TOBN(0xaaba0659, 0xa618b692), TOBN(0x55327733, 0x17266026), - TOBN(0xaf53a0fc, 0x95f57552), TOBN(0x32947650, 0x6cacb0c9), - TOBN(0x253ff58d, 0xc821be01), TOBN(0xb0309531, 0xa06f1146), - TOBN(0x59bbbdf5, 0x05c2e54d), TOBN(0x158f27ad, 0x26e8dd22), - TOBN(0xcc5b7ffb, 0x397e1e53), TOBN(0xae03f65b, 0x7fc1e50d), - TOBN(0xa9784ebd, 0x9c95f0f9), TOBN(0x5ed9deb2, 0x24640771), - TOBN(0x31244af7, 0x035561c4), TOBN(0x87332f3a, 0x7ee857de), - TOBN(0x09e16e9e, 0x2b9e0d88), TOBN(0x52d910f4, 0x56a06049), - TOBN(0x507ed477, 0xa9592f48), TOBN(0x85cb917b, 0x2365d678), - TOBN(0xf8511c93, 0x4c8998d1), TOBN(0x2186a3f1, 0x730ea58f), - TOBN(0x50189626, 0xb2029db0), TOBN(0x9137a6d9, 0x02ceb75a), - TOBN(0x2fe17f37, 0x748bc82c), TOBN(0x87c2e931, 0x80469f8c), - TOBN(0x850f71cd, 0xbf891aa2), TOBN(0x0ca1b89b, 0x75ec3d8d), - TOBN(0x516c43aa, 0x5e1cd3cd), TOBN(0x89397808, 0x9a887c28), - TOBN(0x0059c699, 0xddea1f9f), TOBN(0x7737d6fa, 0x8e6868f7), - TOBN(0x6d93746a, 0x60f1524b), TOBN(0x36985e55, 0xba052aa7), - TOBN(0x41b1d322, 0xed923ea5), TOBN(0x3429759f, 0x25852a11), - TOBN(0xbeca6ec3, 0x092e9f41), TOBN(0x3a238c66, 0x62256bbd), - TOBN(0xd82958ea, 0x70ad487d), TOBN(0x4ac8aaf9, 0x65610d93), - TOBN(0x3fa101b1, 0x5e4ccab0), TOBN(0x9bf430f2, 0x9de14bfb), - TOBN(0xa10f5cc6, 0x6531899d), TOBN(0x590005fb, 0xea8ce17d), - TOBN(0xc437912f, 0x24544cb6), TOBN(0x9987b71a, 0xd79ac2e3), - TOBN(0x13e3d9dd, 0xc058a212), TOBN(0x00075aac, 0xd2de9606), - TOBN(0x80ab508b, 0x6cac8369), TOBN(0x87842be7, 0xf54f6c89), - TOBN(0xa7ad663d, 0x6bc532a4), TOBN(0x67813de7, 0x78a91bc8), - TOBN(0x5dcb61ce, 0xc3427239), TOBN(0x5f3c7cf0, 0xc56934d9), - TOBN(0xc079e0fb, 0xe3191591), TOBN(0xe40896bd, 0xb01aada7), - TOBN(0x8d466791, 0x0492d25f), TOBN(0x8aeb30c9, 0xe7408276), - TOBN(0xe9437495, 0x9287aacc), TOBN(0x23d4708d, 0x79fe03d4), - TOBN(0x8cda9cf2, 0xd0c05199), TOBN(0x502fbc22, 0xfae78454), - TOBN(0xc0bda9df, 0xf572a182), TOBN(0x5f9b71b8, 0x6158b372), - TOBN(0xe0f33a59, 0x2b82dd07), TOBN(0x76302735, 0x9523032e), - TOBN(0x7fe1a721, 0xc4505a32), TOBN(0x7b6e3e82, 0xf796409f)}, - {TOBN(0xe3417bc0, 0x35d0b34a), TOBN(0x440b386b, 0x8327c0a7), - TOBN(0x8fb7262d, 0xac0362d1), TOBN(0x2c41114c, 0xe0cdf943), - TOBN(0x2ba5cef1, 0xad95a0b1), TOBN(0xc09b37a8, 0x67d54362), - TOBN(0x26d6cdd2, 0x01e486c9), TOBN(0x20477abf, 0x42ff9297), - TOBN(0xa004dcb3, 0x292a9287), TOBN(0xddc15cf6, 0x77b092c7), - TOBN(0x083a8464, 0x806c0605), TOBN(0x4a68df70, 0x3db997b0), - TOBN(0x9c134e45, 0x05bf7dd0), TOBN(0xa4e63d39, 0x8ccf7f8c), - TOBN(0xa6e6517f, 0x41b5f8af), TOBN(0xaa8b9342, 0xad7bc1cc), - TOBN(0x126f35b5, 0x1e706ad9), TOBN(0xb99cebb4, 0xc3a9ebdf), - TOBN(0xa75389af, 0xbf608d90), TOBN(0x76113c4f, 0xc6c89858), - TOBN(0x80de8eb0, 0x97e2b5aa), TOBN(0x7e1022cc, 0x63b91304), - TOBN(0x3bdab605, 0x6ccc066c), TOBN(0x33cbb144, 0xb2edf900), - TOBN(0xc4176471, 0x7af715d2), TOBN(0xe2f7f594, 0xd0134a96), - TOBN(0x2c1873ef, 0xa41ec956), TOBN(0xe4e7b4f6, 0x77821304), - TOBN(0xe5c8ff97, 0x88d5374a), TOBN(0x2b915e63, 0x80823d5b), - TOBN(0xea6bc755, 0xb2ee8fe2), TOBN(0x6657624c, 0xe7112651), - TOBN(0x157af101, 0xdace5aca), TOBN(0xc4fdbcf2, 0x11a6a267), - TOBN(0xdaddf340, 0xc49c8609), TOBN(0x97e49f52, 0xe9604a65), - TOBN(0x9be8e790, 0x937e2ad5), TOBN(0x846e2508, 0x326e17f1), - TOBN(0x3f38007a, 0x0bbbc0dc), TOBN(0xcf03603f, 0xb11e16d6), - TOBN(0xd6f800e0, 0x7442f1d5), TOBN(0x475607d1, 0x66e0e3ab), - TOBN(0x82807f16, 0xb7c64047), TOBN(0x8858e1e3, 0xa749883d), - TOBN(0x5859120b, 0x8231ee10), TOBN(0x1b80e7eb, 0x638a1ece), - TOBN(0xcb72525a, 0xc6aa73a4), TOBN(0xa7cdea3d, 0x844423ac), - TOBN(0x5ed0c007, 0xf8ae7c38), TOBN(0x6db07a5c, 0x3d740192), - TOBN(0xbe5e9c2a, 0x5fe36db3), TOBN(0xd5b9d57a, 0x76e95046), - TOBN(0x54ac32e7, 0x8eba20f2), TOBN(0xef11ca8f, 0x71b9a352), - TOBN(0x305e373e, 0xff98a658), TOBN(0xffe5a100, 0x823eb667), - TOBN(0x57477b11, 0xe51732d2), TOBN(0xdfd6eb28, 0x2538fc0e), - TOBN(0x5c43b0cc, 0x3b39eec5), TOBN(0x6af12778, 0xcb36cc57), - TOBN(0x70b0852d, 0x06c425ae), TOBN(0x6df92f8c, 0x5c221b9b), - TOBN(0x6c8d4f9e, 0xce826d9c), TOBN(0xf59aba7b, 0xb49359c3), - TOBN(0x5c8ed8d5, 0xda64309d), TOBN(0x61a6de56, 0x91b30704), - TOBN(0xd6b52f6a, 0x2f9b5808), TOBN(0x0eee4194, 0x98c958a7), - TOBN(0xcddd9aab, 0x771e4caa), TOBN(0x83965dfd, 0x78bc21be), - TOBN(0x02affce3, 0xb3b504f5), TOBN(0x30847a21, 0x561c8291), - TOBN(0xd2eb2cf1, 0x52bfda05), TOBN(0xe0e4c4e9, 0x6197b98c), - TOBN(0x1d35076c, 0xf8a1726f), TOBN(0x6c06085b, 0x2db11e3d), - TOBN(0x15c0c4d7, 0x4463ba14), TOBN(0x9d292f83, 0x0030238c), - TOBN(0x1311ee8b, 0x3727536d), TOBN(0xfeea86ef, 0xbeaedc1e), - TOBN(0xb9d18cd3, 0x66131e2e), TOBN(0xf31d974f, 0x80fe2682), - TOBN(0xb6e49e0f, 0xe4160289), TOBN(0x7c48ec0b, 0x08e92799), - TOBN(0x818111d8, 0xd1989aa7), TOBN(0xb34fa0aa, 0xebf926f9), - TOBN(0xdb5fe2f5, 0xa245474a), TOBN(0xf80a6ebb, 0x3c7ca756), - TOBN(0xa7f96054, 0xafa05dd8), TOBN(0x26dfcf21, 0xfcaf119e), - TOBN(0xe20ef2e3, 0x0564bb59), TOBN(0xef4dca50, 0x61cb02b8), - TOBN(0xcda7838a, 0x65d30672), TOBN(0x8b08d534, 0xfd657e86), - TOBN(0x4c5b4395, 0x46d595c8), TOBN(0x39b58725, 0x425cb836), - TOBN(0x8ea61059, 0x3de9abe3), TOBN(0x40434881, 0x9cdc03be), - TOBN(0x9b261245, 0xcfedce8c), TOBN(0x78c318b4, 0xcf5234a1), - TOBN(0x510bcf16, 0xfde24c99), TOBN(0x2a77cb75, 0xa2c2ff5d), - TOBN(0x9c895c2b, 0x27960fb4), TOBN(0xd30ce975, 0xb0eda42b), - TOBN(0xfda85393, 0x1a62cc26), TOBN(0x23c69b96, 0x50c0e052), - TOBN(0xa227df15, 0xbfc633f3), TOBN(0x2ac78848, 0x1bae7d48), - TOBN(0x487878f9, 0x187d073d), TOBN(0x6c2be919, 0x967f807d), - TOBN(0x765861d8, 0x336e6d8f), TOBN(0x88b8974c, 0xce528a43), - TOBN(0x09521177, 0xff57d051), TOBN(0x2ff38037, 0xfb6a1961), - TOBN(0xfc0aba74, 0xa3d76ad4), TOBN(0x7c764803, 0x25a7ec17), - TOBN(0x7532d75f, 0x48879bc8), TOBN(0xea7eacc0, 0x58ce6bc1), - TOBN(0xc82176b4, 0x8e896c16), TOBN(0x9a30e0b2, 0x2c750fed), - TOBN(0xc37e2c2e, 0x421d3aa4), TOBN(0xf926407c, 0xe84fa840), - TOBN(0x18abc03d, 0x1454e41c), TOBN(0x26605ecd, 0x3f7af644), - TOBN(0x242341a6, 0xd6a5eabf), TOBN(0x1edb84f4, 0x216b668e), - TOBN(0xd836edb8, 0x04010102), TOBN(0x5b337ce7, 0x945e1d8c), - TOBN(0xd2075c77, 0xc055dc14), TOBN(0x2a0ffa25, 0x81d89cdf), - TOBN(0x8ce815ea, 0x6ffdcbaf), TOBN(0xa3428878, 0xfb648867), - TOBN(0x277699cf, 0x884655fb), TOBN(0xfa5b5bd6, 0x364d3e41), - TOBN(0x01f680c6, 0x441e1cb7), TOBN(0x3fd61e66, 0xb70a7d67), - TOBN(0x666ba2dc, 0xcc78cf66), TOBN(0xb3018174, 0x6fdbff77), - TOBN(0x8d4dd0db, 0x168d4668), TOBN(0x259455d0, 0x1dab3a2a), - TOBN(0xf58564c5, 0xcde3acec), TOBN(0x77141925, 0x13adb276), - TOBN(0x527d725d, 0x8a303f65), TOBN(0x55deb6c9, 0xe6f38f7b), - TOBN(0xfd5bb657, 0xb1fa70fb), TOBN(0xfa07f50f, 0xd8073a00), - TOBN(0xf72e3aa7, 0xbca02500), TOBN(0xf68f895d, 0x9975740d), - TOBN(0x30112060, 0x5cae2a6a), TOBN(0x01bd7218, 0x02874842), - TOBN(0x3d423891, 0x7ce47bd3), TOBN(0xa66663c1, 0x789544f6), - TOBN(0x864d05d7, 0x3272d838), TOBN(0xe22924f9, 0xfa6295c5), - TOBN(0x8189593f, 0x6c2fda32), TOBN(0x330d7189, 0xb184b544), - TOBN(0x79efa62c, 0xbde1f714), TOBN(0x35771c94, 0xe5cb1a63), - TOBN(0x2f4826b8, 0x641c8332), TOBN(0x00a894fb, 0xc8cee854), - TOBN(0xb4b9a39b, 0x36194d40), TOBN(0xe857a7c5, 0x77612601), - TOBN(0xf4209dd2, 0x4ecf2f58), TOBN(0x82b9e66d, 0x5a033487), - TOBN(0xc1e36934, 0xe4e8b9dd), TOBN(0xd2372c9d, 0xa42377d7), - TOBN(0x51dc94c7, 0x0e3ae43b), TOBN(0x4c57761e, 0x04474f6f), - TOBN(0xdcdacd0a, 0x1058a318), TOBN(0x369cf3f5, 0x78053a9a), - TOBN(0xc6c3de50, 0x31c68de2), TOBN(0x4653a576, 0x3c4b6d9f), - TOBN(0x1688dd5a, 0xaa4e5c97), TOBN(0x5be80aa1, 0xb7ab3c74), - TOBN(0x70cefe7c, 0xbc65c283), TOBN(0x57f95f13, 0x06867091), - TOBN(0xa39114e2, 0x4415503b), TOBN(0xc08ff7c6, 0x4cbb17e9), - TOBN(0x1eff674d, 0xd7dec966), TOBN(0x6d4690af, 0x53376f63), - TOBN(0xff6fe32e, 0xea74237b), TOBN(0xc436d17e, 0xcd57508e), - TOBN(0x15aa28e1, 0xedcc40fe), TOBN(0x0d769c04, 0x581bbb44), - TOBN(0xc240b6de, 0x34eaacda), TOBN(0xd9e116e8, 0x2ba0f1de), - TOBN(0xcbe45ec7, 0x79438e55), TOBN(0x91787c9d, 0x96f752d7), - TOBN(0x897f532b, 0xf129ac2f), TOBN(0xd307b7c8, 0x5a36e22c), - TOBN(0x91940675, 0x749fb8f3), TOBN(0xd14f95d0, 0x157fdb28), - TOBN(0xfe51d029, 0x6ae55043), TOBN(0x8931e98f, 0x44a87de1), - TOBN(0xe57f1cc6, 0x09e4fee2), TOBN(0x0d063b67, 0x4e072d92), - TOBN(0x70a998b9, 0xed0e4316), TOBN(0xe74a736b, 0x306aca46), - TOBN(0xecf0fbf2, 0x4fda97c7), TOBN(0xa40f65cb, 0x3e178d93), - TOBN(0x16253604, 0x16df4285), TOBN(0xb0c9babb, 0xd0c56ae2), - TOBN(0x73032b19, 0xcfc5cfc3), TOBN(0xe497e5c3, 0x09752056), - TOBN(0x12096bb4, 0x164bda96), TOBN(0x1ee42419, 0xa0b74da1), - TOBN(0x8fc36243, 0x403826ba), TOBN(0x0c8f0069, 0xdc09e660), - TOBN(0x8667e981, 0xc27253c9), TOBN(0x05a6aefb, 0x92b36a45), - TOBN(0xa62c4b36, 0x9cb7bb46), TOBN(0x8394f375, 0x11f7027b), - TOBN(0x747bc79c, 0x5f109d0f), TOBN(0xcad88a76, 0x5b8cc60a), - TOBN(0x80c5a66b, 0x58f09e68), TOBN(0xe753d451, 0xf6127eac), - TOBN(0xc44b74a1, 0x5b0ec6f5), TOBN(0x47989fe4, 0x5289b2b8), - TOBN(0x745f8484, 0x58d6fc73), TOBN(0xec362a6f, 0xf61c70ab), - TOBN(0x070c98a7, 0xb3a8ad41), TOBN(0x73a20fc0, 0x7b63db51), - TOBN(0xed2c2173, 0xf44c35f4), TOBN(0x8a56149d, 0x9acc9dca), - TOBN(0x98f17881, 0x9ac6e0f4), TOBN(0x360fdeaf, 0xa413b5ed), - TOBN(0x0625b8f4, 0xa300b0fd), TOBN(0xf1f4d76a, 0x5b3222d3), - TOBN(0x9d6f5109, 0x587f76b8), TOBN(0x8b4ee08d, 0x2317fdb5), - TOBN(0x88089bb7, 0x8c68b095), TOBN(0x95570e9a, 0x5808d9b9), - TOBN(0xa395c36f, 0x35d33ae7), TOBN(0x200ea123, 0x50bb5a94), - TOBN(0x20c789bd, 0x0bafe84b), TOBN(0x243ef52d, 0x0919276a), - TOBN(0x3934c577, 0xe23ae233), TOBN(0xb93807af, 0xa460d1ec), - TOBN(0xb72a53b1, 0xf8fa76a4), TOBN(0xd8914cb0, 0xc3ca4491), - TOBN(0x2e128494, 0x3fb42622), TOBN(0x3b2700ac, 0x500907d5), - TOBN(0xf370fb09, 0x1a95ec63), TOBN(0xf8f30be2, 0x31b6dfbd), - TOBN(0xf2b2f8d2, 0x69e55f15), TOBN(0x1fead851, 0xcc1323e9), - TOBN(0xfa366010, 0xd9e5eef6), TOBN(0x64d487b0, 0xe316107e), - TOBN(0x4c076b86, 0xd23ddc82), TOBN(0x03fd344c, 0x7e0143f0), - TOBN(0xa95362ff, 0x317af2c5), TOBN(0x0add3db7, 0xe18b7a4f), - TOBN(0x9c673e3f, 0x8260e01b), TOBN(0xfbeb49e5, 0x54a1cc91), - TOBN(0x91351bf2, 0x92f2e433), TOBN(0xc755e7ec, 0x851141eb), - TOBN(0xc9a95139, 0x29607745), TOBN(0x0ca07420, 0xa26f2b28), - TOBN(0xcb2790e7, 0x4bc6f9dd), TOBN(0x345bbb58, 0xadcaffc0), - TOBN(0xc65ea38c, 0xbe0f27a2), TOBN(0x67c24d7c, 0x641fcb56), - TOBN(0x2c25f0a7, 0xa9e2c757), TOBN(0x93f5cdb0, 0x16f16c49), - TOBN(0x2ca5a9d7, 0xc5ee30a1), TOBN(0xd1593635, 0xb909b729), - TOBN(0x804ce9f3, 0xdadeff48), TOBN(0xec464751, 0xb07c30c3), - TOBN(0x89d65ff3, 0x9e49af6a), TOBN(0xf2d6238a, 0x6f3d01bc), - TOBN(0x1095561e, 0x0bced843), TOBN(0x51789e12, 0xc8a13fd8), - TOBN(0xd633f929, 0x763231df), TOBN(0x46df9f7d, 0xe7cbddef), - TOBN(0x01c889c0, 0xcb265da8), TOBN(0xfce1ad10, 0xaf4336d2), - TOBN(0x8d110df6, 0xfc6a0a7e), TOBN(0xdd431b98, 0x6da425dc), - TOBN(0xcdc4aeab, 0x1834aabe), TOBN(0x84deb124, 0x8439b7fc), - TOBN(0x8796f169, 0x3c2a5998), TOBN(0x9b9247b4, 0x7947190d), - TOBN(0x55b9d9a5, 0x11597014), TOBN(0x7e9dd70d, 0x7b1566ee), - TOBN(0x94ad78f7, 0xcbcd5e64), TOBN(0x0359ac17, 0x9bd4c032), - TOBN(0x3b11baaf, 0x7cc222ae), TOBN(0xa6a6e284, 0xba78e812), - TOBN(0x8392053f, 0x24cea1a0), TOBN(0xc97bce4a, 0x33621491), - TOBN(0x7eb1db34, 0x35399ee9), TOBN(0x473f78ef, 0xece81ad1), - TOBN(0x41d72fe0, 0xf63d3d0d), TOBN(0xe620b880, 0xafab62fc), - TOBN(0x92096bc9, 0x93158383), TOBN(0x41a21357, 0x8f896f6c), - TOBN(0x1b5ee2fa, 0xc7dcfcab), TOBN(0x650acfde, 0x9546e007), - TOBN(0xc081b749, 0xb1b02e07), TOBN(0xda9e41a0, 0xf9eca03d), - TOBN(0x013ba727, 0x175a54ab), TOBN(0xca0cd190, 0xea5d8d10), - TOBN(0x85ea52c0, 0x95fd96a9), TOBN(0x2c591b9f, 0xbc5c3940), - TOBN(0x6fb4d4e4, 0x2bad4d5f), TOBN(0xfa4c3590, 0xfef0059b), - TOBN(0x6a10218a, 0xf5122294), TOBN(0x9a78a81a, 0xa85751d1), - TOBN(0x04f20579, 0xa98e84e7), TOBN(0xfe1242c0, 0x4997e5b5), - TOBN(0xe77a273b, 0xca21e1e4), TOBN(0xfcc8b1ef, 0x9411939d), - TOBN(0xe20ea302, 0x92d0487a), TOBN(0x1442dbec, 0x294b91fe), - TOBN(0x1f7a4afe, 0xbb6b0e8f), TOBN(0x1700ef74, 0x6889c318), - TOBN(0xf5bbffc3, 0x70f1fc62), TOBN(0x3b31d4b6, 0x69c79cca), - TOBN(0xe8bc2aab, 0xa7f6340d), TOBN(0xb0b08ab4, 0xa725e10a), - TOBN(0x44f05701, 0xae340050), TOBN(0xba4b3016, 0x1cf0c569), - TOBN(0x5aa29f83, 0xfbe19a51), TOBN(0x1b9ed428, 0xb71d752e), - TOBN(0x1666e54e, 0xeb4819f5), TOBN(0x616cdfed, 0x9e18b75b), - TOBN(0x112ed5be, 0x3ee27b0b), TOBN(0xfbf28319, 0x44c7de4d), - TOBN(0xd685ec85, 0xe0e60d84), TOBN(0x68037e30, 0x1db7ee78), - TOBN(0x5b65bdcd, 0x003c4d6e), TOBN(0x33e7363a, 0x93e29a6a), - TOBN(0x995b3a61, 0x08d0756c), TOBN(0xd727f85c, 0x2faf134b), - TOBN(0xfac6edf7, 0x1d337823), TOBN(0x99b9aa50, 0x0439b8b4), - TOBN(0x722eb104, 0xe2b4e075), TOBN(0x49987295, 0x437c4926), - TOBN(0xb1e4c0e4, 0x46a9b82d), TOBN(0xd0cb3197, 0x57a006f5), - TOBN(0xf3de0f7d, 0xd7808c56), TOBN(0xb5c54d8f, 0x51f89772), - TOBN(0x500a114a, 0xadbd31aa), TOBN(0x9afaaaa6, 0x295f6cab), - TOBN(0x94705e21, 0x04cf667a), TOBN(0xfc2a811b, 0x9d3935d7), - TOBN(0x560b0280, 0x6d09267c), TOBN(0xf19ed119, 0xf780e53b), - TOBN(0xf0227c09, 0x067b6269), TOBN(0x967b8533, 0x5caef599), - TOBN(0x155b9243, 0x68efeebc), TOBN(0xcd6d34f5, 0xc497bae6), - TOBN(0x1dd8d5d3, 0x6cceb370), TOBN(0x2aeac579, 0xa78d7bf9), - TOBN(0x5d65017d, 0x70b67a62), TOBN(0x70c8e44f, 0x17c53f67), - TOBN(0xd1fc0950, 0x86a34d09), TOBN(0xe0fca256, 0xe7134907), - TOBN(0xe24fa29c, 0x80fdd315), TOBN(0x2c4acd03, 0xd87499ad), - TOBN(0xbaaf7517, 0x3b5a9ba6), TOBN(0xb9cbe1f6, 0x12e51a51), - TOBN(0xd88edae3, 0x5e154897), TOBN(0xe4309c3c, 0x77b66ca0), - TOBN(0xf5555805, 0xf67f3746), TOBN(0x85fc37ba, 0xa36401ff), - TOBN(0xdf86e2ca, 0xd9499a53), TOBN(0x6270b2a3, 0xecbc955b), - TOBN(0xafae64f5, 0x974ad33b), TOBN(0x04d85977, 0xfe7b2df1), - TOBN(0x2a3db3ff, 0x4ab03f73), TOBN(0x0b87878a, 0x8702740a), - TOBN(0x6d263f01, 0x5a061732), TOBN(0xc25430ce, 0xa32a1901), - TOBN(0xf7ebab3d, 0xdb155018), TOBN(0x3a86f693, 0x63a9b78e), - TOBN(0x349ae368, 0xda9f3804), TOBN(0x470f07fe, 0xa164349c), - TOBN(0xd52f4cc9, 0x8562baa5), TOBN(0xc74a9e86, 0x2b290df3), - TOBN(0xd3a1aa35, 0x43471a24), TOBN(0x239446be, 0xb8194511), - TOBN(0xbec2dd00, 0x81dcd44d), TOBN(0xca3d7f0f, 0xc42ac82d), - TOBN(0x1f3db085, 0xfdaf4520), TOBN(0xbb6d3e80, 0x4549daf2), - TOBN(0xf5969d8a, 0x19ad5c42), TOBN(0x7052b13d, 0xdbfd1511), - TOBN(0x11890d1b, 0x682b9060), TOBN(0xa71d3883, 0xac34452c), - TOBN(0xa438055b, 0x783805b4), TOBN(0x43241277, 0x4725b23e), - TOBN(0xf20cf96e, 0x4901bbed), TOBN(0x6419c710, 0xf432a2bb), - TOBN(0x57a0fbb9, 0xdfa9cd7d), TOBN(0x589111e4, 0x00daa249), - TOBN(0x19809a33, 0x7b60554e), TOBN(0xea5f8887, 0xede283a4), - TOBN(0x2d713802, 0x503bfd35), TOBN(0x151bb0af, 0x585d2a53), - TOBN(0x40b08f74, 0x43b30ca8), TOBN(0xe10b5bba, 0xd9934583), - TOBN(0xe8a546d6, 0xb51110ad), TOBN(0x1dd50e66, 0x28e0b6c5), - TOBN(0x292e9d54, 0xcff2b821), TOBN(0x3882555d, 0x47281760), - TOBN(0x134838f8, 0x3724d6e3), TOBN(0xf2c679e0, 0x22ddcda1), - TOBN(0x40ee8815, 0x6d2a5768), TOBN(0x7f227bd2, 0x1c1e7e2d), - TOBN(0x487ba134, 0xd04ff443), TOBN(0x76e2ff3d, 0xc614e54b), - TOBN(0x36b88d6f, 0xa3177ec7), TOBN(0xbf731d51, 0x2328fff5), - TOBN(0x758caea2, 0x49ba158e), TOBN(0x5ab8ff4c, 0x02938188), - TOBN(0x33e16056, 0x35edc56d), TOBN(0x5a69d349, 0x7e940d79), - TOBN(0x6c4fd001, 0x03866dcb), TOBN(0x20a38f57, 0x4893cdef), - TOBN(0xfbf3e790, 0xfac3a15b), TOBN(0x6ed7ea2e, 0x7a4f8e6b), - TOBN(0xa663eb4f, 0xbc3aca86), TOBN(0x22061ea5, 0x080d53f7), - TOBN(0x2480dfe6, 0xf546783f), TOBN(0xd38bc6da, 0x5a0a641e), - TOBN(0xfb093cd1, 0x2ede8965), TOBN(0x89654db4, 0xacb455cf), - TOBN(0x413cbf9a, 0x26e1adee), TOBN(0x291f3764, 0x373294d4), - TOBN(0x00797257, 0x648083fe), TOBN(0x25f504d3, 0x208cc341), - TOBN(0x635a8e5e, 0xc3a0ee43), TOBN(0x70aaebca, 0x679898ff), - TOBN(0x9ee9f547, 0x5dc63d56), TOBN(0xce987966, 0xffb34d00), - TOBN(0xf9f86b19, 0x5e26310a), TOBN(0x9e435484, 0x382a8ca8), - TOBN(0x253bcb81, 0xc2352fe4), TOBN(0xa4eac8b0, 0x4474b571), - TOBN(0xc1b97512, 0xc1ad8cf8), TOBN(0x193b4e9e, 0x99e0b697), - TOBN(0x939d2716, 0x01e85df0), TOBN(0x4fb265b3, 0xcd44eafd), - TOBN(0x321e7dcd, 0xe51e1ae2), TOBN(0x8e3a8ca6, 0xe3d8b096), - TOBN(0x8de46cb0, 0x52604998), TOBN(0x91099ad8, 0x39072aa7), - TOBN(0x2617f91c, 0x93aa96b8), TOBN(0x0fc8716b, 0x7fca2e13), - TOBN(0xa7106f5e, 0x95328723), TOBN(0xd1c9c40b, 0x262e6522), - TOBN(0xb9bafe86, 0x42b7c094), TOBN(0x1873439d, 0x1543c021), - TOBN(0xe1baa5de, 0x5cbefd5d), TOBN(0xa363fc5e, 0x521e8aff), - TOBN(0xefe6320d, 0xf862eaac), TOBN(0x14419c63, 0x22c647dc), - TOBN(0x0e06707c, 0x4e46d428), TOBN(0xcb6c834f, 0x4a178f8f), - TOBN(0x0f993a45, 0xd30f917c), TOBN(0xd4c4b049, 0x9879afee), - TOBN(0xb6142a1e, 0x70500063), TOBN(0x7c9b41c3, 0xa5d9d605), - TOBN(0xbc00fc2f, 0x2f8ba2c7), TOBN(0x0966eb2f, 0x7c67aa28), - TOBN(0x13f7b516, 0x5a786972), TOBN(0x3bfb7557, 0x8a2fbba0), - TOBN(0x131c4f23, 0x5a2b9620), TOBN(0xbff3ed27, 0x6faf46be), - TOBN(0x9b4473d1, 0x7e172323), TOBN(0x421e8878, 0x339f6246), - TOBN(0x0fa8587a, 0x25a41632), TOBN(0xc0814124, 0xa35b6c93), - TOBN(0x2b18a9f5, 0x59ebb8db), TOBN(0x264e3357, 0x76edb29c), - TOBN(0xaf245ccd, 0xc87c51e2), TOBN(0x16b3015b, 0x501e6214), - TOBN(0xbb31c560, 0x0a3882ce), TOBN(0x6961bb94, 0xfec11e04), - TOBN(0x3b825b8d, 0xeff7a3a0), TOBN(0xbec33738, 0xb1df7326), - TOBN(0x68ad747c, 0x99604a1f), TOBN(0xd154c934, 0x9a3bd499), - TOBN(0xac33506f, 0x1cc7a906), TOBN(0x73bb5392, 0x6c560e8f), - TOBN(0x6428fcbe, 0x263e3944), TOBN(0xc11828d5, 0x1c387434), - TOBN(0x3cd04be1, 0x3e4b12ff), TOBN(0xc3aad9f9, 0x2d88667c), - TOBN(0xc52ddcf8, 0x248120cf), TOBN(0x985a892e, 0x2a389532), - TOBN(0xfbb4b21b, 0x3bb85fa0), TOBN(0xf95375e0, 0x8dfc6269), - TOBN(0xfb4fb06c, 0x7ee2acea), TOBN(0x6785426e, 0x309c4d1f), - TOBN(0x659b17c8, 0xd8ceb147), TOBN(0x9b649eee, 0xb70a5554), - TOBN(0x6b7fa0b5, 0xac6bc634), TOBN(0xd99fe2c7, 0x1d6e732f), - TOBN(0x30e6e762, 0x8d3abba2), TOBN(0x18fee6e7, 0xa797b799), - TOBN(0x5c9d360d, 0xc696464d), TOBN(0xe3baeb48, 0x27bfde12), - TOBN(0x2bf5db47, 0xf23206d5), TOBN(0x2f6d3420, 0x1d260152), - TOBN(0x17b87653, 0x3f8ff89a), TOBN(0x5157c30c, 0x378fa458), - TOBN(0x7517c5c5, 0x2d4fb936), TOBN(0xef22f7ac, 0xe6518cdc), - TOBN(0xdeb483e6, 0xbf847a64), TOBN(0xf5084558, 0x92e0fa89)}, - {TOBN(0xab9659d8, 0xdf7304d4), TOBN(0xb71bcf1b, 0xff210e8e), - TOBN(0xa9a2438b, 0xd73fbd60), TOBN(0x4595cd1f, 0x5d11b4de), - TOBN(0x9c0d329a, 0x4835859d), TOBN(0x4a0f0d2d, 0x7dbb6e56), - TOBN(0xc6038e5e, 0xdf928a4e), TOBN(0xc9429621, 0x8f5ad154), - TOBN(0x91213462, 0xf23f2d92), TOBN(0x6cab71bd, 0x60b94078), - TOBN(0x6bdd0a63, 0x176cde20), TOBN(0x54c9b20c, 0xee4d54bc), - TOBN(0x3cd2d8aa, 0x9f2ac02f), TOBN(0x03f8e617, 0x206eedb0), - TOBN(0xc7f68e16, 0x93086434), TOBN(0x831469c5, 0x92dd3db9), - TOBN(0x8521df24, 0x8f981354), TOBN(0x587e23ec, 0x3588a259), - TOBN(0xcbedf281, 0xd7a0992c), TOBN(0x06930a55, 0x38961407), - TOBN(0x09320deb, 0xbe5bbe21), TOBN(0xa7ffa5b5, 0x2491817f), - TOBN(0xe6c8b4d9, 0x09065160), TOBN(0xac4f3992, 0xfff6d2a9), - TOBN(0x7aa7a158, 0x3ae9c1bd), TOBN(0xe0af6d98, 0xe37ce240), - TOBN(0xe54342d9, 0x28ab38b4), TOBN(0xe8b75007, 0x0a1c98ca), - TOBN(0xefce86af, 0xe02358f2), TOBN(0x31b8b856, 0xea921228), - TOBN(0x052a1912, 0x0a1c67fc), TOBN(0xb4069ea4, 0xe3aead59), - TOBN(0x3232d6e2, 0x7fa03cb3), TOBN(0xdb938e5b, 0x0fdd7d88), - TOBN(0x04c1d2cd, 0x2ccbfc5d), TOBN(0xd2f45c12, 0xaf3a580f), - TOBN(0x592620b5, 0x7883e614), TOBN(0x5fd27e68, 0xbe7c5f26), - TOBN(0x139e45a9, 0x1567e1e3), TOBN(0x2cc71d2d, 0x44d8aaaf), - TOBN(0x4a9090cd, 0xe36d0757), TOBN(0xf722d7b1, 0xd9a29382), - TOBN(0xfb7fb04c, 0x04b48ddf), TOBN(0x628ad2a7, 0xebe16f43), - TOBN(0xcd3fbfb5, 0x20226040), TOBN(0x6c34ecb1, 0x5104b6c4), - TOBN(0x30c0754e, 0xc903c188), TOBN(0xec336b08, 0x2d23cab0), - TOBN(0x473d62a2, 0x1e206ee5), TOBN(0xf1e27480, 0x8c49a633), - TOBN(0x87ab956c, 0xe9f6b2c3), TOBN(0x61830b48, 0x62b606ea), - TOBN(0x67cd6846, 0xe78e815f), TOBN(0xfe40139f, 0x4c02082a), - TOBN(0x52bbbfcb, 0x952ec365), TOBN(0x74c11642, 0x6b9836ab), - TOBN(0x9f51439e, 0x558df019), TOBN(0x230da4ba, 0xac712b27), - TOBN(0x518919e3, 0x55185a24), TOBN(0x4dcefcdd, 0x84b78f50), - TOBN(0xa7d90fb2, 0xa47d4c5a), TOBN(0x55ac9abf, 0xb30e009e), - TOBN(0xfd2fc359, 0x74eed273), TOBN(0xb72d824c, 0xdbea8faf), - TOBN(0xce721a74, 0x4513e2ca), TOBN(0x0b418612, 0x38240b2c), - TOBN(0x05199968, 0xd5baa450), TOBN(0xeb1757ed, 0x2b0e8c25), - TOBN(0x6ebc3e28, 0x3dfac6d5), TOBN(0xb2431e2e, 0x48a237f5), - TOBN(0x2acb5e23, 0x52f61499), TOBN(0x5558a2a7, 0xe06c936b), - TOBN(0xd213f923, 0xcbb13d1b), TOBN(0x98799f42, 0x5bfb9bfe), - TOBN(0x1ae8ddc9, 0x701144a9), TOBN(0x0b8b3bb6, 0x4c5595ee), - TOBN(0x0ea9ef2e, 0x3ecebb21), TOBN(0x17cb6c4b, 0x3671f9a7), - TOBN(0x47ef464f, 0x726f1d1f), TOBN(0x171b9484, 0x6943a276), - TOBN(0x51a4ae2d, 0x7ef0329c), TOBN(0x08509222, 0x91c4402a), - TOBN(0x64a61d35, 0xafd45bbc), TOBN(0x38f096fe, 0x3035a851), - TOBN(0xc7468b74, 0xa1dec027), TOBN(0xe8cf10e7, 0x4fc7dcba), - TOBN(0xea35ff40, 0xf4a06353), TOBN(0x0b4c0dfa, 0x8b77dd66), - TOBN(0x779b8552, 0xde7e5c19), TOBN(0xfab28609, 0xc1c0256c), - TOBN(0x64f58eee, 0xabd4743d), TOBN(0x4e8ef838, 0x7b6cc93b), - TOBN(0xee650d26, 0x4cb1bf3d), TOBN(0x4c1f9d09, 0x73dedf61), - TOBN(0xaef7c9d7, 0xbfb70ced), TOBN(0x1ec0507e, 0x1641de1e), - TOBN(0xcd7e5cc7, 0xcde45079), TOBN(0xde173c9a, 0x516ac9e4), - TOBN(0x517a8494, 0xc170315c), TOBN(0x438fd905, 0x91d8e8fb), - TOBN(0x5145c506, 0xc7d9630b), TOBN(0x6457a87b, 0xf47d4d75), - TOBN(0xd31646bf, 0x0d9a80e8), TOBN(0x453add2b, 0xcef3aabe), - TOBN(0xc9941109, 0xa607419d), TOBN(0xfaa71e62, 0xbb6bca80), - TOBN(0x34158c13, 0x07c431f3), TOBN(0x594abebc, 0x992bc47a), - TOBN(0x6dfea691, 0xeb78399f), TOBN(0x48aafb35, 0x3f42cba4), - TOBN(0xedcd65af, 0x077c04f0), TOBN(0x1a29a366, 0xe884491a), - TOBN(0x023a40e5, 0x1c21f2bf), TOBN(0xf99a513c, 0xa5057aee), - TOBN(0xa3fe7e25, 0xbcab072e), TOBN(0x8568d2e1, 0x40e32bcf), - TOBN(0x904594eb, 0xd3f69d9f), TOBN(0x181a9733, 0x07affab1), - TOBN(0xe4d68d76, 0xb6e330f4), TOBN(0x87a6dafb, 0xc75a7fc1), - TOBN(0x549db2b5, 0xef7d9289), TOBN(0x2480d4a8, 0x197f015a), - TOBN(0x61d5590b, 0xc40493b6), TOBN(0x3a55b52e, 0x6f780331), - TOBN(0x40eb8115, 0x309eadb0), TOBN(0xdea7de5a, 0x92e5c625), - TOBN(0x64d631f0, 0xcc6a3d5a), TOBN(0x9d5e9d7c, 0x93e8dd61), - TOBN(0xf297bef5, 0x206d3ffc), TOBN(0x23d5e033, 0x7d808bd4), - TOBN(0x4a4f6912, 0xd24cf5ba), TOBN(0xe4d8163b, 0x09cdaa8a), - TOBN(0x0e0de9ef, 0xd3082e8e), TOBN(0x4fe1246c, 0x0192f360), - TOBN(0x1f900150, 0x4b8eee0a), TOBN(0x5219da81, 0xf1da391b), - TOBN(0x7bf6a5c1, 0xf7ea25aa), TOBN(0xd165e6bf, 0xfbb07d5f), - TOBN(0xe3539361, 0x89e78671), TOBN(0xa3fcac89, 0x2bac4219), - TOBN(0xdfab6fd4, 0xf0baa8ab), TOBN(0x5a4adac1, 0xe2c1c2e5), - TOBN(0x6cd75e31, 0x40d85849), TOBN(0xce263fea, 0x19b39181), - TOBN(0xcb6803d3, 0x07032c72), TOBN(0x7f40d5ce, 0x790968c8), - TOBN(0xa6de86bd, 0xdce978f0), TOBN(0x25547c4f, 0x368f751c), - TOBN(0xb1e685fd, 0x65fb2a9e), TOBN(0xce69336f, 0x1eb9179c), - TOBN(0xb15d1c27, 0x12504442), TOBN(0xb7df465c, 0xb911a06b), - TOBN(0xb8d804a3, 0x315980cd), TOBN(0x693bc492, 0xfa3bebf7), - TOBN(0x3578aeee, 0x2253c504), TOBN(0x158de498, 0xcd2474a2), - TOBN(0x1331f5c7, 0xcfda8368), TOBN(0xd2d7bbb3, 0x78d7177e), - TOBN(0xdf61133a, 0xf3c1e46e), TOBN(0x5836ce7d, 0xd30e7be8), - TOBN(0x83084f19, 0x94f834cb), TOBN(0xd35653d4, 0x429ed782), - TOBN(0xa542f16f, 0x59e58243), TOBN(0xc2b52f65, 0x0470a22d), - TOBN(0xe3b6221b, 0x18f23d96), TOBN(0xcb05abac, 0x3f5252b4), - TOBN(0xca00938b, 0x87d61402), TOBN(0x2f186cdd, 0x411933e4), - TOBN(0xe042ece5, 0x9a29a5c5), TOBN(0xb19b3c07, 0x3b6c8402), - TOBN(0xc97667c7, 0x19d92684), TOBN(0xb5624622, 0xebc66372), - TOBN(0x0cb96e65, 0x3c04fa02), TOBN(0x83a7176c, 0x8eaa39aa), - TOBN(0x2033561d, 0xeaa1633f), TOBN(0x45a9d086, 0x4533df73), - TOBN(0xe0542c1d, 0x3dc090bc), TOBN(0x82c996ef, 0xaa59c167), - TOBN(0xe3f735e8, 0x0ee7fc4d), TOBN(0x7b179393, 0x7c35db79), - TOBN(0xb6419e25, 0xf8c5dbfd), TOBN(0x4d9d7a1e, 0x1f327b04), - TOBN(0x979f6f9b, 0x298dfca8), TOBN(0xc7c5dff1, 0x8de9366a), - TOBN(0x1b7a588d, 0x04c82bdd), TOBN(0x68005534, 0xf8319dfd), - TOBN(0xde8a55b5, 0xd8eb9580), TOBN(0x5ea886da, 0x8d5bca81), - TOBN(0xe8530a01, 0x252a0b4d), TOBN(0x1bffb4fe, 0x35eaa0a1), - TOBN(0x2ad828b1, 0xd8e99563), TOBN(0x7de96ef5, 0x95f9cd87), - TOBN(0x4abb2d0c, 0xd77d970c), TOBN(0x03cfb933, 0xd33ef9cb), - TOBN(0xb0547c01, 0x8b211fe9), TOBN(0x2fe64809, 0xa56ed1c6), - TOBN(0xcb7d5624, 0xc2ac98cc), TOBN(0x2a1372c0, 0x1a393e33), - TOBN(0xc8d1ec1c, 0x29660521), TOBN(0xf3d31b04, 0xb37ac3e9), - TOBN(0xa29ae9df, 0x5ece6e7c), TOBN(0x0603ac8f, 0x0facfb55), - TOBN(0xcfe85b7a, 0xdda233a5), TOBN(0xe618919f, 0xbd75f0b8), - TOBN(0xf555a3d2, 0x99bf1603), TOBN(0x1f43afc9, 0xf184255a), - TOBN(0xdcdaf341, 0x319a3e02), TOBN(0xd3b117ef, 0x03903a39), - TOBN(0xe095da13, 0x65d1d131), TOBN(0x86f16367, 0xc37ad03e), - TOBN(0x5f37389e, 0x462cd8dd), TOBN(0xc103fa04, 0xd67a60e6), - TOBN(0x57c34344, 0xf4b478f0), TOBN(0xce91edd8, 0xe117c98d), - TOBN(0x001777b0, 0x231fc12e), TOBN(0x11ae47f2, 0xb207bccb), - TOBN(0xd983cf8d, 0x20f8a242), TOBN(0x7aff5b1d, 0xf22e1ad8), - TOBN(0x68fd11d0, 0x7fc4feb3), TOBN(0x5d53ae90, 0xb0f1c3e1), - TOBN(0x50fb7905, 0xec041803), TOBN(0x85e3c977, 0x14404888), - TOBN(0x0e67faed, 0xac628d8f), TOBN(0x2e865150, 0x6668532c), - TOBN(0x15acaaa4, 0x6a67a6b0), TOBN(0xf4cdee25, 0xb25cec41), - TOBN(0x49ee565a, 0xe4c6701e), TOBN(0x2a04ca66, 0xfc7d63d8), - TOBN(0xeb105018, 0xef0543fb), TOBN(0xf709a4f5, 0xd1b0d81d), - TOBN(0x5b906ee6, 0x2915d333), TOBN(0xf4a87412, 0x96f1f0ab), - TOBN(0xb6b82fa7, 0x4d82f4c2), TOBN(0x90725a60, 0x6804efb3), - TOBN(0xbc82ec46, 0xadc3425e), TOBN(0xb7b80581, 0x2787843e), - TOBN(0xdf46d91c, 0xdd1fc74c), TOBN(0xdc1c62cb, 0xe783a6c4), - TOBN(0x59d1b9f3, 0x1a04cbba), TOBN(0xd87f6f72, 0x95e40764), - TOBN(0x02b4cfc1, 0x317f4a76), TOBN(0x8d2703eb, 0x91036bce), - TOBN(0x98206cc6, 0xa5e72a56), TOBN(0x57be9ed1, 0xcf53fb0f), - TOBN(0x09374571, 0xef0b17ac), TOBN(0x74b2655e, 0xd9181b38), - TOBN(0xc8f80ea8, 0x89935d0e), TOBN(0xc0d9e942, 0x91529936), - TOBN(0x19686041, 0x1e84e0e5), TOBN(0xa5db84d3, 0xaea34c93), - TOBN(0xf9d5bb19, 0x7073a732), TOBN(0xb8d2fe56, 0x6bcfd7c0), - TOBN(0x45775f36, 0xf3eb82fa), TOBN(0x8cb20ccc, 0xfdff8b58), - TOBN(0x1659b65f, 0x8374c110), TOBN(0xb8b4a422, 0x330c789a), - TOBN(0x75e3c3ea, 0x6fe8208b), TOBN(0xbd74b9e4, 0x286e78fe), - TOBN(0x0be2e81b, 0xd7d93a1a), TOBN(0x7ed06e27, 0xdd0a5aae), - TOBN(0x721f5a58, 0x6be8b800), TOBN(0x428299d1, 0xd846db28), - TOBN(0x95cb8e6b, 0x5be88ed3), TOBN(0xc3186b23, 0x1c034e11), - TOBN(0xa6312c9e, 0x8977d99b), TOBN(0xbe944331, 0x83f531e7), - TOBN(0x8232c0c2, 0x18d3b1d4), TOBN(0x617aae8b, 0xe1247b73), - TOBN(0x40153fc4, 0x282aec3b), TOBN(0xc6063d2f, 0xf7b8f823), - TOBN(0x68f10e58, 0x3304f94c), TOBN(0x31efae74, 0xee676346), - TOBN(0xbadb6c6d, 0x40a9b97c), TOBN(0x14702c63, 0x4f666256), - TOBN(0xdeb954f1, 0x5184b2e3), TOBN(0x5184a526, 0x94b6ca40), - TOBN(0xfff05337, 0x003c32ea), TOBN(0x5aa374dd, 0x205974c7), - TOBN(0x9a763854, 0x4b0dd71a), TOBN(0x459cd27f, 0xdeb947ec), - TOBN(0xa6e28161, 0x459c2b92), TOBN(0x2f020fa8, 0x75ee8ef5), - TOBN(0xb132ec2d, 0x30b06310), TOBN(0xc3e15899, 0xbc6a4530), - TOBN(0xdc5f53fe, 0xaa3f451a), TOBN(0x3a3c7f23, 0xc2d9acac), - TOBN(0x2ec2f892, 0x6b27e58b), TOBN(0x68466ee7, 0xd742799f), - TOBN(0x98324dd4, 0x1fa26613), TOBN(0xa2dc6dab, 0xbdc29d63), - TOBN(0xf9675faa, 0xd712d657), TOBN(0x813994be, 0x21fd8d15), - TOBN(0x5ccbb722, 0xfd4f7553), TOBN(0x5135ff8b, 0xf3a36b20), - TOBN(0x44be28af, 0x69559df5), TOBN(0x40b65bed, 0x9d41bf30), - TOBN(0xd98bf2a4, 0x3734e520), TOBN(0x5e3abbe3, 0x209bdcba), - TOBN(0x77c76553, 0xbc945b35), TOBN(0x5331c093, 0xc6ef14aa), - TOBN(0x518ffe29, 0x76b60c80), TOBN(0x2285593b, 0x7ace16f8), - TOBN(0xab1f64cc, 0xbe2b9784), TOBN(0xe8f2c0d9, 0xab2421b6), - TOBN(0x617d7174, 0xc1df065c), TOBN(0xafeeb5ab, 0x5f6578fa), - TOBN(0x16ff1329, 0x263b54a8), TOBN(0x45c55808, 0xc990dce3), - TOBN(0x42eab6c0, 0xecc8c177), TOBN(0x799ea9b5, 0x5982ecaa), - TOBN(0xf65da244, 0xb607ef8e), TOBN(0x8ab226ce, 0x32a3fc2c), - TOBN(0x745741e5, 0x7ea973dc), TOBN(0x5c00ca70, 0x20888f2e), - TOBN(0x7cdce3cf, 0x45fd9cf1), TOBN(0x8a741ef1, 0x5507f872), - TOBN(0x47c51c2f, 0x196b4cec), TOBN(0x70d08e43, 0xc97ea618), - TOBN(0x930da15c, 0x15b18a2b), TOBN(0x33b6c678, 0x2f610514), - TOBN(0xc662e4f8, 0x07ac9794), TOBN(0x1eccf050, 0xba06cb79), - TOBN(0x1ff08623, 0xe7d954e5), TOBN(0x6ef2c5fb, 0x24cf71c3), - TOBN(0xb2c063d2, 0x67978453), TOBN(0xa0cf3796, 0x1d654af8), - TOBN(0x7cb242ea, 0x7ebdaa37), TOBN(0x206e0b10, 0xb86747e0), - TOBN(0x481dae5f, 0xd5ecfefc), TOBN(0x07084fd8, 0xc2bff8fc), - TOBN(0x8040a01a, 0xea324596), TOBN(0x4c646980, 0xd4de4036), - TOBN(0x9eb8ab4e, 0xd65abfc3), TOBN(0xe01cb91f, 0x13541ec7), - TOBN(0x8f029adb, 0xfd695012), TOBN(0x9ae28483, 0x3c7569ec), - TOBN(0xa5614c9e, 0xa66d80a1), TOBN(0x680a3e44, 0x75f5f911), - TOBN(0x0c07b14d, 0xceba4fc1), TOBN(0x891c285b, 0xa13071c1), - TOBN(0xcac67ceb, 0x799ece3c), TOBN(0x29b910a9, 0x41e07e27), - TOBN(0x66bdb409, 0xf2e43123), TOBN(0x06f8b137, 0x7ac9ecbe), - TOBN(0x5981fafd, 0x38547090), TOBN(0x19ab8b9f, 0x85e3415d), - TOBN(0xfc28c194, 0xc7e31b27), TOBN(0x843be0aa, 0x6fbcbb42), - TOBN(0xf3b1ed43, 0xa6db836c), TOBN(0x2a1330e4, 0x01a45c05), - TOBN(0x4f19f3c5, 0x95c1a377), TOBN(0xa85f39d0, 0x44b5ee33), - TOBN(0x3da18e6d, 0x4ae52834), TOBN(0x5a403b39, 0x7423dcb0), - TOBN(0xbb555e0a, 0xf2374aef), TOBN(0x2ad599c4, 0x1e8ca111), - TOBN(0x1b3a2fb9, 0x014b3bf8), TOBN(0x73092684, 0xf66d5007), - TOBN(0x079f1426, 0xc4340102), TOBN(0x1827cf81, 0x8fddf4de), - TOBN(0xc83605f6, 0xf10ff927), TOBN(0xd3871451, 0x23739fc6), - TOBN(0x6d163450, 0xcac1c2cc), TOBN(0x6b521296, 0xa2ec1ac5), - TOBN(0x0606c4f9, 0x6e3cb4a5), TOBN(0xe47d3f41, 0x778abff7), - TOBN(0x425a8d5e, 0xbe8e3a45), TOBN(0x53ea9e97, 0xa6102160), - TOBN(0x477a106e, 0x39cbb688), TOBN(0x532401d2, 0xf3386d32), - TOBN(0x8e564f64, 0xb1b9b421), TOBN(0xca9b8388, 0x81dad33f), - TOBN(0xb1422b4e, 0x2093913e), TOBN(0x533d2f92, 0x69bc8112), - TOBN(0x3fa017be, 0xebe7b2c7), TOBN(0xb2767c4a, 0xcaf197c6), - TOBN(0xc925ff87, 0xaedbae9f), TOBN(0x7daf0eb9, 0x36880a54), - TOBN(0x9284ddf5, 0x9c4d0e71), TOBN(0x1581cf93, 0x316f8cf5), - TOBN(0x3eeca887, 0x3ac1f452), TOBN(0xb417fce9, 0xfb6aeffe), - TOBN(0xa5918046, 0xeefb8dc3), TOBN(0x73d318ac, 0x02209400), - TOBN(0xe800400f, 0x728693e5), TOBN(0xe87d814b, 0x339927ed), - TOBN(0x93e94d3b, 0x57ea9910), TOBN(0xff8a35b6, 0x2245fb69), - TOBN(0x043853d7, 0x7f200d34), TOBN(0x470f1e68, 0x0f653ce1), - TOBN(0x81ac05bd, 0x59a06379), TOBN(0xa14052c2, 0x03930c29), - TOBN(0x6b72fab5, 0x26bc2797), TOBN(0x13670d16, 0x99f16771), - TOBN(0x00170052, 0x1e3e48d1), TOBN(0x978fe401, 0xb7adf678), - TOBN(0x55ecfb92, 0xd41c5dd4), TOBN(0x5ff8e247, 0xc7b27da5), - TOBN(0xe7518272, 0x013fb606), TOBN(0x5768d7e5, 0x2f547a3c), - TOBN(0xbb24eaa3, 0x60017a5f), TOBN(0x6b18e6e4, 0x9c64ce9b), - TOBN(0xc225c655, 0x103dde07), TOBN(0xfc3672ae, 0x7592f7ea), - TOBN(0x9606ad77, 0xd06283a1), TOBN(0x542fc650, 0xe4d59d99), - TOBN(0xabb57c49, 0x2a40e7c2), TOBN(0xac948f13, 0xa8db9f55), - TOBN(0x6d4c9682, 0xb04465c3), TOBN(0xe3d062fa, 0x6468bd15), - TOBN(0xa51729ac, 0x5f318d7e), TOBN(0x1fc87df6, 0x9eb6fc95), - TOBN(0x63d146a8, 0x0591f652), TOBN(0xa861b8f7, 0x589621aa), - TOBN(0x59f5f15a, 0xce31348c), TOBN(0x8f663391, 0x440da6da), - TOBN(0xcfa778ac, 0xb591ffa3), TOBN(0x027ca9c5, 0x4cdfebce), - TOBN(0xbe8e05a5, 0x444ea6b3), TOBN(0x8aab4e69, 0xa78d8254), - TOBN(0x2437f04f, 0xb474d6b8), TOBN(0x6597ffd4, 0x045b3855), - TOBN(0xbb0aea4e, 0xca47ecaa), TOBN(0x568aae83, 0x85c7ebfc), - TOBN(0x0e966e64, 0xc73b2383), TOBN(0x49eb3447, 0xd17d8762), - TOBN(0xde107821, 0x8da05dab), TOBN(0x443d8baa, 0x016b7236), - TOBN(0x163b63a5, 0xea7610d6), TOBN(0xe47e4185, 0xce1ca979), - TOBN(0xae648b65, 0x80baa132), TOBN(0xebf53de2, 0x0e0d5b64), - TOBN(0x8d3bfcb4, 0xd3c8c1ca), TOBN(0x0d914ef3, 0x5d04b309), - TOBN(0x55ef6415, 0x3de7d395), TOBN(0xbde1666f, 0x26b850e8), - TOBN(0xdbe1ca6e, 0xd449ab19), TOBN(0x8902b322, 0xe89a2672), - TOBN(0xb1674b7e, 0xdacb7a53), TOBN(0x8e9faf6e, 0xf52523ff), - TOBN(0x6ba535da, 0x9a85788b), TOBN(0xd21f03ae, 0xbd0626d4), - TOBN(0x099f8c47, 0xe873dc64), TOBN(0xcda8564d, 0x018ec97e), - TOBN(0x3e8d7a5c, 0xde92c68c), TOBN(0x78e035a1, 0x73323cc4), - TOBN(0x3ef26275, 0xf880ff7c), TOBN(0xa4ee3dff, 0x273eedaa), - TOBN(0x58823507, 0xaf4e18f8), TOBN(0x967ec9b5, 0x0672f328), - TOBN(0x9ded19d9, 0x559d3186), TOBN(0x5e2ab3de, 0x6cdce39c), - TOBN(0xabad6e4d, 0x11c226df), TOBN(0xf9783f43, 0x87723014), - TOBN(0x9a49a0cf, 0x1a885719), TOBN(0xfc0c1a5a, 0x90da9dbf), - TOBN(0x8bbaec49, 0x571d92ac), TOBN(0x569e85fe, 0x4692517f), - TOBN(0x8333b014, 0xa14ea4af), TOBN(0x32f2a62f, 0x12e5c5ad), - TOBN(0x98c2ce3a, 0x06d89b85), TOBN(0xb90741aa, 0x2ff77a08), - TOBN(0x2530defc, 0x01f795a2), TOBN(0xd6e5ba0b, 0x84b3c199), - TOBN(0x7d8e8451, 0x12e4c936), TOBN(0xae419f7d, 0xbd0be17b), - TOBN(0xa583fc8c, 0x22262bc9), TOBN(0x6b842ac7, 0x91bfe2bd), - TOBN(0x33cef4e9, 0x440d6827), TOBN(0x5f69f4de, 0xef81fb14), - TOBN(0xf16cf6f6, 0x234fbb92), TOBN(0x76ae3fc3, 0xd9e7e158), - TOBN(0x4e89f6c2, 0xe9740b33), TOBN(0x677bc85d, 0x4962d6a1), - TOBN(0x6c6d8a7f, 0x68d10d15), TOBN(0x5f9a7224, 0x0257b1cd), - TOBN(0x7096b916, 0x4ad85961), TOBN(0x5f8c47f7, 0xe657ab4a), - TOBN(0xde57d7d0, 0xf7461d7e), TOBN(0x7eb6094d, 0x80ce5ee2), - TOBN(0x0b1e1dfd, 0x34190547), TOBN(0x8a394f43, 0xf05dd150), - TOBN(0x0a9eb24d, 0x97df44e6), TOBN(0x78ca06bf, 0x87675719), - TOBN(0x6f0b3462, 0x6ffeec22), TOBN(0x9d91bcea, 0x36cdd8fb), - TOBN(0xac83363c, 0xa105be47), TOBN(0x81ba76c1, 0x069710e3), - TOBN(0x3d1b24cb, 0x28c682c6), TOBN(0x27f25228, 0x8612575b), - TOBN(0xb587c779, 0xe8e66e98), TOBN(0x7b0c03e9, 0x405eb1fe), - TOBN(0xfdf0d030, 0x15b548e7), TOBN(0xa8be76e0, 0x38b36af7), - TOBN(0x4cdab04a, 0x4f310c40), TOBN(0x6287223e, 0xf47ecaec), - TOBN(0x678e6055, 0x8b399320), TOBN(0x61fe3fa6, 0xc01e4646), - TOBN(0xc482866b, 0x03261a5e), TOBN(0xdfcf45b8, 0x5c2f244a), - TOBN(0x8fab9a51, 0x2f684b43), TOBN(0xf796c654, 0xc7220a66), - TOBN(0x1d90707e, 0xf5afa58f), TOBN(0x2c421d97, 0x4fdbe0de), - TOBN(0xc4f4cda3, 0xaf2ebc2f), TOBN(0xa0af843d, 0xcb4efe24), - TOBN(0x53b857c1, 0x9ccd10b1), TOBN(0xddc9d1eb, 0x914d3e04), - TOBN(0x7bdec8bb, 0x62771deb), TOBN(0x829277aa, 0x91c5aa81), - TOBN(0x7af18dd6, 0x832391ae), TOBN(0x1740f316, 0xc71a84ca)}, - {TOBN(0x8928e99a, 0xeeaf8c49), TOBN(0xee7aa73d, 0x6e24d728), - TOBN(0x4c5007c2, 0xe72b156c), TOBN(0x5fcf57c5, 0xed408a1d), - TOBN(0x9f719e39, 0xb6057604), TOBN(0x7d343c01, 0xc2868bbf), - TOBN(0x2cca254b, 0x7e103e2d), TOBN(0xe6eb38a9, 0xf131bea2), - TOBN(0xb33e624f, 0x8be762b4), TOBN(0x2a9ee4d1, 0x058e3413), - TOBN(0x968e6369, 0x67d805fa), TOBN(0x9848949b, 0x7db8bfd7), - TOBN(0x5308d7e5, 0xd23a8417), TOBN(0x892f3b1d, 0xf3e29da5), - TOBN(0xc95c139e, 0x3dee471f), TOBN(0x8631594d, 0xd757e089), - TOBN(0xe0c82a3c, 0xde918dcc), TOBN(0x2e7b5994, 0x26fdcf4b), - TOBN(0x82c50249, 0x32cb1b2d), TOBN(0xea613a9d, 0x7657ae07), - TOBN(0xc2eb5f6c, 0xf1fdc9f7), TOBN(0xb6eae8b8, 0x879fe682), - TOBN(0x253dfee0, 0x591cbc7f), TOBN(0x000da713, 0x3e1290e6), - TOBN(0x1083e2ea, 0x1f095615), TOBN(0x0a28ad77, 0x14e68c33), - TOBN(0x6bfc0252, 0x3d8818be), TOBN(0xb585113a, 0xf35850cd), - TOBN(0x7d935f0b, 0x30df8aa1), TOBN(0xaddda07c, 0x4ab7e3ac), - TOBN(0x92c34299, 0x552f00cb), TOBN(0xc33ed1de, 0x2909df6c), - TOBN(0x22c2195d, 0x80e87766), TOBN(0x9e99e6d8, 0x9ddf4ac0), - TOBN(0x09642e4e, 0x65e74934), TOBN(0x2610ffa2, 0xff1ff241), - TOBN(0x4d1d47d4, 0x751c8159), TOBN(0x697b4985, 0xaf3a9363), - TOBN(0x0318ca46, 0x87477c33), TOBN(0xa90cb565, 0x9441eff3), - TOBN(0x58bb3848, 0x36f024cb), TOBN(0x85be1f77, 0x36016168), - TOBN(0x6c59587c, 0xdc7e07f1), TOBN(0x191be071, 0xaf1d8f02), - TOBN(0xbf169fa5, 0xcca5e55c), TOBN(0x3864ba3c, 0xf7d04eac), - TOBN(0x915e367f, 0x8d7d05db), TOBN(0xb48a876d, 0xa6549e5d), - TOBN(0xef89c656, 0x580e40a2), TOBN(0xf194ed8c, 0x728068bc), - TOBN(0x74528045, 0xa47990c9), TOBN(0xf53fc7d7, 0x5e1a4649), - TOBN(0xbec5ae9b, 0x78593e7d), TOBN(0x2cac4ee3, 0x41db65d7), - TOBN(0xa8c1eb24, 0x04a3d39b), TOBN(0x53b7d634, 0x03f8f3ef), - TOBN(0x2dc40d48, 0x3e07113c), TOBN(0x6e4a5d39, 0x7d8b63ae), - TOBN(0x5582a94b, 0x79684c2b), TOBN(0x932b33d4, 0x622da26c), - TOBN(0xf534f651, 0x0dbbf08d), TOBN(0x211d07c9, 0x64c23a52), - TOBN(0x0eeece0f, 0xee5bdc9b), TOBN(0xdf178168, 0xf7015558), - TOBN(0xd4294635, 0x0a712229), TOBN(0x93cbe448, 0x09273f8c), - TOBN(0x00b095ef, 0x8f13bc83), TOBN(0xbb741972, 0x8798978c), - TOBN(0x9d7309a2, 0x56dbe6e7), TOBN(0xe578ec56, 0x5a5d39ec), - TOBN(0x3961151b, 0x851f9a31), TOBN(0x2da7715d, 0xe5709eb4), - TOBN(0x867f3017, 0x53dfabf0), TOBN(0x728d2078, 0xb8e39259), - TOBN(0x5c75a0cd, 0x815d9958), TOBN(0xf84867a6, 0x16603be1), - TOBN(0xc865b13d, 0x70e35b1c), TOBN(0x02414468, 0x19b03e2c), - TOBN(0xe46041da, 0xac1f3121), TOBN(0x7c9017ad, 0x6f028a7c), - TOBN(0xabc96de9, 0x0a482873), TOBN(0x4265d6b1, 0xb77e54d4), - TOBN(0x68c38e79, 0xa57d88e7), TOBN(0xd461d766, 0x9ce82de3), - TOBN(0x817a9ec5, 0x64a7e489), TOBN(0xcc5675cd, 0xa0def5f2), - TOBN(0x9a00e785, 0x985d494e), TOBN(0xc626833f, 0x1b03514a), - TOBN(0xabe7905a, 0x83cdd60e), TOBN(0x50602fb5, 0xa1170184), - TOBN(0x689886cd, 0xb023642a), TOBN(0xd568d090, 0xa6e1fb00), - TOBN(0x5b1922c7, 0x0259217f), TOBN(0x93831cd9, 0xc43141e4), - TOBN(0xdfca3587, 0x0c95f86e), TOBN(0xdec2057a, 0x568ae828), - TOBN(0xc44ea599, 0xf98a759a), TOBN(0x55a0a7a2, 0xf7c23c1d), - TOBN(0xd5ffb6e6, 0x94c4f687), TOBN(0x3563cce2, 0x12848478), - TOBN(0x812b3517, 0xe7b1fbe1), TOBN(0x8a7dc979, 0x4f7338e0), - TOBN(0x211ecee9, 0x52d048db), TOBN(0x2eea4056, 0xc86ea3b8), - TOBN(0xd8cb68a7, 0xba772b34), TOBN(0xe16ed341, 0x5f4e2541), - TOBN(0x9b32f6a6, 0x0fec14db), TOBN(0xeee376f7, 0x391698be), - TOBN(0xe9a7aa17, 0x83674c02), TOBN(0x65832f97, 0x5843022a), - TOBN(0x29f3a8da, 0x5ba4990f), TOBN(0x79a59c3a, 0xfb8e3216), - TOBN(0x9cdc4d2e, 0xbd19bb16), TOBN(0xc6c7cfd0, 0xb3262d86), - TOBN(0xd4ce14d0, 0x969c0b47), TOBN(0x1fa352b7, 0x13e56128), - TOBN(0x383d55b8, 0x973db6d3), TOBN(0x71836850, 0xe8e5b7bf), - TOBN(0xc7714596, 0xe6bb571f), TOBN(0x259df31f, 0x2d5b2dd2), - TOBN(0x568f8925, 0x913cc16d), TOBN(0x18bc5b6d, 0xe1a26f5a), - TOBN(0xdfa413be, 0xf5f499ae), TOBN(0xf8835dec, 0xc3f0ae84), - TOBN(0xb6e60bd8, 0x65a40ab0), TOBN(0x65596439, 0x194b377e), - TOBN(0xbcd85625, 0x92084a69), TOBN(0x5ce433b9, 0x4f23ede0), - TOBN(0xe8e8f04f, 0x6ad65143), TOBN(0x11511827, 0xd6e14af6), - TOBN(0x3d390a10, 0x8295c0c7), TOBN(0x71e29ee4, 0x621eba16), - TOBN(0xa588fc09, 0x63717b46), TOBN(0x02be02fe, 0xe06ad4a2), - TOBN(0x931558c6, 0x04c22b22), TOBN(0xbb4d4bd6, 0x12f3c849), - TOBN(0x54a4f496, 0x20efd662), TOBN(0x92ba6d20, 0xc5952d14), - TOBN(0x2db8ea1e, 0xcc9784c2), TOBN(0x81cc10ca, 0x4b353644), - TOBN(0x40b570ad, 0x4b4d7f6c), TOBN(0x5c9f1d96, 0x84a1dcd2), - TOBN(0x01379f81, 0x3147e797), TOBN(0xe5c6097b, 0x2bd499f5), - TOBN(0x40dcafa6, 0x328e5e20), TOBN(0xf7b5244a, 0x54815550), - TOBN(0xb9a4f118, 0x47bfc978), TOBN(0x0ea0e79f, 0xd25825b1), - TOBN(0xa50f96eb, 0x646c7ecf), TOBN(0xeb811493, 0x446dea9d), - TOBN(0x2af04677, 0xdfabcf69), TOBN(0xbe3a068f, 0xc713f6e8), - TOBN(0x860d523d, 0x42e06189), TOBN(0xbf077941, 0x4e3aff13), - TOBN(0x0b616dca, 0xc1b20650), TOBN(0xe66dd6d1, 0x2131300d), - TOBN(0xd4a0fd67, 0xff99abde), TOBN(0xc9903550, 0xc7aac50d), - TOBN(0x022ecf8b, 0x7c46b2d7), TOBN(0x3333b1e8, 0x3abf92af), - TOBN(0x11cc113c, 0x6c491c14), TOBN(0x05976688, 0x80dd3f88), - TOBN(0xf5b4d9e7, 0x29d932ed), TOBN(0xe982aad8, 0xa2c38b6d), - TOBN(0x6f925347, 0x8be0dcf0), TOBN(0x700080ae, 0x65ca53f2), - TOBN(0xd8131156, 0x443ca77f), TOBN(0xe92d6942, 0xec51f984), - TOBN(0xd2a08af8, 0x85dfe9ae), TOBN(0xd825d9a5, 0x4d2a86ca), - TOBN(0x2c53988d, 0x39dff020), TOBN(0xf38b135a, 0x430cdc40), - TOBN(0x0c918ae0, 0x62a7150b), TOBN(0xf31fd8de, 0x0c340e9b), - TOBN(0xafa0e7ae, 0x4dbbf02e), TOBN(0x5847fb2a, 0x5eba6239), - TOBN(0x6b1647dc, 0xdccbac8b), TOBN(0xb642aa78, 0x06f485c8), - TOBN(0x873f3765, 0x7038ecdf), TOBN(0x2ce5e865, 0xfa49d3fe), - TOBN(0xea223788, 0xc98c4400), TOBN(0x8104a8cd, 0xf1fa5279), - TOBN(0xbcf7cc7a, 0x06becfd7), TOBN(0x49424316, 0xc8f974ae), - TOBN(0xc0da65e7, 0x84d6365d), TOBN(0xbcb7443f, 0x8f759fb8), - TOBN(0x35c712b1, 0x7ae81930), TOBN(0x80428dff, 0x4c6e08ab), - TOBN(0xf19dafef, 0xa4faf843), TOBN(0xced8538d, 0xffa9855f), - TOBN(0x20ac409c, 0xbe3ac7ce), TOBN(0x358c1fb6, 0x882da71e), - TOBN(0xafa9c0e5, 0xfd349961), TOBN(0x2b2cfa51, 0x8421c2fc), - TOBN(0x2a80db17, 0xf3a28d38), TOBN(0xa8aba539, 0x5d138e7e), - TOBN(0x52012d1d, 0x6e96eb8d), TOBN(0x65d8dea0, 0xcbaf9622), - TOBN(0x57735447, 0xb264f56c), TOBN(0xbeebef3f, 0x1b6c8da2), - TOBN(0xfc346d98, 0xce785254), TOBN(0xd50e8d72, 0xbb64a161), - TOBN(0xc03567c7, 0x49794add), TOBN(0x15a76065, 0x752c7ef6), - TOBN(0x59f3a222, 0x961f23d6), TOBN(0x378e4438, 0x73ecc0b0), - TOBN(0xc74be434, 0x5a82fde4), TOBN(0xae509af2, 0xd8b9cf34), - TOBN(0x4a61ee46, 0x577f44a1), TOBN(0xe09b748c, 0xb611deeb), - TOBN(0xc0481b2c, 0xf5f7b884), TOBN(0x35626678, 0x61acfa6b), - TOBN(0x37f4c518, 0xbf8d21e6), TOBN(0x22d96531, 0xb205a76d), - TOBN(0x37fb85e1, 0x954073c0), TOBN(0xbceafe4f, 0x65b3a567), - TOBN(0xefecdef7, 0xbe42a582), TOBN(0xd3fc6080, 0x65046be6), - TOBN(0xc9af13c8, 0x09e8dba9), TOBN(0x1e6c9847, 0x641491ff), - TOBN(0x3b574925, 0xd30c31f7), TOBN(0xb7eb72ba, 0xac2a2122), - TOBN(0x776a0dac, 0xef0859e7), TOBN(0x06fec314, 0x21900942), - TOBN(0x2464bc10, 0xf8c22049), TOBN(0x9bfbcce7, 0x875ebf69), - TOBN(0xd7a88e2a, 0x4336326b), TOBN(0xda05261c, 0x5bc2acfa), - TOBN(0xc29f5bdc, 0xeba7efc8), TOBN(0x471237ca, 0x25dbbf2e), - TOBN(0xa72773f2, 0x2975f127), TOBN(0xdc744e8e, 0x04d0b326), - TOBN(0x38a7ed16, 0xa56edb73), TOBN(0x64357e37, 0x2c007e70), - TOBN(0xa167d15b, 0x5080b400), TOBN(0x07b41164, 0x23de4be1), - TOBN(0xb2d91e32, 0x74c89883), TOBN(0x3c162821, 0x2882e7ed), - TOBN(0xad6b36ba, 0x7503e482), TOBN(0x48434e8e, 0x0ea34331), - TOBN(0x79f4f24f, 0x2c7ae0b9), TOBN(0xc46fbf81, 0x1939b44a), - TOBN(0x76fefae8, 0x56595eb1), TOBN(0x417b66ab, 0xcd5f29c7), - TOBN(0x5f2332b2, 0xc5ceec20), TOBN(0xd69661ff, 0xe1a1cae2), - TOBN(0x5ede7e52, 0x9b0286e6), TOBN(0x9d062529, 0xe276b993), - TOBN(0x324794b0, 0x7e50122b), TOBN(0xdd744f8b, 0x4af07ca5), - TOBN(0x30a12f08, 0xd63fc97b), TOBN(0x39650f1a, 0x76626d9d), - TOBN(0x101b47f7, 0x1fa38477), TOBN(0x3d815f19, 0xd4dc124f), - TOBN(0x1569ae95, 0xb26eb58a), TOBN(0xc3cde188, 0x95fb1887), - TOBN(0x54e9f37b, 0xf9539a48), TOBN(0xb0100e06, 0x7408c1a5), - TOBN(0x821d9811, 0xea580cbb), TOBN(0x8af52d35, 0x86e50c56), - TOBN(0xdfbd9d47, 0xdbbf698b), TOBN(0x2961a1ea, 0x03dc1c73), - TOBN(0x203d38f8, 0xe76a5df8), TOBN(0x08a53a68, 0x6def707a), - TOBN(0x26eefb48, 0x1bee45d4), TOBN(0xb3cee346, 0x3c688036), - TOBN(0x463c5315, 0xc42f2469), TOBN(0x19d84d2e, 0x81378162), - TOBN(0x22d7c3c5, 0x1c4d349f), TOBN(0x65965844, 0x163d59c5), - TOBN(0xcf198c56, 0xb8abceae), TOBN(0x6fb1fb1b, 0x628559d5), - TOBN(0x8bbffd06, 0x07bf8fe3), TOBN(0x46259c58, 0x3467734b), - TOBN(0xd8953cea, 0x35f7f0d3), TOBN(0x1f0bece2, 0xd65b0ff1), - TOBN(0xf7d5b4b3, 0xf3c72914), TOBN(0x29e8ea95, 0x3cb53389), - TOBN(0x4a365626, 0x836b6d46), TOBN(0xe849f910, 0xea174fde), - TOBN(0x7ec62fbb, 0xf4737f21), TOBN(0xd8dba5ab, 0x6209f5ac), - TOBN(0x24b5d7a9, 0xa5f9adbe), TOBN(0x707d28f7, 0xa61dc768), - TOBN(0x7711460b, 0xcaa999ea), TOBN(0xba7b174d, 0x1c92e4cc), - TOBN(0x3c4bab66, 0x18d4bf2d), TOBN(0xb8f0c980, 0xeb8bd279), - TOBN(0x024bea9a, 0x324b4737), TOBN(0xfba9e423, 0x32a83bca), - TOBN(0x6e635643, 0xa232dced), TOBN(0x99619367, 0x2571c8ba), - TOBN(0xe8c9f357, 0x54b7032b), TOBN(0xf936b3ba, 0x2442d54a), - TOBN(0x2263f0f0, 0x8290c65a), TOBN(0x48989780, 0xee2c7fdb), - TOBN(0xadc5d55a, 0x13d4f95e), TOBN(0x737cff85, 0xad9b8500), - TOBN(0x271c557b, 0x8a73f43d), TOBN(0xbed617a4, 0xe18bc476), - TOBN(0x66245401, 0x7dfd8ab2), TOBN(0xae7b89ae, 0x3a2870aa), - TOBN(0x1b555f53, 0x23a7e545), TOBN(0x6791e247, 0xbe057e4c), - TOBN(0x860136ad, 0x324fa34d), TOBN(0xea111447, 0x4cbeae28), - TOBN(0x023a4270, 0xbedd3299), TOBN(0x3d5c3a7f, 0xc1c35c34), - TOBN(0xb0f6db67, 0x8d0412d2), TOBN(0xd92625e2, 0xfcdc6b9a), - TOBN(0x92ae5ccc, 0x4e28a982), TOBN(0xea251c36, 0x47a3ce7e), - TOBN(0x9d658932, 0x790691bf), TOBN(0xed610589, 0x06b736ae), - TOBN(0x712c2f04, 0xc0d63b6e), TOBN(0x5cf06fd5, 0xc63d488f), - TOBN(0x97363fac, 0xd9588e41), TOBN(0x1f9bf762, 0x2b93257e), - TOBN(0xa9d1ffc4, 0x667acace), TOBN(0x1cf4a1aa, 0x0a061ecf), - TOBN(0x40e48a49, 0xdc1818d0), TOBN(0x0643ff39, 0xa3621ab0), - TOBN(0x5768640c, 0xe39ef639), TOBN(0x1fc099ea, 0x04d86854), - TOBN(0x9130b9c3, 0xeccd28fd), TOBN(0xd743cbd2, 0x7eec54ab), - TOBN(0x052b146f, 0xe5b475b6), TOBN(0x058d9a82, 0x900a7d1f), - TOBN(0x65e02292, 0x91262b72), TOBN(0x96f924f9, 0xbb0edf03), - TOBN(0x5cfa59c8, 0xfe206842), TOBN(0xf6037004, 0x5eafa720), - TOBN(0x5f30699e, 0x18d7dd96), TOBN(0x381e8782, 0xcbab2495), - TOBN(0x91669b46, 0xdd8be949), TOBN(0xb40606f5, 0x26aae8ef), - TOBN(0x2812b839, 0xfc6751a4), TOBN(0x16196214, 0xfba800ef), - TOBN(0x4398d5ca, 0x4c1a2875), TOBN(0x720c00ee, 0x653d8349), - TOBN(0xc2699eb0, 0xd820007c), TOBN(0x880ee660, 0xa39b5825), - TOBN(0x70694694, 0x471f6984), TOBN(0xf7d16ea8, 0xe3dda99a), - TOBN(0x28d675b2, 0xc0519a23), TOBN(0x9ebf94fe, 0x4f6952e3), - TOBN(0xf28bb767, 0xa2294a8a), TOBN(0x85512b4d, 0xfe0af3f5), - TOBN(0x18958ba8, 0x99b16a0d), TOBN(0x95c2430c, 0xba7548a7), - TOBN(0xb30d1b10, 0xa16be615), TOBN(0xe3ebbb97, 0x85bfb74c), - TOBN(0xa3273cfe, 0x18549fdb), TOBN(0xf6e200bf, 0x4fcdb792), - TOBN(0x54a76e18, 0x83aba56c), TOBN(0x73ec66f6, 0x89ef6aa2), - TOBN(0x8d17add7, 0xd1b9a305), TOBN(0xa959c5b9, 0xb7ae1b9d), - TOBN(0x88643522, 0x6bcc094a), TOBN(0xcc5616c4, 0xd7d429b9), - TOBN(0xa6dada01, 0xe6a33f7c), TOBN(0xc6217a07, 0x9d4e70ad), - TOBN(0xd619a818, 0x09c15b7c), TOBN(0xea06b329, 0x0e80c854), - TOBN(0x174811ce, 0xa5f5e7b9), TOBN(0x66dfc310, 0x787c65f4), - TOBN(0x4ea7bd69, 0x3316ab54), TOBN(0xc12c4acb, 0x1dcc0f70), - TOBN(0xe4308d1a, 0x1e407dd9), TOBN(0xe8a3587c, 0x91afa997), - TOBN(0xea296c12, 0xab77b7a5), TOBN(0xb5ad49e4, 0x673c0d52), - TOBN(0x40f9b2b2, 0x7006085a), TOBN(0xa88ff340, 0x87bf6ec2), - TOBN(0x978603b1, 0x4e3066a6), TOBN(0xb3f99fc2, 0xb5e486e2), - TOBN(0x07b53f5e, 0xb2e63645), TOBN(0xbe57e547, 0x84c84232), - TOBN(0xd779c216, 0x7214d5cf), TOBN(0x617969cd, 0x029a3aca), - TOBN(0xd17668cd, 0x8a7017a0), TOBN(0x77b4d19a, 0xbe9b7ee8), - TOBN(0x58fd0e93, 0x9c161776), TOBN(0xa8c4f4ef, 0xd5968a72), - TOBN(0x296071cc, 0x67b3de77), TOBN(0xae3c0b8e, 0x634f7905), - TOBN(0x67e440c2, 0x8a7100c9), TOBN(0xbb8c3c1b, 0xeb4b9b42), - TOBN(0x6d71e8ea, 0xc51b3583), TOBN(0x7591f5af, 0x9525e642), - TOBN(0xf73a2f7b, 0x13f509f3), TOBN(0x618487aa, 0x5619ac9b), - TOBN(0x3a72e5f7, 0x9d61718a), TOBN(0x00413bcc, 0x7592d28c), - TOBN(0x7d9b11d3, 0x963c35cf), TOBN(0x77623bcf, 0xb90a46ed), - TOBN(0xdeef273b, 0xdcdd2a50), TOBN(0x4a741f9b, 0x0601846e), - TOBN(0x33b89e51, 0x0ec6e929), TOBN(0xcb02319f, 0x8b7f22cd), - TOBN(0xbbe1500d, 0x084bae24), TOBN(0x2f0ae8d7, 0x343d2693), - TOBN(0xacffb5f2, 0x7cdef811), TOBN(0xaa0c030a, 0x263fb94f), - TOBN(0x6eef0d61, 0xa0f442de), TOBN(0xf92e1817, 0x27b139d3), - TOBN(0x1ae6deb7, 0x0ad8bc28), TOBN(0xa89e38dc, 0xc0514130), - TOBN(0x81eeb865, 0xd2fdca23), TOBN(0x5a15ee08, 0xcc8ef895), - TOBN(0x768fa10a, 0x01905614), TOBN(0xeff5b8ef, 0x880ee19b), - TOBN(0xf0c0cabb, 0xcb1c8a0e), TOBN(0x2e1ee9cd, 0xb8c838f9), - TOBN(0x0587d8b8, 0x8a4a14c0), TOBN(0xf6f27896, 0x2ff698e5), - TOBN(0xed38ef1c, 0x89ee6256), TOBN(0xf44ee1fe, 0x6b353b45), - TOBN(0x9115c0c7, 0x70e903b3), TOBN(0xc78ec0a1, 0x818f31df), - TOBN(0x6c003324, 0xb7dccbc6), TOBN(0xd96dd1f3, 0x163bbc25), - TOBN(0x33aa82dd, 0x5cedd805), TOBN(0x123aae4f, 0x7f7eb2f1), - TOBN(0x1723fcf5, 0xa26262cd), TOBN(0x1f7f4d5d, 0x0060ebd5), - TOBN(0xf19c5c01, 0xb2eaa3af), TOBN(0x2ccb9b14, 0x9790accf), - TOBN(0x1f9c1cad, 0x52324aa6), TOBN(0x63200526, 0x7247df54), - TOBN(0x5732fe42, 0xbac96f82), TOBN(0x52fe771f, 0x01a1c384), - TOBN(0x546ca13d, 0xb1001684), TOBN(0xb56b4eee, 0xa1709f75), - TOBN(0x266545a9, 0xd5db8672), TOBN(0xed971c90, 0x1e8f3cfb), - TOBN(0x4e7d8691, 0xe3a07b29), TOBN(0x7570d9ec, 0xe4b696b9), - TOBN(0xdc5fa067, 0x7bc7e9ae), TOBN(0x68b44caf, 0xc82c4844), - TOBN(0x519d34b3, 0xbf44da80), TOBN(0x283834f9, 0x5ab32e66), - TOBN(0x6e608797, 0x6278a000), TOBN(0x1e62960e, 0x627312f6), - TOBN(0x9b87b27b, 0xe6901c55), TOBN(0x80e78538, 0x24fdbc1f), - TOBN(0xbbbc0951, 0x2facc27d), TOBN(0x06394239, 0xac143b5a), - TOBN(0x35bb4a40, 0x376c1944), TOBN(0x7cb62694, 0x63da1511), - TOBN(0xafd29161, 0xb7148a3b), TOBN(0xa6f9d9ed, 0x4e2ea2ee), - TOBN(0x15dc2ca2, 0x880dd212), TOBN(0x903c3813, 0xa61139a9), - TOBN(0x2aa7b46d, 0x6c0f8785), TOBN(0x36ce2871, 0x901c60ff), - TOBN(0xc683b028, 0xe10d9c12), TOBN(0x7573baa2, 0x032f33d3), - TOBN(0x87a9b1f6, 0x67a31b58), TOBN(0xfd3ed11a, 0xf4ffae12), - TOBN(0x83dcaa9a, 0x0cb2748e), TOBN(0x8239f018, 0x5d6fdf16), - TOBN(0xba67b49c, 0x72753941), TOBN(0x2beec455, 0xc321cb36), - TOBN(0x88015606, 0x3f8b84ce), TOBN(0x76417083, 0x8d38c86f), - TOBN(0x054f1ca7, 0x598953dd), TOBN(0xc939e110, 0x4e8e7429), - TOBN(0x9b1ac2b3, 0x5a914f2f), TOBN(0x39e35ed3, 0xe74b8f9c), - TOBN(0xd0debdb2, 0x781b2fb0), TOBN(0x1585638f, 0x2d997ba2), - TOBN(0x9c4b646e, 0x9e2fce99), TOBN(0x68a21081, 0x1e80857f), - TOBN(0x06d54e44, 0x3643b52a), TOBN(0xde8d6d63, 0x0d8eb843), - TOBN(0x70321563, 0x42146a0a), TOBN(0x8ba826f2, 0x5eaa3622), - TOBN(0x227a58bd, 0x86138787), TOBN(0x43b6c03c, 0x10281d37), - TOBN(0x6326afbb, 0xb54dde39), TOBN(0x744e5e8a, 0xdb6f2d5f), - TOBN(0x48b2a99a, 0xcff158e1), TOBN(0xa93c8fa0, 0xef87918f), - TOBN(0x2182f956, 0xde058c5c), TOBN(0x216235d2, 0x936f9e7a), - TOBN(0xace0c0db, 0xd2e31e67), TOBN(0xc96449bf, 0xf23ac3e7), - TOBN(0x7e9a2874, 0x170693bd), TOBN(0xa28e14fd, 0xa45e6335), - TOBN(0x5757f6b3, 0x56427344), TOBN(0x822e4556, 0xacf8edf9), - TOBN(0x2b7a6ee2, 0xe6a285cd), TOBN(0x5866f211, 0xa9df3af0), - TOBN(0x40dde2dd, 0xf845b844), TOBN(0x986c3726, 0x110e5e49), - TOBN(0x73680c2a, 0xf7172277), TOBN(0x57b94f0f, 0x0cccb244), - TOBN(0xbdff7267, 0x2d438ca7), TOBN(0xbad1ce11, 0xcf4663fd), - TOBN(0x9813ed9d, 0xd8f71cae), TOBN(0xf43272a6, 0x961fdaa6), - TOBN(0xbeff0119, 0xbd6d1637), TOBN(0xfebc4f91, 0x30361978), - TOBN(0x02b37a95, 0x2f41deff), TOBN(0x0e44a59a, 0xe63b89b7), - TOBN(0x673257dc, 0x143ff951), TOBN(0x19c02205, 0xd752baf4), - TOBN(0x46c23069, 0xc4b7d692), TOBN(0x2e6392c3, 0xfd1502ac), - TOBN(0x6057b1a2, 0x1b220846), TOBN(0xe51ff946, 0x0c1b5b63)}, - {TOBN(0x6e85cb51, 0x566c5c43), TOBN(0xcff9c919, 0x3597f046), - TOBN(0x9354e90c, 0x4994d94a), TOBN(0xe0a39332, 0x2147927d), - TOBN(0x8427fac1, 0x0dc1eb2b), TOBN(0x88cfd8c2, 0x2ff319fa), - TOBN(0xe2d4e684, 0x01965274), TOBN(0xfa2e067d, 0x67aaa746), - TOBN(0xb6d92a7f, 0x3e5f9f11), TOBN(0x9afe153a, 0xd6cb3b8e), - TOBN(0x4d1a6dd7, 0xddf800bd), TOBN(0xf6c13cc0, 0xcaf17e19), - TOBN(0x15f6c58e, 0x325fc3ee), TOBN(0x71095400, 0xa31dc3b2), - TOBN(0x168e7c07, 0xafa3d3e7), TOBN(0x3f8417a1, 0x94c7ae2d), - TOBN(0xec234772, 0x813b230d), TOBN(0x634d0f5f, 0x17344427), - TOBN(0x11548ab1, 0xd77fc56a), TOBN(0x7fab1750, 0xce06af77), - TOBN(0xb62c10a7, 0x4f7c4f83), TOBN(0xa7d2edc4, 0x220a67d9), - TOBN(0x1c404170, 0x921209a0), TOBN(0x0b9815a0, 0xface59f0), - TOBN(0x2842589b, 0x319540c3), TOBN(0x18490f59, 0xa283d6f8), - TOBN(0xa2731f84, 0xdaae9fcb), TOBN(0x3db6d960, 0xc3683ba0), - TOBN(0xc85c63bb, 0x14611069), TOBN(0xb19436af, 0x0788bf05), - TOBN(0x905459df, 0x347460d2), TOBN(0x73f6e094, 0xe11a7db1), - TOBN(0xdc7f938e, 0xb6357f37), TOBN(0xc5d00f79, 0x2bd8aa62), - TOBN(0xc878dcb9, 0x2ca979fc), TOBN(0x37e83ed9, 0xeb023a99), - TOBN(0x6b23e273, 0x1560bf3d), TOBN(0x1086e459, 0x1d0fae61), - TOBN(0x78248316, 0x9a9414bd), TOBN(0x1b956bc0, 0xf0ea9ea1), - TOBN(0x7b85bb91, 0xc31b9c38), TOBN(0x0c5aa90b, 0x48ef57b5), - TOBN(0xdedeb169, 0xaf3bab6f), TOBN(0xe610ad73, 0x2d373685), - TOBN(0xf13870df, 0x02ba8e15), TOBN(0x0337edb6, 0x8ca7f771), - TOBN(0xe4acf747, 0xb62c036c), TOBN(0xd921d576, 0xb6b94e81), - TOBN(0xdbc86439, 0x2c422f7a), TOBN(0xfb635362, 0xed348898), - TOBN(0x83084668, 0xc45bfcd1), TOBN(0xc357c9e3, 0x2b315e11), - TOBN(0xb173b540, 0x5b2e5b8c), TOBN(0x7e946931, 0xe102b9a4), - TOBN(0x17c890eb, 0x7b0fb199), TOBN(0xec225a83, 0xd61b662b), - TOBN(0xf306a3c8, 0xee3c76cb), TOBN(0x3cf11623, 0xd32a1f6e), - TOBN(0xe6d5ab64, 0x6863e956), TOBN(0x3b8a4cbe, 0x5c005c26), - TOBN(0xdcd529a5, 0x9ce6bb27), TOBN(0xc4afaa52, 0x04d4b16f), - TOBN(0xb0624a26, 0x7923798d), TOBN(0x85e56df6, 0x6b307fab), - TOBN(0x0281893c, 0x2bf29698), TOBN(0x91fc19a4, 0xd7ce7603), - TOBN(0x75a5dca3, 0xad9a558f), TOBN(0x40ceb3fa, 0x4d50bf77), - TOBN(0x1baf6060, 0xbc9ba369), TOBN(0x927e1037, 0x597888c2), - TOBN(0xd936bf19, 0x86a34c07), TOBN(0xd4cf10c1, 0xc34ae980), - TOBN(0x3a3e5334, 0x859dd614), TOBN(0x9c475b5b, 0x18d0c8ee), - TOBN(0x63080d1f, 0x07cd51d5), TOBN(0xc9c0d0a6, 0xb88b4326), - TOBN(0x1ac98691, 0xc234296f), TOBN(0x2a0a83a4, 0x94887fb6), - TOBN(0x56511427, 0x0cea9cf2), TOBN(0x5230a6e8, 0xa24802f5), - TOBN(0xf7a2bf0f, 0x72e3d5c1), TOBN(0x37717446, 0x4f21439e), - TOBN(0xfedcbf25, 0x9ce30334), TOBN(0xe0030a78, 0x7ce202f9), - TOBN(0x6f2d9ebf, 0x1202e9ca), TOBN(0xe79dde6c, 0x75e6e591), - TOBN(0xf52072af, 0xf1dac4f8), TOBN(0x6c8d087e, 0xbb9b404d), - TOBN(0xad0fc73d, 0xbce913af), TOBN(0x909e587b, 0x458a07cb), - TOBN(0x1300da84, 0xd4f00c8a), TOBN(0x425cd048, 0xb54466ac), - TOBN(0xb59cb9be, 0x90e9d8bf), TOBN(0x991616db, 0x3e431b0e), - TOBN(0xd3aa117a, 0x531aecff), TOBN(0x91af92d3, 0x59f4dc3b), - TOBN(0x9b1ec292, 0xe93fda29), TOBN(0x76bb6c17, 0xe97d91bc), - TOBN(0x7509d95f, 0xaface1e6), TOBN(0x3653fe47, 0xbe855ae3), - TOBN(0x73180b28, 0x0f680e75), TOBN(0x75eefd1b, 0xeeb6c26c), - TOBN(0xa4cdf29f, 0xb66d4236), TOBN(0x2d70a997, 0x6b5821d8), - TOBN(0x7a3ee207, 0x20445c36), TOBN(0x71d1ac82, 0x59877174), - TOBN(0x0fc539f7, 0x949f73e9), TOBN(0xd05cf3d7, 0x982e3081), - TOBN(0x8758e20b, 0x7b1c7129), TOBN(0xffadcc20, 0x569e61f2), - TOBN(0xb05d3a2f, 0x59544c2d), TOBN(0xbe16f5c1, 0x9fff5e53), - TOBN(0x73cf65b8, 0xaad58135), TOBN(0x622c2119, 0x037aa5be), - TOBN(0x79373b3f, 0x646fd6a0), TOBN(0x0e029db5, 0x0d3978cf), - TOBN(0x8bdfc437, 0x94fba037), TOBN(0xaefbd687, 0x620797a6), - TOBN(0x3fa5382b, 0xbd30d38e), TOBN(0x7627cfbf, 0x585d7464), - TOBN(0xb2330fef, 0x4e4ca463), TOBN(0xbcef7287, 0x3566cc63), - TOBN(0xd161d2ca, 0xcf780900), TOBN(0x135dc539, 0x5b54827d), - TOBN(0x638f052e, 0x27bf1bc6), TOBN(0x10a224f0, 0x07dfa06c), - TOBN(0xe973586d, 0x6d3321da), TOBN(0x8b0c5738, 0x26152c8f), - TOBN(0x07ef4f2a, 0x34606074), TOBN(0x80fe7fe8, 0xa0f7047a), - TOBN(0x3d1a8152, 0xe1a0e306), TOBN(0x32cf43d8, 0x88da5222), - TOBN(0xbf89a95f, 0x5f02ffe6), TOBN(0x3d9eb9a4, 0x806ad3ea), - TOBN(0x012c17bb, 0x79c8e55e), TOBN(0xfdcd1a74, 0x99c81dac), - TOBN(0x7043178b, 0xb9556098), TOBN(0x4090a1df, 0x801c3886), - TOBN(0x759800ff, 0x9b67b912), TOBN(0x3e5c0304, 0x232620c8), - TOBN(0x4b9d3c4b, 0x70dceeca), TOBN(0xbb2d3c15, 0x181f648e), - TOBN(0xf981d837, 0x6e33345c), TOBN(0xb626289b, 0x0cf2297a), - TOBN(0x766ac659, 0x8baebdcf), TOBN(0x1a28ae09, 0x75df01e5), - TOBN(0xb71283da, 0x375876d8), TOBN(0x4865a96d, 0x607b9800), - TOBN(0x25dd1bcd, 0x237936b2), TOBN(0x332f4f4b, 0x60417494), - TOBN(0xd0923d68, 0x370a2147), TOBN(0x497f5dfb, 0xdc842203), - TOBN(0x9dc74cbd, 0x32be5e0f), TOBN(0x7475bcb7, 0x17a01375), - TOBN(0x438477c9, 0x50d872b1), TOBN(0xcec67879, 0xffe1d63d), - TOBN(0x9b006014, 0xd8578c70), TOBN(0xc9ad99a8, 0x78bb6b8b), - TOBN(0x6799008e, 0x11fb3806), TOBN(0xcfe81435, 0xcd44cab3), - TOBN(0xa2ee1582, 0x2f4fb344), TOBN(0xb8823450, 0x483fa6eb), - TOBN(0x622d323d, 0x652c7749), TOBN(0xd8474a98, 0xbeb0a15b), - TOBN(0xe43c154d, 0x5d1c00d0), TOBN(0x7fd581d9, 0x0e3e7aac), - TOBN(0x2b44c619, 0x2525ddf8), TOBN(0x67a033eb, 0xb8ae9739), - TOBN(0x113ffec1, 0x9ef2d2e4), TOBN(0x1bf6767e, 0xd5a0ea7f), - TOBN(0x57fff75e, 0x03714c0a), TOBN(0xa23c422e, 0x0a23e9ee), - TOBN(0xdd5f6b2d, 0x540f83af), TOBN(0xc2c2c27e, 0x55ea46a7), - TOBN(0xeb6b4246, 0x672a1208), TOBN(0xd13599f7, 0xae634f7a), - TOBN(0xcf914b5c, 0xd7b32c6e), TOBN(0x61a5a640, 0xeaf61814), - TOBN(0x8dc3df8b, 0x208a1bbb), TOBN(0xef627fd6, 0xb6d79aa5), - TOBN(0x44232ffc, 0xc4c86bc8), TOBN(0xe6f9231b, 0x061539fe), - TOBN(0x1d04f25a, 0x958b9533), TOBN(0x180cf934, 0x49e8c885), - TOBN(0x89689595, 0x9884aaf7), TOBN(0xb1959be3, 0x07b348a6), - TOBN(0x96250e57, 0x3c147c87), TOBN(0xae0efb3a, 0xdd0c61f8), - TOBN(0xed00745e, 0xca8c325e), TOBN(0x3c911696, 0xecff3f70), - TOBN(0x73acbc65, 0x319ad41d), TOBN(0x7b01a020, 0xf0b1c7ef), - TOBN(0xea32b293, 0x63a1483f), TOBN(0x89eabe71, 0x7a248f96), - TOBN(0x9c6231d3, 0x343157e5), TOBN(0x93a375e5, 0xdf3c546d), - TOBN(0xe76e9343, 0x6a2afe69), TOBN(0xc4f89100, 0xe166c88e), - TOBN(0x248efd0d, 0x4f872093), TOBN(0xae0eb3ea, 0x8fe0ea61), - TOBN(0xaf89790d, 0x9d79046e), TOBN(0x4d650f2d, 0x6cee0976), - TOBN(0xa3935d9a, 0x43071eca), TOBN(0x66fcd2c9, 0x283b0bfe), - TOBN(0x0e665eb5, 0x696605f1), TOBN(0xe77e5d07, 0xa54cd38d), - TOBN(0x90ee050a, 0x43d950cf), TOBN(0x86ddebda, 0xd32e69b5), - TOBN(0x6ad94a3d, 0xfddf7415), TOBN(0xf7fa1309, 0x3f6e8d5a), - TOBN(0xc4831d1d, 0xe9957f75), TOBN(0x7de28501, 0xd5817447), - TOBN(0x6f1d7078, 0x9e2aeb6b), TOBN(0xba2b9ff4, 0xf67a53c2), - TOBN(0x36963767, 0xdf9defc3), TOBN(0x479deed3, 0x0d38022c), - TOBN(0xd2edb89b, 0x3a8631e8), TOBN(0x8de855de, 0x7a213746), - TOBN(0xb2056cb7, 0xb00c5f11), TOBN(0xdeaefbd0, 0x2c9b85e4), - TOBN(0x03f39a8d, 0xd150892d), TOBN(0x37b84686, 0x218b7985), - TOBN(0x36296dd8, 0xb7375f1a), TOBN(0x472cd4b1, 0xb78e898e), - TOBN(0x15dff651, 0xe9f05de9), TOBN(0xd4045069, 0x2ce98ba9), - TOBN(0x8466a7ae, 0x9b38024c), TOBN(0xb910e700, 0xe5a6b5ef), - TOBN(0xae1c56ea, 0xb3aa8f0d), TOBN(0xbab2a507, 0x7eee74a6), - TOBN(0x0dca11e2, 0x4b4c4620), TOBN(0xfd896e2e, 0x4c47d1f4), - TOBN(0xeb45ae53, 0x308fbd93), TOBN(0x46cd5a2e, 0x02c36fda), - TOBN(0x6a3d4e90, 0xbaa48385), TOBN(0xdd55e62e, 0x9dbe9960), - TOBN(0xa1406aa0, 0x2a81ede7), TOBN(0x6860dd14, 0xf9274ea7), - TOBN(0xcfdcb0c2, 0x80414f86), TOBN(0xff410b10, 0x22f94327), - TOBN(0x5a33cc38, 0x49ad467b), TOBN(0xefb48b6c, 0x0a7335f1), - TOBN(0x14fb54a4, 0xb153a360), TOBN(0x604aa9d2, 0xb52469cc), - TOBN(0x5e9dc486, 0x754e48e9), TOBN(0x693cb455, 0x37471e8e), - TOBN(0xfb2fd7cd, 0x8d3b37b6), TOBN(0x63345e16, 0xcf09ff07), - TOBN(0x9910ba6b, 0x23a5d896), TOBN(0x1fe19e35, 0x7fe4364e), - TOBN(0x6e1da8c3, 0x9a33c677), TOBN(0x15b4488b, 0x29fd9fd0), - TOBN(0x1f439254, 0x1a1f22bf), TOBN(0x920a8a70, 0xab8163e8), - TOBN(0x3fd1b249, 0x07e5658e), TOBN(0xf2c4f79c, 0xb6ec839b), - TOBN(0x1abbc3d0, 0x4aa38d1b), TOBN(0x3b0db35c, 0xb5d9510e), - TOBN(0x1754ac78, 0x3e60dec0), TOBN(0x53272fd7, 0xea099b33), - TOBN(0x5fb0494f, 0x07a8e107), TOBN(0x4a89e137, 0x6a8191fa), - TOBN(0xa113b7f6, 0x3c4ad544), TOBN(0x88a2e909, 0x6cb9897b), - TOBN(0x17d55de3, 0xb44a3f84), TOBN(0xacb2f344, 0x17c6c690), - TOBN(0x32088168, 0x10232390), TOBN(0xf2e8a61f, 0x6c733bf7), - TOBN(0xa774aab6, 0x9c2d7652), TOBN(0xfb5307e3, 0xed95c5bc), - TOBN(0xa05c73c2, 0x4981f110), TOBN(0x1baae31c, 0xa39458c9), - TOBN(0x1def185b, 0xcbea62e7), TOBN(0xe8ac9eae, 0xeaf63059), - TOBN(0x098a8cfd, 0x9921851c), TOBN(0xd959c3f1, 0x3abe2f5b), - TOBN(0xa4f19525, 0x20e40ae5), TOBN(0x320789e3, 0x07a24aa1), - TOBN(0x259e6927, 0x7392b2bc), TOBN(0x58f6c667, 0x1918668b), - TOBN(0xce1db2bb, 0xc55d2d8b), TOBN(0x41d58bb7, 0xf4f6ca56), - TOBN(0x7650b680, 0x8f877614), TOBN(0x905e16ba, 0xf4c349ed), - TOBN(0xed415140, 0xf661acac), TOBN(0x3b8784f0, 0xcb2270af), - TOBN(0x3bc280ac, 0x8a402cba), TOBN(0xd53f7146, 0x0937921a), - TOBN(0xc03c8ee5, 0xe5681e83), TOBN(0x62126105, 0xf6ac9e4a), - TOBN(0x9503a53f, 0x936b1a38), TOBN(0x3d45e2d4, 0x782fecbd), - TOBN(0x69a5c439, 0x76e8ae98), TOBN(0xb53b2eeb, 0xbfb4b00e), - TOBN(0xf1674712, 0x72386c89), TOBN(0x30ca34a2, 0x4268bce4), - TOBN(0x7f1ed86c, 0x78341730), TOBN(0x8ef5beb8, 0xb525e248), - TOBN(0xbbc489fd, 0xb74fbf38), TOBN(0x38a92a0e, 0x91a0b382), - TOBN(0x7a77ba3f, 0x22433ccf), TOBN(0xde8362d6, 0xa29f05a9), - TOBN(0x7f6a30ea, 0x61189afc), TOBN(0x693b5505, 0x59ef114f), - TOBN(0x50266bc0, 0xcd1797a1), TOBN(0xea17b47e, 0xf4b7af2d), - TOBN(0xd6c4025c, 0x3df9483e), TOBN(0x8cbb9d9f, 0xa37b18c9), - TOBN(0x91cbfd9c, 0x4d8424cf), TOBN(0xdb7048f1, 0xab1c3506), - TOBN(0x9eaf641f, 0x028206a3), TOBN(0xf986f3f9, 0x25bdf6ce), - TOBN(0x262143b5, 0x224c08dc), TOBN(0x2bbb09b4, 0x81b50c91), - TOBN(0xc16ed709, 0xaca8c84f), TOBN(0xa6210d9d, 0xb2850ca8), - TOBN(0x6d8df67a, 0x09cb54d6), TOBN(0x91eef6e0, 0x500919a4), - TOBN(0x90f61381, 0x0f132857), TOBN(0x9acede47, 0xf8d5028b), - TOBN(0x844d1b71, 0x90b771c3), TOBN(0x563b71e4, 0xba6426be), - TOBN(0x2efa2e83, 0xbdb802ff), TOBN(0x3410cbab, 0xab5b4a41), - TOBN(0x555b2d26, 0x30da84dd), TOBN(0xd0711ae9, 0xee1cc29a), - TOBN(0xcf3e8c60, 0x2f547792), TOBN(0x03d7d5de, 0xdc678b35), - TOBN(0x071a2fa8, 0xced806b8), TOBN(0x222e6134, 0x697f1478), - TOBN(0xdc16fd5d, 0xabfcdbbf), TOBN(0x44912ebf, 0x121b53b8), - TOBN(0xac943674, 0x2496c27c), TOBN(0x8ea3176c, 0x1ffc26b0), - TOBN(0xb6e224ac, 0x13debf2c), TOBN(0x524cc235, 0xf372a832), - TOBN(0xd706e1d8, 0x9f6f1b18), TOBN(0x2552f005, 0x44cce35b), - TOBN(0x8c8326c2, 0xa88e31fc), TOBN(0xb5468b2c, 0xf9552047), - TOBN(0xce683e88, 0x3ff90f2b), TOBN(0x77947bdf, 0x2f0a5423), - TOBN(0xd0a1b28b, 0xed56e328), TOBN(0xaee35253, 0xc20134ac), - TOBN(0x7e98367d, 0x3567962f), TOBN(0x379ed61f, 0x8188bffb), - TOBN(0x73bba348, 0xfaf130a1), TOBN(0x6c1f75e1, 0x904ed734), - TOBN(0x18956642, 0x3b4a79fc), TOBN(0xf20bc83d, 0x54ef4493), - TOBN(0x836d425d, 0x9111eca1), TOBN(0xe5b5c318, 0x009a8dcf), - TOBN(0x3360b25d, 0x13221bc5), TOBN(0x707baad2, 0x6b3eeaf7), - TOBN(0xd7279ed8, 0x743a95a1), TOBN(0x7450a875, 0x969e809f), - TOBN(0x32b6bd53, 0xe5d0338f), TOBN(0x1e77f7af, 0x2b883bbc), - TOBN(0x90da12cc, 0x1063ecd0), TOBN(0xe2697b58, 0xc315be47), - TOBN(0x2771a5bd, 0xda85d534), TOBN(0x53e78c1f, 0xff980eea), - TOBN(0xadf1cf84, 0x900385e7), TOBN(0x7d3b14f6, 0xc9387b62), - TOBN(0x170e74b0, 0xcb8f2bd2), TOBN(0x2d50b486, 0x827fa993), - TOBN(0xcdbe8c9a, 0xf6f32bab), TOBN(0x55e906b0, 0xc3b93ab8), - TOBN(0x747f22fc, 0x8fe280d1), TOBN(0xcd8e0de5, 0xb2e114ab), - TOBN(0x5ab7dbeb, 0xe10b68b0), TOBN(0x9dc63a9c, 0xa480d4b2), - TOBN(0x78d4bc3b, 0x4be1495f), TOBN(0x25eb3db8, 0x9359122d), - TOBN(0x3f8ac05b, 0x0809cbdc), TOBN(0xbf4187bb, 0xd37c702f), - TOBN(0x84cea069, 0x1416a6a5), TOBN(0x8f860c79, 0x43ef881c), - TOBN(0x41311f8a, 0x38038a5d), TOBN(0xe78c2ec0, 0xfc612067), - TOBN(0x494d2e81, 0x5ad73581), TOBN(0xb4cc9e00, 0x59604097), - TOBN(0xff558aec, 0xf3612cba), TOBN(0x35beef7a, 0x9e36c39e), - TOBN(0x1845c7cf, 0xdbcf41b9), TOBN(0x5703662a, 0xaea997c0), - TOBN(0x8b925afe, 0xe402f6d8), TOBN(0xd0a1b1ae, 0x4dd72162), - TOBN(0x9f47b375, 0x03c41c4b), TOBN(0xa023829b, 0x0391d042), - TOBN(0x5f5045c3, 0x503b8b0a), TOBN(0x123c2688, 0x98c010e5), - TOBN(0x324ec0cc, 0x36ba06ee), TOBN(0xface3115, 0x3dd2cc0c), - TOBN(0xb364f3be, 0xf333e91f), TOBN(0xef8aff73, 0x28e832b0), - TOBN(0x1e9bad04, 0x2d05841b), TOBN(0x42f0e3df, 0x356a21e2), - TOBN(0xa3270bcb, 0x4add627e), TOBN(0xb09a8158, 0xd322e711), - TOBN(0x86e326a1, 0x0fee104a), TOBN(0xad7788f8, 0x3703f65d), - TOBN(0x7e765430, 0x47bc4833), TOBN(0x6cee582b, 0x2b9b893a), - TOBN(0x9cd2a167, 0xe8f55a7b), TOBN(0xefbee3c6, 0xd9e4190d), - TOBN(0x33ee7185, 0xd40c2e9d), TOBN(0x844cc9c5, 0xa380b548), - TOBN(0x323f8ecd, 0x66926e04), TOBN(0x0001e38f, 0x8110c1ba), - TOBN(0x8dbcac12, 0xfc6a7f07), TOBN(0xd65e1d58, 0x0cec0827), - TOBN(0xd2cd4141, 0xbe76ca2d), TOBN(0x7895cf5c, 0xe892f33a), - TOBN(0x956d230d, 0x367139d2), TOBN(0xa91abd3e, 0xd012c4c1), - TOBN(0x34fa4883, 0x87eb36bf), TOBN(0xc5f07102, 0x914b8fb4), - TOBN(0x90f0e579, 0xadb9c95f), TOBN(0xfe6ea8cb, 0x28888195), - TOBN(0x7b9b5065, 0xedfa9284), TOBN(0x6c510bd2, 0x2b8c8d65), - TOBN(0xd7b8ebef, 0xcbe8aafd), TOBN(0xedb3af98, 0x96b1da07), - TOBN(0x28ff779d, 0x6295d426), TOBN(0x0c4f6ac7, 0x3fa3ad7b), - TOBN(0xec44d054, 0x8b8e2604), TOBN(0x9b32a66d, 0x8b0050e1), - TOBN(0x1f943366, 0xf0476ce2), TOBN(0x7554d953, 0xa602c7b4), - TOBN(0xbe35aca6, 0x524f2809), TOBN(0xb6881229, 0xfd4edbea), - TOBN(0xe8cd0c8f, 0x508efb63), TOBN(0x9eb5b5c8, 0x6abcefc7), - TOBN(0xf5621f5f, 0xb441ab4f), TOBN(0x79e6c046, 0xb76a2b22), - TOBN(0x74a4792c, 0xe37a1f69), TOBN(0xcbd252cb, 0x03542b60), - TOBN(0x785f65d5, 0xb3c20bd3), TOBN(0x8dea6143, 0x4fabc60c), - TOBN(0x45e21446, 0xde673629), TOBN(0x57f7aa1e, 0x703c2d21), - TOBN(0xa0e99b7f, 0x98c868c7), TOBN(0x4e42f66d, 0x8b641676), - TOBN(0x602884dc, 0x91077896), TOBN(0xa0d690cf, 0xc2c9885b), - TOBN(0xfeb4da33, 0x3b9a5187), TOBN(0x5f789598, 0x153c87ee), - TOBN(0x2192dd47, 0x52b16dba), TOBN(0xdeefc0e6, 0x3524c1b1), - TOBN(0x465ea76e, 0xe4383693), TOBN(0x79401711, 0x361b8d98), - TOBN(0xa5f9ace9, 0xf21a15cb), TOBN(0x73d26163, 0xefee9aeb), - TOBN(0xcca844b3, 0xe677016c), TOBN(0x6c122b07, 0x57eaee06), - TOBN(0xb782dce7, 0x15f09690), TOBN(0x508b9b12, 0x2dfc0fc9), - TOBN(0x9015ab4b, 0x65d89fc6), TOBN(0x5e79dab7, 0xd6d5bb0f), - TOBN(0x64f021f0, 0x6c775aa2), TOBN(0xdf09d8cc, 0x37c7eca1), - TOBN(0x9a761367, 0xef2fa506), TOBN(0xed4ca476, 0x5b81eec6), - TOBN(0x262ede36, 0x10bbb8b5), TOBN(0x0737ce83, 0x0641ada3), - TOBN(0x4c94288a, 0xe9831ccc), TOBN(0x487fc1ce, 0x8065e635), - TOBN(0xb13d7ab3, 0xb8bb3659), TOBN(0xdea5df3e, 0x855e4120), - TOBN(0xb9a18573, 0x85eb0244), TOBN(0x1a1b8ea3, 0xa7cfe0a3), - TOBN(0x3b837119, 0x67b0867c), TOBN(0x8d5e0d08, 0x9d364520), - TOBN(0x52dccc1e, 0xd930f0e3), TOBN(0xefbbcec7, 0xbf20bbaf), - TOBN(0x99cffcab, 0x0263ad10), TOBN(0xd8199e6d, 0xfcd18f8a), - TOBN(0x64e2773f, 0xe9f10617), TOBN(0x0079e8e1, 0x08704848), - TOBN(0x1169989f, 0x8a342283), TOBN(0x8097799c, 0xa83012e6), - TOBN(0xece966cb, 0x8a6a9001), TOBN(0x93b3afef, 0x072ac7fc), - TOBN(0xe6893a2a, 0x2db3d5ba), TOBN(0x263dc462, 0x89bf4fdc), - TOBN(0x8852dfc9, 0xe0396673), TOBN(0x7ac70895, 0x3af362b6), - TOBN(0xbb9cce4d, 0x5c2f342b), TOBN(0xbf80907a, 0xb52d7aae), - TOBN(0x97f3d3cd, 0x2161bcd0), TOBN(0xb25b0834, 0x0962744d), - TOBN(0xc5b18ea5, 0x6c3a1dda), TOBN(0xfe4ec7eb, 0x06c92317), - TOBN(0xb787b890, 0xad1c4afe), TOBN(0xdccd9a92, 0x0ede801a), - TOBN(0x9ac6ddda, 0xdb58da1f), TOBN(0x22bbc12f, 0xb8cae6ee), - TOBN(0xc6f8bced, 0x815c4a43), TOBN(0x8105a92c, 0xf96480c7), - TOBN(0x0dc3dbf3, 0x7a859d51), TOBN(0xe3ec7ce6, 0x3041196b), - TOBN(0xd9f64b25, 0x0d1067c9), TOBN(0xf2321321, 0x3d1f8dd8), - TOBN(0x8b5c619c, 0x76497ee8), TOBN(0x5d2b0ac6, 0xc717370e), - TOBN(0x98204cb6, 0x4fcf68e1), TOBN(0x0bdec211, 0x62bc6792), - TOBN(0x6973ccef, 0xa63b1011), TOBN(0xf9e3fa97, 0xe0de1ac5), - TOBN(0x5efb693e, 0x3d0e0c8b), TOBN(0x037248e9, 0xd2d4fcb4)}, - {TOBN(0x80802dc9, 0x1ec34f9e), TOBN(0xd8772d35, 0x33810603), - TOBN(0x3f06d66c, 0x530cb4f3), TOBN(0x7be5ed0d, 0xc475c129), - TOBN(0xcb9e3c19, 0x31e82b10), TOBN(0xc63d2857, 0xc9ff6b4c), - TOBN(0xb92118c6, 0x92a1b45e), TOBN(0x0aec4414, 0x7285bbca), - TOBN(0xfc189ae7, 0x1e29a3ef), TOBN(0xcbe906f0, 0x4c93302e), - TOBN(0xd0107914, 0xceaae10e), TOBN(0xb7a23f34, 0xb68e19f8), - TOBN(0xe9d875c2, 0xefd2119d), TOBN(0x03198c6e, 0xfcadc9c8), - TOBN(0x65591bf6, 0x4da17113), TOBN(0x3cf0bbf8, 0x3d443038), - TOBN(0xae485bb7, 0x2b724759), TOBN(0x945353e1, 0xb2d4c63a), - TOBN(0x82159d07, 0xde7d6f2c), TOBN(0x389caef3, 0x4ec5b109), - TOBN(0x4a8ebb53, 0xdb65ef14), TOBN(0x2dc2cb7e, 0xdd99de43), - TOBN(0x816fa3ed, 0x83f2405f), TOBN(0x73429bb9, 0xc14208a3), - TOBN(0xb618d590, 0xb01e6e27), TOBN(0x047e2ccd, 0xe180b2dc), - TOBN(0xd1b299b5, 0x04aea4a9), TOBN(0x412c9e1e, 0x9fa403a4), - TOBN(0x88d28a36, 0x79407552), TOBN(0x49c50136, 0xf332b8e3), - TOBN(0x3a1b6fcc, 0xe668de19), TOBN(0x178851bc, 0x75122b97), - TOBN(0xb1e13752, 0xfb85fa4c), TOBN(0xd61257ce, 0x383c8ce9), - TOBN(0xd43da670, 0xd2f74dae), TOBN(0xa35aa23f, 0xbf846bbb), - TOBN(0x5e74235d, 0x4421fc83), TOBN(0xf6df8ee0, 0xc363473b), - TOBN(0x34d7f52a, 0x3c4aa158), TOBN(0x50d05aab, 0x9bc6d22e), - TOBN(0x8c56e735, 0xa64785f4), TOBN(0xbc56637b, 0x5f29cd07), - TOBN(0x53b2bb80, 0x3ee35067), TOBN(0x50235a0f, 0xdc919270), - TOBN(0x191ab6d8, 0xf2c4aa65), TOBN(0xc3475831, 0x8396023b), - TOBN(0x80400ba5, 0xf0f805ba), TOBN(0x8881065b, 0x5ec0f80f), - TOBN(0xc370e522, 0xcc1b5e83), TOBN(0xde2d4ad1, 0x860b8bfb), - TOBN(0xad364df0, 0x67b256df), TOBN(0x8f12502e, 0xe0138997), - TOBN(0x503fa0dc, 0x7783920a), TOBN(0xe80014ad, 0xc0bc866a), - TOBN(0x3f89b744, 0xd3064ba6), TOBN(0x03511dcd, 0xcba5dba5), - TOBN(0x197dd46d, 0x95a7b1a2), TOBN(0x9c4e7ad6, 0x3c6341fb), - TOBN(0x426eca29, 0x484c2ece), TOBN(0x9211e489, 0xde7f4f8a), - TOBN(0x14997f6e, 0xc78ef1f4), TOBN(0x2b2c0910, 0x06574586), - TOBN(0x17286a6e, 0x1c3eede8), TOBN(0x25f92e47, 0x0f60e018), - TOBN(0x805c5646, 0x31890a36), TOBN(0x703ef600, 0x57feea5b), - TOBN(0x389f747c, 0xaf3c3030), TOBN(0xe0e5daeb, 0x54dd3739), - TOBN(0xfe24a4c3, 0xc9c9f155), TOBN(0x7e4bf176, 0xb5393962), - TOBN(0x37183de2, 0xaf20bf29), TOBN(0x4a1bd7b5, 0xf95a8c3b), - TOBN(0xa83b9699, 0x46191d3d), TOBN(0x281fc8dd, 0x7b87f257), - TOBN(0xb18e2c13, 0x54107588), TOBN(0x6372def7, 0x9b2bafe8), - TOBN(0xdaf4bb48, 0x0d8972ca), TOBN(0x3f2dd4b7, 0x56167a3f), - TOBN(0x1eace32d, 0x84310cf4), TOBN(0xe3bcefaf, 0xe42700aa), - TOBN(0x5fe5691e, 0xd785e73d), TOBN(0xa5db5ab6, 0x2ea60467), - TOBN(0x02e23d41, 0xdfc6514a), TOBN(0x35e8048e, 0xe03c3665), - TOBN(0x3f8b118f, 0x1adaa0f8), TOBN(0x28ec3b45, 0x84ce1a5a), - TOBN(0xe8cacc6e, 0x2c6646b8), TOBN(0x1343d185, 0xdbd0e40f), - TOBN(0xe5d7f844, 0xcaaa358c), TOBN(0x1a1db7e4, 0x9924182a), - TOBN(0xd64cd42d, 0x9c875d9a), TOBN(0xb37b515f, 0x042eeec8), - TOBN(0x4d4dd409, 0x7b165fbe), TOBN(0xfc322ed9, 0xe206eff3), - TOBN(0x7dee4102, 0x59b7e17e), TOBN(0x55a481c0, 0x8236ca00), - TOBN(0x8c885312, 0xc23fc975), TOBN(0x15715806, 0x05d6297b), - TOBN(0xa078868e, 0xf78edd39), TOBN(0x956b31e0, 0x03c45e52), - TOBN(0x470275d5, 0xff7b33a6), TOBN(0xc8d5dc3a, 0x0c7e673f), - TOBN(0x419227b4, 0x7e2f2598), TOBN(0x8b37b634, 0x4c14a975), - TOBN(0xd0667ed6, 0x8b11888c), TOBN(0x5e0e8c3e, 0x803e25dc), - TOBN(0x34e5d0dc, 0xb987a24a), TOBN(0x9f40ac3b, 0xae920323), - TOBN(0x5463de95, 0x34e0f63a), TOBN(0xa128bf92, 0x6b6328f9), - TOBN(0x491ccd7c, 0xda64f1b7), TOBN(0x7ef1ec27, 0xc47bde35), - TOBN(0xa857240f, 0xa36a2737), TOBN(0x35dc1366, 0x63621bc1), - TOBN(0x7a3a6453, 0xd4fb6897), TOBN(0x80f1a439, 0xc929319d), - TOBN(0xfc18274b, 0xf8cb0ba0), TOBN(0xb0b53766, 0x8078c5eb), - TOBN(0xfb0d4924, 0x1e01d0ef), TOBN(0x50d7c67d, 0x372ab09c), - TOBN(0xb4e370af, 0x3aeac968), TOBN(0xe4f7fee9, 0xc4b63266), - TOBN(0xb4acd4c2, 0xe3ac5664), TOBN(0xf8910bd2, 0xceb38cbf), - TOBN(0x1c3ae50c, 0xc9c0726e), TOBN(0x15309569, 0xd97b40bf), - TOBN(0x70884b7f, 0xfd5a5a1b), TOBN(0x3890896a, 0xef8314cd), - TOBN(0x58e1515c, 0xa5618c93), TOBN(0xe665432b, 0x77d942d1), - TOBN(0xb32181bf, 0xb6f767a8), TOBN(0x753794e8, 0x3a604110), - TOBN(0x09afeb7c, 0xe8c0dbcc), TOBN(0x31e02613, 0x598673a3), - TOBN(0x5d98e557, 0x7d46db00), TOBN(0xfc21fb8c, 0x9d985b28), - TOBN(0xc9040116, 0xb0843e0b), TOBN(0x53b1b3a8, 0x69b04531), - TOBN(0xdd1649f0, 0x85d7d830), TOBN(0xbb3bcc87, 0xcb7427e8), - TOBN(0x77261100, 0xc93dce83), TOBN(0x7e79da61, 0xa1922a2a), - TOBN(0x587a2b02, 0xf3149ce8), TOBN(0x147e1384, 0xde92ec83), - TOBN(0x484c83d3, 0xaf077f30), TOBN(0xea78f844, 0x0658b53a), - TOBN(0x912076c2, 0x027aec53), TOBN(0xf34714e3, 0x93c8177d), - TOBN(0x37ef5d15, 0xc2376c84), TOBN(0x8315b659, 0x3d1aa783), - TOBN(0x3a75c484, 0xef852a90), TOBN(0x0ba0c58a, 0x16086bd4), - TOBN(0x29688d7a, 0x529a6d48), TOBN(0x9c7f250d, 0xc2f19203), - TOBN(0x123042fb, 0x682e2df9), TOBN(0x2b7587e7, 0xad8121bc), - TOBN(0x30fc0233, 0xe0182a65), TOBN(0xb82ecf87, 0xe3e1128a), - TOBN(0x71682861, 0x93fb098f), TOBN(0x043e21ae, 0x85e9e6a7), - TOBN(0xab5b49d6, 0x66c834ea), TOBN(0x3be43e18, 0x47414287), - TOBN(0xf40fb859, 0x219a2a47), TOBN(0x0e6559e9, 0xcc58df3c), - TOBN(0xfe1dfe8e, 0x0c6615b4), TOBN(0x14abc8fd, 0x56459d70), - TOBN(0x7be0fa8e, 0x05de0386), TOBN(0x8e63ef68, 0xe9035c7c), - TOBN(0x116401b4, 0x53b31e91), TOBN(0x0cba7ad4, 0x4436b4d8), - TOBN(0x9151f9a0, 0x107afd66), TOBN(0xafaca8d0, 0x1f0ee4c4), - TOBN(0x75fe5c1d, 0x9ee9761c), TOBN(0x3497a16b, 0xf0c0588f), - TOBN(0x3ee2bebd, 0x0304804c), TOBN(0xa8fb9a60, 0xc2c990b9), - TOBN(0xd14d32fe, 0x39251114), TOBN(0x36bf25bc, 0xcac73366), - TOBN(0xc9562c66, 0xdba7495c), TOBN(0x324d301b, 0x46ad348b), - TOBN(0x9f46620c, 0xd670407e), TOBN(0x0ea8d4f1, 0xe3733a01), - TOBN(0xd396d532, 0xb0c324e0), TOBN(0x5b211a0e, 0x03c317cd), - TOBN(0x090d7d20, 0x5ffe7b37), TOBN(0x3b7f3efb, 0x1747d2da), - TOBN(0xa2cb525f, 0xb54fc519), TOBN(0x6e220932, 0xf66a971e), - TOBN(0xddc160df, 0xb486d440), TOBN(0x7fcfec46, 0x3fe13465), - TOBN(0x83da7e4e, 0x76e4c151), TOBN(0xd6fa48a1, 0xd8d302b5), - TOBN(0xc6304f26, 0x5872cd88), TOBN(0x806c1d3c, 0x278b90a1), - TOBN(0x3553e725, 0xcaf0bc1c), TOBN(0xff59e603, 0xbb9d8d5c), - TOBN(0xa4550f32, 0x7a0b85dd), TOBN(0xdec5720a, 0x93ecc217), - TOBN(0x0b88b741, 0x69d62213), TOBN(0x7212f245, 0x5b365955), - TOBN(0x20764111, 0xb5cae787), TOBN(0x13cb7f58, 0x1dfd3124), - TOBN(0x2dca77da, 0x1175aefb), TOBN(0xeb75466b, 0xffaae775), - TOBN(0x74d76f3b, 0xdb6cff32), TOBN(0x7440f37a, 0x61fcda9a), - TOBN(0x1bb3ac92, 0xb525028b), TOBN(0x20fbf8f7, 0xa1975f29), - TOBN(0x982692e1, 0xdf83097f), TOBN(0x28738f6c, 0x554b0800), - TOBN(0xdc703717, 0xa2ce2f2f), TOBN(0x7913b93c, 0x40814194), - TOBN(0x04924593, 0x1fe89636), TOBN(0x7b98443f, 0xf78834a6), - TOBN(0x11c6ab01, 0x5114a5a1), TOBN(0x60deb383, 0xffba5f4c), - TOBN(0x4caa54c6, 0x01a982e6), TOBN(0x1dd35e11, 0x3491cd26), - TOBN(0x973c315f, 0x7cbd6b05), TOBN(0xcab00775, 0x52494724), - TOBN(0x04659b1f, 0x6565e15a), TOBN(0xbf30f529, 0x8c8fb026), - TOBN(0xfc21641b, 0xa8a0de37), TOBN(0xe9c7a366, 0xfa5e5114), - TOBN(0xdb849ca5, 0x52f03ad8), TOBN(0xc7e8dbe9, 0x024e35c0), - TOBN(0xa1a2bbac, 0xcfc3c789), TOBN(0xbf733e7d, 0x9c26f262), - TOBN(0x882ffbf5, 0xb8444823), TOBN(0xb7224e88, 0x6bf8483b), - TOBN(0x53023b8b, 0x65bef640), TOBN(0xaabfec91, 0xd4d5f8cd), - TOBN(0xa40e1510, 0x079ea1bd), TOBN(0x1ad9addc, 0xd05d5d26), - TOBN(0xdb3f2eab, 0x13e68d4f), TOBN(0x1cff1ae2, 0x640f803f), - TOBN(0xe0e7b749, 0xd4cee117), TOBN(0x8e9f275b, 0x4036d909), - TOBN(0xce34e31d, 0x8f4d4c38), TOBN(0x22b37f69, 0xd75130fc), - TOBN(0x83e0f1fd, 0xb4014604), TOBN(0xa8ce9919, 0x89415078), - TOBN(0x82375b75, 0x41792efe), TOBN(0x4f59bf5c, 0x97d4515b), - TOBN(0xac4f324f, 0x923a277d), TOBN(0xd9bc9b7d, 0x650f3406), - TOBN(0xc6fa87d1, 0x8a39bc51), TOBN(0x82588530, 0x5ccc108f), - TOBN(0x5ced3c9f, 0x82e4c634), TOBN(0x8efb8314, 0x3a4464f8), - TOBN(0xe706381b, 0x7a1dca25), TOBN(0x6cd15a3c, 0x5a2a412b), - TOBN(0x9347a8fd, 0xbfcd8fb5), TOBN(0x31db2eef, 0x6e54cd22), - TOBN(0xc4aeb11e, 0xf8d8932f), TOBN(0x11e7c1ed, 0x344411af), - TOBN(0x2653050c, 0xdc9a151e), TOBN(0x9edbfc08, 0x3bb0a859), - TOBN(0x926c81c7, 0xfd5691e7), TOBN(0x9c1b2342, 0x6f39019a), - TOBN(0x64a81c8b, 0x7f8474b9), TOBN(0x90657c07, 0x01761819), - TOBN(0x390b3331, 0x55e0375a), TOBN(0xc676c626, 0xb6ebc47d), - TOBN(0x51623247, 0xb7d6dee8), TOBN(0x0948d927, 0x79659313), - TOBN(0x99700161, 0xe9ab35ed), TOBN(0x06cc32b4, 0x8ddde408), - TOBN(0x6f2fd664, 0x061ef338), TOBN(0x1606fa02, 0xc202e9ed), - TOBN(0x55388bc1, 0x929ba99b), TOBN(0xc4428c5e, 0x1e81df69), - TOBN(0xce2028ae, 0xf91b0b2a), TOBN(0xce870a23, 0xf03dfd3f), - TOBN(0x66ec2c87, 0x0affe8ed), TOBN(0xb205fb46, 0x284d0c00), - TOBN(0xbf5dffe7, 0x44cefa48), TOBN(0xb6fc37a8, 0xa19876d7), - TOBN(0xbecfa84c, 0x08b72863), TOBN(0xd7205ff5, 0x2576374f), - TOBN(0x80330d32, 0x8887de41), TOBN(0x5de0df0c, 0x869ea534), - TOBN(0x13f42753, 0x3c56ea17), TOBN(0xeb1f6069, 0x452b1a78), - TOBN(0x50474396, 0xe30ea15c), TOBN(0x575816a1, 0xc1494125), - TOBN(0xbe1ce55b, 0xfe6bb38f), TOBN(0xb901a948, 0x96ae30f7), - TOBN(0xe5af0f08, 0xd8fc3548), TOBN(0x5010b5d0, 0xd73bfd08), - TOBN(0x993d2880, 0x53fe655a), TOBN(0x99f2630b, 0x1c1309fd), - TOBN(0xd8677baf, 0xb4e3b76f), TOBN(0x14e51ddc, 0xb840784b), - TOBN(0x326c750c, 0xbf0092ce), TOBN(0xc83d306b, 0xf528320f), - TOBN(0xc4456715, 0x77d4715c), TOBN(0xd30019f9, 0x6b703235), - TOBN(0x207ccb2e, 0xd669e986), TOBN(0x57c824af, 0xf6dbfc28), - TOBN(0xf0eb532f, 0xd8f92a23), TOBN(0x4a557fd4, 0x9bb98fd2), - TOBN(0xa57acea7, 0xc1e6199a), TOBN(0x0c663820, 0x8b94b1ed), - TOBN(0x9b42be8f, 0xf83a9266), TOBN(0xc7741c97, 0x0101bd45), - TOBN(0x95770c11, 0x07bd9ceb), TOBN(0x1f50250a, 0x8b2e0744), - TOBN(0xf762eec8, 0x1477b654), TOBN(0xc65b900e, 0x15efe59a), - TOBN(0x88c96148, 0x9546a897), TOBN(0x7e8025b3, 0xc30b4d7c), - TOBN(0xae4065ef, 0x12045cf9), TOBN(0x6fcb2caf, 0x9ccce8bd), - TOBN(0x1fa0ba4e, 0xf2cf6525), TOBN(0xf683125d, 0xcb72c312), - TOBN(0xa01da4ea, 0xe312410e), TOBN(0x67e28677, 0x6cd8e830), - TOBN(0xabd95752, 0x98fb3f07), TOBN(0x05f11e11, 0xeef649a5), - TOBN(0xba47faef, 0x9d3472c2), TOBN(0x3adff697, 0xc77d1345), - TOBN(0x4761fa04, 0xdd15afee), TOBN(0x64f1f61a, 0xb9e69462), - TOBN(0xfa691fab, 0x9bfb9093), TOBN(0x3df8ae8f, 0xa1133dfe), - TOBN(0xcd5f8967, 0x58cc710d), TOBN(0xfbb88d50, 0x16c7fe79), - TOBN(0x8e011b4c, 0xe88c50d1), TOBN(0x7532e807, 0xa8771c4f), - TOBN(0x64c78a48, 0xe2278ee4), TOBN(0x0b283e83, 0x3845072a), - TOBN(0x98a6f291, 0x49e69274), TOBN(0xb96e9668, 0x1868b21c), - TOBN(0x38f0adc2, 0xb1a8908e), TOBN(0x90afcff7, 0x1feb829d), - TOBN(0x9915a383, 0x210b0856), TOBN(0xa5a80602, 0xdef04889), - TOBN(0x800e9af9, 0x7c64d509), TOBN(0x81382d0b, 0xb8996f6f), - TOBN(0x490eba53, 0x81927e27), TOBN(0x46c63b32, 0x4af50182), - TOBN(0x784c5fd9, 0xd3ad62ce), TOBN(0xe4fa1870, 0xf8ae8736), - TOBN(0x4ec9d0bc, 0xd7466b25), TOBN(0x84ddbe1a, 0xdb235c65), - TOBN(0x5e2645ee, 0x163c1688), TOBN(0x570bd00e, 0x00eba747), - TOBN(0xfa51b629, 0x128bfa0f), TOBN(0x92fce1bd, 0x6c1d3b68), - TOBN(0x3e7361dc, 0xb66778b1), TOBN(0x9c7d249d, 0x5561d2bb), - TOBN(0xa40b28bf, 0x0bbc6229), TOBN(0x1c83c05e, 0xdfd91497), - TOBN(0x5f9f5154, 0xf083df05), TOBN(0xbac38b3c, 0xeee66c9d), - TOBN(0xf71db7e3, 0xec0dfcfd), TOBN(0xf2ecda8e, 0x8b0a8416), - TOBN(0x52fddd86, 0x7812aa66), TOBN(0x2896ef10, 0x4e6f4272), - TOBN(0xff27186a, 0x0fe9a745), TOBN(0x08249fcd, 0x49ca70db), - TOBN(0x7425a2e6, 0x441cac49), TOBN(0xf4a0885a, 0xece5ff57), - TOBN(0x6e2cb731, 0x7d7ead58), TOBN(0xf96cf7d6, 0x1898d104), - TOBN(0xafe67c9d, 0x4f2c9a89), TOBN(0x89895a50, 0x1c7bf5bc), - TOBN(0xdc7cb8e5, 0x573cecfa), TOBN(0x66497eae, 0xd15f03e6), - TOBN(0x6bc0de69, 0x3f084420), TOBN(0x323b9b36, 0xacd532b0), - TOBN(0xcfed390a, 0x0115a3c1), TOBN(0x9414c40b, 0x2d65ca0e), - TOBN(0x641406bd, 0x2f530c78), TOBN(0x29369a44, 0x833438f2), - TOBN(0x996884f5, 0x903fa271), TOBN(0xe6da0fd2, 0xb9da921e), - TOBN(0xa6f2f269, 0x5db01e54), TOBN(0x1ee3e9bd, 0x6876214e), - TOBN(0xa26e181c, 0xe27a9497), TOBN(0x36d254e4, 0x8e215e04), - TOBN(0x42f32a6c, 0x252cabca), TOBN(0x99481487, 0x80b57614), - TOBN(0x4c4dfe69, 0x40d9cae1), TOBN(0x05869580, 0x11a10f09), - TOBN(0xca287b57, 0x3491b64b), TOBN(0x77862d5d, 0x3fd4a53b), - TOBN(0xbf94856e, 0x50349126), TOBN(0x2be30bd1, 0x71c5268f), - TOBN(0x10393f19, 0xcbb650a6), TOBN(0x639531fe, 0x778cf9fd), - TOBN(0x02556a11, 0xb2935359), TOBN(0xda38aa96, 0xaf8c126e), - TOBN(0x47dbe6c2, 0x0960167f), TOBN(0x37bbabb6, 0x501901cd), - TOBN(0xb6e979e0, 0x2c947778), TOBN(0xd69a5175, 0x7a1a1dc6), - TOBN(0xc3ed5095, 0x9d9faf0c), TOBN(0x4dd9c096, 0x1d5fa5f0), - TOBN(0xa0c4304d, 0x64f16ea8), TOBN(0x8b1cac16, 0x7e718623), - TOBN(0x0b576546, 0x7c67f03e), TOBN(0x559cf5ad, 0xcbd88c01), - TOBN(0x074877bb, 0x0e2af19a), TOBN(0x1f717ec1, 0xa1228c92), - TOBN(0x70bcb800, 0x326e8920), TOBN(0xec6e2c5c, 0x4f312804), - TOBN(0x426aea7d, 0x3fca4752), TOBN(0xf12c0949, 0x2211f62a), - TOBN(0x24beecd8, 0x7be7b6b5), TOBN(0xb77eaf4c, 0x36d7a27d), - TOBN(0x154c2781, 0xfda78fd3), TOBN(0x848a83b0, 0x264eeabe), - TOBN(0x81287ef0, 0x4ffe2bc4), TOBN(0x7b6d88c6, 0xb6b6fc2a), - TOBN(0x805fb947, 0xce417d99), TOBN(0x4b93dcc3, 0x8b916cc4), - TOBN(0x72e65bb3, 0x21273323), TOBN(0xbcc1badd, 0x6ea9886e), - TOBN(0x0e223011, 0x4bc5ee85), TOBN(0xa561be74, 0xc18ee1e4), - TOBN(0x762fd2d4, 0xa6bcf1f1), TOBN(0x50e6a5a4, 0x95231489), - TOBN(0xca96001f, 0xa00b500b), TOBN(0x5c098cfc, 0x5d7dcdf5), - TOBN(0xa64e2d2e, 0x8c446a85), TOBN(0xbae9bcf1, 0x971f3c62), - TOBN(0x4ec22683, 0x8435a2c5), TOBN(0x8ceaed6c, 0x4bad4643), - TOBN(0xe9f8fb47, 0xccccf4e3), TOBN(0xbd4f3fa4, 0x1ce3b21e), - TOBN(0xd79fb110, 0xa3db3292), TOBN(0xe28a37da, 0xb536c66a), - TOBN(0x279ce87b, 0x8e49e6a9), TOBN(0x70ccfe8d, 0xfdcec8e3), - TOBN(0x2193e4e0, 0x3ba464b2), TOBN(0x0f39d60e, 0xaca9a398), - TOBN(0x7d7932af, 0xf82c12ab), TOBN(0xd8ff50ed, 0x91e7e0f7), - TOBN(0xea961058, 0xfa28a7e0), TOBN(0xc726cf25, 0x0bf5ec74), - TOBN(0xe74d55c8, 0xdb229666), TOBN(0x0bd9abbf, 0xa57f5799), - TOBN(0x7479ef07, 0x4dfc47b3), TOBN(0xd9c65fc3, 0x0c52f91d), - TOBN(0x8e0283fe, 0x36a8bde2), TOBN(0xa32a8b5e, 0x7d4b7280), - TOBN(0x6a677c61, 0x12e83233), TOBN(0x0fbb3512, 0xdcc9bf28), - TOBN(0x562e8ea5, 0x0d780f61), TOBN(0x0db8b22b, 0x1dc4e89c), - TOBN(0x0a6fd1fb, 0x89be0144), TOBN(0x8c77d246, 0xca57113b), - TOBN(0x4639075d, 0xff09c91c), TOBN(0x5b47b17f, 0x5060824c), - TOBN(0x58aea2b0, 0x16287b52), TOBN(0xa1343520, 0xd0cd8eb0), - TOBN(0x6148b4d0, 0xc5d58573), TOBN(0xdd2b6170, 0x291c68ae), - TOBN(0xa61b3929, 0x1da3b3b7), TOBN(0x5f946d79, 0x08c4ac10), - TOBN(0x4105d4a5, 0x7217d583), TOBN(0x5061da3d, 0x25e6de5e), - TOBN(0x3113940d, 0xec1b4991), TOBN(0xf12195e1, 0x36f485ae), - TOBN(0xa7507fb2, 0x731a2ee0), TOBN(0x95057a8e, 0x6e9e196e), - TOBN(0xa3c2c911, 0x2e130136), TOBN(0x97dfbb36, 0x33c60d15), - TOBN(0xcaf3c581, 0xb300ee2b), TOBN(0x77f25d90, 0xf4bac8b8), - TOBN(0xdb1c4f98, 0x6d840cd6), TOBN(0x471d62c0, 0xe634288c), - TOBN(0x8ec2f85e, 0xcec8a161), TOBN(0x41f37cbc, 0xfa6f4ae2), - TOBN(0x6793a20f, 0x4b709985), TOBN(0x7a7bd33b, 0xefa8985b), - TOBN(0x2c6a3fbd, 0x938e6446), TOBN(0x19042619, 0x2a8d47c1), - TOBN(0x16848667, 0xcc36975f), TOBN(0x02acf168, 0x9d5f1dfb), - TOBN(0x62d41ad4, 0x613baa94), TOBN(0xb56fbb92, 0x9f684670), - TOBN(0xce610d0d, 0xe9e40569), TOBN(0x7b99c65f, 0x35489fef), - TOBN(0x0c88ad1b, 0x3df18b97), TOBN(0x81b7d9be, 0x5d0e9edb), - TOBN(0xd85218c0, 0xc716cc0a), TOBN(0xf4b5ff90, 0x85691c49), - TOBN(0xa4fd666b, 0xce356ac6), TOBN(0x17c72895, 0x4b327a7a), - TOBN(0xf93d5085, 0xda6be7de), TOBN(0xff71530e, 0x3301d34e), - TOBN(0x4cd96442, 0xd8f448e8), TOBN(0x9283d331, 0x2ed18ffa), - TOBN(0x4d33dd99, 0x2a849870), TOBN(0xa716964b, 0x41576335), - TOBN(0xff5e3a9b, 0x179be0e5), TOBN(0x5b9d6b1b, 0x83b13632), - TOBN(0x3b8bd7d4, 0xa52f313b), TOBN(0xc9dd95a0, 0x637a4660), - TOBN(0x30035962, 0x0b3e218f), TOBN(0xce1481a3, 0xc7b28a3c), - TOBN(0xab41b43a, 0x43228d83), TOBN(0x24ae1c30, 0x4ad63f99), - TOBN(0x8e525f1a, 0x46a51229), TOBN(0x14af860f, 0xcd26d2b4), - TOBN(0xd6baef61, 0x3f714aa1), TOBN(0xf51865ad, 0xeb78795e), - TOBN(0xd3e21fce, 0xe6a9d694), TOBN(0x82ceb1dd, 0x8a37b527)}}; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.c deleted file mode 100644 index 412843b6d..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.c +++ /dev/null @@ -1,447 +0,0 @@ -/* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2014, Intel Corporation. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - * - * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) - * (1) Intel Corporation, Israel Development Center, Haifa, Israel - * (2) University of Haifa, Israel - * - * Reference: - * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with - * 256 Bit Primes" - */ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "../bn/internal.h" -#include "../delocate.h" -#include "../../internal.h" -#include "internal.h" -#include "p256-x86_64.h" - - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) - -typedef P256_POINT_AFFINE PRECOMP256_ROW[64]; - -// One converted into the Montgomery domain -static const BN_ULONG ONE[P256_LIMBS] = { - TOBN(0x00000000, 0x00000001), TOBN(0xffffffff, 0x00000000), - TOBN(0xffffffff, 0xffffffff), TOBN(0x00000000, 0xfffffffe), -}; - -// Precomputed tables for the default generator -#include "p256-x86_64-table.h" - -// Recode window to a signed digit, see util-64.c for details -static unsigned booth_recode_w5(unsigned in) { - unsigned s, d; - - s = ~((in >> 5) - 1); - d = (1 << 6) - in - 1; - d = (d & s) | (in & ~s); - d = (d >> 1) + (d & 1); - - return (d << 1) + (s & 1); -} - -static unsigned booth_recode_w7(unsigned in) { - unsigned s, d; - - s = ~((in >> 7) - 1); - d = (1 << 8) - in - 1; - d = (d & s) | (in & ~s); - d = (d >> 1) + (d & 1); - - return (d << 1) + (s & 1); -} - -// copy_conditional copies |src| to |dst| if |move| is one and leaves it as-is -// if |move| is zero. -// -// WARNING: this breaks the usual convention of constant-time functions -// returning masks. -static void copy_conditional(BN_ULONG dst[P256_LIMBS], - const BN_ULONG src[P256_LIMBS], BN_ULONG move) { - BN_ULONG mask1 = ((BN_ULONG)0) - move; - BN_ULONG mask2 = ~mask1; - - dst[0] = (src[0] & mask1) ^ (dst[0] & mask2); - dst[1] = (src[1] & mask1) ^ (dst[1] & mask2); - dst[2] = (src[2] & mask1) ^ (dst[2] & mask2); - dst[3] = (src[3] & mask1) ^ (dst[3] & mask2); - if (P256_LIMBS == 8) { - dst[4] = (src[4] & mask1) ^ (dst[4] & mask2); - dst[5] = (src[5] & mask1) ^ (dst[5] & mask2); - dst[6] = (src[6] & mask1) ^ (dst[6] & mask2); - dst[7] = (src[7] & mask1) ^ (dst[7] & mask2); - } -} - -// is_not_zero returns one iff in != 0 and zero otherwise. -// -// WARNING: this breaks the usual convention of constant-time functions -// returning masks. -// -// (define-fun is_not_zero ((in (_ BitVec 64))) (_ BitVec 64) -// (bvlshr (bvor in (bvsub #x0000000000000000 in)) #x000000000000003f) -// ) -// -// (declare-fun x () (_ BitVec 64)) -// -// (assert (and (= x #x0000000000000000) (= (is_not_zero x) #x0000000000000001))) -// (check-sat) -// -// (assert (and (not (= x #x0000000000000000)) (= (is_not_zero x) #x0000000000000000))) -// (check-sat) -// -static BN_ULONG is_not_zero(BN_ULONG in) { - in |= (0 - in); - in >>= BN_BITS2 - 1; - return in; -} - -// ecp_nistz256_mod_inverse_mont sets |r| to (|in| * 2^-256)^-1 * 2^256 mod p. -// That is, |r| is the modular inverse of |in| for input and output in the -// Montgomery domain. -static void ecp_nistz256_mod_inverse_mont(BN_ULONG r[P256_LIMBS], - const BN_ULONG in[P256_LIMBS]) { - /* The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff - ffffffff - We use FLT and used poly-2 as exponent */ - BN_ULONG p2[P256_LIMBS]; - BN_ULONG p4[P256_LIMBS]; - BN_ULONG p8[P256_LIMBS]; - BN_ULONG p16[P256_LIMBS]; - BN_ULONG p32[P256_LIMBS]; - BN_ULONG res[P256_LIMBS]; - int i; - - ecp_nistz256_sqr_mont(res, in); - ecp_nistz256_mul_mont(p2, res, in); // 3*p - - ecp_nistz256_sqr_mont(res, p2); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(p4, res, p2); // f*p - - ecp_nistz256_sqr_mont(res, p4); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(p8, res, p4); // ff*p - - ecp_nistz256_sqr_mont(res, p8); - for (i = 0; i < 7; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(p16, res, p8); // ffff*p - - ecp_nistz256_sqr_mont(res, p16); - for (i = 0; i < 15; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(p32, res, p16); // ffffffff*p - - ecp_nistz256_sqr_mont(res, p32); - for (i = 0; i < 31; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, in); - - for (i = 0; i < 32 * 4; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p32); - - for (i = 0; i < 32; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p32); - - for (i = 0; i < 16; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p16); - - for (i = 0; i < 8; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p8); - - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(res, res, p4); - - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(res, res, p2); - - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(r, res, in); -} - -// ecp_nistz256_bignum_to_field_elem copies the contents of |in| to |out| and -// returns one if it fits. Otherwise it returns zero. -static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS], - const BIGNUM *in) { - return bn_copy_words(out, P256_LIMBS, in); -} - -// r = p * p_scalar -static int ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r, - const EC_POINT *p, - const EC_SCALAR *p_scalar) { - assert(p != NULL); - assert(p_scalar != NULL); - - static const unsigned kWindowSize = 5; - static const unsigned kMask = (1 << (5 /* kWindowSize */ + 1)) - 1; - - // A |P256_POINT| is (3 * 32) = 96 bytes, and the 64-byte alignment should - // add no more than 63 bytes of overhead. Thus, |table| should require - // ~1599 ((96 * 16) + 63) bytes of stack space. - alignas(64) P256_POINT table[16]; - uint8_t p_str[33]; - OPENSSL_memcpy(p_str, p_scalar->bytes, 32); - p_str[32] = 0; - - // table[0] is implicitly (0,0,0) (the point at infinity), therefore it is - // not stored. All other values are actually stored with an offset of -1 in - // table. - P256_POINT *row = table; - - if (!ecp_nistz256_bignum_to_field_elem(row[1 - 1].X, &p->X) || - !ecp_nistz256_bignum_to_field_elem(row[1 - 1].Y, &p->Y) || - !ecp_nistz256_bignum_to_field_elem(row[1 - 1].Z, &p->Z)) { - OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - - ecp_nistz256_point_double(&row[2 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[3 - 1], &row[2 - 1], &row[1 - 1]); - ecp_nistz256_point_double(&row[4 - 1], &row[2 - 1]); - ecp_nistz256_point_double(&row[6 - 1], &row[3 - 1]); - ecp_nistz256_point_double(&row[8 - 1], &row[4 - 1]); - ecp_nistz256_point_double(&row[12 - 1], &row[6 - 1]); - ecp_nistz256_point_add(&row[5 - 1], &row[4 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[7 - 1], &row[6 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[9 - 1], &row[8 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[13 - 1], &row[12 - 1], &row[1 - 1]); - ecp_nistz256_point_double(&row[14 - 1], &row[7 - 1]); - ecp_nistz256_point_double(&row[10 - 1], &row[5 - 1]); - ecp_nistz256_point_add(&row[15 - 1], &row[14 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[11 - 1], &row[10 - 1], &row[1 - 1]); - ecp_nistz256_point_double(&row[16 - 1], &row[8 - 1]); - - BN_ULONG tmp[P256_LIMBS]; - alignas(32) P256_POINT h; - unsigned index = 255; - unsigned wvalue = p_str[(index - 1) / 8]; - wvalue = (wvalue >> ((index - 1) % 8)) & kMask; - - ecp_nistz256_select_w5(r, table, booth_recode_w5(wvalue) >> 1); - - while (index >= 5) { - if (index != 255) { - unsigned off = (index - 1) / 8; - - wvalue = p_str[off] | p_str[off + 1] << 8; - wvalue = (wvalue >> ((index - 1) % 8)) & kMask; - - wvalue = booth_recode_w5(wvalue); - - ecp_nistz256_select_w5(&h, table, wvalue >> 1); - - ecp_nistz256_neg(tmp, h.Y); - copy_conditional(h.Y, tmp, (wvalue & 1)); - - ecp_nistz256_point_add(r, r, &h); - } - - index -= kWindowSize; - - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - } - - // Final window - wvalue = p_str[0]; - wvalue = (wvalue << 1) & kMask; - - wvalue = booth_recode_w5(wvalue); - - ecp_nistz256_select_w5(&h, table, wvalue >> 1); - - ecp_nistz256_neg(tmp, h.Y); - copy_conditional(h.Y, tmp, wvalue & 1); - - ecp_nistz256_point_add(r, r, &h); - - return 1; -} - -static int ecp_nistz256_points_mul(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p_, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { - assert((p_ != NULL) == (p_scalar != NULL)); - - static const unsigned kWindowSize = 7; - static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1; - - alignas(32) union { - P256_POINT p; - P256_POINT_AFFINE a; - } t, p; - - if (g_scalar != NULL) { - uint8_t p_str[33]; - OPENSSL_memcpy(p_str, g_scalar->bytes, 32); - p_str[32] = 0; - - // First window - unsigned wvalue = (p_str[0] << 1) & kMask; - unsigned index = kWindowSize; - - wvalue = booth_recode_w7(wvalue); - - const PRECOMP256_ROW *const precomputed_table = - (const PRECOMP256_ROW *)ecp_nistz256_precomputed; - ecp_nistz256_select_w7(&p.a, precomputed_table[0], wvalue >> 1); - - ecp_nistz256_neg(p.p.Z, p.p.Y); - copy_conditional(p.p.Y, p.p.Z, wvalue & 1); - - // Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p| - // is infinity and |ONE| otherwise. |p| was computed from the table, so it - // is infinity iff |wvalue >> 1| is zero. - OPENSSL_memset(p.p.Z, 0, sizeof(p.p.Z)); - copy_conditional(p.p.Z, ONE, is_not_zero(wvalue >> 1)); - - for (int i = 1; i < 37; i++) { - unsigned off = (index - 1) / 8; - wvalue = p_str[off] | p_str[off + 1] << 8; - wvalue = (wvalue >> ((index - 1) % 8)) & kMask; - index += kWindowSize; - - wvalue = booth_recode_w7(wvalue); - - ecp_nistz256_select_w7(&t.a, precomputed_table[i], wvalue >> 1); - - ecp_nistz256_neg(t.p.Z, t.a.Y); - copy_conditional(t.a.Y, t.p.Z, wvalue & 1); - - ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a); - } - } - - const int p_is_infinity = g_scalar == NULL; - if (p_scalar != NULL) { - P256_POINT *out = &t.p; - if (p_is_infinity) { - out = &p.p; - } - - if (!ecp_nistz256_windowed_mul(group, out, p_, p_scalar)) { - return 0; - } - - if (!p_is_infinity) { - ecp_nistz256_point_add(&p.p, &p.p, out); - } - } - - // Not constant-time, but we're only operating on the public output. - if (!bn_set_words(&r->X, p.p.X, P256_LIMBS) || - !bn_set_words(&r->Y, p.p.Y, P256_LIMBS) || - !bn_set_words(&r->Z, p.p.Z, P256_LIMBS)) { - return 0; - } - - return 1; -} - -static int ecp_nistz256_get_affine(const EC_GROUP *group, const EC_POINT *point, - BIGNUM *x, BIGNUM *y, BN_CTX *ctx) { - BN_ULONG z_inv2[P256_LIMBS]; - BN_ULONG z_inv3[P256_LIMBS]; - BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS]; - - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } - - if (!ecp_nistz256_bignum_to_field_elem(point_x, &point->X) || - !ecp_nistz256_bignum_to_field_elem(point_y, &point->Y) || - !ecp_nistz256_bignum_to_field_elem(point_z, &point->Z)) { - OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - - ecp_nistz256_mod_inverse_mont(z_inv3, point_z); - ecp_nistz256_sqr_mont(z_inv2, z_inv3); - - // Instead of using |ecp_nistz256_from_mont| to convert the |x| coordinate - // and then calling |ecp_nistz256_from_mont| again to convert the |y| - // coordinate below, convert the common factor |z_inv2| once now, saving one - // reduction. - ecp_nistz256_from_mont(z_inv2, z_inv2); - - if (x != NULL) { - BN_ULONG x_aff[P256_LIMBS]; - ecp_nistz256_mul_mont(x_aff, z_inv2, point_x); - if (!bn_set_words(x, x_aff, P256_LIMBS)) { - OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); - return 0; - } - } - - if (y != NULL) { - BN_ULONG y_aff[P256_LIMBS]; - ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2); - ecp_nistz256_mul_mont(y_aff, z_inv3, point_y); - if (!bn_set_words(y, y_aff, P256_LIMBS)) { - OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); - return 0; - } - } - - return 1; -} - -DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistz256_method) { - out->group_init = ec_GFp_mont_group_init; - out->group_finish = ec_GFp_mont_group_finish; - out->group_set_curve = ec_GFp_mont_group_set_curve; - out->point_get_affine_coordinates = ecp_nistz256_get_affine; - out->mul = ecp_nistz256_points_mul; - out->mul_public = ecp_nistz256_points_mul; - out->field_mul = ec_GFp_mont_field_mul; - out->field_sqr = ec_GFp_mont_field_sqr; - out->field_encode = ec_GFp_mont_field_encode; - out->field_decode = ec_GFp_mont_field_decode; -}; - -#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) */ diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back deleted file mode 100644 index dbe99ed43..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back +++ /dev/null @@ -1,447 +0,0 @@ -/* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2014, Intel Corporation. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - * - * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) - * (1) Intel Corporation, Israel Development Center, Haifa, Israel - * (2) University of Haifa, Israel - * - * Reference: - * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with - * 256 Bit Primes" - */ - -#include - -#include -#include -#include - -#include -#include -#include - -#include "../bn/internal.h" -#include "../delocate.h" -#include "../../internal.h" -#include "internal.h" -#include "p256-x86_64.h" - - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) - -typedef P256_POINT_AFFINE PRECOMP256_ROW[64]; - -// One converted into the Montgomery domain -static const BN_ULONG ONE[P256_LIMBS] = { - TOBN(0x00000000, 0x00000001), TOBN(0xffffffff, 0x00000000), - TOBN(0xffffffff, 0xffffffff), TOBN(0x00000000, 0xfffffffe), -}; - -// Precomputed tables for the default generator -#include "p256-x86_64-table.h" - -// Recode window to a signed digit, see util-64.c for details -static unsigned booth_recode_w5(unsigned in) { - unsigned s, d; - - s = ~((in >> 5) - 1); - d = (1 << 6) - in - 1; - d = (d & s) | (in & ~s); - d = (d >> 1) + (d & 1); - - return (d << 1) + (s & 1); -} - -static unsigned booth_recode_w7(unsigned in) { - unsigned s, d; - - s = ~((in >> 7) - 1); - d = (1 << 8) - in - 1; - d = (d & s) | (in & ~s); - d = (d >> 1) + (d & 1); - - return (d << 1) + (s & 1); -} - -// copy_conditional copies |src| to |dst| if |move| is one and leaves it as-is -// if |move| is zero. -// -// WARNING: this breaks the usual convention of constant-time functions -// returning masks. -static void copy_conditional(BN_ULONG dst[P256_LIMBS], - const BN_ULONG src[P256_LIMBS], BN_ULONG move) { - BN_ULONG mask1 = ((BN_ULONG)0) - move; - BN_ULONG mask2 = ~mask1; - - dst[0] = (src[0] & mask1) ^ (dst[0] & mask2); - dst[1] = (src[1] & mask1) ^ (dst[1] & mask2); - dst[2] = (src[2] & mask1) ^ (dst[2] & mask2); - dst[3] = (src[3] & mask1) ^ (dst[3] & mask2); - if (P256_LIMBS == 8) { - dst[4] = (src[4] & mask1) ^ (dst[4] & mask2); - dst[5] = (src[5] & mask1) ^ (dst[5] & mask2); - dst[6] = (src[6] & mask1) ^ (dst[6] & mask2); - dst[7] = (src[7] & mask1) ^ (dst[7] & mask2); - } -} - -// is_not_zero returns one iff in != 0 and zero otherwise. -// -// WARNING: this breaks the usual convention of constant-time functions -// returning masks. -// -// (define-fun is_not_zero ((in (_ BitVec 64))) (_ BitVec 64) -// (bvlshr (bvor in (bvsub #x0000000000000000 in)) #x000000000000003f) -// ) -// -// (declare-fun x () (_ BitVec 64)) -// -// (assert (and (= x #x0000000000000000) (= (is_not_zero x) #x0000000000000001))) -// (check-sat) -// -// (assert (and (not (= x #x0000000000000000)) (= (is_not_zero x) #x0000000000000000))) -// (check-sat) -// -static BN_ULONG is_not_zero(BN_ULONG in) { - in |= (0 - in); - in >>= BN_BITS2 - 1; - return in; -} - -// ecp_nistz256_mod_inverse_mont sets |r| to (|in| * 2^-256)^-1 * 2^256 mod p. -// That is, |r| is the modular inverse of |in| for input and output in the -// Montgomery domain. -static void ecp_nistz256_mod_inverse_mont(BN_ULONG r[P256_LIMBS], - const BN_ULONG in[P256_LIMBS]) { - /* The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff - ffffffff - We use FLT and used poly-2 as exponent */ - BN_ULONG p2[P256_LIMBS]; - BN_ULONG p4[P256_LIMBS]; - BN_ULONG p8[P256_LIMBS]; - BN_ULONG p16[P256_LIMBS]; - BN_ULONG p32[P256_LIMBS]; - BN_ULONG res[P256_LIMBS]; - int i; - - ecp_nistz256_sqr_mont(res, in); - ecp_nistz256_mul_mont(p2, res, in); // 3*p - - ecp_nistz256_sqr_mont(res, p2); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(p4, res, p2); // f*p - - ecp_nistz256_sqr_mont(res, p4); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(p8, res, p4); // ff*p - - ecp_nistz256_sqr_mont(res, p8); - for (i = 0; i < 7; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(p16, res, p8); // ffff*p - - ecp_nistz256_sqr_mont(res, p16); - for (i = 0; i < 15; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(p32, res, p16); // ffffffff*p - - ecp_nistz256_sqr_mont(res, p32); - for (i = 0; i < 31; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, in); - - for (i = 0; i < 32 * 4; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p32); - - for (i = 0; i < 32; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p32); - - for (i = 0; i < 16; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p16); - - for (i = 0; i < 8; i++) { - ecp_nistz256_sqr_mont(res, res); - } - ecp_nistz256_mul_mont(res, res, p8); - - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(res, res, p4); - - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(res, res, p2); - - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_sqr_mont(res, res); - ecp_nistz256_mul_mont(r, res, in); -} - -// ecp_nistz256_bignum_to_field_elem copies the contents of |in| to |out| and -// returns one if it fits. Otherwise it returns zero. -static int ecp_nistz256_bignum_to_field_elem(BN_ULONG out[P256_LIMBS], - const BIGNUM *in) { - return bn_copy_words(out, P256_LIMBS, in); -} - -// r = p * p_scalar -static int ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r, - const EC_POINT *p, - const EC_SCALAR *p_scalar) { - assert(p != NULL); - assert(p_scalar != NULL); - - static const unsigned kWindowSize = 5; - static const unsigned kMask = (1 << (5 /* kWindowSize */ + 1)) - 1; - - // A |P256_POINT| is (3 * 32) = 96 bytes, and the 64-byte alignment should - // add no more than 63 bytes of overhead. Thus, |table| should require - // ~1599 ((96 * 16) + 63) bytes of stack space. - alignas(64) P256_POINT table[16]; - uint8_t p_str[33]; - OPENSSL_memcpy(p_str, p_scalar->bytes, 32); - p_str[32] = 0; - - // table[0] is implicitly (0,0,0) (the point at infinity), therefore it is - // not stored. All other values are actually stored with an offset of -1 in - // table. - P256_POINT *row = table; - - if (!ecp_nistz256_bignum_to_field_elem(row[1 - 1].X, &p->X) || - !ecp_nistz256_bignum_to_field_elem(row[1 - 1].Y, &p->Y) || - !ecp_nistz256_bignum_to_field_elem(row[1 - 1].Z, &p->Z)) { - OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - - ecp_nistz256_point_double(&row[2 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[3 - 1], &row[2 - 1], &row[1 - 1]); - ecp_nistz256_point_double(&row[4 - 1], &row[2 - 1]); - ecp_nistz256_point_double(&row[6 - 1], &row[3 - 1]); - ecp_nistz256_point_double(&row[8 - 1], &row[4 - 1]); - ecp_nistz256_point_double(&row[12 - 1], &row[6 - 1]); - ecp_nistz256_point_add(&row[5 - 1], &row[4 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[7 - 1], &row[6 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[9 - 1], &row[8 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[13 - 1], &row[12 - 1], &row[1 - 1]); - ecp_nistz256_point_double(&row[14 - 1], &row[7 - 1]); - ecp_nistz256_point_double(&row[10 - 1], &row[5 - 1]); - ecp_nistz256_point_add(&row[15 - 1], &row[14 - 1], &row[1 - 1]); - ecp_nistz256_point_add(&row[11 - 1], &row[10 - 1], &row[1 - 1]); - ecp_nistz256_point_double(&row[16 - 1], &row[8 - 1]); - - BN_ULONG tmp[P256_LIMBS]; - alignas(32) P256_POINT h; - unsigned index = 255; - unsigned wvalue = p_str[(index - 1) / 8]; - wvalue = (wvalue >> ((index - 1) % 8)) & kMask; - - ecp_nistz256_select_w5(r, table, booth_recode_w5(wvalue) >> 1); - - while (index >= 5) { - if (index != 255) { - unsigned off = (index - 1) / 8; - - wvalue = p_str[off] | p_str[off + 1] << 8; - wvalue = (wvalue >> ((index - 1) % 8)) & kMask; - - wvalue = booth_recode_w5(wvalue); - - ecp_nistz256_select_w5(&h, table, wvalue >> 1); - - ecp_nistz256_neg(tmp, h.Y); - copy_conditional(h.Y, tmp, (wvalue & 1)); - - ecp_nistz256_point_add(r, r, &h); - } - - index -= kWindowSize; - - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - ecp_nistz256_point_double(r, r); - } - - // Final window - wvalue = p_str[0]; - wvalue = (wvalue << 1) & kMask; - - wvalue = booth_recode_w5(wvalue); - - ecp_nistz256_select_w5(&h, table, wvalue >> 1); - - ecp_nistz256_neg(tmp, h.Y); - copy_conditional(h.Y, tmp, wvalue & 1); - - ecp_nistz256_point_add(r, r, &h); - - return 1; -} - -static int ecp_nistz256_points_mul(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p_, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { - assert((p_ != NULL) == (p_scalar != NULL)); - - static const unsigned kWindowSize = 7; - static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1; - - alignas(32) union { - P256_POINT p; - P256_POINT_AFFINE a; - } t, p; - - if (g_scalar != NULL) { - uint8_t p_str[33]; - OPENSSL_memcpy(p_str, g_scalar->bytes, 32); - p_str[32] = 0; - - // First window - unsigned wvalue = (p_str[0] << 1) & kMask; - unsigned index = kWindowSize; - - wvalue = booth_recode_w7(wvalue); - - const PRECOMP256_ROW *const precomputed_table = - (const PRECOMP256_ROW *)ecp_nistz256_precomputed; - ecp_nistz256_select_w7(&p.a, precomputed_table[0], wvalue >> 1); - - ecp_nistz256_neg(p.p.Z, p.p.Y); - copy_conditional(p.p.Y, p.p.Z, wvalue & 1); - - // Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p| - // is infinity and |ONE| otherwise. |p| was computed from the table, so it - // is infinity iff |wvalue >> 1| is zero. - OPENSSL_memset(p.p.Z, 0, sizeof(p.p.Z)); - copy_conditional(p.p.Z, ONE, is_not_zero(wvalue >> 1)); - - for (int i = 1; i < 37; i++) { - unsigned off = (index - 1) / 8; - wvalue = p_str[off] | p_str[off + 1] << 8; - wvalue = (wvalue >> ((index - 1) % 8)) & kMask; - index += kWindowSize; - - wvalue = booth_recode_w7(wvalue); - - ecp_nistz256_select_w7(&t.a, precomputed_table[i], wvalue >> 1); - - ecp_nistz256_neg(t.p.Z, t.a.Y); - copy_conditional(t.a.Y, t.p.Z, wvalue & 1); - - ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a); - } - } - - const int p_is_infinity = g_scalar == NULL; - if (p_scalar != NULL) { - P256_POINT *out = &t.p; - if (p_is_infinity) { - out = &p.p; - } - - if (!ecp_nistz256_windowed_mul(group, out, p_, p_scalar)) { - return 0; - } - - if (!p_is_infinity) { - ecp_nistz256_point_add(&p.p, &p.p, out); - } - } - - // Not constant-time, but we're only operating on the public output. - if (!bn_set_words(&r->X, p.p.X, P256_LIMBS) || - !bn_set_words(&r->Y, p.p.Y, P256_LIMBS) || - !bn_set_words(&r->Z, p.p.Z, P256_LIMBS)) { - return 0; - } - - return 1; -} - -static int ecp_nistz256_get_affine(const EC_GROUP *group, const EC_POINT *point, - BIGNUM *x, BIGNUM *y, BN_CTX *ctx) { - BN_ULONG z_inv2[P256_LIMBS]; - BN_ULONG z_inv3[P256_LIMBS]; - BN_ULONG point_x[P256_LIMBS], point_y[P256_LIMBS], point_z[P256_LIMBS]; - - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } - - if (!ecp_nistz256_bignum_to_field_elem(point_x, &point->X) || - !ecp_nistz256_bignum_to_field_elem(point_y, &point->Y) || - !ecp_nistz256_bignum_to_field_elem(point_z, &point->Z)) { - OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - - ecp_nistz256_mod_inverse_mont(z_inv3, point_z); - ecp_nistz256_sqr_mont(z_inv2, z_inv3); - - // Instead of using |ecp_nistz256_from_mont| to convert the |x| coordinate - // and then calling |ecp_nistz256_from_mont| again to convert the |y| - // coordinate below, convert the common factor |z_inv2| once now, saving one - // reduction. - ecp_nistz256_from_mont(z_inv2, z_inv2); - - if (x != NULL) { - BN_ULONG x_aff[P256_LIMBS]; - ecp_nistz256_mul_mont(x_aff, z_inv2, point_x); - if (!bn_set_words(x, x_aff, P256_LIMBS)) { - OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); - return 0; - } - } - - if (y != NULL) { - BN_ULONG y_aff[P256_LIMBS]; - ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2); - ecp_nistz256_mul_mont(y_aff, z_inv3, point_y); - if (!bn_set_words(y, y_aff, P256_LIMBS)) { - OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); - return 0; - } - } - - return 1; -} - -DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistz256_method) { - out->group_init = ec_GFp_mont_group_init; - out->group_finish = ec_GFp_mont_group_finish; - out->group_set_curve = ec_GFp_mont_group_set_curve; - out->point_get_affine_coordinates = ecp_nistz256_get_affine; - out->mul = ecp_nistz256_points_mul; - out->mul_public = ecp_nistz256_points_mul; - out->field_mul = ec_GFp_mont_field_mul; - out->field_sqr = ec_GFp_mont_field_sqr; - out->field_encode = ec_GFp_mont_field_encode; - out->field_decode = ec_GFp_mont_field_decode; -}; - -#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) */ diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.h deleted file mode 100644 index 4d4526a8b..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2014, Intel Corporation. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - * - * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) - * (1) Intel Corporation, Israel Development Center, Haifa, Israel - * (2) University of Haifa, Israel - * - * Reference: - * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with - * 256 Bit Primes" - */ - -#ifndef OPENSSL_HEADER_EC_P256_X86_64_H -#define OPENSSL_HEADER_EC_P256_X86_64_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) - -// P-256 field operations. -// -// An element mod P in P-256 is represented as a little-endian array of -// |P256_LIMBS| |BN_ULONG|s, spanning the full range of values. -// -// The following functions take fully-reduced inputs mod P and give -// fully-reduced outputs. They may be used in-place. - -#define P256_LIMBS (256 / BN_BITS2) - -// ecp_nistz256_neg sets |res| to -|a| mod P. -void ecp_nistz256_neg(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]); - -// ecp_nistz256_mul_mont sets |res| to |a| * |b| * 2^-256 mod P. -void ecp_nistz256_mul_mont(BN_ULONG res[P256_LIMBS], - const BN_ULONG a[P256_LIMBS], - const BN_ULONG b[P256_LIMBS]); - -// ecp_nistz256_sqr_mont sets |res| to |a| * |a| * 2^-256 mod P. -void ecp_nistz256_sqr_mont(BN_ULONG res[P256_LIMBS], - const BN_ULONG a[P256_LIMBS]); - -// ecp_nistz256_from_mont sets |res| to |in|, converted from Montgomery domain -// by multiplying with 1. -static inline void ecp_nistz256_from_mont(BN_ULONG res[P256_LIMBS], - const BN_ULONG in[P256_LIMBS]) { - static const BN_ULONG ONE[P256_LIMBS] = { 1 }; - ecp_nistz256_mul_mont(res, in, ONE); -} - - -// P-256 point operations. -// -// The following functions may be used in-place. All coordinates are in the -// Montgomery domain. - -// A P256_POINT represents a P-256 point in Jacobian coordinates. -typedef struct { - BN_ULONG X[P256_LIMBS]; - BN_ULONG Y[P256_LIMBS]; - BN_ULONG Z[P256_LIMBS]; -} P256_POINT; - -// A P256_POINT_AFFINE represents a P-256 point in affine coordinates. Infinity -// is encoded as (0, 0). -typedef struct { - BN_ULONG X[P256_LIMBS]; - BN_ULONG Y[P256_LIMBS]; -} P256_POINT_AFFINE; - -// ecp_nistz256_select_w5 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 16 -// and all zeros (the point at infinity) if |index| is 0. This is done in -// constant time. -void ecp_nistz256_select_w5(P256_POINT *val, const P256_POINT in_t[16], - int index); - -// ecp_nistz256_select_w7 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 64 -// and all zeros (the point at infinity) if |index| is 0. This is done in -// constant time. -void ecp_nistz256_select_w7(P256_POINT_AFFINE *val, - const P256_POINT_AFFINE in_t[64], int index); - -// ecp_nistz256_point_double sets |r| to |a| doubled. -void ecp_nistz256_point_double(P256_POINT *r, const P256_POINT *a); - -// ecp_nistz256_point_add adds |a| to |b| and places the result in |r|. -void ecp_nistz256_point_add(P256_POINT *r, const P256_POINT *a, - const P256_POINT *b); - -// ecp_nistz256_point_add_affine adds |a| to |b| and places the result in -// |r|. |a| and |b| must not represent the same point unless they are both -// infinity. -void ecp_nistz256_point_add_affine(P256_POINT *r, const P256_POINT *a, - const P256_POINT_AFFINE *b); - -#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) */ - - -#if defined(__cplusplus) -} // extern C++ -#endif - -#endif // OPENSSL_HEADER_EC_P256_X86_64_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back deleted file mode 100644 index 9226124b9..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. - * Copyright (c) 2014, Intel Corporation. All Rights Reserved. - * - * Licensed under the OpenSSL license (the "License"). You may not use - * this file except in compliance with the License. You can obtain a copy - * in the file LICENSE in the source distribution or at - * https://www.openssl.org/source/license.html - * - * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) - * (1) Intel Corporation, Israel Development Center, Haifa, Israel - * (2) University of Haifa, Israel - * - * Reference: - * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with - * 256 Bit Primes" - */ - -#ifndef OPENSSL_HEADER_EC_P256_X86_64_H -#define OPENSSL_HEADER_EC_P256_X86_64_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) - -// P-256 field operations. -// -// An element mod P in P-256 is represented as a little-endian array of -// |P256_LIMBS| |BN_ULONG|s, spanning the full range of values. -// -// The following functions take fully-reduced inputs mod P and give -// fully-reduced outputs. They may be used in-place. - -#define P256_LIMBS (256 / BN_BITS2) - -// ecp_nistz256_neg sets |res| to -|a| mod P. -void ecp_nistz256_neg(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]); - -// ecp_nistz256_mul_mont sets |res| to |a| * |b| * 2^-256 mod P. -void ecp_nistz256_mul_mont(BN_ULONG res[P256_LIMBS], - const BN_ULONG a[P256_LIMBS], - const BN_ULONG b[P256_LIMBS]); - -// ecp_nistz256_sqr_mont sets |res| to |a| * |a| * 2^-256 mod P. -void ecp_nistz256_sqr_mont(BN_ULONG res[P256_LIMBS], - const BN_ULONG a[P256_LIMBS]); - -// ecp_nistz256_from_mont sets |res| to |in|, converted from Montgomery domain -// by multiplying with 1. -static inline void ecp_nistz256_from_mont(BN_ULONG res[P256_LIMBS], - const BN_ULONG in[P256_LIMBS]) { - static const BN_ULONG ONE[P256_LIMBS] = { 1 }; - ecp_nistz256_mul_mont(res, in, ONE); -} - - -// P-256 point operations. -// -// The following functions may be used in-place. All coordinates are in the -// Montgomery domain. - -// A P256_POINT represents a P-256 point in Jacobian coordinates. -typedef struct { - BN_ULONG X[P256_LIMBS]; - BN_ULONG Y[P256_LIMBS]; - BN_ULONG Z[P256_LIMBS]; -} P256_POINT; - -// A P256_POINT_AFFINE represents a P-256 point in affine coordinates. Infinity -// is encoded as (0, 0). -typedef struct { - BN_ULONG X[P256_LIMBS]; - BN_ULONG Y[P256_LIMBS]; -} P256_POINT_AFFINE; - -// ecp_nistz256_select_w5 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 16 -// and all zeros (the point at infinity) if |index| is 0. This is done in -// constant time. -void ecp_nistz256_select_w5(P256_POINT *val, const P256_POINT in_t[16], - int index); - -// ecp_nistz256_select_w7 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 64 -// and all zeros (the point at infinity) if |index| is 0. This is done in -// constant time. -void ecp_nistz256_select_w7(P256_POINT_AFFINE *val, - const P256_POINT_AFFINE in_t[64], int index); - -// ecp_nistz256_point_double sets |r| to |a| doubled. -void ecp_nistz256_point_double(P256_POINT *r, const P256_POINT *a); - -// ecp_nistz256_point_add adds |a| to |b| and places the result in |r|. -void ecp_nistz256_point_add(P256_POINT *r, const P256_POINT *a, - const P256_POINT *b); - -// ecp_nistz256_point_add_affine adds |a| to |b| and places the result in -// |r|. |a| and |b| must not represent the same point unless they are both -// infinity. -void ecp_nistz256_point_add_affine(P256_POINT *r, const P256_POINT *a, - const P256_POINT_AFFINE *b); - -#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - !defined(OPENSSL_SMALL) */ - - -#if defined(__cplusplus) -} // extern C++ -#endif - -#endif // OPENSSL_HEADER_EC_P256_X86_64_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/simple.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/simple.c deleted file mode 100644 index b00451f0a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/simple.c +++ /dev/null @@ -1,1046 +0,0 @@ -/* Originally written by Bodo Moeller for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#include - -#include - -#include -#include -#include - -#include "internal.h" -#include "../../internal.h" - - -// Most method functions in this file are designed to work with non-trivial -// representations of field elements if necessary (see ecp_mont.c): while -// standard modular addition and subtraction are used, the field_mul and -// field_sqr methods will be used for multiplication, and field_encode and -// field_decode (if defined) will be used for converting between -// representations. -// -// Functions here specifically assume that if a non-trivial representation is -// used, it is a Montgomery representation (i.e. 'encoding' means multiplying -// by some factor R). - -int ec_GFp_simple_group_init(EC_GROUP *group) { - BN_init(&group->field); - BN_init(&group->a); - BN_init(&group->b); - BN_init(&group->one); - group->a_is_minus3 = 0; - return 1; -} - -void ec_GFp_simple_group_finish(EC_GROUP *group) { - BN_free(&group->field); - BN_free(&group->a); - BN_free(&group->b); - BN_free(&group->one); -} - -int ec_GFp_simple_group_set_curve(EC_GROUP *group, const BIGNUM *p, - const BIGNUM *a, const BIGNUM *b, - BN_CTX *ctx) { - int ret = 0; - BN_CTX *new_ctx = NULL; - BIGNUM *tmp_a; - - // p must be a prime > 3 - if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); - return 0; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - tmp_a = BN_CTX_get(ctx); - if (tmp_a == NULL) { - goto err; - } - - // group->field - if (!BN_copy(&group->field, p)) { - goto err; - } - BN_set_negative(&group->field, 0); - // Store the field in minimal form, so it can be used with |BN_ULONG| arrays. - bn_set_minimal_width(&group->field); - - // group->a - if (!BN_nnmod(tmp_a, a, &group->field, ctx)) { - goto err; - } - if (group->meth->field_encode) { - if (!group->meth->field_encode(group, &group->a, tmp_a, ctx)) { - goto err; - } - } else if (!BN_copy(&group->a, tmp_a)) { - goto err; - } - - // group->b - if (!BN_nnmod(&group->b, b, &group->field, ctx)) { - goto err; - } - if (group->meth->field_encode && - !group->meth->field_encode(group, &group->b, &group->b, ctx)) { - goto err; - } - - // group->a_is_minus3 - if (!BN_add_word(tmp_a, 3)) { - goto err; - } - group->a_is_minus3 = (0 == BN_cmp(tmp_a, &group->field)); - - if (group->meth->field_encode != NULL) { - if (!group->meth->field_encode(group, &group->one, BN_value_one(), ctx)) { - goto err; - } - } else if (!BN_copy(&group->one, BN_value_one())) { - goto err; - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, - BIGNUM *b, BN_CTX *ctx) { - int ret = 0; - BN_CTX *new_ctx = NULL; - - if (p != NULL && !BN_copy(p, &group->field)) { - return 0; - } - - if (a != NULL || b != NULL) { - if (group->meth->field_decode) { - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - if (a != NULL && !group->meth->field_decode(group, a, &group->a, ctx)) { - goto err; - } - if (b != NULL && !group->meth->field_decode(group, b, &group->b, ctx)) { - goto err; - } - } else { - if (a != NULL && !BN_copy(a, &group->a)) { - goto err; - } - if (b != NULL && !BN_copy(b, &group->b)) { - goto err; - } - } - } - - ret = 1; - -err: - BN_CTX_free(new_ctx); - return ret; -} - -unsigned ec_GFp_simple_group_get_degree(const EC_GROUP *group) { - return BN_num_bits(&group->field); -} - -int ec_GFp_simple_point_init(EC_POINT *point) { - BN_init(&point->X); - BN_init(&point->Y); - BN_init(&point->Z); - - return 1; -} - -void ec_GFp_simple_point_finish(EC_POINT *point) { - BN_free(&point->X); - BN_free(&point->Y); - BN_free(&point->Z); -} - -int ec_GFp_simple_point_copy(EC_POINT *dest, const EC_POINT *src) { - if (!BN_copy(&dest->X, &src->X) || - !BN_copy(&dest->Y, &src->Y) || - !BN_copy(&dest->Z, &src->Z)) { - return 0; - } - - return 1; -} - -int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *group, - EC_POINT *point) { - BN_zero(&point->Z); - return 1; -} - -static int set_Jprojective_coordinate_GFp(const EC_GROUP *group, BIGNUM *out, - const BIGNUM *in, BN_CTX *ctx) { - if (in == NULL) { - return 1; - } - if (BN_is_negative(in) || - BN_cmp(in, &group->field) >= 0) { - OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - if (group->meth->field_encode) { - return group->meth->field_encode(group, out, in, ctx); - } - return BN_copy(out, in) != NULL; -} - -int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, - EC_POINT *point, const BIGNUM *x, - const BIGNUM *y, BN_CTX *ctx) { - if (x == NULL || y == NULL) { - OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - BN_CTX *new_ctx = NULL; - int ret = 0; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - if (!set_Jprojective_coordinate_GFp(group, &point->X, x, ctx) || - !set_Jprojective_coordinate_GFp(group, &point->Y, y, ctx) || - !BN_copy(&point->Z, &group->one)) { - goto err; - } - - ret = 1; - -err: - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, - const EC_POINT *b, BN_CTX *ctx) { - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - const BIGNUM *p; - BN_CTX *new_ctx = NULL; - BIGNUM *n0, *n1, *n2, *n3, *n4, *n5, *n6; - int ret = 0; - - if (a == b) { - return EC_POINT_dbl(group, r, a, ctx); - } - if (EC_POINT_is_at_infinity(group, a)) { - return EC_POINT_copy(r, b); - } - if (EC_POINT_is_at_infinity(group, b)) { - return EC_POINT_copy(r, a); - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - p = &group->field; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - n0 = BN_CTX_get(ctx); - n1 = BN_CTX_get(ctx); - n2 = BN_CTX_get(ctx); - n3 = BN_CTX_get(ctx); - n4 = BN_CTX_get(ctx); - n5 = BN_CTX_get(ctx); - n6 = BN_CTX_get(ctx); - if (n6 == NULL) { - goto end; - } - - // Note that in this function we must not read components of 'a' or 'b' - // once we have written the corresponding components of 'r'. - // ('r' might be one of 'a' or 'b'.) - - // n1, n2 - int b_Z_is_one = BN_cmp(&b->Z, &group->one) == 0; - - if (b_Z_is_one) { - if (!BN_copy(n1, &a->X) || !BN_copy(n2, &a->Y)) { - goto end; - } - // n1 = X_a - // n2 = Y_a - } else { - if (!field_sqr(group, n0, &b->Z, ctx) || - !field_mul(group, n1, &a->X, n0, ctx)) { - goto end; - } - // n1 = X_a * Z_b^2 - - if (!field_mul(group, n0, n0, &b->Z, ctx) || - !field_mul(group, n2, &a->Y, n0, ctx)) { - goto end; - } - // n2 = Y_a * Z_b^3 - } - - // n3, n4 - int a_Z_is_one = BN_cmp(&a->Z, &group->one) == 0; - if (a_Z_is_one) { - if (!BN_copy(n3, &b->X) || !BN_copy(n4, &b->Y)) { - goto end; - } - // n3 = X_b - // n4 = Y_b - } else { - if (!field_sqr(group, n0, &a->Z, ctx) || - !field_mul(group, n3, &b->X, n0, ctx)) { - goto end; - } - // n3 = X_b * Z_a^2 - - if (!field_mul(group, n0, n0, &a->Z, ctx) || - !field_mul(group, n4, &b->Y, n0, ctx)) { - goto end; - } - // n4 = Y_b * Z_a^3 - } - - // n5, n6 - if (!bn_mod_sub_consttime(n5, n1, n3, p, ctx) || - !bn_mod_sub_consttime(n6, n2, n4, p, ctx)) { - goto end; - } - // n5 = n1 - n3 - // n6 = n2 - n4 - - if (BN_is_zero(n5)) { - if (BN_is_zero(n6)) { - // a is the same point as b - BN_CTX_end(ctx); - ret = EC_POINT_dbl(group, r, a, ctx); - ctx = NULL; - goto end; - } else { - // a is the inverse of b - BN_zero(&r->Z); - ret = 1; - goto end; - } - } - - // 'n7', 'n8' - if (!bn_mod_add_consttime(n1, n1, n3, p, ctx) || - !bn_mod_add_consttime(n2, n2, n4, p, ctx)) { - goto end; - } - // 'n7' = n1 + n3 - // 'n8' = n2 + n4 - - // Z_r - if (a_Z_is_one && b_Z_is_one) { - if (!BN_copy(&r->Z, n5)) { - goto end; - } - } else { - if (a_Z_is_one) { - if (!BN_copy(n0, &b->Z)) { - goto end; - } - } else if (b_Z_is_one) { - if (!BN_copy(n0, &a->Z)) { - goto end; - } - } else if (!field_mul(group, n0, &a->Z, &b->Z, ctx)) { - goto end; - } - if (!field_mul(group, &r->Z, n0, n5, ctx)) { - goto end; - } - } - - // Z_r = Z_a * Z_b * n5 - - // X_r - if (!field_sqr(group, n0, n6, ctx) || - !field_sqr(group, n4, n5, ctx) || - !field_mul(group, n3, n1, n4, ctx) || - !bn_mod_sub_consttime(&r->X, n0, n3, p, ctx)) { - goto end; - } - // X_r = n6^2 - n5^2 * 'n7' - - // 'n9' - if (!bn_mod_lshift1_consttime(n0, &r->X, p, ctx) || - !bn_mod_sub_consttime(n0, n3, n0, p, ctx)) { - goto end; - } - // n9 = n5^2 * 'n7' - 2 * X_r - - // Y_r - if (!field_mul(group, n0, n0, n6, ctx) || - !field_mul(group, n5, n4, n5, ctx)) { - goto end; // now n5 is n5^3 - } - if (!field_mul(group, n1, n2, n5, ctx) || - !bn_mod_sub_consttime(n0, n0, n1, p, ctx)) { - goto end; - } - if (BN_is_odd(n0) && !BN_add(n0, n0, p)) { - goto end; - } - // now 0 <= n0 < 2*p, and n0 is even - if (!BN_rshift1(&r->Y, n0)) { - goto end; - } - // Y_r = (n6 * 'n9' - 'n8' * 'n5^3') / 2 - - ret = 1; - -end: - if (ctx) { - // otherwise we already called BN_CTX_end - BN_CTX_end(ctx); - } - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, - BN_CTX *ctx) { - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - const BIGNUM *p; - BN_CTX *new_ctx = NULL; - BIGNUM *n0, *n1, *n2, *n3; - int ret = 0; - - if (EC_POINT_is_at_infinity(group, a)) { - BN_zero(&r->Z); - return 1; - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - p = &group->field; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - n0 = BN_CTX_get(ctx); - n1 = BN_CTX_get(ctx); - n2 = BN_CTX_get(ctx); - n3 = BN_CTX_get(ctx); - if (n3 == NULL) { - goto err; - } - - // Note that in this function we must not read components of 'a' - // once we have written the corresponding components of 'r'. - // ('r' might the same as 'a'.) - - // n1 - if (BN_cmp(&a->Z, &group->one) == 0) { - if (!field_sqr(group, n0, &a->X, ctx) || - !bn_mod_lshift1_consttime(n1, n0, p, ctx) || - !bn_mod_add_consttime(n0, n0, n1, p, ctx) || - !bn_mod_add_consttime(n1, n0, &group->a, p, ctx)) { - goto err; - } - // n1 = 3 * X_a^2 + a_curve - } else if (group->a_is_minus3) { - if (!field_sqr(group, n1, &a->Z, ctx) || - !bn_mod_add_consttime(n0, &a->X, n1, p, ctx) || - !bn_mod_sub_consttime(n2, &a->X, n1, p, ctx) || - !field_mul(group, n1, n0, n2, ctx) || - !bn_mod_lshift1_consttime(n0, n1, p, ctx) || - !bn_mod_add_consttime(n1, n0, n1, p, ctx)) { - goto err; - } - // n1 = 3 * (X_a + Z_a^2) * (X_a - Z_a^2) - // = 3 * X_a^2 - 3 * Z_a^4 - } else { - if (!field_sqr(group, n0, &a->X, ctx) || - !bn_mod_lshift1_consttime(n1, n0, p, ctx) || - !bn_mod_add_consttime(n0, n0, n1, p, ctx) || - !field_sqr(group, n1, &a->Z, ctx) || - !field_sqr(group, n1, n1, ctx) || - !field_mul(group, n1, n1, &group->a, ctx) || - !bn_mod_add_consttime(n1, n1, n0, p, ctx)) { - goto err; - } - // n1 = 3 * X_a^2 + a_curve * Z_a^4 - } - - // Z_r - if (BN_cmp(&a->Z, &group->one) == 0) { - if (!BN_copy(n0, &a->Y)) { - goto err; - } - } else if (!field_mul(group, n0, &a->Y, &a->Z, ctx)) { - goto err; - } - if (!bn_mod_lshift1_consttime(&r->Z, n0, p, ctx)) { - goto err; - } - // Z_r = 2 * Y_a * Z_a - - // n2 - if (!field_sqr(group, n3, &a->Y, ctx) || - !field_mul(group, n2, &a->X, n3, ctx) || - !bn_mod_lshift_consttime(n2, n2, 2, p, ctx)) { - goto err; - } - // n2 = 4 * X_a * Y_a^2 - - // X_r - if (!bn_mod_lshift1_consttime(n0, n2, p, ctx) || - !field_sqr(group, &r->X, n1, ctx) || - !bn_mod_sub_consttime(&r->X, &r->X, n0, p, ctx)) { - goto err; - } - // X_r = n1^2 - 2 * n2 - - // n3 - if (!field_sqr(group, n0, n3, ctx) || - !bn_mod_lshift_consttime(n3, n0, 3, p, ctx)) { - goto err; - } - // n3 = 8 * Y_a^4 - - // Y_r - if (!bn_mod_sub_consttime(n0, n2, &r->X, p, ctx) || - !field_mul(group, n0, n1, n0, ctx) || - !bn_mod_sub_consttime(&r->Y, n0, n3, p, ctx)) { - goto err; - } - // Y_r = n1 * (n2 - X_r) - n3 - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { - if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(&point->Y)) { - // point is its own inverse - return 1; - } - - return BN_usub(&point->Y, &group->field, &point->Y); -} - -int ec_GFp_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { - return BN_is_zero(&point->Z); -} - -int ec_GFp_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, - BN_CTX *ctx) { - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - const BIGNUM *p; - BN_CTX *new_ctx = NULL; - BIGNUM *rh, *tmp, *Z4, *Z6; - int ret = 0; - - if (EC_POINT_is_at_infinity(group, point)) { - return 1; - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - p = &group->field; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - rh = BN_CTX_get(ctx); - tmp = BN_CTX_get(ctx); - Z4 = BN_CTX_get(ctx); - Z6 = BN_CTX_get(ctx); - if (Z6 == NULL) { - goto err; - } - - // We have a curve defined by a Weierstrass equation - // y^2 = x^3 + a*x + b. - // The point to consider is given in Jacobian projective coordinates - // where (X, Y, Z) represents (x, y) = (X/Z^2, Y/Z^3). - // Substituting this and multiplying by Z^6 transforms the above equation - // into - // Y^2 = X^3 + a*X*Z^4 + b*Z^6. - // To test this, we add up the right-hand side in 'rh'. - - // rh := X^2 - if (!field_sqr(group, rh, &point->X, ctx)) { - goto err; - } - - if (BN_cmp(&point->Z, &group->one) != 0) { - if (!field_sqr(group, tmp, &point->Z, ctx) || - !field_sqr(group, Z4, tmp, ctx) || - !field_mul(group, Z6, Z4, tmp, ctx)) { - goto err; - } - - // rh := (rh + a*Z^4)*X - if (group->a_is_minus3) { - if (!bn_mod_lshift1_consttime(tmp, Z4, p, ctx) || - !bn_mod_add_consttime(tmp, tmp, Z4, p, ctx) || - !bn_mod_sub_consttime(rh, rh, tmp, p, ctx) || - !field_mul(group, rh, rh, &point->X, ctx)) { - goto err; - } - } else { - if (!field_mul(group, tmp, Z4, &group->a, ctx) || - !bn_mod_add_consttime(rh, rh, tmp, p, ctx) || - !field_mul(group, rh, rh, &point->X, ctx)) { - goto err; - } - } - - // rh := rh + b*Z^6 - if (!field_mul(group, tmp, &group->b, Z6, ctx) || - !bn_mod_add_consttime(rh, rh, tmp, p, ctx)) { - goto err; - } - } else { - // rh := (rh + a)*X - if (!bn_mod_add_consttime(rh, rh, &group->a, p, ctx) || - !field_mul(group, rh, rh, &point->X, ctx)) { - goto err; - } - // rh := rh + b - if (!bn_mod_add_consttime(rh, rh, &group->b, p, ctx)) { - goto err; - } - } - - // 'lh' := Y^2 - if (!field_sqr(group, tmp, &point->Y, ctx)) { - goto err; - } - - ret = (0 == BN_ucmp(tmp, rh)); - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, - const EC_POINT *b, BN_CTX *ctx) { - // return values: - // -1 error - // 0 equal (in affine coordinates) - // 1 not equal - - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - BN_CTX *new_ctx = NULL; - BIGNUM *tmp1, *tmp2, *Za23, *Zb23; - const BIGNUM *tmp1_, *tmp2_; - int ret = -1; - - if (ec_GFp_simple_is_at_infinity(group, a)) { - return ec_GFp_simple_is_at_infinity(group, b) ? 0 : 1; - } - - if (ec_GFp_simple_is_at_infinity(group, b)) { - return 1; - } - - int a_Z_is_one = BN_cmp(&a->Z, &group->one) == 0; - int b_Z_is_one = BN_cmp(&b->Z, &group->one) == 0; - - if (a_Z_is_one && b_Z_is_one) { - return ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0) ? 0 : 1; - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return -1; - } - } - - BN_CTX_start(ctx); - tmp1 = BN_CTX_get(ctx); - tmp2 = BN_CTX_get(ctx); - Za23 = BN_CTX_get(ctx); - Zb23 = BN_CTX_get(ctx); - if (Zb23 == NULL) { - goto end; - } - - // We have to decide whether - // (X_a/Z_a^2, Y_a/Z_a^3) = (X_b/Z_b^2, Y_b/Z_b^3), - // or equivalently, whether - // (X_a*Z_b^2, Y_a*Z_b^3) = (X_b*Z_a^2, Y_b*Z_a^3). - - if (!b_Z_is_one) { - if (!field_sqr(group, Zb23, &b->Z, ctx) || - !field_mul(group, tmp1, &a->X, Zb23, ctx)) { - goto end; - } - tmp1_ = tmp1; - } else { - tmp1_ = &a->X; - } - if (!a_Z_is_one) { - if (!field_sqr(group, Za23, &a->Z, ctx) || - !field_mul(group, tmp2, &b->X, Za23, ctx)) { - goto end; - } - tmp2_ = tmp2; - } else { - tmp2_ = &b->X; - } - - // compare X_a*Z_b^2 with X_b*Z_a^2 - if (BN_cmp(tmp1_, tmp2_) != 0) { - ret = 1; // points differ - goto end; - } - - - if (!b_Z_is_one) { - if (!field_mul(group, Zb23, Zb23, &b->Z, ctx) || - !field_mul(group, tmp1, &a->Y, Zb23, ctx)) { - goto end; - } - // tmp1_ = tmp1 - } else { - tmp1_ = &a->Y; - } - if (!a_Z_is_one) { - if (!field_mul(group, Za23, Za23, &a->Z, ctx) || - !field_mul(group, tmp2, &b->Y, Za23, ctx)) { - goto end; - } - // tmp2_ = tmp2 - } else { - tmp2_ = &b->Y; - } - - // compare Y_a*Z_b^3 with Y_b*Z_a^3 - if (BN_cmp(tmp1_, tmp2_) != 0) { - ret = 1; // points differ - goto end; - } - - // points are equal - ret = 0; - -end: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point, - BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - BIGNUM *x, *y; - int ret = 0; - - if (BN_cmp(&point->Z, &group->one) == 0 || - EC_POINT_is_at_infinity(group, point)) { - return 1; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - x = BN_CTX_get(ctx); - y = BN_CTX_get(ctx); - if (y == NULL) { - goto err; - } - - if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx) || - !EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { - goto err; - } - if (BN_cmp(&point->Z, &group->one) != 0) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, - EC_POINT *points[], BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - BIGNUM *tmp, *tmp_Z; - BIGNUM **prod_Z = NULL; - int ret = 0; - - if (num == 0) { - return 1; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - tmp = BN_CTX_get(ctx); - tmp_Z = BN_CTX_get(ctx); - if (tmp == NULL || tmp_Z == NULL) { - goto err; - } - - prod_Z = OPENSSL_malloc(num * sizeof(prod_Z[0])); - if (prod_Z == NULL) { - goto err; - } - OPENSSL_memset(prod_Z, 0, num * sizeof(prod_Z[0])); - for (size_t i = 0; i < num; i++) { - prod_Z[i] = BN_new(); - if (prod_Z[i] == NULL) { - goto err; - } - } - - // Set each prod_Z[i] to the product of points[0]->Z .. points[i]->Z, - // skipping any zero-valued inputs (pretend that they're 1). - - if (!BN_is_zero(&points[0]->Z)) { - if (!BN_copy(prod_Z[0], &points[0]->Z)) { - goto err; - } - } else { - if (BN_copy(prod_Z[0], &group->one) == NULL) { - goto err; - } - } - - for (size_t i = 1; i < num; i++) { - if (!BN_is_zero(&points[i]->Z)) { - if (!group->meth->field_mul(group, prod_Z[i], prod_Z[i - 1], - &points[i]->Z, ctx)) { - goto err; - } - } else { - if (!BN_copy(prod_Z[i], prod_Z[i - 1])) { - goto err; - } - } - } - - // Now use a single explicit inversion to replace every non-zero points[i]->Z - // by its inverse. We use |BN_mod_inverse_odd| instead of doing a constant- - // time inversion using Fermat's Little Theorem because this function is - // usually only used for converting multiples of a public key point to - // affine, and a public key point isn't secret. If we were to use Fermat's - // Little Theorem then the cost of the inversion would usually be so high - // that converting the multiples to affine would be counterproductive. - int no_inverse; - if (!BN_mod_inverse_odd(tmp, &no_inverse, prod_Z[num - 1], &group->field, - ctx)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - goto err; - } - - if (group->meth->field_encode != NULL) { - // In the Montgomery case, we just turned R*H (representing H) - // into 1/(R*H), but we need R*(1/H) (representing 1/H); - // i.e. we need to multiply by the Montgomery factor twice. - if (!group->meth->field_encode(group, tmp, tmp, ctx) || - !group->meth->field_encode(group, tmp, tmp, ctx)) { - goto err; - } - } - - for (size_t i = num - 1; i > 0; --i) { - // Loop invariant: tmp is the product of the inverses of - // points[0]->Z .. points[i]->Z (zero-valued inputs skipped). - if (BN_is_zero(&points[i]->Z)) { - continue; - } - - // Set tmp_Z to the inverse of points[i]->Z (as product - // of Z inverses 0 .. i, Z values 0 .. i - 1). - if (!group->meth->field_mul(group, tmp_Z, prod_Z[i - 1], tmp, ctx) || - // Update tmp to satisfy the loop invariant for i - 1. - !group->meth->field_mul(group, tmp, tmp, &points[i]->Z, ctx) || - // Replace points[i]->Z by its inverse. - !BN_copy(&points[i]->Z, tmp_Z)) { - goto err; - } - } - - // Replace points[0]->Z by its inverse. - if (!BN_is_zero(&points[0]->Z) && !BN_copy(&points[0]->Z, tmp)) { - goto err; - } - - // Finally, fix up the X and Y coordinates for all points. - for (size_t i = 0; i < num; i++) { - EC_POINT *p = points[i]; - - if (!BN_is_zero(&p->Z)) { - // turn (X, Y, 1/Z) into (X/Z^2, Y/Z^3, 1). - if (!group->meth->field_sqr(group, tmp, &p->Z, ctx) || - !group->meth->field_mul(group, &p->X, &p->X, tmp, ctx) || - !group->meth->field_mul(group, tmp, tmp, &p->Z, ctx) || - !group->meth->field_mul(group, &p->Y, &p->Y, tmp, ctx)) { - goto err; - } - - if (BN_copy(&p->Z, &group->one) == NULL) { - goto err; - } - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - if (prod_Z != NULL) { - for (size_t i = 0; i < num; i++) { - if (prod_Z[i] == NULL) { - break; - } - BN_clear_free(prod_Z[i]); - } - OPENSSL_free(prod_Z); - } - - return ret; -} - -int ec_GFp_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx) { - return BN_mod_mul(r, a, b, &group->field, ctx); -} - -int ec_GFp_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - return BN_mod_sqr(r, a, &group->field, ctx); -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/simple.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/simple.c.grpc_back deleted file mode 100644 index 90c61d5d6..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/simple.c.grpc_back +++ /dev/null @@ -1,1046 +0,0 @@ -/* Originally written by Bodo Moeller for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#include - -#include - -#include -#include -#include - -#include "internal.h" -#include "../../internal.h" - - -// Most method functions in this file are designed to work with non-trivial -// representations of field elements if necessary (see ecp_mont.c): while -// standard modular addition and subtraction are used, the field_mul and -// field_sqr methods will be used for multiplication, and field_encode and -// field_decode (if defined) will be used for converting between -// representations. -// -// Functions here specifically assume that if a non-trivial representation is -// used, it is a Montgomery representation (i.e. 'encoding' means multiplying -// by some factor R). - -int ec_GFp_simple_group_init(EC_GROUP *group) { - BN_init(&group->field); - BN_init(&group->a); - BN_init(&group->b); - BN_init(&group->one); - group->a_is_minus3 = 0; - return 1; -} - -void ec_GFp_simple_group_finish(EC_GROUP *group) { - BN_free(&group->field); - BN_free(&group->a); - BN_free(&group->b); - BN_free(&group->one); -} - -int ec_GFp_simple_group_set_curve(EC_GROUP *group, const BIGNUM *p, - const BIGNUM *a, const BIGNUM *b, - BN_CTX *ctx) { - int ret = 0; - BN_CTX *new_ctx = NULL; - BIGNUM *tmp_a; - - // p must be a prime > 3 - if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); - return 0; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - tmp_a = BN_CTX_get(ctx); - if (tmp_a == NULL) { - goto err; - } - - // group->field - if (!BN_copy(&group->field, p)) { - goto err; - } - BN_set_negative(&group->field, 0); - // Store the field in minimal form, so it can be used with |BN_ULONG| arrays. - bn_set_minimal_width(&group->field); - - // group->a - if (!BN_nnmod(tmp_a, a, &group->field, ctx)) { - goto err; - } - if (group->meth->field_encode) { - if (!group->meth->field_encode(group, &group->a, tmp_a, ctx)) { - goto err; - } - } else if (!BN_copy(&group->a, tmp_a)) { - goto err; - } - - // group->b - if (!BN_nnmod(&group->b, b, &group->field, ctx)) { - goto err; - } - if (group->meth->field_encode && - !group->meth->field_encode(group, &group->b, &group->b, ctx)) { - goto err; - } - - // group->a_is_minus3 - if (!BN_add_word(tmp_a, 3)) { - goto err; - } - group->a_is_minus3 = (0 == BN_cmp(tmp_a, &group->field)); - - if (group->meth->field_encode != NULL) { - if (!group->meth->field_encode(group, &group->one, BN_value_one(), ctx)) { - goto err; - } - } else if (!BN_copy(&group->one, BN_value_one())) { - goto err; - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, - BIGNUM *b, BN_CTX *ctx) { - int ret = 0; - BN_CTX *new_ctx = NULL; - - if (p != NULL && !BN_copy(p, &group->field)) { - return 0; - } - - if (a != NULL || b != NULL) { - if (group->meth->field_decode) { - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - if (a != NULL && !group->meth->field_decode(group, a, &group->a, ctx)) { - goto err; - } - if (b != NULL && !group->meth->field_decode(group, b, &group->b, ctx)) { - goto err; - } - } else { - if (a != NULL && !BN_copy(a, &group->a)) { - goto err; - } - if (b != NULL && !BN_copy(b, &group->b)) { - goto err; - } - } - } - - ret = 1; - -err: - BN_CTX_free(new_ctx); - return ret; -} - -unsigned ec_GFp_simple_group_get_degree(const EC_GROUP *group) { - return BN_num_bits(&group->field); -} - -int ec_GFp_simple_point_init(EC_POINT *point) { - BN_init(&point->X); - BN_init(&point->Y); - BN_init(&point->Z); - - return 1; -} - -void ec_GFp_simple_point_finish(EC_POINT *point) { - BN_free(&point->X); - BN_free(&point->Y); - BN_free(&point->Z); -} - -int ec_GFp_simple_point_copy(EC_POINT *dest, const EC_POINT *src) { - if (!BN_copy(&dest->X, &src->X) || - !BN_copy(&dest->Y, &src->Y) || - !BN_copy(&dest->Z, &src->Z)) { - return 0; - } - - return 1; -} - -int ec_GFp_simple_point_set_to_infinity(const EC_GROUP *group, - EC_POINT *point) { - BN_zero(&point->Z); - return 1; -} - -static int set_Jprojective_coordinate_GFp(const EC_GROUP *group, BIGNUM *out, - const BIGNUM *in, BN_CTX *ctx) { - if (in == NULL) { - return 1; - } - if (BN_is_negative(in) || - BN_cmp(in, &group->field) >= 0) { - OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); - return 0; - } - if (group->meth->field_encode) { - return group->meth->field_encode(group, out, in, ctx); - } - return BN_copy(out, in) != NULL; -} - -int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, - EC_POINT *point, const BIGNUM *x, - const BIGNUM *y, BN_CTX *ctx) { - if (x == NULL || y == NULL) { - OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - BN_CTX *new_ctx = NULL; - int ret = 0; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - if (!set_Jprojective_coordinate_GFp(group, &point->X, x, ctx) || - !set_Jprojective_coordinate_GFp(group, &point->Y, y, ctx) || - !BN_copy(&point->Z, &group->one)) { - goto err; - } - - ret = 1; - -err: - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, - const EC_POINT *b, BN_CTX *ctx) { - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - const BIGNUM *p; - BN_CTX *new_ctx = NULL; - BIGNUM *n0, *n1, *n2, *n3, *n4, *n5, *n6; - int ret = 0; - - if (a == b) { - return EC_POINT_dbl(group, r, a, ctx); - } - if (EC_POINT_is_at_infinity(group, a)) { - return EC_POINT_copy(r, b); - } - if (EC_POINT_is_at_infinity(group, b)) { - return EC_POINT_copy(r, a); - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - p = &group->field; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - n0 = BN_CTX_get(ctx); - n1 = BN_CTX_get(ctx); - n2 = BN_CTX_get(ctx); - n3 = BN_CTX_get(ctx); - n4 = BN_CTX_get(ctx); - n5 = BN_CTX_get(ctx); - n6 = BN_CTX_get(ctx); - if (n6 == NULL) { - goto end; - } - - // Note that in this function we must not read components of 'a' or 'b' - // once we have written the corresponding components of 'r'. - // ('r' might be one of 'a' or 'b'.) - - // n1, n2 - int b_Z_is_one = BN_cmp(&b->Z, &group->one) == 0; - - if (b_Z_is_one) { - if (!BN_copy(n1, &a->X) || !BN_copy(n2, &a->Y)) { - goto end; - } - // n1 = X_a - // n2 = Y_a - } else { - if (!field_sqr(group, n0, &b->Z, ctx) || - !field_mul(group, n1, &a->X, n0, ctx)) { - goto end; - } - // n1 = X_a * Z_b^2 - - if (!field_mul(group, n0, n0, &b->Z, ctx) || - !field_mul(group, n2, &a->Y, n0, ctx)) { - goto end; - } - // n2 = Y_a * Z_b^3 - } - - // n3, n4 - int a_Z_is_one = BN_cmp(&a->Z, &group->one) == 0; - if (a_Z_is_one) { - if (!BN_copy(n3, &b->X) || !BN_copy(n4, &b->Y)) { - goto end; - } - // n3 = X_b - // n4 = Y_b - } else { - if (!field_sqr(group, n0, &a->Z, ctx) || - !field_mul(group, n3, &b->X, n0, ctx)) { - goto end; - } - // n3 = X_b * Z_a^2 - - if (!field_mul(group, n0, n0, &a->Z, ctx) || - !field_mul(group, n4, &b->Y, n0, ctx)) { - goto end; - } - // n4 = Y_b * Z_a^3 - } - - // n5, n6 - if (!bn_mod_sub_consttime(n5, n1, n3, p, ctx) || - !bn_mod_sub_consttime(n6, n2, n4, p, ctx)) { - goto end; - } - // n5 = n1 - n3 - // n6 = n2 - n4 - - if (BN_is_zero(n5)) { - if (BN_is_zero(n6)) { - // a is the same point as b - BN_CTX_end(ctx); - ret = EC_POINT_dbl(group, r, a, ctx); - ctx = NULL; - goto end; - } else { - // a is the inverse of b - BN_zero(&r->Z); - ret = 1; - goto end; - } - } - - // 'n7', 'n8' - if (!bn_mod_add_consttime(n1, n1, n3, p, ctx) || - !bn_mod_add_consttime(n2, n2, n4, p, ctx)) { - goto end; - } - // 'n7' = n1 + n3 - // 'n8' = n2 + n4 - - // Z_r - if (a_Z_is_one && b_Z_is_one) { - if (!BN_copy(&r->Z, n5)) { - goto end; - } - } else { - if (a_Z_is_one) { - if (!BN_copy(n0, &b->Z)) { - goto end; - } - } else if (b_Z_is_one) { - if (!BN_copy(n0, &a->Z)) { - goto end; - } - } else if (!field_mul(group, n0, &a->Z, &b->Z, ctx)) { - goto end; - } - if (!field_mul(group, &r->Z, n0, n5, ctx)) { - goto end; - } - } - - // Z_r = Z_a * Z_b * n5 - - // X_r - if (!field_sqr(group, n0, n6, ctx) || - !field_sqr(group, n4, n5, ctx) || - !field_mul(group, n3, n1, n4, ctx) || - !bn_mod_sub_consttime(&r->X, n0, n3, p, ctx)) { - goto end; - } - // X_r = n6^2 - n5^2 * 'n7' - - // 'n9' - if (!bn_mod_lshift1_consttime(n0, &r->X, p, ctx) || - !bn_mod_sub_consttime(n0, n3, n0, p, ctx)) { - goto end; - } - // n9 = n5^2 * 'n7' - 2 * X_r - - // Y_r - if (!field_mul(group, n0, n0, n6, ctx) || - !field_mul(group, n5, n4, n5, ctx)) { - goto end; // now n5 is n5^3 - } - if (!field_mul(group, n1, n2, n5, ctx) || - !bn_mod_sub_consttime(n0, n0, n1, p, ctx)) { - goto end; - } - if (BN_is_odd(n0) && !BN_add(n0, n0, p)) { - goto end; - } - // now 0 <= n0 < 2*p, and n0 is even - if (!BN_rshift1(&r->Y, n0)) { - goto end; - } - // Y_r = (n6 * 'n9' - 'n8' * 'n5^3') / 2 - - ret = 1; - -end: - if (ctx) { - // otherwise we already called BN_CTX_end - BN_CTX_end(ctx); - } - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, - BN_CTX *ctx) { - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - const BIGNUM *p; - BN_CTX *new_ctx = NULL; - BIGNUM *n0, *n1, *n2, *n3; - int ret = 0; - - if (EC_POINT_is_at_infinity(group, a)) { - BN_zero(&r->Z); - return 1; - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - p = &group->field; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - n0 = BN_CTX_get(ctx); - n1 = BN_CTX_get(ctx); - n2 = BN_CTX_get(ctx); - n3 = BN_CTX_get(ctx); - if (n3 == NULL) { - goto err; - } - - // Note that in this function we must not read components of 'a' - // once we have written the corresponding components of 'r'. - // ('r' might the same as 'a'.) - - // n1 - if (BN_cmp(&a->Z, &group->one) == 0) { - if (!field_sqr(group, n0, &a->X, ctx) || - !bn_mod_lshift1_consttime(n1, n0, p, ctx) || - !bn_mod_add_consttime(n0, n0, n1, p, ctx) || - !bn_mod_add_consttime(n1, n0, &group->a, p, ctx)) { - goto err; - } - // n1 = 3 * X_a^2 + a_curve - } else if (group->a_is_minus3) { - if (!field_sqr(group, n1, &a->Z, ctx) || - !bn_mod_add_consttime(n0, &a->X, n1, p, ctx) || - !bn_mod_sub_consttime(n2, &a->X, n1, p, ctx) || - !field_mul(group, n1, n0, n2, ctx) || - !bn_mod_lshift1_consttime(n0, n1, p, ctx) || - !bn_mod_add_consttime(n1, n0, n1, p, ctx)) { - goto err; - } - // n1 = 3 * (X_a + Z_a^2) * (X_a - Z_a^2) - // = 3 * X_a^2 - 3 * Z_a^4 - } else { - if (!field_sqr(group, n0, &a->X, ctx) || - !bn_mod_lshift1_consttime(n1, n0, p, ctx) || - !bn_mod_add_consttime(n0, n0, n1, p, ctx) || - !field_sqr(group, n1, &a->Z, ctx) || - !field_sqr(group, n1, n1, ctx) || - !field_mul(group, n1, n1, &group->a, ctx) || - !bn_mod_add_consttime(n1, n1, n0, p, ctx)) { - goto err; - } - // n1 = 3 * X_a^2 + a_curve * Z_a^4 - } - - // Z_r - if (BN_cmp(&a->Z, &group->one) == 0) { - if (!BN_copy(n0, &a->Y)) { - goto err; - } - } else if (!field_mul(group, n0, &a->Y, &a->Z, ctx)) { - goto err; - } - if (!bn_mod_lshift1_consttime(&r->Z, n0, p, ctx)) { - goto err; - } - // Z_r = 2 * Y_a * Z_a - - // n2 - if (!field_sqr(group, n3, &a->Y, ctx) || - !field_mul(group, n2, &a->X, n3, ctx) || - !bn_mod_lshift_consttime(n2, n2, 2, p, ctx)) { - goto err; - } - // n2 = 4 * X_a * Y_a^2 - - // X_r - if (!bn_mod_lshift1_consttime(n0, n2, p, ctx) || - !field_sqr(group, &r->X, n1, ctx) || - !bn_mod_sub_consttime(&r->X, &r->X, n0, p, ctx)) { - goto err; - } - // X_r = n1^2 - 2 * n2 - - // n3 - if (!field_sqr(group, n0, n3, ctx) || - !bn_mod_lshift_consttime(n3, n0, 3, p, ctx)) { - goto err; - } - // n3 = 8 * Y_a^4 - - // Y_r - if (!bn_mod_sub_consttime(n0, n2, &r->X, p, ctx) || - !field_mul(group, n0, n1, n0, ctx) || - !bn_mod_sub_consttime(&r->Y, n0, n3, p, ctx)) { - goto err; - } - // Y_r = n1 * (n2 - X_r) - n3 - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_invert(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { - if (EC_POINT_is_at_infinity(group, point) || BN_is_zero(&point->Y)) { - // point is its own inverse - return 1; - } - - return BN_usub(&point->Y, &group->field, &point->Y); -} - -int ec_GFp_simple_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { - return BN_is_zero(&point->Z); -} - -int ec_GFp_simple_is_on_curve(const EC_GROUP *group, const EC_POINT *point, - BN_CTX *ctx) { - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - const BIGNUM *p; - BN_CTX *new_ctx = NULL; - BIGNUM *rh, *tmp, *Z4, *Z6; - int ret = 0; - - if (EC_POINT_is_at_infinity(group, point)) { - return 1; - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - p = &group->field; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - rh = BN_CTX_get(ctx); - tmp = BN_CTX_get(ctx); - Z4 = BN_CTX_get(ctx); - Z6 = BN_CTX_get(ctx); - if (Z6 == NULL) { - goto err; - } - - // We have a curve defined by a Weierstrass equation - // y^2 = x^3 + a*x + b. - // The point to consider is given in Jacobian projective coordinates - // where (X, Y, Z) represents (x, y) = (X/Z^2, Y/Z^3). - // Substituting this and multiplying by Z^6 transforms the above equation - // into - // Y^2 = X^3 + a*X*Z^4 + b*Z^6. - // To test this, we add up the right-hand side in 'rh'. - - // rh := X^2 - if (!field_sqr(group, rh, &point->X, ctx)) { - goto err; - } - - if (BN_cmp(&point->Z, &group->one) != 0) { - if (!field_sqr(group, tmp, &point->Z, ctx) || - !field_sqr(group, Z4, tmp, ctx) || - !field_mul(group, Z6, Z4, tmp, ctx)) { - goto err; - } - - // rh := (rh + a*Z^4)*X - if (group->a_is_minus3) { - if (!bn_mod_lshift1_consttime(tmp, Z4, p, ctx) || - !bn_mod_add_consttime(tmp, tmp, Z4, p, ctx) || - !bn_mod_sub_consttime(rh, rh, tmp, p, ctx) || - !field_mul(group, rh, rh, &point->X, ctx)) { - goto err; - } - } else { - if (!field_mul(group, tmp, Z4, &group->a, ctx) || - !bn_mod_add_consttime(rh, rh, tmp, p, ctx) || - !field_mul(group, rh, rh, &point->X, ctx)) { - goto err; - } - } - - // rh := rh + b*Z^6 - if (!field_mul(group, tmp, &group->b, Z6, ctx) || - !bn_mod_add_consttime(rh, rh, tmp, p, ctx)) { - goto err; - } - } else { - // rh := (rh + a)*X - if (!bn_mod_add_consttime(rh, rh, &group->a, p, ctx) || - !field_mul(group, rh, rh, &point->X, ctx)) { - goto err; - } - // rh := rh + b - if (!bn_mod_add_consttime(rh, rh, &group->b, p, ctx)) { - goto err; - } - } - - // 'lh' := Y^2 - if (!field_sqr(group, tmp, &point->Y, ctx)) { - goto err; - } - - ret = (0 == BN_ucmp(tmp, rh)); - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_POINT *a, - const EC_POINT *b, BN_CTX *ctx) { - // return values: - // -1 error - // 0 equal (in affine coordinates) - // 1 not equal - - int (*field_mul)(const EC_GROUP *, BIGNUM *, const BIGNUM *, const BIGNUM *, - BN_CTX *); - int (*field_sqr)(const EC_GROUP *, BIGNUM *, const BIGNUM *, BN_CTX *); - BN_CTX *new_ctx = NULL; - BIGNUM *tmp1, *tmp2, *Za23, *Zb23; - const BIGNUM *tmp1_, *tmp2_; - int ret = -1; - - if (ec_GFp_simple_is_at_infinity(group, a)) { - return ec_GFp_simple_is_at_infinity(group, b) ? 0 : 1; - } - - if (ec_GFp_simple_is_at_infinity(group, b)) { - return 1; - } - - int a_Z_is_one = BN_cmp(&a->Z, &group->one) == 0; - int b_Z_is_one = BN_cmp(&b->Z, &group->one) == 0; - - if (a_Z_is_one && b_Z_is_one) { - return ((BN_cmp(&a->X, &b->X) == 0) && BN_cmp(&a->Y, &b->Y) == 0) ? 0 : 1; - } - - field_mul = group->meth->field_mul; - field_sqr = group->meth->field_sqr; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return -1; - } - } - - BN_CTX_start(ctx); - tmp1 = BN_CTX_get(ctx); - tmp2 = BN_CTX_get(ctx); - Za23 = BN_CTX_get(ctx); - Zb23 = BN_CTX_get(ctx); - if (Zb23 == NULL) { - goto end; - } - - // We have to decide whether - // (X_a/Z_a^2, Y_a/Z_a^3) = (X_b/Z_b^2, Y_b/Z_b^3), - // or equivalently, whether - // (X_a*Z_b^2, Y_a*Z_b^3) = (X_b*Z_a^2, Y_b*Z_a^3). - - if (!b_Z_is_one) { - if (!field_sqr(group, Zb23, &b->Z, ctx) || - !field_mul(group, tmp1, &a->X, Zb23, ctx)) { - goto end; - } - tmp1_ = tmp1; - } else { - tmp1_ = &a->X; - } - if (!a_Z_is_one) { - if (!field_sqr(group, Za23, &a->Z, ctx) || - !field_mul(group, tmp2, &b->X, Za23, ctx)) { - goto end; - } - tmp2_ = tmp2; - } else { - tmp2_ = &b->X; - } - - // compare X_a*Z_b^2 with X_b*Z_a^2 - if (BN_cmp(tmp1_, tmp2_) != 0) { - ret = 1; // points differ - goto end; - } - - - if (!b_Z_is_one) { - if (!field_mul(group, Zb23, Zb23, &b->Z, ctx) || - !field_mul(group, tmp1, &a->Y, Zb23, ctx)) { - goto end; - } - // tmp1_ = tmp1 - } else { - tmp1_ = &a->Y; - } - if (!a_Z_is_one) { - if (!field_mul(group, Za23, Za23, &a->Z, ctx) || - !field_mul(group, tmp2, &b->Y, Za23, ctx)) { - goto end; - } - // tmp2_ = tmp2 - } else { - tmp2_ = &b->Y; - } - - // compare Y_a*Z_b^3 with Y_b*Z_a^3 - if (BN_cmp(tmp1_, tmp2_) != 0) { - ret = 1; // points differ - goto end; - } - - // points are equal - ret = 0; - -end: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_make_affine(const EC_GROUP *group, EC_POINT *point, - BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - BIGNUM *x, *y; - int ret = 0; - - if (BN_cmp(&point->Z, &group->one) == 0 || - EC_POINT_is_at_infinity(group, point)) { - return 1; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - x = BN_CTX_get(ctx); - y = BN_CTX_get(ctx); - if (y == NULL) { - goto err; - } - - if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx) || - !EC_POINT_set_affine_coordinates_GFp(group, point, x, y, ctx)) { - goto err; - } - if (BN_cmp(&point->Z, &group->one) != 0) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - return ret; -} - -int ec_GFp_simple_points_make_affine(const EC_GROUP *group, size_t num, - EC_POINT *points[], BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - BIGNUM *tmp, *tmp_Z; - BIGNUM **prod_Z = NULL; - int ret = 0; - - if (num == 0) { - return 1; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - return 0; - } - } - - BN_CTX_start(ctx); - tmp = BN_CTX_get(ctx); - tmp_Z = BN_CTX_get(ctx); - if (tmp == NULL || tmp_Z == NULL) { - goto err; - } - - prod_Z = OPENSSL_malloc(num * sizeof(prod_Z[0])); - if (prod_Z == NULL) { - goto err; - } - OPENSSL_memset(prod_Z, 0, num * sizeof(prod_Z[0])); - for (size_t i = 0; i < num; i++) { - prod_Z[i] = BN_new(); - if (prod_Z[i] == NULL) { - goto err; - } - } - - // Set each prod_Z[i] to the product of points[0]->Z .. points[i]->Z, - // skipping any zero-valued inputs (pretend that they're 1). - - if (!BN_is_zero(&points[0]->Z)) { - if (!BN_copy(prod_Z[0], &points[0]->Z)) { - goto err; - } - } else { - if (BN_copy(prod_Z[0], &group->one) == NULL) { - goto err; - } - } - - for (size_t i = 1; i < num; i++) { - if (!BN_is_zero(&points[i]->Z)) { - if (!group->meth->field_mul(group, prod_Z[i], prod_Z[i - 1], - &points[i]->Z, ctx)) { - goto err; - } - } else { - if (!BN_copy(prod_Z[i], prod_Z[i - 1])) { - goto err; - } - } - } - - // Now use a single explicit inversion to replace every non-zero points[i]->Z - // by its inverse. We use |BN_mod_inverse_odd| instead of doing a constant- - // time inversion using Fermat's Little Theorem because this function is - // usually only used for converting multiples of a public key point to - // affine, and a public key point isn't secret. If we were to use Fermat's - // Little Theorem then the cost of the inversion would usually be so high - // that converting the multiples to affine would be counterproductive. - int no_inverse; - if (!BN_mod_inverse_odd(tmp, &no_inverse, prod_Z[num - 1], &group->field, - ctx)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - goto err; - } - - if (group->meth->field_encode != NULL) { - // In the Montgomery case, we just turned R*H (representing H) - // into 1/(R*H), but we need R*(1/H) (representing 1/H); - // i.e. we need to multiply by the Montgomery factor twice. - if (!group->meth->field_encode(group, tmp, tmp, ctx) || - !group->meth->field_encode(group, tmp, tmp, ctx)) { - goto err; - } - } - - for (size_t i = num - 1; i > 0; --i) { - // Loop invariant: tmp is the product of the inverses of - // points[0]->Z .. points[i]->Z (zero-valued inputs skipped). - if (BN_is_zero(&points[i]->Z)) { - continue; - } - - // Set tmp_Z to the inverse of points[i]->Z (as product - // of Z inverses 0 .. i, Z values 0 .. i - 1). - if (!group->meth->field_mul(group, tmp_Z, prod_Z[i - 1], tmp, ctx) || - // Update tmp to satisfy the loop invariant for i - 1. - !group->meth->field_mul(group, tmp, tmp, &points[i]->Z, ctx) || - // Replace points[i]->Z by its inverse. - !BN_copy(&points[i]->Z, tmp_Z)) { - goto err; - } - } - - // Replace points[0]->Z by its inverse. - if (!BN_is_zero(&points[0]->Z) && !BN_copy(&points[0]->Z, tmp)) { - goto err; - } - - // Finally, fix up the X and Y coordinates for all points. - for (size_t i = 0; i < num; i++) { - EC_POINT *p = points[i]; - - if (!BN_is_zero(&p->Z)) { - // turn (X, Y, 1/Z) into (X/Z^2, Y/Z^3, 1). - if (!group->meth->field_sqr(group, tmp, &p->Z, ctx) || - !group->meth->field_mul(group, &p->X, &p->X, tmp, ctx) || - !group->meth->field_mul(group, tmp, tmp, &p->Z, ctx) || - !group->meth->field_mul(group, &p->Y, &p->Y, tmp, ctx)) { - goto err; - } - - if (BN_copy(&p->Z, &group->one) == NULL) { - goto err; - } - } - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(new_ctx); - if (prod_Z != NULL) { - for (size_t i = 0; i < num; i++) { - if (prod_Z[i] == NULL) { - break; - } - BN_clear_free(prod_Z[i]); - } - OPENSSL_free(prod_Z); - } - - return ret; -} - -int ec_GFp_simple_field_mul(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - const BIGNUM *b, BN_CTX *ctx) { - return BN_mod_mul(r, a, b, &group->field, ctx); -} - -int ec_GFp_simple_field_sqr(const EC_GROUP *group, BIGNUM *r, const BIGNUM *a, - BN_CTX *ctx) { - return BN_mod_sqr(r, a, &group->field, ctx); -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/util.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/util.c deleted file mode 100644 index 85d663fa6..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/util.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include "internal.h" - -// This function looks at 5+1 scalar bits (5 current, 1 adjacent less -// significant bit), and recodes them into a signed digit for use in fast point -// multiplication: the use of signed rather than unsigned digits means that -// fewer points need to be precomputed, given that point inversion is easy (a -// precomputed point dP makes -dP available as well). -// -// BACKGROUND: -// -// Signed digits for multiplication were introduced by Booth ("A signed binary -// multiplication technique", Quart. Journ. Mech. and Applied Math., vol. IV, -// pt. 2 (1951), pp. 236-240), in that case for multiplication of integers. -// Booth's original encoding did not generally improve the density of nonzero -// digits over the binary representation, and was merely meant to simplify the -// handling of signed factors given in two's complement; but it has since been -// shown to be the basis of various signed-digit representations that do have -// further advantages, including the wNAF, using the following general -// approach: -// -// (1) Given a binary representation -// -// b_k ... b_2 b_1 b_0, -// -// of a nonnegative integer (b_k in {0, 1}), rewrite it in digits 0, 1, -1 -// by using bit-wise subtraction as follows: -// -// b_k b_(k-1) ... b_2 b_1 b_0 -// - b_k ... b_3 b_2 b_1 b_0 -// ------------------------------------- -// s_k b_(k-1) ... s_3 s_2 s_1 s_0 -// -// A left-shift followed by subtraction of the original value yields a new -// representation of the same value, using signed bits s_i = b_(i+1) - b_i. -// This representation from Booth's paper has since appeared in the -// literature under a variety of different names including "reversed binary -// form", "alternating greedy expansion", "mutual opposite form", and -// "sign-alternating {+-1}-representation". -// -// An interesting property is that among the nonzero bits, values 1 and -1 -// strictly alternate. -// -// (2) Various window schemes can be applied to the Booth representation of -// integers: for example, right-to-left sliding windows yield the wNAF -// (a signed-digit encoding independently discovered by various researchers -// in the 1990s), and left-to-right sliding windows yield a left-to-right -// equivalent of the wNAF (independently discovered by various researchers -// around 2004). -// -// To prevent leaking information through side channels in point multiplication, -// we need to recode the given integer into a regular pattern: sliding windows -// as in wNAFs won't do, we need their fixed-window equivalent -- which is a few -// decades older: we'll be using the so-called "modified Booth encoding" due to -// MacSorley ("High-speed arithmetic in binary computers", Proc. IRE, vol. 49 -// (1961), pp. 67-91), in a radix-2^5 setting. That is, we always combine five -// signed bits into a signed digit: -// -// s_(4j + 4) s_(4j + 3) s_(4j + 2) s_(4j + 1) s_(4j) -// -// The sign-alternating property implies that the resulting digit values are -// integers from -16 to 16. -// -// Of course, we don't actually need to compute the signed digits s_i as an -// intermediate step (that's just a nice way to see how this scheme relates -// to the wNAF): a direct computation obtains the recoded digit from the -// six bits b_(4j + 4) ... b_(4j - 1). -// -// This function takes those five bits as an integer (0 .. 63), writing the -// recoded digit to *sign (0 for positive, 1 for negative) and *digit (absolute -// value, in the range 0 .. 8). Note that this integer essentially provides the -// input bits "shifted to the left" by one position: for example, the input to -// compute the least significant recoded digit, given that there's no bit b_-1, -// has to be b_4 b_3 b_2 b_1 b_0 0. -void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, - uint8_t in) { - uint8_t s, d; - - s = ~((in >> 5) - 1); /* sets all bits to MSB(in), 'in' seen as - * 6-bit value */ - d = (1 << 6) - in - 1; - d = (d & s) | (in & ~s); - d = (d >> 1) + (d & 1); - - *sign = s & 1; - *digit = d; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/util.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/util.c.grpc_back deleted file mode 100644 index 7303a1515..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/util.c.grpc_back +++ /dev/null @@ -1,104 +0,0 @@ -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include "internal.h" - -// This function looks at 5+1 scalar bits (5 current, 1 adjacent less -// significant bit), and recodes them into a signed digit for use in fast point -// multiplication: the use of signed rather than unsigned digits means that -// fewer points need to be precomputed, given that point inversion is easy (a -// precomputed point dP makes -dP available as well). -// -// BACKGROUND: -// -// Signed digits for multiplication were introduced by Booth ("A signed binary -// multiplication technique", Quart. Journ. Mech. and Applied Math., vol. IV, -// pt. 2 (1951), pp. 236-240), in that case for multiplication of integers. -// Booth's original encoding did not generally improve the density of nonzero -// digits over the binary representation, and was merely meant to simplify the -// handling of signed factors given in two's complement; but it has since been -// shown to be the basis of various signed-digit representations that do have -// further advantages, including the wNAF, using the following general -// approach: -// -// (1) Given a binary representation -// -// b_k ... b_2 b_1 b_0, -// -// of a nonnegative integer (b_k in {0, 1}), rewrite it in digits 0, 1, -1 -// by using bit-wise subtraction as follows: -// -// b_k b_(k-1) ... b_2 b_1 b_0 -// - b_k ... b_3 b_2 b_1 b_0 -// ------------------------------------- -// s_k b_(k-1) ... s_3 s_2 s_1 s_0 -// -// A left-shift followed by subtraction of the original value yields a new -// representation of the same value, using signed bits s_i = b_(i+1) - b_i. -// This representation from Booth's paper has since appeared in the -// literature under a variety of different names including "reversed binary -// form", "alternating greedy expansion", "mutual opposite form", and -// "sign-alternating {+-1}-representation". -// -// An interesting property is that among the nonzero bits, values 1 and -1 -// strictly alternate. -// -// (2) Various window schemes can be applied to the Booth representation of -// integers: for example, right-to-left sliding windows yield the wNAF -// (a signed-digit encoding independently discovered by various researchers -// in the 1990s), and left-to-right sliding windows yield a left-to-right -// equivalent of the wNAF (independently discovered by various researchers -// around 2004). -// -// To prevent leaking information through side channels in point multiplication, -// we need to recode the given integer into a regular pattern: sliding windows -// as in wNAFs won't do, we need their fixed-window equivalent -- which is a few -// decades older: we'll be using the so-called "modified Booth encoding" due to -// MacSorley ("High-speed arithmetic in binary computers", Proc. IRE, vol. 49 -// (1961), pp. 67-91), in a radix-2^5 setting. That is, we always combine five -// signed bits into a signed digit: -// -// s_(4j + 4) s_(4j + 3) s_(4j + 2) s_(4j + 1) s_(4j) -// -// The sign-alternating property implies that the resulting digit values are -// integers from -16 to 16. -// -// Of course, we don't actually need to compute the signed digits s_i as an -// intermediate step (that's just a nice way to see how this scheme relates -// to the wNAF): a direct computation obtains the recoded digit from the -// six bits b_(4j + 4) ... b_(4j - 1). -// -// This function takes those five bits as an integer (0 .. 63), writing the -// recoded digit to *sign (0 for positive, 1 for negative) and *digit (absolute -// value, in the range 0 .. 8). Note that this integer essentially provides the -// input bits "shifted to the left" by one position: for example, the input to -// compute the least significant recoded digit, given that there's no bit b_-1, -// has to be b_4 b_3 b_2 b_1 b_0 0. -void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, - uint8_t in) { - uint8_t s, d; - - s = ~((in >> 5) - 1); /* sets all bits to MSB(in), 'in' seen as - * 6-bit value */ - d = (1 << 6) - in - 1; - d = (d & s) | (in & ~s); - d = (d >> 1) + (d & 1); - - *sign = s & 1; - *digit = d; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/wnaf.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/wnaf.c deleted file mode 100644 index 5e4202e64..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/wnaf.c +++ /dev/null @@ -1,354 +0,0 @@ -/* Originally written by Bodo Moeller for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#include - -#include - -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../bn/internal.h" -#include "../../internal.h" - - -// This file implements the wNAF-based interleaving multi-exponentiation method -// at: -// http://link.springer.com/chapter/10.1007%2F3-540-45537-X_13 -// http://www.bmoeller.de/pdf/TI-01-08.multiexp.pdf - -int ec_compute_wNAF(const EC_GROUP *group, int8_t *out, const EC_SCALAR *scalar, - size_t bits, int w) { - // 'int8_t' can represent integers with absolute values less than 2^7. - if (w <= 0 || w > 7 || bits == 0) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - int bit = 1 << w; // at most 128 - int next_bit = bit << 1; // at most 256 - int mask = next_bit - 1; // at most 255 - - int window_val = scalar->words[0] & mask; - size_t j = 0; - // If j+w+1 >= bits, window_val will not increase. - while (window_val != 0 || j + w + 1 < bits) { - int digit = 0; - - // 0 <= window_val <= 2^(w+1) - - if (window_val & 1) { - // 0 < window_val < 2^(w+1) - - if (window_val & bit) { - digit = window_val - next_bit; // -2^w < digit < 0 - -#if 1 // modified wNAF - if (j + w + 1 >= bits) { - // special case for generating modified wNAFs: - // no new bits will be added into window_val, - // so using a positive digit here will decrease - // the total length of the representation - - digit = window_val & (mask >> 1); // 0 < digit < 2^w - } -#endif - } else { - digit = window_val; // 0 < digit < 2^w - } - - if (digit <= -bit || digit >= bit || !(digit & 1)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - - window_val -= digit; - - // Now window_val is 0 or 2^(w+1) in standard wNAF generation; - // for modified window NAFs, it may also be 2^w. - if (window_val != 0 && window_val != next_bit && window_val != bit) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - out[j++] = digit; - - window_val >>= 1; - window_val += - bit * bn_is_bit_set_words(scalar->words, group->order.width, j + w); - - if (window_val > next_bit) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - // Fill the rest of the wNAF with zeros. - if (j > bits + 1) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - for (size_t i = j; i < bits + 1; i++) { - out[i] = 0; - } - - return 1; -} - -// TODO: table should be optimised for the wNAF-based implementation, -// sometimes smaller windows will give better performance -// (thus the boundaries should be increased) -static size_t window_bits_for_scalar_size(size_t b) { - if (b >= 300) { - return 4; - } - - if (b >= 70) { - return 3; - } - - if (b >= 20) { - return 2; - } - - return 1; -} - -// EC_WNAF_MAX_WINDOW_BITS is the largest value returned by -// |window_bits_for_scalar_size|. -#define EC_WNAF_MAX_WINDOW_BITS 4 - -// compute_precomp sets |out[i]| to a newly-allocated |EC_POINT| containing -// (2*i+1)*p, for i from 0 to |len|. It returns one on success and -// zero on error. -static int compute_precomp(const EC_GROUP *group, EC_POINT **out, - const EC_POINT *p, size_t len, BN_CTX *ctx) { - out[0] = EC_POINT_new(group); - if (out[0] == NULL || - !EC_POINT_copy(out[0], p)) { - return 0; - } - - int ret = 0; - EC_POINT *two_p = EC_POINT_new(group); - if (two_p == NULL || - !EC_POINT_dbl(group, two_p, p, ctx)) { - goto err; - } - - for (size_t i = 1; i < len; i++) { - out[i] = EC_POINT_new(group); - if (out[i] == NULL || - !EC_POINT_add(group, out[i], out[i - 1], two_p, ctx)) { - goto err; - } - } - - ret = 1; - -err: - EC_POINT_free(two_p); - return ret; -} - -static int lookup_precomp(const EC_GROUP *group, EC_POINT *out, - EC_POINT *const *precomp, int digit, BN_CTX *ctx) { - if (digit < 0) { - digit = -digit; - return EC_POINT_copy(out, precomp[digit >> 1]) && - EC_POINT_invert(group, out, ctx); - } - - return EC_POINT_copy(out, precomp[digit >> 1]); -} - -int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - EC_POINT *precomp_storage[2 * (1 << (EC_WNAF_MAX_WINDOW_BITS - 1))] = {NULL}; - EC_POINT **g_precomp = NULL, **p_precomp = NULL; - int8_t g_wNAF[EC_MAX_SCALAR_BYTES * 8 + 1]; - int8_t p_wNAF[EC_MAX_SCALAR_BYTES * 8 + 1]; - EC_POINT *tmp = NULL; - int ret = 0; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } - } - - size_t bits = BN_num_bits(&group->order); - size_t wsize = window_bits_for_scalar_size(bits); - size_t wNAF_len = bits + 1; - size_t precomp_len = (size_t)1 << (wsize - 1); - - OPENSSL_COMPILE_ASSERT( - OPENSSL_ARRAY_SIZE(g_wNAF) == OPENSSL_ARRAY_SIZE(p_wNAF), - g_wNAF_and_p_wNAF_are_different_sizes); - - if (wNAF_len > OPENSSL_ARRAY_SIZE(g_wNAF) || - 2 * precomp_len > OPENSSL_ARRAY_SIZE(precomp_storage)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - - // TODO(davidben): |mul_public| is for ECDSA verification which can assume - // non-NULL inputs, but this code is also used for |mul| which cannot. It's - // not constant-time, so replace the generic |mul| and remove the NULL checks. - size_t total_precomp = 0; - if (g_scalar != NULL) { - const EC_POINT *g = EC_GROUP_get0_generator(group); - if (g == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_UNDEFINED_GENERATOR); - goto err; - } - g_precomp = precomp_storage + total_precomp; - total_precomp += precomp_len; - if (!ec_compute_wNAF(group, g_wNAF, g_scalar, bits, wsize) || - !compute_precomp(group, g_precomp, g, precomp_len, ctx)) { - goto err; - } - } - - if (p_scalar != NULL) { - p_precomp = precomp_storage + total_precomp; - total_precomp += precomp_len; - if (!ec_compute_wNAF(group, p_wNAF, p_scalar, bits, wsize) || - !compute_precomp(group, p_precomp, p, precomp_len, ctx)) { - goto err; - } - } - - tmp = EC_POINT_new(group); - if (tmp == NULL || - // |window_bits_for_scalar_size| assumes we do this step. - !EC_POINTs_make_affine(group, total_precomp, precomp_storage, ctx)) { - goto err; - } - - int r_is_at_infinity = 1; - for (size_t k = wNAF_len - 1; k < wNAF_len; k--) { - if (!r_is_at_infinity && !EC_POINT_dbl(group, r, r, ctx)) { - goto err; - } - - if (g_scalar != NULL) { - if (g_wNAF[k] != 0) { - if (!lookup_precomp(group, tmp, g_precomp, g_wNAF[k], ctx)) { - goto err; - } - if (r_is_at_infinity) { - if (!EC_POINT_copy(r, tmp)) { - goto err; - } - r_is_at_infinity = 0; - } else if (!EC_POINT_add(group, r, r, tmp, ctx)) { - goto err; - } - } - } - - if (p_scalar != NULL) { - if (p_wNAF[k] != 0) { - if (!lookup_precomp(group, tmp, p_precomp, p_wNAF[k], ctx)) { - goto err; - } - if (r_is_at_infinity) { - if (!EC_POINT_copy(r, tmp)) { - goto err; - } - r_is_at_infinity = 0; - } else if (!EC_POINT_add(group, r, r, tmp, ctx)) { - goto err; - } - } - } - } - - if (r_is_at_infinity && - !EC_POINT_set_to_infinity(group, r)) { - goto err; - } - - ret = 1; - -err: - BN_CTX_free(new_ctx); - EC_POINT_free(tmp); - OPENSSL_cleanse(&g_wNAF, sizeof(g_wNAF)); - OPENSSL_cleanse(&p_wNAF, sizeof(p_wNAF)); - for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(precomp_storage); i++) { - EC_POINT_free(precomp_storage[i]); - } - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/wnaf.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/wnaf.c.grpc_back deleted file mode 100644 index 7bc0bc7bc..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/wnaf.c.grpc_back +++ /dev/null @@ -1,354 +0,0 @@ -/* Originally written by Bodo Moeller for the OpenSSL project. - * ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * - * Portions of the attached software ("Contribution") are developed by - * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. - * - * The Contribution is licensed pursuant to the OpenSSL open source - * license provided above. - * - * The elliptic curve binary polynomial software is originally written by - * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems - * Laboratories. */ - -#include - -#include - -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../bn/internal.h" -#include "../../internal.h" - - -// This file implements the wNAF-based interleaving multi-exponentiation method -// at: -// http://link.springer.com/chapter/10.1007%2F3-540-45537-X_13 -// http://www.bmoeller.de/pdf/TI-01-08.multiexp.pdf - -int ec_compute_wNAF(const EC_GROUP *group, int8_t *out, const EC_SCALAR *scalar, - size_t bits, int w) { - // 'int8_t' can represent integers with absolute values less than 2^7. - if (w <= 0 || w > 7 || bits == 0) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - int bit = 1 << w; // at most 128 - int next_bit = bit << 1; // at most 256 - int mask = next_bit - 1; // at most 255 - - int window_val = scalar->words[0] & mask; - size_t j = 0; - // If j+w+1 >= bits, window_val will not increase. - while (window_val != 0 || j + w + 1 < bits) { - int digit = 0; - - // 0 <= window_val <= 2^(w+1) - - if (window_val & 1) { - // 0 < window_val < 2^(w+1) - - if (window_val & bit) { - digit = window_val - next_bit; // -2^w < digit < 0 - -#if 1 // modified wNAF - if (j + w + 1 >= bits) { - // special case for generating modified wNAFs: - // no new bits will be added into window_val, - // so using a positive digit here will decrease - // the total length of the representation - - digit = window_val & (mask >> 1); // 0 < digit < 2^w - } -#endif - } else { - digit = window_val; // 0 < digit < 2^w - } - - if (digit <= -bit || digit >= bit || !(digit & 1)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - - window_val -= digit; - - // Now window_val is 0 or 2^(w+1) in standard wNAF generation; - // for modified window NAFs, it may also be 2^w. - if (window_val != 0 && window_val != next_bit && window_val != bit) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - out[j++] = digit; - - window_val >>= 1; - window_val += - bit * bn_is_bit_set_words(scalar->words, group->order.width, j + w); - - if (window_val > next_bit) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - // Fill the rest of the wNAF with zeros. - if (j > bits + 1) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - return 0; - } - for (size_t i = j; i < bits + 1; i++) { - out[i] = 0; - } - - return 1; -} - -// TODO: table should be optimised for the wNAF-based implementation, -// sometimes smaller windows will give better performance -// (thus the boundaries should be increased) -static size_t window_bits_for_scalar_size(size_t b) { - if (b >= 300) { - return 4; - } - - if (b >= 70) { - return 3; - } - - if (b >= 20) { - return 2; - } - - return 1; -} - -// EC_WNAF_MAX_WINDOW_BITS is the largest value returned by -// |window_bits_for_scalar_size|. -#define EC_WNAF_MAX_WINDOW_BITS 4 - -// compute_precomp sets |out[i]| to a newly-allocated |EC_POINT| containing -// (2*i+1)*p, for i from 0 to |len|. It returns one on success and -// zero on error. -static int compute_precomp(const EC_GROUP *group, EC_POINT **out, - const EC_POINT *p, size_t len, BN_CTX *ctx) { - out[0] = EC_POINT_new(group); - if (out[0] == NULL || - !EC_POINT_copy(out[0], p)) { - return 0; - } - - int ret = 0; - EC_POINT *two_p = EC_POINT_new(group); - if (two_p == NULL || - !EC_POINT_dbl(group, two_p, p, ctx)) { - goto err; - } - - for (size_t i = 1; i < len; i++) { - out[i] = EC_POINT_new(group); - if (out[i] == NULL || - !EC_POINT_add(group, out[i], out[i - 1], two_p, ctx)) { - goto err; - } - } - - ret = 1; - -err: - EC_POINT_free(two_p); - return ret; -} - -static int lookup_precomp(const EC_GROUP *group, EC_POINT *out, - EC_POINT *const *precomp, int digit, BN_CTX *ctx) { - if (digit < 0) { - digit = -digit; - return EC_POINT_copy(out, precomp[digit >> 1]) && - EC_POINT_invert(group, out, ctx); - } - - return EC_POINT_copy(out, precomp[digit >> 1]); -} - -int ec_wNAF_mul(const EC_GROUP *group, EC_POINT *r, const EC_SCALAR *g_scalar, - const EC_POINT *p, const EC_SCALAR *p_scalar, BN_CTX *ctx) { - BN_CTX *new_ctx = NULL; - EC_POINT *precomp_storage[2 * (1 << (EC_WNAF_MAX_WINDOW_BITS - 1))] = {NULL}; - EC_POINT **g_precomp = NULL, **p_precomp = NULL; - int8_t g_wNAF[EC_MAX_SCALAR_BYTES * 8 + 1]; - int8_t p_wNAF[EC_MAX_SCALAR_BYTES * 8 + 1]; - EC_POINT *tmp = NULL; - int ret = 0; - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } - } - - size_t bits = BN_num_bits(&group->order); - size_t wsize = window_bits_for_scalar_size(bits); - size_t wNAF_len = bits + 1; - size_t precomp_len = (size_t)1 << (wsize - 1); - - OPENSSL_COMPILE_ASSERT( - OPENSSL_ARRAY_SIZE(g_wNAF) == OPENSSL_ARRAY_SIZE(p_wNAF), - g_wNAF_and_p_wNAF_are_different_sizes); - - if (wNAF_len > OPENSSL_ARRAY_SIZE(g_wNAF) || - 2 * precomp_len > OPENSSL_ARRAY_SIZE(precomp_storage)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - - // TODO(davidben): |mul_public| is for ECDSA verification which can assume - // non-NULL inputs, but this code is also used for |mul| which cannot. It's - // not constant-time, so replace the generic |mul| and remove the NULL checks. - size_t total_precomp = 0; - if (g_scalar != NULL) { - const EC_POINT *g = EC_GROUP_get0_generator(group); - if (g == NULL) { - OPENSSL_PUT_ERROR(EC, EC_R_UNDEFINED_GENERATOR); - goto err; - } - g_precomp = precomp_storage + total_precomp; - total_precomp += precomp_len; - if (!ec_compute_wNAF(group, g_wNAF, g_scalar, bits, wsize) || - !compute_precomp(group, g_precomp, g, precomp_len, ctx)) { - goto err; - } - } - - if (p_scalar != NULL) { - p_precomp = precomp_storage + total_precomp; - total_precomp += precomp_len; - if (!ec_compute_wNAF(group, p_wNAF, p_scalar, bits, wsize) || - !compute_precomp(group, p_precomp, p, precomp_len, ctx)) { - goto err; - } - } - - tmp = EC_POINT_new(group); - if (tmp == NULL || - // |window_bits_for_scalar_size| assumes we do this step. - !EC_POINTs_make_affine(group, total_precomp, precomp_storage, ctx)) { - goto err; - } - - int r_is_at_infinity = 1; - for (size_t k = wNAF_len - 1; k < wNAF_len; k--) { - if (!r_is_at_infinity && !EC_POINT_dbl(group, r, r, ctx)) { - goto err; - } - - if (g_scalar != NULL) { - if (g_wNAF[k] != 0) { - if (!lookup_precomp(group, tmp, g_precomp, g_wNAF[k], ctx)) { - goto err; - } - if (r_is_at_infinity) { - if (!EC_POINT_copy(r, tmp)) { - goto err; - } - r_is_at_infinity = 0; - } else if (!EC_POINT_add(group, r, r, tmp, ctx)) { - goto err; - } - } - } - - if (p_scalar != NULL) { - if (p_wNAF[k] != 0) { - if (!lookup_precomp(group, tmp, p_precomp, p_wNAF[k], ctx)) { - goto err; - } - if (r_is_at_infinity) { - if (!EC_POINT_copy(r, tmp)) { - goto err; - } - r_is_at_infinity = 0; - } else if (!EC_POINT_add(group, r, r, tmp, ctx)) { - goto err; - } - } - } - } - - if (r_is_at_infinity && - !EC_POINT_set_to_infinity(group, r)) { - goto err; - } - - ret = 1; - -err: - BN_CTX_free(new_ctx); - EC_POINT_free(tmp); - OPENSSL_cleanse(&g_wNAF, sizeof(g_wNAF)); - OPENSSL_cleanse(&p_wNAF, sizeof(p_wNAF)); - for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(precomp_storage); i++) { - EC_POINT_free(precomp_storage[i]); - } - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ecdsa/ecdsa.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ecdsa/ecdsa.c deleted file mode 100644 index eed17187e..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ecdsa/ecdsa.c +++ /dev/null @@ -1,458 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "../bn/internal.h" -#include "../ec/internal.h" -#include "../../internal.h" - - -// EC_LOOSE_SCALAR is like |EC_SCALAR| but is bounded by 2^|BN_num_bits(order)| -// rather than |order|. -typedef union { - // bytes is the representation of the scalar in little-endian order. - uint8_t bytes[EC_MAX_SCALAR_BYTES]; - BN_ULONG words[EC_MAX_SCALAR_WORDS]; -} EC_LOOSE_SCALAR; - -static void scalar_add_loose(const EC_GROUP *group, EC_LOOSE_SCALAR *r, - const EC_LOOSE_SCALAR *a, const EC_SCALAR *b) { - // Add and subtract one copy of |order| if necessary. We have: - // |a| + |b| < 2^BN_num_bits(order) + order - // so this leaves |r| < 2^BN_num_bits(order). - const BIGNUM *order = &group->order; - BN_ULONG carry = bn_add_words(r->words, a->words, b->words, order->width); - EC_LOOSE_SCALAR tmp; - BN_ULONG v = - bn_sub_words(tmp.words, r->words, order->d, order->width) - carry; - bn_select_words(r->words, 0u - v, r->words /* tmp < 0 */, - tmp.words /* tmp >= 0 */, order->width); -} - -static int scalar_mod_mul_montgomery(const EC_GROUP *group, EC_SCALAR *r, - const EC_SCALAR *a, const EC_SCALAR *b) { - const BIGNUM *order = &group->order; - return bn_mod_mul_montgomery_small(r->words, order->width, a->words, - order->width, b->words, order->width, - group->order_mont); -} - -static int scalar_mod_mul_montgomery_loose(const EC_GROUP *group, EC_SCALAR *r, - const EC_LOOSE_SCALAR *a, - const EC_SCALAR *b) { - // Although |a| is loose, |bn_mod_mul_montgomery_small| only requires the - // product not exceed R * |order|. |b| is fully reduced and |a| < - // 2^BN_num_bits(order) <= R, so this holds. - const BIGNUM *order = &group->order; - return bn_mod_mul_montgomery_small(r->words, order->width, a->words, - order->width, b->words, order->width, - group->order_mont); -} - -// digest_to_scalar interprets |digest_len| bytes from |digest| as a scalar for -// ECDSA. Note this value is not fully reduced modulo the order, only the -// correct number of bits. -static void digest_to_scalar(const EC_GROUP *group, EC_LOOSE_SCALAR *out, - const uint8_t *digest, size_t digest_len) { - const BIGNUM *order = &group->order; - size_t num_bits = BN_num_bits(order); - // Need to truncate digest if it is too long: first truncate whole bytes. - if (8 * digest_len > num_bits) { - digest_len = (num_bits + 7) / 8; - } - OPENSSL_memset(out, 0, sizeof(EC_SCALAR)); - for (size_t i = 0; i < digest_len; i++) { - out->bytes[i] = digest[digest_len - 1 - i]; - } - - // If still too long truncate remaining bits with a shift - if (8 * digest_len > num_bits) { - size_t shift = 8 - (num_bits & 0x7); - for (int i = 0; i < order->width - 1; i++) { - out->words[i] = - (out->words[i] >> shift) | (out->words[i + 1] << (BN_BITS2 - shift)); - } - out->words[order->width - 1] >>= shift; - } -} - -// field_element_to_scalar reduces |r| modulo |group->order|. |r| must -// previously have been reduced modulo |group->field|. -static int field_element_to_scalar(const EC_GROUP *group, BIGNUM *r) { - // We must have p < 2×order, assuming p is not tiny (p >= 17). Thus rather we - // can reduce by performing at most one subtraction. - // - // Proof: We only work with prime order curves, so the number of points on - // the curve is the order. Thus Hasse's theorem gives: - // - // |order - (p + 1)| <= 2×sqrt(p) - // p + 1 - order <= 2×sqrt(p) - // p + 1 - 2×sqrt(p) <= order - // p + 1 - 2×(p/4) < order (p/4 > sqrt(p) for p >= 17) - // p/2 < p/2 + 1 < order - // p < 2×order - // - // Additionally, one can manually check this property for built-in curves. It - // is enforced for legacy custom curves in |EC_GROUP_set_generator|. - // - // TODO(davidben): Introduce |EC_FIELD_ELEMENT|, make this a function from - // |EC_FIELD_ELEMENT| to |EC_SCALAR|, and cut out the |BIGNUM|. Does this need - // to be constant-time for signing? |r| is the x-coordinate for kG, which is - // public unless k was rerolled because |s| was zero. - assert(!BN_is_negative(r)); - assert(BN_cmp(r, &group->field) < 0); - if (BN_cmp(r, &group->order) >= 0 && - !BN_sub(r, r, &group->order)) { - return 0; - } - assert(!BN_is_negative(r)); - assert(BN_cmp(r, &group->order) < 0); - return 1; -} - -ECDSA_SIG *ECDSA_SIG_new(void) { - ECDSA_SIG *sig = OPENSSL_malloc(sizeof(ECDSA_SIG)); - if (sig == NULL) { - return NULL; - } - sig->r = BN_new(); - sig->s = BN_new(); - if (sig->r == NULL || sig->s == NULL) { - ECDSA_SIG_free(sig); - return NULL; - } - return sig; -} - -void ECDSA_SIG_free(ECDSA_SIG *sig) { - if (sig == NULL) { - return; - } - - BN_free(sig->r); - BN_free(sig->s); - OPENSSL_free(sig); -} - -void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **out_r, - const BIGNUM **out_s) { - if (out_r != NULL) { - *out_r = sig->r; - } - if (out_s != NULL) { - *out_s = sig->s; - } -} - -int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { - if (r == NULL || s == NULL) { - return 0; - } - BN_free(sig->r); - BN_free(sig->s); - sig->r = r; - sig->s = s; - return 1; -} - -int ECDSA_do_verify(const uint8_t *digest, size_t digest_len, - const ECDSA_SIG *sig, const EC_KEY *eckey) { - const EC_GROUP *group = EC_KEY_get0_group(eckey); - const EC_POINT *pub_key = EC_KEY_get0_public_key(eckey); - if (group == NULL || pub_key == NULL || sig == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_MISSING_PARAMETERS); - return 0; - } - - BN_CTX *ctx = BN_CTX_new(); - if (!ctx) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - return 0; - } - int ret = 0; - EC_POINT *point = NULL; - BN_CTX_start(ctx); - BIGNUM *X = BN_CTX_get(ctx); - if (X == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB); - goto err; - } - - EC_SCALAR r, s, u1, u2, s_inv_mont; - EC_LOOSE_SCALAR m; - const BIGNUM *order = EC_GROUP_get0_order(group); - if (BN_is_zero(sig->r) || - !ec_bignum_to_scalar(group, &r, sig->r) || - BN_is_zero(sig->s) || - !ec_bignum_to_scalar(group, &s, sig->s)) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); - goto err; - } - // s_inv_mont = s^-1 mod order. We convert the result to Montgomery form for - // the products below. - int no_inverse; - if (!BN_mod_inverse_odd(X, &no_inverse, sig->s, order, ctx) || - // TODO(davidben): Add a words version of |BN_mod_inverse_odd| and write - // into |s_inv_mont| directly. - !ec_bignum_to_scalar_unchecked(group, &s_inv_mont, X) || - !bn_to_montgomery_small(s_inv_mont.words, order->width, s_inv_mont.words, - order->width, group->order_mont)) { - goto err; - } - // u1 = m * s^-1 mod order - // u2 = r * s^-1 mod order - // - // |s_inv_mont| is in Montgomery form while |m| and |r| are not, so |u1| and - // |u2| will be taken out of Montgomery form, as desired. - digest_to_scalar(group, &m, digest, digest_len); - if (!scalar_mod_mul_montgomery_loose(group, &u1, &m, &s_inv_mont) || - !scalar_mod_mul_montgomery(group, &u2, &r, &s_inv_mont)) { - goto err; - } - - point = EC_POINT_new(group); - if (point == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - goto err; - } - if (!ec_point_mul_scalar_public(group, point, &u1, pub_key, &u2, ctx)) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); - goto err; - } - if (!EC_POINT_get_affine_coordinates_GFp(group, point, X, NULL, ctx)) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); - goto err; - } - if (!field_element_to_scalar(group, X)) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB); - goto err; - } - // The signature is correct iff |X| is equal to |sig->r|. - if (BN_ucmp(X, sig->r) != 0) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); - goto err; - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(ctx); - EC_POINT_free(point); - return ret; -} - -static int ecdsa_sign_setup(const EC_KEY *eckey, BN_CTX *ctx, - EC_SCALAR *out_kinv_mont, BIGNUM **rp, - const uint8_t *digest, size_t digest_len, - const EC_SCALAR *priv_key) { - EC_POINT *tmp_point = NULL; - int ret = 0; - EC_SCALAR k; - BIGNUM *r = BN_new(); // this value is later returned in *rp - if (r == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - goto err; - } - const EC_GROUP *group = EC_KEY_get0_group(eckey); - const BIGNUM *order = EC_GROUP_get0_order(group); - tmp_point = EC_POINT_new(group); - if (tmp_point == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); - goto err; - } - - // Check that the size of the group order is FIPS compliant (FIPS 186-4 - // B.5.2). - if (BN_num_bits(order) < 160) { - OPENSSL_PUT_ERROR(ECDSA, EC_R_INVALID_GROUP_ORDER); - goto err; - } - - do { - // Include the private key and message digest in the k generation. - if (eckey->fixed_k != NULL) { - if (!ec_bignum_to_scalar(group, &k, eckey->fixed_k)) { - goto err; - } - } else { - // Pass a SHA512 hash of the private key and digest as additional data - // into the RBG. This is a hardening measure against entropy failure. - OPENSSL_COMPILE_ASSERT(SHA512_DIGEST_LENGTH >= 32, - additional_data_is_too_large_for_sha512); - SHA512_CTX sha; - uint8_t additional_data[SHA512_DIGEST_LENGTH]; - SHA512_Init(&sha); - SHA512_Update(&sha, priv_key->words, order->width * sizeof(BN_ULONG)); - SHA512_Update(&sha, digest, digest_len); - SHA512_Final(additional_data, &sha); - if (!ec_random_nonzero_scalar(group, &k, additional_data)) { - goto err; - } - } - - // Compute k^-1. We leave it in the Montgomery domain as an optimization for - // later operations. - if (!bn_to_montgomery_small(out_kinv_mont->words, order->width, k.words, - order->width, group->order_mont) || - !bn_mod_inverse_prime_mont_small(out_kinv_mont->words, order->width, - out_kinv_mont->words, order->width, - group->order_mont)) { - goto err; - } - - // Compute r, the x-coordinate of generator * k. - if (!ec_point_mul_scalar(group, tmp_point, &k, NULL, NULL, ctx) || - !EC_POINT_get_affine_coordinates_GFp(group, tmp_point, r, NULL, - ctx)) { - goto err; - } - - if (!field_element_to_scalar(group, r)) { - goto err; - } - } while (BN_is_zero(r)); - - BN_clear_free(*rp); - *rp = r; - r = NULL; - ret = 1; - -err: - OPENSSL_cleanse(&k, sizeof(k)); - BN_clear_free(r); - EC_POINT_free(tmp_point); - return ret; -} - -ECDSA_SIG *ECDSA_do_sign(const uint8_t *digest, size_t digest_len, - const EC_KEY *eckey) { - if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NOT_IMPLEMENTED); - return NULL; - } - - const EC_GROUP *group = EC_KEY_get0_group(eckey); - if (group == NULL || eckey->priv_key == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_PASSED_NULL_PARAMETER); - return NULL; - } - const BIGNUM *order = EC_GROUP_get0_order(group); - const EC_SCALAR *priv_key = &eckey->priv_key->scalar; - - int ok = 0; - ECDSA_SIG *ret = ECDSA_SIG_new(); - BN_CTX *ctx = BN_CTX_new(); - EC_SCALAR kinv_mont, r_mont, s; - EC_LOOSE_SCALAR m, tmp; - if (ret == NULL || ctx == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - return NULL; - } - - digest_to_scalar(group, &m, digest, digest_len); - for (;;) { - if (!ecdsa_sign_setup(eckey, ctx, &kinv_mont, &ret->r, digest, digest_len, - priv_key)) { - goto err; - } - - // Compute priv_key * r (mod order). Note if only one parameter is in the - // Montgomery domain, |scalar_mod_mul_montgomery| will compute the answer in - // the normal domain. - if (!ec_bignum_to_scalar(group, &r_mont, ret->r) || - !bn_to_montgomery_small(r_mont.words, order->width, r_mont.words, - order->width, group->order_mont) || - !scalar_mod_mul_montgomery(group, &s, priv_key, &r_mont)) { - goto err; - } - - // Compute tmp = m + priv_key * r. - scalar_add_loose(group, &tmp, &m, &s); - - // Finally, multiply s by k^-1. That was retained in Montgomery form, so the - // same technique as the previous multiplication works. - if (!scalar_mod_mul_montgomery_loose(group, &s, &tmp, &kinv_mont) || - !bn_set_words(ret->s, s.words, order->width)) { - goto err; - } - if (!BN_is_zero(ret->s)) { - // s != 0 => we have a valid signature - break; - } - } - - ok = 1; - -err: - if (!ok) { - ECDSA_SIG_free(ret); - ret = NULL; - } - BN_CTX_free(ctx); - OPENSSL_cleanse(&kinv_mont, sizeof(kinv_mont)); - OPENSSL_cleanse(&r_mont, sizeof(r_mont)); - OPENSSL_cleanse(&s, sizeof(s)); - OPENSSL_cleanse(&tmp, sizeof(tmp)); - OPENSSL_cleanse(&m, sizeof(m)); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back deleted file mode 100644 index 1d08123ba..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back +++ /dev/null @@ -1,458 +0,0 @@ -/* ==================================================================== - * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "../bn/internal.h" -#include "../ec/internal.h" -#include "../../internal.h" - - -// EC_LOOSE_SCALAR is like |EC_SCALAR| but is bounded by 2^|BN_num_bits(order)| -// rather than |order|. -typedef union { - // bytes is the representation of the scalar in little-endian order. - uint8_t bytes[EC_MAX_SCALAR_BYTES]; - BN_ULONG words[EC_MAX_SCALAR_WORDS]; -} EC_LOOSE_SCALAR; - -static void scalar_add_loose(const EC_GROUP *group, EC_LOOSE_SCALAR *r, - const EC_LOOSE_SCALAR *a, const EC_SCALAR *b) { - // Add and subtract one copy of |order| if necessary. We have: - // |a| + |b| < 2^BN_num_bits(order) + order - // so this leaves |r| < 2^BN_num_bits(order). - const BIGNUM *order = &group->order; - BN_ULONG carry = bn_add_words(r->words, a->words, b->words, order->width); - EC_LOOSE_SCALAR tmp; - BN_ULONG v = - bn_sub_words(tmp.words, r->words, order->d, order->width) - carry; - bn_select_words(r->words, 0u - v, r->words /* tmp < 0 */, - tmp.words /* tmp >= 0 */, order->width); -} - -static int scalar_mod_mul_montgomery(const EC_GROUP *group, EC_SCALAR *r, - const EC_SCALAR *a, const EC_SCALAR *b) { - const BIGNUM *order = &group->order; - return bn_mod_mul_montgomery_small(r->words, order->width, a->words, - order->width, b->words, order->width, - group->order_mont); -} - -static int scalar_mod_mul_montgomery_loose(const EC_GROUP *group, EC_SCALAR *r, - const EC_LOOSE_SCALAR *a, - const EC_SCALAR *b) { - // Although |a| is loose, |bn_mod_mul_montgomery_small| only requires the - // product not exceed R * |order|. |b| is fully reduced and |a| < - // 2^BN_num_bits(order) <= R, so this holds. - const BIGNUM *order = &group->order; - return bn_mod_mul_montgomery_small(r->words, order->width, a->words, - order->width, b->words, order->width, - group->order_mont); -} - -// digest_to_scalar interprets |digest_len| bytes from |digest| as a scalar for -// ECDSA. Note this value is not fully reduced modulo the order, only the -// correct number of bits. -static void digest_to_scalar(const EC_GROUP *group, EC_LOOSE_SCALAR *out, - const uint8_t *digest, size_t digest_len) { - const BIGNUM *order = &group->order; - size_t num_bits = BN_num_bits(order); - // Need to truncate digest if it is too long: first truncate whole bytes. - if (8 * digest_len > num_bits) { - digest_len = (num_bits + 7) / 8; - } - OPENSSL_memset(out, 0, sizeof(EC_SCALAR)); - for (size_t i = 0; i < digest_len; i++) { - out->bytes[i] = digest[digest_len - 1 - i]; - } - - // If still too long truncate remaining bits with a shift - if (8 * digest_len > num_bits) { - size_t shift = 8 - (num_bits & 0x7); - for (int i = 0; i < order->width - 1; i++) { - out->words[i] = - (out->words[i] >> shift) | (out->words[i + 1] << (BN_BITS2 - shift)); - } - out->words[order->width - 1] >>= shift; - } -} - -// field_element_to_scalar reduces |r| modulo |group->order|. |r| must -// previously have been reduced modulo |group->field|. -static int field_element_to_scalar(const EC_GROUP *group, BIGNUM *r) { - // We must have p < 2×order, assuming p is not tiny (p >= 17). Thus rather we - // can reduce by performing at most one subtraction. - // - // Proof: We only work with prime order curves, so the number of points on - // the curve is the order. Thus Hasse's theorem gives: - // - // |order - (p + 1)| <= 2×sqrt(p) - // p + 1 - order <= 2×sqrt(p) - // p + 1 - 2×sqrt(p) <= order - // p + 1 - 2×(p/4) < order (p/4 > sqrt(p) for p >= 17) - // p/2 < p/2 + 1 < order - // p < 2×order - // - // Additionally, one can manually check this property for built-in curves. It - // is enforced for legacy custom curves in |EC_GROUP_set_generator|. - // - // TODO(davidben): Introduce |EC_FIELD_ELEMENT|, make this a function from - // |EC_FIELD_ELEMENT| to |EC_SCALAR|, and cut out the |BIGNUM|. Does this need - // to be constant-time for signing? |r| is the x-coordinate for kG, which is - // public unless k was rerolled because |s| was zero. - assert(!BN_is_negative(r)); - assert(BN_cmp(r, &group->field) < 0); - if (BN_cmp(r, &group->order) >= 0 && - !BN_sub(r, r, &group->order)) { - return 0; - } - assert(!BN_is_negative(r)); - assert(BN_cmp(r, &group->order) < 0); - return 1; -} - -ECDSA_SIG *ECDSA_SIG_new(void) { - ECDSA_SIG *sig = OPENSSL_malloc(sizeof(ECDSA_SIG)); - if (sig == NULL) { - return NULL; - } - sig->r = BN_new(); - sig->s = BN_new(); - if (sig->r == NULL || sig->s == NULL) { - ECDSA_SIG_free(sig); - return NULL; - } - return sig; -} - -void ECDSA_SIG_free(ECDSA_SIG *sig) { - if (sig == NULL) { - return; - } - - BN_free(sig->r); - BN_free(sig->s); - OPENSSL_free(sig); -} - -void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **out_r, - const BIGNUM **out_s) { - if (out_r != NULL) { - *out_r = sig->r; - } - if (out_s != NULL) { - *out_s = sig->s; - } -} - -int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { - if (r == NULL || s == NULL) { - return 0; - } - BN_free(sig->r); - BN_free(sig->s); - sig->r = r; - sig->s = s; - return 1; -} - -int ECDSA_do_verify(const uint8_t *digest, size_t digest_len, - const ECDSA_SIG *sig, const EC_KEY *eckey) { - const EC_GROUP *group = EC_KEY_get0_group(eckey); - const EC_POINT *pub_key = EC_KEY_get0_public_key(eckey); - if (group == NULL || pub_key == NULL || sig == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_MISSING_PARAMETERS); - return 0; - } - - BN_CTX *ctx = BN_CTX_new(); - if (!ctx) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - return 0; - } - int ret = 0; - EC_POINT *point = NULL; - BN_CTX_start(ctx); - BIGNUM *X = BN_CTX_get(ctx); - if (X == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB); - goto err; - } - - EC_SCALAR r, s, u1, u2, s_inv_mont; - EC_LOOSE_SCALAR m; - const BIGNUM *order = EC_GROUP_get0_order(group); - if (BN_is_zero(sig->r) || - !ec_bignum_to_scalar(group, &r, sig->r) || - BN_is_zero(sig->s) || - !ec_bignum_to_scalar(group, &s, sig->s)) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); - goto err; - } - // s_inv_mont = s^-1 mod order. We convert the result to Montgomery form for - // the products below. - int no_inverse; - if (!BN_mod_inverse_odd(X, &no_inverse, sig->s, order, ctx) || - // TODO(davidben): Add a words version of |BN_mod_inverse_odd| and write - // into |s_inv_mont| directly. - !ec_bignum_to_scalar_unchecked(group, &s_inv_mont, X) || - !bn_to_montgomery_small(s_inv_mont.words, order->width, s_inv_mont.words, - order->width, group->order_mont)) { - goto err; - } - // u1 = m * s^-1 mod order - // u2 = r * s^-1 mod order - // - // |s_inv_mont| is in Montgomery form while |m| and |r| are not, so |u1| and - // |u2| will be taken out of Montgomery form, as desired. - digest_to_scalar(group, &m, digest, digest_len); - if (!scalar_mod_mul_montgomery_loose(group, &u1, &m, &s_inv_mont) || - !scalar_mod_mul_montgomery(group, &u2, &r, &s_inv_mont)) { - goto err; - } - - point = EC_POINT_new(group); - if (point == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - goto err; - } - if (!ec_point_mul_scalar_public(group, point, &u1, pub_key, &u2, ctx)) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); - goto err; - } - if (!EC_POINT_get_affine_coordinates_GFp(group, point, X, NULL, ctx)) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); - goto err; - } - if (!field_element_to_scalar(group, X)) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_BN_LIB); - goto err; - } - // The signature is correct iff |X| is equal to |sig->r|. - if (BN_ucmp(X, sig->r) != 0) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); - goto err; - } - - ret = 1; - -err: - BN_CTX_end(ctx); - BN_CTX_free(ctx); - EC_POINT_free(point); - return ret; -} - -static int ecdsa_sign_setup(const EC_KEY *eckey, BN_CTX *ctx, - EC_SCALAR *out_kinv_mont, BIGNUM **rp, - const uint8_t *digest, size_t digest_len, - const EC_SCALAR *priv_key) { - EC_POINT *tmp_point = NULL; - int ret = 0; - EC_SCALAR k; - BIGNUM *r = BN_new(); // this value is later returned in *rp - if (r == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - goto err; - } - const EC_GROUP *group = EC_KEY_get0_group(eckey); - const BIGNUM *order = EC_GROUP_get0_order(group); - tmp_point = EC_POINT_new(group); - if (tmp_point == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); - goto err; - } - - // Check that the size of the group order is FIPS compliant (FIPS 186-4 - // B.5.2). - if (BN_num_bits(order) < 160) { - OPENSSL_PUT_ERROR(ECDSA, EC_R_INVALID_GROUP_ORDER); - goto err; - } - - do { - // Include the private key and message digest in the k generation. - if (eckey->fixed_k != NULL) { - if (!ec_bignum_to_scalar(group, &k, eckey->fixed_k)) { - goto err; - } - } else { - // Pass a SHA512 hash of the private key and digest as additional data - // into the RBG. This is a hardening measure against entropy failure. - OPENSSL_COMPILE_ASSERT(SHA512_DIGEST_LENGTH >= 32, - additional_data_is_too_large_for_sha512); - SHA512_CTX sha; - uint8_t additional_data[SHA512_DIGEST_LENGTH]; - SHA512_Init(&sha); - SHA512_Update(&sha, priv_key->words, order->width * sizeof(BN_ULONG)); - SHA512_Update(&sha, digest, digest_len); - SHA512_Final(additional_data, &sha); - if (!ec_random_nonzero_scalar(group, &k, additional_data)) { - goto err; - } - } - - // Compute k^-1. We leave it in the Montgomery domain as an optimization for - // later operations. - if (!bn_to_montgomery_small(out_kinv_mont->words, order->width, k.words, - order->width, group->order_mont) || - !bn_mod_inverse_prime_mont_small(out_kinv_mont->words, order->width, - out_kinv_mont->words, order->width, - group->order_mont)) { - goto err; - } - - // Compute r, the x-coordinate of generator * k. - if (!ec_point_mul_scalar(group, tmp_point, &k, NULL, NULL, ctx) || - !EC_POINT_get_affine_coordinates_GFp(group, tmp_point, r, NULL, - ctx)) { - goto err; - } - - if (!field_element_to_scalar(group, r)) { - goto err; - } - } while (BN_is_zero(r)); - - BN_clear_free(*rp); - *rp = r; - r = NULL; - ret = 1; - -err: - OPENSSL_cleanse(&k, sizeof(k)); - BN_clear_free(r); - EC_POINT_free(tmp_point); - return ret; -} - -ECDSA_SIG *ECDSA_do_sign(const uint8_t *digest, size_t digest_len, - const EC_KEY *eckey) { - if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NOT_IMPLEMENTED); - return NULL; - } - - const EC_GROUP *group = EC_KEY_get0_group(eckey); - if (group == NULL || eckey->priv_key == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_PASSED_NULL_PARAMETER); - return NULL; - } - const BIGNUM *order = EC_GROUP_get0_order(group); - const EC_SCALAR *priv_key = &eckey->priv_key->scalar; - - int ok = 0; - ECDSA_SIG *ret = ECDSA_SIG_new(); - BN_CTX *ctx = BN_CTX_new(); - EC_SCALAR kinv_mont, r_mont, s; - EC_LOOSE_SCALAR m, tmp; - if (ret == NULL || ctx == NULL) { - OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); - return NULL; - } - - digest_to_scalar(group, &m, digest, digest_len); - for (;;) { - if (!ecdsa_sign_setup(eckey, ctx, &kinv_mont, &ret->r, digest, digest_len, - priv_key)) { - goto err; - } - - // Compute priv_key * r (mod order). Note if only one parameter is in the - // Montgomery domain, |scalar_mod_mul_montgomery| will compute the answer in - // the normal domain. - if (!ec_bignum_to_scalar(group, &r_mont, ret->r) || - !bn_to_montgomery_small(r_mont.words, order->width, r_mont.words, - order->width, group->order_mont) || - !scalar_mod_mul_montgomery(group, &s, priv_key, &r_mont)) { - goto err; - } - - // Compute tmp = m + priv_key * r. - scalar_add_loose(group, &tmp, &m, &s); - - // Finally, multiply s by k^-1. That was retained in Montgomery form, so the - // same technique as the previous multiplication works. - if (!scalar_mod_mul_montgomery_loose(group, &s, &tmp, &kinv_mont) || - !bn_set_words(ret->s, s.words, order->width)) { - goto err; - } - if (!BN_is_zero(ret->s)) { - // s != 0 => we have a valid signature - break; - } - } - - ok = 1; - -err: - if (!ok) { - ECDSA_SIG_free(ret); - ret = NULL; - } - BN_CTX_free(ctx); - OPENSSL_cleanse(&kinv_mont, sizeof(kinv_mont)); - OPENSSL_cleanse(&r_mont, sizeof(r_mont)); - OPENSSL_cleanse(&s, sizeof(s)); - OPENSSL_cleanse(&tmp, sizeof(tmp)); - OPENSSL_cleanse(&m, sizeof(m)); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c.back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c.back deleted file mode 100644 index 32429da38..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c.back +++ /dev/null @@ -1,298 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include - -#include "../../internal.h" - - -uint8_t *MD5(const uint8_t *data, size_t len, uint8_t *out) { - MD5_CTX ctx; - MD5_Init(&ctx); - MD5_Update(&ctx, data, len); - MD5_Final(out, &ctx); - - return out; -} - -int MD5_Init(MD5_CTX *md5) { - OPENSSL_memset(md5, 0, sizeof(MD5_CTX)); - md5->h[0] = 0x67452301UL; - md5->h[1] = 0xefcdab89UL; - md5->h[2] = 0x98badcfeUL; - md5->h[3] = 0x10325476UL; - return 1; -} - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -#define MD5_ASM -#define md5_block_data_order md5_block_asm_data_order -#endif - - -void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num); - -#define DATA_ORDER_IS_LITTLE_ENDIAN - -#define HASH_CTX MD5_CTX -#define HASH_CBLOCK 64 -#define HASH_UPDATE MD5_Update -#define HASH_TRANSFORM MD5_Transform -#define HASH_FINAL MD5_Final -#define HASH_MAKE_STRING(c, s) \ - do { \ - uint32_t ll; \ - ll = (c)->h[0]; \ - HOST_l2c(ll, (s)); \ - ll = (c)->h[1]; \ - HOST_l2c(ll, (s)); \ - ll = (c)->h[2]; \ - HOST_l2c(ll, (s)); \ - ll = (c)->h[3]; \ - HOST_l2c(ll, (s)); \ - } while (0) -#define HASH_BLOCK_DATA_ORDER md5_block_data_order - -#include "../digest/md32_common.h" - -// As pointed out by Wei Dai , the above can be -// simplified to the code below. Wei attributes these optimizations -// to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel. -#define F(b, c, d) ((((c) ^ (d)) & (b)) ^ (d)) -#define G(b, c, d) ((((b) ^ (c)) & (d)) ^ (c)) -#define H(b, c, d) ((b) ^ (c) ^ (d)) -#define I(b, c, d) (((~(d)) | (b)) ^ (c)) - -#define ROTATE(a, n) (((a) << (n)) | ((a) >> (32 - (n)))) - -#define R0(a, b, c, d, k, s, t) \ - do { \ - (a) += ((k) + (t) + F((b), (c), (d))); \ - (a) = ROTATE(a, s); \ - (a) += (b); \ - } while (0) - -#define R1(a, b, c, d, k, s, t) \ - do { \ - (a) += ((k) + (t) + G((b), (c), (d))); \ - (a) = ROTATE(a, s); \ - (a) += (b); \ - } while (0) - -#define R2(a, b, c, d, k, s, t) \ - do { \ - (a) += ((k) + (t) + H((b), (c), (d))); \ - (a) = ROTATE(a, s); \ - (a) += (b); \ - } while (0) - -#define R3(a, b, c, d, k, s, t) \ - do { \ - (a) += ((k) + (t) + I((b), (c), (d))); \ - (a) = ROTATE(a, s); \ - (a) += (b); \ - } while (0) - -#ifndef md5_block_data_order -#ifdef X -#undef X -#endif -void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { - uint32_t A, B, C, D, l; - uint32_t XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10, XX11, XX12, - XX13, XX14, XX15; -#define X(i) XX##i - - A = state[0]; - B = state[1]; - C = state[2]; - D = state[3]; - - for (; num--;) { - HOST_c2l(data, l); - X(0) = l; - HOST_c2l(data, l); - X(1) = l; - // Round 0 - R0(A, B, C, D, X(0), 7, 0xd76aa478L); - HOST_c2l(data, l); - X(2) = l; - R0(D, A, B, C, X(1), 12, 0xe8c7b756L); - HOST_c2l(data, l); - X(3) = l; - R0(C, D, A, B, X(2), 17, 0x242070dbL); - HOST_c2l(data, l); - X(4) = l; - R0(B, C, D, A, X(3), 22, 0xc1bdceeeL); - HOST_c2l(data, l); - X(5) = l; - R0(A, B, C, D, X(4), 7, 0xf57c0fafL); - HOST_c2l(data, l); - X(6) = l; - R0(D, A, B, C, X(5), 12, 0x4787c62aL); - HOST_c2l(data, l); - X(7) = l; - R0(C, D, A, B, X(6), 17, 0xa8304613L); - HOST_c2l(data, l); - X(8) = l; - R0(B, C, D, A, X(7), 22, 0xfd469501L); - HOST_c2l(data, l); - X(9) = l; - R0(A, B, C, D, X(8), 7, 0x698098d8L); - HOST_c2l(data, l); - X(10) = l; - R0(D, A, B, C, X(9), 12, 0x8b44f7afL); - HOST_c2l(data, l); - X(11) = l; - R0(C, D, A, B, X(10), 17, 0xffff5bb1L); - HOST_c2l(data, l); - X(12) = l; - R0(B, C, D, A, X(11), 22, 0x895cd7beL); - HOST_c2l(data, l); - X(13) = l; - R0(A, B, C, D, X(12), 7, 0x6b901122L); - HOST_c2l(data, l); - X(14) = l; - R0(D, A, B, C, X(13), 12, 0xfd987193L); - HOST_c2l(data, l); - X(15) = l; - R0(C, D, A, B, X(14), 17, 0xa679438eL); - R0(B, C, D, A, X(15), 22, 0x49b40821L); - // Round 1 - R1(A, B, C, D, X(1), 5, 0xf61e2562L); - R1(D, A, B, C, X(6), 9, 0xc040b340L); - R1(C, D, A, B, X(11), 14, 0x265e5a51L); - R1(B, C, D, A, X(0), 20, 0xe9b6c7aaL); - R1(A, B, C, D, X(5), 5, 0xd62f105dL); - R1(D, A, B, C, X(10), 9, 0x02441453L); - R1(C, D, A, B, X(15), 14, 0xd8a1e681L); - R1(B, C, D, A, X(4), 20, 0xe7d3fbc8L); - R1(A, B, C, D, X(9), 5, 0x21e1cde6L); - R1(D, A, B, C, X(14), 9, 0xc33707d6L); - R1(C, D, A, B, X(3), 14, 0xf4d50d87L); - R1(B, C, D, A, X(8), 20, 0x455a14edL); - R1(A, B, C, D, X(13), 5, 0xa9e3e905L); - R1(D, A, B, C, X(2), 9, 0xfcefa3f8L); - R1(C, D, A, B, X(7), 14, 0x676f02d9L); - R1(B, C, D, A, X(12), 20, 0x8d2a4c8aL); - // Round 2 - R2(A, B, C, D, X(5), 4, 0xfffa3942L); - R2(D, A, B, C, X(8), 11, 0x8771f681L); - R2(C, D, A, B, X(11), 16, 0x6d9d6122L); - R2(B, C, D, A, X(14), 23, 0xfde5380cL); - R2(A, B, C, D, X(1), 4, 0xa4beea44L); - R2(D, A, B, C, X(4), 11, 0x4bdecfa9L); - R2(C, D, A, B, X(7), 16, 0xf6bb4b60L); - R2(B, C, D, A, X(10), 23, 0xbebfbc70L); - R2(A, B, C, D, X(13), 4, 0x289b7ec6L); - R2(D, A, B, C, X(0), 11, 0xeaa127faL); - R2(C, D, A, B, X(3), 16, 0xd4ef3085L); - R2(B, C, D, A, X(6), 23, 0x04881d05L); - R2(A, B, C, D, X(9), 4, 0xd9d4d039L); - R2(D, A, B, C, X(12), 11, 0xe6db99e5L); - R2(C, D, A, B, X(15), 16, 0x1fa27cf8L); - R2(B, C, D, A, X(2), 23, 0xc4ac5665L); - // Round 3 - R3(A, B, C, D, X(0), 6, 0xf4292244L); - R3(D, A, B, C, X(7), 10, 0x432aff97L); - R3(C, D, A, B, X(14), 15, 0xab9423a7L); - R3(B, C, D, A, X(5), 21, 0xfc93a039L); - R3(A, B, C, D, X(12), 6, 0x655b59c3L); - R3(D, A, B, C, X(3), 10, 0x8f0ccc92L); - R3(C, D, A, B, X(10), 15, 0xffeff47dL); - R3(B, C, D, A, X(1), 21, 0x85845dd1L); - R3(A, B, C, D, X(8), 6, 0x6fa87e4fL); - R3(D, A, B, C, X(15), 10, 0xfe2ce6e0L); - R3(C, D, A, B, X(6), 15, 0xa3014314L); - R3(B, C, D, A, X(13), 21, 0x4e0811a1L); - R3(A, B, C, D, X(4), 6, 0xf7537e82L); - R3(D, A, B, C, X(11), 10, 0xbd3af235L); - R3(C, D, A, B, X(2), 15, 0x2ad7d2bbL); - R3(B, C, D, A, X(9), 21, 0xeb86d391L); - - A = state[0] += A; - B = state[1] += B; - C = state[2] += C; - D = state[3] += D; - } -} -#undef X -#endif - -#undef DATA_ORDER_IS_LITTLE_ENDIAN -#undef HASH_CTX -#undef HASH_CBLOCK -#undef HASH_UPDATE -#undef HASH_TRANSFORM -#undef HASH_FINAL -#undef HASH_MAKE_STRING -#undef HASH_BLOCK_DATA_ORDER -#undef F -#undef G -#undef H -#undef I -#undef ROTATE -#undef R0 -#undef R1 -#undef R2 -#undef R3 -#undef HOST_c2l -#undef HOST_l2c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cbc.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cbc.c deleted file mode 100644 index db9f02419..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cbc.c +++ /dev/null @@ -1,211 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include -#include - -#include "internal.h" - - -void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - block128_f block) { - size_t n; - const uint8_t *iv = ivec; - - assert(key != NULL && ivec != NULL); - assert(len == 0 || (in != NULL && out != NULL)); - - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (len >= 16) { - for (n = 0; n < 16; ++n) { - out[n] = in[n] ^ iv[n]; - } - (*block)(out, out, key); - iv = out; - len -= 16; - in += 16; - out += 16; - } - } else { - while (len >= 16) { - for (n = 0; n < 16; n += sizeof(size_t)) { - store_word_le(out + n, load_word_le(in + n) ^ load_word_le(iv + n)); - } - (*block)(out, out, key); - iv = out; - len -= 16; - in += 16; - out += 16; - } - } - - while (len) { - for (n = 0; n < 16 && n < len; ++n) { - out[n] = in[n] ^ iv[n]; - } - for (; n < 16; ++n) { - out[n] = iv[n]; - } - (*block)(out, out, key); - iv = out; - if (len <= 16) { - break; - } - len -= 16; - in += 16; - out += 16; - } - - OPENSSL_memcpy(ivec, iv, 16); -} - -void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - block128_f block) { - size_t n; - union { - size_t t[16 / sizeof(size_t)]; - uint8_t c[16]; - } tmp; - - assert(key != NULL && ivec != NULL); - assert(len == 0 || (in != NULL && out != NULL)); - - const uintptr_t inptr = (uintptr_t) in; - const uintptr_t outptr = (uintptr_t) out; - // If |in| and |out| alias, |in| must be ahead. - assert(inptr >= outptr || inptr + len <= outptr); - - if ((inptr >= 32 && outptr <= inptr - 32) || inptr < outptr) { - // If |out| is at least two blocks behind |in| or completely disjoint, there - // is no need to decrypt to a temporary block. - const uint8_t *iv = ivec; - - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (len >= 16) { - (*block)(in, out, key); - for (n = 0; n < 16; ++n) { - out[n] ^= iv[n]; - } - iv = in; - len -= 16; - in += 16; - out += 16; - } - } else if (16 % sizeof(size_t) == 0) { // always true - while (len >= 16) { - (*block)(in, out, key); - for (n = 0; n < 16; n += sizeof(size_t)) { - store_word_le(out + n, load_word_le(out + n) ^ load_word_le(iv + n)); - } - iv = in; - len -= 16; - in += 16; - out += 16; - } - } - OPENSSL_memcpy(ivec, iv, 16); - } else { - // |out| is less than two blocks behind |in|. Decrypting an input block - // directly to |out| would overwrite a ciphertext block before it is used as - // the next block's IV. Decrypt to a temporary block instead. - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - uint8_t c; - while (len >= 16) { - (*block)(in, tmp.c, key); - for (n = 0; n < 16; ++n) { - c = in[n]; - out[n] = tmp.c[n] ^ ivec[n]; - ivec[n] = c; - } - len -= 16; - in += 16; - out += 16; - } - } else if (16 % sizeof(size_t) == 0) { // always true - while (len >= 16) { - (*block)(in, tmp.c, key); - for (n = 0; n < 16; n += sizeof(size_t)) { - size_t c = load_word_le(in + n); - store_word_le(out + n, - tmp.t[n / sizeof(size_t)] ^ load_word_le(ivec + n)); - store_word_le(ivec + n, c); - } - len -= 16; - in += 16; - out += 16; - } - } - } - - while (len) { - uint8_t c; - (*block)(in, tmp.c, key); - for (n = 0; n < 16 && n < len; ++n) { - c = in[n]; - out[n] = tmp.c[n] ^ ivec[n]; - ivec[n] = c; - } - if (len <= 16) { - for (; n < 16; ++n) { - ivec[n] = in[n]; - } - break; - } - len -= 16; - in += 16; - out += 16; - } -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cbc.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cbc.c.grpc_back deleted file mode 100644 index db9f02419..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cbc.c.grpc_back +++ /dev/null @@ -1,211 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include -#include - -#include "internal.h" - - -void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - block128_f block) { - size_t n; - const uint8_t *iv = ivec; - - assert(key != NULL && ivec != NULL); - assert(len == 0 || (in != NULL && out != NULL)); - - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (len >= 16) { - for (n = 0; n < 16; ++n) { - out[n] = in[n] ^ iv[n]; - } - (*block)(out, out, key); - iv = out; - len -= 16; - in += 16; - out += 16; - } - } else { - while (len >= 16) { - for (n = 0; n < 16; n += sizeof(size_t)) { - store_word_le(out + n, load_word_le(in + n) ^ load_word_le(iv + n)); - } - (*block)(out, out, key); - iv = out; - len -= 16; - in += 16; - out += 16; - } - } - - while (len) { - for (n = 0; n < 16 && n < len; ++n) { - out[n] = in[n] ^ iv[n]; - } - for (; n < 16; ++n) { - out[n] = iv[n]; - } - (*block)(out, out, key); - iv = out; - if (len <= 16) { - break; - } - len -= 16; - in += 16; - out += 16; - } - - OPENSSL_memcpy(ivec, iv, 16); -} - -void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - block128_f block) { - size_t n; - union { - size_t t[16 / sizeof(size_t)]; - uint8_t c[16]; - } tmp; - - assert(key != NULL && ivec != NULL); - assert(len == 0 || (in != NULL && out != NULL)); - - const uintptr_t inptr = (uintptr_t) in; - const uintptr_t outptr = (uintptr_t) out; - // If |in| and |out| alias, |in| must be ahead. - assert(inptr >= outptr || inptr + len <= outptr); - - if ((inptr >= 32 && outptr <= inptr - 32) || inptr < outptr) { - // If |out| is at least two blocks behind |in| or completely disjoint, there - // is no need to decrypt to a temporary block. - const uint8_t *iv = ivec; - - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (len >= 16) { - (*block)(in, out, key); - for (n = 0; n < 16; ++n) { - out[n] ^= iv[n]; - } - iv = in; - len -= 16; - in += 16; - out += 16; - } - } else if (16 % sizeof(size_t) == 0) { // always true - while (len >= 16) { - (*block)(in, out, key); - for (n = 0; n < 16; n += sizeof(size_t)) { - store_word_le(out + n, load_word_le(out + n) ^ load_word_le(iv + n)); - } - iv = in; - len -= 16; - in += 16; - out += 16; - } - } - OPENSSL_memcpy(ivec, iv, 16); - } else { - // |out| is less than two blocks behind |in|. Decrypting an input block - // directly to |out| would overwrite a ciphertext block before it is used as - // the next block's IV. Decrypt to a temporary block instead. - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - uint8_t c; - while (len >= 16) { - (*block)(in, tmp.c, key); - for (n = 0; n < 16; ++n) { - c = in[n]; - out[n] = tmp.c[n] ^ ivec[n]; - ivec[n] = c; - } - len -= 16; - in += 16; - out += 16; - } - } else if (16 % sizeof(size_t) == 0) { // always true - while (len >= 16) { - (*block)(in, tmp.c, key); - for (n = 0; n < 16; n += sizeof(size_t)) { - size_t c = load_word_le(in + n); - store_word_le(out + n, - tmp.t[n / sizeof(size_t)] ^ load_word_le(ivec + n)); - store_word_le(ivec + n, c); - } - len -= 16; - in += 16; - out += 16; - } - } - } - - while (len) { - uint8_t c; - (*block)(in, tmp.c, key); - for (n = 0; n < 16 && n < len; ++n) { - c = in[n]; - out[n] = tmp.c[n] ^ ivec[n]; - ivec[n] = c; - } - if (len <= 16) { - for (; n < 16; ++n) { - ivec[n] = in[n]; - } - break; - } - len -= 16; - in += 16; - out += 16; - } -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ccm.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ccm.c deleted file mode 100644 index 9c35d482c..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ccm.c +++ /dev/null @@ -1,256 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -#include -#include - -#include -#include - -#include "../../internal.h" -#include "internal.h" - - -struct ccm128_state { - union { - uint64_t u[2]; - uint8_t c[16]; - } nonce, cmac; -}; - -int CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, const void *key, block128_f block, - ctr128_f ctr, unsigned M, unsigned L) { - if (M < 4 || M > 16 || (M & 1) != 0 || L < 2 || L > 8) { - return 0; - } - ctx->block = block; - ctx->ctr = ctr; - ctx->M = M; - ctx->L = L; - return 1; -} - -size_t CRYPTO_ccm128_max_input(const CCM128_CONTEXT *ctx) { - return ctx->L >= sizeof(size_t) ? (size_t)-1 - : (((size_t)1) << (ctx->L * 8)) - 1; -} - -static int ccm128_init_state(const CCM128_CONTEXT *ctx, - struct ccm128_state *state, const void *key, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *aad, size_t aad_len, - size_t plaintext_len) { - const block128_f block = ctx->block; - const unsigned M = ctx->M; - const unsigned L = ctx->L; - - // |L| determines the expected |nonce_len| and the limit for |plaintext_len|. - if (plaintext_len > CRYPTO_ccm128_max_input(ctx) || - nonce_len != 15 - L) { - return 0; - } - - // Assemble the first block for computing the MAC. - OPENSSL_memset(state, 0, sizeof(*state)); - state->nonce.c[0] = (uint8_t)((L - 1) | ((M - 2) / 2) << 3); - if (aad_len != 0) { - state->nonce.c[0] |= 0x40; // Set AAD Flag - } - OPENSSL_memcpy(&state->nonce.c[1], nonce, nonce_len); - for (unsigned i = 0; i < L; i++) { - state->nonce.c[15 - i] = (uint8_t)(plaintext_len >> (8 * i)); - } - - (*block)(state->nonce.c, state->cmac.c, key); - size_t blocks = 1; - - if (aad_len != 0) { - unsigned i; - // Cast to u64 to avoid the compiler complaining about invalid shifts. - uint64_t aad_len_u64 = aad_len; - if (aad_len_u64 < 0x10000 - 0x100) { - state->cmac.c[0] ^= (uint8_t)(aad_len_u64 >> 8); - state->cmac.c[1] ^= (uint8_t)aad_len_u64; - i = 2; - } else if (aad_len_u64 <= 0xffffffff) { - state->cmac.c[0] ^= 0xff; - state->cmac.c[1] ^= 0xfe; - state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 24); - state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 16); - state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 8); - state->cmac.c[5] ^= (uint8_t)aad_len_u64; - i = 6; - } else { - state->cmac.c[0] ^= 0xff; - state->cmac.c[1] ^= 0xff; - state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 56); - state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 48); - state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 40); - state->cmac.c[5] ^= (uint8_t)(aad_len_u64 >> 32); - state->cmac.c[6] ^= (uint8_t)(aad_len_u64 >> 24); - state->cmac.c[7] ^= (uint8_t)(aad_len_u64 >> 16); - state->cmac.c[8] ^= (uint8_t)(aad_len_u64 >> 8); - state->cmac.c[9] ^= (uint8_t)aad_len_u64; - i = 10; - } - - do { - for (; i < 16 && aad_len != 0; i++) { - state->cmac.c[i] ^= *aad; - aad++; - aad_len--; - } - (*block)(state->cmac.c, state->cmac.c, key); - blocks++; - i = 0; - } while (aad_len != 0); - } - - // Per RFC 3610, section 2.6, the total number of block cipher operations done - // must not exceed 2^61. There are two block cipher operations remaining per - // message block, plus one block at the end to encrypt the MAC. - size_t remaining_blocks = 2 * ((plaintext_len + 15) / 16) + 1; - if (plaintext_len + 15 < plaintext_len || - remaining_blocks + blocks < blocks || - (uint64_t) remaining_blocks + blocks > UINT64_C(1) << 61) { - return 0; - } - - // Assemble the first block for encrypting and decrypting. The bottom |L| - // bytes are replaced with a counter and all bit the encoding of |L| is - // cleared in the first byte. - state->nonce.c[0] &= 7; - return 1; -} - -static int ccm128_encrypt(const CCM128_CONTEXT *ctx, struct ccm128_state *state, - const void *key, uint8_t *out, const uint8_t *in, - size_t len) { - // The counter for encryption begins at one. - for (unsigned i = 0; i < ctx->L; i++) { - state->nonce.c[15 - i] = 0; - } - state->nonce.c[15] = 1; - - uint8_t partial_buf[16]; - unsigned num = 0; - if (ctx->ctr != NULL) { - CRYPTO_ctr128_encrypt_ctr32(in, out, len, key, state->nonce.c, partial_buf, - &num, ctx->ctr); - } else { - CRYPTO_ctr128_encrypt(in, out, len, key, state->nonce.c, partial_buf, &num, - ctx->block); - } - return 1; -} - -static int ccm128_compute_mac(const CCM128_CONTEXT *ctx, - struct ccm128_state *state, const void *key, - uint8_t *out_tag, size_t tag_len, - const uint8_t *in, size_t len) { - block128_f block = ctx->block; - if (tag_len != ctx->M) { - return 0; - } - - // Incorporate |in| into the MAC. - union { - uint64_t u[2]; - uint8_t c[16]; - } tmp; - while (len >= 16) { - OPENSSL_memcpy(tmp.c, in, 16); - state->cmac.u[0] ^= tmp.u[0]; - state->cmac.u[1] ^= tmp.u[1]; - (*block)(state->cmac.c, state->cmac.c, key); - in += 16; - len -= 16; - } - if (len > 0) { - for (size_t i = 0; i < len; i++) { - state->cmac.c[i] ^= in[i]; - } - (*block)(state->cmac.c, state->cmac.c, key); - } - - // Encrypt the MAC with counter zero. - for (unsigned i = 0; i < ctx->L; i++) { - state->nonce.c[15 - i] = 0; - } - (*block)(state->nonce.c, tmp.c, key); - state->cmac.u[0] ^= tmp.u[0]; - state->cmac.u[1] ^= tmp.u[1]; - - OPENSSL_memcpy(out_tag, state->cmac.c, tag_len); - return 1; -} - -int CRYPTO_ccm128_encrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len) { - struct ccm128_state state; - return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, - len) && - ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, in, len) && - ccm128_encrypt(ctx, &state, key, out, in, len); -} - -int CRYPTO_ccm128_decrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len) { - struct ccm128_state state; - return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, - len) && - ccm128_encrypt(ctx, &state, key, out, in, len) && - ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, out, len); -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ccm.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ccm.c.grpc_back deleted file mode 100644 index 784e4fa2a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ccm.c.grpc_back +++ /dev/null @@ -1,256 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2011 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - */ - -#include -#include - -#include -#include - -#include "../../internal.h" -#include "internal.h" - - -struct ccm128_state { - union { - uint64_t u[2]; - uint8_t c[16]; - } nonce, cmac; -}; - -int CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, const void *key, block128_f block, - ctr128_f ctr, unsigned M, unsigned L) { - if (M < 4 || M > 16 || (M & 1) != 0 || L < 2 || L > 8) { - return 0; - } - ctx->block = block; - ctx->ctr = ctr; - ctx->M = M; - ctx->L = L; - return 1; -} - -size_t CRYPTO_ccm128_max_input(const CCM128_CONTEXT *ctx) { - return ctx->L >= sizeof(size_t) ? (size_t)-1 - : (((size_t)1) << (ctx->L * 8)) - 1; -} - -static int ccm128_init_state(const CCM128_CONTEXT *ctx, - struct ccm128_state *state, const void *key, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *aad, size_t aad_len, - size_t plaintext_len) { - const block128_f block = ctx->block; - const unsigned M = ctx->M; - const unsigned L = ctx->L; - - // |L| determines the expected |nonce_len| and the limit for |plaintext_len|. - if (plaintext_len > CRYPTO_ccm128_max_input(ctx) || - nonce_len != 15 - L) { - return 0; - } - - // Assemble the first block for computing the MAC. - OPENSSL_memset(state, 0, sizeof(*state)); - state->nonce.c[0] = (uint8_t)((L - 1) | ((M - 2) / 2) << 3); - if (aad_len != 0) { - state->nonce.c[0] |= 0x40; // Set AAD Flag - } - OPENSSL_memcpy(&state->nonce.c[1], nonce, nonce_len); - for (unsigned i = 0; i < L; i++) { - state->nonce.c[15 - i] = (uint8_t)(plaintext_len >> (8 * i)); - } - - (*block)(state->nonce.c, state->cmac.c, key); - size_t blocks = 1; - - if (aad_len != 0) { - unsigned i; - // Cast to u64 to avoid the compiler complaining about invalid shifts. - uint64_t aad_len_u64 = aad_len; - if (aad_len_u64 < 0x10000 - 0x100) { - state->cmac.c[0] ^= (uint8_t)(aad_len_u64 >> 8); - state->cmac.c[1] ^= (uint8_t)aad_len_u64; - i = 2; - } else if (aad_len_u64 <= 0xffffffff) { - state->cmac.c[0] ^= 0xff; - state->cmac.c[1] ^= 0xfe; - state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 24); - state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 16); - state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 8); - state->cmac.c[5] ^= (uint8_t)aad_len_u64; - i = 6; - } else { - state->cmac.c[0] ^= 0xff; - state->cmac.c[1] ^= 0xff; - state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 56); - state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 48); - state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 40); - state->cmac.c[5] ^= (uint8_t)(aad_len_u64 >> 32); - state->cmac.c[6] ^= (uint8_t)(aad_len_u64 >> 24); - state->cmac.c[7] ^= (uint8_t)(aad_len_u64 >> 16); - state->cmac.c[8] ^= (uint8_t)(aad_len_u64 >> 8); - state->cmac.c[9] ^= (uint8_t)aad_len_u64; - i = 10; - } - - do { - for (; i < 16 && aad_len != 0; i++) { - state->cmac.c[i] ^= *aad; - aad++; - aad_len--; - } - (*block)(state->cmac.c, state->cmac.c, key); - blocks++; - i = 0; - } while (aad_len != 0); - } - - // Per RFC 3610, section 2.6, the total number of block cipher operations done - // must not exceed 2^61. There are two block cipher operations remaining per - // message block, plus one block at the end to encrypt the MAC. - size_t remaining_blocks = 2 * ((plaintext_len + 15) / 16) + 1; - if (plaintext_len + 15 < plaintext_len || - remaining_blocks + blocks < blocks || - (uint64_t) remaining_blocks + blocks > UINT64_C(1) << 61) { - return 0; - } - - // Assemble the first block for encrypting and decrypting. The bottom |L| - // bytes are replaced with a counter and all bit the encoding of |L| is - // cleared in the first byte. - state->nonce.c[0] &= 7; - return 1; -} - -static int ccm128_encrypt(const CCM128_CONTEXT *ctx, struct ccm128_state *state, - const void *key, uint8_t *out, const uint8_t *in, - size_t len) { - // The counter for encryption begins at one. - for (unsigned i = 0; i < ctx->L; i++) { - state->nonce.c[15 - i] = 0; - } - state->nonce.c[15] = 1; - - uint8_t partial_buf[16]; - unsigned num = 0; - if (ctx->ctr != NULL) { - CRYPTO_ctr128_encrypt_ctr32(in, out, len, key, state->nonce.c, partial_buf, - &num, ctx->ctr); - } else { - CRYPTO_ctr128_encrypt(in, out, len, key, state->nonce.c, partial_buf, &num, - ctx->block); - } - return 1; -} - -static int ccm128_compute_mac(const CCM128_CONTEXT *ctx, - struct ccm128_state *state, const void *key, - uint8_t *out_tag, size_t tag_len, - const uint8_t *in, size_t len) { - block128_f block = ctx->block; - if (tag_len != ctx->M) { - return 0; - } - - // Incorporate |in| into the MAC. - union { - uint64_t u[2]; - uint8_t c[16]; - } tmp; - while (len >= 16) { - OPENSSL_memcpy(tmp.c, in, 16); - state->cmac.u[0] ^= tmp.u[0]; - state->cmac.u[1] ^= tmp.u[1]; - (*block)(state->cmac.c, state->cmac.c, key); - in += 16; - len -= 16; - } - if (len > 0) { - for (size_t i = 0; i < len; i++) { - state->cmac.c[i] ^= in[i]; - } - (*block)(state->cmac.c, state->cmac.c, key); - } - - // Encrypt the MAC with counter zero. - for (unsigned i = 0; i < ctx->L; i++) { - state->nonce.c[15 - i] = 0; - } - (*block)(state->nonce.c, tmp.c, key); - state->cmac.u[0] ^= tmp.u[0]; - state->cmac.u[1] ^= tmp.u[1]; - - OPENSSL_memcpy(out_tag, state->cmac.c, tag_len); - return 1; -} - -int CRYPTO_ccm128_encrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len) { - struct ccm128_state state; - return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, - len) && - ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, in, len) && - ccm128_encrypt(ctx, &state, key, out, in, len); -} - -int CRYPTO_ccm128_decrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len) { - struct ccm128_state state; - return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, - len) && - ccm128_encrypt(ctx, &state, key, out, in, len) && - ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, out, len); -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/gcm.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/gcm.c deleted file mode 100644 index 50796e820..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/gcm.c +++ /dev/null @@ -1,1063 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include - -#include -#include - -#include "internal.h" -#include "../../internal.h" - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) || \ - defined(OPENSSL_PPC64LE)) -#define GHASH_ASM -#endif - -#define PACK(s) ((size_t)(s) << (sizeof(size_t) * 8 - 16)) -#define REDUCE1BIT(V) \ - do { \ - if (sizeof(size_t) == 8) { \ - uint64_t T = UINT64_C(0xe100000000000000) & (0 - ((V).lo & 1)); \ - (V).lo = ((V).hi << 63) | ((V).lo >> 1); \ - (V).hi = ((V).hi >> 1) ^ T; \ - } else { \ - uint32_t T = 0xe1000000U & (0 - (uint32_t)((V).lo & 1)); \ - (V).lo = ((V).hi << 63) | ((V).lo >> 1); \ - (V).hi = ((V).hi >> 1) ^ ((uint64_t)T << 32); \ - } \ - } while (0) - -// kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four -// bits of a |size_t|. -static const size_t kSizeTWithoutLower4Bits = (size_t) -16; - -static void gcm_init_4bit(u128 Htable[16], uint64_t H[2]) { - u128 V; - - Htable[0].hi = 0; - Htable[0].lo = 0; - V.hi = H[0]; - V.lo = H[1]; - - Htable[8] = V; - REDUCE1BIT(V); - Htable[4] = V; - REDUCE1BIT(V); - Htable[2] = V; - REDUCE1BIT(V); - Htable[1] = V; - Htable[3].hi = V.hi ^ Htable[2].hi, Htable[3].lo = V.lo ^ Htable[2].lo; - V = Htable[4]; - Htable[5].hi = V.hi ^ Htable[1].hi, Htable[5].lo = V.lo ^ Htable[1].lo; - Htable[6].hi = V.hi ^ Htable[2].hi, Htable[6].lo = V.lo ^ Htable[2].lo; - Htable[7].hi = V.hi ^ Htable[3].hi, Htable[7].lo = V.lo ^ Htable[3].lo; - V = Htable[8]; - Htable[9].hi = V.hi ^ Htable[1].hi, Htable[9].lo = V.lo ^ Htable[1].lo; - Htable[10].hi = V.hi ^ Htable[2].hi, Htable[10].lo = V.lo ^ Htable[2].lo; - Htable[11].hi = V.hi ^ Htable[3].hi, Htable[11].lo = V.lo ^ Htable[3].lo; - Htable[12].hi = V.hi ^ Htable[4].hi, Htable[12].lo = V.lo ^ Htable[4].lo; - Htable[13].hi = V.hi ^ Htable[5].hi, Htable[13].lo = V.lo ^ Htable[5].lo; - Htable[14].hi = V.hi ^ Htable[6].hi, Htable[14].lo = V.lo ^ Htable[6].lo; - Htable[15].hi = V.hi ^ Htable[7].hi, Htable[15].lo = V.lo ^ Htable[7].lo; - -#if defined(GHASH_ASM) && defined(OPENSSL_ARM) - for (int j = 0; j < 16; ++j) { - V = Htable[j]; - Htable[j].hi = V.lo; - Htable[j].lo = V.hi; - } -#endif -} - -#if !defined(GHASH_ASM) || defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE) -static const size_t rem_4bit[16] = { - PACK(0x0000), PACK(0x1C20), PACK(0x3840), PACK(0x2460), - PACK(0x7080), PACK(0x6CA0), PACK(0x48C0), PACK(0x54E0), - PACK(0xE100), PACK(0xFD20), PACK(0xD940), PACK(0xC560), - PACK(0x9180), PACK(0x8DA0), PACK(0xA9C0), PACK(0xB5E0)}; - -static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) { - u128 Z; - int cnt = 15; - size_t rem, nlo, nhi; - - nlo = ((const uint8_t *)Xi)[15]; - nhi = nlo >> 4; - nlo &= 0xf; - - Z.hi = Htable[nlo].hi; - Z.lo = Htable[nlo].lo; - - while (1) { - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nhi].hi; - Z.lo ^= Htable[nhi].lo; - - if (--cnt < 0) { - break; - } - - nlo = ((const uint8_t *)Xi)[cnt]; - nhi = nlo >> 4; - nlo &= 0xf; - - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nlo].hi; - Z.lo ^= Htable[nlo].lo; - } - - Xi[0] = CRYPTO_bswap8(Z.hi); - Xi[1] = CRYPTO_bswap8(Z.lo); -} - -// Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for -// details... Compiler-generated code doesn't seem to give any -// performance improvement, at least not on x86[_64]. It's here -// mostly as reference and a placeholder for possible future -// non-trivial optimization[s]... -static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], - const uint8_t *inp, size_t len) { - u128 Z; - int cnt; - size_t rem, nlo, nhi; - - do { - cnt = 15; - nlo = ((const uint8_t *)Xi)[15]; - nlo ^= inp[15]; - nhi = nlo >> 4; - nlo &= 0xf; - - Z.hi = Htable[nlo].hi; - Z.lo = Htable[nlo].lo; - - while (1) { - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nhi].hi; - Z.lo ^= Htable[nhi].lo; - - if (--cnt < 0) { - break; - } - - nlo = ((const uint8_t *)Xi)[cnt]; - nlo ^= inp[cnt]; - nhi = nlo >> 4; - nlo &= 0xf; - - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nlo].hi; - Z.lo ^= Htable[nlo].lo; - } - - Xi[0] = CRYPTO_bswap8(Z.hi); - Xi[1] = CRYPTO_bswap8(Z.lo); - } while (inp += 16, len -= 16); -} -#else // GHASH_ASM -void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#endif - -#define GCM_MUL(ctx, Xi) gcm_gmult_4bit((ctx)->Xi.u, (ctx)->Htable) -#if defined(GHASH_ASM) -#define GHASH(ctx, in, len) gcm_ghash_4bit((ctx)->Xi.u, (ctx)->Htable, in, len) -// GHASH_CHUNK is "stride parameter" missioned to mitigate cache -// trashing effect. In other words idea is to hash data while it's -// still in L1 cache after encryption pass... -#define GHASH_CHUNK (3 * 1024) -#endif - - -#if defined(GHASH_ASM) - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -#define GCM_FUNCREF_4BIT -void gcm_init_clmul(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_clmul(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_clmul(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); - -#if defined(OPENSSL_X86_64) -#define GHASH_ASM_X86_64 -void gcm_init_avx(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_avx(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, - size_t len); -#define AESNI_GCM -size_t aesni_gcm_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], uint64_t *Xi); -size_t aesni_gcm_decrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], uint64_t *Xi); -#endif - -#if defined(OPENSSL_X86) -#define GHASH_ASM_X86 -void gcm_gmult_4bit_mmx(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_4bit_mmx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#endif - -#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) -#include -#if __ARM_ARCH__ >= 7 -#define GHASH_ASM_ARM -#define GCM_FUNCREF_4BIT - -static int pmull_capable(void) { - return CRYPTO_is_ARMv8_PMULL_capable(); -} - -void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); - -#if defined(OPENSSL_ARM) -// 32-bit ARM also has support for doing GCM with NEON instructions. -static int neon_capable(void) { - return CRYPTO_is_NEON_capable(); -} - -void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#else -// AArch64 only has the ARMv8 versions of functions. -static int neon_capable(void) { - return 0; -} -static void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]) { - abort(); -} -static void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]) { - abort(); -} -static void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], - const uint8_t *inp, size_t len) { - abort(); -} -#endif - -#endif -#elif defined(OPENSSL_PPC64LE) -#define GHASH_ASM_PPC64LE -#define GCM_FUNCREF_4BIT -void gcm_init_p8(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_p8(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_p8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#endif -#endif - -#ifdef GCM_FUNCREF_4BIT -#undef GCM_MUL -#define GCM_MUL(ctx, Xi) (*gcm_gmult_p)((ctx)->Xi.u, (ctx)->Htable) -#ifdef GHASH -#undef GHASH -#define GHASH(ctx, in, len) (*gcm_ghash_p)((ctx)->Xi.u, (ctx)->Htable, in, len) -#endif -#endif - -void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, - u128 *out_key, u128 out_table[16], - int *out_is_avx, - const uint8_t *gcm_key) { - *out_is_avx = 0; - - union { - uint64_t u[2]; - uint8_t c[16]; - } H; - - OPENSSL_memcpy(H.c, gcm_key, 16); - - // H is stored in host byte order - H.u[0] = CRYPTO_bswap8(H.u[0]); - H.u[1] = CRYPTO_bswap8(H.u[1]); - - OPENSSL_memcpy(out_key, H.c, 16); - -#if defined(GHASH_ASM_X86_64) - if (crypto_gcm_clmul_enabled()) { - if (((OPENSSL_ia32cap_get()[1] >> 22) & 0x41) == 0x41) { // AVX+MOVBE - gcm_init_avx(out_table, H.u); - *out_mult = gcm_gmult_avx; - *out_hash = gcm_ghash_avx; - *out_is_avx = 1; - return; - } - gcm_init_clmul(out_table, H.u); - *out_mult = gcm_gmult_clmul; - *out_hash = gcm_ghash_clmul; - return; - } -#elif defined(GHASH_ASM_X86) - if (crypto_gcm_clmul_enabled()) { - gcm_init_clmul(out_table, H.u); - *out_mult = gcm_gmult_clmul; - *out_hash = gcm_ghash_clmul; - return; - } -#elif defined(GHASH_ASM_ARM) - if (pmull_capable()) { - gcm_init_v8(out_table, H.u); - *out_mult = gcm_gmult_v8; - *out_hash = gcm_ghash_v8; - return; - } - - if (neon_capable()) { - gcm_init_neon(out_table, H.u); - *out_mult = gcm_gmult_neon; - *out_hash = gcm_ghash_neon; - return; - } -#elif defined(GHASH_ASM_PPC64LE) - if (CRYPTO_is_PPC64LE_vcrypto_capable()) { - gcm_init_p8(out_table, H.u); - *out_mult = gcm_gmult_p8; - *out_hash = gcm_ghash_p8; - return; - } -#endif - - gcm_init_4bit(out_table, H.u); -#if defined(GHASH_ASM_X86) - *out_mult = gcm_gmult_4bit_mmx; - *out_hash = gcm_ghash_4bit_mmx; -#else - *out_mult = gcm_gmult_4bit; - *out_hash = gcm_ghash_4bit; -#endif -} - -void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, const void *aes_key, - block128_f block, int is_aesni_encrypt) { - OPENSSL_memset(ctx, 0, sizeof(*ctx)); - ctx->block = block; - - uint8_t gcm_key[16]; - OPENSSL_memset(gcm_key, 0, sizeof(gcm_key)); - (*block)(gcm_key, gcm_key, aes_key); - - int is_avx; - CRYPTO_ghash_init(&ctx->gmult, &ctx->ghash, &ctx->H, ctx->Htable, &is_avx, - gcm_key); - - ctx->use_aesni_gcm_crypt = (is_avx && is_aesni_encrypt) ? 1 : 0; -} - -void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *iv, size_t len) { - unsigned int ctr; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#endif - - ctx->Yi.u[0] = 0; - ctx->Yi.u[1] = 0; - ctx->Xi.u[0] = 0; - ctx->Xi.u[1] = 0; - ctx->len.u[0] = 0; // AAD length - ctx->len.u[1] = 0; // message length - ctx->ares = 0; - ctx->mres = 0; - - if (len == 12) { - OPENSSL_memcpy(ctx->Yi.c, iv, 12); - ctx->Yi.c[15] = 1; - ctr = 1; - } else { - uint64_t len0 = len; - - while (len >= 16) { - for (size_t i = 0; i < 16; ++i) { - ctx->Yi.c[i] ^= iv[i]; - } - GCM_MUL(ctx, Yi); - iv += 16; - len -= 16; - } - if (len) { - for (size_t i = 0; i < len; ++i) { - ctx->Yi.c[i] ^= iv[i]; - } - GCM_MUL(ctx, Yi); - } - len0 <<= 3; - ctx->Yi.u[1] ^= CRYPTO_bswap8(len0); - - GCM_MUL(ctx, Yi); - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - } - - (*ctx->block)(ctx->Yi.c, ctx->EK0.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); -} - -int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) { - unsigned int n; - uint64_t alen = ctx->len.u[0]; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - if (ctx->len.u[1]) { - return 0; - } - - alen += len; - if (alen > (UINT64_C(1) << 61) || (sizeof(len) == 8 && alen < len)) { - return 0; - } - ctx->len.u[0] = alen; - - n = ctx->ares; - if (n) { - while (n && len) { - ctx->Xi.c[n] ^= *(aad++); - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->ares = n; - return 1; - } - } - - // Process a whole number of blocks. -#ifdef GHASH - size_t len_blocks = len & kSizeTWithoutLower4Bits; - if (len_blocks != 0) { - GHASH(ctx, aad, len_blocks); - aad += len_blocks; - len -= len_blocks; - } -#else - while (len >= 16) { - for (size_t i = 0; i < 16; ++i) { - ctx->Xi.c[i] ^= aad[i]; - } - GCM_MUL(ctx, Xi); - aad += 16; - len -= 16; - } -#endif - - // Process the remainder. - if (len != 0) { - n = (unsigned int)len; - for (size_t i = 0; i < len; ++i) { - ctx->Xi.c[i] ^= aad[i]; - } - } - - ctx->ares = n; - return 1; -} - -int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, size_t len) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; - block128_f block = ctx->block; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to encrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - - n = ctx->mres; - if (n) { - while (n && len) { - ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out) % sizeof(size_t) != 0) { - for (size_t i = 0; i < len; ++i) { - if (n == 0) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - } - ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n]; - n = (n + 1) % 16; - if (n == 0) { - GCM_MUL(ctx, Xi); - } - } - - ctx->mres = n; - return 1; - } -#if defined(GHASH) && defined(GHASH_CHUNK) - while (len >= GHASH_CHUNK) { - size_t j = GHASH_CHUNK; - - while (j) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - j -= 16; - } - GHASH(ctx, out - GHASH_CHUNK, GHASH_CHUNK); - len -= GHASH_CHUNK; - } - size_t len_blocks = len & kSizeTWithoutLower4Bits; - if (len_blocks != 0) { - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - len -= 16; - } - GHASH(ctx, out - len_blocks, len_blocks); - } -#else - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]; - store_word_le(out + i, tmp); - ctx->Xi.t[i / sizeof(size_t)] ^= tmp; - } - GCM_MUL(ctx, Xi); - out += 16; - in += 16; - len -= 16; - } -#endif - if (len) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const void *key, - const unsigned char *in, unsigned char *out, - size_t len) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; - block128_f block = ctx->block; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to decrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - - n = ctx->mres; - if (n) { - while (n && len) { - uint8_t c = *(in++); - *(out++) = c ^ ctx->EKi.c[n]; - ctx->Xi.c[n] ^= c; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out) % sizeof(size_t) != 0) { - for (size_t i = 0; i < len; ++i) { - uint8_t c; - if (n == 0) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - } - c = in[i]; - out[i] = c ^ ctx->EKi.c[n]; - ctx->Xi.c[n] ^= c; - n = (n + 1) % 16; - if (n == 0) { - GCM_MUL(ctx, Xi); - } - } - - ctx->mres = n; - return 1; - } -#if defined(GHASH) && defined(GHASH_CHUNK) - while (len >= GHASH_CHUNK) { - size_t j = GHASH_CHUNK; - - GHASH(ctx, in, GHASH_CHUNK); - while (j) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - j -= 16; - } - len -= GHASH_CHUNK; - } - size_t len_blocks = len & kSizeTWithoutLower4Bits; - if (len_blocks != 0) { - GHASH(ctx, in, len_blocks); - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - len -= 16; - } - } -#else - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - size_t c = load_word_le(in + i); - store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]); - ctx->Xi.t[i / sizeof(size_t)] ^= c; - } - GCM_MUL(ctx, Xi); - out += 16; - in += 16; - len -= 16; - } -#endif - if (len) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - uint8_t c = in[n]; - ctx->Xi.c[n] ^= c; - out[n] = c ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, size_t len, - ctr128_f stream) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to encrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - n = ctx->mres; - if (n) { - while (n && len) { - ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - -#if defined(AESNI_GCM) - if (ctx->use_aesni_gcm_crypt) { - // |aesni_gcm_encrypt| may not process all the input given to it. It may - // not process *any* of its input if it is deemed too small. - size_t bulk = aesni_gcm_encrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); - in += bulk; - out += bulk; - len -= bulk; - } -#endif - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - -#if defined(GHASH) - while (len >= GHASH_CHUNK) { - (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); - ctr += GHASH_CHUNK / 16; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - GHASH(ctx, out, GHASH_CHUNK); - out += GHASH_CHUNK; - in += GHASH_CHUNK; - len -= GHASH_CHUNK; - } -#endif - size_t i = len & kSizeTWithoutLower4Bits; - if (i != 0) { - size_t j = i / 16; - - (*stream)(in, out, j, key, ctx->Yi.c); - ctr += (unsigned int)j; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - in += i; - len -= i; -#if defined(GHASH) - GHASH(ctx, out, i); - out += i; -#else - while (j--) { - for (i = 0; i < 16; ++i) { - ctx->Xi.c[i] ^= out[i]; - } - GCM_MUL(ctx, Xi); - out += 16; - } -#endif - } - if (len) { - (*ctx->block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, size_t len, - ctr128_f stream) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to decrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - n = ctx->mres; - if (n) { - while (n && len) { - uint8_t c = *(in++); - *(out++) = c ^ ctx->EKi.c[n]; - ctx->Xi.c[n] ^= c; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - -#if defined(AESNI_GCM) - if (ctx->use_aesni_gcm_crypt) { - // |aesni_gcm_decrypt| may not process all the input given to it. It may - // not process *any* of its input if it is deemed too small. - size_t bulk = aesni_gcm_decrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); - in += bulk; - out += bulk; - len -= bulk; - } -#endif - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - -#if defined(GHASH) - while (len >= GHASH_CHUNK) { - GHASH(ctx, in, GHASH_CHUNK); - (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); - ctr += GHASH_CHUNK / 16; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - out += GHASH_CHUNK; - in += GHASH_CHUNK; - len -= GHASH_CHUNK; - } -#endif - size_t i = len & kSizeTWithoutLower4Bits; - if (i != 0) { - size_t j = i / 16; - -#if defined(GHASH) - GHASH(ctx, in, i); -#else - while (j--) { - size_t k; - for (k = 0; k < 16; ++k) { - ctx->Xi.c[k] ^= in[k]; - } - GCM_MUL(ctx, Xi); - in += 16; - } - j = i / 16; - in -= i; -#endif - (*stream)(in, out, j, key, ctx->Yi.c); - ctr += (unsigned int)j; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - out += i; - in += i; - len -= i; - } - if (len) { - (*ctx->block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - uint8_t c = in[n]; - ctx->Xi.c[n] ^= c; - out[n] = c ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) { - uint64_t alen = ctx->len.u[0] << 3; - uint64_t clen = ctx->len.u[1] << 3; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#endif - - if (ctx->mres || ctx->ares) { - GCM_MUL(ctx, Xi); - } - - alen = CRYPTO_bswap8(alen); - clen = CRYPTO_bswap8(clen); - - ctx->Xi.u[0] ^= alen; - ctx->Xi.u[1] ^= clen; - GCM_MUL(ctx, Xi); - - ctx->Xi.u[0] ^= ctx->EK0.u[0]; - ctx->Xi.u[1] ^= ctx->EK0.u[1]; - - if (tag && len <= sizeof(ctx->Xi)) { - return CRYPTO_memcmp(ctx->Xi.c, tag, len) == 0; - } else { - return 0; - } -} - -void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) { - CRYPTO_gcm128_finish(ctx, NULL, 0); - OPENSSL_memcpy(tag, ctx->Xi.c, - len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c)); -} - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -int crypto_gcm_clmul_enabled(void) { -#ifdef GHASH_ASM - const uint32_t *ia32cap = OPENSSL_ia32cap_get(); - return (ia32cap[0] & (1 << 24)) && // check FXSR bit - (ia32cap[1] & (1 << 1)); // check PCLMULQDQ bit -#else - return 0; -#endif -} -#endif diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/gcm.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/gcm.c.grpc_back deleted file mode 100644 index 05cd18d4f..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/gcm.c.grpc_back +++ /dev/null @@ -1,1063 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#include - -#include -#include - -#include -#include - -#include "internal.h" -#include "../../internal.h" - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) || \ - defined(OPENSSL_PPC64LE)) -#define GHASH_ASM -#endif - -#define PACK(s) ((size_t)(s) << (sizeof(size_t) * 8 - 16)) -#define REDUCE1BIT(V) \ - do { \ - if (sizeof(size_t) == 8) { \ - uint64_t T = UINT64_C(0xe100000000000000) & (0 - ((V).lo & 1)); \ - (V).lo = ((V).hi << 63) | ((V).lo >> 1); \ - (V).hi = ((V).hi >> 1) ^ T; \ - } else { \ - uint32_t T = 0xe1000000U & (0 - (uint32_t)((V).lo & 1)); \ - (V).lo = ((V).hi << 63) | ((V).lo >> 1); \ - (V).hi = ((V).hi >> 1) ^ ((uint64_t)T << 32); \ - } \ - } while (0) - -// kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four -// bits of a |size_t|. -static const size_t kSizeTWithoutLower4Bits = (size_t) -16; - -static void gcm_init_4bit(u128 Htable[16], uint64_t H[2]) { - u128 V; - - Htable[0].hi = 0; - Htable[0].lo = 0; - V.hi = H[0]; - V.lo = H[1]; - - Htable[8] = V; - REDUCE1BIT(V); - Htable[4] = V; - REDUCE1BIT(V); - Htable[2] = V; - REDUCE1BIT(V); - Htable[1] = V; - Htable[3].hi = V.hi ^ Htable[2].hi, Htable[3].lo = V.lo ^ Htable[2].lo; - V = Htable[4]; - Htable[5].hi = V.hi ^ Htable[1].hi, Htable[5].lo = V.lo ^ Htable[1].lo; - Htable[6].hi = V.hi ^ Htable[2].hi, Htable[6].lo = V.lo ^ Htable[2].lo; - Htable[7].hi = V.hi ^ Htable[3].hi, Htable[7].lo = V.lo ^ Htable[3].lo; - V = Htable[8]; - Htable[9].hi = V.hi ^ Htable[1].hi, Htable[9].lo = V.lo ^ Htable[1].lo; - Htable[10].hi = V.hi ^ Htable[2].hi, Htable[10].lo = V.lo ^ Htable[2].lo; - Htable[11].hi = V.hi ^ Htable[3].hi, Htable[11].lo = V.lo ^ Htable[3].lo; - Htable[12].hi = V.hi ^ Htable[4].hi, Htable[12].lo = V.lo ^ Htable[4].lo; - Htable[13].hi = V.hi ^ Htable[5].hi, Htable[13].lo = V.lo ^ Htable[5].lo; - Htable[14].hi = V.hi ^ Htable[6].hi, Htable[14].lo = V.lo ^ Htable[6].lo; - Htable[15].hi = V.hi ^ Htable[7].hi, Htable[15].lo = V.lo ^ Htable[7].lo; - -#if defined(GHASH_ASM) && defined(OPENSSL_ARM) - for (int j = 0; j < 16; ++j) { - V = Htable[j]; - Htable[j].hi = V.lo; - Htable[j].lo = V.hi; - } -#endif -} - -#if !defined(GHASH_ASM) || defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE) -static const size_t rem_4bit[16] = { - PACK(0x0000), PACK(0x1C20), PACK(0x3840), PACK(0x2460), - PACK(0x7080), PACK(0x6CA0), PACK(0x48C0), PACK(0x54E0), - PACK(0xE100), PACK(0xFD20), PACK(0xD940), PACK(0xC560), - PACK(0x9180), PACK(0x8DA0), PACK(0xA9C0), PACK(0xB5E0)}; - -static void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) { - u128 Z; - int cnt = 15; - size_t rem, nlo, nhi; - - nlo = ((const uint8_t *)Xi)[15]; - nhi = nlo >> 4; - nlo &= 0xf; - - Z.hi = Htable[nlo].hi; - Z.lo = Htable[nlo].lo; - - while (1) { - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nhi].hi; - Z.lo ^= Htable[nhi].lo; - - if (--cnt < 0) { - break; - } - - nlo = ((const uint8_t *)Xi)[cnt]; - nhi = nlo >> 4; - nlo &= 0xf; - - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nlo].hi; - Z.lo ^= Htable[nlo].lo; - } - - Xi[0] = CRYPTO_bswap8(Z.hi); - Xi[1] = CRYPTO_bswap8(Z.lo); -} - -// Streamed gcm_mult_4bit, see CRYPTO_gcm128_[en|de]crypt for -// details... Compiler-generated code doesn't seem to give any -// performance improvement, at least not on x86[_64]. It's here -// mostly as reference and a placeholder for possible future -// non-trivial optimization[s]... -static void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], - const uint8_t *inp, size_t len) { - u128 Z; - int cnt; - size_t rem, nlo, nhi; - - do { - cnt = 15; - nlo = ((const uint8_t *)Xi)[15]; - nlo ^= inp[15]; - nhi = nlo >> 4; - nlo &= 0xf; - - Z.hi = Htable[nlo].hi; - Z.lo = Htable[nlo].lo; - - while (1) { - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nhi].hi; - Z.lo ^= Htable[nhi].lo; - - if (--cnt < 0) { - break; - } - - nlo = ((const uint8_t *)Xi)[cnt]; - nlo ^= inp[cnt]; - nhi = nlo >> 4; - nlo &= 0xf; - - rem = (size_t)Z.lo & 0xf; - Z.lo = (Z.hi << 60) | (Z.lo >> 4); - Z.hi = (Z.hi >> 4); - if (sizeof(size_t) == 8) { - Z.hi ^= rem_4bit[rem]; - } else { - Z.hi ^= (uint64_t)rem_4bit[rem] << 32; - } - - Z.hi ^= Htable[nlo].hi; - Z.lo ^= Htable[nlo].lo; - } - - Xi[0] = CRYPTO_bswap8(Z.hi); - Xi[1] = CRYPTO_bswap8(Z.lo); - } while (inp += 16, len -= 16); -} -#else // GHASH_ASM -void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#endif - -#define GCM_MUL(ctx, Xi) gcm_gmult_4bit((ctx)->Xi.u, (ctx)->Htable) -#if defined(GHASH_ASM) -#define GHASH(ctx, in, len) gcm_ghash_4bit((ctx)->Xi.u, (ctx)->Htable, in, len) -// GHASH_CHUNK is "stride parameter" missioned to mitigate cache -// trashing effect. In other words idea is to hash data while it's -// still in L1 cache after encryption pass... -#define GHASH_CHUNK (3 * 1024) -#endif - - -#if defined(GHASH_ASM) - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -#define GCM_FUNCREF_4BIT -void gcm_init_clmul(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_clmul(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_clmul(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); - -#if defined(OPENSSL_X86_64) -#define GHASH_ASM_X86_64 -void gcm_init_avx(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_avx(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, - size_t len); -#define AESNI_GCM -size_t aesni_gcm_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], uint64_t *Xi); -size_t aesni_gcm_decrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], uint64_t *Xi); -#endif - -#if defined(OPENSSL_X86) -#define GHASH_ASM_X86 -void gcm_gmult_4bit_mmx(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_4bit_mmx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#endif - -#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) -#include -#if __ARM_ARCH__ >= 7 -#define GHASH_ASM_ARM -#define GCM_FUNCREF_4BIT - -static int pmull_capable(void) { - return CRYPTO_is_ARMv8_PMULL_capable(); -} - -void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); - -#if defined(OPENSSL_ARM) -// 32-bit ARM also has support for doing GCM with NEON instructions. -static int neon_capable(void) { - return CRYPTO_is_NEON_capable(); -} - -void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#else -// AArch64 only has the ARMv8 versions of functions. -static int neon_capable(void) { - return 0; -} -static void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]) { - abort(); -} -static void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]) { - abort(); -} -static void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], - const uint8_t *inp, size_t len) { - abort(); -} -#endif - -#endif -#elif defined(OPENSSL_PPC64LE) -#define GHASH_ASM_PPC64LE -#define GCM_FUNCREF_4BIT -void gcm_init_p8(u128 Htable[16], const uint64_t Xi[2]); -void gcm_gmult_p8(uint64_t Xi[2], const u128 Htable[16]); -void gcm_ghash_p8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len); -#endif -#endif - -#ifdef GCM_FUNCREF_4BIT -#undef GCM_MUL -#define GCM_MUL(ctx, Xi) (*gcm_gmult_p)((ctx)->Xi.u, (ctx)->Htable) -#ifdef GHASH -#undef GHASH -#define GHASH(ctx, in, len) (*gcm_ghash_p)((ctx)->Xi.u, (ctx)->Htable, in, len) -#endif -#endif - -void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, - u128 *out_key, u128 out_table[16], - int *out_is_avx, - const uint8_t *gcm_key) { - *out_is_avx = 0; - - union { - uint64_t u[2]; - uint8_t c[16]; - } H; - - OPENSSL_memcpy(H.c, gcm_key, 16); - - // H is stored in host byte order - H.u[0] = CRYPTO_bswap8(H.u[0]); - H.u[1] = CRYPTO_bswap8(H.u[1]); - - OPENSSL_memcpy(out_key, H.c, 16); - -#if defined(GHASH_ASM_X86_64) - if (crypto_gcm_clmul_enabled()) { - if (((OPENSSL_ia32cap_get()[1] >> 22) & 0x41) == 0x41) { // AVX+MOVBE - gcm_init_avx(out_table, H.u); - *out_mult = gcm_gmult_avx; - *out_hash = gcm_ghash_avx; - *out_is_avx = 1; - return; - } - gcm_init_clmul(out_table, H.u); - *out_mult = gcm_gmult_clmul; - *out_hash = gcm_ghash_clmul; - return; - } -#elif defined(GHASH_ASM_X86) - if (crypto_gcm_clmul_enabled()) { - gcm_init_clmul(out_table, H.u); - *out_mult = gcm_gmult_clmul; - *out_hash = gcm_ghash_clmul; - return; - } -#elif defined(GHASH_ASM_ARM) - if (pmull_capable()) { - gcm_init_v8(out_table, H.u); - *out_mult = gcm_gmult_v8; - *out_hash = gcm_ghash_v8; - return; - } - - if (neon_capable()) { - gcm_init_neon(out_table, H.u); - *out_mult = gcm_gmult_neon; - *out_hash = gcm_ghash_neon; - return; - } -#elif defined(GHASH_ASM_PPC64LE) - if (CRYPTO_is_PPC64LE_vcrypto_capable()) { - gcm_init_p8(out_table, H.u); - *out_mult = gcm_gmult_p8; - *out_hash = gcm_ghash_p8; - return; - } -#endif - - gcm_init_4bit(out_table, H.u); -#if defined(GHASH_ASM_X86) - *out_mult = gcm_gmult_4bit_mmx; - *out_hash = gcm_ghash_4bit_mmx; -#else - *out_mult = gcm_gmult_4bit; - *out_hash = gcm_ghash_4bit; -#endif -} - -void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, const void *aes_key, - block128_f block, int is_aesni_encrypt) { - OPENSSL_memset(ctx, 0, sizeof(*ctx)); - ctx->block = block; - - uint8_t gcm_key[16]; - OPENSSL_memset(gcm_key, 0, sizeof(gcm_key)); - (*block)(gcm_key, gcm_key, aes_key); - - int is_avx; - CRYPTO_ghash_init(&ctx->gmult, &ctx->ghash, &ctx->H, ctx->Htable, &is_avx, - gcm_key); - - ctx->use_aesni_gcm_crypt = (is_avx && is_aesni_encrypt) ? 1 : 0; -} - -void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *iv, size_t len) { - unsigned int ctr; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#endif - - ctx->Yi.u[0] = 0; - ctx->Yi.u[1] = 0; - ctx->Xi.u[0] = 0; - ctx->Xi.u[1] = 0; - ctx->len.u[0] = 0; // AAD length - ctx->len.u[1] = 0; // message length - ctx->ares = 0; - ctx->mres = 0; - - if (len == 12) { - OPENSSL_memcpy(ctx->Yi.c, iv, 12); - ctx->Yi.c[15] = 1; - ctr = 1; - } else { - uint64_t len0 = len; - - while (len >= 16) { - for (size_t i = 0; i < 16; ++i) { - ctx->Yi.c[i] ^= iv[i]; - } - GCM_MUL(ctx, Yi); - iv += 16; - len -= 16; - } - if (len) { - for (size_t i = 0; i < len; ++i) { - ctx->Yi.c[i] ^= iv[i]; - } - GCM_MUL(ctx, Yi); - } - len0 <<= 3; - ctx->Yi.u[1] ^= CRYPTO_bswap8(len0); - - GCM_MUL(ctx, Yi); - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - } - - (*ctx->block)(ctx->Yi.c, ctx->EK0.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); -} - -int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) { - unsigned int n; - uint64_t alen = ctx->len.u[0]; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - if (ctx->len.u[1]) { - return 0; - } - - alen += len; - if (alen > (UINT64_C(1) << 61) || (sizeof(len) == 8 && alen < len)) { - return 0; - } - ctx->len.u[0] = alen; - - n = ctx->ares; - if (n) { - while (n && len) { - ctx->Xi.c[n] ^= *(aad++); - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->ares = n; - return 1; - } - } - - // Process a whole number of blocks. -#ifdef GHASH - size_t len_blocks = len & kSizeTWithoutLower4Bits; - if (len_blocks != 0) { - GHASH(ctx, aad, len_blocks); - aad += len_blocks; - len -= len_blocks; - } -#else - while (len >= 16) { - for (size_t i = 0; i < 16; ++i) { - ctx->Xi.c[i] ^= aad[i]; - } - GCM_MUL(ctx, Xi); - aad += 16; - len -= 16; - } -#endif - - // Process the remainder. - if (len != 0) { - n = (unsigned int)len; - for (size_t i = 0; i < len; ++i) { - ctx->Xi.c[i] ^= aad[i]; - } - } - - ctx->ares = n; - return 1; -} - -int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, size_t len) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; - block128_f block = ctx->block; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to encrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - - n = ctx->mres; - if (n) { - while (n && len) { - ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out) % sizeof(size_t) != 0) { - for (size_t i = 0; i < len; ++i) { - if (n == 0) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - } - ctx->Xi.c[n] ^= out[i] = in[i] ^ ctx->EKi.c[n]; - n = (n + 1) % 16; - if (n == 0) { - GCM_MUL(ctx, Xi); - } - } - - ctx->mres = n; - return 1; - } -#if defined(GHASH) && defined(GHASH_CHUNK) - while (len >= GHASH_CHUNK) { - size_t j = GHASH_CHUNK; - - while (j) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - j -= 16; - } - GHASH(ctx, out - GHASH_CHUNK, GHASH_CHUNK); - len -= GHASH_CHUNK; - } - size_t len_blocks = len & kSizeTWithoutLower4Bits; - if (len_blocks != 0) { - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - len -= 16; - } - GHASH(ctx, out - len_blocks, len_blocks); - } -#else - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - size_t tmp = load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]; - store_word_le(out + i, tmp); - ctx->Xi.t[i / sizeof(size_t)] ^= tmp; - } - GCM_MUL(ctx, Xi); - out += 16; - in += 16; - len -= 16; - } -#endif - if (len) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const void *key, - const unsigned char *in, unsigned char *out, - size_t len) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; - block128_f block = ctx->block; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to decrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - - n = ctx->mres; - if (n) { - while (n && len) { - uint8_t c = *(in++); - *(out++) = c ^ ctx->EKi.c[n]; - ctx->Xi.c[n] ^= c; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out) % sizeof(size_t) != 0) { - for (size_t i = 0; i < len; ++i) { - uint8_t c; - if (n == 0) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - } - c = in[i]; - out[i] = c ^ ctx->EKi.c[n]; - ctx->Xi.c[n] ^= c; - n = (n + 1) % 16; - if (n == 0) { - GCM_MUL(ctx, Xi); - } - } - - ctx->mres = n; - return 1; - } -#if defined(GHASH) && defined(GHASH_CHUNK) - while (len >= GHASH_CHUNK) { - size_t j = GHASH_CHUNK; - - GHASH(ctx, in, GHASH_CHUNK); - while (j) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - j -= 16; - } - len -= GHASH_CHUNK; - } - size_t len_blocks = len & kSizeTWithoutLower4Bits; - if (len_blocks != 0) { - GHASH(ctx, in, len_blocks); - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - store_word_le(out + i, - load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); - } - out += 16; - in += 16; - len -= 16; - } - } -#else - while (len >= 16) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - for (size_t i = 0; i < 16; i += sizeof(size_t)) { - size_t c = load_word_le(in + i); - store_word_le(out + i, c ^ ctx->EKi.t[i / sizeof(size_t)]); - ctx->Xi.t[i / sizeof(size_t)] ^= c; - } - GCM_MUL(ctx, Xi); - out += 16; - in += 16; - len -= 16; - } -#endif - if (len) { - (*block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - uint8_t c = in[n]; - ctx->Xi.c[n] ^= c; - out[n] = c ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, size_t len, - ctr128_f stream) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to encrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - n = ctx->mres; - if (n) { - while (n && len) { - ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - -#if defined(AESNI_GCM) - if (ctx->use_aesni_gcm_crypt) { - // |aesni_gcm_encrypt| may not process all the input given to it. It may - // not process *any* of its input if it is deemed too small. - size_t bulk = aesni_gcm_encrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); - in += bulk; - out += bulk; - len -= bulk; - } -#endif - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - -#if defined(GHASH) - while (len >= GHASH_CHUNK) { - (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); - ctr += GHASH_CHUNK / 16; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - GHASH(ctx, out, GHASH_CHUNK); - out += GHASH_CHUNK; - in += GHASH_CHUNK; - len -= GHASH_CHUNK; - } -#endif - size_t i = len & kSizeTWithoutLower4Bits; - if (i != 0) { - size_t j = i / 16; - - (*stream)(in, out, j, key, ctx->Yi.c); - ctr += (unsigned int)j; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - in += i; - len -= i; -#if defined(GHASH) - GHASH(ctx, out, i); - out += i; -#else - while (j--) { - for (i = 0; i < 16; ++i) { - ctx->Xi.c[i] ^= out[i]; - } - GCM_MUL(ctx, Xi); - out += 16; - } -#endif - } - if (len) { - (*ctx->block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, size_t len, - ctr128_f stream) { - unsigned int n, ctr; - uint64_t mlen = ctx->len.u[1]; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#ifdef GHASH - void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, - size_t len) = ctx->ghash; -#endif -#endif - - mlen += len; - if (mlen > ((UINT64_C(1) << 36) - 32) || - (sizeof(len) == 8 && mlen < len)) { - return 0; - } - ctx->len.u[1] = mlen; - - if (ctx->ares) { - // First call to decrypt finalizes GHASH(AAD) - GCM_MUL(ctx, Xi); - ctx->ares = 0; - } - - n = ctx->mres; - if (n) { - while (n && len) { - uint8_t c = *(in++); - *(out++) = c ^ ctx->EKi.c[n]; - ctx->Xi.c[n] ^= c; - --len; - n = (n + 1) % 16; - } - if (n == 0) { - GCM_MUL(ctx, Xi); - } else { - ctx->mres = n; - return 1; - } - } - -#if defined(AESNI_GCM) - if (ctx->use_aesni_gcm_crypt) { - // |aesni_gcm_decrypt| may not process all the input given to it. It may - // not process *any* of its input if it is deemed too small. - size_t bulk = aesni_gcm_decrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); - in += bulk; - out += bulk; - len -= bulk; - } -#endif - - ctr = CRYPTO_bswap4(ctx->Yi.d[3]); - -#if defined(GHASH) - while (len >= GHASH_CHUNK) { - GHASH(ctx, in, GHASH_CHUNK); - (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); - ctr += GHASH_CHUNK / 16; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - out += GHASH_CHUNK; - in += GHASH_CHUNK; - len -= GHASH_CHUNK; - } -#endif - size_t i = len & kSizeTWithoutLower4Bits; - if (i != 0) { - size_t j = i / 16; - -#if defined(GHASH) - GHASH(ctx, in, i); -#else - while (j--) { - size_t k; - for (k = 0; k < 16; ++k) { - ctx->Xi.c[k] ^= in[k]; - } - GCM_MUL(ctx, Xi); - in += 16; - } - j = i / 16; - in -= i; -#endif - (*stream)(in, out, j, key, ctx->Yi.c); - ctr += (unsigned int)j; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - out += i; - in += i; - len -= i; - } - if (len) { - (*ctx->block)(ctx->Yi.c, ctx->EKi.c, key); - ++ctr; - ctx->Yi.d[3] = CRYPTO_bswap4(ctr); - while (len--) { - uint8_t c = in[n]; - ctx->Xi.c[n] ^= c; - out[n] = c ^ ctx->EKi.c[n]; - ++n; - } - } - - ctx->mres = n; - return 1; -} - -int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) { - uint64_t alen = ctx->len.u[0] << 3; - uint64_t clen = ctx->len.u[1] << 3; -#ifdef GCM_FUNCREF_4BIT - void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = ctx->gmult; -#endif - - if (ctx->mres || ctx->ares) { - GCM_MUL(ctx, Xi); - } - - alen = CRYPTO_bswap8(alen); - clen = CRYPTO_bswap8(clen); - - ctx->Xi.u[0] ^= alen; - ctx->Xi.u[1] ^= clen; - GCM_MUL(ctx, Xi); - - ctx->Xi.u[0] ^= ctx->EK0.u[0]; - ctx->Xi.u[1] ^= ctx->EK0.u[1]; - - if (tag && len <= sizeof(ctx->Xi)) { - return CRYPTO_memcmp(ctx->Xi.c, tag, len) == 0; - } else { - return 0; - } -} - -void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) { - CRYPTO_gcm128_finish(ctx, NULL, 0); - OPENSSL_memcpy(tag, ctx->Xi.c, - len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c)); -} - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -int crypto_gcm_clmul_enabled(void) { -#ifdef GHASH_ASM - const uint32_t *ia32cap = OPENSSL_ia32cap_get(); - return (ia32cap[0] & (1 << 24)) && // check FXSR bit - (ia32cap[1] & (1 << 1)); // check PCLMULQDQ bit -#else - return 0; -#endif -} -#endif diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/internal.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/internal.h deleted file mode 100644 index 08d8d9c7f..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/internal.h +++ /dev/null @@ -1,388 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#ifndef OPENSSL_HEADER_MODES_INTERNAL_H -#define OPENSSL_HEADER_MODES_INTERNAL_H - -#include - -#include - -#include "../../internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -#define STRICT_ALIGNMENT 1 -#if defined(OPENSSL_X86_64) || defined(OPENSSL_X86) || defined(OPENSSL_AARCH64) -#undef STRICT_ALIGNMENT -#define STRICT_ALIGNMENT 0 -#endif - -static inline uint32_t GETU32(const void *in) { - uint32_t v; - OPENSSL_memcpy(&v, in, sizeof(v)); - return CRYPTO_bswap4(v); -} - -static inline void PUTU32(void *out, uint32_t v) { - v = CRYPTO_bswap4(v); - OPENSSL_memcpy(out, &v, sizeof(v)); -} - -static inline size_t load_word_le(const void *in) { - size_t v; - OPENSSL_memcpy(&v, in, sizeof(v)); - return v; -} - -static inline void store_word_le(void *out, size_t v) { - OPENSSL_memcpy(out, &v, sizeof(v)); -} - -// block128_f is the type of a 128-bit, block cipher. -typedef void (*block128_f)(const uint8_t in[16], uint8_t out[16], - const void *key); - -// GCM definitions -typedef struct { uint64_t hi,lo; } u128; - -// gmult_func multiplies |Xi| by the GCM key and writes the result back to -// |Xi|. -typedef void (*gmult_func)(uint64_t Xi[2], const u128 Htable[16]); - -// ghash_func repeatedly multiplies |Xi| by the GCM key and adds in blocks from -// |inp|. The result is written back to |Xi| and the |len| argument must be a -// multiple of 16. -typedef void (*ghash_func)(uint64_t Xi[2], const u128 Htable[16], - const uint8_t *inp, size_t len); - -// This differs from upstream's |gcm128_context| in that it does not have the -// |key| pointer, in order to make it |memcpy|-friendly. Rather the key is -// passed into each call that needs it. -struct gcm128_context { - // Following 6 names follow names in GCM specification - union { - uint64_t u[2]; - uint32_t d[4]; - uint8_t c[16]; - size_t t[16 / sizeof(size_t)]; - } Yi, EKi, EK0, len, Xi; - - // Note that the order of |Xi|, |H| and |Htable| is fixed by the MOVBE-based, - // x86-64, GHASH assembly. - u128 H; - u128 Htable[16]; - gmult_func gmult; - ghash_func ghash; - - unsigned int mres, ares; - block128_f block; - - // use_aesni_gcm_crypt is true if this context should use the assembly - // functions |aesni_gcm_encrypt| and |aesni_gcm_decrypt| to process data. - unsigned use_aesni_gcm_crypt:1; -}; - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -// crypto_gcm_clmul_enabled returns one if the CLMUL implementation of GCM is -// used. -int crypto_gcm_clmul_enabled(void); -#endif - - -// CTR. - -// ctr128_f is the type of a function that performs CTR-mode encryption. -typedef void (*ctr128_f)(const uint8_t *in, uint8_t *out, size_t blocks, - const void *key, const uint8_t ivec[16]); - -// CRYPTO_ctr128_encrypt encrypts (or decrypts, it's the same in CTR mode) -// |len| bytes from |in| to |out| using |block| in counter mode. There's no -// requirement that |len| be a multiple of any value and any partial blocks are -// stored in |ecount_buf| and |*num|, which must be zeroed before the initial -// call. The counter is a 128-bit, big-endian value in |ivec| and is -// incremented by this function. -void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - uint8_t ecount_buf[16], unsigned *num, - block128_f block); - -// CRYPTO_ctr128_encrypt_ctr32 acts like |CRYPTO_ctr128_encrypt| but takes -// |ctr|, a function that performs CTR mode but only deals with the lower 32 -// bits of the counter. This is useful when |ctr| can be an optimised -// function. -void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - uint8_t ecount_buf[16], unsigned *num, - ctr128_f ctr); - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) -void aesni_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t blocks, - const void *key, const uint8_t *ivec); -#endif - - -// GCM. -// -// This API differs from the upstream API slightly. The |GCM128_CONTEXT| does -// not have a |key| pointer that points to the key as upstream's version does. -// Instead, every function takes a |key| parameter. This way |GCM128_CONTEXT| -// can be safely copied. - -typedef struct gcm128_context GCM128_CONTEXT; - -// CRYPTO_ghash_init writes a precomputed table of powers of |gcm_key| to -// |out_table| and sets |*out_mult| and |*out_hash| to (potentially hardware -// accelerated) functions for performing operations in the GHASH field. If the -// AVX implementation was used |*out_is_avx| will be true. -void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, - u128 *out_key, u128 out_table[16], int *out_is_avx, - const uint8_t *gcm_key); - -// CRYPTO_gcm128_init initialises |ctx| to use |block| (typically AES) with -// the given key. |is_aesni_encrypt| is one if |block| is |aesni_encrypt|. -OPENSSL_EXPORT void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, const void *key, - block128_f block, int is_aesni_encrypt); - -// CRYPTO_gcm128_setiv sets the IV (nonce) for |ctx|. The |key| must be the -// same key that was passed to |CRYPTO_gcm128_init|. -OPENSSL_EXPORT void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *iv, size_t iv_len); - -// CRYPTO_gcm128_aad sets the authenticated data for an instance of GCM. -// This must be called before and data is encrypted. It returns one on success -// and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, - size_t len); - -// CRYPTO_gcm128_encrypt encrypts |len| bytes from |in| to |out|. The |key| -// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one -// on success and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, - size_t len); - -// CRYPTO_gcm128_decrypt decrypts |len| bytes from |in| to |out|. The |key| -// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one -// on success and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, - size_t len); - -// CRYPTO_gcm128_encrypt_ctr32 encrypts |len| bytes from |in| to |out| using -// a CTR function that only handles the bottom 32 bits of the nonce, like -// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was -// passed to |CRYPTO_gcm128_init|. It returns one on success and zero -// otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, - const void *key, - const uint8_t *in, uint8_t *out, - size_t len, ctr128_f stream); - -// CRYPTO_gcm128_decrypt_ctr32 decrypts |len| bytes from |in| to |out| using -// a CTR function that only handles the bottom 32 bits of the nonce, like -// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was -// passed to |CRYPTO_gcm128_init|. It returns one on success and zero -// otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, - const void *key, - const uint8_t *in, uint8_t *out, - size_t len, ctr128_f stream); - -// CRYPTO_gcm128_finish calculates the authenticator and compares it against -// |len| bytes of |tag|. It returns one on success and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, - size_t len); - -// CRYPTO_gcm128_tag calculates the authenticator and copies it into |tag|. -// The minimum of |len| and 16 bytes are copied into |tag|. -OPENSSL_EXPORT void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, uint8_t *tag, - size_t len); - - -// CCM. - -typedef struct ccm128_context { - block128_f block; - ctr128_f ctr; - unsigned M, L; -} CCM128_CONTEXT; - -// CRYPTO_ccm128_init initialises |ctx| to use |block| (typically AES) with the -// specified |M| and |L| parameters. It returns one on success and zero if |M| -// or |L| is invalid. -int CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, const void *key, block128_f block, - ctr128_f ctr, unsigned M, unsigned L); - -// CRYPTO_ccm128_max_input returns the maximum input length accepted by |ctx|. -size_t CRYPTO_ccm128_max_input(const CCM128_CONTEXT *ctx); - -// CRYPTO_ccm128_encrypt encrypts |len| bytes from |in| to |out| writing the tag -// to |out_tag|. |key| must be the same key that was passed to -// |CRYPTO_ccm128_init|. It returns one on success and zero otherwise. -int CRYPTO_ccm128_encrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len); - -// CRYPTO_ccm128_decrypt decrypts |len| bytes from |in| to |out|, writing the -// expected tag to |out_tag|. |key| must be the same key that was passed to -// |CRYPTO_ccm128_init|. It returns one on success and zero otherwise. -int CRYPTO_ccm128_decrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len); - - -// CBC. - -// cbc128_f is the type of a function that performs CBC-mode encryption. -typedef void (*cbc128_f)(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], int enc); - -// CRYPTO_cbc128_encrypt encrypts |len| bytes from |in| to |out| using the -// given IV and block cipher in CBC mode. The input need not be a multiple of -// 128 bits long, but the output will round up to the nearest 128 bit multiple, -// zero padding the input if needed. The IV will be updated on return. -void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], block128_f block); - -// CRYPTO_cbc128_decrypt decrypts |len| bytes from |in| to |out| using the -// given IV and block cipher in CBC mode. If |len| is not a multiple of 128 -// bits then only that many bytes will be written, but a multiple of 128 bits -// is always read from |in|. The IV will be updated on return. -void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], block128_f block); - - -// OFB. - -// CRYPTO_ofb128_encrypt encrypts (or decrypts, it's the same with OFB mode) -// |len| bytes from |in| to |out| using |block| in OFB mode. There's no -// requirement that |len| be a multiple of any value and any partial blocks are -// stored in |ivec| and |*num|, the latter must be zero before the initial -// call. -void CRYPTO_ofb128_encrypt(const uint8_t *in, uint8_t *out, - size_t len, const void *key, uint8_t ivec[16], - unsigned *num, block128_f block); - - -// CFB. - -// CRYPTO_cfb128_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes -// from |in| to |out| using |block| in CFB mode. There's no requirement that -// |len| be a multiple of any value and any partial blocks are stored in |ivec| -// and |*num|, the latter must be zero before the initial call. -void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block); - -// CRYPTO_cfb128_8_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes -// from |in| to |out| using |block| in CFB-8 mode. Prior to the first call -// |num| should be set to zero. -void CRYPTO_cfb128_8_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block); - -// CRYPTO_cfb128_1_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes -// from |in| to |out| using |block| in CFB-1 mode. Prior to the first call -// |num| should be set to zero. -void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block); - -size_t CRYPTO_cts128_encrypt_block(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - block128_f block); - - -// POLYVAL. -// -// POLYVAL is a polynomial authenticator that operates over a field very -// similar to the one that GHASH uses. See -// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02#section-3. - -typedef union { - uint64_t u[2]; - uint8_t c[16]; -} polyval_block; - -struct polyval_ctx { - // Note that the order of |S|, |H| and |Htable| is fixed by the MOVBE-based, - // x86-64, GHASH assembly. - polyval_block S; - u128 H; - u128 Htable[16]; - gmult_func gmult; - ghash_func ghash; -}; - -// CRYPTO_POLYVAL_init initialises |ctx| using |key|. -void CRYPTO_POLYVAL_init(struct polyval_ctx *ctx, const uint8_t key[16]); - -// CRYPTO_POLYVAL_update_blocks updates the accumulator in |ctx| given the -// blocks from |in|. Only a whole number of blocks can be processed so |in_len| -// must be a multiple of 16. -void CRYPTO_POLYVAL_update_blocks(struct polyval_ctx *ctx, const uint8_t *in, - size_t in_len); - -// CRYPTO_POLYVAL_finish writes the accumulator from |ctx| to |out|. -void CRYPTO_POLYVAL_finish(const struct polyval_ctx *ctx, uint8_t out[16]); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_MODES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/internal.h.grpc_back deleted file mode 100644 index de6c50351..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/internal.h.grpc_back +++ /dev/null @@ -1,388 +0,0 @@ -/* ==================================================================== - * Copyright (c) 2008 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== */ - -#ifndef OPENSSL_HEADER_MODES_INTERNAL_H -#define OPENSSL_HEADER_MODES_INTERNAL_H - -#include - -#include - -#include "../../internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -#define STRICT_ALIGNMENT 1 -#if defined(OPENSSL_X86_64) || defined(OPENSSL_X86) || defined(OPENSSL_AARCH64) -#undef STRICT_ALIGNMENT -#define STRICT_ALIGNMENT 0 -#endif - -static inline uint32_t GETU32(const void *in) { - uint32_t v; - OPENSSL_memcpy(&v, in, sizeof(v)); - return CRYPTO_bswap4(v); -} - -static inline void PUTU32(void *out, uint32_t v) { - v = CRYPTO_bswap4(v); - OPENSSL_memcpy(out, &v, sizeof(v)); -} - -static inline size_t load_word_le(const void *in) { - size_t v; - OPENSSL_memcpy(&v, in, sizeof(v)); - return v; -} - -static inline void store_word_le(void *out, size_t v) { - OPENSSL_memcpy(out, &v, sizeof(v)); -} - -// block128_f is the type of a 128-bit, block cipher. -typedef void (*block128_f)(const uint8_t in[16], uint8_t out[16], - const void *key); - -// GCM definitions -typedef struct { uint64_t hi,lo; } u128; - -// gmult_func multiplies |Xi| by the GCM key and writes the result back to -// |Xi|. -typedef void (*gmult_func)(uint64_t Xi[2], const u128 Htable[16]); - -// ghash_func repeatedly multiplies |Xi| by the GCM key and adds in blocks from -// |inp|. The result is written back to |Xi| and the |len| argument must be a -// multiple of 16. -typedef void (*ghash_func)(uint64_t Xi[2], const u128 Htable[16], - const uint8_t *inp, size_t len); - -// This differs from upstream's |gcm128_context| in that it does not have the -// |key| pointer, in order to make it |memcpy|-friendly. Rather the key is -// passed into each call that needs it. -struct gcm128_context { - // Following 6 names follow names in GCM specification - union { - uint64_t u[2]; - uint32_t d[4]; - uint8_t c[16]; - size_t t[16 / sizeof(size_t)]; - } Yi, EKi, EK0, len, Xi; - - // Note that the order of |Xi|, |H| and |Htable| is fixed by the MOVBE-based, - // x86-64, GHASH assembly. - u128 H; - u128 Htable[16]; - gmult_func gmult; - ghash_func ghash; - - unsigned int mres, ares; - block128_f block; - - // use_aesni_gcm_crypt is true if this context should use the assembly - // functions |aesni_gcm_encrypt| and |aesni_gcm_decrypt| to process data. - unsigned use_aesni_gcm_crypt:1; -}; - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -// crypto_gcm_clmul_enabled returns one if the CLMUL implementation of GCM is -// used. -int crypto_gcm_clmul_enabled(void); -#endif - - -// CTR. - -// ctr128_f is the type of a function that performs CTR-mode encryption. -typedef void (*ctr128_f)(const uint8_t *in, uint8_t *out, size_t blocks, - const void *key, const uint8_t ivec[16]); - -// CRYPTO_ctr128_encrypt encrypts (or decrypts, it's the same in CTR mode) -// |len| bytes from |in| to |out| using |block| in counter mode. There's no -// requirement that |len| be a multiple of any value and any partial blocks are -// stored in |ecount_buf| and |*num|, which must be zeroed before the initial -// call. The counter is a 128-bit, big-endian value in |ivec| and is -// incremented by this function. -void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - uint8_t ecount_buf[16], unsigned *num, - block128_f block); - -// CRYPTO_ctr128_encrypt_ctr32 acts like |CRYPTO_ctr128_encrypt| but takes -// |ctr|, a function that performs CTR mode but only deals with the lower 32 -// bits of the counter. This is useful when |ctr| can be an optimised -// function. -void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - uint8_t ecount_buf[16], unsigned *num, - ctr128_f ctr); - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64)) -void aesni_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t blocks, - const void *key, const uint8_t *ivec); -#endif - - -// GCM. -// -// This API differs from the upstream API slightly. The |GCM128_CONTEXT| does -// not have a |key| pointer that points to the key as upstream's version does. -// Instead, every function takes a |key| parameter. This way |GCM128_CONTEXT| -// can be safely copied. - -typedef struct gcm128_context GCM128_CONTEXT; - -// CRYPTO_ghash_init writes a precomputed table of powers of |gcm_key| to -// |out_table| and sets |*out_mult| and |*out_hash| to (potentially hardware -// accelerated) functions for performing operations in the GHASH field. If the -// AVX implementation was used |*out_is_avx| will be true. -void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, - u128 *out_key, u128 out_table[16], int *out_is_avx, - const uint8_t *gcm_key); - -// CRYPTO_gcm128_init initialises |ctx| to use |block| (typically AES) with -// the given key. |is_aesni_encrypt| is one if |block| is |aesni_encrypt|. -OPENSSL_EXPORT void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, const void *key, - block128_f block, int is_aesni_encrypt); - -// CRYPTO_gcm128_setiv sets the IV (nonce) for |ctx|. The |key| must be the -// same key that was passed to |CRYPTO_gcm128_init|. -OPENSSL_EXPORT void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *iv, size_t iv_len); - -// CRYPTO_gcm128_aad sets the authenticated data for an instance of GCM. -// This must be called before and data is encrypted. It returns one on success -// and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, - size_t len); - -// CRYPTO_gcm128_encrypt encrypts |len| bytes from |in| to |out|. The |key| -// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one -// on success and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, - size_t len); - -// CRYPTO_gcm128_decrypt decrypts |len| bytes from |in| to |out|. The |key| -// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one -// on success and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const void *key, - const uint8_t *in, uint8_t *out, - size_t len); - -// CRYPTO_gcm128_encrypt_ctr32 encrypts |len| bytes from |in| to |out| using -// a CTR function that only handles the bottom 32 bits of the nonce, like -// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was -// passed to |CRYPTO_gcm128_init|. It returns one on success and zero -// otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, - const void *key, - const uint8_t *in, uint8_t *out, - size_t len, ctr128_f stream); - -// CRYPTO_gcm128_decrypt_ctr32 decrypts |len| bytes from |in| to |out| using -// a CTR function that only handles the bottom 32 bits of the nonce, like -// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was -// passed to |CRYPTO_gcm128_init|. It returns one on success and zero -// otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, - const void *key, - const uint8_t *in, uint8_t *out, - size_t len, ctr128_f stream); - -// CRYPTO_gcm128_finish calculates the authenticator and compares it against -// |len| bytes of |tag|. It returns one on success and zero otherwise. -OPENSSL_EXPORT int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, - size_t len); - -// CRYPTO_gcm128_tag calculates the authenticator and copies it into |tag|. -// The minimum of |len| and 16 bytes are copied into |tag|. -OPENSSL_EXPORT void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, uint8_t *tag, - size_t len); - - -// CCM. - -typedef struct ccm128_context { - block128_f block; - ctr128_f ctr; - unsigned M, L; -} CCM128_CONTEXT; - -// CRYPTO_ccm128_init initialises |ctx| to use |block| (typically AES) with the -// specified |M| and |L| parameters. It returns one on success and zero if |M| -// or |L| is invalid. -int CRYPTO_ccm128_init(CCM128_CONTEXT *ctx, const void *key, block128_f block, - ctr128_f ctr, unsigned M, unsigned L); - -// CRYPTO_ccm128_max_input returns the maximum input length accepted by |ctx|. -size_t CRYPTO_ccm128_max_input(const CCM128_CONTEXT *ctx); - -// CRYPTO_ccm128_encrypt encrypts |len| bytes from |in| to |out| writing the tag -// to |out_tag|. |key| must be the same key that was passed to -// |CRYPTO_ccm128_init|. It returns one on success and zero otherwise. -int CRYPTO_ccm128_encrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len); - -// CRYPTO_ccm128_decrypt decrypts |len| bytes from |in| to |out|, writing the -// expected tag to |out_tag|. |key| must be the same key that was passed to -// |CRYPTO_ccm128_init|. It returns one on success and zero otherwise. -int CRYPTO_ccm128_decrypt(const CCM128_CONTEXT *ctx, const void *key, - uint8_t *out, uint8_t *out_tag, size_t tag_len, - const uint8_t *nonce, size_t nonce_len, - const uint8_t *in, size_t len, const uint8_t *aad, - size_t aad_len); - - -// CBC. - -// cbc128_f is the type of a function that performs CBC-mode encryption. -typedef void (*cbc128_f)(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], int enc); - -// CRYPTO_cbc128_encrypt encrypts |len| bytes from |in| to |out| using the -// given IV and block cipher in CBC mode. The input need not be a multiple of -// 128 bits long, but the output will round up to the nearest 128 bit multiple, -// zero padding the input if needed. The IV will be updated on return. -void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], block128_f block); - -// CRYPTO_cbc128_decrypt decrypts |len| bytes from |in| to |out| using the -// given IV and block cipher in CBC mode. If |len| is not a multiple of 128 -// bits then only that many bytes will be written, but a multiple of 128 bits -// is always read from |in|. The IV will be updated on return. -void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], block128_f block); - - -// OFB. - -// CRYPTO_ofb128_encrypt encrypts (or decrypts, it's the same with OFB mode) -// |len| bytes from |in| to |out| using |block| in OFB mode. There's no -// requirement that |len| be a multiple of any value and any partial blocks are -// stored in |ivec| and |*num|, the latter must be zero before the initial -// call. -void CRYPTO_ofb128_encrypt(const uint8_t *in, uint8_t *out, - size_t len, const void *key, uint8_t ivec[16], - unsigned *num, block128_f block); - - -// CFB. - -// CRYPTO_cfb128_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes -// from |in| to |out| using |block| in CFB mode. There's no requirement that -// |len| be a multiple of any value and any partial blocks are stored in |ivec| -// and |*num|, the latter must be zero before the initial call. -void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block); - -// CRYPTO_cfb128_8_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes -// from |in| to |out| using |block| in CFB-8 mode. Prior to the first call -// |num| should be set to zero. -void CRYPTO_cfb128_8_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block); - -// CRYPTO_cfb128_1_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes -// from |in| to |out| using |block| in CFB-1 mode. Prior to the first call -// |num| should be set to zero. -void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block); - -size_t CRYPTO_cts128_encrypt_block(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], - block128_f block); - - -// POLYVAL. -// -// POLYVAL is a polynomial authenticator that operates over a field very -// similar to the one that GHASH uses. See -// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02#section-3. - -typedef union { - uint64_t u[2]; - uint8_t c[16]; -} polyval_block; - -struct polyval_ctx { - // Note that the order of |S|, |H| and |Htable| is fixed by the MOVBE-based, - // x86-64, GHASH assembly. - polyval_block S; - u128 H; - u128 Htable[16]; - gmult_func gmult; - ghash_func ghash; -}; - -// CRYPTO_POLYVAL_init initialises |ctx| using |key|. -void CRYPTO_POLYVAL_init(struct polyval_ctx *ctx, const uint8_t key[16]); - -// CRYPTO_POLYVAL_update_blocks updates the accumulator in |ctx| given the -// blocks from |in|. Only a whole number of blocks can be processed so |in_len| -// must be a multiple of 16. -void CRYPTO_POLYVAL_update_blocks(struct polyval_ctx *ctx, const uint8_t *in, - size_t in_len); - -// CRYPTO_POLYVAL_finish writes the accumulator from |ctx| to |out|. -void CRYPTO_POLYVAL_finish(const struct polyval_ctx *ctx, uint8_t out[16]); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_MODES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/internal.h b/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/internal.h deleted file mode 100644 index 482b84411..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/internal.h +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H -#define OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H - -#include - -#include "../../internal.h" -#include "../modes/internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -// RAND_bytes_with_additional_data samples from the RNG after mixing 32 bytes -// from |user_additional_data| in. -void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, - const uint8_t user_additional_data[32]); - -// CRYPTO_sysrand fills |len| bytes at |buf| with entropy from the operating -// system. -void CRYPTO_sysrand(uint8_t *buf, size_t len); - -// rand_fork_unsafe_buffering_enabled returns whether fork-unsafe buffering has -// been enabled via |RAND_enable_fork_unsafe_buffering|. -int rand_fork_unsafe_buffering_enabled(void); - -// CTR_DRBG_STATE contains the state of a CTR_DRBG based on AES-256. See SP -// 800-90Ar1. -typedef struct { - AES_KEY ks; - block128_f block; - ctr128_f ctr; - union { - uint8_t bytes[16]; - uint32_t words[4]; - } counter; - uint64_t reseed_counter; -} CTR_DRBG_STATE; - -// See SP 800-90Ar1, table 3. -#define CTR_DRBG_ENTROPY_LEN 48 -#define CTR_DRBG_MAX_GENERATE_LENGTH 65536 - -// CTR_DRBG_init initialises |*drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of -// entropy in |entropy| and, optionally, a personalization string up to -// |CTR_DRBG_ENTROPY_LEN| bytes in length. It returns one on success and zero -// on error. -OPENSSL_EXPORT int CTR_DRBG_init(CTR_DRBG_STATE *drbg, - const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], - const uint8_t *personalization, - size_t personalization_len); - -// CTR_DRBG_reseed reseeds |drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of entropy -// in |entropy| and, optionally, up to |CTR_DRBG_ENTROPY_LEN| bytes of -// additional data. It returns one on success or zero on error. -OPENSSL_EXPORT int CTR_DRBG_reseed(CTR_DRBG_STATE *drbg, - const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], - const uint8_t *additional_data, - size_t additional_data_len); - -// CTR_DRBG_generate processes to up |CTR_DRBG_ENTROPY_LEN| bytes of additional -// data (if any) and then writes |out_len| random bytes to |out|, where -// |out_len| <= |CTR_DRBG_MAX_GENERATE_LENGTH|. It returns one on success or -// zero on error. -OPENSSL_EXPORT int CTR_DRBG_generate(CTR_DRBG_STATE *drbg, uint8_t *out, - size_t out_len, - const uint8_t *additional_data, - size_t additional_data_len); - -// CTR_DRBG_clear zeroises the state of |drbg|. -OPENSSL_EXPORT void CTR_DRBG_clear(CTR_DRBG_STATE *drbg); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/internal.h.grpc_back deleted file mode 100644 index f73f4a177..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/internal.h.grpc_back +++ /dev/null @@ -1,92 +0,0 @@ -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H -#define OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H - -#include - -#include "../../internal.h" -#include "../modes/internal.h" - -#if defined(__cplusplus) -extern "C" { -#endif - - -// RAND_bytes_with_additional_data samples from the RNG after mixing 32 bytes -// from |user_additional_data| in. -void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, - const uint8_t user_additional_data[32]); - -// CRYPTO_sysrand fills |len| bytes at |buf| with entropy from the operating -// system. -void CRYPTO_sysrand(uint8_t *buf, size_t len); - -// rand_fork_unsafe_buffering_enabled returns whether fork-unsafe buffering has -// been enabled via |RAND_enable_fork_unsafe_buffering|. -int rand_fork_unsafe_buffering_enabled(void); - -// CTR_DRBG_STATE contains the state of a CTR_DRBG based on AES-256. See SP -// 800-90Ar1. -typedef struct { - AES_KEY ks; - block128_f block; - ctr128_f ctr; - union { - uint8_t bytes[16]; - uint32_t words[4]; - } counter; - uint64_t reseed_counter; -} CTR_DRBG_STATE; - -// See SP 800-90Ar1, table 3. -#define CTR_DRBG_ENTROPY_LEN 48 -#define CTR_DRBG_MAX_GENERATE_LENGTH 65536 - -// CTR_DRBG_init initialises |*drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of -// entropy in |entropy| and, optionally, a personalization string up to -// |CTR_DRBG_ENTROPY_LEN| bytes in length. It returns one on success and zero -// on error. -OPENSSL_EXPORT int CTR_DRBG_init(CTR_DRBG_STATE *drbg, - const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], - const uint8_t *personalization, - size_t personalization_len); - -// CTR_DRBG_reseed reseeds |drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of entropy -// in |entropy| and, optionally, up to |CTR_DRBG_ENTROPY_LEN| bytes of -// additional data. It returns one on success or zero on error. -OPENSSL_EXPORT int CTR_DRBG_reseed(CTR_DRBG_STATE *drbg, - const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], - const uint8_t *additional_data, - size_t additional_data_len); - -// CTR_DRBG_generate processes to up |CTR_DRBG_ENTROPY_LEN| bytes of additional -// data (if any) and then writes |out_len| random bytes to |out|, where -// |out_len| <= |CTR_DRBG_MAX_GENERATE_LENGTH|. It returns one on success or -// zero on error. -OPENSSL_EXPORT int CTR_DRBG_generate(CTR_DRBG_STATE *drbg, uint8_t *out, - size_t out_len, - const uint8_t *additional_data, - size_t additional_data_len); - -// CTR_DRBG_clear zeroises the state of |drbg|. -OPENSSL_EXPORT void CTR_DRBG_clear(CTR_DRBG_STATE *drbg); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/urandom.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/urandom.c deleted file mode 100644 index 02557649b..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/urandom.c +++ /dev/null @@ -1,302 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#if !defined(_GNU_SOURCE) -#define _GNU_SOURCE // needed for syscall() on Linux. -#endif - -#include - -#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_FUCHSIA) && \ - !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) - -#include -#include -#include -#include -#include -#include - -#if defined(OPENSSL_LINUX) -#if defined(BORINGSSL_FIPS) -#include -#include -#endif -#include -#endif - -#include -#include - -#include "internal.h" -#include "../delocate.h" -#include "../../internal.h" - - -#if defined(OPENSSL_LINUX) - -#if defined(OPENSSL_X86_64) -#define EXPECTED_NR_getrandom 318 -#elif defined(OPENSSL_X86) -#define EXPECTED_NR_getrandom 355 -#elif defined(OPENSSL_AARCH64) -#define EXPECTED_NR_getrandom 278 -#elif defined(OPENSSL_ARM) -#define EXPECTED_NR_getrandom 384 -#elif defined(OPENSSL_PPC64LE) -#define EXPECTED_NR_getrandom 359 -#endif - -#if defined(EXPECTED_NR_getrandom) -#define USE_NR_getrandom - -#if defined(__NR_getrandom) - -#if __NR_getrandom != EXPECTED_NR_getrandom -#error "system call number for getrandom is not the expected value" -#endif - -#else // __NR_getrandom - -#define __NR_getrandom EXPECTED_NR_getrandom - -#endif // __NR_getrandom - -#endif // EXPECTED_NR_getrandom - -#if !defined(GRND_NONBLOCK) -#define GRND_NONBLOCK 1 -#endif - -#endif // OPENSSL_LINUX - -// rand_lock is used to protect the |*_requested| variables. -DEFINE_STATIC_MUTEX(rand_lock); - -// The following constants are magic values of |urandom_fd|. -static const int kUnset = 0; -static const int kHaveGetrandom = -3; - -// urandom_fd_requested is set by |RAND_set_urandom_fd|. It's protected by -// |rand_lock|. -DEFINE_BSS_GET(int, urandom_fd_requested); - -// urandom_fd is a file descriptor to /dev/urandom. It's protected by |once|. -DEFINE_BSS_GET(int, urandom_fd); - -DEFINE_STATIC_ONCE(rand_once); - -#if defined(USE_NR_getrandom) || defined(BORINGSSL_FIPS) -// message writes |msg| to stderr. We use this because referencing |stderr| -// with |fprintf| generates relocations, which is a problem inside the FIPS -// module. -static void message(const char *msg) { - ssize_t r; - do { - r = write(2, msg, strlen(msg)); - } while (r == -1 && errno == EINTR); -} -#endif - -// init_once initializes the state of this module to values previously -// requested. This is the only function that modifies |urandom_fd| and -// |urandom_buffering|, whose values may be read safely after calling the -// once. -static void init_once(void) { - CRYPTO_STATIC_MUTEX_lock_read(rand_lock_bss_get()); - int fd = *urandom_fd_requested_bss_get(); - CRYPTO_STATIC_MUTEX_unlock_read(rand_lock_bss_get()); - -#if defined(USE_NR_getrandom) - uint8_t dummy; - long getrandom_ret = - syscall(__NR_getrandom, &dummy, sizeof(dummy), GRND_NONBLOCK); - - if (getrandom_ret == 1) { - *urandom_fd_bss_get() = kHaveGetrandom; - return; - } else if (getrandom_ret == -1 && errno == EAGAIN) { - message( - "getrandom indicates that the entropy pool has not been initialized. " - "Rather than continue with poor entropy, this process will block until " - "entropy is available.\n"); - - do { - getrandom_ret = - syscall(__NR_getrandom, &dummy, sizeof(dummy), 0 /* no flags */); - } while (getrandom_ret == -1 && errno == EINTR); - - if (getrandom_ret == 1) { - *urandom_fd_bss_get() = kHaveGetrandom; - return; - } - } -#endif // USE_NR_getrandom - - if (fd == kUnset) { - do { - fd = open("/dev/urandom", O_RDONLY); - } while (fd == -1 && errno == EINTR); - } - - if (fd < 0) { - abort(); - } - - assert(kUnset == 0); - if (fd == kUnset) { - // Because we want to keep |urandom_fd| in the BSS, we have to initialise - // it to zero. But zero is a valid file descriptor too. Thus if open - // returns zero for /dev/urandom, we dup it to get a non-zero number. - fd = dup(fd); - close(kUnset); - - if (fd <= 0) { - abort(); - } - } - -#if defined(BORINGSSL_FIPS) - // In FIPS mode we ensure that the kernel has sufficient entropy before - // continuing. This is automatically handled by getrandom, which requires - // that the entropy pool has been initialised, but for urandom we have to - // poll. - for (;;) { - int entropy_bits; - if (ioctl(fd, RNDGETENTCNT, &entropy_bits)) { - message( - "RNDGETENTCNT on /dev/urandom failed. We cannot continue in this " - "case when in FIPS mode.\n"); - abort(); - } - - static const int kBitsNeeded = 256; - if (entropy_bits >= kBitsNeeded) { - break; - } - - usleep(250000); - } -#endif - - int flags = fcntl(fd, F_GETFD); - if (flags == -1) { - // Native Client doesn't implement |fcntl|. - if (errno != ENOSYS) { - abort(); - } - } else { - flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) { - abort(); - } - } - *urandom_fd_bss_get() = fd; -} - -void RAND_set_urandom_fd(int fd) { - fd = dup(fd); - if (fd < 0) { - abort(); - } - - assert(kUnset == 0); - if (fd == kUnset) { - // Because we want to keep |urandom_fd| in the BSS, we have to initialise - // it to zero. But zero is a valid file descriptor too. Thus if dup - // returned zero we dup it again to get a non-zero number. - fd = dup(fd); - close(kUnset); - - if (fd <= 0) { - abort(); - } - } - - CRYPTO_STATIC_MUTEX_lock_write(rand_lock_bss_get()); - *urandom_fd_requested_bss_get() = fd; - CRYPTO_STATIC_MUTEX_unlock_write(rand_lock_bss_get()); - - CRYPTO_once(rand_once_bss_get(), init_once); - if (*urandom_fd_bss_get() == kHaveGetrandom) { - close(fd); - } else if (*urandom_fd_bss_get() != fd) { - abort(); // Already initialized. - } -} - -#if defined(USE_NR_getrandom) && defined(OPENSSL_MSAN) -void __msan_unpoison(void *, size_t); -#endif - -// fill_with_entropy writes |len| bytes of entropy into |out|. It returns one -// on success and zero on error. -static char fill_with_entropy(uint8_t *out, size_t len) { - while (len > 0) { - ssize_t r; - - if (*urandom_fd_bss_get() == kHaveGetrandom) { -#if defined(USE_NR_getrandom) - do { - r = syscall(__NR_getrandom, out, len, 0 /* no flags */); - } while (r == -1 && errno == EINTR); - -#if defined(OPENSSL_MSAN) - if (r > 0) { - // MSAN doesn't recognise |syscall| and thus doesn't notice that we - // have initialised the output buffer. - __msan_unpoison(out, r); - } -#endif // OPENSSL_MSAN - -#else // USE_NR_getrandom - abort(); -#endif - } else { - do { - r = read(*urandom_fd_bss_get(), out, len); - } while (r == -1 && errno == EINTR); - } - - if (r <= 0) { - return 0; - } - out += r; - len -= r; - } - - return 1; -} - -// CRYPTO_sysrand puts |requested| random bytes into |out|. -void CRYPTO_sysrand(uint8_t *out, size_t requested) { - if (requested == 0) { - return; - } - - CRYPTO_once(rand_once_bss_get(), init_once); - - if (!fill_with_entropy(out, requested)) { - abort(); - } - -#if defined(BORINGSSL_FIPS_BREAK_CRNG) - // This breaks the "continuous random number generator test" defined in FIPS - // 140-2, section 4.9.2, and implemented in rand_get_seed(). - OPENSSL_memset(out, 0, requested); -#endif -} - -#endif /* !OPENSSL_WINDOWS && !defined(OPENSSL_FUCHSIA) && \ - !BORINGSSL_UNSAFE_DETERMINISTIC_MODE && !OPENSSL_TRUSTY */ diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/urandom.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/urandom.c.grpc_back deleted file mode 100644 index d2be7199a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/urandom.c.grpc_back +++ /dev/null @@ -1,302 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#if !defined(_GNU_SOURCE) -#define _GNU_SOURCE // needed for syscall() on Linux. -#endif - -#include - -#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_FUCHSIA) && \ - !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) - -#include -#include -#include -#include -#include -#include - -#if defined(OPENSSL_LINUX) -#if defined(BORINGSSL_FIPS) -#include -#include -#endif -#include -#endif - -#include -#include - -#include "internal.h" -#include "../delocate.h" -#include "../../internal.h" - - -#if defined(OPENSSL_LINUX) - -#if defined(OPENSSL_X86_64) -#define EXPECTED_NR_getrandom 318 -#elif defined(OPENSSL_X86) -#define EXPECTED_NR_getrandom 355 -#elif defined(OPENSSL_AARCH64) -#define EXPECTED_NR_getrandom 278 -#elif defined(OPENSSL_ARM) -#define EXPECTED_NR_getrandom 384 -#elif defined(OPENSSL_PPC64LE) -#define EXPECTED_NR_getrandom 359 -#endif - -#if defined(EXPECTED_NR_getrandom) -#define USE_NR_getrandom - -#if defined(__NR_getrandom) - -#if __NR_getrandom != EXPECTED_NR_getrandom -#error "system call number for getrandom is not the expected value" -#endif - -#else // __NR_getrandom - -#define __NR_getrandom EXPECTED_NR_getrandom - -#endif // __NR_getrandom - -#endif // EXPECTED_NR_getrandom - -#if !defined(GRND_NONBLOCK) -#define GRND_NONBLOCK 1 -#endif - -#endif // OPENSSL_LINUX - -// rand_lock is used to protect the |*_requested| variables. -DEFINE_STATIC_MUTEX(rand_lock); - -// The following constants are magic values of |urandom_fd|. -static const int kUnset = 0; -static const int kHaveGetrandom = -3; - -// urandom_fd_requested is set by |RAND_set_urandom_fd|. It's protected by -// |rand_lock|. -DEFINE_BSS_GET(int, urandom_fd_requested); - -// urandom_fd is a file descriptor to /dev/urandom. It's protected by |once|. -DEFINE_BSS_GET(int, urandom_fd); - -DEFINE_STATIC_ONCE(rand_once); - -#if defined(USE_NR_getrandom) || defined(BORINGSSL_FIPS) -// message writes |msg| to stderr. We use this because referencing |stderr| -// with |fprintf| generates relocations, which is a problem inside the FIPS -// module. -static void message(const char *msg) { - ssize_t r; - do { - r = write(2, msg, strlen(msg)); - } while (r == -1 && errno == EINTR); -} -#endif - -// init_once initializes the state of this module to values previously -// requested. This is the only function that modifies |urandom_fd| and -// |urandom_buffering|, whose values may be read safely after calling the -// once. -static void init_once(void) { - CRYPTO_STATIC_MUTEX_lock_read(rand_lock_bss_get()); - int fd = *urandom_fd_requested_bss_get(); - CRYPTO_STATIC_MUTEX_unlock_read(rand_lock_bss_get()); - -#if defined(USE_NR_getrandom) - uint8_t dummy; - long getrandom_ret = - syscall(__NR_getrandom, &dummy, sizeof(dummy), GRND_NONBLOCK); - - if (getrandom_ret == 1) { - *urandom_fd_bss_get() = kHaveGetrandom; - return; - } else if (getrandom_ret == -1 && errno == EAGAIN) { - message( - "getrandom indicates that the entropy pool has not been initialized. " - "Rather than continue with poor entropy, this process will block until " - "entropy is available.\n"); - - do { - getrandom_ret = - syscall(__NR_getrandom, &dummy, sizeof(dummy), 0 /* no flags */); - } while (getrandom_ret == -1 && errno == EINTR); - - if (getrandom_ret == 1) { - *urandom_fd_bss_get() = kHaveGetrandom; - return; - } - } -#endif // USE_NR_getrandom - - if (fd == kUnset) { - do { - fd = open("/dev/urandom", O_RDONLY); - } while (fd == -1 && errno == EINTR); - } - - if (fd < 0) { - abort(); - } - - assert(kUnset == 0); - if (fd == kUnset) { - // Because we want to keep |urandom_fd| in the BSS, we have to initialise - // it to zero. But zero is a valid file descriptor too. Thus if open - // returns zero for /dev/urandom, we dup it to get a non-zero number. - fd = dup(fd); - close(kUnset); - - if (fd <= 0) { - abort(); - } - } - -#if defined(BORINGSSL_FIPS) - // In FIPS mode we ensure that the kernel has sufficient entropy before - // continuing. This is automatically handled by getrandom, which requires - // that the entropy pool has been initialised, but for urandom we have to - // poll. - for (;;) { - int entropy_bits; - if (ioctl(fd, RNDGETENTCNT, &entropy_bits)) { - message( - "RNDGETENTCNT on /dev/urandom failed. We cannot continue in this " - "case when in FIPS mode.\n"); - abort(); - } - - static const int kBitsNeeded = 256; - if (entropy_bits >= kBitsNeeded) { - break; - } - - usleep(250000); - } -#endif - - int flags = fcntl(fd, F_GETFD); - if (flags == -1) { - // Native Client doesn't implement |fcntl|. - if (errno != ENOSYS) { - abort(); - } - } else { - flags |= FD_CLOEXEC; - if (fcntl(fd, F_SETFD, flags) == -1) { - abort(); - } - } - *urandom_fd_bss_get() = fd; -} - -void RAND_set_urandom_fd(int fd) { - fd = dup(fd); - if (fd < 0) { - abort(); - } - - assert(kUnset == 0); - if (fd == kUnset) { - // Because we want to keep |urandom_fd| in the BSS, we have to initialise - // it to zero. But zero is a valid file descriptor too. Thus if dup - // returned zero we dup it again to get a non-zero number. - fd = dup(fd); - close(kUnset); - - if (fd <= 0) { - abort(); - } - } - - CRYPTO_STATIC_MUTEX_lock_write(rand_lock_bss_get()); - *urandom_fd_requested_bss_get() = fd; - CRYPTO_STATIC_MUTEX_unlock_write(rand_lock_bss_get()); - - CRYPTO_once(rand_once_bss_get(), init_once); - if (*urandom_fd_bss_get() == kHaveGetrandom) { - close(fd); - } else if (*urandom_fd_bss_get() != fd) { - abort(); // Already initialized. - } -} - -#if defined(USE_NR_getrandom) && defined(OPENSSL_MSAN) -void __msan_unpoison(void *, size_t); -#endif - -// fill_with_entropy writes |len| bytes of entropy into |out|. It returns one -// on success and zero on error. -static char fill_with_entropy(uint8_t *out, size_t len) { - while (len > 0) { - ssize_t r; - - if (*urandom_fd_bss_get() == kHaveGetrandom) { -#if defined(USE_NR_getrandom) - do { - r = syscall(__NR_getrandom, out, len, 0 /* no flags */); - } while (r == -1 && errno == EINTR); - -#if defined(OPENSSL_MSAN) - if (r > 0) { - // MSAN doesn't recognise |syscall| and thus doesn't notice that we - // have initialised the output buffer. - __msan_unpoison(out, r); - } -#endif // OPENSSL_MSAN - -#else // USE_NR_getrandom - abort(); -#endif - } else { - do { - r = read(*urandom_fd_bss_get(), out, len); - } while (r == -1 && errno == EINTR); - } - - if (r <= 0) { - return 0; - } - out += r; - len -= r; - } - - return 1; -} - -// CRYPTO_sysrand puts |requested| random bytes into |out|. -void CRYPTO_sysrand(uint8_t *out, size_t requested) { - if (requested == 0) { - return; - } - - CRYPTO_once(rand_once_bss_get(), init_once); - - if (!fill_with_entropy(out, requested)) { - abort(); - } - -#if defined(BORINGSSL_FIPS_BREAK_CRNG) - // This breaks the "continuous random number generator test" defined in FIPS - // 140-2, section 4.9.2, and implemented in rand_get_seed(). - OPENSSL_memset(out, 0, requested); -#endif -} - -#endif /* !OPENSSL_WINDOWS && !defined(OPENSSL_FUCHSIA) && \ - !BORINGSSL_UNSAFE_DETERMINISTIC_MODE && !OPENSSL_TRUSTY */ diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha512.c b/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha512.c deleted file mode 100644 index cc4082141..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha512.c +++ /dev/null @@ -1,608 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include - -#include "../../internal.h" - - -// IMPLEMENTATION NOTES. -// -// The 32-bit hash algorithms share a common byte-order neutral collector and -// padding function implementations that operate on unaligned data, -// ../md32_common.h. This SHA-512 implementation does not. Reasons -// [in reverse order] are: -// -// - It's the only 64-bit hash algorithm for the moment of this writing, -// there is no need for common collector/padding implementation [yet]; -// - By supporting only a transform function that operates on *aligned* data -// the collector/padding function is simpler and easier to optimize. - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define SHA512_ASM -#endif - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(__ARM_FEATURE_UNALIGNED) -#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA -#endif - -int SHA384_Init(SHA512_CTX *sha) { - sha->h[0] = UINT64_C(0xcbbb9d5dc1059ed8); - sha->h[1] = UINT64_C(0x629a292a367cd507); - sha->h[2] = UINT64_C(0x9159015a3070dd17); - sha->h[3] = UINT64_C(0x152fecd8f70e5939); - sha->h[4] = UINT64_C(0x67332667ffc00b31); - sha->h[5] = UINT64_C(0x8eb44a8768581511); - sha->h[6] = UINT64_C(0xdb0c2e0d64f98fa7); - sha->h[7] = UINT64_C(0x47b5481dbefa4fa4); - - sha->Nl = 0; - sha->Nh = 0; - sha->num = 0; - sha->md_len = SHA384_DIGEST_LENGTH; - return 1; -} - - -int SHA512_Init(SHA512_CTX *sha) { - sha->h[0] = UINT64_C(0x6a09e667f3bcc908); - sha->h[1] = UINT64_C(0xbb67ae8584caa73b); - sha->h[2] = UINT64_C(0x3c6ef372fe94f82b); - sha->h[3] = UINT64_C(0xa54ff53a5f1d36f1); - sha->h[4] = UINT64_C(0x510e527fade682d1); - sha->h[5] = UINT64_C(0x9b05688c2b3e6c1f); - sha->h[6] = UINT64_C(0x1f83d9abfb41bd6b); - sha->h[7] = UINT64_C(0x5be0cd19137e2179); - - sha->Nl = 0; - sha->Nh = 0; - sha->num = 0; - sha->md_len = SHA512_DIGEST_LENGTH; - return 1; -} - -uint8_t *SHA384(const uint8_t *data, size_t len, uint8_t *out) { - SHA512_CTX ctx; - SHA384_Init(&ctx); - SHA384_Update(&ctx, data, len); - SHA384_Final(out, &ctx); - OPENSSL_cleanse(&ctx, sizeof(ctx)); - return out; -} - -uint8_t *SHA512(const uint8_t *data, size_t len, uint8_t *out) { - SHA512_CTX ctx; - SHA512_Init(&ctx); - SHA512_Update(&ctx, data, len); - SHA512_Final(out, &ctx); - OPENSSL_cleanse(&ctx, sizeof(ctx)); - return out; -} - -#if !defined(SHA512_ASM) -static -#endif -void sha512_block_data_order(uint64_t *state, const uint64_t *W, size_t num); - - -int SHA384_Final(uint8_t *md, SHA512_CTX *sha) { - return SHA512_Final(md, sha); -} - -int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len) { - return SHA512_Update(sha, data, len); -} - -void SHA512_Transform(SHA512_CTX *c, const uint8_t *block) { -#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA - if ((size_t)block % sizeof(c->u.d[0]) != 0) { - OPENSSL_memcpy(c->u.p, block, sizeof(c->u.p)); - block = c->u.p; - } -#endif - sha512_block_data_order(c->h, (uint64_t *)block, 1); -} - -int SHA512_Update(SHA512_CTX *c, const void *in_data, size_t len) { - uint64_t l; - uint8_t *p = c->u.p; - const uint8_t *data = (const uint8_t *)in_data; - - if (len == 0) { - return 1; - } - - l = (c->Nl + (((uint64_t)len) << 3)) & UINT64_C(0xffffffffffffffff); - if (l < c->Nl) { - c->Nh++; - } - if (sizeof(len) >= 8) { - c->Nh += (((uint64_t)len) >> 61); - } - c->Nl = l; - - if (c->num != 0) { - size_t n = sizeof(c->u) - c->num; - - if (len < n) { - OPENSSL_memcpy(p + c->num, data, len); - c->num += (unsigned int)len; - return 1; - } else { - OPENSSL_memcpy(p + c->num, data, n), c->num = 0; - len -= n; - data += n; - sha512_block_data_order(c->h, (uint64_t *)p, 1); - } - } - - if (len >= sizeof(c->u)) { -#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA - if ((size_t)data % sizeof(c->u.d[0]) != 0) { - while (len >= sizeof(c->u)) { - OPENSSL_memcpy(p, data, sizeof(c->u)); - sha512_block_data_order(c->h, (uint64_t *)p, 1); - len -= sizeof(c->u); - data += sizeof(c->u); - } - } else -#endif - { - sha512_block_data_order(c->h, (uint64_t *)data, len / sizeof(c->u)); - data += len; - len %= sizeof(c->u); - data -= len; - } - } - - if (len != 0) { - OPENSSL_memcpy(p, data, len); - c->num = (int)len; - } - - return 1; -} - -int SHA512_Final(uint8_t *md, SHA512_CTX *sha) { - uint8_t *p = (uint8_t *)sha->u.p; - size_t n = sha->num; - - p[n] = 0x80; // There always is a room for one - n++; - if (n > (sizeof(sha->u) - 16)) { - OPENSSL_memset(p + n, 0, sizeof(sha->u) - n); - n = 0; - sha512_block_data_order(sha->h, (uint64_t *)p, 1); - } - - OPENSSL_memset(p + n, 0, sizeof(sha->u) - 16 - n); - p[sizeof(sha->u) - 1] = (uint8_t)(sha->Nl); - p[sizeof(sha->u) - 2] = (uint8_t)(sha->Nl >> 8); - p[sizeof(sha->u) - 3] = (uint8_t)(sha->Nl >> 16); - p[sizeof(sha->u) - 4] = (uint8_t)(sha->Nl >> 24); - p[sizeof(sha->u) - 5] = (uint8_t)(sha->Nl >> 32); - p[sizeof(sha->u) - 6] = (uint8_t)(sha->Nl >> 40); - p[sizeof(sha->u) - 7] = (uint8_t)(sha->Nl >> 48); - p[sizeof(sha->u) - 8] = (uint8_t)(sha->Nl >> 56); - p[sizeof(sha->u) - 9] = (uint8_t)(sha->Nh); - p[sizeof(sha->u) - 10] = (uint8_t)(sha->Nh >> 8); - p[sizeof(sha->u) - 11] = (uint8_t)(sha->Nh >> 16); - p[sizeof(sha->u) - 12] = (uint8_t)(sha->Nh >> 24); - p[sizeof(sha->u) - 13] = (uint8_t)(sha->Nh >> 32); - p[sizeof(sha->u) - 14] = (uint8_t)(sha->Nh >> 40); - p[sizeof(sha->u) - 15] = (uint8_t)(sha->Nh >> 48); - p[sizeof(sha->u) - 16] = (uint8_t)(sha->Nh >> 56); - - sha512_block_data_order(sha->h, (uint64_t *)p, 1); - - if (md == NULL) { - // TODO(davidben): This NULL check is absent in other low-level hash 'final' - // functions and is one of the few places one can fail. - return 0; - } - - switch (sha->md_len) { - // Let compiler decide if it's appropriate to unroll... - case SHA384_DIGEST_LENGTH: - for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) { - uint64_t t = sha->h[n]; - - *(md++) = (uint8_t)(t >> 56); - *(md++) = (uint8_t)(t >> 48); - *(md++) = (uint8_t)(t >> 40); - *(md++) = (uint8_t)(t >> 32); - *(md++) = (uint8_t)(t >> 24); - *(md++) = (uint8_t)(t >> 16); - *(md++) = (uint8_t)(t >> 8); - *(md++) = (uint8_t)(t); - } - break; - case SHA512_DIGEST_LENGTH: - for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) { - uint64_t t = sha->h[n]; - - *(md++) = (uint8_t)(t >> 56); - *(md++) = (uint8_t)(t >> 48); - *(md++) = (uint8_t)(t >> 40); - *(md++) = (uint8_t)(t >> 32); - *(md++) = (uint8_t)(t >> 24); - *(md++) = (uint8_t)(t >> 16); - *(md++) = (uint8_t)(t >> 8); - *(md++) = (uint8_t)(t); - } - break; - // ... as well as make sure md_len is not abused. - default: - // TODO(davidben): This bad |md_len| case is one of the few places a - // low-level hash 'final' function can fail. This should never happen. - return 0; - } - - return 1; -} - -#ifndef SHA512_ASM -static const uint64_t K512[80] = { - UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), - UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), - UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019), - UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118), - UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe), - UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2), - UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1), - UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694), - UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3), - UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65), - UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483), - UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5), - UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210), - UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4), - UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725), - UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70), - UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926), - UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df), - UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8), - UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b), - UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001), - UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30), - UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910), - UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8), - UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53), - UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8), - UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb), - UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3), - UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60), - UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec), - UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9), - UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b), - UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207), - UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178), - UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6), - UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b), - UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493), - UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c), - UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a), - UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817), -}; - -#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) -#if defined(__x86_64) || defined(__x86_64__) -#define ROTR(a, n) \ - ({ \ - uint64_t ret; \ - __asm__("rorq %1, %0" : "=r"(ret) : "J"(n), "0"(a) : "cc"); \ - ret; \ - }) -#define PULL64(x) \ - ({ \ - uint64_t ret = *((const uint64_t *)(&(x))); \ - __asm__("bswapq %0" : "=r"(ret) : "0"(ret)); \ - ret; \ - }) -#elif(defined(__i386) || defined(__i386__)) -#define PULL64(x) \ - ({ \ - const unsigned int *p = (const unsigned int *)(&(x)); \ - unsigned int hi = p[0], lo = p[1]; \ - __asm__("bswapl %0; bswapl %1;" : "=r"(lo), "=r"(hi) : "0"(lo), "1"(hi)); \ - ((uint64_t)hi) << 32 | lo; \ - }) -#elif(defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) -#define ROTR(a, n) \ - ({ \ - uint64_t ret; \ - __asm__("rotrdi %0, %1, %2" : "=r"(ret) : "r"(a), "K"(n)); \ - ret; \ - }) -#elif defined(__aarch64__) -#define ROTR(a, n) \ - ({ \ - uint64_t ret; \ - __asm__("ror %0, %1, %2" : "=r"(ret) : "r"(a), "I"(n)); \ - ret; \ - }) -#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define PULL64(x) \ - ({ \ - uint64_t ret; \ - __asm__("rev %0, %1" : "=r"(ret) : "r"(*((const uint64_t *)(&(x))))); \ - ret; \ - }) -#endif -#endif -#elif defined(_MSC_VER) -#if defined(_WIN64) // applies to both IA-64 and AMD64 -#pragma intrinsic(_rotr64) -#define ROTR(a, n) _rotr64((a), n) -#endif -#if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) -static uint64_t __fastcall __pull64be(const void *x) { - _asm mov edx, [ecx + 0] - _asm mov eax, [ecx + 4] - _asm bswap edx - _asm bswap eax -} -#define PULL64(x) __pull64be(&(x)) -#if _MSC_VER <= 1200 -#pragma inline_depth(0) -#endif -#endif -#endif - -#ifndef PULL64 -#define B(x, j) \ - (((uint64_t)(*(((const uint8_t *)(&x)) + j))) << ((7 - j) * 8)) -#define PULL64(x) \ - (B(x, 0) | B(x, 1) | B(x, 2) | B(x, 3) | B(x, 4) | B(x, 5) | B(x, 6) | \ - B(x, 7)) -#endif - -#ifndef ROTR -#define ROTR(x, s) (((x) >> s) | (x) << (64 - s)) -#endif - -#define Sigma0(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) -#define Sigma1(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) -#define sigma0(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) -#define sigma1(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) - -#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) -#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) - - -#if defined(__i386) || defined(__i386__) || defined(_M_IX86) -// This code should give better results on 32-bit CPU with less than -// ~24 registers, both size and performance wise... -static void sha512_block_data_order(uint64_t *state, const uint64_t *W, - size_t num) { - uint64_t A, E, T; - uint64_t X[9 + 80], *F; - int i; - - while (num--) { - F = X + 80; - A = state[0]; - F[1] = state[1]; - F[2] = state[2]; - F[3] = state[3]; - E = state[4]; - F[5] = state[5]; - F[6] = state[6]; - F[7] = state[7]; - - for (i = 0; i < 16; i++, F--) { - T = PULL64(W[i]); - F[0] = A; - F[4] = E; - F[8] = T; - T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; - E = F[3] + T; - A = T + Sigma0(A) + Maj(A, F[1], F[2]); - } - - for (; i < 80; i++, F--) { - T = sigma0(F[8 + 16 - 1]); - T += sigma1(F[8 + 16 - 14]); - T += F[8 + 16] + F[8 + 16 - 9]; - - F[0] = A; - F[4] = E; - F[8] = T; - T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; - E = F[3] + T; - A = T + Sigma0(A) + Maj(A, F[1], F[2]); - } - - state[0] += A; - state[1] += F[1]; - state[2] += F[2]; - state[3] += F[3]; - state[4] += E; - state[5] += F[5]; - state[6] += F[6]; - state[7] += F[7]; - - W += 16; - } -} - -#else - -#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ - do { \ - T1 += h + Sigma1(e) + Ch(e, f, g) + K512[i]; \ - h = Sigma0(a) + Maj(a, b, c); \ - d += T1; \ - h += T1; \ - } while (0) - -#define ROUND_16_80(i, j, a, b, c, d, e, f, g, h, X) \ - do { \ - s0 = X[(j + 1) & 0x0f]; \ - s0 = sigma0(s0); \ - s1 = X[(j + 14) & 0x0f]; \ - s1 = sigma1(s1); \ - T1 = X[(j) & 0x0f] += s0 + s1 + X[(j + 9) & 0x0f]; \ - ROUND_00_15(i + j, a, b, c, d, e, f, g, h); \ - } while (0) - -static void sha512_block_data_order(uint64_t *state, const uint64_t *W, - size_t num) { - uint64_t a, b, c, d, e, f, g, h, s0, s1, T1; - uint64_t X[16]; - int i; - - while (num--) { - - a = state[0]; - b = state[1]; - c = state[2]; - d = state[3]; - e = state[4]; - f = state[5]; - g = state[6]; - h = state[7]; - - T1 = X[0] = PULL64(W[0]); - ROUND_00_15(0, a, b, c, d, e, f, g, h); - T1 = X[1] = PULL64(W[1]); - ROUND_00_15(1, h, a, b, c, d, e, f, g); - T1 = X[2] = PULL64(W[2]); - ROUND_00_15(2, g, h, a, b, c, d, e, f); - T1 = X[3] = PULL64(W[3]); - ROUND_00_15(3, f, g, h, a, b, c, d, e); - T1 = X[4] = PULL64(W[4]); - ROUND_00_15(4, e, f, g, h, a, b, c, d); - T1 = X[5] = PULL64(W[5]); - ROUND_00_15(5, d, e, f, g, h, a, b, c); - T1 = X[6] = PULL64(W[6]); - ROUND_00_15(6, c, d, e, f, g, h, a, b); - T1 = X[7] = PULL64(W[7]); - ROUND_00_15(7, b, c, d, e, f, g, h, a); - T1 = X[8] = PULL64(W[8]); - ROUND_00_15(8, a, b, c, d, e, f, g, h); - T1 = X[9] = PULL64(W[9]); - ROUND_00_15(9, h, a, b, c, d, e, f, g); - T1 = X[10] = PULL64(W[10]); - ROUND_00_15(10, g, h, a, b, c, d, e, f); - T1 = X[11] = PULL64(W[11]); - ROUND_00_15(11, f, g, h, a, b, c, d, e); - T1 = X[12] = PULL64(W[12]); - ROUND_00_15(12, e, f, g, h, a, b, c, d); - T1 = X[13] = PULL64(W[13]); - ROUND_00_15(13, d, e, f, g, h, a, b, c); - T1 = X[14] = PULL64(W[14]); - ROUND_00_15(14, c, d, e, f, g, h, a, b); - T1 = X[15] = PULL64(W[15]); - ROUND_00_15(15, b, c, d, e, f, g, h, a); - - for (i = 16; i < 80; i += 16) { - ROUND_16_80(i, 0, a, b, c, d, e, f, g, h, X); - ROUND_16_80(i, 1, h, a, b, c, d, e, f, g, X); - ROUND_16_80(i, 2, g, h, a, b, c, d, e, f, X); - ROUND_16_80(i, 3, f, g, h, a, b, c, d, e, X); - ROUND_16_80(i, 4, e, f, g, h, a, b, c, d, X); - ROUND_16_80(i, 5, d, e, f, g, h, a, b, c, X); - ROUND_16_80(i, 6, c, d, e, f, g, h, a, b, X); - ROUND_16_80(i, 7, b, c, d, e, f, g, h, a, X); - ROUND_16_80(i, 8, a, b, c, d, e, f, g, h, X); - ROUND_16_80(i, 9, h, a, b, c, d, e, f, g, X); - ROUND_16_80(i, 10, g, h, a, b, c, d, e, f, X); - ROUND_16_80(i, 11, f, g, h, a, b, c, d, e, X); - ROUND_16_80(i, 12, e, f, g, h, a, b, c, d, X); - ROUND_16_80(i, 13, d, e, f, g, h, a, b, c, X); - ROUND_16_80(i, 14, c, d, e, f, g, h, a, b, X); - ROUND_16_80(i, 15, b, c, d, e, f, g, h, a, X); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; - - W += 16; - } -} - -#endif - -#endif // !SHA512_ASM - -#undef ROTR -#undef PULL64 -#undef B -#undef Sigma0 -#undef Sigma1 -#undef sigma0 -#undef sigma1 -#undef Ch -#undef Maj -#undef ROUND_00_15 -#undef ROUND_16_80 -#undef HOST_c2l -#undef HOST_l2c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha512.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha512.c.grpc_back deleted file mode 100644 index 3902f50e5..000000000 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha512.c.grpc_back +++ /dev/null @@ -1,608 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include - -#include "../../internal.h" - - -// IMPLEMENTATION NOTES. -// -// The 32-bit hash algorithms share a common byte-order neutral collector and -// padding function implementations that operate on unaligned data, -// ../md32_common.h. This SHA-512 implementation does not. Reasons -// [in reverse order] are: -// -// - It's the only 64-bit hash algorithm for the moment of this writing, -// there is no need for common collector/padding implementation [yet]; -// - By supporting only a transform function that operates on *aligned* data -// the collector/padding function is simpler and easier to optimize. - -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define SHA512_ASM -#endif - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(__ARM_FEATURE_UNALIGNED) -#define SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA -#endif - -int SHA384_Init(SHA512_CTX *sha) { - sha->h[0] = UINT64_C(0xcbbb9d5dc1059ed8); - sha->h[1] = UINT64_C(0x629a292a367cd507); - sha->h[2] = UINT64_C(0x9159015a3070dd17); - sha->h[3] = UINT64_C(0x152fecd8f70e5939); - sha->h[4] = UINT64_C(0x67332667ffc00b31); - sha->h[5] = UINT64_C(0x8eb44a8768581511); - sha->h[6] = UINT64_C(0xdb0c2e0d64f98fa7); - sha->h[7] = UINT64_C(0x47b5481dbefa4fa4); - - sha->Nl = 0; - sha->Nh = 0; - sha->num = 0; - sha->md_len = SHA384_DIGEST_LENGTH; - return 1; -} - - -int SHA512_Init(SHA512_CTX *sha) { - sha->h[0] = UINT64_C(0x6a09e667f3bcc908); - sha->h[1] = UINT64_C(0xbb67ae8584caa73b); - sha->h[2] = UINT64_C(0x3c6ef372fe94f82b); - sha->h[3] = UINT64_C(0xa54ff53a5f1d36f1); - sha->h[4] = UINT64_C(0x510e527fade682d1); - sha->h[5] = UINT64_C(0x9b05688c2b3e6c1f); - sha->h[6] = UINT64_C(0x1f83d9abfb41bd6b); - sha->h[7] = UINT64_C(0x5be0cd19137e2179); - - sha->Nl = 0; - sha->Nh = 0; - sha->num = 0; - sha->md_len = SHA512_DIGEST_LENGTH; - return 1; -} - -uint8_t *SHA384(const uint8_t *data, size_t len, uint8_t *out) { - SHA512_CTX ctx; - SHA384_Init(&ctx); - SHA384_Update(&ctx, data, len); - SHA384_Final(out, &ctx); - OPENSSL_cleanse(&ctx, sizeof(ctx)); - return out; -} - -uint8_t *SHA512(const uint8_t *data, size_t len, uint8_t *out) { - SHA512_CTX ctx; - SHA512_Init(&ctx); - SHA512_Update(&ctx, data, len); - SHA512_Final(out, &ctx); - OPENSSL_cleanse(&ctx, sizeof(ctx)); - return out; -} - -#if !defined(SHA512_ASM) -static -#endif -void sha512_block_data_order(uint64_t *state, const uint64_t *W, size_t num); - - -int SHA384_Final(uint8_t *md, SHA512_CTX *sha) { - return SHA512_Final(md, sha); -} - -int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len) { - return SHA512_Update(sha, data, len); -} - -void SHA512_Transform(SHA512_CTX *c, const uint8_t *block) { -#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA - if ((size_t)block % sizeof(c->u.d[0]) != 0) { - OPENSSL_memcpy(c->u.p, block, sizeof(c->u.p)); - block = c->u.p; - } -#endif - sha512_block_data_order(c->h, (uint64_t *)block, 1); -} - -int SHA512_Update(SHA512_CTX *c, const void *in_data, size_t len) { - uint64_t l; - uint8_t *p = c->u.p; - const uint8_t *data = (const uint8_t *)in_data; - - if (len == 0) { - return 1; - } - - l = (c->Nl + (((uint64_t)len) << 3)) & UINT64_C(0xffffffffffffffff); - if (l < c->Nl) { - c->Nh++; - } - if (sizeof(len) >= 8) { - c->Nh += (((uint64_t)len) >> 61); - } - c->Nl = l; - - if (c->num != 0) { - size_t n = sizeof(c->u) - c->num; - - if (len < n) { - OPENSSL_memcpy(p + c->num, data, len); - c->num += (unsigned int)len; - return 1; - } else { - OPENSSL_memcpy(p + c->num, data, n), c->num = 0; - len -= n; - data += n; - sha512_block_data_order(c->h, (uint64_t *)p, 1); - } - } - - if (len >= sizeof(c->u)) { -#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA - if ((size_t)data % sizeof(c->u.d[0]) != 0) { - while (len >= sizeof(c->u)) { - OPENSSL_memcpy(p, data, sizeof(c->u)); - sha512_block_data_order(c->h, (uint64_t *)p, 1); - len -= sizeof(c->u); - data += sizeof(c->u); - } - } else -#endif - { - sha512_block_data_order(c->h, (uint64_t *)data, len / sizeof(c->u)); - data += len; - len %= sizeof(c->u); - data -= len; - } - } - - if (len != 0) { - OPENSSL_memcpy(p, data, len); - c->num = (int)len; - } - - return 1; -} - -int SHA512_Final(uint8_t *md, SHA512_CTX *sha) { - uint8_t *p = (uint8_t *)sha->u.p; - size_t n = sha->num; - - p[n] = 0x80; // There always is a room for one - n++; - if (n > (sizeof(sha->u) - 16)) { - OPENSSL_memset(p + n, 0, sizeof(sha->u) - n); - n = 0; - sha512_block_data_order(sha->h, (uint64_t *)p, 1); - } - - OPENSSL_memset(p + n, 0, sizeof(sha->u) - 16 - n); - p[sizeof(sha->u) - 1] = (uint8_t)(sha->Nl); - p[sizeof(sha->u) - 2] = (uint8_t)(sha->Nl >> 8); - p[sizeof(sha->u) - 3] = (uint8_t)(sha->Nl >> 16); - p[sizeof(sha->u) - 4] = (uint8_t)(sha->Nl >> 24); - p[sizeof(sha->u) - 5] = (uint8_t)(sha->Nl >> 32); - p[sizeof(sha->u) - 6] = (uint8_t)(sha->Nl >> 40); - p[sizeof(sha->u) - 7] = (uint8_t)(sha->Nl >> 48); - p[sizeof(sha->u) - 8] = (uint8_t)(sha->Nl >> 56); - p[sizeof(sha->u) - 9] = (uint8_t)(sha->Nh); - p[sizeof(sha->u) - 10] = (uint8_t)(sha->Nh >> 8); - p[sizeof(sha->u) - 11] = (uint8_t)(sha->Nh >> 16); - p[sizeof(sha->u) - 12] = (uint8_t)(sha->Nh >> 24); - p[sizeof(sha->u) - 13] = (uint8_t)(sha->Nh >> 32); - p[sizeof(sha->u) - 14] = (uint8_t)(sha->Nh >> 40); - p[sizeof(sha->u) - 15] = (uint8_t)(sha->Nh >> 48); - p[sizeof(sha->u) - 16] = (uint8_t)(sha->Nh >> 56); - - sha512_block_data_order(sha->h, (uint64_t *)p, 1); - - if (md == NULL) { - // TODO(davidben): This NULL check is absent in other low-level hash 'final' - // functions and is one of the few places one can fail. - return 0; - } - - switch (sha->md_len) { - // Let compiler decide if it's appropriate to unroll... - case SHA384_DIGEST_LENGTH: - for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) { - uint64_t t = sha->h[n]; - - *(md++) = (uint8_t)(t >> 56); - *(md++) = (uint8_t)(t >> 48); - *(md++) = (uint8_t)(t >> 40); - *(md++) = (uint8_t)(t >> 32); - *(md++) = (uint8_t)(t >> 24); - *(md++) = (uint8_t)(t >> 16); - *(md++) = (uint8_t)(t >> 8); - *(md++) = (uint8_t)(t); - } - break; - case SHA512_DIGEST_LENGTH: - for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) { - uint64_t t = sha->h[n]; - - *(md++) = (uint8_t)(t >> 56); - *(md++) = (uint8_t)(t >> 48); - *(md++) = (uint8_t)(t >> 40); - *(md++) = (uint8_t)(t >> 32); - *(md++) = (uint8_t)(t >> 24); - *(md++) = (uint8_t)(t >> 16); - *(md++) = (uint8_t)(t >> 8); - *(md++) = (uint8_t)(t); - } - break; - // ... as well as make sure md_len is not abused. - default: - // TODO(davidben): This bad |md_len| case is one of the few places a - // low-level hash 'final' function can fail. This should never happen. - return 0; - } - - return 1; -} - -#ifndef SHA512_ASM -static const uint64_t K512[80] = { - UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), - UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), - UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019), - UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118), - UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe), - UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2), - UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1), - UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694), - UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3), - UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65), - UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483), - UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5), - UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210), - UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4), - UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725), - UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70), - UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926), - UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df), - UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8), - UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b), - UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001), - UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30), - UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910), - UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8), - UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53), - UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8), - UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb), - UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3), - UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60), - UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec), - UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9), - UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b), - UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207), - UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178), - UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6), - UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b), - UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493), - UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c), - UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a), - UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817), -}; - -#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) -#if defined(__x86_64) || defined(__x86_64__) -#define ROTR(a, n) \ - ({ \ - uint64_t ret; \ - __asm__("rorq %1, %0" : "=r"(ret) : "J"(n), "0"(a) : "cc"); \ - ret; \ - }) -#define PULL64(x) \ - ({ \ - uint64_t ret = *((const uint64_t *)(&(x))); \ - __asm__("bswapq %0" : "=r"(ret) : "0"(ret)); \ - ret; \ - }) -#elif(defined(__i386) || defined(__i386__)) -#define PULL64(x) \ - ({ \ - const unsigned int *p = (const unsigned int *)(&(x)); \ - unsigned int hi = p[0], lo = p[1]; \ - __asm__("bswapl %0; bswapl %1;" : "=r"(lo), "=r"(hi) : "0"(lo), "1"(hi)); \ - ((uint64_t)hi) << 32 | lo; \ - }) -#elif(defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) -#define ROTR(a, n) \ - ({ \ - uint64_t ret; \ - __asm__("rotrdi %0, %1, %2" : "=r"(ret) : "r"(a), "K"(n)); \ - ret; \ - }) -#elif defined(__aarch64__) -#define ROTR(a, n) \ - ({ \ - uint64_t ret; \ - __asm__("ror %0, %1, %2" : "=r"(ret) : "r"(a), "I"(n)); \ - ret; \ - }) -#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ -#define PULL64(x) \ - ({ \ - uint64_t ret; \ - __asm__("rev %0, %1" : "=r"(ret) : "r"(*((const uint64_t *)(&(x))))); \ - ret; \ - }) -#endif -#endif -#elif defined(_MSC_VER) -#if defined(_WIN64) // applies to both IA-64 and AMD64 -#pragma intrinsic(_rotr64) -#define ROTR(a, n) _rotr64((a), n) -#endif -#if defined(_M_IX86) && !defined(OPENSSL_NO_ASM) -static uint64_t __fastcall __pull64be(const void *x) { - _asm mov edx, [ecx + 0] - _asm mov eax, [ecx + 4] - _asm bswap edx - _asm bswap eax -} -#define PULL64(x) __pull64be(&(x)) -#if _MSC_VER <= 1200 -#pragma inline_depth(0) -#endif -#endif -#endif - -#ifndef PULL64 -#define B(x, j) \ - (((uint64_t)(*(((const uint8_t *)(&x)) + j))) << ((7 - j) * 8)) -#define PULL64(x) \ - (B(x, 0) | B(x, 1) | B(x, 2) | B(x, 3) | B(x, 4) | B(x, 5) | B(x, 6) | \ - B(x, 7)) -#endif - -#ifndef ROTR -#define ROTR(x, s) (((x) >> s) | (x) << (64 - s)) -#endif - -#define Sigma0(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) -#define Sigma1(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) -#define sigma0(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) -#define sigma1(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) - -#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) -#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) - - -#if defined(__i386) || defined(__i386__) || defined(_M_IX86) -// This code should give better results on 32-bit CPU with less than -// ~24 registers, both size and performance wise... -static void sha512_block_data_order(uint64_t *state, const uint64_t *W, - size_t num) { - uint64_t A, E, T; - uint64_t X[9 + 80], *F; - int i; - - while (num--) { - F = X + 80; - A = state[0]; - F[1] = state[1]; - F[2] = state[2]; - F[3] = state[3]; - E = state[4]; - F[5] = state[5]; - F[6] = state[6]; - F[7] = state[7]; - - for (i = 0; i < 16; i++, F--) { - T = PULL64(W[i]); - F[0] = A; - F[4] = E; - F[8] = T; - T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; - E = F[3] + T; - A = T + Sigma0(A) + Maj(A, F[1], F[2]); - } - - for (; i < 80; i++, F--) { - T = sigma0(F[8 + 16 - 1]); - T += sigma1(F[8 + 16 - 14]); - T += F[8 + 16] + F[8 + 16 - 9]; - - F[0] = A; - F[4] = E; - F[8] = T; - T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; - E = F[3] + T; - A = T + Sigma0(A) + Maj(A, F[1], F[2]); - } - - state[0] += A; - state[1] += F[1]; - state[2] += F[2]; - state[3] += F[3]; - state[4] += E; - state[5] += F[5]; - state[6] += F[6]; - state[7] += F[7]; - - W += 16; - } -} - -#else - -#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ - do { \ - T1 += h + Sigma1(e) + Ch(e, f, g) + K512[i]; \ - h = Sigma0(a) + Maj(a, b, c); \ - d += T1; \ - h += T1; \ - } while (0) - -#define ROUND_16_80(i, j, a, b, c, d, e, f, g, h, X) \ - do { \ - s0 = X[(j + 1) & 0x0f]; \ - s0 = sigma0(s0); \ - s1 = X[(j + 14) & 0x0f]; \ - s1 = sigma1(s1); \ - T1 = X[(j) & 0x0f] += s0 + s1 + X[(j + 9) & 0x0f]; \ - ROUND_00_15(i + j, a, b, c, d, e, f, g, h); \ - } while (0) - -static void sha512_block_data_order(uint64_t *state, const uint64_t *W, - size_t num) { - uint64_t a, b, c, d, e, f, g, h, s0, s1, T1; - uint64_t X[16]; - int i; - - while (num--) { - - a = state[0]; - b = state[1]; - c = state[2]; - d = state[3]; - e = state[4]; - f = state[5]; - g = state[6]; - h = state[7]; - - T1 = X[0] = PULL64(W[0]); - ROUND_00_15(0, a, b, c, d, e, f, g, h); - T1 = X[1] = PULL64(W[1]); - ROUND_00_15(1, h, a, b, c, d, e, f, g); - T1 = X[2] = PULL64(W[2]); - ROUND_00_15(2, g, h, a, b, c, d, e, f); - T1 = X[3] = PULL64(W[3]); - ROUND_00_15(3, f, g, h, a, b, c, d, e); - T1 = X[4] = PULL64(W[4]); - ROUND_00_15(4, e, f, g, h, a, b, c, d); - T1 = X[5] = PULL64(W[5]); - ROUND_00_15(5, d, e, f, g, h, a, b, c); - T1 = X[6] = PULL64(W[6]); - ROUND_00_15(6, c, d, e, f, g, h, a, b); - T1 = X[7] = PULL64(W[7]); - ROUND_00_15(7, b, c, d, e, f, g, h, a); - T1 = X[8] = PULL64(W[8]); - ROUND_00_15(8, a, b, c, d, e, f, g, h); - T1 = X[9] = PULL64(W[9]); - ROUND_00_15(9, h, a, b, c, d, e, f, g); - T1 = X[10] = PULL64(W[10]); - ROUND_00_15(10, g, h, a, b, c, d, e, f); - T1 = X[11] = PULL64(W[11]); - ROUND_00_15(11, f, g, h, a, b, c, d, e); - T1 = X[12] = PULL64(W[12]); - ROUND_00_15(12, e, f, g, h, a, b, c, d); - T1 = X[13] = PULL64(W[13]); - ROUND_00_15(13, d, e, f, g, h, a, b, c); - T1 = X[14] = PULL64(W[14]); - ROUND_00_15(14, c, d, e, f, g, h, a, b); - T1 = X[15] = PULL64(W[15]); - ROUND_00_15(15, b, c, d, e, f, g, h, a); - - for (i = 16; i < 80; i += 16) { - ROUND_16_80(i, 0, a, b, c, d, e, f, g, h, X); - ROUND_16_80(i, 1, h, a, b, c, d, e, f, g, X); - ROUND_16_80(i, 2, g, h, a, b, c, d, e, f, X); - ROUND_16_80(i, 3, f, g, h, a, b, c, d, e, X); - ROUND_16_80(i, 4, e, f, g, h, a, b, c, d, X); - ROUND_16_80(i, 5, d, e, f, g, h, a, b, c, X); - ROUND_16_80(i, 6, c, d, e, f, g, h, a, b, X); - ROUND_16_80(i, 7, b, c, d, e, f, g, h, a, X); - ROUND_16_80(i, 8, a, b, c, d, e, f, g, h, X); - ROUND_16_80(i, 9, h, a, b, c, d, e, f, g, X); - ROUND_16_80(i, 10, g, h, a, b, c, d, e, f, X); - ROUND_16_80(i, 11, f, g, h, a, b, c, d, e, X); - ROUND_16_80(i, 12, e, f, g, h, a, b, c, d, X); - ROUND_16_80(i, 13, d, e, f, g, h, a, b, c, X); - ROUND_16_80(i, 14, c, d, e, f, g, h, a, b, X); - ROUND_16_80(i, 15, b, c, d, e, f, g, h, a, X); - } - - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - state[5] += f; - state[6] += g; - state[7] += h; - - W += 16; - } -} - -#endif - -#endif // !SHA512_ASM - -#undef ROTR -#undef PULL64 -#undef B -#undef Sigma0 -#undef Sigma1 -#undef sigma0 -#undef sigma1 -#undef Ch -#undef Maj -#undef ROUND_00_15 -#undef ROUND_16_80 -#undef HOST_c2l -#undef HOST_l2c diff --git a/Pods/BoringSSL-GRPC/crypto/internal.h b/Pods/BoringSSL-GRPC/crypto/internal.h deleted file mode 100644 index af06032fb..000000000 --- a/Pods/BoringSSL-GRPC/crypto/internal.h +++ /dev/null @@ -1,739 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#ifndef OPENSSL_HEADER_CRYPTO_INTERNAL_H -#define OPENSSL_HEADER_CRYPTO_INTERNAL_H - -#include -#include -#include - -#include -#include - -#if defined(__GNUC__) && \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 -// |alignas| and |alignof| were added in C11. GCC added support in version 4.8. -// Testing for __STDC_VERSION__/__cplusplus doesn't work because 4.7 already -// reports support for C11. -#define alignas(x) __attribute__ ((aligned (x))) -#define alignof(x) __alignof__ (x) -#elif !defined(__cplusplus) -#if defined(_MSC_VER) -#define alignas(x) __declspec(align(x)) -#define alignof __alignof -#else -#include -#endif -#endif - -#if !defined(OPENSSL_NO_THREADS) && \ - (!defined(OPENSSL_WINDOWS) || defined(__MINGW32__)) -#include -#define OPENSSL_PTHREADS -#endif - -#if !defined(OPENSSL_NO_THREADS) && !defined(OPENSSL_PTHREADS) && \ - defined(OPENSSL_WINDOWS) -#define OPENSSL_WINDOWS_THREADS -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM) || \ - defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE) -// OPENSSL_cpuid_setup initializes the platform-specific feature cache. -void OPENSSL_cpuid_setup(void); -#endif - - -#if (!defined(_MSC_VER) || defined(__clang__)) && defined(OPENSSL_64_BIT) -#define BORINGSSL_HAS_UINT128 -typedef __int128_t int128_t; -typedef __uint128_t uint128_t; - -// clang-cl supports __uint128_t but modulus and division don't work. -// https://crbug.com/787617. -#if !defined(_MSC_VER) || !defined(__clang__) -#define BORINGSSL_CAN_DIVIDE_UINT128 -#endif -#endif - -#define OPENSSL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) - -// Have a generic fall-through for different versions of C/C++. -#if defined(__cplusplus) && __cplusplus >= 201703L -#define OPENSSL_FALLTHROUGH [[fallthrough]] -#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__) -#define OPENSSL_FALLTHROUGH [[clang::fallthrough]] -#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \ - __GNUC__ >= 7 -#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]] -#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7 -#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) -#else // C++11 on gcc 6, and all other cases -#define OPENSSL_FALLTHROUGH -#endif - -// buffers_alias returns one if |a| and |b| alias and zero otherwise. -static inline int buffers_alias(const uint8_t *a, size_t a_len, - const uint8_t *b, size_t b_len) { - // Cast |a| and |b| to integers. In C, pointer comparisons between unrelated - // objects are undefined whereas pointer to integer conversions are merely - // implementation-defined. We assume the implementation defined it in a sane - // way. - uintptr_t a_u = (uintptr_t)a; - uintptr_t b_u = (uintptr_t)b; - return a_u + a_len > b_u && b_u + b_len > a_u; -} - - -// Constant-time utility functions. -// -// The following methods return a bitmask of all ones (0xff...f) for true and 0 -// for false. This is useful for choosing a value based on the result of a -// conditional in constant time. For example, -// -// if (a < b) { -// c = a; -// } else { -// c = b; -// } -// -// can be written as -// -// crypto_word_t lt = constant_time_lt_w(a, b); -// c = constant_time_select_w(lt, a, b); - -// crypto_word_t is the type that most constant-time functions use. Ideally we -// would like it to be |size_t|, but NaCl builds in 64-bit mode with 32-bit -// pointers, which means that |size_t| can be 32 bits when |BN_ULONG| is 64 -// bits. Since we want to be able to do constant-time operations on a -// |BN_ULONG|, |crypto_word_t| is defined as an unsigned value with the native -// word length. -#if defined(OPENSSL_64_BIT) -typedef uint64_t crypto_word_t; -#elif defined(OPENSSL_32_BIT) -typedef uint32_t crypto_word_t; -#else -#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" -#endif - -#define CONSTTIME_TRUE_W ~((crypto_word_t)0) -#define CONSTTIME_FALSE_W ((crypto_word_t)0) -#define CONSTTIME_TRUE_8 ((uint8_t)0xff) - -#define CONSTTIME_TRUE_W ~((crypto_word_t)0) -#define CONSTTIME_FALSE_W ((crypto_word_t)0) -#define CONSTTIME_TRUE_8 ((uint8_t)0xff) -#define CONSTTIME_FALSE_8 ((uint8_t)0) - -// constant_time_msb_w returns the given value with the MSB copied to all the -// other bits. -static inline crypto_word_t constant_time_msb_w(crypto_word_t a) { - return 0u - (a >> (sizeof(a) * 8 - 1)); -} - -// constant_time_lt_w returns 0xff..f if a < b and 0 otherwise. -static inline crypto_word_t constant_time_lt_w(crypto_word_t a, - crypto_word_t b) { - // Consider the two cases of the problem: - // msb(a) == msb(b): a < b iff the MSB of a - b is set. - // msb(a) != msb(b): a < b iff the MSB of b is set. - // - // If msb(a) == msb(b) then the following evaluates as: - // msb(a^((a^b)|((a-b)^a))) == - // msb(a^((a-b) ^ a)) == (because msb(a^b) == 0) - // msb(a^a^(a-b)) == (rearranging) - // msb(a-b) (because ∀x. x^x == 0) - // - // Else, if msb(a) != msb(b) then the following evaluates as: - // msb(a^((a^b)|((a-b)^a))) == - // msb(a^(𝟙 | ((a-b)^a))) == (because msb(a^b) == 1 and 𝟙 - // represents a value s.t. msb(𝟙) = 1) - // msb(a^𝟙) == (because ORing with 1 results in 1) - // msb(b) - // - // - // Here is an SMT-LIB verification of this formula: - // - // (define-fun lt ((a (_ BitVec 32)) (b (_ BitVec 32))) (_ BitVec 32) - // (bvxor a (bvor (bvxor a b) (bvxor (bvsub a b) a))) - // ) - // - // (declare-fun a () (_ BitVec 32)) - // (declare-fun b () (_ BitVec 32)) - // - // (assert (not (= (= #x00000001 (bvlshr (lt a b) #x0000001f)) (bvult a b)))) - // (check-sat) - // (get-model) - return constant_time_msb_w(a^((a^b)|((a-b)^a))); -} - -// constant_time_lt_8 acts like |constant_time_lt_w| but returns an 8-bit -// mask. -static inline uint8_t constant_time_lt_8(crypto_word_t a, crypto_word_t b) { - return (uint8_t)(constant_time_lt_w(a, b)); -} - -// constant_time_ge_w returns 0xff..f if a >= b and 0 otherwise. -static inline crypto_word_t constant_time_ge_w(crypto_word_t a, - crypto_word_t b) { - return ~constant_time_lt_w(a, b); -} - -// constant_time_ge_8 acts like |constant_time_ge_w| but returns an 8-bit -// mask. -static inline uint8_t constant_time_ge_8(crypto_word_t a, crypto_word_t b) { - return (uint8_t)(constant_time_ge_w(a, b)); -} - -// constant_time_is_zero returns 0xff..f if a == 0 and 0 otherwise. -static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) { - // Here is an SMT-LIB verification of this formula: - // - // (define-fun is_zero ((a (_ BitVec 32))) (_ BitVec 32) - // (bvand (bvnot a) (bvsub a #x00000001)) - // ) - // - // (declare-fun a () (_ BitVec 32)) - // - // (assert (not (= (= #x00000001 (bvlshr (is_zero a) #x0000001f)) (= a #x00000000)))) - // (check-sat) - // (get-model) - return constant_time_msb_w(~a & (a - 1)); -} - -// constant_time_is_zero_8 acts like |constant_time_is_zero_w| but returns an -// 8-bit mask. -static inline uint8_t constant_time_is_zero_8(crypto_word_t a) { - return (uint8_t)(constant_time_is_zero_w(a)); -} - -// constant_time_eq_w returns 0xff..f if a == b and 0 otherwise. -static inline crypto_word_t constant_time_eq_w(crypto_word_t a, - crypto_word_t b) { - return constant_time_is_zero_w(a ^ b); -} - -// constant_time_eq_8 acts like |constant_time_eq_w| but returns an 8-bit -// mask. -static inline uint8_t constant_time_eq_8(crypto_word_t a, crypto_word_t b) { - return (uint8_t)(constant_time_eq_w(a, b)); -} - -// constant_time_eq_int acts like |constant_time_eq_w| but works on int -// values. -static inline crypto_word_t constant_time_eq_int(int a, int b) { - return constant_time_eq_w((crypto_word_t)(a), (crypto_word_t)(b)); -} - -// constant_time_eq_int_8 acts like |constant_time_eq_int| but returns an 8-bit -// mask. -static inline uint8_t constant_time_eq_int_8(int a, int b) { - return constant_time_eq_8((crypto_word_t)(a), (crypto_word_t)(b)); -} - -// constant_time_select_w returns (mask & a) | (~mask & b). When |mask| is all -// 1s or all 0s (as returned by the methods above), the select methods return -// either |a| (if |mask| is nonzero) or |b| (if |mask| is zero). -static inline crypto_word_t constant_time_select_w(crypto_word_t mask, - crypto_word_t a, - crypto_word_t b) { - return (mask & a) | (~mask & b); -} - -// constant_time_select_8 acts like |constant_time_select| but operates on -// 8-bit values. -static inline uint8_t constant_time_select_8(uint8_t mask, uint8_t a, - uint8_t b) { - return (uint8_t)(constant_time_select_w(mask, a, b)); -} - -// constant_time_select_int acts like |constant_time_select| but operates on -// ints. -static inline int constant_time_select_int(crypto_word_t mask, int a, int b) { - return (int)(constant_time_select_w(mask, (crypto_word_t)(a), - (crypto_word_t)(b))); -} - - -// Thread-safe initialisation. - -#if defined(OPENSSL_NO_THREADS) -typedef uint32_t CRYPTO_once_t; -#define CRYPTO_ONCE_INIT 0 -#elif defined(OPENSSL_WINDOWS_THREADS) -typedef INIT_ONCE CRYPTO_once_t; -#define CRYPTO_ONCE_INIT INIT_ONCE_STATIC_INIT -#elif defined(OPENSSL_PTHREADS) -typedef pthread_once_t CRYPTO_once_t; -#define CRYPTO_ONCE_INIT PTHREAD_ONCE_INIT -#else -#error "Unknown threading library" -#endif - -// CRYPTO_once calls |init| exactly once per process. This is thread-safe: if -// concurrent threads call |CRYPTO_once| with the same |CRYPTO_once_t| argument -// then they will block until |init| completes, but |init| will have only been -// called once. -// -// The |once| argument must be a |CRYPTO_once_t| that has been initialised with -// the value |CRYPTO_ONCE_INIT|. -OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); - - -// Reference counting. - -// CRYPTO_REFCOUNT_MAX is the value at which the reference count saturates. -#define CRYPTO_REFCOUNT_MAX 0xffffffff - -// CRYPTO_refcount_inc atomically increments the value at |*count| unless the -// value would overflow. It's safe for multiple threads to concurrently call -// this or |CRYPTO_refcount_dec_and_test_zero| on the same -// |CRYPTO_refcount_t|. -OPENSSL_EXPORT void CRYPTO_refcount_inc(CRYPTO_refcount_t *count); - -// CRYPTO_refcount_dec_and_test_zero tests the value at |*count|: -// if it's zero, it crashes the address space. -// if it's the maximum value, it returns zero. -// otherwise, it atomically decrements it and returns one iff the resulting -// value is zero. -// -// It's safe for multiple threads to concurrently call this or -// |CRYPTO_refcount_inc| on the same |CRYPTO_refcount_t|. -OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count); - - -// Locks. -// -// Two types of locks are defined: |CRYPTO_MUTEX|, which can be used in -// structures as normal, and |struct CRYPTO_STATIC_MUTEX|, which can be used as -// a global lock. A global lock must be initialised to the value -// |CRYPTO_STATIC_MUTEX_INIT|. -// -// |CRYPTO_MUTEX| can appear in public structures and so is defined in -// thread.h as a structure large enough to fit the real type. The global lock is -// a different type so it may be initialized with platform initializer macros. - -#if defined(OPENSSL_NO_THREADS) -struct CRYPTO_STATIC_MUTEX { - char padding; // Empty structs have different sizes in C and C++. -}; -#define CRYPTO_STATIC_MUTEX_INIT { 0 } -#elif defined(OPENSSL_WINDOWS_THREADS) -struct CRYPTO_STATIC_MUTEX { - SRWLOCK lock; -}; -#define CRYPTO_STATIC_MUTEX_INIT { SRWLOCK_INIT } -#elif defined(OPENSSL_PTHREADS) -struct CRYPTO_STATIC_MUTEX { - pthread_rwlock_t lock; -}; -#define CRYPTO_STATIC_MUTEX_INIT { PTHREAD_RWLOCK_INITIALIZER } -#else -#error "Unknown threading library" -#endif - -// CRYPTO_MUTEX_init initialises |lock|. If |lock| is a static variable, use a -// |CRYPTO_STATIC_MUTEX|. -OPENSSL_EXPORT void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_lock_read locks |lock| such that other threads may also have a -// read lock, but none may have a write lock. -OPENSSL_EXPORT void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_lock_write locks |lock| such that no other thread has any type -// of lock on it. -OPENSSL_EXPORT void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_unlock_read unlocks |lock| for reading. -OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_unlock_write unlocks |lock| for writing. -OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_cleanup releases all resources held by |lock|. -OPENSSL_EXPORT void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_lock_read locks |lock| such that other threads may also -// have a read lock, but none may have a write lock. The |lock| variable does -// not need to be initialised by any function, but must have been statically -// initialised with |CRYPTO_STATIC_MUTEX_INIT|. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_read( - struct CRYPTO_STATIC_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_lock_write locks |lock| such that no other thread has -// any type of lock on it. The |lock| variable does not need to be initialised -// by any function, but must have been statically initialised with -// |CRYPTO_STATIC_MUTEX_INIT|. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_write( - struct CRYPTO_STATIC_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_unlock_read unlocks |lock| for reading. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_read( - struct CRYPTO_STATIC_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_unlock_write unlocks |lock| for writing. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_write( - struct CRYPTO_STATIC_MUTEX *lock); - -#if defined(__cplusplus) -extern "C++" { - -namespace bssl { - -namespace internal { - -// MutexLockBase is a RAII helper for CRYPTO_MUTEX locking. -template -class MutexLockBase { - public: - explicit MutexLockBase(CRYPTO_MUTEX *mu) : mu_(mu) { - assert(mu_ != nullptr); - LockFunc(mu_); - } - ~MutexLockBase() { ReleaseFunc(mu_); } - MutexLockBase(const MutexLockBase &) = delete; - MutexLockBase &operator=(const MutexLockBase &) = - delete; - - private: - CRYPTO_MUTEX *const mu_; -}; - -} // namespace internal - -using MutexWriteLock = - internal::MutexLockBase; -using MutexReadLock = - internal::MutexLockBase; - -} // namespace bssl - -} // extern "C++" -#endif // defined(__cplusplus) - - -// Thread local storage. - -// thread_local_data_t enumerates the types of thread-local data that can be -// stored. -typedef enum { - OPENSSL_THREAD_LOCAL_ERR = 0, - OPENSSL_THREAD_LOCAL_RAND, - OPENSSL_THREAD_LOCAL_TEST, - NUM_OPENSSL_THREAD_LOCALS, -} thread_local_data_t; - -// thread_local_destructor_t is the type of a destructor function that will be -// called when a thread exits and its thread-local storage needs to be freed. -typedef void (*thread_local_destructor_t)(void *); - -// CRYPTO_get_thread_local gets the pointer value that is stored for the -// current thread for the given index, or NULL if none has been set. -OPENSSL_EXPORT void *CRYPTO_get_thread_local(thread_local_data_t value); - -// CRYPTO_set_thread_local sets a pointer value for the current thread at the -// given index. This function should only be called once per thread for a given -// |index|: rather than update the pointer value itself, update the data that -// is pointed to. -// -// The destructor function will be called when a thread exits to free this -// thread-local data. All calls to |CRYPTO_set_thread_local| with the same -// |index| should have the same |destructor| argument. The destructor may be -// called with a NULL argument if a thread that never set a thread-local -// pointer for |index|, exits. The destructor may be called concurrently with -// different arguments. -// -// This function returns one on success or zero on error. If it returns zero -// then |destructor| has been called with |value| already. -OPENSSL_EXPORT int CRYPTO_set_thread_local( - thread_local_data_t index, void *value, - thread_local_destructor_t destructor); - - -// ex_data - -typedef struct crypto_ex_data_func_st CRYPTO_EX_DATA_FUNCS; - -DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) - -// CRYPTO_EX_DATA_CLASS tracks the ex_indices registered for a type which -// supports ex_data. It should defined as a static global within the module -// which defines that type. -typedef struct { - struct CRYPTO_STATIC_MUTEX lock; - STACK_OF(CRYPTO_EX_DATA_FUNCS) *meth; - // num_reserved is one if the ex_data index zero is reserved for legacy - // |TYPE_get_app_data| functions. - uint8_t num_reserved; -} CRYPTO_EX_DATA_CLASS; - -#define CRYPTO_EX_DATA_CLASS_INIT {CRYPTO_STATIC_MUTEX_INIT, NULL, 0} -#define CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA \ - {CRYPTO_STATIC_MUTEX_INIT, NULL, 1} - -// CRYPTO_get_ex_new_index allocates a new index for |ex_data_class| and writes -// it to |*out_index|. Each class of object should provide a wrapper function -// that uses the correct |CRYPTO_EX_DATA_CLASS|. It returns one on success and -// zero otherwise. -OPENSSL_EXPORT int CRYPTO_get_ex_new_index(CRYPTO_EX_DATA_CLASS *ex_data_class, - int *out_index, long argl, - void *argp, - CRYPTO_EX_free *free_func); - -// CRYPTO_set_ex_data sets an extra data pointer on a given object. Each class -// of object should provide a wrapper function. -OPENSSL_EXPORT int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val); - -// CRYPTO_get_ex_data returns an extra data pointer for a given object, or NULL -// if no such index exists. Each class of object should provide a wrapper -// function. -OPENSSL_EXPORT void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int index); - -// CRYPTO_new_ex_data initialises a newly allocated |CRYPTO_EX_DATA|. -OPENSSL_EXPORT void CRYPTO_new_ex_data(CRYPTO_EX_DATA *ad); - -// CRYPTO_free_ex_data frees |ad|, which is embedded inside |obj|, which is an -// object of the given class. -OPENSSL_EXPORT void CRYPTO_free_ex_data(CRYPTO_EX_DATA_CLASS *ex_data_class, - void *obj, CRYPTO_EX_DATA *ad); - - -// Endianness conversions. - -#if defined(__GNUC__) && __GNUC__ >= 2 -static inline uint32_t CRYPTO_bswap4(uint32_t x) { - return __builtin_bswap32(x); -} - -static inline uint64_t CRYPTO_bswap8(uint64_t x) { - return __builtin_bswap64(x); -} -#elif defined(_MSC_VER) -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#pragma intrinsic(_byteswap_uint64, _byteswap_ulong) -static inline uint32_t CRYPTO_bswap4(uint32_t x) { - return _byteswap_ulong(x); -} - -static inline uint64_t CRYPTO_bswap8(uint64_t x) { - return _byteswap_uint64(x); -} -#else -static inline uint32_t CRYPTO_bswap4(uint32_t x) { - x = (x >> 16) | (x << 16); - x = ((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8); - return x; -} - -static inline uint64_t CRYPTO_bswap8(uint64_t x) { - return CRYPTO_bswap4(x >> 32) | (((uint64_t)CRYPTO_bswap4(x)) << 32); -} -#endif - - -// Language bug workarounds. -// -// Most C standard library functions are undefined if passed NULL, even when the -// corresponding length is zero. This gives them (and, in turn, all functions -// which call them) surprising behavior on empty arrays. Some compilers will -// miscompile code due to this rule. See also -// https://www.imperialviolet.org/2016/06/26/nonnull.html -// -// These wrapper functions behave the same as the corresponding C standard -// functions, but behave as expected when passed NULL if the length is zero. -// -// Note |OPENSSL_memcmp| is a different function from |CRYPTO_memcmp|. - -// C++ defines |memchr| as a const-correct overload. -#if defined(__cplusplus) -extern "C++" { - -static inline const void *OPENSSL_memchr(const void *s, int c, size_t n) { - if (n == 0) { - return NULL; - } - - return memchr(s, c, n); -} - -static inline void *OPENSSL_memchr(void *s, int c, size_t n) { - if (n == 0) { - return NULL; - } - - return memchr(s, c, n); -} - -} // extern "C++" -#else // __cplusplus - -static inline void *OPENSSL_memchr(const void *s, int c, size_t n) { - if (n == 0) { - return NULL; - } - - return memchr(s, c, n); -} - -#endif // __cplusplus - -static inline int OPENSSL_memcmp(const void *s1, const void *s2, size_t n) { - if (n == 0) { - return 0; - } - - return memcmp(s1, s2, n); -} - -static inline void *OPENSSL_memcpy(void *dst, const void *src, size_t n) { - if (n == 0) { - return dst; - } - - return memcpy(dst, src, n); -} - -static inline void *OPENSSL_memmove(void *dst, const void *src, size_t n) { - if (n == 0) { - return dst; - } - - return memmove(dst, src, n); -} - -static inline void *OPENSSL_memset(void *dst, int c, size_t n) { - if (n == 0) { - return dst; - } - - return memset(dst, c, n); -} - -#if defined(BORINGSSL_FIPS) -// BORINGSSL_FIPS_abort is called when a FIPS power-on or continuous test -// fails. It prevents any further cryptographic operations by the current -// process. -void BORINGSSL_FIPS_abort(void) __attribute__((noreturn)); -#endif - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CRYPTO_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/internal.h.grpc_back deleted file mode 100644 index 067f3bb04..000000000 --- a/Pods/BoringSSL-GRPC/crypto/internal.h.grpc_back +++ /dev/null @@ -1,739 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#ifndef OPENSSL_HEADER_CRYPTO_INTERNAL_H -#define OPENSSL_HEADER_CRYPTO_INTERNAL_H - -#include -#include -#include - -#include -#include - -#if defined(__GNUC__) && \ - (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) < 40800 -// |alignas| and |alignof| were added in C11. GCC added support in version 4.8. -// Testing for __STDC_VERSION__/__cplusplus doesn't work because 4.7 already -// reports support for C11. -#define alignas(x) __attribute__ ((aligned (x))) -#define alignof(x) __alignof__ (x) -#elif !defined(__cplusplus) -#if defined(_MSC_VER) -#define alignas(x) __declspec(align(x)) -#define alignof __alignof -#else -#include -#endif -#endif - -#if !defined(OPENSSL_NO_THREADS) && \ - (!defined(OPENSSL_WINDOWS) || defined(__MINGW32__)) -#include -#define OPENSSL_PTHREADS -#endif - -#if !defined(OPENSSL_NO_THREADS) && !defined(OPENSSL_PTHREADS) && \ - defined(OPENSSL_WINDOWS) -#define OPENSSL_WINDOWS_THREADS -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM) || \ - defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE) -// OPENSSL_cpuid_setup initializes the platform-specific feature cache. -void OPENSSL_cpuid_setup(void); -#endif - - -#if (!defined(_MSC_VER) || defined(__clang__)) && defined(OPENSSL_64_BIT) -#define BORINGSSL_HAS_UINT128 -typedef __int128_t int128_t; -typedef __uint128_t uint128_t; - -// clang-cl supports __uint128_t but modulus and division don't work. -// https://crbug.com/787617. -#if !defined(_MSC_VER) || !defined(__clang__) -#define BORINGSSL_CAN_DIVIDE_UINT128 -#endif -#endif - -#define OPENSSL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) - -// Have a generic fall-through for different versions of C/C++. -#if defined(__cplusplus) && __cplusplus >= 201703L -#define OPENSSL_FALLTHROUGH [[fallthrough]] -#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__) -#define OPENSSL_FALLTHROUGH [[clang::fallthrough]] -#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \ - __GNUC__ >= 7 -#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]] -#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7 -#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) -#else // C++11 on gcc 6, and all other cases -#define OPENSSL_FALLTHROUGH -#endif - -// buffers_alias returns one if |a| and |b| alias and zero otherwise. -static inline int buffers_alias(const uint8_t *a, size_t a_len, - const uint8_t *b, size_t b_len) { - // Cast |a| and |b| to integers. In C, pointer comparisons between unrelated - // objects are undefined whereas pointer to integer conversions are merely - // implementation-defined. We assume the implementation defined it in a sane - // way. - uintptr_t a_u = (uintptr_t)a; - uintptr_t b_u = (uintptr_t)b; - return a_u + a_len > b_u && b_u + b_len > a_u; -} - - -// Constant-time utility functions. -// -// The following methods return a bitmask of all ones (0xff...f) for true and 0 -// for false. This is useful for choosing a value based on the result of a -// conditional in constant time. For example, -// -// if (a < b) { -// c = a; -// } else { -// c = b; -// } -// -// can be written as -// -// crypto_word_t lt = constant_time_lt_w(a, b); -// c = constant_time_select_w(lt, a, b); - -// crypto_word_t is the type that most constant-time functions use. Ideally we -// would like it to be |size_t|, but NaCl builds in 64-bit mode with 32-bit -// pointers, which means that |size_t| can be 32 bits when |BN_ULONG| is 64 -// bits. Since we want to be able to do constant-time operations on a -// |BN_ULONG|, |crypto_word_t| is defined as an unsigned value with the native -// word length. -#if defined(OPENSSL_64_BIT) -typedef uint64_t crypto_word_t; -#elif defined(OPENSSL_32_BIT) -typedef uint32_t crypto_word_t; -#else -#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" -#endif - -#define CONSTTIME_TRUE_W ~((crypto_word_t)0) -#define CONSTTIME_FALSE_W ((crypto_word_t)0) -#define CONSTTIME_TRUE_8 ((uint8_t)0xff) - -#define CONSTTIME_TRUE_W ~((crypto_word_t)0) -#define CONSTTIME_FALSE_W ((crypto_word_t)0) -#define CONSTTIME_TRUE_8 ((uint8_t)0xff) -#define CONSTTIME_FALSE_8 ((uint8_t)0) - -// constant_time_msb_w returns the given value with the MSB copied to all the -// other bits. -static inline crypto_word_t constant_time_msb_w(crypto_word_t a) { - return 0u - (a >> (sizeof(a) * 8 - 1)); -} - -// constant_time_lt_w returns 0xff..f if a < b and 0 otherwise. -static inline crypto_word_t constant_time_lt_w(crypto_word_t a, - crypto_word_t b) { - // Consider the two cases of the problem: - // msb(a) == msb(b): a < b iff the MSB of a - b is set. - // msb(a) != msb(b): a < b iff the MSB of b is set. - // - // If msb(a) == msb(b) then the following evaluates as: - // msb(a^((a^b)|((a-b)^a))) == - // msb(a^((a-b) ^ a)) == (because msb(a^b) == 0) - // msb(a^a^(a-b)) == (rearranging) - // msb(a-b) (because ∀x. x^x == 0) - // - // Else, if msb(a) != msb(b) then the following evaluates as: - // msb(a^((a^b)|((a-b)^a))) == - // msb(a^(𝟙 | ((a-b)^a))) == (because msb(a^b) == 1 and 𝟙 - // represents a value s.t. msb(𝟙) = 1) - // msb(a^𝟙) == (because ORing with 1 results in 1) - // msb(b) - // - // - // Here is an SMT-LIB verification of this formula: - // - // (define-fun lt ((a (_ BitVec 32)) (b (_ BitVec 32))) (_ BitVec 32) - // (bvxor a (bvor (bvxor a b) (bvxor (bvsub a b) a))) - // ) - // - // (declare-fun a () (_ BitVec 32)) - // (declare-fun b () (_ BitVec 32)) - // - // (assert (not (= (= #x00000001 (bvlshr (lt a b) #x0000001f)) (bvult a b)))) - // (check-sat) - // (get-model) - return constant_time_msb_w(a^((a^b)|((a-b)^a))); -} - -// constant_time_lt_8 acts like |constant_time_lt_w| but returns an 8-bit -// mask. -static inline uint8_t constant_time_lt_8(crypto_word_t a, crypto_word_t b) { - return (uint8_t)(constant_time_lt_w(a, b)); -} - -// constant_time_ge_w returns 0xff..f if a >= b and 0 otherwise. -static inline crypto_word_t constant_time_ge_w(crypto_word_t a, - crypto_word_t b) { - return ~constant_time_lt_w(a, b); -} - -// constant_time_ge_8 acts like |constant_time_ge_w| but returns an 8-bit -// mask. -static inline uint8_t constant_time_ge_8(crypto_word_t a, crypto_word_t b) { - return (uint8_t)(constant_time_ge_w(a, b)); -} - -// constant_time_is_zero returns 0xff..f if a == 0 and 0 otherwise. -static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) { - // Here is an SMT-LIB verification of this formula: - // - // (define-fun is_zero ((a (_ BitVec 32))) (_ BitVec 32) - // (bvand (bvnot a) (bvsub a #x00000001)) - // ) - // - // (declare-fun a () (_ BitVec 32)) - // - // (assert (not (= (= #x00000001 (bvlshr (is_zero a) #x0000001f)) (= a #x00000000)))) - // (check-sat) - // (get-model) - return constant_time_msb_w(~a & (a - 1)); -} - -// constant_time_is_zero_8 acts like |constant_time_is_zero_w| but returns an -// 8-bit mask. -static inline uint8_t constant_time_is_zero_8(crypto_word_t a) { - return (uint8_t)(constant_time_is_zero_w(a)); -} - -// constant_time_eq_w returns 0xff..f if a == b and 0 otherwise. -static inline crypto_word_t constant_time_eq_w(crypto_word_t a, - crypto_word_t b) { - return constant_time_is_zero_w(a ^ b); -} - -// constant_time_eq_8 acts like |constant_time_eq_w| but returns an 8-bit -// mask. -static inline uint8_t constant_time_eq_8(crypto_word_t a, crypto_word_t b) { - return (uint8_t)(constant_time_eq_w(a, b)); -} - -// constant_time_eq_int acts like |constant_time_eq_w| but works on int -// values. -static inline crypto_word_t constant_time_eq_int(int a, int b) { - return constant_time_eq_w((crypto_word_t)(a), (crypto_word_t)(b)); -} - -// constant_time_eq_int_8 acts like |constant_time_eq_int| but returns an 8-bit -// mask. -static inline uint8_t constant_time_eq_int_8(int a, int b) { - return constant_time_eq_8((crypto_word_t)(a), (crypto_word_t)(b)); -} - -// constant_time_select_w returns (mask & a) | (~mask & b). When |mask| is all -// 1s or all 0s (as returned by the methods above), the select methods return -// either |a| (if |mask| is nonzero) or |b| (if |mask| is zero). -static inline crypto_word_t constant_time_select_w(crypto_word_t mask, - crypto_word_t a, - crypto_word_t b) { - return (mask & a) | (~mask & b); -} - -// constant_time_select_8 acts like |constant_time_select| but operates on -// 8-bit values. -static inline uint8_t constant_time_select_8(uint8_t mask, uint8_t a, - uint8_t b) { - return (uint8_t)(constant_time_select_w(mask, a, b)); -} - -// constant_time_select_int acts like |constant_time_select| but operates on -// ints. -static inline int constant_time_select_int(crypto_word_t mask, int a, int b) { - return (int)(constant_time_select_w(mask, (crypto_word_t)(a), - (crypto_word_t)(b))); -} - - -// Thread-safe initialisation. - -#if defined(OPENSSL_NO_THREADS) -typedef uint32_t CRYPTO_once_t; -#define CRYPTO_ONCE_INIT 0 -#elif defined(OPENSSL_WINDOWS_THREADS) -typedef INIT_ONCE CRYPTO_once_t; -#define CRYPTO_ONCE_INIT INIT_ONCE_STATIC_INIT -#elif defined(OPENSSL_PTHREADS) -typedef pthread_once_t CRYPTO_once_t; -#define CRYPTO_ONCE_INIT PTHREAD_ONCE_INIT -#else -#error "Unknown threading library" -#endif - -// CRYPTO_once calls |init| exactly once per process. This is thread-safe: if -// concurrent threads call |CRYPTO_once| with the same |CRYPTO_once_t| argument -// then they will block until |init| completes, but |init| will have only been -// called once. -// -// The |once| argument must be a |CRYPTO_once_t| that has been initialised with -// the value |CRYPTO_ONCE_INIT|. -OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); - - -// Reference counting. - -// CRYPTO_REFCOUNT_MAX is the value at which the reference count saturates. -#define CRYPTO_REFCOUNT_MAX 0xffffffff - -// CRYPTO_refcount_inc atomically increments the value at |*count| unless the -// value would overflow. It's safe for multiple threads to concurrently call -// this or |CRYPTO_refcount_dec_and_test_zero| on the same -// |CRYPTO_refcount_t|. -OPENSSL_EXPORT void CRYPTO_refcount_inc(CRYPTO_refcount_t *count); - -// CRYPTO_refcount_dec_and_test_zero tests the value at |*count|: -// if it's zero, it crashes the address space. -// if it's the maximum value, it returns zero. -// otherwise, it atomically decrements it and returns one iff the resulting -// value is zero. -// -// It's safe for multiple threads to concurrently call this or -// |CRYPTO_refcount_inc| on the same |CRYPTO_refcount_t|. -OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count); - - -// Locks. -// -// Two types of locks are defined: |CRYPTO_MUTEX|, which can be used in -// structures as normal, and |struct CRYPTO_STATIC_MUTEX|, which can be used as -// a global lock. A global lock must be initialised to the value -// |CRYPTO_STATIC_MUTEX_INIT|. -// -// |CRYPTO_MUTEX| can appear in public structures and so is defined in -// thread.h as a structure large enough to fit the real type. The global lock is -// a different type so it may be initialized with platform initializer macros. - -#if defined(OPENSSL_NO_THREADS) -struct CRYPTO_STATIC_MUTEX { - char padding; // Empty structs have different sizes in C and C++. -}; -#define CRYPTO_STATIC_MUTEX_INIT { 0 } -#elif defined(OPENSSL_WINDOWS_THREADS) -struct CRYPTO_STATIC_MUTEX { - SRWLOCK lock; -}; -#define CRYPTO_STATIC_MUTEX_INIT { SRWLOCK_INIT } -#elif defined(OPENSSL_PTHREADS) -struct CRYPTO_STATIC_MUTEX { - pthread_rwlock_t lock; -}; -#define CRYPTO_STATIC_MUTEX_INIT { PTHREAD_RWLOCK_INITIALIZER } -#else -#error "Unknown threading library" -#endif - -// CRYPTO_MUTEX_init initialises |lock|. If |lock| is a static variable, use a -// |CRYPTO_STATIC_MUTEX|. -OPENSSL_EXPORT void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_lock_read locks |lock| such that other threads may also have a -// read lock, but none may have a write lock. -OPENSSL_EXPORT void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_lock_write locks |lock| such that no other thread has any type -// of lock on it. -OPENSSL_EXPORT void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_unlock_read unlocks |lock| for reading. -OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_unlock_write unlocks |lock| for writing. -OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock); - -// CRYPTO_MUTEX_cleanup releases all resources held by |lock|. -OPENSSL_EXPORT void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_lock_read locks |lock| such that other threads may also -// have a read lock, but none may have a write lock. The |lock| variable does -// not need to be initialised by any function, but must have been statically -// initialised with |CRYPTO_STATIC_MUTEX_INIT|. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_read( - struct CRYPTO_STATIC_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_lock_write locks |lock| such that no other thread has -// any type of lock on it. The |lock| variable does not need to be initialised -// by any function, but must have been statically initialised with -// |CRYPTO_STATIC_MUTEX_INIT|. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_write( - struct CRYPTO_STATIC_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_unlock_read unlocks |lock| for reading. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_read( - struct CRYPTO_STATIC_MUTEX *lock); - -// CRYPTO_STATIC_MUTEX_unlock_write unlocks |lock| for writing. -OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_write( - struct CRYPTO_STATIC_MUTEX *lock); - -#if defined(__cplusplus) -extern "C++" { - -namespace bssl { - -namespace internal { - -// MutexLockBase is a RAII helper for CRYPTO_MUTEX locking. -template -class MutexLockBase { - public: - explicit MutexLockBase(CRYPTO_MUTEX *mu) : mu_(mu) { - assert(mu_ != nullptr); - LockFunc(mu_); - } - ~MutexLockBase() { ReleaseFunc(mu_); } - MutexLockBase(const MutexLockBase &) = delete; - MutexLockBase &operator=(const MutexLockBase &) = - delete; - - private: - CRYPTO_MUTEX *const mu_; -}; - -} // namespace internal - -using MutexWriteLock = - internal::MutexLockBase; -using MutexReadLock = - internal::MutexLockBase; - -} // namespace bssl - -} // extern "C++" -#endif // defined(__cplusplus) - - -// Thread local storage. - -// thread_local_data_t enumerates the types of thread-local data that can be -// stored. -typedef enum { - OPENSSL_THREAD_LOCAL_ERR = 0, - OPENSSL_THREAD_LOCAL_RAND, - OPENSSL_THREAD_LOCAL_TEST, - NUM_OPENSSL_THREAD_LOCALS, -} thread_local_data_t; - -// thread_local_destructor_t is the type of a destructor function that will be -// called when a thread exits and its thread-local storage needs to be freed. -typedef void (*thread_local_destructor_t)(void *); - -// CRYPTO_get_thread_local gets the pointer value that is stored for the -// current thread for the given index, or NULL if none has been set. -OPENSSL_EXPORT void *CRYPTO_get_thread_local(thread_local_data_t value); - -// CRYPTO_set_thread_local sets a pointer value for the current thread at the -// given index. This function should only be called once per thread for a given -// |index|: rather than update the pointer value itself, update the data that -// is pointed to. -// -// The destructor function will be called when a thread exits to free this -// thread-local data. All calls to |CRYPTO_set_thread_local| with the same -// |index| should have the same |destructor| argument. The destructor may be -// called with a NULL argument if a thread that never set a thread-local -// pointer for |index|, exits. The destructor may be called concurrently with -// different arguments. -// -// This function returns one on success or zero on error. If it returns zero -// then |destructor| has been called with |value| already. -OPENSSL_EXPORT int CRYPTO_set_thread_local( - thread_local_data_t index, void *value, - thread_local_destructor_t destructor); - - -// ex_data - -typedef struct crypto_ex_data_func_st CRYPTO_EX_DATA_FUNCS; - -DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) - -// CRYPTO_EX_DATA_CLASS tracks the ex_indices registered for a type which -// supports ex_data. It should defined as a static global within the module -// which defines that type. -typedef struct { - struct CRYPTO_STATIC_MUTEX lock; - STACK_OF(CRYPTO_EX_DATA_FUNCS) *meth; - // num_reserved is one if the ex_data index zero is reserved for legacy - // |TYPE_get_app_data| functions. - uint8_t num_reserved; -} CRYPTO_EX_DATA_CLASS; - -#define CRYPTO_EX_DATA_CLASS_INIT {CRYPTO_STATIC_MUTEX_INIT, NULL, 0} -#define CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA \ - {CRYPTO_STATIC_MUTEX_INIT, NULL, 1} - -// CRYPTO_get_ex_new_index allocates a new index for |ex_data_class| and writes -// it to |*out_index|. Each class of object should provide a wrapper function -// that uses the correct |CRYPTO_EX_DATA_CLASS|. It returns one on success and -// zero otherwise. -OPENSSL_EXPORT int CRYPTO_get_ex_new_index(CRYPTO_EX_DATA_CLASS *ex_data_class, - int *out_index, long argl, - void *argp, - CRYPTO_EX_free *free_func); - -// CRYPTO_set_ex_data sets an extra data pointer on a given object. Each class -// of object should provide a wrapper function. -OPENSSL_EXPORT int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val); - -// CRYPTO_get_ex_data returns an extra data pointer for a given object, or NULL -// if no such index exists. Each class of object should provide a wrapper -// function. -OPENSSL_EXPORT void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int index); - -// CRYPTO_new_ex_data initialises a newly allocated |CRYPTO_EX_DATA|. -OPENSSL_EXPORT void CRYPTO_new_ex_data(CRYPTO_EX_DATA *ad); - -// CRYPTO_free_ex_data frees |ad|, which is embedded inside |obj|, which is an -// object of the given class. -OPENSSL_EXPORT void CRYPTO_free_ex_data(CRYPTO_EX_DATA_CLASS *ex_data_class, - void *obj, CRYPTO_EX_DATA *ad); - - -// Endianness conversions. - -#if defined(__GNUC__) && __GNUC__ >= 2 -static inline uint32_t CRYPTO_bswap4(uint32_t x) { - return __builtin_bswap32(x); -} - -static inline uint64_t CRYPTO_bswap8(uint64_t x) { - return __builtin_bswap64(x); -} -#elif defined(_MSC_VER) -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#pragma intrinsic(_byteswap_uint64, _byteswap_ulong) -static inline uint32_t CRYPTO_bswap4(uint32_t x) { - return _byteswap_ulong(x); -} - -static inline uint64_t CRYPTO_bswap8(uint64_t x) { - return _byteswap_uint64(x); -} -#else -static inline uint32_t CRYPTO_bswap4(uint32_t x) { - x = (x >> 16) | (x << 16); - x = ((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8); - return x; -} - -static inline uint64_t CRYPTO_bswap8(uint64_t x) { - return CRYPTO_bswap4(x >> 32) | (((uint64_t)CRYPTO_bswap4(x)) << 32); -} -#endif - - -// Language bug workarounds. -// -// Most C standard library functions are undefined if passed NULL, even when the -// corresponding length is zero. This gives them (and, in turn, all functions -// which call them) surprising behavior on empty arrays. Some compilers will -// miscompile code due to this rule. See also -// https://www.imperialviolet.org/2016/06/26/nonnull.html -// -// These wrapper functions behave the same as the corresponding C standard -// functions, but behave as expected when passed NULL if the length is zero. -// -// Note |OPENSSL_memcmp| is a different function from |CRYPTO_memcmp|. - -// C++ defines |memchr| as a const-correct overload. -#if defined(__cplusplus) -extern "C++" { - -static inline const void *OPENSSL_memchr(const void *s, int c, size_t n) { - if (n == 0) { - return NULL; - } - - return memchr(s, c, n); -} - -static inline void *OPENSSL_memchr(void *s, int c, size_t n) { - if (n == 0) { - return NULL; - } - - return memchr(s, c, n); -} - -} // extern "C++" -#else // __cplusplus - -static inline void *OPENSSL_memchr(const void *s, int c, size_t n) { - if (n == 0) { - return NULL; - } - - return memchr(s, c, n); -} - -#endif // __cplusplus - -static inline int OPENSSL_memcmp(const void *s1, const void *s2, size_t n) { - if (n == 0) { - return 0; - } - - return memcmp(s1, s2, n); -} - -static inline void *OPENSSL_memcpy(void *dst, const void *src, size_t n) { - if (n == 0) { - return dst; - } - - return memcpy(dst, src, n); -} - -static inline void *OPENSSL_memmove(void *dst, const void *src, size_t n) { - if (n == 0) { - return dst; - } - - return memmove(dst, src, n); -} - -static inline void *OPENSSL_memset(void *dst, int c, size_t n) { - if (n == 0) { - return dst; - } - - return memset(dst, c, n); -} - -#if defined(BORINGSSL_FIPS) -// BORINGSSL_FIPS_abort is called when a FIPS power-on or continuous test -// fails. It prevents any further cryptographic operations by the current -// process. -void BORINGSSL_FIPS_abort(void) __attribute__((noreturn)); -#endif - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CRYPTO_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/mem.c b/Pods/BoringSSL-GRPC/crypto/mem.c deleted file mode 100644 index 82ddd0e33..000000000 --- a/Pods/BoringSSL-GRPC/crypto/mem.c +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include -#include -#include -#include - -#if defined(OPENSSL_WINDOWS) -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#endif - -#include "internal.h" - - -#define OPENSSL_MALLOC_PREFIX 8 - - -void *OPENSSL_malloc(size_t size) { - void *ptr = malloc(size + OPENSSL_MALLOC_PREFIX); - if (ptr == NULL) { - return NULL; - } - - *(size_t *)ptr = size; - - return ((uint8_t *)ptr) + OPENSSL_MALLOC_PREFIX; -} - -void OPENSSL_free(void *orig_ptr) { - if (orig_ptr == NULL) { - return; - } - - void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; - - size_t size = *(size_t *)ptr; - OPENSSL_cleanse(ptr, size + OPENSSL_MALLOC_PREFIX); - free(ptr); -} - -void *OPENSSL_realloc(void *orig_ptr, size_t new_size) { - if (orig_ptr == NULL) { - return OPENSSL_malloc(new_size); - } - - void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; - size_t old_size = *(size_t *)ptr; - - void *ret = OPENSSL_malloc(new_size); - if (ret == NULL) { - return NULL; - } - - size_t to_copy = new_size; - if (old_size < to_copy) { - to_copy = old_size; - } - - memcpy(ret, orig_ptr, to_copy); - OPENSSL_free(orig_ptr); - - return ret; -} - -void OPENSSL_cleanse(void *ptr, size_t len) { -#if defined(OPENSSL_WINDOWS) - SecureZeroMemory(ptr, len); -#else - OPENSSL_memset(ptr, 0, len); - -#if !defined(OPENSSL_NO_ASM) - /* As best as we can tell, this is sufficient to break any optimisations that - might try to eliminate "superfluous" memsets. If there's an easy way to - detect memset_s, it would be better to use that. */ - __asm__ __volatile__("" : : "r"(ptr) : "memory"); -#endif -#endif // !OPENSSL_NO_ASM -} - -int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) { - const uint8_t *a = in_a; - const uint8_t *b = in_b; - uint8_t x = 0; - - for (size_t i = 0; i < len; i++) { - x |= a[i] ^ b[i]; - } - - return x; -} - -uint32_t OPENSSL_hash32(const void *ptr, size_t len) { - // These are the FNV-1a parameters for 32 bits. - static const uint32_t kPrime = 16777619u; - static const uint32_t kOffsetBasis = 2166136261u; - - const uint8_t *in = ptr; - uint32_t h = kOffsetBasis; - - for (size_t i = 0; i < len; i++) { - h ^= in[i]; - h *= kPrime; - } - - return h; -} - -size_t OPENSSL_strnlen(const char *s, size_t len) { - for (size_t i = 0; i < len; i++) { - if (s[i] == 0) { - return i; - } - } - - return len; -} - -char *OPENSSL_strdup(const char *s) { - const size_t len = strlen(s) + 1; - char *ret = OPENSSL_malloc(len); - if (ret == NULL) { - return NULL; - } - OPENSSL_memcpy(ret, s, len); - return ret; -} - -int OPENSSL_tolower(int c) { - if (c >= 'A' && c <= 'Z') { - return c + ('a' - 'A'); - } - return c; -} - -int OPENSSL_strcasecmp(const char *a, const char *b) { - for (size_t i = 0;; i++) { - const int aa = OPENSSL_tolower(a[i]); - const int bb = OPENSSL_tolower(b[i]); - - if (aa < bb) { - return -1; - } else if (aa > bb) { - return 1; - } else if (aa == 0) { - return 0; - } - } -} - -int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) { - for (size_t i = 0; i < n; i++) { - const int aa = OPENSSL_tolower(a[i]); - const int bb = OPENSSL_tolower(b[i]); - - if (aa < bb) { - return -1; - } else if (aa > bb) { - return 1; - } else if (aa == 0) { - return 0; - } - } - - return 0; -} - -int BIO_snprintf(char *buf, size_t n, const char *format, ...) { - va_list args; - va_start(args, format); - int ret = BIO_vsnprintf(buf, n, format, args); - va_end(args); - return ret; -} - -int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) { - return vsnprintf(buf, n, format, args); -} diff --git a/Pods/BoringSSL-GRPC/crypto/mem.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/mem.c.grpc_back deleted file mode 100644 index 50c6fe6d8..000000000 --- a/Pods/BoringSSL-GRPC/crypto/mem.c.grpc_back +++ /dev/null @@ -1,235 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include -#include -#include -#include - -#if defined(OPENSSL_WINDOWS) -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#endif - -#include "internal.h" - - -#define OPENSSL_MALLOC_PREFIX 8 - - -void *OPENSSL_malloc(size_t size) { - void *ptr = malloc(size + OPENSSL_MALLOC_PREFIX); - if (ptr == NULL) { - return NULL; - } - - *(size_t *)ptr = size; - - return ((uint8_t *)ptr) + OPENSSL_MALLOC_PREFIX; -} - -void OPENSSL_free(void *orig_ptr) { - if (orig_ptr == NULL) { - return; - } - - void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; - - size_t size = *(size_t *)ptr; - OPENSSL_cleanse(ptr, size + OPENSSL_MALLOC_PREFIX); - free(ptr); -} - -void *OPENSSL_realloc(void *orig_ptr, size_t new_size) { - if (orig_ptr == NULL) { - return OPENSSL_malloc(new_size); - } - - void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; - size_t old_size = *(size_t *)ptr; - - void *ret = OPENSSL_malloc(new_size); - if (ret == NULL) { - return NULL; - } - - size_t to_copy = new_size; - if (old_size < to_copy) { - to_copy = old_size; - } - - memcpy(ret, orig_ptr, to_copy); - OPENSSL_free(orig_ptr); - - return ret; -} - -void OPENSSL_cleanse(void *ptr, size_t len) { -#if defined(OPENSSL_WINDOWS) - SecureZeroMemory(ptr, len); -#else - OPENSSL_memset(ptr, 0, len); - -#if !defined(OPENSSL_NO_ASM) - /* As best as we can tell, this is sufficient to break any optimisations that - might try to eliminate "superfluous" memsets. If there's an easy way to - detect memset_s, it would be better to use that. */ - __asm__ __volatile__("" : : "r"(ptr) : "memory"); -#endif -#endif // !OPENSSL_NO_ASM -} - -int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) { - const uint8_t *a = in_a; - const uint8_t *b = in_b; - uint8_t x = 0; - - for (size_t i = 0; i < len; i++) { - x |= a[i] ^ b[i]; - } - - return x; -} - -uint32_t OPENSSL_hash32(const void *ptr, size_t len) { - // These are the FNV-1a parameters for 32 bits. - static const uint32_t kPrime = 16777619u; - static const uint32_t kOffsetBasis = 2166136261u; - - const uint8_t *in = ptr; - uint32_t h = kOffsetBasis; - - for (size_t i = 0; i < len; i++) { - h ^= in[i]; - h *= kPrime; - } - - return h; -} - -size_t OPENSSL_strnlen(const char *s, size_t len) { - for (size_t i = 0; i < len; i++) { - if (s[i] == 0) { - return i; - } - } - - return len; -} - -char *OPENSSL_strdup(const char *s) { - const size_t len = strlen(s) + 1; - char *ret = OPENSSL_malloc(len); - if (ret == NULL) { - return NULL; - } - OPENSSL_memcpy(ret, s, len); - return ret; -} - -int OPENSSL_tolower(int c) { - if (c >= 'A' && c <= 'Z') { - return c + ('a' - 'A'); - } - return c; -} - -int OPENSSL_strcasecmp(const char *a, const char *b) { - for (size_t i = 0;; i++) { - const int aa = OPENSSL_tolower(a[i]); - const int bb = OPENSSL_tolower(b[i]); - - if (aa < bb) { - return -1; - } else if (aa > bb) { - return 1; - } else if (aa == 0) { - return 0; - } - } -} - -int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) { - for (size_t i = 0; i < n; i++) { - const int aa = OPENSSL_tolower(a[i]); - const int bb = OPENSSL_tolower(b[i]); - - if (aa < bb) { - return -1; - } else if (aa > bb) { - return 1; - } else if (aa == 0) { - return 0; - } - } - - return 0; -} - -int BIO_snprintf(char *buf, size_t n, const char *format, ...) { - va_list args; - va_start(args, format); - int ret = BIO_vsnprintf(buf, n, format, args); - va_end(args); - return ret; -} - -int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) { - return vsnprintf(buf, n, format, args); -} diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_info.c b/Pods/BoringSSL-GRPC/crypto/pem/pem_info.c deleted file mode 100644 index 1a306a820..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_info.c +++ /dev/null @@ -1,379 +0,0 @@ -/* crypto/pem/pem_info.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef OPENSSL_NO_FP_API -STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u) -{ - BIO *b; - STACK_OF(X509_INFO) *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); - } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_X509_INFO_read_bio(b, sk, cb, u); - BIO_free(b); - return (ret); -} -#endif - -STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u) -{ - X509_INFO *xi = NULL; - char *name = NULL, *header = NULL; - void *pp; - unsigned char *data = NULL; - const unsigned char *p; - long len, error = 0; - int ok = 0; - STACK_OF(X509_INFO) *ret = NULL; - unsigned int i, raw, ptype; - d2i_of_void *d2i = 0; - - if (sk == NULL) { - if ((ret = sk_X509_INFO_new_null()) == NULL) { - OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); - goto err; - } - } else - ret = sk; - - if ((xi = X509_INFO_new()) == NULL) - goto err; - for (;;) { - raw = 0; - ptype = 0; - i = PEM_read_bio(bp, &name, &header, &data, &len); - if (i == 0) { - error = ERR_GET_REASON(ERR_peek_last_error()); - if (error == PEM_R_NO_START_LINE) { - ERR_clear_error(); - break; - } - goto err; - } - start: - if ((strcmp(name, PEM_STRING_X509) == 0) || - (strcmp(name, PEM_STRING_X509_OLD) == 0)) { - d2i = (D2I_OF(void)) d2i_X509; - if (xi->x509 != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - pp = &(xi->x509); - } else if ((strcmp(name, PEM_STRING_X509_TRUSTED) == 0)) { - d2i = (D2I_OF(void)) d2i_X509_AUX; - if (xi->x509 != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - pp = &(xi->x509); - } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) { - d2i = (D2I_OF(void)) d2i_X509_CRL; - if (xi->crl != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - pp = &(xi->crl); - } else if (strcmp(name, PEM_STRING_RSA) == 0) { - d2i = (D2I_OF(void)) d2i_RSAPrivateKey; - if (xi->x_pkey != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - - xi->enc_data = NULL; - xi->enc_len = 0; - - xi->x_pkey = X509_PKEY_new(); - ptype = EVP_PKEY_RSA; - pp = &xi->x_pkey->dec_pkey; - if ((int)strlen(header) > 10) /* assume encrypted */ - raw = 1; - } else -#ifndef OPENSSL_NO_DSA - if (strcmp(name, PEM_STRING_DSA) == 0) { - d2i = (D2I_OF(void)) d2i_DSAPrivateKey; - if (xi->x_pkey != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - - xi->enc_data = NULL; - xi->enc_len = 0; - - xi->x_pkey = X509_PKEY_new(); - ptype = EVP_PKEY_DSA; - pp = &xi->x_pkey->dec_pkey; - if ((int)strlen(header) > 10) /* assume encrypted */ - raw = 1; - } else -#endif - if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) { - d2i = (D2I_OF(void)) d2i_ECPrivateKey; - if (xi->x_pkey != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - - xi->enc_data = NULL; - xi->enc_len = 0; - - xi->x_pkey = X509_PKEY_new(); - ptype = EVP_PKEY_EC; - pp = &xi->x_pkey->dec_pkey; - if ((int)strlen(header) > 10) /* assume encrypted */ - raw = 1; - } else { - d2i = NULL; - pp = NULL; - } - - if (d2i != NULL) { - if (!raw) { - EVP_CIPHER_INFO cipher; - - if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) - goto err; - if (!PEM_do_header(&cipher, data, &len, cb, u)) - goto err; - p = data; - if (ptype) { - if (!d2i_PrivateKey(ptype, pp, &p, len)) { - OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); - goto err; - } - } else if (d2i(pp, &p, len) == NULL) { - OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); - goto err; - } - } else { /* encrypted RSA data */ - if (!PEM_get_EVP_CIPHER_INFO(header, &xi->enc_cipher)) - goto err; - xi->enc_data = (char *)data; - xi->enc_len = (int)len; - data = NULL; - } - } else { - /* unknown */ - } - if (name != NULL) - OPENSSL_free(name); - if (header != NULL) - OPENSSL_free(header); - if (data != NULL) - OPENSSL_free(data); - name = NULL; - header = NULL; - data = NULL; - } - - /* - * if the last one hasn't been pushed yet and there is anything in it - * then add it to the stack ... - */ - if ((xi->x509 != NULL) || (xi->crl != NULL) || - (xi->x_pkey != NULL) || (xi->enc_data != NULL)) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - xi = NULL; - } - ok = 1; - err: - if (xi != NULL) - X509_INFO_free(xi); - if (!ok) { - for (i = 0; i < sk_X509_INFO_num(ret); i++) { - xi = sk_X509_INFO_value(ret, i); - X509_INFO_free(xi); - } - if (ret != sk) - sk_X509_INFO_free(ret); - ret = NULL; - } - - if (name != NULL) - OPENSSL_free(name); - if (header != NULL) - OPENSSL_free(header); - if (data != NULL) - OPENSSL_free(data); - return (ret); -} - -/* A TJH addition */ -int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, - unsigned char *kstr, int klen, - pem_password_cb *cb, void *u) -{ - int i, ret = 0; - unsigned char *data = NULL; - const char *objstr = NULL; - char buf[PEM_BUFSIZE]; - unsigned char *iv = NULL; - unsigned iv_len = 0; - - if (enc != NULL) { - iv_len = EVP_CIPHER_iv_length(enc); - objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL) { - OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); - goto err; - } - } - - /* - * now for the fun part ... if we have a private key then we have to be - * able to handle a not-yet-decrypted key being written out correctly ... - * if it is decrypted or it is non-encrypted then we use the base code - */ - if (xi->x_pkey != NULL) { - if ((xi->enc_data != NULL) && (xi->enc_len > 0)) { - if (enc == NULL) { - OPENSSL_PUT_ERROR(PEM, PEM_R_CIPHER_IS_NULL); - goto err; - } - - /* copy from weirdo names into more normal things */ - iv = xi->enc_cipher.iv; - data = (unsigned char *)xi->enc_data; - i = xi->enc_len; - - /* - * we take the encryption data from the internal stuff rather - * than what the user has passed us ... as we have to match - * exactly for some strange reason - */ - objstr = OBJ_nid2sn(EVP_CIPHER_nid(xi->enc_cipher.cipher)); - if (objstr == NULL) { - OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); - goto err; - } - - /* create the right magic header stuff */ - assert(strlen(objstr) + 23 + 2 * iv_len + 13 <= sizeof buf); - buf[0] = '\0'; - PEM_proc_type(buf, PEM_TYPE_ENCRYPTED); - PEM_dek_info(buf, objstr, iv_len, (char *)iv); - - /* use the normal code to write things out */ - i = PEM_write_bio(bp, PEM_STRING_RSA, buf, data, i); - if (i <= 0) - goto err; - } else { - /* Add DSA/DH */ - /* normal optionally encrypted stuff */ - if (PEM_write_bio_RSAPrivateKey(bp, - xi->x_pkey->dec_pkey->pkey.rsa, - enc, kstr, klen, cb, u) <= 0) - goto err; - } - } - - /* if we have a certificate then write it out now */ - if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp, xi->x509) <= 0)) - goto err; - - /* - * we are ignoring anything else that is loaded into the X509_INFO - * structure for the moment ... as I don't need it so I'm not coding it - * here and Eric can do it when this makes it into the base library --tjh - */ - - ret = 1; - -err: - OPENSSL_cleanse(buf, PEM_BUFSIZE); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_info.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/pem/pem_info.c.grpc_back deleted file mode 100644 index d707e426b..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_info.c.grpc_back +++ /dev/null @@ -1,379 +0,0 @@ -/* crypto/pem/pem_info.c */ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef OPENSSL_NO_FP_API -STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u) -{ - BIO *b; - STACK_OF(X509_INFO) *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { - OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); - } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_X509_INFO_read_bio(b, sk, cb, u); - BIO_free(b); - return (ret); -} -#endif - -STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, - pem_password_cb *cb, void *u) -{ - X509_INFO *xi = NULL; - char *name = NULL, *header = NULL; - void *pp; - unsigned char *data = NULL; - const unsigned char *p; - long len, error = 0; - int ok = 0; - STACK_OF(X509_INFO) *ret = NULL; - unsigned int i, raw, ptype; - d2i_of_void *d2i = 0; - - if (sk == NULL) { - if ((ret = sk_X509_INFO_new_null()) == NULL) { - OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); - goto err; - } - } else - ret = sk; - - if ((xi = X509_INFO_new()) == NULL) - goto err; - for (;;) { - raw = 0; - ptype = 0; - i = PEM_read_bio(bp, &name, &header, &data, &len); - if (i == 0) { - error = ERR_GET_REASON(ERR_peek_last_error()); - if (error == PEM_R_NO_START_LINE) { - ERR_clear_error(); - break; - } - goto err; - } - start: - if ((strcmp(name, PEM_STRING_X509) == 0) || - (strcmp(name, PEM_STRING_X509_OLD) == 0)) { - d2i = (D2I_OF(void)) d2i_X509; - if (xi->x509 != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - pp = &(xi->x509); - } else if ((strcmp(name, PEM_STRING_X509_TRUSTED) == 0)) { - d2i = (D2I_OF(void)) d2i_X509_AUX; - if (xi->x509 != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - pp = &(xi->x509); - } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) { - d2i = (D2I_OF(void)) d2i_X509_CRL; - if (xi->crl != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - pp = &(xi->crl); - } else if (strcmp(name, PEM_STRING_RSA) == 0) { - d2i = (D2I_OF(void)) d2i_RSAPrivateKey; - if (xi->x_pkey != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - - xi->enc_data = NULL; - xi->enc_len = 0; - - xi->x_pkey = X509_PKEY_new(); - ptype = EVP_PKEY_RSA; - pp = &xi->x_pkey->dec_pkey; - if ((int)strlen(header) > 10) /* assume encrypted */ - raw = 1; - } else -#ifndef OPENSSL_NO_DSA - if (strcmp(name, PEM_STRING_DSA) == 0) { - d2i = (D2I_OF(void)) d2i_DSAPrivateKey; - if (xi->x_pkey != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - - xi->enc_data = NULL; - xi->enc_len = 0; - - xi->x_pkey = X509_PKEY_new(); - ptype = EVP_PKEY_DSA; - pp = &xi->x_pkey->dec_pkey; - if ((int)strlen(header) > 10) /* assume encrypted */ - raw = 1; - } else -#endif - if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) { - d2i = (D2I_OF(void)) d2i_ECPrivateKey; - if (xi->x_pkey != NULL) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - if ((xi = X509_INFO_new()) == NULL) - goto err; - goto start; - } - - xi->enc_data = NULL; - xi->enc_len = 0; - - xi->x_pkey = X509_PKEY_new(); - ptype = EVP_PKEY_EC; - pp = &xi->x_pkey->dec_pkey; - if ((int)strlen(header) > 10) /* assume encrypted */ - raw = 1; - } else { - d2i = NULL; - pp = NULL; - } - - if (d2i != NULL) { - if (!raw) { - EVP_CIPHER_INFO cipher; - - if (!PEM_get_EVP_CIPHER_INFO(header, &cipher)) - goto err; - if (!PEM_do_header(&cipher, data, &len, cb, u)) - goto err; - p = data; - if (ptype) { - if (!d2i_PrivateKey(ptype, pp, &p, len)) { - OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); - goto err; - } - } else if (d2i(pp, &p, len) == NULL) { - OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); - goto err; - } - } else { /* encrypted RSA data */ - if (!PEM_get_EVP_CIPHER_INFO(header, &xi->enc_cipher)) - goto err; - xi->enc_data = (char *)data; - xi->enc_len = (int)len; - data = NULL; - } - } else { - /* unknown */ - } - if (name != NULL) - OPENSSL_free(name); - if (header != NULL) - OPENSSL_free(header); - if (data != NULL) - OPENSSL_free(data); - name = NULL; - header = NULL; - data = NULL; - } - - /* - * if the last one hasn't been pushed yet and there is anything in it - * then add it to the stack ... - */ - if ((xi->x509 != NULL) || (xi->crl != NULL) || - (xi->x_pkey != NULL) || (xi->enc_data != NULL)) { - if (!sk_X509_INFO_push(ret, xi)) - goto err; - xi = NULL; - } - ok = 1; - err: - if (xi != NULL) - X509_INFO_free(xi); - if (!ok) { - for (i = 0; i < sk_X509_INFO_num(ret); i++) { - xi = sk_X509_INFO_value(ret, i); - X509_INFO_free(xi); - } - if (ret != sk) - sk_X509_INFO_free(ret); - ret = NULL; - } - - if (name != NULL) - OPENSSL_free(name); - if (header != NULL) - OPENSSL_free(header); - if (data != NULL) - OPENSSL_free(data); - return (ret); -} - -/* A TJH addition */ -int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, - unsigned char *kstr, int klen, - pem_password_cb *cb, void *u) -{ - int i, ret = 0; - unsigned char *data = NULL; - const char *objstr = NULL; - char buf[PEM_BUFSIZE]; - unsigned char *iv = NULL; - unsigned iv_len = 0; - - if (enc != NULL) { - iv_len = EVP_CIPHER_iv_length(enc); - objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL) { - OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); - goto err; - } - } - - /* - * now for the fun part ... if we have a private key then we have to be - * able to handle a not-yet-decrypted key being written out correctly ... - * if it is decrypted or it is non-encrypted then we use the base code - */ - if (xi->x_pkey != NULL) { - if ((xi->enc_data != NULL) && (xi->enc_len > 0)) { - if (enc == NULL) { - OPENSSL_PUT_ERROR(PEM, PEM_R_CIPHER_IS_NULL); - goto err; - } - - /* copy from weirdo names into more normal things */ - iv = xi->enc_cipher.iv; - data = (unsigned char *)xi->enc_data; - i = xi->enc_len; - - /* - * we take the encryption data from the internal stuff rather - * than what the user has passed us ... as we have to match - * exactly for some strange reason - */ - objstr = OBJ_nid2sn(EVP_CIPHER_nid(xi->enc_cipher.cipher)); - if (objstr == NULL) { - OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); - goto err; - } - - /* create the right magic header stuff */ - assert(strlen(objstr) + 23 + 2 * iv_len + 13 <= sizeof buf); - buf[0] = '\0'; - PEM_proc_type(buf, PEM_TYPE_ENCRYPTED); - PEM_dek_info(buf, objstr, iv_len, (char *)iv); - - /* use the normal code to write things out */ - i = PEM_write_bio(bp, PEM_STRING_RSA, buf, data, i); - if (i <= 0) - goto err; - } else { - /* Add DSA/DH */ - /* normal optionally encrypted stuff */ - if (PEM_write_bio_RSAPrivateKey(bp, - xi->x_pkey->dec_pkey->pkey.rsa, - enc, kstr, klen, cb, u) <= 0) - goto err; - } - } - - /* if we have a certificate then write it out now */ - if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp, xi->x509) <= 0)) - goto err; - - /* - * we are ignoring anything else that is loaded into the X509_INFO - * structure for the moment ... as I don't need it so I'm not coding it - * here and Eric can do it when this makes it into the base library --tjh - */ - - ret = 1; - -err: - OPENSSL_cleanse(buf, PEM_BUFSIZE); - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7_x509.c b/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7_x509.c deleted file mode 100644 index bcc8da204..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7_x509.c +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" - - -int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs) { - int ret = 0; - const size_t initial_certs_len = sk_X509_num(out_certs); - STACK_OF(CRYPTO_BUFFER) *raw = sk_CRYPTO_BUFFER_new_null(); - if (raw == NULL || - !PKCS7_get_raw_certificates(raw, cbs, NULL)) { - goto err; - } - - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(raw); i++) { - CRYPTO_BUFFER *buf = sk_CRYPTO_BUFFER_value(raw, i); - X509 *x509 = X509_parse_from_buffer(buf); - if (x509 == NULL || - !sk_X509_push(out_certs, x509)) { - X509_free(x509); - goto err; - } - } - - ret = 1; - -err: - sk_CRYPTO_BUFFER_pop_free(raw, CRYPTO_BUFFER_free); - if (!ret) { - while (sk_X509_num(out_certs) != initial_certs_len) { - X509 *x509 = sk_X509_pop(out_certs); - X509_free(x509); - } - } - - return ret; -} - -int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs) { - CBS signed_data, crls; - uint8_t *der_bytes = NULL; - int ret = 0; - const size_t initial_crls_len = sk_X509_CRL_num(out_crls); - - if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs)) { - return 0; - } - - // See https://tools.ietf.org/html/rfc2315#section-9.1 - - // Even if only CRLs are included, there may be an empty certificates block. - // OpenSSL does this, for example. - if (CBS_peek_asn1_tag(&signed_data, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) && - !CBS_get_asn1(&signed_data, NULL /* certificates */, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - goto err; - } - - if (!CBS_get_asn1(&signed_data, &crls, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { - OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_NO_CRLS_INCLUDED); - goto err; - } - - while (CBS_len(&crls) > 0) { - CBS crl_data; - X509_CRL *crl; - const uint8_t *inp; - - if (!CBS_get_asn1_element(&crls, &crl_data, CBS_ASN1_SEQUENCE)) { - goto err; - } - - if (CBS_len(&crl_data) > LONG_MAX) { - goto err; - } - inp = CBS_data(&crl_data); - crl = d2i_X509_CRL(NULL, &inp, (long)CBS_len(&crl_data)); - if (!crl) { - goto err; - } - - assert(inp == CBS_data(&crl_data) + CBS_len(&crl_data)); - - if (sk_X509_CRL_push(out_crls, crl) == 0) { - X509_CRL_free(crl); - goto err; - } - } - - ret = 1; - -err: - OPENSSL_free(der_bytes); - - if (!ret) { - while (sk_X509_CRL_num(out_crls) != initial_crls_len) { - X509_CRL_free(sk_X509_CRL_pop(out_crls)); - } - } - - return ret; -} - -int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, BIO *pem_bio) { - uint8_t *data; - long len; - int ret; - - // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM - // internally will actually allow several other values too, including - // "CERTIFICATE". - if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, - PEM_STRING_PKCS7, pem_bio, - NULL /* password callback */, - NULL /* password callback argument */)) { - return 0; - } - - CBS cbs; - CBS_init(&cbs, data, len); - ret = PKCS7_get_certificates(out_certs, &cbs); - OPENSSL_free(data); - return ret; -} - -int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, BIO *pem_bio) { - uint8_t *data; - long len; - int ret; - - // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM - // internally will actually allow several other values too, including - // "CERTIFICATE". - if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, - PEM_STRING_PKCS7, pem_bio, - NULL /* password callback */, - NULL /* password callback argument */)) { - return 0; - } - - CBS cbs; - CBS_init(&cbs, data, len); - ret = PKCS7_get_CRLs(out_crls, &cbs); - OPENSSL_free(data); - return ret; -} - -static int pkcs7_bundle_certificates_cb(CBB *out, const void *arg) { - const STACK_OF(X509) *certs = arg; - size_t i; - CBB certificates; - - // See https://tools.ietf.org/html/rfc2315#section-9.1 - if (!CBB_add_asn1(out, &certificates, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - return 0; - } - - for (i = 0; i < sk_X509_num(certs); i++) { - X509 *x509 = sk_X509_value(certs, i); - uint8_t *buf; - int len = i2d_X509(x509, NULL); - - if (len < 0 || - !CBB_add_space(&certificates, &buf, len) || - i2d_X509(x509, &buf) < 0) { - return 0; - } - } - - return CBB_flush(out); -} - -int PKCS7_bundle_certificates(CBB *out, const STACK_OF(X509) *certs) { - return pkcs7_bundle(out, pkcs7_bundle_certificates_cb, certs); -} - -static int pkcs7_bundle_crls_cb(CBB *out, const void *arg) { - const STACK_OF(X509_CRL) *crls = arg; - size_t i; - CBB crl_data; - - // See https://tools.ietf.org/html/rfc2315#section-9.1 - if (!CBB_add_asn1(out, &crl_data, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { - return 0; - } - - for (i = 0; i < sk_X509_CRL_num(crls); i++) { - X509_CRL *crl = sk_X509_CRL_value(crls, i); - uint8_t *buf; - int len = i2d_X509_CRL(crl, NULL); - - if (len < 0 || - !CBB_add_space(&crl_data, &buf, len) || - i2d_X509_CRL(crl, &buf) < 0) { - return 0; - } - } - - return CBB_flush(out); -} - -int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls) { - return pkcs7_bundle(out, pkcs7_bundle_crls_cb, crls); -} diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7_x509.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7_x509.c.grpc_back deleted file mode 100644 index 7bc39d27d..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7_x509.c.grpc_back +++ /dev/null @@ -1,233 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" - - -int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs) { - int ret = 0; - const size_t initial_certs_len = sk_X509_num(out_certs); - STACK_OF(CRYPTO_BUFFER) *raw = sk_CRYPTO_BUFFER_new_null(); - if (raw == NULL || - !PKCS7_get_raw_certificates(raw, cbs, NULL)) { - goto err; - } - - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(raw); i++) { - CRYPTO_BUFFER *buf = sk_CRYPTO_BUFFER_value(raw, i); - X509 *x509 = X509_parse_from_buffer(buf); - if (x509 == NULL || - !sk_X509_push(out_certs, x509)) { - X509_free(x509); - goto err; - } - } - - ret = 1; - -err: - sk_CRYPTO_BUFFER_pop_free(raw, CRYPTO_BUFFER_free); - if (!ret) { - while (sk_X509_num(out_certs) != initial_certs_len) { - X509 *x509 = sk_X509_pop(out_certs); - X509_free(x509); - } - } - - return ret; -} - -int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs) { - CBS signed_data, crls; - uint8_t *der_bytes = NULL; - int ret = 0; - const size_t initial_crls_len = sk_X509_CRL_num(out_crls); - - if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs)) { - return 0; - } - - // See https://tools.ietf.org/html/rfc2315#section-9.1 - - // Even if only CRLs are included, there may be an empty certificates block. - // OpenSSL does this, for example. - if (CBS_peek_asn1_tag(&signed_data, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) && - !CBS_get_asn1(&signed_data, NULL /* certificates */, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - goto err; - } - - if (!CBS_get_asn1(&signed_data, &crls, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { - OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_NO_CRLS_INCLUDED); - goto err; - } - - while (CBS_len(&crls) > 0) { - CBS crl_data; - X509_CRL *crl; - const uint8_t *inp; - - if (!CBS_get_asn1_element(&crls, &crl_data, CBS_ASN1_SEQUENCE)) { - goto err; - } - - if (CBS_len(&crl_data) > LONG_MAX) { - goto err; - } - inp = CBS_data(&crl_data); - crl = d2i_X509_CRL(NULL, &inp, (long)CBS_len(&crl_data)); - if (!crl) { - goto err; - } - - assert(inp == CBS_data(&crl_data) + CBS_len(&crl_data)); - - if (sk_X509_CRL_push(out_crls, crl) == 0) { - X509_CRL_free(crl); - goto err; - } - } - - ret = 1; - -err: - OPENSSL_free(der_bytes); - - if (!ret) { - while (sk_X509_CRL_num(out_crls) != initial_crls_len) { - X509_CRL_free(sk_X509_CRL_pop(out_crls)); - } - } - - return ret; -} - -int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, BIO *pem_bio) { - uint8_t *data; - long len; - int ret; - - // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM - // internally will actually allow several other values too, including - // "CERTIFICATE". - if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, - PEM_STRING_PKCS7, pem_bio, - NULL /* password callback */, - NULL /* password callback argument */)) { - return 0; - } - - CBS cbs; - CBS_init(&cbs, data, len); - ret = PKCS7_get_certificates(out_certs, &cbs); - OPENSSL_free(data); - return ret; -} - -int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, BIO *pem_bio) { - uint8_t *data; - long len; - int ret; - - // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM - // internally will actually allow several other values too, including - // "CERTIFICATE". - if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, - PEM_STRING_PKCS7, pem_bio, - NULL /* password callback */, - NULL /* password callback argument */)) { - return 0; - } - - CBS cbs; - CBS_init(&cbs, data, len); - ret = PKCS7_get_CRLs(out_crls, &cbs); - OPENSSL_free(data); - return ret; -} - -static int pkcs7_bundle_certificates_cb(CBB *out, const void *arg) { - const STACK_OF(X509) *certs = arg; - size_t i; - CBB certificates; - - // See https://tools.ietf.org/html/rfc2315#section-9.1 - if (!CBB_add_asn1(out, &certificates, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - return 0; - } - - for (i = 0; i < sk_X509_num(certs); i++) { - X509 *x509 = sk_X509_value(certs, i); - uint8_t *buf; - int len = i2d_X509(x509, NULL); - - if (len < 0 || - !CBB_add_space(&certificates, &buf, len) || - i2d_X509(x509, &buf) < 0) { - return 0; - } - } - - return CBB_flush(out); -} - -int PKCS7_bundle_certificates(CBB *out, const STACK_OF(X509) *certs) { - return pkcs7_bundle(out, pkcs7_bundle_certificates_cb, certs); -} - -static int pkcs7_bundle_crls_cb(CBB *out, const void *arg) { - const STACK_OF(X509_CRL) *crls = arg; - size_t i; - CBB crl_data; - - // See https://tools.ietf.org/html/rfc2315#section-9.1 - if (!CBB_add_asn1(out, &crl_data, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { - return 0; - } - - for (i = 0; i < sk_X509_CRL_num(crls); i++) { - X509_CRL *crl = sk_X509_CRL_value(crls, i); - uint8_t *buf; - int len = i2d_X509_CRL(crl, NULL); - - if (len < 0 || - !CBB_add_space(&crl_data, &buf, len) || - i2d_X509_CRL(crl, &buf) < 0) { - return 0; - } - } - - return CBB_flush(out); -} - -int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls) { - return pkcs7_bundle(out, pkcs7_bundle_crls_cb, crls); -} diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/internal.h b/Pods/BoringSSL-GRPC/crypto/pkcs8/internal.h deleted file mode 100644 index 7ac57f70e..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/internal.h +++ /dev/null @@ -1,120 +0,0 @@ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#ifndef OPENSSL_HEADER_PKCS8_INTERNAL_H -#define OPENSSL_HEADER_PKCS8_INTERNAL_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// pkcs8_pbe_decrypt decrypts |in| using the PBE scheme described by -// |algorithm|, which should be a serialized AlgorithmIdentifier structure. On -// success, it sets |*out| to a newly-allocated buffer containing the decrypted -// result and returns one. Otherwise, it returns zero. -int pkcs8_pbe_decrypt(uint8_t **out, size_t *out_len, CBS *algorithm, - const char *pass, size_t pass_len, const uint8_t *in, - size_t in_len); - -#define PKCS12_KEY_ID 1 -#define PKCS12_IV_ID 2 -#define PKCS12_MAC_ID 3 - -// pkcs12_key_gen runs the PKCS#12 key derivation function as specified in -// RFC 7292, appendix B. On success, it writes the resulting |out_len| bytes of -// key material to |out| and returns one. Otherwise, it returns zero. |id| -// should be one of the |PKCS12_*_ID| values. -int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, - size_t salt_len, uint8_t id, unsigned iterations, - size_t out_len, uint8_t *out, const EVP_MD *md); - -struct pbe_suite { - int pbe_nid; - uint8_t oid[10]; - uint8_t oid_len; - const EVP_CIPHER *(*cipher_func)(void); - const EVP_MD *(*md_func)(void); - // decrypt_init initialize |ctx| for decrypting. The password is specified by - // |pass| and |pass_len|. |param| contains the serialized parameters field of - // the AlgorithmIdentifier. - // - // It returns one on success and zero on error. - int (*decrypt_init)(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, - const char *pass, size_t pass_len, CBS *param); -}; - -#define PKCS5_DEFAULT_ITERATIONS 2048 -#define PKCS5_SALT_LEN 8 - -int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, - const char *pass, size_t pass_len, CBS *param); - -// PKCS5_pbe2_encrypt_init configures |ctx| for encrypting with PKCS #5 PBES2, -// as defined in RFC 2998, with the specified parameters. It writes the -// corresponding AlgorithmIdentifier to |out|. -int PKCS5_pbe2_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, - const EVP_CIPHER *cipher, unsigned iterations, - const char *pass, size_t pass_len, - const uint8_t *salt, size_t salt_len); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_PKCS8_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/pkcs8/internal.h.grpc_back deleted file mode 100644 index 939948984..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/internal.h.grpc_back +++ /dev/null @@ -1,120 +0,0 @@ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#ifndef OPENSSL_HEADER_PKCS8_INTERNAL_H -#define OPENSSL_HEADER_PKCS8_INTERNAL_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// pkcs8_pbe_decrypt decrypts |in| using the PBE scheme described by -// |algorithm|, which should be a serialized AlgorithmIdentifier structure. On -// success, it sets |*out| to a newly-allocated buffer containing the decrypted -// result and returns one. Otherwise, it returns zero. -int pkcs8_pbe_decrypt(uint8_t **out, size_t *out_len, CBS *algorithm, - const char *pass, size_t pass_len, const uint8_t *in, - size_t in_len); - -#define PKCS12_KEY_ID 1 -#define PKCS12_IV_ID 2 -#define PKCS12_MAC_ID 3 - -// pkcs12_key_gen runs the PKCS#12 key derivation function as specified in -// RFC 7292, appendix B. On success, it writes the resulting |out_len| bytes of -// key material to |out| and returns one. Otherwise, it returns zero. |id| -// should be one of the |PKCS12_*_ID| values. -int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, - size_t salt_len, uint8_t id, unsigned iterations, - size_t out_len, uint8_t *out, const EVP_MD *md); - -struct pbe_suite { - int pbe_nid; - uint8_t oid[10]; - uint8_t oid_len; - const EVP_CIPHER *(*cipher_func)(void); - const EVP_MD *(*md_func)(void); - // decrypt_init initialize |ctx| for decrypting. The password is specified by - // |pass| and |pass_len|. |param| contains the serialized parameters field of - // the AlgorithmIdentifier. - // - // It returns one on success and zero on error. - int (*decrypt_init)(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, - const char *pass, size_t pass_len, CBS *param); -}; - -#define PKCS5_DEFAULT_ITERATIONS 2048 -#define PKCS5_SALT_LEN 8 - -int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, - const char *pass, size_t pass_len, CBS *param); - -// PKCS5_pbe2_encrypt_init configures |ctx| for encrypting with PKCS #5 PBES2, -// as defined in RFC 2998, with the specified parameters. It writes the -// corresponding AlgorithmIdentifier to |out|. -int PKCS5_pbe2_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, - const EVP_CIPHER *cipher, unsigned iterations, - const char *pass, size_t pass_len, - const uint8_t *salt, size_t salt_len); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_PKCS8_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8_x509.c b/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8_x509.c deleted file mode 100644 index ffcd914a0..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8_x509.c +++ /dev/null @@ -1,789 +0,0 @@ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../bytestring/internal.h" -#include "../internal.h" - - -// Minor tweak to operation: zero private key data -static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, - void *exarg) { - // Since the structure must still be valid use ASN1_OP_FREE_PRE - if (operation == ASN1_OP_FREE_PRE) { - PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; - if (key->pkey && key->pkey->type == V_ASN1_OCTET_STRING && - key->pkey->value.octet_string) { - OPENSSL_cleanse(key->pkey->value.octet_string->data, - key->pkey->value.octet_string->length); - } - } - return 1; -} - -ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb) = { - ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER), - ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR), - ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY), - ASN1_IMP_SET_OF_OPT(PKCS8_PRIV_KEY_INFO, attributes, X509_ATTRIBUTE, 0) -} ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) - -IMPLEMENT_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) - -EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) { - uint8_t *der = NULL; - int der_len = i2d_PKCS8_PRIV_KEY_INFO(p8, &der); - if (der_len < 0) { - return NULL; - } - - CBS cbs; - CBS_init(&cbs, der, (size_t)der_len); - EVP_PKEY *ret = EVP_parse_private_key(&cbs); - if (ret == NULL || CBS_len(&cbs) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); - EVP_PKEY_free(ret); - OPENSSL_free(der); - return NULL; - } - - OPENSSL_free(der); - return ret; -} - -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) { - CBB cbb; - uint8_t *der = NULL; - size_t der_len; - if (!CBB_init(&cbb, 0) || - !EVP_marshal_private_key(&cbb, pkey) || - !CBB_finish(&cbb, &der, &der_len) || - der_len > LONG_MAX) { - CBB_cleanup(&cbb); - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_ENCODE_ERROR); - goto err; - } - - const uint8_t *p = der; - PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, (long)der_len); - if (p8 == NULL || p != der + der_len) { - PKCS8_PRIV_KEY_INFO_free(p8); - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); - goto err; - } - - OPENSSL_free(der); - return p8; - -err: - OPENSSL_free(der); - return NULL; -} - -PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8, const char *pass, - int pass_len_in) { - size_t pass_len; - if (pass_len_in == -1 && pass != NULL) { - pass_len = strlen(pass); - } else { - pass_len = (size_t)pass_len_in; - } - - PKCS8_PRIV_KEY_INFO *ret = NULL; - EVP_PKEY *pkey = NULL; - uint8_t *in = NULL; - - // Convert the legacy ASN.1 object to a byte string. - int in_len = i2d_X509_SIG(pkcs8, &in); - if (in_len < 0) { - goto err; - } - - CBS cbs; - CBS_init(&cbs, in, in_len); - pkey = PKCS8_parse_encrypted_private_key(&cbs, pass, pass_len); - if (pkey == NULL || CBS_len(&cbs) != 0) { - goto err; - } - - ret = EVP_PKEY2PKCS8(pkey); - -err: - OPENSSL_free(in); - EVP_PKEY_free(pkey); - return ret; -} - -X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, - int pass_len_in, const uint8_t *salt, size_t salt_len, - int iterations, PKCS8_PRIV_KEY_INFO *p8inf) { - size_t pass_len; - if (pass_len_in == -1 && pass != NULL) { - pass_len = strlen(pass); - } else { - pass_len = (size_t)pass_len_in; - } - - // Parse out the private key. - EVP_PKEY *pkey = EVP_PKCS82PKEY(p8inf); - if (pkey == NULL) { - return NULL; - } - - X509_SIG *ret = NULL; - uint8_t *der = NULL; - size_t der_len; - CBB cbb; - if (!CBB_init(&cbb, 128) || - !PKCS8_marshal_encrypted_private_key(&cbb, pbe_nid, cipher, pass, - pass_len, salt, salt_len, iterations, - pkey) || - !CBB_finish(&cbb, &der, &der_len)) { - CBB_cleanup(&cbb); - goto err; - } - - // Convert back to legacy ASN.1 objects. - const uint8_t *ptr = der; - ret = d2i_X509_SIG(NULL, &ptr, der_len); - if (ret == NULL || ptr != der + der_len) { - OPENSSL_PUT_ERROR(PKCS8, ERR_R_INTERNAL_ERROR); - X509_SIG_free(ret); - ret = NULL; - } - -err: - OPENSSL_free(der); - EVP_PKEY_free(pkey); - return ret; -} - -struct pkcs12_context { - EVP_PKEY **out_key; - STACK_OF(X509) *out_certs; - const char *password; - size_t password_len; -}; - -// PKCS12_handle_sequence parses a BER-encoded SEQUENCE of elements in a PKCS#12 -// structure. -static int PKCS12_handle_sequence( - CBS *sequence, struct pkcs12_context *ctx, - int (*handle_element)(CBS *cbs, struct pkcs12_context *ctx)) { - uint8_t *der_bytes = NULL; - size_t der_len; - CBS in; - int ret = 0; - - // Although a BER->DER conversion is done at the beginning of |PKCS12_parse|, - // the ASN.1 data gets wrapped in OCTETSTRINGs and/or encrypted and the - // conversion cannot see through those wrappings. So each time we step - // through one we need to convert to DER again. - if (!CBS_asn1_ber_to_der(sequence, &der_bytes, &der_len)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - if (der_bytes != NULL) { - CBS_init(&in, der_bytes, der_len); - } else { - CBS_init(&in, CBS_data(sequence), CBS_len(sequence)); - } - - CBS child; - if (!CBS_get_asn1(&in, &child, CBS_ASN1_SEQUENCE) || - CBS_len(&in) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - while (CBS_len(&child) > 0) { - CBS element; - if (!CBS_get_asn1(&child, &element, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (!handle_element(&element, ctx)) { - goto err; - } - } - - ret = 1; - -err: - OPENSSL_free(der_bytes); - return ret; -} - -// 1.2.840.113549.1.12.10.1.2 -static const uint8_t kPKCS8ShroudedKeyBag[] = { - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02}; - -// 1.2.840.113549.1.12.10.1.3 -static const uint8_t kCertBag[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, - 0x01, 0x0c, 0x0a, 0x01, 0x03}; - -// 1.2.840.113549.1.9.22.1 -static const uint8_t kX509Certificate[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x09, 0x16, 0x01}; - -// PKCS12_handle_safe_bag parses a single SafeBag element in a PKCS#12 -// structure. -static int PKCS12_handle_safe_bag(CBS *safe_bag, struct pkcs12_context *ctx) { - CBS bag_id, wrapped_value; - if (!CBS_get_asn1(safe_bag, &bag_id, CBS_ASN1_OBJECT) || - !CBS_get_asn1(safe_bag, &wrapped_value, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) - /* Ignore the bagAttributes field. */) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - if (CBS_mem_equal(&bag_id, kPKCS8ShroudedKeyBag, - sizeof(kPKCS8ShroudedKeyBag))) { - // See RFC 7292, section 4.2.2. - if (*ctx->out_key) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MULTIPLE_PRIVATE_KEYS_IN_PKCS12); - return 0; - } - - EVP_PKEY *pkey = PKCS8_parse_encrypted_private_key( - &wrapped_value, ctx->password, ctx->password_len); - if (pkey == NULL) { - return 0; - } - - if (CBS_len(&wrapped_value) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - EVP_PKEY_free(pkey); - return 0; - } - - *ctx->out_key = pkey; - return 1; - } - - if (CBS_mem_equal(&bag_id, kCertBag, sizeof(kCertBag))) { - // See RFC 7292, section 4.2.3. - CBS cert_bag, cert_type, wrapped_cert, cert; - if (!CBS_get_asn1(&wrapped_value, &cert_bag, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&cert_bag, &cert_type, CBS_ASN1_OBJECT) || - !CBS_get_asn1(&cert_bag, &wrapped_cert, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || - !CBS_get_asn1(&wrapped_cert, &cert, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - // Skip unknown certificate types. - if (!CBS_mem_equal(&cert_type, kX509Certificate, - sizeof(kX509Certificate))) { - return 1; - } - - if (CBS_len(&cert) > LONG_MAX) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - const uint8_t *inp = CBS_data(&cert); - X509 *x509 = d2i_X509(NULL, &inp, (long)CBS_len(&cert)); - if (!x509) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - if (inp != CBS_data(&cert) + CBS_len(&cert)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - X509_free(x509); - return 0; - } - - if (0 == sk_X509_push(ctx->out_certs, x509)) { - X509_free(x509); - return 0; - } - - return 1; - } - - // Unknown element type - ignore it. - return 1; -} - -// 1.2.840.113549.1.7.1 -static const uint8_t kPKCS7Data[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x07, 0x01}; - -// 1.2.840.113549.1.7.6 -static const uint8_t kPKCS7EncryptedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x07, 0x06}; - -// PKCS12_handle_content_info parses a single PKCS#7 ContentInfo element in a -// PKCS#12 structure. -static int PKCS12_handle_content_info(CBS *content_info, - struct pkcs12_context *ctx) { - CBS content_type, wrapped_contents, contents; - int ret = 0; - uint8_t *storage = NULL; - - if (!CBS_get_asn1(content_info, &content_type, CBS_ASN1_OBJECT) || - !CBS_get_asn1(content_info, &wrapped_contents, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || - CBS_len(content_info) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (CBS_mem_equal(&content_type, kPKCS7EncryptedData, - sizeof(kPKCS7EncryptedData))) { - // See https://tools.ietf.org/html/rfc2315#section-13. - // - // PKCS#7 encrypted data inside a PKCS#12 structure is generally an - // encrypted certificate bag and it's generally encrypted with 40-bit - // RC2-CBC. - CBS version_bytes, eci, contents_type, ai, encrypted_contents; - uint8_t *out; - size_t out_len; - - if (!CBS_get_asn1(&wrapped_contents, &contents, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&contents, &version_bytes, CBS_ASN1_INTEGER) || - // EncryptedContentInfo, see - // https://tools.ietf.org/html/rfc2315#section-10.1 - !CBS_get_asn1(&contents, &eci, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&eci, &contents_type, CBS_ASN1_OBJECT) || - // AlgorithmIdentifier, see - // https://tools.ietf.org/html/rfc5280#section-4.1.1.2 - !CBS_get_asn1(&eci, &ai, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1_implicit_string( - &eci, &encrypted_contents, &storage, - CBS_ASN1_CONTEXT_SPECIFIC | 0, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (!CBS_mem_equal(&contents_type, kPKCS7Data, sizeof(kPKCS7Data))) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (!pkcs8_pbe_decrypt(&out, &out_len, &ai, ctx->password, - ctx->password_len, CBS_data(&encrypted_contents), - CBS_len(&encrypted_contents))) { - goto err; - } - - CBS safe_contents; - CBS_init(&safe_contents, out, out_len); - ret = PKCS12_handle_sequence(&safe_contents, ctx, PKCS12_handle_safe_bag); - OPENSSL_free(out); - } else if (CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { - CBS octet_string_contents; - - if (!CBS_get_asn1(&wrapped_contents, &octet_string_contents, - CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - ret = PKCS12_handle_sequence(&octet_string_contents, ctx, - PKCS12_handle_safe_bag); - } else { - // Unknown element type - ignore it. - ret = 1; - } - -err: - OPENSSL_free(storage); - return ret; -} - -int PKCS12_get_key_and_certs(EVP_PKEY **out_key, STACK_OF(X509) *out_certs, - CBS *ber_in, const char *password) { - uint8_t *der_bytes = NULL; - size_t der_len; - CBS in, pfx, mac_data, authsafe, content_type, wrapped_authsafes, authsafes; - uint64_t version; - int ret = 0; - struct pkcs12_context ctx; - const size_t original_out_certs_len = sk_X509_num(out_certs); - - // The input may be in BER format. - if (!CBS_asn1_ber_to_der(ber_in, &der_bytes, &der_len)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - if (der_bytes != NULL) { - CBS_init(&in, der_bytes, der_len); - } else { - CBS_init(&in, CBS_data(ber_in), CBS_len(ber_in)); - } - - *out_key = NULL; - OPENSSL_memset(&ctx, 0, sizeof(ctx)); - - // See ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1.pdf, section - // four. - if (!CBS_get_asn1(&in, &pfx, CBS_ASN1_SEQUENCE) || - CBS_len(&in) != 0 || - !CBS_get_asn1_uint64(&pfx, &version)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (version < 3) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_VERSION); - goto err; - } - - if (!CBS_get_asn1(&pfx, &authsafe, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (CBS_len(&pfx) == 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MISSING_MAC); - goto err; - } - - if (!CBS_get_asn1(&pfx, &mac_data, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - // authsafe is a PKCS#7 ContentInfo. See - // https://tools.ietf.org/html/rfc2315#section-7. - if (!CBS_get_asn1(&authsafe, &content_type, CBS_ASN1_OBJECT) || - !CBS_get_asn1(&authsafe, &wrapped_authsafes, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - // The content type can either be data or signedData. The latter indicates - // that it's signed by a public key, which isn't supported. - if (!CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED); - goto err; - } - - if (!CBS_get_asn1(&wrapped_authsafes, &authsafes, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - ctx.out_key = out_key; - ctx.out_certs = out_certs; - ctx.password = password; - ctx.password_len = password != NULL ? strlen(password) : 0; - - // Verify the MAC. - { - CBS mac, salt, expected_mac; - if (!CBS_get_asn1(&mac_data, &mac, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - const EVP_MD *md = EVP_parse_digest_algorithm(&mac); - if (md == NULL) { - goto err; - } - - if (!CBS_get_asn1(&mac, &expected_mac, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&mac_data, &salt, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - // The iteration count is optional and the default is one. - uint64_t iterations = 1; - if (CBS_len(&mac_data) > 0) { - if (!CBS_get_asn1_uint64(&mac_data, &iterations) || - iterations > UINT_MAX) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - } - - uint8_t hmac_key[EVP_MAX_MD_SIZE]; - if (!pkcs12_key_gen(ctx.password, ctx.password_len, CBS_data(&salt), - CBS_len(&salt), PKCS12_MAC_ID, iterations, - EVP_MD_size(md), hmac_key, md)) { - goto err; - } - - uint8_t hmac[EVP_MAX_MD_SIZE]; - unsigned hmac_len; - if (NULL == HMAC(md, hmac_key, EVP_MD_size(md), CBS_data(&authsafes), - CBS_len(&authsafes), hmac, &hmac_len)) { - goto err; - } - - if (!CBS_mem_equal(&expected_mac, hmac, hmac_len)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INCORRECT_PASSWORD); - goto err; - } - } - - // authsafes contains a series of PKCS#7 ContentInfos. - if (!PKCS12_handle_sequence(&authsafes, &ctx, PKCS12_handle_content_info)) { - goto err; - } - - ret = 1; - -err: - OPENSSL_free(der_bytes); - if (!ret) { - EVP_PKEY_free(*out_key); - *out_key = NULL; - while (sk_X509_num(out_certs) > original_out_certs_len) { - X509 *x509 = sk_X509_pop(out_certs); - X509_free(x509); - } - } - - return ret; -} - -void PKCS12_PBE_add(void) {} - -struct pkcs12_st { - uint8_t *ber_bytes; - size_t ber_len; -}; - -PKCS12 *d2i_PKCS12(PKCS12 **out_p12, const uint8_t **ber_bytes, - size_t ber_len) { - PKCS12 *p12; - - p12 = OPENSSL_malloc(sizeof(PKCS12)); - if (!p12) { - return NULL; - } - - p12->ber_bytes = OPENSSL_malloc(ber_len); - if (!p12->ber_bytes) { - OPENSSL_free(p12); - return NULL; - } - - OPENSSL_memcpy(p12->ber_bytes, *ber_bytes, ber_len); - p12->ber_len = ber_len; - *ber_bytes += ber_len; - - if (out_p12) { - PKCS12_free(*out_p12); - - *out_p12 = p12; - } - - return p12; -} - -PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12) { - size_t used = 0; - BUF_MEM *buf; - const uint8_t *dummy; - static const size_t kMaxSize = 256 * 1024; - PKCS12 *ret = NULL; - - buf = BUF_MEM_new(); - if (buf == NULL) { - return NULL; - } - if (BUF_MEM_grow(buf, 8192) == 0) { - goto out; - } - - for (;;) { - int n = BIO_read(bio, &buf->data[used], buf->length - used); - if (n < 0) { - if (used == 0) { - goto out; - } - // Workaround a bug in node.js. It uses a memory BIO for this in the wrong - // mode. - n = 0; - } - - if (n == 0) { - break; - } - used += n; - - if (used < buf->length) { - continue; - } - - if (buf->length > kMaxSize || - BUF_MEM_grow(buf, buf->length * 2) == 0) { - goto out; - } - } - - dummy = (uint8_t*) buf->data; - ret = d2i_PKCS12(out_p12, &dummy, used); - -out: - BUF_MEM_free(buf); - return ret; -} - -PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12) { - BIO *bio; - PKCS12 *ret; - - bio = BIO_new_fp(fp, 0 /* don't take ownership */); - if (!bio) { - return NULL; - } - - ret = d2i_PKCS12_bio(bio, out_p12); - BIO_free(bio); - return ret; -} - -int PKCS12_parse(const PKCS12 *p12, const char *password, EVP_PKEY **out_pkey, - X509 **out_cert, STACK_OF(X509) **out_ca_certs) { - CBS ber_bytes; - STACK_OF(X509) *ca_certs = NULL; - char ca_certs_alloced = 0; - - if (out_ca_certs != NULL && *out_ca_certs != NULL) { - ca_certs = *out_ca_certs; - } - - if (!ca_certs) { - ca_certs = sk_X509_new_null(); - if (ca_certs == NULL) { - OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); - return 0; - } - ca_certs_alloced = 1; - } - - CBS_init(&ber_bytes, p12->ber_bytes, p12->ber_len); - if (!PKCS12_get_key_and_certs(out_pkey, ca_certs, &ber_bytes, password)) { - if (ca_certs_alloced) { - sk_X509_free(ca_certs); - } - return 0; - } - - *out_cert = NULL; - if (sk_X509_num(ca_certs) > 0) { - *out_cert = sk_X509_shift(ca_certs); - } - - if (out_ca_certs) { - *out_ca_certs = ca_certs; - } else { - sk_X509_pop_free(ca_certs, X509_free); - } - - return 1; -} - -int PKCS12_verify_mac(const PKCS12 *p12, const char *password, - int password_len) { - if (password == NULL) { - if (password_len != 0) { - return 0; - } - } else if (password_len != -1 && - (password[password_len] != 0 || - OPENSSL_memchr(password, 0, password_len) != NULL)) { - return 0; - } - - EVP_PKEY *pkey = NULL; - X509 *cert = NULL; - if (!PKCS12_parse(p12, password, &pkey, &cert, NULL)) { - ERR_clear_error(); - return 0; - } - - EVP_PKEY_free(pkey); - X509_free(cert); - - return 1; -} - -void PKCS12_free(PKCS12 *p12) { - if (p12 == NULL) { - return; - } - OPENSSL_free(p12->ber_bytes); - OPENSSL_free(p12); -} diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8_x509.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8_x509.c.grpc_back deleted file mode 100644 index b3e2d93fa..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8_x509.c.grpc_back +++ /dev/null @@ -1,789 +0,0 @@ -/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL - * project 1999. - */ -/* ==================================================================== - * Copyright (c) 1999 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * licensing@OpenSSL.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../bytestring/internal.h" -#include "../internal.h" - - -// Minor tweak to operation: zero private key data -static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, - void *exarg) { - // Since the structure must still be valid use ASN1_OP_FREE_PRE - if (operation == ASN1_OP_FREE_PRE) { - PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; - if (key->pkey && key->pkey->type == V_ASN1_OCTET_STRING && - key->pkey->value.octet_string) { - OPENSSL_cleanse(key->pkey->value.octet_string->data, - key->pkey->value.octet_string->length); - } - } - return 1; -} - -ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb) = { - ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER), - ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR), - ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY), - ASN1_IMP_SET_OF_OPT(PKCS8_PRIV_KEY_INFO, attributes, X509_ATTRIBUTE, 0) -} ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) - -IMPLEMENT_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) - -EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) { - uint8_t *der = NULL; - int der_len = i2d_PKCS8_PRIV_KEY_INFO(p8, &der); - if (der_len < 0) { - return NULL; - } - - CBS cbs; - CBS_init(&cbs, der, (size_t)der_len); - EVP_PKEY *ret = EVP_parse_private_key(&cbs); - if (ret == NULL || CBS_len(&cbs) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); - EVP_PKEY_free(ret); - OPENSSL_free(der); - return NULL; - } - - OPENSSL_free(der); - return ret; -} - -PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) { - CBB cbb; - uint8_t *der = NULL; - size_t der_len; - if (!CBB_init(&cbb, 0) || - !EVP_marshal_private_key(&cbb, pkey) || - !CBB_finish(&cbb, &der, &der_len) || - der_len > LONG_MAX) { - CBB_cleanup(&cbb); - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_ENCODE_ERROR); - goto err; - } - - const uint8_t *p = der; - PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, (long)der_len); - if (p8 == NULL || p != der + der_len) { - PKCS8_PRIV_KEY_INFO_free(p8); - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); - goto err; - } - - OPENSSL_free(der); - return p8; - -err: - OPENSSL_free(der); - return NULL; -} - -PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8, const char *pass, - int pass_len_in) { - size_t pass_len; - if (pass_len_in == -1 && pass != NULL) { - pass_len = strlen(pass); - } else { - pass_len = (size_t)pass_len_in; - } - - PKCS8_PRIV_KEY_INFO *ret = NULL; - EVP_PKEY *pkey = NULL; - uint8_t *in = NULL; - - // Convert the legacy ASN.1 object to a byte string. - int in_len = i2d_X509_SIG(pkcs8, &in); - if (in_len < 0) { - goto err; - } - - CBS cbs; - CBS_init(&cbs, in, in_len); - pkey = PKCS8_parse_encrypted_private_key(&cbs, pass, pass_len); - if (pkey == NULL || CBS_len(&cbs) != 0) { - goto err; - } - - ret = EVP_PKEY2PKCS8(pkey); - -err: - OPENSSL_free(in); - EVP_PKEY_free(pkey); - return ret; -} - -X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, - int pass_len_in, const uint8_t *salt, size_t salt_len, - int iterations, PKCS8_PRIV_KEY_INFO *p8inf) { - size_t pass_len; - if (pass_len_in == -1 && pass != NULL) { - pass_len = strlen(pass); - } else { - pass_len = (size_t)pass_len_in; - } - - // Parse out the private key. - EVP_PKEY *pkey = EVP_PKCS82PKEY(p8inf); - if (pkey == NULL) { - return NULL; - } - - X509_SIG *ret = NULL; - uint8_t *der = NULL; - size_t der_len; - CBB cbb; - if (!CBB_init(&cbb, 128) || - !PKCS8_marshal_encrypted_private_key(&cbb, pbe_nid, cipher, pass, - pass_len, salt, salt_len, iterations, - pkey) || - !CBB_finish(&cbb, &der, &der_len)) { - CBB_cleanup(&cbb); - goto err; - } - - // Convert back to legacy ASN.1 objects. - const uint8_t *ptr = der; - ret = d2i_X509_SIG(NULL, &ptr, der_len); - if (ret == NULL || ptr != der + der_len) { - OPENSSL_PUT_ERROR(PKCS8, ERR_R_INTERNAL_ERROR); - X509_SIG_free(ret); - ret = NULL; - } - -err: - OPENSSL_free(der); - EVP_PKEY_free(pkey); - return ret; -} - -struct pkcs12_context { - EVP_PKEY **out_key; - STACK_OF(X509) *out_certs; - const char *password; - size_t password_len; -}; - -// PKCS12_handle_sequence parses a BER-encoded SEQUENCE of elements in a PKCS#12 -// structure. -static int PKCS12_handle_sequence( - CBS *sequence, struct pkcs12_context *ctx, - int (*handle_element)(CBS *cbs, struct pkcs12_context *ctx)) { - uint8_t *der_bytes = NULL; - size_t der_len; - CBS in; - int ret = 0; - - // Although a BER->DER conversion is done at the beginning of |PKCS12_parse|, - // the ASN.1 data gets wrapped in OCTETSTRINGs and/or encrypted and the - // conversion cannot see through those wrappings. So each time we step - // through one we need to convert to DER again. - if (!CBS_asn1_ber_to_der(sequence, &der_bytes, &der_len)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - if (der_bytes != NULL) { - CBS_init(&in, der_bytes, der_len); - } else { - CBS_init(&in, CBS_data(sequence), CBS_len(sequence)); - } - - CBS child; - if (!CBS_get_asn1(&in, &child, CBS_ASN1_SEQUENCE) || - CBS_len(&in) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - while (CBS_len(&child) > 0) { - CBS element; - if (!CBS_get_asn1(&child, &element, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (!handle_element(&element, ctx)) { - goto err; - } - } - - ret = 1; - -err: - OPENSSL_free(der_bytes); - return ret; -} - -// 1.2.840.113549.1.12.10.1.2 -static const uint8_t kPKCS8ShroudedKeyBag[] = { - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02}; - -// 1.2.840.113549.1.12.10.1.3 -static const uint8_t kCertBag[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, - 0x01, 0x0c, 0x0a, 0x01, 0x03}; - -// 1.2.840.113549.1.9.22.1 -static const uint8_t kX509Certificate[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x09, 0x16, 0x01}; - -// PKCS12_handle_safe_bag parses a single SafeBag element in a PKCS#12 -// structure. -static int PKCS12_handle_safe_bag(CBS *safe_bag, struct pkcs12_context *ctx) { - CBS bag_id, wrapped_value; - if (!CBS_get_asn1(safe_bag, &bag_id, CBS_ASN1_OBJECT) || - !CBS_get_asn1(safe_bag, &wrapped_value, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) - /* Ignore the bagAttributes field. */) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - if (CBS_mem_equal(&bag_id, kPKCS8ShroudedKeyBag, - sizeof(kPKCS8ShroudedKeyBag))) { - // See RFC 7292, section 4.2.2. - if (*ctx->out_key) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MULTIPLE_PRIVATE_KEYS_IN_PKCS12); - return 0; - } - - EVP_PKEY *pkey = PKCS8_parse_encrypted_private_key( - &wrapped_value, ctx->password, ctx->password_len); - if (pkey == NULL) { - return 0; - } - - if (CBS_len(&wrapped_value) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - EVP_PKEY_free(pkey); - return 0; - } - - *ctx->out_key = pkey; - return 1; - } - - if (CBS_mem_equal(&bag_id, kCertBag, sizeof(kCertBag))) { - // See RFC 7292, section 4.2.3. - CBS cert_bag, cert_type, wrapped_cert, cert; - if (!CBS_get_asn1(&wrapped_value, &cert_bag, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&cert_bag, &cert_type, CBS_ASN1_OBJECT) || - !CBS_get_asn1(&cert_bag, &wrapped_cert, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || - !CBS_get_asn1(&wrapped_cert, &cert, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - // Skip unknown certificate types. - if (!CBS_mem_equal(&cert_type, kX509Certificate, - sizeof(kX509Certificate))) { - return 1; - } - - if (CBS_len(&cert) > LONG_MAX) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - const uint8_t *inp = CBS_data(&cert); - X509 *x509 = d2i_X509(NULL, &inp, (long)CBS_len(&cert)); - if (!x509) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - - if (inp != CBS_data(&cert) + CBS_len(&cert)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - X509_free(x509); - return 0; - } - - if (0 == sk_X509_push(ctx->out_certs, x509)) { - X509_free(x509); - return 0; - } - - return 1; - } - - // Unknown element type - ignore it. - return 1; -} - -// 1.2.840.113549.1.7.1 -static const uint8_t kPKCS7Data[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x07, 0x01}; - -// 1.2.840.113549.1.7.6 -static const uint8_t kPKCS7EncryptedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, - 0x0d, 0x01, 0x07, 0x06}; - -// PKCS12_handle_content_info parses a single PKCS#7 ContentInfo element in a -// PKCS#12 structure. -static int PKCS12_handle_content_info(CBS *content_info, - struct pkcs12_context *ctx) { - CBS content_type, wrapped_contents, contents; - int ret = 0; - uint8_t *storage = NULL; - - if (!CBS_get_asn1(content_info, &content_type, CBS_ASN1_OBJECT) || - !CBS_get_asn1(content_info, &wrapped_contents, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || - CBS_len(content_info) != 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (CBS_mem_equal(&content_type, kPKCS7EncryptedData, - sizeof(kPKCS7EncryptedData))) { - // See https://tools.ietf.org/html/rfc2315#section-13. - // - // PKCS#7 encrypted data inside a PKCS#12 structure is generally an - // encrypted certificate bag and it's generally encrypted with 40-bit - // RC2-CBC. - CBS version_bytes, eci, contents_type, ai, encrypted_contents; - uint8_t *out; - size_t out_len; - - if (!CBS_get_asn1(&wrapped_contents, &contents, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&contents, &version_bytes, CBS_ASN1_INTEGER) || - // EncryptedContentInfo, see - // https://tools.ietf.org/html/rfc2315#section-10.1 - !CBS_get_asn1(&contents, &eci, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&eci, &contents_type, CBS_ASN1_OBJECT) || - // AlgorithmIdentifier, see - // https://tools.ietf.org/html/rfc5280#section-4.1.1.2 - !CBS_get_asn1(&eci, &ai, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1_implicit_string( - &eci, &encrypted_contents, &storage, - CBS_ASN1_CONTEXT_SPECIFIC | 0, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (!CBS_mem_equal(&contents_type, kPKCS7Data, sizeof(kPKCS7Data))) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (!pkcs8_pbe_decrypt(&out, &out_len, &ai, ctx->password, - ctx->password_len, CBS_data(&encrypted_contents), - CBS_len(&encrypted_contents))) { - goto err; - } - - CBS safe_contents; - CBS_init(&safe_contents, out, out_len); - ret = PKCS12_handle_sequence(&safe_contents, ctx, PKCS12_handle_safe_bag); - OPENSSL_free(out); - } else if (CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { - CBS octet_string_contents; - - if (!CBS_get_asn1(&wrapped_contents, &octet_string_contents, - CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - ret = PKCS12_handle_sequence(&octet_string_contents, ctx, - PKCS12_handle_safe_bag); - } else { - // Unknown element type - ignore it. - ret = 1; - } - -err: - OPENSSL_free(storage); - return ret; -} - -int PKCS12_get_key_and_certs(EVP_PKEY **out_key, STACK_OF(X509) *out_certs, - CBS *ber_in, const char *password) { - uint8_t *der_bytes = NULL; - size_t der_len; - CBS in, pfx, mac_data, authsafe, content_type, wrapped_authsafes, authsafes; - uint64_t version; - int ret = 0; - struct pkcs12_context ctx; - const size_t original_out_certs_len = sk_X509_num(out_certs); - - // The input may be in BER format. - if (!CBS_asn1_ber_to_der(ber_in, &der_bytes, &der_len)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - return 0; - } - if (der_bytes != NULL) { - CBS_init(&in, der_bytes, der_len); - } else { - CBS_init(&in, CBS_data(ber_in), CBS_len(ber_in)); - } - - *out_key = NULL; - OPENSSL_memset(&ctx, 0, sizeof(ctx)); - - // See ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1.pdf, section - // four. - if (!CBS_get_asn1(&in, &pfx, CBS_ASN1_SEQUENCE) || - CBS_len(&in) != 0 || - !CBS_get_asn1_uint64(&pfx, &version)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (version < 3) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_VERSION); - goto err; - } - - if (!CBS_get_asn1(&pfx, &authsafe, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - if (CBS_len(&pfx) == 0) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MISSING_MAC); - goto err; - } - - if (!CBS_get_asn1(&pfx, &mac_data, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - // authsafe is a PKCS#7 ContentInfo. See - // https://tools.ietf.org/html/rfc2315#section-7. - if (!CBS_get_asn1(&authsafe, &content_type, CBS_ASN1_OBJECT) || - !CBS_get_asn1(&authsafe, &wrapped_authsafes, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - // The content type can either be data or signedData. The latter indicates - // that it's signed by a public key, which isn't supported. - if (!CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED); - goto err; - } - - if (!CBS_get_asn1(&wrapped_authsafes, &authsafes, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - ctx.out_key = out_key; - ctx.out_certs = out_certs; - ctx.password = password; - ctx.password_len = password != NULL ? strlen(password) : 0; - - // Verify the MAC. - { - CBS mac, salt, expected_mac; - if (!CBS_get_asn1(&mac_data, &mac, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - const EVP_MD *md = EVP_parse_digest_algorithm(&mac); - if (md == NULL) { - goto err; - } - - if (!CBS_get_asn1(&mac, &expected_mac, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&mac_data, &salt, CBS_ASN1_OCTETSTRING)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - - // The iteration count is optional and the default is one. - uint64_t iterations = 1; - if (CBS_len(&mac_data) > 0) { - if (!CBS_get_asn1_uint64(&mac_data, &iterations) || - iterations > UINT_MAX) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); - goto err; - } - } - - uint8_t hmac_key[EVP_MAX_MD_SIZE]; - if (!pkcs12_key_gen(ctx.password, ctx.password_len, CBS_data(&salt), - CBS_len(&salt), PKCS12_MAC_ID, iterations, - EVP_MD_size(md), hmac_key, md)) { - goto err; - } - - uint8_t hmac[EVP_MAX_MD_SIZE]; - unsigned hmac_len; - if (NULL == HMAC(md, hmac_key, EVP_MD_size(md), CBS_data(&authsafes), - CBS_len(&authsafes), hmac, &hmac_len)) { - goto err; - } - - if (!CBS_mem_equal(&expected_mac, hmac, hmac_len)) { - OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INCORRECT_PASSWORD); - goto err; - } - } - - // authsafes contains a series of PKCS#7 ContentInfos. - if (!PKCS12_handle_sequence(&authsafes, &ctx, PKCS12_handle_content_info)) { - goto err; - } - - ret = 1; - -err: - OPENSSL_free(der_bytes); - if (!ret) { - EVP_PKEY_free(*out_key); - *out_key = NULL; - while (sk_X509_num(out_certs) > original_out_certs_len) { - X509 *x509 = sk_X509_pop(out_certs); - X509_free(x509); - } - } - - return ret; -} - -void PKCS12_PBE_add(void) {} - -struct pkcs12_st { - uint8_t *ber_bytes; - size_t ber_len; -}; - -PKCS12 *d2i_PKCS12(PKCS12 **out_p12, const uint8_t **ber_bytes, - size_t ber_len) { - PKCS12 *p12; - - p12 = OPENSSL_malloc(sizeof(PKCS12)); - if (!p12) { - return NULL; - } - - p12->ber_bytes = OPENSSL_malloc(ber_len); - if (!p12->ber_bytes) { - OPENSSL_free(p12); - return NULL; - } - - OPENSSL_memcpy(p12->ber_bytes, *ber_bytes, ber_len); - p12->ber_len = ber_len; - *ber_bytes += ber_len; - - if (out_p12) { - PKCS12_free(*out_p12); - - *out_p12 = p12; - } - - return p12; -} - -PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12) { - size_t used = 0; - BUF_MEM *buf; - const uint8_t *dummy; - static const size_t kMaxSize = 256 * 1024; - PKCS12 *ret = NULL; - - buf = BUF_MEM_new(); - if (buf == NULL) { - return NULL; - } - if (BUF_MEM_grow(buf, 8192) == 0) { - goto out; - } - - for (;;) { - int n = BIO_read(bio, &buf->data[used], buf->length - used); - if (n < 0) { - if (used == 0) { - goto out; - } - // Workaround a bug in node.js. It uses a memory BIO for this in the wrong - // mode. - n = 0; - } - - if (n == 0) { - break; - } - used += n; - - if (used < buf->length) { - continue; - } - - if (buf->length > kMaxSize || - BUF_MEM_grow(buf, buf->length * 2) == 0) { - goto out; - } - } - - dummy = (uint8_t*) buf->data; - ret = d2i_PKCS12(out_p12, &dummy, used); - -out: - BUF_MEM_free(buf); - return ret; -} - -PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12) { - BIO *bio; - PKCS12 *ret; - - bio = BIO_new_fp(fp, 0 /* don't take ownership */); - if (!bio) { - return NULL; - } - - ret = d2i_PKCS12_bio(bio, out_p12); - BIO_free(bio); - return ret; -} - -int PKCS12_parse(const PKCS12 *p12, const char *password, EVP_PKEY **out_pkey, - X509 **out_cert, STACK_OF(X509) **out_ca_certs) { - CBS ber_bytes; - STACK_OF(X509) *ca_certs = NULL; - char ca_certs_alloced = 0; - - if (out_ca_certs != NULL && *out_ca_certs != NULL) { - ca_certs = *out_ca_certs; - } - - if (!ca_certs) { - ca_certs = sk_X509_new_null(); - if (ca_certs == NULL) { - OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); - return 0; - } - ca_certs_alloced = 1; - } - - CBS_init(&ber_bytes, p12->ber_bytes, p12->ber_len); - if (!PKCS12_get_key_and_certs(out_pkey, ca_certs, &ber_bytes, password)) { - if (ca_certs_alloced) { - sk_X509_free(ca_certs); - } - return 0; - } - - *out_cert = NULL; - if (sk_X509_num(ca_certs) > 0) { - *out_cert = sk_X509_shift(ca_certs); - } - - if (out_ca_certs) { - *out_ca_certs = ca_certs; - } else { - sk_X509_pop_free(ca_certs, X509_free); - } - - return 1; -} - -int PKCS12_verify_mac(const PKCS12 *p12, const char *password, - int password_len) { - if (password == NULL) { - if (password_len != 0) { - return 0; - } - } else if (password_len != -1 && - (password[password_len] != 0 || - OPENSSL_memchr(password, 0, password_len) != NULL)) { - return 0; - } - - EVP_PKEY *pkey = NULL; - X509 *cert = NULL; - if (!PKCS12_parse(p12, password, &pkey, &cert, NULL)) { - ERR_clear_error(); - return 0; - } - - EVP_PKEY_free(pkey); - X509_free(cert); - - return 1; -} - -void PKCS12_free(PKCS12 *p12) { - if (p12 == NULL) { - return; - } - OPENSSL_free(p12->ber_bytes); - OPENSSL_free(p12); -} diff --git a/Pods/BoringSSL-GRPC/crypto/pool/internal.h b/Pods/BoringSSL-GRPC/crypto/pool/internal.h deleted file mode 100644 index 6dad52134..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pool/internal.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_POOL_INTERNAL_H -#define OPENSSL_HEADER_POOL_INTERNAL_H - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -DECLARE_LHASH_OF(CRYPTO_BUFFER); - -struct crypto_buffer_st { - CRYPTO_BUFFER_POOL *pool; - uint8_t *data; - size_t len; - CRYPTO_refcount_t references; -}; - -struct crypto_buffer_pool_st { - LHASH_OF(CRYPTO_BUFFER) *bufs; - CRYPTO_MUTEX lock; -}; - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_POOL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/pool/internal.h.grpc_back b/Pods/BoringSSL-GRPC/crypto/pool/internal.h.grpc_back deleted file mode 100644 index 5b288ebbd..000000000 --- a/Pods/BoringSSL-GRPC/crypto/pool/internal.h.grpc_back +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_POOL_INTERNAL_H -#define OPENSSL_HEADER_POOL_INTERNAL_H - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -DECLARE_LHASH_OF(CRYPTO_BUFFER); - -struct crypto_buffer_st { - CRYPTO_BUFFER_POOL *pool; - uint8_t *data; - size_t len; - CRYPTO_refcount_t references; -}; - -struct crypto_buffer_pool_st { - LHASH_OF(CRYPTO_BUFFER) *bufs; - CRYPTO_MUTEX lock; -}; - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_POOL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/fuchsia.c b/Pods/BoringSSL-GRPC/crypto/rand_extra/fuchsia.c deleted file mode 100644 index 5507d718d..000000000 --- a/Pods/BoringSSL-GRPC/crypto/rand_extra/fuchsia.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#if defined(OPENSSL_FUCHSIA) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) - -#include -#include - -#include - -#include "../fipsmodule/rand/internal.h" - -void CRYPTO_sysrand(uint8_t *out, size_t requested) { - while (requested > 0) { - size_t output_bytes_this_pass = ZX_CPRNG_DRAW_MAX_LEN; - if (requested < output_bytes_this_pass) { - output_bytes_this_pass = requested; - } - size_t bytes_drawn; - zx_status_t status = - zx_cprng_draw(out, output_bytes_this_pass, &bytes_drawn); - if (status != ZX_OK) { - abort(); - } - requested -= bytes_drawn; - out += bytes_drawn; - } -} - -#endif // OPENSSL_FUCHSIA && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/fuchsia.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/rand_extra/fuchsia.c.grpc_back deleted file mode 100644 index ce8356c0a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/rand_extra/fuchsia.c.grpc_back +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#if defined(OPENSSL_FUCHSIA) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) - -#include -#include - -#include - -#include "../fipsmodule/rand/internal.h" - -void CRYPTO_sysrand(uint8_t *out, size_t requested) { - while (requested > 0) { - size_t output_bytes_this_pass = ZX_CPRNG_DRAW_MAX_LEN; - if (requested < output_bytes_this_pass) { - output_bytes_this_pass = requested; - } - size_t bytes_drawn; - zx_status_t status = - zx_cprng_draw(out, output_bytes_this_pass, &bytes_drawn); - if (status != ZX_OK) { - abort(); - } - requested -= bytes_drawn; - out += bytes_drawn; - } -} - -#endif // OPENSSL_FUCHSIA && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/Pods/BoringSSL-GRPC/crypto/stack/stack.c b/Pods/BoringSSL-GRPC/crypto/stack/stack.c deleted file mode 100644 index 659b4e131..000000000 --- a/Pods/BoringSSL-GRPC/crypto/stack/stack.c +++ /dev/null @@ -1,380 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include - -#include "../internal.h" - - -// kMinSize is the number of pointers that will be initially allocated in a new -// stack. -static const size_t kMinSize = 4; - -_STACK *sk_new(stack_cmp_func comp) { - _STACK *ret; - - ret = OPENSSL_malloc(sizeof(_STACK)); - if (ret == NULL) { - goto err; - } - OPENSSL_memset(ret, 0, sizeof(_STACK)); - - ret->data = OPENSSL_malloc(sizeof(void *) * kMinSize); - if (ret->data == NULL) { - goto err; - } - - OPENSSL_memset(ret->data, 0, sizeof(void *) * kMinSize); - - ret->comp = comp; - ret->num_alloc = kMinSize; - - return ret; - -err: - OPENSSL_free(ret); - return NULL; -} - -_STACK *sk_new_null(void) { return sk_new(NULL); } - -size_t sk_num(const _STACK *sk) { - if (sk == NULL) { - return 0; - } - return sk->num; -} - -void sk_zero(_STACK *sk) { - if (sk == NULL || sk->num == 0) { - return; - } - OPENSSL_memset(sk->data, 0, sizeof(void*) * sk->num); - sk->num = 0; - sk->sorted = 0; -} - -void *sk_value(const _STACK *sk, size_t i) { - if (!sk || i >= sk->num) { - return NULL; - } - return sk->data[i]; -} - -void *sk_set(_STACK *sk, size_t i, void *value) { - if (!sk || i >= sk->num) { - return NULL; - } - return sk->data[i] = value; -} - -void sk_free(_STACK *sk) { - if (sk == NULL) { - return; - } - OPENSSL_free(sk->data); - OPENSSL_free(sk); -} - -void sk_pop_free(_STACK *sk, void (*func)(void *)) { - if (sk == NULL) { - return; - } - - for (size_t i = 0; i < sk->num; i++) { - if (sk->data[i] != NULL) { - func(sk->data[i]); - } - } - sk_free(sk); -} - -size_t sk_insert(_STACK *sk, void *p, size_t where) { - if (sk == NULL) { - return 0; - } - - if (sk->num_alloc <= sk->num + 1) { - // Attempt to double the size of the array. - size_t new_alloc = sk->num_alloc << 1; - size_t alloc_size = new_alloc * sizeof(void *); - void **data; - - // If the doubling overflowed, try to increment. - if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { - new_alloc = sk->num_alloc + 1; - alloc_size = new_alloc * sizeof(void *); - } - - // If the increment also overflowed, fail. - if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { - return 0; - } - - data = OPENSSL_realloc(sk->data, alloc_size); - if (data == NULL) { - return 0; - } - - sk->data = data; - sk->num_alloc = new_alloc; - } - - if (where >= sk->num) { - sk->data[sk->num] = p; - } else { - OPENSSL_memmove(&sk->data[where + 1], &sk->data[where], - sizeof(void *) * (sk->num - where)); - sk->data[where] = p; - } - - sk->num++; - sk->sorted = 0; - - return sk->num; -} - -void *sk_delete(_STACK *sk, size_t where) { - void *ret; - - if (!sk || where >= sk->num) { - return NULL; - } - - ret = sk->data[where]; - - if (where != sk->num - 1) { - OPENSSL_memmove(&sk->data[where], &sk->data[where + 1], - sizeof(void *) * (sk->num - where - 1)); - } - - sk->num--; - return ret; -} - -void *sk_delete_ptr(_STACK *sk, void *p) { - if (sk == NULL) { - return NULL; - } - - for (size_t i = 0; i < sk->num; i++) { - if (sk->data[i] == p) { - return sk_delete(sk, i); - } - } - - return NULL; -} - -int sk_find(_STACK *sk, size_t *out_index, void *p) { - if (sk == NULL) { - return 0; - } - - if (sk->comp == NULL) { - // Use pointer equality when no comparison function has been set. - for (size_t i = 0; i < sk->num; i++) { - if (sk->data[i] == p) { - if (out_index) { - *out_index = i; - } - return 1; - } - } - return 0; - } - - if (p == NULL) { - return 0; - } - - sk_sort(sk); - - // sk->comp is a function that takes pointers to pointers to elements, but - // qsort and bsearch take a comparison function that just takes pointers to - // elements. However, since we're passing an array of pointers to - // qsort/bsearch, we can just cast the comparison function and everything - // works. - const void *const *r = bsearch(&p, sk->data, sk->num, sizeof(void *), - (int (*)(const void *, const void *))sk->comp); - if (r == NULL) { - return 0; - } - size_t idx = ((void **)r) - sk->data; - // This function always returns the first result. - while (idx > 0 && - sk->comp((const void **)&p, (const void **)&sk->data[idx - 1]) == 0) { - idx--; - } - if (out_index) { - *out_index = idx; - } - return 1; -} - -void *sk_shift(_STACK *sk) { - if (sk == NULL) { - return NULL; - } - if (sk->num == 0) { - return NULL; - } - return sk_delete(sk, 0); -} - -size_t sk_push(_STACK *sk, void *p) { return (sk_insert(sk, p, sk->num)); } - -void *sk_pop(_STACK *sk) { - if (sk == NULL) { - return NULL; - } - if (sk->num == 0) { - return NULL; - } - return sk_delete(sk, sk->num - 1); -} - -_STACK *sk_dup(const _STACK *sk) { - _STACK *ret; - void **s; - - if (sk == NULL) { - return NULL; - } - - ret = sk_new(sk->comp); - if (ret == NULL) { - goto err; - } - - s = (void **)OPENSSL_realloc(ret->data, sizeof(void *) * sk->num_alloc); - if (s == NULL) { - goto err; - } - ret->data = s; - - ret->num = sk->num; - OPENSSL_memcpy(ret->data, sk->data, sizeof(void *) * sk->num); - ret->sorted = sk->sorted; - ret->num_alloc = sk->num_alloc; - ret->comp = sk->comp; - return ret; - -err: - sk_free(ret); - return NULL; -} - -void sk_sort(_STACK *sk) { - int (*comp_func)(const void *,const void *); - - if (sk == NULL || sk->comp == NULL || sk->sorted) { - return; - } - - // See the comment in sk_find about this cast. - comp_func = (int (*)(const void *, const void *))(sk->comp); - qsort(sk->data, sk->num, sizeof(void *), comp_func); - sk->sorted = 1; -} - -int sk_is_sorted(const _STACK *sk) { - if (!sk) { - return 1; - } - return sk->sorted; -} - -stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp) { - stack_cmp_func old = sk->comp; - - if (sk->comp != comp) { - sk->sorted = 0; - } - sk->comp = comp; - - return old; -} - -_STACK *sk_deep_copy(const _STACK *sk, void *(*copy_func)(void *), - void (*free_func)(void *)) { - _STACK *ret = sk_dup(sk); - if (ret == NULL) { - return NULL; - } - - for (size_t i = 0; i < ret->num; i++) { - if (ret->data[i] == NULL) { - continue; - } - ret->data[i] = copy_func(ret->data[i]); - if (ret->data[i] == NULL) { - for (size_t j = 0; j < i; j++) { - if (ret->data[j] != NULL) { - free_func(ret->data[j]); - } - } - sk_free(ret); - return NULL; - } - } - - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/stack/stack.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/stack/stack.c.grpc_back deleted file mode 100644 index f6b44123a..000000000 --- a/Pods/BoringSSL-GRPC/crypto/stack/stack.c.grpc_back +++ /dev/null @@ -1,380 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include - -#include - -#include "../internal.h" - - -// kMinSize is the number of pointers that will be initially allocated in a new -// stack. -static const size_t kMinSize = 4; - -_STACK *sk_new(stack_cmp_func comp) { - _STACK *ret; - - ret = OPENSSL_malloc(sizeof(_STACK)); - if (ret == NULL) { - goto err; - } - OPENSSL_memset(ret, 0, sizeof(_STACK)); - - ret->data = OPENSSL_malloc(sizeof(void *) * kMinSize); - if (ret->data == NULL) { - goto err; - } - - OPENSSL_memset(ret->data, 0, sizeof(void *) * kMinSize); - - ret->comp = comp; - ret->num_alloc = kMinSize; - - return ret; - -err: - OPENSSL_free(ret); - return NULL; -} - -_STACK *sk_new_null(void) { return sk_new(NULL); } - -size_t sk_num(const _STACK *sk) { - if (sk == NULL) { - return 0; - } - return sk->num; -} - -void sk_zero(_STACK *sk) { - if (sk == NULL || sk->num == 0) { - return; - } - OPENSSL_memset(sk->data, 0, sizeof(void*) * sk->num); - sk->num = 0; - sk->sorted = 0; -} - -void *sk_value(const _STACK *sk, size_t i) { - if (!sk || i >= sk->num) { - return NULL; - } - return sk->data[i]; -} - -void *sk_set(_STACK *sk, size_t i, void *value) { - if (!sk || i >= sk->num) { - return NULL; - } - return sk->data[i] = value; -} - -void sk_free(_STACK *sk) { - if (sk == NULL) { - return; - } - OPENSSL_free(sk->data); - OPENSSL_free(sk); -} - -void sk_pop_free(_STACK *sk, void (*func)(void *)) { - if (sk == NULL) { - return; - } - - for (size_t i = 0; i < sk->num; i++) { - if (sk->data[i] != NULL) { - func(sk->data[i]); - } - } - sk_free(sk); -} - -size_t sk_insert(_STACK *sk, void *p, size_t where) { - if (sk == NULL) { - return 0; - } - - if (sk->num_alloc <= sk->num + 1) { - // Attempt to double the size of the array. - size_t new_alloc = sk->num_alloc << 1; - size_t alloc_size = new_alloc * sizeof(void *); - void **data; - - // If the doubling overflowed, try to increment. - if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { - new_alloc = sk->num_alloc + 1; - alloc_size = new_alloc * sizeof(void *); - } - - // If the increment also overflowed, fail. - if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { - return 0; - } - - data = OPENSSL_realloc(sk->data, alloc_size); - if (data == NULL) { - return 0; - } - - sk->data = data; - sk->num_alloc = new_alloc; - } - - if (where >= sk->num) { - sk->data[sk->num] = p; - } else { - OPENSSL_memmove(&sk->data[where + 1], &sk->data[where], - sizeof(void *) * (sk->num - where)); - sk->data[where] = p; - } - - sk->num++; - sk->sorted = 0; - - return sk->num; -} - -void *sk_delete(_STACK *sk, size_t where) { - void *ret; - - if (!sk || where >= sk->num) { - return NULL; - } - - ret = sk->data[where]; - - if (where != sk->num - 1) { - OPENSSL_memmove(&sk->data[where], &sk->data[where + 1], - sizeof(void *) * (sk->num - where - 1)); - } - - sk->num--; - return ret; -} - -void *sk_delete_ptr(_STACK *sk, void *p) { - if (sk == NULL) { - return NULL; - } - - for (size_t i = 0; i < sk->num; i++) { - if (sk->data[i] == p) { - return sk_delete(sk, i); - } - } - - return NULL; -} - -int sk_find(_STACK *sk, size_t *out_index, void *p) { - if (sk == NULL) { - return 0; - } - - if (sk->comp == NULL) { - // Use pointer equality when no comparison function has been set. - for (size_t i = 0; i < sk->num; i++) { - if (sk->data[i] == p) { - if (out_index) { - *out_index = i; - } - return 1; - } - } - return 0; - } - - if (p == NULL) { - return 0; - } - - sk_sort(sk); - - // sk->comp is a function that takes pointers to pointers to elements, but - // qsort and bsearch take a comparison function that just takes pointers to - // elements. However, since we're passing an array of pointers to - // qsort/bsearch, we can just cast the comparison function and everything - // works. - const void *const *r = bsearch(&p, sk->data, sk->num, sizeof(void *), - (int (*)(const void *, const void *))sk->comp); - if (r == NULL) { - return 0; - } - size_t idx = ((void **)r) - sk->data; - // This function always returns the first result. - while (idx > 0 && - sk->comp((const void **)&p, (const void **)&sk->data[idx - 1]) == 0) { - idx--; - } - if (out_index) { - *out_index = idx; - } - return 1; -} - -void *sk_shift(_STACK *sk) { - if (sk == NULL) { - return NULL; - } - if (sk->num == 0) { - return NULL; - } - return sk_delete(sk, 0); -} - -size_t sk_push(_STACK *sk, void *p) { return (sk_insert(sk, p, sk->num)); } - -void *sk_pop(_STACK *sk) { - if (sk == NULL) { - return NULL; - } - if (sk->num == 0) { - return NULL; - } - return sk_delete(sk, sk->num - 1); -} - -_STACK *sk_dup(const _STACK *sk) { - _STACK *ret; - void **s; - - if (sk == NULL) { - return NULL; - } - - ret = sk_new(sk->comp); - if (ret == NULL) { - goto err; - } - - s = (void **)OPENSSL_realloc(ret->data, sizeof(void *) * sk->num_alloc); - if (s == NULL) { - goto err; - } - ret->data = s; - - ret->num = sk->num; - OPENSSL_memcpy(ret->data, sk->data, sizeof(void *) * sk->num); - ret->sorted = sk->sorted; - ret->num_alloc = sk->num_alloc; - ret->comp = sk->comp; - return ret; - -err: - sk_free(ret); - return NULL; -} - -void sk_sort(_STACK *sk) { - int (*comp_func)(const void *,const void *); - - if (sk == NULL || sk->comp == NULL || sk->sorted) { - return; - } - - // See the comment in sk_find about this cast. - comp_func = (int (*)(const void *, const void *))(sk->comp); - qsort(sk->data, sk->num, sizeof(void *), comp_func); - sk->sorted = 1; -} - -int sk_is_sorted(const _STACK *sk) { - if (!sk) { - return 1; - } - return sk->sorted; -} - -stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp) { - stack_cmp_func old = sk->comp; - - if (sk->comp != comp) { - sk->sorted = 0; - } - sk->comp = comp; - - return old; -} - -_STACK *sk_deep_copy(const _STACK *sk, void *(*copy_func)(void *), - void (*free_func)(void *)) { - _STACK *ret = sk_dup(sk); - if (ret == NULL) { - return NULL; - } - - for (size_t i = 0; i < ret->num; i++) { - if (ret->data[i] == NULL) { - continue; - } - ret->data[i] = copy_func(ret->data[i]); - if (ret->data[i] == NULL) { - for (size_t j = 0; j < i; j++) { - if (ret->data[j] != NULL) { - free_func(ret->data[j]); - } - } - sk_free(ret); - return NULL; - } - } - - return ret; -} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_all.c b/Pods/BoringSSL-GRPC/crypto/x509/x_all.c deleted file mode 100644 index 8ea59dd47..000000000 --- a/Pods/BoringSSL-GRPC/crypto/x509/x_all.c +++ /dev/null @@ -1,501 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include -#include -#include -#include -#include -#include -#include -#include - -int X509_verify(X509 *a, EVP_PKEY *r) -{ - if (X509_ALGOR_cmp(a->sig_alg, a->cert_info->signature)) - return 0; - return (ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF), a->sig_alg, - a->signature, a->cert_info, r)); -} - -int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) -{ - return (ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO), - a->sig_alg, a->signature, a->req_info, r)); -} - -int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - x->cert_info->enc.modified = 1; - return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature, - x->sig_alg, x->signature, x->cert_info, pkey, md)); -} - -int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx) -{ - x->cert_info->enc.modified = 1; - return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CINF), - x->cert_info->signature, - x->sig_alg, x->signature, x->cert_info, ctx); -} - -int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - return (ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO), x->sig_alg, NULL, - x->signature, x->req_info, pkey, md)); -} - -int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx) -{ - return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_REQ_INFO), - x->sig_alg, NULL, x->signature, x->req_info, - ctx); -} - -int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - x->crl->enc.modified = 1; - return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CRL_INFO), x->crl->sig_alg, - x->sig_alg, x->signature, x->crl, pkey, md)); -} - -int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx) -{ - x->crl->enc.modified = 1; - return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CRL_INFO), - x->crl->sig_alg, x->sig_alg, x->signature, - x->crl, ctx); -} - -int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - return (ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, NULL, - x->signature, x->spkac, pkey, md)); -} - -int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *x, EVP_PKEY *pkey) -{ - return (ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, - x->signature, x->spkac, pkey)); -} - -#ifndef OPENSSL_NO_FP_API -X509 *d2i_X509_fp(FILE *fp, X509 **x509) -{ - return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509), fp, x509); -} - -int i2d_X509_fp(FILE *fp, X509 *x509) -{ - return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509), fp, x509); -} -#endif - -X509 *d2i_X509_bio(BIO *bp, X509 **x509) -{ - return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), bp, x509); -} - -int i2d_X509_bio(BIO *bp, X509 *x509) -{ - return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509); -} - -#ifndef OPENSSL_NO_FP_API -X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl) -{ - return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); -} - -int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) -{ - return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); -} -#endif - -X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl) -{ - return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); -} - -int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) -{ - return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); -} - -#ifndef OPENSSL_NO_FP_API -X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req) -{ - return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); -} - -int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) -{ - return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); -} -#endif - -X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req) -{ - return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); -} - -int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) -{ - return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); -} - -#ifndef OPENSSL_NO_FP_API -RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa) -{ - return ASN1_d2i_fp_of(RSA, RSA_new, d2i_RSAPrivateKey, fp, rsa); -} - -int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa) -{ - return ASN1_i2d_fp_of_const(RSA, i2d_RSAPrivateKey, fp, rsa); -} - -RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa) -{ - return ASN1_d2i_fp_of(RSA, RSA_new, d2i_RSAPublicKey, fp, rsa); -} - -RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa) -{ - return ASN1_d2i_fp((void *(*)(void)) - RSA_new, (D2I_OF(void)) d2i_RSA_PUBKEY, fp, - (void **)rsa); -} - -int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) -{ - return ASN1_i2d_fp_of_const(RSA, i2d_RSAPublicKey, fp, rsa); -} - -int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa) -{ - return ASN1_i2d_fp((I2D_OF_const(void))i2d_RSA_PUBKEY, fp, rsa); -} -#endif - -RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa) -{ - return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSAPrivateKey, bp, rsa); -} - -int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa) -{ - return ASN1_i2d_bio_of_const(RSA, i2d_RSAPrivateKey, bp, rsa); -} - -RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa) -{ - return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSAPublicKey, bp, rsa); -} - -RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa) -{ - return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSA_PUBKEY, bp, rsa); -} - -int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) -{ - return ASN1_i2d_bio_of_const(RSA, i2d_RSAPublicKey, bp, rsa); -} - -int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa) -{ - return ASN1_i2d_bio_of_const(RSA, i2d_RSA_PUBKEY, bp, rsa); -} - -#ifndef OPENSSL_NO_DSA -# ifndef OPENSSL_NO_FP_API -DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa) -{ - return ASN1_d2i_fp_of(DSA, DSA_new, d2i_DSAPrivateKey, fp, dsa); -} - -int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa) -{ - return ASN1_i2d_fp_of_const(DSA, i2d_DSAPrivateKey, fp, dsa); -} - -DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa) -{ - return ASN1_d2i_fp_of(DSA, DSA_new, d2i_DSA_PUBKEY, fp, dsa); -} - -int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa) -{ - return ASN1_i2d_fp_of_const(DSA, i2d_DSA_PUBKEY, fp, dsa); -} -# endif - -DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa) -{ - return ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSAPrivateKey, bp, dsa); -} - -int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa) -{ - return ASN1_i2d_bio_of_const(DSA, i2d_DSAPrivateKey, bp, dsa); -} - -DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa) -{ - return ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSA_PUBKEY, bp, dsa); -} - -int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa) -{ - return ASN1_i2d_bio_of_const(DSA, i2d_DSA_PUBKEY, bp, dsa); -} - -#endif - -#ifndef OPENSSL_NO_FP_API -EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey) -{ - return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, fp, eckey); -} - -int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey) -{ - return ASN1_i2d_fp_of_const(EC_KEY, i2d_EC_PUBKEY, fp, eckey); -} - -EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey) -{ - return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, fp, eckey); -} - -int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey) -{ - return ASN1_i2d_fp_of_const(EC_KEY, i2d_ECPrivateKey, fp, eckey); -} -#endif -EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey) -{ - return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, bp, eckey); -} - -int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *ecdsa) -{ - return ASN1_i2d_bio_of_const(EC_KEY, i2d_EC_PUBKEY, bp, ecdsa); -} - -EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey) -{ - return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, bp, eckey); -} - -int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey) -{ - return ASN1_i2d_bio_of_const(EC_KEY, i2d_ECPrivateKey, bp, eckey); -} - -int X509_pubkey_digest(const X509 *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - ASN1_BIT_STRING *key; - key = X509_get0_pubkey_bitstr(data); - if (!key) - return 0; - return EVP_Digest(key->data, key->length, md, len, type, NULL); -} - -int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, - unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509), type, (char *)data, md, len)); -} - -int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509_CRL), type, (char *)data, md, len)); -} - -int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509_REQ), type, (char *)data, md, len)); -} - -int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509_NAME), type, (char *)data, md, len)); -} - -#ifndef OPENSSL_NO_FP_API -X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8) -{ - return ASN1_d2i_fp_of(X509_SIG, X509_SIG_new, d2i_X509_SIG, fp, p8); -} - -int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8) -{ - return ASN1_i2d_fp_of(X509_SIG, i2d_X509_SIG, fp, p8); -} -#endif - -X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8) -{ - return ASN1_d2i_bio_of(X509_SIG, X509_SIG_new, d2i_X509_SIG, bp, p8); -} - -int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8) -{ - return ASN1_i2d_bio_of(X509_SIG, i2d_X509_SIG, bp, p8); -} - -#ifndef OPENSSL_NO_FP_API -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, - PKCS8_PRIV_KEY_INFO **p8inf) -{ - return ASN1_d2i_fp_of(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_new, - d2i_PKCS8_PRIV_KEY_INFO, fp, p8inf); -} - -int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf) -{ - return ASN1_i2d_fp_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, fp, - p8inf); -} - -int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key) -{ - PKCS8_PRIV_KEY_INFO *p8inf; - int ret; - p8inf = EVP_PKEY2PKCS8(key); - if (!p8inf) - return 0; - ret = i2d_PKCS8_PRIV_KEY_INFO_fp(fp, p8inf); - PKCS8_PRIV_KEY_INFO_free(p8inf); - return ret; -} - -int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey) -{ - return ASN1_i2d_fp_of_const(EVP_PKEY, i2d_PrivateKey, fp, pkey); -} - -EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a) -{ - return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, fp, a); -} - -int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey) -{ - return ASN1_i2d_fp_of_const(EVP_PKEY, i2d_PUBKEY, fp, pkey); -} - -EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a) -{ - return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, fp, a); -} - -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, - PKCS8_PRIV_KEY_INFO **p8inf) -{ - return ASN1_d2i_bio_of(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_new, - d2i_PKCS8_PRIV_KEY_INFO, bp, p8inf); -} - -int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf) -{ - return ASN1_i2d_bio_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, bp, - p8inf); -} - -int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key) -{ - PKCS8_PRIV_KEY_INFO *p8inf; - int ret; - p8inf = EVP_PKEY2PKCS8(key); - if (!p8inf) - return 0; - ret = i2d_PKCS8_PRIV_KEY_INFO_bio(bp, p8inf); - PKCS8_PRIV_KEY_INFO_free(p8inf); - return ret; -} -#endif - -int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey) -{ - return ASN1_i2d_bio_of_const(EVP_PKEY, i2d_PrivateKey, bp, pkey); -} - -EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a) -{ - return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, bp, a); -} - -int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey) -{ - return ASN1_i2d_bio_of_const(EVP_PKEY, i2d_PUBKEY, bp, pkey); -} - -EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a) -{ - return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, bp, a); -} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_all.c.grpc_back b/Pods/BoringSSL-GRPC/crypto/x509/x_all.c.grpc_back deleted file mode 100644 index c430a7d31..000000000 --- a/Pods/BoringSSL-GRPC/crypto/x509/x_all.c.grpc_back +++ /dev/null @@ -1,501 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include -#include -#include -#include -#include -#include -#include -#include - -int X509_verify(X509 *a, EVP_PKEY *r) -{ - if (X509_ALGOR_cmp(a->sig_alg, a->cert_info->signature)) - return 0; - return (ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF), a->sig_alg, - a->signature, a->cert_info, r)); -} - -int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) -{ - return (ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO), - a->sig_alg, a->signature, a->req_info, r)); -} - -int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - x->cert_info->enc.modified = 1; - return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature, - x->sig_alg, x->signature, x->cert_info, pkey, md)); -} - -int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx) -{ - x->cert_info->enc.modified = 1; - return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CINF), - x->cert_info->signature, - x->sig_alg, x->signature, x->cert_info, ctx); -} - -int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - return (ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO), x->sig_alg, NULL, - x->signature, x->req_info, pkey, md)); -} - -int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx) -{ - return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_REQ_INFO), - x->sig_alg, NULL, x->signature, x->req_info, - ctx); -} - -int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - x->crl->enc.modified = 1; - return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CRL_INFO), x->crl->sig_alg, - x->sig_alg, x->signature, x->crl, pkey, md)); -} - -int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx) -{ - x->crl->enc.modified = 1; - return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CRL_INFO), - x->crl->sig_alg, x->sig_alg, x->signature, - x->crl, ctx); -} - -int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) -{ - return (ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, NULL, - x->signature, x->spkac, pkey, md)); -} - -int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *x, EVP_PKEY *pkey) -{ - return (ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, - x->signature, x->spkac, pkey)); -} - -#ifndef OPENSSL_NO_FP_API -X509 *d2i_X509_fp(FILE *fp, X509 **x509) -{ - return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509), fp, x509); -} - -int i2d_X509_fp(FILE *fp, X509 *x509) -{ - return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509), fp, x509); -} -#endif - -X509 *d2i_X509_bio(BIO *bp, X509 **x509) -{ - return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), bp, x509); -} - -int i2d_X509_bio(BIO *bp, X509 *x509) -{ - return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509); -} - -#ifndef OPENSSL_NO_FP_API -X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl) -{ - return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); -} - -int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) -{ - return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); -} -#endif - -X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl) -{ - return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); -} - -int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) -{ - return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); -} - -#ifndef OPENSSL_NO_FP_API -X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req) -{ - return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); -} - -int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) -{ - return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); -} -#endif - -X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req) -{ - return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); -} - -int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) -{ - return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); -} - -#ifndef OPENSSL_NO_FP_API -RSA *d2i_RSAPrivateKey_fp(FILE *fp, RSA **rsa) -{ - return ASN1_d2i_fp_of(RSA, RSA_new, d2i_RSAPrivateKey, fp, rsa); -} - -int i2d_RSAPrivateKey_fp(FILE *fp, RSA *rsa) -{ - return ASN1_i2d_fp_of_const(RSA, i2d_RSAPrivateKey, fp, rsa); -} - -RSA *d2i_RSAPublicKey_fp(FILE *fp, RSA **rsa) -{ - return ASN1_d2i_fp_of(RSA, RSA_new, d2i_RSAPublicKey, fp, rsa); -} - -RSA *d2i_RSA_PUBKEY_fp(FILE *fp, RSA **rsa) -{ - return ASN1_d2i_fp((void *(*)(void)) - RSA_new, (D2I_OF(void)) d2i_RSA_PUBKEY, fp, - (void **)rsa); -} - -int i2d_RSAPublicKey_fp(FILE *fp, RSA *rsa) -{ - return ASN1_i2d_fp_of_const(RSA, i2d_RSAPublicKey, fp, rsa); -} - -int i2d_RSA_PUBKEY_fp(FILE *fp, RSA *rsa) -{ - return ASN1_i2d_fp((I2D_OF_const(void))i2d_RSA_PUBKEY, fp, rsa); -} -#endif - -RSA *d2i_RSAPrivateKey_bio(BIO *bp, RSA **rsa) -{ - return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSAPrivateKey, bp, rsa); -} - -int i2d_RSAPrivateKey_bio(BIO *bp, RSA *rsa) -{ - return ASN1_i2d_bio_of_const(RSA, i2d_RSAPrivateKey, bp, rsa); -} - -RSA *d2i_RSAPublicKey_bio(BIO *bp, RSA **rsa) -{ - return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSAPublicKey, bp, rsa); -} - -RSA *d2i_RSA_PUBKEY_bio(BIO *bp, RSA **rsa) -{ - return ASN1_d2i_bio_of(RSA, RSA_new, d2i_RSA_PUBKEY, bp, rsa); -} - -int i2d_RSAPublicKey_bio(BIO *bp, RSA *rsa) -{ - return ASN1_i2d_bio_of_const(RSA, i2d_RSAPublicKey, bp, rsa); -} - -int i2d_RSA_PUBKEY_bio(BIO *bp, RSA *rsa) -{ - return ASN1_i2d_bio_of_const(RSA, i2d_RSA_PUBKEY, bp, rsa); -} - -#ifndef OPENSSL_NO_DSA -# ifndef OPENSSL_NO_FP_API -DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa) -{ - return ASN1_d2i_fp_of(DSA, DSA_new, d2i_DSAPrivateKey, fp, dsa); -} - -int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa) -{ - return ASN1_i2d_fp_of_const(DSA, i2d_DSAPrivateKey, fp, dsa); -} - -DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa) -{ - return ASN1_d2i_fp_of(DSA, DSA_new, d2i_DSA_PUBKEY, fp, dsa); -} - -int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa) -{ - return ASN1_i2d_fp_of_const(DSA, i2d_DSA_PUBKEY, fp, dsa); -} -# endif - -DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa) -{ - return ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSAPrivateKey, bp, dsa); -} - -int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa) -{ - return ASN1_i2d_bio_of_const(DSA, i2d_DSAPrivateKey, bp, dsa); -} - -DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa) -{ - return ASN1_d2i_bio_of(DSA, DSA_new, d2i_DSA_PUBKEY, bp, dsa); -} - -int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa) -{ - return ASN1_i2d_bio_of_const(DSA, i2d_DSA_PUBKEY, bp, dsa); -} - -#endif - -#ifndef OPENSSL_NO_FP_API -EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey) -{ - return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, fp, eckey); -} - -int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey) -{ - return ASN1_i2d_fp_of_const(EC_KEY, i2d_EC_PUBKEY, fp, eckey); -} - -EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey) -{ - return ASN1_d2i_fp_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, fp, eckey); -} - -int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey) -{ - return ASN1_i2d_fp_of_const(EC_KEY, i2d_ECPrivateKey, fp, eckey); -} -#endif -EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey) -{ - return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_EC_PUBKEY, bp, eckey); -} - -int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *ecdsa) -{ - return ASN1_i2d_bio_of_const(EC_KEY, i2d_EC_PUBKEY, bp, ecdsa); -} - -EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey) -{ - return ASN1_d2i_bio_of(EC_KEY, EC_KEY_new, d2i_ECPrivateKey, bp, eckey); -} - -int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey) -{ - return ASN1_i2d_bio_of_const(EC_KEY, i2d_ECPrivateKey, bp, eckey); -} - -int X509_pubkey_digest(const X509 *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - ASN1_BIT_STRING *key; - key = X509_get0_pubkey_bitstr(data); - if (!key) - return 0; - return EVP_Digest(key->data, key->length, md, len, type, NULL); -} - -int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, - unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509), type, (char *)data, md, len)); -} - -int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509_CRL), type, (char *)data, md, len)); -} - -int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509_REQ), type, (char *)data, md, len)); -} - -int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, - unsigned char *md, unsigned int *len) -{ - return (ASN1_item_digest - (ASN1_ITEM_rptr(X509_NAME), type, (char *)data, md, len)); -} - -#ifndef OPENSSL_NO_FP_API -X509_SIG *d2i_PKCS8_fp(FILE *fp, X509_SIG **p8) -{ - return ASN1_d2i_fp_of(X509_SIG, X509_SIG_new, d2i_X509_SIG, fp, p8); -} - -int i2d_PKCS8_fp(FILE *fp, X509_SIG *p8) -{ - return ASN1_i2d_fp_of(X509_SIG, i2d_X509_SIG, fp, p8); -} -#endif - -X509_SIG *d2i_PKCS8_bio(BIO *bp, X509_SIG **p8) -{ - return ASN1_d2i_bio_of(X509_SIG, X509_SIG_new, d2i_X509_SIG, bp, p8); -} - -int i2d_PKCS8_bio(BIO *bp, X509_SIG *p8) -{ - return ASN1_i2d_bio_of(X509_SIG, i2d_X509_SIG, bp, p8); -} - -#ifndef OPENSSL_NO_FP_API -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, - PKCS8_PRIV_KEY_INFO **p8inf) -{ - return ASN1_d2i_fp_of(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_new, - d2i_PKCS8_PRIV_KEY_INFO, fp, p8inf); -} - -int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, PKCS8_PRIV_KEY_INFO *p8inf) -{ - return ASN1_i2d_fp_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, fp, - p8inf); -} - -int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key) -{ - PKCS8_PRIV_KEY_INFO *p8inf; - int ret; - p8inf = EVP_PKEY2PKCS8(key); - if (!p8inf) - return 0; - ret = i2d_PKCS8_PRIV_KEY_INFO_fp(fp, p8inf); - PKCS8_PRIV_KEY_INFO_free(p8inf); - return ret; -} - -int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey) -{ - return ASN1_i2d_fp_of_const(EVP_PKEY, i2d_PrivateKey, fp, pkey); -} - -EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a) -{ - return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, fp, a); -} - -int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey) -{ - return ASN1_i2d_fp_of_const(EVP_PKEY, i2d_PUBKEY, fp, pkey); -} - -EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a) -{ - return ASN1_d2i_fp_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, fp, a); -} - -PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, - PKCS8_PRIV_KEY_INFO **p8inf) -{ - return ASN1_d2i_bio_of(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_new, - d2i_PKCS8_PRIV_KEY_INFO, bp, p8inf); -} - -int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, PKCS8_PRIV_KEY_INFO *p8inf) -{ - return ASN1_i2d_bio_of(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO, bp, - p8inf); -} - -int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key) -{ - PKCS8_PRIV_KEY_INFO *p8inf; - int ret; - p8inf = EVP_PKEY2PKCS8(key); - if (!p8inf) - return 0; - ret = i2d_PKCS8_PRIV_KEY_INFO_bio(bp, p8inf); - PKCS8_PRIV_KEY_INFO_free(p8inf); - return ret; -} -#endif - -int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey) -{ - return ASN1_i2d_bio_of_const(EVP_PKEY, i2d_PrivateKey, bp, pkey); -} - -EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a) -{ - return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_AutoPrivateKey, bp, a); -} - -int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey) -{ - return ASN1_i2d_bio_of_const(EVP_PKEY, i2d_PUBKEY, bp, pkey); -} - -EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a) -{ - return ASN1_d2i_bio_of(EVP_PKEY, EVP_PKEY_new, d2i_PUBKEY, bp, a); -} diff --git a/Pods/BoringSSL-GRPC/err_data.c b/Pods/BoringSSL-GRPC/err_data.c index 54e7086c6..dce06bed0 100644 --- a/Pods/BoringSSL-GRPC/err_data.c +++ b/Pods/BoringSSL-GRPC/err_data.c @@ -1,1341 +1,1407 @@ - /* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - /* This file was generated by err_data_generate.go. */ + /* This file was generated by err_data_generate.go. */ - #include - #include - #include +#include +#include +#include - OPENSSL_COMPILE_ASSERT(ERR_LIB_NONE == 1, library_values_changed_1); - OPENSSL_COMPILE_ASSERT(ERR_LIB_SYS == 2, library_values_changed_2); - OPENSSL_COMPILE_ASSERT(ERR_LIB_BN == 3, library_values_changed_3); - OPENSSL_COMPILE_ASSERT(ERR_LIB_RSA == 4, library_values_changed_4); - OPENSSL_COMPILE_ASSERT(ERR_LIB_DH == 5, library_values_changed_5); - OPENSSL_COMPILE_ASSERT(ERR_LIB_EVP == 6, library_values_changed_6); - OPENSSL_COMPILE_ASSERT(ERR_LIB_BUF == 7, library_values_changed_7); - OPENSSL_COMPILE_ASSERT(ERR_LIB_OBJ == 8, library_values_changed_8); - OPENSSL_COMPILE_ASSERT(ERR_LIB_PEM == 9, library_values_changed_9); - OPENSSL_COMPILE_ASSERT(ERR_LIB_DSA == 10, library_values_changed_10); - OPENSSL_COMPILE_ASSERT(ERR_LIB_X509 == 11, library_values_changed_11); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ASN1 == 12, library_values_changed_12); - OPENSSL_COMPILE_ASSERT(ERR_LIB_CONF == 13, library_values_changed_13); - OPENSSL_COMPILE_ASSERT(ERR_LIB_CRYPTO == 14, library_values_changed_14); - OPENSSL_COMPILE_ASSERT(ERR_LIB_EC == 15, library_values_changed_15); - OPENSSL_COMPILE_ASSERT(ERR_LIB_SSL == 16, library_values_changed_16); - OPENSSL_COMPILE_ASSERT(ERR_LIB_BIO == 17, library_values_changed_17); - OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS7 == 18, library_values_changed_18); - OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS8 == 19, library_values_changed_19); - OPENSSL_COMPILE_ASSERT(ERR_LIB_X509V3 == 20, library_values_changed_20); - OPENSSL_COMPILE_ASSERT(ERR_LIB_RAND == 21, library_values_changed_21); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ENGINE == 22, library_values_changed_22); - OPENSSL_COMPILE_ASSERT(ERR_LIB_OCSP == 23, library_values_changed_23); - OPENSSL_COMPILE_ASSERT(ERR_LIB_UI == 24, library_values_changed_24); - OPENSSL_COMPILE_ASSERT(ERR_LIB_COMP == 25, library_values_changed_25); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDSA == 26, library_values_changed_26); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDH == 27, library_values_changed_27); - OPENSSL_COMPILE_ASSERT(ERR_LIB_HMAC == 28, library_values_changed_28); - OPENSSL_COMPILE_ASSERT(ERR_LIB_DIGEST == 29, library_values_changed_29); - OPENSSL_COMPILE_ASSERT(ERR_LIB_CIPHER == 30, library_values_changed_30); - OPENSSL_COMPILE_ASSERT(ERR_LIB_HKDF == 31, library_values_changed_31); - OPENSSL_COMPILE_ASSERT(ERR_LIB_USER == 32, library_values_changed_32); - OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == 33, library_values_changed_num); +OPENSSL_STATIC_ASSERT(ERR_LIB_NONE == 1, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_SYS == 2, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_BN == 3, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_RSA == 4, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_DH == 5, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_EVP == 6, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_BUF == 7, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_OBJ == 8, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_PEM == 9, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_DSA == 10, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_X509 == 11, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ASN1 == 12, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_CONF == 13, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_CRYPTO == 14, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_EC == 15, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_SSL == 16, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_BIO == 17, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS7 == 18, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS8 == 19, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_X509V3 == 20, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_RAND == 21, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ENGINE == 22, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_OCSP == 23, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_UI == 24, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_COMP == 25, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ECDSA == 26, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ECDH == 27, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_HMAC == 28, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_DIGEST == 29, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_CIPHER == 30, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_HKDF == 31, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_USER == 32, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_NUM_LIBS == 33, "number of libraries changed"); - const uint32_t kOpenSSLReasonValues[] = { - 0xc320838, - 0xc328852, - 0xc330861, - 0xc338871, - 0xc340880, - 0xc348899, - 0xc3508a5, - 0xc3588c2, - 0xc3608e2, - 0xc3688f0, - 0xc370900, - 0xc37890d, - 0xc38091d, - 0xc388928, - 0xc39093e, - 0xc39894d, - 0xc3a0961, - 0xc3a8845, - 0xc3b00ea, - 0xc3b88d4, - 0x10320845, - 0x10329513, - 0x1033151f, - 0x10339538, - 0x1034154b, - 0x10348eed, - 0x10350c5e, - 0x1035955e, - 0x10361573, - 0x10369586, - 0x103715a5, - 0x103795be, - 0x103815d3, - 0x103895f1, - 0x10391600, - 0x1039961c, - 0x103a1637, - 0x103a9646, - 0x103b1662, - 0x103b967d, - 0x103c1694, - 0x103c80ea, - 0x103d16a5, - 0x103d96b9, - 0x103e16d8, - 0x103e96e7, - 0x103f16fe, - 0x103f9711, - 0x10400c22, - 0x10409724, - 0x10411742, - 0x10419755, - 0x1042176f, - 0x1042977f, - 0x10431793, - 0x104397a9, - 0x104417c1, - 0x104497d6, - 0x104517ea, - 0x104597fc, - 0x104605fb, - 0x1046894d, - 0x10471811, - 0x10479828, - 0x1048183d, - 0x1048984b, - 0x10490e4f, - 0x14320c05, - 0x14328c13, - 0x14330c22, - 0x14338c34, - 0x143400ac, - 0x143480ea, - 0x18320083, - 0x18328f43, - 0x183300ac, - 0x18338f59, - 0x18340f6d, - 0x183480ea, - 0x18350f82, - 0x18358f9a, - 0x18360faf, - 0x18368fc3, - 0x18370fe7, - 0x18378ffd, - 0x18381011, - 0x18389021, - 0x18390a73, - 0x18399031, - 0x183a1059, - 0x183a907f, - 0x183b0c6a, - 0x183b90b4, - 0x183c10c6, - 0x183c90d1, - 0x183d10e1, - 0x183d90f2, - 0x183e1103, - 0x183e9115, - 0x183f113e, - 0x183f9157, - 0x1840116f, - 0x184086d3, - 0x184110a2, - 0x1841906d, - 0x1842108c, - 0x18429046, - 0x20321196, - 0x243211a2, - 0x24328993, - 0x243311b4, - 0x243391c1, - 0x243411ce, - 0x243491e0, - 0x243511ef, - 0x2435920c, - 0x24361219, - 0x24369227, - 0x24371235, - 0x24379243, - 0x2438124c, - 0x24389259, - 0x2439126c, - 0x28320c52, - 0x28328c6a, - 0x28330c22, - 0x28338c7d, - 0x28340c5e, - 0x283480ac, - 0x283500ea, - 0x2c322c30, - 0x2c329283, - 0x2c332c3e, - 0x2c33ac50, - 0x2c342c64, - 0x2c34ac76, - 0x2c352c91, - 0x2c35aca3, - 0x2c362cb6, - 0x2c36832d, - 0x2c372cc3, - 0x2c37acd5, - 0x2c382cfa, - 0x2c38ad11, - 0x2c392d1f, - 0x2c39ad2f, - 0x2c3a2d41, - 0x2c3aad55, - 0x2c3b2d66, - 0x2c3bad85, - 0x2c3c1295, - 0x2c3c92ab, - 0x2c3d2d99, - 0x2c3d92c4, - 0x2c3e2db6, - 0x2c3eadc4, - 0x2c3f2ddc, - 0x2c3fadf4, - 0x2c402e01, - 0x2c409196, - 0x2c412e12, - 0x2c41ae25, - 0x2c42116f, - 0x2c42ae36, - 0x2c430720, - 0x2c43ad77, - 0x2c442ce8, - 0x30320000, - 0x30328015, - 0x3033001f, - 0x30338038, - 0x3034004a, - 0x30348064, - 0x3035006b, - 0x30358083, - 0x30360094, - 0x303680ac, - 0x303700b9, - 0x303780c8, - 0x303800ea, - 0x303880f7, - 0x3039010a, - 0x30398125, - 0x303a013a, - 0x303a814e, - 0x303b0162, - 0x303b8173, - 0x303c018c, - 0x303c81a9, - 0x303d01b7, - 0x303d81cb, - 0x303e01db, - 0x303e81f4, - 0x303f0204, - 0x303f8217, - 0x30400226, - 0x30408232, - 0x30410247, - 0x30418257, - 0x3042026e, - 0x3042827b, - 0x3043028e, - 0x3043829d, - 0x304402b2, - 0x304482d3, - 0x304502e6, - 0x304582f9, - 0x30460312, - 0x3046832d, - 0x3047034a, - 0x30478363, - 0x30480371, - 0x30488382, - 0x30490391, - 0x304983a9, - 0x304a03bb, - 0x304a83cf, - 0x304b03ee, - 0x304b8401, - 0x304c040c, - 0x304c841d, - 0x304d0429, - 0x304d843f, - 0x304e044d, - 0x304e8463, - 0x304f0475, - 0x304f8487, - 0x3050049a, - 0x305084ad, - 0x305104be, - 0x305184ce, - 0x305204e6, - 0x305284fb, - 0x30530513, - 0x30538527, - 0x3054053f, - 0x30548558, - 0x30550571, - 0x3055858e, - 0x30560599, - 0x305685b1, - 0x305705c1, - 0x305785d2, - 0x305805e5, - 0x305885fb, - 0x30590604, - 0x30598619, - 0x305a062c, - 0x305a863b, - 0x305b065b, - 0x305b866a, - 0x305c068b, - 0x305c86a7, - 0x305d06b3, - 0x305d86d3, - 0x305e06ef, - 0x305e8700, - 0x305f0716, - 0x305f8720, - 0x34320b63, - 0x34328b77, - 0x34330b94, - 0x34338ba7, - 0x34340bb6, - 0x34348bef, - 0x34350bd3, - 0x3c320083, - 0x3c328ca7, - 0x3c330cc0, - 0x3c338cdb, - 0x3c340cf8, - 0x3c348d22, - 0x3c350d3d, - 0x3c358d63, - 0x3c360d7c, - 0x3c368d94, - 0x3c370da5, - 0x3c378db3, - 0x3c380dc0, - 0x3c388dd4, - 0x3c390c6a, - 0x3c398de8, - 0x3c3a0dfc, - 0x3c3a890d, - 0x3c3b0e0c, - 0x3c3b8e27, - 0x3c3c0e39, - 0x3c3c8e6c, - 0x3c3d0e76, - 0x3c3d8e8a, - 0x3c3e0e98, - 0x3c3e8ebd, - 0x3c3f0c93, - 0x3c3f8ea6, - 0x3c4000ac, - 0x3c4080ea, - 0x3c410d13, - 0x3c418d52, - 0x3c420e4f, - 0x403218a4, - 0x403298ba, - 0x403318e8, - 0x403398f2, - 0x40341909, - 0x40349927, - 0x40351937, - 0x40359949, - 0x40361956, - 0x40369962, - 0x40371977, - 0x40379989, - 0x40381994, - 0x403899a6, - 0x40390eed, - 0x403999b6, - 0x403a19c9, - 0x403a99ea, - 0x403b19fb, - 0x403b9a0b, - 0x403c0064, - 0x403c8083, - 0x403d1a8f, - 0x403d9aa5, - 0x403e1ab4, - 0x403e9aec, - 0x403f1b06, - 0x403f9b14, - 0x40401b29, - 0x40409b3d, - 0x40411b5a, - 0x40419b75, - 0x40421b8e, - 0x40429ba1, - 0x40431bb5, - 0x40439bcd, - 0x40441be4, - 0x404480ac, - 0x40451bf9, - 0x40459c0b, - 0x40461c2f, - 0x40469c4f, - 0x40471c5d, - 0x40479c84, - 0x40481cc1, - 0x40489cda, - 0x40491cf1, - 0x40499d0b, - 0x404a1d22, - 0x404a9d40, - 0x404b1d58, - 0x404b9d6f, - 0x404c1d85, - 0x404c9d97, - 0x404d1db8, - 0x404d9dda, - 0x404e1dee, - 0x404e9dfb, - 0x404f1e28, - 0x404f9e51, - 0x40501e8c, - 0x40509ea0, - 0x40511ebb, - 0x40521ecb, - 0x40529eef, - 0x40531f07, - 0x40539f1a, - 0x40541f2f, - 0x40549f52, - 0x40551f60, - 0x40559f7d, - 0x40561f8a, - 0x40569fa3, - 0x40571fbb, - 0x40579fce, - 0x40581fe3, - 0x4058a00a, - 0x40592039, - 0x4059a066, - 0x405a207a, - 0x405aa08a, - 0x405b20a2, - 0x405ba0b3, - 0x405c20c6, - 0x405ca105, - 0x405d2112, - 0x405da129, - 0x405e2167, - 0x405e8ab1, - 0x405f2188, - 0x405fa195, - 0x406021a3, - 0x4060a1c5, - 0x40612209, - 0x4061a241, - 0x40622258, - 0x4062a269, - 0x4063227a, - 0x4063a28f, - 0x406422a6, - 0x4064a2d2, - 0x406522ed, - 0x4065a304, - 0x4066231c, - 0x4066a346, - 0x40672371, - 0x4067a392, - 0x406823b9, - 0x4068a3da, - 0x4069240c, - 0x4069a43a, - 0x406a245b, - 0x406aa47b, - 0x406b2603, - 0x406ba626, - 0x406c263c, - 0x406ca8b7, - 0x406d28e6, - 0x406da90e, - 0x406e293c, - 0x406ea989, - 0x406f29a8, - 0x406fa9e0, - 0x407029f3, - 0x4070aa10, - 0x40710800, - 0x4071aa22, - 0x40722a35, - 0x4072aa4e, - 0x40732a66, - 0x40739482, - 0x40742a7a, - 0x4074aa94, - 0x40752aa5, - 0x4075aab9, - 0x40762ac7, - 0x40769259, - 0x40772aec, - 0x4077ab0e, - 0x40782b29, - 0x4078ab62, - 0x40792b79, - 0x4079ab8f, - 0x407a2b9b, - 0x407aabae, - 0x407b2bc3, - 0x407babd5, - 0x407c2c06, - 0x407cac0f, - 0x407d23f5, - 0x407d9e61, - 0x407e2b3e, - 0x407ea01a, - 0x407f1c71, - 0x407f9a31, - 0x40801e38, - 0x40809c99, - 0x40811edd, - 0x40819e12, - 0x40822927, - 0x40829a17, - 0x40831ff5, - 0x4083a2b7, - 0x40841cad, - 0x4084a052, - 0x408520d7, - 0x4085a1ed, - 0x40862149, - 0x40869e7b, - 0x4087296d, - 0x4087a21e, - 0x40881a78, - 0x4088a3a5, - 0x40891ac7, - 0x40899a54, - 0x408a265c, - 0x408a9862, - 0x408b2bea, - 0x408ba9bd, - 0x408c20e7, - 0x408c987e, - 0x41f4252e, - 0x41f925c0, - 0x41fe24b3, - 0x41fea6a8, - 0x41ff2799, - 0x42032547, - 0x42082569, - 0x4208a5a5, - 0x42092497, - 0x4209a5df, - 0x420a24ee, - 0x420aa4ce, - 0x420b250e, - 0x420ba587, - 0x420c27b5, - 0x420ca675, - 0x420d268f, - 0x420da6c6, - 0x421226e0, - 0x4217277c, - 0x4217a722, - 0x421c2744, - 0x421f26ff, - 0x422127cc, - 0x4226275f, - 0x422b289b, - 0x422ba849, - 0x422c2883, - 0x422ca808, - 0x422d27e7, - 0x422da868, - 0x422e282e, - 0x422ea954, - 0x4432072b, - 0x4432873a, - 0x44330746, - 0x44338754, - 0x44340767, - 0x44348778, - 0x4435077f, - 0x44358789, - 0x4436079c, - 0x443687b2, - 0x443707c4, - 0x443787d1, - 0x443807e0, - 0x443887e8, - 0x44390800, - 0x4439880e, - 0x443a0821, - 0x48321283, - 0x48329295, - 0x483312ab, - 0x483392c4, - 0x4c3212e9, - 0x4c3292f9, - 0x4c33130c, - 0x4c33932c, - 0x4c3400ac, - 0x4c3480ea, - 0x4c351338, - 0x4c359346, - 0x4c361362, - 0x4c369375, - 0x4c371384, - 0x4c379392, - 0x4c3813a7, - 0x4c3893b3, - 0x4c3913d3, - 0x4c3993fd, - 0x4c3a1416, - 0x4c3a942f, - 0x4c3b05fb, - 0x4c3b9448, - 0x4c3c145a, - 0x4c3c9469, - 0x4c3d1482, - 0x4c3d8c45, - 0x4c3e14db, - 0x4c3e9491, - 0x4c3f14fd, - 0x4c3f9259, - 0x4c4014a7, - 0x4c4092d5, - 0x4c4114cb, - 0x50322e48, - 0x5032ae57, - 0x50332e62, - 0x5033ae72, - 0x50342e8b, - 0x5034aea5, - 0x50352eb3, - 0x5035aec9, - 0x50362edb, - 0x5036aef1, - 0x50372f0a, - 0x5037af1d, - 0x50382f35, - 0x5038af46, - 0x50392f5b, - 0x5039af6f, - 0x503a2f8f, - 0x503aafa5, - 0x503b2fbd, - 0x503bafcf, - 0x503c2feb, - 0x503cb002, - 0x503d301b, - 0x503db031, - 0x503e303e, - 0x503eb054, - 0x503f3066, - 0x503f8382, - 0x50403079, - 0x5040b089, - 0x504130a3, - 0x5041b0b2, - 0x504230cc, - 0x5042b0e9, - 0x504330f9, - 0x5043b109, - 0x50443118, - 0x5044843f, - 0x5045312c, - 0x5045b14a, - 0x5046315d, - 0x5046b173, - 0x50473185, - 0x5047b19a, - 0x504831c0, - 0x5048b1ce, - 0x504931e1, - 0x5049b1f6, - 0x504a320c, - 0x504ab21c, - 0x504b323c, - 0x504bb24f, - 0x504c3272, - 0x504cb2a0, - 0x504d32b2, - 0x504db2cf, - 0x504e32ea, - 0x504eb306, - 0x504f3318, - 0x504fb32f, - 0x5050333e, - 0x505086ef, - 0x50513351, - 0x58320f2b, - 0x68320eed, - 0x68328c6a, - 0x68330c7d, - 0x68338efb, - 0x68340f0b, - 0x683480ea, - 0x6c320ec9, - 0x6c328c34, - 0x6c330ed4, - 0x74320a19, - 0x743280ac, - 0x74330c45, - 0x7832097e, - 0x78328993, - 0x7833099f, - 0x78338083, - 0x783409ae, - 0x783489c3, - 0x783509e2, - 0x78358a04, - 0x78360a19, - 0x78368a2f, - 0x78370a3f, - 0x78378a60, - 0x78380a73, - 0x78388a85, - 0x78390a92, - 0x78398ab1, - 0x783a0ac6, - 0x783a8ad4, - 0x783b0ade, - 0x783b8af2, - 0x783c0b09, - 0x783c8b1e, - 0x783d0b35, - 0x783d8b4a, - 0x783e0aa0, - 0x783e8a52, - 0x7c321185, - }; +const uint32_t kOpenSSLReasonValues[] = { + 0xc32083a, + 0xc328854, + 0xc330863, + 0xc338873, + 0xc340882, + 0xc34889b, + 0xc3508a7, + 0xc3588c4, + 0xc3608e4, + 0xc3688f2, + 0xc370902, + 0xc37890f, + 0xc38091f, + 0xc38892a, + 0xc390940, + 0xc39894f, + 0xc3a0963, + 0xc3a8847, + 0xc3b00ea, + 0xc3b88d6, + 0x10320847, + 0x1032959f, + 0x103315ab, + 0x103395c4, + 0x103415d7, + 0x10348f27, + 0x10350c60, + 0x103595ea, + 0x10361614, + 0x10369627, + 0x10371646, + 0x1037965f, + 0x10381674, + 0x10389692, + 0x103916a1, + 0x103996bd, + 0x103a16d8, + 0x103a96e7, + 0x103b1703, + 0x103b971e, + 0x103c1744, + 0x103c80ea, + 0x103d1755, + 0x103d9769, + 0x103e1788, + 0x103e9797, + 0x103f17ae, + 0x103f97c1, + 0x10400c24, + 0x104097d4, + 0x104117f2, + 0x10419805, + 0x1042181f, + 0x1042982f, + 0x10431843, + 0x10439859, + 0x10441871, + 0x10449886, + 0x1045189a, + 0x104598ac, + 0x104605fd, + 0x1046894f, + 0x104718c1, + 0x104798d8, + 0x104818ed, + 0x104898fb, + 0x10490e73, + 0x10499735, + 0x104a15ff, + 0x14320c07, + 0x14328c15, + 0x14330c24, + 0x14338c36, + 0x143400ac, + 0x143480ea, + 0x18320083, + 0x18328f7d, + 0x183300ac, + 0x18338f93, + 0x18340fa7, + 0x183480ea, + 0x18350fbc, + 0x18358fd4, + 0x18360fe9, + 0x18368ffd, + 0x18371021, + 0x18379037, + 0x1838104b, + 0x1838905b, + 0x18390a75, + 0x1839906b, + 0x183a1091, + 0x183a90b7, + 0x183b0c7f, + 0x183b9106, + 0x183c1118, + 0x183c9123, + 0x183d1133, + 0x183d9144, + 0x183e1155, + 0x183e9167, + 0x183f1190, + 0x183f91a9, + 0x184011c1, + 0x184086d5, + 0x184110da, + 0x184190a5, + 0x184210c4, + 0x18428c6c, + 0x18431080, + 0x184390ec, + 0x203211fb, + 0x203291e8, + 0x24321207, + 0x24328995, + 0x24331219, + 0x24339226, + 0x24341233, + 0x24349245, + 0x24351254, + 0x24359271, + 0x2436127e, + 0x2436928c, + 0x2437129a, + 0x243792a8, + 0x243812b1, + 0x243892be, + 0x243912d1, + 0x28320c54, + 0x28328c7f, + 0x28330c24, + 0x28338c92, + 0x28340c60, + 0x283480ac, + 0x283500ea, + 0x28358c6c, + 0x2c322f0c, + 0x2c3292e8, + 0x2c332f1a, + 0x2c33af2c, + 0x2c342f40, + 0x2c34af52, + 0x2c352f6d, + 0x2c35af7f, + 0x2c362f92, + 0x2c36832d, + 0x2c372f9f, + 0x2c37afb1, + 0x2c382fd6, + 0x2c38afed, + 0x2c392ffb, + 0x2c39b00b, + 0x2c3a301d, + 0x2c3ab031, + 0x2c3b3042, + 0x2c3bb061, + 0x2c3c12fa, + 0x2c3c9310, + 0x2c3d3075, + 0x2c3d9329, + 0x2c3e3092, + 0x2c3eb0a0, + 0x2c3f30b8, + 0x2c3fb0d0, + 0x2c4030fa, + 0x2c4091fb, + 0x2c41310b, + 0x2c41b11e, + 0x2c4211c1, + 0x2c42b12f, + 0x2c430722, + 0x2c43b053, + 0x2c442fc4, + 0x2c44b0dd, + 0x30320000, + 0x30328015, + 0x3033001f, + 0x30338038, + 0x3034004a, + 0x30348064, + 0x3035006b, + 0x30358083, + 0x30360094, + 0x303680ac, + 0x303700b9, + 0x303780c8, + 0x303800ea, + 0x303880f7, + 0x3039010a, + 0x30398125, + 0x303a013a, + 0x303a814e, + 0x303b0162, + 0x303b8173, + 0x303c018c, + 0x303c81a9, + 0x303d01b7, + 0x303d81cb, + 0x303e01db, + 0x303e81f4, + 0x303f0204, + 0x303f8217, + 0x30400226, + 0x30408232, + 0x30410247, + 0x30418257, + 0x3042026e, + 0x3042827b, + 0x3043028e, + 0x3043829d, + 0x304402b2, + 0x304482d3, + 0x304502e6, + 0x304582f9, + 0x30460312, + 0x3046832d, + 0x3047034a, + 0x3047835c, + 0x3048036a, + 0x3048837b, + 0x3049038a, + 0x304983a2, + 0x304a03b4, + 0x304a83c8, + 0x304b03e0, + 0x304b83f3, + 0x304c03fe, + 0x304c840f, + 0x304d041b, + 0x304d8431, + 0x304e043f, + 0x304e8455, + 0x304f0467, + 0x304f8479, + 0x3050049c, + 0x305084af, + 0x305104c0, + 0x305184d0, + 0x305204e8, + 0x305284fd, + 0x30530515, + 0x30538529, + 0x30540541, + 0x3054855a, + 0x30550573, + 0x30558590, + 0x3056059b, + 0x305685b3, + 0x305705c3, + 0x305785d4, + 0x305805e7, + 0x305885fd, + 0x30590606, + 0x3059861b, + 0x305a062e, + 0x305a863d, + 0x305b065d, + 0x305b866c, + 0x305c068d, + 0x305c86a9, + 0x305d06b5, + 0x305d86d5, + 0x305e06f1, + 0x305e8702, + 0x305f0718, + 0x305f8722, + 0x3060048c, + 0x34320b65, + 0x34328b79, + 0x34330b96, + 0x34338ba9, + 0x34340bb8, + 0x34348bf1, + 0x34350bd5, + 0x3c320083, + 0x3c328cbc, + 0x3c330cd5, + 0x3c338cf0, + 0x3c340d0d, + 0x3c348d37, + 0x3c350d52, + 0x3c358d78, + 0x3c360d91, + 0x3c368da9, + 0x3c370dba, + 0x3c378dc8, + 0x3c380dd5, + 0x3c388de9, + 0x3c390c7f, + 0x3c398e0c, + 0x3c3a0e20, + 0x3c3a890f, + 0x3c3b0e30, + 0x3c3b8e4b, + 0x3c3c0e5d, + 0x3c3c8e90, + 0x3c3d0e9a, + 0x3c3d8eae, + 0x3c3e0ebc, + 0x3c3e8ee1, + 0x3c3f0ca8, + 0x3c3f8eca, + 0x3c4000ac, + 0x3c4080ea, + 0x3c410d28, + 0x3c418d67, + 0x3c420e73, + 0x3c428dfd, + 0x40321971, + 0x40329987, + 0x403319b5, + 0x403399bf, + 0x403419d6, + 0x403499f4, + 0x40351a04, + 0x40359a16, + 0x40361a23, + 0x40369a2f, + 0x40371a44, + 0x40379a56, + 0x40381a61, + 0x40389a73, + 0x40390f27, + 0x40399a83, + 0x403a1a96, + 0x403a9ab7, + 0x403b1ac8, + 0x403b9ad8, + 0x403c0064, + 0x403c8083, + 0x403d1b5c, + 0x403d9b72, + 0x403e1b81, + 0x403e9bb9, + 0x403f1bd3, + 0x403f9bfb, + 0x40401c10, + 0x40409c24, + 0x40411c41, + 0x40419c5c, + 0x40421c75, + 0x40429c88, + 0x40431c9c, + 0x40439cb4, + 0x40441ccb, + 0x404480ac, + 0x40451ce0, + 0x40459cf2, + 0x40461d16, + 0x40469d36, + 0x40471d44, + 0x40479d6b, + 0x40481ddc, + 0x40489e0f, + 0x40491e26, + 0x40499e40, + 0x404a1e57, + 0x404a9e75, + 0x404b1e8d, + 0x404b9ea4, + 0x404c1eba, + 0x404c9ecc, + 0x404d1eed, + 0x404d9f26, + 0x404e1f3a, + 0x404e9f47, + 0x404f1f8e, + 0x404f9fd4, + 0x4050202b, + 0x4050a03f, + 0x40512072, + 0x40522082, + 0x4052a0a6, + 0x405320be, + 0x4053a0d1, + 0x405420e6, + 0x4054a109, + 0x40552117, + 0x4055a154, + 0x40562161, + 0x4056a17a, + 0x40572192, + 0x4057a1a5, + 0x405821ba, + 0x4058a1e1, + 0x40592210, + 0x4059a23d, + 0x405a2251, + 0x405aa261, + 0x405b2279, + 0x405ba28a, + 0x405c229d, + 0x405ca2dc, + 0x405d22e9, + 0x405da30e, + 0x405e234c, + 0x405e8ab3, + 0x405f236d, + 0x405fa37a, + 0x40602388, + 0x4060a3aa, + 0x4061240b, + 0x4061a443, + 0x4062245a, + 0x4062a46b, + 0x40632490, + 0x4063a4a5, + 0x406424bc, + 0x4064a4e8, + 0x40652503, + 0x4065a51a, + 0x40662532, + 0x4066a55c, + 0x40672587, + 0x4067a5cc, + 0x40682614, + 0x4068a635, + 0x40692667, + 0x4069a695, + 0x406a26b6, + 0x406aa6d6, + 0x406b285e, + 0x406ba881, + 0x406c2897, + 0x406cab3a, + 0x406d2b69, + 0x406dab91, + 0x406e2bbf, + 0x406eac0c, + 0x406f2c47, + 0x406fac7f, + 0x40702c92, + 0x4070acaf, + 0x40710802, + 0x4071acc1, + 0x40722cd4, + 0x4072ad0a, + 0x40732d22, + 0x407394fa, + 0x40742d36, + 0x4074ad50, + 0x40752d61, + 0x4075ad75, + 0x40762d83, + 0x407692be, + 0x40772da8, + 0x4077adca, + 0x40782de5, + 0x4078ae1e, + 0x40792e35, + 0x4079ae4b, + 0x407a2e77, + 0x407aae8a, + 0x407b2e9f, + 0x407baeb1, + 0x407c2ee2, + 0x407caeeb, + 0x407d2650, + 0x407d9fe4, + 0x407e2dfa, + 0x407ea1f1, + 0x407f1d58, + 0x407f9afe, + 0x40801f9e, + 0x40809d80, + 0x40812094, + 0x40819f78, + 0x40822baa, + 0x40829ae4, + 0x408321cc, + 0x4083a4cd, + 0x40841d94, + 0x4084a229, + 0x408522ae, + 0x4085a3d2, + 0x4086232e, + 0x40869ffe, + 0x40872bf0, + 0x4087a420, + 0x40881b45, + 0x4088a5df, + 0x40891b94, + 0x40899b21, + 0x408a28cf, + 0x408a9912, + 0x408b2ec6, + 0x408bac5c, + 0x408c22be, + 0x408c992e, + 0x408d1df5, + 0x408d9dc6, + 0x408e1f0f, + 0x408ea134, + 0x408f25f3, + 0x408fa3ee, + 0x409025a8, + 0x4090a300, + 0x409128b7, + 0x40919954, + 0x40921be1, + 0x4092ac2b, + 0x40932ced, + 0x4093a00f, + 0x40941da8, + 0x4094a8e8, + 0x4095247c, + 0x4095ae57, + 0x40962bd7, + 0x40969fb7, + 0x4097205a, + 0x40979f5e, + 0x41f42789, + 0x41f9281b, + 0x41fe270e, + 0x41fea92b, + 0x41ff2a1c, + 0x420327a2, + 0x420827c4, + 0x4208a800, + 0x420926f2, + 0x4209a83a, + 0x420a2749, + 0x420aa729, + 0x420b2769, + 0x420ba7e2, + 0x420c2a38, + 0x420ca8f8, + 0x420d2912, + 0x420da949, + 0x42122963, + 0x421729ff, + 0x4217a9a5, + 0x421c29c7, + 0x421f2982, + 0x42212a4f, + 0x422629e2, + 0x422b2b1e, + 0x422baacc, + 0x422c2b06, + 0x422caa8b, + 0x422d2a6a, + 0x422daaeb, + 0x422e2ab1, + 0x4432072d, + 0x4432873c, + 0x44330748, + 0x44338756, + 0x44340769, + 0x4434877a, + 0x44350781, + 0x4435878b, + 0x4436079e, + 0x443687b4, + 0x443707c6, + 0x443787d3, + 0x443807e2, + 0x443887ea, + 0x44390802, + 0x44398810, + 0x443a0823, + 0x483212e8, + 0x483292fa, + 0x48331310, + 0x48339329, + 0x4c32134e, + 0x4c32935e, + 0x4c331371, + 0x4c339391, + 0x4c3400ac, + 0x4c3480ea, + 0x4c35139d, + 0x4c3593ab, + 0x4c3613c7, + 0x4c3693ed, + 0x4c3713fc, + 0x4c37940a, + 0x4c38141f, + 0x4c38942b, + 0x4c39144b, + 0x4c399475, + 0x4c3a148e, + 0x4c3a94a7, + 0x4c3b05fd, + 0x4c3b94c0, + 0x4c3c14d2, + 0x4c3c94e1, + 0x4c3d14fa, + 0x4c3d8c47, + 0x4c3e1567, + 0x4c3e9509, + 0x4c3f1589, + 0x4c3f92be, + 0x4c40151f, + 0x4c40933a, + 0x4c411557, + 0x4c4193da, + 0x4c421543, + 0x50323141, + 0x5032b150, + 0x5033315b, + 0x5033b16b, + 0x50343184, + 0x5034b19e, + 0x503531ac, + 0x5035b1c2, + 0x503631d4, + 0x5036b1ea, + 0x50373203, + 0x5037b216, + 0x5038322e, + 0x5038b23f, + 0x50393254, + 0x5039b268, + 0x503a3288, + 0x503ab29e, + 0x503b32b6, + 0x503bb2c8, + 0x503c32e4, + 0x503cb2fb, + 0x503d3314, + 0x503db32a, + 0x503e3337, + 0x503eb34d, + 0x503f335f, + 0x503f837b, + 0x50403372, + 0x5040b382, + 0x5041339c, + 0x5041b3ab, + 0x504233c5, + 0x5042b3e2, + 0x504333f2, + 0x5043b402, + 0x50443411, + 0x50448431, + 0x50453425, + 0x5045b443, + 0x50463456, + 0x5046b46c, + 0x5047347e, + 0x5047b493, + 0x504834b9, + 0x5048b4c7, + 0x504934da, + 0x5049b4ef, + 0x504a3505, + 0x504ab515, + 0x504b3535, + 0x504bb548, + 0x504c356b, + 0x504cb599, + 0x504d35ab, + 0x504db5c8, + 0x504e35e3, + 0x504eb5ff, + 0x504f3611, + 0x504fb628, + 0x50503637, + 0x505086f1, + 0x5051364a, + 0x58320f65, + 0x68320f27, + 0x68328c7f, + 0x68330c92, + 0x68338f35, + 0x68340f45, + 0x683480ea, + 0x6c320eed, + 0x6c328c36, + 0x6c330ef8, + 0x6c338f11, + 0x74320a1b, + 0x743280ac, + 0x74330c47, + 0x78320980, + 0x78328995, + 0x783309a1, + 0x78338083, + 0x783409b0, + 0x783489c5, + 0x783509e4, + 0x78358a06, + 0x78360a1b, + 0x78368a31, + 0x78370a41, + 0x78378a62, + 0x78380a75, + 0x78388a87, + 0x78390a94, + 0x78398ab3, + 0x783a0ac8, + 0x783a8ad6, + 0x783b0ae0, + 0x783b8af4, + 0x783c0b0b, + 0x783c8b20, + 0x783d0b37, + 0x783d8b4c, + 0x783e0aa2, + 0x783e8a54, + 0x7c3211d7, +}; - const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]); +const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]); + +const char kOpenSSLReasonStringData[] = + "ASN1_LENGTH_MISMATCH\0" + "AUX_ERROR\0" + "BAD_GET_ASN1_OBJECT_CALL\0" + "BAD_OBJECT_HEADER\0" + "BMPSTRING_IS_WRONG_LENGTH\0" + "BN_LIB\0" + "BOOLEAN_IS_WRONG_LENGTH\0" + "BUFFER_TOO_SMALL\0" + "CONTEXT_NOT_INITIALISED\0" + "DECODE_ERROR\0" + "DEPTH_EXCEEDED\0" + "DIGEST_AND_KEY_TYPE_NOT_SUPPORTED\0" + "ENCODE_ERROR\0" + "ERROR_GETTING_TIME\0" + "EXPECTING_AN_ASN1_SEQUENCE\0" + "EXPECTING_AN_INTEGER\0" + "EXPECTING_AN_OBJECT\0" + "EXPECTING_A_BOOLEAN\0" + "EXPECTING_A_TIME\0" + "EXPLICIT_LENGTH_MISMATCH\0" + "EXPLICIT_TAG_NOT_CONSTRUCTED\0" + "FIELD_MISSING\0" + "FIRST_NUM_TOO_LARGE\0" + "HEADER_TOO_LONG\0" + "ILLEGAL_BITSTRING_FORMAT\0" + "ILLEGAL_BOOLEAN\0" + "ILLEGAL_CHARACTERS\0" + "ILLEGAL_FORMAT\0" + "ILLEGAL_HEX\0" + "ILLEGAL_IMPLICIT_TAG\0" + "ILLEGAL_INTEGER\0" + "ILLEGAL_NESTED_TAGGING\0" + "ILLEGAL_NULL\0" + "ILLEGAL_NULL_VALUE\0" + "ILLEGAL_OBJECT\0" + "ILLEGAL_OPTIONAL_ANY\0" + "ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE\0" + "ILLEGAL_TAGGED_ANY\0" + "ILLEGAL_TIME_VALUE\0" + "INTEGER_NOT_ASCII_FORMAT\0" + "INTEGER_TOO_LARGE_FOR_LONG\0" + "INVALID_BIT_STRING_BITS_LEFT\0" + "INVALID_BMPSTRING\0" + "INVALID_DIGIT\0" + "INVALID_MODIFIER\0" + "INVALID_NUMBER\0" + "INVALID_OBJECT_ENCODING\0" + "INVALID_SEPARATOR\0" + "INVALID_TIME_FORMAT\0" + "INVALID_UNIVERSALSTRING\0" + "INVALID_UTF8STRING\0" + "LIST_ERROR\0" + "MISSING_ASN1_EOS\0" + "MISSING_EOC\0" + "MISSING_SECOND_NUMBER\0" + "MISSING_VALUE\0" + "MSTRING_NOT_UNIVERSAL\0" + "MSTRING_WRONG_TAG\0" + "NESTED_ASN1_ERROR\0" + "NESTED_ASN1_STRING\0" + "NESTED_TOO_DEEP\0" + "NON_HEX_CHARACTERS\0" + "NOT_ASCII_FORMAT\0" + "NOT_ENOUGH_DATA\0" + "NO_MATCHING_CHOICE_TYPE\0" + "NULL_IS_WRONG_LENGTH\0" + "OBJECT_NOT_ASCII_FORMAT\0" + "ODD_NUMBER_OF_CHARS\0" + "SECOND_NUMBER_TOO_LARGE\0" + "SEQUENCE_LENGTH_MISMATCH\0" + "SEQUENCE_NOT_CONSTRUCTED\0" + "SEQUENCE_OR_SET_NEEDS_CONFIG\0" + "SHORT_LINE\0" + "STREAMING_NOT_SUPPORTED\0" + "STRING_TOO_LONG\0" + "STRING_TOO_SHORT\0" + "TAG_VALUE_TOO_HIGH\0" + "TIME_NOT_ASCII_FORMAT\0" + "TOO_LONG\0" + "TYPE_NOT_CONSTRUCTED\0" + "TYPE_NOT_PRIMITIVE\0" + "UNEXPECTED_EOC\0" + "UNIVERSALSTRING_IS_WRONG_LENGTH\0" + "UNKNOWN_FORMAT\0" + "UNKNOWN_MESSAGE_DIGEST_ALGORITHM\0" + "UNKNOWN_SIGNATURE_ALGORITHM\0" + "UNKNOWN_TAG\0" + "UNSUPPORTED_ANY_DEFINED_BY_TYPE\0" + "UNSUPPORTED_PUBLIC_KEY_TYPE\0" + "UNSUPPORTED_TYPE\0" + "WRONG_PUBLIC_KEY_TYPE\0" + "WRONG_TAG\0" + "WRONG_TYPE\0" + "BAD_FOPEN_MODE\0" + "BROKEN_PIPE\0" + "CONNECT_ERROR\0" + "ERROR_SETTING_NBIO\0" + "INVALID_ARGUMENT\0" + "IN_USE\0" + "KEEPALIVE\0" + "NBIO_CONNECT_ERROR\0" + "NO_HOSTNAME_SPECIFIED\0" + "NO_PORT_SPECIFIED\0" + "NO_SUCH_FILE\0" + "NULL_PARAMETER\0" + "SYS_LIB\0" + "UNABLE_TO_CREATE_SOCKET\0" + "UNINITIALIZED\0" + "UNSUPPORTED_METHOD\0" + "WRITE_TO_READ_ONLY_BIO\0" + "ARG2_LT_ARG3\0" + "BAD_ENCODING\0" + "BAD_RECIPROCAL\0" + "BIGNUM_TOO_LONG\0" + "BITS_TOO_SMALL\0" + "CALLED_WITH_EVEN_MODULUS\0" + "DIV_BY_ZERO\0" + "EXPAND_ON_STATIC_BIGNUM_DATA\0" + "INPUT_NOT_REDUCED\0" + "INVALID_INPUT\0" + "INVALID_RANGE\0" + "NEGATIVE_NUMBER\0" + "NOT_A_SQUARE\0" + "NOT_INITIALIZED\0" + "NO_INVERSE\0" + "PRIVATE_KEY_TOO_LARGE\0" + "P_IS_NOT_PRIME\0" + "TOO_MANY_ITERATIONS\0" + "TOO_MANY_TEMPORARY_VARIABLES\0" + "AES_KEY_SETUP_FAILED\0" + "BAD_DECRYPT\0" + "BAD_KEY_LENGTH\0" + "CTRL_NOT_IMPLEMENTED\0" + "CTRL_OPERATION_NOT_IMPLEMENTED\0" + "DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH\0" + "INITIALIZATION_ERROR\0" + "INPUT_NOT_INITIALIZED\0" + "INVALID_AD_SIZE\0" + "INVALID_KEY_LENGTH\0" + "INVALID_NONCE\0" + "INVALID_NONCE_SIZE\0" + "INVALID_OPERATION\0" + "IV_TOO_LARGE\0" + "NO_CIPHER_SET\0" + "NO_DIRECTION_SET\0" + "OUTPUT_ALIASES_INPUT\0" + "TAG_TOO_LARGE\0" + "TOO_LARGE\0" + "UNSUPPORTED_AD_SIZE\0" + "UNSUPPORTED_INPUT_SIZE\0" + "UNSUPPORTED_KEY_SIZE\0" + "UNSUPPORTED_NONCE_SIZE\0" + "UNSUPPORTED_TAG_SIZE\0" + "WRONG_FINAL_BLOCK_LENGTH\0" + "LIST_CANNOT_BE_NULL\0" + "MISSING_CLOSE_SQUARE_BRACKET\0" + "MISSING_EQUAL_SIGN\0" + "NO_CLOSE_BRACE\0" + "UNABLE_TO_CREATE_NEW_SECTION\0" + "VARIABLE_EXPANSION_TOO_LONG\0" + "VARIABLE_HAS_NO_VALUE\0" + "BAD_GENERATOR\0" + "INVALID_PUBKEY\0" + "MODULUS_TOO_LARGE\0" + "NO_PRIVATE_VALUE\0" + "UNKNOWN_HASH\0" + "BAD_Q_VALUE\0" + "BAD_VERSION\0" + "INVALID_PARAMETERS\0" + "MISSING_PARAMETERS\0" + "NEED_NEW_SETUP_VALUES\0" + "BIGNUM_OUT_OF_RANGE\0" + "COORDINATES_OUT_OF_RANGE\0" + "D2I_ECPKPARAMETERS_FAILURE\0" + "EC_GROUP_NEW_BY_NAME_FAILURE\0" + "GROUP2PKPARAMETERS_FAILURE\0" + "GROUP_MISMATCH\0" + "I2D_ECPKPARAMETERS_FAILURE\0" + "INCOMPATIBLE_OBJECTS\0" + "INVALID_COFACTOR\0" + "INVALID_COMPRESSED_POINT\0" + "INVALID_COMPRESSION_BIT\0" + "INVALID_ENCODING\0" + "INVALID_FIELD\0" + "INVALID_FORM\0" + "INVALID_GROUP_ORDER\0" + "INVALID_PRIVATE_KEY\0" + "INVALID_SCALAR\0" + "MISSING_PRIVATE_KEY\0" + "NON_NAMED_CURVE\0" + "PKPARAMETERS2GROUP_FAILURE\0" + "POINT_AT_INFINITY\0" + "POINT_IS_NOT_ON_CURVE\0" + "PUBLIC_KEY_VALIDATION_FAILED\0" + "SLOT_FULL\0" + "UNDEFINED_GENERATOR\0" + "UNKNOWN_GROUP\0" + "UNKNOWN_ORDER\0" + "WRONG_CURVE_PARAMETERS\0" + "WRONG_ORDER\0" + "KDF_FAILED\0" + "POINT_ARITHMETIC_FAILURE\0" + "UNKNOWN_DIGEST_LENGTH\0" + "BAD_SIGNATURE\0" + "NOT_IMPLEMENTED\0" + "RANDOM_NUMBER_GENERATION_FAILED\0" + "OPERATION_NOT_SUPPORTED\0" + "COMMAND_NOT_SUPPORTED\0" + "DIFFERENT_KEY_TYPES\0" + "DIFFERENT_PARAMETERS\0" + "EXPECTING_AN_EC_KEY_KEY\0" + "EXPECTING_AN_RSA_KEY\0" + "EXPECTING_A_DSA_KEY\0" + "ILLEGAL_OR_UNSUPPORTED_PADDING_MODE\0" + "INVALID_DIGEST_LENGTH\0" + "INVALID_DIGEST_TYPE\0" + "INVALID_KEYBITS\0" + "INVALID_MGF1_MD\0" + "INVALID_PADDING_MODE\0" + "INVALID_PEER_KEY\0" + "INVALID_PSS_SALTLEN\0" + "INVALID_SIGNATURE\0" + "KEYS_NOT_SET\0" + "MEMORY_LIMIT_EXCEEDED\0" + "NOT_A_PRIVATE_KEY\0" + "NOT_XOF_OR_INVALID_LENGTH\0" + "NO_DEFAULT_DIGEST\0" + "NO_KEY_SET\0" + "NO_MDC2_SUPPORT\0" + "NO_NID_FOR_CURVE\0" + "NO_OPERATION_SET\0" + "NO_PARAMETERS_SET\0" + "OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE\0" + "OPERATON_NOT_INITIALIZED\0" + "UNKNOWN_PUBLIC_KEY_TYPE\0" + "UNSUPPORTED_ALGORITHM\0" + "OUTPUT_TOO_LARGE\0" + "INVALID_OID_STRING\0" + "UNKNOWN_NID\0" + "BAD_BASE64_DECODE\0" + "BAD_END_LINE\0" + "BAD_IV_CHARS\0" + "BAD_PASSWORD_READ\0" + "CIPHER_IS_NULL\0" + "ERROR_CONVERTING_PRIVATE_KEY\0" + "NOT_DEK_INFO\0" + "NOT_ENCRYPTED\0" + "NOT_PROC_TYPE\0" + "NO_START_LINE\0" + "READ_KEY\0" + "SHORT_HEADER\0" + "UNSUPPORTED_CIPHER\0" + "UNSUPPORTED_ENCRYPTION\0" + "BAD_PKCS7_VERSION\0" + "NOT_PKCS7_SIGNED_DATA\0" + "NO_CERTIFICATES_INCLUDED\0" + "NO_CRLS_INCLUDED\0" + "BAD_ITERATION_COUNT\0" + "BAD_PKCS12_DATA\0" + "BAD_PKCS12_VERSION\0" + "CIPHER_HAS_NO_OBJECT_IDENTIFIER\0" + "CRYPT_ERROR\0" + "ENCRYPT_ERROR\0" + "ERROR_SETTING_CIPHER_PARAMS\0" + "INCORRECT_PASSWORD\0" + "INVALID_CHARACTERS\0" + "KEYGEN_FAILURE\0" + "KEY_GEN_ERROR\0" + "METHOD_NOT_SUPPORTED\0" + "MISSING_MAC\0" + "MULTIPLE_PRIVATE_KEYS_IN_PKCS12\0" + "PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED\0" + "PKCS12_TOO_DEEPLY_NESTED\0" + "PRIVATE_KEY_DECODE_ERROR\0" + "PRIVATE_KEY_ENCODE_ERROR\0" + "UNKNOWN_ALGORITHM\0" + "UNKNOWN_CIPHER\0" + "UNKNOWN_CIPHER_ALGORITHM\0" + "UNKNOWN_DIGEST\0" + "UNSUPPORTED_KEYLENGTH\0" + "UNSUPPORTED_KEY_DERIVATION_FUNCTION\0" + "UNSUPPORTED_OPTIONS\0" + "UNSUPPORTED_PRF\0" + "UNSUPPORTED_PRIVATE_KEY_ALGORITHM\0" + "UNSUPPORTED_SALT_TYPE\0" + "BAD_E_VALUE\0" + "BAD_FIXED_HEADER_DECRYPT\0" + "BAD_PAD_BYTE_COUNT\0" + "BAD_RSA_PARAMETERS\0" + "BLOCK_TYPE_IS_NOT_01\0" + "BLOCK_TYPE_IS_NOT_02\0" + "BN_NOT_INITIALIZED\0" + "CANNOT_RECOVER_MULTI_PRIME_KEY\0" + "CRT_PARAMS_ALREADY_GIVEN\0" + "CRT_VALUES_INCORRECT\0" + "DATA_LEN_NOT_EQUAL_TO_MOD_LEN\0" + "DATA_TOO_LARGE\0" + "DATA_TOO_LARGE_FOR_KEY_SIZE\0" + "DATA_TOO_LARGE_FOR_MODULUS\0" + "DATA_TOO_SMALL\0" + "DATA_TOO_SMALL_FOR_KEY_SIZE\0" + "DIGEST_TOO_BIG_FOR_RSA_KEY\0" + "D_E_NOT_CONGRUENT_TO_1\0" + "D_OUT_OF_RANGE\0" + "EMPTY_PUBLIC_KEY\0" + "FIRST_OCTET_INVALID\0" + "INCONSISTENT_SET_OF_CRT_VALUES\0" + "INTERNAL_ERROR\0" + "INVALID_MESSAGE_LENGTH\0" + "KEY_SIZE_TOO_SMALL\0" + "LAST_OCTET_INVALID\0" + "MUST_HAVE_AT_LEAST_TWO_PRIMES\0" + "NO_PUBLIC_EXPONENT\0" + "NULL_BEFORE_BLOCK_MISSING\0" + "N_NOT_EQUAL_P_Q\0" + "OAEP_DECODING_ERROR\0" + "ONLY_ONE_OF_P_Q_GIVEN\0" + "OUTPUT_BUFFER_TOO_SMALL\0" + "PADDING_CHECK_FAILED\0" + "PKCS_DECODING_ERROR\0" + "SLEN_CHECK_FAILED\0" + "SLEN_RECOVERY_FAILED\0" + "UNKNOWN_ALGORITHM_TYPE\0" + "UNKNOWN_PADDING_TYPE\0" + "VALUE_MISSING\0" + "WRONG_SIGNATURE_LENGTH\0" + "ALPN_MISMATCH_ON_EARLY_DATA\0" + "APPLICATION_DATA_INSTEAD_OF_HANDSHAKE\0" + "APPLICATION_DATA_ON_SHUTDOWN\0" + "APP_DATA_IN_HANDSHAKE\0" + "ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT\0" + "BAD_ALERT\0" + "BAD_CHANGE_CIPHER_SPEC\0" + "BAD_DATA_RETURNED_BY_CALLBACK\0" + "BAD_DH_P_LENGTH\0" + "BAD_DIGEST_LENGTH\0" + "BAD_ECC_CERT\0" + "BAD_ECPOINT\0" + "BAD_HANDSHAKE_RECORD\0" + "BAD_HELLO_REQUEST\0" + "BAD_LENGTH\0" + "BAD_PACKET_LENGTH\0" + "BAD_RSA_ENCRYPT\0" + "BAD_SRTP_MKI_VALUE\0" + "BAD_SRTP_PROTECTION_PROFILE_LIST\0" + "BAD_SSL_FILETYPE\0" + "BAD_WRITE_RETRY\0" + "BIO_NOT_SET\0" + "BLOCK_CIPHER_PAD_IS_WRONG\0" + "BUFFERED_MESSAGES_ON_CIPHER_CHANGE\0" + "CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD\0" + "CANNOT_PARSE_LEAF_CERT\0" + "CA_DN_LENGTH_MISMATCH\0" + "CA_DN_TOO_LONG\0" + "CCS_RECEIVED_EARLY\0" + "CERTIFICATE_AND_PRIVATE_KEY_MISMATCH\0" + "CERTIFICATE_VERIFY_FAILED\0" + "CERT_CB_ERROR\0" + "CERT_DECOMPRESSION_FAILED\0" + "CERT_LENGTH_MISMATCH\0" + "CHANNEL_ID_NOT_P256\0" + "CHANNEL_ID_SIGNATURE_INVALID\0" + "CIPHER_OR_HASH_UNAVAILABLE\0" + "CLIENTHELLO_PARSE_FAILED\0" + "CLIENTHELLO_TLSEXT\0" + "CONNECTION_REJECTED\0" + "CONNECTION_TYPE_NOT_SET\0" + "CUSTOM_EXTENSION_ERROR\0" + "DATA_LENGTH_TOO_LONG\0" + "DECRYPTION_FAILED\0" + "DECRYPTION_FAILED_OR_BAD_RECORD_MAC\0" + "DH_PUBLIC_VALUE_LENGTH_IS_WRONG\0" + "DH_P_TOO_LONG\0" + "DIGEST_CHECK_FAILED\0" + "DOWNGRADE_DETECTED\0" + "DTLS_MESSAGE_TOO_BIG\0" + "DUPLICATE_EXTENSION\0" + "DUPLICATE_KEY_SHARE\0" + "DUPLICATE_SIGNATURE_ALGORITHM\0" + "EARLY_DATA_NOT_IN_USE\0" + "ECC_CERT_NOT_FOR_SIGNING\0" + "EMPTY_HELLO_RETRY_REQUEST\0" + "EMS_STATE_INCONSISTENT\0" + "ENCRYPTED_LENGTH_TOO_LONG\0" + "ERROR_ADDING_EXTENSION\0" + "ERROR_IN_RECEIVED_CIPHER_LIST\0" + "ERROR_PARSING_EXTENSION\0" + "EXCESSIVE_MESSAGE_SIZE\0" + "EXTRA_DATA_IN_MESSAGE\0" + "FRAGMENT_MISMATCH\0" + "GOT_NEXT_PROTO_WITHOUT_EXTENSION\0" + "HANDSHAKE_FAILURE_ON_CLIENT_HELLO\0" + "HANDSHAKE_NOT_COMPLETE\0" + "HTTPS_PROXY_REQUEST\0" + "HTTP_REQUEST\0" + "INAPPROPRIATE_FALLBACK\0" + "INCONSISTENT_CLIENT_HELLO\0" + "INVALID_ALPN_PROTOCOL\0" + "INVALID_COMMAND\0" + "INVALID_COMPRESSION_LIST\0" + "INVALID_DELEGATED_CREDENTIAL\0" + "INVALID_MESSAGE\0" + "INVALID_OUTER_RECORD_TYPE\0" + "INVALID_SCT_LIST\0" + "INVALID_SIGNATURE_ALGORITHM\0" + "INVALID_SSL_SESSION\0" + "INVALID_TICKET_KEYS_LENGTH\0" + "KEY_USAGE_BIT_INCORRECT\0" + "LENGTH_MISMATCH\0" + "MISSING_EXTENSION\0" + "MISSING_KEY_SHARE\0" + "MISSING_RSA_CERTIFICATE\0" + "MISSING_TMP_DH_KEY\0" + "MISSING_TMP_ECDH_KEY\0" + "MIXED_SPECIAL_OPERATOR_WITH_GROUPS\0" + "MTU_TOO_SMALL\0" + "NEGOTIATED_BOTH_NPN_AND_ALPN\0" + "NEGOTIATED_TB_WITHOUT_EMS_OR_RI\0" + "NESTED_GROUP\0" + "NO_CERTIFICATES_RETURNED\0" + "NO_CERTIFICATE_ASSIGNED\0" + "NO_CERTIFICATE_SET\0" + "NO_CIPHERS_AVAILABLE\0" + "NO_CIPHERS_PASSED\0" + "NO_CIPHERS_SPECIFIED\0" + "NO_CIPHER_MATCH\0" + "NO_COMMON_SIGNATURE_ALGORITHMS\0" + "NO_COMPRESSION_SPECIFIED\0" + "NO_GROUPS_SPECIFIED\0" + "NO_METHOD_SPECIFIED\0" + "NO_P256_SUPPORT\0" + "NO_PRIVATE_KEY_ASSIGNED\0" + "NO_RENEGOTIATION\0" + "NO_REQUIRED_DIGEST\0" + "NO_SHARED_CIPHER\0" + "NO_SHARED_GROUP\0" + "NO_SUPPORTED_VERSIONS_ENABLED\0" + "NULL_SSL_CTX\0" + "NULL_SSL_METHOD_PASSED\0" + "OCSP_CB_ERROR\0" + "OLD_SESSION_CIPHER_NOT_RETURNED\0" + "OLD_SESSION_PRF_HASH_MISMATCH\0" + "OLD_SESSION_VERSION_NOT_RETURNED\0" + "PARSE_TLSEXT\0" + "PATH_TOO_LONG\0" + "PEER_DID_NOT_RETURN_A_CERTIFICATE\0" + "PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE\0" + "PRE_SHARED_KEY_MUST_BE_LAST\0" + "PRIVATE_KEY_OPERATION_FAILED\0" + "PROTOCOL_IS_SHUTDOWN\0" + "PSK_IDENTITY_BINDER_COUNT_MISMATCH\0" + "PSK_IDENTITY_NOT_FOUND\0" + "PSK_NO_CLIENT_CB\0" + "PSK_NO_SERVER_CB\0" + "QUIC_INTERNAL_ERROR\0" + "READ_TIMEOUT_EXPIRED\0" + "RECORD_LENGTH_MISMATCH\0" + "RECORD_TOO_LARGE\0" + "RENEGOTIATION_EMS_MISMATCH\0" + "RENEGOTIATION_ENCODING_ERR\0" + "RENEGOTIATION_MISMATCH\0" + "REQUIRED_CIPHER_MISSING\0" + "RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION\0" + "RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION\0" + "SCSV_RECEIVED_WHEN_RENEGOTIATING\0" + "SECOND_SERVERHELLO_VERSION_MISMATCH\0" + "SERVERHELLO_TLSEXT\0" + "SERVER_CERT_CHANGED\0" + "SERVER_ECHOED_INVALID_SESSION_ID\0" + "SESSION_ID_CONTEXT_UNINITIALIZED\0" + "SESSION_MAY_NOT_BE_CREATED\0" + "SHUTDOWN_WHILE_IN_INIT\0" + "SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER\0" + "SRTP_COULD_NOT_ALLOCATE_PROFILES\0" + "SRTP_UNKNOWN_PROTECTION_PROFILE\0" + "SSL3_EXT_INVALID_SERVERNAME\0" + "SSLV3_ALERT_BAD_CERTIFICATE\0" + "SSLV3_ALERT_BAD_RECORD_MAC\0" + "SSLV3_ALERT_CERTIFICATE_EXPIRED\0" + "SSLV3_ALERT_CERTIFICATE_REVOKED\0" + "SSLV3_ALERT_CERTIFICATE_UNKNOWN\0" + "SSLV3_ALERT_CLOSE_NOTIFY\0" + "SSLV3_ALERT_DECOMPRESSION_FAILURE\0" + "SSLV3_ALERT_HANDSHAKE_FAILURE\0" + "SSLV3_ALERT_ILLEGAL_PARAMETER\0" + "SSLV3_ALERT_NO_CERTIFICATE\0" + "SSLV3_ALERT_UNEXPECTED_MESSAGE\0" + "SSLV3_ALERT_UNSUPPORTED_CERTIFICATE\0" + "SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION\0" + "SSL_HANDSHAKE_FAILURE\0" + "SSL_SESSION_ID_CONTEXT_TOO_LONG\0" + "SSL_SESSION_ID_TOO_LONG\0" + "TICKET_ENCRYPTION_FAILED\0" + "TLS13_DOWNGRADE\0" + "TLSV1_ALERT_ACCESS_DENIED\0" + "TLSV1_ALERT_DECODE_ERROR\0" + "TLSV1_ALERT_DECRYPTION_FAILED\0" + "TLSV1_ALERT_DECRYPT_ERROR\0" + "TLSV1_ALERT_EXPORT_RESTRICTION\0" + "TLSV1_ALERT_INAPPROPRIATE_FALLBACK\0" + "TLSV1_ALERT_INSUFFICIENT_SECURITY\0" + "TLSV1_ALERT_INTERNAL_ERROR\0" + "TLSV1_ALERT_NO_RENEGOTIATION\0" + "TLSV1_ALERT_PROTOCOL_VERSION\0" + "TLSV1_ALERT_RECORD_OVERFLOW\0" + "TLSV1_ALERT_UNKNOWN_CA\0" + "TLSV1_ALERT_USER_CANCELLED\0" + "TLSV1_BAD_CERTIFICATE_HASH_VALUE\0" + "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\0" + "TLSV1_CERTIFICATE_REQUIRED\0" + "TLSV1_CERTIFICATE_UNOBTAINABLE\0" + "TLSV1_UNKNOWN_PSK_IDENTITY\0" + "TLSV1_UNRECOGNIZED_NAME\0" + "TLSV1_UNSUPPORTED_EXTENSION\0" + "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\0" + "TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\0" + "TOO_MANY_EMPTY_FRAGMENTS\0" + "TOO_MANY_KEY_UPDATES\0" + "TOO_MANY_WARNING_ALERTS\0" + "TOO_MUCH_READ_EARLY_DATA\0" + "TOO_MUCH_SKIPPED_EARLY_DATA\0" + "UNABLE_TO_FIND_ECDH_PARAMETERS\0" + "UNCOMPRESSED_CERT_TOO_LARGE\0" + "UNEXPECTED_EXTENSION\0" + "UNEXPECTED_EXTENSION_ON_EARLY_DATA\0" + "UNEXPECTED_MESSAGE\0" + "UNEXPECTED_OPERATOR_IN_GROUP\0" + "UNEXPECTED_RECORD\0" + "UNKNOWN_ALERT_TYPE\0" + "UNKNOWN_CERTIFICATE_TYPE\0" + "UNKNOWN_CERT_COMPRESSION_ALG\0" + "UNKNOWN_CIPHER_RETURNED\0" + "UNKNOWN_CIPHER_TYPE\0" + "UNKNOWN_KEY_EXCHANGE_TYPE\0" + "UNKNOWN_PROTOCOL\0" + "UNKNOWN_SSL_VERSION\0" + "UNKNOWN_STATE\0" + "UNSAFE_LEGACY_RENEGOTIATION_DISABLED\0" + "UNSUPPORTED_COMPRESSION_ALGORITHM\0" + "UNSUPPORTED_ELLIPTIC_CURVE\0" + "UNSUPPORTED_PROTOCOL\0" + "UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY\0" + "WRONG_CERTIFICATE_TYPE\0" + "WRONG_CIPHER_RETURNED\0" + "WRONG_CURVE\0" + "WRONG_ENCRYPTION_LEVEL_RECEIVED\0" + "WRONG_MESSAGE_TYPE\0" + "WRONG_SIGNATURE_TYPE\0" + "WRONG_SSL_VERSION\0" + "WRONG_VERSION_NUMBER\0" + "WRONG_VERSION_ON_EARLY_DATA\0" + "X509_LIB\0" + "X509_VERIFICATION_SETUP_PROBLEMS\0" + "AKID_MISMATCH\0" + "BAD_X509_FILETYPE\0" + "BASE64_DECODE_ERROR\0" + "CANT_CHECK_DH_KEY\0" + "CERT_ALREADY_IN_HASH_TABLE\0" + "CRL_ALREADY_DELTA\0" + "CRL_VERIFY_FAILURE\0" + "IDP_MISMATCH\0" + "INVALID_DIRECTORY\0" + "INVALID_FIELD_NAME\0" + "INVALID_PARAMETER\0" + "INVALID_PSS_PARAMETERS\0" + "INVALID_TRUST\0" + "ISSUER_MISMATCH\0" + "KEY_TYPE_MISMATCH\0" + "KEY_VALUES_MISMATCH\0" + "LOADING_CERT_DIR\0" + "LOADING_DEFAULTS\0" + "NAME_TOO_LONG\0" + "NEWER_CRL_NOT_NEWER\0" + "NO_CERT_SET_FOR_US_TO_VERIFY\0" + "NO_CRL_NUMBER\0" + "PUBLIC_KEY_DECODE_ERROR\0" + "PUBLIC_KEY_ENCODE_ERROR\0" + "SHOULD_RETRY\0" + "SIGNATURE_ALGORITHM_MISMATCH\0" + "UNKNOWN_KEY_TYPE\0" + "UNKNOWN_PURPOSE_ID\0" + "UNKNOWN_TRUST_ID\0" + "WRONG_LOOKUP_TYPE\0" + "BAD_IP_ADDRESS\0" + "BAD_OBJECT\0" + "BN_DEC2BN_ERROR\0" + "BN_TO_ASN1_INTEGER_ERROR\0" + "CANNOT_FIND_FREE_FUNCTION\0" + "DIRNAME_ERROR\0" + "DISTPOINT_ALREADY_SET\0" + "DUPLICATE_ZONE_ID\0" + "ERROR_CONVERTING_ZONE\0" + "ERROR_CREATING_EXTENSION\0" + "ERROR_IN_EXTENSION\0" + "EXPECTED_A_SECTION_NAME\0" + "EXTENSION_EXISTS\0" + "EXTENSION_NAME_ERROR\0" + "EXTENSION_NOT_FOUND\0" + "EXTENSION_SETTING_NOT_SUPPORTED\0" + "EXTENSION_VALUE_ERROR\0" + "ILLEGAL_EMPTY_EXTENSION\0" + "ILLEGAL_HEX_DIGIT\0" + "INCORRECT_POLICY_SYNTAX_TAG\0" + "INVALID_BOOLEAN_STRING\0" + "INVALID_EXTENSION_STRING\0" + "INVALID_MULTIPLE_RDNS\0" + "INVALID_NAME\0" + "INVALID_NULL_ARGUMENT\0" + "INVALID_NULL_NAME\0" + "INVALID_NULL_VALUE\0" + "INVALID_NUMBERS\0" + "INVALID_OBJECT_IDENTIFIER\0" + "INVALID_OPTION\0" + "INVALID_POLICY_IDENTIFIER\0" + "INVALID_PROXY_POLICY_SETTING\0" + "INVALID_PURPOSE\0" + "INVALID_SECTION\0" + "INVALID_SYNTAX\0" + "ISSUER_DECODE_ERROR\0" + "NEED_ORGANIZATION_AND_NUMBERS\0" + "NO_CONFIG_DATABASE\0" + "NO_ISSUER_CERTIFICATE\0" + "NO_ISSUER_DETAILS\0" + "NO_POLICY_IDENTIFIER\0" + "NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED\0" + "NO_PUBLIC_KEY\0" + "NO_SUBJECT_DETAILS\0" + "ODD_NUMBER_OF_DIGITS\0" + "OPERATION_NOT_DEFINED\0" + "OTHERNAME_ERROR\0" + "POLICY_LANGUAGE_ALREADY_DEFINED\0" + "POLICY_PATH_LENGTH\0" + "POLICY_PATH_LENGTH_ALREADY_DEFINED\0" + "POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY\0" + "SECTION_NOT_FOUND\0" + "UNABLE_TO_GET_ISSUER_DETAILS\0" + "UNABLE_TO_GET_ISSUER_KEYID\0" + "UNKNOWN_BIT_STRING_ARGUMENT\0" + "UNKNOWN_EXTENSION\0" + "UNKNOWN_EXTENSION_NAME\0" + "UNKNOWN_OPTION\0" + "UNSUPPORTED_OPTION\0" + "USER_TOO_LONG\0" + ""; - const char kOpenSSLReasonStringData[] = - "ASN1_LENGTH_MISMATCH\0" - "AUX_ERROR\0" - "BAD_GET_ASN1_OBJECT_CALL\0" - "BAD_OBJECT_HEADER\0" - "BMPSTRING_IS_WRONG_LENGTH\0" - "BN_LIB\0" - "BOOLEAN_IS_WRONG_LENGTH\0" - "BUFFER_TOO_SMALL\0" - "CONTEXT_NOT_INITIALISED\0" - "DECODE_ERROR\0" - "DEPTH_EXCEEDED\0" - "DIGEST_AND_KEY_TYPE_NOT_SUPPORTED\0" - "ENCODE_ERROR\0" - "ERROR_GETTING_TIME\0" - "EXPECTING_AN_ASN1_SEQUENCE\0" - "EXPECTING_AN_INTEGER\0" - "EXPECTING_AN_OBJECT\0" - "EXPECTING_A_BOOLEAN\0" - "EXPECTING_A_TIME\0" - "EXPLICIT_LENGTH_MISMATCH\0" - "EXPLICIT_TAG_NOT_CONSTRUCTED\0" - "FIELD_MISSING\0" - "FIRST_NUM_TOO_LARGE\0" - "HEADER_TOO_LONG\0" - "ILLEGAL_BITSTRING_FORMAT\0" - "ILLEGAL_BOOLEAN\0" - "ILLEGAL_CHARACTERS\0" - "ILLEGAL_FORMAT\0" - "ILLEGAL_HEX\0" - "ILLEGAL_IMPLICIT_TAG\0" - "ILLEGAL_INTEGER\0" - "ILLEGAL_NESTED_TAGGING\0" - "ILLEGAL_NULL\0" - "ILLEGAL_NULL_VALUE\0" - "ILLEGAL_OBJECT\0" - "ILLEGAL_OPTIONAL_ANY\0" - "ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE\0" - "ILLEGAL_TAGGED_ANY\0" - "ILLEGAL_TIME_VALUE\0" - "INTEGER_NOT_ASCII_FORMAT\0" - "INTEGER_TOO_LARGE_FOR_LONG\0" - "INVALID_BIT_STRING_BITS_LEFT\0" - "INVALID_BMPSTRING_LENGTH\0" - "INVALID_DIGIT\0" - "INVALID_MODIFIER\0" - "INVALID_NUMBER\0" - "INVALID_OBJECT_ENCODING\0" - "INVALID_SEPARATOR\0" - "INVALID_TIME_FORMAT\0" - "INVALID_UNIVERSALSTRING_LENGTH\0" - "INVALID_UTF8STRING\0" - "LIST_ERROR\0" - "MISSING_ASN1_EOS\0" - "MISSING_EOC\0" - "MISSING_SECOND_NUMBER\0" - "MISSING_VALUE\0" - "MSTRING_NOT_UNIVERSAL\0" - "MSTRING_WRONG_TAG\0" - "NESTED_ASN1_ERROR\0" - "NESTED_ASN1_STRING\0" - "NON_HEX_CHARACTERS\0" - "NOT_ASCII_FORMAT\0" - "NOT_ENOUGH_DATA\0" - "NO_MATCHING_CHOICE_TYPE\0" - "NULL_IS_WRONG_LENGTH\0" - "OBJECT_NOT_ASCII_FORMAT\0" - "ODD_NUMBER_OF_CHARS\0" - "SECOND_NUMBER_TOO_LARGE\0" - "SEQUENCE_LENGTH_MISMATCH\0" - "SEQUENCE_NOT_CONSTRUCTED\0" - "SEQUENCE_OR_SET_NEEDS_CONFIG\0" - "SHORT_LINE\0" - "STREAMING_NOT_SUPPORTED\0" - "STRING_TOO_LONG\0" - "STRING_TOO_SHORT\0" - "TAG_VALUE_TOO_HIGH\0" - "TIME_NOT_ASCII_FORMAT\0" - "TOO_LONG\0" - "TYPE_NOT_CONSTRUCTED\0" - "TYPE_NOT_PRIMITIVE\0" - "UNEXPECTED_EOC\0" - "UNIVERSALSTRING_IS_WRONG_LENGTH\0" - "UNKNOWN_FORMAT\0" - "UNKNOWN_MESSAGE_DIGEST_ALGORITHM\0" - "UNKNOWN_SIGNATURE_ALGORITHM\0" - "UNKNOWN_TAG\0" - "UNSUPPORTED_ANY_DEFINED_BY_TYPE\0" - "UNSUPPORTED_PUBLIC_KEY_TYPE\0" - "UNSUPPORTED_TYPE\0" - "WRONG_PUBLIC_KEY_TYPE\0" - "WRONG_TAG\0" - "WRONG_TYPE\0" - "BAD_FOPEN_MODE\0" - "BROKEN_PIPE\0" - "CONNECT_ERROR\0" - "ERROR_SETTING_NBIO\0" - "INVALID_ARGUMENT\0" - "IN_USE\0" - "KEEPALIVE\0" - "NBIO_CONNECT_ERROR\0" - "NO_HOSTNAME_SPECIFIED\0" - "NO_PORT_SPECIFIED\0" - "NO_SUCH_FILE\0" - "NULL_PARAMETER\0" - "SYS_LIB\0" - "UNABLE_TO_CREATE_SOCKET\0" - "UNINITIALIZED\0" - "UNSUPPORTED_METHOD\0" - "WRITE_TO_READ_ONLY_BIO\0" - "ARG2_LT_ARG3\0" - "BAD_ENCODING\0" - "BAD_RECIPROCAL\0" - "BIGNUM_TOO_LONG\0" - "BITS_TOO_SMALL\0" - "CALLED_WITH_EVEN_MODULUS\0" - "DIV_BY_ZERO\0" - "EXPAND_ON_STATIC_BIGNUM_DATA\0" - "INPUT_NOT_REDUCED\0" - "INVALID_INPUT\0" - "INVALID_RANGE\0" - "NEGATIVE_NUMBER\0" - "NOT_A_SQUARE\0" - "NOT_INITIALIZED\0" - "NO_INVERSE\0" - "PRIVATE_KEY_TOO_LARGE\0" - "P_IS_NOT_PRIME\0" - "TOO_MANY_ITERATIONS\0" - "TOO_MANY_TEMPORARY_VARIABLES\0" - "AES_KEY_SETUP_FAILED\0" - "BAD_DECRYPT\0" - "BAD_KEY_LENGTH\0" - "CTRL_NOT_IMPLEMENTED\0" - "CTRL_OPERATION_NOT_IMPLEMENTED\0" - "DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH\0" - "INITIALIZATION_ERROR\0" - "INPUT_NOT_INITIALIZED\0" - "INVALID_AD_SIZE\0" - "INVALID_KEY_LENGTH\0" - "INVALID_NONCE\0" - "INVALID_NONCE_SIZE\0" - "INVALID_OPERATION\0" - "IV_TOO_LARGE\0" - "NO_CIPHER_SET\0" - "NO_DIRECTION_SET\0" - "OUTPUT_ALIASES_INPUT\0" - "TAG_TOO_LARGE\0" - "TOO_LARGE\0" - "UNSUPPORTED_AD_SIZE\0" - "UNSUPPORTED_INPUT_SIZE\0" - "UNSUPPORTED_KEY_SIZE\0" - "UNSUPPORTED_NONCE_SIZE\0" - "UNSUPPORTED_TAG_SIZE\0" - "WRONG_FINAL_BLOCK_LENGTH\0" - "LIST_CANNOT_BE_NULL\0" - "MISSING_CLOSE_SQUARE_BRACKET\0" - "MISSING_EQUAL_SIGN\0" - "NO_CLOSE_BRACE\0" - "UNABLE_TO_CREATE_NEW_SECTION\0" - "VARIABLE_EXPANSION_TOO_LONG\0" - "VARIABLE_HAS_NO_VALUE\0" - "BAD_GENERATOR\0" - "INVALID_PUBKEY\0" - "MODULUS_TOO_LARGE\0" - "NO_PRIVATE_VALUE\0" - "UNKNOWN_HASH\0" - "BAD_Q_VALUE\0" - "BAD_VERSION\0" - "MISSING_PARAMETERS\0" - "NEED_NEW_SETUP_VALUES\0" - "BIGNUM_OUT_OF_RANGE\0" - "COORDINATES_OUT_OF_RANGE\0" - "D2I_ECPKPARAMETERS_FAILURE\0" - "EC_GROUP_NEW_BY_NAME_FAILURE\0" - "GROUP2PKPARAMETERS_FAILURE\0" - "GROUP_MISMATCH\0" - "I2D_ECPKPARAMETERS_FAILURE\0" - "INCOMPATIBLE_OBJECTS\0" - "INVALID_COFACTOR\0" - "INVALID_COMPRESSED_POINT\0" - "INVALID_COMPRESSION_BIT\0" - "INVALID_ENCODING\0" - "INVALID_FIELD\0" - "INVALID_FORM\0" - "INVALID_GROUP_ORDER\0" - "INVALID_PRIVATE_KEY\0" - "MISSING_PRIVATE_KEY\0" - "NON_NAMED_CURVE\0" - "PKPARAMETERS2GROUP_FAILURE\0" - "POINT_AT_INFINITY\0" - "POINT_IS_NOT_ON_CURVE\0" - "PUBLIC_KEY_VALIDATION_FAILED\0" - "SLOT_FULL\0" - "UNDEFINED_GENERATOR\0" - "UNKNOWN_GROUP\0" - "UNKNOWN_ORDER\0" - "WRONG_CURVE_PARAMETERS\0" - "WRONG_ORDER\0" - "KDF_FAILED\0" - "POINT_ARITHMETIC_FAILURE\0" - "BAD_SIGNATURE\0" - "NOT_IMPLEMENTED\0" - "RANDOM_NUMBER_GENERATION_FAILED\0" - "OPERATION_NOT_SUPPORTED\0" - "COMMAND_NOT_SUPPORTED\0" - "DIFFERENT_KEY_TYPES\0" - "DIFFERENT_PARAMETERS\0" - "EXPECTING_AN_EC_KEY_KEY\0" - "EXPECTING_AN_RSA_KEY\0" - "EXPECTING_A_DSA_KEY\0" - "ILLEGAL_OR_UNSUPPORTED_PADDING_MODE\0" - "INVALID_DIGEST_LENGTH\0" - "INVALID_DIGEST_TYPE\0" - "INVALID_KEYBITS\0" - "INVALID_MGF1_MD\0" - "INVALID_PADDING_MODE\0" - "INVALID_PARAMETERS\0" - "INVALID_PSS_SALTLEN\0" - "INVALID_SIGNATURE\0" - "KEYS_NOT_SET\0" - "MEMORY_LIMIT_EXCEEDED\0" - "NOT_A_PRIVATE_KEY\0" - "NO_DEFAULT_DIGEST\0" - "NO_KEY_SET\0" - "NO_MDC2_SUPPORT\0" - "NO_NID_FOR_CURVE\0" - "NO_OPERATION_SET\0" - "NO_PARAMETERS_SET\0" - "OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE\0" - "OPERATON_NOT_INITIALIZED\0" - "UNKNOWN_PUBLIC_KEY_TYPE\0" - "UNSUPPORTED_ALGORITHM\0" - "OUTPUT_TOO_LARGE\0" - "UNKNOWN_NID\0" - "BAD_BASE64_DECODE\0" - "BAD_END_LINE\0" - "BAD_IV_CHARS\0" - "BAD_PASSWORD_READ\0" - "CIPHER_IS_NULL\0" - "ERROR_CONVERTING_PRIVATE_KEY\0" - "NOT_DEK_INFO\0" - "NOT_ENCRYPTED\0" - "NOT_PROC_TYPE\0" - "NO_START_LINE\0" - "READ_KEY\0" - "SHORT_HEADER\0" - "UNSUPPORTED_CIPHER\0" - "UNSUPPORTED_ENCRYPTION\0" - "BAD_PKCS7_VERSION\0" - "NOT_PKCS7_SIGNED_DATA\0" - "NO_CERTIFICATES_INCLUDED\0" - "NO_CRLS_INCLUDED\0" - "BAD_ITERATION_COUNT\0" - "BAD_PKCS12_DATA\0" - "BAD_PKCS12_VERSION\0" - "CIPHER_HAS_NO_OBJECT_IDENTIFIER\0" - "CRYPT_ERROR\0" - "ENCRYPT_ERROR\0" - "ERROR_SETTING_CIPHER_PARAMS\0" - "INCORRECT_PASSWORD\0" - "KEYGEN_FAILURE\0" - "KEY_GEN_ERROR\0" - "METHOD_NOT_SUPPORTED\0" - "MISSING_MAC\0" - "MULTIPLE_PRIVATE_KEYS_IN_PKCS12\0" - "PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED\0" - "PKCS12_TOO_DEEPLY_NESTED\0" - "PRIVATE_KEY_DECODE_ERROR\0" - "PRIVATE_KEY_ENCODE_ERROR\0" - "UNKNOWN_ALGORITHM\0" - "UNKNOWN_CIPHER\0" - "UNKNOWN_CIPHER_ALGORITHM\0" - "UNKNOWN_DIGEST\0" - "UNSUPPORTED_KEYLENGTH\0" - "UNSUPPORTED_KEY_DERIVATION_FUNCTION\0" - "UNSUPPORTED_PRF\0" - "UNSUPPORTED_PRIVATE_KEY_ALGORITHM\0" - "UNSUPPORTED_SALT_TYPE\0" - "BAD_E_VALUE\0" - "BAD_FIXED_HEADER_DECRYPT\0" - "BAD_PAD_BYTE_COUNT\0" - "BAD_RSA_PARAMETERS\0" - "BLOCK_TYPE_IS_NOT_01\0" - "BN_NOT_INITIALIZED\0" - "CANNOT_RECOVER_MULTI_PRIME_KEY\0" - "CRT_PARAMS_ALREADY_GIVEN\0" - "CRT_VALUES_INCORRECT\0" - "DATA_LEN_NOT_EQUAL_TO_MOD_LEN\0" - "DATA_TOO_LARGE\0" - "DATA_TOO_LARGE_FOR_KEY_SIZE\0" - "DATA_TOO_LARGE_FOR_MODULUS\0" - "DATA_TOO_SMALL\0" - "DATA_TOO_SMALL_FOR_KEY_SIZE\0" - "DIGEST_TOO_BIG_FOR_RSA_KEY\0" - "D_E_NOT_CONGRUENT_TO_1\0" - "EMPTY_PUBLIC_KEY\0" - "FIRST_OCTET_INVALID\0" - "INCONSISTENT_SET_OF_CRT_VALUES\0" - "INTERNAL_ERROR\0" - "INVALID_MESSAGE_LENGTH\0" - "KEY_SIZE_TOO_SMALL\0" - "LAST_OCTET_INVALID\0" - "MUST_HAVE_AT_LEAST_TWO_PRIMES\0" - "NO_PUBLIC_EXPONENT\0" - "NULL_BEFORE_BLOCK_MISSING\0" - "N_NOT_EQUAL_P_Q\0" - "OAEP_DECODING_ERROR\0" - "ONLY_ONE_OF_P_Q_GIVEN\0" - "OUTPUT_BUFFER_TOO_SMALL\0" - "PADDING_CHECK_FAILED\0" - "PKCS_DECODING_ERROR\0" - "SLEN_CHECK_FAILED\0" - "SLEN_RECOVERY_FAILED\0" - "UNKNOWN_ALGORITHM_TYPE\0" - "UNKNOWN_PADDING_TYPE\0" - "VALUE_MISSING\0" - "WRONG_SIGNATURE_LENGTH\0" - "ALPN_MISMATCH_ON_EARLY_DATA\0" - "APPLICATION_DATA_INSTEAD_OF_HANDSHAKE\0" - "APP_DATA_IN_HANDSHAKE\0" - "ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT\0" - "BAD_ALERT\0" - "BAD_CHANGE_CIPHER_SPEC\0" - "BAD_DATA_RETURNED_BY_CALLBACK\0" - "BAD_DH_P_LENGTH\0" - "BAD_DIGEST_LENGTH\0" - "BAD_ECC_CERT\0" - "BAD_ECPOINT\0" - "BAD_HANDSHAKE_RECORD\0" - "BAD_HELLO_REQUEST\0" - "BAD_LENGTH\0" - "BAD_PACKET_LENGTH\0" - "BAD_RSA_ENCRYPT\0" - "BAD_SRTP_MKI_VALUE\0" - "BAD_SRTP_PROTECTION_PROFILE_LIST\0" - "BAD_SSL_FILETYPE\0" - "BAD_WRITE_RETRY\0" - "BIO_NOT_SET\0" - "BLOCK_CIPHER_PAD_IS_WRONG\0" - "BUFFERED_MESSAGES_ON_CIPHER_CHANGE\0" - "CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD\0" - "CANNOT_PARSE_LEAF_CERT\0" - "CA_DN_LENGTH_MISMATCH\0" - "CA_DN_TOO_LONG\0" - "CCS_RECEIVED_EARLY\0" - "CERTIFICATE_AND_PRIVATE_KEY_MISMATCH\0" - "CERTIFICATE_VERIFY_FAILED\0" - "CERT_CB_ERROR\0" - "CERT_LENGTH_MISMATCH\0" - "CHANNEL_ID_NOT_P256\0" - "CHANNEL_ID_SIGNATURE_INVALID\0" - "CIPHER_OR_HASH_UNAVAILABLE\0" - "CLIENTHELLO_PARSE_FAILED\0" - "CLIENTHELLO_TLSEXT\0" - "CONNECTION_REJECTED\0" - "CONNECTION_TYPE_NOT_SET\0" - "CUSTOM_EXTENSION_ERROR\0" - "DATA_LENGTH_TOO_LONG\0" - "DECRYPTION_FAILED\0" - "DECRYPTION_FAILED_OR_BAD_RECORD_MAC\0" - "DH_PUBLIC_VALUE_LENGTH_IS_WRONG\0" - "DH_P_TOO_LONG\0" - "DIGEST_CHECK_FAILED\0" - "DOWNGRADE_DETECTED\0" - "DTLS_MESSAGE_TOO_BIG\0" - "DUPLICATE_EXTENSION\0" - "DUPLICATE_KEY_SHARE\0" - "ECC_CERT_NOT_FOR_SIGNING\0" - "EMS_STATE_INCONSISTENT\0" - "ENCRYPTED_LENGTH_TOO_LONG\0" - "ERROR_ADDING_EXTENSION\0" - "ERROR_IN_RECEIVED_CIPHER_LIST\0" - "ERROR_PARSING_EXTENSION\0" - "EXCESSIVE_MESSAGE_SIZE\0" - "EXTRA_DATA_IN_MESSAGE\0" - "FRAGMENT_MISMATCH\0" - "GOT_NEXT_PROTO_WITHOUT_EXTENSION\0" - "HANDSHAKE_FAILURE_ON_CLIENT_HELLO\0" - "HTTPS_PROXY_REQUEST\0" - "HTTP_REQUEST\0" - "INAPPROPRIATE_FALLBACK\0" - "INVALID_ALPN_PROTOCOL\0" - "INVALID_COMMAND\0" - "INVALID_COMPRESSION_LIST\0" - "INVALID_MESSAGE\0" - "INVALID_OUTER_RECORD_TYPE\0" - "INVALID_SCT_LIST\0" - "INVALID_SSL_SESSION\0" - "INVALID_TICKET_KEYS_LENGTH\0" - "LENGTH_MISMATCH\0" - "MISSING_EXTENSION\0" - "MISSING_KEY_SHARE\0" - "MISSING_RSA_CERTIFICATE\0" - "MISSING_TMP_DH_KEY\0" - "MISSING_TMP_ECDH_KEY\0" - "MIXED_SPECIAL_OPERATOR_WITH_GROUPS\0" - "MTU_TOO_SMALL\0" - "NEGOTIATED_BOTH_NPN_AND_ALPN\0" - "NESTED_GROUP\0" - "NO_CERTIFICATES_RETURNED\0" - "NO_CERTIFICATE_ASSIGNED\0" - "NO_CERTIFICATE_SET\0" - "NO_CIPHERS_AVAILABLE\0" - "NO_CIPHERS_PASSED\0" - "NO_CIPHERS_SPECIFIED\0" - "NO_CIPHER_MATCH\0" - "NO_COMMON_SIGNATURE_ALGORITHMS\0" - "NO_COMPRESSION_SPECIFIED\0" - "NO_GROUPS_SPECIFIED\0" - "NO_METHOD_SPECIFIED\0" - "NO_P256_SUPPORT\0" - "NO_PRIVATE_KEY_ASSIGNED\0" - "NO_RENEGOTIATION\0" - "NO_REQUIRED_DIGEST\0" - "NO_SHARED_CIPHER\0" - "NO_SHARED_GROUP\0" - "NO_SUPPORTED_VERSIONS_ENABLED\0" - "NULL_SSL_CTX\0" - "NULL_SSL_METHOD_PASSED\0" - "OLD_SESSION_CIPHER_NOT_RETURNED\0" - "OLD_SESSION_PRF_HASH_MISMATCH\0" - "OLD_SESSION_VERSION_NOT_RETURNED\0" - "PARSE_TLSEXT\0" - "PATH_TOO_LONG\0" - "PEER_DID_NOT_RETURN_A_CERTIFICATE\0" - "PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE\0" - "PRE_SHARED_KEY_MUST_BE_LAST\0" - "PROTOCOL_IS_SHUTDOWN\0" - "PSK_IDENTITY_BINDER_COUNT_MISMATCH\0" - "PSK_IDENTITY_NOT_FOUND\0" - "PSK_NO_CLIENT_CB\0" - "PSK_NO_SERVER_CB\0" - "READ_TIMEOUT_EXPIRED\0" - "RECORD_LENGTH_MISMATCH\0" - "RECORD_TOO_LARGE\0" - "RENEGOTIATION_EMS_MISMATCH\0" - "RENEGOTIATION_ENCODING_ERR\0" - "RENEGOTIATION_MISMATCH\0" - "REQUIRED_CIPHER_MISSING\0" - "RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION\0" - "RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION\0" - "SCSV_RECEIVED_WHEN_RENEGOTIATING\0" - "SERVERHELLO_TLSEXT\0" - "SERVER_CERT_CHANGED\0" - "SESSION_ID_CONTEXT_UNINITIALIZED\0" - "SESSION_MAY_NOT_BE_CREATED\0" - "SHUTDOWN_WHILE_IN_INIT\0" - "SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER\0" - "SRTP_COULD_NOT_ALLOCATE_PROFILES\0" - "SRTP_UNKNOWN_PROTECTION_PROFILE\0" - "SSL3_EXT_INVALID_SERVERNAME\0" - "SSLV3_ALERT_BAD_CERTIFICATE\0" - "SSLV3_ALERT_BAD_RECORD_MAC\0" - "SSLV3_ALERT_CERTIFICATE_EXPIRED\0" - "SSLV3_ALERT_CERTIFICATE_REVOKED\0" - "SSLV3_ALERT_CERTIFICATE_UNKNOWN\0" - "SSLV3_ALERT_CLOSE_NOTIFY\0" - "SSLV3_ALERT_DECOMPRESSION_FAILURE\0" - "SSLV3_ALERT_HANDSHAKE_FAILURE\0" - "SSLV3_ALERT_ILLEGAL_PARAMETER\0" - "SSLV3_ALERT_NO_CERTIFICATE\0" - "SSLV3_ALERT_UNEXPECTED_MESSAGE\0" - "SSLV3_ALERT_UNSUPPORTED_CERTIFICATE\0" - "SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION\0" - "SSL_HANDSHAKE_FAILURE\0" - "SSL_SESSION_ID_CONTEXT_TOO_LONG\0" - "TICKET_ENCRYPTION_FAILED\0" - "TLSV1_ALERT_ACCESS_DENIED\0" - "TLSV1_ALERT_DECODE_ERROR\0" - "TLSV1_ALERT_DECRYPTION_FAILED\0" - "TLSV1_ALERT_DECRYPT_ERROR\0" - "TLSV1_ALERT_EXPORT_RESTRICTION\0" - "TLSV1_ALERT_INAPPROPRIATE_FALLBACK\0" - "TLSV1_ALERT_INSUFFICIENT_SECURITY\0" - "TLSV1_ALERT_INTERNAL_ERROR\0" - "TLSV1_ALERT_NO_RENEGOTIATION\0" - "TLSV1_ALERT_PROTOCOL_VERSION\0" - "TLSV1_ALERT_RECORD_OVERFLOW\0" - "TLSV1_ALERT_UNKNOWN_CA\0" - "TLSV1_ALERT_USER_CANCELLED\0" - "TLSV1_BAD_CERTIFICATE_HASH_VALUE\0" - "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\0" - "TLSV1_CERTIFICATE_REQUIRED\0" - "TLSV1_CERTIFICATE_UNOBTAINABLE\0" - "TLSV1_UNKNOWN_PSK_IDENTITY\0" - "TLSV1_UNRECOGNIZED_NAME\0" - "TLSV1_UNSUPPORTED_EXTENSION\0" - "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\0" - "TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\0" - "TOO_MANY_EMPTY_FRAGMENTS\0" - "TOO_MANY_KEY_UPDATES\0" - "TOO_MANY_WARNING_ALERTS\0" - "TOO_MUCH_READ_EARLY_DATA\0" - "TOO_MUCH_SKIPPED_EARLY_DATA\0" - "UNABLE_TO_FIND_ECDH_PARAMETERS\0" - "UNEXPECTED_EXTENSION\0" - "UNEXPECTED_EXTENSION_ON_EARLY_DATA\0" - "UNEXPECTED_MESSAGE\0" - "UNEXPECTED_OPERATOR_IN_GROUP\0" - "UNEXPECTED_RECORD\0" - "UNKNOWN_ALERT_TYPE\0" - "UNKNOWN_CERTIFICATE_TYPE\0" - "UNKNOWN_CIPHER_RETURNED\0" - "UNKNOWN_CIPHER_TYPE\0" - "UNKNOWN_KEY_EXCHANGE_TYPE\0" - "UNKNOWN_PROTOCOL\0" - "UNKNOWN_SSL_VERSION\0" - "UNKNOWN_STATE\0" - "UNSAFE_LEGACY_RENEGOTIATION_DISABLED\0" - "UNSUPPORTED_COMPRESSION_ALGORITHM\0" - "UNSUPPORTED_ELLIPTIC_CURVE\0" - "UNSUPPORTED_PROTOCOL\0" - "UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY\0" - "WRONG_CERTIFICATE_TYPE\0" - "WRONG_CIPHER_RETURNED\0" - "WRONG_CURVE\0" - "WRONG_MESSAGE_TYPE\0" - "WRONG_SIGNATURE_TYPE\0" - "WRONG_SSL_VERSION\0" - "WRONG_VERSION_NUMBER\0" - "WRONG_VERSION_ON_EARLY_DATA\0" - "X509_LIB\0" - "X509_VERIFICATION_SETUP_PROBLEMS\0" - "AKID_MISMATCH\0" - "BAD_X509_FILETYPE\0" - "BASE64_DECODE_ERROR\0" - "CANT_CHECK_DH_KEY\0" - "CERT_ALREADY_IN_HASH_TABLE\0" - "CRL_ALREADY_DELTA\0" - "CRL_VERIFY_FAILURE\0" - "IDP_MISMATCH\0" - "INVALID_DIRECTORY\0" - "INVALID_FIELD_NAME\0" - "INVALID_PARAMETER\0" - "INVALID_PSS_PARAMETERS\0" - "INVALID_TRUST\0" - "ISSUER_MISMATCH\0" - "KEY_TYPE_MISMATCH\0" - "KEY_VALUES_MISMATCH\0" - "LOADING_CERT_DIR\0" - "LOADING_DEFAULTS\0" - "NAME_TOO_LONG\0" - "NEWER_CRL_NOT_NEWER\0" - "NO_CERT_SET_FOR_US_TO_VERIFY\0" - "NO_CRL_NUMBER\0" - "PUBLIC_KEY_DECODE_ERROR\0" - "PUBLIC_KEY_ENCODE_ERROR\0" - "SHOULD_RETRY\0" - "UNKNOWN_KEY_TYPE\0" - "UNKNOWN_PURPOSE_ID\0" - "UNKNOWN_TRUST_ID\0" - "WRONG_LOOKUP_TYPE\0" - "BAD_IP_ADDRESS\0" - "BAD_OBJECT\0" - "BN_DEC2BN_ERROR\0" - "BN_TO_ASN1_INTEGER_ERROR\0" - "CANNOT_FIND_FREE_FUNCTION\0" - "DIRNAME_ERROR\0" - "DISTPOINT_ALREADY_SET\0" - "DUPLICATE_ZONE_ID\0" - "ERROR_CONVERTING_ZONE\0" - "ERROR_CREATING_EXTENSION\0" - "ERROR_IN_EXTENSION\0" - "EXPECTED_A_SECTION_NAME\0" - "EXTENSION_EXISTS\0" - "EXTENSION_NAME_ERROR\0" - "EXTENSION_NOT_FOUND\0" - "EXTENSION_SETTING_NOT_SUPPORTED\0" - "EXTENSION_VALUE_ERROR\0" - "ILLEGAL_EMPTY_EXTENSION\0" - "ILLEGAL_HEX_DIGIT\0" - "INCORRECT_POLICY_SYNTAX_TAG\0" - "INVALID_BOOLEAN_STRING\0" - "INVALID_EXTENSION_STRING\0" - "INVALID_MULTIPLE_RDNS\0" - "INVALID_NAME\0" - "INVALID_NULL_ARGUMENT\0" - "INVALID_NULL_NAME\0" - "INVALID_NULL_VALUE\0" - "INVALID_NUMBERS\0" - "INVALID_OBJECT_IDENTIFIER\0" - "INVALID_OPTION\0" - "INVALID_POLICY_IDENTIFIER\0" - "INVALID_PROXY_POLICY_SETTING\0" - "INVALID_PURPOSE\0" - "INVALID_SECTION\0" - "INVALID_SYNTAX\0" - "ISSUER_DECODE_ERROR\0" - "NEED_ORGANIZATION_AND_NUMBERS\0" - "NO_CONFIG_DATABASE\0" - "NO_ISSUER_CERTIFICATE\0" - "NO_ISSUER_DETAILS\0" - "NO_POLICY_IDENTIFIER\0" - "NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED\0" - "NO_PUBLIC_KEY\0" - "NO_SUBJECT_DETAILS\0" - "ODD_NUMBER_OF_DIGITS\0" - "OPERATION_NOT_DEFINED\0" - "OTHERNAME_ERROR\0" - "POLICY_LANGUAGE_ALREADY_DEFINED\0" - "POLICY_PATH_LENGTH\0" - "POLICY_PATH_LENGTH_ALREADY_DEFINED\0" - "POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY\0" - "SECTION_NOT_FOUND\0" - "UNABLE_TO_GET_ISSUER_DETAILS\0" - "UNABLE_TO_GET_ISSUER_KEYID\0" - "UNKNOWN_BIT_STRING_ARGUMENT\0" - "UNKNOWN_EXTENSION\0" - "UNKNOWN_EXTENSION_NAME\0" - "UNKNOWN_OPTION\0" - "UNSUPPORTED_OPTION\0" - "USER_TOO_LONG\0" - ""; diff --git a/Pods/BoringSSL-GRPC/err_data.c.grpc_back b/Pods/BoringSSL-GRPC/err_data.c.grpc_back index e6c3f909b..7830d6f12 100644 --- a/Pods/BoringSSL-GRPC/err_data.c.grpc_back +++ b/Pods/BoringSSL-GRPC/err_data.c.grpc_back @@ -1,1341 +1,1407 @@ - /* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - /* This file was generated by err_data_generate.go. */ + /* This file was generated by err_data_generate.go. */ - #include - #include - #include +#include +#include +#include - OPENSSL_COMPILE_ASSERT(ERR_LIB_NONE == 1, library_values_changed_1); - OPENSSL_COMPILE_ASSERT(ERR_LIB_SYS == 2, library_values_changed_2); - OPENSSL_COMPILE_ASSERT(ERR_LIB_BN == 3, library_values_changed_3); - OPENSSL_COMPILE_ASSERT(ERR_LIB_RSA == 4, library_values_changed_4); - OPENSSL_COMPILE_ASSERT(ERR_LIB_DH == 5, library_values_changed_5); - OPENSSL_COMPILE_ASSERT(ERR_LIB_EVP == 6, library_values_changed_6); - OPENSSL_COMPILE_ASSERT(ERR_LIB_BUF == 7, library_values_changed_7); - OPENSSL_COMPILE_ASSERT(ERR_LIB_OBJ == 8, library_values_changed_8); - OPENSSL_COMPILE_ASSERT(ERR_LIB_PEM == 9, library_values_changed_9); - OPENSSL_COMPILE_ASSERT(ERR_LIB_DSA == 10, library_values_changed_10); - OPENSSL_COMPILE_ASSERT(ERR_LIB_X509 == 11, library_values_changed_11); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ASN1 == 12, library_values_changed_12); - OPENSSL_COMPILE_ASSERT(ERR_LIB_CONF == 13, library_values_changed_13); - OPENSSL_COMPILE_ASSERT(ERR_LIB_CRYPTO == 14, library_values_changed_14); - OPENSSL_COMPILE_ASSERT(ERR_LIB_EC == 15, library_values_changed_15); - OPENSSL_COMPILE_ASSERT(ERR_LIB_SSL == 16, library_values_changed_16); - OPENSSL_COMPILE_ASSERT(ERR_LIB_BIO == 17, library_values_changed_17); - OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS7 == 18, library_values_changed_18); - OPENSSL_COMPILE_ASSERT(ERR_LIB_PKCS8 == 19, library_values_changed_19); - OPENSSL_COMPILE_ASSERT(ERR_LIB_X509V3 == 20, library_values_changed_20); - OPENSSL_COMPILE_ASSERT(ERR_LIB_RAND == 21, library_values_changed_21); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ENGINE == 22, library_values_changed_22); - OPENSSL_COMPILE_ASSERT(ERR_LIB_OCSP == 23, library_values_changed_23); - OPENSSL_COMPILE_ASSERT(ERR_LIB_UI == 24, library_values_changed_24); - OPENSSL_COMPILE_ASSERT(ERR_LIB_COMP == 25, library_values_changed_25); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDSA == 26, library_values_changed_26); - OPENSSL_COMPILE_ASSERT(ERR_LIB_ECDH == 27, library_values_changed_27); - OPENSSL_COMPILE_ASSERT(ERR_LIB_HMAC == 28, library_values_changed_28); - OPENSSL_COMPILE_ASSERT(ERR_LIB_DIGEST == 29, library_values_changed_29); - OPENSSL_COMPILE_ASSERT(ERR_LIB_CIPHER == 30, library_values_changed_30); - OPENSSL_COMPILE_ASSERT(ERR_LIB_HKDF == 31, library_values_changed_31); - OPENSSL_COMPILE_ASSERT(ERR_LIB_USER == 32, library_values_changed_32); - OPENSSL_COMPILE_ASSERT(ERR_NUM_LIBS == 33, library_values_changed_num); +OPENSSL_STATIC_ASSERT(ERR_LIB_NONE == 1, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_SYS == 2, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_BN == 3, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_RSA == 4, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_DH == 5, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_EVP == 6, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_BUF == 7, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_OBJ == 8, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_PEM == 9, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_DSA == 10, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_X509 == 11, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ASN1 == 12, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_CONF == 13, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_CRYPTO == 14, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_EC == 15, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_SSL == 16, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_BIO == 17, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS7 == 18, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_PKCS8 == 19, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_X509V3 == 20, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_RAND == 21, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ENGINE == 22, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_OCSP == 23, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_UI == 24, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_COMP == 25, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ECDSA == 26, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_ECDH == 27, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_HMAC == 28, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_DIGEST == 29, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_CIPHER == 30, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_HKDF == 31, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_LIB_USER == 32, "library value changed"); +OPENSSL_STATIC_ASSERT(ERR_NUM_LIBS == 33, "number of libraries changed"); - const uint32_t kOpenSSLReasonValues[] = { - 0xc320838, - 0xc328852, - 0xc330861, - 0xc338871, - 0xc340880, - 0xc348899, - 0xc3508a5, - 0xc3588c2, - 0xc3608e2, - 0xc3688f0, - 0xc370900, - 0xc37890d, - 0xc38091d, - 0xc388928, - 0xc39093e, - 0xc39894d, - 0xc3a0961, - 0xc3a8845, - 0xc3b00ea, - 0xc3b88d4, - 0x10320845, - 0x10329513, - 0x1033151f, - 0x10339538, - 0x1034154b, - 0x10348eed, - 0x10350c5e, - 0x1035955e, - 0x10361573, - 0x10369586, - 0x103715a5, - 0x103795be, - 0x103815d3, - 0x103895f1, - 0x10391600, - 0x1039961c, - 0x103a1637, - 0x103a9646, - 0x103b1662, - 0x103b967d, - 0x103c1694, - 0x103c80ea, - 0x103d16a5, - 0x103d96b9, - 0x103e16d8, - 0x103e96e7, - 0x103f16fe, - 0x103f9711, - 0x10400c22, - 0x10409724, - 0x10411742, - 0x10419755, - 0x1042176f, - 0x1042977f, - 0x10431793, - 0x104397a9, - 0x104417c1, - 0x104497d6, - 0x104517ea, - 0x104597fc, - 0x104605fb, - 0x1046894d, - 0x10471811, - 0x10479828, - 0x1048183d, - 0x1048984b, - 0x10490e4f, - 0x14320c05, - 0x14328c13, - 0x14330c22, - 0x14338c34, - 0x143400ac, - 0x143480ea, - 0x18320083, - 0x18328f43, - 0x183300ac, - 0x18338f59, - 0x18340f6d, - 0x183480ea, - 0x18350f82, - 0x18358f9a, - 0x18360faf, - 0x18368fc3, - 0x18370fe7, - 0x18378ffd, - 0x18381011, - 0x18389021, - 0x18390a73, - 0x18399031, - 0x183a1059, - 0x183a907f, - 0x183b0c6a, - 0x183b90b4, - 0x183c10c6, - 0x183c90d1, - 0x183d10e1, - 0x183d90f2, - 0x183e1103, - 0x183e9115, - 0x183f113e, - 0x183f9157, - 0x1840116f, - 0x184086d3, - 0x184110a2, - 0x1841906d, - 0x1842108c, - 0x18429046, - 0x20321196, - 0x243211a2, - 0x24328993, - 0x243311b4, - 0x243391c1, - 0x243411ce, - 0x243491e0, - 0x243511ef, - 0x2435920c, - 0x24361219, - 0x24369227, - 0x24371235, - 0x24379243, - 0x2438124c, - 0x24389259, - 0x2439126c, - 0x28320c52, - 0x28328c6a, - 0x28330c22, - 0x28338c7d, - 0x28340c5e, - 0x283480ac, - 0x283500ea, - 0x2c322c30, - 0x2c329283, - 0x2c332c3e, - 0x2c33ac50, - 0x2c342c64, - 0x2c34ac76, - 0x2c352c91, - 0x2c35aca3, - 0x2c362cb6, - 0x2c36832d, - 0x2c372cc3, - 0x2c37acd5, - 0x2c382cfa, - 0x2c38ad11, - 0x2c392d1f, - 0x2c39ad2f, - 0x2c3a2d41, - 0x2c3aad55, - 0x2c3b2d66, - 0x2c3bad85, - 0x2c3c1295, - 0x2c3c92ab, - 0x2c3d2d99, - 0x2c3d92c4, - 0x2c3e2db6, - 0x2c3eadc4, - 0x2c3f2ddc, - 0x2c3fadf4, - 0x2c402e01, - 0x2c409196, - 0x2c412e12, - 0x2c41ae25, - 0x2c42116f, - 0x2c42ae36, - 0x2c430720, - 0x2c43ad77, - 0x2c442ce8, - 0x30320000, - 0x30328015, - 0x3033001f, - 0x30338038, - 0x3034004a, - 0x30348064, - 0x3035006b, - 0x30358083, - 0x30360094, - 0x303680ac, - 0x303700b9, - 0x303780c8, - 0x303800ea, - 0x303880f7, - 0x3039010a, - 0x30398125, - 0x303a013a, - 0x303a814e, - 0x303b0162, - 0x303b8173, - 0x303c018c, - 0x303c81a9, - 0x303d01b7, - 0x303d81cb, - 0x303e01db, - 0x303e81f4, - 0x303f0204, - 0x303f8217, - 0x30400226, - 0x30408232, - 0x30410247, - 0x30418257, - 0x3042026e, - 0x3042827b, - 0x3043028e, - 0x3043829d, - 0x304402b2, - 0x304482d3, - 0x304502e6, - 0x304582f9, - 0x30460312, - 0x3046832d, - 0x3047034a, - 0x30478363, - 0x30480371, - 0x30488382, - 0x30490391, - 0x304983a9, - 0x304a03bb, - 0x304a83cf, - 0x304b03ee, - 0x304b8401, - 0x304c040c, - 0x304c841d, - 0x304d0429, - 0x304d843f, - 0x304e044d, - 0x304e8463, - 0x304f0475, - 0x304f8487, - 0x3050049a, - 0x305084ad, - 0x305104be, - 0x305184ce, - 0x305204e6, - 0x305284fb, - 0x30530513, - 0x30538527, - 0x3054053f, - 0x30548558, - 0x30550571, - 0x3055858e, - 0x30560599, - 0x305685b1, - 0x305705c1, - 0x305785d2, - 0x305805e5, - 0x305885fb, - 0x30590604, - 0x30598619, - 0x305a062c, - 0x305a863b, - 0x305b065b, - 0x305b866a, - 0x305c068b, - 0x305c86a7, - 0x305d06b3, - 0x305d86d3, - 0x305e06ef, - 0x305e8700, - 0x305f0716, - 0x305f8720, - 0x34320b63, - 0x34328b77, - 0x34330b94, - 0x34338ba7, - 0x34340bb6, - 0x34348bef, - 0x34350bd3, - 0x3c320083, - 0x3c328ca7, - 0x3c330cc0, - 0x3c338cdb, - 0x3c340cf8, - 0x3c348d22, - 0x3c350d3d, - 0x3c358d63, - 0x3c360d7c, - 0x3c368d94, - 0x3c370da5, - 0x3c378db3, - 0x3c380dc0, - 0x3c388dd4, - 0x3c390c6a, - 0x3c398de8, - 0x3c3a0dfc, - 0x3c3a890d, - 0x3c3b0e0c, - 0x3c3b8e27, - 0x3c3c0e39, - 0x3c3c8e6c, - 0x3c3d0e76, - 0x3c3d8e8a, - 0x3c3e0e98, - 0x3c3e8ebd, - 0x3c3f0c93, - 0x3c3f8ea6, - 0x3c4000ac, - 0x3c4080ea, - 0x3c410d13, - 0x3c418d52, - 0x3c420e4f, - 0x403218a4, - 0x403298ba, - 0x403318e8, - 0x403398f2, - 0x40341909, - 0x40349927, - 0x40351937, - 0x40359949, - 0x40361956, - 0x40369962, - 0x40371977, - 0x40379989, - 0x40381994, - 0x403899a6, - 0x40390eed, - 0x403999b6, - 0x403a19c9, - 0x403a99ea, - 0x403b19fb, - 0x403b9a0b, - 0x403c0064, - 0x403c8083, - 0x403d1a8f, - 0x403d9aa5, - 0x403e1ab4, - 0x403e9aec, - 0x403f1b06, - 0x403f9b14, - 0x40401b29, - 0x40409b3d, - 0x40411b5a, - 0x40419b75, - 0x40421b8e, - 0x40429ba1, - 0x40431bb5, - 0x40439bcd, - 0x40441be4, - 0x404480ac, - 0x40451bf9, - 0x40459c0b, - 0x40461c2f, - 0x40469c4f, - 0x40471c5d, - 0x40479c84, - 0x40481cc1, - 0x40489cda, - 0x40491cf1, - 0x40499d0b, - 0x404a1d22, - 0x404a9d40, - 0x404b1d58, - 0x404b9d6f, - 0x404c1d85, - 0x404c9d97, - 0x404d1db8, - 0x404d9dda, - 0x404e1dee, - 0x404e9dfb, - 0x404f1e28, - 0x404f9e51, - 0x40501e8c, - 0x40509ea0, - 0x40511ebb, - 0x40521ecb, - 0x40529eef, - 0x40531f07, - 0x40539f1a, - 0x40541f2f, - 0x40549f52, - 0x40551f60, - 0x40559f7d, - 0x40561f8a, - 0x40569fa3, - 0x40571fbb, - 0x40579fce, - 0x40581fe3, - 0x4058a00a, - 0x40592039, - 0x4059a066, - 0x405a207a, - 0x405aa08a, - 0x405b20a2, - 0x405ba0b3, - 0x405c20c6, - 0x405ca105, - 0x405d2112, - 0x405da129, - 0x405e2167, - 0x405e8ab1, - 0x405f2188, - 0x405fa195, - 0x406021a3, - 0x4060a1c5, - 0x40612209, - 0x4061a241, - 0x40622258, - 0x4062a269, - 0x4063227a, - 0x4063a28f, - 0x406422a6, - 0x4064a2d2, - 0x406522ed, - 0x4065a304, - 0x4066231c, - 0x4066a346, - 0x40672371, - 0x4067a392, - 0x406823b9, - 0x4068a3da, - 0x4069240c, - 0x4069a43a, - 0x406a245b, - 0x406aa47b, - 0x406b2603, - 0x406ba626, - 0x406c263c, - 0x406ca8b7, - 0x406d28e6, - 0x406da90e, - 0x406e293c, - 0x406ea989, - 0x406f29a8, - 0x406fa9e0, - 0x407029f3, - 0x4070aa10, - 0x40710800, - 0x4071aa22, - 0x40722a35, - 0x4072aa4e, - 0x40732a66, - 0x40739482, - 0x40742a7a, - 0x4074aa94, - 0x40752aa5, - 0x4075aab9, - 0x40762ac7, - 0x40769259, - 0x40772aec, - 0x4077ab0e, - 0x40782b29, - 0x4078ab62, - 0x40792b79, - 0x4079ab8f, - 0x407a2b9b, - 0x407aabae, - 0x407b2bc3, - 0x407babd5, - 0x407c2c06, - 0x407cac0f, - 0x407d23f5, - 0x407d9e61, - 0x407e2b3e, - 0x407ea01a, - 0x407f1c71, - 0x407f9a31, - 0x40801e38, - 0x40809c99, - 0x40811edd, - 0x40819e12, - 0x40822927, - 0x40829a17, - 0x40831ff5, - 0x4083a2b7, - 0x40841cad, - 0x4084a052, - 0x408520d7, - 0x4085a1ed, - 0x40862149, - 0x40869e7b, - 0x4087296d, - 0x4087a21e, - 0x40881a78, - 0x4088a3a5, - 0x40891ac7, - 0x40899a54, - 0x408a265c, - 0x408a9862, - 0x408b2bea, - 0x408ba9bd, - 0x408c20e7, - 0x408c987e, - 0x41f4252e, - 0x41f925c0, - 0x41fe24b3, - 0x41fea6a8, - 0x41ff2799, - 0x42032547, - 0x42082569, - 0x4208a5a5, - 0x42092497, - 0x4209a5df, - 0x420a24ee, - 0x420aa4ce, - 0x420b250e, - 0x420ba587, - 0x420c27b5, - 0x420ca675, - 0x420d268f, - 0x420da6c6, - 0x421226e0, - 0x4217277c, - 0x4217a722, - 0x421c2744, - 0x421f26ff, - 0x422127cc, - 0x4226275f, - 0x422b289b, - 0x422ba849, - 0x422c2883, - 0x422ca808, - 0x422d27e7, - 0x422da868, - 0x422e282e, - 0x422ea954, - 0x4432072b, - 0x4432873a, - 0x44330746, - 0x44338754, - 0x44340767, - 0x44348778, - 0x4435077f, - 0x44358789, - 0x4436079c, - 0x443687b2, - 0x443707c4, - 0x443787d1, - 0x443807e0, - 0x443887e8, - 0x44390800, - 0x4439880e, - 0x443a0821, - 0x48321283, - 0x48329295, - 0x483312ab, - 0x483392c4, - 0x4c3212e9, - 0x4c3292f9, - 0x4c33130c, - 0x4c33932c, - 0x4c3400ac, - 0x4c3480ea, - 0x4c351338, - 0x4c359346, - 0x4c361362, - 0x4c369375, - 0x4c371384, - 0x4c379392, - 0x4c3813a7, - 0x4c3893b3, - 0x4c3913d3, - 0x4c3993fd, - 0x4c3a1416, - 0x4c3a942f, - 0x4c3b05fb, - 0x4c3b9448, - 0x4c3c145a, - 0x4c3c9469, - 0x4c3d1482, - 0x4c3d8c45, - 0x4c3e14db, - 0x4c3e9491, - 0x4c3f14fd, - 0x4c3f9259, - 0x4c4014a7, - 0x4c4092d5, - 0x4c4114cb, - 0x50322e48, - 0x5032ae57, - 0x50332e62, - 0x5033ae72, - 0x50342e8b, - 0x5034aea5, - 0x50352eb3, - 0x5035aec9, - 0x50362edb, - 0x5036aef1, - 0x50372f0a, - 0x5037af1d, - 0x50382f35, - 0x5038af46, - 0x50392f5b, - 0x5039af6f, - 0x503a2f8f, - 0x503aafa5, - 0x503b2fbd, - 0x503bafcf, - 0x503c2feb, - 0x503cb002, - 0x503d301b, - 0x503db031, - 0x503e303e, - 0x503eb054, - 0x503f3066, - 0x503f8382, - 0x50403079, - 0x5040b089, - 0x504130a3, - 0x5041b0b2, - 0x504230cc, - 0x5042b0e9, - 0x504330f9, - 0x5043b109, - 0x50443118, - 0x5044843f, - 0x5045312c, - 0x5045b14a, - 0x5046315d, - 0x5046b173, - 0x50473185, - 0x5047b19a, - 0x504831c0, - 0x5048b1ce, - 0x504931e1, - 0x5049b1f6, - 0x504a320c, - 0x504ab21c, - 0x504b323c, - 0x504bb24f, - 0x504c3272, - 0x504cb2a0, - 0x504d32b2, - 0x504db2cf, - 0x504e32ea, - 0x504eb306, - 0x504f3318, - 0x504fb32f, - 0x5050333e, - 0x505086ef, - 0x50513351, - 0x58320f2b, - 0x68320eed, - 0x68328c6a, - 0x68330c7d, - 0x68338efb, - 0x68340f0b, - 0x683480ea, - 0x6c320ec9, - 0x6c328c34, - 0x6c330ed4, - 0x74320a19, - 0x743280ac, - 0x74330c45, - 0x7832097e, - 0x78328993, - 0x7833099f, - 0x78338083, - 0x783409ae, - 0x783489c3, - 0x783509e2, - 0x78358a04, - 0x78360a19, - 0x78368a2f, - 0x78370a3f, - 0x78378a60, - 0x78380a73, - 0x78388a85, - 0x78390a92, - 0x78398ab1, - 0x783a0ac6, - 0x783a8ad4, - 0x783b0ade, - 0x783b8af2, - 0x783c0b09, - 0x783c8b1e, - 0x783d0b35, - 0x783d8b4a, - 0x783e0aa0, - 0x783e8a52, - 0x7c321185, - }; +const uint32_t kOpenSSLReasonValues[] = { + 0xc32083a, + 0xc328854, + 0xc330863, + 0xc338873, + 0xc340882, + 0xc34889b, + 0xc3508a7, + 0xc3588c4, + 0xc3608e4, + 0xc3688f2, + 0xc370902, + 0xc37890f, + 0xc38091f, + 0xc38892a, + 0xc390940, + 0xc39894f, + 0xc3a0963, + 0xc3a8847, + 0xc3b00ea, + 0xc3b88d6, + 0x10320847, + 0x1032959f, + 0x103315ab, + 0x103395c4, + 0x103415d7, + 0x10348f27, + 0x10350c60, + 0x103595ea, + 0x10361614, + 0x10369627, + 0x10371646, + 0x1037965f, + 0x10381674, + 0x10389692, + 0x103916a1, + 0x103996bd, + 0x103a16d8, + 0x103a96e7, + 0x103b1703, + 0x103b971e, + 0x103c1744, + 0x103c80ea, + 0x103d1755, + 0x103d9769, + 0x103e1788, + 0x103e9797, + 0x103f17ae, + 0x103f97c1, + 0x10400c24, + 0x104097d4, + 0x104117f2, + 0x10419805, + 0x1042181f, + 0x1042982f, + 0x10431843, + 0x10439859, + 0x10441871, + 0x10449886, + 0x1045189a, + 0x104598ac, + 0x104605fd, + 0x1046894f, + 0x104718c1, + 0x104798d8, + 0x104818ed, + 0x104898fb, + 0x10490e73, + 0x10499735, + 0x104a15ff, + 0x14320c07, + 0x14328c15, + 0x14330c24, + 0x14338c36, + 0x143400ac, + 0x143480ea, + 0x18320083, + 0x18328f7d, + 0x183300ac, + 0x18338f93, + 0x18340fa7, + 0x183480ea, + 0x18350fbc, + 0x18358fd4, + 0x18360fe9, + 0x18368ffd, + 0x18371021, + 0x18379037, + 0x1838104b, + 0x1838905b, + 0x18390a75, + 0x1839906b, + 0x183a1091, + 0x183a90b7, + 0x183b0c7f, + 0x183b9106, + 0x183c1118, + 0x183c9123, + 0x183d1133, + 0x183d9144, + 0x183e1155, + 0x183e9167, + 0x183f1190, + 0x183f91a9, + 0x184011c1, + 0x184086d5, + 0x184110da, + 0x184190a5, + 0x184210c4, + 0x18428c6c, + 0x18431080, + 0x184390ec, + 0x203211fb, + 0x203291e8, + 0x24321207, + 0x24328995, + 0x24331219, + 0x24339226, + 0x24341233, + 0x24349245, + 0x24351254, + 0x24359271, + 0x2436127e, + 0x2436928c, + 0x2437129a, + 0x243792a8, + 0x243812b1, + 0x243892be, + 0x243912d1, + 0x28320c54, + 0x28328c7f, + 0x28330c24, + 0x28338c92, + 0x28340c60, + 0x283480ac, + 0x283500ea, + 0x28358c6c, + 0x2c322f0c, + 0x2c3292e8, + 0x2c332f1a, + 0x2c33af2c, + 0x2c342f40, + 0x2c34af52, + 0x2c352f6d, + 0x2c35af7f, + 0x2c362f92, + 0x2c36832d, + 0x2c372f9f, + 0x2c37afb1, + 0x2c382fd6, + 0x2c38afed, + 0x2c392ffb, + 0x2c39b00b, + 0x2c3a301d, + 0x2c3ab031, + 0x2c3b3042, + 0x2c3bb061, + 0x2c3c12fa, + 0x2c3c9310, + 0x2c3d3075, + 0x2c3d9329, + 0x2c3e3092, + 0x2c3eb0a0, + 0x2c3f30b8, + 0x2c3fb0d0, + 0x2c4030fa, + 0x2c4091fb, + 0x2c41310b, + 0x2c41b11e, + 0x2c4211c1, + 0x2c42b12f, + 0x2c430722, + 0x2c43b053, + 0x2c442fc4, + 0x2c44b0dd, + 0x30320000, + 0x30328015, + 0x3033001f, + 0x30338038, + 0x3034004a, + 0x30348064, + 0x3035006b, + 0x30358083, + 0x30360094, + 0x303680ac, + 0x303700b9, + 0x303780c8, + 0x303800ea, + 0x303880f7, + 0x3039010a, + 0x30398125, + 0x303a013a, + 0x303a814e, + 0x303b0162, + 0x303b8173, + 0x303c018c, + 0x303c81a9, + 0x303d01b7, + 0x303d81cb, + 0x303e01db, + 0x303e81f4, + 0x303f0204, + 0x303f8217, + 0x30400226, + 0x30408232, + 0x30410247, + 0x30418257, + 0x3042026e, + 0x3042827b, + 0x3043028e, + 0x3043829d, + 0x304402b2, + 0x304482d3, + 0x304502e6, + 0x304582f9, + 0x30460312, + 0x3046832d, + 0x3047034a, + 0x3047835c, + 0x3048036a, + 0x3048837b, + 0x3049038a, + 0x304983a2, + 0x304a03b4, + 0x304a83c8, + 0x304b03e0, + 0x304b83f3, + 0x304c03fe, + 0x304c840f, + 0x304d041b, + 0x304d8431, + 0x304e043f, + 0x304e8455, + 0x304f0467, + 0x304f8479, + 0x3050049c, + 0x305084af, + 0x305104c0, + 0x305184d0, + 0x305204e8, + 0x305284fd, + 0x30530515, + 0x30538529, + 0x30540541, + 0x3054855a, + 0x30550573, + 0x30558590, + 0x3056059b, + 0x305685b3, + 0x305705c3, + 0x305785d4, + 0x305805e7, + 0x305885fd, + 0x30590606, + 0x3059861b, + 0x305a062e, + 0x305a863d, + 0x305b065d, + 0x305b866c, + 0x305c068d, + 0x305c86a9, + 0x305d06b5, + 0x305d86d5, + 0x305e06f1, + 0x305e8702, + 0x305f0718, + 0x305f8722, + 0x3060048c, + 0x34320b65, + 0x34328b79, + 0x34330b96, + 0x34338ba9, + 0x34340bb8, + 0x34348bf1, + 0x34350bd5, + 0x3c320083, + 0x3c328cbc, + 0x3c330cd5, + 0x3c338cf0, + 0x3c340d0d, + 0x3c348d37, + 0x3c350d52, + 0x3c358d78, + 0x3c360d91, + 0x3c368da9, + 0x3c370dba, + 0x3c378dc8, + 0x3c380dd5, + 0x3c388de9, + 0x3c390c7f, + 0x3c398e0c, + 0x3c3a0e20, + 0x3c3a890f, + 0x3c3b0e30, + 0x3c3b8e4b, + 0x3c3c0e5d, + 0x3c3c8e90, + 0x3c3d0e9a, + 0x3c3d8eae, + 0x3c3e0ebc, + 0x3c3e8ee1, + 0x3c3f0ca8, + 0x3c3f8eca, + 0x3c4000ac, + 0x3c4080ea, + 0x3c410d28, + 0x3c418d67, + 0x3c420e73, + 0x3c428dfd, + 0x40321971, + 0x40329987, + 0x403319b5, + 0x403399bf, + 0x403419d6, + 0x403499f4, + 0x40351a04, + 0x40359a16, + 0x40361a23, + 0x40369a2f, + 0x40371a44, + 0x40379a56, + 0x40381a61, + 0x40389a73, + 0x40390f27, + 0x40399a83, + 0x403a1a96, + 0x403a9ab7, + 0x403b1ac8, + 0x403b9ad8, + 0x403c0064, + 0x403c8083, + 0x403d1b5c, + 0x403d9b72, + 0x403e1b81, + 0x403e9bb9, + 0x403f1bd3, + 0x403f9bfb, + 0x40401c10, + 0x40409c24, + 0x40411c41, + 0x40419c5c, + 0x40421c75, + 0x40429c88, + 0x40431c9c, + 0x40439cb4, + 0x40441ccb, + 0x404480ac, + 0x40451ce0, + 0x40459cf2, + 0x40461d16, + 0x40469d36, + 0x40471d44, + 0x40479d6b, + 0x40481ddc, + 0x40489e0f, + 0x40491e26, + 0x40499e40, + 0x404a1e57, + 0x404a9e75, + 0x404b1e8d, + 0x404b9ea4, + 0x404c1eba, + 0x404c9ecc, + 0x404d1eed, + 0x404d9f26, + 0x404e1f3a, + 0x404e9f47, + 0x404f1f8e, + 0x404f9fd4, + 0x4050202b, + 0x4050a03f, + 0x40512072, + 0x40522082, + 0x4052a0a6, + 0x405320be, + 0x4053a0d1, + 0x405420e6, + 0x4054a109, + 0x40552117, + 0x4055a154, + 0x40562161, + 0x4056a17a, + 0x40572192, + 0x4057a1a5, + 0x405821ba, + 0x4058a1e1, + 0x40592210, + 0x4059a23d, + 0x405a2251, + 0x405aa261, + 0x405b2279, + 0x405ba28a, + 0x405c229d, + 0x405ca2dc, + 0x405d22e9, + 0x405da30e, + 0x405e234c, + 0x405e8ab3, + 0x405f236d, + 0x405fa37a, + 0x40602388, + 0x4060a3aa, + 0x4061240b, + 0x4061a443, + 0x4062245a, + 0x4062a46b, + 0x40632490, + 0x4063a4a5, + 0x406424bc, + 0x4064a4e8, + 0x40652503, + 0x4065a51a, + 0x40662532, + 0x4066a55c, + 0x40672587, + 0x4067a5cc, + 0x40682614, + 0x4068a635, + 0x40692667, + 0x4069a695, + 0x406a26b6, + 0x406aa6d6, + 0x406b285e, + 0x406ba881, + 0x406c2897, + 0x406cab3a, + 0x406d2b69, + 0x406dab91, + 0x406e2bbf, + 0x406eac0c, + 0x406f2c47, + 0x406fac7f, + 0x40702c92, + 0x4070acaf, + 0x40710802, + 0x4071acc1, + 0x40722cd4, + 0x4072ad0a, + 0x40732d22, + 0x407394fa, + 0x40742d36, + 0x4074ad50, + 0x40752d61, + 0x4075ad75, + 0x40762d83, + 0x407692be, + 0x40772da8, + 0x4077adca, + 0x40782de5, + 0x4078ae1e, + 0x40792e35, + 0x4079ae4b, + 0x407a2e77, + 0x407aae8a, + 0x407b2e9f, + 0x407baeb1, + 0x407c2ee2, + 0x407caeeb, + 0x407d2650, + 0x407d9fe4, + 0x407e2dfa, + 0x407ea1f1, + 0x407f1d58, + 0x407f9afe, + 0x40801f9e, + 0x40809d80, + 0x40812094, + 0x40819f78, + 0x40822baa, + 0x40829ae4, + 0x408321cc, + 0x4083a4cd, + 0x40841d94, + 0x4084a229, + 0x408522ae, + 0x4085a3d2, + 0x4086232e, + 0x40869ffe, + 0x40872bf0, + 0x4087a420, + 0x40881b45, + 0x4088a5df, + 0x40891b94, + 0x40899b21, + 0x408a28cf, + 0x408a9912, + 0x408b2ec6, + 0x408bac5c, + 0x408c22be, + 0x408c992e, + 0x408d1df5, + 0x408d9dc6, + 0x408e1f0f, + 0x408ea134, + 0x408f25f3, + 0x408fa3ee, + 0x409025a8, + 0x4090a300, + 0x409128b7, + 0x40919954, + 0x40921be1, + 0x4092ac2b, + 0x40932ced, + 0x4093a00f, + 0x40941da8, + 0x4094a8e8, + 0x4095247c, + 0x4095ae57, + 0x40962bd7, + 0x40969fb7, + 0x4097205a, + 0x40979f5e, + 0x41f42789, + 0x41f9281b, + 0x41fe270e, + 0x41fea92b, + 0x41ff2a1c, + 0x420327a2, + 0x420827c4, + 0x4208a800, + 0x420926f2, + 0x4209a83a, + 0x420a2749, + 0x420aa729, + 0x420b2769, + 0x420ba7e2, + 0x420c2a38, + 0x420ca8f8, + 0x420d2912, + 0x420da949, + 0x42122963, + 0x421729ff, + 0x4217a9a5, + 0x421c29c7, + 0x421f2982, + 0x42212a4f, + 0x422629e2, + 0x422b2b1e, + 0x422baacc, + 0x422c2b06, + 0x422caa8b, + 0x422d2a6a, + 0x422daaeb, + 0x422e2ab1, + 0x4432072d, + 0x4432873c, + 0x44330748, + 0x44338756, + 0x44340769, + 0x4434877a, + 0x44350781, + 0x4435878b, + 0x4436079e, + 0x443687b4, + 0x443707c6, + 0x443787d3, + 0x443807e2, + 0x443887ea, + 0x44390802, + 0x44398810, + 0x443a0823, + 0x483212e8, + 0x483292fa, + 0x48331310, + 0x48339329, + 0x4c32134e, + 0x4c32935e, + 0x4c331371, + 0x4c339391, + 0x4c3400ac, + 0x4c3480ea, + 0x4c35139d, + 0x4c3593ab, + 0x4c3613c7, + 0x4c3693ed, + 0x4c3713fc, + 0x4c37940a, + 0x4c38141f, + 0x4c38942b, + 0x4c39144b, + 0x4c399475, + 0x4c3a148e, + 0x4c3a94a7, + 0x4c3b05fd, + 0x4c3b94c0, + 0x4c3c14d2, + 0x4c3c94e1, + 0x4c3d14fa, + 0x4c3d8c47, + 0x4c3e1567, + 0x4c3e9509, + 0x4c3f1589, + 0x4c3f92be, + 0x4c40151f, + 0x4c40933a, + 0x4c411557, + 0x4c4193da, + 0x4c421543, + 0x50323141, + 0x5032b150, + 0x5033315b, + 0x5033b16b, + 0x50343184, + 0x5034b19e, + 0x503531ac, + 0x5035b1c2, + 0x503631d4, + 0x5036b1ea, + 0x50373203, + 0x5037b216, + 0x5038322e, + 0x5038b23f, + 0x50393254, + 0x5039b268, + 0x503a3288, + 0x503ab29e, + 0x503b32b6, + 0x503bb2c8, + 0x503c32e4, + 0x503cb2fb, + 0x503d3314, + 0x503db32a, + 0x503e3337, + 0x503eb34d, + 0x503f335f, + 0x503f837b, + 0x50403372, + 0x5040b382, + 0x5041339c, + 0x5041b3ab, + 0x504233c5, + 0x5042b3e2, + 0x504333f2, + 0x5043b402, + 0x50443411, + 0x50448431, + 0x50453425, + 0x5045b443, + 0x50463456, + 0x5046b46c, + 0x5047347e, + 0x5047b493, + 0x504834b9, + 0x5048b4c7, + 0x504934da, + 0x5049b4ef, + 0x504a3505, + 0x504ab515, + 0x504b3535, + 0x504bb548, + 0x504c356b, + 0x504cb599, + 0x504d35ab, + 0x504db5c8, + 0x504e35e3, + 0x504eb5ff, + 0x504f3611, + 0x504fb628, + 0x50503637, + 0x505086f1, + 0x5051364a, + 0x58320f65, + 0x68320f27, + 0x68328c7f, + 0x68330c92, + 0x68338f35, + 0x68340f45, + 0x683480ea, + 0x6c320eed, + 0x6c328c36, + 0x6c330ef8, + 0x6c338f11, + 0x74320a1b, + 0x743280ac, + 0x74330c47, + 0x78320980, + 0x78328995, + 0x783309a1, + 0x78338083, + 0x783409b0, + 0x783489c5, + 0x783509e4, + 0x78358a06, + 0x78360a1b, + 0x78368a31, + 0x78370a41, + 0x78378a62, + 0x78380a75, + 0x78388a87, + 0x78390a94, + 0x78398ab3, + 0x783a0ac8, + 0x783a8ad6, + 0x783b0ae0, + 0x783b8af4, + 0x783c0b0b, + 0x783c8b20, + 0x783d0b37, + 0x783d8b4c, + 0x783e0aa2, + 0x783e8a54, + 0x7c3211d7, +}; - const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]); +const size_t kOpenSSLReasonValuesLen = sizeof(kOpenSSLReasonValues) / sizeof(kOpenSSLReasonValues[0]); + +const char kOpenSSLReasonStringData[] = + "ASN1_LENGTH_MISMATCH\0" + "AUX_ERROR\0" + "BAD_GET_ASN1_OBJECT_CALL\0" + "BAD_OBJECT_HEADER\0" + "BMPSTRING_IS_WRONG_LENGTH\0" + "BN_LIB\0" + "BOOLEAN_IS_WRONG_LENGTH\0" + "BUFFER_TOO_SMALL\0" + "CONTEXT_NOT_INITIALISED\0" + "DECODE_ERROR\0" + "DEPTH_EXCEEDED\0" + "DIGEST_AND_KEY_TYPE_NOT_SUPPORTED\0" + "ENCODE_ERROR\0" + "ERROR_GETTING_TIME\0" + "EXPECTING_AN_ASN1_SEQUENCE\0" + "EXPECTING_AN_INTEGER\0" + "EXPECTING_AN_OBJECT\0" + "EXPECTING_A_BOOLEAN\0" + "EXPECTING_A_TIME\0" + "EXPLICIT_LENGTH_MISMATCH\0" + "EXPLICIT_TAG_NOT_CONSTRUCTED\0" + "FIELD_MISSING\0" + "FIRST_NUM_TOO_LARGE\0" + "HEADER_TOO_LONG\0" + "ILLEGAL_BITSTRING_FORMAT\0" + "ILLEGAL_BOOLEAN\0" + "ILLEGAL_CHARACTERS\0" + "ILLEGAL_FORMAT\0" + "ILLEGAL_HEX\0" + "ILLEGAL_IMPLICIT_TAG\0" + "ILLEGAL_INTEGER\0" + "ILLEGAL_NESTED_TAGGING\0" + "ILLEGAL_NULL\0" + "ILLEGAL_NULL_VALUE\0" + "ILLEGAL_OBJECT\0" + "ILLEGAL_OPTIONAL_ANY\0" + "ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE\0" + "ILLEGAL_TAGGED_ANY\0" + "ILLEGAL_TIME_VALUE\0" + "INTEGER_NOT_ASCII_FORMAT\0" + "INTEGER_TOO_LARGE_FOR_LONG\0" + "INVALID_BIT_STRING_BITS_LEFT\0" + "INVALID_BMPSTRING\0" + "INVALID_DIGIT\0" + "INVALID_MODIFIER\0" + "INVALID_NUMBER\0" + "INVALID_OBJECT_ENCODING\0" + "INVALID_SEPARATOR\0" + "INVALID_TIME_FORMAT\0" + "INVALID_UNIVERSALSTRING\0" + "INVALID_UTF8STRING\0" + "LIST_ERROR\0" + "MISSING_ASN1_EOS\0" + "MISSING_EOC\0" + "MISSING_SECOND_NUMBER\0" + "MISSING_VALUE\0" + "MSTRING_NOT_UNIVERSAL\0" + "MSTRING_WRONG_TAG\0" + "NESTED_ASN1_ERROR\0" + "NESTED_ASN1_STRING\0" + "NESTED_TOO_DEEP\0" + "NON_HEX_CHARACTERS\0" + "NOT_ASCII_FORMAT\0" + "NOT_ENOUGH_DATA\0" + "NO_MATCHING_CHOICE_TYPE\0" + "NULL_IS_WRONG_LENGTH\0" + "OBJECT_NOT_ASCII_FORMAT\0" + "ODD_NUMBER_OF_CHARS\0" + "SECOND_NUMBER_TOO_LARGE\0" + "SEQUENCE_LENGTH_MISMATCH\0" + "SEQUENCE_NOT_CONSTRUCTED\0" + "SEQUENCE_OR_SET_NEEDS_CONFIG\0" + "SHORT_LINE\0" + "STREAMING_NOT_SUPPORTED\0" + "STRING_TOO_LONG\0" + "STRING_TOO_SHORT\0" + "TAG_VALUE_TOO_HIGH\0" + "TIME_NOT_ASCII_FORMAT\0" + "TOO_LONG\0" + "TYPE_NOT_CONSTRUCTED\0" + "TYPE_NOT_PRIMITIVE\0" + "UNEXPECTED_EOC\0" + "UNIVERSALSTRING_IS_WRONG_LENGTH\0" + "UNKNOWN_FORMAT\0" + "UNKNOWN_MESSAGE_DIGEST_ALGORITHM\0" + "UNKNOWN_SIGNATURE_ALGORITHM\0" + "UNKNOWN_TAG\0" + "UNSUPPORTED_ANY_DEFINED_BY_TYPE\0" + "UNSUPPORTED_PUBLIC_KEY_TYPE\0" + "UNSUPPORTED_TYPE\0" + "WRONG_PUBLIC_KEY_TYPE\0" + "WRONG_TAG\0" + "WRONG_TYPE\0" + "BAD_FOPEN_MODE\0" + "BROKEN_PIPE\0" + "CONNECT_ERROR\0" + "ERROR_SETTING_NBIO\0" + "INVALID_ARGUMENT\0" + "IN_USE\0" + "KEEPALIVE\0" + "NBIO_CONNECT_ERROR\0" + "NO_HOSTNAME_SPECIFIED\0" + "NO_PORT_SPECIFIED\0" + "NO_SUCH_FILE\0" + "NULL_PARAMETER\0" + "SYS_LIB\0" + "UNABLE_TO_CREATE_SOCKET\0" + "UNINITIALIZED\0" + "UNSUPPORTED_METHOD\0" + "WRITE_TO_READ_ONLY_BIO\0" + "ARG2_LT_ARG3\0" + "BAD_ENCODING\0" + "BAD_RECIPROCAL\0" + "BIGNUM_TOO_LONG\0" + "BITS_TOO_SMALL\0" + "CALLED_WITH_EVEN_MODULUS\0" + "DIV_BY_ZERO\0" + "EXPAND_ON_STATIC_BIGNUM_DATA\0" + "INPUT_NOT_REDUCED\0" + "INVALID_INPUT\0" + "INVALID_RANGE\0" + "NEGATIVE_NUMBER\0" + "NOT_A_SQUARE\0" + "NOT_INITIALIZED\0" + "NO_INVERSE\0" + "PRIVATE_KEY_TOO_LARGE\0" + "P_IS_NOT_PRIME\0" + "TOO_MANY_ITERATIONS\0" + "TOO_MANY_TEMPORARY_VARIABLES\0" + "AES_KEY_SETUP_FAILED\0" + "BAD_DECRYPT\0" + "BAD_KEY_LENGTH\0" + "CTRL_NOT_IMPLEMENTED\0" + "CTRL_OPERATION_NOT_IMPLEMENTED\0" + "DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH\0" + "INITIALIZATION_ERROR\0" + "INPUT_NOT_INITIALIZED\0" + "INVALID_AD_SIZE\0" + "INVALID_KEY_LENGTH\0" + "INVALID_NONCE\0" + "INVALID_NONCE_SIZE\0" + "INVALID_OPERATION\0" + "IV_TOO_LARGE\0" + "NO_CIPHER_SET\0" + "NO_DIRECTION_SET\0" + "OUTPUT_ALIASES_INPUT\0" + "TAG_TOO_LARGE\0" + "TOO_LARGE\0" + "UNSUPPORTED_AD_SIZE\0" + "UNSUPPORTED_INPUT_SIZE\0" + "UNSUPPORTED_KEY_SIZE\0" + "UNSUPPORTED_NONCE_SIZE\0" + "UNSUPPORTED_TAG_SIZE\0" + "WRONG_FINAL_BLOCK_LENGTH\0" + "LIST_CANNOT_BE_NULL\0" + "MISSING_CLOSE_SQUARE_BRACKET\0" + "MISSING_EQUAL_SIGN\0" + "NO_CLOSE_BRACE\0" + "UNABLE_TO_CREATE_NEW_SECTION\0" + "VARIABLE_EXPANSION_TOO_LONG\0" + "VARIABLE_HAS_NO_VALUE\0" + "BAD_GENERATOR\0" + "INVALID_PUBKEY\0" + "MODULUS_TOO_LARGE\0" + "NO_PRIVATE_VALUE\0" + "UNKNOWN_HASH\0" + "BAD_Q_VALUE\0" + "BAD_VERSION\0" + "INVALID_PARAMETERS\0" + "MISSING_PARAMETERS\0" + "NEED_NEW_SETUP_VALUES\0" + "BIGNUM_OUT_OF_RANGE\0" + "COORDINATES_OUT_OF_RANGE\0" + "D2I_ECPKPARAMETERS_FAILURE\0" + "EC_GROUP_NEW_BY_NAME_FAILURE\0" + "GROUP2PKPARAMETERS_FAILURE\0" + "GROUP_MISMATCH\0" + "I2D_ECPKPARAMETERS_FAILURE\0" + "INCOMPATIBLE_OBJECTS\0" + "INVALID_COFACTOR\0" + "INVALID_COMPRESSED_POINT\0" + "INVALID_COMPRESSION_BIT\0" + "INVALID_ENCODING\0" + "INVALID_FIELD\0" + "INVALID_FORM\0" + "INVALID_GROUP_ORDER\0" + "INVALID_PRIVATE_KEY\0" + "INVALID_SCALAR\0" + "MISSING_PRIVATE_KEY\0" + "NON_NAMED_CURVE\0" + "PKPARAMETERS2GROUP_FAILURE\0" + "POINT_AT_INFINITY\0" + "POINT_IS_NOT_ON_CURVE\0" + "PUBLIC_KEY_VALIDATION_FAILED\0" + "SLOT_FULL\0" + "UNDEFINED_GENERATOR\0" + "UNKNOWN_GROUP\0" + "UNKNOWN_ORDER\0" + "WRONG_CURVE_PARAMETERS\0" + "WRONG_ORDER\0" + "KDF_FAILED\0" + "POINT_ARITHMETIC_FAILURE\0" + "UNKNOWN_DIGEST_LENGTH\0" + "BAD_SIGNATURE\0" + "NOT_IMPLEMENTED\0" + "RANDOM_NUMBER_GENERATION_FAILED\0" + "OPERATION_NOT_SUPPORTED\0" + "COMMAND_NOT_SUPPORTED\0" + "DIFFERENT_KEY_TYPES\0" + "DIFFERENT_PARAMETERS\0" + "EXPECTING_AN_EC_KEY_KEY\0" + "EXPECTING_AN_RSA_KEY\0" + "EXPECTING_A_DSA_KEY\0" + "ILLEGAL_OR_UNSUPPORTED_PADDING_MODE\0" + "INVALID_DIGEST_LENGTH\0" + "INVALID_DIGEST_TYPE\0" + "INVALID_KEYBITS\0" + "INVALID_MGF1_MD\0" + "INVALID_PADDING_MODE\0" + "INVALID_PEER_KEY\0" + "INVALID_PSS_SALTLEN\0" + "INVALID_SIGNATURE\0" + "KEYS_NOT_SET\0" + "MEMORY_LIMIT_EXCEEDED\0" + "NOT_A_PRIVATE_KEY\0" + "NOT_XOF_OR_INVALID_LENGTH\0" + "NO_DEFAULT_DIGEST\0" + "NO_KEY_SET\0" + "NO_MDC2_SUPPORT\0" + "NO_NID_FOR_CURVE\0" + "NO_OPERATION_SET\0" + "NO_PARAMETERS_SET\0" + "OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE\0" + "OPERATON_NOT_INITIALIZED\0" + "UNKNOWN_PUBLIC_KEY_TYPE\0" + "UNSUPPORTED_ALGORITHM\0" + "OUTPUT_TOO_LARGE\0" + "INVALID_OID_STRING\0" + "UNKNOWN_NID\0" + "BAD_BASE64_DECODE\0" + "BAD_END_LINE\0" + "BAD_IV_CHARS\0" + "BAD_PASSWORD_READ\0" + "CIPHER_IS_NULL\0" + "ERROR_CONVERTING_PRIVATE_KEY\0" + "NOT_DEK_INFO\0" + "NOT_ENCRYPTED\0" + "NOT_PROC_TYPE\0" + "NO_START_LINE\0" + "READ_KEY\0" + "SHORT_HEADER\0" + "UNSUPPORTED_CIPHER\0" + "UNSUPPORTED_ENCRYPTION\0" + "BAD_PKCS7_VERSION\0" + "NOT_PKCS7_SIGNED_DATA\0" + "NO_CERTIFICATES_INCLUDED\0" + "NO_CRLS_INCLUDED\0" + "BAD_ITERATION_COUNT\0" + "BAD_PKCS12_DATA\0" + "BAD_PKCS12_VERSION\0" + "CIPHER_HAS_NO_OBJECT_IDENTIFIER\0" + "CRYPT_ERROR\0" + "ENCRYPT_ERROR\0" + "ERROR_SETTING_CIPHER_PARAMS\0" + "INCORRECT_PASSWORD\0" + "INVALID_CHARACTERS\0" + "KEYGEN_FAILURE\0" + "KEY_GEN_ERROR\0" + "METHOD_NOT_SUPPORTED\0" + "MISSING_MAC\0" + "MULTIPLE_PRIVATE_KEYS_IN_PKCS12\0" + "PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED\0" + "PKCS12_TOO_DEEPLY_NESTED\0" + "PRIVATE_KEY_DECODE_ERROR\0" + "PRIVATE_KEY_ENCODE_ERROR\0" + "UNKNOWN_ALGORITHM\0" + "UNKNOWN_CIPHER\0" + "UNKNOWN_CIPHER_ALGORITHM\0" + "UNKNOWN_DIGEST\0" + "UNSUPPORTED_KEYLENGTH\0" + "UNSUPPORTED_KEY_DERIVATION_FUNCTION\0" + "UNSUPPORTED_OPTIONS\0" + "UNSUPPORTED_PRF\0" + "UNSUPPORTED_PRIVATE_KEY_ALGORITHM\0" + "UNSUPPORTED_SALT_TYPE\0" + "BAD_E_VALUE\0" + "BAD_FIXED_HEADER_DECRYPT\0" + "BAD_PAD_BYTE_COUNT\0" + "BAD_RSA_PARAMETERS\0" + "BLOCK_TYPE_IS_NOT_01\0" + "BLOCK_TYPE_IS_NOT_02\0" + "BN_NOT_INITIALIZED\0" + "CANNOT_RECOVER_MULTI_PRIME_KEY\0" + "CRT_PARAMS_ALREADY_GIVEN\0" + "CRT_VALUES_INCORRECT\0" + "DATA_LEN_NOT_EQUAL_TO_MOD_LEN\0" + "DATA_TOO_LARGE\0" + "DATA_TOO_LARGE_FOR_KEY_SIZE\0" + "DATA_TOO_LARGE_FOR_MODULUS\0" + "DATA_TOO_SMALL\0" + "DATA_TOO_SMALL_FOR_KEY_SIZE\0" + "DIGEST_TOO_BIG_FOR_RSA_KEY\0" + "D_E_NOT_CONGRUENT_TO_1\0" + "D_OUT_OF_RANGE\0" + "EMPTY_PUBLIC_KEY\0" + "FIRST_OCTET_INVALID\0" + "INCONSISTENT_SET_OF_CRT_VALUES\0" + "INTERNAL_ERROR\0" + "INVALID_MESSAGE_LENGTH\0" + "KEY_SIZE_TOO_SMALL\0" + "LAST_OCTET_INVALID\0" + "MUST_HAVE_AT_LEAST_TWO_PRIMES\0" + "NO_PUBLIC_EXPONENT\0" + "NULL_BEFORE_BLOCK_MISSING\0" + "N_NOT_EQUAL_P_Q\0" + "OAEP_DECODING_ERROR\0" + "ONLY_ONE_OF_P_Q_GIVEN\0" + "OUTPUT_BUFFER_TOO_SMALL\0" + "PADDING_CHECK_FAILED\0" + "PKCS_DECODING_ERROR\0" + "SLEN_CHECK_FAILED\0" + "SLEN_RECOVERY_FAILED\0" + "UNKNOWN_ALGORITHM_TYPE\0" + "UNKNOWN_PADDING_TYPE\0" + "VALUE_MISSING\0" + "WRONG_SIGNATURE_LENGTH\0" + "ALPN_MISMATCH_ON_EARLY_DATA\0" + "APPLICATION_DATA_INSTEAD_OF_HANDSHAKE\0" + "APPLICATION_DATA_ON_SHUTDOWN\0" + "APP_DATA_IN_HANDSHAKE\0" + "ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT\0" + "BAD_ALERT\0" + "BAD_CHANGE_CIPHER_SPEC\0" + "BAD_DATA_RETURNED_BY_CALLBACK\0" + "BAD_DH_P_LENGTH\0" + "BAD_DIGEST_LENGTH\0" + "BAD_ECC_CERT\0" + "BAD_ECPOINT\0" + "BAD_HANDSHAKE_RECORD\0" + "BAD_HELLO_REQUEST\0" + "BAD_LENGTH\0" + "BAD_PACKET_LENGTH\0" + "BAD_RSA_ENCRYPT\0" + "BAD_SRTP_MKI_VALUE\0" + "BAD_SRTP_PROTECTION_PROFILE_LIST\0" + "BAD_SSL_FILETYPE\0" + "BAD_WRITE_RETRY\0" + "BIO_NOT_SET\0" + "BLOCK_CIPHER_PAD_IS_WRONG\0" + "BUFFERED_MESSAGES_ON_CIPHER_CHANGE\0" + "CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD\0" + "CANNOT_PARSE_LEAF_CERT\0" + "CA_DN_LENGTH_MISMATCH\0" + "CA_DN_TOO_LONG\0" + "CCS_RECEIVED_EARLY\0" + "CERTIFICATE_AND_PRIVATE_KEY_MISMATCH\0" + "CERTIFICATE_VERIFY_FAILED\0" + "CERT_CB_ERROR\0" + "CERT_DECOMPRESSION_FAILED\0" + "CERT_LENGTH_MISMATCH\0" + "CHANNEL_ID_NOT_P256\0" + "CHANNEL_ID_SIGNATURE_INVALID\0" + "CIPHER_OR_HASH_UNAVAILABLE\0" + "CLIENTHELLO_PARSE_FAILED\0" + "CLIENTHELLO_TLSEXT\0" + "CONNECTION_REJECTED\0" + "CONNECTION_TYPE_NOT_SET\0" + "CUSTOM_EXTENSION_ERROR\0" + "DATA_LENGTH_TOO_LONG\0" + "DECRYPTION_FAILED\0" + "DECRYPTION_FAILED_OR_BAD_RECORD_MAC\0" + "DH_PUBLIC_VALUE_LENGTH_IS_WRONG\0" + "DH_P_TOO_LONG\0" + "DIGEST_CHECK_FAILED\0" + "DOWNGRADE_DETECTED\0" + "DTLS_MESSAGE_TOO_BIG\0" + "DUPLICATE_EXTENSION\0" + "DUPLICATE_KEY_SHARE\0" + "DUPLICATE_SIGNATURE_ALGORITHM\0" + "EARLY_DATA_NOT_IN_USE\0" + "ECC_CERT_NOT_FOR_SIGNING\0" + "EMPTY_HELLO_RETRY_REQUEST\0" + "EMS_STATE_INCONSISTENT\0" + "ENCRYPTED_LENGTH_TOO_LONG\0" + "ERROR_ADDING_EXTENSION\0" + "ERROR_IN_RECEIVED_CIPHER_LIST\0" + "ERROR_PARSING_EXTENSION\0" + "EXCESSIVE_MESSAGE_SIZE\0" + "EXTRA_DATA_IN_MESSAGE\0" + "FRAGMENT_MISMATCH\0" + "GOT_NEXT_PROTO_WITHOUT_EXTENSION\0" + "HANDSHAKE_FAILURE_ON_CLIENT_HELLO\0" + "HANDSHAKE_NOT_COMPLETE\0" + "HTTPS_PROXY_REQUEST\0" + "HTTP_REQUEST\0" + "INAPPROPRIATE_FALLBACK\0" + "INCONSISTENT_CLIENT_HELLO\0" + "INVALID_ALPN_PROTOCOL\0" + "INVALID_COMMAND\0" + "INVALID_COMPRESSION_LIST\0" + "INVALID_DELEGATED_CREDENTIAL\0" + "INVALID_MESSAGE\0" + "INVALID_OUTER_RECORD_TYPE\0" + "INVALID_SCT_LIST\0" + "INVALID_SIGNATURE_ALGORITHM\0" + "INVALID_SSL_SESSION\0" + "INVALID_TICKET_KEYS_LENGTH\0" + "KEY_USAGE_BIT_INCORRECT\0" + "LENGTH_MISMATCH\0" + "MISSING_EXTENSION\0" + "MISSING_KEY_SHARE\0" + "MISSING_RSA_CERTIFICATE\0" + "MISSING_TMP_DH_KEY\0" + "MISSING_TMP_ECDH_KEY\0" + "MIXED_SPECIAL_OPERATOR_WITH_GROUPS\0" + "MTU_TOO_SMALL\0" + "NEGOTIATED_BOTH_NPN_AND_ALPN\0" + "NEGOTIATED_TB_WITHOUT_EMS_OR_RI\0" + "NESTED_GROUP\0" + "NO_CERTIFICATES_RETURNED\0" + "NO_CERTIFICATE_ASSIGNED\0" + "NO_CERTIFICATE_SET\0" + "NO_CIPHERS_AVAILABLE\0" + "NO_CIPHERS_PASSED\0" + "NO_CIPHERS_SPECIFIED\0" + "NO_CIPHER_MATCH\0" + "NO_COMMON_SIGNATURE_ALGORITHMS\0" + "NO_COMPRESSION_SPECIFIED\0" + "NO_GROUPS_SPECIFIED\0" + "NO_METHOD_SPECIFIED\0" + "NO_P256_SUPPORT\0" + "NO_PRIVATE_KEY_ASSIGNED\0" + "NO_RENEGOTIATION\0" + "NO_REQUIRED_DIGEST\0" + "NO_SHARED_CIPHER\0" + "NO_SHARED_GROUP\0" + "NO_SUPPORTED_VERSIONS_ENABLED\0" + "NULL_SSL_CTX\0" + "NULL_SSL_METHOD_PASSED\0" + "OCSP_CB_ERROR\0" + "OLD_SESSION_CIPHER_NOT_RETURNED\0" + "OLD_SESSION_PRF_HASH_MISMATCH\0" + "OLD_SESSION_VERSION_NOT_RETURNED\0" + "PARSE_TLSEXT\0" + "PATH_TOO_LONG\0" + "PEER_DID_NOT_RETURN_A_CERTIFICATE\0" + "PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE\0" + "PRE_SHARED_KEY_MUST_BE_LAST\0" + "PRIVATE_KEY_OPERATION_FAILED\0" + "PROTOCOL_IS_SHUTDOWN\0" + "PSK_IDENTITY_BINDER_COUNT_MISMATCH\0" + "PSK_IDENTITY_NOT_FOUND\0" + "PSK_NO_CLIENT_CB\0" + "PSK_NO_SERVER_CB\0" + "QUIC_INTERNAL_ERROR\0" + "READ_TIMEOUT_EXPIRED\0" + "RECORD_LENGTH_MISMATCH\0" + "RECORD_TOO_LARGE\0" + "RENEGOTIATION_EMS_MISMATCH\0" + "RENEGOTIATION_ENCODING_ERR\0" + "RENEGOTIATION_MISMATCH\0" + "REQUIRED_CIPHER_MISSING\0" + "RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION\0" + "RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION\0" + "SCSV_RECEIVED_WHEN_RENEGOTIATING\0" + "SECOND_SERVERHELLO_VERSION_MISMATCH\0" + "SERVERHELLO_TLSEXT\0" + "SERVER_CERT_CHANGED\0" + "SERVER_ECHOED_INVALID_SESSION_ID\0" + "SESSION_ID_CONTEXT_UNINITIALIZED\0" + "SESSION_MAY_NOT_BE_CREATED\0" + "SHUTDOWN_WHILE_IN_INIT\0" + "SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER\0" + "SRTP_COULD_NOT_ALLOCATE_PROFILES\0" + "SRTP_UNKNOWN_PROTECTION_PROFILE\0" + "SSL3_EXT_INVALID_SERVERNAME\0" + "SSLV3_ALERT_BAD_CERTIFICATE\0" + "SSLV3_ALERT_BAD_RECORD_MAC\0" + "SSLV3_ALERT_CERTIFICATE_EXPIRED\0" + "SSLV3_ALERT_CERTIFICATE_REVOKED\0" + "SSLV3_ALERT_CERTIFICATE_UNKNOWN\0" + "SSLV3_ALERT_CLOSE_NOTIFY\0" + "SSLV3_ALERT_DECOMPRESSION_FAILURE\0" + "SSLV3_ALERT_HANDSHAKE_FAILURE\0" + "SSLV3_ALERT_ILLEGAL_PARAMETER\0" + "SSLV3_ALERT_NO_CERTIFICATE\0" + "SSLV3_ALERT_UNEXPECTED_MESSAGE\0" + "SSLV3_ALERT_UNSUPPORTED_CERTIFICATE\0" + "SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION\0" + "SSL_HANDSHAKE_FAILURE\0" + "SSL_SESSION_ID_CONTEXT_TOO_LONG\0" + "SSL_SESSION_ID_TOO_LONG\0" + "TICKET_ENCRYPTION_FAILED\0" + "TLS13_DOWNGRADE\0" + "TLSV1_ALERT_ACCESS_DENIED\0" + "TLSV1_ALERT_DECODE_ERROR\0" + "TLSV1_ALERT_DECRYPTION_FAILED\0" + "TLSV1_ALERT_DECRYPT_ERROR\0" + "TLSV1_ALERT_EXPORT_RESTRICTION\0" + "TLSV1_ALERT_INAPPROPRIATE_FALLBACK\0" + "TLSV1_ALERT_INSUFFICIENT_SECURITY\0" + "TLSV1_ALERT_INTERNAL_ERROR\0" + "TLSV1_ALERT_NO_RENEGOTIATION\0" + "TLSV1_ALERT_PROTOCOL_VERSION\0" + "TLSV1_ALERT_RECORD_OVERFLOW\0" + "TLSV1_ALERT_UNKNOWN_CA\0" + "TLSV1_ALERT_USER_CANCELLED\0" + "TLSV1_BAD_CERTIFICATE_HASH_VALUE\0" + "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\0" + "TLSV1_CERTIFICATE_REQUIRED\0" + "TLSV1_CERTIFICATE_UNOBTAINABLE\0" + "TLSV1_UNKNOWN_PSK_IDENTITY\0" + "TLSV1_UNRECOGNIZED_NAME\0" + "TLSV1_UNSUPPORTED_EXTENSION\0" + "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\0" + "TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\0" + "TOO_MANY_EMPTY_FRAGMENTS\0" + "TOO_MANY_KEY_UPDATES\0" + "TOO_MANY_WARNING_ALERTS\0" + "TOO_MUCH_READ_EARLY_DATA\0" + "TOO_MUCH_SKIPPED_EARLY_DATA\0" + "UNABLE_TO_FIND_ECDH_PARAMETERS\0" + "UNCOMPRESSED_CERT_TOO_LARGE\0" + "UNEXPECTED_EXTENSION\0" + "UNEXPECTED_EXTENSION_ON_EARLY_DATA\0" + "UNEXPECTED_MESSAGE\0" + "UNEXPECTED_OPERATOR_IN_GROUP\0" + "UNEXPECTED_RECORD\0" + "UNKNOWN_ALERT_TYPE\0" + "UNKNOWN_CERTIFICATE_TYPE\0" + "UNKNOWN_CERT_COMPRESSION_ALG\0" + "UNKNOWN_CIPHER_RETURNED\0" + "UNKNOWN_CIPHER_TYPE\0" + "UNKNOWN_KEY_EXCHANGE_TYPE\0" + "UNKNOWN_PROTOCOL\0" + "UNKNOWN_SSL_VERSION\0" + "UNKNOWN_STATE\0" + "UNSAFE_LEGACY_RENEGOTIATION_DISABLED\0" + "UNSUPPORTED_COMPRESSION_ALGORITHM\0" + "UNSUPPORTED_ELLIPTIC_CURVE\0" + "UNSUPPORTED_PROTOCOL\0" + "UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY\0" + "WRONG_CERTIFICATE_TYPE\0" + "WRONG_CIPHER_RETURNED\0" + "WRONG_CURVE\0" + "WRONG_ENCRYPTION_LEVEL_RECEIVED\0" + "WRONG_MESSAGE_TYPE\0" + "WRONG_SIGNATURE_TYPE\0" + "WRONG_SSL_VERSION\0" + "WRONG_VERSION_NUMBER\0" + "WRONG_VERSION_ON_EARLY_DATA\0" + "X509_LIB\0" + "X509_VERIFICATION_SETUP_PROBLEMS\0" + "AKID_MISMATCH\0" + "BAD_X509_FILETYPE\0" + "BASE64_DECODE_ERROR\0" + "CANT_CHECK_DH_KEY\0" + "CERT_ALREADY_IN_HASH_TABLE\0" + "CRL_ALREADY_DELTA\0" + "CRL_VERIFY_FAILURE\0" + "IDP_MISMATCH\0" + "INVALID_DIRECTORY\0" + "INVALID_FIELD_NAME\0" + "INVALID_PARAMETER\0" + "INVALID_PSS_PARAMETERS\0" + "INVALID_TRUST\0" + "ISSUER_MISMATCH\0" + "KEY_TYPE_MISMATCH\0" + "KEY_VALUES_MISMATCH\0" + "LOADING_CERT_DIR\0" + "LOADING_DEFAULTS\0" + "NAME_TOO_LONG\0" + "NEWER_CRL_NOT_NEWER\0" + "NO_CERT_SET_FOR_US_TO_VERIFY\0" + "NO_CRL_NUMBER\0" + "PUBLIC_KEY_DECODE_ERROR\0" + "PUBLIC_KEY_ENCODE_ERROR\0" + "SHOULD_RETRY\0" + "SIGNATURE_ALGORITHM_MISMATCH\0" + "UNKNOWN_KEY_TYPE\0" + "UNKNOWN_PURPOSE_ID\0" + "UNKNOWN_TRUST_ID\0" + "WRONG_LOOKUP_TYPE\0" + "BAD_IP_ADDRESS\0" + "BAD_OBJECT\0" + "BN_DEC2BN_ERROR\0" + "BN_TO_ASN1_INTEGER_ERROR\0" + "CANNOT_FIND_FREE_FUNCTION\0" + "DIRNAME_ERROR\0" + "DISTPOINT_ALREADY_SET\0" + "DUPLICATE_ZONE_ID\0" + "ERROR_CONVERTING_ZONE\0" + "ERROR_CREATING_EXTENSION\0" + "ERROR_IN_EXTENSION\0" + "EXPECTED_A_SECTION_NAME\0" + "EXTENSION_EXISTS\0" + "EXTENSION_NAME_ERROR\0" + "EXTENSION_NOT_FOUND\0" + "EXTENSION_SETTING_NOT_SUPPORTED\0" + "EXTENSION_VALUE_ERROR\0" + "ILLEGAL_EMPTY_EXTENSION\0" + "ILLEGAL_HEX_DIGIT\0" + "INCORRECT_POLICY_SYNTAX_TAG\0" + "INVALID_BOOLEAN_STRING\0" + "INVALID_EXTENSION_STRING\0" + "INVALID_MULTIPLE_RDNS\0" + "INVALID_NAME\0" + "INVALID_NULL_ARGUMENT\0" + "INVALID_NULL_NAME\0" + "INVALID_NULL_VALUE\0" + "INVALID_NUMBERS\0" + "INVALID_OBJECT_IDENTIFIER\0" + "INVALID_OPTION\0" + "INVALID_POLICY_IDENTIFIER\0" + "INVALID_PROXY_POLICY_SETTING\0" + "INVALID_PURPOSE\0" + "INVALID_SECTION\0" + "INVALID_SYNTAX\0" + "ISSUER_DECODE_ERROR\0" + "NEED_ORGANIZATION_AND_NUMBERS\0" + "NO_CONFIG_DATABASE\0" + "NO_ISSUER_CERTIFICATE\0" + "NO_ISSUER_DETAILS\0" + "NO_POLICY_IDENTIFIER\0" + "NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED\0" + "NO_PUBLIC_KEY\0" + "NO_SUBJECT_DETAILS\0" + "ODD_NUMBER_OF_DIGITS\0" + "OPERATION_NOT_DEFINED\0" + "OTHERNAME_ERROR\0" + "POLICY_LANGUAGE_ALREADY_DEFINED\0" + "POLICY_PATH_LENGTH\0" + "POLICY_PATH_LENGTH_ALREADY_DEFINED\0" + "POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY\0" + "SECTION_NOT_FOUND\0" + "UNABLE_TO_GET_ISSUER_DETAILS\0" + "UNABLE_TO_GET_ISSUER_KEYID\0" + "UNKNOWN_BIT_STRING_ARGUMENT\0" + "UNKNOWN_EXTENSION\0" + "UNKNOWN_EXTENSION_NAME\0" + "UNKNOWN_OPTION\0" + "UNSUPPORTED_OPTION\0" + "USER_TOO_LONG\0" + ""; - const char kOpenSSLReasonStringData[] = - "ASN1_LENGTH_MISMATCH\0" - "AUX_ERROR\0" - "BAD_GET_ASN1_OBJECT_CALL\0" - "BAD_OBJECT_HEADER\0" - "BMPSTRING_IS_WRONG_LENGTH\0" - "BN_LIB\0" - "BOOLEAN_IS_WRONG_LENGTH\0" - "BUFFER_TOO_SMALL\0" - "CONTEXT_NOT_INITIALISED\0" - "DECODE_ERROR\0" - "DEPTH_EXCEEDED\0" - "DIGEST_AND_KEY_TYPE_NOT_SUPPORTED\0" - "ENCODE_ERROR\0" - "ERROR_GETTING_TIME\0" - "EXPECTING_AN_ASN1_SEQUENCE\0" - "EXPECTING_AN_INTEGER\0" - "EXPECTING_AN_OBJECT\0" - "EXPECTING_A_BOOLEAN\0" - "EXPECTING_A_TIME\0" - "EXPLICIT_LENGTH_MISMATCH\0" - "EXPLICIT_TAG_NOT_CONSTRUCTED\0" - "FIELD_MISSING\0" - "FIRST_NUM_TOO_LARGE\0" - "HEADER_TOO_LONG\0" - "ILLEGAL_BITSTRING_FORMAT\0" - "ILLEGAL_BOOLEAN\0" - "ILLEGAL_CHARACTERS\0" - "ILLEGAL_FORMAT\0" - "ILLEGAL_HEX\0" - "ILLEGAL_IMPLICIT_TAG\0" - "ILLEGAL_INTEGER\0" - "ILLEGAL_NESTED_TAGGING\0" - "ILLEGAL_NULL\0" - "ILLEGAL_NULL_VALUE\0" - "ILLEGAL_OBJECT\0" - "ILLEGAL_OPTIONAL_ANY\0" - "ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE\0" - "ILLEGAL_TAGGED_ANY\0" - "ILLEGAL_TIME_VALUE\0" - "INTEGER_NOT_ASCII_FORMAT\0" - "INTEGER_TOO_LARGE_FOR_LONG\0" - "INVALID_BIT_STRING_BITS_LEFT\0" - "INVALID_BMPSTRING_LENGTH\0" - "INVALID_DIGIT\0" - "INVALID_MODIFIER\0" - "INVALID_NUMBER\0" - "INVALID_OBJECT_ENCODING\0" - "INVALID_SEPARATOR\0" - "INVALID_TIME_FORMAT\0" - "INVALID_UNIVERSALSTRING_LENGTH\0" - "INVALID_UTF8STRING\0" - "LIST_ERROR\0" - "MISSING_ASN1_EOS\0" - "MISSING_EOC\0" - "MISSING_SECOND_NUMBER\0" - "MISSING_VALUE\0" - "MSTRING_NOT_UNIVERSAL\0" - "MSTRING_WRONG_TAG\0" - "NESTED_ASN1_ERROR\0" - "NESTED_ASN1_STRING\0" - "NON_HEX_CHARACTERS\0" - "NOT_ASCII_FORMAT\0" - "NOT_ENOUGH_DATA\0" - "NO_MATCHING_CHOICE_TYPE\0" - "NULL_IS_WRONG_LENGTH\0" - "OBJECT_NOT_ASCII_FORMAT\0" - "ODD_NUMBER_OF_CHARS\0" - "SECOND_NUMBER_TOO_LARGE\0" - "SEQUENCE_LENGTH_MISMATCH\0" - "SEQUENCE_NOT_CONSTRUCTED\0" - "SEQUENCE_OR_SET_NEEDS_CONFIG\0" - "SHORT_LINE\0" - "STREAMING_NOT_SUPPORTED\0" - "STRING_TOO_LONG\0" - "STRING_TOO_SHORT\0" - "TAG_VALUE_TOO_HIGH\0" - "TIME_NOT_ASCII_FORMAT\0" - "TOO_LONG\0" - "TYPE_NOT_CONSTRUCTED\0" - "TYPE_NOT_PRIMITIVE\0" - "UNEXPECTED_EOC\0" - "UNIVERSALSTRING_IS_WRONG_LENGTH\0" - "UNKNOWN_FORMAT\0" - "UNKNOWN_MESSAGE_DIGEST_ALGORITHM\0" - "UNKNOWN_SIGNATURE_ALGORITHM\0" - "UNKNOWN_TAG\0" - "UNSUPPORTED_ANY_DEFINED_BY_TYPE\0" - "UNSUPPORTED_PUBLIC_KEY_TYPE\0" - "UNSUPPORTED_TYPE\0" - "WRONG_PUBLIC_KEY_TYPE\0" - "WRONG_TAG\0" - "WRONG_TYPE\0" - "BAD_FOPEN_MODE\0" - "BROKEN_PIPE\0" - "CONNECT_ERROR\0" - "ERROR_SETTING_NBIO\0" - "INVALID_ARGUMENT\0" - "IN_USE\0" - "KEEPALIVE\0" - "NBIO_CONNECT_ERROR\0" - "NO_HOSTNAME_SPECIFIED\0" - "NO_PORT_SPECIFIED\0" - "NO_SUCH_FILE\0" - "NULL_PARAMETER\0" - "SYS_LIB\0" - "UNABLE_TO_CREATE_SOCKET\0" - "UNINITIALIZED\0" - "UNSUPPORTED_METHOD\0" - "WRITE_TO_READ_ONLY_BIO\0" - "ARG2_LT_ARG3\0" - "BAD_ENCODING\0" - "BAD_RECIPROCAL\0" - "BIGNUM_TOO_LONG\0" - "BITS_TOO_SMALL\0" - "CALLED_WITH_EVEN_MODULUS\0" - "DIV_BY_ZERO\0" - "EXPAND_ON_STATIC_BIGNUM_DATA\0" - "INPUT_NOT_REDUCED\0" - "INVALID_INPUT\0" - "INVALID_RANGE\0" - "NEGATIVE_NUMBER\0" - "NOT_A_SQUARE\0" - "NOT_INITIALIZED\0" - "NO_INVERSE\0" - "PRIVATE_KEY_TOO_LARGE\0" - "P_IS_NOT_PRIME\0" - "TOO_MANY_ITERATIONS\0" - "TOO_MANY_TEMPORARY_VARIABLES\0" - "AES_KEY_SETUP_FAILED\0" - "BAD_DECRYPT\0" - "BAD_KEY_LENGTH\0" - "CTRL_NOT_IMPLEMENTED\0" - "CTRL_OPERATION_NOT_IMPLEMENTED\0" - "DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH\0" - "INITIALIZATION_ERROR\0" - "INPUT_NOT_INITIALIZED\0" - "INVALID_AD_SIZE\0" - "INVALID_KEY_LENGTH\0" - "INVALID_NONCE\0" - "INVALID_NONCE_SIZE\0" - "INVALID_OPERATION\0" - "IV_TOO_LARGE\0" - "NO_CIPHER_SET\0" - "NO_DIRECTION_SET\0" - "OUTPUT_ALIASES_INPUT\0" - "TAG_TOO_LARGE\0" - "TOO_LARGE\0" - "UNSUPPORTED_AD_SIZE\0" - "UNSUPPORTED_INPUT_SIZE\0" - "UNSUPPORTED_KEY_SIZE\0" - "UNSUPPORTED_NONCE_SIZE\0" - "UNSUPPORTED_TAG_SIZE\0" - "WRONG_FINAL_BLOCK_LENGTH\0" - "LIST_CANNOT_BE_NULL\0" - "MISSING_CLOSE_SQUARE_BRACKET\0" - "MISSING_EQUAL_SIGN\0" - "NO_CLOSE_BRACE\0" - "UNABLE_TO_CREATE_NEW_SECTION\0" - "VARIABLE_EXPANSION_TOO_LONG\0" - "VARIABLE_HAS_NO_VALUE\0" - "BAD_GENERATOR\0" - "INVALID_PUBKEY\0" - "MODULUS_TOO_LARGE\0" - "NO_PRIVATE_VALUE\0" - "UNKNOWN_HASH\0" - "BAD_Q_VALUE\0" - "BAD_VERSION\0" - "MISSING_PARAMETERS\0" - "NEED_NEW_SETUP_VALUES\0" - "BIGNUM_OUT_OF_RANGE\0" - "COORDINATES_OUT_OF_RANGE\0" - "D2I_ECPKPARAMETERS_FAILURE\0" - "EC_GROUP_NEW_BY_NAME_FAILURE\0" - "GROUP2PKPARAMETERS_FAILURE\0" - "GROUP_MISMATCH\0" - "I2D_ECPKPARAMETERS_FAILURE\0" - "INCOMPATIBLE_OBJECTS\0" - "INVALID_COFACTOR\0" - "INVALID_COMPRESSED_POINT\0" - "INVALID_COMPRESSION_BIT\0" - "INVALID_ENCODING\0" - "INVALID_FIELD\0" - "INVALID_FORM\0" - "INVALID_GROUP_ORDER\0" - "INVALID_PRIVATE_KEY\0" - "MISSING_PRIVATE_KEY\0" - "NON_NAMED_CURVE\0" - "PKPARAMETERS2GROUP_FAILURE\0" - "POINT_AT_INFINITY\0" - "POINT_IS_NOT_ON_CURVE\0" - "PUBLIC_KEY_VALIDATION_FAILED\0" - "SLOT_FULL\0" - "UNDEFINED_GENERATOR\0" - "UNKNOWN_GROUP\0" - "UNKNOWN_ORDER\0" - "WRONG_CURVE_PARAMETERS\0" - "WRONG_ORDER\0" - "KDF_FAILED\0" - "POINT_ARITHMETIC_FAILURE\0" - "BAD_SIGNATURE\0" - "NOT_IMPLEMENTED\0" - "RANDOM_NUMBER_GENERATION_FAILED\0" - "OPERATION_NOT_SUPPORTED\0" - "COMMAND_NOT_SUPPORTED\0" - "DIFFERENT_KEY_TYPES\0" - "DIFFERENT_PARAMETERS\0" - "EXPECTING_AN_EC_KEY_KEY\0" - "EXPECTING_AN_RSA_KEY\0" - "EXPECTING_A_DSA_KEY\0" - "ILLEGAL_OR_UNSUPPORTED_PADDING_MODE\0" - "INVALID_DIGEST_LENGTH\0" - "INVALID_DIGEST_TYPE\0" - "INVALID_KEYBITS\0" - "INVALID_MGF1_MD\0" - "INVALID_PADDING_MODE\0" - "INVALID_PARAMETERS\0" - "INVALID_PSS_SALTLEN\0" - "INVALID_SIGNATURE\0" - "KEYS_NOT_SET\0" - "MEMORY_LIMIT_EXCEEDED\0" - "NOT_A_PRIVATE_KEY\0" - "NO_DEFAULT_DIGEST\0" - "NO_KEY_SET\0" - "NO_MDC2_SUPPORT\0" - "NO_NID_FOR_CURVE\0" - "NO_OPERATION_SET\0" - "NO_PARAMETERS_SET\0" - "OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE\0" - "OPERATON_NOT_INITIALIZED\0" - "UNKNOWN_PUBLIC_KEY_TYPE\0" - "UNSUPPORTED_ALGORITHM\0" - "OUTPUT_TOO_LARGE\0" - "UNKNOWN_NID\0" - "BAD_BASE64_DECODE\0" - "BAD_END_LINE\0" - "BAD_IV_CHARS\0" - "BAD_PASSWORD_READ\0" - "CIPHER_IS_NULL\0" - "ERROR_CONVERTING_PRIVATE_KEY\0" - "NOT_DEK_INFO\0" - "NOT_ENCRYPTED\0" - "NOT_PROC_TYPE\0" - "NO_START_LINE\0" - "READ_KEY\0" - "SHORT_HEADER\0" - "UNSUPPORTED_CIPHER\0" - "UNSUPPORTED_ENCRYPTION\0" - "BAD_PKCS7_VERSION\0" - "NOT_PKCS7_SIGNED_DATA\0" - "NO_CERTIFICATES_INCLUDED\0" - "NO_CRLS_INCLUDED\0" - "BAD_ITERATION_COUNT\0" - "BAD_PKCS12_DATA\0" - "BAD_PKCS12_VERSION\0" - "CIPHER_HAS_NO_OBJECT_IDENTIFIER\0" - "CRYPT_ERROR\0" - "ENCRYPT_ERROR\0" - "ERROR_SETTING_CIPHER_PARAMS\0" - "INCORRECT_PASSWORD\0" - "KEYGEN_FAILURE\0" - "KEY_GEN_ERROR\0" - "METHOD_NOT_SUPPORTED\0" - "MISSING_MAC\0" - "MULTIPLE_PRIVATE_KEYS_IN_PKCS12\0" - "PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED\0" - "PKCS12_TOO_DEEPLY_NESTED\0" - "PRIVATE_KEY_DECODE_ERROR\0" - "PRIVATE_KEY_ENCODE_ERROR\0" - "UNKNOWN_ALGORITHM\0" - "UNKNOWN_CIPHER\0" - "UNKNOWN_CIPHER_ALGORITHM\0" - "UNKNOWN_DIGEST\0" - "UNSUPPORTED_KEYLENGTH\0" - "UNSUPPORTED_KEY_DERIVATION_FUNCTION\0" - "UNSUPPORTED_PRF\0" - "UNSUPPORTED_PRIVATE_KEY_ALGORITHM\0" - "UNSUPPORTED_SALT_TYPE\0" - "BAD_E_VALUE\0" - "BAD_FIXED_HEADER_DECRYPT\0" - "BAD_PAD_BYTE_COUNT\0" - "BAD_RSA_PARAMETERS\0" - "BLOCK_TYPE_IS_NOT_01\0" - "BN_NOT_INITIALIZED\0" - "CANNOT_RECOVER_MULTI_PRIME_KEY\0" - "CRT_PARAMS_ALREADY_GIVEN\0" - "CRT_VALUES_INCORRECT\0" - "DATA_LEN_NOT_EQUAL_TO_MOD_LEN\0" - "DATA_TOO_LARGE\0" - "DATA_TOO_LARGE_FOR_KEY_SIZE\0" - "DATA_TOO_LARGE_FOR_MODULUS\0" - "DATA_TOO_SMALL\0" - "DATA_TOO_SMALL_FOR_KEY_SIZE\0" - "DIGEST_TOO_BIG_FOR_RSA_KEY\0" - "D_E_NOT_CONGRUENT_TO_1\0" - "EMPTY_PUBLIC_KEY\0" - "FIRST_OCTET_INVALID\0" - "INCONSISTENT_SET_OF_CRT_VALUES\0" - "INTERNAL_ERROR\0" - "INVALID_MESSAGE_LENGTH\0" - "KEY_SIZE_TOO_SMALL\0" - "LAST_OCTET_INVALID\0" - "MUST_HAVE_AT_LEAST_TWO_PRIMES\0" - "NO_PUBLIC_EXPONENT\0" - "NULL_BEFORE_BLOCK_MISSING\0" - "N_NOT_EQUAL_P_Q\0" - "OAEP_DECODING_ERROR\0" - "ONLY_ONE_OF_P_Q_GIVEN\0" - "OUTPUT_BUFFER_TOO_SMALL\0" - "PADDING_CHECK_FAILED\0" - "PKCS_DECODING_ERROR\0" - "SLEN_CHECK_FAILED\0" - "SLEN_RECOVERY_FAILED\0" - "UNKNOWN_ALGORITHM_TYPE\0" - "UNKNOWN_PADDING_TYPE\0" - "VALUE_MISSING\0" - "WRONG_SIGNATURE_LENGTH\0" - "ALPN_MISMATCH_ON_EARLY_DATA\0" - "APPLICATION_DATA_INSTEAD_OF_HANDSHAKE\0" - "APP_DATA_IN_HANDSHAKE\0" - "ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT\0" - "BAD_ALERT\0" - "BAD_CHANGE_CIPHER_SPEC\0" - "BAD_DATA_RETURNED_BY_CALLBACK\0" - "BAD_DH_P_LENGTH\0" - "BAD_DIGEST_LENGTH\0" - "BAD_ECC_CERT\0" - "BAD_ECPOINT\0" - "BAD_HANDSHAKE_RECORD\0" - "BAD_HELLO_REQUEST\0" - "BAD_LENGTH\0" - "BAD_PACKET_LENGTH\0" - "BAD_RSA_ENCRYPT\0" - "BAD_SRTP_MKI_VALUE\0" - "BAD_SRTP_PROTECTION_PROFILE_LIST\0" - "BAD_SSL_FILETYPE\0" - "BAD_WRITE_RETRY\0" - "BIO_NOT_SET\0" - "BLOCK_CIPHER_PAD_IS_WRONG\0" - "BUFFERED_MESSAGES_ON_CIPHER_CHANGE\0" - "CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD\0" - "CANNOT_PARSE_LEAF_CERT\0" - "CA_DN_LENGTH_MISMATCH\0" - "CA_DN_TOO_LONG\0" - "CCS_RECEIVED_EARLY\0" - "CERTIFICATE_AND_PRIVATE_KEY_MISMATCH\0" - "CERTIFICATE_VERIFY_FAILED\0" - "CERT_CB_ERROR\0" - "CERT_LENGTH_MISMATCH\0" - "CHANNEL_ID_NOT_P256\0" - "CHANNEL_ID_SIGNATURE_INVALID\0" - "CIPHER_OR_HASH_UNAVAILABLE\0" - "CLIENTHELLO_PARSE_FAILED\0" - "CLIENTHELLO_TLSEXT\0" - "CONNECTION_REJECTED\0" - "CONNECTION_TYPE_NOT_SET\0" - "CUSTOM_EXTENSION_ERROR\0" - "DATA_LENGTH_TOO_LONG\0" - "DECRYPTION_FAILED\0" - "DECRYPTION_FAILED_OR_BAD_RECORD_MAC\0" - "DH_PUBLIC_VALUE_LENGTH_IS_WRONG\0" - "DH_P_TOO_LONG\0" - "DIGEST_CHECK_FAILED\0" - "DOWNGRADE_DETECTED\0" - "DTLS_MESSAGE_TOO_BIG\0" - "DUPLICATE_EXTENSION\0" - "DUPLICATE_KEY_SHARE\0" - "ECC_CERT_NOT_FOR_SIGNING\0" - "EMS_STATE_INCONSISTENT\0" - "ENCRYPTED_LENGTH_TOO_LONG\0" - "ERROR_ADDING_EXTENSION\0" - "ERROR_IN_RECEIVED_CIPHER_LIST\0" - "ERROR_PARSING_EXTENSION\0" - "EXCESSIVE_MESSAGE_SIZE\0" - "EXTRA_DATA_IN_MESSAGE\0" - "FRAGMENT_MISMATCH\0" - "GOT_NEXT_PROTO_WITHOUT_EXTENSION\0" - "HANDSHAKE_FAILURE_ON_CLIENT_HELLO\0" - "HTTPS_PROXY_REQUEST\0" - "HTTP_REQUEST\0" - "INAPPROPRIATE_FALLBACK\0" - "INVALID_ALPN_PROTOCOL\0" - "INVALID_COMMAND\0" - "INVALID_COMPRESSION_LIST\0" - "INVALID_MESSAGE\0" - "INVALID_OUTER_RECORD_TYPE\0" - "INVALID_SCT_LIST\0" - "INVALID_SSL_SESSION\0" - "INVALID_TICKET_KEYS_LENGTH\0" - "LENGTH_MISMATCH\0" - "MISSING_EXTENSION\0" - "MISSING_KEY_SHARE\0" - "MISSING_RSA_CERTIFICATE\0" - "MISSING_TMP_DH_KEY\0" - "MISSING_TMP_ECDH_KEY\0" - "MIXED_SPECIAL_OPERATOR_WITH_GROUPS\0" - "MTU_TOO_SMALL\0" - "NEGOTIATED_BOTH_NPN_AND_ALPN\0" - "NESTED_GROUP\0" - "NO_CERTIFICATES_RETURNED\0" - "NO_CERTIFICATE_ASSIGNED\0" - "NO_CERTIFICATE_SET\0" - "NO_CIPHERS_AVAILABLE\0" - "NO_CIPHERS_PASSED\0" - "NO_CIPHERS_SPECIFIED\0" - "NO_CIPHER_MATCH\0" - "NO_COMMON_SIGNATURE_ALGORITHMS\0" - "NO_COMPRESSION_SPECIFIED\0" - "NO_GROUPS_SPECIFIED\0" - "NO_METHOD_SPECIFIED\0" - "NO_P256_SUPPORT\0" - "NO_PRIVATE_KEY_ASSIGNED\0" - "NO_RENEGOTIATION\0" - "NO_REQUIRED_DIGEST\0" - "NO_SHARED_CIPHER\0" - "NO_SHARED_GROUP\0" - "NO_SUPPORTED_VERSIONS_ENABLED\0" - "NULL_SSL_CTX\0" - "NULL_SSL_METHOD_PASSED\0" - "OLD_SESSION_CIPHER_NOT_RETURNED\0" - "OLD_SESSION_PRF_HASH_MISMATCH\0" - "OLD_SESSION_VERSION_NOT_RETURNED\0" - "PARSE_TLSEXT\0" - "PATH_TOO_LONG\0" - "PEER_DID_NOT_RETURN_A_CERTIFICATE\0" - "PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE\0" - "PRE_SHARED_KEY_MUST_BE_LAST\0" - "PROTOCOL_IS_SHUTDOWN\0" - "PSK_IDENTITY_BINDER_COUNT_MISMATCH\0" - "PSK_IDENTITY_NOT_FOUND\0" - "PSK_NO_CLIENT_CB\0" - "PSK_NO_SERVER_CB\0" - "READ_TIMEOUT_EXPIRED\0" - "RECORD_LENGTH_MISMATCH\0" - "RECORD_TOO_LARGE\0" - "RENEGOTIATION_EMS_MISMATCH\0" - "RENEGOTIATION_ENCODING_ERR\0" - "RENEGOTIATION_MISMATCH\0" - "REQUIRED_CIPHER_MISSING\0" - "RESUMED_EMS_SESSION_WITHOUT_EMS_EXTENSION\0" - "RESUMED_NON_EMS_SESSION_WITH_EMS_EXTENSION\0" - "SCSV_RECEIVED_WHEN_RENEGOTIATING\0" - "SERVERHELLO_TLSEXT\0" - "SERVER_CERT_CHANGED\0" - "SESSION_ID_CONTEXT_UNINITIALIZED\0" - "SESSION_MAY_NOT_BE_CREATED\0" - "SHUTDOWN_WHILE_IN_INIT\0" - "SIGNATURE_ALGORITHMS_EXTENSION_SENT_BY_SERVER\0" - "SRTP_COULD_NOT_ALLOCATE_PROFILES\0" - "SRTP_UNKNOWN_PROTECTION_PROFILE\0" - "SSL3_EXT_INVALID_SERVERNAME\0" - "SSLV3_ALERT_BAD_CERTIFICATE\0" - "SSLV3_ALERT_BAD_RECORD_MAC\0" - "SSLV3_ALERT_CERTIFICATE_EXPIRED\0" - "SSLV3_ALERT_CERTIFICATE_REVOKED\0" - "SSLV3_ALERT_CERTIFICATE_UNKNOWN\0" - "SSLV3_ALERT_CLOSE_NOTIFY\0" - "SSLV3_ALERT_DECOMPRESSION_FAILURE\0" - "SSLV3_ALERT_HANDSHAKE_FAILURE\0" - "SSLV3_ALERT_ILLEGAL_PARAMETER\0" - "SSLV3_ALERT_NO_CERTIFICATE\0" - "SSLV3_ALERT_UNEXPECTED_MESSAGE\0" - "SSLV3_ALERT_UNSUPPORTED_CERTIFICATE\0" - "SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION\0" - "SSL_HANDSHAKE_FAILURE\0" - "SSL_SESSION_ID_CONTEXT_TOO_LONG\0" - "TICKET_ENCRYPTION_FAILED\0" - "TLSV1_ALERT_ACCESS_DENIED\0" - "TLSV1_ALERT_DECODE_ERROR\0" - "TLSV1_ALERT_DECRYPTION_FAILED\0" - "TLSV1_ALERT_DECRYPT_ERROR\0" - "TLSV1_ALERT_EXPORT_RESTRICTION\0" - "TLSV1_ALERT_INAPPROPRIATE_FALLBACK\0" - "TLSV1_ALERT_INSUFFICIENT_SECURITY\0" - "TLSV1_ALERT_INTERNAL_ERROR\0" - "TLSV1_ALERT_NO_RENEGOTIATION\0" - "TLSV1_ALERT_PROTOCOL_VERSION\0" - "TLSV1_ALERT_RECORD_OVERFLOW\0" - "TLSV1_ALERT_UNKNOWN_CA\0" - "TLSV1_ALERT_USER_CANCELLED\0" - "TLSV1_BAD_CERTIFICATE_HASH_VALUE\0" - "TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE\0" - "TLSV1_CERTIFICATE_REQUIRED\0" - "TLSV1_CERTIFICATE_UNOBTAINABLE\0" - "TLSV1_UNKNOWN_PSK_IDENTITY\0" - "TLSV1_UNRECOGNIZED_NAME\0" - "TLSV1_UNSUPPORTED_EXTENSION\0" - "TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST\0" - "TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG\0" - "TOO_MANY_EMPTY_FRAGMENTS\0" - "TOO_MANY_KEY_UPDATES\0" - "TOO_MANY_WARNING_ALERTS\0" - "TOO_MUCH_READ_EARLY_DATA\0" - "TOO_MUCH_SKIPPED_EARLY_DATA\0" - "UNABLE_TO_FIND_ECDH_PARAMETERS\0" - "UNEXPECTED_EXTENSION\0" - "UNEXPECTED_EXTENSION_ON_EARLY_DATA\0" - "UNEXPECTED_MESSAGE\0" - "UNEXPECTED_OPERATOR_IN_GROUP\0" - "UNEXPECTED_RECORD\0" - "UNKNOWN_ALERT_TYPE\0" - "UNKNOWN_CERTIFICATE_TYPE\0" - "UNKNOWN_CIPHER_RETURNED\0" - "UNKNOWN_CIPHER_TYPE\0" - "UNKNOWN_KEY_EXCHANGE_TYPE\0" - "UNKNOWN_PROTOCOL\0" - "UNKNOWN_SSL_VERSION\0" - "UNKNOWN_STATE\0" - "UNSAFE_LEGACY_RENEGOTIATION_DISABLED\0" - "UNSUPPORTED_COMPRESSION_ALGORITHM\0" - "UNSUPPORTED_ELLIPTIC_CURVE\0" - "UNSUPPORTED_PROTOCOL\0" - "UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY\0" - "WRONG_CERTIFICATE_TYPE\0" - "WRONG_CIPHER_RETURNED\0" - "WRONG_CURVE\0" - "WRONG_MESSAGE_TYPE\0" - "WRONG_SIGNATURE_TYPE\0" - "WRONG_SSL_VERSION\0" - "WRONG_VERSION_NUMBER\0" - "WRONG_VERSION_ON_EARLY_DATA\0" - "X509_LIB\0" - "X509_VERIFICATION_SETUP_PROBLEMS\0" - "AKID_MISMATCH\0" - "BAD_X509_FILETYPE\0" - "BASE64_DECODE_ERROR\0" - "CANT_CHECK_DH_KEY\0" - "CERT_ALREADY_IN_HASH_TABLE\0" - "CRL_ALREADY_DELTA\0" - "CRL_VERIFY_FAILURE\0" - "IDP_MISMATCH\0" - "INVALID_DIRECTORY\0" - "INVALID_FIELD_NAME\0" - "INVALID_PARAMETER\0" - "INVALID_PSS_PARAMETERS\0" - "INVALID_TRUST\0" - "ISSUER_MISMATCH\0" - "KEY_TYPE_MISMATCH\0" - "KEY_VALUES_MISMATCH\0" - "LOADING_CERT_DIR\0" - "LOADING_DEFAULTS\0" - "NAME_TOO_LONG\0" - "NEWER_CRL_NOT_NEWER\0" - "NO_CERT_SET_FOR_US_TO_VERIFY\0" - "NO_CRL_NUMBER\0" - "PUBLIC_KEY_DECODE_ERROR\0" - "PUBLIC_KEY_ENCODE_ERROR\0" - "SHOULD_RETRY\0" - "UNKNOWN_KEY_TYPE\0" - "UNKNOWN_PURPOSE_ID\0" - "UNKNOWN_TRUST_ID\0" - "WRONG_LOOKUP_TYPE\0" - "BAD_IP_ADDRESS\0" - "BAD_OBJECT\0" - "BN_DEC2BN_ERROR\0" - "BN_TO_ASN1_INTEGER_ERROR\0" - "CANNOT_FIND_FREE_FUNCTION\0" - "DIRNAME_ERROR\0" - "DISTPOINT_ALREADY_SET\0" - "DUPLICATE_ZONE_ID\0" - "ERROR_CONVERTING_ZONE\0" - "ERROR_CREATING_EXTENSION\0" - "ERROR_IN_EXTENSION\0" - "EXPECTED_A_SECTION_NAME\0" - "EXTENSION_EXISTS\0" - "EXTENSION_NAME_ERROR\0" - "EXTENSION_NOT_FOUND\0" - "EXTENSION_SETTING_NOT_SUPPORTED\0" - "EXTENSION_VALUE_ERROR\0" - "ILLEGAL_EMPTY_EXTENSION\0" - "ILLEGAL_HEX_DIGIT\0" - "INCORRECT_POLICY_SYNTAX_TAG\0" - "INVALID_BOOLEAN_STRING\0" - "INVALID_EXTENSION_STRING\0" - "INVALID_MULTIPLE_RDNS\0" - "INVALID_NAME\0" - "INVALID_NULL_ARGUMENT\0" - "INVALID_NULL_NAME\0" - "INVALID_NULL_VALUE\0" - "INVALID_NUMBERS\0" - "INVALID_OBJECT_IDENTIFIER\0" - "INVALID_OPTION\0" - "INVALID_POLICY_IDENTIFIER\0" - "INVALID_PROXY_POLICY_SETTING\0" - "INVALID_PURPOSE\0" - "INVALID_SECTION\0" - "INVALID_SYNTAX\0" - "ISSUER_DECODE_ERROR\0" - "NEED_ORGANIZATION_AND_NUMBERS\0" - "NO_CONFIG_DATABASE\0" - "NO_ISSUER_CERTIFICATE\0" - "NO_ISSUER_DETAILS\0" - "NO_POLICY_IDENTIFIER\0" - "NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED\0" - "NO_PUBLIC_KEY\0" - "NO_SUBJECT_DETAILS\0" - "ODD_NUMBER_OF_DIGITS\0" - "OPERATION_NOT_DEFINED\0" - "OTHERNAME_ERROR\0" - "POLICY_LANGUAGE_ALREADY_DEFINED\0" - "POLICY_PATH_LENGTH\0" - "POLICY_PATH_LENGTH_ALREADY_DEFINED\0" - "POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY\0" - "SECTION_NOT_FOUND\0" - "UNABLE_TO_GET_ISSUER_DETAILS\0" - "UNABLE_TO_GET_ISSUER_KEYID\0" - "UNKNOWN_BIT_STRING_ARGUMENT\0" - "UNKNOWN_EXTENSION\0" - "UNKNOWN_EXTENSION_NAME\0" - "UNKNOWN_OPTION\0" - "UNSUPPORTED_OPTION\0" - "USER_TOO_LONG\0" - ""; diff --git a/Pods/BoringSSL-GRPC/include/openssl/cpu.h b/Pods/BoringSSL-GRPC/include/openssl/cpu.h deleted file mode 100644 index 3e92bf219..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/cpu.h +++ /dev/null @@ -1,196 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). */ - -#ifndef OPENSSL_HEADER_CPU_H -#define OPENSSL_HEADER_CPU_H - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// Runtime CPU feature support - - -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) -// OPENSSL_ia32cap_P contains the Intel CPUID bits when running on an x86 or -// x86-64 system. -// -// Index 0: -// EDX for CPUID where EAX = 1 -// Bit 20 is always zero -// Bit 28 is adjusted to reflect whether the data cache is shared between -// multiple logical cores -// Bit 30 is used to indicate an Intel CPU -// Index 1: -// ECX for CPUID where EAX = 1 -// Bit 11 is used to indicate AMD XOP support, not SDBG -// Index 2: -// EBX for CPUID where EAX = 7 -// Index 3 is set to zero. -// -// Note: the CPUID bits are pre-adjusted for the OSXSAVE bit and the YMM and XMM -// bits in XCR0, so it is not necessary to check those. -extern uint32_t OPENSSL_ia32cap_P[4]; - -#if defined(BORINGSSL_FIPS) -const uint32_t *OPENSSL_ia32cap_get(void); -#else -static inline const uint32_t *OPENSSL_ia32cap_get(void) { - return OPENSSL_ia32cap_P; -} -#endif - -#endif - -#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) - -#if defined(OPENSSL_APPLE) -// iOS builds use the static ARM configuration. -#define OPENSSL_STATIC_ARMCAP -#endif - -#if !defined(OPENSSL_STATIC_ARMCAP) - -// CRYPTO_is_NEON_capable_at_runtime returns true if the current CPU has a NEON -// unit. Note that |OPENSSL_armcap_P| also exists and contains the same -// information in a form that's easier for assembly to use. -OPENSSL_EXPORT char CRYPTO_is_NEON_capable_at_runtime(void); - -// CRYPTO_is_NEON_capable returns true if the current CPU has a NEON unit. If -// this is known statically then it returns one immediately. -static inline int CRYPTO_is_NEON_capable(void) { - // Only statically skip the runtime lookup on aarch64. On arm, one CPU is - // known to have a broken NEON unit which is known to fail with on some - // hand-written NEON assembly. For now, continue to apply the workaround even - // when the compiler is instructed to freely emit NEON code. See - // https://crbug.com/341598 and https://crbug.com/606629. -#if defined(__ARM_NEON__) && !defined(OPENSSL_ARM) - return 1; -#else - return CRYPTO_is_NEON_capable_at_runtime(); -#endif -} - -#if defined(OPENSSL_ARM) -// CRYPTO_has_broken_NEON returns one if the current CPU is known to have a -// broken NEON unit. See https://crbug.com/341598. -OPENSSL_EXPORT int CRYPTO_has_broken_NEON(void); - -// CRYPTO_needs_hwcap2_workaround returns one if the ARMv8 AArch32 AT_HWCAP2 -// workaround was needed. See https://crbug.com/boringssl/46. -OPENSSL_EXPORT int CRYPTO_needs_hwcap2_workaround(void); -#endif - -// CRYPTO_is_ARMv8_AES_capable returns true if the current CPU supports the -// ARMv8 AES instruction. -int CRYPTO_is_ARMv8_AES_capable(void); - -// CRYPTO_is_ARMv8_PMULL_capable returns true if the current CPU supports the -// ARMv8 PMULL instruction. -int CRYPTO_is_ARMv8_PMULL_capable(void); - -#else - -static inline int CRYPTO_is_NEON_capable(void) { -#if defined(OPENSSL_STATIC_ARMCAP_NEON) || defined(__ARM_NEON__) - return 1; -#else - return 0; -#endif -} - -static inline int CRYPTO_is_ARMv8_AES_capable(void) { -#if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO) - return 1; -#else - return 0; -#endif -} - -static inline int CRYPTO_is_ARMv8_PMULL_capable(void) { -#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO) - return 1; -#else - return 0; -#endif -} - -#endif // OPENSSL_STATIC_ARMCAP -#endif // OPENSSL_ARM || OPENSSL_AARCH64 - -#if defined(OPENSSL_PPC64LE) - -// CRYPTO_is_PPC64LE_vcrypto_capable returns true iff the current CPU supports -// the Vector.AES category of instructions. -int CRYPTO_is_PPC64LE_vcrypto_capable(void); - -extern unsigned long OPENSSL_ppc64le_hwcap2; - -#endif // OPENSSL_PPC64LE - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CPU_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/lhash.h b/Pods/BoringSSL-GRPC/include/openssl/lhash.h deleted file mode 100644 index 1d75eb78c..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/lhash.h +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_LHASH_H -#define OPENSSL_HEADER_LHASH_H - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// lhash is a traditional, chaining hash table that automatically expands and -// contracts as needed. One should not use the lh_* functions directly, rather -// use the type-safe macro wrappers: -// -// A hash table of a specific type of object has type |LHASH_OF(type)|. This -// can be defined (once) with |DEFINE_LHASH_OF(type)| and declared where needed -// with |DECLARE_LHASH_OF(type)|. For example: -// -// struct foo { -// int bar; -// }; -// -// DEFINE_LHASH_OF(struct foo); -// -// Although note that the hash table will contain /pointers/ to |foo|. -// -// A macro will be defined for each of the lh_* functions below. For -// LHASH_OF(foo), the macros would be lh_foo_new, lh_foo_num_items etc. - - -#define LHASH_OF(type) struct lhash_st_##type - -#define DEFINE_LHASH_OF(type) LHASH_OF(type) { int dummy; } - -#define DECLARE_LHASH_OF(type) LHASH_OF(type); - -// The make_macros.sh script in this directory parses the following lines and -// generates the lhash_macros.h file that contains macros for the following -// types of stacks: -// -// LHASH_OF:ASN1_OBJECT -// LHASH_OF:CONF_VALUE -// LHASH_OF:CRYPTO_BUFFER -// LHASH_OF:SSL_SESSION - -#define IN_LHASH_H -#include -#undef IN_LHASH_H - - -// lhash_item_st is an element of a hash chain. It points to the opaque data -// for this element and to the next item in the chain. The linked-list is NULL -// terminated. -typedef struct lhash_item_st { - void *data; - struct lhash_item_st *next; - // hash contains the cached, hash value of |data|. - uint32_t hash; -} LHASH_ITEM; - -// lhash_cmp_func is a comparison function that returns a value equal, or not -// equal, to zero depending on whether |*a| is equal, or not equal to |*b|, -// respectively. Note the difference between this and |stack_cmp_func| in that -// this takes pointers to the objects directly. -typedef int (*lhash_cmp_func)(const void *a, const void *b); - -// lhash_hash_func is a function that maps an object to a uniformly distributed -// uint32_t. -typedef uint32_t (*lhash_hash_func)(const void *a); - -typedef struct lhash_st _LHASH; - -// lh_new returns a new, empty hash table or NULL on error. -OPENSSL_EXPORT _LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp); - -// lh_free frees the hash table itself but none of the elements. See -// |lh_doall|. -OPENSSL_EXPORT void lh_free(_LHASH *lh); - -// lh_num_items returns the number of items in |lh|. -OPENSSL_EXPORT size_t lh_num_items(const _LHASH *lh); - -// lh_retrieve finds an element equal to |data| in the hash table and returns -// it. If no such element exists, it returns NULL. -OPENSSL_EXPORT void *lh_retrieve(const _LHASH *lh, const void *data); - -// lh_insert inserts |data| into the hash table. If an existing element is -// equal to |data| (with respect to the comparison function) then |*old_data| -// will be set to that value and it will be replaced. Otherwise, or in the -// event of an error, |*old_data| will be set to NULL. It returns one on -// success or zero in the case of an allocation error. -OPENSSL_EXPORT int lh_insert(_LHASH *lh, void **old_data, void *data); - -// lh_delete removes an element equal to |data| from the hash table and returns -// it. If no such element is found, it returns NULL. -OPENSSL_EXPORT void *lh_delete(_LHASH *lh, const void *data); - -// lh_doall calls |func| on each element of the hash table. -// TODO(fork): rename this -OPENSSL_EXPORT void lh_doall(_LHASH *lh, void (*func)(void *)); - -// lh_doall_arg calls |func| on each element of the hash table and also passes -// |arg| as the second argument. -// TODO(fork): rename this -OPENSSL_EXPORT void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), - void *arg); - -// lh_strhash is the default hash function which processes NUL-terminated -// strings. -OPENSSL_EXPORT uint32_t lh_strhash(const char *c); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_LHASH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/lhash.h.grpc_back b/Pods/BoringSSL-GRPC/include/openssl/lhash.h.grpc_back deleted file mode 100644 index 1ceeb6998..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/lhash.h.grpc_back +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_LHASH_H -#define OPENSSL_HEADER_LHASH_H - -#include -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// lhash is a traditional, chaining hash table that automatically expands and -// contracts as needed. One should not use the lh_* functions directly, rather -// use the type-safe macro wrappers: -// -// A hash table of a specific type of object has type |LHASH_OF(type)|. This -// can be defined (once) with |DEFINE_LHASH_OF(type)| and declared where needed -// with |DECLARE_LHASH_OF(type)|. For example: -// -// struct foo { -// int bar; -// }; -// -// DEFINE_LHASH_OF(struct foo); -// -// Although note that the hash table will contain /pointers/ to |foo|. -// -// A macro will be defined for each of the lh_* functions below. For -// LHASH_OF(foo), the macros would be lh_foo_new, lh_foo_num_items etc. - - -#define LHASH_OF(type) struct lhash_st_##type - -#define DEFINE_LHASH_OF(type) LHASH_OF(type) { int dummy; } - -#define DECLARE_LHASH_OF(type) LHASH_OF(type); - -// The make_macros.sh script in this directory parses the following lines and -// generates the lhash_macros.h file that contains macros for the following -// types of stacks: -// -// LHASH_OF:ASN1_OBJECT -// LHASH_OF:CONF_VALUE -// LHASH_OF:CRYPTO_BUFFER -// LHASH_OF:SSL_SESSION - -#define IN_LHASH_H -#include -#undef IN_LHASH_H - - -// lhash_item_st is an element of a hash chain. It points to the opaque data -// for this element and to the next item in the chain. The linked-list is NULL -// terminated. -typedef struct lhash_item_st { - void *data; - struct lhash_item_st *next; - // hash contains the cached, hash value of |data|. - uint32_t hash; -} LHASH_ITEM; - -// lhash_cmp_func is a comparison function that returns a value equal, or not -// equal, to zero depending on whether |*a| is equal, or not equal to |*b|, -// respectively. Note the difference between this and |stack_cmp_func| in that -// this takes pointers to the objects directly. -typedef int (*lhash_cmp_func)(const void *a, const void *b); - -// lhash_hash_func is a function that maps an object to a uniformly distributed -// uint32_t. -typedef uint32_t (*lhash_hash_func)(const void *a); - -typedef struct lhash_st _LHASH; - -// lh_new returns a new, empty hash table or NULL on error. -OPENSSL_EXPORT _LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp); - -// lh_free frees the hash table itself but none of the elements. See -// |lh_doall|. -OPENSSL_EXPORT void lh_free(_LHASH *lh); - -// lh_num_items returns the number of items in |lh|. -OPENSSL_EXPORT size_t lh_num_items(const _LHASH *lh); - -// lh_retrieve finds an element equal to |data| in the hash table and returns -// it. If no such element exists, it returns NULL. -OPENSSL_EXPORT void *lh_retrieve(const _LHASH *lh, const void *data); - -// lh_insert inserts |data| into the hash table. If an existing element is -// equal to |data| (with respect to the comparison function) then |*old_data| -// will be set to that value and it will be replaced. Otherwise, or in the -// event of an error, |*old_data| will be set to NULL. It returns one on -// success or zero in the case of an allocation error. -OPENSSL_EXPORT int lh_insert(_LHASH *lh, void **old_data, void *data); - -// lh_delete removes an element equal to |data| from the hash table and returns -// it. If no such element is found, it returns NULL. -OPENSSL_EXPORT void *lh_delete(_LHASH *lh, const void *data); - -// lh_doall calls |func| on each element of the hash table. -// TODO(fork): rename this -OPENSSL_EXPORT void lh_doall(_LHASH *lh, void (*func)(void *)); - -// lh_doall_arg calls |func| on each element of the hash table and also passes -// |arg| as the second argument. -// TODO(fork): rename this -OPENSSL_EXPORT void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), - void *arg); - -// lh_strhash is the default hash function which processes NUL-terminated -// strings. -OPENSSL_EXPORT uint32_t lh_strhash(const char *c); - - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_LHASH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/lhash_macros.h b/Pods/BoringSSL-GRPC/include/openssl/lhash_macros.h deleted file mode 100644 index 378c8391e..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/lhash_macros.h +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#if !defined(IN_LHASH_H) -#error "Don't include this file directly. Include lhash.h" -#endif - -// ASN1_OBJECT -#define lh_ASN1_OBJECT_new(hash, comp) \ - ((LHASH_OF(ASN1_OBJECT) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const ASN1_OBJECT *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const ASN1_OBJECT *a, const ASN1_OBJECT *b), \ - comp))) - -#define lh_ASN1_OBJECT_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh)); - -#define lh_ASN1_OBJECT_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh)) - -#define lh_ASN1_OBJECT_retrieve(lh, data) \ - ((ASN1_OBJECT *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void *, ASN1_OBJECT *, data))) - -#define lh_ASN1_OBJECT_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void **, ASN1_OBJECT **, old_data), \ - CHECKED_CAST(void *, ASN1_OBJECT *, data)) - -#define lh_ASN1_OBJECT_delete(lh, data) \ - ((ASN1_OBJECT *)lh_delete( \ - CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void *, ASN1_OBJECT *, data))) - -#define lh_ASN1_OBJECT_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), func)); - -#define lh_ASN1_OBJECT_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(ASN1_OBJECT *, void *), func), \ - arg); - - -// CONF_VALUE -#define lh_CONF_VALUE_new(hash, comp) \ - ((LHASH_OF(CONF_VALUE) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const CONF_VALUE *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const CONF_VALUE *a, const CONF_VALUE *b), comp))) - -#define lh_CONF_VALUE_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh)); - -#define lh_CONF_VALUE_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh)) - -#define lh_CONF_VALUE_retrieve(lh, data) \ - ((CONF_VALUE *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void *, CONF_VALUE *, data))) - -#define lh_CONF_VALUE_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void **, CONF_VALUE **, old_data), \ - CHECKED_CAST(void *, CONF_VALUE *, data)) - -#define lh_CONF_VALUE_delete(lh, data) \ - ((CONF_VALUE *)lh_delete(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void *, CONF_VALUE *, data))) - -#define lh_CONF_VALUE_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), func)); - -#define lh_CONF_VALUE_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(CONF_VALUE *, void *), func), \ - arg); - - -// CRYPTO_BUFFER -#define lh_CRYPTO_BUFFER_new(hash, comp) \ - ((LHASH_OF(CRYPTO_BUFFER) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const CRYPTO_BUFFER *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const CRYPTO_BUFFER *a, const CRYPTO_BUFFER *b), \ - comp))) - -#define lh_CRYPTO_BUFFER_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh)); - -#define lh_CRYPTO_BUFFER_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh)) - -#define lh_CRYPTO_BUFFER_retrieve(lh, data) \ - ((CRYPTO_BUFFER *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void *, CRYPTO_BUFFER *, data))) - -#define lh_CRYPTO_BUFFER_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void **, CRYPTO_BUFFER **, old_data), \ - CHECKED_CAST(void *, CRYPTO_BUFFER *, data)) - -#define lh_CRYPTO_BUFFER_delete(lh, data) \ - ((CRYPTO_BUFFER *)lh_delete( \ - CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void *, CRYPTO_BUFFER *, data))) - -#define lh_CRYPTO_BUFFER_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_BUFFER *), func)); - -#define lh_CRYPTO_BUFFER_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(CRYPTO_BUFFER *, void *), func), \ - arg); - - -// SSL_SESSION -#define lh_SSL_SESSION_new(hash, comp) \ - ((LHASH_OF(SSL_SESSION) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const SSL_SESSION *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const SSL_SESSION *a, const SSL_SESSION *b), \ - comp))) - -#define lh_SSL_SESSION_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh)); - -#define lh_SSL_SESSION_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh)) - -#define lh_SSL_SESSION_retrieve(lh, data) \ - ((SSL_SESSION *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void *, SSL_SESSION *, data))) - -#define lh_SSL_SESSION_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void **, SSL_SESSION **, old_data), \ - CHECKED_CAST(void *, SSL_SESSION *, data)) - -#define lh_SSL_SESSION_delete(lh, data) \ - ((SSL_SESSION *)lh_delete( \ - CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void *, SSL_SESSION *, data))) - -#define lh_SSL_SESSION_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(SSL_SESSION *), func)); - -#define lh_SSL_SESSION_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(SSL_SESSION *, void *), func), \ - arg); diff --git a/Pods/BoringSSL-GRPC/include/openssl/lhash_macros.h.grpc_back b/Pods/BoringSSL-GRPC/include/openssl/lhash_macros.h.grpc_back deleted file mode 100644 index 378c8391e..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/lhash_macros.h.grpc_back +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#if !defined(IN_LHASH_H) -#error "Don't include this file directly. Include lhash.h" -#endif - -// ASN1_OBJECT -#define lh_ASN1_OBJECT_new(hash, comp) \ - ((LHASH_OF(ASN1_OBJECT) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const ASN1_OBJECT *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const ASN1_OBJECT *a, const ASN1_OBJECT *b), \ - comp))) - -#define lh_ASN1_OBJECT_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh)); - -#define lh_ASN1_OBJECT_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh)) - -#define lh_ASN1_OBJECT_retrieve(lh, data) \ - ((ASN1_OBJECT *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void *, ASN1_OBJECT *, data))) - -#define lh_ASN1_OBJECT_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void **, ASN1_OBJECT **, old_data), \ - CHECKED_CAST(void *, ASN1_OBJECT *, data)) - -#define lh_ASN1_OBJECT_delete(lh, data) \ - ((ASN1_OBJECT *)lh_delete( \ - CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void *, ASN1_OBJECT *, data))) - -#define lh_ASN1_OBJECT_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(ASN1_OBJECT *), func)); - -#define lh_ASN1_OBJECT_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(ASN1_OBJECT) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(ASN1_OBJECT *, void *), func), \ - arg); - - -// CONF_VALUE -#define lh_CONF_VALUE_new(hash, comp) \ - ((LHASH_OF(CONF_VALUE) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const CONF_VALUE *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const CONF_VALUE *a, const CONF_VALUE *b), comp))) - -#define lh_CONF_VALUE_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh)); - -#define lh_CONF_VALUE_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh)) - -#define lh_CONF_VALUE_retrieve(lh, data) \ - ((CONF_VALUE *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void *, CONF_VALUE *, data))) - -#define lh_CONF_VALUE_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void **, CONF_VALUE **, old_data), \ - CHECKED_CAST(void *, CONF_VALUE *, data)) - -#define lh_CONF_VALUE_delete(lh, data) \ - ((CONF_VALUE *)lh_delete(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void *, CONF_VALUE *, data))) - -#define lh_CONF_VALUE_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(CONF_VALUE *), func)); - -#define lh_CONF_VALUE_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(CONF_VALUE) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(CONF_VALUE *, void *), func), \ - arg); - - -// CRYPTO_BUFFER -#define lh_CRYPTO_BUFFER_new(hash, comp) \ - ((LHASH_OF(CRYPTO_BUFFER) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const CRYPTO_BUFFER *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const CRYPTO_BUFFER *a, const CRYPTO_BUFFER *b), \ - comp))) - -#define lh_CRYPTO_BUFFER_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh)); - -#define lh_CRYPTO_BUFFER_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh)) - -#define lh_CRYPTO_BUFFER_retrieve(lh, data) \ - ((CRYPTO_BUFFER *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void *, CRYPTO_BUFFER *, data))) - -#define lh_CRYPTO_BUFFER_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void **, CRYPTO_BUFFER **, old_data), \ - CHECKED_CAST(void *, CRYPTO_BUFFER *, data)) - -#define lh_CRYPTO_BUFFER_delete(lh, data) \ - ((CRYPTO_BUFFER *)lh_delete( \ - CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void *, CRYPTO_BUFFER *, data))) - -#define lh_CRYPTO_BUFFER_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(CRYPTO_BUFFER *), func)); - -#define lh_CRYPTO_BUFFER_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(CRYPTO_BUFFER) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(CRYPTO_BUFFER *, void *), func), \ - arg); - - -// SSL_SESSION -#define lh_SSL_SESSION_new(hash, comp) \ - ((LHASH_OF(SSL_SESSION) *)lh_new( \ - CHECKED_CAST(lhash_hash_func, uint32_t(*)(const SSL_SESSION *), hash), \ - CHECKED_CAST(lhash_cmp_func, \ - int (*)(const SSL_SESSION *a, const SSL_SESSION *b), \ - comp))) - -#define lh_SSL_SESSION_free(lh) \ - lh_free(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh)); - -#define lh_SSL_SESSION_num_items(lh) \ - lh_num_items(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh)) - -#define lh_SSL_SESSION_retrieve(lh, data) \ - ((SSL_SESSION *)lh_retrieve( \ - CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void *, SSL_SESSION *, data))) - -#define lh_SSL_SESSION_insert(lh, old_data, data) \ - lh_insert(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void **, SSL_SESSION **, old_data), \ - CHECKED_CAST(void *, SSL_SESSION *, data)) - -#define lh_SSL_SESSION_delete(lh, data) \ - ((SSL_SESSION *)lh_delete( \ - CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void *, SSL_SESSION *, data))) - -#define lh_SSL_SESSION_doall(lh, func) \ - lh_doall(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void (*)(void *), void (*)(SSL_SESSION *), func)); - -#define lh_SSL_SESSION_doall_arg(lh, func, arg) \ - lh_doall_arg(CHECKED_CAST(_LHASH *, LHASH_OF(SSL_SESSION) *, lh), \ - CHECKED_CAST(void (*)(void *, void *), \ - void (*)(SSL_SESSION *, void *), func), \ - arg); diff --git a/Pods/BoringSSL-GRPC/include/openssl/pem.h b/Pods/BoringSSL-GRPC/include/openssl/pem.h deleted file mode 100644 index 8d2a3883d..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/pem.h +++ /dev/null @@ -1,397 +0,0 @@ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_PEM_H -#define OPENSSL_HEADER_PEM_H - -#include -#include -#include -#include -#include -#include -#include - -/* For compatibility with open-iscsi, which assumes that it can get - * |OPENSSL_malloc| from pem.h or err.h */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -#define PEM_BUFSIZE 1024 - -#define PEM_STRING_X509_OLD "X509 CERTIFICATE" -#define PEM_STRING_X509 "CERTIFICATE" -#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" -#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" -#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" -#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" -#define PEM_STRING_X509_CRL "X509 CRL" -#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" -#define PEM_STRING_PUBLIC "PUBLIC KEY" -#define PEM_STRING_RSA "RSA PRIVATE KEY" -#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" -#define PEM_STRING_DSA "DSA PRIVATE KEY" -#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" -#define PEM_STRING_EC "EC PRIVATE KEY" -#define PEM_STRING_PKCS7 "PKCS7" -#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" -#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" -#define PEM_STRING_PKCS8INF "PRIVATE KEY" -#define PEM_STRING_DHPARAMS "DH PARAMETERS" -#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" -#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" -#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" -#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" -#define PEM_STRING_CMS "CMS" - -/* enc_type is one off */ -#define PEM_TYPE_ENCRYPTED 10 -#define PEM_TYPE_MIC_ONLY 20 -#define PEM_TYPE_MIC_CLEAR 30 -#define PEM_TYPE_CLEAR 40 - -/* These macros make the PEM_read/PEM_write functions easier to maintain and - * write. Now they are all implemented with either: - * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) - */ - -#ifdef OPENSSL_NO_FP_API - -#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ - -#else - -#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ -OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ -{ \ -return (type *)PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \ -} - -#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x) \ -{ \ -return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x) \ -{ \ -return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ - } - -#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ - } - -#endif - -#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ -OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ -{ \ -return (type *)PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \ -} - -#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x) \ -{ \ -return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x) \ -{ \ -return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \ - } - -#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \ - } - -#define IMPLEMENT_PEM_write(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_read_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb(name, type, str, asn1) - -/* These are the same except they are for the declarations */ - -#if defined(OPENSSL_NO_FP_API) - -#define DECLARE_PEM_read_fp(name, type) /**/ -#define DECLARE_PEM_write_fp(name, type) /**/ -#define DECLARE_PEM_write_cb_fp(name, type) /**/ - -#else - -#define DECLARE_PEM_read_fp(name, type) \ - OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); - -#define DECLARE_PEM_write_fp(name, type) \ - OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x); - -#define DECLARE_PEM_write_fp_const(name, type) \ - OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x); - -#define DECLARE_PEM_write_cb_fp(name, type) \ - OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - -#endif - -#define DECLARE_PEM_read_bio(name, type) \ - OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); - -#define DECLARE_PEM_write_bio(name, type) \ - OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x); - -#define DECLARE_PEM_write_bio_const(name, type) \ - OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x); - -#define DECLARE_PEM_write_cb_bio(name, type) \ - OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - - -#define DECLARE_PEM_write(name, type) \ - DECLARE_PEM_write_bio(name, type) \ - DECLARE_PEM_write_fp(name, type) - -#define DECLARE_PEM_write_const(name, type) \ - DECLARE_PEM_write_bio_const(name, type) \ - DECLARE_PEM_write_fp_const(name, type) - -#define DECLARE_PEM_write_cb(name, type) \ - DECLARE_PEM_write_cb_bio(name, type) \ - DECLARE_PEM_write_cb_fp(name, type) - -#define DECLARE_PEM_read(name, type) \ - DECLARE_PEM_read_bio(name, type) \ - DECLARE_PEM_read_fp(name, type) - -#define DECLARE_PEM_rw(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write(name, type) - -#define DECLARE_PEM_rw_const(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_const(name, type) - -#define DECLARE_PEM_rw_cb(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_cb(name, type) - -/* "userdata": new with OpenSSL 0.9.4 */ -typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); - -OPENSSL_EXPORT int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); -OPENSSL_EXPORT int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, pem_password_cb *callback,void *u); - -OPENSSL_EXPORT int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,long *len); -OPENSSL_EXPORT int PEM_write_bio(BIO *bp,const char *name, const char *hdr, const unsigned char *data, long len); -OPENSSL_EXPORT int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); -OPENSSL_EXPORT void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp, void *x, const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); - -OPENSSL_EXPORT int PEM_read(FILE *fp, char **name, char **header, unsigned char **data,long *len); -OPENSSL_EXPORT int PEM_write(FILE *fp, const char *name, const char *hdr, const unsigned char *data, long len); -OPENSSL_EXPORT void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u); -OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); - -/* PEM_def_callback treats |userdata| as a string and copies it into |buf|, - * assuming its |size| is sufficient. Returns the length of the string, or 0 - * if there is not enough room. If either |buf| or |userdata| is NULL, 0 is - * returned. Note that this is different from OpenSSL, which prompts for a - * password. */ -OPENSSL_EXPORT int PEM_def_callback(char *buf, int size, int rwflag, void *userdata); -OPENSSL_EXPORT void PEM_proc_type(char *buf, int type); -OPENSSL_EXPORT void PEM_dek_info(char *buf, const char *type, int len, char *str); - - -DECLARE_PEM_rw(X509, X509) - -DECLARE_PEM_rw(X509_AUX, X509) - -DECLARE_PEM_rw(X509_REQ, X509_REQ) -DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) - -DECLARE_PEM_rw(X509_CRL, X509_CRL) - -DECLARE_PEM_rw(PKCS8, X509_SIG) - -DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) - -DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) - -DECLARE_PEM_rw_const(RSAPublicKey, RSA) -DECLARE_PEM_rw(RSA_PUBKEY, RSA) - -#ifndef OPENSSL_NO_DSA - -DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) - -DECLARE_PEM_rw(DSA_PUBKEY, DSA) - -DECLARE_PEM_rw_const(DSAparams, DSA) - -#endif - -DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) -DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) - - -DECLARE_PEM_rw_const(DHparams, DH) - - -DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) - -DECLARE_PEM_rw(PUBKEY, EVP_PKEY) - -OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, char *, int, pem_password_cb *, void *); -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); - - -#ifdef __cplusplus -} -#endif - -#define PEM_R_BAD_BASE64_DECODE 100 -#define PEM_R_BAD_DECRYPT 101 -#define PEM_R_BAD_END_LINE 102 -#define PEM_R_BAD_IV_CHARS 103 -#define PEM_R_BAD_PASSWORD_READ 104 -#define PEM_R_CIPHER_IS_NULL 105 -#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 106 -#define PEM_R_NOT_DEK_INFO 107 -#define PEM_R_NOT_ENCRYPTED 108 -#define PEM_R_NOT_PROC_TYPE 109 -#define PEM_R_NO_START_LINE 110 -#define PEM_R_READ_KEY 111 -#define PEM_R_SHORT_HEADER 112 -#define PEM_R_UNSUPPORTED_CIPHER 113 -#define PEM_R_UNSUPPORTED_ENCRYPTION 114 - -#endif /* OPENSSL_HEADER_PEM_H */ diff --git a/Pods/BoringSSL-GRPC/include/openssl/pem.h.grpc_back b/Pods/BoringSSL-GRPC/include/openssl/pem.h.grpc_back deleted file mode 100644 index 4868e12fe..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/pem.h.grpc_back +++ /dev/null @@ -1,397 +0,0 @@ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_PEM_H -#define OPENSSL_HEADER_PEM_H - -#include -#include -#include -#include -#include -#include -#include - -/* For compatibility with open-iscsi, which assumes that it can get - * |OPENSSL_malloc| from pem.h or err.h */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -#define PEM_BUFSIZE 1024 - -#define PEM_STRING_X509_OLD "X509 CERTIFICATE" -#define PEM_STRING_X509 "CERTIFICATE" -#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" -#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" -#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" -#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" -#define PEM_STRING_X509_CRL "X509 CRL" -#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" -#define PEM_STRING_PUBLIC "PUBLIC KEY" -#define PEM_STRING_RSA "RSA PRIVATE KEY" -#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" -#define PEM_STRING_DSA "DSA PRIVATE KEY" -#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" -#define PEM_STRING_EC "EC PRIVATE KEY" -#define PEM_STRING_PKCS7 "PKCS7" -#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" -#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" -#define PEM_STRING_PKCS8INF "PRIVATE KEY" -#define PEM_STRING_DHPARAMS "DH PARAMETERS" -#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" -#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" -#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" -#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" -#define PEM_STRING_CMS "CMS" - -/* enc_type is one off */ -#define PEM_TYPE_ENCRYPTED 10 -#define PEM_TYPE_MIC_ONLY 20 -#define PEM_TYPE_MIC_CLEAR 30 -#define PEM_TYPE_CLEAR 40 - -/* These macros make the PEM_read/PEM_write functions easier to maintain and - * write. Now they are all implemented with either: - * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) - */ - -#ifdef OPENSSL_NO_FP_API - -#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ -#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ - -#else - -#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ -OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u)\ -{ \ -return (type *)PEM_ASN1_read((d2i_of_void *)d2i_##asn1, str,fp,(void **)x,cb,u); \ -} - -#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x) \ -{ \ -return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x) \ -{ \ -return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,(void *)x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ - } - -#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, \ - void *u) \ - { \ - return PEM_ASN1_write((i2d_of_void *)i2d_##asn1,str,fp,x,enc,kstr,klen,cb,u); \ - } - -#endif - -#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ -OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u)\ -{ \ -return (type *)PEM_ASN1_read_bio((d2i_of_void *)d2i_##asn1, str,bp,(void **)x,cb,u); \ -} - -#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x) \ -{ \ -return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x) \ -{ \ -return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,NULL,NULL,0,NULL,NULL); \ -} - -#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,x,enc,kstr,klen,cb,u); \ - } - -#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ -OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u) \ - { \ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_##asn1,str,bp,(void *)x,enc,kstr,klen,cb,u); \ - } - -#define IMPLEMENT_PEM_write(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ - IMPLEMENT_PEM_read_fp(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_const(name, type, str, asn1) - -#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ - IMPLEMENT_PEM_read(name, type, str, asn1) \ - IMPLEMENT_PEM_write_cb(name, type, str, asn1) - -/* These are the same except they are for the declarations */ - -#if defined(OPENSSL_NO_FP_API) - -#define DECLARE_PEM_read_fp(name, type) /**/ -#define DECLARE_PEM_write_fp(name, type) /**/ -#define DECLARE_PEM_write_cb_fp(name, type) /**/ - -#else - -#define DECLARE_PEM_read_fp(name, type) \ - OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); - -#define DECLARE_PEM_write_fp(name, type) \ - OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x); - -#define DECLARE_PEM_write_fp_const(name, type) \ - OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x); - -#define DECLARE_PEM_write_cb_fp(name, type) \ - OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - -#endif - -#define DECLARE_PEM_read_bio(name, type) \ - OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); - -#define DECLARE_PEM_write_bio(name, type) \ - OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x); - -#define DECLARE_PEM_write_bio_const(name, type) \ - OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x); - -#define DECLARE_PEM_write_cb_bio(name, type) \ - OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ - unsigned char *kstr, int klen, pem_password_cb *cb, void *u); - - -#define DECLARE_PEM_write(name, type) \ - DECLARE_PEM_write_bio(name, type) \ - DECLARE_PEM_write_fp(name, type) - -#define DECLARE_PEM_write_const(name, type) \ - DECLARE_PEM_write_bio_const(name, type) \ - DECLARE_PEM_write_fp_const(name, type) - -#define DECLARE_PEM_write_cb(name, type) \ - DECLARE_PEM_write_cb_bio(name, type) \ - DECLARE_PEM_write_cb_fp(name, type) - -#define DECLARE_PEM_read(name, type) \ - DECLARE_PEM_read_bio(name, type) \ - DECLARE_PEM_read_fp(name, type) - -#define DECLARE_PEM_rw(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write(name, type) - -#define DECLARE_PEM_rw_const(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_const(name, type) - -#define DECLARE_PEM_rw_cb(name, type) \ - DECLARE_PEM_read(name, type) \ - DECLARE_PEM_write_cb(name, type) - -/* "userdata": new with OpenSSL 0.9.4 */ -typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); - -OPENSSL_EXPORT int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); -OPENSSL_EXPORT int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, pem_password_cb *callback,void *u); - -OPENSSL_EXPORT int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,long *len); -OPENSSL_EXPORT int PEM_write_bio(BIO *bp,const char *name, const char *hdr, const unsigned char *data, long len); -OPENSSL_EXPORT int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); -OPENSSL_EXPORT void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp, void *x, const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); - -OPENSSL_EXPORT int PEM_read(FILE *fp, char **name, char **header, unsigned char **data,long *len); -OPENSSL_EXPORT int PEM_write(FILE *fp, const char *name, const char *hdr, const unsigned char *data, long len); -OPENSSL_EXPORT void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u); -OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); - -/* PEM_def_callback treats |userdata| as a string and copies it into |buf|, - * assuming its |size| is sufficient. Returns the length of the string, or 0 - * if there is not enough room. If either |buf| or |userdata| is NULL, 0 is - * returned. Note that this is different from OpenSSL, which prompts for a - * password. */ -OPENSSL_EXPORT int PEM_def_callback(char *buf, int size, int rwflag, void *userdata); -OPENSSL_EXPORT void PEM_proc_type(char *buf, int type); -OPENSSL_EXPORT void PEM_dek_info(char *buf, const char *type, int len, char *str); - - -DECLARE_PEM_rw(X509, X509) - -DECLARE_PEM_rw(X509_AUX, X509) - -DECLARE_PEM_rw(X509_REQ, X509_REQ) -DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) - -DECLARE_PEM_rw(X509_CRL, X509_CRL) - -DECLARE_PEM_rw(PKCS8, X509_SIG) - -DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) - -DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) - -DECLARE_PEM_rw_const(RSAPublicKey, RSA) -DECLARE_PEM_rw(RSA_PUBKEY, RSA) - -#ifndef OPENSSL_NO_DSA - -DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) - -DECLARE_PEM_rw(DSA_PUBKEY, DSA) - -DECLARE_PEM_rw_const(DSAparams, DSA) - -#endif - -DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) -DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) - - -DECLARE_PEM_rw_const(DHparams, DH) - - -DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) - -DECLARE_PEM_rw(PUBKEY, EVP_PKEY) - -OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, char *, int, pem_password_cb *, void *); -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); -OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); - -OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); - - -#ifdef __cplusplus -} -#endif - -#define PEM_R_BAD_BASE64_DECODE 100 -#define PEM_R_BAD_DECRYPT 101 -#define PEM_R_BAD_END_LINE 102 -#define PEM_R_BAD_IV_CHARS 103 -#define PEM_R_BAD_PASSWORD_READ 104 -#define PEM_R_CIPHER_IS_NULL 105 -#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 106 -#define PEM_R_NOT_DEK_INFO 107 -#define PEM_R_NOT_ENCRYPTED 108 -#define PEM_R_NOT_PROC_TYPE 109 -#define PEM_R_NO_START_LINE 110 -#define PEM_R_READ_KEY 111 -#define PEM_R_SHORT_HEADER 112 -#define PEM_R_UNSUPPORTED_CIPHER 113 -#define PEM_R_UNSUPPORTED_ENCRYPTION 114 - -#endif /* OPENSSL_HEADER_PEM_H */ diff --git a/Pods/BoringSSL-GRPC/include/openssl/pkcs7.h b/Pods/BoringSSL-GRPC/include/openssl/pkcs7.h deleted file mode 100644 index 1a04d38a1..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/pkcs7.h +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_PKCS7_H -#define OPENSSL_HEADER_PKCS7_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// PKCS#7. -// -// This library contains functions for extracting information from PKCS#7 -// structures (RFC 2315). - -DECLARE_STACK_OF(CRYPTO_BUFFER) -DECLARE_STACK_OF(X509) -DECLARE_STACK_OF(X509_CRL) - -// PKCS7_get_raw_certificates parses a PKCS#7, SignedData structure from |cbs| -// and appends the included certificates to |out_certs|. It returns one on -// success and zero on error. -OPENSSL_EXPORT int PKCS7_get_raw_certificates( - STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool); - -// PKCS7_get_certificates behaves like |PKCS7_get_raw_certificates| but parses -// them into |X509| objects. -OPENSSL_EXPORT int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs); - -// PKCS7_bundle_certificates appends a PKCS#7, SignedData structure containing -// |certs| to |out|. It returns one on success and zero on error. -OPENSSL_EXPORT int PKCS7_bundle_certificates( - CBB *out, const STACK_OF(X509) *certs); - -// PKCS7_get_CRLs parses a PKCS#7, SignedData structure from |cbs| and appends -// the included CRLs to |out_crls|. It returns one on success and zero on -// error. -OPENSSL_EXPORT int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs); - -// PKCS7_bundle_CRLs appends a PKCS#7, SignedData structure containing -// |crls| to |out|. It returns one on success and zero on error. -OPENSSL_EXPORT int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls); - -// PKCS7_get_PEM_certificates reads a PEM-encoded, PKCS#7, SignedData structure -// from |pem_bio| and appends the included certificates to |out_certs|. It -// returns one on success and zero on error. -OPENSSL_EXPORT int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, - BIO *pem_bio); - -// PKCS7_get_PEM_CRLs reads a PEM-encoded, PKCS#7, SignedData structure from -// |pem_bio| and appends the included CRLs to |out_crls|. It returns one on -// success and zero on error. -OPENSSL_EXPORT int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, - BIO *pem_bio); - - -#if defined(__cplusplus) -} // extern C -#endif - -#define PKCS7_R_BAD_PKCS7_VERSION 100 -#define PKCS7_R_NOT_PKCS7_SIGNED_DATA 101 -#define PKCS7_R_NO_CERTIFICATES_INCLUDED 102 -#define PKCS7_R_NO_CRLS_INCLUDED 103 - -#endif // OPENSSL_HEADER_PKCS7_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/pkcs7.h.grpc_back b/Pods/BoringSSL-GRPC/include/openssl/pkcs7.h.grpc_back deleted file mode 100644 index d7081413b..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/pkcs7.h.grpc_back +++ /dev/null @@ -1,82 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_PKCS7_H -#define OPENSSL_HEADER_PKCS7_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// PKCS#7. -// -// This library contains functions for extracting information from PKCS#7 -// structures (RFC 2315). - -DECLARE_STACK_OF(CRYPTO_BUFFER) -DECLARE_STACK_OF(X509) -DECLARE_STACK_OF(X509_CRL) - -// PKCS7_get_raw_certificates parses a PKCS#7, SignedData structure from |cbs| -// and appends the included certificates to |out_certs|. It returns one on -// success and zero on error. -OPENSSL_EXPORT int PKCS7_get_raw_certificates( - STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool); - -// PKCS7_get_certificates behaves like |PKCS7_get_raw_certificates| but parses -// them into |X509| objects. -OPENSSL_EXPORT int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs); - -// PKCS7_bundle_certificates appends a PKCS#7, SignedData structure containing -// |certs| to |out|. It returns one on success and zero on error. -OPENSSL_EXPORT int PKCS7_bundle_certificates( - CBB *out, const STACK_OF(X509) *certs); - -// PKCS7_get_CRLs parses a PKCS#7, SignedData structure from |cbs| and appends -// the included CRLs to |out_crls|. It returns one on success and zero on -// error. -OPENSSL_EXPORT int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs); - -// PKCS7_bundle_CRLs appends a PKCS#7, SignedData structure containing -// |crls| to |out|. It returns one on success and zero on error. -OPENSSL_EXPORT int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls); - -// PKCS7_get_PEM_certificates reads a PEM-encoded, PKCS#7, SignedData structure -// from |pem_bio| and appends the included certificates to |out_certs|. It -// returns one on success and zero on error. -OPENSSL_EXPORT int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, - BIO *pem_bio); - -// PKCS7_get_PEM_CRLs reads a PEM-encoded, PKCS#7, SignedData structure from -// |pem_bio| and appends the included CRLs to |out_crls|. It returns one on -// success and zero on error. -OPENSSL_EXPORT int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, - BIO *pem_bio); - - -#if defined(__cplusplus) -} // extern C -#endif - -#define PKCS7_R_BAD_PKCS7_VERSION 100 -#define PKCS7_R_NOT_PKCS7_SIGNED_DATA 101 -#define PKCS7_R_NO_CERTIFICATES_INCLUDED 102 -#define PKCS7_R_NO_CRLS_INCLUDED 103 - -#endif // OPENSSL_HEADER_PKCS7_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/span.h b/Pods/BoringSSL-GRPC/include/openssl/span.h deleted file mode 100644 index f1ec8767f..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/span.h +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_SSL_SPAN_H -#define OPENSSL_HEADER_SSL_SPAN_H - -#include - -#if !defined(BORINGSSL_NO_CXX) - -extern "C++" { - -#include -#include -#include -#include - -namespace bssl { - -template -class Span; - -namespace internal { -template -class SpanBase { - // Put comparison operator implementations into a base class with const T, so - // they can be used with any type that implicitly converts into a Span. - static_assert(std::is_const::value, - "Span must be derived from SpanBase"); - - friend bool operator==(Span lhs, Span rhs) { - // MSVC issues warning C4996 because std::equal is unsafe. The pragma to - // suppress the warning mysteriously has no effect, hence this - // implementation. See - // https://msdn.microsoft.com/en-us/library/aa985974.aspx. - if (lhs.size() != rhs.size()) { - return false; - } - for (T *l = lhs.begin(), *r = rhs.begin(); l != lhs.end() && r != rhs.end(); - ++l, ++r) { - if (*l != *r) { - return false; - } - } - return true; - } - - friend bool operator!=(Span lhs, Span rhs) { return !(lhs == rhs); } -}; -} // namespace internal - -// A Span is a non-owning reference to a contiguous array of objects of type -// |T|. Conceptually, a Span is a simple a pointer to |T| and a count of -// elements accessible via that pointer. The elements referenced by the Span can -// be mutated if |T| is mutable. -// -// A Span can be constructed from container types implementing |data()| and -// |size()| methods. If |T| is constant, construction from a container type is -// implicit. This allows writing methods that accept data from some unspecified -// container type: -// -// // Foo views data referenced by v. -// void Foo(bssl::Span v) { ... } -// -// std::vector vec; -// Foo(vec); -// -// For mutable Spans, conversion is explicit: -// -// // FooMutate mutates data referenced by v. -// void FooMutate(bssl::Span v) { ... } -// -// FooMutate(bssl::Span(vec)); -// -// You can also use the |MakeSpan| and |MakeConstSpan| factory methods to -// construct Spans in order to deduce the type of the Span automatically. -// -// FooMutate(bssl::MakeSpan(vec)); -// -// Note that Spans have value type sematics. They are cheap to construct and -// copy, and should be passed by value whenever a method would otherwise accept -// a reference or pointer to a container or array. -template -class Span : private internal::SpanBase { - private: - // Heuristically test whether C is a container type that can be converted into - // a Span by checking for data() and size() member functions. - // - // TODO(davidben): Switch everything to std::enable_if_t when we remove - // support for MSVC 2015. Although we could write our own enable_if_t and MSVC - // 2015 has std::enable_if_t anyway, MSVC 2015's SFINAE implementation is - // problematic and does not work below unless we write the ::type at use. - template - using EnableIfContainer = std::enable_if< - std::is_convertible().data()), T *>::value && - std::is_integral().size())>::value>; - - static const size_t npos = static_cast(-1); - - public: - constexpr Span() : Span(nullptr, 0) {} - constexpr Span(T *ptr, size_t len) : data_(ptr), size_(len) {} - - template - constexpr Span(T (&array)[N]) : Span(array, N) {} - - template < - typename C, typename = typename EnableIfContainer::type, - typename = typename std::enable_if::value, C>::type> - Span(const C &container) : data_(container.data()), size_(container.size()) {} - - template < - typename C, typename = typename EnableIfContainer::type, - typename = typename std::enable_if::value, C>::type> - explicit Span(C &container) - : data_(container.data()), size_(container.size()) {} - - T *data() const { return data_; } - size_t size() const { return size_; } - bool empty() const { return size_ == 0; } - - T *begin() const { return data_; } - const T *cbegin() const { return data_; } - T *end() const { return data_ + size_; }; - const T *cend() const { return end(); }; - - T &front() const { - assert(size_ != 0); - return data_[0]; - } - T &back() const { - assert(size_ != 0); - return data_[size_ - 1]; - } - - T &operator[](size_t i) const { return data_[i]; } - T &at(size_t i) const { return data_[i]; } - - Span subspan(size_t pos = 0, size_t len = npos) const { - if (pos > size_) { - abort(); // absl::Span throws an exception here. - } - return Span(data_ + pos, std::min(size_ - pos, len)); - } - - private: - T *data_; - size_t size_; -}; - -template -const size_t Span::npos; - -template -Span MakeSpan(T *ptr, size_t size) { - return Span(ptr, size); -} - -template -auto MakeSpan(C &c) -> decltype(MakeSpan(c.data(), c.size())) { - return MakeSpan(c.data(), c.size()); -} - -template -Span MakeConstSpan(T *ptr, size_t size) { - return Span(ptr, size); -} - -template -auto MakeConstSpan(const C &c) -> decltype(MakeConstSpan(c.data(), c.size())) { - return MakeConstSpan(c.data(), c.size()); -} - -} // namespace bssl - -} // extern C++ - -#endif // !defined(BORINGSSL_NO_CXX) - -#endif // OPENSSL_HEADER_SSL_SPAN_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/stack.h b/Pods/BoringSSL-GRPC/include/openssl/stack.h deleted file mode 100644 index 8902fc011..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/stack.h +++ /dev/null @@ -1,485 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_STACK_H -#define OPENSSL_HEADER_STACK_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// A stack, in OpenSSL, is an array of pointers. They are the most commonly -// used collection object. -// -// This file defines macros for type safe use of the stack functions. A stack -// of a specific type of object has type |STACK_OF(type)|. This can be defined -// (once) with |DEFINE_STACK_OF(type)| and declared where needed with -// |DECLARE_STACK_OF(type)|. For example: -// -// typedef struct foo_st { -// int bar; -// } FOO; -// -// DEFINE_STACK_OF(FOO); -// -// Although note that the stack will contain /pointers/ to |FOO|. -// -// A macro will be defined for each of the sk_* functions below. For -// STACK_OF(FOO), the macros would be sk_FOO_new, sk_FOO_pop etc. - - -// stack_cmp_func is a comparison function that returns a value < 0, 0 or > 0 -// if |*a| is less than, equal to or greater than |*b|, respectively. Note the -// extra indirection - the function is given a pointer to a pointer to the -// element. This differs from the usual qsort/bsearch comparison function. -typedef int (*stack_cmp_func)(const void **a, const void **b); - -// stack_st contains an array of pointers. It is not designed to be used -// directly, rather the wrapper macros should be used. -typedef struct stack_st { - // num contains the number of valid pointers in |data|. - size_t num; - void **data; - // sorted is non-zero if the values pointed to by |data| are in ascending - // order, based on |comp|. - int sorted; - // num_alloc contains the number of pointers allocated in the buffer pointed - // to by |data|, which may be larger than |num|. - size_t num_alloc; - // comp is an optional comparison function. - stack_cmp_func comp; -} _STACK; - - -#define STACK_OF(type) struct stack_st_##type - -#define DECLARE_STACK_OF(type) STACK_OF(type); - -// These are the raw stack functions, you shouldn't be using them. Rather you -// should be using the type stack macros implemented above. - -// sk_new creates a new, empty stack with the given comparison function, which -// may be zero. It returns the new stack or NULL on allocation failure. -OPENSSL_EXPORT _STACK *sk_new(stack_cmp_func comp); - -// sk_new_null creates a new, empty stack. It returns the new stack or NULL on -// allocation failure. -OPENSSL_EXPORT _STACK *sk_new_null(void); - -// sk_num returns the number of elements in |s|. -OPENSSL_EXPORT size_t sk_num(const _STACK *sk); - -// sk_zero resets |sk| to the empty state but does nothing to free the -// individual elements themselves. -OPENSSL_EXPORT void sk_zero(_STACK *sk); - -// sk_value returns the |i|th pointer in |sk|, or NULL if |i| is out of -// range. -OPENSSL_EXPORT void *sk_value(const _STACK *sk, size_t i); - -// sk_set sets the |i|th pointer in |sk| to |p| and returns |p|. If |i| is out -// of range, it returns NULL. -OPENSSL_EXPORT void *sk_set(_STACK *sk, size_t i, void *p); - -// sk_free frees the given stack and array of pointers, but does nothing to -// free the individual elements. Also see |sk_pop_free|. -OPENSSL_EXPORT void sk_free(_STACK *sk); - -// sk_pop_free calls |free_func| on each element in the stack and then frees -// the stack itself. -OPENSSL_EXPORT void sk_pop_free(_STACK *sk, void (*free_func)(void *)); - -// sk_insert inserts |p| into the stack at index |where|, moving existing -// elements if needed. It returns the length of the new stack, or zero on -// error. -OPENSSL_EXPORT size_t sk_insert(_STACK *sk, void *p, size_t where); - -// sk_delete removes the pointer at index |where|, moving other elements down -// if needed. It returns the removed pointer, or NULL if |where| is out of -// range. -OPENSSL_EXPORT void *sk_delete(_STACK *sk, size_t where); - -// sk_delete_ptr removes, at most, one instance of |p| from the stack based on -// pointer equality. If an instance of |p| is found then |p| is returned, -// otherwise it returns NULL. -OPENSSL_EXPORT void *sk_delete_ptr(_STACK *sk, void *p); - -// sk_find returns the first value in the stack equal to |p|. If a comparison -// function has been set on the stack, then equality is defined by it and the -// stack will be sorted if need be so that a binary search can be used. -// Otherwise pointer equality is used. If a matching element is found, its -// index is written to |*out_index| (if |out_index| is not NULL) and one is -// returned. Otherwise zero is returned. -OPENSSL_EXPORT int sk_find(_STACK *sk, size_t *out_index, void *p); - -// sk_shift removes and returns the first element in the stack, or returns NULL -// if the stack is empty. -OPENSSL_EXPORT void *sk_shift(_STACK *sk); - -// sk_push appends |p| to the stack and returns the length of the new stack, or -// 0 on allocation failure. -OPENSSL_EXPORT size_t sk_push(_STACK *sk, void *p); - -// sk_pop returns and removes the last element on the stack, or NULL if the -// stack is empty. -OPENSSL_EXPORT void *sk_pop(_STACK *sk); - -// sk_dup performs a shallow copy of a stack and returns the new stack, or NULL -// on error. -OPENSSL_EXPORT _STACK *sk_dup(const _STACK *sk); - -// sk_sort sorts the elements of |sk| into ascending order based on the -// comparison function. The stack maintains a |sorted| flag and sorting an -// already sorted stack is a no-op. -OPENSSL_EXPORT void sk_sort(_STACK *sk); - -// sk_is_sorted returns one if |sk| is known to be sorted and zero -// otherwise. -OPENSSL_EXPORT int sk_is_sorted(const _STACK *sk); - -// sk_set_cmp_func sets the comparison function to be used by |sk| and returns -// the previous one. -OPENSSL_EXPORT stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp); - -// sk_deep_copy performs a copy of |sk| and of each of the non-NULL elements in -// |sk| by using |copy_func|. If an error occurs, |free_func| is used to free -// any copies already made and NULL is returned. -OPENSSL_EXPORT _STACK *sk_deep_copy(const _STACK *sk, - void *(*copy_func)(void *), - void (*free_func)(void *)); - - -// Defining stack types. -// -// This set of macros is used to emit the typed functions that act on a -// |STACK_OF(T)|. - -#if !defined(BORINGSSL_NO_CXX) -extern "C++" { -namespace bssl { -namespace internal { -template -struct StackTraits {}; -} -} -} - -#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) \ - extern "C++" { \ - namespace bssl { \ - namespace internal { \ - template <> \ - struct StackTraits { \ - static constexpr bool kIsStack = true; \ - using Type = type; \ - static constexpr bool kIsConst = is_const; \ - }; \ - } \ - } \ - } - -#else -#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) -#endif - -// Stack functions must be tagged unused to support file-local stack types. -// Clang's -Wunused-function only allows unused static inline functions if they -// are defined in a header. - -#define BORINGSSL_DEFINE_STACK_OF_IMPL(name, ptrtype, constptrtype) \ - DECLARE_STACK_OF(name) \ - \ - typedef int (*stack_##name##_cmp_func)(constptrtype *a, constptrtype *b); \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) * \ - sk_##name##_new(stack_##name##_cmp_func comp) { \ - return (STACK_OF(name) *)sk_new((stack_cmp_func)comp); \ - } \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) *sk_##name##_new_null(void) { \ - return (STACK_OF(name) *)sk_new_null(); \ - } \ - \ - static inline OPENSSL_UNUSED size_t sk_##name##_num( \ - const STACK_OF(name) *sk) { \ - return sk_num((const _STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_zero(STACK_OF(name) *sk) { \ - sk_zero((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_value( \ - const STACK_OF(name) *sk, size_t i) { \ - return (ptrtype)sk_value((const _STACK *)sk, i); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_set(STACK_OF(name) *sk, \ - size_t i, ptrtype p) { \ - return (ptrtype)sk_set((_STACK *)sk, i, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_free(STACK_OF(name) *sk) { \ - sk_free((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_pop_free( \ - STACK_OF(name) *sk, void (*free_func)(ptrtype p)) { \ - sk_pop_free((_STACK *)sk, (void (*)(void *))free_func); \ - } \ - \ - static inline OPENSSL_UNUSED size_t sk_##name##_insert( \ - STACK_OF(name) *sk, ptrtype p, size_t where) { \ - return sk_insert((_STACK *)sk, (void *)p, where); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_delete(STACK_OF(name) *sk, \ - size_t where) { \ - return (ptrtype)sk_delete((_STACK *)sk, where); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_delete_ptr( \ - STACK_OF(name) *sk, ptrtype p) { \ - return (ptrtype)sk_delete_ptr((_STACK *)sk, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED int sk_##name##_find( \ - STACK_OF(name) *sk, size_t *out_index, ptrtype p) { \ - return sk_find((_STACK *)sk, out_index, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_shift(STACK_OF(name) *sk) { \ - return (ptrtype)sk_shift((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED size_t sk_##name##_push(STACK_OF(name) *sk, \ - ptrtype p) { \ - return sk_push((_STACK *)sk, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_pop(STACK_OF(name) *sk) { \ - return (ptrtype)sk_pop((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) * \ - sk_##name##_dup(const STACK_OF(name) *sk) { \ - return (STACK_OF(name) *)sk_dup((const _STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_sort(STACK_OF(name) *sk) { \ - sk_sort((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED int sk_##name##_is_sorted( \ - const STACK_OF(name) *sk) { \ - return sk_is_sorted((const _STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED stack_##name##_cmp_func \ - sk_##name##_set_cmp_func(STACK_OF(name) *sk, \ - stack_##name##_cmp_func comp) { \ - return (stack_##name##_cmp_func)sk_set_cmp_func((_STACK *)sk, \ - (stack_cmp_func)comp); \ - } \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) * \ - sk_##name##_deep_copy(const STACK_OF(name) *sk, \ - ptrtype(*copy_func)(ptrtype), \ - void (*free_func)(ptrtype)) { \ - return (STACK_OF(name) *)sk_deep_copy((const _STACK *)sk, \ - (void *(*)(void *))copy_func, \ - (void (*)(void *))free_func); \ - } - -// DEFINE_STACK_OF defines |STACK_OF(type)| to be a stack whose elements are -// |type| *. -#define DEFINE_STACK_OF(type) \ - BORINGSSL_DEFINE_STACK_OF_IMPL(type, type *, const type *) \ - BORINGSSL_DEFINE_STACK_TRAITS(type, type, false) - -// DEFINE_CONST_STACK_OF defines |STACK_OF(type)| to be a stack whose elements -// are const |type| *. -#define DEFINE_CONST_STACK_OF(type) \ - BORINGSSL_DEFINE_STACK_OF_IMPL(type, const type *, const type *) \ - BORINGSSL_DEFINE_STACK_TRAITS(type, const type, true) - -// DEFINE_SPECIAL_STACK_OF defines |STACK_OF(type)| to be a stack whose elements -// are |type|, where |type| must be a typedef for a pointer. -#define DEFINE_SPECIAL_STACK_OF(type) \ - OPENSSL_COMPILE_ASSERT(sizeof(type) == sizeof(void *), \ - special_stack_of_non_pointer_##type); \ - BORINGSSL_DEFINE_STACK_OF_IMPL(type, type, const type) - - -typedef char *OPENSSL_STRING; - -DEFINE_STACK_OF(void) -DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING) - - -#if defined(__cplusplus) -} // extern C -#endif - -#if !defined(BORINGSSL_NO_CXX) -extern "C++" { - -#include - -namespace bssl { - -namespace internal { - -// Stacks defined with |DEFINE_CONST_STACK_OF| are freed with |sk_free|. -template -struct DeleterImpl< - Stack, typename std::enable_if::kIsConst>::type> { - static void Free(Stack *sk) { sk_free(reinterpret_cast<_STACK *>(sk)); } -}; - -// Stacks defined with |DEFINE_STACK_OF| are freed with |sk_pop_free| and the -// corresponding type's deleter. -template -struct DeleterImpl< - Stack, typename std::enable_if::kIsConst>::type> { - static void Free(Stack *sk) { - sk_pop_free( - reinterpret_cast<_STACK *>(sk), - reinterpret_cast( - DeleterImpl::Type>::Free)); - } -}; - -template -class StackIteratorImpl { - public: - using Type = typename StackTraits::Type; - // Iterators must be default-constructable. - StackIteratorImpl() : sk_(nullptr), idx_(0) {} - StackIteratorImpl(const Stack *sk, size_t idx) : sk_(sk), idx_(idx) {} - - bool operator==(StackIteratorImpl other) const { - return sk_ == other.sk_ && idx_ == other.idx_; - } - bool operator!=(StackIteratorImpl other) const { - return !(*this == other); - } - - Type *operator*() const { - return reinterpret_cast( - sk_value(reinterpret_cast(sk_), idx_)); - } - - StackIteratorImpl &operator++(/* prefix */) { - idx_++; - return *this; - } - - StackIteratorImpl operator++(int /* postfix */) { - StackIteratorImpl copy(*this); - ++(*this); - return copy; - } - - private: - const Stack *sk_; - size_t idx_; -}; - -template -using StackIterator = typename std::enable_if::kIsStack, - StackIteratorImpl>::type; - -} // namespace internal - -// PushToStack pushes |elem| to |sk|. It returns true on success and false on -// allocation failure. -template -static inline - typename std::enable_if::kIsConst, bool>::type - PushToStack(Stack *sk, - UniquePtr::Type> elem) { - if (!sk_push(reinterpret_cast<_STACK *>(sk), elem.get())) { - return false; - } - // sk_push takes ownership on success. - elem.release(); - return true; -} - -} // namespace bssl - -// Define begin() and end() for stack types so C++ range for loops work. -template -static inline bssl::internal::StackIterator begin(const Stack *sk) { - return bssl::internal::StackIterator(sk, 0); -} - -template -static inline bssl::internal::StackIterator end(const Stack *sk) { - return bssl::internal::StackIterator( - sk, sk_num(reinterpret_cast(sk))); -} - -} // extern C++ -#endif - -#endif // OPENSSL_HEADER_STACK_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/stack.h.grpc_back b/Pods/BoringSSL-GRPC/include/openssl/stack.h.grpc_back deleted file mode 100644 index 625f66e43..000000000 --- a/Pods/BoringSSL-GRPC/include/openssl/stack.h.grpc_back +++ /dev/null @@ -1,485 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#ifndef OPENSSL_HEADER_STACK_H -#define OPENSSL_HEADER_STACK_H - -#include - -#include - -#if defined(__cplusplus) -extern "C" { -#endif - - -// A stack, in OpenSSL, is an array of pointers. They are the most commonly -// used collection object. -// -// This file defines macros for type safe use of the stack functions. A stack -// of a specific type of object has type |STACK_OF(type)|. This can be defined -// (once) with |DEFINE_STACK_OF(type)| and declared where needed with -// |DECLARE_STACK_OF(type)|. For example: -// -// typedef struct foo_st { -// int bar; -// } FOO; -// -// DEFINE_STACK_OF(FOO); -// -// Although note that the stack will contain /pointers/ to |FOO|. -// -// A macro will be defined for each of the sk_* functions below. For -// STACK_OF(FOO), the macros would be sk_FOO_new, sk_FOO_pop etc. - - -// stack_cmp_func is a comparison function that returns a value < 0, 0 or > 0 -// if |*a| is less than, equal to or greater than |*b|, respectively. Note the -// extra indirection - the function is given a pointer to a pointer to the -// element. This differs from the usual qsort/bsearch comparison function. -typedef int (*stack_cmp_func)(const void **a, const void **b); - -// stack_st contains an array of pointers. It is not designed to be used -// directly, rather the wrapper macros should be used. -typedef struct stack_st { - // num contains the number of valid pointers in |data|. - size_t num; - void **data; - // sorted is non-zero if the values pointed to by |data| are in ascending - // order, based on |comp|. - int sorted; - // num_alloc contains the number of pointers allocated in the buffer pointed - // to by |data|, which may be larger than |num|. - size_t num_alloc; - // comp is an optional comparison function. - stack_cmp_func comp; -} _STACK; - - -#define STACK_OF(type) struct stack_st_##type - -#define DECLARE_STACK_OF(type) STACK_OF(type); - -// These are the raw stack functions, you shouldn't be using them. Rather you -// should be using the type stack macros implemented above. - -// sk_new creates a new, empty stack with the given comparison function, which -// may be zero. It returns the new stack or NULL on allocation failure. -OPENSSL_EXPORT _STACK *sk_new(stack_cmp_func comp); - -// sk_new_null creates a new, empty stack. It returns the new stack or NULL on -// allocation failure. -OPENSSL_EXPORT _STACK *sk_new_null(void); - -// sk_num returns the number of elements in |s|. -OPENSSL_EXPORT size_t sk_num(const _STACK *sk); - -// sk_zero resets |sk| to the empty state but does nothing to free the -// individual elements themselves. -OPENSSL_EXPORT void sk_zero(_STACK *sk); - -// sk_value returns the |i|th pointer in |sk|, or NULL if |i| is out of -// range. -OPENSSL_EXPORT void *sk_value(const _STACK *sk, size_t i); - -// sk_set sets the |i|th pointer in |sk| to |p| and returns |p|. If |i| is out -// of range, it returns NULL. -OPENSSL_EXPORT void *sk_set(_STACK *sk, size_t i, void *p); - -// sk_free frees the given stack and array of pointers, but does nothing to -// free the individual elements. Also see |sk_pop_free|. -OPENSSL_EXPORT void sk_free(_STACK *sk); - -// sk_pop_free calls |free_func| on each element in the stack and then frees -// the stack itself. -OPENSSL_EXPORT void sk_pop_free(_STACK *sk, void (*free_func)(void *)); - -// sk_insert inserts |p| into the stack at index |where|, moving existing -// elements if needed. It returns the length of the new stack, or zero on -// error. -OPENSSL_EXPORT size_t sk_insert(_STACK *sk, void *p, size_t where); - -// sk_delete removes the pointer at index |where|, moving other elements down -// if needed. It returns the removed pointer, or NULL if |where| is out of -// range. -OPENSSL_EXPORT void *sk_delete(_STACK *sk, size_t where); - -// sk_delete_ptr removes, at most, one instance of |p| from the stack based on -// pointer equality. If an instance of |p| is found then |p| is returned, -// otherwise it returns NULL. -OPENSSL_EXPORT void *sk_delete_ptr(_STACK *sk, void *p); - -// sk_find returns the first value in the stack equal to |p|. If a comparison -// function has been set on the stack, then equality is defined by it and the -// stack will be sorted if need be so that a binary search can be used. -// Otherwise pointer equality is used. If a matching element is found, its -// index is written to |*out_index| (if |out_index| is not NULL) and one is -// returned. Otherwise zero is returned. -OPENSSL_EXPORT int sk_find(_STACK *sk, size_t *out_index, void *p); - -// sk_shift removes and returns the first element in the stack, or returns NULL -// if the stack is empty. -OPENSSL_EXPORT void *sk_shift(_STACK *sk); - -// sk_push appends |p| to the stack and returns the length of the new stack, or -// 0 on allocation failure. -OPENSSL_EXPORT size_t sk_push(_STACK *sk, void *p); - -// sk_pop returns and removes the last element on the stack, or NULL if the -// stack is empty. -OPENSSL_EXPORT void *sk_pop(_STACK *sk); - -// sk_dup performs a shallow copy of a stack and returns the new stack, or NULL -// on error. -OPENSSL_EXPORT _STACK *sk_dup(const _STACK *sk); - -// sk_sort sorts the elements of |sk| into ascending order based on the -// comparison function. The stack maintains a |sorted| flag and sorting an -// already sorted stack is a no-op. -OPENSSL_EXPORT void sk_sort(_STACK *sk); - -// sk_is_sorted returns one if |sk| is known to be sorted and zero -// otherwise. -OPENSSL_EXPORT int sk_is_sorted(const _STACK *sk); - -// sk_set_cmp_func sets the comparison function to be used by |sk| and returns -// the previous one. -OPENSSL_EXPORT stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp); - -// sk_deep_copy performs a copy of |sk| and of each of the non-NULL elements in -// |sk| by using |copy_func|. If an error occurs, |free_func| is used to free -// any copies already made and NULL is returned. -OPENSSL_EXPORT _STACK *sk_deep_copy(const _STACK *sk, - void *(*copy_func)(void *), - void (*free_func)(void *)); - - -// Defining stack types. -// -// This set of macros is used to emit the typed functions that act on a -// |STACK_OF(T)|. - -#if !defined(BORINGSSL_NO_CXX) -extern "C++" { -namespace bssl { -namespace internal { -template -struct StackTraits {}; -} -} -} - -#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) \ - extern "C++" { \ - namespace bssl { \ - namespace internal { \ - template <> \ - struct StackTraits { \ - static constexpr bool kIsStack = true; \ - using Type = type; \ - static constexpr bool kIsConst = is_const; \ - }; \ - } \ - } \ - } - -#else -#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) -#endif - -// Stack functions must be tagged unused to support file-local stack types. -// Clang's -Wunused-function only allows unused static inline functions if they -// are defined in a header. - -#define BORINGSSL_DEFINE_STACK_OF_IMPL(name, ptrtype, constptrtype) \ - DECLARE_STACK_OF(name) \ - \ - typedef int (*stack_##name##_cmp_func)(constptrtype *a, constptrtype *b); \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) * \ - sk_##name##_new(stack_##name##_cmp_func comp) { \ - return (STACK_OF(name) *)sk_new((stack_cmp_func)comp); \ - } \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) *sk_##name##_new_null(void) { \ - return (STACK_OF(name) *)sk_new_null(); \ - } \ - \ - static inline OPENSSL_UNUSED size_t sk_##name##_num( \ - const STACK_OF(name) *sk) { \ - return sk_num((const _STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_zero(STACK_OF(name) *sk) { \ - sk_zero((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_value( \ - const STACK_OF(name) *sk, size_t i) { \ - return (ptrtype)sk_value((const _STACK *)sk, i); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_set(STACK_OF(name) *sk, \ - size_t i, ptrtype p) { \ - return (ptrtype)sk_set((_STACK *)sk, i, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_free(STACK_OF(name) *sk) { \ - sk_free((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_pop_free( \ - STACK_OF(name) *sk, void (*free_func)(ptrtype p)) { \ - sk_pop_free((_STACK *)sk, (void (*)(void *))free_func); \ - } \ - \ - static inline OPENSSL_UNUSED size_t sk_##name##_insert( \ - STACK_OF(name) *sk, ptrtype p, size_t where) { \ - return sk_insert((_STACK *)sk, (void *)p, where); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_delete(STACK_OF(name) *sk, \ - size_t where) { \ - return (ptrtype)sk_delete((_STACK *)sk, where); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_delete_ptr( \ - STACK_OF(name) *sk, ptrtype p) { \ - return (ptrtype)sk_delete_ptr((_STACK *)sk, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED int sk_##name##_find( \ - STACK_OF(name) *sk, size_t *out_index, ptrtype p) { \ - return sk_find((_STACK *)sk, out_index, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_shift(STACK_OF(name) *sk) { \ - return (ptrtype)sk_shift((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED size_t sk_##name##_push(STACK_OF(name) *sk, \ - ptrtype p) { \ - return sk_push((_STACK *)sk, (void *)p); \ - } \ - \ - static inline OPENSSL_UNUSED ptrtype sk_##name##_pop(STACK_OF(name) *sk) { \ - return (ptrtype)sk_pop((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) * \ - sk_##name##_dup(const STACK_OF(name) *sk) { \ - return (STACK_OF(name) *)sk_dup((const _STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED void sk_##name##_sort(STACK_OF(name) *sk) { \ - sk_sort((_STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED int sk_##name##_is_sorted( \ - const STACK_OF(name) *sk) { \ - return sk_is_sorted((const _STACK *)sk); \ - } \ - \ - static inline OPENSSL_UNUSED stack_##name##_cmp_func \ - sk_##name##_set_cmp_func(STACK_OF(name) *sk, \ - stack_##name##_cmp_func comp) { \ - return (stack_##name##_cmp_func)sk_set_cmp_func((_STACK *)sk, \ - (stack_cmp_func)comp); \ - } \ - \ - static inline OPENSSL_UNUSED STACK_OF(name) * \ - sk_##name##_deep_copy(const STACK_OF(name) *sk, \ - ptrtype(*copy_func)(ptrtype), \ - void (*free_func)(ptrtype)) { \ - return (STACK_OF(name) *)sk_deep_copy((const _STACK *)sk, \ - (void *(*)(void *))copy_func, \ - (void (*)(void *))free_func); \ - } - -// DEFINE_STACK_OF defines |STACK_OF(type)| to be a stack whose elements are -// |type| *. -#define DEFINE_STACK_OF(type) \ - BORINGSSL_DEFINE_STACK_OF_IMPL(type, type *, const type *) \ - BORINGSSL_DEFINE_STACK_TRAITS(type, type, false) - -// DEFINE_CONST_STACK_OF defines |STACK_OF(type)| to be a stack whose elements -// are const |type| *. -#define DEFINE_CONST_STACK_OF(type) \ - BORINGSSL_DEFINE_STACK_OF_IMPL(type, const type *, const type *) \ - BORINGSSL_DEFINE_STACK_TRAITS(type, const type, true) - -// DEFINE_SPECIAL_STACK_OF defines |STACK_OF(type)| to be a stack whose elements -// are |type|, where |type| must be a typedef for a pointer. -#define DEFINE_SPECIAL_STACK_OF(type) \ - OPENSSL_COMPILE_ASSERT(sizeof(type) == sizeof(void *), \ - special_stack_of_non_pointer_##type); \ - BORINGSSL_DEFINE_STACK_OF_IMPL(type, type, const type) - - -typedef char *OPENSSL_STRING; - -DEFINE_STACK_OF(void) -DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING) - - -#if defined(__cplusplus) -} // extern C -#endif - -#if !defined(BORINGSSL_NO_CXX) -extern "C++" { - -#include - -namespace bssl { - -namespace internal { - -// Stacks defined with |DEFINE_CONST_STACK_OF| are freed with |sk_free|. -template -struct DeleterImpl< - Stack, typename std::enable_if::kIsConst>::type> { - static void Free(Stack *sk) { sk_free(reinterpret_cast<_STACK *>(sk)); } -}; - -// Stacks defined with |DEFINE_STACK_OF| are freed with |sk_pop_free| and the -// corresponding type's deleter. -template -struct DeleterImpl< - Stack, typename std::enable_if::kIsConst>::type> { - static void Free(Stack *sk) { - sk_pop_free( - reinterpret_cast<_STACK *>(sk), - reinterpret_cast( - DeleterImpl::Type>::Free)); - } -}; - -template -class StackIteratorImpl { - public: - using Type = typename StackTraits::Type; - // Iterators must be default-constructable. - StackIteratorImpl() : sk_(nullptr), idx_(0) {} - StackIteratorImpl(const Stack *sk, size_t idx) : sk_(sk), idx_(idx) {} - - bool operator==(StackIteratorImpl other) const { - return sk_ == other.sk_ && idx_ == other.idx_; - } - bool operator!=(StackIteratorImpl other) const { - return !(*this == other); - } - - Type *operator*() const { - return reinterpret_cast( - sk_value(reinterpret_cast(sk_), idx_)); - } - - StackIteratorImpl &operator++(/* prefix */) { - idx_++; - return *this; - } - - StackIteratorImpl operator++(int /* postfix */) { - StackIteratorImpl copy(*this); - ++(*this); - return copy; - } - - private: - const Stack *sk_; - size_t idx_; -}; - -template -using StackIterator = typename std::enable_if::kIsStack, - StackIteratorImpl>::type; - -} // namespace internal - -// PushToStack pushes |elem| to |sk|. It returns true on success and false on -// allocation failure. -template -static inline - typename std::enable_if::kIsConst, bool>::type - PushToStack(Stack *sk, - UniquePtr::Type> elem) { - if (!sk_push(reinterpret_cast<_STACK *>(sk), elem.get())) { - return false; - } - // sk_push takes ownership on success. - elem.release(); - return true; -} - -} // namespace bssl - -// Define begin() and end() for stack types so C++ range for loops work. -template -static inline bssl::internal::StackIterator begin(const Stack *sk) { - return bssl::internal::StackIterator(sk, 0); -} - -template -static inline bssl::internal::StackIterator end(const Stack *sk) { - return bssl::internal::StackIterator( - sk, sk_num(reinterpret_cast(sk))); -} - -} // extern C++ -#endif - -#endif // OPENSSL_HEADER_STACK_H diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_bitstr.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_bitstr.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_bitstr.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_bitstr.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_bitstr.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_bool.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_bool.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c index 645c03495..0786c1a0a 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_bool.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c @@ -62,17 +62,30 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) { int r; - unsigned char *p; + unsigned char *p, *allocated = NULL; r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); if (pp == NULL) return (r); - p = *pp; + + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(r)) == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } ASN1_put_object(&p, 0, 1, V_ASN1_BOOLEAN, V_ASN1_UNIVERSAL); - *(p++) = (unsigned char)a; - *pp = p; - return (r); + *p = (unsigned char)a; + + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + 1; + return r; } int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length) diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_bool.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_bool.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c.grpc_back index 64a079ec4..34bbd1551 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_bool.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_bool.c.grpc_back @@ -62,17 +62,30 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp) { int r; - unsigned char *p; + unsigned char *p, *allocated = NULL; r = ASN1_object_size(0, 1, V_ASN1_BOOLEAN); if (pp == NULL) return (r); - p = *pp; + + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(r)) == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } ASN1_put_object(&p, 0, 1, V_ASN1_BOOLEAN, V_ASN1_UNIVERSAL); - *(p++) = (unsigned char)a; - *pp = p; - return (r); + *p = (unsigned char)a; + + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + 1; + return r; } int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length) diff --git a/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c new file mode 100644 index 000000000..6a78bb5d9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c @@ -0,0 +1,93 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include + +#include +#include +#include + + +void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x) +{ + uint8_t *data; + size_t len; + // Historically, this function did not impose a limit in OpenSSL and is used + // to read CRLs, so we leave this without an external bound. + if (!BIO_read_asn1(in, &data, &len, INT_MAX)) { + return NULL; + } + const uint8_t *ptr = data; + void *ret = ASN1_item_d2i(x, &ptr, len, it); + OPENSSL_free(data); + return ret; +} + +#ifndef OPENSSL_NO_FP_API +void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x) +{ + BIO *b = BIO_new_fp(in, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); + return NULL; + } + void *ret = ASN1_item_d2i_bio(it, b, x); + BIO_free(b); + return ret; +} +#endif diff --git a/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c.grpc_back new file mode 100644 index 000000000..fd423e276 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_d2i_fp.c.grpc_back @@ -0,0 +1,93 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include + +#include +#include +#include + + +void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x) +{ + uint8_t *data; + size_t len; + // Historically, this function did not impose a limit in OpenSSL and is used + // to read CRLs, so we leave this without an external bound. + if (!BIO_read_asn1(in, &data, &len, INT_MAX)) { + return NULL; + } + const uint8_t *ptr = data; + void *ret = ASN1_item_d2i(x, &ptr, len, it); + OPENSSL_free(data); + return ret; +} + +#ifndef OPENSSL_NO_FP_API +void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x) +{ + BIO *b = BIO_new_fp(in, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); + return NULL; + } + void *ret = ASN1_item_d2i_bio(it, b, x); + BIO_free(b); + return ret; +} +#endif diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_dup.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_dup.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c index 272979cea..838ee9e34 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_dup.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c @@ -59,30 +59,6 @@ #include #include -void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) -{ - unsigned char *b, *p; - const unsigned char *p2; - int i; - char *ret; - - if (x == NULL) - return (NULL); - - i = i2d(x, NULL); - b = OPENSSL_malloc(i + 10); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return (NULL); - } - p = b; - i = i2d(x, &p); - p2 = b; - ret = d2i(NULL, &p2, i); - OPENSSL_free(b); - return (ret); -} - /* * ASN1_ITEM version of dup: this follows the model above except we don't * need to allocate the buffer. At some point this could be rewritten to diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_dup.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_dup.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c.grpc_back index 57394f58c..9ede85117 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_dup.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_dup.c.grpc_back @@ -59,30 +59,6 @@ #include #include -void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x) -{ - unsigned char *b, *p; - const unsigned char *p2; - int i; - char *ret; - - if (x == NULL) - return (NULL); - - i = i2d(x, NULL); - b = OPENSSL_malloc(i + 10); - if (b == NULL) { - OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); - return (NULL); - } - p = b; - i = i2d(x, &p); - p2 = b; - ret = d2i(NULL, &p2, i); - OPENSSL_free(b); - return (ret); -} - /* * ASN1_ITEM version of dup: this follows the model above except we don't * need to allocate the buffer. At some point this could be rewritten to diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_enum.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_enum.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c index 5e1fc7af2..97fdf0f23 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_enum.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c @@ -120,8 +120,8 @@ long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) else if (i != V_ASN1_ENUMERATED) return -1; - OPENSSL_COMPILE_ASSERT(sizeof(uint64_t) >= sizeof(long), - long_larger_than_uint64_t); + OPENSSL_STATIC_ASSERT(sizeof(uint64_t) >= sizeof(long), + "long larger than uint64_t"); if (a->length > (int)sizeof(uint64_t)) { /* hmm... a bit ugly */ diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_enum.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_enum.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c.grpc_back index 4a779718c..11e60ac39 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_enum.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_enum.c.grpc_back @@ -120,8 +120,8 @@ long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a) else if (i != V_ASN1_ENUMERATED) return -1; - OPENSSL_COMPILE_ASSERT(sizeof(uint64_t) >= sizeof(long), - long_larger_than_uint64_t); + OPENSSL_STATIC_ASSERT(sizeof(uint64_t) >= sizeof(long), + "long larger than uint64_t"); if (a->length > (int)sizeof(uint64_t)) { /* hmm... a bit ugly */ diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_gentm.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_gentm.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_gentm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_gentm.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_gentm.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c new file mode 100644 index 000000000..8af01a3ee --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c @@ -0,0 +1,88 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include +#include + + +int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) +{ + BIO *b = BIO_new_fp(out, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); + return 0; + } + int ret = ASN1_item_i2d_bio(it, b, x); + BIO_free(b); + return ret; +} + +int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) +{ + unsigned char *b = NULL; + int n = ASN1_item_i2d(x, &b, it); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = BIO_write_all(out, b, n); + OPENSSL_free(b); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c.grpc_back new file mode 100644 index 000000000..db0d81228 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_i2d_fp.c.grpc_back @@ -0,0 +1,88 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include +#include + + +int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x) +{ + BIO *b = BIO_new_fp(out, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_BUF_LIB); + return 0; + } + int ret = ASN1_item_i2d_bio(it, b, x); + BIO_free(b); + return ret; +} + +int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x) +{ + unsigned char *b = NULL; + int n = ASN1_item_i2d(x, &b, it); + if (b == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + + int ret = BIO_write_all(out, b, n); + OPENSSL_free(b); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_int.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_int.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c index f467071a5..f652250e8 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_int.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c @@ -195,6 +195,16 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, unsigned char *to, *s; int i; + /* + * This function can handle lengths up to INT_MAX - 1, but the rest of the + * legacy ASN.1 code mixes integer types, so avoid exposing it to + * ASN1_INTEGERS with larger lengths. + */ + if (len < 0 || len > INT_MAX / 2) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); + return NULL; + } + if ((a == NULL) || ((*a) == NULL)) { if ((ret = M_ASN1_INTEGER_new()) == NULL) return (NULL); @@ -276,75 +286,6 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, return (NULL); } -/* - * This is a version of d2i_ASN1_INTEGER that ignores the sign bit of ASN1 - * integers: some broken software can encode a positive INTEGER with its MSB - * set as negative (it doesn't add a padding zero). - */ - -ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, - long length) -{ - ASN1_INTEGER *ret = NULL; - const unsigned char *p; - unsigned char *s; - long len; - int inf, tag, xclass; - int i; - - if ((a == NULL) || ((*a) == NULL)) { - if ((ret = M_ASN1_INTEGER_new()) == NULL) - return (NULL); - ret->type = V_ASN1_INTEGER; - } else - ret = (*a); - - p = *pp; - inf = ASN1_get_object(&p, &len, &tag, &xclass, length); - if (inf & 0x80) { - i = ASN1_R_BAD_OBJECT_HEADER; - goto err; - } - - if (tag != V_ASN1_INTEGER) { - i = ASN1_R_EXPECTING_AN_INTEGER; - goto err; - } - - /* - * We must OPENSSL_malloc stuff, even for 0 bytes otherwise it signifies - * a missing NULL parameter. - */ - s = (unsigned char *)OPENSSL_malloc((int)len + 1); - if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; - goto err; - } - ret->type = V_ASN1_INTEGER; - if (len) { - if ((*p == 0) && (len != 1)) { - p++; - len--; - } - OPENSSL_memcpy(s, p, (int)len); - p += len; - } - - if (ret->data != NULL) - OPENSSL_free(ret->data); - ret->data = s; - ret->length = (int)len; - if (a != NULL) - (*a) = ret; - *pp = p; - return (ret); - err: - OPENSSL_PUT_ERROR(ASN1, i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) - M_ASN1_INTEGER_free(ret); - return (NULL); -} - int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) { if (v >= 0) { @@ -400,8 +341,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a) else if (i != V_ASN1_INTEGER) return -1; - OPENSSL_COMPILE_ASSERT(sizeof(uint64_t) >= sizeof(long), - long_larger_than_uint64_t); + OPENSSL_STATIC_ASSERT(sizeof(uint64_t) >= sizeof(long), + "long larger than uint64_t"); if (a->length > (int)sizeof(uint64_t)) { /* hmm... a bit ugly, return all ones */ diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_int.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c.grpc_back similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_int.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c.grpc_back index dd74550be..7b483f2d4 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_int.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_int.c.grpc_back @@ -195,6 +195,16 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, unsigned char *to, *s; int i; + /* + * This function can handle lengths up to INT_MAX - 1, but the rest of the + * legacy ASN.1 code mixes integer types, so avoid exposing it to + * ASN1_INTEGERS with larger lengths. + */ + if (len < 0 || len > INT_MAX / 2) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); + return NULL; + } + if ((a == NULL) || ((*a) == NULL)) { if ((ret = M_ASN1_INTEGER_new()) == NULL) return (NULL); @@ -276,75 +286,6 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, return (NULL); } -/* - * This is a version of d2i_ASN1_INTEGER that ignores the sign bit of ASN1 - * integers: some broken software can encode a positive INTEGER with its MSB - * set as negative (it doesn't add a padding zero). - */ - -ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, - long length) -{ - ASN1_INTEGER *ret = NULL; - const unsigned char *p; - unsigned char *s; - long len; - int inf, tag, xclass; - int i; - - if ((a == NULL) || ((*a) == NULL)) { - if ((ret = M_ASN1_INTEGER_new()) == NULL) - return (NULL); - ret->type = V_ASN1_INTEGER; - } else - ret = (*a); - - p = *pp; - inf = ASN1_get_object(&p, &len, &tag, &xclass, length); - if (inf & 0x80) { - i = ASN1_R_BAD_OBJECT_HEADER; - goto err; - } - - if (tag != V_ASN1_INTEGER) { - i = ASN1_R_EXPECTING_AN_INTEGER; - goto err; - } - - /* - * We must OPENSSL_malloc stuff, even for 0 bytes otherwise it signifies - * a missing NULL parameter. - */ - s = (unsigned char *)OPENSSL_malloc((int)len + 1); - if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; - goto err; - } - ret->type = V_ASN1_INTEGER; - if (len) { - if ((*p == 0) && (len != 1)) { - p++; - len--; - } - OPENSSL_memcpy(s, p, (int)len); - p += len; - } - - if (ret->data != NULL) - OPENSSL_free(ret->data); - ret->data = s; - ret->length = (int)len; - if (a != NULL) - (*a) = ret; - *pp = p; - return (ret); - err: - OPENSSL_PUT_ERROR(ASN1, i); - if ((ret != NULL) && ((a == NULL) || (*a != ret))) - M_ASN1_INTEGER_free(ret); - return (NULL); -} - int ASN1_INTEGER_set(ASN1_INTEGER *a, long v) { if (v >= 0) { @@ -400,8 +341,8 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a) else if (i != V_ASN1_INTEGER) return -1; - OPENSSL_COMPILE_ASSERT(sizeof(uint64_t) >= sizeof(long), - long_larger_than_uint64_t); + OPENSSL_STATIC_ASSERT(sizeof(uint64_t) >= sizeof(long), + "long larger than uint64_t"); if (a->length > (int)sizeof(uint64_t)) { /* hmm... a bit ugly, return all ones */ diff --git a/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c new file mode 100644 index 000000000..3eef4374f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c @@ -0,0 +1,305 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include + +#include +#include +#include + +#include "asn1_locl.h" +#include "../bytestring/internal.h" + +static int is_printable(uint32_t value); + +/* + * These functions take a string in UTF8, ASCII or multibyte form and a mask + * of permissible ASN1 string types. It then works out the minimal type + * (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and + * creates a string of the correct type with the supplied data. Yes this is + * horrible: it has to be :-( The 'ncopy' form checks minimum and maximum + * size limits too. + */ + +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask) +{ + return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); +} + +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_BMPSTRING) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_UNIVERSALSTRING) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_UTF8STRING) + +int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask, + long minsize, long maxsize) +{ + int str_type; + char free_out; + ASN1_STRING *dest; + size_t nchar = 0; + char strbuf[32]; + if (len == -1) + len = strlen((const char *)in); + if (!mask) + mask = DIRSTRING_TYPE; + + int (*decode_func)(CBS *, uint32_t*); + int error; + switch (inform) { + case MBSTRING_BMP: + decode_func = cbs_get_ucs2_be; + error = ASN1_R_INVALID_BMPSTRING; + break; + + case MBSTRING_UNIV: + decode_func = cbs_get_utf32_be; + error = ASN1_R_INVALID_UNIVERSALSTRING; + break; + + case MBSTRING_UTF8: + decode_func = cbs_get_utf8; + error = ASN1_R_INVALID_UTF8STRING; + break; + + case MBSTRING_ASC: + decode_func = cbs_get_latin1; + error = ERR_R_INTERNAL_ERROR; // Latin-1 inputs are never invalid. + break; + + default: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); + return -1; + } + + /* Check |minsize| and |maxsize| and work out the minimal type, if any. */ + CBS cbs; + CBS_init(&cbs, in, len); + size_t utf8_len = 0; + while (CBS_len(&cbs) != 0) { + uint32_t c; + if (!decode_func(&cbs, &c)) { + OPENSSL_PUT_ERROR(ASN1, error); + return -1; + } + if (nchar == 0 && + (inform == MBSTRING_BMP || inform == MBSTRING_UNIV) && + c == 0xfeff) { + /* Reject byte-order mark. We could drop it but that would mean + * adding ambiguity around whether a BOM was included or not when + * matching strings. + * + * For a little-endian UCS-2 string, the BOM will appear as 0xfffe + * and will be rejected as noncharacter, below. */ + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS); + return -1; + } + + /* Update which output formats are still possible. */ + if ((mask & B_ASN1_PRINTABLESTRING) && !is_printable(c)) { + mask &= ~B_ASN1_PRINTABLESTRING; + } + if ((mask & B_ASN1_IA5STRING) && (c > 127)) { + mask &= ~B_ASN1_IA5STRING; + } + if ((mask & B_ASN1_T61STRING) && (c > 0xff)) { + mask &= ~B_ASN1_T61STRING; + } + if ((mask & B_ASN1_BMPSTRING) && (c > 0xffff)) { + mask &= ~B_ASN1_BMPSTRING; + } + if (!mask) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS); + return -1; + } + + nchar++; + utf8_len += cbb_get_utf8_len(c); + } + + if (minsize > 0 && nchar < (size_t)minsize) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT); + BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize); + ERR_add_error_data(2, "minsize=", strbuf); + return -1; + } + + if (maxsize > 0 && nchar > (size_t)maxsize) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG); + BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize); + ERR_add_error_data(2, "maxsize=", strbuf); + return -1; + } + + /* Now work out output format and string type */ + int (*encode_func)(CBB *, uint32_t) = cbb_add_latin1; + size_t size_estimate = nchar; + int outform = MBSTRING_ASC; + if (mask & B_ASN1_PRINTABLESTRING) { + str_type = V_ASN1_PRINTABLESTRING; + } else if (mask & B_ASN1_IA5STRING) { + str_type = V_ASN1_IA5STRING; + } else if (mask & B_ASN1_T61STRING) { + str_type = V_ASN1_T61STRING; + } else if (mask & B_ASN1_BMPSTRING) { + str_type = V_ASN1_BMPSTRING; + outform = MBSTRING_BMP; + encode_func = cbb_add_ucs2_be; + size_estimate = 2 * nchar; + } else if (mask & B_ASN1_UNIVERSALSTRING) { + str_type = V_ASN1_UNIVERSALSTRING; + encode_func = cbb_add_utf32_be; + size_estimate = 4 * nchar; + outform = MBSTRING_UNIV; + } else { + str_type = V_ASN1_UTF8STRING; + outform = MBSTRING_UTF8; + encode_func = cbb_add_utf8; + size_estimate = utf8_len; + } + + if (!out) + return str_type; + if (*out) { + free_out = 0; + dest = *out; + if (dest->data) { + dest->length = 0; + OPENSSL_free(dest->data); + dest->data = NULL; + } + dest->type = str_type; + } else { + free_out = 1; + dest = ASN1_STRING_type_new(str_type); + if (!dest) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return -1; + } + *out = dest; + } + + /* If both the same type just copy across */ + if (inform == outform) { + if (!ASN1_STRING_set(dest, in, len)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return -1; + } + return str_type; + } + + CBB cbb; + if (!CBB_init(&cbb, size_estimate + 1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + CBS_init(&cbs, in, len); + while (CBS_len(&cbs) != 0) { + uint32_t c; + if (!decode_func(&cbs, &c) || + !encode_func(&cbb, c)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR); + goto err; + } + } + uint8_t *data = NULL; + size_t data_len; + if (/* OpenSSL historically NUL-terminated this value with a single byte, + * even for |MBSTRING_BMP| and |MBSTRING_UNIV|. */ + !CBB_add_u8(&cbb, 0) || + !CBB_finish(&cbb, &data, &data_len) || + data_len < 1 || + data_len > INT_MAX) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR); + OPENSSL_free(data); + goto err; + } + dest->length = (int)(data_len - 1); + dest->data = data; + return str_type; + + err: + if (free_out) + ASN1_STRING_free(dest); + CBB_cleanup(&cbb); + return -1; +} + +/* Return 1 if the character is permitted in a PrintableString */ +static int is_printable(uint32_t value) +{ + int ch; + if (value > 0x7f) + return 0; + ch = (int)value; + /* + * Note: we can't use 'isalnum' because certain accented characters may + * count as alphanumeric in some environments. + */ + if ((ch >= 'a') && (ch <= 'z')) + return 1; + if ((ch >= 'A') && (ch <= 'Z')) + return 1; + if ((ch >= '0') && (ch <= '9')) + return 1; + if ((ch == ' ') || strchr("'()+,-./:=?", ch)) + return 1; + return 0; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c.grpc_back new file mode 100644 index 000000000..1bbcd1bc5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_mbstr.c.grpc_back @@ -0,0 +1,305 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include + +#include +#include +#include + +#include "asn1_locl.h" +#include "../bytestring/internal.h" + +static int is_printable(uint32_t value); + +/* + * These functions take a string in UTF8, ASCII or multibyte form and a mask + * of permissible ASN1 string types. It then works out the minimal type + * (using the order Printable < IA5 < T61 < BMP < Universal < UTF8) and + * creates a string of the correct type with the supplied data. Yes this is + * horrible: it has to be :-( The 'ncopy' form checks minimum and maximum + * size limits too. + */ + +int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask) +{ + return ASN1_mbstring_ncopy(out, in, len, inform, mask, 0, 0); +} + +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_BMPSTRING) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_UNIVERSALSTRING) +OPENSSL_DECLARE_ERROR_REASON(ASN1, INVALID_UTF8STRING) + +int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, + int inform, unsigned long mask, + long minsize, long maxsize) +{ + int str_type; + char free_out; + ASN1_STRING *dest; + size_t nchar = 0; + char strbuf[32]; + if (len == -1) + len = strlen((const char *)in); + if (!mask) + mask = DIRSTRING_TYPE; + + int (*decode_func)(CBS *, uint32_t*); + int error; + switch (inform) { + case MBSTRING_BMP: + decode_func = cbs_get_ucs2_be; + error = ASN1_R_INVALID_BMPSTRING; + break; + + case MBSTRING_UNIV: + decode_func = cbs_get_utf32_be; + error = ASN1_R_INVALID_UNIVERSALSTRING; + break; + + case MBSTRING_UTF8: + decode_func = cbs_get_utf8; + error = ASN1_R_INVALID_UTF8STRING; + break; + + case MBSTRING_ASC: + decode_func = cbs_get_latin1; + error = ERR_R_INTERNAL_ERROR; // Latin-1 inputs are never invalid. + break; + + default: + OPENSSL_PUT_ERROR(ASN1, ASN1_R_UNKNOWN_FORMAT); + return -1; + } + + /* Check |minsize| and |maxsize| and work out the minimal type, if any. */ + CBS cbs; + CBS_init(&cbs, in, len); + size_t utf8_len = 0; + while (CBS_len(&cbs) != 0) { + uint32_t c; + if (!decode_func(&cbs, &c)) { + OPENSSL_PUT_ERROR(ASN1, error); + return -1; + } + if (nchar == 0 && + (inform == MBSTRING_BMP || inform == MBSTRING_UNIV) && + c == 0xfeff) { + /* Reject byte-order mark. We could drop it but that would mean + * adding ambiguity around whether a BOM was included or not when + * matching strings. + * + * For a little-endian UCS-2 string, the BOM will appear as 0xfffe + * and will be rejected as noncharacter, below. */ + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS); + return -1; + } + + /* Update which output formats are still possible. */ + if ((mask & B_ASN1_PRINTABLESTRING) && !is_printable(c)) { + mask &= ~B_ASN1_PRINTABLESTRING; + } + if ((mask & B_ASN1_IA5STRING) && (c > 127)) { + mask &= ~B_ASN1_IA5STRING; + } + if ((mask & B_ASN1_T61STRING) && (c > 0xff)) { + mask &= ~B_ASN1_T61STRING; + } + if ((mask & B_ASN1_BMPSTRING) && (c > 0xffff)) { + mask &= ~B_ASN1_BMPSTRING; + } + if (!mask) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_CHARACTERS); + return -1; + } + + nchar++; + utf8_len += cbb_get_utf8_len(c); + } + + if (minsize > 0 && nchar < (size_t)minsize) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_SHORT); + BIO_snprintf(strbuf, sizeof strbuf, "%ld", minsize); + ERR_add_error_data(2, "minsize=", strbuf); + return -1; + } + + if (maxsize > 0 && nchar > (size_t)maxsize) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_STRING_TOO_LONG); + BIO_snprintf(strbuf, sizeof strbuf, "%ld", maxsize); + ERR_add_error_data(2, "maxsize=", strbuf); + return -1; + } + + /* Now work out output format and string type */ + int (*encode_func)(CBB *, uint32_t) = cbb_add_latin1; + size_t size_estimate = nchar; + int outform = MBSTRING_ASC; + if (mask & B_ASN1_PRINTABLESTRING) { + str_type = V_ASN1_PRINTABLESTRING; + } else if (mask & B_ASN1_IA5STRING) { + str_type = V_ASN1_IA5STRING; + } else if (mask & B_ASN1_T61STRING) { + str_type = V_ASN1_T61STRING; + } else if (mask & B_ASN1_BMPSTRING) { + str_type = V_ASN1_BMPSTRING; + outform = MBSTRING_BMP; + encode_func = cbb_add_ucs2_be; + size_estimate = 2 * nchar; + } else if (mask & B_ASN1_UNIVERSALSTRING) { + str_type = V_ASN1_UNIVERSALSTRING; + encode_func = cbb_add_utf32_be; + size_estimate = 4 * nchar; + outform = MBSTRING_UNIV; + } else { + str_type = V_ASN1_UTF8STRING; + outform = MBSTRING_UTF8; + encode_func = cbb_add_utf8; + size_estimate = utf8_len; + } + + if (!out) + return str_type; + if (*out) { + free_out = 0; + dest = *out; + if (dest->data) { + dest->length = 0; + OPENSSL_free(dest->data); + dest->data = NULL; + } + dest->type = str_type; + } else { + free_out = 1; + dest = ASN1_STRING_type_new(str_type); + if (!dest) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return -1; + } + *out = dest; + } + + /* If both the same type just copy across */ + if (inform == outform) { + if (!ASN1_STRING_set(dest, in, len)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return -1; + } + return str_type; + } + + CBB cbb; + if (!CBB_init(&cbb, size_estimate + 1)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + goto err; + } + CBS_init(&cbs, in, len); + while (CBS_len(&cbs) != 0) { + uint32_t c; + if (!decode_func(&cbs, &c) || + !encode_func(&cbb, c)) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR); + goto err; + } + } + uint8_t *data = NULL; + size_t data_len; + if (/* OpenSSL historically NUL-terminated this value with a single byte, + * even for |MBSTRING_BMP| and |MBSTRING_UNIV|. */ + !CBB_add_u8(&cbb, 0) || + !CBB_finish(&cbb, &data, &data_len) || + data_len < 1 || + data_len > INT_MAX) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_INTERNAL_ERROR); + OPENSSL_free(data); + goto err; + } + dest->length = (int)(data_len - 1); + dest->data = data; + return str_type; + + err: + if (free_out) + ASN1_STRING_free(dest); + CBB_cleanup(&cbb); + return -1; +} + +/* Return 1 if the character is permitted in a PrintableString */ +static int is_printable(uint32_t value) +{ + int ch; + if (value > 0x7f) + return 0; + ch = (int)value; + /* + * Note: we can't use 'isalnum' because certain accented characters may + * count as alphanumeric in some environments. + */ + if ((ch >= 'a') && (ch <= 'z')) + return 1; + if ((ch >= 'A') && (ch <= 'Z')) + return 1; + if ((ch >= '0') && (ch <= '9')) + return 1; + if ((ch == ' ') || strchr("'()+,-./:=?", ch)) + return 1; + return 0; +} diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_object.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_object.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c index d5e59e292..3a21f919e 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_object.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c @@ -68,7 +68,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) { - unsigned char *p; + unsigned char *p, *allocated = NULL; int objsize; if ((a == NULL) || (a->data == NULL)) @@ -78,13 +78,24 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) if (pp == NULL || objsize == -1) return objsize; - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL); OPENSSL_memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (objsize); + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + a->length; + return objsize; } int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a) diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_object.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_object.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c.grpc_back index 005e37d50..97335bfd8 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_object.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_object.c.grpc_back @@ -68,7 +68,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) { - unsigned char *p; + unsigned char *p, *allocated = NULL; int objsize; if ((a == NULL) || (a->data == NULL)) @@ -78,13 +78,24 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) if (pp == NULL || objsize == -1) return objsize; - p = *pp; + if (*pp == NULL) { + if ((p = allocated = OPENSSL_malloc(objsize)) == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); + return 0; + } + } else { + p = *pp; + } + ASN1_put_object(&p, 0, a->length, V_ASN1_OBJECT, V_ASN1_UNIVERSAL); OPENSSL_memcpy(p, a->data, a->length); - p += a->length; - *pp = p; - return (objsize); + /* + * If a new buffer was allocated, just return it back. + * If not, return the incremented buffer pointer. + */ + *pp = allocated != NULL ? allocated : p + a->length; + return objsize; } int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a) diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_octet.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_octet.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_octet.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_octet.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_octet.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_print.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_print.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_print.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_print.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_print.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_strnid.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_strnid.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c index addbd7d62..f2943111d 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_strnid.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c @@ -223,6 +223,7 @@ ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid) return ttmp; if (!stable) return NULL; + sk_ASN1_STRING_TABLE_sort(stable); found = sk_ASN1_STRING_TABLE_find(stable, &idx, &fnd); if (!found) return NULL; diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_strnid.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_strnid.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c.grpc_back index 379a79fb7..efbf0fa89 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_strnid.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_strnid.c.grpc_back @@ -223,6 +223,7 @@ ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid) return ttmp; if (!stable) return NULL; + sk_ASN1_STRING_TABLE_sort(stable); found = sk_ASN1_STRING_TABLE_find(stable, &idx, &fnd); if (!found) return NULL; diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_time.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_time.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c index feb244344..e74c2feca 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_time.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c @@ -60,7 +60,6 @@ #include #include -#include #include #include @@ -143,11 +142,11 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, str = (char *)ret->data; /* Work out the century and prepend */ if (t->data[0] >= '5') - BUF_strlcpy(str, "19", newlen); + OPENSSL_strlcpy(str, "19", newlen); else - BUF_strlcpy(str, "20", newlen); + OPENSSL_strlcpy(str, "20", newlen); - BUF_strlcat(str, (char *)t->data, newlen); + OPENSSL_strlcat(str, (char *)t->data, newlen); done: if (out != NULL && *out == NULL) diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_time.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_time.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c.grpc_back index c962c0bf0..51aae5d9f 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/a_time.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_time.c.grpc_back @@ -60,7 +60,6 @@ #include #include -#include #include #include @@ -143,11 +142,11 @@ ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, str = (char *)ret->data; /* Work out the century and prepend */ if (t->data[0] >= '5') - BUF_strlcpy(str, "19", newlen); + OPENSSL_strlcpy(str, "19", newlen); else - BUF_strlcpy(str, "20", newlen); + OPENSSL_strlcpy(str, "20", newlen); - BUF_strlcat(str, (char *)t->data, newlen); + OPENSSL_strlcat(str, (char *)t->data, newlen); done: if (out != NULL && *out == NULL) diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_type.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_type.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_type.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_type.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_type.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_utctm.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_utctm.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_utctm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_utctm.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_utctm.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_utf8.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_utf8.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/a_utf8.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/a_utf8.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/a_utf8.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_lib.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn1_lib.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c index 8585302d8..7694e4e0e 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_lib.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c @@ -205,7 +205,11 @@ static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, } else ret = i; } - if (ret > LONG_MAX) + /* + * Bound the length to comfortably fit in an int. Lengths in this module + * often switch between int and long without overflow checks. + */ + if (ret > INT_MAX / 2) return 0; *pp = p; *rl = (long)ret; diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_lib.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn1_lib.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c.grpc_back index ea727f335..8526aba38 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_lib.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_lib.c.grpc_back @@ -205,7 +205,11 @@ static int asn1_get_length(const unsigned char **pp, int *inf, long *rl, } else ret = i; } - if (ret > LONG_MAX) + /* + * Bound the length to comfortably fit in an int. Lengths in this module + * often switch between int and long without overflow checks. + */ + if (ret > INT_MAX / 2) return 0; *pp = p; *rl = (long)ret; diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_locl.h b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn1_locl.h rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_locl.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn1_locl.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_locl.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_par.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn1_par.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn1_par.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn1_par.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn1_par.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn_pack.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn_pack.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/asn_pack.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/asn_pack.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/asn_pack.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/f_enum.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/f_enum.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/f_enum.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/f_enum.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/f_enum.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/f_int.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/f_int.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/f_int.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/f_int.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/f_int.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/f_string.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/f_string.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/f_string.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/f_string.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/f_string.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_dec.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_dec.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_dec.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_dec.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_dec.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_enc.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_enc.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c index 74b5f9c54..5242acea5 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_enc.c +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c @@ -192,7 +192,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, /* Use indefinite length constructed if requested */ if (aclass & ASN1_TFLG_NDEF) ndef = 2; - /* fall through */ + OPENSSL_FALLTHROUGH; case ASN1_ITYPE_SEQUENCE: i = asn1_enc_restore(&seqcontlen, out, pval, it); @@ -583,6 +583,8 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, otmp = (ASN1_OBJECT *)*pval; cont = otmp->data; len = otmp->length; + if (cont == NULL || len == 0) + return -1; break; case V_ASN1_NULL: diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_enc.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_enc.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c.grpc_back index cc87d3498..3722a5191 100644 --- a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_enc.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_enc.c.grpc_back @@ -192,7 +192,7 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, /* Use indefinite length constructed if requested */ if (aclass & ASN1_TFLG_NDEF) ndef = 2; - /* fall through */ + OPENSSL_FALLTHROUGH; case ASN1_ITYPE_SEQUENCE: i = asn1_enc_restore(&seqcontlen, out, pval, it); @@ -583,6 +583,8 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype, otmp = (ASN1_OBJECT *)*pval; cont = otmp->data; len = otmp->length; + if (cont == NULL || len == 0) + return -1; break; case V_ASN1_NULL: diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_fre.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_fre.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_fre.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_fre.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_fre.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_new.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_new.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_new.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_new.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_new.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_typ.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_typ.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_typ.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_typ.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_typ.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_utl.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_utl.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/tasn_utl.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/tasn_utl.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/tasn_utl.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/time_support.c b/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/time_support.c rename to Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c diff --git a/Pods/BoringSSL-GRPC/crypto/asn1/time_support.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/asn1/time_support.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/asn1/time_support.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/base64/base64.c b/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/base64/base64.c rename to Pods/BoringSSL-GRPC/src/crypto/base64/base64.c index 648527d25..16a238282 100644 --- a/Pods/BoringSSL-GRPC/crypto/base64/base64.c +++ b/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c @@ -98,8 +98,8 @@ static uint8_t conv_bin2ascii(uint8_t a) { return ret; } -OPENSSL_COMPILE_ASSERT(sizeof(((EVP_ENCODE_CTX *)(NULL))->data) % 3 == 0, - data_length_must_be_multiple_of_base64_chunk_size); +OPENSSL_STATIC_ASSERT(sizeof(((EVP_ENCODE_CTX *)(NULL))->data) % 3 == 0, + "data length must be a multiple of base64 chunk size"); int EVP_EncodedLength(size_t *out_len, size_t len) { if (len + 2 < len) { diff --git a/Pods/BoringSSL-GRPC/crypto/base64/base64.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/base64/base64.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/base64/base64.c.grpc_back index b701b0d12..349452dd4 100644 --- a/Pods/BoringSSL-GRPC/crypto/base64/base64.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/base64/base64.c.grpc_back @@ -98,8 +98,8 @@ static uint8_t conv_bin2ascii(uint8_t a) { return ret; } -OPENSSL_COMPILE_ASSERT(sizeof(((EVP_ENCODE_CTX *)(NULL))->data) % 3 == 0, - data_length_must_be_multiple_of_base64_chunk_size); +OPENSSL_STATIC_ASSERT(sizeof(((EVP_ENCODE_CTX *)(NULL))->data) % 3 == 0, + "data length must be a multiple of base64 chunk size"); int EVP_EncodedLength(size_t *out_len, size_t len) { if (len + 2 < len) { diff --git a/Pods/BoringSSL-GRPC/crypto/bio/bio.c b/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c similarity index 84% rename from Pods/BoringSSL-GRPC/crypto/bio/bio.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/bio.c index 0df245d03..88a560489 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/bio.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c @@ -61,6 +61,7 @@ #include #include +#include #include #include #include @@ -177,6 +178,19 @@ int BIO_write(BIO *bio, const void *in, int inl) { return ret; } +int BIO_write_all(BIO *bio, const void *data, size_t len) { + const uint8_t *data_u8 = data; + while (len > 0) { + int ret = BIO_write(bio, data_u8, len > INT_MAX ? INT_MAX : (int)len); + if (ret <= 0) { + return 0; + } + data_u8 += ret; + len -= ret; + } + return 1; +} + int BIO_puts(BIO *bio, const char *in) { return BIO_write(bio, in, strlen(in)); } @@ -468,11 +482,52 @@ static int bio_read_all(BIO *bio, uint8_t **out, size_t *out_len, } } +// bio_read_full reads |len| bytes |bio| and writes them into |out|. It +// tolerates partial reads from |bio| and returns one on success or zero if a +// read fails before |len| bytes are read. On failure, it additionally sets +// |*out_eof_on_first_read| to whether the error was due to |bio| returning zero +// on the first read. |out_eof_on_first_read| may be NULL to discard the value. +static int bio_read_full(BIO *bio, uint8_t *out, int *out_eof_on_first_read, + size_t len) { + int first_read = 1; + while (len > 0) { + int todo = len <= INT_MAX ? (int)len : INT_MAX; + int ret = BIO_read(bio, out, todo); + if (ret <= 0) { + if (out_eof_on_first_read != NULL) { + *out_eof_on_first_read = first_read && ret == 0; + } + return 0; + } + out += ret; + len -= (size_t)ret; + first_read = 0; + } + + return 1; +} + +// For compatibility with existing |d2i_*_bio| callers, |BIO_read_asn1| uses +// |ERR_LIB_ASN1| errors. +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_DECODE_ERROR) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_HEADER_TOO_LONG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_NOT_ENOUGH_DATA) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_TOO_LONG) + int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { uint8_t header[6]; static const size_t kInitialHeaderLen = 2; - if (BIO_read(bio, header, kInitialHeaderLen) != (int) kInitialHeaderLen) { + int eof_on_first_read; + if (!bio_read_full(bio, header, &eof_on_first_read, kInitialHeaderLen)) { + if (eof_on_first_read) { + // Historically, OpenSSL returned |ASN1_R_HEADER_TOO_LONG| when + // |d2i_*_bio| could not read anything. CPython conditions on this to + // determine if |bio| was empty. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_HEADER_TOO_LONG); + } else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); + } return 0; } @@ -481,6 +536,7 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { if ((tag & 0x1f) == 0x1f) { // Long form tags are not supported. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } @@ -494,34 +550,40 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { if ((tag & 0x20 /* constructed */) != 0 && num_bytes == 0) { // indefinite length. - return bio_read_all(bio, out, out_len, header, kInitialHeaderLen, - max_len); + if (!bio_read_all(bio, out, out_len, header, kInitialHeaderLen, + max_len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); + return 0; + } + return 1; } if (num_bytes == 0 || num_bytes > 4) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } - if (BIO_read(bio, header + kInitialHeaderLen, num_bytes) != - (int)num_bytes) { + if (!bio_read_full(bio, header + kInitialHeaderLen, NULL, num_bytes)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); return 0; } header_len = kInitialHeaderLen + num_bytes; uint32_t len32 = 0; - unsigned i; - for (i = 0; i < num_bytes; i++) { + for (unsigned i = 0; i < num_bytes; i++) { len32 <<= 8; len32 |= header[kInitialHeaderLen + i]; } if (len32 < 128) { // Length should have used short-form encoding. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } if ((len32 >> ((num_bytes-1)*8)) == 0) { // Length should have been at least one byte shorter. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } @@ -531,6 +593,7 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { if (len + header_len < len || len + header_len > max_len || len > INT_MAX) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); return 0; } len += header_len; @@ -538,11 +601,12 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { *out = OPENSSL_malloc(len); if (*out == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); return 0; } OPENSSL_memcpy(*out, header, header_len); - if (BIO_read(bio, (*out) + header_len, len - header_len) != - (int) (len - header_len)) { + if (!bio_read_full(bio, (*out) + header_len, NULL, len - header_len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); OPENSSL_free(*out); return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/bio/bio.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c.grpc_back similarity index 84% rename from Pods/BoringSSL-GRPC/crypto/bio/bio.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/bio.c.grpc_back index 3e788b876..7d97c3e71 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/bio.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/bio.c.grpc_back @@ -61,6 +61,7 @@ #include #include +#include #include #include #include @@ -177,6 +178,19 @@ int BIO_write(BIO *bio, const void *in, int inl) { return ret; } +int BIO_write_all(BIO *bio, const void *data, size_t len) { + const uint8_t *data_u8 = data; + while (len > 0) { + int ret = BIO_write(bio, data_u8, len > INT_MAX ? INT_MAX : (int)len); + if (ret <= 0) { + return 0; + } + data_u8 += ret; + len -= ret; + } + return 1; +} + int BIO_puts(BIO *bio, const char *in) { return BIO_write(bio, in, strlen(in)); } @@ -468,11 +482,52 @@ static int bio_read_all(BIO *bio, uint8_t **out, size_t *out_len, } } +// bio_read_full reads |len| bytes |bio| and writes them into |out|. It +// tolerates partial reads from |bio| and returns one on success or zero if a +// read fails before |len| bytes are read. On failure, it additionally sets +// |*out_eof_on_first_read| to whether the error was due to |bio| returning zero +// on the first read. |out_eof_on_first_read| may be NULL to discard the value. +static int bio_read_full(BIO *bio, uint8_t *out, int *out_eof_on_first_read, + size_t len) { + int first_read = 1; + while (len > 0) { + int todo = len <= INT_MAX ? (int)len : INT_MAX; + int ret = BIO_read(bio, out, todo); + if (ret <= 0) { + if (out_eof_on_first_read != NULL) { + *out_eof_on_first_read = first_read && ret == 0; + } + return 0; + } + out += ret; + len -= (size_t)ret; + first_read = 0; + } + + return 1; +} + +// For compatibility with existing |d2i_*_bio| callers, |BIO_read_asn1| uses +// |ERR_LIB_ASN1| errors. +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_DECODE_ERROR) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_HEADER_TOO_LONG) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_NOT_ENOUGH_DATA) +OPENSSL_DECLARE_ERROR_REASON(ASN1, ASN1_R_TOO_LONG) + int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { uint8_t header[6]; static const size_t kInitialHeaderLen = 2; - if (BIO_read(bio, header, kInitialHeaderLen) != (int) kInitialHeaderLen) { + int eof_on_first_read; + if (!bio_read_full(bio, header, &eof_on_first_read, kInitialHeaderLen)) { + if (eof_on_first_read) { + // Historically, OpenSSL returned |ASN1_R_HEADER_TOO_LONG| when + // |d2i_*_bio| could not read anything. CPython conditions on this to + // determine if |bio| was empty. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_HEADER_TOO_LONG); + } else { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); + } return 0; } @@ -481,6 +536,7 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { if ((tag & 0x1f) == 0x1f) { // Long form tags are not supported. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } @@ -494,34 +550,40 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { if ((tag & 0x20 /* constructed */) != 0 && num_bytes == 0) { // indefinite length. - return bio_read_all(bio, out, out_len, header, kInitialHeaderLen, - max_len); + if (!bio_read_all(bio, out, out_len, header, kInitialHeaderLen, + max_len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); + return 0; + } + return 1; } if (num_bytes == 0 || num_bytes > 4) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } - if (BIO_read(bio, header + kInitialHeaderLen, num_bytes) != - (int)num_bytes) { + if (!bio_read_full(bio, header + kInitialHeaderLen, NULL, num_bytes)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); return 0; } header_len = kInitialHeaderLen + num_bytes; uint32_t len32 = 0; - unsigned i; - for (i = 0; i < num_bytes; i++) { + for (unsigned i = 0; i < num_bytes; i++) { len32 <<= 8; len32 |= header[kInitialHeaderLen + i]; } if (len32 < 128) { // Length should have used short-form encoding. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } if ((len32 >> ((num_bytes-1)*8)) == 0) { // Length should have been at least one byte shorter. + OPENSSL_PUT_ERROR(ASN1, ASN1_R_DECODE_ERROR); return 0; } @@ -531,6 +593,7 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { if (len + header_len < len || len + header_len > max_len || len > INT_MAX) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_TOO_LONG); return 0; } len += header_len; @@ -538,11 +601,12 @@ int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, size_t max_len) { *out = OPENSSL_malloc(len); if (*out == NULL) { + OPENSSL_PUT_ERROR(ASN1, ERR_R_MALLOC_FAILURE); return 0; } OPENSSL_memcpy(*out, header, header_len); - if (BIO_read(bio, (*out) + header_len, len - header_len) != - (int) (len - header_len)) { + if (!bio_read_full(bio, (*out) + header_len, NULL, len - header_len)) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_NOT_ENOUGH_DATA); OPENSSL_free(*out); return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/bio/bio_mem.c b/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/bio_mem.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c diff --git a/Pods/BoringSSL-GRPC/crypto/bio/bio_mem.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/bio_mem.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/bio_mem.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/bio/connect.c b/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/bio/connect.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/connect.c index 5bc3600d6..409f4acde 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/connect.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c @@ -56,6 +56,8 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include #include @@ -72,7 +74,6 @@ OPENSSL_MSVC_PRAGMA(warning(push, 3)) OPENSSL_MSVC_PRAGMA(warning(pop)) #endif -#include #include #include @@ -147,7 +148,7 @@ static int split_host_and_port(char **out_host, char **out_port, const char *nam } } - *out_host = BUF_strndup(host, host_len); + *out_host = OPENSSL_strndup(host, host_len); if (*out_host == NULL) { return 0; } @@ -427,13 +428,13 @@ static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr) { bio->init = 1; if (num == 0) { OPENSSL_free(data->param_hostname); - data->param_hostname = BUF_strdup(ptr); + data->param_hostname = OPENSSL_strdup(ptr); if (data->param_hostname == NULL) { ret = 0; } } else if (num == 1) { OPENSSL_free(data->param_port); - data->param_port = BUF_strdup(ptr); + data->param_port = OPENSSL_strdup(ptr); if (data->param_port == NULL) { ret = 0; } @@ -540,3 +541,5 @@ int BIO_set_nbio(BIO *bio, int on) { int BIO_do_connect(BIO *bio) { return BIO_ctrl(bio, BIO_C_DO_STATE_MACHINE, 0, NULL); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/connect.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/bio/connect.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/connect.c.grpc_back index 0b60f6a95..b8afa6137 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/connect.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/connect.c.grpc_back @@ -56,6 +56,8 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include #include @@ -72,7 +74,6 @@ OPENSSL_MSVC_PRAGMA(warning(push, 3)) OPENSSL_MSVC_PRAGMA(warning(pop)) #endif -#include #include #include @@ -147,7 +148,7 @@ static int split_host_and_port(char **out_host, char **out_port, const char *nam } } - *out_host = BUF_strndup(host, host_len); + *out_host = OPENSSL_strndup(host, host_len); if (*out_host == NULL) { return 0; } @@ -427,13 +428,13 @@ static long conn_ctrl(BIO *bio, int cmd, long num, void *ptr) { bio->init = 1; if (num == 0) { OPENSSL_free(data->param_hostname); - data->param_hostname = BUF_strdup(ptr); + data->param_hostname = OPENSSL_strdup(ptr); if (data->param_hostname == NULL) { ret = 0; } } else if (num == 1) { OPENSSL_free(data->param_port); - data->param_port = BUF_strdup(ptr); + data->param_port = OPENSSL_strdup(ptr); if (data->param_port == NULL) { ret = 0; } @@ -540,3 +541,5 @@ int BIO_set_nbio(BIO *bio, int on) { int BIO_do_connect(BIO *bio) { return BIO_ctrl(bio, BIO_C_DO_STATE_MACHINE, 0, NULL); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/fd.c b/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/bio/fd.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/fd.c index 5dfccd83e..bf83b162e 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/fd.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c @@ -56,6 +56,8 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include @@ -68,7 +70,6 @@ OPENSSL_MSVC_PRAGMA(warning(push, 3)) OPENSSL_MSVC_PRAGMA(warning(pop)) #endif -#include #include #include @@ -274,3 +275,5 @@ int BIO_set_fd(BIO *bio, int fd, int close_flag) { int BIO_get_fd(BIO *bio, int *out_fd) { return BIO_ctrl(bio, BIO_C_GET_FD, 0, (char *) out_fd); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/fd.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/bio/fd.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/fd.c.grpc_back index fed5228ff..d4e691805 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/fd.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/fd.c.grpc_back @@ -56,6 +56,8 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include @@ -68,7 +70,6 @@ OPENSSL_MSVC_PRAGMA(warning(push, 3)) OPENSSL_MSVC_PRAGMA(warning(pop)) #endif -#include #include #include @@ -274,3 +275,5 @@ int BIO_set_fd(BIO *bio, int fd, int close_flag) { int BIO_get_fd(BIO *bio, int *out_fd) { return BIO_ctrl(bio, BIO_C_GET_FD, 0, (char *) out_fd); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/file.c b/Pods/BoringSSL-GRPC/src/crypto/bio/file.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/bio/file.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/file.c index fbad20bf7..6405f2422 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/file.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/file.c @@ -73,11 +73,12 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include #include -#include #include #include @@ -105,13 +106,12 @@ BIO *BIO_new_file(const char *filename, const char *mode) { return NULL; } - ret = BIO_new(BIO_s_file()); + ret = BIO_new_fp(file, BIO_CLOSE); if (ret == NULL) { fclose(file); return NULL; } - BIO_set_fp(ret, file, BIO_CLOSE); return ret; } @@ -207,16 +207,16 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) { b->shutdown = (int)num & BIO_CLOSE; if (num & BIO_FP_APPEND) { if (num & BIO_FP_READ) { - BUF_strlcpy(p, "a+", sizeof(p)); + OPENSSL_strlcpy(p, "a+", sizeof(p)); } else { - BUF_strlcpy(p, "a", sizeof(p)); + OPENSSL_strlcpy(p, "a", sizeof(p)); } } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) { - BUF_strlcpy(p, "r+", sizeof(p)); + OPENSSL_strlcpy(p, "r+", sizeof(p)); } else if (num & BIO_FP_WRITE) { - BUF_strlcpy(p, "w", sizeof(p)); + OPENSSL_strlcpy(p, "w", sizeof(p)); } else if (num & BIO_FP_READ) { - BUF_strlcpy(p, "r", sizeof(p)); + OPENSSL_strlcpy(p, "r", sizeof(p)); } else { OPENSSL_PUT_ERROR(BIO, BIO_R_BAD_FOPEN_MODE); ret = 0; @@ -313,3 +313,5 @@ int BIO_rw_filename(BIO *bio, const char *filename) { return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_READ | BIO_FP_WRITE, (char *)filename); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/file.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/file.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/bio/file.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/file.c.grpc_back index f61dbe4fe..15feb9d86 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/file.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/file.c.grpc_back @@ -73,11 +73,12 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include #include -#include #include #include @@ -105,13 +106,12 @@ BIO *BIO_new_file(const char *filename, const char *mode) { return NULL; } - ret = BIO_new(BIO_s_file()); + ret = BIO_new_fp(file, BIO_CLOSE); if (ret == NULL) { fclose(file); return NULL; } - BIO_set_fp(ret, file, BIO_CLOSE); return ret; } @@ -207,16 +207,16 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) { b->shutdown = (int)num & BIO_CLOSE; if (num & BIO_FP_APPEND) { if (num & BIO_FP_READ) { - BUF_strlcpy(p, "a+", sizeof(p)); + OPENSSL_strlcpy(p, "a+", sizeof(p)); } else { - BUF_strlcpy(p, "a", sizeof(p)); + OPENSSL_strlcpy(p, "a", sizeof(p)); } } else if ((num & BIO_FP_READ) && (num & BIO_FP_WRITE)) { - BUF_strlcpy(p, "r+", sizeof(p)); + OPENSSL_strlcpy(p, "r+", sizeof(p)); } else if (num & BIO_FP_WRITE) { - BUF_strlcpy(p, "w", sizeof(p)); + OPENSSL_strlcpy(p, "w", sizeof(p)); } else if (num & BIO_FP_READ) { - BUF_strlcpy(p, "r", sizeof(p)); + OPENSSL_strlcpy(p, "r", sizeof(p)); } else { OPENSSL_PUT_ERROR(BIO, BIO_R_BAD_FOPEN_MODE); ret = 0; @@ -313,3 +313,5 @@ int BIO_rw_filename(BIO *bio, const char *filename) { return BIO_ctrl(bio, BIO_C_SET_FILENAME, BIO_CLOSE | BIO_FP_READ | BIO_FP_WRITE, (char *)filename); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/hexdump.c b/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/hexdump.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c diff --git a/Pods/BoringSSL-GRPC/crypto/bio/hexdump.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/hexdump.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/hexdump.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/bio/internal.h b/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/bio/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/bio/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/bio/pair.c b/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/bio/pair.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/pair.c index 7d9d82c5a..aa19a31de 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/pair.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c @@ -55,7 +55,6 @@ #include #include -#include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/bio/pair.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/bio/pair.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/pair.c.grpc_back index f5057ed36..03f60b7cc 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/pair.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/pair.c.grpc_back @@ -55,7 +55,6 @@ #include #include -#include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/bio/printf.c b/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/printf.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/printf.c diff --git a/Pods/BoringSSL-GRPC/crypto/bio/printf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/printf.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bio/printf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/printf.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/bio/socket.c b/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/bio/socket.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/socket.c index 5961170e8..359a88851 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/socket.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c @@ -57,6 +57,8 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include @@ -200,3 +202,5 @@ BIO *BIO_new_socket(int fd, int close_flag) { BIO_set_fd(ret, fd, close_flag); return ret; } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/socket.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/bio/socket.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/socket.c.grpc_back index 111761fa8..081ce0109 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/socket.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/socket.c.grpc_back @@ -57,6 +57,8 @@ #include +#if !defined(OPENSSL_TRUSTY) + #include #include @@ -200,3 +202,5 @@ BIO *BIO_new_socket(int fd, int close_flag) { BIO_set_fd(ret, fd, close_flag); return ret; } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/socket_helper.c b/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/bio/socket_helper.c rename to Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c index 8101c8326..1ea87f742 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/socket_helper.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c @@ -18,6 +18,8 @@ #include #include +#if !defined(OPENSSL_TRUSTY) + #include #include #include @@ -112,3 +114,5 @@ int bio_sock_error(int sock) { } return error; } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bio/socket_helper.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/bio/socket_helper.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c.grpc_back index 268405a6d..d4209d0f9 100644 --- a/Pods/BoringSSL-GRPC/crypto/bio/socket_helper.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bio/socket_helper.c.grpc_back @@ -18,6 +18,8 @@ #include #include +#if !defined(OPENSSL_TRUSTY) + #include #include #include @@ -112,3 +114,5 @@ int bio_sock_error(int sock) { } return error; } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/bn_extra/bn_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bn_extra/bn_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c diff --git a/Pods/BoringSSL-GRPC/crypto/bn_extra/bn_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bn_extra/bn_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bn_extra/bn_asn1.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/bn_extra/convert.c b/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/bn_extra/convert.c rename to Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c index 2610ae5c6..b1c285b83 100644 --- a/Pods/BoringSSL-GRPC/crypto/bn_extra/convert.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c @@ -367,17 +367,13 @@ int BN_print(BIO *bp, const BIGNUM *a) { } int BN_print_fp(FILE *fp, const BIGNUM *a) { - BIO *b; - int ret; - - b = BIO_new(BIO_s_file()); + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); if (b == NULL) { return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = BN_print(b, a); - BIO_free(b); + int ret = BN_print(b, a); + BIO_free(b); return ret; } @@ -464,3 +460,11 @@ BIGNUM *BN_mpi2bn(const uint8_t *in, size_t len, BIGNUM *out) { } return out; } + +int BN_bn2binpad(const BIGNUM *in, uint8_t *out, int len) { + if (len < 0 || + !BN_bn2bin_padded(out, (size_t)len, in)) { + return -1; + } + return len; +} diff --git a/Pods/BoringSSL-GRPC/crypto/bn_extra/convert.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/bn_extra/convert.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c.grpc_back index c70ff8b5b..6e930fc69 100644 --- a/Pods/BoringSSL-GRPC/crypto/bn_extra/convert.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bn_extra/convert.c.grpc_back @@ -367,17 +367,13 @@ end: } int BN_print_fp(FILE *fp, const BIGNUM *a) { - BIO *b; - int ret; - - b = BIO_new(BIO_s_file()); + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); if (b == NULL) { return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = BN_print(b, a); - BIO_free(b); + int ret = BN_print(b, a); + BIO_free(b); return ret; } @@ -464,3 +460,11 @@ BIGNUM *BN_mpi2bn(const uint8_t *in, size_t len, BIGNUM *out) { } return out; } + +int BN_bn2binpad(const BIGNUM *in, uint8_t *out, int len) { + if (len < 0 || + !BN_bn2bin_padded(out, (size_t)len, in)) { + return -1; + } + return len; +} diff --git a/Pods/BoringSSL-GRPC/crypto/buf/buf.c b/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c similarity index 81% rename from Pods/BoringSSL-GRPC/crypto/buf/buf.c rename to Pods/BoringSSL-GRPC/src/crypto/buf/buf.c index 52d39dff8..bcf591ce6 100644 --- a/Pods/BoringSSL-GRPC/crypto/buf/buf.c +++ b/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c @@ -132,6 +132,10 @@ size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len) { } int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len) { + // Work around a C language bug. See https://crbug.com/1019588. + if (len == 0) { + return 1; + } size_t new_len = buf->length + len; if (new_len < len) { OPENSSL_PUT_ERROR(BUF, ERR_R_OVERFLOW); @@ -145,87 +149,24 @@ int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len) { return 1; } -char *BUF_strdup(const char *str) { - if (str == NULL) { - return NULL; - } - - return BUF_strndup(str, strlen(str)); -} +char *BUF_strdup(const char *str) { return OPENSSL_strdup(str); } size_t BUF_strnlen(const char *str, size_t max_len) { - size_t i; - - for (i = 0; i < max_len; i++) { - if (str[i] == 0) { - break; - } - } - - return i; + return OPENSSL_strnlen(str, max_len); } char *BUF_strndup(const char *str, size_t size) { - char *ret; - size_t alloc_size; - - if (str == NULL) { - return NULL; - } - - size = BUF_strnlen(str, size); - - alloc_size = size + 1; - if (alloc_size < size) { - // overflow - OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); - return NULL; - } - ret = OPENSSL_malloc(alloc_size); - if (ret == NULL) { - OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); - return NULL; - } - - OPENSSL_memcpy(ret, str, size); - ret[size] = '\0'; - return ret; + return OPENSSL_strndup(str, size); } size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size) { - size_t l = 0; - - for (; dst_size > 1 && *src; dst_size--) { - *dst++ = *src++; - l++; - } - - if (dst_size) { - *dst = 0; - } - - return l + strlen(src); + return OPENSSL_strlcpy(dst, src, dst_size); } size_t BUF_strlcat(char *dst, const char *src, size_t dst_size) { - size_t l = 0; - for (; dst_size > 0 && *dst; dst_size--, dst++) { - l++; - } - return l + BUF_strlcpy(dst, src, dst_size); + return OPENSSL_strlcat(dst, src, dst_size); } void *BUF_memdup(const void *data, size_t size) { - if (size == 0) { - return NULL; - } - - void *ret = OPENSSL_malloc(size); - if (ret == NULL) { - OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); - return NULL; - } - - OPENSSL_memcpy(ret, data, size); - return ret; + return OPENSSL_memdup(data, size); } diff --git a/Pods/BoringSSL-GRPC/crypto/buf/buf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c.grpc_back similarity index 81% rename from Pods/BoringSSL-GRPC/crypto/buf/buf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/buf/buf.c.grpc_back index 146b1e0a3..bd97dd347 100644 --- a/Pods/BoringSSL-GRPC/crypto/buf/buf.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/buf/buf.c.grpc_back @@ -132,6 +132,10 @@ size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len) { } int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len) { + // Work around a C language bug. See https://crbug.com/1019588. + if (len == 0) { + return 1; + } size_t new_len = buf->length + len; if (new_len < len) { OPENSSL_PUT_ERROR(BUF, ERR_R_OVERFLOW); @@ -145,87 +149,24 @@ int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len) { return 1; } -char *BUF_strdup(const char *str) { - if (str == NULL) { - return NULL; - } - - return BUF_strndup(str, strlen(str)); -} +char *BUF_strdup(const char *str) { return OPENSSL_strdup(str); } size_t BUF_strnlen(const char *str, size_t max_len) { - size_t i; - - for (i = 0; i < max_len; i++) { - if (str[i] == 0) { - break; - } - } - - return i; + return OPENSSL_strnlen(str, max_len); } char *BUF_strndup(const char *str, size_t size) { - char *ret; - size_t alloc_size; - - if (str == NULL) { - return NULL; - } - - size = BUF_strnlen(str, size); - - alloc_size = size + 1; - if (alloc_size < size) { - // overflow - OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); - return NULL; - } - ret = OPENSSL_malloc(alloc_size); - if (ret == NULL) { - OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); - return NULL; - } - - OPENSSL_memcpy(ret, str, size); - ret[size] = '\0'; - return ret; + return OPENSSL_strndup(str, size); } size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size) { - size_t l = 0; - - for (; dst_size > 1 && *src; dst_size--) { - *dst++ = *src++; - l++; - } - - if (dst_size) { - *dst = 0; - } - - return l + strlen(src); + return OPENSSL_strlcpy(dst, src, dst_size); } size_t BUF_strlcat(char *dst, const char *src, size_t dst_size) { - size_t l = 0; - for (; dst_size > 0 && *dst; dst_size--, dst++) { - l++; - } - return l + BUF_strlcpy(dst, src, dst_size); + return OPENSSL_strlcat(dst, src, dst_size); } void *BUF_memdup(const void *data, size_t size) { - if (size == 0) { - return NULL; - } - - void *ret = OPENSSL_malloc(size); - if (ret == NULL) { - OPENSSL_PUT_ERROR(BUF, ERR_R_MALLOC_FAILURE); - return NULL; - } - - OPENSSL_memcpy(ret, data, size); - return ret; + return OPENSSL_memdup(data, size); } diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/asn1_compat.c b/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bytestring/asn1_compat.c rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/asn1_compat.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/bytestring/asn1_compat.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/asn1_compat.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/ber.c b/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/bytestring/ber.c rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c index 47c25983a..e4a92831b 100644 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/ber.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c @@ -189,7 +189,7 @@ static int cbs_convert_ber(CBS *in, CBB *out, unsigned string_tag, return looking_for_eoc == 0; } -int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len) { +int CBS_asn1_ber_to_der(CBS *in, CBS *out, uint8_t **out_storage) { CBB cbb; // First, do a quick walk to find any indefinite-length elements. Most of the @@ -200,18 +200,22 @@ int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len) { } if (!conversion_needed) { - *out = NULL; - *out_len = 0; + if (!CBS_get_any_asn1_element(in, out, NULL, NULL)) { + return 0; + } + *out_storage = NULL; return 1; } + size_t len; if (!CBB_init(&cbb, CBS_len(in)) || !cbs_convert_ber(in, &cbb, 0, 0, 0) || - !CBB_finish(&cbb, out, out_len)) { + !CBB_finish(&cbb, out_storage, &len)) { CBB_cleanup(&cbb); return 0; } + CBS_init(out, *out_storage, len); return 1; } diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/ber.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/bytestring/ber.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c.grpc_back index bb5e17c42..743723994 100644 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/ber.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/ber.c.grpc_back @@ -189,7 +189,7 @@ static int cbs_convert_ber(CBS *in, CBB *out, unsigned string_tag, return looking_for_eoc == 0; } -int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len) { +int CBS_asn1_ber_to_der(CBS *in, CBS *out, uint8_t **out_storage) { CBB cbb; // First, do a quick walk to find any indefinite-length elements. Most of the @@ -200,18 +200,22 @@ int CBS_asn1_ber_to_der(CBS *in, uint8_t **out, size_t *out_len) { } if (!conversion_needed) { - *out = NULL; - *out_len = 0; + if (!CBS_get_any_asn1_element(in, out, NULL, NULL)) { + return 0; + } + *out_storage = NULL; return 1; } + size_t len; if (!CBB_init(&cbb, CBS_len(in)) || !cbs_convert_ber(in, &cbb, 0, 0, 0) || - !CBB_finish(&cbb, out, out_len)) { + !CBB_finish(&cbb, out_storage, &len)) { CBB_cleanup(&cbb); return 0; } + CBS_init(out, *out_storage, len); return 1; } diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/cbb.c b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/bytestring/cbb.c rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c index f8c48996c..1b7ae10c6 100644 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/cbb.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c @@ -18,7 +18,6 @@ #include #include -#include #include #include "../internal.h" @@ -44,7 +43,7 @@ static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { base->error = 0; cbb->base = base; - cbb->is_top_level = 1; + cbb->is_child = 0; return 1; } @@ -76,11 +75,14 @@ int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) { } void CBB_cleanup(CBB *cbb) { - if (cbb->base) { - // Only top-level |CBB|s are cleaned up. Child |CBB|s are non-owning. They - // are implicitly discarded when the parent is flushed or cleaned up. - assert(cbb->is_top_level); + // Child |CBB|s are non-owning. They are implicitly discarded and should not + // be used with |CBB_cleanup| or |ScopedCBB|. + assert(!cbb->is_child); + if (cbb->is_child) { + return; + } + if (cbb->base) { if (cbb->base->can_resize) { OPENSSL_free(cbb->base->buf); } @@ -144,7 +146,7 @@ static int cbb_buffer_add(struct cbb_buffer_st *base, uint8_t **out, return 1; } -static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint32_t v, +static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint64_t v, size_t len_len) { if (len_len == 0) { return 1; @@ -169,7 +171,7 @@ static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint32_t v, } int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len) { - if (!cbb->is_top_level) { + if (cbb->is_child) { return 0; } @@ -310,6 +312,7 @@ static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents, OPENSSL_memset(prefix_bytes, 0, len_len); OPENSSL_memset(out_contents, 0, sizeof(CBB)); out_contents->base = cbb->base; + out_contents->is_child = 1; cbb->child = out_contents; cbb->child->offset = offset; cbb->child->pending_len_len = len_len; @@ -381,6 +384,7 @@ int CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag) { OPENSSL_memset(out_contents, 0, sizeof(CBB)); out_contents->base = cbb->base; + out_contents->is_child = 1; cbb->child = out_contents; cbb->child->offset = offset; cbb->child->pending_len_len = 1; @@ -443,6 +447,10 @@ int CBB_add_u16(CBB *cbb, uint16_t value) { return cbb_buffer_add_u(cbb->base, value, 2); } +int CBB_add_u16le(CBB *cbb, uint16_t value) { + return CBB_add_u16(cbb, CRYPTO_bswap2(value)); +} + int CBB_add_u24(CBB *cbb, uint32_t value) { if (!CBB_flush(cbb)) { return 0; @@ -459,6 +467,21 @@ int CBB_add_u32(CBB *cbb, uint32_t value) { return cbb_buffer_add_u(cbb->base, value, 4); } +int CBB_add_u32le(CBB *cbb, uint32_t value) { + return CBB_add_u32(cbb, CRYPTO_bswap4(value)); +} + +int CBB_add_u64(CBB *cbb, uint64_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + return cbb_buffer_add_u(cbb->base, value, 8); +} + +int CBB_add_u64le(CBB *cbb, uint64_t value) { + return CBB_add_u64(cbb, CRYPTO_bswap8(value)); +} + void CBB_discard_child(CBB *cbb) { if (cbb->child == NULL) { return; @@ -505,6 +528,34 @@ int CBB_add_asn1_uint64(CBB *cbb, uint64_t value) { return CBB_flush(cbb); } +int CBB_add_asn1_int64(CBB *cbb, int64_t value) { + if (value >= 0) { + return CBB_add_asn1_uint64(cbb, value); + } + + union { + int64_t i; + uint8_t bytes[sizeof(int64_t)]; + } u; + u.i = value; + int start = 7; + // Skip leading sign-extension bytes unless they are necessary. + while (start > 0 && (u.bytes[start] == 0xff && (u.bytes[start - 1] & 0x80))) { + start--; + } + + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER)) { + return 0; + } + for (int i = start; i >= 0; i--) { + if (!CBB_add_u8(&child, u.bytes[i])) { + return 0; + } + } + return CBB_flush(cbb); +} + int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, size_t data_len) { CBB child; if (!CBB_add_asn1(cbb, &child, CBS_ASN1_OCTETSTRING) || @@ -637,7 +688,7 @@ int CBB_flush_asn1_set_of(CBB *cbb) { // remain valid as we rewrite |cbb|. int ret = 0; size_t buf_len = CBB_len(cbb); - uint8_t *buf = BUF_memdup(CBB_data(cbb), buf_len); + uint8_t *buf = OPENSSL_memdup(CBB_data(cbb), buf_len); CBS *children = OPENSSL_malloc(num_children * sizeof(CBS)); if (buf == NULL || children == NULL) { goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/cbb.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/bytestring/cbb.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c.grpc_back index 38e9a83a3..efb89c72c 100644 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/cbb.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbb.c.grpc_back @@ -18,7 +18,6 @@ #include #include -#include #include #include "../internal.h" @@ -44,7 +43,7 @@ static int cbb_init(CBB *cbb, uint8_t *buf, size_t cap) { base->error = 0; cbb->base = base; - cbb->is_top_level = 1; + cbb->is_child = 0; return 1; } @@ -76,11 +75,14 @@ int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len) { } void CBB_cleanup(CBB *cbb) { - if (cbb->base) { - // Only top-level |CBB|s are cleaned up. Child |CBB|s are non-owning. They - // are implicitly discarded when the parent is flushed or cleaned up. - assert(cbb->is_top_level); + // Child |CBB|s are non-owning. They are implicitly discarded and should not + // be used with |CBB_cleanup| or |ScopedCBB|. + assert(!cbb->is_child); + if (cbb->is_child) { + return; + } + if (cbb->base) { if (cbb->base->can_resize) { OPENSSL_free(cbb->base->buf); } @@ -144,7 +146,7 @@ static int cbb_buffer_add(struct cbb_buffer_st *base, uint8_t **out, return 1; } -static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint32_t v, +static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint64_t v, size_t len_len) { if (len_len == 0) { return 1; @@ -169,7 +171,7 @@ static int cbb_buffer_add_u(struct cbb_buffer_st *base, uint32_t v, } int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len) { - if (!cbb->is_top_level) { + if (cbb->is_child) { return 0; } @@ -310,6 +312,7 @@ static int cbb_add_length_prefixed(CBB *cbb, CBB *out_contents, OPENSSL_memset(prefix_bytes, 0, len_len); OPENSSL_memset(out_contents, 0, sizeof(CBB)); out_contents->base = cbb->base; + out_contents->is_child = 1; cbb->child = out_contents; cbb->child->offset = offset; cbb->child->pending_len_len = len_len; @@ -381,6 +384,7 @@ int CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag) { OPENSSL_memset(out_contents, 0, sizeof(CBB)); out_contents->base = cbb->base; + out_contents->is_child = 1; cbb->child = out_contents; cbb->child->offset = offset; cbb->child->pending_len_len = 1; @@ -443,6 +447,10 @@ int CBB_add_u16(CBB *cbb, uint16_t value) { return cbb_buffer_add_u(cbb->base, value, 2); } +int CBB_add_u16le(CBB *cbb, uint16_t value) { + return CBB_add_u16(cbb, CRYPTO_bswap2(value)); +} + int CBB_add_u24(CBB *cbb, uint32_t value) { if (!CBB_flush(cbb)) { return 0; @@ -459,6 +467,21 @@ int CBB_add_u32(CBB *cbb, uint32_t value) { return cbb_buffer_add_u(cbb->base, value, 4); } +int CBB_add_u32le(CBB *cbb, uint32_t value) { + return CBB_add_u32(cbb, CRYPTO_bswap4(value)); +} + +int CBB_add_u64(CBB *cbb, uint64_t value) { + if (!CBB_flush(cbb)) { + return 0; + } + return cbb_buffer_add_u(cbb->base, value, 8); +} + +int CBB_add_u64le(CBB *cbb, uint64_t value) { + return CBB_add_u64(cbb, CRYPTO_bswap8(value)); +} + void CBB_discard_child(CBB *cbb) { if (cbb->child == NULL) { return; @@ -505,6 +528,34 @@ int CBB_add_asn1_uint64(CBB *cbb, uint64_t value) { return CBB_flush(cbb); } +int CBB_add_asn1_int64(CBB *cbb, int64_t value) { + if (value >= 0) { + return CBB_add_asn1_uint64(cbb, value); + } + + union { + int64_t i; + uint8_t bytes[sizeof(int64_t)]; + } u; + u.i = value; + int start = 7; + // Skip leading sign-extension bytes unless they are necessary. + while (start > 0 && (u.bytes[start] == 0xff && (u.bytes[start - 1] & 0x80))) { + start--; + } + + CBB child; + if (!CBB_add_asn1(cbb, &child, CBS_ASN1_INTEGER)) { + return 0; + } + for (int i = start; i >= 0; i--) { + if (!CBB_add_u8(&child, u.bytes[i])) { + return 0; + } + } + return CBB_flush(cbb); +} + int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, size_t data_len) { CBB child; if (!CBB_add_asn1(cbb, &child, CBS_ASN1_OCTETSTRING) || @@ -637,7 +688,7 @@ int CBB_flush_asn1_set_of(CBB *cbb) { // remain valid as we rewrite |cbb|. int ret = 0; size_t buf_len = CBB_len(cbb); - uint8_t *buf = BUF_memdup(CBB_data(cbb), buf_len); + uint8_t *buf = OPENSSL_memdup(CBB_data(cbb), buf_len); CBS *children = OPENSSL_malloc(num_children * sizeof(CBS)); if (buf == NULL || children == NULL) { goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/cbs.c b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/bytestring/cbs.c rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c index e56eaf95b..3e238e094 100644 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/cbs.c +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c @@ -12,11 +12,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - -#include #include #include @@ -65,7 +60,7 @@ int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) { if (cbs->len == 0) { return 1; } - *out_ptr = BUF_memdup(cbs->data, cbs->len); + *out_ptr = OPENSSL_memdup(cbs->data, cbs->len); if (*out_ptr == NULL) { return 0; } @@ -77,7 +72,7 @@ int CBS_strdup(const CBS *cbs, char **out_ptr) { if (*out_ptr != NULL) { OPENSSL_free(*out_ptr); } - *out_ptr = BUF_strndup((const char*)cbs->data, cbs->len); + *out_ptr = OPENSSL_strndup((const char*)cbs->data, cbs->len); return (*out_ptr != NULL); } @@ -92,8 +87,8 @@ int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len) { return CRYPTO_memcmp(cbs->data, data, len) == 0; } -static int cbs_get_u(CBS *cbs, uint32_t *out, size_t len) { - uint32_t result = 0; +static int cbs_get_u(CBS *cbs, uint64_t *out, size_t len) { + uint64_t result = 0; const uint8_t *data; if (!cbs_get(cbs, &data, len)) { @@ -117,7 +112,7 @@ int CBS_get_u8(CBS *cbs, uint8_t *out) { } int CBS_get_u16(CBS *cbs, uint16_t *out) { - uint32_t v; + uint64_t v; if (!cbs_get_u(cbs, &v, 2)) { return 0; } @@ -125,12 +120,50 @@ int CBS_get_u16(CBS *cbs, uint16_t *out) { return 1; } +int CBS_get_u16le(CBS *cbs, uint16_t *out) { + if (!CBS_get_u16(cbs, out)) { + return 0; + } + *out = CRYPTO_bswap2(*out); + return 1; +} + int CBS_get_u24(CBS *cbs, uint32_t *out) { - return cbs_get_u(cbs, out, 3); + uint64_t v; + if (!cbs_get_u(cbs, &v, 3)) { + return 0; + } + *out = v; + return 1; } int CBS_get_u32(CBS *cbs, uint32_t *out) { - return cbs_get_u(cbs, out, 4); + uint64_t v; + if (!cbs_get_u(cbs, &v, 4)) { + return 0; + } + *out = v; + return 1; +} + +int CBS_get_u32le(CBS *cbs, uint32_t *out) { + if (!CBS_get_u32(cbs, out)) { + return 0; + } + *out = CRYPTO_bswap4(*out); + return 1; +} + +int CBS_get_u64(CBS *cbs, uint64_t *out) { + return cbs_get_u(cbs, out, 8); +} + +int CBS_get_u64le(CBS *cbs, uint64_t *out) { + if (!cbs_get_u(cbs, out, 8)) { + return 0; + } + *out = CRYPTO_bswap8(*out); + return 1; } int CBS_get_last_u8(CBS *cbs, uint8_t *out) { @@ -161,10 +194,13 @@ int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len) { } static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_len) { - uint32_t len; + uint64_t len; if (!cbs_get_u(cbs, &len, len_len)) { return 0; } + // If |len_len| <= 3 then we know that |len| will fit into a |size_t|, even on + // 32-bit systems. + assert(len_len <= 3); return CBS_get_bytes(cbs, out, len); } @@ -278,7 +314,7 @@ static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, // encode the number of subsequent octets used to encode the length (ITU-T // X.690 clause 8.1.3.5.b). const size_t num_bytes = length_byte & 0x7f; - uint32_t len32; + uint64_t len64; if (ber_ok && (tag & CBS_ASN1_CONSTRUCTED) != 0 && num_bytes == 0) { // indefinite length @@ -294,20 +330,20 @@ static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, if (num_bytes == 0 || num_bytes > 4) { return 0; } - if (!cbs_get_u(&header, &len32, num_bytes)) { + if (!cbs_get_u(&header, &len64, num_bytes)) { return 0; } // ITU-T X.690 section 10.1 (DER length forms) requires encoding the length // with the minimum number of octets. - if (len32 < 128) { + if (len64 < 128) { // Length should have used short-form encoding. return 0; } - if ((len32 >> ((num_bytes-1)*8)) == 0) { + if ((len64 >> ((num_bytes-1)*8)) == 0) { // Length should have been at least one byte shorter. return 0; } - len = len32; + len = len64; if (len + header_len + num_bytes < len) { // Overflow. return 0; @@ -425,6 +461,40 @@ int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out) { return 1; } +int CBS_get_asn1_int64(CBS *cbs, int64_t *out) { + CBS bytes; + if (!CBS_get_asn1(cbs, &bytes, CBS_ASN1_INTEGER)) { + return 0; + } + const uint8_t *data = CBS_data(&bytes); + const size_t len = CBS_len(&bytes); + + if (len == 0 || len > sizeof(int64_t)) { + // An INTEGER is encoded with at least one octet. + return 0; + } + if (len > 1) { + if (data[0] == 0 && (data[1] & 0x80) == 0) { + return 0; // Extra leading zeros. + } + if (data[0] == 0xff && (data[1] & 0x80) != 0) { + return 0; // Extra leading 0xff. + } + } + + union { + int64_t i; + uint8_t bytes[sizeof(int64_t)]; + } u; + const int is_negative = (data[0] & 0x80); + memset(u.bytes, is_negative ? 0xff : 0, sizeof(u.bytes)); // Sign-extend. + for (size_t i = 0; i < len; i++) { + u.bytes[i] = data[len - i - 1]; + } + *out = u.i; + return 1; +} + int CBS_get_asn1_bool(CBS *cbs, int *out) { CBS bytes; if (!CBS_get_asn1(cbs, &bytes, CBS_ASN1_BOOLEAN) || diff --git a/Pods/BoringSSL-GRPC/crypto/bytestring/cbs.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c.grpc_back similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/bytestring/cbs.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c.grpc_back index 458af3809..49d700366 100644 --- a/Pods/BoringSSL-GRPC/crypto/bytestring/cbs.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/cbs.c.grpc_back @@ -12,11 +12,6 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - -#include #include #include @@ -65,7 +60,7 @@ int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len) { if (cbs->len == 0) { return 1; } - *out_ptr = BUF_memdup(cbs->data, cbs->len); + *out_ptr = OPENSSL_memdup(cbs->data, cbs->len); if (*out_ptr == NULL) { return 0; } @@ -77,7 +72,7 @@ int CBS_strdup(const CBS *cbs, char **out_ptr) { if (*out_ptr != NULL) { OPENSSL_free(*out_ptr); } - *out_ptr = BUF_strndup((const char*)cbs->data, cbs->len); + *out_ptr = OPENSSL_strndup((const char*)cbs->data, cbs->len); return (*out_ptr != NULL); } @@ -92,8 +87,8 @@ int CBS_mem_equal(const CBS *cbs, const uint8_t *data, size_t len) { return CRYPTO_memcmp(cbs->data, data, len) == 0; } -static int cbs_get_u(CBS *cbs, uint32_t *out, size_t len) { - uint32_t result = 0; +static int cbs_get_u(CBS *cbs, uint64_t *out, size_t len) { + uint64_t result = 0; const uint8_t *data; if (!cbs_get(cbs, &data, len)) { @@ -117,7 +112,7 @@ int CBS_get_u8(CBS *cbs, uint8_t *out) { } int CBS_get_u16(CBS *cbs, uint16_t *out) { - uint32_t v; + uint64_t v; if (!cbs_get_u(cbs, &v, 2)) { return 0; } @@ -125,12 +120,50 @@ int CBS_get_u16(CBS *cbs, uint16_t *out) { return 1; } +int CBS_get_u16le(CBS *cbs, uint16_t *out) { + if (!CBS_get_u16(cbs, out)) { + return 0; + } + *out = CRYPTO_bswap2(*out); + return 1; +} + int CBS_get_u24(CBS *cbs, uint32_t *out) { - return cbs_get_u(cbs, out, 3); + uint64_t v; + if (!cbs_get_u(cbs, &v, 3)) { + return 0; + } + *out = v; + return 1; } int CBS_get_u32(CBS *cbs, uint32_t *out) { - return cbs_get_u(cbs, out, 4); + uint64_t v; + if (!cbs_get_u(cbs, &v, 4)) { + return 0; + } + *out = v; + return 1; +} + +int CBS_get_u32le(CBS *cbs, uint32_t *out) { + if (!CBS_get_u32(cbs, out)) { + return 0; + } + *out = CRYPTO_bswap4(*out); + return 1; +} + +int CBS_get_u64(CBS *cbs, uint64_t *out) { + return cbs_get_u(cbs, out, 8); +} + +int CBS_get_u64le(CBS *cbs, uint64_t *out) { + if (!cbs_get_u(cbs, out, 8)) { + return 0; + } + *out = CRYPTO_bswap8(*out); + return 1; } int CBS_get_last_u8(CBS *cbs, uint8_t *out) { @@ -161,10 +194,13 @@ int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len) { } static int cbs_get_length_prefixed(CBS *cbs, CBS *out, size_t len_len) { - uint32_t len; + uint64_t len; if (!cbs_get_u(cbs, &len, len_len)) { return 0; } + // If |len_len| <= 3 then we know that |len| will fit into a |size_t|, even on + // 32-bit systems. + assert(len_len <= 3); return CBS_get_bytes(cbs, out, len); } @@ -278,7 +314,7 @@ static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, // encode the number of subsequent octets used to encode the length (ITU-T // X.690 clause 8.1.3.5.b). const size_t num_bytes = length_byte & 0x7f; - uint32_t len32; + uint64_t len64; if (ber_ok && (tag & CBS_ASN1_CONSTRUCTED) != 0 && num_bytes == 0) { // indefinite length @@ -294,20 +330,20 @@ static int cbs_get_any_asn1_element(CBS *cbs, CBS *out, unsigned *out_tag, if (num_bytes == 0 || num_bytes > 4) { return 0; } - if (!cbs_get_u(&header, &len32, num_bytes)) { + if (!cbs_get_u(&header, &len64, num_bytes)) { return 0; } // ITU-T X.690 section 10.1 (DER length forms) requires encoding the length // with the minimum number of octets. - if (len32 < 128) { + if (len64 < 128) { // Length should have used short-form encoding. return 0; } - if ((len32 >> ((num_bytes-1)*8)) == 0) { + if ((len64 >> ((num_bytes-1)*8)) == 0) { // Length should have been at least one byte shorter. return 0; } - len = len32; + len = len64; if (len + header_len + num_bytes < len) { // Overflow. return 0; @@ -425,6 +461,40 @@ int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out) { return 1; } +int CBS_get_asn1_int64(CBS *cbs, int64_t *out) { + CBS bytes; + if (!CBS_get_asn1(cbs, &bytes, CBS_ASN1_INTEGER)) { + return 0; + } + const uint8_t *data = CBS_data(&bytes); + const size_t len = CBS_len(&bytes); + + if (len == 0 || len > sizeof(int64_t)) { + // An INTEGER is encoded with at least one octet. + return 0; + } + if (len > 1) { + if (data[0] == 0 && (data[1] & 0x80) == 0) { + return 0; // Extra leading zeros. + } + if (data[0] == 0xff && (data[1] & 0x80) != 0) { + return 0; // Extra leading 0xff. + } + } + + union { + int64_t i; + uint8_t bytes[sizeof(int64_t)]; + } u; + const int is_negative = (data[0] & 0x80); + memset(u.bytes, is_negative ? 0xff : 0, sizeof(u.bytes)); // Sign-extend. + for (size_t i = 0; i < len; i++) { + u.bytes[i] = data[len - i - 1]; + } + *out = u.i; + return 1; +} + int CBS_get_asn1_bool(CBS *cbs, int *out) { CBS bytes; if (!CBS_get_asn1(cbs, &bytes, CBS_ASN1_BOOLEAN) || diff --git a/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h b/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h new file mode 100644 index 000000000..d98c8fc5a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h @@ -0,0 +1,96 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_BYTESTRING_INTERNAL_H +#define OPENSSL_HEADER_BYTESTRING_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CBS_asn1_ber_to_der reads a BER element from |in|. If it finds +// indefinite-length elements or constructed strings then it converts the BER +// data to DER, sets |out| to the converted contents and |*out_storage| to a +// buffer which the caller must release with |OPENSSL_free|. Otherwise, it sets +// |out| to the original BER element in |in| and |*out_storage| to NULL. +// Additionally, |*in| will be advanced over the BER element. +// +// This function should successfully process any valid BER input, however it +// will not convert all of BER's deviations from DER. BER is ambiguous between +// implicitly-tagged SEQUENCEs of strings and implicitly-tagged constructed +// strings. Implicitly-tagged strings must be parsed with +// |CBS_get_ber_implicitly_tagged_string| instead of |CBS_get_asn1|. The caller +// must also account for BER variations in the contents of a primitive. +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBS_asn1_ber_to_der(CBS *in, CBS *out, + uint8_t **out_storage); + +// CBS_get_asn1_implicit_string parses a BER string of primitive type +// |inner_tag| implicitly-tagged with |outer_tag|. It sets |out| to the +// contents. If concatenation was needed, it sets |*out_storage| to a buffer +// which the caller must release with |OPENSSL_free|. Otherwise, it sets +// |*out_storage| to NULL. +// +// This function does not parse all of BER. It requires the string be +// definite-length. Constructed strings are allowed, but all children of the +// outermost element must be primitive. The caller should use +// |CBS_asn1_ber_to_der| before running this function. +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBS_get_asn1_implicit_string(CBS *in, CBS *out, + uint8_t **out_storage, + unsigned outer_tag, + unsigned inner_tag); + +// CBB_finish_i2d calls |CBB_finish| on |cbb| which must have been initialized +// with |CBB_init|. If |outp| is not NULL then the result is written to |*outp| +// and |*outp| is advanced just past the output. It returns the number of bytes +// in the result, whether written or not, or a negative value on error. On +// error, it calls |CBB_cleanup| on |cbb|. +// +// This function may be used to help implement legacy i2d ASN.1 functions. +int CBB_finish_i2d(CBB *cbb, uint8_t **outp); + + +// Unicode utilities. + +// The following functions read one Unicode code point from |cbs| with the +// corresponding encoding and store it in |*out|. They return one on success and +// zero on error. +OPENSSL_EXPORT int cbs_get_utf8(CBS *cbs, uint32_t *out); +OPENSSL_EXPORT int cbs_get_latin1(CBS *cbs, uint32_t *out); +OPENSSL_EXPORT int cbs_get_ucs2_be(CBS *cbs, uint32_t *out); +OPENSSL_EXPORT int cbs_get_utf32_be(CBS *cbs, uint32_t *out); + +// cbb_get_utf8_len returns the number of bytes needed to represent |u| in +// UTF-8. +OPENSSL_EXPORT size_t cbb_get_utf8_len(uint32_t u); + +// The following functions encode |u| to |cbb| with the corresponding +// encoding. They return one on success and zero on error. +OPENSSL_EXPORT int cbb_add_utf8(CBB *cbb, uint32_t u); +OPENSSL_EXPORT int cbb_add_latin1(CBB *cbb, uint32_t u); +OPENSSL_EXPORT int cbb_add_ucs2_be(CBB *cbb, uint32_t u); +OPENSSL_EXPORT int cbb_add_utf32_be(CBB *cbb, uint32_t u); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BYTESTRING_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h.grpc_back new file mode 100644 index 000000000..7ef0e21c6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/internal.h.grpc_back @@ -0,0 +1,96 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_BYTESTRING_INTERNAL_H +#define OPENSSL_HEADER_BYTESTRING_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CBS_asn1_ber_to_der reads a BER element from |in|. If it finds +// indefinite-length elements or constructed strings then it converts the BER +// data to DER, sets |out| to the converted contents and |*out_storage| to a +// buffer which the caller must release with |OPENSSL_free|. Otherwise, it sets +// |out| to the original BER element in |in| and |*out_storage| to NULL. +// Additionally, |*in| will be advanced over the BER element. +// +// This function should successfully process any valid BER input, however it +// will not convert all of BER's deviations from DER. BER is ambiguous between +// implicitly-tagged SEQUENCEs of strings and implicitly-tagged constructed +// strings. Implicitly-tagged strings must be parsed with +// |CBS_get_ber_implicitly_tagged_string| instead of |CBS_get_asn1|. The caller +// must also account for BER variations in the contents of a primitive. +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBS_asn1_ber_to_der(CBS *in, CBS *out, + uint8_t **out_storage); + +// CBS_get_asn1_implicit_string parses a BER string of primitive type +// |inner_tag| implicitly-tagged with |outer_tag|. It sets |out| to the +// contents. If concatenation was needed, it sets |*out_storage| to a buffer +// which the caller must release with |OPENSSL_free|. Otherwise, it sets +// |*out_storage| to NULL. +// +// This function does not parse all of BER. It requires the string be +// definite-length. Constructed strings are allowed, but all children of the +// outermost element must be primitive. The caller should use +// |CBS_asn1_ber_to_der| before running this function. +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBS_get_asn1_implicit_string(CBS *in, CBS *out, + uint8_t **out_storage, + unsigned outer_tag, + unsigned inner_tag); + +// CBB_finish_i2d calls |CBB_finish| on |cbb| which must have been initialized +// with |CBB_init|. If |outp| is not NULL then the result is written to |*outp| +// and |*outp| is advanced just past the output. It returns the number of bytes +// in the result, whether written or not, or a negative value on error. On +// error, it calls |CBB_cleanup| on |cbb|. +// +// This function may be used to help implement legacy i2d ASN.1 functions. +int CBB_finish_i2d(CBB *cbb, uint8_t **outp); + + +// Unicode utilities. + +// The following functions read one Unicode code point from |cbs| with the +// corresponding encoding and store it in |*out|. They return one on success and +// zero on error. +OPENSSL_EXPORT int cbs_get_utf8(CBS *cbs, uint32_t *out); +OPENSSL_EXPORT int cbs_get_latin1(CBS *cbs, uint32_t *out); +OPENSSL_EXPORT int cbs_get_ucs2_be(CBS *cbs, uint32_t *out); +OPENSSL_EXPORT int cbs_get_utf32_be(CBS *cbs, uint32_t *out); + +// cbb_get_utf8_len returns the number of bytes needed to represent |u| in +// UTF-8. +OPENSSL_EXPORT size_t cbb_get_utf8_len(uint32_t u); + +// The following functions encode |u| to |cbb| with the corresponding +// encoding. They return one on success and zero on error. +OPENSSL_EXPORT int cbb_add_utf8(CBB *cbb, uint32_t u); +OPENSSL_EXPORT int cbb_add_latin1(CBB *cbb, uint32_t u); +OPENSSL_EXPORT int cbb_add_ucs2_be(CBB *cbb, uint32_t u); +OPENSSL_EXPORT int cbb_add_utf32_be(CBB *cbb, uint32_t u); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BYTESTRING_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c b/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c new file mode 100644 index 000000000..0dba532bc --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c @@ -0,0 +1,155 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include "internal.h" + + +static int is_valid_code_point(uint32_t v) { + // References in the following are to Unicode 9.0.0. + if (// The Unicode space runs from zero to 0x10ffff (3.4 D9). + v > 0x10ffff || + // Values 0x...fffe, 0x...ffff, and 0xfdd0-0xfdef are permanently reserved + // (3.4 D14) + (v & 0xfffe) == 0xfffe || + (v >= 0xfdd0 && v <= 0xfdef) || + // Surrogate code points are invalid (3.2 C1). + (v >= 0xd800 && v <= 0xdfff)) { + return 0; + } + return 1; +} + +// BOTTOM_BITS returns a byte with the bottom |n| bits set. +#define BOTTOM_BITS(n) (uint8_t)((1u << (n)) - 1) + +// TOP_BITS returns a byte with the top |n| bits set. +#define TOP_BITS(n) ((uint8_t)~BOTTOM_BITS(8 - (n))) + +int cbs_get_utf8(CBS *cbs, uint32_t *out) { + uint8_t c; + if (!CBS_get_u8(cbs, &c)) { + return 0; + } + if (c <= 0x7f) { + *out = c; + return 1; + } + uint32_t v, lower_bound; + size_t len; + if ((c & TOP_BITS(3)) == TOP_BITS(2)) { + v = c & BOTTOM_BITS(5); + len = 1; + lower_bound = 0x80; + } else if ((c & TOP_BITS(4)) == TOP_BITS(3)) { + v = c & BOTTOM_BITS(4); + len = 2; + lower_bound = 0x800; + } else if ((c & TOP_BITS(5)) == TOP_BITS(4)) { + v = c & BOTTOM_BITS(3); + len = 3; + lower_bound = 0x10000; + } else { + return 0; + } + for (size_t i = 0; i < len; i++) { + if (!CBS_get_u8(cbs, &c) || + (c & TOP_BITS(2)) != TOP_BITS(1)) { + return 0; + } + v <<= 6; + v |= c & BOTTOM_BITS(6); + } + if (!is_valid_code_point(v) || + v < lower_bound) { + return 0; + } + *out = v; + return 1; +} + +int cbs_get_latin1(CBS *cbs, uint32_t *out) { + uint8_t c; + if (!CBS_get_u8(cbs, &c)) { + return 0; + } + *out = c; + return 1; +} + +int cbs_get_ucs2_be(CBS *cbs, uint32_t *out) { + // Note UCS-2 (used by BMPString) does not support surrogates. + uint16_t c; + if (!CBS_get_u16(cbs, &c) || + !is_valid_code_point(c)) { + return 0; + } + *out = c; + return 1; +} + +int cbs_get_utf32_be(CBS *cbs, uint32_t *out) { + return CBS_get_u32(cbs, out) && is_valid_code_point(*out); +} + +size_t cbb_get_utf8_len(uint32_t u) { + if (u <= 0x7f) { + return 1; + } + if (u <= 0x7ff) { + return 2; + } + if (u <= 0xffff) { + return 3; + } + return 4; +} + +int cbb_add_utf8(CBB *cbb, uint32_t u) { + if (!is_valid_code_point(u)) { + return 0; + } + if (u <= 0x7f) { + return CBB_add_u8(cbb, (uint8_t)u); + } + if (u <= 0x7ff) { + return CBB_add_u8(cbb, TOP_BITS(2) | (u >> 6)) && + CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); + } + if (u <= 0xffff) { + return CBB_add_u8(cbb, TOP_BITS(3) | (u >> 12)) && + CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && + CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); + } + if (u <= 0x10ffff) { + return CBB_add_u8(cbb, TOP_BITS(4) | (u >> 18)) && + CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 12) & BOTTOM_BITS(6))) && + CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && + CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); + } + return 0; +} + +int cbb_add_latin1(CBB *cbb, uint32_t u) { + return u <= 0xff && CBB_add_u8(cbb, (uint8_t)u); +} + +int cbb_add_ucs2_be(CBB *cbb, uint32_t u) { + return u <= 0xffff && is_valid_code_point(u) && CBB_add_u16(cbb, (uint16_t)u); +} + +int cbb_add_utf32_be(CBB *cbb, uint32_t u) { + return is_valid_code_point(u) && CBB_add_u32(cbb, u); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c.grpc_back new file mode 100644 index 000000000..6f9467f9c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/bytestring/unicode.c.grpc_back @@ -0,0 +1,155 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include "internal.h" + + +static int is_valid_code_point(uint32_t v) { + // References in the following are to Unicode 9.0.0. + if (// The Unicode space runs from zero to 0x10ffff (3.4 D9). + v > 0x10ffff || + // Values 0x...fffe, 0x...ffff, and 0xfdd0-0xfdef are permanently reserved + // (3.4 D14) + (v & 0xfffe) == 0xfffe || + (v >= 0xfdd0 && v <= 0xfdef) || + // Surrogate code points are invalid (3.2 C1). + (v >= 0xd800 && v <= 0xdfff)) { + return 0; + } + return 1; +} + +// BOTTOM_BITS returns a byte with the bottom |n| bits set. +#define BOTTOM_BITS(n) (uint8_t)((1u << (n)) - 1) + +// TOP_BITS returns a byte with the top |n| bits set. +#define TOP_BITS(n) ((uint8_t)~BOTTOM_BITS(8 - (n))) + +int cbs_get_utf8(CBS *cbs, uint32_t *out) { + uint8_t c; + if (!CBS_get_u8(cbs, &c)) { + return 0; + } + if (c <= 0x7f) { + *out = c; + return 1; + } + uint32_t v, lower_bound; + size_t len; + if ((c & TOP_BITS(3)) == TOP_BITS(2)) { + v = c & BOTTOM_BITS(5); + len = 1; + lower_bound = 0x80; + } else if ((c & TOP_BITS(4)) == TOP_BITS(3)) { + v = c & BOTTOM_BITS(4); + len = 2; + lower_bound = 0x800; + } else if ((c & TOP_BITS(5)) == TOP_BITS(4)) { + v = c & BOTTOM_BITS(3); + len = 3; + lower_bound = 0x10000; + } else { + return 0; + } + for (size_t i = 0; i < len; i++) { + if (!CBS_get_u8(cbs, &c) || + (c & TOP_BITS(2)) != TOP_BITS(1)) { + return 0; + } + v <<= 6; + v |= c & BOTTOM_BITS(6); + } + if (!is_valid_code_point(v) || + v < lower_bound) { + return 0; + } + *out = v; + return 1; +} + +int cbs_get_latin1(CBS *cbs, uint32_t *out) { + uint8_t c; + if (!CBS_get_u8(cbs, &c)) { + return 0; + } + *out = c; + return 1; +} + +int cbs_get_ucs2_be(CBS *cbs, uint32_t *out) { + // Note UCS-2 (used by BMPString) does not support surrogates. + uint16_t c; + if (!CBS_get_u16(cbs, &c) || + !is_valid_code_point(c)) { + return 0; + } + *out = c; + return 1; +} + +int cbs_get_utf32_be(CBS *cbs, uint32_t *out) { + return CBS_get_u32(cbs, out) && is_valid_code_point(*out); +} + +size_t cbb_get_utf8_len(uint32_t u) { + if (u <= 0x7f) { + return 1; + } + if (u <= 0x7ff) { + return 2; + } + if (u <= 0xffff) { + return 3; + } + return 4; +} + +int cbb_add_utf8(CBB *cbb, uint32_t u) { + if (!is_valid_code_point(u)) { + return 0; + } + if (u <= 0x7f) { + return CBB_add_u8(cbb, (uint8_t)u); + } + if (u <= 0x7ff) { + return CBB_add_u8(cbb, TOP_BITS(2) | (u >> 6)) && + CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); + } + if (u <= 0xffff) { + return CBB_add_u8(cbb, TOP_BITS(3) | (u >> 12)) && + CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && + CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); + } + if (u <= 0x10ffff) { + return CBB_add_u8(cbb, TOP_BITS(4) | (u >> 18)) && + CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 12) & BOTTOM_BITS(6))) && + CBB_add_u8(cbb, TOP_BITS(1) | ((u >> 6) & BOTTOM_BITS(6))) && + CBB_add_u8(cbb, TOP_BITS(1) | (u & BOTTOM_BITS(6))); + } + return 0; +} + +int cbb_add_latin1(CBB *cbb, uint32_t u) { + return u <= 0xff && CBB_add_u8(cbb, (uint8_t)u); +} + +int cbb_add_ucs2_be(CBB *cbb, uint32_t u) { + return u <= 0xffff && is_valid_code_point(u) && CBB_add_u16(cbb, (uint16_t)u); +} + +int cbb_add_utf32_be(CBB *cbb, uint32_t u) { + return is_valid_code_point(u) && CBB_add_u32(cbb, u); +} diff --git a/Pods/BoringSSL-GRPC/crypto/chacha/chacha.c b/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/chacha/chacha.c rename to Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c index 6bbc087e8..0b382bf2e 100644 --- a/Pods/BoringSSL-GRPC/crypto/chacha/chacha.c +++ b/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c @@ -22,19 +22,49 @@ #include #include "../internal.h" +#include "internal.h" #define U8TO32_LITTLE(p) \ (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \ ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24)) -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +// sigma contains the ChaCha constants, which happen to be an ASCII string. +static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', + '2', '-', 'b', 'y', 't', 'e', ' ', 'k' }; + +#define ROTATE(v, n) (((v) << (n)) | ((v) >> (32 - (n)))) + +// QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. +#define QUARTERROUND(a, b, c, d) \ + x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 16); \ + x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 12); \ + x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 8); \ + x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 7); -// ChaCha20_ctr32 is defined in asm/chacha-*.pl. -void ChaCha20_ctr32(uint8_t *out, const uint8_t *in, size_t in_len, - const uint32_t key[8], const uint32_t counter[4]); +void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32], + const uint8_t nonce[16]) { + uint32_t x[16]; + OPENSSL_memcpy(x, sigma, sizeof(sigma)); + OPENSSL_memcpy(&x[4], key, 32); + OPENSSL_memcpy(&x[12], nonce, 16); + + for (size_t i = 0; i < 20; i += 2) { + QUARTERROUND(0, 4, 8, 12) + QUARTERROUND(1, 5, 9, 13) + QUARTERROUND(2, 6, 10, 14) + QUARTERROUND(3, 7, 11, 15) + QUARTERROUND(0, 5, 10, 15) + QUARTERROUND(1, 6, 11, 12) + QUARTERROUND(2, 7, 8, 13) + QUARTERROUND(3, 4, 9, 14) + } + + OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4); + OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4); +} + +#if defined(CHACHA20_ASM) void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len, const uint8_t key[32], const uint8_t nonce[12], @@ -69,12 +99,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len, #else -// sigma contains the ChaCha constants, which happen to be an ASCII string. -static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', - '2', '-', 'b', 'y', 't', 'e', ' ', 'k' }; - -#define ROTATE(v, n) (((v) << (n)) | ((v) >> (32 - (n)))) - #define U32TO8_LITTLE(p, v) \ { \ (p)[0] = (v >> 0) & 0xff; \ @@ -83,13 +107,6 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', (p)[3] = (v >> 24) & 0xff; \ } -// QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. -#define QUARTERROUND(a, b, c, d) \ - x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 16); \ - x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 12); \ - x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 8); \ - x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 7); - // chacha_core performs 20 rounds of ChaCha on the input words in // |input| and writes the 64 output bytes to |output|. static void chacha_core(uint8_t output[64], const uint32_t input[16]) { diff --git a/Pods/BoringSSL-GRPC/crypto/chacha/chacha.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c.grpc_back similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/chacha/chacha.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c.grpc_back index 646ef7a6c..b539f9987 100644 --- a/Pods/BoringSSL-GRPC/crypto/chacha/chacha.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/chacha/chacha.c.grpc_back @@ -22,19 +22,49 @@ #include #include "../internal.h" +#include "internal.h" #define U8TO32_LITTLE(p) \ (((uint32_t)((p)[0])) | ((uint32_t)((p)[1]) << 8) | \ ((uint32_t)((p)[2]) << 16) | ((uint32_t)((p)[3]) << 24)) -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +// sigma contains the ChaCha constants, which happen to be an ASCII string. +static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', + '2', '-', 'b', 'y', 't', 'e', ' ', 'k' }; + +#define ROTATE(v, n) (((v) << (n)) | ((v) >> (32 - (n)))) + +// QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. +#define QUARTERROUND(a, b, c, d) \ + x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 16); \ + x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 12); \ + x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 8); \ + x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 7); -// ChaCha20_ctr32 is defined in asm/chacha-*.pl. -void ChaCha20_ctr32(uint8_t *out, const uint8_t *in, size_t in_len, - const uint32_t key[8], const uint32_t counter[4]); +void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32], + const uint8_t nonce[16]) { + uint32_t x[16]; + OPENSSL_memcpy(x, sigma, sizeof(sigma)); + OPENSSL_memcpy(&x[4], key, 32); + OPENSSL_memcpy(&x[12], nonce, 16); + + for (size_t i = 0; i < 20; i += 2) { + QUARTERROUND(0, 4, 8, 12) + QUARTERROUND(1, 5, 9, 13) + QUARTERROUND(2, 6, 10, 14) + QUARTERROUND(3, 7, 11, 15) + QUARTERROUND(0, 5, 10, 15) + QUARTERROUND(1, 6, 11, 12) + QUARTERROUND(2, 7, 8, 13) + QUARTERROUND(3, 4, 9, 14) + } + + OPENSSL_memcpy(out, &x[0], sizeof(uint32_t) * 4); + OPENSSL_memcpy(&out[16], &x[12], sizeof(uint32_t) * 4); +} + +#if defined(CHACHA20_ASM) void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len, const uint8_t key[32], const uint8_t nonce[12], @@ -69,12 +99,6 @@ void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, size_t in_len, #else -// sigma contains the ChaCha constants, which happen to be an ASCII string. -static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', - '2', '-', 'b', 'y', 't', 'e', ' ', 'k' }; - -#define ROTATE(v, n) (((v) << (n)) | ((v) >> (32 - (n)))) - #define U32TO8_LITTLE(p, v) \ { \ (p)[0] = (v >> 0) & 0xff; \ @@ -83,13 +107,6 @@ static const uint8_t sigma[16] = { 'e', 'x', 'p', 'a', 'n', 'd', ' ', '3', (p)[3] = (v >> 24) & 0xff; \ } -// QUARTERROUND updates a, b, c, d with a ChaCha "quarter" round. -#define QUARTERROUND(a, b, c, d) \ - x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 16); \ - x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 12); \ - x[a] += x[b]; x[d] = ROTATE(x[d] ^ x[a], 8); \ - x[c] += x[d]; x[b] = ROTATE(x[b] ^ x[c], 7); - // chacha_core performs 20 rounds of ChaCha on the input words in // |input| and writes the 64 output bytes to |output|. static void chacha_core(uint8_t output[64], const uint32_t input[16]) { diff --git a/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h b/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h new file mode 100644 index 000000000..5dbb97b73 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CHACHA_INTERNAL +#define OPENSSL_HEADER_CHACHA_INTERNAL + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CRYPTO_hchacha20 computes the HChaCha20 function, which should only be used +// as part of XChaCha20. +void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32], + const uint8_t nonce[16]); + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +#define CHACHA20_ASM + +// ChaCha20_ctr32 is defined in asm/chacha-*.pl. +void ChaCha20_ctr32(uint8_t *out, const uint8_t *in, size_t in_len, + const uint32_t key[8], const uint32_t counter[4]); +#endif + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CHACHA_INTERNAL diff --git a/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h.grpc_back new file mode 100644 index 000000000..1435e3b01 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/chacha/internal.h.grpc_back @@ -0,0 +1,45 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CHACHA_INTERNAL +#define OPENSSL_HEADER_CHACHA_INTERNAL + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CRYPTO_hchacha20 computes the HChaCha20 function, which should only be used +// as part of XChaCha20. +void CRYPTO_hchacha20(uint8_t out[32], const uint8_t key[32], + const uint8_t nonce[16]); + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +#define CHACHA20_ASM + +// ChaCha20_ctr32 is defined in asm/chacha-*.pl. +void ChaCha20_ctr32(uint8_t *out, const uint8_t *in, size_t in_len, + const uint32_t key[8], const uint32_t counter[4]); +#endif + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CHACHA_INTERNAL diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/cipher_extra.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c similarity index 77% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/cipher_extra.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c index d322dc657..4bfb52a7c 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/cipher_extra.c +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c @@ -94,20 +94,49 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name) { } else if (OPENSSL_strcasecmp(name, "des-cbc") == 0) { return EVP_des_cbc(); } else if (OPENSSL_strcasecmp(name, "des-ede3-cbc") == 0 || + // This is not a name used by OpenSSL, but tcpdump registers it + // with |EVP_add_cipher_alias|. Our |EVP_add_cipher_alias| is a + // no-op, so we support the name here. OPENSSL_strcasecmp(name, "3des") == 0) { return EVP_des_ede3_cbc(); } else if (OPENSSL_strcasecmp(name, "aes-128-cbc") == 0) { return EVP_aes_128_cbc(); + } else if (OPENSSL_strcasecmp(name, "aes-192-cbc") == 0) { + return EVP_aes_192_cbc(); } else if (OPENSSL_strcasecmp(name, "aes-256-cbc") == 0) { return EVP_aes_256_cbc(); } else if (OPENSSL_strcasecmp(name, "aes-128-ctr") == 0) { return EVP_aes_128_ctr(); + } else if (OPENSSL_strcasecmp(name, "aes-192-ctr") == 0) { + return EVP_aes_192_ctr(); } else if (OPENSSL_strcasecmp(name, "aes-256-ctr") == 0) { return EVP_aes_256_ctr(); } else if (OPENSSL_strcasecmp(name, "aes-128-ecb") == 0) { return EVP_aes_128_ecb(); + } else if (OPENSSL_strcasecmp(name, "aes-192-ecb") == 0) { + return EVP_aes_192_ecb(); } else if (OPENSSL_strcasecmp(name, "aes-256-ecb") == 0) { return EVP_aes_256_ecb(); + } else if (OPENSSL_strcasecmp(name, "aes-128-gcm") == 0) { + return EVP_aes_128_gcm(); + } else if (OPENSSL_strcasecmp(name, "aes-192-gcm") == 0) { + return EVP_aes_192_gcm(); + } else if (OPENSSL_strcasecmp(name, "aes-256-gcm") == 0) { + return EVP_aes_256_gcm(); + } else if (OPENSSL_strcasecmp(name, "aes-128-ofb") == 0) { + return EVP_aes_128_ofb(); + } else if (OPENSSL_strcasecmp(name, "aes-192-ofb") == 0) { + return EVP_aes_192_ofb(); + } else if (OPENSSL_strcasecmp(name, "aes-256-ofb") == 0) { + return EVP_aes_256_ofb(); + } else if (OPENSSL_strcasecmp(name, "des-ecb") == 0) { + return EVP_des_ecb(); + } else if (OPENSSL_strcasecmp(name, "des-ede") == 0) { + return EVP_des_ede(); + } else if (OPENSSL_strcasecmp(name, "des-ede-cbc") == 0) { + return EVP_des_ede_cbc(); + } else if (OPENSSL_strcasecmp(name, "rc2-cbc") == 0) { + return EVP_rc2_cbc(); } return NULL; diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/cipher_extra.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/cipher_extra.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c.grpc_back index fc8e24b65..b132265bc 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/cipher_extra.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/cipher_extra.c.grpc_back @@ -94,20 +94,49 @@ const EVP_CIPHER *EVP_get_cipherbyname(const char *name) { } else if (OPENSSL_strcasecmp(name, "des-cbc") == 0) { return EVP_des_cbc(); } else if (OPENSSL_strcasecmp(name, "des-ede3-cbc") == 0 || + // This is not a name used by OpenSSL, but tcpdump registers it + // with |EVP_add_cipher_alias|. Our |EVP_add_cipher_alias| is a + // no-op, so we support the name here. OPENSSL_strcasecmp(name, "3des") == 0) { return EVP_des_ede3_cbc(); } else if (OPENSSL_strcasecmp(name, "aes-128-cbc") == 0) { return EVP_aes_128_cbc(); + } else if (OPENSSL_strcasecmp(name, "aes-192-cbc") == 0) { + return EVP_aes_192_cbc(); } else if (OPENSSL_strcasecmp(name, "aes-256-cbc") == 0) { return EVP_aes_256_cbc(); } else if (OPENSSL_strcasecmp(name, "aes-128-ctr") == 0) { return EVP_aes_128_ctr(); + } else if (OPENSSL_strcasecmp(name, "aes-192-ctr") == 0) { + return EVP_aes_192_ctr(); } else if (OPENSSL_strcasecmp(name, "aes-256-ctr") == 0) { return EVP_aes_256_ctr(); } else if (OPENSSL_strcasecmp(name, "aes-128-ecb") == 0) { return EVP_aes_128_ecb(); + } else if (OPENSSL_strcasecmp(name, "aes-192-ecb") == 0) { + return EVP_aes_192_ecb(); } else if (OPENSSL_strcasecmp(name, "aes-256-ecb") == 0) { return EVP_aes_256_ecb(); + } else if (OPENSSL_strcasecmp(name, "aes-128-gcm") == 0) { + return EVP_aes_128_gcm(); + } else if (OPENSSL_strcasecmp(name, "aes-192-gcm") == 0) { + return EVP_aes_192_gcm(); + } else if (OPENSSL_strcasecmp(name, "aes-256-gcm") == 0) { + return EVP_aes_256_gcm(); + } else if (OPENSSL_strcasecmp(name, "aes-128-ofb") == 0) { + return EVP_aes_128_ofb(); + } else if (OPENSSL_strcasecmp(name, "aes-192-ofb") == 0) { + return EVP_aes_192_ofb(); + } else if (OPENSSL_strcasecmp(name, "aes-256-ofb") == 0) { + return EVP_aes_256_ofb(); + } else if (OPENSSL_strcasecmp(name, "des-ecb") == 0) { + return EVP_des_ecb(); + } else if (OPENSSL_strcasecmp(name, "des-ede") == 0) { + return EVP_des_ede(); + } else if (OPENSSL_strcasecmp(name, "des-ede-cbc") == 0) { + return EVP_des_ede_cbc(); + } else if (OPENSSL_strcasecmp(name, "rc2-cbc") == 0) { + return EVP_rc2_cbc(); } return NULL; diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/derive_key.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/derive_key.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/derive_key.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/derive_key.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/derive_key.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c new file mode 100644 index 000000000..a13bc99d1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c @@ -0,0 +1,447 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include + +#include +#include +#include +#include + +#include "../fipsmodule/cipher/internal.h" + + +struct ccm128_context { + block128_f block; + ctr128_f ctr; + unsigned M, L; +}; + +struct ccm128_state { + union { + uint64_t u[2]; + uint8_t c[16]; + } nonce, cmac; +}; + +static int CRYPTO_ccm128_init(struct ccm128_context *ctx, const AES_KEY *key, + block128_f block, ctr128_f ctr, unsigned M, + unsigned L) { + if (M < 4 || M > 16 || (M & 1) != 0 || L < 2 || L > 8) { + return 0; + } + ctx->block = block; + ctx->ctr = ctr; + ctx->M = M; + ctx->L = L; + return 1; +} + +static size_t CRYPTO_ccm128_max_input(const struct ccm128_context *ctx) { + return ctx->L >= sizeof(size_t) ? (size_t)-1 + : (((size_t)1) << (ctx->L * 8)) - 1; +} + +static int ccm128_init_state(const struct ccm128_context *ctx, + struct ccm128_state *state, const AES_KEY *key, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *aad, size_t aad_len, + size_t plaintext_len) { + const block128_f block = ctx->block; + const unsigned M = ctx->M; + const unsigned L = ctx->L; + + // |L| determines the expected |nonce_len| and the limit for |plaintext_len|. + if (plaintext_len > CRYPTO_ccm128_max_input(ctx) || + nonce_len != 15 - L) { + return 0; + } + + // Assemble the first block for computing the MAC. + OPENSSL_memset(state, 0, sizeof(*state)); + state->nonce.c[0] = (uint8_t)((L - 1) | ((M - 2) / 2) << 3); + if (aad_len != 0) { + state->nonce.c[0] |= 0x40; // Set AAD Flag + } + OPENSSL_memcpy(&state->nonce.c[1], nonce, nonce_len); + for (unsigned i = 0; i < L; i++) { + state->nonce.c[15 - i] = (uint8_t)(plaintext_len >> (8 * i)); + } + + (*block)(state->nonce.c, state->cmac.c, key); + size_t blocks = 1; + + if (aad_len != 0) { + unsigned i; + // Cast to u64 to avoid the compiler complaining about invalid shifts. + uint64_t aad_len_u64 = aad_len; + if (aad_len_u64 < 0x10000 - 0x100) { + state->cmac.c[0] ^= (uint8_t)(aad_len_u64 >> 8); + state->cmac.c[1] ^= (uint8_t)aad_len_u64; + i = 2; + } else if (aad_len_u64 <= 0xffffffff) { + state->cmac.c[0] ^= 0xff; + state->cmac.c[1] ^= 0xfe; + state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 24); + state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 16); + state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 8); + state->cmac.c[5] ^= (uint8_t)aad_len_u64; + i = 6; + } else { + state->cmac.c[0] ^= 0xff; + state->cmac.c[1] ^= 0xff; + state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 56); + state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 48); + state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 40); + state->cmac.c[5] ^= (uint8_t)(aad_len_u64 >> 32); + state->cmac.c[6] ^= (uint8_t)(aad_len_u64 >> 24); + state->cmac.c[7] ^= (uint8_t)(aad_len_u64 >> 16); + state->cmac.c[8] ^= (uint8_t)(aad_len_u64 >> 8); + state->cmac.c[9] ^= (uint8_t)aad_len_u64; + i = 10; + } + + do { + for (; i < 16 && aad_len != 0; i++) { + state->cmac.c[i] ^= *aad; + aad++; + aad_len--; + } + (*block)(state->cmac.c, state->cmac.c, key); + blocks++; + i = 0; + } while (aad_len != 0); + } + + // Per RFC 3610, section 2.6, the total number of block cipher operations done + // must not exceed 2^61. There are two block cipher operations remaining per + // message block, plus one block at the end to encrypt the MAC. + size_t remaining_blocks = 2 * ((plaintext_len + 15) / 16) + 1; + if (plaintext_len + 15 < plaintext_len || + remaining_blocks + blocks < blocks || + (uint64_t) remaining_blocks + blocks > UINT64_C(1) << 61) { + return 0; + } + + // Assemble the first block for encrypting and decrypting. The bottom |L| + // bytes are replaced with a counter and all bit the encoding of |L| is + // cleared in the first byte. + state->nonce.c[0] &= 7; + return 1; +} + +static int ccm128_encrypt(const struct ccm128_context *ctx, + struct ccm128_state *state, const AES_KEY *key, + uint8_t *out, const uint8_t *in, size_t len) { + // The counter for encryption begins at one. + for (unsigned i = 0; i < ctx->L; i++) { + state->nonce.c[15 - i] = 0; + } + state->nonce.c[15] = 1; + + uint8_t partial_buf[16]; + unsigned num = 0; + if (ctx->ctr != NULL) { + CRYPTO_ctr128_encrypt_ctr32(in, out, len, key, state->nonce.c, partial_buf, + &num, ctx->ctr); + } else { + CRYPTO_ctr128_encrypt(in, out, len, key, state->nonce.c, partial_buf, &num, + ctx->block); + } + return 1; +} + +static int ccm128_compute_mac(const struct ccm128_context *ctx, + struct ccm128_state *state, const AES_KEY *key, + uint8_t *out_tag, size_t tag_len, + const uint8_t *in, size_t len) { + block128_f block = ctx->block; + if (tag_len != ctx->M) { + return 0; + } + + // Incorporate |in| into the MAC. + union { + uint64_t u[2]; + uint8_t c[16]; + } tmp; + while (len >= 16) { + OPENSSL_memcpy(tmp.c, in, 16); + state->cmac.u[0] ^= tmp.u[0]; + state->cmac.u[1] ^= tmp.u[1]; + (*block)(state->cmac.c, state->cmac.c, key); + in += 16; + len -= 16; + } + if (len > 0) { + for (size_t i = 0; i < len; i++) { + state->cmac.c[i] ^= in[i]; + } + (*block)(state->cmac.c, state->cmac.c, key); + } + + // Encrypt the MAC with counter zero. + for (unsigned i = 0; i < ctx->L; i++) { + state->nonce.c[15 - i] = 0; + } + (*block)(state->nonce.c, tmp.c, key); + state->cmac.u[0] ^= tmp.u[0]; + state->cmac.u[1] ^= tmp.u[1]; + + OPENSSL_memcpy(out_tag, state->cmac.c, tag_len); + return 1; +} + +static int CRYPTO_ccm128_encrypt(const struct ccm128_context *ctx, + const AES_KEY *key, uint8_t *out, + uint8_t *out_tag, size_t tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t len, + const uint8_t *aad, size_t aad_len) { + struct ccm128_state state; + return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, + len) && + ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, in, len) && + ccm128_encrypt(ctx, &state, key, out, in, len); +} + +static int CRYPTO_ccm128_decrypt(const struct ccm128_context *ctx, + const AES_KEY *key, uint8_t *out, + uint8_t *out_tag, size_t tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t len, + const uint8_t *aad, size_t aad_len) { + struct ccm128_state state; + return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, + len) && + ccm128_encrypt(ctx, &state, key, out, in, len) && + ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, out, len); +} + +#define EVP_AEAD_AES_CCM_MAX_TAG_LEN 16 + +struct aead_aes_ccm_ctx { + union { + double align; + AES_KEY ks; + } ks; + struct ccm128_context ccm; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_ccm_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_ccm_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_ccm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len, unsigned M, + unsigned L) { + assert(M == EVP_AEAD_max_overhead(ctx->aead)); + assert(M == EVP_AEAD_max_tag_len(ctx->aead)); + assert(15 - L == EVP_AEAD_nonce_length(ctx->aead)); + + if (key_len != EVP_AEAD_key_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); + return 0; // EVP_AEAD_CTX_init should catch this. + } + + if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { + tag_len = M; + } + + if (tag_len != M) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + struct aead_aes_ccm_ctx *ccm_ctx = (struct aead_aes_ccm_ctx *)&ctx->state; + + block128_f block; + ctr128_f ctr = aes_ctr_set_key(&ccm_ctx->ks.ks, NULL, &block, key, key_len); + ctx->tag_len = tag_len; + if (!CRYPTO_ccm128_init(&ccm_ctx->ccm, &ccm_ctx->ks.ks, block, ctr, M, L)) { + OPENSSL_PUT_ERROR(CIPHER, ERR_R_INTERNAL_ERROR); + return 0; + } + + return 1; +} + +static void aead_aes_ccm_cleanup(EVP_AEAD_CTX *ctx) {} + +static int aead_aes_ccm_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + const struct aead_aes_ccm_ctx *ccm_ctx = + (struct aead_aes_ccm_ctx *)&ctx->state; + + if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (!CRYPTO_ccm128_encrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, out_tag, + ctx->tag_len, nonce, nonce_len, in, in_len, ad, + ad_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + *out_tag_len = ctx->tag_len; + return 1; +} + +static int aead_aes_ccm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *in_tag, size_t in_tag_len, + const uint8_t *ad, size_t ad_len) { + const struct aead_aes_ccm_ctx *ccm_ctx = + (struct aead_aes_ccm_ctx *)&ctx->state; + + if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (in_tag_len != ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + uint8_t tag[EVP_AEAD_AES_CCM_MAX_TAG_LEN]; + assert(ctx->tag_len <= EVP_AEAD_AES_CCM_MAX_TAG_LEN); + if (!CRYPTO_ccm128_decrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, tag, + ctx->tag_len, nonce, nonce_len, in, in_len, ad, + ad_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +static int aead_aes_ccm_bluetooth_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len) { + return aead_aes_ccm_init(ctx, key, key_len, tag_len, 4, 2); +} + +static const EVP_AEAD aead_aes_128_ccm_bluetooth = { + 16, // key length (AES-128) + 13, // nonce length + 4, // overhead + 4, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ccm_bluetooth_init, + NULL /* init_with_direction */, + aead_aes_ccm_cleanup, + NULL /* open */, + aead_aes_ccm_seal_scatter, + aead_aes_ccm_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth(void) { + return &aead_aes_128_ccm_bluetooth; +} + +static int aead_aes_ccm_bluetooth_8_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len) { + return aead_aes_ccm_init(ctx, key, key_len, tag_len, 8, 2); +} + +static const EVP_AEAD aead_aes_128_ccm_bluetooth_8 = { + 16, // key length (AES-128) + 13, // nonce length + 8, // overhead + 8, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ccm_bluetooth_8_init, + NULL /* init_with_direction */, + aead_aes_ccm_cleanup, + NULL /* open */, + aead_aes_ccm_seal_scatter, + aead_aes_ccm_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth_8(void) { + return &aead_aes_128_ccm_bluetooth_8; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c.grpc_back new file mode 100644 index 000000000..e9e9e16e1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesccm.c.grpc_back @@ -0,0 +1,447 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include + +#include +#include +#include +#include + +#include "../fipsmodule/cipher/internal.h" + + +struct ccm128_context { + block128_f block; + ctr128_f ctr; + unsigned M, L; +}; + +struct ccm128_state { + union { + uint64_t u[2]; + uint8_t c[16]; + } nonce, cmac; +}; + +static int CRYPTO_ccm128_init(struct ccm128_context *ctx, const AES_KEY *key, + block128_f block, ctr128_f ctr, unsigned M, + unsigned L) { + if (M < 4 || M > 16 || (M & 1) != 0 || L < 2 || L > 8) { + return 0; + } + ctx->block = block; + ctx->ctr = ctr; + ctx->M = M; + ctx->L = L; + return 1; +} + +static size_t CRYPTO_ccm128_max_input(const struct ccm128_context *ctx) { + return ctx->L >= sizeof(size_t) ? (size_t)-1 + : (((size_t)1) << (ctx->L * 8)) - 1; +} + +static int ccm128_init_state(const struct ccm128_context *ctx, + struct ccm128_state *state, const AES_KEY *key, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *aad, size_t aad_len, + size_t plaintext_len) { + const block128_f block = ctx->block; + const unsigned M = ctx->M; + const unsigned L = ctx->L; + + // |L| determines the expected |nonce_len| and the limit for |plaintext_len|. + if (plaintext_len > CRYPTO_ccm128_max_input(ctx) || + nonce_len != 15 - L) { + return 0; + } + + // Assemble the first block for computing the MAC. + OPENSSL_memset(state, 0, sizeof(*state)); + state->nonce.c[0] = (uint8_t)((L - 1) | ((M - 2) / 2) << 3); + if (aad_len != 0) { + state->nonce.c[0] |= 0x40; // Set AAD Flag + } + OPENSSL_memcpy(&state->nonce.c[1], nonce, nonce_len); + for (unsigned i = 0; i < L; i++) { + state->nonce.c[15 - i] = (uint8_t)(plaintext_len >> (8 * i)); + } + + (*block)(state->nonce.c, state->cmac.c, key); + size_t blocks = 1; + + if (aad_len != 0) { + unsigned i; + // Cast to u64 to avoid the compiler complaining about invalid shifts. + uint64_t aad_len_u64 = aad_len; + if (aad_len_u64 < 0x10000 - 0x100) { + state->cmac.c[0] ^= (uint8_t)(aad_len_u64 >> 8); + state->cmac.c[1] ^= (uint8_t)aad_len_u64; + i = 2; + } else if (aad_len_u64 <= 0xffffffff) { + state->cmac.c[0] ^= 0xff; + state->cmac.c[1] ^= 0xfe; + state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 24); + state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 16); + state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 8); + state->cmac.c[5] ^= (uint8_t)aad_len_u64; + i = 6; + } else { + state->cmac.c[0] ^= 0xff; + state->cmac.c[1] ^= 0xff; + state->cmac.c[2] ^= (uint8_t)(aad_len_u64 >> 56); + state->cmac.c[3] ^= (uint8_t)(aad_len_u64 >> 48); + state->cmac.c[4] ^= (uint8_t)(aad_len_u64 >> 40); + state->cmac.c[5] ^= (uint8_t)(aad_len_u64 >> 32); + state->cmac.c[6] ^= (uint8_t)(aad_len_u64 >> 24); + state->cmac.c[7] ^= (uint8_t)(aad_len_u64 >> 16); + state->cmac.c[8] ^= (uint8_t)(aad_len_u64 >> 8); + state->cmac.c[9] ^= (uint8_t)aad_len_u64; + i = 10; + } + + do { + for (; i < 16 && aad_len != 0; i++) { + state->cmac.c[i] ^= *aad; + aad++; + aad_len--; + } + (*block)(state->cmac.c, state->cmac.c, key); + blocks++; + i = 0; + } while (aad_len != 0); + } + + // Per RFC 3610, section 2.6, the total number of block cipher operations done + // must not exceed 2^61. There are two block cipher operations remaining per + // message block, plus one block at the end to encrypt the MAC. + size_t remaining_blocks = 2 * ((plaintext_len + 15) / 16) + 1; + if (plaintext_len + 15 < plaintext_len || + remaining_blocks + blocks < blocks || + (uint64_t) remaining_blocks + blocks > UINT64_C(1) << 61) { + return 0; + } + + // Assemble the first block for encrypting and decrypting. The bottom |L| + // bytes are replaced with a counter and all bit the encoding of |L| is + // cleared in the first byte. + state->nonce.c[0] &= 7; + return 1; +} + +static int ccm128_encrypt(const struct ccm128_context *ctx, + struct ccm128_state *state, const AES_KEY *key, + uint8_t *out, const uint8_t *in, size_t len) { + // The counter for encryption begins at one. + for (unsigned i = 0; i < ctx->L; i++) { + state->nonce.c[15 - i] = 0; + } + state->nonce.c[15] = 1; + + uint8_t partial_buf[16]; + unsigned num = 0; + if (ctx->ctr != NULL) { + CRYPTO_ctr128_encrypt_ctr32(in, out, len, key, state->nonce.c, partial_buf, + &num, ctx->ctr); + } else { + CRYPTO_ctr128_encrypt(in, out, len, key, state->nonce.c, partial_buf, &num, + ctx->block); + } + return 1; +} + +static int ccm128_compute_mac(const struct ccm128_context *ctx, + struct ccm128_state *state, const AES_KEY *key, + uint8_t *out_tag, size_t tag_len, + const uint8_t *in, size_t len) { + block128_f block = ctx->block; + if (tag_len != ctx->M) { + return 0; + } + + // Incorporate |in| into the MAC. + union { + uint64_t u[2]; + uint8_t c[16]; + } tmp; + while (len >= 16) { + OPENSSL_memcpy(tmp.c, in, 16); + state->cmac.u[0] ^= tmp.u[0]; + state->cmac.u[1] ^= tmp.u[1]; + (*block)(state->cmac.c, state->cmac.c, key); + in += 16; + len -= 16; + } + if (len > 0) { + for (size_t i = 0; i < len; i++) { + state->cmac.c[i] ^= in[i]; + } + (*block)(state->cmac.c, state->cmac.c, key); + } + + // Encrypt the MAC with counter zero. + for (unsigned i = 0; i < ctx->L; i++) { + state->nonce.c[15 - i] = 0; + } + (*block)(state->nonce.c, tmp.c, key); + state->cmac.u[0] ^= tmp.u[0]; + state->cmac.u[1] ^= tmp.u[1]; + + OPENSSL_memcpy(out_tag, state->cmac.c, tag_len); + return 1; +} + +static int CRYPTO_ccm128_encrypt(const struct ccm128_context *ctx, + const AES_KEY *key, uint8_t *out, + uint8_t *out_tag, size_t tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t len, + const uint8_t *aad, size_t aad_len) { + struct ccm128_state state; + return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, + len) && + ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, in, len) && + ccm128_encrypt(ctx, &state, key, out, in, len); +} + +static int CRYPTO_ccm128_decrypt(const struct ccm128_context *ctx, + const AES_KEY *key, uint8_t *out, + uint8_t *out_tag, size_t tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t len, + const uint8_t *aad, size_t aad_len) { + struct ccm128_state state; + return ccm128_init_state(ctx, &state, key, nonce, nonce_len, aad, aad_len, + len) && + ccm128_encrypt(ctx, &state, key, out, in, len) && + ccm128_compute_mac(ctx, &state, key, out_tag, tag_len, out, len); +} + +#define EVP_AEAD_AES_CCM_MAX_TAG_LEN 16 + +struct aead_aes_ccm_ctx { + union { + double align; + AES_KEY ks; + } ks; + struct ccm128_context ccm; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_ccm_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_ccm_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_ccm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len, unsigned M, + unsigned L) { + assert(M == EVP_AEAD_max_overhead(ctx->aead)); + assert(M == EVP_AEAD_max_tag_len(ctx->aead)); + assert(15 - L == EVP_AEAD_nonce_length(ctx->aead)); + + if (key_len != EVP_AEAD_key_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); + return 0; // EVP_AEAD_CTX_init should catch this. + } + + if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { + tag_len = M; + } + + if (tag_len != M) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + struct aead_aes_ccm_ctx *ccm_ctx = (struct aead_aes_ccm_ctx *)&ctx->state; + + block128_f block; + ctr128_f ctr = aes_ctr_set_key(&ccm_ctx->ks.ks, NULL, &block, key, key_len); + ctx->tag_len = tag_len; + if (!CRYPTO_ccm128_init(&ccm_ctx->ccm, &ccm_ctx->ks.ks, block, ctr, M, L)) { + OPENSSL_PUT_ERROR(CIPHER, ERR_R_INTERNAL_ERROR); + return 0; + } + + return 1; +} + +static void aead_aes_ccm_cleanup(EVP_AEAD_CTX *ctx) {} + +static int aead_aes_ccm_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + const struct aead_aes_ccm_ctx *ccm_ctx = + (struct aead_aes_ccm_ctx *)&ctx->state; + + if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (!CRYPTO_ccm128_encrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, out_tag, + ctx->tag_len, nonce, nonce_len, in, in_len, ad, + ad_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + *out_tag_len = ctx->tag_len; + return 1; +} + +static int aead_aes_ccm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *in_tag, size_t in_tag_len, + const uint8_t *ad, size_t ad_len) { + const struct aead_aes_ccm_ctx *ccm_ctx = + (struct aead_aes_ccm_ctx *)&ctx->state; + + if (in_len > CRYPTO_ccm128_max_input(&ccm_ctx->ccm)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (nonce_len != EVP_AEAD_nonce_length(ctx->aead)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (in_tag_len != ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + uint8_t tag[EVP_AEAD_AES_CCM_MAX_TAG_LEN]; + assert(ctx->tag_len <= EVP_AEAD_AES_CCM_MAX_TAG_LEN); + if (!CRYPTO_ccm128_decrypt(&ccm_ctx->ccm, &ccm_ctx->ks.ks, out, tag, + ctx->tag_len, nonce, nonce_len, in, in_len, ad, + ad_len)) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +static int aead_aes_ccm_bluetooth_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len) { + return aead_aes_ccm_init(ctx, key, key_len, tag_len, 4, 2); +} + +static const EVP_AEAD aead_aes_128_ccm_bluetooth = { + 16, // key length (AES-128) + 13, // nonce length + 4, // overhead + 4, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ccm_bluetooth_init, + NULL /* init_with_direction */, + aead_aes_ccm_cleanup, + NULL /* open */, + aead_aes_ccm_seal_scatter, + aead_aes_ccm_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth(void) { + return &aead_aes_128_ccm_bluetooth; +} + +static int aead_aes_ccm_bluetooth_8_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len) { + return aead_aes_ccm_init(ctx, key, key_len, tag_len, 8, 2); +} + +static const EVP_AEAD aead_aes_128_ccm_bluetooth_8 = { + 16, // key length (AES-128) + 13, // nonce length + 8, // overhead + 8, // max tag length + 0, // seal_scatter_supports_extra_in + + aead_aes_ccm_bluetooth_8_init, + NULL /* init_with_direction */, + aead_aes_ccm_cleanup, + NULL /* open */, + aead_aes_ccm_seal_scatter, + aead_aes_ccm_open_gather, + NULL /* get_iv */, + NULL /* tag_len */, +}; + +const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth_8(void) { + return &aead_aes_128_ccm_bluetooth_8; +} diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesctrhmac.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesctrhmac.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c index fc8125ee3..e3daec44c 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesctrhmac.c +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c @@ -35,6 +35,15 @@ struct aead_aes_ctr_hmac_sha256_ctx { SHA256_CTX outer_init_state; }; +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_ctr_hmac_sha256_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_ctr_hmac_sha256_ctx), + "AEAD state has insufficient alignment"); +#endif + static void hmac_init(SHA256_CTX *out_inner, SHA256_CTX *out_outer, const uint8_t hmac_key[32]) { static const size_t hmac_key_len = 32; @@ -61,7 +70,8 @@ static void hmac_init(SHA256_CTX *out_inner, SHA256_CTX *out_outer, static int aead_aes_ctr_hmac_sha256_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len) { - struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx; + struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = + (struct aead_aes_ctr_hmac_sha256_ctx *)&ctx->state; static const size_t hmac_key_len = 32; if (key_len < hmac_key_len) { @@ -84,26 +94,16 @@ static int aead_aes_ctr_hmac_sha256_init(EVP_AEAD_CTX *ctx, const uint8_t *key, return 0; } - aes_ctx = OPENSSL_malloc(sizeof(struct aead_aes_ctr_hmac_sha256_ctx)); - if (aes_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } - aes_ctx->ctr = aes_ctr_set_key(&aes_ctx->ks.ks, NULL, &aes_ctx->block, key, aes_key_len); ctx->tag_len = tag_len; hmac_init(&aes_ctx->inner_init_state, &aes_ctx->outer_init_state, key + aes_key_len); - ctx->aead_state = aes_ctx; - return 1; } -static void aead_aes_ctr_hmac_sha256_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} +static void aead_aes_ctr_hmac_sha256_cleanup(EVP_AEAD_CTX *ctx) {} static void hmac_update_uint64(SHA256_CTX *sha256, uint64_t value) { unsigned i; @@ -178,7 +178,8 @@ static int aead_aes_ctr_hmac_sha256_seal_scatter( size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = ctx->aead_state; + const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = + (struct aead_aes_ctr_hmac_sha256_ctx *) &ctx->state; const uint64_t in_len_64 = in_len; if (in_len_64 >= (UINT64_C(1) << 32) * AES_BLOCK_SIZE) { @@ -212,7 +213,8 @@ static int aead_aes_ctr_hmac_sha256_open_gather( const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, size_t in_tag_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = ctx->aead_state; + const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = + (struct aead_aes_ctr_hmac_sha256_ctx *) &ctx->state; if (in_tag_len != ctx->tag_len) { OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesctrhmac.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesctrhmac.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c.grpc_back index 3a0de9b15..8c45c8111 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesctrhmac.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesctrhmac.c.grpc_back @@ -35,6 +35,15 @@ struct aead_aes_ctr_hmac_sha256_ctx { SHA256_CTX outer_init_state; }; +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_ctr_hmac_sha256_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_ctr_hmac_sha256_ctx), + "AEAD state has insufficient alignment"); +#endif + static void hmac_init(SHA256_CTX *out_inner, SHA256_CTX *out_outer, const uint8_t hmac_key[32]) { static const size_t hmac_key_len = 32; @@ -61,7 +70,8 @@ static void hmac_init(SHA256_CTX *out_inner, SHA256_CTX *out_outer, static int aead_aes_ctr_hmac_sha256_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len) { - struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx; + struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = + (struct aead_aes_ctr_hmac_sha256_ctx *)&ctx->state; static const size_t hmac_key_len = 32; if (key_len < hmac_key_len) { @@ -84,26 +94,16 @@ static int aead_aes_ctr_hmac_sha256_init(EVP_AEAD_CTX *ctx, const uint8_t *key, return 0; } - aes_ctx = OPENSSL_malloc(sizeof(struct aead_aes_ctr_hmac_sha256_ctx)); - if (aes_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } - aes_ctx->ctr = aes_ctr_set_key(&aes_ctx->ks.ks, NULL, &aes_ctx->block, key, aes_key_len); ctx->tag_len = tag_len; hmac_init(&aes_ctx->inner_init_state, &aes_ctx->outer_init_state, key + aes_key_len); - ctx->aead_state = aes_ctx; - return 1; } -static void aead_aes_ctr_hmac_sha256_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} +static void aead_aes_ctr_hmac_sha256_cleanup(EVP_AEAD_CTX *ctx) {} static void hmac_update_uint64(SHA256_CTX *sha256, uint64_t value) { unsigned i; @@ -178,7 +178,8 @@ static int aead_aes_ctr_hmac_sha256_seal_scatter( size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = ctx->aead_state; + const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = + (struct aead_aes_ctr_hmac_sha256_ctx *) &ctx->state; const uint64_t in_len_64 = in_len; if (in_len_64 >= (UINT64_C(1) << 32) * AES_BLOCK_SIZE) { @@ -212,7 +213,8 @@ static int aead_aes_ctr_hmac_sha256_open_gather( const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, size_t in_tag_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = ctx->aead_state; + const struct aead_aes_ctr_hmac_sha256_ctx *aes_ctx = + (struct aead_aes_ctr_hmac_sha256_ctx *) &ctx->state; if (in_tag_len != ctx->tag_len) { OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesgcmsiv.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c similarity index 90% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesgcmsiv.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c index b1021f75c..9c7e47154 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesgcmsiv.c +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c @@ -27,28 +27,47 @@ #define EVP_AEAD_AES_GCM_SIV_NONCE_LEN 12 #define EVP_AEAD_AES_GCM_SIV_TAG_LEN 16 -#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) +// TODO(davidben): AES-GCM-SIV assembly is not correct for Windows. It must save +// and restore xmm6 through xmm15. +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ + !defined(OPENSSL_WINDOWS) +#define AES_GCM_SIV_ASM // Optimised AES-GCM-SIV struct aead_aes_gcm_siv_asm_ctx { alignas(16) uint8_t key[16*15]; int is_128_bit; - // ptr contains the original pointer from |OPENSSL_malloc|, which may only be - // 8-byte aligned. When freeing this structure, actually call |OPENSSL_free| - // on this pointer. - void *ptr; }; +// The assembly code assumes 8-byte alignment of the EVP_AEAD_CTX's state, and +// aligns to 16 bytes itself. +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) + 8 >= + sizeof(struct aead_aes_gcm_siv_asm_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= 8, + "AEAD state has insufficient alignment"); +#endif + +// asm_ctx_from_ctx returns a 16-byte aligned context pointer from |ctx|. +static struct aead_aes_gcm_siv_asm_ctx *asm_ctx_from_ctx( + const EVP_AEAD_CTX *ctx) { + // ctx->state must already be 8-byte aligned. Thus, at most, we may need to + // add eight to align it to 16 bytes. + const uintptr_t offset = ((uintptr_t)&ctx->state) & 8; + return (struct aead_aes_gcm_siv_asm_ctx *)(&ctx->state.opaque[offset]); +} + // aes128gcmsiv_aes_ks writes an AES-128 key schedule for |key| to // |out_expanded_key|. extern void aes128gcmsiv_aes_ks( const uint8_t key[16], uint8_t out_expanded_key[16*15]); -// aes128gcmsiv_aes_ks writes an AES-128 key schedule for |key| to +// aes256gcmsiv_aes_ks writes an AES-256 key schedule for |key| to // |out_expanded_key|. extern void aes256gcmsiv_aes_ks( - const uint8_t key[16], uint8_t out_expanded_key[16*15]); + const uint8_t key[32], uint8_t out_expanded_key[16*15]); static int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len) { @@ -68,18 +87,8 @@ static int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, return 0; } - char *ptr = OPENSSL_malloc(sizeof(struct aead_aes_gcm_siv_asm_ctx) + 8); - if (ptr == NULL) { - return 0; - } - assert((((uintptr_t)ptr) & 7) == 0); - - // gcm_siv_ctx needs to be 16-byte aligned in a cross-platform way. - struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = - (struct aead_aes_gcm_siv_asm_ctx *)(ptr + (((uintptr_t)ptr) & 8)); - + struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); assert((((uintptr_t)gcm_siv_ctx) & 15) == 0); - gcm_siv_ctx->ptr = ptr; if (key_bits == 128) { aes128gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); @@ -88,16 +97,13 @@ static int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, aes256gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); gcm_siv_ctx->is_128_bit = 0; } - ctx->aead_state = gcm_siv_ctx; + ctx->tag_len = tag_len; return 1; } -static void aead_aes_gcm_siv_asm_cleanup(EVP_AEAD_CTX *ctx) { - const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = ctx->aead_state; - OPENSSL_free(gcm_siv_ctx->ptr); -} +static void aead_aes_gcm_siv_asm_cleanup(EVP_AEAD_CTX *ctx) {} // aesgcmsiv_polyval_horner updates the POLYVAL value in |in_out_poly| to // include a number (|in_blocks|) of 16-byte blocks of data from |in|, given @@ -337,7 +343,7 @@ static int aead_aes_gcm_siv_asm_seal_scatter( size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = ctx->aead_state; + const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); const uint64_t in_len_64 = in_len; const uint64_t ad_len_64 = ad_len; @@ -420,7 +426,12 @@ static int aead_aes_gcm_siv_asm_open(const EVP_AEAD_CTX *ctx, uint8_t *out, return 0; } - const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = ctx->aead_state; + if (nonce_len != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); const size_t plaintext_len = in_len - EVP_AEAD_AES_GCM_SIV_TAG_LEN; const uint8_t *const given_tag = in + plaintext_len; @@ -547,7 +558,7 @@ static const EVP_AEAD aead_aes_256_gcm_siv_asm = { NULL /* tag_len */, }; -#endif // X86_64 && !NO_ASM +#endif // X86_64 && !NO_ASM && !WINDOWS struct aead_aes_gcm_siv_ctx { union { @@ -558,6 +569,15 @@ struct aead_aes_gcm_siv_ctx { unsigned is_256:1; }; +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_siv_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_siv_ctx), + "AEAD state has insufficient alignment"); +#endif + static int aead_aes_gcm_siv_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len) { const size_t key_bits = key_len * 8; @@ -576,24 +596,18 @@ static int aead_aes_gcm_siv_init(EVP_AEAD_CTX *ctx, const uint8_t *key, } struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = - OPENSSL_malloc(sizeof(struct aead_aes_gcm_siv_ctx)); - if (gcm_siv_ctx == NULL) { - return 0; - } + (struct aead_aes_gcm_siv_ctx *)&ctx->state; OPENSSL_memset(gcm_siv_ctx, 0, sizeof(struct aead_aes_gcm_siv_ctx)); aes_ctr_set_key(&gcm_siv_ctx->ks.ks, NULL, &gcm_siv_ctx->kgk_block, key, key_len); gcm_siv_ctx->is_256 = (key_len == 32); - ctx->aead_state = gcm_siv_ctx; ctx->tag_len = tag_len; return 1; } -static void aead_aes_gcm_siv_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} +static void aead_aes_gcm_siv_cleanup(EVP_AEAD_CTX *ctx) {} // gcm_siv_crypt encrypts (or decrypts—it's the same thing) |in_len| bytes from // |in| to |out|, using the block function |enc_block| with |key| in counter @@ -709,6 +723,14 @@ static void gcm_siv_keys( } OPENSSL_memcpy(out_keys->auth_key, key_material, 16); + // Note the |ctr128_f| function uses a big-endian couner, while AES-GCM-SIV + // uses a little-endian counter. We ignore the return value and only use + // |block128_f|. This has a significant performance cost for the fallback + // bitsliced AES implementations (bsaes and aes_nohw). + // + // We currently do not consider AES-GCM-SIV to be performance-sensitive on + // client hardware. If this changes, we can write little-endian |ctr128_f| + // functions. aes_ctr_set_key(&out_keys->enc_key.ks, NULL, &out_keys->enc_block, key_material + 16, gcm_siv_ctx->is_256 ? 32 : 16); } @@ -718,7 +740,8 @@ static int aead_aes_gcm_siv_seal_scatter( size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = ctx->aead_state; + const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = + (struct aead_aes_gcm_siv_ctx *)&ctx->state; const uint64_t in_len_64 = in_len; const uint64_t ad_len_64 = ad_len; @@ -778,7 +801,8 @@ static int aead_aes_gcm_siv_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, return 0; } - const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = ctx->aead_state; + const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = + (struct aead_aes_gcm_siv_ctx *)&ctx->state; struct gcm_siv_record_keys keys; gcm_siv_keys(gcm_siv_ctx, &keys, nonce); @@ -831,7 +855,7 @@ static const EVP_AEAD aead_aes_256_gcm_siv = { NULL /* tag_len */, }; -#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) +#if defined(AES_GCM_SIV_ASM) static char avx_aesni_capable(void) { const uint32_t ecx = OPENSSL_ia32cap_P[1]; @@ -864,4 +888,4 @@ const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) { return &aead_aes_256_gcm_siv; } -#endif // X86_64 && !NO_ASM +#endif // AES_GCM_SIV_ASM diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back similarity index 90% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back index 9de23003b..d7175723c 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_aesgcmsiv.c.grpc_back @@ -27,28 +27,47 @@ #define EVP_AEAD_AES_GCM_SIV_NONCE_LEN 12 #define EVP_AEAD_AES_GCM_SIV_TAG_LEN 16 -#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) +// TODO(davidben): AES-GCM-SIV assembly is not correct for Windows. It must save +// and restore xmm6 through xmm15. +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ + !defined(OPENSSL_WINDOWS) +#define AES_GCM_SIV_ASM // Optimised AES-GCM-SIV struct aead_aes_gcm_siv_asm_ctx { alignas(16) uint8_t key[16*15]; int is_128_bit; - // ptr contains the original pointer from |OPENSSL_malloc|, which may only be - // 8-byte aligned. When freeing this structure, actually call |OPENSSL_free| - // on this pointer. - void *ptr; }; +// The assembly code assumes 8-byte alignment of the EVP_AEAD_CTX's state, and +// aligns to 16 bytes itself. +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) + 8 >= + sizeof(struct aead_aes_gcm_siv_asm_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= 8, + "AEAD state has insufficient alignment"); +#endif + +// asm_ctx_from_ctx returns a 16-byte aligned context pointer from |ctx|. +static struct aead_aes_gcm_siv_asm_ctx *asm_ctx_from_ctx( + const EVP_AEAD_CTX *ctx) { + // ctx->state must already be 8-byte aligned. Thus, at most, we may need to + // add eight to align it to 16 bytes. + const uintptr_t offset = ((uintptr_t)&ctx->state) & 8; + return (struct aead_aes_gcm_siv_asm_ctx *)(&ctx->state.opaque[offset]); +} + // aes128gcmsiv_aes_ks writes an AES-128 key schedule for |key| to // |out_expanded_key|. extern void aes128gcmsiv_aes_ks( const uint8_t key[16], uint8_t out_expanded_key[16*15]); -// aes128gcmsiv_aes_ks writes an AES-128 key schedule for |key| to +// aes256gcmsiv_aes_ks writes an AES-256 key schedule for |key| to // |out_expanded_key|. extern void aes256gcmsiv_aes_ks( - const uint8_t key[16], uint8_t out_expanded_key[16*15]); + const uint8_t key[32], uint8_t out_expanded_key[16*15]); static int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len) { @@ -68,18 +87,8 @@ static int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, return 0; } - char *ptr = OPENSSL_malloc(sizeof(struct aead_aes_gcm_siv_asm_ctx) + 8); - if (ptr == NULL) { - return 0; - } - assert((((uintptr_t)ptr) & 7) == 0); - - // gcm_siv_ctx needs to be 16-byte aligned in a cross-platform way. - struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = - (struct aead_aes_gcm_siv_asm_ctx *)(ptr + (((uintptr_t)ptr) & 8)); - + struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); assert((((uintptr_t)gcm_siv_ctx) & 15) == 0); - gcm_siv_ctx->ptr = ptr; if (key_bits == 128) { aes128gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); @@ -88,16 +97,13 @@ static int aead_aes_gcm_siv_asm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, aes256gcmsiv_aes_ks(key, &gcm_siv_ctx->key[0]); gcm_siv_ctx->is_128_bit = 0; } - ctx->aead_state = gcm_siv_ctx; + ctx->tag_len = tag_len; return 1; } -static void aead_aes_gcm_siv_asm_cleanup(EVP_AEAD_CTX *ctx) { - const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = ctx->aead_state; - OPENSSL_free(gcm_siv_ctx->ptr); -} +static void aead_aes_gcm_siv_asm_cleanup(EVP_AEAD_CTX *ctx) {} // aesgcmsiv_polyval_horner updates the POLYVAL value in |in_out_poly| to // include a number (|in_blocks|) of 16-byte blocks of data from |in|, given @@ -337,7 +343,7 @@ static int aead_aes_gcm_siv_asm_seal_scatter( size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = ctx->aead_state; + const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); const uint64_t in_len_64 = in_len; const uint64_t ad_len_64 = ad_len; @@ -420,7 +426,12 @@ static int aead_aes_gcm_siv_asm_open(const EVP_AEAD_CTX *ctx, uint8_t *out, return 0; } - const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = ctx->aead_state; + if (nonce_len != EVP_AEAD_AES_GCM_SIV_NONCE_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + const struct aead_aes_gcm_siv_asm_ctx *gcm_siv_ctx = asm_ctx_from_ctx(ctx); const size_t plaintext_len = in_len - EVP_AEAD_AES_GCM_SIV_TAG_LEN; const uint8_t *const given_tag = in + plaintext_len; @@ -547,7 +558,7 @@ static const EVP_AEAD aead_aes_256_gcm_siv_asm = { NULL /* tag_len */, }; -#endif // X86_64 && !NO_ASM +#endif // X86_64 && !NO_ASM && !WINDOWS struct aead_aes_gcm_siv_ctx { union { @@ -558,6 +569,15 @@ struct aead_aes_gcm_siv_ctx { unsigned is_256:1; }; +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_siv_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_siv_ctx), + "AEAD state has insufficient alignment"); +#endif + static int aead_aes_gcm_siv_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, size_t tag_len) { const size_t key_bits = key_len * 8; @@ -576,24 +596,18 @@ static int aead_aes_gcm_siv_init(EVP_AEAD_CTX *ctx, const uint8_t *key, } struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = - OPENSSL_malloc(sizeof(struct aead_aes_gcm_siv_ctx)); - if (gcm_siv_ctx == NULL) { - return 0; - } + (struct aead_aes_gcm_siv_ctx *)&ctx->state; OPENSSL_memset(gcm_siv_ctx, 0, sizeof(struct aead_aes_gcm_siv_ctx)); aes_ctr_set_key(&gcm_siv_ctx->ks.ks, NULL, &gcm_siv_ctx->kgk_block, key, key_len); gcm_siv_ctx->is_256 = (key_len == 32); - ctx->aead_state = gcm_siv_ctx; ctx->tag_len = tag_len; return 1; } -static void aead_aes_gcm_siv_cleanup(EVP_AEAD_CTX *ctx) { - OPENSSL_free(ctx->aead_state); -} +static void aead_aes_gcm_siv_cleanup(EVP_AEAD_CTX *ctx) {} // gcm_siv_crypt encrypts (or decrypts—it's the same thing) |in_len| bytes from // |in| to |out|, using the block function |enc_block| with |key| in counter @@ -709,6 +723,14 @@ static void gcm_siv_keys( } OPENSSL_memcpy(out_keys->auth_key, key_material, 16); + // Note the |ctr128_f| function uses a big-endian couner, while AES-GCM-SIV + // uses a little-endian counter. We ignore the return value and only use + // |block128_f|. This has a significant performance cost for the fallback + // bitsliced AES implementations (bsaes and aes_nohw). + // + // We currently do not consider AES-GCM-SIV to be performance-sensitive on + // client hardware. If this changes, we can write little-endian |ctr128_f| + // functions. aes_ctr_set_key(&out_keys->enc_key.ks, NULL, &out_keys->enc_block, key_material + 16, gcm_siv_ctx->is_256 ? 32 : 16); } @@ -718,7 +740,8 @@ static int aead_aes_gcm_siv_seal_scatter( size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len, const uint8_t *ad, size_t ad_len) { - const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = ctx->aead_state; + const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = + (struct aead_aes_gcm_siv_ctx *)&ctx->state; const uint64_t in_len_64 = in_len; const uint64_t ad_len_64 = ad_len; @@ -778,7 +801,8 @@ static int aead_aes_gcm_siv_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, return 0; } - const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = ctx->aead_state; + const struct aead_aes_gcm_siv_ctx *gcm_siv_ctx = + (struct aead_aes_gcm_siv_ctx *)&ctx->state; struct gcm_siv_record_keys keys; gcm_siv_keys(gcm_siv_ctx, &keys, nonce); @@ -831,7 +855,7 @@ static const EVP_AEAD aead_aes_256_gcm_siv = { NULL /* tag_len */, }; -#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) +#if defined(AES_GCM_SIV_ASM) static char avx_aesni_capable(void) { const uint32_t ecx = OPENSSL_ia32cap_P[1]; @@ -864,4 +888,4 @@ const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void) { return &aead_aes_256_gcm_siv; } -#endif // X86_64 && !NO_ASM +#endif // AES_GCM_SIV_ASM diff --git a/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c new file mode 100644 index 000000000..cb0ee4029 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c @@ -0,0 +1,418 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../fipsmodule/cipher/internal.h" +#include "../internal.h" +#include "../chacha/internal.h" + + +#define POLY1305_TAG_LEN 16 + +struct aead_chacha20_poly1305_ctx { + uint8_t key[32]; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_chacha20_poly1305_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_chacha20_poly1305_ctx), + "AEAD state has insufficient alignment"); +#endif + +// For convenience (the x86_64 calling convention allows only six parameters in +// registers), the final parameter for the assembly functions is both an input +// and output parameter. +union open_data { + struct { + alignas(16) uint8_t key[32]; + uint32_t counter; + uint8_t nonce[12]; + } in; + struct { + uint8_t tag[POLY1305_TAG_LEN]; + } out; +}; + +union seal_data { + struct { + alignas(16) uint8_t key[32]; + uint32_t counter; + uint8_t nonce[12]; + const uint8_t *extra_ciphertext; + size_t extra_ciphertext_len; + } in; + struct { + uint8_t tag[POLY1305_TAG_LEN]; + } out; +}; + +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ + !defined(OPENSSL_WINDOWS) +static int asm_capable(void) { + const int sse41_capable = (OPENSSL_ia32cap_P[1] & (1 << 19)) != 0; + return sse41_capable; +} + +OPENSSL_STATIC_ASSERT(sizeof(union open_data) == 48, "wrong open_data size"); +OPENSSL_STATIC_ASSERT(sizeof(union seal_data) == 48 + 8 + 8, + "wrong seal_data size"); + +// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It decrypts +// |plaintext_len| bytes from |ciphertext| and writes them to |out_plaintext|. +// Additional input parameters are passed in |aead_data->in|. On exit, it will +// write calculated tag value to |aead_data->out.tag|, which the caller must +// check. +extern void chacha20_poly1305_open(uint8_t *out_plaintext, + const uint8_t *ciphertext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union open_data *aead_data); + +// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It encrypts +// |plaintext_len| bytes from |plaintext| and writes them to |out_ciphertext|. +// Additional input parameters are passed in |aead_data->in|. The calculated tag +// value is over the computed ciphertext concatenated with |extra_ciphertext| +// and written to |aead_data->out.tag|. +extern void chacha20_poly1305_seal(uint8_t *out_ciphertext, + const uint8_t *plaintext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union seal_data *aead_data); +#else +static int asm_capable(void) { return 0; } + + +static void chacha20_poly1305_open(uint8_t *out_plaintext, + const uint8_t *ciphertext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union open_data *aead_data) {} + +static void chacha20_poly1305_seal(uint8_t *out_ciphertext, + const uint8_t *plaintext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union seal_data *aead_data) {} +#endif + +static int aead_chacha20_poly1305_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len) { + struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + if (tag_len == 0) { + tag_len = POLY1305_TAG_LEN; + } + + if (tag_len > POLY1305_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (key_len != sizeof(c20_ctx->key)) { + return 0; // internal error - EVP_AEAD_CTX_init should catch this. + } + + OPENSSL_memcpy(c20_ctx->key, key, key_len); + ctx->tag_len = tag_len; + + return 1; +} + +static void aead_chacha20_poly1305_cleanup(EVP_AEAD_CTX *ctx) {} + +static void poly1305_update_length(poly1305_state *poly1305, size_t data_len) { + uint8_t length_bytes[8]; + + for (unsigned i = 0; i < sizeof(length_bytes); i++) { + length_bytes[i] = data_len; + data_len >>= 8; + } + + CRYPTO_poly1305_update(poly1305, length_bytes, sizeof(length_bytes)); +} + +// calc_tag fills |tag| with the authentication tag for the given inputs. +static void calc_tag(uint8_t tag[POLY1305_TAG_LEN], const uint8_t *key, + const uint8_t nonce[12], const uint8_t *ad, size_t ad_len, + const uint8_t *ciphertext, size_t ciphertext_len, + const uint8_t *ciphertext_extra, + size_t ciphertext_extra_len) { + alignas(16) uint8_t poly1305_key[32]; + OPENSSL_memset(poly1305_key, 0, sizeof(poly1305_key)); + CRYPTO_chacha_20(poly1305_key, poly1305_key, sizeof(poly1305_key), key, nonce, + 0); + + static const uint8_t padding[16] = { 0 }; // Padding is all zeros. + poly1305_state ctx; + CRYPTO_poly1305_init(&ctx, poly1305_key); + CRYPTO_poly1305_update(&ctx, ad, ad_len); + if (ad_len % 16 != 0) { + CRYPTO_poly1305_update(&ctx, padding, sizeof(padding) - (ad_len % 16)); + } + CRYPTO_poly1305_update(&ctx, ciphertext, ciphertext_len); + CRYPTO_poly1305_update(&ctx, ciphertext_extra, ciphertext_extra_len); + const size_t ciphertext_total = ciphertext_len + ciphertext_extra_len; + if (ciphertext_total % 16 != 0) { + CRYPTO_poly1305_update(&ctx, padding, + sizeof(padding) - (ciphertext_total % 16)); + } + poly1305_update_length(&ctx, ad_len); + poly1305_update_length(&ctx, ciphertext_total); + CRYPTO_poly1305_finish(&ctx, tag); +} + +static int chacha20_poly1305_seal_scatter( + const uint8_t *key, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len, size_t tag_len) { + if (extra_in_len + tag_len < tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + if (max_out_tag_len < tag_len + extra_in_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow + // individual operations that work on more than 256GB at a time. + // |in_len_64| is needed because, on 32-bit platforms, size_t is only + // 32-bits and this produces a warning because it's always false. + // Casting to uint64_t inside the conditional is not sufficient to stop + // the warning. + const uint64_t in_len_64 = in_len; + if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + // The the extra input is given, it is expected to be very short and so is + // encrypted byte-by-byte first. + if (extra_in_len) { + static const size_t kChaChaBlockSize = 64; + uint32_t block_counter = 1 + (in_len / kChaChaBlockSize); + size_t offset = in_len % kChaChaBlockSize; + uint8_t block[64 /* kChaChaBlockSize */]; + + for (size_t done = 0; done < extra_in_len; block_counter++) { + memset(block, 0, sizeof(block)); + CRYPTO_chacha_20(block, block, sizeof(block), key, nonce, + block_counter); + for (size_t i = offset; i < sizeof(block) && done < extra_in_len; + i++, done++) { + out_tag[done] = extra_in[done] ^ block[i]; + } + offset = 0; + } + } + + union seal_data data; + if (asm_capable()) { + OPENSSL_memcpy(data.in.key, key, 32); + data.in.counter = 0; + OPENSSL_memcpy(data.in.nonce, nonce, 12); + data.in.extra_ciphertext = out_tag; + data.in.extra_ciphertext_len = extra_in_len; + chacha20_poly1305_seal(out, in, in_len, ad, ad_len, &data); + } else { + CRYPTO_chacha_20(out, in, in_len, key, nonce, 1); + calc_tag(data.out.tag, key, nonce, ad, ad_len, out, in_len, out_tag, + extra_in_len); + } + + OPENSSL_memcpy(out_tag + extra_in_len, data.out.tag, tag_len); + *out_tag_len = extra_in_len + tag_len; + return 1; +} + +static int aead_chacha20_poly1305_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + return chacha20_poly1305_seal_scatter( + c20_ctx->key, out, out_tag, out_tag_len, max_out_tag_len, nonce, + nonce_len, in, in_len, extra_in, extra_in_len, ad, ad_len, ctx->tag_len); +} + +static int aead_xchacha20_poly1305_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + if (nonce_len != 24) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + alignas(4) uint8_t derived_key[32]; + alignas(4) uint8_t derived_nonce[12]; + CRYPTO_hchacha20(derived_key, c20_ctx->key, nonce); + OPENSSL_memset(derived_nonce, 0, 4); + OPENSSL_memcpy(&derived_nonce[4], &nonce[16], 8); + + return chacha20_poly1305_seal_scatter( + derived_key, out, out_tag, out_tag_len, max_out_tag_len, + derived_nonce, sizeof(derived_nonce), in, in_len, extra_in, extra_in_len, + ad, ad_len, ctx->tag_len); +} + +static int chacha20_poly1305_open_gather( + const uint8_t *key, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len, size_t tag_len) { + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + if (in_tag_len != tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow + // individual operations that work on more than 256GB at a time. + // |in_len_64| is needed because, on 32-bit platforms, size_t is only + // 32-bits and this produces a warning because it's always false. + // Casting to uint64_t inside the conditional is not sufficient to stop + // the warning. + const uint64_t in_len_64 = in_len; + if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + union open_data data; + if (asm_capable()) { + OPENSSL_memcpy(data.in.key, key, 32); + data.in.counter = 0; + OPENSSL_memcpy(data.in.nonce, nonce, 12); + chacha20_poly1305_open(out, in, in_len, ad, ad_len, &data); + } else { + calc_tag(data.out.tag, key, nonce, ad, ad_len, in, in_len, NULL, 0); + CRYPTO_chacha_20(out, in, in_len, key, nonce, 1); + } + + if (CRYPTO_memcmp(data.out.tag, in_tag, tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +static int aead_chacha20_poly1305_open_gather( + const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + return chacha20_poly1305_open_gather(c20_ctx->key, out, nonce, nonce_len, in, + in_len, in_tag, in_tag_len, ad, ad_len, + ctx->tag_len); +} + +static int aead_xchacha20_poly1305_open_gather( + const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + if (nonce_len != 24) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + alignas(4) uint8_t derived_key[32]; + alignas(4) uint8_t derived_nonce[12]; + CRYPTO_hchacha20(derived_key, c20_ctx->key, nonce); + OPENSSL_memset(derived_nonce, 0, 4); + OPENSSL_memcpy(&derived_nonce[4], &nonce[16], 8); + + return chacha20_poly1305_open_gather( + derived_key, out, derived_nonce, sizeof(derived_nonce), in, in_len, + in_tag, in_tag_len, ad, ad_len, ctx->tag_len); +} + +static const EVP_AEAD aead_chacha20_poly1305 = { + 32, // key len + 12, // nonce len + POLY1305_TAG_LEN, // overhead + POLY1305_TAG_LEN, // max tag length + 1, // seal_scatter_supports_extra_in + + aead_chacha20_poly1305_init, + NULL, // init_with_direction + aead_chacha20_poly1305_cleanup, + NULL /* open */, + aead_chacha20_poly1305_seal_scatter, + aead_chacha20_poly1305_open_gather, + NULL, // get_iv + NULL, // tag_len +}; + +static const EVP_AEAD aead_xchacha20_poly1305 = { + 32, // key len + 24, // nonce len + POLY1305_TAG_LEN, // overhead + POLY1305_TAG_LEN, // max tag length + 1, // seal_scatter_supports_extra_in + + aead_chacha20_poly1305_init, + NULL, // init_with_direction + aead_chacha20_poly1305_cleanup, + NULL /* open */, + aead_xchacha20_poly1305_seal_scatter, + aead_xchacha20_poly1305_open_gather, + NULL, // get_iv + NULL, // tag_len +}; + +const EVP_AEAD *EVP_aead_chacha20_poly1305(void) { + return &aead_chacha20_poly1305; +} + +const EVP_AEAD *EVP_aead_xchacha20_poly1305(void) { + return &aead_xchacha20_poly1305; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back new file mode 100644 index 000000000..1c175e9aa --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_chacha20poly1305.c.grpc_back @@ -0,0 +1,418 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../fipsmodule/cipher/internal.h" +#include "../internal.h" +#include "../chacha/internal.h" + + +#define POLY1305_TAG_LEN 16 + +struct aead_chacha20_poly1305_ctx { + uint8_t key[32]; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_chacha20_poly1305_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_chacha20_poly1305_ctx), + "AEAD state has insufficient alignment"); +#endif + +// For convenience (the x86_64 calling convention allows only six parameters in +// registers), the final parameter for the assembly functions is both an input +// and output parameter. +union open_data { + struct { + alignas(16) uint8_t key[32]; + uint32_t counter; + uint8_t nonce[12]; + } in; + struct { + uint8_t tag[POLY1305_TAG_LEN]; + } out; +}; + +union seal_data { + struct { + alignas(16) uint8_t key[32]; + uint32_t counter; + uint8_t nonce[12]; + const uint8_t *extra_ciphertext; + size_t extra_ciphertext_len; + } in; + struct { + uint8_t tag[POLY1305_TAG_LEN]; + } out; +}; + +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ + !defined(OPENSSL_WINDOWS) +static int asm_capable(void) { + const int sse41_capable = (OPENSSL_ia32cap_P[1] & (1 << 19)) != 0; + return sse41_capable; +} + +OPENSSL_STATIC_ASSERT(sizeof(union open_data) == 48, "wrong open_data size"); +OPENSSL_STATIC_ASSERT(sizeof(union seal_data) == 48 + 8 + 8, + "wrong seal_data size"); + +// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It decrypts +// |plaintext_len| bytes from |ciphertext| and writes them to |out_plaintext|. +// Additional input parameters are passed in |aead_data->in|. On exit, it will +// write calculated tag value to |aead_data->out.tag|, which the caller must +// check. +extern void chacha20_poly1305_open(uint8_t *out_plaintext, + const uint8_t *ciphertext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union open_data *aead_data); + +// chacha20_poly1305_open is defined in chacha20_poly1305_x86_64.pl. It encrypts +// |plaintext_len| bytes from |plaintext| and writes them to |out_ciphertext|. +// Additional input parameters are passed in |aead_data->in|. The calculated tag +// value is over the computed ciphertext concatenated with |extra_ciphertext| +// and written to |aead_data->out.tag|. +extern void chacha20_poly1305_seal(uint8_t *out_ciphertext, + const uint8_t *plaintext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union seal_data *aead_data); +#else +static int asm_capable(void) { return 0; } + + +static void chacha20_poly1305_open(uint8_t *out_plaintext, + const uint8_t *ciphertext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union open_data *aead_data) {} + +static void chacha20_poly1305_seal(uint8_t *out_ciphertext, + const uint8_t *plaintext, + size_t plaintext_len, const uint8_t *ad, + size_t ad_len, union seal_data *aead_data) {} +#endif + +static int aead_chacha20_poly1305_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t tag_len) { + struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + if (tag_len == 0) { + tag_len = POLY1305_TAG_LEN; + } + + if (tag_len > POLY1305_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (key_len != sizeof(c20_ctx->key)) { + return 0; // internal error - EVP_AEAD_CTX_init should catch this. + } + + OPENSSL_memcpy(c20_ctx->key, key, key_len); + ctx->tag_len = tag_len; + + return 1; +} + +static void aead_chacha20_poly1305_cleanup(EVP_AEAD_CTX *ctx) {} + +static void poly1305_update_length(poly1305_state *poly1305, size_t data_len) { + uint8_t length_bytes[8]; + + for (unsigned i = 0; i < sizeof(length_bytes); i++) { + length_bytes[i] = data_len; + data_len >>= 8; + } + + CRYPTO_poly1305_update(poly1305, length_bytes, sizeof(length_bytes)); +} + +// calc_tag fills |tag| with the authentication tag for the given inputs. +static void calc_tag(uint8_t tag[POLY1305_TAG_LEN], const uint8_t *key, + const uint8_t nonce[12], const uint8_t *ad, size_t ad_len, + const uint8_t *ciphertext, size_t ciphertext_len, + const uint8_t *ciphertext_extra, + size_t ciphertext_extra_len) { + alignas(16) uint8_t poly1305_key[32]; + OPENSSL_memset(poly1305_key, 0, sizeof(poly1305_key)); + CRYPTO_chacha_20(poly1305_key, poly1305_key, sizeof(poly1305_key), key, nonce, + 0); + + static const uint8_t padding[16] = { 0 }; // Padding is all zeros. + poly1305_state ctx; + CRYPTO_poly1305_init(&ctx, poly1305_key); + CRYPTO_poly1305_update(&ctx, ad, ad_len); + if (ad_len % 16 != 0) { + CRYPTO_poly1305_update(&ctx, padding, sizeof(padding) - (ad_len % 16)); + } + CRYPTO_poly1305_update(&ctx, ciphertext, ciphertext_len); + CRYPTO_poly1305_update(&ctx, ciphertext_extra, ciphertext_extra_len); + const size_t ciphertext_total = ciphertext_len + ciphertext_extra_len; + if (ciphertext_total % 16 != 0) { + CRYPTO_poly1305_update(&ctx, padding, + sizeof(padding) - (ciphertext_total % 16)); + } + poly1305_update_length(&ctx, ad_len); + poly1305_update_length(&ctx, ciphertext_total); + CRYPTO_poly1305_finish(&ctx, tag); +} + +static int chacha20_poly1305_seal_scatter( + const uint8_t *key, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len, size_t tag_len) { + if (extra_in_len + tag_len < tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + if (max_out_tag_len < tag_len + extra_in_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow + // individual operations that work on more than 256GB at a time. + // |in_len_64| is needed because, on 32-bit platforms, size_t is only + // 32-bits and this produces a warning because it's always false. + // Casting to uint64_t inside the conditional is not sufficient to stop + // the warning. + const uint64_t in_len_64 = in_len; + if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + if (max_out_tag_len < tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + + // The the extra input is given, it is expected to be very short and so is + // encrypted byte-by-byte first. + if (extra_in_len) { + static const size_t kChaChaBlockSize = 64; + uint32_t block_counter = 1 + (in_len / kChaChaBlockSize); + size_t offset = in_len % kChaChaBlockSize; + uint8_t block[64 /* kChaChaBlockSize */]; + + for (size_t done = 0; done < extra_in_len; block_counter++) { + memset(block, 0, sizeof(block)); + CRYPTO_chacha_20(block, block, sizeof(block), key, nonce, + block_counter); + for (size_t i = offset; i < sizeof(block) && done < extra_in_len; + i++, done++) { + out_tag[done] = extra_in[done] ^ block[i]; + } + offset = 0; + } + } + + union seal_data data; + if (asm_capable()) { + OPENSSL_memcpy(data.in.key, key, 32); + data.in.counter = 0; + OPENSSL_memcpy(data.in.nonce, nonce, 12); + data.in.extra_ciphertext = out_tag; + data.in.extra_ciphertext_len = extra_in_len; + chacha20_poly1305_seal(out, in, in_len, ad, ad_len, &data); + } else { + CRYPTO_chacha_20(out, in, in_len, key, nonce, 1); + calc_tag(data.out.tag, key, nonce, ad, ad_len, out, in_len, out_tag, + extra_in_len); + } + + OPENSSL_memcpy(out_tag + extra_in_len, data.out.tag, tag_len); + *out_tag_len = extra_in_len + tag_len; + return 1; +} + +static int aead_chacha20_poly1305_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + return chacha20_poly1305_seal_scatter( + c20_ctx->key, out, out_tag, out_tag_len, max_out_tag_len, nonce, + nonce_len, in, in_len, extra_in, extra_in_len, ad, ad_len, ctx->tag_len); +} + +static int aead_xchacha20_poly1305_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + if (nonce_len != 24) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + alignas(4) uint8_t derived_key[32]; + alignas(4) uint8_t derived_nonce[12]; + CRYPTO_hchacha20(derived_key, c20_ctx->key, nonce); + OPENSSL_memset(derived_nonce, 0, 4); + OPENSSL_memcpy(&derived_nonce[4], &nonce[16], 8); + + return chacha20_poly1305_seal_scatter( + derived_key, out, out_tag, out_tag_len, max_out_tag_len, + derived_nonce, sizeof(derived_nonce), in, in_len, extra_in, extra_in_len, + ad, ad_len, ctx->tag_len); +} + +static int chacha20_poly1305_open_gather( + const uint8_t *key, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len, size_t tag_len) { + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + if (in_tag_len != tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + // |CRYPTO_chacha_20| uses a 32-bit block counter. Therefore we disallow + // individual operations that work on more than 256GB at a time. + // |in_len_64| is needed because, on 32-bit platforms, size_t is only + // 32-bits and this produces a warning because it's always false. + // Casting to uint64_t inside the conditional is not sufficient to stop + // the warning. + const uint64_t in_len_64 = in_len; + if (in_len_64 >= (UINT64_C(1) << 32) * 64 - 64) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + + union open_data data; + if (asm_capable()) { + OPENSSL_memcpy(data.in.key, key, 32); + data.in.counter = 0; + OPENSSL_memcpy(data.in.nonce, nonce, 12); + chacha20_poly1305_open(out, in, in_len, ad, ad_len, &data); + } else { + calc_tag(data.out.tag, key, nonce, ad, ad_len, in, in_len, NULL, 0); + CRYPTO_chacha_20(out, in, in_len, key, nonce, 1); + } + + if (CRYPTO_memcmp(data.out.tag, in_tag, tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +static int aead_chacha20_poly1305_open_gather( + const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + return chacha20_poly1305_open_gather(c20_ctx->key, out, nonce, nonce_len, in, + in_len, in_tag, in_tag_len, ad, ad_len, + ctx->tag_len); +} + +static int aead_xchacha20_poly1305_open_gather( + const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len) { + const struct aead_chacha20_poly1305_ctx *c20_ctx = + (struct aead_chacha20_poly1305_ctx *)&ctx->state; + + if (nonce_len != 24) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + alignas(4) uint8_t derived_key[32]; + alignas(4) uint8_t derived_nonce[12]; + CRYPTO_hchacha20(derived_key, c20_ctx->key, nonce); + OPENSSL_memset(derived_nonce, 0, 4); + OPENSSL_memcpy(&derived_nonce[4], &nonce[16], 8); + + return chacha20_poly1305_open_gather( + derived_key, out, derived_nonce, sizeof(derived_nonce), in, in_len, + in_tag, in_tag_len, ad, ad_len, ctx->tag_len); +} + +static const EVP_AEAD aead_chacha20_poly1305 = { + 32, // key len + 12, // nonce len + POLY1305_TAG_LEN, // overhead + POLY1305_TAG_LEN, // max tag length + 1, // seal_scatter_supports_extra_in + + aead_chacha20_poly1305_init, + NULL, // init_with_direction + aead_chacha20_poly1305_cleanup, + NULL /* open */, + aead_chacha20_poly1305_seal_scatter, + aead_chacha20_poly1305_open_gather, + NULL, // get_iv + NULL, // tag_len +}; + +static const EVP_AEAD aead_xchacha20_poly1305 = { + 32, // key len + 24, // nonce len + POLY1305_TAG_LEN, // overhead + POLY1305_TAG_LEN, // max tag length + 1, // seal_scatter_supports_extra_in + + aead_chacha20_poly1305_init, + NULL, // init_with_direction + aead_chacha20_poly1305_cleanup, + NULL /* open */, + aead_xchacha20_poly1305_seal_scatter, + aead_xchacha20_poly1305_open_gather, + NULL, // get_iv + NULL, // tag_len +}; + +const EVP_AEAD *EVP_aead_chacha20_poly1305(void) { + return &aead_chacha20_poly1305; +} + +const EVP_AEAD *EVP_aead_xchacha20_poly1305(void) { + return &aead_xchacha20_poly1305; +} diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_null.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_null.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_null.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_null.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_null.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc2.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc2.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc2.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc2.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc2.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc4.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc4.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc4.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_rc4.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_rc4.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_tls.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_tls.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c index 48fbccd0a..2b5b82fed 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_tls.c +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c @@ -42,14 +42,22 @@ typedef struct { char implicit_iv; } AEAD_TLS_CTX; -OPENSSL_COMPILE_ASSERT(EVP_MAX_MD_SIZE < 256, mac_key_len_fits_in_uint8_t); +OPENSSL_STATIC_ASSERT(EVP_MAX_MD_SIZE < 256, + "mac_key_len does not fit in uint8_t"); + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(AEAD_TLS_CTX), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(AEAD_TLS_CTX), + "AEAD state has insufficient alignment"); +#endif static void aead_tls_cleanup(EVP_AEAD_CTX *ctx) { - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; EVP_CIPHER_CTX_cleanup(&tls_ctx->cipher_ctx); HMAC_CTX_cleanup(&tls_ctx->hmac_ctx); - OPENSSL_free(tls_ctx); - ctx->aead_state = NULL; } static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, @@ -72,11 +80,7 @@ static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, assert(mac_key_len + enc_key_len + (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); - AEAD_TLS_CTX *tls_ctx = OPENSSL_malloc(sizeof(AEAD_TLS_CTX)); - if (tls_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; EVP_CIPHER_CTX_init(&tls_ctx->cipher_ctx); HMAC_CTX_init(&tls_ctx->hmac_ctx); assert(mac_key_len <= EVP_MAX_MD_SIZE); @@ -84,13 +88,11 @@ static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, tls_ctx->mac_key_len = (uint8_t)mac_key_len; tls_ctx->implicit_iv = implicit_iv; - ctx->aead_state = tls_ctx; if (!EVP_CipherInit_ex(&tls_ctx->cipher_ctx, cipher, NULL, &key[mac_key_len], implicit_iv ? &key[mac_key_len + enc_key_len] : NULL, dir == evp_aead_seal) || !HMAC_Init_ex(&tls_ctx->hmac_ctx, key, mac_key_len, md, NULL)) { aead_tls_cleanup(ctx); - ctx->aead_state = NULL; return 0; } EVP_CIPHER_CTX_set_padding(&tls_ctx->cipher_ctx, 0); @@ -101,7 +103,7 @@ static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, static size_t aead_tls_tag_len(const EVP_AEAD_CTX *ctx, const size_t in_len, const size_t extra_in_len) { assert(extra_in_len == 0); - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + const AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; const size_t hmac_len = HMAC_size(&tls_ctx->hmac_ctx); if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) != EVP_CIPH_CBC_MODE) { @@ -125,7 +127,7 @@ static int aead_tls_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *extra_in, const size_t extra_in_len, const uint8_t *ad, const size_t ad_len) { - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; if (!tls_ctx->cipher_ctx.encrypt) { // Unlike a normal AEAD, a TLS AEAD may only be used in one direction. @@ -241,7 +243,7 @@ static int aead_tls_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, size_t max_out_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *ad, size_t ad_len) { - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; if (tls_ctx->cipher_ctx.encrypt) { // Unlike a normal AEAD, a TLS AEAD may only be used in one direction. @@ -297,6 +299,8 @@ static int aead_tls_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, total += len; assert(total == in_len); + CONSTTIME_SECRET(out, total); + // Remove CBC padding. Code from here on is timing-sensitive with respect to // |padding_ok| and |data_plus_mac_len| for CBC ciphers. size_t data_plus_mac_len; @@ -373,11 +377,15 @@ static int aead_tls_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, crypto_word_t good = constant_time_eq_int(CRYPTO_memcmp(record_mac, mac, mac_len), 0); good &= padding_ok; + CONSTTIME_DECLASSIFY(&good, sizeof(good)); if (!good) { OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); return 0; } + CONSTTIME_DECLASSIFY(&data_len, sizeof(data_len)); + CONSTTIME_DECLASSIFY(out, data_len); + // End of timing-sensitive code. *out_len = data_len; @@ -453,7 +461,7 @@ static int aead_des_ede3_cbc_sha1_tls_implicit_iv_init( static int aead_tls_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, size_t *out_iv_len) { - const AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX*) ctx->aead_state; + const AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; const size_t iv_len = EVP_CIPHER_CTX_iv_length(&tls_ctx->cipher_ctx); if (iv_len <= 1) { return 0; diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_tls.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c.grpc_back similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/e_tls.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c.grpc_back index bba22be53..c812b6b86 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/e_tls.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/e_tls.c.grpc_back @@ -42,14 +42,22 @@ typedef struct { char implicit_iv; } AEAD_TLS_CTX; -OPENSSL_COMPILE_ASSERT(EVP_MAX_MD_SIZE < 256, mac_key_len_fits_in_uint8_t); +OPENSSL_STATIC_ASSERT(EVP_MAX_MD_SIZE < 256, + "mac_key_len does not fit in uint8_t"); + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(AEAD_TLS_CTX), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(AEAD_TLS_CTX), + "AEAD state has insufficient alignment"); +#endif static void aead_tls_cleanup(EVP_AEAD_CTX *ctx) { - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; EVP_CIPHER_CTX_cleanup(&tls_ctx->cipher_ctx); HMAC_CTX_cleanup(&tls_ctx->hmac_ctx); - OPENSSL_free(tls_ctx); - ctx->aead_state = NULL; } static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, @@ -72,11 +80,7 @@ static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, assert(mac_key_len + enc_key_len + (implicit_iv ? EVP_CIPHER_iv_length(cipher) : 0) == key_len); - AEAD_TLS_CTX *tls_ctx = OPENSSL_malloc(sizeof(AEAD_TLS_CTX)); - if (tls_ctx == NULL) { - OPENSSL_PUT_ERROR(CIPHER, ERR_R_MALLOC_FAILURE); - return 0; - } + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; EVP_CIPHER_CTX_init(&tls_ctx->cipher_ctx); HMAC_CTX_init(&tls_ctx->hmac_ctx); assert(mac_key_len <= EVP_MAX_MD_SIZE); @@ -84,13 +88,11 @@ static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, tls_ctx->mac_key_len = (uint8_t)mac_key_len; tls_ctx->implicit_iv = implicit_iv; - ctx->aead_state = tls_ctx; if (!EVP_CipherInit_ex(&tls_ctx->cipher_ctx, cipher, NULL, &key[mac_key_len], implicit_iv ? &key[mac_key_len + enc_key_len] : NULL, dir == evp_aead_seal) || !HMAC_Init_ex(&tls_ctx->hmac_ctx, key, mac_key_len, md, NULL)) { aead_tls_cleanup(ctx); - ctx->aead_state = NULL; return 0; } EVP_CIPHER_CTX_set_padding(&tls_ctx->cipher_ctx, 0); @@ -101,7 +103,7 @@ static int aead_tls_init(EVP_AEAD_CTX *ctx, const uint8_t *key, size_t key_len, static size_t aead_tls_tag_len(const EVP_AEAD_CTX *ctx, const size_t in_len, const size_t extra_in_len) { assert(extra_in_len == 0); - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + const AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; const size_t hmac_len = HMAC_size(&tls_ctx->hmac_ctx); if (EVP_CIPHER_CTX_mode(&tls_ctx->cipher_ctx) != EVP_CIPH_CBC_MODE) { @@ -125,7 +127,7 @@ static int aead_tls_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *extra_in, const size_t extra_in_len, const uint8_t *ad, const size_t ad_len) { - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; if (!tls_ctx->cipher_ctx.encrypt) { // Unlike a normal AEAD, a TLS AEAD may only be used in one direction. @@ -241,7 +243,7 @@ static int aead_tls_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, size_t max_out_len, const uint8_t *nonce, size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *ad, size_t ad_len) { - AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)ctx->aead_state; + AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; if (tls_ctx->cipher_ctx.encrypt) { // Unlike a normal AEAD, a TLS AEAD may only be used in one direction. @@ -297,6 +299,8 @@ static int aead_tls_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, total += len; assert(total == in_len); + CONSTTIME_SECRET(out, total); + // Remove CBC padding. Code from here on is timing-sensitive with respect to // |padding_ok| and |data_plus_mac_len| for CBC ciphers. size_t data_plus_mac_len; @@ -373,11 +377,15 @@ static int aead_tls_open(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, crypto_word_t good = constant_time_eq_int(CRYPTO_memcmp(record_mac, mac, mac_len), 0); good &= padding_ok; + CONSTTIME_DECLASSIFY(&good, sizeof(good)); if (!good) { OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); return 0; } + CONSTTIME_DECLASSIFY(&data_len, sizeof(data_len)); + CONSTTIME_DECLASSIFY(out, data_len); + // End of timing-sensitive code. *out_len = data_len; @@ -453,7 +461,7 @@ static int aead_des_ede3_cbc_sha1_tls_implicit_iv_init( static int aead_tls_get_iv(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, size_t *out_iv_len) { - const AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX*) ctx->aead_state; + const AEAD_TLS_CTX *tls_ctx = (AEAD_TLS_CTX *)&ctx->state; const size_t iv_len = EVP_CIPHER_CTX_iv_length(&tls_ctx->cipher_ctx); if (iv_len <= 1) { return 0; diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/internal.h b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/tls_cbc.c b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/tls_cbc.c rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c index 8a7906eeb..a18f5211b 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/tls_cbc.c +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c @@ -271,7 +271,7 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, HASH_CTX md_state; void (*md_final_raw)(HASH_CTX *ctx, uint8_t *md_out); void (*md_transform)(HASH_CTX *ctx, const uint8_t *block); - unsigned md_size, md_block_size = 64; + unsigned md_size, md_block_size = 64, md_block_shift = 6; // md_length_size is the number of bytes in the length field that terminates // the hash. unsigned md_length_size = 8; @@ -305,6 +305,7 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, md_transform = tls1_sha512_transform; md_size = SHA384_DIGEST_LENGTH; md_block_size = 128; + md_block_shift = 7; md_length_size = 16; break; @@ -318,6 +319,7 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES); assert(md_block_size <= MAX_HASH_BLOCK_SIZE); + assert(md_block_size == (1u << md_block_shift)); assert(md_size <= EVP_MAX_MD_SIZE); static const size_t kHeaderLength = 13; @@ -327,9 +329,18 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, // padding value. // // TLSv1 has MACs up to 48 bytes long (SHA-384) and the padding is not - // required to be minimal. Therefore we say that the final six blocks - // can vary based on the padding. - static const size_t kVarianceBlocks = 6; + // required to be minimal. Therefore we say that the final |kVarianceBlocks| + // blocks can vary based on the padding and on the hash used. This value + // must be derived from public information. + const size_t kVarianceBlocks = + ( 255 + 1 + // maximum padding bytes + padding length + md_size + // length of hash's output + md_block_size - 1 // ceiling + ) / md_block_size + + 1; // the 0x80 marker and the encoded message length could or not + // require an extra block; since the exact value depends on the + // message length; thus, one extra block is always added to run + // in constant time. // From now on we're dealing with the MAC, which conceptually has 13 // bytes of `header' before the start of the data. @@ -350,18 +361,16 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, // k is the starting byte offset into the conceptual header||data where // we start processing. size_t k = 0; - // mac_end_offset is the index just past the end of the data to be - // MACed. + // mac_end_offset is the index just past the end of the data to be MACed. size_t mac_end_offset = data_plus_mac_size + kHeaderLength - md_size; - // c is the index of the 0x80 byte in the final hash block that - // contains application data. - size_t c = mac_end_offset % md_block_size; - // index_a is the hash block number that contains the 0x80 terminating - // value. - size_t index_a = mac_end_offset / md_block_size; - // index_b is the hash block number that contains the 64-bit hash - // length, in bits. - size_t index_b = (mac_end_offset + md_length_size) / md_block_size; + // c is the index of the 0x80 byte in the final hash block that contains + // application data. + size_t c = mac_end_offset & (md_block_size - 1); + // index_a is the hash block number that contains the 0x80 terminating value. + size_t index_a = mac_end_offset >> md_block_shift; + // index_b is the hash block number that contains the 64-bit hash length, in + // bits. + size_t index_b = (mac_end_offset + md_length_size) >> md_block_shift; if (num_blocks > kVarianceBlocks) { num_starting_blocks = num_blocks - kVarianceBlocks; diff --git a/Pods/BoringSSL-GRPC/crypto/cipher_extra/tls_cbc.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/cipher_extra/tls_cbc.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c.grpc_back index 6f95130a3..52353f2a5 100644 --- a/Pods/BoringSSL-GRPC/crypto/cipher_extra/tls_cbc.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/cipher_extra/tls_cbc.c.grpc_back @@ -271,7 +271,7 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, HASH_CTX md_state; void (*md_final_raw)(HASH_CTX *ctx, uint8_t *md_out); void (*md_transform)(HASH_CTX *ctx, const uint8_t *block); - unsigned md_size, md_block_size = 64; + unsigned md_size, md_block_size = 64, md_block_shift = 6; // md_length_size is the number of bytes in the length field that terminates // the hash. unsigned md_length_size = 8; @@ -305,6 +305,7 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, md_transform = tls1_sha512_transform; md_size = SHA384_DIGEST_LENGTH; md_block_size = 128; + md_block_shift = 7; md_length_size = 16; break; @@ -318,6 +319,7 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, assert(md_length_size <= MAX_HASH_BIT_COUNT_BYTES); assert(md_block_size <= MAX_HASH_BLOCK_SIZE); + assert(md_block_size == (1u << md_block_shift)); assert(md_size <= EVP_MAX_MD_SIZE); static const size_t kHeaderLength = 13; @@ -327,9 +329,18 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, // padding value. // // TLSv1 has MACs up to 48 bytes long (SHA-384) and the padding is not - // required to be minimal. Therefore we say that the final six blocks - // can vary based on the padding. - static const size_t kVarianceBlocks = 6; + // required to be minimal. Therefore we say that the final |kVarianceBlocks| + // blocks can vary based on the padding and on the hash used. This value + // must be derived from public information. + const size_t kVarianceBlocks = + ( 255 + 1 + // maximum padding bytes + padding length + md_size + // length of hash's output + md_block_size - 1 // ceiling + ) / md_block_size + + 1; // the 0x80 marker and the encoded message length could or not + // require an extra block; since the exact value depends on the + // message length; thus, one extra block is always added to run + // in constant time. // From now on we're dealing with the MAC, which conceptually has 13 // bytes of `header' before the start of the data. @@ -350,18 +361,16 @@ int EVP_tls_cbc_digest_record(const EVP_MD *md, uint8_t *md_out, // k is the starting byte offset into the conceptual header||data where // we start processing. size_t k = 0; - // mac_end_offset is the index just past the end of the data to be - // MACed. + // mac_end_offset is the index just past the end of the data to be MACed. size_t mac_end_offset = data_plus_mac_size + kHeaderLength - md_size; - // c is the index of the 0x80 byte in the final hash block that - // contains application data. - size_t c = mac_end_offset % md_block_size; - // index_a is the hash block number that contains the 0x80 terminating - // value. - size_t index_a = mac_end_offset / md_block_size; - // index_b is the hash block number that contains the 64-bit hash - // length, in bits. - size_t index_b = (mac_end_offset + md_length_size) / md_block_size; + // c is the index of the 0x80 byte in the final hash block that contains + // application data. + size_t c = mac_end_offset & (md_block_size - 1); + // index_a is the hash block number that contains the 0x80 terminating value. + size_t index_a = mac_end_offset >> md_block_shift; + // index_b is the hash block number that contains the 64-bit hash length, in + // bits. + size_t index_b = (mac_end_offset + md_length_size) >> md_block_shift; if (num_blocks > kVarianceBlocks) { num_starting_blocks = num_blocks - kVarianceBlocks; diff --git a/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c b/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c new file mode 100644 index 000000000..b1913122c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c @@ -0,0 +1,278 @@ +/* ==================================================================== + * Copyright (c) 2010 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include +#include + +#include +#include +#include + +#include "../internal.h" + + +struct cmac_ctx_st { + EVP_CIPHER_CTX cipher_ctx; + // k1 and k2 are the CMAC subkeys. See + // https://tools.ietf.org/html/rfc4493#section-2.3 + uint8_t k1[AES_BLOCK_SIZE]; + uint8_t k2[AES_BLOCK_SIZE]; + // Last (possibly partial) scratch + uint8_t block[AES_BLOCK_SIZE]; + // block_used contains the number of valid bytes in |block|. + unsigned block_used; +}; + +static void CMAC_CTX_init(CMAC_CTX *ctx) { + EVP_CIPHER_CTX_init(&ctx->cipher_ctx); +} + +static void CMAC_CTX_cleanup(CMAC_CTX *ctx) { + EVP_CIPHER_CTX_cleanup(&ctx->cipher_ctx); + OPENSSL_cleanse(ctx->k1, sizeof(ctx->k1)); + OPENSSL_cleanse(ctx->k2, sizeof(ctx->k2)); + OPENSSL_cleanse(ctx->block, sizeof(ctx->block)); +} + +int AES_CMAC(uint8_t out[16], const uint8_t *key, size_t key_len, + const uint8_t *in, size_t in_len) { + const EVP_CIPHER *cipher; + switch (key_len) { + case 16: + cipher = EVP_aes_128_cbc(); + break; + case 32: + cipher = EVP_aes_256_cbc(); + break; + default: + return 0; + } + + size_t scratch_out_len; + CMAC_CTX ctx; + CMAC_CTX_init(&ctx); + + const int ok = CMAC_Init(&ctx, key, key_len, cipher, NULL /* engine */) && + CMAC_Update(&ctx, in, in_len) && + CMAC_Final(&ctx, out, &scratch_out_len); + + CMAC_CTX_cleanup(&ctx); + return ok; +} + +CMAC_CTX *CMAC_CTX_new(void) { + CMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx)); + if (ctx != NULL) { + CMAC_CTX_init(ctx); + } + return ctx; +} + +void CMAC_CTX_free(CMAC_CTX *ctx) { + if (ctx == NULL) { + return; + } + + CMAC_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in) { + if (!EVP_CIPHER_CTX_copy(&out->cipher_ctx, &in->cipher_ctx)) { + return 0; + } + OPENSSL_memcpy(out->k1, in->k1, AES_BLOCK_SIZE); + OPENSSL_memcpy(out->k2, in->k2, AES_BLOCK_SIZE); + OPENSSL_memcpy(out->block, in->block, AES_BLOCK_SIZE); + out->block_used = in->block_used; + return 1; +} + +// binary_field_mul_x_128 treats the 128 bits at |in| as an element of GF(2¹²⁸) +// with a hard-coded reduction polynomial and sets |out| as x times the input. +// +// See https://tools.ietf.org/html/rfc4493#section-2.3 +static void binary_field_mul_x_128(uint8_t out[16], const uint8_t in[16]) { + unsigned i; + + // Shift |in| to left, including carry. + for (i = 0; i < 15; i++) { + out[i] = (in[i] << 1) | (in[i+1] >> 7); + } + + // If MSB set fixup with R. + const uint8_t carry = in[0] >> 7; + out[i] = (in[i] << 1) ^ ((0 - carry) & 0x87); +} + +// binary_field_mul_x_64 behaves like |binary_field_mul_x_128| but acts on an +// element of GF(2⁶⁴). +// +// See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38b.pdf +static void binary_field_mul_x_64(uint8_t out[8], const uint8_t in[8]) { + unsigned i; + + // Shift |in| to left, including carry. + for (i = 0; i < 7; i++) { + out[i] = (in[i] << 1) | (in[i+1] >> 7); + } + + // If MSB set fixup with R. + const uint8_t carry = in[0] >> 7; + out[i] = (in[i] << 1) ^ ((0 - carry) & 0x1b); +} + +static const uint8_t kZeroIV[AES_BLOCK_SIZE] = {0}; + +int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t key_len, + const EVP_CIPHER *cipher, ENGINE *engine) { + uint8_t scratch[AES_BLOCK_SIZE]; + + size_t block_size = EVP_CIPHER_block_size(cipher); + if ((block_size != AES_BLOCK_SIZE && block_size != 8 /* 3-DES */) || + EVP_CIPHER_key_length(cipher) != key_len || + !EVP_EncryptInit_ex(&ctx->cipher_ctx, cipher, NULL, key, kZeroIV) || + !EVP_Cipher(&ctx->cipher_ctx, scratch, kZeroIV, block_size) || + // Reset context again ready for first data. + !EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV)) { + return 0; + } + + if (block_size == AES_BLOCK_SIZE) { + binary_field_mul_x_128(ctx->k1, scratch); + binary_field_mul_x_128(ctx->k2, ctx->k1); + } else { + binary_field_mul_x_64(ctx->k1, scratch); + binary_field_mul_x_64(ctx->k2, ctx->k1); + } + ctx->block_used = 0; + + return 1; +} + +int CMAC_Reset(CMAC_CTX *ctx) { + ctx->block_used = 0; + return EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV); +} + +int CMAC_Update(CMAC_CTX *ctx, const uint8_t *in, size_t in_len) { + size_t block_size = EVP_CIPHER_CTX_block_size(&ctx->cipher_ctx); + assert(block_size <= AES_BLOCK_SIZE); + uint8_t scratch[AES_BLOCK_SIZE]; + + if (ctx->block_used > 0) { + size_t todo = block_size - ctx->block_used; + if (in_len < todo) { + todo = in_len; + } + + OPENSSL_memcpy(ctx->block + ctx->block_used, in, todo); + in += todo; + in_len -= todo; + ctx->block_used += todo; + + // If |in_len| is zero then either |ctx->block_used| is less than + // |block_size|, in which case we can stop here, or |ctx->block_used| is + // exactly |block_size| but there's no more data to process. In the latter + // case we don't want to process this block now because it might be the last + // block and that block is treated specially. + if (in_len == 0) { + return 1; + } + + assert(ctx->block_used == block_size); + + if (!EVP_Cipher(&ctx->cipher_ctx, scratch, ctx->block, block_size)) { + return 0; + } + } + + // Encrypt all but one of the remaining blocks. + while (in_len > block_size) { + if (!EVP_Cipher(&ctx->cipher_ctx, scratch, in, block_size)) { + return 0; + } + in += block_size; + in_len -= block_size; + } + + OPENSSL_memcpy(ctx->block, in, in_len); + ctx->block_used = in_len; + + return 1; +} + +int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len) { + size_t block_size = EVP_CIPHER_CTX_block_size(&ctx->cipher_ctx); + assert(block_size <= AES_BLOCK_SIZE); + + *out_len = block_size; + if (out == NULL) { + return 1; + } + + const uint8_t *mask = ctx->k1; + + if (ctx->block_used != block_size) { + // If the last block is incomplete, terminate it with a single 'one' bit + // followed by zeros. + ctx->block[ctx->block_used] = 0x80; + OPENSSL_memset(ctx->block + ctx->block_used + 1, 0, + block_size - (ctx->block_used + 1)); + + mask = ctx->k2; + } + + for (unsigned i = 0; i < block_size; i++) { + out[i] = ctx->block[i] ^ mask[i]; + } + + return EVP_Cipher(&ctx->cipher_ctx, out, out, block_size); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c.grpc_back new file mode 100644 index 000000000..b6a10f79d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cmac/cmac.c.grpc_back @@ -0,0 +1,278 @@ +/* ==================================================================== + * Copyright (c) 2010 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include +#include + +#include +#include +#include + +#include "../internal.h" + + +struct cmac_ctx_st { + EVP_CIPHER_CTX cipher_ctx; + // k1 and k2 are the CMAC subkeys. See + // https://tools.ietf.org/html/rfc4493#section-2.3 + uint8_t k1[AES_BLOCK_SIZE]; + uint8_t k2[AES_BLOCK_SIZE]; + // Last (possibly partial) scratch + uint8_t block[AES_BLOCK_SIZE]; + // block_used contains the number of valid bytes in |block|. + unsigned block_used; +}; + +static void CMAC_CTX_init(CMAC_CTX *ctx) { + EVP_CIPHER_CTX_init(&ctx->cipher_ctx); +} + +static void CMAC_CTX_cleanup(CMAC_CTX *ctx) { + EVP_CIPHER_CTX_cleanup(&ctx->cipher_ctx); + OPENSSL_cleanse(ctx->k1, sizeof(ctx->k1)); + OPENSSL_cleanse(ctx->k2, sizeof(ctx->k2)); + OPENSSL_cleanse(ctx->block, sizeof(ctx->block)); +} + +int AES_CMAC(uint8_t out[16], const uint8_t *key, size_t key_len, + const uint8_t *in, size_t in_len) { + const EVP_CIPHER *cipher; + switch (key_len) { + case 16: + cipher = EVP_aes_128_cbc(); + break; + case 32: + cipher = EVP_aes_256_cbc(); + break; + default: + return 0; + } + + size_t scratch_out_len; + CMAC_CTX ctx; + CMAC_CTX_init(&ctx); + + const int ok = CMAC_Init(&ctx, key, key_len, cipher, NULL /* engine */) && + CMAC_Update(&ctx, in, in_len) && + CMAC_Final(&ctx, out, &scratch_out_len); + + CMAC_CTX_cleanup(&ctx); + return ok; +} + +CMAC_CTX *CMAC_CTX_new(void) { + CMAC_CTX *ctx = OPENSSL_malloc(sizeof(*ctx)); + if (ctx != NULL) { + CMAC_CTX_init(ctx); + } + return ctx; +} + +void CMAC_CTX_free(CMAC_CTX *ctx) { + if (ctx == NULL) { + return; + } + + CMAC_CTX_cleanup(ctx); + OPENSSL_free(ctx); +} + +int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in) { + if (!EVP_CIPHER_CTX_copy(&out->cipher_ctx, &in->cipher_ctx)) { + return 0; + } + OPENSSL_memcpy(out->k1, in->k1, AES_BLOCK_SIZE); + OPENSSL_memcpy(out->k2, in->k2, AES_BLOCK_SIZE); + OPENSSL_memcpy(out->block, in->block, AES_BLOCK_SIZE); + out->block_used = in->block_used; + return 1; +} + +// binary_field_mul_x_128 treats the 128 bits at |in| as an element of GF(2¹²⁸) +// with a hard-coded reduction polynomial and sets |out| as x times the input. +// +// See https://tools.ietf.org/html/rfc4493#section-2.3 +static void binary_field_mul_x_128(uint8_t out[16], const uint8_t in[16]) { + unsigned i; + + // Shift |in| to left, including carry. + for (i = 0; i < 15; i++) { + out[i] = (in[i] << 1) | (in[i+1] >> 7); + } + + // If MSB set fixup with R. + const uint8_t carry = in[0] >> 7; + out[i] = (in[i] << 1) ^ ((0 - carry) & 0x87); +} + +// binary_field_mul_x_64 behaves like |binary_field_mul_x_128| but acts on an +// element of GF(2⁶⁴). +// +// See https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-38b.pdf +static void binary_field_mul_x_64(uint8_t out[8], const uint8_t in[8]) { + unsigned i; + + // Shift |in| to left, including carry. + for (i = 0; i < 7; i++) { + out[i] = (in[i] << 1) | (in[i+1] >> 7); + } + + // If MSB set fixup with R. + const uint8_t carry = in[0] >> 7; + out[i] = (in[i] << 1) ^ ((0 - carry) & 0x1b); +} + +static const uint8_t kZeroIV[AES_BLOCK_SIZE] = {0}; + +int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t key_len, + const EVP_CIPHER *cipher, ENGINE *engine) { + uint8_t scratch[AES_BLOCK_SIZE]; + + size_t block_size = EVP_CIPHER_block_size(cipher); + if ((block_size != AES_BLOCK_SIZE && block_size != 8 /* 3-DES */) || + EVP_CIPHER_key_length(cipher) != key_len || + !EVP_EncryptInit_ex(&ctx->cipher_ctx, cipher, NULL, key, kZeroIV) || + !EVP_Cipher(&ctx->cipher_ctx, scratch, kZeroIV, block_size) || + // Reset context again ready for first data. + !EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV)) { + return 0; + } + + if (block_size == AES_BLOCK_SIZE) { + binary_field_mul_x_128(ctx->k1, scratch); + binary_field_mul_x_128(ctx->k2, ctx->k1); + } else { + binary_field_mul_x_64(ctx->k1, scratch); + binary_field_mul_x_64(ctx->k2, ctx->k1); + } + ctx->block_used = 0; + + return 1; +} + +int CMAC_Reset(CMAC_CTX *ctx) { + ctx->block_used = 0; + return EVP_EncryptInit_ex(&ctx->cipher_ctx, NULL, NULL, NULL, kZeroIV); +} + +int CMAC_Update(CMAC_CTX *ctx, const uint8_t *in, size_t in_len) { + size_t block_size = EVP_CIPHER_CTX_block_size(&ctx->cipher_ctx); + assert(block_size <= AES_BLOCK_SIZE); + uint8_t scratch[AES_BLOCK_SIZE]; + + if (ctx->block_used > 0) { + size_t todo = block_size - ctx->block_used; + if (in_len < todo) { + todo = in_len; + } + + OPENSSL_memcpy(ctx->block + ctx->block_used, in, todo); + in += todo; + in_len -= todo; + ctx->block_used += todo; + + // If |in_len| is zero then either |ctx->block_used| is less than + // |block_size|, in which case we can stop here, or |ctx->block_used| is + // exactly |block_size| but there's no more data to process. In the latter + // case we don't want to process this block now because it might be the last + // block and that block is treated specially. + if (in_len == 0) { + return 1; + } + + assert(ctx->block_used == block_size); + + if (!EVP_Cipher(&ctx->cipher_ctx, scratch, ctx->block, block_size)) { + return 0; + } + } + + // Encrypt all but one of the remaining blocks. + while (in_len > block_size) { + if (!EVP_Cipher(&ctx->cipher_ctx, scratch, in, block_size)) { + return 0; + } + in += block_size; + in_len -= block_size; + } + + OPENSSL_memcpy(ctx->block, in, in_len); + ctx->block_used = in_len; + + return 1; +} + +int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len) { + size_t block_size = EVP_CIPHER_CTX_block_size(&ctx->cipher_ctx); + assert(block_size <= AES_BLOCK_SIZE); + + *out_len = block_size; + if (out == NULL) { + return 1; + } + + const uint8_t *mask = ctx->k1; + + if (ctx->block_used != block_size) { + // If the last block is incomplete, terminate it with a single 'one' bit + // followed by zeros. + ctx->block[ctx->block_used] = 0x80; + OPENSSL_memset(ctx->block + ctx->block_used + 1, 0, + block_size - (ctx->block_used + 1)); + + mask = ctx->k2; + } + + for (unsigned i = 0; i < block_size; i++) { + out[i] = ctx->block[i] ^ mask[i]; + } + + return EVP_Cipher(&ctx->cipher_ctx, out, out, block_size); +} diff --git a/Pods/BoringSSL-GRPC/crypto/conf/conf.c b/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/conf/conf.c rename to Pods/BoringSSL-GRPC/src/crypto/conf/conf.c index d16a6386b..5ae7f1175 100644 --- a/Pods/BoringSSL-GRPC/crypto/conf/conf.c +++ b/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c @@ -62,6 +62,7 @@ #include #include #include +#include #include #include "conf_def.h" @@ -69,6 +70,12 @@ #include "../internal.h" +DEFINE_LHASH_OF(CONF_VALUE) + +struct conf_st { + LHASH_OF(CONF_VALUE) *data; +}; + // The maximum length we can grow a value to after variable expansion. 64k // should be more than enough for all reasonable uses. #define MAX_CONF_VALUE_LENGTH 65536 diff --git a/Pods/BoringSSL-GRPC/crypto/conf/conf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/conf/conf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/conf/conf.c.grpc_back index b1982f82a..7070ca899 100644 --- a/Pods/BoringSSL-GRPC/crypto/conf/conf.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/conf/conf.c.grpc_back @@ -62,6 +62,7 @@ #include #include #include +#include #include #include "conf_def.h" @@ -69,6 +70,12 @@ #include "../internal.h" +DEFINE_LHASH_OF(CONF_VALUE) + +struct conf_st { + LHASH_OF(CONF_VALUE) *data; +}; + // The maximum length we can grow a value to after variable expansion. 64k // should be more than enough for all reasonable uses. #define MAX_CONF_VALUE_LENGTH 65536 diff --git a/Pods/BoringSSL-GRPC/crypto/conf/conf_def.h b/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/conf/conf_def.h rename to Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h diff --git a/Pods/BoringSSL-GRPC/crypto/conf/conf_def.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/conf/conf_def.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/conf/conf_def.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/conf/internal.h b/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/conf/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/conf/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/conf/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/conf/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/conf/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/conf/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-aarch64-fuchsia.c b/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-aarch64-fuchsia.c rename to Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-aarch64-fuchsia.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-aarch64-fuchsia.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-fuchsia.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-aarch64-linux.c b/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-aarch64-linux.c rename to Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-aarch64-linux.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-aarch64-linux.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cpu-aarch64-linux.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c new file mode 100644 index 000000000..1cde16fd5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c @@ -0,0 +1,218 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#if defined(OPENSSL_ARM) && !defined(OPENSSL_STATIC_ARMCAP) +#include +#include +#include +#include + +#include +#include + +#include "cpu-arm-linux.h" + +#define AT_HWCAP 16 +#define AT_HWCAP2 26 + +// |getauxval| is not available on Android until API level 20. Link it as a weak +// symbol and use other methods as fallback. +unsigned long getauxval(unsigned long type) __attribute__((weak)); + +static int open_eintr(const char *path, int flags) { + int ret; + do { + ret = open(path, flags); + } while (ret < 0 && errno == EINTR); + return ret; +} + +static ssize_t read_eintr(int fd, void *out, size_t len) { + ssize_t ret; + do { + ret = read(fd, out, len); + } while (ret < 0 && errno == EINTR); + return ret; +} + +// read_full reads exactly |len| bytes from |fd| to |out|. On error or end of +// file, it returns zero. +static int read_full(int fd, void *out, size_t len) { + char *outp = out; + while (len > 0) { + ssize_t ret = read_eintr(fd, outp, len); + if (ret <= 0) { + return 0; + } + outp += ret; + len -= ret; + } + return 1; +} + +// read_file opens |path| and reads until end-of-file. On success, it returns +// one and sets |*out_ptr| and |*out_len| to a newly-allocated buffer with the +// contents. Otherwise, it returns zero. +static int read_file(char **out_ptr, size_t *out_len, const char *path) { + int fd = open_eintr(path, O_RDONLY); + if (fd < 0) { + return 0; + } + + static const size_t kReadSize = 1024; + int ret = 0; + size_t cap = kReadSize, len = 0; + char *buf = OPENSSL_malloc(cap); + if (buf == NULL) { + goto err; + } + + for (;;) { + if (cap - len < kReadSize) { + size_t new_cap = cap * 2; + if (new_cap < cap) { + goto err; + } + char *new_buf = OPENSSL_realloc(buf, new_cap); + if (new_buf == NULL) { + goto err; + } + buf = new_buf; + cap = new_cap; + } + + ssize_t bytes_read = read_eintr(fd, buf + len, kReadSize); + if (bytes_read < 0) { + goto err; + } + if (bytes_read == 0) { + break; + } + len += bytes_read; + } + + *out_ptr = buf; + *out_len = len; + ret = 1; + buf = NULL; + +err: + OPENSSL_free(buf); + close(fd); + return ret; +} + +// getauxval_proc behaves like |getauxval| but reads from /proc/self/auxv. +static unsigned long getauxval_proc(unsigned long type) { + int fd = open_eintr("/proc/self/auxv", O_RDONLY); + if (fd < 0) { + return 0; + } + + struct { + unsigned long tag; + unsigned long value; + } entry; + + for (;;) { + if (!read_full(fd, &entry, sizeof(entry)) || + (entry.tag == 0 && entry.value == 0)) { + break; + } + if (entry.tag == type) { + close(fd); + return entry.value; + } + } + close(fd); + return 0; +} + +extern uint32_t OPENSSL_armcap_P; + +static int g_has_broken_neon, g_needs_hwcap2_workaround; + +void OPENSSL_cpuid_setup(void) { + char *cpuinfo_data; + size_t cpuinfo_len; + if (!read_file(&cpuinfo_data, &cpuinfo_len, "/proc/cpuinfo")) { + return; + } + STRING_PIECE cpuinfo; + cpuinfo.data = cpuinfo_data; + cpuinfo.len = cpuinfo_len; + + // |getauxval| is not available on Android until API level 20. If it is + // unavailable, read from /proc/self/auxv as a fallback. This is unreadable + // on some versions of Android, so further fall back to /proc/cpuinfo. + // + // See + // https://android.googlesource.com/platform/ndk/+/882ac8f3392858991a0e1af33b4b7387ec856bd2 + // and b/13679666 (Google-internal) for details. + unsigned long hwcap = 0; + if (getauxval != NULL) { + hwcap = getauxval(AT_HWCAP); + } + if (hwcap == 0) { + hwcap = getauxval_proc(AT_HWCAP); + } + if (hwcap == 0) { + hwcap = crypto_get_arm_hwcap_from_cpuinfo(&cpuinfo); + } + + // Clear NEON support if known broken. + g_has_broken_neon = crypto_cpuinfo_has_broken_neon(&cpuinfo); + if (g_has_broken_neon) { + hwcap &= ~HWCAP_NEON; + } + + // Matching OpenSSL, only report other features if NEON is present. + if (hwcap & HWCAP_NEON) { + OPENSSL_armcap_P |= ARMV7_NEON; + + // Some ARMv8 Android devices don't expose AT_HWCAP2. Fall back to + // /proc/cpuinfo. See https://crbug.com/596156. + unsigned long hwcap2 = 0; + if (getauxval != NULL) { + hwcap2 = getauxval(AT_HWCAP2); + } + if (hwcap2 == 0) { + hwcap2 = crypto_get_arm_hwcap2_from_cpuinfo(&cpuinfo); + g_needs_hwcap2_workaround = hwcap2 != 0; + } + + if (hwcap2 & HWCAP2_AES) { + OPENSSL_armcap_P |= ARMV8_AES; + } + if (hwcap2 & HWCAP2_PMULL) { + OPENSSL_armcap_P |= ARMV8_PMULL; + } + if (hwcap2 & HWCAP2_SHA1) { + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (hwcap2 & HWCAP2_SHA2) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } + } + + OPENSSL_free(cpuinfo_data); +} + +int CRYPTO_has_broken_NEON(void) { return g_has_broken_neon; } + +int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; } + +#endif // OPENSSL_ARM && !OPENSSL_STATIC_ARMCAP diff --git a/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c.grpc_back new file mode 100644 index 000000000..ed30715ba --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.c.grpc_back @@ -0,0 +1,218 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#if defined(OPENSSL_ARM) && !defined(OPENSSL_STATIC_ARMCAP) +#include +#include +#include +#include + +#include +#include + +#include "cpu-arm-linux.h" + +#define AT_HWCAP 16 +#define AT_HWCAP2 26 + +// |getauxval| is not available on Android until API level 20. Link it as a weak +// symbol and use other methods as fallback. +unsigned long getauxval(unsigned long type) __attribute__((weak)); + +static int open_eintr(const char *path, int flags) { + int ret; + do { + ret = open(path, flags); + } while (ret < 0 && errno == EINTR); + return ret; +} + +static ssize_t read_eintr(int fd, void *out, size_t len) { + ssize_t ret; + do { + ret = read(fd, out, len); + } while (ret < 0 && errno == EINTR); + return ret; +} + +// read_full reads exactly |len| bytes from |fd| to |out|. On error or end of +// file, it returns zero. +static int read_full(int fd, void *out, size_t len) { + char *outp = out; + while (len > 0) { + ssize_t ret = read_eintr(fd, outp, len); + if (ret <= 0) { + return 0; + } + outp += ret; + len -= ret; + } + return 1; +} + +// read_file opens |path| and reads until end-of-file. On success, it returns +// one and sets |*out_ptr| and |*out_len| to a newly-allocated buffer with the +// contents. Otherwise, it returns zero. +static int read_file(char **out_ptr, size_t *out_len, const char *path) { + int fd = open_eintr(path, O_RDONLY); + if (fd < 0) { + return 0; + } + + static const size_t kReadSize = 1024; + int ret = 0; + size_t cap = kReadSize, len = 0; + char *buf = OPENSSL_malloc(cap); + if (buf == NULL) { + goto err; + } + + for (;;) { + if (cap - len < kReadSize) { + size_t new_cap = cap * 2; + if (new_cap < cap) { + goto err; + } + char *new_buf = OPENSSL_realloc(buf, new_cap); + if (new_buf == NULL) { + goto err; + } + buf = new_buf; + cap = new_cap; + } + + ssize_t bytes_read = read_eintr(fd, buf + len, kReadSize); + if (bytes_read < 0) { + goto err; + } + if (bytes_read == 0) { + break; + } + len += bytes_read; + } + + *out_ptr = buf; + *out_len = len; + ret = 1; + buf = NULL; + +err: + OPENSSL_free(buf); + close(fd); + return ret; +} + +// getauxval_proc behaves like |getauxval| but reads from /proc/self/auxv. +static unsigned long getauxval_proc(unsigned long type) { + int fd = open_eintr("/proc/self/auxv", O_RDONLY); + if (fd < 0) { + return 0; + } + + struct { + unsigned long tag; + unsigned long value; + } entry; + + for (;;) { + if (!read_full(fd, &entry, sizeof(entry)) || + (entry.tag == 0 && entry.value == 0)) { + break; + } + if (entry.tag == type) { + close(fd); + return entry.value; + } + } + close(fd); + return 0; +} + +extern uint32_t OPENSSL_armcap_P; + +static int g_has_broken_neon, g_needs_hwcap2_workaround; + +void OPENSSL_cpuid_setup(void) { + char *cpuinfo_data; + size_t cpuinfo_len; + if (!read_file(&cpuinfo_data, &cpuinfo_len, "/proc/cpuinfo")) { + return; + } + STRING_PIECE cpuinfo; + cpuinfo.data = cpuinfo_data; + cpuinfo.len = cpuinfo_len; + + // |getauxval| is not available on Android until API level 20. If it is + // unavailable, read from /proc/self/auxv as a fallback. This is unreadable + // on some versions of Android, so further fall back to /proc/cpuinfo. + // + // See + // https://android.googlesource.com/platform/ndk/+/882ac8f3392858991a0e1af33b4b7387ec856bd2 + // and b/13679666 (Google-internal) for details. + unsigned long hwcap = 0; + if (getauxval != NULL) { + hwcap = getauxval(AT_HWCAP); + } + if (hwcap == 0) { + hwcap = getauxval_proc(AT_HWCAP); + } + if (hwcap == 0) { + hwcap = crypto_get_arm_hwcap_from_cpuinfo(&cpuinfo); + } + + // Clear NEON support if known broken. + g_has_broken_neon = crypto_cpuinfo_has_broken_neon(&cpuinfo); + if (g_has_broken_neon) { + hwcap &= ~HWCAP_NEON; + } + + // Matching OpenSSL, only report other features if NEON is present. + if (hwcap & HWCAP_NEON) { + OPENSSL_armcap_P |= ARMV7_NEON; + + // Some ARMv8 Android devices don't expose AT_HWCAP2. Fall back to + // /proc/cpuinfo. See https://crbug.com/596156. + unsigned long hwcap2 = 0; + if (getauxval != NULL) { + hwcap2 = getauxval(AT_HWCAP2); + } + if (hwcap2 == 0) { + hwcap2 = crypto_get_arm_hwcap2_from_cpuinfo(&cpuinfo); + g_needs_hwcap2_workaround = hwcap2 != 0; + } + + if (hwcap2 & HWCAP2_AES) { + OPENSSL_armcap_P |= ARMV8_AES; + } + if (hwcap2 & HWCAP2_PMULL) { + OPENSSL_armcap_P |= ARMV8_PMULL; + } + if (hwcap2 & HWCAP2_SHA1) { + OPENSSL_armcap_P |= ARMV8_SHA1; + } + if (hwcap2 & HWCAP2_SHA2) { + OPENSSL_armcap_P |= ARMV8_SHA256; + } + } + + OPENSSL_free(cpuinfo_data); +} + +int CRYPTO_has_broken_NEON(void) { return g_has_broken_neon; } + +int CRYPTO_needs_hwcap2_workaround(void) { return g_needs_hwcap2_workaround; } + +#endif // OPENSSL_ARM && !OPENSSL_STATIC_ARMCAP diff --git a/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h new file mode 100644 index 000000000..0fd8c69f1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h @@ -0,0 +1,201 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_CPU_ARM_LINUX_H +#define OPENSSL_HEADER_CRYPTO_CPU_ARM_LINUX_H + +#include + +#include + +#include "internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// The cpuinfo parser lives in a header file so it may be accessible from +// cross-platform fuzzers without adding code to those platforms normally. + +#define HWCAP_NEON (1 << 12) + +// See /usr/include/asm/hwcap.h on an ARM installation for the source of +// these values. +#define HWCAP2_AES (1 << 0) +#define HWCAP2_PMULL (1 << 1) +#define HWCAP2_SHA1 (1 << 2) +#define HWCAP2_SHA2 (1 << 3) + +typedef struct { + const char *data; + size_t len; +} STRING_PIECE; + +static int STRING_PIECE_equals(const STRING_PIECE *a, const char *b) { + size_t b_len = strlen(b); + return a->len == b_len && OPENSSL_memcmp(a->data, b, b_len) == 0; +} + +// STRING_PIECE_split finds the first occurence of |sep| in |in| and, if found, +// sets |*out_left| and |*out_right| to |in| split before and after it. It +// returns one if |sep| was found and zero otherwise. +static int STRING_PIECE_split(STRING_PIECE *out_left, STRING_PIECE *out_right, + const STRING_PIECE *in, char sep) { + const char *p = (const char *)OPENSSL_memchr(in->data, sep, in->len); + if (p == NULL) { + return 0; + } + // |out_left| or |out_right| may alias |in|, so make a copy. + STRING_PIECE in_copy = *in; + out_left->data = in_copy.data; + out_left->len = p - in_copy.data; + out_right->data = in_copy.data + out_left->len + 1; + out_right->len = in_copy.len - out_left->len - 1; + return 1; +} + +// STRING_PIECE_get_delimited reads a |sep|-delimited entry from |s|, writing it +// to |out| and updating |s| to point beyond it. It returns one on success and +// zero if |s| is empty. If |s| is has no copies of |sep| and is non-empty, it +// reads the entire string to |out|. +static int STRING_PIECE_get_delimited(STRING_PIECE *s, STRING_PIECE *out, char sep) { + if (s->len == 0) { + return 0; + } + if (!STRING_PIECE_split(out, s, s, sep)) { + // |s| had no instances of |sep|. Return the entire string. + *out = *s; + s->data += s->len; + s->len = 0; + } + return 1; +} + +// STRING_PIECE_trim removes leading and trailing whitespace from |s|. +static void STRING_PIECE_trim(STRING_PIECE *s) { + while (s->len != 0 && (s->data[0] == ' ' || s->data[0] == '\t')) { + s->data++; + s->len--; + } + while (s->len != 0 && + (s->data[s->len - 1] == ' ' || s->data[s->len - 1] == '\t')) { + s->len--; + } +} + +// extract_cpuinfo_field extracts a /proc/cpuinfo field named |field| from +// |in|. If found, it sets |*out| to the value and returns one. Otherwise, it +// returns zero. +static int extract_cpuinfo_field(STRING_PIECE *out, const STRING_PIECE *in, + const char *field) { + // Process |in| one line at a time. + STRING_PIECE remaining = *in, line; + while (STRING_PIECE_get_delimited(&remaining, &line, '\n')) { + STRING_PIECE key, value; + if (!STRING_PIECE_split(&key, &value, &line, ':')) { + continue; + } + STRING_PIECE_trim(&key); + if (STRING_PIECE_equals(&key, field)) { + STRING_PIECE_trim(&value); + *out = value; + return 1; + } + } + + return 0; +} + +static int cpuinfo_field_equals(const STRING_PIECE *cpuinfo, const char *field, + const char *value) { + STRING_PIECE extracted; + return extract_cpuinfo_field(&extracted, cpuinfo, field) && + STRING_PIECE_equals(&extracted, value); +} + +// has_list_item treats |list| as a space-separated list of items and returns +// one if |item| is contained in |list| and zero otherwise. +static int has_list_item(const STRING_PIECE *list, const char *item) { + STRING_PIECE remaining = *list, feature; + while (STRING_PIECE_get_delimited(&remaining, &feature, ' ')) { + if (STRING_PIECE_equals(&feature, item)) { + return 1; + } + } + return 0; +} + +// crypto_get_arm_hwcap_from_cpuinfo returns an equivalent ARM |AT_HWCAP| value +// from |cpuinfo|. +static unsigned long crypto_get_arm_hwcap_from_cpuinfo( + const STRING_PIECE *cpuinfo) { + if (cpuinfo_field_equals(cpuinfo, "CPU architecture", "8")) { + // This is a 32-bit ARM binary running on a 64-bit kernel. NEON is always + // available on ARMv8. Linux omits required features, so reading the + // "Features" line does not work. (For simplicity, use strict equality. We + // assume everything running on future ARM architectures will have a + // working |getauxval|.) + return HWCAP_NEON; + } + + STRING_PIECE features; + if (extract_cpuinfo_field(&features, cpuinfo, "Features") && + has_list_item(&features, "neon")) { + return HWCAP_NEON; + } + return 0; +} + +// crypto_get_arm_hwcap2_from_cpuinfo returns an equivalent ARM |AT_HWCAP2| +// value from |cpuinfo|. +static unsigned long crypto_get_arm_hwcap2_from_cpuinfo( + const STRING_PIECE *cpuinfo) { + STRING_PIECE features; + if (!extract_cpuinfo_field(&features, cpuinfo, "Features")) { + return 0; + } + + unsigned long ret = 0; + if (has_list_item(&features, "aes")) { + ret |= HWCAP2_AES; + } + if (has_list_item(&features, "pmull")) { + ret |= HWCAP2_PMULL; + } + if (has_list_item(&features, "sha1")) { + ret |= HWCAP2_SHA1; + } + if (has_list_item(&features, "sha2")) { + ret |= HWCAP2_SHA2; + } + return ret; +} + +// crypto_cpuinfo_has_broken_neon returns one if |cpuinfo| matches a CPU known +// to have broken NEON unit and zero otherwise. See https://crbug.com/341598. +static int crypto_cpuinfo_has_broken_neon(const STRING_PIECE *cpuinfo) { + return cpuinfo_field_equals(cpuinfo, "CPU implementer", "0x51") && + cpuinfo_field_equals(cpuinfo, "CPU architecture", "7") && + cpuinfo_field_equals(cpuinfo, "CPU variant", "0x1") && + cpuinfo_field_equals(cpuinfo, "CPU part", "0x04d") && + cpuinfo_field_equals(cpuinfo, "CPU revision", "0"); +} + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_CPU_ARM_LINUX_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h.grpc_back new file mode 100644 index 000000000..e326285f3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm-linux.h.grpc_back @@ -0,0 +1,201 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_CPU_ARM_LINUX_H +#define OPENSSL_HEADER_CRYPTO_CPU_ARM_LINUX_H + +#include + +#include + +#include "internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// The cpuinfo parser lives in a header file so it may be accessible from +// cross-platform fuzzers without adding code to those platforms normally. + +#define HWCAP_NEON (1 << 12) + +// See /usr/include/asm/hwcap.h on an ARM installation for the source of +// these values. +#define HWCAP2_AES (1 << 0) +#define HWCAP2_PMULL (1 << 1) +#define HWCAP2_SHA1 (1 << 2) +#define HWCAP2_SHA2 (1 << 3) + +typedef struct { + const char *data; + size_t len; +} STRING_PIECE; + +static int STRING_PIECE_equals(const STRING_PIECE *a, const char *b) { + size_t b_len = strlen(b); + return a->len == b_len && OPENSSL_memcmp(a->data, b, b_len) == 0; +} + +// STRING_PIECE_split finds the first occurence of |sep| in |in| and, if found, +// sets |*out_left| and |*out_right| to |in| split before and after it. It +// returns one if |sep| was found and zero otherwise. +static int STRING_PIECE_split(STRING_PIECE *out_left, STRING_PIECE *out_right, + const STRING_PIECE *in, char sep) { + const char *p = (const char *)OPENSSL_memchr(in->data, sep, in->len); + if (p == NULL) { + return 0; + } + // |out_left| or |out_right| may alias |in|, so make a copy. + STRING_PIECE in_copy = *in; + out_left->data = in_copy.data; + out_left->len = p - in_copy.data; + out_right->data = in_copy.data + out_left->len + 1; + out_right->len = in_copy.len - out_left->len - 1; + return 1; +} + +// STRING_PIECE_get_delimited reads a |sep|-delimited entry from |s|, writing it +// to |out| and updating |s| to point beyond it. It returns one on success and +// zero if |s| is empty. If |s| is has no copies of |sep| and is non-empty, it +// reads the entire string to |out|. +static int STRING_PIECE_get_delimited(STRING_PIECE *s, STRING_PIECE *out, char sep) { + if (s->len == 0) { + return 0; + } + if (!STRING_PIECE_split(out, s, s, sep)) { + // |s| had no instances of |sep|. Return the entire string. + *out = *s; + s->data += s->len; + s->len = 0; + } + return 1; +} + +// STRING_PIECE_trim removes leading and trailing whitespace from |s|. +static void STRING_PIECE_trim(STRING_PIECE *s) { + while (s->len != 0 && (s->data[0] == ' ' || s->data[0] == '\t')) { + s->data++; + s->len--; + } + while (s->len != 0 && + (s->data[s->len - 1] == ' ' || s->data[s->len - 1] == '\t')) { + s->len--; + } +} + +// extract_cpuinfo_field extracts a /proc/cpuinfo field named |field| from +// |in|. If found, it sets |*out| to the value and returns one. Otherwise, it +// returns zero. +static int extract_cpuinfo_field(STRING_PIECE *out, const STRING_PIECE *in, + const char *field) { + // Process |in| one line at a time. + STRING_PIECE remaining = *in, line; + while (STRING_PIECE_get_delimited(&remaining, &line, '\n')) { + STRING_PIECE key, value; + if (!STRING_PIECE_split(&key, &value, &line, ':')) { + continue; + } + STRING_PIECE_trim(&key); + if (STRING_PIECE_equals(&key, field)) { + STRING_PIECE_trim(&value); + *out = value; + return 1; + } + } + + return 0; +} + +static int cpuinfo_field_equals(const STRING_PIECE *cpuinfo, const char *field, + const char *value) { + STRING_PIECE extracted; + return extract_cpuinfo_field(&extracted, cpuinfo, field) && + STRING_PIECE_equals(&extracted, value); +} + +// has_list_item treats |list| as a space-separated list of items and returns +// one if |item| is contained in |list| and zero otherwise. +static int has_list_item(const STRING_PIECE *list, const char *item) { + STRING_PIECE remaining = *list, feature; + while (STRING_PIECE_get_delimited(&remaining, &feature, ' ')) { + if (STRING_PIECE_equals(&feature, item)) { + return 1; + } + } + return 0; +} + +// crypto_get_arm_hwcap_from_cpuinfo returns an equivalent ARM |AT_HWCAP| value +// from |cpuinfo|. +static unsigned long crypto_get_arm_hwcap_from_cpuinfo( + const STRING_PIECE *cpuinfo) { + if (cpuinfo_field_equals(cpuinfo, "CPU architecture", "8")) { + // This is a 32-bit ARM binary running on a 64-bit kernel. NEON is always + // available on ARMv8. Linux omits required features, so reading the + // "Features" line does not work. (For simplicity, use strict equality. We + // assume everything running on future ARM architectures will have a + // working |getauxval|.) + return HWCAP_NEON; + } + + STRING_PIECE features; + if (extract_cpuinfo_field(&features, cpuinfo, "Features") && + has_list_item(&features, "neon")) { + return HWCAP_NEON; + } + return 0; +} + +// crypto_get_arm_hwcap2_from_cpuinfo returns an equivalent ARM |AT_HWCAP2| +// value from |cpuinfo|. +static unsigned long crypto_get_arm_hwcap2_from_cpuinfo( + const STRING_PIECE *cpuinfo) { + STRING_PIECE features; + if (!extract_cpuinfo_field(&features, cpuinfo, "Features")) { + return 0; + } + + unsigned long ret = 0; + if (has_list_item(&features, "aes")) { + ret |= HWCAP2_AES; + } + if (has_list_item(&features, "pmull")) { + ret |= HWCAP2_PMULL; + } + if (has_list_item(&features, "sha1")) { + ret |= HWCAP2_SHA1; + } + if (has_list_item(&features, "sha2")) { + ret |= HWCAP2_SHA2; + } + return ret; +} + +// crypto_cpuinfo_has_broken_neon returns one if |cpuinfo| matches a CPU known +// to have broken NEON unit and zero otherwise. See https://crbug.com/341598. +static int crypto_cpuinfo_has_broken_neon(const STRING_PIECE *cpuinfo) { + return cpuinfo_field_equals(cpuinfo, "CPU implementer", "0x51") && + cpuinfo_field_equals(cpuinfo, "CPU architecture", "7") && + cpuinfo_field_equals(cpuinfo, "CPU variant", "0x1") && + cpuinfo_field_equals(cpuinfo, "CPU part", "0x04d") && + cpuinfo_field_equals(cpuinfo, "CPU revision", "0"); +} + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_CPU_ARM_LINUX_H diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-arm.c b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-arm.c rename to Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-arm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-arm.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cpu-arm.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-intel.c b/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c similarity index 83% rename from Pods/BoringSSL-GRPC/crypto/cpu-intel.c rename to Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c index 88c7bacbd..6de8f1982 100644 --- a/Pods/BoringSSL-GRPC/crypto/cpu-intel.c +++ b/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c @@ -54,10 +54,6 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - #include @@ -127,9 +123,17 @@ static uint64_t OPENSSL_xgetbv(uint32_t xcr) { // and |out[1]|. See the comment in |OPENSSL_cpuid_setup| about this. static void handle_cpu_env(uint32_t *out, const char *in) { const int invert = in[0] == '~'; + const int hex = in[invert] == '0' && in[invert+1] == 'x'; + + int sscanf_result; uint64_t v; + if (hex) { + sscanf_result = sscanf(in + invert + 2, "%" PRIx64, &v); + } else { + sscanf_result = sscanf(in + invert, "%" PRIu64, &v); + } - if (!sscanf(in + invert, "%" PRIu64, &v)) { + if (!sscanf_result) { return; } @@ -156,50 +160,43 @@ void OPENSSL_cpuid_setup(void) { edx == 0x69746e65 /* enti */ && ecx == 0x444d4163 /* cAMD */; - int has_amd_xop = 0; - if (is_amd) { - // AMD-specific logic. - // See http://developer.amd.com/wordpress/media/2012/10/254811.pdf - OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0x80000000); - uint32_t num_extended_ids = eax; - if (num_extended_ids >= 0x80000001) { - OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0x80000001); - if (ecx & (1u << 11)) { - has_amd_xop = 1; - } - } - } - - uint32_t extended_features = 0; + uint32_t extended_features[2] = {0}; if (num_ids >= 7) { OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 7); - extended_features = ebx; - } - - // Determine the number of cores sharing an L1 data cache to adjust the - // hyper-threading bit. - uint32_t cores_per_cache = 0; - if (is_amd) { - // AMD CPUs never share an L1 data cache between threads but do set the HTT - // bit on multi-core CPUs. - cores_per_cache = 1; - } else if (num_ids >= 4) { - // TODO(davidben): The Intel manual says this CPUID leaf enumerates all - // caches using ECX and doesn't say which is first. Does this matter? - OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 4); - cores_per_cache = 1 + ((eax >> 14) & 0xfff); + extended_features[0] = ebx; + extended_features[1] = ecx; } OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 1); - // Adjust the hyper-threading bit. - if (edx & (1u << 28)) { - uint32_t num_logical_cores = (ebx >> 16) & 0xff; - if (cores_per_cache == 1 || num_logical_cores <= 1) { - edx &= ~(1u << 28); + if (is_amd) { + // See https://www.amd.com/system/files/TechDocs/25481.pdf, page 10. + const uint32_t base_family = (eax >> 8) & 15; + const uint32_t base_model = (eax >> 4) & 15; + + uint32_t family = base_family; + uint32_t model = base_model; + if (base_family == 0xf) { + const uint32_t ext_family = (eax >> 20) & 255; + family += ext_family; + const uint32_t ext_model = (eax >> 16) & 15; + model |= ext_model << 4; + } + + if (family < 0x17 || (family == 0x17 && 0x70 <= model && model <= 0x7f)) { + // Disable RDRAND on AMD families before 0x17 (Zen) due to reported + // failures after suspend. + // https://bugzilla.redhat.com/show_bug.cgi?id=1150286 + // Also disable for family 0x17, models 0x70–0x7f, due to possible RDRAND + // failures there too. + ecx &= ~(1u << 30); } } + // Force the hyper-threading bit so that the more conservative path is always + // chosen. + edx |= 1u << 28; + // Reserved bit #20 was historically repurposed to control the in-memory // representation of RC4 state. Always set it to zero. edx &= ~(1u << 20); @@ -219,12 +216,9 @@ void OPENSSL_cpuid_setup(void) { edx &= ~(1u << 30); } - // The SDBG bit is repurposed to denote AMD XOP support. - if (has_amd_xop) { - ecx |= (1u << 11); - } else { - ecx &= ~(1u << 11); - } + // The SDBG bit is repurposed to denote AMD XOP support. Don't ever use AMD + // XOP code paths. + ecx &= ~(1u << 11); uint64_t xcr0 = 0; if (ecx & (1u << 27)) { @@ -241,26 +235,26 @@ void OPENSSL_cpuid_setup(void) { // // TODO(davidben): Should bits 17 and 26-28 also be cleared? Upstream // doesn't clear those. - extended_features &= + extended_features[0] &= ~((1u << 5) | (1u << 16) | (1u << 21) | (1u << 30) | (1u << 31)); } // See Intel manual, volume 1, section 15.2. if ((xcr0 & 0xe6) != 0xe6) { // Clear AVX512F. Note we don't touch other AVX512 extensions because they // can be used with YMM. - extended_features &= ~(1u << 16); + extended_features[0] &= ~(1u << 16); } // Disable ADX instructions on Knights Landing. See OpenSSL commit // 64d92d74985ebb3d0be58a9718f9e080a14a8e7f. if ((ecx & (1u << 26)) == 0) { - extended_features &= ~(1u << 19); + extended_features[0] &= ~(1u << 19); } OPENSSL_ia32cap_P[0] = edx; OPENSSL_ia32cap_P[1] = ecx; - OPENSSL_ia32cap_P[2] = extended_features; - OPENSSL_ia32cap_P[3] = 0; + OPENSSL_ia32cap_P[2] = extended_features[0]; + OPENSSL_ia32cap_P[3] = extended_features[1]; const char *env1, *env2; env1 = getenv("OPENSSL_ia32cap"); diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-intel.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c.grpc_back similarity index 83% rename from Pods/BoringSSL-GRPC/crypto/cpu-intel.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c.grpc_back index 1ac280c86..cc41fc47f 100644 --- a/Pods/BoringSSL-GRPC/crypto/cpu-intel.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/cpu-intel.c.grpc_back @@ -54,10 +54,6 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - #include @@ -127,9 +123,17 @@ static uint64_t OPENSSL_xgetbv(uint32_t xcr) { // and |out[1]|. See the comment in |OPENSSL_cpuid_setup| about this. static void handle_cpu_env(uint32_t *out, const char *in) { const int invert = in[0] == '~'; + const int hex = in[invert] == '0' && in[invert+1] == 'x'; + + int sscanf_result; uint64_t v; + if (hex) { + sscanf_result = sscanf(in + invert + 2, "%" PRIx64, &v); + } else { + sscanf_result = sscanf(in + invert, "%" PRIu64, &v); + } - if (!sscanf(in + invert, "%" PRIu64, &v)) { + if (!sscanf_result) { return; } @@ -156,50 +160,43 @@ void OPENSSL_cpuid_setup(void) { edx == 0x69746e65 /* enti */ && ecx == 0x444d4163 /* cAMD */; - int has_amd_xop = 0; - if (is_amd) { - // AMD-specific logic. - // See http://developer.amd.com/wordpress/media/2012/10/254811.pdf - OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0x80000000); - uint32_t num_extended_ids = eax; - if (num_extended_ids >= 0x80000001) { - OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 0x80000001); - if (ecx & (1u << 11)) { - has_amd_xop = 1; - } - } - } - - uint32_t extended_features = 0; + uint32_t extended_features[2] = {0}; if (num_ids >= 7) { OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 7); - extended_features = ebx; - } - - // Determine the number of cores sharing an L1 data cache to adjust the - // hyper-threading bit. - uint32_t cores_per_cache = 0; - if (is_amd) { - // AMD CPUs never share an L1 data cache between threads but do set the HTT - // bit on multi-core CPUs. - cores_per_cache = 1; - } else if (num_ids >= 4) { - // TODO(davidben): The Intel manual says this CPUID leaf enumerates all - // caches using ECX and doesn't say which is first. Does this matter? - OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 4); - cores_per_cache = 1 + ((eax >> 14) & 0xfff); + extended_features[0] = ebx; + extended_features[1] = ecx; } OPENSSL_cpuid(&eax, &ebx, &ecx, &edx, 1); - // Adjust the hyper-threading bit. - if (edx & (1u << 28)) { - uint32_t num_logical_cores = (ebx >> 16) & 0xff; - if (cores_per_cache == 1 || num_logical_cores <= 1) { - edx &= ~(1u << 28); + if (is_amd) { + // See https://www.amd.com/system/files/TechDocs/25481.pdf, page 10. + const uint32_t base_family = (eax >> 8) & 15; + const uint32_t base_model = (eax >> 4) & 15; + + uint32_t family = base_family; + uint32_t model = base_model; + if (base_family == 0xf) { + const uint32_t ext_family = (eax >> 20) & 255; + family += ext_family; + const uint32_t ext_model = (eax >> 16) & 15; + model |= ext_model << 4; + } + + if (family < 0x17 || (family == 0x17 && 0x70 <= model && model <= 0x7f)) { + // Disable RDRAND on AMD families before 0x17 (Zen) due to reported + // failures after suspend. + // https://bugzilla.redhat.com/show_bug.cgi?id=1150286 + // Also disable for family 0x17, models 0x70–0x7f, due to possible RDRAND + // failures there too. + ecx &= ~(1u << 30); } } + // Force the hyper-threading bit so that the more conservative path is always + // chosen. + edx |= 1u << 28; + // Reserved bit #20 was historically repurposed to control the in-memory // representation of RC4 state. Always set it to zero. edx &= ~(1u << 20); @@ -219,12 +216,9 @@ void OPENSSL_cpuid_setup(void) { edx &= ~(1u << 30); } - // The SDBG bit is repurposed to denote AMD XOP support. - if (has_amd_xop) { - ecx |= (1u << 11); - } else { - ecx &= ~(1u << 11); - } + // The SDBG bit is repurposed to denote AMD XOP support. Don't ever use AMD + // XOP code paths. + ecx &= ~(1u << 11); uint64_t xcr0 = 0; if (ecx & (1u << 27)) { @@ -241,26 +235,26 @@ void OPENSSL_cpuid_setup(void) { // // TODO(davidben): Should bits 17 and 26-28 also be cleared? Upstream // doesn't clear those. - extended_features &= + extended_features[0] &= ~((1u << 5) | (1u << 16) | (1u << 21) | (1u << 30) | (1u << 31)); } // See Intel manual, volume 1, section 15.2. if ((xcr0 & 0xe6) != 0xe6) { // Clear AVX512F. Note we don't touch other AVX512 extensions because they // can be used with YMM. - extended_features &= ~(1u << 16); + extended_features[0] &= ~(1u << 16); } // Disable ADX instructions on Knights Landing. See OpenSSL commit // 64d92d74985ebb3d0be58a9718f9e080a14a8e7f. if ((ecx & (1u << 26)) == 0) { - extended_features &= ~(1u << 19); + extended_features[0] &= ~(1u << 19); } OPENSSL_ia32cap_P[0] = edx; OPENSSL_ia32cap_P[1] = ecx; - OPENSSL_ia32cap_P[2] = extended_features; - OPENSSL_ia32cap_P[3] = 0; + OPENSSL_ia32cap_P[2] = extended_features[0]; + OPENSSL_ia32cap_P[3] = extended_features[1]; const char *env1, *env2; env1 = getenv("OPENSSL_ia32cap"); diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-ppc64le.c b/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-ppc64le.c rename to Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c diff --git a/Pods/BoringSSL-GRPC/crypto/cpu-ppc64le.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/cpu-ppc64le.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/cpu-ppc64le.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/crypto.c b/Pods/BoringSSL-GRPC/src/crypto/crypto.c similarity index 81% rename from Pods/BoringSSL-GRPC/crypto/crypto.c rename to Pods/BoringSSL-GRPC/src/crypto/crypto.c index e892bb45a..f28988116 100644 --- a/Pods/BoringSSL-GRPC/crypto/crypto.c +++ b/Pods/BoringSSL-GRPC/src/crypto/crypto.c @@ -36,8 +36,8 @@ #define BORINGSSL_NO_STATIC_INITIALIZER #endif -#endif /* !OPENSSL_NO_ASM && (OPENSSL_X86 || OPENSSL_X86_64 || - OPENSSL_ARM || OPENSSL_AARCH64) */ +#endif // !NO_ASM && !STATIC_ARMCAP && + // (X86 || X86_64 || ARM || AARCH64 || PPC64LE) // Our assembly does not use the GOT to reference symbols, which means @@ -60,8 +60,7 @@ // that tests the capability values will still skip the constructor but, so // far, the init constructor function only sets the capability variables. -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) - +#if defined(BORINGSSL_DISPATCH_TEST) // This value must be explicitly initialised to zero in order to work around a // bug in libtool or the linker on OS X. // @@ -69,6 +68,12 @@ // archive, linking on OS X will fail to resolve common symbols. By // initialising it to zero, it becomes a "data symbol", which isn't so // affected. +HIDDEN uint8_t BORINGSSL_function_hit[7] = {0}; +#endif + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) + +// This value must be explicitly initialized to zero. See similar comment above. HIDDEN uint32_t OPENSSL_ia32cap_P[4] = {0}; #elif defined(OPENSSL_PPC64LE) @@ -82,7 +87,8 @@ HIDDEN unsigned long OPENSSL_ppc64le_hwcap2 = 0; #if defined(OPENSSL_STATIC_ARMCAP) HIDDEN uint32_t OPENSSL_armcap_P = -#if defined(OPENSSL_STATIC_ARMCAP_NEON) || defined(__ARM_NEON__) +#if defined(OPENSSL_STATIC_ARMCAP_NEON) || \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) ARMV7_NEON | #endif #if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO) @@ -101,6 +107,10 @@ HIDDEN uint32_t OPENSSL_armcap_P = #else HIDDEN uint32_t OPENSSL_armcap_P = 0; + +uint32_t *OPENSSL_get_armcap_pointer_for_test(void) { + return &OPENSSL_armcap_P; +} #endif #endif @@ -164,31 +174,36 @@ int CRYPTO_has_asm(void) { #endif } -const char *SSLeay_version(int unused) { - return "BoringSSL"; +const char *SSLeay_version(int which) { return OpenSSL_version(which); } + +const char *OpenSSL_version(int which) { + switch (which) { + case OPENSSL_VERSION: + return "BoringSSL"; + case OPENSSL_CFLAGS: + return "compiler: n/a"; + case OPENSSL_BUILT_ON: + return "built on: n/a"; + case OPENSSL_PLATFORM: + return "platform: n/a"; + case OPENSSL_DIR: + return "OPENSSLDIR: n/a"; + default: + return "not available"; + } } -const char *OpenSSL_version(int unused) { - return "BoringSSL"; -} +unsigned long SSLeay(void) { return OPENSSL_VERSION_NUMBER; } -unsigned long SSLeay(void) { - return OPENSSL_VERSION_NUMBER; -} +unsigned long OpenSSL_version_num(void) { return OPENSSL_VERSION_NUMBER; } -unsigned long OpenSSL_version_num(void) { - return OPENSSL_VERSION_NUMBER; -} +int CRYPTO_malloc_init(void) { return 1; } -int CRYPTO_malloc_init(void) { - return 1; -} +int OPENSSL_malloc_init(void) { return 1; } void ENGINE_load_builtin_engines(void) {} -int ENGINE_register_all_complete(void) { - return 1; -} +int ENGINE_register_all_complete(void) { return 1; } void OPENSSL_load_builtin_modules(void) {} @@ -196,3 +211,5 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { CRYPTO_library_init(); return 1; } + +void OPENSSL_cleanup(void) {} diff --git a/Pods/BoringSSL-GRPC/crypto/crypto.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/crypto.c.grpc_back similarity index 81% rename from Pods/BoringSSL-GRPC/crypto/crypto.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/crypto.c.grpc_back index 9f4639f23..297240ec3 100644 --- a/Pods/BoringSSL-GRPC/crypto/crypto.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/crypto.c.grpc_back @@ -36,8 +36,8 @@ #define BORINGSSL_NO_STATIC_INITIALIZER #endif -#endif /* !OPENSSL_NO_ASM && (OPENSSL_X86 || OPENSSL_X86_64 || - OPENSSL_ARM || OPENSSL_AARCH64) */ +#endif // !NO_ASM && !STATIC_ARMCAP && + // (X86 || X86_64 || ARM || AARCH64 || PPC64LE) // Our assembly does not use the GOT to reference symbols, which means @@ -60,8 +60,7 @@ // that tests the capability values will still skip the constructor but, so // far, the init constructor function only sets the capability variables. -#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) - +#if defined(BORINGSSL_DISPATCH_TEST) // This value must be explicitly initialised to zero in order to work around a // bug in libtool or the linker on OS X. // @@ -69,6 +68,12 @@ // archive, linking on OS X will fail to resolve common symbols. By // initialising it to zero, it becomes a "data symbol", which isn't so // affected. +HIDDEN uint8_t BORINGSSL_function_hit[7] = {0}; +#endif + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) + +// This value must be explicitly initialized to zero. See similar comment above. HIDDEN uint32_t OPENSSL_ia32cap_P[4] = {0}; #elif defined(OPENSSL_PPC64LE) @@ -82,7 +87,8 @@ HIDDEN unsigned long OPENSSL_ppc64le_hwcap2 = 0; #if defined(OPENSSL_STATIC_ARMCAP) HIDDEN uint32_t OPENSSL_armcap_P = -#if defined(OPENSSL_STATIC_ARMCAP_NEON) || defined(__ARM_NEON__) +#if defined(OPENSSL_STATIC_ARMCAP_NEON) || \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) ARMV7_NEON | #endif #if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO) @@ -101,6 +107,10 @@ HIDDEN uint32_t OPENSSL_armcap_P = #else HIDDEN uint32_t OPENSSL_armcap_P = 0; + +uint32_t *OPENSSL_get_armcap_pointer_for_test(void) { + return &OPENSSL_armcap_P; +} #endif #endif @@ -164,31 +174,36 @@ int CRYPTO_has_asm(void) { #endif } -const char *SSLeay_version(int unused) { - return "BoringSSL"; +const char *SSLeay_version(int which) { return OpenSSL_version(which); } + +const char *OpenSSL_version(int which) { + switch (which) { + case OPENSSL_VERSION: + return "BoringSSL"; + case OPENSSL_CFLAGS: + return "compiler: n/a"; + case OPENSSL_BUILT_ON: + return "built on: n/a"; + case OPENSSL_PLATFORM: + return "platform: n/a"; + case OPENSSL_DIR: + return "OPENSSLDIR: n/a"; + default: + return "not available"; + } } -const char *OpenSSL_version(int unused) { - return "BoringSSL"; -} +unsigned long SSLeay(void) { return OPENSSL_VERSION_NUMBER; } -unsigned long SSLeay(void) { - return OPENSSL_VERSION_NUMBER; -} +unsigned long OpenSSL_version_num(void) { return OPENSSL_VERSION_NUMBER; } -unsigned long OpenSSL_version_num(void) { - return OPENSSL_VERSION_NUMBER; -} +int CRYPTO_malloc_init(void) { return 1; } -int CRYPTO_malloc_init(void) { - return 1; -} +int OPENSSL_malloc_init(void) { return 1; } void ENGINE_load_builtin_engines(void) {} -int ENGINE_register_all_complete(void) { - return 1; -} +int ENGINE_register_all_complete(void) { return 1; } void OPENSSL_load_builtin_modules(void) {} @@ -196,3 +211,5 @@ int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { CRYPTO_library_init(); return 1; } + +void OPENSSL_cleanup(void) {} diff --git a/Pods/BoringSSL-GRPC/crypto/curve25519/spake25519.c b/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/curve25519/spake25519.c rename to Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c index 1b54ff3d1..dc7151930 100644 --- a/Pods/BoringSSL-GRPC/crypto/curve25519/spake25519.c +++ b/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c @@ -481,7 +481,7 @@ int SPAKE2_process_msg(SPAKE2_CTX *ctx, uint8_t *out_key, size_t *out_key_len, } ge_p3 Qstar; - if (0 != x25519_ge_frombytes_vartime(&Qstar, their_msg)) { + if (!x25519_ge_frombytes_vartime(&Qstar, their_msg)) { // Point received from peer was not on the curve. return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/curve25519/spake25519.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/curve25519/spake25519.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c.grpc_back index e0ff9baee..650178cda 100644 --- a/Pods/BoringSSL-GRPC/crypto/curve25519/spake25519.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/curve25519/spake25519.c.grpc_back @@ -481,7 +481,7 @@ int SPAKE2_process_msg(SPAKE2_CTX *ctx, uint8_t *out_key, size_t *out_key_len, } ge_p3 Qstar; - if (0 != x25519_ge_frombytes_vartime(&Qstar, their_msg)) { + if (!x25519_ge_frombytes_vartime(&Qstar, their_msg)) { // Point received from peer was not on the curve. return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/dh/check.c b/Pods/BoringSSL-GRPC/src/crypto/dh/check.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/dh/check.c rename to Pods/BoringSSL-GRPC/src/crypto/dh/check.c index f5ece41d2..0b8518394 100644 --- a/Pods/BoringSSL-GRPC/crypto/dh/check.c +++ b/Pods/BoringSSL-GRPC/src/crypto/dh/check.c @@ -151,7 +151,7 @@ int DH_check(const DH *dh, int *out_flags) { *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; } } - r = BN_is_prime_ex(dh->q, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(dh->q, BN_prime_checks_for_validation, ctx, NULL); if (r < 0) { goto err; } @@ -188,7 +188,7 @@ int DH_check(const DH *dh, int *out_flags) { *out_flags |= DH_CHECK_UNABLE_TO_CHECK_GENERATOR; } - r = BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(dh->p, BN_prime_checks_for_validation, ctx, NULL); if (r < 0) { goto err; } @@ -198,7 +198,7 @@ int DH_check(const DH *dh, int *out_flags) { if (!BN_rshift1(t1, dh->p)) { goto err; } - r = BN_is_prime_ex(t1, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(t1, BN_prime_checks_for_validation, ctx, NULL); if (r < 0) { goto err; } diff --git a/Pods/BoringSSL-GRPC/crypto/dh/check.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/dh/check.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/dh/check.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/dh/check.c.grpc_back index 454ad44a1..5b6e03a51 100644 --- a/Pods/BoringSSL-GRPC/crypto/dh/check.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/dh/check.c.grpc_back @@ -151,7 +151,7 @@ int DH_check(const DH *dh, int *out_flags) { *out_flags |= DH_CHECK_NOT_SUITABLE_GENERATOR; } } - r = BN_is_prime_ex(dh->q, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(dh->q, BN_prime_checks_for_validation, ctx, NULL); if (r < 0) { goto err; } @@ -188,7 +188,7 @@ int DH_check(const DH *dh, int *out_flags) { *out_flags |= DH_CHECK_UNABLE_TO_CHECK_GENERATOR; } - r = BN_is_prime_ex(dh->p, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(dh->p, BN_prime_checks_for_validation, ctx, NULL); if (r < 0) { goto err; } @@ -198,7 +198,7 @@ int DH_check(const DH *dh, int *out_flags) { if (!BN_rshift1(t1, dh->p)) { goto err; } - r = BN_is_prime_ex(t1, BN_prime_checks, ctx, NULL); + r = BN_is_prime_ex(t1, BN_prime_checks_for_validation, ctx, NULL); if (r < 0) { goto err; } diff --git a/Pods/BoringSSL-GRPC/crypto/dh/dh.c b/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/dh/dh.c rename to Pods/BoringSSL-GRPC/src/crypto/dh/dh.c index e2166ce11..65457ff39 100644 --- a/Pods/BoringSSL-GRPC/crypto/dh/dh.c +++ b/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -476,7 +475,7 @@ static int int_dh_param_copy(DH *to, const DH *from, int is_x942) { to->seedlen = 0; if (from->seed) { - to->seed = BUF_memdup(from->seed, from->seedlen); + to->seed = OPENSSL_memdup(from->seed, from->seedlen); if (!to->seed) { return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/dh/dh.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/dh/dh.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/dh/dh.c.grpc_back index 7b7b83359..68d710d7c 100644 --- a/Pods/BoringSSL-GRPC/crypto/dh/dh.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/dh/dh.c.grpc_back @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -476,7 +475,7 @@ static int int_dh_param_copy(DH *to, const DH *from, int is_x942) { to->seedlen = 0; if (from->seed) { - to->seed = BUF_memdup(from->seed, from->seedlen); + to->seed = OPENSSL_memdup(from->seed, from->seedlen); if (!to->seed) { return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/dh/dh_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/dh/dh_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c diff --git a/Pods/BoringSSL-GRPC/crypto/dh/dh_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/dh/dh_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/dh/dh_asn1.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/dh/params.c b/Pods/BoringSSL-GRPC/src/crypto/dh/params.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/dh/params.c rename to Pods/BoringSSL-GRPC/src/crypto/dh/params.c diff --git a/Pods/BoringSSL-GRPC/crypto/dh/params.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/dh/params.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/dh/params.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/dh/params.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/digest_extra/digest_extra.c b/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/digest_extra/digest_extra.c rename to Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c diff --git a/Pods/BoringSSL-GRPC/crypto/digest_extra/digest_extra.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/digest_extra/digest_extra.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/digest_extra/digest_extra.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/dsa/dsa.c b/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/dsa/dsa.c rename to Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c index a3f8535b2..da0931d74 100644 --- a/Pods/BoringSSL-GRPC/crypto/dsa/dsa.c +++ b/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c @@ -79,7 +79,7 @@ #define OPENSSL_DSA_MAX_MODULUS_BITS 10000 // Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of -// Rabin-Miller +// Miller-Rabin. #define DSS_prime_checks 50 static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, @@ -256,7 +256,7 @@ int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, const uint8_t *seed_in, // Find q. for (;;) { // step 1 - if (!BN_GENCB_call(cb, 0, m++)) { + if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, m++)) { goto err; } @@ -319,7 +319,7 @@ int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, const uint8_t *seed_in, n = (bits - 1) / 160; for (;;) { - if ((counter != 0) && !BN_GENCB_call(cb, 0, counter)) { + if ((counter != 0) && !BN_GENCB_call(cb, BN_GENCB_GENERATED, counter)) { goto err; } @@ -541,22 +541,51 @@ void DSA_SIG_free(DSA_SIG *sig) { OPENSSL_free(sig); } +// mod_mul_consttime sets |r| to |a| * |b| modulo |mont->N|, treating |a| and +// |b| as secret. This function internally uses Montgomery reduction, but +// neither inputs nor outputs are in Montgomery form. +static int mod_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + // |BN_mod_mul_montgomery| removes a factor of R, so we cancel it with a + // single |BN_to_montgomery| which adds one factor of R. + int ok = tmp != NULL && + BN_to_montgomery(tmp, a, mont, ctx) && + BN_mod_mul_montgomery(r, tmp, b, mont, ctx); + BN_CTX_end(ctx); + return ok; +} + DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, const DSA *dsa) { + if (!dsa->p || !dsa->q || !dsa->g) { + OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS); + return NULL; + } + + // Reject invalid parameters. In particular, the algorithm will infinite loop + // if |g| is zero. + if (BN_is_zero(dsa->p) || BN_is_zero(dsa->q) || BN_is_zero(dsa->g)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_INVALID_PARAMETERS); + return NULL; + } + + // We only support DSA keys that are a multiple of 8 bits. (This is a weaker + // check than the one in |DSA_do_check_signature|, which only allows 160-, + // 224-, and 256-bit keys. + if (BN_num_bits(dsa->q) % 8 != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE); + return NULL; + } + BIGNUM *kinv = NULL, *r = NULL, *s = NULL; BIGNUM m; BIGNUM xr; BN_CTX *ctx = NULL; - int reason = ERR_R_BN_LIB; DSA_SIG *ret = NULL; BN_init(&m); BN_init(&xr); - - if (!dsa->p || !dsa->q || !dsa->g) { - reason = DSA_R_MISSING_PARAMETERS; - goto err; - } - s = BN_new(); if (s == NULL) { goto err; @@ -572,9 +601,9 @@ DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, const DSA *dsa) { } if (digest_len > BN_num_bytes(dsa->q)) { - // if the digest length is greater than the size of q use the - // BN_num_bits(dsa->q) leftmost bits of the digest, see - // fips 186-3, 4.2 + // If the digest length is greater than the size of |dsa->q| use the + // BN_num_bits(dsa->q) leftmost bits of the digest, see FIPS 186-3, 4.2. + // Note the above check that |dsa->q| is a multiple of 8 bits. digest_len = BN_num_bytes(dsa->q); } @@ -582,19 +611,23 @@ DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, const DSA *dsa) { goto err; } - // Compute s = inv(k) (m + xr) mod q - if (!BN_mod_mul(&xr, dsa->priv_key, r, dsa->q, ctx)) { - goto err; // s = xr - } - if (!BN_add(s, &xr, &m)) { - goto err; // s = m + xr - } - if (BN_cmp(s, dsa->q) > 0) { - if (!BN_sub(s, s, dsa->q)) { - goto err; - } + // |m| is bounded by 2^(num_bits(q)), which is slightly looser than q. This + // violates |bn_mod_add_consttime| and |mod_mul_consttime|'s preconditions. + // (The underlying algorithms could accept looser bounds, but we reduce for + // simplicity.) + size_t q_width = bn_minimal_width(dsa->q); + if (!bn_resize_words(&m, q_width) || + !bn_resize_words(&xr, q_width)) { + goto err; } - if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) { + bn_reduce_once_in_place(m.d, 0 /* no carry word */, dsa->q->d, + xr.d /* scratch space */, q_width); + + // Compute s = inv(k) (m + xr) mod q. Note |dsa->method_mont_q| is + // initialized by |dsa_sign_setup|. + if (!mod_mul_consttime(&xr, dsa->priv_key, r, dsa->method_mont_q, ctx) || + !bn_mod_add_consttime(s, &xr, &m, dsa->q, ctx) || + !mod_mul_consttime(s, s, kinv, dsa->method_mont_q, ctx)) { goto err; } @@ -612,7 +645,7 @@ DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, const DSA *dsa) { err: if (ret == NULL) { - OPENSSL_PUT_ERROR(DSA, reason); + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); BN_free(r); BN_free(s); } @@ -648,7 +681,7 @@ int DSA_do_check_signature(int *out_valid, const uint8_t *digest, } i = BN_num_bits(dsa->q); - // fips 186-3 allows only different sizes for q + // FIPS 186-3 allows only different sizes for q. if (i != 160 && i != 224 && i != 256) { OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE); return 0; @@ -832,29 +865,18 @@ int DSA_size(const DSA *dsa) { return ret; } -static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, +static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx, BIGNUM **out_kinv, BIGNUM **out_r) { - BN_CTX *ctx; - BIGNUM k, *kinv = NULL, *r = NULL; - int ret = 0; - if (!dsa->p || !dsa->q || !dsa->g) { OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS); return 0; } + int ret = 0; + BIGNUM k; BN_init(&k); - - ctx = ctx_in; - if (ctx == NULL) { - ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } - } - - r = BN_new(); - kinv = BN_new(); + BIGNUM *r = BN_new(); + BIGNUM *kinv = BN_new(); if (r == NULL || kinv == NULL || // Get random k !BN_rand_range_ex(&k, 1, dsa->q) || @@ -867,32 +889,34 @@ static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, // Compute r = (g^k mod p) mod q !BN_mod_exp_mont_consttime(r, dsa->g, &k, dsa->p, ctx, dsa->method_mont_p) || + // Note |BN_mod| below is not constant-time and may leak information about + // |r|. |dsa->p| may be significantly larger than |dsa->q|, so this is not + // easily performed in constant-time with Montgomery reduction. + // + // However, |r| at this point is g^k (mod p). It is almost the value of + // |r| revealed in the signature anyway (g^k (mod p) (mod q)), going from + // it to |k| would require computing a discrete log. !BN_mod(r, r, dsa->q, ctx) || // Compute part of 's = inv(k) (m + xr) mod q' using Fermat's Little // Theorem. !bn_mod_inverse_prime(kinv, &k, dsa->q, ctx, dsa->method_mont_q)) { + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); goto err; } BN_clear_free(*out_kinv); *out_kinv = kinv; kinv = NULL; + BN_clear_free(*out_r); *out_r = r; + r = NULL; + ret = 1; err: - if (!ret) { - OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); - if (r != NULL) { - BN_clear_free(r); - } - } - - if (ctx_in == NULL) { - BN_CTX_free(ctx); - } BN_clear_free(&k); + BN_clear_free(r); BN_clear_free(kinv); return ret; } diff --git a/Pods/BoringSSL-GRPC/crypto/dsa/dsa.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/dsa/dsa.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c.grpc_back index b97806b84..cc98225df 100644 --- a/Pods/BoringSSL-GRPC/crypto/dsa/dsa.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa.c.grpc_back @@ -79,7 +79,7 @@ #define OPENSSL_DSA_MAX_MODULUS_BITS 10000 // Primality test according to FIPS PUB 186[-1], Appendix 2.1: 50 rounds of -// Rabin-Miller +// Miller-Rabin. #define DSS_prime_checks 50 static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, @@ -256,7 +256,7 @@ int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, const uint8_t *seed_in, // Find q. for (;;) { // step 1 - if (!BN_GENCB_call(cb, 0, m++)) { + if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, m++)) { goto err; } @@ -319,7 +319,7 @@ int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, const uint8_t *seed_in, n = (bits - 1) / 160; for (;;) { - if ((counter != 0) && !BN_GENCB_call(cb, 0, counter)) { + if ((counter != 0) && !BN_GENCB_call(cb, BN_GENCB_GENERATED, counter)) { goto err; } @@ -541,22 +541,51 @@ void DSA_SIG_free(DSA_SIG *sig) { OPENSSL_free(sig); } +// mod_mul_consttime sets |r| to |a| * |b| modulo |mont->N|, treating |a| and +// |b| as secret. This function internally uses Montgomery reduction, but +// neither inputs nor outputs are in Montgomery form. +static int mod_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + // |BN_mod_mul_montgomery| removes a factor of R, so we cancel it with a + // single |BN_to_montgomery| which adds one factor of R. + int ok = tmp != NULL && + BN_to_montgomery(tmp, a, mont, ctx) && + BN_mod_mul_montgomery(r, tmp, b, mont, ctx); + BN_CTX_end(ctx); + return ok; +} + DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, const DSA *dsa) { + if (!dsa->p || !dsa->q || !dsa->g) { + OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS); + return NULL; + } + + // Reject invalid parameters. In particular, the algorithm will infinite loop + // if |g| is zero. + if (BN_is_zero(dsa->p) || BN_is_zero(dsa->q) || BN_is_zero(dsa->g)) { + OPENSSL_PUT_ERROR(DSA, DSA_R_INVALID_PARAMETERS); + return NULL; + } + + // We only support DSA keys that are a multiple of 8 bits. (This is a weaker + // check than the one in |DSA_do_check_signature|, which only allows 160-, + // 224-, and 256-bit keys. + if (BN_num_bits(dsa->q) % 8 != 0) { + OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE); + return NULL; + } + BIGNUM *kinv = NULL, *r = NULL, *s = NULL; BIGNUM m; BIGNUM xr; BN_CTX *ctx = NULL; - int reason = ERR_R_BN_LIB; DSA_SIG *ret = NULL; BN_init(&m); BN_init(&xr); - - if (!dsa->p || !dsa->q || !dsa->g) { - reason = DSA_R_MISSING_PARAMETERS; - goto err; - } - s = BN_new(); if (s == NULL) { goto err; @@ -572,9 +601,9 @@ redo: } if (digest_len > BN_num_bytes(dsa->q)) { - // if the digest length is greater than the size of q use the - // BN_num_bits(dsa->q) leftmost bits of the digest, see - // fips 186-3, 4.2 + // If the digest length is greater than the size of |dsa->q| use the + // BN_num_bits(dsa->q) leftmost bits of the digest, see FIPS 186-3, 4.2. + // Note the above check that |dsa->q| is a multiple of 8 bits. digest_len = BN_num_bytes(dsa->q); } @@ -582,19 +611,23 @@ redo: goto err; } - // Compute s = inv(k) (m + xr) mod q - if (!BN_mod_mul(&xr, dsa->priv_key, r, dsa->q, ctx)) { - goto err; // s = xr - } - if (!BN_add(s, &xr, &m)) { - goto err; // s = m + xr - } - if (BN_cmp(s, dsa->q) > 0) { - if (!BN_sub(s, s, dsa->q)) { - goto err; - } + // |m| is bounded by 2^(num_bits(q)), which is slightly looser than q. This + // violates |bn_mod_add_consttime| and |mod_mul_consttime|'s preconditions. + // (The underlying algorithms could accept looser bounds, but we reduce for + // simplicity.) + size_t q_width = bn_minimal_width(dsa->q); + if (!bn_resize_words(&m, q_width) || + !bn_resize_words(&xr, q_width)) { + goto err; } - if (!BN_mod_mul(s, s, kinv, dsa->q, ctx)) { + bn_reduce_once_in_place(m.d, 0 /* no carry word */, dsa->q->d, + xr.d /* scratch space */, q_width); + + // Compute s = inv(k) (m + xr) mod q. Note |dsa->method_mont_q| is + // initialized by |dsa_sign_setup|. + if (!mod_mul_consttime(&xr, dsa->priv_key, r, dsa->method_mont_q, ctx) || + !bn_mod_add_consttime(s, &xr, &m, dsa->q, ctx) || + !mod_mul_consttime(s, s, kinv, dsa->method_mont_q, ctx)) { goto err; } @@ -612,7 +645,7 @@ redo: err: if (ret == NULL) { - OPENSSL_PUT_ERROR(DSA, reason); + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); BN_free(r); BN_free(s); } @@ -648,7 +681,7 @@ int DSA_do_check_signature(int *out_valid, const uint8_t *digest, } i = BN_num_bits(dsa->q); - // fips 186-3 allows only different sizes for q + // FIPS 186-3 allows only different sizes for q. if (i != 160 && i != 224 && i != 256) { OPENSSL_PUT_ERROR(DSA, DSA_R_BAD_Q_VALUE); return 0; @@ -832,29 +865,18 @@ int DSA_size(const DSA *dsa) { return ret; } -static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, +static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx, BIGNUM **out_kinv, BIGNUM **out_r) { - BN_CTX *ctx; - BIGNUM k, *kinv = NULL, *r = NULL; - int ret = 0; - if (!dsa->p || !dsa->q || !dsa->g) { OPENSSL_PUT_ERROR(DSA, DSA_R_MISSING_PARAMETERS); return 0; } + int ret = 0; + BIGNUM k; BN_init(&k); - - ctx = ctx_in; - if (ctx == NULL) { - ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } - } - - r = BN_new(); - kinv = BN_new(); + BIGNUM *r = BN_new(); + BIGNUM *kinv = BN_new(); if (r == NULL || kinv == NULL || // Get random k !BN_rand_range_ex(&k, 1, dsa->q) || @@ -867,32 +889,34 @@ static int dsa_sign_setup(const DSA *dsa, BN_CTX *ctx_in, BIGNUM **out_kinv, // Compute r = (g^k mod p) mod q !BN_mod_exp_mont_consttime(r, dsa->g, &k, dsa->p, ctx, dsa->method_mont_p) || + // Note |BN_mod| below is not constant-time and may leak information about + // |r|. |dsa->p| may be significantly larger than |dsa->q|, so this is not + // easily performed in constant-time with Montgomery reduction. + // + // However, |r| at this point is g^k (mod p). It is almost the value of + // |r| revealed in the signature anyway (g^k (mod p) (mod q)), going from + // it to |k| would require computing a discrete log. !BN_mod(r, r, dsa->q, ctx) || // Compute part of 's = inv(k) (m + xr) mod q' using Fermat's Little // Theorem. !bn_mod_inverse_prime(kinv, &k, dsa->q, ctx, dsa->method_mont_q)) { + OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); goto err; } BN_clear_free(*out_kinv); *out_kinv = kinv; kinv = NULL; + BN_clear_free(*out_r); *out_r = r; + r = NULL; + ret = 1; err: - if (!ret) { - OPENSSL_PUT_ERROR(DSA, ERR_R_BN_LIB); - if (r != NULL) { - BN_clear_free(r); - } - } - - if (ctx_in == NULL) { - BN_CTX_free(ctx); - } BN_clear_free(&k); + BN_clear_free(r); BN_clear_free(kinv); return ret; } diff --git a/Pods/BoringSSL-GRPC/crypto/dsa/dsa_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/dsa/dsa_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c diff --git a/Pods/BoringSSL-GRPC/crypto/dsa/dsa_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/dsa/dsa_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/dsa/dsa_asn1.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/ec_extra/ec_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/ec_extra/ec_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c index 31b6c5f97..58e46d64a 100644 --- a/Pods/BoringSSL-GRPC/crypto/ec_extra/ec_asn1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c @@ -159,8 +159,8 @@ EC_KEY *EC_KEY_parse_private_key(CBS *cbs, const EC_GROUP *group) { (point_conversion_form_t)(CBS_data(&public_key)[0] & ~0x01); } else { // Compute the public key instead. - if (!ec_point_mul_scalar(group, ret->pub_key, &ret->priv_key->scalar, NULL, - NULL, NULL)) { + if (!ec_point_mul_scalar_base(group, &ret->pub_key->raw, + &ret->priv_key->scalar)) { goto err; } // Remember the original private-key-only encoding. @@ -264,7 +264,8 @@ static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, CBS *out_base_y, CBS *out_order) { // See RFC 3279, section 2.3.5. Note that RFC 3279 calls this structure an // ECParameters while RFC 5480 calls it a SpecifiedECDomain. - CBS params, field_id, field_type, curve, base; + CBS params, field_id, field_type, curve, base, cofactor; + int has_cofactor; uint64_t version; if (!CBS_get_asn1(in, ¶ms, CBS_ASN1_SEQUENCE) || !CBS_get_asn1_uint64(¶ms, &version) || @@ -272,7 +273,8 @@ static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, !CBS_get_asn1(¶ms, &field_id, CBS_ASN1_SEQUENCE) || !CBS_get_asn1(&field_id, &field_type, CBS_ASN1_OBJECT) || CBS_len(&field_type) != sizeof(kPrimeField) || - OPENSSL_memcmp(CBS_data(&field_type), kPrimeField, sizeof(kPrimeField)) != 0 || + OPENSSL_memcmp(CBS_data(&field_type), kPrimeField, sizeof(kPrimeField)) != + 0 || !CBS_get_asn1(&field_id, out_prime, CBS_ASN1_INTEGER) || !is_unsigned_integer(out_prime) || CBS_len(&field_id) != 0 || @@ -280,16 +282,26 @@ static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, !CBS_get_asn1(&curve, out_a, CBS_ASN1_OCTETSTRING) || !CBS_get_asn1(&curve, out_b, CBS_ASN1_OCTETSTRING) || // |curve| has an optional BIT STRING seed which we ignore. + !CBS_get_optional_asn1(&curve, NULL, NULL, CBS_ASN1_BITSTRING) || + CBS_len(&curve) != 0 || !CBS_get_asn1(¶ms, &base, CBS_ASN1_OCTETSTRING) || !CBS_get_asn1(¶ms, out_order, CBS_ASN1_INTEGER) || - !is_unsigned_integer(out_order)) { + !is_unsigned_integer(out_order) || + !CBS_get_optional_asn1(¶ms, &cofactor, &has_cofactor, + CBS_ASN1_INTEGER) || + CBS_len(¶ms) != 0) { OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); return 0; } - // |params| has an optional cofactor which we ignore. With the optional seed - // in |curve|, a group already has arbitrarily many encodings. Parse enough to - // uniquely determine the curve. + if (has_cofactor) { + // We only support prime-order curves so the cofactor must be one. + if (CBS_len(&cofactor) != 1 || + CBS_data(&cofactor)[0] != 1) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return 0; + } + } // Require that the base point use uncompressed form. uint8_t form; diff --git a/Pods/BoringSSL-GRPC/crypto/ec_extra/ec_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c.grpc_back similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/ec_extra/ec_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c.grpc_back index bde6d0b31..9769d014e 100644 --- a/Pods/BoringSSL-GRPC/crypto/ec_extra/ec_asn1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_asn1.c.grpc_back @@ -159,8 +159,8 @@ EC_KEY *EC_KEY_parse_private_key(CBS *cbs, const EC_GROUP *group) { (point_conversion_form_t)(CBS_data(&public_key)[0] & ~0x01); } else { // Compute the public key instead. - if (!ec_point_mul_scalar(group, ret->pub_key, &ret->priv_key->scalar, NULL, - NULL, NULL)) { + if (!ec_point_mul_scalar_base(group, &ret->pub_key->raw, + &ret->priv_key->scalar)) { goto err; } // Remember the original private-key-only encoding. @@ -264,7 +264,8 @@ static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, CBS *out_base_y, CBS *out_order) { // See RFC 3279, section 2.3.5. Note that RFC 3279 calls this structure an // ECParameters while RFC 5480 calls it a SpecifiedECDomain. - CBS params, field_id, field_type, curve, base; + CBS params, field_id, field_type, curve, base, cofactor; + int has_cofactor; uint64_t version; if (!CBS_get_asn1(in, ¶ms, CBS_ASN1_SEQUENCE) || !CBS_get_asn1_uint64(¶ms, &version) || @@ -272,7 +273,8 @@ static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, !CBS_get_asn1(¶ms, &field_id, CBS_ASN1_SEQUENCE) || !CBS_get_asn1(&field_id, &field_type, CBS_ASN1_OBJECT) || CBS_len(&field_type) != sizeof(kPrimeField) || - OPENSSL_memcmp(CBS_data(&field_type), kPrimeField, sizeof(kPrimeField)) != 0 || + OPENSSL_memcmp(CBS_data(&field_type), kPrimeField, sizeof(kPrimeField)) != + 0 || !CBS_get_asn1(&field_id, out_prime, CBS_ASN1_INTEGER) || !is_unsigned_integer(out_prime) || CBS_len(&field_id) != 0 || @@ -280,16 +282,26 @@ static int parse_explicit_prime_curve(CBS *in, CBS *out_prime, CBS *out_a, !CBS_get_asn1(&curve, out_a, CBS_ASN1_OCTETSTRING) || !CBS_get_asn1(&curve, out_b, CBS_ASN1_OCTETSTRING) || // |curve| has an optional BIT STRING seed which we ignore. + !CBS_get_optional_asn1(&curve, NULL, NULL, CBS_ASN1_BITSTRING) || + CBS_len(&curve) != 0 || !CBS_get_asn1(¶ms, &base, CBS_ASN1_OCTETSTRING) || !CBS_get_asn1(¶ms, out_order, CBS_ASN1_INTEGER) || - !is_unsigned_integer(out_order)) { + !is_unsigned_integer(out_order) || + !CBS_get_optional_asn1(¶ms, &cofactor, &has_cofactor, + CBS_ASN1_INTEGER) || + CBS_len(¶ms) != 0) { OPENSSL_PUT_ERROR(EC, EC_R_DECODE_ERROR); return 0; } - // |params| has an optional cofactor which we ignore. With the optional seed - // in |curve|, a group already has arbitrarily many encodings. Parse enough to - // uniquely determine the curve. + if (has_cofactor) { + // We only support prime-order curves so the cofactor must be one. + if (CBS_len(&cofactor) != 1 || + CBS_data(&cofactor)[0] != 1) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return 0; + } + } // Require that the base point use uncompressed form. uint8_t form; diff --git a/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c new file mode 100644 index 000000000..f906e9573 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c @@ -0,0 +1,95 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include +#include +#include +#include +#include + +#include "../fipsmodule/ec/internal.h" + + +EC_KEY *EC_KEY_derive_from_secret(const EC_GROUP *group, const uint8_t *secret, + size_t secret_len) { +#define EC_KEY_DERIVE_MAX_NAME_LEN 16 + const char *name = EC_curve_nid2nist(EC_GROUP_get_curve_name(group)); + if (name == NULL || strlen(name) > EC_KEY_DERIVE_MAX_NAME_LEN) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; + } + + // Assemble a label string to provide some key separation in case |secret| is + // misused, but ultimately it's on the caller to ensure |secret| is suitably + // separated. + static const char kLabel[] = "derive EC key "; + char info[sizeof(kLabel) + EC_KEY_DERIVE_MAX_NAME_LEN]; + OPENSSL_strlcpy(info, kLabel, sizeof(info)); + OPENSSL_strlcat(info, name, sizeof(info)); + + // Generate 128 bits beyond the group order so the bias is at most 2^-128. +#define EC_KEY_DERIVE_EXTRA_BITS 128 +#define EC_KEY_DERIVE_EXTRA_BYTES (EC_KEY_DERIVE_EXTRA_BITS / 8) + + if (EC_GROUP_order_bits(group) <= EC_KEY_DERIVE_EXTRA_BITS + 8) { + // The reduction strategy below requires the group order be large enough. + // (The actual bound is a bit tighter, but our curves are much larger than + // 128-bit.) + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + return NULL; + } + + uint8_t derived[EC_KEY_DERIVE_EXTRA_BYTES + EC_MAX_BYTES]; + size_t derived_len = BN_num_bytes(&group->order) + EC_KEY_DERIVE_EXTRA_BYTES; + assert(derived_len <= sizeof(derived)); + if (!HKDF(derived, derived_len, EVP_sha256(), secret, secret_len, + /*salt=*/NULL, /*salt_len=*/0, (const uint8_t *)info, + strlen(info))) { + return NULL; + } + + EC_KEY *key = EC_KEY_new(); + BN_CTX *ctx = BN_CTX_new(); + BIGNUM *priv = BN_bin2bn(derived, derived_len, NULL); + EC_POINT *pub = EC_POINT_new(group); + if (key == NULL || ctx == NULL || priv == NULL || pub == NULL || + // Reduce |priv| with Montgomery reduction. First, convert "from" + // Montgomery form to compute |priv| * R^-1 mod |order|. This requires + // |priv| be under order * R, which is true if the group order is large + // enough. 2^(num_bytes(order)) < 2^8 * order, so: + // + // priv < 2^8 * order * 2^128 < order * order < order * R + !BN_from_montgomery(priv, priv, group->order_mont, ctx) || + // Multiply by R^2 and do another Montgomery reduction to compute + // priv * R^-1 * R^2 * R^-1 = priv mod order. + !BN_to_montgomery(priv, priv, group->order_mont, ctx) || + !EC_POINT_mul(group, pub, priv, NULL, NULL, ctx) || + !EC_KEY_set_group(key, group) || !EC_KEY_set_public_key(key, pub) || + !EC_KEY_set_private_key(key, priv)) { + EC_KEY_free(key); + key = NULL; + goto err; + } + +err: + OPENSSL_cleanse(derived, sizeof(derived)); + BN_CTX_free(ctx); + BN_free(priv); + EC_POINT_free(pub); + return key; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c.grpc_back new file mode 100644 index 000000000..6904d7bd0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/ec_extra/ec_derive.c.grpc_back @@ -0,0 +1,95 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include +#include +#include +#include +#include + +#include "../fipsmodule/ec/internal.h" + + +EC_KEY *EC_KEY_derive_from_secret(const EC_GROUP *group, const uint8_t *secret, + size_t secret_len) { +#define EC_KEY_DERIVE_MAX_NAME_LEN 16 + const char *name = EC_curve_nid2nist(EC_GROUP_get_curve_name(group)); + if (name == NULL || strlen(name) > EC_KEY_DERIVE_MAX_NAME_LEN) { + OPENSSL_PUT_ERROR(EC, EC_R_UNKNOWN_GROUP); + return NULL; + } + + // Assemble a label string to provide some key separation in case |secret| is + // misused, but ultimately it's on the caller to ensure |secret| is suitably + // separated. + static const char kLabel[] = "derive EC key "; + char info[sizeof(kLabel) + EC_KEY_DERIVE_MAX_NAME_LEN]; + OPENSSL_strlcpy(info, kLabel, sizeof(info)); + OPENSSL_strlcat(info, name, sizeof(info)); + + // Generate 128 bits beyond the group order so the bias is at most 2^-128. +#define EC_KEY_DERIVE_EXTRA_BITS 128 +#define EC_KEY_DERIVE_EXTRA_BYTES (EC_KEY_DERIVE_EXTRA_BITS / 8) + + if (EC_GROUP_order_bits(group) <= EC_KEY_DERIVE_EXTRA_BITS + 8) { + // The reduction strategy below requires the group order be large enough. + // (The actual bound is a bit tighter, but our curves are much larger than + // 128-bit.) + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + return NULL; + } + + uint8_t derived[EC_KEY_DERIVE_EXTRA_BYTES + EC_MAX_BYTES]; + size_t derived_len = BN_num_bytes(&group->order) + EC_KEY_DERIVE_EXTRA_BYTES; + assert(derived_len <= sizeof(derived)); + if (!HKDF(derived, derived_len, EVP_sha256(), secret, secret_len, + /*salt=*/NULL, /*salt_len=*/0, (const uint8_t *)info, + strlen(info))) { + return NULL; + } + + EC_KEY *key = EC_KEY_new(); + BN_CTX *ctx = BN_CTX_new(); + BIGNUM *priv = BN_bin2bn(derived, derived_len, NULL); + EC_POINT *pub = EC_POINT_new(group); + if (key == NULL || ctx == NULL || priv == NULL || pub == NULL || + // Reduce |priv| with Montgomery reduction. First, convert "from" + // Montgomery form to compute |priv| * R^-1 mod |order|. This requires + // |priv| be under order * R, which is true if the group order is large + // enough. 2^(num_bytes(order)) < 2^8 * order, so: + // + // priv < 2^8 * order * 2^128 < order * order < order * R + !BN_from_montgomery(priv, priv, group->order_mont, ctx) || + // Multiply by R^2 and do another Montgomery reduction to compute + // priv * R^-1 * R^2 * R^-1 = priv mod order. + !BN_to_montgomery(priv, priv, group->order_mont, ctx) || + !EC_POINT_mul(group, pub, priv, NULL, NULL, ctx) || + !EC_KEY_set_group(key, group) || !EC_KEY_set_public_key(key, pub) || + !EC_KEY_set_private_key(key, priv)) { + EC_KEY_free(key); + key = NULL; + goto err; + } + +err: + OPENSSL_cleanse(derived, sizeof(derived)); + BN_CTX_free(ctx); + BN_free(priv); + EC_POINT_free(pub); + return key; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c b/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c new file mode 100644 index 000000000..5626e0558 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c @@ -0,0 +1,124 @@ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include +#include + +#include +#include +#include + +#include "../fipsmodule/ec/internal.h" +#include "../internal.h" + + +int ECDH_compute_key(void *out, size_t out_len, const EC_POINT *pub_key, + const EC_KEY *priv_key, + void *(*kdf)(const void *in, size_t inlen, void *out, + size_t *out_len)) { + if (priv_key->priv_key == NULL) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); + return -1; + } + const EC_SCALAR *const priv = &priv_key->priv_key->scalar; + const EC_GROUP *const group = EC_KEY_get0_group(priv_key); + if (EC_GROUP_cmp(group, pub_key->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return -1; + } + + EC_RAW_POINT shared_point; + uint8_t buf[EC_MAX_BYTES]; + size_t buf_len; + if (!ec_point_mul_scalar(group, &shared_point, &pub_key->raw, priv) || + !ec_point_get_affine_coordinate_bytes(group, buf, NULL, &buf_len, + sizeof(buf), &shared_point)) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); + return -1; + } + + if (kdf != NULL) { + if (kdf(buf, buf_len, out, &out_len) == NULL) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_KDF_FAILED); + return -1; + } + } else { + // no KDF, just copy as much as we can + if (buf_len < out_len) { + out_len = buf_len; + } + OPENSSL_memcpy(out, buf, out_len); + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(ECDH, ERR_R_OVERFLOW); + return -1; + } + + return (int)out_len; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c.grpc_back new file mode 100644 index 000000000..b8a099a56 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/ecdh_extra/ecdh_extra.c.grpc_back @@ -0,0 +1,124 @@ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include +#include + +#include +#include +#include + +#include "../fipsmodule/ec/internal.h" +#include "../internal.h" + + +int ECDH_compute_key(void *out, size_t out_len, const EC_POINT *pub_key, + const EC_KEY *priv_key, + void *(*kdf)(const void *in, size_t inlen, void *out, + size_t *out_len)) { + if (priv_key->priv_key == NULL) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); + return -1; + } + const EC_SCALAR *const priv = &priv_key->priv_key->scalar; + const EC_GROUP *const group = EC_KEY_get0_group(priv_key); + if (EC_GROUP_cmp(group, pub_key->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return -1; + } + + EC_RAW_POINT shared_point; + uint8_t buf[EC_MAX_BYTES]; + size_t buf_len; + if (!ec_point_mul_scalar(group, &shared_point, &pub_key->raw, priv) || + !ec_point_get_affine_coordinate_bytes(group, buf, NULL, &buf_len, + sizeof(buf), &shared_point)) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); + return -1; + } + + if (kdf != NULL) { + if (kdf(buf, buf_len, out, &out_len) == NULL) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_KDF_FAILED); + return -1; + } + } else { + // no KDF, just copy as much as we can + if (buf_len < out_len) { + out_len = buf_len; + } + OPENSSL_memcpy(out, buf, out_len); + } + + if (out_len > INT_MAX) { + OPENSSL_PUT_ERROR(ECDH, ERR_R_OVERFLOW); + return -1; + } + + return (int)out_len; +} diff --git a/Pods/BoringSSL-GRPC/crypto/ecdsa_extra/ecdsa_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/ecdsa_extra/ecdsa_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c index cd467c0ba..0bb1e23d5 100644 --- a/Pods/BoringSSL-GRPC/crypto/ecdsa_extra/ecdsa_asn1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c @@ -74,15 +74,7 @@ int ECDSA_sign(int type, const uint8_t *digest, size_t digest_len, uint8_t *sig, } int ret = 0; - ECDSA_SIG *s = NULL; - - if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NOT_IMPLEMENTED); - *sig_len = 0; - goto err; - } - - s = ECDSA_do_sign(digest, digest_len, eckey); + ECDSA_SIG *s = ECDSA_do_sign(digest, digest_len, eckey); if (s == NULL) { *sig_len = 0; goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back index fbf4ccafe..e6212cc35 100644 --- a/Pods/BoringSSL-GRPC/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/ecdsa_extra/ecdsa_asn1.c.grpc_back @@ -74,15 +74,7 @@ int ECDSA_sign(int type, const uint8_t *digest, size_t digest_len, uint8_t *sig, } int ret = 0; - ECDSA_SIG *s = NULL; - - if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { - OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NOT_IMPLEMENTED); - *sig_len = 0; - goto err; - } - - s = ECDSA_do_sign(digest, digest_len, eckey); + ECDSA_SIG *s = ECDSA_do_sign(digest, digest_len, eckey); if (s == NULL) { *sig_len = 0; goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/engine/engine.c b/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/engine/engine.c rename to Pods/BoringSSL-GRPC/src/crypto/engine/engine.c index 5d92eaba0..678d70344 100644 --- a/Pods/BoringSSL-GRPC/crypto/engine/engine.c +++ b/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c @@ -41,9 +41,10 @@ ENGINE *ENGINE_new(void) { return engine; } -void ENGINE_free(ENGINE *engine) { +int ENGINE_free(ENGINE *engine) { // Methods are currently required to be static so are not unref'ed. OPENSSL_free(engine); + return 1; } // set_method takes a pointer to a method and its given size and sets diff --git a/Pods/BoringSSL-GRPC/crypto/engine/engine.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/engine/engine.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/engine/engine.c.grpc_back index 875f1480d..973a57c80 100644 --- a/Pods/BoringSSL-GRPC/crypto/engine/engine.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/engine/engine.c.grpc_back @@ -41,9 +41,10 @@ ENGINE *ENGINE_new(void) { return engine; } -void ENGINE_free(ENGINE *engine) { +int ENGINE_free(ENGINE *engine) { // Methods are currently required to be static so are not unref'ed. OPENSSL_free(engine); + return 1; } // set_method takes a pointer to a method and its given size and sets diff --git a/Pods/BoringSSL-GRPC/crypto/err/err.c b/Pods/BoringSSL-GRPC/src/crypto/err/err.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/err/err.c rename to Pods/BoringSSL-GRPC/src/crypto/err/err.c index 1236c5892..5f05f1f13 100644 --- a/Pods/BoringSSL-GRPC/crypto/err/err.c +++ b/Pods/BoringSSL-GRPC/src/crypto/err/err.c @@ -382,18 +382,16 @@ char *ERR_error_string(uint32_t packed_error, char *ret) { OPENSSL_memset(ret, 0, ERR_ERROR_STRING_BUF_LEN); #endif - ERR_error_string_n(packed_error, ret, ERR_ERROR_STRING_BUF_LEN); - - return ret; + return ERR_error_string_n(packed_error, ret, ERR_ERROR_STRING_BUF_LEN); } -void ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { +char *ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { char lib_buf[64], reason_buf[64]; const char *lib_str, *reason_str; unsigned lib, reason; if (len == 0) { - return; + return NULL; } lib = ERR_GET_LIB(packed_error); @@ -425,7 +423,7 @@ void ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { if (len <= num_colons) { // In this situation it's not possible to ensure that the correct number // of colons are included in the output. - return; + return buf; } for (i = 0; i < num_colons; i++) { @@ -444,6 +442,8 @@ void ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { s = colon + 1; } } + + return buf; } // err_string_cmp is a compare function for searching error values with @@ -781,6 +781,8 @@ void ERR_load_BIO_strings(void) {} void ERR_load_ERR_strings(void) {} +void ERR_load_RAND_strings(void) {} + struct err_save_state_st { struct err_error_st *errors; size_t num_errors; diff --git a/Pods/BoringSSL-GRPC/crypto/err/err.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/err/err.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/err/err.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/err/err.c.grpc_back index c7bff1680..a432ce3fb 100644 --- a/Pods/BoringSSL-GRPC/crypto/err/err.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/err/err.c.grpc_back @@ -382,18 +382,16 @@ char *ERR_error_string(uint32_t packed_error, char *ret) { OPENSSL_memset(ret, 0, ERR_ERROR_STRING_BUF_LEN); #endif - ERR_error_string_n(packed_error, ret, ERR_ERROR_STRING_BUF_LEN); - - return ret; + return ERR_error_string_n(packed_error, ret, ERR_ERROR_STRING_BUF_LEN); } -void ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { +char *ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { char lib_buf[64], reason_buf[64]; const char *lib_str, *reason_str; unsigned lib, reason; if (len == 0) { - return; + return NULL; } lib = ERR_GET_LIB(packed_error); @@ -425,7 +423,7 @@ void ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { if (len <= num_colons) { // In this situation it's not possible to ensure that the correct number // of colons are included in the output. - return; + return buf; } for (i = 0; i < num_colons; i++) { @@ -444,6 +442,8 @@ void ERR_error_string_n(uint32_t packed_error, char *buf, size_t len) { s = colon + 1; } } + + return buf; } // err_string_cmp is a compare function for searching error values with @@ -781,6 +781,8 @@ void ERR_load_BIO_strings(void) {} void ERR_load_ERR_strings(void) {} +void ERR_load_RAND_strings(void) {} + struct err_save_state_st { struct err_error_st *errors; size_t num_errors; diff --git a/Pods/BoringSSL-GRPC/src/crypto/err/internal.h b/Pods/BoringSSL-GRPC/src/crypto/err/internal.h new file mode 100644 index 000000000..a4c152044 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/err/internal.h @@ -0,0 +1,58 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Private error queue functions. + +// ERR_SAVE_STATE contains a saved representation of the error queue. It is +// slightly more compact than |ERR_STATE| as the error queue will typically not +// contain |ERR_NUM_ERRORS| entries. +typedef struct err_save_state_st ERR_SAVE_STATE; + +// ERR_SAVE_STATE_free releases all memory associated with |state|. +OPENSSL_EXPORT void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state); + +// ERR_save_state returns a newly-allocated |ERR_SAVE_STATE| structure +// containing the current state of the error queue or NULL on allocation +// error. It should be released with |ERR_SAVE_STATE_free|. +OPENSSL_EXPORT ERR_SAVE_STATE *ERR_save_state(void); + +// ERR_restore_state clears the error queue and replaces it with |state|. +OPENSSL_EXPORT void ERR_restore_state(const ERR_SAVE_STATE *state); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(ERR_SAVE_STATE, ERR_SAVE_STATE_free) + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/err/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/err/internal.h.grpc_back new file mode 100644 index 000000000..179f756b8 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/err/internal.h.grpc_back @@ -0,0 +1,58 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Private error queue functions. + +// ERR_SAVE_STATE contains a saved representation of the error queue. It is +// slightly more compact than |ERR_STATE| as the error queue will typically not +// contain |ERR_NUM_ERRORS| entries. +typedef struct err_save_state_st ERR_SAVE_STATE; + +// ERR_SAVE_STATE_free releases all memory associated with |state|. +OPENSSL_EXPORT void ERR_SAVE_STATE_free(ERR_SAVE_STATE *state); + +// ERR_save_state returns a newly-allocated |ERR_SAVE_STATE| structure +// containing the current state of the error queue or NULL on allocation +// error. It should be released with |ERR_SAVE_STATE_free|. +OPENSSL_EXPORT ERR_SAVE_STATE *ERR_save_state(void); + +// ERR_restore_state clears the error queue and replaces it with |state|. +OPENSSL_EXPORT void ERR_restore_state(const ERR_SAVE_STATE *state); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(ERR_SAVE_STATE, ERR_SAVE_STATE_free) + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_CRYPTO_ERR_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/evp/digestsign.c b/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/digestsign.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c diff --git a/Pods/BoringSSL-GRPC/crypto/evp/digestsign.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/digestsign.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/digestsign.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/evp/evp.c b/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c similarity index 77% rename from Pods/BoringSSL-GRPC/crypto/evp/evp.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/evp.c index 6911771c7..b52f8592f 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/evp.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c @@ -71,6 +71,11 @@ #include "../internal.h" +// Node depends on |EVP_R_NOT_XOF_OR_INVALID_LENGTH|. +// +// TODO(davidben): Fix Node to not touch the error queue itself and remove this. +OPENSSL_DECLARE_ERROR_REASON(EVP, NOT_XOF_OR_INVALID_LENGTH) + EVP_PKEY *EVP_PKEY_new(void) { EVP_PKEY *ret; @@ -176,7 +181,7 @@ int EVP_PKEY_size(const EVP_PKEY *pkey) { return 0; } -int EVP_PKEY_bits(EVP_PKEY *pkey) { +int EVP_PKEY_bits(const EVP_PKEY *pkey) { if (pkey && pkey->ameth && pkey->ameth->pkey_bits) { return pkey->ameth->pkey_bits(pkey); } @@ -200,6 +205,8 @@ static const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find(int nid) { return &dsa_asn1_meth; case EVP_PKEY_ED25519: return &ed25519_asn1_meth; + case EVP_PKEY_X25519: + return &x25519_asn1_meth; default: return NULL; } @@ -225,7 +232,7 @@ int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key) { return EVP_PKEY_assign(pkey, EVP_PKEY_RSA, key); } -RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { +RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_RSA) { OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_AN_RSA_KEY); return NULL; @@ -233,7 +240,7 @@ RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { return pkey->pkey.rsa; } -RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) { +RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey) { RSA *rsa = EVP_PKEY_get0_RSA(pkey); if (rsa != NULL) { RSA_up_ref(rsa); @@ -253,7 +260,7 @@ int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key) { return EVP_PKEY_assign(pkey, EVP_PKEY_DSA, key); } -DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey) { +DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_DSA) { OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_A_DSA_KEY); return NULL; @@ -261,7 +268,7 @@ DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey) { return pkey->pkey.dsa; } -DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey) { +DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey) { DSA *dsa = EVP_PKEY_get0_DSA(pkey); if (dsa != NULL) { DSA_up_ref(dsa); @@ -281,7 +288,7 @@ int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) { return EVP_PKEY_assign(pkey, EVP_PKEY_EC, key); } -EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) { +EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_EC) { OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_AN_EC_KEY_KEY); return NULL; @@ -289,7 +296,7 @@ EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) { return pkey->pkey.ec; } -EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) { +EC_KEY *EVP_PKEY_get1_EC_KEY(const EVP_PKEY *pkey) { EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(pkey); if (ec_key != NULL) { EC_KEY_up_ref(ec_key); @@ -297,7 +304,8 @@ EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) { return ec_key; } -DH *EVP_PKEY_get0_DH(EVP_PKEY *pkey) { return NULL; } +DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey) { return NULL; } +DH *EVP_PKEY_get1_DH(const EVP_PKEY *pkey) { return NULL; } int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) { if (!EVP_PKEY_set_type(pkey, type)) { @@ -329,7 +337,73 @@ int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) { return 1; } +EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *unused, + const uint8_t *in, size_t len) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + + if (ret->ameth->set_priv_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + goto err; + } + + if (!ret->ameth->set_priv_raw(ret, in, len)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *unused, + const uint8_t *in, size_t len) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + if (ret->ameth->set_pub_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + goto err; + } + + if (!ret->ameth->set_pub_raw(ret, in, len)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + if (pkey->ameth->get_priv_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return pkey->ameth->get_priv_raw(pkey, out, out_len); +} + +int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + if (pkey->ameth->get_pub_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return pkey->ameth->get_pub_raw(pkey, out, out_len); +} int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { if (a->type != b->type) { @@ -360,3 +434,10 @@ void OpenSSL_add_all_ciphers(void) {} void OpenSSL_add_all_digests(void) {} void EVP_cleanup(void) {} + +int EVP_PKEY_base_id(const EVP_PKEY *pkey) { + // OpenSSL has two notions of key type because it supports multiple OIDs for + // the same algorithm: NID_rsa vs NID_rsaEncryption and five distinct spelling + // of DSA. We do not support these, so the base ID is simply the ID. + return EVP_PKEY_id(pkey); +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/evp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/crypto/evp/evp.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/evp.c.grpc_back index ad5f85bf3..60fdf64ed 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/evp.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/evp.c.grpc_back @@ -71,6 +71,11 @@ #include "../internal.h" +// Node depends on |EVP_R_NOT_XOF_OR_INVALID_LENGTH|. +// +// TODO(davidben): Fix Node to not touch the error queue itself and remove this. +OPENSSL_DECLARE_ERROR_REASON(EVP, NOT_XOF_OR_INVALID_LENGTH) + EVP_PKEY *EVP_PKEY_new(void) { EVP_PKEY *ret; @@ -176,7 +181,7 @@ int EVP_PKEY_size(const EVP_PKEY *pkey) { return 0; } -int EVP_PKEY_bits(EVP_PKEY *pkey) { +int EVP_PKEY_bits(const EVP_PKEY *pkey) { if (pkey && pkey->ameth && pkey->ameth->pkey_bits) { return pkey->ameth->pkey_bits(pkey); } @@ -200,6 +205,8 @@ static const EVP_PKEY_ASN1_METHOD *evp_pkey_asn1_find(int nid) { return &dsa_asn1_meth; case EVP_PKEY_ED25519: return &ed25519_asn1_meth; + case EVP_PKEY_X25519: + return &x25519_asn1_meth; default: return NULL; } @@ -225,7 +232,7 @@ int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key) { return EVP_PKEY_assign(pkey, EVP_PKEY_RSA, key); } -RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { +RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_RSA) { OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_AN_RSA_KEY); return NULL; @@ -233,7 +240,7 @@ RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { return pkey->pkey.rsa; } -RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey) { +RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey) { RSA *rsa = EVP_PKEY_get0_RSA(pkey); if (rsa != NULL) { RSA_up_ref(rsa); @@ -253,7 +260,7 @@ int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key) { return EVP_PKEY_assign(pkey, EVP_PKEY_DSA, key); } -DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey) { +DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_DSA) { OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_A_DSA_KEY); return NULL; @@ -261,7 +268,7 @@ DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey) { return pkey->pkey.dsa; } -DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey) { +DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey) { DSA *dsa = EVP_PKEY_get0_DSA(pkey); if (dsa != NULL) { DSA_up_ref(dsa); @@ -281,7 +288,7 @@ int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key) { return EVP_PKEY_assign(pkey, EVP_PKEY_EC, key); } -EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) { +EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_EC) { OPENSSL_PUT_ERROR(EVP, EVP_R_EXPECTING_AN_EC_KEY_KEY); return NULL; @@ -289,7 +296,7 @@ EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey) { return pkey->pkey.ec; } -EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) { +EC_KEY *EVP_PKEY_get1_EC_KEY(const EVP_PKEY *pkey) { EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(pkey); if (ec_key != NULL) { EC_KEY_up_ref(ec_key); @@ -297,7 +304,8 @@ EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey) { return ec_key; } -DH *EVP_PKEY_get0_DH(EVP_PKEY *pkey) { return NULL; } +DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey) { return NULL; } +DH *EVP_PKEY_get1_DH(const EVP_PKEY *pkey) { return NULL; } int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key) { if (!EVP_PKEY_set_type(pkey, type)) { @@ -329,7 +337,73 @@ int EVP_PKEY_set_type(EVP_PKEY *pkey, int type) { return 1; } +EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *unused, + const uint8_t *in, size_t len) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + + if (ret->ameth->set_priv_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + goto err; + } + + if (!ret->ameth->set_priv_raw(ret, in, len)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *unused, + const uint8_t *in, size_t len) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL || + !EVP_PKEY_set_type(ret, type)) { + goto err; + } + if (ret->ameth->set_pub_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + goto err; + } + + if (!ret->ameth->set_pub_raw(ret, in, len)) { + goto err; + } + + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} + +int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + if (pkey->ameth->get_priv_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return pkey->ameth->get_priv_raw(pkey, out, out_len); +} + +int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + if (pkey->ameth->get_pub_raw == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + + return pkey->ameth->get_pub_raw(pkey, out, out_len); +} int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { if (a->type != b->type) { @@ -360,3 +434,10 @@ void OpenSSL_add_all_ciphers(void) {} void OpenSSL_add_all_digests(void) {} void EVP_cleanup(void) {} + +int EVP_PKEY_base_id(const EVP_PKEY *pkey) { + // OpenSSL has two notions of key type because it supports multiple OIDs for + // the same algorithm: NID_rsa vs NID_rsaEncryption and five distinct spelling + // of DSA. We do not support these, so the base ID is simply the ID. + return EVP_PKEY_id(pkey); +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/evp_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/evp/evp_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c index 7d86fbc91..47b3e70af 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/evp_asn1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c @@ -73,6 +73,7 @@ static const EVP_PKEY_ASN1_METHOD *const kASN1Methods[] = { &ec_asn1_meth, &dsa_asn1_meth, &ed25519_asn1_meth, + &x25519_asn1_meth, }; static int parse_key_type(CBS *cbs, int *out_type) { @@ -100,10 +101,16 @@ EVP_PKEY *EVP_parse_public_key(CBS *cbs) { uint8_t padding; if (!CBS_get_asn1(cbs, &spki, CBS_ASN1_SEQUENCE) || !CBS_get_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || - !parse_key_type(&algorithm, &type) || !CBS_get_asn1(&spki, &key, CBS_ASN1_BITSTRING) || - CBS_len(&spki) != 0 || - // Every key type defined encodes the key as a byte string with the same + CBS_len(&spki) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + if (!parse_key_type(&algorithm, &type)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return NULL; + } + if (// Every key type defined encodes the key as a byte string with the same // conversion to BIT STRING. !CBS_get_u8(&key, &padding) || padding != 0) { @@ -152,11 +159,14 @@ EVP_PKEY *EVP_parse_private_key(CBS *cbs) { !CBS_get_asn1_uint64(&pkcs8, &version) || version != 0 || !CBS_get_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || - !parse_key_type(&algorithm, &type) || !CBS_get_asn1(&pkcs8, &key, CBS_ASN1_OCTETSTRING)) { OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); return NULL; } + if (!parse_key_type(&algorithm, &type)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return NULL; + } // A PrivateKeyInfo ends with a SET of Attributes which we ignore. @@ -322,7 +332,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, long len) { } } -int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp) { +int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp) { switch (key->type) { case EVP_PKEY_RSA: return i2d_RSAPublicKey(key->pkey.rsa, outp); @@ -335,3 +345,44 @@ int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp) { return -1; } } + +EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **out, const uint8_t **inp, + long len) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, *inp, len < 0 ? 0 : (size_t)len); + switch (type) { + case EVP_PKEY_RSA: { + RSA *rsa = RSA_parse_public_key(&cbs); + if (rsa == NULL || !EVP_PKEY_assign_RSA(ret, rsa)) { + RSA_free(rsa); + goto err; + } + break; + } + + // Unlike OpenSSL, we do not support EC keys with this API. The raw EC + // public key serialization requires knowing the group. In OpenSSL, calling + // this function with |EVP_PKEY_EC| and setting |out| to NULL does not work. + // It requires |*out| to include a partially-initiazed |EVP_PKEY| to extract + // the group. + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + goto err; + } + + *inp = CBS_data(&cbs); + if (out != NULL) { + EVP_PKEY_free(*out); + *out = ret; + } + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/evp_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/evp/evp_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c.grpc_back index bcb86d760..fc1dce317 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/evp_asn1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_asn1.c.grpc_back @@ -73,6 +73,7 @@ static const EVP_PKEY_ASN1_METHOD *const kASN1Methods[] = { &ec_asn1_meth, &dsa_asn1_meth, &ed25519_asn1_meth, + &x25519_asn1_meth, }; static int parse_key_type(CBS *cbs, int *out_type) { @@ -100,10 +101,16 @@ EVP_PKEY *EVP_parse_public_key(CBS *cbs) { uint8_t padding; if (!CBS_get_asn1(cbs, &spki, CBS_ASN1_SEQUENCE) || !CBS_get_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || - !parse_key_type(&algorithm, &type) || !CBS_get_asn1(&spki, &key, CBS_ASN1_BITSTRING) || - CBS_len(&spki) != 0 || - // Every key type defined encodes the key as a byte string with the same + CBS_len(&spki) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return NULL; + } + if (!parse_key_type(&algorithm, &type)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return NULL; + } + if (// Every key type defined encodes the key as a byte string with the same // conversion to BIT STRING. !CBS_get_u8(&key, &padding) || padding != 0) { @@ -152,11 +159,14 @@ EVP_PKEY *EVP_parse_private_key(CBS *cbs) { !CBS_get_asn1_uint64(&pkcs8, &version) || version != 0 || !CBS_get_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || - !parse_key_type(&algorithm, &type) || !CBS_get_asn1(&pkcs8, &key, CBS_ASN1_OCTETSTRING)) { OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); return NULL; } + if (!parse_key_type(&algorithm, &type)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_ALGORITHM); + return NULL; + } // A PrivateKeyInfo ends with a SET of Attributes which we ignore. @@ -322,7 +332,7 @@ EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, long len) { } } -int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp) { +int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp) { switch (key->type) { case EVP_PKEY_RSA: return i2d_RSAPublicKey(key->pkey.rsa, outp); @@ -335,3 +345,44 @@ int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp) { return -1; } } + +EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **out, const uint8_t **inp, + long len) { + EVP_PKEY *ret = EVP_PKEY_new(); + if (ret == NULL) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, *inp, len < 0 ? 0 : (size_t)len); + switch (type) { + case EVP_PKEY_RSA: { + RSA *rsa = RSA_parse_public_key(&cbs); + if (rsa == NULL || !EVP_PKEY_assign_RSA(ret, rsa)) { + RSA_free(rsa); + goto err; + } + break; + } + + // Unlike OpenSSL, we do not support EC keys with this API. The raw EC + // public key serialization requires knowing the group. In OpenSSL, calling + // this function with |EVP_PKEY_EC| and setting |out| to NULL does not work. + // It requires |*out| to include a partially-initiazed |EVP_PKEY| to extract + // the group. + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + goto err; + } + + *inp = CBS_data(&cbs); + if (out != NULL) { + EVP_PKEY_free(*out); + *out = ret; + } + return ret; + +err: + EVP_PKEY_free(ret); + return NULL; +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/evp_ctx.c b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c similarity index 90% rename from Pods/BoringSSL-GRPC/crypto/evp/evp_ctx.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c index 05cf46f93..dcdaf4be8 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/evp_ctx.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c @@ -67,15 +67,14 @@ static const EVP_PKEY_METHOD *const evp_methods[] = { - &rsa_pkey_meth, - &ec_pkey_meth, - &ed25519_pkey_meth, + &rsa_pkey_meth, + &ec_pkey_meth, + &ed25519_pkey_meth, + &x25519_pkey_meth, }; static const EVP_PKEY_METHOD *evp_pkey_meth_find(int type) { - unsigned i; - - for (i = 0; i < sizeof(evp_methods)/sizeof(EVP_PKEY_METHOD*); i++) { + for (size_t i = 0; i < sizeof(evp_methods)/sizeof(EVP_PKEY_METHOD*); i++) { if (evp_methods[i]->pkey_id == type) { return evp_methods[i]; } @@ -415,7 +414,7 @@ int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) { return 1; } -int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { +int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey) { if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); return 0; @@ -425,21 +424,60 @@ int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { return 0; } - if (!ppkey) { + if (!out_pkey) { + return 0; + } + + if (!*out_pkey) { + *out_pkey = EVP_PKEY_new(); + if (!*out_pkey) { + OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); + return 0; + } + } + + if (!ctx->pmeth->keygen(ctx, *out_pkey)) { + EVP_PKEY_free(*out_pkey); + *out_pkey = NULL; + return 0; + } + return 1; +} + +int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_PARAMGEN; + return 1; +} + +int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_PARAMGEN) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + + if (!out_pkey) { return 0; } - if (!*ppkey) { - *ppkey = EVP_PKEY_new(); - if (!*ppkey) { + if (!*out_pkey) { + *out_pkey = EVP_PKEY_new(); + if (!*out_pkey) { OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); return 0; } } - if (!ctx->pmeth->keygen(ctx, *ppkey)) { - EVP_PKEY_free(*ppkey); - *ppkey = NULL; + if (!ctx->pmeth->paramgen(ctx, *out_pkey)) { + EVP_PKEY_free(*out_pkey); + *out_pkey = NULL; return 0; } return 1; diff --git a/Pods/BoringSSL-GRPC/crypto/evp/evp_ctx.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c.grpc_back similarity index 90% rename from Pods/BoringSSL-GRPC/crypto/evp/evp_ctx.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c.grpc_back index 3599f7783..9ca2c5581 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/evp_ctx.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/evp_ctx.c.grpc_back @@ -67,15 +67,14 @@ static const EVP_PKEY_METHOD *const evp_methods[] = { - &rsa_pkey_meth, - &ec_pkey_meth, - &ed25519_pkey_meth, + &rsa_pkey_meth, + &ec_pkey_meth, + &ed25519_pkey_meth, + &x25519_pkey_meth, }; static const EVP_PKEY_METHOD *evp_pkey_meth_find(int type) { - unsigned i; - - for (i = 0; i < sizeof(evp_methods)/sizeof(EVP_PKEY_METHOD*); i++) { + for (size_t i = 0; i < sizeof(evp_methods)/sizeof(EVP_PKEY_METHOD*); i++) { if (evp_methods[i]->pkey_id == type) { return evp_methods[i]; } @@ -415,7 +414,7 @@ int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx) { return 1; } -int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { +int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey) { if (!ctx || !ctx->pmeth || !ctx->pmeth->keygen) { OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); return 0; @@ -425,21 +424,60 @@ int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { return 0; } - if (!ppkey) { + if (!out_pkey) { + return 0; + } + + if (!*out_pkey) { + *out_pkey = EVP_PKEY_new(); + if (!*out_pkey) { + OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); + return 0; + } + } + + if (!ctx->pmeth->keygen(ctx, *out_pkey)) { + EVP_PKEY_free(*out_pkey); + *out_pkey = NULL; + return 0; + } + return 1; +} + +int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + ctx->operation = EVP_PKEY_OP_PARAMGEN; + return 1; +} + +int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey) { + if (!ctx || !ctx->pmeth || !ctx->pmeth->paramgen) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE); + return 0; + } + if (ctx->operation != EVP_PKEY_OP_PARAMGEN) { + OPENSSL_PUT_ERROR(EVP, EVP_R_OPERATON_NOT_INITIALIZED); + return 0; + } + + if (!out_pkey) { return 0; } - if (!*ppkey) { - *ppkey = EVP_PKEY_new(); - if (!*ppkey) { + if (!*out_pkey) { + *out_pkey = EVP_PKEY_new(); + if (!*out_pkey) { OPENSSL_PUT_ERROR(EVP, ERR_LIB_EVP); return 0; } } - if (!ctx->pmeth->keygen(ctx, *ppkey)) { - EVP_PKEY_free(*ppkey); - *ppkey = NULL; + if (!ctx->pmeth->paramgen(ctx, *out_pkey)) { + EVP_PKEY_free(*out_pkey); + *out_pkey = NULL; return 0; } return 1; diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h b/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h new file mode 100644 index 000000000..1b1fb485b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h @@ -0,0 +1,269 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_EVP_INTERNAL_H +#define OPENSSL_HEADER_EVP_INTERNAL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +struct evp_pkey_asn1_method_st { + int pkey_id; + uint8_t oid[9]; + uint8_t oid_len; + + // pub_decode decodes |params| and |key| as a SubjectPublicKeyInfo + // and writes the result into |out|. It returns one on success and zero on + // error. |params| is the AlgorithmIdentifier after the OBJECT IDENTIFIER + // type field, and |key| is the contents of the subjectPublicKey with the + // leading padding byte checked and removed. Although X.509 uses BIT STRINGs + // to represent SubjectPublicKeyInfo, every key type defined encodes the key + // as a byte string with the same conversion to BIT STRING. + int (*pub_decode)(EVP_PKEY *out, CBS *params, CBS *key); + + // pub_encode encodes |key| as a SubjectPublicKeyInfo and appends the result + // to |out|. It returns one on success and zero on error. + int (*pub_encode)(CBB *out, const EVP_PKEY *key); + + int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); + + // priv_decode decodes |params| and |key| as a PrivateKeyInfo and writes the + // result into |out|. It returns one on success and zero on error. |params| is + // the AlgorithmIdentifier after the OBJECT IDENTIFIER type field, and |key| + // is the contents of the OCTET STRING privateKey field. + int (*priv_decode)(EVP_PKEY *out, CBS *params, CBS *key); + + // priv_encode encodes |key| as a PrivateKeyInfo and appends the result to + // |out|. It returns one on success and zero on error. + int (*priv_encode)(CBB *out, const EVP_PKEY *key); + + int (*set_priv_raw)(EVP_PKEY *pkey, const uint8_t *in, size_t len); + int (*set_pub_raw)(EVP_PKEY *pkey, const uint8_t *in, size_t len); + int (*get_priv_raw)(const EVP_PKEY *pkey, uint8_t *out, size_t *out_len); + int (*get_pub_raw)(const EVP_PKEY *pkey, uint8_t *out, size_t *out_len); + + // pkey_opaque returns 1 if the |pk| is opaque. Opaque keys are backed by + // custom implementations which do not expose key material and parameters. + int (*pkey_opaque)(const EVP_PKEY *pk); + + int (*pkey_size)(const EVP_PKEY *pk); + int (*pkey_bits)(const EVP_PKEY *pk); + + int (*param_missing)(const EVP_PKEY *pk); + int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); + int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); + + void (*pkey_free)(EVP_PKEY *pkey); +} /* EVP_PKEY_ASN1_METHOD */; + + +#define EVP_PKEY_OP_UNDEFINED 0 +#define EVP_PKEY_OP_KEYGEN (1 << 2) +#define EVP_PKEY_OP_SIGN (1 << 3) +#define EVP_PKEY_OP_VERIFY (1 << 4) +#define EVP_PKEY_OP_VERIFYRECOVER (1 << 5) +#define EVP_PKEY_OP_ENCRYPT (1 << 6) +#define EVP_PKEY_OP_DECRYPT (1 << 7) +#define EVP_PKEY_OP_DERIVE (1 << 8) +#define EVP_PKEY_OP_PARAMGEN (1 << 9) + +#define EVP_PKEY_OP_TYPE_SIG \ + (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER) + +#define EVP_PKEY_OP_TYPE_CRYPT (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) + +#define EVP_PKEY_OP_TYPE_NOGEN \ + (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE) + +#define EVP_PKEY_OP_TYPE_GEN (EVP_PKEY_OP_KEYGEN | EVP_PKEY_OP_PARAMGEN) + +// EVP_PKEY_CTX_ctrl performs |cmd| on |ctx|. The |keytype| and |optype| +// arguments can be -1 to specify that any type and operation are acceptable, +// otherwise |keytype| must match the type of |ctx| and the bits of |optype| +// must intersect the operation flags set on |ctx|. +// +// The |p1| and |p2| arguments depend on the value of |cmd|. +// +// It returns one on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, + int cmd, int p1, void *p2); + +#define EVP_PKEY_CTRL_MD 1 +#define EVP_PKEY_CTRL_GET_MD 2 + +// EVP_PKEY_CTRL_PEER_KEY is called with different values of |p1|: +// 0: Is called from |EVP_PKEY_derive_set_peer| and |p2| contains a peer key. +// If the return value is <= 0, the key is rejected. +// 1: Is called at the end of |EVP_PKEY_derive_set_peer| and |p2| contains a +// peer key. If the return value is <= 0, the key is rejected. +// 2: Is called with |p2| == NULL to test whether the peer's key was used. +// (EC)DH always return one in this case. +// 3: Is called with |p2| == NULL to set whether the peer's key was used. +// (EC)DH always return one in this case. This was only used for GOST. +#define EVP_PKEY_CTRL_PEER_KEY 3 + +// EVP_PKEY_ALG_CTRL is the base value from which key-type specific ctrl +// commands are numbered. +#define EVP_PKEY_ALG_CTRL 0x1000 + +#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 5) +#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 8) +#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 10) +#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) +#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 13) + +struct evp_pkey_ctx_st { + // Method associated with this operation + const EVP_PKEY_METHOD *pmeth; + // Engine that implements this method or NULL if builtin + ENGINE *engine; + // Key: may be NULL + EVP_PKEY *pkey; + // Peer key for key agreement, may be NULL + EVP_PKEY *peerkey; + // operation contains one of the |EVP_PKEY_OP_*| values. + int operation; + // Algorithm specific data + void *data; +} /* EVP_PKEY_CTX */; + +struct evp_pkey_method_st { + int pkey_id; + + int (*init)(EVP_PKEY_CTX *ctx); + int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src); + void (*cleanup)(EVP_PKEY_CTX *ctx); + + int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); + + int (*sign)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen); + + int (*sign_message)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen); + + int (*verify)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, + const uint8_t *tbs, size_t tbslen); + + int (*verify_message)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, + const uint8_t *tbs, size_t tbslen); + + int (*verify_recover)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len, + const uint8_t *sig, size_t sig_len); + + int (*encrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen); + + int (*decrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen); + + int (*derive)(EVP_PKEY_CTX *ctx, uint8_t *key, size_t *keylen); + + int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); + + int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); +} /* EVP_PKEY_METHOD */; + +typedef struct { + union { + uint8_t priv[64]; + struct { + // Shift the location of the public key to align with where it is in the + // private key representation. + uint8_t pad[32]; + uint8_t value[32]; + } pub; + } key; + char has_private; +} ED25519_KEY; + +typedef struct { + uint8_t pub[32]; + uint8_t priv[32]; + char has_private; +} X25519_KEY; + +extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD ec_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD x25519_asn1_meth; + +extern const EVP_PKEY_METHOD rsa_pkey_meth; +extern const EVP_PKEY_METHOD ec_pkey_meth; +extern const EVP_PKEY_METHOD ed25519_pkey_meth; +extern const EVP_PKEY_METHOD x25519_pkey_meth; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_EVP_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h.grpc_back new file mode 100644 index 000000000..8b6a58363 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/internal.h.grpc_back @@ -0,0 +1,269 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_EVP_INTERNAL_H +#define OPENSSL_HEADER_EVP_INTERNAL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +struct evp_pkey_asn1_method_st { + int pkey_id; + uint8_t oid[9]; + uint8_t oid_len; + + // pub_decode decodes |params| and |key| as a SubjectPublicKeyInfo + // and writes the result into |out|. It returns one on success and zero on + // error. |params| is the AlgorithmIdentifier after the OBJECT IDENTIFIER + // type field, and |key| is the contents of the subjectPublicKey with the + // leading padding byte checked and removed. Although X.509 uses BIT STRINGs + // to represent SubjectPublicKeyInfo, every key type defined encodes the key + // as a byte string with the same conversion to BIT STRING. + int (*pub_decode)(EVP_PKEY *out, CBS *params, CBS *key); + + // pub_encode encodes |key| as a SubjectPublicKeyInfo and appends the result + // to |out|. It returns one on success and zero on error. + int (*pub_encode)(CBB *out, const EVP_PKEY *key); + + int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); + + // priv_decode decodes |params| and |key| as a PrivateKeyInfo and writes the + // result into |out|. It returns one on success and zero on error. |params| is + // the AlgorithmIdentifier after the OBJECT IDENTIFIER type field, and |key| + // is the contents of the OCTET STRING privateKey field. + int (*priv_decode)(EVP_PKEY *out, CBS *params, CBS *key); + + // priv_encode encodes |key| as a PrivateKeyInfo and appends the result to + // |out|. It returns one on success and zero on error. + int (*priv_encode)(CBB *out, const EVP_PKEY *key); + + int (*set_priv_raw)(EVP_PKEY *pkey, const uint8_t *in, size_t len); + int (*set_pub_raw)(EVP_PKEY *pkey, const uint8_t *in, size_t len); + int (*get_priv_raw)(const EVP_PKEY *pkey, uint8_t *out, size_t *out_len); + int (*get_pub_raw)(const EVP_PKEY *pkey, uint8_t *out, size_t *out_len); + + // pkey_opaque returns 1 if the |pk| is opaque. Opaque keys are backed by + // custom implementations which do not expose key material and parameters. + int (*pkey_opaque)(const EVP_PKEY *pk); + + int (*pkey_size)(const EVP_PKEY *pk); + int (*pkey_bits)(const EVP_PKEY *pk); + + int (*param_missing)(const EVP_PKEY *pk); + int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from); + int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b); + + void (*pkey_free)(EVP_PKEY *pkey); +} /* EVP_PKEY_ASN1_METHOD */; + + +#define EVP_PKEY_OP_UNDEFINED 0 +#define EVP_PKEY_OP_KEYGEN (1 << 2) +#define EVP_PKEY_OP_SIGN (1 << 3) +#define EVP_PKEY_OP_VERIFY (1 << 4) +#define EVP_PKEY_OP_VERIFYRECOVER (1 << 5) +#define EVP_PKEY_OP_ENCRYPT (1 << 6) +#define EVP_PKEY_OP_DECRYPT (1 << 7) +#define EVP_PKEY_OP_DERIVE (1 << 8) +#define EVP_PKEY_OP_PARAMGEN (1 << 9) + +#define EVP_PKEY_OP_TYPE_SIG \ + (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY | EVP_PKEY_OP_VERIFYRECOVER) + +#define EVP_PKEY_OP_TYPE_CRYPT (EVP_PKEY_OP_ENCRYPT | EVP_PKEY_OP_DECRYPT) + +#define EVP_PKEY_OP_TYPE_NOGEN \ + (EVP_PKEY_OP_SIG | EVP_PKEY_OP_CRYPT | EVP_PKEY_OP_DERIVE) + +#define EVP_PKEY_OP_TYPE_GEN (EVP_PKEY_OP_KEYGEN | EVP_PKEY_OP_PARAMGEN) + +// EVP_PKEY_CTX_ctrl performs |cmd| on |ctx|. The |keytype| and |optype| +// arguments can be -1 to specify that any type and operation are acceptable, +// otherwise |keytype| must match the type of |ctx| and the bits of |optype| +// must intersect the operation flags set on |ctx|. +// +// The |p1| and |p2| arguments depend on the value of |cmd|. +// +// It returns one on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, + int cmd, int p1, void *p2); + +#define EVP_PKEY_CTRL_MD 1 +#define EVP_PKEY_CTRL_GET_MD 2 + +// EVP_PKEY_CTRL_PEER_KEY is called with different values of |p1|: +// 0: Is called from |EVP_PKEY_derive_set_peer| and |p2| contains a peer key. +// If the return value is <= 0, the key is rejected. +// 1: Is called at the end of |EVP_PKEY_derive_set_peer| and |p2| contains a +// peer key. If the return value is <= 0, the key is rejected. +// 2: Is called with |p2| == NULL to test whether the peer's key was used. +// (EC)DH always return one in this case. +// 3: Is called with |p2| == NULL to set whether the peer's key was used. +// (EC)DH always return one in this case. This was only used for GOST. +#define EVP_PKEY_CTRL_PEER_KEY 3 + +// EVP_PKEY_ALG_CTRL is the base value from which key-type specific ctrl +// commands are numbered. +#define EVP_PKEY_ALG_CTRL 0x1000 + +#define EVP_PKEY_CTRL_RSA_PADDING (EVP_PKEY_ALG_CTRL + 1) +#define EVP_PKEY_CTRL_GET_RSA_PADDING (EVP_PKEY_ALG_CTRL + 2) +#define EVP_PKEY_CTRL_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 3) +#define EVP_PKEY_CTRL_GET_RSA_PSS_SALTLEN (EVP_PKEY_ALG_CTRL + 4) +#define EVP_PKEY_CTRL_RSA_KEYGEN_BITS (EVP_PKEY_ALG_CTRL + 5) +#define EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP (EVP_PKEY_ALG_CTRL + 6) +#define EVP_PKEY_CTRL_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 7) +#define EVP_PKEY_CTRL_GET_RSA_OAEP_MD (EVP_PKEY_ALG_CTRL + 8) +#define EVP_PKEY_CTRL_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 9) +#define EVP_PKEY_CTRL_GET_RSA_MGF1_MD (EVP_PKEY_ALG_CTRL + 10) +#define EVP_PKEY_CTRL_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 11) +#define EVP_PKEY_CTRL_GET_RSA_OAEP_LABEL (EVP_PKEY_ALG_CTRL + 12) +#define EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID (EVP_PKEY_ALG_CTRL + 13) + +struct evp_pkey_ctx_st { + // Method associated with this operation + const EVP_PKEY_METHOD *pmeth; + // Engine that implements this method or NULL if builtin + ENGINE *engine; + // Key: may be NULL + EVP_PKEY *pkey; + // Peer key for key agreement, may be NULL + EVP_PKEY *peerkey; + // operation contains one of the |EVP_PKEY_OP_*| values. + int operation; + // Algorithm specific data + void *data; +} /* EVP_PKEY_CTX */; + +struct evp_pkey_method_st { + int pkey_id; + + int (*init)(EVP_PKEY_CTX *ctx); + int (*copy)(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src); + void (*cleanup)(EVP_PKEY_CTX *ctx); + + int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); + + int (*sign)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen); + + int (*sign_message)(EVP_PKEY_CTX *ctx, uint8_t *sig, size_t *siglen, + const uint8_t *tbs, size_t tbslen); + + int (*verify)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, + const uint8_t *tbs, size_t tbslen); + + int (*verify_message)(EVP_PKEY_CTX *ctx, const uint8_t *sig, size_t siglen, + const uint8_t *tbs, size_t tbslen); + + int (*verify_recover)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *out_len, + const uint8_t *sig, size_t sig_len); + + int (*encrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen); + + int (*decrypt)(EVP_PKEY_CTX *ctx, uint8_t *out, size_t *outlen, + const uint8_t *in, size_t inlen); + + int (*derive)(EVP_PKEY_CTX *ctx, uint8_t *key, size_t *keylen); + + int (*paramgen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); + + int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); +} /* EVP_PKEY_METHOD */; + +typedef struct { + union { + uint8_t priv[64]; + struct { + // Shift the location of the public key to align with where it is in the + // private key representation. + uint8_t pad[32]; + uint8_t value[32]; + } pub; + } key; + char has_private; +} ED25519_KEY; + +typedef struct { + uint8_t pub[32]; + uint8_t priv[32]; + char has_private; +} X25519_KEY; + +extern const EVP_PKEY_ASN1_METHOD dsa_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD ec_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD rsa_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth; +extern const EVP_PKEY_ASN1_METHOD x25519_asn1_meth; + +extern const EVP_PKEY_METHOD rsa_pkey_meth; +extern const EVP_PKEY_METHOD ec_pkey_meth; +extern const EVP_PKEY_METHOD ed25519_pkey_meth; +extern const EVP_PKEY_METHOD x25519_pkey_meth; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_EVP_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_dsa_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/evp/p_dsa_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c index 80b996b58..78587dcb3 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_dsa_asn1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c @@ -255,6 +255,11 @@ const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { dsa_priv_decode, dsa_priv_encode, + NULL /* set_priv_raw */, + NULL /* set_pub_raw */, + NULL /* get_priv_raw */, + NULL /* get_pub_raw */, + NULL /* pkey_opaque */, int_dsa_size, diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_dsa_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/evp/p_dsa_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c.grpc_back index 34b2e70c2..d50e0fc37 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_dsa_asn1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_dsa_asn1.c.grpc_back @@ -255,6 +255,11 @@ const EVP_PKEY_ASN1_METHOD dsa_asn1_meth = { dsa_priv_decode, dsa_priv_encode, + NULL /* set_priv_raw */, + NULL /* set_pub_raw */, + NULL /* get_priv_raw */, + NULL /* get_pub_raw */, + NULL /* pkey_opaque */, int_dsa_size, diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ec.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c similarity index 82% rename from Pods/BoringSSL-GRPC/crypto/evp/p_ec.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c index a45d37f20..9dc36faba 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ec.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c @@ -58,7 +58,6 @@ #include #include -#include #include #include #include @@ -76,6 +75,7 @@ typedef struct { // message digest const EVP_MD *md; + EC_GROUP *gen_group; } EC_PKEY_CTX; @@ -111,6 +111,7 @@ static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { return; } + EC_GROUP_free(dctx->gen_group); OPENSSL_free(dctx); } @@ -199,6 +200,16 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { // Default behaviour is OK return 1; + case EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID: { + EC_GROUP *group = EC_GROUP_new_by_curve_name(p1); + if (group == NULL) { + return 0; + } + EC_GROUP_free(dctx->gen_group); + dctx->gen_group = group; + return 1; + } + default: OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); return 0; @@ -206,14 +217,35 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { } static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { - if (ctx->pkey == NULL) { + EC_PKEY_CTX *dctx = ctx->data; + const EC_GROUP *group = dctx->gen_group; + if (group == NULL) { + if (ctx->pkey == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_PARAMETERS_SET); + return 0; + } + group = EC_KEY_get0_group(ctx->pkey->pkey.ec); + } + EC_KEY *ec = EC_KEY_new(); + if (ec == NULL || + !EC_KEY_set_group(ec, group) || + !EC_KEY_generate_key(ec)) { + EC_KEY_free(ec); + return 0; + } + EVP_PKEY_assign_EC_KEY(pkey, ec); + return 1; +} + +static int pkey_ec_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + EC_PKEY_CTX *dctx = ctx->data; + if (dctx->gen_group == NULL) { OPENSSL_PUT_ERROR(EVP, EVP_R_NO_PARAMETERS_SET); return 0; } EC_KEY *ec = EC_KEY_new(); if (ec == NULL || - !EC_KEY_set_group(ec, EC_KEY_get0_group(ctx->pkey->pkey.ec)) || - !EC_KEY_generate_key(ec)) { + !EC_KEY_set_group(ec, dctx->gen_group)) { EC_KEY_free(ec); return 0; } @@ -235,5 +267,20 @@ const EVP_PKEY_METHOD ec_pkey_meth = { NULL /* encrypt */, NULL /* decrypt */, pkey_ec_derive, + pkey_ec_paramgen, pkey_ec_ctrl, }; + +int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_TYPE_GEN, + EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL); +} + +int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, int encoding) { + // BoringSSL only supports named curve syntax. + if (encoding != OPENSSL_EC_NAMED_CURVE) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PARAMETERS); + return 0; + } + return 1; +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ec.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/crypto/evp/p_ec.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c.grpc_back index d311d2209..976754154 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ec.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec.c.grpc_back @@ -58,7 +58,6 @@ #include #include -#include #include #include #include @@ -76,6 +75,7 @@ typedef struct { // message digest const EVP_MD *md; + EC_GROUP *gen_group; } EC_PKEY_CTX; @@ -111,6 +111,7 @@ static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) { return; } + EC_GROUP_free(dctx->gen_group); OPENSSL_free(dctx); } @@ -199,6 +200,16 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { // Default behaviour is OK return 1; + case EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID: { + EC_GROUP *group = EC_GROUP_new_by_curve_name(p1); + if (group == NULL) { + return 0; + } + EC_GROUP_free(dctx->gen_group); + dctx->gen_group = group; + return 1; + } + default: OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); return 0; @@ -206,14 +217,35 @@ static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { } static int pkey_ec_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { - if (ctx->pkey == NULL) { + EC_PKEY_CTX *dctx = ctx->data; + const EC_GROUP *group = dctx->gen_group; + if (group == NULL) { + if (ctx->pkey == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_PARAMETERS_SET); + return 0; + } + group = EC_KEY_get0_group(ctx->pkey->pkey.ec); + } + EC_KEY *ec = EC_KEY_new(); + if (ec == NULL || + !EC_KEY_set_group(ec, group) || + !EC_KEY_generate_key(ec)) { + EC_KEY_free(ec); + return 0; + } + EVP_PKEY_assign_EC_KEY(pkey, ec); + return 1; +} + +static int pkey_ec_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + EC_PKEY_CTX *dctx = ctx->data; + if (dctx->gen_group == NULL) { OPENSSL_PUT_ERROR(EVP, EVP_R_NO_PARAMETERS_SET); return 0; } EC_KEY *ec = EC_KEY_new(); if (ec == NULL || - !EC_KEY_set_group(ec, EC_KEY_get0_group(ctx->pkey->pkey.ec)) || - !EC_KEY_generate_key(ec)) { + !EC_KEY_set_group(ec, dctx->gen_group)) { EC_KEY_free(ec); return 0; } @@ -235,5 +267,20 @@ const EVP_PKEY_METHOD ec_pkey_meth = { NULL /* encrypt */, NULL /* decrypt */, pkey_ec_derive, + pkey_ec_paramgen, pkey_ec_ctrl, }; + +int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, int nid) { + return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_EC, EVP_PKEY_OP_TYPE_GEN, + EVP_PKEY_CTRL_EC_PARAMGEN_CURVE_NID, nid, NULL); +} + +int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, int encoding) { + // BoringSSL only supports named curve syntax. + if (encoding != OPENSSL_EC_NAMED_CURVE) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PARAMETERS); + return 0; + } + return 1; +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ec_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/evp/p_ec_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c index 4130a5116..5c0bec5f5 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ec_asn1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c @@ -206,13 +206,7 @@ static int ec_missing_parameters(const EVP_PKEY *pkey) { } static int ec_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { - EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec)); - if (group == NULL || - EC_KEY_set_group(to->pkey.ec, group) == 0) { - return 0; - } - EC_GROUP_free(group); - return 1; + return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec)); } static int ec_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { @@ -243,6 +237,11 @@ const EVP_PKEY_ASN1_METHOD ec_asn1_meth = { eckey_priv_decode, eckey_priv_encode, + NULL /* set_priv_raw */, + NULL /* set_pub_raw */, + NULL /* get_priv_raw */, + NULL /* get_pub_raw */, + eckey_opaque, int_ec_size, diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_ec_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/evp/p_ec_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c.grpc_back index c5828d932..dedc5e0ae 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_ec_asn1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ec_asn1.c.grpc_back @@ -206,13 +206,7 @@ static int ec_missing_parameters(const EVP_PKEY *pkey) { } static int ec_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) { - EC_GROUP *group = EC_GROUP_dup(EC_KEY_get0_group(from->pkey.ec)); - if (group == NULL || - EC_KEY_set_group(to->pkey.ec, group) == 0) { - return 0; - } - EC_GROUP_free(group); - return 1; + return EC_KEY_set_group(to->pkey.ec, EC_KEY_get0_group(from->pkey.ec)); } static int ec_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { @@ -243,6 +237,11 @@ const EVP_PKEY_ASN1_METHOD ec_asn1_meth = { eckey_priv_decode, eckey_priv_encode, + NULL /* set_priv_raw */, + NULL /* set_pub_raw */, + NULL /* get_priv_raw */, + NULL /* get_pub_raw */, + eckey_opaque, int_ec_size, diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c new file mode 100644 index 000000000..d520ed2e6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c @@ -0,0 +1,104 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include + +#include "internal.h" + + +// Ed25519 has no parameters to copy. +static int pkey_ed25519_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { return 1; } + +static int pkey_ed25519_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!EVP_PKEY_set_type(pkey, EVP_PKEY_ED25519)) { + OPENSSL_free(key); + return 0; + } + + uint8_t pubkey_unused[32]; + ED25519_keypair(pubkey_unused, key->key.priv); + key->has_private = 1; + + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = key; + return 1; +} + +static int pkey_ed25519_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig, + size_t *siglen, const uint8_t *tbs, + size_t tbslen) { + ED25519_KEY *key = ctx->pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (sig == NULL) { + *siglen = 64; + return 1; + } + + if (*siglen < 64) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (!ED25519_sign(sig, tbs, tbslen, key->key.priv)) { + return 0; + } + + *siglen = 64; + return 1; +} + +static int pkey_ed25519_verify_message(EVP_PKEY_CTX *ctx, const uint8_t *sig, + size_t siglen, const uint8_t *tbs, + size_t tbslen) { + ED25519_KEY *key = ctx->pkey->pkey.ptr; + if (siglen != 64 || + !ED25519_verify(tbs, tbslen, sig, key->key.pub.value)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_SIGNATURE); + return 0; + } + + return 1; +} + +const EVP_PKEY_METHOD ed25519_pkey_meth = { + EVP_PKEY_ED25519, + NULL /* init */, + pkey_ed25519_copy, + NULL /* cleanup */, + pkey_ed25519_keygen, + NULL /* sign */, + pkey_ed25519_sign_message, + NULL /* verify */, + pkey_ed25519_verify_message, + NULL /* verify_recover */, + NULL /* encrypt */, + NULL /* decrypt */, + NULL /* derive */, + NULL /* paramgen */, + NULL /* ctrl */, +}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c.grpc_back new file mode 100644 index 000000000..9149afb22 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519.c.grpc_back @@ -0,0 +1,104 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include + +#include "internal.h" + + +// Ed25519 has no parameters to copy. +static int pkey_ed25519_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { return 1; } + +static int pkey_ed25519_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!EVP_PKEY_set_type(pkey, EVP_PKEY_ED25519)) { + OPENSSL_free(key); + return 0; + } + + uint8_t pubkey_unused[32]; + ED25519_keypair(pubkey_unused, key->key.priv); + key->has_private = 1; + + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = key; + return 1; +} + +static int pkey_ed25519_sign_message(EVP_PKEY_CTX *ctx, uint8_t *sig, + size_t *siglen, const uint8_t *tbs, + size_t tbslen) { + ED25519_KEY *key = ctx->pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (sig == NULL) { + *siglen = 64; + return 1; + } + + if (*siglen < 64) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + if (!ED25519_sign(sig, tbs, tbslen, key->key.priv)) { + return 0; + } + + *siglen = 64; + return 1; +} + +static int pkey_ed25519_verify_message(EVP_PKEY_CTX *ctx, const uint8_t *sig, + size_t siglen, const uint8_t *tbs, + size_t tbslen) { + ED25519_KEY *key = ctx->pkey->pkey.ptr; + if (siglen != 64 || + !ED25519_verify(tbs, tbslen, sig, key->key.pub.value)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_SIGNATURE); + return 0; + } + + return 1; +} + +const EVP_PKEY_METHOD ed25519_pkey_meth = { + EVP_PKEY_ED25519, + NULL /* init */, + pkey_ed25519_copy, + NULL /* cleanup */, + pkey_ed25519_keygen, + NULL /* sign */, + pkey_ed25519_sign_message, + NULL /* verify */, + pkey_ed25519_verify_message, + NULL /* verify_recover */, + NULL /* encrypt */, + NULL /* decrypt */, + NULL /* derive */, + NULL /* paramgen */, + NULL /* ctrl */, +}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c new file mode 100644 index 000000000..632ee5bc1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c @@ -0,0 +1,221 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include +#include + +#include "internal.h" +#include "../internal.h" + + +static void ed25519_free(EVP_PKEY *pkey) { + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = NULL; +} + +static int ed25519_set_priv_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + // The RFC 8032 encoding stores only the 32-byte seed, so we must recover the + // full representation which we use from it. + uint8_t pubkey_unused[32]; + ED25519_keypair_from_seed(pubkey_unused, key->key.priv, in); + key->has_private = 1; + + ed25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int ed25519_set_pub_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(key->key.pub.value, in, 32); + key->has_private = 0; + + ed25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int ed25519_get_priv_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const ED25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + // The raw private key format is the first 32 bytes of the private key. + OPENSSL_memcpy(out, key->key.priv, 32); + *out_len = 32; + return 1; +} + +static int ed25519_get_pub_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const ED25519_KEY *key = pkey->pkey.ptr; + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(out, key->key.pub.value, 32); + *out_len = 32; + return 1; +} + +static int ed25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 4. + + // The parameters must be omitted. Public keys have length 32. + if (CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return ed25519_set_pub_raw(out, CBS_data(key), CBS_len(key)); +} + +static int ed25519_pub_encode(CBB *out, const EVP_PKEY *pkey) { + const ED25519_KEY *key = pkey->pkey.ptr; + + // See RFC 8410, section 4. + CBB spki, algorithm, oid, key_bitstring; + if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !CBB_add_bytes(&key_bitstring, key->key.pub.value, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int ed25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + const ED25519_KEY *a_key = a->pkey.ptr; + const ED25519_KEY *b_key = b->pkey.ptr; + return OPENSSL_memcmp(a_key->key.pub.value, b_key->key.pub.value, 32) == 0; +} + +static int ed25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 7. + + // Parameters must be empty. The key is a 32-byte value wrapped in an extra + // OCTET STRING layer. + CBS inner; + if (CBS_len(params) != 0 || + !CBS_get_asn1(key, &inner, CBS_ASN1_OCTETSTRING) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return ed25519_set_priv_raw(out, CBS_data(&inner), CBS_len(&inner)); +} + +static int ed25519_priv_encode(CBB *out, const EVP_PKEY *pkey) { + ED25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + // See RFC 8410, section 7. + CBB pkcs8, algorithm, oid, private_key, inner; + if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&pkcs8, 0 /* version */) || + !CBB_add_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !CBB_add_asn1(&private_key, &inner, CBS_ASN1_OCTETSTRING) || + // The PKCS#8 encoding stores only the 32-byte seed which is the first 32 + // bytes of the private key. + !CBB_add_bytes(&inner, key->key.priv, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int ed25519_size(const EVP_PKEY *pkey) { return 64; } + +static int ed25519_bits(const EVP_PKEY *pkey) { return 253; } + +const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { + EVP_PKEY_ED25519, + {0x2b, 0x65, 0x70}, + 3, + ed25519_pub_decode, + ed25519_pub_encode, + ed25519_pub_cmp, + ed25519_priv_decode, + ed25519_priv_encode, + ed25519_set_priv_raw, + ed25519_set_pub_raw, + ed25519_get_priv_raw, + ed25519_get_pub_raw, + NULL /* pkey_opaque */, + ed25519_size, + ed25519_bits, + NULL /* param_missing */, + NULL /* param_copy */, + NULL /* param_cmp */, + ed25519_free, +}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c.grpc_back new file mode 100644 index 000000000..1f996cf6d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_ed25519_asn1.c.grpc_back @@ -0,0 +1,221 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include +#include + +#include "internal.h" +#include "../internal.h" + + +static void ed25519_free(EVP_PKEY *pkey) { + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = NULL; +} + +static int ed25519_set_priv_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + // The RFC 8032 encoding stores only the 32-byte seed, so we must recover the + // full representation which we use from it. + uint8_t pubkey_unused[32]; + ED25519_keypair_from_seed(pubkey_unused, key->key.priv, in); + key->has_private = 1; + + ed25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int ed25519_set_pub_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + ED25519_KEY *key = OPENSSL_malloc(sizeof(ED25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(key->key.pub.value, in, 32); + key->has_private = 0; + + ed25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int ed25519_get_priv_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const ED25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + // The raw private key format is the first 32 bytes of the private key. + OPENSSL_memcpy(out, key->key.priv, 32); + *out_len = 32; + return 1; +} + +static int ed25519_get_pub_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const ED25519_KEY *key = pkey->pkey.ptr; + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(out, key->key.pub.value, 32); + *out_len = 32; + return 1; +} + +static int ed25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 4. + + // The parameters must be omitted. Public keys have length 32. + if (CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return ed25519_set_pub_raw(out, CBS_data(key), CBS_len(key)); +} + +static int ed25519_pub_encode(CBB *out, const EVP_PKEY *pkey) { + const ED25519_KEY *key = pkey->pkey.ptr; + + // See RFC 8410, section 4. + CBB spki, algorithm, oid, key_bitstring; + if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !CBB_add_bytes(&key_bitstring, key->key.pub.value, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int ed25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + const ED25519_KEY *a_key = a->pkey.ptr; + const ED25519_KEY *b_key = b->pkey.ptr; + return OPENSSL_memcmp(a_key->key.pub.value, b_key->key.pub.value, 32) == 0; +} + +static int ed25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 7. + + // Parameters must be empty. The key is a 32-byte value wrapped in an extra + // OCTET STRING layer. + CBS inner; + if (CBS_len(params) != 0 || + !CBS_get_asn1(key, &inner, CBS_ASN1_OCTETSTRING) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return ed25519_set_priv_raw(out, CBS_data(&inner), CBS_len(&inner)); +} + +static int ed25519_priv_encode(CBB *out, const EVP_PKEY *pkey) { + ED25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + // See RFC 8410, section 7. + CBB pkcs8, algorithm, oid, private_key, inner; + if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&pkcs8, 0 /* version */) || + !CBB_add_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, ed25519_asn1_meth.oid, ed25519_asn1_meth.oid_len) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !CBB_add_asn1(&private_key, &inner, CBS_ASN1_OCTETSTRING) || + // The PKCS#8 encoding stores only the 32-byte seed which is the first 32 + // bytes of the private key. + !CBB_add_bytes(&inner, key->key.priv, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int ed25519_size(const EVP_PKEY *pkey) { return 64; } + +static int ed25519_bits(const EVP_PKEY *pkey) { return 253; } + +const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = { + EVP_PKEY_ED25519, + {0x2b, 0x65, 0x70}, + 3, + ed25519_pub_decode, + ed25519_pub_encode, + ed25519_pub_cmp, + ed25519_priv_decode, + ed25519_priv_encode, + ed25519_set_priv_raw, + ed25519_set_pub_raw, + ed25519_get_priv_raw, + ed25519_get_pub_raw, + NULL /* pkey_opaque */, + ed25519_size, + ed25519_bits, + NULL /* param_missing */, + NULL /* param_copy */, + NULL /* param_cmp */, + ed25519_free, +}; diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/evp/p_rsa.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c index b5f727121..04a4f2281 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -132,9 +131,10 @@ static int pkey_rsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { dctx->pad_mode = sctx->pad_mode; dctx->md = sctx->md; dctx->mgf1md = sctx->mgf1md; + dctx->saltlen = sctx->saltlen; if (sctx->oaep_label) { OPENSSL_free(dctx->oaep_label); - dctx->oaep_label = BUF_memdup(sctx->oaep_label, sctx->oaep_labellen); + dctx->oaep_label = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen); if (!dctx->oaep_label) { return 0; } @@ -553,7 +553,8 @@ const EVP_PKEY_METHOD rsa_pkey_meth = { pkey_rsa_verify_recover, pkey_rsa_encrypt, pkey_rsa_decrypt, - 0 /* derive */, + NULL /* derive */, + NULL /* paramgen */, pkey_rsa_ctrl, }; @@ -567,6 +568,19 @@ int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *out_padding) { 0, out_padding); } +int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return 0; +} + +int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int salt_len) { + return 0; +} + +int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md) { + return 0; +} + int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int salt_len) { return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY), diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/evp/p_rsa.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c.grpc_back index cfc6bea1e..7872a922c 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa.c.grpc_back @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -132,9 +131,10 @@ static int pkey_rsa_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { dctx->pad_mode = sctx->pad_mode; dctx->md = sctx->md; dctx->mgf1md = sctx->mgf1md; + dctx->saltlen = sctx->saltlen; if (sctx->oaep_label) { OPENSSL_free(dctx->oaep_label); - dctx->oaep_label = BUF_memdup(sctx->oaep_label, sctx->oaep_labellen); + dctx->oaep_label = OPENSSL_memdup(sctx->oaep_label, sctx->oaep_labellen); if (!dctx->oaep_label) { return 0; } @@ -553,7 +553,8 @@ const EVP_PKEY_METHOD rsa_pkey_meth = { pkey_rsa_verify_recover, pkey_rsa_encrypt, pkey_rsa_decrypt, - 0 /* derive */, + NULL /* derive */, + NULL /* paramgen */, pkey_rsa_ctrl, }; @@ -567,6 +568,19 @@ int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, int *out_padding) { 0, out_padding); } +int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, const EVP_MD *md) { + return 0; +} + +int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, int salt_len) { + return 0; +} + +int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md) { + return 0; +} + int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, int salt_len) { return EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_RSA, (EVP_PKEY_OP_SIGN | EVP_PKEY_OP_VERIFY), diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/evp/p_rsa_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c index b10c36fc2..1bd2eab47 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa_asn1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c @@ -178,6 +178,11 @@ const EVP_PKEY_ASN1_METHOD rsa_asn1_meth = { rsa_priv_decode, rsa_priv_encode, + NULL /* set_priv_raw */, + NULL /* set_pub_raw */, + NULL /* get_priv_raw */, + NULL /* get_pub_raw */, + rsa_opaque, int_rsa_size, diff --git a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/evp/p_rsa_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c.grpc_back index 85f6fc837..c0971038e 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/p_rsa_asn1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_rsa_asn1.c.grpc_back @@ -178,6 +178,11 @@ const EVP_PKEY_ASN1_METHOD rsa_asn1_meth = { rsa_priv_decode, rsa_priv_encode, + NULL /* set_priv_raw */, + NULL /* set_pub_raw */, + NULL /* get_priv_raw */, + NULL /* get_pub_raw */, + rsa_opaque, int_rsa_size, diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c new file mode 100644 index 000000000..b72ac6dc3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c @@ -0,0 +1,110 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include + +#include "internal.h" + + +// X25519 has no parameters to copy. +static int pkey_x25519_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { return 1; } + +static int pkey_x25519_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + X25519_KEY *key = OPENSSL_malloc(sizeof(X25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!EVP_PKEY_set_type(pkey, EVP_PKEY_X25519)) { + OPENSSL_free(key); + return 0; + } + + X25519_keypair(key->pub, key->priv); + key->has_private = 1; + + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = key; + return 1; +} + +static int pkey_x25519_derive(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len) { + if (ctx->pkey == NULL || ctx->peerkey == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_KEYS_NOT_SET); + return 0; + } + + const X25519_KEY *our_key = ctx->pkey->pkey.ptr; + const X25519_KEY *peer_key = ctx->peerkey->pkey.ptr; + if (our_key == NULL || peer_key == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_KEYS_NOT_SET); + return 0; + } + + if (!our_key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (out != NULL) { + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + if (!X25519(out, our_key->priv, peer_key->pub)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PEER_KEY); + return 0; + } + } + + *out_len = 32; + return 1; +} + +static int pkey_x25519_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { + switch (type) { + case EVP_PKEY_CTRL_PEER_KEY: + // |EVP_PKEY_derive_set_peer| requires the key implement this command, + // even if it is a no-op. + return 1; + + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); + return 0; + } +} + +const EVP_PKEY_METHOD x25519_pkey_meth = { + EVP_PKEY_X25519, + NULL /* init */, + pkey_x25519_copy, + NULL /* cleanup */, + pkey_x25519_keygen, + NULL /* sign */, + NULL /* sign_message */, + NULL /* verify */, + NULL /* verify_message */, + NULL /* verify_recover */, + NULL /* encrypt */, + NULL /* decrypt */, + pkey_x25519_derive, + NULL /* paramgen */, + pkey_x25519_ctrl, +}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c.grpc_back new file mode 100644 index 000000000..ed7df39a9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519.c.grpc_back @@ -0,0 +1,110 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include + +#include "internal.h" + + +// X25519 has no parameters to copy. +static int pkey_x25519_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src) { return 1; } + +static int pkey_x25519_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) { + X25519_KEY *key = OPENSSL_malloc(sizeof(X25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + if (!EVP_PKEY_set_type(pkey, EVP_PKEY_X25519)) { + OPENSSL_free(key); + return 0; + } + + X25519_keypair(key->pub, key->priv); + key->has_private = 1; + + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = key; + return 1; +} + +static int pkey_x25519_derive(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len) { + if (ctx->pkey == NULL || ctx->peerkey == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_KEYS_NOT_SET); + return 0; + } + + const X25519_KEY *our_key = ctx->pkey->pkey.ptr; + const X25519_KEY *peer_key = ctx->peerkey->pkey.ptr; + if (our_key == NULL || peer_key == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_KEYS_NOT_SET); + return 0; + } + + if (!our_key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (out != NULL) { + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + if (!X25519(out, our_key->priv, peer_key->pub)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_INVALID_PEER_KEY); + return 0; + } + } + + *out_len = 32; + return 1; +} + +static int pkey_x25519_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) { + switch (type) { + case EVP_PKEY_CTRL_PEER_KEY: + // |EVP_PKEY_derive_set_peer| requires the key implement this command, + // even if it is a no-op. + return 1; + + default: + OPENSSL_PUT_ERROR(EVP, EVP_R_COMMAND_NOT_SUPPORTED); + return 0; + } +} + +const EVP_PKEY_METHOD x25519_pkey_meth = { + EVP_PKEY_X25519, + NULL /* init */, + pkey_x25519_copy, + NULL /* cleanup */, + pkey_x25519_keygen, + NULL /* sign */, + NULL /* sign_message */, + NULL /* verify */, + NULL /* verify_message */, + NULL /* verify_recover */, + NULL /* encrypt */, + NULL /* decrypt */, + pkey_x25519_derive, + NULL /* paramgen */, + pkey_x25519_ctrl, +}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c new file mode 100644 index 000000000..0e96d996d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c @@ -0,0 +1,248 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include +#include + +#include "internal.h" +#include "../internal.h" + + +static void x25519_free(EVP_PKEY *pkey) { + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = NULL; +} + +static int x25519_set_priv_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + X25519_KEY *key = OPENSSL_malloc(sizeof(X25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(key->priv, in, 32); + X25519_public_from_private(key->pub, key->priv); + key->has_private = 1; + + x25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int x25519_set_pub_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + X25519_KEY *key = OPENSSL_malloc(sizeof(X25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(key->pub, in, 32); + key->has_private = 0; + + x25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int x25519_get_priv_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const X25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(out, key->priv, 32); + *out_len = 32; + return 1; +} + +static int x25519_get_pub_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const X25519_KEY *key = pkey->pkey.ptr; + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(out, key->pub, 32); + *out_len = 32; + return 1; +} + +static int x25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 4. + + // The parameters must be omitted. Public keys have length 32. + if (CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return x25519_set_pub_raw(out, CBS_data(key), CBS_len(key)); +} + +static int x25519_pub_encode(CBB *out, const EVP_PKEY *pkey) { + const X25519_KEY *key = pkey->pkey.ptr; + + // See RFC 8410, section 4. + CBB spki, algorithm, oid, key_bitstring; + if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, x25519_asn1_meth.oid, x25519_asn1_meth.oid_len) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !CBB_add_bytes(&key_bitstring, key->pub, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int x25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + const X25519_KEY *a_key = a->pkey.ptr; + const X25519_KEY *b_key = b->pkey.ptr; + return OPENSSL_memcmp(a_key->pub, b_key->pub, 32) == 0; +} + +static int x25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 7. + + // Parameters must be empty. The key is a 32-byte value wrapped in an extra + // OCTET STRING layer. + CBS inner; + if (CBS_len(params) != 0 || + !CBS_get_asn1(key, &inner, CBS_ASN1_OCTETSTRING) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return x25519_set_priv_raw(out, CBS_data(&inner), CBS_len(&inner)); +} + +static int x25519_priv_encode(CBB *out, const EVP_PKEY *pkey) { + X25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + // See RFC 8410, section 7. + CBB pkcs8, algorithm, oid, private_key, inner; + if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&pkcs8, 0 /* version */) || + !CBB_add_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, x25519_asn1_meth.oid, x25519_asn1_meth.oid_len) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !CBB_add_asn1(&private_key, &inner, CBS_ASN1_OCTETSTRING) || + // The PKCS#8 encoding stores only the 32-byte seed which is the first 32 + // bytes of the private key. + !CBB_add_bytes(&inner, key->priv, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int x25519_size(const EVP_PKEY *pkey) { return 32; } + +static int x25519_bits(const EVP_PKEY *pkey) { return 253; } + +const EVP_PKEY_ASN1_METHOD x25519_asn1_meth = { + EVP_PKEY_X25519, + {0x2b, 0x65, 0x6e}, + 3, + x25519_pub_decode, + x25519_pub_encode, + x25519_pub_cmp, + x25519_priv_decode, + x25519_priv_encode, + x25519_set_priv_raw, + x25519_set_pub_raw, + x25519_get_priv_raw, + x25519_get_pub_raw, + NULL /* pkey_opaque */, + x25519_size, + x25519_bits, + NULL /* param_missing */, + NULL /* param_copy */, + NULL /* param_cmp */, + x25519_free, +}; + +int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, const uint8_t *in, + size_t len) { + // TODO(davidben): In OpenSSL, this function also works for |EVP_PKEY_EC| + // keys. Add support if it ever comes up. + if (pkey->type != EVP_PKEY_X25519) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + return 0; + } + + return x25519_set_pub_raw(pkey, in, len); +} + +size_t EVP_PKEY_get1_tls_encodedpoint(const EVP_PKEY *pkey, uint8_t **out_ptr) { + // TODO(davidben): In OpenSSL, this function also works for |EVP_PKEY_EC| + // keys. Add support if it ever comes up. + if (pkey->type != EVP_PKEY_X25519) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + return 0; + } + + const X25519_KEY *key = pkey->pkey.ptr; + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_KEY_SET); + return 0; + } + + *out_ptr = OPENSSL_memdup(key->pub, 32); + return *out_ptr == NULL ? 0 : 32; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c.grpc_back new file mode 100644 index 000000000..99b4cc9c9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/p_x25519_asn1.c.grpc_back @@ -0,0 +1,248 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include +#include + +#include "internal.h" +#include "../internal.h" + + +static void x25519_free(EVP_PKEY *pkey) { + OPENSSL_free(pkey->pkey.ptr); + pkey->pkey.ptr = NULL; +} + +static int x25519_set_priv_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + X25519_KEY *key = OPENSSL_malloc(sizeof(X25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(key->priv, in, 32); + X25519_public_from_private(key->pub, key->priv); + key->has_private = 1; + + x25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int x25519_set_pub_raw(EVP_PKEY *pkey, const uint8_t *in, size_t len) { + if (len != 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + X25519_KEY *key = OPENSSL_malloc(sizeof(X25519_KEY)); + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, ERR_R_MALLOC_FAILURE); + return 0; + } + + OPENSSL_memcpy(key->pub, in, 32); + key->has_private = 0; + + x25519_free(pkey); + pkey->pkey.ptr = key; + return 1; +} + +static int x25519_get_priv_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const X25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(out, key->priv, 32); + *out_len = 32; + return 1; +} + +static int x25519_get_pub_raw(const EVP_PKEY *pkey, uint8_t *out, + size_t *out_len) { + const X25519_KEY *key = pkey->pkey.ptr; + if (out == NULL) { + *out_len = 32; + return 1; + } + + if (*out_len < 32) { + OPENSSL_PUT_ERROR(EVP, EVP_R_BUFFER_TOO_SMALL); + return 0; + } + + OPENSSL_memcpy(out, key->pub, 32); + *out_len = 32; + return 1; +} + +static int x25519_pub_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 4. + + // The parameters must be omitted. Public keys have length 32. + if (CBS_len(params) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return x25519_set_pub_raw(out, CBS_data(key), CBS_len(key)); +} + +static int x25519_pub_encode(CBB *out, const EVP_PKEY *pkey) { + const X25519_KEY *key = pkey->pkey.ptr; + + // See RFC 8410, section 4. + CBB spki, algorithm, oid, key_bitstring; + if (!CBB_add_asn1(out, &spki, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&spki, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, x25519_asn1_meth.oid, x25519_asn1_meth.oid_len) || + !CBB_add_asn1(&spki, &key_bitstring, CBS_ASN1_BITSTRING) || + !CBB_add_u8(&key_bitstring, 0 /* padding */) || + !CBB_add_bytes(&key_bitstring, key->pub, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int x25519_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) { + const X25519_KEY *a_key = a->pkey.ptr; + const X25519_KEY *b_key = b->pkey.ptr; + return OPENSSL_memcmp(a_key->pub, b_key->pub, 32) == 0; +} + +static int x25519_priv_decode(EVP_PKEY *out, CBS *params, CBS *key) { + // See RFC 8410, section 7. + + // Parameters must be empty. The key is a 32-byte value wrapped in an extra + // OCTET STRING layer. + CBS inner; + if (CBS_len(params) != 0 || + !CBS_get_asn1(key, &inner, CBS_ASN1_OCTETSTRING) || + CBS_len(key) != 0) { + OPENSSL_PUT_ERROR(EVP, EVP_R_DECODE_ERROR); + return 0; + } + + return x25519_set_priv_raw(out, CBS_data(&inner), CBS_len(&inner)); +} + +static int x25519_priv_encode(CBB *out, const EVP_PKEY *pkey) { + X25519_KEY *key = pkey->pkey.ptr; + if (!key->has_private) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NOT_A_PRIVATE_KEY); + return 0; + } + + // See RFC 8410, section 7. + CBB pkcs8, algorithm, oid, private_key, inner; + if (!CBB_add_asn1(out, &pkcs8, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&pkcs8, 0 /* version */) || + !CBB_add_asn1(&pkcs8, &algorithm, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&algorithm, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, x25519_asn1_meth.oid, x25519_asn1_meth.oid_len) || + !CBB_add_asn1(&pkcs8, &private_key, CBS_ASN1_OCTETSTRING) || + !CBB_add_asn1(&private_key, &inner, CBS_ASN1_OCTETSTRING) || + // The PKCS#8 encoding stores only the 32-byte seed which is the first 32 + // bytes of the private key. + !CBB_add_bytes(&inner, key->priv, 32) || + !CBB_flush(out)) { + OPENSSL_PUT_ERROR(EVP, EVP_R_ENCODE_ERROR); + return 0; + } + + return 1; +} + +static int x25519_size(const EVP_PKEY *pkey) { return 32; } + +static int x25519_bits(const EVP_PKEY *pkey) { return 253; } + +const EVP_PKEY_ASN1_METHOD x25519_asn1_meth = { + EVP_PKEY_X25519, + {0x2b, 0x65, 0x6e}, + 3, + x25519_pub_decode, + x25519_pub_encode, + x25519_pub_cmp, + x25519_priv_decode, + x25519_priv_encode, + x25519_set_priv_raw, + x25519_set_pub_raw, + x25519_get_priv_raw, + x25519_get_pub_raw, + NULL /* pkey_opaque */, + x25519_size, + x25519_bits, + NULL /* param_missing */, + NULL /* param_copy */, + NULL /* param_cmp */, + x25519_free, +}; + +int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, const uint8_t *in, + size_t len) { + // TODO(davidben): In OpenSSL, this function also works for |EVP_PKEY_EC| + // keys. Add support if it ever comes up. + if (pkey->type != EVP_PKEY_X25519) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + return 0; + } + + return x25519_set_pub_raw(pkey, in, len); +} + +size_t EVP_PKEY_get1_tls_encodedpoint(const EVP_PKEY *pkey, uint8_t **out_ptr) { + // TODO(davidben): In OpenSSL, this function also works for |EVP_PKEY_EC| + // keys. Add support if it ever comes up. + if (pkey->type != EVP_PKEY_X25519) { + OPENSSL_PUT_ERROR(EVP, EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE); + return 0; + } + + const X25519_KEY *key = pkey->pkey.ptr; + if (key == NULL) { + OPENSSL_PUT_ERROR(EVP, EVP_R_NO_KEY_SET); + return 0; + } + + *out_ptr = OPENSSL_memdup(key->pub, 32); + return *out_ptr == NULL ? 0 : 32; +} diff --git a/Pods/BoringSSL-GRPC/crypto/evp/pbkdf.c b/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/pbkdf.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c diff --git a/Pods/BoringSSL-GRPC/crypto/evp/pbkdf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/pbkdf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/pbkdf.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/evp/print.c b/Pods/BoringSSL-GRPC/src/crypto/evp/print.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/print.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/print.c diff --git a/Pods/BoringSSL-GRPC/crypto/evp/print.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/print.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/print.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/print.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/evp/scrypt.c b/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/evp/scrypt.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c index 7b502003b..82ed1f95f 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/scrypt.c +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c @@ -30,7 +30,7 @@ // A block_t is a Salsa20 block. typedef struct { uint32_t words[16]; } block_t; -OPENSSL_COMPILE_ASSERT(sizeof(block_t) == 64, block_t_has_padding); +OPENSSL_STATIC_ASSERT(sizeof(block_t) == 64, "block_t has padding"); #define R(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) @@ -173,7 +173,7 @@ int EVP_PBE_scrypt(const char *password, size_t password_len, // Allocate and divide up the scratch space. |max_mem| fits in a size_t, which // is no bigger than uint64_t, so none of these operations may overflow. - OPENSSL_COMPILE_ASSERT(UINT64_MAX >= ((size_t)-1), size_t_exceeds_u64); + OPENSSL_STATIC_ASSERT(UINT64_MAX >= ((size_t)-1), "size_t exceeds uint64_t"); size_t B_blocks = p * 2 * r; size_t B_bytes = B_blocks * sizeof(block_t); size_t T_blocks = 2 * r; @@ -187,6 +187,10 @@ int EVP_PBE_scrypt(const char *password, size_t password_len, int ret = 0; block_t *T = B + B_blocks; block_t *V = T + T_blocks; + + // NOTE: PKCS5_PBKDF2_HMAC can only fail due to allocation failure + // or |iterations| of 0 (we pass 1 here). This is consistent with + // the documented failure conditions of EVP_PBE_scrypt. if (!PKCS5_PBKDF2_HMAC(password, password_len, salt, salt_len, 1, EVP_sha256(), B_bytes, (uint8_t *)B)) { goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/evp/scrypt.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c.grpc_back similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/evp/scrypt.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c.grpc_back index ed186eed6..2feb6504f 100644 --- a/Pods/BoringSSL-GRPC/crypto/evp/scrypt.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/evp/scrypt.c.grpc_back @@ -30,7 +30,7 @@ // A block_t is a Salsa20 block. typedef struct { uint32_t words[16]; } block_t; -OPENSSL_COMPILE_ASSERT(sizeof(block_t) == 64, block_t_has_padding); +OPENSSL_STATIC_ASSERT(sizeof(block_t) == 64, "block_t has padding"); #define R(a, b) (((a) << (b)) | ((a) >> (32 - (b)))) @@ -173,7 +173,7 @@ int EVP_PBE_scrypt(const char *password, size_t password_len, // Allocate and divide up the scratch space. |max_mem| fits in a size_t, which // is no bigger than uint64_t, so none of these operations may overflow. - OPENSSL_COMPILE_ASSERT(UINT64_MAX >= ((size_t)-1), size_t_exceeds_u64); + OPENSSL_STATIC_ASSERT(UINT64_MAX >= ((size_t)-1), "size_t exceeds uint64_t"); size_t B_blocks = p * 2 * r; size_t B_bytes = B_blocks * sizeof(block_t); size_t T_blocks = 2 * r; @@ -187,6 +187,10 @@ int EVP_PBE_scrypt(const char *password, size_t password_len, int ret = 0; block_t *T = B + B_blocks; block_t *V = T + T_blocks; + + // NOTE: PKCS5_PBKDF2_HMAC can only fail due to allocation failure + // or |iterations| of 0 (we pass 1 here). This is consistent with + // the documented failure conditions of EVP_PBE_scrypt. if (!PKCS5_PBKDF2_HMAC(password, password_len, salt, salt_len, 1, EVP_sha256(), B_bytes, (uint8_t *)B)) { goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/evp/sign.c b/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/sign.c rename to Pods/BoringSSL-GRPC/src/crypto/evp/sign.c diff --git a/Pods/BoringSSL-GRPC/crypto/evp/sign.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/evp/sign.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/evp/sign.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/evp/sign.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/ex_data.c b/Pods/BoringSSL-GRPC/src/crypto/ex_data.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/ex_data.c rename to Pods/BoringSSL-GRPC/src/crypto/ex_data.c diff --git a/Pods/BoringSSL-GRPC/crypto/ex_data.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/ex_data.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/ex_data.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/ex_data.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c new file mode 100644 index 000000000..ef61b9469 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c @@ -0,0 +1,108 @@ +/* ==================================================================== + * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include + +#include + +#include "internal.h" +#include "../modes/internal.h" + + +// Be aware that different sets of AES functions use incompatible key +// representations, varying in format of the key schedule, the |AES_KEY.rounds| +// value, or both. Therefore they cannot mix. Also, on AArch64, the plain-C +// code, above, is incompatible with the |aes_hw_*| functions. + +void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + if (hwaes_capable()) { + aes_hw_encrypt(in, out, key); + } else if (vpaes_capable()) { + vpaes_encrypt(in, out, key); + } else { + aes_nohw_encrypt(in, out, key); + } +} + +void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + if (hwaes_capable()) { + aes_hw_decrypt(in, out, key); + } else if (vpaes_capable()) { + vpaes_decrypt(in, out, key); + } else { + aes_nohw_decrypt(in, out, key); + } +} + +int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { + if (bits != 128 && bits != 192 && bits != 256) { + return -2; + } + if (hwaes_capable()) { + return aes_hw_set_encrypt_key(key, bits, aeskey); + } else if (vpaes_capable()) { + return vpaes_set_encrypt_key(key, bits, aeskey); + } else { + return aes_nohw_set_encrypt_key(key, bits, aeskey); + } +} + +int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { + if (bits != 128 && bits != 192 && bits != 256) { + return -2; + } + if (hwaes_capable()) { + return aes_hw_set_decrypt_key(key, bits, aeskey); + } else if (vpaes_capable()) { + return vpaes_set_decrypt_key(key, bits, aeskey); + } else { + return aes_nohw_set_decrypt_key(key, bits, aeskey); + } +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c.grpc_back new file mode 100644 index 000000000..f60281dfa --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes.c.grpc_back @@ -0,0 +1,108 @@ +/* ==================================================================== + * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include + +#include + +#include "internal.h" +#include "../modes/internal.h" + + +// Be aware that different sets of AES functions use incompatible key +// representations, varying in format of the key schedule, the |AES_KEY.rounds| +// value, or both. Therefore they cannot mix. Also, on AArch64, the plain-C +// code, above, is incompatible with the |aes_hw_*| functions. + +void AES_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + if (hwaes_capable()) { + aes_hw_encrypt(in, out, key); + } else if (vpaes_capable()) { + vpaes_encrypt(in, out, key); + } else { + aes_nohw_encrypt(in, out, key); + } +} + +void AES_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + if (hwaes_capable()) { + aes_hw_decrypt(in, out, key); + } else if (vpaes_capable()) { + vpaes_decrypt(in, out, key); + } else { + aes_nohw_decrypt(in, out, key); + } +} + +int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { + if (bits != 128 && bits != 192 && bits != 256) { + return -2; + } + if (hwaes_capable()) { + return aes_hw_set_encrypt_key(key, bits, aeskey); + } else if (vpaes_capable()) { + return vpaes_set_encrypt_key(key, bits, aeskey); + } else { + return aes_nohw_set_encrypt_key(key, bits, aeskey); + } +} + +int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey) { + if (bits != 128 && bits != 192 && bits != 256) { + return -2; + } + if (hwaes_capable()) { + return aes_hw_set_decrypt_key(key, bits, aeskey); + } else if (vpaes_capable()) { + return vpaes_set_decrypt_key(key, bits, aeskey); + } else { + return aes_nohw_set_decrypt_key(key, bits, aeskey); + } +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c new file mode 100644 index 000000000..18ffdc9ea --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c @@ -0,0 +1,1282 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include "../../internal.h" + +#if defined(OPENSSL_SSE2) +#include +#endif + + +// This file contains a constant-time implementation of AES, bitsliced with +// 32-bit, 64-bit, or 128-bit words, operating on two-, four-, and eight-block +// batches, respectively. The 128-bit implementation requires SSE2 intrinsics. +// +// This implementation is based on the algorithms described in the following +// references: +// - https://bearssl.org/constanttime.html#aes +// - https://eprint.iacr.org/2009/129.pdf +// - https://eprint.iacr.org/2009/191.pdf + + +// Word operations. +// +// An aes_word_t is the word used for this AES implementation. Throughout this +// file, bits and bytes are ordered little-endian, though "left" and "right" +// shifts match the operations themselves, which makes them reversed in a +// little-endian, left-to-right reading. +// +// Eight |aes_word_t|s contain |AES_NOHW_BATCH_SIZE| blocks. The bits in an +// |aes_word_t| are divided into 16 consecutive groups of |AES_NOHW_BATCH_SIZE| +// bits each, each corresponding to a byte in an AES block in column-major +// order (AES's byte order). We refer to these as "logical bytes". Note, in the +// 32-bit and 64-bit implementations, they are smaller than a byte. (The +// contents of a logical byte will be described later.) +// +// MSVC does not support C bit operators on |__m128i|, so the wrapper functions +// |aes_nohw_and|, etc., should be used instead. Note |aes_nohw_shift_left| and +// |aes_nohw_shift_right| measure the shift in logical bytes. That is, the shift +// value ranges from 0 to 15 independent of |aes_word_t| and +// |AES_NOHW_BATCH_SIZE|. +// +// This ordering is different from https://eprint.iacr.org/2009/129.pdf, which +// uses row-major order. Matching the AES order was easier to reason about, and +// we do not have PSHUFB available to arbitrarily permute bytes. + +#if defined(OPENSSL_SSE2) +typedef __m128i aes_word_t; +// AES_NOHW_WORD_SIZE is sizeof(aes_word_t). alignas(sizeof(T)) does not work in +// MSVC, so we define a constant. +#define AES_NOHW_WORD_SIZE 16 +#define AES_NOHW_BATCH_SIZE 8 +#define AES_NOHW_ROW0_MASK \ + _mm_set_epi32(0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff) +#define AES_NOHW_ROW1_MASK \ + _mm_set_epi32(0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00) +#define AES_NOHW_ROW2_MASK \ + _mm_set_epi32(0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000) +#define AES_NOHW_ROW3_MASK \ + _mm_set_epi32(0xff000000, 0xff000000, 0xff000000, 0xff000000) +#define AES_NOHW_COL01_MASK \ + _mm_set_epi32(0x00000000, 0x00000000, 0xffffffff, 0xffffffff) +#define AES_NOHW_COL2_MASK \ + _mm_set_epi32(0x00000000, 0xffffffff, 0x00000000, 0x00000000) +#define AES_NOHW_COL3_MASK \ + _mm_set_epi32(0xffffffff, 0x00000000, 0x00000000, 0x00000000) + +static inline aes_word_t aes_nohw_and(aes_word_t a, aes_word_t b) { + return _mm_and_si128(a, b); +} + +static inline aes_word_t aes_nohw_or(aes_word_t a, aes_word_t b) { + return _mm_or_si128(a, b); +} + +static inline aes_word_t aes_nohw_xor(aes_word_t a, aes_word_t b) { + return _mm_xor_si128(a, b); +} + +static inline aes_word_t aes_nohw_not(aes_word_t a) { + return _mm_xor_si128( + a, _mm_set_epi32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff)); +} + +// These are macros because parameters to |_mm_slli_si128| and |_mm_srli_si128| +// must be constants. +#define aes_nohw_shift_left(/* aes_word_t */ a, /* const */ i) \ + _mm_slli_si128((a), (i)) +#define aes_nohw_shift_right(/* aes_word_t */ a, /* const */ i) \ + _mm_srli_si128((a), (i)) +#else // !OPENSSL_SSE2 +#if defined(OPENSSL_64_BIT) +typedef uint64_t aes_word_t; +#define AES_NOHW_WORD_SIZE 8 +#define AES_NOHW_BATCH_SIZE 4 +#define AES_NOHW_ROW0_MASK UINT64_C(0x000f000f000f000f) +#define AES_NOHW_ROW1_MASK UINT64_C(0x00f000f000f000f0) +#define AES_NOHW_ROW2_MASK UINT64_C(0x0f000f000f000f00) +#define AES_NOHW_ROW3_MASK UINT64_C(0xf000f000f000f000) +#define AES_NOHW_COL01_MASK UINT64_C(0x00000000ffffffff) +#define AES_NOHW_COL2_MASK UINT64_C(0x0000ffff00000000) +#define AES_NOHW_COL3_MASK UINT64_C(0xffff000000000000) +#else // !OPENSSL_64_BIT +typedef uint32_t aes_word_t; +#define AES_NOHW_WORD_SIZE 4 +#define AES_NOHW_BATCH_SIZE 2 +#define AES_NOHW_ROW0_MASK 0x03030303 +#define AES_NOHW_ROW1_MASK 0x0c0c0c0c +#define AES_NOHW_ROW2_MASK 0x30303030 +#define AES_NOHW_ROW3_MASK 0xc0c0c0c0 +#define AES_NOHW_COL01_MASK 0x0000ffff +#define AES_NOHW_COL2_MASK 0x00ff0000 +#define AES_NOHW_COL3_MASK 0xff000000 +#endif // OPENSSL_64_BIT + +static inline aes_word_t aes_nohw_and(aes_word_t a, aes_word_t b) { + return a & b; +} + +static inline aes_word_t aes_nohw_or(aes_word_t a, aes_word_t b) { + return a | b; +} + +static inline aes_word_t aes_nohw_xor(aes_word_t a, aes_word_t b) { + return a ^ b; +} + +static inline aes_word_t aes_nohw_not(aes_word_t a) { return ~a; } + +static inline aes_word_t aes_nohw_shift_left(aes_word_t a, aes_word_t i) { + return a << (i * AES_NOHW_BATCH_SIZE); +} + +static inline aes_word_t aes_nohw_shift_right(aes_word_t a, aes_word_t i) { + return a >> (i * AES_NOHW_BATCH_SIZE); +} +#endif // OPENSSL_SSE2 + +OPENSSL_STATIC_ASSERT(AES_NOHW_BATCH_SIZE * 128 == 8 * 8 * sizeof(aes_word_t), + "batch size does not match word size"); +OPENSSL_STATIC_ASSERT(AES_NOHW_WORD_SIZE == sizeof(aes_word_t), + "AES_NOHW_WORD_SIZE is incorrect"); + + +// Block representations. +// +// This implementation uses three representations for AES blocks. First, the +// public API represents blocks as uint8_t[16] in the usual way. Second, most +// AES steps are evaluated in bitsliced form, stored in an |AES_NOHW_BATCH|. +// This stores |AES_NOHW_BATCH_SIZE| blocks in bitsliced order. For 64-bit words +// containing bitsliced blocks a, b, c, d, this would be as follows (vertical +// bars divide logical bytes): +// +// batch.w[0] = a0 b0 c0 d0 | a8 b8 c8 d8 | a16 b16 c16 d16 ... +// batch.w[1] = a1 b1 c1 d1 | a9 b9 c9 d9 | a17 b17 c17 d17 ... +// batch.w[2] = a2 b2 c2 d2 | a10 b10 c10 d10 | a18 b18 c18 d18 ... +// batch.w[3] = a3 b3 c3 d3 | a11 b11 c11 d11 | a19 b19 c19 d19 ... +// ... +// +// Finally, an individual block may be stored as an intermediate form in an +// aes_word_t[AES_NOHW_BLOCK_WORDS]. In this form, we permute the bits in each +// block, so that block[0]'s ith logical byte contains least-significant +// |AES_NOHW_BATCH_SIZE| bits of byte i, block[1] contains the next group of +// |AES_NOHW_BATCH_SIZE| bits, and so on. We refer to this transformation as +// "compacting" the block. Note this is no-op with 128-bit words because then +// |AES_NOHW_BLOCK_WORDS| is one and |AES_NOHW_BATCH_SIZE| is eight. For 64-bit +// words, one block would be stored in two words: +// +// block[0] = a0 a1 a2 a3 | a8 a9 a10 a11 | a16 a17 a18 a19 ... +// block[1] = a4 a5 a6 a7 | a12 a13 a14 a15 | a20 a21 a22 a23 ... +// +// Observe that the distances between corresponding bits in bitsliced and +// compact bit orders match. If we line up corresponding words of each block, +// the bitsliced and compact representations may be converted by tranposing bits +// in corresponding logical bytes. Continuing the 64-bit example: +// +// block_a[0] = a0 a1 a2 a3 | a8 a9 a10 a11 | a16 a17 a18 a19 ... +// block_b[0] = b0 b1 b2 b3 | b8 b9 b10 b11 | b16 b17 b18 b19 ... +// block_c[0] = c0 c1 c2 c3 | c8 c9 c10 c11 | c16 c17 c18 c19 ... +// block_d[0] = d0 d1 d2 d3 | d8 d9 d10 d11 | d16 d17 d18 d19 ... +// +// batch.w[0] = a0 b0 c0 d0 | a8 b8 c8 d8 | a16 b16 c16 d16 ... +// batch.w[1] = a1 b1 c1 d1 | a9 b9 c9 d9 | a17 b17 c17 d17 ... +// batch.w[2] = a2 b2 c2 d2 | a10 b10 c10 d10 | a18 b18 c18 d18 ... +// batch.w[3] = a3 b3 c3 d3 | a11 b11 c11 d11 | a19 b19 c19 d19 ... +// +// Note also that bitwise operations and (logical) byte permutations on an +// |aes_word_t| work equally for the bitsliced and compact words. +// +// We use the compact form in the |AES_KEY| representation to save work +// inflating round keys into |AES_NOHW_BATCH|. The compact form also exists +// temporarily while moving blocks in or out of an |AES_NOHW_BATCH|, immediately +// before or after |aes_nohw_transpose|. + +#define AES_NOHW_BLOCK_WORDS (16 / sizeof(aes_word_t)) + +// An AES_NOHW_BATCH stores |AES_NOHW_BATCH_SIZE| blocks. Unless otherwise +// specified, it is in bitsliced form. +typedef struct { + aes_word_t w[8]; +} AES_NOHW_BATCH; + +// An AES_NOHW_SCHEDULE is an expanded bitsliced AES key schedule. It is +// suitable for encryption or decryption. It is as large as |AES_NOHW_BATCH| +// |AES_KEY|s so it should not be used as a long-term key representation. +typedef struct { + // keys is an array of batches, one for each round key. Each batch stores + // |AES_NOHW_BATCH_SIZE| copies of the round key in bitsliced form. + AES_NOHW_BATCH keys[AES_MAXNR + 1]; +} AES_NOHW_SCHEDULE; + +// aes_nohw_batch_set sets the |i|th block of |batch| to |in|. |batch| is in +// compact form. +static inline void aes_nohw_batch_set(AES_NOHW_BATCH *batch, + const aes_word_t in[AES_NOHW_BLOCK_WORDS], + size_t i) { + // Note the words are interleaved. The order comes from |aes_nohw_transpose|. + // If |i| is zero and this is the 64-bit implementation, in[0] contains bits + // 0-3 and in[1] contains bits 4-7. We place in[0] at w[0] and in[1] at + // w[4] so that bits 0 and 4 are in the correct position. (In general, bits + // along diagonals of |AES_NOHW_BATCH_SIZE| by |AES_NOHW_BATCH_SIZE| squares + // will be correctly placed.) + assert(i < AES_NOHW_BATCH_SIZE); +#if defined(OPENSSL_SSE2) + batch->w[i] = in[0]; +#elif defined(OPENSSL_64_BIT) + batch->w[i] = in[0]; + batch->w[i + 4] = in[1]; +#else + batch->w[i] = in[0]; + batch->w[i + 2] = in[1]; + batch->w[i + 4] = in[2]; + batch->w[i + 6] = in[3]; +#endif +} + +// aes_nohw_batch_get writes the |i|th block of |batch| to |out|. |batch| is in +// compact form. +static inline void aes_nohw_batch_get(const AES_NOHW_BATCH *batch, + aes_word_t out[AES_NOHW_BLOCK_WORDS], + size_t i) { + assert(i < AES_NOHW_BATCH_SIZE); +#if defined(OPENSSL_SSE2) + out[0] = batch->w[i]; +#elif defined(OPENSSL_64_BIT) + out[0] = batch->w[i]; + out[1] = batch->w[i + 4]; +#else + out[0] = batch->w[i]; + out[1] = batch->w[i + 2]; + out[2] = batch->w[i + 4]; + out[3] = batch->w[i + 6]; +#endif +} + +#if !defined(OPENSSL_SSE2) +// aes_nohw_delta_swap returns |a| with bits |a & mask| and +// |a & (mask << shift)| swapped. |mask| and |mask << shift| may not overlap. +static inline aes_word_t aes_nohw_delta_swap(aes_word_t a, aes_word_t mask, + aes_word_t shift) { + // See + // https://reflectionsonsecurity.wordpress.com/2014/05/11/efficient-bit-permutation-using-delta-swaps/ + aes_word_t b = (a ^ (a >> shift)) & mask; + return a ^ b ^ (b << shift); +} + +// In the 32-bit and 64-bit implementations, a block spans multiple words. +// |aes_nohw_compact_block| must permute bits across different words. First we +// implement |aes_nohw_compact_word| which performs a smaller version of the +// transformation which stays within a single word. +// +// These transformations are generalizations of the output of +// http://programming.sirrida.de/calcperm.php on smaller inputs. +#if defined(OPENSSL_64_BIT) +static inline uint64_t aes_nohw_compact_word(uint64_t a) { + // Numbering the 64/2 = 16 4-bit chunks, least to most significant, we swap + // quartets of those chunks: + // 0 1 2 3 | 4 5 6 7 | 8 9 10 11 | 12 13 14 15 => + // 0 2 1 3 | 4 6 5 7 | 8 10 9 11 | 12 14 13 15 + a = aes_nohw_delta_swap(a, UINT64_C(0x00f000f000f000f0), 4); + // Swap quartets of 8-bit chunks (still numbering by 4-bit chunks): + // 0 2 1 3 | 4 6 5 7 | 8 10 9 11 | 12 14 13 15 => + // 0 2 4 6 | 1 3 5 7 | 8 10 12 14 | 9 11 13 15 + a = aes_nohw_delta_swap(a, UINT64_C(0x0000ff000000ff00), 8); + // Swap quartets of 16-bit chunks (still numbering by 4-bit chunks): + // 0 2 4 6 | 1 3 5 7 | 8 10 12 14 | 9 11 13 15 => + // 0 2 4 6 | 8 10 12 14 | 1 3 5 7 | 9 11 13 15 + a = aes_nohw_delta_swap(a, UINT64_C(0x00000000ffff0000), 16); + return a; +} + +static inline uint64_t aes_nohw_uncompact_word(uint64_t a) { + // Reverse the steps of |aes_nohw_uncompact_word|. + a = aes_nohw_delta_swap(a, UINT64_C(0x00000000ffff0000), 16); + a = aes_nohw_delta_swap(a, UINT64_C(0x0000ff000000ff00), 8); + a = aes_nohw_delta_swap(a, UINT64_C(0x00f000f000f000f0), 4); + return a; +} +#else // !OPENSSL_64_BIT +static inline uint32_t aes_nohw_compact_word(uint32_t a) { + // Numbering the 32/2 = 16 pairs of bits, least to most significant, we swap: + // 0 1 2 3 | 4 5 6 7 | 8 9 10 11 | 12 13 14 15 => + // 0 4 2 6 | 1 5 3 7 | 8 12 10 14 | 9 13 11 15 + // Note: 0x00cc = 0b0000_0000_1100_1100 + // 0x00cc << 6 = 0b0011_0011_0000_0000 + a = aes_nohw_delta_swap(a, 0x00cc00cc, 6); + // Now we swap groups of four bits (still numbering by pairs): + // 0 4 2 6 | 1 5 3 7 | 8 12 10 14 | 9 13 11 15 => + // 0 4 8 12 | 1 5 9 13 | 2 6 10 14 | 3 7 11 15 + // Note: 0x0000_f0f0 << 12 = 0x0f0f_0000 + a = aes_nohw_delta_swap(a, 0x0000f0f0, 12); + return a; +} + +static inline uint32_t aes_nohw_uncompact_word(uint32_t a) { + // Reverse the steps of |aes_nohw_uncompact_word|. + a = aes_nohw_delta_swap(a, 0x0000f0f0, 12); + a = aes_nohw_delta_swap(a, 0x00cc00cc, 6); + return a; +} + +static inline uint32_t aes_nohw_word_from_bytes(uint8_t a0, uint8_t a1, + uint8_t a2, uint8_t a3) { + return (uint32_t)a0 | ((uint32_t)a1 << 8) | ((uint32_t)a2 << 16) | + ((uint32_t)a3 << 24); +} +#endif // OPENSSL_64_BIT +#endif // !OPENSSL_SSE2 + +static inline void aes_nohw_compact_block(aes_word_t out[AES_NOHW_BLOCK_WORDS], + const uint8_t in[16]) { + memcpy(out, in, 16); +#if defined(OPENSSL_SSE2) + // No conversions needed. +#elif defined(OPENSSL_64_BIT) + uint64_t a0 = aes_nohw_compact_word(out[0]); + uint64_t a1 = aes_nohw_compact_word(out[1]); + out[0] = (a0 & UINT64_C(0x00000000ffffffff)) | (a1 << 32); + out[1] = (a1 & UINT64_C(0xffffffff00000000)) | (a0 >> 32); +#else + uint32_t a0 = aes_nohw_compact_word(out[0]); + uint32_t a1 = aes_nohw_compact_word(out[1]); + uint32_t a2 = aes_nohw_compact_word(out[2]); + uint32_t a3 = aes_nohw_compact_word(out[3]); + // Note clang, when building for ARM Thumb2, will sometimes miscompile + // expressions such as (a0 & 0x0000ff00) << 8, particularly when building + // without optimizations. This bug was introduced in + // https://reviews.llvm.org/rL340261 and fixed in + // https://reviews.llvm.org/rL351310. The following is written to avoid this. + out[0] = aes_nohw_word_from_bytes(a0, a1, a2, a3); + out[1] = aes_nohw_word_from_bytes(a0 >> 8, a1 >> 8, a2 >> 8, a3 >> 8); + out[2] = aes_nohw_word_from_bytes(a0 >> 16, a1 >> 16, a2 >> 16, a3 >> 16); + out[3] = aes_nohw_word_from_bytes(a0 >> 24, a1 >> 24, a2 >> 24, a3 >> 24); +#endif +} + +static inline void aes_nohw_uncompact_block( + uint8_t out[16], const aes_word_t in[AES_NOHW_BLOCK_WORDS]) { +#if defined(OPENSSL_SSE2) + memcpy(out, in, 16); // No conversions needed. +#elif defined(OPENSSL_64_BIT) + uint64_t a0 = in[0]; + uint64_t a1 = in[1]; + uint64_t b0 = + aes_nohw_uncompact_word((a0 & UINT64_C(0x00000000ffffffff)) | (a1 << 32)); + uint64_t b1 = + aes_nohw_uncompact_word((a1 & UINT64_C(0xffffffff00000000)) | (a0 >> 32)); + memcpy(out, &b0, 8); + memcpy(out + 8, &b1, 8); +#else + uint32_t a0 = in[0]; + uint32_t a1 = in[1]; + uint32_t a2 = in[2]; + uint32_t a3 = in[3]; + // Note clang, when building for ARM Thumb2, will sometimes miscompile + // expressions such as (a0 & 0x0000ff00) << 8, particularly when building + // without optimizations. This bug was introduced in + // https://reviews.llvm.org/rL340261 and fixed in + // https://reviews.llvm.org/rL351310. The following is written to avoid this. + uint32_t b0 = aes_nohw_word_from_bytes(a0, a1, a2, a3); + uint32_t b1 = aes_nohw_word_from_bytes(a0 >> 8, a1 >> 8, a2 >> 8, a3 >> 8); + uint32_t b2 = + aes_nohw_word_from_bytes(a0 >> 16, a1 >> 16, a2 >> 16, a3 >> 16); + uint32_t b3 = + aes_nohw_word_from_bytes(a0 >> 24, a1 >> 24, a2 >> 24, a3 >> 24); + b0 = aes_nohw_uncompact_word(b0); + b1 = aes_nohw_uncompact_word(b1); + b2 = aes_nohw_uncompact_word(b2); + b3 = aes_nohw_uncompact_word(b3); + memcpy(out, &b0, 4); + memcpy(out + 4, &b1, 4); + memcpy(out + 8, &b2, 4); + memcpy(out + 12, &b3, 4); +#endif +} + +// aes_nohw_swap_bits is a variation on a delta swap. It swaps the bits in +// |*a & (mask << shift)| with the bits in |*b & mask|. |mask| and +// |mask << shift| must not overlap. |mask| is specified as a |uint32_t|, but it +// is repeated to the full width of |aes_word_t|. +#if defined(OPENSSL_SSE2) +// This must be a macro because |_mm_srli_epi32| and |_mm_slli_epi32| require +// constant shift values. +#define aes_nohw_swap_bits(/*__m128i* */ a, /*__m128i* */ b, \ + /* uint32_t */ mask, /* const */ shift) \ + do { \ + __m128i swap = \ + _mm_and_si128(_mm_xor_si128(_mm_srli_epi32(*(a), (shift)), *(b)), \ + _mm_set_epi32((mask), (mask), (mask), (mask))); \ + *(a) = _mm_xor_si128(*(a), _mm_slli_epi32(swap, (shift))); \ + *(b) = _mm_xor_si128(*(b), swap); \ + \ + } while (0) +#else +static inline void aes_nohw_swap_bits(aes_word_t *a, aes_word_t *b, + uint32_t mask, aes_word_t shift) { +#if defined(OPENSSL_64_BIT) + aes_word_t mask_w = (((uint64_t)mask) << 32) | mask; +#else + aes_word_t mask_w = mask; +#endif + // This is a variation on a delta swap. + aes_word_t swap = ((*a >> shift) ^ *b) & mask_w; + *a ^= swap << shift; + *b ^= swap; +} +#endif // OPENSSL_SSE2 + +// aes_nohw_transpose converts |batch| to and from bitsliced form. It divides +// the 8 × word_size bits into AES_NOHW_BATCH_SIZE × AES_NOHW_BATCH_SIZE squares +// and transposes each square. +static void aes_nohw_transpose(AES_NOHW_BATCH *batch) { + // Swap bits with index 0 and 1 mod 2 (0x55 = 0b01010101). + aes_nohw_swap_bits(&batch->w[0], &batch->w[1], 0x55555555, 1); + aes_nohw_swap_bits(&batch->w[2], &batch->w[3], 0x55555555, 1); + aes_nohw_swap_bits(&batch->w[4], &batch->w[5], 0x55555555, 1); + aes_nohw_swap_bits(&batch->w[6], &batch->w[7], 0x55555555, 1); + +#if AES_NOHW_BATCH_SIZE >= 4 + // Swap bits with index 0-1 and 2-3 mod 4 (0x33 = 0b00110011). + aes_nohw_swap_bits(&batch->w[0], &batch->w[2], 0x33333333, 2); + aes_nohw_swap_bits(&batch->w[1], &batch->w[3], 0x33333333, 2); + aes_nohw_swap_bits(&batch->w[4], &batch->w[6], 0x33333333, 2); + aes_nohw_swap_bits(&batch->w[5], &batch->w[7], 0x33333333, 2); +#endif + +#if AES_NOHW_BATCH_SIZE >= 8 + // Swap bits with index 0-3 and 4-7 mod 8 (0x0f = 0b00001111). + aes_nohw_swap_bits(&batch->w[0], &batch->w[4], 0x0f0f0f0f, 4); + aes_nohw_swap_bits(&batch->w[1], &batch->w[5], 0x0f0f0f0f, 4); + aes_nohw_swap_bits(&batch->w[2], &batch->w[6], 0x0f0f0f0f, 4); + aes_nohw_swap_bits(&batch->w[3], &batch->w[7], 0x0f0f0f0f, 4); +#endif +} + +// aes_nohw_to_batch initializes |out| with the |num_blocks| blocks from |in|. +// |num_blocks| must be at most |AES_NOHW_BATCH|. +static void aes_nohw_to_batch(AES_NOHW_BATCH *out, const uint8_t *in, + size_t num_blocks) { + // Don't leave unused blocks unitialized. + memset(out, 0, sizeof(AES_NOHW_BATCH)); + assert(num_blocks <= AES_NOHW_BATCH_SIZE); + for (size_t i = 0; i < num_blocks; i++) { + aes_word_t block[AES_NOHW_BLOCK_WORDS]; + aes_nohw_compact_block(block, in + 16 * i); + aes_nohw_batch_set(out, block, i); + } + + aes_nohw_transpose(out); +} + +// aes_nohw_to_batch writes the first |num_blocks| blocks in |batch| to |out|. +// |num_blocks| must be at most |AES_NOHW_BATCH|. +static void aes_nohw_from_batch(uint8_t *out, size_t num_blocks, + const AES_NOHW_BATCH *batch) { + AES_NOHW_BATCH copy = *batch; + aes_nohw_transpose(©); + + assert(num_blocks <= AES_NOHW_BATCH_SIZE); + for (size_t i = 0; i < num_blocks; i++) { + aes_word_t block[AES_NOHW_BLOCK_WORDS]; + aes_nohw_batch_get(©, block, i); + aes_nohw_uncompact_block(out + 16 * i, block); + } +} + + +// AES round steps. + +static void aes_nohw_add_round_key(AES_NOHW_BATCH *batch, + const AES_NOHW_BATCH *key) { + for (size_t i = 0; i < 8; i++) { + batch->w[i] = aes_nohw_xor(batch->w[i], key->w[i]); + } +} + +static void aes_nohw_sub_bytes(AES_NOHW_BATCH *batch) { + // See https://eprint.iacr.org/2009/191.pdf, Appendix C. + aes_word_t x0 = batch->w[7]; + aes_word_t x1 = batch->w[6]; + aes_word_t x2 = batch->w[5]; + aes_word_t x3 = batch->w[4]; + aes_word_t x4 = batch->w[3]; + aes_word_t x5 = batch->w[2]; + aes_word_t x6 = batch->w[1]; + aes_word_t x7 = batch->w[0]; + + // Figure 2, the top linear transformation. + aes_word_t y14 = aes_nohw_xor(x3, x5); + aes_word_t y13 = aes_nohw_xor(x0, x6); + aes_word_t y9 = aes_nohw_xor(x0, x3); + aes_word_t y8 = aes_nohw_xor(x0, x5); + aes_word_t t0 = aes_nohw_xor(x1, x2); + aes_word_t y1 = aes_nohw_xor(t0, x7); + aes_word_t y4 = aes_nohw_xor(y1, x3); + aes_word_t y12 = aes_nohw_xor(y13, y14); + aes_word_t y2 = aes_nohw_xor(y1, x0); + aes_word_t y5 = aes_nohw_xor(y1, x6); + aes_word_t y3 = aes_nohw_xor(y5, y8); + aes_word_t t1 = aes_nohw_xor(x4, y12); + aes_word_t y15 = aes_nohw_xor(t1, x5); + aes_word_t y20 = aes_nohw_xor(t1, x1); + aes_word_t y6 = aes_nohw_xor(y15, x7); + aes_word_t y10 = aes_nohw_xor(y15, t0); + aes_word_t y11 = aes_nohw_xor(y20, y9); + aes_word_t y7 = aes_nohw_xor(x7, y11); + aes_word_t y17 = aes_nohw_xor(y10, y11); + aes_word_t y19 = aes_nohw_xor(y10, y8); + aes_word_t y16 = aes_nohw_xor(t0, y11); + aes_word_t y21 = aes_nohw_xor(y13, y16); + aes_word_t y18 = aes_nohw_xor(x0, y16); + + // Figure 3, the middle non-linear section. + aes_word_t t2 = aes_nohw_and(y12, y15); + aes_word_t t3 = aes_nohw_and(y3, y6); + aes_word_t t4 = aes_nohw_xor(t3, t2); + aes_word_t t5 = aes_nohw_and(y4, x7); + aes_word_t t6 = aes_nohw_xor(t5, t2); + aes_word_t t7 = aes_nohw_and(y13, y16); + aes_word_t t8 = aes_nohw_and(y5, y1); + aes_word_t t9 = aes_nohw_xor(t8, t7); + aes_word_t t10 = aes_nohw_and(y2, y7); + aes_word_t t11 = aes_nohw_xor(t10, t7); + aes_word_t t12 = aes_nohw_and(y9, y11); + aes_word_t t13 = aes_nohw_and(y14, y17); + aes_word_t t14 = aes_nohw_xor(t13, t12); + aes_word_t t15 = aes_nohw_and(y8, y10); + aes_word_t t16 = aes_nohw_xor(t15, t12); + aes_word_t t17 = aes_nohw_xor(t4, t14); + aes_word_t t18 = aes_nohw_xor(t6, t16); + aes_word_t t19 = aes_nohw_xor(t9, t14); + aes_word_t t20 = aes_nohw_xor(t11, t16); + aes_word_t t21 = aes_nohw_xor(t17, y20); + aes_word_t t22 = aes_nohw_xor(t18, y19); + aes_word_t t23 = aes_nohw_xor(t19, y21); + aes_word_t t24 = aes_nohw_xor(t20, y18); + aes_word_t t25 = aes_nohw_xor(t21, t22); + aes_word_t t26 = aes_nohw_and(t21, t23); + aes_word_t t27 = aes_nohw_xor(t24, t26); + aes_word_t t28 = aes_nohw_and(t25, t27); + aes_word_t t29 = aes_nohw_xor(t28, t22); + aes_word_t t30 = aes_nohw_xor(t23, t24); + aes_word_t t31 = aes_nohw_xor(t22, t26); + aes_word_t t32 = aes_nohw_and(t31, t30); + aes_word_t t33 = aes_nohw_xor(t32, t24); + aes_word_t t34 = aes_nohw_xor(t23, t33); + aes_word_t t35 = aes_nohw_xor(t27, t33); + aes_word_t t36 = aes_nohw_and(t24, t35); + aes_word_t t37 = aes_nohw_xor(t36, t34); + aes_word_t t38 = aes_nohw_xor(t27, t36); + aes_word_t t39 = aes_nohw_and(t29, t38); + aes_word_t t40 = aes_nohw_xor(t25, t39); + aes_word_t t41 = aes_nohw_xor(t40, t37); + aes_word_t t42 = aes_nohw_xor(t29, t33); + aes_word_t t43 = aes_nohw_xor(t29, t40); + aes_word_t t44 = aes_nohw_xor(t33, t37); + aes_word_t t45 = aes_nohw_xor(t42, t41); + aes_word_t z0 = aes_nohw_and(t44, y15); + aes_word_t z1 = aes_nohw_and(t37, y6); + aes_word_t z2 = aes_nohw_and(t33, x7); + aes_word_t z3 = aes_nohw_and(t43, y16); + aes_word_t z4 = aes_nohw_and(t40, y1); + aes_word_t z5 = aes_nohw_and(t29, y7); + aes_word_t z6 = aes_nohw_and(t42, y11); + aes_word_t z7 = aes_nohw_and(t45, y17); + aes_word_t z8 = aes_nohw_and(t41, y10); + aes_word_t z9 = aes_nohw_and(t44, y12); + aes_word_t z10 = aes_nohw_and(t37, y3); + aes_word_t z11 = aes_nohw_and(t33, y4); + aes_word_t z12 = aes_nohw_and(t43, y13); + aes_word_t z13 = aes_nohw_and(t40, y5); + aes_word_t z14 = aes_nohw_and(t29, y2); + aes_word_t z15 = aes_nohw_and(t42, y9); + aes_word_t z16 = aes_nohw_and(t45, y14); + aes_word_t z17 = aes_nohw_and(t41, y8); + + // Figure 4, bottom linear transformation. + aes_word_t t46 = aes_nohw_xor(z15, z16); + aes_word_t t47 = aes_nohw_xor(z10, z11); + aes_word_t t48 = aes_nohw_xor(z5, z13); + aes_word_t t49 = aes_nohw_xor(z9, z10); + aes_word_t t50 = aes_nohw_xor(z2, z12); + aes_word_t t51 = aes_nohw_xor(z2, z5); + aes_word_t t52 = aes_nohw_xor(z7, z8); + aes_word_t t53 = aes_nohw_xor(z0, z3); + aes_word_t t54 = aes_nohw_xor(z6, z7); + aes_word_t t55 = aes_nohw_xor(z16, z17); + aes_word_t t56 = aes_nohw_xor(z12, t48); + aes_word_t t57 = aes_nohw_xor(t50, t53); + aes_word_t t58 = aes_nohw_xor(z4, t46); + aes_word_t t59 = aes_nohw_xor(z3, t54); + aes_word_t t60 = aes_nohw_xor(t46, t57); + aes_word_t t61 = aes_nohw_xor(z14, t57); + aes_word_t t62 = aes_nohw_xor(t52, t58); + aes_word_t t63 = aes_nohw_xor(t49, t58); + aes_word_t t64 = aes_nohw_xor(z4, t59); + aes_word_t t65 = aes_nohw_xor(t61, t62); + aes_word_t t66 = aes_nohw_xor(z1, t63); + aes_word_t s0 = aes_nohw_xor(t59, t63); + aes_word_t s6 = aes_nohw_xor(t56, aes_nohw_not(t62)); + aes_word_t s7 = aes_nohw_xor(t48, aes_nohw_not(t60)); + aes_word_t t67 = aes_nohw_xor(t64, t65); + aes_word_t s3 = aes_nohw_xor(t53, t66); + aes_word_t s4 = aes_nohw_xor(t51, t66); + aes_word_t s5 = aes_nohw_xor(t47, t65); + aes_word_t s1 = aes_nohw_xor(t64, aes_nohw_not(s3)); + aes_word_t s2 = aes_nohw_xor(t55, aes_nohw_not(t67)); + + batch->w[0] = s7; + batch->w[1] = s6; + batch->w[2] = s5; + batch->w[3] = s4; + batch->w[4] = s3; + batch->w[5] = s2; + batch->w[6] = s1; + batch->w[7] = s0; +} + +// aes_nohw_sub_bytes_inv_affine inverts the affine transform portion of the AES +// S-box, defined in FIPS PUB 197, section 5.1.1, step 2. +static void aes_nohw_sub_bytes_inv_affine(AES_NOHW_BATCH *batch) { + aes_word_t a0 = batch->w[0]; + aes_word_t a1 = batch->w[1]; + aes_word_t a2 = batch->w[2]; + aes_word_t a3 = batch->w[3]; + aes_word_t a4 = batch->w[4]; + aes_word_t a5 = batch->w[5]; + aes_word_t a6 = batch->w[6]; + aes_word_t a7 = batch->w[7]; + + // Apply the circulant [0 0 1 0 0 1 0 1]. This is the inverse of the circulant + // [1 0 0 0 1 1 1 1]. + aes_word_t b0 = aes_nohw_xor(a2, aes_nohw_xor(a5, a7)); + aes_word_t b1 = aes_nohw_xor(a3, aes_nohw_xor(a6, a0)); + aes_word_t b2 = aes_nohw_xor(a4, aes_nohw_xor(a7, a1)); + aes_word_t b3 = aes_nohw_xor(a5, aes_nohw_xor(a0, a2)); + aes_word_t b4 = aes_nohw_xor(a6, aes_nohw_xor(a1, a3)); + aes_word_t b5 = aes_nohw_xor(a7, aes_nohw_xor(a2, a4)); + aes_word_t b6 = aes_nohw_xor(a0, aes_nohw_xor(a3, a5)); + aes_word_t b7 = aes_nohw_xor(a1, aes_nohw_xor(a4, a6)); + + // XOR 0x05. Equivalently, we could XOR 0x63 before applying the circulant, + // but 0x05 has lower Hamming weight. (0x05 is the circulant applied to 0x63.) + batch->w[0] = aes_nohw_not(b0); + batch->w[1] = b1; + batch->w[2] = aes_nohw_not(b2); + batch->w[3] = b3; + batch->w[4] = b4; + batch->w[5] = b5; + batch->w[6] = b6; + batch->w[7] = b7; +} + +static void aes_nohw_inv_sub_bytes(AES_NOHW_BATCH *batch) { + // We implement the inverse S-box using the forwards implementation with the + // technique described in https://www.bearssl.org/constanttime.html#aes. + // + // The forwards S-box inverts its input and applies an affine transformation: + // S(x) = A(Inv(x)). Thus Inv(x) = InvA(S(x)). The inverse S-box is then: + // + // InvS(x) = Inv(InvA(x)). + // = InvA(S(InvA(x))) + aes_nohw_sub_bytes_inv_affine(batch); + aes_nohw_sub_bytes(batch); + aes_nohw_sub_bytes_inv_affine(batch); +} + +// aes_nohw_rotate_cols_right returns |v| with the columns in each row rotated +// to the right by |n|. This is a macro because |aes_nohw_shift_*| require +// constant shift counts in the SSE2 implementation. +#define aes_nohw_rotate_cols_right(/* aes_word_t */ v, /* const */ n) \ + (aes_nohw_or(aes_nohw_shift_right((v), (n)*4), \ + aes_nohw_shift_left((v), 16 - (n)*4))) + +static void aes_nohw_shift_rows(AES_NOHW_BATCH *batch) { + for (size_t i = 0; i < 8; i++) { + aes_word_t row0 = aes_nohw_and(batch->w[i], AES_NOHW_ROW0_MASK); + aes_word_t row1 = aes_nohw_and(batch->w[i], AES_NOHW_ROW1_MASK); + aes_word_t row2 = aes_nohw_and(batch->w[i], AES_NOHW_ROW2_MASK); + aes_word_t row3 = aes_nohw_and(batch->w[i], AES_NOHW_ROW3_MASK); + row1 = aes_nohw_rotate_cols_right(row1, 1); + row2 = aes_nohw_rotate_cols_right(row2, 2); + row3 = aes_nohw_rotate_cols_right(row3, 3); + batch->w[i] = aes_nohw_or(aes_nohw_or(row0, row1), aes_nohw_or(row2, row3)); + } +} + +static void aes_nohw_inv_shift_rows(AES_NOHW_BATCH *batch) { + for (size_t i = 0; i < 8; i++) { + aes_word_t row0 = aes_nohw_and(batch->w[i], AES_NOHW_ROW0_MASK); + aes_word_t row1 = aes_nohw_and(batch->w[i], AES_NOHW_ROW1_MASK); + aes_word_t row2 = aes_nohw_and(batch->w[i], AES_NOHW_ROW2_MASK); + aes_word_t row3 = aes_nohw_and(batch->w[i], AES_NOHW_ROW3_MASK); + row1 = aes_nohw_rotate_cols_right(row1, 3); + row2 = aes_nohw_rotate_cols_right(row2, 2); + row3 = aes_nohw_rotate_cols_right(row3, 1); + batch->w[i] = aes_nohw_or(aes_nohw_or(row0, row1), aes_nohw_or(row2, row3)); + } +} + +// aes_nohw_rotate_rows_down returns |v| with the rows in each column rotated +// down by one. +static inline aes_word_t aes_nohw_rotate_rows_down(aes_word_t v) { +#if defined(OPENSSL_SSE2) + return _mm_or_si128(_mm_srli_epi32(v, 8), _mm_slli_epi32(v, 24)); +#elif defined(OPENSSL_64_BIT) + return ((v >> 4) & UINT64_C(0x0fff0fff0fff0fff)) | + ((v << 12) & UINT64_C(0xf000f000f000f000)); +#else + return ((v >> 2) & 0x3f3f3f3f) | ((v << 6) & 0xc0c0c0c0); +#endif +} + +// aes_nohw_rotate_rows_twice returns |v| with the rows in each column rotated +// by two. +static inline aes_word_t aes_nohw_rotate_rows_twice(aes_word_t v) { +#if defined(OPENSSL_SSE2) + return _mm_or_si128(_mm_srli_epi32(v, 16), _mm_slli_epi32(v, 16)); +#elif defined(OPENSSL_64_BIT) + return ((v >> 8) & UINT64_C(0x00ff00ff00ff00ff)) | + ((v << 8) & UINT64_C(0xff00ff00ff00ff00)); +#else + return ((v >> 4) & 0x0f0f0f0f) | ((v << 4) & 0xf0f0f0f0); +#endif +} + +static void aes_nohw_mix_columns(AES_NOHW_BATCH *batch) { + // See https://eprint.iacr.org/2009/129.pdf, section 4.4 and appendix A. + aes_word_t a0 = batch->w[0]; + aes_word_t a1 = batch->w[1]; + aes_word_t a2 = batch->w[2]; + aes_word_t a3 = batch->w[3]; + aes_word_t a4 = batch->w[4]; + aes_word_t a5 = batch->w[5]; + aes_word_t a6 = batch->w[6]; + aes_word_t a7 = batch->w[7]; + + aes_word_t r0 = aes_nohw_rotate_rows_down(a0); + aes_word_t a0_r0 = aes_nohw_xor(a0, r0); + aes_word_t r1 = aes_nohw_rotate_rows_down(a1); + aes_word_t a1_r1 = aes_nohw_xor(a1, r1); + aes_word_t r2 = aes_nohw_rotate_rows_down(a2); + aes_word_t a2_r2 = aes_nohw_xor(a2, r2); + aes_word_t r3 = aes_nohw_rotate_rows_down(a3); + aes_word_t a3_r3 = aes_nohw_xor(a3, r3); + aes_word_t r4 = aes_nohw_rotate_rows_down(a4); + aes_word_t a4_r4 = aes_nohw_xor(a4, r4); + aes_word_t r5 = aes_nohw_rotate_rows_down(a5); + aes_word_t a5_r5 = aes_nohw_xor(a5, r5); + aes_word_t r6 = aes_nohw_rotate_rows_down(a6); + aes_word_t a6_r6 = aes_nohw_xor(a6, r6); + aes_word_t r7 = aes_nohw_rotate_rows_down(a7); + aes_word_t a7_r7 = aes_nohw_xor(a7, r7); + + batch->w[0] = + aes_nohw_xor(aes_nohw_xor(a7_r7, r0), aes_nohw_rotate_rows_twice(a0_r0)); + batch->w[1] = + aes_nohw_xor(aes_nohw_xor(a0_r0, a7_r7), + aes_nohw_xor(r1, aes_nohw_rotate_rows_twice(a1_r1))); + batch->w[2] = + aes_nohw_xor(aes_nohw_xor(a1_r1, r2), aes_nohw_rotate_rows_twice(a2_r2)); + batch->w[3] = + aes_nohw_xor(aes_nohw_xor(a2_r2, a7_r7), + aes_nohw_xor(r3, aes_nohw_rotate_rows_twice(a3_r3))); + batch->w[4] = + aes_nohw_xor(aes_nohw_xor(a3_r3, a7_r7), + aes_nohw_xor(r4, aes_nohw_rotate_rows_twice(a4_r4))); + batch->w[5] = + aes_nohw_xor(aes_nohw_xor(a4_r4, r5), aes_nohw_rotate_rows_twice(a5_r5)); + batch->w[6] = + aes_nohw_xor(aes_nohw_xor(a5_r5, r6), aes_nohw_rotate_rows_twice(a6_r6)); + batch->w[7] = + aes_nohw_xor(aes_nohw_xor(a6_r6, r7), aes_nohw_rotate_rows_twice(a7_r7)); +} + +static void aes_nohw_inv_mix_columns(AES_NOHW_BATCH *batch) { + aes_word_t a0 = batch->w[0]; + aes_word_t a1 = batch->w[1]; + aes_word_t a2 = batch->w[2]; + aes_word_t a3 = batch->w[3]; + aes_word_t a4 = batch->w[4]; + aes_word_t a5 = batch->w[5]; + aes_word_t a6 = batch->w[6]; + aes_word_t a7 = batch->w[7]; + + // bsaes-x86_64.pl describes the following decomposition of the inverse + // MixColumns matrix, credited to Jussi Kivilinna. This gives a much simpler + // multiplication. + // + // | 0e 0b 0d 09 | | 02 03 01 01 | | 05 00 04 00 | + // | 09 0e 0b 0d | = | 01 02 03 01 | x | 00 05 00 04 | + // | 0d 09 0e 0b | | 01 01 02 03 | | 04 00 05 00 | + // | 0b 0d 09 0e | | 03 01 01 02 | | 00 04 00 05 | + // + // First, apply the [5 0 4 0] matrix. Multiplying by 4 in F_(2^8) is described + // by the following bit equations: + // + // b0 = a6 + // b1 = a6 ^ a7 + // b2 = a0 ^ a7 + // b3 = a1 ^ a6 + // b4 = a2 ^ a6 ^ a7 + // b5 = a3 ^ a7 + // b6 = a4 + // b7 = a5 + // + // Each coefficient is given by: + // + // b_ij = 05·a_ij ⊕ 04·a_i(j+2) = 04·(a_ij ⊕ a_i(j+2)) ⊕ a_ij + // + // We combine the two equations below. Note a_i(j+2) is a row rotation. + aes_word_t a0_r0 = aes_nohw_xor(a0, aes_nohw_rotate_rows_twice(a0)); + aes_word_t a1_r1 = aes_nohw_xor(a1, aes_nohw_rotate_rows_twice(a1)); + aes_word_t a2_r2 = aes_nohw_xor(a2, aes_nohw_rotate_rows_twice(a2)); + aes_word_t a3_r3 = aes_nohw_xor(a3, aes_nohw_rotate_rows_twice(a3)); + aes_word_t a4_r4 = aes_nohw_xor(a4, aes_nohw_rotate_rows_twice(a4)); + aes_word_t a5_r5 = aes_nohw_xor(a5, aes_nohw_rotate_rows_twice(a5)); + aes_word_t a6_r6 = aes_nohw_xor(a6, aes_nohw_rotate_rows_twice(a6)); + aes_word_t a7_r7 = aes_nohw_xor(a7, aes_nohw_rotate_rows_twice(a7)); + + batch->w[0] = aes_nohw_xor(a0, a6_r6); + batch->w[1] = aes_nohw_xor(a1, aes_nohw_xor(a6_r6, a7_r7)); + batch->w[2] = aes_nohw_xor(a2, aes_nohw_xor(a0_r0, a7_r7)); + batch->w[3] = aes_nohw_xor(a3, aes_nohw_xor(a1_r1, a6_r6)); + batch->w[4] = + aes_nohw_xor(aes_nohw_xor(a4, a2_r2), aes_nohw_xor(a6_r6, a7_r7)); + batch->w[5] = aes_nohw_xor(a5, aes_nohw_xor(a3_r3, a7_r7)); + batch->w[6] = aes_nohw_xor(a6, a4_r4); + batch->w[7] = aes_nohw_xor(a7, a5_r5); + + // Apply the [02 03 01 01] matrix, which is just MixColumns. + aes_nohw_mix_columns(batch); +} + +static void aes_nohw_encrypt_batch(const AES_NOHW_SCHEDULE *key, + size_t num_rounds, AES_NOHW_BATCH *batch) { + aes_nohw_add_round_key(batch, &key->keys[0]); + for (size_t i = 1; i < num_rounds; i++) { + aes_nohw_sub_bytes(batch); + aes_nohw_shift_rows(batch); + aes_nohw_mix_columns(batch); + aes_nohw_add_round_key(batch, &key->keys[i]); + } + aes_nohw_sub_bytes(batch); + aes_nohw_shift_rows(batch); + aes_nohw_add_round_key(batch, &key->keys[num_rounds]); +} + +static void aes_nohw_decrypt_batch(const AES_NOHW_SCHEDULE *key, + size_t num_rounds, AES_NOHW_BATCH *batch) { + aes_nohw_add_round_key(batch, &key->keys[num_rounds]); + aes_nohw_inv_shift_rows(batch); + aes_nohw_inv_sub_bytes(batch); + for (size_t i = num_rounds - 1; i > 0; i--) { + aes_nohw_add_round_key(batch, &key->keys[i]); + aes_nohw_inv_mix_columns(batch); + aes_nohw_inv_shift_rows(batch); + aes_nohw_inv_sub_bytes(batch); + } + aes_nohw_add_round_key(batch, &key->keys[0]); +} + + +// Key schedule. + +static void aes_nohw_expand_round_keys(AES_NOHW_SCHEDULE *out, + const AES_KEY *key) { + for (size_t i = 0; i <= key->rounds; i++) { + // Copy the round key into each block in the batch. + for (size_t j = 0; j < AES_NOHW_BATCH_SIZE; j++) { + aes_word_t tmp[AES_NOHW_BLOCK_WORDS]; + memcpy(tmp, key->rd_key + 4 * i, 16); + aes_nohw_batch_set(&out->keys[i], tmp, j); + } + aes_nohw_transpose(&out->keys[i]); + } +} + +static const uint8_t aes_nohw_rcon[10] = {0x01, 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36}; + +// aes_nohw_rcon_slice returns the |i|th group of |AES_NOHW_BATCH_SIZE| bits in +// |rcon|, stored in a |aes_word_t|. +static inline aes_word_t aes_nohw_rcon_slice(uint8_t rcon, size_t i) { + rcon = (rcon >> (i * AES_NOHW_BATCH_SIZE)) & ((1 << AES_NOHW_BATCH_SIZE) - 1); +#if defined(OPENSSL_SSE2) + return _mm_set_epi32(0, 0, 0, rcon); +#else + return ((aes_word_t)rcon); +#endif +} + +static void aes_nohw_sub_block(aes_word_t out[AES_NOHW_BLOCK_WORDS], + const aes_word_t in[AES_NOHW_BLOCK_WORDS]) { + AES_NOHW_BATCH batch; + memset(&batch, 0, sizeof(batch)); + aes_nohw_batch_set(&batch, in, 0); + aes_nohw_transpose(&batch); + aes_nohw_sub_bytes(&batch); + aes_nohw_transpose(&batch); + aes_nohw_batch_get(&batch, out, 0); +} + +static void aes_nohw_setup_key_128(AES_KEY *key, const uint8_t in[16]) { + key->rounds = 10; + + aes_word_t block[AES_NOHW_BLOCK_WORDS]; + aes_nohw_compact_block(block, in); + memcpy(key->rd_key, block, 16); + + for (size_t i = 1; i <= 10; i++) { + aes_word_t sub[AES_NOHW_BLOCK_WORDS]; + aes_nohw_sub_block(sub, block); + uint8_t rcon = aes_nohw_rcon[i - 1]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Incorporate |rcon| and the transformed word into the first word. + block[j] = aes_nohw_xor(block[j], aes_nohw_rcon_slice(rcon, j)); + block[j] = aes_nohw_xor( + block[j], + aes_nohw_shift_right(aes_nohw_rotate_rows_down(sub[j]), 12)); + // Propagate to the remaining words. Note this is reordered from the usual + // formulation to avoid needing masks. + aes_word_t v = block[j]; + block[j] = aes_nohw_xor(block[j], aes_nohw_shift_left(v, 4)); + block[j] = aes_nohw_xor(block[j], aes_nohw_shift_left(v, 8)); + block[j] = aes_nohw_xor(block[j], aes_nohw_shift_left(v, 12)); + } + memcpy(key->rd_key + 4 * i, block, 16); + } +} + +static void aes_nohw_setup_key_192(AES_KEY *key, const uint8_t in[24]) { + key->rounds = 12; + + aes_word_t storage1[AES_NOHW_BLOCK_WORDS], storage2[AES_NOHW_BLOCK_WORDS]; + aes_word_t *block1 = storage1, *block2 = storage2; + + // AES-192's key schedule is complex because each key schedule iteration + // produces six words, but we compute on blocks and each block is four words. + // We maintain a sliding window of two blocks, filled to 1.5 blocks at a time. + // We loop below every three blocks or two key schedule iterations. + // + // On entry to the loop, |block1| and the first half of |block2| contain the + // previous key schedule iteration. |block1| has been written to |key|, but + // |block2| has not as it is incomplete. + aes_nohw_compact_block(block1, in); + memcpy(key->rd_key, block1, 16); + + uint8_t half_block[16] = {0}; + memcpy(half_block, in + 16, 8); + aes_nohw_compact_block(block2, half_block); + + for (size_t i = 0; i < 4; i++) { + aes_word_t sub[AES_NOHW_BLOCK_WORDS]; + aes_nohw_sub_block(sub, block2); + uint8_t rcon = aes_nohw_rcon[2 * i]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Compute the first two words of the next key schedule iteration, which + // go in the second half of |block2|. The first two words of the previous + // iteration are in the first half of |block1|. Apply |rcon| here too + // because the shifts match. + block2[j] = aes_nohw_or( + block2[j], + aes_nohw_shift_left( + aes_nohw_xor(block1[j], aes_nohw_rcon_slice(rcon, j)), 8)); + // Incorporate the transformed word and propagate. Note the last word of + // the previous iteration corresponds to the second word of |copy|. This + // is incorporated into the first word of the next iteration, or the third + // word of |block2|. + block2[j] = aes_nohw_xor( + block2[j], aes_nohw_and(aes_nohw_shift_left( + aes_nohw_rotate_rows_down(sub[j]), 4), + AES_NOHW_COL2_MASK)); + block2[j] = aes_nohw_xor( + block2[j], + aes_nohw_and(aes_nohw_shift_left(block2[j], 4), AES_NOHW_COL3_MASK)); + + // Compute the remaining four words, which fill |block1|. Begin by moving + // the corresponding words of the previous iteration: the second half of + // |block1| and the first half of |block2|. + block1[j] = aes_nohw_shift_right(block1[j], 8); + block1[j] = aes_nohw_or(block1[j], aes_nohw_shift_left(block2[j], 8)); + // Incorporate the second word, computed previously in |block2|, and + // propagate. + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_right(block2[j], 12)); + aes_word_t v = block1[j]; + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 4)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 8)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 12)); + } + + // This completes two round keys. Note half of |block2| was computed in the + // previous loop iteration but was not yet output. + memcpy(key->rd_key + 4 * (3 * i + 1), block2, 16); + memcpy(key->rd_key + 4 * (3 * i + 2), block1, 16); + + aes_nohw_sub_block(sub, block1); + rcon = aes_nohw_rcon[2 * i + 1]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Compute the first four words of the next key schedule iteration in + // |block2|. Begin by moving the corresponding words of the previous + // iteration: the second half of |block2| and the first half of |block1|. + block2[j] = aes_nohw_shift_right(block2[j], 8); + block2[j] = aes_nohw_or(block2[j], aes_nohw_shift_left(block1[j], 8)); + // Incorporate rcon and the transformed word. Note the last word of the + // previous iteration corresponds to the last word of |copy|. + block2[j] = aes_nohw_xor(block2[j], aes_nohw_rcon_slice(rcon, j)); + block2[j] = aes_nohw_xor( + block2[j], + aes_nohw_shift_right(aes_nohw_rotate_rows_down(sub[j]), 12)); + // Propagate to the remaining words. + aes_word_t v = block2[j]; + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 4)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 8)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 12)); + + // Compute the last two words, which go in the first half of |block1|. The + // last two words of the previous iteration are in the second half of + // |block1|. + block1[j] = aes_nohw_shift_right(block1[j], 8); + // Propagate blocks and mask off the excess. + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_right(block2[j], 12)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(block1[j], 4)); + block1[j] = aes_nohw_and(block1[j], AES_NOHW_COL01_MASK); + } + + // |block2| has a complete round key. |block1| will be completed in the next + // iteration. + memcpy(key->rd_key + 4 * (3 * i + 3), block2, 16); + + // Swap blocks to restore the invariant. + aes_word_t *tmp = block1; + block1 = block2; + block2 = tmp; + } +} + +static void aes_nohw_setup_key_256(AES_KEY *key, const uint8_t in[32]) { + key->rounds = 14; + + // Each key schedule iteration produces two round keys. + aes_word_t block1[AES_NOHW_BLOCK_WORDS], block2[AES_NOHW_BLOCK_WORDS]; + aes_nohw_compact_block(block1, in); + memcpy(key->rd_key, block1, 16); + + aes_nohw_compact_block(block2, in + 16); + memcpy(key->rd_key + 4, block2, 16); + + for (size_t i = 2; i <= 14; i += 2) { + aes_word_t sub[AES_NOHW_BLOCK_WORDS]; + aes_nohw_sub_block(sub, block2); + uint8_t rcon = aes_nohw_rcon[i / 2 - 1]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Incorporate |rcon| and the transformed word into the first word. + block1[j] = aes_nohw_xor(block1[j], aes_nohw_rcon_slice(rcon, j)); + block1[j] = aes_nohw_xor( + block1[j], + aes_nohw_shift_right(aes_nohw_rotate_rows_down(sub[j]), 12)); + // Propagate to the remaining words. + aes_word_t v = block1[j]; + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 4)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 8)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 12)); + } + memcpy(key->rd_key + 4 * i, block1, 16); + + if (i == 14) { + break; + } + + aes_nohw_sub_block(sub, block1); + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Incorporate the transformed word into the first word. + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_right(sub[j], 12)); + // Propagate to the remaining words. + aes_word_t v = block2[j]; + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 4)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 8)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 12)); + } + memcpy(key->rd_key + 4 * (i + 1), block2, 16); + } +} + + +// External API. + +int aes_nohw_set_encrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey) { + switch (bits) { + case 128: + aes_nohw_setup_key_128(aeskey, key); + return 0; + case 192: + aes_nohw_setup_key_192(aeskey, key); + return 0; + case 256: + aes_nohw_setup_key_256(aeskey, key); + return 0; + } + return 1; +} + +int aes_nohw_set_decrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey) { + return aes_nohw_set_encrypt_key(key, bits, aeskey); +} + +void aes_nohw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, in, /*num_blocks=*/1); + aes_nohw_encrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, /*num_blocks=*/1, &batch); +} + +void aes_nohw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, in, /*num_blocks=*/1); + aes_nohw_decrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, /*num_blocks=*/1, &batch); +} + +static inline void aes_nohw_xor_block(uint8_t out[16], const uint8_t a[16], + const uint8_t b[16]) { + for (size_t i = 0; i < 16; i += sizeof(aes_word_t)) { + aes_word_t x, y; + memcpy(&x, a + i, sizeof(aes_word_t)); + memcpy(&y, b + i, sizeof(aes_word_t)); + x = aes_nohw_xor(x, y); + memcpy(out + i, &x, sizeof(aes_word_t)); + } +} + +void aes_nohw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t blocks, const AES_KEY *key, + const uint8_t ivec[16]) { + if (blocks == 0) { + return; + } + + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + + // Make |AES_NOHW_BATCH_SIZE| copies of |ivec|. + alignas(AES_NOHW_WORD_SIZE) union { + uint32_t u32[AES_NOHW_BATCH_SIZE * 4]; + uint8_t u8[AES_NOHW_BATCH_SIZE * 16]; + } ivs, enc_ivs; + for (size_t i = 0; i < AES_NOHW_BATCH_SIZE; i++) { + memcpy(ivs.u8 + 16 * i, ivec, 16); + } + + uint32_t ctr = CRYPTO_bswap4(ivs.u32[3]); + for (;;) { + // Update counters. + for (size_t i = 0; i < AES_NOHW_BATCH_SIZE; i++) { + ivs.u32[4 * i + 3] = CRYPTO_bswap4(ctr + i); + } + + size_t todo = blocks >= AES_NOHW_BATCH_SIZE ? AES_NOHW_BATCH_SIZE : blocks; + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, ivs.u8, todo); + aes_nohw_encrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(enc_ivs.u8, todo, &batch); + + for (size_t i = 0; i < todo; i++) { + aes_nohw_xor_block(out + 16 * i, in + 16 * i, enc_ivs.u8 + 16 * i); + } + + blocks -= todo; + if (blocks == 0) { + break; + } + + in += 16 * AES_NOHW_BATCH_SIZE; + out += 16 * AES_NOHW_BATCH_SIZE; + ctr += AES_NOHW_BATCH_SIZE; + } +} + +void aes_nohw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t *ivec, const int enc) { + assert(len % 16 == 0); + size_t blocks = len / 16; + if (blocks == 0) { + return; + } + + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + alignas(AES_NOHW_WORD_SIZE) uint8_t iv[16]; + memcpy(iv, ivec, 16); + + if (enc) { + // CBC encryption is not parallelizable. + while (blocks > 0) { + aes_nohw_xor_block(iv, iv, in); + + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, iv, /*num_blocks=*/1); + aes_nohw_encrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, /*num_blocks=*/1, &batch); + + memcpy(iv, out, 16); + + in += 16; + out += 16; + blocks--; + } + memcpy(ivec, iv, 16); + return; + } + + for (;;) { + size_t todo = blocks >= AES_NOHW_BATCH_SIZE ? AES_NOHW_BATCH_SIZE : blocks; + // Make a copy of the input so we can decrypt in-place. + alignas(AES_NOHW_WORD_SIZE) uint8_t copy[AES_NOHW_BATCH_SIZE * 16]; + memcpy(copy, in, todo * 16); + + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, in, todo); + aes_nohw_decrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, todo, &batch); + + aes_nohw_xor_block(out, out, iv); + for (size_t i = 1; i < todo; i++) { + aes_nohw_xor_block(out + 16 * i, out + 16 * i, copy + 16 * (i - 1)); + } + + // Save the last block as the IV. + memcpy(iv, copy + 16 * (todo - 1), 16); + + blocks -= todo; + if (blocks == 0) { + break; + } + + in += 16 * AES_NOHW_BATCH_SIZE; + out += 16 * AES_NOHW_BATCH_SIZE; + } + + memcpy(ivec, iv, 16); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c.grpc_back new file mode 100644 index 000000000..ffbee8962 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/aes_nohw.c.grpc_back @@ -0,0 +1,1282 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include "../../internal.h" + +#if defined(OPENSSL_SSE2) +#include +#endif + + +// This file contains a constant-time implementation of AES, bitsliced with +// 32-bit, 64-bit, or 128-bit words, operating on two-, four-, and eight-block +// batches, respectively. The 128-bit implementation requires SSE2 intrinsics. +// +// This implementation is based on the algorithms described in the following +// references: +// - https://bearssl.org/constanttime.html#aes +// - https://eprint.iacr.org/2009/129.pdf +// - https://eprint.iacr.org/2009/191.pdf + + +// Word operations. +// +// An aes_word_t is the word used for this AES implementation. Throughout this +// file, bits and bytes are ordered little-endian, though "left" and "right" +// shifts match the operations themselves, which makes them reversed in a +// little-endian, left-to-right reading. +// +// Eight |aes_word_t|s contain |AES_NOHW_BATCH_SIZE| blocks. The bits in an +// |aes_word_t| are divided into 16 consecutive groups of |AES_NOHW_BATCH_SIZE| +// bits each, each corresponding to a byte in an AES block in column-major +// order (AES's byte order). We refer to these as "logical bytes". Note, in the +// 32-bit and 64-bit implementations, they are smaller than a byte. (The +// contents of a logical byte will be described later.) +// +// MSVC does not support C bit operators on |__m128i|, so the wrapper functions +// |aes_nohw_and|, etc., should be used instead. Note |aes_nohw_shift_left| and +// |aes_nohw_shift_right| measure the shift in logical bytes. That is, the shift +// value ranges from 0 to 15 independent of |aes_word_t| and +// |AES_NOHW_BATCH_SIZE|. +// +// This ordering is different from https://eprint.iacr.org/2009/129.pdf, which +// uses row-major order. Matching the AES order was easier to reason about, and +// we do not have PSHUFB available to arbitrarily permute bytes. + +#if defined(OPENSSL_SSE2) +typedef __m128i aes_word_t; +// AES_NOHW_WORD_SIZE is sizeof(aes_word_t). alignas(sizeof(T)) does not work in +// MSVC, so we define a constant. +#define AES_NOHW_WORD_SIZE 16 +#define AES_NOHW_BATCH_SIZE 8 +#define AES_NOHW_ROW0_MASK \ + _mm_set_epi32(0x000000ff, 0x000000ff, 0x000000ff, 0x000000ff) +#define AES_NOHW_ROW1_MASK \ + _mm_set_epi32(0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00) +#define AES_NOHW_ROW2_MASK \ + _mm_set_epi32(0x00ff0000, 0x00ff0000, 0x00ff0000, 0x00ff0000) +#define AES_NOHW_ROW3_MASK \ + _mm_set_epi32(0xff000000, 0xff000000, 0xff000000, 0xff000000) +#define AES_NOHW_COL01_MASK \ + _mm_set_epi32(0x00000000, 0x00000000, 0xffffffff, 0xffffffff) +#define AES_NOHW_COL2_MASK \ + _mm_set_epi32(0x00000000, 0xffffffff, 0x00000000, 0x00000000) +#define AES_NOHW_COL3_MASK \ + _mm_set_epi32(0xffffffff, 0x00000000, 0x00000000, 0x00000000) + +static inline aes_word_t aes_nohw_and(aes_word_t a, aes_word_t b) { + return _mm_and_si128(a, b); +} + +static inline aes_word_t aes_nohw_or(aes_word_t a, aes_word_t b) { + return _mm_or_si128(a, b); +} + +static inline aes_word_t aes_nohw_xor(aes_word_t a, aes_word_t b) { + return _mm_xor_si128(a, b); +} + +static inline aes_word_t aes_nohw_not(aes_word_t a) { + return _mm_xor_si128( + a, _mm_set_epi32(0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff)); +} + +// These are macros because parameters to |_mm_slli_si128| and |_mm_srli_si128| +// must be constants. +#define aes_nohw_shift_left(/* aes_word_t */ a, /* const */ i) \ + _mm_slli_si128((a), (i)) +#define aes_nohw_shift_right(/* aes_word_t */ a, /* const */ i) \ + _mm_srli_si128((a), (i)) +#else // !OPENSSL_SSE2 +#if defined(OPENSSL_64_BIT) +typedef uint64_t aes_word_t; +#define AES_NOHW_WORD_SIZE 8 +#define AES_NOHW_BATCH_SIZE 4 +#define AES_NOHW_ROW0_MASK UINT64_C(0x000f000f000f000f) +#define AES_NOHW_ROW1_MASK UINT64_C(0x00f000f000f000f0) +#define AES_NOHW_ROW2_MASK UINT64_C(0x0f000f000f000f00) +#define AES_NOHW_ROW3_MASK UINT64_C(0xf000f000f000f000) +#define AES_NOHW_COL01_MASK UINT64_C(0x00000000ffffffff) +#define AES_NOHW_COL2_MASK UINT64_C(0x0000ffff00000000) +#define AES_NOHW_COL3_MASK UINT64_C(0xffff000000000000) +#else // !OPENSSL_64_BIT +typedef uint32_t aes_word_t; +#define AES_NOHW_WORD_SIZE 4 +#define AES_NOHW_BATCH_SIZE 2 +#define AES_NOHW_ROW0_MASK 0x03030303 +#define AES_NOHW_ROW1_MASK 0x0c0c0c0c +#define AES_NOHW_ROW2_MASK 0x30303030 +#define AES_NOHW_ROW3_MASK 0xc0c0c0c0 +#define AES_NOHW_COL01_MASK 0x0000ffff +#define AES_NOHW_COL2_MASK 0x00ff0000 +#define AES_NOHW_COL3_MASK 0xff000000 +#endif // OPENSSL_64_BIT + +static inline aes_word_t aes_nohw_and(aes_word_t a, aes_word_t b) { + return a & b; +} + +static inline aes_word_t aes_nohw_or(aes_word_t a, aes_word_t b) { + return a | b; +} + +static inline aes_word_t aes_nohw_xor(aes_word_t a, aes_word_t b) { + return a ^ b; +} + +static inline aes_word_t aes_nohw_not(aes_word_t a) { return ~a; } + +static inline aes_word_t aes_nohw_shift_left(aes_word_t a, aes_word_t i) { + return a << (i * AES_NOHW_BATCH_SIZE); +} + +static inline aes_word_t aes_nohw_shift_right(aes_word_t a, aes_word_t i) { + return a >> (i * AES_NOHW_BATCH_SIZE); +} +#endif // OPENSSL_SSE2 + +OPENSSL_STATIC_ASSERT(AES_NOHW_BATCH_SIZE * 128 == 8 * 8 * sizeof(aes_word_t), + "batch size does not match word size"); +OPENSSL_STATIC_ASSERT(AES_NOHW_WORD_SIZE == sizeof(aes_word_t), + "AES_NOHW_WORD_SIZE is incorrect"); + + +// Block representations. +// +// This implementation uses three representations for AES blocks. First, the +// public API represents blocks as uint8_t[16] in the usual way. Second, most +// AES steps are evaluated in bitsliced form, stored in an |AES_NOHW_BATCH|. +// This stores |AES_NOHW_BATCH_SIZE| blocks in bitsliced order. For 64-bit words +// containing bitsliced blocks a, b, c, d, this would be as follows (vertical +// bars divide logical bytes): +// +// batch.w[0] = a0 b0 c0 d0 | a8 b8 c8 d8 | a16 b16 c16 d16 ... +// batch.w[1] = a1 b1 c1 d1 | a9 b9 c9 d9 | a17 b17 c17 d17 ... +// batch.w[2] = a2 b2 c2 d2 | a10 b10 c10 d10 | a18 b18 c18 d18 ... +// batch.w[3] = a3 b3 c3 d3 | a11 b11 c11 d11 | a19 b19 c19 d19 ... +// ... +// +// Finally, an individual block may be stored as an intermediate form in an +// aes_word_t[AES_NOHW_BLOCK_WORDS]. In this form, we permute the bits in each +// block, so that block[0]'s ith logical byte contains least-significant +// |AES_NOHW_BATCH_SIZE| bits of byte i, block[1] contains the next group of +// |AES_NOHW_BATCH_SIZE| bits, and so on. We refer to this transformation as +// "compacting" the block. Note this is no-op with 128-bit words because then +// |AES_NOHW_BLOCK_WORDS| is one and |AES_NOHW_BATCH_SIZE| is eight. For 64-bit +// words, one block would be stored in two words: +// +// block[0] = a0 a1 a2 a3 | a8 a9 a10 a11 | a16 a17 a18 a19 ... +// block[1] = a4 a5 a6 a7 | a12 a13 a14 a15 | a20 a21 a22 a23 ... +// +// Observe that the distances between corresponding bits in bitsliced and +// compact bit orders match. If we line up corresponding words of each block, +// the bitsliced and compact representations may be converted by tranposing bits +// in corresponding logical bytes. Continuing the 64-bit example: +// +// block_a[0] = a0 a1 a2 a3 | a8 a9 a10 a11 | a16 a17 a18 a19 ... +// block_b[0] = b0 b1 b2 b3 | b8 b9 b10 b11 | b16 b17 b18 b19 ... +// block_c[0] = c0 c1 c2 c3 | c8 c9 c10 c11 | c16 c17 c18 c19 ... +// block_d[0] = d0 d1 d2 d3 | d8 d9 d10 d11 | d16 d17 d18 d19 ... +// +// batch.w[0] = a0 b0 c0 d0 | a8 b8 c8 d8 | a16 b16 c16 d16 ... +// batch.w[1] = a1 b1 c1 d1 | a9 b9 c9 d9 | a17 b17 c17 d17 ... +// batch.w[2] = a2 b2 c2 d2 | a10 b10 c10 d10 | a18 b18 c18 d18 ... +// batch.w[3] = a3 b3 c3 d3 | a11 b11 c11 d11 | a19 b19 c19 d19 ... +// +// Note also that bitwise operations and (logical) byte permutations on an +// |aes_word_t| work equally for the bitsliced and compact words. +// +// We use the compact form in the |AES_KEY| representation to save work +// inflating round keys into |AES_NOHW_BATCH|. The compact form also exists +// temporarily while moving blocks in or out of an |AES_NOHW_BATCH|, immediately +// before or after |aes_nohw_transpose|. + +#define AES_NOHW_BLOCK_WORDS (16 / sizeof(aes_word_t)) + +// An AES_NOHW_BATCH stores |AES_NOHW_BATCH_SIZE| blocks. Unless otherwise +// specified, it is in bitsliced form. +typedef struct { + aes_word_t w[8]; +} AES_NOHW_BATCH; + +// An AES_NOHW_SCHEDULE is an expanded bitsliced AES key schedule. It is +// suitable for encryption or decryption. It is as large as |AES_NOHW_BATCH| +// |AES_KEY|s so it should not be used as a long-term key representation. +typedef struct { + // keys is an array of batches, one for each round key. Each batch stores + // |AES_NOHW_BATCH_SIZE| copies of the round key in bitsliced form. + AES_NOHW_BATCH keys[AES_MAXNR + 1]; +} AES_NOHW_SCHEDULE; + +// aes_nohw_batch_set sets the |i|th block of |batch| to |in|. |batch| is in +// compact form. +static inline void aes_nohw_batch_set(AES_NOHW_BATCH *batch, + const aes_word_t in[AES_NOHW_BLOCK_WORDS], + size_t i) { + // Note the words are interleaved. The order comes from |aes_nohw_transpose|. + // If |i| is zero and this is the 64-bit implementation, in[0] contains bits + // 0-3 and in[1] contains bits 4-7. We place in[0] at w[0] and in[1] at + // w[4] so that bits 0 and 4 are in the correct position. (In general, bits + // along diagonals of |AES_NOHW_BATCH_SIZE| by |AES_NOHW_BATCH_SIZE| squares + // will be correctly placed.) + assert(i < AES_NOHW_BATCH_SIZE); +#if defined(OPENSSL_SSE2) + batch->w[i] = in[0]; +#elif defined(OPENSSL_64_BIT) + batch->w[i] = in[0]; + batch->w[i + 4] = in[1]; +#else + batch->w[i] = in[0]; + batch->w[i + 2] = in[1]; + batch->w[i + 4] = in[2]; + batch->w[i + 6] = in[3]; +#endif +} + +// aes_nohw_batch_get writes the |i|th block of |batch| to |out|. |batch| is in +// compact form. +static inline void aes_nohw_batch_get(const AES_NOHW_BATCH *batch, + aes_word_t out[AES_NOHW_BLOCK_WORDS], + size_t i) { + assert(i < AES_NOHW_BATCH_SIZE); +#if defined(OPENSSL_SSE2) + out[0] = batch->w[i]; +#elif defined(OPENSSL_64_BIT) + out[0] = batch->w[i]; + out[1] = batch->w[i + 4]; +#else + out[0] = batch->w[i]; + out[1] = batch->w[i + 2]; + out[2] = batch->w[i + 4]; + out[3] = batch->w[i + 6]; +#endif +} + +#if !defined(OPENSSL_SSE2) +// aes_nohw_delta_swap returns |a| with bits |a & mask| and +// |a & (mask << shift)| swapped. |mask| and |mask << shift| may not overlap. +static inline aes_word_t aes_nohw_delta_swap(aes_word_t a, aes_word_t mask, + aes_word_t shift) { + // See + // https://reflectionsonsecurity.wordpress.com/2014/05/11/efficient-bit-permutation-using-delta-swaps/ + aes_word_t b = (a ^ (a >> shift)) & mask; + return a ^ b ^ (b << shift); +} + +// In the 32-bit and 64-bit implementations, a block spans multiple words. +// |aes_nohw_compact_block| must permute bits across different words. First we +// implement |aes_nohw_compact_word| which performs a smaller version of the +// transformation which stays within a single word. +// +// These transformations are generalizations of the output of +// http://programming.sirrida.de/calcperm.php on smaller inputs. +#if defined(OPENSSL_64_BIT) +static inline uint64_t aes_nohw_compact_word(uint64_t a) { + // Numbering the 64/2 = 16 4-bit chunks, least to most significant, we swap + // quartets of those chunks: + // 0 1 2 3 | 4 5 6 7 | 8 9 10 11 | 12 13 14 15 => + // 0 2 1 3 | 4 6 5 7 | 8 10 9 11 | 12 14 13 15 + a = aes_nohw_delta_swap(a, UINT64_C(0x00f000f000f000f0), 4); + // Swap quartets of 8-bit chunks (still numbering by 4-bit chunks): + // 0 2 1 3 | 4 6 5 7 | 8 10 9 11 | 12 14 13 15 => + // 0 2 4 6 | 1 3 5 7 | 8 10 12 14 | 9 11 13 15 + a = aes_nohw_delta_swap(a, UINT64_C(0x0000ff000000ff00), 8); + // Swap quartets of 16-bit chunks (still numbering by 4-bit chunks): + // 0 2 4 6 | 1 3 5 7 | 8 10 12 14 | 9 11 13 15 => + // 0 2 4 6 | 8 10 12 14 | 1 3 5 7 | 9 11 13 15 + a = aes_nohw_delta_swap(a, UINT64_C(0x00000000ffff0000), 16); + return a; +} + +static inline uint64_t aes_nohw_uncompact_word(uint64_t a) { + // Reverse the steps of |aes_nohw_uncompact_word|. + a = aes_nohw_delta_swap(a, UINT64_C(0x00000000ffff0000), 16); + a = aes_nohw_delta_swap(a, UINT64_C(0x0000ff000000ff00), 8); + a = aes_nohw_delta_swap(a, UINT64_C(0x00f000f000f000f0), 4); + return a; +} +#else // !OPENSSL_64_BIT +static inline uint32_t aes_nohw_compact_word(uint32_t a) { + // Numbering the 32/2 = 16 pairs of bits, least to most significant, we swap: + // 0 1 2 3 | 4 5 6 7 | 8 9 10 11 | 12 13 14 15 => + // 0 4 2 6 | 1 5 3 7 | 8 12 10 14 | 9 13 11 15 + // Note: 0x00cc = 0b0000_0000_1100_1100 + // 0x00cc << 6 = 0b0011_0011_0000_0000 + a = aes_nohw_delta_swap(a, 0x00cc00cc, 6); + // Now we swap groups of four bits (still numbering by pairs): + // 0 4 2 6 | 1 5 3 7 | 8 12 10 14 | 9 13 11 15 => + // 0 4 8 12 | 1 5 9 13 | 2 6 10 14 | 3 7 11 15 + // Note: 0x0000_f0f0 << 12 = 0x0f0f_0000 + a = aes_nohw_delta_swap(a, 0x0000f0f0, 12); + return a; +} + +static inline uint32_t aes_nohw_uncompact_word(uint32_t a) { + // Reverse the steps of |aes_nohw_uncompact_word|. + a = aes_nohw_delta_swap(a, 0x0000f0f0, 12); + a = aes_nohw_delta_swap(a, 0x00cc00cc, 6); + return a; +} + +static inline uint32_t aes_nohw_word_from_bytes(uint8_t a0, uint8_t a1, + uint8_t a2, uint8_t a3) { + return (uint32_t)a0 | ((uint32_t)a1 << 8) | ((uint32_t)a2 << 16) | + ((uint32_t)a3 << 24); +} +#endif // OPENSSL_64_BIT +#endif // !OPENSSL_SSE2 + +static inline void aes_nohw_compact_block(aes_word_t out[AES_NOHW_BLOCK_WORDS], + const uint8_t in[16]) { + memcpy(out, in, 16); +#if defined(OPENSSL_SSE2) + // No conversions needed. +#elif defined(OPENSSL_64_BIT) + uint64_t a0 = aes_nohw_compact_word(out[0]); + uint64_t a1 = aes_nohw_compact_word(out[1]); + out[0] = (a0 & UINT64_C(0x00000000ffffffff)) | (a1 << 32); + out[1] = (a1 & UINT64_C(0xffffffff00000000)) | (a0 >> 32); +#else + uint32_t a0 = aes_nohw_compact_word(out[0]); + uint32_t a1 = aes_nohw_compact_word(out[1]); + uint32_t a2 = aes_nohw_compact_word(out[2]); + uint32_t a3 = aes_nohw_compact_word(out[3]); + // Note clang, when building for ARM Thumb2, will sometimes miscompile + // expressions such as (a0 & 0x0000ff00) << 8, particularly when building + // without optimizations. This bug was introduced in + // https://reviews.llvm.org/rL340261 and fixed in + // https://reviews.llvm.org/rL351310. The following is written to avoid this. + out[0] = aes_nohw_word_from_bytes(a0, a1, a2, a3); + out[1] = aes_nohw_word_from_bytes(a0 >> 8, a1 >> 8, a2 >> 8, a3 >> 8); + out[2] = aes_nohw_word_from_bytes(a0 >> 16, a1 >> 16, a2 >> 16, a3 >> 16); + out[3] = aes_nohw_word_from_bytes(a0 >> 24, a1 >> 24, a2 >> 24, a3 >> 24); +#endif +} + +static inline void aes_nohw_uncompact_block( + uint8_t out[16], const aes_word_t in[AES_NOHW_BLOCK_WORDS]) { +#if defined(OPENSSL_SSE2) + memcpy(out, in, 16); // No conversions needed. +#elif defined(OPENSSL_64_BIT) + uint64_t a0 = in[0]; + uint64_t a1 = in[1]; + uint64_t b0 = + aes_nohw_uncompact_word((a0 & UINT64_C(0x00000000ffffffff)) | (a1 << 32)); + uint64_t b1 = + aes_nohw_uncompact_word((a1 & UINT64_C(0xffffffff00000000)) | (a0 >> 32)); + memcpy(out, &b0, 8); + memcpy(out + 8, &b1, 8); +#else + uint32_t a0 = in[0]; + uint32_t a1 = in[1]; + uint32_t a2 = in[2]; + uint32_t a3 = in[3]; + // Note clang, when building for ARM Thumb2, will sometimes miscompile + // expressions such as (a0 & 0x0000ff00) << 8, particularly when building + // without optimizations. This bug was introduced in + // https://reviews.llvm.org/rL340261 and fixed in + // https://reviews.llvm.org/rL351310. The following is written to avoid this. + uint32_t b0 = aes_nohw_word_from_bytes(a0, a1, a2, a3); + uint32_t b1 = aes_nohw_word_from_bytes(a0 >> 8, a1 >> 8, a2 >> 8, a3 >> 8); + uint32_t b2 = + aes_nohw_word_from_bytes(a0 >> 16, a1 >> 16, a2 >> 16, a3 >> 16); + uint32_t b3 = + aes_nohw_word_from_bytes(a0 >> 24, a1 >> 24, a2 >> 24, a3 >> 24); + b0 = aes_nohw_uncompact_word(b0); + b1 = aes_nohw_uncompact_word(b1); + b2 = aes_nohw_uncompact_word(b2); + b3 = aes_nohw_uncompact_word(b3); + memcpy(out, &b0, 4); + memcpy(out + 4, &b1, 4); + memcpy(out + 8, &b2, 4); + memcpy(out + 12, &b3, 4); +#endif +} + +// aes_nohw_swap_bits is a variation on a delta swap. It swaps the bits in +// |*a & (mask << shift)| with the bits in |*b & mask|. |mask| and +// |mask << shift| must not overlap. |mask| is specified as a |uint32_t|, but it +// is repeated to the full width of |aes_word_t|. +#if defined(OPENSSL_SSE2) +// This must be a macro because |_mm_srli_epi32| and |_mm_slli_epi32| require +// constant shift values. +#define aes_nohw_swap_bits(/*__m128i* */ a, /*__m128i* */ b, \ + /* uint32_t */ mask, /* const */ shift) \ + do { \ + __m128i swap = \ + _mm_and_si128(_mm_xor_si128(_mm_srli_epi32(*(a), (shift)), *(b)), \ + _mm_set_epi32((mask), (mask), (mask), (mask))); \ + *(a) = _mm_xor_si128(*(a), _mm_slli_epi32(swap, (shift))); \ + *(b) = _mm_xor_si128(*(b), swap); \ + \ + } while (0) +#else +static inline void aes_nohw_swap_bits(aes_word_t *a, aes_word_t *b, + uint32_t mask, aes_word_t shift) { +#if defined(OPENSSL_64_BIT) + aes_word_t mask_w = (((uint64_t)mask) << 32) | mask; +#else + aes_word_t mask_w = mask; +#endif + // This is a variation on a delta swap. + aes_word_t swap = ((*a >> shift) ^ *b) & mask_w; + *a ^= swap << shift; + *b ^= swap; +} +#endif // OPENSSL_SSE2 + +// aes_nohw_transpose converts |batch| to and from bitsliced form. It divides +// the 8 × word_size bits into AES_NOHW_BATCH_SIZE × AES_NOHW_BATCH_SIZE squares +// and transposes each square. +static void aes_nohw_transpose(AES_NOHW_BATCH *batch) { + // Swap bits with index 0 and 1 mod 2 (0x55 = 0b01010101). + aes_nohw_swap_bits(&batch->w[0], &batch->w[1], 0x55555555, 1); + aes_nohw_swap_bits(&batch->w[2], &batch->w[3], 0x55555555, 1); + aes_nohw_swap_bits(&batch->w[4], &batch->w[5], 0x55555555, 1); + aes_nohw_swap_bits(&batch->w[6], &batch->w[7], 0x55555555, 1); + +#if AES_NOHW_BATCH_SIZE >= 4 + // Swap bits with index 0-1 and 2-3 mod 4 (0x33 = 0b00110011). + aes_nohw_swap_bits(&batch->w[0], &batch->w[2], 0x33333333, 2); + aes_nohw_swap_bits(&batch->w[1], &batch->w[3], 0x33333333, 2); + aes_nohw_swap_bits(&batch->w[4], &batch->w[6], 0x33333333, 2); + aes_nohw_swap_bits(&batch->w[5], &batch->w[7], 0x33333333, 2); +#endif + +#if AES_NOHW_BATCH_SIZE >= 8 + // Swap bits with index 0-3 and 4-7 mod 8 (0x0f = 0b00001111). + aes_nohw_swap_bits(&batch->w[0], &batch->w[4], 0x0f0f0f0f, 4); + aes_nohw_swap_bits(&batch->w[1], &batch->w[5], 0x0f0f0f0f, 4); + aes_nohw_swap_bits(&batch->w[2], &batch->w[6], 0x0f0f0f0f, 4); + aes_nohw_swap_bits(&batch->w[3], &batch->w[7], 0x0f0f0f0f, 4); +#endif +} + +// aes_nohw_to_batch initializes |out| with the |num_blocks| blocks from |in|. +// |num_blocks| must be at most |AES_NOHW_BATCH|. +static void aes_nohw_to_batch(AES_NOHW_BATCH *out, const uint8_t *in, + size_t num_blocks) { + // Don't leave unused blocks unitialized. + memset(out, 0, sizeof(AES_NOHW_BATCH)); + assert(num_blocks <= AES_NOHW_BATCH_SIZE); + for (size_t i = 0; i < num_blocks; i++) { + aes_word_t block[AES_NOHW_BLOCK_WORDS]; + aes_nohw_compact_block(block, in + 16 * i); + aes_nohw_batch_set(out, block, i); + } + + aes_nohw_transpose(out); +} + +// aes_nohw_to_batch writes the first |num_blocks| blocks in |batch| to |out|. +// |num_blocks| must be at most |AES_NOHW_BATCH|. +static void aes_nohw_from_batch(uint8_t *out, size_t num_blocks, + const AES_NOHW_BATCH *batch) { + AES_NOHW_BATCH copy = *batch; + aes_nohw_transpose(©); + + assert(num_blocks <= AES_NOHW_BATCH_SIZE); + for (size_t i = 0; i < num_blocks; i++) { + aes_word_t block[AES_NOHW_BLOCK_WORDS]; + aes_nohw_batch_get(©, block, i); + aes_nohw_uncompact_block(out + 16 * i, block); + } +} + + +// AES round steps. + +static void aes_nohw_add_round_key(AES_NOHW_BATCH *batch, + const AES_NOHW_BATCH *key) { + for (size_t i = 0; i < 8; i++) { + batch->w[i] = aes_nohw_xor(batch->w[i], key->w[i]); + } +} + +static void aes_nohw_sub_bytes(AES_NOHW_BATCH *batch) { + // See https://eprint.iacr.org/2009/191.pdf, Appendix C. + aes_word_t x0 = batch->w[7]; + aes_word_t x1 = batch->w[6]; + aes_word_t x2 = batch->w[5]; + aes_word_t x3 = batch->w[4]; + aes_word_t x4 = batch->w[3]; + aes_word_t x5 = batch->w[2]; + aes_word_t x6 = batch->w[1]; + aes_word_t x7 = batch->w[0]; + + // Figure 2, the top linear transformation. + aes_word_t y14 = aes_nohw_xor(x3, x5); + aes_word_t y13 = aes_nohw_xor(x0, x6); + aes_word_t y9 = aes_nohw_xor(x0, x3); + aes_word_t y8 = aes_nohw_xor(x0, x5); + aes_word_t t0 = aes_nohw_xor(x1, x2); + aes_word_t y1 = aes_nohw_xor(t0, x7); + aes_word_t y4 = aes_nohw_xor(y1, x3); + aes_word_t y12 = aes_nohw_xor(y13, y14); + aes_word_t y2 = aes_nohw_xor(y1, x0); + aes_word_t y5 = aes_nohw_xor(y1, x6); + aes_word_t y3 = aes_nohw_xor(y5, y8); + aes_word_t t1 = aes_nohw_xor(x4, y12); + aes_word_t y15 = aes_nohw_xor(t1, x5); + aes_word_t y20 = aes_nohw_xor(t1, x1); + aes_word_t y6 = aes_nohw_xor(y15, x7); + aes_word_t y10 = aes_nohw_xor(y15, t0); + aes_word_t y11 = aes_nohw_xor(y20, y9); + aes_word_t y7 = aes_nohw_xor(x7, y11); + aes_word_t y17 = aes_nohw_xor(y10, y11); + aes_word_t y19 = aes_nohw_xor(y10, y8); + aes_word_t y16 = aes_nohw_xor(t0, y11); + aes_word_t y21 = aes_nohw_xor(y13, y16); + aes_word_t y18 = aes_nohw_xor(x0, y16); + + // Figure 3, the middle non-linear section. + aes_word_t t2 = aes_nohw_and(y12, y15); + aes_word_t t3 = aes_nohw_and(y3, y6); + aes_word_t t4 = aes_nohw_xor(t3, t2); + aes_word_t t5 = aes_nohw_and(y4, x7); + aes_word_t t6 = aes_nohw_xor(t5, t2); + aes_word_t t7 = aes_nohw_and(y13, y16); + aes_word_t t8 = aes_nohw_and(y5, y1); + aes_word_t t9 = aes_nohw_xor(t8, t7); + aes_word_t t10 = aes_nohw_and(y2, y7); + aes_word_t t11 = aes_nohw_xor(t10, t7); + aes_word_t t12 = aes_nohw_and(y9, y11); + aes_word_t t13 = aes_nohw_and(y14, y17); + aes_word_t t14 = aes_nohw_xor(t13, t12); + aes_word_t t15 = aes_nohw_and(y8, y10); + aes_word_t t16 = aes_nohw_xor(t15, t12); + aes_word_t t17 = aes_nohw_xor(t4, t14); + aes_word_t t18 = aes_nohw_xor(t6, t16); + aes_word_t t19 = aes_nohw_xor(t9, t14); + aes_word_t t20 = aes_nohw_xor(t11, t16); + aes_word_t t21 = aes_nohw_xor(t17, y20); + aes_word_t t22 = aes_nohw_xor(t18, y19); + aes_word_t t23 = aes_nohw_xor(t19, y21); + aes_word_t t24 = aes_nohw_xor(t20, y18); + aes_word_t t25 = aes_nohw_xor(t21, t22); + aes_word_t t26 = aes_nohw_and(t21, t23); + aes_word_t t27 = aes_nohw_xor(t24, t26); + aes_word_t t28 = aes_nohw_and(t25, t27); + aes_word_t t29 = aes_nohw_xor(t28, t22); + aes_word_t t30 = aes_nohw_xor(t23, t24); + aes_word_t t31 = aes_nohw_xor(t22, t26); + aes_word_t t32 = aes_nohw_and(t31, t30); + aes_word_t t33 = aes_nohw_xor(t32, t24); + aes_word_t t34 = aes_nohw_xor(t23, t33); + aes_word_t t35 = aes_nohw_xor(t27, t33); + aes_word_t t36 = aes_nohw_and(t24, t35); + aes_word_t t37 = aes_nohw_xor(t36, t34); + aes_word_t t38 = aes_nohw_xor(t27, t36); + aes_word_t t39 = aes_nohw_and(t29, t38); + aes_word_t t40 = aes_nohw_xor(t25, t39); + aes_word_t t41 = aes_nohw_xor(t40, t37); + aes_word_t t42 = aes_nohw_xor(t29, t33); + aes_word_t t43 = aes_nohw_xor(t29, t40); + aes_word_t t44 = aes_nohw_xor(t33, t37); + aes_word_t t45 = aes_nohw_xor(t42, t41); + aes_word_t z0 = aes_nohw_and(t44, y15); + aes_word_t z1 = aes_nohw_and(t37, y6); + aes_word_t z2 = aes_nohw_and(t33, x7); + aes_word_t z3 = aes_nohw_and(t43, y16); + aes_word_t z4 = aes_nohw_and(t40, y1); + aes_word_t z5 = aes_nohw_and(t29, y7); + aes_word_t z6 = aes_nohw_and(t42, y11); + aes_word_t z7 = aes_nohw_and(t45, y17); + aes_word_t z8 = aes_nohw_and(t41, y10); + aes_word_t z9 = aes_nohw_and(t44, y12); + aes_word_t z10 = aes_nohw_and(t37, y3); + aes_word_t z11 = aes_nohw_and(t33, y4); + aes_word_t z12 = aes_nohw_and(t43, y13); + aes_word_t z13 = aes_nohw_and(t40, y5); + aes_word_t z14 = aes_nohw_and(t29, y2); + aes_word_t z15 = aes_nohw_and(t42, y9); + aes_word_t z16 = aes_nohw_and(t45, y14); + aes_word_t z17 = aes_nohw_and(t41, y8); + + // Figure 4, bottom linear transformation. + aes_word_t t46 = aes_nohw_xor(z15, z16); + aes_word_t t47 = aes_nohw_xor(z10, z11); + aes_word_t t48 = aes_nohw_xor(z5, z13); + aes_word_t t49 = aes_nohw_xor(z9, z10); + aes_word_t t50 = aes_nohw_xor(z2, z12); + aes_word_t t51 = aes_nohw_xor(z2, z5); + aes_word_t t52 = aes_nohw_xor(z7, z8); + aes_word_t t53 = aes_nohw_xor(z0, z3); + aes_word_t t54 = aes_nohw_xor(z6, z7); + aes_word_t t55 = aes_nohw_xor(z16, z17); + aes_word_t t56 = aes_nohw_xor(z12, t48); + aes_word_t t57 = aes_nohw_xor(t50, t53); + aes_word_t t58 = aes_nohw_xor(z4, t46); + aes_word_t t59 = aes_nohw_xor(z3, t54); + aes_word_t t60 = aes_nohw_xor(t46, t57); + aes_word_t t61 = aes_nohw_xor(z14, t57); + aes_word_t t62 = aes_nohw_xor(t52, t58); + aes_word_t t63 = aes_nohw_xor(t49, t58); + aes_word_t t64 = aes_nohw_xor(z4, t59); + aes_word_t t65 = aes_nohw_xor(t61, t62); + aes_word_t t66 = aes_nohw_xor(z1, t63); + aes_word_t s0 = aes_nohw_xor(t59, t63); + aes_word_t s6 = aes_nohw_xor(t56, aes_nohw_not(t62)); + aes_word_t s7 = aes_nohw_xor(t48, aes_nohw_not(t60)); + aes_word_t t67 = aes_nohw_xor(t64, t65); + aes_word_t s3 = aes_nohw_xor(t53, t66); + aes_word_t s4 = aes_nohw_xor(t51, t66); + aes_word_t s5 = aes_nohw_xor(t47, t65); + aes_word_t s1 = aes_nohw_xor(t64, aes_nohw_not(s3)); + aes_word_t s2 = aes_nohw_xor(t55, aes_nohw_not(t67)); + + batch->w[0] = s7; + batch->w[1] = s6; + batch->w[2] = s5; + batch->w[3] = s4; + batch->w[4] = s3; + batch->w[5] = s2; + batch->w[6] = s1; + batch->w[7] = s0; +} + +// aes_nohw_sub_bytes_inv_affine inverts the affine transform portion of the AES +// S-box, defined in FIPS PUB 197, section 5.1.1, step 2. +static void aes_nohw_sub_bytes_inv_affine(AES_NOHW_BATCH *batch) { + aes_word_t a0 = batch->w[0]; + aes_word_t a1 = batch->w[1]; + aes_word_t a2 = batch->w[2]; + aes_word_t a3 = batch->w[3]; + aes_word_t a4 = batch->w[4]; + aes_word_t a5 = batch->w[5]; + aes_word_t a6 = batch->w[6]; + aes_word_t a7 = batch->w[7]; + + // Apply the circulant [0 0 1 0 0 1 0 1]. This is the inverse of the circulant + // [1 0 0 0 1 1 1 1]. + aes_word_t b0 = aes_nohw_xor(a2, aes_nohw_xor(a5, a7)); + aes_word_t b1 = aes_nohw_xor(a3, aes_nohw_xor(a6, a0)); + aes_word_t b2 = aes_nohw_xor(a4, aes_nohw_xor(a7, a1)); + aes_word_t b3 = aes_nohw_xor(a5, aes_nohw_xor(a0, a2)); + aes_word_t b4 = aes_nohw_xor(a6, aes_nohw_xor(a1, a3)); + aes_word_t b5 = aes_nohw_xor(a7, aes_nohw_xor(a2, a4)); + aes_word_t b6 = aes_nohw_xor(a0, aes_nohw_xor(a3, a5)); + aes_word_t b7 = aes_nohw_xor(a1, aes_nohw_xor(a4, a6)); + + // XOR 0x05. Equivalently, we could XOR 0x63 before applying the circulant, + // but 0x05 has lower Hamming weight. (0x05 is the circulant applied to 0x63.) + batch->w[0] = aes_nohw_not(b0); + batch->w[1] = b1; + batch->w[2] = aes_nohw_not(b2); + batch->w[3] = b3; + batch->w[4] = b4; + batch->w[5] = b5; + batch->w[6] = b6; + batch->w[7] = b7; +} + +static void aes_nohw_inv_sub_bytes(AES_NOHW_BATCH *batch) { + // We implement the inverse S-box using the forwards implementation with the + // technique described in https://www.bearssl.org/constanttime.html#aes. + // + // The forwards S-box inverts its input and applies an affine transformation: + // S(x) = A(Inv(x)). Thus Inv(x) = InvA(S(x)). The inverse S-box is then: + // + // InvS(x) = Inv(InvA(x)). + // = InvA(S(InvA(x))) + aes_nohw_sub_bytes_inv_affine(batch); + aes_nohw_sub_bytes(batch); + aes_nohw_sub_bytes_inv_affine(batch); +} + +// aes_nohw_rotate_cols_right returns |v| with the columns in each row rotated +// to the right by |n|. This is a macro because |aes_nohw_shift_*| require +// constant shift counts in the SSE2 implementation. +#define aes_nohw_rotate_cols_right(/* aes_word_t */ v, /* const */ n) \ + (aes_nohw_or(aes_nohw_shift_right((v), (n)*4), \ + aes_nohw_shift_left((v), 16 - (n)*4))) + +static void aes_nohw_shift_rows(AES_NOHW_BATCH *batch) { + for (size_t i = 0; i < 8; i++) { + aes_word_t row0 = aes_nohw_and(batch->w[i], AES_NOHW_ROW0_MASK); + aes_word_t row1 = aes_nohw_and(batch->w[i], AES_NOHW_ROW1_MASK); + aes_word_t row2 = aes_nohw_and(batch->w[i], AES_NOHW_ROW2_MASK); + aes_word_t row3 = aes_nohw_and(batch->w[i], AES_NOHW_ROW3_MASK); + row1 = aes_nohw_rotate_cols_right(row1, 1); + row2 = aes_nohw_rotate_cols_right(row2, 2); + row3 = aes_nohw_rotate_cols_right(row3, 3); + batch->w[i] = aes_nohw_or(aes_nohw_or(row0, row1), aes_nohw_or(row2, row3)); + } +} + +static void aes_nohw_inv_shift_rows(AES_NOHW_BATCH *batch) { + for (size_t i = 0; i < 8; i++) { + aes_word_t row0 = aes_nohw_and(batch->w[i], AES_NOHW_ROW0_MASK); + aes_word_t row1 = aes_nohw_and(batch->w[i], AES_NOHW_ROW1_MASK); + aes_word_t row2 = aes_nohw_and(batch->w[i], AES_NOHW_ROW2_MASK); + aes_word_t row3 = aes_nohw_and(batch->w[i], AES_NOHW_ROW3_MASK); + row1 = aes_nohw_rotate_cols_right(row1, 3); + row2 = aes_nohw_rotate_cols_right(row2, 2); + row3 = aes_nohw_rotate_cols_right(row3, 1); + batch->w[i] = aes_nohw_or(aes_nohw_or(row0, row1), aes_nohw_or(row2, row3)); + } +} + +// aes_nohw_rotate_rows_down returns |v| with the rows in each column rotated +// down by one. +static inline aes_word_t aes_nohw_rotate_rows_down(aes_word_t v) { +#if defined(OPENSSL_SSE2) + return _mm_or_si128(_mm_srli_epi32(v, 8), _mm_slli_epi32(v, 24)); +#elif defined(OPENSSL_64_BIT) + return ((v >> 4) & UINT64_C(0x0fff0fff0fff0fff)) | + ((v << 12) & UINT64_C(0xf000f000f000f000)); +#else + return ((v >> 2) & 0x3f3f3f3f) | ((v << 6) & 0xc0c0c0c0); +#endif +} + +// aes_nohw_rotate_rows_twice returns |v| with the rows in each column rotated +// by two. +static inline aes_word_t aes_nohw_rotate_rows_twice(aes_word_t v) { +#if defined(OPENSSL_SSE2) + return _mm_or_si128(_mm_srli_epi32(v, 16), _mm_slli_epi32(v, 16)); +#elif defined(OPENSSL_64_BIT) + return ((v >> 8) & UINT64_C(0x00ff00ff00ff00ff)) | + ((v << 8) & UINT64_C(0xff00ff00ff00ff00)); +#else + return ((v >> 4) & 0x0f0f0f0f) | ((v << 4) & 0xf0f0f0f0); +#endif +} + +static void aes_nohw_mix_columns(AES_NOHW_BATCH *batch) { + // See https://eprint.iacr.org/2009/129.pdf, section 4.4 and appendix A. + aes_word_t a0 = batch->w[0]; + aes_word_t a1 = batch->w[1]; + aes_word_t a2 = batch->w[2]; + aes_word_t a3 = batch->w[3]; + aes_word_t a4 = batch->w[4]; + aes_word_t a5 = batch->w[5]; + aes_word_t a6 = batch->w[6]; + aes_word_t a7 = batch->w[7]; + + aes_word_t r0 = aes_nohw_rotate_rows_down(a0); + aes_word_t a0_r0 = aes_nohw_xor(a0, r0); + aes_word_t r1 = aes_nohw_rotate_rows_down(a1); + aes_word_t a1_r1 = aes_nohw_xor(a1, r1); + aes_word_t r2 = aes_nohw_rotate_rows_down(a2); + aes_word_t a2_r2 = aes_nohw_xor(a2, r2); + aes_word_t r3 = aes_nohw_rotate_rows_down(a3); + aes_word_t a3_r3 = aes_nohw_xor(a3, r3); + aes_word_t r4 = aes_nohw_rotate_rows_down(a4); + aes_word_t a4_r4 = aes_nohw_xor(a4, r4); + aes_word_t r5 = aes_nohw_rotate_rows_down(a5); + aes_word_t a5_r5 = aes_nohw_xor(a5, r5); + aes_word_t r6 = aes_nohw_rotate_rows_down(a6); + aes_word_t a6_r6 = aes_nohw_xor(a6, r6); + aes_word_t r7 = aes_nohw_rotate_rows_down(a7); + aes_word_t a7_r7 = aes_nohw_xor(a7, r7); + + batch->w[0] = + aes_nohw_xor(aes_nohw_xor(a7_r7, r0), aes_nohw_rotate_rows_twice(a0_r0)); + batch->w[1] = + aes_nohw_xor(aes_nohw_xor(a0_r0, a7_r7), + aes_nohw_xor(r1, aes_nohw_rotate_rows_twice(a1_r1))); + batch->w[2] = + aes_nohw_xor(aes_nohw_xor(a1_r1, r2), aes_nohw_rotate_rows_twice(a2_r2)); + batch->w[3] = + aes_nohw_xor(aes_nohw_xor(a2_r2, a7_r7), + aes_nohw_xor(r3, aes_nohw_rotate_rows_twice(a3_r3))); + batch->w[4] = + aes_nohw_xor(aes_nohw_xor(a3_r3, a7_r7), + aes_nohw_xor(r4, aes_nohw_rotate_rows_twice(a4_r4))); + batch->w[5] = + aes_nohw_xor(aes_nohw_xor(a4_r4, r5), aes_nohw_rotate_rows_twice(a5_r5)); + batch->w[6] = + aes_nohw_xor(aes_nohw_xor(a5_r5, r6), aes_nohw_rotate_rows_twice(a6_r6)); + batch->w[7] = + aes_nohw_xor(aes_nohw_xor(a6_r6, r7), aes_nohw_rotate_rows_twice(a7_r7)); +} + +static void aes_nohw_inv_mix_columns(AES_NOHW_BATCH *batch) { + aes_word_t a0 = batch->w[0]; + aes_word_t a1 = batch->w[1]; + aes_word_t a2 = batch->w[2]; + aes_word_t a3 = batch->w[3]; + aes_word_t a4 = batch->w[4]; + aes_word_t a5 = batch->w[5]; + aes_word_t a6 = batch->w[6]; + aes_word_t a7 = batch->w[7]; + + // bsaes-x86_64.pl describes the following decomposition of the inverse + // MixColumns matrix, credited to Jussi Kivilinna. This gives a much simpler + // multiplication. + // + // | 0e 0b 0d 09 | | 02 03 01 01 | | 05 00 04 00 | + // | 09 0e 0b 0d | = | 01 02 03 01 | x | 00 05 00 04 | + // | 0d 09 0e 0b | | 01 01 02 03 | | 04 00 05 00 | + // | 0b 0d 09 0e | | 03 01 01 02 | | 00 04 00 05 | + // + // First, apply the [5 0 4 0] matrix. Multiplying by 4 in F_(2^8) is described + // by the following bit equations: + // + // b0 = a6 + // b1 = a6 ^ a7 + // b2 = a0 ^ a7 + // b3 = a1 ^ a6 + // b4 = a2 ^ a6 ^ a7 + // b5 = a3 ^ a7 + // b6 = a4 + // b7 = a5 + // + // Each coefficient is given by: + // + // b_ij = 05·a_ij ⊕ 04·a_i(j+2) = 04·(a_ij ⊕ a_i(j+2)) ⊕ a_ij + // + // We combine the two equations below. Note a_i(j+2) is a row rotation. + aes_word_t a0_r0 = aes_nohw_xor(a0, aes_nohw_rotate_rows_twice(a0)); + aes_word_t a1_r1 = aes_nohw_xor(a1, aes_nohw_rotate_rows_twice(a1)); + aes_word_t a2_r2 = aes_nohw_xor(a2, aes_nohw_rotate_rows_twice(a2)); + aes_word_t a3_r3 = aes_nohw_xor(a3, aes_nohw_rotate_rows_twice(a3)); + aes_word_t a4_r4 = aes_nohw_xor(a4, aes_nohw_rotate_rows_twice(a4)); + aes_word_t a5_r5 = aes_nohw_xor(a5, aes_nohw_rotate_rows_twice(a5)); + aes_word_t a6_r6 = aes_nohw_xor(a6, aes_nohw_rotate_rows_twice(a6)); + aes_word_t a7_r7 = aes_nohw_xor(a7, aes_nohw_rotate_rows_twice(a7)); + + batch->w[0] = aes_nohw_xor(a0, a6_r6); + batch->w[1] = aes_nohw_xor(a1, aes_nohw_xor(a6_r6, a7_r7)); + batch->w[2] = aes_nohw_xor(a2, aes_nohw_xor(a0_r0, a7_r7)); + batch->w[3] = aes_nohw_xor(a3, aes_nohw_xor(a1_r1, a6_r6)); + batch->w[4] = + aes_nohw_xor(aes_nohw_xor(a4, a2_r2), aes_nohw_xor(a6_r6, a7_r7)); + batch->w[5] = aes_nohw_xor(a5, aes_nohw_xor(a3_r3, a7_r7)); + batch->w[6] = aes_nohw_xor(a6, a4_r4); + batch->w[7] = aes_nohw_xor(a7, a5_r5); + + // Apply the [02 03 01 01] matrix, which is just MixColumns. + aes_nohw_mix_columns(batch); +} + +static void aes_nohw_encrypt_batch(const AES_NOHW_SCHEDULE *key, + size_t num_rounds, AES_NOHW_BATCH *batch) { + aes_nohw_add_round_key(batch, &key->keys[0]); + for (size_t i = 1; i < num_rounds; i++) { + aes_nohw_sub_bytes(batch); + aes_nohw_shift_rows(batch); + aes_nohw_mix_columns(batch); + aes_nohw_add_round_key(batch, &key->keys[i]); + } + aes_nohw_sub_bytes(batch); + aes_nohw_shift_rows(batch); + aes_nohw_add_round_key(batch, &key->keys[num_rounds]); +} + +static void aes_nohw_decrypt_batch(const AES_NOHW_SCHEDULE *key, + size_t num_rounds, AES_NOHW_BATCH *batch) { + aes_nohw_add_round_key(batch, &key->keys[num_rounds]); + aes_nohw_inv_shift_rows(batch); + aes_nohw_inv_sub_bytes(batch); + for (size_t i = num_rounds - 1; i > 0; i--) { + aes_nohw_add_round_key(batch, &key->keys[i]); + aes_nohw_inv_mix_columns(batch); + aes_nohw_inv_shift_rows(batch); + aes_nohw_inv_sub_bytes(batch); + } + aes_nohw_add_round_key(batch, &key->keys[0]); +} + + +// Key schedule. + +static void aes_nohw_expand_round_keys(AES_NOHW_SCHEDULE *out, + const AES_KEY *key) { + for (size_t i = 0; i <= key->rounds; i++) { + // Copy the round key into each block in the batch. + for (size_t j = 0; j < AES_NOHW_BATCH_SIZE; j++) { + aes_word_t tmp[AES_NOHW_BLOCK_WORDS]; + memcpy(tmp, key->rd_key + 4 * i, 16); + aes_nohw_batch_set(&out->keys[i], tmp, j); + } + aes_nohw_transpose(&out->keys[i]); + } +} + +static const uint8_t aes_nohw_rcon[10] = {0x01, 0x02, 0x04, 0x08, 0x10, + 0x20, 0x40, 0x80, 0x1b, 0x36}; + +// aes_nohw_rcon_slice returns the |i|th group of |AES_NOHW_BATCH_SIZE| bits in +// |rcon|, stored in a |aes_word_t|. +static inline aes_word_t aes_nohw_rcon_slice(uint8_t rcon, size_t i) { + rcon = (rcon >> (i * AES_NOHW_BATCH_SIZE)) & ((1 << AES_NOHW_BATCH_SIZE) - 1); +#if defined(OPENSSL_SSE2) + return _mm_set_epi32(0, 0, 0, rcon); +#else + return ((aes_word_t)rcon); +#endif +} + +static void aes_nohw_sub_block(aes_word_t out[AES_NOHW_BLOCK_WORDS], + const aes_word_t in[AES_NOHW_BLOCK_WORDS]) { + AES_NOHW_BATCH batch; + memset(&batch, 0, sizeof(batch)); + aes_nohw_batch_set(&batch, in, 0); + aes_nohw_transpose(&batch); + aes_nohw_sub_bytes(&batch); + aes_nohw_transpose(&batch); + aes_nohw_batch_get(&batch, out, 0); +} + +static void aes_nohw_setup_key_128(AES_KEY *key, const uint8_t in[16]) { + key->rounds = 10; + + aes_word_t block[AES_NOHW_BLOCK_WORDS]; + aes_nohw_compact_block(block, in); + memcpy(key->rd_key, block, 16); + + for (size_t i = 1; i <= 10; i++) { + aes_word_t sub[AES_NOHW_BLOCK_WORDS]; + aes_nohw_sub_block(sub, block); + uint8_t rcon = aes_nohw_rcon[i - 1]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Incorporate |rcon| and the transformed word into the first word. + block[j] = aes_nohw_xor(block[j], aes_nohw_rcon_slice(rcon, j)); + block[j] = aes_nohw_xor( + block[j], + aes_nohw_shift_right(aes_nohw_rotate_rows_down(sub[j]), 12)); + // Propagate to the remaining words. Note this is reordered from the usual + // formulation to avoid needing masks. + aes_word_t v = block[j]; + block[j] = aes_nohw_xor(block[j], aes_nohw_shift_left(v, 4)); + block[j] = aes_nohw_xor(block[j], aes_nohw_shift_left(v, 8)); + block[j] = aes_nohw_xor(block[j], aes_nohw_shift_left(v, 12)); + } + memcpy(key->rd_key + 4 * i, block, 16); + } +} + +static void aes_nohw_setup_key_192(AES_KEY *key, const uint8_t in[24]) { + key->rounds = 12; + + aes_word_t storage1[AES_NOHW_BLOCK_WORDS], storage2[AES_NOHW_BLOCK_WORDS]; + aes_word_t *block1 = storage1, *block2 = storage2; + + // AES-192's key schedule is complex because each key schedule iteration + // produces six words, but we compute on blocks and each block is four words. + // We maintain a sliding window of two blocks, filled to 1.5 blocks at a time. + // We loop below every three blocks or two key schedule iterations. + // + // On entry to the loop, |block1| and the first half of |block2| contain the + // previous key schedule iteration. |block1| has been written to |key|, but + // |block2| has not as it is incomplete. + aes_nohw_compact_block(block1, in); + memcpy(key->rd_key, block1, 16); + + uint8_t half_block[16] = {0}; + memcpy(half_block, in + 16, 8); + aes_nohw_compact_block(block2, half_block); + + for (size_t i = 0; i < 4; i++) { + aes_word_t sub[AES_NOHW_BLOCK_WORDS]; + aes_nohw_sub_block(sub, block2); + uint8_t rcon = aes_nohw_rcon[2 * i]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Compute the first two words of the next key schedule iteration, which + // go in the second half of |block2|. The first two words of the previous + // iteration are in the first half of |block1|. Apply |rcon| here too + // because the shifts match. + block2[j] = aes_nohw_or( + block2[j], + aes_nohw_shift_left( + aes_nohw_xor(block1[j], aes_nohw_rcon_slice(rcon, j)), 8)); + // Incorporate the transformed word and propagate. Note the last word of + // the previous iteration corresponds to the second word of |copy|. This + // is incorporated into the first word of the next iteration, or the third + // word of |block2|. + block2[j] = aes_nohw_xor( + block2[j], aes_nohw_and(aes_nohw_shift_left( + aes_nohw_rotate_rows_down(sub[j]), 4), + AES_NOHW_COL2_MASK)); + block2[j] = aes_nohw_xor( + block2[j], + aes_nohw_and(aes_nohw_shift_left(block2[j], 4), AES_NOHW_COL3_MASK)); + + // Compute the remaining four words, which fill |block1|. Begin by moving + // the corresponding words of the previous iteration: the second half of + // |block1| and the first half of |block2|. + block1[j] = aes_nohw_shift_right(block1[j], 8); + block1[j] = aes_nohw_or(block1[j], aes_nohw_shift_left(block2[j], 8)); + // Incorporate the second word, computed previously in |block2|, and + // propagate. + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_right(block2[j], 12)); + aes_word_t v = block1[j]; + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 4)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 8)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 12)); + } + + // This completes two round keys. Note half of |block2| was computed in the + // previous loop iteration but was not yet output. + memcpy(key->rd_key + 4 * (3 * i + 1), block2, 16); + memcpy(key->rd_key + 4 * (3 * i + 2), block1, 16); + + aes_nohw_sub_block(sub, block1); + rcon = aes_nohw_rcon[2 * i + 1]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Compute the first four words of the next key schedule iteration in + // |block2|. Begin by moving the corresponding words of the previous + // iteration: the second half of |block2| and the first half of |block1|. + block2[j] = aes_nohw_shift_right(block2[j], 8); + block2[j] = aes_nohw_or(block2[j], aes_nohw_shift_left(block1[j], 8)); + // Incorporate rcon and the transformed word. Note the last word of the + // previous iteration corresponds to the last word of |copy|. + block2[j] = aes_nohw_xor(block2[j], aes_nohw_rcon_slice(rcon, j)); + block2[j] = aes_nohw_xor( + block2[j], + aes_nohw_shift_right(aes_nohw_rotate_rows_down(sub[j]), 12)); + // Propagate to the remaining words. + aes_word_t v = block2[j]; + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 4)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 8)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 12)); + + // Compute the last two words, which go in the first half of |block1|. The + // last two words of the previous iteration are in the second half of + // |block1|. + block1[j] = aes_nohw_shift_right(block1[j], 8); + // Propagate blocks and mask off the excess. + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_right(block2[j], 12)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(block1[j], 4)); + block1[j] = aes_nohw_and(block1[j], AES_NOHW_COL01_MASK); + } + + // |block2| has a complete round key. |block1| will be completed in the next + // iteration. + memcpy(key->rd_key + 4 * (3 * i + 3), block2, 16); + + // Swap blocks to restore the invariant. + aes_word_t *tmp = block1; + block1 = block2; + block2 = tmp; + } +} + +static void aes_nohw_setup_key_256(AES_KEY *key, const uint8_t in[32]) { + key->rounds = 14; + + // Each key schedule iteration produces two round keys. + aes_word_t block1[AES_NOHW_BLOCK_WORDS], block2[AES_NOHW_BLOCK_WORDS]; + aes_nohw_compact_block(block1, in); + memcpy(key->rd_key, block1, 16); + + aes_nohw_compact_block(block2, in + 16); + memcpy(key->rd_key + 4, block2, 16); + + for (size_t i = 2; i <= 14; i += 2) { + aes_word_t sub[AES_NOHW_BLOCK_WORDS]; + aes_nohw_sub_block(sub, block2); + uint8_t rcon = aes_nohw_rcon[i / 2 - 1]; + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Incorporate |rcon| and the transformed word into the first word. + block1[j] = aes_nohw_xor(block1[j], aes_nohw_rcon_slice(rcon, j)); + block1[j] = aes_nohw_xor( + block1[j], + aes_nohw_shift_right(aes_nohw_rotate_rows_down(sub[j]), 12)); + // Propagate to the remaining words. + aes_word_t v = block1[j]; + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 4)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 8)); + block1[j] = aes_nohw_xor(block1[j], aes_nohw_shift_left(v, 12)); + } + memcpy(key->rd_key + 4 * i, block1, 16); + + if (i == 14) { + break; + } + + aes_nohw_sub_block(sub, block1); + for (size_t j = 0; j < AES_NOHW_BLOCK_WORDS; j++) { + // Incorporate the transformed word into the first word. + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_right(sub[j], 12)); + // Propagate to the remaining words. + aes_word_t v = block2[j]; + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 4)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 8)); + block2[j] = aes_nohw_xor(block2[j], aes_nohw_shift_left(v, 12)); + } + memcpy(key->rd_key + 4 * (i + 1), block2, 16); + } +} + + +// External API. + +int aes_nohw_set_encrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey) { + switch (bits) { + case 128: + aes_nohw_setup_key_128(aeskey, key); + return 0; + case 192: + aes_nohw_setup_key_192(aeskey, key); + return 0; + case 256: + aes_nohw_setup_key_256(aeskey, key); + return 0; + } + return 1; +} + +int aes_nohw_set_decrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey) { + return aes_nohw_set_encrypt_key(key, bits, aeskey); +} + +void aes_nohw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, in, /*num_blocks=*/1); + aes_nohw_encrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, /*num_blocks=*/1, &batch); +} + +void aes_nohw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key) { + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, in, /*num_blocks=*/1); + aes_nohw_decrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, /*num_blocks=*/1, &batch); +} + +static inline void aes_nohw_xor_block(uint8_t out[16], const uint8_t a[16], + const uint8_t b[16]) { + for (size_t i = 0; i < 16; i += sizeof(aes_word_t)) { + aes_word_t x, y; + memcpy(&x, a + i, sizeof(aes_word_t)); + memcpy(&y, b + i, sizeof(aes_word_t)); + x = aes_nohw_xor(x, y); + memcpy(out + i, &x, sizeof(aes_word_t)); + } +} + +void aes_nohw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t blocks, const AES_KEY *key, + const uint8_t ivec[16]) { + if (blocks == 0) { + return; + } + + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + + // Make |AES_NOHW_BATCH_SIZE| copies of |ivec|. + alignas(AES_NOHW_WORD_SIZE) union { + uint32_t u32[AES_NOHW_BATCH_SIZE * 4]; + uint8_t u8[AES_NOHW_BATCH_SIZE * 16]; + } ivs, enc_ivs; + for (size_t i = 0; i < AES_NOHW_BATCH_SIZE; i++) { + memcpy(ivs.u8 + 16 * i, ivec, 16); + } + + uint32_t ctr = CRYPTO_bswap4(ivs.u32[3]); + for (;;) { + // Update counters. + for (size_t i = 0; i < AES_NOHW_BATCH_SIZE; i++) { + ivs.u32[4 * i + 3] = CRYPTO_bswap4(ctr + i); + } + + size_t todo = blocks >= AES_NOHW_BATCH_SIZE ? AES_NOHW_BATCH_SIZE : blocks; + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, ivs.u8, todo); + aes_nohw_encrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(enc_ivs.u8, todo, &batch); + + for (size_t i = 0; i < todo; i++) { + aes_nohw_xor_block(out + 16 * i, in + 16 * i, enc_ivs.u8 + 16 * i); + } + + blocks -= todo; + if (blocks == 0) { + break; + } + + in += 16 * AES_NOHW_BATCH_SIZE; + out += 16 * AES_NOHW_BATCH_SIZE; + ctr += AES_NOHW_BATCH_SIZE; + } +} + +void aes_nohw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t *ivec, const int enc) { + assert(len % 16 == 0); + size_t blocks = len / 16; + if (blocks == 0) { + return; + } + + AES_NOHW_SCHEDULE sched; + aes_nohw_expand_round_keys(&sched, key); + alignas(AES_NOHW_WORD_SIZE) uint8_t iv[16]; + memcpy(iv, ivec, 16); + + if (enc) { + // CBC encryption is not parallelizable. + while (blocks > 0) { + aes_nohw_xor_block(iv, iv, in); + + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, iv, /*num_blocks=*/1); + aes_nohw_encrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, /*num_blocks=*/1, &batch); + + memcpy(iv, out, 16); + + in += 16; + out += 16; + blocks--; + } + memcpy(ivec, iv, 16); + return; + } + + for (;;) { + size_t todo = blocks >= AES_NOHW_BATCH_SIZE ? AES_NOHW_BATCH_SIZE : blocks; + // Make a copy of the input so we can decrypt in-place. + alignas(AES_NOHW_WORD_SIZE) uint8_t copy[AES_NOHW_BATCH_SIZE * 16]; + memcpy(copy, in, todo * 16); + + AES_NOHW_BATCH batch; + aes_nohw_to_batch(&batch, in, todo); + aes_nohw_decrypt_batch(&sched, key->rounds, &batch); + aes_nohw_from_batch(out, todo, &batch); + + aes_nohw_xor_block(out, out, iv); + for (size_t i = 1; i < todo; i++) { + aes_nohw_xor_block(out + 16 * i, out + 16 * i, copy + 16 * (i - 1)); + } + + // Save the last block as the IV. + memcpy(iv, copy + 16 * (todo - 1), 16); + + blocks -= todo; + if (blocks == 0) { + break; + } + + in += 16 * AES_NOHW_BATCH_SIZE; + out += 16 * AES_NOHW_BATCH_SIZE; + } + + memcpy(ivec, iv, 16); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h new file mode 100644 index 000000000..2c20807de --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h @@ -0,0 +1,238 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_AES_INTERNAL_H +#define OPENSSL_HEADER_AES_INTERNAL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_NO_ASM) + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +#define HWAES +#define HWAES_ECB + +OPENSSL_INLINE int hwaes_capable(void) { + return (OPENSSL_ia32cap_get()[1] & (1 << (57 - 32))) != 0; +} + +#define VPAES +#if defined(OPENSSL_X86_64) +#define VPAES_CTR32 +#endif +#define VPAES_CBC +OPENSSL_INLINE int vpaes_capable(void) { + return (OPENSSL_ia32cap_get()[1] & (1 << (41 - 32))) != 0; +} + +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) +#define HWAES + +OPENSSL_INLINE int hwaes_capable(void) { return CRYPTO_is_ARMv8_AES_capable(); } + +#if defined(OPENSSL_ARM) +#define BSAES +#define VPAES +#define VPAES_CTR32 +OPENSSL_INLINE int bsaes_capable(void) { return CRYPTO_is_NEON_capable(); } +OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); } +#endif + +#if defined(OPENSSL_AARCH64) +#define VPAES +#define VPAES_CBC +#define VPAES_CTR32 +OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); } +#endif + +#elif defined(OPENSSL_PPC64LE) +#define HWAES + +OPENSSL_INLINE int hwaes_capable(void) { + return CRYPTO_is_PPC64LE_vcrypto_capable(); +} +#endif + +#endif // !NO_ASM + + +#if defined(HWAES) + +int aes_hw_set_encrypt_key(const uint8_t *user_key, const int bits, + AES_KEY *key); +int aes_hw_set_decrypt_key(const uint8_t *user_key, const int bits, + AES_KEY *key); +void aes_hw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_hw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, uint8_t *ivec, const int enc); +void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, const uint8_t ivec[16]); + +#else + +// If HWAES isn't defined then we provide dummy functions for each of the hwaes +// functions. +OPENSSL_INLINE int hwaes_capable(void) { return 0; } + +OPENSSL_INLINE int aes_hw_set_encrypt_key(const uint8_t *user_key, int bits, + AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE int aes_hw_set_decrypt_key(const uint8_t *user_key, int bits, + AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE void aes_hw_encrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE void aes_hw_decrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const AES_KEY *key, + uint8_t *ivec, int enc) { + abort(); +} + +OPENSSL_INLINE void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + const uint8_t ivec[16]) { + abort(); +} + +#endif // !HWAES + + +#if defined(HWAES_ECB) +void aes_hw_ecb_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, const int enc); +#endif // HWAES_ECB + + +#if defined(BSAES) +// Note |bsaes_cbc_encrypt| requires |enc| to be zero. +void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, uint8_t ivec[16], int enc); +void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, const uint8_t ivec[16]); +// VPAES to BSAES conversions are available on all BSAES platforms. +void vpaes_encrypt_key_to_bsaes(AES_KEY *out_bsaes, const AES_KEY *vpaes); +void vpaes_decrypt_key_to_bsaes(AES_KEY *out_bsaes, const AES_KEY *vpaes); +#else +OPENSSL_INLINE char bsaes_capable(void) { return 0; } + +// On other platforms, bsaes_capable() will always return false and so the +// following will never be called. +OPENSSL_INLINE void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const AES_KEY *key, + uint8_t ivec[16], int enc) { + abort(); +} + +OPENSSL_INLINE void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + const uint8_t ivec[16]) { + abort(); +} + +OPENSSL_INLINE void vpaes_encrypt_key_to_bsaes(AES_KEY *out_bsaes, + const AES_KEY *vpaes) { + abort(); +} + +OPENSSL_INLINE void vpaes_decrypt_key_to_bsaes(AES_KEY *out_bsaes, + const AES_KEY *vpaes) { + abort(); +} +#endif // !BSAES + + +#if defined(VPAES) +// On platforms where VPAES gets defined (just above), then these functions are +// provided by asm. +int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); +int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); + +void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); + +#if defined(VPAES_CBC) +void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, uint8_t *ivec, int enc); +#endif +#if defined(VPAES_CTR32) +void vpaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, const uint8_t ivec[16]); +#endif +#else +OPENSSL_INLINE char vpaes_capable(void) { return 0; } + +// On other platforms, vpaes_capable() will always return false and so the +// following will never be called. +OPENSSL_INLINE int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, + AES_KEY *key) { + abort(); +} +OPENSSL_INLINE int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, + AES_KEY *key) { + abort(); +} +OPENSSL_INLINE void vpaes_encrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} +OPENSSL_INLINE void vpaes_decrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} +OPENSSL_INLINE void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const AES_KEY *key, + uint8_t *ivec, int enc) { + abort(); +} +#endif // !VPAES + + +int aes_nohw_set_encrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey); +int aes_nohw_set_decrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey); +void aes_nohw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_nohw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_nohw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t blocks, const AES_KEY *key, + const uint8_t ivec[16]); +void aes_nohw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t *ivec, const int enc); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_AES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h.grpc_back new file mode 100644 index 000000000..5b8069550 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/internal.h.grpc_back @@ -0,0 +1,238 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_AES_INTERNAL_H +#define OPENSSL_HEADER_AES_INTERNAL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_NO_ASM) + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +#define HWAES +#define HWAES_ECB + +OPENSSL_INLINE int hwaes_capable(void) { + return (OPENSSL_ia32cap_get()[1] & (1 << (57 - 32))) != 0; +} + +#define VPAES +#if defined(OPENSSL_X86_64) +#define VPAES_CTR32 +#endif +#define VPAES_CBC +OPENSSL_INLINE int vpaes_capable(void) { + return (OPENSSL_ia32cap_get()[1] & (1 << (41 - 32))) != 0; +} + +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) +#define HWAES + +OPENSSL_INLINE int hwaes_capable(void) { return CRYPTO_is_ARMv8_AES_capable(); } + +#if defined(OPENSSL_ARM) +#define BSAES +#define VPAES +#define VPAES_CTR32 +OPENSSL_INLINE int bsaes_capable(void) { return CRYPTO_is_NEON_capable(); } +OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); } +#endif + +#if defined(OPENSSL_AARCH64) +#define VPAES +#define VPAES_CBC +#define VPAES_CTR32 +OPENSSL_INLINE int vpaes_capable(void) { return CRYPTO_is_NEON_capable(); } +#endif + +#elif defined(OPENSSL_PPC64LE) +#define HWAES + +OPENSSL_INLINE int hwaes_capable(void) { + return CRYPTO_is_PPC64LE_vcrypto_capable(); +} +#endif + +#endif // !NO_ASM + + +#if defined(HWAES) + +int aes_hw_set_encrypt_key(const uint8_t *user_key, const int bits, + AES_KEY *key); +int aes_hw_set_decrypt_key(const uint8_t *user_key, const int bits, + AES_KEY *key); +void aes_hw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_hw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, uint8_t *ivec, const int enc); +void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, const uint8_t ivec[16]); + +#else + +// If HWAES isn't defined then we provide dummy functions for each of the hwaes +// functions. +OPENSSL_INLINE int hwaes_capable(void) { return 0; } + +OPENSSL_INLINE int aes_hw_set_encrypt_key(const uint8_t *user_key, int bits, + AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE int aes_hw_set_decrypt_key(const uint8_t *user_key, int bits, + AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE void aes_hw_encrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE void aes_hw_decrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} + +OPENSSL_INLINE void aes_hw_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const AES_KEY *key, + uint8_t *ivec, int enc) { + abort(); +} + +OPENSSL_INLINE void aes_hw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + const uint8_t ivec[16]) { + abort(); +} + +#endif // !HWAES + + +#if defined(HWAES_ECB) +void aes_hw_ecb_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, const int enc); +#endif // HWAES_ECB + + +#if defined(BSAES) +// Note |bsaes_cbc_encrypt| requires |enc| to be zero. +void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, uint8_t ivec[16], int enc); +void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, const uint8_t ivec[16]); +// VPAES to BSAES conversions are available on all BSAES platforms. +void vpaes_encrypt_key_to_bsaes(AES_KEY *out_bsaes, const AES_KEY *vpaes); +void vpaes_decrypt_key_to_bsaes(AES_KEY *out_bsaes, const AES_KEY *vpaes); +#else +OPENSSL_INLINE char bsaes_capable(void) { return 0; } + +// On other platforms, bsaes_capable() will always return false and so the +// following will never be called. +OPENSSL_INLINE void bsaes_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const AES_KEY *key, + uint8_t ivec[16], int enc) { + abort(); +} + +OPENSSL_INLINE void bsaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + const uint8_t ivec[16]) { + abort(); +} + +OPENSSL_INLINE void vpaes_encrypt_key_to_bsaes(AES_KEY *out_bsaes, + const AES_KEY *vpaes) { + abort(); +} + +OPENSSL_INLINE void vpaes_decrypt_key_to_bsaes(AES_KEY *out_bsaes, + const AES_KEY *vpaes) { + abort(); +} +#endif // !BSAES + + +#if defined(VPAES) +// On platforms where VPAES gets defined (just above), then these functions are +// provided by asm. +int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); +int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, AES_KEY *key); + +void vpaes_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void vpaes_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); + +#if defined(VPAES_CBC) +void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t length, + const AES_KEY *key, uint8_t *ivec, int enc); +#endif +#if defined(VPAES_CTR32) +void vpaes_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, const uint8_t ivec[16]); +#endif +#else +OPENSSL_INLINE char vpaes_capable(void) { return 0; } + +// On other platforms, vpaes_capable() will always return false and so the +// following will never be called. +OPENSSL_INLINE int vpaes_set_encrypt_key(const uint8_t *userKey, int bits, + AES_KEY *key) { + abort(); +} +OPENSSL_INLINE int vpaes_set_decrypt_key(const uint8_t *userKey, int bits, + AES_KEY *key) { + abort(); +} +OPENSSL_INLINE void vpaes_encrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} +OPENSSL_INLINE void vpaes_decrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key) { + abort(); +} +OPENSSL_INLINE void vpaes_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const AES_KEY *key, + uint8_t *ivec, int enc) { + abort(); +} +#endif // !VPAES + + +int aes_nohw_set_encrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey); +int aes_nohw_set_decrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey); +void aes_nohw_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_nohw_decrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key); +void aes_nohw_ctr32_encrypt_blocks(const uint8_t *in, uint8_t *out, + size_t blocks, const AES_KEY *key, + const uint8_t ivec[16]); +void aes_nohw_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t *ivec, const int enc); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_AES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c new file mode 100644 index 000000000..a0947bca2 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c @@ -0,0 +1,236 @@ +/* ==================================================================== + * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include +#include +#include + +#include + +#include "../../internal.h" + + +// kDefaultIV is the default IV value given in RFC 3394, 2.2.3.1. +static const uint8_t kDefaultIV[] = { + 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, +}; + +static const unsigned kBound = 6; + +int AES_wrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, + const uint8_t *in, size_t in_len) { + // See RFC 3394, section 2.2.1. Additionally, note that section 2 requires the + // plaintext be at least two 8-byte blocks. + + if (in_len > INT_MAX - 8 || in_len < 16 || in_len % 8 != 0) { + return -1; + } + + if (iv == NULL) { + iv = kDefaultIV; + } + + OPENSSL_memmove(out + 8, in, in_len); + uint8_t A[AES_BLOCK_SIZE]; + OPENSSL_memcpy(A, iv, 8); + + size_t n = in_len / 8; + + for (unsigned j = 0; j < kBound; j++) { + for (size_t i = 1; i <= n; i++) { + OPENSSL_memcpy(A + 8, out + 8 * i, 8); + AES_encrypt(A, A, key); + + uint32_t t = (uint32_t)(n * j + i); + A[7] ^= t & 0xff; + A[6] ^= (t >> 8) & 0xff; + A[5] ^= (t >> 16) & 0xff; + A[4] ^= (t >> 24) & 0xff; + OPENSSL_memcpy(out + 8 * i, A + 8, 8); + } + } + + OPENSSL_memcpy(out, A, 8); + return (int)in_len + 8; +} + +// aes_unwrap_key_inner performs steps one and two from +// https://tools.ietf.org/html/rfc3394#section-2.2.2 +static int aes_unwrap_key_inner(const AES_KEY *key, uint8_t *out, + uint8_t out_iv[8], const uint8_t *in, + size_t in_len) { + // See RFC 3394, section 2.2.2. Additionally, note that section 2 requires the + // plaintext be at least two 8-byte blocks, so the ciphertext must be at least + // three blocks. + + if (in_len > INT_MAX || in_len < 24 || in_len % 8 != 0) { + return 0; + } + + uint8_t A[AES_BLOCK_SIZE]; + OPENSSL_memcpy(A, in, 8); + OPENSSL_memmove(out, in + 8, in_len - 8); + + size_t n = (in_len / 8) - 1; + + for (unsigned j = kBound - 1; j < kBound; j--) { + for (size_t i = n; i > 0; i--) { + uint32_t t = (uint32_t)(n * j + i); + A[7] ^= t & 0xff; + A[6] ^= (t >> 8) & 0xff; + A[5] ^= (t >> 16) & 0xff; + A[4] ^= (t >> 24) & 0xff; + OPENSSL_memcpy(A + 8, out + 8 * (i - 1), 8); + AES_decrypt(A, A, key); + OPENSSL_memcpy(out + 8 * (i - 1), A + 8, 8); + } + } + + memcpy(out_iv, A, 8); + return 1; +} + +int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, + const uint8_t *in, size_t in_len) { + uint8_t calculated_iv[8]; + if (!aes_unwrap_key_inner(key, out, calculated_iv, in, in_len)) { + return -1; + } + + if (iv == NULL) { + iv = kDefaultIV; + } + if (CRYPTO_memcmp(calculated_iv, iv, 8) != 0) { + return -1; + } + + return (int)in_len - 8; +} + +// kPaddingConstant is used in Key Wrap with Padding. See +// https://tools.ietf.org/html/rfc5649#section-3 +static const uint8_t kPaddingConstant[4] = {0xa6, 0x59, 0x59, 0xa6}; + +int AES_wrap_key_padded(const AES_KEY *key, uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *in, size_t in_len) { + // See https://tools.ietf.org/html/rfc5649#section-4.1 + const uint32_t in_len32_be = CRYPTO_bswap4(in_len); + const uint64_t in_len64 = in_len; + const size_t padded_len = (in_len + 7) & ~7; + + *out_len = 0; + if (in_len == 0 || in_len64 > 0xffffffffu || in_len + 7 < in_len || + padded_len + 8 < padded_len || max_out < padded_len + 8) { + return 0; + } + + uint8_t block[AES_BLOCK_SIZE]; + memcpy(block, kPaddingConstant, sizeof(kPaddingConstant)); + memcpy(block + 4, &in_len32_be, sizeof(in_len32_be)); + + if (in_len <= 8) { + memset(block + 8, 0, 8); + memcpy(block + 8, in, in_len); + AES_encrypt(block, out, key); + *out_len = AES_BLOCK_SIZE; + return 1; + } + + uint8_t *padded_in = OPENSSL_malloc(padded_len); + if (padded_in == NULL) { + return 0; + } + assert(padded_len >= 8); + memset(padded_in + padded_len - 8, 0, 8); + memcpy(padded_in, in, in_len); + const int ret = AES_wrap_key(key, block, out, padded_in, padded_len); + OPENSSL_free(padded_in); + if (ret < 0) { + return 0; + } + *out_len = ret; + return 1; +} + +int AES_unwrap_key_padded(const AES_KEY *key, uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *in, size_t in_len) { + *out_len = 0; + if (in_len < AES_BLOCK_SIZE || max_out < in_len - 8) { + return 0; + } + + uint8_t iv[8]; + if (in_len == AES_BLOCK_SIZE) { + uint8_t block[AES_BLOCK_SIZE]; + AES_decrypt(in, block, key); + memcpy(iv, block, sizeof(iv)); + memcpy(out, block + 8, 8); + } else if (!aes_unwrap_key_inner(key, out, iv, in, in_len)) { + return 0; + } + assert(in_len % 8 == 0); + + crypto_word_t ok = constant_time_eq_int( + CRYPTO_memcmp(iv, kPaddingConstant, sizeof(kPaddingConstant)), 0); + + uint32_t claimed_len32; + memcpy(&claimed_len32, iv + 4, sizeof(claimed_len32)); + const size_t claimed_len = CRYPTO_bswap4(claimed_len32); + ok &= ~constant_time_is_zero_w(claimed_len); + ok &= constant_time_eq_w((claimed_len - 1) >> 3, (in_len - 9) >> 3); + + // Check that padding bytes are all zero. + for (size_t i = in_len - 15; i < in_len - 8; i++) { + ok &= constant_time_is_zero_w(constant_time_ge_8(i, claimed_len) & out[i]); + } + + *out_len = constant_time_select_w(ok, claimed_len, 0); + return ok & 1; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c.grpc_back new file mode 100644 index 000000000..9a5b28da2 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/key_wrap.c.grpc_back @@ -0,0 +1,236 @@ +/* ==================================================================== + * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include +#include +#include + +#include + +#include "../../internal.h" + + +// kDefaultIV is the default IV value given in RFC 3394, 2.2.3.1. +static const uint8_t kDefaultIV[] = { + 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, 0xa6, +}; + +static const unsigned kBound = 6; + +int AES_wrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, + const uint8_t *in, size_t in_len) { + // See RFC 3394, section 2.2.1. Additionally, note that section 2 requires the + // plaintext be at least two 8-byte blocks. + + if (in_len > INT_MAX - 8 || in_len < 16 || in_len % 8 != 0) { + return -1; + } + + if (iv == NULL) { + iv = kDefaultIV; + } + + OPENSSL_memmove(out + 8, in, in_len); + uint8_t A[AES_BLOCK_SIZE]; + OPENSSL_memcpy(A, iv, 8); + + size_t n = in_len / 8; + + for (unsigned j = 0; j < kBound; j++) { + for (size_t i = 1; i <= n; i++) { + OPENSSL_memcpy(A + 8, out + 8 * i, 8); + AES_encrypt(A, A, key); + + uint32_t t = (uint32_t)(n * j + i); + A[7] ^= t & 0xff; + A[6] ^= (t >> 8) & 0xff; + A[5] ^= (t >> 16) & 0xff; + A[4] ^= (t >> 24) & 0xff; + OPENSSL_memcpy(out + 8 * i, A + 8, 8); + } + } + + OPENSSL_memcpy(out, A, 8); + return (int)in_len + 8; +} + +// aes_unwrap_key_inner performs steps one and two from +// https://tools.ietf.org/html/rfc3394#section-2.2.2 +static int aes_unwrap_key_inner(const AES_KEY *key, uint8_t *out, + uint8_t out_iv[8], const uint8_t *in, + size_t in_len) { + // See RFC 3394, section 2.2.2. Additionally, note that section 2 requires the + // plaintext be at least two 8-byte blocks, so the ciphertext must be at least + // three blocks. + + if (in_len > INT_MAX || in_len < 24 || in_len % 8 != 0) { + return 0; + } + + uint8_t A[AES_BLOCK_SIZE]; + OPENSSL_memcpy(A, in, 8); + OPENSSL_memmove(out, in + 8, in_len - 8); + + size_t n = (in_len / 8) - 1; + + for (unsigned j = kBound - 1; j < kBound; j--) { + for (size_t i = n; i > 0; i--) { + uint32_t t = (uint32_t)(n * j + i); + A[7] ^= t & 0xff; + A[6] ^= (t >> 8) & 0xff; + A[5] ^= (t >> 16) & 0xff; + A[4] ^= (t >> 24) & 0xff; + OPENSSL_memcpy(A + 8, out + 8 * (i - 1), 8); + AES_decrypt(A, A, key); + OPENSSL_memcpy(out + 8 * (i - 1), A + 8, 8); + } + } + + memcpy(out_iv, A, 8); + return 1; +} + +int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, uint8_t *out, + const uint8_t *in, size_t in_len) { + uint8_t calculated_iv[8]; + if (!aes_unwrap_key_inner(key, out, calculated_iv, in, in_len)) { + return -1; + } + + if (iv == NULL) { + iv = kDefaultIV; + } + if (CRYPTO_memcmp(calculated_iv, iv, 8) != 0) { + return -1; + } + + return (int)in_len - 8; +} + +// kPaddingConstant is used in Key Wrap with Padding. See +// https://tools.ietf.org/html/rfc5649#section-3 +static const uint8_t kPaddingConstant[4] = {0xa6, 0x59, 0x59, 0xa6}; + +int AES_wrap_key_padded(const AES_KEY *key, uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *in, size_t in_len) { + // See https://tools.ietf.org/html/rfc5649#section-4.1 + const uint32_t in_len32_be = CRYPTO_bswap4(in_len); + const uint64_t in_len64 = in_len; + const size_t padded_len = (in_len + 7) & ~7; + + *out_len = 0; + if (in_len == 0 || in_len64 > 0xffffffffu || in_len + 7 < in_len || + padded_len + 8 < padded_len || max_out < padded_len + 8) { + return 0; + } + + uint8_t block[AES_BLOCK_SIZE]; + memcpy(block, kPaddingConstant, sizeof(kPaddingConstant)); + memcpy(block + 4, &in_len32_be, sizeof(in_len32_be)); + + if (in_len <= 8) { + memset(block + 8, 0, 8); + memcpy(block + 8, in, in_len); + AES_encrypt(block, out, key); + *out_len = AES_BLOCK_SIZE; + return 1; + } + + uint8_t *padded_in = OPENSSL_malloc(padded_len); + if (padded_in == NULL) { + return 0; + } + assert(padded_len >= 8); + memset(padded_in + padded_len - 8, 0, 8); + memcpy(padded_in, in, in_len); + const int ret = AES_wrap_key(key, block, out, padded_in, padded_len); + OPENSSL_free(padded_in); + if (ret < 0) { + return 0; + } + *out_len = ret; + return 1; +} + +int AES_unwrap_key_padded(const AES_KEY *key, uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *in, size_t in_len) { + *out_len = 0; + if (in_len < AES_BLOCK_SIZE || max_out < in_len - 8) { + return 0; + } + + uint8_t iv[8]; + if (in_len == AES_BLOCK_SIZE) { + uint8_t block[AES_BLOCK_SIZE]; + AES_decrypt(in, block, key); + memcpy(iv, block, sizeof(iv)); + memcpy(out, block + 8, 8); + } else if (!aes_unwrap_key_inner(key, out, iv, in, in_len)) { + return 0; + } + assert(in_len % 8 == 0); + + crypto_word_t ok = constant_time_eq_int( + CRYPTO_memcmp(iv, kPaddingConstant, sizeof(kPaddingConstant)), 0); + + uint32_t claimed_len32; + memcpy(&claimed_len32, iv + 4, sizeof(claimed_len32)); + const size_t claimed_len = CRYPTO_bswap4(claimed_len32); + ok &= ~constant_time_is_zero_w(claimed_len); + ok &= constant_time_eq_w((claimed_len - 1) >> 3, (in_len - 9) >> 3); + + // Check that padding bytes are all zero. + for (size_t i = in_len - 15; i < in_len - 8; i++) { + ok &= constant_time_is_zero_w(constant_time_ge_8(i, claimed_len) & out[i]); + } + + *out_len = constant_time_select_w(ok, claimed_len, 0); + return ok & 1; +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/mode_wrappers.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c similarity index 81% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/mode_wrappers.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c index c3d299f3e..42497dc4b 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/mode_wrappers.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c @@ -6,7 +6,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -50,14 +50,14 @@ #include +#include "../aes/internal.h" #include "../modes/internal.h" void AES_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, const AES_KEY *key, uint8_t ivec[AES_BLOCK_SIZE], uint8_t ecount_buf[AES_BLOCK_SIZE], unsigned int *num) { - CRYPTO_ctr128_encrypt(in, out, len, key, ivec, ecount_buf, num, - (block128_f)AES_encrypt); + CRYPTO_ctr128_encrypt(in, out, len, key, ivec, ecount_buf, num, AES_encrypt); } void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key, @@ -72,33 +72,28 @@ void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key, } } -#if defined(OPENSSL_NO_ASM) || \ - (!defined(OPENSSL_X86_64) && !defined(OPENSSL_X86)) void AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, const AES_KEY *key, uint8_t *ivec, const int enc) { + if (hwaes_capable()) { + aes_hw_cbc_encrypt(in, out, len, key, ivec, enc); + return; + } + if (!vpaes_capable()) { + aes_nohw_cbc_encrypt(in, out, len, key, ivec, enc); + return; + } if (enc) { - CRYPTO_cbc128_encrypt(in, out, len, key, ivec, (block128_f)AES_encrypt); + CRYPTO_cbc128_encrypt(in, out, len, key, ivec, AES_encrypt); } else { - CRYPTO_cbc128_decrypt(in, out, len, key, ivec, (block128_f)AES_decrypt); + CRYPTO_cbc128_decrypt(in, out, len, key, ivec, AES_decrypt); } } -#else - -void asm_AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, uint8_t *ivec, const int enc); -void AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, uint8_t *ivec, const int enc) { - asm_AES_cbc_encrypt(in, out, len, key, ivec, enc); -} - -#endif // OPENSSL_NO_ASM || (!OPENSSL_X86_64 && !OPENSSL_X86) void AES_ofb128_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, int *num) { unsigned num_u = (unsigned)(*num); - CRYPTO_ofb128_encrypt(in, out, length, key, ivec, &num_u, - (block128_f)AES_encrypt); + CRYPTO_ofb128_encrypt(in, out, length, key, ivec, &num_u, AES_encrypt); *num = (int)num_u; } @@ -106,7 +101,6 @@ void AES_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, int *num, int enc) { unsigned num_u = (unsigned)(*num); - CRYPTO_cfb128_encrypt(in, out, length, key, ivec, &num_u, enc, - (block128_f)AES_encrypt); + CRYPTO_cfb128_encrypt(in, out, length, key, ivec, &num_u, enc, AES_encrypt); *num = (int)num_u; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back similarity index 81% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back index 34514db51..206fcfd49 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/aes/mode_wrappers.c.grpc_back @@ -6,7 +6,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -50,14 +50,14 @@ #include +#include "../aes/internal.h" #include "../modes/internal.h" void AES_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, const AES_KEY *key, uint8_t ivec[AES_BLOCK_SIZE], uint8_t ecount_buf[AES_BLOCK_SIZE], unsigned int *num) { - CRYPTO_ctr128_encrypt(in, out, len, key, ivec, ecount_buf, num, - (block128_f)AES_encrypt); + CRYPTO_ctr128_encrypt(in, out, len, key, ivec, ecount_buf, num, AES_encrypt); } void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key, @@ -72,33 +72,28 @@ void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, const AES_KEY *key, } } -#if defined(OPENSSL_NO_ASM) || \ - (!defined(OPENSSL_X86_64) && !defined(OPENSSL_X86)) void AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, const AES_KEY *key, uint8_t *ivec, const int enc) { + if (hwaes_capable()) { + aes_hw_cbc_encrypt(in, out, len, key, ivec, enc); + return; + } + if (!vpaes_capable()) { + aes_nohw_cbc_encrypt(in, out, len, key, ivec, enc); + return; + } if (enc) { - CRYPTO_cbc128_encrypt(in, out, len, key, ivec, (block128_f)AES_encrypt); + CRYPTO_cbc128_encrypt(in, out, len, key, ivec, AES_encrypt); } else { - CRYPTO_cbc128_decrypt(in, out, len, key, ivec, (block128_f)AES_decrypt); + CRYPTO_cbc128_decrypt(in, out, len, key, ivec, AES_decrypt); } } -#else - -void asm_AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, uint8_t *ivec, const int enc); -void AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const AES_KEY *key, uint8_t *ivec, const int enc) { - asm_AES_cbc_encrypt(in, out, len, key, ivec, enc); -} - -#endif // OPENSSL_NO_ASM || (!OPENSSL_X86_64 && !OPENSSL_X86) void AES_ofb128_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, int *num) { unsigned num_u = (unsigned)(*num); - CRYPTO_ofb128_encrypt(in, out, length, key, ivec, &num_u, - (block128_f)AES_encrypt); + CRYPTO_ofb128_encrypt(in, out, length, key, ivec, &num_u, AES_encrypt); *num = (int)num_u; } @@ -106,7 +101,6 @@ void AES_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t length, const AES_KEY *key, uint8_t *ivec, int *num, int enc) { unsigned num_u = (unsigned)(*num); - CRYPTO_cfb128_encrypt(in, out, length, key, ivec, &num_u, enc, - (block128_f)AES_encrypt); + CRYPTO_cfb128_encrypt(in, out, length, key, ivec, &num_u, enc, AES_encrypt); *num = (int)num_u; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/add.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/add.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/add.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/add.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/add.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/asm/x86_64-gcc.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/asm/x86_64-gcc.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/asm/x86_64-gcc.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bn.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bn.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c index 27c2ee59c..ce87862f8 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bn.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c @@ -384,6 +384,23 @@ int bn_expand(BIGNUM *bn, size_t bits) { } int bn_resize_words(BIGNUM *bn, size_t words) { +#if defined(OPENSSL_PPC64LE) + // This is a workaround for a miscompilation bug in Clang 7.0.1 on POWER. + // The unittests catch the miscompilation, if it occurs, and it manifests + // as a crash in |bn_fits_in_words|. + // + // The bug only triggers if building in FIPS mode and with -O3. Clang 8.0.1 + // has the same bug but this workaround is not effective there---I've not + // been able to find a workaround for 8.0.1. + // + // At the time of writing (2019-08-08), Clang git does *not* have this bug + // and does not need this workaroud. The current git version should go on to + // be Clang 10 thus, once we can depend on that, this can be removed. + if (value_barrier_w((size_t)bn->width == words)) { + return 1; + } +#endif + if ((size_t)bn->width <= words) { if (!bn_wexpand(bn, words)) { return 0; @@ -406,8 +423,8 @@ int bn_resize_words(BIGNUM *bn, size_t words) { void bn_select_words(BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, const BN_ULONG *b, size_t num) { for (size_t i = 0; i < num; i++) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); r[i] = constant_time_select_w(mask, a[i], b[i]); } } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bn.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bn.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c.grpc_back index c020d9640..e3f1c9007 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bn.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bn.c.grpc_back @@ -384,6 +384,23 @@ int bn_expand(BIGNUM *bn, size_t bits) { } int bn_resize_words(BIGNUM *bn, size_t words) { +#if defined(OPENSSL_PPC64LE) + // This is a workaround for a miscompilation bug in Clang 7.0.1 on POWER. + // The unittests catch the miscompilation, if it occurs, and it manifests + // as a crash in |bn_fits_in_words|. + // + // The bug only triggers if building in FIPS mode and with -O3. Clang 8.0.1 + // has the same bug but this workaround is not effective there---I've not + // been able to find a workaround for 8.0.1. + // + // At the time of writing (2019-08-08), Clang git does *not* have this bug + // and does not need this workaroud. The current git version should go on to + // be Clang 10 thus, once we can depend on that, this can be removed. + if (value_barrier_w((size_t)bn->width == words)) { + return 1; + } +#endif + if ((size_t)bn->width <= words) { if (!bn_wexpand(bn, words)) { return 0; @@ -406,8 +423,8 @@ int bn_resize_words(BIGNUM *bn, size_t words) { void bn_select_words(BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, const BN_ULONG *b, size_t num) { for (size_t i = 0; i < num; i++) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); r[i] = constant_time_select_w(mask, a[i], b[i]); } } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bytes.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bytes.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bytes.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/bytes.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/bytes.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/cmp.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/cmp.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c index 01f8cbd22..284ef07bd 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/cmp.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c @@ -65,8 +65,8 @@ static int bn_cmp_words_consttime(const BN_ULONG *a, size_t a_len, const BN_ULONG *b, size_t b_len) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); int ret = 0; // Process the common words in little-endian order. size_t min = a_len < b_len ? a_len : b_len; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/cmp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/cmp.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c.grpc_back index 692adb5af..fe478b601 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/cmp.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/cmp.c.grpc_back @@ -65,8 +65,8 @@ static int bn_cmp_words_consttime(const BN_ULONG *a, size_t a_len, const BN_ULONG *b, size_t b_len) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); int ret = 0; // Process the common words in little-endian order. size_t min = a_len < b_len ? a_len : b_len; diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c new file mode 100644 index 000000000..c9ef14720 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c @@ -0,0 +1,236 @@ +/* Written by Ulf Moeller for the OpenSSL project. */ +/* ==================================================================== + * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + + +#include + +#include +#include + +#include +#include + +#include "../../internal.h" + + +// The stack frame info is resizing, set a first-time expansion size; +#define BN_CTX_START_FRAMES 32 + + +// BN_STACK + +// A |BN_STACK| is a stack of |size_t| values. +typedef struct { + // Array of indexes into |ctx->bignums|. + size_t *indexes; + // Number of stack frames, and the size of the allocated array + size_t depth, size; +} BN_STACK; + +static void BN_STACK_init(BN_STACK *); +static void BN_STACK_cleanup(BN_STACK *); +static int BN_STACK_push(BN_STACK *, size_t idx); +static size_t BN_STACK_pop(BN_STACK *); + + +// BN_CTX + +DEFINE_STACK_OF(BIGNUM) + +// The opaque BN_CTX type +struct bignum_ctx { + // bignums is the stack of |BIGNUM|s managed by this |BN_CTX|. + STACK_OF(BIGNUM) *bignums; + // stack is the stack of |BN_CTX_start| frames. It is the value of |used| at + // the time |BN_CTX_start| was called. + BN_STACK stack; + // used is the number of |BIGNUM|s from |bignums| that have been used. + size_t used; + // error is one if any operation on this |BN_CTX| failed. All subsequent + // operations will fail. + char error; + // defer_error is one if an operation on this |BN_CTX| has failed, but no + // error has been pushed to the queue yet. This is used to defer errors from + // |BN_CTX_start| to |BN_CTX_get|. + char defer_error; +}; + +BN_CTX *BN_CTX_new(void) { + BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX)); + if (!ret) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + + // Initialise the structure + ret->bignums = NULL; + BN_STACK_init(&ret->stack); + ret->used = 0; + ret->error = 0; + ret->defer_error = 0; + return ret; +} + +void BN_CTX_free(BN_CTX *ctx) { + if (ctx == NULL) { + return; + } + + // All |BN_CTX_start| calls must be matched with |BN_CTX_end|, otherwise the + // function may use more memory than expected, potentially without bound if + // done in a loop. Assert that all |BIGNUM|s have been released. + assert(ctx->used == 0 || ctx->error); + sk_BIGNUM_pop_free(ctx->bignums, BN_free); + BN_STACK_cleanup(&ctx->stack); + OPENSSL_free(ctx); +} + +void BN_CTX_start(BN_CTX *ctx) { + if (ctx->error) { + // Once an operation has failed, |ctx->stack| no longer matches the number + // of |BN_CTX_end| calls to come. Do nothing. + return; + } + + if (!BN_STACK_push(&ctx->stack, ctx->used)) { + ctx->error = 1; + // |BN_CTX_start| cannot fail, so defer the error to |BN_CTX_get|. + ctx->defer_error = 1; + } +} + +BIGNUM *BN_CTX_get(BN_CTX *ctx) { + // Once any operation has failed, they all do. + if (ctx->error) { + if (ctx->defer_error) { + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); + ctx->defer_error = 0; + } + return NULL; + } + + if (ctx->bignums == NULL) { + ctx->bignums = sk_BIGNUM_new_null(); + if (ctx->bignums == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + ctx->error = 1; + return NULL; + } + } + + if (ctx->used == sk_BIGNUM_num(ctx->bignums)) { + BIGNUM *bn = BN_new(); + if (bn == NULL || !sk_BIGNUM_push(ctx->bignums, bn)) { + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); + BN_free(bn); + ctx->error = 1; + return NULL; + } + } + + BIGNUM *ret = sk_BIGNUM_value(ctx->bignums, ctx->used); + BN_zero(ret); + // This is bounded by |sk_BIGNUM_num|, so it cannot overflow. + ctx->used++; + return ret; +} + +void BN_CTX_end(BN_CTX *ctx) { + if (ctx->error) { + // Once an operation has failed, |ctx->stack| no longer matches the number + // of |BN_CTX_end| calls to come. Do nothing. + return; + } + + ctx->used = BN_STACK_pop(&ctx->stack); +} + + +// BN_STACK + +static void BN_STACK_init(BN_STACK *st) { + st->indexes = NULL; + st->depth = st->size = 0; +} + +static void BN_STACK_cleanup(BN_STACK *st) { + OPENSSL_free(st->indexes); +} + +static int BN_STACK_push(BN_STACK *st, size_t idx) { + if (st->depth == st->size) { + // This function intentionally does not push to the error queue on error. + // Error-reporting is deferred to |BN_CTX_get|. + size_t new_size = st->size != 0 ? st->size * 3 / 2 : BN_CTX_START_FRAMES; + if (new_size <= st->size || new_size > ((size_t)-1) / sizeof(size_t)) { + return 0; + } + size_t *new_indexes = + OPENSSL_realloc(st->indexes, new_size * sizeof(size_t)); + if (new_indexes == NULL) { + return 0; + } + st->indexes = new_indexes; + st->size = new_size; + } + + st->indexes[st->depth] = idx; + st->depth++; + return 1; +} + +static size_t BN_STACK_pop(BN_STACK *st) { + assert(st->depth > 0); + st->depth--; + return st->indexes[st->depth]; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c.grpc_back new file mode 100644 index 000000000..f8c7ebfa6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/ctx.c.grpc_back @@ -0,0 +1,236 @@ +/* Written by Ulf Moeller for the OpenSSL project. */ +/* ==================================================================== + * Copyright (c) 1998-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + + +#include + +#include +#include + +#include +#include + +#include "../../internal.h" + + +// The stack frame info is resizing, set a first-time expansion size; +#define BN_CTX_START_FRAMES 32 + + +// BN_STACK + +// A |BN_STACK| is a stack of |size_t| values. +typedef struct { + // Array of indexes into |ctx->bignums|. + size_t *indexes; + // Number of stack frames, and the size of the allocated array + size_t depth, size; +} BN_STACK; + +static void BN_STACK_init(BN_STACK *); +static void BN_STACK_cleanup(BN_STACK *); +static int BN_STACK_push(BN_STACK *, size_t idx); +static size_t BN_STACK_pop(BN_STACK *); + + +// BN_CTX + +DEFINE_STACK_OF(BIGNUM) + +// The opaque BN_CTX type +struct bignum_ctx { + // bignums is the stack of |BIGNUM|s managed by this |BN_CTX|. + STACK_OF(BIGNUM) *bignums; + // stack is the stack of |BN_CTX_start| frames. It is the value of |used| at + // the time |BN_CTX_start| was called. + BN_STACK stack; + // used is the number of |BIGNUM|s from |bignums| that have been used. + size_t used; + // error is one if any operation on this |BN_CTX| failed. All subsequent + // operations will fail. + char error; + // defer_error is one if an operation on this |BN_CTX| has failed, but no + // error has been pushed to the queue yet. This is used to defer errors from + // |BN_CTX_start| to |BN_CTX_get|. + char defer_error; +}; + +BN_CTX *BN_CTX_new(void) { + BN_CTX *ret = OPENSSL_malloc(sizeof(BN_CTX)); + if (!ret) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + + // Initialise the structure + ret->bignums = NULL; + BN_STACK_init(&ret->stack); + ret->used = 0; + ret->error = 0; + ret->defer_error = 0; + return ret; +} + +void BN_CTX_free(BN_CTX *ctx) { + if (ctx == NULL) { + return; + } + + // All |BN_CTX_start| calls must be matched with |BN_CTX_end|, otherwise the + // function may use more memory than expected, potentially without bound if + // done in a loop. Assert that all |BIGNUM|s have been released. + assert(ctx->used == 0 || ctx->error); + sk_BIGNUM_pop_free(ctx->bignums, BN_free); + BN_STACK_cleanup(&ctx->stack); + OPENSSL_free(ctx); +} + +void BN_CTX_start(BN_CTX *ctx) { + if (ctx->error) { + // Once an operation has failed, |ctx->stack| no longer matches the number + // of |BN_CTX_end| calls to come. Do nothing. + return; + } + + if (!BN_STACK_push(&ctx->stack, ctx->used)) { + ctx->error = 1; + // |BN_CTX_start| cannot fail, so defer the error to |BN_CTX_get|. + ctx->defer_error = 1; + } +} + +BIGNUM *BN_CTX_get(BN_CTX *ctx) { + // Once any operation has failed, they all do. + if (ctx->error) { + if (ctx->defer_error) { + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); + ctx->defer_error = 0; + } + return NULL; + } + + if (ctx->bignums == NULL) { + ctx->bignums = sk_BIGNUM_new_null(); + if (ctx->bignums == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + ctx->error = 1; + return NULL; + } + } + + if (ctx->used == sk_BIGNUM_num(ctx->bignums)) { + BIGNUM *bn = BN_new(); + if (bn == NULL || !sk_BIGNUM_push(ctx->bignums, bn)) { + OPENSSL_PUT_ERROR(BN, BN_R_TOO_MANY_TEMPORARY_VARIABLES); + BN_free(bn); + ctx->error = 1; + return NULL; + } + } + + BIGNUM *ret = sk_BIGNUM_value(ctx->bignums, ctx->used); + BN_zero(ret); + // This is bounded by |sk_BIGNUM_num|, so it cannot overflow. + ctx->used++; + return ret; +} + +void BN_CTX_end(BN_CTX *ctx) { + if (ctx->error) { + // Once an operation has failed, |ctx->stack| no longer matches the number + // of |BN_CTX_end| calls to come. Do nothing. + return; + } + + ctx->used = BN_STACK_pop(&ctx->stack); +} + + +// BN_STACK + +static void BN_STACK_init(BN_STACK *st) { + st->indexes = NULL; + st->depth = st->size = 0; +} + +static void BN_STACK_cleanup(BN_STACK *st) { + OPENSSL_free(st->indexes); +} + +static int BN_STACK_push(BN_STACK *st, size_t idx) { + if (st->depth == st->size) { + // This function intentionally does not push to the error queue on error. + // Error-reporting is deferred to |BN_CTX_get|. + size_t new_size = st->size != 0 ? st->size * 3 / 2 : BN_CTX_START_FRAMES; + if (new_size <= st->size || new_size > ((size_t)-1) / sizeof(size_t)) { + return 0; + } + size_t *new_indexes = + OPENSSL_realloc(st->indexes, new_size * sizeof(size_t)); + if (new_indexes == NULL) { + return 0; + } + st->indexes = new_indexes; + st->size = new_size; + } + + st->indexes[st->depth] = idx; + st->depth++; + return 1; +} + +static size_t BN_STACK_pop(BN_STACK *st) { + assert(st->depth > 0); + st->depth--; + return st->indexes[st->depth]; +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/div.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/div.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c index 0831ad1cd..45ae65e3e 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/div.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c @@ -64,7 +64,7 @@ #include "internal.h" -#if !defined(BN_ULLONG) +#if !defined(BN_CAN_DIVIDE_ULLONG) && !defined(BN_CAN_USE_INLINE_ASM) // bn_div_words divides a double-width |h|,|l| by |d| and returns the result, // which must fit in a |BN_ULONG|. static BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) { @@ -135,7 +135,7 @@ static BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) { ret |= q; return ret; } -#endif // !defined(BN_ULLONG) +#endif // !defined(BN_CAN_DIVIDE_ULLONG) && !defined(BN_CAN_USE_INLINE_ASM) static inline void bn_div_rem_words(BN_ULONG *quotient_out, BN_ULONG *rem_out, BN_ULONG n0, BN_ULONG n1, BN_ULONG d0) { @@ -155,20 +155,18 @@ static inline void bn_div_rem_words(BN_ULONG *quotient_out, BN_ULONG *rem_out, // // These issues aren't specific to x86 and x86_64, so it might be worthwhile // to add more assembly language implementations. -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86) && \ - (defined(__GNUC__) || defined(__clang__)) +#if defined(BN_CAN_USE_INLINE_ASM) && defined(OPENSSL_X86) __asm__ volatile("divl %4" : "=a"(*quotient_out), "=d"(*rem_out) : "a"(n1), "d"(n0), "rm"(d0) : "cc"); -#elif !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - (defined(__GNUC__) || defined(__clang__)) +#elif defined(BN_CAN_USE_INLINE_ASM) && defined(OPENSSL_X86_64) __asm__ volatile("divq %4" : "=a"(*quotient_out), "=d"(*rem_out) : "a"(n1), "d"(n0), "rm"(d0) : "cc"); #else -#if defined(BN_ULLONG) +#if defined(BN_CAN_DIVIDE_ULLONG) BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; *quotient_out = (BN_ULONG)(n / d0); #else @@ -414,11 +412,37 @@ int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) { return (d->neg ? BN_sub : BN_add)(r, r, d); } -// bn_mod_sub_words sets |r| to |a| - |b| (mod |m|), using |tmp| as scratch -// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of -// |r|, |a|, and |b| may alias. -static void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, - const BN_ULONG *m, BN_ULONG *tmp, size_t num) { +BN_ULONG bn_reduce_once(BN_ULONG *r, const BN_ULONG *a, BN_ULONG carry, + const BN_ULONG *m, size_t num) { + assert(r != a); + // |r| = |a| - |m|. |bn_sub_words| performs the bulk of the subtraction, and + // then we apply the borrow to |carry|. + carry -= bn_sub_words(r, a, m, num); + // We know 0 <= |a| < 2*|m|, so -|m| <= |r| < |m|. + // + // If 0 <= |r| < |m|, |r| fits in |num| words and |carry| is zero. We then + // wish to select |r| as the answer. Otherwise -m <= r < 0 and we wish to + // return |r| + |m|, or |a|. |carry| must then be -1 or all ones. In both + // cases, |carry| is a suitable input to |bn_select_words|. + // + // Although |carry| may be one if it was one on input and |bn_sub_words| + // returns zero, this would give |r| > |m|, violating our input assumptions. + assert(carry == 0 || carry == (BN_ULONG)-1); + bn_select_words(r, carry, a /* r < 0 */, r /* r >= 0 */, num); + return carry; +} + +BN_ULONG bn_reduce_once_in_place(BN_ULONG *r, BN_ULONG carry, const BN_ULONG *m, + BN_ULONG *tmp, size_t num) { + // See |bn_reduce_once| for why this logic works. + carry -= bn_sub_words(tmp, r, m, num); + assert(carry == 0 || carry == (BN_ULONG)-1); + bn_select_words(r, carry, r /* tmp < 0 */, tmp /* tmp >= 0 */, num); + return carry; +} + +void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num) { // r = a - b BN_ULONG borrow = bn_sub_words(r, a, b, num); // tmp = a - b + m @@ -426,32 +450,10 @@ static void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, bn_select_words(r, 0 - borrow, tmp /* r < 0 */, r /* r >= 0 */, num); } -// bn_mod_add_words sets |r| to |a| + |b| (mod |m|), using |tmp| as scratch -// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of -// |r|, |a|, and |b| may alias. -static void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, - const BN_ULONG *m, BN_ULONG *tmp, size_t num) { - // tmp = a + b. Note the result fits in |num|+1 words. We store the extra word - // in |carry|. - BN_ULONG carry = bn_add_words(tmp, a, b, num); - // r = a + b - m. We use |bn_sub_words| to perform the bulk of the - // subtraction, and then apply the borrow to |carry|. - carry -= bn_sub_words(r, tmp, m, num); - // |a| and |b| were both fully-reduced, so we know: - // - // 0 + 0 - m <= r < m + m - m - // -m <= r < m - // - // If 0 <= |r| < |m|, |r| fits in |num| words and |carry| is zero. We then - // wish to select |r| as the answer. Otherwise -m <= r < 0 and we wish to - // return |r| + |m|, or |tmp|. |carry| must then be -1 or all ones. In both - // cases, |carry| is a suitable input to |bn_select_words|. - // - // Although |carry| may be one if |bn_add_words| returns one and - // |bn_sub_words| returns zero, this would give |r| > |m|, which violates are - // input assumptions. - assert(carry == 0 || carry == (BN_ULONG)-1); - bn_select_words(r, carry, tmp /* r < 0 */, r /* r >= 0 */, num); +void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num) { + BN_ULONG carry = bn_add_words(r, a, b, num); + bn_reduce_once_in_place(r, carry, m, tmp, num); } int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, @@ -504,27 +506,14 @@ int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, // extra word in |carry|. BN_ULONG carry = bn_add_words(r->d, r->d, r->d, divisor->width); r->d[0] |= (numerator->d[i] >> bit) & 1; - // tmp = r - divisor. We use |bn_sub_words| to perform the bulk of the - // subtraction, and then apply the borrow to |carry|. - carry -= bn_sub_words(tmp->d, r->d, divisor->d, divisor->width); // |r| was previously fully-reduced, so we know: - // - // 2*0 - divisor <= tmp <= 2*(divisor-1) + 1 - divisor - // -divisor <= tmp < divisor - // - // If 0 <= |tmp| < |divisor|, |tmp| fits in |divisor->width| and |carry| - // is zero. We then wish to select |tmp|. Otherwise, - // -|divisor| <= |tmp| < 0 and we wish to select |tmp| + |divisor|, which - // is |r|. |carry| must then be -1 (all ones). In both cases, |carry| is a - // suitable input to |bn_select_words|. - // - // Although |carry| may be one if |bn_add_words| returns one and - // |bn_sub_words| returns zero, this would give |r| > |d|, which violates - // the loop invariant. - bn_select_words(r->d, carry, r->d /* tmp < 0 */, tmp->d /* tmp >= 0 */, - divisor->width); + // 2*0 <= r <= 2*(divisor-1) + 1 + // 0 <= r <= 2*divisor - 1 < 2*divisor. + // Thus |r| satisfies the preconditions for |bn_reduce_once_in_place|. + BN_ULONG subtracted = bn_reduce_once_in_place(r->d, carry, divisor->d, + tmp->d, divisor->width); // The corresponding bit of the quotient is set iff we needed to subtract. - q->d[i] |= (~carry & 1) << bit; + q->d[i] |= (~subtracted & 1) << bit; } } @@ -600,6 +589,7 @@ int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, if (ok) { bn_mod_add_words(r->d, a->d, b->d, m->d, tmp->d, m->width); r->width = m->width; + r->neg = 0; } BN_CTX_end(ctx); return ok; @@ -624,6 +614,7 @@ int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, if (ok) { bn_mod_sub_words(r->d, a->d, b->d, m->d, tmp->d, m->width); r->width = m->width; + r->neg = 0; } BN_CTX_end(ctx); return ok; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/div.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/div.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c.grpc_back index 2a3bcdde8..27b591c9e 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/div.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div.c.grpc_back @@ -64,7 +64,7 @@ #include "internal.h" -#if !defined(BN_ULLONG) +#if !defined(BN_CAN_DIVIDE_ULLONG) && !defined(BN_CAN_USE_INLINE_ASM) // bn_div_words divides a double-width |h|,|l| by |d| and returns the result, // which must fit in a |BN_ULONG|. static BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) { @@ -135,7 +135,7 @@ static BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) { ret |= q; return ret; } -#endif // !defined(BN_ULLONG) +#endif // !defined(BN_CAN_DIVIDE_ULLONG) && !defined(BN_CAN_USE_INLINE_ASM) static inline void bn_div_rem_words(BN_ULONG *quotient_out, BN_ULONG *rem_out, BN_ULONG n0, BN_ULONG n1, BN_ULONG d0) { @@ -155,20 +155,18 @@ static inline void bn_div_rem_words(BN_ULONG *quotient_out, BN_ULONG *rem_out, // // These issues aren't specific to x86 and x86_64, so it might be worthwhile // to add more assembly language implementations. -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86) && \ - (defined(__GNUC__) || defined(__clang__)) +#if defined(BN_CAN_USE_INLINE_ASM) && defined(OPENSSL_X86) __asm__ volatile("divl %4" : "=a"(*quotient_out), "=d"(*rem_out) : "a"(n1), "d"(n0), "rm"(d0) : "cc"); -#elif !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ - (defined(__GNUC__) || defined(__clang__)) +#elif defined(BN_CAN_USE_INLINE_ASM) && defined(OPENSSL_X86_64) __asm__ volatile("divq %4" : "=a"(*quotient_out), "=d"(*rem_out) : "a"(n1), "d"(n0), "rm"(d0) : "cc"); #else -#if defined(BN_ULLONG) +#if defined(BN_CAN_DIVIDE_ULLONG) BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; *quotient_out = (BN_ULONG)(n / d0); #else @@ -414,11 +412,37 @@ int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx) { return (d->neg ? BN_sub : BN_add)(r, r, d); } -// bn_mod_sub_words sets |r| to |a| - |b| (mod |m|), using |tmp| as scratch -// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of -// |r|, |a|, and |b| may alias. -static void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, - const BN_ULONG *m, BN_ULONG *tmp, size_t num) { +BN_ULONG bn_reduce_once(BN_ULONG *r, const BN_ULONG *a, BN_ULONG carry, + const BN_ULONG *m, size_t num) { + assert(r != a); + // |r| = |a| - |m|. |bn_sub_words| performs the bulk of the subtraction, and + // then we apply the borrow to |carry|. + carry -= bn_sub_words(r, a, m, num); + // We know 0 <= |a| < 2*|m|, so -|m| <= |r| < |m|. + // + // If 0 <= |r| < |m|, |r| fits in |num| words and |carry| is zero. We then + // wish to select |r| as the answer. Otherwise -m <= r < 0 and we wish to + // return |r| + |m|, or |a|. |carry| must then be -1 or all ones. In both + // cases, |carry| is a suitable input to |bn_select_words|. + // + // Although |carry| may be one if it was one on input and |bn_sub_words| + // returns zero, this would give |r| > |m|, violating our input assumptions. + assert(carry == 0 || carry == (BN_ULONG)-1); + bn_select_words(r, carry, a /* r < 0 */, r /* r >= 0 */, num); + return carry; +} + +BN_ULONG bn_reduce_once_in_place(BN_ULONG *r, BN_ULONG carry, const BN_ULONG *m, + BN_ULONG *tmp, size_t num) { + // See |bn_reduce_once| for why this logic works. + carry -= bn_sub_words(tmp, r, m, num); + assert(carry == 0 || carry == (BN_ULONG)-1); + bn_select_words(r, carry, r /* tmp < 0 */, tmp /* tmp >= 0 */, num); + return carry; +} + +void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num) { // r = a - b BN_ULONG borrow = bn_sub_words(r, a, b, num); // tmp = a - b + m @@ -426,32 +450,10 @@ static void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, bn_select_words(r, 0 - borrow, tmp /* r < 0 */, r /* r >= 0 */, num); } -// bn_mod_add_words sets |r| to |a| + |b| (mod |m|), using |tmp| as scratch -// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of -// |r|, |a|, and |b| may alias. -static void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, - const BN_ULONG *m, BN_ULONG *tmp, size_t num) { - // tmp = a + b. Note the result fits in |num|+1 words. We store the extra word - // in |carry|. - BN_ULONG carry = bn_add_words(tmp, a, b, num); - // r = a + b - m. We use |bn_sub_words| to perform the bulk of the - // subtraction, and then apply the borrow to |carry|. - carry -= bn_sub_words(r, tmp, m, num); - // |a| and |b| were both fully-reduced, so we know: - // - // 0 + 0 - m <= r < m + m - m - // -m <= r < m - // - // If 0 <= |r| < |m|, |r| fits in |num| words and |carry| is zero. We then - // wish to select |r| as the answer. Otherwise -m <= r < 0 and we wish to - // return |r| + |m|, or |tmp|. |carry| must then be -1 or all ones. In both - // cases, |carry| is a suitable input to |bn_select_words|. - // - // Although |carry| may be one if |bn_add_words| returns one and - // |bn_sub_words| returns zero, this would give |r| > |m|, which violates are - // input assumptions. - assert(carry == 0 || carry == (BN_ULONG)-1); - bn_select_words(r, carry, tmp /* r < 0 */, r /* r >= 0 */, num); +void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num) { + BN_ULONG carry = bn_add_words(r, a, b, num); + bn_reduce_once_in_place(r, carry, m, tmp, num); } int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, @@ -504,27 +506,14 @@ int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, // extra word in |carry|. BN_ULONG carry = bn_add_words(r->d, r->d, r->d, divisor->width); r->d[0] |= (numerator->d[i] >> bit) & 1; - // tmp = r - divisor. We use |bn_sub_words| to perform the bulk of the - // subtraction, and then apply the borrow to |carry|. - carry -= bn_sub_words(tmp->d, r->d, divisor->d, divisor->width); // |r| was previously fully-reduced, so we know: - // - // 2*0 - divisor <= tmp <= 2*(divisor-1) + 1 - divisor - // -divisor <= tmp < divisor - // - // If 0 <= |tmp| < |divisor|, |tmp| fits in |divisor->width| and |carry| - // is zero. We then wish to select |tmp|. Otherwise, - // -|divisor| <= |tmp| < 0 and we wish to select |tmp| + |divisor|, which - // is |r|. |carry| must then be -1 (all ones). In both cases, |carry| is a - // suitable input to |bn_select_words|. - // - // Although |carry| may be one if |bn_add_words| returns one and - // |bn_sub_words| returns zero, this would give |r| > |d|, which violates - // the loop invariant. - bn_select_words(r->d, carry, r->d /* tmp < 0 */, tmp->d /* tmp >= 0 */, - divisor->width); + // 2*0 <= r <= 2*(divisor-1) + 1 + // 0 <= r <= 2*divisor - 1 < 2*divisor. + // Thus |r| satisfies the preconditions for |bn_reduce_once_in_place|. + BN_ULONG subtracted = bn_reduce_once_in_place(r->d, carry, divisor->d, + tmp->d, divisor->width); // The corresponding bit of the quotient is set iff we needed to subtract. - q->d[i] |= (~carry & 1) << bit; + q->d[i] |= (~subtracted & 1) << bit; } } @@ -600,6 +589,7 @@ int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, if (ok) { bn_mod_add_words(r->d, a->d, b->d, m->d, tmp->d, m->width); r->width = m->width; + r->neg = 0; } BN_CTX_end(ctx); return ok; @@ -624,6 +614,7 @@ int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, if (ok) { bn_mod_sub_words(r->d, a->d, b->d, m->d, tmp->d, m->width); r->width = m->width; + r->neg = 0; } BN_CTX_end(ctx); return ok; diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c new file mode 100644 index 000000000..027e005e7 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c @@ -0,0 +1,87 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" + + +// The following functions use a Barrett reduction variant to avoid leaking the +// numerator. See http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html +// +// We use 32-bit numerator and 16-bit divisor for simplicity. This allows +// computing |m| and |q| without architecture-specific code. + +// mod_u16 returns |n| mod |d|. |p| and |m| are the "magic numbers" for |d| (see +// reference). For proof of correctness in Coq, see +// https://github.com/davidben/fiat-crypto/blob/barrett/src/Arithmetic/BarrettReduction/RidiculousFish.v +// Note the Coq version of |mod_u16| additionally includes the computation of +// |p| and |m| from |bn_mod_u16_consttime| below. +static uint16_t mod_u16(uint32_t n, uint16_t d, uint32_t p, uint32_t m) { + // Compute floor(n/d) per steps 3 through 5. + uint32_t q = ((uint64_t)m * n) >> 32; + // Note there is a typo in the reference. We right-shift by one, not two. + uint32_t t = ((n - q) >> 1) + q; + t = t >> (p - 1); + + // Multiply and subtract to get the remainder. + n -= d * t; + assert(n < d); + return n; +} + +// shift_and_add_mod_u16 returns |r| * 2^32 + |a| mod |d|. |p| and |m| are the +// "magic numbers" for |d| (see reference). +static uint16_t shift_and_add_mod_u16(uint16_t r, uint32_t a, uint16_t d, + uint32_t p, uint32_t m) { + // Incorporate |a| in two 16-bit chunks. + uint32_t t = r; + t <<= 16; + t |= a >> 16; + t = mod_u16(t, d, p, m); + + t <<= 16; + t |= a & 0xffff; + t = mod_u16(t, d, p, m); + return t; +} + +uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d) { + if (d <= 1) { + return 0; + } + + // Compute the "magic numbers" for |d|. See steps 1 and 2. + // This computes p = ceil(log_2(d)). + uint32_t p = BN_num_bits_word(d - 1); + // This operation is not constant-time, but |p| and |d| are public values. + // Note that |p| is at most 16, so the computation fits in |uint64_t|. + assert(p <= 16); + uint32_t m = ((UINT64_C(1) << (32 + p)) + d - 1) / d; + + uint16_t ret = 0; + for (int i = bn->width - 1; i >= 0; i--) { +#if BN_BITS2 == 32 + ret = shift_and_add_mod_u16(ret, bn->d[i], d, p, m); +#elif BN_BITS2 == 64 + ret = shift_and_add_mod_u16(ret, bn->d[i] >> 32, d, p, m); + ret = shift_and_add_mod_u16(ret, bn->d[i] & 0xffffffff, d, p, m); +#else +#error "Unknown BN_ULONG size" +#endif + } + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c.grpc_back new file mode 100644 index 000000000..7f03f28d0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/div_extra.c.grpc_back @@ -0,0 +1,87 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" + + +// The following functions use a Barrett reduction variant to avoid leaking the +// numerator. See http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html +// +// We use 32-bit numerator and 16-bit divisor for simplicity. This allows +// computing |m| and |q| without architecture-specific code. + +// mod_u16 returns |n| mod |d|. |p| and |m| are the "magic numbers" for |d| (see +// reference). For proof of correctness in Coq, see +// https://github.com/davidben/fiat-crypto/blob/barrett/src/Arithmetic/BarrettReduction/RidiculousFish.v +// Note the Coq version of |mod_u16| additionally includes the computation of +// |p| and |m| from |bn_mod_u16_consttime| below. +static uint16_t mod_u16(uint32_t n, uint16_t d, uint32_t p, uint32_t m) { + // Compute floor(n/d) per steps 3 through 5. + uint32_t q = ((uint64_t)m * n) >> 32; + // Note there is a typo in the reference. We right-shift by one, not two. + uint32_t t = ((n - q) >> 1) + q; + t = t >> (p - 1); + + // Multiply and subtract to get the remainder. + n -= d * t; + assert(n < d); + return n; +} + +// shift_and_add_mod_u16 returns |r| * 2^32 + |a| mod |d|. |p| and |m| are the +// "magic numbers" for |d| (see reference). +static uint16_t shift_and_add_mod_u16(uint16_t r, uint32_t a, uint16_t d, + uint32_t p, uint32_t m) { + // Incorporate |a| in two 16-bit chunks. + uint32_t t = r; + t <<= 16; + t |= a >> 16; + t = mod_u16(t, d, p, m); + + t <<= 16; + t |= a & 0xffff; + t = mod_u16(t, d, p, m); + return t; +} + +uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d) { + if (d <= 1) { + return 0; + } + + // Compute the "magic numbers" for |d|. See steps 1 and 2. + // This computes p = ceil(log_2(d)). + uint32_t p = BN_num_bits_word(d - 1); + // This operation is not constant-time, but |p| and |d| are public values. + // Note that |p| is at most 16, so the computation fits in |uint64_t|. + assert(p <= 16); + uint32_t m = ((UINT64_C(1) << (32 + p)) + d - 1) / d; + + uint16_t ret = 0; + for (int i = bn->width - 1; i >= 0; i--) { +#if BN_BITS2 == 32 + ret = shift_and_add_mod_u16(ret, bn->d[i], d, p, m); +#elif BN_BITS2 == 64 + ret = shift_and_add_mod_u16(ret, bn->d[i] >> 32, d, p, m); + ret = shift_and_add_mod_u16(ret, bn->d[i] & 0xffffffff, d, p, m); +#else +#error "Unknown BN_ULONG size" +#endif + } + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/exponentiation.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c similarity index 82% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/exponentiation.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c index dde75a44e..bf70c3aa3 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/exponentiation.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c @@ -109,6 +109,7 @@ #include #include +#include #include #include @@ -116,25 +117,8 @@ #include #include "internal.h" - - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) -#define OPENSSL_BN_ASM_MONT5 -#define RSAZ_ENABLED - #include "rsaz_exp.h" -void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, const void *table, - const BN_ULONG *np, const BN_ULONG *n0, int num, - int power); -void bn_scatter5(const BN_ULONG *inp, size_t num, void *table, size_t power); -void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power); -void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const void *table, - const BN_ULONG *np, const BN_ULONG *n0, int num, int power); -int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap, - const BN_ULONG *not_used, const BN_ULONG *np, - const BN_ULONG *n0, int num); -#endif int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { int i, bits, ret = 0; @@ -445,21 +429,18 @@ static int BN_window_bits_for_exponent_size(int b) { static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx) { - int i, j, bits, ret = 0, wstart, window; + int i, j, ret = 0, wstart, window; int start = 1; BIGNUM *aa; // Table of variables obtained from 'ctx' BIGNUM *val[TABLE_SIZE]; BN_RECP_CTX recp; - bits = BN_num_bits(p); + // This function is only called on even moduli. + assert(!BN_is_odd(m)); + int bits = BN_num_bits(p); if (bits == 0) { - // x**0 mod 1 is still zero. - if (BN_is_one(m)) { - BN_zero(r); - return 1; - } return BN_one(r); } @@ -585,6 +566,17 @@ static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx) { + if (m->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (a->neg || BN_ucmp(a, m) >= 0) { + if (!BN_nnmod(r, a, m, ctx)) { + return 0; + } + a = r; + } + if (BN_is_odd(m)) { return BN_mod_exp_mont(r, a, p, m, ctx, NULL); } @@ -598,10 +590,19 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); return 0; } + if (m->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (a->neg || BN_ucmp(a, m) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + int bits = BN_num_bits(p); if (bits == 0) { // x**0 mod 1 is still zero. - if (BN_is_one(m)) { + if (BN_abs_is_word(m, 1)) { BN_zero(rr); return 1; } @@ -613,48 +614,33 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BN_MONT_CTX *new_mont = NULL; BN_CTX_start(ctx); - BIGNUM *d = BN_CTX_get(ctx); BIGNUM *r = BN_CTX_get(ctx); val[0] = BN_CTX_get(ctx); - if (!d || !r || !val[0]) { + if (r == NULL || val[0] == NULL) { goto err; } // Allocate a montgomery context if it was not supplied by the caller. if (mont == NULL) { - new_mont = BN_MONT_CTX_new_for_modulus(m, ctx); + new_mont = BN_MONT_CTX_new_consttime(m, ctx); if (new_mont == NULL) { goto err; } mont = new_mont; } - const BIGNUM *aa; - if (a->neg || BN_ucmp(a, m) >= 0) { - if (!BN_nnmod(val[0], a, m, ctx)) { - goto err; - } - aa = val[0]; - } else { - aa = a; - } - - if (BN_is_zero(aa)) { - BN_zero(rr); - ret = 1; - goto err; - } - // We exponentiate by looking at sliding windows of the exponent and - // precomputing powers of |aa|. Windows may be shifted so they always end on a - // set bit, so only precompute odd powers. We compute val[i] = aa^(2*i + 1) + // precomputing powers of |a|. Windows may be shifted so they always end on a + // set bit, so only precompute odd powers. We compute val[i] = a^(2*i + 1) // for i = 0 to 2^(window-1), all in Montgomery form. int window = BN_window_bits_for_exponent_size(bits); - if (!BN_to_montgomery(val[0], aa, mont, ctx)) { + if (!BN_to_montgomery(val[0], a, mont, ctx)) { goto err; } if (window > 1) { - if (!BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) { + BIGNUM *d = BN_CTX_get(ctx); + if (d == NULL || + !BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) { goto err; } for (int i = 1; i < 1 << (window - 1); i++) { @@ -666,10 +652,8 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } } - if (!bn_one_to_montgomery(r, mont, ctx)) { - goto err; - } - + // |p| is non-zero, so at least one window is non-zero. To save some + // multiplications, defer initializing |r| until then. int r_is_one = 1; int wstart = bits - 1; // The top bit of the window. for (;;) { @@ -706,7 +690,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, assert(wvalue & 1); assert(wvalue < (1 << window)); - if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) { + if (r_is_one) { + if (!BN_copy(r, val[wvalue >> 1])) { + goto err; + } + } else if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) { goto err; } @@ -717,6 +705,9 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, wstart -= wsize + 1; } + // |p| is non-zero, so |r_is_one| must be cleared at some point. + assert(!r_is_one); + if (!BN_from_montgomery(rr, r, mont, ctx)) { goto err; } @@ -728,29 +719,24 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, return ret; } -int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *p, size_t num_p, - const BN_MONT_CTX *mont) { - size_t num_n = mont->N.width; - if (num_n != num_a || num_n != num_r || num_n > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; - } - if (!BN_is_odd(&mont->N)) { - OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); - return 0; +void bn_mod_exp_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_ULONG *p, size_t num_p, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } - unsigned bits = 0; - if (num_p != 0) { - bits = BN_num_bits_word(p[num_p - 1]) + (num_p - 1) * BN_BITS2; + assert(BN_is_odd(&mont->N)); + + // Count the number of bits in |p|. Note this function treats |p| as public. + while (num_p != 0 && p[num_p - 1] == 0) { + num_p--; } - if (bits == 0) { - OPENSSL_memset(r, 0, num_r * sizeof(BN_ULONG)); - if (!BN_is_one(&mont->N)) { - r[0] = 1; - } - return 1; + if (num_p == 0) { + bn_from_montgomery_small(r, mont->RR.d, num, mont); + return; } + unsigned bits = BN_num_bits_word(p[num_p - 1]) + (num_p - 1) * BN_BITS2; + assert(bits != 0); // We exponentiate by looking at sliding windows of the exponent and // precomputing powers of |a|. Windows may be shifted so they always end on a @@ -760,34 +746,24 @@ int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, if (window > TABLE_BITS_SMALL) { window = TABLE_BITS_SMALL; // Tolerate excessively large |p|. } - int ret = 0; BN_ULONG val[TABLE_SIZE_SMALL][BN_SMALL_MAX_WORDS]; - OPENSSL_memcpy(val[0], a, num_n * sizeof(BN_ULONG)); + OPENSSL_memcpy(val[0], a, num * sizeof(BN_ULONG)); if (window > 1) { BN_ULONG d[BN_SMALL_MAX_WORDS]; - if (!bn_mod_mul_montgomery_small(d, num_n, val[0], num_n, val[0], num_n, - mont)) { - goto err; - } + bn_mod_mul_montgomery_small(d, val[0], val[0], num, mont); for (unsigned i = 1; i < 1u << (window - 1); i++) { - if (!bn_mod_mul_montgomery_small(val[i], num_n, val[i - 1], num_n, d, - num_n, mont)) { - goto err; - } + bn_mod_mul_montgomery_small(val[i], val[i - 1], d, num, mont); } } - if (!bn_one_to_montgomery_small(r, num_r, mont)) { - goto err; - } - + // |p| is non-zero, so at least one window is non-zero. To save some + // multiplications, defer initializing |r| until then. int r_is_one = 1; unsigned wstart = bits - 1; // The top bit of the window. for (;;) { if (!bn_is_bit_set_words(p, num_p, wstart)) { - if (!r_is_one && - !bn_mod_mul_montgomery_small(r, num_r, r, num_r, r, num_r, mont)) { - goto err; + if (!r_is_one) { + bn_mod_mul_montgomery_small(r, r, r, num, mont); } if (wstart == 0) { break; @@ -810,19 +786,17 @@ int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, // Shift |r| to the end of the window. if (!r_is_one) { for (unsigned i = 0; i < wsize + 1; i++) { - if (!bn_mod_mul_montgomery_small(r, num_r, r, num_r, r, num_r, mont)) { - goto err; - } + bn_mod_mul_montgomery_small(r, r, r, num, mont); } } assert(wvalue & 1); assert(wvalue < (1u << window)); - if (!bn_mod_mul_montgomery_small(r, num_r, r, num_r, val[wvalue >> 1], - num_n, mont)) { - goto err; + if (r_is_one) { + OPENSSL_memcpy(r, val[wvalue >> 1], num * sizeof(BN_ULONG)); + } else { + bn_mod_mul_montgomery_small(r, r, val[wvalue >> 1], num, mont); } - r_is_one = 0; if (wstart == wsize) { break; @@ -830,103 +804,54 @@ int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, wstart -= wsize + 1; } - ret = 1; - -err: + // |p| is non-zero, so |r_is_one| must be cleared at some point. + assert(!r_is_one); OPENSSL_cleanse(val, sizeof(val)); - return ret; } -int bn_mod_inverse_prime_mont_small(BN_ULONG *r, size_t num_r, - const BN_ULONG *a, size_t num_a, - const BN_MONT_CTX *mont) { - const BN_ULONG *p = mont->N.d; - size_t num_p = mont->N.width; - if (num_p > BN_SMALL_MAX_WORDS || num_p == 0) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; +void bn_mod_inverse_prime_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } // Per Fermat's Little Theorem, a^-1 = a^(p-2) (mod p) for p prime. BN_ULONG p_minus_two[BN_SMALL_MAX_WORDS]; - OPENSSL_memcpy(p_minus_two, p, num_p * sizeof(BN_ULONG)); + const BN_ULONG *p = mont->N.d; + OPENSSL_memcpy(p_minus_two, p, num * sizeof(BN_ULONG)); if (p_minus_two[0] >= 2) { p_minus_two[0] -= 2; } else { p_minus_two[0] -= 2; - for (size_t i = 1; i < num_p; i++) { + for (size_t i = 1; i < num; i++) { if (p_minus_two[i]-- != 0) { break; } } } - return bn_mod_exp_mont_small(r, num_r, a, num_a, p_minus_two, num_p, mont); + bn_mod_exp_mont_small(r, a, num, p_minus_two, num, mont); } - -// |BN_mod_exp_mont_consttime| stores the precomputed powers in a specific -// layout so that accessing any of these table values shows the same access -// pattern as far as cache lines are concerned. The following functions are -// used to transfer a BIGNUM from/to that table. - -static void copy_to_prebuf(const BIGNUM *b, int top, unsigned char *buf, - int idx, int window) { - int i, j; - const int width = 1 << window; - BN_ULONG *table = (BN_ULONG *) buf; - - if (top > b->width) { - top = b->width; // this works because 'buf' is explicitly zeroed - } - - for (i = 0, j = idx; i < top; i++, j += width) { - table[j] = b->d[i]; - } +static void copy_to_prebuf(const BIGNUM *b, int top, BN_ULONG *table, int idx, + int window) { + int ret = bn_copy_words(table + idx * top, top, b); + assert(ret); // |b| is guaranteed to fit. + (void)ret; } -static int copy_from_prebuf(BIGNUM *b, int top, unsigned char *buf, int idx, +static int copy_from_prebuf(BIGNUM *b, int top, const BN_ULONG *table, int idx, int window) { - int i, j; - const int width = 1 << window; - volatile BN_ULONG *table = (volatile BN_ULONG *)buf; - if (!bn_wexpand(b, top)) { return 0; } - if (window <= 3) { - for (i = 0; i < top; i++, table += width) { - BN_ULONG acc = 0; - - for (j = 0; j < width; j++) { - acc |= table[j] & ((BN_ULONG)0 - (constant_time_eq_int(j, idx) & 1)); - } - - b->d[i] = acc; - } - } else { - int xstride = 1 << (window - 2); - BN_ULONG y0, y1, y2, y3; - - i = idx >> (window - 2); // equivalent of idx / xstride - idx &= xstride - 1; // equivalent of idx % xstride - - y0 = (BN_ULONG)0 - (constant_time_eq_int(i, 0) & 1); - y1 = (BN_ULONG)0 - (constant_time_eq_int(i, 1) & 1); - y2 = (BN_ULONG)0 - (constant_time_eq_int(i, 2) & 1); - y3 = (BN_ULONG)0 - (constant_time_eq_int(i, 3) & 1); - - for (i = 0; i < top; i++, table += width) { - BN_ULONG acc = 0; - - for (j = 0; j < xstride; j++) { - acc |= ((table[j + 0 * xstride] & y0) | (table[j + 1 * xstride] & y1) | - (table[j + 2 * xstride] & y2) | (table[j + 3 * xstride] & y3)) & - ((BN_ULONG)0 - (constant_time_eq_int(j, idx) & 1)); - } - - b->d[i] = acc; + OPENSSL_memset(b->d, 0, sizeof(BN_ULONG) * top); + const int width = 1 << window; + for (int i = 0; i < width; i++, table += top) { + BN_ULONG mask = constant_time_eq_int(i, idx); + for (int j = 0; j < top; j++) { + b->d[j] |= table[j] & mask; } } @@ -934,9 +859,6 @@ static int copy_from_prebuf(BIGNUM *b, int top, unsigned char *buf, int idx, return 1; } -// BN_mod_exp_mont_conttime is based on the assumption that the L1 data cache -// line width of the target processor is at least the following value. -#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH (64) #define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK \ (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1) @@ -972,9 +894,8 @@ static int copy_from_prebuf(BIGNUM *b, int top, unsigned char *buf, int idx, (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - \ (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK)))) -// This variant of BN_mod_exp_mont() uses fixed windows and the special -// precomputation memory layout to limit data-dependency to a minimum -// to protect secret exponents (cf. the hyper-threading timing attacks +// This variant of |BN_mod_exp_mont| uses fixed windows and fixed memory access +// patterns to protect secret exponents (cf. the hyper-threading timing attacks // pointed out by Colin Percival, // http://www.daemonology.net/hyperthreading-considered-harmful/) int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, @@ -986,14 +907,21 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, int numPowers; unsigned char *powerbufFree = NULL; int powerbufLen = 0; - unsigned char *powerbuf = NULL; + BN_ULONG *powerbuf = NULL; BIGNUM tmp, am; - BIGNUM *new_a = NULL; if (!BN_is_odd(m)) { OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); return 0; } + if (m->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (a->neg || BN_ucmp(a, m) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } // Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak // whether the top bits are zero. @@ -1001,7 +929,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, int bits = max_bits; if (bits == 0) { // x**0 mod 1 is still zero. - if (BN_is_one(m)) { + if (BN_abs_is_word(m, 1)) { BN_zero(rr); return 1; } @@ -1010,7 +938,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, // Allocate a montgomery context if it was not supplied by the caller. if (mont == NULL) { - new_mont = BN_MONT_CTX_new_for_modulus(m, ctx); + new_mont = BN_MONT_CTX_new_consttime(m, ctx); if (new_mont == NULL) { goto err; } @@ -1021,25 +949,25 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, // implementation assumes it can use |top| to size R. int top = mont->N.width; - if (a->neg || BN_ucmp(a, m) >= 0) { - new_a = BN_new(); - if (new_a == NULL || - !BN_nnmod(new_a, a, m, ctx)) { - goto err; - } - a = new_a; - } - -#ifdef RSAZ_ENABLED - // If the size of the operands allow it, perform the optimized - // RSAZ exponentiation. For further information see - // crypto/bn/rsaz_exp.c and accompanying assembly modules. - if ((16 == a->width) && (16 == p->width) && (BN_num_bits(m) == 1024) && - rsaz_avx2_eligible()) { +#if defined(OPENSSL_BN_ASM_MONT5) || defined(RSAZ_ENABLED) + // Share one large stack-allocated buffer between the RSAZ and non-RSAZ code + // paths. If we were to use separate static buffers for each then there is + // some chance that both large buffers would be allocated on the stack, + // causing the stack space requirement to be truly huge (~10KB). + alignas(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH) BN_ULONG + storage[MOD_EXP_CTIME_STORAGE_LEN]; +#endif +#if defined(RSAZ_ENABLED) + // If the size of the operands allow it, perform the optimized RSAZ + // exponentiation. For further information see crypto/fipsmodule/bn/rsaz_exp.c + // and accompanying assembly modules. + if (a->width == 16 && p->width == 16 && BN_num_bits(m) == 1024 && + rsaz_avx2_preferred()) { if (!bn_wexpand(rr, 16)) { goto err; } - RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d, mont->n0[0]); + RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d, mont->n0[0], + storage); rr->width = 16; rr->neg = 0; ret = 1; @@ -1063,29 +991,26 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, powerbufLen += sizeof(m->d[0]) * (top * numPowers + ((2 * top) > numPowers ? (2 * top) : numPowers)); -#ifdef alloca - if (powerbufLen < 3072) { - powerbufFree = alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH); - } else + +#if defined(OPENSSL_BN_ASM_MONT5) + if ((size_t)powerbufLen <= sizeof(storage)) { + powerbuf = storage; + } + // |storage| is more than large enough to handle 1024-bit inputs. + assert(powerbuf != NULL || top * BN_BITS2 > 1024); #endif - { - if ((powerbufFree = OPENSSL_malloc( - powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL) { + if (powerbuf == NULL) { + powerbufFree = + OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH); + if (powerbufFree == NULL) { goto err; } + powerbuf = (BN_ULONG *)MOD_EXP_CTIME_ALIGN(powerbufFree); } - - powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree); OPENSSL_memset(powerbuf, 0, powerbufLen); -#ifdef alloca - if (powerbufLen < 3072) { - powerbufFree = NULL; - } -#endif - // lay down tmp and am right after powers table - tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers); + tmp.d = powerbuf + top * numPowers; am.d = tmp.d + top; tmp.width = am.width = 0; tmp.dmax = am.dmax = top; @@ -1290,7 +1215,9 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, err: BN_MONT_CTX_free(new_mont); - BN_clear_free(new_a); + if (powerbuf != NULL && powerbufFree == NULL) { + OPENSSL_cleanse(powerbuf, powerbufLen); + } OPENSSL_free(powerbufFree); return (ret); } @@ -1303,6 +1230,11 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, int ret = 0; + // BN_mod_exp_mont requires reduced inputs. + if (bn_minimal_width(m) == 1) { + a %= m->d[0]; + } + if (!BN_set_word(&a_bignum, a)) { OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); goto err; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/exponentiation.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/exponentiation.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c.grpc_back index c85c00b1b..8d4a5c8b3 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/exponentiation.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/exponentiation.c.grpc_back @@ -109,6 +109,7 @@ #include #include +#include #include #include @@ -116,25 +117,8 @@ #include #include "internal.h" - - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) -#define OPENSSL_BN_ASM_MONT5 -#define RSAZ_ENABLED - #include "rsaz_exp.h" -void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, const void *table, - const BN_ULONG *np, const BN_ULONG *n0, int num, - int power); -void bn_scatter5(const BN_ULONG *inp, size_t num, void *table, size_t power); -void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power); -void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const void *table, - const BN_ULONG *np, const BN_ULONG *n0, int num, int power); -int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap, - const BN_ULONG *not_used, const BN_ULONG *np, - const BN_ULONG *n0, int num); -#endif int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) { int i, bits, ret = 0; @@ -445,21 +429,18 @@ static int BN_window_bits_for_exponent_size(int b) { static int mod_exp_recp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx) { - int i, j, bits, ret = 0, wstart, window; + int i, j, ret = 0, wstart, window; int start = 1; BIGNUM *aa; // Table of variables obtained from 'ctx' BIGNUM *val[TABLE_SIZE]; BN_RECP_CTX recp; - bits = BN_num_bits(p); + // This function is only called on even moduli. + assert(!BN_is_odd(m)); + int bits = BN_num_bits(p); if (bits == 0) { - // x**0 mod 1 is still zero. - if (BN_is_one(m)) { - BN_zero(r); - return 1; - } return BN_one(r); } @@ -585,6 +566,17 @@ err: int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx) { + if (m->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (a->neg || BN_ucmp(a, m) >= 0) { + if (!BN_nnmod(r, a, m, ctx)) { + return 0; + } + a = r; + } + if (BN_is_odd(m)) { return BN_mod_exp_mont(r, a, p, m, ctx, NULL); } @@ -598,10 +590,19 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); return 0; } + if (m->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (a->neg || BN_ucmp(a, m) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + int bits = BN_num_bits(p); if (bits == 0) { // x**0 mod 1 is still zero. - if (BN_is_one(m)) { + if (BN_abs_is_word(m, 1)) { BN_zero(rr); return 1; } @@ -613,48 +614,33 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, BN_MONT_CTX *new_mont = NULL; BN_CTX_start(ctx); - BIGNUM *d = BN_CTX_get(ctx); BIGNUM *r = BN_CTX_get(ctx); val[0] = BN_CTX_get(ctx); - if (!d || !r || !val[0]) { + if (r == NULL || val[0] == NULL) { goto err; } // Allocate a montgomery context if it was not supplied by the caller. if (mont == NULL) { - new_mont = BN_MONT_CTX_new_for_modulus(m, ctx); + new_mont = BN_MONT_CTX_new_consttime(m, ctx); if (new_mont == NULL) { goto err; } mont = new_mont; } - const BIGNUM *aa; - if (a->neg || BN_ucmp(a, m) >= 0) { - if (!BN_nnmod(val[0], a, m, ctx)) { - goto err; - } - aa = val[0]; - } else { - aa = a; - } - - if (BN_is_zero(aa)) { - BN_zero(rr); - ret = 1; - goto err; - } - // We exponentiate by looking at sliding windows of the exponent and - // precomputing powers of |aa|. Windows may be shifted so they always end on a - // set bit, so only precompute odd powers. We compute val[i] = aa^(2*i + 1) + // precomputing powers of |a|. Windows may be shifted so they always end on a + // set bit, so only precompute odd powers. We compute val[i] = a^(2*i + 1) // for i = 0 to 2^(window-1), all in Montgomery form. int window = BN_window_bits_for_exponent_size(bits); - if (!BN_to_montgomery(val[0], aa, mont, ctx)) { + if (!BN_to_montgomery(val[0], a, mont, ctx)) { goto err; } if (window > 1) { - if (!BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) { + BIGNUM *d = BN_CTX_get(ctx); + if (d == NULL || + !BN_mod_mul_montgomery(d, val[0], val[0], mont, ctx)) { goto err; } for (int i = 1; i < 1 << (window - 1); i++) { @@ -666,10 +652,8 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, } } - if (!bn_one_to_montgomery(r, mont, ctx)) { - goto err; - } - + // |p| is non-zero, so at least one window is non-zero. To save some + // multiplications, defer initializing |r| until then. int r_is_one = 1; int wstart = bits - 1; // The top bit of the window. for (;;) { @@ -706,7 +690,11 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, assert(wvalue & 1); assert(wvalue < (1 << window)); - if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) { + if (r_is_one) { + if (!BN_copy(r, val[wvalue >> 1])) { + goto err; + } + } else if (!BN_mod_mul_montgomery(r, r, val[wvalue >> 1], mont, ctx)) { goto err; } @@ -717,6 +705,9 @@ int BN_mod_exp_mont(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, wstart -= wsize + 1; } + // |p| is non-zero, so |r_is_one| must be cleared at some point. + assert(!r_is_one); + if (!BN_from_montgomery(rr, r, mont, ctx)) { goto err; } @@ -728,29 +719,24 @@ err: return ret; } -int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *p, size_t num_p, - const BN_MONT_CTX *mont) { - size_t num_n = mont->N.width; - if (num_n != num_a || num_n != num_r || num_n > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; - } - if (!BN_is_odd(&mont->N)) { - OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); - return 0; +void bn_mod_exp_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_ULONG *p, size_t num_p, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } - unsigned bits = 0; - if (num_p != 0) { - bits = BN_num_bits_word(p[num_p - 1]) + (num_p - 1) * BN_BITS2; + assert(BN_is_odd(&mont->N)); + + // Count the number of bits in |p|. Note this function treats |p| as public. + while (num_p != 0 && p[num_p - 1] == 0) { + num_p--; } - if (bits == 0) { - OPENSSL_memset(r, 0, num_r * sizeof(BN_ULONG)); - if (!BN_is_one(&mont->N)) { - r[0] = 1; - } - return 1; + if (num_p == 0) { + bn_from_montgomery_small(r, mont->RR.d, num, mont); + return; } + unsigned bits = BN_num_bits_word(p[num_p - 1]) + (num_p - 1) * BN_BITS2; + assert(bits != 0); // We exponentiate by looking at sliding windows of the exponent and // precomputing powers of |a|. Windows may be shifted so they always end on a @@ -760,34 +746,24 @@ int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, if (window > TABLE_BITS_SMALL) { window = TABLE_BITS_SMALL; // Tolerate excessively large |p|. } - int ret = 0; BN_ULONG val[TABLE_SIZE_SMALL][BN_SMALL_MAX_WORDS]; - OPENSSL_memcpy(val[0], a, num_n * sizeof(BN_ULONG)); + OPENSSL_memcpy(val[0], a, num * sizeof(BN_ULONG)); if (window > 1) { BN_ULONG d[BN_SMALL_MAX_WORDS]; - if (!bn_mod_mul_montgomery_small(d, num_n, val[0], num_n, val[0], num_n, - mont)) { - goto err; - } + bn_mod_mul_montgomery_small(d, val[0], val[0], num, mont); for (unsigned i = 1; i < 1u << (window - 1); i++) { - if (!bn_mod_mul_montgomery_small(val[i], num_n, val[i - 1], num_n, d, - num_n, mont)) { - goto err; - } + bn_mod_mul_montgomery_small(val[i], val[i - 1], d, num, mont); } } - if (!bn_one_to_montgomery_small(r, num_r, mont)) { - goto err; - } - + // |p| is non-zero, so at least one window is non-zero. To save some + // multiplications, defer initializing |r| until then. int r_is_one = 1; unsigned wstart = bits - 1; // The top bit of the window. for (;;) { if (!bn_is_bit_set_words(p, num_p, wstart)) { - if (!r_is_one && - !bn_mod_mul_montgomery_small(r, num_r, r, num_r, r, num_r, mont)) { - goto err; + if (!r_is_one) { + bn_mod_mul_montgomery_small(r, r, r, num, mont); } if (wstart == 0) { break; @@ -810,19 +786,17 @@ int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, // Shift |r| to the end of the window. if (!r_is_one) { for (unsigned i = 0; i < wsize + 1; i++) { - if (!bn_mod_mul_montgomery_small(r, num_r, r, num_r, r, num_r, mont)) { - goto err; - } + bn_mod_mul_montgomery_small(r, r, r, num, mont); } } assert(wvalue & 1); assert(wvalue < (1u << window)); - if (!bn_mod_mul_montgomery_small(r, num_r, r, num_r, val[wvalue >> 1], - num_n, mont)) { - goto err; + if (r_is_one) { + OPENSSL_memcpy(r, val[wvalue >> 1], num * sizeof(BN_ULONG)); + } else { + bn_mod_mul_montgomery_small(r, r, val[wvalue >> 1], num, mont); } - r_is_one = 0; if (wstart == wsize) { break; @@ -830,103 +804,54 @@ int bn_mod_exp_mont_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, wstart -= wsize + 1; } - ret = 1; - -err: + // |p| is non-zero, so |r_is_one| must be cleared at some point. + assert(!r_is_one); OPENSSL_cleanse(val, sizeof(val)); - return ret; } -int bn_mod_inverse_prime_mont_small(BN_ULONG *r, size_t num_r, - const BN_ULONG *a, size_t num_a, - const BN_MONT_CTX *mont) { - const BN_ULONG *p = mont->N.d; - size_t num_p = mont->N.width; - if (num_p > BN_SMALL_MAX_WORDS || num_p == 0) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; +void bn_mod_inverse_prime_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } // Per Fermat's Little Theorem, a^-1 = a^(p-2) (mod p) for p prime. BN_ULONG p_minus_two[BN_SMALL_MAX_WORDS]; - OPENSSL_memcpy(p_minus_two, p, num_p * sizeof(BN_ULONG)); + const BN_ULONG *p = mont->N.d; + OPENSSL_memcpy(p_minus_two, p, num * sizeof(BN_ULONG)); if (p_minus_two[0] >= 2) { p_minus_two[0] -= 2; } else { p_minus_two[0] -= 2; - for (size_t i = 1; i < num_p; i++) { + for (size_t i = 1; i < num; i++) { if (p_minus_two[i]-- != 0) { break; } } } - return bn_mod_exp_mont_small(r, num_r, a, num_a, p_minus_two, num_p, mont); + bn_mod_exp_mont_small(r, a, num, p_minus_two, num, mont); } - -// |BN_mod_exp_mont_consttime| stores the precomputed powers in a specific -// layout so that accessing any of these table values shows the same access -// pattern as far as cache lines are concerned. The following functions are -// used to transfer a BIGNUM from/to that table. - -static void copy_to_prebuf(const BIGNUM *b, int top, unsigned char *buf, - int idx, int window) { - int i, j; - const int width = 1 << window; - BN_ULONG *table = (BN_ULONG *) buf; - - if (top > b->width) { - top = b->width; // this works because 'buf' is explicitly zeroed - } - - for (i = 0, j = idx; i < top; i++, j += width) { - table[j] = b->d[i]; - } +static void copy_to_prebuf(const BIGNUM *b, int top, BN_ULONG *table, int idx, + int window) { + int ret = bn_copy_words(table + idx * top, top, b); + assert(ret); // |b| is guaranteed to fit. + (void)ret; } -static int copy_from_prebuf(BIGNUM *b, int top, unsigned char *buf, int idx, +static int copy_from_prebuf(BIGNUM *b, int top, const BN_ULONG *table, int idx, int window) { - int i, j; - const int width = 1 << window; - volatile BN_ULONG *table = (volatile BN_ULONG *)buf; - if (!bn_wexpand(b, top)) { return 0; } - if (window <= 3) { - for (i = 0; i < top; i++, table += width) { - BN_ULONG acc = 0; - - for (j = 0; j < width; j++) { - acc |= table[j] & ((BN_ULONG)0 - (constant_time_eq_int(j, idx) & 1)); - } - - b->d[i] = acc; - } - } else { - int xstride = 1 << (window - 2); - BN_ULONG y0, y1, y2, y3; - - i = idx >> (window - 2); // equivalent of idx / xstride - idx &= xstride - 1; // equivalent of idx % xstride - - y0 = (BN_ULONG)0 - (constant_time_eq_int(i, 0) & 1); - y1 = (BN_ULONG)0 - (constant_time_eq_int(i, 1) & 1); - y2 = (BN_ULONG)0 - (constant_time_eq_int(i, 2) & 1); - y3 = (BN_ULONG)0 - (constant_time_eq_int(i, 3) & 1); - - for (i = 0; i < top; i++, table += width) { - BN_ULONG acc = 0; - - for (j = 0; j < xstride; j++) { - acc |= ((table[j + 0 * xstride] & y0) | (table[j + 1 * xstride] & y1) | - (table[j + 2 * xstride] & y2) | (table[j + 3 * xstride] & y3)) & - ((BN_ULONG)0 - (constant_time_eq_int(j, idx) & 1)); - } - - b->d[i] = acc; + OPENSSL_memset(b->d, 0, sizeof(BN_ULONG) * top); + const int width = 1 << window; + for (int i = 0; i < width; i++, table += top) { + BN_ULONG mask = constant_time_eq_int(i, idx); + for (int j = 0; j < top; j++) { + b->d[j] |= table[j] & mask; } } @@ -934,9 +859,6 @@ static int copy_from_prebuf(BIGNUM *b, int top, unsigned char *buf, int idx, return 1; } -// BN_mod_exp_mont_conttime is based on the assumption that the L1 data cache -// line width of the target processor is at least the following value. -#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH (64) #define MOD_EXP_CTIME_MIN_CACHE_LINE_MASK \ (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - 1) @@ -972,9 +894,8 @@ static int copy_from_prebuf(BIGNUM *b, int top, unsigned char *buf, int idx, (MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH - \ (((size_t)(x_)) & (MOD_EXP_CTIME_MIN_CACHE_LINE_MASK)))) -// This variant of BN_mod_exp_mont() uses fixed windows and the special -// precomputation memory layout to limit data-dependency to a minimum -// to protect secret exponents (cf. the hyper-threading timing attacks +// This variant of |BN_mod_exp_mont| uses fixed windows and fixed memory access +// patterns to protect secret exponents (cf. the hyper-threading timing attacks // pointed out by Colin Percival, // http://www.daemonology.net/hyperthreading-considered-harmful/) int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, @@ -986,14 +907,21 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, int numPowers; unsigned char *powerbufFree = NULL; int powerbufLen = 0; - unsigned char *powerbuf = NULL; + BN_ULONG *powerbuf = NULL; BIGNUM tmp, am; - BIGNUM *new_a = NULL; if (!BN_is_odd(m)) { OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); return 0; } + if (m->neg) { + OPENSSL_PUT_ERROR(BN, BN_R_NEGATIVE_NUMBER); + return 0; + } + if (a->neg || BN_ucmp(a, m) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } // Use all bits stored in |p|, rather than |BN_num_bits|, so we do not leak // whether the top bits are zero. @@ -1001,7 +929,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, int bits = max_bits; if (bits == 0) { // x**0 mod 1 is still zero. - if (BN_is_one(m)) { + if (BN_abs_is_word(m, 1)) { BN_zero(rr); return 1; } @@ -1010,7 +938,7 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, // Allocate a montgomery context if it was not supplied by the caller. if (mont == NULL) { - new_mont = BN_MONT_CTX_new_for_modulus(m, ctx); + new_mont = BN_MONT_CTX_new_consttime(m, ctx); if (new_mont == NULL) { goto err; } @@ -1021,25 +949,25 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, // implementation assumes it can use |top| to size R. int top = mont->N.width; - if (a->neg || BN_ucmp(a, m) >= 0) { - new_a = BN_new(); - if (new_a == NULL || - !BN_nnmod(new_a, a, m, ctx)) { - goto err; - } - a = new_a; - } - -#ifdef RSAZ_ENABLED - // If the size of the operands allow it, perform the optimized - // RSAZ exponentiation. For further information see - // crypto/bn/rsaz_exp.c and accompanying assembly modules. - if ((16 == a->width) && (16 == p->width) && (BN_num_bits(m) == 1024) && - rsaz_avx2_eligible()) { +#if defined(OPENSSL_BN_ASM_MONT5) || defined(RSAZ_ENABLED) + // Share one large stack-allocated buffer between the RSAZ and non-RSAZ code + // paths. If we were to use separate static buffers for each then there is + // some chance that both large buffers would be allocated on the stack, + // causing the stack space requirement to be truly huge (~10KB). + alignas(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH) BN_ULONG + storage[MOD_EXP_CTIME_STORAGE_LEN]; +#endif +#if defined(RSAZ_ENABLED) + // If the size of the operands allow it, perform the optimized RSAZ + // exponentiation. For further information see crypto/fipsmodule/bn/rsaz_exp.c + // and accompanying assembly modules. + if (a->width == 16 && p->width == 16 && BN_num_bits(m) == 1024 && + rsaz_avx2_preferred()) { if (!bn_wexpand(rr, 16)) { goto err; } - RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d, mont->n0[0]); + RSAZ_1024_mod_exp_avx2(rr->d, a->d, p->d, m->d, mont->RR.d, mont->n0[0], + storage); rr->width = 16; rr->neg = 0; ret = 1; @@ -1063,29 +991,26 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, powerbufLen += sizeof(m->d[0]) * (top * numPowers + ((2 * top) > numPowers ? (2 * top) : numPowers)); -#ifdef alloca - if (powerbufLen < 3072) { - powerbufFree = alloca(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH); - } else + +#if defined(OPENSSL_BN_ASM_MONT5) + if ((size_t)powerbufLen <= sizeof(storage)) { + powerbuf = storage; + } + // |storage| is more than large enough to handle 1024-bit inputs. + assert(powerbuf != NULL || top * BN_BITS2 > 1024); #endif - { - if ((powerbufFree = OPENSSL_malloc( - powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH)) == NULL) { + if (powerbuf == NULL) { + powerbufFree = + OPENSSL_malloc(powerbufLen + MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH); + if (powerbufFree == NULL) { goto err; } + powerbuf = (BN_ULONG *)MOD_EXP_CTIME_ALIGN(powerbufFree); } - - powerbuf = MOD_EXP_CTIME_ALIGN(powerbufFree); OPENSSL_memset(powerbuf, 0, powerbufLen); -#ifdef alloca - if (powerbufLen < 3072) { - powerbufFree = NULL; - } -#endif - // lay down tmp and am right after powers table - tmp.d = (BN_ULONG *)(powerbuf + sizeof(m->d[0]) * top * numPowers); + tmp.d = powerbuf + top * numPowers; am.d = tmp.d + top; tmp.width = am.width = 0; tmp.dmax = am.dmax = top; @@ -1290,7 +1215,9 @@ int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, err: BN_MONT_CTX_free(new_mont); - BN_clear_free(new_a); + if (powerbuf != NULL && powerbufFree == NULL) { + OPENSSL_cleanse(powerbuf, powerbufLen); + } OPENSSL_free(powerbufFree); return (ret); } @@ -1303,6 +1230,11 @@ int BN_mod_exp_mont_word(BIGNUM *rr, BN_ULONG a, const BIGNUM *p, int ret = 0; + // BN_mod_exp_mont requires reduced inputs. + if (bn_minimal_width(m) == 1) { + a %= m->d[0]; + } + if (!BN_set_word(&a_bignum, a)) { OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); goto err; diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c new file mode 100644 index 000000000..258bea24a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c @@ -0,0 +1,378 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include + +#include "internal.h" + + +int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, + const BIGNUM *n, BN_CTX *ctx) { + *out_no_inverse = 0; + + if (!BN_is_odd(n)) { + OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); + return 0; + } + + if (BN_is_negative(a) || BN_cmp(a, n) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + + BIGNUM *A, *B, *X, *Y; + int ret = 0; + int sign; + + BN_CTX_start(ctx); + A = BN_CTX_get(ctx); + B = BN_CTX_get(ctx); + X = BN_CTX_get(ctx); + Y = BN_CTX_get(ctx); + if (Y == NULL) { + goto err; + } + + BIGNUM *R = out; + + BN_zero(Y); + if (!BN_one(X) || BN_copy(B, a) == NULL || BN_copy(A, n) == NULL) { + goto err; + } + A->neg = 0; + sign = -1; + // From B = a mod |n|, A = |n| it follows that + // + // 0 <= B < A, + // -sign*X*a == B (mod |n|), + // sign*Y*a == A (mod |n|). + + // Binary inversion algorithm; requires odd modulus. This is faster than the + // general algorithm if the modulus is sufficiently small (about 400 .. 500 + // bits on 32-bit systems, but much more on 64-bit systems) + int shift; + + while (!BN_is_zero(B)) { + // 0 < B < |n|, + // 0 < A <= |n|, + // (1) -sign*X*a == B (mod |n|), + // (2) sign*Y*a == A (mod |n|) + + // Now divide B by the maximum possible power of two in the integers, + // and divide X by the same value mod |n|. + // When we're done, (1) still holds. + shift = 0; + while (!BN_is_bit_set(B, shift)) { + // note that 0 < B + shift++; + + if (BN_is_odd(X)) { + if (!BN_uadd(X, X, n)) { + goto err; + } + } + // now X is even, so we can easily divide it by two + if (!BN_rshift1(X, X)) { + goto err; + } + } + if (shift > 0) { + if (!BN_rshift(B, B, shift)) { + goto err; + } + } + + // Same for A and Y. Afterwards, (2) still holds. + shift = 0; + while (!BN_is_bit_set(A, shift)) { + // note that 0 < A + shift++; + + if (BN_is_odd(Y)) { + if (!BN_uadd(Y, Y, n)) { + goto err; + } + } + // now Y is even + if (!BN_rshift1(Y, Y)) { + goto err; + } + } + if (shift > 0) { + if (!BN_rshift(A, A, shift)) { + goto err; + } + } + + // We still have (1) and (2). + // Both A and B are odd. + // The following computations ensure that + // + // 0 <= B < |n|, + // 0 < A < |n|, + // (1) -sign*X*a == B (mod |n|), + // (2) sign*Y*a == A (mod |n|), + // + // and that either A or B is even in the next iteration. + if (BN_ucmp(B, A) >= 0) { + // -sign*(X + Y)*a == B - A (mod |n|) + if (!BN_uadd(X, X, Y)) { + goto err; + } + // NB: we could use BN_mod_add_quick(X, X, Y, n), but that + // actually makes the algorithm slower + if (!BN_usub(B, B, A)) { + goto err; + } + } else { + // sign*(X + Y)*a == A - B (mod |n|) + if (!BN_uadd(Y, Y, X)) { + goto err; + } + // as above, BN_mod_add_quick(Y, Y, X, n) would slow things down + if (!BN_usub(A, A, B)) { + goto err; + } + } + } + + if (!BN_is_one(A)) { + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + goto err; + } + + // The while loop (Euclid's algorithm) ends when + // A == gcd(a,n); + // we have + // sign*Y*a == A (mod |n|), + // where Y is non-negative. + + if (sign < 0) { + if (!BN_sub(Y, n, Y)) { + goto err; + } + } + // Now Y*a == A (mod |n|). + + // Y*a == 1 (mod |n|) + if (!Y->neg && BN_ucmp(Y, n) < 0) { + if (!BN_copy(R, Y)) { + goto err; + } + } else { + if (!BN_nnmod(R, Y, n, ctx)) { + goto err; + } + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +BIGNUM *BN_mod_inverse(BIGNUM *out, const BIGNUM *a, const BIGNUM *n, + BN_CTX *ctx) { + BIGNUM *new_out = NULL; + if (out == NULL) { + new_out = BN_new(); + if (new_out == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + out = new_out; + } + + int ok = 0; + BIGNUM *a_reduced = NULL; + if (a->neg || BN_ucmp(a, n) >= 0) { + a_reduced = BN_dup(a); + if (a_reduced == NULL) { + goto err; + } + if (!BN_nnmod(a_reduced, a_reduced, n, ctx)) { + goto err; + } + a = a_reduced; + } + + int no_inverse; + if (!BN_is_odd(n)) { + if (!bn_mod_inverse_consttime(out, &no_inverse, a, n, ctx)) { + goto err; + } + } else if (!BN_mod_inverse_odd(out, &no_inverse, a, n, ctx)) { + goto err; + } + + ok = 1; + +err: + if (!ok) { + BN_free(new_out); + out = NULL; + } + BN_free(a_reduced); + return out; +} + +int BN_mod_inverse_blinded(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + *out_no_inverse = 0; + + if (BN_is_negative(a) || BN_cmp(a, &mont->N) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + + int ret = 0; + BIGNUM blinding_factor; + BN_init(&blinding_factor); + + if (!BN_rand_range_ex(&blinding_factor, 1, &mont->N) || + !BN_mod_mul_montgomery(out, &blinding_factor, a, mont, ctx) || + !BN_mod_inverse_odd(out, out_no_inverse, out, &mont->N, ctx) || + !BN_mod_mul_montgomery(out, &blinding_factor, out, mont, ctx)) { + OPENSSL_PUT_ERROR(BN, ERR_R_BN_LIB); + goto err; + } + + ret = 1; + +err: + BN_free(&blinding_factor); + return ret; +} + +int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p) { + BN_CTX_start(ctx); + BIGNUM *p_minus_2 = BN_CTX_get(ctx); + int ok = p_minus_2 != NULL && + BN_copy(p_minus_2, p) && + BN_sub_word(p_minus_2, 2) && + BN_mod_exp_mont(out, a, p_minus_2, p, ctx, mont_p); + BN_CTX_end(ctx); + return ok; +} + +int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p) { + BN_CTX_start(ctx); + BIGNUM *p_minus_2 = BN_CTX_get(ctx); + int ok = p_minus_2 != NULL && + BN_copy(p_minus_2, p) && + BN_sub_word(p_minus_2, 2) && + BN_mod_exp_mont_consttime(out, a, p_minus_2, p, ctx, mont_p); + BN_CTX_end(ctx); + return ok; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c.grpc_back new file mode 100644 index 000000000..bd0fa6f5d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd.c.grpc_back @@ -0,0 +1,378 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include + +#include "internal.h" + + +int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, + const BIGNUM *n, BN_CTX *ctx) { + *out_no_inverse = 0; + + if (!BN_is_odd(n)) { + OPENSSL_PUT_ERROR(BN, BN_R_CALLED_WITH_EVEN_MODULUS); + return 0; + } + + if (BN_is_negative(a) || BN_cmp(a, n) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + + BIGNUM *A, *B, *X, *Y; + int ret = 0; + int sign; + + BN_CTX_start(ctx); + A = BN_CTX_get(ctx); + B = BN_CTX_get(ctx); + X = BN_CTX_get(ctx); + Y = BN_CTX_get(ctx); + if (Y == NULL) { + goto err; + } + + BIGNUM *R = out; + + BN_zero(Y); + if (!BN_one(X) || BN_copy(B, a) == NULL || BN_copy(A, n) == NULL) { + goto err; + } + A->neg = 0; + sign = -1; + // From B = a mod |n|, A = |n| it follows that + // + // 0 <= B < A, + // -sign*X*a == B (mod |n|), + // sign*Y*a == A (mod |n|). + + // Binary inversion algorithm; requires odd modulus. This is faster than the + // general algorithm if the modulus is sufficiently small (about 400 .. 500 + // bits on 32-bit systems, but much more on 64-bit systems) + int shift; + + while (!BN_is_zero(B)) { + // 0 < B < |n|, + // 0 < A <= |n|, + // (1) -sign*X*a == B (mod |n|), + // (2) sign*Y*a == A (mod |n|) + + // Now divide B by the maximum possible power of two in the integers, + // and divide X by the same value mod |n|. + // When we're done, (1) still holds. + shift = 0; + while (!BN_is_bit_set(B, shift)) { + // note that 0 < B + shift++; + + if (BN_is_odd(X)) { + if (!BN_uadd(X, X, n)) { + goto err; + } + } + // now X is even, so we can easily divide it by two + if (!BN_rshift1(X, X)) { + goto err; + } + } + if (shift > 0) { + if (!BN_rshift(B, B, shift)) { + goto err; + } + } + + // Same for A and Y. Afterwards, (2) still holds. + shift = 0; + while (!BN_is_bit_set(A, shift)) { + // note that 0 < A + shift++; + + if (BN_is_odd(Y)) { + if (!BN_uadd(Y, Y, n)) { + goto err; + } + } + // now Y is even + if (!BN_rshift1(Y, Y)) { + goto err; + } + } + if (shift > 0) { + if (!BN_rshift(A, A, shift)) { + goto err; + } + } + + // We still have (1) and (2). + // Both A and B are odd. + // The following computations ensure that + // + // 0 <= B < |n|, + // 0 < A < |n|, + // (1) -sign*X*a == B (mod |n|), + // (2) sign*Y*a == A (mod |n|), + // + // and that either A or B is even in the next iteration. + if (BN_ucmp(B, A) >= 0) { + // -sign*(X + Y)*a == B - A (mod |n|) + if (!BN_uadd(X, X, Y)) { + goto err; + } + // NB: we could use BN_mod_add_quick(X, X, Y, n), but that + // actually makes the algorithm slower + if (!BN_usub(B, B, A)) { + goto err; + } + } else { + // sign*(X + Y)*a == A - B (mod |n|) + if (!BN_uadd(Y, Y, X)) { + goto err; + } + // as above, BN_mod_add_quick(Y, Y, X, n) would slow things down + if (!BN_usub(A, A, B)) { + goto err; + } + } + } + + if (!BN_is_one(A)) { + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + goto err; + } + + // The while loop (Euclid's algorithm) ends when + // A == gcd(a,n); + // we have + // sign*Y*a == A (mod |n|), + // where Y is non-negative. + + if (sign < 0) { + if (!BN_sub(Y, n, Y)) { + goto err; + } + } + // Now Y*a == A (mod |n|). + + // Y*a == 1 (mod |n|) + if (!Y->neg && BN_ucmp(Y, n) < 0) { + if (!BN_copy(R, Y)) { + goto err; + } + } else { + if (!BN_nnmod(R, Y, n, ctx)) { + goto err; + } + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +BIGNUM *BN_mod_inverse(BIGNUM *out, const BIGNUM *a, const BIGNUM *n, + BN_CTX *ctx) { + BIGNUM *new_out = NULL; + if (out == NULL) { + new_out = BN_new(); + if (new_out == NULL) { + OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); + return NULL; + } + out = new_out; + } + + int ok = 0; + BIGNUM *a_reduced = NULL; + if (a->neg || BN_ucmp(a, n) >= 0) { + a_reduced = BN_dup(a); + if (a_reduced == NULL) { + goto err; + } + if (!BN_nnmod(a_reduced, a_reduced, n, ctx)) { + goto err; + } + a = a_reduced; + } + + int no_inverse; + if (!BN_is_odd(n)) { + if (!bn_mod_inverse_consttime(out, &no_inverse, a, n, ctx)) { + goto err; + } + } else if (!BN_mod_inverse_odd(out, &no_inverse, a, n, ctx)) { + goto err; + } + + ok = 1; + +err: + if (!ok) { + BN_free(new_out); + out = NULL; + } + BN_free(a_reduced); + return out; +} + +int BN_mod_inverse_blinded(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + *out_no_inverse = 0; + + if (BN_is_negative(a) || BN_cmp(a, &mont->N) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + + int ret = 0; + BIGNUM blinding_factor; + BN_init(&blinding_factor); + + if (!BN_rand_range_ex(&blinding_factor, 1, &mont->N) || + !BN_mod_mul_montgomery(out, &blinding_factor, a, mont, ctx) || + !BN_mod_inverse_odd(out, out_no_inverse, out, &mont->N, ctx) || + !BN_mod_mul_montgomery(out, &blinding_factor, out, mont, ctx)) { + OPENSSL_PUT_ERROR(BN, ERR_R_BN_LIB); + goto err; + } + + ret = 1; + +err: + BN_free(&blinding_factor); + return ret; +} + +int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p) { + BN_CTX_start(ctx); + BIGNUM *p_minus_2 = BN_CTX_get(ctx); + int ok = p_minus_2 != NULL && + BN_copy(p_minus_2, p) && + BN_sub_word(p_minus_2, 2) && + BN_mod_exp_mont(out, a, p_minus_2, p, ctx, mont_p); + BN_CTX_end(ctx); + return ok; +} + +int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p) { + BN_CTX_start(ctx); + BIGNUM *p_minus_2 = BN_CTX_get(ctx); + int ok = p_minus_2 != NULL && + BN_copy(p_minus_2, p) && + BN_sub_word(p_minus_2, 2) && + BN_mod_exp_mont_consttime(out, a, p_minus_2, p, ctx, mont_p); + BN_CTX_end(ctx); + return ok; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c new file mode 100644 index 000000000..83615d555 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c @@ -0,0 +1,325 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include + +#include "internal.h" + + +static BN_ULONG word_is_odd_mask(BN_ULONG a) { return (BN_ULONG)0 - (a & 1); } + +static void maybe_rshift1_words(BN_ULONG *a, BN_ULONG mask, BN_ULONG *tmp, + size_t num) { + bn_rshift1_words(tmp, a, num); + bn_select_words(a, mask, tmp, a, num); +} + +static void maybe_rshift1_words_carry(BN_ULONG *a, BN_ULONG carry, + BN_ULONG mask, BN_ULONG *tmp, + size_t num) { + maybe_rshift1_words(a, mask, tmp, num); + if (num != 0) { + carry &= mask; + a[num - 1] |= carry << (BN_BITS2-1); + } +} + +static BN_ULONG maybe_add_words(BN_ULONG *a, BN_ULONG mask, const BN_ULONG *b, + BN_ULONG *tmp, size_t num) { + BN_ULONG carry = bn_add_words(tmp, a, b, num); + bn_select_words(a, mask, tmp, a, num); + return carry & mask; +} + +static int bn_gcd_consttime(BIGNUM *r, unsigned *out_shift, const BIGNUM *x, + const BIGNUM *y, BN_CTX *ctx) { + size_t width = x->width > y->width ? x->width : y->width; + if (width == 0) { + *out_shift = 0; + BN_zero(r); + return 1; + } + + // This is a constant-time implementation of Stein's algorithm (binary GCD). + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *u = BN_CTX_get(ctx); + BIGNUM *v = BN_CTX_get(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (u == NULL || v == NULL || tmp == NULL || + !BN_copy(u, x) || + !BN_copy(v, y) || + !bn_resize_words(u, width) || + !bn_resize_words(v, width) || + !bn_resize_words(tmp, width)) { + goto err; + } + + // Each loop iteration halves at least one of |u| and |v|. Thus we need at + // most the combined bit width of inputs for at least one value to be zero. + unsigned x_bits = x->width * BN_BITS2, y_bits = y->width * BN_BITS2; + unsigned num_iters = x_bits + y_bits; + if (num_iters < x_bits) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + goto err; + } + + unsigned shift = 0; + for (unsigned i = 0; i < num_iters; i++) { + BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); + + // If both |u| and |v| are odd, subtract the smaller from the larger. + BN_ULONG u_less_than_v = + (BN_ULONG)0 - bn_sub_words(tmp->d, u->d, v->d, width); + bn_select_words(u->d, both_odd & ~u_less_than_v, tmp->d, u->d, width); + bn_sub_words(tmp->d, v->d, u->d, width); + bn_select_words(v->d, both_odd & u_less_than_v, tmp->d, v->d, width); + + // At least one of |u| and |v| is now even. + BN_ULONG u_is_odd = word_is_odd_mask(u->d[0]); + BN_ULONG v_is_odd = word_is_odd_mask(v->d[0]); + assert(!(u_is_odd & v_is_odd)); + + // If both are even, the final GCD gains a factor of two. + shift += 1 & (~u_is_odd & ~v_is_odd); + + // Halve any which are even. + maybe_rshift1_words(u->d, ~u_is_odd, tmp->d, width); + maybe_rshift1_words(v->d, ~v_is_odd, tmp->d, width); + } + + // One of |u| or |v| is zero at this point. The algorithm usually makes |u| + // zero, unless |y| was already zero on input. Fix this by combining the + // values. + assert(BN_is_zero(u) || BN_is_zero(v)); + for (size_t i = 0; i < width; i++) { + v->d[i] |= u->d[i]; + } + + *out_shift = shift; + ret = bn_set_words(r, v->d, width); + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_gcd(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) { + unsigned shift; + return bn_gcd_consttime(r, &shift, x, y, ctx) && + BN_lshift(r, r, shift); +} + +int bn_is_relatively_prime(int *out_relatively_prime, const BIGNUM *x, + const BIGNUM *y, BN_CTX *ctx) { + int ret = 0; + BN_CTX_start(ctx); + unsigned shift; + BIGNUM *gcd = BN_CTX_get(ctx); + if (gcd == NULL || + !bn_gcd_consttime(gcd, &shift, x, y, ctx)) { + goto err; + } + + // Check that 2^|shift| * |gcd| is one. + if (gcd->width == 0) { + *out_relatively_prime = 0; + } else { + BN_ULONG mask = shift | (gcd->d[0] ^ 1); + for (int i = 1; i < gcd->width; i++) { + mask |= gcd->d[i]; + } + *out_relatively_prime = mask == 0; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + BN_CTX_start(ctx); + unsigned shift; + BIGNUM *gcd = BN_CTX_get(ctx); + int ret = gcd != NULL && + bn_mul_consttime(r, a, b, ctx) && + bn_gcd_consttime(gcd, &shift, a, b, ctx) && + bn_div_consttime(r, NULL, r, gcd, ctx) && + bn_rshift_secret_shift(r, r, shift, ctx); + BN_CTX_end(ctx); + return ret; +} + +int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, const BIGNUM *a, + const BIGNUM *n, BN_CTX *ctx) { + *out_no_inverse = 0; + if (BN_is_negative(a) || BN_ucmp(a, n) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + if (BN_is_zero(a)) { + if (BN_is_one(n)) { + BN_zero(r); + return 1; + } + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + return 0; + } + + // This is a constant-time implementation of the extended binary GCD + // algorithm. It is adapted from the Handbook of Applied Cryptography, section + // 14.4.3, algorithm 14.51, and modified to bound coefficients and avoid + // negative numbers. + // + // For more details and proof of correctness, see + // https://github.com/mit-plv/fiat-crypto/pull/333. In particular, see |step| + // and |mod_inverse_consttime| for the algorithm in Gallina and see + // |mod_inverse_consttime_spec| for the correctness result. + + if (!BN_is_odd(a) && !BN_is_odd(n)) { + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + return 0; + } + + // This function exists to compute the RSA private exponent, where |a| is one + // word. We'll thus use |a_width| when available. + size_t n_width = n->width, a_width = a->width; + if (a_width > n_width) { + a_width = n_width; + } + + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *u = BN_CTX_get(ctx); + BIGNUM *v = BN_CTX_get(ctx); + BIGNUM *A = BN_CTX_get(ctx); + BIGNUM *B = BN_CTX_get(ctx); + BIGNUM *C = BN_CTX_get(ctx); + BIGNUM *D = BN_CTX_get(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + BIGNUM *tmp2 = BN_CTX_get(ctx); + if (u == NULL || v == NULL || A == NULL || B == NULL || C == NULL || + D == NULL || tmp == NULL || tmp2 == NULL || + !BN_copy(u, a) || + !BN_copy(v, n) || + !BN_one(A) || + !BN_one(D) || + // For convenience, size |u| and |v| equivalently. + !bn_resize_words(u, n_width) || + !bn_resize_words(v, n_width) || + // |A| and |C| are bounded by |m|. + !bn_resize_words(A, n_width) || + !bn_resize_words(C, n_width) || + // |B| and |D| are bounded by |a|. + !bn_resize_words(B, a_width) || + !bn_resize_words(D, a_width) || + // |tmp| and |tmp2| may be used at either size. + !bn_resize_words(tmp, n_width) || + !bn_resize_words(tmp2, n_width)) { + goto err; + } + + // Each loop iteration halves at least one of |u| and |v|. Thus we need at + // most the combined bit width of inputs for at least one value to be zero. + unsigned a_bits = a_width * BN_BITS2, n_bits = n_width * BN_BITS2; + unsigned num_iters = a_bits + n_bits; + if (num_iters < a_bits) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + goto err; + } + + // Before and after each loop iteration, the following hold: + // + // u = A*a - B*n + // v = D*n - C*a + // 0 < u <= a + // 0 <= v <= n + // 0 <= A < n + // 0 <= B <= a + // 0 <= C < n + // 0 <= D <= a + // + // After each loop iteration, u and v only get smaller, and at least one of + // them shrinks by at least a factor of two. + for (unsigned i = 0; i < num_iters; i++) { + BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); + + // If both |u| and |v| are odd, subtract the smaller from the larger. + BN_ULONG v_less_than_u = + (BN_ULONG)0 - bn_sub_words(tmp->d, v->d, u->d, n_width); + bn_select_words(v->d, both_odd & ~v_less_than_u, tmp->d, v->d, n_width); + bn_sub_words(tmp->d, u->d, v->d, n_width); + bn_select_words(u->d, both_odd & v_less_than_u, tmp->d, u->d, n_width); + + // If we updated one of the values, update the corresponding coefficient. + BN_ULONG carry = bn_add_words(tmp->d, A->d, C->d, n_width); + carry -= bn_sub_words(tmp2->d, tmp->d, n->d, n_width); + bn_select_words(tmp->d, carry, tmp->d, tmp2->d, n_width); + bn_select_words(A->d, both_odd & v_less_than_u, tmp->d, A->d, n_width); + bn_select_words(C->d, both_odd & ~v_less_than_u, tmp->d, C->d, n_width); + + bn_add_words(tmp->d, B->d, D->d, a_width); + bn_sub_words(tmp2->d, tmp->d, a->d, a_width); + bn_select_words(tmp->d, carry, tmp->d, tmp2->d, a_width); + bn_select_words(B->d, both_odd & v_less_than_u, tmp->d, B->d, a_width); + bn_select_words(D->d, both_odd & ~v_less_than_u, tmp->d, D->d, a_width); + + // Our loop invariants hold at this point. Additionally, exactly one of |u| + // and |v| is now even. + BN_ULONG u_is_even = ~word_is_odd_mask(u->d[0]); + BN_ULONG v_is_even = ~word_is_odd_mask(v->d[0]); + assert(u_is_even != v_is_even); + + // Halve the even one and adjust the corresponding coefficient. + maybe_rshift1_words(u->d, u_is_even, tmp->d, n_width); + BN_ULONG A_or_B_is_odd = + word_is_odd_mask(A->d[0]) | word_is_odd_mask(B->d[0]); + BN_ULONG A_carry = + maybe_add_words(A->d, A_or_B_is_odd & u_is_even, n->d, tmp->d, n_width); + BN_ULONG B_carry = + maybe_add_words(B->d, A_or_B_is_odd & u_is_even, a->d, tmp->d, a_width); + maybe_rshift1_words_carry(A->d, A_carry, u_is_even, tmp->d, n_width); + maybe_rshift1_words_carry(B->d, B_carry, u_is_even, tmp->d, a_width); + + maybe_rshift1_words(v->d, v_is_even, tmp->d, n_width); + BN_ULONG C_or_D_is_odd = + word_is_odd_mask(C->d[0]) | word_is_odd_mask(D->d[0]); + BN_ULONG C_carry = + maybe_add_words(C->d, C_or_D_is_odd & v_is_even, n->d, tmp->d, n_width); + BN_ULONG D_carry = + maybe_add_words(D->d, C_or_D_is_odd & v_is_even, a->d, tmp->d, a_width); + maybe_rshift1_words_carry(C->d, C_carry, v_is_even, tmp->d, n_width); + maybe_rshift1_words_carry(D->d, D_carry, v_is_even, tmp->d, a_width); + } + + assert(BN_is_zero(v)); + if (!BN_is_one(u)) { + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + goto err; + } + + ret = BN_copy(r, A) != NULL; + +err: + BN_CTX_end(ctx); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c.grpc_back new file mode 100644 index 000000000..30540e3c2 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/gcd_extra.c.grpc_back @@ -0,0 +1,325 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include + +#include "internal.h" + + +static BN_ULONG word_is_odd_mask(BN_ULONG a) { return (BN_ULONG)0 - (a & 1); } + +static void maybe_rshift1_words(BN_ULONG *a, BN_ULONG mask, BN_ULONG *tmp, + size_t num) { + bn_rshift1_words(tmp, a, num); + bn_select_words(a, mask, tmp, a, num); +} + +static void maybe_rshift1_words_carry(BN_ULONG *a, BN_ULONG carry, + BN_ULONG mask, BN_ULONG *tmp, + size_t num) { + maybe_rshift1_words(a, mask, tmp, num); + if (num != 0) { + carry &= mask; + a[num - 1] |= carry << (BN_BITS2-1); + } +} + +static BN_ULONG maybe_add_words(BN_ULONG *a, BN_ULONG mask, const BN_ULONG *b, + BN_ULONG *tmp, size_t num) { + BN_ULONG carry = bn_add_words(tmp, a, b, num); + bn_select_words(a, mask, tmp, a, num); + return carry & mask; +} + +static int bn_gcd_consttime(BIGNUM *r, unsigned *out_shift, const BIGNUM *x, + const BIGNUM *y, BN_CTX *ctx) { + size_t width = x->width > y->width ? x->width : y->width; + if (width == 0) { + *out_shift = 0; + BN_zero(r); + return 1; + } + + // This is a constant-time implementation of Stein's algorithm (binary GCD). + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *u = BN_CTX_get(ctx); + BIGNUM *v = BN_CTX_get(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (u == NULL || v == NULL || tmp == NULL || + !BN_copy(u, x) || + !BN_copy(v, y) || + !bn_resize_words(u, width) || + !bn_resize_words(v, width) || + !bn_resize_words(tmp, width)) { + goto err; + } + + // Each loop iteration halves at least one of |u| and |v|. Thus we need at + // most the combined bit width of inputs for at least one value to be zero. + unsigned x_bits = x->width * BN_BITS2, y_bits = y->width * BN_BITS2; + unsigned num_iters = x_bits + y_bits; + if (num_iters < x_bits) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + goto err; + } + + unsigned shift = 0; + for (unsigned i = 0; i < num_iters; i++) { + BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); + + // If both |u| and |v| are odd, subtract the smaller from the larger. + BN_ULONG u_less_than_v = + (BN_ULONG)0 - bn_sub_words(tmp->d, u->d, v->d, width); + bn_select_words(u->d, both_odd & ~u_less_than_v, tmp->d, u->d, width); + bn_sub_words(tmp->d, v->d, u->d, width); + bn_select_words(v->d, both_odd & u_less_than_v, tmp->d, v->d, width); + + // At least one of |u| and |v| is now even. + BN_ULONG u_is_odd = word_is_odd_mask(u->d[0]); + BN_ULONG v_is_odd = word_is_odd_mask(v->d[0]); + assert(!(u_is_odd & v_is_odd)); + + // If both are even, the final GCD gains a factor of two. + shift += 1 & (~u_is_odd & ~v_is_odd); + + // Halve any which are even. + maybe_rshift1_words(u->d, ~u_is_odd, tmp->d, width); + maybe_rshift1_words(v->d, ~v_is_odd, tmp->d, width); + } + + // One of |u| or |v| is zero at this point. The algorithm usually makes |u| + // zero, unless |y| was already zero on input. Fix this by combining the + // values. + assert(BN_is_zero(u) || BN_is_zero(v)); + for (size_t i = 0; i < width; i++) { + v->d[i] |= u->d[i]; + } + + *out_shift = shift; + ret = bn_set_words(r, v->d, width); + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_gcd(BIGNUM *r, const BIGNUM *x, const BIGNUM *y, BN_CTX *ctx) { + unsigned shift; + return bn_gcd_consttime(r, &shift, x, y, ctx) && + BN_lshift(r, r, shift); +} + +int bn_is_relatively_prime(int *out_relatively_prime, const BIGNUM *x, + const BIGNUM *y, BN_CTX *ctx) { + int ret = 0; + BN_CTX_start(ctx); + unsigned shift; + BIGNUM *gcd = BN_CTX_get(ctx); + if (gcd == NULL || + !bn_gcd_consttime(gcd, &shift, x, y, ctx)) { + goto err; + } + + // Check that 2^|shift| * |gcd| is one. + if (gcd->width == 0) { + *out_relatively_prime = 0; + } else { + BN_ULONG mask = shift | (gcd->d[0] ^ 1); + for (int i = 1; i < gcd->width; i++) { + mask |= gcd->d[i]; + } + *out_relatively_prime = mask == 0; + } + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + BN_CTX_start(ctx); + unsigned shift; + BIGNUM *gcd = BN_CTX_get(ctx); + int ret = gcd != NULL && + bn_mul_consttime(r, a, b, ctx) && + bn_gcd_consttime(gcd, &shift, a, b, ctx) && + bn_div_consttime(r, NULL, r, gcd, ctx) && + bn_rshift_secret_shift(r, r, shift, ctx); + BN_CTX_end(ctx); + return ret; +} + +int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, const BIGNUM *a, + const BIGNUM *n, BN_CTX *ctx) { + *out_no_inverse = 0; + if (BN_is_negative(a) || BN_ucmp(a, n) >= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INPUT_NOT_REDUCED); + return 0; + } + if (BN_is_zero(a)) { + if (BN_is_one(n)) { + BN_zero(r); + return 1; + } + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + return 0; + } + + // This is a constant-time implementation of the extended binary GCD + // algorithm. It is adapted from the Handbook of Applied Cryptography, section + // 14.4.3, algorithm 14.51, and modified to bound coefficients and avoid + // negative numbers. + // + // For more details and proof of correctness, see + // https://github.com/mit-plv/fiat-crypto/pull/333. In particular, see |step| + // and |mod_inverse_consttime| for the algorithm in Gallina and see + // |mod_inverse_consttime_spec| for the correctness result. + + if (!BN_is_odd(a) && !BN_is_odd(n)) { + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + return 0; + } + + // This function exists to compute the RSA private exponent, where |a| is one + // word. We'll thus use |a_width| when available. + size_t n_width = n->width, a_width = a->width; + if (a_width > n_width) { + a_width = n_width; + } + + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *u = BN_CTX_get(ctx); + BIGNUM *v = BN_CTX_get(ctx); + BIGNUM *A = BN_CTX_get(ctx); + BIGNUM *B = BN_CTX_get(ctx); + BIGNUM *C = BN_CTX_get(ctx); + BIGNUM *D = BN_CTX_get(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + BIGNUM *tmp2 = BN_CTX_get(ctx); + if (u == NULL || v == NULL || A == NULL || B == NULL || C == NULL || + D == NULL || tmp == NULL || tmp2 == NULL || + !BN_copy(u, a) || + !BN_copy(v, n) || + !BN_one(A) || + !BN_one(D) || + // For convenience, size |u| and |v| equivalently. + !bn_resize_words(u, n_width) || + !bn_resize_words(v, n_width) || + // |A| and |C| are bounded by |m|. + !bn_resize_words(A, n_width) || + !bn_resize_words(C, n_width) || + // |B| and |D| are bounded by |a|. + !bn_resize_words(B, a_width) || + !bn_resize_words(D, a_width) || + // |tmp| and |tmp2| may be used at either size. + !bn_resize_words(tmp, n_width) || + !bn_resize_words(tmp2, n_width)) { + goto err; + } + + // Each loop iteration halves at least one of |u| and |v|. Thus we need at + // most the combined bit width of inputs for at least one value to be zero. + unsigned a_bits = a_width * BN_BITS2, n_bits = n_width * BN_BITS2; + unsigned num_iters = a_bits + n_bits; + if (num_iters < a_bits) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + goto err; + } + + // Before and after each loop iteration, the following hold: + // + // u = A*a - B*n + // v = D*n - C*a + // 0 < u <= a + // 0 <= v <= n + // 0 <= A < n + // 0 <= B <= a + // 0 <= C < n + // 0 <= D <= a + // + // After each loop iteration, u and v only get smaller, and at least one of + // them shrinks by at least a factor of two. + for (unsigned i = 0; i < num_iters; i++) { + BN_ULONG both_odd = word_is_odd_mask(u->d[0]) & word_is_odd_mask(v->d[0]); + + // If both |u| and |v| are odd, subtract the smaller from the larger. + BN_ULONG v_less_than_u = + (BN_ULONG)0 - bn_sub_words(tmp->d, v->d, u->d, n_width); + bn_select_words(v->d, both_odd & ~v_less_than_u, tmp->d, v->d, n_width); + bn_sub_words(tmp->d, u->d, v->d, n_width); + bn_select_words(u->d, both_odd & v_less_than_u, tmp->d, u->d, n_width); + + // If we updated one of the values, update the corresponding coefficient. + BN_ULONG carry = bn_add_words(tmp->d, A->d, C->d, n_width); + carry -= bn_sub_words(tmp2->d, tmp->d, n->d, n_width); + bn_select_words(tmp->d, carry, tmp->d, tmp2->d, n_width); + bn_select_words(A->d, both_odd & v_less_than_u, tmp->d, A->d, n_width); + bn_select_words(C->d, both_odd & ~v_less_than_u, tmp->d, C->d, n_width); + + bn_add_words(tmp->d, B->d, D->d, a_width); + bn_sub_words(tmp2->d, tmp->d, a->d, a_width); + bn_select_words(tmp->d, carry, tmp->d, tmp2->d, a_width); + bn_select_words(B->d, both_odd & v_less_than_u, tmp->d, B->d, a_width); + bn_select_words(D->d, both_odd & ~v_less_than_u, tmp->d, D->d, a_width); + + // Our loop invariants hold at this point. Additionally, exactly one of |u| + // and |v| is now even. + BN_ULONG u_is_even = ~word_is_odd_mask(u->d[0]); + BN_ULONG v_is_even = ~word_is_odd_mask(v->d[0]); + assert(u_is_even != v_is_even); + + // Halve the even one and adjust the corresponding coefficient. + maybe_rshift1_words(u->d, u_is_even, tmp->d, n_width); + BN_ULONG A_or_B_is_odd = + word_is_odd_mask(A->d[0]) | word_is_odd_mask(B->d[0]); + BN_ULONG A_carry = + maybe_add_words(A->d, A_or_B_is_odd & u_is_even, n->d, tmp->d, n_width); + BN_ULONG B_carry = + maybe_add_words(B->d, A_or_B_is_odd & u_is_even, a->d, tmp->d, a_width); + maybe_rshift1_words_carry(A->d, A_carry, u_is_even, tmp->d, n_width); + maybe_rshift1_words_carry(B->d, B_carry, u_is_even, tmp->d, a_width); + + maybe_rshift1_words(v->d, v_is_even, tmp->d, n_width); + BN_ULONG C_or_D_is_odd = + word_is_odd_mask(C->d[0]) | word_is_odd_mask(D->d[0]); + BN_ULONG C_carry = + maybe_add_words(C->d, C_or_D_is_odd & v_is_even, n->d, tmp->d, n_width); + BN_ULONG D_carry = + maybe_add_words(D->d, C_or_D_is_odd & v_is_even, a->d, tmp->d, a_width); + maybe_rshift1_words_carry(C->d, C_carry, v_is_even, tmp->d, n_width); + maybe_rshift1_words_carry(D->d, D_carry, v_is_even, tmp->d, a_width); + } + + assert(BN_is_zero(v)); + if (!BN_is_one(u)) { + *out_no_inverse = 1; + OPENSSL_PUT_ERROR(BN, BN_R_NO_INVERSE); + goto err; + } + + ret = BN_copy(r, A) != NULL; + +err: + BN_CTX_end(ctx); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/generic.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/generic.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/generic.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/generic.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/generic.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h new file mode 100644 index 000000000..547415a15 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h @@ -0,0 +1,691 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the Eric Young open source + * license provided above. + * + * The binary polynomial arithmetic software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_BN_INTERNAL_H +#define OPENSSL_HEADER_BN_INTERNAL_H + +#include + +#if defined(OPENSSL_X86_64) && defined(_MSC_VER) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#pragma intrinsic(__umulh, _umul128) +#endif + +#include "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(OPENSSL_64_BIT) + +#if defined(BORINGSSL_HAS_UINT128) +// MSVC doesn't support two-word integers on 64-bit. +#define BN_ULLONG uint128_t +#if defined(BORINGSSL_CAN_DIVIDE_UINT128) +#define BN_CAN_DIVIDE_ULLONG +#endif +#endif + +#define BN_BITS2 64 +#define BN_BYTES 8 +#define BN_BITS4 32 +#define BN_MASK2 (0xffffffffffffffffUL) +#define BN_MASK2l (0xffffffffUL) +#define BN_MASK2h (0xffffffff00000000UL) +#define BN_MASK2h1 (0xffffffff80000000UL) +#define BN_MONT_CTX_N0_LIMBS 1 +#define BN_DEC_CONV (10000000000000000000UL) +#define BN_DEC_NUM 19 +#define TOBN(hi, lo) ((BN_ULONG)(hi) << 32 | (lo)) + +#elif defined(OPENSSL_32_BIT) + +#define BN_ULLONG uint64_t +#define BN_CAN_DIVIDE_ULLONG +#define BN_BITS2 32 +#define BN_BYTES 4 +#define BN_BITS4 16 +#define BN_MASK2 (0xffffffffUL) +#define BN_MASK2l (0xffffUL) +#define BN_MASK2h1 (0xffff8000UL) +#define BN_MASK2h (0xffff0000UL) +// On some 32-bit platforms, Montgomery multiplication is done using 64-bit +// arithmetic with SIMD instructions. On such platforms, |BN_MONT_CTX::n0| +// needs to be two words long. Only certain 32-bit platforms actually make use +// of n0[1] and shorter R value would suffice for the others. However, +// currently only the assembly files know which is which. +#define BN_MONT_CTX_N0_LIMBS 2 +#define BN_DEC_CONV (1000000000UL) +#define BN_DEC_NUM 9 +#define TOBN(hi, lo) (lo), (hi) + +#else +#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" +#endif + +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) +#define BN_CAN_USE_INLINE_ASM +#endif + +// |BN_mod_exp_mont_consttime| is based on the assumption that the L1 data +// cache line width of the target processor is at least the following value. +#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH 64 + +// The number of |BN_ULONG|s needed for the |BN_mod_exp_mont_consttime| stack- +// allocated storage buffer. The buffer is just the right size for the RSAZ +// and is about ~1KB larger than what's necessary (4480 bytes) for 1024-bit +// inputs. +#define MOD_EXP_CTIME_STORAGE_LEN \ + (((320u * 3u) + (32u * 9u * 16u)) / sizeof(BN_ULONG)) + +#define STATIC_BIGNUM(x) \ + { \ + (BN_ULONG *)(x), sizeof(x) / sizeof(BN_ULONG), \ + sizeof(x) / sizeof(BN_ULONG), 0, BN_FLG_STATIC_DATA \ + } + +#if defined(BN_ULLONG) +#define Lw(t) ((BN_ULONG)(t)) +#define Hw(t) ((BN_ULONG)((t) >> BN_BITS2)) +#endif + +// bn_minimal_width returns the minimal value of |bn->top| which fits the +// value of |bn|. +int bn_minimal_width(const BIGNUM *bn); + +// bn_set_minimal_width sets |bn->width| to |bn_minimal_width(bn)|. If |bn| is +// zero, |bn->neg| is set to zero. +void bn_set_minimal_width(BIGNUM *bn); + +// bn_wexpand ensures that |bn| has at least |words| works of space without +// altering its value. It returns one on success or zero on allocation +// failure. +int bn_wexpand(BIGNUM *bn, size_t words); + +// bn_expand acts the same as |bn_wexpand|, but takes a number of bits rather +// than a number of words. +int bn_expand(BIGNUM *bn, size_t bits); + +// bn_resize_words adjusts |bn->top| to be |words|. It returns one on success +// and zero on allocation error or if |bn|'s value is too large. +OPENSSL_EXPORT int bn_resize_words(BIGNUM *bn, size_t words); + +// bn_select_words sets |r| to |a| if |mask| is all ones or |b| if |mask| is +// all zeros. +void bn_select_words(BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, + const BN_ULONG *b, size_t num); + +// bn_set_words sets |bn| to the value encoded in the |num| words in |words|, +// least significant word first. +int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num); + +// bn_fits_in_words returns one if |bn| may be represented in |num| words, plus +// a sign bit, and zero otherwise. +int bn_fits_in_words(const BIGNUM *bn, size_t num); + +// bn_copy_words copies the value of |bn| to |out| and returns one if the value +// is representable in |num| words. Otherwise, it returns zero. +int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn); + +// bn_mul_add_words multiples |ap| by |w|, adds the result to |rp|, and places +// the result in |rp|. |ap| and |rp| must both be |num| words long. It returns +// the carry word of the operation. |ap| and |rp| may be equal but otherwise may +// not alias. +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w); + +// bn_mul_words multiples |ap| by |w| and places the result in |rp|. |ap| and +// |rp| must both be |num| words long. It returns the carry word of the +// operation. |ap| and |rp| may be equal but otherwise may not alias. +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w); + +// bn_sqr_words sets |rp[2*i]| and |rp[2*i+1]| to |ap[i]|'s square, for all |i| +// up to |num|. |ap| is an array of |num| words and |rp| an array of |2*num| +// words. |ap| and |rp| may not alias. +// +// This gives the contribution of the |ap[i]*ap[i]| terms when squaring |ap|. +void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num); + +// bn_add_words adds |ap| to |bp| and places the result in |rp|, each of which +// are |num| words long. It returns the carry bit, which is one if the operation +// overflowed and zero otherwise. Any pair of |ap|, |bp|, and |rp| may be equal +// to each other but otherwise may not alias. +BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t num); + +// bn_sub_words subtracts |bp| from |ap| and places the result in |rp|. It +// returns the borrow bit, which is one if the computation underflowed and zero +// otherwise. Any pair of |ap|, |bp|, and |rp| may be equal to each other but +// otherwise may not alias. +BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t num); + +// bn_mul_comba4 sets |r| to the product of |a| and |b|. +void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]); + +// bn_mul_comba8 sets |r| to the product of |a| and |b|. +void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]); + +// bn_sqr_comba8 sets |r| to |a|^2. +void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[4]); + +// bn_sqr_comba4 sets |r| to |a|^2. +void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]); + +// bn_less_than_words returns one if |a| < |b| and zero otherwise, where |a| +// and |b| both are |len| words long. It runs in constant time. +int bn_less_than_words(const BN_ULONG *a, const BN_ULONG *b, size_t len); + +// bn_in_range_words returns one if |min_inclusive| <= |a| < |max_exclusive|, +// where |a| and |max_exclusive| both are |len| words long. |a| and +// |max_exclusive| are treated as secret. +int bn_in_range_words(const BN_ULONG *a, BN_ULONG min_inclusive, + const BN_ULONG *max_exclusive, size_t len); + +// bn_rand_range_words sets |out| to a uniformly distributed random number from +// |min_inclusive| to |max_exclusive|. Both |out| and |max_exclusive| are |len| +// words long. +// +// This function runs in time independent of the result, but |min_inclusive| and +// |max_exclusive| are public data. (Information about the range is unavoidably +// leaked by how many iterations it took to select a number.) +int bn_rand_range_words(BN_ULONG *out, BN_ULONG min_inclusive, + const BN_ULONG *max_exclusive, size_t len, + const uint8_t additional_data[32]); + +// bn_range_secret_range behaves like |BN_rand_range_ex|, but treats +// |max_exclusive| as secret. Because of this constraint, the distribution of +// values returned is more complex. +// +// Rather than repeatedly generating values until one is in range, which would +// leak information, it generates one value. If the value is in range, it sets +// |*out_is_uniform| to one. Otherwise, it sets |*out_is_uniform| to zero, +// fixing up the value to force it in range. +// +// The subset of calls to |bn_rand_secret_range| which set |*out_is_uniform| to +// one are uniformly distributed in the target range. Calls overall are not. +// This function is intended for use in situations where the extra values are +// still usable and where the number of iterations needed to reach the target +// number of uniform outputs may be blinded for negligible probabilities of +// timing leaks. +// +// Although this function treats |max_exclusive| as secret, it treats the number +// of bits in |max_exclusive| as public. +int bn_rand_secret_range(BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive); + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +#define OPENSSL_BN_ASM_MONT +// bn_mul_mont writes |ap| * |bp| mod |np| to |rp|, each |num| words +// long. Inputs and outputs are in Montgomery form. |n0| is a pointer to the +// corresponding field in |BN_MONT_CTX|. It returns one if |bn_mul_mont| handles +// inputs of this size and zero otherwise. +// +// TODO(davidben): The x86_64 implementation expects a 32-bit input and masks +// off upper bits. The aarch64 implementation expects a 64-bit input and does +// not. |size_t| is the safer option but not strictly correct for x86_64. But +// this function implicitly already has a bound on the size of |num| because it +// internally creates |num|-sized stack allocation. +// +// See also discussion in |ToWord| in abi_test.h for notes on smaller-than-word +// inputs. +int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + const BN_ULONG *np, const BN_ULONG *n0, size_t num); +#endif + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) +#define OPENSSL_BN_ASM_MONT5 + +// bn_mul_mont_gather5 multiples loads index |power| of |table|, multiplies it +// by |ap| modulo |np|, and stores the result in |rp|. The values are |num| +// words long and represented in Montgomery form. |n0| is a pointer to the +// corresponding field in |BN_MONT_CTX|. +void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, + const BN_ULONG *table, const BN_ULONG *np, + const BN_ULONG *n0, int num, int power); + +// bn_scatter5 stores |inp| to index |power| of |table|. |inp| and each entry of +// |table| are |num| words long. |power| must be less than 32. |table| must be +// 32*|num| words long. +void bn_scatter5(const BN_ULONG *inp, size_t num, BN_ULONG *table, + size_t power); + +// bn_gather5 loads index |power| of |table| and stores it in |out|. |out| and +// each entry of |table| are |num| words long. |power| must be less than 32. +void bn_gather5(BN_ULONG *out, size_t num, BN_ULONG *table, size_t power); + +// bn_power5 squares |ap| five times and multiplies it by the value stored at +// index |power| of |table|, modulo |np|. It stores the result in |rp|. The +// values are |num| words long and represented in Montgomery form. |n0| is a +// pointer to the corresponding field in |BN_MONT_CTX|. |num| must be divisible +// by 8. +void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *table, + const BN_ULONG *np, const BN_ULONG *n0, int num, int power); + +// bn_from_montgomery converts |ap| from Montgomery form modulo |np| and writes +// the result in |rp|, each of which is |num| words long. It returns one on +// success and zero if it cannot handle inputs of length |num|. |n0| is a +// pointer to the corresponding field in |BN_MONT_CTX|. +int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap, + const BN_ULONG *not_used, const BN_ULONG *np, + const BN_ULONG *n0, int num); +#endif // !OPENSSL_NO_ASM && OPENSSL_X86_64 + +uint64_t bn_mont_n0(const BIGNUM *n); + +// bn_mod_exp_base_2_consttime calculates r = 2**p (mod n). |p| must be larger +// than log_2(n); i.e. 2**p must be larger than |n|. |n| must be positive and +// odd. |p| and the bit width of |n| are assumed public, but |n| is otherwise +// treated as secret. +int bn_mod_exp_base_2_consttime(BIGNUM *r, unsigned p, const BIGNUM *n, + BN_CTX *ctx); + +#if defined(OPENSSL_X86_64) && defined(_MSC_VER) +#define BN_UMULT_LOHI(low, high, a, b) ((low) = _umul128((a), (b), &(high))) +#endif + +#if !defined(BN_ULLONG) && !defined(BN_UMULT_LOHI) +#error "Either BN_ULLONG or BN_UMULT_LOHI must be defined on every platform." +#endif + +// bn_jacobi returns the Jacobi symbol of |a| and |b| (which is -1, 0 or 1), or +// -2 on error. +int bn_jacobi(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +// bn_is_bit_set_words returns one if bit |bit| is set in |a| and zero +// otherwise. +int bn_is_bit_set_words(const BN_ULONG *a, size_t num, unsigned bit); + +// bn_one_to_montgomery sets |r| to one in Montgomery form. It returns one on +// success and zero on error. This function treats the bit width of the modulus +// as public. +int bn_one_to_montgomery(BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx); + +// bn_less_than_montgomery_R returns one if |bn| is less than the Montgomery R +// value for |mont| and zero otherwise. +int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont); + +// bn_mod_u16_consttime returns |bn| mod |d|, ignoring |bn|'s sign bit. It runs +// in time independent of the value of |bn|, but it treats |d| as public. +OPENSSL_EXPORT uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d); + +// bn_odd_number_is_obviously_composite returns one if |bn| is divisible by one +// of the first several odd primes and zero otherwise. +int bn_odd_number_is_obviously_composite(const BIGNUM *bn); + +// A BN_MILLER_RABIN stores state common to each Miller-Rabin iteration. It is +// initialized within an existing |BN_CTX| scope and may not be used after +// that scope is released with |BN_CTX_end|. Field names match those in FIPS +// 186-4, section C.3.1. +typedef struct { + // w1 is w-1. + BIGNUM *w1; + // m is (w-1)/2^a. + BIGNUM *m; + // one_mont is 1 (mod w) in Montgomery form. + BIGNUM *one_mont; + // w1_mont is w-1 (mod w) in Montgomery form. + BIGNUM *w1_mont; + // w_bits is BN_num_bits(w). + int w_bits; + // a is the largest integer such that 2^a divides w-1. + int a; +} BN_MILLER_RABIN; + +// bn_miller_rabin_init initializes |miller_rabin| for testing if |mont->N| is +// prime. It returns one on success and zero on error. +OPENSSL_EXPORT int bn_miller_rabin_init(BN_MILLER_RABIN *miller_rabin, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +// bn_miller_rabin_iteration performs one Miller-Rabin iteration, checking if +// |b| is a composite witness for |mont->N|. |miller_rabin| must have been +// initialized with |bn_miller_rabin_setup|. On success, it returns one and sets +// |*out_is_possibly_prime| to one if |mont->N| may still be prime or zero if +// |b| shows it is composite. On allocation or internal failure, it returns +// zero. +OPENSSL_EXPORT int bn_miller_rabin_iteration( + const BN_MILLER_RABIN *miller_rabin, int *out_is_possibly_prime, + const BIGNUM *b, const BN_MONT_CTX *mont, BN_CTX *ctx); + +// bn_rshift1_words sets |r| to |a| >> 1, where both arrays are |num| bits wide. +void bn_rshift1_words(BN_ULONG *r, const BN_ULONG *a, size_t num); + +// bn_rshift_words sets |r| to |a| >> |shift|, where both arrays are |num| bits +// wide. +void bn_rshift_words(BN_ULONG *r, const BN_ULONG *a, unsigned shift, + size_t num); + +// bn_rshift_secret_shift behaves like |BN_rshift| but runs in time independent +// of both |a| and |n|. +OPENSSL_EXPORT int bn_rshift_secret_shift(BIGNUM *r, const BIGNUM *a, + unsigned n, BN_CTX *ctx); + +// bn_reduce_once sets |r| to |a| mod |m| where 0 <= |a| < 2*|m|. It returns +// zero if |a| < |m| and a mask of all ones if |a| >= |m|. Each array is |num| +// words long, but |a| has an additional word specified by |carry|. |carry| must +// be zero or one, as implied by the bounds on |a|. +// +// |r|, |a|, and |m| may not alias. Use |bn_reduce_once_in_place| if |r| and |a| +// must alias. +BN_ULONG bn_reduce_once(BN_ULONG *r, const BN_ULONG *a, BN_ULONG carry, + const BN_ULONG *m, size_t num); + +// bn_reduce_once_in_place behaves like |bn_reduce_once| but acts in-place on +// |r|, using |tmp| as scratch space. |r|, |tmp|, and |m| may not alias. +BN_ULONG bn_reduce_once_in_place(BN_ULONG *r, BN_ULONG carry, const BN_ULONG *m, + BN_ULONG *tmp, size_t num); + + +// Constant-time non-modular arithmetic. +// +// The following functions implement non-modular arithmetic in constant-time +// and pessimally set |r->width| to the largest possible word size. +// +// Note this means that, e.g., repeatedly multiplying by one will cause widths +// to increase without bound. The corresponding public API functions minimize +// their outputs to avoid regressing calculator consumers. + +// bn_uadd_consttime behaves like |BN_uadd|, but it pessimally sets +// |r->width| = |a->width| + |b->width| + 1. +int bn_uadd_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// bn_usub_consttime behaves like |BN_usub|, but it pessimally sets +// |r->width| = |a->width|. +int bn_usub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// bn_abs_sub_consttime sets |r| to the absolute value of |a| - |b|, treating +// both inputs as secret. It returns one on success and zero on error. +OPENSSL_EXPORT int bn_abs_sub_consttime(BIGNUM *r, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); + +// bn_mul_consttime behaves like |BN_mul|, but it rejects negative inputs and +// pessimally sets |r->width| to |a->width| + |b->width|, to avoid leaking +// information about |a| and |b|. +int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +// bn_sqrt_consttime behaves like |BN_sqrt|, but it pessimally sets |r->width| +// to 2*|a->width|, to avoid leaking information about |a| and |b|. +int bn_sqr_consttime(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); + +// bn_div_consttime behaves like |BN_div|, but it rejects negative inputs and +// treats both inputs, including their magnitudes, as secret. It is, as a +// result, much slower than |BN_div| and should only be used for rare operations +// where Montgomery reduction is not available. +// +// Note that |quotient->width| will be set pessimally to |numerator->width|. +OPENSSL_EXPORT int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, + const BIGNUM *numerator, + const BIGNUM *divisor, BN_CTX *ctx); + +// bn_is_relatively_prime checks whether GCD(|x|, |y|) is one. On success, it +// returns one and sets |*out_relatively_prime| to one if the GCD was one and +// zero otherwise. On error, it returns zero. +OPENSSL_EXPORT int bn_is_relatively_prime(int *out_relatively_prime, + const BIGNUM *x, const BIGNUM *y, + BN_CTX *ctx); + +// bn_lcm_consttime sets |r| to LCM(|a|, |b|). It returns one and success and +// zero on error. |a| and |b| are both treated as secret. +OPENSSL_EXPORT int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx); + + +// Constant-time modular arithmetic. +// +// The following functions implement basic constant-time modular arithmetic. + +// bn_mod_add_words sets |r| to |a| + |b| (mod |m|), using |tmp| as scratch +// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of +// |r|, |a|, and |b| may alias. +void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num); + +// bn_mod_add_consttime acts like |BN_mod_add_quick| but takes a |BN_CTX|. +int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// bn_mod_sub_words sets |r| to |a| - |b| (mod |m|), using |tmp| as scratch +// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of +// |r|, |a|, and |b| may alias. +void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num); + +// bn_mod_sub_consttime acts like |BN_mod_sub_quick| but takes a |BN_CTX|. +int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// bn_mod_lshift1_consttime acts like |BN_mod_lshift1_quick| but takes a +// |BN_CTX|. +int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, + BN_CTX *ctx); + +// bn_mod_lshift_consttime acts like |BN_mod_lshift_quick| but takes a |BN_CTX|. +int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx); + +// bn_mod_inverse_consttime sets |r| to |a|^-1, mod |n|. |a| must be non- +// negative and less than |n|. It returns one on success and zero on error. On +// failure, if the failure was caused by |a| having no inverse mod |n| then +// |*out_no_inverse| will be set to one; otherwise it will be set to zero. +// +// This function treats both |a| and |n| as secret, provided they are both non- +// zero and the inverse exists. It should only be used for even moduli where +// none of the less general implementations are applicable. +OPENSSL_EXPORT int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, + const BIGNUM *a, const BIGNUM *n, + BN_CTX *ctx); + +// bn_mod_inverse_prime sets |out| to the modular inverse of |a| modulo |p|, +// computed with Fermat's Little Theorem. It returns one on success and zero on +// error. If |mont_p| is NULL, one will be computed temporarily. +int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p); + +// bn_mod_inverse_secret_prime behaves like |bn_mod_inverse_prime| but uses +// |BN_mod_exp_mont_consttime| instead of |BN_mod_exp_mont| in hopes of +// protecting the exponent. +int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p); + + +// Low-level operations for small numbers. +// +// The following functions implement algorithms suitable for use with scalars +// and field elements in elliptic curves. They rely on the number being small +// both to stack-allocate various temporaries and because they do not implement +// optimizations useful for the larger values used in RSA. + +// BN_SMALL_MAX_WORDS is the largest size input these functions handle. This +// limit allows temporaries to be more easily stack-allocated. This limit is set +// to accommodate P-521. +#if defined(OPENSSL_32_BIT) +#define BN_SMALL_MAX_WORDS 17 +#else +#define BN_SMALL_MAX_WORDS 9 +#endif + +// bn_mul_small sets |r| to |a|*|b|. |num_r| must be |num_a| + |num_b|. |r| may +// not alias with |a| or |b|. +void bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, + const BN_ULONG *b, size_t num_b); + +// bn_sqr_small sets |r| to |a|^2. |num_a| must be at most |BN_SMALL_MAX_WORDS|. +// |num_r| must be |num_a|*2. |r| and |a| may not alias. +void bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a); + +// In the following functions, the modulus must be at most |BN_SMALL_MAX_WORDS| +// words long. + +// bn_to_montgomery_small sets |r| to |a| translated to the Montgomery domain. +// |r| and |a| are |num| words long, which must be |mont->N.width|. |a| must be +// fully reduced and may alias |r|. +void bn_to_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont); + +// bn_from_montgomery_small sets |r| to |a| translated out of the Montgomery +// domain. |r| and |a| are |num| words long, which must be |mont->N.width|. |a| +// must be fully-reduced and may alias |r|. +void bn_from_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont); + +// bn_mod_mul_montgomery_small sets |r| to |a| * |b| mod |mont->N|. Both inputs +// and outputs are in the Montgomery domain. Each array is |num| words long, +// which must be |mont->N.width|. Any two of |r|, |a|, and |b| may alias. |a| +// and |b| must be reduced on input. +void bn_mod_mul_montgomery_small(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, size_t num, + const BN_MONT_CTX *mont); + +// bn_mod_exp_mont_small sets |r| to |a|^|p| mod |mont->N|. It returns one on +// success and zero on programmer or internal error. Both inputs and outputs are +// in the Montgomery domain. |r| and |a| are |num| words long, which must be +// |mont->N.width| and at most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced. +// This function runs in time independent of |a|, but |p| and |mont->N| are +// public values. |a| must be fully-reduced and may alias with |r|. +// +// Note this function differs from |BN_mod_exp_mont| which uses Montgomery +// reduction but takes input and output outside the Montgomery domain. Combine +// this function with |bn_from_montgomery_small| and |bn_to_montgomery_small| +// if necessary. +void bn_mod_exp_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_ULONG *p, size_t num_p, + const BN_MONT_CTX *mont); + +// bn_mod_inverse_prime_mont_small sets |r| to |a|^-1 mod |mont->N|. |mont->N| +// must be a prime. |r| and |a| are |num| words long, which must be +// |mont->N.width| and at most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced +// and may alias |r|. This function runs in time independent of |a|, but +// |mont->N| is a public value. +void bn_mod_inverse_prime_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BN_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h.grpc_back new file mode 100644 index 000000000..d58a2acce --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/internal.h.grpc_back @@ -0,0 +1,691 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the Eric Young open source + * license provided above. + * + * The binary polynomial arithmetic software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_BN_INTERNAL_H +#define OPENSSL_HEADER_BN_INTERNAL_H + +#include + +#if defined(OPENSSL_X86_64) && defined(_MSC_VER) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#pragma intrinsic(__umulh, _umul128) +#endif + +#include "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +#if defined(OPENSSL_64_BIT) + +#if defined(BORINGSSL_HAS_UINT128) +// MSVC doesn't support two-word integers on 64-bit. +#define BN_ULLONG uint128_t +#if defined(BORINGSSL_CAN_DIVIDE_UINT128) +#define BN_CAN_DIVIDE_ULLONG +#endif +#endif + +#define BN_BITS2 64 +#define BN_BYTES 8 +#define BN_BITS4 32 +#define BN_MASK2 (0xffffffffffffffffUL) +#define BN_MASK2l (0xffffffffUL) +#define BN_MASK2h (0xffffffff00000000UL) +#define BN_MASK2h1 (0xffffffff80000000UL) +#define BN_MONT_CTX_N0_LIMBS 1 +#define BN_DEC_CONV (10000000000000000000UL) +#define BN_DEC_NUM 19 +#define TOBN(hi, lo) ((BN_ULONG)(hi) << 32 | (lo)) + +#elif defined(OPENSSL_32_BIT) + +#define BN_ULLONG uint64_t +#define BN_CAN_DIVIDE_ULLONG +#define BN_BITS2 32 +#define BN_BYTES 4 +#define BN_BITS4 16 +#define BN_MASK2 (0xffffffffUL) +#define BN_MASK2l (0xffffUL) +#define BN_MASK2h1 (0xffff8000UL) +#define BN_MASK2h (0xffff0000UL) +// On some 32-bit platforms, Montgomery multiplication is done using 64-bit +// arithmetic with SIMD instructions. On such platforms, |BN_MONT_CTX::n0| +// needs to be two words long. Only certain 32-bit platforms actually make use +// of n0[1] and shorter R value would suffice for the others. However, +// currently only the assembly files know which is which. +#define BN_MONT_CTX_N0_LIMBS 2 +#define BN_DEC_CONV (1000000000UL) +#define BN_DEC_NUM 9 +#define TOBN(hi, lo) (lo), (hi) + +#else +#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" +#endif + +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) +#define BN_CAN_USE_INLINE_ASM +#endif + +// |BN_mod_exp_mont_consttime| is based on the assumption that the L1 data +// cache line width of the target processor is at least the following value. +#define MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH 64 + +// The number of |BN_ULONG|s needed for the |BN_mod_exp_mont_consttime| stack- +// allocated storage buffer. The buffer is just the right size for the RSAZ +// and is about ~1KB larger than what's necessary (4480 bytes) for 1024-bit +// inputs. +#define MOD_EXP_CTIME_STORAGE_LEN \ + (((320u * 3u) + (32u * 9u * 16u)) / sizeof(BN_ULONG)) + +#define STATIC_BIGNUM(x) \ + { \ + (BN_ULONG *)(x), sizeof(x) / sizeof(BN_ULONG), \ + sizeof(x) / sizeof(BN_ULONG), 0, BN_FLG_STATIC_DATA \ + } + +#if defined(BN_ULLONG) +#define Lw(t) ((BN_ULONG)(t)) +#define Hw(t) ((BN_ULONG)((t) >> BN_BITS2)) +#endif + +// bn_minimal_width returns the minimal value of |bn->top| which fits the +// value of |bn|. +int bn_minimal_width(const BIGNUM *bn); + +// bn_set_minimal_width sets |bn->width| to |bn_minimal_width(bn)|. If |bn| is +// zero, |bn->neg| is set to zero. +void bn_set_minimal_width(BIGNUM *bn); + +// bn_wexpand ensures that |bn| has at least |words| works of space without +// altering its value. It returns one on success or zero on allocation +// failure. +int bn_wexpand(BIGNUM *bn, size_t words); + +// bn_expand acts the same as |bn_wexpand|, but takes a number of bits rather +// than a number of words. +int bn_expand(BIGNUM *bn, size_t bits); + +// bn_resize_words adjusts |bn->top| to be |words|. It returns one on success +// and zero on allocation error or if |bn|'s value is too large. +OPENSSL_EXPORT int bn_resize_words(BIGNUM *bn, size_t words); + +// bn_select_words sets |r| to |a| if |mask| is all ones or |b| if |mask| is +// all zeros. +void bn_select_words(BN_ULONG *r, BN_ULONG mask, const BN_ULONG *a, + const BN_ULONG *b, size_t num); + +// bn_set_words sets |bn| to the value encoded in the |num| words in |words|, +// least significant word first. +int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num); + +// bn_fits_in_words returns one if |bn| may be represented in |num| words, plus +// a sign bit, and zero otherwise. +int bn_fits_in_words(const BIGNUM *bn, size_t num); + +// bn_copy_words copies the value of |bn| to |out| and returns one if the value +// is representable in |num| words. Otherwise, it returns zero. +int bn_copy_words(BN_ULONG *out, size_t num, const BIGNUM *bn); + +// bn_mul_add_words multiples |ap| by |w|, adds the result to |rp|, and places +// the result in |rp|. |ap| and |rp| must both be |num| words long. It returns +// the carry word of the operation. |ap| and |rp| may be equal but otherwise may +// not alias. +BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, + BN_ULONG w); + +// bn_mul_words multiples |ap| by |w| and places the result in |rp|. |ap| and +// |rp| must both be |num| words long. It returns the carry word of the +// operation. |ap| and |rp| may be equal but otherwise may not alias. +BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num, BN_ULONG w); + +// bn_sqr_words sets |rp[2*i]| and |rp[2*i+1]| to |ap[i]|'s square, for all |i| +// up to |num|. |ap| is an array of |num| words and |rp| an array of |2*num| +// words. |ap| and |rp| may not alias. +// +// This gives the contribution of the |ap[i]*ap[i]| terms when squaring |ap|. +void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, size_t num); + +// bn_add_words adds |ap| to |bp| and places the result in |rp|, each of which +// are |num| words long. It returns the carry bit, which is one if the operation +// overflowed and zero otherwise. Any pair of |ap|, |bp|, and |rp| may be equal +// to each other but otherwise may not alias. +BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t num); + +// bn_sub_words subtracts |bp| from |ap| and places the result in |rp|. It +// returns the borrow bit, which is one if the computation underflowed and zero +// otherwise. Any pair of |ap|, |bp|, and |rp| may be equal to each other but +// otherwise may not alias. +BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + size_t num); + +// bn_mul_comba4 sets |r| to the product of |a| and |b|. +void bn_mul_comba4(BN_ULONG r[8], const BN_ULONG a[4], const BN_ULONG b[4]); + +// bn_mul_comba8 sets |r| to the product of |a| and |b|. +void bn_mul_comba8(BN_ULONG r[16], const BN_ULONG a[8], const BN_ULONG b[8]); + +// bn_sqr_comba8 sets |r| to |a|^2. +void bn_sqr_comba8(BN_ULONG r[16], const BN_ULONG a[4]); + +// bn_sqr_comba4 sets |r| to |a|^2. +void bn_sqr_comba4(BN_ULONG r[8], const BN_ULONG a[4]); + +// bn_less_than_words returns one if |a| < |b| and zero otherwise, where |a| +// and |b| both are |len| words long. It runs in constant time. +int bn_less_than_words(const BN_ULONG *a, const BN_ULONG *b, size_t len); + +// bn_in_range_words returns one if |min_inclusive| <= |a| < |max_exclusive|, +// where |a| and |max_exclusive| both are |len| words long. |a| and +// |max_exclusive| are treated as secret. +int bn_in_range_words(const BN_ULONG *a, BN_ULONG min_inclusive, + const BN_ULONG *max_exclusive, size_t len); + +// bn_rand_range_words sets |out| to a uniformly distributed random number from +// |min_inclusive| to |max_exclusive|. Both |out| and |max_exclusive| are |len| +// words long. +// +// This function runs in time independent of the result, but |min_inclusive| and +// |max_exclusive| are public data. (Information about the range is unavoidably +// leaked by how many iterations it took to select a number.) +int bn_rand_range_words(BN_ULONG *out, BN_ULONG min_inclusive, + const BN_ULONG *max_exclusive, size_t len, + const uint8_t additional_data[32]); + +// bn_range_secret_range behaves like |BN_rand_range_ex|, but treats +// |max_exclusive| as secret. Because of this constraint, the distribution of +// values returned is more complex. +// +// Rather than repeatedly generating values until one is in range, which would +// leak information, it generates one value. If the value is in range, it sets +// |*out_is_uniform| to one. Otherwise, it sets |*out_is_uniform| to zero, +// fixing up the value to force it in range. +// +// The subset of calls to |bn_rand_secret_range| which set |*out_is_uniform| to +// one are uniformly distributed in the target range. Calls overall are not. +// This function is intended for use in situations where the extra values are +// still usable and where the number of iterations needed to reach the target +// number of uniform outputs may be blinded for negligible probabilities of +// timing leaks. +// +// Although this function treats |max_exclusive| as secret, it treats the number +// of bits in |max_exclusive| as public. +int bn_rand_secret_range(BIGNUM *r, int *out_is_uniform, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive); + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +#define OPENSSL_BN_ASM_MONT +// bn_mul_mont writes |ap| * |bp| mod |np| to |rp|, each |num| words +// long. Inputs and outputs are in Montgomery form. |n0| is a pointer to the +// corresponding field in |BN_MONT_CTX|. It returns one if |bn_mul_mont| handles +// inputs of this size and zero otherwise. +// +// TODO(davidben): The x86_64 implementation expects a 32-bit input and masks +// off upper bits. The aarch64 implementation expects a 64-bit input and does +// not. |size_t| is the safer option but not strictly correct for x86_64. But +// this function implicitly already has a bound on the size of |num| because it +// internally creates |num|-sized stack allocation. +// +// See also discussion in |ToWord| in abi_test.h for notes on smaller-than-word +// inputs. +int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, + const BN_ULONG *np, const BN_ULONG *n0, size_t num); +#endif + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) +#define OPENSSL_BN_ASM_MONT5 + +// bn_mul_mont_gather5 multiples loads index |power| of |table|, multiplies it +// by |ap| modulo |np|, and stores the result in |rp|. The values are |num| +// words long and represented in Montgomery form. |n0| is a pointer to the +// corresponding field in |BN_MONT_CTX|. +void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, + const BN_ULONG *table, const BN_ULONG *np, + const BN_ULONG *n0, int num, int power); + +// bn_scatter5 stores |inp| to index |power| of |table|. |inp| and each entry of +// |table| are |num| words long. |power| must be less than 32. |table| must be +// 32*|num| words long. +void bn_scatter5(const BN_ULONG *inp, size_t num, BN_ULONG *table, + size_t power); + +// bn_gather5 loads index |power| of |table| and stores it in |out|. |out| and +// each entry of |table| are |num| words long. |power| must be less than 32. +void bn_gather5(BN_ULONG *out, size_t num, BN_ULONG *table, size_t power); + +// bn_power5 squares |ap| five times and multiplies it by the value stored at +// index |power| of |table|, modulo |np|. It stores the result in |rp|. The +// values are |num| words long and represented in Montgomery form. |n0| is a +// pointer to the corresponding field in |BN_MONT_CTX|. |num| must be divisible +// by 8. +void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *table, + const BN_ULONG *np, const BN_ULONG *n0, int num, int power); + +// bn_from_montgomery converts |ap| from Montgomery form modulo |np| and writes +// the result in |rp|, each of which is |num| words long. It returns one on +// success and zero if it cannot handle inputs of length |num|. |n0| is a +// pointer to the corresponding field in |BN_MONT_CTX|. +int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap, + const BN_ULONG *not_used, const BN_ULONG *np, + const BN_ULONG *n0, int num); +#endif // !OPENSSL_NO_ASM && OPENSSL_X86_64 + +uint64_t bn_mont_n0(const BIGNUM *n); + +// bn_mod_exp_base_2_consttime calculates r = 2**p (mod n). |p| must be larger +// than log_2(n); i.e. 2**p must be larger than |n|. |n| must be positive and +// odd. |p| and the bit width of |n| are assumed public, but |n| is otherwise +// treated as secret. +int bn_mod_exp_base_2_consttime(BIGNUM *r, unsigned p, const BIGNUM *n, + BN_CTX *ctx); + +#if defined(OPENSSL_X86_64) && defined(_MSC_VER) +#define BN_UMULT_LOHI(low, high, a, b) ((low) = _umul128((a), (b), &(high))) +#endif + +#if !defined(BN_ULLONG) && !defined(BN_UMULT_LOHI) +#error "Either BN_ULLONG or BN_UMULT_LOHI must be defined on every platform." +#endif + +// bn_jacobi returns the Jacobi symbol of |a| and |b| (which is -1, 0 or 1), or +// -2 on error. +int bn_jacobi(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +// bn_is_bit_set_words returns one if bit |bit| is set in |a| and zero +// otherwise. +int bn_is_bit_set_words(const BN_ULONG *a, size_t num, unsigned bit); + +// bn_one_to_montgomery sets |r| to one in Montgomery form. It returns one on +// success and zero on error. This function treats the bit width of the modulus +// as public. +int bn_one_to_montgomery(BIGNUM *r, const BN_MONT_CTX *mont, BN_CTX *ctx); + +// bn_less_than_montgomery_R returns one if |bn| is less than the Montgomery R +// value for |mont| and zero otherwise. +int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont); + +// bn_mod_u16_consttime returns |bn| mod |d|, ignoring |bn|'s sign bit. It runs +// in time independent of the value of |bn|, but it treats |d| as public. +OPENSSL_EXPORT uint16_t bn_mod_u16_consttime(const BIGNUM *bn, uint16_t d); + +// bn_odd_number_is_obviously_composite returns one if |bn| is divisible by one +// of the first several odd primes and zero otherwise. +int bn_odd_number_is_obviously_composite(const BIGNUM *bn); + +// A BN_MILLER_RABIN stores state common to each Miller-Rabin iteration. It is +// initialized within an existing |BN_CTX| scope and may not be used after +// that scope is released with |BN_CTX_end|. Field names match those in FIPS +// 186-4, section C.3.1. +typedef struct { + // w1 is w-1. + BIGNUM *w1; + // m is (w-1)/2^a. + BIGNUM *m; + // one_mont is 1 (mod w) in Montgomery form. + BIGNUM *one_mont; + // w1_mont is w-1 (mod w) in Montgomery form. + BIGNUM *w1_mont; + // w_bits is BN_num_bits(w). + int w_bits; + // a is the largest integer such that 2^a divides w-1. + int a; +} BN_MILLER_RABIN; + +// bn_miller_rabin_init initializes |miller_rabin| for testing if |mont->N| is +// prime. It returns one on success and zero on error. +OPENSSL_EXPORT int bn_miller_rabin_init(BN_MILLER_RABIN *miller_rabin, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +// bn_miller_rabin_iteration performs one Miller-Rabin iteration, checking if +// |b| is a composite witness for |mont->N|. |miller_rabin| must have been +// initialized with |bn_miller_rabin_setup|. On success, it returns one and sets +// |*out_is_possibly_prime| to one if |mont->N| may still be prime or zero if +// |b| shows it is composite. On allocation or internal failure, it returns +// zero. +OPENSSL_EXPORT int bn_miller_rabin_iteration( + const BN_MILLER_RABIN *miller_rabin, int *out_is_possibly_prime, + const BIGNUM *b, const BN_MONT_CTX *mont, BN_CTX *ctx); + +// bn_rshift1_words sets |r| to |a| >> 1, where both arrays are |num| bits wide. +void bn_rshift1_words(BN_ULONG *r, const BN_ULONG *a, size_t num); + +// bn_rshift_words sets |r| to |a| >> |shift|, where both arrays are |num| bits +// wide. +void bn_rshift_words(BN_ULONG *r, const BN_ULONG *a, unsigned shift, + size_t num); + +// bn_rshift_secret_shift behaves like |BN_rshift| but runs in time independent +// of both |a| and |n|. +OPENSSL_EXPORT int bn_rshift_secret_shift(BIGNUM *r, const BIGNUM *a, + unsigned n, BN_CTX *ctx); + +// bn_reduce_once sets |r| to |a| mod |m| where 0 <= |a| < 2*|m|. It returns +// zero if |a| < |m| and a mask of all ones if |a| >= |m|. Each array is |num| +// words long, but |a| has an additional word specified by |carry|. |carry| must +// be zero or one, as implied by the bounds on |a|. +// +// |r|, |a|, and |m| may not alias. Use |bn_reduce_once_in_place| if |r| and |a| +// must alias. +BN_ULONG bn_reduce_once(BN_ULONG *r, const BN_ULONG *a, BN_ULONG carry, + const BN_ULONG *m, size_t num); + +// bn_reduce_once_in_place behaves like |bn_reduce_once| but acts in-place on +// |r|, using |tmp| as scratch space. |r|, |tmp|, and |m| may not alias. +BN_ULONG bn_reduce_once_in_place(BN_ULONG *r, BN_ULONG carry, const BN_ULONG *m, + BN_ULONG *tmp, size_t num); + + +// Constant-time non-modular arithmetic. +// +// The following functions implement non-modular arithmetic in constant-time +// and pessimally set |r->width| to the largest possible word size. +// +// Note this means that, e.g., repeatedly multiplying by one will cause widths +// to increase without bound. The corresponding public API functions minimize +// their outputs to avoid regressing calculator consumers. + +// bn_uadd_consttime behaves like |BN_uadd|, but it pessimally sets +// |r->width| = |a->width| + |b->width| + 1. +int bn_uadd_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// bn_usub_consttime behaves like |BN_usub|, but it pessimally sets +// |r->width| = |a->width|. +int bn_usub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// bn_abs_sub_consttime sets |r| to the absolute value of |a| - |b|, treating +// both inputs as secret. It returns one on success and zero on error. +OPENSSL_EXPORT int bn_abs_sub_consttime(BIGNUM *r, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); + +// bn_mul_consttime behaves like |BN_mul|, but it rejects negative inputs and +// pessimally sets |r->width| to |a->width| + |b->width|, to avoid leaking +// information about |a| and |b|. +int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + +// bn_sqrt_consttime behaves like |BN_sqrt|, but it pessimally sets |r->width| +// to 2*|a->width|, to avoid leaking information about |a| and |b|. +int bn_sqr_consttime(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); + +// bn_div_consttime behaves like |BN_div|, but it rejects negative inputs and +// treats both inputs, including their magnitudes, as secret. It is, as a +// result, much slower than |BN_div| and should only be used for rare operations +// where Montgomery reduction is not available. +// +// Note that |quotient->width| will be set pessimally to |numerator->width|. +OPENSSL_EXPORT int bn_div_consttime(BIGNUM *quotient, BIGNUM *remainder, + const BIGNUM *numerator, + const BIGNUM *divisor, BN_CTX *ctx); + +// bn_is_relatively_prime checks whether GCD(|x|, |y|) is one. On success, it +// returns one and sets |*out_relatively_prime| to one if the GCD was one and +// zero otherwise. On error, it returns zero. +OPENSSL_EXPORT int bn_is_relatively_prime(int *out_relatively_prime, + const BIGNUM *x, const BIGNUM *y, + BN_CTX *ctx); + +// bn_lcm_consttime sets |r| to LCM(|a|, |b|). It returns one and success and +// zero on error. |a| and |b| are both treated as secret. +OPENSSL_EXPORT int bn_lcm_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx); + + +// Constant-time modular arithmetic. +// +// The following functions implement basic constant-time modular arithmetic. + +// bn_mod_add_words sets |r| to |a| + |b| (mod |m|), using |tmp| as scratch +// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of +// |r|, |a|, and |b| may alias. +void bn_mod_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num); + +// bn_mod_add_consttime acts like |BN_mod_add_quick| but takes a |BN_CTX|. +int bn_mod_add_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// bn_mod_sub_words sets |r| to |a| - |b| (mod |m|), using |tmp| as scratch +// space. Each array is |num| words long. |a| and |b| must be < |m|. Any pair of +// |r|, |a|, and |b| may alias. +void bn_mod_sub_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, + const BN_ULONG *m, BN_ULONG *tmp, size_t num); + +// bn_mod_sub_consttime acts like |BN_mod_sub_quick| but takes a |BN_CTX|. +int bn_mod_sub_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// bn_mod_lshift1_consttime acts like |BN_mod_lshift1_quick| but takes a +// |BN_CTX|. +int bn_mod_lshift1_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, + BN_CTX *ctx); + +// bn_mod_lshift_consttime acts like |BN_mod_lshift_quick| but takes a |BN_CTX|. +int bn_mod_lshift_consttime(BIGNUM *r, const BIGNUM *a, int n, const BIGNUM *m, + BN_CTX *ctx); + +// bn_mod_inverse_consttime sets |r| to |a|^-1, mod |n|. |a| must be non- +// negative and less than |n|. It returns one on success and zero on error. On +// failure, if the failure was caused by |a| having no inverse mod |n| then +// |*out_no_inverse| will be set to one; otherwise it will be set to zero. +// +// This function treats both |a| and |n| as secret, provided they are both non- +// zero and the inverse exists. It should only be used for even moduli where +// none of the less general implementations are applicable. +OPENSSL_EXPORT int bn_mod_inverse_consttime(BIGNUM *r, int *out_no_inverse, + const BIGNUM *a, const BIGNUM *n, + BN_CTX *ctx); + +// bn_mod_inverse_prime sets |out| to the modular inverse of |a| modulo |p|, +// computed with Fermat's Little Theorem. It returns one on success and zero on +// error. If |mont_p| is NULL, one will be computed temporarily. +int bn_mod_inverse_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p); + +// bn_mod_inverse_secret_prime behaves like |bn_mod_inverse_prime| but uses +// |BN_mod_exp_mont_consttime| instead of |BN_mod_exp_mont| in hopes of +// protecting the exponent. +int bn_mod_inverse_secret_prime(BIGNUM *out, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx, const BN_MONT_CTX *mont_p); + + +// Low-level operations for small numbers. +// +// The following functions implement algorithms suitable for use with scalars +// and field elements in elliptic curves. They rely on the number being small +// both to stack-allocate various temporaries and because they do not implement +// optimizations useful for the larger values used in RSA. + +// BN_SMALL_MAX_WORDS is the largest size input these functions handle. This +// limit allows temporaries to be more easily stack-allocated. This limit is set +// to accommodate P-521. +#if defined(OPENSSL_32_BIT) +#define BN_SMALL_MAX_WORDS 17 +#else +#define BN_SMALL_MAX_WORDS 9 +#endif + +// bn_mul_small sets |r| to |a|*|b|. |num_r| must be |num_a| + |num_b|. |r| may +// not alias with |a| or |b|. +void bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, + const BN_ULONG *b, size_t num_b); + +// bn_sqr_small sets |r| to |a|^2. |num_a| must be at most |BN_SMALL_MAX_WORDS|. +// |num_r| must be |num_a|*2. |r| and |a| may not alias. +void bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a); + +// In the following functions, the modulus must be at most |BN_SMALL_MAX_WORDS| +// words long. + +// bn_to_montgomery_small sets |r| to |a| translated to the Montgomery domain. +// |r| and |a| are |num| words long, which must be |mont->N.width|. |a| must be +// fully reduced and may alias |r|. +void bn_to_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont); + +// bn_from_montgomery_small sets |r| to |a| translated out of the Montgomery +// domain. |r| and |a| are |num| words long, which must be |mont->N.width|. |a| +// must be fully-reduced and may alias |r|. +void bn_from_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont); + +// bn_mod_mul_montgomery_small sets |r| to |a| * |b| mod |mont->N|. Both inputs +// and outputs are in the Montgomery domain. Each array is |num| words long, +// which must be |mont->N.width|. Any two of |r|, |a|, and |b| may alias. |a| +// and |b| must be reduced on input. +void bn_mod_mul_montgomery_small(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, size_t num, + const BN_MONT_CTX *mont); + +// bn_mod_exp_mont_small sets |r| to |a|^|p| mod |mont->N|. It returns one on +// success and zero on programmer or internal error. Both inputs and outputs are +// in the Montgomery domain. |r| and |a| are |num| words long, which must be +// |mont->N.width| and at most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced. +// This function runs in time independent of |a|, but |p| and |mont->N| are +// public values. |a| must be fully-reduced and may alias with |r|. +// +// Note this function differs from |BN_mod_exp_mont| which uses Montgomery +// reduction but takes input and output outside the Montgomery domain. Combine +// this function with |bn_from_montgomery_small| and |bn_to_montgomery_small| +// if necessary. +void bn_mod_exp_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_ULONG *p, size_t num_p, + const BN_MONT_CTX *mont); + +// bn_mod_inverse_prime_mont_small sets |r| to |a|^-1 mod |mont->N|. |mont->N| +// must be a prime. |r| and |a| are |num| words long, which must be +// |mont->N.width| and at most |BN_SMALL_MAX_WORDS|. |a| must be fully-reduced +// and may alias |r|. This function runs in time independent of |a|, but +// |mont->N| is a public value. +void bn_mod_inverse_prime_mont_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BN_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/jacobi.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/jacobi.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/jacobi.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/jacobi.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/jacobi.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c similarity index 78% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c index d5c209b96..a6b00e20c 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c @@ -109,6 +109,8 @@ #include #include +#include +#include #include #include @@ -120,13 +122,6 @@ #include "../../internal.h" -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define OPENSSL_BN_ASM_MONT -#endif - - BN_MONT_CTX *BN_MONT_CTX_new(void) { BN_MONT_CTX *ret = OPENSSL_malloc(sizeof(BN_MONT_CTX)); @@ -165,12 +160,7 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, const BN_MONT_CTX *from) { return to; } -OPENSSL_COMPILE_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, - BN_MONT_CTX_N0_LIMBS_VALUE_INVALID); -OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS == - sizeof(uint64_t), BN_MONT_CTX_set_64_bit_mismatch); - -int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { +static int bn_mont_ctx_set_N_and_n0(BN_MONT_CTX *mont, const BIGNUM *mod) { if (BN_is_zero(mod)) { OPENSSL_PUT_ERROR(BN, BN_R_DIV_BY_ZERO); return 0; @@ -200,6 +190,11 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { // others, we could use a shorter R value and use faster |BN_ULONG|-based // math instead of |uint64_t|-based math, which would be double-precision. // However, currently only the assembler files know which is which. + OPENSSL_STATIC_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, + "BN_MONT_CTX_N0_LIMBS value is invalid"); + OPENSSL_STATIC_ASSERT( + sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS == sizeof(uint64_t), + "uint64_t is insufficient precision for n0"); uint64_t n0 = bn_mont_n0(&mont->N); mont->n0[0] = (BN_ULONG)n0; #if BN_MONT_CTX_N0_LIMBS == 2 @@ -207,6 +202,13 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { #else mont->n0[1] = 0; #endif + return 1; +} + +int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { + if (!bn_mont_ctx_set_N_and_n0(mont, mod)) { + return 0; + } BN_CTX *new_ctx = NULL; if (ctx == NULL) { @@ -223,7 +225,10 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { // BN_BITS2|, is correct because R**2 will still be a multiple of the latter // as |BN_MONT_CTX_N0_LIMBS| is either one or two. unsigned lgBigR = mont->N.width * BN_BITS2; - int ok = bn_mod_exp_base_2_consttime(&mont->RR, lgBigR * 2, &mont->N, ctx); + BN_zero(&mont->RR); + int ok = BN_set_bit(&mont->RR, lgBigR * 2) && + BN_mod(&mont->RR, &mont->RR, &mont->N, ctx) && + bn_resize_words(&mont->RR, mont->N.width); BN_CTX_free(new_ctx); return ok; } @@ -238,6 +243,24 @@ BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, BN_CTX *ctx) { return mont; } +BN_MONT_CTX *BN_MONT_CTX_new_consttime(const BIGNUM *mod, BN_CTX *ctx) { + BN_MONT_CTX *mont = BN_MONT_CTX_new(); + if (mont == NULL || + !bn_mont_ctx_set_N_and_n0(mont, mod)) { + goto err; + } + unsigned lgBigR = mont->N.width * BN_BITS2; + if (!bn_mod_exp_base_2_consttime(&mont->RR, lgBigR * 2, &mont->N, ctx) || + !bn_resize_words(&mont->RR, mont->N.width)) { + goto err; + } + return mont; + +err: + BN_MONT_CTX_free(mont); + return NULL; +} + int BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, const BIGNUM *mod, BN_CTX *bn_ctx) { CRYPTO_MUTEX_lock_read(lock); @@ -289,18 +312,7 @@ static int bn_from_montgomery_in_place(BN_ULONG *r, size_t num_r, BN_ULONG *a, a += num_n; // |a| thus requires at most one additional subtraction |n| to be reduced. - // Subtract |n| and select the answer in constant time. - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); - BN_ULONG v = bn_sub_words(r, a, n, num_n) - carry; - // |v| is one if |a| - |n| underflowed or zero if it did not. Note |v| cannot - // be -1. That would imply the subtraction did not fit in |num_n| words, and - // we know at most one subtraction is needed. - v = 0u - v; - for (size_t i = 0; i < num_n; i++) { - r[i] = constant_time_select_w(v, a[i], r[i]); - a[i] = 0; - } + bn_reduce_once(r, a, carry, n, num_n); return 1; } @@ -438,89 +450,53 @@ int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont) { bn_fits_in_words(bn, mont->N.width); } -int bn_to_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont) { - return bn_mod_mul_montgomery_small(r, num_r, a, num_a, mont->RR.d, - mont->RR.width, mont); +void bn_to_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont) { + bn_mod_mul_montgomery_small(r, a, mont->RR.d, num, mont); } -int bn_from_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont) { - size_t num_n = mont->N.width; - if (num_a > 2 * num_n || num_r != num_n || num_n > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; +void bn_from_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } BN_ULONG tmp[BN_SMALL_MAX_WORDS * 2]; - size_t num_tmp = 2 * num_n; - OPENSSL_memcpy(tmp, a, num_a * sizeof(BN_ULONG)); - OPENSSL_memset(tmp + num_a, 0, (num_tmp - num_a) * sizeof(BN_ULONG)); - int ret = bn_from_montgomery_in_place(r, num_r, tmp, num_tmp, mont); - OPENSSL_cleanse(tmp, num_tmp * sizeof(BN_ULONG)); - return ret; -} - -int bn_one_to_montgomery_small(BN_ULONG *r, size_t num_r, - const BN_MONT_CTX *mont) { - const BN_ULONG *n = mont->N.d; - size_t num_n = mont->N.width; - if (num_n == 0 || num_r != num_n) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; + OPENSSL_memcpy(tmp, a, num * sizeof(BN_ULONG)); + OPENSSL_memset(tmp + num, 0, num * sizeof(BN_ULONG)); + if (!bn_from_montgomery_in_place(r, num, tmp, 2 * num, mont)) { + abort(); } - - // If the high bit of |n| is set, R = 2^(num_n*BN_BITS2) < 2 * |n|, so we - // compute R - |n| rather than perform Montgomery reduction. - if (num_n > 0 && (n[num_n - 1] >> (BN_BITS2 - 1)) != 0) { - r[0] = 0 - n[0]; - for (size_t i = 1; i < num_n; i++) { - r[i] = ~n[i]; - } - return 1; - } - - return bn_from_montgomery_small(r, num_r, mont->RR.d, mont->RR.width, mont); + OPENSSL_cleanse(tmp, 2 * num * sizeof(BN_ULONG)); } -int bn_mod_mul_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *b, size_t num_b, - const BN_MONT_CTX *mont) { - size_t num_n = mont->N.width; - if (num_r != num_n || num_a + num_b > 2 * num_n || - num_n > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; +void bn_mod_mul_montgomery_small(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, size_t num, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } #if defined(OPENSSL_BN_ASM_MONT) // |bn_mul_mont| requires at least 128 bits of limbs, at least for x86. - if (num_n >= (128 / BN_BITS2) && - num_a == num_n && - num_b == num_n) { - if (!bn_mul_mont(r, a, b, mont->N.d, mont->n0, num_n)) { - assert(0); // The check above ensures this won't happen. - OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); - return 0; + if (num >= (128 / BN_BITS2)) { + if (!bn_mul_mont(r, a, b, mont->N.d, mont->n0, num)) { + abort(); // The check above ensures this won't happen. } - return 1; + return; } #endif // Compute the product. BN_ULONG tmp[2 * BN_SMALL_MAX_WORDS]; - size_t num_tmp = 2 * num_n; - size_t num_ab = num_a + num_b; - if (a == b && num_a == num_b) { - if (!bn_sqr_small(tmp, num_ab, a, num_a)) { - return 0; - } - } else if (!bn_mul_small(tmp, num_ab, a, num_a, b, num_b)) { - return 0; + if (a == b) { + bn_sqr_small(tmp, 2 * num, a, num); + } else { + bn_mul_small(tmp, 2 * num, a, num, b, num); } - // Zero-extend to full width and reduce. - OPENSSL_memset(tmp + num_ab, 0, (num_tmp - num_ab) * sizeof(BN_ULONG)); - int ret = bn_from_montgomery_in_place(r, num_r, tmp, num_tmp, mont); - OPENSSL_cleanse(tmp, num_tmp * sizeof(BN_ULONG)); - return ret; + // Reduce. + if (!bn_from_montgomery_in_place(r, num, tmp, 2 * num, mont)) { + abort(); + } + OPENSSL_cleanse(tmp, 2 * num * sizeof(BN_ULONG)); } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c.grpc_back similarity index 78% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c.grpc_back index d6e2ad55b..b6eaf6a2e 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery.c.grpc_back @@ -109,6 +109,8 @@ #include #include +#include +#include #include #include @@ -120,13 +122,6 @@ #include "../../internal.h" -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define OPENSSL_BN_ASM_MONT -#endif - - BN_MONT_CTX *BN_MONT_CTX_new(void) { BN_MONT_CTX *ret = OPENSSL_malloc(sizeof(BN_MONT_CTX)); @@ -165,12 +160,7 @@ BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, const BN_MONT_CTX *from) { return to; } -OPENSSL_COMPILE_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, - BN_MONT_CTX_N0_LIMBS_VALUE_INVALID); -OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS == - sizeof(uint64_t), BN_MONT_CTX_set_64_bit_mismatch); - -int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { +static int bn_mont_ctx_set_N_and_n0(BN_MONT_CTX *mont, const BIGNUM *mod) { if (BN_is_zero(mod)) { OPENSSL_PUT_ERROR(BN, BN_R_DIV_BY_ZERO); return 0; @@ -200,6 +190,11 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { // others, we could use a shorter R value and use faster |BN_ULONG|-based // math instead of |uint64_t|-based math, which would be double-precision. // However, currently only the assembler files know which is which. + OPENSSL_STATIC_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, + "BN_MONT_CTX_N0_LIMBS value is invalid"); + OPENSSL_STATIC_ASSERT( + sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS == sizeof(uint64_t), + "uint64_t is insufficient precision for n0"); uint64_t n0 = bn_mont_n0(&mont->N); mont->n0[0] = (BN_ULONG)n0; #if BN_MONT_CTX_N0_LIMBS == 2 @@ -207,6 +202,13 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { #else mont->n0[1] = 0; #endif + return 1; +} + +int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { + if (!bn_mont_ctx_set_N_and_n0(mont, mod)) { + return 0; + } BN_CTX *new_ctx = NULL; if (ctx == NULL) { @@ -223,7 +225,10 @@ int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx) { // BN_BITS2|, is correct because R**2 will still be a multiple of the latter // as |BN_MONT_CTX_N0_LIMBS| is either one or two. unsigned lgBigR = mont->N.width * BN_BITS2; - int ok = bn_mod_exp_base_2_consttime(&mont->RR, lgBigR * 2, &mont->N, ctx); + BN_zero(&mont->RR); + int ok = BN_set_bit(&mont->RR, lgBigR * 2) && + BN_mod(&mont->RR, &mont->RR, &mont->N, ctx) && + bn_resize_words(&mont->RR, mont->N.width); BN_CTX_free(new_ctx); return ok; } @@ -238,6 +243,24 @@ BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, BN_CTX *ctx) { return mont; } +BN_MONT_CTX *BN_MONT_CTX_new_consttime(const BIGNUM *mod, BN_CTX *ctx) { + BN_MONT_CTX *mont = BN_MONT_CTX_new(); + if (mont == NULL || + !bn_mont_ctx_set_N_and_n0(mont, mod)) { + goto err; + } + unsigned lgBigR = mont->N.width * BN_BITS2; + if (!bn_mod_exp_base_2_consttime(&mont->RR, lgBigR * 2, &mont->N, ctx) || + !bn_resize_words(&mont->RR, mont->N.width)) { + goto err; + } + return mont; + +err: + BN_MONT_CTX_free(mont); + return NULL; +} + int BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, const BIGNUM *mod, BN_CTX *bn_ctx) { CRYPTO_MUTEX_lock_read(lock); @@ -289,18 +312,7 @@ static int bn_from_montgomery_in_place(BN_ULONG *r, size_t num_r, BN_ULONG *a, a += num_n; // |a| thus requires at most one additional subtraction |n| to be reduced. - // Subtract |n| and select the answer in constant time. - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); - BN_ULONG v = bn_sub_words(r, a, n, num_n) - carry; - // |v| is one if |a| - |n| underflowed or zero if it did not. Note |v| cannot - // be -1. That would imply the subtraction did not fit in |num_n| words, and - // we know at most one subtraction is needed. - v = 0u - v; - for (size_t i = 0; i < num_n; i++) { - r[i] = constant_time_select_w(v, a[i], r[i]); - a[i] = 0; - } + bn_reduce_once(r, a, carry, n, num_n); return 1; } @@ -438,89 +450,53 @@ int bn_less_than_montgomery_R(const BIGNUM *bn, const BN_MONT_CTX *mont) { bn_fits_in_words(bn, mont->N.width); } -int bn_to_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont) { - return bn_mod_mul_montgomery_small(r, num_r, a, num_a, mont->RR.d, - mont->RR.width, mont); +void bn_to_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont) { + bn_mod_mul_montgomery_small(r, a, mont->RR.d, num, mont); } -int bn_from_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_MONT_CTX *mont) { - size_t num_n = mont->N.width; - if (num_a > 2 * num_n || num_r != num_n || num_n > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; +void bn_from_montgomery_small(BN_ULONG *r, const BN_ULONG *a, size_t num, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } BN_ULONG tmp[BN_SMALL_MAX_WORDS * 2]; - size_t num_tmp = 2 * num_n; - OPENSSL_memcpy(tmp, a, num_a * sizeof(BN_ULONG)); - OPENSSL_memset(tmp + num_a, 0, (num_tmp - num_a) * sizeof(BN_ULONG)); - int ret = bn_from_montgomery_in_place(r, num_r, tmp, num_tmp, mont); - OPENSSL_cleanse(tmp, num_tmp * sizeof(BN_ULONG)); - return ret; -} - -int bn_one_to_montgomery_small(BN_ULONG *r, size_t num_r, - const BN_MONT_CTX *mont) { - const BN_ULONG *n = mont->N.d; - size_t num_n = mont->N.width; - if (num_n == 0 || num_r != num_n) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; + OPENSSL_memcpy(tmp, a, num * sizeof(BN_ULONG)); + OPENSSL_memset(tmp + num, 0, num * sizeof(BN_ULONG)); + if (!bn_from_montgomery_in_place(r, num, tmp, 2 * num, mont)) { + abort(); } - - // If the high bit of |n| is set, R = 2^(num_n*BN_BITS2) < 2 * |n|, so we - // compute R - |n| rather than perform Montgomery reduction. - if (num_n > 0 && (n[num_n - 1] >> (BN_BITS2 - 1)) != 0) { - r[0] = 0 - n[0]; - for (size_t i = 1; i < num_n; i++) { - r[i] = ~n[i]; - } - return 1; - } - - return bn_from_montgomery_small(r, num_r, mont->RR.d, mont->RR.width, mont); + OPENSSL_cleanse(tmp, 2 * num * sizeof(BN_ULONG)); } -int bn_mod_mul_montgomery_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, - size_t num_a, const BN_ULONG *b, size_t num_b, - const BN_MONT_CTX *mont) { - size_t num_n = mont->N.width; - if (num_r != num_n || num_a + num_b > 2 * num_n || - num_n > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; +void bn_mod_mul_montgomery_small(BN_ULONG *r, const BN_ULONG *a, + const BN_ULONG *b, size_t num, + const BN_MONT_CTX *mont) { + if (num != (size_t)mont->N.width || num > BN_SMALL_MAX_WORDS) { + abort(); } #if defined(OPENSSL_BN_ASM_MONT) // |bn_mul_mont| requires at least 128 bits of limbs, at least for x86. - if (num_n >= (128 / BN_BITS2) && - num_a == num_n && - num_b == num_n) { - if (!bn_mul_mont(r, a, b, mont->N.d, mont->n0, num_n)) { - assert(0); // The check above ensures this won't happen. - OPENSSL_PUT_ERROR(BN, ERR_R_INTERNAL_ERROR); - return 0; + if (num >= (128 / BN_BITS2)) { + if (!bn_mul_mont(r, a, b, mont->N.d, mont->n0, num)) { + abort(); // The check above ensures this won't happen. } - return 1; + return; } #endif // Compute the product. BN_ULONG tmp[2 * BN_SMALL_MAX_WORDS]; - size_t num_tmp = 2 * num_n; - size_t num_ab = num_a + num_b; - if (a == b && num_a == num_b) { - if (!bn_sqr_small(tmp, num_ab, a, num_a)) { - return 0; - } - } else if (!bn_mul_small(tmp, num_ab, a, num_a, b, num_b)) { - return 0; + if (a == b) { + bn_sqr_small(tmp, 2 * num, a, num); + } else { + bn_mul_small(tmp, 2 * num, a, num, b, num); } - // Zero-extend to full width and reduce. - OPENSSL_memset(tmp + num_ab, 0, (num_tmp - num_ab) * sizeof(BN_ULONG)); - int ret = bn_from_montgomery_in_place(r, num_r, tmp, num_tmp, mont); - OPENSSL_cleanse(tmp, num_tmp * sizeof(BN_ULONG)); - return ret; + // Reduce. + if (!bn_from_montgomery_in_place(r, num, tmp, 2 * num, mont)) { + abort(); + } + OPENSSL_cleanse(tmp, 2 * num * sizeof(BN_ULONG)); } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery_inv.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery_inv.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c index 6489a9b1a..64d07ed66 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery_inv.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c @@ -22,17 +22,18 @@ static uint64_t bn_neg_inv_mod_r_u64(uint64_t n); -OPENSSL_COMPILE_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, - BN_MONT_CTX_N0_LIMBS_VALUE_INVALID_2); -OPENSSL_COMPILE_ASSERT(sizeof(uint64_t) == - BN_MONT_CTX_N0_LIMBS * sizeof(BN_ULONG), - BN_MONT_CTX_N0_LIMBS_DOES_NOT_MATCH_UINT64_T); +OPENSSL_STATIC_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, + "BN_MONT_CTX_N0_LIMBS value is invalid"); +OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS == + sizeof(uint64_t), + "uint64_t is insufficient precision for n0"); // LG_LITTLE_R is log_2(r). #define LG_LITTLE_R (BN_MONT_CTX_N0_LIMBS * BN_BITS2) uint64_t bn_mont_n0(const BIGNUM *n) { - // These conditions are checked by the caller, |BN_MONT_CTX_set|. + // These conditions are checked by the caller, |BN_MONT_CTX_set| or + // |BN_MONT_CTX_new_consttime|. assert(!BN_is_zero(n)); assert(!BN_is_negative(n)); assert(BN_is_odd(n)); diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back index a920ca41d..c80873f57 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/montgomery_inv.c.grpc_back @@ -22,17 +22,18 @@ static uint64_t bn_neg_inv_mod_r_u64(uint64_t n); -OPENSSL_COMPILE_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, - BN_MONT_CTX_N0_LIMBS_VALUE_INVALID_2); -OPENSSL_COMPILE_ASSERT(sizeof(uint64_t) == - BN_MONT_CTX_N0_LIMBS * sizeof(BN_ULONG), - BN_MONT_CTX_N0_LIMBS_DOES_NOT_MATCH_UINT64_T); +OPENSSL_STATIC_ASSERT(BN_MONT_CTX_N0_LIMBS == 1 || BN_MONT_CTX_N0_LIMBS == 2, + "BN_MONT_CTX_N0_LIMBS value is invalid"); +OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS == + sizeof(uint64_t), + "uint64_t is insufficient precision for n0"); // LG_LITTLE_R is log_2(r). #define LG_LITTLE_R (BN_MONT_CTX_N0_LIMBS * BN_BITS2) uint64_t bn_mont_n0(const BIGNUM *n) { - // These conditions are checked by the caller, |BN_MONT_CTX_set|. + // These conditions are checked by the caller, |BN_MONT_CTX_set| or + // |BN_MONT_CTX_new_consttime|. assert(!BN_is_zero(n)); assert(!BN_is_negative(n)); assert(BN_is_odd(n)); diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/mul.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/mul.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c index e9610dab8..7050c8dea 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/mul.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c @@ -57,6 +57,7 @@ #include #include +#include #include #include @@ -408,8 +409,8 @@ static void bn_mul_recursive(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, BN_ULONG c_neg = c - bn_sub_words(&t[n2 * 2], t, &t[n2], n2); BN_ULONG c_pos = c + bn_add_words(&t[n2], t, &t[n2], n2); bn_select_words(&t[n2], neg, &t[n2 * 2], &t[n2], n2); - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); c = constant_time_select_w(neg, c_neg, c_pos); // We now have our three components. Add them together. @@ -522,8 +523,8 @@ static void bn_mul_part_recursive(BN_ULONG *r, const BN_ULONG *a, BN_ULONG c_neg = c - bn_sub_words(&t[n2 * 2], t, &t[n2], n2); BN_ULONG c_pos = c + bn_add_words(&t[n2], t, &t[n2], n2); bn_select_words(&t[n2], neg, &t[n2 * 2], &t[n2], n2); - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); c = constant_time_select_w(neg, c_neg, c_pos); // We now have our three components. Add them together. @@ -558,7 +559,7 @@ static int bn_mul_impl(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX_start(ctx); if (r == a || r == b) { rr = BN_CTX_get(ctx); - if (r == NULL) { + if (rr == NULL) { goto err; } } else { @@ -656,11 +657,10 @@ int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { return bn_mul_impl(r, a, b, ctx); } -int bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, - const BN_ULONG *b, size_t num_b) { +void bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, + const BN_ULONG *b, size_t num_b) { if (num_r != num_a + num_b) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; + abort(); } // TODO(davidben): Should this call |bn_mul_comba4| too? |BN_mul| does not // hit that code. @@ -669,7 +669,6 @@ int bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, } else { bn_mul_normal(r, a, num_a, b, num_b); } - return 1; } // tmp must have 2*n words @@ -858,10 +857,9 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { return 1; } -int bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a) { +void bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a) { if (num_r != 2 * num_a || num_a > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; + abort(); } if (num_a == 4) { bn_sqr_comba4(r, a); @@ -872,5 +870,4 @@ int bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a) { bn_sqr_normal(r, a, num_a, tmp); OPENSSL_cleanse(tmp, 2 * num_a * sizeof(BN_ULONG)); } - return 1; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/mul.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/mul.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c.grpc_back index 4a0711d89..640d8cdb0 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/mul.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/mul.c.grpc_back @@ -57,6 +57,7 @@ #include #include +#include #include #include @@ -408,8 +409,8 @@ static void bn_mul_recursive(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, BN_ULONG c_neg = c - bn_sub_words(&t[n2 * 2], t, &t[n2], n2); BN_ULONG c_pos = c + bn_add_words(&t[n2], t, &t[n2], n2); bn_select_words(&t[n2], neg, &t[n2 * 2], &t[n2], n2); - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); c = constant_time_select_w(neg, c_neg, c_pos); // We now have our three components. Add them together. @@ -522,8 +523,8 @@ static void bn_mul_part_recursive(BN_ULONG *r, const BN_ULONG *a, BN_ULONG c_neg = c - bn_sub_words(&t[n2 * 2], t, &t[n2], n2); BN_ULONG c_pos = c + bn_add_words(&t[n2], t, &t[n2], n2); bn_select_words(&t[n2], neg, &t[n2 * 2], &t[n2], n2); - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); c = constant_time_select_w(neg, c_neg, c_pos); // We now have our three components. Add them together. @@ -558,7 +559,7 @@ static int bn_mul_impl(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX_start(ctx); if (r == a || r == b) { rr = BN_CTX_get(ctx); - if (r == NULL) { + if (rr == NULL) { goto err; } } else { @@ -656,11 +657,10 @@ int bn_mul_consttime(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { return bn_mul_impl(r, a, b, ctx); } -int bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, - const BN_ULONG *b, size_t num_b) { +void bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, + const BN_ULONG *b, size_t num_b) { if (num_r != num_a + num_b) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; + abort(); } // TODO(davidben): Should this call |bn_mul_comba4| too? |BN_mul| does not // hit that code. @@ -669,7 +669,6 @@ int bn_mul_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a, } else { bn_mul_normal(r, a, num_a, b, num_b); } - return 1; } // tmp must have 2*n words @@ -858,10 +857,9 @@ int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx) { return 1; } -int bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a) { +void bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a) { if (num_r != 2 * num_a || num_a > BN_SMALL_MAX_WORDS) { - OPENSSL_PUT_ERROR(BN, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; + abort(); } if (num_a == 4) { bn_sqr_comba4(r, a); @@ -872,5 +870,4 @@ int bn_sqr_small(BN_ULONG *r, size_t num_r, const BN_ULONG *a, size_t num_a) { bn_sqr_normal(r, a, num_a, tmp); OPENSSL_cleanse(tmp, 2 * num_a * sizeof(BN_ULONG)); } - return 1; } diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c new file mode 100644 index 000000000..ea41f0fa6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c @@ -0,0 +1,1068 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// The quick sieve algorithm approach to weeding out primes is Philip +// Zimmermann's, as implemented in PGP. I have had a read of his comments and +// implemented my own version. + +// kPrimes contains the first 1024 primes. +static const uint16_t kPrimes[] = { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, + 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, + 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, + 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, + 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, + 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, + 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, + 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, + 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, + 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, + 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, + 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, + 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, + 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, + 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, + 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, + 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, + 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, + 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, + 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, + 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, + 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, + 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, + 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, + 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, + 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, + 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, + 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, + 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, + 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, + 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, + 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, + 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, + 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, + 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, + 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, + 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, + 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, + 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, + 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, + 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, + 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, + 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, + 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, + 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, + 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, + 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, + 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, + 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, + 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, + 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, + 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, + 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, + 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, + 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, + 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, + 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, + 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, + 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, + 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, + 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, + 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, + 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, + 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, + 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, + 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, + 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, + 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, + 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, + 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, + 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, + 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, + 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, + 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, + 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, + 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, + 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, + 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, + 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, + 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, + 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, + 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, + 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, + 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, + 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, + 8117, 8123, 8147, 8161, +}; + +// BN_prime_checks_for_size returns the number of Miller-Rabin iterations +// necessary for generating a 'bits'-bit candidate prime. +// +// +// This table is generated using the algorithm of FIPS PUB 186-4 +// Digital Signature Standard (DSS), section F.1, page 117. +// (https://doi.org/10.6028/NIST.FIPS.186-4) +// The following magma script was used to generate the output: +// securitybits:=125; +// k:=1024; +// for t:=1 to 65 do +// for M:=3 to Floor(2*Sqrt(k-1)-1) do +// S:=0; +// // Sum over m +// for m:=3 to M do +// s:=0; +// // Sum over j +// for j:=2 to m do +// s+:=(RealField(32)!2)^-(j+(k-1)/j); +// end for; +// S+:=2^(m-(m-1)*t)*s; +// end for; +// A:=2^(k-2-M*t); +// B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; +// pkt:=2.00743*Log(2)*k*2^-k*(A+B); +// seclevel:=Floor(-Log(2,pkt)); +// if seclevel ge securitybits then +// printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; +// break; +// end if; +// end for; +// if seclevel ge securitybits then break; end if; +// end for; +// +// It can be run online at: http://magma.maths.usyd.edu.au/calc +// And will output: +// k: 1024, security: 129 bits (t: 6, M: 23) +// k is the number of bits of the prime, securitybits is the level we want to +// reach. +// prime length | RSA key size | # MR tests | security level +// -------------+--------------|------------+--------------- +// (b) >= 6394 | >= 12788 | 3 | 256 bit +// (b) >= 3747 | >= 7494 | 3 | 192 bit +// (b) >= 1345 | >= 2690 | 4 | 128 bit +// (b) >= 1080 | >= 2160 | 5 | 128 bit +// (b) >= 852 | >= 1704 | 5 | 112 bit +// (b) >= 476 | >= 952 | 5 | 80 bit +// (b) >= 400 | >= 800 | 6 | 80 bit +// (b) >= 347 | >= 694 | 7 | 80 bit +// (b) >= 308 | >= 616 | 8 | 80 bit +// (b) >= 55 | >= 110 | 27 | 64 bit +// (b) >= 6 | >= 12 | 34 | 64 bit +static int BN_prime_checks_for_size(int bits) { + if (bits >= 3747) { + return 3; + } + if (bits >= 1345) { + return 4; + } + if (bits >= 476) { + return 5; + } + if (bits >= 400) { + return 6; + } + if (bits >= 347) { + return 7; + } + if (bits >= 308) { + return 8; + } + if (bits >= 55) { + return 27; + } + return 34; +} + +// num_trial_division_primes returns the number of primes to try with trial +// division before using more expensive checks. For larger numbers, the value +// of excluding a candidate with trial division is larger. +static size_t num_trial_division_primes(const BIGNUM *n) { + if (n->width * BN_BITS2 > 1024) { + return OPENSSL_ARRAY_SIZE(kPrimes); + } + return OPENSSL_ARRAY_SIZE(kPrimes) / 2; +} + +// BN_PRIME_CHECKS_BLINDED is the iteration count for blinding the constant-time +// primality test. See |BN_primality_test| for details. This number is selected +// so that, for a candidate N-bit RSA prime, picking |BN_PRIME_CHECKS_BLINDED| +// random N-bit numbers will have at least |BN_prime_checks_for_size(N)| values +// in range with high probability. +// +// The following Python script computes the blinding factor needed for the +// corresponding iteration count. +/* +import math + +# We choose candidate RSA primes between sqrt(2)/2 * 2^N and 2^N and select +# witnesses by generating random N-bit numbers. Thus the probability of +# selecting one in range is at least sqrt(2)/2. +p = math.sqrt(2) / 2 + +# Target around 2^-8 probability of the blinding being insufficient given that +# key generation is a one-time, noisy operation. +epsilon = 2**-8 + +def choose(a, b): + r = 1 + for i in xrange(b): + r *= a - i + r /= (i + 1) + return r + +def failure_rate(min_uniform, iterations): + """ Returns the probability that, for |iterations| candidate witnesses, fewer + than |min_uniform| of them will be uniform. """ + prob = 0.0 + for i in xrange(min_uniform): + prob += (choose(iterations, i) * + p**i * (1-p)**(iterations - i)) + return prob + +for min_uniform in (3, 4, 5, 6, 8, 13, 19, 28): + # Find the smallest number of iterations under the target failure rate. + iterations = min_uniform + while True: + prob = failure_rate(min_uniform, iterations) + if prob < epsilon: + print min_uniform, iterations, prob + break + iterations += 1 + +Output: + 3 9 0.00368894873911 + 4 11 0.00363319494662 + 5 13 0.00336215573898 + 6 15 0.00300145783158 + 8 19 0.00225214119331 + 13 27 0.00385610026955 + 19 38 0.0021410539126 + 28 52 0.00325405801769 + +16 iterations suffices for 400-bit primes and larger (6 uniform samples needed), +which is already well below the minimum acceptable key size for RSA. +*/ +#define BN_PRIME_CHECKS_BLINDED 16 + +static int probable_prime(BIGNUM *rnd, int bits); +static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, + const BIGNUM *rem, BN_CTX *ctx); +static int probable_prime_dh_safe(BIGNUM *rnd, int bits, const BIGNUM *add, + const BIGNUM *rem, BN_CTX *ctx); + +void BN_GENCB_set(BN_GENCB *callback, + int (*f)(int event, int n, struct bn_gencb_st *), + void *arg) { + callback->callback = f; + callback->arg = arg; +} + +int BN_GENCB_call(BN_GENCB *callback, int event, int n) { + if (!callback) { + return 1; + } + + return callback->callback(event, n, callback); +} + +int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, + const BIGNUM *rem, BN_GENCB *cb) { + BIGNUM *t; + int found = 0; + int i, j, c1 = 0; + BN_CTX *ctx; + int checks = BN_prime_checks_for_size(bits); + + if (bits < 2) { + // There are no prime numbers this small. + OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); + return 0; + } else if (bits == 2 && safe) { + // The smallest safe prime (7) is three bits. + OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); + return 0; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (!t) { + goto err; + } + +loop: + // make a random number and set the top and bottom bits + if (add == NULL) { + if (!probable_prime(ret, bits)) { + goto err; + } + } else { + if (safe) { + if (!probable_prime_dh_safe(ret, bits, add, rem, ctx)) { + goto err; + } + } else { + if (!probable_prime_dh(ret, bits, add, rem, ctx)) { + goto err; + } + } + } + + if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, c1++)) { + // aborted + goto err; + } + + if (!safe) { + i = BN_is_prime_fasttest_ex(ret, checks, ctx, 0, cb); + if (i == -1) { + goto err; + } else if (i == 0) { + goto loop; + } + } else { + // for "safe prime" generation, check that (p-1)/2 is prime. Since a prime + // is odd, We just need to divide by 2 + if (!BN_rshift1(t, ret)) { + goto err; + } + + // Interleave |ret| and |t|'s primality tests to avoid paying the full + // iteration count on |ret| only to quickly discover |t| is composite. + // + // TODO(davidben): This doesn't quite work because an iteration count of 1 + // still runs the blinding mechanism. + for (i = 0; i < checks; i++) { + j = BN_is_prime_fasttest_ex(ret, 1, ctx, 0, NULL); + if (j == -1) { + goto err; + } else if (j == 0) { + goto loop; + } + + j = BN_is_prime_fasttest_ex(t, 1, ctx, 0, NULL); + if (j == -1) { + goto err; + } else if (j == 0) { + goto loop; + } + + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, i)) { + goto err; + } + // We have a safe prime test pass + } + } + + // we have a prime :-) + found = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + + return found; +} + +static int bn_trial_division(uint16_t *out, const BIGNUM *bn) { + const size_t num_primes = num_trial_division_primes(bn); + for (size_t i = 1; i < num_primes; i++) { + if (bn_mod_u16_consttime(bn, kPrimes[i]) == 0) { + *out = kPrimes[i]; + return 1; + } + } + return 0; +} + +int bn_odd_number_is_obviously_composite(const BIGNUM *bn) { + uint16_t prime; + return bn_trial_division(&prime, bn) && !BN_is_word(bn, prime); +} + +int bn_miller_rabin_init(BN_MILLER_RABIN *miller_rabin, const BN_MONT_CTX *mont, + BN_CTX *ctx) { + // This function corresponds to steps 1 through 3 of FIPS 186-4, C.3.1. + const BIGNUM *w = &mont->N; + // Note we do not call |BN_CTX_start| in this function. We intentionally + // allocate values in the containing scope so they outlive this function. + miller_rabin->w1 = BN_CTX_get(ctx); + miller_rabin->m = BN_CTX_get(ctx); + miller_rabin->one_mont = BN_CTX_get(ctx); + miller_rabin->w1_mont = BN_CTX_get(ctx); + if (miller_rabin->w1 == NULL || + miller_rabin->m == NULL || + miller_rabin->one_mont == NULL || + miller_rabin->w1_mont == NULL) { + return 0; + } + + // See FIPS 186-4, C.3.1, steps 1 through 3. + if (!bn_usub_consttime(miller_rabin->w1, w, BN_value_one())) { + return 0; + } + miller_rabin->a = BN_count_low_zero_bits(miller_rabin->w1); + if (!bn_rshift_secret_shift(miller_rabin->m, miller_rabin->w1, + miller_rabin->a, ctx)) { + return 0; + } + miller_rabin->w_bits = BN_num_bits(w); + + // Precompute some values in Montgomery form. + if (!bn_one_to_montgomery(miller_rabin->one_mont, mont, ctx) || + // w - 1 is -1 mod w, so we can compute it in the Montgomery domain, -R, + // with a subtraction. (|one_mont| cannot be zero.) + !bn_usub_consttime(miller_rabin->w1_mont, w, miller_rabin->one_mont)) { + return 0; + } + + return 1; +} + +int bn_miller_rabin_iteration(const BN_MILLER_RABIN *miller_rabin, + int *out_is_possibly_prime, const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + // This function corresponds to steps 4.3 through 4.5 of FIPS 186-4, C.3.1. + int ret = 0; + BN_CTX_start(ctx); + + // Step 4.3. We use Montgomery-encoding for better performance and to avoid + // timing leaks. + const BIGNUM *w = &mont->N; + BIGNUM *z = BN_CTX_get(ctx); + if (z == NULL || + !BN_mod_exp_mont_consttime(z, b, miller_rabin->m, w, ctx, mont) || + !BN_to_montgomery(z, z, mont, ctx)) { + goto err; + } + + // is_possibly_prime is all ones if we have determined |b| is not a composite + // witness for |w|. This is equivalent to going to step 4.7 in the original + // algorithm. To avoid timing leaks, we run the algorithm to the end for prime + // inputs. + crypto_word_t is_possibly_prime = 0; + + // Step 4.4. If z = 1 or z = w-1, b is not a composite witness and w is still + // possibly prime. + is_possibly_prime = BN_equal_consttime(z, miller_rabin->one_mont) | + BN_equal_consttime(z, miller_rabin->w1_mont); + is_possibly_prime = 0 - is_possibly_prime; // Make it all zeros or all ones. + + // Step 4.5. + // + // To avoid leaking |a|, we run the loop to |w_bits| and mask off all + // iterations once |j| = |a|. + for (int j = 1; j < miller_rabin->w_bits; j++) { + if (constant_time_eq_int(j, miller_rabin->a) & ~is_possibly_prime) { + // If the loop is done and we haven't seen z = 1 or z = w-1 yet, the + // value is composite and we can break in variable time. + break; + } + + // Step 4.5.1. + if (!BN_mod_mul_montgomery(z, z, z, mont, ctx)) { + goto err; + } + + // Step 4.5.2. If z = w-1 and the loop is not done, this is not a composite + // witness. + crypto_word_t z_is_w1_mont = BN_equal_consttime(z, miller_rabin->w1_mont); + z_is_w1_mont = 0 - z_is_w1_mont; // Make it all zeros or all ones. + is_possibly_prime |= z_is_w1_mont; // Go to step 4.7 if |z_is_w1_mont|. + + // Step 4.5.3. If z = 1 and the loop is not done, the previous value of z + // was not -1. There are no non-trivial square roots of 1 modulo a prime, so + // w is composite and we may exit in variable time. + if (BN_equal_consttime(z, miller_rabin->one_mont) & ~is_possibly_prime) { + break; + } + } + + *out_is_possibly_prime = is_possibly_prime & 1; + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_primality_test(int *out_is_probably_prime, const BIGNUM *w, int checks, + BN_CTX *ctx, int do_trial_division, BN_GENCB *cb) { + // This function's secrecy and performance requirements come from RSA key + // generation. We generate RSA keys by selecting two large, secret primes with + // rejection sampling. + // + // We thus treat |w| as secret if turns out to be a large prime. However, if + // |w| is composite, we treat this and |w| itself as public. (Conversely, if + // |w| is prime, that it is prime is public. Only the value is secret.) This + // is fine for RSA key generation, but note it is important that we use + // rejection sampling, with each candidate prime chosen independently. This + // would not work for, e.g., an algorithm which looked for primes in + // consecutive integers. These assumptions allow us to discard composites + // quickly. We additionally treat |w| as public when it is a small prime to + // simplify trial decryption and some edge cases. + // + // One RSA key generation will call this function on exactly two primes and + // many more composites. The overall cost is a combination of several factors: + // + // 1. Checking if |w| is divisible by a small prime is much faster than + // learning it is composite by Miller-Rabin (see below for details on that + // cost). Trial division by p saves 1/p of Miller-Rabin calls, so this is + // worthwhile until p exceeds the ratio of the two costs. + // + // 2. For a random (i.e. non-adversarial) candidate large prime and candidate + // witness, the probability of false witness is very low. (This is why FIPS + // 186-4 only requires a few iterations.) Thus composites not discarded by + // trial decryption, in practice, cost one Miller-Rabin iteration. Only the + // two actual primes cost the full iteration count. + // + // 3. A Miller-Rabin iteration is a modular exponentiation plus |a| additional + // modular squares, where |a| is the number of factors of two in |w-1|. |a| + // is likely small (the distribution falls exponentially), but it is also + // potentially secret, so we loop up to its log(w) upper bound when |w| is + // prime. When |w| is composite, we break early, so only two calls pay this + // cost. (Note that all calls pay the modular exponentiation which is, + // itself, log(w) modular multiplications and squares.) + // + // 4. While there are only two prime calls, they multiplicatively pay the full + // costs of (2) and (3). + // + // 5. After the primes are chosen, RSA keys derive some values from the + // primes, but this cost is negligible in comparison. + + *out_is_probably_prime = 0; + + if (BN_cmp(w, BN_value_one()) <= 0) { + return 1; + } + + if (!BN_is_odd(w)) { + // The only even prime is two. + *out_is_probably_prime = BN_is_word(w, 2); + return 1; + } + + // Miller-Rabin does not work for three. + if (BN_is_word(w, 3)) { + *out_is_probably_prime = 1; + return 1; + } + + if (do_trial_division) { + // Perform additional trial division checks to discard small primes. + uint16_t prime; + if (bn_trial_division(&prime, w)) { + *out_is_probably_prime = BN_is_word(w, prime); + return 1; + } + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, -1)) { + return 0; + } + } + + if (checks == BN_prime_checks_for_generation) { + checks = BN_prime_checks_for_size(BN_num_bits(w)); + } + + BN_CTX *new_ctx = NULL; + if (ctx == NULL) { + new_ctx = BN_CTX_new(); + if (new_ctx == NULL) { + return 0; + } + ctx = new_ctx; + } + + // See C.3.1 from FIPS 186-4. + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *b = BN_CTX_get(ctx); + BN_MONT_CTX *mont = BN_MONT_CTX_new_consttime(w, ctx); + BN_MILLER_RABIN miller_rabin; + if (b == NULL || mont == NULL || + // Steps 1-3. + !bn_miller_rabin_init(&miller_rabin, mont, ctx)) { + goto err; + } + + // The following loop performs in inner iteration of the Miller-Rabin + // Primality test (Step 4). + // + // The algorithm as specified in FIPS 186-4 leaks information on |w|, the RSA + // private key. Instead, we run through each iteration unconditionally, + // performing modular multiplications, masking off any effects to behave + // equivalently to the specified algorithm. + // + // We also blind the number of values of |b| we try. Steps 4.1–4.2 say to + // discard out-of-range values. To avoid leaking information on |w|, we use + // |bn_rand_secret_range| which, rather than discarding bad values, adjusts + // them to be in range. Though not uniformly selected, these adjusted values + // are still usable as Miller-Rabin checks. + // + // Miller-Rabin is already probabilistic, so we could reach the desired + // confidence levels by just suitably increasing the iteration count. However, + // to align with FIPS 186-4, we use a more pessimal analysis: we do not count + // the non-uniform values towards the iteration count. As a result, this + // function is more complex and has more timing risk than necessary. + // + // We count both total iterations and uniform ones and iterate until we've + // reached at least |BN_PRIME_CHECKS_BLINDED| and |iterations|, respectively. + // If the latter is large enough, it will be the limiting factor with high + // probability and we won't leak information. + // + // Note this blinding does not impact most calls when picking primes because + // composites are rejected early. Only the two secret primes see extra work. + + crypto_word_t uniform_iterations = 0; + // Using |constant_time_lt_w| seems to prevent the compiler from optimizing + // this into two jumps. + for (int i = 1; (i <= BN_PRIME_CHECKS_BLINDED) | + constant_time_lt_w(uniform_iterations, checks); + i++) { + // Step 4.1-4.2 + int is_uniform; + if (!bn_rand_secret_range(b, &is_uniform, 2, miller_rabin.w1)) { + goto err; + } + uniform_iterations += is_uniform; + + // Steps 4.3-4.5 + int is_possibly_prime = 0; + if (!bn_miller_rabin_iteration(&miller_rabin, &is_possibly_prime, b, mont, + ctx)) { + goto err; + } + + if (!is_possibly_prime) { + // Step 4.6. We did not see z = w-1 before z = 1, so w must be composite. + *out_is_probably_prime = 0; + ret = 1; + goto err; + } + + // Step 4.7 + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, i - 1)) { + goto err; + } + } + + assert(uniform_iterations >= (crypto_word_t)checks); + *out_is_probably_prime = 1; + ret = 1; + +err: + BN_MONT_CTX_free(mont); + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + return ret; +} + +int BN_is_prime_ex(const BIGNUM *candidate, int checks, BN_CTX *ctx, + BN_GENCB *cb) { + return BN_is_prime_fasttest_ex(candidate, checks, ctx, 0, cb); +} + +int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx, + int do_trial_division, BN_GENCB *cb) { + int is_probably_prime; + if (!BN_primality_test(&is_probably_prime, a, checks, ctx, do_trial_division, + cb)) { + return -1; + } + return is_probably_prime; +} + +int BN_enhanced_miller_rabin_primality_test( + enum bn_primality_result_t *out_result, const BIGNUM *w, int checks, + BN_CTX *ctx, BN_GENCB *cb) { + // Enhanced Miller-Rabin is only valid on odd integers greater than 3. + if (!BN_is_odd(w) || BN_cmp_word(w, 3) <= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INVALID_INPUT); + return 0; + } + + if (checks == BN_prime_checks_for_generation) { + checks = BN_prime_checks_for_size(BN_num_bits(w)); + } + + int ret = 0; + BN_MONT_CTX *mont = NULL; + + BN_CTX_start(ctx); + + BIGNUM *w1 = BN_CTX_get(ctx); + if (w1 == NULL || + !BN_copy(w1, w) || + !BN_sub_word(w1, 1)) { + goto err; + } + + // Write w1 as m*2^a (Steps 1 and 2). + int a = 0; + while (!BN_is_bit_set(w1, a)) { + a++; + } + BIGNUM *m = BN_CTX_get(ctx); + if (m == NULL || + !BN_rshift(m, w1, a)) { + goto err; + } + + BIGNUM *b = BN_CTX_get(ctx); + BIGNUM *g = BN_CTX_get(ctx); + BIGNUM *z = BN_CTX_get(ctx); + BIGNUM *x = BN_CTX_get(ctx); + BIGNUM *x1 = BN_CTX_get(ctx); + if (b == NULL || + g == NULL || + z == NULL || + x == NULL || + x1 == NULL) { + goto err; + } + + // Montgomery setup for computations mod w + mont = BN_MONT_CTX_new_for_modulus(w, ctx); + if (mont == NULL) { + goto err; + } + + // The following loop performs in inner iteration of the Enhanced Miller-Rabin + // Primality test (Step 4). + for (int i = 1; i <= checks; i++) { + // Step 4.1-4.2 + if (!BN_rand_range_ex(b, 2, w1)) { + goto err; + } + + // Step 4.3-4.4 + if (!BN_gcd(g, b, w, ctx)) { + goto err; + } + if (BN_cmp_word(g, 1) > 0) { + *out_result = bn_composite; + ret = 1; + goto err; + } + + // Step 4.5 + if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) { + goto err; + } + + // Step 4.6 + if (BN_is_one(z) || BN_cmp(z, w1) == 0) { + goto loop; + } + + // Step 4.7 + for (int j = 1; j < a; j++) { + if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { + goto err; + } + if (BN_cmp(z, w1) == 0) { + goto loop; + } + if (BN_is_one(z)) { + goto composite; + } + } + + // Step 4.8-4.9 + if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { + goto err; + } + + // Step 4.10-4.11 + if (!BN_is_one(z) && !BN_copy(x, z)) { + goto err; + } + + composite: + // Step 4.12-4.14 + if (!BN_copy(x1, x) || + !BN_sub_word(x1, 1) || + !BN_gcd(g, x1, w, ctx)) { + goto err; + } + if (BN_cmp_word(g, 1) > 0) { + *out_result = bn_composite; + } else { + *out_result = bn_non_prime_power_composite; + } + + ret = 1; + goto err; + + loop: + // Step 4.15 + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, i - 1)) { + goto err; + } + } + + *out_result = bn_probably_prime; + ret = 1; + +err: + BN_MONT_CTX_free(mont); + BN_CTX_end(ctx); + + return ret; +} + +static int probable_prime(BIGNUM *rnd, int bits) { + do { + if (!BN_rand(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD)) { + return 0; + } + } while (bn_odd_number_is_obviously_composite(rnd)); + return 1; +} + +static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, + const BIGNUM *rem, BN_CTX *ctx) { + int ret = 0; + BIGNUM *t1; + + BN_CTX_start(ctx); + if ((t1 = BN_CTX_get(ctx)) == NULL) { + goto err; + } + + if (!BN_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { + goto err; + } + + // we need ((rnd-rem) % add) == 0 + + if (!BN_mod(t1, rnd, add, ctx)) { + goto err; + } + if (!BN_sub(rnd, rnd, t1)) { + goto err; + } + if (rem == NULL) { + if (!BN_add_word(rnd, 1)) { + goto err; + } + } else { + if (!BN_add(rnd, rnd, rem)) { + goto err; + } + } + // we now have a random number 'rand' to test. + + const size_t num_primes = num_trial_division_primes(rnd); +loop: + for (size_t i = 1; i < num_primes; i++) { + // check that rnd is a prime + if (bn_mod_u16_consttime(rnd, kPrimes[i]) <= 1) { + if (!BN_add(rnd, rnd, add)) { + goto err; + } + goto loop; + } + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd, + const BIGNUM *rem, BN_CTX *ctx) { + int ret = 0; + BIGNUM *t1, *qadd, *q; + + bits--; + BN_CTX_start(ctx); + t1 = BN_CTX_get(ctx); + q = BN_CTX_get(ctx); + qadd = BN_CTX_get(ctx); + if (qadd == NULL) { + goto err; + } + + if (!BN_rshift1(qadd, padd)) { + goto err; + } + + if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { + goto err; + } + + // we need ((rnd-rem) % add) == 0 + if (!BN_mod(t1, q, qadd, ctx)) { + goto err; + } + + if (!BN_sub(q, q, t1)) { + goto err; + } + + if (rem == NULL) { + if (!BN_add_word(q, 1)) { + goto err; + } + } else { + if (!BN_rshift1(t1, rem)) { + goto err; + } + if (!BN_add(q, q, t1)) { + goto err; + } + } + + // we now have a random number 'rand' to test. + if (!BN_lshift1(p, q)) { + goto err; + } + if (!BN_add_word(p, 1)) { + goto err; + } + + const size_t num_primes = num_trial_division_primes(p); +loop: + for (size_t i = 1; i < num_primes; i++) { + // check that p and q are prime + // check that for p and q + // gcd(p-1,primes) == 1 (except for 2) + if (bn_mod_u16_consttime(p, kPrimes[i]) == 0 || + bn_mod_u16_consttime(q, kPrimes[i]) == 0) { + if (!BN_add(p, p, padd)) { + goto err; + } + if (!BN_add(q, q, qadd)) { + goto err; + } + goto loop; + } + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c.grpc_back new file mode 100644 index 000000000..262822f38 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/prime.c.grpc_back @@ -0,0 +1,1068 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// The quick sieve algorithm approach to weeding out primes is Philip +// Zimmermann's, as implemented in PGP. I have had a read of his comments and +// implemented my own version. + +// kPrimes contains the first 1024 primes. +static const uint16_t kPrimes[] = { + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, + 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, + 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, + 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, + 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, + 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, + 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, + 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, + 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, + 599, 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, + 661, 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, 743, + 751, 757, 761, 769, 773, 787, 797, 809, 811, 821, 823, 827, + 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, 907, 911, + 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, + 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, + 1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, + 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, + 1259, 1277, 1279, 1283, 1289, 1291, 1297, 1301, 1303, 1307, 1319, 1321, + 1327, 1361, 1367, 1373, 1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, + 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511, + 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, 1601, + 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, + 1697, 1699, 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, + 1787, 1789, 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, + 1879, 1889, 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, + 1993, 1997, 1999, 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, + 2081, 2083, 2087, 2089, 2099, 2111, 2113, 2129, 2131, 2137, 2141, 2143, + 2153, 2161, 2179, 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, + 2269, 2273, 2281, 2287, 2293, 2297, 2309, 2311, 2333, 2339, 2341, 2347, + 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, 2411, 2417, 2423, + 2437, 2441, 2447, 2459, 2467, 2473, 2477, 2503, 2521, 2531, 2539, 2543, + 2549, 2551, 2557, 2579, 2591, 2593, 2609, 2617, 2621, 2633, 2647, 2657, + 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, 2707, 2711, 2713, + 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, 2801, + 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, 2903, + 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999, 3001, 3011, + 3019, 3023, 3037, 3041, 3049, 3061, 3067, 3079, 3083, 3089, 3109, 3119, + 3121, 3137, 3163, 3167, 3169, 3181, 3187, 3191, 3203, 3209, 3217, 3221, + 3229, 3251, 3253, 3257, 3259, 3271, 3299, 3301, 3307, 3313, 3319, 3323, + 3329, 3331, 3343, 3347, 3359, 3361, 3371, 3373, 3389, 3391, 3407, 3413, + 3433, 3449, 3457, 3461, 3463, 3467, 3469, 3491, 3499, 3511, 3517, 3527, + 3529, 3533, 3539, 3541, 3547, 3557, 3559, 3571, 3581, 3583, 3593, 3607, + 3613, 3617, 3623, 3631, 3637, 3643, 3659, 3671, 3673, 3677, 3691, 3697, + 3701, 3709, 3719, 3727, 3733, 3739, 3761, 3767, 3769, 3779, 3793, 3797, + 3803, 3821, 3823, 3833, 3847, 3851, 3853, 3863, 3877, 3881, 3889, 3907, + 3911, 3917, 3919, 3923, 3929, 3931, 3943, 3947, 3967, 3989, 4001, 4003, + 4007, 4013, 4019, 4021, 4027, 4049, 4051, 4057, 4073, 4079, 4091, 4093, + 4099, 4111, 4127, 4129, 4133, 4139, 4153, 4157, 4159, 4177, 4201, 4211, + 4217, 4219, 4229, 4231, 4241, 4243, 4253, 4259, 4261, 4271, 4273, 4283, + 4289, 4297, 4327, 4337, 4339, 4349, 4357, 4363, 4373, 4391, 4397, 4409, + 4421, 4423, 4441, 4447, 4451, 4457, 4463, 4481, 4483, 4493, 4507, 4513, + 4517, 4519, 4523, 4547, 4549, 4561, 4567, 4583, 4591, 4597, 4603, 4621, + 4637, 4639, 4643, 4649, 4651, 4657, 4663, 4673, 4679, 4691, 4703, 4721, + 4723, 4729, 4733, 4751, 4759, 4783, 4787, 4789, 4793, 4799, 4801, 4813, + 4817, 4831, 4861, 4871, 4877, 4889, 4903, 4909, 4919, 4931, 4933, 4937, + 4943, 4951, 4957, 4967, 4969, 4973, 4987, 4993, 4999, 5003, 5009, 5011, + 5021, 5023, 5039, 5051, 5059, 5077, 5081, 5087, 5099, 5101, 5107, 5113, + 5119, 5147, 5153, 5167, 5171, 5179, 5189, 5197, 5209, 5227, 5231, 5233, + 5237, 5261, 5273, 5279, 5281, 5297, 5303, 5309, 5323, 5333, 5347, 5351, + 5381, 5387, 5393, 5399, 5407, 5413, 5417, 5419, 5431, 5437, 5441, 5443, + 5449, 5471, 5477, 5479, 5483, 5501, 5503, 5507, 5519, 5521, 5527, 5531, + 5557, 5563, 5569, 5573, 5581, 5591, 5623, 5639, 5641, 5647, 5651, 5653, + 5657, 5659, 5669, 5683, 5689, 5693, 5701, 5711, 5717, 5737, 5741, 5743, + 5749, 5779, 5783, 5791, 5801, 5807, 5813, 5821, 5827, 5839, 5843, 5849, + 5851, 5857, 5861, 5867, 5869, 5879, 5881, 5897, 5903, 5923, 5927, 5939, + 5953, 5981, 5987, 6007, 6011, 6029, 6037, 6043, 6047, 6053, 6067, 6073, + 6079, 6089, 6091, 6101, 6113, 6121, 6131, 6133, 6143, 6151, 6163, 6173, + 6197, 6199, 6203, 6211, 6217, 6221, 6229, 6247, 6257, 6263, 6269, 6271, + 6277, 6287, 6299, 6301, 6311, 6317, 6323, 6329, 6337, 6343, 6353, 6359, + 6361, 6367, 6373, 6379, 6389, 6397, 6421, 6427, 6449, 6451, 6469, 6473, + 6481, 6491, 6521, 6529, 6547, 6551, 6553, 6563, 6569, 6571, 6577, 6581, + 6599, 6607, 6619, 6637, 6653, 6659, 6661, 6673, 6679, 6689, 6691, 6701, + 6703, 6709, 6719, 6733, 6737, 6761, 6763, 6779, 6781, 6791, 6793, 6803, + 6823, 6827, 6829, 6833, 6841, 6857, 6863, 6869, 6871, 6883, 6899, 6907, + 6911, 6917, 6947, 6949, 6959, 6961, 6967, 6971, 6977, 6983, 6991, 6997, + 7001, 7013, 7019, 7027, 7039, 7043, 7057, 7069, 7079, 7103, 7109, 7121, + 7127, 7129, 7151, 7159, 7177, 7187, 7193, 7207, 7211, 7213, 7219, 7229, + 7237, 7243, 7247, 7253, 7283, 7297, 7307, 7309, 7321, 7331, 7333, 7349, + 7351, 7369, 7393, 7411, 7417, 7433, 7451, 7457, 7459, 7477, 7481, 7487, + 7489, 7499, 7507, 7517, 7523, 7529, 7537, 7541, 7547, 7549, 7559, 7561, + 7573, 7577, 7583, 7589, 7591, 7603, 7607, 7621, 7639, 7643, 7649, 7669, + 7673, 7681, 7687, 7691, 7699, 7703, 7717, 7723, 7727, 7741, 7753, 7757, + 7759, 7789, 7793, 7817, 7823, 7829, 7841, 7853, 7867, 7873, 7877, 7879, + 7883, 7901, 7907, 7919, 7927, 7933, 7937, 7949, 7951, 7963, 7993, 8009, + 8011, 8017, 8039, 8053, 8059, 8069, 8081, 8087, 8089, 8093, 8101, 8111, + 8117, 8123, 8147, 8161, +}; + +// BN_prime_checks_for_size returns the number of Miller-Rabin iterations +// necessary for generating a 'bits'-bit candidate prime. +// +// +// This table is generated using the algorithm of FIPS PUB 186-4 +// Digital Signature Standard (DSS), section F.1, page 117. +// (https://doi.org/10.6028/NIST.FIPS.186-4) +// The following magma script was used to generate the output: +// securitybits:=125; +// k:=1024; +// for t:=1 to 65 do +// for M:=3 to Floor(2*Sqrt(k-1)-1) do +// S:=0; +// // Sum over m +// for m:=3 to M do +// s:=0; +// // Sum over j +// for j:=2 to m do +// s+:=(RealField(32)!2)^-(j+(k-1)/j); +// end for; +// S+:=2^(m-(m-1)*t)*s; +// end for; +// A:=2^(k-2-M*t); +// B:=8*(Pi(RealField(32))^2-6)/3*2^(k-2)*S; +// pkt:=2.00743*Log(2)*k*2^-k*(A+B); +// seclevel:=Floor(-Log(2,pkt)); +// if seclevel ge securitybits then +// printf "k: %5o, security: %o bits (t: %o, M: %o)\n",k,seclevel,t,M; +// break; +// end if; +// end for; +// if seclevel ge securitybits then break; end if; +// end for; +// +// It can be run online at: http://magma.maths.usyd.edu.au/calc +// And will output: +// k: 1024, security: 129 bits (t: 6, M: 23) +// k is the number of bits of the prime, securitybits is the level we want to +// reach. +// prime length | RSA key size | # MR tests | security level +// -------------+--------------|------------+--------------- +// (b) >= 6394 | >= 12788 | 3 | 256 bit +// (b) >= 3747 | >= 7494 | 3 | 192 bit +// (b) >= 1345 | >= 2690 | 4 | 128 bit +// (b) >= 1080 | >= 2160 | 5 | 128 bit +// (b) >= 852 | >= 1704 | 5 | 112 bit +// (b) >= 476 | >= 952 | 5 | 80 bit +// (b) >= 400 | >= 800 | 6 | 80 bit +// (b) >= 347 | >= 694 | 7 | 80 bit +// (b) >= 308 | >= 616 | 8 | 80 bit +// (b) >= 55 | >= 110 | 27 | 64 bit +// (b) >= 6 | >= 12 | 34 | 64 bit +static int BN_prime_checks_for_size(int bits) { + if (bits >= 3747) { + return 3; + } + if (bits >= 1345) { + return 4; + } + if (bits >= 476) { + return 5; + } + if (bits >= 400) { + return 6; + } + if (bits >= 347) { + return 7; + } + if (bits >= 308) { + return 8; + } + if (bits >= 55) { + return 27; + } + return 34; +} + +// num_trial_division_primes returns the number of primes to try with trial +// division before using more expensive checks. For larger numbers, the value +// of excluding a candidate with trial division is larger. +static size_t num_trial_division_primes(const BIGNUM *n) { + if (n->width * BN_BITS2 > 1024) { + return OPENSSL_ARRAY_SIZE(kPrimes); + } + return OPENSSL_ARRAY_SIZE(kPrimes) / 2; +} + +// BN_PRIME_CHECKS_BLINDED is the iteration count for blinding the constant-time +// primality test. See |BN_primality_test| for details. This number is selected +// so that, for a candidate N-bit RSA prime, picking |BN_PRIME_CHECKS_BLINDED| +// random N-bit numbers will have at least |BN_prime_checks_for_size(N)| values +// in range with high probability. +// +// The following Python script computes the blinding factor needed for the +// corresponding iteration count. +/* +import math + +# We choose candidate RSA primes between sqrt(2)/2 * 2^N and 2^N and select +# witnesses by generating random N-bit numbers. Thus the probability of +# selecting one in range is at least sqrt(2)/2. +p = math.sqrt(2) / 2 + +# Target around 2^-8 probability of the blinding being insufficient given that +# key generation is a one-time, noisy operation. +epsilon = 2**-8 + +def choose(a, b): + r = 1 + for i in xrange(b): + r *= a - i + r /= (i + 1) + return r + +def failure_rate(min_uniform, iterations): + """ Returns the probability that, for |iterations| candidate witnesses, fewer + than |min_uniform| of them will be uniform. """ + prob = 0.0 + for i in xrange(min_uniform): + prob += (choose(iterations, i) * + p**i * (1-p)**(iterations - i)) + return prob + +for min_uniform in (3, 4, 5, 6, 8, 13, 19, 28): + # Find the smallest number of iterations under the target failure rate. + iterations = min_uniform + while True: + prob = failure_rate(min_uniform, iterations) + if prob < epsilon: + print min_uniform, iterations, prob + break + iterations += 1 + +Output: + 3 9 0.00368894873911 + 4 11 0.00363319494662 + 5 13 0.00336215573898 + 6 15 0.00300145783158 + 8 19 0.00225214119331 + 13 27 0.00385610026955 + 19 38 0.0021410539126 + 28 52 0.00325405801769 + +16 iterations suffices for 400-bit primes and larger (6 uniform samples needed), +which is already well below the minimum acceptable key size for RSA. +*/ +#define BN_PRIME_CHECKS_BLINDED 16 + +static int probable_prime(BIGNUM *rnd, int bits); +static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, + const BIGNUM *rem, BN_CTX *ctx); +static int probable_prime_dh_safe(BIGNUM *rnd, int bits, const BIGNUM *add, + const BIGNUM *rem, BN_CTX *ctx); + +void BN_GENCB_set(BN_GENCB *callback, + int (*f)(int event, int n, struct bn_gencb_st *), + void *arg) { + callback->callback = f; + callback->arg = arg; +} + +int BN_GENCB_call(BN_GENCB *callback, int event, int n) { + if (!callback) { + return 1; + } + + return callback->callback(event, n, callback); +} + +int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, + const BIGNUM *rem, BN_GENCB *cb) { + BIGNUM *t; + int found = 0; + int i, j, c1 = 0; + BN_CTX *ctx; + int checks = BN_prime_checks_for_size(bits); + + if (bits < 2) { + // There are no prime numbers this small. + OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); + return 0; + } else if (bits == 2 && safe) { + // The smallest safe prime (7) is three bits. + OPENSSL_PUT_ERROR(BN, BN_R_BITS_TOO_SMALL); + return 0; + } + + ctx = BN_CTX_new(); + if (ctx == NULL) { + goto err; + } + BN_CTX_start(ctx); + t = BN_CTX_get(ctx); + if (!t) { + goto err; + } + +loop: + // make a random number and set the top and bottom bits + if (add == NULL) { + if (!probable_prime(ret, bits)) { + goto err; + } + } else { + if (safe) { + if (!probable_prime_dh_safe(ret, bits, add, rem, ctx)) { + goto err; + } + } else { + if (!probable_prime_dh(ret, bits, add, rem, ctx)) { + goto err; + } + } + } + + if (!BN_GENCB_call(cb, BN_GENCB_GENERATED, c1++)) { + // aborted + goto err; + } + + if (!safe) { + i = BN_is_prime_fasttest_ex(ret, checks, ctx, 0, cb); + if (i == -1) { + goto err; + } else if (i == 0) { + goto loop; + } + } else { + // for "safe prime" generation, check that (p-1)/2 is prime. Since a prime + // is odd, We just need to divide by 2 + if (!BN_rshift1(t, ret)) { + goto err; + } + + // Interleave |ret| and |t|'s primality tests to avoid paying the full + // iteration count on |ret| only to quickly discover |t| is composite. + // + // TODO(davidben): This doesn't quite work because an iteration count of 1 + // still runs the blinding mechanism. + for (i = 0; i < checks; i++) { + j = BN_is_prime_fasttest_ex(ret, 1, ctx, 0, NULL); + if (j == -1) { + goto err; + } else if (j == 0) { + goto loop; + } + + j = BN_is_prime_fasttest_ex(t, 1, ctx, 0, NULL); + if (j == -1) { + goto err; + } else if (j == 0) { + goto loop; + } + + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, i)) { + goto err; + } + // We have a safe prime test pass + } + } + + // we have a prime :-) + found = 1; + +err: + if (ctx != NULL) { + BN_CTX_end(ctx); + BN_CTX_free(ctx); + } + + return found; +} + +static int bn_trial_division(uint16_t *out, const BIGNUM *bn) { + const size_t num_primes = num_trial_division_primes(bn); + for (size_t i = 1; i < num_primes; i++) { + if (bn_mod_u16_consttime(bn, kPrimes[i]) == 0) { + *out = kPrimes[i]; + return 1; + } + } + return 0; +} + +int bn_odd_number_is_obviously_composite(const BIGNUM *bn) { + uint16_t prime; + return bn_trial_division(&prime, bn) && !BN_is_word(bn, prime); +} + +int bn_miller_rabin_init(BN_MILLER_RABIN *miller_rabin, const BN_MONT_CTX *mont, + BN_CTX *ctx) { + // This function corresponds to steps 1 through 3 of FIPS 186-4, C.3.1. + const BIGNUM *w = &mont->N; + // Note we do not call |BN_CTX_start| in this function. We intentionally + // allocate values in the containing scope so they outlive this function. + miller_rabin->w1 = BN_CTX_get(ctx); + miller_rabin->m = BN_CTX_get(ctx); + miller_rabin->one_mont = BN_CTX_get(ctx); + miller_rabin->w1_mont = BN_CTX_get(ctx); + if (miller_rabin->w1 == NULL || + miller_rabin->m == NULL || + miller_rabin->one_mont == NULL || + miller_rabin->w1_mont == NULL) { + return 0; + } + + // See FIPS 186-4, C.3.1, steps 1 through 3. + if (!bn_usub_consttime(miller_rabin->w1, w, BN_value_one())) { + return 0; + } + miller_rabin->a = BN_count_low_zero_bits(miller_rabin->w1); + if (!bn_rshift_secret_shift(miller_rabin->m, miller_rabin->w1, + miller_rabin->a, ctx)) { + return 0; + } + miller_rabin->w_bits = BN_num_bits(w); + + // Precompute some values in Montgomery form. + if (!bn_one_to_montgomery(miller_rabin->one_mont, mont, ctx) || + // w - 1 is -1 mod w, so we can compute it in the Montgomery domain, -R, + // with a subtraction. (|one_mont| cannot be zero.) + !bn_usub_consttime(miller_rabin->w1_mont, w, miller_rabin->one_mont)) { + return 0; + } + + return 1; +} + +int bn_miller_rabin_iteration(const BN_MILLER_RABIN *miller_rabin, + int *out_is_possibly_prime, const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx) { + // This function corresponds to steps 4.3 through 4.5 of FIPS 186-4, C.3.1. + int ret = 0; + BN_CTX_start(ctx); + + // Step 4.3. We use Montgomery-encoding for better performance and to avoid + // timing leaks. + const BIGNUM *w = &mont->N; + BIGNUM *z = BN_CTX_get(ctx); + if (z == NULL || + !BN_mod_exp_mont_consttime(z, b, miller_rabin->m, w, ctx, mont) || + !BN_to_montgomery(z, z, mont, ctx)) { + goto err; + } + + // is_possibly_prime is all ones if we have determined |b| is not a composite + // witness for |w|. This is equivalent to going to step 4.7 in the original + // algorithm. To avoid timing leaks, we run the algorithm to the end for prime + // inputs. + crypto_word_t is_possibly_prime = 0; + + // Step 4.4. If z = 1 or z = w-1, b is not a composite witness and w is still + // possibly prime. + is_possibly_prime = BN_equal_consttime(z, miller_rabin->one_mont) | + BN_equal_consttime(z, miller_rabin->w1_mont); + is_possibly_prime = 0 - is_possibly_prime; // Make it all zeros or all ones. + + // Step 4.5. + // + // To avoid leaking |a|, we run the loop to |w_bits| and mask off all + // iterations once |j| = |a|. + for (int j = 1; j < miller_rabin->w_bits; j++) { + if (constant_time_eq_int(j, miller_rabin->a) & ~is_possibly_prime) { + // If the loop is done and we haven't seen z = 1 or z = w-1 yet, the + // value is composite and we can break in variable time. + break; + } + + // Step 4.5.1. + if (!BN_mod_mul_montgomery(z, z, z, mont, ctx)) { + goto err; + } + + // Step 4.5.2. If z = w-1 and the loop is not done, this is not a composite + // witness. + crypto_word_t z_is_w1_mont = BN_equal_consttime(z, miller_rabin->w1_mont); + z_is_w1_mont = 0 - z_is_w1_mont; // Make it all zeros or all ones. + is_possibly_prime |= z_is_w1_mont; // Go to step 4.7 if |z_is_w1_mont|. + + // Step 4.5.3. If z = 1 and the loop is not done, the previous value of z + // was not -1. There are no non-trivial square roots of 1 modulo a prime, so + // w is composite and we may exit in variable time. + if (BN_equal_consttime(z, miller_rabin->one_mont) & ~is_possibly_prime) { + break; + } + } + + *out_is_possibly_prime = is_possibly_prime & 1; + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +int BN_primality_test(int *out_is_probably_prime, const BIGNUM *w, int checks, + BN_CTX *ctx, int do_trial_division, BN_GENCB *cb) { + // This function's secrecy and performance requirements come from RSA key + // generation. We generate RSA keys by selecting two large, secret primes with + // rejection sampling. + // + // We thus treat |w| as secret if turns out to be a large prime. However, if + // |w| is composite, we treat this and |w| itself as public. (Conversely, if + // |w| is prime, that it is prime is public. Only the value is secret.) This + // is fine for RSA key generation, but note it is important that we use + // rejection sampling, with each candidate prime chosen independently. This + // would not work for, e.g., an algorithm which looked for primes in + // consecutive integers. These assumptions allow us to discard composites + // quickly. We additionally treat |w| as public when it is a small prime to + // simplify trial decryption and some edge cases. + // + // One RSA key generation will call this function on exactly two primes and + // many more composites. The overall cost is a combination of several factors: + // + // 1. Checking if |w| is divisible by a small prime is much faster than + // learning it is composite by Miller-Rabin (see below for details on that + // cost). Trial division by p saves 1/p of Miller-Rabin calls, so this is + // worthwhile until p exceeds the ratio of the two costs. + // + // 2. For a random (i.e. non-adversarial) candidate large prime and candidate + // witness, the probability of false witness is very low. (This is why FIPS + // 186-4 only requires a few iterations.) Thus composites not discarded by + // trial decryption, in practice, cost one Miller-Rabin iteration. Only the + // two actual primes cost the full iteration count. + // + // 3. A Miller-Rabin iteration is a modular exponentiation plus |a| additional + // modular squares, where |a| is the number of factors of two in |w-1|. |a| + // is likely small (the distribution falls exponentially), but it is also + // potentially secret, so we loop up to its log(w) upper bound when |w| is + // prime. When |w| is composite, we break early, so only two calls pay this + // cost. (Note that all calls pay the modular exponentiation which is, + // itself, log(w) modular multiplications and squares.) + // + // 4. While there are only two prime calls, they multiplicatively pay the full + // costs of (2) and (3). + // + // 5. After the primes are chosen, RSA keys derive some values from the + // primes, but this cost is negligible in comparison. + + *out_is_probably_prime = 0; + + if (BN_cmp(w, BN_value_one()) <= 0) { + return 1; + } + + if (!BN_is_odd(w)) { + // The only even prime is two. + *out_is_probably_prime = BN_is_word(w, 2); + return 1; + } + + // Miller-Rabin does not work for three. + if (BN_is_word(w, 3)) { + *out_is_probably_prime = 1; + return 1; + } + + if (do_trial_division) { + // Perform additional trial division checks to discard small primes. + uint16_t prime; + if (bn_trial_division(&prime, w)) { + *out_is_probably_prime = BN_is_word(w, prime); + return 1; + } + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, -1)) { + return 0; + } + } + + if (checks == BN_prime_checks_for_generation) { + checks = BN_prime_checks_for_size(BN_num_bits(w)); + } + + BN_CTX *new_ctx = NULL; + if (ctx == NULL) { + new_ctx = BN_CTX_new(); + if (new_ctx == NULL) { + return 0; + } + ctx = new_ctx; + } + + // See C.3.1 from FIPS 186-4. + int ret = 0; + BN_CTX_start(ctx); + BIGNUM *b = BN_CTX_get(ctx); + BN_MONT_CTX *mont = BN_MONT_CTX_new_consttime(w, ctx); + BN_MILLER_RABIN miller_rabin; + if (b == NULL || mont == NULL || + // Steps 1-3. + !bn_miller_rabin_init(&miller_rabin, mont, ctx)) { + goto err; + } + + // The following loop performs in inner iteration of the Miller-Rabin + // Primality test (Step 4). + // + // The algorithm as specified in FIPS 186-4 leaks information on |w|, the RSA + // private key. Instead, we run through each iteration unconditionally, + // performing modular multiplications, masking off any effects to behave + // equivalently to the specified algorithm. + // + // We also blind the number of values of |b| we try. Steps 4.1–4.2 say to + // discard out-of-range values. To avoid leaking information on |w|, we use + // |bn_rand_secret_range| which, rather than discarding bad values, adjusts + // them to be in range. Though not uniformly selected, these adjusted values + // are still usable as Miller-Rabin checks. + // + // Miller-Rabin is already probabilistic, so we could reach the desired + // confidence levels by just suitably increasing the iteration count. However, + // to align with FIPS 186-4, we use a more pessimal analysis: we do not count + // the non-uniform values towards the iteration count. As a result, this + // function is more complex and has more timing risk than necessary. + // + // We count both total iterations and uniform ones and iterate until we've + // reached at least |BN_PRIME_CHECKS_BLINDED| and |iterations|, respectively. + // If the latter is large enough, it will be the limiting factor with high + // probability and we won't leak information. + // + // Note this blinding does not impact most calls when picking primes because + // composites are rejected early. Only the two secret primes see extra work. + + crypto_word_t uniform_iterations = 0; + // Using |constant_time_lt_w| seems to prevent the compiler from optimizing + // this into two jumps. + for (int i = 1; (i <= BN_PRIME_CHECKS_BLINDED) | + constant_time_lt_w(uniform_iterations, checks); + i++) { + // Step 4.1-4.2 + int is_uniform; + if (!bn_rand_secret_range(b, &is_uniform, 2, miller_rabin.w1)) { + goto err; + } + uniform_iterations += is_uniform; + + // Steps 4.3-4.5 + int is_possibly_prime = 0; + if (!bn_miller_rabin_iteration(&miller_rabin, &is_possibly_prime, b, mont, + ctx)) { + goto err; + } + + if (!is_possibly_prime) { + // Step 4.6. We did not see z = w-1 before z = 1, so w must be composite. + *out_is_probably_prime = 0; + ret = 1; + goto err; + } + + // Step 4.7 + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, i - 1)) { + goto err; + } + } + + assert(uniform_iterations >= (crypto_word_t)checks); + *out_is_probably_prime = 1; + ret = 1; + +err: + BN_MONT_CTX_free(mont); + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + return ret; +} + +int BN_is_prime_ex(const BIGNUM *candidate, int checks, BN_CTX *ctx, + BN_GENCB *cb) { + return BN_is_prime_fasttest_ex(candidate, checks, ctx, 0, cb); +} + +int BN_is_prime_fasttest_ex(const BIGNUM *a, int checks, BN_CTX *ctx, + int do_trial_division, BN_GENCB *cb) { + int is_probably_prime; + if (!BN_primality_test(&is_probably_prime, a, checks, ctx, do_trial_division, + cb)) { + return -1; + } + return is_probably_prime; +} + +int BN_enhanced_miller_rabin_primality_test( + enum bn_primality_result_t *out_result, const BIGNUM *w, int checks, + BN_CTX *ctx, BN_GENCB *cb) { + // Enhanced Miller-Rabin is only valid on odd integers greater than 3. + if (!BN_is_odd(w) || BN_cmp_word(w, 3) <= 0) { + OPENSSL_PUT_ERROR(BN, BN_R_INVALID_INPUT); + return 0; + } + + if (checks == BN_prime_checks_for_generation) { + checks = BN_prime_checks_for_size(BN_num_bits(w)); + } + + int ret = 0; + BN_MONT_CTX *mont = NULL; + + BN_CTX_start(ctx); + + BIGNUM *w1 = BN_CTX_get(ctx); + if (w1 == NULL || + !BN_copy(w1, w) || + !BN_sub_word(w1, 1)) { + goto err; + } + + // Write w1 as m*2^a (Steps 1 and 2). + int a = 0; + while (!BN_is_bit_set(w1, a)) { + a++; + } + BIGNUM *m = BN_CTX_get(ctx); + if (m == NULL || + !BN_rshift(m, w1, a)) { + goto err; + } + + BIGNUM *b = BN_CTX_get(ctx); + BIGNUM *g = BN_CTX_get(ctx); + BIGNUM *z = BN_CTX_get(ctx); + BIGNUM *x = BN_CTX_get(ctx); + BIGNUM *x1 = BN_CTX_get(ctx); + if (b == NULL || + g == NULL || + z == NULL || + x == NULL || + x1 == NULL) { + goto err; + } + + // Montgomery setup for computations mod w + mont = BN_MONT_CTX_new_for_modulus(w, ctx); + if (mont == NULL) { + goto err; + } + + // The following loop performs in inner iteration of the Enhanced Miller-Rabin + // Primality test (Step 4). + for (int i = 1; i <= checks; i++) { + // Step 4.1-4.2 + if (!BN_rand_range_ex(b, 2, w1)) { + goto err; + } + + // Step 4.3-4.4 + if (!BN_gcd(g, b, w, ctx)) { + goto err; + } + if (BN_cmp_word(g, 1) > 0) { + *out_result = bn_composite; + ret = 1; + goto err; + } + + // Step 4.5 + if (!BN_mod_exp_mont(z, b, m, w, ctx, mont)) { + goto err; + } + + // Step 4.6 + if (BN_is_one(z) || BN_cmp(z, w1) == 0) { + goto loop; + } + + // Step 4.7 + for (int j = 1; j < a; j++) { + if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { + goto err; + } + if (BN_cmp(z, w1) == 0) { + goto loop; + } + if (BN_is_one(z)) { + goto composite; + } + } + + // Step 4.8-4.9 + if (!BN_copy(x, z) || !BN_mod_mul(z, x, x, w, ctx)) { + goto err; + } + + // Step 4.10-4.11 + if (!BN_is_one(z) && !BN_copy(x, z)) { + goto err; + } + + composite: + // Step 4.12-4.14 + if (!BN_copy(x1, x) || + !BN_sub_word(x1, 1) || + !BN_gcd(g, x1, w, ctx)) { + goto err; + } + if (BN_cmp_word(g, 1) > 0) { + *out_result = bn_composite; + } else { + *out_result = bn_non_prime_power_composite; + } + + ret = 1; + goto err; + + loop: + // Step 4.15 + if (!BN_GENCB_call(cb, BN_GENCB_PRIME_TEST, i - 1)) { + goto err; + } + } + + *out_result = bn_probably_prime; + ret = 1; + +err: + BN_MONT_CTX_free(mont); + BN_CTX_end(ctx); + + return ret; +} + +static int probable_prime(BIGNUM *rnd, int bits) { + do { + if (!BN_rand(rnd, bits, BN_RAND_TOP_TWO, BN_RAND_BOTTOM_ODD)) { + return 0; + } + } while (bn_odd_number_is_obviously_composite(rnd)); + return 1; +} + +static int probable_prime_dh(BIGNUM *rnd, int bits, const BIGNUM *add, + const BIGNUM *rem, BN_CTX *ctx) { + int ret = 0; + BIGNUM *t1; + + BN_CTX_start(ctx); + if ((t1 = BN_CTX_get(ctx)) == NULL) { + goto err; + } + + if (!BN_rand(rnd, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { + goto err; + } + + // we need ((rnd-rem) % add) == 0 + + if (!BN_mod(t1, rnd, add, ctx)) { + goto err; + } + if (!BN_sub(rnd, rnd, t1)) { + goto err; + } + if (rem == NULL) { + if (!BN_add_word(rnd, 1)) { + goto err; + } + } else { + if (!BN_add(rnd, rnd, rem)) { + goto err; + } + } + // we now have a random number 'rand' to test. + + const size_t num_primes = num_trial_division_primes(rnd); +loop: + for (size_t i = 1; i < num_primes; i++) { + // check that rnd is a prime + if (bn_mod_u16_consttime(rnd, kPrimes[i]) <= 1) { + if (!BN_add(rnd, rnd, add)) { + goto err; + } + goto loop; + } + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} + +static int probable_prime_dh_safe(BIGNUM *p, int bits, const BIGNUM *padd, + const BIGNUM *rem, BN_CTX *ctx) { + int ret = 0; + BIGNUM *t1, *qadd, *q; + + bits--; + BN_CTX_start(ctx); + t1 = BN_CTX_get(ctx); + q = BN_CTX_get(ctx); + qadd = BN_CTX_get(ctx); + if (qadd == NULL) { + goto err; + } + + if (!BN_rshift1(qadd, padd)) { + goto err; + } + + if (!BN_rand(q, bits, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD)) { + goto err; + } + + // we need ((rnd-rem) % add) == 0 + if (!BN_mod(t1, q, qadd, ctx)) { + goto err; + } + + if (!BN_sub(q, q, t1)) { + goto err; + } + + if (rem == NULL) { + if (!BN_add_word(q, 1)) { + goto err; + } + } else { + if (!BN_rshift1(t1, rem)) { + goto err; + } + if (!BN_add(q, q, t1)) { + goto err; + } + } + + // we now have a random number 'rand' to test. + if (!BN_lshift1(p, q)) { + goto err; + } + if (!BN_add_word(p, 1)) { + goto err; + } + + const size_t num_primes = num_trial_division_primes(p); +loop: + for (size_t i = 1; i < num_primes; i++) { + // check that p and q are prime + // check that for p and q + // gcd(p-1,primes) == 1 (except for 2) + if (bn_mod_u16_consttime(p, kPrimes[i]) == 0 || + bn_mod_u16_consttime(q, kPrimes[i]) == 0) { + if (!BN_add(p, p, padd)) { + goto err; + } + if (!BN_add(q, q, qadd)) { + goto err; + } + goto loop; + } + } + + ret = 1; + +err: + BN_CTX_end(ctx); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/random.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/random.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c index fb39e5352..cef812cf2 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/random.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c @@ -108,10 +108,10 @@ #include +#include #include #include -#include #include #include @@ -121,9 +121,6 @@ int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { - uint8_t *buf = NULL; - int ret = 0, bit, bytes, mask; - if (rnd == NULL) { return 0; } @@ -144,48 +141,41 @@ int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { return 1; } - bytes = (bits + 7) / 8; - bit = (bits - 1) % 8; - mask = 0xff << (bit + 1); - - buf = OPENSSL_malloc(bytes); - if (buf == NULL) { - OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); - goto err; + if (bits > INT_MAX - (BN_BITS2 - 1)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; } - // Make a random number and set the top and bottom bits. - RAND_bytes(buf, bytes); + int words = (bits + BN_BITS2 - 1) / BN_BITS2; + int bit = (bits - 1) % BN_BITS2; + const BN_ULONG kOne = 1; + const BN_ULONG kThree = 3; + BN_ULONG mask = bit < BN_BITS2 - 1 ? (kOne << (bit + 1)) - 1 : BN_MASK2; + if (!bn_wexpand(rnd, words)) { + return 0; + } + RAND_bytes((uint8_t *)rnd->d, words * sizeof(BN_ULONG)); + rnd->d[words - 1] &= mask; if (top != BN_RAND_TOP_ANY) { if (top == BN_RAND_TOP_TWO && bits > 1) { if (bit == 0) { - buf[0] = 1; - buf[1] |= 0x80; + rnd->d[words - 1] |= 1; + rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); } else { - buf[0] |= (3 << (bit - 1)); + rnd->d[words - 1] |= kThree << (bit - 1); } } else { - buf[0] |= (1 << bit); + rnd->d[words - 1] |= kOne << bit; } } - - buf[0] &= ~mask; - - // Set the bottom bit if requested, - if (bottom == BN_RAND_BOTTOM_ODD) { - buf[bytes - 1] |= 1; - } - - if (!BN_bin2bn(buf, bytes, rnd)) { - goto err; + if (bottom == BN_RAND_BOTTOM_ODD) { + rnd->d[0] |= 1; } - ret = 1; - -err: - OPENSSL_free(buf); - return ret; + rnd->neg = 0; + rnd->width = words; + return 1; } int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) { @@ -205,8 +195,8 @@ static crypto_word_t bn_less_than_word_mask(const BN_ULONG *a, size_t len, } // |a| < |b| iff a[1..len-1] are all zero and a[0] < b. - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); crypto_word_t mask = 0; for (size_t i = 1; i < len; i++) { mask |= a[i]; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/random.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/random.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c.grpc_back index 5922df416..f6812f126 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/random.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/random.c.grpc_back @@ -108,10 +108,10 @@ #include +#include #include #include -#include #include #include @@ -121,9 +121,6 @@ int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { - uint8_t *buf = NULL; - int ret = 0, bit, bytes, mask; - if (rnd == NULL) { return 0; } @@ -144,48 +141,41 @@ int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) { return 1; } - bytes = (bits + 7) / 8; - bit = (bits - 1) % 8; - mask = 0xff << (bit + 1); - - buf = OPENSSL_malloc(bytes); - if (buf == NULL) { - OPENSSL_PUT_ERROR(BN, ERR_R_MALLOC_FAILURE); - goto err; + if (bits > INT_MAX - (BN_BITS2 - 1)) { + OPENSSL_PUT_ERROR(BN, BN_R_BIGNUM_TOO_LONG); + return 0; } - // Make a random number and set the top and bottom bits. - RAND_bytes(buf, bytes); + int words = (bits + BN_BITS2 - 1) / BN_BITS2; + int bit = (bits - 1) % BN_BITS2; + const BN_ULONG kOne = 1; + const BN_ULONG kThree = 3; + BN_ULONG mask = bit < BN_BITS2 - 1 ? (kOne << (bit + 1)) - 1 : BN_MASK2; + if (!bn_wexpand(rnd, words)) { + return 0; + } + RAND_bytes((uint8_t *)rnd->d, words * sizeof(BN_ULONG)); + rnd->d[words - 1] &= mask; if (top != BN_RAND_TOP_ANY) { if (top == BN_RAND_TOP_TWO && bits > 1) { if (bit == 0) { - buf[0] = 1; - buf[1] |= 0x80; + rnd->d[words - 1] |= 1; + rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); } else { - buf[0] |= (3 << (bit - 1)); + rnd->d[words - 1] |= kThree << (bit - 1); } } else { - buf[0] |= (1 << bit); + rnd->d[words - 1] |= kOne << bit; } } - - buf[0] &= ~mask; - - // Set the bottom bit if requested, - if (bottom == BN_RAND_BOTTOM_ODD) { - buf[bytes - 1] |= 1; - } - - if (!BN_bin2bn(buf, bytes, rnd)) { - goto err; + if (bottom == BN_RAND_BOTTOM_ODD) { + rnd->d[0] |= 1; } - ret = 1; - -err: - OPENSSL_free(buf); - return ret; + rnd->neg = 0; + rnd->width = words; + return 1; } int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom) { @@ -205,8 +195,8 @@ static crypto_word_t bn_less_than_word_mask(const BN_ULONG *a, size_t len, } // |a| < |b| iff a[1..len-1] are all zero and a[0] < b. - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); crypto_word_t mask = 0; for (size_t i = 1; i < len; i++) { mask |= a[i]; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c similarity index 85% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c index bc90f0501..32a624d35 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c @@ -12,27 +12,16 @@ * (2) University of Haifa, Israel */ -#include - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) - #include "rsaz_exp.h" +#if defined(RSAZ_ENABLED) + #include +#include "internal.h" #include "../../internal.h" -// See crypto/bn/asm/rsaz-avx2.pl for further details. -void rsaz_1024_norm2red_avx2(void *red, const void *norm); -void rsaz_1024_mul_avx2(void *ret, const void *a, const void *b, const void *n, - BN_ULONG k); -void rsaz_1024_sqr_avx2(void *ret, const void *a, const void *n, BN_ULONG k, - int cnt); -void rsaz_1024_scatter5_avx2(void *tbl, const void *val, int i); -void rsaz_1024_gather5_avx2(void *val, const void *tbl, int i); -void rsaz_1024_red2norm_avx2(void *norm, const void *red); - // one is 1 in RSAZ's representation. alignas(64) static const BN_ULONG one[40] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -44,19 +33,25 @@ alignas(64) static const BN_ULONG two80[40] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void RSAZ_1024_mod_exp_avx2(BN_ULONG result_norm[16], - const BN_ULONG base_norm[16], const BN_ULONG exponent[16], - const BN_ULONG m_norm[16], const BN_ULONG RR[16], BN_ULONG k0) { - alignas(64) uint8_t storage[(320 * 3) + (32 * 9 * 16)]; // 5.5KB - unsigned char *a_inv, *m, *result, *table_s = storage + (320 * 3), - *R2 = table_s; // borrow + const BN_ULONG base_norm[16], + const BN_ULONG exponent[16], + const BN_ULONG m_norm[16], const BN_ULONG RR[16], + BN_ULONG k0, + BN_ULONG storage[MOD_EXP_CTIME_STORAGE_LEN]) { + OPENSSL_STATIC_ASSERT(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH % 64 == 0, + "MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH is too small"); + assert((uintptr_t)storage % 64 == 0); + + BN_ULONG *a_inv, *m, *result, *table_s = storage + 40 * 3, *R2 = table_s; + // Note |R2| aliases |table_s|. if (((((uintptr_t)storage & 4095) + 320) >> 12) != 0) { result = storage; - a_inv = storage + 320; - m = storage + (320 * 2); // should not cross page + a_inv = storage + 40; + m = storage + 40 * 2; // should not cross page } else { m = storage; // should not cross page - result = storage + 320; - a_inv = storage + (320 * 2); + result = storage + 40; + a_inv = storage + 40 * 2; } rsaz_1024_norm2red_avx2(m, m_norm); @@ -225,7 +220,7 @@ void RSAZ_1024_mod_exp_avx2(BN_ULONG result_norm[16], rsaz_1024_red2norm_avx2(result_norm, result); - OPENSSL_cleanse(storage, sizeof(storage)); + OPENSSL_cleanse(storage, MOD_EXP_CTIME_STORAGE_LEN * sizeof(BN_ULONG)); } -#endif // OPENSSL_X86_64 +#endif // RSAZ_ENABLED diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back similarity index 85% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back index 97c58bad6..7e15aaf94 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.c.grpc_back @@ -12,27 +12,16 @@ * (2) University of Haifa, Israel */ -#include - -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) - #include "rsaz_exp.h" +#if defined(RSAZ_ENABLED) + #include +#include "internal.h" #include "../../internal.h" -// See crypto/bn/asm/rsaz-avx2.pl for further details. -void rsaz_1024_norm2red_avx2(void *red, const void *norm); -void rsaz_1024_mul_avx2(void *ret, const void *a, const void *b, const void *n, - BN_ULONG k); -void rsaz_1024_sqr_avx2(void *ret, const void *a, const void *n, BN_ULONG k, - int cnt); -void rsaz_1024_scatter5_avx2(void *tbl, const void *val, int i); -void rsaz_1024_gather5_avx2(void *val, const void *tbl, int i); -void rsaz_1024_red2norm_avx2(void *norm, const void *red); - // one is 1 in RSAZ's representation. alignas(64) static const BN_ULONG one[40] = { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -44,19 +33,25 @@ alignas(64) static const BN_ULONG two80[40] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void RSAZ_1024_mod_exp_avx2(BN_ULONG result_norm[16], - const BN_ULONG base_norm[16], const BN_ULONG exponent[16], - const BN_ULONG m_norm[16], const BN_ULONG RR[16], BN_ULONG k0) { - alignas(64) uint8_t storage[(320 * 3) + (32 * 9 * 16)]; // 5.5KB - unsigned char *a_inv, *m, *result, *table_s = storage + (320 * 3), - *R2 = table_s; // borrow + const BN_ULONG base_norm[16], + const BN_ULONG exponent[16], + const BN_ULONG m_norm[16], const BN_ULONG RR[16], + BN_ULONG k0, + BN_ULONG storage[MOD_EXP_CTIME_STORAGE_LEN]) { + OPENSSL_STATIC_ASSERT(MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH % 64 == 0, + "MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH is too small"); + assert((uintptr_t)storage % 64 == 0); + + BN_ULONG *a_inv, *m, *result, *table_s = storage + 40 * 3, *R2 = table_s; + // Note |R2| aliases |table_s|. if (((((uintptr_t)storage & 4095) + 320) >> 12) != 0) { result = storage; - a_inv = storage + 320; - m = storage + (320 * 2); // should not cross page + a_inv = storage + 40; + m = storage + 40 * 2; // should not cross page } else { m = storage; // should not cross page - result = storage + 320; - a_inv = storage + (320 * 2); + result = storage + 40; + a_inv = storage + 40 * 2; } rsaz_1024_norm2red_avx2(m, m_norm); @@ -225,7 +220,7 @@ void RSAZ_1024_mod_exp_avx2(BN_ULONG result_norm[16], rsaz_1024_red2norm_avx2(result_norm, result); - OPENSSL_cleanse(storage, sizeof(storage)); + OPENSSL_cleanse(storage, MOD_EXP_CTIME_STORAGE_LEN * sizeof(BN_ULONG)); } -#endif // OPENSSL_X86_64 +#endif // RSAZ_ENABLED diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h new file mode 100644 index 000000000..717c3d41a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h @@ -0,0 +1,104 @@ +/* + * Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2012, Intel Corporation. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) + * (1) Intel Corporation, Israel Development Center, Haifa, Israel + * (2) University of Haifa, Israel + */ + +#ifndef OPENSSL_HEADER_BN_RSAZ_EXP_H +#define OPENSSL_HEADER_BN_RSAZ_EXP_H + +#include +#include + +#include "internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) +#define RSAZ_ENABLED + + +// RSAZ_1024_mod_exp_avx2 sets |result| to |base_norm| raised to |exponent| +// modulo |m_norm|. |base_norm| must be fully-reduced and |exponent| must have +// the high bit set (it is 1024 bits wide). |RR| and |k0| must be |RR| and |n0|, +// respectively, extracted from |m_norm|'s |BN_MONT_CTX|. |storage_words| is a +// temporary buffer that must be aligned to |MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH| +// bytes. +void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], const BN_ULONG base_norm[16], + const BN_ULONG exponent[16], + const BN_ULONG m_norm[16], const BN_ULONG RR[16], + BN_ULONG k0, + BN_ULONG storage_words[MOD_EXP_CTIME_STORAGE_LEN]); + +OPENSSL_INLINE int rsaz_avx2_capable(void) { + const uint32_t *cap = OPENSSL_ia32cap_get(); + return (cap[2] & (1 << 5)) != 0; // AVX2 +} + +OPENSSL_INLINE int rsaz_avx2_preferred(void) { + const uint32_t *cap = OPENSSL_ia32cap_get(); + static const uint32_t kBMI2AndADX = (1 << 8) | (1 << 19); + if ((cap[2] & kBMI2AndADX) == kBMI2AndADX) { + // If BMI2 and ADX are available, x86_64-mont5.pl is faster. + return 0; + } + return (cap[2] & (1 << 5)) != 0; // AVX2 +} + + +// Assembly functions. + +// RSAZ represents 1024-bit integers using unsaturated 29-bit limbs stored in +// 64-bit integers. This requires 36 limbs but padded up to 40. +// +// See crypto/bn/asm/rsaz-avx2.pl for further details. + +// rsaz_1024_norm2red_avx2 converts |norm| from |BIGNUM| to RSAZ representation +// and writes the result to |red|. +void rsaz_1024_norm2red_avx2(BN_ULONG red[40], const BN_ULONG norm[16]); + +// rsaz_1024_mul_avx2 computes |a| * |b| mod |n| and writes the result to |ret|. +// Inputs and outputs are in Montgomery form, using RSAZ's representation. |k| +// is -|n|^-1 mod 2^64 or |n0| from |BN_MONT_CTX|. +void rsaz_1024_mul_avx2(BN_ULONG ret[40], const BN_ULONG a[40], + const BN_ULONG b[40], const BN_ULONG n[40], BN_ULONG k); + +// rsaz_1024_mul_avx2 computes |a|^(2*|count|) mod |n| and writes the result to +// |ret|. Inputs and outputs are in Montgomery form, using RSAZ's +// representation. |k| is -|n|^-1 mod 2^64 or |n0| from |BN_MONT_CTX|. +void rsaz_1024_sqr_avx2(BN_ULONG ret[40], const BN_ULONG a[40], + const BN_ULONG n[40], BN_ULONG k, int count); + +// rsaz_1024_scatter5_avx2 stores |val| at index |i| of |tbl|. |i| must be +// positive and at most 31. Note the table only uses 18 |BN_ULONG|s per entry +// instead of 40. It packs two 29-bit limbs into each |BN_ULONG| and only stores +// 36 limbs rather than the padded 40. +void rsaz_1024_scatter5_avx2(BN_ULONG tbl[32 * 18], const BN_ULONG val[40], + int i); + +// rsaz_1024_gather5_avx2 loads index |i| of |tbl| and writes it to |val|. +void rsaz_1024_gather5_avx2(BN_ULONG val[40], const BN_ULONG tbl[32 * 18], + int i); + +// rsaz_1024_red2norm_avx2 converts |red| from RSAZ to |BIGNUM| representation +// and writes the result to |norm|. +void rsaz_1024_red2norm_avx2(BN_ULONG norm[16], const BN_ULONG red[40]); + + +#endif // !OPENSSL_NO_ASM && OPENSSL_X86_64 + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // OPENSSL_HEADER_BN_RSAZ_EXP_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back new file mode 100644 index 000000000..3b061921c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/rsaz_exp.h.grpc_back @@ -0,0 +1,104 @@ +/* + * Copyright 2013-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2012, Intel Corporation. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) + * (1) Intel Corporation, Israel Development Center, Haifa, Israel + * (2) University of Haifa, Israel + */ + +#ifndef OPENSSL_HEADER_BN_RSAZ_EXP_H +#define OPENSSL_HEADER_BN_RSAZ_EXP_H + +#include +#include + +#include "internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) +#define RSAZ_ENABLED + + +// RSAZ_1024_mod_exp_avx2 sets |result| to |base_norm| raised to |exponent| +// modulo |m_norm|. |base_norm| must be fully-reduced and |exponent| must have +// the high bit set (it is 1024 bits wide). |RR| and |k0| must be |RR| and |n0|, +// respectively, extracted from |m_norm|'s |BN_MONT_CTX|. |storage_words| is a +// temporary buffer that must be aligned to |MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH| +// bytes. +void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16], const BN_ULONG base_norm[16], + const BN_ULONG exponent[16], + const BN_ULONG m_norm[16], const BN_ULONG RR[16], + BN_ULONG k0, + BN_ULONG storage_words[MOD_EXP_CTIME_STORAGE_LEN]); + +OPENSSL_INLINE int rsaz_avx2_capable(void) { + const uint32_t *cap = OPENSSL_ia32cap_get(); + return (cap[2] & (1 << 5)) != 0; // AVX2 +} + +OPENSSL_INLINE int rsaz_avx2_preferred(void) { + const uint32_t *cap = OPENSSL_ia32cap_get(); + static const uint32_t kBMI2AndADX = (1 << 8) | (1 << 19); + if ((cap[2] & kBMI2AndADX) == kBMI2AndADX) { + // If BMI2 and ADX are available, x86_64-mont5.pl is faster. + return 0; + } + return (cap[2] & (1 << 5)) != 0; // AVX2 +} + + +// Assembly functions. + +// RSAZ represents 1024-bit integers using unsaturated 29-bit limbs stored in +// 64-bit integers. This requires 36 limbs but padded up to 40. +// +// See crypto/bn/asm/rsaz-avx2.pl for further details. + +// rsaz_1024_norm2red_avx2 converts |norm| from |BIGNUM| to RSAZ representation +// and writes the result to |red|. +void rsaz_1024_norm2red_avx2(BN_ULONG red[40], const BN_ULONG norm[16]); + +// rsaz_1024_mul_avx2 computes |a| * |b| mod |n| and writes the result to |ret|. +// Inputs and outputs are in Montgomery form, using RSAZ's representation. |k| +// is -|n|^-1 mod 2^64 or |n0| from |BN_MONT_CTX|. +void rsaz_1024_mul_avx2(BN_ULONG ret[40], const BN_ULONG a[40], + const BN_ULONG b[40], const BN_ULONG n[40], BN_ULONG k); + +// rsaz_1024_mul_avx2 computes |a|^(2*|count|) mod |n| and writes the result to +// |ret|. Inputs and outputs are in Montgomery form, using RSAZ's +// representation. |k| is -|n|^-1 mod 2^64 or |n0| from |BN_MONT_CTX|. +void rsaz_1024_sqr_avx2(BN_ULONG ret[40], const BN_ULONG a[40], + const BN_ULONG n[40], BN_ULONG k, int count); + +// rsaz_1024_scatter5_avx2 stores |val| at index |i| of |tbl|. |i| must be +// positive and at most 31. Note the table only uses 18 |BN_ULONG|s per entry +// instead of 40. It packs two 29-bit limbs into each |BN_ULONG| and only stores +// 36 limbs rather than the padded 40. +void rsaz_1024_scatter5_avx2(BN_ULONG tbl[32 * 18], const BN_ULONG val[40], + int i); + +// rsaz_1024_gather5_avx2 loads index |i| of |tbl| and writes it to |val|. +void rsaz_1024_gather5_avx2(BN_ULONG val[40], const BN_ULONG tbl[32 * 18], + int i); + +// rsaz_1024_red2norm_avx2 converts |red| from RSAZ to |BIGNUM| representation +// and writes the result to |norm|. +void rsaz_1024_red2norm_avx2(BN_ULONG norm[16], const BN_ULONG red[40]); + + +#endif // !OPENSSL_NO_ASM && OPENSSL_X86_64 + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // OPENSSL_HEADER_BN_RSAZ_EXP_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/shift.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/shift.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c index b250ac05b..880866cf2 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/shift.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c @@ -133,8 +133,8 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a) { return 1; } -static void bn_rshift_words(BN_ULONG *r, const BN_ULONG *a, unsigned shift, - size_t num) { +void bn_rshift_words(BN_ULONG *r, const BN_ULONG *a, unsigned shift, + size_t num) { unsigned shift_bits = shift % BN_BITS2; size_t shift_words = shift / BN_BITS2; if (shift_words >= num) { @@ -296,15 +296,15 @@ int BN_mask_bits(BIGNUM *a, int n) { } static int bn_count_low_zero_bits_word(BN_ULONG l) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); - OPENSSL_COMPILE_ASSERT(sizeof(int) <= sizeof(crypto_word_t), - crypto_word_t_too_small_2); - OPENSSL_COMPILE_ASSERT(BN_BITS2 == sizeof(BN_ULONG) * 8, - bn_ulong_has_padding_bits); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); + OPENSSL_STATIC_ASSERT(sizeof(int) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); + OPENSSL_STATIC_ASSERT(BN_BITS2 == sizeof(BN_ULONG) * 8, + "BN_ULONG has padding bits"); // C has very bizarre rules for types smaller than an int. - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) >= sizeof(int), - bn_ulong_is_promoted_to_int); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) >= sizeof(int), + "BN_ULONG gets promoted to int"); crypto_word_t mask; int bits = 0; @@ -342,10 +342,10 @@ static int bn_count_low_zero_bits_word(BN_ULONG l) { } int BN_count_low_zero_bits(const BIGNUM *bn) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); - OPENSSL_COMPILE_ASSERT(sizeof(int) <= sizeof(crypto_word_t), - crypto_word_t_too_small_2); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); + OPENSSL_STATIC_ASSERT(sizeof(int) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); int ret = 0; crypto_word_t saw_nonzero = 0; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/shift.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/shift.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c.grpc_back index 3e7173960..523da674c 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/shift.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/shift.c.grpc_back @@ -133,8 +133,8 @@ int BN_lshift1(BIGNUM *r, const BIGNUM *a) { return 1; } -static void bn_rshift_words(BN_ULONG *r, const BN_ULONG *a, unsigned shift, - size_t num) { +void bn_rshift_words(BN_ULONG *r, const BN_ULONG *a, unsigned shift, + size_t num) { unsigned shift_bits = shift % BN_BITS2; size_t shift_words = shift / BN_BITS2; if (shift_words >= num) { @@ -296,15 +296,15 @@ int BN_mask_bits(BIGNUM *a, int n) { } static int bn_count_low_zero_bits_word(BN_ULONG l) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); - OPENSSL_COMPILE_ASSERT(sizeof(int) <= sizeof(crypto_word_t), - crypto_word_t_too_small_2); - OPENSSL_COMPILE_ASSERT(BN_BITS2 == sizeof(BN_ULONG) * 8, - bn_ulong_has_padding_bits); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); + OPENSSL_STATIC_ASSERT(sizeof(int) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); + OPENSSL_STATIC_ASSERT(BN_BITS2 == sizeof(BN_ULONG) * 8, + "BN_ULONG has padding bits"); // C has very bizarre rules for types smaller than an int. - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) >= sizeof(int), - bn_ulong_is_promoted_to_int); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) >= sizeof(int), + "BN_ULONG gets promoted to int"); crypto_word_t mask; int bits = 0; @@ -342,10 +342,10 @@ static int bn_count_low_zero_bits_word(BN_ULONG l) { } int BN_count_low_zero_bits(const BIGNUM *bn) { - OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), - crypto_word_t_too_small); - OPENSSL_COMPILE_ASSERT(sizeof(int) <= sizeof(crypto_word_t), - crypto_word_t_too_small_2); + OPENSSL_STATIC_ASSERT(sizeof(BN_ULONG) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); + OPENSSL_STATIC_ASSERT(sizeof(int) <= sizeof(crypto_word_t), + "crypto_word_t is too small"); int ret = 0; crypto_word_t saw_nonzero = 0; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/sqrt.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/sqrt.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/sqrt.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/bn/sqrt.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/bn/sqrt.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/aead.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/aead.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/aead.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/aead.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/aead.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/cipher.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/cipher.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c index 797391c6b..15a85ea31 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/cipher.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c @@ -125,9 +125,10 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) { return 1; } -void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { +int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { EVP_CIPHER_CTX_cleanup(ctx); EVP_CIPHER_CTX_init(ctx); + return 1; } int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, @@ -191,7 +192,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, case EVP_CIPH_CFB_MODE: ctx->num = 0; - // fall-through + OPENSSL_FALLTHROUGH; case EVP_CIPH_CBC_MODE: assert(EVP_CIPHER_CTX_iv_length(ctx) <= sizeof(ctx->iv)); @@ -496,6 +497,10 @@ int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->nid; } +int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) { + return ctx->encrypt; +} + unsigned EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->block_size; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/cipher.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/cipher.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c.grpc_back index f3d405742..c50c6c5cc 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/cipher.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/cipher.c.grpc_back @@ -125,9 +125,10 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) { return 1; } -void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { +int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) { EVP_CIPHER_CTX_cleanup(ctx); EVP_CIPHER_CTX_init(ctx); + return 1; } int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, @@ -191,7 +192,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, case EVP_CIPH_CFB_MODE: ctx->num = 0; - // fall-through + OPENSSL_FALLTHROUGH; case EVP_CIPH_CBC_MODE: assert(EVP_CIPHER_CTX_iv_length(ctx) <= sizeof(ctx->iv)); @@ -496,6 +497,10 @@ int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->nid; } +int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx) { + return ctx->encrypt; +} + unsigned EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->block_size; } diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c new file mode 100644 index 000000000..808d33958 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c @@ -0,0 +1,1302 @@ +/* ==================================================================== + * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" +#include "../aes/internal.h" +#include "../modes/internal.h" +#include "../delocate.h" + + +OPENSSL_MSVC_PRAGMA(warning(push)) +OPENSSL_MSVC_PRAGMA(warning(disable: 4702)) // Unreachable code. + +#if defined(BSAES) +static void vpaes_ctr32_encrypt_blocks_with_bsaes(const uint8_t *in, + uint8_t *out, size_t blocks, + const AES_KEY *key, + const uint8_t ivec[16]) { + // |bsaes_ctr32_encrypt_blocks| is faster than |vpaes_ctr32_encrypt_blocks|, + // but it takes at least one full 8-block batch to amortize the conversion. + if (blocks < 8) { + vpaes_ctr32_encrypt_blocks(in, out, blocks, key, ivec); + return; + } + + size_t bsaes_blocks = blocks; + if (bsaes_blocks % 8 < 6) { + // |bsaes_ctr32_encrypt_blocks| internally works in 8-block batches. If the + // final batch is too small (under six blocks), it is faster to loop over + // |vpaes_encrypt|. Round |bsaes_blocks| down to a multiple of 8. + bsaes_blocks -= bsaes_blocks % 8; + } + + AES_KEY bsaes; + vpaes_encrypt_key_to_bsaes(&bsaes, key); + bsaes_ctr32_encrypt_blocks(in, out, bsaes_blocks, &bsaes, ivec); + OPENSSL_cleanse(&bsaes, sizeof(bsaes)); + + in += 16 * bsaes_blocks; + out += 16 * bsaes_blocks; + blocks -= bsaes_blocks; + + union { + uint32_t u32[4]; + uint8_t u8[16]; + } new_ivec; + memcpy(new_ivec.u8, ivec, 16); + uint32_t ctr = CRYPTO_bswap4(new_ivec.u32[3]) + bsaes_blocks; + new_ivec.u32[3] = CRYPTO_bswap4(ctr); + + // Finish any remaining blocks with |vpaes_ctr32_encrypt_blocks|. + vpaes_ctr32_encrypt_blocks(in, out, blocks, key, new_ivec.u8); +} +#endif // BSAES + +typedef struct { + union { + double align; + AES_KEY ks; + } ks; + block128_f block; + union { + cbc128_f cbc; + ctr128_f ctr; + } stream; +} EVP_AES_KEY; + +typedef struct { + GCM128_CONTEXT gcm; + union { + double align; + AES_KEY ks; + } ks; // AES key schedule to use + int key_set; // Set if key initialised + int iv_set; // Set if an iv is set + uint8_t *iv; // Temporary IV store + int ivlen; // IV length + int taglen; + int iv_gen; // It is OK to generate IVs + ctr128_f ctr; +} EVP_AES_GCM_CTX; + +static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + int ret, mode; + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + mode = ctx->cipher->flags & EVP_CIPH_MODE_MASK; + if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) { + if (hwaes_capable()) { + ret = aes_hw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_hw_decrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_hw_cbc_encrypt; + } + } else if (bsaes_capable() && mode == EVP_CIPH_CBC_MODE) { + assert(vpaes_capable()); + ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + if (ret == 0) { + vpaes_decrypt_key_to_bsaes(&dat->ks.ks, &dat->ks.ks); + } + // If |dat->stream.cbc| is provided, |dat->block| is never used. + dat->block = NULL; + dat->stream.cbc = bsaes_cbc_encrypt; + } else if (vpaes_capable()) { + ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = vpaes_decrypt; + dat->stream.cbc = NULL; +#if defined(VPAES_CBC) + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = vpaes_cbc_encrypt; + } +#endif + } else { + ret = aes_nohw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_nohw_decrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_nohw_cbc_encrypt; + } + } + } else if (hwaes_capable()) { + ret = aes_hw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_hw_encrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_hw_cbc_encrypt; + } else if (mode == EVP_CIPH_CTR_MODE) { + dat->stream.ctr = aes_hw_ctr32_encrypt_blocks; + } + } else if (vpaes_capable()) { + ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = vpaes_encrypt; + dat->stream.cbc = NULL; +#if defined(VPAES_CBC) + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = vpaes_cbc_encrypt; + } +#endif + if (mode == EVP_CIPH_CTR_MODE) { +#if defined(BSAES) + assert(bsaes_capable()); + dat->stream.ctr = vpaes_ctr32_encrypt_blocks_with_bsaes; +#elif defined(VPAES_CTR32) + dat->stream.ctr = vpaes_ctr32_encrypt_blocks; +#endif + } + } else { + ret = aes_nohw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_nohw_encrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_nohw_cbc_encrypt; + } + } + + if (ret < 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_AES_KEY_SETUP_FAILED); + return 0; + } + + return 1; +} + +static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + if (dat->stream.cbc) { + (*dat->stream.cbc)(in, out, len, &dat->ks.ks, ctx->iv, ctx->encrypt); + } else if (ctx->encrypt) { + CRYPTO_cbc128_encrypt(in, out, len, &dat->ks.ks, ctx->iv, dat->block); + } else { + CRYPTO_cbc128_decrypt(in, out, len, &dat->ks.ks, ctx->iv, dat->block); + } + + return 1; +} + +static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + size_t bl = ctx->cipher->block_size; + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + if (len < bl) { + return 1; + } + + len -= bl; + for (size_t i = 0; i <= len; i += bl) { + (*dat->block)(in + i, out + i, &dat->ks.ks); + } + + return 1; +} + +static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + if (dat->stream.ctr) { + CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks.ks, ctx->iv, ctx->buf, + &ctx->num, dat->stream.ctr); + } else { + CRYPTO_ctr128_encrypt(in, out, len, &dat->ks.ks, ctx->iv, ctx->buf, + &ctx->num, dat->block); + } + return 1; +} + +static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + CRYPTO_ofb128_encrypt(in, out, len, &dat->ks.ks, ctx->iv, &ctx->num, + dat->block); + return 1; +} + +ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_KEY *gcm_key, + block128_f *out_block, const uint8_t *key, + size_t key_bytes) { + if (hwaes_capable()) { + aes_hw_set_encrypt_key(key, key_bytes * 8, aes_key); + if (gcm_key != NULL) { + CRYPTO_gcm128_init_key(gcm_key, aes_key, aes_hw_encrypt, 1); + } + if (out_block) { + *out_block = aes_hw_encrypt; + } + return aes_hw_ctr32_encrypt_blocks; + } + + if (vpaes_capable()) { + vpaes_set_encrypt_key(key, key_bytes * 8, aes_key); + if (out_block) { + *out_block = vpaes_encrypt; + } + if (gcm_key != NULL) { + CRYPTO_gcm128_init_key(gcm_key, aes_key, vpaes_encrypt, 0); + } +#if defined(BSAES) + assert(bsaes_capable()); + return vpaes_ctr32_encrypt_blocks_with_bsaes; +#elif defined(VPAES_CTR32) + return vpaes_ctr32_encrypt_blocks; +#else + return NULL; +#endif + } + + aes_nohw_set_encrypt_key(key, key_bytes * 8, aes_key); + if (gcm_key != NULL) { + CRYPTO_gcm128_init_key(gcm_key, aes_key, aes_nohw_encrypt, 0); + } + if (out_block) { + *out_block = aes_nohw_encrypt; + } + return aes_nohw_ctr32_encrypt_blocks; +} + +#if defined(OPENSSL_32_BIT) +#define EVP_AES_GCM_CTX_PADDING (4+8) +#else +#define EVP_AES_GCM_CTX_PADDING 8 +#endif + +static EVP_AES_GCM_CTX *aes_gcm_from_cipher_ctx(EVP_CIPHER_CTX *ctx) { +#if defined(__GNUC__) || defined(__clang__) + OPENSSL_STATIC_ASSERT( + alignof(EVP_AES_GCM_CTX) <= 16, + "EVP_AES_GCM_CTX needs more alignment than this function provides"); +#endif + + // |malloc| guarantees up to 4-byte alignment on 32-bit and 8-byte alignment + // on 64-bit systems, so we need to adjust to reach 16-byte alignment. + assert(ctx->cipher->ctx_size == + sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING); + + char *ptr = ctx->cipher_data; +#if defined(OPENSSL_32_BIT) + assert((uintptr_t)ptr % 4 == 0); + ptr += (uintptr_t)ptr & 4; +#endif + assert((uintptr_t)ptr % 8 == 0); + ptr += (uintptr_t)ptr & 8; + return (EVP_AES_GCM_CTX *)ptr; +} + +static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(ctx); + if (!iv && !key) { + return 1; + } + if (key) { + OPENSSL_memset(&gctx->gcm, 0, sizeof(gctx->gcm)); + gctx->ctr = aes_ctr_set_key(&gctx->ks.ks, &gctx->gcm.gcm_key, NULL, key, + ctx->key_len); + // If we have an iv can set it directly, otherwise use saved IV. + if (iv == NULL && gctx->iv_set) { + iv = gctx->iv; + } + if (iv) { + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); + gctx->iv_set = 1; + } + gctx->key_set = 1; + } else { + // If key set use IV, otherwise copy + if (gctx->key_set) { + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); + } else { + OPENSSL_memcpy(gctx->iv, iv, gctx->ivlen); + } + gctx->iv_set = 1; + gctx->iv_gen = 0; + } + return 1; +} + +static void aes_gcm_cleanup(EVP_CIPHER_CTX *c) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(c); + OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm)); + if (gctx->iv != c->iv) { + OPENSSL_free(gctx->iv); + } +} + +// increment counter (64-bit int) by 1 +static void ctr64_inc(uint8_t *counter) { + int n = 8; + uint8_t c; + + do { + --n; + c = counter[n]; + ++c; + counter[n] = c; + if (c) { + return; + } + } while (n); +} + +static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(c); + switch (type) { + case EVP_CTRL_INIT: + gctx->key_set = 0; + gctx->iv_set = 0; + gctx->ivlen = c->cipher->iv_len; + gctx->iv = c->iv; + gctx->taglen = -1; + gctx->iv_gen = 0; + return 1; + + case EVP_CTRL_AEAD_SET_IVLEN: + if (arg <= 0) { + return 0; + } + + // Allocate memory for IV if needed + if (arg > EVP_MAX_IV_LENGTH && arg > gctx->ivlen) { + if (gctx->iv != c->iv) { + OPENSSL_free(gctx->iv); + } + gctx->iv = OPENSSL_malloc(arg); + if (!gctx->iv) { + return 0; + } + } + gctx->ivlen = arg; + return 1; + + case EVP_CTRL_AEAD_SET_TAG: + if (arg <= 0 || arg > 16 || c->encrypt) { + return 0; + } + OPENSSL_memcpy(c->buf, ptr, arg); + gctx->taglen = arg; + return 1; + + case EVP_CTRL_AEAD_GET_TAG: + if (arg <= 0 || arg > 16 || !c->encrypt || gctx->taglen < 0) { + return 0; + } + OPENSSL_memcpy(ptr, c->buf, arg); + return 1; + + case EVP_CTRL_AEAD_SET_IV_FIXED: + // Special case: -1 length restores whole IV + if (arg == -1) { + OPENSSL_memcpy(gctx->iv, ptr, gctx->ivlen); + gctx->iv_gen = 1; + return 1; + } + // Fixed field must be at least 4 bytes and invocation field + // at least 8. + if (arg < 4 || (gctx->ivlen - arg) < 8) { + return 0; + } + if (arg) { + OPENSSL_memcpy(gctx->iv, ptr, arg); + } + if (c->encrypt && !RAND_bytes(gctx->iv + arg, gctx->ivlen - arg)) { + return 0; + } + gctx->iv_gen = 1; + return 1; + + case EVP_CTRL_GCM_IV_GEN: + if (gctx->iv_gen == 0 || gctx->key_set == 0) { + return 0; + } + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); + if (arg <= 0 || arg > gctx->ivlen) { + arg = gctx->ivlen; + } + OPENSSL_memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); + // Invocation field will be at least 8 bytes in size and + // so no need to check wrap around or increment more than + // last 8 bytes. + ctr64_inc(gctx->iv + gctx->ivlen - 8); + gctx->iv_set = 1; + return 1; + + case EVP_CTRL_GCM_SET_IV_INV: + if (gctx->iv_gen == 0 || gctx->key_set == 0 || c->encrypt) { + return 0; + } + OPENSSL_memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); + gctx->iv_set = 1; + return 1; + + case EVP_CTRL_COPY: { + EVP_CIPHER_CTX *out = ptr; + EVP_AES_GCM_CTX *gctx_out = aes_gcm_from_cipher_ctx(out); + // |EVP_CIPHER_CTX_copy| copies this generically, but we must redo it in + // case |out->cipher_data| and |in->cipher_data| are differently aligned. + OPENSSL_memcpy(gctx_out, gctx, sizeof(EVP_AES_GCM_CTX)); + if (gctx->iv == c->iv) { + gctx_out->iv = out->iv; + } else { + gctx_out->iv = OPENSSL_malloc(gctx->ivlen); + if (!gctx_out->iv) { + return 0; + } + OPENSSL_memcpy(gctx_out->iv, gctx->iv, gctx->ivlen); + } + return 1; + } + + default: + return -1; + } +} + +static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(ctx); + + // If not set up, return error + if (!gctx->key_set) { + return -1; + } + if (!gctx->iv_set) { + return -1; + } + + if (in) { + if (out == NULL) { + if (!CRYPTO_gcm128_aad(&gctx->gcm, in, len)) { + return -1; + } + } else if (ctx->encrypt) { + if (gctx->ctr) { + if (!CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, + gctx->ctr)) { + return -1; + } + } else { + if (!CRYPTO_gcm128_encrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { + return -1; + } + } + } else { + if (gctx->ctr) { + if (!CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, + gctx->ctr)) { + return -1; + } + } else { + if (!CRYPTO_gcm128_decrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { + return -1; + } + } + } + return len; + } else { + if (!ctx->encrypt) { + if (gctx->taglen < 0 || + !CRYPTO_gcm128_finish(&gctx->gcm, ctx->buf, gctx->taglen)) { + return -1; + } + gctx->iv_set = 0; + return 0; + } + CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, 16); + gctx->taglen = 16; + // Don't reuse the IV + gctx->iv_set = 0; + return 0; + } +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_cbc_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_cbc; + out->block_size = 16; + out->key_len = 16; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = aes_init_key; + out->cipher = aes_cbc_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ctr_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ctr; + out->block_size = 1; + out->key_len = 16; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CTR_MODE; + out->init = aes_init_key; + out->cipher = aes_ctr_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ecb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ecb; + out->block_size = 16; + out->key_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ofb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ofb128; + out->block_size = 1; + out->key_len = 16; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_OFB_MODE; + out->init = aes_init_key; + out->cipher = aes_ofb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_gcm_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_gcm; + out->block_size = 1; + out->key_len = 16; + out->iv_len = 12; + out->ctx_size = sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING; + out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_CUSTOM_COPY | + EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | + EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; + out->init = aes_gcm_init_key; + out->cipher = aes_gcm_cipher; + out->cleanup = aes_gcm_cleanup; + out->ctrl = aes_gcm_ctrl; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_cbc_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_cbc; + out->block_size = 16; + out->key_len = 24; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = aes_init_key; + out->cipher = aes_cbc_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ctr_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ctr; + out->block_size = 1; + out->key_len = 24; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CTR_MODE; + out->init = aes_init_key; + out->cipher = aes_ctr_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ecb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ecb; + out->block_size = 16; + out->key_len = 24; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ofb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ofb128; + out->block_size = 1; + out->key_len = 24; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_OFB_MODE; + out->init = aes_init_key; + out->cipher = aes_ofb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_gcm_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_gcm; + out->block_size = 1; + out->key_len = 24; + out->iv_len = 12; + out->ctx_size = sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING; + out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_CUSTOM_COPY | + EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | + EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; + out->init = aes_gcm_init_key; + out->cipher = aes_gcm_cipher; + out->cleanup = aes_gcm_cleanup; + out->ctrl = aes_gcm_ctrl; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_cbc_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_cbc; + out->block_size = 16; + out->key_len = 32; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = aes_init_key; + out->cipher = aes_cbc_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ctr_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ctr; + out->block_size = 1; + out->key_len = 32; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CTR_MODE; + out->init = aes_init_key; + out->cipher = aes_ctr_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ecb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ecb; + out->block_size = 16; + out->key_len = 32; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ofb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ofb128; + out->block_size = 1; + out->key_len = 32; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_OFB_MODE; + out->init = aes_init_key; + out->cipher = aes_ofb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_gcm_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_gcm; + out->block_size = 1; + out->key_len = 32; + out->iv_len = 12; + out->ctx_size = sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING; + out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_CUSTOM_COPY | + EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | + EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; + out->init = aes_gcm_init_key; + out->cipher = aes_gcm_cipher; + out->cleanup = aes_gcm_cleanup; + out->ctrl = aes_gcm_ctrl; +} + +#if defined(HWAES_ECB) + +static int aes_hw_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t len) { + size_t bl = ctx->cipher->block_size; + + if (len < bl) { + return 1; + } + + aes_hw_ecb_encrypt(in, out, len, ctx->cipher_data, ctx->encrypt); + + return 1; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_hw_128_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ecb; + out->block_size = 16; + out->key_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_hw_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_hw_192_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ecb; + out->block_size = 16; + out->key_len = 24; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_hw_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_hw_256_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ecb; + out->block_size = 16; + out->key_len = 32; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_hw_ecb_cipher; +} + +#define EVP_ECB_CIPHER_FUNCTION(keybits) \ + const EVP_CIPHER *EVP_aes_##keybits##_ecb(void) { \ + if (hwaes_capable()) { \ + return aes_hw_##keybits##_ecb(); \ + } \ + return aes_##keybits##_ecb_generic(); \ + } + +#else + +#define EVP_ECB_CIPHER_FUNCTION(keybits) \ + const EVP_CIPHER *EVP_aes_##keybits##_ecb(void) { \ + return aes_##keybits##_ecb_generic(); \ + } + +#endif // HWAES_ECB + +#define EVP_CIPHER_FUNCTION(keybits, mode) \ + const EVP_CIPHER *EVP_aes_##keybits##_##mode(void) { \ + return aes_##keybits##_##mode##_generic(); \ + } + +EVP_CIPHER_FUNCTION(128, cbc) +EVP_CIPHER_FUNCTION(128, ctr) +EVP_CIPHER_FUNCTION(128, ofb) +EVP_CIPHER_FUNCTION(128, gcm) + +EVP_CIPHER_FUNCTION(192, cbc) +EVP_CIPHER_FUNCTION(192, ctr) +EVP_CIPHER_FUNCTION(192, ofb) +EVP_CIPHER_FUNCTION(192, gcm) + +EVP_CIPHER_FUNCTION(256, cbc) +EVP_CIPHER_FUNCTION(256, ctr) +EVP_CIPHER_FUNCTION(256, ofb) +EVP_CIPHER_FUNCTION(256, gcm) + +EVP_ECB_CIPHER_FUNCTION(128) +EVP_ECB_CIPHER_FUNCTION(192) +EVP_ECB_CIPHER_FUNCTION(256) + + +#define EVP_AEAD_AES_GCM_TAG_LEN 16 + +struct aead_aes_gcm_ctx { + union { + double align; + AES_KEY ks; + } ks; + GCM128_KEY gcm_key; + ctr128_f ctr; +}; + +static int aead_aes_gcm_init_impl(struct aead_aes_gcm_ctx *gcm_ctx, + size_t *out_tag_len, const uint8_t *key, + size_t key_len, size_t tag_len) { + const size_t key_bits = key_len * 8; + + if (key_bits != 128 && key_bits != 192 && key_bits != 256) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); + return 0; // EVP_AEAD_CTX_init should catch this. + } + + if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { + tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + } + + if (tag_len > EVP_AEAD_AES_GCM_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + gcm_ctx->ctr = + aes_ctr_set_key(&gcm_ctx->ks.ks, &gcm_ctx->gcm_key, NULL, key, key_len); + *out_tag_len = tag_len; + return 1; +} + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_gcm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t requested_tag_len) { + struct aead_aes_gcm_ctx *gcm_ctx = (struct aead_aes_gcm_ctx *) &ctx->state; + + size_t actual_tag_len; + if (!aead_aes_gcm_init_impl(gcm_ctx, &actual_tag_len, key, key_len, + requested_tag_len)) { + return 0; + } + + ctx->tag_len = actual_tag_len; + return 1; +} + +static void aead_aes_gcm_cleanup(EVP_AEAD_CTX *ctx) {} + +static int aead_aes_gcm_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, + uint8_t *out_tag, size_t *out_tag_len, + size_t max_out_tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *extra_in, + size_t extra_in_len, + const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_ctx *gcm_ctx = (struct aead_aes_gcm_ctx *) &ctx->state; + + if (extra_in_len + ctx->tag_len < ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + if (max_out_tag_len < extra_in_len + ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + if (nonce_len == 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + const AES_KEY *key = &gcm_ctx->ks.ks; + + GCM128_CONTEXT gcm; + OPENSSL_memset(&gcm, 0, sizeof(gcm)); + OPENSSL_memcpy(&gcm.gcm_key, &gcm_ctx->gcm_key, sizeof(gcm.gcm_key)); + CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); + + if (ad_len > 0 && !CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { + return 0; + } + + if (gcm_ctx->ctr) { + if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, in, out, in_len, + gcm_ctx->ctr)) { + return 0; + } + } else { + if (!CRYPTO_gcm128_encrypt(&gcm, key, in, out, in_len)) { + return 0; + } + } + + if (extra_in_len) { + if (gcm_ctx->ctr) { + if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, extra_in, out_tag, + extra_in_len, gcm_ctx->ctr)) { + return 0; + } + } else { + if (!CRYPTO_gcm128_encrypt(&gcm, key, extra_in, out_tag, extra_in_len)) { + return 0; + } + } + } + + CRYPTO_gcm128_tag(&gcm, out_tag + extra_in_len, ctx->tag_len); + *out_tag_len = ctx->tag_len + extra_in_len; + + return 1; +} + +static int aead_aes_gcm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *in_tag, size_t in_tag_len, + const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_ctx *gcm_ctx = (struct aead_aes_gcm_ctx *) &ctx->state; + uint8_t tag[EVP_AEAD_AES_GCM_TAG_LEN]; + + if (nonce_len == 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (in_tag_len != ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + const AES_KEY *key = &gcm_ctx->ks.ks; + + GCM128_CONTEXT gcm; + OPENSSL_memset(&gcm, 0, sizeof(gcm)); + OPENSSL_memcpy(&gcm.gcm_key, &gcm_ctx->gcm_key, sizeof(gcm.gcm_key)); + CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); + + if (!CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { + return 0; + } + + if (gcm_ctx->ctr) { + if (!CRYPTO_gcm128_decrypt_ctr32(&gcm, key, in, out, in_len, + gcm_ctx->ctr)) { + return 0; + } + } else { + if (!CRYPTO_gcm128_decrypt(&gcm, key, in, out, in_len)) { + return 0; + } + } + + CRYPTO_gcm128_tag(&gcm, tag, ctx->tag_len); + if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 16; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_192_gcm) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 24; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 32; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +struct aead_aes_gcm_tls12_ctx { + struct aead_aes_gcm_ctx gcm_ctx; + uint64_t min_next_nonce; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_tls12_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_tls12_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_gcm_tls12_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t requested_tag_len) { + struct aead_aes_gcm_tls12_ctx *gcm_ctx = + (struct aead_aes_gcm_tls12_ctx *) &ctx->state; + + gcm_ctx->min_next_nonce = 0; + + size_t actual_tag_len; + if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len, + requested_tag_len)) { + return 0; + } + + ctx->tag_len = actual_tag_len; + return 1; +} + +static int aead_aes_gcm_tls12_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_tls12_ctx *gcm_ctx = + (struct aead_aes_gcm_tls12_ctx *) &ctx->state; + + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + // The given nonces must be strictly monotonically increasing. + uint64_t given_counter; + OPENSSL_memcpy(&given_counter, nonce + nonce_len - sizeof(given_counter), + sizeof(given_counter)); + given_counter = CRYPTO_bswap8(given_counter); + if (given_counter == UINT64_MAX || + given_counter < gcm_ctx->min_next_nonce) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE); + return 0; + } + + gcm_ctx->min_next_nonce = given_counter + 1; + + return aead_aes_gcm_seal_scatter(ctx, out, out_tag, out_tag_len, + max_out_tag_len, nonce, nonce_len, in, + in_len, extra_in, extra_in_len, ad, ad_len); +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm_tls12) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 16; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls12_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm_tls12) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 32; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls12_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +struct aead_aes_gcm_tls13_ctx { + struct aead_aes_gcm_ctx gcm_ctx; + uint64_t min_next_nonce; + uint64_t mask; + uint8_t first; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_tls13_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_tls13_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_gcm_tls13_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t requested_tag_len) { + struct aead_aes_gcm_tls13_ctx *gcm_ctx = + (struct aead_aes_gcm_tls13_ctx *) &ctx->state; + + gcm_ctx->min_next_nonce = 0; + gcm_ctx->first = 1; + + size_t actual_tag_len; + if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len, + requested_tag_len)) { + return 0; + } + + ctx->tag_len = actual_tag_len; + return 1; +} + +static int aead_aes_gcm_tls13_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_tls13_ctx *gcm_ctx = + (struct aead_aes_gcm_tls13_ctx *) &ctx->state; + + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + // The given nonces must be strictly monotonically increasing. See + // https://tools.ietf.org/html/rfc8446#section-5.3 for details of the TLS 1.3 + // nonce construction. + uint64_t given_counter; + OPENSSL_memcpy(&given_counter, nonce + nonce_len - sizeof(given_counter), + sizeof(given_counter)); + given_counter = CRYPTO_bswap8(given_counter); + + if (gcm_ctx->first) { + // In the first call the sequence number will be zero and therefore the + // given nonce will be 0 ^ mask = mask. + gcm_ctx->mask = given_counter; + gcm_ctx->first = 0; + } + given_counter ^= gcm_ctx->mask; + + if (given_counter == UINT64_MAX || + given_counter < gcm_ctx->min_next_nonce) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE); + return 0; + } + + gcm_ctx->min_next_nonce = given_counter + 1; + + return aead_aes_gcm_seal_scatter(ctx, out, out_tag, out_tag_len, + max_out_tag_len, nonce, nonce_len, in, + in_len, extra_in, extra_in_len, ad, ad_len); +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm_tls13) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 16; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls13_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls13_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm_tls13) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 32; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls13_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls13_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +int EVP_has_aes_hardware(void) { +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) + return hwaes_capable() && crypto_gcm_clmul_enabled(); +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + return hwaes_capable() && CRYPTO_is_ARMv8_PMULL_capable(); +#elif defined(OPENSSL_PPC64LE) + return CRYPTO_is_PPC64LE_vcrypto_capable(); +#else + return 0; +#endif +} + +OPENSSL_MSVC_PRAGMA(warning(pop)) diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c.grpc_back new file mode 100644 index 000000000..8f4907f3a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_aes.c.grpc_back @@ -0,0 +1,1302 @@ +/* ==================================================================== + * Copyright (c) 2001-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" +#include "../aes/internal.h" +#include "../modes/internal.h" +#include "../delocate.h" + + +OPENSSL_MSVC_PRAGMA(warning(push)) +OPENSSL_MSVC_PRAGMA(warning(disable: 4702)) // Unreachable code. + +#if defined(BSAES) +static void vpaes_ctr32_encrypt_blocks_with_bsaes(const uint8_t *in, + uint8_t *out, size_t blocks, + const AES_KEY *key, + const uint8_t ivec[16]) { + // |bsaes_ctr32_encrypt_blocks| is faster than |vpaes_ctr32_encrypt_blocks|, + // but it takes at least one full 8-block batch to amortize the conversion. + if (blocks < 8) { + vpaes_ctr32_encrypt_blocks(in, out, blocks, key, ivec); + return; + } + + size_t bsaes_blocks = blocks; + if (bsaes_blocks % 8 < 6) { + // |bsaes_ctr32_encrypt_blocks| internally works in 8-block batches. If the + // final batch is too small (under six blocks), it is faster to loop over + // |vpaes_encrypt|. Round |bsaes_blocks| down to a multiple of 8. + bsaes_blocks -= bsaes_blocks % 8; + } + + AES_KEY bsaes; + vpaes_encrypt_key_to_bsaes(&bsaes, key); + bsaes_ctr32_encrypt_blocks(in, out, bsaes_blocks, &bsaes, ivec); + OPENSSL_cleanse(&bsaes, sizeof(bsaes)); + + in += 16 * bsaes_blocks; + out += 16 * bsaes_blocks; + blocks -= bsaes_blocks; + + union { + uint32_t u32[4]; + uint8_t u8[16]; + } new_ivec; + memcpy(new_ivec.u8, ivec, 16); + uint32_t ctr = CRYPTO_bswap4(new_ivec.u32[3]) + bsaes_blocks; + new_ivec.u32[3] = CRYPTO_bswap4(ctr); + + // Finish any remaining blocks with |vpaes_ctr32_encrypt_blocks|. + vpaes_ctr32_encrypt_blocks(in, out, blocks, key, new_ivec.u8); +} +#endif // BSAES + +typedef struct { + union { + double align; + AES_KEY ks; + } ks; + block128_f block; + union { + cbc128_f cbc; + ctr128_f ctr; + } stream; +} EVP_AES_KEY; + +typedef struct { + GCM128_CONTEXT gcm; + union { + double align; + AES_KEY ks; + } ks; // AES key schedule to use + int key_set; // Set if key initialised + int iv_set; // Set if an iv is set + uint8_t *iv; // Temporary IV store + int ivlen; // IV length + int taglen; + int iv_gen; // It is OK to generate IVs + ctr128_f ctr; +} EVP_AES_GCM_CTX; + +static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + int ret, mode; + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + mode = ctx->cipher->flags & EVP_CIPH_MODE_MASK; + if ((mode == EVP_CIPH_ECB_MODE || mode == EVP_CIPH_CBC_MODE) && !enc) { + if (hwaes_capable()) { + ret = aes_hw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_hw_decrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_hw_cbc_encrypt; + } + } else if (bsaes_capable() && mode == EVP_CIPH_CBC_MODE) { + assert(vpaes_capable()); + ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + if (ret == 0) { + vpaes_decrypt_key_to_bsaes(&dat->ks.ks, &dat->ks.ks); + } + // If |dat->stream.cbc| is provided, |dat->block| is never used. + dat->block = NULL; + dat->stream.cbc = bsaes_cbc_encrypt; + } else if (vpaes_capable()) { + ret = vpaes_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = vpaes_decrypt; + dat->stream.cbc = NULL; +#if defined(VPAES_CBC) + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = vpaes_cbc_encrypt; + } +#endif + } else { + ret = aes_nohw_set_decrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_nohw_decrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_nohw_cbc_encrypt; + } + } + } else if (hwaes_capable()) { + ret = aes_hw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_hw_encrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_hw_cbc_encrypt; + } else if (mode == EVP_CIPH_CTR_MODE) { + dat->stream.ctr = aes_hw_ctr32_encrypt_blocks; + } + } else if (vpaes_capable()) { + ret = vpaes_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = vpaes_encrypt; + dat->stream.cbc = NULL; +#if defined(VPAES_CBC) + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = vpaes_cbc_encrypt; + } +#endif + if (mode == EVP_CIPH_CTR_MODE) { +#if defined(BSAES) + assert(bsaes_capable()); + dat->stream.ctr = vpaes_ctr32_encrypt_blocks_with_bsaes; +#elif defined(VPAES_CTR32) + dat->stream.ctr = vpaes_ctr32_encrypt_blocks; +#endif + } + } else { + ret = aes_nohw_set_encrypt_key(key, ctx->key_len * 8, &dat->ks.ks); + dat->block = aes_nohw_encrypt; + dat->stream.cbc = NULL; + if (mode == EVP_CIPH_CBC_MODE) { + dat->stream.cbc = aes_nohw_cbc_encrypt; + } + } + + if (ret < 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_AES_KEY_SETUP_FAILED); + return 0; + } + + return 1; +} + +static int aes_cbc_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + if (dat->stream.cbc) { + (*dat->stream.cbc)(in, out, len, &dat->ks.ks, ctx->iv, ctx->encrypt); + } else if (ctx->encrypt) { + CRYPTO_cbc128_encrypt(in, out, len, &dat->ks.ks, ctx->iv, dat->block); + } else { + CRYPTO_cbc128_decrypt(in, out, len, &dat->ks.ks, ctx->iv, dat->block); + } + + return 1; +} + +static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + size_t bl = ctx->cipher->block_size; + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + if (len < bl) { + return 1; + } + + len -= bl; + for (size_t i = 0; i <= len; i += bl) { + (*dat->block)(in + i, out + i, &dat->ks.ks); + } + + return 1; +} + +static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + if (dat->stream.ctr) { + CRYPTO_ctr128_encrypt_ctr32(in, out, len, &dat->ks.ks, ctx->iv, ctx->buf, + &ctx->num, dat->stream.ctr); + } else { + CRYPTO_ctr128_encrypt(in, out, len, &dat->ks.ks, ctx->iv, ctx->buf, + &ctx->num, dat->block); + } + return 1; +} + +static int aes_ofb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; + + CRYPTO_ofb128_encrypt(in, out, len, &dat->ks.ks, ctx->iv, &ctx->num, + dat->block); + return 1; +} + +ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_KEY *gcm_key, + block128_f *out_block, const uint8_t *key, + size_t key_bytes) { + if (hwaes_capable()) { + aes_hw_set_encrypt_key(key, key_bytes * 8, aes_key); + if (gcm_key != NULL) { + CRYPTO_gcm128_init_key(gcm_key, aes_key, aes_hw_encrypt, 1); + } + if (out_block) { + *out_block = aes_hw_encrypt; + } + return aes_hw_ctr32_encrypt_blocks; + } + + if (vpaes_capable()) { + vpaes_set_encrypt_key(key, key_bytes * 8, aes_key); + if (out_block) { + *out_block = vpaes_encrypt; + } + if (gcm_key != NULL) { + CRYPTO_gcm128_init_key(gcm_key, aes_key, vpaes_encrypt, 0); + } +#if defined(BSAES) + assert(bsaes_capable()); + return vpaes_ctr32_encrypt_blocks_with_bsaes; +#elif defined(VPAES_CTR32) + return vpaes_ctr32_encrypt_blocks; +#else + return NULL; +#endif + } + + aes_nohw_set_encrypt_key(key, key_bytes * 8, aes_key); + if (gcm_key != NULL) { + CRYPTO_gcm128_init_key(gcm_key, aes_key, aes_nohw_encrypt, 0); + } + if (out_block) { + *out_block = aes_nohw_encrypt; + } + return aes_nohw_ctr32_encrypt_blocks; +} + +#if defined(OPENSSL_32_BIT) +#define EVP_AES_GCM_CTX_PADDING (4+8) +#else +#define EVP_AES_GCM_CTX_PADDING 8 +#endif + +static EVP_AES_GCM_CTX *aes_gcm_from_cipher_ctx(EVP_CIPHER_CTX *ctx) { +#if defined(__GNUC__) || defined(__clang__) + OPENSSL_STATIC_ASSERT( + alignof(EVP_AES_GCM_CTX) <= 16, + "EVP_AES_GCM_CTX needs more alignment than this function provides"); +#endif + + // |malloc| guarantees up to 4-byte alignment on 32-bit and 8-byte alignment + // on 64-bit systems, so we need to adjust to reach 16-byte alignment. + assert(ctx->cipher->ctx_size == + sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING); + + char *ptr = ctx->cipher_data; +#if defined(OPENSSL_32_BIT) + assert((uintptr_t)ptr % 4 == 0); + ptr += (uintptr_t)ptr & 4; +#endif + assert((uintptr_t)ptr % 8 == 0); + ptr += (uintptr_t)ptr & 8; + return (EVP_AES_GCM_CTX *)ptr; +} + +static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, + const uint8_t *iv, int enc) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(ctx); + if (!iv && !key) { + return 1; + } + if (key) { + OPENSSL_memset(&gctx->gcm, 0, sizeof(gctx->gcm)); + gctx->ctr = aes_ctr_set_key(&gctx->ks.ks, &gctx->gcm.gcm_key, NULL, key, + ctx->key_len); + // If we have an iv can set it directly, otherwise use saved IV. + if (iv == NULL && gctx->iv_set) { + iv = gctx->iv; + } + if (iv) { + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); + gctx->iv_set = 1; + } + gctx->key_set = 1; + } else { + // If key set use IV, otherwise copy + if (gctx->key_set) { + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, iv, gctx->ivlen); + } else { + OPENSSL_memcpy(gctx->iv, iv, gctx->ivlen); + } + gctx->iv_set = 1; + gctx->iv_gen = 0; + } + return 1; +} + +static void aes_gcm_cleanup(EVP_CIPHER_CTX *c) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(c); + OPENSSL_cleanse(&gctx->gcm, sizeof(gctx->gcm)); + if (gctx->iv != c->iv) { + OPENSSL_free(gctx->iv); + } +} + +// increment counter (64-bit int) by 1 +static void ctr64_inc(uint8_t *counter) { + int n = 8; + uint8_t c; + + do { + --n; + c = counter[n]; + ++c; + counter[n] = c; + if (c) { + return; + } + } while (n); +} + +static int aes_gcm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(c); + switch (type) { + case EVP_CTRL_INIT: + gctx->key_set = 0; + gctx->iv_set = 0; + gctx->ivlen = c->cipher->iv_len; + gctx->iv = c->iv; + gctx->taglen = -1; + gctx->iv_gen = 0; + return 1; + + case EVP_CTRL_AEAD_SET_IVLEN: + if (arg <= 0) { + return 0; + } + + // Allocate memory for IV if needed + if (arg > EVP_MAX_IV_LENGTH && arg > gctx->ivlen) { + if (gctx->iv != c->iv) { + OPENSSL_free(gctx->iv); + } + gctx->iv = OPENSSL_malloc(arg); + if (!gctx->iv) { + return 0; + } + } + gctx->ivlen = arg; + return 1; + + case EVP_CTRL_AEAD_SET_TAG: + if (arg <= 0 || arg > 16 || c->encrypt) { + return 0; + } + OPENSSL_memcpy(c->buf, ptr, arg); + gctx->taglen = arg; + return 1; + + case EVP_CTRL_AEAD_GET_TAG: + if (arg <= 0 || arg > 16 || !c->encrypt || gctx->taglen < 0) { + return 0; + } + OPENSSL_memcpy(ptr, c->buf, arg); + return 1; + + case EVP_CTRL_AEAD_SET_IV_FIXED: + // Special case: -1 length restores whole IV + if (arg == -1) { + OPENSSL_memcpy(gctx->iv, ptr, gctx->ivlen); + gctx->iv_gen = 1; + return 1; + } + // Fixed field must be at least 4 bytes and invocation field + // at least 8. + if (arg < 4 || (gctx->ivlen - arg) < 8) { + return 0; + } + if (arg) { + OPENSSL_memcpy(gctx->iv, ptr, arg); + } + if (c->encrypt && !RAND_bytes(gctx->iv + arg, gctx->ivlen - arg)) { + return 0; + } + gctx->iv_gen = 1; + return 1; + + case EVP_CTRL_GCM_IV_GEN: + if (gctx->iv_gen == 0 || gctx->key_set == 0) { + return 0; + } + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); + if (arg <= 0 || arg > gctx->ivlen) { + arg = gctx->ivlen; + } + OPENSSL_memcpy(ptr, gctx->iv + gctx->ivlen - arg, arg); + // Invocation field will be at least 8 bytes in size and + // so no need to check wrap around or increment more than + // last 8 bytes. + ctr64_inc(gctx->iv + gctx->ivlen - 8); + gctx->iv_set = 1; + return 1; + + case EVP_CTRL_GCM_SET_IV_INV: + if (gctx->iv_gen == 0 || gctx->key_set == 0 || c->encrypt) { + return 0; + } + OPENSSL_memcpy(gctx->iv + gctx->ivlen - arg, ptr, arg); + CRYPTO_gcm128_setiv(&gctx->gcm, &gctx->ks.ks, gctx->iv, gctx->ivlen); + gctx->iv_set = 1; + return 1; + + case EVP_CTRL_COPY: { + EVP_CIPHER_CTX *out = ptr; + EVP_AES_GCM_CTX *gctx_out = aes_gcm_from_cipher_ctx(out); + // |EVP_CIPHER_CTX_copy| copies this generically, but we must redo it in + // case |out->cipher_data| and |in->cipher_data| are differently aligned. + OPENSSL_memcpy(gctx_out, gctx, sizeof(EVP_AES_GCM_CTX)); + if (gctx->iv == c->iv) { + gctx_out->iv = out->iv; + } else { + gctx_out->iv = OPENSSL_malloc(gctx->ivlen); + if (!gctx_out->iv) { + return 0; + } + OPENSSL_memcpy(gctx_out->iv, gctx->iv, gctx->ivlen); + } + return 1; + } + + default: + return -1; + } +} + +static int aes_gcm_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t len) { + EVP_AES_GCM_CTX *gctx = aes_gcm_from_cipher_ctx(ctx); + + // If not set up, return error + if (!gctx->key_set) { + return -1; + } + if (!gctx->iv_set) { + return -1; + } + + if (in) { + if (out == NULL) { + if (!CRYPTO_gcm128_aad(&gctx->gcm, in, len)) { + return -1; + } + } else if (ctx->encrypt) { + if (gctx->ctr) { + if (!CRYPTO_gcm128_encrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, + gctx->ctr)) { + return -1; + } + } else { + if (!CRYPTO_gcm128_encrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { + return -1; + } + } + } else { + if (gctx->ctr) { + if (!CRYPTO_gcm128_decrypt_ctr32(&gctx->gcm, &gctx->ks.ks, in, out, len, + gctx->ctr)) { + return -1; + } + } else { + if (!CRYPTO_gcm128_decrypt(&gctx->gcm, &gctx->ks.ks, in, out, len)) { + return -1; + } + } + } + return len; + } else { + if (!ctx->encrypt) { + if (gctx->taglen < 0 || + !CRYPTO_gcm128_finish(&gctx->gcm, ctx->buf, gctx->taglen)) { + return -1; + } + gctx->iv_set = 0; + return 0; + } + CRYPTO_gcm128_tag(&gctx->gcm, ctx->buf, 16); + gctx->taglen = 16; + // Don't reuse the IV + gctx->iv_set = 0; + return 0; + } +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_cbc_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_cbc; + out->block_size = 16; + out->key_len = 16; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = aes_init_key; + out->cipher = aes_cbc_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ctr_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ctr; + out->block_size = 1; + out->key_len = 16; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CTR_MODE; + out->init = aes_init_key; + out->cipher = aes_ctr_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ecb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ecb; + out->block_size = 16; + out->key_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_ofb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ofb128; + out->block_size = 1; + out->key_len = 16; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_OFB_MODE; + out->init = aes_init_key; + out->cipher = aes_ofb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_128_gcm_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_gcm; + out->block_size = 1; + out->key_len = 16; + out->iv_len = 12; + out->ctx_size = sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING; + out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_CUSTOM_COPY | + EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | + EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; + out->init = aes_gcm_init_key; + out->cipher = aes_gcm_cipher; + out->cleanup = aes_gcm_cleanup; + out->ctrl = aes_gcm_ctrl; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_cbc_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_cbc; + out->block_size = 16; + out->key_len = 24; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = aes_init_key; + out->cipher = aes_cbc_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ctr_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ctr; + out->block_size = 1; + out->key_len = 24; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CTR_MODE; + out->init = aes_init_key; + out->cipher = aes_ctr_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ecb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ecb; + out->block_size = 16; + out->key_len = 24; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_ofb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ofb128; + out->block_size = 1; + out->key_len = 24; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_OFB_MODE; + out->init = aes_init_key; + out->cipher = aes_ofb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_192_gcm_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_gcm; + out->block_size = 1; + out->key_len = 24; + out->iv_len = 12; + out->ctx_size = sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING; + out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_CUSTOM_COPY | + EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | + EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; + out->init = aes_gcm_init_key; + out->cipher = aes_gcm_cipher; + out->cleanup = aes_gcm_cleanup; + out->ctrl = aes_gcm_ctrl; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_cbc_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_cbc; + out->block_size = 16; + out->key_len = 32; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CBC_MODE; + out->init = aes_init_key; + out->cipher = aes_cbc_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ctr_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ctr; + out->block_size = 1; + out->key_len = 32; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_CTR_MODE; + out->init = aes_init_key; + out->cipher = aes_ctr_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ecb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ecb; + out->block_size = 16; + out->key_len = 32; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_ofb_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ofb128; + out->block_size = 1; + out->key_len = 32; + out->iv_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_OFB_MODE; + out->init = aes_init_key; + out->cipher = aes_ofb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_256_gcm_generic) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_gcm; + out->block_size = 1; + out->key_len = 32; + out->iv_len = 12; + out->ctx_size = sizeof(EVP_AES_GCM_CTX) + EVP_AES_GCM_CTX_PADDING; + out->flags = EVP_CIPH_GCM_MODE | EVP_CIPH_CUSTOM_IV | EVP_CIPH_CUSTOM_COPY | + EVP_CIPH_FLAG_CUSTOM_CIPHER | EVP_CIPH_ALWAYS_CALL_INIT | + EVP_CIPH_CTRL_INIT | EVP_CIPH_FLAG_AEAD_CIPHER; + out->init = aes_gcm_init_key; + out->cipher = aes_gcm_cipher; + out->cleanup = aes_gcm_cleanup; + out->ctrl = aes_gcm_ctrl; +} + +#if defined(HWAES_ECB) + +static int aes_hw_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t len) { + size_t bl = ctx->cipher->block_size; + + if (len < bl) { + return 1; + } + + aes_hw_ecb_encrypt(in, out, len, ctx->cipher_data, ctx->encrypt); + + return 1; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_hw_128_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_128_ecb; + out->block_size = 16; + out->key_len = 16; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_hw_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_hw_192_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_192_ecb; + out->block_size = 16; + out->key_len = 24; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_hw_ecb_cipher; +} + +DEFINE_LOCAL_DATA(EVP_CIPHER, aes_hw_256_ecb) { + memset(out, 0, sizeof(EVP_CIPHER)); + + out->nid = NID_aes_256_ecb; + out->block_size = 16; + out->key_len = 32; + out->ctx_size = sizeof(EVP_AES_KEY); + out->flags = EVP_CIPH_ECB_MODE; + out->init = aes_init_key; + out->cipher = aes_hw_ecb_cipher; +} + +#define EVP_ECB_CIPHER_FUNCTION(keybits) \ + const EVP_CIPHER *EVP_aes_##keybits##_ecb(void) { \ + if (hwaes_capable()) { \ + return aes_hw_##keybits##_ecb(); \ + } \ + return aes_##keybits##_ecb_generic(); \ + } + +#else + +#define EVP_ECB_CIPHER_FUNCTION(keybits) \ + const EVP_CIPHER *EVP_aes_##keybits##_ecb(void) { \ + return aes_##keybits##_ecb_generic(); \ + } + +#endif // HWAES_ECB + +#define EVP_CIPHER_FUNCTION(keybits, mode) \ + const EVP_CIPHER *EVP_aes_##keybits##_##mode(void) { \ + return aes_##keybits##_##mode##_generic(); \ + } + +EVP_CIPHER_FUNCTION(128, cbc) +EVP_CIPHER_FUNCTION(128, ctr) +EVP_CIPHER_FUNCTION(128, ofb) +EVP_CIPHER_FUNCTION(128, gcm) + +EVP_CIPHER_FUNCTION(192, cbc) +EVP_CIPHER_FUNCTION(192, ctr) +EVP_CIPHER_FUNCTION(192, ofb) +EVP_CIPHER_FUNCTION(192, gcm) + +EVP_CIPHER_FUNCTION(256, cbc) +EVP_CIPHER_FUNCTION(256, ctr) +EVP_CIPHER_FUNCTION(256, ofb) +EVP_CIPHER_FUNCTION(256, gcm) + +EVP_ECB_CIPHER_FUNCTION(128) +EVP_ECB_CIPHER_FUNCTION(192) +EVP_ECB_CIPHER_FUNCTION(256) + + +#define EVP_AEAD_AES_GCM_TAG_LEN 16 + +struct aead_aes_gcm_ctx { + union { + double align; + AES_KEY ks; + } ks; + GCM128_KEY gcm_key; + ctr128_f ctr; +}; + +static int aead_aes_gcm_init_impl(struct aead_aes_gcm_ctx *gcm_ctx, + size_t *out_tag_len, const uint8_t *key, + size_t key_len, size_t tag_len) { + const size_t key_bits = key_len * 8; + + if (key_bits != 128 && key_bits != 192 && key_bits != 256) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_KEY_LENGTH); + return 0; // EVP_AEAD_CTX_init should catch this. + } + + if (tag_len == EVP_AEAD_DEFAULT_TAG_LENGTH) { + tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + } + + if (tag_len > EVP_AEAD_AES_GCM_TAG_LEN) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TAG_TOO_LARGE); + return 0; + } + + gcm_ctx->ctr = + aes_ctr_set_key(&gcm_ctx->ks.ks, &gcm_ctx->gcm_key, NULL, key, key_len); + *out_tag_len = tag_len; + return 1; +} + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_gcm_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t requested_tag_len) { + struct aead_aes_gcm_ctx *gcm_ctx = (struct aead_aes_gcm_ctx *) &ctx->state; + + size_t actual_tag_len; + if (!aead_aes_gcm_init_impl(gcm_ctx, &actual_tag_len, key, key_len, + requested_tag_len)) { + return 0; + } + + ctx->tag_len = actual_tag_len; + return 1; +} + +static void aead_aes_gcm_cleanup(EVP_AEAD_CTX *ctx) {} + +static int aead_aes_gcm_seal_scatter(const EVP_AEAD_CTX *ctx, uint8_t *out, + uint8_t *out_tag, size_t *out_tag_len, + size_t max_out_tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *extra_in, + size_t extra_in_len, + const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_ctx *gcm_ctx = (struct aead_aes_gcm_ctx *) &ctx->state; + + if (extra_in_len + ctx->tag_len < ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_TOO_LARGE); + return 0; + } + if (max_out_tag_len < extra_in_len + ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BUFFER_TOO_SMALL); + return 0; + } + if (nonce_len == 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + const AES_KEY *key = &gcm_ctx->ks.ks; + + GCM128_CONTEXT gcm; + OPENSSL_memset(&gcm, 0, sizeof(gcm)); + OPENSSL_memcpy(&gcm.gcm_key, &gcm_ctx->gcm_key, sizeof(gcm.gcm_key)); + CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); + + if (ad_len > 0 && !CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { + return 0; + } + + if (gcm_ctx->ctr) { + if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, in, out, in_len, + gcm_ctx->ctr)) { + return 0; + } + } else { + if (!CRYPTO_gcm128_encrypt(&gcm, key, in, out, in_len)) { + return 0; + } + } + + if (extra_in_len) { + if (gcm_ctx->ctr) { + if (!CRYPTO_gcm128_encrypt_ctr32(&gcm, key, extra_in, out_tag, + extra_in_len, gcm_ctx->ctr)) { + return 0; + } + } else { + if (!CRYPTO_gcm128_encrypt(&gcm, key, extra_in, out_tag, extra_in_len)) { + return 0; + } + } + } + + CRYPTO_gcm128_tag(&gcm, out_tag + extra_in_len, ctx->tag_len); + *out_tag_len = ctx->tag_len + extra_in_len; + + return 1; +} + +static int aead_aes_gcm_open_gather(const EVP_AEAD_CTX *ctx, uint8_t *out, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *in_tag, size_t in_tag_len, + const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_ctx *gcm_ctx = (struct aead_aes_gcm_ctx *) &ctx->state; + uint8_t tag[EVP_AEAD_AES_GCM_TAG_LEN]; + + if (nonce_len == 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE_SIZE); + return 0; + } + + if (in_tag_len != ctx->tag_len) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + const AES_KEY *key = &gcm_ctx->ks.ks; + + GCM128_CONTEXT gcm; + OPENSSL_memset(&gcm, 0, sizeof(gcm)); + OPENSSL_memcpy(&gcm.gcm_key, &gcm_ctx->gcm_key, sizeof(gcm.gcm_key)); + CRYPTO_gcm128_setiv(&gcm, key, nonce, nonce_len); + + if (!CRYPTO_gcm128_aad(&gcm, ad, ad_len)) { + return 0; + } + + if (gcm_ctx->ctr) { + if (!CRYPTO_gcm128_decrypt_ctr32(&gcm, key, in, out, in_len, + gcm_ctx->ctr)) { + return 0; + } + } else { + if (!CRYPTO_gcm128_decrypt(&gcm, key, in, out, in_len)) { + return 0; + } + } + + CRYPTO_gcm128_tag(&gcm, tag, ctx->tag_len); + if (CRYPTO_memcmp(tag, in_tag, ctx->tag_len) != 0) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_BAD_DECRYPT); + return 0; + } + + return 1; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 16; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_192_gcm) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 24; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 32; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +struct aead_aes_gcm_tls12_ctx { + struct aead_aes_gcm_ctx gcm_ctx; + uint64_t min_next_nonce; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_tls12_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_tls12_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_gcm_tls12_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t requested_tag_len) { + struct aead_aes_gcm_tls12_ctx *gcm_ctx = + (struct aead_aes_gcm_tls12_ctx *) &ctx->state; + + gcm_ctx->min_next_nonce = 0; + + size_t actual_tag_len; + if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len, + requested_tag_len)) { + return 0; + } + + ctx->tag_len = actual_tag_len; + return 1; +} + +static int aead_aes_gcm_tls12_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_tls12_ctx *gcm_ctx = + (struct aead_aes_gcm_tls12_ctx *) &ctx->state; + + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + // The given nonces must be strictly monotonically increasing. + uint64_t given_counter; + OPENSSL_memcpy(&given_counter, nonce + nonce_len - sizeof(given_counter), + sizeof(given_counter)); + given_counter = CRYPTO_bswap8(given_counter); + if (given_counter == UINT64_MAX || + given_counter < gcm_ctx->min_next_nonce) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE); + return 0; + } + + gcm_ctx->min_next_nonce = given_counter + 1; + + return aead_aes_gcm_seal_scatter(ctx, out, out_tag, out_tag_len, + max_out_tag_len, nonce, nonce_len, in, + in_len, extra_in, extra_in_len, ad, ad_len); +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm_tls12) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 16; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls12_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm_tls12) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 32; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls12_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls12_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +struct aead_aes_gcm_tls13_ctx { + struct aead_aes_gcm_ctx gcm_ctx; + uint64_t min_next_nonce; + uint64_t mask; + uint8_t first; +}; + +OPENSSL_STATIC_ASSERT(sizeof(((EVP_AEAD_CTX *)NULL)->state) >= + sizeof(struct aead_aes_gcm_tls13_ctx), + "AEAD state is too small"); +#if defined(__GNUC__) || defined(__clang__) +OPENSSL_STATIC_ASSERT(alignof(union evp_aead_ctx_st_state) >= + alignof(struct aead_aes_gcm_tls13_ctx), + "AEAD state has insufficient alignment"); +#endif + +static int aead_aes_gcm_tls13_init(EVP_AEAD_CTX *ctx, const uint8_t *key, + size_t key_len, size_t requested_tag_len) { + struct aead_aes_gcm_tls13_ctx *gcm_ctx = + (struct aead_aes_gcm_tls13_ctx *) &ctx->state; + + gcm_ctx->min_next_nonce = 0; + gcm_ctx->first = 1; + + size_t actual_tag_len; + if (!aead_aes_gcm_init_impl(&gcm_ctx->gcm_ctx, &actual_tag_len, key, key_len, + requested_tag_len)) { + return 0; + } + + ctx->tag_len = actual_tag_len; + return 1; +} + +static int aead_aes_gcm_tls13_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len) { + struct aead_aes_gcm_tls13_ctx *gcm_ctx = + (struct aead_aes_gcm_tls13_ctx *) &ctx->state; + + if (nonce_len != 12) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_UNSUPPORTED_NONCE_SIZE); + return 0; + } + + // The given nonces must be strictly monotonically increasing. See + // https://tools.ietf.org/html/rfc8446#section-5.3 for details of the TLS 1.3 + // nonce construction. + uint64_t given_counter; + OPENSSL_memcpy(&given_counter, nonce + nonce_len - sizeof(given_counter), + sizeof(given_counter)); + given_counter = CRYPTO_bswap8(given_counter); + + if (gcm_ctx->first) { + // In the first call the sequence number will be zero and therefore the + // given nonce will be 0 ^ mask = mask. + gcm_ctx->mask = given_counter; + gcm_ctx->first = 0; + } + given_counter ^= gcm_ctx->mask; + + if (given_counter == UINT64_MAX || + given_counter < gcm_ctx->min_next_nonce) { + OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INVALID_NONCE); + return 0; + } + + gcm_ctx->min_next_nonce = given_counter + 1; + + return aead_aes_gcm_seal_scatter(ctx, out, out_tag, out_tag_len, + max_out_tag_len, nonce, nonce_len, in, + in_len, extra_in, extra_in_len, ad, ad_len); +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_128_gcm_tls13) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 16; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls13_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls13_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +DEFINE_METHOD_FUNCTION(EVP_AEAD, EVP_aead_aes_256_gcm_tls13) { + memset(out, 0, sizeof(EVP_AEAD)); + + out->key_len = 32; + out->nonce_len = 12; + out->overhead = EVP_AEAD_AES_GCM_TAG_LEN; + out->max_tag_len = EVP_AEAD_AES_GCM_TAG_LEN; + out->seal_scatter_supports_extra_in = 1; + + out->init = aead_aes_gcm_tls13_init; + out->cleanup = aead_aes_gcm_cleanup; + out->seal_scatter = aead_aes_gcm_tls13_seal_scatter; + out->open_gather = aead_aes_gcm_open_gather; +} + +int EVP_has_aes_hardware(void) { +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) + return hwaes_capable() && crypto_gcm_clmul_enabled(); +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + return hwaes_capable() && CRYPTO_is_ARMv8_PMULL_capable(); +#elif defined(OPENSSL_PPC64LE) + return CRYPTO_is_PPC64LE_vcrypto_capable(); +#else + return 0; +#endif +} + +OPENSSL_MSVC_PRAGMA(warning(pop)) diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_des.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_des.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c index 0ccdb5017..2aaefbc75 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_des.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c @@ -231,3 +231,7 @@ DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede3) { out->init = des_ede3_init_key; out->cipher = des_ede_ecb_cipher; } + +const EVP_CIPHER* EVP_des_ede3_ecb(void) { + return EVP_des_ede3(); +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_des.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_des.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c.grpc_back index eaba6d7ae..e77363b5e 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/cipher/e_des.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/e_des.c.grpc_back @@ -231,3 +231,7 @@ DEFINE_METHOD_FUNCTION(EVP_CIPHER, EVP_des_ede3) { out->init = des_ede3_init_key; out->cipher = des_ede_ecb_cipher; } + +const EVP_CIPHER* EVP_des_ede3_ecb(void) { + return EVP_des_ede3(); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h new file mode 100644 index 000000000..6d0160e6f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h @@ -0,0 +1,128 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_CIPHER_INTERNAL_H +#define OPENSSL_HEADER_CIPHER_INTERNAL_H + +#include + +#include +#include + +#include "../../internal.h" +#include "../modes/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// EVP_CIPH_MODE_MASK contains the bits of |flags| that represent the mode. +#define EVP_CIPH_MODE_MASK 0x3f + +// EVP_AEAD represents a specific AEAD algorithm. +struct evp_aead_st { + uint8_t key_len; + uint8_t nonce_len; + uint8_t overhead; + uint8_t max_tag_len; + int seal_scatter_supports_extra_in; + + // init initialises an |EVP_AEAD_CTX|. If this call returns zero then + // |cleanup| will not be called for that context. + int (*init)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, + size_t tag_len); + int (*init_with_direction)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, + size_t tag_len, enum evp_aead_direction_t dir); + void (*cleanup)(EVP_AEAD_CTX *); + + int (*open)(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, + size_t max_out_len, const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, const uint8_t *ad, + size_t ad_len); + + int (*seal_scatter)(const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, + const uint8_t *nonce, size_t nonce_len, const uint8_t *in, + size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len); + + int (*open_gather)(const EVP_AEAD_CTX *ctx, uint8_t *out, + const uint8_t *nonce, size_t nonce_len, const uint8_t *in, + size_t in_len, const uint8_t *in_tag, size_t in_tag_len, + const uint8_t *ad, size_t ad_len); + + int (*get_iv)(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, + size_t *out_len); + + size_t (*tag_len)(const EVP_AEAD_CTX *ctx, size_t in_Len, + size_t extra_in_len); +}; + +// aes_ctr_set_key initialises |*aes_key| using |key_bytes| bytes from |key|, +// where |key_bytes| must either be 16, 24 or 32. If not NULL, |*out_block| is +// set to a function that encrypts single blocks. If not NULL, |*gcm_key| is +// initialised to do GHASH with the given key. It returns a function for +// optimised CTR-mode, or NULL if CTR-mode should be built using |*out_block|. +ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_KEY *gcm_key, + block128_f *out_block, const uint8_t *key, + size_t key_bytes); + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CIPHER_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h.grpc_back new file mode 100644 index 000000000..68efe33d4 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/cipher/internal.h.grpc_back @@ -0,0 +1,128 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_CIPHER_INTERNAL_H +#define OPENSSL_HEADER_CIPHER_INTERNAL_H + +#include + +#include +#include + +#include "../../internal.h" +#include "../modes/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// EVP_CIPH_MODE_MASK contains the bits of |flags| that represent the mode. +#define EVP_CIPH_MODE_MASK 0x3f + +// EVP_AEAD represents a specific AEAD algorithm. +struct evp_aead_st { + uint8_t key_len; + uint8_t nonce_len; + uint8_t overhead; + uint8_t max_tag_len; + int seal_scatter_supports_extra_in; + + // init initialises an |EVP_AEAD_CTX|. If this call returns zero then + // |cleanup| will not be called for that context. + int (*init)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, + size_t tag_len); + int (*init_with_direction)(EVP_AEAD_CTX *, const uint8_t *key, size_t key_len, + size_t tag_len, enum evp_aead_direction_t dir); + void (*cleanup)(EVP_AEAD_CTX *); + + int (*open)(const EVP_AEAD_CTX *ctx, uint8_t *out, size_t *out_len, + size_t max_out_len, const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, const uint8_t *ad, + size_t ad_len); + + int (*seal_scatter)(const EVP_AEAD_CTX *ctx, uint8_t *out, uint8_t *out_tag, + size_t *out_tag_len, size_t max_out_tag_len, + const uint8_t *nonce, size_t nonce_len, const uint8_t *in, + size_t in_len, const uint8_t *extra_in, + size_t extra_in_len, const uint8_t *ad, size_t ad_len); + + int (*open_gather)(const EVP_AEAD_CTX *ctx, uint8_t *out, + const uint8_t *nonce, size_t nonce_len, const uint8_t *in, + size_t in_len, const uint8_t *in_tag, size_t in_tag_len, + const uint8_t *ad, size_t ad_len); + + int (*get_iv)(const EVP_AEAD_CTX *ctx, const uint8_t **out_iv, + size_t *out_len); + + size_t (*tag_len)(const EVP_AEAD_CTX *ctx, size_t in_Len, + size_t extra_in_len); +}; + +// aes_ctr_set_key initialises |*aes_key| using |key_bytes| bytes from |key|, +// where |key_bytes| must either be 16, 24 or 32. If not NULL, |*out_block| is +// set to a function that encrypts single blocks. If not NULL, |*gcm_key| is +// initialised to do GHASH with the given key. It returns a function for +// optimised CTR-mode, or NULL if CTR-mode should be built using |*out_block|. +ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_KEY *gcm_key, + block128_f *out_block, const uint8_t *key, + size_t key_bytes); + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CIPHER_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/delocate.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/delocate.h rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h index 66f9527bb..06f3c4821 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/delocate.h +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h @@ -20,10 +20,11 @@ #include "../internal.h" -#if defined(BORINGSSL_FIPS) && !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN) +#if !defined(BORINGSSL_SHARED_LIBRARY) && defined(BORINGSSL_FIPS) && \ + !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN) #define DEFINE_BSS_GET(type, name) \ static type name __attribute__((used)); \ - type *name##_bss_get(void); + type *name##_bss_get(void) __attribute__((const)); // For FIPS builds we require that CRYPTO_ONCE_INIT be zero. #define DEFINE_STATIC_ONCE(name) DEFINE_BSS_GET(CRYPTO_once_t, name) // For FIPS builds we require that CRYPTO_STATIC_MUTEX_INIT be zero. diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/delocate.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/delocate.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h.grpc_back index 065a21ca4..d6564e487 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/delocate.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/delocate.h.grpc_back @@ -20,10 +20,11 @@ #include "../internal.h" -#if defined(BORINGSSL_FIPS) && !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN) +#if !defined(BORINGSSL_SHARED_LIBRARY) && defined(BORINGSSL_FIPS) && \ + !defined(OPENSSL_ASAN) && !defined(OPENSSL_MSAN) #define DEFINE_BSS_GET(type, name) \ static type name __attribute__((used)); \ - type *name##_bss_get(void); + type *name##_bss_get(void) __attribute__((const)); // For FIPS builds we require that CRYPTO_ONCE_INIT be zero. #define DEFINE_STATIC_ONCE(name) DEFINE_BSS_GET(CRYPTO_once_t, name) // For FIPS builds we require that CRYPTO_STATIC_MUTEX_INIT be zero. diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/des/des.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/des/des.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/des/des.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/des/des.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/des.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/des/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/des/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/des/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/des/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/des/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digest.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digest.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c index d28ba44d0..4bae3f476 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digest.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c @@ -115,8 +115,17 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) { void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) { EVP_MD_CTX_free(ctx); } +int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out, size_t len) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; +} + +uint32_t EVP_MD_meth_get_flags(const EVP_MD *md) { return EVP_MD_flags(md); } + int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) { - if (in == NULL || in->digest == NULL) { + // |in->digest| may be NULL if this is a signing |EVP_MD_CTX| for, e.g., + // Ed25519 which does not hash with |EVP_MD_CTX|. + if (in == NULL || (in->pctx == NULL && in->digest == NULL)) { OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_INPUT_NOT_INITIALIZED); return 0; } @@ -131,29 +140,34 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) { } } - uint8_t *tmp_buf; - if (out->digest != in->digest) { - assert(in->digest->ctx_size != 0); - tmp_buf = OPENSSL_malloc(in->digest->ctx_size); - if (tmp_buf == NULL) { - if (pctx) { - in->pctx_ops->free(pctx); + uint8_t *tmp_buf = NULL; + if (in->digest != NULL) { + if (out->digest != in->digest) { + assert(in->digest->ctx_size != 0); + tmp_buf = OPENSSL_malloc(in->digest->ctx_size); + if (tmp_buf == NULL) { + if (pctx) { + in->pctx_ops->free(pctx); + } + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; } - OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); - return 0; + } else { + // |md_data| will be the correct size in this case. It's removed from + // |out| so that |EVP_MD_CTX_cleanup| doesn't free it, and then it's + // reused. + tmp_buf = out->md_data; + out->md_data = NULL; } - } else { - // |md_data| will be the correct size in this case. It's removed from |out| - // so that |EVP_MD_CTX_cleanup| doesn't free it, and then it's reused. - tmp_buf = out->md_data; - out->md_data = NULL; } EVP_MD_CTX_cleanup(out); out->digest = in->digest; out->md_data = tmp_buf; - OPENSSL_memcpy(out->md_data, in->md_data, in->digest->ctx_size); + if (in->digest != NULL) { + OPENSSL_memcpy(out->md_data, in->md_data, in->digest->ctx_size); + } out->pctx = pctx; out->pctx_ops = in->pctx_ops; assert(out->pctx == NULL || out->pctx_ops != NULL); @@ -166,9 +180,10 @@ int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) { return EVP_MD_CTX_copy_ex(out, in); } -void EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { +int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { EVP_MD_CTX_cleanup(ctx); EVP_MD_CTX_init(ctx); + return 1; } int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine) { diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digest.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c.grpc_back similarity index 85% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digest.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c.grpc_back index 1c35809fe..a0b3bf508 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digest.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digest.c.grpc_back @@ -115,8 +115,17 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) { void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx) { EVP_MD_CTX_free(ctx); } +int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out, size_t len) { + OPENSSL_PUT_ERROR(DIGEST, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; +} + +uint32_t EVP_MD_meth_get_flags(const EVP_MD *md) { return EVP_MD_flags(md); } + int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) { - if (in == NULL || in->digest == NULL) { + // |in->digest| may be NULL if this is a signing |EVP_MD_CTX| for, e.g., + // Ed25519 which does not hash with |EVP_MD_CTX|. + if (in == NULL || (in->pctx == NULL && in->digest == NULL)) { OPENSSL_PUT_ERROR(DIGEST, DIGEST_R_INPUT_NOT_INITIALIZED); return 0; } @@ -131,29 +140,34 @@ int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in) { } } - uint8_t *tmp_buf; - if (out->digest != in->digest) { - assert(in->digest->ctx_size != 0); - tmp_buf = OPENSSL_malloc(in->digest->ctx_size); - if (tmp_buf == NULL) { - if (pctx) { - in->pctx_ops->free(pctx); + uint8_t *tmp_buf = NULL; + if (in->digest != NULL) { + if (out->digest != in->digest) { + assert(in->digest->ctx_size != 0); + tmp_buf = OPENSSL_malloc(in->digest->ctx_size); + if (tmp_buf == NULL) { + if (pctx) { + in->pctx_ops->free(pctx); + } + OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); + return 0; } - OPENSSL_PUT_ERROR(DIGEST, ERR_R_MALLOC_FAILURE); - return 0; + } else { + // |md_data| will be the correct size in this case. It's removed from + // |out| so that |EVP_MD_CTX_cleanup| doesn't free it, and then it's + // reused. + tmp_buf = out->md_data; + out->md_data = NULL; } - } else { - // |md_data| will be the correct size in this case. It's removed from |out| - // so that |EVP_MD_CTX_cleanup| doesn't free it, and then it's reused. - tmp_buf = out->md_data; - out->md_data = NULL; } EVP_MD_CTX_cleanup(out); out->digest = in->digest; out->md_data = tmp_buf; - OPENSSL_memcpy(out->md_data, in->md_data, in->digest->ctx_size); + if (in->digest != NULL) { + OPENSSL_memcpy(out->md_data, in->md_data, in->digest->ctx_size); + } out->pctx = pctx; out->pctx_ops = in->pctx_ops; assert(out->pctx == NULL || out->pctx_ops != NULL); @@ -166,9 +180,10 @@ int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) { return EVP_MD_CTX_copy_ex(out, in); } -void EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { +int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { EVP_MD_CTX_cleanup(ctx); EVP_MD_CTX_init(ctx); + return 1; } int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine) { diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digests.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digests.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digests.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/digests.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/digests.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/md32_common.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/md32_common.h rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h index b187e853c..fc325d99d 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/md32_common.h +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h @@ -223,12 +223,12 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) { } -void HASH_TRANSFORM(HASH_CTX *c, const uint8_t *data) { +void HASH_TRANSFORM(HASH_CTX *c, const uint8_t data[HASH_CBLOCK]) { HASH_BLOCK_DATA_ORDER(c->h, data, 1); } -int HASH_FINAL(uint8_t *md, HASH_CTX *c) { +int HASH_FINAL(uint8_t out[HASH_DIGEST_LENGTH], HASH_CTX *c) { // |c->data| always has room for at least one byte. A full block would have // been consumed. size_t n = c->num; @@ -258,7 +258,7 @@ int HASH_FINAL(uint8_t *md, HASH_CTX *c) { c->num = 0; OPENSSL_memset(c->data, 0, HASH_CBLOCK); - HASH_MAKE_STRING(c, md); + HASH_MAKE_STRING(c, out); return 1; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/md32_common.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/md32_common.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h.grpc_back index a0c3665d5..07d39d9df 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/digest/md32_common.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/digest/md32_common.h.grpc_back @@ -223,12 +223,12 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) { } -void HASH_TRANSFORM(HASH_CTX *c, const uint8_t *data) { +void HASH_TRANSFORM(HASH_CTX *c, const uint8_t data[HASH_CBLOCK]) { HASH_BLOCK_DATA_ORDER(c->h, data, 1); } -int HASH_FINAL(uint8_t *md, HASH_CTX *c) { +int HASH_FINAL(uint8_t out[HASH_DIGEST_LENGTH], HASH_CTX *c) { // |c->data| always has room for at least one byte. A full block would have // been consumed. size_t n = c->num; @@ -258,7 +258,7 @@ int HASH_FINAL(uint8_t *md, HASH_CTX *c) { c->num = 0; OPENSSL_memset(c->data, 0, HASH_CBLOCK); - HASH_MAKE_STRING(c, md); + HASH_MAKE_STRING(c, out); return 1; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c similarity index 78% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c index 50b7dcf34..9ccdb3318 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c @@ -316,7 +316,7 @@ static void ec_group_set0_generator(EC_GROUP *group, EC_POINT *generator) { EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { - if (BN_num_bytes(p) > EC_MAX_SCALAR_BYTES) { + if (BN_num_bytes(p) > EC_MAX_BYTES) { OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); return NULL; } @@ -344,15 +344,14 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, generator->group != group) { // |EC_GROUP_set_generator| may only be used with |EC_GROUP|s returned by // |EC_GROUP_new_curve_GFp| and may only used once on each group. - // Additionally, |generator| must been created from - // |EC_GROUP_new_curve_GFp|, not a copy, so that - // |generator->group->generator| is set correctly. + // |generator| must have been created from |EC_GROUP_new_curve_GFp|, not a + // copy, so that |generator->group->generator| is set correctly. OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (BN_num_bytes(order) > EC_MAX_SCALAR_BYTES) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); + if (BN_num_bytes(order) > EC_MAX_BYTES) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); return 0; } @@ -367,25 +366,23 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, // Note any curve which did not satisfy this must have been invalid or use a // tiny prime (less than 17). See the proof in |field_element_to_scalar| in // the ECDSA implementation. + int ret = 0; + EC_POINT *copy = NULL; BIGNUM *tmp = BN_new(); if (tmp == NULL || !BN_lshift1(tmp, order)) { - BN_free(tmp); - return 0; + goto err; } - int ok = BN_cmp(tmp, &group->field) > 0; - BN_free(tmp); - if (!ok) { + if (BN_cmp(tmp, &group->field) <= 0) { OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); - return 0; + goto err; } - EC_POINT *copy = EC_POINT_new(group); + copy = EC_POINT_new(group); if (copy == NULL || !EC_POINT_copy(copy, generator) || !BN_copy(&group->order, order)) { - EC_POINT_free(copy); - return 0; + goto err; } // Store the order in minimal form, so it can be used with |BN_ULONG| arrays. bn_set_minimal_width(&group->order); @@ -393,11 +390,26 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, BN_MONT_CTX_free(group->order_mont); group->order_mont = BN_MONT_CTX_new_for_modulus(&group->order, NULL); if (group->order_mont == NULL) { - return 0; + goto err; + } + + group->field_greater_than_order = BN_cmp(&group->field, &group->order) > 0; + if (group->field_greater_than_order) { + if (!BN_sub(tmp, &group->field, &group->order) || + !bn_copy_words(group->field_minus_order.words, group->field.width, + tmp)) { + goto err; + } } ec_group_set0_generator(group, copy); - return 1; + copy = NULL; + ret = 1; + +err: + EC_POINT_free(copy); + BN_free(tmp); + return ret; } static EC_GROUP *ec_group_new_from_data(const struct built_in_curve *curve) { @@ -449,6 +461,14 @@ static EC_GROUP *ec_group_new_from_data(const struct built_in_curve *curve) { goto err; } + group->field_greater_than_order = BN_cmp(&group->field, &group->order) > 0; + if (group->field_greater_than_order) { + if (!BN_sub(p, &group->field, &group->order) || + !bn_copy_words(group->field_minus_order.words, group->field.width, p)) { + goto err; + } + } + group->order_mont = BN_MONT_CTX_new_for_modulus(&group->order, ctx); if (group->order_mont == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); @@ -479,8 +499,8 @@ static EC_GROUP *ec_group_new_from_data(const struct built_in_curve *curve) { struct built_in_groups_st { EC_GROUP *groups[OPENSSL_NUM_BUILT_IN_CURVES]; }; -DEFINE_BSS_GET(struct built_in_groups_st, built_in_groups); -DEFINE_STATIC_MUTEX(built_in_groups_lock); +DEFINE_BSS_GET(struct built_in_groups_st, built_in_groups) +DEFINE_STATIC_MUTEX(built_in_groups_lock) EC_GROUP *EC_GROUP_new_by_curve_name(int nid) { struct built_in_groups_st *groups = built_in_groups_bss_get(); @@ -579,13 +599,14 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ignored) { // structure. If |a| or |b| is incomplete (due to legacy OpenSSL mistakes, // custom curve construction is sadly done in two parts) but otherwise not the // same object, we consider them always unequal. - return a->generator == NULL || + return a->meth != b->meth || + a->generator == NULL || b->generator == NULL || BN_cmp(&a->order, &b->order) != 0 || BN_cmp(&a->field, &b->field) != 0 || - BN_cmp(&a->a, &b->a) != 0 || - BN_cmp(&a->b, &b->b) != 0 || - ec_GFp_simple_cmp(a, a->generator, b->generator, NULL) != 0; + !ec_felem_equal(a, &a->a, &b->a) || + !ec_felem_equal(a, &a->b, &b->b) || + ec_GFp_simple_cmp(a, &a->generator->raw, &b->generator->raw) != 0; } const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group) { @@ -604,6 +625,10 @@ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { return 1; } +int EC_GROUP_order_bits(const EC_GROUP *group) { + return BN_num_bits(&group->order); +} + int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) { // All |EC_GROUP|s have cofactor 1. @@ -612,36 +637,59 @@ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *out_p, BIGNUM *out_a, BIGNUM *out_b, BN_CTX *ctx) { - return ec_GFp_simple_group_get_curve(group, out_p, out_a, out_b, ctx); + return ec_GFp_simple_group_get_curve(group, out_p, out_a, out_b); } int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } unsigned EC_GROUP_get_degree(const EC_GROUP *group) { - return ec_GFp_simple_group_get_degree(group); + return BN_num_bits(&group->field); } -EC_POINT *EC_POINT_new(const EC_GROUP *group) { - EC_POINT *ret; +const char *EC_curve_nid2nist(int nid) { + switch (nid) { + case NID_secp224r1: + return "P-224"; + case NID_X9_62_prime256v1: + return "P-256"; + case NID_secp384r1: + return "P-384"; + case NID_secp521r1: + return "P-521"; + } + return NULL; +} + +int EC_curve_nist2nid(const char *name) { + if (strcmp(name, "P-224") == 0) { + return NID_secp224r1; + } + if (strcmp(name, "P-256") == 0) { + return NID_X9_62_prime256v1; + } + if (strcmp(name, "P-384") == 0) { + return NID_secp384r1; + } + if (strcmp(name, "P-521") == 0) { + return NID_secp521r1; + } + return NID_undef; +} +EC_POINT *EC_POINT_new(const EC_GROUP *group) { if (group == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return NULL; } - ret = OPENSSL_malloc(sizeof *ret); + EC_POINT *ret = OPENSSL_malloc(sizeof *ret); if (ret == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); return NULL; } ret->group = EC_GROUP_dup(group); - if (ret->group == NULL || - !ec_GFp_simple_point_init(ret)) { - OPENSSL_free(ret); - return NULL; - } - + ec_GFp_simple_point_init(&ret->raw); return ret; } @@ -649,7 +697,6 @@ static void ec_point_free(EC_POINT *point, int free_group) { if (!point) { return; } - ec_GFp_simple_point_finish(point); if (free_group) { EC_GROUP_free(point->group); } @@ -670,7 +717,8 @@ int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) { if (dest == src) { return 1; } - return ec_GFp_simple_point_copy(dest, src); + ec_GFp_simple_point_copy(&dest->raw, &src->raw); + return 1; } EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { @@ -693,7 +741,8 @@ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) { OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_point_set_to_infinity(group, point); + ec_GFp_simple_point_set_to_infinity(group, &point->raw); + return 1; } int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { @@ -701,7 +750,7 @@ int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_is_at_infinity(group, point); + return ec_GFp_simple_is_at_infinity(group, &point->raw); } int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, @@ -710,7 +759,7 @@ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_is_on_curve(group, point, ctx); + return ec_GFp_simple_is_on_curve(group, &point->raw); } int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, @@ -720,26 +769,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return -1; } - return ec_GFp_simple_cmp(group, a, b, ctx); -} - -int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { - if (EC_GROUP_cmp(group, point->group, NULL) != 0) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); - return 0; - } - return ec_GFp_simple_make_affine(group, point, ctx); -} - -int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], - BN_CTX *ctx) { - for (size_t i = 0; i < num; i++) { - if (EC_GROUP_cmp(group, points[i]->group, NULL) != 0) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); - return 0; - } - } - return ec_GFp_simple_points_make_affine(group, num, points, ctx); + return ec_GFp_simple_cmp(group, &a->raw, &b->raw); } int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, @@ -753,7 +783,15 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); + EC_FELEM x_felem, y_felem; + if (!group->meth->point_get_affine_coordinates(group, &point->raw, + x == NULL ? NULL : &x_felem, + y == NULL ? NULL : &y_felem) || + (x != NULL && !bn_set_words(x, x_felem.words, group->field.width)) || + (y != NULL && !bn_set_words(y, y_felem.words, group->field.width))) { + return 0; + } + return 1; } int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, @@ -763,7 +801,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - if (!ec_GFp_simple_point_set_affine_coordinates(group, point, x, y, ctx)) { + if (!ec_GFp_simple_point_set_affine_coordinates(group, &point->raw, x, y)) { return 0; } @@ -775,7 +813,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, // constructing an arbitrary group. In this, we give up and hope they're // checking the return value. if (generator) { - EC_POINT_copy(point, generator); + ec_GFp_simple_point_copy(&point->raw, &generator->raw); } OPENSSL_PUT_ERROR(EC, EC_R_POINT_IS_NOT_ON_CURVE); return 0; @@ -792,10 +830,10 @@ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_add(group, r, a, b, ctx); + group->meth->add(group, &r->raw, &a->raw, &b->raw); + return 1; } - int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx) { if (EC_GROUP_cmp(group, r->group, NULL) != 0 || @@ -803,7 +841,8 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_dbl(group, r, a, ctx); + group->meth->dbl(group, &r->raw, &a->raw); + return 1; } @@ -812,7 +851,8 @@ int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_invert(group, a, ctx); + ec_GFp_simple_invert(group, &a->raw); + return 1; } static int arbitrary_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, @@ -829,7 +869,7 @@ static int arbitrary_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, BIGNUM *tmp = BN_CTX_get(ctx); int ok = tmp != NULL && BN_nnmod(tmp, in, order, ctx) && - ec_bignum_to_scalar_unchecked(group, out, tmp); + ec_bignum_to_scalar(group, out, tmp); BN_CTX_end(ctx); return ok; } @@ -845,9 +885,13 @@ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, return 0; } + if (EC_GROUP_cmp(group, r->group, NULL) != 0 || + (p != NULL && EC_GROUP_cmp(group, p->group, NULL) != 0)) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + int ret = 0; - EC_SCALAR g_scalar_storage, p_scalar_storage; - EC_SCALAR *g_scalar_arg = NULL, *p_scalar_arg = NULL; BN_CTX *new_ctx = NULL; if (ctx == NULL) { new_ctx = BN_CTX_new(); @@ -857,69 +901,158 @@ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, ctx = new_ctx; } + // If both |g_scalar| and |p_scalar| are non-NULL, + // |ec_point_mul_scalar_public| would share the doublings between the two + // products, which would be more efficient. However, we conservatively assume + // the caller needs a constant-time operation. (ECDSA verification does not + // use this function.) + // + // Previously, the low-level constant-time multiplication function aligned + // with this function's calling convention, but this was misleading. Curves + // which combined the two multiplications did not avoid the doubling case + // in the incomplete addition formula and were not constant-time. + if (g_scalar != NULL) { - if (!arbitrary_bignum_to_scalar(group, &g_scalar_storage, g_scalar, ctx)) { + EC_SCALAR scalar; + if (!arbitrary_bignum_to_scalar(group, &scalar, g_scalar, ctx) || + !ec_point_mul_scalar_base(group, &r->raw, &scalar)) { goto err; } - g_scalar_arg = &g_scalar_storage; } if (p_scalar != NULL) { - if (!arbitrary_bignum_to_scalar(group, &p_scalar_storage, p_scalar, ctx)) { + EC_SCALAR scalar; + EC_RAW_POINT tmp; + if (!arbitrary_bignum_to_scalar(group, &scalar, p_scalar, ctx) || + !ec_point_mul_scalar(group, &tmp, &p->raw, &scalar)) { goto err; } - p_scalar_arg = &p_scalar_storage; + if (g_scalar == NULL) { + OPENSSL_memcpy(&r->raw, &tmp, sizeof(EC_RAW_POINT)); + } else { + group->meth->add(group, &r->raw, &r->raw, &tmp); + } } - ret = ec_point_mul_scalar(group, r, g_scalar_arg, p, p_scalar_arg, ctx); + ret = 1; err: BN_CTX_free(new_ctx); - OPENSSL_cleanse(&g_scalar_storage, sizeof(g_scalar_storage)); - OPENSSL_cleanse(&p_scalar_storage, sizeof(p_scalar_storage)); return ret; } -int ec_point_mul_scalar_public(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { - if ((g_scalar == NULL && p_scalar == NULL) || - (p == NULL) != (p_scalar == NULL)) { +int ec_point_mul_scalar_public(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + if (g_scalar == NULL || p_scalar == NULL || p == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } - if (EC_GROUP_cmp(group, r->group, NULL) != 0 || - (p != NULL && EC_GROUP_cmp(group, p->group, NULL) != 0)) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + group->meth->mul_public(group, r, g_scalar, p, p_scalar); + return 1; +} + +int ec_point_mul_scalar(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar) { + if (p == NULL || scalar == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } - return group->meth->mul_public(group, r, g_scalar, p, p_scalar, ctx); + group->meth->mul(group, r, p, scalar); + return 1; } -int ec_point_mul_scalar(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { - if ((g_scalar == NULL && p_scalar == NULL) || - (p == NULL) != (p_scalar == NULL)) { +int ec_point_mul_scalar_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + if (scalar == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } - if (EC_GROUP_cmp(group, r->group, NULL) != 0 || - (p != NULL && EC_GROUP_cmp(group, p->group, NULL) != 0)) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + group->meth->mul_base(group, r, scalar); + return 1; +} + +int ec_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r) { + return group->meth->cmp_x_coordinate(group, p, r); +} + +int ec_get_x_coordinate_as_scalar(const EC_GROUP *group, EC_SCALAR *out, + const EC_RAW_POINT *p) { + EC_FELEM x; + // For simplicity, in case of width mismatches between |group->field| and + // |group->order|, zero any untouched words in |x|. + OPENSSL_memset(&x, 0, sizeof(x)); + if (!group->meth->point_get_affine_coordinates(group, p, &x, NULL)) { + return 0; + } + + // We must have p < 2×order, assuming p is not tiny (p >= 17). Thus rather we + // can reduce by performing at most one subtraction. + // + // Proof: We only work with prime order curves, so the number of points on + // the curve is the order. Thus Hasse's theorem gives: + // + // |order - (p + 1)| <= 2×sqrt(p) + // p + 1 - order <= 2×sqrt(p) + // p + 1 - 2×sqrt(p) <= order + // p + 1 - 2×(p/4) < order (p/4 > sqrt(p) for p >= 17) + // p/2 < p/2 + 1 < order + // p < 2×order + // + // Additionally, one can manually check this property for built-in curves. It + // is enforced for legacy custom curves in |EC_GROUP_set_generator|. + + // The above does not guarantee |group->field| is not one word larger than + // |group->order|, so read one extra carry word. + BN_ULONG carry = + group->order.width < EC_MAX_WORDS ? x.words[group->order.width] : 0; + bn_reduce_once(out->words, x.words, carry, group->order.d, + group->order.width); + return 1; +} + +int ec_point_get_affine_coordinate_bytes(const EC_GROUP *group, uint8_t *out_x, + uint8_t *out_y, size_t *out_len, + size_t max_out, + const EC_RAW_POINT *p) { + size_t len = BN_num_bytes(&group->field); + assert(len <= EC_MAX_BYTES); + if (max_out < len) { + OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); return 0; } - return group->meth->mul(group, r, g_scalar, p, p_scalar, ctx); + EC_FELEM x, y; + if (!group->meth->point_get_affine_coordinates( + group, p, out_x == NULL ? NULL : &x, out_y == NULL ? NULL : &y)) { + return 0; + } + + if (out_x != NULL) { + for (size_t i = 0; i < len; i++) { + out_x[i] = x.bytes[len - i - 1]; + } + } + if (out_y != NULL) { + for (size_t i = 0; i < len; i++) { + out_y[i] = y.bytes[len - i - 1]; + } + } + *out_len = len; + return 1; } void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag) {} const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group) { - return NULL; + // This function exists purely to give callers a way to call + // |EC_METHOD_get_field_type|. cryptography.io crashes if |EC_GROUP_method_of| + // returns NULL, so return some other garbage pointer. + return (const EC_METHOD *)0x12340000; } int EC_METHOD_get_field_type(const EC_METHOD *meth) { @@ -945,30 +1078,3 @@ size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, return OPENSSL_NUM_BUILT_IN_CURVES; } - -int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in) { - if (!ec_bignum_to_scalar_unchecked(group, out, in)) { - return 0; - } - if (!bn_less_than_words(out->words, group->order.d, group->order.width)) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_SCALAR); - return 0; - } - return 1; -} - -int ec_bignum_to_scalar_unchecked(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in) { - if (!bn_copy_words(out->words, group->order.width, in)) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_SCALAR); - return 0; - } - return 1; -} - -int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, - const uint8_t additional_data[32]) { - return bn_rand_range_words(out->words, 1, group->order.d, group->order.width, - additional_data); -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c.grpc_back similarity index 78% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c.grpc_back index 904466af3..158d66cc0 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec.c.grpc_back @@ -316,7 +316,7 @@ static void ec_group_set0_generator(EC_GROUP *group, EC_POINT *generator) { EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { - if (BN_num_bytes(p) > EC_MAX_SCALAR_BYTES) { + if (BN_num_bytes(p) > EC_MAX_BYTES) { OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); return NULL; } @@ -344,15 +344,14 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, generator->group != group) { // |EC_GROUP_set_generator| may only be used with |EC_GROUP|s returned by // |EC_GROUP_new_curve_GFp| and may only used once on each group. - // Additionally, |generator| must been created from - // |EC_GROUP_new_curve_GFp|, not a copy, so that - // |generator->group->generator| is set correctly. + // |generator| must have been created from |EC_GROUP_new_curve_GFp|, not a + // copy, so that |generator->group->generator| is set correctly. OPENSSL_PUT_ERROR(EC, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); return 0; } - if (BN_num_bytes(order) > EC_MAX_SCALAR_BYTES) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); + if (BN_num_bytes(order) > EC_MAX_BYTES) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); return 0; } @@ -367,25 +366,23 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, // Note any curve which did not satisfy this must have been invalid or use a // tiny prime (less than 17). See the proof in |field_element_to_scalar| in // the ECDSA implementation. + int ret = 0; + EC_POINT *copy = NULL; BIGNUM *tmp = BN_new(); if (tmp == NULL || !BN_lshift1(tmp, order)) { - BN_free(tmp); - return 0; + goto err; } - int ok = BN_cmp(tmp, &group->field) > 0; - BN_free(tmp); - if (!ok) { + if (BN_cmp(tmp, &group->field) <= 0) { OPENSSL_PUT_ERROR(EC, EC_R_INVALID_GROUP_ORDER); - return 0; + goto err; } - EC_POINT *copy = EC_POINT_new(group); + copy = EC_POINT_new(group); if (copy == NULL || !EC_POINT_copy(copy, generator) || !BN_copy(&group->order, order)) { - EC_POINT_free(copy); - return 0; + goto err; } // Store the order in minimal form, so it can be used with |BN_ULONG| arrays. bn_set_minimal_width(&group->order); @@ -393,11 +390,26 @@ int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, BN_MONT_CTX_free(group->order_mont); group->order_mont = BN_MONT_CTX_new_for_modulus(&group->order, NULL); if (group->order_mont == NULL) { - return 0; + goto err; + } + + group->field_greater_than_order = BN_cmp(&group->field, &group->order) > 0; + if (group->field_greater_than_order) { + if (!BN_sub(tmp, &group->field, &group->order) || + !bn_copy_words(group->field_minus_order.words, group->field.width, + tmp)) { + goto err; + } } ec_group_set0_generator(group, copy); - return 1; + copy = NULL; + ret = 1; + +err: + EC_POINT_free(copy); + BN_free(tmp); + return ret; } static EC_GROUP *ec_group_new_from_data(const struct built_in_curve *curve) { @@ -449,6 +461,14 @@ static EC_GROUP *ec_group_new_from_data(const struct built_in_curve *curve) { goto err; } + group->field_greater_than_order = BN_cmp(&group->field, &group->order) > 0; + if (group->field_greater_than_order) { + if (!BN_sub(p, &group->field, &group->order) || + !bn_copy_words(group->field_minus_order.words, group->field.width, p)) { + goto err; + } + } + group->order_mont = BN_MONT_CTX_new_for_modulus(&group->order, ctx); if (group->order_mont == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); @@ -479,8 +499,8 @@ err: struct built_in_groups_st { EC_GROUP *groups[OPENSSL_NUM_BUILT_IN_CURVES]; }; -DEFINE_BSS_GET(struct built_in_groups_st, built_in_groups); -DEFINE_STATIC_MUTEX(built_in_groups_lock); +DEFINE_BSS_GET(struct built_in_groups_st, built_in_groups) +DEFINE_STATIC_MUTEX(built_in_groups_lock) EC_GROUP *EC_GROUP_new_by_curve_name(int nid) { struct built_in_groups_st *groups = built_in_groups_bss_get(); @@ -579,13 +599,14 @@ int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, BN_CTX *ignored) { // structure. If |a| or |b| is incomplete (due to legacy OpenSSL mistakes, // custom curve construction is sadly done in two parts) but otherwise not the // same object, we consider them always unequal. - return a->generator == NULL || + return a->meth != b->meth || + a->generator == NULL || b->generator == NULL || BN_cmp(&a->order, &b->order) != 0 || BN_cmp(&a->field, &b->field) != 0 || - BN_cmp(&a->a, &b->a) != 0 || - BN_cmp(&a->b, &b->b) != 0 || - ec_GFp_simple_cmp(a, a->generator, b->generator, NULL) != 0; + !ec_felem_equal(a, &a->a, &b->a) || + !ec_felem_equal(a, &a->b, &b->b) || + ec_GFp_simple_cmp(a, &a->generator->raw, &b->generator->raw) != 0; } const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group) { @@ -604,6 +625,10 @@ int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx) { return 1; } +int EC_GROUP_order_bits(const EC_GROUP *group) { + return BN_num_bits(&group->order); +} + int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, BN_CTX *ctx) { // All |EC_GROUP|s have cofactor 1. @@ -612,36 +637,59 @@ int EC_GROUP_get_cofactor(const EC_GROUP *group, BIGNUM *cofactor, int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *out_p, BIGNUM *out_a, BIGNUM *out_b, BN_CTX *ctx) { - return ec_GFp_simple_group_get_curve(group, out_p, out_a, out_b, ctx); + return ec_GFp_simple_group_get_curve(group, out_p, out_a, out_b); } int EC_GROUP_get_curve_name(const EC_GROUP *group) { return group->curve_name; } unsigned EC_GROUP_get_degree(const EC_GROUP *group) { - return ec_GFp_simple_group_get_degree(group); + return BN_num_bits(&group->field); } -EC_POINT *EC_POINT_new(const EC_GROUP *group) { - EC_POINT *ret; +const char *EC_curve_nid2nist(int nid) { + switch (nid) { + case NID_secp224r1: + return "P-224"; + case NID_X9_62_prime256v1: + return "P-256"; + case NID_secp384r1: + return "P-384"; + case NID_secp521r1: + return "P-521"; + } + return NULL; +} + +int EC_curve_nist2nid(const char *name) { + if (strcmp(name, "P-224") == 0) { + return NID_secp224r1; + } + if (strcmp(name, "P-256") == 0) { + return NID_X9_62_prime256v1; + } + if (strcmp(name, "P-384") == 0) { + return NID_secp384r1; + } + if (strcmp(name, "P-521") == 0) { + return NID_secp521r1; + } + return NID_undef; +} +EC_POINT *EC_POINT_new(const EC_GROUP *group) { if (group == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return NULL; } - ret = OPENSSL_malloc(sizeof *ret); + EC_POINT *ret = OPENSSL_malloc(sizeof *ret); if (ret == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_MALLOC_FAILURE); return NULL; } ret->group = EC_GROUP_dup(group); - if (ret->group == NULL || - !ec_GFp_simple_point_init(ret)) { - OPENSSL_free(ret); - return NULL; - } - + ec_GFp_simple_point_init(&ret->raw); return ret; } @@ -649,7 +697,6 @@ static void ec_point_free(EC_POINT *point, int free_group) { if (!point) { return; } - ec_GFp_simple_point_finish(point); if (free_group) { EC_GROUP_free(point->group); } @@ -670,7 +717,8 @@ int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src) { if (dest == src) { return 1; } - return ec_GFp_simple_point_copy(dest, src); + ec_GFp_simple_point_copy(&dest->raw, &src->raw); + return 1; } EC_POINT *EC_POINT_dup(const EC_POINT *a, const EC_GROUP *group) { @@ -693,7 +741,8 @@ int EC_POINT_set_to_infinity(const EC_GROUP *group, EC_POINT *point) { OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_point_set_to_infinity(group, point); + ec_GFp_simple_point_set_to_infinity(group, &point->raw); + return 1; } int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { @@ -701,7 +750,7 @@ int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *point) { OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_is_at_infinity(group, point); + return ec_GFp_simple_is_at_infinity(group, &point->raw); } int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, @@ -710,7 +759,7 @@ int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_is_on_curve(group, point, ctx); + return ec_GFp_simple_is_on_curve(group, &point->raw); } int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, @@ -720,26 +769,7 @@ int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return -1; } - return ec_GFp_simple_cmp(group, a, b, ctx); -} - -int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx) { - if (EC_GROUP_cmp(group, point->group, NULL) != 0) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); - return 0; - } - return ec_GFp_simple_make_affine(group, point, ctx); -} - -int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], - BN_CTX *ctx) { - for (size_t i = 0; i < num; i++) { - if (EC_GROUP_cmp(group, points[i]->group, NULL) != 0) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); - return 0; - } - } - return ec_GFp_simple_points_make_affine(group, num, points, ctx); + return ec_GFp_simple_cmp(group, &a->raw, &b->raw); } int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, @@ -753,7 +783,15 @@ int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return group->meth->point_get_affine_coordinates(group, point, x, y, ctx); + EC_FELEM x_felem, y_felem; + if (!group->meth->point_get_affine_coordinates(group, &point->raw, + x == NULL ? NULL : &x_felem, + y == NULL ? NULL : &y_felem) || + (x != NULL && !bn_set_words(x, x_felem.words, group->field.width)) || + (y != NULL && !bn_set_words(y, y_felem.words, group->field.width))) { + return 0; + } + return 1; } int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, @@ -763,7 +801,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - if (!ec_GFp_simple_point_set_affine_coordinates(group, point, x, y, ctx)) { + if (!ec_GFp_simple_point_set_affine_coordinates(group, &point->raw, x, y)) { return 0; } @@ -775,7 +813,7 @@ int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, // constructing an arbitrary group. In this, we give up and hope they're // checking the return value. if (generator) { - EC_POINT_copy(point, generator); + ec_GFp_simple_point_copy(&point->raw, &generator->raw); } OPENSSL_PUT_ERROR(EC, EC_R_POINT_IS_NOT_ON_CURVE); return 0; @@ -792,10 +830,10 @@ int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_add(group, r, a, b, ctx); + group->meth->add(group, &r->raw, &a->raw, &b->raw); + return 1; } - int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx) { if (EC_GROUP_cmp(group, r->group, NULL) != 0 || @@ -803,7 +841,8 @@ int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_dbl(group, r, a, ctx); + group->meth->dbl(group, &r->raw, &a->raw); + return 1; } @@ -812,7 +851,8 @@ int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx) { OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_invert(group, a, ctx); + ec_GFp_simple_invert(group, &a->raw); + return 1; } static int arbitrary_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, @@ -829,7 +869,7 @@ static int arbitrary_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, BIGNUM *tmp = BN_CTX_get(ctx); int ok = tmp != NULL && BN_nnmod(tmp, in, order, ctx) && - ec_bignum_to_scalar_unchecked(group, out, tmp); + ec_bignum_to_scalar(group, out, tmp); BN_CTX_end(ctx); return ok; } @@ -845,9 +885,13 @@ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, return 0; } + if (EC_GROUP_cmp(group, r->group, NULL) != 0 || + (p != NULL && EC_GROUP_cmp(group, p->group, NULL) != 0)) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + int ret = 0; - EC_SCALAR g_scalar_storage, p_scalar_storage; - EC_SCALAR *g_scalar_arg = NULL, *p_scalar_arg = NULL; BN_CTX *new_ctx = NULL; if (ctx == NULL) { new_ctx = BN_CTX_new(); @@ -857,69 +901,158 @@ int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *g_scalar, ctx = new_ctx; } + // If both |g_scalar| and |p_scalar| are non-NULL, + // |ec_point_mul_scalar_public| would share the doublings between the two + // products, which would be more efficient. However, we conservatively assume + // the caller needs a constant-time operation. (ECDSA verification does not + // use this function.) + // + // Previously, the low-level constant-time multiplication function aligned + // with this function's calling convention, but this was misleading. Curves + // which combined the two multiplications did not avoid the doubling case + // in the incomplete addition formula and were not constant-time. + if (g_scalar != NULL) { - if (!arbitrary_bignum_to_scalar(group, &g_scalar_storage, g_scalar, ctx)) { + EC_SCALAR scalar; + if (!arbitrary_bignum_to_scalar(group, &scalar, g_scalar, ctx) || + !ec_point_mul_scalar_base(group, &r->raw, &scalar)) { goto err; } - g_scalar_arg = &g_scalar_storage; } if (p_scalar != NULL) { - if (!arbitrary_bignum_to_scalar(group, &p_scalar_storage, p_scalar, ctx)) { + EC_SCALAR scalar; + EC_RAW_POINT tmp; + if (!arbitrary_bignum_to_scalar(group, &scalar, p_scalar, ctx) || + !ec_point_mul_scalar(group, &tmp, &p->raw, &scalar)) { goto err; } - p_scalar_arg = &p_scalar_storage; + if (g_scalar == NULL) { + OPENSSL_memcpy(&r->raw, &tmp, sizeof(EC_RAW_POINT)); + } else { + group->meth->add(group, &r->raw, &r->raw, &tmp); + } } - ret = ec_point_mul_scalar(group, r, g_scalar_arg, p, p_scalar_arg, ctx); + ret = 1; err: BN_CTX_free(new_ctx); - OPENSSL_cleanse(&g_scalar_storage, sizeof(g_scalar_storage)); - OPENSSL_cleanse(&p_scalar_storage, sizeof(p_scalar_storage)); return ret; } -int ec_point_mul_scalar_public(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { - if ((g_scalar == NULL && p_scalar == NULL) || - (p == NULL) != (p_scalar == NULL)) { +int ec_point_mul_scalar_public(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + if (g_scalar == NULL || p_scalar == NULL || p == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } - if (EC_GROUP_cmp(group, r->group, NULL) != 0 || - (p != NULL && EC_GROUP_cmp(group, p->group, NULL) != 0)) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + group->meth->mul_public(group, r, g_scalar, p, p_scalar); + return 1; +} + +int ec_point_mul_scalar(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar) { + if (p == NULL || scalar == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } - return group->meth->mul_public(group, r, g_scalar, p, p_scalar, ctx); + group->meth->mul(group, r, p, scalar); + return 1; } -int ec_point_mul_scalar(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { - if ((g_scalar == NULL && p_scalar == NULL) || - (p == NULL) != (p_scalar == NULL)) { +int ec_point_mul_scalar_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + if (scalar == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); return 0; } - if (EC_GROUP_cmp(group, r->group, NULL) != 0 || - (p != NULL && EC_GROUP_cmp(group, p->group, NULL) != 0)) { - OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + group->meth->mul_base(group, r, scalar); + return 1; +} + +int ec_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r) { + return group->meth->cmp_x_coordinate(group, p, r); +} + +int ec_get_x_coordinate_as_scalar(const EC_GROUP *group, EC_SCALAR *out, + const EC_RAW_POINT *p) { + EC_FELEM x; + // For simplicity, in case of width mismatches between |group->field| and + // |group->order|, zero any untouched words in |x|. + OPENSSL_memset(&x, 0, sizeof(x)); + if (!group->meth->point_get_affine_coordinates(group, p, &x, NULL)) { + return 0; + } + + // We must have p < 2×order, assuming p is not tiny (p >= 17). Thus rather we + // can reduce by performing at most one subtraction. + // + // Proof: We only work with prime order curves, so the number of points on + // the curve is the order. Thus Hasse's theorem gives: + // + // |order - (p + 1)| <= 2×sqrt(p) + // p + 1 - order <= 2×sqrt(p) + // p + 1 - 2×sqrt(p) <= order + // p + 1 - 2×(p/4) < order (p/4 > sqrt(p) for p >= 17) + // p/2 < p/2 + 1 < order + // p < 2×order + // + // Additionally, one can manually check this property for built-in curves. It + // is enforced for legacy custom curves in |EC_GROUP_set_generator|. + + // The above does not guarantee |group->field| is not one word larger than + // |group->order|, so read one extra carry word. + BN_ULONG carry = + group->order.width < EC_MAX_WORDS ? x.words[group->order.width] : 0; + bn_reduce_once(out->words, x.words, carry, group->order.d, + group->order.width); + return 1; +} + +int ec_point_get_affine_coordinate_bytes(const EC_GROUP *group, uint8_t *out_x, + uint8_t *out_y, size_t *out_len, + size_t max_out, + const EC_RAW_POINT *p) { + size_t len = BN_num_bytes(&group->field); + assert(len <= EC_MAX_BYTES); + if (max_out < len) { + OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); return 0; } - return group->meth->mul(group, r, g_scalar, p, p_scalar, ctx); + EC_FELEM x, y; + if (!group->meth->point_get_affine_coordinates( + group, p, out_x == NULL ? NULL : &x, out_y == NULL ? NULL : &y)) { + return 0; + } + + if (out_x != NULL) { + for (size_t i = 0; i < len; i++) { + out_x[i] = x.bytes[len - i - 1]; + } + } + if (out_y != NULL) { + for (size_t i = 0; i < len; i++) { + out_y[i] = y.bytes[len - i - 1]; + } + } + *out_len = len; + return 1; } void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag) {} const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group) { - return NULL; + // This function exists purely to give callers a way to call + // |EC_METHOD_get_field_type|. cryptography.io crashes if |EC_GROUP_method_of| + // returns NULL, so return some other garbage pointer. + return (const EC_METHOD *)0x12340000; } int EC_METHOD_get_field_type(const EC_METHOD *meth) { @@ -945,30 +1078,3 @@ size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, return OPENSSL_NUM_BUILT_IN_CURVES; } - -int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in) { - if (!ec_bignum_to_scalar_unchecked(group, out, in)) { - return 0; - } - if (!bn_less_than_words(out->words, group->order.d, group->order.width)) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_SCALAR); - return 0; - } - return 1; -} - -int ec_bignum_to_scalar_unchecked(const EC_GROUP *group, EC_SCALAR *out, - const BIGNUM *in) { - if (!bn_copy_words(out->words, group->order.width, in)) { - OPENSSL_PUT_ERROR(EC, EC_R_INVALID_SCALAR); - return 0; - } - return 1; -} - -int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, - const uint8_t additional_data[32]) { - return bn_rand_range_words(out->words, 1, group->order.d, group->order.width, - additional_data); -} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_key.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_key.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c index b7e7f91b3..7cf9ffbe6 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_key.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c @@ -82,7 +82,7 @@ #include "../../internal.h" -DEFINE_STATIC_EX_DATA_CLASS(g_ec_ex_data_class); +DEFINE_STATIC_EX_DATA_CLASS(g_ec_ex_data_class) static EC_WRAPPED_SCALAR *ec_wrapped_scalar_new(const EC_GROUP *group) { EC_WRAPPED_SCALAR *wrapped = OPENSSL_malloc(sizeof(EC_WRAPPED_SCALAR)); @@ -267,7 +267,7 @@ int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key) { return 0; } - if (EC_GROUP_cmp(key->group, pub_key->group, NULL) != 0) { + if (pub_key != NULL && EC_GROUP_cmp(key->group, pub_key->group, NULL) != 0) { OPENSSL_PUT_ERROR(EC, EC_R_GROUP_MISMATCH); return 0; } @@ -322,8 +322,8 @@ int EC_KEY_check_key(const EC_KEY *eckey) { if (eckey->priv_key != NULL) { point = EC_POINT_new(eckey->group); if (point == NULL || - !ec_point_mul_scalar(eckey->group, point, &eckey->priv_key->scalar, - NULL, NULL, ctx)) { + !ec_point_mul_scalar_base(eckey->group, &point->raw, + &eckey->priv_key->scalar)) { OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); goto err; } @@ -369,8 +369,8 @@ int EC_KEY_check_fips(const EC_KEY *key) { return 1; } -int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, - BIGNUM *y) { +int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, const BIGNUM *x, + const BIGNUM *y) { EC_POINT *point = NULL; int ok = 0; @@ -394,6 +394,33 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, return ok; } +size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, + unsigned char **out_buf, BN_CTX *ctx) { + if (key == NULL || key->pub_key == NULL || key->group == NULL) { + return 0; + } + + const size_t len = + EC_POINT_point2oct(key->group, key->pub_key, form, NULL, 0, ctx); + if (len == 0) { + return 0; + } + + uint8_t *buf = OPENSSL_malloc(len); + if (buf == NULL) { + return 0; + } + + if (EC_POINT_point2oct(key->group, key->pub_key, form, buf, len, ctx) != + len) { + OPENSSL_free(buf); + return 0; + } + + *out_buf = buf; + return len; +} + int EC_KEY_generate_key(EC_KEY *key) { if (key == NULL || key->group == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); @@ -413,8 +440,7 @@ int EC_KEY_generate_key(EC_KEY *key) { // Generate the private key by testing candidates (FIPS 186-4 B.4.2). !ec_random_nonzero_scalar(key->group, &priv_key->scalar, kDefaultAdditionalData) || - !ec_point_mul_scalar(key->group, pub_key, &priv_key->scalar, NULL, NULL, - NULL)) { + !ec_point_mul_scalar_base(key->group, &pub_key->raw, &priv_key->scalar)) { EC_POINT_free(pub_key); ec_wrapped_scalar_free(priv_key); return 0; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_key.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_key.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c.grpc_back index a6d469767..0d9ce671d 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/ec_key.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_key.c.grpc_back @@ -82,7 +82,7 @@ #include "../../internal.h" -DEFINE_STATIC_EX_DATA_CLASS(g_ec_ex_data_class); +DEFINE_STATIC_EX_DATA_CLASS(g_ec_ex_data_class) static EC_WRAPPED_SCALAR *ec_wrapped_scalar_new(const EC_GROUP *group) { EC_WRAPPED_SCALAR *wrapped = OPENSSL_malloc(sizeof(EC_WRAPPED_SCALAR)); @@ -267,7 +267,7 @@ int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub_key) { return 0; } - if (EC_GROUP_cmp(key->group, pub_key->group, NULL) != 0) { + if (pub_key != NULL && EC_GROUP_cmp(key->group, pub_key->group, NULL) != 0) { OPENSSL_PUT_ERROR(EC, EC_R_GROUP_MISMATCH); return 0; } @@ -322,8 +322,8 @@ int EC_KEY_check_key(const EC_KEY *eckey) { if (eckey->priv_key != NULL) { point = EC_POINT_new(eckey->group); if (point == NULL || - !ec_point_mul_scalar(eckey->group, point, &eckey->priv_key->scalar, - NULL, NULL, ctx)) { + !ec_point_mul_scalar_base(eckey->group, &point->raw, + &eckey->priv_key->scalar)) { OPENSSL_PUT_ERROR(EC, ERR_R_EC_LIB); goto err; } @@ -369,8 +369,8 @@ int EC_KEY_check_fips(const EC_KEY *key) { return 1; } -int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, - BIGNUM *y) { +int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, const BIGNUM *x, + const BIGNUM *y) { EC_POINT *point = NULL; int ok = 0; @@ -394,6 +394,33 @@ err: return ok; } +size_t EC_KEY_key2buf(const EC_KEY *key, point_conversion_form_t form, + unsigned char **out_buf, BN_CTX *ctx) { + if (key == NULL || key->pub_key == NULL || key->group == NULL) { + return 0; + } + + const size_t len = + EC_POINT_point2oct(key->group, key->pub_key, form, NULL, 0, ctx); + if (len == 0) { + return 0; + } + + uint8_t *buf = OPENSSL_malloc(len); + if (buf == NULL) { + return 0; + } + + if (EC_POINT_point2oct(key->group, key->pub_key, form, buf, len, ctx) != + len) { + OPENSSL_free(buf); + return 0; + } + + *out_buf = buf; + return len; +} + int EC_KEY_generate_key(EC_KEY *key) { if (key == NULL || key->group == NULL) { OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); @@ -413,8 +440,7 @@ int EC_KEY_generate_key(EC_KEY *key) { // Generate the private key by testing candidates (FIPS 186-4 B.4.2). !ec_random_nonzero_scalar(key->group, &priv_key->scalar, kDefaultAdditionalData) || - !ec_point_mul_scalar(key->group, pub_key, &priv_key->scalar, NULL, NULL, - NULL)) { + !ec_point_mul_scalar_base(key->group, &pub_key->raw, &priv_key->scalar)) { EC_POINT_free(pub_key); ec_wrapped_scalar_free(priv_key); return 0; diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c new file mode 100644 index 000000000..a195b9583 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c @@ -0,0 +1,483 @@ +/* Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#include + +#include +#include +#include + +#include "../bn/internal.h" +#include "../delocate.h" +#include "internal.h" + + +int ec_GFp_mont_group_init(EC_GROUP *group) { + int ok; + + ok = ec_GFp_simple_group_init(group); + group->mont = NULL; + return ok; +} + +void ec_GFp_mont_group_finish(EC_GROUP *group) { + BN_MONT_CTX_free(group->mont); + group->mont = NULL; + ec_GFp_simple_group_finish(group); +} + +int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, + const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + BN_CTX *new_ctx = NULL; + int ret = 0; + + BN_MONT_CTX_free(group->mont); + group->mont = NULL; + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + } + + group->mont = BN_MONT_CTX_new_for_modulus(p, ctx); + if (group->mont == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + goto err; + } + + ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); + + if (!ret) { + BN_MONT_CTX_free(group->mont); + group->mont = NULL; + } + +err: + BN_CTX_free(new_ctx); + return ret; +} + +static void ec_GFp_mont_felem_to_montgomery(const EC_GROUP *group, + EC_FELEM *out, const EC_FELEM *in) { + bn_to_montgomery_small(out->words, in->words, group->field.width, + group->mont); +} + +static void ec_GFp_mont_felem_from_montgomery(const EC_GROUP *group, + EC_FELEM *out, + const EC_FELEM *in) { + bn_from_montgomery_small(out->words, in->words, group->field.width, + group->mont); +} + +static void ec_GFp_mont_felem_inv(const EC_GROUP *group, EC_FELEM *out, + const EC_FELEM *a) { + bn_mod_inverse_prime_mont_small(out->words, a->words, group->field.width, + group->mont); +} + +void ec_GFp_mont_felem_mul(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a, const EC_FELEM *b) { + bn_mod_mul_montgomery_small(r->words, a->words, b->words, group->field.width, + group->mont); +} + +void ec_GFp_mont_felem_sqr(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a) { + bn_mod_mul_montgomery_small(r->words, a->words, a->words, group->field.width, + group->mont); +} + +int ec_GFp_mont_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in) { + if (group->mont == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); + return 0; + } + + if (!bn_copy_words(out->words, group->field.width, in)) { + return 0; + } + ec_GFp_mont_felem_to_montgomery(group, out, out); + return 1; +} + +int ec_GFp_mont_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in) { + if (group->mont == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); + return 0; + } + + EC_FELEM tmp; + ec_GFp_mont_felem_from_montgomery(group, &tmp, in); + return bn_set_words(out, tmp.words, group->field.width); +} + +static int ec_GFp_mont_point_get_affine_coordinates(const EC_GROUP *group, + const EC_RAW_POINT *point, + EC_FELEM *x, EC_FELEM *y) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + // Transform (X, Y, Z) into (x, y) := (X/Z^2, Y/Z^3). + + EC_FELEM z1, z2; + ec_GFp_mont_felem_inv(group, &z2, &point->Z); + ec_GFp_mont_felem_sqr(group, &z1, &z2); + + // Instead of using |ec_GFp_mont_felem_from_montgomery| to convert the |x| + // coordinate and then calling |ec_GFp_mont_felem_from_montgomery| again to + // convert the |y| coordinate below, convert the common factor |z1| once now, + // saving one reduction. + ec_GFp_mont_felem_from_montgomery(group, &z1, &z1); + + if (x != NULL) { + ec_GFp_mont_felem_mul(group, x, &point->X, &z1); + } + + if (y != NULL) { + ec_GFp_mont_felem_mul(group, &z1, &z1, &z2); + ec_GFp_mont_felem_mul(group, y, &point->Y, &z1); + } + + return 1; +} + +void ec_GFp_mont_add(const EC_GROUP *group, EC_RAW_POINT *out, + const EC_RAW_POINT *a, const EC_RAW_POINT *b) { + if (a == b) { + ec_GFp_mont_dbl(group, out, a); + return; + } + + // The method is taken from: + // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-2007-bl + // + // Coq transcription and correctness proof: + // + // + EC_FELEM x_out, y_out, z_out; + BN_ULONG z1nz = ec_felem_non_zero_mask(group, &a->Z); + BN_ULONG z2nz = ec_felem_non_zero_mask(group, &b->Z); + + // z1z1 = z1z1 = z1**2 + EC_FELEM z1z1; + ec_GFp_mont_felem_sqr(group, &z1z1, &a->Z); + + // z2z2 = z2**2 + EC_FELEM z2z2; + ec_GFp_mont_felem_sqr(group, &z2z2, &b->Z); + + // u1 = x1*z2z2 + EC_FELEM u1; + ec_GFp_mont_felem_mul(group, &u1, &a->X, &z2z2); + + // two_z1z2 = (z1 + z2)**2 - (z1z1 + z2z2) = 2z1z2 + EC_FELEM two_z1z2; + ec_felem_add(group, &two_z1z2, &a->Z, &b->Z); + ec_GFp_mont_felem_sqr(group, &two_z1z2, &two_z1z2); + ec_felem_sub(group, &two_z1z2, &two_z1z2, &z1z1); + ec_felem_sub(group, &two_z1z2, &two_z1z2, &z2z2); + + // s1 = y1 * z2**3 + EC_FELEM s1; + ec_GFp_mont_felem_mul(group, &s1, &b->Z, &z2z2); + ec_GFp_mont_felem_mul(group, &s1, &s1, &a->Y); + + // u2 = x2*z1z1 + EC_FELEM u2; + ec_GFp_mont_felem_mul(group, &u2, &b->X, &z1z1); + + // h = u2 - u1 + EC_FELEM h; + ec_felem_sub(group, &h, &u2, &u1); + + BN_ULONG xneq = ec_felem_non_zero_mask(group, &h); + + // z_out = two_z1z2 * h + ec_GFp_mont_felem_mul(group, &z_out, &h, &two_z1z2); + + // z1z1z1 = z1 * z1z1 + EC_FELEM z1z1z1; + ec_GFp_mont_felem_mul(group, &z1z1z1, &a->Z, &z1z1); + + // s2 = y2 * z1**3 + EC_FELEM s2; + ec_GFp_mont_felem_mul(group, &s2, &b->Y, &z1z1z1); + + // r = (s2 - s1)*2 + EC_FELEM r; + ec_felem_sub(group, &r, &s2, &s1); + ec_felem_add(group, &r, &r, &r); + + BN_ULONG yneq = ec_felem_non_zero_mask(group, &r); + + // This case will never occur in the constant-time |ec_GFp_mont_mul|. + BN_ULONG is_nontrivial_double = ~xneq & ~yneq & z1nz & z2nz; + if (is_nontrivial_double) { + ec_GFp_mont_dbl(group, out, a); + return; + } + + // I = (2h)**2 + EC_FELEM i; + ec_felem_add(group, &i, &h, &h); + ec_GFp_mont_felem_sqr(group, &i, &i); + + // J = h * I + EC_FELEM j; + ec_GFp_mont_felem_mul(group, &j, &h, &i); + + // V = U1 * I + EC_FELEM v; + ec_GFp_mont_felem_mul(group, &v, &u1, &i); + + // x_out = r**2 - J - 2V + ec_GFp_mont_felem_sqr(group, &x_out, &r); + ec_felem_sub(group, &x_out, &x_out, &j); + ec_felem_sub(group, &x_out, &x_out, &v); + ec_felem_sub(group, &x_out, &x_out, &v); + + // y_out = r(V-x_out) - 2 * s1 * J + ec_felem_sub(group, &y_out, &v, &x_out); + ec_GFp_mont_felem_mul(group, &y_out, &y_out, &r); + EC_FELEM s1j; + ec_GFp_mont_felem_mul(group, &s1j, &s1, &j); + ec_felem_sub(group, &y_out, &y_out, &s1j); + ec_felem_sub(group, &y_out, &y_out, &s1j); + + ec_felem_select(group, &x_out, z1nz, &x_out, &b->X); + ec_felem_select(group, &out->X, z2nz, &x_out, &a->X); + ec_felem_select(group, &y_out, z1nz, &y_out, &b->Y); + ec_felem_select(group, &out->Y, z2nz, &y_out, &a->Y); + ec_felem_select(group, &z_out, z1nz, &z_out, &b->Z); + ec_felem_select(group, &out->Z, z2nz, &z_out, &a->Z); +} + +void ec_GFp_mont_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a) { + if (group->a_is_minus3) { + // The method is taken from: + // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // + // Coq transcription and correctness proof: + // + // + EC_FELEM delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; + // delta = z^2 + ec_GFp_mont_felem_sqr(group, &delta, &a->Z); + // gamma = y^2 + ec_GFp_mont_felem_sqr(group, &gamma, &a->Y); + // beta = x*gamma + ec_GFp_mont_felem_mul(group, &beta, &a->X, &gamma); + + // alpha = 3*(x-delta)*(x+delta) + ec_felem_sub(group, &ftmp, &a->X, &delta); + ec_felem_add(group, &ftmp2, &a->X, &delta); + + ec_felem_add(group, &tmptmp, &ftmp2, &ftmp2); + ec_felem_add(group, &ftmp2, &ftmp2, &tmptmp); + ec_GFp_mont_felem_mul(group, &alpha, &ftmp, &ftmp2); + + // x' = alpha^2 - 8*beta + ec_GFp_mont_felem_sqr(group, &r->X, &alpha); + ec_felem_add(group, &fourbeta, &beta, &beta); + ec_felem_add(group, &fourbeta, &fourbeta, &fourbeta); + ec_felem_add(group, &tmptmp, &fourbeta, &fourbeta); + ec_felem_sub(group, &r->X, &r->X, &tmptmp); + + // z' = (y + z)^2 - gamma - delta + ec_felem_add(group, &delta, &gamma, &delta); + ec_felem_add(group, &ftmp, &a->Y, &a->Z); + ec_GFp_mont_felem_sqr(group, &r->Z, &ftmp); + ec_felem_sub(group, &r->Z, &r->Z, &delta); + + // y' = alpha*(4*beta - x') - 8*gamma^2 + ec_felem_sub(group, &r->Y, &fourbeta, &r->X); + ec_felem_add(group, &gamma, &gamma, &gamma); + ec_GFp_mont_felem_sqr(group, &gamma, &gamma); + ec_GFp_mont_felem_mul(group, &r->Y, &alpha, &r->Y); + ec_felem_add(group, &gamma, &gamma, &gamma); + ec_felem_sub(group, &r->Y, &r->Y, &gamma); + } else { + // The method is taken from: + // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-2007-bl + // + // Coq transcription and correctness proof: + // + // + EC_FELEM xx, yy, yyyy, zz; + ec_GFp_mont_felem_sqr(group, &xx, &a->X); + ec_GFp_mont_felem_sqr(group, &yy, &a->Y); + ec_GFp_mont_felem_sqr(group, &yyyy, &yy); + ec_GFp_mont_felem_sqr(group, &zz, &a->Z); + + // s = 2*((x_in + yy)^2 - xx - yyyy) + EC_FELEM s; + ec_felem_add(group, &s, &a->X, &yy); + ec_GFp_mont_felem_sqr(group, &s, &s); + ec_felem_sub(group, &s, &s, &xx); + ec_felem_sub(group, &s, &s, &yyyy); + ec_felem_add(group, &s, &s, &s); + + // m = 3*xx + a*zz^2 + EC_FELEM m; + ec_GFp_mont_felem_sqr(group, &m, &zz); + ec_GFp_mont_felem_mul(group, &m, &group->a, &m); + ec_felem_add(group, &m, &m, &xx); + ec_felem_add(group, &m, &m, &xx); + ec_felem_add(group, &m, &m, &xx); + + // x_out = m^2 - 2*s + ec_GFp_mont_felem_sqr(group, &r->X, &m); + ec_felem_sub(group, &r->X, &r->X, &s); + ec_felem_sub(group, &r->X, &r->X, &s); + + // z_out = (y_in + z_in)^2 - yy - zz + ec_felem_add(group, &r->Z, &a->Y, &a->Z); + ec_GFp_mont_felem_sqr(group, &r->Z, &r->Z); + ec_felem_sub(group, &r->Z, &r->Z, &yy); + ec_felem_sub(group, &r->Z, &r->Z, &zz); + + // y_out = m*(s-x_out) - 8*yyyy + ec_felem_add(group, &yyyy, &yyyy, &yyyy); + ec_felem_add(group, &yyyy, &yyyy, &yyyy); + ec_felem_add(group, &yyyy, &yyyy, &yyyy); + ec_felem_sub(group, &r->Y, &s, &r->X); + ec_GFp_mont_felem_mul(group, &r->Y, &r->Y, &m); + ec_felem_sub(group, &r->Y, &r->Y, &yyyy); + } +} + +static int ec_GFp_mont_cmp_x_coordinate(const EC_GROUP *group, + const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (!group->field_greater_than_order || + group->field.width != group->order.width) { + // Do not bother optimizing this case. p > order in all commonly-used + // curves. + return ec_GFp_simple_cmp_x_coordinate(group, p, r); + } + + if (ec_GFp_simple_is_at_infinity(group, p)) { + return 0; + } + + // We wish to compare X/Z^2 with r. This is equivalent to comparing X with + // r*Z^2. Note that X and Z are represented in Montgomery form, while r is + // not. + EC_FELEM r_Z2, Z2_mont, X; + ec_GFp_mont_felem_mul(group, &Z2_mont, &p->Z, &p->Z); + // r < order < p, so this is valid. + OPENSSL_memcpy(r_Z2.words, r->words, group->field.width * sizeof(BN_ULONG)); + ec_GFp_mont_felem_mul(group, &r_Z2, &r_Z2, &Z2_mont); + ec_GFp_mont_felem_from_montgomery(group, &X, &p->X); + + if (ec_felem_equal(group, &r_Z2, &X)) { + return 1; + } + + // During signing the x coefficient is reduced modulo the group order. + // Therefore there is a small possibility, less than 1/2^128, that group_order + // < p.x < P. in that case we need not only to compare against |r| but also to + // compare against r+group_order. + if (bn_less_than_words(r->words, group->field_minus_order.words, + group->field.width)) { + // We can ignore the carry because: r + group_order < p < 2^256. + bn_add_words(r_Z2.words, r->words, group->order.d, group->field.width); + ec_GFp_mont_felem_mul(group, &r_Z2, &r_Z2, &Z2_mont); + if (ec_felem_equal(group, &r_Z2, &X)) { + return 1; + } + } + + return 0; +} + +DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_mont_method) { + out->group_init = ec_GFp_mont_group_init; + out->group_finish = ec_GFp_mont_group_finish; + out->group_set_curve = ec_GFp_mont_group_set_curve; + out->point_get_affine_coordinates = ec_GFp_mont_point_get_affine_coordinates; + out->add = ec_GFp_mont_add; + out->dbl = ec_GFp_mont_dbl; + out->mul = ec_GFp_mont_mul; + out->mul_base = ec_GFp_mont_mul_base; + out->mul_public = ec_GFp_mont_mul_public; + out->felem_mul = ec_GFp_mont_felem_mul; + out->felem_sqr = ec_GFp_mont_felem_sqr; + out->bignum_to_felem = ec_GFp_mont_bignum_to_felem; + out->felem_to_bignum = ec_GFp_mont_felem_to_bignum; + out->scalar_inv_montgomery = ec_simple_scalar_inv_montgomery; + out->scalar_inv_montgomery_vartime = ec_GFp_simple_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ec_GFp_mont_cmp_x_coordinate; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back new file mode 100644 index 000000000..0cf1d910d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/ec_montgomery.c.grpc_back @@ -0,0 +1,483 @@ +/* Originally written by Bodo Moeller and Nils Larsch for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#include + +#include +#include +#include + +#include "../bn/internal.h" +#include "../delocate.h" +#include "internal.h" + + +int ec_GFp_mont_group_init(EC_GROUP *group) { + int ok; + + ok = ec_GFp_simple_group_init(group); + group->mont = NULL; + return ok; +} + +void ec_GFp_mont_group_finish(EC_GROUP *group) { + BN_MONT_CTX_free(group->mont); + group->mont = NULL; + ec_GFp_simple_group_finish(group); +} + +int ec_GFp_mont_group_set_curve(EC_GROUP *group, const BIGNUM *p, + const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx) { + BN_CTX *new_ctx = NULL; + int ret = 0; + + BN_MONT_CTX_free(group->mont); + group->mont = NULL; + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + } + + group->mont = BN_MONT_CTX_new_for_modulus(p, ctx); + if (group->mont == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); + goto err; + } + + ret = ec_GFp_simple_group_set_curve(group, p, a, b, ctx); + + if (!ret) { + BN_MONT_CTX_free(group->mont); + group->mont = NULL; + } + +err: + BN_CTX_free(new_ctx); + return ret; +} + +static void ec_GFp_mont_felem_to_montgomery(const EC_GROUP *group, + EC_FELEM *out, const EC_FELEM *in) { + bn_to_montgomery_small(out->words, in->words, group->field.width, + group->mont); +} + +static void ec_GFp_mont_felem_from_montgomery(const EC_GROUP *group, + EC_FELEM *out, + const EC_FELEM *in) { + bn_from_montgomery_small(out->words, in->words, group->field.width, + group->mont); +} + +static void ec_GFp_mont_felem_inv(const EC_GROUP *group, EC_FELEM *out, + const EC_FELEM *a) { + bn_mod_inverse_prime_mont_small(out->words, a->words, group->field.width, + group->mont); +} + +void ec_GFp_mont_felem_mul(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a, const EC_FELEM *b) { + bn_mod_mul_montgomery_small(r->words, a->words, b->words, group->field.width, + group->mont); +} + +void ec_GFp_mont_felem_sqr(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a) { + bn_mod_mul_montgomery_small(r->words, a->words, a->words, group->field.width, + group->mont); +} + +int ec_GFp_mont_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in) { + if (group->mont == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); + return 0; + } + + if (!bn_copy_words(out->words, group->field.width, in)) { + return 0; + } + ec_GFp_mont_felem_to_montgomery(group, out, out); + return 1; +} + +int ec_GFp_mont_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in) { + if (group->mont == NULL) { + OPENSSL_PUT_ERROR(EC, EC_R_NOT_INITIALIZED); + return 0; + } + + EC_FELEM tmp; + ec_GFp_mont_felem_from_montgomery(group, &tmp, in); + return bn_set_words(out, tmp.words, group->field.width); +} + +static int ec_GFp_mont_point_get_affine_coordinates(const EC_GROUP *group, + const EC_RAW_POINT *point, + EC_FELEM *x, EC_FELEM *y) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + // Transform (X, Y, Z) into (x, y) := (X/Z^2, Y/Z^3). + + EC_FELEM z1, z2; + ec_GFp_mont_felem_inv(group, &z2, &point->Z); + ec_GFp_mont_felem_sqr(group, &z1, &z2); + + // Instead of using |ec_GFp_mont_felem_from_montgomery| to convert the |x| + // coordinate and then calling |ec_GFp_mont_felem_from_montgomery| again to + // convert the |y| coordinate below, convert the common factor |z1| once now, + // saving one reduction. + ec_GFp_mont_felem_from_montgomery(group, &z1, &z1); + + if (x != NULL) { + ec_GFp_mont_felem_mul(group, x, &point->X, &z1); + } + + if (y != NULL) { + ec_GFp_mont_felem_mul(group, &z1, &z1, &z2); + ec_GFp_mont_felem_mul(group, y, &point->Y, &z1); + } + + return 1; +} + +void ec_GFp_mont_add(const EC_GROUP *group, EC_RAW_POINT *out, + const EC_RAW_POINT *a, const EC_RAW_POINT *b) { + if (a == b) { + ec_GFp_mont_dbl(group, out, a); + return; + } + + // The method is taken from: + // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#addition-add-2007-bl + // + // Coq transcription and correctness proof: + // + // + EC_FELEM x_out, y_out, z_out; + BN_ULONG z1nz = ec_felem_non_zero_mask(group, &a->Z); + BN_ULONG z2nz = ec_felem_non_zero_mask(group, &b->Z); + + // z1z1 = z1z1 = z1**2 + EC_FELEM z1z1; + ec_GFp_mont_felem_sqr(group, &z1z1, &a->Z); + + // z2z2 = z2**2 + EC_FELEM z2z2; + ec_GFp_mont_felem_sqr(group, &z2z2, &b->Z); + + // u1 = x1*z2z2 + EC_FELEM u1; + ec_GFp_mont_felem_mul(group, &u1, &a->X, &z2z2); + + // two_z1z2 = (z1 + z2)**2 - (z1z1 + z2z2) = 2z1z2 + EC_FELEM two_z1z2; + ec_felem_add(group, &two_z1z2, &a->Z, &b->Z); + ec_GFp_mont_felem_sqr(group, &two_z1z2, &two_z1z2); + ec_felem_sub(group, &two_z1z2, &two_z1z2, &z1z1); + ec_felem_sub(group, &two_z1z2, &two_z1z2, &z2z2); + + // s1 = y1 * z2**3 + EC_FELEM s1; + ec_GFp_mont_felem_mul(group, &s1, &b->Z, &z2z2); + ec_GFp_mont_felem_mul(group, &s1, &s1, &a->Y); + + // u2 = x2*z1z1 + EC_FELEM u2; + ec_GFp_mont_felem_mul(group, &u2, &b->X, &z1z1); + + // h = u2 - u1 + EC_FELEM h; + ec_felem_sub(group, &h, &u2, &u1); + + BN_ULONG xneq = ec_felem_non_zero_mask(group, &h); + + // z_out = two_z1z2 * h + ec_GFp_mont_felem_mul(group, &z_out, &h, &two_z1z2); + + // z1z1z1 = z1 * z1z1 + EC_FELEM z1z1z1; + ec_GFp_mont_felem_mul(group, &z1z1z1, &a->Z, &z1z1); + + // s2 = y2 * z1**3 + EC_FELEM s2; + ec_GFp_mont_felem_mul(group, &s2, &b->Y, &z1z1z1); + + // r = (s2 - s1)*2 + EC_FELEM r; + ec_felem_sub(group, &r, &s2, &s1); + ec_felem_add(group, &r, &r, &r); + + BN_ULONG yneq = ec_felem_non_zero_mask(group, &r); + + // This case will never occur in the constant-time |ec_GFp_mont_mul|. + BN_ULONG is_nontrivial_double = ~xneq & ~yneq & z1nz & z2nz; + if (is_nontrivial_double) { + ec_GFp_mont_dbl(group, out, a); + return; + } + + // I = (2h)**2 + EC_FELEM i; + ec_felem_add(group, &i, &h, &h); + ec_GFp_mont_felem_sqr(group, &i, &i); + + // J = h * I + EC_FELEM j; + ec_GFp_mont_felem_mul(group, &j, &h, &i); + + // V = U1 * I + EC_FELEM v; + ec_GFp_mont_felem_mul(group, &v, &u1, &i); + + // x_out = r**2 - J - 2V + ec_GFp_mont_felem_sqr(group, &x_out, &r); + ec_felem_sub(group, &x_out, &x_out, &j); + ec_felem_sub(group, &x_out, &x_out, &v); + ec_felem_sub(group, &x_out, &x_out, &v); + + // y_out = r(V-x_out) - 2 * s1 * J + ec_felem_sub(group, &y_out, &v, &x_out); + ec_GFp_mont_felem_mul(group, &y_out, &y_out, &r); + EC_FELEM s1j; + ec_GFp_mont_felem_mul(group, &s1j, &s1, &j); + ec_felem_sub(group, &y_out, &y_out, &s1j); + ec_felem_sub(group, &y_out, &y_out, &s1j); + + ec_felem_select(group, &x_out, z1nz, &x_out, &b->X); + ec_felem_select(group, &out->X, z2nz, &x_out, &a->X); + ec_felem_select(group, &y_out, z1nz, &y_out, &b->Y); + ec_felem_select(group, &out->Y, z2nz, &y_out, &a->Y); + ec_felem_select(group, &z_out, z1nz, &z_out, &b->Z); + ec_felem_select(group, &out->Z, z2nz, &z_out, &a->Z); +} + +void ec_GFp_mont_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a) { + if (group->a_is_minus3) { + // The method is taken from: + // http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b + // + // Coq transcription and correctness proof: + // + // + EC_FELEM delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; + // delta = z^2 + ec_GFp_mont_felem_sqr(group, &delta, &a->Z); + // gamma = y^2 + ec_GFp_mont_felem_sqr(group, &gamma, &a->Y); + // beta = x*gamma + ec_GFp_mont_felem_mul(group, &beta, &a->X, &gamma); + + // alpha = 3*(x-delta)*(x+delta) + ec_felem_sub(group, &ftmp, &a->X, &delta); + ec_felem_add(group, &ftmp2, &a->X, &delta); + + ec_felem_add(group, &tmptmp, &ftmp2, &ftmp2); + ec_felem_add(group, &ftmp2, &ftmp2, &tmptmp); + ec_GFp_mont_felem_mul(group, &alpha, &ftmp, &ftmp2); + + // x' = alpha^2 - 8*beta + ec_GFp_mont_felem_sqr(group, &r->X, &alpha); + ec_felem_add(group, &fourbeta, &beta, &beta); + ec_felem_add(group, &fourbeta, &fourbeta, &fourbeta); + ec_felem_add(group, &tmptmp, &fourbeta, &fourbeta); + ec_felem_sub(group, &r->X, &r->X, &tmptmp); + + // z' = (y + z)^2 - gamma - delta + ec_felem_add(group, &delta, &gamma, &delta); + ec_felem_add(group, &ftmp, &a->Y, &a->Z); + ec_GFp_mont_felem_sqr(group, &r->Z, &ftmp); + ec_felem_sub(group, &r->Z, &r->Z, &delta); + + // y' = alpha*(4*beta - x') - 8*gamma^2 + ec_felem_sub(group, &r->Y, &fourbeta, &r->X); + ec_felem_add(group, &gamma, &gamma, &gamma); + ec_GFp_mont_felem_sqr(group, &gamma, &gamma); + ec_GFp_mont_felem_mul(group, &r->Y, &alpha, &r->Y); + ec_felem_add(group, &gamma, &gamma, &gamma); + ec_felem_sub(group, &r->Y, &r->Y, &gamma); + } else { + // The method is taken from: + // http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html#doubling-dbl-2007-bl + // + // Coq transcription and correctness proof: + // + // + EC_FELEM xx, yy, yyyy, zz; + ec_GFp_mont_felem_sqr(group, &xx, &a->X); + ec_GFp_mont_felem_sqr(group, &yy, &a->Y); + ec_GFp_mont_felem_sqr(group, &yyyy, &yy); + ec_GFp_mont_felem_sqr(group, &zz, &a->Z); + + // s = 2*((x_in + yy)^2 - xx - yyyy) + EC_FELEM s; + ec_felem_add(group, &s, &a->X, &yy); + ec_GFp_mont_felem_sqr(group, &s, &s); + ec_felem_sub(group, &s, &s, &xx); + ec_felem_sub(group, &s, &s, &yyyy); + ec_felem_add(group, &s, &s, &s); + + // m = 3*xx + a*zz^2 + EC_FELEM m; + ec_GFp_mont_felem_sqr(group, &m, &zz); + ec_GFp_mont_felem_mul(group, &m, &group->a, &m); + ec_felem_add(group, &m, &m, &xx); + ec_felem_add(group, &m, &m, &xx); + ec_felem_add(group, &m, &m, &xx); + + // x_out = m^2 - 2*s + ec_GFp_mont_felem_sqr(group, &r->X, &m); + ec_felem_sub(group, &r->X, &r->X, &s); + ec_felem_sub(group, &r->X, &r->X, &s); + + // z_out = (y_in + z_in)^2 - yy - zz + ec_felem_add(group, &r->Z, &a->Y, &a->Z); + ec_GFp_mont_felem_sqr(group, &r->Z, &r->Z); + ec_felem_sub(group, &r->Z, &r->Z, &yy); + ec_felem_sub(group, &r->Z, &r->Z, &zz); + + // y_out = m*(s-x_out) - 8*yyyy + ec_felem_add(group, &yyyy, &yyyy, &yyyy); + ec_felem_add(group, &yyyy, &yyyy, &yyyy); + ec_felem_add(group, &yyyy, &yyyy, &yyyy); + ec_felem_sub(group, &r->Y, &s, &r->X); + ec_GFp_mont_felem_mul(group, &r->Y, &r->Y, &m); + ec_felem_sub(group, &r->Y, &r->Y, &yyyy); + } +} + +static int ec_GFp_mont_cmp_x_coordinate(const EC_GROUP *group, + const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (!group->field_greater_than_order || + group->field.width != group->order.width) { + // Do not bother optimizing this case. p > order in all commonly-used + // curves. + return ec_GFp_simple_cmp_x_coordinate(group, p, r); + } + + if (ec_GFp_simple_is_at_infinity(group, p)) { + return 0; + } + + // We wish to compare X/Z^2 with r. This is equivalent to comparing X with + // r*Z^2. Note that X and Z are represented in Montgomery form, while r is + // not. + EC_FELEM r_Z2, Z2_mont, X; + ec_GFp_mont_felem_mul(group, &Z2_mont, &p->Z, &p->Z); + // r < order < p, so this is valid. + OPENSSL_memcpy(r_Z2.words, r->words, group->field.width * sizeof(BN_ULONG)); + ec_GFp_mont_felem_mul(group, &r_Z2, &r_Z2, &Z2_mont); + ec_GFp_mont_felem_from_montgomery(group, &X, &p->X); + + if (ec_felem_equal(group, &r_Z2, &X)) { + return 1; + } + + // During signing the x coefficient is reduced modulo the group order. + // Therefore there is a small possibility, less than 1/2^128, that group_order + // < p.x < P. in that case we need not only to compare against |r| but also to + // compare against r+group_order. + if (bn_less_than_words(r->words, group->field_minus_order.words, + group->field.width)) { + // We can ignore the carry because: r + group_order < p < 2^256. + bn_add_words(r_Z2.words, r->words, group->order.d, group->field.width); + ec_GFp_mont_felem_mul(group, &r_Z2, &r_Z2, &Z2_mont); + if (ec_felem_equal(group, &r_Z2, &X)) { + return 1; + } + } + + return 0; +} + +DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_mont_method) { + out->group_init = ec_GFp_mont_group_init; + out->group_finish = ec_GFp_mont_group_finish; + out->group_set_curve = ec_GFp_mont_group_set_curve; + out->point_get_affine_coordinates = ec_GFp_mont_point_get_affine_coordinates; + out->add = ec_GFp_mont_add; + out->dbl = ec_GFp_mont_dbl; + out->mul = ec_GFp_mont_mul; + out->mul_base = ec_GFp_mont_mul_base; + out->mul_public = ec_GFp_mont_mul_public; + out->felem_mul = ec_GFp_mont_felem_mul; + out->felem_sqr = ec_GFp_mont_felem_sqr; + out->bignum_to_felem = ec_GFp_mont_bignum_to_felem; + out->felem_to_bignum = ec_GFp_mont_felem_to_bignum; + out->scalar_inv_montgomery = ec_simple_scalar_inv_montgomery; + out->scalar_inv_montgomery_vartime = ec_GFp_simple_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ec_GFp_mont_cmp_x_coordinate; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c new file mode 100644 index 000000000..88ff4a22f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c @@ -0,0 +1,82 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include +#include + +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +int ec_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, const BIGNUM *in) { + if (BN_is_negative(in) || BN_cmp(in, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); + return 0; + } + return group->meth->bignum_to_felem(group, out, in); +} + +int ec_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, const EC_FELEM *in) { + return group->meth->felem_to_bignum(group, out, in); +} + +void ec_felem_neg(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a) { + // -a is zero if a is zero and p-a otherwise. + BN_ULONG mask = ec_felem_non_zero_mask(group, a); + BN_ULONG borrow = + bn_sub_words(out->words, group->field.d, a->words, group->field.width); + assert(borrow == 0); + (void)borrow; + for (int i = 0; i < group->field.width; i++) { + out->words[i] &= mask; + } +} + +void ec_felem_add(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b) { + EC_FELEM tmp; + bn_mod_add_words(out->words, a->words, b->words, group->field.d, tmp.words, + group->field.width); +} + +void ec_felem_sub(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b) { + EC_FELEM tmp; + bn_mod_sub_words(out->words, a->words, b->words, group->field.d, tmp.words, + group->field.width); +} + +BN_ULONG ec_felem_non_zero_mask(const EC_GROUP *group, const EC_FELEM *a) { + BN_ULONG mask = 0; + for (int i = 0; i < group->field.width; i++) { + mask |= a->words[i]; + } + return ~constant_time_is_zero_w(mask); +} + +void ec_felem_select(const EC_GROUP *group, EC_FELEM *out, BN_ULONG mask, + const EC_FELEM *a, const EC_FELEM *b) { + bn_select_words(out->words, mask, a->words, b->words, group->field.width); +} + +int ec_felem_equal(const EC_GROUP *group, const EC_FELEM *a, + const EC_FELEM *b) { + // Note this function is variable-time. Constant-time operations should use + // |ec_felem_non_zero_mask|. + return OPENSSL_memcmp(a->words, b->words, + group->field.width * sizeof(BN_ULONG)) == 0; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c.grpc_back new file mode 100644 index 000000000..9be9f8cd3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/felem.c.grpc_back @@ -0,0 +1,82 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include +#include + +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +int ec_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, const BIGNUM *in) { + if (BN_is_negative(in) || BN_cmp(in, &group->field) >= 0) { + OPENSSL_PUT_ERROR(EC, EC_R_COORDINATES_OUT_OF_RANGE); + return 0; + } + return group->meth->bignum_to_felem(group, out, in); +} + +int ec_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, const EC_FELEM *in) { + return group->meth->felem_to_bignum(group, out, in); +} + +void ec_felem_neg(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a) { + // -a is zero if a is zero and p-a otherwise. + BN_ULONG mask = ec_felem_non_zero_mask(group, a); + BN_ULONG borrow = + bn_sub_words(out->words, group->field.d, a->words, group->field.width); + assert(borrow == 0); + (void)borrow; + for (int i = 0; i < group->field.width; i++) { + out->words[i] &= mask; + } +} + +void ec_felem_add(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b) { + EC_FELEM tmp; + bn_mod_add_words(out->words, a->words, b->words, group->field.d, tmp.words, + group->field.width); +} + +void ec_felem_sub(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b) { + EC_FELEM tmp; + bn_mod_sub_words(out->words, a->words, b->words, group->field.d, tmp.words, + group->field.width); +} + +BN_ULONG ec_felem_non_zero_mask(const EC_GROUP *group, const EC_FELEM *a) { + BN_ULONG mask = 0; + for (int i = 0; i < group->field.width; i++) { + mask |= a->words[i]; + } + return ~constant_time_is_zero_w(mask); +} + +void ec_felem_select(const EC_GROUP *group, EC_FELEM *out, BN_ULONG mask, + const EC_FELEM *a, const EC_FELEM *b) { + bn_select_words(out->words, mask, a->words, b->words, group->field.width); +} + +int ec_felem_equal(const EC_GROUP *group, const EC_FELEM *a, + const EC_FELEM *b) { + // Note this function is variable-time. Constant-time operations should use + // |ec_felem_non_zero_mask|. + return OPENSSL_memcmp(a->words, b->words, + group->field.width * sizeof(BN_ULONG)) == 0; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h new file mode 100644 index 000000000..6396e5ceb --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h @@ -0,0 +1,503 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_EC_INTERNAL_H +#define OPENSSL_HEADER_EC_INTERNAL_H + +#include + +#include +#include +#include +#include + +#include "../bn/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Cap the size of all field elements and scalars, including custom curves, to +// 66 bytes, large enough to fit secp521r1 and brainpoolP512r1, which appear to +// be the largest fields anyone plausibly uses. +#define EC_MAX_BYTES 66 +#define EC_MAX_WORDS ((EC_MAX_BYTES + BN_BYTES - 1) / BN_BYTES) + +OPENSSL_STATIC_ASSERT(EC_MAX_WORDS <= BN_SMALL_MAX_WORDS, + "bn_*_small functions not usable"); + +// An EC_SCALAR is an integer fully reduced modulo the order. Only the first +// |order->width| words are used. An |EC_SCALAR| is specific to an |EC_GROUP| +// and must not be mixed between groups. +typedef union { + // bytes is the representation of the scalar in little-endian order. + uint8_t bytes[EC_MAX_BYTES]; + BN_ULONG words[EC_MAX_WORDS]; +} EC_SCALAR; + +// An EC_FELEM represents a field element. Only the first |field->width| words +// are used. An |EC_FELEM| is specific to an |EC_GROUP| and must not be mixed +// between groups. Additionally, the representation (whether or not elements are +// represented in Montgomery-form) may vary between |EC_METHOD|s. +typedef union { + // bytes is the representation of the field element in little-endian order. + uint8_t bytes[EC_MAX_BYTES]; + BN_ULONG words[EC_MAX_WORDS]; +} EC_FELEM; + +// An EC_RAW_POINT represents an elliptic curve point. Unlike |EC_POINT|, it is +// a plain struct which can be stack-allocated and needs no cleanup. It is +// specific to an |EC_GROUP| and must not be mixed between groups. +typedef struct { + EC_FELEM X, Y, Z; + // X, Y, and Z are Jacobian projective coordinates. They represent + // (X/Z^2, Y/Z^3) if Z != 0 and the point at infinity otherwise. +} EC_RAW_POINT; + +struct ec_method_st { + int (*group_init)(EC_GROUP *); + void (*group_finish)(EC_GROUP *); + int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *); + + // point_get_affine_coordinates sets |*x| and |*y| to the affine coordinates + // of |p|. Either |x| or |y| may be NULL to omit it. It returns one on success + // and zero if |p| is the point at infinity. + // + // Note: unlike |EC_FELEM|s used as intermediate values internal to the + // |EC_METHOD|, |*x| and |*y| are not encoded in Montgomery form. + int (*point_get_affine_coordinates)(const EC_GROUP *, const EC_RAW_POINT *p, + EC_FELEM *x, EC_FELEM *y); + + // add sets |r| to |a| + |b|. + void (*add)(const EC_GROUP *group, EC_RAW_POINT *r, const EC_RAW_POINT *a, + const EC_RAW_POINT *b); + // dbl sets |r| to |a| + |a|. + void (*dbl)(const EC_GROUP *group, EC_RAW_POINT *r, const EC_RAW_POINT *a); + + // mul sets |r| to |scalar|*|p|. + void (*mul)(const EC_GROUP *group, EC_RAW_POINT *r, const EC_RAW_POINT *p, + const EC_SCALAR *scalar); + // mul_base sets |r| to |scalar|*generator. + void (*mul_base)(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar); + // mul_public sets |r| to |g_scalar|*generator + |p_scalar|*|p|. It assumes + // that the inputs are public so there is no concern about leaking their + // values through timing. + void (*mul_public)(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar); + + // felem_mul and felem_sqr implement multiplication and squaring, + // respectively, so that the generic |EC_POINT_add| and |EC_POINT_dbl| + // implementations can work both with |EC_GFp_mont_method| and the tuned + // operations. + // + // TODO(davidben): This constrains |EC_FELEM|'s internal representation, adds + // many indirect calls in the middle of the generic code, and a bunch of + // conversions. If p224-64.c were easily convertable to Montgomery form, we + // could say |EC_FELEM| is always in Montgomery form. If we routed the rest of + // simple.c to |EC_METHOD|, we could give |EC_POINT| an |EC_METHOD|-specific + // representation and say |EC_FELEM| is purely a |EC_GFp_mont_method| type. + void (*felem_mul)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b); + void (*felem_sqr)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a); + + int (*bignum_to_felem)(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in); + int (*felem_to_bignum)(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in); + + // scalar_inv_montgomery sets |out| to |in|^-1, where both input and output + // are in Montgomery form. + void (*scalar_inv_montgomery)(const EC_GROUP *group, EC_SCALAR *out, + const EC_SCALAR *in); + + // scalar_inv_montgomery_vartime performs the same computation as + // |scalar_inv_montgomery|. It further assumes that the inputs are public so + // there is no concern about leaking their values through timing. + int (*scalar_inv_montgomery_vartime)(const EC_GROUP *group, EC_SCALAR *out, + const EC_SCALAR *in); + + // cmp_x_coordinate compares the x (affine) coordinate of |p|, mod the group + // order, with |r|. It returns one if the values match and zero if |p| is the + // point at infinity of the values do not match. + int (*cmp_x_coordinate)(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r); +} /* EC_METHOD */; + +const EC_METHOD *EC_GFp_mont_method(void); + +struct ec_group_st { + const EC_METHOD *meth; + + // Unlike all other |EC_POINT|s, |generator| does not own |generator->group| + // to avoid a reference cycle. + EC_POINT *generator; + BIGNUM order; + + int curve_name; // optional NID for named curve + + BN_MONT_CTX *order_mont; // data for ECDSA inverse + + // The following members are handled by the method functions, + // even if they appear generic + + BIGNUM field; // For curves over GF(p), this is the modulus. + + EC_FELEM a, b; // Curve coefficients. + + // a_is_minus3 is one if |a| is -3 mod |field| and zero otherwise. Point + // arithmetic is optimized for -3. + int a_is_minus3; + + // field_greater_than_order is one if |field| is greate than |order| and zero + // otherwise. + int field_greater_than_order; + + // field_minus_order, if |field_greater_than_order| is true, is |field| minus + // |order| represented as an |EC_FELEM|. Otherwise, it is zero. + // + // Note: unlike |EC_FELEM|s used as intermediate values internal to the + // |EC_METHOD|, this value is not encoded in Montgomery form. + EC_FELEM field_minus_order; + + CRYPTO_refcount_t references; + + BN_MONT_CTX *mont; // Montgomery structure. + + EC_FELEM one; // The value one. +} /* EC_GROUP */; + +struct ec_point_st { + // group is an owning reference to |group|, unless this is + // |group->generator|. + EC_GROUP *group; + // raw is the group-specific point data. Functions that take |EC_POINT| + // typically check consistency with |EC_GROUP| while functions that take + // |EC_RAW_POINT| do not. Thus accesses to this field should be externally + // checked for consistency. + EC_RAW_POINT raw; +} /* EC_POINT */; + +EC_GROUP *ec_group_new(const EC_METHOD *meth); + +// ec_bignum_to_felem converts |in| to an |EC_FELEM|. It returns one on success +// and zero if |in| is out of range. +int ec_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, const BIGNUM *in); + +// ec_felem_to_bignum converts |in| to a |BIGNUM|. It returns one on success and +// zero on allocation failure. +int ec_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, const EC_FELEM *in); + +// ec_felem_neg sets |out| to -|a|. +void ec_felem_neg(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a); + +// ec_felem_add sets |out| to |a| + |b|. +void ec_felem_add(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b); + +// ec_felem_add sets |out| to |a| - |b|. +void ec_felem_sub(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b); + +// ec_felem_non_zero_mask returns all ones if |a| is non-zero and all zeros +// otherwise. +BN_ULONG ec_felem_non_zero_mask(const EC_GROUP *group, const EC_FELEM *a); + +// ec_felem_select, in constant time, sets |out| to |a| if |mask| is all ones +// and |b| if |mask| is all zeros. +void ec_felem_select(const EC_GROUP *group, EC_FELEM *out, BN_ULONG mask, + const EC_FELEM *a, const EC_FELEM *b); + +// ec_felem_equal returns one if |a| and |b| are equal and zero otherwise. It +// treats |a| and |b| as public and does *not* run in constant time. +int ec_felem_equal(const EC_GROUP *group, const EC_FELEM *a, const EC_FELEM *b); + +// ec_bignum_to_scalar converts |in| to an |EC_SCALAR| and writes it to +// |*out|. It returns one on success and zero if |in| is out of range. +OPENSSL_EXPORT int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const BIGNUM *in); + +// ec_random_nonzero_scalar sets |out| to a uniformly selected random value from +// 1 to |group->order| - 1. It returns one on success and zero on error. +int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, + const uint8_t additional_data[32]); + +// ec_scalar_equal_vartime returns one if |a| and |b| are equal and zero +// otherwise. Both values are treated as public. +int ec_scalar_equal_vartime(const EC_GROUP *group, const EC_SCALAR *a, + const EC_SCALAR *b); + +// ec_scalar_is_zero returns one if |a| is zero and zero otherwise. +int ec_scalar_is_zero(const EC_GROUP *group, const EC_SCALAR *a); + +// ec_scalar_add sets |r| to |a| + |b|. +void ec_scalar_add(const EC_GROUP *group, EC_SCALAR *r, const EC_SCALAR *a, + const EC_SCALAR *b); + +// ec_scalar_to_montgomery sets |r| to |a| in Montgomery form. +void ec_scalar_to_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_scalar_to_montgomery sets |r| to |a| converted from Montgomery form. +void ec_scalar_from_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_scalar_mul_montgomery sets |r| to |a| * |b| where inputs and outputs are +// in Montgomery form. +void ec_scalar_mul_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a, const EC_SCALAR *b); + +// ec_scalar_mul_montgomery sets |r| to |a|^-1 where inputs and outputs are in +// Montgomery form. +void ec_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_scalar_inv_montgomery_vartime performs the same actions as +// |ec_scalar_inv_montgomery|, but in variable time. +int ec_scalar_inv_montgomery_vartime(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_point_mul_scalar sets |r| to |p| * |scalar|. Both inputs are considered +// secret. +int ec_point_mul_scalar(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar); + +// ec_point_mul_scalar_base sets |r| to generator * |scalar|. |scalar| is +// treated as secret. +int ec_point_mul_scalar_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar); + +// ec_point_mul_scalar_public performs the same computation as +// ec_point_mul_scalar. It further assumes that the inputs are public so +// there is no concern about leaking their values through timing. +OPENSSL_EXPORT int ec_point_mul_scalar_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar); + +// ec_cmp_x_coordinate compares the x (affine) coordinate of |p|, mod the group +// order, with |r|. It returns one if the values match and zero if |p| is the +// point at infinity of the values do not match. +int ec_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r); + +// ec_get_x_coordinate_as_scalar sets |*out| to |p|'s x-coordinate, modulo +// |group->order|. It returns one on success and zero if |p| is the point at +// infinity. +int ec_get_x_coordinate_as_scalar(const EC_GROUP *group, EC_SCALAR *out, + const EC_RAW_POINT *p); + +// ec_point_get_affine_coordinate_bytes writes |p|'s affine coordinates to +// |out_x| and |out_y|, each of which must have at must |max_out| bytes. It sets +// |*out_len| to the number of bytes written in each buffer. Coordinates are +// written big-endian and zero-padded to the size of the field. +// +// Either of |out_x| or |out_y| may be NULL to omit that coordinate. This +// function returns one on success and zero on failure. +int ec_point_get_affine_coordinate_bytes(const EC_GROUP *group, uint8_t *out_x, + uint8_t *out_y, size_t *out_len, + size_t max_out, const EC_RAW_POINT *p); + +// ec_field_element_to_scalar reduces |r| modulo |group->order|. |r| must +// previously have been reduced modulo |group->field|. +int ec_field_element_to_scalar(const EC_GROUP *group, BIGNUM *r); + +void ec_GFp_mont_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar); +void ec_GFp_mont_mul_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar); + +// ec_compute_wNAF writes the modified width-(w+1) Non-Adjacent Form (wNAF) of +// |scalar| to |out|. |out| must have room for |bits| + 1 elements, each of +// which will be either zero or odd with an absolute value less than 2^w +// satisfying +// scalar = \sum_j out[j]*2^j +// where at most one of any w+1 consecutive digits is non-zero +// with the exception that the most significant digit may be only +// w-1 zeros away from that next non-zero digit. +void ec_compute_wNAF(const EC_GROUP *group, int8_t *out, + const EC_SCALAR *scalar, size_t bits, int w); + +void ec_GFp_mont_mul_public(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar); + +// method functions in simple.c +int ec_GFp_simple_group_init(EC_GROUP *); +void ec_GFp_simple_group_finish(EC_GROUP *); +int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *); +int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, + BIGNUM *b); +void ec_GFp_simple_point_init(EC_RAW_POINT *); +void ec_GFp_simple_point_copy(EC_RAW_POINT *, const EC_RAW_POINT *); +void ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_RAW_POINT *); +int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_RAW_POINT *, + const BIGNUM *x, + const BIGNUM *y); +void ec_GFp_mont_add(const EC_GROUP *, EC_RAW_POINT *r, const EC_RAW_POINT *a, + const EC_RAW_POINT *b); +void ec_GFp_mont_dbl(const EC_GROUP *, EC_RAW_POINT *r, const EC_RAW_POINT *a); +void ec_GFp_simple_invert(const EC_GROUP *, EC_RAW_POINT *); +int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_RAW_POINT *); +int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_RAW_POINT *); +int ec_GFp_simple_cmp(const EC_GROUP *, const EC_RAW_POINT *a, + const EC_RAW_POINT *b); +void ec_simple_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +int ec_GFp_simple_mont_inv_mod_ord_vartime(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +int ec_GFp_simple_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r); + +// method functions in montgomery.c +int ec_GFp_mont_group_init(EC_GROUP *); +int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *); +void ec_GFp_mont_group_finish(EC_GROUP *); +void ec_GFp_mont_felem_mul(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b); +void ec_GFp_mont_felem_sqr(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a); + +int ec_GFp_mont_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in); +int ec_GFp_mont_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in); + +void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, uint8_t in); + +const EC_METHOD *EC_GFp_nistp224_method(void); +const EC_METHOD *EC_GFp_nistp256_method(void); + +// EC_GFp_nistz256_method is a GFp method using montgomery multiplication, with +// x86-64 optimized P256. See http://eprint.iacr.org/2013/816. +const EC_METHOD *EC_GFp_nistz256_method(void); + +// An EC_WRAPPED_SCALAR is an |EC_SCALAR| with a parallel |BIGNUM| +// representation. It exists to support the |EC_KEY_get0_private_key| API. +typedef struct { + BIGNUM bignum; + EC_SCALAR scalar; +} EC_WRAPPED_SCALAR; + +struct ec_key_st { + EC_GROUP *group; + + EC_POINT *pub_key; + EC_WRAPPED_SCALAR *priv_key; + + // fixed_k may contain a specific value of 'k', to be used in ECDSA signing. + // This is only for the FIPS power-on tests. + BIGNUM *fixed_k; + + unsigned int enc_flag; + point_conversion_form_t conv_form; + + CRYPTO_refcount_t references; + + ECDSA_METHOD *ecdsa_meth; + + CRYPTO_EX_DATA ex_data; +} /* EC_KEY */; + +struct built_in_curve { + int nid; + const uint8_t *oid; + uint8_t oid_len; + // comment is a human-readable string describing the curve. + const char *comment; + // param_len is the number of bytes needed to store a field element. + uint8_t param_len; + // params points to an array of 6*|param_len| bytes which hold the field + // elements of the following (in big-endian order): prime, a, b, generator x, + // generator y, order. + const uint8_t *params; + const EC_METHOD *method; +}; + +#define OPENSSL_NUM_BUILT_IN_CURVES 4 + +struct built_in_curves { + struct built_in_curve curves[OPENSSL_NUM_BUILT_IN_CURVES]; +}; + +// OPENSSL_built_in_curves returns a pointer to static information about +// standard curves. The array is terminated with an entry where |nid| is +// |NID_undef|. +const struct built_in_curves *OPENSSL_built_in_curves(void); + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_EC_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h.grpc_back new file mode 100644 index 000000000..7934c3ad0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/internal.h.grpc_back @@ -0,0 +1,503 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_EC_INTERNAL_H +#define OPENSSL_HEADER_EC_INTERNAL_H + +#include + +#include +#include +#include +#include + +#include "../bn/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Cap the size of all field elements and scalars, including custom curves, to +// 66 bytes, large enough to fit secp521r1 and brainpoolP512r1, which appear to +// be the largest fields anyone plausibly uses. +#define EC_MAX_BYTES 66 +#define EC_MAX_WORDS ((EC_MAX_BYTES + BN_BYTES - 1) / BN_BYTES) + +OPENSSL_STATIC_ASSERT(EC_MAX_WORDS <= BN_SMALL_MAX_WORDS, + "bn_*_small functions not usable"); + +// An EC_SCALAR is an integer fully reduced modulo the order. Only the first +// |order->width| words are used. An |EC_SCALAR| is specific to an |EC_GROUP| +// and must not be mixed between groups. +typedef union { + // bytes is the representation of the scalar in little-endian order. + uint8_t bytes[EC_MAX_BYTES]; + BN_ULONG words[EC_MAX_WORDS]; +} EC_SCALAR; + +// An EC_FELEM represents a field element. Only the first |field->width| words +// are used. An |EC_FELEM| is specific to an |EC_GROUP| and must not be mixed +// between groups. Additionally, the representation (whether or not elements are +// represented in Montgomery-form) may vary between |EC_METHOD|s. +typedef union { + // bytes is the representation of the field element in little-endian order. + uint8_t bytes[EC_MAX_BYTES]; + BN_ULONG words[EC_MAX_WORDS]; +} EC_FELEM; + +// An EC_RAW_POINT represents an elliptic curve point. Unlike |EC_POINT|, it is +// a plain struct which can be stack-allocated and needs no cleanup. It is +// specific to an |EC_GROUP| and must not be mixed between groups. +typedef struct { + EC_FELEM X, Y, Z; + // X, Y, and Z are Jacobian projective coordinates. They represent + // (X/Z^2, Y/Z^3) if Z != 0 and the point at infinity otherwise. +} EC_RAW_POINT; + +struct ec_method_st { + int (*group_init)(EC_GROUP *); + void (*group_finish)(EC_GROUP *); + int (*group_set_curve)(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *); + + // point_get_affine_coordinates sets |*x| and |*y| to the affine coordinates + // of |p|. Either |x| or |y| may be NULL to omit it. It returns one on success + // and zero if |p| is the point at infinity. + // + // Note: unlike |EC_FELEM|s used as intermediate values internal to the + // |EC_METHOD|, |*x| and |*y| are not encoded in Montgomery form. + int (*point_get_affine_coordinates)(const EC_GROUP *, const EC_RAW_POINT *p, + EC_FELEM *x, EC_FELEM *y); + + // add sets |r| to |a| + |b|. + void (*add)(const EC_GROUP *group, EC_RAW_POINT *r, const EC_RAW_POINT *a, + const EC_RAW_POINT *b); + // dbl sets |r| to |a| + |a|. + void (*dbl)(const EC_GROUP *group, EC_RAW_POINT *r, const EC_RAW_POINT *a); + + // mul sets |r| to |scalar|*|p|. + void (*mul)(const EC_GROUP *group, EC_RAW_POINT *r, const EC_RAW_POINT *p, + const EC_SCALAR *scalar); + // mul_base sets |r| to |scalar|*generator. + void (*mul_base)(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar); + // mul_public sets |r| to |g_scalar|*generator + |p_scalar|*|p|. It assumes + // that the inputs are public so there is no concern about leaking their + // values through timing. + void (*mul_public)(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar); + + // felem_mul and felem_sqr implement multiplication and squaring, + // respectively, so that the generic |EC_POINT_add| and |EC_POINT_dbl| + // implementations can work both with |EC_GFp_mont_method| and the tuned + // operations. + // + // TODO(davidben): This constrains |EC_FELEM|'s internal representation, adds + // many indirect calls in the middle of the generic code, and a bunch of + // conversions. If p224-64.c were easily convertable to Montgomery form, we + // could say |EC_FELEM| is always in Montgomery form. If we routed the rest of + // simple.c to |EC_METHOD|, we could give |EC_POINT| an |EC_METHOD|-specific + // representation and say |EC_FELEM| is purely a |EC_GFp_mont_method| type. + void (*felem_mul)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b); + void (*felem_sqr)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a); + + int (*bignum_to_felem)(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in); + int (*felem_to_bignum)(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in); + + // scalar_inv_montgomery sets |out| to |in|^-1, where both input and output + // are in Montgomery form. + void (*scalar_inv_montgomery)(const EC_GROUP *group, EC_SCALAR *out, + const EC_SCALAR *in); + + // scalar_inv_montgomery_vartime performs the same computation as + // |scalar_inv_montgomery|. It further assumes that the inputs are public so + // there is no concern about leaking their values through timing. + int (*scalar_inv_montgomery_vartime)(const EC_GROUP *group, EC_SCALAR *out, + const EC_SCALAR *in); + + // cmp_x_coordinate compares the x (affine) coordinate of |p|, mod the group + // order, with |r|. It returns one if the values match and zero if |p| is the + // point at infinity of the values do not match. + int (*cmp_x_coordinate)(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r); +} /* EC_METHOD */; + +const EC_METHOD *EC_GFp_mont_method(void); + +struct ec_group_st { + const EC_METHOD *meth; + + // Unlike all other |EC_POINT|s, |generator| does not own |generator->group| + // to avoid a reference cycle. + EC_POINT *generator; + BIGNUM order; + + int curve_name; // optional NID for named curve + + BN_MONT_CTX *order_mont; // data for ECDSA inverse + + // The following members are handled by the method functions, + // even if they appear generic + + BIGNUM field; // For curves over GF(p), this is the modulus. + + EC_FELEM a, b; // Curve coefficients. + + // a_is_minus3 is one if |a| is -3 mod |field| and zero otherwise. Point + // arithmetic is optimized for -3. + int a_is_minus3; + + // field_greater_than_order is one if |field| is greate than |order| and zero + // otherwise. + int field_greater_than_order; + + // field_minus_order, if |field_greater_than_order| is true, is |field| minus + // |order| represented as an |EC_FELEM|. Otherwise, it is zero. + // + // Note: unlike |EC_FELEM|s used as intermediate values internal to the + // |EC_METHOD|, this value is not encoded in Montgomery form. + EC_FELEM field_minus_order; + + CRYPTO_refcount_t references; + + BN_MONT_CTX *mont; // Montgomery structure. + + EC_FELEM one; // The value one. +} /* EC_GROUP */; + +struct ec_point_st { + // group is an owning reference to |group|, unless this is + // |group->generator|. + EC_GROUP *group; + // raw is the group-specific point data. Functions that take |EC_POINT| + // typically check consistency with |EC_GROUP| while functions that take + // |EC_RAW_POINT| do not. Thus accesses to this field should be externally + // checked for consistency. + EC_RAW_POINT raw; +} /* EC_POINT */; + +EC_GROUP *ec_group_new(const EC_METHOD *meth); + +// ec_bignum_to_felem converts |in| to an |EC_FELEM|. It returns one on success +// and zero if |in| is out of range. +int ec_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, const BIGNUM *in); + +// ec_felem_to_bignum converts |in| to a |BIGNUM|. It returns one on success and +// zero on allocation failure. +int ec_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, const EC_FELEM *in); + +// ec_felem_neg sets |out| to -|a|. +void ec_felem_neg(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a); + +// ec_felem_add sets |out| to |a| + |b|. +void ec_felem_add(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b); + +// ec_felem_add sets |out| to |a| - |b|. +void ec_felem_sub(const EC_GROUP *group, EC_FELEM *out, const EC_FELEM *a, + const EC_FELEM *b); + +// ec_felem_non_zero_mask returns all ones if |a| is non-zero and all zeros +// otherwise. +BN_ULONG ec_felem_non_zero_mask(const EC_GROUP *group, const EC_FELEM *a); + +// ec_felem_select, in constant time, sets |out| to |a| if |mask| is all ones +// and |b| if |mask| is all zeros. +void ec_felem_select(const EC_GROUP *group, EC_FELEM *out, BN_ULONG mask, + const EC_FELEM *a, const EC_FELEM *b); + +// ec_felem_equal returns one if |a| and |b| are equal and zero otherwise. It +// treats |a| and |b| as public and does *not* run in constant time. +int ec_felem_equal(const EC_GROUP *group, const EC_FELEM *a, const EC_FELEM *b); + +// ec_bignum_to_scalar converts |in| to an |EC_SCALAR| and writes it to +// |*out|. It returns one on success and zero if |in| is out of range. +OPENSSL_EXPORT int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const BIGNUM *in); + +// ec_random_nonzero_scalar sets |out| to a uniformly selected random value from +// 1 to |group->order| - 1. It returns one on success and zero on error. +int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, + const uint8_t additional_data[32]); + +// ec_scalar_equal_vartime returns one if |a| and |b| are equal and zero +// otherwise. Both values are treated as public. +int ec_scalar_equal_vartime(const EC_GROUP *group, const EC_SCALAR *a, + const EC_SCALAR *b); + +// ec_scalar_is_zero returns one if |a| is zero and zero otherwise. +int ec_scalar_is_zero(const EC_GROUP *group, const EC_SCALAR *a); + +// ec_scalar_add sets |r| to |a| + |b|. +void ec_scalar_add(const EC_GROUP *group, EC_SCALAR *r, const EC_SCALAR *a, + const EC_SCALAR *b); + +// ec_scalar_to_montgomery sets |r| to |a| in Montgomery form. +void ec_scalar_to_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_scalar_to_montgomery sets |r| to |a| converted from Montgomery form. +void ec_scalar_from_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_scalar_mul_montgomery sets |r| to |a| * |b| where inputs and outputs are +// in Montgomery form. +void ec_scalar_mul_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a, const EC_SCALAR *b); + +// ec_scalar_mul_montgomery sets |r| to |a|^-1 where inputs and outputs are in +// Montgomery form. +void ec_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_scalar_inv_montgomery_vartime performs the same actions as +// |ec_scalar_inv_montgomery|, but in variable time. +int ec_scalar_inv_montgomery_vartime(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +// ec_point_mul_scalar sets |r| to |p| * |scalar|. Both inputs are considered +// secret. +int ec_point_mul_scalar(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar); + +// ec_point_mul_scalar_base sets |r| to generator * |scalar|. |scalar| is +// treated as secret. +int ec_point_mul_scalar_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar); + +// ec_point_mul_scalar_public performs the same computation as +// ec_point_mul_scalar. It further assumes that the inputs are public so +// there is no concern about leaking their values through timing. +OPENSSL_EXPORT int ec_point_mul_scalar_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar); + +// ec_cmp_x_coordinate compares the x (affine) coordinate of |p|, mod the group +// order, with |r|. It returns one if the values match and zero if |p| is the +// point at infinity of the values do not match. +int ec_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r); + +// ec_get_x_coordinate_as_scalar sets |*out| to |p|'s x-coordinate, modulo +// |group->order|. It returns one on success and zero if |p| is the point at +// infinity. +int ec_get_x_coordinate_as_scalar(const EC_GROUP *group, EC_SCALAR *out, + const EC_RAW_POINT *p); + +// ec_point_get_affine_coordinate_bytes writes |p|'s affine coordinates to +// |out_x| and |out_y|, each of which must have at must |max_out| bytes. It sets +// |*out_len| to the number of bytes written in each buffer. Coordinates are +// written big-endian and zero-padded to the size of the field. +// +// Either of |out_x| or |out_y| may be NULL to omit that coordinate. This +// function returns one on success and zero on failure. +int ec_point_get_affine_coordinate_bytes(const EC_GROUP *group, uint8_t *out_x, + uint8_t *out_y, size_t *out_len, + size_t max_out, const EC_RAW_POINT *p); + +// ec_field_element_to_scalar reduces |r| modulo |group->order|. |r| must +// previously have been reduced modulo |group->field|. +int ec_field_element_to_scalar(const EC_GROUP *group, BIGNUM *r); + +void ec_GFp_mont_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar); +void ec_GFp_mont_mul_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar); + +// ec_compute_wNAF writes the modified width-(w+1) Non-Adjacent Form (wNAF) of +// |scalar| to |out|. |out| must have room for |bits| + 1 elements, each of +// which will be either zero or odd with an absolute value less than 2^w +// satisfying +// scalar = \sum_j out[j]*2^j +// where at most one of any w+1 consecutive digits is non-zero +// with the exception that the most significant digit may be only +// w-1 zeros away from that next non-zero digit. +void ec_compute_wNAF(const EC_GROUP *group, int8_t *out, + const EC_SCALAR *scalar, size_t bits, int w); + +void ec_GFp_mont_mul_public(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar); + +// method functions in simple.c +int ec_GFp_simple_group_init(EC_GROUP *); +void ec_GFp_simple_group_finish(EC_GROUP *); +int ec_GFp_simple_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *); +int ec_GFp_simple_group_get_curve(const EC_GROUP *, BIGNUM *p, BIGNUM *a, + BIGNUM *b); +void ec_GFp_simple_point_init(EC_RAW_POINT *); +void ec_GFp_simple_point_copy(EC_RAW_POINT *, const EC_RAW_POINT *); +void ec_GFp_simple_point_set_to_infinity(const EC_GROUP *, EC_RAW_POINT *); +int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *, EC_RAW_POINT *, + const BIGNUM *x, + const BIGNUM *y); +void ec_GFp_mont_add(const EC_GROUP *, EC_RAW_POINT *r, const EC_RAW_POINT *a, + const EC_RAW_POINT *b); +void ec_GFp_mont_dbl(const EC_GROUP *, EC_RAW_POINT *r, const EC_RAW_POINT *a); +void ec_GFp_simple_invert(const EC_GROUP *, EC_RAW_POINT *); +int ec_GFp_simple_is_at_infinity(const EC_GROUP *, const EC_RAW_POINT *); +int ec_GFp_simple_is_on_curve(const EC_GROUP *, const EC_RAW_POINT *); +int ec_GFp_simple_cmp(const EC_GROUP *, const EC_RAW_POINT *a, + const EC_RAW_POINT *b); +void ec_simple_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +int ec_GFp_simple_mont_inv_mod_ord_vartime(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a); + +int ec_GFp_simple_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r); + +// method functions in montgomery.c +int ec_GFp_mont_group_init(EC_GROUP *); +int ec_GFp_mont_group_set_curve(EC_GROUP *, const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *); +void ec_GFp_mont_group_finish(EC_GROUP *); +void ec_GFp_mont_felem_mul(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b); +void ec_GFp_mont_felem_sqr(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a); + +int ec_GFp_mont_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in); +int ec_GFp_mont_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in); + +void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, uint8_t in); + +const EC_METHOD *EC_GFp_nistp224_method(void); +const EC_METHOD *EC_GFp_nistp256_method(void); + +// EC_GFp_nistz256_method is a GFp method using montgomery multiplication, with +// x86-64 optimized P256. See http://eprint.iacr.org/2013/816. +const EC_METHOD *EC_GFp_nistz256_method(void); + +// An EC_WRAPPED_SCALAR is an |EC_SCALAR| with a parallel |BIGNUM| +// representation. It exists to support the |EC_KEY_get0_private_key| API. +typedef struct { + BIGNUM bignum; + EC_SCALAR scalar; +} EC_WRAPPED_SCALAR; + +struct ec_key_st { + EC_GROUP *group; + + EC_POINT *pub_key; + EC_WRAPPED_SCALAR *priv_key; + + // fixed_k may contain a specific value of 'k', to be used in ECDSA signing. + // This is only for the FIPS power-on tests. + BIGNUM *fixed_k; + + unsigned int enc_flag; + point_conversion_form_t conv_form; + + CRYPTO_refcount_t references; + + ECDSA_METHOD *ecdsa_meth; + + CRYPTO_EX_DATA ex_data; +} /* EC_KEY */; + +struct built_in_curve { + int nid; + const uint8_t *oid; + uint8_t oid_len; + // comment is a human-readable string describing the curve. + const char *comment; + // param_len is the number of bytes needed to store a field element. + uint8_t param_len; + // params points to an array of 6*|param_len| bytes which hold the field + // elements of the following (in big-endian order): prime, a, b, generator x, + // generator y, order. + const uint8_t *params; + const EC_METHOD *method; +}; + +#define OPENSSL_NUM_BUILT_IN_CURVES 4 + +struct built_in_curves { + struct built_in_curve curves[OPENSSL_NUM_BUILT_IN_CURVES]; +}; + +// OPENSSL_built_in_curves returns a pointer to static information about +// standard curves. The array is terminated with an entry where |nid| is +// |NID_undef|. +const struct built_in_curves *OPENSSL_built_in_curves(void); + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_EC_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/oct.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/oct.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c index d4d083784..aa428054d 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/oct.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c @@ -74,22 +74,18 @@ static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, - const EC_POINT *point, + const EC_RAW_POINT *point, point_conversion_form_t form, - uint8_t *buf, size_t len, BN_CTX *ctx) { - size_t ret = 0; - BN_CTX *new_ctx = NULL; - int used_ctx = 0; - - if ((form != POINT_CONVERSION_COMPRESSED) && - (form != POINT_CONVERSION_UNCOMPRESSED)) { + uint8_t *buf, size_t len) { + if (form != POINT_CONVERSION_COMPRESSED && + form != POINT_CONVERSION_UNCOMPRESSED) { OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FORM); - goto err; + return 0; } - if (EC_POINT_is_at_infinity(group, point)) { + if (ec_GFp_simple_is_at_infinity(group, point)) { OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - goto err; + return 0; } const size_t field_len = BN_num_bytes(&group->field); @@ -103,64 +99,31 @@ static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, if (buf != NULL) { if (len < output_len) { OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); - goto err; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } + return 0; } - BN_CTX_start(ctx); - used_ctx = 1; - BIGNUM *x = BN_CTX_get(ctx); - BIGNUM *y = BN_CTX_get(ctx); - if (y == NULL) { - goto err; + uint8_t y_buf[EC_MAX_BYTES]; + size_t field_len_out; + if (!ec_point_get_affine_coordinate_bytes( + group, buf + 1 /* x */, + form == POINT_CONVERSION_COMPRESSED ? y_buf : buf + 1 + field_len, + &field_len_out, field_len, point)) { + return 0; } - if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) { - goto err; + if (field_len_out != field_len) { + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + return 0; } - if ((form == POINT_CONVERSION_COMPRESSED) && - BN_is_odd(y)) { - buf[0] = form + 1; + if (form == POINT_CONVERSION_COMPRESSED) { + buf[0] = form + (y_buf[field_len - 1] & 1); } else { buf[0] = form; } - size_t i = 1; - - if (!BN_bn2bin_padded(buf + i, field_len, x)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - i += field_len; - - if (form == POINT_CONVERSION_UNCOMPRESSED) { - if (!BN_bn2bin_padded(buf + i, field_len, y)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - i += field_len; - } - - if (i != output_len) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } } - ret = output_len; - -err: - if (used_ctx) { - BN_CTX_end(ctx); - } - BN_CTX_free(new_ctx); - return ret; + return output_len; } static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, @@ -263,7 +226,7 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_point2oct(group, point, form, buf, len, ctx); + return ec_GFp_simple_point2oct(group, &point->raw, form, buf, len); } int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/oct.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/oct.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c.grpc_back index 19e17a7c0..04b1f2cc8 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/oct.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/oct.c.grpc_back @@ -74,22 +74,18 @@ static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, - const EC_POINT *point, + const EC_RAW_POINT *point, point_conversion_form_t form, - uint8_t *buf, size_t len, BN_CTX *ctx) { - size_t ret = 0; - BN_CTX *new_ctx = NULL; - int used_ctx = 0; - - if ((form != POINT_CONVERSION_COMPRESSED) && - (form != POINT_CONVERSION_UNCOMPRESSED)) { + uint8_t *buf, size_t len) { + if (form != POINT_CONVERSION_COMPRESSED && + form != POINT_CONVERSION_UNCOMPRESSED) { OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FORM); - goto err; + return 0; } - if (EC_POINT_is_at_infinity(group, point)) { + if (ec_GFp_simple_is_at_infinity(group, point)) { OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - goto err; + return 0; } const size_t field_len = BN_num_bytes(&group->field); @@ -103,64 +99,31 @@ static size_t ec_GFp_simple_point2oct(const EC_GROUP *group, if (buf != NULL) { if (len < output_len) { OPENSSL_PUT_ERROR(EC, EC_R_BUFFER_TOO_SMALL); - goto err; - } - - if (ctx == NULL) { - ctx = new_ctx = BN_CTX_new(); - if (ctx == NULL) { - goto err; - } + return 0; } - BN_CTX_start(ctx); - used_ctx = 1; - BIGNUM *x = BN_CTX_get(ctx); - BIGNUM *y = BN_CTX_get(ctx); - if (y == NULL) { - goto err; + uint8_t y_buf[EC_MAX_BYTES]; + size_t field_len_out; + if (!ec_point_get_affine_coordinate_bytes( + group, buf + 1 /* x */, + form == POINT_CONVERSION_COMPRESSED ? y_buf : buf + 1 + field_len, + &field_len_out, field_len, point)) { + return 0; } - if (!EC_POINT_get_affine_coordinates_GFp(group, point, x, y, ctx)) { - goto err; + if (field_len_out != field_len) { + OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); + return 0; } - if ((form == POINT_CONVERSION_COMPRESSED) && - BN_is_odd(y)) { - buf[0] = form + 1; + if (form == POINT_CONVERSION_COMPRESSED) { + buf[0] = form + (y_buf[field_len - 1] & 1); } else { buf[0] = form; } - size_t i = 1; - - if (!BN_bn2bin_padded(buf + i, field_len, x)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - i += field_len; - - if (form == POINT_CONVERSION_UNCOMPRESSED) { - if (!BN_bn2bin_padded(buf + i, field_len, y)) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } - i += field_len; - } - - if (i != output_len) { - OPENSSL_PUT_ERROR(EC, ERR_R_INTERNAL_ERROR); - goto err; - } } - ret = output_len; - -err: - if (used_ctx) { - BN_CTX_end(ctx); - } - BN_CTX_free(new_ctx); - return ret; + return output_len; } static int ec_GFp_simple_oct2point(const EC_GROUP *group, EC_POINT *point, @@ -263,7 +226,7 @@ size_t EC_POINT_point2oct(const EC_GROUP *group, const EC_POINT *point, OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); return 0; } - return ec_GFp_simple_point2oct(group, point, form, buf, len, ctx); + return ec_GFp_simple_point2oct(group, &point->raw, form, buf, len); } int EC_POINT_set_compressed_coordinates_GFp(const EC_GROUP *group, diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p224-64.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c similarity index 76% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p224-64.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c index 0433b0893..4932289da 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p224-64.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c @@ -203,40 +203,65 @@ static void p224_felem_to_bin28(uint8_t out[28], const p224_felem in) { } } -// To preserve endianness when using BN_bn2bin and BN_bin2bn -static void p224_flip_endian(uint8_t *out, const uint8_t *in, size_t len) { - for (size_t i = 0; i < len; ++i) { - out[i] = in[len - 1 - i]; - } +static void p224_generic_to_felem(p224_felem out, const EC_FELEM *in) { + p224_bin28_to_felem(out, in->bytes); } -// From OpenSSL BIGNUM to internal representation -static int p224_BN_to_felem(p224_felem out, const BIGNUM *bn) { - // BN_bn2bin eats leading zeroes - p224_felem_bytearray b_out; - OPENSSL_memset(b_out, 0, sizeof(b_out)); - size_t num_bytes = BN_num_bytes(bn); - if (num_bytes > sizeof(b_out) || - BN_is_negative(bn)) { - OPENSSL_PUT_ERROR(EC, EC_R_BIGNUM_OUT_OF_RANGE); - return 0; - } +// Requires 0 <= in < 2*p (always call p224_felem_reduce first) +static void p224_felem_to_generic(EC_FELEM *out, const p224_felem in) { + // Reduce to unique minimal representation. + static const int64_t two56 = ((p224_limb)1) << 56; + // 0 <= in < 2*p, p = 2^224 - 2^96 + 1 + // if in > p , reduce in = in - 2^224 + 2^96 - 1 + int64_t tmp[4], a; + tmp[0] = in[0]; + tmp[1] = in[1]; + tmp[2] = in[2]; + tmp[3] = in[3]; + // Case 1: a = 1 iff in >= 2^224 + a = (in[3] >> 56); + tmp[0] -= a; + tmp[1] += a << 40; + tmp[3] &= 0x00ffffffffffffff; + // Case 2: a = 0 iff p <= in < 2^224, i.e., the high 128 bits are all 1 and + // the lower part is non-zero + a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) | + (((int64_t)(in[0] + (in[1] & 0x000000ffffffffff)) - 1) >> 63); + a &= 0x00ffffffffffffff; + // turn a into an all-one mask (if a = 0) or an all-zero mask + a = (a - 1) >> 63; + // subtract 2^224 - 2^96 + 1 if a is all-one + tmp[3] &= a ^ 0xffffffffffffffff; + tmp[2] &= a ^ 0xffffffffffffffff; + tmp[1] &= (a ^ 0xffffffffffffffff) | 0x000000ffffffffff; + tmp[0] -= 1 & a; - p224_felem_bytearray b_in; - num_bytes = BN_bn2bin(bn, b_in); - p224_flip_endian(b_out, b_in, num_bytes); - p224_bin28_to_felem(out, b_out); - return 1; -} + // eliminate negative coefficients: if tmp[0] is negative, tmp[1] must + // be non-zero, so we only need one step + a = tmp[0] >> 63; + tmp[0] += two56 & a; + tmp[1] -= 1 & a; -// From internal representation to OpenSSL BIGNUM -static BIGNUM *p224_felem_to_BN(BIGNUM *out, const p224_felem in) { - p224_felem_bytearray b_in, b_out; - p224_felem_to_bin28(b_in, in); - p224_flip_endian(b_out, b_in, sizeof(b_out)); - return BN_bin2bn(b_out, sizeof(b_out), out); + // carry 1 -> 2 -> 3 + tmp[2] += tmp[1] >> 56; + tmp[1] &= 0x00ffffffffffffff; + + tmp[3] += tmp[2] >> 56; + tmp[2] &= 0x00ffffffffffffff; + + // Now 0 <= tmp < p + p224_felem tmp2; + tmp2[0] = tmp[0]; + tmp2[1] = tmp[1]; + tmp2[2] = tmp[2]; + tmp2[3] = tmp[3]; + + p224_felem_to_bin28(out->bytes, tmp2); + // 224 is not a multiple of 64, so zero the remaining bytes. + OPENSSL_memset(out->bytes + 28, 0, 32 - 28); } + // Field operations, using the internal representation of field elements. // NB! These operations are specific to our point multiplication and cannot be // expected to be correct in general - e.g., multiplication with a large scalar @@ -447,55 +472,6 @@ static void p224_felem_reduce(p224_felem out, const p224_widefelem in) { out[3] = output[3]; } -// Reduce to unique minimal representation. -// Requires 0 <= in < 2*p (always call p224_felem_reduce first) -static void p224_felem_contract(p224_felem out, const p224_felem in) { - static const int64_t two56 = ((p224_limb)1) << 56; - // 0 <= in < 2*p, p = 2^224 - 2^96 + 1 - // if in > p , reduce in = in - 2^224 + 2^96 - 1 - int64_t tmp[4], a; - tmp[0] = in[0]; - tmp[1] = in[1]; - tmp[2] = in[2]; - tmp[3] = in[3]; - // Case 1: a = 1 iff in >= 2^224 - a = (in[3] >> 56); - tmp[0] -= a; - tmp[1] += a << 40; - tmp[3] &= 0x00ffffffffffffff; - // Case 2: a = 0 iff p <= in < 2^224, i.e., the high 128 bits are all 1 and - // the lower part is non-zero - a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) | - (((int64_t)(in[0] + (in[1] & 0x000000ffffffffff)) - 1) >> 63); - a &= 0x00ffffffffffffff; - // turn a into an all-one mask (if a = 0) or an all-zero mask - a = (a - 1) >> 63; - // subtract 2^224 - 2^96 + 1 if a is all-one - tmp[3] &= a ^ 0xffffffffffffffff; - tmp[2] &= a ^ 0xffffffffffffffff; - tmp[1] &= (a ^ 0xffffffffffffffff) | 0x000000ffffffffff; - tmp[0] -= 1 & a; - - // eliminate negative coefficients: if tmp[0] is negative, tmp[1] must - // be non-zero, so we only need one step - a = tmp[0] >> 63; - tmp[0] += two56 & a; - tmp[1] -= 1 & a; - - // carry 1 -> 2 -> 3 - tmp[2] += tmp[1] >> 56; - tmp[1] &= 0x00ffffffffffffff; - - tmp[3] += tmp[2] >> 56; - tmp[2] &= 0x00ffffffffffffff; - - // Now 0 <= out < p - out[0] = tmp[0]; - out[1] = tmp[1]; - out[2] = tmp[2]; - out[3] = tmp[3]; -} - // Get negative value: out = -in // Requires in[i] < 2^63, // ensures out[0] < 2^56, out[1] < 2^56, out[2] < 2^56, out[3] <= 2^56 + 2^16 @@ -782,7 +758,9 @@ static void p224_point_add(p224_felem x3, p224_felem y3, p224_felem z3, z1_is_zero = p224_felem_is_zero(z1); z2_is_zero = p224_felem_is_zero(z2); // In affine coordinates, (X_1, Y_1) == (X_2, Y_2) - if (x_equal && y_equal && !z1_is_zero && !z2_is_zero) { + p224_limb is_nontrivial_double = + x_equal & y_equal & (1 - z1_is_zero) & (1 - z2_is_zero); + if (is_nontrivial_double) { p224_point_double(x3, y3, z3, x1, y1, z1); return; } @@ -895,196 +873,295 @@ static char p224_get_bit(const p224_felem_bytearray in, size_t i) { return (in[i >> 3] >> (i & 7)) & 1; } -// Interleaved point multiplication using precomputed point multiples: -// The small point multiples 0*P, 1*P, ..., 16*P are in p_pre_comp, the scalars -// in p_scalar, if non-NULL. If g_scalar is non-NULL, we also add this multiple -// of the generator, using certain (large) precomputed multiples in -// g_p224_pre_comp. Output point (X, Y, Z) is stored in x_out, y_out, z_out -static void p224_batch_mul(p224_felem x_out, p224_felem y_out, p224_felem z_out, - const uint8_t *p_scalar, const uint8_t *g_scalar, - const p224_felem p_pre_comp[17][3]) { - p224_felem nq[3], tmp[4]; - uint64_t bits; - uint8_t sign, digit; +// Takes the Jacobian coordinates (X, Y, Z) of a point and returns +// (X', Y') = (X/Z^2, Y/Z^3) +static int ec_GFp_nistp224_point_get_affine_coordinates( + const EC_GROUP *group, const EC_RAW_POINT *point, EC_FELEM *x, + EC_FELEM *y) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } - // set nq to the point at infinity - OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); + p224_felem z1, z2; + p224_widefelem tmp; + p224_generic_to_felem(z1, &point->Z); + p224_felem_inv(z2, z1); + p224_felem_square(tmp, z2); + p224_felem_reduce(z1, tmp); - // Loop over both scalars msb-to-lsb, interleaving additions of multiples of - // the generator (two in each of the last 28 rounds) and additions of p (every - // 5th round). - int skip = 1; // save two point operations in the first round - size_t i = p_scalar != NULL ? 220 : 27; - for (;;) { - // double - if (!skip) { - p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + if (x != NULL) { + p224_felem x_in, x_out; + p224_generic_to_felem(x_in, &point->X); + p224_felem_mul(tmp, x_in, z1); + p224_felem_reduce(x_out, tmp); + p224_felem_to_generic(x, x_out); + } + + if (y != NULL) { + p224_felem y_in, y_out; + p224_generic_to_felem(y_in, &point->Y); + p224_felem_mul(tmp, z1, z2); + p224_felem_reduce(z1, tmp); + p224_felem_mul(tmp, y_in, z1); + p224_felem_reduce(y_out, tmp); + p224_felem_to_generic(y, y_out); + } + + return 1; +} + +static void ec_GFp_nistp224_add(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a, const EC_RAW_POINT *b) { + p224_felem x1, y1, z1, x2, y2, z2; + p224_generic_to_felem(x1, &a->X); + p224_generic_to_felem(y1, &a->Y); + p224_generic_to_felem(z1, &a->Z); + p224_generic_to_felem(x2, &b->X); + p224_generic_to_felem(y2, &b->Y); + p224_generic_to_felem(z2, &b->Z); + p224_point_add(x1, y1, z1, x1, y1, z1, 0 /* both Jacobian */, x2, y2, z2); + // The outputs are already reduced, but still need to be contracted. + p224_felem_to_generic(&r->X, x1); + p224_felem_to_generic(&r->Y, y1); + p224_felem_to_generic(&r->Z, z1); +} + +static void ec_GFp_nistp224_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a) { + p224_felem x, y, z; + p224_generic_to_felem(x, &a->X); + p224_generic_to_felem(y, &a->Y); + p224_generic_to_felem(z, &a->Z); + p224_point_double(x, y, z, x, y, z); + // The outputs are already reduced, but still need to be contracted. + p224_felem_to_generic(&r->X, x); + p224_felem_to_generic(&r->Y, y); + p224_felem_to_generic(&r->Z, z); +} + +static void ec_GFp_nistp224_make_precomp(p224_felem out[17][3], + const EC_RAW_POINT *p) { + OPENSSL_memset(out[0], 0, sizeof(p224_felem) * 3); + + p224_generic_to_felem(out[1][0], &p->X); + p224_generic_to_felem(out[1][1], &p->Y); + p224_generic_to_felem(out[1][2], &p->Z); + + for (size_t j = 2; j <= 16; ++j) { + if (j & 1) { + p224_point_add(out[j][0], out[j][1], out[j][2], out[1][0], out[1][1], + out[1][2], 0, out[j - 1][0], out[j - 1][1], out[j - 1][2]); + } else { + p224_point_double(out[j][0], out[j][1], out[j][2], out[j / 2][0], + out[j / 2][1], out[j / 2][2]); } + } +} - // add multiples of the generator - if (g_scalar != NULL && i <= 27) { - // first, look 28 bits upwards - bits = p224_get_bit(g_scalar, i + 196) << 3; - bits |= p224_get_bit(g_scalar, i + 140) << 2; - bits |= p224_get_bit(g_scalar, i + 84) << 1; - bits |= p224_get_bit(g_scalar, i + 28); - // select the point to add, in constant time - p224_select_point(bits, 16, g_p224_pre_comp[1], tmp); +static void ec_GFp_nistp224_point_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *scalar) { + p224_felem p_pre_comp[17][3]; + ec_GFp_nistp224_make_precomp(p_pre_comp, p); - if (!skip) { - p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, - tmp[0], tmp[1], tmp[2]); - } else { - OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); - skip = 0; - } + // Set nq to the point at infinity. + p224_felem nq[3], tmp[4]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); - // second, look at the current position - bits = p224_get_bit(g_scalar, i + 168) << 3; - bits |= p224_get_bit(g_scalar, i + 112) << 2; - bits |= p224_get_bit(g_scalar, i + 56) << 1; - bits |= p224_get_bit(g_scalar, i); - // select the point to add, in constant time - p224_select_point(bits, 16, g_p224_pre_comp[0], tmp); - p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, - tmp[0], tmp[1], tmp[2]); + int skip = 1; // Save two point operations in the first round. + for (size_t i = 220; i < 221; i--) { + if (!skip) { + p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); } - // do other additions every 5 doublings - if (p_scalar != NULL && i % 5 == 0) { - bits = p224_get_bit(p_scalar, i + 4) << 5; - bits |= p224_get_bit(p_scalar, i + 3) << 4; - bits |= p224_get_bit(p_scalar, i + 2) << 3; - bits |= p224_get_bit(p_scalar, i + 1) << 2; - bits |= p224_get_bit(p_scalar, i) << 1; - bits |= p224_get_bit(p_scalar, i - 1); + // Add every 5 doublings. + if (i % 5 == 0) { + uint64_t bits = p224_get_bit(scalar->bytes, i + 4) << 5; + bits |= p224_get_bit(scalar->bytes, i + 3) << 4; + bits |= p224_get_bit(scalar->bytes, i + 2) << 3; + bits |= p224_get_bit(scalar->bytes, i + 1) << 2; + bits |= p224_get_bit(scalar->bytes, i) << 1; + bits |= p224_get_bit(scalar->bytes, i - 1); + uint8_t sign, digit; ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); - // select the point to add or subtract - p224_select_point(digit, 17, p_pre_comp, tmp); + // Select the point to add or subtract. + p224_select_point(digit, 17, (const p224_felem(*)[3])p_pre_comp, tmp); p224_felem_neg(tmp[3], tmp[1]); // (X, -Y, Z) is the negative point p224_copy_conditional(tmp[1], tmp[3], sign); if (!skip) { p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, - tmp[0], tmp[1], tmp[2]); + tmp[0], tmp[1], tmp[2]); } else { OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); skip = 0; } } - - if (i == 0) { - break; - } - --i; } - p224_felem_assign(x_out, nq[0]); - p224_felem_assign(y_out, nq[1]); - p224_felem_assign(z_out, nq[2]); -} -// Takes the Jacobian coordinates (X, Y, Z) of a point and returns -// (X', Y') = (X/Z^2, Y/Z^3) -static int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, - BN_CTX *ctx) { - p224_felem z1, z2, x_in, y_in, x_out, y_out; - p224_widefelem tmp; + // Reduce the output to its unique minimal representation. + p224_felem_to_generic(&r->X, nq[0]); + p224_felem_to_generic(&r->Y, nq[1]); + p224_felem_to_generic(&r->Z, nq[2]); +} - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } +static void ec_GFp_nistp224_point_mul_base(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + // Set nq to the point at infinity. + p224_felem nq[3], tmp[3]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); - if (!p224_BN_to_felem(x_in, &point->X) || - !p224_BN_to_felem(y_in, &point->Y) || - !p224_BN_to_felem(z1, &point->Z)) { - return 0; - } + int skip = 1; // Save two point operations in the first round. + for (size_t i = 27; i < 28; i--) { + // double + if (!skip) { + p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + } - p224_felem_inv(z2, z1); - p224_felem_square(tmp, z2); - p224_felem_reduce(z1, tmp); + // First, look 28 bits upwards. + uint64_t bits = p224_get_bit(scalar->bytes, i + 196) << 3; + bits |= p224_get_bit(scalar->bytes, i + 140) << 2; + bits |= p224_get_bit(scalar->bytes, i + 84) << 1; + bits |= p224_get_bit(scalar->bytes, i + 28); + // Select the point to add, in constant time. + p224_select_point(bits, 16, g_p224_pre_comp[1], tmp); - if (x != NULL) { - p224_felem_mul(tmp, x_in, z1); - p224_felem_reduce(x_in, tmp); - p224_felem_contract(x_out, x_in); - if (!p224_felem_to_BN(x, x_out)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; + if (!skip) { + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + tmp[0], tmp[1], tmp[2]); + } else { + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; } - } - if (y != NULL) { - p224_felem_mul(tmp, z1, z2); - p224_felem_reduce(z1, tmp); - p224_felem_mul(tmp, y_in, z1); - p224_felem_reduce(y_in, tmp); - p224_felem_contract(y_out, y_in); - if (!p224_felem_to_BN(y, y_out)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } + // Second, look at the current position/ + bits = p224_get_bit(scalar->bytes, i + 168) << 3; + bits |= p224_get_bit(scalar->bytes, i + 112) << 2; + bits |= p224_get_bit(scalar->bytes, i + 56) << 1; + bits |= p224_get_bit(scalar->bytes, i); + // Select the point to add, in constant time. + p224_select_point(bits, 16, g_p224_pre_comp[0], tmp); + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + tmp[0], tmp[1], tmp[2]); } - return 1; + // Reduce the output to its unique minimal representation. + p224_felem_to_generic(&r->X, nq[0]); + p224_felem_to_generic(&r->Y, nq[1]); + p224_felem_to_generic(&r->Z, nq[2]); } -static int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { +static void ec_GFp_nistp224_point_mul_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + // TODO(davidben): If P-224 ECDSA verify performance ever matters, using + // |ec_compute_wNAF| for |p_scalar| would likely be an easy improvement. p224_felem p_pre_comp[17][3]; - p224_felem x_in, y_in, z_in, x_out, y_out, z_out; - - if (p != NULL && p_scalar != NULL) { - // We treat NULL scalars as 0, and NULL points as points at infinity, i.e., - // they contribute nothing to the linear combination. - OPENSSL_memset(&p_pre_comp, 0, sizeof(p_pre_comp)); - // precompute multiples - if (!p224_BN_to_felem(x_out, &p->X) || - !p224_BN_to_felem(y_out, &p->Y) || - !p224_BN_to_felem(z_out, &p->Z)) { - return 0; + ec_GFp_nistp224_make_precomp(p_pre_comp, p); + + // Set nq to the point at infinity. + p224_felem nq[3], tmp[3]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); + + // Loop over both scalars msb-to-lsb, interleaving additions of multiples of + // the generator (two in each of the last 28 rounds) and additions of p (every + // 5th round). + int skip = 1; // Save two point operations in the first round. + for (size_t i = 220; i < 221; i--) { + if (!skip) { + p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); } - p224_felem_assign(p_pre_comp[1][0], x_out); - p224_felem_assign(p_pre_comp[1][1], y_out); - p224_felem_assign(p_pre_comp[1][2], z_out); + // Add multiples of the generator. + if (i <= 27) { + // First, look 28 bits upwards. + uint64_t bits = p224_get_bit(g_scalar->bytes, i + 196) << 3; + bits |= p224_get_bit(g_scalar->bytes, i + 140) << 2; + bits |= p224_get_bit(g_scalar->bytes, i + 84) << 1; + bits |= p224_get_bit(g_scalar->bytes, i + 28); - for (size_t j = 2; j <= 16; ++j) { - if (j & 1) { - p224_point_add(p_pre_comp[j][0], p_pre_comp[j][1], p_pre_comp[j][2], - p_pre_comp[1][0], p_pre_comp[1][1], p_pre_comp[1][2], - 0, p_pre_comp[j - 1][0], p_pre_comp[j - 1][1], - p_pre_comp[j - 1][2]); + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + g_p224_pre_comp[1][bits][0], g_p224_pre_comp[1][bits][1], + g_p224_pre_comp[1][bits][2]); + assert(!skip); + + // Second, look at the current position. + bits = p224_get_bit(g_scalar->bytes, i + 168) << 3; + bits |= p224_get_bit(g_scalar->bytes, i + 112) << 2; + bits |= p224_get_bit(g_scalar->bytes, i + 56) << 1; + bits |= p224_get_bit(g_scalar->bytes, i); + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + g_p224_pre_comp[0][bits][0], g_p224_pre_comp[0][bits][1], + g_p224_pre_comp[0][bits][2]); + } + + // Incorporate |p_scalar| every 5 doublings. + if (i % 5 == 0) { + uint64_t bits = p224_get_bit(p_scalar->bytes, i + 4) << 5; + bits |= p224_get_bit(p_scalar->bytes, i + 3) << 4; + bits |= p224_get_bit(p_scalar->bytes, i + 2) << 3; + bits |= p224_get_bit(p_scalar->bytes, i + 1) << 2; + bits |= p224_get_bit(p_scalar->bytes, i) << 1; + bits |= p224_get_bit(p_scalar->bytes, i - 1); + uint8_t sign, digit; + ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); + + // Select the point to add or subtract. + OPENSSL_memcpy(tmp, p_pre_comp[digit], 3 * sizeof(p224_felem)); + if (sign) { + p224_felem_neg(tmp[1], tmp[1]); // (X, -Y, Z) is the negative point + } + + if (!skip) { + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, + tmp[0], tmp[1], tmp[2]); } else { - p224_point_double(p_pre_comp[j][0], p_pre_comp[j][1], - p_pre_comp[j][2], p_pre_comp[j / 2][0], - p_pre_comp[j / 2][1], p_pre_comp[j / 2][2]); + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; } } } - p224_batch_mul(x_out, y_out, z_out, - (p != NULL && p_scalar != NULL) ? p_scalar->bytes : NULL, - g_scalar != NULL ? g_scalar->bytes : NULL, - (const p224_felem(*)[3])p_pre_comp); - - // reduce the output to its unique minimal representation - p224_felem_contract(x_in, x_out); - p224_felem_contract(y_in, y_out); - p224_felem_contract(z_in, z_out); - if (!p224_felem_to_BN(&r->X, x_in) || - !p224_felem_to_BN(&r->Y, y_in) || - !p224_felem_to_BN(&r->Z, z_in)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - return 1; + // Reduce the output to its unique minimal representation. + p224_felem_to_generic(&r->X, nq[0]); + p224_felem_to_generic(&r->Y, nq[1]); + p224_felem_to_generic(&r->Z, nq[2]); +} + +static void ec_GFp_nistp224_felem_mul(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a, const EC_FELEM *b) { + p224_felem felem1, felem2; + p224_widefelem wide; + p224_generic_to_felem(felem1, a); + p224_generic_to_felem(felem2, b); + p224_felem_mul(wide, felem1, felem2); + p224_felem_reduce(felem1, wide); + p224_felem_to_generic(r, felem1); +} + +static void ec_GFp_nistp224_felem_sqr(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a) { + p224_felem felem; + p224_generic_to_felem(felem, a); + p224_widefelem wide; + p224_felem_square(wide, felem); + p224_felem_reduce(felem, wide); + p224_felem_to_generic(r, felem); +} + +static int ec_GFp_nistp224_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in) { + return bn_copy_words(out->words, group->field.width, in); +} + +static int ec_GFp_nistp224_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in) { + return bn_set_words(out, in->words, group->field.width); } DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp224_method) { @@ -1093,12 +1170,18 @@ DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp224_method) { out->group_set_curve = ec_GFp_simple_group_set_curve; out->point_get_affine_coordinates = ec_GFp_nistp224_point_get_affine_coordinates; - out->mul = ec_GFp_nistp224_points_mul; - out->mul_public = ec_GFp_nistp224_points_mul; - out->field_mul = ec_GFp_simple_field_mul; - out->field_sqr = ec_GFp_simple_field_sqr; - out->field_encode = NULL; - out->field_decode = NULL; -}; + out->add = ec_GFp_nistp224_add; + out->dbl = ec_GFp_nistp224_dbl; + out->mul = ec_GFp_nistp224_point_mul; + out->mul_base = ec_GFp_nistp224_point_mul_base; + out->mul_public = ec_GFp_nistp224_point_mul_public; + out->felem_mul = ec_GFp_nistp224_felem_mul; + out->felem_sqr = ec_GFp_nistp224_felem_sqr; + out->bignum_to_felem = ec_GFp_nistp224_bignum_to_felem; + out->felem_to_bignum = ec_GFp_nistp224_felem_to_bignum; + out->scalar_inv_montgomery = ec_simple_scalar_inv_montgomery; + out->scalar_inv_montgomery_vartime = ec_GFp_simple_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ec_GFp_simple_cmp_x_coordinate; +} #endif // BORINGSSL_HAS_UINT128 && !SMALL diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p224-64.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c.grpc_back similarity index 76% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p224-64.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c.grpc_back index 028197b6d..f8af39bef 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/ec/p224-64.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p224-64.c.grpc_back @@ -203,40 +203,65 @@ static void p224_felem_to_bin28(uint8_t out[28], const p224_felem in) { } } -// To preserve endianness when using BN_bn2bin and BN_bin2bn -static void p224_flip_endian(uint8_t *out, const uint8_t *in, size_t len) { - for (size_t i = 0; i < len; ++i) { - out[i] = in[len - 1 - i]; - } +static void p224_generic_to_felem(p224_felem out, const EC_FELEM *in) { + p224_bin28_to_felem(out, in->bytes); } -// From OpenSSL BIGNUM to internal representation -static int p224_BN_to_felem(p224_felem out, const BIGNUM *bn) { - // BN_bn2bin eats leading zeroes - p224_felem_bytearray b_out; - OPENSSL_memset(b_out, 0, sizeof(b_out)); - size_t num_bytes = BN_num_bytes(bn); - if (num_bytes > sizeof(b_out) || - BN_is_negative(bn)) { - OPENSSL_PUT_ERROR(EC, EC_R_BIGNUM_OUT_OF_RANGE); - return 0; - } +// Requires 0 <= in < 2*p (always call p224_felem_reduce first) +static void p224_felem_to_generic(EC_FELEM *out, const p224_felem in) { + // Reduce to unique minimal representation. + static const int64_t two56 = ((p224_limb)1) << 56; + // 0 <= in < 2*p, p = 2^224 - 2^96 + 1 + // if in > p , reduce in = in - 2^224 + 2^96 - 1 + int64_t tmp[4], a; + tmp[0] = in[0]; + tmp[1] = in[1]; + tmp[2] = in[2]; + tmp[3] = in[3]; + // Case 1: a = 1 iff in >= 2^224 + a = (in[3] >> 56); + tmp[0] -= a; + tmp[1] += a << 40; + tmp[3] &= 0x00ffffffffffffff; + // Case 2: a = 0 iff p <= in < 2^224, i.e., the high 128 bits are all 1 and + // the lower part is non-zero + a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) | + (((int64_t)(in[0] + (in[1] & 0x000000ffffffffff)) - 1) >> 63); + a &= 0x00ffffffffffffff; + // turn a into an all-one mask (if a = 0) or an all-zero mask + a = (a - 1) >> 63; + // subtract 2^224 - 2^96 + 1 if a is all-one + tmp[3] &= a ^ 0xffffffffffffffff; + tmp[2] &= a ^ 0xffffffffffffffff; + tmp[1] &= (a ^ 0xffffffffffffffff) | 0x000000ffffffffff; + tmp[0] -= 1 & a; - p224_felem_bytearray b_in; - num_bytes = BN_bn2bin(bn, b_in); - p224_flip_endian(b_out, b_in, num_bytes); - p224_bin28_to_felem(out, b_out); - return 1; -} + // eliminate negative coefficients: if tmp[0] is negative, tmp[1] must + // be non-zero, so we only need one step + a = tmp[0] >> 63; + tmp[0] += two56 & a; + tmp[1] -= 1 & a; -// From internal representation to OpenSSL BIGNUM -static BIGNUM *p224_felem_to_BN(BIGNUM *out, const p224_felem in) { - p224_felem_bytearray b_in, b_out; - p224_felem_to_bin28(b_in, in); - p224_flip_endian(b_out, b_in, sizeof(b_out)); - return BN_bin2bn(b_out, sizeof(b_out), out); + // carry 1 -> 2 -> 3 + tmp[2] += tmp[1] >> 56; + tmp[1] &= 0x00ffffffffffffff; + + tmp[3] += tmp[2] >> 56; + tmp[2] &= 0x00ffffffffffffff; + + // Now 0 <= tmp < p + p224_felem tmp2; + tmp2[0] = tmp[0]; + tmp2[1] = tmp[1]; + tmp2[2] = tmp[2]; + tmp2[3] = tmp[3]; + + p224_felem_to_bin28(out->bytes, tmp2); + // 224 is not a multiple of 64, so zero the remaining bytes. + OPENSSL_memset(out->bytes + 28, 0, 32 - 28); } + // Field operations, using the internal representation of field elements. // NB! These operations are specific to our point multiplication and cannot be // expected to be correct in general - e.g., multiplication with a large scalar @@ -447,55 +472,6 @@ static void p224_felem_reduce(p224_felem out, const p224_widefelem in) { out[3] = output[3]; } -// Reduce to unique minimal representation. -// Requires 0 <= in < 2*p (always call p224_felem_reduce first) -static void p224_felem_contract(p224_felem out, const p224_felem in) { - static const int64_t two56 = ((p224_limb)1) << 56; - // 0 <= in < 2*p, p = 2^224 - 2^96 + 1 - // if in > p , reduce in = in - 2^224 + 2^96 - 1 - int64_t tmp[4], a; - tmp[0] = in[0]; - tmp[1] = in[1]; - tmp[2] = in[2]; - tmp[3] = in[3]; - // Case 1: a = 1 iff in >= 2^224 - a = (in[3] >> 56); - tmp[0] -= a; - tmp[1] += a << 40; - tmp[3] &= 0x00ffffffffffffff; - // Case 2: a = 0 iff p <= in < 2^224, i.e., the high 128 bits are all 1 and - // the lower part is non-zero - a = ((in[3] & in[2] & (in[1] | 0x000000ffffffffff)) + 1) | - (((int64_t)(in[0] + (in[1] & 0x000000ffffffffff)) - 1) >> 63); - a &= 0x00ffffffffffffff; - // turn a into an all-one mask (if a = 0) or an all-zero mask - a = (a - 1) >> 63; - // subtract 2^224 - 2^96 + 1 if a is all-one - tmp[3] &= a ^ 0xffffffffffffffff; - tmp[2] &= a ^ 0xffffffffffffffff; - tmp[1] &= (a ^ 0xffffffffffffffff) | 0x000000ffffffffff; - tmp[0] -= 1 & a; - - // eliminate negative coefficients: if tmp[0] is negative, tmp[1] must - // be non-zero, so we only need one step - a = tmp[0] >> 63; - tmp[0] += two56 & a; - tmp[1] -= 1 & a; - - // carry 1 -> 2 -> 3 - tmp[2] += tmp[1] >> 56; - tmp[1] &= 0x00ffffffffffffff; - - tmp[3] += tmp[2] >> 56; - tmp[2] &= 0x00ffffffffffffff; - - // Now 0 <= out < p - out[0] = tmp[0]; - out[1] = tmp[1]; - out[2] = tmp[2]; - out[3] = tmp[3]; -} - // Get negative value: out = -in // Requires in[i] < 2^63, // ensures out[0] < 2^56, out[1] < 2^56, out[2] < 2^56, out[3] <= 2^56 + 2^16 @@ -782,7 +758,9 @@ static void p224_point_add(p224_felem x3, p224_felem y3, p224_felem z3, z1_is_zero = p224_felem_is_zero(z1); z2_is_zero = p224_felem_is_zero(z2); // In affine coordinates, (X_1, Y_1) == (X_2, Y_2) - if (x_equal && y_equal && !z1_is_zero && !z2_is_zero) { + p224_limb is_nontrivial_double = + x_equal & y_equal & (1 - z1_is_zero) & (1 - z2_is_zero); + if (is_nontrivial_double) { p224_point_double(x3, y3, z3, x1, y1, z1); return; } @@ -895,196 +873,295 @@ static char p224_get_bit(const p224_felem_bytearray in, size_t i) { return (in[i >> 3] >> (i & 7)) & 1; } -// Interleaved point multiplication using precomputed point multiples: -// The small point multiples 0*P, 1*P, ..., 16*P are in p_pre_comp, the scalars -// in p_scalar, if non-NULL. If g_scalar is non-NULL, we also add this multiple -// of the generator, using certain (large) precomputed multiples in -// g_p224_pre_comp. Output point (X, Y, Z) is stored in x_out, y_out, z_out -static void p224_batch_mul(p224_felem x_out, p224_felem y_out, p224_felem z_out, - const uint8_t *p_scalar, const uint8_t *g_scalar, - const p224_felem p_pre_comp[17][3]) { - p224_felem nq[3], tmp[4]; - uint64_t bits; - uint8_t sign, digit; +// Takes the Jacobian coordinates (X, Y, Z) of a point and returns +// (X', Y') = (X/Z^2, Y/Z^3) +static int ec_GFp_nistp224_point_get_affine_coordinates( + const EC_GROUP *group, const EC_RAW_POINT *point, EC_FELEM *x, + EC_FELEM *y) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } - // set nq to the point at infinity - OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); + p224_felem z1, z2; + p224_widefelem tmp; + p224_generic_to_felem(z1, &point->Z); + p224_felem_inv(z2, z1); + p224_felem_square(tmp, z2); + p224_felem_reduce(z1, tmp); - // Loop over both scalars msb-to-lsb, interleaving additions of multiples of - // the generator (two in each of the last 28 rounds) and additions of p (every - // 5th round). - int skip = 1; // save two point operations in the first round - size_t i = p_scalar != NULL ? 220 : 27; - for (;;) { - // double - if (!skip) { - p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + if (x != NULL) { + p224_felem x_in, x_out; + p224_generic_to_felem(x_in, &point->X); + p224_felem_mul(tmp, x_in, z1); + p224_felem_reduce(x_out, tmp); + p224_felem_to_generic(x, x_out); + } + + if (y != NULL) { + p224_felem y_in, y_out; + p224_generic_to_felem(y_in, &point->Y); + p224_felem_mul(tmp, z1, z2); + p224_felem_reduce(z1, tmp); + p224_felem_mul(tmp, y_in, z1); + p224_felem_reduce(y_out, tmp); + p224_felem_to_generic(y, y_out); + } + + return 1; +} + +static void ec_GFp_nistp224_add(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a, const EC_RAW_POINT *b) { + p224_felem x1, y1, z1, x2, y2, z2; + p224_generic_to_felem(x1, &a->X); + p224_generic_to_felem(y1, &a->Y); + p224_generic_to_felem(z1, &a->Z); + p224_generic_to_felem(x2, &b->X); + p224_generic_to_felem(y2, &b->Y); + p224_generic_to_felem(z2, &b->Z); + p224_point_add(x1, y1, z1, x1, y1, z1, 0 /* both Jacobian */, x2, y2, z2); + // The outputs are already reduced, but still need to be contracted. + p224_felem_to_generic(&r->X, x1); + p224_felem_to_generic(&r->Y, y1); + p224_felem_to_generic(&r->Z, z1); +} + +static void ec_GFp_nistp224_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a) { + p224_felem x, y, z; + p224_generic_to_felem(x, &a->X); + p224_generic_to_felem(y, &a->Y); + p224_generic_to_felem(z, &a->Z); + p224_point_double(x, y, z, x, y, z); + // The outputs are already reduced, but still need to be contracted. + p224_felem_to_generic(&r->X, x); + p224_felem_to_generic(&r->Y, y); + p224_felem_to_generic(&r->Z, z); +} + +static void ec_GFp_nistp224_make_precomp(p224_felem out[17][3], + const EC_RAW_POINT *p) { + OPENSSL_memset(out[0], 0, sizeof(p224_felem) * 3); + + p224_generic_to_felem(out[1][0], &p->X); + p224_generic_to_felem(out[1][1], &p->Y); + p224_generic_to_felem(out[1][2], &p->Z); + + for (size_t j = 2; j <= 16; ++j) { + if (j & 1) { + p224_point_add(out[j][0], out[j][1], out[j][2], out[1][0], out[1][1], + out[1][2], 0, out[j - 1][0], out[j - 1][1], out[j - 1][2]); + } else { + p224_point_double(out[j][0], out[j][1], out[j][2], out[j / 2][0], + out[j / 2][1], out[j / 2][2]); } + } +} - // add multiples of the generator - if (g_scalar != NULL && i <= 27) { - // first, look 28 bits upwards - bits = p224_get_bit(g_scalar, i + 196) << 3; - bits |= p224_get_bit(g_scalar, i + 140) << 2; - bits |= p224_get_bit(g_scalar, i + 84) << 1; - bits |= p224_get_bit(g_scalar, i + 28); - // select the point to add, in constant time - p224_select_point(bits, 16, g_p224_pre_comp[1], tmp); +static void ec_GFp_nistp224_point_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *scalar) { + p224_felem p_pre_comp[17][3]; + ec_GFp_nistp224_make_precomp(p_pre_comp, p); - if (!skip) { - p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, - tmp[0], tmp[1], tmp[2]); - } else { - OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); - skip = 0; - } + // Set nq to the point at infinity. + p224_felem nq[3], tmp[4]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); - // second, look at the current position - bits = p224_get_bit(g_scalar, i + 168) << 3; - bits |= p224_get_bit(g_scalar, i + 112) << 2; - bits |= p224_get_bit(g_scalar, i + 56) << 1; - bits |= p224_get_bit(g_scalar, i); - // select the point to add, in constant time - p224_select_point(bits, 16, g_p224_pre_comp[0], tmp); - p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, - tmp[0], tmp[1], tmp[2]); + int skip = 1; // Save two point operations in the first round. + for (size_t i = 220; i < 221; i--) { + if (!skip) { + p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); } - // do other additions every 5 doublings - if (p_scalar != NULL && i % 5 == 0) { - bits = p224_get_bit(p_scalar, i + 4) << 5; - bits |= p224_get_bit(p_scalar, i + 3) << 4; - bits |= p224_get_bit(p_scalar, i + 2) << 3; - bits |= p224_get_bit(p_scalar, i + 1) << 2; - bits |= p224_get_bit(p_scalar, i) << 1; - bits |= p224_get_bit(p_scalar, i - 1); + // Add every 5 doublings. + if (i % 5 == 0) { + uint64_t bits = p224_get_bit(scalar->bytes, i + 4) << 5; + bits |= p224_get_bit(scalar->bytes, i + 3) << 4; + bits |= p224_get_bit(scalar->bytes, i + 2) << 3; + bits |= p224_get_bit(scalar->bytes, i + 1) << 2; + bits |= p224_get_bit(scalar->bytes, i) << 1; + bits |= p224_get_bit(scalar->bytes, i - 1); + uint8_t sign, digit; ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); - // select the point to add or subtract - p224_select_point(digit, 17, p_pre_comp, tmp); + // Select the point to add or subtract. + p224_select_point(digit, 17, (const p224_felem(*)[3])p_pre_comp, tmp); p224_felem_neg(tmp[3], tmp[1]); // (X, -Y, Z) is the negative point p224_copy_conditional(tmp[1], tmp[3], sign); if (!skip) { p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, - tmp[0], tmp[1], tmp[2]); + tmp[0], tmp[1], tmp[2]); } else { OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); skip = 0; } } - - if (i == 0) { - break; - } - --i; } - p224_felem_assign(x_out, nq[0]); - p224_felem_assign(y_out, nq[1]); - p224_felem_assign(z_out, nq[2]); -} -// Takes the Jacobian coordinates (X, Y, Z) of a point and returns -// (X', Y') = (X/Z^2, Y/Z^3) -static int ec_GFp_nistp224_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x, BIGNUM *y, - BN_CTX *ctx) { - p224_felem z1, z2, x_in, y_in, x_out, y_out; - p224_widefelem tmp; + // Reduce the output to its unique minimal representation. + p224_felem_to_generic(&r->X, nq[0]); + p224_felem_to_generic(&r->Y, nq[1]); + p224_felem_to_generic(&r->Z, nq[2]); +} - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } +static void ec_GFp_nistp224_point_mul_base(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + // Set nq to the point at infinity. + p224_felem nq[3], tmp[3]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); - if (!p224_BN_to_felem(x_in, &point->X) || - !p224_BN_to_felem(y_in, &point->Y) || - !p224_BN_to_felem(z1, &point->Z)) { - return 0; - } + int skip = 1; // Save two point operations in the first round. + for (size_t i = 27; i < 28; i--) { + // double + if (!skip) { + p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + } - p224_felem_inv(z2, z1); - p224_felem_square(tmp, z2); - p224_felem_reduce(z1, tmp); + // First, look 28 bits upwards. + uint64_t bits = p224_get_bit(scalar->bytes, i + 196) << 3; + bits |= p224_get_bit(scalar->bytes, i + 140) << 2; + bits |= p224_get_bit(scalar->bytes, i + 84) << 1; + bits |= p224_get_bit(scalar->bytes, i + 28); + // Select the point to add, in constant time. + p224_select_point(bits, 16, g_p224_pre_comp[1], tmp); - if (x != NULL) { - p224_felem_mul(tmp, x_in, z1); - p224_felem_reduce(x_in, tmp); - p224_felem_contract(x_out, x_in); - if (!p224_felem_to_BN(x, x_out)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; + if (!skip) { + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + tmp[0], tmp[1], tmp[2]); + } else { + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; } - } - if (y != NULL) { - p224_felem_mul(tmp, z1, z2); - p224_felem_reduce(z1, tmp); - p224_felem_mul(tmp, y_in, z1); - p224_felem_reduce(y_in, tmp); - p224_felem_contract(y_out, y_in); - if (!p224_felem_to_BN(y, y_out)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } + // Second, look at the current position/ + bits = p224_get_bit(scalar->bytes, i + 168) << 3; + bits |= p224_get_bit(scalar->bytes, i + 112) << 2; + bits |= p224_get_bit(scalar->bytes, i + 56) << 1; + bits |= p224_get_bit(scalar->bytes, i); + // Select the point to add, in constant time. + p224_select_point(bits, 16, g_p224_pre_comp[0], tmp); + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + tmp[0], tmp[1], tmp[2]); } - return 1; + // Reduce the output to its unique minimal representation. + p224_felem_to_generic(&r->X, nq[0]); + p224_felem_to_generic(&r->Y, nq[1]); + p224_felem_to_generic(&r->Z, nq[2]); } -static int ec_GFp_nistp224_points_mul(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p, - const EC_SCALAR *p_scalar, BN_CTX *ctx) { +static void ec_GFp_nistp224_point_mul_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + // TODO(davidben): If P-224 ECDSA verify performance ever matters, using + // |ec_compute_wNAF| for |p_scalar| would likely be an easy improvement. p224_felem p_pre_comp[17][3]; - p224_felem x_in, y_in, z_in, x_out, y_out, z_out; - - if (p != NULL && p_scalar != NULL) { - // We treat NULL scalars as 0, and NULL points as points at infinity, i.e., - // they contribute nothing to the linear combination. - OPENSSL_memset(&p_pre_comp, 0, sizeof(p_pre_comp)); - // precompute multiples - if (!p224_BN_to_felem(x_out, &p->X) || - !p224_BN_to_felem(y_out, &p->Y) || - !p224_BN_to_felem(z_out, &p->Z)) { - return 0; + ec_GFp_nistp224_make_precomp(p_pre_comp, p); + + // Set nq to the point at infinity. + p224_felem nq[3], tmp[3]; + OPENSSL_memset(nq, 0, 3 * sizeof(p224_felem)); + + // Loop over both scalars msb-to-lsb, interleaving additions of multiples of + // the generator (two in each of the last 28 rounds) and additions of p (every + // 5th round). + int skip = 1; // Save two point operations in the first round. + for (size_t i = 220; i < 221; i--) { + if (!skip) { + p224_point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); } - p224_felem_assign(p_pre_comp[1][0], x_out); - p224_felem_assign(p_pre_comp[1][1], y_out); - p224_felem_assign(p_pre_comp[1][2], z_out); + // Add multiples of the generator. + if (i <= 27) { + // First, look 28 bits upwards. + uint64_t bits = p224_get_bit(g_scalar->bytes, i + 196) << 3; + bits |= p224_get_bit(g_scalar->bytes, i + 140) << 2; + bits |= p224_get_bit(g_scalar->bytes, i + 84) << 1; + bits |= p224_get_bit(g_scalar->bytes, i + 28); - for (size_t j = 2; j <= 16; ++j) { - if (j & 1) { - p224_point_add(p_pre_comp[j][0], p_pre_comp[j][1], p_pre_comp[j][2], - p_pre_comp[1][0], p_pre_comp[1][1], p_pre_comp[1][2], - 0, p_pre_comp[j - 1][0], p_pre_comp[j - 1][1], - p_pre_comp[j - 1][2]); + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + g_p224_pre_comp[1][bits][0], g_p224_pre_comp[1][bits][1], + g_p224_pre_comp[1][bits][2]); + assert(!skip); + + // Second, look at the current position. + bits = p224_get_bit(g_scalar->bytes, i + 168) << 3; + bits |= p224_get_bit(g_scalar->bytes, i + 112) << 2; + bits |= p224_get_bit(g_scalar->bytes, i + 56) << 1; + bits |= p224_get_bit(g_scalar->bytes, i); + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, + g_p224_pre_comp[0][bits][0], g_p224_pre_comp[0][bits][1], + g_p224_pre_comp[0][bits][2]); + } + + // Incorporate |p_scalar| every 5 doublings. + if (i % 5 == 0) { + uint64_t bits = p224_get_bit(p_scalar->bytes, i + 4) << 5; + bits |= p224_get_bit(p_scalar->bytes, i + 3) << 4; + bits |= p224_get_bit(p_scalar->bytes, i + 2) << 3; + bits |= p224_get_bit(p_scalar->bytes, i + 1) << 2; + bits |= p224_get_bit(p_scalar->bytes, i) << 1; + bits |= p224_get_bit(p_scalar->bytes, i - 1); + uint8_t sign, digit; + ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); + + // Select the point to add or subtract. + OPENSSL_memcpy(tmp, p_pre_comp[digit], 3 * sizeof(p224_felem)); + if (sign) { + p224_felem_neg(tmp[1], tmp[1]); // (X, -Y, Z) is the negative point + } + + if (!skip) { + p224_point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, + tmp[0], tmp[1], tmp[2]); } else { - p224_point_double(p_pre_comp[j][0], p_pre_comp[j][1], - p_pre_comp[j][2], p_pre_comp[j / 2][0], - p_pre_comp[j / 2][1], p_pre_comp[j / 2][2]); + OPENSSL_memcpy(nq, tmp, 3 * sizeof(p224_felem)); + skip = 0; } } } - p224_batch_mul(x_out, y_out, z_out, - (p != NULL && p_scalar != NULL) ? p_scalar->bytes : NULL, - g_scalar != NULL ? g_scalar->bytes : NULL, - (const p224_felem(*)[3])p_pre_comp); - - // reduce the output to its unique minimal representation - p224_felem_contract(x_in, x_out); - p224_felem_contract(y_in, y_out); - p224_felem_contract(z_in, z_out); - if (!p224_felem_to_BN(&r->X, x_in) || - !p224_felem_to_BN(&r->Y, y_in) || - !p224_felem_to_BN(&r->Z, z_in)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - return 1; + // Reduce the output to its unique minimal representation. + p224_felem_to_generic(&r->X, nq[0]); + p224_felem_to_generic(&r->Y, nq[1]); + p224_felem_to_generic(&r->Z, nq[2]); +} + +static void ec_GFp_nistp224_felem_mul(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a, const EC_FELEM *b) { + p224_felem felem1, felem2; + p224_widefelem wide; + p224_generic_to_felem(felem1, a); + p224_generic_to_felem(felem2, b); + p224_felem_mul(wide, felem1, felem2); + p224_felem_reduce(felem1, wide); + p224_felem_to_generic(r, felem1); +} + +static void ec_GFp_nistp224_felem_sqr(const EC_GROUP *group, EC_FELEM *r, + const EC_FELEM *a) { + p224_felem felem; + p224_generic_to_felem(felem, a); + p224_widefelem wide; + p224_felem_square(wide, felem); + p224_felem_reduce(felem, wide); + p224_felem_to_generic(r, felem); +} + +static int ec_GFp_nistp224_bignum_to_felem(const EC_GROUP *group, EC_FELEM *out, + const BIGNUM *in) { + return bn_copy_words(out->words, group->field.width, in); +} + +static int ec_GFp_nistp224_felem_to_bignum(const EC_GROUP *group, BIGNUM *out, + const EC_FELEM *in) { + return bn_set_words(out, in->words, group->field.width); } DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp224_method) { @@ -1093,12 +1170,18 @@ DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp224_method) { out->group_set_curve = ec_GFp_simple_group_set_curve; out->point_get_affine_coordinates = ec_GFp_nistp224_point_get_affine_coordinates; - out->mul = ec_GFp_nistp224_points_mul; - out->mul_public = ec_GFp_nistp224_points_mul; - out->field_mul = ec_GFp_simple_field_mul; - out->field_sqr = ec_GFp_simple_field_sqr; - out->field_encode = NULL; - out->field_decode = NULL; -}; + out->add = ec_GFp_nistp224_add; + out->dbl = ec_GFp_nistp224_dbl; + out->mul = ec_GFp_nistp224_point_mul; + out->mul_base = ec_GFp_nistp224_point_mul_base; + out->mul_public = ec_GFp_nistp224_point_mul_public; + out->felem_mul = ec_GFp_nistp224_felem_mul; + out->felem_sqr = ec_GFp_nistp224_felem_sqr; + out->bignum_to_felem = ec_GFp_nistp224_bignum_to_felem; + out->felem_to_bignum = ec_GFp_nistp224_felem_to_bignum; + out->scalar_inv_montgomery = ec_simple_scalar_inv_montgomery; + out->scalar_inv_montgomery_vartime = ec_GFp_simple_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ec_GFp_simple_cmp_x_coordinate; +} #endif // BORINGSSL_HAS_UINT128 && !SMALL diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h new file mode 100644 index 000000000..8246b11b9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h @@ -0,0 +1,9501 @@ +/* Copyright (c) 2015, Intel Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +// This is the precomputed constant time access table for the code in +// p256-x86_64.c, for the default generator. The table consists of 37 +// subtables, each subtable contains 64 affine points. The affine points are +// encoded as eight uint64's, four for the x coordinate and four for the y. +// Both values are in little-endian order. There are 37 tables because a +// signed, 6-bit wNAF form of the scalar is used and ceil(256/(6 + 1)) = 37. +// Within each table there are 64 values because the 6-bit wNAF value can take +// 64 values, ignoring the sign bit, which is implemented by performing a +// negation of the affine point when required. We would like to align it to 2MB +// in order to increase the chances of using a large page but that appears to +// lead to invalid ELF files being produced. + +// This file is generated by make_p256-x86_64-table.go. + +static const alignas(4096) PRECOMP256_ROW ecp_nistz256_precomputed[37] = { + {{{TOBN(0x79e730d4, 0x18a9143c), TOBN(0x75ba95fc, 0x5fedb601), + TOBN(0x79fb732b, 0x77622510), TOBN(0x18905f76, 0xa53755c6)}, + {TOBN(0xddf25357, 0xce95560a), TOBN(0x8b4ab8e4, 0xba19e45c), + TOBN(0xd2e88688, 0xdd21f325), TOBN(0x8571ff18, 0x25885d85)}}, + {{TOBN(0x850046d4, 0x10ddd64d), TOBN(0xaa6ae3c1, 0xa433827d), + TOBN(0x73220503, 0x8d1490d9), TOBN(0xf6bb32e4, 0x3dcf3a3b)}, + {TOBN(0x2f3648d3, 0x61bee1a5), TOBN(0x152cd7cb, 0xeb236ff8), + TOBN(0x19a8fb0e, 0x92042dbe), TOBN(0x78c57751, 0x0a5b8a3b)}}, + {{TOBN(0xffac3f90, 0x4eebc127), TOBN(0xb027f84a, 0x087d81fb), + TOBN(0x66ad77dd, 0x87cbbc98), TOBN(0x26936a3f, 0xb6ff747e)}, + {TOBN(0xb04c5c1f, 0xc983a7eb), TOBN(0x583e47ad, 0x0861fe1a), + TOBN(0x78820831, 0x1a2ee98e), TOBN(0xd5f06a29, 0xe587cc07)}}, + {{TOBN(0x74b0b50d, 0x46918dcc), TOBN(0x4650a6ed, 0xc623c173), + TOBN(0x0cdaacac, 0xe8100af2), TOBN(0x577362f5, 0x41b0176b)}, + {TOBN(0x2d96f24c, 0xe4cbaba6), TOBN(0x17628471, 0xfad6f447), + TOBN(0x6b6c36de, 0xe5ddd22e), TOBN(0x84b14c39, 0x4c5ab863)}}, + {{TOBN(0xbe1b8aae, 0xc45c61f5), TOBN(0x90ec649a, 0x94b9537d), + TOBN(0x941cb5aa, 0xd076c20c), TOBN(0xc9079605, 0x890523c8)}, + {TOBN(0xeb309b4a, 0xe7ba4f10), TOBN(0x73c568ef, 0xe5eb882b), + TOBN(0x3540a987, 0x7e7a1f68), TOBN(0x73a076bb, 0x2dd1e916)}}, + {{TOBN(0x40394737, 0x3e77664a), TOBN(0x55ae744f, 0x346cee3e), + TOBN(0xd50a961a, 0x5b17a3ad), TOBN(0x13074b59, 0x54213673)}, + {TOBN(0x93d36220, 0xd377e44b), TOBN(0x299c2b53, 0xadff14b5), + TOBN(0xf424d44c, 0xef639f11), TOBN(0xa4c9916d, 0x4a07f75f)}}, + {{TOBN(0x0746354e, 0xa0173b4f), TOBN(0x2bd20213, 0xd23c00f7), + TOBN(0xf43eaab5, 0x0c23bb08), TOBN(0x13ba5119, 0xc3123e03)}, + {TOBN(0x2847d030, 0x3f5b9d4d), TOBN(0x6742f2f2, 0x5da67bdd), + TOBN(0xef933bdc, 0x77c94195), TOBN(0xeaedd915, 0x6e240867)}}, + {{TOBN(0x27f14cd1, 0x9499a78f), TOBN(0x462ab5c5, 0x6f9b3455), + TOBN(0x8f90f02a, 0xf02cfc6b), TOBN(0xb763891e, 0xb265230d)}, + {TOBN(0xf59da3a9, 0x532d4977), TOBN(0x21e3327d, 0xcf9eba15), + TOBN(0x123c7b84, 0xbe60bbf0), TOBN(0x56ec12f2, 0x7706df76)}}, + {{TOBN(0x75c96e8f, 0x264e20e8), TOBN(0xabe6bfed, 0x59a7a841), + TOBN(0x2cc09c04, 0x44c8eb00), TOBN(0xe05b3080, 0xf0c4e16b)}, + {TOBN(0x1eb7777a, 0xa45f3314), TOBN(0x56af7bed, 0xce5d45e3), + TOBN(0x2b6e019a, 0x88b12f1a), TOBN(0x086659cd, 0xfd835f9b)}}, + {{TOBN(0x2c18dbd1, 0x9dc21ec8), TOBN(0x98f9868a, 0x0fcf8139), + TOBN(0x737d2cd6, 0x48250b49), TOBN(0xcc61c947, 0x24b3428f)}, + {TOBN(0x0c2b4078, 0x80dd9e76), TOBN(0xc43a8991, 0x383fbe08), + TOBN(0x5f7d2d65, 0x779be5d2), TOBN(0x78719a54, 0xeb3b4ab5)}}, + {{TOBN(0xea7d260a, 0x6245e404), TOBN(0x9de40795, 0x6e7fdfe0), + TOBN(0x1ff3a415, 0x8dac1ab5), TOBN(0x3e7090f1, 0x649c9073)}, + {TOBN(0x1a768561, 0x2b944e88), TOBN(0x250f939e, 0xe57f61c8), + TOBN(0x0c0daa89, 0x1ead643d), TOBN(0x68930023, 0xe125b88e)}}, + {{TOBN(0x04b71aa7, 0xd2697768), TOBN(0xabdedef5, 0xca345a33), + TOBN(0x2409d29d, 0xee37385e), TOBN(0x4ee1df77, 0xcb83e156)}, + {TOBN(0x0cac12d9, 0x1cbb5b43), TOBN(0x170ed2f6, 0xca895637), + TOBN(0x28228cfa, 0x8ade6d66), TOBN(0x7ff57c95, 0x53238aca)}}, + {{TOBN(0xccc42563, 0x4b2ed709), TOBN(0x0e356769, 0x856fd30d), + TOBN(0xbcbcd43f, 0x559e9811), TOBN(0x738477ac, 0x5395b759)}, + {TOBN(0x35752b90, 0xc00ee17f), TOBN(0x68748390, 0x742ed2e3), + TOBN(0x7cd06422, 0xbd1f5bc1), TOBN(0xfbc08769, 0xc9e7b797)}}, + {{TOBN(0xa242a35b, 0xb0cf664a), TOBN(0x126e48f7, 0x7f9707e3), + TOBN(0x1717bf54, 0xc6832660), TOBN(0xfaae7332, 0xfd12c72e)}, + {TOBN(0x27b52db7, 0x995d586b), TOBN(0xbe29569e, 0x832237c2), + TOBN(0xe8e4193e, 0x2a65e7db), TOBN(0x152706dc, 0x2eaa1bbb)}}, + {{TOBN(0x72bcd8b7, 0xbc60055b), TOBN(0x03cc23ee, 0x56e27e4b), + TOBN(0xee337424, 0xe4819370), TOBN(0xe2aa0e43, 0x0ad3da09)}, + {TOBN(0x40b8524f, 0x6383c45d), TOBN(0xd7663554, 0x42a41b25), + TOBN(0x64efa6de, 0x778a4797), TOBN(0x2042170a, 0x7079adf4)}}, + {{TOBN(0x808b0b65, 0x0bc6fb80), TOBN(0x5882e075, 0x3ffe2e6b), + TOBN(0xd5ef2f7c, 0x2c83f549), TOBN(0x54d63c80, 0x9103b723)}, + {TOBN(0xf2f11bd6, 0x52a23f9b), TOBN(0x3670c319, 0x4b0b6587), + TOBN(0x55c4623b, 0xb1580e9e), TOBN(0x64edf7b2, 0x01efe220)}}, + {{TOBN(0x97091dcb, 0xd53c5c9d), TOBN(0xf17624b6, 0xac0a177b), + TOBN(0xb0f13975, 0x2cfe2dff), TOBN(0xc1a35c0a, 0x6c7a574e)}, + {TOBN(0x227d3146, 0x93e79987), TOBN(0x0575bf30, 0xe89cb80e), + TOBN(0x2f4e247f, 0x0d1883bb), TOBN(0xebd51226, 0x3274c3d0)}}, + {{TOBN(0x5f3e51c8, 0x56ada97a), TOBN(0x4afc964d, 0x8f8b403e), + TOBN(0xa6f247ab, 0x412e2979), TOBN(0x675abd1b, 0x6f80ebda)}, + {TOBN(0x66a2bd72, 0x5e485a1d), TOBN(0x4b2a5caf, 0x8f4f0b3c), + TOBN(0x2626927f, 0x1b847bba), TOBN(0x6c6fc7d9, 0x0502394d)}}, + {{TOBN(0xfea912ba, 0xa5659ae8), TOBN(0x68363aba, 0x25e1a16e), + TOBN(0xb8842277, 0x752c41ac), TOBN(0xfe545c28, 0x2897c3fc)}, + {TOBN(0x2d36e9e7, 0xdc4c696b), TOBN(0x5806244a, 0xfba977c5), + TOBN(0x85665e9b, 0xe39508c1), TOBN(0xf720ee25, 0x6d12597b)}}, + {{TOBN(0x8a979129, 0xd2337a31), TOBN(0x5916868f, 0x0f862bdc), + TOBN(0x048099d9, 0x5dd283ba), TOBN(0xe2d1eeb6, 0xfe5bfb4e)}, + {TOBN(0x82ef1c41, 0x7884005d), TOBN(0xa2d4ec17, 0xffffcbae), + TOBN(0x9161c53f, 0x8aa95e66), TOBN(0x5ee104e1, 0xc5fee0d0)}}, + {{TOBN(0x562e4cec, 0xc135b208), TOBN(0x74e1b265, 0x4783f47d), + TOBN(0x6d2a506c, 0x5a3f3b30), TOBN(0xecead9f4, 0xc16762fc)}, + {TOBN(0xf29dd4b2, 0xe286e5b9), TOBN(0x1b0fadc0, 0x83bb3c61), + TOBN(0x7a75023e, 0x7fac29a4), TOBN(0xc086d5f1, 0xc9477fa3)}}, + {{TOBN(0x0fc61135, 0x2f6f3076), TOBN(0xc99ffa23, 0xe3912a9a), + TOBN(0x6a0b0685, 0xd2f8ba3d), TOBN(0xfdc777e8, 0xe93358a4)}, + {TOBN(0x94a787bb, 0x35415f04), TOBN(0x640c2d6a, 0x4d23fea4), + TOBN(0x9de917da, 0x153a35b5), TOBN(0x793e8d07, 0x5d5cd074)}}, + {{TOBN(0xf4f87653, 0x2de45068), TOBN(0x37c7a7e8, 0x9e2e1f6e), + TOBN(0xd0825fa2, 0xa3584069), TOBN(0xaf2cea7c, 0x1727bf42)}, + {TOBN(0x0360a4fb, 0x9e4785a9), TOBN(0xe5fda49c, 0x27299f4a), + TOBN(0x48068e13, 0x71ac2f71), TOBN(0x83d0687b, 0x9077666f)}}, + {{TOBN(0x6d3883b2, 0x15d02819), TOBN(0x6d0d7550, 0x40dd9a35), + TOBN(0x61d7cbf9, 0x1d2b469f), TOBN(0xf97b232f, 0x2efc3115)}, + {TOBN(0xa551d750, 0xb24bcbc7), TOBN(0x11ea4949, 0x88a1e356), + TOBN(0x7669f031, 0x93cb7501), TOBN(0x595dc55e, 0xca737b8a)}}, + {{TOBN(0xa4a319ac, 0xd837879f), TOBN(0x6fc1b49e, 0xed6b67b0), + TOBN(0xe3959933, 0x32f1f3af), TOBN(0x966742eb, 0x65432a2e)}, + {TOBN(0x4b8dc9fe, 0xb4966228), TOBN(0x96cc6312, 0x43f43950), + TOBN(0x12068859, 0xc9b731ee), TOBN(0x7b948dc3, 0x56f79968)}}, + {{TOBN(0x61e4ad32, 0xed1f8008), TOBN(0xe6c9267a, 0xd8b17538), + TOBN(0x1ac7c5eb, 0x857ff6fb), TOBN(0x994baaa8, 0x55f2fb10)}, + {TOBN(0x84cf14e1, 0x1d248018), TOBN(0x5a39898b, 0x628ac508), + TOBN(0x14fde97b, 0x5fa944f5), TOBN(0xed178030, 0xd12e5ac7)}}, + {{TOBN(0x042c2af4, 0x97e2feb4), TOBN(0xd36a42d7, 0xaebf7313), + TOBN(0x49d2c9eb, 0x084ffdd7), TOBN(0x9f8aa54b, 0x2ef7c76a)}, + {TOBN(0x9200b7ba, 0x09895e70), TOBN(0x3bd0c66f, 0xddb7fb58), + TOBN(0x2d97d108, 0x78eb4cbb), TOBN(0x2d431068, 0xd84bde31)}}, + {{TOBN(0x4b523eb7, 0x172ccd1f), TOBN(0x7323cb28, 0x30a6a892), + TOBN(0x97082ec0, 0xcfe153eb), TOBN(0xe97f6b6a, 0xf2aadb97)}, + {TOBN(0x1d3d393e, 0xd1a83da1), TOBN(0xa6a7f9c7, 0x804b2a68), + TOBN(0x4a688b48, 0x2d0cb71e), TOBN(0xa9b4cc5f, 0x40585278)}}, + {{TOBN(0x5e5db46a, 0xcb66e132), TOBN(0xf1be963a, 0x0d925880), + TOBN(0x944a7027, 0x0317b9e2), TOBN(0xe266f959, 0x48603d48)}, + {TOBN(0x98db6673, 0x5c208899), TOBN(0x90472447, 0xa2fb18a3), + TOBN(0x8a966939, 0x777c619f), TOBN(0x3798142a, 0x2a3be21b)}}, + {{TOBN(0xb4241cb1, 0x3298b343), TOBN(0xa3a14e49, 0xb44f65a1), + TOBN(0xc5f4d6cd, 0x3ac77acd), TOBN(0xd0288cb5, 0x52b6fc3c)}, + {TOBN(0xd5cc8c2f, 0x1c040abc), TOBN(0xb675511e, 0x06bf9b4a), + TOBN(0xd667da37, 0x9b3aa441), TOBN(0x460d45ce, 0x51601f72)}}, + {{TOBN(0xe2f73c69, 0x6755ff89), TOBN(0xdd3cf7e7, 0x473017e6), + TOBN(0x8ef5689d, 0x3cf7600d), TOBN(0x948dc4f8, 0xb1fc87b4)}, + {TOBN(0xd9e9fe81, 0x4ea53299), TOBN(0x2d921ca2, 0x98eb6028), + TOBN(0xfaecedfd, 0x0c9803fc), TOBN(0xf38ae891, 0x4d7b4745)}}, + {{TOBN(0xd8c5fccf, 0xc5e3a3d8), TOBN(0xbefd904c, 0x4079dfbf), + TOBN(0xbc6d6a58, 0xfead0197), TOBN(0x39227077, 0x695532a4)}, + {TOBN(0x09e23e6d, 0xdbef42f5), TOBN(0x7e449b64, 0x480a9908), + TOBN(0x7b969c1a, 0xad9a2e40), TOBN(0x6231d792, 0x9591c2a4)}}, + {{TOBN(0x87151456, 0x0f664534), TOBN(0x85ceae7c, 0x4b68f103), + TOBN(0xac09c4ae, 0x65578ab9), TOBN(0x33ec6868, 0xf044b10c)}, + {TOBN(0x6ac4832b, 0x3a8ec1f1), TOBN(0x5509d128, 0x5847d5ef), + TOBN(0xf909604f, 0x763f1574), TOBN(0xb16c4303, 0xc32f63c4)}}, + {{TOBN(0xb6ab2014, 0x7ca23cd3), TOBN(0xcaa7a5c6, 0xa391849d), + TOBN(0x5b0673a3, 0x75678d94), TOBN(0xc982ddd4, 0xdd303e64)}, + {TOBN(0xfd7b000b, 0x5db6f971), TOBN(0xbba2cb1f, 0x6f876f92), + TOBN(0xc77332a3, 0x3c569426), TOBN(0xa159100c, 0x570d74f8)}}, + {{TOBN(0xfd16847f, 0xdec67ef5), TOBN(0x742ee464, 0x233e76b7), + TOBN(0x0b8e4134, 0xefc2b4c8), TOBN(0xca640b86, 0x42a3e521)}, + {TOBN(0x653a0190, 0x8ceb6aa9), TOBN(0x313c300c, 0x547852d5), + TOBN(0x24e4ab12, 0x6b237af7), TOBN(0x2ba90162, 0x8bb47af8)}}, + {{TOBN(0x3d5e58d6, 0xa8219bb7), TOBN(0xc691d0bd, 0x1b06c57f), + TOBN(0x0ae4cb10, 0xd257576e), TOBN(0x3569656c, 0xd54a3dc3)}, + {TOBN(0xe5ebaebd, 0x94cda03a), TOBN(0x934e82d3, 0x162bfe13), + TOBN(0x450ac0ba, 0xe251a0c6), TOBN(0x480b9e11, 0xdd6da526)}}, + {{TOBN(0x00467bc5, 0x8cce08b5), TOBN(0xb636458c, 0x7f178d55), + TOBN(0xc5748bae, 0xa677d806), TOBN(0x2763a387, 0xdfa394eb)}, + {TOBN(0xa12b448a, 0x7d3cebb6), TOBN(0xe7adda3e, 0x6f20d850), + TOBN(0xf63ebce5, 0x1558462c), TOBN(0x58b36143, 0x620088a8)}}, + {{TOBN(0x8a2cc3ca, 0x4d63c0ee), TOBN(0x51233117, 0x0fe948ce), + TOBN(0x7463fd85, 0x222ef33b), TOBN(0xadf0c7dc, 0x7c603d6c)}, + {TOBN(0x0ec32d3b, 0xfe7765e5), TOBN(0xccaab359, 0xbf380409), + TOBN(0xbdaa84d6, 0x8e59319c), TOBN(0xd9a4c280, 0x9c80c34d)}}, + {{TOBN(0xa9d89488, 0xa059c142), TOBN(0x6f5ae714, 0xff0b9346), + TOBN(0x068f237d, 0x16fb3664), TOBN(0x5853e4c4, 0x363186ac)}, + {TOBN(0xe2d87d23, 0x63c52f98), TOBN(0x2ec4a766, 0x81828876), + TOBN(0x47b864fa, 0xe14e7b1c), TOBN(0x0c0bc0e5, 0x69192408)}}, + {{TOBN(0xe4d7681d, 0xb82e9f3e), TOBN(0x83200f0b, 0xdf25e13c), + TOBN(0x8909984c, 0x66f27280), TOBN(0x462d7b00, 0x75f73227)}, + {TOBN(0xd90ba188, 0xf2651798), TOBN(0x74c6e18c, 0x36ab1c34), + TOBN(0xab256ea3, 0x5ef54359), TOBN(0x03466612, 0xd1aa702f)}}, + {{TOBN(0x624d6049, 0x2ed22e91), TOBN(0x6fdfe0b5, 0x6f072822), + TOBN(0xeeca1115, 0x39ce2271), TOBN(0x98100a4f, 0xdb01614f)}, + {TOBN(0xb6b0daa2, 0xa35c628f), TOBN(0xb6f94d2e, 0xc87e9a47), + TOBN(0xc6773259, 0x1d57d9ce), TOBN(0xf70bfeec, 0x03884a7b)}}, + {{TOBN(0x5fb35ccf, 0xed2bad01), TOBN(0xa155cbe3, 0x1da6a5c7), + TOBN(0xc2e2594c, 0x30a92f8f), TOBN(0x649c89ce, 0x5bfafe43)}, + {TOBN(0xd158667d, 0xe9ff257a), TOBN(0x9b359611, 0xf32c50ae), + TOBN(0x4b00b20b, 0x906014cf), TOBN(0xf3a8cfe3, 0x89bc7d3d)}}, + {{TOBN(0x4ff23ffd, 0x248a7d06), TOBN(0x80c5bfb4, 0x878873fa), + TOBN(0xb7d9ad90, 0x05745981), TOBN(0x179c85db, 0x3db01994)}, + {TOBN(0xba41b062, 0x61a6966c), TOBN(0x4d82d052, 0xeadce5a8), + TOBN(0x9e91cd3b, 0xa5e6a318), TOBN(0x47795f4f, 0x95b2dda0)}}, + {{TOBN(0xecfd7c1f, 0xd55a897c), TOBN(0x009194ab, 0xb29110fb), + TOBN(0x5f0e2046, 0xe381d3b0), TOBN(0x5f3425f6, 0xa98dd291)}, + {TOBN(0xbfa06687, 0x730d50da), TOBN(0x0423446c, 0x4b083b7f), + TOBN(0x397a247d, 0xd69d3417), TOBN(0xeb629f90, 0x387ba42a)}}, + {{TOBN(0x1ee426cc, 0xd5cd79bf), TOBN(0x0032940b, 0x946c6e18), + TOBN(0x1b1e8ae0, 0x57477f58), TOBN(0xe94f7d34, 0x6d823278)}, + {TOBN(0xc747cb96, 0x782ba21a), TOBN(0xc5254469, 0xf72b33a5), + TOBN(0x772ef6de, 0xc7f80c81), TOBN(0xd73acbfe, 0x2cd9e6b5)}}, + {{TOBN(0x4075b5b1, 0x49ee90d9), TOBN(0x785c339a, 0xa06e9eba), + TOBN(0xa1030d5b, 0xabf825e0), TOBN(0xcec684c3, 0xa42931dc)}, + {TOBN(0x42ab62c9, 0xc1586e63), TOBN(0x45431d66, 0x5ab43f2b), + TOBN(0x57c8b2c0, 0x55f7835d), TOBN(0x033da338, 0xc1b7f865)}}, + {{TOBN(0x283c7513, 0xcaa76097), TOBN(0x0a624fa9, 0x36c83906), + TOBN(0x6b20afec, 0x715af2c7), TOBN(0x4b969974, 0xeba78bfd)}, + {TOBN(0x220755cc, 0xd921d60e), TOBN(0x9b944e10, 0x7baeca13), + TOBN(0x04819d51, 0x5ded93d4), TOBN(0x9bbff86e, 0x6dddfd27)}}, + {{TOBN(0x6b344130, 0x77adc612), TOBN(0xa7496529, 0xbbd803a0), + TOBN(0x1a1baaa7, 0x6d8805bd), TOBN(0xc8403902, 0x470343ad)}, + {TOBN(0x39f59f66, 0x175adff1), TOBN(0x0b26d7fb, 0xb7d8c5b7), + TOBN(0xa875f5ce, 0x529d75e3), TOBN(0x85efc7e9, 0x41325cc2)}}, + {{TOBN(0x21950b42, 0x1ff6acd3), TOBN(0xffe70484, 0x53dc6909), + TOBN(0xff4cd0b2, 0x28766127), TOBN(0xabdbe608, 0x4fb7db2b)}, + {TOBN(0x837c9228, 0x5e1109e8), TOBN(0x26147d27, 0xf4645b5a), + TOBN(0x4d78f592, 0xf7818ed8), TOBN(0xd394077e, 0xf247fa36)}}, + {{TOBN(0x0fb9c2d0, 0x488c171a), TOBN(0xa78bfbaa, 0x13685278), + TOBN(0xedfbe268, 0xd5b1fa6a), TOBN(0x0dceb8db, 0x2b7eaba7)}, + {TOBN(0xbf9e8089, 0x9ae2b710), TOBN(0xefde7ae6, 0xa4449c96), + TOBN(0x43b7716b, 0xcc143a46), TOBN(0xd7d34194, 0xc3628c13)}}, + {{TOBN(0x508cec1c, 0x3b3f64c9), TOBN(0xe20bc0ba, 0x1e5edf3f), + TOBN(0xda1deb85, 0x2f4318d4), TOBN(0xd20ebe0d, 0x5c3fa443)}, + {TOBN(0x370b4ea7, 0x73241ea3), TOBN(0x61f1511c, 0x5e1a5f65), + TOBN(0x99a5e23d, 0x82681c62), TOBN(0xd731e383, 0xa2f54c2d)}}, + {{TOBN(0x2692f36e, 0x83445904), TOBN(0x2e0ec469, 0xaf45f9c0), + TOBN(0x905a3201, 0xc67528b7), TOBN(0x88f77f34, 0xd0e5e542)}, + {TOBN(0xf67a8d29, 0x5864687c), TOBN(0x23b92eae, 0x22df3562), + TOBN(0x5c27014b, 0x9bbec39e), TOBN(0x7ef2f226, 0x9c0f0f8d)}}, + {{TOBN(0x97359638, 0x546c4d8d), TOBN(0x5f9c3fc4, 0x92f24679), + TOBN(0x912e8bed, 0xa8c8acd9), TOBN(0xec3a318d, 0x306634b0)}, + {TOBN(0x80167f41, 0xc31cb264), TOBN(0x3db82f6f, 0x522113f2), + TOBN(0xb155bcd2, 0xdcafe197), TOBN(0xfba1da59, 0x43465283)}}, + {{TOBN(0xa0425b8e, 0xb212cf53), TOBN(0x4f2e512e, 0xf8557c5f), + TOBN(0xc1286ff9, 0x25c4d56c), TOBN(0xbb8a0fea, 0xee26c851)}, + {TOBN(0xc28f70d2, 0xe7d6107e), TOBN(0x7ee0c444, 0xe76265aa), + TOBN(0x3df277a4, 0x1d1936b1), TOBN(0x1a556e3f, 0xea9595eb)}}, + {{TOBN(0x258bbbf9, 0xe7305683), TOBN(0x31eea5bf, 0x07ef5be6), + TOBN(0x0deb0e4a, 0x46c814c1), TOBN(0x5cee8449, 0xa7b730dd)}, + {TOBN(0xeab495c5, 0xa0182bde), TOBN(0xee759f87, 0x9e27a6b4), + TOBN(0xc2cf6a68, 0x80e518ca), TOBN(0x25e8013f, 0xf14cf3f4)}}, + {{TOBN(0x8fc44140, 0x7e8d7a14), TOBN(0xbb1ff3ca, 0x9556f36a), + TOBN(0x6a844385, 0x14600044), TOBN(0xba3f0c4a, 0x7451ae63)}, + {TOBN(0xdfcac25b, 0x1f9af32a), TOBN(0x01e0db86, 0xb1f2214b), + TOBN(0x4e9a5bc2, 0xa4b596ac), TOBN(0x83927681, 0x026c2c08)}}, + {{TOBN(0x3ec832e7, 0x7acaca28), TOBN(0x1bfeea57, 0xc7385b29), + TOBN(0x068212e3, 0xfd1eaf38), TOBN(0xc1329830, 0x6acf8ccc)}, + {TOBN(0xb909f2db, 0x2aac9e59), TOBN(0x5748060d, 0xb661782a), + TOBN(0xc5ab2632, 0xc79b7a01), TOBN(0xda44c6c6, 0x00017626)}}, + {{TOBN(0xf26c00e8, 0xa7ea82f0), TOBN(0x99cac80d, 0xe4299aaf), + TOBN(0xd66fe3b6, 0x7ed78be1), TOBN(0x305f725f, 0x648d02cd)}, + {TOBN(0x33ed1bc4, 0x623fb21b), TOBN(0xfa70533e, 0x7a6319ad), + TOBN(0x17ab562d, 0xbe5ffb3e), TOBN(0x06374994, 0x56674741)}}, + {{TOBN(0x69d44ed6, 0x5c46aa8e), TOBN(0x2100d5d3, 0xa8d063d1), + TOBN(0xcb9727ea, 0xa2d17c36), TOBN(0x4c2bab1b, 0x8add53b7)}, + {TOBN(0xa084e90c, 0x15426704), TOBN(0x778afcd3, 0xa837ebea), + TOBN(0x6651f701, 0x7ce477f8), TOBN(0xa0624998, 0x46fb7a8b)}}, + {{TOBN(0xdc1e6828, 0xed8a6e19), TOBN(0x33fc2336, 0x4189d9c7), + TOBN(0x026f8fe2, 0x671c39bc), TOBN(0xd40c4ccd, 0xbc6f9915)}, + {TOBN(0xafa135bb, 0xf80e75ca), TOBN(0x12c651a0, 0x22adff2c), + TOBN(0xc40a04bd, 0x4f51ad96), TOBN(0x04820109, 0xbbe4e832)}}, + {{TOBN(0x3667eb1a, 0x7f4c04cc), TOBN(0x59556621, 0xa9404f84), + TOBN(0x71cdf653, 0x7eceb50a), TOBN(0x994a44a6, 0x9b8335fa)}, + {TOBN(0xd7faf819, 0xdbeb9b69), TOBN(0x473c5680, 0xeed4350d), + TOBN(0xb6658466, 0xda44bba2), TOBN(0x0d1bc780, 0x872bdbf3)}}, + {{TOBN(0xe535f175, 0xa1962f91), TOBN(0x6ed7e061, 0xed58f5a7), + TOBN(0x177aa4c0, 0x2089a233), TOBN(0x0dbcb03a, 0xe539b413)}, + {TOBN(0xe3dc424e, 0xbb32e38e), TOBN(0x6472e5ef, 0x6806701e), + TOBN(0xdd47ff98, 0x814be9ee), TOBN(0x6b60cfff, 0x35ace009)}}, + {{TOBN(0xb8d3d931, 0x9ff91fe5), TOBN(0x039c4800, 0xf0518eed), + TOBN(0x95c37632, 0x9182cb26), TOBN(0x0763a434, 0x82fc568d)}, + {TOBN(0x707c04d5, 0x383e76ba), TOBN(0xac98b930, 0x824e8197), + TOBN(0x92bf7c8f, 0x91230de0), TOBN(0x90876a01, 0x40959b70)}}, + {{TOBN(0xdb6d96f3, 0x05968b80), TOBN(0x380a0913, 0x089f73b9), + TOBN(0x7da70b83, 0xc2c61e01), TOBN(0x95fb8394, 0x569b38c7)}, + {TOBN(0x9a3c6512, 0x80edfe2f), TOBN(0x8f726bb9, 0x8faeaf82), + TOBN(0x8010a4a0, 0x78424bf8), TOBN(0x29672044, 0x0e844970)}}}, + {{{TOBN(0x63c5cb81, 0x7a2ad62a), TOBN(0x7ef2b6b9, 0xac62ff54), + TOBN(0x3749bba4, 0xb3ad9db5), TOBN(0xad311f2c, 0x46d5a617)}, + {TOBN(0xb77a8087, 0xc2ff3b6d), TOBN(0xb46feaf3, 0x367834ff), + TOBN(0xf8aa266d, 0x75d6b138), TOBN(0xfa38d320, 0xec008188)}}, + {{TOBN(0x486d8ffa, 0x696946fc), TOBN(0x50fbc6d8, 0xb9cba56d), + TOBN(0x7e3d423e, 0x90f35a15), TOBN(0x7c3da195, 0xc0dd962c)}, + {TOBN(0xe673fdb0, 0x3cfd5d8b), TOBN(0x0704b7c2, 0x889dfca5), + TOBN(0xf6ce581f, 0xf52305aa), TOBN(0x399d49eb, 0x914d5e53)}}, + {{TOBN(0x380a496d, 0x6ec293cd), TOBN(0x733dbda7, 0x8e7051f5), + TOBN(0x037e388d, 0xb849140a), TOBN(0xee4b32b0, 0x5946dbf6)}, + {TOBN(0xb1c4fda9, 0xcae368d1), TOBN(0x5001a7b0, 0xfdb0b2f3), + TOBN(0x6df59374, 0x2e3ac46e), TOBN(0x4af675f2, 0x39b3e656)}}, + {{TOBN(0x44e38110, 0x39949296), TOBN(0x5b63827b, 0x361db1b5), + TOBN(0x3e5323ed, 0x206eaff5), TOBN(0x942370d2, 0xc21f4290)}, + {TOBN(0xf2caaf2e, 0xe0d985a1), TOBN(0x192cc64b, 0x7239846d), + TOBN(0x7c0b8f47, 0xae6312f8), TOBN(0x7dc61f91, 0x96620108)}}, + {{TOBN(0xb830fb5b, 0xc2da7de9), TOBN(0xd0e643df, 0x0ff8d3be), + TOBN(0x31ee77ba, 0x188a9641), TOBN(0x4e8aa3aa, 0xbcf6d502)}, + {TOBN(0xf9fb6532, 0x9a49110f), TOBN(0xd18317f6, 0x2dd6b220), + TOBN(0x7e3ced41, 0x52c3ea5a), TOBN(0x0d296a14, 0x7d579c4a)}}, + {{TOBN(0x35d6a53e, 0xed4c3717), TOBN(0x9f8240cf, 0x3d0ed2a3), + TOBN(0x8c0d4d05, 0xe5543aa5), TOBN(0x45d5bbfb, 0xdd33b4b4)}, + {TOBN(0xfa04cc73, 0x137fd28e), TOBN(0x862ac6ef, 0xc73b3ffd), + TOBN(0x403ff9f5, 0x31f51ef2), TOBN(0x34d5e0fc, 0xbc73f5a2)}}, + {{TOBN(0xf2526820, 0x08913f4f), TOBN(0xea20ed61, 0xeac93d95), + TOBN(0x51ed38b4, 0x6ca6b26c), TOBN(0x8662dcbc, 0xea4327b0)}, + {TOBN(0x6daf295c, 0x725d2aaa), TOBN(0xbad2752f, 0x8e52dcda), + TOBN(0x2210e721, 0x0b17dacc), TOBN(0xa37f7912, 0xd51e8232)}}, + {{TOBN(0x4f7081e1, 0x44cc3add), TOBN(0xd5ffa1d6, 0x87be82cf), + TOBN(0x89890b6c, 0x0edd6472), TOBN(0xada26e1a, 0x3ed17863)}, + {TOBN(0x276f2715, 0x63483caa), TOBN(0xe6924cd9, 0x2f6077fd), + TOBN(0x05a7fe98, 0x0a466e3c), TOBN(0xf1c794b0, 0xb1902d1f)}}, + {{TOBN(0xe5213688, 0x82a8042c), TOBN(0xd931cfaf, 0xcd278298), + TOBN(0x069a0ae0, 0xf597a740), TOBN(0x0adbb3f3, 0xeb59107c)}, + {TOBN(0x983e951e, 0x5eaa8eb8), TOBN(0xe663a8b5, 0x11b48e78), + TOBN(0x1631cc0d, 0x8a03f2c5), TOBN(0x7577c11e, 0x11e271e2)}}, + {{TOBN(0x33b2385c, 0x08369a90), TOBN(0x2990c59b, 0x190eb4f8), + TOBN(0x819a6145, 0xc68eac80), TOBN(0x7a786d62, 0x2ec4a014)}, + {TOBN(0x33faadbe, 0x20ac3a8d), TOBN(0x31a21781, 0x5aba2d30), + TOBN(0x209d2742, 0xdba4f565), TOBN(0xdb2ce9e3, 0x55aa0fbb)}}, + {{TOBN(0x8cef334b, 0x168984df), TOBN(0xe81dce17, 0x33879638), + TOBN(0xf6e6949c, 0x263720f0), TOBN(0x5c56feaf, 0xf593cbec)}, + {TOBN(0x8bff5601, 0xfde58c84), TOBN(0x74e24117, 0x2eccb314), + TOBN(0xbcf01b61, 0x4c9a8a78), TOBN(0xa233e35e, 0x544c9868)}}, + {{TOBN(0xb3156bf3, 0x8bd7aff1), TOBN(0x1b5ee4cb, 0x1d81b146), + TOBN(0x7ba1ac41, 0xd628a915), TOBN(0x8f3a8f9c, 0xfd89699e)}, + {TOBN(0x7329b9c9, 0xa0748be7), TOBN(0x1d391c95, 0xa92e621f), + TOBN(0xe51e6b21, 0x4d10a837), TOBN(0xd255f53a, 0x4947b435)}}, + {{TOBN(0x07669e04, 0xf1788ee3), TOBN(0xc14f27af, 0xa86938a2), + TOBN(0x8b47a334, 0xe93a01c0), TOBN(0xff627438, 0xd9366808)}, + {TOBN(0x7a0985d8, 0xca2a5965), TOBN(0x3d9a5542, 0xd6e9b9b3), + TOBN(0xc23eb80b, 0x4cf972e8), TOBN(0x5c1c33bb, 0x4fdf72fd)}}, + {{TOBN(0x0c4a58d4, 0x74a86108), TOBN(0xf8048a8f, 0xee4c5d90), + TOBN(0xe3c7c924, 0xe86d4c80), TOBN(0x28c889de, 0x056a1e60)}, + {TOBN(0x57e2662e, 0xb214a040), TOBN(0xe8c48e98, 0x37e10347), + TOBN(0x87742862, 0x80ac748a), TOBN(0xf1c24022, 0x186b06f2)}}, + {{TOBN(0xac2dd4c3, 0x5f74040a), TOBN(0x409aeb71, 0xfceac957), + TOBN(0x4fbad782, 0x55c4ec23), TOBN(0xb359ed61, 0x8a7b76ec)}, + {TOBN(0x12744926, 0xed6f4a60), TOBN(0xe21e8d7f, 0x4b912de3), + TOBN(0xe2575a59, 0xfc705a59), TOBN(0x72f1d4de, 0xed2dbc0e)}}, + {{TOBN(0x3d2b24b9, 0xeb7926b8), TOBN(0xbff88cb3, 0xcdbe5509), + TOBN(0xd0f399af, 0xe4dd640b), TOBN(0x3c5fe130, 0x2f76ed45)}, + {TOBN(0x6f3562f4, 0x3764fb3d), TOBN(0x7b5af318, 0x3151b62d), + TOBN(0xd5bd0bc7, 0xd79ce5f3), TOBN(0xfdaf6b20, 0xec66890f)}}, + {{TOBN(0x735c67ec, 0x6063540c), TOBN(0x50b259c2, 0xe5f9cb8f), + TOBN(0xb8734f9a, 0x3f99c6ab), TOBN(0xf8cc13d5, 0xa3a7bc85)}, + {TOBN(0x80c1b305, 0xc5217659), TOBN(0xfe5364d4, 0x4ec12a54), + TOBN(0xbd87045e, 0x681345fe), TOBN(0x7f8efeb1, 0x582f897f)}}, + {{TOBN(0xe8cbf1e5, 0xd5923359), TOBN(0xdb0cea9d, 0x539b9fb0), + TOBN(0x0c5b34cf, 0x49859b98), TOBN(0x5e583c56, 0xa4403cc6)}, + {TOBN(0x11fc1a2d, 0xd48185b7), TOBN(0xc93fbc7e, 0x6e521787), + TOBN(0x47e7a058, 0x05105b8b), TOBN(0x7b4d4d58, 0xdb8260c8)}}, + {{TOBN(0xe33930b0, 0x46eb842a), TOBN(0x8e844a9a, 0x7bdae56d), + TOBN(0x34ef3a9e, 0x13f7fdfc), TOBN(0xb3768f82, 0x636ca176)}, + {TOBN(0x2821f4e0, 0x4e09e61c), TOBN(0x414dc3a1, 0xa0c7cddc), + TOBN(0xd5379437, 0x54945fcd), TOBN(0x151b6eef, 0xb3555ff1)}}, + {{TOBN(0xb31bd613, 0x6339c083), TOBN(0x39ff8155, 0xdfb64701), + TOBN(0x7c3388d2, 0xe29604ab), TOBN(0x1e19084b, 0xa6b10442)}, + {TOBN(0x17cf54c0, 0xeccd47ef), TOBN(0x89693385, 0x4a5dfb30), + TOBN(0x69d023fb, 0x47daf9f6), TOBN(0x9222840b, 0x7d91d959)}}, + {{TOBN(0x439108f5, 0x803bac62), TOBN(0x0b7dd91d, 0x379bd45f), + TOBN(0xd651e827, 0xca63c581), TOBN(0x5c5d75f6, 0x509c104f)}, + {TOBN(0x7d5fc738, 0x1f2dc308), TOBN(0x20faa7bf, 0xd98454be), + TOBN(0x95374bee, 0xa517b031), TOBN(0xf036b9b1, 0x642692ac)}}, + {{TOBN(0xc5106109, 0x39842194), TOBN(0xb7e2353e, 0x49d05295), + TOBN(0xfc8c1d5c, 0xefb42ee0), TOBN(0xe04884eb, 0x08ce811c)}, + {TOBN(0xf1f75d81, 0x7419f40e), TOBN(0x5b0ac162, 0xa995c241), + TOBN(0x120921bb, 0xc4c55646), TOBN(0x713520c2, 0x8d33cf97)}}, + {{TOBN(0xb4a65a5c, 0xe98c5100), TOBN(0x6cec871d, 0x2ddd0f5a), + TOBN(0x251f0b7f, 0x9ba2e78b), TOBN(0x224a8434, 0xce3a2a5f)}, + {TOBN(0x26827f61, 0x25f5c46f), TOBN(0x6a22bedc, 0x48545ec0), + TOBN(0x25ae5fa0, 0xb1bb5cdc), TOBN(0xd693682f, 0xfcb9b98f)}}, + {{TOBN(0x32027fe8, 0x91e5d7d3), TOBN(0xf14b7d17, 0x73a07678), + TOBN(0xf88497b3, 0xc0dfdd61), TOBN(0xf7c2eec0, 0x2a8c4f48)}, + {TOBN(0xaa5573f4, 0x3756e621), TOBN(0xc013a240, 0x1825b948), + TOBN(0x1c03b345, 0x63878572), TOBN(0xa0472bea, 0x653a4184)}}, + {{TOBN(0xf4222e27, 0x0ac69a80), TOBN(0x34096d25, 0xf51e54f6), + TOBN(0x00a648cb, 0x8fffa591), TOBN(0x4e87acdc, 0x69b6527f)}, + {TOBN(0x0575e037, 0xe285ccb4), TOBN(0x188089e4, 0x50ddcf52), + TOBN(0xaa96c9a8, 0x870ff719), TOBN(0x74a56cd8, 0x1fc7e369)}}, + {{TOBN(0x41d04ee2, 0x1726931a), TOBN(0x0bbbb2c8, 0x3660ecfd), + TOBN(0xa6ef6de5, 0x24818e18), TOBN(0xe421cc51, 0xe7d57887)}, + {TOBN(0xf127d208, 0xbea87be6), TOBN(0x16a475d3, 0xb1cdd682), + TOBN(0x9db1b684, 0x439b63f7), TOBN(0x5359b3db, 0xf0f113b6)}}, + {{TOBN(0xdfccf1de, 0x8bf06e31), TOBN(0x1fdf8f44, 0xdd383901), + TOBN(0x10775cad, 0x5017e7d2), TOBN(0xdfc3a597, 0x58d11eef)}, + {TOBN(0x6ec9c8a0, 0xb1ecff10), TOBN(0xee6ed6cc, 0x28400549), + TOBN(0xb5ad7bae, 0x1b4f8d73), TOBN(0x61b4f11d, 0xe00aaab9)}}, + {{TOBN(0x7b32d69b, 0xd4eff2d7), TOBN(0x88ae6771, 0x4288b60f), + TOBN(0x159461b4, 0x37a1e723), TOBN(0x1f3d4789, 0x570aae8c)}, + {TOBN(0x869118c0, 0x7f9871da), TOBN(0x35fbda78, 0xf635e278), + TOBN(0x738f3641, 0xe1541dac), TOBN(0x6794b13a, 0xc0dae45f)}}, + {{TOBN(0x065064ac, 0x09cc0917), TOBN(0x27c53729, 0xc68540fd), + TOBN(0x0d2d4c8e, 0xef227671), TOBN(0xd23a9f80, 0xa1785a04)}, + {TOBN(0x98c59528, 0x52650359), TOBN(0xfa09ad01, 0x74a1acad), + TOBN(0x082d5a29, 0x0b55bf5c), TOBN(0xa40f1c67, 0x419b8084)}}, + {{TOBN(0x3a5c752e, 0xdcc18770), TOBN(0x4baf1f2f, 0x8825c3a5), + TOBN(0xebd63f74, 0x21b153ed), TOBN(0xa2383e47, 0xb2f64723)}, + {TOBN(0xe7bf620a, 0x2646d19a), TOBN(0x56cb44ec, 0x03c83ffd), + TOBN(0xaf7267c9, 0x4f6be9f1), TOBN(0x8b2dfd7b, 0xc06bb5e9)}}, + {{TOBN(0xb87072f2, 0xa672c5c7), TOBN(0xeacb11c8, 0x0d53c5e2), + TOBN(0x22dac29d, 0xff435932), TOBN(0x37bdb99d, 0x4408693c)}, + {TOBN(0xf6e62fb6, 0x2899c20f), TOBN(0x3535d512, 0x447ece24), + TOBN(0xfbdc6b88, 0xff577ce3), TOBN(0x726693bd, 0x190575f2)}}, + {{TOBN(0x6772b0e5, 0xab4b35a2), TOBN(0x1d8b6001, 0xf5eeaacf), + TOBN(0x728f7ce4, 0x795b9580), TOBN(0x4a20ed2a, 0x41fb81da)}, + {TOBN(0x9f685cd4, 0x4fec01e6), TOBN(0x3ed7ddcc, 0xa7ff50ad), + TOBN(0x460fd264, 0x0c2d97fd), TOBN(0x3a241426, 0xeb82f4f9)}}, + {{TOBN(0x17d1df2c, 0x6a8ea820), TOBN(0xb2b50d3b, 0xf22cc254), + TOBN(0x03856cba, 0xb7291426), TOBN(0x87fd26ae, 0x04f5ee39)}, + {TOBN(0x9cb696cc, 0x02bee4ba), TOBN(0x53121804, 0x06820fd6), + TOBN(0xa5dfc269, 0x0212e985), TOBN(0x666f7ffa, 0x160f9a09)}}, + {{TOBN(0xc503cd33, 0xbccd9617), TOBN(0x365dede4, 0xba7730a3), + TOBN(0x798c6355, 0x5ddb0786), TOBN(0xa6c3200e, 0xfc9cd3bc)}, + {TOBN(0x060ffb2c, 0xe5e35efd), TOBN(0x99a4e25b, 0x5555a1c1), + TOBN(0x11d95375, 0xf70b3751), TOBN(0x0a57354a, 0x160e1bf6)}}, + {{TOBN(0xecb3ae4b, 0xf8e4b065), TOBN(0x07a834c4, 0x2e53022b), + TOBN(0x1cd300b3, 0x8692ed96), TOBN(0x16a6f792, 0x61ee14ec)}, + {TOBN(0x8f1063c6, 0x6a8649ed), TOBN(0xfbcdfcfe, 0x869f3e14), + TOBN(0x2cfb97c1, 0x00a7b3ec), TOBN(0xcea49b3c, 0x7130c2f1)}}, + {{TOBN(0x462d044f, 0xe9d96488), TOBN(0x4b53d52e, 0x8182a0c1), + TOBN(0x84b6ddd3, 0x0391e9e9), TOBN(0x80ab7b48, 0xb1741a09)}, + {TOBN(0xec0e15d4, 0x27d3317f), TOBN(0x8dfc1ddb, 0x1a64671e), + TOBN(0x93cc5d5f, 0xd49c5b92), TOBN(0xc995d53d, 0x3674a331)}}, + {{TOBN(0x302e41ec, 0x090090ae), TOBN(0x2278a0cc, 0xedb06830), + TOBN(0x1d025932, 0xfbc99690), TOBN(0x0c32fbd2, 0xb80d68da)}, + {TOBN(0xd79146da, 0xf341a6c1), TOBN(0xae0ba139, 0x1bef68a0), + TOBN(0xc6b8a563, 0x8d774b3a), TOBN(0x1cf307bd, 0x880ba4d7)}}, + {{TOBN(0xc033bdc7, 0x19803511), TOBN(0xa9f97b3b, 0x8888c3be), + TOBN(0x3d68aebc, 0x85c6d05e), TOBN(0xc3b88a9d, 0x193919eb)}, + {TOBN(0x2d300748, 0xc48b0ee3), TOBN(0x7506bc7c, 0x07a746c1), + TOBN(0xfc48437c, 0x6e6d57f3), TOBN(0x5bd71587, 0xcfeaa91a)}}, + {{TOBN(0xa4ed0408, 0xc1bc5225), TOBN(0xd0b946db, 0x2719226d), + TOBN(0x109ecd62, 0x758d2d43), TOBN(0x75c8485a, 0x2751759b)}, + {TOBN(0xb0b75f49, 0x9ce4177a), TOBN(0x4fa61a1e, 0x79c10c3d), + TOBN(0xc062d300, 0xa167fcd7), TOBN(0x4df3874c, 0x750f0fa8)}}, + {{TOBN(0x29ae2cf9, 0x83dfedc9), TOBN(0xf8437134, 0x8d87631a), + TOBN(0xaf571711, 0x7429c8d2), TOBN(0x18d15867, 0x146d9272)}, + {TOBN(0x83053ecf, 0x69769bb7), TOBN(0xc55eb856, 0xc479ab82), + TOBN(0x5ef7791c, 0x21b0f4b2), TOBN(0xaa5956ba, 0x3d491525)}}, + {{TOBN(0x407a96c2, 0x9fe20eba), TOBN(0xf27168bb, 0xe52a5ad3), + TOBN(0x43b60ab3, 0xbf1d9d89), TOBN(0xe45c51ef, 0x710e727a)}, + {TOBN(0xdfca5276, 0x099b4221), TOBN(0x8dc6407c, 0x2557a159), + TOBN(0x0ead8335, 0x91035895), TOBN(0x0a9db957, 0x9c55dc32)}}, + {{TOBN(0xe40736d3, 0xdf61bc76), TOBN(0x13a619c0, 0x3f778cdb), + TOBN(0x6dd921a4, 0xc56ea28f), TOBN(0x76a52433, 0x2fa647b4)}, + {TOBN(0x23591891, 0xac5bdc5d), TOBN(0xff4a1a72, 0xbac7dc01), + TOBN(0x9905e261, 0x62df8453), TOBN(0x3ac045df, 0xe63b265f)}}, + {{TOBN(0x8a3f341b, 0xad53dba7), TOBN(0x8ec269cc, 0x837b625a), + TOBN(0xd71a2782, 0x3ae31189), TOBN(0x8fb4f9a3, 0x55e96120)}, + {TOBN(0x804af823, 0xff9875cf), TOBN(0x23224f57, 0x5d442a9b), + TOBN(0x1c4d3b9e, 0xecc62679), TOBN(0x91da22fb, 0xa0e7ddb1)}}, + {{TOBN(0xa370324d, 0x6c04a661), TOBN(0x9710d3b6, 0x5e376d17), + TOBN(0xed8c98f0, 0x3044e357), TOBN(0xc364ebbe, 0x6422701c)}, + {TOBN(0x347f5d51, 0x7733d61c), TOBN(0xd55644b9, 0xcea826c3), + TOBN(0x80c6e0ad, 0x55a25548), TOBN(0x0aa7641d, 0x844220a7)}}, + {{TOBN(0x1438ec81, 0x31810660), TOBN(0x9dfa6507, 0xde4b4043), + TOBN(0x10b515d8, 0xcc3e0273), TOBN(0x1b6066dd, 0x28d8cfb2)}, + {TOBN(0xd3b04591, 0x9c9efebd), TOBN(0x425d4bdf, 0xa21c1ff4), + TOBN(0x5fe5af19, 0xd57607d3), TOBN(0xbbf773f7, 0x54481084)}}, + {{TOBN(0x8435bd69, 0x94b03ed1), TOBN(0xd9ad1de3, 0x634cc546), + TOBN(0x2cf423fc, 0x00e420ca), TOBN(0xeed26d80, 0xa03096dd)}, + {TOBN(0xd7f60be7, 0xa4db09d2), TOBN(0xf47f569d, 0x960622f7), + TOBN(0xe5925fd7, 0x7296c729), TOBN(0xeff2db26, 0x26ca2715)}}, + {{TOBN(0xa6fcd014, 0xb913e759), TOBN(0x53da4786, 0x8ff4de93), + TOBN(0x14616d79, 0xc32068e1), TOBN(0xb187d664, 0xccdf352e)}, + {TOBN(0xf7afb650, 0x1dc90b59), TOBN(0x8170e943, 0x7daa1b26), + TOBN(0xc8e3bdd8, 0x700c0a84), TOBN(0x6e8d345f, 0x6482bdfa)}}, + {{TOBN(0x84cfbfa1, 0xc5c5ea50), TOBN(0xd3baf14c, 0x67960681), + TOBN(0x26398403, 0x0dd50942), TOBN(0xe4b7839c, 0x4716a663)}, + {TOBN(0xd5f1f794, 0xe7de6dc0), TOBN(0x5cd0f4d4, 0x622aa7ce), + TOBN(0x5295f3f1, 0x59acfeec), TOBN(0x8d933552, 0x953e0607)}}, + {{TOBN(0xc7db8ec5, 0x776c5722), TOBN(0xdc467e62, 0x2b5f290c), + TOBN(0xd4297e70, 0x4ff425a9), TOBN(0x4be924c1, 0x0cf7bb72)}, + {TOBN(0x0d5dc5ae, 0xa1892131), TOBN(0x8bf8a8e3, 0xa705c992), + TOBN(0x73a0b064, 0x7a305ac5), TOBN(0x00c9ca4e, 0x9a8c77a8)}}, + {{TOBN(0x5dfee80f, 0x83774bdd), TOBN(0x63131602, 0x85734485), + TOBN(0xa1b524ae, 0x914a69a9), TOBN(0xebc2ffaf, 0xd4e300d7)}, + {TOBN(0x52c93db7, 0x7cfa46a5), TOBN(0x71e6161f, 0x21653b50), + TOBN(0x3574fc57, 0xa4bc580a), TOBN(0xc09015dd, 0xe1bc1253)}}, + {{TOBN(0x4b7b47b2, 0xd174d7aa), TOBN(0x4072d8e8, 0xf3a15d04), + TOBN(0xeeb7d47f, 0xd6fa07ed), TOBN(0x6f2b9ff9, 0xedbdafb1)}, + {TOBN(0x18c51615, 0x3760fe8a), TOBN(0x7a96e6bf, 0xf06c6c13), + TOBN(0x4d7a0410, 0x0ea2d071), TOBN(0xa1914e9b, 0x0be2a5ce)}}, + {{TOBN(0x5726e357, 0xd8a3c5cf), TOBN(0x1197ecc3, 0x2abb2b13), + TOBN(0x6c0d7f7f, 0x31ae88dd), TOBN(0x15b20d1a, 0xfdbb3efe)}, + {TOBN(0xcd06aa26, 0x70584039), TOBN(0x2277c969, 0xa7dc9747), + TOBN(0xbca69587, 0x7855d815), TOBN(0x899ea238, 0x5188b32a)}}, + {{TOBN(0x37d9228b, 0x760c1c9d), TOBN(0xc7efbb11, 0x9b5c18da), + TOBN(0x7f0d1bc8, 0x19f6dbc5), TOBN(0x4875384b, 0x07e6905b)}, + {TOBN(0xc7c50baa, 0x3ba8cd86), TOBN(0xb0ce40fb, 0xc2905de0), + TOBN(0x70840673, 0x7a231952), TOBN(0xa912a262, 0xcf43de26)}}, + {{TOBN(0x9c38ddcc, 0xeb5b76c1), TOBN(0x746f5285, 0x26fc0ab4), + TOBN(0x52a63a50, 0xd62c269f), TOBN(0x60049c55, 0x99458621)}, + {TOBN(0xe7f48f82, 0x3c2f7c9e), TOBN(0x6bd99043, 0x917d5cf3), + TOBN(0xeb1317a8, 0x8701f469), TOBN(0xbd3fe2ed, 0x9a449fe0)}}, + {{TOBN(0x421e79ca, 0x12ef3d36), TOBN(0x9ee3c36c, 0x3e7ea5de), + TOBN(0xe48198b5, 0xcdff36f7), TOBN(0xaff4f967, 0xc6b82228)}, + {TOBN(0x15e19dd0, 0xc47adb7e), TOBN(0x45699b23, 0x032e7dfa), + TOBN(0x40680c8b, 0x1fae026a), TOBN(0x5a347a48, 0x550dbf4d)}}, + {{TOBN(0xe652533b, 0x3cef0d7d), TOBN(0xd94f7b18, 0x2bbb4381), + TOBN(0x838752be, 0x0e80f500), TOBN(0x8e6e2488, 0x9e9c9bfb)}, + {TOBN(0xc9751697, 0x16caca6a), TOBN(0x866c49d8, 0x38531ad9), + TOBN(0xc917e239, 0x7151ade1), TOBN(0x2d016ec1, 0x6037c407)}}, + {{TOBN(0xa407ccc9, 0x00eac3f9), TOBN(0x835f6280, 0xe2ed4748), + TOBN(0xcc54c347, 0x1cc98e0d), TOBN(0x0e969937, 0xdcb572eb)}, + {TOBN(0x1b16c8e8, 0x8f30c9cb), TOBN(0xa606ae75, 0x373c4661), + TOBN(0x47aa689b, 0x35502cab), TOBN(0xf89014ae, 0x4d9bb64f)}}, + {{TOBN(0x202f6a9c, 0x31c71f7b), TOBN(0x01f95aa3, 0x296ffe5c), + TOBN(0x5fc06014, 0x53cec3a3), TOBN(0xeb991237, 0x5f498a45)}, + {TOBN(0xae9a935e, 0x5d91ba87), TOBN(0xc6ac6281, 0x0b564a19), + TOBN(0x8a8fe81c, 0x3bd44e69), TOBN(0x7c8b467f, 0x9dd11d45)}}, + {{TOBN(0xf772251f, 0xea5b8e69), TOBN(0xaeecb3bd, 0xc5b75fbc), + TOBN(0x1aca3331, 0x887ff0e5), TOBN(0xbe5d49ff, 0x19f0a131)}, + {TOBN(0x582c13aa, 0xe5c8646f), TOBN(0xdbaa12e8, 0x20e19980), + TOBN(0x8f40f31a, 0xf7abbd94), TOBN(0x1f13f5a8, 0x1dfc7663)}}, + {{TOBN(0x5d81f1ee, 0xaceb4fc0), TOBN(0x36256002, 0x5e6f0f42), + TOBN(0x4b67d6d7, 0x751370c8), TOBN(0x2608b698, 0x03e80589)}, + {TOBN(0xcfc0d2fc, 0x05268301), TOBN(0xa6943d39, 0x40309212), + TOBN(0x192a90c2, 0x1fd0e1c2), TOBN(0xb209f113, 0x37f1dc76)}}, + {{TOBN(0xefcc5e06, 0x97bf1298), TOBN(0xcbdb6730, 0x219d639e), + TOBN(0xd009c116, 0xb81e8c6f), TOBN(0xa3ffdde3, 0x1a7ce2e5)}, + {TOBN(0xc53fbaaa, 0xa914d3ba), TOBN(0x836d500f, 0x88df85ee), + TOBN(0xd98dc71b, 0x66ee0751), TOBN(0x5a3d7005, 0x714516fd)}}, + {{TOBN(0x21d3634d, 0x39eedbba), TOBN(0x35cd2e68, 0x0455a46d), + TOBN(0xc8cafe65, 0xf9d7eb0c), TOBN(0xbda3ce9e, 0x00cefb3e)}, + {TOBN(0xddc17a60, 0x2c9cf7a4), TOBN(0x01572ee4, 0x7bcb8773), + TOBN(0xa92b2b01, 0x8c7548df), TOBN(0x732fd309, 0xa84600e3)}}, + {{TOBN(0xe22109c7, 0x16543a40), TOBN(0x9acafd36, 0xfede3c6c), + TOBN(0xfb206852, 0x6824e614), TOBN(0x2a4544a9, 0xda25dca0)}, + {TOBN(0x25985262, 0x91d60b06), TOBN(0x281b7be9, 0x28753545), + TOBN(0xec667b1a, 0x90f13b27), TOBN(0x33a83aff, 0x940e2eb4)}}, + {{TOBN(0x80009862, 0xd5d721d5), TOBN(0x0c3357a3, 0x5bd3a182), + TOBN(0x27f3a83b, 0x7aa2cda4), TOBN(0xb58ae74e, 0xf6f83085)}, + {TOBN(0x2a911a81, 0x2e6dad6b), TOBN(0xde286051, 0xf43d6c5b), + TOBN(0x4bdccc41, 0xf996c4d8), TOBN(0xe7312ec0, 0x0ae1e24e)}}}, + {{{TOBN(0xf8d112e7, 0x6e6485b3), TOBN(0x4d3e24db, 0x771c52f8), + TOBN(0x48e3ee41, 0x684a2f6d), TOBN(0x7161957d, 0x21d95551)}, + {TOBN(0x19631283, 0xcdb12a6c), TOBN(0xbf3fa882, 0x2e50e164), + TOBN(0xf6254b63, 0x3166cc73), TOBN(0x3aefa7ae, 0xaee8cc38)}}, + {{TOBN(0x79b0fe62, 0x3b36f9fd), TOBN(0x26543b23, 0xfde19fc0), + TOBN(0x136e64a0, 0x958482ef), TOBN(0x23f63771, 0x9b095825)}, + {TOBN(0x14cfd596, 0xb6a1142e), TOBN(0x5ea6aac6, 0x335aac0b), + TOBN(0x86a0e8bd, 0xf3081dd5), TOBN(0x5fb89d79, 0x003dc12a)}}, + {{TOBN(0xf615c33a, 0xf72e34d4), TOBN(0x0bd9ea40, 0x110eec35), + TOBN(0x1c12bc5b, 0xc1dea34e), TOBN(0x686584c9, 0x49ae4699)}, + {TOBN(0x13ad95d3, 0x8c97b942), TOBN(0x4609561a, 0x4e5c7562), + TOBN(0x9e94a4ae, 0xf2737f89), TOBN(0xf57594c6, 0x371c78b6)}}, + {{TOBN(0x0f0165fc, 0xe3779ee3), TOBN(0xe00e7f9d, 0xbd495d9e), + TOBN(0x1fa4efa2, 0x20284e7a), TOBN(0x4564bade, 0x47ac6219)}, + {TOBN(0x90e6312a, 0xc4708e8e), TOBN(0x4f5725fb, 0xa71e9adf), + TOBN(0xe95f55ae, 0x3d684b9f), TOBN(0x47f7ccb1, 0x1e94b415)}}, + {{TOBN(0x7322851b, 0x8d946581), TOBN(0xf0d13133, 0xbdf4a012), + TOBN(0xa3510f69, 0x6584dae0), TOBN(0x03a7c171, 0x3c9f6c6d)}, + {TOBN(0x5be97f38, 0xe475381a), TOBN(0xca1ba422, 0x85823334), + TOBN(0xf83cc5c7, 0x0be17dda), TOBN(0x158b1494, 0x0b918c0f)}}, + {{TOBN(0xda3a77e5, 0x522e6b69), TOBN(0x69c908c3, 0xbbcd6c18), + TOBN(0x1f1b9e48, 0xd924fd56), TOBN(0x37c64e36, 0xaa4bb3f7)}, + {TOBN(0x5a4fdbdf, 0xee478d7d), TOBN(0xba75c8bc, 0x0193f7a0), + TOBN(0x84bc1e84, 0x56cd16df), TOBN(0x1fb08f08, 0x46fad151)}}, + {{TOBN(0x8a7cabf9, 0x842e9f30), TOBN(0xa331d4bf, 0x5eab83af), + TOBN(0xd272cfba, 0x017f2a6a), TOBN(0x27560abc, 0x83aba0e3)}, + {TOBN(0x94b83387, 0x0e3a6b75), TOBN(0x25c6aea2, 0x6b9f50f5), + TOBN(0x803d691d, 0xb5fdf6d0), TOBN(0x03b77509, 0xe6333514)}}, + {{TOBN(0x36178903, 0x61a341c1), TOBN(0x3604dc60, 0x0cfd6142), + TOBN(0x022295eb, 0x8533316c), TOBN(0x3dbde4ac, 0x44af2922)}, + {TOBN(0x898afc5d, 0x1c7eef69), TOBN(0x58896805, 0xd14f4fa1), + TOBN(0x05002160, 0x203c21ca), TOBN(0x6f0d1f30, 0x40ef730b)}}, + {{TOBN(0x8e8c44d4, 0x196224f8), TOBN(0x75a4ab95, 0x374d079d), + TOBN(0x79085ecc, 0x7d48f123), TOBN(0x56f04d31, 0x1bf65ad8)}, + {TOBN(0xe220bf1c, 0xbda602b2), TOBN(0x73ee1742, 0xf9612c69), + TOBN(0x76008fc8, 0x084fd06b), TOBN(0x4000ef9f, 0xf11380d1)}}, + {{TOBN(0x48201b4b, 0x12cfe297), TOBN(0x3eee129c, 0x292f74e5), + TOBN(0xe1fe114e, 0xc9e874e8), TOBN(0x899b055c, 0x92c5fc41)}, + {TOBN(0x4e477a64, 0x3a39c8cf), TOBN(0x82f09efe, 0x78963cc9), + TOBN(0x6fd3fd8f, 0xd333f863), TOBN(0x85132b2a, 0xdc949c63)}}, + {{TOBN(0x7e06a3ab, 0x516eb17b), TOBN(0x73bec06f, 0xd2c7372b), + TOBN(0xe4f74f55, 0xba896da6), TOBN(0xbb4afef8, 0x8e9eb40f)}, + {TOBN(0x2d75bec8, 0xe61d66b0), TOBN(0x02bda4b4, 0xef29300b), + TOBN(0x8bbaa8de, 0x026baa5a), TOBN(0xff54befd, 0xa07f4440)}}, + {{TOBN(0xbd9b8b1d, 0xbe7a2af3), TOBN(0xec51caa9, 0x4fb74a72), + TOBN(0xb9937a4b, 0x63879697), TOBN(0x7c9a9d20, 0xec2687d5)}, + {TOBN(0x1773e44f, 0x6ef5f014), TOBN(0x8abcf412, 0xe90c6900), + TOBN(0x387bd022, 0x8142161e), TOBN(0x50393755, 0xfcb6ff2a)}}, + {{TOBN(0x9813fd56, 0xed6def63), TOBN(0x53cf6482, 0x7d53106c), + TOBN(0x991a35bd, 0x431f7ac1), TOBN(0xf1e274dd, 0x63e65faf)}, + {TOBN(0xf63ffa3c, 0x44cc7880), TOBN(0x411a426b, 0x7c256981), + TOBN(0xb698b9fd, 0x93a420e0), TOBN(0x89fdddc0, 0xae53f8fe)}}, + {{TOBN(0x766e0722, 0x32398baa), TOBN(0x205fee42, 0x5cfca031), + TOBN(0xa49f5341, 0x7a029cf2), TOBN(0xa88c68b8, 0x4023890d)}, + {TOBN(0xbc275041, 0x7337aaa8), TOBN(0x9ed364ad, 0x0eb384f4), + TOBN(0xe0816f85, 0x29aba92f), TOBN(0x2e9e1941, 0x04e38a88)}}, + {{TOBN(0x57eef44a, 0x3dafd2d5), TOBN(0x35d1fae5, 0x97ed98d8), + TOBN(0x50628c09, 0x2307f9b1), TOBN(0x09d84aae, 0xd6cba5c6)}, + {TOBN(0x67071bc7, 0x88aaa691), TOBN(0x2dea57a9, 0xafe6cb03), + TOBN(0xdfe11bb4, 0x3d78ac01), TOBN(0x7286418c, 0x7fd7aa51)}}, + {{TOBN(0xfabf7709, 0x77f7195a), TOBN(0x8ec86167, 0xadeb838f), + TOBN(0xea1285a8, 0xbb4f012d), TOBN(0xd6883503, 0x9a3eab3f)}, + {TOBN(0xee5d24f8, 0x309004c2), TOBN(0xa96e4b76, 0x13ffe95e), + TOBN(0x0cdffe12, 0xbd223ea4), TOBN(0x8f5c2ee5, 0xb6739a53)}}, + {{TOBN(0x5cb4aaa5, 0xdd968198), TOBN(0xfa131c52, 0x72413a6c), + TOBN(0x53d46a90, 0x9536d903), TOBN(0xb270f0d3, 0x48606d8e)}, + {TOBN(0x518c7564, 0xa053a3bc), TOBN(0x088254b7, 0x1a86caef), + TOBN(0xb3ba8cb4, 0x0ab5efd0), TOBN(0x5c59900e, 0x4605945d)}}, + {{TOBN(0xecace1dd, 0xa1887395), TOBN(0x40960f36, 0x932a65de), + TOBN(0x9611ff5c, 0x3aa95529), TOBN(0xc58215b0, 0x7c1e5a36)}, + {TOBN(0xd48c9b58, 0xf0e1a524), TOBN(0xb406856b, 0xf590dfb8), + TOBN(0xc7605e04, 0x9cd95662), TOBN(0x0dd036ee, 0xa33ecf82)}}, + {{TOBN(0xa50171ac, 0xc33156b3), TOBN(0xf09d24ea, 0x4a80172e), + TOBN(0x4e1f72c6, 0x76dc8eef), TOBN(0xe60caadc, 0x5e3d44ee)}, + {TOBN(0x006ef8a6, 0x979b1d8f), TOBN(0x60908a1c, 0x97788d26), + TOBN(0x6e08f95b, 0x266feec0), TOBN(0x618427c2, 0x22e8c94e)}}, + {{TOBN(0x3d613339, 0x59145a65), TOBN(0xcd9bc368, 0xfa406337), + TOBN(0x82d11be3, 0x2d8a52a0), TOBN(0xf6877b27, 0x97a1c590)}, + {TOBN(0x837a819b, 0xf5cbdb25), TOBN(0x2a4fd1d8, 0xde090249), + TOBN(0x622a7de7, 0x74990e5f), TOBN(0x840fa5a0, 0x7945511b)}}, + {{TOBN(0x30b974be, 0x6558842d), TOBN(0x70df8c64, 0x17f3d0a6), + TOBN(0x7c803520, 0x7542e46d), TOBN(0x7251fe7f, 0xe4ecc823)}, + {TOBN(0xe59134cb, 0x5e9aac9a), TOBN(0x11bb0934, 0xf0045d71), + TOBN(0x53e5d9b5, 0xdbcb1d4e), TOBN(0x8d97a905, 0x92defc91)}}, + {{TOBN(0xfe289327, 0x7946d3f9), TOBN(0xe132bd24, 0x07472273), + TOBN(0xeeeb510c, 0x1eb6ae86), TOBN(0x777708c5, 0xf0595067)}, + {TOBN(0x18e2c8cd, 0x1297029e), TOBN(0x2c61095c, 0xbbf9305e), + TOBN(0xe466c258, 0x6b85d6d9), TOBN(0x8ac06c36, 0xda1ea530)}}, + {{TOBN(0xa365dc39, 0xa1304668), TOBN(0xe4a9c885, 0x07f89606), + TOBN(0x65a4898f, 0xacc7228d), TOBN(0x3e2347ff, 0x84ca8303)}, + {TOBN(0xa5f6fb77, 0xea7d23a3), TOBN(0x2fac257d, 0x672a71cd), + TOBN(0x6908bef8, 0x7e6a44d3), TOBN(0x8ff87566, 0x891d3d7a)}}, + {{TOBN(0xe58e90b3, 0x6b0cf82e), TOBN(0x6438d246, 0x2615b5e7), + TOBN(0x07b1f8fc, 0x669c145a), TOBN(0xb0d8b2da, 0x36f1e1cb)}, + {TOBN(0x54d5dadb, 0xd9184c4d), TOBN(0x3dbb18d5, 0xf93d9976), + TOBN(0x0a3e0f56, 0xd1147d47), TOBN(0x2afa8c8d, 0xa0a48609)}}, + {{TOBN(0x275353e8, 0xbc36742c), TOBN(0x898f427e, 0xeea0ed90), + TOBN(0x26f4947e, 0x3e477b00), TOBN(0x8ad8848a, 0x308741e3)}, + {TOBN(0x6c703c38, 0xd74a2a46), TOBN(0x5e3e05a9, 0x9ba17ba2), + TOBN(0xc1fa6f66, 0x4ab9a9e4), TOBN(0x474a2d9a, 0x3841d6ec)}}, + {{TOBN(0x871239ad, 0x653ae326), TOBN(0x14bcf72a, 0xa74cbb43), + TOBN(0x8737650e, 0x20d4c083), TOBN(0x3df86536, 0x110ed4af)}, + {TOBN(0xd2d86fe7, 0xb53ca555), TOBN(0x688cb00d, 0xabd5d538), + TOBN(0xcf81bda3, 0x1ad38468), TOBN(0x7ccfe3cc, 0xf01167b6)}}, + {{TOBN(0xcf4f47e0, 0x6c4c1fe6), TOBN(0x557e1f1a, 0x298bbb79), + TOBN(0xf93b974f, 0x30d45a14), TOBN(0x174a1d2d, 0x0baf97c4)}, + {TOBN(0x7a003b30, 0xc51fbf53), TOBN(0xd8940991, 0xee68b225), + TOBN(0x5b0aa7b7, 0x1c0f4173), TOBN(0x975797c9, 0xa20a7153)}}, + {{TOBN(0x26e08c07, 0xe3533d77), TOBN(0xd7222e6a, 0x2e341c99), + TOBN(0x9d60ec3d, 0x8d2dc4ed), TOBN(0xbdfe0d8f, 0x7c476cf8)}, + {TOBN(0x1fe59ab6, 0x1d056605), TOBN(0xa9ea9df6, 0x86a8551f), + TOBN(0x8489941e, 0x47fb8d8c), TOBN(0xfeb874eb, 0x4a7f1b10)}}, + {{TOBN(0xfe5fea86, 0x7ee0d98f), TOBN(0x201ad34b, 0xdbf61864), + TOBN(0x45d8fe47, 0x37c031d4), TOBN(0xd5f49fae, 0x795f0822)}, + {TOBN(0xdb0fb291, 0xc7f4a40c), TOBN(0x2e69d9c1, 0x730ddd92), + TOBN(0x754e1054, 0x49d76987), TOBN(0x8a24911d, 0x7662db87)}}, + {{TOBN(0x61fc1810, 0x60a71676), TOBN(0xe852d1a8, 0xf66a8ad1), + TOBN(0x172bbd65, 0x6417231e), TOBN(0x0d6de7bd, 0x3babb11f)}, + {TOBN(0x6fde6f88, 0xc8e347f8), TOBN(0x1c587547, 0x9bd99cc3), + TOBN(0x78e54ed0, 0x34076950), TOBN(0x97f0f334, 0x796e83ba)}}, + {{TOBN(0xe4dbe1ce, 0x4924867a), TOBN(0xbd5f51b0, 0x60b84917), + TOBN(0x37530040, 0x3cb09a79), TOBN(0xdb3fe0f8, 0xff1743d8)}, + {TOBN(0xed7894d8, 0x556fa9db), TOBN(0xfa262169, 0x23412fbf), + TOBN(0x563be0db, 0xba7b9291), TOBN(0x6ca8b8c0, 0x0c9fb234)}}, + {{TOBN(0xed406aa9, 0xbd763802), TOBN(0xc21486a0, 0x65303da1), + TOBN(0x61ae291e, 0xc7e62ec4), TOBN(0x622a0492, 0xdf99333e)}, + {TOBN(0x7fd80c9d, 0xbb7a8ee0), TOBN(0xdc2ed3bc, 0x6c01aedb), + TOBN(0x35c35a12, 0x08be74ec), TOBN(0xd540cb1a, 0x469f671f)}}, + {{TOBN(0xd16ced4e, 0xcf84f6c7), TOBN(0x8561fb9c, 0x2d090f43), + TOBN(0x7e693d79, 0x6f239db4), TOBN(0xa736f928, 0x77bd0d94)}, + {TOBN(0x07b4d929, 0x2c1950ee), TOBN(0xda177543, 0x56dc11b3), + TOBN(0xa5dfbbaa, 0x7a6a878e), TOBN(0x1c70cb29, 0x4decb08a)}}, + {{TOBN(0xfba28c8b, 0x6f0f7c50), TOBN(0xa8eba2b8, 0x854dcc6d), + TOBN(0x5ff8e89a, 0x36b78642), TOBN(0x070c1c8e, 0xf6873adf)}, + {TOBN(0xbbd3c371, 0x6484d2e4), TOBN(0xfb78318f, 0x0d414129), + TOBN(0x2621a39c, 0x6ad93b0b), TOBN(0x979d74c2, 0xa9e917f7)}}, + {{TOBN(0xfc195647, 0x61fb0428), TOBN(0x4d78954a, 0xbee624d4), + TOBN(0xb94896e0, 0xb8ae86fd), TOBN(0x6667ac0c, 0xc91c8b13)}, + {TOBN(0x9f180512, 0x43bcf832), TOBN(0xfbadf8b7, 0xa0010137), + TOBN(0xc69b4089, 0xb3ba8aa7), TOBN(0xfac4bacd, 0xe687ce85)}}, + {{TOBN(0x9164088d, 0x977eab40), TOBN(0x51f4c5b6, 0x2760b390), + TOBN(0xd238238f, 0x340dd553), TOBN(0x358566c3, 0xdb1d31c9)}, + {TOBN(0x3a5ad69e, 0x5068f5ff), TOBN(0xf31435fc, 0xdaff6b06), + TOBN(0xae549a5b, 0xd6debff0), TOBN(0x59e5f0b7, 0x75e01331)}}, + {{TOBN(0x5d492fb8, 0x98559acf), TOBN(0x96018c2e, 0x4db79b50), + TOBN(0x55f4a48f, 0x609f66aa), TOBN(0x1943b3af, 0x4900a14f)}, + {TOBN(0xc22496df, 0x15a40d39), TOBN(0xb2a44684, 0x4c20f7c5), + TOBN(0x76a35afa, 0x3b98404c), TOBN(0xbec75725, 0xff5d1b77)}}, + {{TOBN(0xb67aa163, 0xbea06444), TOBN(0x27e95bb2, 0xf724b6f2), + TOBN(0x3c20e3e9, 0xd238c8ab), TOBN(0x1213754e, 0xddd6ae17)}, + {TOBN(0x8c431020, 0x716e0f74), TOBN(0x6679c82e, 0xffc095c2), + TOBN(0x2eb3adf4, 0xd0ac2932), TOBN(0x2cc970d3, 0x01bb7a76)}}, + {{TOBN(0x70c71f2f, 0x740f0e66), TOBN(0x545c616b, 0x2b6b23cc), + TOBN(0x4528cfcb, 0xb40a8bd7), TOBN(0xff839633, 0x2ab27722)}, + {TOBN(0x049127d9, 0x025ac99a), TOBN(0xd314d4a0, 0x2b63e33b), + TOBN(0xc8c310e7, 0x28d84519), TOBN(0x0fcb8983, 0xb3bc84ba)}}, + {{TOBN(0x2cc52261, 0x38634818), TOBN(0x501814f4, 0xb44c2e0b), + TOBN(0xf7e181aa, 0x54dfdba3), TOBN(0xcfd58ff0, 0xe759718c)}, + {TOBN(0xf90cdb14, 0xd3b507a8), TOBN(0x57bd478e, 0xc50bdad8), + TOBN(0x29c197e2, 0x50e5f9aa), TOBN(0x4db6eef8, 0xe40bc855)}}, + {{TOBN(0x2cc8f21a, 0xd1fc0654), TOBN(0xc71cc963, 0x81269d73), + TOBN(0xecfbb204, 0x077f49f9), TOBN(0xdde92571, 0xca56b793)}, + {TOBN(0x9abed6a3, 0xf97ad8f7), TOBN(0xe6c19d3f, 0x924de3bd), + TOBN(0x8dce92f4, 0xa140a800), TOBN(0x85f44d1e, 0x1337af07)}}, + {{TOBN(0x5953c08b, 0x09d64c52), TOBN(0xa1b5e49f, 0xf5df9749), + TOBN(0x336a8fb8, 0x52735f7d), TOBN(0xb332b6db, 0x9add676b)}, + {TOBN(0x558b88a0, 0xb4511aa4), TOBN(0x09788752, 0xdbd5cc55), + TOBN(0x16b43b9c, 0xd8cd52bd), TOBN(0x7f0bc5a0, 0xc2a2696b)}}, + {{TOBN(0x146e12d4, 0xc11f61ef), TOBN(0x9ce10754, 0x3a83e79e), + TOBN(0x08ec73d9, 0x6cbfca15), TOBN(0x09ff29ad, 0x5b49653f)}, + {TOBN(0xe31b72bd, 0xe7da946e), TOBN(0xebf9eb3b, 0xee80a4f2), + TOBN(0xd1aabd08, 0x17598ce4), TOBN(0x18b5fef4, 0x53f37e80)}}, + {{TOBN(0xd5d5cdd3, 0x5958cd79), TOBN(0x3580a1b5, 0x1d373114), + TOBN(0xa36e4c91, 0xfa935726), TOBN(0xa38c534d, 0xef20d760)}, + {TOBN(0x7088e40a, 0x2ff5845b), TOBN(0xe5bb40bd, 0xbd78177f), + TOBN(0x4f06a7a8, 0x857f9920), TOBN(0xe3cc3e50, 0xe968f05d)}}, + {{TOBN(0x1d68b7fe, 0xe5682d26), TOBN(0x5206f76f, 0xaec7f87c), + TOBN(0x41110530, 0x041951ab), TOBN(0x58ec52c1, 0xd4b5a71a)}, + {TOBN(0xf3488f99, 0x0f75cf9a), TOBN(0xf411951f, 0xba82d0d5), + TOBN(0x27ee75be, 0x618895ab), TOBN(0xeae060d4, 0x6d8aab14)}}, + {{TOBN(0x9ae1df73, 0x7fb54dc2), TOBN(0x1f3e391b, 0x25963649), + TOBN(0x242ec32a, 0xfe055081), TOBN(0x5bd450ef, 0x8491c9bd)}, + {TOBN(0x367efc67, 0x981eb389), TOBN(0xed7e1928, 0x3a0550d5), + TOBN(0x362e776b, 0xab3ce75c), TOBN(0xe890e308, 0x1f24c523)}}, + {{TOBN(0xb961b682, 0xfeccef76), TOBN(0x8b8e11f5, 0x8bba6d92), + TOBN(0x8f2ccc4c, 0x2b2375c4), TOBN(0x0d7f7a52, 0xe2f86cfa)}, + {TOBN(0xfd94d30a, 0x9efe5633), TOBN(0x2d8d246b, 0x5451f934), + TOBN(0x2234c6e3, 0x244e6a00), TOBN(0xde2b5b0d, 0xddec8c50)}}, + {{TOBN(0x2ce53c5a, 0xbf776f5b), TOBN(0x6f724071, 0x60357b05), + TOBN(0xb2593717, 0x71bf3f7a), TOBN(0x87d2501c, 0x440c4a9f)}, + {TOBN(0x440552e1, 0x87b05340), TOBN(0xb7bf7cc8, 0x21624c32), + TOBN(0x4155a6ce, 0x22facddb), TOBN(0x5a4228cb, 0x889837ef)}}, + {{TOBN(0xef87d6d6, 0xfd4fd671), TOBN(0xa233687e, 0xc2daa10e), + TOBN(0x75622244, 0x03c0eb96), TOBN(0x7632d184, 0x8bf19be6)}, + {TOBN(0x05d0f8e9, 0x40735ff4), TOBN(0x3a3e6e13, 0xc00931f1), + TOBN(0x31ccde6a, 0xdafe3f18), TOBN(0xf381366a, 0xcfe51207)}}, + {{TOBN(0x24c222a9, 0x60167d92), TOBN(0x62f9d6f8, 0x7529f18c), + TOBN(0x412397c0, 0x0353b114), TOBN(0x334d89dc, 0xef808043)}, + {TOBN(0xd9ec63ba, 0x2a4383ce), TOBN(0xcec8e937, 0x5cf92ba0), + TOBN(0xfb8b4288, 0xc8be74c0), TOBN(0x67d6912f, 0x105d4391)}}, + {{TOBN(0x7b996c46, 0x1b913149), TOBN(0x36aae2ef, 0x3a4e02da), + TOBN(0xb68aa003, 0x972de594), TOBN(0x284ec70d, 0x4ec6d545)}, + {TOBN(0xf3d2b2d0, 0x61391d54), TOBN(0x69c5d5d6, 0xfe114e92), + TOBN(0xbe0f00b5, 0xb4482dff), TOBN(0xe1596fa5, 0xf5bf33c5)}}, + {{TOBN(0x10595b56, 0x96a71cba), TOBN(0x944938b2, 0xfdcadeb7), + TOBN(0xa282da4c, 0xfccd8471), TOBN(0x98ec05f3, 0x0d37bfe1)}, + {TOBN(0xe171ce1b, 0x0698304a), TOBN(0x2d691444, 0x21bdf79b), + TOBN(0xd0cd3b74, 0x1b21dec1), TOBN(0x712ecd8b, 0x16a15f71)}}, + {{TOBN(0x8d4c00a7, 0x00fd56e1), TOBN(0x02ec9692, 0xf9527c18), + TOBN(0x21c44937, 0x4a3e42e1), TOBN(0x9176fbab, 0x1392ae0a)}, + {TOBN(0x8726f1ba, 0x44b7b618), TOBN(0xb4d7aae9, 0xf1de491c), + TOBN(0xf91df7b9, 0x07b582c0), TOBN(0x7e116c30, 0xef60aa3a)}}, + {{TOBN(0x99270f81, 0x466265d7), TOBN(0xb15b6fe2, 0x4df7adf0), + TOBN(0xfe33b2d3, 0xf9738f7f), TOBN(0x48553ab9, 0xd6d70f95)}, + {TOBN(0x2cc72ac8, 0xc21e94db), TOBN(0x795ac38d, 0xbdc0bbee), + TOBN(0x0a1be449, 0x2e40478f), TOBN(0x81bd3394, 0x052bde55)}}, + {{TOBN(0x63c8dbe9, 0x56b3c4f2), TOBN(0x017a99cf, 0x904177cc), + TOBN(0x947bbddb, 0x4d010fc1), TOBN(0xacf9b00b, 0xbb2c9b21)}, + {TOBN(0x2970bc8d, 0x47173611), TOBN(0x1a4cbe08, 0xac7d756f), + TOBN(0x06d9f4aa, 0x67d541a2), TOBN(0xa3e8b689, 0x59c2cf44)}}, + {{TOBN(0xaad066da, 0x4d88f1dd), TOBN(0xc604f165, 0x7ad35dea), + TOBN(0x7edc0720, 0x4478ca67), TOBN(0xa10dfae0, 0xba02ce06)}, + {TOBN(0xeceb1c76, 0xaf36f4e4), TOBN(0x994b2292, 0xaf3f8f48), + TOBN(0xbf9ed77b, 0x77c8a68c), TOBN(0x74f544ea, 0x51744c9d)}}, + {{TOBN(0x82d05bb9, 0x8113a757), TOBN(0x4ef2d2b4, 0x8a9885e4), + TOBN(0x1e332be5, 0x1aa7865f), TOBN(0x22b76b18, 0x290d1a52)}, + {TOBN(0x308a2310, 0x44351683), TOBN(0x9d861896, 0xa3f22840), + TOBN(0x5959ddcd, 0x841ed947), TOBN(0x0def0c94, 0x154b73bf)}}, + {{TOBN(0xf0105417, 0x4c7c15e0), TOBN(0x539bfb02, 0x3a277c32), + TOBN(0xe699268e, 0xf9dccf5f), TOBN(0x9f5796a5, 0x0247a3bd)}, + {TOBN(0x8b839de8, 0x4f157269), TOBN(0xc825c1e5, 0x7a30196b), + TOBN(0x6ef0aabc, 0xdc8a5a91), TOBN(0xf4a8ce6c, 0x498b7fe6)}}, + {{TOBN(0x1cce35a7, 0x70cbac78), TOBN(0x83488e9b, 0xf6b23958), + TOBN(0x0341a070, 0xd76cb011), TOBN(0xda6c9d06, 0xae1b2658)}, + {TOBN(0xb701fb30, 0xdd648c52), TOBN(0x994ca02c, 0x52fb9fd1), + TOBN(0x06933117, 0x6f563086), TOBN(0x3d2b8100, 0x17856bab)}}, + {{TOBN(0xe89f48c8, 0x5963a46e), TOBN(0x658ab875, 0xa99e61c7), + TOBN(0x6e296f87, 0x4b8517b4), TOBN(0x36c4fcdc, 0xfc1bc656)}, + {TOBN(0xde5227a1, 0xa3906def), TOBN(0x9fe95f57, 0x62418945), + TOBN(0x20c91e81, 0xfdd96cde), TOBN(0x5adbe47e, 0xda4480de)}}, + {{TOBN(0xa009370f, 0x396de2b6), TOBN(0x98583d4b, 0xf0ecc7bd), + TOBN(0xf44f6b57, 0xe51d0672), TOBN(0x03d6b078, 0x556b1984)}, + {TOBN(0x27dbdd93, 0xb0b64912), TOBN(0x9b3a3434, 0x15687b09), + TOBN(0x0dba6461, 0x51ec20a9), TOBN(0xec93db7f, 0xff28187c)}}, + {{TOBN(0x00ff8c24, 0x66e48bdd), TOBN(0x2514f2f9, 0x11ccd78e), + TOBN(0xeba11f4f, 0xe1250603), TOBN(0x8a22cd41, 0x243fa156)}, + {TOBN(0xa4e58df4, 0xb283e4c6), TOBN(0x78c29859, 0x8b39783f), + TOBN(0x5235aee2, 0xa5259809), TOBN(0xc16284b5, 0x0e0227dd)}}, + {{TOBN(0xa5f57916, 0x1338830d), TOBN(0x6d4b8a6b, 0xd2123fca), + TOBN(0x236ea68a, 0xf9c546f8), TOBN(0xc1d36873, 0xfa608d36)}, + {TOBN(0xcd76e495, 0x8d436d13), TOBN(0xd4d9c221, 0x8fb080af), + TOBN(0x665c1728, 0xe8ad3fb5), TOBN(0xcf1ebe4d, 0xb3d572e0)}}, + {{TOBN(0xa7a8746a, 0x584c5e20), TOBN(0x267e4ea1, 0xb9dc7035), + TOBN(0x593a15cf, 0xb9548c9b), TOBN(0x5e6e2135, 0x4bd012f3)}, + {TOBN(0xdf31cc6a, 0x8c8f936e), TOBN(0x8af84d04, 0xb5c241dc), + TOBN(0x63990a6f, 0x345efb86), TOBN(0x6fef4e61, 0xb9b962cb)}}}, + {{{TOBN(0xf6368f09, 0x25722608), TOBN(0x131260db, 0x131cf5c6), + TOBN(0x40eb353b, 0xfab4f7ac), TOBN(0x85c78880, 0x37eee829)}, + {TOBN(0x4c1581ff, 0xc3bdf24e), TOBN(0x5bff75cb, 0xf5c3c5a8), + TOBN(0x35e8c83f, 0xa14e6f40), TOBN(0xb81d1c0f, 0x0295e0ca)}}, + {{TOBN(0xfcde7cc8, 0xf43a730f), TOBN(0xe89b6f3c, 0x33ab590e), + TOBN(0xc823f529, 0xad03240b), TOBN(0x82b79afe, 0x98bea5db)}, + {TOBN(0x568f2856, 0x962fe5de), TOBN(0x0c590adb, 0x60c591f3), + TOBN(0x1fc74a14, 0x4a28a858), TOBN(0x3b662498, 0xb3203f4c)}}, + {{TOBN(0x91e3cf0d, 0x6c39765a), TOBN(0xa2db3acd, 0xac3cca0b), + TOBN(0x288f2f08, 0xcb953b50), TOBN(0x2414582c, 0xcf43cf1a)}, + {TOBN(0x8dec8bbc, 0x60eee9a8), TOBN(0x54c79f02, 0x729aa042), + TOBN(0xd81cd5ec, 0x6532f5d5), TOBN(0xa672303a, 0xcf82e15f)}}, + {{TOBN(0x376aafa8, 0x719c0563), TOBN(0xcd8ad2dc, 0xbc5fc79f), + TOBN(0x303fdb9f, 0xcb750cd3), TOBN(0x14ff052f, 0x4418b08e)}, + {TOBN(0xf75084cf, 0x3e2d6520), TOBN(0x7ebdf0f8, 0x144ed509), + TOBN(0xf43bf0f2, 0xd3f25b98), TOBN(0x86ad71cf, 0xa354d837)}}, + {{TOBN(0xb827fe92, 0x26f43572), TOBN(0xdfd3ab5b, 0x5d824758), + TOBN(0x315dd23a, 0x539094c1), TOBN(0x85c0e37a, 0x66623d68)}, + {TOBN(0x575c7972, 0x7be19ae0), TOBN(0x616a3396, 0xdf0d36b5), + TOBN(0xa1ebb3c8, 0x26b1ff7e), TOBN(0x635b9485, 0x140ad453)}}, + {{TOBN(0x92bf3cda, 0xda430c0b), TOBN(0x4702850e, 0x3a96dac6), + TOBN(0xc91cf0a5, 0x15ac326a), TOBN(0x95de4f49, 0xab8c25e4)}, + {TOBN(0xb01bad09, 0xe265c17c), TOBN(0x24e45464, 0x087b3881), + TOBN(0xd43e583c, 0xe1fac5ca), TOBN(0xe17cb318, 0x6ead97a6)}}, + {{TOBN(0x6cc39243, 0x74dcec46), TOBN(0x33cfc02d, 0x54c2b73f), + TOBN(0x82917844, 0xf26cd99c), TOBN(0x8819dd95, 0xd1773f89)}, + {TOBN(0x09572aa6, 0x0871f427), TOBN(0x8e0cf365, 0xf6f01c34), + TOBN(0x7fa52988, 0xbff1f5af), TOBN(0x4eb357ea, 0xe75e8e50)}}, + {{TOBN(0xd9d0c8c4, 0x868af75d), TOBN(0xd7325cff, 0x45c8c7ea), + TOBN(0xab471996, 0xcc81ecb0), TOBN(0xff5d55f3, 0x611824ed)}, + {TOBN(0xbe314541, 0x1977a0ee), TOBN(0x5085c4c5, 0x722038c6), + TOBN(0x2d5335bf, 0xf94bb495), TOBN(0x894ad8a6, 0xc8e2a082)}}, + {{TOBN(0x5c3e2341, 0xada35438), TOBN(0xf4a9fc89, 0x049b8c4e), + TOBN(0xbeeb355a, 0x9f17cf34), TOBN(0x3f311e0e, 0x6c91fe10)}, + {TOBN(0xc2d20038, 0x92ab9891), TOBN(0x257bdcc1, 0x3e8ce9a9), + TOBN(0x1b2d9789, 0x88c53bee), TOBN(0x927ce89a, 0xcdba143a)}}, + {{TOBN(0xb0a32cca, 0x523db280), TOBN(0x5c889f8a, 0x50d43783), + TOBN(0x503e04b3, 0x4897d16f), TOBN(0x8cdb6e78, 0x08f5f2e8)}, + {TOBN(0x6ab91cf0, 0x179c8e74), TOBN(0xd8874e52, 0x48211d60), + TOBN(0xf948d4d5, 0xea851200), TOBN(0x4076d41e, 0xe6f9840a)}}, + {{TOBN(0xc20e263c, 0x47b517ea), TOBN(0x79a448fd, 0x30685e5e), + TOBN(0xe55f6f78, 0xf90631a0), TOBN(0x88a790b1, 0xa79e6346)}, + {TOBN(0x62160c7d, 0x80969fe8), TOBN(0x54f92fd4, 0x41491bb9), + TOBN(0xa6645c23, 0x5c957526), TOBN(0xf44cc5ae, 0xbea3ce7b)}}, + {{TOBN(0xf7628327, 0x8b1e68b7), TOBN(0xc731ad7a, 0x303f29d3), + TOBN(0xfe5a9ca9, 0x57d03ecb), TOBN(0x96c0d50c, 0x41bc97a7)}, + {TOBN(0xc4669fe7, 0x9b4f7f24), TOBN(0xfdd781d8, 0x3d9967ef), + TOBN(0x7892c7c3, 0x5d2c208d), TOBN(0x8bf64f7c, 0xae545cb3)}}, + {{TOBN(0xc01f862c, 0x467be912), TOBN(0xf4c85ee9, 0xc73d30cc), + TOBN(0x1fa6f4be, 0x6ab83ec7), TOBN(0xa07a3c1c, 0x4e3e3cf9)}, + {TOBN(0x87f8ef45, 0x0c00beb3), TOBN(0x30e2c2b3, 0x000d4c3e), + TOBN(0x1aa00b94, 0xfe08bf5b), TOBN(0x32c133aa, 0x9224ef52)}}, + {{TOBN(0x38df16bb, 0x32e5685d), TOBN(0x68a9e069, 0x58e6f544), + TOBN(0x495aaff7, 0xcdc5ebc6), TOBN(0xf894a645, 0x378b135f)}, + {TOBN(0xf316350a, 0x09e27ecf), TOBN(0xeced201e, 0x58f7179d), + TOBN(0x2eec273c, 0xe97861ba), TOBN(0x47ec2cae, 0xd693be2e)}}, + {{TOBN(0xfa4c97c4, 0xf68367ce), TOBN(0xe4f47d0b, 0xbe5a5755), + TOBN(0x17de815d, 0xb298a979), TOBN(0xd7eca659, 0xc177dc7d)}, + {TOBN(0x20fdbb71, 0x49ded0a3), TOBN(0x4cb2aad4, 0xfb34d3c5), + TOBN(0x2cf31d28, 0x60858a33), TOBN(0x3b6873ef, 0xa24aa40f)}}, + {{TOBN(0x540234b2, 0x2c11bb37), TOBN(0x2d0366dd, 0xed4c74a3), + TOBN(0xf9a968da, 0xeec5f25d), TOBN(0x36601068, 0x67b63142)}, + {TOBN(0x07cd6d2c, 0x68d7b6d4), TOBN(0xa8f74f09, 0x0c842942), + TOBN(0xe2751404, 0x7768b1ee), TOBN(0x4b5f7e89, 0xfe62aee4)}}, + {{TOBN(0xc6a77177, 0x89070d26), TOBN(0xa1f28e4e, 0xdd1c8bc7), + TOBN(0xea5f4f06, 0x469e1f17), TOBN(0x78fc242a, 0xfbdb78e0)}, + {TOBN(0xc9c7c592, 0x8b0588f1), TOBN(0xb6b7a0fd, 0x1535921e), + TOBN(0xcc5bdb91, 0xbde5ae35), TOBN(0xb42c485e, 0x12ff1864)}}, + {{TOBN(0xa1113e13, 0xdbab98aa), TOBN(0xde9d469b, 0xa17b1024), + TOBN(0x23f48b37, 0xc0462d3a), TOBN(0x3752e537, 0x7c5c078d)}, + {TOBN(0xe3a86add, 0x15544eb9), TOBN(0xf013aea7, 0x80fba279), + TOBN(0x8b5bb76c, 0xf22001b5), TOBN(0xe617ba14, 0xf02891ab)}}, + {{TOBN(0xd39182a6, 0x936219d3), TOBN(0x5ce1f194, 0xae51cb19), + TOBN(0xc78f8598, 0xbf07a74c), TOBN(0x6d7158f2, 0x22cbf1bc)}, + {TOBN(0x3b846b21, 0xe300ce18), TOBN(0x35fba630, 0x2d11275d), + TOBN(0x5fe25c36, 0xa0239b9b), TOBN(0xd8beb35d, 0xdf05d940)}}, + {{TOBN(0x4db02bb0, 0x1f7e320d), TOBN(0x0641c364, 0x6da320ea), + TOBN(0x6d95fa5d, 0x821389a3), TOBN(0x92699748, 0x8fcd8e3d)}, + {TOBN(0x316fef17, 0xceb6c143), TOBN(0x67fcb841, 0xd933762b), + TOBN(0xbb837e35, 0x118b17f8), TOBN(0x4b92552f, 0x9fd24821)}}, + {{TOBN(0xae6bc70e, 0x46aca793), TOBN(0x1cf0b0e4, 0xe579311b), + TOBN(0x8dc631be, 0x5802f716), TOBN(0x099bdc6f, 0xbddbee4d)}, + {TOBN(0xcc352bb2, 0x0caf8b05), TOBN(0xf74d505a, 0x72d63df2), + TOBN(0xb9876d4b, 0x91c4f408), TOBN(0x1ce18473, 0x9e229b2d)}}, + {{TOBN(0x49507597, 0x83abdb4a), TOBN(0x850fbcb6, 0xdee84b18), + TOBN(0x6325236e, 0x609e67dc), TOBN(0x04d831d9, 0x9336c6d8)}, + {TOBN(0x8deaae3b, 0xfa12d45d), TOBN(0xe425f8ce, 0x4746e246), + TOBN(0x8004c175, 0x24f5f31e), TOBN(0xaca16d8f, 0xad62c3b7)}}, + {{TOBN(0x0dc15a6a, 0x9152f934), TOBN(0xf1235e5d, 0xed0e12c1), + TOBN(0xc33c06ec, 0xda477dac), TOBN(0x76be8732, 0xb2ea0006)}, + {TOBN(0xcf3f7831, 0x0c0cd313), TOBN(0x3c524553, 0xa614260d), + TOBN(0x31a756f8, 0xcab22d15), TOBN(0x03ee10d1, 0x77827a20)}}, + {{TOBN(0xd1e059b2, 0x1994ef20), TOBN(0x2a653b69, 0x638ae318), + TOBN(0x70d5eb58, 0x2f699010), TOBN(0x279739f7, 0x09f5f84a)}, + {TOBN(0x5da4663c, 0x8b799336), TOBN(0xfdfdf14d, 0x203c37eb), + TOBN(0x32d8a9dc, 0xa1dbfb2d), TOBN(0xab40cff0, 0x77d48f9b)}}, + {{TOBN(0xc018b383, 0xd20b42d5), TOBN(0xf9a810ef, 0x9f78845f), + TOBN(0x40af3753, 0xbdba9df0), TOBN(0xb90bdcfc, 0x131dfdf9)}, + {TOBN(0x18720591, 0xf01ab782), TOBN(0xc823f211, 0x6af12a88), + TOBN(0xa51b80f3, 0x0dc14401), TOBN(0xde248f77, 0xfb2dfbe3)}}, + {{TOBN(0xef5a44e5, 0x0cafe751), TOBN(0x73997c9c, 0xd4dcd221), + TOBN(0x32fd86d1, 0xde854024), TOBN(0xd5b53adc, 0xa09b84bb)}, + {TOBN(0x008d7a11, 0xdcedd8d1), TOBN(0x406bd1c8, 0x74b32c84), + TOBN(0x5d4472ff, 0x05dde8b1), TOBN(0x2e25f2cd, 0xfce2b32f)}}, + {{TOBN(0xbec0dd5e, 0x29dfc254), TOBN(0x4455fcf6, 0x2b98b267), + TOBN(0x0b4d43a5, 0xc72df2ad), TOBN(0xea70e6be, 0x48a75397)}, + {TOBN(0x2aad6169, 0x5820f3bf), TOBN(0xf410d2dd, 0x9e37f68f), + TOBN(0x70fb7dba, 0x7be5ac83), TOBN(0x636bb645, 0x36ec3eec)}}, + {{TOBN(0x27104ea3, 0x9754e21c), TOBN(0xbc87a3e6, 0x8d63c373), + TOBN(0x483351d7, 0x4109db9a), TOBN(0x0fa724e3, 0x60134da7)}, + {TOBN(0x9ff44c29, 0xb0720b16), TOBN(0x2dd0cf13, 0x06aceead), + TOBN(0x5942758c, 0xe26929a6), TOBN(0x96c5db92, 0xb766a92b)}}, + {{TOBN(0xcec7d4c0, 0x5f18395e), TOBN(0xd3f22744, 0x1f80d032), + TOBN(0x7a68b37a, 0xcb86075b), TOBN(0x074764dd, 0xafef92db)}, + {TOBN(0xded1e950, 0x7bc7f389), TOBN(0xc580c850, 0xb9756460), + TOBN(0xaeeec2a4, 0x7da48157), TOBN(0x3f0b4e7f, 0x82c587b3)}}, + {{TOBN(0x231c6de8, 0xa9f19c53), TOBN(0x5717bd73, 0x6974e34e), + TOBN(0xd9e1d216, 0xf1508fa9), TOBN(0x9f112361, 0xdadaa124)}, + {TOBN(0x80145e31, 0x823b7348), TOBN(0x4dd8f0d5, 0xac634069), + TOBN(0xe3d82fc7, 0x2297c258), TOBN(0x276fcfee, 0x9cee7431)}}, + {{TOBN(0x8eb61b5e, 0x2bc0aea9), TOBN(0x4f668fd5, 0xde329431), + TOBN(0x03a32ab1, 0x38e4b87e), TOBN(0xe1374517, 0x73d0ef0b)}, + {TOBN(0x1a46f7e6, 0x853ac983), TOBN(0xc3bdf42e, 0x68e78a57), + TOBN(0xacf20785, 0x2ea96dd1), TOBN(0xa10649b9, 0xf1638460)}}, + {{TOBN(0xf2369f0b, 0x879fbbed), TOBN(0x0ff0ae86, 0xda9d1869), + TOBN(0x5251d759, 0x56766f45), TOBN(0x4984d8c0, 0x2be8d0fc)}, + {TOBN(0x7ecc95a6, 0xd21008f0), TOBN(0x29bd54a0, 0x3a1a1c49), + TOBN(0xab9828c5, 0xd26c50f3), TOBN(0x32c0087c, 0x51d0d251)}}, + {{TOBN(0x9bac3ce6, 0x0c1cdb26), TOBN(0xcd94d947, 0x557ca205), + TOBN(0x1b1bd598, 0x9db1fdcd), TOBN(0x0eda0108, 0xa3d8b149)}, + {TOBN(0x95066610, 0x56152fcc), TOBN(0xc2f037e6, 0xe7192b33), + TOBN(0xdeffb41a, 0xc92e05a4), TOBN(0x1105f6c2, 0xc2f6c62e)}}, + {{TOBN(0x68e73500, 0x8733913c), TOBN(0xcce86163, 0x3f3adc40), + TOBN(0xf407a942, 0x38a278e9), TOBN(0xd13c1b9d, 0x2ab21292)}, + {TOBN(0x93ed7ec7, 0x1c74cf5c), TOBN(0x8887dc48, 0xf1a4c1b4), + TOBN(0x3830ff30, 0x4b3a11f1), TOBN(0x358c5a3c, 0x58937cb6)}}, + {{TOBN(0x027dc404, 0x89022829), TOBN(0x40e93977, 0x3b798f79), + TOBN(0x90ad3337, 0x38be6ead), TOBN(0x9c23f6bc, 0xf34c0a5d)}, + {TOBN(0xd1711a35, 0xfbffd8bb), TOBN(0x60fcfb49, 0x1949d3dd), + TOBN(0x09c8ef4b, 0x7825d93a), TOBN(0x24233cff, 0xa0a8c968)}}, + {{TOBN(0x67ade46c, 0xe6d982af), TOBN(0xebb6bf3e, 0xe7544d7c), + TOBN(0xd6b9ba76, 0x3d8bd087), TOBN(0x46fe382d, 0x4dc61280)}, + {TOBN(0xbd39a7e8, 0xb5bdbd75), TOBN(0xab381331, 0xb8f228fe), + TOBN(0x0709a77c, 0xce1c4300), TOBN(0x6a247e56, 0xf337ceac)}}, + {{TOBN(0x8f34f21b, 0x636288be), TOBN(0x9dfdca74, 0xc8a7c305), + TOBN(0x6decfd1b, 0xea919e04), TOBN(0xcdf2688d, 0x8e1991f8)}, + {TOBN(0xe607df44, 0xd0f8a67e), TOBN(0xd985df4b, 0x0b58d010), + TOBN(0x57f834c5, 0x0c24f8f4), TOBN(0xe976ef56, 0xa0bf01ae)}}, + {{TOBN(0x536395ac, 0xa1c32373), TOBN(0x351027aa, 0x734c0a13), + TOBN(0xd2f1b5d6, 0x5e6bd5bc), TOBN(0x2b539e24, 0x223debed)}, + {TOBN(0xd4994cec, 0x0eaa1d71), TOBN(0x2a83381d, 0x661dcf65), + TOBN(0x5f1aed2f, 0x7b54c740), TOBN(0x0bea3fa5, 0xd6dda5ee)}}, + {{TOBN(0x9d4fb684, 0x36cc6134), TOBN(0x8eb9bbf3, 0xc0a443dd), + TOBN(0xfc500e2e, 0x383b7d2a), TOBN(0x7aad621c, 0x5b775257)}, + {TOBN(0x69284d74, 0x0a8f7cc0), TOBN(0xe820c2ce, 0x07562d65), + TOBN(0xbf9531b9, 0x499758ee), TOBN(0x73e95ca5, 0x6ee0cc2d)}}, + {{TOBN(0xf61790ab, 0xfbaf50a5), TOBN(0xdf55e76b, 0x684e0750), + TOBN(0xec516da7, 0xf176b005), TOBN(0x575553bb, 0x7a2dddc7)}, + {TOBN(0x37c87ca3, 0x553afa73), TOBN(0x315f3ffc, 0x4d55c251), + TOBN(0xe846442a, 0xaf3e5d35), TOBN(0x61b91149, 0x6495ff28)}}, + {{TOBN(0x23cc95d3, 0xfa326dc3), TOBN(0x1df4da1f, 0x18fc2cea), + TOBN(0x24bf9adc, 0xd0a37d59), TOBN(0xb6710053, 0x320d6e1e)}, + {TOBN(0x96f9667e, 0x618344d1), TOBN(0xcc7ce042, 0xa06445af), + TOBN(0xa02d8514, 0xd68dbc3a), TOBN(0x4ea109e4, 0x280b5a5b)}}, + {{TOBN(0x5741a7ac, 0xb40961bf), TOBN(0x4ada5937, 0x6aa56bfa), + TOBN(0x7feb9145, 0x02b765d1), TOBN(0x561e97be, 0xe6ad1582)}, + {TOBN(0xbbc4a5b6, 0xda3982f5), TOBN(0x0c2659ed, 0xb546f468), + TOBN(0xb8e7e6aa, 0x59612d20), TOBN(0xd83dfe20, 0xac19e8e0)}}, + {{TOBN(0x8530c45f, 0xb835398c), TOBN(0x6106a8bf, 0xb38a41c2), + TOBN(0x21e8f9a6, 0x35f5dcdb), TOBN(0x39707137, 0xcae498ed)}, + {TOBN(0x70c23834, 0xd8249f00), TOBN(0x9f14b58f, 0xab2537a0), + TOBN(0xd043c365, 0x5f61c0c2), TOBN(0xdc5926d6, 0x09a194a7)}}, + {{TOBN(0xddec0339, 0x8e77738a), TOBN(0xd07a63ef, 0xfba46426), + TOBN(0x2e58e79c, 0xee7f6e86), TOBN(0xe59b0459, 0xff32d241)}, + {TOBN(0xc5ec84e5, 0x20fa0338), TOBN(0x97939ac8, 0xeaff5ace), + TOBN(0x0310a4e3, 0xb4a38313), TOBN(0x9115fba2, 0x8f9d9885)}}, + {{TOBN(0x8dd710c2, 0x5fadf8c3), TOBN(0x66be38a2, 0xce19c0e2), + TOBN(0xd42a279c, 0x4cfe5022), TOBN(0x597bb530, 0x0e24e1b8)}, + {TOBN(0x3cde86b7, 0xc153ca7f), TOBN(0xa8d30fb3, 0x707d63bd), + TOBN(0xac905f92, 0xbd60d21e), TOBN(0x98e7ffb6, 0x7b9a54ab)}}, + {{TOBN(0xd7147df8, 0xe9726a30), TOBN(0xb5e216ff, 0xafce3533), + TOBN(0xb550b799, 0x2ff1ec40), TOBN(0x6b613b87, 0xa1e953fd)}, + {TOBN(0x87b88dba, 0x792d5610), TOBN(0x2ee1270a, 0xa190fbe1), + TOBN(0x02f4e2dc, 0x2ef581da), TOBN(0x016530e4, 0xeff82a95)}}, + {{TOBN(0xcbb93dfd, 0x8fd6ee89), TOBN(0x16d3d986, 0x46848fff), + TOBN(0x600eff24, 0x1da47adf), TOBN(0x1b9754a0, 0x0ad47a71)}, + {TOBN(0x8f9266df, 0x70c33b98), TOBN(0xaadc87ae, 0xdf34186e), + TOBN(0x0d2ce8e1, 0x4ad24132), TOBN(0x8a47cbfc, 0x19946eba)}}, + {{TOBN(0x47feeb66, 0x62b5f3af), TOBN(0xcefab561, 0x0abb3734), + TOBN(0x449de60e, 0x19f35cb1), TOBN(0x39f8db14, 0x157f0eb9)}, + {TOBN(0xffaecc5b, 0x3c61bfd6), TOBN(0xa5a4d41d, 0x41216703), + TOBN(0x7f8fabed, 0x224e1cc2), TOBN(0x0d5a8186, 0x871ad953)}}, + {{TOBN(0xf10774f7, 0xd22da9a9), TOBN(0x45b8a678, 0xcc8a9b0d), + TOBN(0xd9c2e722, 0xbdc32cff), TOBN(0xbf71b5f5, 0x337202a5)}, + {TOBN(0x95c57f2f, 0x69fc4db9), TOBN(0xb6dad34c, 0x765d01e1), + TOBN(0x7e0bd13f, 0xcb904635), TOBN(0x61751253, 0x763a588c)}}, + {{TOBN(0xd85c2997, 0x81af2c2d), TOBN(0xc0f7d9c4, 0x81b9d7da), + TOBN(0x838a34ae, 0x08533e8d), TOBN(0x15c4cb08, 0x311d8311)}, + {TOBN(0x97f83285, 0x8e121e14), TOBN(0xeea7dc1e, 0x85000a5f), + TOBN(0x0c6059b6, 0x5d256274), TOBN(0xec9beace, 0xb95075c0)}}, + {{TOBN(0x173daad7, 0x1df97828), TOBN(0xbf851cb5, 0xa8937877), + TOBN(0xb083c594, 0x01646f3c), TOBN(0x3bad30cf, 0x50c6d352)}, + {TOBN(0xfeb2b202, 0x496bbcea), TOBN(0x3cf9fd4f, 0x18a1e8ba), + TOBN(0xd26de7ff, 0x1c066029), TOBN(0x39c81e9e, 0x4e9ed4f8)}}, + {{TOBN(0xd8be0cb9, 0x7b390d35), TOBN(0x01df2bbd, 0x964aab27), + TOBN(0x3e8c1a65, 0xc3ef64f8), TOBN(0x567291d1, 0x716ed1dd)}, + {TOBN(0x95499c6c, 0x5f5406d3), TOBN(0x71fdda39, 0x5ba8e23f), + TOBN(0xcfeb320e, 0xd5096ece), TOBN(0xbe7ba92b, 0xca66dd16)}}, + {{TOBN(0x4608d36b, 0xc6fb5a7d), TOBN(0xe3eea15a, 0x6d2dd0e0), + TOBN(0x75b0a3eb, 0x8f97a36a), TOBN(0xf59814cc, 0x1c83de1e)}, + {TOBN(0x56c9c5b0, 0x1c33c23f), TOBN(0xa96c1da4, 0x6faa4136), + TOBN(0x46bf2074, 0xde316551), TOBN(0x3b866e7b, 0x1f756c8f)}}, + {{TOBN(0x727727d8, 0x1495ed6b), TOBN(0xb2394243, 0xb682dce7), + TOBN(0x8ab8454e, 0x758610f3), TOBN(0xc243ce84, 0x857d72a4)}, + {TOBN(0x7b320d71, 0xdbbf370f), TOBN(0xff9afa37, 0x78e0f7ca), + TOBN(0x0119d1e0, 0xea7b523f), TOBN(0xb997f8cb, 0x058c7d42)}}, + {{TOBN(0x285bcd2a, 0x37bbb184), TOBN(0x51dcec49, 0xa45d1fa6), + TOBN(0x6ade3b64, 0xe29634cb), TOBN(0x080c94a7, 0x26b86ef1)}, + {TOBN(0xba583db1, 0x2283fbe3), TOBN(0x902bddc8, 0x5a9315ed), + TOBN(0x07c1ccb3, 0x86964bec), TOBN(0x78f4eacf, 0xb6258301)}}, + {{TOBN(0x4bdf3a49, 0x56f90823), TOBN(0xba0f5080, 0x741d777b), + TOBN(0x091d71c3, 0xf38bf760), TOBN(0x9633d50f, 0x9b625b02)}, + {TOBN(0x03ecb743, 0xb8c9de61), TOBN(0xb4751254, 0x5de74720), + TOBN(0x9f9defc9, 0x74ce1cb2), TOBN(0x774a4f6a, 0x00bd32ef)}}, + {{TOBN(0xaca385f7, 0x73848f22), TOBN(0x53dad716, 0xf3f8558e), + TOBN(0xab7b34b0, 0x93c471f9), TOBN(0xf530e069, 0x19644bc7)}, + {TOBN(0x3d9fb1ff, 0xdd59d31a), TOBN(0x4382e0df, 0x08daa795), + TOBN(0x165c6f4b, 0xd5cc88d7), TOBN(0xeaa392d5, 0x4a18c900)}}, + {{TOBN(0x94203c67, 0x648024ee), TOBN(0x188763f2, 0x8c2fabcd), + TOBN(0xa80f87ac, 0xbbaec835), TOBN(0x632c96e0, 0xf29d8d54)}, + {TOBN(0x29b0a60e, 0x4c00a95e), TOBN(0x2ef17f40, 0xe011e9fa), + TOBN(0xf6c0e1d1, 0x15b77223), TOBN(0xaaec2c62, 0x14b04e32)}}, + {{TOBN(0xd35688d8, 0x3d84e58c), TOBN(0x2af5094c, 0x958571db), + TOBN(0x4fff7e19, 0x760682a6), TOBN(0x4cb27077, 0xe39a407c)}, + {TOBN(0x0f59c547, 0x4ff0e321), TOBN(0x169f34a6, 0x1b34c8ff), + TOBN(0x2bff1096, 0x52bc1ba7), TOBN(0xa25423b7, 0x83583544)}}, + {{TOBN(0x5d55d5d5, 0x0ac8b782), TOBN(0xff6622ec, 0x2db3c892), + TOBN(0x48fce741, 0x6b8bb642), TOBN(0x31d6998c, 0x69d7e3dc)}, + {TOBN(0xdbaf8004, 0xcadcaed0), TOBN(0x801b0142, 0xd81d053c), + TOBN(0x94b189fc, 0x59630ec6), TOBN(0x120e9934, 0xaf762c8e)}}, + {{TOBN(0x53a29aa4, 0xfdc6a404), TOBN(0x19d8e01e, 0xa1909948), + TOBN(0x3cfcabf1, 0xd7e89681), TOBN(0x3321a50d, 0x4e132d37)}, + {TOBN(0xd0496863, 0xe9a86111), TOBN(0x8c0cde61, 0x06a3bc65), + TOBN(0xaf866c49, 0xfc9f8eef), TOBN(0x2066350e, 0xff7f5141)}}, + {{TOBN(0x4f8a4689, 0xe56ddfbd), TOBN(0xea1b0c07, 0xfe32983a), + TOBN(0x2b317462, 0x873cb8cb), TOBN(0x658deddc, 0x2d93229f)}, + {TOBN(0x65efaf4d, 0x0f64ef58), TOBN(0xfe43287d, 0x730cc7a8), + TOBN(0xaebc0c72, 0x3d047d70), TOBN(0x92efa539, 0xd92d26c9)}}, + {{TOBN(0x06e78457, 0x94b56526), TOBN(0x415cb80f, 0x0961002d), + TOBN(0x89e5c565, 0x76dcb10f), TOBN(0x8bbb6982, 0xff9259fe)}, + {TOBN(0x4fe8795b, 0x9abc2668), TOBN(0xb5d4f534, 0x1e678fb1), + TOBN(0x6601f3be, 0x7b7da2b9), TOBN(0x98da59e2, 0xa13d6805)}}, + {{TOBN(0x190d8ea6, 0x01799a52), TOBN(0xa20cec41, 0xb86d2952), + TOBN(0x3062ffb2, 0x7fff2a7c), TOBN(0x741b32e5, 0x79f19d37)}, + {TOBN(0xf80d8181, 0x4eb57d47), TOBN(0x7a2d0ed4, 0x16aef06b), + TOBN(0x09735fb0, 0x1cecb588), TOBN(0x1641caaa, 0xc6061f5b)}}}, + {{{TOBN(0x7f99824f, 0x20151427), TOBN(0x206828b6, 0x92430206), + TOBN(0xaa9097d7, 0xe1112357), TOBN(0xacf9a2f2, 0x09e414ec)}, + {TOBN(0xdbdac9da, 0x27915356), TOBN(0x7e0734b7, 0x001efee3), + TOBN(0x54fab5bb, 0xd2b288e2), TOBN(0x4c630fc4, 0xf62dd09c)}}, + {{TOBN(0x8537107a, 0x1ac2703b), TOBN(0xb49258d8, 0x6bc857b5), + TOBN(0x57df14de, 0xbcdaccd1), TOBN(0x24ab68d7, 0xc4ae8529)}, + {TOBN(0x7ed8b5d4, 0x734e59d0), TOBN(0x5f8740c8, 0xc495cc80), + TOBN(0x84aedd5a, 0x291db9b3), TOBN(0x80b360f8, 0x4fb995be)}}, + {{TOBN(0xae915f5d, 0x5fa067d1), TOBN(0x4134b57f, 0x9668960c), + TOBN(0xbd3656d6, 0xa48edaac), TOBN(0xdac1e3e4, 0xfc1d7436)}, + {TOBN(0x674ff869, 0xd81fbb26), TOBN(0x449ed3ec, 0xb26c33d4), + TOBN(0x85138705, 0xd94203e8), TOBN(0xccde538b, 0xbeeb6f4a)}}, + {{TOBN(0x55d5c68d, 0xa61a76fa), TOBN(0x598b441d, 0xca1554dc), + TOBN(0xd39923b9, 0x773b279c), TOBN(0x33331d3c, 0x36bf9efc)}, + {TOBN(0x2d4c848e, 0x298de399), TOBN(0xcfdb8e77, 0xa1a27f56), + TOBN(0x94c855ea, 0x57b8ab70), TOBN(0xdcdb9dae, 0x6f7879ba)}}, + {{TOBN(0x7bdff8c2, 0x019f2a59), TOBN(0xb3ce5bb3, 0xcb4fbc74), + TOBN(0xea907f68, 0x8a9173dd), TOBN(0x6cd3d0d3, 0x95a75439)}, + {TOBN(0x92ecc4d6, 0xefed021c), TOBN(0x09a9f9b0, 0x6a77339a), + TOBN(0x87ca6b15, 0x7188c64a), TOBN(0x10c29968, 0x44899158)}}, + {{TOBN(0x5859a229, 0xed6e82ef), TOBN(0x16f338e3, 0x65ebaf4e), + TOBN(0x0cd31387, 0x5ead67ae), TOBN(0x1c73d228, 0x54ef0bb4)}, + {TOBN(0x4cb55131, 0x74a5c8c7), TOBN(0x01cd2970, 0x7f69ad6a), + TOBN(0xa04d00dd, 0xe966f87e), TOBN(0xd96fe447, 0x0b7b0321)}}, + {{TOBN(0x342ac06e, 0x88fbd381), TOBN(0x02cd4a84, 0x5c35a493), + TOBN(0xe8fa89de, 0x54f1bbcd), TOBN(0x341d6367, 0x2575ed4c)}, + {TOBN(0xebe357fb, 0xd238202b), TOBN(0x600b4d1a, 0xa984ead9), + TOBN(0xc35c9f44, 0x52436ea0), TOBN(0x96fe0a39, 0xa370751b)}}, + {{TOBN(0x4c4f0736, 0x7f636a38), TOBN(0x9f943fb7, 0x0e76d5cb), + TOBN(0xb03510ba, 0xa8b68b8b), TOBN(0xc246780a, 0x9ed07a1f)}, + {TOBN(0x3c051415, 0x6d549fc2), TOBN(0xc2953f31, 0x607781ca), + TOBN(0x955e2c69, 0xd8d95413), TOBN(0xb300fadc, 0x7bd282e3)}}, + {{TOBN(0x81fe7b50, 0x87e9189f), TOBN(0xdb17375c, 0xf42dda27), + TOBN(0x22f7d896, 0xcf0a5904), TOBN(0xa0e57c5a, 0xebe348e6)}, + {TOBN(0xa61011d3, 0xf40e3c80), TOBN(0xb1189321, 0x8db705c5), + TOBN(0x4ed9309e, 0x50fedec3), TOBN(0xdcf14a10, 0x4d6d5c1d)}}, + {{TOBN(0x056c265b, 0x55691342), TOBN(0xe8e08504, 0x91049dc7), + TOBN(0x131329f5, 0xc9bae20a), TOBN(0x96c8b3e8, 0xd9dccdb4)}, + {TOBN(0x8c5ff838, 0xfb4ee6b4), TOBN(0xfc5a9aeb, 0x41e8ccf0), + TOBN(0x7417b764, 0xfae050c6), TOBN(0x0953c3d7, 0x00452080)}}, + {{TOBN(0x21372682, 0x38dfe7e8), TOBN(0xea417e15, 0x2bb79d4b), + TOBN(0x59641f1c, 0x76e7cf2d), TOBN(0x271e3059, 0xea0bcfcc)}, + {TOBN(0x624c7dfd, 0x7253ecbd), TOBN(0x2f552e25, 0x4fca6186), + TOBN(0xcbf84ecd, 0x4d866e9c), TOBN(0x73967709, 0xf68d4610)}}, + {{TOBN(0xa14b1163, 0xc27901b4), TOBN(0xfd9236e0, 0x899b8bf3), + TOBN(0x42b091ec, 0xcbc6da0a), TOBN(0xbb1dac6f, 0x5ad1d297)}, + {TOBN(0x80e61d53, 0xa91cf76e), TOBN(0x4110a412, 0xd31f1ee7), + TOBN(0x2d87c3ba, 0x13efcf77), TOBN(0x1f374bb4, 0xdf450d76)}}, + {{TOBN(0x5e78e2f2, 0x0d188dab), TOBN(0xe3968ed0, 0xf4b885ef), + TOBN(0x46c0568e, 0x7314570f), TOBN(0x31616338, 0x01170521)}, + {TOBN(0x18e1e7e2, 0x4f0c8afe), TOBN(0x4caa75ff, 0xdeea78da), + TOBN(0x82db67f2, 0x7c5d8a51), TOBN(0x36a44d86, 0x6f505370)}}, + {{TOBN(0xd72c5bda, 0x0333974f), TOBN(0x5db516ae, 0x27a70146), + TOBN(0x34705281, 0x210ef921), TOBN(0xbff17a8f, 0x0c9c38e5)}, + {TOBN(0x78f4814e, 0x12476da1), TOBN(0xc1e16613, 0x33c16980), + TOBN(0x9e5b386f, 0x424d4bca), TOBN(0x4c274e87, 0xc85740de)}}, + {{TOBN(0xb6a9b88d, 0x6c2f5226), TOBN(0x14d1b944, 0x550d7ca8), + TOBN(0x580c85fc, 0x1fc41709), TOBN(0xc1da368b, 0x54c6d519)}, + {TOBN(0x2b0785ce, 0xd5113cf7), TOBN(0x0670f633, 0x5a34708f), + TOBN(0x46e23767, 0x15cc3f88), TOBN(0x1b480cfa, 0x50c72c8f)}}, + {{TOBN(0x20288602, 0x4147519a), TOBN(0xd0981eac, 0x26b372f0), + TOBN(0xa9d4a7ca, 0xa785ebc8), TOBN(0xd953c50d, 0xdbdf58e9)}, + {TOBN(0x9d6361cc, 0xfd590f8f), TOBN(0x72e9626b, 0x44e6c917), + TOBN(0x7fd96110, 0x22eb64cf), TOBN(0x863ebb7e, 0x9eb288f3)}}, + {{TOBN(0x6e6ab761, 0x6aca8ee7), TOBN(0x97d10b39, 0xd7b40358), + TOBN(0x1687d377, 0x1e5feb0d), TOBN(0xc83e50e4, 0x8265a27a)}, + {TOBN(0x8f75a9fe, 0xc954b313), TOBN(0xcc2e8f47, 0x310d1f61), + TOBN(0xf5ba81c5, 0x6557d0e0), TOBN(0x25f9680c, 0x3eaf6207)}}, + {{TOBN(0xf95c6609, 0x4354080b), TOBN(0x5225bfa5, 0x7bf2fe1c), + TOBN(0xc5c004e2, 0x5c7d98fa), TOBN(0x3561bf1c, 0x019aaf60)}, + {TOBN(0x5e6f9f17, 0xba151474), TOBN(0xdec2f934, 0xb04f6eca), + TOBN(0x64e368a1, 0x269acb1e), TOBN(0x1332d9e4, 0x0cdda493)}}, + {{TOBN(0x60d6cf69, 0xdf23de05), TOBN(0x66d17da2, 0x009339a0), + TOBN(0x9fcac985, 0x0a693923), TOBN(0xbcf057fc, 0xed7c6a6d)}, + {TOBN(0xc3c5c8c5, 0xf0b5662c), TOBN(0x25318dd8, 0xdcba4f24), + TOBN(0x60e8cb75, 0x082b69ff), TOBN(0x7c23b3ee, 0x1e728c01)}}, + {{TOBN(0x15e10a0a, 0x097e4403), TOBN(0xcb3d0a86, 0x19854665), + TOBN(0x88d8e211, 0xd67d4826), TOBN(0xb39af66e, 0x0b9d2839)}, + {TOBN(0xa5f94588, 0xbd475ca8), TOBN(0xe06b7966, 0xc077b80b), + TOBN(0xfedb1485, 0xda27c26c), TOBN(0xd290d33a, 0xfe0fd5e0)}}, + {{TOBN(0xa40bcc47, 0xf34fb0fa), TOBN(0xb4760cc8, 0x1fb1ab09), + TOBN(0x8fca0993, 0xa273bfe3), TOBN(0x13e4fe07, 0xf70b213c)}, + {TOBN(0x3bcdb992, 0xfdb05163), TOBN(0x8c484b11, 0x0c2b19b6), + TOBN(0x1acb815f, 0xaaf2e3e2), TOBN(0xc6905935, 0xb89ff1b4)}}, + {{TOBN(0xb2ad6f9d, 0x586e74e1), TOBN(0x488883ad, 0x67b80484), + TOBN(0x758aa2c7, 0x369c3ddb), TOBN(0x8ab74e69, 0x9f9afd31)}, + {TOBN(0x10fc2d28, 0x5e21beb1), TOBN(0x3484518a, 0x318c42f9), + TOBN(0x377427dc, 0x53cf40c3), TOBN(0x9de0781a, 0x391bc1d9)}}, + {{TOBN(0x8faee858, 0x693807e1), TOBN(0xa3865327, 0x4e81ccc7), + TOBN(0x02c30ff2, 0x6f835b84), TOBN(0xb604437b, 0x0d3d38d4)}, + {TOBN(0xb3fc8a98, 0x5ca1823d), TOBN(0xb82f7ec9, 0x03be0324), + TOBN(0xee36d761, 0xcf684a33), TOBN(0x5a01df0e, 0x9f29bf7d)}}, + {{TOBN(0x686202f3, 0x1306583d), TOBN(0x05b10da0, 0x437c622e), + TOBN(0xbf9aaa0f, 0x076a7bc8), TOBN(0x25e94efb, 0x8f8f4e43)}, + {TOBN(0x8a35c9b7, 0xfa3dc26d), TOBN(0xe0e5fb93, 0x96ff03c5), + TOBN(0xa77e3843, 0xebc394ce), TOBN(0xcede6595, 0x8361de60)}}, + {{TOBN(0xd27c22f6, 0xa1993545), TOBN(0xab01cc36, 0x24d671ba), + TOBN(0x63fa2877, 0xa169c28e), TOBN(0x925ef904, 0x2eb08376)}, + {TOBN(0x3b2fa3cf, 0x53aa0b32), TOBN(0xb27beb5b, 0x71c49d7a), + TOBN(0xb60e1834, 0xd105e27f), TOBN(0xd6089788, 0x4f68570d)}}, + {{TOBN(0x23094ce0, 0xd6fbc2ac), TOBN(0x738037a1, 0x815ff551), + TOBN(0xda73b1bb, 0x6bef119c), TOBN(0xdcf6c430, 0xeef506ba)}, + {TOBN(0x00e4fe7b, 0xe3ef104a), TOBN(0xebdd9a2c, 0x0a065628), + TOBN(0x853a81c3, 0x8792043e), TOBN(0x22ad6ece, 0xb3b59108)}}, + {{TOBN(0x9fb813c0, 0x39cd297d), TOBN(0x8ec7e16e, 0x05bda5d9), + TOBN(0x2834797c, 0x0d104b96), TOBN(0xcc11a2e7, 0x7c511510)}, + {TOBN(0x96ca5a53, 0x96ee6380), TOBN(0x054c8655, 0xcea38742), + TOBN(0xb5946852, 0xd54dfa7d), TOBN(0x97c422e7, 0x1f4ab207)}}, + {{TOBN(0xbf907509, 0x0c22b540), TOBN(0x2cde42aa, 0xb7c267d4), + TOBN(0xba18f9ed, 0x5ab0d693), TOBN(0x3ba62aa6, 0x6e4660d9)}, + {TOBN(0xb24bf97b, 0xab9ea96a), TOBN(0x5d039642, 0xe3b60e32), + TOBN(0x4e6a4506, 0x7c4d9bd5), TOBN(0x666c5b9e, 0x7ed4a6a4)}}, + {{TOBN(0xfa3fdcd9, 0x8edbd7cc), TOBN(0x4660bb87, 0xc6ccd753), + TOBN(0x9ae90820, 0x21e6b64f), TOBN(0x8a56a713, 0xb36bfb3f)}, + {TOBN(0xabfce096, 0x5726d47f), TOBN(0x9eed01b2, 0x0b1a9a7f), + TOBN(0x30e9cad4, 0x4eb74a37), TOBN(0x7b2524cc, 0x53e9666d)}}, + {{TOBN(0x6a29683b, 0x8f4b002f), TOBN(0xc2200d7a, 0x41f4fc20), + TOBN(0xcf3af47a, 0x3a338acc), TOBN(0x6539a4fb, 0xe7128975)}, + {TOBN(0xcec31c14, 0xc33c7fcf), TOBN(0x7eb6799b, 0xc7be322b), + TOBN(0x119ef4e9, 0x6646f623), TOBN(0x7b7a26a5, 0x54d7299b)}}, + {{TOBN(0xcb37f08d, 0x403f46f2), TOBN(0x94b8fc43, 0x1a0ec0c7), + TOBN(0xbb8514e3, 0xc332142f), TOBN(0xf3ed2c33, 0xe80d2a7a)}, + {TOBN(0x8d2080af, 0xb639126c), TOBN(0xf7b6be60, 0xe3553ade), + TOBN(0x3950aa9f, 0x1c7e2b09), TOBN(0x847ff958, 0x6410f02b)}}, + {{TOBN(0x877b7cf5, 0x678a31b0), TOBN(0xd50301ae, 0x3998b620), + TOBN(0x734257c5, 0xc00fb396), TOBN(0xf9fb18a0, 0x04e672a6)}, + {TOBN(0xff8bd8eb, 0xe8758851), TOBN(0x1e64e4c6, 0x5d99ba44), + TOBN(0x4b8eaedf, 0x7dfd93b7), TOBN(0xba2f2a98, 0x04e76b8c)}}, + {{TOBN(0x7d790cba, 0xe8053433), TOBN(0xc8e725a0, 0x3d2c9585), + TOBN(0x58c5c476, 0xcdd8f5ed), TOBN(0xd106b952, 0xefa9fe1d)}, + {TOBN(0x3c5c775b, 0x0eff13a9), TOBN(0x242442ba, 0xe057b930), + TOBN(0xe9f458d4, 0xc9b70cbd), TOBN(0x69b71448, 0xa3cdb89a)}}, + {{TOBN(0x41ee46f6, 0x0e2ed742), TOBN(0x573f1045, 0x40067493), + TOBN(0xb1e154ff, 0x9d54c304), TOBN(0x2ad0436a, 0x8d3a7502)}, + {TOBN(0xee4aaa2d, 0x431a8121), TOBN(0xcd38b3ab, 0x886f11ed), + TOBN(0x57d49ea6, 0x034a0eb7), TOBN(0xd2b773bd, 0xf7e85e58)}}, + {{TOBN(0x4a559ac4, 0x9b5c1f14), TOBN(0xc444be1a, 0x3e54df2b), + TOBN(0x13aad704, 0xeda41891), TOBN(0xcd927bec, 0x5eb5c788)}, + {TOBN(0xeb3c8516, 0xe48c8a34), TOBN(0x1b7ac812, 0x4b546669), + TOBN(0x1815f896, 0x594df8ec), TOBN(0x87c6a79c, 0x79227865)}}, + {{TOBN(0xae02a2f0, 0x9b56ddbd), TOBN(0x1339b5ac, 0x8a2f1cf3), + TOBN(0xf2b569c7, 0x839dff0d), TOBN(0xb0b9e864, 0xfee9a43d)}, + {TOBN(0x4ff8ca41, 0x77bb064e), TOBN(0x145a2812, 0xfd249f63), + TOBN(0x3ab7beac, 0xf86f689a), TOBN(0x9bafec27, 0x01d35f5e)}}, + {{TOBN(0x28054c65, 0x4265aa91), TOBN(0xa4b18304, 0x035efe42), + TOBN(0x6887b0e6, 0x9639dec7), TOBN(0xf4b8f6ad, 0x3d52aea5)}, + {TOBN(0xfb9293cc, 0x971a8a13), TOBN(0x3f159e5d, 0x4c934d07), + TOBN(0x2c50e9b1, 0x09acbc29), TOBN(0x08eb65e6, 0x7154d129)}}, + {{TOBN(0x4feff589, 0x30b75c3e), TOBN(0x0bb82fe2, 0x94491c93), + TOBN(0xd8ac377a, 0x89af62bb), TOBN(0xd7b51490, 0x9685e49f)}, + {TOBN(0xabca9a7b, 0x04497f19), TOBN(0x1b35ed0a, 0x1a7ad13f), + TOBN(0x6b601e21, 0x3ec86ed6), TOBN(0xda91fcb9, 0xce0c76f1)}}, + {{TOBN(0x9e28507b, 0xd7ab27e1), TOBN(0x7c19a555, 0x63945b7b), + TOBN(0x6b43f0a1, 0xaafc9827), TOBN(0x443b4fbd, 0x3aa55b91)}, + {TOBN(0x962b2e65, 0x6962c88f), TOBN(0x139da8d4, 0xce0db0ca), + TOBN(0xb93f05dd, 0x1b8d6c4f), TOBN(0x779cdff7, 0x180b9824)}}, + {{TOBN(0xbba23fdd, 0xae57c7b7), TOBN(0x345342f2, 0x1b932522), + TOBN(0xfd9c80fe, 0x556d4aa3), TOBN(0xa03907ba, 0x6525bb61)}, + {TOBN(0x38b010e1, 0xff218933), TOBN(0xc066b654, 0xaa52117b), + TOBN(0x8e141920, 0x94f2e6ea), TOBN(0x66a27dca, 0x0d32f2b2)}}, + {{TOBN(0x69c7f993, 0x048b3717), TOBN(0xbf5a989a, 0xb178ae1c), + TOBN(0x49fa9058, 0x564f1d6b), TOBN(0x27ec6e15, 0xd31fde4e)}, + {TOBN(0x4cce0373, 0x7276e7fc), TOBN(0x64086d79, 0x89d6bf02), + TOBN(0x5a72f046, 0x4ccdd979), TOBN(0x909c3566, 0x47775631)}}, + {{TOBN(0x1c07bc6b, 0x75dd7125), TOBN(0xb4c6bc97, 0x87a0428d), + TOBN(0x507ece52, 0xfdeb6b9d), TOBN(0xfca56512, 0xb2c95432)}, + {TOBN(0x15d97181, 0xd0e8bd06), TOBN(0x384dd317, 0xc6bb46ea), + TOBN(0x5441ea20, 0x3952b624), TOBN(0xbcf70dee, 0x4e7dc2fb)}}, + {{TOBN(0x372b016e, 0x6628e8c3), TOBN(0x07a0d667, 0xb60a7522), + TOBN(0xcf05751b, 0x0a344ee2), TOBN(0x0ec09a48, 0x118bdeec)}, + {TOBN(0x6e4b3d4e, 0xd83dce46), TOBN(0x43a6316d, 0x99d2fc6e), + TOBN(0xa99d8989, 0x56cf044c), TOBN(0x7c7f4454, 0xae3e5fb7)}}, + {{TOBN(0xb2e6b121, 0xfbabbe92), TOBN(0x281850fb, 0xe1330076), + TOBN(0x093581ec, 0x97890015), TOBN(0x69b1dded, 0x75ff77f5)}, + {TOBN(0x7cf0b18f, 0xab105105), TOBN(0x953ced31, 0xa89ccfef), + TOBN(0x3151f85f, 0xeb914009), TOBN(0x3c9f1b87, 0x88ed48ad)}}, + {{TOBN(0xc9aba1a1, 0x4a7eadcb), TOBN(0x928e7501, 0x522e71cf), + TOBN(0xeaede727, 0x3a2e4f83), TOBN(0x467e10d1, 0x1ce3bbd3)}, + {TOBN(0xf3442ac3, 0xb955dcf0), TOBN(0xba96307d, 0xd3d5e527), + TOBN(0xf763a10e, 0xfd77f474), TOBN(0x5d744bd0, 0x6a6e1ff0)}}, + {{TOBN(0xd287282a, 0xa777899e), TOBN(0xe20eda8f, 0xd03f3cde), + TOBN(0x6a7e75bb, 0x50b07d31), TOBN(0x0b7e2a94, 0x6f379de4)}, + {TOBN(0x31cb64ad, 0x19f593cf), TOBN(0x7b1a9e4f, 0x1e76ef1d), + TOBN(0xe18c9c9d, 0xb62d609c), TOBN(0x439bad6d, 0xe779a650)}}, + {{TOBN(0x219d9066, 0xe032f144), TOBN(0x1db632b8, 0xe8b2ec6a), + TOBN(0xff0d0fd4, 0xfda12f78), TOBN(0x56fb4c2d, 0x2a25d265)}, + {TOBN(0x5f4e2ee1, 0x255a03f1), TOBN(0x61cd6af2, 0xe96af176), + TOBN(0xe0317ba8, 0xd068bc97), TOBN(0x927d6bab, 0x264b988e)}}, + {{TOBN(0xa18f07e0, 0xe90fb21e), TOBN(0x00fd2b80, 0xbba7fca1), + TOBN(0x20387f27, 0x95cd67b5), TOBN(0x5b89a4e7, 0xd39707f7)}, + {TOBN(0x8f83ad3f, 0x894407ce), TOBN(0xa0025b94, 0x6c226132), + TOBN(0xc79563c7, 0xf906c13b), TOBN(0x5f548f31, 0x4e7bb025)}}, + {{TOBN(0x2b4c6b8f, 0xeac6d113), TOBN(0xa67e3f9c, 0x0e813c76), + TOBN(0x3982717c, 0x3fe1f4b9), TOBN(0x58865819, 0x26d8050e)}, + {TOBN(0x99f3640c, 0xf7f06f20), TOBN(0xdc610216, 0x2a66ebc2), + TOBN(0x52f2c175, 0x767a1e08), TOBN(0x05660e1a, 0x5999871b)}}, + {{TOBN(0x6b0f1762, 0x6d3c4693), TOBN(0xf0e7d627, 0x37ed7bea), + TOBN(0xc51758c7, 0xb75b226d), TOBN(0x40a88628, 0x1f91613b)}, + {TOBN(0x889dbaa7, 0xbbb38ce0), TOBN(0xe0404b65, 0xbddcad81), + TOBN(0xfebccd3a, 0x8bc9671f), TOBN(0xfbf9a357, 0xee1f5375)}}, + {{TOBN(0x5dc169b0, 0x28f33398), TOBN(0xb07ec11d, 0x72e90f65), + TOBN(0xae7f3b4a, 0xfaab1eb1), TOBN(0xd970195e, 0x5f17538a)}, + {TOBN(0x52b05cbe, 0x0181e640), TOBN(0xf5debd62, 0x2643313d), + TOBN(0x76148154, 0x5df31f82), TOBN(0x23e03b33, 0x3a9e13c5)}}, + {{TOBN(0xff758949, 0x4fde0c1f), TOBN(0xbf8a1abe, 0xe5b6ec20), + TOBN(0x702278fb, 0x87e1db6c), TOBN(0xc447ad7a, 0x35ed658f)}, + {TOBN(0x48d4aa38, 0x03d0ccf2), TOBN(0x80acb338, 0x819a7c03), + TOBN(0x9bc7c89e, 0x6e17cecc), TOBN(0x46736b8b, 0x03be1d82)}}, + {{TOBN(0xd65d7b60, 0xc0432f96), TOBN(0xddebe7a3, 0xdeb5442f), + TOBN(0x79a25307, 0x7dff69a2), TOBN(0x37a56d94, 0x02cf3122)}, + {TOBN(0x8bab8aed, 0xf2350d0a), TOBN(0x13c3f276, 0x037b0d9a), + TOBN(0xc664957c, 0x44c65cae), TOBN(0x88b44089, 0xc2e71a88)}}, + {{TOBN(0xdb88e5a3, 0x5cb02664), TOBN(0x5d4c0bf1, 0x8686c72e), + TOBN(0xea3d9b62, 0xa682d53e), TOBN(0x9b605ef4, 0x0b2ad431)}, + {TOBN(0x71bac202, 0xc69645d0), TOBN(0xa115f03a, 0x6a1b66e7), + TOBN(0xfe2c563a, 0x158f4dc4), TOBN(0xf715b3a0, 0x4d12a78c)}}, + {{TOBN(0x8f7f0a48, 0xd413213a), TOBN(0x2035806d, 0xc04becdb), + TOBN(0xecd34a99, 0x5d8587f5), TOBN(0x4d8c3079, 0x9f6d3a71)}, + {TOBN(0x1b2a2a67, 0x8d95a8f6), TOBN(0xc58c9d7d, 0xf2110d0d), + TOBN(0xdeee81d5, 0xcf8fba3f), TOBN(0xa42be3c0, 0x0c7cdf68)}}, + {{TOBN(0x2126f742, 0xd43b5eaa), TOBN(0x054a0766, 0xdfa59b85), + TOBN(0x9d0d5e36, 0x126bfd45), TOBN(0xa1f8fbd7, 0x384f8a8f)}, + {TOBN(0x317680f5, 0xd563fccc), TOBN(0x48ca5055, 0xf280a928), + TOBN(0xe00b81b2, 0x27b578cf), TOBN(0x10aad918, 0x2994a514)}}, + {{TOBN(0xd9e07b62, 0xb7bdc953), TOBN(0x9f0f6ff2, 0x5bc086dd), + TOBN(0x09d1ccff, 0x655eee77), TOBN(0x45475f79, 0x5bef7df1)}, + {TOBN(0x3faa28fa, 0x86f702cc), TOBN(0x92e60905, 0x0f021f07), + TOBN(0xe9e62968, 0x7f8fa8c6), TOBN(0xbd71419a, 0xf036ea2c)}}, + {{TOBN(0x171ee1cc, 0x6028da9a), TOBN(0x5352fe1a, 0xc251f573), + TOBN(0xf8ff236e, 0x3fa997f4), TOBN(0xd831b6c9, 0xa5749d5f)}, + {TOBN(0x7c872e1d, 0xe350e2c2), TOBN(0xc56240d9, 0x1e0ce403), + TOBN(0xf9deb077, 0x6974f5cb), TOBN(0x7d50ba87, 0x961c3728)}}, + {{TOBN(0xd6f89426, 0x5a3a2518), TOBN(0xcf817799, 0xc6303d43), + TOBN(0x510a0471, 0x619e5696), TOBN(0xab049ff6, 0x3a5e307b)}, + {TOBN(0xe4cdf9b0, 0xfeb13ec7), TOBN(0xd5e97117, 0x9d8ff90c), + TOBN(0xf6f64d06, 0x9afa96af), TOBN(0x00d0bf5e, 0x9d2012a2)}}, + {{TOBN(0xe63f301f, 0x358bcdc0), TOBN(0x07689e99, 0x0a9d47f8), + TOBN(0x1f689e2f, 0x4f43d43a), TOBN(0x4d542a16, 0x90920904)}, + {TOBN(0xaea293d5, 0x9ca0a707), TOBN(0xd061fe45, 0x8ac68065), + TOBN(0x1033bf1b, 0x0090008c), TOBN(0x29749558, 0xc08a6db6)}}, + {{TOBN(0x74b5fc59, 0xc1d5d034), TOBN(0xf712e9f6, 0x67e215e0), + TOBN(0xfd520cbd, 0x860200e6), TOBN(0x0229acb4, 0x3ea22588)}, + {TOBN(0x9cd1e14c, 0xfff0c82e), TOBN(0x87684b62, 0x59c69e73), + TOBN(0xda85e61c, 0x96ccb989), TOBN(0x2d5dbb02, 0xa3d06493)}}, + {{TOBN(0xf22ad33a, 0xe86b173c), TOBN(0xe8e41ea5, 0xa79ff0e3), + TOBN(0x01d2d725, 0xdd0d0c10), TOBN(0x31f39088, 0x032d28f9)}, + {TOBN(0x7b3f71e1, 0x7829839e), TOBN(0x0cf691b4, 0x4502ae58), + TOBN(0xef658dbd, 0xbefc6115), TOBN(0xa5cd6ee5, 0xb3ab5314)}}, + {{TOBN(0x206c8d7b, 0x5f1d2347), TOBN(0x794645ba, 0x4cc2253a), + TOBN(0xd517d8ff, 0x58389e08), TOBN(0x4fa20dee, 0x9f847288)}, + {TOBN(0xeba072d8, 0xd797770a), TOBN(0x7360c91d, 0xbf429e26), + TOBN(0x7200a3b3, 0x80af8279), TOBN(0x6a1c9150, 0x82dadce3)}}, + {{TOBN(0x0ee6d3a7, 0xc35d8794), TOBN(0x042e6558, 0x0356bae5), + TOBN(0x9f59698d, 0x643322fd), TOBN(0x9379ae15, 0x50a61967)}, + {TOBN(0x64b9ae62, 0xfcc9981e), TOBN(0xaed3d631, 0x6d2934c6), + TOBN(0x2454b302, 0x5e4e65eb), TOBN(0xab09f647, 0xf9950428)}}}, + {{{TOBN(0xb2083a12, 0x22248acc), TOBN(0x1f6ec0ef, 0x3264e366), + TOBN(0x5659b704, 0x5afdee28), TOBN(0x7a823a40, 0xe6430bb5)}, + {TOBN(0x24592a04, 0xe1900a79), TOBN(0xcde09d4a, 0xc9ee6576), + TOBN(0x52b6463f, 0x4b5ea54a), TOBN(0x1efe9ed3, 0xd3ca65a7)}}, + {{TOBN(0xe27a6dbe, 0x305406dd), TOBN(0x8eb7dc7f, 0xdd5d1957), + TOBN(0xf54a6876, 0x387d4d8f), TOBN(0x9c479409, 0xc7762de4)}, + {TOBN(0xbe4d5b5d, 0x99b30778), TOBN(0x25380c56, 0x6e793682), + TOBN(0x602d37f3, 0xdac740e3), TOBN(0x140deabe, 0x1566e4ae)}}, + {{TOBN(0x4481d067, 0xafd32acf), TOBN(0xd8f0fcca, 0xe1f71ccf), + TOBN(0xd208dd0c, 0xb596f2da), TOBN(0xd049d730, 0x9aad93f9)}, + {TOBN(0xc79f263d, 0x42ab580e), TOBN(0x09411bb1, 0x23f707b4), + TOBN(0x8cfde1ff, 0x835e0eda), TOBN(0x72707490, 0x90f03402)}}, + {{TOBN(0xeaee6126, 0xc49a861e), TOBN(0x024f3b65, 0xe14f0d06), + TOBN(0x51a3f1e8, 0xc69bfc17), TOBN(0xc3c3a8e9, 0xa7686381)}, + {TOBN(0x3400752c, 0xb103d4c8), TOBN(0x02bc4613, 0x9218b36b), + TOBN(0xc67f75eb, 0x7651504a), TOBN(0xd6848b56, 0xd02aebfa)}}, + {{TOBN(0xbd9802e6, 0xc30fa92b), TOBN(0x5a70d96d, 0x9a552784), + TOBN(0x9085c4ea, 0x3f83169b), TOBN(0xfa9423bb, 0x06908228)}, + {TOBN(0x2ffebe12, 0xfe97a5b9), TOBN(0x85da6049, 0x71b99118), + TOBN(0x9cbc2f7f, 0x63178846), TOBN(0xfd96bc70, 0x9153218e)}}, + {{TOBN(0x958381db, 0x1782269b), TOBN(0xae34bf79, 0x2597e550), + TOBN(0xbb5c6064, 0x5f385153), TOBN(0x6f0e96af, 0xe3088048)}, + {TOBN(0xbf6a0215, 0x77884456), TOBN(0xb3b5688c, 0x69310ea7), + TOBN(0x17c94295, 0x04fad2de), TOBN(0xe020f0e5, 0x17896d4d)}}, + {{TOBN(0x730ba0ab, 0x0976505f), TOBN(0x567f6813, 0x095e2ec5), + TOBN(0x47062010, 0x6331ab71), TOBN(0x72cfa977, 0x41d22b9f)}, + {TOBN(0x33e55ead, 0x8a2373da), TOBN(0xa8d0d5f4, 0x7ba45a68), + TOBN(0xba1d8f9c, 0x03029d15), TOBN(0x8f34f1cc, 0xfc55b9f3)}}, + {{TOBN(0xcca4428d, 0xbbe5a1a9), TOBN(0x8187fd5f, 0x3126bd67), + TOBN(0x0036973a, 0x48105826), TOBN(0xa39b6663, 0xb8bd61a0)}, + {TOBN(0x6d42deef, 0x2d65a808), TOBN(0x4969044f, 0x94636b19), + TOBN(0xf611ee47, 0xdd5d564c), TOBN(0x7b2f3a49, 0xd2873077)}}, + {{TOBN(0x94157d45, 0x300eb294), TOBN(0x2b2a656e, 0x169c1494), + TOBN(0xc000dd76, 0xd3a47aa9), TOBN(0xa2864e4f, 0xa6243ea4)}, + {TOBN(0x82716c47, 0xdb89842e), TOBN(0x12dfd7d7, 0x61479fb7), + TOBN(0x3b9a2c56, 0xe0b2f6dc), TOBN(0x46be862a, 0xd7f85d67)}}, + {{TOBN(0x03b0d8dd, 0x0f82b214), TOBN(0x460c34f9, 0xf103cbc6), + TOBN(0xf32e5c03, 0x18d79e19), TOBN(0x8b8888ba, 0xa84117f8)}, + {TOBN(0x8f3c37dc, 0xc0722677), TOBN(0x10d21be9, 0x1c1c0f27), + TOBN(0xd47c8468, 0xe0f7a0c6), TOBN(0x9bf02213, 0xadecc0e0)}}, + {{TOBN(0x0baa7d12, 0x42b48b99), TOBN(0x1bcb665d, 0x48424096), + TOBN(0x8b847cd6, 0xebfb5cfb), TOBN(0x87c2ae56, 0x9ad4d10d)}, + {TOBN(0xf1cbb122, 0x0de36726), TOBN(0xe7043c68, 0x3fdfbd21), + TOBN(0x4bd0826a, 0x4e79d460), TOBN(0x11f5e598, 0x4bd1a2cb)}}, + {{TOBN(0x97554160, 0xb7fe7b6e), TOBN(0x7d16189a, 0x400a3fb2), + TOBN(0xd73e9bea, 0xe328ca1e), TOBN(0x0dd04b97, 0xe793d8cc)}, + {TOBN(0xa9c83c9b, 0x506db8cc), TOBN(0x5cd47aae, 0xcf38814c), + TOBN(0x26fc430d, 0xb64b45e6), TOBN(0x079b5499, 0xd818ea84)}}, + {{TOBN(0xebb01102, 0xc1c24a3b), TOBN(0xca24e568, 0x1c161c1a), + TOBN(0x103eea69, 0x36f00a4a), TOBN(0x9ad76ee8, 0x76176c7b)}, + {TOBN(0x97451fc2, 0x538e0ff7), TOBN(0x94f89809, 0x6604b3b0), + TOBN(0x6311436e, 0x3249cfd7), TOBN(0x27b4a7bd, 0x41224f69)}}, + {{TOBN(0x03b5d21a, 0xe0ac2941), TOBN(0x279b0254, 0xc2d31937), + TOBN(0x3307c052, 0xcac992d0), TOBN(0x6aa7cb92, 0xefa8b1f3)}, + {TOBN(0x5a182580, 0x0d37c7a5), TOBN(0x13380c37, 0x342d5422), + TOBN(0x92ac2d66, 0xd5d2ef92), TOBN(0x035a70c9, 0x030c63c6)}}, + {{TOBN(0xc16025dd, 0x4ce4f152), TOBN(0x1f419a71, 0xf9df7c06), + TOBN(0x6d5b2214, 0x91e4bb14), TOBN(0xfc43c6cc, 0x839fb4ce)}, + {TOBN(0x49f06591, 0x925d6b2d), TOBN(0x4b37d9d3, 0x62186598), + TOBN(0x8c54a971, 0xd01b1629), TOBN(0xe1a9c29f, 0x51d50e05)}}, + {{TOBN(0x5109b785, 0x71ba1861), TOBN(0x48b22d5c, 0xd0c8f93d), + TOBN(0xe8fa84a7, 0x8633bb93), TOBN(0x53fba6ba, 0x5aebbd08)}, + {TOBN(0x7ff27df3, 0xe5eea7d8), TOBN(0x521c8796, 0x68ca7158), + TOBN(0xb9d5133b, 0xce6f1a05), TOBN(0x2d50cd53, 0xfd0ebee4)}}, + {{TOBN(0xc82115d6, 0xc5a3ef16), TOBN(0x993eff9d, 0xba079221), + TOBN(0xe4da2c5e, 0x4b5da81c), TOBN(0x9a89dbdb, 0x8033fd85)}, + {TOBN(0x60819ebf, 0x2b892891), TOBN(0x53902b21, 0x5d14a4d5), + TOBN(0x6ac35051, 0xd7fda421), TOBN(0xcc6ab885, 0x61c83284)}}, + {{TOBN(0x14eba133, 0xf74cff17), TOBN(0x240aaa03, 0xecb813f2), + TOBN(0xcfbb6540, 0x6f665bee), TOBN(0x084b1fe4, 0xa425ad73)}, + {TOBN(0x009d5d16, 0xd081f6a6), TOBN(0x35304fe8, 0xeef82c90), + TOBN(0xf20346d5, 0xaa9eaa22), TOBN(0x0ada9f07, 0xac1c91e3)}}, + {{TOBN(0xa6e21678, 0x968a6144), TOBN(0x54c1f77c, 0x07b31a1e), + TOBN(0xd6bb787e, 0x5781fbe1), TOBN(0x61bd2ee0, 0xe31f1c4a)}, + {TOBN(0xf25aa1e9, 0x781105fc), TOBN(0x9cf2971f, 0x7b2f8e80), + TOBN(0x26d15412, 0xcdff919b), TOBN(0x01db4ebe, 0x34bc896e)}}, + {{TOBN(0x7d9b3e23, 0xb40df1cf), TOBN(0x59337373, 0x94e971b4), + TOBN(0xbf57bd14, 0x669cf921), TOBN(0x865daedf, 0x0c1a1064)}, + {TOBN(0x3eb70bd3, 0x83279125), TOBN(0xbc3d5b9f, 0x34ecdaab), + TOBN(0x91e3ed7e, 0x5f755caf), TOBN(0x49699f54, 0xd41e6f02)}}, + {{TOBN(0x185770e1, 0xd4a7a15b), TOBN(0x08f3587a, 0xeaac87e7), + TOBN(0x352018db, 0x473133ea), TOBN(0x674ce719, 0x04fd30fc)}, + {TOBN(0x7b8d9835, 0x088b3e0e), TOBN(0x7a0356a9, 0x5d0d47a1), + TOBN(0x9d9e7659, 0x6474a3c4), TOBN(0x61ea48a7, 0xff66966c)}}, + {{TOBN(0x30417758, 0x0f3e4834), TOBN(0xfdbb21c2, 0x17a9afcb), + TOBN(0x756fa17f, 0x2f9a67b3), TOBN(0x2a6b2421, 0xa245c1a8)}, + {TOBN(0x64be2794, 0x4af02291), TOBN(0xade465c6, 0x2a5804fe), + TOBN(0x8dffbd39, 0xa6f08fd7), TOBN(0xc4efa84c, 0xaa14403b)}}, + {{TOBN(0xa1b91b2a, 0x442b0f5c), TOBN(0xb748e317, 0xcf997736), + TOBN(0x8d1b62bf, 0xcee90e16), TOBN(0x907ae271, 0x0b2078c0)}, + {TOBN(0xdf31534b, 0x0c9bcddd), TOBN(0x043fb054, 0x39adce83), + TOBN(0x99031043, 0xd826846a), TOBN(0x61a9c0d6, 0xb144f393)}}, + {{TOBN(0xdab48046, 0x47718427), TOBN(0xdf17ff9b, 0x6e830f8b), + TOBN(0x408d7ee8, 0xe49a1347), TOBN(0x6ac71e23, 0x91c1d4ae)}, + {TOBN(0xc8cbb9fd, 0x1defd73c), TOBN(0x19840657, 0xbbbbfec5), + TOBN(0x39db1cb5, 0x9e7ef8ea), TOBN(0x78aa8296, 0x64105f30)}}, + {{TOBN(0xa3d9b7f0, 0xa3738c29), TOBN(0x0a2f235a, 0xbc3250a3), + TOBN(0x55e506f6, 0x445e4caf), TOBN(0x0974f73d, 0x33475f7a)}, + {TOBN(0xd37dbba3, 0x5ba2f5a8), TOBN(0x542c6e63, 0x6af40066), + TOBN(0x26d99b53, 0xc5d73e2c), TOBN(0x06060d7d, 0x6c3ca33e)}}, + {{TOBN(0xcdbef1c2, 0x065fef4a), TOBN(0x77e60f7d, 0xfd5b92e3), + TOBN(0xd7c549f0, 0x26708350), TOBN(0x201b3ad0, 0x34f121bf)}, + {TOBN(0x5fcac2a1, 0x0334fc14), TOBN(0x8a9a9e09, 0x344552f6), + TOBN(0x7dd8a1d3, 0x97653082), TOBN(0x5fc0738f, 0x79d4f289)}}, + {{TOBN(0x787d244d, 0x17d2d8c3), TOBN(0xeffc6345, 0x70830684), + TOBN(0x5ddb96dd, 0xe4f73ae5), TOBN(0x8efb14b1, 0x172549a5)}, + {TOBN(0x6eb73eee, 0x2245ae7a), TOBN(0xbca4061e, 0xea11f13e), + TOBN(0xb577421d, 0x30b01f5d), TOBN(0xaa688b24, 0x782e152c)}}, + {{TOBN(0x67608e71, 0xbd3502ba), TOBN(0x4ef41f24, 0xb4de75a0), + TOBN(0xb08dde5e, 0xfd6125e5), TOBN(0xde484825, 0xa409543f)}, + {TOBN(0x1f198d98, 0x65cc2295), TOBN(0x428a3771, 0x6e0edfa2), + TOBN(0x4f9697a2, 0xadf35fc7), TOBN(0x01a43c79, 0xf7cac3c7)}}, + {{TOBN(0xb05d7059, 0x0fd3659a), TOBN(0x8927f30c, 0xbb7f2d9a), + TOBN(0x4023d1ac, 0x8cf984d3), TOBN(0x32125ed3, 0x02897a45)}, + {TOBN(0xfb572dad, 0x3d414205), TOBN(0x73000ef2, 0xe3fa82a9), + TOBN(0x4c0868e9, 0xf10a5581), TOBN(0x5b61fc67, 0x6b0b3ca5)}}, + {{TOBN(0xc1258d5b, 0x7cae440c), TOBN(0x21c08b41, 0x402b7531), + TOBN(0xf61a8955, 0xde932321), TOBN(0x3568faf8, 0x2d1408af)}, + {TOBN(0x71b15e99, 0x9ecf965b), TOBN(0xf14ed248, 0xe917276f), + TOBN(0xc6f4caa1, 0x820cf9e2), TOBN(0x681b20b2, 0x18d83c7e)}}, + {{TOBN(0x6cde738d, 0xc6c01120), TOBN(0x71db0813, 0xae70e0db), + TOBN(0x95fc0644, 0x74afe18c), TOBN(0x34619053, 0x129e2be7)}, + {TOBN(0x80615cea, 0xdb2a3b15), TOBN(0x0a49a19e, 0xdb4c7073), + TOBN(0x0e1b84c8, 0x8fd2d367), TOBN(0xd74bf462, 0x033fb8aa)}}, + {{TOBN(0x889f6d65, 0x533ef217), TOBN(0x7158c7e4, 0xc3ca2e87), + TOBN(0xfb670dfb, 0xdc2b4167), TOBN(0x75910a01, 0x844c257f)}, + {TOBN(0xf336bf07, 0xcf88577d), TOBN(0x22245250, 0xe45e2ace), + TOBN(0x2ed92e8d, 0x7ca23d85), TOBN(0x29f8be4c, 0x2b812f58)}}, + {{TOBN(0xdd9ebaa7, 0x076fe12b), TOBN(0x3f2400cb, 0xae1537f9), + TOBN(0x1aa93528, 0x17bdfb46), TOBN(0xc0f98430, 0x67883b41)}, + {TOBN(0x5590ede1, 0x0170911d), TOBN(0x7562f5bb, 0x34d4b17f), + TOBN(0xe1fa1df2, 0x1826b8d2), TOBN(0xb40b796a, 0x6bd80d59)}}, + {{TOBN(0xd65bf197, 0x3467ba92), TOBN(0x8c9b46db, 0xf70954b0), + TOBN(0x97c8a0f3, 0x0e78f15d), TOBN(0xa8f3a69a, 0x85a4c961)}, + {TOBN(0x4242660f, 0x61e4ce9b), TOBN(0xbf06aab3, 0x6ea6790c), + TOBN(0xc6706f8e, 0xec986416), TOBN(0x9e56dec1, 0x9a9fc225)}}, + {{TOBN(0x527c46f4, 0x9a9898d9), TOBN(0xd799e77b, 0x5633cdef), + TOBN(0x24eacc16, 0x7d9e4297), TOBN(0xabb61cea, 0x6b1cb734)}, + {TOBN(0xbee2e8a7, 0xf778443c), TOBN(0x3bb42bf1, 0x29de2fe6), + TOBN(0xcbed86a1, 0x3003bb6f), TOBN(0xd3918e6c, 0xd781cdf6)}}, + {{TOBN(0x4bee3271, 0x9a5103f1), TOBN(0x5243efc6, 0xf50eac06), + TOBN(0xb8e122cb, 0x6adcc119), TOBN(0x1b7faa84, 0xc0b80a08)}, + {TOBN(0x32c3d1bd, 0x6dfcd08c), TOBN(0x129dec4e, 0x0be427de), + TOBN(0x98ab679c, 0x1d263c83), TOBN(0xafc83cb7, 0xcef64eff)}}, + {{TOBN(0x85eb6088, 0x2fa6be76), TOBN(0x892585fb, 0x1328cbfe), + TOBN(0xc154d3ed, 0xcf618dda), TOBN(0xc44f601b, 0x3abaf26e)}, + {TOBN(0x7bf57d0b, 0x2be1fdfd), TOBN(0xa833bd2d, 0x21137fee), + TOBN(0x9353af36, 0x2db591a8), TOBN(0xc76f26dc, 0x5562a056)}}, + {{TOBN(0x1d87e47d, 0x3fdf5a51), TOBN(0x7afb5f93, 0x55c9cab0), + TOBN(0x91bbf58f, 0x89e0586e), TOBN(0x7c72c018, 0x0d843709)}, + {TOBN(0xa9a5aafb, 0x99b5c3dc), TOBN(0xa48a0f1d, 0x3844aeb0), + TOBN(0x7178b7dd, 0xb667e482), TOBN(0x453985e9, 0x6e23a59a)}}, + {{TOBN(0x4a54c860, 0x01b25dd8), TOBN(0x0dd37f48, 0xfb897c8a), + TOBN(0x5f8aa610, 0x0ea90cd9), TOBN(0xc8892c68, 0x16d5830d)}, + {TOBN(0xeb4befc0, 0xef514ca5), TOBN(0x478eb679, 0xe72c9ee6), + TOBN(0x9bca20da, 0xdbc40d5f), TOBN(0xf015de21, 0xdde4f64a)}}, + {{TOBN(0xaa6a4de0, 0xeaf4b8a5), TOBN(0x68cfd9ca, 0x4bc60e32), + TOBN(0x668a4b01, 0x7fd15e70), TOBN(0xd9f0694a, 0xf27dc09d)}, + {TOBN(0xf6c3cad5, 0xba708bcd), TOBN(0x5cd2ba69, 0x5bb95c2a), + TOBN(0xaa28c1d3, 0x33c0a58f), TOBN(0x23e274e3, 0xabc77870)}}, + {{TOBN(0x44c3692d, 0xdfd20a4a), TOBN(0x091c5fd3, 0x81a66653), + TOBN(0x6c0bb691, 0x09a0757d), TOBN(0x9072e8b9, 0x667343ea)}, + {TOBN(0x31d40eb0, 0x80848bec), TOBN(0x95bd480a, 0x79fd36cc), + TOBN(0x01a77c61, 0x65ed43f5), TOBN(0xafccd127, 0x2e0d40bf)}}, + {{TOBN(0xeccfc82d, 0x1cc1884b), TOBN(0xc85ac201, 0x5d4753b4), + TOBN(0xc7a6caac, 0x658e099f), TOBN(0xcf46369e, 0x04b27390)}, + {TOBN(0xe2e7d049, 0x506467ea), TOBN(0x481b63a2, 0x37cdeccc), + TOBN(0x4029abd8, 0xed80143a), TOBN(0x28bfe3c7, 0xbcb00b88)}}, + {{TOBN(0x3bec1009, 0x0643d84a), TOBN(0x885f3668, 0xabd11041), + TOBN(0xdb02432c, 0xf83a34d6), TOBN(0x32f7b360, 0x719ceebe)}, + {TOBN(0xf06c7837, 0xdad1fe7a), TOBN(0x60a157a9, 0x5441a0b0), + TOBN(0x704970e9, 0xe2d47550), TOBN(0xcd2bd553, 0x271b9020)}}, + {{TOBN(0xff57f82f, 0x33e24a0b), TOBN(0x9cbee23f, 0xf2565079), + TOBN(0x16353427, 0xeb5f5825), TOBN(0x276feec4, 0xe948d662)}, + {TOBN(0xd1b62bc6, 0xda10032b), TOBN(0x718351dd, 0xf0e72a53), + TOBN(0x93452076, 0x2420e7ba), TOBN(0x96368fff, 0x3a00118d)}}, + {{TOBN(0x00ce2d26, 0x150a49e4), TOBN(0x0c28b636, 0x3f04706b), + TOBN(0xbad65a46, 0x58b196d0), TOBN(0x6c8455fc, 0xec9f8b7c)}, + {TOBN(0xe90c895f, 0x2d71867e), TOBN(0x5c0be31b, 0xedf9f38c), + TOBN(0x2a37a15e, 0xd8f6ec04), TOBN(0x239639e7, 0x8cd85251)}}, + {{TOBN(0xd8975315, 0x9c7c4c6b), TOBN(0x603aa3c0, 0xd7409af7), + TOBN(0xb8d53d0c, 0x007132fb), TOBN(0x68d12af7, 0xa6849238)}, + {TOBN(0xbe0607e7, 0xbf5d9279), TOBN(0x9aa50055, 0xaada74ce), + TOBN(0xe81079cb, 0xba7e8ccb), TOBN(0x610c71d1, 0xa5f4ff5e)}}, + {{TOBN(0x9e2ee1a7, 0x5aa07093), TOBN(0xca84004b, 0xa75da47c), + TOBN(0x074d3951, 0x3de75401), TOBN(0xf938f756, 0xbb311592)}, + {TOBN(0x96197618, 0x00a43421), TOBN(0x39a25362, 0x07bc78c8), + TOBN(0x278f710a, 0x0a171276), TOBN(0xb28446ea, 0x8d1a8f08)}}, + {{TOBN(0x184781bf, 0xe3b6a661), TOBN(0x7751cb1d, 0xe6d279f7), + TOBN(0xf8ff95d6, 0xc59eb662), TOBN(0x186d90b7, 0x58d3dea7)}, + {TOBN(0x0e4bb6c1, 0xdfb4f754), TOBN(0x5c5cf56b, 0x2b2801dc), + TOBN(0xc561e452, 0x1f54564d), TOBN(0xb4fb8c60, 0xf0dd7f13)}}, + {{TOBN(0xf8849630, 0x33ff98c7), TOBN(0x9619fffa, 0xcf17769c), + TOBN(0xf8090bf6, 0x1bfdd80a), TOBN(0x14d9a149, 0x422cfe63)}, + {TOBN(0xb354c360, 0x6f6df9ea), TOBN(0xdbcf770d, 0x218f17ea), + TOBN(0x207db7c8, 0x79eb3480), TOBN(0x213dbda8, 0x559b6a26)}}, + {{TOBN(0xac4c200b, 0x29fc81b3), TOBN(0xebc3e09f, 0x171d87c1), + TOBN(0x91799530, 0x1481aa9e), TOBN(0x051b92e1, 0x92e114fa)}, + {TOBN(0xdf8f92e9, 0xecb5537f), TOBN(0x44b1b2cc, 0x290c7483), + TOBN(0xa711455a, 0x2adeb016), TOBN(0x964b6856, 0x81a10c2c)}}, + {{TOBN(0x4f159d99, 0xcec03623), TOBN(0x05532225, 0xef3271ea), + TOBN(0xb231bea3, 0xc5ee4849), TOBN(0x57a54f50, 0x7094f103)}, + {TOBN(0x3e2d421d, 0x9598b352), TOBN(0xe865a49c, 0x67412ab4), + TOBN(0xd2998a25, 0x1cc3a912), TOBN(0x5d092808, 0x0c74d65d)}}, + {{TOBN(0x73f45908, 0x4088567a), TOBN(0xeb6b280e, 0x1f214a61), + TOBN(0x8c9adc34, 0xcaf0c13d), TOBN(0x39d12938, 0xf561fb80)}, + {TOBN(0xb2dc3a5e, 0xbc6edfb4), TOBN(0x7485b1b1, 0xfe4d210e), + TOBN(0x062e0400, 0xe186ae72), TOBN(0x91e32d5c, 0x6eeb3b88)}}, + {{TOBN(0x6df574d7, 0x4be59224), TOBN(0xebc88ccc, 0x716d55f3), + TOBN(0x26c2e6d0, 0xcad6ed33), TOBN(0xc6e21e7d, 0x0d3e8b10)}, + {TOBN(0x2cc5840e, 0x5bcc36bb), TOBN(0x9292445e, 0x7da74f69), + TOBN(0x8be8d321, 0x4e5193a8), TOBN(0x3ec23629, 0x8df06413)}}, + {{TOBN(0xc7e9ae85, 0xb134defa), TOBN(0x6073b1d0, 0x1bb2d475), + TOBN(0xb9ad615e, 0x2863c00d), TOBN(0x9e29493d, 0x525f4ac4)}, + {TOBN(0xc32b1dea, 0x4e9acf4f), TOBN(0x3e1f01c8, 0xa50db88d), + TOBN(0xb05d70ea, 0x04da916c), TOBN(0x714b0d0a, 0xd865803e)}}, + {{TOBN(0x4bd493fc, 0x9920cb5e), TOBN(0x5b44b1f7, 0x92c7a3ac), + TOBN(0xa2a77293, 0xbcec9235), TOBN(0x5ee06e87, 0xcd378553)}, + {TOBN(0xceff8173, 0xda621607), TOBN(0x2bb03e4c, 0x99f5d290), + TOBN(0x2945106a, 0xa6f734ac), TOBN(0xb5056604, 0xd25c4732)}}, + {{TOBN(0x5945920c, 0xe079afee), TOBN(0x686e17a0, 0x6789831f), + TOBN(0x5966bee8, 0xb74a5ae5), TOBN(0x38a673a2, 0x1e258d46)}, + {TOBN(0xbd1cc1f2, 0x83141c95), TOBN(0x3b2ecf4f, 0x0e96e486), + TOBN(0xcd3aa896, 0x74e5fc78), TOBN(0x415ec10c, 0x2482fa7a)}}, + {{TOBN(0x15234419, 0x80503380), TOBN(0x513d917a, 0xd314b392), + TOBN(0xb0b52f4e, 0x63caecae), TOBN(0x07bf22ad, 0x2dc7780b)}, + {TOBN(0xe761e8a1, 0xe4306839), TOBN(0x1b3be962, 0x5dd7feaa), + TOBN(0x4fe728de, 0x74c778f1), TOBN(0xf1fa0bda, 0x5e0070f6)}}, + {{TOBN(0x85205a31, 0x6ec3f510), TOBN(0x2c7e4a14, 0xd2980475), + TOBN(0xde3c19c0, 0x6f30ebfd), TOBN(0xdb1c1f38, 0xd4b7e644)}, + {TOBN(0xfe291a75, 0x5dce364a), TOBN(0xb7b22a3c, 0x058f5be3), + TOBN(0x2cd2c302, 0x37fea38c), TOBN(0x2930967a, 0x2e17be17)}}, + {{TOBN(0x87f009de, 0x0c061c65), TOBN(0xcb014aac, 0xedc6ed44), + TOBN(0x49bd1cb4, 0x3bafb1eb), TOBN(0x81bd8b5c, 0x282d3688)}, + {TOBN(0x1cdab87e, 0xf01a17af), TOBN(0x21f37ac4, 0xe710063b), + TOBN(0x5a6c5676, 0x42fc8193), TOBN(0xf4753e70, 0x56a6015c)}}, + {{TOBN(0x020f795e, 0xa15b0a44), TOBN(0x8f37c8d7, 0x8958a958), + TOBN(0x63b7e89b, 0xa4b675b5), TOBN(0xb4fb0c0c, 0x0fc31aea)}, + {TOBN(0xed95e639, 0xa7ff1f2e), TOBN(0x9880f5a3, 0x619614fb), + TOBN(0xdeb6ff02, 0x947151ab), TOBN(0x5bc5118c, 0xa868dcdb)}}, + {{TOBN(0xd8da2055, 0x4c20cea5), TOBN(0xcac2776e, 0x14c4d69a), + TOBN(0xcccb22c1, 0x622d599b), TOBN(0xa4ddb653, 0x68a9bb50)}, + {TOBN(0x2c4ff151, 0x1b4941b4), TOBN(0xe1ff19b4, 0x6efba588), + TOBN(0x35034363, 0xc48345e0), TOBN(0x45542e3d, 0x1e29dfc4)}}, + {{TOBN(0xf197cb91, 0x349f7aed), TOBN(0x3b2b5a00, 0x8fca8420), + TOBN(0x7c175ee8, 0x23aaf6d8), TOBN(0x54dcf421, 0x35af32b6)}, + {TOBN(0x0ba14307, 0x27d6561e), TOBN(0x879d5ee4, 0xd175b1e2), + TOBN(0xc7c43673, 0x99807db5), TOBN(0x77a54455, 0x9cd55bcd)}}, + {{TOBN(0xe6c2ff13, 0x0105c072), TOBN(0x18f7a99f, 0x8dda7da4), + TOBN(0x4c301820, 0x0e2d35c1), TOBN(0x06a53ca0, 0xd9cc6c82)}, + {TOBN(0xaa21cc1e, 0xf1aa1d9e), TOBN(0x32414334, 0x4a75b1e8), + TOBN(0x2a6d1328, 0x0ebe9fdc), TOBN(0x16bd173f, 0x98a4755a)}}, + {{TOBN(0xfbb9b245, 0x2133ffd9), TOBN(0x39a8b2f1, 0x830f1a20), + TOBN(0x484bc97d, 0xd5a1f52a), TOBN(0xd6aebf56, 0xa40eddf8)}, + {TOBN(0x32257acb, 0x76ccdac6), TOBN(0xaf4d36ec, 0x1586ff27), + TOBN(0x8eaa8863, 0xf8de7dd1), TOBN(0x0045d5cf, 0x88647c16)}}}, + {{{TOBN(0xa6f3d574, 0xc005979d), TOBN(0xc2072b42, 0x6a40e350), + TOBN(0xfca5c156, 0x8de2ecf9), TOBN(0xa8c8bf5b, 0xa515344e)}, + {TOBN(0x97aee555, 0x114df14a), TOBN(0xd4374a4d, 0xfdc5ec6b), + TOBN(0x754cc28f, 0x2ca85418), TOBN(0x71cb9e27, 0xd3c41f78)}}, + {{TOBN(0x89105079, 0x03605c39), TOBN(0xf0843d9e, 0xa142c96c), + TOBN(0xf3744934, 0x16923684), TOBN(0x732caa2f, 0xfa0a2893)}, + {TOBN(0xb2e8c270, 0x61160170), TOBN(0xc32788cc, 0x437fbaa3), + TOBN(0x39cd818e, 0xa6eda3ac), TOBN(0xe2e94239, 0x9e2b2e07)}}, + {{TOBN(0x6967d39b, 0x0260e52a), TOBN(0xd42585cc, 0x90653325), + TOBN(0x0d9bd605, 0x21ca7954), TOBN(0x4fa20877, 0x81ed57b3)}, + {TOBN(0x60c1eff8, 0xe34a0bbe), TOBN(0x56b0040c, 0x84f6ef64), + TOBN(0x28be2b24, 0xb1af8483), TOBN(0xb2278163, 0xf5531614)}}, + {{TOBN(0x8df27545, 0x5922ac1c), TOBN(0xa7b3ef5c, 0xa52b3f63), + TOBN(0x8e77b214, 0x71de57c4), TOBN(0x31682c10, 0x834c008b)}, + {TOBN(0xc76824f0, 0x4bd55d31), TOBN(0xb6d1c086, 0x17b61c71), + TOBN(0x31db0903, 0xc2a5089d), TOBN(0x9c092172, 0x184e5d3f)}}, + {{TOBN(0xdd7ced5b, 0xc00cc638), TOBN(0x1a2015eb, 0x61278fc2), + TOBN(0x2e8e5288, 0x6a37f8d6), TOBN(0xc457786f, 0xe79933ad)}, + {TOBN(0xb3fe4cce, 0x2c51211a), TOBN(0xad9b10b2, 0x24c20498), + TOBN(0x90d87a4f, 0xd28db5e5), TOBN(0x698cd105, 0x3aca2fc3)}}, + {{TOBN(0x4f112d07, 0xe91b536d), TOBN(0xceb982f2, 0x9eba09d6), + TOBN(0x3c157b2c, 0x197c396f), TOBN(0xe23c2d41, 0x7b66eb24)}, + {TOBN(0x480c57d9, 0x3f330d37), TOBN(0xb3a4c8a1, 0x79108deb), + TOBN(0x702388de, 0xcb199ce5), TOBN(0x0b019211, 0xb944a8d4)}}, + {{TOBN(0x24f2a692, 0x840bb336), TOBN(0x7c353bdc, 0xa669fa7b), + TOBN(0xda20d6fc, 0xdec9c300), TOBN(0x625fbe2f, 0xa13a4f17)}, + {TOBN(0xa2b1b61a, 0xdbc17328), TOBN(0x008965bf, 0xa9515621), + TOBN(0x49690939, 0xc620ff46), TOBN(0x182dd27d, 0x8717e91c)}}, + {{TOBN(0x5ace5035, 0xea6c3997), TOBN(0x54259aaa, 0xc2610bef), + TOBN(0xef18bb3f, 0x3c80dd39), TOBN(0x6910b95b, 0x5fc3fa39)}, + {TOBN(0xfce2f510, 0x43e09aee), TOBN(0xced56c9f, 0xa7675665), + TOBN(0x10e265ac, 0xd872db61), TOBN(0x6982812e, 0xae9fce69)}}, + {{TOBN(0x29be11c6, 0xce800998), TOBN(0x72bb1752, 0xb90360d9), + TOBN(0x2c193197, 0x5a4ad590), TOBN(0x2ba2f548, 0x9fc1dbc0)}, + {TOBN(0x7fe4eebb, 0xe490ebe0), TOBN(0x12a0a4cd, 0x7fae11c0), + TOBN(0x7197cf81, 0xe903ba37), TOBN(0xcf7d4aa8, 0xde1c6dd8)}}, + {{TOBN(0x92af6bf4, 0x3fd5684c), TOBN(0x2b26eecf, 0x80360aa1), + TOBN(0xbd960f30, 0x00546a82), TOBN(0x407b3c43, 0xf59ad8fe)}, + {TOBN(0x86cae5fe, 0x249c82ba), TOBN(0x9e0faec7, 0x2463744c), + TOBN(0x87f551e8, 0x94916272), TOBN(0x033f9344, 0x6ceb0615)}}, + {{TOBN(0x1e5eb0d1, 0x8be82e84), TOBN(0x89967f0e, 0x7a582fef), + TOBN(0xbcf687d5, 0xa6e921fa), TOBN(0xdfee4cf3, 0xd37a09ba)}, + {TOBN(0x94f06965, 0xb493c465), TOBN(0x638b9a1c, 0x7635c030), + TOBN(0x76667864, 0x66f05e9f), TOBN(0xccaf6808, 0xc04da725)}}, + {{TOBN(0xca2eb690, 0x768fccfc), TOBN(0xf402d37d, 0xb835b362), + TOBN(0x0efac0d0, 0xe2fdfcce), TOBN(0xefc9cdef, 0xb638d990)}, + {TOBN(0x2af12b72, 0xd1669a8b), TOBN(0x33c536bc, 0x5774ccbd), + TOBN(0x30b21909, 0xfb34870e), TOBN(0xc38fa2f7, 0x7df25aca)}}, + {{TOBN(0x74c5f02b, 0xbf81f3f5), TOBN(0x0525a5ae, 0xaf7e4581), + TOBN(0x88d2aaba, 0x433c54ae), TOBN(0xed9775db, 0x806a56c5)}, + {TOBN(0xd320738a, 0xc0edb37d), TOBN(0x25fdb6ee, 0x66cc1f51), + TOBN(0xac661d17, 0x10600d76), TOBN(0x931ec1f3, 0xbdd1ed76)}}, + {{TOBN(0x65c11d62, 0x19ee43f1), TOBN(0x5cd57c3e, 0x60829d97), + TOBN(0xd26c91a3, 0x984be6e8), TOBN(0xf08d9309, 0x8b0c53bd)}, + {TOBN(0x94bc9e5b, 0xc016e4ea), TOBN(0xd3916839, 0x11d43d2b), + TOBN(0x886c5ad7, 0x73701155), TOBN(0xe0377626, 0x20b00715)}}, + {{TOBN(0x7f01c9ec, 0xaa80ba59), TOBN(0x3083411a, 0x68538e51), + TOBN(0x970370f1, 0xe88128af), TOBN(0x625cc3db, 0x91dec14b)}, + {TOBN(0xfef9666c, 0x01ac3107), TOBN(0xb2a8d577, 0xd5057ac3), + TOBN(0xb0f26299, 0x92be5df7), TOBN(0xf579c8e5, 0x00353924)}}, + {{TOBN(0xb8fa3d93, 0x1341ed7a), TOBN(0x4223272c, 0xa7b59d49), + TOBN(0x3dcb1947, 0x83b8c4a4), TOBN(0x4e413c01, 0xed1302e4)}, + {TOBN(0x6d999127, 0xe17e44ce), TOBN(0xee86bf75, 0x33b3adfb), + TOBN(0xf6902fe6, 0x25aa96ca), TOBN(0xb73540e4, 0xe5aae47d)}}, + {{TOBN(0x32801d7b, 0x1b4a158c), TOBN(0xe571c99e, 0x27e2a369), + TOBN(0x40cb76c0, 0x10d9f197), TOBN(0xc308c289, 0x3167c0ae)}, + {TOBN(0xa6ef9dd3, 0xeb7958f2), TOBN(0xa7226dfc, 0x300879b1), + TOBN(0x6cd0b362, 0x7edf0636), TOBN(0x4efbce6c, 0x7bc37eed)}}, + {{TOBN(0x75f92a05, 0x8d699021), TOBN(0x586d4c79, 0x772566e3), + TOBN(0x378ca5f1, 0x761ad23a), TOBN(0x650d86fc, 0x1465a8ac)}, + {TOBN(0x7a4ed457, 0x842ba251), TOBN(0x6b65e3e6, 0x42234933), + TOBN(0xaf1543b7, 0x31aad657), TOBN(0xa4cefe98, 0xcbfec369)}}, + {{TOBN(0xb587da90, 0x9f47befb), TOBN(0x6562e9fb, 0x41312d13), + TOBN(0xa691ea59, 0xeff1cefe), TOBN(0xcc30477a, 0x05fc4cf6)}, + {TOBN(0xa1632461, 0x0b0ffd3d), TOBN(0xa1f16f3b, 0x5b355956), + TOBN(0x5b148d53, 0x4224ec24), TOBN(0xdc834e7b, 0xf977012a)}}, + {{TOBN(0x7bfc5e75, 0xb2c69dbc), TOBN(0x3aa77a29, 0x03c3da6c), + TOBN(0xde0df03c, 0xca910271), TOBN(0xcbd5ca4a, 0x7806dc55)}, + {TOBN(0xe1ca5807, 0x6db476cb), TOBN(0xfde15d62, 0x5f37a31e), + TOBN(0xf49af520, 0xf41af416), TOBN(0x96c5c5b1, 0x7d342db5)}}, + {{TOBN(0x155c43b7, 0xeb4ceb9b), TOBN(0x2e993010, 0x4e77371a), + TOBN(0x1d2987da, 0x675d43af), TOBN(0xef2bc1c0, 0x8599fd72)}, + {TOBN(0x96894b7b, 0x9342f6b2), TOBN(0x201eadf2, 0x7c8e71f0), + TOBN(0xf3479d9f, 0x4a1f3efc), TOBN(0xe0f8a742, 0x702a9704)}}, + {{TOBN(0xeafd44b6, 0xb3eba40c), TOBN(0xf9739f29, 0xc1c1e0d0), + TOBN(0x0091471a, 0x619d505e), TOBN(0xc15f9c96, 0x9d7c263e)}, + {TOBN(0x5be47285, 0x83afbe33), TOBN(0xa3b6d6af, 0x04f1e092), + TOBN(0xe76526b9, 0x751a9d11), TOBN(0x2ec5b26d, 0x9a4ae4d2)}}, + {{TOBN(0xeb66f4d9, 0x02f6fb8d), TOBN(0x4063c561, 0x96912164), + TOBN(0xeb7050c1, 0x80ef3000), TOBN(0x288d1c33, 0xeaa5b3f0)}, + {TOBN(0xe87c68d6, 0x07806fd8), TOBN(0xb2f7f9d5, 0x4bbbf50f), + TOBN(0x25972f3a, 0xac8d6627), TOBN(0xf8547774, 0x10e8c13b)}}, + {{TOBN(0xcc50ef6c, 0x872b4a60), TOBN(0xab2a34a4, 0x4613521b), + TOBN(0x39c5c190, 0x983e15d1), TOBN(0x61dde5df, 0x59905512)}, + {TOBN(0xe417f621, 0x9f2275f3), TOBN(0x0750c8b6, 0x451d894b), + TOBN(0x75b04ab9, 0x78b0bdaa), TOBN(0x3bfd9fd4, 0x458589bd)}}, + {{TOBN(0xf1013e30, 0xee9120b6), TOBN(0x2b51af93, 0x23a4743e), + TOBN(0xea96ffae, 0x48d14d9e), TOBN(0x71dc0dbe, 0x698a1d32)}, + {TOBN(0x914962d2, 0x0180cca4), TOBN(0x1ae60677, 0xc3568963), + TOBN(0x8cf227b1, 0x437bc444), TOBN(0xc650c83b, 0xc9962c7a)}}, + {{TOBN(0x23c2c7dd, 0xfe7ccfc4), TOBN(0xf925c89d, 0x1b929d48), + TOBN(0x4460f74b, 0x06783c33), TOBN(0xac2c8d49, 0xa590475a)}, + {TOBN(0xfb40b407, 0xb807bba0), TOBN(0x9d1e362d, 0x69ff8f3a), + TOBN(0xa33e9681, 0xcbef64a4), TOBN(0x67ece5fa, 0x332fb4b2)}}, + {{TOBN(0x6900a99b, 0x739f10e3), TOBN(0xc3341ca9, 0xff525925), + TOBN(0xee18a626, 0xa9e2d041), TOBN(0xa5a83685, 0x29580ddd)}, + {TOBN(0xf3470c81, 0x9d7de3cd), TOBN(0xedf02586, 0x2062cf9c), + TOBN(0xf43522fa, 0xc010edb0), TOBN(0x30314135, 0x13a4b1ae)}}, + {{TOBN(0xc792e02a, 0xdb22b94b), TOBN(0x993d8ae9, 0xa1eaa45b), + TOBN(0x8aad6cd3, 0xcd1e1c63), TOBN(0x89529ca7, 0xc5ce688a)}, + {TOBN(0x2ccee3aa, 0xe572a253), TOBN(0xe02b6438, 0x02a21efb), + TOBN(0xa7091b6e, 0xc9430358), TOBN(0x06d1b1fa, 0x9d7db504)}}, + {{TOBN(0x58846d32, 0xc4744733), TOBN(0x40517c71, 0x379f9e34), + TOBN(0x2f65655f, 0x130ef6ca), TOBN(0x526e4488, 0xf1f3503f)}, + {TOBN(0x8467bd17, 0x7ee4a976), TOBN(0x1d9dc913, 0x921363d1), + TOBN(0xd8d24c33, 0xb069e041), TOBN(0x5eb5da0a, 0x2cdf7f51)}}, + {{TOBN(0x1c0f3cb1, 0x197b994f), TOBN(0x3c95a6c5, 0x2843eae9), + TOBN(0x7766ffc9, 0xa6097ea5), TOBN(0x7bea4093, 0xd723b867)}, + {TOBN(0xb48e1f73, 0x4db378f9), TOBN(0x70025b00, 0xe37b77ac), + TOBN(0x943dc8e7, 0xaf24ad46), TOBN(0xb98a15ac, 0x16d00a85)}}, + {{TOBN(0x3adc38ba, 0x2743b004), TOBN(0xb1c7f4f7, 0x334415ee), + TOBN(0xea43df8f, 0x1e62d05a), TOBN(0x32618905, 0x9d76a3b6)}, + {TOBN(0x2fbd0bb5, 0xa23a0f46), TOBN(0x5bc971db, 0x6a01918c), + TOBN(0x7801d94a, 0xb4743f94), TOBN(0xb94df65e, 0x676ae22b)}}, + {{TOBN(0xaafcbfab, 0xaf95894c), TOBN(0x7b9bdc07, 0x276b2241), + TOBN(0xeaf98362, 0x5bdda48b), TOBN(0x5977faf2, 0xa3fcb4df)}, + {TOBN(0xbed042ef, 0x052c4b5b), TOBN(0x9fe87f71, 0x067591f0), + TOBN(0xc89c73ca, 0x22f24ec7), TOBN(0x7d37fa9e, 0xe64a9f1b)}}, + {{TOBN(0x2710841a, 0x15562627), TOBN(0x2c01a613, 0xc243b034), + TOBN(0x1d135c56, 0x2bc68609), TOBN(0xc2ca1715, 0x8b03f1f6)}, + {TOBN(0xc9966c2d, 0x3eb81d82), TOBN(0xc02abf4a, 0x8f6df13e), + TOBN(0x77b34bd7, 0x8f72b43b), TOBN(0xaff6218f, 0x360c82b0)}}, + {{TOBN(0x0aa5726c, 0x8d55b9d2), TOBN(0xdc0adbe9, 0x99e9bffb), + TOBN(0x9097549c, 0xefb9e72a), TOBN(0x16755712, 0x9dfb3111)}, + {TOBN(0xdd8bf984, 0xf26847f9), TOBN(0xbcb8e387, 0xdfb30cb7), + TOBN(0xc1fd32a7, 0x5171ef9c), TOBN(0x977f3fc7, 0x389b363f)}}, + {{TOBN(0x116eaf2b, 0xf4babda0), TOBN(0xfeab68bd, 0xf7113c8e), + TOBN(0xd1e3f064, 0xb7def526), TOBN(0x1ac30885, 0xe0b3fa02)}, + {TOBN(0x1c5a6e7b, 0x40142d9d), TOBN(0x839b5603, 0x30921c0b), + TOBN(0x48f301fa, 0x36a116a3), TOBN(0x380e1107, 0xcfd9ee6d)}}, + {{TOBN(0x7945ead8, 0x58854be1), TOBN(0x4111c12e, 0xcbd4d49d), + TOBN(0xece3b1ec, 0x3a29c2ef), TOBN(0x6356d404, 0x8d3616f5)}, + {TOBN(0x9f0d6a8f, 0x594d320e), TOBN(0x0989316d, 0xf651ccd2), + TOBN(0x6c32117a, 0x0f8fdde4), TOBN(0x9abe5cc5, 0xa26a9bbc)}}, + {{TOBN(0xcff560fb, 0x9723f671), TOBN(0x21b2a12d, 0x7f3d593c), + TOBN(0xe4cb18da, 0x24ba0696), TOBN(0x186e2220, 0xc3543384)}, + {TOBN(0x722f64e0, 0x88312c29), TOBN(0x94282a99, 0x17dc7752), + TOBN(0x62467bbf, 0x5a85ee89), TOBN(0xf435c650, 0xf10076a0)}}, + {{TOBN(0xc9ff1539, 0x43b3a50b), TOBN(0x7132130c, 0x1a53efbc), + TOBN(0x31bfe063, 0xf7b0c5b7), TOBN(0xb0179a7d, 0x4ea994cc)}, + {TOBN(0x12d064b3, 0xc85f455b), TOBN(0x47259328, 0x8f6e0062), + TOBN(0xf64e590b, 0xb875d6d9), TOBN(0x22dd6225, 0xad92bcc7)}}, + {{TOBN(0xb658038e, 0xb9c3bd6d), TOBN(0x00cdb0d6, 0xfbba27c8), + TOBN(0x0c681337, 0x1062c45d), TOBN(0xd8515b8c, 0x2d33407d)}, + {TOBN(0xcb8f699e, 0x8cbb5ecf), TOBN(0x8c4347f8, 0xc608d7d8), + TOBN(0x2c11850a, 0xbb3e00db), TOBN(0x20a8dafd, 0xecb49d19)}}, + {{TOBN(0xbd781480, 0x45ee2f40), TOBN(0x75e354af, 0x416b60cf), + TOBN(0xde0b58a1, 0x8d49a8c4), TOBN(0xe40e94e2, 0xfa359536)}, + {TOBN(0xbd4fa59f, 0x62accd76), TOBN(0x05cf466a, 0x8c762837), + TOBN(0xb5abda99, 0x448c277b), TOBN(0x5a9e01bf, 0x48b13740)}}, + {{TOBN(0x9d457798, 0x326aad8d), TOBN(0xbdef4954, 0xc396f7e7), + TOBN(0x6fb274a2, 0xc253e292), TOBN(0x2800bf0a, 0x1cfe53e7)}, + {TOBN(0x22426d31, 0x44438fd4), TOBN(0xef233923, 0x5e259f9a), + TOBN(0x4188503c, 0x03f66264), TOBN(0x9e5e7f13, 0x7f9fdfab)}}, + {{TOBN(0x565eb76c, 0x5fcc1aba), TOBN(0xea632548, 0x59b5bff8), + TOBN(0x5587c087, 0xaab6d3fa), TOBN(0x92b639ea, 0x6ce39c1b)}, + {TOBN(0x0706e782, 0x953b135c), TOBN(0x7308912e, 0x425268ef), + TOBN(0x599e92c7, 0x090e7469), TOBN(0x83b90f52, 0x9bc35e75)}}, + {{TOBN(0x4750b3d0, 0x244975b3), TOBN(0xf3a44358, 0x11965d72), + TOBN(0x179c6774, 0x9c8dc751), TOBN(0xff18cdfe, 0xd23d9ff0)}, + {TOBN(0xc4013833, 0x2028e247), TOBN(0x96e280e2, 0xf3bfbc79), + TOBN(0xf60417bd, 0xd0880a84), TOBN(0x263c9f3d, 0x2a568151)}}, + {{TOBN(0x36be15b3, 0x2d2ce811), TOBN(0x846dc0c2, 0xf8291d21), + TOBN(0x5cfa0ecb, 0x789fcfdb), TOBN(0x45a0beed, 0xd7535b9a)}, + {TOBN(0xec8e9f07, 0x96d69af1), TOBN(0x31a7c5b8, 0x599ab6dc), + TOBN(0xd36d45ef, 0xf9e2e09f), TOBN(0x3cf49ef1, 0xdcee954b)}}, + {{TOBN(0x6be34cf3, 0x086cff9b), TOBN(0x88dbd491, 0x39a3360f), + TOBN(0x1e96b8cc, 0x0dbfbd1d), TOBN(0xc1e5f7bf, 0xcb7e2552)}, + {TOBN(0x0547b214, 0x28819d98), TOBN(0xc770dd9c, 0x7aea9dcb), + TOBN(0xaef0d4c7, 0x041d68c8), TOBN(0xcc2b9818, 0x13cb9ba8)}}, + {{TOBN(0x7fc7bc76, 0xfe86c607), TOBN(0x6b7b9337, 0x502a9a95), + TOBN(0x1948dc27, 0xd14dab63), TOBN(0x249dd198, 0xdae047be)}, + {TOBN(0xe8356584, 0xa981a202), TOBN(0x3531dd18, 0x3a893387), + TOBN(0x1be11f90, 0xc85c7209), TOBN(0x93d2fe1e, 0xe2a52b5a)}}, + {{TOBN(0x8225bfe2, 0xec6d6b97), TOBN(0x9cf6d6f4, 0xbd0aa5de), + TOBN(0x911459cb, 0x54779f5f), TOBN(0x5649cddb, 0x86aeb1f3)}, + {TOBN(0x32133579, 0x3f26ce5a), TOBN(0xc289a102, 0x550f431e), + TOBN(0x559dcfda, 0x73b84c6f), TOBN(0x84973819, 0xee3ac4d7)}}, + {{TOBN(0xb51e55e6, 0xf2606a82), TOBN(0xe25f7061, 0x90f2fb57), + TOBN(0xacef6c2a, 0xb1a4e37c), TOBN(0x864e359d, 0x5dcf2706)}, + {TOBN(0x479e6b18, 0x7ce57316), TOBN(0x2cab2500, 0x3a96b23d), + TOBN(0xed489862, 0x8ef16df7), TOBN(0x2056538c, 0xef3758b5)}}, + {{TOBN(0xa7df865e, 0xf15d3101), TOBN(0x80c5533a, 0x61b553d7), + TOBN(0x366e1997, 0x4ed14294), TOBN(0x6620741f, 0xb3c0bcd6)}, + {TOBN(0x21d1d9c4, 0xedc45418), TOBN(0x005b859e, 0xc1cc4a9d), + TOBN(0xdf01f630, 0xa1c462f0), TOBN(0x15d06cf3, 0xf26820c7)}}, + {{TOBN(0x9f7f24ee, 0x3484be47), TOBN(0x2ff33e96, 0x4a0c902f), + TOBN(0x00bdf457, 0x5a0bc453), TOBN(0x2378dfaf, 0x1aa238db)}, + {TOBN(0x272420ec, 0x856720f2), TOBN(0x2ad9d95b, 0x96797291), + TOBN(0xd1242cc6, 0x768a1558), TOBN(0x2e287f8b, 0x5cc86aa8)}}, + {{TOBN(0x796873d0, 0x990cecaa), TOBN(0xade55f81, 0x675d4080), + TOBN(0x2645eea3, 0x21f0cd84), TOBN(0x7a1efa0f, 0xb4e17d02)}, + {TOBN(0xf6858420, 0x037cc061), TOBN(0x682e05f0, 0xd5d43e12), + TOBN(0x59c36994, 0x27218710), TOBN(0x85cbba4d, 0x3f7cd2fc)}}, + {{TOBN(0x726f9729, 0x7a3cd22a), TOBN(0x9f8cd5dc, 0x4a628397), + TOBN(0x17b93ab9, 0xc23165ed), TOBN(0xff5f5dbf, 0x122823d4)}, + {TOBN(0xc1e4e4b5, 0x654a446d), TOBN(0xd1a9496f, 0x677257ba), + TOBN(0x6387ba94, 0xde766a56), TOBN(0x23608bc8, 0x521ec74a)}}, + {{TOBN(0x16a522d7, 0x6688c4d4), TOBN(0x9d6b4282, 0x07373abd), + TOBN(0xa62f07ac, 0xb42efaa3), TOBN(0xf73e00f7, 0xe3b90180)}, + {TOBN(0x36175fec, 0x49421c3e), TOBN(0xc4e44f9b, 0x3dcf2678), + TOBN(0x76df436b, 0x7220f09f), TOBN(0x172755fb, 0x3aa8b6cf)}}, + {{TOBN(0xbab89d57, 0x446139cc), TOBN(0x0a0a6e02, 0x5fe0208f), + TOBN(0xcdbb63e2, 0x11e5d399), TOBN(0x33ecaa12, 0xa8977f0b)}, + {TOBN(0x59598b21, 0xf7c42664), TOBN(0xb3e91b32, 0xab65d08a), + TOBN(0x035822ee, 0xf4502526), TOBN(0x1dcf0176, 0x720a82a9)}}, + {{TOBN(0x50f8598f, 0x3d589e02), TOBN(0xdf0478ff, 0xb1d63d2c), + TOBN(0x8b8068bd, 0x1571cd07), TOBN(0x30c3aa4f, 0xd79670cd)}, + {TOBN(0x25e8fd4b, 0x941ade7f), TOBN(0x3d1debdc, 0x32790011), + TOBN(0x65b6dcbd, 0x3a3f9ff0), TOBN(0x282736a4, 0x793de69c)}}, + {{TOBN(0xef69a0c3, 0xd41d3bd3), TOBN(0xb533b8c9, 0x07a26bde), + TOBN(0xe2801d97, 0xdb2edf9f), TOBN(0xdc4a8269, 0xe1877af0)}, + {TOBN(0x6c1c5851, 0x3d590dbe), TOBN(0x84632f6b, 0xee4e9357), + TOBN(0xd36d36b7, 0x79b33374), TOBN(0xb46833e3, 0x9bbca2e6)}}, + {{TOBN(0x37893913, 0xf7fc0586), TOBN(0x385315f7, 0x66bf4719), + TOBN(0x72c56293, 0xb31855dc), TOBN(0xd1416d4e, 0x849061fe)}, + {TOBN(0xbeb3ab78, 0x51047213), TOBN(0x447f6e61, 0xf040c996), + TOBN(0xd06d310d, 0x638b1d0c), TOBN(0xe28a413f, 0xbad1522e)}}, + {{TOBN(0x685a76cb, 0x82003f86), TOBN(0x610d07f7, 0x0bcdbca3), + TOBN(0x6ff66021, 0x9ca4c455), TOBN(0x7df39b87, 0xcea10eec)}, + {TOBN(0xb9255f96, 0xe22db218), TOBN(0x8cc6d9eb, 0x08a34c44), + TOBN(0xcd4ffb86, 0x859f9276), TOBN(0x8fa15eb2, 0x50d07335)}}, + {{TOBN(0xdf553845, 0xcf2c24b5), TOBN(0x89f66a9f, 0x52f9c3ba), + TOBN(0x8f22b5b9, 0xe4a7ceb3), TOBN(0xaffef809, 0x0e134686)}, + {TOBN(0x3e53e1c6, 0x8eb8fac2), TOBN(0x93c1e4eb, 0x28aec98e), + TOBN(0xb6b91ec5, 0x32a43bcb), TOBN(0x2dbfa947, 0xb2d74a51)}}, + {{TOBN(0xe065d190, 0xca84bad7), TOBN(0xfb13919f, 0xad58e65c), + TOBN(0x3c41718b, 0xf1cb6e31), TOBN(0x688969f0, 0x06d05c3f)}, + {TOBN(0xd4f94ce7, 0x21264d45), TOBN(0xfdfb65e9, 0x7367532b), + TOBN(0x5b1be8b1, 0x0945a39d), TOBN(0x229f789c, 0x2b8baf3b)}}, + {{TOBN(0xd8f41f3e, 0x6f49f15d), TOBN(0x678ce828, 0x907f0792), + TOBN(0xc69ace82, 0xfca6e867), TOBN(0x106451ae, 0xd01dcc89)}, + {TOBN(0x1bb4f7f0, 0x19fc32d2), TOBN(0x64633dfc, 0xb00c52d2), + TOBN(0x8f13549a, 0xad9ea445), TOBN(0x99a3bf50, 0xfb323705)}}, + {{TOBN(0x0c9625a2, 0x534d4dbc), TOBN(0x45b8f1d1, 0xc2a2fea3), + TOBN(0x76ec21a1, 0xa530fc1a), TOBN(0x4bac9c2a, 0x9e5bd734)}, + {TOBN(0x5996d76a, 0x7b4e3587), TOBN(0x0045cdee, 0x1182d9e3), + TOBN(0x1aee24b9, 0x1207f13d), TOBN(0x66452e97, 0x97345a41)}}, + {{TOBN(0x16e5b054, 0x9f950cd0), TOBN(0x9cc72fb1, 0xd7fdd075), + TOBN(0x6edd61e7, 0x66249663), TOBN(0xde4caa4d, 0xf043cccb)}, + {TOBN(0x11b1f57a, 0x55c7ac17), TOBN(0x779cbd44, 0x1a85e24d), + TOBN(0x78030f86, 0xe46081e7), TOBN(0xfd4a6032, 0x8e20f643)}}, + {{TOBN(0xcc7a6488, 0x0a750c0f), TOBN(0x39bacfe3, 0x4e548e83), + TOBN(0x3d418c76, 0x0c110f05), TOBN(0x3e4daa4c, 0xb1f11588)}, + {TOBN(0x2733e7b5, 0x5ffc69ff), TOBN(0x46f147bc, 0x92053127), + TOBN(0x885b2434, 0xd722df94), TOBN(0x6a444f65, 0xe6fc6b7c)}}}, + {{{TOBN(0x7a1a465a, 0xc3f16ea8), TOBN(0x115a461d, 0xb2f1d11c), + TOBN(0x4767dd95, 0x6c68a172), TOBN(0x3392f2eb, 0xd13a4698)}, + {TOBN(0xc7a99ccd, 0xe526cdc7), TOBN(0x8e537fdc, 0x22292b81), + TOBN(0x76d8cf69, 0xa6d39198), TOBN(0xffc5ff43, 0x2446852d)}}, + {{TOBN(0x97b14f7e, 0xa90567e6), TOBN(0x513257b7, 0xb6ae5cb7), + TOBN(0x85454a3c, 0x9f10903d), TOBN(0xd8d2c9ad, 0x69bc3724)}, + {TOBN(0x38da9324, 0x6b29cb44), TOBN(0xb540a21d, 0x77c8cbac), + TOBN(0x9bbfe435, 0x01918e42), TOBN(0xfffa707a, 0x56c3614e)}}, + {{TOBN(0x0ce4e3f1, 0xd4e353b7), TOBN(0x062d8a14, 0xef46b0a0), + TOBN(0x6408d5ab, 0x574b73fd), TOBN(0xbc41d1c9, 0xd3273ffd)}, + {TOBN(0x3538e1e7, 0x6be77800), TOBN(0x71fe8b37, 0xc5655031), + TOBN(0x1cd91621, 0x6b9b331a), TOBN(0xad825d0b, 0xbb388f73)}}, + {{TOBN(0x56c2e05b, 0x1cb76219), TOBN(0x0ec0bf91, 0x71567e7e), + TOBN(0xe7076f86, 0x61c4c910), TOBN(0xd67b085b, 0xbabc04d9)}, + {TOBN(0x9fb90459, 0x5e93a96a), TOBN(0x7526c1ea, 0xfbdc249a), + TOBN(0x0d44d367, 0xecdd0bb7), TOBN(0x95399917, 0x9dc0d695)}}, + {{TOBN(0x61360ee9, 0x9e240d18), TOBN(0x057cdcac, 0xb4b94466), + TOBN(0xe7667cd1, 0x2fe5325c), TOBN(0x1fa297b5, 0x21974e3b)}, + {TOBN(0xfa4081e7, 0xdb083d76), TOBN(0x31993be6, 0xf206bd15), + TOBN(0x8949269b, 0x14c19f8c), TOBN(0x21468d72, 0xa9d92357)}}, + {{TOBN(0x2ccbc583, 0xa4c506ec), TOBN(0x957ed188, 0xd1acfe97), + TOBN(0x8baed833, 0x12f1aea2), TOBN(0xef2a6cb4, 0x8325362d)}, + {TOBN(0x130dde42, 0x8e195c43), TOBN(0xc842025a, 0x0e6050c6), + TOBN(0x2da972a7, 0x08686a5d), TOBN(0xb52999a1, 0xe508b4a8)}}, + {{TOBN(0xd9f090b9, 0x10a5a8bd), TOBN(0xca91d249, 0x096864da), + TOBN(0x8e6a93be, 0x3f67dbc1), TOBN(0xacae6fba, 0xf5f4764c)}, + {TOBN(0x1563c6e0, 0xd21411a0), TOBN(0x28fa787f, 0xda0a4ad8), + TOBN(0xd524491c, 0x908c8030), TOBN(0x1257ba0e, 0x4c795f07)}}, + {{TOBN(0x83f49167, 0xceca9754), TOBN(0x426d2cf6, 0x4b7939a0), + TOBN(0x2555e355, 0x723fd0bf), TOBN(0xa96e6d06, 0xc4f144e2)}, + {TOBN(0x4768a8dd, 0x87880e61), TOBN(0x15543815, 0xe508e4d5), + TOBN(0x09d7e772, 0xb1b65e15), TOBN(0x63439dd6, 0xac302fa0)}}, + {{TOBN(0xb93f802f, 0xc14e35c2), TOBN(0x71735b7c, 0x4341333c), + TOBN(0x03a25104, 0x16d4f362), TOBN(0x3f4d069b, 0xbf433c8e)}, + {TOBN(0x0d83ae01, 0xf78f5a7c), TOBN(0x50a8ffbe, 0x7c4eed07), + TOBN(0xc74f8906, 0x76e10f83), TOBN(0x7d080966, 0x9ddaf8e1)}}, + {{TOBN(0xb11df8e1, 0x698e04cc), TOBN(0x877be203, 0x169005c8), + TOBN(0x32749e8c, 0x4f3c6179), TOBN(0x2dbc9d0a, 0x7853fc05)}, + {TOBN(0x187d4f93, 0x9454d937), TOBN(0xe682ce9d, 0xb4800e1b), + TOBN(0xa9129ad8, 0x165e68e8), TOBN(0x0fe29735, 0xbe7f785b)}}, + {{TOBN(0x5303f40c, 0x5b9e02b7), TOBN(0xa37c9692, 0x35ee04e8), + TOBN(0x5f46cc20, 0x34d6632b), TOBN(0x55ef72b2, 0x96ac545b)}, + {TOBN(0xabec5c1f, 0x7b91b062), TOBN(0x0a79e1c7, 0xbb33e821), + TOBN(0xbb04b428, 0x3a9f4117), TOBN(0x0de1f28f, 0xfd2a475a)}}, + {{TOBN(0x31019ccf, 0x3a4434b4), TOBN(0xa3458111, 0x1a7954dc), + TOBN(0xa9dac80d, 0xe34972a7), TOBN(0xb043d054, 0x74f6b8dd)}, + {TOBN(0x021c319e, 0x11137b1a), TOBN(0x00a754ce, 0xed5cc03f), + TOBN(0x0aa2c794, 0xcbea5ad4), TOBN(0x093e67f4, 0x70c015b6)}}, + {{TOBN(0x72cdfee9, 0xc97e3f6b), TOBN(0xc10bcab4, 0xb6da7461), + TOBN(0x3b02d2fc, 0xb59806b9), TOBN(0x85185e89, 0xa1de6f47)}, + {TOBN(0x39e6931f, 0x0eb6c4d4), TOBN(0x4d4440bd, 0xd4fa5b04), + TOBN(0x5418786e, 0x34be7eb8), TOBN(0x6380e521, 0x9d7259bc)}}, + {{TOBN(0x20ac0351, 0xd598d710), TOBN(0x272c4166, 0xcb3a4da4), + TOBN(0xdb82fe1a, 0xca71de1f), TOBN(0x746e79f2, 0xd8f54b0f)}, + {TOBN(0x6e7fc736, 0x4b573e9b), TOBN(0x75d03f46, 0xfd4b5040), + TOBN(0x5c1cc36d, 0x0b98d87b), TOBN(0x513ba3f1, 0x1f472da1)}}, + {{TOBN(0x79d0af26, 0xabb177dd), TOBN(0xf82ab568, 0x7891d564), + TOBN(0x2b6768a9, 0x72232173), TOBN(0xefbb3bb0, 0x8c1f6619)}, + {TOBN(0xb29c11db, 0xa6d18358), TOBN(0x519e2797, 0xb0916d3a), + TOBN(0xd4dc18f0, 0x9188e290), TOBN(0x648e86e3, 0x98b0ca7f)}}, + {{TOBN(0x859d3145, 0x983c38b5), TOBN(0xb14f176c, 0x637abc8b), + TOBN(0x2793fb9d, 0xcaff7be6), TOBN(0xebe5a55f, 0x35a66a5a)}, + {TOBN(0x7cec1dcd, 0x9f87dc59), TOBN(0x7c595cd3, 0xfbdbf560), + TOBN(0x5b543b22, 0x26eb3257), TOBN(0x69080646, 0xc4c935fd)}}, + {{TOBN(0x7f2e4403, 0x81e9ede3), TOBN(0x243c3894, 0xcaf6df0a), + TOBN(0x7c605bb1, 0x1c073b11), TOBN(0xcd06a541, 0xba6a4a62)}, + {TOBN(0x29168949, 0x49d4e2e5), TOBN(0x33649d07, 0x4af66880), + TOBN(0xbfc0c885, 0xe9a85035), TOBN(0xb4e52113, 0xfc410f4b)}}, + {{TOBN(0xdca3b706, 0x78a6513b), TOBN(0x92ea4a2a, 0x9edb1943), + TOBN(0x02642216, 0xdb6e2dd8), TOBN(0x9b45d0b4, 0x9fd57894)}, + {TOBN(0x114e70db, 0xc69d11ae), TOBN(0x1477dd19, 0x4c57595f), + TOBN(0xbc2208b4, 0xec77c272), TOBN(0x95c5b4d7, 0xdb68f59c)}}, + {{TOBN(0xb8c4fc63, 0x42e532b7), TOBN(0x386ba422, 0x9ae35290), + TOBN(0xfb5dda42, 0xd201ecbc), TOBN(0x2353dc8b, 0xa0e38fd6)}, + {TOBN(0x9a0b85ea, 0x68f7e978), TOBN(0x96ec5682, 0x2ad6d11f), + TOBN(0x5e279d6c, 0xe5f6886d), TOBN(0xd3fe03cd, 0x3cb1914d)}}, + {{TOBN(0xfe541fa4, 0x7ea67c77), TOBN(0x952bd2af, 0xe3ea810c), + TOBN(0x791fef56, 0x8d01d374), TOBN(0xa3a1c621, 0x0f11336e)}, + {TOBN(0x5ad0d5a9, 0xc7ec6d79), TOBN(0xff7038af, 0x3225c342), + TOBN(0x003c6689, 0xbc69601b), TOBN(0x25059bc7, 0x45e8747d)}}, + {{TOBN(0xfa4965b2, 0xf2086fbf), TOBN(0xf6840ea6, 0x86916078), + TOBN(0xd7ac7620, 0x70081d6c), TOBN(0xe600da31, 0xb5328645)}, + {TOBN(0x01916f63, 0x529b8a80), TOBN(0xe80e4858, 0x2d7d6f3e), + TOBN(0x29eb0fe8, 0xd664ca7c), TOBN(0xf017637b, 0xe7b43b0c)}}, + {{TOBN(0x9a75c806, 0x76cb2566), TOBN(0x8f76acb1, 0xb24892d9), + TOBN(0x7ae7b9cc, 0x1f08fe45), TOBN(0x19ef7329, 0x6a4907d8)}, + {TOBN(0x2db4ab71, 0x5f228bf0), TOBN(0xf3cdea39, 0x817032d7), + TOBN(0x0b1f482e, 0xdcabe3c0), TOBN(0x3baf76b4, 0xbb86325c)}}, + {{TOBN(0xd49065e0, 0x10089465), TOBN(0x3bab5d29, 0x8e77c596), + TOBN(0x7636c3a6, 0x193dbd95), TOBN(0xdef5d294, 0xb246e499)}, + {TOBN(0xb22c58b9, 0x286b2475), TOBN(0xa0b93939, 0xcd80862b), + TOBN(0x3002c83a, 0xf0992388), TOBN(0x6de01f9b, 0xeacbe14c)}}, + {{TOBN(0x6aac688e, 0xadd70482), TOBN(0x708de92a, 0x7b4a4e8a), + TOBN(0x75b6dd73, 0x758a6eef), TOBN(0xea4bf352, 0x725b3c43)}, + {TOBN(0x10041f2c, 0x87912868), TOBN(0xb1b1be95, 0xef09297a), + TOBN(0x19ae23c5, 0xa9f3860a), TOBN(0xc4f0f839, 0x515dcf4b)}}, + {{TOBN(0x3c7ecca3, 0x97f6306a), TOBN(0x744c44ae, 0x68a3a4b0), + TOBN(0x69cd13a0, 0xb3a1d8a2), TOBN(0x7cad0a1e, 0x5256b578)}, + {TOBN(0xea653fcd, 0x33791d9e), TOBN(0x9cc2a05d, 0x74b2e05f), + TOBN(0x73b391dc, 0xfd7affa2), TOBN(0xddb7091e, 0xb6b05442)}}, + {{TOBN(0xc71e27bf, 0x8538a5c6), TOBN(0x195c63dd, 0x89abff17), + TOBN(0xfd315285, 0x1b71e3da), TOBN(0x9cbdfda7, 0xfa680fa0)}, + {TOBN(0x9db876ca, 0x849d7eab), TOBN(0xebe2764b, 0x3c273271), + TOBN(0x663357e3, 0xf208dcea), TOBN(0x8c5bd833, 0x565b1b70)}}, + {{TOBN(0xccc3b4f5, 0x9837fc0d), TOBN(0x9b641ba8, 0xa79cf00f), + TOBN(0x7428243d, 0xdfdf3990), TOBN(0x83a594c4, 0x020786b1)}, + {TOBN(0xb712451a, 0x526c4502), TOBN(0x9d39438e, 0x6adb3f93), + TOBN(0xfdb261e3, 0xe9ff0ccd), TOBN(0x80344e3c, 0xe07af4c3)}}, + {{TOBN(0x75900d7c, 0x2fa4f126), TOBN(0x08a3b865, 0x5c99a232), + TOBN(0x2478b6bf, 0xdb25e0c3), TOBN(0x482cc2c2, 0x71db2edf)}, + {TOBN(0x37df7e64, 0x5f321bb8), TOBN(0x8a93821b, 0x9a8005b4), + TOBN(0x3fa2f10c, 0xcc8c1958), TOBN(0x0d332218, 0x2c269d0a)}}, + {{TOBN(0x20ab8119, 0xe246b0e6), TOBN(0xb39781e4, 0xd349fd17), + TOBN(0xd293231e, 0xb31aa100), TOBN(0x4b779c97, 0xbb032168)}, + {TOBN(0x4b3f19e1, 0xc8470500), TOBN(0x45b7efe9, 0x0c4c869d), + TOBN(0xdb84f38a, 0xa1a6bbcc), TOBN(0x3b59cb15, 0xb2fddbc1)}}, + {{TOBN(0xba5514df, 0x3fd165e8), TOBN(0x499fd6a9, 0x061f8811), + TOBN(0x72cd1fe0, 0xbfef9f00), TOBN(0x120a4bb9, 0x79ad7e8a)}, + {TOBN(0xf2ffd095, 0x5f4a5ac5), TOBN(0xcfd174f1, 0x95a7a2f0), + TOBN(0xd42301ba, 0x9d17baf1), TOBN(0xd2fa487a, 0x77f22089)}}, + {{TOBN(0x9cb09efe, 0xb1dc77e1), TOBN(0xe9566939, 0x21c99682), + TOBN(0x8c546901, 0x6c6067bb), TOBN(0xfd378574, 0x61c24456)}, + {TOBN(0x2b6a6cbe, 0x81796b33), TOBN(0x62d550f6, 0x58e87f8b), + TOBN(0x1b763e1c, 0x7f1b01b4), TOBN(0x4b93cfea, 0x1b1b5e12)}}, + {{TOBN(0xb9345238, 0x1d531696), TOBN(0x57201c00, 0x88cdde69), + TOBN(0xdde92251, 0x9a86afc7), TOBN(0xe3043895, 0xbd35cea8)}, + {TOBN(0x7608c1e1, 0x8555970d), TOBN(0x8267dfa9, 0x2535935e), + TOBN(0xd4c60a57, 0x322ea38b), TOBN(0xe0bf7977, 0x804ef8b5)}}, + {{TOBN(0x1a0dab28, 0xc06fece4), TOBN(0xd405991e, 0x94e7b49d), + TOBN(0xc542b6d2, 0x706dab28), TOBN(0xcb228da3, 0xa91618fb)}, + {TOBN(0x224e4164, 0x107d1cea), TOBN(0xeb9fdab3, 0xd0f5d8f1), + TOBN(0xc02ba386, 0x0d6e41cd), TOBN(0x676a72c5, 0x9b1f7146)}}, + {{TOBN(0xffd6dd98, 0x4d6cb00b), TOBN(0xcef9c5ca, 0xde2e8d7c), + TOBN(0xa1bbf5d7, 0x641c7936), TOBN(0x1b95b230, 0xee8f772e)}, + {TOBN(0xf765a92e, 0xe8ac25b1), TOBN(0xceb04cfc, 0x3a18b7c6), + TOBN(0x27944cef, 0x0acc8966), TOBN(0xcbb3c957, 0x434c1004)}}, + {{TOBN(0x9c9971a1, 0xa43ff93c), TOBN(0x5bc2db17, 0xa1e358a9), + TOBN(0x45b4862e, 0xa8d9bc82), TOBN(0x70ebfbfb, 0x2201e052)}, + {TOBN(0xafdf64c7, 0x92871591), TOBN(0xea5bcae6, 0xb42d0219), + TOBN(0xde536c55, 0x2ad8f03c), TOBN(0xcd6c3f4d, 0xa76aa33c)}}, + {{TOBN(0xbeb5f623, 0x0bca6de3), TOBN(0xdd20dd99, 0xb1e706fd), + TOBN(0x90b3ff9d, 0xac9059d4), TOBN(0x2d7b2902, 0x7ccccc4e)}, + {TOBN(0x8a090a59, 0xce98840f), TOBN(0xa5d947e0, 0x8410680a), + TOBN(0x49ae346a, 0x923379a5), TOBN(0x7dbc84f9, 0xb28a3156)}}, + {{TOBN(0xfd40d916, 0x54a1aff2), TOBN(0xabf318ba, 0x3a78fb9b), + TOBN(0x50152ed8, 0x3029f95e), TOBN(0x9fc1dd77, 0xc58ad7fa)}, + {TOBN(0x5fa57915, 0x13595c17), TOBN(0xb9504668, 0x8f62b3a9), + TOBN(0x907b5b24, 0xff3055b0), TOBN(0x2e995e35, 0x9a84f125)}}, + {{TOBN(0x87dacf69, 0x7e9bbcfb), TOBN(0x95d0c1d6, 0xe86d96e3), + TOBN(0x65726e3c, 0x2d95a75c), TOBN(0x2c3c9001, 0xacd27f21)}, + {TOBN(0x1deab561, 0x6c973f57), TOBN(0x108b7e2c, 0xa5221643), + TOBN(0x5fee9859, 0xc4ef79d4), TOBN(0xbd62b88a, 0x40d4b8c6)}}, + {{TOBN(0xb4dd29c4, 0x197c75d6), TOBN(0x266a6df2, 0xb7076feb), + TOBN(0x9512d0ea, 0x4bf2df11), TOBN(0x1320c24f, 0x6b0cc9ec)}, + {TOBN(0x6bb1e0e1, 0x01a59596), TOBN(0x8317c5bb, 0xeff9aaac), + TOBN(0x65bb405e, 0x385aa6c9), TOBN(0x613439c1, 0x8f07988f)}}, + {{TOBN(0xd730049f, 0x16a66e91), TOBN(0xe97f2820, 0xfa1b0e0d), + TOBN(0x4131e003, 0x304c28ea), TOBN(0x820ab732, 0x526bac62)}, + {TOBN(0xb2ac9ef9, 0x28714423), TOBN(0x54ecfffa, 0xadb10cb2), + TOBN(0x8781476e, 0xf886a4cc), TOBN(0x4b2c87b5, 0xdb2f8d49)}}, + {{TOBN(0xe857cd20, 0x0a44295d), TOBN(0x707d7d21, 0x58c6b044), + TOBN(0xae8521f9, 0xf596757c), TOBN(0x87448f03, 0x67b2b714)}, + {TOBN(0x13a9bc45, 0x5ebcd58d), TOBN(0x79bcced9, 0x9122d3c1), + TOBN(0x3c644247, 0x9e076642), TOBN(0x0cf22778, 0x2df4767d)}}, + {{TOBN(0x5e61aee4, 0x71d444b6), TOBN(0x211236bf, 0xc5084a1d), + TOBN(0x7e15bc9a, 0x4fd3eaf6), TOBN(0x68df2c34, 0xab622bf5)}, + {TOBN(0x9e674f0f, 0x59bf4f36), TOBN(0xf883669b, 0xd7f34d73), + TOBN(0xc48ac1b8, 0x31497b1d), TOBN(0x323b925d, 0x5106703b)}}, + {{TOBN(0x22156f42, 0x74082008), TOBN(0xeffc521a, 0xc8482bcb), + TOBN(0x5c6831bf, 0x12173479), TOBN(0xcaa2528f, 0xc4739490)}, + {TOBN(0x84d2102a, 0x8f1b3c4d), TOBN(0xcf64dfc1, 0x2d9bec0d), + TOBN(0x433febad, 0x78a546ef), TOBN(0x1f621ec3, 0x7b73cef1)}}, + {{TOBN(0x6aecd627, 0x37338615), TOBN(0x162082ab, 0x01d8edf6), + TOBN(0x833a8119, 0x19e86b66), TOBN(0x6023a251, 0xd299b5db)}, + {TOBN(0xf5bb0c3a, 0xbbf04b89), TOBN(0x6735eb69, 0xae749a44), + TOBN(0xd0e058c5, 0x4713de3b), TOBN(0xfdf2593e, 0x2c3d4ccd)}}, + {{TOBN(0x1b8f414e, 0xfdd23667), TOBN(0xdd52aaca, 0xfa2015ee), + TOBN(0x3e31b517, 0xbd9625ff), TOBN(0x5ec9322d, 0x8db5918c)}, + {TOBN(0xbc73ac85, 0xa96f5294), TOBN(0x82aa5bf3, 0x61a0666a), + TOBN(0x49755810, 0xbf08ac42), TOBN(0xd21cdfd5, 0x891cedfc)}}, + {{TOBN(0x918cb57b, 0x67f8be10), TOBN(0x365d1a7c, 0x56ffa726), + TOBN(0x2435c504, 0x6532de93), TOBN(0xc0fc5e10, 0x2674cd02)}, + {TOBN(0x6e51fcf8, 0x9cbbb142), TOBN(0x1d436e5a, 0xafc50692), + TOBN(0x766bffff, 0x3fbcae22), TOBN(0x3148c2fd, 0xfd55d3b8)}}, + {{TOBN(0x52c7fdc9, 0x233222fa), TOBN(0x89ff1092, 0xe419fb6b), + TOBN(0x3cd6db99, 0x25254977), TOBN(0x2e85a161, 0x1cf12ca7)}, + {TOBN(0xadd2547c, 0xdc810bc9), TOBN(0xea3f458f, 0x9d257c22), + TOBN(0x642c1fbe, 0x27d6b19b), TOBN(0xed07e6b5, 0x140481a6)}}, + {{TOBN(0x6ada1d42, 0x86d2e0f8), TOBN(0xe5920122, 0x0e8a9fd5), + TOBN(0x02c936af, 0x708c1b49), TOBN(0x60f30fee, 0x2b4bfaff)}, + {TOBN(0x6637ad06, 0x858e6a61), TOBN(0xce4c7767, 0x3fd374d0), + TOBN(0x39d54b2d, 0x7188defb), TOBN(0xa8c9d250, 0xf56a6b66)}}, + {{TOBN(0x58fc0f5e, 0xb24fe1dc), TOBN(0x9eaf9dee, 0x6b73f24c), + TOBN(0xa90d588b, 0x33650705), TOBN(0xde5b62c5, 0xaf2ec729)}, + {TOBN(0x5c72cfae, 0xd3c2b36e), TOBN(0x868c19d5, 0x034435da), + TOBN(0x88605f93, 0xe17ee145), TOBN(0xaa60c4ee, 0x77a5d5b1)}}, + {{TOBN(0xbcf5bfd2, 0x3b60c472), TOBN(0xaf4ef13c, 0xeb1d3049), + TOBN(0x373f44fc, 0xe13895c9), TOBN(0xf29b382f, 0x0cbc9822)}, + {TOBN(0x1bfcb853, 0x73efaef6), TOBN(0xcf56ac9c, 0xa8c96f40), + TOBN(0xd7adf109, 0x7a191e24), TOBN(0x98035f44, 0xbf8a8dc2)}}, + {{TOBN(0xf40a71b9, 0x1e750c84), TOBN(0xc57f7b0c, 0x5dc6c469), + TOBN(0x49a0e79c, 0x6fbc19c1), TOBN(0x6b0f5889, 0xa48ebdb8)}, + {TOBN(0x5d3fd084, 0xa07c4e9f), TOBN(0xc3830111, 0xab27de14), + TOBN(0x0e4929fe, 0x33e08dcc), TOBN(0xf4a5ad24, 0x40bb73a3)}}, + {{TOBN(0xde86c2bf, 0x490f97ca), TOBN(0x288f09c6, 0x67a1ce18), + TOBN(0x364bb886, 0x1844478d), TOBN(0x7840fa42, 0xceedb040)}, + {TOBN(0x1269fdd2, 0x5a631b37), TOBN(0x94761f1e, 0xa47c8b7d), + TOBN(0xfc0c2e17, 0x481c6266), TOBN(0x85e16ea2, 0x3daa5fa7)}}, + {{TOBN(0xccd86033, 0x92491048), TOBN(0x0c2f6963, 0xf4d402d7), + TOBN(0x6336f7df, 0xdf6a865c), TOBN(0x0a2a463c, 0xb5c02a87)}, + {TOBN(0xb0e29be7, 0xbf2f12ee), TOBN(0xf0a22002, 0x66bad988), + TOBN(0x27f87e03, 0x9123c1d7), TOBN(0x21669c55, 0x328a8c98)}}, + {{TOBN(0x186b9803, 0x92f14529), TOBN(0xd3d056cc, 0x63954df3), + TOBN(0x2f03fd58, 0x175a46f6), TOBN(0x63e34ebe, 0x11558558)}, + {TOBN(0xe13fedee, 0x5b80cfa5), TOBN(0xe872a120, 0xd401dbd1), + TOBN(0x52657616, 0xe8a9d667), TOBN(0xbc8da4b6, 0xe08d6693)}}, + {{TOBN(0x370fb9bb, 0x1b703e75), TOBN(0x6773b186, 0xd4338363), + TOBN(0x18dad378, 0xecef7bff), TOBN(0xaac787ed, 0x995677da)}, + {TOBN(0x4801ea8b, 0x0437164b), TOBN(0xf430ad20, 0x73fe795e), + TOBN(0xb164154d, 0x8ee5eb73), TOBN(0x0884ecd8, 0x108f7c0e)}}, + {{TOBN(0x0e6ec096, 0x5f520698), TOBN(0x640631fe, 0x44f7b8d9), + TOBN(0x92fd34fc, 0xa35a68b9), TOBN(0x9c5a4b66, 0x4d40cf4e)}, + {TOBN(0x949454bf, 0x80b6783d), TOBN(0x80e701fe, 0x3a320a10), + TOBN(0x8d1a564a, 0x1a0a39b2), TOBN(0x1436d53d, 0x320587db)}}, + {{TOBN(0xf5096e6d, 0x6556c362), TOBN(0xbc23a3c0, 0xe2455d7e), + TOBN(0x3a7aee54, 0x807230f9), TOBN(0x9ba1cfa6, 0x22ae82fd)}, + {TOBN(0x833a057a, 0x99c5d706), TOBN(0x8be85f4b, 0x842315c9), + TOBN(0xd083179a, 0x66a72f12), TOBN(0x2fc77d5d, 0xcdcc73cd)}}, + {{TOBN(0x22b88a80, 0x5616ee30), TOBN(0xfb09548f, 0xe7ab1083), + TOBN(0x8ad6ab0d, 0x511270cd), TOBN(0x61f6c57a, 0x6924d9ab)}, + {TOBN(0xa0f7bf72, 0x90aecb08), TOBN(0x849f87c9, 0x0df784a4), + TOBN(0x27c79c15, 0xcfaf1d03), TOBN(0xbbf9f675, 0xc463face)}}, + {{TOBN(0x91502c65, 0x765ba543), TOBN(0x18ce3cac, 0x42ea60dd), + TOBN(0xe5cee6ac, 0x6e43ecb3), TOBN(0x63e4e910, 0x68f2aeeb)}, + {TOBN(0x26234fa3, 0xc85932ee), TOBN(0x96883e8b, 0x4c90c44d), + TOBN(0x29b9e738, 0xa18a50f6), TOBN(0xbfc62b2a, 0x3f0420df)}}, + {{TOBN(0xd22a7d90, 0x6d3e1fa9), TOBN(0x17115618, 0xfe05b8a3), + TOBN(0x2a0c9926, 0xbb2b9c01), TOBN(0xc739fcc6, 0xe07e76a2)}, + {TOBN(0x540e9157, 0x165e439a), TOBN(0x06353a62, 0x6a9063d8), + TOBN(0x84d95594, 0x61e927a3), TOBN(0x013b9b26, 0xe2e0be7f)}}, + {{TOBN(0x4feaec3b, 0x973497f1), TOBN(0x15c0f94e, 0x093ebc2d), + TOBN(0x6af5f227, 0x33af0583), TOBN(0x0c2af206, 0xc61f3340)}, + {TOBN(0xd25dbdf1, 0x4457397c), TOBN(0x2e8ed017, 0xcabcbae0), + TOBN(0xe3010938, 0xc2815306), TOBN(0xbaa99337, 0xe8c6cd68)}}, + {{TOBN(0x08513182, 0x3b0ec7de), TOBN(0x1e1b822b, 0x58df05df), + TOBN(0x5c14842f, 0xa5c3b683), TOBN(0x98fe977e, 0x3eba34ce)}, + {TOBN(0xfd2316c2, 0x0d5e8873), TOBN(0xe48d839a, 0xbd0d427d), + TOBN(0x495b2218, 0x623fc961), TOBN(0x24ee56e7, 0xb46fba5e)}}, + {{TOBN(0x9184a55b, 0x91e4de58), TOBN(0xa7488ca5, 0xdfdea288), + TOBN(0xa723862e, 0xa8dcc943), TOBN(0x92d762b2, 0x849dc0fc)}, + {TOBN(0x3c444a12, 0x091ff4a9), TOBN(0x581113fa, 0x0cada274), + TOBN(0xb9de0a45, 0x30d8eae2), TOBN(0x5e0fcd85, 0xdf6b41ea)}}, + {{TOBN(0x6233ea68, 0xc094dbb5), TOBN(0xb77d062e, 0xd968d410), + TOBN(0x3e719bbc, 0x58b3002d), TOBN(0x68e7dd3d, 0x3dc49d58)}, + {TOBN(0x8d825740, 0x013a5e58), TOBN(0x21311747, 0x3c9e3c1b), + TOBN(0x0cb0a2a7, 0x7c99b6ab), TOBN(0x5c48a3b3, 0xc2f888f2)}}}, + {{{TOBN(0xc7913e91, 0x991724f3), TOBN(0x5eda799c, 0x39cbd686), + TOBN(0xddb595c7, 0x63d4fc1e), TOBN(0x6b63b80b, 0xac4fed54)}, + {TOBN(0x6ea0fc69, 0x7e5fb516), TOBN(0x737708ba, 0xd0f1c964), + TOBN(0x9628745f, 0x11a92ca5), TOBN(0x61f37958, 0x9a86967a)}}, + {{TOBN(0x9af39b2c, 0xaa665072), TOBN(0x78322fa4, 0xefd324ef), + TOBN(0x3d153394, 0xc327bd31), TOBN(0x81d5f271, 0x3129dab0)}, + {TOBN(0xc72e0c42, 0xf48027f5), TOBN(0xaa40cdbc, 0x8536e717), + TOBN(0xf45a657a, 0x2d369d0f), TOBN(0xb03bbfc4, 0xea7f74e6)}}, + {{TOBN(0x46a8c418, 0x0d738ded), TOBN(0x6f1a5bb0, 0xe0de5729), + TOBN(0xf10230b9, 0x8ba81675), TOBN(0x32c6f30c, 0x112b33d4)}, + {TOBN(0x7559129d, 0xd8fffb62), TOBN(0x6a281b47, 0xb459bf05), + TOBN(0x77c1bd3a, 0xfa3b6776), TOBN(0x0709b380, 0x7829973a)}}, + {{TOBN(0x8c26b232, 0xa3326505), TOBN(0x38d69272, 0xee1d41bf), + TOBN(0x0459453e, 0xffe32afa), TOBN(0xce8143ad, 0x7cb3ea87)}, + {TOBN(0x932ec1fa, 0x7e6ab666), TOBN(0x6cd2d230, 0x22286264), + TOBN(0x459a46fe, 0x6736f8ed), TOBN(0x50bf0d00, 0x9eca85bb)}}, + {{TOBN(0x0b825852, 0x877a21ec), TOBN(0x300414a7, 0x0f537a94), + TOBN(0x3f1cba40, 0x21a9a6a2), TOBN(0x50824eee, 0x76943c00)}, + {TOBN(0xa0dbfcec, 0xf83cba5d), TOBN(0xf9538148, 0x93b4f3c0), + TOBN(0x61744162, 0x48f24dd7), TOBN(0x5322d64d, 0xe4fb09dd)}}, + {{TOBN(0x57447384, 0x3d9325f3), TOBN(0xa9bef2d0, 0xf371cb84), + TOBN(0x77d2188b, 0xa61e36c5), TOBN(0xbbd6a7d7, 0xc602df72)}, + {TOBN(0xba3aa902, 0x8f61bc0b), TOBN(0xf49085ed, 0x6ed0b6a1), + TOBN(0x8bc625d6, 0xae6e8298), TOBN(0x832b0b1d, 0xa2e9c01d)}}, + {{TOBN(0xa337c447, 0xf1f0ced1), TOBN(0x800cc793, 0x9492dd2b), + TOBN(0x4b93151d, 0xbea08efa), TOBN(0x820cf3f8, 0xde0a741e)}, + {TOBN(0xff1982dc, 0x1c0f7d13), TOBN(0xef921960, 0x84dde6ca), + TOBN(0x1ad7d972, 0x45f96ee3), TOBN(0x319c8dbe, 0x29dea0c7)}}, + {{TOBN(0xd3ea3871, 0x7b82b99b), TOBN(0x75922d4d, 0x470eb624), + TOBN(0x8f66ec54, 0x3b95d466), TOBN(0x66e673cc, 0xbee1e346)}, + {TOBN(0x6afe67c4, 0xb5f2b89a), TOBN(0x3de9c1e6, 0x290e5cd3), + TOBN(0x8c278bb6, 0x310a2ada), TOBN(0x420fa384, 0x0bdb323b)}}, + {{TOBN(0x0ae1d63b, 0x0eb919b0), TOBN(0xd74ee51d, 0xa74b9620), + TOBN(0x395458d0, 0xa674290c), TOBN(0x324c930f, 0x4620a510)}, + {TOBN(0x2d1f4d19, 0xfbac27d4), TOBN(0x4086e8ca, 0x9bedeeac), + TOBN(0x0cdd211b, 0x9b679ab8), TOBN(0x5970167d, 0x7090fec4)}}, + {{TOBN(0x3420f2c9, 0xfaf1fc63), TOBN(0x616d333a, 0x328c8bb4), + TOBN(0x7d65364c, 0x57f1fe4a), TOBN(0x9343e877, 0x55e5c73a)}, + {TOBN(0x5795176b, 0xe970e78c), TOBN(0xa36ccebf, 0x60533627), + TOBN(0xfc7c7380, 0x09cdfc1b), TOBN(0xb39a2afe, 0xb3fec326)}}, + {{TOBN(0xb7ff1ba1, 0x6224408a), TOBN(0xcc856e92, 0x247cfc5e), + TOBN(0x01f102e7, 0xc18bc493), TOBN(0x4613ab74, 0x2091c727)}, + {TOBN(0xaa25e89c, 0xc420bf2b), TOBN(0x00a53176, 0x90337ec2), + TOBN(0xd2be9f43, 0x7d025fc7), TOBN(0x3316fb85, 0x6e6fe3dc)}}, + {{TOBN(0x27520af5, 0x9ac50814), TOBN(0xfdf95e78, 0x9a8e4223), + TOBN(0xb7e7df2a, 0x56bec5a0), TOBN(0xf7022f7d, 0xdf159e5d)}, + {TOBN(0x93eeeab1, 0xcac1fe8f), TOBN(0x8040188c, 0x37451168), + TOBN(0x7ee8aa8a, 0xd967dce6), TOBN(0xfa0e79e7, 0x3abc9299)}}, + {{TOBN(0x67332cfc, 0x2064cfd1), TOBN(0x339c31de, 0xb0651934), + TOBN(0x719b28d5, 0x2a3bcbea), TOBN(0xee74c82b, 0x9d6ae5c6)}, + {TOBN(0x0927d05e, 0xbaf28ee6), TOBN(0x82cecf2c, 0x9d719028), + TOBN(0x0b0d353e, 0xddb30289), TOBN(0xfe4bb977, 0xfddb2e29)}}, + {{TOBN(0xbb5bb990, 0x640bfd9e), TOBN(0xd226e277, 0x82f62108), + TOBN(0x4bf00985, 0x02ffdd56), TOBN(0x7756758a, 0x2ca1b1b5)}, + {TOBN(0xc32b62a3, 0x5285fe91), TOBN(0xedbc546a, 0x8c9cd140), + TOBN(0x1e47a013, 0xaf5cb008), TOBN(0xbca7e720, 0x073ce8f2)}}, + {{TOBN(0xe10b2ab8, 0x17a91cae), TOBN(0xb89aab65, 0x08e27f63), + TOBN(0x7b3074a7, 0xdba3ddf9), TOBN(0x1c20ce09, 0x330c2972)}, + {TOBN(0x6b9917b4, 0x5fcf7e33), TOBN(0xe6793743, 0x945ceb42), + TOBN(0x18fc2215, 0x5c633d19), TOBN(0xad1adb3c, 0xc7485474)}}, + {{TOBN(0x646f9679, 0x6424c49b), TOBN(0xf888dfe8, 0x67c241c9), + TOBN(0xe12d4b93, 0x24f68b49), TOBN(0x9a6b62d8, 0xa571df20)}, + {TOBN(0x81b4b26d, 0x179483cb), TOBN(0x666f9632, 0x9511fae2), + TOBN(0xd281b3e4, 0xd53aa51f), TOBN(0x7f96a765, 0x7f3dbd16)}}, + {{TOBN(0xa7f8b5bf, 0x074a30ce), TOBN(0xd7f52107, 0x005a32e6), + TOBN(0x6f9e0907, 0x50237ed4), TOBN(0x2f21da47, 0x8096fa2b)}, + {TOBN(0xf3e19cb4, 0xeec863a0), TOBN(0xd18f77fd, 0x9527620a), + TOBN(0x9505c81c, 0x407c1cf8), TOBN(0x9998db4e, 0x1b6ec284)}}, + {{TOBN(0x7e3389e5, 0xc247d44d), TOBN(0x12507141, 0x3f4f3d80), + TOBN(0xd4ba0110, 0x4a78a6c7), TOBN(0x312874a0, 0x767720be)}, + {TOBN(0xded059a6, 0x75944370), TOBN(0xd6123d90, 0x3b2c0bdd), + TOBN(0xa56b717b, 0x51c108e3), TOBN(0x9bb7940e, 0x070623e9)}}, + {{TOBN(0x794e2d59, 0x84ac066c), TOBN(0xf5954a92, 0xe68c69a0), + TOBN(0x28c52458, 0x4fd99dcc), TOBN(0x60e639fc, 0xb1012517)}, + {TOBN(0xc2e60125, 0x7de79248), TOBN(0xe9ef6404, 0xf12fc6d7), + TOBN(0x4c4f2808, 0x2a3b5d32), TOBN(0x865ad32e, 0xc768eb8a)}}, + {{TOBN(0xac02331b, 0x13fb70b6), TOBN(0x037b44c1, 0x95599b27), + TOBN(0x1a860fc4, 0x60bd082c), TOBN(0xa2e25745, 0xc980cd01)}, + {TOBN(0xee3387a8, 0x1da0263e), TOBN(0x931bfb95, 0x2d10f3d6), + TOBN(0x5b687270, 0xa1f24a32), TOBN(0xf140e65d, 0xca494b86)}}, + {{TOBN(0x4f4ddf91, 0xb2f1ac7a), TOBN(0xf99eaabb, 0x760fee27), + TOBN(0x57f4008a, 0x49c228e5), TOBN(0x090be440, 0x1cf713bb)}, + {TOBN(0xac91fbe4, 0x5004f022), TOBN(0xd838c2c2, 0x569e1af6), + TOBN(0xd6c7d20b, 0x0f1daaa5), TOBN(0xaa063ac1, 0x1bbb02c0)}}, + {{TOBN(0x0938a422, 0x59558a78), TOBN(0x5343c669, 0x8435da2f), + TOBN(0x96f67b18, 0x034410dc), TOBN(0x7cc1e424, 0x84510804)}, + {TOBN(0x86a1543f, 0x16dfbb7d), TOBN(0x921fa942, 0x5b5bd592), + TOBN(0x9dcccb6e, 0xb33dd03c), TOBN(0x8581ddd9, 0xb843f51e)}}, + {{TOBN(0x54935fcb, 0x81d73c9e), TOBN(0x6d07e979, 0x0a5e97ab), + TOBN(0x4dc7b30a, 0xcf3a6bab), TOBN(0x147ab1f3, 0x170bee11)}, + {TOBN(0x0aaf8e3d, 0x9fafdee4), TOBN(0xfab3dbcb, 0x538a8b95), + TOBN(0x405df4b3, 0x6ef13871), TOBN(0xf1f4e9cb, 0x088d5a49)}}, + {{TOBN(0x9bcd24d3, 0x66b33f1d), TOBN(0x3b97b820, 0x5ce445c0), + TOBN(0xe2926549, 0xba93ff61), TOBN(0xd9c341ce, 0x4dafe616)}, + {TOBN(0xfb30a76e, 0x16efb6f3), TOBN(0xdf24b8ca, 0x605b953c), + TOBN(0x8bd52afe, 0xc2fffb9f), TOBN(0xbbac5ff7, 0xe19d0b96)}}, + {{TOBN(0x43c01b87, 0x459afccd), TOBN(0x6bd45143, 0xb7432652), + TOBN(0x84734530, 0x55b5d78e), TOBN(0x81088fdb, 0x1554ba7d)}, + {TOBN(0xada0a52c, 0x1e269375), TOBN(0xf9f037c4, 0x2dc5ec10), + TOBN(0xc0660607, 0x94bfbc11), TOBN(0xc0a630bb, 0xc9c40d2f)}}, + {{TOBN(0x5efc797e, 0xab64c31e), TOBN(0xffdb1dab, 0x74507144), + TOBN(0xf6124287, 0x1ca6790c), TOBN(0xe9609d81, 0xe69bf1bf)}, + {TOBN(0xdb898595, 0x00d24fc9), TOBN(0x9c750333, 0xe51fb417), + TOBN(0x51830a91, 0xfef7bbde), TOBN(0x0ce67dc8, 0x945f585c)}}, + {{TOBN(0x9a730ed4, 0x4763eb50), TOBN(0x24a0e221, 0xc1ab0d66), + TOBN(0x643b6393, 0x648748f3), TOBN(0x1982daa1, 0x6d3c6291)}, + {TOBN(0x6f00a9f7, 0x8bbc5549), TOBN(0x7a1783e1, 0x7f36384e), + TOBN(0xe8346323, 0xde977f50), TOBN(0x91ab688d, 0xb245502a)}}, + {{TOBN(0x331ab6b5, 0x6d0bdd66), TOBN(0x0a6ef32e, 0x64b71229), + TOBN(0x1028150e, 0xfe7c352f), TOBN(0x27e04350, 0xce7b39d3)}, + {TOBN(0x2a3c8acd, 0xc1070c82), TOBN(0xfb2034d3, 0x80c9feef), + TOBN(0x2d729621, 0x709f3729), TOBN(0x8df290bf, 0x62cb4549)}}, + {{TOBN(0x02f99f33, 0xfc2e4326), TOBN(0x3b30076d, 0x5eddf032), + TOBN(0xbb21f8cf, 0x0c652fb5), TOBN(0x314fb49e, 0xed91cf7b)}, + {TOBN(0xa013eca5, 0x2f700750), TOBN(0x2b9e3c23, 0x712a4575), + TOBN(0xe5355557, 0xaf30fbb0), TOBN(0x1ada3516, 0x7c77e771)}}, + {{TOBN(0x45f6ecb2, 0x7b135670), TOBN(0xe85d19df, 0x7cfc202e), + TOBN(0x0f1b50c7, 0x58d1be9f), TOBN(0x5ebf2c0a, 0xead2e344)}, + {TOBN(0x1531fe4e, 0xabc199c9), TOBN(0xc7032592, 0x56bab0ae), + TOBN(0x16ab2e48, 0x6c1fec54), TOBN(0x0f87fda8, 0x04280188)}}, + {{TOBN(0xdc9f46fc, 0x609e4a74), TOBN(0x2a44a143, 0xba667f91), + TOBN(0xbc3d8b95, 0xb4d83436), TOBN(0xa01e4bd0, 0xc7bd2958)}, + {TOBN(0x7b182932, 0x73483c90), TOBN(0xa79c6aa1, 0xa7c7b598), + TOBN(0xbf3983c6, 0xeaaac07e), TOBN(0x8f18181e, 0x96e0d4e6)}}, + {{TOBN(0x8553d37c, 0x051af62b), TOBN(0xe9a998eb, 0x0bf94496), + TOBN(0xe0844f9f, 0xb0d59aa1), TOBN(0x983fd558, 0xe6afb813)}, + {TOBN(0x9670c0ca, 0x65d69804), TOBN(0x732b22de, 0x6ea5ff2d), + TOBN(0xd7640ba9, 0x5fd8623b), TOBN(0x9f619163, 0xa6351782)}}, + {{TOBN(0x0bfc27ee, 0xacee5043), TOBN(0xae419e73, 0x2eb10f02), + TOBN(0x19c028d1, 0x8943fb05), TOBN(0x71f01cf7, 0xff13aa2a)}, + {TOBN(0x7790737e, 0x8887a132), TOBN(0x67513309, 0x66318410), + TOBN(0x9819e8a3, 0x7ddb795e), TOBN(0xfecb8ef5, 0xdad100b2)}}, + {{TOBN(0x59f74a22, 0x3021926a), TOBN(0xb7c28a49, 0x6f9b4c1c), + TOBN(0xed1a733f, 0x912ad0ab), TOBN(0x42a910af, 0x01a5659c)}, + {TOBN(0x3842c6e0, 0x7bd68cab), TOBN(0x2b57fa38, 0x76d70ac8), + TOBN(0x8a6707a8, 0x3c53aaeb), TOBN(0x62c1c510, 0x65b4db18)}}, + {{TOBN(0x8de2c1fb, 0xb2d09dc7), TOBN(0xc3dfed12, 0x266bd23b), + TOBN(0x927d039b, 0xd5b27db6), TOBN(0x2fb2f0f1, 0x103243da)}, + {TOBN(0xf855a07b, 0x80be7399), TOBN(0xed9327ce, 0x1f9f27a8), + TOBN(0xa0bd99c7, 0x729bdef7), TOBN(0x2b67125e, 0x28250d88)}}, + {{TOBN(0x784b26e8, 0x8670ced7), TOBN(0xe3dfe41f, 0xc31bd3b4), + TOBN(0x9e353a06, 0xbcc85cbc), TOBN(0x302e2909, 0x60178a9d)}, + {TOBN(0x860abf11, 0xa6eac16e), TOBN(0x76447000, 0xaa2b3aac), + TOBN(0x46ff9d19, 0x850afdab), TOBN(0x35bdd6a5, 0xfdb2d4c1)}}, + {{TOBN(0xe82594b0, 0x7e5c9ce9), TOBN(0x0f379e53, 0x20af346e), + TOBN(0x608b31e3, 0xbc65ad4a), TOBN(0x710c6b12, 0x267c4826)}, + {TOBN(0x51c966f9, 0x71954cf1), TOBN(0xb1cec793, 0x0d0aa215), + TOBN(0x1f155989, 0x86bd23a8), TOBN(0xae2ff99c, 0xf9452e86)}}, + {{TOBN(0xd8dd953c, 0x340ceaa2), TOBN(0x26355275, 0x2e2e9333), + TOBN(0x15d4e5f9, 0x8586f06d), TOBN(0xd6bf94a8, 0xf7cab546)}, + {TOBN(0x33c59a0a, 0xb76a9af0), TOBN(0x52740ab3, 0xba095af7), + TOBN(0xc444de8a, 0x24389ca0), TOBN(0xcc6f9863, 0x706da0cb)}}, + {{TOBN(0xb5a741a7, 0x6b2515cf), TOBN(0x71c41601, 0x9585c749), + TOBN(0x78350d4f, 0xe683de97), TOBN(0x31d61524, 0x63d0b5f5)}, + {TOBN(0x7a0cc5e1, 0xfbce090b), TOBN(0xaac927ed, 0xfbcb2a5b), + TOBN(0xe920de49, 0x20d84c35), TOBN(0x8c06a0b6, 0x22b4de26)}}, + {{TOBN(0xd34dd58b, 0xafe7ddf3), TOBN(0x55851fed, 0xc1e6e55b), + TOBN(0xd1395616, 0x960696e7), TOBN(0x940304b2, 0x5f22705f)}, + {TOBN(0x6f43f861, 0xb0a2a860), TOBN(0xcf121282, 0x0e7cc981), + TOBN(0x12186212, 0x0ab64a96), TOBN(0x09215b9a, 0xb789383c)}}, + {{TOBN(0x311eb305, 0x37387c09), TOBN(0xc5832fce, 0xf03ee760), + TOBN(0x30358f58, 0x32f7ea19), TOBN(0xe01d3c34, 0x91d53551)}, + {TOBN(0x1ca5ee41, 0xda48ea80), TOBN(0x34e71e8e, 0xcf4fa4c1), + TOBN(0x312abd25, 0x7af1e1c7), TOBN(0xe3afcdeb, 0x2153f4a5)}}, + {{TOBN(0x9d5c84d7, 0x00235e9a), TOBN(0x0308d3f4, 0x8c4c836f), + TOBN(0xc0a66b04, 0x89332de5), TOBN(0x610dd399, 0x89e566ef)}, + {TOBN(0xf8eea460, 0xd1ac1635), TOBN(0x84cbb3fb, 0x20a2c0df), + TOBN(0x40afb488, 0xe74a48c5), TOBN(0x29738198, 0xd326b150)}}, + {{TOBN(0x2a17747f, 0xa6d74081), TOBN(0x60ea4c05, 0x55a26214), + TOBN(0x53514bb4, 0x1f88c5fe), TOBN(0xedd64567, 0x7e83426c)}, + {TOBN(0xd5d6cbec, 0x96460b25), TOBN(0xa12fd0ce, 0x68dc115e), + TOBN(0xc5bc3ed2, 0x697840ea), TOBN(0x969876a8, 0xa6331e31)}}, + {{TOBN(0x60c36217, 0x472ff580), TOBN(0xf4229705, 0x4ad41393), + TOBN(0x4bd99ef0, 0xa03b8b92), TOBN(0x501c7317, 0xc144f4f6)}, + {TOBN(0x159009b3, 0x18464945), TOBN(0x6d5e594c, 0x74c5c6be), + TOBN(0x2d587011, 0x321a3660), TOBN(0xd1e184b1, 0x3898d022)}}, + {{TOBN(0x5ba04752, 0x4c6a7e04), TOBN(0x47fa1e2b, 0x45550b65), + TOBN(0x9419daf0, 0x48c0a9a5), TOBN(0x66362953, 0x7c243236)}, + {TOBN(0xcd0744b1, 0x5cb12a88), TOBN(0x561b6f9a, 0x2b646188), + TOBN(0x599415a5, 0x66c2c0c0), TOBN(0xbe3f0859, 0x0f83f09a)}}, + {{TOBN(0x9141c5be, 0xb92041b8), TOBN(0x01ae38c7, 0x26477d0d), + TOBN(0xca8b71f3, 0xd12c7a94), TOBN(0xfab5b31f, 0x765c70db)}, + {TOBN(0x76ae7492, 0x487443e9), TOBN(0x8595a310, 0x990d1349), + TOBN(0xf8dbeda8, 0x7d460a37), TOBN(0x7f7ad082, 0x1e45a38f)}}, + {{TOBN(0xed1d4db6, 0x1059705a), TOBN(0xa3dd492a, 0xe6b9c697), + TOBN(0x4b92ee3a, 0x6eb38bd5), TOBN(0xbab2609d, 0x67cc0bb7)}, + {TOBN(0x7fc4fe89, 0x6e70ee82), TOBN(0xeff2c56e, 0x13e6b7e3), + TOBN(0x9b18959e, 0x34d26fca), TOBN(0x2517ab66, 0x889d6b45)}}, + {{TOBN(0xf167b4e0, 0xbdefdd4f), TOBN(0x69958465, 0xf366e401), + TOBN(0x5aa368ab, 0xa73bbec0), TOBN(0x12148709, 0x7b240c21)}, + {TOBN(0x378c3233, 0x18969006), TOBN(0xcb4d73ce, 0xe1fe53d1), + TOBN(0x5f50a80e, 0x130c4361), TOBN(0xd67f5951, 0x7ef5212b)}}, + {{TOBN(0xf145e21e, 0x9e70c72e), TOBN(0xb2e52e29, 0x5566d2fb), + TOBN(0x44eaba4a, 0x032397f5), TOBN(0x5e56937b, 0x7e31a7de)}, + {TOBN(0x68dcf517, 0x456c61e1), TOBN(0xbc2e954a, 0xa8b0a388), + TOBN(0xe3552fa7, 0x60a8b755), TOBN(0x03442dae, 0x73ad0cde)}}, + {{TOBN(0x37ffe747, 0xceb26210), TOBN(0x983545e8, 0x787baef9), + TOBN(0x8b8c8535, 0x86a3de31), TOBN(0xc621dbcb, 0xfacd46db)}, + {TOBN(0x82e442e9, 0x59266fbb), TOBN(0xa3514c37, 0x339d471c), + TOBN(0x3a11b771, 0x62cdad96), TOBN(0xf0cb3b3c, 0xecf9bdf0)}}, + {{TOBN(0x3fcbdbce, 0x478e2135), TOBN(0x7547b5cf, 0xbda35342), + TOBN(0xa97e81f1, 0x8a677af6), TOBN(0xc8c2bf83, 0x28817987)}, + {TOBN(0xdf07eaaf, 0x45580985), TOBN(0xc68d1f05, 0xc93b45cb), + TOBN(0x106aa2fe, 0xc77b4cac), TOBN(0x4c1d8afc, 0x04a7ae86)}}, + {{TOBN(0xdb41c3fd, 0x9eb45ab2), TOBN(0x5b234b5b, 0xd4b22e74), + TOBN(0xda253dec, 0xf215958a), TOBN(0x67e0606e, 0xa04edfa0)}, + {TOBN(0xabbbf070, 0xef751b11), TOBN(0xf352f175, 0xf6f06dce), + TOBN(0xdfc4b6af, 0x6839f6b4), TOBN(0x53ddf9a8, 0x9959848e)}}, + {{TOBN(0xda49c379, 0xc21520b0), TOBN(0x90864ff0, 0xdbd5d1b6), + TOBN(0x2f055d23, 0x5f49c7f7), TOBN(0xe51e4e6a, 0xa796b2d8)}, + {TOBN(0xc361a67f, 0x5c9dc340), TOBN(0x5ad53c37, 0xbca7c620), + TOBN(0xda1d6588, 0x32c756d0), TOBN(0xad60d911, 0x8bb67e13)}}, + {{TOBN(0xd6c47bdf, 0x0eeec8c6), TOBN(0x4a27fec1, 0x078a1821), + TOBN(0x081f7415, 0xc3099524), TOBN(0x8effdf0b, 0x82cd8060)}, + {TOBN(0xdb70ec1c, 0x65842df8), TOBN(0x8821b358, 0xd319a901), + TOBN(0x72ee56ee, 0xde42b529), TOBN(0x5bb39592, 0x236e4286)}}, + {{TOBN(0xd1183316, 0xfd6f7140), TOBN(0xf9fadb5b, 0xbd8e81f7), + TOBN(0x701d5e0c, 0x5a02d962), TOBN(0xfdee4dbf, 0x1b601324)}, + {TOBN(0xbed17407, 0x35d7620e), TOBN(0x04e3c2c3, 0xf48c0012), + TOBN(0x9ee29da7, 0x3455449a), TOBN(0x562cdef4, 0x91a836c4)}}, + {{TOBN(0x8f682a5f, 0x47701097), TOBN(0x617125d8, 0xff88d0c2), + TOBN(0x948fda24, 0x57bb86dd), TOBN(0x348abb8f, 0x289f7286)}, + {TOBN(0xeb10eab5, 0x99d94bbd), TOBN(0xd51ba28e, 0x4684d160), + TOBN(0xabe0e51c, 0x30c8f41a), TOBN(0x66588b45, 0x13254f4a)}}, + {{TOBN(0x147ebf01, 0xfad097a5), TOBN(0x49883ea8, 0x610e815d), + TOBN(0xe44d60ba, 0x8a11de56), TOBN(0xa970de6e, 0x827a7a6d)}, + {TOBN(0x2be41424, 0x5e17fc19), TOBN(0xd833c657, 0x01214057), + TOBN(0x1375813b, 0x363e723f), TOBN(0x6820bb88, 0xe6a52e9b)}}, + {{TOBN(0x7e7f6970, 0xd875d56a), TOBN(0xd6a0a9ac, 0x51fbf6bf), + TOBN(0x54ba8790, 0xa3083c12), TOBN(0xebaeb23d, 0x6ae7eb64)}, + {TOBN(0xa8685c3a, 0xb99a907a), TOBN(0xf1e74550, 0x026bf40b), + TOBN(0x7b73a027, 0xc802cd9e), TOBN(0x9a8a927c, 0x4fef4635)}}, + {{TOBN(0xe1b6f60c, 0x08191224), TOBN(0xc4126ebb, 0xde4ec091), + TOBN(0xe1dff4dc, 0x4ae38d84), TOBN(0xde3f57db, 0x4f2ef985)}, + {TOBN(0x34964337, 0xd446a1dd), TOBN(0x7bf217a0, 0x859e77f6), + TOBN(0x8ff10527, 0x8e1d13f5), TOBN(0xa304ef03, 0x74eeae27)}}, + {{TOBN(0xfc6f5e47, 0xd19dfa5a), TOBN(0xdb007de3, 0x7fad982b), + TOBN(0x28205ad1, 0x613715f5), TOBN(0x251e6729, 0x7889529e)}, + {TOBN(0x72705184, 0x1ae98e78), TOBN(0xf818537d, 0x271cac32), + TOBN(0xc8a15b7e, 0xb7f410f5), TOBN(0xc474356f, 0x81f62393)}}, + {{TOBN(0x92dbdc5a, 0xc242316b), TOBN(0xabe060ac, 0xdbf4aff5), + TOBN(0x6e8c38fe, 0x909a8ec6), TOBN(0x43e514e5, 0x6116cb94)}, + {TOBN(0x2078fa38, 0x07d784f9), TOBN(0x1161a880, 0xf4b5b357), + TOBN(0x5283ce79, 0x13adea3d), TOBN(0x0756c3e6, 0xcc6a910b)}}, + {{TOBN(0x60bcfe01, 0xaaa79697), TOBN(0x04a73b29, 0x56391db1), + TOBN(0xdd8dad47, 0x189b45a0), TOBN(0xbfac0dd0, 0x48d5b8d9)}, + {TOBN(0x34ab3af5, 0x7d3d2ec2), TOBN(0x6fa2fc2d, 0x207bd3af), + TOBN(0x9ff40092, 0x66550ded), TOBN(0x719b3e87, 0x1fd5b913)}}, + {{TOBN(0xa573a496, 0x6d17fbc7), TOBN(0x0cd1a70a, 0x73d2b24e), + TOBN(0x34e2c5ca, 0xb2676937), TOBN(0xe7050b06, 0xbf669f21)}, + {TOBN(0xfbe948b6, 0x1ede9046), TOBN(0xa0530051, 0x97662659), + TOBN(0x58cbd4ed, 0xf10124c5), TOBN(0xde2646e4, 0xdd6c06c8)}}, + {{TOBN(0x332f8108, 0x8cad38c0), TOBN(0x471b7e90, 0x6bd68ae2), + TOBN(0x56ac3fb2, 0x0d8e27a3), TOBN(0xb54660db, 0x136b4b0d)}, + {TOBN(0x123a1e11, 0xa6fd8de4), TOBN(0x44dbffea, 0xa37799ef), + TOBN(0x4540b977, 0xce6ac17c), TOBN(0x495173a8, 0xaf60acef)}}}, + {{{TOBN(0x9ebb284d, 0x391c2a82), TOBN(0xbcdd4863, 0x158308e8), + TOBN(0x006f16ec, 0x83f1edca), TOBN(0xa13e2c37, 0x695dc6c8)}, + {TOBN(0x2ab756f0, 0x4a057a87), TOBN(0xa8765500, 0xa6b48f98), + TOBN(0x4252face, 0x68651c44), TOBN(0xa52b540b, 0xe1765e02)}}, + {{TOBN(0x4f922fc5, 0x16a0d2bb), TOBN(0x0d5cc16c, 0x1a623499), + TOBN(0x9241cf3a, 0x57c62c8b), TOBN(0x2f5e6961, 0xfd1b667f)}, + {TOBN(0x5c15c70b, 0xf5a01797), TOBN(0x3d20b44d, 0x60956192), + TOBN(0x04911b37, 0x071fdb52), TOBN(0xf648f916, 0x8d6f0f7b)}}, + {{TOBN(0x6dc1acaf, 0xe60b7cf7), TOBN(0x25860a50, 0x84a9d869), + TOBN(0x56fc6f09, 0xe7ba8ac4), TOBN(0x828c5bd0, 0x6148d29e)}, + {TOBN(0xac6b435e, 0xdc55ae5f), TOBN(0xa527f56c, 0xc0117411), + TOBN(0x94d5045e, 0xfd24342c), TOBN(0x2c4c0a35, 0x70b67c0d)}}, + {{TOBN(0x027cc8b8, 0xfac61d9a), TOBN(0x7d25e062, 0xe3c6fe8a), + TOBN(0xe08805bf, 0xe5bff503), TOBN(0x13271e6c, 0x6ff632f7)}, + {TOBN(0x55dca6c0, 0x232f76a5), TOBN(0x8957c32d, 0x701ef426), + TOBN(0xee728bcb, 0xa10a5178), TOBN(0x5ea60411, 0xb62c5173)}}, + {{TOBN(0xfc4e964e, 0xd0b8892b), TOBN(0x9ea17683, 0x9301bb74), + TOBN(0x6265c5ae, 0xfcc48626), TOBN(0xe60cf82e, 0xbb3e9102)}, + {TOBN(0x57adf797, 0xd4df5531), TOBN(0x235b59a1, 0x8deeefe2), + TOBN(0x60adcf58, 0x3f306eb1), TOBN(0x105c2753, 0x3d09492d)}}, + {{TOBN(0x4090914b, 0xb5def996), TOBN(0x1cb69c83, 0x233dd1e7), + TOBN(0xc1e9c1d3, 0x9b3d5e76), TOBN(0x1f3338ed, 0xfccf6012)}, + {TOBN(0xb1e95d0d, 0x2f5378a8), TOBN(0xacf4c2c7, 0x2f00cd21), + TOBN(0x6e984240, 0xeb5fe290), TOBN(0xd66c038d, 0x248088ae)}}, + {{TOBN(0x804d264a, 0xf94d70cf), TOBN(0xbdb802ef, 0x7314bf7e), + TOBN(0x8fb54de2, 0x4333ed02), TOBN(0x740461e0, 0x285635d9)}, + {TOBN(0x4113b2c8, 0x365e9383), TOBN(0xea762c83, 0x3fdef652), + TOBN(0x4eec6e2e, 0x47b956c1), TOBN(0xa3d814be, 0x65620fa4)}}, + {{TOBN(0x9ad5462b, 0xb4d8bc50), TOBN(0x181c0b16, 0xa9195770), + TOBN(0xebd4fe1c, 0x78412a68), TOBN(0xae0341bc, 0xc0dff48c)}, + {TOBN(0xb6bc45cf, 0x7003e866), TOBN(0xf11a6dea, 0x8a24a41b), + TOBN(0x5407151a, 0xd04c24c2), TOBN(0x62c9d27d, 0xda5b7b68)}}, + {{TOBN(0x2e964235, 0x88cceff6), TOBN(0x8594c54f, 0x8b07ed69), + TOBN(0x1578e73c, 0xc84d0d0d), TOBN(0x7b4e1055, 0xff532868)}, + {TOBN(0xa348c0d5, 0xb5ec995a), TOBN(0xbf4b9d55, 0x14289a54), + TOBN(0x9ba155a6, 0x58fbd777), TOBN(0x186ed7a8, 0x1a84491d)}}, + {{TOBN(0xd4992b30, 0x614c0900), TOBN(0xda98d121, 0xbd00c24b), + TOBN(0x7f534dc8, 0x7ec4bfa1), TOBN(0x4a5ff674, 0x37dc34bc)}, + {TOBN(0x68c196b8, 0x1d7ea1d7), TOBN(0x38cf2893, 0x80a6d208), + TOBN(0xfd56cd09, 0xe3cbbd6e), TOBN(0xec72e27e, 0x4205a5b6)}}, + {{TOBN(0x15ea68f5, 0xa44f77f7), TOBN(0x7aa5f9fd, 0xb43c52bc), + TOBN(0x86ff676f, 0x94f0e609), TOBN(0xa4cde963, 0x2e2d432b)}, + {TOBN(0x8cafa0c0, 0xeee470af), TOBN(0x84137d0e, 0x8a3f5ec8), + TOBN(0xebb40411, 0xfaa31231), TOBN(0xa239c13f, 0x6f7f7ccf)}}, + {{TOBN(0x32865719, 0xa8afd30b), TOBN(0x86798328, 0x8a826dce), + TOBN(0xdf04e891, 0xc4a8fbe0), TOBN(0xbb6b6e1b, 0xebf56ad3)}, + {TOBN(0x0a695b11, 0x471f1ff0), TOBN(0xd76c3389, 0xbe15baf0), + TOBN(0x018edb95, 0xbe96c43e), TOBN(0xf2beaaf4, 0x90794158)}}, + {{TOBN(0x152db09e, 0xc3076a27), TOBN(0x5e82908e, 0xe416545d), + TOBN(0xa2c41272, 0x356d6f2e), TOBN(0xdc9c9642, 0x31fd74e1)}, + {TOBN(0x66ceb88d, 0x519bf615), TOBN(0xe29ecd76, 0x05a2274e), + TOBN(0x3a0473c4, 0xbf5e2fa0), TOBN(0x6b6eb671, 0x64284e67)}}, + {{TOBN(0xe8b97932, 0xb88756dd), TOBN(0xed4e8652, 0xf17e3e61), + TOBN(0xc2dd1499, 0x3ee1c4a4), TOBN(0xc0aaee17, 0x597f8c0e)}, + {TOBN(0x15c4edb9, 0x6c168af3), TOBN(0x6563c7bf, 0xb39ae875), + TOBN(0xadfadb6f, 0x20adb436), TOBN(0xad55e8c9, 0x9a042ac0)}}, + {{TOBN(0x975a1ed8, 0xb76da1f5), TOBN(0x10dfa466, 0xa58acb94), + TOBN(0x8dd7f7e3, 0xac060282), TOBN(0x6813e66a, 0x572a051e)}, + {TOBN(0xb4ccae1e, 0x350cb901), TOBN(0xb653d656, 0x50cb7822), + TOBN(0x42484710, 0xdfab3b87), TOBN(0xcd7ee537, 0x9b670fd0)}}, + {{TOBN(0x0a50b12e, 0x523b8bf6), TOBN(0x8009eb5b, 0x8f910c1b), + TOBN(0xf535af82, 0x4a167588), TOBN(0x0f835f9c, 0xfb2a2abd)}, + {TOBN(0xf59b2931, 0x2afceb62), TOBN(0xc797df2a, 0x169d383f), + TOBN(0xeb3f5fb0, 0x66ac02b0), TOBN(0x029d4c6f, 0xdaa2d0ca)}}, + {{TOBN(0xd4059bc1, 0xafab4bc5), TOBN(0x833f5c6f, 0x56783247), + TOBN(0xb5346630, 0x8d2d3605), TOBN(0x83387891, 0xd34d8433)}, + {TOBN(0xd973b30f, 0xadd9419a), TOBN(0xbcca1099, 0xafe3fce8), + TOBN(0x08178315, 0x0809aac6), TOBN(0x01b7f21a, 0x540f0f11)}}, + {{TOBN(0x65c29219, 0x909523c8), TOBN(0xa62f648f, 0xa3a1c741), + TOBN(0x88598d4f, 0x60c9e55a), TOBN(0xbce9141b, 0x0e4f347a)}, + {TOBN(0x9af97d84, 0x35f9b988), TOBN(0x0210da62, 0x320475b6), + TOBN(0x3c076e22, 0x9191476c), TOBN(0x7520dbd9, 0x44fc7834)}}, + {{TOBN(0x6a6b2cfe, 0xc1ab1bbd), TOBN(0xef8a65be, 0xdc650938), + TOBN(0x72855540, 0x805d7bc4), TOBN(0xda389396, 0xed11fdfd)}, + {TOBN(0xa9d5bd36, 0x74660876), TOBN(0x11d67c54, 0xb45dff35), + TOBN(0x6af7d148, 0xa4f5da94), TOBN(0xbb8d4c3f, 0xc0bbeb31)}}, + {{TOBN(0x87a7ebd1, 0xe0a1b12a), TOBN(0x1e4ef88d, 0x770ba95f), + TOBN(0x8c33345c, 0xdc2ae9cb), TOBN(0xcecf1276, 0x01cc8403)}, + {TOBN(0x687c012e, 0x1b39b80f), TOBN(0xfd90d0ad, 0x35c33ba4), + TOBN(0xa3ef5a67, 0x5c9661c2), TOBN(0x368fc88e, 0xe017429e)}}, + {{TOBN(0xd30c6761, 0x196a2fa2), TOBN(0x931b9817, 0xbd5b312e), + TOBN(0xba01000c, 0x72f54a31), TOBN(0xa203d2c8, 0x66eaa541)}, + {TOBN(0xf2abdee0, 0x98939db3), TOBN(0xe37d6c2c, 0x3e606c02), + TOBN(0xf2921574, 0x521ff643), TOBN(0x2781b3c4, 0xd7e2fca3)}}, + {{TOBN(0x664300b0, 0x7850ec06), TOBN(0xac5a38b9, 0x7d3a10cf), + TOBN(0x9233188d, 0xe34ab39d), TOBN(0xe77057e4, 0x5072cbb9)}, + {TOBN(0xbcf0c042, 0xb59e78df), TOBN(0x4cfc91e8, 0x1d97de52), + TOBN(0x4661a26c, 0x3ee0ca4a), TOBN(0x5620a4c1, 0xfb8507bc)}}, + {{TOBN(0x4b44d4aa, 0x049f842c), TOBN(0xceabc5d5, 0x1540e82b), + TOBN(0x306710fd, 0x15c6f156), TOBN(0xbe5ae52b, 0x63db1d72)}, + {TOBN(0x06f1e7e6, 0x334957f1), TOBN(0x57e388f0, 0x31144a70), + TOBN(0xfb69bb2f, 0xdf96447b), TOBN(0x0f78ebd3, 0x73e38a12)}}, + {{TOBN(0xb8222605, 0x2b7ce542), TOBN(0xe6d4ce99, 0x7472bde1), + TOBN(0x53e16ebe, 0x09d2f4da), TOBN(0x180ff42e, 0x53b92b2e)}, + {TOBN(0xc59bcc02, 0x2c34a1c6), TOBN(0x3803d6f9, 0x422c46c2), + TOBN(0x18aff74f, 0x5c14a8a2), TOBN(0x55aebf80, 0x10a08b28)}}, + {{TOBN(0x66097d58, 0x7135593f), TOBN(0x32e6eff7, 0x2be570cd), + TOBN(0x584e6a10, 0x2a8c860d), TOBN(0xcd185890, 0xa2eb4163)}, + {TOBN(0x7ceae99d, 0x6d97e134), TOBN(0xd42c6b70, 0xdd8447ce), + TOBN(0x59ddbb4a, 0xb8c50273), TOBN(0x03c612df, 0x3cf34e1e)}}, + {{TOBN(0x84b9ca15, 0x04b6c5a0), TOBN(0x35216f39, 0x18f0e3a3), + TOBN(0x3ec2d2bc, 0xbd986c00), TOBN(0x8bf546d9, 0xd19228fe)}, + {TOBN(0xd1c655a4, 0x4cd623c3), TOBN(0x366ce718, 0x502b8e5a), + TOBN(0x2cfc84b4, 0xeea0bfe7), TOBN(0xe01d5cee, 0xcf443e8e)}}, + {{TOBN(0x8ec045d9, 0x036520f8), TOBN(0xdfb3c3d1, 0x92d40e98), + TOBN(0x0bac4cce, 0xcc559a04), TOBN(0x35eccae5, 0x240ea6b1)}, + {TOBN(0x180b32db, 0xf8a5a0ac), TOBN(0x547972a5, 0xeb699700), + TOBN(0xa3765801, 0xca26bca0), TOBN(0x57e09d0e, 0xa647f25a)}}, + {{TOBN(0xb956970e, 0x2fdd23cc), TOBN(0xb80288bc, 0x5682e971), + TOBN(0xe6e6d91e, 0x9ae86ebc), TOBN(0x0564c83f, 0x8c9f1939)}, + {TOBN(0x551932a2, 0x39560368), TOBN(0xe893752b, 0x049c28e2), + TOBN(0x0b03cee5, 0xa6a158c3), TOBN(0xe12d656b, 0x04964263)}}, + {{TOBN(0x4b47554e, 0x63e3bc1d), TOBN(0xc719b6a2, 0x45044ff7), + TOBN(0x4f24d30a, 0xe48daa07), TOBN(0xa3f37556, 0xc8c1edc3)}, + {TOBN(0x9a47bf76, 0x0700d360), TOBN(0xbb1a1824, 0x822ae4e2), + TOBN(0x22e275a3, 0x89f1fb4c), TOBN(0x72b1aa23, 0x9968c5f5)}}, + {{TOBN(0xa75feaca, 0xbe063f64), TOBN(0x9b392f43, 0xbce47a09), + TOBN(0xd4241509, 0x1ad07aca), TOBN(0x4b0c591b, 0x8d26cd0f)}, + {TOBN(0x2d42ddfd, 0x92f1169a), TOBN(0x63aeb1ac, 0x4cbf2392), + TOBN(0x1de9e877, 0x0691a2af), TOBN(0xebe79af7, 0xd98021da)}}, + {{TOBN(0xcfdf2a4e, 0x40e50acf), TOBN(0xf0a98ad7, 0xaf01d665), + TOBN(0xefb640bf, 0x1831be1f), TOBN(0x6fe8bd2f, 0x80e9ada0)}, + {TOBN(0x94c103a1, 0x6cafbc91), TOBN(0x170f8759, 0x8308e08c), + TOBN(0x5de2d2ab, 0x9780ff4f), TOBN(0x666466bc, 0x45b201f2)}}, + {{TOBN(0x58af2010, 0xf5b343bc), TOBN(0x0f2e400a, 0xf2f142fe), + TOBN(0x3483bfde, 0xa85f4bdf), TOBN(0xf0b1d093, 0x03bfeaa9)}, + {TOBN(0x2ea01b95, 0xc7081603), TOBN(0xe943e4c9, 0x3dba1097), + TOBN(0x47be92ad, 0xb438f3a6), TOBN(0x00bb7742, 0xe5bf6636)}}, + {{TOBN(0x136b7083, 0x824297b4), TOBN(0x9d0e5580, 0x5584455f), + TOBN(0xab48cedc, 0xf1c7d69e), TOBN(0x53a9e481, 0x2a256e76)}, + {TOBN(0x0402b0e0, 0x65eb2413), TOBN(0xdadbbb84, 0x8fc407a7), + TOBN(0xa65cd5a4, 0x8d7f5492), TOBN(0x21d44293, 0x74bae294)}}, + {{TOBN(0x66917ce6, 0x3b5f1cc4), TOBN(0x37ae52ea, 0xce872e62), + TOBN(0xbb087b72, 0x2905f244), TOBN(0x12077086, 0x1e6af74f)}, + {TOBN(0x4b644e49, 0x1058edea), TOBN(0x827510e3, 0xb638ca1d), + TOBN(0x8cf2b704, 0x6038591c), TOBN(0xffc8b47a, 0xfe635063)}}, + {{TOBN(0x3ae220e6, 0x1b4d5e63), TOBN(0xbd864742, 0x9d961b4b), + TOBN(0x610c107e, 0x9bd16bed), TOBN(0x4270352a, 0x1127147b)}, + {TOBN(0x7d17ffe6, 0x64cfc50e), TOBN(0x50dee01a, 0x1e36cb42), + TOBN(0x068a7622, 0x35dc5f9a), TOBN(0x9a08d536, 0xdf53f62c)}}, + {{TOBN(0x4ed71457, 0x6be5f7de), TOBN(0xd93006f8, 0xc2263c9e), + TOBN(0xe073694c, 0xcacacb36), TOBN(0x2ff7a5b4, 0x3ae118ab)}, + {TOBN(0x3cce53f1, 0xcd871236), TOBN(0xf156a39d, 0xc2aa6d52), + TOBN(0x9cc5f271, 0xb198d76d), TOBN(0xbc615b6f, 0x81383d39)}}, + {{TOBN(0xa54538e8, 0xde3eee6b), TOBN(0x58c77538, 0xab910d91), + TOBN(0x31e5bdbc, 0x58d278bd), TOBN(0x3cde4adf, 0xb963acae)}, + {TOBN(0xb1881fd2, 0x5302169c), TOBN(0x8ca60fa0, 0xa989ed8b), + TOBN(0xa1999458, 0xff96a0ee), TOBN(0xc1141f03, 0xac6c283d)}}, + {{TOBN(0x7677408d, 0x6dfafed3), TOBN(0x33a01653, 0x39661588), + TOBN(0x3c9c15ec, 0x0b726fa0), TOBN(0x090cfd93, 0x6c9b56da)}, + {TOBN(0xe34f4bae, 0xa3c40af5), TOBN(0x3469eadb, 0xd21129f1), + TOBN(0xcc51674a, 0x1e207ce8), TOBN(0x1e293b24, 0xc83b1ef9)}}, + {{TOBN(0x17173d13, 0x1e6c0bb4), TOBN(0x19004695, 0x90776d35), + TOBN(0xe7980e34, 0x6de6f922), TOBN(0x873554cb, 0xf4dd9a22)}, + {TOBN(0x0316c627, 0xcbf18a51), TOBN(0x4d93651b, 0x3032c081), + TOBN(0x207f2771, 0x3946834d), TOBN(0x2c08d7b4, 0x30cdbf80)}}, + {{TOBN(0x137a4fb4, 0x86df2a61), TOBN(0xa1ed9c07, 0xecf7b4a2), + TOBN(0xb2e460e2, 0x7bd042ff), TOBN(0xb7f5e2fa, 0x5f62f5ec)}, + {TOBN(0x7aa6ec6b, 0xcc2423b7), TOBN(0x75ce0a7f, 0xba63eea7), + TOBN(0x67a45fb1, 0xf250a6e1), TOBN(0x93bc919c, 0xe53cdc9f)}}, + {{TOBN(0x9271f56f, 0x871942df), TOBN(0x2372ff6f, 0x7859ad66), + TOBN(0x5f4c2b96, 0x33cb1a78), TOBN(0xe3e29101, 0x5838aa83)}, + {TOBN(0xa7ed1611, 0xe4e8110c), TOBN(0x2a2d70d5, 0x330198ce), + TOBN(0xbdf132e8, 0x6720efe0), TOBN(0xe61a8962, 0x66a471bf)}}, + {{TOBN(0x796d3a85, 0x825808bd), TOBN(0x51dc3cb7, 0x3fd6e902), + TOBN(0x643c768a, 0x916219d1), TOBN(0x36cd7685, 0xa2ad7d32)}, + {TOBN(0xe3db9d05, 0xb22922a4), TOBN(0x6494c87e, 0xdba29660), + TOBN(0xf0ac91df, 0xbcd2ebc7), TOBN(0x4deb57a0, 0x45107f8d)}}, + {{TOBN(0x42271f59, 0xc3d12a73), TOBN(0x5f71687c, 0xa5c2c51d), + TOBN(0xcb1f50c6, 0x05797bcb), TOBN(0x29ed0ed9, 0xd6d34eb0)}, + {TOBN(0xe5fe5b47, 0x4683c2eb), TOBN(0x4956eeb5, 0x97447c46), + TOBN(0x5b163a43, 0x71207167), TOBN(0x93fa2fed, 0x0248c5ef)}}, + {{TOBN(0x67930af2, 0x31f63950), TOBN(0xa77797c1, 0x14caa2c9), + TOBN(0x526e80ee, 0x27ac7e62), TOBN(0xe1e6e626, 0x58b28aec)}, + {TOBN(0x636178b0, 0xb3c9fef0), TOBN(0xaf7752e0, 0x6d5f90be), + TOBN(0x94ecaf18, 0xeece51cf), TOBN(0x2864d0ed, 0xca806e1f)}}, + {{TOBN(0x6de2e383, 0x97c69134), TOBN(0x5a42c316, 0xeb291293), + TOBN(0xc7779219, 0x6a60bae0), TOBN(0xa24de346, 0x6b7599d1)}, + {TOBN(0x49d374aa, 0xb75d4941), TOBN(0x98900586, 0x2d501ff0), + TOBN(0x9f16d40e, 0xeb7974cf), TOBN(0x1033860b, 0xcdd8c115)}}, + {{TOBN(0xb6c69ac8, 0x2094cec3), TOBN(0x9976fb88, 0x403b770c), + TOBN(0x1dea026c, 0x4859590d), TOBN(0xb6acbb46, 0x8562d1fd)}, + {TOBN(0x7cd6c461, 0x44569d85), TOBN(0xc3190a36, 0x97f0891d), + TOBN(0xc6f53195, 0x48d5a17d), TOBN(0x7d919966, 0xd749abc8)}}, + {{TOBN(0x65104837, 0xdd1c8a20), TOBN(0x7e5410c8, 0x2f683419), + TOBN(0x958c3ca8, 0xbe94022e), TOBN(0x605c3197, 0x6145dac2)}, + {TOBN(0x3fc07501, 0x01683d54), TOBN(0x1d7127c5, 0x595b1234), + TOBN(0x10b8f87c, 0x9481277f), TOBN(0x677db2a8, 0xe65a1adb)}}, + {{TOBN(0xec2fccaa, 0xddce3345), TOBN(0x2a6811b7, 0x012a4350), + TOBN(0x96760ff1, 0xac598bdc), TOBN(0x054d652a, 0xd1bf4128)}, + {TOBN(0x0a1151d4, 0x92a21005), TOBN(0xad7f3971, 0x33110fdf), + TOBN(0x8c95928c, 0x1960100f), TOBN(0x6c91c825, 0x7bf03362)}}, + {{TOBN(0xc8c8b2a2, 0xce309f06), TOBN(0xfdb27b59, 0xca27204b), + TOBN(0xd223eaa5, 0x0848e32e), TOBN(0xb93e4b2e, 0xe7bfaf1e)}, + {TOBN(0xc5308ae6, 0x44aa3ded), TOBN(0x317a666a, 0xc015d573), + TOBN(0xc888ce23, 0x1a979707), TOBN(0xf141c1e6, 0x0d5c4958)}}, + {{TOBN(0xb53b7de5, 0x61906373), TOBN(0x858dbade, 0xeb999595), + TOBN(0x8cbb47b2, 0xa59e5c36), TOBN(0x660318b3, 0xdcf4e842)}, + {TOBN(0xbd161ccd, 0x12ba4b7a), TOBN(0xf399daab, 0xf8c8282a), + TOBN(0x1587633a, 0xeeb2130d), TOBN(0xa465311a, 0xda38dd7d)}}, + {{TOBN(0x5f75eec8, 0x64d3779b), TOBN(0x3c5d0476, 0xad64c171), + TOBN(0x87410371, 0x2a914428), TOBN(0x8096a891, 0x90e2fc29)}, + {TOBN(0xd3d2ae9d, 0x23b3ebc2), TOBN(0x90bdd6db, 0xa580cfd6), + TOBN(0x52dbb7f3, 0xc5b01f6c), TOBN(0xe68eded4, 0xe102a2dc)}}, + {{TOBN(0x17785b77, 0x99eb6df0), TOBN(0x26c3cc51, 0x7386b779), + TOBN(0x345ed988, 0x6417a48e), TOBN(0xe990b4e4, 0x07d6ef31)}, + {TOBN(0x0f456b7e, 0x2586abba), TOBN(0x239ca6a5, 0x59c96e9a), + TOBN(0xe327459c, 0xe2eb4206), TOBN(0x3a4c3313, 0xa002b90a)}}, + {{TOBN(0x2a114806, 0xf6a3f6fb), TOBN(0xad5cad2f, 0x85c251dd), + TOBN(0x92c1f613, 0xf5a784d3), TOBN(0xec7bfacf, 0x349766d5)}, + {TOBN(0x04b3cd33, 0x3e23cb3b), TOBN(0x3979fe84, 0xc5a64b2d), + TOBN(0x192e2720, 0x7e589106), TOBN(0xa60c43d1, 0xa15b527f)}}, + {{TOBN(0x2dae9082, 0xbe7cf3a6), TOBN(0xcc86ba92, 0xbc967274), + TOBN(0xf28a2ce8, 0xaea0a8a9), TOBN(0x404ca6d9, 0x6ee988b3)}, + {TOBN(0xfd7e9c5d, 0x005921b8), TOBN(0xf56297f1, 0x44e79bf9), + TOBN(0xa163b460, 0x0d75ddc2), TOBN(0x30b23616, 0xa1f2be87)}}, + {{TOBN(0x4b070d21, 0xbfe50e2b), TOBN(0x7ef8cfd0, 0xe1bfede1), + TOBN(0xadba0011, 0x2aac4ae0), TOBN(0x2a3e7d01, 0xb9ebd033)}, + {TOBN(0x995277ec, 0xe38d9d1c), TOBN(0xb500249e, 0x9c5d2de3), + TOBN(0x8912b820, 0xf13ca8c9), TOBN(0xc8798114, 0x877793af)}}, + {{TOBN(0x19e6125d, 0xec3f1dec), TOBN(0x07b1f040, 0x911178da), + TOBN(0xd93ededa, 0x904a6738), TOBN(0x55187a5a, 0x0bebedcd)}, + {TOBN(0xf7d04722, 0xeb329d41), TOBN(0xf449099e, 0xf170b391), + TOBN(0xfd317a69, 0xca99f828), TOBN(0x50c3db2b, 0x34a4976d)}}, + {{TOBN(0xe9ba7784, 0x3757b392), TOBN(0x326caefd, 0xaa3ca05a), + TOBN(0x78e5293b, 0xf1e593d4), TOBN(0x7842a937, 0x0d98fd13)}, + {TOBN(0xe694bf96, 0x5f96b10d), TOBN(0x373a9df6, 0x06a8cd05), + TOBN(0x997d1e51, 0xe8f0c7fc), TOBN(0x1d019790, 0x63fd972e)}}, + {{TOBN(0x0064d858, 0x5499fb32), TOBN(0x7b67bad9, 0x77a8aeb7), + TOBN(0x1d3eb977, 0x2d08eec5), TOBN(0x5fc047a6, 0xcbabae1d)}, + {TOBN(0x0577d159, 0xe54a64bb), TOBN(0x8862201b, 0xc43497e4), + TOBN(0xad6b4e28, 0x2ce0608d), TOBN(0x8b687b7d, 0x0b167aac)}}, + {{TOBN(0x6ed4d367, 0x8b2ecfa9), TOBN(0x24dfe62d, 0xa90c3c38), + TOBN(0xa1862e10, 0x3fe5c42b), TOBN(0x1ca73dca, 0xd5732a9f)}, + {TOBN(0x35f038b7, 0x76bb87ad), TOBN(0x674976ab, 0xf242b81f), + TOBN(0x4f2bde7e, 0xb0fd90cd), TOBN(0x6efc172e, 0xa7fdf092)}}, + {{TOBN(0x3806b69b, 0x92222f1f), TOBN(0x5a2459ca, 0x6cf7ae70), + TOBN(0x6789f69c, 0xa85217ee), TOBN(0x5f232b5e, 0xe3dc85ac)}, + {TOBN(0x660e3ec5, 0x48e9e516), TOBN(0x124b4e47, 0x3197eb31), + TOBN(0x10a0cb13, 0xaafcca23), TOBN(0x7bd63ba4, 0x8213224f)}}, + {{TOBN(0xaffad7cc, 0x290a7f4f), TOBN(0x6b409c9e, 0x0286b461), + TOBN(0x58ab809f, 0xffa407af), TOBN(0xc3122eed, 0xc68ac073)}, + {TOBN(0x17bf9e50, 0x4ef24d7e), TOBN(0x5d929794, 0x3e2a5811), + TOBN(0x519bc867, 0x02902e01), TOBN(0x76bba5da, 0x39c8a851)}}, + {{TOBN(0xe9f9669c, 0xda94951e), TOBN(0x4b6af58d, 0x66b8d418), + TOBN(0xfa321074, 0x17d426a4), TOBN(0xc78e66a9, 0x9dde6027)}, + {TOBN(0x0516c083, 0x4a53b964), TOBN(0xfc659d38, 0xff602330), + TOBN(0x0ab55e5c, 0x58c5c897), TOBN(0x985099b2, 0x838bc5df)}}, + {{TOBN(0x061d9efc, 0xc52fc238), TOBN(0x712b2728, 0x6ac1da3f), + TOBN(0xfb658149, 0x9283fe08), TOBN(0x4954ac94, 0xb8aaa2f7)}, + {TOBN(0x85c0ada4, 0x7fb2e74f), TOBN(0xee8ba98e, 0xb89926b0), + TOBN(0xe4f9d37d, 0x23d1af5b), TOBN(0x14ccdbf9, 0xba9b015e)}}, + {{TOBN(0xb674481b, 0x7bfe7178), TOBN(0x4e1debae, 0x65405868), + TOBN(0x061b2821, 0xc48c867d), TOBN(0x69c15b35, 0x513b30ea)}, + {TOBN(0x3b4a1666, 0x36871088), TOBN(0xe5e29f5d, 0x1220b1ff), + TOBN(0x4b82bb35, 0x233d9f4d), TOBN(0x4e076333, 0x18cdc675)}}}, + {{{TOBN(0x0d53f5c7, 0xa3e6fced), TOBN(0xe8cbbdd5, 0xf45fbdeb), + TOBN(0xf85c01df, 0x13339a70), TOBN(0x0ff71880, 0x142ceb81)}, + {TOBN(0x4c4e8774, 0xbd70437a), TOBN(0x5fb32891, 0xba0bda6a), + TOBN(0x1cdbebd2, 0xf18bd26e), TOBN(0x2f9526f1, 0x03a9d522)}}, + {{TOBN(0x40ce3051, 0x92c4d684), TOBN(0x8b04d725, 0x7612efcd), + TOBN(0xb9dcda36, 0x6f9cae20), TOBN(0x0edc4d24, 0xf058856c)}, + {TOBN(0x64f2e6bf, 0x85427900), TOBN(0x3de81295, 0xdc09dfea), + TOBN(0xd41b4487, 0x379bf26c), TOBN(0x50b62c6d, 0x6df135a9)}}, + {{TOBN(0xd4f8e3b4, 0xc72dfe67), TOBN(0xc416b0f6, 0x90e19fdf), + TOBN(0x18b9098d, 0x4c13bd35), TOBN(0xac11118a, 0x15b8cb9e)}, + {TOBN(0xf598a318, 0xf0062841), TOBN(0xbfe0602f, 0x89f356f4), + TOBN(0x7ae3637e, 0x30177a0c), TOBN(0x34097747, 0x61136537)}}, + {{TOBN(0x0db2fb5e, 0xd005832a), TOBN(0x5f5efd3b, 0x91042e4f), + TOBN(0x8c4ffdc6, 0xed70f8ca), TOBN(0xe4645d0b, 0xb52da9cc)}, + {TOBN(0x9596f58b, 0xc9001d1f), TOBN(0x52c8f0bc, 0x4e117205), + TOBN(0xfd4aa0d2, 0xe398a084), TOBN(0x815bfe3a, 0x104f49de)}}, + {{TOBN(0x97e5443f, 0x23885e5f), TOBN(0xf72f8f99, 0xe8433aab), + TOBN(0xbd00b154, 0xe4d4e604), TOBN(0xd0b35e6a, 0xe5e173ff)}, + {TOBN(0x57b2a048, 0x9164722d), TOBN(0x3e3c665b, 0x88761ec8), + TOBN(0x6bdd1397, 0x3da83832), TOBN(0x3c8b1a1e, 0x73dafe3b)}}, + {{TOBN(0x4497ace6, 0x54317cac), TOBN(0xbe600ab9, 0x521771b3), + TOBN(0xb42e409e, 0xb0dfe8b8), TOBN(0x386a67d7, 0x3942310f)}, + {TOBN(0x25548d8d, 0x4431cc28), TOBN(0xa7cff142, 0x985dc524), + TOBN(0x4d60f5a1, 0x93c4be32), TOBN(0x83ebd5c8, 0xd071c6e1)}}, + {{TOBN(0xba3a80a7, 0xb1fd2b0b), TOBN(0x9b3ad396, 0x5bec33e8), + TOBN(0xb3868d61, 0x79743fb3), TOBN(0xcfd169fc, 0xfdb462fa)}, + {TOBN(0xd3b499d7, 0x9ce0a6af), TOBN(0x55dc1cf1, 0xe42d3ff8), + TOBN(0x04fb9e6c, 0xc6c3e1b2), TOBN(0x47e6961d, 0x6f69a474)}}, + {{TOBN(0x54eb3acc, 0xe548b37b), TOBN(0xb38e7542, 0x84d40549), + TOBN(0x8c3daa51, 0x7b341b4f), TOBN(0x2f6928ec, 0x690bf7fa)}, + {TOBN(0x0496b323, 0x86ce6c41), TOBN(0x01be1c55, 0x10adadcd), + TOBN(0xc04e67e7, 0x4bb5faf9), TOBN(0x3cbaf678, 0xe15c9985)}}, + {{TOBN(0x8cd12145, 0x50ca4247), TOBN(0xba1aa47a, 0xe7dd30aa), + TOBN(0x2f81ddf1, 0xe58fee24), TOBN(0x03452936, 0xeec9b0e8)}, + {TOBN(0x8bdc3b81, 0x243aea96), TOBN(0x9a2919af, 0x15c3d0e5), + TOBN(0x9ea640ec, 0x10948361), TOBN(0x5ac86d5b, 0x6e0bcccf)}}, + {{TOBN(0xf892d918, 0xc36cf440), TOBN(0xaed3e837, 0xc939719c), + TOBN(0xb07b08d2, 0xc0218b64), TOBN(0x6f1bcbba, 0xce9790dd)}, + {TOBN(0x4a84d6ed, 0x60919b8e), TOBN(0xd8900791, 0x8ac1f9eb), + TOBN(0xf84941aa, 0x0dd5daef), TOBN(0xb22fe40a, 0x67fd62c5)}}, + {{TOBN(0x97e15ba2, 0x157f2db3), TOBN(0xbda2fc8f, 0x8e28ca9c), + TOBN(0x5d050da4, 0x37b9f454), TOBN(0x3d57eb57, 0x2379d72e)}, + {TOBN(0xe9b5eba2, 0xfb5ee997), TOBN(0x01648ca2, 0xe11538ca), + TOBN(0x32bb76f6, 0xf6327974), TOBN(0x338f14b8, 0xff3f4bb7)}}, + {{TOBN(0x524d226a, 0xd7ab9a2d), TOBN(0x9c00090d, 0x7dfae958), + TOBN(0x0ba5f539, 0x8751d8c2), TOBN(0x8afcbcdd, 0x3ab8262d)}, + {TOBN(0x57392729, 0xe99d043b), TOBN(0xef51263b, 0xaebc943a), + TOBN(0x9feace93, 0x20862935), TOBN(0x639efc03, 0xb06c817b)}}, + {{TOBN(0x1fe054b3, 0x66b4be7a), TOBN(0x3f25a9de, 0x84a37a1e), + TOBN(0xf39ef1ad, 0x78d75cd9), TOBN(0xd7b58f49, 0x5062c1b5)}, + {TOBN(0x6f74f9a9, 0xff563436), TOBN(0xf718ff29, 0xe8af51e7), + TOBN(0x5234d313, 0x15e97fec), TOBN(0xb6a8e2b1, 0x292f1c0a)}}, + {{TOBN(0xa7f53aa8, 0x327720c1), TOBN(0x956ca322, 0xba092cc8), + TOBN(0x8f03d64a, 0x28746c4d), TOBN(0x51fe1782, 0x66d0d392)}, + {TOBN(0xd19b34db, 0x3c832c80), TOBN(0x60dccc5c, 0x6da2e3b4), + TOBN(0x245dd62e, 0x0a104ccc), TOBN(0xa7ab1de1, 0x620b21fd)}}, + {{TOBN(0xb293ae0b, 0x3893d123), TOBN(0xf7b75783, 0xb15ee71c), + TOBN(0x5aa3c614, 0x42a9468b), TOBN(0xd686123c, 0xdb15d744)}, + {TOBN(0x8c616891, 0xa7ab4116), TOBN(0x6fcd72c8, 0xa4e6a459), + TOBN(0xac219110, 0x77e5fad7), TOBN(0xfb6a20e7, 0x704fa46b)}}, + {{TOBN(0xe839be7d, 0x341d81dc), TOBN(0xcddb6889, 0x32148379), + TOBN(0xda6211a1, 0xf7026ead), TOBN(0xf3b2575f, 0xf4d1cc5e)}, + {TOBN(0x40cfc8f6, 0xa7a73ae6), TOBN(0x83879a5e, 0x61d5b483), + TOBN(0xc5acb1ed, 0x41a50ebc), TOBN(0x59a60cc8, 0x3c07d8fa)}}, + {{TOBN(0x1b73bdce, 0xb1876262), TOBN(0x2b0d79f0, 0x12af4ee9), + TOBN(0x8bcf3b0b, 0xd46e1d07), TOBN(0x17d6af9d, 0xe45d152f)}, + {TOBN(0x73520461, 0x6d736451), TOBN(0x43cbbd97, 0x56b0bf5a), + TOBN(0xb0833a5b, 0xd5999b9d), TOBN(0x702614f0, 0xeb72e398)}}, + {{TOBN(0x0aadf01a, 0x59c3e9f8), TOBN(0x40200e77, 0xce6b3d16), + TOBN(0xda22bdd3, 0xdeddafad), TOBN(0x76dedaf4, 0x310d72e1)}, + {TOBN(0x49ef807c, 0x4bc2e88f), TOBN(0x6ba81291, 0x146dd5a5), + TOBN(0xa1a4077a, 0x7d8d59e9), TOBN(0x87b6a2e7, 0x802db349)}}, + {{TOBN(0xd5679997, 0x1b4e598e), TOBN(0xf499ef1f, 0x06fe4b1d), + TOBN(0x3978d3ae, 0xfcb267c5), TOBN(0xb582b557, 0x235786d0)}, + {TOBN(0x32b3b2ca, 0x1715cb07), TOBN(0x4c3de6a2, 0x8480241d), + TOBN(0x63b5ffed, 0xcb571ecd), TOBN(0xeaf53900, 0xed2fe9a9)}}, + {{TOBN(0xdec98d4a, 0xc3b81990), TOBN(0x1cb83722, 0x9e0cc8fe), + TOBN(0xfe0b0491, 0xd2b427b9), TOBN(0x0f2386ac, 0xe983a66c)}, + {TOBN(0x930c4d1e, 0xb3291213), TOBN(0xa2f82b2e, 0x59a62ae4), + TOBN(0x77233853, 0xf93e89e3), TOBN(0x7f8063ac, 0x11777c7f)}}, + {{TOBN(0xff0eb567, 0x59ad2877), TOBN(0x6f454642, 0x9865c754), + TOBN(0xe6fe701a, 0x236e9a84), TOBN(0xc586ef16, 0x06e40fc3)}, + {TOBN(0x3f62b6e0, 0x24bafad9), TOBN(0xc8b42bd2, 0x64da906a), + TOBN(0xc98e1eb4, 0xda3276a0), TOBN(0x30d0e5fc, 0x06cbf852)}}, + {{TOBN(0x1b6b2ae1, 0xe8b4dfd4), TOBN(0xd754d5c7, 0x8301cbac), + TOBN(0x66097629, 0x112a39ac), TOBN(0xf86b5999, 0x93ba4ab9)}, + {TOBN(0x26c9dea7, 0x99f9d581), TOBN(0x0473b1a8, 0xc2fafeaa), + TOBN(0x1469af55, 0x3b2505a5), TOBN(0x227d16d7, 0xd6a43323)}}, + {{TOBN(0x3316f73c, 0xad3d97f9), TOBN(0x52bf3bb5, 0x1f137455), + TOBN(0x953eafeb, 0x09954e7c), TOBN(0xa721dfed, 0xdd732411)}, + {TOBN(0xb4929821, 0x141d4579), TOBN(0x3411321c, 0xaa3bd435), + TOBN(0xafb355aa, 0x17fa6015), TOBN(0xb4e7ef4a, 0x18e42f0e)}}, + {{TOBN(0x604ac97c, 0x59371000), TOBN(0xe1c48c70, 0x7f759c18), + TOBN(0x3f62ecc5, 0xa5db6b65), TOBN(0x0a78b173, 0x38a21495)}, + {TOBN(0x6be1819d, 0xbcc8ad94), TOBN(0x70dc04f6, 0xd89c3400), + TOBN(0x462557b4, 0xa6b4840a), TOBN(0x544c6ade, 0x60bd21c0)}}, + {{TOBN(0x6a00f24e, 0x907a544b), TOBN(0xa7520dcb, 0x313da210), + TOBN(0xfe939b75, 0x11e4994b), TOBN(0x918b6ba6, 0xbc275d70)}, + {TOBN(0xd3e5e0fc, 0x644be892), TOBN(0x707a9816, 0xfdaf6c42), + TOBN(0x60145567, 0xf15c13fe), TOBN(0x4818ebaa, 0xe130a54a)}}, + {{TOBN(0x28aad3ad, 0x58d2f767), TOBN(0xdc5267fd, 0xd7e7c773), + TOBN(0x4919cc88, 0xc3afcc98), TOBN(0xaa2e6ab0, 0x2db8cd4b)}, + {TOBN(0xd46fec04, 0xd0c63eaa), TOBN(0xa1cb92c5, 0x19ffa832), + TOBN(0x678dd178, 0xe43a631f), TOBN(0xfb5ae1cd, 0x3dc788b3)}}, + {{TOBN(0x68b4fb90, 0x6e77de04), TOBN(0x7992bcf0, 0xf06dbb97), + TOBN(0x896e6a13, 0xc417c01d), TOBN(0x8d96332c, 0xb956be01)}, + {TOBN(0x902fc93a, 0x413aa2b9), TOBN(0x99a4d915, 0xfc98c8a5), + TOBN(0x52c29407, 0x565f1137), TOBN(0x4072690f, 0x21e4f281)}}, + {{TOBN(0x36e607cf, 0x02ff6072), TOBN(0xa47d2ca9, 0x8ad98cdc), + TOBN(0xbf471d1e, 0xf5f56609), TOBN(0xbcf86623, 0xf264ada0)}, + {TOBN(0xb70c0687, 0xaa9e5cb6), TOBN(0xc98124f2, 0x17401c6c), + TOBN(0x8189635f, 0xd4a61435), TOBN(0xd28fb8af, 0xa9d98ea6)}}, + {{TOBN(0xb9a67c2a, 0x40c251f8), TOBN(0x88cd5d87, 0xa2da44be), + TOBN(0x437deb96, 0xe09b5423), TOBN(0x150467db, 0x64287dc1)}, + {TOBN(0xe161debb, 0xcdabb839), TOBN(0xa79e9742, 0xf1839a3e), + TOBN(0xbb8dd3c2, 0x652d202b), TOBN(0x7b3e67f7, 0xe9f97d96)}}, + {{TOBN(0x5aa5d78f, 0xb1cb6ac9), TOBN(0xffa13e8e, 0xca1d0d45), + TOBN(0x369295dd, 0x2ba5bf95), TOBN(0xd68bd1f8, 0x39aff05e)}, + {TOBN(0xaf0d86f9, 0x26d783f2), TOBN(0x543a59b3, 0xfc3aafc1), + TOBN(0x3fcf81d2, 0x7b7da97c), TOBN(0xc990a056, 0xd25dee46)}}, + {{TOBN(0x3e6775b8, 0x519cce2c), TOBN(0xfc9af71f, 0xae13d863), + TOBN(0x774a4a6f, 0x47c1605c), TOBN(0x46ba4245, 0x2fd205e8)}, + {TOBN(0xa06feea4, 0xd3fd524d), TOBN(0x1e724641, 0x6de1acc2), + TOBN(0xf53816f1, 0x334e2b42), TOBN(0x49e5918e, 0x922f0024)}}, + {{TOBN(0x439530b6, 0x65c7322d), TOBN(0xcf12cc01, 0xb3c1b3fb), + TOBN(0xc70b0186, 0x0172f685), TOBN(0xb915ee22, 0x1b58391d)}, + {TOBN(0x9afdf03b, 0xa317db24), TOBN(0x87dec659, 0x17b8ffc4), + TOBN(0x7f46597b, 0xe4d3d050), TOBN(0x80a1c1ed, 0x006500e7)}}, + {{TOBN(0x84902a96, 0x78bf030e), TOBN(0xfb5e9c9a, 0x50560148), + TOBN(0x6dae0a92, 0x63362426), TOBN(0xdcaeecf4, 0xa9e30c40)}, + {TOBN(0xc0d887bb, 0x518d0c6b), TOBN(0x99181152, 0xcb985b9d), + TOBN(0xad186898, 0xef7bc381), TOBN(0x18168ffb, 0x9ee46201)}}, + {{TOBN(0x9a04cdaa, 0x2502753c), TOBN(0xbb279e26, 0x51407c41), + TOBN(0xeacb03aa, 0xf23564e5), TOBN(0x18336582, 0x71e61016)}, + {TOBN(0x8684b8c4, 0xeb809877), TOBN(0xb336e18d, 0xea0e672e), + TOBN(0xefb601f0, 0x34ee5867), TOBN(0x2733edbe, 0x1341cfd1)}}, + {{TOBN(0xb15e809a, 0x26025c3c), TOBN(0xe6e981a6, 0x9350df88), + TOBN(0x92376237, 0x8502fd8e), TOBN(0x4791f216, 0x0c12be9b)}, + {TOBN(0xb7256789, 0x25f02425), TOBN(0xec863194, 0x7a974443), + TOBN(0x7c0ce882, 0xfb41cc52), TOBN(0xc266ff7e, 0xf25c07f2)}}, + {{TOBN(0x3d4da8c3, 0x017025f3), TOBN(0xefcf628c, 0xfb9579b4), + TOBN(0x5c4d0016, 0x1f3716ec), TOBN(0x9c27ebc4, 0x6801116e)}, + {TOBN(0x5eba0ea1, 0x1da1767e), TOBN(0xfe151452, 0x47004c57), + TOBN(0x3ace6df6, 0x8c2373b7), TOBN(0x75c3dffe, 0x5dbc37ac)}}, + {{TOBN(0x3dc32a73, 0xddc925fc), TOBN(0xb679c841, 0x2f65ee0b), + TOBN(0x715a3295, 0x451cbfeb), TOBN(0xd9889768, 0xf76e9a29)}, + {TOBN(0xec20ce7f, 0xb28ad247), TOBN(0xe99146c4, 0x00894d79), + TOBN(0x71457d7c, 0x9f5e3ea7), TOBN(0x097b2662, 0x38030031)}}, + {{TOBN(0xdb7f6ae6, 0xcf9f82a8), TOBN(0x319decb9, 0x438f473a), + TOBN(0xa63ab386, 0x283856c3), TOBN(0x13e3172f, 0xb06a361b)}, + {TOBN(0x2959f8dc, 0x7d5a006c), TOBN(0x2dbc27c6, 0x75fba752), + TOBN(0xc1227ab2, 0x87c22c9e), TOBN(0x06f61f75, 0x71a268b2)}}, + {{TOBN(0x1b6bb971, 0x04779ce2), TOBN(0xaca83812, 0x0aadcb1d), + TOBN(0x297ae0bc, 0xaeaab2d5), TOBN(0xa5c14ee7, 0x5bfb9f13)}, + {TOBN(0xaa00c583, 0xf17a62c7), TOBN(0x39eb962c, 0x173759f6), + TOBN(0x1eeba1d4, 0x86c9a88f), TOBN(0x0ab6c37a, 0xdf016c5e)}}, + {{TOBN(0xa2a147db, 0xa28a0749), TOBN(0x246c20d6, 0xee519165), + TOBN(0x5068d1b1, 0xd3810715), TOBN(0xb1e7018c, 0x748160b9)}, + {TOBN(0x03f5b1fa, 0xf380ff62), TOBN(0xef7fb1dd, 0xf3cb2c1e), + TOBN(0xeab539a8, 0xfc91a7da), TOBN(0x83ddb707, 0xf3f9b561)}}, + {{TOBN(0xc550e211, 0xfe7df7a4), TOBN(0xa7cd07f2, 0x063f6f40), + TOBN(0xb0de3635, 0x2976879c), TOBN(0xb5f83f85, 0xe55741da)}, + {TOBN(0x4ea9d25e, 0xf3d8ac3d), TOBN(0x6fe2066f, 0x62819f02), + TOBN(0x4ab2b9c2, 0xcef4a564), TOBN(0x1e155d96, 0x5ffa2de3)}}, + {{TOBN(0x0eb0a19b, 0xc3a72d00), TOBN(0x4037665b, 0x8513c31b), + TOBN(0x2fb2b6bf, 0x04c64637), TOBN(0x45c34d6e, 0x08cdc639)}, + {TOBN(0x56f1e10f, 0xf01fd796), TOBN(0x4dfb8101, 0xfe3667b8), + TOBN(0xe0eda253, 0x9021d0c0), TOBN(0x7a94e9ff, 0x8a06c6ab)}}, + {{TOBN(0x2d3bb0d9, 0xbb9aa882), TOBN(0xea20e4e5, 0xec05fd10), + TOBN(0xed7eeb5f, 0x1a1ca64e), TOBN(0x2fa6b43c, 0xc6327cbd)}, + {TOBN(0xb577e3cf, 0x3aa91121), TOBN(0x8c6bd5ea, 0x3a34079b), + TOBN(0xd7e5ba39, 0x60e02fc0), TOBN(0xf16dd2c3, 0x90141bf8)}}, + {{TOBN(0xb57276d9, 0x80101b98), TOBN(0x760883fd, 0xb82f0f66), + TOBN(0x89d7de75, 0x4bc3eff3), TOBN(0x03b60643, 0x5dc2ab40)}, + {TOBN(0xcd6e53df, 0xe05beeac), TOBN(0xf2f1e862, 0xbc3325cd), + TOBN(0xdd0f7921, 0x774f03c3), TOBN(0x97ca7221, 0x4552cc1b)}}, + {{TOBN(0x5a0d6afe, 0x1cd19f72), TOBN(0xa20915dc, 0xf183fbeb), + TOBN(0x9fda4b40, 0x832c403c), TOBN(0x32738edd, 0xbe425442)}, + {TOBN(0x469a1df6, 0xb5eccf1a), TOBN(0x4b5aff42, 0x28bbe1f0), + TOBN(0x31359d7f, 0x570dfc93), TOBN(0xa18be235, 0xf0088628)}}, + {{TOBN(0xa5b30fba, 0xb00ed3a9), TOBN(0x34c61374, 0x73cdf8be), + TOBN(0x2c5c5f46, 0xabc56797), TOBN(0x5cecf93d, 0xb82a8ae2)}, + {TOBN(0x7d3dbe41, 0xa968fbf0), TOBN(0xd23d4583, 0x1a5c7f3d), + TOBN(0xf28f69a0, 0xc087a9c7), TOBN(0xc2d75471, 0x474471ca)}}, + {{TOBN(0x36ec9f4a, 0x4eb732ec), TOBN(0x6c943bbd, 0xb1ca6bed), + TOBN(0xd64535e1, 0xf2457892), TOBN(0x8b84a8ea, 0xf7e2ac06)}, + {TOBN(0xe0936cd3, 0x2499dd5f), TOBN(0x12053d7e, 0x0ed04e57), + TOBN(0x4bdd0076, 0xe4305d9d), TOBN(0x34a527b9, 0x1f67f0a2)}}, + {{TOBN(0xe79a4af0, 0x9cec46ea), TOBN(0xb15347a1, 0x658b9bc7), + TOBN(0x6bd2796f, 0x35af2f75), TOBN(0xac957990, 0x4051c435)}, + {TOBN(0x2669dda3, 0xc33a655d), TOBN(0x5d503c2e, 0x88514aa3), + TOBN(0xdfa11337, 0x3753dd41), TOBN(0x3f054673, 0x0b754f78)}}, + {{TOBN(0xbf185677, 0x496125bd), TOBN(0xfb0023c8, 0x3775006c), + TOBN(0xfa0f072f, 0x3a037899), TOBN(0x4222b6eb, 0x0e4aea57)}, + {TOBN(0x3dde5e76, 0x7866d25a), TOBN(0xb6eb04f8, 0x4837aa6f), + TOBN(0x5315591a, 0x2cf1cdb8), TOBN(0x6dfb4f41, 0x2d4e683c)}}, + {{TOBN(0x7e923ea4, 0x48ee1f3a), TOBN(0x9604d9f7, 0x05a2afd5), + TOBN(0xbe1d4a33, 0x40ea4948), TOBN(0x5b45f1f4, 0xb44cbd2f)}, + {TOBN(0x5faf8376, 0x4acc757e), TOBN(0xa7cf9ab8, 0x63d68ff7), + TOBN(0x8ad62f69, 0xdf0e404b), TOBN(0xd65f33c2, 0x12bdafdf)}}, + {{TOBN(0xc365de15, 0xa377b14e), TOBN(0x6bf5463b, 0x8e39f60c), + TOBN(0x62030d2d, 0x2ce68148), TOBN(0xd95867ef, 0xe6f843a8)}, + {TOBN(0xd39a0244, 0xef5ab017), TOBN(0x0bd2d8c1, 0x4ab55d12), + TOBN(0xc9503db3, 0x41639169), TOBN(0x2d4e25b0, 0xf7660c8a)}}, + {{TOBN(0x760cb3b5, 0xe224c5d7), TOBN(0xfa3baf8c, 0x68616919), + TOBN(0x9fbca113, 0x8d142552), TOBN(0x1ab18bf1, 0x7669ebf5)}, + {TOBN(0x55e6f53e, 0x9bdf25dd), TOBN(0x04cc0bf3, 0xcb6cd154), + TOBN(0x595bef49, 0x95e89080), TOBN(0xfe9459a8, 0x104a9ac1)}}, + {{TOBN(0xad2d89ca, 0xcce9bb32), TOBN(0xddea65e1, 0xf7de8285), + TOBN(0x62ed8c35, 0xb351bd4b), TOBN(0x4150ff36, 0x0c0e19a7)}, + {TOBN(0x86e3c801, 0x345f4e47), TOBN(0x3bf21f71, 0x203a266c), + TOBN(0x7ae110d4, 0x855b1f13), TOBN(0x5d6aaf6a, 0x07262517)}}, + {{TOBN(0x1e0f12e1, 0x813d28f1), TOBN(0x6000e11d, 0x7ad7a523), + TOBN(0xc7d8deef, 0xc744a17b), TOBN(0x1e990b48, 0x14c05a00)}, + {TOBN(0x68fddaee, 0x93e976d5), TOBN(0x696241d1, 0x46610d63), + TOBN(0xb204e7c3, 0x893dda88), TOBN(0x8bccfa65, 0x6a3a6946)}}, + {{TOBN(0xb59425b4, 0xc5cd1411), TOBN(0x701b4042, 0xff3658b1), + TOBN(0xe3e56bca, 0x4784cf93), TOBN(0x27de5f15, 0x8fe68d60)}, + {TOBN(0x4ab9cfce, 0xf8d53f19), TOBN(0xddb10311, 0xa40a730d), + TOBN(0x6fa73cd1, 0x4eee0a8a), TOBN(0xfd548748, 0x5249719d)}}, + {{TOBN(0x49d66316, 0xa8123ef0), TOBN(0x73c32db4, 0xe7f95438), + TOBN(0x2e2ed209, 0x0d9e7854), TOBN(0xf98a9329, 0x9d9f0507)}, + {TOBN(0xc5d33cf6, 0x0c6aa20a), TOBN(0x9a32ba14, 0x75279bb2), + TOBN(0x7e3202cb, 0x774a7307), TOBN(0x64ed4bc4, 0xe8c42dbd)}}, + {{TOBN(0xc20f1a06, 0xd4caed0d), TOBN(0xb8021407, 0x171d22b3), + TOBN(0xd426ca04, 0xd13268d7), TOBN(0x92377007, 0x25f4d126)}, + {TOBN(0x4204cbc3, 0x71f21a85), TOBN(0x18461b7a, 0xf82369ba), + TOBN(0xc0c07d31, 0x3fc858f9), TOBN(0x5deb5a50, 0xe2bab569)}}, + {{TOBN(0xd5959d46, 0xd5eea89e), TOBN(0xfdff8424, 0x08437f4b), + TOBN(0xf21071e4, 0x3cfe254f), TOBN(0x72417696, 0x95468321)}, + {TOBN(0x5d8288b9, 0x102cae3e), TOBN(0x2d143e3d, 0xf1965dff), + TOBN(0x00c9a376, 0xa078d847), TOBN(0x6fc0da31, 0x26028731)}}, + {{TOBN(0xa2baeadf, 0xe45083a2), TOBN(0x66bc7218, 0x5e5b4bcd), + TOBN(0x2c826442, 0xd04b8e7f), TOBN(0xc19f5451, 0x6c4b586b)}, + {TOBN(0x60182c49, 0x5b7eeed5), TOBN(0xd9954ecd, 0x7aa9dfa1), + TOBN(0xa403a8ec, 0xc73884ad), TOBN(0x7fb17de2, 0x9bb39041)}}, + {{TOBN(0x694b64c5, 0xabb020e8), TOBN(0x3d18c184, 0x19c4eec7), + TOBN(0x9c4673ef, 0x1c4793e5), TOBN(0xc7b8aeb5, 0x056092e6)}, + {TOBN(0x3aa1ca43, 0xf0f8c16b), TOBN(0x224ed5ec, 0xd679b2f6), + TOBN(0x0d56eeaf, 0x55a205c9), TOBN(0xbfe115ba, 0x4b8e028b)}}, + {{TOBN(0x97e60849, 0x3927f4fe), TOBN(0xf91fbf94, 0x759aa7c5), + TOBN(0x985af769, 0x6be90a51), TOBN(0xc1277b78, 0x78ccb823)}, + {TOBN(0x395b656e, 0xe7a75952), TOBN(0x00df7de0, 0x928da5f5), + TOBN(0x09c23175, 0x4ca4454f), TOBN(0x4ec971f4, 0x7aa2d3c1)}}, + {{TOBN(0x45c3c507, 0xe75d9ccc), TOBN(0x63b7be8a, 0x3dc90306), + TOBN(0x37e09c66, 0x5db44bdc), TOBN(0x50d60da1, 0x6841c6a2)}, + {TOBN(0x6f9b65ee, 0x08df1b12), TOBN(0x38734879, 0x7ff089df), + TOBN(0x9c331a66, 0x3fe8013d), TOBN(0x017f5de9, 0x5f42fcc8)}}, + {{TOBN(0x43077866, 0xe8e57567), TOBN(0xc9f781ce, 0xf9fcdb18), + TOBN(0x38131dda, 0x9b12e174), TOBN(0x25d84aa3, 0x8a03752a)}, + {TOBN(0x45e09e09, 0x4d0c0ce2), TOBN(0x1564008b, 0x92bebba5), + TOBN(0xf7e8ad31, 0xa87284c7), TOBN(0xb7c4b46c, 0x97e7bbaa)}}, + {{TOBN(0x3e22a7b3, 0x97acf4ec), TOBN(0x0426c400, 0x5ea8b640), + TOBN(0x5e3295a6, 0x4e969285), TOBN(0x22aabc59, 0xa6a45670)}, + {TOBN(0xb929714c, 0x5f5942bc), TOBN(0x9a6168bd, 0xfa3182ed), + TOBN(0x2216a665, 0x104152ba), TOBN(0x46908d03, 0xb6926368)}}}, + {{{TOBN(0xa9f5d874, 0x5a1251fb), TOBN(0x967747a8, 0xc72725c7), + TOBN(0x195c33e5, 0x31ffe89e), TOBN(0x609d210f, 0xe964935e)}, + {TOBN(0xcafd6ca8, 0x2fe12227), TOBN(0xaf9b5b96, 0x0426469d), + TOBN(0x2e9ee04c, 0x5693183c), TOBN(0x1084a333, 0xc8146fef)}}, + {{TOBN(0x96649933, 0xaed1d1f7), TOBN(0x566eaff3, 0x50563090), + TOBN(0x345057f0, 0xad2e39cf), TOBN(0x148ff65b, 0x1f832124)}, + {TOBN(0x042e89d4, 0xcf94cf0d), TOBN(0x319bec84, 0x520c58b3), + TOBN(0x2a267626, 0x5361aa0d), TOBN(0xc86fa302, 0x8fbc87ad)}}, + {{TOBN(0xfc83d2ab, 0x5c8b06d5), TOBN(0xb1a785a2, 0xfe4eac46), + TOBN(0xb99315bc, 0x846f7779), TOBN(0xcf31d816, 0xef9ea505)}, + {TOBN(0x2391fe6a, 0x15d7dc85), TOBN(0x2f132b04, 0xb4016b33), + TOBN(0x29547fe3, 0x181cb4c7), TOBN(0xdb66d8a6, 0x650155a1)}}, + {{TOBN(0x6b66d7e1, 0xadc1696f), TOBN(0x98ebe593, 0x0acd72d0), + TOBN(0x65f24550, 0xcc1b7435), TOBN(0xce231393, 0xb4b9a5ec)}, + {TOBN(0x234a22d4, 0xdb067df9), TOBN(0x98dda095, 0xcaff9b00), + TOBN(0x1bbc75a0, 0x6100c9c1), TOBN(0x1560a9c8, 0x939cf695)}}, + {{TOBN(0xcf006d3e, 0x99e0925f), TOBN(0x2dd74a96, 0x6322375a), + TOBN(0xc58b446a, 0xb56af5ba), TOBN(0x50292683, 0xe0b9b4f1)}, + {TOBN(0xe2c34cb4, 0x1aeaffa3), TOBN(0x8b17203f, 0x9b9587c1), + TOBN(0x6d559207, 0xead1350c), TOBN(0x2b66a215, 0xfb7f9604)}}, + {{TOBN(0x0850325e, 0xfe51bf74), TOBN(0x9c4f579e, 0x5e460094), + TOBN(0x5c87b92a, 0x76da2f25), TOBN(0x889de4e0, 0x6febef33)}, + {TOBN(0x6900ec06, 0x646083ce), TOBN(0xbe2a0335, 0xbfe12773), + TOBN(0xadd1da35, 0xc5344110), TOBN(0x757568b7, 0xb802cd20)}}, + {{TOBN(0x75559779, 0x00f7e6c8), TOBN(0x38e8b94f, 0x0facd2f0), + TOBN(0xfea1f3af, 0x03fde375), TOBN(0x5e11a1d8, 0x75881dfc)}, + {TOBN(0xb3a6b02e, 0xc1e2f2ef), TOBN(0x193d2bbb, 0xc605a6c5), + TOBN(0x325ffeee, 0x339a0b2d), TOBN(0x27b6a724, 0x9e0c8846)}}, + {{TOBN(0xe4050f1c, 0xf1c367ca), TOBN(0x9bc85a9b, 0xc90fbc7d), + TOBN(0xa373c4a2, 0xe1a11032), TOBN(0xb64232b7, 0xad0393a9)}, + {TOBN(0xf5577eb0, 0x167dad29), TOBN(0x1604f301, 0x94b78ab2), + TOBN(0x0baa94af, 0xe829348b), TOBN(0x77fbd8dd, 0x41654342)}}, + {{TOBN(0xdab50ea5, 0xb964e39a), TOBN(0xd4c29e3c, 0xd0d3c76e), + TOBN(0x80dae67c, 0x56d11964), TOBN(0x7307a8bf, 0xe5ffcc2f)}, + {TOBN(0x65bbc1aa, 0x91708c3b), TOBN(0xa151e62c, 0x28bf0eeb), + TOBN(0x6cb53381, 0x6fa34db7), TOBN(0x5139e05c, 0xa29403a8)}}, + {{TOBN(0x6ff651b4, 0x94a7cd2e), TOBN(0x5671ffd1, 0x0699336c), + TOBN(0x6f5fd2cc, 0x979a896a), TOBN(0x11e893a8, 0xd8148cef)}, + {TOBN(0x988906a1, 0x65cf7b10), TOBN(0x81b67178, 0xc50d8485), + TOBN(0x7c0deb35, 0x8a35b3de), TOBN(0x423ac855, 0xc1d29799)}}, + {{TOBN(0xaf580d87, 0xdac50b74), TOBN(0x28b2b89f, 0x5869734c), + TOBN(0x99a3b936, 0x874e28fb), TOBN(0xbb2c9190, 0x25f3f73a)}, + {TOBN(0x199f6918, 0x84a9d5b7), TOBN(0x7ebe2325, 0x7e770374), + TOBN(0xf442e107, 0x0738efe2), TOBN(0xcf9f3f56, 0xcf9082d2)}}, + {{TOBN(0x719f69e1, 0x09618708), TOBN(0xcc9e8364, 0xc183f9b1), + TOBN(0xec203a95, 0x366a21af), TOBN(0x6aec5d6d, 0x068b141f)}, + {TOBN(0xee2df78a, 0x994f04e9), TOBN(0xb39ccae8, 0x271245b0), + TOBN(0xb875a4a9, 0x97e43f4f), TOBN(0x507dfe11, 0xdb2cea98)}}, + {{TOBN(0x4fbf81cb, 0x489b03e9), TOBN(0xdb86ec5b, 0x6ec414fa), + TOBN(0xfad444f9, 0xf51b3ae5), TOBN(0xca7d33d6, 0x1914e3fe)}, + {TOBN(0xa9c32f5c, 0x0ae6c4d0), TOBN(0xa9ca1d1e, 0x73969568), + TOBN(0x98043c31, 0x1aa7467e), TOBN(0xe832e75c, 0xe21b5ac6)}}, + {{TOBN(0x314b7aea, 0x5232123d), TOBN(0x08307c8c, 0x65ae86db), + TOBN(0x06e7165c, 0xaa4668ed), TOBN(0xb170458b, 0xb4d3ec39)}, + {TOBN(0x4d2e3ec6, 0xc19bb986), TOBN(0xc5f34846, 0xae0304ed), + TOBN(0x917695a0, 0x6c9f9722), TOBN(0x6c7f7317, 0x4cab1c0a)}}, + {{TOBN(0x6295940e, 0x9d6d2e8b), TOBN(0xd318b8c1, 0x549f7c97), + TOBN(0x22453204, 0x97713885), TOBN(0x468d834b, 0xa8a440fe)}, + {TOBN(0xd81fe5b2, 0xbfba796e), TOBN(0x152364db, 0x6d71f116), + TOBN(0xbb8c7c59, 0xb5b66e53), TOBN(0x0b12c61b, 0x2641a192)}}, + {{TOBN(0x31f14802, 0xfcf0a7fd), TOBN(0x42fd0789, 0x5488b01e), + TOBN(0x71d78d6d, 0x9952b498), TOBN(0x8eb572d9, 0x07ac5201)}, + {TOBN(0xe0a2a44c, 0x4d194a88), TOBN(0xd2b63fd9, 0xba017e66), + TOBN(0x78efc6c8, 0xf888aefc), TOBN(0xb76f6bda, 0x4a881a11)}}, + {{TOBN(0x187f314b, 0xb46c2397), TOBN(0x004cf566, 0x5ded2819), + TOBN(0xa9ea5704, 0x38764d34), TOBN(0xbba45217, 0x78084709)}, + {TOBN(0x06474571, 0x1171121e), TOBN(0xad7b7eb1, 0xe7c9b671), + TOBN(0xdacfbc40, 0x730f7507), TOBN(0x178cd8c6, 0xc7ad7bd1)}}, + {{TOBN(0xbf0be101, 0xb2a67238), TOBN(0x3556d367, 0xaf9c14f2), + TOBN(0x104b7831, 0xa5662075), TOBN(0x58ca59bb, 0x79d9e60a)}, + {TOBN(0x4bc45392, 0xa569a73b), TOBN(0x517a52e8, 0x5698f6c9), + TOBN(0x85643da5, 0xaeadd755), TOBN(0x1aed0cd5, 0x2a581b84)}}, + {{TOBN(0xb9b4ff84, 0x80af1372), TOBN(0x244c3113, 0xf1ba5d1f), + TOBN(0x2a5dacbe, 0xf5f98d31), TOBN(0x2c3323e8, 0x4375bc2a)}, + {TOBN(0x17a3ab4a, 0x5594b1dd), TOBN(0xa1928bfb, 0xceb4797e), + TOBN(0xe83af245, 0xe4886a19), TOBN(0x8979d546, 0x72b5a74a)}}, + {{TOBN(0xa0f726bc, 0x19f9e967), TOBN(0xd9d03152, 0xe8fbbf4e), + TOBN(0xcfd6f51d, 0xb7707d40), TOBN(0x633084d9, 0x63f6e6e0)}, + {TOBN(0xedcd9cdc, 0x55667eaf), TOBN(0x73b7f92b, 0x2e44d56f), + TOBN(0xfb2e39b6, 0x4e962b14), TOBN(0x7d408f6e, 0xf671fcbf)}}, + {{TOBN(0xcc634ddc, 0x164a89bb), TOBN(0x74a42bb2, 0x3ef3bd05), + TOBN(0x1280dbb2, 0x428decbb), TOBN(0x6103f6bb, 0x402c8596)}, + {TOBN(0xfa2bf581, 0x355a5752), TOBN(0x562f96a8, 0x00946674), + TOBN(0x4e4ca16d, 0x6da0223b), TOBN(0xfe47819f, 0x28d3aa25)}}, + {{TOBN(0x9eea3075, 0xf8dfcf8a), TOBN(0xa284f0aa, 0x95669825), + TOBN(0xb3fca250, 0x867d3fd8), TOBN(0x20757b5f, 0x269d691e)}, + {TOBN(0xf2c24020, 0x93b8a5de), TOBN(0xd3f93359, 0xebc06da6), + TOBN(0x1178293e, 0xb2739c33), TOBN(0xd2a3e770, 0xbcd686e5)}}, + {{TOBN(0xa76f49f4, 0xcd941534), TOBN(0x0d37406b, 0xe3c71c0e), + TOBN(0x172d9397, 0x3b97f7e3), TOBN(0xec17e239, 0xbd7fd0de)}, + {TOBN(0xe3290551, 0x6f496ba2), TOBN(0x6a693172, 0x36ad50e7), + TOBN(0xc4e539a2, 0x83e7eff5), TOBN(0x752737e7, 0x18e1b4cf)}}, + {{TOBN(0xa2f7932c, 0x68af43ee), TOBN(0x5502468e, 0x703d00bd), + TOBN(0xe5dc978f, 0x2fb061f5), TOBN(0xc9a1904a, 0x28c815ad)}, + {TOBN(0xd3af538d, 0x470c56a4), TOBN(0x159abc5f, 0x193d8ced), + TOBN(0x2a37245f, 0x20108ef3), TOBN(0xfa17081e, 0x223f7178)}}, + {{TOBN(0x27b0fb2b, 0x10c8c0f5), TOBN(0x2102c3ea, 0x40650547), + TOBN(0x594564df, 0x8ac3bfa7), TOBN(0x98102033, 0x509dad96)}, + {TOBN(0x6989643f, 0xf1d18a13), TOBN(0x35eebd91, 0xd7fc5af0), + TOBN(0x078d096a, 0xfaeaafd8), TOBN(0xb7a89341, 0xdef3de98)}}, + {{TOBN(0x2a206e8d, 0xecf2a73a), TOBN(0x066a6397, 0x8e551994), + TOBN(0x3a6a088a, 0xb98d53a2), TOBN(0x0ce7c67c, 0x2d1124aa)}, + {TOBN(0x48cec671, 0x759a113c), TOBN(0xe3b373d3, 0x4f6f67fa), + TOBN(0x5455d479, 0xfd36727b), TOBN(0xe5a428ee, 0xa13c0d81)}}, + {{TOBN(0xb853dbc8, 0x1c86682b), TOBN(0xb78d2727, 0xb8d02b2a), + TOBN(0xaaf69bed, 0x8ebc329a), TOBN(0xdb6b40b3, 0x293b2148)}, + {TOBN(0xe42ea77d, 0xb8c4961f), TOBN(0xb1a12f7c, 0x20e5e0ab), + TOBN(0xa0ec5274, 0x79e8b05e), TOBN(0x68027391, 0xfab60a80)}}, + {{TOBN(0x6bfeea5f, 0x16b1bd5e), TOBN(0xf957e420, 0x4de30ad3), + TOBN(0xcbaf664e, 0x6a353b9e), TOBN(0x5c873312, 0x26d14feb)}, + {TOBN(0x4e87f98c, 0xb65f57cb), TOBN(0xdb60a621, 0x5e0cdd41), + TOBN(0x67c16865, 0xa6881440), TOBN(0x1093ef1a, 0x46ab52aa)}}, + {{TOBN(0xc095afb5, 0x3f4ece64), TOBN(0x6a6bb02e, 0x7604551a), + TOBN(0x55d44b4e, 0x0b26b8cd), TOBN(0xe5f9a999, 0xf971268a)}, + {TOBN(0xc08ec425, 0x11a7de84), TOBN(0x83568095, 0xfda469dd), + TOBN(0x737bfba1, 0x6c6c90a2), TOBN(0x1cb9c4a0, 0xbe229831)}}, + {{TOBN(0x93bccbba, 0xbb2eec64), TOBN(0xa0c23b64, 0xda03adbe), + TOBN(0x5f7aa00a, 0xe0e86ac4), TOBN(0x470b941e, 0xfc1401e6)}, + {TOBN(0x5ad8d679, 0x9df43574), TOBN(0x4ccfb8a9, 0x0f65d810), + TOBN(0x1bce80e3, 0xaa7fbd81), TOBN(0x273291ad, 0x9508d20a)}}, + {{TOBN(0xf5c4b46b, 0x42a92806), TOBN(0x810684ec, 0xa86ab44a), + TOBN(0x4591640b, 0xca0bc9f8), TOBN(0xb5efcdfc, 0x5c4b6054)}, + {TOBN(0x16fc8907, 0x6e9edd12), TOBN(0xe29d0b50, 0xd4d792f9), + TOBN(0xa45fd01c, 0x9b03116d), TOBN(0x85035235, 0xc81765a4)}}, + {{TOBN(0x1fe2a9b2, 0xb4b4b67c), TOBN(0xc1d10df0, 0xe8020604), + TOBN(0x9d64abfc, 0xbc8058d8), TOBN(0x8943b9b2, 0x712a0fbb)}, + {TOBN(0x90eed914, 0x3b3def04), TOBN(0x85ab3aa2, 0x4ce775ff), + TOBN(0x605fd4ca, 0x7bbc9040), TOBN(0x8b34a564, 0xe2c75dfb)}}, + {{TOBN(0x41ffc94a, 0x10358560), TOBN(0x2d8a5072, 0x9e5c28aa), + TOBN(0xe915a0fc, 0x4cc7eb15), TOBN(0xe9efab05, 0x8f6d0f5d)}, + {TOBN(0xdbab47a9, 0xd19e9b91), TOBN(0x8cfed745, 0x0276154c), + TOBN(0x154357ae, 0x2cfede0d), TOBN(0x520630df, 0x19f5a4ef)}}, + {{TOBN(0x25759f7c, 0xe382360f), TOBN(0xb6db05c9, 0x88bf5857), + TOBN(0x2917d61d, 0x6c58d46c), TOBN(0x14f8e491, 0xfd20cb7a)}, + {TOBN(0xb68a727a, 0x11c20340), TOBN(0x0386f86f, 0xaf7ccbb6), + TOBN(0x5c8bc6cc, 0xfee09a20), TOBN(0x7d76ff4a, 0xbb7eea35)}}, + {{TOBN(0xa7bdebe7, 0xdb15be7a), TOBN(0x67a08054, 0xd89f0302), + TOBN(0x56bf0ea9, 0xc1193364), TOBN(0xc8244467, 0x62837ebe)}, + {TOBN(0x32bd8e8b, 0x20d841b8), TOBN(0x127a0548, 0xdbb8a54f), + TOBN(0x83dd4ca6, 0x63b20236), TOBN(0x87714718, 0x203491fa)}}, + {{TOBN(0x4dabcaaa, 0xaa8a5288), TOBN(0x91cc0c8a, 0xaf23a1c9), + TOBN(0x34c72c6a, 0x3f220e0c), TOBN(0xbcc20bdf, 0x1232144a)}, + {TOBN(0x6e2f42da, 0xa20ede1b), TOBN(0xc441f00c, 0x74a00515), + TOBN(0xbf46a5b6, 0x734b8c4b), TOBN(0x57409503, 0x7b56c9a4)}}, + {{TOBN(0x9f735261, 0xe4585d45), TOBN(0x9231faed, 0x6734e642), + TOBN(0x1158a176, 0xbe70ee6c), TOBN(0x35f1068d, 0x7c3501bf)}, + {TOBN(0x6beef900, 0xa2d26115), TOBN(0x649406f2, 0xef0afee3), + TOBN(0x3f43a60a, 0xbc2420a1), TOBN(0x509002a7, 0xd5aee4ac)}}, + {{TOBN(0xb46836a5, 0x3ff3571b), TOBN(0x24f98b78, 0x837927c1), + TOBN(0x6254256a, 0x4533c716), TOBN(0xf27abb0b, 0xd07ee196)}, + {TOBN(0xd7cf64fc, 0x5c6d5bfd), TOBN(0x6915c751, 0xf0cd7a77), + TOBN(0xd9f59012, 0x8798f534), TOBN(0x772b0da8, 0xf81d8b5f)}}, + {{TOBN(0x1244260c, 0x2e03fa69), TOBN(0x36cf0e3a, 0x3be1a374), + TOBN(0x6e7c1633, 0xef06b960), TOBN(0xa71a4c55, 0x671f90f6)}, + {TOBN(0x7a941251, 0x33c673db), TOBN(0xc0bea510, 0x73e8c131), + TOBN(0x61a8a699, 0xd4f6c734), TOBN(0x25e78c88, 0x341ed001)}}, + {{TOBN(0x5c18acf8, 0x8e2f7d90), TOBN(0xfdbf33d7, 0x77be32cd), + TOBN(0x0a085cd7, 0xd2eb5ee9), TOBN(0x2d702cfb, 0xb3201115)}, + {TOBN(0xb6e0ebdb, 0x85c88ce8), TOBN(0x23a3ce3c, 0x1e01d617), + TOBN(0x3041618e, 0x567333ac), TOBN(0x9dd0fd8f, 0x157edb6b)}}, + {{TOBN(0x27f74702, 0xb57872b8), TOBN(0x2ef26b4f, 0x657d5fe1), + TOBN(0x95426f0a, 0x57cf3d40), TOBN(0x847e2ad1, 0x65a6067a)}, + {TOBN(0xd474d9a0, 0x09996a74), TOBN(0x16a56acd, 0x2a26115c), + TOBN(0x02a615c3, 0xd16f4d43), TOBN(0xcc3fc965, 0xaadb85b7)}}, + {{TOBN(0x386bda73, 0xce07d1b0), TOBN(0xd82910c2, 0x58ad4178), + TOBN(0x124f82cf, 0xcd2617f4), TOBN(0xcc2f5e8d, 0xef691770)}, + {TOBN(0x82702550, 0xb8c30ccc), TOBN(0x7b856aea, 0x1a8e575a), + TOBN(0xbb822fef, 0xb1ab9459), TOBN(0x085928bc, 0xec24e38e)}}, + {{TOBN(0x5d0402ec, 0xba8f4b4d), TOBN(0xc07cd4ba, 0x00b4d58b), + TOBN(0x5d8dffd5, 0x29227e7a), TOBN(0x61d44d0c, 0x31bf386f)}, + {TOBN(0xe486dc2b, 0x135e6f4d), TOBN(0x680962eb, 0xe79410ef), + TOBN(0xa61bd343, 0xf10088b5), TOBN(0x6aa76076, 0xe2e28686)}}, + {{TOBN(0x80463d11, 0x8fb98871), TOBN(0xcb26f5c3, 0xbbc76aff), + TOBN(0xd4ab8edd, 0xfbe03614), TOBN(0xc8eb579b, 0xc0cf2dee)}, + {TOBN(0xcc004c15, 0xc93bae41), TOBN(0x46fbae5d, 0x3aeca3b2), + TOBN(0x671235cf, 0x0f1e9ab1), TOBN(0xadfba934, 0x9ec285c1)}}, + {{TOBN(0x88ded013, 0xf216c980), TOBN(0xc8ac4fb8, 0xf79e0bc1), + TOBN(0xa29b89c6, 0xfb97a237), TOBN(0xb697b780, 0x9922d8e7)}, + {TOBN(0x3142c639, 0xddb945b5), TOBN(0x447b06c7, 0xe094c3a9), + TOBN(0xcdcb3642, 0x72266c90), TOBN(0x633aad08, 0xa9385046)}}, + {{TOBN(0xa36c936b, 0xb57c6477), TOBN(0x871f8b64, 0xe94dbcc6), + TOBN(0x28d0fb62, 0xa591a67b), TOBN(0x9d40e081, 0xc1d926f5)}, + {TOBN(0x3111eaf6, 0xf2d84b5a), TOBN(0x228993f9, 0xa565b644), + TOBN(0x0ccbf592, 0x2c83188b), TOBN(0xf87b30ab, 0x3df3e197)}}, + {{TOBN(0xb8658b31, 0x7642bca8), TOBN(0x1a032d7f, 0x52800f17), + TOBN(0x051dcae5, 0x79bf9445), TOBN(0xeba6b8ee, 0x54a2e253)}, + {TOBN(0x5c8b9cad, 0xd4485692), TOBN(0x84bda40e, 0x8986e9be), + TOBN(0xd16d16a4, 0x2f0db448), TOBN(0x8ec80050, 0xa14d4188)}}, + {{TOBN(0xb2b26107, 0x98fa7aaa), TOBN(0x41209ee4, 0xf073aa4e), + TOBN(0xf1570359, 0xf2d6b19b), TOBN(0xcbe6868c, 0xfc577caf)}, + {TOBN(0x186c4bdc, 0x32c04dd3), TOBN(0xa6c35fae, 0xcfeee397), + TOBN(0xb4a1b312, 0xf086c0cf), TOBN(0xe0a5ccc6, 0xd9461fe2)}}, + {{TOBN(0xc32278aa, 0x1536189f), TOBN(0x1126c55f, 0xba6df571), + TOBN(0x0f71a602, 0xb194560e), TOBN(0x8b2d7405, 0x324bd6e1)}, + {TOBN(0x8481939e, 0x3738be71), TOBN(0xb5090b1a, 0x1a4d97a9), + TOBN(0x116c65a3, 0xf05ba915), TOBN(0x21863ad3, 0xaae448aa)}}, + {{TOBN(0xd24e2679, 0xa7aae5d3), TOBN(0x7076013d, 0x0de5c1c4), + TOBN(0x2d50f8ba, 0xbb05b629), TOBN(0x73c1abe2, 0x6e66efbb)}, + {TOBN(0xefd4b422, 0xf2488af7), TOBN(0xe4105d02, 0x663ba575), + TOBN(0x7eb60a8b, 0x53a69457), TOBN(0x62210008, 0xc945973b)}}, + {{TOBN(0xfb255478, 0x77a50ec6), TOBN(0xbf0392f7, 0x0a37a72c), + TOBN(0xa0a7a19c, 0x4be18e7a), TOBN(0x90d8ea16, 0x25b1e0af)}, + {TOBN(0x7582a293, 0xef953f57), TOBN(0x90a64d05, 0xbdc5465a), + TOBN(0xca79c497, 0xe2510717), TOBN(0x560dbb7c, 0x18cb641f)}}, + {{TOBN(0x1d8e3286, 0x4b66abfb), TOBN(0xd26f52e5, 0x59030900), + TOBN(0x1ee3f643, 0x5584941a), TOBN(0x6d3b3730, 0x569f5958)}, + {TOBN(0x9ff2a62f, 0x4789dba5), TOBN(0x91fcb815, 0x72b5c9b7), + TOBN(0xf446cb7d, 0x6c8f9a0e), TOBN(0x48f625c1, 0x39b7ecb5)}}, + {{TOBN(0xbabae801, 0x1c6219b8), TOBN(0xe7a562d9, 0x28ac2f23), + TOBN(0xe1b48732, 0x26e20588), TOBN(0x06ee1cad, 0x775af051)}, + {TOBN(0xda29ae43, 0xfaff79f7), TOBN(0xc141a412, 0x652ee9e0), + TOBN(0x1e127f6f, 0x195f4bd0), TOBN(0x29c6ab4f, 0x072f34f8)}}, + {{TOBN(0x7b7c1477, 0x30448112), TOBN(0x82b51af1, 0xe4a38656), + TOBN(0x2bf2028a, 0x2f315010), TOBN(0xc9a4a01f, 0x6ea88cd4)}, + {TOBN(0xf63e95d8, 0x257e5818), TOBN(0xdd8efa10, 0xb4519b16), + TOBN(0xed8973e0, 0x0da910bf), TOBN(0xed49d077, 0x5c0fe4a9)}}, + {{TOBN(0xac3aac5e, 0xb7caee1e), TOBN(0x1033898d, 0xa7f4da57), + TOBN(0x42145c0e, 0x5c6669b9), TOBN(0x42daa688, 0xc1aa2aa0)}, + {TOBN(0x629cc15c, 0x1a1d885a), TOBN(0x25572ec0, 0xf4b76817), + TOBN(0x8312e435, 0x9c8f8f28), TOBN(0x8107f8cd, 0x81965490)}}, + {{TOBN(0x516ff3a3, 0x6fa6110c), TOBN(0x74fb1eb1, 0xfb93561f), + TOBN(0x6c0c9047, 0x8457522b), TOBN(0xcfd32104, 0x6bb8bdc6)}, + {TOBN(0x2d6884a2, 0xcc80ad57), TOBN(0x7c27fc35, 0x86a9b637), + TOBN(0x3461baed, 0xadf4e8cd), TOBN(0x1d56251a, 0x617242f0)}}, + {{TOBN(0x0b80d209, 0xc955bef4), TOBN(0xdf02cad2, 0x06adb047), + TOBN(0xf0d7cb91, 0x5ec74fee), TOBN(0xd2503375, 0x1111ba44)}, + {TOBN(0x9671755e, 0xdf53cb36), TOBN(0x54dcb612, 0x3368551b), + TOBN(0x66d69aac, 0xc8a025a4), TOBN(0x6be946c6, 0xe77ef445)}}, + {{TOBN(0x719946d1, 0xa995e094), TOBN(0x65e848f6, 0xe51e04d8), + TOBN(0xe62f3300, 0x6a1e3113), TOBN(0x1541c7c1, 0x501de503)}, + {TOBN(0x4daac9fa, 0xf4acfade), TOBN(0x0e585897, 0x44cd0b71), + TOBN(0x544fd869, 0x0a51cd77), TOBN(0x60fc20ed, 0x0031016d)}}, + {{TOBN(0x58b404ec, 0xa4276867), TOBN(0x46f6c3cc, 0x34f34993), + TOBN(0x477ca007, 0xc636e5bd), TOBN(0x8018f5e5, 0x7c458b47)}, + {TOBN(0xa1202270, 0xe47b668f), TOBN(0xcef48ccd, 0xee14f203), + TOBN(0x23f98bae, 0x62ff9b4d), TOBN(0x55acc035, 0xc589eddd)}}, + {{TOBN(0x3fe712af, 0x64db4444), TOBN(0x19e9d634, 0xbecdd480), + TOBN(0xe08bc047, 0xa930978a), TOBN(0x2dbf24ec, 0xa1280733)}, + {TOBN(0x3c0ae38c, 0x2cd706b2), TOBN(0x5b012a5b, 0x359017b9), + TOBN(0x3943c38c, 0x72e0f5ae), TOBN(0x786167ea, 0x57176fa3)}}, + {{TOBN(0xe5f9897d, 0x594881dc), TOBN(0x6b5efad8, 0xcfb820c1), + TOBN(0xb2179093, 0xd55018de), TOBN(0x39ad7d32, 0x0bac56ce)}, + {TOBN(0xb55122e0, 0x2cfc0e81), TOBN(0x117c4661, 0xf6d89daa), + TOBN(0x362d01e1, 0xcb64fa09), TOBN(0x6a309b4e, 0x3e9c4ddd)}}, + {{TOBN(0xfa979fb7, 0xabea49b1), TOBN(0xb4b1d27d, 0x10e2c6c5), + TOBN(0xbd61c2c4, 0x23afde7a), TOBN(0xeb6614f8, 0x9786d358)}, + {TOBN(0x4a5d816b, 0x7f6f7459), TOBN(0xe431a44f, 0x09360e7b), + TOBN(0x8c27a032, 0xc309914c), TOBN(0xcea5d68a, 0xcaede3d8)}}, + {{TOBN(0x3668f665, 0x3a0a3f95), TOBN(0x89369416, 0x7ceba27b), + TOBN(0x89981fad, 0xe4728fe9), TOBN(0x7102c8a0, 0x8a093562)}, + {TOBN(0xbb80310e, 0x235d21c8), TOBN(0x505e55d1, 0xbefb7f7b), + TOBN(0xa0a90811, 0x12958a67), TOBN(0xd67e106a, 0x4d851fef)}}, + {{TOBN(0xb84011a9, 0x431dd80e), TOBN(0xeb7c7cca, 0x73306cd9), + TOBN(0x20fadd29, 0xd1b3b730), TOBN(0x83858b5b, 0xfe37b3d3)}, + {TOBN(0xbf4cd193, 0xb6251d5c), TOBN(0x1cca1fd3, 0x1352d952), + TOBN(0xc66157a4, 0x90fbc051), TOBN(0x7990a638, 0x89b98636)}}}, + {{{TOBN(0xe5aa692a, 0x87dec0e1), TOBN(0x010ded8d, 0xf7b39d00), + TOBN(0x7b1b80c8, 0x54cfa0b5), TOBN(0x66beb876, 0xa0f8ea28)}, + {TOBN(0x50d7f531, 0x3476cd0e), TOBN(0xa63d0e65, 0xb08d3949), + TOBN(0x1a09eea9, 0x53479fc6), TOBN(0x82ae9891, 0xf499e742)}}, + {{TOBN(0xab58b910, 0x5ca7d866), TOBN(0x582967e2, 0x3adb3b34), + TOBN(0x89ae4447, 0xcceac0bc), TOBN(0x919c667c, 0x7bf56af5)}, + {TOBN(0x9aec17b1, 0x60f5dcd7), TOBN(0xec697b9f, 0xddcaadbc), + TOBN(0x0b98f341, 0x463467f5), TOBN(0xb187f1f7, 0xa967132f)}}, + {{TOBN(0x90fe7a1d, 0x214aeb18), TOBN(0x1506af3c, 0x741432f7), + TOBN(0xbb5565f9, 0xe591a0c4), TOBN(0x10d41a77, 0xb44f1bc3)}, + {TOBN(0xa09d65e4, 0xa84bde96), TOBN(0x42f060d8, 0xf20a6a1c), + TOBN(0x652a3bfd, 0xf27f9ce7), TOBN(0xb6bdb65c, 0x3b3d739f)}}, + {{TOBN(0xeb5ddcb6, 0xec7fae9f), TOBN(0x995f2714, 0xefb66e5a), + TOBN(0xdee95d8e, 0x69445d52), TOBN(0x1b6c2d46, 0x09e27620)}, + {TOBN(0x32621c31, 0x8129d716), TOBN(0xb03909f1, 0x0958c1aa), + TOBN(0x8c468ef9, 0x1af4af63), TOBN(0x162c429f, 0xfba5cdf6)}}, + {{TOBN(0x2f682343, 0x753b9371), TOBN(0x29cab45a, 0x5f1f9cd7), + TOBN(0x571623ab, 0xb245db96), TOBN(0xc507db09, 0x3fd79999)}, + {TOBN(0x4e2ef652, 0xaf036c32), TOBN(0x86f0cc78, 0x05018e5c), + TOBN(0xc10a73d4, 0xab8be350), TOBN(0x6519b397, 0x7e826327)}}, + {{TOBN(0xe8cb5eef, 0x9c053df7), TOBN(0x8de25b37, 0xb300ea6f), + TOBN(0xdb03fa92, 0xc849cffb), TOBN(0x242e43a7, 0xe84169bb)}, + {TOBN(0xe4fa51f4, 0xdd6f958e), TOBN(0x6925a77f, 0xf4445a8d), + TOBN(0xe6e72a50, 0xe90d8949), TOBN(0xc66648e3, 0x2b1f6390)}}, + {{TOBN(0xb2ab1957, 0x173e460c), TOBN(0x1bbbce75, 0x30704590), + TOBN(0xc0a90dbd, 0xdb1c7162), TOBN(0x505e399e, 0x15cdd65d)}, + {TOBN(0x68434dcb, 0x57797ab7), TOBN(0x60ad35ba, 0x6a2ca8e8), + TOBN(0x4bfdb1e0, 0xde3336c1), TOBN(0xbbef99eb, 0xd8b39015)}}, + {{TOBN(0x6c3b96f3, 0x1711ebec), TOBN(0x2da40f1f, 0xce98fdc4), + TOBN(0xb99774d3, 0x57b4411f), TOBN(0x87c8bdf4, 0x15b65bb6)}, + {TOBN(0xda3a89e3, 0xc2eef12d), TOBN(0xde95bb9b, 0x3c7471f3), + TOBN(0x600f225b, 0xd812c594), TOBN(0x54907c5d, 0x2b75a56b)}}, + {{TOBN(0xa93cc5f0, 0x8db60e35), TOBN(0x743e3cd6, 0xfa833319), + TOBN(0x7dad5c41, 0xf81683c9), TOBN(0x70c1e7d9, 0x9c34107e)}, + {TOBN(0x0edc4a39, 0xa6be0907), TOBN(0x36d47035, 0x86d0b7d3), + TOBN(0x8c76da03, 0x272bfa60), TOBN(0x0b4a07ea, 0x0f08a414)}}, + {{TOBN(0x699e4d29, 0x45c1dd53), TOBN(0xcadc5898, 0x231debb5), + TOBN(0xdf49fcc7, 0xa77f00e0), TOBN(0x93057bbf, 0xa73e5a0e)}, + {TOBN(0x2f8b7ecd, 0x027a4cd1), TOBN(0x114734b3, 0xc614011a), + TOBN(0xe7a01db7, 0x67677c68), TOBN(0x89d9be5e, 0x7e273f4f)}}, + {{TOBN(0xd225cb2e, 0x089808ef), TOBN(0xf1f7a27d, 0xd59e4107), + TOBN(0x53afc761, 0x8211b9c9), TOBN(0x0361bc67, 0xe6819159)}, + {TOBN(0x2a865d0b, 0x7f071426), TOBN(0x6a3c1810, 0xe7072567), + TOBN(0x3e3bca1e, 0x0d6bcabd), TOBN(0xa1b02bc1, 0x408591bc)}}, + {{TOBN(0xe0deee59, 0x31fba239), TOBN(0xf47424d3, 0x98bd91d1), + TOBN(0x0f8886f4, 0x071a3c1d), TOBN(0x3f7d41e8, 0xa819233b)}, + {TOBN(0x708623c2, 0xcf6eb998), TOBN(0x86bb49af, 0x609a287f), + TOBN(0x942bb249, 0x63c90762), TOBN(0x0ef6eea5, 0x55a9654b)}}, + {{TOBN(0x5f6d2d72, 0x36f5defe), TOBN(0xfa9922dc, 0x56f99176), + TOBN(0x6c8c5ece, 0xf78ce0c7), TOBN(0x7b44589d, 0xbe09b55e)}, + {TOBN(0xe11b3bca, 0x9ea83770), TOBN(0xd7fa2c7f, 0x2ab71547), + TOBN(0x2a3dd6fa, 0x2a1ddcc0), TOBN(0x09acb430, 0x5a7b7707)}}, + {{TOBN(0x4add4a2e, 0x649d4e57), TOBN(0xcd53a2b0, 0x1917526e), + TOBN(0xc5262330, 0x20b44ac4), TOBN(0x4028746a, 0xbaa2c31d)}, + {TOBN(0x51318390, 0x64291d4c), TOBN(0xbf48f151, 0xee5ad909), + TOBN(0xcce57f59, 0x7b185681), TOBN(0x7c3ac1b0, 0x4854d442)}}, + {{TOBN(0x65587dc3, 0xc093c171), TOBN(0xae7acb24, 0x24f42b65), + TOBN(0x5a338adb, 0x955996cb), TOBN(0xc8e65675, 0x6051f91b)}, + {TOBN(0x66711fba, 0x28b8d0b1), TOBN(0x15d74137, 0xb6c10a90), + TOBN(0x70cdd7eb, 0x3a232a80), TOBN(0xc9e2f07f, 0x6191ed24)}}, + {{TOBN(0xa80d1db6, 0xf79588c0), TOBN(0xfa52fc69, 0xb55768cc), + TOBN(0x0b4df1ae, 0x7f54438a), TOBN(0x0cadd1a7, 0xf9b46a4f)}, + {TOBN(0xb40ea6b3, 0x1803dd6f), TOBN(0x488e4fa5, 0x55eaae35), + TOBN(0x9f047d55, 0x382e4e16), TOBN(0xc9b5b7e0, 0x2f6e0c98)}}, + {{TOBN(0x6b1bd2d3, 0x95762649), TOBN(0xa9604ee7, 0xc7aea3f6), + TOBN(0x3646ff27, 0x6dc6f896), TOBN(0x9bf0e7f5, 0x2860bad1)}, + {TOBN(0x2d92c821, 0x7cb44b92), TOBN(0xa2f5ce63, 0xaea9c182), + TOBN(0xd0a2afb1, 0x9154a5fd), TOBN(0x482e474c, 0x95801da6)}}, + {{TOBN(0xc19972d0, 0xb611c24b), TOBN(0x1d468e65, 0x60a8f351), + TOBN(0xeb758069, 0x7bcf6421), TOBN(0xec9dd0ee, 0x88fbc491)}, + {TOBN(0x5b59d2bf, 0x956c2e32), TOBN(0x73dc6864, 0xdcddf94e), + TOBN(0xfd5e2321, 0xbcee7665), TOBN(0xa7b4f8ef, 0x5e9a06c4)}}, + {{TOBN(0xfba918dd, 0x7280f855), TOBN(0xbbaac260, 0x8baec688), + TOBN(0xa3b3f00f, 0x33400f42), TOBN(0x3d2dba29, 0x66f2e6e4)}, + {TOBN(0xb6f71a94, 0x98509375), TOBN(0x8f33031f, 0xcea423cc), + TOBN(0x009b8dd0, 0x4807e6fb), TOBN(0x5163cfe5, 0x5cdb954c)}}, + {{TOBN(0x03cc8f17, 0xcf41c6e8), TOBN(0xf1f03c2a, 0x037b925c), + TOBN(0xc39c19cc, 0x66d2427c), TOBN(0x823d24ba, 0x7b6c18e4)}, + {TOBN(0x32ef9013, 0x901f0b4f), TOBN(0x684360f1, 0xf8941c2e), + TOBN(0x0ebaff52, 0x2c28092e), TOBN(0x7891e4e3, 0x256c932f)}}, + {{TOBN(0x51264319, 0xac445e3d), TOBN(0x553432e7, 0x8ea74381), + TOBN(0xe6eeaa69, 0x67e9c50a), TOBN(0x27ced284, 0x62e628c7)}, + {TOBN(0x3f96d375, 0x7a4afa57), TOBN(0xde0a14c3, 0xe484c150), + TOBN(0x364a24eb, 0x38bd9923), TOBN(0x1df18da0, 0xe5177422)}}, + {{TOBN(0x174e8f82, 0xd8d38a9b), TOBN(0x2e97c600, 0xe7de1391), + TOBN(0xc5709850, 0xa1c175dd), TOBN(0x969041a0, 0x32ae5035)}, + {TOBN(0xcbfd533b, 0x76a2086b), TOBN(0xd6bba71b, 0xd7c2e8fe), + TOBN(0xb2d58ee6, 0x099dfb67), TOBN(0x3a8b342d, 0x064a85d9)}}, + {{TOBN(0x3bc07649, 0x522f9be3), TOBN(0x690c075b, 0xdf1f49a8), + TOBN(0x80e1aee8, 0x3854ec42), TOBN(0x2a7dbf44, 0x17689dc7)}, + {TOBN(0xc004fc0e, 0x3faf4078), TOBN(0xb2f02e9e, 0xdf11862c), + TOBN(0xf10a5e0f, 0xa0a1b7b3), TOBN(0x30aca623, 0x8936ec80)}}, + {{TOBN(0xf83cbf05, 0x02f40d9a), TOBN(0x4681c468, 0x2c318a4d), + TOBN(0x98575618, 0x0e9c2674), TOBN(0xbe79d046, 0x1847092e)}, + {TOBN(0xaf1e480a, 0x78bd01e0), TOBN(0x6dd359e4, 0x72a51db9), + TOBN(0x62ce3821, 0xe3afbab6), TOBN(0xc5cee5b6, 0x17733199)}}, + {{TOBN(0xe08b30d4, 0x6ffd9fbb), TOBN(0x6e5bc699, 0x36c610b7), + TOBN(0xf343cff2, 0x9ce262cf), TOBN(0xca2e4e35, 0x68b914c1)}, + {TOBN(0x011d64c0, 0x16de36c5), TOBN(0xe0b10fdd, 0x42e2b829), + TOBN(0x78942981, 0x6685aaf8), TOBN(0xe7511708, 0x230ede97)}}, + {{TOBN(0x671ed8fc, 0x3b922bf8), TOBN(0xe4d8c0a0, 0x4c29b133), + TOBN(0x87eb1239, 0x3b6e99c4), TOBN(0xaff3974c, 0x8793beba)}, + {TOBN(0x03749405, 0x2c18df9b), TOBN(0xc5c3a293, 0x91007139), + TOBN(0x6a77234f, 0xe37a0b95), TOBN(0x02c29a21, 0xb661c96b)}}, + {{TOBN(0xc3aaf1d6, 0x141ecf61), TOBN(0x9195509e, 0x3bb22f53), + TOBN(0x29597404, 0x22d51357), TOBN(0x1b083822, 0x537bed60)}, + {TOBN(0xcd7d6e35, 0xe07289f0), TOBN(0x1f94c48c, 0x6dd86eff), + TOBN(0xc8bb1f82, 0xeb0f9cfa), TOBN(0x9ee0b7e6, 0x1b2eb97d)}}, + {{TOBN(0x5a52fe2e, 0x34d74e31), TOBN(0xa352c310, 0x3bf79ab6), + TOBN(0x97ff6c5a, 0xabfeeb8f), TOBN(0xbfbe8fef, 0xf5c97305)}, + {TOBN(0xd6081ce6, 0xa7904608), TOBN(0x1f812f3a, 0xc4fca249), + TOBN(0x9b24bc9a, 0xb9e5e200), TOBN(0x91022c67, 0x38012ee8)}}, + {{TOBN(0xe83d9c5d, 0x30a713a1), TOBN(0x4876e3f0, 0x84ef0f93), + TOBN(0xc9777029, 0xc1fbf928), TOBN(0xef7a6bb3, 0xbce7d2a4)}, + {TOBN(0xb8067228, 0xdfa2a659), TOBN(0xd5cd3398, 0xd877a48f), + TOBN(0xbea4fd8f, 0x025d0f3f), TOBN(0xd67d2e35, 0x2eae7c2b)}}, + {{TOBN(0x184de7d7, 0xcc5f4394), TOBN(0xb5551b5c, 0x4536e142), + TOBN(0x2e89b212, 0xd34aa60a), TOBN(0x14a96fea, 0xf50051d5)}, + {TOBN(0x4e21ef74, 0x0d12bb0b), TOBN(0xc522f020, 0x60b9677e), + TOBN(0x8b12e467, 0x2df7731d), TOBN(0x39f80382, 0x7b326d31)}}, + {{TOBN(0xdfb8630c, 0x39024a94), TOBN(0xaacb96a8, 0x97319452), + TOBN(0xd68a3961, 0xeda3867c), TOBN(0x0c58e2b0, 0x77c4ffca)}, + {TOBN(0x3d545d63, 0x4da919fa), TOBN(0xef79b69a, 0xf15e2289), + TOBN(0x54bc3d3d, 0x808bab10), TOBN(0xc8ab3007, 0x45f82c37)}}, + {{TOBN(0xc12738b6, 0x7c4a658a), TOBN(0xb3c47639, 0x40e72182), + TOBN(0x3b77be46, 0x8798e44f), TOBN(0xdc047df2, 0x17a7f85f)}, + {TOBN(0x2439d4c5, 0x5e59d92d), TOBN(0xcedca475, 0xe8e64d8d), + TOBN(0xa724cd0d, 0x87ca9b16), TOBN(0x35e4fd59, 0xa5540dfe)}}, + {{TOBN(0xf8c1ff18, 0xe4bcf6b1), TOBN(0x856d6285, 0x295018fa), + TOBN(0x433f665c, 0x3263c949), TOBN(0xa6a76dd6, 0xa1f21409)}, + {TOBN(0x17d32334, 0xcc7b4f79), TOBN(0xa1d03122, 0x06720e4a), + TOBN(0xadb6661d, 0x81d9bed5), TOBN(0xf0d6fb02, 0x11db15d1)}}, + {{TOBN(0x7fd11ad5, 0x1fb747d2), TOBN(0xab50f959, 0x3033762b), + TOBN(0x2a7e711b, 0xfbefaf5a), TOBN(0xc7393278, 0x3fef2bbf)}, + {TOBN(0xe29fa244, 0x0df6f9be), TOBN(0x9092757b, 0x71efd215), + TOBN(0xee60e311, 0x4f3d6fd9), TOBN(0x338542d4, 0x0acfb78b)}}, + {{TOBN(0x44a23f08, 0x38961a0f), TOBN(0x1426eade, 0x986987ca), + TOBN(0x36e6ee2e, 0x4a863cc6), TOBN(0x48059420, 0x628b8b79)}, + {TOBN(0x30303ad8, 0x7396e1de), TOBN(0x5c8bdc48, 0x38c5aad1), + TOBN(0x3e40e11f, 0x5c8f5066), TOBN(0xabd6e768, 0x8d246bbd)}}, + {{TOBN(0x68aa40bb, 0x23330a01), TOBN(0xd23f5ee4, 0xc34eafa0), + TOBN(0x3bbee315, 0x5de02c21), TOBN(0x18dd4397, 0xd1d8dd06)}, + {TOBN(0x3ba1939a, 0x122d7b44), TOBN(0xe6d3b40a, 0xa33870d6), + TOBN(0x8e620f70, 0x1c4fe3f8), TOBN(0xf6bba1a5, 0xd3a50cbf)}}, + {{TOBN(0x4a78bde5, 0xcfc0aee0), TOBN(0x847edc46, 0xc08c50bd), + TOBN(0xbaa2439c, 0xad63c9b2), TOBN(0xceb4a728, 0x10fc2acb)}, + {TOBN(0xa419e40e, 0x26da033d), TOBN(0x6cc3889d, 0x03e02683), + TOBN(0x1cd28559, 0xfdccf725), TOBN(0x0fd7e0f1, 0x8d13d208)}}, + {{TOBN(0x01b9733b, 0x1f0df9d4), TOBN(0x8cc2c5f3, 0xa2b5e4f3), + TOBN(0x43053bfa, 0x3a304fd4), TOBN(0x8e87665c, 0x0a9f1aa7)}, + {TOBN(0x087f29ec, 0xd73dc965), TOBN(0x15ace455, 0x3e9023db), + TOBN(0x2370e309, 0x2bce28b4), TOBN(0xf9723442, 0xb6b1e84a)}}, + {{TOBN(0xbeee662e, 0xb72d9f26), TOBN(0xb19396de, 0xf0e47109), + TOBN(0x85b1fa73, 0xe13289d0), TOBN(0x436cf77e, 0x54e58e32)}, + {TOBN(0x0ec833b3, 0xe990ef77), TOBN(0x7373e3ed, 0x1b11fc25), + TOBN(0xbe0eda87, 0x0fc332ce), TOBN(0xced04970, 0x8d7ea856)}}, + {{TOBN(0xf85ff785, 0x7e977ca0), TOBN(0xb66ee8da, 0xdfdd5d2b), + TOBN(0xf5e37950, 0x905af461), TOBN(0x587b9090, 0x966d487c)}, + {TOBN(0x6a198a1b, 0x32ba0127), TOBN(0xa7720e07, 0x141615ac), + TOBN(0xa23f3499, 0x996ef2f2), TOBN(0xef5f64b4, 0x470bcb3d)}}, + {{TOBN(0xa526a962, 0x92b8c559), TOBN(0x0c14aac0, 0x69740a0f), + TOBN(0x0d41a9e3, 0xa6bdc0a5), TOBN(0x97d52106, 0x9c48aef4)}, + {TOBN(0xcf16bd30, 0x3e7c253b), TOBN(0xcc834b1a, 0x47fdedc1), + TOBN(0x7362c6e5, 0x373aab2e), TOBN(0x264ed85e, 0xc5f590ff)}}, + {{TOBN(0x7a46d9c0, 0x66d41870), TOBN(0xa50c20b1, 0x4787ba09), + TOBN(0x185e7e51, 0xe3d44635), TOBN(0xb3b3e080, 0x31e2d8dc)}, + {TOBN(0xbed1e558, 0xa179e9d9), TOBN(0x2daa3f79, 0x74a76781), + TOBN(0x4372baf2, 0x3a40864f), TOBN(0x46900c54, 0x4fe75cb5)}}, + {{TOBN(0xb95f171e, 0xf76765d0), TOBN(0x4ad726d2, 0x95c87502), + TOBN(0x2ec769da, 0x4d7c99bd), TOBN(0x5e2ddd19, 0xc36cdfa8)}, + {TOBN(0xc22117fc, 0xa93e6dea), TOBN(0xe8a2583b, 0x93771123), + TOBN(0xbe2f6089, 0xfa08a3a2), TOBN(0x4809d5ed, 0x8f0e1112)}}, + {{TOBN(0x3b414aa3, 0xda7a095e), TOBN(0x9049acf1, 0x26f5aadd), + TOBN(0x78d46a4d, 0x6be8b84a), TOBN(0xd66b1963, 0xb732b9b3)}, + {TOBN(0x5c2ac2a0, 0xde6e9555), TOBN(0xcf52d098, 0xb5bd8770), + TOBN(0x15a15fa6, 0x0fd28921), TOBN(0x56ccb81e, 0x8b27536d)}}, + {{TOBN(0x0f0d8ab8, 0x9f4ccbb8), TOBN(0xed5f44d2, 0xdb221729), + TOBN(0x43141988, 0x00bed10c), TOBN(0xc94348a4, 0x1d735b8b)}, + {TOBN(0x79f3e9c4, 0x29ef8479), TOBN(0x4c13a4e3, 0x614c693f), + TOBN(0x32c9af56, 0x8e143a14), TOBN(0xbc517799, 0xe29ac5c4)}}, + {{TOBN(0x05e17992, 0x2774856f), TOBN(0x6e52fb05, 0x6c1bf55f), + TOBN(0xaeda4225, 0xe4f19e16), TOBN(0x70f4728a, 0xaf5ccb26)}, + {TOBN(0x5d2118d1, 0xb2947f22), TOBN(0xc827ea16, 0x281d6fb9), + TOBN(0x8412328d, 0x8cf0eabd), TOBN(0x45ee9fb2, 0x03ef9dcf)}}, + {{TOBN(0x8e700421, 0xbb937d63), TOBN(0xdf8ff2d5, 0xcc4b37a6), + TOBN(0xa4c0d5b2, 0x5ced7b68), TOBN(0x6537c1ef, 0xc7308f59)}, + {TOBN(0x25ce6a26, 0x3b37f8e8), TOBN(0x170e9a9b, 0xdeebc6ce), + TOBN(0xdd037952, 0x8728d72c), TOBN(0x445b0e55, 0x850154bc)}}, + {{TOBN(0x4b7d0e06, 0x83a7337b), TOBN(0x1e3416d4, 0xffecf249), + TOBN(0x24840eff, 0x66a2b71f), TOBN(0xd0d9a50a, 0xb37cc26d)}, + {TOBN(0xe2198150, 0x6fe28ef7), TOBN(0x3cc5ef16, 0x23324c7f), + TOBN(0x220f3455, 0x769b5263), TOBN(0xe2ade2f1, 0xa10bf475)}}, + {{TOBN(0x28cd20fa, 0x458d3671), TOBN(0x1549722c, 0x2dc4847b), + TOBN(0x6dd01e55, 0x591941e3), TOBN(0x0e6fbcea, 0x27128ccb)}, + {TOBN(0xae1a1e6b, 0x3bef0262), TOBN(0xfa8c472c, 0x8f54e103), + TOBN(0x7539c0a8, 0x72c052ec), TOBN(0xd7b27369, 0x5a3490e9)}}, + {{TOBN(0x143fe1f1, 0x71684349), TOBN(0x36b4722e, 0x32e19b97), + TOBN(0xdc059227, 0x90980aff), TOBN(0x175c9c88, 0x9e13d674)}, + {TOBN(0xa7de5b22, 0x6e6bfdb1), TOBN(0x5ea5b7b2, 0xbedb4b46), + TOBN(0xd5570191, 0xd34a6e44), TOBN(0xfcf60d2e, 0xa24ff7e6)}}, + {{TOBN(0x614a392d, 0x677819e1), TOBN(0x7be74c7e, 0xaa5a29e8), + TOBN(0xab50fece, 0x63c85f3f), TOBN(0xaca2e2a9, 0x46cab337)}, + {TOBN(0x7f700388, 0x122a6fe3), TOBN(0xdb69f703, 0x882a04a8), + TOBN(0x9a77935d, 0xcf7aed57), TOBN(0xdf16207c, 0x8d91c86f)}}, + {{TOBN(0x2fca49ab, 0x63ed9998), TOBN(0xa3125c44, 0xa77ddf96), + TOBN(0x05dd8a86, 0x24344072), TOBN(0xa023dda2, 0xfec3fb56)}, + {TOBN(0x421b41fc, 0x0c743032), TOBN(0x4f2120c1, 0x5e438639), + TOBN(0xfb7cae51, 0xc83c1b07), TOBN(0xb2370caa, 0xcac2171a)}}, + {{TOBN(0x2eb2d962, 0x6cc820fb), TOBN(0x59feee5c, 0xb85a44bf), + TOBN(0x94620fca, 0x5b6598f0), TOBN(0x6b922cae, 0x7e314051)}, + {TOBN(0xff8745ad, 0x106bed4e), TOBN(0x546e71f5, 0xdfa1e9ab), + TOBN(0x935c1e48, 0x1ec29487), TOBN(0x9509216c, 0x4d936530)}}, + {{TOBN(0xc7ca3067, 0x85c9a2db), TOBN(0xd6ae5152, 0x6be8606f), + TOBN(0x09dbcae6, 0xe14c651d), TOBN(0xc9536e23, 0x9bc32f96)}, + {TOBN(0xa90535a9, 0x34521b03), TOBN(0xf39c526c, 0x878756ff), + TOBN(0x383172ec, 0x8aedf03c), TOBN(0x20a8075e, 0xefe0c034)}}, + {{TOBN(0xf22f9c62, 0x64026422), TOBN(0x8dd10780, 0x24b9d076), + TOBN(0x944c742a, 0x3bef2950), TOBN(0x55b9502e, 0x88a2b00b)}, + {TOBN(0xa59e14b4, 0x86a09817), TOBN(0xa39dd3ac, 0x47bb4071), + TOBN(0x55137f66, 0x3be0592f), TOBN(0x07fcafd4, 0xc9e63f5b)}}, + {{TOBN(0x963652ee, 0x346eb226), TOBN(0x7dfab085, 0xec2facb7), + TOBN(0x273bf2b8, 0x691add26), TOBN(0x30d74540, 0xf2b46c44)}, + {TOBN(0x05e8e73e, 0xf2c2d065), TOBN(0xff9b8a00, 0xd42eeac9), + TOBN(0x2fcbd205, 0x97209d22), TOBN(0xeb740ffa, 0xde14ea2c)}}, + {{TOBN(0xc71ff913, 0xa8aef518), TOBN(0x7bfc74bb, 0xfff4cfa2), + TOBN(0x1716680c, 0xb6b36048), TOBN(0x121b2cce, 0x9ef79af1)}, + {TOBN(0xbff3c836, 0xa01eb3d3), TOBN(0x50eb1c6a, 0x5f79077b), + TOBN(0xa48c32d6, 0xa004bbcf), TOBN(0x47a59316, 0x7d64f61d)}}, + {{TOBN(0x6068147f, 0x93102016), TOBN(0x12c5f654, 0x94d12576), + TOBN(0xefb071a7, 0xc9bc6b91), TOBN(0x7c2da0c5, 0x6e23ea95)}, + {TOBN(0xf4fd45b6, 0xd4a1dd5d), TOBN(0x3e7ad9b6, 0x9122b13c), + TOBN(0x342ca118, 0xe6f57a48), TOBN(0x1c2e94a7, 0x06f8288f)}}, + {{TOBN(0x99e68f07, 0x5a97d231), TOBN(0x7c80de97, 0x4d838758), + TOBN(0xbce0f5d0, 0x05872727), TOBN(0xbe5d95c2, 0x19c4d016)}, + {TOBN(0x921d5cb1, 0x9c2492ee), TOBN(0x42192dc1, 0x404d6fb3), + TOBN(0x4c84dcd1, 0x32f988d3), TOBN(0xde26d61f, 0xa17b8e85)}}, + {{TOBN(0xc466dcb6, 0x137c7408), TOBN(0x9a38d7b6, 0x36a266da), + TOBN(0x7ef5cb06, 0x83bebf1b), TOBN(0xe5cdcbbf, 0x0fd014e3)}, + {TOBN(0x30aa376d, 0xf65965a0), TOBN(0x60fe88c2, 0xebb3e95e), + TOBN(0x33fd0b61, 0x66ee6f20), TOBN(0x8827dcdb, 0x3f41f0a0)}}, + {{TOBN(0xbf8a9d24, 0x0c56c690), TOBN(0x40265dad, 0xddb7641d), + TOBN(0x522b05bf, 0x3a6b662b), TOBN(0x466d1dfe, 0xb1478c9b)}, + {TOBN(0xaa616962, 0x1484469b), TOBN(0x0db60549, 0x02df8f9f), + TOBN(0xc37bca02, 0x3cb8bf51), TOBN(0x5effe346, 0x21371ce8)}}, + {{TOBN(0xe8f65264, 0xff112c32), TOBN(0x8a9c736d, 0x7b971fb2), + TOBN(0xa4f19470, 0x7b75080d), TOBN(0xfc3f2c5a, 0x8839c59b)}, + {TOBN(0x1d6c777e, 0x5aeb49c2), TOBN(0xf3db034d, 0xda1addfe), + TOBN(0xd76fee5a, 0x5535affc), TOBN(0x0853ac70, 0xb92251fd)}}, + {{TOBN(0x37e3d594, 0x8b2a29d5), TOBN(0x28f1f457, 0x4de00ddb), + TOBN(0x8083c1b5, 0xf42c328b), TOBN(0xd8ef1d8f, 0xe493c73b)}, + {TOBN(0x96fb6260, 0x41dc61bd), TOBN(0xf74e8a9d, 0x27ee2f8a), + TOBN(0x7c605a80, 0x2c946a5d), TOBN(0xeed48d65, 0x3839ccfd)}}, + {{TOBN(0x9894344f, 0x3a29467a), TOBN(0xde81e949, 0xc51eba6d), + TOBN(0xdaea066b, 0xa5e5c2f2), TOBN(0x3fc8a614, 0x08c8c7b3)}, + {TOBN(0x7adff88f, 0x06d0de9f), TOBN(0xbbc11cf5, 0x3b75ce0a), + TOBN(0x9fbb7acc, 0xfbbc87d5), TOBN(0xa1458e26, 0x7badfde2)}}}, + {{{TOBN(0x1cb43668, 0xe039c256), TOBN(0x5f26fb8b, 0x7c17fd5d), + TOBN(0xeee426af, 0x79aa062b), TOBN(0x072002d0, 0xd78fbf04)}, + {TOBN(0x4c9ca237, 0xe84fb7e3), TOBN(0xb401d8a1, 0x0c82133d), + TOBN(0xaaa52592, 0x6d7e4181), TOBN(0xe9430833, 0x73dbb152)}}, + {{TOBN(0xf92dda31, 0xbe24319a), TOBN(0x03f7d28b, 0xe095a8e7), + TOBN(0xa52fe840, 0x98782185), TOBN(0x276ddafe, 0x29c24dbc)}, + {TOBN(0x80cd5496, 0x1d7a64eb), TOBN(0xe4360889, 0x7f1dbe42), + TOBN(0x2f81a877, 0x8438d2d5), TOBN(0x7e4d52a8, 0x85169036)}}, + {{TOBN(0x19e3d5b1, 0x1d59715d), TOBN(0xc7eaa762, 0xd788983e), + TOBN(0xe5a730b0, 0xabf1f248), TOBN(0xfbab8084, 0xfae3fd83)}, + {TOBN(0x65e50d21, 0x53765b2f), TOBN(0xbdd4e083, 0xfa127f3d), + TOBN(0x9cf3c074, 0x397b1b10), TOBN(0x59f8090c, 0xb1b59fd3)}}, + {{TOBN(0x7b15fd9d, 0x615faa8f), TOBN(0x8fa1eb40, 0x968554ed), + TOBN(0x7bb4447e, 0x7aa44882), TOBN(0x2bb2d0d1, 0x029fff32)}, + {TOBN(0x075e2a64, 0x6caa6d2f), TOBN(0x8eb879de, 0x22e7351b), + TOBN(0xbcd5624e, 0x9a506c62), TOBN(0x218eaef0, 0xa87e24dc)}}, + {{TOBN(0x37e56847, 0x44ddfa35), TOBN(0x9ccfc5c5, 0xdab3f747), + TOBN(0x9ac1df3f, 0x1ee96cf4), TOBN(0x0c0571a1, 0x3b480b8f)}, + {TOBN(0x2fbeb3d5, 0x4b3a7b3c), TOBN(0x35c03669, 0x5dcdbb99), + TOBN(0x52a0f5dc, 0xb2415b3a), TOBN(0xd57759b4, 0x4413ed9a)}}, + {{TOBN(0x1fe647d8, 0x3d30a2c5), TOBN(0x0857f77e, 0xf78a81dc), + TOBN(0x11d5a334, 0x131a4a9b), TOBN(0xc0a94af9, 0x29d393f5)}, + {TOBN(0xbc3a5c0b, 0xdaa6ec1a), TOBN(0xba9fe493, 0x88d2d7ed), + TOBN(0xbb4335b4, 0xbb614797), TOBN(0x991c4d68, 0x72f83533)}}, + {{TOBN(0x53258c28, 0xd2f01cb3), TOBN(0x93d6eaa3, 0xd75db0b1), + TOBN(0x419a2b0d, 0xe87d0db4), TOBN(0xa1e48f03, 0xd8fe8493)}, + {TOBN(0xf747faf6, 0xc508b23a), TOBN(0xf137571a, 0x35d53549), + TOBN(0x9f5e58e2, 0xfcf9b838), TOBN(0xc7186cee, 0xa7fd3cf5)}}, + {{TOBN(0x77b868ce, 0xe978a1d3), TOBN(0xe3a68b33, 0x7ab92d04), + TOBN(0x51029794, 0x87a5b862), TOBN(0x5f0606c3, 0x3a61d41d)}, + {TOBN(0x2814be27, 0x6f9326f1), TOBN(0x2f521c14, 0xc6fe3c2e), + TOBN(0x17464d7d, 0xacdf7351), TOBN(0x10f5f9d3, 0x777f7e44)}}, + {{TOBN(0xce8e616b, 0x269fb37d), TOBN(0xaaf73804, 0x7de62de5), + TOBN(0xaba11175, 0x4fdd4153), TOBN(0x515759ba, 0x3770b49b)}, + {TOBN(0x8b09ebf8, 0xaa423a61), TOBN(0x592245a1, 0xcd41fb92), + TOBN(0x1cba8ec1, 0x9b4c8936), TOBN(0xa87e91e3, 0xaf36710e)}}, + {{TOBN(0x1fd84ce4, 0x3d34a2e3), TOBN(0xee3759ce, 0xb43b5d61), + TOBN(0x895bc78c, 0x619186c7), TOBN(0xf19c3809, 0xcbb9725a)}, + {TOBN(0xc0be21aa, 0xde744b1f), TOBN(0xa7d222b0, 0x60f8056b), + TOBN(0x74be6157, 0xb23efe11), TOBN(0x6fab2b4f, 0x0cd68253)}}, + {{TOBN(0xad33ea5f, 0x4bf1d725), TOBN(0x9c1d8ee2, 0x4f6c950f), + TOBN(0x544ee78a, 0xa377af06), TOBN(0x54f489bb, 0x94a113e1)}, + {TOBN(0x8f11d634, 0x992fb7e8), TOBN(0x0169a7aa, 0xa2a44347), + TOBN(0x1d49d4af, 0x95020e00), TOBN(0x95945722, 0xe08e120b)}}, + {{TOBN(0xb6e33878, 0xa4d32282), TOBN(0xe36e029d, 0x48020ae7), + TOBN(0xe05847fb, 0x37a9b750), TOBN(0xf876812c, 0xb29e3819)}, + {TOBN(0x84ad138e, 0xd23a17f0), TOBN(0x6d7b4480, 0xf0b3950e), + TOBN(0xdfa8aef4, 0x2fd67ae0), TOBN(0x8d3eea24, 0x52333af6)}}, + {{TOBN(0x0d052075, 0xb15d5acc), TOBN(0xc6d9c79f, 0xbd815bc4), + TOBN(0x8dcafd88, 0xdfa36cf2), TOBN(0x908ccbe2, 0x38aa9070)}, + {TOBN(0x638722c4, 0xba35afce), TOBN(0x5a3da8b0, 0xfd6abf0b), + TOBN(0x2dce252c, 0xc9c335c1), TOBN(0x84e7f0de, 0x65aa799b)}}, + {{TOBN(0x2101a522, 0xb99a72cb), TOBN(0x06de6e67, 0x87618016), + TOBN(0x5ff8c7cd, 0xe6f3653e), TOBN(0x0a821ab5, 0xc7a6754a)}, + {TOBN(0x7e3fa52b, 0x7cb0b5a2), TOBN(0xa7fb121c, 0xc9048790), + TOBN(0x1a725020, 0x06ce053a), TOBN(0xb490a31f, 0x04e929b0)}}, + {{TOBN(0xe17be47d, 0x62dd61ad), TOBN(0x781a961c, 0x6be01371), + TOBN(0x1063bfd3, 0xdae3cbba), TOBN(0x35647406, 0x7f73c9ba)}, + {TOBN(0xf50e957b, 0x2736a129), TOBN(0xa6313702, 0xed13f256), + TOBN(0x9436ee65, 0x3a19fcc5), TOBN(0xcf2bdb29, 0xe7a4c8b6)}}, + {{TOBN(0xb06b1244, 0xc5f95cd8), TOBN(0xda8c8af0, 0xf4ab95f4), + TOBN(0x1bae59c2, 0xb9e5836d), TOBN(0x07d51e7e, 0x3acffffc)}, + {TOBN(0x01e15e6a, 0xc2ccbcda), TOBN(0x3bc1923f, 0x8528c3e0), + TOBN(0x43324577, 0xa49fead4), TOBN(0x61a1b884, 0x2aa7a711)}}, + {{TOBN(0xf9a86e08, 0x700230ef), TOBN(0x0af585a1, 0xbd19adf8), + TOBN(0x7645f361, 0xf55ad8f2), TOBN(0x6e676223, 0x46c3614c)}, + {TOBN(0x23cb257c, 0x4e774d3f), TOBN(0x82a38513, 0xac102d1b), + TOBN(0x9bcddd88, 0x7b126aa5), TOBN(0xe716998b, 0xeefd3ee4)}}, + {{TOBN(0x4239d571, 0xfb167583), TOBN(0xdd011c78, 0xd16c8f8a), + TOBN(0x271c2895, 0x69a27519), TOBN(0x9ce0a3b7, 0xd2d64b6a)}, + {TOBN(0x8c977289, 0xd5ec6738), TOBN(0xa3b49f9a, 0x8840ef6b), + TOBN(0x808c14c9, 0x9a453419), TOBN(0x5c00295b, 0x0cf0a2d5)}}, + {{TOBN(0x524414fb, 0x1d4bcc76), TOBN(0xb07691d2, 0x459a88f1), + TOBN(0x77f43263, 0xf70d110f), TOBN(0x64ada5e0, 0xb7abf9f3)}, + {TOBN(0xafd0f94e, 0x5b544cf5), TOBN(0xb4a13a15, 0xfd2713fe), + TOBN(0xb99b7d6e, 0x250c74f4), TOBN(0x097f2f73, 0x20324e45)}}, + {{TOBN(0x994b37d8, 0xaffa8208), TOBN(0xc3c31b0b, 0xdc29aafc), + TOBN(0x3da74651, 0x7a3a607f), TOBN(0xd8e1b8c1, 0xfe6955d6)}, + {TOBN(0x716e1815, 0xc8418682), TOBN(0x541d487f, 0x7dc91d97), + TOBN(0x48a04669, 0xc6996982), TOBN(0xf39cab15, 0x83a6502e)}}, + {{TOBN(0x025801a0, 0xe68db055), TOBN(0xf3569758, 0xba3338d5), + TOBN(0xb0c8c0aa, 0xee2afa84), TOBN(0x4f6985d3, 0xfb6562d1)}, + {TOBN(0x351f1f15, 0x132ed17a), TOBN(0x510ed0b4, 0xc04365fe), + TOBN(0xa3f98138, 0xe5b1f066), TOBN(0xbc9d95d6, 0x32df03dc)}}, + {{TOBN(0xa83ccf6e, 0x19abd09e), TOBN(0x0b4097c1, 0x4ff17edb), + TOBN(0x58a5c478, 0xd64a06ce), TOBN(0x2ddcc3fd, 0x544a58fd)}, + {TOBN(0xd449503d, 0x9e8153b8), TOBN(0x3324fd02, 0x7774179b), + TOBN(0xaf5d47c8, 0xdbd9120c), TOBN(0xeb860162, 0x34fa94db)}}, + {{TOBN(0x5817bdd1, 0x972f07f4), TOBN(0xe5579e2e, 0xd27bbceb), + TOBN(0x86847a1f, 0x5f11e5a6), TOBN(0xb39ed255, 0x7c3cf048)}, + {TOBN(0xe1076417, 0xa2f62e55), TOBN(0x6b9ab38f, 0x1bcf82a2), + TOBN(0x4bb7c319, 0x7aeb29f9), TOBN(0xf6d17da3, 0x17227a46)}}, + {{TOBN(0xab53ddbd, 0x0f968c00), TOBN(0xa03da7ec, 0x000c880b), + TOBN(0x7b239624, 0x6a9ad24d), TOBN(0x612c0401, 0x01ec60d0)}, + {TOBN(0x70d10493, 0x109f5df1), TOBN(0xfbda4030, 0x80af7550), + TOBN(0x30b93f95, 0xc6b9a9b3), TOBN(0x0c74ec71, 0x007d9418)}}, + {{TOBN(0x94175564, 0x6edb951f), TOBN(0x5f4a9d78, 0x7f22c282), + TOBN(0xb7870895, 0xb38d1196), TOBN(0xbc593df3, 0xa228ce7c)}, + {TOBN(0xc78c5bd4, 0x6af3641a), TOBN(0x7802200b, 0x3d9b3dcc), + TOBN(0x0dc73f32, 0x8be33304), TOBN(0x847ed87d, 0x61ffb79a)}}, + {{TOBN(0xf85c974e, 0x6d671192), TOBN(0x1e14100a, 0xde16f60f), + TOBN(0x45cb0d5a, 0x95c38797), TOBN(0x18923bba, 0x9b022da4)}, + {TOBN(0xef2be899, 0xbbe7e86e), TOBN(0x4a1510ee, 0x216067bf), + TOBN(0xd98c8154, 0x84d5ce3e), TOBN(0x1af777f0, 0xf92a2b90)}}, + {{TOBN(0x9fbcb400, 0x4ef65724), TOBN(0x3e04a4c9, 0x3c0ca6fe), + TOBN(0xfb3e2cb5, 0x55002994), TOBN(0x1f3a93c5, 0x5363ecab)}, + {TOBN(0x1fe00efe, 0x3923555b), TOBN(0x744bedd9, 0x1e1751ea), + TOBN(0x3fb2db59, 0x6ab69357), TOBN(0x8dbd7365, 0xf5e6618b)}}, + {{TOBN(0x99d53099, 0xdf1ea40e), TOBN(0xb3f24a0b, 0x57d61e64), + TOBN(0xd088a198, 0x596eb812), TOBN(0x22c8361b, 0x5762940b)}, + {TOBN(0x66f01f97, 0xf9c0d95c), TOBN(0x88461172, 0x8e43cdae), + TOBN(0x11599a7f, 0xb72b15c3), TOBN(0x135a7536, 0x420d95cc)}}, + {{TOBN(0x2dcdf0f7, 0x5f7ae2f6), TOBN(0x15fc6e1d, 0xd7fa6da2), + TOBN(0x81ca829a, 0xd1d441b6), TOBN(0x84c10cf8, 0x04a106b6)}, + {TOBN(0xa9b26c95, 0xa73fbbd0), TOBN(0x7f24e0cb, 0x4d8f6ee8), + TOBN(0x48b45937, 0x1e25a043), TOBN(0xf8a74fca, 0x036f3dfe)}}, + {{TOBN(0x1ed46585, 0xc9f84296), TOBN(0x7fbaa8fb, 0x3bc278b0), + TOBN(0xa8e96cd4, 0x6c4fcbd0), TOBN(0x940a1202, 0x73b60a5f)}, + {TOBN(0x34aae120, 0x55a4aec8), TOBN(0x550e9a74, 0xdbd742f0), + TOBN(0x794456d7, 0x228c68ab), TOBN(0x492f8868, 0xa4e25ec6)}}, + {{TOBN(0x682915ad, 0xb2d8f398), TOBN(0xf13b51cc, 0x5b84c953), + TOBN(0xcda90ab8, 0x5bb917d6), TOBN(0x4b615560, 0x4ea3dee1)}, + {TOBN(0x578b4e85, 0x0a52c1c8), TOBN(0xeab1a695, 0x20b75fc4), + TOBN(0x60c14f3c, 0xaa0bb3c6), TOBN(0x220f448a, 0xb8216094)}}, + {{TOBN(0x4fe7ee31, 0xb0e63d34), TOBN(0xf4600572, 0xa9e54fab), + TOBN(0xc0493334, 0xd5e7b5a4), TOBN(0x8589fb92, 0x06d54831)}, + {TOBN(0xaa70f5cc, 0x6583553a), TOBN(0x0879094a, 0xe25649e5), + TOBN(0xcc904507, 0x10044652), TOBN(0xebb0696d, 0x02541c4f)}}, + {{TOBN(0x5a171fde, 0xb9718710), TOBN(0x38f1bed8, 0xf374a9f5), + TOBN(0xc8c582e1, 0xba39bdc1), TOBN(0xfc457b0a, 0x908cc0ce)}, + {TOBN(0x9a187fd4, 0x883841e2), TOBN(0x8ec25b39, 0x38725381), + TOBN(0x2553ed05, 0x96f84395), TOBN(0x095c7661, 0x6f6c6897)}}, + {{TOBN(0x917ac85c, 0x4bdc5610), TOBN(0xb2885fe4, 0x179eb301), + TOBN(0x5fc65547, 0x8b78bdcc), TOBN(0x4a9fc893, 0xe59e4699)}, + {TOBN(0xbb7ff0cd, 0x3ce299af), TOBN(0x195be9b3, 0xadf38b20), + TOBN(0x6a929c87, 0xd38ddb8f), TOBN(0x55fcc99c, 0xb21a51b9)}}, + {{TOBN(0x2b695b4c, 0x721a4593), TOBN(0xed1e9a15, 0x768eaac2), + TOBN(0xfb63d71c, 0x7489f914), TOBN(0xf98ba31c, 0x78118910)}, + {TOBN(0x80291373, 0x9b128eb4), TOBN(0x7801214e, 0xd448af4a), + TOBN(0xdbd2e22b, 0x55418dd3), TOBN(0xeffb3c0d, 0xd3998242)}}, + {{TOBN(0xdfa6077c, 0xc7bf3827), TOBN(0xf2165bcb, 0x47f8238f), + TOBN(0xfe37cf68, 0x8564d554), TOBN(0xe5f825c4, 0x0a81fb98)}, + {TOBN(0x43cc4f67, 0xffed4d6f), TOBN(0xbc609578, 0xb50a34b0), + TOBN(0x8aa8fcf9, 0x5041faf1), TOBN(0x5659f053, 0x651773b6)}}, + {{TOBN(0xe87582c3, 0x6044d63b), TOBN(0xa6089409, 0x0cdb0ca0), + TOBN(0x8c993e0f, 0xbfb2bcf6), TOBN(0xfc64a719, 0x45985cfc)}, + {TOBN(0x15c4da80, 0x83dbedba), TOBN(0x804ae112, 0x2be67df7), + TOBN(0xda4c9658, 0xa23defde), TOBN(0x12002ddd, 0x5156e0d3)}}, + {{TOBN(0xe68eae89, 0x5dd21b96), TOBN(0x8b99f28b, 0xcf44624d), + TOBN(0x0ae00808, 0x1ec8897a), TOBN(0xdd0a9303, 0x6712f76e)}, + {TOBN(0x96237522, 0x4e233de4), TOBN(0x192445b1, 0x2b36a8a5), + TOBN(0xabf9ff74, 0x023993d9), TOBN(0x21f37bf4, 0x2aad4a8f)}}, + {{TOBN(0x340a4349, 0xf8bd2bbd), TOBN(0x1d902cd9, 0x4868195d), + TOBN(0x3d27bbf1, 0xe5fdb6f1), TOBN(0x7a5ab088, 0x124f9f1c)}, + {TOBN(0xc466ab06, 0xf7a09e03), TOBN(0x2f8a1977, 0x31f2c123), + TOBN(0xda355dc7, 0x041b6657), TOBN(0xcb840d12, 0x8ece2a7c)}}, + {{TOBN(0xb600ad9f, 0x7db32675), TOBN(0x78fea133, 0x07a06f1b), + TOBN(0x5d032269, 0xb31f6094), TOBN(0x07753ef5, 0x83ec37aa)}, + {TOBN(0x03485aed, 0x9c0bea78), TOBN(0x41bb3989, 0xbc3f4524), + TOBN(0x09403761, 0x697f726d), TOBN(0x6109beb3, 0xdf394820)}}, + {{TOBN(0x804111ea, 0x3b6d1145), TOBN(0xb6271ea9, 0xa8582654), + TOBN(0x619615e6, 0x24e66562), TOBN(0xa2554945, 0xd7b6ad9c)}, + {TOBN(0xd9c4985e, 0x99bfe35f), TOBN(0x9770ccc0, 0x7b51cdf6), + TOBN(0x7c327013, 0x92881832), TOBN(0x8777d45f, 0x286b26d1)}}, + {{TOBN(0x9bbeda22, 0xd847999d), TOBN(0x03aa33b6, 0xc3525d32), + TOBN(0x4b7b96d4, 0x28a959a1), TOBN(0xbb3786e5, 0x31e5d234)}, + {TOBN(0xaeb5d3ce, 0x6961f247), TOBN(0x20aa85af, 0x02f93d3f), + TOBN(0x9cd1ad3d, 0xd7a7ae4f), TOBN(0xbf6688f0, 0x781adaa8)}}, + {{TOBN(0xb1b40e86, 0x7469cead), TOBN(0x1904c524, 0x309fca48), + TOBN(0x9b7312af, 0x4b54bbc7), TOBN(0xbe24bf8f, 0x593affa2)}, + {TOBN(0xbe5e0790, 0xbd98764b), TOBN(0xa0f45f17, 0xa26e299e), + TOBN(0x4af0d2c2, 0x6b8fe4c7), TOBN(0xef170db1, 0x8ae8a3e6)}}, + {{TOBN(0x0e8d61a0, 0x29e0ccc1), TOBN(0xcd53e87e, 0x60ad36ca), + TOBN(0x328c6623, 0xc8173822), TOBN(0x7ee1767d, 0xa496be55)}, + {TOBN(0x89f13259, 0x648945af), TOBN(0x9e45a5fd, 0x25c8009c), + TOBN(0xaf2febd9, 0x1f61ab8c), TOBN(0x43f6bc86, 0x8a275385)}}, + {{TOBN(0x87792348, 0xf2142e79), TOBN(0x17d89259, 0xc6e6238a), + TOBN(0x7536d2f6, 0x4a839d9b), TOBN(0x1f428fce, 0x76a1fbdc)}, + {TOBN(0x1c109601, 0x0db06dfe), TOBN(0xbfc16bc1, 0x50a3a3cc), + TOBN(0xf9cbd9ec, 0x9b30f41b), TOBN(0x5b5da0d6, 0x00138cce)}}, + {{TOBN(0xec1d0a48, 0x56ef96a7), TOBN(0xb47eb848, 0x982bf842), + TOBN(0x66deae32, 0xec3f700d), TOBN(0x4e43c42c, 0xaa1181e0)}, + {TOBN(0xa1d72a31, 0xd1a4aa2a), TOBN(0x440d4668, 0xc004f3ce), + TOBN(0x0d6a2d3b, 0x45fe8a7a), TOBN(0x820e52e2, 0xfb128365)}}, + {{TOBN(0x29ac5fcf, 0x25e51b09), TOBN(0x180cd2bf, 0x2023d159), + TOBN(0xa9892171, 0xa1ebf90e), TOBN(0xf97c4c87, 0x7c132181)}, + {TOBN(0x9f1dc724, 0xc03dbb7e), TOBN(0xae043765, 0x018cbbe4), + TOBN(0xfb0b2a36, 0x0767d153), TOBN(0xa8e2f4d6, 0x249cbaeb)}}, + {{TOBN(0x172a5247, 0xd95ea168), TOBN(0x1758fada, 0x2970764a), + TOBN(0xac803a51, 0x1d978169), TOBN(0x299cfe2e, 0xde77e01b)}, + {TOBN(0x652a1e17, 0xb0a98927), TOBN(0x2e26e1d1, 0x20014495), + TOBN(0x7ae0af9f, 0x7175b56a), TOBN(0xc2e22a80, 0xd64b9f95)}}, + {{TOBN(0x4d0ff9fb, 0xd90a060a), TOBN(0x496a27db, 0xbaf38085), + TOBN(0x32305401, 0xda776bcf), TOBN(0xb8cdcef6, 0x725f209e)}, + {TOBN(0x61ba0f37, 0x436a0bba), TOBN(0x263fa108, 0x76860049), + TOBN(0x92beb98e, 0xda3542cf), TOBN(0xa2d4d14a, 0xd5849538)}}, + {{TOBN(0x989b9d68, 0x12e9a1bc), TOBN(0x61d9075c, 0x5f6e3268), + TOBN(0x352c6aa9, 0x99ace638), TOBN(0xde4e4a55, 0x920f43ff)}, + {TOBN(0xe5e4144a, 0xd673c017), TOBN(0x667417ae, 0x6f6e05ea), + TOBN(0x613416ae, 0xdcd1bd56), TOBN(0x5eb36201, 0x86693711)}}, + {{TOBN(0x2d7bc504, 0x3a1aa914), TOBN(0x175a1299, 0x76dc5975), + TOBN(0xe900e0f2, 0x3fc8125c), TOBN(0x569ef68c, 0x11198875)}, + {TOBN(0x9012db63, 0x63a113b4), TOBN(0xe3bd3f56, 0x98835766), + TOBN(0xa5c94a52, 0x76412dea), TOBN(0xad9e2a09, 0xaa735e5c)}}, + {{TOBN(0x405a984c, 0x508b65e9), TOBN(0xbde4a1d1, 0x6df1a0d1), + TOBN(0x1a9433a1, 0xdfba80da), TOBN(0xe9192ff9, 0x9440ad2e)}, + {TOBN(0x9f649696, 0x5099fe92), TOBN(0x25ddb65c, 0x0b27a54a), + TOBN(0x178279dd, 0xc590da61), TOBN(0x5479a999, 0xfbde681a)}}, + {{TOBN(0xd0e84e05, 0x013fe162), TOBN(0xbe11dc92, 0x632d471b), + TOBN(0xdf0b0c45, 0xfc0e089f), TOBN(0x04fb15b0, 0x4c144025)}, + {TOBN(0xa61d5fc2, 0x13c99927), TOBN(0xa033e9e0, 0x3de2eb35), + TOBN(0xf8185d5c, 0xb8dacbb4), TOBN(0x9a88e265, 0x8644549d)}}, + {{TOBN(0xf717af62, 0x54671ff6), TOBN(0x4bd4241b, 0x5fa58603), + TOBN(0x06fba40b, 0xe67773c0), TOBN(0xc1d933d2, 0x6a2847e9)}, + {TOBN(0xf4f5acf3, 0x689e2c70), TOBN(0x92aab0e7, 0x46bafd31), + TOBN(0x798d76aa, 0x3473f6e5), TOBN(0xcc6641db, 0x93141934)}}, + {{TOBN(0xcae27757, 0xd31e535e), TOBN(0x04cc43b6, 0x87c2ee11), + TOBN(0x8d1f9675, 0x2e029ffa), TOBN(0xc2150672, 0xe4cc7a2c)}, + {TOBN(0x3b03c1e0, 0x8d68b013), TOBN(0xa9d6816f, 0xedf298f3), + TOBN(0x1bfbb529, 0xa2804464), TOBN(0x95a52fae, 0x5db22125)}}, + {{TOBN(0x55b32160, 0x0e1cb64e), TOBN(0x004828f6, 0x7e7fc9fe), + TOBN(0x13394b82, 0x1bb0fb93), TOBN(0xb6293a2d, 0x35f1a920)}, + {TOBN(0xde35ef21, 0xd145d2d9), TOBN(0xbe6225b3, 0xbb8fa603), + TOBN(0x00fc8f6b, 0x32cf252d), TOBN(0xa28e52e6, 0x117cf8c2)}}, + {{TOBN(0x9d1dc89b, 0x4c371e6d), TOBN(0xcebe0675, 0x36ef0f28), + TOBN(0x5de05d09, 0xa4292f81), TOBN(0xa8303593, 0x353e3083)}, + {TOBN(0xa1715b0a, 0x7e37a9bb), TOBN(0x8c56f61e, 0x2b8faec3), + TOBN(0x52507431, 0x33c9b102), TOBN(0x0130cefc, 0xa44431f0)}}, + {{TOBN(0x56039fa0, 0xbd865cfb), TOBN(0x4b03e578, 0xbc5f1dd7), + TOBN(0x40edf2e4, 0xbabe7224), TOBN(0xc752496d, 0x3a1988f6)}, + {TOBN(0xd1572d3b, 0x564beb6b), TOBN(0x0db1d110, 0x39a1c608), + TOBN(0x568d1934, 0x16f60126), TOBN(0x05ae9668, 0xf354af33)}}, + {{TOBN(0x19de6d37, 0xc92544f2), TOBN(0xcc084353, 0xa35837d5), + TOBN(0xcbb6869c, 0x1a514ece), TOBN(0xb633e728, 0x2e1d1066)}, + {TOBN(0xf15dd69f, 0x936c581c), TOBN(0x96e7b8ce, 0x7439c4f9), + TOBN(0x5e676f48, 0x2e448a5b), TOBN(0xb2ca7d5b, 0xfd916bbb)}}, + {{TOBN(0xd55a2541, 0xf5024025), TOBN(0x47bc5769, 0xe4c2d937), + TOBN(0x7d31b92a, 0x0362189f), TOBN(0x83f3086e, 0xef7816f9)}, + {TOBN(0xf9f46d94, 0xb587579a), TOBN(0xec2d22d8, 0x30e76c5f), + TOBN(0x27d57461, 0xb000ffcf), TOBN(0xbb7e65f9, 0x364ffc2c)}}, + {{TOBN(0x7c7c9477, 0x6652a220), TOBN(0x61618f89, 0xd696c981), + TOBN(0x5021701d, 0x89effff3), TOBN(0xf2c8ff8e, 0x7c314163)}, + {TOBN(0x2da413ad, 0x8efb4d3e), TOBN(0x937b5adf, 0xce176d95), + TOBN(0x22867d34, 0x2a67d51c), TOBN(0x262b9b10, 0x18eb3ac9)}}, + {{TOBN(0x4e314fe4, 0xc43ff28b), TOBN(0x76476627, 0x6a664e7a), + TOBN(0x3e90e40b, 0xb7a565c2), TOBN(0x8588993a, 0xc1acf831)}, + {TOBN(0xd7b501d6, 0x8f938829), TOBN(0x996627ee, 0x3edd7d4c), + TOBN(0x37d44a62, 0x90cd34c7), TOBN(0xa8327499, 0xf3833e8d)}}, + {{TOBN(0x2e18917d, 0x4bf50353), TOBN(0x85dd726b, 0x556765fb), + TOBN(0x54fe65d6, 0x93d5ab66), TOBN(0x3ddbaced, 0x915c25fe)}, + {TOBN(0xa799d9a4, 0x12f22e85), TOBN(0xe2a24867, 0x6d06f6bc), + TOBN(0xf4f1ee56, 0x43ca1637), TOBN(0xfda2828b, 0x61ece30a)}}, + {{TOBN(0x758c1a3e, 0xa2dee7a6), TOBN(0xdcde2f3c, 0x734b2284), + TOBN(0xaba445d2, 0x4eaba6ad), TOBN(0x35aaf668, 0x76cee0a7)}, + {TOBN(0x7e0b04a9, 0xe5aa049a), TOBN(0xe74083ad, 0x91103e84), + TOBN(0xbeb183ce, 0x40afecc3), TOBN(0x6b89de9f, 0xea043f7a)}}}, + {{{TOBN(0x0e299d23, 0xfe67ba66), TOBN(0x91450760, 0x93cf2f34), + TOBN(0xf45b5ea9, 0x97fcf913), TOBN(0x5be00843, 0x8bd7ddda)}, + {TOBN(0x358c3e05, 0xd53ff04d), TOBN(0xbf7ccdc3, 0x5de91ef7), + TOBN(0xad684dbf, 0xb69ec1a0), TOBN(0x367e7cf2, 0x801fd997)}}, + {{TOBN(0x0ca1f3b7, 0xb0dc8595), TOBN(0x27de4608, 0x9f1d9f2e), + TOBN(0x1af3bf39, 0xbadd82a7), TOBN(0x79356a79, 0x65862448)}, + {TOBN(0xc0602345, 0xf5f9a052), TOBN(0x1a8b0f89, 0x139a42f9), + TOBN(0xb53eee42, 0x844d40fc), TOBN(0x93b0bfe5, 0x4e5b6368)}}, + {{TOBN(0x5434dd02, 0xc024789c), TOBN(0x90dca9ea, 0x41b57bfc), + TOBN(0x8aa898e2, 0x243398df), TOBN(0xf607c834, 0x894a94bb)}, + {TOBN(0xbb07be97, 0xc2c99b76), TOBN(0x6576ba67, 0x18c29302), + TOBN(0x3d79efcc, 0xe703a88c), TOBN(0xf259ced7, 0xb6a0d106)}}, + {{TOBN(0x0f893a5d, 0xc8de610b), TOBN(0xe8c515fb, 0x67e223ce), + TOBN(0x7774bfa6, 0x4ead6dc5), TOBN(0x89d20f95, 0x925c728f)}, + {TOBN(0x7a1e0966, 0x098583ce), TOBN(0xa2eedb94, 0x93f2a7d7), + TOBN(0x1b282097, 0x4c304d4a), TOBN(0x0842e3da, 0xc077282d)}}, + {{TOBN(0xe4d972a3, 0x3b9e2d7b), TOBN(0x7cc60b27, 0xc48218ff), + TOBN(0x8fc70838, 0x84149d91), TOBN(0x5c04346f, 0x2f461ecc)}, + {TOBN(0xebe9fdf2, 0x614650a9), TOBN(0x5e35b537, 0xc1f666ac), + TOBN(0x645613d1, 0x88babc83), TOBN(0x88cace3a, 0xc5e1c93e)}}, + {{TOBN(0x209ca375, 0x3de92e23), TOBN(0xccb03cc8, 0x5fbbb6e3), + TOBN(0xccb90f03, 0xd7b1487e), TOBN(0xfa9c2a38, 0xc710941f)}, + {TOBN(0x756c3823, 0x6724ceed), TOBN(0x3a902258, 0x192d0323), + TOBN(0xb150e519, 0xea5e038e), TOBN(0xdcba2865, 0xc7427591)}}, + {{TOBN(0xe549237f, 0x78890732), TOBN(0xc443bef9, 0x53fcb4d9), + TOBN(0x9884d8a6, 0xeb3480d6), TOBN(0x8a35b6a1, 0x3048b186)}, + {TOBN(0xb4e44716, 0x65e9a90a), TOBN(0x45bf380d, 0x653006c0), + TOBN(0x8f3f820d, 0x4fe9ae3b), TOBN(0x244a35a0, 0x979a3b71)}}, + {{TOBN(0xa1010e9d, 0x74cd06ff), TOBN(0x9c17c7df, 0xaca3eeac), + TOBN(0x74c86cd3, 0x8063aa2b), TOBN(0x8595c4b3, 0x734614ff)}, + {TOBN(0xa3de00ca, 0x990f62cc), TOBN(0xd9bed213, 0xca0c3be5), + TOBN(0x7886078a, 0xdf8ce9f5), TOBN(0xddb27ce3, 0x5cd44444)}}, + {{TOBN(0xed374a66, 0x58926ddd), TOBN(0x138b2d49, 0x908015b8), + TOBN(0x886c6579, 0xde1f7ab8), TOBN(0x888b9aa0, 0xc3020b7a)}, + {TOBN(0xd3ec034e, 0x3a96e355), TOBN(0xba65b0b8, 0xf30fbe9a), + TOBN(0x064c8e50, 0xff21367a), TOBN(0x1f508ea4, 0x0b04b46e)}}, + {{TOBN(0x98561a49, 0x747c866c), TOBN(0xbbb1e5fe, 0x0518a062), + TOBN(0x20ff4e8b, 0xecdc3608), TOBN(0x7f55cded, 0x20184027)}, + {TOBN(0x8d73ec95, 0xf38c85f0), TOBN(0x5b589fdf, 0x8bc3b8c3), + TOBN(0xbe95dd98, 0x0f12b66f), TOBN(0xf5bd1a09, 0x0e338e01)}}, + {{TOBN(0x65163ae5, 0x5e915918), TOBN(0x6158d6d9, 0x86f8a46b), + TOBN(0x8466b538, 0xeeebf99c), TOBN(0xca8761f6, 0xbca477ef)}, + {TOBN(0xaf3449c2, 0x9ebbc601), TOBN(0xef3b0f41, 0xe0c3ae2f), + TOBN(0xaa6c577d, 0x5de63752), TOBN(0xe9166601, 0x64682a51)}}, + {{TOBN(0x5a3097be, 0xfc15aa1e), TOBN(0x40d12548, 0xb54b0745), + TOBN(0x5bad4706, 0x519a5f12), TOBN(0xed03f717, 0xa439dee6)}, + {TOBN(0x0794bb6c, 0x4a02c499), TOBN(0xf725083d, 0xcffe71d2), + TOBN(0x2cad7519, 0x0f3adcaf), TOBN(0x7f68ea1c, 0x43729310)}}, + {{TOBN(0xe747c8c7, 0xb7ffd977), TOBN(0xec104c35, 0x80761a22), + TOBN(0x8395ebaf, 0x5a3ffb83), TOBN(0xfb3261f4, 0xe4b63db7)}, + {TOBN(0x53544960, 0xd883e544), TOBN(0x13520d70, 0x8cc2eeb8), + TOBN(0x08f6337b, 0xd3d65f99), TOBN(0x83997db2, 0x781cf95b)}}, + {{TOBN(0xce6ff106, 0x0dbd2c01), TOBN(0x4f8eea6b, 0x1f9ce934), + TOBN(0x546f7c4b, 0x0e993921), TOBN(0x6236a324, 0x5e753fc7)}, + {TOBN(0x65a41f84, 0xa16022e9), TOBN(0x0c18d878, 0x43d1dbb2), + TOBN(0x73c55640, 0x2d4cef9c), TOBN(0xa0428108, 0x70444c74)}}, + {{TOBN(0x68e4f15e, 0x9afdfb3c), TOBN(0x49a56143, 0x5bdfb6df), + TOBN(0xa9bc1bd4, 0x5f823d97), TOBN(0xbceb5970, 0xea111c2a)}, + {TOBN(0x366b455f, 0xb269bbc4), TOBN(0x7cd85e1e, 0xe9bc5d62), + TOBN(0xc743c41c, 0x4f18b086), TOBN(0xa4b40990, 0x95294fb9)}}, + {{TOBN(0x9c7c581d, 0x26ee8382), TOBN(0xcf17dcc5, 0x359d638e), + TOBN(0xee8273ab, 0xb728ae3d), TOBN(0x1d112926, 0xf821f047)}, + {TOBN(0x11498477, 0x50491a74), TOBN(0x687fa761, 0xfde0dfb9), + TOBN(0x2c258022, 0x7ea435ab), TOBN(0x6b8bdb94, 0x91ce7e3f)}}, + {{TOBN(0x4c5b5dc9, 0x3bf834aa), TOBN(0x04371819, 0x4f6c7e4b), + TOBN(0xc284e00a, 0x3736bcad), TOBN(0x0d881118, 0x21ae8f8d)}, + {TOBN(0xf9cf0f82, 0xf48c8e33), TOBN(0xa11fd075, 0xa1bf40db), + TOBN(0xdceab0de, 0xdc2733e5), TOBN(0xc560a8b5, 0x8e986bd7)}}, + {{TOBN(0x48dd1fe2, 0x3929d097), TOBN(0x3885b290, 0x92f188f1), + TOBN(0x0f2ae613, 0xda6fcdac), TOBN(0x9054303e, 0xb662a46c)}, + {TOBN(0xb6871e44, 0x0738042a), TOBN(0x98e6a977, 0xbdaf6449), + TOBN(0xd8bc0650, 0xd1c9df1b), TOBN(0xef3d6451, 0x36e098f9)}}, + {{TOBN(0x03fbae82, 0xb6d72d28), TOBN(0x77ca9db1, 0xf5d84080), + TOBN(0x8a112cff, 0xa58efc1c), TOBN(0x518d761c, 0xc564cb4a)}, + {TOBN(0x69b5740e, 0xf0d1b5ce), TOBN(0x717039cc, 0xe9eb1785), + TOBN(0x3fe29f90, 0x22f53382), TOBN(0x8e54ba56, 0x6bc7c95c)}}, + {{TOBN(0x9c806d8a, 0xf7f91d0f), TOBN(0x3b61b0f1, 0xa82a5728), + TOBN(0x4640032d, 0x94d76754), TOBN(0x273eb5de, 0x47d834c6)}, + {TOBN(0x2988abf7, 0x7b4e4d53), TOBN(0xb7ce66bf, 0xde401777), + TOBN(0x9fba6b32, 0x715071b3), TOBN(0x82413c24, 0xad3a1a98)}}, + {{TOBN(0x5b7fc8c4, 0xe0e8ad93), TOBN(0xb5679aee, 0x5fab868d), + TOBN(0xb1f9d2fa, 0x2b3946f3), TOBN(0x458897dc, 0x5685b50a)}, + {TOBN(0x1e98c930, 0x89d0caf3), TOBN(0x39564c5f, 0x78642e92), + TOBN(0x1b77729a, 0x0dbdaf18), TOBN(0xf9170722, 0x579e82e6)}}, + {{TOBN(0x680c0317, 0xe4515fa5), TOBN(0xf85cff84, 0xfb0c790f), + TOBN(0xc7a82aab, 0x6d2e0765), TOBN(0x7446bca9, 0x35c82b32)}, + {TOBN(0x5de607aa, 0x6d63184f), TOBN(0x7c1a46a8, 0x262803a6), + TOBN(0xd218313d, 0xaebe8035), TOBN(0x92113ffd, 0xc73c51f8)}}, + {{TOBN(0x4b38e083, 0x12e7e46c), TOBN(0x69d0a37a, 0x56126bd5), + TOBN(0xfb3f324b, 0x73c07e04), TOBN(0xa0c22f67, 0x8fda7267)}, + {TOBN(0x8f2c0051, 0x4d2c7d8f), TOBN(0xbc45ced3, 0xcbe2cae5), + TOBN(0xe1c6cf07, 0xa8f0f277), TOBN(0xbc392312, 0x1eb99a98)}}, + {{TOBN(0x75537b7e, 0x3cc8ac85), TOBN(0x8d725f57, 0xdd02753b), + TOBN(0xfd05ff64, 0xb737df2f), TOBN(0x55fe8712, 0xf6d2531d)}, + {TOBN(0x57ce04a9, 0x6ab6b01c), TOBN(0x69a02a89, 0x7cd93724), + TOBN(0x4f82ac35, 0xcf86699b), TOBN(0x8242d3ad, 0x9cb4b232)}}, + {{TOBN(0x713d0f65, 0xd62105e5), TOBN(0xbb222bfa, 0x2d29be61), + TOBN(0xf2f9a79e, 0x6cfbef09), TOBN(0xfc24d8d3, 0xd5d6782f)}, + {TOBN(0x5db77085, 0xd4129967), TOBN(0xdb81c3cc, 0xdc3c2a43), + TOBN(0x9d655fc0, 0x05d8d9a3), TOBN(0x3f5d057a, 0x54298026)}}, + {{TOBN(0x1157f56d, 0x88c54694), TOBN(0xb26baba5, 0x9b09573e), + TOBN(0x2cab03b0, 0x22adffd1), TOBN(0x60a412c8, 0xdd69f383)}, + {TOBN(0xed76e98b, 0x54b25039), TOBN(0xd4ee67d3, 0x687e714d), + TOBN(0x87739648, 0x7b00b594), TOBN(0xce419775, 0xc9ef709b)}}, + {{TOBN(0x40f76f85, 0x1c203a40), TOBN(0x30d352d6, 0xeafd8f91), + TOBN(0xaf196d3d, 0x95578dd2), TOBN(0xea4bb3d7, 0x77cc3f3d)}, + {TOBN(0x42a5bd03, 0xb98e782b), TOBN(0xac958c40, 0x0624920d), + TOBN(0xb838134c, 0xfc56fcc8), TOBN(0x86ec4ccf, 0x89572e5e)}}, + {{TOBN(0x69c43526, 0x9be47be0), TOBN(0x323b7dd8, 0xcb28fea1), + TOBN(0xfa5538ba, 0x3a6c67e5), TOBN(0xef921d70, 0x1d378e46)}, + {TOBN(0xf92961fc, 0x3c4b880e), TOBN(0x3f6f914e, 0x98940a67), + TOBN(0xa990eb0a, 0xfef0ff39), TOBN(0xa6c2920f, 0xf0eeff9c)}}, + {{TOBN(0xca804166, 0x51b8d9a3), TOBN(0x42531bc9, 0x0ffb0db1), + TOBN(0x72ce4718, 0xaa82e7ce), TOBN(0x6e199913, 0xdf574741)}, + {TOBN(0xd5f1b13d, 0xd5d36946), TOBN(0x8255dc65, 0xf68f0194), + TOBN(0xdc9df4cd, 0x8710d230), TOBN(0x3453c20f, 0x138c1988)}}, + {{TOBN(0x9af98dc0, 0x89a6ef01), TOBN(0x4dbcc3f0, 0x9857df85), + TOBN(0x34805601, 0x5c1ad924), TOBN(0x40448da5, 0xd0493046)}, + {TOBN(0xf629926d, 0x4ee343e2), TOBN(0x6343f1bd, 0x90e8a301), + TOBN(0xefc93491, 0x40815b3f), TOBN(0xf882a423, 0xde8f66fb)}}, + {{TOBN(0x3a12d5f4, 0xe7db9f57), TOBN(0x7dfba38a, 0x3c384c27), + TOBN(0x7a904bfd, 0x6fc660b1), TOBN(0xeb6c5db3, 0x2773b21c)}, + {TOBN(0xc350ee66, 0x1cdfe049), TOBN(0x9baac0ce, 0x44540f29), + TOBN(0xbc57b6ab, 0xa5ec6aad), TOBN(0x167ce8c3, 0x0a7c1baa)}}, + {{TOBN(0xb23a03a5, 0x53fb2b56), TOBN(0x6ce141e7, 0x4e057f78), + TOBN(0x796525c3, 0x89e490d9), TOBN(0x0bc95725, 0xa31a7e75)}, + {TOBN(0x1ec56791, 0x1220fd06), TOBN(0x716e3a3c, 0x408b0bd6), + TOBN(0x31cd6bf7, 0xe8ebeba9), TOBN(0xa7326ca6, 0xbee6b670)}}, + {{TOBN(0x3d9f851c, 0xcd090c43), TOBN(0x561e8f13, 0xf12c3988), + TOBN(0x50490b6a, 0x904b7be4), TOBN(0x61690ce1, 0x0410737b)}, + {TOBN(0x299e9a37, 0x0f009052), TOBN(0x258758f0, 0xf026092e), + TOBN(0x9fa255f3, 0xfdfcdc0f), TOBN(0xdbc9fb1f, 0xc0e1bcd2)}}, + {{TOBN(0x35f9dd6e, 0x24651840), TOBN(0xdca45a84, 0xa5c59abc), + TOBN(0x103d396f, 0xecca4938), TOBN(0x4532da0a, 0xb97b3f29)}, + {TOBN(0xc4135ea5, 0x1999a6bf), TOBN(0x3aa9505a, 0x5e6bf2ee), + TOBN(0xf77cef06, 0x3f5be093), TOBN(0x97d1a0f8, 0xa943152e)}}, + {{TOBN(0x2cb0ebba, 0x2e1c21dd), TOBN(0xf41b29fc, 0x2c6797c4), + TOBN(0xc6e17321, 0xb300101f), TOBN(0x4422b0e9, 0xd0d79a89)}, + {TOBN(0x49e4901c, 0x92f1bfc4), TOBN(0x06ab1f8f, 0xe1e10ed9), + TOBN(0x84d35577, 0xdb2926b8), TOBN(0xca349d39, 0x356e8ec2)}}, + {{TOBN(0x70b63d32, 0x343bf1a9), TOBN(0x8fd3bd28, 0x37d1a6b1), + TOBN(0x0454879c, 0x316865b4), TOBN(0xee959ff6, 0xc458efa2)}, + {TOBN(0x0461dcf8, 0x9706dc3f), TOBN(0x737db0e2, 0x164e4b2e), + TOBN(0x09262680, 0x2f8843c8), TOBN(0x54498bbc, 0x7745e6f6)}}, + {{TOBN(0x359473fa, 0xa29e24af), TOBN(0xfcc3c454, 0x70aa87a1), + TOBN(0xfd2c4bf5, 0x00573ace), TOBN(0xb65b514e, 0x28dd1965)}, + {TOBN(0xe46ae7cf, 0x2193e393), TOBN(0x60e9a4e1, 0xf5444d97), + TOBN(0xe7594e96, 0x00ff38ed), TOBN(0x43d84d2f, 0x0a0e0f02)}}, + {{TOBN(0x8b6db141, 0xee398a21), TOBN(0xb88a56ae, 0xe3bcc5be), + TOBN(0x0a1aa52f, 0x373460ea), TOBN(0x20da1a56, 0x160bb19b)}, + {TOBN(0xfb54999d, 0x65bf0384), TOBN(0x71a14d24, 0x5d5a180e), + TOBN(0xbc44db7b, 0x21737b04), TOBN(0xd84fcb18, 0x01dd8e92)}}, + {{TOBN(0x80de937b, 0xfa44b479), TOBN(0x53505499, 0x5c98fd4f), + TOBN(0x1edb12ab, 0x28f08727), TOBN(0x4c58b582, 0xa5f3ef53)}, + {TOBN(0xbfb236d8, 0x8327f246), TOBN(0xc3a3bfaa, 0x4d7df320), + TOBN(0xecd96c59, 0xb96024f2), TOBN(0xfc293a53, 0x7f4e0433)}}, + {{TOBN(0x5341352b, 0x5acf6e10), TOBN(0xc50343fd, 0xafe652c3), + TOBN(0x4af3792d, 0x18577a7f), TOBN(0xe1a4c617, 0xaf16823d)}, + {TOBN(0x9b26d0cd, 0x33425d0a), TOBN(0x306399ed, 0x9b7bc47f), + TOBN(0x2a792f33, 0x706bb20b), TOBN(0x31219614, 0x98111055)}}, + {{TOBN(0x864ec064, 0x87f5d28b), TOBN(0x11392d91, 0x962277fd), + TOBN(0xb5aa7942, 0xbb6aed5f), TOBN(0x080094dc, 0x47e799d9)}, + {TOBN(0x4afa588c, 0x208ba19b), TOBN(0xd3e7570f, 0x8512f284), + TOBN(0xcbae64e6, 0x02f5799a), TOBN(0xdeebe7ef, 0x514b9492)}}, + {{TOBN(0x30300f98, 0xe5c298ff), TOBN(0x17f561be, 0x3678361f), + TOBN(0xf52ff312, 0x98cb9a16), TOBN(0x6233c3bc, 0x5562d490)}, + {TOBN(0x7bfa15a1, 0x92e3a2cb), TOBN(0x961bcfd1, 0xe6365119), + TOBN(0x3bdd29bf, 0x2c8c53b1), TOBN(0x739704df, 0x822844ba)}}, + {{TOBN(0x7dacfb58, 0x7e7b754b), TOBN(0x23360791, 0xa806c9b9), + TOBN(0xe7eb88c9, 0x23504452), TOBN(0x2983e996, 0x852c1783)}, + {TOBN(0xdd4ae529, 0x958d881d), TOBN(0x026bae03, 0x262c7b3c), + TOBN(0x3a6f9193, 0x960b52d1), TOBN(0xd0980f90, 0x92696cfb)}}, + {{TOBN(0x4c1f428c, 0xd5f30851), TOBN(0x94dfed27, 0x2a4f6630), + TOBN(0x4df53772, 0xfc5d48a4), TOBN(0xdd2d5a2f, 0x933260ce)}, + {TOBN(0x574115bd, 0xd44cc7a5), TOBN(0x4ba6b20d, 0xbd12533a), + TOBN(0x30e93cb8, 0x243057c9), TOBN(0x794c486a, 0x14de320e)}}, + {{TOBN(0xe925d4ce, 0xf21496e4), TOBN(0xf951d198, 0xec696331), + TOBN(0x9810e2de, 0x3e8d812f), TOBN(0xd0a47259, 0x389294ab)}, + {TOBN(0x513ba2b5, 0x0e3bab66), TOBN(0x462caff5, 0xabad306f), + TOBN(0xe2dc6d59, 0xaf04c49e), TOBN(0x1aeb8750, 0xe0b84b0b)}}, + {{TOBN(0xc034f12f, 0x2f7d0ca2), TOBN(0x6d2e8128, 0xe06acf2f), + TOBN(0x801f4f83, 0x21facc2f), TOBN(0xa1170c03, 0xf40ef607)}, + {TOBN(0xfe0a1d4f, 0x7805a99c), TOBN(0xbde56a36, 0xcc26aba5), + TOBN(0x5b1629d0, 0x35531f40), TOBN(0xac212c2b, 0x9afa6108)}}, + {{TOBN(0x30a06bf3, 0x15697be5), TOBN(0x6f0545dc, 0x2c63c7c1), + TOBN(0x5d8cb842, 0x7ccdadaf), TOBN(0xd52e379b, 0xac7015bb)}, + {TOBN(0xc4f56147, 0xf462c23e), TOBN(0xd44a4298, 0x46bc24b0), + TOBN(0xbc73d23a, 0xe2856d4f), TOBN(0x61cedd8c, 0x0832bcdf)}}, + {{TOBN(0x60953556, 0x99f241d7), TOBN(0xee4adbd7, 0x001a349d), + TOBN(0x0b35bf6a, 0xaa89e491), TOBN(0x7f0076f4, 0x136f7546)}, + {TOBN(0xd19a18ba, 0x9264da3d), TOBN(0x6eb2d2cd, 0x62a7a28b), + TOBN(0xcdba941f, 0x8761c971), TOBN(0x1550518b, 0xa3be4a5d)}}, + {{TOBN(0xd0e8e2f0, 0x57d0b70c), TOBN(0xeea8612e, 0xcd133ba3), + TOBN(0x814670f0, 0x44416aec), TOBN(0x424db6c3, 0x30775061)}, + {TOBN(0xd96039d1, 0x16213fd1), TOBN(0xc61e7fa5, 0x18a3478f), + TOBN(0xa805bdcc, 0xcb0c5021), TOBN(0xbdd6f3a8, 0x0cc616dd)}}, + {{TOBN(0x06009667, 0x5d97f7e2), TOBN(0x31db0fc1, 0xaf0bf4b6), + TOBN(0x23680ed4, 0x5491627a), TOBN(0xb99a3c66, 0x7d741fb1)}, + {TOBN(0xe9bb5f55, 0x36b1ff92), TOBN(0x29738577, 0x512b388d), + TOBN(0xdb8a2ce7, 0x50fcf263), TOBN(0x385346d4, 0x6c4f7b47)}}, + {{TOBN(0xbe86c5ef, 0x31631f9e), TOBN(0xbf91da21, 0x03a57a29), + TOBN(0xc3b1f796, 0x7b23f821), TOBN(0x0f7d00d2, 0x770db354)}, + {TOBN(0x8ffc6c3b, 0xd8fe79da), TOBN(0xcc5e8c40, 0xd525c996), + TOBN(0x4640991d, 0xcfff632a), TOBN(0x64d97e8c, 0x67112528)}}, + {{TOBN(0xc232d973, 0x02f1cd1e), TOBN(0xce87eacb, 0x1dd212a4), + TOBN(0x6e4c8c73, 0xe69802f7), TOBN(0x12ef0290, 0x1fffddbd)}, + {TOBN(0x941ec74e, 0x1bcea6e2), TOBN(0xd0b54024, 0x3cb92cbb), + TOBN(0x809fb9d4, 0x7e8f9d05), TOBN(0x3bf16159, 0xf2992aae)}}, + {{TOBN(0xad40f279, 0xf8a7a838), TOBN(0x11aea631, 0x05615660), + TOBN(0xbf52e6f1, 0xa01f6fa1), TOBN(0xef046995, 0x3dc2aec9)}, + {TOBN(0x785dbec9, 0xd8080711), TOBN(0xe1aec60a, 0x9fdedf76), + TOBN(0xece797b5, 0xfa21c126), TOBN(0xc66e898f, 0x05e52732)}}, + {{TOBN(0x39bb69c4, 0x08811fdb), TOBN(0x8bfe1ef8, 0x2fc7f082), + TOBN(0xc8e7a393, 0x174f4138), TOBN(0xfba8ad1d, 0xd58d1f98)}, + {TOBN(0xbc21d0ce, 0xbfd2fd5b), TOBN(0x0b839a82, 0x6ee60d61), + TOBN(0xaacf7658, 0xafd22253), TOBN(0xb526bed8, 0xaae396b3)}}, + {{TOBN(0xccc1bbc2, 0x38564464), TOBN(0x9e3ff947, 0x8c45bc73), + TOBN(0xcde9bca3, 0x58188a78), TOBN(0x138b8ee0, 0xd73bf8f7)}, + {TOBN(0x5c7e234c, 0x4123c489), TOBN(0x66e69368, 0xfa643297), + TOBN(0x0629eeee, 0x39a15fa3), TOBN(0x95fab881, 0xa9e2a927)}}, + {{TOBN(0xb2497007, 0xeafbb1e1), TOBN(0xd75c9ce6, 0xe75b7a93), + TOBN(0x3558352d, 0xefb68d78), TOBN(0xa2f26699, 0x223f6396)}, + {TOBN(0xeb911ecf, 0xe469b17a), TOBN(0x62545779, 0xe72d3ec2), + TOBN(0x8ea47de7, 0x82cb113f), TOBN(0xebe4b086, 0x4e1fa98d)}}, + {{TOBN(0xec2d5ed7, 0x8cdfedb1), TOBN(0xa535c077, 0xfe211a74), + TOBN(0x9678109b, 0x11d244c5), TOBN(0xf17c8bfb, 0xbe299a76)}, + {TOBN(0xb651412e, 0xfb11fbc4), TOBN(0xea0b5482, 0x94ab3f65), + TOBN(0xd8dffd95, 0x0cf78243), TOBN(0x2e719e57, 0xce0361d4)}}, + {{TOBN(0x9007f085, 0x304ddc5b), TOBN(0x095e8c6d, 0x4daba2ea), + TOBN(0x5a33cdb4, 0x3f9d28a9), TOBN(0x85b95cd8, 0xe2283003)}, + {TOBN(0xbcd6c819, 0xb9744733), TOBN(0x29c5f538, 0xfc7f5783), + TOBN(0x6c49b2fa, 0xd59038e4), TOBN(0x68349cc1, 0x3bbe1018)}}, + {{TOBN(0xcc490c1d, 0x21830ee5), TOBN(0x36f9c4ee, 0xe9bfa297), + TOBN(0x58fd7294, 0x48de1a94), TOBN(0xaadb13a8, 0x4e8f2cdc)}, + {TOBN(0x515eaaa0, 0x81313dba), TOBN(0xc76bb468, 0xc2152dd8), + TOBN(0x357f8d75, 0xa653dbf8), TOBN(0xe4d8c4d1, 0xb14ac143)}}, + {{TOBN(0xbdb8e675, 0xb055cb40), TOBN(0x898f8e7b, 0x977b5167), + TOBN(0xecc65651, 0xb82fb863), TOBN(0x56544814, 0x6d88f01f)}, + {TOBN(0xb0928e95, 0x263a75a9), TOBN(0xcfb6836f, 0x1a22fcda), + TOBN(0x651d14db, 0x3f3bd37c), TOBN(0x1d3837fb, 0xb6ad4664)}}, + {{TOBN(0x7c5fb538, 0xff4f94ab), TOBN(0x7243c712, 0x6d7fb8f2), + TOBN(0xef13d60c, 0xa85c5287), TOBN(0x18cfb7c7, 0x4bb8dd1b)}, + {TOBN(0x82f9bfe6, 0x72908219), TOBN(0x35c4592b, 0x9d5144ab), + TOBN(0x52734f37, 0x9cf4b42f), TOBN(0x6bac55e7, 0x8c60ddc4)}}, + {{TOBN(0xb5cd811e, 0x94dea0f6), TOBN(0x259ecae4, 0xe18cc1a3), + TOBN(0x6a0e836e, 0x15e660f8), TOBN(0x6c639ea6, 0x0e02bff2)}, + {TOBN(0x8721b8cb, 0x7e1026fd), TOBN(0x9e73b50b, 0x63261942), + TOBN(0xb8c70974, 0x77f01da3), TOBN(0x1839e6a6, 0x8268f57f)}}, + {{TOBN(0x571b9415, 0x5150b805), TOBN(0x1892389e, 0xf92c7097), + TOBN(0x8d69c18e, 0x4a084b95), TOBN(0x7014c512, 0xbe5b495c)}, + {TOBN(0x4780db36, 0x1b07523c), TOBN(0x2f6219ce, 0x2c1c64fa), + TOBN(0xc38b81b0, 0x602c105a), TOBN(0xab4f4f20, 0x5dc8e360)}}, + {{TOBN(0x20d3c982, 0xcf7d62d2), TOBN(0x1f36e29d, 0x23ba8150), + TOBN(0x48ae0bf0, 0x92763f9e), TOBN(0x7a527e6b, 0x1d3a7007)}, + {TOBN(0xb4a89097, 0x581a85e3), TOBN(0x1f1a520f, 0xdc158be5), + TOBN(0xf98db37d, 0x167d726e), TOBN(0x8802786e, 0x1113e862)}}}, + {{{TOBN(0xefb2149e, 0x36f09ab0), TOBN(0x03f163ca, 0x4a10bb5b), + TOBN(0xd0297045, 0x06e20998), TOBN(0x56f0af00, 0x1b5a3bab)}, + {TOBN(0x7af4cfec, 0x70880e0d), TOBN(0x7332a66f, 0xbe3d913f), + TOBN(0x32e6c84a, 0x7eceb4bd), TOBN(0xedc4a79a, 0x9c228f55)}}, + {{TOBN(0xc37c7dd0, 0xc55c4496), TOBN(0xa6a96357, 0x25bbabd2), + TOBN(0x5b7e63f2, 0xadd7f363), TOBN(0x9dce3782, 0x2e73f1df)}, + {TOBN(0xe1e5a16a, 0xb2b91f71), TOBN(0xe4489823, 0x5ba0163c), + TOBN(0xf2759c32, 0xf6e515ad), TOBN(0xa5e2f1f8, 0x8615eecf)}}, + {{TOBN(0x74519be7, 0xabded551), TOBN(0x03d358b8, 0xc8b74410), + TOBN(0x4d00b10b, 0x0e10d9a9), TOBN(0x6392b0b1, 0x28da52b7)}, + {TOBN(0x6744a298, 0x0b75c904), TOBN(0xc305b0ae, 0xa8f7f96c), + TOBN(0x042e421d, 0x182cf932), TOBN(0xf6fc5d50, 0x9e4636ca)}}, + {{TOBN(0x795847c9, 0xd64cc78c), TOBN(0x6c50621b, 0x9b6cb27b), + TOBN(0x07099bf8, 0xdf8022ab), TOBN(0x48f862eb, 0xc04eda1d)}, + {TOBN(0xd12732ed, 0xe1603c16), TOBN(0x19a80e0f, 0x5c9a9450), + TOBN(0xe2257f54, 0xb429b4fc), TOBN(0x66d3b2c6, 0x45460515)}}, + {{TOBN(0x6ca4f87e, 0x822e37be), TOBN(0x73f237b4, 0x253bda4e), + TOBN(0xf747f3a2, 0x41190aeb), TOBN(0xf06fa36f, 0x804cf284)}, + {TOBN(0x0a6bbb6e, 0xfc621c12), TOBN(0x5d624b64, 0x40b80ec6), + TOBN(0x4b072425, 0x7ba556f3), TOBN(0x7fa0c354, 0x3e2d20a8)}}, + {{TOBN(0xe921fa31, 0xe3229d41), TOBN(0xa929c652, 0x94531bd4), + TOBN(0x84156027, 0xa6d38209), TOBN(0xf3d69f73, 0x6bdb97bd)}, + {TOBN(0x8906d19a, 0x16833631), TOBN(0x68a34c2e, 0x03d51be3), + TOBN(0xcb59583b, 0x0e511cd8), TOBN(0x99ce6bfd, 0xfdc132a8)}}, + {{TOBN(0x3facdaaa, 0xffcdb463), TOBN(0x658bbc1a, 0x34a38b08), + TOBN(0x12a801f8, 0xf1a9078d), TOBN(0x1567bcf9, 0x6ab855de)}, + {TOBN(0xe08498e0, 0x3572359b), TOBN(0xcf0353e5, 0x8659e68b), + TOBN(0xbb86e9c8, 0x7d23807c), TOBN(0xbc08728d, 0x2198e8a2)}}, + {{TOBN(0x8de2b7bc, 0x453cadd6), TOBN(0x203900a7, 0xbc0bc1f8), + TOBN(0xbcd86e47, 0xa6abd3af), TOBN(0x911cac12, 0x8502effb)}, + {TOBN(0x2d550242, 0xec965469), TOBN(0x0e9f7692, 0x29e0017e), + TOBN(0x633f078f, 0x65979885), TOBN(0xfb87d449, 0x4cf751ef)}}, + {{TOBN(0xe1790e4b, 0xfc25419a), TOBN(0x36467203, 0x4bff3cfd), + TOBN(0xc8db6386, 0x25b6e83f), TOBN(0x6cc69f23, 0x6cad6fd2)}, + {TOBN(0x0219e45a, 0x6bc68bb9), TOBN(0xe43d79b6, 0x297f7334), + TOBN(0x7d445368, 0x465dc97c), TOBN(0x4b9eea32, 0x2a0b949a)}}, + {{TOBN(0x1b96c6ba, 0x6102d021), TOBN(0xeaafac78, 0x2f4461ea), + TOBN(0xd4b85c41, 0xc49f19a8), TOBN(0x275c28e4, 0xcf538875)}, + {TOBN(0x35451a9d, 0xdd2e54e0), TOBN(0x6991adb5, 0x0605618b), + TOBN(0x5b8b4bcd, 0x7b36cd24), TOBN(0x372a4f8c, 0x56f37216)}}, + {{TOBN(0xc890bd73, 0xa6a5da60), TOBN(0x6f083da0, 0xdc4c9ff0), + TOBN(0xf4e14d94, 0xf0536e57), TOBN(0xf9ee1eda, 0xaaec8243)}, + {TOBN(0x571241ec, 0x8bdcf8e7), TOBN(0xa5db8271, 0x0b041e26), + TOBN(0x9a0b9a99, 0xe3fff040), TOBN(0xcaaf21dd, 0x7c271202)}}, + {{TOBN(0xb4e2b2e1, 0x4f0dd2e8), TOBN(0xe77e7c4f, 0x0a377ac7), + TOBN(0x69202c3f, 0x0d7a2198), TOBN(0xf759b7ff, 0x28200eb8)}, + {TOBN(0xc87526ed, 0xdcfe314e), TOBN(0xeb84c524, 0x53d5cf99), + TOBN(0xb1b52ace, 0x515138b6), TOBN(0x5aa7ff8c, 0x23fca3f4)}}, + {{TOBN(0xff0b13c3, 0xb9791a26), TOBN(0x960022da, 0xcdd58b16), + TOBN(0xdbd55c92, 0x57aad2de), TOBN(0x3baaaaa3, 0xf30fe619)}, + {TOBN(0x9a4b2346, 0x0d881efd), TOBN(0x506416c0, 0x46325e2a), + TOBN(0x91381e76, 0x035c18d4), TOBN(0xb3bb68be, 0xf27817b0)}}, + {{TOBN(0x15bfb8bf, 0x5116f937), TOBN(0x7c64a586, 0xc1268943), + TOBN(0x71e25cc3, 0x8419a2c8), TOBN(0x9fd6b0c4, 0x8335f463)}, + {TOBN(0x4bf0ba3c, 0xe8ee0e0e), TOBN(0x6f6fba60, 0x298c21fa), + TOBN(0x57d57b39, 0xae66bee0), TOBN(0x292d5130, 0x22672544)}}, + {{TOBN(0xf451105d, 0xbab093b3), TOBN(0x012f59b9, 0x02839986), + TOBN(0x8a915802, 0x3474a89c), TOBN(0x048c919c, 0x2de03e97)}, + {TOBN(0xc476a2b5, 0x91071cd5), TOBN(0x791ed89a, 0x034970a5), + TOBN(0x89bd9042, 0xe1b7994b), TOBN(0x8eaf5179, 0xa1057ffd)}}, + {{TOBN(0x6066e2a2, 0xd551ee10), TOBN(0x87a8f1d8, 0x727e09a6), + TOBN(0x00d08bab, 0x2c01148d), TOBN(0x6da8e4f1, 0x424f33fe)}, + {TOBN(0x466d17f0, 0xcf9a4e71), TOBN(0xff502010, 0x3bf5cb19), + TOBN(0xdccf97d8, 0xd062ecc0), TOBN(0x80c0d9af, 0x81d80ac4)}}, + {{TOBN(0xe87771d8, 0x033f2876), TOBN(0xb0186ec6, 0x7d5cc3db), + TOBN(0x58e8bb80, 0x3bc9bc1d), TOBN(0x4d1395cc, 0x6f6ef60e)}, + {TOBN(0xa73c62d6, 0x186244a0), TOBN(0x918e5f23, 0x110a5b53), + TOBN(0xed4878ca, 0x741b7eab), TOBN(0x3038d71a, 0xdbe03e51)}}, + {{TOBN(0x840204b7, 0xa93c3246), TOBN(0x21ab6069, 0xa0b9b4cd), + TOBN(0xf5fa6e2b, 0xb1d64218), TOBN(0x1de6ad0e, 0xf3d56191)}, + {TOBN(0x570aaa88, 0xff1929c7), TOBN(0xc6df4c6b, 0x640e87b5), + TOBN(0xde8a74f2, 0xc65f0ccc), TOBN(0x8b972fd5, 0xe6f6cc01)}}, + {{TOBN(0x3fff36b6, 0x0b846531), TOBN(0xba7e45e6, 0x10a5e475), + TOBN(0x84a1d10e, 0x4145b6c5), TOBN(0xf1f7f91a, 0x5e046d9d)}, + {TOBN(0x0317a692, 0x44de90d7), TOBN(0x951a1d4a, 0xf199c15e), + TOBN(0x91f78046, 0xc9d73deb), TOBN(0x74c82828, 0xfab8224f)}}, + {{TOBN(0xaa6778fc, 0xe7560b90), TOBN(0xb4073e61, 0xa7e824ce), + TOBN(0xff0d693c, 0xd642eba8), TOBN(0x7ce2e57a, 0x5dccef38)}, + {TOBN(0x89c2c789, 0x1df1ad46), TOBN(0x83a06922, 0x098346fd), + TOBN(0x2d715d72, 0xda2fc177), TOBN(0x7b6dd71d, 0x85b6cf1d)}}, + {{TOBN(0xc60a6d0a, 0x73fa9cb0), TOBN(0xedd3992e, 0x328bf5a9), + TOBN(0xc380ddd0, 0x832c8c82), TOBN(0xd182d410, 0xa2a0bf50)}, + {TOBN(0x7d9d7438, 0xd9a528db), TOBN(0xe8b1a0e9, 0xcaf53994), + TOBN(0xddd6e5fe, 0x0e19987c), TOBN(0xacb8df03, 0x190b059d)}}, + {{TOBN(0x53703a32, 0x8300129f), TOBN(0x1f637662, 0x68c43bfd), + TOBN(0xbcbd1913, 0x00e54051), TOBN(0x812fcc62, 0x7bf5a8c5)}, + {TOBN(0x3f969d5f, 0x29fb85da), TOBN(0x72f4e00a, 0x694759e8), + TOBN(0x426b6e52, 0x790726b7), TOBN(0x617bbc87, 0x3bdbb209)}}, + {{TOBN(0x511f8bb9, 0x97aee317), TOBN(0x812a4096, 0xe81536a8), + TOBN(0x137dfe59, 0x3ac09b9b), TOBN(0x0682238f, 0xba8c9a7a)}, + {TOBN(0x7072ead6, 0xaeccb4bd), TOBN(0x6a34e9aa, 0x692ba633), + TOBN(0xc82eaec2, 0x6fff9d33), TOBN(0xfb753512, 0x1d4d2b62)}}, + {{TOBN(0x1a0445ff, 0x1d7aadab), TOBN(0x65d38260, 0xd5f6a67c), + TOBN(0x6e62fb08, 0x91cfb26f), TOBN(0xef1e0fa5, 0x5c7d91d6)}, + {TOBN(0x47e7c7ba, 0x33db72cd), TOBN(0x017cbc09, 0xfa7c74b2), + TOBN(0x3c931590, 0xf50a503c), TOBN(0xcac54f60, 0x616baa42)}}, + {{TOBN(0x9b6cd380, 0xb2369f0f), TOBN(0x97d3a70d, 0x23c76151), + TOBN(0x5f9dd6fc, 0x9862a9c6), TOBN(0x044c4ab2, 0x12312f51)}, + {TOBN(0x035ea0fd, 0x834a2ddc), TOBN(0x49e6b862, 0xcc7b826d), + TOBN(0xb03d6883, 0x62fce490), TOBN(0x62f2497a, 0xb37e36e9)}}, + {{TOBN(0x04b005b6, 0xc6458293), TOBN(0x36bb5276, 0xe8d10af7), + TOBN(0xacf2dc13, 0x8ee617b8), TOBN(0x470d2d35, 0xb004b3d4)}, + {TOBN(0x06790832, 0xfeeb1b77), TOBN(0x2bb75c39, 0x85657f9c), + TOBN(0xd70bd4ed, 0xc0f60004), TOBN(0xfe797ecc, 0x219b018b)}}, + {{TOBN(0x9b5bec2a, 0x753aebcc), TOBN(0xdaf9f3dc, 0xc939eca5), + TOBN(0xd6bc6833, 0xd095ad09), TOBN(0x98abdd51, 0xdaa4d2fc)}, + {TOBN(0xd9840a31, 0x8d168be5), TOBN(0xcf7c10e0, 0x2325a23c), + TOBN(0xa5c02aa0, 0x7e6ecfaf), TOBN(0x2462e7e6, 0xb5bfdf18)}}, + {{TOBN(0xab2d8a8b, 0xa0cc3f12), TOBN(0x68dd485d, 0xbc672a29), + TOBN(0x72039752, 0x596f2cd3), TOBN(0x5d3eea67, 0xa0cf3d8d)}, + {TOBN(0x810a1a81, 0xe6602671), TOBN(0x8f144a40, 0x14026c0c), + TOBN(0xbc753a6d, 0x76b50f85), TOBN(0xc4dc21e8, 0x645cd4a4)}}, + {{TOBN(0xc5262dea, 0x521d0378), TOBN(0x802b8e0e, 0x05011c6f), + TOBN(0x1ba19cbb, 0x0b4c19ea), TOBN(0x21db64b5, 0xebf0aaec)}, + {TOBN(0x1f394ee9, 0x70342f9d), TOBN(0x93a10aee, 0x1bc44a14), + TOBN(0xa7eed31b, 0x3efd0baa), TOBN(0x6e7c824e, 0x1d154e65)}}, + {{TOBN(0xee23fa81, 0x9966e7ee), TOBN(0x64ec4aa8, 0x05b7920d), + TOBN(0x2d44462d, 0x2d90aad4), TOBN(0xf44dd195, 0xdf277ad5)}, + {TOBN(0x8d6471f1, 0xbb46b6a1), TOBN(0x1e65d313, 0xfd885090), + TOBN(0x33a800f5, 0x13a977b4), TOBN(0xaca9d721, 0x0797e1ef)}}, + {{TOBN(0x9a5a85a0, 0xfcff6a17), TOBN(0x9970a3f3, 0x1eca7cee), + TOBN(0xbb9f0d6b, 0xc9504be3), TOBN(0xe0c504be, 0xadd24ee2)}, + {TOBN(0x7e09d956, 0x77fcc2f4), TOBN(0xef1a5227, 0x65bb5fc4), + TOBN(0x145d4fb1, 0x8b9286aa), TOBN(0x66fd0c5d, 0x6649028b)}}, + {{TOBN(0x98857ceb, 0x1bf4581c), TOBN(0xe635e186, 0xaca7b166), + TOBN(0x278ddd22, 0x659722ac), TOBN(0xa0903c4c, 0x1db68007)}, + {TOBN(0x366e4589, 0x48f21402), TOBN(0x31b49c14, 0xb96abda2), + TOBN(0x329c4b09, 0xe0403190), TOBN(0x97197ca3, 0xd29f43fe)}}, + {{TOBN(0x8073dd1e, 0x274983d8), TOBN(0xda1a3bde, 0x55717c8f), + TOBN(0xfd3d4da2, 0x0361f9d1), TOBN(0x1332d081, 0x4c7de1ce)}, + {TOBN(0x9b7ef7a3, 0xaa6d0e10), TOBN(0x17db2e73, 0xf54f1c4a), + TOBN(0xaf3dffae, 0x4cd35567), TOBN(0xaaa2f406, 0xe56f4e71)}}, + {{TOBN(0x8966759e, 0x7ace3fc7), TOBN(0x9594eacf, 0x45a8d8c6), + TOBN(0x8de3bd8b, 0x91834e0e), TOBN(0xafe4ca53, 0x548c0421)}, + {TOBN(0xfdd7e856, 0xe6ee81c6), TOBN(0x8f671beb, 0x6b891a3a), + TOBN(0xf7a58f2b, 0xfae63829), TOBN(0x9ab186fb, 0x9c11ac9f)}}, + {{TOBN(0x8d6eb369, 0x10b5be76), TOBN(0x046b7739, 0xfb040bcd), + TOBN(0xccb4529f, 0xcb73de88), TOBN(0x1df0fefc, 0xcf26be03)}, + {TOBN(0xad7757a6, 0xbcfcd027), TOBN(0xa8786c75, 0xbb3165ca), + TOBN(0xe9db1e34, 0x7e99a4d9), TOBN(0x99ee86df, 0xb06c504b)}}, + {{TOBN(0x5b7c2ddd, 0xc15c9f0a), TOBN(0xdf87a734, 0x4295989e), + TOBN(0x59ece47c, 0x03d08fda), TOBN(0xb074d3dd, 0xad5fc702)}, + {TOBN(0x20407903, 0x51a03776), TOBN(0x2bb1f77b, 0x2a608007), + TOBN(0x25c58f4f, 0xe1153185), TOBN(0xe6df62f6, 0x766e6447)}}, + {{TOBN(0xefb3d1be, 0xed51275a), TOBN(0x5de47dc7, 0x2f0f483f), + TOBN(0x7932d98e, 0x97c2bedf), TOBN(0xd5c11927, 0x0219f8a1)}, + {TOBN(0x9d751200, 0xa73a294e), TOBN(0x5f88434a, 0x9dc20172), + TOBN(0xd28d9fd3, 0xa26f506a), TOBN(0xa890cd31, 0x9d1dcd48)}}, + {{TOBN(0x0aebaec1, 0x70f4d3b4), TOBN(0xfd1a1369, 0x0ffc8d00), + TOBN(0xb9d9c240, 0x57d57838), TOBN(0x45929d26, 0x68bac361)}, + {TOBN(0x5a2cd060, 0x25b15ca6), TOBN(0x4b3c83e1, 0x6e474446), + TOBN(0x1aac7578, 0xee1e5134), TOBN(0xa418f5d6, 0xc91e2f41)}}, + {{TOBN(0x6936fc8a, 0x213ed68b), TOBN(0x860ae7ed, 0x510a5224), + TOBN(0x63660335, 0xdef09b53), TOBN(0x641b2897, 0xcd79c98d)}, + {TOBN(0x29bd38e1, 0x01110f35), TOBN(0x79c26f42, 0x648b1937), + TOBN(0x64dae519, 0x9d9164f4), TOBN(0xd85a2310, 0x0265c273)}}, + {{TOBN(0x7173dd5d, 0x4b07e2b1), TOBN(0xd144c4cb, 0x8d9ea221), + TOBN(0xe8b04ea4, 0x1105ab14), TOBN(0x92dda542, 0xfe80d8f1)}, + {TOBN(0xe9982fa8, 0xcf03dce6), TOBN(0x8b5ea965, 0x1a22cffc), + TOBN(0xf7f4ea7f, 0x3fad88c4), TOBN(0x62db773e, 0x6a5ba95c)}}, + {{TOBN(0xd20f02fb, 0x93f24567), TOBN(0xfd46c69a, 0x315257ca), + TOBN(0x0ac74cc7, 0x8bcab987), TOBN(0x46f31c01, 0x5ceca2f5)}, + {TOBN(0x40aedb59, 0x888b219e), TOBN(0xe50ecc37, 0xe1fccd02), + TOBN(0x1bcd9dad, 0x911f816c), TOBN(0x583cc1ec, 0x8db9b00c)}}, + {{TOBN(0xf3cd2e66, 0xa483bf11), TOBN(0xfa08a6f5, 0xb1b2c169), + TOBN(0xf375e245, 0x4be9fa28), TOBN(0x99a7ffec, 0x5b6d011f)}, + {TOBN(0x6a3ebddb, 0xc4ae62da), TOBN(0x6cea00ae, 0x374aef5d), + TOBN(0xab5fb98d, 0x9d4d05bc), TOBN(0x7cba1423, 0xd560f252)}}, + {{TOBN(0x49b2cc21, 0x208490de), TOBN(0x1ca66ec3, 0xbcfb2879), + TOBN(0x7f1166b7, 0x1b6fb16f), TOBN(0xfff63e08, 0x65fe5db3)}, + {TOBN(0xb8345abe, 0x8b2610be), TOBN(0xb732ed80, 0x39de3df4), + TOBN(0x0e24ed50, 0x211c32b4), TOBN(0xd10d8a69, 0x848ff27d)}}, + {{TOBN(0xc1074398, 0xed4de248), TOBN(0xd7cedace, 0x10488927), + TOBN(0xa4aa6bf8, 0x85673e13), TOBN(0xb46bae91, 0x6daf30af)}, + {TOBN(0x07088472, 0xfcef7ad8), TOBN(0x61151608, 0xd4b35e97), + TOBN(0xbcfe8f26, 0xdde29986), TOBN(0xeb84c4c7, 0xd5a34c79)}}, + {{TOBN(0xc1eec55c, 0x164e1214), TOBN(0x891be86d, 0xa147bb03), + TOBN(0x9fab4d10, 0x0ba96835), TOBN(0xbf01e9b8, 0xa5c1ae9f)}, + {TOBN(0x6b4de139, 0xb186ebc0), TOBN(0xd5c74c26, 0x85b91bca), + TOBN(0x5086a99c, 0xc2d93854), TOBN(0xeed62a7b, 0xa7a9dfbc)}}, + {{TOBN(0x8778ed6f, 0x76b7618a), TOBN(0xbff750a5, 0x03b66062), + TOBN(0x4cb7be22, 0xb65186db), TOBN(0x369dfbf0, 0xcc3a6d13)}, + {TOBN(0xc7dab26c, 0x7191a321), TOBN(0x9edac3f9, 0x40ed718e), + TOBN(0xbc142b36, 0xd0cfd183), TOBN(0xc8af82f6, 0x7c991693)}}, + {{TOBN(0xb3d1e4d8, 0x97ce0b2a), TOBN(0xe6d7c87f, 0xc3a55cdf), + TOBN(0x35846b95, 0x68b81afe), TOBN(0x018d12af, 0xd3c239d8)}, + {TOBN(0x2b2c6208, 0x01206e15), TOBN(0xe0e42453, 0xa3b882c6), + TOBN(0x854470a3, 0xa50162d5), TOBN(0x08157478, 0x7017a62a)}}, + {{TOBN(0x18bd3fb4, 0x820357c7), TOBN(0x992039ae, 0x6f1458ad), + TOBN(0x9a1df3c5, 0x25b44aa1), TOBN(0x2d780357, 0xed3d5281)}, + {TOBN(0x58cf7e4d, 0xc77ad4d4), TOBN(0xd49a7998, 0xf9df4fc4), + TOBN(0x4465a8b5, 0x1d71205e), TOBN(0xa0ee0ea6, 0x649254aa)}}, + {{TOBN(0x4b5eeecf, 0xab7bd771), TOBN(0x6c873073, 0x35c262b9), + TOBN(0xdc5bd648, 0x3c9d61e7), TOBN(0x233d6d54, 0x321460d2)}, + {TOBN(0xd20c5626, 0xfc195bcc), TOBN(0x25445958, 0x04d78b63), + TOBN(0xe03fcb3d, 0x17ec8ef3), TOBN(0x54b690d1, 0x46b8f781)}}, + {{TOBN(0x82fa2c8a, 0x21230646), TOBN(0xf51aabb9, 0x084f418c), + TOBN(0xff4fbec1, 0x1a30ba43), TOBN(0x6a5acf73, 0x743c9df7)}, + {TOBN(0x1da2b357, 0xd635b4d5), TOBN(0xc3de68dd, 0xecd5c1da), + TOBN(0xa689080b, 0xd61af0dd), TOBN(0xdea5938a, 0xd665bf99)}}, + {{TOBN(0x0231d71a, 0xfe637294), TOBN(0x01968aa6, 0xa5a81cd8), + TOBN(0x11252d50, 0x048e63b5), TOBN(0xc446bc52, 0x6ca007e9)}, + {TOBN(0xef8c50a6, 0x96d6134b), TOBN(0x9361fbf5, 0x9e09a05c), + TOBN(0xf17f85a6, 0xdca3291a), TOBN(0xb178d548, 0xff251a21)}}, + {{TOBN(0x87f6374b, 0xa4df3915), TOBN(0x566ce1bf, 0x2fd5d608), + TOBN(0x425cba4d, 0x7de35102), TOBN(0x6b745f8f, 0x58c5d5e2)}, + {TOBN(0x88402af6, 0x63122edf), TOBN(0x3190f9ed, 0x3b989a89), + TOBN(0x4ad3d387, 0xebba3156), TOBN(0xef385ad9, 0xc7c469a5)}}, + {{TOBN(0xb08281de, 0x3f642c29), TOBN(0x20be0888, 0x910ffb88), + TOBN(0xf353dd4a, 0xd5292546), TOBN(0x3f1627de, 0x8377a262)}, + {TOBN(0xa5faa013, 0xeefcd638), TOBN(0x8f3bf626, 0x74cc77c3), + TOBN(0x32618f65, 0xa348f55e), TOBN(0x5787c0dc, 0x9fefeb9e)}}, + {{TOBN(0xf1673aa2, 0xd9a23e44), TOBN(0x88dfa993, 0x4e10690d), + TOBN(0x1ced1b36, 0x2bf91108), TOBN(0x9193ceca, 0x3af48649)}, + {TOBN(0xfb34327d, 0x2d738fc5), TOBN(0x6697b037, 0x975fee6c), + TOBN(0x2f485da0, 0xc04079a5), TOBN(0x2cdf5735, 0x2feaa1ac)}}, + {{TOBN(0x76944420, 0xbd55659e), TOBN(0x7973e32b, 0x4376090c), + TOBN(0x86bb4fe1, 0x163b591a), TOBN(0x10441aed, 0xc196f0ca)}, + {TOBN(0x3b431f4a, 0x045ad915), TOBN(0x6c11b437, 0xa4afacb1), + TOBN(0x30b0c7db, 0x71fdbbd8), TOBN(0xb642931f, 0xeda65acd)}}, + {{TOBN(0x4baae6e8, 0x9c92b235), TOBN(0xa73bbd0e, 0x6b3993a1), + TOBN(0xd06d60ec, 0x693dd031), TOBN(0x03cab91b, 0x7156881c)}, + {TOBN(0xd615862f, 0x1db3574b), TOBN(0x485b0185, 0x64bb061a), + TOBN(0x27434988, 0xa0181e06), TOBN(0x2cd61ad4, 0xc1c0c757)}}, + {{TOBN(0x3effed5a, 0x2ff9f403), TOBN(0x8dc98d8b, 0x62239029), + TOBN(0x2206021e, 0x1f17b70d), TOBN(0xafbec0ca, 0xbf510015)}, + {TOBN(0x9fed7164, 0x80130dfa), TOBN(0x306dc2b5, 0x8a02dcf5), + TOBN(0x48f06620, 0xfeb10fc0), TOBN(0x78d1e1d5, 0x5a57cf51)}}, + {{TOBN(0xadef8c5a, 0x192ef710), TOBN(0x88afbd4b, 0x3b7431f9), + TOBN(0x7e1f7407, 0x64250c9e), TOBN(0x6e31318d, 0xb58bec07)}, + {TOBN(0xfd4fc4b8, 0x24f89b4e), TOBN(0x65a5dd88, 0x48c36a2a), + TOBN(0x4f1eccff, 0xf024baa7), TOBN(0x22a21cf2, 0xcba94650)}}, + {{TOBN(0x95d29dee, 0x42a554f7), TOBN(0x828983a5, 0x002ec4ba), + TOBN(0x8112a1f7, 0x8badb73d), TOBN(0x79ea8897, 0xa27c1839)}, + {TOBN(0x8969a5a7, 0xd065fd83), TOBN(0xf49af791, 0xb262a0bc), + TOBN(0xfcdea8b6, 0xaf2b5127), TOBN(0x10e913e1, 0x564c2dbc)}}, + {{TOBN(0x51239d14, 0xbc21ef51), TOBN(0xe51c3ceb, 0x4ce57292), + TOBN(0x795ff068, 0x47bbcc3b), TOBN(0x86b46e1e, 0xbd7e11e6)}, + {TOBN(0x0ea6ba23, 0x80041ef4), TOBN(0xd72fe505, 0x6262342e), + TOBN(0x8abc6dfd, 0x31d294d4), TOBN(0xbbe017a2, 0x1278c2c9)}}, + {{TOBN(0xb1fcfa09, 0xb389328a), TOBN(0x322fbc62, 0xd01771b5), + TOBN(0x04c0d063, 0x60b045bf), TOBN(0xdb652edc, 0x10e52d01)}, + {TOBN(0x50ef932c, 0x03ec6627), TOBN(0xde1b3b2d, 0xc1ee50e3), + TOBN(0x5ab7bdc5, 0xdc37a90d), TOBN(0xfea67213, 0x31e33a96)}}, + {{TOBN(0x6482b5cb, 0x4f2999aa), TOBN(0x38476cc6, 0xb8cbf0dd), + TOBN(0x93ebfacb, 0x173405bb), TOBN(0x15cdafe7, 0xe52369ec)}, + {TOBN(0xd42d5ba4, 0xd935b7db), TOBN(0x648b6004, 0x1c99a4cd), + TOBN(0x785101bd, 0xa3b5545b), TOBN(0x4bf2c38a, 0x9dd67faf)}}, + {{TOBN(0xb1aadc63, 0x4442449c), TOBN(0xe0e9921a, 0x33ad4fb8), + TOBN(0x5c552313, 0xaa686d82), TOBN(0xdee635fa, 0x465d866c)}, + {TOBN(0xbc3c224a, 0x18ee6e8a), TOBN(0xeed748a6, 0xed42e02f), + TOBN(0xe70f930a, 0xd474cd08), TOBN(0x774ea6ec, 0xfff24adf)}}, + {{TOBN(0x03e2de1c, 0xf3480d4a), TOBN(0xf0d8edc7, 0xbc8acf1a), + TOBN(0xf23e3303, 0x68295a9c), TOBN(0xfadd5f68, 0xc546a97d)}, + {TOBN(0x895597ad, 0x96f8acb1), TOBN(0xbddd49d5, 0x671bdae2), + TOBN(0x16fcd528, 0x21dd43f4), TOBN(0xa5a45412, 0x6619141a)}}}, + {{{TOBN(0x8ce9b6bf, 0xc360e25a), TOBN(0xe6425195, 0x075a1a78), + TOBN(0x9dc756a8, 0x481732f4), TOBN(0x83c0440f, 0x5432b57a)}, + {TOBN(0xc670b3f1, 0xd720281f), TOBN(0x2205910e, 0xd135e051), + TOBN(0xded14b0e, 0xdb052be7), TOBN(0x697b3d27, 0xc568ea39)}}, + {{TOBN(0x2e599b9a, 0xfb3ff9ed), TOBN(0x28c2e0ab, 0x17f6515c), + TOBN(0x1cbee4fd, 0x474da449), TOBN(0x071279a4, 0x4f364452)}, + {TOBN(0x97abff66, 0x01fbe855), TOBN(0x3ee394e8, 0x5fda51c4), + TOBN(0x190385f6, 0x67597c0b), TOBN(0x6e9fccc6, 0xa27ee34b)}}, + {{TOBN(0x0b89de93, 0x14092ebb), TOBN(0xf17256bd, 0x428e240c), + TOBN(0xcf89a7f3, 0x93d2f064), TOBN(0x4f57841e, 0xe1ed3b14)}, + {TOBN(0x4ee14405, 0xe708d855), TOBN(0x856aae72, 0x03f1c3d0), + TOBN(0xc8e5424f, 0xbdd7eed5), TOBN(0x3333e4ef, 0x73ab4270)}}, + {{TOBN(0x3bc77ade, 0xdda492f8), TOBN(0xc11a3aea, 0x78297205), + TOBN(0x5e89a3e7, 0x34931b4c), TOBN(0x17512e2e, 0x9f5694bb)}, + {TOBN(0x5dc349f3, 0x177bf8b6), TOBN(0x232ea4ba, 0x08c7ff3e), + TOBN(0x9c4f9d16, 0xf511145d), TOBN(0xccf109a3, 0x33b379c3)}}, + {{TOBN(0xe75e7a88, 0xa1f25897), TOBN(0x7ac6961f, 0xa1b5d4d8), + TOBN(0xe3e10773, 0x08f3ed5c), TOBN(0x208a54ec, 0x0a892dfb)}, + {TOBN(0xbe826e19, 0x78660710), TOBN(0x0cf70a97, 0x237df2c8), + TOBN(0x418a7340, 0xed704da5), TOBN(0xa3eeb9a9, 0x08ca33fd)}}, + {{TOBN(0x49d96233, 0x169bca96), TOBN(0x04d286d4, 0x2da6aafb), + TOBN(0xc09606ec, 0xa0c2fa94), TOBN(0x8869d0d5, 0x23ff0fb3)}, + {TOBN(0xa99937e5, 0xd0150d65), TOBN(0xa92e2503, 0x240c14c9), + TOBN(0x656bf945, 0x108e2d49), TOBN(0x152a733a, 0xa2f59e2b)}}, + {{TOBN(0xb4323d58, 0x8434a920), TOBN(0xc0af8e93, 0x622103c5), + TOBN(0x667518ef, 0x938dbf9a), TOBN(0xa1843073, 0x83a9cdf2)}, + {TOBN(0x350a94aa, 0x5447ab80), TOBN(0xe5e5a325, 0xc75a3d61), + TOBN(0x74ba507f, 0x68411a9e), TOBN(0x10581fc1, 0x594f70c5)}}, + {{TOBN(0x60e28570, 0x80eb24a9), TOBN(0x7bedfb4d, 0x488e0cfd), + TOBN(0x721ebbd7, 0xc259cdb8), TOBN(0x0b0da855, 0xbc6390a9)}, + {TOBN(0x2b4d04db, 0xde314c70), TOBN(0xcdbf1fbc, 0x6c32e846), + TOBN(0x33833eab, 0xb162fc9e), TOBN(0x9939b48b, 0xb0dd3ab7)}}, + {{TOBN(0x5aaa98a7, 0xcb0c9c8c), TOBN(0x75105f30, 0x81c4375c), + TOBN(0xceee5057, 0x5ef1c90f), TOBN(0xb31e065f, 0xc23a17bf)}, + {TOBN(0x5364d275, 0xd4b6d45a), TOBN(0xd363f3ad, 0x62ec8996), + TOBN(0xb5d21239, 0x4391c65b), TOBN(0x84564765, 0xebb41b47)}}, + {{TOBN(0x20d18ecc, 0x37107c78), TOBN(0xacff3b6b, 0x570c2a66), + TOBN(0x22f975d9, 0x9bd0d845), TOBN(0xef0a0c46, 0xba178fa0)}, + {TOBN(0x1a419651, 0x76b6028e), TOBN(0xc49ec674, 0x248612d4), + TOBN(0x5b6ac4f2, 0x7338af55), TOBN(0x06145e62, 0x7bee5a36)}}, + {{TOBN(0x33e95d07, 0xe75746b5), TOBN(0x1c1e1f6d, 0xc40c78be), + TOBN(0x967833ef, 0x222ff8e2), TOBN(0x4bedcf6a, 0xb49180ad)}, + {TOBN(0x6b37e9c1, 0x3d7a4c8a), TOBN(0x2748887c, 0x6ddfe760), + TOBN(0xf7055123, 0xaa3a5bbc), TOBN(0x954ff225, 0x7bbb8e74)}}, + {{TOBN(0xc42b8ab1, 0x97c3dfb9), TOBN(0x55a549b0, 0xcf168154), + TOBN(0xad6748e7, 0xc1b50692), TOBN(0x2775780f, 0x6fc5cbcb)}, + {TOBN(0x4eab80b8, 0xe1c9d7c8), TOBN(0x8c69dae1, 0x3fdbcd56), + TOBN(0x47e6b4fb, 0x9969eace), TOBN(0x002f1085, 0xa705cb5a)}}, + {{TOBN(0x4e23ca44, 0x6d3fea55), TOBN(0xb4ae9c86, 0xf4810568), + TOBN(0x47bfb91b, 0x2a62f27d), TOBN(0x60deb4c9, 0xd9bac28c)}, + {TOBN(0xa892d894, 0x7de6c34c), TOBN(0x4ee68259, 0x4494587d), + TOBN(0x914ee14e, 0x1a3f8a5b), TOBN(0xbb113eaa, 0x28700385)}}, + {{TOBN(0x81ca03b9, 0x2115b4c9), TOBN(0x7c163d38, 0x8908cad1), + TOBN(0xc912a118, 0xaa18179a), TOBN(0xe09ed750, 0x886e3081)}, + {TOBN(0xa676e3fa, 0x26f516ca), TOBN(0x753cacf7, 0x8e732f91), + TOBN(0x51592aea, 0x833da8b4), TOBN(0xc626f42f, 0x4cbea8aa)}}, + {{TOBN(0xef9dc899, 0xa7b56eaf), TOBN(0x00c0e52c, 0x34ef7316), + TOBN(0x5b1e4e24, 0xfe818a86), TOBN(0x9d31e20d, 0xc538be47)}, + {TOBN(0x22eb932d, 0x3ed68974), TOBN(0xe44bbc08, 0x7c4e87c4), + TOBN(0x4121086e, 0x0dde9aef), TOBN(0x8e6b9cff, 0x134f4345)}}, + {{TOBN(0x96892c1f, 0x711b0eb9), TOBN(0xb905f2c8, 0x780ab954), + TOBN(0xace26309, 0xa20792db), TOBN(0xec8ac9b3, 0x0684e126)}, + {TOBN(0x486ad8b6, 0xb40a2447), TOBN(0x60121fc1, 0x9fe3fb24), + TOBN(0x5626fccf, 0x1a8e3b3f), TOBN(0x4e568622, 0x6ad1f394)}}, + {{TOBN(0xda7aae0d, 0x196aa5a1), TOBN(0xe0df8c77, 0x1041b5fb), + TOBN(0x451465d9, 0x26b318b7), TOBN(0xc29b6e55, 0x7ab136e9)}, + {TOBN(0x2c2ab48b, 0x71148463), TOBN(0xb5738de3, 0x64454a76), + TOBN(0x54ccf9a0, 0x5a03abe4), TOBN(0x377c0296, 0x0427d58e)}}, + {{TOBN(0x73f5f0b9, 0x2bb39c1f), TOBN(0x14373f2c, 0xe608d8c5), + TOBN(0xdcbfd314, 0x00fbb805), TOBN(0xdf18fb20, 0x83afdcfb)}, + {TOBN(0x81a57f42, 0x42b3523f), TOBN(0xe958532d, 0x87f650fb), + TOBN(0xaa8dc8b6, 0x8b0a7d7c), TOBN(0x1b75dfb7, 0x150166be)}}, + {{TOBN(0x90e4f7c9, 0x2d7d1413), TOBN(0x67e2d6b5, 0x9834f597), + TOBN(0x4fd4f4f9, 0xa808c3e8), TOBN(0xaf8237e0, 0xd5281ec1)}, + {TOBN(0x25ab5fdc, 0x84687cee), TOBN(0xc5ded6b1, 0xa5b26c09), + TOBN(0x8e4a5aec, 0xc8ea7650), TOBN(0x23b73e5c, 0x14cc417f)}}, + {{TOBN(0x2bfb4318, 0x3037bf52), TOBN(0xb61e6db5, 0x78c725d7), + TOBN(0x8efd4060, 0xbbb3e5d7), TOBN(0x2e014701, 0xdbac488e)}, + {TOBN(0xac75cf9a, 0x360aa449), TOBN(0xb70cfd05, 0x79634d08), + TOBN(0xa591536d, 0xfffb15ef), TOBN(0xb2c37582, 0xd07c106c)}}, + {{TOBN(0xb4293fdc, 0xf50225f9), TOBN(0xc52e175c, 0xb0e12b03), + TOBN(0xf649c3ba, 0xd0a8bf64), TOBN(0x745a8fef, 0xeb8ae3c6)}, + {TOBN(0x30d7e5a3, 0x58321bc3), TOBN(0xb1732be7, 0x0bc4df48), + TOBN(0x1f217993, 0xe9ea5058), TOBN(0xf7a71cde, 0x3e4fd745)}}, + {{TOBN(0x86cc533e, 0x894c5bbb), TOBN(0x6915c7d9, 0x69d83082), + TOBN(0xa6aa2d05, 0x5815c244), TOBN(0xaeeee592, 0x49b22ce5)}, + {TOBN(0x89e39d13, 0x78135486), TOBN(0x3a275c1f, 0x16b76f2f), + TOBN(0xdb6bcc1b, 0xe036e8f5), TOBN(0x4df69b21, 0x5e4709f5)}}, + {{TOBN(0xa188b250, 0x2d0f39aa), TOBN(0x622118bb, 0x15a85947), + TOBN(0x2ebf520f, 0xfde0f4fa), TOBN(0xa40e9f29, 0x4860e539)}, + {TOBN(0x7b6a51eb, 0x22b57f0f), TOBN(0x849a33b9, 0x7e80644a), + TOBN(0x50e5d16f, 0x1cf095fe), TOBN(0xd754b54e, 0xec55f002)}}, + {{TOBN(0x5cfbbb22, 0x236f4a98), TOBN(0x0b0c59e9, 0x066800bb), + TOBN(0x4ac69a8f, 0x5a9a7774), TOBN(0x2b33f804, 0xd6bec948)}, + {TOBN(0xb3729295, 0x32e6c466), TOBN(0x68956d0f, 0x4e599c73), + TOBN(0xa47a249f, 0x155c31cc), TOBN(0x24d80f0d, 0xe1ce284e)}}, + {{TOBN(0xcd821dfb, 0x988baf01), TOBN(0xe6331a7d, 0xdbb16647), + TOBN(0x1eb8ad33, 0x094cb960), TOBN(0x593cca38, 0xc91bbca5)}, + {TOBN(0x384aac8d, 0x26567456), TOBN(0x40fa0309, 0xc04b6490), + TOBN(0x97834cd6, 0xdab6c8f6), TOBN(0x68a7318d, 0x3f91e55f)}}, + {{TOBN(0xa00fd04e, 0xfc4d3157), TOBN(0xb56f8ab2, 0x2bf3bdea), + TOBN(0x014f5648, 0x4fa57172), TOBN(0x948c5860, 0x450abdb3)}, + {TOBN(0x342b5df0, 0x0ebd4f08), TOBN(0x3e5168cd, 0x0e82938e), + TOBN(0x7aedc1ce, 0xb0df5dd0), TOBN(0x6bbbc6d9, 0xe5732516)}}, + {{TOBN(0xc7bfd486, 0x605daaa6), TOBN(0x46fd72b7, 0xbb9a6c9e), + TOBN(0xe4847fb1, 0xa124fb89), TOBN(0x75959cbd, 0xa2d8ffbc)}, + {TOBN(0x42579f65, 0xc8a588ee), TOBN(0x368c92e6, 0xb80b499d), + TOBN(0xea4ef6cd, 0x999a5df1), TOBN(0xaa73bb7f, 0x936fe604)}}, + {{TOBN(0xf347a70d, 0x6457d188), TOBN(0x86eda86b, 0x8b7a388b), + TOBN(0xb7cdff06, 0x0ccd6013), TOBN(0xbeb1b6c7, 0xd0053fb2)}, + {TOBN(0x0b022387, 0x99240a9f), TOBN(0x1bbb384f, 0x776189b2), + TOBN(0x8695e71e, 0x9066193a), TOBN(0x2eb50097, 0x06ffac7e)}}, + {{TOBN(0x0654a9c0, 0x4a7d2caa), TOBN(0x6f3fb3d1, 0xa5aaa290), + TOBN(0x835db041, 0xff476e8f), TOBN(0x540b8b0b, 0xc42295e4)}, + {TOBN(0xa5c73ac9, 0x05e214f5), TOBN(0x9a74075a, 0x56a0b638), + TOBN(0x2e4b1090, 0xce9e680b), TOBN(0x57a5b479, 0x6b8d9afa)}}, + {{TOBN(0x0dca48e7, 0x26bfe65c), TOBN(0x097e391c, 0x7290c307), + TOBN(0x683c462e, 0x6669e72e), TOBN(0xf505be1e, 0x062559ac)}, + {TOBN(0x5fbe3ea1, 0xe3a3035a), TOBN(0x6431ebf6, 0x9cd50da8), + TOBN(0xfd169d5c, 0x1f6407f2), TOBN(0x8d838a95, 0x60fce6b8)}}, + {{TOBN(0x2a2bfa7f, 0x650006f0), TOBN(0xdfd7dad3, 0x50c0fbb2), + TOBN(0x92452495, 0xccf9ad96), TOBN(0x183bf494, 0xd95635f9)}, + {TOBN(0x02d5df43, 0x4a7bd989), TOBN(0x505385cc, 0xa5431095), + TOBN(0xdd98e67d, 0xfd43f53e), TOBN(0xd61e1a6c, 0x500c34a9)}}, + {{TOBN(0x5a4b46c6, 0x4a8a3d62), TOBN(0x8469c4d0, 0x247743d2), + TOBN(0x2bb3a13d, 0x88f7e433), TOBN(0x62b23a10, 0x01be5849)}, + {TOBN(0xe83596b4, 0xa63d1a4c), TOBN(0x454e7fea, 0x7d183f3e), + TOBN(0x643fce61, 0x17afb01c), TOBN(0x4e65e5e6, 0x1c4c3638)}}, + {{TOBN(0x41d85ea1, 0xef74c45b), TOBN(0x2cfbfa66, 0xae328506), + TOBN(0x98b078f5, 0x3ada7da9), TOBN(0xd985fe37, 0xec752fbb)}, + {TOBN(0xeece68fe, 0x5a0148b4), TOBN(0x6f9a55c7, 0x2d78136d), + TOBN(0x232dccc4, 0xd2b729ce), TOBN(0xa27e0dfd, 0x90aafbc4)}}, + {{TOBN(0x96474452, 0x12b4603e), TOBN(0xa876c551, 0x6b706d14), + TOBN(0xdf145fcf, 0x69a9d412), TOBN(0xe2ab75b7, 0x2d479c34)}, + {TOBN(0x12df9a76, 0x1a23ff97), TOBN(0xc6138992, 0x5d359d10), + TOBN(0x6e51c7ae, 0xfa835f22), TOBN(0x69a79cb1, 0xc0fcc4d9)}}, + {{TOBN(0xf57f350d, 0x594cc7e1), TOBN(0x3079ca63, 0x3350ab79), + TOBN(0x226fb614, 0x9aff594a), TOBN(0x35afec02, 0x6d59a62b)}, + {TOBN(0x9bee46f4, 0x06ed2c6e), TOBN(0x58da1735, 0x7d939a57), + TOBN(0x44c50402, 0x8fd1797e), TOBN(0xd8853e7c, 0x5ccea6ca)}}, + {{TOBN(0x4065508d, 0xa35fcd5f), TOBN(0x8965df8c, 0x495ccaeb), + TOBN(0x0f2da850, 0x12e1a962), TOBN(0xee471b94, 0xc1cf1cc4)}, + {TOBN(0xcef19bc8, 0x0a08fb75), TOBN(0x704958f5, 0x81de3591), + TOBN(0x2867f8b2, 0x3aef4f88), TOBN(0x8d749384, 0xea9f9a5f)}}, + {{TOBN(0x1b385537, 0x8c9049f4), TOBN(0x5be948f3, 0x7b92d8b6), + TOBN(0xd96f725d, 0xb6e2bd6b), TOBN(0x37a222bc, 0x958c454d)}, + {TOBN(0xe7c61abb, 0x8809bf61), TOBN(0x46f07fbc, 0x1346f18d), + TOBN(0xfb567a7a, 0xe87c0d1c), TOBN(0x84a461c8, 0x7ef3d07a)}}, + {{TOBN(0x0a5adce6, 0xd9278d98), TOBN(0x24d94813, 0x9dfc73e1), + TOBN(0x4f3528b6, 0x054321c3), TOBN(0x2e03fdde, 0x692ea706)}, + {TOBN(0x10e60619, 0x47b533c0), TOBN(0x1a8bc73f, 0x2ca3c055), + TOBN(0xae58d4b2, 0x1bb62b8f), TOBN(0xb2045a73, 0x584a24e3)}}, + {{TOBN(0x3ab3d5af, 0xbd76e195), TOBN(0x478dd1ad, 0x6938a810), + TOBN(0x6ffab393, 0x6ee3d5cb), TOBN(0xdfb693db, 0x22b361e4)}, + {TOBN(0xf9694496, 0x51dbf1a7), TOBN(0xcab4b4ef, 0x08a2e762), + TOBN(0xe8c92f25, 0xd39bba9a), TOBN(0x850e61bc, 0xf1464d96)}}, + {{TOBN(0xb7e830e3, 0xdc09508b), TOBN(0xfaf6d2cf, 0x74317655), + TOBN(0x72606ceb, 0xdf690355), TOBN(0x48bb92b3, 0xd0c3ded6)}, + {TOBN(0x65b75484, 0x5c7cf892), TOBN(0xf6cd7ac9, 0xd5d5f01f), + TOBN(0xc2c30a59, 0x96401d69), TOBN(0x91268650, 0xed921878)}}, + {{TOBN(0x380bf913, 0xb78c558f), TOBN(0x43c0baeb, 0xc8afdaa9), + TOBN(0x377f61d5, 0x54f169d3), TOBN(0xf8da07e3, 0xae5ff20b)}, + {TOBN(0xb676c49d, 0xa8a90ea8), TOBN(0x81c1ff2b, 0x83a29b21), + TOBN(0x383297ac, 0x2ad8d276), TOBN(0x3001122f, 0xba89f982)}}, + {{TOBN(0xe1d794be, 0x6718e448), TOBN(0x246c1482, 0x7c3e6e13), + TOBN(0x56646ef8, 0x5d26b5ef), TOBN(0x80f5091e, 0x88069cdd)}, + {TOBN(0xc5992e2f, 0x724bdd38), TOBN(0x02e915b4, 0x8471e8c7), + TOBN(0x96ff320a, 0x0d0ff2a9), TOBN(0xbf886487, 0x4384d1a0)}}, + {{TOBN(0xbbe1e6a6, 0xc93f72d6), TOBN(0xd5f75d12, 0xcad800ea), + TOBN(0xfa40a09f, 0xe7acf117), TOBN(0x32c8cdd5, 0x7581a355)}, + {TOBN(0x74221992, 0x7023c499), TOBN(0xa8afe5d7, 0x38ec3901), + TOBN(0x5691afcb, 0xa90e83f0), TOBN(0x41bcaa03, 0x0b8f8eac)}}, + {{TOBN(0xe38b5ff9, 0x8d2668d5), TOBN(0x0715281a, 0x7ad81965), + TOBN(0x1bc8fc7c, 0x03c6ce11), TOBN(0xcbbee6e2, 0x8b650436)}, + {TOBN(0x06b00fe8, 0x0cdb9808), TOBN(0x17d6e066, 0xfe3ed315), + TOBN(0x2e9d38c6, 0x4d0b5018), TOBN(0xab8bfd56, 0x844dcaef)}}, + {{TOBN(0x42894a59, 0x513aed8b), TOBN(0xf77f3b6d, 0x314bd07a), + TOBN(0xbbdecb8f, 0x8e42b582), TOBN(0xf10e2fa8, 0xd2390fe6)}, + {TOBN(0xefb95022, 0x62a2f201), TOBN(0x4d59ea50, 0x50ee32b0), + TOBN(0xd87f7728, 0x6da789a8), TOBN(0xcf98a2cf, 0xf79492c4)}}, + {{TOBN(0xf9577239, 0x720943c2), TOBN(0xba044cf5, 0x3990b9d0), + TOBN(0x5aa8e823, 0x95f2884a), TOBN(0x834de6ed, 0x0278a0af)}, + {TOBN(0xc8e1ee9a, 0x5f25bd12), TOBN(0x9259ceaa, 0x6f7ab271), + TOBN(0x7e6d97a2, 0x77d00b76), TOBN(0x5c0c6eea, 0xa437832a)}}, + {{TOBN(0x5232c20f, 0x5606b81d), TOBN(0xabd7b375, 0x0d991ee5), + TOBN(0x4d2bfe35, 0x8632d951), TOBN(0x78f85146, 0x98ed9364)}, + {TOBN(0x951873f0, 0xf30c3282), TOBN(0x0da8ac80, 0xa789230b), + TOBN(0x3ac7789c, 0x5398967f), TOBN(0xa69b8f7f, 0xbdda0fb5)}}, + {{TOBN(0xe5db7717, 0x6add8545), TOBN(0x1b71cb66, 0x72c49b66), + TOBN(0xd8560739, 0x68421d77), TOBN(0x03840fe8, 0x83e3afea)}, + {TOBN(0xb391dad5, 0x1ec69977), TOBN(0xae243fb9, 0x307f6726), + TOBN(0xc88ac87b, 0xe8ca160c), TOBN(0x5174cced, 0x4ce355f4)}}, + {{TOBN(0x98a35966, 0xe58ba37d), TOBN(0xfdcc8da2, 0x7817335d), + TOBN(0x5b752830, 0x83fbc7bf), TOBN(0x68e419d4, 0xd9c96984)}, + {TOBN(0x409a39f4, 0x02a40380), TOBN(0x88940faf, 0x1fe977bc), + TOBN(0xc640a94b, 0x8f8edea6), TOBN(0x1e22cd17, 0xed11547d)}}, + {{TOBN(0xe28568ce, 0x59ffc3e2), TOBN(0x60aa1b55, 0xc1dee4e7), + TOBN(0xc67497c8, 0x837cb363), TOBN(0x06fb438a, 0x105a2bf2)}, + {TOBN(0x30357ec4, 0x500d8e20), TOBN(0x1ad9095d, 0x0670db10), + TOBN(0x7f589a05, 0xc73b7cfd), TOBN(0xf544607d, 0x880d6d28)}}, + {{TOBN(0x17ba93b1, 0xa20ef103), TOBN(0xad859130, 0x6ba6577b), + TOBN(0x65c91cf6, 0x6fa214a0), TOBN(0xd7d49c6c, 0x27990da5)}, + {TOBN(0xecd9ec8d, 0x20bb569d), TOBN(0xbd4b2502, 0xeeffbc33), + TOBN(0x2056ca5a, 0x6bed0467), TOBN(0x7916a1f7, 0x5b63728c)}}, + {{TOBN(0xd4f9497d, 0x53a4f566), TOBN(0x89734664, 0x97b56810), + TOBN(0xf8e1da74, 0x0494a621), TOBN(0x82546a93, 0x8d011c68)}, + {TOBN(0x1f3acb19, 0xc61ac162), TOBN(0x52f8fa9c, 0xabad0d3e), + TOBN(0x15356523, 0xb4b7ea43), TOBN(0x5a16ad61, 0xae608125)}}, + {{TOBN(0xb0bcb87f, 0x4faed184), TOBN(0x5f236b1d, 0x5029f45f), + TOBN(0xd42c7607, 0x0bc6b1fc), TOBN(0xc644324e, 0x68aefce3)}, + {TOBN(0x8e191d59, 0x5c5d8446), TOBN(0xc0208077, 0x13ae1979), + TOBN(0xadcaee55, 0x3ba59cc7), TOBN(0x20ed6d6b, 0xa2cb81ba)}}, + {{TOBN(0x0952ba19, 0xb6efcffc), TOBN(0x60f12d68, 0x97c0b87c), + TOBN(0x4ee2c7c4, 0x9caa30bc), TOBN(0x767238b7, 0x97fbff4e)}, + {TOBN(0xebc73921, 0x501b5d92), TOBN(0x3279e3df, 0xc2a37737), + TOBN(0x9fc12bc8, 0x6d197543), TOBN(0xfa94dc6f, 0x0a40db4e)}}, + {{TOBN(0x7392b41a, 0x530ccbbd), TOBN(0x87c82146, 0xea823525), + TOBN(0xa52f984c, 0x05d98d0c), TOBN(0x2ae57d73, 0x5ef6974c)}, + {TOBN(0x9377f7bf, 0x3042a6dd), TOBN(0xb1a007c0, 0x19647a64), + TOBN(0xfaa9079a, 0x0cca9767), TOBN(0x3d81a25b, 0xf68f72d5)}}, + {{TOBN(0x752067f8, 0xff81578e), TOBN(0x78622150, 0x9045447d), + TOBN(0xc0c22fcf, 0x0505aa6f), TOBN(0x1030f0a6, 0x6bed1c77)}, + {TOBN(0x31f29f15, 0x1f0bd739), TOBN(0x2d7989c7, 0xe6debe85), + TOBN(0x5c070e72, 0x8e677e98), TOBN(0x0a817bd3, 0x06e81fd5)}}, + {{TOBN(0xc110d830, 0xb0f2ac95), TOBN(0x48d0995a, 0xab20e64e), + TOBN(0x0f3e00e1, 0x7729cd9a), TOBN(0x2a570c20, 0xdd556946)}, + {TOBN(0x912dbcfd, 0x4e86214d), TOBN(0x2d014ee2, 0xcf615498), + TOBN(0x55e2b1e6, 0x3530d76e), TOBN(0xc5135ae4, 0xfd0fd6d1)}}, + {{TOBN(0x0066273a, 0xd4f3049f), TOBN(0xbb8e9893, 0xe7087477), + TOBN(0x2dba1ddb, 0x14c6e5fd), TOBN(0xdba37886, 0x51f57e6c)}, + {TOBN(0x5aaee0a6, 0x5a72f2cf), TOBN(0x1208bfbf, 0x7bea5642), + TOBN(0xf5c6aa3b, 0x67872c37), TOBN(0xd726e083, 0x43f93224)}}, + {{TOBN(0x1854daa5, 0x061f1658), TOBN(0xc0016df1, 0xdf0cd2b3), + TOBN(0xc2a3f23e, 0x833d50de), TOBN(0x73b681d2, 0xbbbd3017)}, + {TOBN(0x2f046dc4, 0x3ac343c0), TOBN(0x9c847e7d, 0x85716421), + TOBN(0xe1e13c91, 0x0917eed4), TOBN(0x3fc9eebd, 0x63a1b9c6)}}, + {{TOBN(0x0f816a72, 0x7fe02299), TOBN(0x6335ccc2, 0x294f3319), + TOBN(0x3820179f, 0x4745c5be), TOBN(0xe647b782, 0x922f066e)}, + {TOBN(0xc22e49de, 0x02cafb8a), TOBN(0x299bc2ff, 0xfcc2eccc), + TOBN(0x9a8feea2, 0x6e0e8282), TOBN(0xa627278b, 0xfe893205)}}, + {{TOBN(0xa7e19733, 0x7933e47b), TOBN(0xf4ff6b13, 0x2e766402), + TOBN(0xa4d8be0a, 0x98440d9f), TOBN(0x658f5c2f, 0x38938808)}, + {TOBN(0x90b75677, 0xc95b3b3e), TOBN(0xfa044269, 0x3137b6ff), + TOBN(0x077b039b, 0x43c47c29), TOBN(0xcca95dd3, 0x8a6445b2)}}, + {{TOBN(0x0b498ba4, 0x2333fc4c), TOBN(0x274f8e68, 0xf736a1b1), + TOBN(0x6ca348fd, 0x5f1d4b2e), TOBN(0x24d3be78, 0xa8f10199)}, + {TOBN(0x8535f858, 0xca14f530), TOBN(0xa6e7f163, 0x5b982e51), + TOBN(0x847c8512, 0x36e1bf62), TOBN(0xf6a7c58e, 0x03448418)}}, + {{TOBN(0x583f3703, 0xf9374ab6), TOBN(0x864f9195, 0x6e564145), + TOBN(0x33bc3f48, 0x22526d50), TOBN(0x9f323c80, 0x1262a496)}, + {TOBN(0xaa97a7ae, 0x3f046a9a), TOBN(0x70da183e, 0xdf8a039a), + TOBN(0x5b68f71c, 0x52aa0ba6), TOBN(0x9be0fe51, 0x21459c2d)}}, + {{TOBN(0xc1e17eb6, 0xcbc613e5), TOBN(0x33131d55, 0x497ea61c), + TOBN(0x2f69d39e, 0xaf7eded5), TOBN(0x73c2f434, 0xde6af11b)}, + {TOBN(0x4ca52493, 0xa4a375fa), TOBN(0x5f06787c, 0xb833c5c2), + TOBN(0x814e091f, 0x3e6e71cf), TOBN(0x76451f57, 0x8b746666)}}}, + {{{TOBN(0x80f9bdef, 0x694db7e0), TOBN(0xedca8787, 0xb9fcddc6), + TOBN(0x51981c34, 0x03b8dce1), TOBN(0x4274dcf1, 0x70e10ba1)}, + {TOBN(0xf72743b8, 0x6def6d1a), TOBN(0xd25b1670, 0xebdb1866), + TOBN(0xc4491e8c, 0x050c6f58), TOBN(0x2be2b2ab, 0x87fbd7f5)}}, + {{TOBN(0x3e0e5c9d, 0xd111f8ec), TOBN(0xbcc33f8d, 0xb7c4e760), + TOBN(0x702f9a91, 0xbd392a51), TOBN(0x7da4a795, 0xc132e92d)}, + {TOBN(0x1a0b0ae3, 0x0bb1151b), TOBN(0x54febac8, 0x02e32251), + TOBN(0xea3a5082, 0x694e9e78), TOBN(0xe58ffec1, 0xe4fe40b8)}}, + {{TOBN(0xf85592fc, 0xd1e0cf9e), TOBN(0xdea75f0d, 0xc0e7b2e8), + TOBN(0xc04215cf, 0xc135584e), TOBN(0x174fc727, 0x2f57092a)}, + {TOBN(0xe7277877, 0xeb930bea), TOBN(0x504caccb, 0x5eb02a5a), + TOBN(0xf9fe08f7, 0xf5241b9b), TOBN(0xe7fb62f4, 0x8d5ca954)}}, + {{TOBN(0xfbb8349d, 0x29c4120b), TOBN(0x9f94391f, 0xc0d0d915), + TOBN(0xc4074fa7, 0x5410ba51), TOBN(0xa66adbf6, 0x150a5911)}, + {TOBN(0xc164543c, 0x34bfca38), TOBN(0xe0f27560, 0xb9e1ccfc), + TOBN(0x99da0f53, 0xe820219c), TOBN(0xe8234498, 0xc6b4997a)}}, + {{TOBN(0xcfb88b76, 0x9d4c5423), TOBN(0x9e56eb10, 0xb0521c49), + TOBN(0x418e0b5e, 0xbe8700a1), TOBN(0x00cbaad6, 0xf93cb58a)}, + {TOBN(0xe923fbde, 0xd92a5e67), TOBN(0xca4979ac, 0x1f347f11), + TOBN(0x89162d85, 0x6bc0585b), TOBN(0xdd6254af, 0xac3c70e3)}}, + {{TOBN(0x7b23c513, 0x516e19e4), TOBN(0x56e2e847, 0xc5c4d593), + TOBN(0x9f727d73, 0x5ce71ef6), TOBN(0x5b6304a6, 0xf79a44c5)}, + {TOBN(0x6638a736, 0x3ab7e433), TOBN(0x1adea470, 0xfe742f83), + TOBN(0xe054b854, 0x5b7fc19f), TOBN(0xf935381a, 0xba1d0698)}}, + {{TOBN(0x546eab2d, 0x799e9a74), TOBN(0x96239e0e, 0xa949f729), + TOBN(0xca274c6b, 0x7090055a), TOBN(0x835142c3, 0x9020c9b0)}, + {TOBN(0xa405667a, 0xa2e8807f), TOBN(0x29f2c085, 0x1aa3d39e), + TOBN(0xcc555d64, 0x42fc72f5), TOBN(0xe856e0e7, 0xfbeacb3c)}}, + {{TOBN(0xb5504f9d, 0x918e4936), TOBN(0x65035ef6, 0xb2513982), + TOBN(0x0553a0c2, 0x6f4d9cb9), TOBN(0x6cb10d56, 0xbea85509)}, + {TOBN(0x48d957b7, 0xa242da11), TOBN(0x16a4d3dd, 0x672b7268), + TOBN(0x3d7e637c, 0x8502a96b), TOBN(0x27c7032b, 0x730d463b)}}, + {{TOBN(0xbdc02b18, 0xe4136a14), TOBN(0xbacf969d, 0x678e32bf), + TOBN(0xc98d89a3, 0xdd9c3c03), TOBN(0x7b92420a, 0x23becc4f)}, + {TOBN(0xd4b41f78, 0xc64d565c), TOBN(0x9f969d00, 0x10f28295), + TOBN(0xec7f7f76, 0xb13d051a), TOBN(0x08945e1e, 0xa92da585)}}, + {{TOBN(0x55366b7d, 0x5846426f), TOBN(0xe7d09e89, 0x247d441d), + TOBN(0x510b404d, 0x736fbf48), TOBN(0x7fa003d0, 0xe784bd7d)}, + {TOBN(0x25f7614f, 0x17fd9596), TOBN(0x49e0e0a1, 0x35cb98db), + TOBN(0x2c65957b, 0x2e83a76a), TOBN(0x5d40da8d, 0xcddbe0f8)}}, + {{TOBN(0xf2b8c405, 0x050bad24), TOBN(0x8918426d, 0xc2aa4823), + TOBN(0x2aeab3dd, 0xa38365a7), TOBN(0x72031717, 0x7c91b690)}, + {TOBN(0x8b00d699, 0x60a94120), TOBN(0x478a255d, 0xe99eaeec), + TOBN(0xbf656a5f, 0x6f60aafd), TOBN(0xdfd7cb75, 0x5dee77b3)}}, + {{TOBN(0x37f68bb4, 0xa595939d), TOBN(0x03556479, 0x28740217), + TOBN(0x8e740e7c, 0x84ad7612), TOBN(0xd89bc843, 0x9044695f)}, + {TOBN(0xf7f3da5d, 0x85a9184d), TOBN(0x562563bb, 0x9fc0b074), + TOBN(0x06d2e6aa, 0xf88a888e), TOBN(0x612d8643, 0x161fbe7c)}}, + {{TOBN(0x465edba7, 0xf64085e7), TOBN(0xb230f304, 0x29aa8511), + TOBN(0x53388426, 0xcda2d188), TOBN(0x90885735, 0x4b666649)}, + {TOBN(0x6f02ff9a, 0x652f54f6), TOBN(0x65c82294, 0x5fae2bf0), + TOBN(0x7816ade0, 0x62f5eee3), TOBN(0xdcdbdf43, 0xfcc56d70)}}, + {{TOBN(0x9fb3bba3, 0x54530bb2), TOBN(0xbde3ef77, 0xcb0869ea), + TOBN(0x89bc9046, 0x0b431163), TOBN(0x4d03d7d2, 0xe4819a35)}, + {TOBN(0x33ae4f9e, 0x43b6a782), TOBN(0x216db307, 0x9c88a686), + TOBN(0x91dd88e0, 0x00ffedd9), TOBN(0xb280da9f, 0x12bd4840)}}, + {{TOBN(0x32a7cb8a, 0x1635e741), TOBN(0xfe14008a, 0x78be02a7), + TOBN(0x3fafb334, 0x1b7ae030), TOBN(0x7fd508e7, 0x5add0ce9)}, + {TOBN(0x72c83219, 0xd607ad51), TOBN(0x0f229c0a, 0x8d40964a), + TOBN(0x1be2c336, 0x1c878da2), TOBN(0xe0c96742, 0xeab2ab86)}}, + {{TOBN(0x458f8691, 0x3e538cd7), TOBN(0xa7001f6c, 0x8e08ad53), + TOBN(0x52b8c6e6, 0xbf5d15ff), TOBN(0x548234a4, 0x011215dd)}, + {TOBN(0xff5a9d2d, 0x3d5b4045), TOBN(0xb0ffeeb6, 0x4a904190), + TOBN(0x55a3aca4, 0x48607f8b), TOBN(0x8cbd665c, 0x30a0672a)}}, + {{TOBN(0x87f834e0, 0x42583068), TOBN(0x02da2aeb, 0xf3f6e683), + TOBN(0x6b763e5d, 0x05c12248), TOBN(0x7230378f, 0x65a8aefc)}, + {TOBN(0x93bd80b5, 0x71e8e5ca), TOBN(0x53ab041c, 0xb3b62524), + TOBN(0x1b860513, 0x6c9c552e), TOBN(0xe84d402c, 0xd5524e66)}}, + {{TOBN(0xa37f3573, 0xf37f5937), TOBN(0xeb0f6c7d, 0xd1e4fca5), + TOBN(0x2965a554, 0xac8ab0fc), TOBN(0x17fbf56c, 0x274676ac)}, + {TOBN(0x2e2f6bd9, 0xacf7d720), TOBN(0x41fc8f88, 0x10224766), + TOBN(0x517a14b3, 0x85d53bef), TOBN(0xdae327a5, 0x7d76a7d1)}}, + {{TOBN(0x6ad0a065, 0xc4818267), TOBN(0x33aa189b, 0x37c1bbc1), + TOBN(0x64970b52, 0x27392a92), TOBN(0x21699a1c, 0x2d1535ea)}, + {TOBN(0xcd20779c, 0xc2d7a7fd), TOBN(0xe3186059, 0x99c83cf2), + TOBN(0x9b69440b, 0x72c0b8c7), TOBN(0xa81497d7, 0x7b9e0e4d)}}, + {{TOBN(0x515d5c89, 0x1f5f82dc), TOBN(0x9a7f67d7, 0x6361079e), + TOBN(0xa8da81e3, 0x11a35330), TOBN(0xe44990c4, 0x4b18be1b)}, + {TOBN(0xc7d5ed95, 0xaf103e59), TOBN(0xece8aba7, 0x8dac9261), + TOBN(0xbe82b099, 0x9394b8d3), TOBN(0x6830f09a, 0x16adfe83)}}, + {{TOBN(0x250a29b4, 0x88172d01), TOBN(0x8b20bd65, 0xcaff9e02), + TOBN(0xb8a7661e, 0xe8a6329a), TOBN(0x4520304d, 0xd3fce920)}, + {TOBN(0xae45da1f, 0x2b47f7ef), TOBN(0xe07f5288, 0x5bffc540), + TOBN(0xf7997009, 0x3464f874), TOBN(0x2244c2cd, 0xa6fa1f38)}}, + {{TOBN(0x43c41ac1, 0x94d7d9b1), TOBN(0x5bafdd82, 0xc82e7f17), + TOBN(0xdf0614c1, 0x5fda0fca), TOBN(0x74b043a7, 0xa8ae37ad)}, + {TOBN(0x3ba6afa1, 0x9e71734c), TOBN(0x15d5437e, 0x9c450f2e), + TOBN(0x4a5883fe, 0x67e242b1), TOBN(0x5143bdc2, 0x2c1953c2)}}, + {{TOBN(0x542b8b53, 0xfc5e8920), TOBN(0x363bf9a8, 0x9a9cee08), + TOBN(0x02375f10, 0xc3486e08), TOBN(0x2037543b, 0x8c5e70d2)}, + {TOBN(0x7109bccc, 0x625640b4), TOBN(0xcbc1051e, 0x8bc62c3b), + TOBN(0xf8455fed, 0x803f26ea), TOBN(0x6badceab, 0xeb372424)}}, + {{TOBN(0xa2a9ce7c, 0x6b53f5f9), TOBN(0x64246595, 0x1b176d99), + TOBN(0xb1298d36, 0xb95c081b), TOBN(0x53505bb8, 0x1d9a9ee6)}, + {TOBN(0x3f6f9e61, 0xf2ba70b0), TOBN(0xd07e16c9, 0x8afad453), + TOBN(0x9f1694bb, 0xe7eb4a6a), TOBN(0xdfebced9, 0x3cb0bc8e)}}, + {{TOBN(0x92d3dcdc, 0x53868c8b), TOBN(0x174311a2, 0x386107a6), + TOBN(0x4109e07c, 0x689b4e64), TOBN(0x30e4587f, 0x2df3dcb6)}, + {TOBN(0x841aea31, 0x0811b3b2), TOBN(0x6144d41d, 0x0cce43ea), + TOBN(0x464c4581, 0x2a9a7803), TOBN(0xd03d371f, 0x3e158930)}}, + {{TOBN(0xc676d7f2, 0xb1f3390b), TOBN(0x9f7a1b8c, 0xa5b61272), + TOBN(0x4ebebfc9, 0xc2e127a9), TOBN(0x4602500c, 0x5dd997bf)}, + {TOBN(0x7f09771c, 0x4711230f), TOBN(0x058eb37c, 0x020f09c1), + TOBN(0xab693d4b, 0xfee5e38b), TOBN(0x9289eb1f, 0x4653cbc0)}}, + {{TOBN(0xbecf46ab, 0xd51b9cf5), TOBN(0xd2aa9c02, 0x9f0121af), + TOBN(0x36aaf7d2, 0xe90dc274), TOBN(0x909e4ea0, 0x48b95a3c)}, + {TOBN(0xe6b70496, 0x6f32dbdb), TOBN(0x672188a0, 0x8b030b3e), + TOBN(0xeeffe5b3, 0xcfb617e2), TOBN(0x87e947de, 0x7c82709e)}}, + {{TOBN(0xa44d2b39, 0x1770f5a7), TOBN(0xe4d4d791, 0x0e44eb82), + TOBN(0x42e69d1e, 0x3f69712a), TOBN(0xbf11c4d6, 0xac6a820e)}, + {TOBN(0xb5e7f3e5, 0x42c4224c), TOBN(0xd6b4e81c, 0x449d941c), + TOBN(0x5d72bd16, 0x5450e878), TOBN(0x6a61e28a, 0xee25ac54)}}, + {{TOBN(0x33272094, 0xe6f1cd95), TOBN(0x7512f30d, 0x0d18673f), + TOBN(0x32f7a4ca, 0x5afc1464), TOBN(0x2f095656, 0x6bbb977b)}, + {TOBN(0x586f47ca, 0xa8226200), TOBN(0x02c868ad, 0x1ac07369), + TOBN(0x4ef2b845, 0xc613acbe), TOBN(0x43d7563e, 0x0386054c)}}, + {{TOBN(0x54da9dc7, 0xab952578), TOBN(0xb5423df2, 0x26e84d0b), + TOBN(0xa8b64eeb, 0x9b872042), TOBN(0xac205782, 0x5990f6df)}, + {TOBN(0x4ff696eb, 0x21f4c77a), TOBN(0x1a79c3e4, 0xaab273af), + TOBN(0x29bc922e, 0x9436b3f1), TOBN(0xff807ef8, 0xd6d9a27a)}}, + {{TOBN(0x82acea3d, 0x778f22a0), TOBN(0xfb10b2e8, 0x5b5e7469), + TOBN(0xc0b16980, 0x2818ee7d), TOBN(0x011afff4, 0xc91c1a2f)}, + {TOBN(0x95a6d126, 0xad124418), TOBN(0x31c081a5, 0xe72e295f), + TOBN(0x36bb283a, 0xf2f4db75), TOBN(0xd115540f, 0x7acef462)}}, + {{TOBN(0xc7f3a8f8, 0x33f6746c), TOBN(0x21e46f65, 0xfea990ca), + TOBN(0x915fd5c5, 0xcaddb0a9), TOBN(0xbd41f016, 0x78614555)}, + {TOBN(0x346f4434, 0x426ffb58), TOBN(0x80559436, 0x14dbc204), + TOBN(0xf3dd20fe, 0x5a969b7f), TOBN(0x9d59e956, 0xe899a39a)}}, + {{TOBN(0xf1b0971c, 0x8ad4cf4b), TOBN(0x03448860, 0x2ffb8fb8), + TOBN(0xf071ac3c, 0x65340ba4), TOBN(0x408d0596, 0xb27fd758)}, + {TOBN(0xe7c78ea4, 0x98c364b0), TOBN(0xa4aac4a5, 0x051e8ab5), + TOBN(0xb9e1d560, 0x485d9002), TOBN(0x9acd518a, 0x88844455)}}, + {{TOBN(0xe4ca688f, 0xd06f56c0), TOBN(0xa48af70d, 0xdf027972), + TOBN(0x691f0f04, 0x5e9a609d), TOBN(0xa9dd82cd, 0xee61270e)}, + {TOBN(0x8903ca63, 0xa0ef18d3), TOBN(0x9fb7ee35, 0x3d6ca3bd), + TOBN(0xa7b4a09c, 0xabf47d03), TOBN(0x4cdada01, 0x1c67de8e)}}, + {{TOBN(0x52003749, 0x9355a244), TOBN(0xe77fd2b6, 0x4f2151a9), + TOBN(0x695d6cf6, 0x66b4efcb), TOBN(0xc5a0cacf, 0xda2cfe25)}, + {TOBN(0x104efe5c, 0xef811865), TOBN(0xf52813e8, 0x9ea5cc3d), + TOBN(0x855683dc, 0x40b58dbc), TOBN(0x0338ecde, 0x175fcb11)}}, + {{TOBN(0xf9a05637, 0x74921592), TOBN(0xb4f1261d, 0xb9bb9d31), + TOBN(0x551429b7, 0x4e9c5459), TOBN(0xbe182e6f, 0x6ea71f53)}, + {TOBN(0xd3a3b07c, 0xdfc50573), TOBN(0x9ba1afda, 0x62be8d44), + TOBN(0x9bcfd2cb, 0x52ab65d3), TOBN(0xdf11d547, 0xa9571802)}}, + {{TOBN(0x099403ee, 0x02a2404a), TOBN(0x497406f4, 0x21088a71), + TOBN(0x99479409, 0x5004ae71), TOBN(0xbdb42078, 0xa812c362)}, + {TOBN(0x2b72a30f, 0xd8828442), TOBN(0x283add27, 0xfcb5ed1c), + TOBN(0xf7c0e200, 0x66a40015), TOBN(0x3e3be641, 0x08b295ef)}}, + {{TOBN(0xac127dc1, 0xe038a675), TOBN(0x729deff3, 0x8c5c6320), + TOBN(0xb7df8fd4, 0xa90d2c53), TOBN(0x9b74b0ec, 0x681e7cd3)}, + {TOBN(0x5cb5a623, 0xdab407e5), TOBN(0xcdbd3615, 0x76b340c6), + TOBN(0xa184415a, 0x7d28392c), TOBN(0xc184c1d8, 0xe96f7830)}}, + {{TOBN(0xc3204f19, 0x81d3a80f), TOBN(0xfde0c841, 0xc8e02432), + TOBN(0x78203b3e, 0x8149e0c1), TOBN(0x5904bdbb, 0x08053a73)}, + {TOBN(0x30fc1dd1, 0x101b6805), TOBN(0x43c223bc, 0x49aa6d49), + TOBN(0x9ed67141, 0x7a174087), TOBN(0x311469a0, 0xd5997008)}}, + {{TOBN(0xb189b684, 0x5e43fc61), TOBN(0xf3282375, 0xe0d3ab57), + TOBN(0x4fa34b67, 0xb1181da8), TOBN(0x621ed0b2, 0x99ee52b8)}, + {TOBN(0x9b178de1, 0xad990676), TOBN(0xd51de67b, 0x56d54065), + TOBN(0x2a2c27c4, 0x7538c201), TOBN(0x33856ec8, 0x38a40f5c)}}, + {{TOBN(0x2522fc15, 0xbe6cdcde), TOBN(0x1e603f33, 0x9f0c6f89), + TOBN(0x7994edc3, 0x103e30a6), TOBN(0x033a00db, 0x220c853e)}, + {TOBN(0xd3cfa409, 0xf7bb7fd7), TOBN(0x70f8781e, 0x462d18f6), + TOBN(0xbbd82980, 0x687fe295), TOBN(0x6eef4c32, 0x595669f3)}}, + {{TOBN(0x86a9303b, 0x2f7e85c3), TOBN(0x5fce4621, 0x71988f9b), + TOBN(0x5b935bf6, 0xc138acb5), TOBN(0x30ea7d67, 0x25661212)}, + {TOBN(0xef1eb5f4, 0xe51ab9a2), TOBN(0x0587c98a, 0xae067c78), + TOBN(0xb3ce1b3c, 0x77ca9ca6), TOBN(0x2a553d4d, 0x54b5f057)}}, + {{TOBN(0xc7898236, 0x4da29ec2), TOBN(0xdbdd5d13, 0xb9c57316), + TOBN(0xc57d6e6b, 0x2cd80d47), TOBN(0x80b460cf, 0xfe9e7391)}, + {TOBN(0x98648cab, 0xf963c31e), TOBN(0x67f9f633, 0xcc4d32fd), + TOBN(0x0af42a9d, 0xfdf7c687), TOBN(0x55f292a3, 0x0b015ea7)}}, + {{TOBN(0x89e468b2, 0xcd21ab3d), TOBN(0xe504f022, 0xc393d392), + TOBN(0xab21e1d4, 0xa5013af9), TOBN(0xe3283f78, 0xc2c28acb)}, + {TOBN(0xf38b35f6, 0x226bf99f), TOBN(0xe8354274, 0x0e291e69), + TOBN(0x61673a15, 0xb20c162d), TOBN(0xc101dc75, 0xb04fbdbe)}}, + {{TOBN(0x8323b4c2, 0x255bd617), TOBN(0x6c969693, 0x6c2a9154), + TOBN(0xc6e65860, 0x62679387), TOBN(0x8e01db0c, 0xb8c88e23)}, + {TOBN(0x33c42873, 0x893a5559), TOBN(0x7630f04b, 0x47a3e149), + TOBN(0xb5d80805, 0xddcf35f8), TOBN(0x582ca080, 0x77dfe732)}}, + {{TOBN(0x2c7156e1, 0x0b1894a0), TOBN(0x92034001, 0xd81c68c0), + TOBN(0xed225d00, 0xc8b115b5), TOBN(0x237f9c22, 0x83b907f2)}, + {TOBN(0x0ea2f32f, 0x4470e2c0), TOBN(0xb725f7c1, 0x58be4e95), + TOBN(0x0f1dcafa, 0xb1ae5463), TOBN(0x59ed5187, 0x1ba2fc04)}}, + {{TOBN(0xf6e0f316, 0xd0115d4d), TOBN(0x5180b12f, 0xd3691599), + TOBN(0x157e32c9, 0x527f0a41), TOBN(0x7b0b081d, 0xa8e0ecc0)}, + {TOBN(0x6dbaaa8a, 0xbf4f0dd0), TOBN(0x99b289c7, 0x4d252696), + TOBN(0x79b7755e, 0xdbf864fe), TOBN(0x6974e2b1, 0x76cad3ab)}}, + {{TOBN(0x35dbbee2, 0x06ddd657), TOBN(0xe7cbdd11, 0x2ff3a96d), + TOBN(0x88381968, 0x076be758), TOBN(0x2d737e72, 0x08c91f5d)}, + {TOBN(0x5f83ab62, 0x86ec3776), TOBN(0x98aa649d, 0x945fa7a1), + TOBN(0xf477ec37, 0x72ef0933), TOBN(0x66f52b1e, 0x098c17b1)}}, + {{TOBN(0x9eec58fb, 0xd803738b), TOBN(0x91aaade7, 0xe4e86aa4), + TOBN(0x6b1ae617, 0xa5b51492), TOBN(0x63272121, 0xbbc45974)}, + {TOBN(0x7e0e28f0, 0x862c5129), TOBN(0x0a8f79a9, 0x3321a4a0), + TOBN(0xe26d1664, 0x5041c88f), TOBN(0x0571b805, 0x53233e3a)}}, + {{TOBN(0xd1b0ccde, 0xc9520711), TOBN(0x55a9e4ed, 0x3c8b84bf), + TOBN(0x9426bd39, 0xa1fef314), TOBN(0x4f5f638e, 0x6eb93f2b)}, + {TOBN(0xba2a1ed3, 0x2bf9341b), TOBN(0xd63c1321, 0x4d42d5a9), + TOBN(0xd2964a89, 0x316dc7c5), TOBN(0xd1759606, 0xca511851)}}, + {{TOBN(0xd8a9201f, 0xf9e6ed35), TOBN(0xb7b5ee45, 0x6736925a), + TOBN(0x0a83fbbc, 0x99581af7), TOBN(0x3076bc40, 0x64eeb051)}, + {TOBN(0x5511c98c, 0x02dec312), TOBN(0x270de898, 0x238dcb78), + TOBN(0x2cf4cf9c, 0x539c08c9), TOBN(0xa70cb65e, 0x38d3b06e)}}, + {{TOBN(0xb12ec10e, 0xcfe57bbd), TOBN(0x82c7b656, 0x35a0c2b5), + TOBN(0xddc7d5cd, 0x161c67bd), TOBN(0xe32e8985, 0xae3a32cc)}, + {TOBN(0x7aba9444, 0xd11a5529), TOBN(0xe964ed02, 0x2427fa1a), + TOBN(0x1528392d, 0x24a1770a), TOBN(0xa152ce2c, 0x12c72fcd)}}, + {{TOBN(0x714553a4, 0x8ec07649), TOBN(0x18b4c290, 0x459dd453), + TOBN(0xea32b714, 0x7b64b110), TOBN(0xb871bfa5, 0x2e6f07a2)}, + {TOBN(0xb67112e5, 0x9e2e3c9b), TOBN(0xfbf250e5, 0x44aa90f6), + TOBN(0xf77aedb8, 0xbd539006), TOBN(0x3b0cdf9a, 0xd172a66f)}}, + {{TOBN(0xedf69fea, 0xf8c51187), TOBN(0x05bb67ec, 0x741e4da7), + TOBN(0x47df0f32, 0x08114345), TOBN(0x56facb07, 0xbb9792b1)}, + {TOBN(0xf3e007e9, 0x8f6229e4), TOBN(0x62d103f4, 0x526fba0f), + TOBN(0x4f33bef7, 0xb0339d79), TOBN(0x9841357b, 0xb59bfec1)}}, + {{TOBN(0xfa8dbb59, 0xc34e6705), TOBN(0xc3c7180b, 0x7fdaa84c), + TOBN(0xf95872fc, 0xa4108537), TOBN(0x8750cc3b, 0x932a3e5a)}, + {TOBN(0xb61cc69d, 0xb7275d7d), TOBN(0xffa0168b, 0x2e59b2e9), + TOBN(0xca032abc, 0x6ecbb493), TOBN(0x1d86dbd3, 0x2c9082d8)}}, + {{TOBN(0xae1e0b67, 0xe28ef5ba), TOBN(0x2c9a4699, 0xcb18e169), + TOBN(0x0ecd0e33, 0x1e6bbd20), TOBN(0x571b360e, 0xaf5e81d2)}, + {TOBN(0xcd9fea58, 0x101c1d45), TOBN(0x6651788e, 0x18880452), + TOBN(0xa9972635, 0x1f8dd446), TOBN(0x44bed022, 0xe37281d0)}}, + {{TOBN(0x094b2b2d, 0x33da525d), TOBN(0xf193678e, 0x13144fd8), + TOBN(0xb8ab5ba4, 0xf4c1061d), TOBN(0x4343b5fa, 0xdccbe0f4)}, + {TOBN(0xa8702371, 0x63812713), TOBN(0x47bf6d2d, 0xf7611d93), + TOBN(0x46729b8c, 0xbd21e1d7), TOBN(0x7484d4e0, 0xd629e77d)}}, + {{TOBN(0x830e6eea, 0x60dbac1f), TOBN(0x23d8c484, 0xda06a2f7), + TOBN(0x896714b0, 0x50ca535b), TOBN(0xdc8d3644, 0xebd97a9b)}, + {TOBN(0x106ef9fa, 0xb12177b4), TOBN(0xf79bf464, 0x534d5d9c), + TOBN(0x2537a349, 0xa6ab360b), TOBN(0xc7c54253, 0xa00c744f)}}, + {{TOBN(0xb3c7a047, 0xe5911a76), TOBN(0x61ffa5c8, 0x647f1ee7), + TOBN(0x15aed36f, 0x8f56ab42), TOBN(0x6a0d41b0, 0xa3ff9ac9)}, + {TOBN(0x68f469f5, 0xcc30d357), TOBN(0xbe9adf81, 0x6b72be96), + TOBN(0x1cd926fe, 0x903ad461), TOBN(0x7e89e38f, 0xcaca441b)}}, + {{TOBN(0xf0f82de5, 0xfacf69d4), TOBN(0x363b7e76, 0x4775344c), + TOBN(0x6894f312, 0xb2e36d04), TOBN(0x3c6cb4fe, 0x11d1c9a5)}, + {TOBN(0x85d9c339, 0x4008e1f2), TOBN(0x5e9a85ea, 0x249f326c), + TOBN(0xdc35c60a, 0x678c5e06), TOBN(0xc08b944f, 0x9f86fba9)}}, + {{TOBN(0xde40c02c, 0x89f71f0f), TOBN(0xad8f3e31, 0xff3da3c0), + TOBN(0x3ea5096b, 0x42125ded), TOBN(0x13879cbf, 0xa7379183)}, + {TOBN(0x6f4714a5, 0x6b306a0b), TOBN(0x359c2ea6, 0x67646c5e), + TOBN(0xfacf8943, 0x07726368), TOBN(0x07a58935, 0x65ff431e)}}, + {{TOBN(0x24d661d1, 0x68754ab0), TOBN(0x801fce1d, 0x6f429a76), + TOBN(0xc068a85f, 0xa58ce769), TOBN(0xedc35c54, 0x5d5eca2b)}, + {TOBN(0xea31276f, 0xa3f660d1), TOBN(0xa0184ebe, 0xb8fc7167), + TOBN(0x0f20f21a, 0x1d8db0ae), TOBN(0xd96d095f, 0x56c35e12)}}, + {{TOBN(0xedf402b5, 0xf8c2a25b), TOBN(0x1bb772b9, 0x059204b6), + TOBN(0x50cbeae2, 0x19b4e34c), TOBN(0x93109d80, 0x3fa0845a)}, + {TOBN(0x54f7ccf7, 0x8ef59fb5), TOBN(0x3b438fe2, 0x88070963), + TOBN(0x9e28c659, 0x31f3ba9b), TOBN(0x9cc31b46, 0xead9da92)}}, + {{TOBN(0x3c2f0ba9, 0xb733aa5f), TOBN(0xdece47cb, 0xf05af235), + TOBN(0xf8e3f715, 0xa2ac82a5), TOBN(0xc97ba641, 0x2203f18a)}, + {TOBN(0xc3af5504, 0x09c11060), TOBN(0x56ea2c05, 0x46af512d), + TOBN(0xfac28daf, 0xf3f28146), TOBN(0x87fab43a, 0x959ef494)}}}, + {{{TOBN(0x09891641, 0xd4c5105f), TOBN(0x1ae80f8e, 0x6d7fbd65), + TOBN(0x9d67225f, 0xbee6bdb0), TOBN(0x3b433b59, 0x7fc4d860)}, + {TOBN(0x44e66db6, 0x93e85638), TOBN(0xf7b59252, 0xe3e9862f), + TOBN(0xdb785157, 0x665c32ec), TOBN(0x702fefd7, 0xae362f50)}}, + {{TOBN(0x3754475d, 0x0fefb0c3), TOBN(0xd48fb56b, 0x46d7c35d), + TOBN(0xa070b633, 0x363798a4), TOBN(0xae89f3d2, 0x8fdb98e6)}, + {TOBN(0x970b89c8, 0x6363d14c), TOBN(0x89817521, 0x67abd27d), + TOBN(0x9bf7d474, 0x44d5a021), TOBN(0xb3083baf, 0xcac72aee)}}, + {{TOBN(0x389741de, 0xbe949a44), TOBN(0x638e9388, 0x546a4fa5), + TOBN(0x3fe6419c, 0xa0047bdc), TOBN(0x7047f648, 0xaaea57ca)}, + {TOBN(0x54e48a90, 0x41fbab17), TOBN(0xda8e0b28, 0x576bdba2), + TOBN(0xe807eebc, 0xc72afddc), TOBN(0x07d3336d, 0xf42577bf)}}, + {{TOBN(0x62a8c244, 0xbfe20925), TOBN(0x91c19ac3, 0x8fdce867), + TOBN(0x5a96a5d5, 0xdd387063), TOBN(0x61d587d4, 0x21d324f6)}, + {TOBN(0xe87673a2, 0xa37173ea), TOBN(0x23848008, 0x53778b65), + TOBN(0x10f8441e, 0x05bab43e), TOBN(0xfa11fe12, 0x4621efbe)}}, + {{TOBN(0x047b772e, 0x81685d7b), TOBN(0x23f27d81, 0xbf34a976), + TOBN(0xc27608e2, 0x915f48ef), TOBN(0x3b0b43fa, 0xa521d5c3)}, + {TOBN(0x7613fb26, 0x63ca7284), TOBN(0x7f5729b4, 0x1d4db837), + TOBN(0x87b14898, 0x583b526b), TOBN(0x00b732a6, 0xbbadd3d1)}}, + {{TOBN(0x8e02f426, 0x2048e396), TOBN(0x436b50b6, 0x383d9de4), + TOBN(0xf78d3481, 0x471e85ad), TOBN(0x8b01ea6a, 0xd005c8d6)}, + {TOBN(0xd3c7afee, 0x97015c07), TOBN(0x46cdf1a9, 0x4e3ba2ae), + TOBN(0x7a42e501, 0x83d3a1d2), TOBN(0xd54b5268, 0xb541dff4)}}, + {{TOBN(0x3f24cf30, 0x4e23e9bc), TOBN(0x4387f816, 0x126e3624), + TOBN(0x26a46a03, 0x3b0b6d61), TOBN(0xaf1bc845, 0x8b2d777c)}, + {TOBN(0x25c401ba, 0x527de79c), TOBN(0x0e1346d4, 0x4261bbb6), + TOBN(0x4b96c44b, 0x287b4bc7), TOBN(0x658493c7, 0x5254562f)}}, + {{TOBN(0x23f949fe, 0xb8a24a20), TOBN(0x17ebfed1, 0xf52ca53f), + TOBN(0x9b691bbe, 0xbcfb4853), TOBN(0x5617ff6b, 0x6278a05d)}, + {TOBN(0x241b34c5, 0xe3c99ebd), TOBN(0xfc64242e, 0x1784156a), + TOBN(0x4206482f, 0x695d67df), TOBN(0xb967ce0e, 0xee27c011)}}, + {{TOBN(0x65db3751, 0x21c80b5d), TOBN(0x2e7a563c, 0xa31ecca0), + TOBN(0xe56ffc4e, 0x5238a07e), TOBN(0x3d6c2966, 0x32ced854)}, + {TOBN(0xe99d7d1a, 0xaf70b885), TOBN(0xafc3bad9, 0x2d686459), + TOBN(0x9c78bf46, 0x0cc8ba5b), TOBN(0x5a439519, 0x18955aa3)}}, + {{TOBN(0xf8b517a8, 0x5fe4e314), TOBN(0xe60234d0, 0xfcb8906f), + TOBN(0xffe542ac, 0xf2061b23), TOBN(0x287e191f, 0x6b4cb59c)}, + {TOBN(0x21857ddc, 0x09d877d8), TOBN(0x1c23478c, 0x14678941), + TOBN(0xbbf0c056, 0xb6e05ea4), TOBN(0x82da4b53, 0xb01594fe)}}, + {{TOBN(0xf7526791, 0xfadb8608), TOBN(0x049e832d, 0x7b74cdf6), + TOBN(0xa43581cc, 0xc2b90a34), TOBN(0x73639eb8, 0x9360b10c)}, + {TOBN(0x4fba331f, 0xe1e4a71b), TOBN(0x6ffd6b93, 0x8072f919), + TOBN(0x6e53271c, 0x65679032), TOBN(0x67206444, 0xf14272ce)}}, + {{TOBN(0xc0f734a3, 0xb2335834), TOBN(0x9526205a, 0x90ef6860), + TOBN(0xcb8be717, 0x04e2bb0d), TOBN(0x2418871e, 0x02f383fa)}, + {TOBN(0xd7177681, 0x4082c157), TOBN(0xcc914ad0, 0x29c20073), + TOBN(0xf186c1eb, 0xe587e728), TOBN(0x6fdb3c22, 0x61bcd5fd)}}, + {{TOBN(0x30d014a6, 0xf2f9f8e9), TOBN(0x963ece23, 0x4fec49d2), + TOBN(0x862025c5, 0x9605a8d9), TOBN(0x39874445, 0x19f8929a)}, + {TOBN(0x01b6ff65, 0x12bf476a), TOBN(0x598a64d8, 0x09cf7d91), + TOBN(0xd7ec7749, 0x93be56ca), TOBN(0x10899785, 0xcbb33615)}}, + {{TOBN(0xb8a092fd, 0x02eee3ad), TOBN(0xa86b3d35, 0x30145270), + TOBN(0x323d98c6, 0x8512b675), TOBN(0x4b8bc785, 0x62ebb40f)}, + {TOBN(0x7d301f54, 0x413f9cde), TOBN(0xa5e4fb4f, 0x2bab5664), + TOBN(0x1d2b252d, 0x1cbfec23), TOBN(0xfcd576bb, 0xe177120d)}}, + {{TOBN(0x04427d3e, 0x83731a34), TOBN(0x2bb9028e, 0xed836e8e), + TOBN(0xb36acff8, 0xb612ca7c), TOBN(0xb88fe5ef, 0xd3d9c73a)}, + {TOBN(0xbe2a6bc6, 0xedea4eb3), TOBN(0x43b93133, 0x488eec77), + TOBN(0xf41ff566, 0xb17106e1), TOBN(0x469e9172, 0x654efa32)}}, + {{TOBN(0xb4480f04, 0x41c23fa3), TOBN(0xb4712eb0, 0xc1989a2e), + TOBN(0x3ccbba0f, 0x93a29ca7), TOBN(0x6e205c14, 0xd619428c)}, + {TOBN(0x90db7957, 0xb3641686), TOBN(0x0432691d, 0x45ac8b4e), + TOBN(0x07a759ac, 0xf64e0350), TOBN(0x0514d89c, 0x9c972517)}}, + {{TOBN(0x1701147f, 0xa8e67fc3), TOBN(0x9e2e0b8b, 0xab2085be), + TOBN(0xd5651824, 0xac284e57), TOBN(0x890d4325, 0x74893664)}, + {TOBN(0x8a7c5e6e, 0xc55e68a3), TOBN(0xbf12e90b, 0x4339c85a), + TOBN(0x31846b85, 0xf922b655), TOBN(0x9a54ce4d, 0x0bf4d700)}}, + {{TOBN(0xd7f4e83a, 0xf1a14295), TOBN(0x916f955c, 0xb285d4f9), + TOBN(0xe57bb0e0, 0x99ffdaba), TOBN(0x28a43034, 0xeab0d152)}, + {TOBN(0x0a36ffa2, 0xb8a9cef8), TOBN(0x5517407e, 0xb9ec051a), + TOBN(0x9c796096, 0xea68e672), TOBN(0x853db5fb, 0xfb3c77fb)}}, + {{TOBN(0x21474ba9, 0xe864a51a), TOBN(0x6c267699, 0x6e8a1b8b), + TOBN(0x7c823626, 0x94120a28), TOBN(0xe61e9a48, 0x8383a5db)}, + {TOBN(0x7dd75003, 0x9f84216d), TOBN(0xab020d07, 0xad43cd85), + TOBN(0x9437ae48, 0xda12c659), TOBN(0x6449c2eb, 0xe65452ad)}}, + {{TOBN(0xcc7c4c1c, 0x2cf9d7c1), TOBN(0x1320886a, 0xee95e5ab), + TOBN(0xbb7b9056, 0xbeae170c), TOBN(0xc8a5b250, 0xdbc0d662)}, + {TOBN(0x4ed81432, 0xc11d2303), TOBN(0x7da66912, 0x1f03769f), + TOBN(0x3ac7a5fd, 0x84539828), TOBN(0x14dada94, 0x3bccdd02)}}, + {{TOBN(0x8b84c321, 0x7ef6b0d1), TOBN(0x52a9477a, 0x7c933f22), + TOBN(0x5ef6728a, 0xfd440b82), TOBN(0x5c3bd859, 0x6ce4bd5e)}, + {TOBN(0x918b80f5, 0xf22c2d3e), TOBN(0x368d5040, 0xb7bb6cc5), + TOBN(0xb66142a1, 0x2695a11c), TOBN(0x60ac583a, 0xeb19ea70)}}, + {{TOBN(0x317cbb98, 0x0eab2437), TOBN(0x8cc08c55, 0x5e2654c8), + TOBN(0xfe2d6520, 0xe6d8307f), TOBN(0xe9f147f3, 0x57428993)}, + {TOBN(0x5f9c7d14, 0xd2fd6cf1), TOBN(0xa3ecd064, 0x2d4fcbb0), + TOBN(0xad83fef0, 0x8e7341f7), TOBN(0x643f23a0, 0x3a63115c)}}, + {{TOBN(0xd38a78ab, 0xe65ab743), TOBN(0xbf7c75b1, 0x35edc89c), + TOBN(0x3dd8752e, 0x530df568), TOBN(0xf85c4a76, 0xe308c682)}, + {TOBN(0x4c9955b2, 0xe68acf37), TOBN(0xa544df3d, 0xab32af85), + TOBN(0x4b8ec3f5, 0xa25cf493), TOBN(0x4d8f2764, 0x1a622feb)}}, + {{TOBN(0x7bb4f7aa, 0xf0dcbc49), TOBN(0x7de551f9, 0x70bbb45b), + TOBN(0xcfd0f3e4, 0x9f2ca2e5), TOBN(0xece58709, 0x1f5c76ef)}, + {TOBN(0x32920edd, 0x167d79ae), TOBN(0x039df8a2, 0xfa7d7ec1), + TOBN(0xf46206c0, 0xbb30af91), TOBN(0x1ff5e2f5, 0x22676b59)}}, + {{TOBN(0x11f4a039, 0x6ea51d66), TOBN(0x506c1445, 0x807d7a26), + TOBN(0x60da5705, 0x755a9b24), TOBN(0x8fc8cc32, 0x1f1a319e)}, + {TOBN(0x83642d4d, 0x9433d67d), TOBN(0x7fa5cb8f, 0x6a7dd296), + TOBN(0x576591db, 0x9b7bde07), TOBN(0x13173d25, 0x419716fb)}}, + {{TOBN(0xea30599d, 0xd5b340ff), TOBN(0xfc6b5297, 0xb0fe76c5), + TOBN(0x1c6968c8, 0xab8f5adc), TOBN(0xf723c7f5, 0x901c928d)}, + {TOBN(0x4203c321, 0x9773d402), TOBN(0xdf7c6aa3, 0x1b51dd47), + TOBN(0x3d49e37a, 0x552be23c), TOBN(0x57febee8, 0x0b5a6e87)}}, + {{TOBN(0xc5ecbee4, 0x7bd8e739), TOBN(0x79d44994, 0xae63bf75), + TOBN(0x168bd00f, 0x38fb8923), TOBN(0x75d48ee4, 0xd0533130)}, + {TOBN(0x554f77aa, 0xdb5cdf33), TOBN(0x3396e896, 0x3c696769), + TOBN(0x2fdddbf2, 0xd3fd674e), TOBN(0xbbb8f6ee, 0x99d0e3e5)}}, + {{TOBN(0x51b90651, 0xcbae2f70), TOBN(0xefc4bc05, 0x93aaa8eb), + TOBN(0x8ecd8689, 0xdd1df499), TOBN(0x1aee99a8, 0x22f367a5)}, + {TOBN(0x95d485b9, 0xae8274c5), TOBN(0x6c14d445, 0x7d30b39c), + TOBN(0xbafea90b, 0xbcc1ef81), TOBN(0x7c5f317a, 0xa459a2ed)}}, + {{TOBN(0x01211075, 0x4ef44227), TOBN(0xa17bed6e, 0xdc20f496), + TOBN(0x0cdfe424, 0x819853cd), TOBN(0x13793298, 0xf71e2ce7)}, + {TOBN(0x3c1f3078, 0xdbbe307b), TOBN(0x6dd1c20e, 0x76ee9936), + TOBN(0x23ee4b57, 0x423caa20), TOBN(0x4ac3793b, 0x8efb840e)}}, + {{TOBN(0x934438eb, 0xed1f8ca0), TOBN(0x3e546658, 0x4ebb25a2), + TOBN(0xc415af0e, 0xc069896f), TOBN(0xc13eddb0, 0x9a5aa43d)}, + {TOBN(0x7a04204f, 0xd49eb8f6), TOBN(0xd0d5bdfc, 0xd74f1670), + TOBN(0x3697e286, 0x56fc0558), TOBN(0x10207371, 0x01cebade)}}, + {{TOBN(0x5f87e690, 0x0647a82b), TOBN(0x908e0ed4, 0x8f40054f), + TOBN(0xa9f633d4, 0x79853803), TOBN(0x8ed13c9a, 0x4a28b252)}, + {TOBN(0x3e2ef676, 0x1f460f64), TOBN(0x53930b9b, 0x36d06336), + TOBN(0x347073ac, 0x8fc4979b), TOBN(0x84380e0e, 0x5ecd5597)}}, + {{TOBN(0xe3b22c6b, 0xc4fe3c39), TOBN(0xba4a8153, 0x6c7bebdf), + TOBN(0xf23ab6b7, 0x25693459), TOBN(0x53bc3770, 0x14922b11)}, + {TOBN(0x4645c8ab, 0x5afc60db), TOBN(0xaa022355, 0x20b9f2a3), + TOBN(0x52a2954c, 0xce0fc507), TOBN(0x8c2731bb, 0x7ce1c2e7)}}, + {{TOBN(0xf39608ab, 0x18a0339d), TOBN(0xac7a658d, 0x3735436c), + TOBN(0xb22c2b07, 0xcd992b4f), TOBN(0x4e83daec, 0xf40dcfd4)}, + {TOBN(0x8a34c7be, 0x2f39ea3e), TOBN(0xef0c005f, 0xb0a56d2e), + TOBN(0x62731f6a, 0x6edd8038), TOBN(0x5721d740, 0x4e3cb075)}}, + {{TOBN(0x1ea41511, 0xfbeeee1b), TOBN(0xd1ef5e73, 0xef1d0c05), + TOBN(0x42feefd1, 0x73c07d35), TOBN(0xe530a00a, 0x8a329493)}, + {TOBN(0x5d55b7fe, 0xf15ebfb0), TOBN(0x549de03c, 0xd322491a), + TOBN(0xf7b5f602, 0x745b3237), TOBN(0x3632a3a2, 0x1ab6e2b6)}}, + {{TOBN(0x0d3bba89, 0x0ef59f78), TOBN(0x0dfc6443, 0xc9e52b9a), + TOBN(0x1dc79699, 0x72631447), TOBN(0xef033917, 0xb3be20b1)}, + {TOBN(0x0c92735d, 0xb1383948), TOBN(0xc1fc29a2, 0xc0dd7d7d), + TOBN(0x6485b697, 0x403ed068), TOBN(0x13bfaab3, 0xaac93bdc)}}, + {{TOBN(0x410dc6a9, 0x0deeaf52), TOBN(0xb003fb02, 0x4c641c15), + TOBN(0x1384978c, 0x5bc504c4), TOBN(0x37640487, 0x864a6a77)}, + {TOBN(0x05991bc6, 0x222a77da), TOBN(0x62260a57, 0x5e47eb11), + TOBN(0xc7af6613, 0xf21b432c), TOBN(0x22f3acc9, 0xab4953e9)}}, + {{TOBN(0x52934922, 0x8e41d155), TOBN(0x4d024568, 0x3ac059ef), + TOBN(0xb0201755, 0x4d884411), TOBN(0xce8055cf, 0xa59a178f)}, + {TOBN(0xcd77d1af, 0xf6204549), TOBN(0xa0a00a3e, 0xc7066759), + TOBN(0x471071ef, 0x0272c229), TOBN(0x009bcf6b, 0xd3c4b6b0)}}, + {{TOBN(0x2a2638a8, 0x22305177), TOBN(0xd51d59df, 0x41645bbf), + TOBN(0xa81142fd, 0xc0a7a3c0), TOBN(0xa17eca6d, 0x4c7063ee)}, + {TOBN(0x0bb887ed, 0x60d9dcec), TOBN(0xd6d28e51, 0x20ad2455), + TOBN(0xebed6308, 0xa67102ba), TOBN(0x042c3114, 0x8bffa408)}}, + {{TOBN(0xfd099ac5, 0x8aa68e30), TOBN(0x7a6a3d7c, 0x1483513e), + TOBN(0xffcc6b75, 0xba2d8f0c), TOBN(0x54dacf96, 0x1e78b954)}, + {TOBN(0xf645696f, 0xa4a9af89), TOBN(0x3a411940, 0x06ac98ec), + TOBN(0x41b8b3f6, 0x22a67a20), TOBN(0x2d0b1e0f, 0x99dec626)}}, + {{TOBN(0x27c89192, 0x40be34e8), TOBN(0xc7162b37, 0x91907f35), + TOBN(0x90188ec1, 0xa956702b), TOBN(0xca132f7d, 0xdf93769c)}, + {TOBN(0x3ece44f9, 0x0e2025b4), TOBN(0x67aaec69, 0x0c62f14c), + TOBN(0xad741418, 0x22e3cc11), TOBN(0xcf9b75c3, 0x7ff9a50e)}}, + {{TOBN(0x02fa2b16, 0x4d348272), TOBN(0xbd99d61a, 0x9959d56d), + TOBN(0xbc4f19db, 0x18762916), TOBN(0xcc7cce50, 0x49c1ac80)}, + {TOBN(0x4d59ebaa, 0xd846bd83), TOBN(0x8775a9dc, 0xa9202849), + TOBN(0x07ec4ae1, 0x6e1f4ca9), TOBN(0x27eb5875, 0xba893f11)}}, + {{TOBN(0x00284d51, 0x662cc565), TOBN(0x82353a6b, 0x0db4138d), + TOBN(0xd9c7aaaa, 0xaa32a594), TOBN(0xf5528b5e, 0xa5669c47)}, + {TOBN(0xf3220231, 0x2f23c5ff), TOBN(0xe3e8147a, 0x6affa3a1), + TOBN(0xfb423d5c, 0x202ddda0), TOBN(0x3d6414ac, 0x6b871bd4)}}, + {{TOBN(0x586f82e1, 0xa51a168a), TOBN(0xb712c671, 0x48ae5448), + TOBN(0x9a2e4bd1, 0x76233eb8), TOBN(0x0188223a, 0x78811ca9)}, + {TOBN(0x553c5e21, 0xf7c18de1), TOBN(0x7682e451, 0xb27bb286), + TOBN(0x3ed036b3, 0x0e51e929), TOBN(0xf487211b, 0xec9cb34f)}}, + {{TOBN(0x0d094277, 0x0c24efc8), TOBN(0x0349fd04, 0xbef737a4), + TOBN(0x6d1c9dd2, 0x514cdd28), TOBN(0x29c135ff, 0x30da9521)}, + {TOBN(0xea6e4508, 0xf78b0b6f), TOBN(0x176f5dd2, 0x678c143c), + TOBN(0x08148418, 0x4be21e65), TOBN(0x27f7525c, 0xe7df38c4)}}, + {{TOBN(0x1fb70e09, 0x748ab1a4), TOBN(0x9cba50a0, 0x5efe4433), + TOBN(0x7846c7a6, 0x15f75af2), TOBN(0x2a7c2c57, 0x5ee73ea8)}, + {TOBN(0x42e566a4, 0x3f0a449a), TOBN(0x45474c3b, 0xad90fc3d), + TOBN(0x7447be3d, 0x8b61d057), TOBN(0x3e9d1cf1, 0x3a4ec092)}}, + {{TOBN(0x1603e453, 0xf380a6e6), TOBN(0x0b86e431, 0x9b1437c2), + TOBN(0x7a4173f2, 0xef29610a), TOBN(0x8fa729a7, 0xf03d57f7)}, + {TOBN(0x3e186f6e, 0x6c9c217e), TOBN(0xbe1d3079, 0x91919524), + TOBN(0x92a62a70, 0x153d4fb1), TOBN(0x32ed3e34, 0xd68c2f71)}}, + {{TOBN(0xd785027f, 0x9eb1a8b7), TOBN(0xbc37eb77, 0xc5b22fe8), + TOBN(0x466b34f0, 0xb9d6a191), TOBN(0x008a89af, 0x9a05f816)}, + {TOBN(0x19b028fb, 0x7d42c10a), TOBN(0x7fe8c92f, 0x49b3f6b8), + TOBN(0x58907cc0, 0xa5a0ade3), TOBN(0xb3154f51, 0x559d1a7c)}}, + {{TOBN(0x5066efb6, 0xd9790ed6), TOBN(0xa77a0cbc, 0xa6aa793b), + TOBN(0x1a915f3c, 0x223e042e), TOBN(0x1c5def04, 0x69c5874b)}, + {TOBN(0x0e830078, 0x73b6c1da), TOBN(0x55cf85d2, 0xfcd8557a), + TOBN(0x0f7c7c76, 0x0460f3b1), TOBN(0x87052acb, 0x46e58063)}}, + {{TOBN(0x09212b80, 0x907eae66), TOBN(0x3cb068e0, 0x4d721c89), + TOBN(0xa87941ae, 0xdd45ac1c), TOBN(0xde8d5c0d, 0x0daa0dbb)}, + {TOBN(0xda421fdc, 0xe3502e6e), TOBN(0xc8944201, 0x4d89a084), + TOBN(0x7307ba5e, 0xf0c24bfb), TOBN(0xda212beb, 0x20bde0ef)}}, + {{TOBN(0xea2da24b, 0xf82ce682), TOBN(0x058d3816, 0x07f71fe4), + TOBN(0x35a02462, 0x5ffad8de), TOBN(0xcd7b05dc, 0xaadcefab)}, + {TOBN(0xd442f8ed, 0x1d9f54ec), TOBN(0x8be3d618, 0xb2d3b5ca), + TOBN(0xe2220ed0, 0xe06b2ce2), TOBN(0x82699a5f, 0x1b0da4c0)}}, + {{TOBN(0x3ff106f5, 0x71c0c3a7), TOBN(0x8f580f5a, 0x0d34180c), + TOBN(0x4ebb120e, 0x22d7d375), TOBN(0x5e5782cc, 0xe9513675)}, + {TOBN(0x2275580c, 0x99c82a70), TOBN(0xe8359fbf, 0x15ea8c4c), + TOBN(0x53b48db8, 0x7b415e70), TOBN(0xaacf2240, 0x100c6014)}}, + {{TOBN(0x9faaccf5, 0xe4652f1d), TOBN(0xbd6fdd2a, 0xd56157b2), + TOBN(0xa4f4fb1f, 0x6261ec50), TOBN(0x244e55ad, 0x476bcd52)}, + {TOBN(0x881c9305, 0x047d320b), TOBN(0x1ca983d5, 0x6181263f), + TOBN(0x354e9a44, 0x278fb8ee), TOBN(0xad2dbc0f, 0x396e4964)}}, + {{TOBN(0x723f3aa2, 0x9268b3de), TOBN(0x0d1ca29a, 0xe6e0609a), + TOBN(0x794866aa, 0x6cf44252), TOBN(0x0b59f3e3, 0x01af87ed)}, + {TOBN(0xe234e5ff, 0x7f4a6c51), TOBN(0xa8768fd2, 0x61dc2f7e), + TOBN(0xdafc7332, 0x0a94d81f), TOBN(0xd7f84282, 0x06938ce1)}}, + {{TOBN(0xae0b3c0e, 0x0546063e), TOBN(0x7fbadcb2, 0x5d61abc6), + TOBN(0xd5d7a2c9, 0x369ac400), TOBN(0xa5978d09, 0xae67d10c)}, + {TOBN(0x290f211e, 0x4f85eaac), TOBN(0xe61e2ad1, 0xfacac681), + TOBN(0xae125225, 0x388384cd), TOBN(0xa7fb68e9, 0xccfde30f)}}, + {{TOBN(0x7a59b936, 0x3daed4c2), TOBN(0x80a9aa40, 0x2606f789), + TOBN(0xb40c1ea5, 0xf6a6d90a), TOBN(0x948364d3, 0x514d5885)}, + {TOBN(0x062ebc60, 0x70985182), TOBN(0xa6db5b0e, 0x33310895), + TOBN(0x64a12175, 0xe329c2f5), TOBN(0xc5f25bd2, 0x90ea237e)}}, + {{TOBN(0x7915c524, 0x2d0a4c23), TOBN(0xeb5d26e4, 0x6bb3cc52), + TOBN(0x369a9116, 0xc09e2c92), TOBN(0x0c527f92, 0xcf182cf8)}, + {TOBN(0x9e591938, 0x2aede0ac), TOBN(0xb2922208, 0x6cc34939), + TOBN(0x3c9d8962, 0x99a34361), TOBN(0x3c81836d, 0xc1905fe6)}}, + {{TOBN(0x4bfeb57f, 0xa001ec5a), TOBN(0xe993f5bb, 0xa0dc5dba), + TOBN(0x47884109, 0x724a1380), TOBN(0x8a0369ab, 0x32fe9a04)}, + {TOBN(0xea068d60, 0x8c927db8), TOBN(0xbf5f37cf, 0x94655741), + TOBN(0x47d402a2, 0x04b6c7ea), TOBN(0x4551c295, 0x6af259cb)}}, + {{TOBN(0x698b71e7, 0xed77ee8b), TOBN(0xbddf7bd0, 0xf309d5c7), + TOBN(0x6201c22c, 0x34e780ca), TOBN(0xab04f7d8, 0x4c295ef4)}, + {TOBN(0x1c947294, 0x4313a8ce), TOBN(0xe532e4ac, 0x92ca4cfe), + TOBN(0x89738f80, 0xd0a7a97a), TOBN(0xec088c88, 0xa580fd5b)}}, + {{TOBN(0x612b1ecc, 0x42ce9e51), TOBN(0x8f9840fd, 0xb25fdd2a), + TOBN(0x3cda78c0, 0x01e7f839), TOBN(0x546b3d3a, 0xece05480)}, + {TOBN(0x271719a9, 0x80d30916), TOBN(0x45497107, 0x584c20c4), + TOBN(0xaf8f9478, 0x5bc78608), TOBN(0x28c7d484, 0x277e2a4c)}}, + {{TOBN(0xfce01767, 0x88a2ffe4), TOBN(0xdc506a35, 0x28e169a5), + TOBN(0x0ea10861, 0x7af9c93a), TOBN(0x1ed24361, 0x03fa0e08)}, + {TOBN(0x96eaaa92, 0xa3d694e7), TOBN(0xc0f43b4d, 0xef50bc74), + TOBN(0xce6aa58c, 0x64114db4), TOBN(0x8218e8ea, 0x7c000fd4)}}, + {{TOBN(0xac815dfb, 0x185f8844), TOBN(0xcd7e90cb, 0x1557abfb), + TOBN(0x23d16655, 0xafbfecdf), TOBN(0x80f3271f, 0x085cac4a)}, + {TOBN(0x7fc39aa7, 0xd0e62f47), TOBN(0x88d519d1, 0x460a48e5), + TOBN(0x59559ac4, 0xd28f101e), TOBN(0x7981d9e9, 0xca9ae816)}}, + {{TOBN(0x5c38652c, 0x9ac38203), TOBN(0x86eaf87f, 0x57657fe5), + TOBN(0x568fc472, 0xe21f5416), TOBN(0x2afff39c, 0xe7e597b5)}, + {TOBN(0x3adbbb07, 0x256d4eab), TOBN(0x22598692, 0x8285ab89), + TOBN(0x35f8112a, 0x041caefe), TOBN(0x95df02e3, 0xa5064c8b)}}, + {{TOBN(0x4d63356e, 0xc7004bf3), TOBN(0x230a08f4, 0xdb83c7de), + TOBN(0xca27b270, 0x8709a7b7), TOBN(0x0d1c4cc4, 0xcb9abd2d)}, + {TOBN(0x8a0bc66e, 0x7550fee8), TOBN(0x369cd4c7, 0x9cf7247e), + TOBN(0x75562e84, 0x92b5b7e7), TOBN(0x8fed0da0, 0x5802af7b)}}, + {{TOBN(0x6a7091c2, 0xe48fb889), TOBN(0x26882c13, 0x7b8a9d06), + TOBN(0xa2498663, 0x1b82a0e2), TOBN(0x844ed736, 0x3518152d)}, + {TOBN(0x282f476f, 0xd86e27c7), TOBN(0xa04edaca, 0x04afefdc), + TOBN(0x8b256ebc, 0x6119e34d), TOBN(0x56a413e9, 0x0787d78b)}}}, + {{{TOBN(0x82ee061d, 0x5a74be50), TOBN(0xe41781c4, 0xdea16ff5), + TOBN(0xe0b0c81e, 0x99bfc8a2), TOBN(0x624f4d69, 0x0b547e2d)}, + {TOBN(0x3a83545d, 0xbdcc9ae4), TOBN(0x2573dbb6, 0x409b1e8e), + TOBN(0x482960c4, 0xa6c93539), TOBN(0xf01059ad, 0x5ae18798)}}, + {{TOBN(0x715c9f97, 0x3112795f), TOBN(0xe8244437, 0x984e6ee1), + TOBN(0x55cb4858, 0xecb66bcd), TOBN(0x7c136735, 0xabaffbee)}, + {TOBN(0x54661595, 0x5dbec38e), TOBN(0x51c0782c, 0x388ad153), + TOBN(0x9ba4c53a, 0xc6e0952f), TOBN(0x27e6782a, 0x1b21dfa8)}}, + {{TOBN(0x682f903d, 0x4ed2dbc2), TOBN(0x0eba59c8, 0x7c3b2d83), + TOBN(0x8e9dc84d, 0x9c7e9335), TOBN(0x5f9b21b0, 0x0eb226d7)}, + {TOBN(0xe33bd394, 0xaf267bae), TOBN(0xaa86cc25, 0xbe2e15ae), + TOBN(0x4f0bf67d, 0x6a8ec500), TOBN(0x5846aa44, 0xf9630658)}}, + {{TOBN(0xfeb09740, 0xe2c2bf15), TOBN(0x627a2205, 0xa9e99704), + TOBN(0xec8d73d0, 0xc2fbc565), TOBN(0x223eed8f, 0xc20c8de8)}, + {TOBN(0x1ee32583, 0xa8363b49), TOBN(0x1a0b6cb9, 0xc9c2b0a6), + TOBN(0x49f7c3d2, 0x90dbc85c), TOBN(0xa8dfbb97, 0x1ef4c1ac)}}, + {{TOBN(0xafb34d4c, 0x65c7c2ab), TOBN(0x1d4610e7, 0xe2c5ea84), + TOBN(0x893f6d1b, 0x973c4ab5), TOBN(0xa3cdd7e9, 0x945ba5c4)}, + {TOBN(0x60514983, 0x064417ee), TOBN(0x1459b23c, 0xad6bdf2b), + TOBN(0x23b2c341, 0x5cf726c3), TOBN(0x3a829635, 0x32d6354a)}}, + {{TOBN(0x294f901f, 0xab192c18), TOBN(0xec5fcbfe, 0x7030164f), + TOBN(0xe2e2fcb7, 0xe2246ba6), TOBN(0x1e7c88b3, 0x221a1a0c)}, + {TOBN(0x72c7dd93, 0xc92d88c5), TOBN(0x41c2148e, 0x1106fb59), + TOBN(0x547dd4f5, 0xa0f60f14), TOBN(0xed9b52b2, 0x63960f31)}}, + {{TOBN(0x6c8349eb, 0xb0a5b358), TOBN(0xb154c5c2, 0x9e7e2ed6), + TOBN(0xcad5eccf, 0xeda462db), TOBN(0xf2d6dbe4, 0x2de66b69)}, + {TOBN(0x426aedf3, 0x8665e5b2), TOBN(0x488a8513, 0x7b7f5723), + TOBN(0x15cc43b3, 0x8bcbb386), TOBN(0x27ad0af3, 0xd791d879)}}, + {{TOBN(0xc16c236e, 0x846e364f), TOBN(0x7f33527c, 0xdea50ca0), + TOBN(0xc4810775, 0x0926b86d), TOBN(0x6c2a3609, 0x0598e70c)}, + {TOBN(0xa6755e52, 0xf024e924), TOBN(0xe0fa07a4, 0x9db4afca), + TOBN(0x15c3ce7d, 0x66831790), TOBN(0x5b4ef350, 0xa6cbb0d6)}}, + {{TOBN(0x2c4aafc4, 0xb6205969), TOBN(0x42563f02, 0xf6c7854f), + TOBN(0x016aced5, 0x1d983b48), TOBN(0xfeb356d8, 0x99949755)}, + {TOBN(0x8c2a2c81, 0xd1a39bd7), TOBN(0x8f44340f, 0xe6934ae9), + TOBN(0x148cf91c, 0x447904da), TOBN(0x7340185f, 0x0f51a926)}}, + {{TOBN(0x2f8f00fb, 0x7409ab46), TOBN(0x057e78e6, 0x80e289b2), + TOBN(0x03e5022c, 0xa888e5d1), TOBN(0x3c87111a, 0x9dede4e2)}, + {TOBN(0x5b9b0e1c, 0x7809460b), TOBN(0xe751c852, 0x71c9abc7), + TOBN(0x8b944e28, 0xc7cc1dc9), TOBN(0x4f201ffa, 0x1d3cfa08)}}, + {{TOBN(0x02fc905c, 0x3e6721ce), TOBN(0xd52d70da, 0xd0b3674c), + TOBN(0x5dc2e5ca, 0x18810da4), TOBN(0xa984b273, 0x5c69dd99)}, + {TOBN(0x63b92527, 0x84de5ca4), TOBN(0x2f1c9872, 0xc852dec4), + TOBN(0x18b03593, 0xc2e3de09), TOBN(0x19d70b01, 0x9813dc2f)}}, + {{TOBN(0x42806b2d, 0xa6dc1d29), TOBN(0xd3030009, 0xf871e144), + TOBN(0xa1feb333, 0xaaf49276), TOBN(0xb5583b9e, 0xc70bc04b)}, + {TOBN(0x1db0be78, 0x95695f20), TOBN(0xfc841811, 0x89d012b5), + TOBN(0x6409f272, 0x05f61643), TOBN(0x40d34174, 0xd5883128)}}, + {{TOBN(0xd79196f5, 0x67419833), TOBN(0x6059e252, 0x863b7b08), + TOBN(0x84da1817, 0x1c56700c), TOBN(0x5758ee56, 0xb28d3ec4)}, + {TOBN(0x7da2771d, 0x013b0ea6), TOBN(0xfddf524b, 0x54c5e9b9), + TOBN(0x7df4faf8, 0x24305d80), TOBN(0x58f5c1bf, 0x3a97763f)}}, + {{TOBN(0xa5af37f1, 0x7c696042), TOBN(0xd4cba22c, 0x4a2538de), + TOBN(0x211cb995, 0x9ea42600), TOBN(0xcd105f41, 0x7b069889)}, + {TOBN(0xb1e1cf19, 0xddb81e74), TOBN(0x472f2d89, 0x5157b8ca), + TOBN(0x086fb008, 0xee9db885), TOBN(0x365cd570, 0x0f26d131)}}, + {{TOBN(0x284b02bb, 0xa2be7053), TOBN(0xdcbbf7c6, 0x7ab9a6d6), + TOBN(0x4425559c, 0x20f7a530), TOBN(0x961f2dfa, 0x188767c8)}, + {TOBN(0xe2fd9435, 0x70dc80c4), TOBN(0x104d6b63, 0xf0784120), + TOBN(0x7f592bc1, 0x53567122), TOBN(0xf6bc1246, 0xf688ad77)}}, + {{TOBN(0x05214c05, 0x0f15dde9), TOBN(0xa47a76a8, 0x0d5f2b82), + TOBN(0xbb254d30, 0x62e82b62), TOBN(0x11a05fe0, 0x3ec955ee)}, + {TOBN(0x7eaff46e, 0x9d529b36), TOBN(0x55ab1301, 0x8f9e3df6), + TOBN(0xc463e371, 0x99317698), TOBN(0xfd251438, 0xccda47ad)}}, + {{TOBN(0xca9c3547, 0x23d695ea), TOBN(0x48ce626e, 0x16e589b5), + TOBN(0x6b5b64c7, 0xb187d086), TOBN(0xd02e1794, 0xb2207948)}, + {TOBN(0x8b58e98f, 0x7198111d), TOBN(0x90ca6305, 0xdcf9c3cc), + TOBN(0x5691fe72, 0xf34089b0), TOBN(0x60941af1, 0xfc7c80ff)}}, + {{TOBN(0xa09bc0a2, 0x22eb51e5), TOBN(0xc0bb7244, 0xaa9cf09a), + TOBN(0x36a8077f, 0x80159f06), TOBN(0x8b5c989e, 0xdddc560e)}, + {TOBN(0x19d2f316, 0x512e1f43), TOBN(0x02eac554, 0xad08ff62), + TOBN(0x012ab84c, 0x07d20b4e), TOBN(0x37d1e115, 0xd6d4e4e1)}}, + {{TOBN(0xb6443e1a, 0xab7b19a8), TOBN(0xf08d067e, 0xdef8cd45), + TOBN(0x63adf3e9, 0x685e03da), TOBN(0xcf15a10e, 0x4792b916)}, + {TOBN(0xf44bcce5, 0xb738a425), TOBN(0xebe131d5, 0x9636b2fd), + TOBN(0x94068841, 0x7850d605), TOBN(0x09684eaa, 0xb40d749d)}}, + {{TOBN(0x8c3c669c, 0x72ba075b), TOBN(0x89f78b55, 0xba469015), + TOBN(0x5706aade, 0x3e9f8ba8), TOBN(0x6d8bd565, 0xb32d7ed7)}, + {TOBN(0x25f4e63b, 0x805f08d6), TOBN(0x7f48200d, 0xc3bcc1b5), + TOBN(0x4e801968, 0xb025d847), TOBN(0x74afac04, 0x87cbe0a8)}}, + {{TOBN(0x43ed2c2b, 0x7e63d690), TOBN(0xefb6bbf0, 0x0223cdb8), + TOBN(0x4fec3cae, 0x2884d3fe), TOBN(0x065ecce6, 0xd75e25a4)}, + {TOBN(0x6c2294ce, 0x69f79071), TOBN(0x0d9a8e5f, 0x044b8666), + TOBN(0x5009f238, 0x17b69d8f), TOBN(0x3c29f8fe, 0xc5dfdaf7)}}, + {{TOBN(0x9067528f, 0xebae68c4), TOBN(0x5b385632, 0x30c5ba21), + TOBN(0x540df119, 0x1fdd1aec), TOBN(0xcf37825b, 0xcfba4c78)}, + {TOBN(0x77eff980, 0xbeb11454), TOBN(0x40a1a991, 0x60c1b066), + TOBN(0xe8018980, 0xf889a1c7), TOBN(0xb9c52ae9, 0x76c24be0)}}, + {{TOBN(0x05fbbcce, 0x45650ef4), TOBN(0xae000f10, 0x8aa29ac7), + TOBN(0x884b7172, 0x4f04c470), TOBN(0x7cd4fde2, 0x19bb5c25)}, + {TOBN(0x6477b22a, 0xe8840869), TOBN(0xa8868859, 0x5fbd0686), + TOBN(0xf23cc02e, 0x1116dfba), TOBN(0x76cd563f, 0xd87d7776)}}, + {{TOBN(0xe2a37598, 0xa9d82abf), TOBN(0x5f188ccb, 0xe6c170f5), + TOBN(0x81682200, 0x5066b087), TOBN(0xda22c212, 0xc7155ada)}, + {TOBN(0x151e5d3a, 0xfbddb479), TOBN(0x4b606b84, 0x6d715b99), + TOBN(0x4a73b54b, 0xf997cb2e), TOBN(0x9a1bfe43, 0x3ecd8b66)}}, + {{TOBN(0x1c312809, 0x2a67d48a), TOBN(0xcd6a671e, 0x031fa9e2), + TOBN(0xbec3312a, 0x0e43a34a), TOBN(0x1d935639, 0x55ef47d3)}, + {TOBN(0x5ea02489, 0x8fea73ea), TOBN(0x8247b364, 0xa035afb2), + TOBN(0xb58300a6, 0x5265b54c), TOBN(0x3286662f, 0x722c7148)}}, + {{TOBN(0xb77fd76b, 0xb4ec4c20), TOBN(0xf0a12fa7, 0x0f3fe3fd), + TOBN(0xf845bbf5, 0x41d8c7e8), TOBN(0xe4d969ca, 0x5ec10aa8)}, + {TOBN(0x4c0053b7, 0x43e232a3), TOBN(0xdc7a3fac, 0x37f8a45a), + TOBN(0x3c4261c5, 0x20d81c8f), TOBN(0xfd4b3453, 0xb00eab00)}}, + {{TOBN(0x76d48f86, 0xd36e3062), TOBN(0x626c5277, 0xa143ff02), + TOBN(0x538174de, 0xaf76f42e), TOBN(0x2267aa86, 0x6407ceac)}, + {TOBN(0xfad76351, 0x72e572d5), TOBN(0xab861af7, 0xba7330eb), + TOBN(0xa0a1c8c7, 0x418d8657), TOBN(0x988821cb, 0x20289a52)}}, + {{TOBN(0x79732522, 0xcccc18ad), TOBN(0xaadf3f8d, 0xf1a6e027), + TOBN(0xf7382c93, 0x17c2354d), TOBN(0x5ce1680c, 0xd818b689)}, + {TOBN(0x359ebbfc, 0xd9ecbee9), TOBN(0x4330689c, 0x1cae62ac), + TOBN(0xb55ce5b4, 0xc51ac38a), TOBN(0x7921dfea, 0xfe238ee8)}}, + {{TOBN(0x3972bef8, 0x271d1ca5), TOBN(0x3e423bc7, 0xe8aabd18), + TOBN(0x57b09f3f, 0x44a3e5e3), TOBN(0x5da886ae, 0x7b444d66)}, + {TOBN(0x68206634, 0xa9964375), TOBN(0x356a2fa3, 0x699cd0ff), + TOBN(0xaf0faa24, 0xdba515e9), TOBN(0x536e1f5c, 0xb321d79a)}}, + {{TOBN(0xd3b9913a, 0x5c04e4ea), TOBN(0xd549dcfe, 0xd6f11513), + TOBN(0xee227bf5, 0x79fd1d94), TOBN(0x9f35afee, 0xb43f2c67)}, + {TOBN(0xd2638d24, 0xf1314f53), TOBN(0x62baf948, 0xcabcd822), + TOBN(0x5542de29, 0x4ef48db0), TOBN(0xb3eb6a04, 0xfc5f6bb2)}}, + {{TOBN(0x23c110ae, 0x1208e16a), TOBN(0x1a4d15b5, 0xf8363e24), + TOBN(0x30716844, 0x164be00b), TOBN(0xa8e24824, 0xf6f4690d)}, + {TOBN(0x548773a2, 0x90b170cf), TOBN(0xa1bef331, 0x42f191f4), + TOBN(0x70f418d0, 0x9247aa97), TOBN(0xea06028e, 0x48be9147)}}, + {{TOBN(0xe13122f3, 0xdbfb894e), TOBN(0xbe9b79f6, 0xce274b18), + TOBN(0x85a49de5, 0xca58aadf), TOBN(0x24957758, 0x11487351)}, + {TOBN(0x111def61, 0xbb939099), TOBN(0x1d6a974a, 0x26d13694), + TOBN(0x4474b4ce, 0xd3fc253b), TOBN(0x3a1485e6, 0x4c5db15e)}}, + {{TOBN(0xe79667b4, 0x147c15b4), TOBN(0xe34f553b, 0x7bc61301), + TOBN(0x032b80f8, 0x17094381), TOBN(0x55d8bafd, 0x723eaa21)}, + {TOBN(0x5a987995, 0xf1c0e74e), TOBN(0x5a9b292e, 0xebba289c), + TOBN(0x413cd4b2, 0xeb4c8251), TOBN(0x98b5d243, 0xd162db0a)}}, + {{TOBN(0xbb47bf66, 0x68342520), TOBN(0x08d68949, 0xbaa862d1), + TOBN(0x11f349c7, 0xe906abcd), TOBN(0x454ce985, 0xed7bf00e)}, + {TOBN(0xacab5c9e, 0xb55b803b), TOBN(0xb03468ea, 0x31e3c16d), + TOBN(0x5c24213d, 0xd273bf12), TOBN(0x211538eb, 0x71587887)}}, + {{TOBN(0x198e4a2f, 0x731dea2d), TOBN(0xd5856cf2, 0x74ed7b2a), + TOBN(0x86a632eb, 0x13a664fe), TOBN(0x932cd909, 0xbda41291)}, + {TOBN(0x850e95d4, 0xc0c4ddc0), TOBN(0xc0f422f8, 0x347fc2c9), + TOBN(0xe68cbec4, 0x86076bcb), TOBN(0xf9e7c0c0, 0xcd6cd286)}}, + {{TOBN(0x65994ddb, 0x0f5f27ca), TOBN(0xe85461fb, 0xa80d59ff), + TOBN(0xff05481a, 0x66601023), TOBN(0xc665427a, 0xfc9ebbfb)}, + {TOBN(0xb0571a69, 0x7587fd52), TOBN(0x935289f8, 0x8d49efce), + TOBN(0x61becc60, 0xea420688), TOBN(0xb22639d9, 0x13a786af)}}, + {{TOBN(0x1a8e6220, 0x361ecf90), TOBN(0x001f23e0, 0x25506463), + TOBN(0xe4ae9b5d, 0x0a5c2b79), TOBN(0xebc9cdad, 0xd8149db5)}, + {TOBN(0xb33164a1, 0x934aa728), TOBN(0x750eb00e, 0xae9b60f3), + TOBN(0x5a91615b, 0x9b9cfbfd), TOBN(0x97015cbf, 0xef45f7f6)}}, + {{TOBN(0xb462c4a5, 0xbf5151df), TOBN(0x21adcc41, 0xb07118f2), + TOBN(0xd60c545b, 0x043fa42c), TOBN(0xfc21aa54, 0xe96be1ab)}, + {TOBN(0xe84bc32f, 0x4e51ea80), TOBN(0x3dae45f0, 0x259b5d8d), + TOBN(0xbb73c7eb, 0xc38f1b5e), TOBN(0xe405a74a, 0xe8ae617d)}}, + {{TOBN(0xbb1ae9c6, 0x9f1c56bd), TOBN(0x8c176b98, 0x49f196a4), + TOBN(0xc448f311, 0x6875092b), TOBN(0xb5afe3de, 0x9f976033)}, + {TOBN(0xa8dafd49, 0x145813e5), TOBN(0x687fc4d9, 0xe2b34226), + TOBN(0xf2dfc92d, 0x4c7ff57f), TOBN(0x004e3fc1, 0x401f1b46)}}, + {{TOBN(0x5afddab6, 0x1430c9ab), TOBN(0x0bdd41d3, 0x2238e997), + TOBN(0xf0947430, 0x418042ae), TOBN(0x71f9adda, 0xcdddc4cb)}, + {TOBN(0x7090c016, 0xc52dd907), TOBN(0xd9bdf44d, 0x29e2047f), + TOBN(0xe6f1fe80, 0x1b1011a6), TOBN(0xb63accbc, 0xd9acdc78)}}, + {{TOBN(0xcfc7e235, 0x1272a95b), TOBN(0x0c667717, 0xa6276ac8), + TOBN(0x3c0d3709, 0xe2d7eef7), TOBN(0x5add2b06, 0x9a685b3e)}, + {TOBN(0x363ad32d, 0x14ea5d65), TOBN(0xf8e01f06, 0x8d7dd506), + TOBN(0xc9ea2213, 0x75b4aac6), TOBN(0xed2a2bf9, 0x0d353466)}}, + {{TOBN(0x439d79b5, 0xe9d3a7c3), TOBN(0x8e0ee5a6, 0x81b7f34b), + TOBN(0xcf3dacf5, 0x1dc4ba75), TOBN(0x1d3d1773, 0xeb3310c7)}, + {TOBN(0xa8e67112, 0x7747ae83), TOBN(0x31f43160, 0x197d6b40), + TOBN(0x0521ccee, 0xcd961400), TOBN(0x67246f11, 0xf6535768)}}, + {{TOBN(0x702fcc5a, 0xef0c3133), TOBN(0x247cc45d, 0x7e16693b), + TOBN(0xfd484e49, 0xc729b749), TOBN(0x522cef7d, 0xb218320f)}, + {TOBN(0xe56ef405, 0x59ab93b3), TOBN(0x225fba11, 0x9f181071), + TOBN(0x33bd6595, 0x15330ed0), TOBN(0xc4be69d5, 0x1ddb32f7)}}, + {{TOBN(0x264c7668, 0x0448087c), TOBN(0xac30903f, 0x71432dae), + TOBN(0x3851b266, 0x00f9bf47), TOBN(0x400ed311, 0x6cdd6d03)}, + {TOBN(0x045e79fe, 0xf8fd2424), TOBN(0xfdfd974a, 0xfa6da98b), + TOBN(0x45c9f641, 0x0c1e673a), TOBN(0x76f2e733, 0x5b2c5168)}}, + {{TOBN(0x1adaebb5, 0x2a601753), TOBN(0xb286514c, 0xc57c2d49), + TOBN(0xd8769670, 0x1e0bfd24), TOBN(0x950c547e, 0x04478922)}, + {TOBN(0xd1d41969, 0xe5d32bfe), TOBN(0x30bc1472, 0x750d6c3e), + TOBN(0x8f3679fe, 0xe0e27f3a), TOBN(0x8f64a7dc, 0xa4a6ee0c)}}, + {{TOBN(0x2fe59937, 0x633dfb1f), TOBN(0xea82c395, 0x977f2547), + TOBN(0xcbdfdf1a, 0x661ea646), TOBN(0xc7ccc591, 0xb9085451)}, + {TOBN(0x82177962, 0x81761e13), TOBN(0xda57596f, 0x9196885c), + TOBN(0xbc17e849, 0x28ffbd70), TOBN(0x1e6e0a41, 0x2671d36f)}}, + {{TOBN(0x61ae872c, 0x4152fcf5), TOBN(0x441c87b0, 0x9e77e754), + TOBN(0xd0799dd5, 0xa34dff09), TOBN(0x766b4e44, 0x88a6b171)}, + {TOBN(0xdc06a512, 0x11f1c792), TOBN(0xea02ae93, 0x4be35c3e), + TOBN(0xe5ca4d6d, 0xe90c469e), TOBN(0x4df4368e, 0x56e4ff5c)}}, + {{TOBN(0x7817acab, 0x4baef62e), TOBN(0x9f5a2202, 0xa85b91e8), + TOBN(0x9666ebe6, 0x6ce57610), TOBN(0x32ad31f3, 0xf73bfe03)}, + {TOBN(0x628330a4, 0x25bcf4d6), TOBN(0xea950593, 0x515056e6), + TOBN(0x59811c89, 0xe1332156), TOBN(0xc89cf1fe, 0x8c11b2d7)}}, + {{TOBN(0x75b63913, 0x04e60cc0), TOBN(0xce811e8d, 0x4625d375), + TOBN(0x030e43fc, 0x2d26e562), TOBN(0xfbb30b4b, 0x608d36a0)}, + {TOBN(0x634ff82c, 0x48528118), TOBN(0x7c6fe085, 0xcd285911), + TOBN(0x7f2830c0, 0x99358f28), TOBN(0x2e60a95e, 0x665e6c09)}}, + {{TOBN(0x08407d3d, 0x9b785dbf), TOBN(0x530889ab, 0xa759bce7), + TOBN(0xf228e0e6, 0x52f61239), TOBN(0x2b6d1461, 0x6879be3c)}, + {TOBN(0xe6902c04, 0x51a7bbf7), TOBN(0x30ad99f0, 0x76f24a64), + TOBN(0x66d9317a, 0x98bc6da0), TOBN(0xf4f877f3, 0xcb596ac0)}}, + {{TOBN(0xb05ff62d, 0x4c44f119), TOBN(0x4555f536, 0xe9b77416), + TOBN(0xc7c0d059, 0x8caed63b), TOBN(0x0cd2b7ce, 0xc358b2a9)}, + {TOBN(0x3f33287b, 0x46945fa3), TOBN(0xf8785b20, 0xd67c8791), + TOBN(0xc54a7a61, 0x9637bd08), TOBN(0x54d4598c, 0x18be79d7)}}, + {{TOBN(0x889e5acb, 0xc46d7ce1), TOBN(0x9a515bb7, 0x8b085877), + TOBN(0xfac1a03d, 0x0b7a5050), TOBN(0x7d3e738a, 0xf2926035)}, + {TOBN(0x861cc2ce, 0x2a6cb0eb), TOBN(0x6f2e2955, 0x8f7adc79), + TOBN(0x61c4d451, 0x33016376), TOBN(0xd9fd2c80, 0x5ad59090)}}, + {{TOBN(0xe5a83738, 0xb2b836a1), TOBN(0x855b41a0, 0x7c0d6622), + TOBN(0x186fe317, 0x7cc19af1), TOBN(0x6465c1ff, 0xfdd99acb)}, + {TOBN(0x46e5c23f, 0x6974b99e), TOBN(0x75a7cf8b, 0xa2717cbe), + TOBN(0x4d2ebc3f, 0x062be658), TOBN(0x094b4447, 0x5f209c98)}}, + {{TOBN(0x4af285ed, 0xb940cb5a), TOBN(0x6706d792, 0x7cc82f10), + TOBN(0xc8c8776c, 0x030526fa), TOBN(0xfa8e6f76, 0xa0da9140)}, + {TOBN(0x77ea9d34, 0x591ee4f0), TOBN(0x5f46e337, 0x40274166), + TOBN(0x1bdf98bb, 0xea671457), TOBN(0xd7c08b46, 0x862a1fe2)}}, + {{TOBN(0x46cc303c, 0x1c08ad63), TOBN(0x99543440, 0x4c845e7b), + TOBN(0x1b8fbdb5, 0x48f36bf7), TOBN(0x5b82c392, 0x8c8273a7)}, + {TOBN(0x08f712c4, 0x928435d5), TOBN(0x071cf0f1, 0x79330380), + TOBN(0xc74c2d24, 0xa8da054a), TOBN(0xcb0e7201, 0x43c46b5c)}}, + {{TOBN(0x0ad7337a, 0xc0b7eff3), TOBN(0x8552225e, 0xc5e48b3c), + TOBN(0xe6f78b0c, 0x73f13a5f), TOBN(0x5e70062e, 0x82349cbe)}, + {TOBN(0x6b8d5048, 0xe7073969), TOBN(0x392d2a29, 0xc33cb3d2), + TOBN(0xee4f727c, 0x4ecaa20f), TOBN(0xa068c99e, 0x2ccde707)}}, + {{TOBN(0xfcd5651f, 0xb87a2913), TOBN(0xea3e3c15, 0x3cc252f0), + TOBN(0x777d92df, 0x3b6cd3e4), TOBN(0x7a414143, 0xc5a732e7)}, + {TOBN(0xa895951a, 0xa71ff493), TOBN(0xfe980c92, 0xbbd37cf6), + TOBN(0x45bd5e64, 0xdecfeeff), TOBN(0x910dc2a9, 0xa44c43e9)}}, + {{TOBN(0xcb403f26, 0xcca9f54d), TOBN(0x928bbdfb, 0x9303f6db), + TOBN(0x3c37951e, 0xa9eee67c), TOBN(0x3bd61a52, 0xf79961c3)}, + {TOBN(0x09a238e6, 0x395c9a79), TOBN(0x6940ca2d, 0x61eb352d), + TOBN(0x7d1e5c5e, 0xc1875631), TOBN(0x1e19742c, 0x1e1b20d1)}}, + {{TOBN(0x4633d908, 0x23fc2e6e), TOBN(0xa76e29a9, 0x08959149), + TOBN(0x61069d9c, 0x84ed7da5), TOBN(0x0baa11cf, 0x5dbcad51)}, + {TOBN(0xd01eec64, 0x961849da), TOBN(0x93b75f1f, 0xaf3d8c28), + TOBN(0x57bc4f9f, 0x1ca2ee44), TOBN(0x5a26322d, 0x00e00558)}}, + {{TOBN(0x1888d658, 0x61a023ef), TOBN(0x1d72aab4, 0xb9e5246e), + TOBN(0xa9a26348, 0xe5563ec0), TOBN(0xa0971963, 0xc3439a43)}, + {TOBN(0x567dd54b, 0xadb9b5b7), TOBN(0x73fac1a1, 0xc45a524b), + TOBN(0x8fe97ef7, 0xfe38e608), TOBN(0x608748d2, 0x3f384f48)}}, + {{TOBN(0xb0571794, 0xc486094f), TOBN(0x869254a3, 0x8bf3a8d6), + TOBN(0x148a8dd1, 0x310b0e25), TOBN(0x99ab9f3f, 0x9aa3f7d8)}, + {TOBN(0x0927c68a, 0x6706c02e), TOBN(0x22b5e76c, 0x69790e6c), + TOBN(0x6c325260, 0x6c71376c), TOBN(0x53a57690, 0x09ef6657)}}, + {{TOBN(0x8d63f852, 0xedffcf3a), TOBN(0xb4d2ed04, 0x3c0a6f55), + TOBN(0xdb3aa8de, 0x12519b9e), TOBN(0x5d38e9c4, 0x1e0a569a)}, + {TOBN(0x871528bf, 0x303747e2), TOBN(0xa208e77c, 0xf5b5c18d), + TOBN(0x9d129c88, 0xca6bf923), TOBN(0xbcbf197f, 0xbf02839f)}}, + {{TOBN(0x9b9bf030, 0x27323194), TOBN(0x3b055a8b, 0x339ca59d), + TOBN(0xb46b2312, 0x0f669520), TOBN(0x19789f1f, 0x497e5f24)}, + {TOBN(0x9c499468, 0xaaf01801), TOBN(0x72ee1190, 0x8b69d59c), + TOBN(0x8bd39595, 0xacf4c079), TOBN(0x3ee11ece, 0x8e0cd048)}}, + {{TOBN(0xebde86ec, 0x1ed66f18), TOBN(0x225d906b, 0xd61fce43), + TOBN(0x5cab07d6, 0xe8bed74d), TOBN(0x16e4617f, 0x27855ab7)}, + {TOBN(0x6568aadd, 0xb2fbc3dd), TOBN(0xedb5484f, 0x8aeddf5b), + TOBN(0x878f20e8, 0x6dcf2fad), TOBN(0x3516497c, 0x615f5699)}}}, + {{{TOBN(0xef0a3fec, 0xfa181e69), TOBN(0x9ea02f81, 0x30d69a98), + TOBN(0xb2e9cf8e, 0x66eab95d), TOBN(0x520f2beb, 0x24720021)}, + {TOBN(0x621c540a, 0x1df84361), TOBN(0x12037721, 0x71fa6d5d), + TOBN(0x6e3c7b51, 0x0ff5f6ff), TOBN(0x817a069b, 0xabb2bef3)}}, + {{TOBN(0x83572fb6, 0xb294cda6), TOBN(0x6ce9bf75, 0xb9039f34), + TOBN(0x20e012f0, 0x095cbb21), TOBN(0xa0aecc1b, 0xd063f0da)}, + {TOBN(0x57c21c3a, 0xf02909e5), TOBN(0xc7d59ecf, 0x48ce9cdc), + TOBN(0x2732b844, 0x8ae336f8), TOBN(0x056e3723, 0x3f4f85f4)}}, + {{TOBN(0x8a10b531, 0x89e800ca), TOBN(0x50fe0c17, 0x145208fd), + TOBN(0x9e43c0d3, 0xb714ba37), TOBN(0x427d200e, 0x34189acc)}, + {TOBN(0x05dee24f, 0xe616e2c0), TOBN(0x9c25f4c8, 0xee1854c1), + TOBN(0x4d3222a5, 0x8f342a73), TOBN(0x0807804f, 0xa027c952)}}, + {{TOBN(0xc222653a, 0x4f0d56f3), TOBN(0x961e4047, 0xca28b805), + TOBN(0x2c03f8b0, 0x4a73434b), TOBN(0x4c966787, 0xab712a19)}, + {TOBN(0xcc196c42, 0x864fee42), TOBN(0xc1be93da, 0x5b0ece5c), + TOBN(0xa87d9f22, 0xc131c159), TOBN(0x2bb6d593, 0xdce45655)}}, + {{TOBN(0x22c49ec9, 0xb809b7ce), TOBN(0x8a41486b, 0xe2c72c2c), + TOBN(0x813b9420, 0xfea0bf36), TOBN(0xb3d36ee9, 0xa66dac69)}, + {TOBN(0x6fddc08a, 0x328cc987), TOBN(0x0a3bcd2c, 0x3a326461), + TOBN(0x7103c49d, 0xd810dbba), TOBN(0xf9d81a28, 0x4b78a4c4)}}, + {{TOBN(0x3de865ad, 0xe4d55941), TOBN(0xdedafa5e, 0x30384087), + TOBN(0x6f414abb, 0x4ef18b9b), TOBN(0x9ee9ea42, 0xfaee5268)}, + {TOBN(0x260faa16, 0x37a55a4a), TOBN(0xeb19a514, 0x015f93b9), + TOBN(0x51d7ebd2, 0x9e9c3598), TOBN(0x523fc56d, 0x1932178e)}}, + {{TOBN(0x501d070c, 0xb98fe684), TOBN(0xd60fbe9a, 0x124a1458), + TOBN(0xa45761c8, 0x92bc6b3f), TOBN(0xf5384858, 0xfe6f27cb)}, + {TOBN(0x4b0271f7, 0xb59e763b), TOBN(0x3d4606a9, 0x5b5a8e5e), + TOBN(0x1eda5d9b, 0x05a48292), TOBN(0xda7731d0, 0xe6fec446)}}, + {{TOBN(0xa3e33693, 0x90d45871), TOBN(0xe9764040, 0x06166d8d), + TOBN(0xb5c33682, 0x89a90403), TOBN(0x4bd17983, 0x72f1d637)}, + {TOBN(0xa616679e, 0xd5d2c53a), TOBN(0x5ec4bcd8, 0xfdcf3b87), + TOBN(0xae6d7613, 0xb66a694e), TOBN(0x7460fc76, 0xe3fc27e5)}}, + {{TOBN(0x70469b82, 0x95caabee), TOBN(0xde024ca5, 0x889501e3), + TOBN(0x6bdadc06, 0x076ed265), TOBN(0x0cb1236b, 0x5a0ef8b2)}, + {TOBN(0x4065ddbf, 0x0972ebf9), TOBN(0xf1dd3875, 0x22aca432), + TOBN(0xa88b97cf, 0x744aff76), TOBN(0xd1359afd, 0xfe8e3d24)}}, + {{TOBN(0x52a3ba2b, 0x91502cf3), TOBN(0x2c3832a8, 0x084db75d), + TOBN(0x04a12ddd, 0xde30b1c9), TOBN(0x7802eabc, 0xe31fd60c)}, + {TOBN(0x33707327, 0xa37fddab), TOBN(0x65d6f2ab, 0xfaafa973), + TOBN(0x3525c5b8, 0x11e6f91a), TOBN(0x76aeb0c9, 0x5f46530b)}}, + {{TOBN(0xe8815ff6, 0x2f93a675), TOBN(0xa6ec9684, 0x05f48679), + TOBN(0x6dcbb556, 0x358ae884), TOBN(0x0af61472, 0xe19e3873)}, + {TOBN(0x72334372, 0xa5f696be), TOBN(0xc65e57ea, 0x6f22fb70), + TOBN(0x268da30c, 0x946cea90), TOBN(0x136a8a87, 0x65681b2a)}}, + {{TOBN(0xad5e81dc, 0x0f9f44d4), TOBN(0xf09a6960, 0x2c46585a), + TOBN(0xd1649164, 0xc447d1b1), TOBN(0x3b4b36c8, 0x879dc8b1)}, + {TOBN(0x20d4177b, 0x3b6b234c), TOBN(0x096a2505, 0x1730d9d0), + TOBN(0x0611b9b8, 0xef80531d), TOBN(0xba904b3b, 0x64bb495d)}}, + {{TOBN(0x1192d9d4, 0x93a3147a), TOBN(0x9f30a5dc, 0x9a565545), + TOBN(0x90b1f9cb, 0x6ef07212), TOBN(0x29958546, 0x0d87fc13)}, + {TOBN(0xd3323eff, 0xc17db9ba), TOBN(0xcb18548c, 0xcb1644a8), + TOBN(0x18a306d4, 0x4f49ffbc), TOBN(0x28d658f1, 0x4c2e8684)}}, + {{TOBN(0x44ba60cd, 0xa99f8c71), TOBN(0x67b7abdb, 0x4bf742ff), + TOBN(0x66310f9c, 0x914b3f99), TOBN(0xae430a32, 0xf412c161)}, + {TOBN(0x1e6776d3, 0x88ace52f), TOBN(0x4bc0fa24, 0x52d7067d), + TOBN(0x03c286aa, 0x8f07cd1b), TOBN(0x4cb8f38c, 0xa985b2c1)}}, + {{TOBN(0x83ccbe80, 0x8c3bff36), TOBN(0x005a0bd2, 0x5263e575), + TOBN(0x460d7dda, 0x259bdcd1), TOBN(0x4a1c5642, 0xfa5cab6b)}, + {TOBN(0x2b7bdbb9, 0x9fe4fc88), TOBN(0x09418e28, 0xcc97bbb5), + TOBN(0xd8274fb4, 0xa12321ae), TOBN(0xb137007d, 0x5c87b64e)}}, + {{TOBN(0x80531fe1, 0xc63c4962), TOBN(0x50541e89, 0x981fdb25), + TOBN(0xdc1291a1, 0xfd4c2b6b), TOBN(0xc0693a17, 0xa6df4fca)}, + {TOBN(0xb2c4604e, 0x0117f203), TOBN(0x245f1963, 0x0a99b8d0), + TOBN(0xaedc20aa, 0xc6212c44), TOBN(0xb1ed4e56, 0x520f52a8)}}, + {{TOBN(0xfe48f575, 0xf8547be3), TOBN(0x0a7033cd, 0xa9e45f98), + TOBN(0x4b45d3a9, 0x18c50100), TOBN(0xb2a6cd6a, 0xa61d41da)}, + {TOBN(0x60bbb4f5, 0x57933c6b), TOBN(0xa7538ebd, 0x2b0d7ffc), + TOBN(0x9ea3ab8d, 0x8cd626b6), TOBN(0x8273a484, 0x3601625a)}}, + {{TOBN(0x88859845, 0x0168e508), TOBN(0x8cbc9bb2, 0x99a94abd), + TOBN(0x713ac792, 0xfab0a671), TOBN(0xa3995b19, 0x6c9ebffc)}, + {TOBN(0xe711668e, 0x1239e152), TOBN(0x56892558, 0xbbb8dff4), + TOBN(0x8bfc7dab, 0xdbf17963), TOBN(0x5b59fe5a, 0xb3de1253)}}, + {{TOBN(0x7e3320eb, 0x34a9f7ae), TOBN(0xe5e8cf72, 0xd751efe4), + TOBN(0x7ea003bc, 0xd9be2f37), TOBN(0xc0f551a0, 0xb6c08ef7)}, + {TOBN(0x56606268, 0x038f6725), TOBN(0x1dd38e35, 0x6d92d3b6), + TOBN(0x07dfce7c, 0xc3cbd686), TOBN(0x4e549e04, 0x651c5da8)}}, + {{TOBN(0x4058f93b, 0x08b19340), TOBN(0xc2fae6f4, 0xcac6d89d), + TOBN(0x4bad8a8c, 0x8f159cc7), TOBN(0x0ddba4b3, 0xcb0b601c)}, + {TOBN(0xda4fc7b5, 0x1dd95f8c), TOBN(0x1d163cd7, 0xcea5c255), + TOBN(0x30707d06, 0x274a8c4c), TOBN(0x79d9e008, 0x2802e9ce)}}, + {{TOBN(0x02a29ebf, 0xe6ddd505), TOBN(0x37064e74, 0xb50bed1a), + TOBN(0x3f6bae65, 0xa7327d57), TOBN(0x3846f5f1, 0xf83920bc)}, + {TOBN(0x87c37491, 0x60df1b9b), TOBN(0x4cfb2895, 0x2d1da29f), + TOBN(0x10a478ca, 0x4ed1743c), TOBN(0x390c6030, 0x3edd47c6)}}, + {{TOBN(0x8f3e5312, 0x8c0a78de), TOBN(0xccd02bda, 0x1e85df70), + TOBN(0xd6c75c03, 0xa61b6582), TOBN(0x0762921c, 0xfc0eebd1)}, + {TOBN(0xd34d0823, 0xd85010c0), TOBN(0xd73aaacb, 0x0044cf1f), + TOBN(0xfb4159bb, 0xa3b5e78a), TOBN(0x2287c7f7, 0xe5826f3f)}}, + {{TOBN(0x4aeaf742, 0x580b1a01), TOBN(0xf080415d, 0x60423b79), + TOBN(0xe12622cd, 0xa7dea144), TOBN(0x49ea4996, 0x59d62472)}, + {TOBN(0xb42991ef, 0x571f3913), TOBN(0x0610f214, 0xf5b25a8a), + TOBN(0x47adc585, 0x30b79e8f), TOBN(0xf90e3df6, 0x07a065a2)}}, + {{TOBN(0x5d0a5deb, 0x43e2e034), TOBN(0x53fb5a34, 0x444024aa), + TOBN(0xa8628c68, 0x6b0c9f7f), TOBN(0x9c69c29c, 0xac563656)}, + {TOBN(0x5a231feb, 0xbace47b6), TOBN(0xbdce0289, 0x9ea5a2ec), + TOBN(0x05da1fac, 0x9463853e), TOBN(0x96812c52, 0x509e78aa)}}, + {{TOBN(0xd3fb5771, 0x57151692), TOBN(0xeb2721f8, 0xd98e1c44), + TOBN(0xc0506087, 0x32399be1), TOBN(0xda5a5511, 0xd979d8b8)}, + {TOBN(0x737ed55d, 0xc6f56780), TOBN(0xe20d3004, 0x0dc7a7f4), + TOBN(0x02ce7301, 0xf5941a03), TOBN(0x91ef5215, 0xed30f83a)}}, + {{TOBN(0x28727fc1, 0x4092d85f), TOBN(0x72d223c6, 0x5c49e41a), + TOBN(0xa7cf30a2, 0xba6a4d81), TOBN(0x7c086209, 0xb030d87d)}, + {TOBN(0x04844c7d, 0xfc588b09), TOBN(0x728cd499, 0x5874bbb0), + TOBN(0xcc1281ee, 0xe84c0495), TOBN(0x0769b5ba, 0xec31958f)}}, + {{TOBN(0x665c228b, 0xf99c2471), TOBN(0xf2d8a11b, 0x191eb110), + TOBN(0x4594f494, 0xd36d7024), TOBN(0x482ded8b, 0xcdcb25a1)}, + {TOBN(0xc958a9d8, 0xdadd4885), TOBN(0x7004477e, 0xf1d2b547), + TOBN(0x0a45f6ef, 0x2a0af550), TOBN(0x4fc739d6, 0x2f8d6351)}}, + {{TOBN(0x75cdaf27, 0x786f08a9), TOBN(0x8700bb26, 0x42c2737f), + TOBN(0x855a7141, 0x1c4e2670), TOBN(0x810188c1, 0x15076fef)}, + {TOBN(0xc251d0c9, 0xabcd3297), TOBN(0xae4c8967, 0xf48108eb), + TOBN(0xbd146de7, 0x18ceed30), TOBN(0xf9d4f07a, 0xc986bced)}}, + {{TOBN(0x5ad98ed5, 0x83fa1e08), TOBN(0x7780d33e, 0xbeabd1fb), + TOBN(0xe330513c, 0x903b1196), TOBN(0xba11de9e, 0xa47bc8c4)}, + {TOBN(0x684334da, 0x02c2d064), TOBN(0x7ecf360d, 0xa48de23b), + TOBN(0x57a1b474, 0x0a9089d8), TOBN(0xf28fa439, 0xff36734c)}}, + {{TOBN(0xf2a482cb, 0xea4570b3), TOBN(0xee65d68b, 0xa5ebcee9), + TOBN(0x988d0036, 0xb9694cd5), TOBN(0x53edd0e9, 0x37885d32)}, + {TOBN(0xe37e3307, 0xbeb9bc6d), TOBN(0xe9abb907, 0x9f5c6768), + TOBN(0x4396ccd5, 0x51f2160f), TOBN(0x2500888c, 0x47336da6)}}, + {{TOBN(0x383f9ed9, 0x926fce43), TOBN(0x809dd1c7, 0x04da2930), + TOBN(0x30f6f596, 0x8a4cb227), TOBN(0x0d700c7f, 0x73a56b38)}, + {TOBN(0x1825ea33, 0xab64a065), TOBN(0xaab9b735, 0x1338df80), + TOBN(0x1516100d, 0x9b63f57f), TOBN(0x2574395a, 0x27a6a634)}}, + {{TOBN(0xb5560fb6, 0x700a1acd), TOBN(0xe823fd73, 0xfd999681), + TOBN(0xda915d1f, 0x6cb4e1ba), TOBN(0x0d030118, 0x6ebe00a3)}, + {TOBN(0x744fb0c9, 0x89fca8cd), TOBN(0x970d01db, 0xf9da0e0b), + TOBN(0x0ad8c564, 0x7931d76f), TOBN(0xb15737bf, 0xf659b96a)}}, + {{TOBN(0xdc9933e8, 0xa8b484e7), TOBN(0xb2fdbdf9, 0x7a26dec7), + TOBN(0x2349e9a4, 0x9f1f0136), TOBN(0x7860368e, 0x70fddddb)}, + {TOBN(0xd93d2c1c, 0xf9ad3e18), TOBN(0x6d6c5f17, 0x689f4e79), + TOBN(0x7a544d91, 0xb24ff1b6), TOBN(0x3e12a5eb, 0xfe16cd8c)}}, + {{TOBN(0x543574e9, 0xa56b872f), TOBN(0xa1ad550c, 0xfcf68ea2), + TOBN(0x689e37d2, 0x3f560ef7), TOBN(0x8c54b9ca, 0xc9d47a8b)}, + {TOBN(0x46d40a4a, 0x088ac342), TOBN(0xec450c7c, 0x1576c6d0), + TOBN(0xb589e31c, 0x1f9689e9), TOBN(0xdacf2602, 0xb8781718)}}, + {{TOBN(0xa89237c6, 0xc8cb6b42), TOBN(0x1326fc93, 0xb96ef381), + TOBN(0x55d56c6d, 0xb5f07825), TOBN(0xacba2eea, 0x7449e22d)}, + {TOBN(0x74e0887a, 0x633c3000), TOBN(0xcb6cd172, 0xd7cbcf71), + TOBN(0x309e81de, 0xc36cf1be), TOBN(0x07a18a6d, 0x60ae399b)}}, + {{TOBN(0xb36c2679, 0x9edce57e), TOBN(0x52b892f4, 0xdf001d41), + TOBN(0xd884ae5d, 0x16a1f2c6), TOBN(0x9b329424, 0xefcc370a)}, + {TOBN(0x3120daf2, 0xbd2e21df), TOBN(0x55298d2d, 0x02470a99), + TOBN(0x0b78af6c, 0xa05db32e), TOBN(0x5c76a331, 0x601f5636)}}, + {{TOBN(0xaae861ff, 0xf8a4f29c), TOBN(0x70dc9240, 0xd68f8d49), + TOBN(0x960e649f, 0x81b1321c), TOBN(0x3d2c801b, 0x8792e4ce)}, + {TOBN(0xf479f772, 0x42521876), TOBN(0x0bed93bc, 0x416c79b1), + TOBN(0xa67fbc05, 0x263e5bc9), TOBN(0x01e8e630, 0x521db049)}}, + {{TOBN(0x76f26738, 0xc6f3431e), TOBN(0xe609cb02, 0xe3267541), + TOBN(0xb10cff2d, 0x818c877c), TOBN(0x1f0e75ce, 0x786a13cb)}, + {TOBN(0xf4fdca64, 0x1158544d), TOBN(0x5d777e89, 0x6cb71ed0), + TOBN(0x3c233737, 0xa9aa4755), TOBN(0x7b453192, 0xe527ab40)}}, + {{TOBN(0xdb59f688, 0x39f05ffe), TOBN(0x8f4f4be0, 0x6d82574e), + TOBN(0xcce3450c, 0xee292d1b), TOBN(0xaa448a12, 0x61ccd086)}, + {TOBN(0xabce91b3, 0xf7914967), TOBN(0x4537f09b, 0x1908a5ed), + TOBN(0xa812421e, 0xf51042e7), TOBN(0xfaf5cebc, 0xec0b3a34)}}, + {{TOBN(0x730ffd87, 0x4ca6b39a), TOBN(0x70fb72ed, 0x02efd342), + TOBN(0xeb4735f9, 0xd75c8edb), TOBN(0xc11f2157, 0xc278aa51)}, + {TOBN(0xc459f635, 0xbf3bfebf), TOBN(0x3a1ff0b4, 0x6bd9601f), + TOBN(0xc9d12823, 0xc420cb73), TOBN(0x3e9af3e2, 0x3c2915a3)}}, + {{TOBN(0xe0c82c72, 0xb41c3440), TOBN(0x175239e5, 0xe3039a5f), + TOBN(0xe1084b8a, 0x558795a3), TOBN(0x328d0a1d, 0xd01e5c60)}, + {TOBN(0x0a495f2e, 0xd3788a04), TOBN(0x25d8ff16, 0x66c11a9f), + TOBN(0xf5155f05, 0x9ed692d6), TOBN(0x954fa107, 0x4f425fe4)}}, + {{TOBN(0xd16aabf2, 0xe98aaa99), TOBN(0x90cd8ba0, 0x96b0f88a), + TOBN(0x957f4782, 0xc154026a), TOBN(0x54ee0734, 0x52af56d2)}, + {TOBN(0xbcf89e54, 0x45b4147a), TOBN(0x3d102f21, 0x9a52816c), + TOBN(0x6808517e, 0x39b62e77), TOBN(0x92e25421, 0x69169ad8)}}, + {{TOBN(0xd721d871, 0xbb608558), TOBN(0x60e4ebae, 0xf6d4ff9b), + TOBN(0x0ba10819, 0x41f2763e), TOBN(0xca2e45be, 0x51ee3247)}, + {TOBN(0x66d172ec, 0x2bfd7a5f), TOBN(0x528a8f2f, 0x74d0b12d), + TOBN(0xe17f1e38, 0xdabe70dc), TOBN(0x1d5d7316, 0x9f93983c)}}, + {{TOBN(0x51b2184a, 0xdf423e31), TOBN(0xcb417291, 0xaedb1a10), + TOBN(0x2054ca93, 0x625bcab9), TOBN(0x54396860, 0xa98998f0)}, + {TOBN(0x4e53f6c4, 0xa54ae57e), TOBN(0x0ffeb590, 0xee648e9d), + TOBN(0xfbbdaadc, 0x6afaf6bc), TOBN(0xf88ae796, 0xaa3bfb8a)}}, + {{TOBN(0x209f1d44, 0xd2359ed9), TOBN(0xac68dd03, 0xf3544ce2), + TOBN(0xf378da47, 0xfd51e569), TOBN(0xe1abd860, 0x2cc80097)}, + {TOBN(0x23ca18d9, 0x343b6e3a), TOBN(0x480797e8, 0xb40a1bae), + TOBN(0xd1f0c717, 0x533f3e67), TOBN(0x44896970, 0x06e6cdfc)}}, + {{TOBN(0x8ca21055, 0x52a82e8d), TOBN(0xb2caf785, 0x78460cdc), + TOBN(0x4c1b7b62, 0xe9037178), TOBN(0xefc09d2c, 0xdb514b58)}, + {TOBN(0x5f2df9ee, 0x9113be5c), TOBN(0x2fbda78f, 0xb3f9271c), + TOBN(0xe09a81af, 0x8f83fc54), TOBN(0x06b13866, 0x8afb5141)}}, + {{TOBN(0x38f6480f, 0x43e3865d), TOBN(0x72dd77a8, 0x1ddf47d9), + TOBN(0xf2a8e971, 0x4c205ff7), TOBN(0x46d449d8, 0x9d088ad8)}, + {TOBN(0x926619ea, 0x185d706f), TOBN(0xe47e02eb, 0xc7dd7f62), + TOBN(0xe7f120a7, 0x8cbc2031), TOBN(0xc18bef00, 0x998d4ac9)}}, + {{TOBN(0x18f37a9c, 0x6bdf22da), TOBN(0xefbc432f, 0x90dc82df), + TOBN(0xc52cef8e, 0x5d703651), TOBN(0x82887ba0, 0xd99881a5)}, + {TOBN(0x7cec9dda, 0xb920ec1d), TOBN(0xd0d7e8c3, 0xec3e8d3b), + TOBN(0x445bc395, 0x4ca88747), TOBN(0xedeaa2e0, 0x9fd53535)}}, + {{TOBN(0x461b1d93, 0x6cc87475), TOBN(0xd92a52e2, 0x6d2383bd), + TOBN(0xfabccb59, 0xd7903546), TOBN(0x6111a761, 0x3d14b112)}, + {TOBN(0x0ae584fe, 0xb3d5f612), TOBN(0x5ea69b8d, 0x60e828ec), + TOBN(0x6c078985, 0x54087030), TOBN(0x649cab04, 0xac4821fe)}}, + {{TOBN(0x25ecedcf, 0x8bdce214), TOBN(0xb5622f72, 0x86af7361), + TOBN(0x0e1227aa, 0x7038b9e2), TOBN(0xd0efb273, 0xac20fa77)}, + {TOBN(0x817ff88b, 0x79df975b), TOBN(0x856bf286, 0x1999503e), + TOBN(0xb4d5351f, 0x5038ec46), TOBN(0x740a52c5, 0xfc42af6e)}}, + {{TOBN(0x2e38bb15, 0x2cbb1a3f), TOBN(0xc3eb99fe, 0x17a83429), + TOBN(0xca4fcbf1, 0xdd66bb74), TOBN(0x880784d6, 0xcde5e8fc)}, + {TOBN(0xddc84c1c, 0xb4e7a0be), TOBN(0x8780510d, 0xbd15a72f), + TOBN(0x44bcf1af, 0x81ec30e1), TOBN(0x141e50a8, 0x0a61073e)}}, + {{TOBN(0x0d955718, 0x47be87ae), TOBN(0x68a61417, 0xf76a4372), + TOBN(0xf57e7e87, 0xc607c3d3), TOBN(0x043afaf8, 0x5252f332)}, + {TOBN(0xcc14e121, 0x1552a4d2), TOBN(0xb6dee692, 0xbb4d4ab4), + TOBN(0xb6ab74c8, 0xa03816a4), TOBN(0x84001ae4, 0x6f394a29)}}, + {{TOBN(0x5bed8344, 0xd795fb45), TOBN(0x57326e7d, 0xb79f55a5), + TOBN(0xc9533ce0, 0x4accdffc), TOBN(0x53473caf, 0x3993fa04)}, + {TOBN(0x7906eb93, 0xa13df4c8), TOBN(0xa73e51f6, 0x97cbe46f), + TOBN(0xd1ab3ae1, 0x0ae4ccf8), TOBN(0x25614508, 0x8a5b3dbc)}}, + {{TOBN(0x61eff962, 0x11a71b27), TOBN(0xdf71412b, 0x6bb7fa39), + TOBN(0xb31ba6b8, 0x2bd7f3ef), TOBN(0xb0b9c415, 0x69180d29)}, + {TOBN(0xeec14552, 0x014cdde5), TOBN(0x702c624b, 0x227b4bbb), + TOBN(0x2b15e8c2, 0xd3e988f3), TOBN(0xee3bcc6d, 0xa4f7fd04)}}, + {{TOBN(0x9d00822a, 0x42ac6c85), TOBN(0x2db0cea6, 0x1df9f2b7), + TOBN(0xd7cad2ab, 0x42de1e58), TOBN(0x346ed526, 0x2d6fbb61)}, + {TOBN(0xb3962995, 0x1a2faf09), TOBN(0x2fa8a580, 0x7c25612e), + TOBN(0x30ae04da, 0x7cf56490), TOBN(0x75662908, 0x0eea3961)}}, + {{TOBN(0x3609f5c5, 0x3d080847), TOBN(0xcb081d39, 0x5241d4f6), + TOBN(0xb4fb3810, 0x77961a63), TOBN(0xc20c5984, 0x2abb66fc)}, + {TOBN(0x3d40aa7c, 0xf902f245), TOBN(0x9cb12736, 0x4e536b1e), + TOBN(0x5eda24da, 0x99b3134f), TOBN(0xafbd9c69, 0x5cd011af)}}, + {{TOBN(0x9a16e30a, 0xc7088c7d), TOBN(0x5ab65710, 0x3207389f), + TOBN(0x1b09547f, 0xe7407a53), TOBN(0x2322f9d7, 0x4fdc6eab)}, + {TOBN(0xc0f2f22d, 0x7430de4d), TOBN(0x19382696, 0xe68ca9a9), + TOBN(0x17f1eff1, 0x918e5868), TOBN(0xe3b5b635, 0x586f4204)}}, + {{TOBN(0x146ef980, 0x3fbc4341), TOBN(0x359f2c80, 0x5b5eed4e), + TOBN(0x9f35744e, 0x7482e41d), TOBN(0x9a9ac3ec, 0xf3b224c2)}, + {TOBN(0x9161a6fe, 0x91fc50ae), TOBN(0x89ccc66b, 0xc613fa7c), + TOBN(0x89268b14, 0xc732f15a), TOBN(0x7cd6f4e2, 0xb467ed03)}}, + {{TOBN(0xfbf79869, 0xce56b40e), TOBN(0xf93e094c, 0xc02dde98), + TOBN(0xefe0c3a8, 0xedee2cd7), TOBN(0x90f3ffc0, 0xb268fd42)}, + {TOBN(0x81a7fd56, 0x08241aed), TOBN(0x95ab7ad8, 0x00b1afe8), + TOBN(0x40127056, 0x3e310d52), TOBN(0xd3ffdeb1, 0x09d9fc43)}}, + {{TOBN(0xc8f85c91, 0xd11a8594), TOBN(0x2e74d258, 0x31cf6db8), + TOBN(0x829c7ca3, 0x02b5dfd0), TOBN(0xe389cfbe, 0x69143c86)}, + {TOBN(0xd01b6405, 0x941768d8), TOBN(0x45103995, 0x03bf825d), + TOBN(0xcc4ee166, 0x56cd17e2), TOBN(0xbea3c283, 0xba037e79)}}, + {{TOBN(0x4e1ac06e, 0xd9a47520), TOBN(0xfbfe18aa, 0xaf852404), + TOBN(0x5615f8e2, 0x8087648a), TOBN(0x7301e47e, 0xb9d150d9)}, + {TOBN(0x79f9f9dd, 0xb299b977), TOBN(0x76697a7b, 0xa5b78314), + TOBN(0x10d67468, 0x7d7c90e7), TOBN(0x7afffe03, 0x937210b5)}}, + {{TOBN(0x5aef3e4b, 0x28c22cee), TOBN(0xefb0ecd8, 0x09fd55ae), + TOBN(0x4cea7132, 0x0d2a5d6a), TOBN(0x9cfb5fa1, 0x01db6357)}, + {TOBN(0x395e0b57, 0xf36e1ac5), TOBN(0x008fa9ad, 0x36cafb7d), + TOBN(0x8f6cdf70, 0x5308c4db), TOBN(0x51527a37, 0x95ed2477)}}, + {{TOBN(0xba0dee30, 0x5bd21311), TOBN(0x6ed41b22, 0x909c90d7), + TOBN(0xc5f6b758, 0x7c8696d3), TOBN(0x0db8eaa8, 0x3ce83a80)}, + {TOBN(0xd297fe37, 0xb24b4b6f), TOBN(0xfe58afe8, 0x522d1f0d), + TOBN(0x97358736, 0x8c98dbd9), TOBN(0x6bc226ca, 0x9454a527)}}, + {{TOBN(0xa12b384e, 0xce53c2d0), TOBN(0x779d897d, 0x5e4606da), + TOBN(0xa53e47b0, 0x73ec12b0), TOBN(0x462dbbba, 0x5756f1ad)}, + {TOBN(0x69fe09f2, 0xcafe37b6), TOBN(0x273d1ebf, 0xecce2e17), + TOBN(0x8ac1d538, 0x3cf607fd), TOBN(0x8035f7ff, 0x12e10c25)}}}, + {{{TOBN(0x854d34c7, 0x7e6c5520), TOBN(0xc27df9ef, 0xdcb9ea58), + TOBN(0x405f2369, 0xd686666d), TOBN(0x29d1febf, 0x0417aa85)}, + {TOBN(0x9846819e, 0x93470afe), TOBN(0x3e6a9669, 0xe2a27f9e), + TOBN(0x24d008a2, 0xe31e6504), TOBN(0xdba7cecf, 0x9cb7680a)}}, + {{TOBN(0xecaff541, 0x338d6e43), TOBN(0x56f7dd73, 0x4541d5cc), + TOBN(0xb5d426de, 0x96bc88ca), TOBN(0x48d94f6b, 0x9ed3a2c3)}, + {TOBN(0x6354a3bb, 0x2ef8279c), TOBN(0xd575465b, 0x0b1867f2), + TOBN(0xef99b0ff, 0x95225151), TOBN(0xf3e19d88, 0xf94500d8)}}, + {{TOBN(0x92a83268, 0xe32dd620), TOBN(0x913ec99f, 0x627849a2), + TOBN(0xedd8fdfa, 0x2c378882), TOBN(0xaf96f33e, 0xee6f8cfe)}, + {TOBN(0xc06737e5, 0xdc3fa8a5), TOBN(0x236bb531, 0xb0b03a1d), + TOBN(0x33e59f29, 0x89f037b0), TOBN(0x13f9b5a7, 0xd9a12a53)}}, + {{TOBN(0x0d0df6ce, 0x51efb310), TOBN(0xcb5b2eb4, 0x958df5be), + TOBN(0xd6459e29, 0x36158e59), TOBN(0x82aae2b9, 0x1466e336)}, + {TOBN(0xfb658a39, 0x411aa636), TOBN(0x7152ecc5, 0xd4c0a933), + TOBN(0xf10c758a, 0x49f026b7), TOBN(0xf4837f97, 0xcb09311f)}}, + {{TOBN(0xddfb02c4, 0xc753c45f), TOBN(0x18ca81b6, 0xf9c840fe), + TOBN(0x846fd09a, 0xb0f8a3e6), TOBN(0xb1162add, 0xe7733dbc)}, + {TOBN(0x7070ad20, 0x236e3ab6), TOBN(0xf88cdaf5, 0xb2a56326), + TOBN(0x05fc8719, 0x997cbc7a), TOBN(0x442cd452, 0x4b665272)}}, + {{TOBN(0x7807f364, 0xb71698f5), TOBN(0x6ba418d2, 0x9f7b605e), + TOBN(0xfd20b00f, 0xa03b2cbb), TOBN(0x883eca37, 0xda54386f)}, + {TOBN(0xff0be43f, 0xf3437f24), TOBN(0xe910b432, 0xa48bb33c), + TOBN(0x4963a128, 0x329df765), TOBN(0xac1dd556, 0xbe2fe6f7)}}, + {{TOBN(0x557610f9, 0x24a0a3fc), TOBN(0x38e17bf4, 0xe881c3f9), + TOBN(0x6ba84faf, 0xed0dac99), TOBN(0xd4a222c3, 0x59eeb918)}, + {TOBN(0xc79c1dbe, 0x13f542b6), TOBN(0x1fc65e0d, 0xe425d457), + TOBN(0xeffb754f, 0x1debb779), TOBN(0x638d8fd0, 0x9e08af60)}}, + {{TOBN(0x994f523a, 0x626332d5), TOBN(0x7bc38833, 0x5561bb44), + TOBN(0x005ed4b0, 0x3d845ea2), TOBN(0xd39d3ee1, 0xc2a1f08a)}, + {TOBN(0x6561fdd3, 0xe7676b0d), TOBN(0x620e35ff, 0xfb706017), + TOBN(0x36ce424f, 0xf264f9a8), TOBN(0xc4c3419f, 0xda2681f7)}}, + {{TOBN(0xfb6afd2f, 0x69beb6e8), TOBN(0x3a50b993, 0x6d700d03), + TOBN(0xc840b2ad, 0x0c83a14f), TOBN(0x573207be, 0x54085bef)}, + {TOBN(0x5af882e3, 0x09fe7e5b), TOBN(0x957678a4, 0x3b40a7e1), + TOBN(0x172d4bdd, 0x543056e2), TOBN(0x9c1b26b4, 0x0df13c0a)}}, + {{TOBN(0x1c30861c, 0xf405ff06), TOBN(0xebac86bd, 0x486e828b), + TOBN(0xe791a971, 0x636933fc), TOBN(0x50e7c2be, 0x7aeee947)}, + {TOBN(0xc3d4a095, 0xfa90d767), TOBN(0xae60eb7b, 0xe670ab7b), + TOBN(0x17633a64, 0x397b056d), TOBN(0x93a21f33, 0x105012aa)}}, + {{TOBN(0x663c370b, 0xabb88643), TOBN(0x91df36d7, 0x22e21599), + TOBN(0x183ba835, 0x8b761671), TOBN(0x381eea1d, 0x728f3bf1)}, + {TOBN(0xb9b2f1ba, 0x39966e6c), TOBN(0x7c464a28, 0xe7295492), + TOBN(0x0fd5f70a, 0x09b26b7f), TOBN(0xa9aba1f9, 0xfbe009df)}}, + {{TOBN(0x857c1f22, 0x369b87ad), TOBN(0x3c00e5d9, 0x32fca556), + TOBN(0x1ad74cab, 0x90b06466), TOBN(0xa7112386, 0x550faaf2)}, + {TOBN(0x7435e198, 0x6d9bd5f5), TOBN(0x2dcc7e38, 0x59c3463f), + TOBN(0xdc7df748, 0xca7bd4b2), TOBN(0x13cd4c08, 0x9dec2f31)}}, + {{TOBN(0x0d3b5df8, 0xe3237710), TOBN(0x0dadb26e, 0xcbd2f7b0), + TOBN(0x9f5966ab, 0xe4aa082b), TOBN(0x666ec8de, 0x350e966e)}, + {TOBN(0x1bfd1ed5, 0xee524216), TOBN(0xcd93c59b, 0x41dab0b6), + TOBN(0x658a8435, 0xd186d6ba), TOBN(0x1b7d34d2, 0x159d1195)}}, + {{TOBN(0x5936e460, 0x22caf46b), TOBN(0x6a45dd8f, 0x9a96fe4f), + TOBN(0xf7925434, 0xb98f474e), TOBN(0x41410412, 0x0053ef15)}, + {TOBN(0x71cf8d12, 0x41de97bf), TOBN(0xb8547b61, 0xbd80bef4), + TOBN(0xb47d3970, 0xc4db0037), TOBN(0xf1bcd328, 0xfef20dff)}}, + {{TOBN(0x31a92e09, 0x10caad67), TOBN(0x1f591960, 0x5531a1e1), + TOBN(0x3bb852e0, 0x5f4fc840), TOBN(0x63e297ca, 0x93a72c6c)}, + {TOBN(0x3c2b0b2e, 0x49abad67), TOBN(0x6ec405fc, 0xed3db0d9), + TOBN(0xdc14a530, 0x7fef1d40), TOBN(0xccd19846, 0x280896fc)}}, + {{TOBN(0x00f83176, 0x9bb81648), TOBN(0xd69eb485, 0x653120d0), + TOBN(0xd17d75f4, 0x4ccabc62), TOBN(0x34a07f82, 0xb749fcb1)}, + {TOBN(0x2c3af787, 0xbbfb5554), TOBN(0xb06ed4d0, 0x62e283f8), + TOBN(0x5722889f, 0xa19213a0), TOBN(0x162b085e, 0xdcf3c7b4)}}, + {{TOBN(0xbcaecb31, 0xe0dd3eca), TOBN(0xc6237fbc, 0xe52f13a5), + TOBN(0xcc2b6b03, 0x27bac297), TOBN(0x2ae1cac5, 0xb917f54a)}, + {TOBN(0x474807d4, 0x7845ae4f), TOBN(0xfec7dd92, 0xce5972e0), + TOBN(0xc3bd2541, 0x1d7915bb), TOBN(0x66f85dc4, 0xd94907ca)}}, + {{TOBN(0xd981b888, 0xbdbcf0ca), TOBN(0xd75f5da6, 0xdf279e9f), + TOBN(0x128bbf24, 0x7054e934), TOBN(0x3c6ff6e5, 0x81db134b)}, + {TOBN(0x795b7cf4, 0x047d26e4), TOBN(0xf370f7b8, 0x5049ec37), + TOBN(0xc6712d4d, 0xced945af), TOBN(0xdf30b5ec, 0x095642bc)}}, + {{TOBN(0x9b034c62, 0x4896246e), TOBN(0x5652c016, 0xee90bbd1), + TOBN(0xeb38636f, 0x87fedb73), TOBN(0x5e32f847, 0x0135a613)}, + {TOBN(0x0703b312, 0xcf933c83), TOBN(0xd05bb76e, 0x1a7f47e6), + TOBN(0x825e4f0c, 0x949c2415), TOBN(0x569e5622, 0x7250d6f8)}}, + {{TOBN(0xbbe9eb3a, 0x6568013e), TOBN(0x8dbd203f, 0x22f243fc), + TOBN(0x9dbd7694, 0xb342734a), TOBN(0x8f6d12f8, 0x46afa984)}, + {TOBN(0xb98610a2, 0xc9eade29), TOBN(0xbab4f323, 0x47dd0f18), + TOBN(0x5779737b, 0x671c0d46), TOBN(0x10b6a7c6, 0xd3e0a42a)}}, + {{TOBN(0xfb19ddf3, 0x3035b41c), TOBN(0xd336343f, 0x99c45895), + TOBN(0x61fe4938, 0x54c857e5), TOBN(0xc4d506be, 0xae4e57d5)}, + {TOBN(0x3cd8c8cb, 0xbbc33f75), TOBN(0x7281f08a, 0x9262c77d), + TOBN(0x083f4ea6, 0xf11a2823), TOBN(0x8895041e, 0x9fba2e33)}}, + {{TOBN(0xfcdfea49, 0x9c438edf), TOBN(0x7678dcc3, 0x91edba44), + TOBN(0xf07b3b87, 0xe2ba50f0), TOBN(0xc13888ef, 0x43948c1b)}, + {TOBN(0xc2135ad4, 0x1140af42), TOBN(0x8e5104f3, 0x926ed1a7), + TOBN(0xf24430cb, 0x88f6695f), TOBN(0x0ce0637b, 0x6d73c120)}}, + {{TOBN(0xb2db01e6, 0xfe631e8f), TOBN(0x1c5563d7, 0xd7bdd24b), + TOBN(0x8daea3ba, 0x369ad44f), TOBN(0x000c81b6, 0x8187a9f9)}, + {TOBN(0x5f48a951, 0xaae1fd9a), TOBN(0xe35626c7, 0x8d5aed8a), + TOBN(0x20952763, 0x0498c622), TOBN(0x76d17634, 0x773aa504)}}, + {{TOBN(0x36d90dda, 0xeb300f7a), TOBN(0x9dcf7dfc, 0xedb5e801), + TOBN(0x645cb268, 0x74d5244c), TOBN(0xa127ee79, 0x348e3aa2)}, + {TOBN(0x488acc53, 0x575f1dbb), TOBN(0x95037e85, 0x80e6161e), + TOBN(0x57e59283, 0x292650d0), TOBN(0xabe67d99, 0x14938216)}}, + {{TOBN(0x3c7f944b, 0x3f8e1065), TOBN(0xed908cb6, 0x330e8924), + TOBN(0x08ee8fd5, 0x6f530136), TOBN(0x2227b7d5, 0xd7ffc169)}, + {TOBN(0x4f55c893, 0xb5cd6dd5), TOBN(0x82225e11, 0xa62796e8), + TOBN(0x5c6cead1, 0xcb18e12c), TOBN(0x4381ae0c, 0x84f5a51a)}}, + {{TOBN(0x345913d3, 0x7fafa4c8), TOBN(0x3d918082, 0x0491aac0), + TOBN(0x9347871f, 0x3e69264c), TOBN(0xbea9dd3c, 0xb4f4f0cd)}, + {TOBN(0xbda5d067, 0x3eadd3e7), TOBN(0x0033c1b8, 0x0573bcd8), + TOBN(0x25589379, 0x5da2486c), TOBN(0xcb89ee5b, 0x86abbee7)}}, + {{TOBN(0x8fe0a8f3, 0x22532e5d), TOBN(0xb6410ff0, 0x727dfc4c), + TOBN(0x619b9d58, 0x226726db), TOBN(0x5ec25669, 0x7a2b2dc7)}, + {TOBN(0xaf4d2e06, 0x4c3beb01), TOBN(0x852123d0, 0x7acea556), + TOBN(0x0e9470fa, 0xf783487a), TOBN(0x75a7ea04, 0x5664b3eb)}}, + {{TOBN(0x4ad78f35, 0x6798e4ba), TOBN(0x9214e6e5, 0xc7d0e091), + TOBN(0xc420b488, 0xb1290403), TOBN(0x64049e0a, 0xfc295749)}, + {TOBN(0x03ef5af1, 0x3ae9841f), TOBN(0xdbe4ca19, 0xb0b662a6), + TOBN(0x46845c5f, 0xfa453458), TOBN(0xf8dabf19, 0x10b66722)}}, + {{TOBN(0xb650f0aa, 0xcce2793b), TOBN(0x71db851e, 0xc5ec47c1), + TOBN(0x3eb78f3e, 0x3b234fa9), TOBN(0xb0c60f35, 0xfc0106ce)}, + {TOBN(0x05427121, 0x774eadbd), TOBN(0x25367faf, 0xce323863), + TOBN(0x7541b5c9, 0xcd086976), TOBN(0x4ff069e2, 0xdc507ad1)}}, + {{TOBN(0x74145256, 0x8776e667), TOBN(0x6e76142c, 0xb23c6bb5), + TOBN(0xdbf30712, 0x1b3a8a87), TOBN(0x60e7363e, 0x98450836)}, + {TOBN(0x5741450e, 0xb7366d80), TOBN(0xe4ee14ca, 0x4837dbdf), + TOBN(0xa765eb9b, 0x69d4316f), TOBN(0x04548dca, 0x8ef43825)}}, + {{TOBN(0x9c9f4e4c, 0x5ae888eb), TOBN(0x733abb51, 0x56e9ac99), + TOBN(0xdaad3c20, 0xba6ac029), TOBN(0x9b8dd3d3, 0x2ba3e38e)}, + {TOBN(0xa9bb4c92, 0x0bc5d11a), TOBN(0xf20127a7, 0x9c5f88a3), + TOBN(0x4f52b06e, 0x161d3cb8), TOBN(0x26c1ff09, 0x6afaf0a6)}}, + {{TOBN(0x32670d2f, 0x7189e71f), TOBN(0xc6438748, 0x5ecf91e7), + TOBN(0x15758e57, 0xdb757a21), TOBN(0x427d09f8, 0x290a9ce5)}, + {TOBN(0x846a308f, 0x38384a7a), TOBN(0xaac3acb4, 0xb0732b99), + TOBN(0x9e941009, 0x17845819), TOBN(0x95cba111, 0xa7ce5e03)}}, + {{TOBN(0x6f3d4f7f, 0xb00009c4), TOBN(0xb8396c27, 0x8ff28b5f), + TOBN(0xb1a9ae43, 0x1c97975d), TOBN(0x9d7ba8af, 0xe5d9fed5)}, + {TOBN(0x338cf09f, 0x34f485b6), TOBN(0xbc0ddacc, 0x64122516), + TOBN(0xa450da12, 0x05d471fe), TOBN(0x4c3a6250, 0x628dd8c9)}}, + {{TOBN(0x69c7d103, 0xd1295837), TOBN(0xa2893e50, 0x3807eb2f), + TOBN(0xd6e1e1de, 0xbdb41491), TOBN(0xc630745b, 0x5e138235)}, + {TOBN(0xc892109e, 0x48661ae1), TOBN(0x8d17e7eb, 0xea2b2674), + TOBN(0x00ec0f87, 0xc328d6b5), TOBN(0x6d858645, 0xf079ff9e)}}, + {{TOBN(0x6cdf243e, 0x19115ead), TOBN(0x1ce1393e, 0x4bac4fcf), + TOBN(0x2c960ed0, 0x9c29f25b), TOBN(0x59be4d8e, 0x9d388a05)}, + {TOBN(0x0d46e06c, 0xd0def72b), TOBN(0xb923db5d, 0xe0342748), + TOBN(0xf7d3aacd, 0x936d4a3d), TOBN(0x558519cc, 0x0b0b099e)}}, + {{TOBN(0x3ea8ebf8, 0x827097ef), TOBN(0x259353db, 0xd054f55d), + TOBN(0x84c89abc, 0x6d2ed089), TOBN(0x5c548b69, 0x8e096a7c)}, + {TOBN(0xd587f616, 0x994b995d), TOBN(0x4d1531f6, 0xa5845601), + TOBN(0x792ab31e, 0x451fd9f0), TOBN(0xc8b57bb2, 0x65adf6ca)}}, + {{TOBN(0x68440fcb, 0x1cd5ad73), TOBN(0xb9c860e6, 0x6144da4f), + TOBN(0x2ab286aa, 0x8462beb8), TOBN(0xcc6b8fff, 0xef46797f)}, + {TOBN(0xac820da4, 0x20c8a471), TOBN(0x69ae05a1, 0x77ff7faf), + TOBN(0xb9163f39, 0xbfb5da77), TOBN(0xbd03e590, 0x2c73ab7a)}}, + {{TOBN(0x7e862b5e, 0xb2940d9e), TOBN(0x3c663d86, 0x4b9af564), + TOBN(0xd8309031, 0xbde3033d), TOBN(0x298231b2, 0xd42c5bc6)}, + {TOBN(0x42090d2c, 0x552ad093), TOBN(0xa4799d1c, 0xff854695), + TOBN(0x0a88b5d6, 0xd31f0d00), TOBN(0xf8b40825, 0xa2f26b46)}}, + {{TOBN(0xec29b1ed, 0xf1bd7218), TOBN(0xd491c53b, 0x4b24c86e), + TOBN(0xd2fe588f, 0x3395ea65), TOBN(0x6f3764f7, 0x4456ef15)}, + {TOBN(0xdb43116d, 0xcdc34800), TOBN(0xcdbcd456, 0xc1e33955), + TOBN(0xefdb5540, 0x74ab286b), TOBN(0x948c7a51, 0xd18c5d7c)}}, + {{TOBN(0xeb81aa37, 0x7378058e), TOBN(0x41c746a1, 0x04411154), + TOBN(0xa10c73bc, 0xfb828ac7), TOBN(0x6439be91, 0x9d972b29)}, + {TOBN(0x4bf3b4b0, 0x43a2fbad), TOBN(0x39e6dadf, 0x82b5e840), + TOBN(0x4f716408, 0x6397bd4c), TOBN(0x0f7de568, 0x7f1eeccb)}}, + {{TOBN(0x5865c5a1, 0xd2ffbfc1), TOBN(0xf74211fa, 0x4ccb6451), + TOBN(0x66368a88, 0xc0b32558), TOBN(0x5b539dc2, 0x9ad7812e)}, + {TOBN(0x579483d0, 0x2f3af6f6), TOBN(0x52132078, 0x99934ece), + TOBN(0x50b9650f, 0xdcc9e983), TOBN(0xca989ec9, 0xaee42b8a)}}, + {{TOBN(0x6a44c829, 0xd6f62f99), TOBN(0x8f06a309, 0x4c2a7c0c), + TOBN(0x4ea2b3a0, 0x98a0cb0a), TOBN(0x5c547b70, 0xbeee8364)}, + {TOBN(0x461d40e1, 0x682afe11), TOBN(0x9e0fc77a, 0x7b41c0a8), + TOBN(0x79e4aefd, 0xe20d5d36), TOBN(0x2916e520, 0x32dd9f63)}}, + {{TOBN(0xf59e52e8, 0x3f883faf), TOBN(0x396f9639, 0x2b868d35), + TOBN(0xc902a9df, 0x4ca19881), TOBN(0x0fc96822, 0xdb2401a6)}, + {TOBN(0x41237587, 0x66f1c68d), TOBN(0x10fc6de3, 0xfb476c0d), + TOBN(0xf8b6b579, 0x841f5d90), TOBN(0x2ba8446c, 0xfa24f44a)}}, + {{TOBN(0xa237b920, 0xef4a9975), TOBN(0x60bb6004, 0x2330435f), + TOBN(0xd6f4ab5a, 0xcfb7e7b5), TOBN(0xb2ac5097, 0x83435391)}, + {TOBN(0xf036ee2f, 0xb0d1ea67), TOBN(0xae779a6a, 0x74c56230), + TOBN(0x59bff8c8, 0xab838ae6), TOBN(0xcd83ca99, 0x9b38e6f0)}}, + {{TOBN(0xbb27bef5, 0xe33deed3), TOBN(0xe6356f6f, 0x001892a8), + TOBN(0xbf3be6cc, 0x7adfbd3e), TOBN(0xaecbc81c, 0x33d1ac9d)}, + {TOBN(0xe4feb909, 0xe6e861dc), TOBN(0x90a247a4, 0x53f5f801), + TOBN(0x01c50acb, 0x27346e57), TOBN(0xce29242e, 0x461acc1b)}}, + {{TOBN(0x04dd214a, 0x2f998a91), TOBN(0x271ee9b1, 0xd4baf27b), + TOBN(0x7e3027d1, 0xe8c26722), TOBN(0x21d1645c, 0x1820dce5)}, + {TOBN(0x086f242c, 0x7501779c), TOBN(0xf0061407, 0xfa0e8009), + TOBN(0xf23ce477, 0x60187129), TOBN(0x05bbdedb, 0x0fde9bd0)}}, + {{TOBN(0x682f4832, 0x25d98473), TOBN(0xf207fe85, 0x5c658427), + TOBN(0xb6fdd7ba, 0x4166ffa1), TOBN(0x0c314056, 0x9eed799d)}, + {TOBN(0x0db8048f, 0x4107e28f), TOBN(0x74ed3871, 0x41216840), + TOBN(0x74489f8f, 0x56a3c06e), TOBN(0x1e1c005b, 0x12777134)}}, + {{TOBN(0xdb332a73, 0xf37ec3c3), TOBN(0xc65259bd, 0xdd59eba0), + TOBN(0x2291709c, 0xdb4d3257), TOBN(0x9a793b25, 0xbd389390)}, + {TOBN(0xf39fe34b, 0xe43756f0), TOBN(0x2f76bdce, 0x9afb56c9), + TOBN(0x9f37867a, 0x61208b27), TOBN(0xea1d4307, 0x089972c3)}}, + {{TOBN(0x8c595330, 0x8bdf623a), TOBN(0x5f5accda, 0x8441fb7d), + TOBN(0xfafa9418, 0x32ddfd95), TOBN(0x6ad40c5a, 0x0fde9be7)}, + {TOBN(0x43faba89, 0xaeca8709), TOBN(0xc64a7cf1, 0x2c248a9d), + TOBN(0x16620252, 0x72637a76), TOBN(0xaee1c791, 0x22b8d1bb)}}, + {{TOBN(0xf0f798fd, 0x21a843b2), TOBN(0x56e4ed4d, 0x8d005cb1), + TOBN(0x355f7780, 0x1f0d8abe), TOBN(0x197b04cf, 0x34522326)}, + {TOBN(0x41f9b31f, 0xfd42c13f), TOBN(0x5ef7feb2, 0xb40f933d), + TOBN(0x27326f42, 0x5d60bad4), TOBN(0x027ecdb2, 0x8c92cf89)}}, + {{TOBN(0x04aae4d1, 0x4e3352fe), TOBN(0x08414d2f, 0x73591b90), + TOBN(0x5ed6124e, 0xb7da7d60), TOBN(0xb985b931, 0x4d13d4ec)}, + {TOBN(0xa592d3ab, 0x96bf36f9), TOBN(0x012dbed5, 0xbbdf51df), + TOBN(0xa57963c0, 0xdf6c177d), TOBN(0x010ec869, 0x87ca29cf)}}, + {{TOBN(0xba1700f6, 0xbf926dff), TOBN(0x7c9fdbd1, 0xf4bf6bc2), + TOBN(0xdc18dc8f, 0x64da11f5), TOBN(0xa6074b7a, 0xd938ae75)}, + {TOBN(0x14270066, 0xe84f44a4), TOBN(0x99998d38, 0xd27b954e), + TOBN(0xc1be8ab2, 0xb4f38e9a), TOBN(0x8bb55bbf, 0x15c01016)}}, + {{TOBN(0xf73472b4, 0x0ea2ab30), TOBN(0xd365a340, 0xf73d68dd), + TOBN(0xc01a7168, 0x19c2e1eb), TOBN(0x32f49e37, 0x34061719)}, + {TOBN(0xb73c57f1, 0x01d8b4d6), TOBN(0x03c8423c, 0x26b47700), + TOBN(0x321d0bc8, 0xa4d8826a), TOBN(0x6004213c, 0x4bc0e638)}}, + {{TOBN(0xf78c64a1, 0xc1c06681), TOBN(0x16e0a16f, 0xef018e50), + TOBN(0x31cbdf91, 0xdb42b2b3), TOBN(0xf8f4ffce, 0xe0d36f58)}, + {TOBN(0xcdcc71cd, 0x4cc5e3e0), TOBN(0xd55c7cfa, 0xa129e3e0), + TOBN(0xccdb6ba0, 0x0fb2cbf1), TOBN(0x6aba0005, 0xc4bce3cb)}}, + {{TOBN(0x501cdb30, 0xd232cfc4), TOBN(0x9ddcf12e, 0xd58a3cef), + TOBN(0x02d2cf9c, 0x87e09149), TOBN(0xdc5d7ec7, 0x2c976257)}, + {TOBN(0x6447986e, 0x0b50d7dd), TOBN(0x88fdbaf7, 0x807f112a), + TOBN(0x58c9822a, 0xb00ae9f6), TOBN(0x6abfb950, 0x6d3d27e0)}}, + {{TOBN(0xd0a74487, 0x8a429f4f), TOBN(0x0649712b, 0xdb516609), + TOBN(0xb826ba57, 0xe769b5df), TOBN(0x82335df2, 0x1fc7aaf2)}, + {TOBN(0x2389f067, 0x5c93d995), TOBN(0x59ac367a, 0x68677be6), + TOBN(0xa77985ff, 0x21d9951b), TOBN(0x038956fb, 0x85011cce)}}, + {{TOBN(0x608e48cb, 0xbb734e37), TOBN(0xc08c0bf2, 0x2be5b26f), + TOBN(0x17bbdd3b, 0xf9b1a0d9), TOBN(0xeac7d898, 0x10483319)}, + {TOBN(0xc95c4baf, 0xbc1a6dea), TOBN(0xfdd0e2bf, 0x172aafdb), + TOBN(0x40373cbc, 0x8235c41a), TOBN(0x14303f21, 0xfb6f41d5)}}, + {{TOBN(0xba063621, 0x0408f237), TOBN(0xcad3b09a, 0xecd2d1ed), + TOBN(0x4667855a, 0x52abb6a2), TOBN(0xba9157dc, 0xaa8b417b)}, + {TOBN(0xfe7f3507, 0x4f013efb), TOBN(0x1b112c4b, 0xaa38c4a2), + TOBN(0xa1406a60, 0x9ba64345), TOBN(0xe53cba33, 0x6993c80b)}}, + {{TOBN(0x45466063, 0xded40d23), TOBN(0x3d5f1f4d, 0x54908e25), + TOBN(0x9ebefe62, 0x403c3c31), TOBN(0x274ea0b5, 0x0672a624)}, + {TOBN(0xff818d99, 0x451d1b71), TOBN(0x80e82643, 0x8f79cf79), + TOBN(0xa165df13, 0x73ce37f5), TOBN(0xa744ef4f, 0xfe3a21fd)}}, + {{TOBN(0x73f1e7f5, 0xcf551396), TOBN(0xc616898e, 0x868c676b), + TOBN(0x671c28c7, 0x8c442c36), TOBN(0xcfe5e558, 0x5e0a317d)}, + {TOBN(0x1242d818, 0x7051f476), TOBN(0x56fad2a6, 0x14f03442), + TOBN(0x262068bc, 0x0a44d0f6), TOBN(0xdfa2cd6e, 0xce6edf4e)}}, + {{TOBN(0x0f43813a, 0xd15d1517), TOBN(0x61214cb2, 0x377d44f5), + TOBN(0xd399aa29, 0xc639b35f), TOBN(0x42136d71, 0x54c51c19)}, + {TOBN(0x9774711b, 0x08417221), TOBN(0x0a5546b3, 0x52545a57), + TOBN(0x80624c41, 0x1150582d), TOBN(0x9ec5c418, 0xfbc555bc)}}, + {{TOBN(0x2c87dcad, 0x771849f1), TOBN(0xb0c932c5, 0x01d7bf6f), + TOBN(0x6aa5cd3e, 0x89116eb2), TOBN(0xd378c25a, 0x51ca7bd3)}, + {TOBN(0xc612a0da, 0x9e6e3e31), TOBN(0x0417a54d, 0xb68ad5d0), + TOBN(0x00451e4a, 0x22c6edb8), TOBN(0x9fbfe019, 0xb42827ce)}}, + {{TOBN(0x2fa92505, 0xba9384a2), TOBN(0x21b8596e, 0x64ad69c1), + TOBN(0x8f4fcc49, 0x983b35a6), TOBN(0xde093760, 0x72754672)}, + {TOBN(0x2f14ccc8, 0xf7bffe6d), TOBN(0x27566bff, 0x5d94263d), + TOBN(0xb5b4e9c6, 0x2df3ec30), TOBN(0x94f1d7d5, 0x3e6ea6ba)}}, + {{TOBN(0x97b7851a, 0xaaca5e9b), TOBN(0x518aa521, 0x56713b97), + TOBN(0x3357e8c7, 0x150a61f6), TOBN(0x7842e7e2, 0xec2c2b69)}, + {TOBN(0x8dffaf65, 0x6868a548), TOBN(0xd963bd82, 0xe068fc81), + TOBN(0x64da5c8b, 0x65917733), TOBN(0x927090ff, 0x7b247328)}}}, + {{{TOBN(0x214bc9a7, 0xd298c241), TOBN(0xe3b697ba, 0x56807cfd), + TOBN(0xef1c7802, 0x4564eadb), TOBN(0xdde8cdcf, 0xb48149c5)}, + {TOBN(0x946bf0a7, 0x5a4d2604), TOBN(0x27154d7f, 0x6c1538af), + TOBN(0x95cc9230, 0xde5b1fcc), TOBN(0xd88519e9, 0x66864f82)}}, + {{TOBN(0xb828dd1a, 0x7cb1282c), TOBN(0xa08d7626, 0xbe46973a), + TOBN(0x6baf8d40, 0xe708d6b2), TOBN(0x72571fa1, 0x4daeb3f3)}, + {TOBN(0x85b1732f, 0xf22dfd98), TOBN(0x87ab01a7, 0x0087108d), + TOBN(0xaaaafea8, 0x5988207a), TOBN(0xccc832f8, 0x69f00755)}}, + {{TOBN(0x964d950e, 0x36ff3bf0), TOBN(0x8ad20f6f, 0xf0b34638), + TOBN(0x4d9177b3, 0xb5d7585f), TOBN(0xcf839760, 0xef3f019f)}, + {TOBN(0x582fc5b3, 0x8288c545), TOBN(0x2f8e4e9b, 0x13116bd1), + TOBN(0xf91e1b2f, 0x332120ef), TOBN(0xcf568724, 0x2a17dd23)}}, + {{TOBN(0x488f1185, 0xca8d9d1a), TOBN(0xadf2c77d, 0xd987ded2), + TOBN(0x5f3039f0, 0x60c46124), TOBN(0xe5d70b75, 0x71e095f4)}, + {TOBN(0x82d58650, 0x6260e70f), TOBN(0x39d75ea7, 0xf750d105), + TOBN(0x8cf3d0b1, 0x75bac364), TOBN(0xf3a7564d, 0x21d01329)}}, + {{TOBN(0x182f04cd, 0x2f52d2a7), TOBN(0x4fde149a, 0xe2df565a), + TOBN(0xb80c5eec, 0xa79fb2f7), TOBN(0xab491d7b, 0x22ddc897)}, + {TOBN(0x99d76c18, 0xc6312c7f), TOBN(0xca0d5f3d, 0x6aa41a57), + TOBN(0x71207325, 0xd15363a0), TOBN(0xe82aa265, 0xbeb252c2)}}, + {{TOBN(0x94ab4700, 0xec3128c2), TOBN(0x6c76d862, 0x8e383f49), + TOBN(0xdc36b150, 0xc03024eb), TOBN(0xfb439477, 0x53daac69)}, + {TOBN(0xfc68764a, 0x8dc79623), TOBN(0x5b86995d, 0xb440fbb2), + TOBN(0xd66879bf, 0xccc5ee0d), TOBN(0x05228942, 0x95aa8bd3)}}, + {{TOBN(0xb51a40a5, 0x1e6a75c1), TOBN(0x24327c76, 0x0ea7d817), + TOBN(0x06630182, 0x07774597), TOBN(0xd6fdbec3, 0x97fa7164)}, + {TOBN(0x20c99dfb, 0x13c90f48), TOBN(0xd6ac5273, 0x686ef263), + TOBN(0xc6a50bdc, 0xfef64eeb), TOBN(0xcd87b281, 0x86fdfc32)}}, + {{TOBN(0xb24aa43e, 0x3fcd3efc), TOBN(0xdd26c034, 0xb8088e9a), + TOBN(0xa5ef4dc9, 0xbd3d46ea), TOBN(0xa2f99d58, 0x8a4c6a6f)}, + {TOBN(0xddabd355, 0x2f1da46c), TOBN(0x72c3f8ce, 0x1afacdd1), + TOBN(0xd90c4eee, 0x92d40578), TOBN(0xd28bb41f, 0xca623b94)}}, + {{TOBN(0x50fc0711, 0x745edc11), TOBN(0x9dd9ad7d, 0x3dc87558), + TOBN(0xce6931fb, 0xb49d1e64), TOBN(0x6c77a0a2, 0xc98bd0f9)}, + {TOBN(0x62b9a629, 0x6baf7cb1), TOBN(0xcf065f91, 0xccf72d22), + TOBN(0x7203cce9, 0x79639071), TOBN(0x09ae4885, 0xf9cb732f)}}, + {{TOBN(0x5e7c3bec, 0xee8314f3), TOBN(0x1c068aed, 0xdbea298f), + TOBN(0x08d381f1, 0x7c80acec), TOBN(0x03b56be8, 0xe330495b)}, + {TOBN(0xaeffb8f2, 0x9222882d), TOBN(0x95ff38f6, 0xc4af8bf7), + TOBN(0x50e32d35, 0x1fc57d8c), TOBN(0x6635be52, 0x17b444f0)}}, + {{TOBN(0x04d15276, 0xa5177900), TOBN(0x4e1dbb47, 0xf6858752), + TOBN(0x5b475622, 0xc615796c), TOBN(0xa6fa0387, 0x691867bf)}, + {TOBN(0xed7f5d56, 0x2844c6d0), TOBN(0xc633cf9b, 0x03a2477d), + TOBN(0xf6be5c40, 0x2d3721d6), TOBN(0xaf312eb7, 0xe9fd68e6)}}, + {{TOBN(0x242792d2, 0xe7417ce1), TOBN(0xff42bc71, 0x970ee7f5), + TOBN(0x1ff4dc6d, 0x5c67a41e), TOBN(0x77709b7b, 0x20882a58)}, + {TOBN(0x3554731d, 0xbe217f2c), TOBN(0x2af2a8cd, 0x5bb72177), + TOBN(0x58eee769, 0x591dd059), TOBN(0xbb2930c9, 0x4bba6477)}}, + {{TOBN(0x863ee047, 0x7d930cfc), TOBN(0x4c262ad1, 0x396fd1f4), + TOBN(0xf4765bc8, 0x039af7e1), TOBN(0x2519834b, 0x5ba104f6)}, + {TOBN(0x7cd61b4c, 0xd105f961), TOBN(0xa5415da5, 0xd63bca54), + TOBN(0x778280a0, 0x88a1f17c), TOBN(0xc4968949, 0x2329512c)}}, + {{TOBN(0x174a9126, 0xcecdaa7a), TOBN(0xfc8c7e0e, 0x0b13247b), + TOBN(0x29c110d2, 0x3484c1c4), TOBN(0xf8eb8757, 0x831dfc3b)}, + {TOBN(0x022f0212, 0xc0067452), TOBN(0x3f6f69ee, 0x7b9b926c), + TOBN(0x09032da0, 0xef42daf4), TOBN(0x79f00ade, 0x83f80de4)}}, + {{TOBN(0x6210db71, 0x81236c97), TOBN(0x74f7685b, 0x3ee0781f), + TOBN(0x4df7da7b, 0xa3e41372), TOBN(0x2aae38b1, 0xb1a1553e)}, + {TOBN(0x1688e222, 0xf6dd9d1b), TOBN(0x57695448, 0x5b8b6487), + TOBN(0x478d2127, 0x4b2edeaa), TOBN(0xb2818fa5, 0x1e85956a)}}, + {{TOBN(0x1e6addda, 0xf176f2c0), TOBN(0x01ca4604, 0xe2572658), + TOBN(0x0a404ded, 0x85342ffb), TOBN(0x8cf60f96, 0x441838d6)}, + {TOBN(0x9bbc691c, 0xc9071c4a), TOBN(0xfd588744, 0x34442803), + TOBN(0x97101c85, 0x809c0d81), TOBN(0xa7fb754c, 0x8c456f7f)}}, + {{TOBN(0xc95f3c5c, 0xd51805e1), TOBN(0xab4ccd39, 0xb299dca8), + TOBN(0x3e03d20b, 0x47eaf500), TOBN(0xfa3165c1, 0xd7b80893)}, + {TOBN(0x005e8b54, 0xe160e552), TOBN(0xdc4972ba, 0x9019d11f), + TOBN(0x21a6972e, 0x0c9a4a7a), TOBN(0xa52c258f, 0x37840fd7)}}, + {{TOBN(0xf8559ff4, 0xc1e99d81), TOBN(0x08e1a7d6, 0xa3c617c0), + TOBN(0xb398fd43, 0x248c6ba7), TOBN(0x6ffedd91, 0xd1283794)}, + {TOBN(0x8a6a59d2, 0xd629d208), TOBN(0xa9d141d5, 0x3490530e), + TOBN(0x42f6fc18, 0x38505989), TOBN(0x09bf250d, 0x479d94ee)}}, + {{TOBN(0x223ad3b1, 0xb3822790), TOBN(0x6c5926c0, 0x93b8971c), + TOBN(0x609efc7e, 0x75f7fa62), TOBN(0x45d66a6d, 0x1ec2d989)}, + {TOBN(0x4422d663, 0x987d2792), TOBN(0x4a73caad, 0x3eb31d2b), + TOBN(0xf06c2ac1, 0xa32cb9e6), TOBN(0xd9445c5f, 0x91aeba84)}}, + {{TOBN(0x6af7a1d5, 0xaf71013f), TOBN(0xe68216e5, 0x0bedc946), + TOBN(0xf4cba30b, 0xd27370a0), TOBN(0x7981afbf, 0x870421cc)}, + {TOBN(0x02496a67, 0x9449f0e1), TOBN(0x86cfc4be, 0x0a47edae), + TOBN(0x3073c936, 0xb1feca22), TOBN(0xf5694612, 0x03f8f8fb)}}, + {{TOBN(0xd063b723, 0x901515ea), TOBN(0x4c6c77a5, 0x749cf038), + TOBN(0x6361e360, 0xab9e5059), TOBN(0x596cf171, 0xa76a37c0)}, + {TOBN(0x800f53fa, 0x6530ae7a), TOBN(0x0f5e631e, 0x0792a7a6), + TOBN(0x5cc29c24, 0xefdb81c9), TOBN(0xa269e868, 0x3f9c40ba)}}, + {{TOBN(0xec14f9e1, 0x2cb7191e), TOBN(0x78ea1bd8, 0xe5b08ea6), + TOBN(0x3c65aa9b, 0x46332bb9), TOBN(0x84cc22b3, 0xbf80ce25)}, + {TOBN(0x0098e9e9, 0xd49d5bf1), TOBN(0xcd4ec1c6, 0x19087da4), + TOBN(0x3c9d07c5, 0xaef6e357), TOBN(0x839a0268, 0x9f8f64b8)}}, + {{TOBN(0xc5e9eb62, 0xc6d8607f), TOBN(0x759689f5, 0x6aa995e4), + TOBN(0x70464669, 0xbbb48317), TOBN(0x921474bf, 0xe402417d)}, + {TOBN(0xcabe135b, 0x2a354c8c), TOBN(0xd51e52d2, 0x812fa4b5), + TOBN(0xec741096, 0x53311fe8), TOBN(0x4f774535, 0xb864514b)}}, + {{TOBN(0xbcadd671, 0x5bde48f8), TOBN(0xc9703873, 0x2189bc7d), + TOBN(0x5d45299e, 0xc709ee8a), TOBN(0xd1287ee2, 0x845aaff8)}, + {TOBN(0x7d1f8874, 0xdb1dbf1f), TOBN(0xea46588b, 0x990c88d6), + TOBN(0x60ba649a, 0x84368313), TOBN(0xd5fdcbce, 0x60d543ae)}}, + {{TOBN(0x90b46d43, 0x810d5ab0), TOBN(0x6739d8f9, 0x04d7e5cc), + TOBN(0x021c1a58, 0x0d337c33), TOBN(0x00a61162, 0x68e67c40)}, + {TOBN(0x95ef413b, 0x379f0a1f), TOBN(0xfe126605, 0xe9e2ab95), + TOBN(0x67578b85, 0x2f5f199c), TOBN(0xf5c00329, 0x2cb84913)}}, + {{TOBN(0xf7956430, 0x37577dd8), TOBN(0x83b82af4, 0x29c5fe88), + TOBN(0x9c1bea26, 0xcdbdc132), TOBN(0x589fa086, 0x9c04339e)}, + {TOBN(0x033e9538, 0xb13799df), TOBN(0x85fa8b21, 0xd295d034), + TOBN(0xdf17f73f, 0xbd9ddcca), TOBN(0xf32bd122, 0xddb66334)}}, + {{TOBN(0x55ef88a7, 0x858b044c), TOBN(0x1f0d69c2, 0x5aa9e397), + TOBN(0x55fd9cc3, 0x40d85559), TOBN(0xc774df72, 0x7785ddb2)}, + {TOBN(0x5dcce9f6, 0xd3bd2e1c), TOBN(0xeb30da20, 0xa85dfed0), + TOBN(0x5ed7f5bb, 0xd3ed09c4), TOBN(0x7d42a35c, 0x82a9c1bd)}}, + {{TOBN(0xcf3de995, 0x9890272d), TOBN(0x75f3432a, 0x3e713a10), + TOBN(0x5e13479f, 0xe28227b8), TOBN(0xb8561ea9, 0xfefacdc8)}, + {TOBN(0xa6a297a0, 0x8332aafd), TOBN(0x9b0d8bb5, 0x73809b62), + TOBN(0xd2fa1cfd, 0x0c63036f), TOBN(0x7a16eb55, 0xbd64bda8)}}, + {{TOBN(0x3f5cf5f6, 0x78e62ddc), TOBN(0x2267c454, 0x07fd752b), + TOBN(0x5e361b6b, 0x5e437bbe), TOBN(0x95c59501, 0x8354e075)}, + {TOBN(0xec725f85, 0xf2b254d9), TOBN(0x844b617d, 0x2cb52b4e), + TOBN(0xed8554f5, 0xcf425fb5), TOBN(0xab67703e, 0x2af9f312)}}, + {{TOBN(0x4cc34ec1, 0x3cf48283), TOBN(0xb09daa25, 0x9c8a705e), + TOBN(0xd1e9d0d0, 0x5b7d4f84), TOBN(0x4df6ef64, 0xdb38929d)}, + {TOBN(0xe16b0763, 0xaa21ba46), TOBN(0xc6b1d178, 0xa293f8fb), + TOBN(0x0ff5b602, 0xd520aabf), TOBN(0x94d671bd, 0xc339397a)}}, + {{TOBN(0x7c7d98cf, 0x4f5792fa), TOBN(0x7c5e0d67, 0x11215261), + TOBN(0x9b19a631, 0xa7c5a6d4), TOBN(0xc8511a62, 0x7a45274d)}, + {TOBN(0x0c16621c, 0xa5a60d99), TOBN(0xf7fbab88, 0xcf5e48cb), + TOBN(0xab1e6ca2, 0xf7ddee08), TOBN(0x83bd08ce, 0xe7867f3c)}}, + {{TOBN(0xf7e48e8a, 0x2ac13e27), TOBN(0x4494f6df, 0x4eb1a9f5), + TOBN(0xedbf84eb, 0x981f0a62), TOBN(0x49badc32, 0x536438f0)}, + {TOBN(0x50bea541, 0x004f7571), TOBN(0xbac67d10, 0xdf1c94ee), + TOBN(0x253d73a1, 0xb727bc31), TOBN(0xb3d01cf2, 0x30686e28)}}, + {{TOBN(0x51b77b1b, 0x55fd0b8b), TOBN(0xa099d183, 0xfeec3173), + TOBN(0x202b1fb7, 0x670e72b7), TOBN(0xadc88b33, 0xa8e1635f)}, + {TOBN(0x34e8216a, 0xf989d905), TOBN(0xc2e68d20, 0x29b58d01), + TOBN(0x11f81c92, 0x6fe55a93), TOBN(0x15f1462a, 0x8f296f40)}}, + {{TOBN(0x1915d375, 0xea3d62f2), TOBN(0xa17765a3, 0x01c8977d), + TOBN(0x7559710a, 0xe47b26f6), TOBN(0xe0bd29c8, 0x535077a5)}, + {TOBN(0x615f976d, 0x08d84858), TOBN(0x370dfe85, 0x69ced5c1), + TOBN(0xbbc7503c, 0xa734fa56), TOBN(0xfbb9f1ec, 0x91ac4574)}}, + {{TOBN(0x95d7ec53, 0x060dd7ef), TOBN(0xeef2dacd, 0x6e657979), + TOBN(0x54511af3, 0xe2a08235), TOBN(0x1e324aa4, 0x1f4aea3d)}, + {TOBN(0x550e7e71, 0xe6e67671), TOBN(0xbccd5190, 0xbf52faf7), + TOBN(0xf880d316, 0x223cc62a), TOBN(0x0d402c7e, 0x2b32eb5d)}}, + {{TOBN(0xa40bc039, 0x306a5a3b), TOBN(0x4e0a41fd, 0x96783a1b), + TOBN(0xa1e8d39a, 0x0253cdd4), TOBN(0x6480be26, 0xc7388638)}, + {TOBN(0xee365e1d, 0x2285f382), TOBN(0x188d8d8f, 0xec0b5c36), + TOBN(0x34ef1a48, 0x1f0f4d82), TOBN(0x1a8f43e1, 0xa487d29a)}}, + {{TOBN(0x8168226d, 0x77aefb3a), TOBN(0xf69a751e, 0x1e72c253), + TOBN(0x8e04359a, 0xe9594df1), TOBN(0x475ffd7d, 0xd14c0467)}, + {TOBN(0xb5a2c2b1, 0x3844e95c), TOBN(0x85caf647, 0xdd12ef94), + TOBN(0x1ecd2a9f, 0xf1063d00), TOBN(0x1dd2e229, 0x23843311)}}, + {{TOBN(0x38f0e09d, 0x73d17244), TOBN(0x3ede7746, 0x8fc653f1), + TOBN(0xae4459f5, 0xdc20e21c), TOBN(0x00db2ffa, 0x6a8599ea)}, + {TOBN(0x11682c39, 0x30cfd905), TOBN(0x4934d074, 0xa5c112a6), + TOBN(0xbdf063c5, 0x568bfe95), TOBN(0x779a440a, 0x016c441a)}}, + {{TOBN(0x0c23f218, 0x97d6fbdc), TOBN(0xd3a5cd87, 0xe0776aac), + TOBN(0xcee37f72, 0xd712e8db), TOBN(0xfb28c70d, 0x26f74e8d)}, + {TOBN(0xffe0c728, 0xb61301a0), TOBN(0xa6282168, 0xd3724354), + TOBN(0x7ff4cb00, 0x768ffedc), TOBN(0xc51b3088, 0x03b02de9)}}, + {{TOBN(0xa5a8147c, 0x3902dda5), TOBN(0x35d2f706, 0xfe6973b4), + TOBN(0x5ac2efcf, 0xc257457e), TOBN(0x933f48d4, 0x8700611b)}, + {TOBN(0xc365af88, 0x4912beb2), TOBN(0x7f5a4de6, 0x162edf94), + TOBN(0xc646ba7c, 0x0c32f34b), TOBN(0x632c6af3, 0xb2091074)}}, + {{TOBN(0x58d4f2e3, 0x753e43a9), TOBN(0x70e1d217, 0x24d4e23f), + TOBN(0xb24bf729, 0xafede6a6), TOBN(0x7f4a94d8, 0x710c8b60)}, + {TOBN(0xaad90a96, 0x8d4faa6a), TOBN(0xd9ed0b32, 0xb066b690), + TOBN(0x52fcd37b, 0x78b6dbfd), TOBN(0x0b64615e, 0x8bd2b431)}}, + {{TOBN(0x228e2048, 0xcfb9fad5), TOBN(0xbeaa386d, 0x240b76bd), + TOBN(0x2d6681c8, 0x90dad7bc), TOBN(0x3e553fc3, 0x06d38f5e)}, + {TOBN(0xf27cdb9b, 0x9d5f9750), TOBN(0x3e85c52a, 0xd28c5b0e), + TOBN(0x190795af, 0x5247c39b), TOBN(0x547831eb, 0xbddd6828)}}, + {{TOBN(0xf327a227, 0x4a82f424), TOBN(0x36919c78, 0x7e47f89d), + TOBN(0xe4783919, 0x43c7392c), TOBN(0xf101b9aa, 0x2316fefe)}, + {TOBN(0xbcdc9e9c, 0x1c5009d2), TOBN(0xfb55ea13, 0x9cd18345), + TOBN(0xf5b5e231, 0xa3ce77c7), TOBN(0xde6b4527, 0xd2f2cb3d)}}, + {{TOBN(0x10f6a333, 0x9bb26f5f), TOBN(0x1e85db8e, 0x044d85b6), + TOBN(0xc3697a08, 0x94197e54), TOBN(0x65e18cc0, 0xa7cb4ea8)}, + {TOBN(0xa38c4f50, 0xa471fe6e), TOBN(0xf031747a, 0x2f13439c), + TOBN(0x53c4a6ba, 0xc007318b), TOBN(0xa8da3ee5, 0x1deccb3d)}}, + {{TOBN(0x0555b31c, 0x558216b1), TOBN(0x90c7810c, 0x2f79e6c2), + TOBN(0x9b669f4d, 0xfe8eed3c), TOBN(0x70398ec8, 0xe0fac126)}, + {TOBN(0xa96a449e, 0xf701b235), TOBN(0x0ceecdb3, 0xeb94f395), + TOBN(0x285fc368, 0xd0cb7431), TOBN(0x0d37bb52, 0x16a18c64)}}, + {{TOBN(0x05110d38, 0xb880d2dd), TOBN(0xa60f177b, 0x65930d57), + TOBN(0x7da34a67, 0xf36235f5), TOBN(0x47f5e17c, 0x183816b9)}, + {TOBN(0xc7664b57, 0xdb394af4), TOBN(0x39ba215d, 0x7036f789), + TOBN(0x46d2ca0e, 0x2f27b472), TOBN(0xc42647ee, 0xf73a84b7)}}, + {{TOBN(0x44bc7545, 0x64488f1d), TOBN(0xaa922708, 0xf4cf85d5), + TOBN(0x721a01d5, 0x53e4df63), TOBN(0x649c0c51, 0x5db46ced)}, + {TOBN(0x6bf0d64e, 0x3cffcb6c), TOBN(0xe3bf93fe, 0x50f71d96), + TOBN(0x75044558, 0xbcc194a0), TOBN(0x16ae3372, 0x6afdc554)}}, + {{TOBN(0xbfc01adf, 0x5ca48f3f), TOBN(0x64352f06, 0xe22a9b84), + TOBN(0xcee54da1, 0xc1099e4a), TOBN(0xbbda54e8, 0xfa1b89c0)}, + {TOBN(0x166a3df5, 0x6f6e55fb), TOBN(0x1ca44a24, 0x20176f88), + TOBN(0x936afd88, 0xdfb7b5ff), TOBN(0xe34c2437, 0x8611d4a0)}}, + {{TOBN(0x7effbb75, 0x86142103), TOBN(0x6704ba1b, 0x1f34fc4d), + TOBN(0x7c2a468f, 0x10c1b122), TOBN(0x36b3a610, 0x8c6aace9)}, + {TOBN(0xabfcc0a7, 0x75a0d050), TOBN(0x066f9197, 0x3ce33e32), + TOBN(0xce905ef4, 0x29fe09be), TOBN(0x89ee25ba, 0xa8376351)}}, + {{TOBN(0x2a3ede22, 0xfd29dc76), TOBN(0x7fd32ed9, 0x36f17260), + TOBN(0x0cadcf68, 0x284b4126), TOBN(0x63422f08, 0xa7951fc8)}, + {TOBN(0x562b24f4, 0x0807e199), TOBN(0xfe9ce5d1, 0x22ad4490), + TOBN(0xc2f51b10, 0x0db2b1b4), TOBN(0xeb3613ff, 0xe4541d0d)}}, + {{TOBN(0xbd2c4a05, 0x2680813b), TOBN(0x527aa55d, 0x561b08d6), + TOBN(0xa9f8a40e, 0xa7205558), TOBN(0xe3eea56f, 0x243d0bec)}, + {TOBN(0x7b853817, 0xa0ff58b3), TOBN(0xb67d3f65, 0x1a69e627), + TOBN(0x0b76bbb9, 0xa869b5d6), TOBN(0xa3afeb82, 0x546723ed)}}, + {{TOBN(0x5f24416d, 0x3e554892), TOBN(0x8413b53d, 0x430e2a45), + TOBN(0x99c56aee, 0x9032a2a0), TOBN(0x09432bf6, 0xeec367b1)}, + {TOBN(0x552850c6, 0xdaf0ecc1), TOBN(0x49ebce55, 0x5bc92048), + TOBN(0xdfb66ba6, 0x54811307), TOBN(0x1b84f797, 0x6f298597)}}, + {{TOBN(0x79590481, 0x8d1d7a0d), TOBN(0xd9fabe03, 0x3a6fa556), + TOBN(0xa40f9c59, 0xba9e5d35), TOBN(0xcb1771c1, 0xf6247577)}, + {TOBN(0x542a47ca, 0xe9a6312b), TOBN(0xa34b3560, 0x552dd8c5), + TOBN(0xfdf94de0, 0x0d794716), TOBN(0xd46124a9, 0x9c623094)}}, + {{TOBN(0x56b7435d, 0x68afe8b4), TOBN(0x27f20540, 0x6c0d8ea1), + TOBN(0x12b77e14, 0x73186898), TOBN(0xdbc3dd46, 0x7479490f)}, + {TOBN(0x951a9842, 0xc03b0c05), TOBN(0x8b1b3bb3, 0x7921bc96), + TOBN(0xa573b346, 0x2b202e0a), TOBN(0x77e4665d, 0x47254d56)}}, + {{TOBN(0x08b70dfc, 0xd23e3984), TOBN(0xab86e8bc, 0xebd14236), + TOBN(0xaa3e07f8, 0x57114ba7), TOBN(0x5ac71689, 0xab0ef4f2)}, + {TOBN(0x88fca384, 0x0139d9af), TOBN(0x72733f88, 0x76644af0), + TOBN(0xf122f72a, 0x65d74f4a), TOBN(0x13931577, 0xa5626c7a)}}, + {{TOBN(0xd5b5d9eb, 0x70f8d5a4), TOBN(0x375adde7, 0xd7bbb228), + TOBN(0x31e88b86, 0x0c1c0b32), TOBN(0xd1f568c4, 0x173edbaa)}, + {TOBN(0x1592fc83, 0x5459df02), TOBN(0x2beac0fb, 0x0fcd9a7e), + TOBN(0xb0a6fdb8, 0x1b473b0a), TOBN(0xe3224c6f, 0x0fe8fc48)}}, + {{TOBN(0x680bd00e, 0xe87edf5b), TOBN(0x30385f02, 0x20e77cf5), + TOBN(0xe9ab98c0, 0x4d42d1b2), TOBN(0x72d191d2, 0xd3816d77)}, + {TOBN(0x1564daca, 0x0917d9e5), TOBN(0x394eab59, 0x1f8fed7f), + TOBN(0xa209aa8d, 0x7fbb3896), TOBN(0x5564f3b9, 0xbe6ac98e)}}, + {{TOBN(0xead21d05, 0xd73654ef), TOBN(0x68d1a9c4, 0x13d78d74), + TOBN(0x61e01708, 0x6d4973a0), TOBN(0x83da3500, 0x46e6d32a)}, + {TOBN(0x6a3dfca4, 0x68ae0118), TOBN(0xa1b9a4c9, 0xd02da069), + TOBN(0x0b2ff9c7, 0xebab8302), TOBN(0x98af07c3, 0x944ba436)}}, + {{TOBN(0x85997326, 0x995f0f9f), TOBN(0x467fade0, 0x71b58bc6), + TOBN(0x47e4495a, 0xbd625a2b), TOBN(0xfdd2d01d, 0x33c3b8cd)}, + {TOBN(0x2c38ae28, 0xc693f9fa), TOBN(0x48622329, 0x348f7999), + TOBN(0x97bf738e, 0x2161f583), TOBN(0x15ee2fa7, 0x565e8cc9)}}, + {{TOBN(0xa1a5c845, 0x5777e189), TOBN(0xcc10bee0, 0x456f2829), + TOBN(0x8ad95c56, 0xda762bd5), TOBN(0x152e2214, 0xe9d91da8)}, + {TOBN(0x975b0e72, 0x7cb23c74), TOBN(0xfd5d7670, 0xa90c66df), + TOBN(0xb5b5b8ad, 0x225ffc53), TOBN(0xab6dff73, 0xfaded2ae)}}, + {{TOBN(0xebd56781, 0x6f4cbe9d), TOBN(0x0ed8b249, 0x6a574bd7), + TOBN(0x41c246fe, 0x81a881fa), TOBN(0x91564805, 0xc3db9c70)}, + {TOBN(0xd7c12b08, 0x5b862809), TOBN(0x1facd1f1, 0x55858d7b), + TOBN(0x7693747c, 0xaf09e92a), TOBN(0x3b69dcba, 0x189a425f)}}, + {{TOBN(0x0be28e9f, 0x967365ef), TOBN(0x57300eb2, 0xe801f5c9), + TOBN(0x93b8ac6a, 0xd583352f), TOBN(0xa2cf1f89, 0xcd05b2b7)}, + {TOBN(0x7c0c9b74, 0x4dcc40cc), TOBN(0xfee38c45, 0xada523fb), + TOBN(0xb49a4dec, 0x1099cc4d), TOBN(0x325c377f, 0x69f069c6)}}, + {{TOBN(0xe12458ce, 0x476cc9ff), TOBN(0x580e0b6c, 0xc6d4cb63), + TOBN(0xd561c8b7, 0x9072289b), TOBN(0x0377f264, 0xa619e6da)}, + {TOBN(0x26685362, 0x88e591a5), TOBN(0xa453a7bd, 0x7523ca2b), + TOBN(0x8a9536d2, 0xc1df4533), TOBN(0xc8e50f2f, 0xbe972f79)}}, + {{TOBN(0xd433e50f, 0x6d3549cf), TOBN(0x6f33696f, 0xfacd665e), + TOBN(0x695bfdac, 0xce11fcb4), TOBN(0x810ee252, 0xaf7c9860)}, + {TOBN(0x65450fe1, 0x7159bb2c), TOBN(0xf7dfbebe, 0x758b357b), + TOBN(0x2b057e74, 0xd69fea72), TOBN(0xd485717a, 0x92731745)}}}, + {{{TOBN(0x896c42e8, 0xee36860c), TOBN(0xdaf04dfd, 0x4113c22d), + TOBN(0x1adbb7b7, 0x44104213), TOBN(0xe5fd5fa1, 0x1fd394ea)}, + {TOBN(0x68235d94, 0x1a4e0551), TOBN(0x6772cfbe, 0x18d10151), + TOBN(0x276071e3, 0x09984523), TOBN(0xe4e879de, 0x5a56ba98)}}, + {{TOBN(0xaaafafb0, 0x285b9491), TOBN(0x01a0be88, 0x1e4c705e), + TOBN(0xff1d4f5d, 0x2ad9caab), TOBN(0x6e349a4a, 0xc37a233f)}, + {TOBN(0xcf1c1246, 0x4a1c6a16), TOBN(0xd99e6b66, 0x29383260), + TOBN(0xea3d4366, 0x5f6d5471), TOBN(0x36974d04, 0xff8cc89b)}}, + {{TOBN(0xc26c49a1, 0xcfe89d80), TOBN(0xb42c026d, 0xda9c8371), + TOBN(0xca6c013a, 0xdad066d2), TOBN(0xfb8f7228, 0x56a4f3ee)}, + {TOBN(0x08b579ec, 0xd850935b), TOBN(0x34c1a74c, 0xd631e1b3), + TOBN(0xcb5fe596, 0xac198534), TOBN(0x39ff21f6, 0xe1f24f25)}}, + {{TOBN(0x27f29e14, 0x8f929057), TOBN(0x7a64ae06, 0xc0c853df), + TOBN(0x256cd183, 0x58e9c5ce), TOBN(0x9d9cce82, 0xded092a5)}, + {TOBN(0xcc6e5979, 0x6e93b7c7), TOBN(0xe1e47092, 0x31bb9e27), + TOBN(0xb70b3083, 0xaa9e29a0), TOBN(0xbf181a75, 0x3785e644)}}, + {{TOBN(0xf53f2c65, 0x8ead09f7), TOBN(0x1335e1d5, 0x9780d14d), + TOBN(0x69cc20e0, 0xcd1b66bc), TOBN(0x9b670a37, 0xbbe0bfc8)}, + {TOBN(0xce53dc81, 0x28efbeed), TOBN(0x0c74e77c, 0x8326a6e5), + TOBN(0x3604e0d2, 0xb88e9a63), TOBN(0xbab38fca, 0x13dc2248)}}, + {{TOBN(0x8ed6e8c8, 0x5c0a3f1e), TOBN(0xbcad2492, 0x7c87c37f), + TOBN(0xfdfb62bb, 0x9ee3b78d), TOBN(0xeba8e477, 0xcbceba46)}, + {TOBN(0x37d38cb0, 0xeeaede4b), TOBN(0x0bc498e8, 0x7976deb6), + TOBN(0xb2944c04, 0x6b6147fb), TOBN(0x8b123f35, 0xf71f9609)}}, + {{TOBN(0xa155dcc7, 0xde79dc24), TOBN(0xf1168a32, 0x558f69cd), + TOBN(0xbac21595, 0x0d1850df), TOBN(0x15c8295b, 0xb204c848)}, + {TOBN(0xf661aa36, 0x7d8184ff), TOBN(0xc396228e, 0x30447bdb), + TOBN(0x11cd5143, 0xbde4a59e), TOBN(0xe3a26e3b, 0x6beab5e6)}}, + {{TOBN(0xd3b3a13f, 0x1402b9d0), TOBN(0x573441c3, 0x2c7bc863), + TOBN(0x4b301ec4, 0x578c3e6e), TOBN(0xc26fc9c4, 0x0adaf57e)}, + {TOBN(0x96e71bfd, 0x7493cea3), TOBN(0xd05d4b3f, 0x1af81456), + TOBN(0xdaca2a8a, 0x6a8c608f), TOBN(0x53ef07f6, 0x0725b276)}}, + {{TOBN(0x07a5fbd2, 0x7824fc56), TOBN(0x34675218, 0x13289077), + TOBN(0x5bf69fd5, 0xe0c48349), TOBN(0xa613ddd3, 0xb6aa7875)}, + {TOBN(0x7f78c19c, 0x5450d866), TOBN(0x46f4409c, 0x8f84a481), + TOBN(0x9f1d1928, 0x90fce239), TOBN(0x016c4168, 0xb2ce44b9)}}, + {{TOBN(0xbae023f0, 0xc7435978), TOBN(0xb152c888, 0x20e30e19), + TOBN(0x9c241645, 0xe3fa6faf), TOBN(0x735d95c1, 0x84823e60)}, + {TOBN(0x03197573, 0x03955317), TOBN(0x0b4b02a9, 0xf03b4995), + TOBN(0x076bf559, 0x70274600), TOBN(0x32c5cc53, 0xaaf57508)}}, + {{TOBN(0xe8af6d1f, 0x60624129), TOBN(0xb7bc5d64, 0x9a5e2b5e), + TOBN(0x3814b048, 0x5f082d72), TOBN(0x76f267f2, 0xce19677a)}, + {TOBN(0x626c630f, 0xb36eed93), TOBN(0x55230cd7, 0x3bf56803), + TOBN(0x78837949, 0xce2736a0), TOBN(0x0d792d60, 0xaa6c55f1)}}, + {{TOBN(0x0318dbfd, 0xd5c7c5d2), TOBN(0xb38f8da7, 0x072b342d), + TOBN(0x3569bddc, 0x7b8de38a), TOBN(0xf25b5887, 0xa1c94842)}, + {TOBN(0xb2d5b284, 0x2946ad60), TOBN(0x854f29ad, 0xe9d1707e), + TOBN(0xaa5159dc, 0x2c6a4509), TOBN(0x899f94c0, 0x57189837)}}, + {{TOBN(0xcf6adc51, 0xf4a55b03), TOBN(0x261762de, 0x35e3b2d5), + TOBN(0x4cc43012, 0x04827b51), TOBN(0xcd22a113, 0xc6021442)}, + {TOBN(0xce2fd61a, 0x247c9569), TOBN(0x59a50973, 0xd152beca), + TOBN(0x6c835a11, 0x63a716d4), TOBN(0xc26455ed, 0x187dedcf)}}, + {{TOBN(0x27f536e0, 0x49ce89e7), TOBN(0x18908539, 0xcc890cb5), + TOBN(0x308909ab, 0xd83c2aa1), TOBN(0xecd3142b, 0x1ab73bd3)}, + {TOBN(0x6a85bf59, 0xb3f5ab84), TOBN(0x3c320a68, 0xf2bea4c6), + TOBN(0xad8dc538, 0x6da4541f), TOBN(0xeaf34eb0, 0xb7c41186)}}, + {{TOBN(0x1c780129, 0x977c97c4), TOBN(0x5ff9beeb, 0xc57eb9fa), + TOBN(0xa24d0524, 0xc822c478), TOBN(0xfd8eec2a, 0x461cd415)}, + {TOBN(0xfbde194e, 0xf027458c), TOBN(0xb4ff5319, 0x1d1be115), + TOBN(0x63f874d9, 0x4866d6f4), TOBN(0x35c75015, 0xb21ad0c9)}}, + {{TOBN(0xa6b5c9d6, 0x46ac49d2), TOBN(0x42c77c0b, 0x83137aa9), + TOBN(0x24d000fc, 0x68225a38), TOBN(0x0f63cfc8, 0x2fe1e907)}, + {TOBN(0x22d1b01b, 0xc6441f95), TOBN(0x7d38f719, 0xec8e448f), + TOBN(0x9b33fa5f, 0x787fb1ba), TOBN(0x94dcfda1, 0x190158df)}}, + {{TOBN(0xc47cb339, 0x5f6d4a09), TOBN(0x6b4f355c, 0xee52b826), + TOBN(0x3d100f5d, 0xf51b930a), TOBN(0xf4512fac, 0x9f668f69)}, + {TOBN(0x546781d5, 0x206c4c74), TOBN(0xd021d4d4, 0xcb4d2e48), + TOBN(0x494a54c2, 0xca085c2d), TOBN(0xf1dbaca4, 0x520850a8)}}, + {{TOBN(0x63c79326, 0x490a1aca), TOBN(0xcb64dd9c, 0x41526b02), + TOBN(0xbb772591, 0xa2979258), TOBN(0x3f582970, 0x48d97846)}, + {TOBN(0xd66b70d1, 0x7c213ba7), TOBN(0xc28febb5, 0xe8a0ced4), + TOBN(0x6b911831, 0xc10338c1), TOBN(0x0d54e389, 0xbf0126f3)}}, + {{TOBN(0x7048d460, 0x4af206ee), TOBN(0x786c88f6, 0x77e97cb9), + TOBN(0xd4375ae1, 0xac64802e), TOBN(0x469bcfe1, 0xd53ec11c)}, + {TOBN(0xfc9b340d, 0x47062230), TOBN(0xe743bb57, 0xc5b4a3ac), + TOBN(0xfe00b4aa, 0x59ef45ac), TOBN(0x29a4ef23, 0x59edf188)}}, + {{TOBN(0x40242efe, 0xb483689b), TOBN(0x2575d3f6, 0x513ac262), + TOBN(0xf30037c8, 0x0ca6db72), TOBN(0xc9fcce82, 0x98864be2)}, + {TOBN(0x84a112ff, 0x0149362d), TOBN(0x95e57582, 0x1c4ae971), + TOBN(0x1fa4b1a8, 0x945cf86c), TOBN(0x4525a734, 0x0b024a2f)}}, + {{TOBN(0xe76c8b62, 0x8f338360), TOBN(0x483ff593, 0x28edf32b), + TOBN(0x67e8e90a, 0x298b1aec), TOBN(0x9caab338, 0x736d9a21)}, + {TOBN(0x5c09d2fd, 0x66892709), TOBN(0x2496b4dc, 0xb55a1d41), + TOBN(0x93f5fb1a, 0xe24a4394), TOBN(0x08c75049, 0x6fa8f6c1)}}, + {{TOBN(0xcaead1c2, 0xc905d85f), TOBN(0xe9d7f790, 0x0733ae57), + TOBN(0x24c9a65c, 0xf07cdd94), TOBN(0x7389359c, 0xa4b55931)}, + {TOBN(0xf58709b7, 0x367e45f7), TOBN(0x1f203067, 0xcb7e7adc), + TOBN(0x82444bff, 0xc7b72818), TOBN(0x07303b35, 0xbaac8033)}}, + {{TOBN(0x1e1ee4e4, 0xd13b7ea1), TOBN(0xe6489b24, 0xe0e74180), + TOBN(0xa5f2c610, 0x7e70ef70), TOBN(0xa1655412, 0xbdd10894)}, + {TOBN(0x555ebefb, 0x7af4194e), TOBN(0x533c1c3c, 0x8e89bd9c), + TOBN(0x735b9b57, 0x89895856), TOBN(0x15fb3cd2, 0x567f5c15)}}, + {{TOBN(0x057fed45, 0x526f09fd), TOBN(0xe8a4f10c, 0x8128240a), + TOBN(0x9332efc4, 0xff2bfd8d), TOBN(0x214e77a0, 0xbd35aa31)}, + {TOBN(0x32896d73, 0x14faa40e), TOBN(0x767867ec, 0x01e5f186), + TOBN(0xc9adf8f1, 0x17a1813e), TOBN(0xcb6cda78, 0x54741795)}}, + {{TOBN(0xb7521b6d, 0x349d51aa), TOBN(0xf56b5a9e, 0xe3c7b8e9), + TOBN(0xc6f1e5c9, 0x32a096df), TOBN(0x083667c4, 0xa3635024)}, + {TOBN(0x365ea135, 0x18087f2f), TOBN(0xf1b8eaac, 0xd136e45d), + TOBN(0xc8a0e484, 0x73aec989), TOBN(0xd75a324b, 0x142c9259)}}, + {{TOBN(0xb7b4d001, 0x01dae185), TOBN(0x45434e0b, 0x9b7a94bc), + TOBN(0xf54339af, 0xfbd8cb0b), TOBN(0xdcc4569e, 0xe98ef49e)}, + {TOBN(0x7789318a, 0x09a51299), TOBN(0x81b4d206, 0xb2b025d8), + TOBN(0xf64aa418, 0xfae85792), TOBN(0x3e50258f, 0xacd7baf7)}}, + {{TOBN(0xdce84cdb, 0x2996864b), TOBN(0xa2e67089, 0x1f485fa4), + TOBN(0xb28b2bb6, 0x534c6a5a), TOBN(0x31a7ec6b, 0xc94b9d39)}, + {TOBN(0x1d217766, 0xd6bc20da), TOBN(0x4acdb5ec, 0x86761190), + TOBN(0x68726328, 0x73701063), TOBN(0x4d24ee7c, 0x2128c29b)}}, + {{TOBN(0xc072ebd3, 0xa19fd868), TOBN(0x612e481c, 0xdb8ddd3b), + TOBN(0xb4e1d754, 0x1a64d852), TOBN(0x00ef95ac, 0xc4c6c4ab)}, + {TOBN(0x1536d2ed, 0xaa0a6c46), TOBN(0x61294086, 0x43774790), + TOBN(0x54af25e8, 0x343fda10), TOBN(0x9ff9d98d, 0xfd25d6f2)}}, + {{TOBN(0x0746af7c, 0x468b8835), TOBN(0x977a31cb, 0x730ecea7), + TOBN(0xa5096b80, 0xc2cf4a81), TOBN(0xaa986833, 0x6458c37a)}, + {TOBN(0x6af29bf3, 0xa6bd9d34), TOBN(0x6a62fe9b, 0x33c5d854), + TOBN(0x50e6c304, 0xb7133b5e), TOBN(0x04b60159, 0x7d6e6848)}}, + {{TOBN(0x4cd296df, 0x5579bea4), TOBN(0x10e35ac8, 0x5ceedaf1), + TOBN(0x04c4c5fd, 0xe3bcc5b1), TOBN(0x95f9ee8a, 0x89412cf9)}, + {TOBN(0x2c9459ee, 0x82b6eb0f), TOBN(0x2e845765, 0x95c2aadd), + TOBN(0x774a84ae, 0xd327fcfe), TOBN(0xd8c93722, 0x0368d476)}}, + {{TOBN(0x0dbd5748, 0xf83e8a3b), TOBN(0xa579aa96, 0x8d2495f3), + TOBN(0x535996a0, 0xae496e9b), TOBN(0x07afbfe9, 0xb7f9bcc2)}, + {TOBN(0x3ac1dc6d, 0x5b7bd293), TOBN(0x3b592cff, 0x7022323d), + TOBN(0xba0deb98, 0x9c0a3e76), TOBN(0x18e78e9f, 0x4b197acb)}}, + {{TOBN(0x211cde10, 0x296c36ef), TOBN(0x7ee89672, 0x82c4da77), + TOBN(0xb617d270, 0xa57836da), TOBN(0xf0cd9c31, 0x9cb7560b)}, + {TOBN(0x01fdcbf7, 0xe455fe90), TOBN(0x3fb53cbb, 0x7e7334f3), + TOBN(0x781e2ea4, 0x4e7de4ec), TOBN(0x8adab3ad, 0x0b384fd0)}}, + {{TOBN(0x129eee2f, 0x53d64829), TOBN(0x7a471e17, 0xa261492b), + TOBN(0xe4f9adb9, 0xe4cb4a2c), TOBN(0x3d359f6f, 0x97ba2c2d)}, + {TOBN(0x346c6786, 0x0aacd697), TOBN(0x92b444c3, 0x75c2f8a8), + TOBN(0xc79fa117, 0xd85df44e), TOBN(0x56782372, 0x398ddf31)}}, + {{TOBN(0x60e690f2, 0xbbbab3b8), TOBN(0x4851f8ae, 0x8b04816b), + TOBN(0xc72046ab, 0x9c92e4d2), TOBN(0x518c74a1, 0x7cf3136b)}, + {TOBN(0xff4eb50a, 0xf9877d4c), TOBN(0x14578d90, 0xa919cabb), + TOBN(0x8218f8c4, 0xac5eb2b6), TOBN(0xa3ccc547, 0x542016e4)}}, + {{TOBN(0x025bf48e, 0x327f8349), TOBN(0xf3e97346, 0xf43cb641), + TOBN(0xdc2bafdf, 0x500f1085), TOBN(0x57167876, 0x2f063055)}, + {TOBN(0x5bd914b9, 0x411925a6), TOBN(0x7c078d48, 0xa1123de5), + TOBN(0xee6bf835, 0x182b165d), TOBN(0xb11b5e5b, 0xba519727)}}, + {{TOBN(0xe33ea76c, 0x1eea7b85), TOBN(0x2352b461, 0x92d4f85e), + TOBN(0xf101d334, 0xafe115bb), TOBN(0xfabc1294, 0x889175a3)}, + {TOBN(0x7f6bcdc0, 0x5233f925), TOBN(0xe0a802db, 0xe77fec55), + TOBN(0xbdb47b75, 0x8069b659), TOBN(0x1c5e12de, 0xf98fbd74)}}, + {{TOBN(0x869c58c6, 0x4b8457ee), TOBN(0xa5360f69, 0x4f7ea9f7), + TOBN(0xe576c09f, 0xf460b38f), TOBN(0x6b70d548, 0x22b7fb36)}, + {TOBN(0x3fd237f1, 0x3bfae315), TOBN(0x33797852, 0xcbdff369), + TOBN(0x97df25f5, 0x25b516f9), TOBN(0x46f388f2, 0xba38ad2d)}}, + {{TOBN(0x656c4658, 0x89d8ddbb), TOBN(0x8830b26e, 0x70f38ee8), + TOBN(0x4320fd5c, 0xde1212b0), TOBN(0xc34f30cf, 0xe4a2edb2)}, + {TOBN(0xabb131a3, 0x56ab64b8), TOBN(0x7f77f0cc, 0xd99c5d26), + TOBN(0x66856a37, 0xbf981d94), TOBN(0x19e76d09, 0x738bd76e)}}, + {{TOBN(0xe76c8ac3, 0x96238f39), TOBN(0xc0a482be, 0xa830b366), + TOBN(0xb7b8eaff, 0x0b4eb499), TOBN(0x8ecd83bc, 0x4bfb4865)}, + {TOBN(0x971b2cb7, 0xa2f3776f), TOBN(0xb42176a4, 0xf4b88adf), + TOBN(0xb9617df5, 0xbe1fa446), TOBN(0x8b32d508, 0xcd031bd2)}}, + {{TOBN(0x1c6bd47d, 0x53b618c0), TOBN(0xc424f46c, 0x6a227923), + TOBN(0x7303ffde, 0xdd92d964), TOBN(0xe9712878, 0x71b5abf2)}, + {TOBN(0x8f48a632, 0xf815561d), TOBN(0x85f48ff5, 0xd3c055d1), + TOBN(0x222a1427, 0x7525684f), TOBN(0xd0d841a0, 0x67360cc3)}}, + {{TOBN(0x4245a926, 0x0b9267c6), TOBN(0xc78913f1, 0xcf07f863), + TOBN(0xaa844c8e, 0x4d0d9e24), TOBN(0xa42ad522, 0x3d5f9017)}, + {TOBN(0xbd371749, 0xa2c989d5), TOBN(0x928292df, 0xe1f5e78e), + TOBN(0x493b383e, 0x0a1ea6da), TOBN(0x5136fd8d, 0x13aee529)}}, + {{TOBN(0x860c44b1, 0xf2c34a99), TOBN(0x3b00aca4, 0xbf5855ac), + TOBN(0xabf6aaa0, 0xfaaf37be), TOBN(0x65f43682, 0x2a53ec08)}, + {TOBN(0x1d9a5801, 0xa11b12e1), TOBN(0x78a7ab2c, 0xe20ed475), + TOBN(0x0de1067e, 0x9a41e0d5), TOBN(0x30473f5f, 0x305023ea)}}, + {{TOBN(0xdd3ae09d, 0x169c7d97), TOBN(0x5cd5baa4, 0xcfaef9cd), + TOBN(0x5cd7440b, 0x65a44803), TOBN(0xdc13966a, 0x47f364de)}, + {TOBN(0x077b2be8, 0x2b8357c1), TOBN(0x0cb1b4c5, 0xe9d57c2a), + TOBN(0x7a4ceb32, 0x05ff363e), TOBN(0xf310fa4d, 0xca35a9ef)}}, + {{TOBN(0xdbb7b352, 0xf97f68c6), TOBN(0x0c773b50, 0x0b02cf58), + TOBN(0xea2e4821, 0x3c1f96d9), TOBN(0xffb357b0, 0xeee01815)}, + {TOBN(0xb9c924cd, 0xe0f28039), TOBN(0x0b36c95a, 0x46a3fbe4), + TOBN(0x1faaaea4, 0x5e46db6c), TOBN(0xcae575c3, 0x1928aaff)}}, + {{TOBN(0x7f671302, 0xa70dab86), TOBN(0xfcbd12a9, 0x71c58cfc), + TOBN(0xcbef9acf, 0xbee0cb92), TOBN(0x573da0b9, 0xf8c1b583)}, + {TOBN(0x4752fcfe, 0x0d41d550), TOBN(0xe7eec0e3, 0x2155cffe), + TOBN(0x0fc39fcb, 0x545ae248), TOBN(0x522cb8d1, 0x8065f44e)}}, + {{TOBN(0x263c962a, 0x70cbb96c), TOBN(0xe034362a, 0xbcd124a9), + TOBN(0xf120db28, 0x3c2ae58d), TOBN(0xb9a38d49, 0xfef6d507)}, + {TOBN(0xb1fd2a82, 0x1ff140fd), TOBN(0xbd162f30, 0x20aee7e0), + TOBN(0x4e17a5d4, 0xcb251949), TOBN(0x2aebcb83, 0x4f7e1c3d)}}, + {{TOBN(0x608eb25f, 0x937b0527), TOBN(0xf42e1e47, 0xeb7d9997), + TOBN(0xeba699c4, 0xb8a53a29), TOBN(0x1f921c71, 0xe091b536)}, + {TOBN(0xcce29e7b, 0x5b26bbd5), TOBN(0x7a8ef5ed, 0x3b61a680), + TOBN(0xe5ef8043, 0xba1f1c7e), TOBN(0x16ea8217, 0x18158dda)}}, + {{TOBN(0x01778a2b, 0x599ff0f9), TOBN(0x68a923d7, 0x8104fc6b), + TOBN(0x5bfa44df, 0xda694ff3), TOBN(0x4f7199db, 0xf7667f12)}, + {TOBN(0xc06d8ff6, 0xe46f2a79), TOBN(0x08b5dead, 0xe9f8131d), + TOBN(0x02519a59, 0xabb4ce7c), TOBN(0xc4f710bc, 0xb42aec3e)}}, + {{TOBN(0x3d77b057, 0x78bde41a), TOBN(0x6474bf80, 0xb4186b5a), + TOBN(0x048b3f67, 0x88c65741), TOBN(0xc64519de, 0x03c7c154)}, + {TOBN(0xdf073846, 0x0edfcc4f), TOBN(0x319aa737, 0x48f1aa6b), + TOBN(0x8b9f8a02, 0xca909f77), TOBN(0x90258139, 0x7580bfef)}}, + {{TOBN(0xd8bfd3ca, 0xc0c22719), TOBN(0xc60209e4, 0xc9ca151e), + TOBN(0x7a744ab5, 0xd9a1a69c), TOBN(0x6de5048b, 0x14937f8f)}, + {TOBN(0x171938d8, 0xe115ac04), TOBN(0x7df70940, 0x1c6b16d2), + TOBN(0xa6aeb663, 0x7f8e94e7), TOBN(0xc130388e, 0x2a2cf094)}}, + {{TOBN(0x1850be84, 0x77f54e6e), TOBN(0x9f258a72, 0x65d60fe5), + TOBN(0xff7ff0c0, 0x6c9146d6), TOBN(0x039aaf90, 0xe63a830b)}, + {TOBN(0x38f27a73, 0x9460342f), TOBN(0x4703148c, 0x3f795f8a), + TOBN(0x1bb5467b, 0x9681a97e), TOBN(0x00931ba5, 0xecaeb594)}}, + {{TOBN(0xcdb6719d, 0x786f337c), TOBN(0xd9c01cd2, 0xe704397d), + TOBN(0x0f4a3f20, 0x555c2fef), TOBN(0x00452509, 0x7c0af223)}, + {TOBN(0x54a58047, 0x84db8e76), TOBN(0x3bacf1aa, 0x93c8aa06), + TOBN(0x11ca957c, 0xf7919422), TOBN(0x50641053, 0x78cdaa40)}}, + {{TOBN(0x7a303874, 0x9f7144ae), TOBN(0x170c963f, 0x43d4acfd), + TOBN(0x5e148149, 0x58ddd3ef), TOBN(0xa7bde582, 0x9e72dba8)}, + {TOBN(0x0769da8b, 0x6fa68750), TOBN(0xfa64e532, 0x572e0249), + TOBN(0xfcaadf9d, 0x2619ad31), TOBN(0x87882daa, 0xa7b349cd)}}, + {{TOBN(0x9f6eb731, 0x6c67a775), TOBN(0xcb10471a, 0xefc5d0b1), + TOBN(0xb433750c, 0xe1b806b2), TOBN(0x19c5714d, 0x57b1ae7e)}, + {TOBN(0xc0dc8b7b, 0xed03fd3f), TOBN(0xdd03344f, 0x31bc194e), + TOBN(0xa66c52a7, 0x8c6320b5), TOBN(0x8bc82ce3, 0xd0b6fd93)}}, + {{TOBN(0xf8e13501, 0xb35f1341), TOBN(0xe53156dd, 0x25a43e42), + TOBN(0xd3adf27e, 0x4daeb85c), TOBN(0xb81d8379, 0xbbeddeb5)}, + {TOBN(0x1b0b546e, 0x2e435867), TOBN(0x9020eb94, 0xeba5dd60), + TOBN(0x37d91161, 0x8210cb9d), TOBN(0x4c596b31, 0x5c91f1cf)}}, + {{TOBN(0xb228a90f, 0x0e0b040d), TOBN(0xbaf02d82, 0x45ff897f), + TOBN(0x2aac79e6, 0x00fa6122), TOBN(0x24828817, 0x8e36f557)}, + {TOBN(0xb9521d31, 0x113ec356), TOBN(0x9e48861e, 0x15eff1f8), + TOBN(0x2aa1d412, 0xe0d41715), TOBN(0x71f86203, 0x53f131b8)}}, + {{TOBN(0xf60da8da, 0x3fd19408), TOBN(0x4aa716dc, 0x278d9d99), + TOBN(0x394531f7, 0xa8c51c90), TOBN(0xb560b0e8, 0xf59db51c)}, + {TOBN(0xa28fc992, 0xfa34bdad), TOBN(0xf024fa14, 0x9cd4f8bd), + TOBN(0x5cf530f7, 0x23a9d0d3), TOBN(0x615ca193, 0xe28c9b56)}}, + {{TOBN(0x6d2a483d, 0x6f73c51e), TOBN(0xa4cb2412, 0xea0dc2dd), + TOBN(0x50663c41, 0x1eb917ff), TOBN(0x3d3a74cf, 0xeade299e)}, + {TOBN(0x29b3990f, 0x4a7a9202), TOBN(0xa9bccf59, 0xa7b15c3d), + TOBN(0x66a3ccdc, 0xa5df9208), TOBN(0x48027c14, 0x43f2f929)}}, + {{TOBN(0xd385377c, 0x40b557f0), TOBN(0xe001c366, 0xcd684660), + TOBN(0x1b18ed6b, 0xe2183a27), TOBN(0x879738d8, 0x63210329)}, + {TOBN(0xa687c74b, 0xbda94882), TOBN(0xd1bbcc48, 0xa684b299), + TOBN(0xaf6f1112, 0x863b3724), TOBN(0x6943d1b4, 0x2c8ce9f8)}}, + {{TOBN(0xe044a3bb, 0x098cafb4), TOBN(0x27ed2310, 0x60d48caf), + TOBN(0x542b5675, 0x3a31b84d), TOBN(0xcbf3dd50, 0xfcddbed7)}, + {TOBN(0x25031f16, 0x41b1d830), TOBN(0xa7ec851d, 0xcb0c1e27), + TOBN(0xac1c8fe0, 0xb5ae75db), TOBN(0xb24c7557, 0x08c52120)}}, + {{TOBN(0x57f811dc, 0x1d4636c3), TOBN(0xf8436526, 0x681a9939), + TOBN(0x1f6bc6d9, 0x9c81adb3), TOBN(0x840f8ac3, 0x5b7d80d4)}, + {TOBN(0x731a9811, 0xf4387f1a), TOBN(0x7c501cd3, 0xb5156880), + TOBN(0xa5ca4a07, 0xdfe68867), TOBN(0xf123d8f0, 0x5fcea120)}}, + {{TOBN(0x1fbb0e71, 0xd607039e), TOBN(0x2b70e215, 0xcd3a4546), + TOBN(0x32d2f01d, 0x53324091), TOBN(0xb796ff08, 0x180ab19b)}, + {TOBN(0x32d87a86, 0x3c57c4aa), TOBN(0x2aed9caf, 0xb7c49a27), + TOBN(0x9fb35eac, 0x31630d98), TOBN(0x338e8cdf, 0x5c3e20a3)}}, + {{TOBN(0x80f16182, 0x66cde8db), TOBN(0x4e159980, 0x2d72fd36), + TOBN(0xd7b8f13b, 0x9b6e5072), TOBN(0xf5213907, 0x3b7b5dc1)}, + {TOBN(0x4d431f1d, 0x8ce4396e), TOBN(0x37a1a680, 0xa7ed2142), + TOBN(0xbf375696, 0xd01aaf6b), TOBN(0xaa1c0c54, 0xe63aab66)}}, + {{TOBN(0x3014368b, 0x4ed80940), TOBN(0x67e6d056, 0x7a6fcedd), + TOBN(0x7c208c49, 0xca97579f), TOBN(0xfe3d7a81, 0xa23597f6)}, + {TOBN(0x5e203202, 0x7e096ae2), TOBN(0xb1f3e1e7, 0x24b39366), + TOBN(0x26da26f3, 0x2fdcdffc), TOBN(0x79422f1d, 0x6097be83)}}}, + {{{TOBN(0x263a2cfb, 0x9db3b381), TOBN(0x9c3a2dee, 0xd4df0a4b), + TOBN(0x728d06e9, 0x7d04e61f), TOBN(0x8b1adfbc, 0x42449325)}, + {TOBN(0x6ec1d939, 0x7e053a1b), TOBN(0xee2be5c7, 0x66daf707), + TOBN(0x80ba1e14, 0x810ac7ab), TOBN(0xdd2ae778, 0xf530f174)}}, + {{TOBN(0x0435d97a, 0x205b9d8b), TOBN(0x6eb8f064, 0x056756d4), + TOBN(0xd5e88a8b, 0xb6f8210e), TOBN(0x070ef12d, 0xec9fd9ea)}, + {TOBN(0x4d849505, 0x3bcc876a), TOBN(0x12a75338, 0xa7404ce3), + TOBN(0xd22b49e1, 0xb8a1db5e), TOBN(0xec1f2051, 0x14bfa5ad)}}, + {{TOBN(0xadbaeb79, 0xb6828f36), TOBN(0x9d7a0258, 0x01bd5b9e), + TOBN(0xeda01e0d, 0x1e844b0c), TOBN(0x4b625175, 0x887edfc9)}, + {TOBN(0x14109fdd, 0x9669b621), TOBN(0x88a2ca56, 0xf6f87b98), + TOBN(0xfe2eb788, 0x170df6bc), TOBN(0x0cea06f4, 0xffa473f9)}}, + {{TOBN(0x43ed81b5, 0xc4e83d33), TOBN(0xd9f35879, 0x5efd488b), + TOBN(0x164a620f, 0x9deb4d0f), TOBN(0xc6927bdb, 0xac6a7394)}, + {TOBN(0x45c28df7, 0x9f9e0f03), TOBN(0x2868661e, 0xfcd7e1a9), + TOBN(0x7cf4e8d0, 0xffa348f1), TOBN(0x6bd4c284, 0x398538e0)}}, + {{TOBN(0x2618a091, 0x289a8619), TOBN(0xef796e60, 0x6671b173), + TOBN(0x664e46e5, 0x9090c632), TOBN(0xa38062d4, 0x1e66f8fb)}, + {TOBN(0x6c744a20, 0x0573274e), TOBN(0xd07b67e4, 0xa9271394), + TOBN(0x391223b2, 0x6bdc0e20), TOBN(0xbe2d93f1, 0xeb0a05a7)}}, + {{TOBN(0xf23e2e53, 0x3f36d141), TOBN(0xe84bb3d4, 0x4dfca442), + TOBN(0xb804a48d, 0x6b7c023a), TOBN(0x1e16a8fa, 0x76431c3b)}, + {TOBN(0x1b5452ad, 0xddd472e0), TOBN(0x7d405ee7, 0x0d1ee127), + TOBN(0x50fc6f1d, 0xffa27599), TOBN(0x351ac53c, 0xbf391b35)}}, + {{TOBN(0x7efa14b8, 0x4444896b), TOBN(0x64974d2f, 0xf94027fb), + TOBN(0xefdcd0e8, 0xde84487d), TOBN(0x8c45b260, 0x2b48989b)}, + {TOBN(0xa8fcbbc2, 0xd8463487), TOBN(0xd1b2b3f7, 0x3fbc476c), + TOBN(0x21d005b7, 0xc8f443c0), TOBN(0x518f2e67, 0x40c0139c)}}, + {{TOBN(0x56036e8c, 0x06d75fc1), TOBN(0x2dcf7bb7, 0x3249a89f), + TOBN(0x81dd1d3d, 0xe245e7dd), TOBN(0xf578dc4b, 0xebd6e2a7)}, + {TOBN(0x4c028903, 0xdf2ce7a0), TOBN(0xaee36288, 0x9c39afac), + TOBN(0xdc847c31, 0x146404ab), TOBN(0x6304c0d8, 0xa4e97818)}}, + {{TOBN(0xae51dca2, 0xa91f6791), TOBN(0x2abe4190, 0x9baa9efc), + TOBN(0xd9d2e2f4, 0x559c7ac1), TOBN(0xe82f4b51, 0xfc9f773a)}, + {TOBN(0xa7713027, 0x4073e81c), TOBN(0xc0276fac, 0xfbb596fc), + TOBN(0x1d819fc9, 0xa684f70c), TOBN(0x29b47fdd, 0xc9f7b1e0)}}, + {{TOBN(0x358de103, 0x459b1940), TOBN(0xec881c59, 0x5b013e93), + TOBN(0x51574c93, 0x49532ad3), TOBN(0x2db1d445, 0xb37b46de)}, + {TOBN(0xc6445b87, 0xdf239fd8), TOBN(0xc718af75, 0x151d24ee), + TOBN(0xaea1c4a4, 0xf43c6259), TOBN(0x40c0e5d7, 0x70be02f7)}}, + {{TOBN(0x6a4590f4, 0x721b33f2), TOBN(0x2124f1fb, 0xfedf04ea), + TOBN(0xf8e53cde, 0x9745efe7), TOBN(0xe7e10432, 0x65f046d9)}, + {TOBN(0xc3fca28e, 0xe4d0c7e6), TOBN(0x847e339a, 0x87253b1b), + TOBN(0x9b595348, 0x3743e643), TOBN(0xcb6a0a0b, 0x4fd12fc5)}}, + {{TOBN(0xfb6836c3, 0x27d02dcc), TOBN(0x5ad00982, 0x7a68bcc2), + TOBN(0x1b24b44c, 0x005e912d), TOBN(0xcc83d20f, 0x811fdcfe)}, + {TOBN(0x36527ec1, 0x666fba0c), TOBN(0x69948197, 0x14754635), + TOBN(0xfcdcb1a8, 0x556da9c2), TOBN(0xa5934267, 0x81a732b2)}}, + {{TOBN(0xec1214ed, 0xa714181d), TOBN(0x609ac13b, 0x6067b341), + TOBN(0xff4b4c97, 0xa545df1f), TOBN(0xa1240501, 0x34d2076b)}, + {TOBN(0x6efa0c23, 0x1409ca97), TOBN(0x254cc1a8, 0x20638c43), + TOBN(0xd4e363af, 0xdcfb46cd), TOBN(0x62c2adc3, 0x03942a27)}}, + {{TOBN(0xc67b9df0, 0x56e46483), TOBN(0xa55abb20, 0x63736356), + TOBN(0xab93c098, 0xc551bc52), TOBN(0x382b49f9, 0xb15fe64b)}, + {TOBN(0x9ec221ad, 0x4dff8d47), TOBN(0x79caf615, 0x437df4d6), + TOBN(0x5f13dc64, 0xbb456509), TOBN(0xe4c589d9, 0x191f0714)}}, + {{TOBN(0x27b6a8ab, 0x3fd40e09), TOBN(0xe455842e, 0x77313ea9), + TOBN(0x8b51d1e2, 0x1f55988b), TOBN(0x5716dd73, 0x062bbbfc)}, + {TOBN(0x633c11e5, 0x4e8bf3de), TOBN(0x9a0e77b6, 0x1b85be3b), + TOBN(0x56510729, 0x0911cca6), TOBN(0x27e76495, 0xefa6590f)}}, + {{TOBN(0xe4ac8b33, 0x070d3aab), TOBN(0x2643672b, 0x9a2cd5e5), + TOBN(0x52eff79b, 0x1cfc9173), TOBN(0x665ca49b, 0x90a7c13f)}, + {TOBN(0x5a8dda59, 0xb3efb998), TOBN(0x8a5b922d, 0x052f1341), + TOBN(0xae9ebbab, 0x3cf9a530), TOBN(0x35986e7b, 0xf56da4d7)}}, + {{TOBN(0x3a636b5c, 0xff3513cc), TOBN(0xbb0cf8ba, 0x3198f7dd), + TOBN(0xb8d40522, 0x41f16f86), TOBN(0x760575d8, 0xde13a7bf)}, + {TOBN(0x36f74e16, 0x9f7aa181), TOBN(0x163a3ecf, 0xf509ed1c), + TOBN(0x6aead61f, 0x3c40a491), TOBN(0x158c95fc, 0xdfe8fcaa)}}, + {{TOBN(0xa3991b6e, 0x13cda46f), TOBN(0x79482415, 0x342faed0), + TOBN(0xf3ba5bde, 0x666b5970), TOBN(0x1d52e6bc, 0xb26ab6dd)}, + {TOBN(0x768ba1e7, 0x8608dd3d), TOBN(0x4930db2a, 0xea076586), + TOBN(0xd9575714, 0xe7dc1afa), TOBN(0x1fc7bf7d, 0xf7c58817)}}, + {{TOBN(0x6b47accd, 0xd9eee96c), TOBN(0x0ca277fb, 0xe58cec37), + TOBN(0x113fe413, 0xe702c42a), TOBN(0xdd1764ee, 0xc47cbe51)}, + {TOBN(0x041e7cde, 0x7b3ed739), TOBN(0x50cb7459, 0x5ce9e1c0), + TOBN(0x35568513, 0x2925b212), TOBN(0x7cff95c4, 0x001b081c)}}, + {{TOBN(0x63ee4cbd, 0x8088b454), TOBN(0xdb7f32f7, 0x9a9e0c8a), + TOBN(0xb377d418, 0x6b2447cb), TOBN(0xe3e982aa, 0xd370219b)}, + {TOBN(0x06ccc1e4, 0xc2a2a593), TOBN(0x72c36865, 0x0773f24f), + TOBN(0xa13b4da7, 0x95859423), TOBN(0x8bbf1d33, 0x75040c8f)}}, + {{TOBN(0x726f0973, 0xda50c991), TOBN(0x48afcd5b, 0x822d6ee2), + TOBN(0xe5fc718b, 0x20fd7771), TOBN(0xb9e8e77d, 0xfd0807a1)}, + {TOBN(0x7f5e0f44, 0x99a7703d), TOBN(0x6972930e, 0x618e36f3), + TOBN(0x2b7c77b8, 0x23807bbe), TOBN(0xe5b82405, 0xcb27ff50)}}, + {{TOBN(0xba8b8be3, 0xbd379062), TOBN(0xd64b7a1d, 0x2dce4a92), + TOBN(0x040a73c5, 0xb2952e37), TOBN(0x0a9e252e, 0xd438aeca)}, + {TOBN(0xdd43956b, 0xc39d3bcb), TOBN(0x1a31ca00, 0xb32b2d63), + TOBN(0xd67133b8, 0x5c417a18), TOBN(0xd08e4790, 0x2ef442c8)}}, + {{TOBN(0x98cb1ae9, 0x255c0980), TOBN(0x4bd86381, 0x2b4a739f), + TOBN(0x5a5c31e1, 0x1e4a45a1), TOBN(0x1e5d55fe, 0x9cb0db2f)}, + {TOBN(0x74661b06, 0x8ff5cc29), TOBN(0x026b389f, 0x0eb8a4f4), + TOBN(0x536b21a4, 0x58848c24), TOBN(0x2e5bf8ec, 0x81dc72b0)}}, + {{TOBN(0x03c187d0, 0xad886aac), TOBN(0x5c16878a, 0xb771b645), + TOBN(0xb07dfc6f, 0xc74045ab), TOBN(0x2c6360bf, 0x7800caed)}, + {TOBN(0x24295bb5, 0xb9c972a3), TOBN(0xc9e6f88e, 0x7c9a6dba), + TOBN(0x90ffbf24, 0x92a79aa6), TOBN(0xde29d50a, 0x41c26ac2)}}, + {{TOBN(0x9f0af483, 0xd309cbe6), TOBN(0x5b020d8a, 0xe0bced4f), + TOBN(0x606e986d, 0xb38023e3), TOBN(0xad8f2c9d, 0x1abc6933)}, + {TOBN(0x19292e1d, 0xe7400e93), TOBN(0xfe3e18a9, 0x52be5e4d), + TOBN(0xe8e9771d, 0x2e0680bf), TOBN(0x8c5bec98, 0xc54db063)}}, + {{TOBN(0x2af9662a, 0x74a55d1f), TOBN(0xe3fbf28f, 0x046f66d8), + TOBN(0xa3a72ab4, 0xd4dc4794), TOBN(0x09779f45, 0x5c7c2dd8)}, + {TOBN(0xd893bdaf, 0xc3d19d8d), TOBN(0xd5a75094, 0x57d6a6df), + TOBN(0x8cf8fef9, 0x952e6255), TOBN(0x3da67cfb, 0xda9a8aff)}}, + {{TOBN(0x4c23f62a, 0x2c160dcd), TOBN(0x34e6c5e3, 0x8f90eaef), + TOBN(0x35865519, 0xa9a65d5a), TOBN(0x07c48aae, 0x8fd38a3d)}, + {TOBN(0xb7e7aeda, 0x50068527), TOBN(0x2c09ef23, 0x1c90936a), + TOBN(0x31ecfeb6, 0xe879324c), TOBN(0xa0871f6b, 0xfb0ec938)}}, + {{TOBN(0xb1f0fb68, 0xd84d835d), TOBN(0xc90caf39, 0x861dc1e6), + TOBN(0x12e5b046, 0x7594f8d7), TOBN(0x26897ae2, 0x65012b92)}, + {TOBN(0xbcf68a08, 0xa4d6755d), TOBN(0x403ee41c, 0x0991fbda), + TOBN(0x733e343e, 0x3bbf17e8), TOBN(0xd2c7980d, 0x679b3d65)}}, + {{TOBN(0x33056232, 0xd2e11305), TOBN(0x966be492, 0xf3c07a6f), + TOBN(0x6a8878ff, 0xbb15509d), TOBN(0xff221101, 0x0a9b59a4)}, + {TOBN(0x6c9f564a, 0xabe30129), TOBN(0xc6f2c940, 0x336e64cf), + TOBN(0x0fe75262, 0x8b0c8022), TOBN(0xbe0267e9, 0x6ae8db87)}}, + {{TOBN(0x22e192f1, 0x93bc042b), TOBN(0xf085b534, 0xb237c458), + TOBN(0xa0d192bd, 0x832c4168), TOBN(0x7a76e9e3, 0xbdf6271d)}, + {TOBN(0x52a882fa, 0xb88911b5), TOBN(0xc85345e4, 0xb4db0eb5), + TOBN(0xa3be02a6, 0x81a7c3ff), TOBN(0x51889c8c, 0xf0ec0469)}}, + {{TOBN(0x9d031369, 0xa5e829e5), TOBN(0xcbb4c6fc, 0x1607aa41), + TOBN(0x75ac59a6, 0x241d84c1), TOBN(0xc043f2bf, 0x8829e0ee)}, + {TOBN(0x82a38f75, 0x8ea5e185), TOBN(0x8bda40b9, 0xd87cbd9f), + TOBN(0x9e65e75e, 0x2d8fc601), TOBN(0x3d515f74, 0xa35690b3)}}, + {{TOBN(0x534acf4f, 0xda79e5ac), TOBN(0x68b83b3a, 0x8630215f), + TOBN(0x5c748b2e, 0xd085756e), TOBN(0xb0317258, 0xe5d37cb2)}, + {TOBN(0x6735841a, 0xc5ccc2c4), TOBN(0x7d7dc96b, 0x3d9d5069), + TOBN(0xa147e410, 0xfd1754bd), TOBN(0x65296e94, 0xd399ddd5)}}, + {{TOBN(0xf6b5b2d0, 0xbc8fa5bc), TOBN(0x8a5ead67, 0x500c277b), + TOBN(0x214625e6, 0xdfa08a5d), TOBN(0x51fdfedc, 0x959cf047)}, + {TOBN(0x6bc9430b, 0x289fca32), TOBN(0xe36ff0cf, 0x9d9bdc3f), + TOBN(0x2fe187cb, 0x58ea0ede), TOBN(0xed66af20, 0x5a900b3f)}}, + {{TOBN(0x00e0968b, 0x5fa9f4d6), TOBN(0x2d4066ce, 0x37a362e7), + TOBN(0xa99a9748, 0xbd07e772), TOBN(0x710989c0, 0x06a4f1d0)}, + {TOBN(0xd5dedf35, 0xce40cbd8), TOBN(0xab55c5f0, 0x1743293d), + TOBN(0x766f1144, 0x8aa24e2c), TOBN(0x94d874f8, 0x605fbcb4)}}, + {{TOBN(0xa365f0e8, 0xa518001b), TOBN(0xee605eb6, 0x9d04ef0f), + TOBN(0x5a3915cd, 0xba8d4d25), TOBN(0x44c0e1b8, 0xb5113472)}, + {TOBN(0xcbb024e8, 0x8b6740dc), TOBN(0x89087a53, 0xee1d4f0c), + TOBN(0xa88fa05c, 0x1fc4e372), TOBN(0x8bf395cb, 0xaf8b3af2)}}, + {{TOBN(0x1e71c9a1, 0xdeb8568b), TOBN(0xa35daea0, 0x80fb3d32), + TOBN(0xe8b6f266, 0x2cf8fb81), TOBN(0x6d51afe8, 0x9490696a)}, + {TOBN(0x81beac6e, 0x51803a19), TOBN(0xe3d24b7f, 0x86219080), + TOBN(0x727cfd9d, 0xdf6f463c), TOBN(0x8c6865ca, 0x72284ee8)}}, + {{TOBN(0x32c88b7d, 0xb743f4ef), TOBN(0x3793909b, 0xe7d11dce), + TOBN(0xd398f922, 0x2ff2ebe8), TOBN(0x2c70ca44, 0xe5e49796)}, + {TOBN(0xdf4d9929, 0xcb1131b1), TOBN(0x7826f298, 0x25888e79), + TOBN(0x4d3a112c, 0xf1d8740a), TOBN(0x00384cb6, 0x270afa8b)}}, + {{TOBN(0xcb64125b, 0x3ab48095), TOBN(0x3451c256, 0x62d05106), + TOBN(0xd73d577d, 0xa4955845), TOBN(0x39570c16, 0xbf9f4433)}, + {TOBN(0xd7dfaad3, 0xadecf263), TOBN(0xf1c3d8d1, 0xdc76e102), + TOBN(0x5e774a58, 0x54c6a836), TOBN(0xdad4b672, 0x3e92d47b)}}, + {{TOBN(0xbe7e990f, 0xf0d796a0), TOBN(0x5fc62478, 0xdf0e8b02), + TOBN(0x8aae8bf4, 0x030c00ad), TOBN(0x3d2db93b, 0x9004ba0f)}, + {TOBN(0xe48c8a79, 0xd85d5ddc), TOBN(0xe907caa7, 0x6bb07f34), + TOBN(0x58db343a, 0xa39eaed5), TOBN(0x0ea6e007, 0xadaf5724)}}, + {{TOBN(0xe00df169, 0xd23233f3), TOBN(0x3e322796, 0x77cb637f), + TOBN(0x1f897c0e, 0x1da0cf6c), TOBN(0xa651f5d8, 0x31d6bbdd)}, + {TOBN(0xdd61af19, 0x1a230c76), TOBN(0xbd527272, 0xcdaa5e4a), + TOBN(0xca753636, 0xd0abcd7e), TOBN(0x78bdd37c, 0x370bd8dc)}}, + {{TOBN(0xc23916c2, 0x17cd93fe), TOBN(0x65b97a4d, 0xdadce6e2), + TOBN(0xe04ed4eb, 0x174e42f8), TOBN(0x1491ccaa, 0xbb21480a)}, + {TOBN(0x145a8280, 0x23196332), TOBN(0x3c3862d7, 0x587b479a), + TOBN(0x9f4a88a3, 0x01dcd0ed), TOBN(0x4da2b7ef, 0x3ea12f1f)}}, + {{TOBN(0xf8e7ae33, 0xb126e48e), TOBN(0x404a0b32, 0xf494e237), + TOBN(0x9beac474, 0xc55acadb), TOBN(0x4ee5cf3b, 0xcbec9fd9)}, + {TOBN(0x336b33b9, 0x7df3c8c3), TOBN(0xbd905fe3, 0xb76808fd), + TOBN(0x8f436981, 0xaa45c16a), TOBN(0x255c5bfa, 0x3dd27b62)}}, + {{TOBN(0x71965cbf, 0xc3dd9b4d), TOBN(0xce23edbf, 0xfc068a87), + TOBN(0xb78d4725, 0x745b029b), TOBN(0x74610713, 0xcefdd9bd)}, + {TOBN(0x7116f75f, 0x1266bf52), TOBN(0x02046722, 0x18e49bb6), + TOBN(0xdf43df9f, 0x3d6f19e3), TOBN(0xef1bc7d0, 0xe685cb2f)}}, + {{TOBN(0xcddb27c1, 0x7078c432), TOBN(0xe1961b9c, 0xb77fedb7), + TOBN(0x1edc2f5c, 0xc2290570), TOBN(0x2c3fefca, 0x19cbd886)}, + {TOBN(0xcf880a36, 0xc2af389a), TOBN(0x96c610fd, 0xbda71cea), + TOBN(0xf03977a9, 0x32aa8463), TOBN(0x8eb7763f, 0x8586d90a)}}, + {{TOBN(0x3f342454, 0x2a296e77), TOBN(0xc8718683, 0x42837a35), + TOBN(0x7dc71090, 0x6a09c731), TOBN(0x54778ffb, 0x51b816db)}, + {TOBN(0x6b33bfec, 0xaf06defd), TOBN(0xfe3c105f, 0x8592b70b), + TOBN(0xf937fda4, 0x61da6114), TOBN(0x3c13e651, 0x4c266ad7)}}, + {{TOBN(0xe363a829, 0x855938e8), TOBN(0x2eeb5d9e, 0x9de54b72), + TOBN(0xbeb93b0e, 0x20ccfab9), TOBN(0x3dffbb5f, 0x25e61a25)}, + {TOBN(0x7f655e43, 0x1acc093d), TOBN(0x0cb6cc3d, 0x3964ce61), + TOBN(0x6ab283a1, 0xe5e9b460), TOBN(0x55d787c5, 0xa1c7e72d)}}, + {{TOBN(0x4d2efd47, 0xdeadbf02), TOBN(0x11e80219, 0xac459068), + TOBN(0x810c7626, 0x71f311f0), TOBN(0xfa17ef8d, 0x4ab6ef53)}, + {TOBN(0xaf47fd25, 0x93e43bff), TOBN(0x5cb5ff3f, 0x0be40632), + TOBN(0x54687106, 0x8ee61da3), TOBN(0x7764196e, 0xb08afd0f)}}, + {{TOBN(0x831ab3ed, 0xf0290a8f), TOBN(0xcae81966, 0xcb47c387), + TOBN(0xaad7dece, 0x184efb4f), TOBN(0xdcfc53b3, 0x4749110e)}, + {TOBN(0x6698f23c, 0x4cb632f9), TOBN(0xc42a1ad6, 0xb91f8067), + TOBN(0xb116a81d, 0x6284180a), TOBN(0xebedf5f8, 0xe901326f)}}, + {{TOBN(0xf2274c9f, 0x97e3e044), TOBN(0x42018520, 0x11d09fc9), + TOBN(0x56a65f17, 0xd18e6e23), TOBN(0x2ea61e2a, 0x352b683c)}, + {TOBN(0x27d291bc, 0x575eaa94), TOBN(0x9e7bc721, 0xb8ff522d), + TOBN(0x5f7268bf, 0xa7f04d6f), TOBN(0x5868c73f, 0xaba41748)}}, + {{TOBN(0x9f85c2db, 0x7be0eead), TOBN(0x511e7842, 0xff719135), + TOBN(0x5a06b1e9, 0xc5ea90d7), TOBN(0x0c19e283, 0x26fab631)}, + {TOBN(0x8af8f0cf, 0xe9206c55), TOBN(0x89389cb4, 0x3553c06a), + TOBN(0x39dbed97, 0xf65f8004), TOBN(0x0621b037, 0xc508991d)}}, + {{TOBN(0x1c52e635, 0x96e78cc4), TOBN(0x5385c8b2, 0x0c06b4a8), + TOBN(0xd84ddfdb, 0xb0e87d03), TOBN(0xc49dfb66, 0x934bafad)}, + {TOBN(0x7071e170, 0x59f70772), TOBN(0x3a073a84, 0x3a1db56b), + TOBN(0x03494903, 0x3b8af190), TOBN(0x7d882de3, 0xd32920f0)}}, + {{TOBN(0x91633f0a, 0xb2cf8940), TOBN(0x72b0b178, 0x6f948f51), + TOBN(0x2d28dc30, 0x782653c8), TOBN(0x88829849, 0xdb903a05)}, + {TOBN(0xb8095d0c, 0x6a19d2bb), TOBN(0x4b9e7f0c, 0x86f782cb), + TOBN(0x7af73988, 0x2d907064), TOBN(0xd12be0fe, 0x8b32643c)}}, + {{TOBN(0x358ed23d, 0x0e165dc3), TOBN(0x3d47ce62, 0x4e2378ce), + TOBN(0x7e2bb0b9, 0xfeb8a087), TOBN(0x3246e8ae, 0xe29e10b9)}, + {TOBN(0x459f4ec7, 0x03ce2b4d), TOBN(0xe9b4ca1b, 0xbbc077cf), + TOBN(0x2613b4f2, 0x0e9940c1), TOBN(0xfc598bb9, 0x047d1eb1)}}, + {{TOBN(0x9744c62b, 0x45036099), TOBN(0xa9dee742, 0x167c65d8), + TOBN(0x0c511525, 0xdabe1943), TOBN(0xda110554, 0x93c6c624)}, + {TOBN(0xae00a52c, 0x651a3be2), TOBN(0xcda5111d, 0x884449a6), + TOBN(0x063c06f4, 0xff33bed1), TOBN(0x73baaf9a, 0x0d3d76b4)}}, + {{TOBN(0x52fb0c9d, 0x7fc63668), TOBN(0x6886c9dd, 0x0c039cde), + TOBN(0x602bd599, 0x55b22351), TOBN(0xb00cab02, 0x360c7c13)}, + {TOBN(0x8cb616bc, 0x81b69442), TOBN(0x41486700, 0xb55c3cee), + TOBN(0x71093281, 0xf49ba278), TOBN(0xad956d9c, 0x64a50710)}}, + {{TOBN(0x9561f28b, 0x638a7e81), TOBN(0x54155cdf, 0x5980ddc3), + TOBN(0xb2db4a96, 0xd26f247a), TOBN(0x9d774e4e, 0x4787d100)}, + {TOBN(0x1a9e6e2e, 0x078637d2), TOBN(0x1c363e2d, 0x5e0ae06a), + TOBN(0x7493483e, 0xe9cfa354), TOBN(0x76843cb3, 0x7f74b98d)}}, + {{TOBN(0xbaca6591, 0xd4b66947), TOBN(0xb452ce98, 0x04460a8c), + TOBN(0x6830d246, 0x43768f55), TOBN(0xf4197ed8, 0x7dff12df)}, + {TOBN(0x6521b472, 0x400dd0f7), TOBN(0x59f5ca8f, 0x4b1e7093), + TOBN(0x6feff11b, 0x080338ae), TOBN(0x0ada31f6, 0xa29ca3c6)}}, + {{TOBN(0x24794eb6, 0x94a2c215), TOBN(0xd83a43ab, 0x05a57ab4), + TOBN(0x264a543a, 0x2a6f89fe), TOBN(0x2c2a3868, 0xdd5ec7c2)}, + {TOBN(0xd3373940, 0x8439d9b2), TOBN(0x715ea672, 0x0acd1f11), + TOBN(0x42c1d235, 0xe7e6cc19), TOBN(0x81ce6e96, 0xb990585c)}}, + {{TOBN(0x04e5dfe0, 0xd809c7bd), TOBN(0xd7b2580c, 0x8f1050ab), + TOBN(0x6d91ad78, 0xd8a4176f), TOBN(0x0af556ee, 0x4e2e897c)}, + {TOBN(0x162a8b73, 0x921de0ac), TOBN(0x52ac9c22, 0x7ea78400), + TOBN(0xee2a4eea, 0xefce2174), TOBN(0xbe61844e, 0x6d637f79)}}, + {{TOBN(0x0491f1bc, 0x789a283b), TOBN(0x72d3ac3d, 0x880836f4), + TOBN(0xaa1c5ea3, 0x88e5402d), TOBN(0x1b192421, 0xd5cc473d)}, + {TOBN(0x5c0b9998, 0x9dc84cac), TOBN(0xb0a8482d, 0x9c6e75b8), + TOBN(0x639961d0, 0x3a191ce2), TOBN(0xda3bc865, 0x6d837930)}}, + {{TOBN(0xca990653, 0x056e6f8f), TOBN(0x84861c41, 0x64d133a7), + TOBN(0x8b403276, 0x746abe40), TOBN(0xb7b4d51a, 0xebf8e303)}, + {TOBN(0x05b43211, 0x220a255d), TOBN(0xc997152c, 0x02419e6e), + TOBN(0x76ff47b6, 0x630c2fea), TOBN(0x50518677, 0x281fdade)}}, + {{TOBN(0x3283b8ba, 0xcf902b0b), TOBN(0x8d4b4eb5, 0x37db303b), + TOBN(0xcc89f42d, 0x755011bc), TOBN(0xb43d74bb, 0xdd09d19b)}, + {TOBN(0x65746bc9, 0x8adba350), TOBN(0x364eaf8c, 0xb51c1927), + TOBN(0x13c76596, 0x10ad72ec), TOBN(0x30045121, 0xf8d40c20)}}, + {{TOBN(0x6d2d99b7, 0xea7b979b), TOBN(0xcd78cd74, 0xe6fb3bcd), + TOBN(0x11e45a9e, 0x86cffbfe), TOBN(0x78a61cf4, 0x637024f6)}, + {TOBN(0xd06bc872, 0x3d502295), TOBN(0xf1376854, 0x458cb288), + TOBN(0xb9db26a1, 0x342f8586), TOBN(0xf33effcf, 0x4beee09e)}}, + {{TOBN(0xd7e0c4cd, 0xb30cfb3a), TOBN(0x6d09b8c1, 0x6c9db4c8), + TOBN(0x40ba1a42, 0x07c8d9df), TOBN(0x6fd495f7, 0x1c52c66d)}, + {TOBN(0xfb0e169f, 0x275264da), TOBN(0x80c2b746, 0xe57d8362), + TOBN(0xedd987f7, 0x49ad7222), TOBN(0xfdc229af, 0x4398ec7b)}}}, + {{{TOBN(0xb0d1ed84, 0x52666a58), TOBN(0x4bcb6e00, 0xe6a9c3c2), + TOBN(0x3c57411c, 0x26906408), TOBN(0xcfc20755, 0x13556400)}, + {TOBN(0xa08b1c50, 0x5294dba3), TOBN(0xa30ba286, 0x8b7dd31e), + TOBN(0xd70ba90e, 0x991eca74), TOBN(0x094e142c, 0xe762c2b9)}}, + {{TOBN(0xb81d783e, 0x979f3925), TOBN(0x1efd130a, 0xaf4c89a7), + TOBN(0x525c2144, 0xfd1bf7fa), TOBN(0x4b296904, 0x1b265a9e)}, + {TOBN(0xed8e9634, 0xb9db65b6), TOBN(0x35c82e32, 0x03599d8a), + TOBN(0xdaa7a54f, 0x403563f3), TOBN(0x9df088ad, 0x022c38ab)}}, + {{TOBN(0xe5cfb066, 0xbb3fd30a), TOBN(0x429169da, 0xeff0354e), + TOBN(0x809cf852, 0x3524e36c), TOBN(0x136f4fb3, 0x0155be1d)}, + {TOBN(0x4826af01, 0x1fbba712), TOBN(0x6ef0f0b4, 0x506ba1a1), + TOBN(0xd9928b31, 0x77aea73e), TOBN(0xe2bf6af2, 0x5eaa244e)}}, + {{TOBN(0x8d084f12, 0x4237b64b), TOBN(0x688ebe99, 0xe3ecfd07), + TOBN(0x57b8a70c, 0xf6845dd8), TOBN(0x808fc59c, 0x5da4a325)}, + {TOBN(0xa9032b2b, 0xa3585862), TOBN(0xb66825d5, 0xedf29386), + TOBN(0xb5a5a8db, 0x431ec29b), TOBN(0xbb143a98, 0x3a1e8dc8)}}, + {{TOBN(0x35ee94ce, 0x12ae381b), TOBN(0x3a7f176c, 0x86ccda90), + TOBN(0xc63a657e, 0x4606eaca), TOBN(0x9ae5a380, 0x43cd04df)}, + {TOBN(0x9bec8d15, 0xed251b46), TOBN(0x1f5d6d30, 0xcaca5e64), + TOBN(0x347b3b35, 0x9ff20f07), TOBN(0x4d65f034, 0xf7e4b286)}}, + {{TOBN(0x9e93ba24, 0xf111661e), TOBN(0xedced484, 0xb105eb04), + TOBN(0x96dc9ba1, 0xf424b578), TOBN(0xbf8f66b7, 0xe83e9069)}, + {TOBN(0x872d4df4, 0xd7ed8216), TOBN(0xbf07f377, 0x8e2cbecf), + TOBN(0x4281d899, 0x98e73754), TOBN(0xfec85fbb, 0x8aab8708)}}, + {{TOBN(0x9a3c0dee, 0xa5ba5b0b), TOBN(0xe6a116ce, 0x42d05299), + TOBN(0xae9775fe, 0xe9b02d42), TOBN(0x72b05200, 0xa1545cb6)}, + {TOBN(0xbc506f7d, 0x31a3b4ea), TOBN(0xe5893078, 0x8bbd9b32), + TOBN(0xc8bc5f37, 0xe4b12a97), TOBN(0x6b000c06, 0x4a73b671)}}, + {{TOBN(0x13b5bf22, 0x765fa7d0), TOBN(0x59805bf0, 0x1d6a5370), + TOBN(0x67a5e29d, 0x4280db98), TOBN(0x4f53916f, 0x776b1ce3)}, + {TOBN(0x714ff61f, 0x33ddf626), TOBN(0x4206238e, 0xa085d103), + TOBN(0x1c50d4b7, 0xe5809ee3), TOBN(0x999f450d, 0x85f8eb1d)}}, + {{TOBN(0x658a6051, 0xe4c79e9b), TOBN(0x1394cb73, 0xc66a9fea), + TOBN(0x27f31ed5, 0xc6be7b23), TOBN(0xf4c88f36, 0x5aa6f8fe)}, + {TOBN(0x0fb0721f, 0x4aaa499e), TOBN(0x68b3a7d5, 0xe3fb2a6b), + TOBN(0xa788097d, 0x3a92851d), TOBN(0x060e7f8a, 0xe96f4913)}}, + {{TOBN(0x82eebe73, 0x1a3a93bc), TOBN(0x42bbf465, 0xa21adc1a), + TOBN(0xc10b6fa4, 0xef030efd), TOBN(0x247aa4c7, 0x87b097bb)}, + {TOBN(0x8b8dc632, 0xf60c77da), TOBN(0x6ffbc26a, 0xc223523e), + TOBN(0xa4f6ff11, 0x344579cf), TOBN(0x5825653c, 0x980250f6)}}, + {{TOBN(0xb2dd097e, 0xbc1aa2b9), TOBN(0x07889393, 0x37a0333a), + TOBN(0x1cf55e71, 0x37a0db38), TOBN(0x2648487f, 0x792c1613)}, + {TOBN(0xdad01336, 0x3fcef261), TOBN(0x6239c81d, 0x0eabf129), + TOBN(0x8ee761de, 0x9d276be2), TOBN(0x406a7a34, 0x1eda6ad3)}}, + {{TOBN(0x4bf367ba, 0x4a493b31), TOBN(0x54f20a52, 0x9bf7f026), + TOBN(0xb696e062, 0x9795914b), TOBN(0xcddab96d, 0x8bf236ac)}, + {TOBN(0x4ff2c70a, 0xed25ea13), TOBN(0xfa1d09eb, 0x81cbbbe7), + TOBN(0x88fc8c87, 0x468544c5), TOBN(0x847a670d, 0x696b3317)}}, + {{TOBN(0xf133421e, 0x64bcb626), TOBN(0xaea638c8, 0x26dee0b5), + TOBN(0xd6e7680b, 0xb310346c), TOBN(0xe06f4097, 0xd5d4ced3)}, + {TOBN(0x09961452, 0x7512a30b), TOBN(0xf3d867fd, 0xe589a59a), + TOBN(0x2e73254f, 0x52d0c180), TOBN(0x9063d8a3, 0x333c74ac)}}, + {{TOBN(0xeda6c595, 0xd314e7bc), TOBN(0x2ee7464b, 0x467899ed), + TOBN(0x1cef423c, 0x0a1ed5d3), TOBN(0x217e76ea, 0x69cc7613)}, + {TOBN(0x27ccce1f, 0xe7cda917), TOBN(0x12d8016b, 0x8a893f16), + TOBN(0xbcd6de84, 0x9fc74f6b), TOBN(0xfa5817e2, 0xf3144e61)}}, + {{TOBN(0x1f354164, 0x0821ee4c), TOBN(0x1583eab4, 0x0bc61992), + TOBN(0x7490caf6, 0x1d72879f), TOBN(0x998ad9f3, 0xf76ae7b2)}, + {TOBN(0x1e181950, 0xa41157f7), TOBN(0xa9d7e1e6, 0xe8da3a7e), + TOBN(0x963784eb, 0x8426b95f), TOBN(0x0ee4ed6e, 0x542e2a10)}}, + {{TOBN(0xb79d4cc5, 0xac751e7b), TOBN(0x93f96472, 0xfd4211bd), + TOBN(0x8c72d3d2, 0xc8de4fc6), TOBN(0x7b69cbf5, 0xdf44f064)}, + {TOBN(0x3da90ca2, 0xf4bf94e1), TOBN(0x1a5325f8, 0xf12894e2), + TOBN(0x0a437f6c, 0x7917d60b), TOBN(0x9be70486, 0x96c9cb5d)}}, + {{TOBN(0xb4d880bf, 0xe1dc5c05), TOBN(0xd738adda, 0xeebeeb57), + TOBN(0x6f0119d3, 0xdf0fe6a3), TOBN(0x5c686e55, 0x66eaaf5a)}, + {TOBN(0x9cb10b50, 0xdfd0b7ec), TOBN(0xbdd0264b, 0x6a497c21), + TOBN(0xfc093514, 0x8c546c96), TOBN(0x58a947fa, 0x79dbf42a)}}, + {{TOBN(0xc0b48d4e, 0x49ccd6d7), TOBN(0xff8fb02c, 0x88bd5580), + TOBN(0xc75235e9, 0x07d473b2), TOBN(0x4fab1ac5, 0xa2188af3)}, + {TOBN(0x030fa3bc, 0x97576ec0), TOBN(0xe8c946e8, 0x0b7e7d2f), + TOBN(0x40a5c9cc, 0x70305600), TOBN(0x6d8260a9, 0xc8b013b4)}}, + {{TOBN(0x0368304f, 0x70bba85c), TOBN(0xad090da1, 0xa4a0d311), + TOBN(0x7170e870, 0x2415eec1), TOBN(0xbfba35fe, 0x8461ea47)}, + {TOBN(0x6279019a, 0xc1e91938), TOBN(0xa47638f3, 0x1afc415f), + TOBN(0x36c65cbb, 0xbcba0e0f), TOBN(0x02160efb, 0x034e2c48)}}, + {{TOBN(0xe6c51073, 0x615cd9e4), TOBN(0x498ec047, 0xf1243c06), + TOBN(0x3e5a8809, 0xb17b3d8c), TOBN(0x5cd99e61, 0x0cc565f1)}, + {TOBN(0x81e312df, 0x7851dafe), TOBN(0xf156f5ba, 0xa79061e2), + TOBN(0x80d62b71, 0x880c590e), TOBN(0xbec9746f, 0x0a39faa1)}}, + {{TOBN(0x1d98a9c1, 0xc8ed1f7a), TOBN(0x09e43bb5, 0xa81d5ff2), + TOBN(0xd5f00f68, 0x0da0794a), TOBN(0x412050d9, 0x661aa836)}, + {TOBN(0xa89f7c4e, 0x90747e40), TOBN(0x6dc05ebb, 0xb62a3686), + TOBN(0xdf4de847, 0x308e3353), TOBN(0x53868fbb, 0x9fb53bb9)}}, + {{TOBN(0x2b09d2c3, 0xcfdcf7dd), TOBN(0x41a9fce3, 0x723fcab4), + TOBN(0x73d905f7, 0x07f57ca3), TOBN(0x080f9fb1, 0xac8e1555)}, + {TOBN(0x7c088e84, 0x9ba7a531), TOBN(0x07d35586, 0xed9a147f), + TOBN(0x602846ab, 0xaf48c336), TOBN(0x7320fd32, 0x0ccf0e79)}}, + {{TOBN(0xaa780798, 0xb18bd1ff), TOBN(0x52c2e300, 0xafdd2905), + TOBN(0xf27ea3d6, 0x434267cd), TOBN(0x8b96d16d, 0x15605b5f)}, + {TOBN(0x7bb31049, 0x4b45706b), TOBN(0xe7f58b8e, 0x743d25f8), + TOBN(0xe9b5e45b, 0x87f30076), TOBN(0xd19448d6, 0x5d053d5a)}}, + {{TOBN(0x1ecc8cb9, 0xd3210a04), TOBN(0x6bc7d463, 0xdafb5269), + TOBN(0x3e59b10a, 0x67c3489f), TOBN(0x1769788c, 0x65641e1b)}, + {TOBN(0x8a53b82d, 0xbd6cb838), TOBN(0x7066d6e6, 0x236d5f22), + TOBN(0x03aa1c61, 0x6908536e), TOBN(0xc971da0d, 0x66ae9809)}}, + {{TOBN(0x01b3a86b, 0xc49a2fac), TOBN(0x3b8420c0, 0x3092e77a), + TOBN(0x02057300, 0x7d6fb556), TOBN(0x6941b2a1, 0xbff40a87)}, + {TOBN(0x140b6308, 0x0658ff2a), TOBN(0x87804363, 0x3424ab36), + TOBN(0x0253bd51, 0x5751e299), TOBN(0xc75bcd76, 0x449c3e3a)}}, + {{TOBN(0x92eb4090, 0x7f8f875d), TOBN(0x9c9d754e, 0x56c26bbf), + TOBN(0x158cea61, 0x8110bbe7), TOBN(0x62a6b802, 0x745f91ea)}, + {TOBN(0xa79c41aa, 0xc6e7394b), TOBN(0x445b6a83, 0xad57ef10), + TOBN(0x0c5277eb, 0x6ea6f40c), TOBN(0x319fe96b, 0x88633365)}}, + {{TOBN(0x0b0fc61f, 0x385f63cb), TOBN(0x41250c84, 0x22bdd127), + TOBN(0x67d153f1, 0x09e942c2), TOBN(0x60920d08, 0xc021ad5d)}, + {TOBN(0x229f5746, 0x724d81a5), TOBN(0xb7ffb892, 0x5bba3299), + TOBN(0x518c51a1, 0xde413032), TOBN(0x2a9bfe77, 0x3c2fd94c)}}, + {{TOBN(0xcbcde239, 0x3191f4fd), TOBN(0x43093e16, 0xd3d6ada1), + TOBN(0x184579f3, 0x58769606), TOBN(0x2c94a8b3, 0xd236625c)}, + {TOBN(0x6922b9c0, 0x5c437d8e), TOBN(0x3d4ae423, 0xd8d9f3c8), + TOBN(0xf72c31c1, 0x2e7090a2), TOBN(0x4ac3f5f3, 0xd76a55bd)}}, + {{TOBN(0x342508fc, 0x6b6af991), TOBN(0x0d527100, 0x1b5cebbd), + TOBN(0xb84740d0, 0xdd440dd7), TOBN(0x748ef841, 0x780162fd)}, + {TOBN(0xa8dbfe0e, 0xdfc6fafb), TOBN(0xeadfdf05, 0xf7300f27), + TOBN(0x7d06555f, 0xfeba4ec9), TOBN(0x12c56f83, 0x9e25fa97)}}, + {{TOBN(0x77f84203, 0xd39b8c34), TOBN(0xed8b1be6, 0x3125eddb), + TOBN(0x5bbf2441, 0xf6e39dc5), TOBN(0xb00f6ee6, 0x6a5d678a)}, + {TOBN(0xba456ecf, 0x57d0ea99), TOBN(0xdcae0f58, 0x17e06c43), + TOBN(0x01643de4, 0x0f5b4baa), TOBN(0x2c324341, 0xd161b9be)}}, + {{TOBN(0x80177f55, 0xe126d468), TOBN(0xed325f1f, 0x76748e09), + TOBN(0x6116004a, 0xcfa9bdc2), TOBN(0x2d8607e6, 0x3a9fb468)}, + {TOBN(0x0e573e27, 0x6009d660), TOBN(0x3a525d2e, 0x8d10c5a1), + TOBN(0xd26cb45c, 0x3b9009a0), TOBN(0xb6b0cdc0, 0xde9d7448)}}, + {{TOBN(0x949c9976, 0xe1337c26), TOBN(0x6faadebd, 0xd73d68e5), + TOBN(0x9e158614, 0xf1b768d9), TOBN(0x22dfa557, 0x9cc4f069)}, + {TOBN(0xccd6da17, 0xbe93c6d6), TOBN(0x24866c61, 0xa504f5b9), + TOBN(0x2121353c, 0x8d694da1), TOBN(0x1c6ca580, 0x0140b8c6)}}, + {{TOBN(0xc245ad8c, 0xe964021e), TOBN(0xb83bffba, 0x032b82b3), + TOBN(0xfaa220c6, 0x47ef9898), TOBN(0x7e8d3ac6, 0x982c948a)}, + {TOBN(0x1faa2091, 0xbc2d124a), TOBN(0xbd54c3dd, 0x05b15ff4), + TOBN(0x386bf3ab, 0xc87c6fb7), TOBN(0xfb2b0563, 0xfdeb6f66)}}, + {{TOBN(0x4e77c557, 0x5b45afb4), TOBN(0xe9ded649, 0xefb8912d), + TOBN(0x7ec9bbf5, 0x42f6e557), TOBN(0x2570dfff, 0x62671f00)}, + {TOBN(0x2b3bfb78, 0x88e084bd), TOBN(0xa024b238, 0xf37fe5b4), + TOBN(0x44e7dc04, 0x95649aee), TOBN(0x498ca255, 0x5e7ec1d8)}}, + {{TOBN(0x3bc766ea, 0xaaa07e86), TOBN(0x0db6facb, 0xf3608586), + TOBN(0xbadd2549, 0xbdc259c8), TOBN(0x95af3c6e, 0x041c649f)}, + {TOBN(0xb36a928c, 0x02e30afb), TOBN(0x9b5356ad, 0x008a88b8), + TOBN(0x4b67a5f1, 0xcf1d9e9d), TOBN(0xc6542e47, 0xa5d8d8ce)}}, + {{TOBN(0x73061fe8, 0x7adfb6cc), TOBN(0xcc826fd3, 0x98678141), + TOBN(0x00e758b1, 0x3c80515a), TOBN(0x6afe3247, 0x41485083)}, + {TOBN(0x0fcb08b9, 0xb6ae8a75), TOBN(0xb8cf388d, 0x4acf51e1), + TOBN(0x344a5560, 0x6961b9d6), TOBN(0x1a6778b8, 0x6a97fd0c)}}, + {{TOBN(0xd840fdc1, 0xecc4c7e3), TOBN(0xde9fe47d, 0x16db68cc), + TOBN(0xe95f89de, 0xa3e216aa), TOBN(0x84f1a6a4, 0x9594a8be)}, + {TOBN(0x7ddc7d72, 0x5a7b162b), TOBN(0xc5cfda19, 0xadc817a3), + TOBN(0x80a5d350, 0x78b58d46), TOBN(0x93365b13, 0x82978f19)}}, + {{TOBN(0x2e44d225, 0x26a1fc90), TOBN(0x0d6d10d2, 0x4d70705d), + TOBN(0xd94b6b10, 0xd70c45f4), TOBN(0x0f201022, 0xb216c079)}, + {TOBN(0xcec966c5, 0x658fde41), TOBN(0xa8d2bc7d, 0x7e27601d), + TOBN(0xbfcce3e1, 0xff230be7), TOBN(0x3394ff6b, 0x0033ffb5)}}, + {{TOBN(0xd890c509, 0x8132c9af), TOBN(0xaac4b0eb, 0x361e7868), + TOBN(0x5194ded3, 0xe82d15aa), TOBN(0x4550bd2e, 0x23ae6b7d)}, + {TOBN(0x3fda318e, 0xea5399d4), TOBN(0xd989bffa, 0x91638b80), + TOBN(0x5ea124d0, 0xa14aa12d), TOBN(0x1fb1b899, 0x3667b944)}}, + {{TOBN(0x95ec7969, 0x44c44d6a), TOBN(0x91df144a, 0x57e86137), + TOBN(0x915fd620, 0x73adac44), TOBN(0x8f01732d, 0x59a83801)}, + {TOBN(0xec579d25, 0x3aa0a633), TOBN(0x06de5e7c, 0xc9d6d59c), + TOBN(0xc132f958, 0xb1ef8010), TOBN(0x29476f96, 0xe65c1a02)}}, + {{TOBN(0x336a77c0, 0xd34c3565), TOBN(0xef1105b2, 0x1b9f1e9e), + TOBN(0x63e6d08b, 0xf9e08002), TOBN(0x9aff2f21, 0xc613809e)}, + {TOBN(0xb5754f85, 0x3a80e75d), TOBN(0xde71853e, 0x6bbda681), + TOBN(0x86f041df, 0x8197fd7a), TOBN(0x8b332e08, 0x127817fa)}}, + {{TOBN(0x05d99be8, 0xb9c20cda), TOBN(0x89f7aad5, 0xd5cd0c98), + TOBN(0x7ef936fe, 0x5bb94183), TOBN(0x92ca0753, 0xb05cd7f2)}, + {TOBN(0x9d65db11, 0x74a1e035), TOBN(0x02628cc8, 0x13eaea92), + TOBN(0xf2d9e242, 0x49e4fbf2), TOBN(0x94fdfd9b, 0xe384f8b7)}}, + {{TOBN(0x65f56054, 0x63428c6b), TOBN(0x2f7205b2, 0x90b409a5), + TOBN(0xf778bb78, 0xff45ae11), TOBN(0xa13045be, 0xc5ee53b2)}, + {TOBN(0xe00a14ff, 0x03ef77fe), TOBN(0x689cd59f, 0xffef8bef), + TOBN(0x3578f0ed, 0x1e9ade22), TOBN(0xe99f3ec0, 0x6268b6a8)}}, + {{TOBN(0xa2057d91, 0xea1b3c3e), TOBN(0x2d1a7053, 0xb8823a4a), + TOBN(0xabbb336a, 0x2cca451e), TOBN(0xcd2466e3, 0x2218bb5d)}, + {TOBN(0x3ac1f42f, 0xc8cb762d), TOBN(0x7e312aae, 0x7690211f), + TOBN(0xebb9bd73, 0x45d07450), TOBN(0x207c4b82, 0x46c2213f)}}, + {{TOBN(0x99d425c1, 0x375913ec), TOBN(0x94e45e96, 0x67908220), + TOBN(0xc08f3087, 0xcd67dbf6), TOBN(0xa5670fbe, 0xc0887056)}, + {TOBN(0x6717b64a, 0x66f5b8fc), TOBN(0xd5a56aea, 0x786fec28), + TOBN(0xa8c3f55f, 0xc0ff4952), TOBN(0xa77fefae, 0x457ac49b)}}, + {{TOBN(0x29882d7c, 0x98379d44), TOBN(0xd000bdfb, 0x509edc8a), + TOBN(0xc6f95979, 0xe66fe464), TOBN(0x504a6115, 0xfa61bde0)}, + {TOBN(0x56b3b871, 0xeffea31a), TOBN(0x2d3de26d, 0xf0c21a54), + TOBN(0x21dbff31, 0x834753bf), TOBN(0xe67ecf49, 0x69269d86)}}, + {{TOBN(0x7a176952, 0x151fe690), TOBN(0x03515804, 0x7f2adb5f), + TOBN(0xee794b15, 0xd1b62a8d), TOBN(0xf004ceec, 0xaae454e6)}, + {TOBN(0x0897ea7c, 0xf0386fac), TOBN(0x3b62ff12, 0xd1fca751), + TOBN(0x154181df, 0x1b7a04ec), TOBN(0x2008e04a, 0xfb5847ec)}}, + {{TOBN(0xd147148e, 0x41dbd772), TOBN(0x2b419f73, 0x22942654), + TOBN(0x669f30d3, 0xe9c544f7), TOBN(0x52a2c223, 0xc8540149)}, + {TOBN(0x5da9ee14, 0x634dfb02), TOBN(0x5f074ff0, 0xf47869f3), + TOBN(0x74ee878d, 0xa3933acc), TOBN(0xe6510651, 0x4fe35ed1)}}, + {{TOBN(0xb3eb9482, 0xf1012e7a), TOBN(0x51013cc0, 0xa8a566ae), + TOBN(0xdd5e9243, 0x47c00d3b), TOBN(0x7fde089d, 0x946bb0e5)}, + {TOBN(0x030754fe, 0xc731b4b3), TOBN(0x12a136a4, 0x99fda062), + TOBN(0x7c1064b8, 0x5a1a35bc), TOBN(0xbf1f5763, 0x446c84ef)}}, + {{TOBN(0xed29a56d, 0xa16d4b34), TOBN(0x7fba9d09, 0xdca21c4f), + TOBN(0x66d7ac00, 0x6d8de486), TOBN(0x60061987, 0x73a2a5e1)}, + {TOBN(0x8b400f86, 0x9da28ff0), TOBN(0x3133f708, 0x43c4599c), + TOBN(0x9911c9b8, 0xee28cb0d), TOBN(0xcd7e2874, 0x8e0af61d)}}, + {{TOBN(0x5a85f0f2, 0x72ed91fc), TOBN(0x85214f31, 0x9cd4a373), + TOBN(0x881fe5be, 0x1925253c), TOBN(0xd8dc98e0, 0x91e8bc76)}, + {TOBN(0x7120affe, 0x585cc3a2), TOBN(0x724952ed, 0x735bf97a), + TOBN(0x5581e7dc, 0x3eb34581), TOBN(0x5cbff4f2, 0xe52ee57d)}}, + {{TOBN(0x8d320a0e, 0x87d8cc7b), TOBN(0x9beaa7f3, 0xf1d280d0), + TOBN(0x7a0b9571, 0x9beec704), TOBN(0x9126332e, 0x5b7f0057)}, + {TOBN(0x01fbc1b4, 0x8ed3bd6d), TOBN(0x35bb2c12, 0xd945eb24), + TOBN(0x6404694e, 0x9a8ae255), TOBN(0xb6092eec, 0x8d6abfb3)}}, + {{TOBN(0x4d76143f, 0xcc058865), TOBN(0x7b0a5af2, 0x6e249922), + TOBN(0x8aef9440, 0x6a50d353), TOBN(0xe11e4bcc, 0x64f0e07a)}, + {TOBN(0x4472993a, 0xa14a90fa), TOBN(0x7706e20c, 0xba0c51d4), + TOBN(0xf403292f, 0x1532672d), TOBN(0x52573bfa, 0x21829382)}}, + {{TOBN(0x6a7bb6a9, 0x3b5bdb83), TOBN(0x08da65c0, 0xa4a72318), + TOBN(0xc58d22aa, 0x63eb065f), TOBN(0x1717596c, 0x1b15d685)}, + {TOBN(0x112df0d0, 0xb266d88b), TOBN(0xf688ae97, 0x5941945a), + TOBN(0x487386e3, 0x7c292cac), TOBN(0x42f3b50d, 0x57d6985c)}}, + {{TOBN(0x6da4f998, 0x6a90fc34), TOBN(0xc8f257d3, 0x65ca8a8d), + TOBN(0xc2feabca, 0x6951f762), TOBN(0xe1bc81d0, 0x74c323ac)}, + {TOBN(0x1bc68f67, 0x251a2a12), TOBN(0x10d86587, 0xbe8a70dc), + TOBN(0xd648af7f, 0xf0f84d2e), TOBN(0xf0aa9ebc, 0x6a43ac92)}}, + {{TOBN(0x69e3be04, 0x27596893), TOBN(0xb6bb02a6, 0x45bf452b), + TOBN(0x0875c11a, 0xf4c698c8), TOBN(0x6652b5c7, 0xbece3794)}, + {TOBN(0x7b3755fd, 0x4f5c0499), TOBN(0x6ea16558, 0xb5532b38), + TOBN(0xd1c69889, 0xa2e96ef7), TOBN(0x9c773c3a, 0x61ed8f48)}}, + {{TOBN(0x2b653a40, 0x9b323abc), TOBN(0xe26605e1, 0xf0e1d791), + TOBN(0x45d41064, 0x4a87157a), TOBN(0x8f9a78b7, 0xcbbce616)}, + {TOBN(0xcf1e44aa, 0xc407eddd), TOBN(0x81ddd1d8, 0xa35b964f), + TOBN(0x473e339e, 0xfd083999), TOBN(0x6c94bdde, 0x8e796802)}}, + {{TOBN(0x5a304ada, 0x8545d185), TOBN(0x82ae44ea, 0x738bb8cb), + TOBN(0x628a35e3, 0xdf87e10e), TOBN(0xd3624f3d, 0xa15b9fe3)}, + {TOBN(0xcc44209b, 0x14be4254), TOBN(0x7d0efcbc, 0xbdbc2ea5), + TOBN(0x1f603362, 0x04c37bbe), TOBN(0x21f363f5, 0x56a5852c)}}, + {{TOBN(0xa1503d1c, 0xa8501550), TOBN(0x2251e0e1, 0xd8ab10bb), + TOBN(0xde129c96, 0x6961c51c), TOBN(0x1f7246a4, 0x81910f68)}, + {TOBN(0x2eb744ee, 0x5f2591f2), TOBN(0x3c47d33f, 0x5e627157), + TOBN(0x4d6d62c9, 0x22f3bd68), TOBN(0x6120a64b, 0xcb8df856)}}, + {{TOBN(0x3a9ac6c0, 0x7b5d07df), TOBN(0xa92b9558, 0x7ef39783), + TOBN(0xe128a134, 0xab3a9b4f), TOBN(0x41c18807, 0xb1252f05)}, + {TOBN(0xfc7ed089, 0x80ba9b1c), TOBN(0xac8dc6de, 0xc532a9dd), + TOBN(0xbf829cef, 0x55246809), TOBN(0x101b784f, 0x5b4ee80f)}}, + {{TOBN(0xc09945bb, 0xb6f11603), TOBN(0x57b09dbe, 0x41d2801e), + TOBN(0xfba5202f, 0xa97534a8), TOBN(0x7fd8ae5f, 0xc17b9614)}, + {TOBN(0xa50ba666, 0x78308435), TOBN(0x9572f77c, 0xd3868c4d), + TOBN(0x0cef7bfd, 0x2dd7aab0), TOBN(0xe7958e08, 0x2c7c79ff)}}, + {{TOBN(0x81262e42, 0x25346689), TOBN(0x716da290, 0xb07c7004), + TOBN(0x35f911ea, 0xb7950ee3), TOBN(0x6fd72969, 0x261d21b5)}, + {TOBN(0x52389803, 0x08b640d3), TOBN(0x5b0026ee, 0x887f12a1), + TOBN(0x20e21660, 0x742e9311), TOBN(0x0ef6d541, 0x5ff77ff7)}}, + {{TOBN(0x969127f0, 0xf9c41135), TOBN(0xf21d60c9, 0x68a64993), + TOBN(0x656e5d0c, 0xe541875c), TOBN(0xf1e0f84e, 0xa1d3c233)}, + {TOBN(0x9bcca359, 0x06002d60), TOBN(0xbe2da60c, 0x06191552), + TOBN(0x5da8bbae, 0x61181ec3), TOBN(0x9f04b823, 0x65806f19)}}, + {{TOBN(0xf1604a7d, 0xd4b79bb8), TOBN(0xaee806fb, 0x52c878c8), + TOBN(0x34144f11, 0x8d47b8e8), TOBN(0x72edf52b, 0x949f9054)}, + {TOBN(0xebfca84e, 0x2127015a), TOBN(0x9051d0c0, 0x9cb7cef3), + TOBN(0x86e8fe58, 0x296deec8), TOBN(0x33b28188, 0x41010d74)}}}, + {{{TOBN(0x01079383, 0x171b445f), TOBN(0x9bcf21e3, 0x8131ad4c), + TOBN(0x8cdfe205, 0xc93987e8), TOBN(0xe63f4152, 0xc92e8c8f)}, + {TOBN(0x729462a9, 0x30add43d), TOBN(0x62ebb143, 0xc980f05a), + TOBN(0x4f3954e5, 0x3b06e968), TOBN(0xfe1d75ad, 0x242cf6b1)}}, + {{TOBN(0x5f95c6c7, 0xaf8685c8), TOBN(0xd4c1c8ce, 0x2f8f01aa), + TOBN(0xc44bbe32, 0x2574692a), TOBN(0xb8003478, 0xd4a4a068)}, + {TOBN(0x7c8fc6e5, 0x2eca3cdb), TOBN(0xea1db16b, 0xec04d399), + TOBN(0xb05bc82e, 0x8f2bc5cf), TOBN(0x763d517f, 0xf44793d2)}}, + {{TOBN(0x4451c1b8, 0x08bd98d0), TOBN(0x644b1cd4, 0x6575f240), + TOBN(0x6907eb33, 0x7375d270), TOBN(0x56c8bebd, 0xfa2286bd)}, + {TOBN(0xc713d2ac, 0xc4632b46), TOBN(0x17da427a, 0xafd60242), + TOBN(0x313065b7, 0xc95c7546), TOBN(0xf8239898, 0xbf17a3de)}}, + {{TOBN(0xf3b7963f, 0x4c830320), TOBN(0x842c7aa0, 0x903203e3), + TOBN(0xaf22ca0a, 0xe7327afb), TOBN(0x38e13092, 0x967609b6)}, + {TOBN(0x73b8fb62, 0x757558f1), TOBN(0x3cc3e831, 0xf7eca8c1), + TOBN(0xe4174474, 0xf6331627), TOBN(0xa77989ca, 0xc3c40234)}}, + {{TOBN(0xe5fd17a1, 0x44a081e0), TOBN(0xd797fb7d, 0xb70e296a), + TOBN(0x2b472b30, 0x481f719c), TOBN(0x0e632a98, 0xfe6f8c52)}, + {TOBN(0x89ccd116, 0xc5f0c284), TOBN(0xf51088af, 0x2d987c62), + TOBN(0x2a2bccda, 0x4c2de6cf), TOBN(0x810f9efe, 0xf679f0f9)}}, + {{TOBN(0xb0f394b9, 0x7ffe4b3e), TOBN(0x0b691d21, 0xe5fa5d21), + TOBN(0xb0bd7747, 0x9dfbbc75), TOBN(0xd2830fda, 0xfaf78b00)}, + {TOBN(0xf78c249c, 0x52434f57), TOBN(0x4b1f7545, 0x98096dab), + TOBN(0x73bf6f94, 0x8ff8c0b3), TOBN(0x34aef03d, 0x454e134c)}}, + {{TOBN(0xf8d151f4, 0xb7ac7ec5), TOBN(0xd6ceb95a, 0xe50da7d5), + TOBN(0xa1b492b0, 0xdc3a0eb8), TOBN(0x75157b69, 0xb3dd2863)}, + {TOBN(0xe2c4c74e, 0xc5413d62), TOBN(0xbe329ff7, 0xbc5fc4c7), + TOBN(0x835a2aea, 0x60fa9dda), TOBN(0xf117f5ad, 0x7445cb87)}}, + {{TOBN(0xae8317f4, 0xb0166f7a), TOBN(0xfbd3e3f7, 0xceec74e6), + TOBN(0xfdb516ac, 0xe0874bfd), TOBN(0x3d846019, 0xc681f3a3)}, + {TOBN(0x0b12ee5c, 0x7c1620b0), TOBN(0xba68b4dd, 0x2b63c501), + TOBN(0xac03cd32, 0x6668c51e), TOBN(0x2a6279f7, 0x4e0bcb5b)}}, + {{TOBN(0x17bd69b0, 0x6ae85c10), TOBN(0x72946979, 0x1dfdd3a6), + TOBN(0xd9a03268, 0x2c078bec), TOBN(0x41c6a658, 0xbfd68a52)}, + {TOBN(0xcdea1024, 0x0e023900), TOBN(0xbaeec121, 0xb10d144d), + TOBN(0x5a600e74, 0x058ab8dc), TOBN(0x1333af21, 0xbb89ccdd)}}, + {{TOBN(0xdf25eae0, 0x3aaba1f1), TOBN(0x2cada16e, 0x3b7144cf), + TOBN(0x657ee27d, 0x71ab98bc), TOBN(0x99088b4c, 0x7a6fc96e)}, + {TOBN(0x05d5c0a0, 0x3549dbd4), TOBN(0x42cbdf8f, 0xf158c3ac), + TOBN(0x3fb6b3b0, 0x87edd685), TOBN(0x22071cf6, 0x86f064d0)}}, + {{TOBN(0xd2d6721f, 0xff2811e5), TOBN(0xdb81b703, 0xfe7fae8c), + TOBN(0x3cfb74ef, 0xd3f1f7bb), TOBN(0x0cdbcd76, 0x16cdeb5d)}, + {TOBN(0x4f39642a, 0x566a808c), TOBN(0x02b74454, 0x340064d6), + TOBN(0xfabbadca, 0x0528fa6f), TOBN(0xe4c3074c, 0xd3fc0bb6)}}, + {{TOBN(0xb32cb8b0, 0xb796d219), TOBN(0xc3e95f4f, 0x34741dd9), + TOBN(0x87212125, 0x68edf6f5), TOBN(0x7a03aee4, 0xa2b9cb8e)}, + {TOBN(0x0cd3c376, 0xf53a89aa), TOBN(0x0d8af9b1, 0x948a28dc), + TOBN(0xcf86a3f4, 0x902ab04f), TOBN(0x8aacb62a, 0x7f42002d)}}, + {{TOBN(0x106985eb, 0xf62ffd52), TOBN(0xe670b54e, 0x5797bf10), + TOBN(0x4b405209, 0xc5e30aef), TOBN(0x12c97a20, 0x4365b5e9)}, + {TOBN(0x104646ce, 0x1fe32093), TOBN(0x13cb4ff6, 0x3907a8c9), + TOBN(0x8b9f30d1, 0xd46e726b), TOBN(0xe1985e21, 0xaba0f499)}}, + {{TOBN(0xc573dea9, 0x10a230cd), TOBN(0x24f46a93, 0xcd30f947), + TOBN(0xf2623fcf, 0xabe2010a), TOBN(0x3f278cb2, 0x73f00e4f)}, + {TOBN(0xed55c67d, 0x50b920eb), TOBN(0xf1cb9a2d, 0x8e760571), + TOBN(0x7c50d109, 0x0895b709), TOBN(0x4207cf07, 0x190d4369)}}, + {{TOBN(0x3b027e81, 0xc4127fe1), TOBN(0xa9f8b9ad, 0x3ae9c566), + TOBN(0x5ab10851, 0xacbfbba5), TOBN(0xa747d648, 0x569556f5)}, + {TOBN(0xcc172b5c, 0x2ba97bf7), TOBN(0x15e0f77d, 0xbcfa3324), + TOBN(0xa345b797, 0x7686279d), TOBN(0x5a723480, 0xe38003d3)}}, + {{TOBN(0xfd8e139f, 0x8f5fcda8), TOBN(0xf3e558c4, 0xbdee5bfd), + TOBN(0xd76cbaf4, 0xe33f9f77), TOBN(0x3a4c97a4, 0x71771969)}, + {TOBN(0xda27e84b, 0xf6dce6a7), TOBN(0xff373d96, 0x13e6c2d1), + TOBN(0xf115193c, 0xd759a6e9), TOBN(0x3f9b7025, 0x63d2262c)}}, + {{TOBN(0xd9764a31, 0x317cd062), TOBN(0x30779d8e, 0x199f8332), + TOBN(0xd8074106, 0x16b11b0b), TOBN(0x7917ab9f, 0x78aeaed8)}, + {TOBN(0xb67a9cbe, 0x28fb1d8e), TOBN(0x2e313563, 0x136eda33), + TOBN(0x010b7069, 0xa371a86c), TOBN(0x44d90fa2, 0x6744e6b7)}}, + {{TOBN(0x68190867, 0xd6b3e243), TOBN(0x9fe6cd9d, 0x59048c48), + TOBN(0xb900b028, 0x95731538), TOBN(0xa012062f, 0x32cae04f)}, + {TOBN(0x8107c8bc, 0x9399d082), TOBN(0x47e8c54a, 0x41df12e2), + TOBN(0x14ba5117, 0xb6ef3f73), TOBN(0x22260bea, 0x81362f0b)}}, + {{TOBN(0x90ea261e, 0x1a18cc20), TOBN(0x2192999f, 0x2321d636), + TOBN(0xef64d314, 0xe311b6a0), TOBN(0xd7401e4c, 0x3b54a1f5)}, + {TOBN(0x19019983, 0x6fbca2ba), TOBN(0x46ad3293, 0x8fbffc4b), + TOBN(0xa142d3f6, 0x3786bf40), TOBN(0xeb5cbc26, 0xb67039fc)}}, + {{TOBN(0x9cb0ae6c, 0x252bd479), TOBN(0x05e0f88a, 0x12b5848f), + TOBN(0x78f6d2b2, 0xa5c97663), TOBN(0x6f6e149b, 0xc162225c)}, + {TOBN(0xe602235c, 0xde601a89), TOBN(0xd17bbe98, 0xf373be1f), + TOBN(0xcaf49a5b, 0xa8471827), TOBN(0x7e1a0a85, 0x18aaa116)}}, + {{TOBN(0x6c833196, 0x270580c3), TOBN(0x1e233839, 0xf1c98a14), + TOBN(0x67b2f7b4, 0xae34e0a5), TOBN(0x47ac8745, 0xd8ce7289)}, + {TOBN(0x2b74779a, 0x100dd467), TOBN(0x274a4337, 0x4ee50d09), + TOBN(0x603dcf13, 0x83608bc9), TOBN(0xcd9da6c3, 0xc89e8388)}}, + {{TOBN(0x2660199f, 0x355116ac), TOBN(0xcc38bb59, 0xb6d18eed), + TOBN(0x3075f31f, 0x2f4bc071), TOBN(0x9774457f, 0x265dc57e)}, + {TOBN(0x06a6a9c8, 0xc6db88bb), TOBN(0x6429d07f, 0x4ec98e04), + TOBN(0x8d05e57b, 0x05ecaa8b), TOBN(0x20f140b1, 0x7872ea7b)}}, + {{TOBN(0xdf8c0f09, 0xca494693), TOBN(0x48d3a020, 0xf252e909), + TOBN(0x4c5c29af, 0x57b14b12), TOBN(0x7e6fa37d, 0xbf47ad1c)}, + {TOBN(0x66e7b506, 0x49a0c938), TOBN(0xb72c0d48, 0x6be5f41f), + TOBN(0x6a6242b8, 0xb2359412), TOBN(0xcd35c774, 0x8e859480)}}, + {{TOBN(0x12536fea, 0x87baa627), TOBN(0x58c1fec1, 0xf72aa680), + TOBN(0x6c29b637, 0x601e5dc9), TOBN(0x9e3c3c1c, 0xde9e01b9)}, + {TOBN(0xefc8127b, 0x2bcfe0b0), TOBN(0x35107102, 0x2a12f50d), + TOBN(0x6ccd6cb1, 0x4879b397), TOBN(0xf792f804, 0xf8a82f21)}}, + {{TOBN(0x509d4804, 0xa9b46402), TOBN(0xedddf85d, 0xc10f0850), + TOBN(0x928410dc, 0x4b6208aa), TOBN(0xf6229c46, 0x391012dc)}, + {TOBN(0xc5a7c41e, 0x7727b9b6), TOBN(0x289e4e4b, 0xaa444842), + TOBN(0x049ba1d9, 0xe9a947ea), TOBN(0x44f9e47f, 0x83c8debc)}}, + {{TOBN(0xfa77a1fe, 0x611f8b8e), TOBN(0xfd2e416a, 0xf518f427), + TOBN(0xc5fffa70, 0x114ebac3), TOBN(0xfe57c4e9, 0x5d89697b)}, + {TOBN(0xfdd053ac, 0xb1aaf613), TOBN(0x31df210f, 0xea585a45), + TOBN(0x318cc10e, 0x24985034), TOBN(0x1a38efd1, 0x5f1d6130)}}, + {{TOBN(0xbf86f237, 0x0b1e9e21), TOBN(0xb258514d, 0x1dbe88aa), + TOBN(0x1e38a588, 0x90c1baf9), TOBN(0x2936a01e, 0xbdb9b692)}, + {TOBN(0xd576de98, 0x6dd5b20c), TOBN(0xb586bf71, 0x70f98ecf), + TOBN(0xcccf0f12, 0xc42d2fd7), TOBN(0x8717e61c, 0xfb35bd7b)}}, + {{TOBN(0x8b1e5722, 0x35e6fc06), TOBN(0x3477728f, 0x0b3e13d5), + TOBN(0x150c294d, 0xaa8a7372), TOBN(0xc0291d43, 0x3bfa528a)}, + {TOBN(0xc6c8bc67, 0xcec5a196), TOBN(0xdeeb31e4, 0x5c2e8a7c), + TOBN(0xba93e244, 0xfb6e1c51), TOBN(0xb9f8b71b, 0x2e28e156)}}, + {{TOBN(0xce65a287, 0x968a2ab9), TOBN(0xe3c5ce69, 0x46bbcb1f), + TOBN(0xf8c835b9, 0xe7ae3f30), TOBN(0x16bbee26, 0xff72b82b)}, + {TOBN(0x665e2017, 0xfd42cd22), TOBN(0x1e139970, 0xf8b1d2a0), + TOBN(0x125cda29, 0x79204932), TOBN(0x7aee94a5, 0x49c3bee5)}}, + {{TOBN(0x68c70160, 0x89821a66), TOBN(0xf7c37678, 0x8f981669), + TOBN(0xd90829fc, 0x48cc3645), TOBN(0x346af049, 0xd70addfc)}, + {TOBN(0x2057b232, 0x370bf29c), TOBN(0xf90c73ce, 0x42e650ee), + TOBN(0xe03386ea, 0xa126ab90), TOBN(0x0e266e7e, 0x975a087b)}}, + {{TOBN(0x80578eb9, 0x0fca65d9), TOBN(0x7e2989ea, 0x16af45b8), + TOBN(0x7438212d, 0xcac75a4e), TOBN(0x38c7ca39, 0x4fef36b8)}, + {TOBN(0x8650c494, 0xd402676a), TOBN(0x26ab5a66, 0xf72c7c48), + TOBN(0x4e6cb426, 0xce3a464e), TOBN(0xf8f99896, 0x2b72f841)}}, + {{TOBN(0x8c318491, 0x1a335cc8), TOBN(0x563459ba, 0x6a5913e4), + TOBN(0x1b920d61, 0xc7b32919), TOBN(0x805ab8b6, 0xa02425ad)}, + {TOBN(0x2ac512da, 0x8d006086), TOBN(0x6ca4846a, 0xbcf5c0fd), + TOBN(0xafea51d8, 0xac2138d7), TOBN(0xcb647545, 0x344cd443)}}, + {{TOBN(0x0429ee8f, 0xbd7d9040), TOBN(0xee66a2de, 0x819b9c96), + TOBN(0x54f9ec25, 0xdea7d744), TOBN(0x2ffea642, 0x671721bb)}, + {TOBN(0x4f19dbd1, 0x114344ea), TOBN(0x04304536, 0xfd0dbc8b), + TOBN(0x014b50aa, 0x29ec7f91), TOBN(0xb5fc22fe, 0xbb06014d)}}, + {{TOBN(0x60d963a9, 0x1ee682e0), TOBN(0xdf48abc0, 0xfe85c727), + TOBN(0x0cadba13, 0x2e707c2d), TOBN(0xde608d3a, 0xa645aeff)}, + {TOBN(0x05f1c28b, 0xedafd883), TOBN(0x3c362ede, 0xbd94de1f), + TOBN(0x8dd0629d, 0x13593e41), TOBN(0x0a5e736f, 0x766d6eaf)}}, + {{TOBN(0xbfa92311, 0xf68cf9d1), TOBN(0xa4f9ef87, 0xc1797556), + TOBN(0x10d75a1f, 0x5601c209), TOBN(0x651c374c, 0x09b07361)}, + {TOBN(0x49950b58, 0x88b5cead), TOBN(0x0ef00058, 0x6fa9dbaa), + TOBN(0xf51ddc26, 0x4e15f33a), TOBN(0x1f8b5ca6, 0x2ef46140)}}, + {{TOBN(0x343ac0a3, 0xee9523f0), TOBN(0xbb75eab2, 0x975ea978), + TOBN(0x1bccf332, 0x107387f4), TOBN(0x790f9259, 0x9ab0062e)}, + {TOBN(0xf1a363ad, 0x1e4f6a5f), TOBN(0x06e08b84, 0x62519a50), + TOBN(0x60915187, 0x7265f1ee), TOBN(0x6a80ca34, 0x93ae985e)}}, + {{TOBN(0x81b29768, 0xaaba4864), TOBN(0xb13cabf2, 0x8d52a7d6), + TOBN(0xb5c36348, 0x8ead03f1), TOBN(0xc932ad95, 0x81c7c1c0)}, + {TOBN(0x5452708e, 0xcae1e27b), TOBN(0x9dac4269, 0x1b0df648), + TOBN(0x233e3f0c, 0xdfcdb8bc), TOBN(0xe6ceccdf, 0xec540174)}}, + {{TOBN(0xbd0d845e, 0x95081181), TOBN(0xcc8a7920, 0x699355d5), + TOBN(0x111c0f6d, 0xc3b375a8), TOBN(0xfd95bc6b, 0xfd51e0dc)}, + {TOBN(0x4a106a26, 0x6888523a), TOBN(0x4d142bd6, 0xcb01a06d), + TOBN(0x79bfd289, 0xadb9b397), TOBN(0x0bdbfb94, 0xe9863914)}}, + {{TOBN(0x29d8a229, 0x1660f6a6), TOBN(0x7f6abcd6, 0x551c042d), + TOBN(0x13039deb, 0x0ac3ffe8), TOBN(0xa01be628, 0xec8523fb)}, + {TOBN(0x6ea34103, 0x0ca1c328), TOBN(0xc74114bd, 0xb903928e), + TOBN(0x8aa4ff4e, 0x9e9144b0), TOBN(0x7064091f, 0x7f9a4b17)}}, + {{TOBN(0xa3f4f521, 0xe447f2c4), TOBN(0x81b8da7a, 0x604291f0), + TOBN(0xd680bc46, 0x7d5926de), TOBN(0x84f21fd5, 0x34a1202f)}, + {TOBN(0x1d1e3181, 0x4e9df3d8), TOBN(0x1ca4861a, 0x39ab8d34), + TOBN(0x809ddeec, 0x5b19aa4a), TOBN(0x59f72f7e, 0x4d329366)}}, + {{TOBN(0xa2f93f41, 0x386d5087), TOBN(0x40bf739c, 0xdd67d64f), + TOBN(0xb4494205, 0x66702158), TOBN(0xc33c65be, 0x73b1e178)}, + {TOBN(0xcdcd657c, 0x38ca6153), TOBN(0x97f4519a, 0xdc791976), + TOBN(0xcc7c7f29, 0xcd6e1f39), TOBN(0x38de9cfb, 0x7e3c3932)}}, + {{TOBN(0xe448eba3, 0x7b793f85), TOBN(0xe9f8dbf9, 0xf067e914), + TOBN(0xc0390266, 0xf114ae87), TOBN(0x39ed75a7, 0xcd6a8e2a)}, + {TOBN(0xadb14848, 0x7ffba390), TOBN(0x67f8cb8b, 0x6af9bc09), + TOBN(0x322c3848, 0x9c7476db), TOBN(0xa320fecf, 0x52a538d6)}}, + {{TOBN(0xe0493002, 0xb2aced2b), TOBN(0xdfba1809, 0x616bd430), + TOBN(0x531c4644, 0xc331be70), TOBN(0xbc04d32e, 0x90d2e450)}, + {TOBN(0x1805a0d1, 0x0f9f142d), TOBN(0x2c44a0c5, 0x47ee5a23), + TOBN(0x31875a43, 0x3989b4e3), TOBN(0x6b1949fd, 0x0c063481)}}, + {{TOBN(0x2dfb9e08, 0xbe0f4492), TOBN(0x3ff0da03, 0xe9d5e517), + TOBN(0x03dbe9a1, 0xf79466a8), TOBN(0x0b87bcd0, 0x15ea9932)}, + {TOBN(0xeb64fc83, 0xab1f58ab), TOBN(0x6d9598da, 0x817edc8a), + TOBN(0x699cff66, 0x1d3b67e5), TOBN(0x645c0f29, 0x92635853)}}, + {{TOBN(0x253cdd82, 0xeabaf21c), TOBN(0x82b9602a, 0x2241659e), + TOBN(0x2cae07ec, 0x2d9f7091), TOBN(0xbe4c720c, 0x8b48cd9b)}, + {TOBN(0x6ce5bc03, 0x6f08d6c9), TOBN(0x36e8a997, 0xaf10bf40), + TOBN(0x83422d21, 0x3e10ff12), TOBN(0x7b26d3eb, 0xbcc12494)}}, + {{TOBN(0xb240d2d0, 0xc9469ad6), TOBN(0xc4a11b4d, 0x30afa05b), + TOBN(0x4b604ace, 0xdd6ba286), TOBN(0x18486600, 0x3ee2864c)}, + {TOBN(0x5869d6ba, 0x8d9ce5be), TOBN(0x0d8f68c5, 0xff4bfb0d), + TOBN(0xb69f210b, 0x5700cf73), TOBN(0x61f6653a, 0x6d37c135)}}, + {{TOBN(0xff3d432b, 0x5aff5a48), TOBN(0x0d81c4b9, 0x72ba3a69), + TOBN(0xee879ae9, 0xfa1899ef), TOBN(0xbac7e2a0, 0x2d6acafd)}, + {TOBN(0xd6d93f6c, 0x1c664399), TOBN(0x4c288de1, 0x5bcb135d), + TOBN(0x83031dab, 0x9dab7cbf), TOBN(0xfe23feb0, 0x3abbf5f0)}}, + {{TOBN(0x9f1b2466, 0xcdedca85), TOBN(0x140bb710, 0x1a09538c), + TOBN(0xac8ae851, 0x5e11115d), TOBN(0x0d63ff67, 0x6f03f59e)}, + {TOBN(0x755e5551, 0x7d234afb), TOBN(0x61c2db4e, 0x7e208fc1), + TOBN(0xaa9859ce, 0xf28a4b5d), TOBN(0xbdd6d4fc, 0x34af030f)}}, + {{TOBN(0xd1c4a26d, 0x3be01cb1), TOBN(0x9ba14ffc, 0x243aa07c), + TOBN(0xf95cd3a9, 0xb2503502), TOBN(0xe379bc06, 0x7d2a93ab)}, + {TOBN(0x3efc18e9, 0xd4ca8d68), TOBN(0x083558ec, 0x80bb412a), + TOBN(0xd903b940, 0x9645a968), TOBN(0xa499f0b6, 0x9ba6054f)}}, + {{TOBN(0x208b573c, 0xb8349abe), TOBN(0x3baab3e5, 0x30b4fc1c), + TOBN(0x87e978ba, 0xcb524990), TOBN(0x3524194e, 0xccdf0e80)}, + {TOBN(0x62711725, 0x7d4bcc42), TOBN(0xe90a3d9b, 0xb90109ba), + TOBN(0x3b1bdd57, 0x1323e1e0), TOBN(0xb78e9bd5, 0x5eae1599)}}, + {{TOBN(0x0794b746, 0x9e03d278), TOBN(0x80178605, 0xd70e6297), + TOBN(0x171792f8, 0x99c97855), TOBN(0x11b393ee, 0xf5a86b5c)}, + {TOBN(0x48ef6582, 0xd8884f27), TOBN(0xbd44737a, 0xbf19ba5f), + TOBN(0x8698de4c, 0xa42062c6), TOBN(0x8975eb80, 0x61ce9c54)}}, + {{TOBN(0xd50e57c7, 0xd7fe71f3), TOBN(0x15342190, 0xbc97ce38), + TOBN(0x51bda2de, 0x4df07b63), TOBN(0xba12aeae, 0x200eb87d)}, + {TOBN(0xabe135d2, 0xa9b4f8f6), TOBN(0x04619d65, 0xfad6d99c), + TOBN(0x4a6683a7, 0x7994937c), TOBN(0x7a778c8b, 0x6f94f09a)}}, + {{TOBN(0x8c508623, 0x20a71b89), TOBN(0x241a2aed, 0x1c229165), + TOBN(0x352be595, 0xaaf83a99), TOBN(0x9fbfee7f, 0x1562bac8)}, + {TOBN(0xeaf658b9, 0x5c4017e3), TOBN(0x1dc7f9e0, 0x15120b86), + TOBN(0xd84f13dd, 0x4c034d6f), TOBN(0x283dd737, 0xeaea3038)}}, + {{TOBN(0x197f2609, 0xcd85d6a2), TOBN(0x6ebbc345, 0xfae60177), + TOBN(0xb80f031b, 0x4e12fede), TOBN(0xde55d0c2, 0x07a2186b)}, + {TOBN(0x1fb3e37f, 0x24dcdd5a), TOBN(0x8d602da5, 0x7ed191fb), + TOBN(0x108fb056, 0x76023e0d), TOBN(0x70178c71, 0x459c20c0)}}, + {{TOBN(0xfad5a386, 0x3fe54cf0), TOBN(0xa4a3ec4f, 0x02bbb475), + TOBN(0x1aa5ec20, 0x919d94d7), TOBN(0x5d3b63b5, 0xa81e4ab3)}, + {TOBN(0x7fa733d8, 0x5ad3d2af), TOBN(0xfbc586dd, 0xd1ac7a37), + TOBN(0x282925de, 0x40779614), TOBN(0xfe0ffffb, 0xe74a242a)}}, + {{TOBN(0x3f39e67f, 0x906151e5), TOBN(0xcea27f5f, 0x55e10649), + TOBN(0xdca1d4e1, 0xc17cf7b7), TOBN(0x0c326d12, 0x2fe2362d)}, + {TOBN(0x05f7ac33, 0x7dd35df3), TOBN(0x0c3b7639, 0xc396dbdf), + TOBN(0x0912f5ac, 0x03b7db1c), TOBN(0x9dea4b70, 0x5c9ed4a9)}}, + {{TOBN(0x475e6e53, 0xaae3f639), TOBN(0xfaba0e7c, 0xfc278bac), + TOBN(0x16f9e221, 0x9490375f), TOBN(0xaebf9746, 0xa5a7ed0a)}, + {TOBN(0x45f9af3f, 0xf41ad5d6), TOBN(0x03c4623c, 0xb2e99224), + TOBN(0x82c5bb5c, 0xb3cf56aa), TOBN(0x64311819, 0x34567ed3)}}, + {{TOBN(0xec57f211, 0x8be489ac), TOBN(0x2821895d, 0xb9a1104b), + TOBN(0x610dc875, 0x6064e007), TOBN(0x8e526f3f, 0x5b20d0fe)}, + {TOBN(0x6e71ca77, 0x5b645aee), TOBN(0x3d1dcb9f, 0x800e10ff), + TOBN(0x36b51162, 0x189cf6de), TOBN(0x2c5a3e30, 0x6bb17353)}}, + {{TOBN(0xc186cd3e, 0x2a6c6fbf), TOBN(0xa74516fa, 0x4bf97906), + TOBN(0x5b4b8f4b, 0x279d6901), TOBN(0x0c4e57b4, 0x2b573743)}, + {TOBN(0x75fdb229, 0xb6e386b6), TOBN(0xb46793fd, 0x99deac27), + TOBN(0xeeec47ea, 0xcf712629), TOBN(0xe965f3c4, 0xcbc3b2dd)}}, + {{TOBN(0x8dd1fb83, 0x425c6559), TOBN(0x7fc00ee6, 0x0af06fda), + TOBN(0xe98c9225, 0x33d956df), TOBN(0x0f1ef335, 0x4fbdc8a2)}, + {TOBN(0x2abb5145, 0xb79b8ea2), TOBN(0x40fd2945, 0xbdbff288), + TOBN(0x6a814ac4, 0xd7185db7), TOBN(0xc4329d6f, 0xc084609a)}}, + {{TOBN(0xc9ba7b52, 0xed1be45d), TOBN(0x891dd20d, 0xe4cd2c74), + TOBN(0x5a4d4a7f, 0x824139b1), TOBN(0x66c17716, 0xb873c710)}, + {TOBN(0x5e5bc141, 0x2843c4e0), TOBN(0xd5ac4817, 0xb97eb5bf), + TOBN(0xc0f8af54, 0x450c95c7), TOBN(0xc91b3fa0, 0x318406c5)}}, + {{TOBN(0x360c340a, 0xab9d97f8), TOBN(0xfb57bd07, 0x90a2d611), + TOBN(0x4339ae3c, 0xa6a6f7e5), TOBN(0x9c1fcd2a, 0x2feb8a10)}, + {TOBN(0x972bcca9, 0xc7ea7432), TOBN(0x1b0b924c, 0x308076f6), + TOBN(0x80b2814a, 0x2a5b4ca5), TOBN(0x2f78f55b, 0x61ef3b29)}}, + {{TOBN(0xf838744a, 0xc18a414f), TOBN(0xc611eaae, 0x903d0a86), + TOBN(0x94dabc16, 0x2a453f55), TOBN(0xe6f2e3da, 0x14efb279)}, + {TOBN(0x5b7a6017, 0x9320dc3c), TOBN(0x692e382f, 0x8df6b5a4), + TOBN(0x3f5e15e0, 0x2d40fa90), TOBN(0xc87883ae, 0x643dd318)}}, + {{TOBN(0x511053e4, 0x53544774), TOBN(0x834d0ecc, 0x3adba2bc), + TOBN(0x4215d7f7, 0xbae371f5), TOBN(0xfcfd57bf, 0x6c8663bc)}, + {TOBN(0xded2383d, 0xd6901b1d), TOBN(0x3b49fbb4, 0xb5587dc3), + TOBN(0xfd44a08d, 0x07625f62), TOBN(0x3ee4d65b, 0x9de9b762)}}}, + {{{TOBN(0x64e5137d, 0x0d63d1fa), TOBN(0x658fc052, 0x02a9d89f), + TOBN(0x48894874, 0x50436309), TOBN(0xe9ae30f8, 0xd598da61)}, + {TOBN(0x2ed710d1, 0x818baf91), TOBN(0xe27e9e06, 0x8b6a0c20), + TOBN(0x1e28dcfb, 0x1c1a6b44), TOBN(0x883acb64, 0xd6ac57dc)}}, + {{TOBN(0x8735728d, 0xc2c6ff70), TOBN(0x79d6122f, 0xc5dc2235), + TOBN(0x23f5d003, 0x19e277f9), TOBN(0x7ee84e25, 0xdded8cc7)}, + {TOBN(0x91a8afb0, 0x63cd880a), TOBN(0x3f3ea7c6, 0x3574af60), + TOBN(0x0cfcdc84, 0x02de7f42), TOBN(0x62d0792f, 0xb31aa152)}}, + {{TOBN(0x8e1b4e43, 0x8a5807ce), TOBN(0xad283893, 0xe4109a7e), + TOBN(0xc30cc9cb, 0xafd59dda), TOBN(0xf65f36c6, 0x3d8d8093)}, + {TOBN(0xdf31469e, 0xa60d32b2), TOBN(0xee93df4b, 0x3e8191c8), + TOBN(0x9c1017c5, 0x355bdeb5), TOBN(0xd2623185, 0x8616aa28)}}, + {{TOBN(0xb02c83f9, 0xdec31a21), TOBN(0x988c8b23, 0x6ad9d573), + TOBN(0x53e983ae, 0xa57be365), TOBN(0xe968734d, 0x646f834e)}, + {TOBN(0x9137ea8f, 0x5da6309b), TOBN(0x10f3a624, 0xc1f1ce16), + TOBN(0x782a9ea2, 0xca440921), TOBN(0xdf94739e, 0x5b46f1b5)}}, + {{TOBN(0x9f9be006, 0xcce85c9b), TOBN(0x360e70d6, 0xa4c7c2d3), + TOBN(0x2cd5beea, 0xaefa1e60), TOBN(0x64cf63c0, 0x8c3d2b6d)}, + {TOBN(0xfb107fa3, 0xe1cf6f90), TOBN(0xb7e937c6, 0xd5e044e6), + TOBN(0x74e8ca78, 0xce34db9f), TOBN(0x4f8b36c1, 0x3e210bd0)}}, + {{TOBN(0x1df165a4, 0x34a35ea8), TOBN(0x3418e0f7, 0x4d4412f6), + TOBN(0x5af1f8af, 0x518836c3), TOBN(0x42ceef4d, 0x130e1965)}, + {TOBN(0x5560ca0b, 0x543a1957), TOBN(0xc33761e5, 0x886cb123), + TOBN(0x66624b1f, 0xfe98ed30), TOBN(0xf772f4bf, 0x1090997d)}}, + {{TOBN(0xf4e540bb, 0x4885d410), TOBN(0x7287f810, 0x9ba5f8d7), + TOBN(0x22d0d865, 0xde98dfb1), TOBN(0x49ff51a1, 0xbcfbb8a3)}, + {TOBN(0xb6b6fa53, 0x6bc3012e), TOBN(0x3d31fd72, 0x170d541d), + TOBN(0x8018724f, 0x4b0f4966), TOBN(0x79e7399f, 0x87dbde07)}}, + {{TOBN(0x56f8410e, 0xf4f8b16a), TOBN(0x97241afe, 0xc47b266a), + TOBN(0x0a406b8e, 0x6d9c87c1), TOBN(0x803f3e02, 0xcd42ab1b)}, + {TOBN(0x7f0309a8, 0x04dbec69), TOBN(0xa83b85f7, 0x3bbad05f), + TOBN(0xc6097273, 0xad8e197f), TOBN(0xc097440e, 0x5067adc1)}}, + {{TOBN(0x730eafb6, 0x3524ff16), TOBN(0xd7f9b51e, 0x823fc6ce), + TOBN(0x27bd0d32, 0x443e4ac0), TOBN(0x40c59ad9, 0x4d66f217)}, + {TOBN(0x6c33136f, 0x17c387a4), TOBN(0x5043b8d5, 0xeb86804d), + TOBN(0x74970312, 0x675a73c9), TOBN(0x838fdb31, 0xf16669b6)}}, + {{TOBN(0xc507b6dd, 0x418e7ddd), TOBN(0x39888d93, 0x472f19d6), + TOBN(0x7eae26be, 0x0c27eb4d), TOBN(0x17b53ed3, 0xfbabb884)}, + {TOBN(0xfc27021b, 0x2b01ae4f), TOBN(0x88462e87, 0xcf488682), + TOBN(0xbee096ec, 0x215e2d87), TOBN(0xeb2fea9a, 0xd242e29b)}}, + {{TOBN(0x5d985b5f, 0xb821fc28), TOBN(0x89d2e197, 0xdc1e2ad2), + TOBN(0x55b566b8, 0x9030ba62), TOBN(0xe3fd41b5, 0x4f41b1c6)}, + {TOBN(0xb738ac2e, 0xb9a96d61), TOBN(0x7f8567ca, 0x369443f4), + TOBN(0x8698622d, 0xf803a440), TOBN(0x2b586236, 0x8fe2f4dc)}}, + {{TOBN(0xbbcc00c7, 0x56b95bce), TOBN(0x5ec03906, 0x616da680), + TOBN(0x79162ee6, 0x72214252), TOBN(0x43132b63, 0x86a892d2)}, + {TOBN(0x4bdd3ff2, 0x2f3263bf), TOBN(0xd5b3733c, 0x9cd0a142), + TOBN(0x592eaa82, 0x44415ccb), TOBN(0x663e8924, 0x8d5474ea)}}, + {{TOBN(0x8058a25e, 0x5236344e), TOBN(0x82e8df9d, 0xbda76ee6), + TOBN(0xdcf6efd8, 0x11cc3d22), TOBN(0x00089cda, 0x3b4ab529)}, + {TOBN(0x91d3a071, 0xbd38a3db), TOBN(0x4ea97fc0, 0xef72b925), + TOBN(0x0c9fc15b, 0xea3edf75), TOBN(0x5a6297cd, 0xa4348ed3)}}, + {{TOBN(0x0d38ab35, 0xce7c42d4), TOBN(0x9fd493ef, 0x82feab10), + TOBN(0x46056b6d, 0x82111b45), TOBN(0xda11dae1, 0x73efc5c3)}, + {TOBN(0xdc740278, 0x5545a7fb), TOBN(0xbdb2601c, 0x40d507e6), + TOBN(0x121dfeeb, 0x7066fa58), TOBN(0x214369a8, 0x39ae8c2a)}}, + {{TOBN(0x195709cb, 0x06e0956c), TOBN(0x4c9d254f, 0x010cd34b), + TOBN(0xf51e13f7, 0x0471a532), TOBN(0xe19d6791, 0x1e73054d)}, + {TOBN(0xf702a628, 0xdb5c7be3), TOBN(0xc7141218, 0xb24dde05), + TOBN(0xdc18233c, 0xf29b2e2e), TOBN(0x3a6bd1e8, 0x85342dba)}}, + {{TOBN(0x3f747fa0, 0xb311898c), TOBN(0xe2a272e4, 0xcd0eac65), + TOBN(0x4bba5851, 0xf914d0bc), TOBN(0x7a1a9660, 0xc4a43ee3)}, + {TOBN(0xe5a367ce, 0xa1c8cde9), TOBN(0x9d958ba9, 0x7271abe3), + TOBN(0xf3ff7eb6, 0x3d1615cd), TOBN(0xa2280dce, 0xf5ae20b0)}}, + {{TOBN(0x56dba5c1, 0xcf640147), TOBN(0xea5a2e3d, 0x5e83d118), + TOBN(0x04cd6b6d, 0xda24c511), TOBN(0x1c0f4671, 0xe854d214)}, + {TOBN(0x91a6b7a9, 0x69565381), TOBN(0xdc966240, 0xdecf1f5b), + TOBN(0x1b22d21c, 0xfcf5d009), TOBN(0x2a05f641, 0x9021dbd5)}}, + {{TOBN(0x8c0ed566, 0xd4312483), TOBN(0x5179a95d, 0x643e216f), + TOBN(0xcc185fec, 0x17044493), TOBN(0xb3063339, 0x54991a21)}, + {TOBN(0xd801ecdb, 0x0081a726), TOBN(0x0149b0c6, 0x4fa89bbb), + TOBN(0xafe9065a, 0x4391b6b9), TOBN(0xedc92786, 0xd633f3a3)}}, + {{TOBN(0xe408c24a, 0xae6a8e13), TOBN(0x85833fde, 0x9f3897ab), + TOBN(0x43800e7e, 0xd81a0715), TOBN(0xde08e346, 0xb44ffc5f)}, + {TOBN(0x7094184c, 0xcdeff2e0), TOBN(0x49f9387b, 0x165eaed1), + TOBN(0x635d6129, 0x777c468a), TOBN(0x8c0dcfd1, 0x538c2dd8)}}, + {{TOBN(0xd6d9d9e3, 0x7a6a308b), TOBN(0x62375830, 0x4c2767d3), + TOBN(0x874a8bc6, 0xf38cbeb6), TOBN(0xd94d3f1a, 0xccb6fd9e)}, + {TOBN(0x92a9735b, 0xba21f248), TOBN(0x272ad0e5, 0x6cd1efb0), + TOBN(0x7437b69c, 0x05b03284), TOBN(0xe7f04702, 0x6948c225)}}, + {{TOBN(0x8a56c04a, 0xcba2ecec), TOBN(0x0c181270, 0xe3a73e41), + TOBN(0x6cb34e9d, 0x03e93725), TOBN(0xf77c8713, 0x496521a9)}, + {TOBN(0x94569183, 0xfa7f9f90), TOBN(0xf2e7aa4c, 0x8c9707ad), + TOBN(0xced2c9ba, 0x26c1c9a3), TOBN(0x9109fe96, 0x40197507)}}, + {{TOBN(0x9ae868a9, 0xe9adfe1c), TOBN(0x3984403d, 0x314e39bb), + TOBN(0xb5875720, 0xf2fe378f), TOBN(0x33f901e0, 0xba44a628)}, + {TOBN(0xea1125fe, 0x3652438c), TOBN(0xae9ec4e6, 0x9dd1f20b), + TOBN(0x1e740d9e, 0xbebf7fbd), TOBN(0x6dbd3ddc, 0x42dbe79c)}}, + {{TOBN(0x62082aec, 0xedd36776), TOBN(0xf612c478, 0xe9859039), + TOBN(0xa493b201, 0x032f7065), TOBN(0xebd4d8f2, 0x4ff9b211)}, + {TOBN(0x3f23a0aa, 0xaac4cb32), TOBN(0xea3aadb7, 0x15ed4005), + TOBN(0xacf17ea4, 0xafa27e63), TOBN(0x56125c1a, 0xc11fd66c)}}, + {{TOBN(0x266344a4, 0x3794f8dc), TOBN(0xdcca923a, 0x483c5c36), + TOBN(0x2d6b6bbf, 0x3f9d10a0), TOBN(0xb320c5ca, 0x81d9bdf3)}, + {TOBN(0x620e28ff, 0x47b50a95), TOBN(0x933e3b01, 0xcef03371), + TOBN(0xf081bf85, 0x99100153), TOBN(0x183be9a0, 0xc3a8c8d6)}}, + {{TOBN(0x4e3ddc5a, 0xd6bbe24d), TOBN(0xc6c74630, 0x53843795), + TOBN(0x78193dd7, 0x65ec2d4c), TOBN(0xb8df26cc, 0xcd3c89b2)}, + {TOBN(0x98dbe399, 0x5a483f8d), TOBN(0x72d8a957, 0x7dd3313a), + TOBN(0x65087294, 0xab0bd375), TOBN(0xfcd89248, 0x7c259d16)}}, + {{TOBN(0x8a9443d7, 0x7613aa81), TOBN(0x80100800, 0x85fe6584), + TOBN(0x70fc4dbc, 0x7fb10288), TOBN(0xf58280d3, 0xe86beee8)}, + {TOBN(0x14fdd82f, 0x7c978c38), TOBN(0xdf1204c1, 0x0de44d7b), + TOBN(0xa08a1c84, 0x4160252f), TOBN(0x591554ca, 0xc17646a5)}}, + {{TOBN(0x214a37d6, 0xa05bd525), TOBN(0x48d5f09b, 0x07957b3c), + TOBN(0x0247cdcb, 0xd7109bc9), TOBN(0x40f9e4bb, 0x30599ce7)}, + {TOBN(0xc325fa03, 0xf46ad2ec), TOBN(0x00f766cf, 0xc3e3f9ee), + TOBN(0xab556668, 0xd43a4577), TOBN(0x68d30a61, 0x3ee03b93)}}, + {{TOBN(0x7ddc81ea, 0x77b46a08), TOBN(0xcf5a6477, 0xc7480699), + TOBN(0x43a8cb34, 0x6633f683), TOBN(0x1b867e6b, 0x92363c60)}, + {TOBN(0x43921114, 0x1f60558e), TOBN(0xcdbcdd63, 0x2f41450e), + TOBN(0x7fc04601, 0xcc630e8b), TOBN(0xea7c66d5, 0x97038b43)}}, + {{TOBN(0x7259b8a5, 0x04e99fd8), TOBN(0x98a8dd12, 0x4785549a), + TOBN(0x0e459a7c, 0x840552e1), TOBN(0xcdfcf4d0, 0x4bb0909e)}, + {TOBN(0x34a86db2, 0x53758da7), TOBN(0xe643bb83, 0xeac997e1), + TOBN(0x96400bd7, 0x530c5b7e), TOBN(0x9f97af87, 0xb41c8b52)}}, + {{TOBN(0x34fc8820, 0xfbeee3f9), TOBN(0x93e53490, 0x49091afd), + TOBN(0x764b9be5, 0x9a31f35c), TOBN(0x71f37864, 0x57e3d924)}, + {TOBN(0x02fb34e0, 0x943aa75e), TOBN(0xa18c9c58, 0xab8ff6e4), + TOBN(0x080f31b1, 0x33cf0d19), TOBN(0x5c9682db, 0x083518a7)}}, + {{TOBN(0x873d4ca6, 0xb709c3de), TOBN(0x64a84262, 0x3575b8f0), + TOBN(0x6275da1f, 0x020154bb), TOBN(0x97678caa, 0xd17cf1ab)}, + {TOBN(0x8779795f, 0x951a95c3), TOBN(0xdd35b163, 0x50fccc08), + TOBN(0x32709627, 0x33d8f031), TOBN(0x3c5ab10a, 0x498dd85c)}}, + {{TOBN(0xb6c185c3, 0x41dca566), TOBN(0x7de7feda, 0xd8622aa3), + TOBN(0x99e84d92, 0x901b6dfb), TOBN(0x30a02b0e, 0x7c4ad288)}, + {TOBN(0xc7c81daa, 0x2fd3cf36), TOBN(0xd1319547, 0xdf89e59f), + TOBN(0xb2be8184, 0xcd496733), TOBN(0xd5f449eb, 0x93d3412b)}}, + {{TOBN(0x7ea41b1b, 0x25fe531d), TOBN(0xf9797432, 0x6a1d5646), + TOBN(0x86067f72, 0x2bde501a), TOBN(0xf91481c0, 0x0c85e89c)}, + {TOBN(0xca8ee465, 0xf8b05bc6), TOBN(0x1844e1cf, 0x02e83cda), + TOBN(0xca82114a, 0xb4dbe33b), TOBN(0x0f9f8769, 0x4eabfde2)}}, + {{TOBN(0x4936b1c0, 0x38b27fe2), TOBN(0x63b6359b, 0xaba402df), + TOBN(0x40c0ea2f, 0x656bdbab), TOBN(0x9c992a89, 0x6580c39c)}, + {TOBN(0x600e8f15, 0x2a60aed1), TOBN(0xeb089ca4, 0xe0bf49df), + TOBN(0x9c233d7d, 0x2d42d99a), TOBN(0x648d3f95, 0x4c6bc2fa)}}, + {{TOBN(0xdcc383a8, 0xe1add3f3), TOBN(0xf42c0c6a, 0x4f64a348), + TOBN(0x2abd176f, 0x0030dbdb), TOBN(0x4de501a3, 0x7d6c215e)}, + {TOBN(0x4a107c1f, 0x4b9a64bc), TOBN(0xa77f0ad3, 0x2496cd59), + TOBN(0xfb78ac62, 0x7688dffb), TOBN(0x7025a2ca, 0x67937d8e)}}, + {{TOBN(0xfde8b2d1, 0xd1a8f4e7), TOBN(0xf5b3da47, 0x7354927c), + TOBN(0xe48606a3, 0xd9205735), TOBN(0xac477cc6, 0xe177b917)}, + {TOBN(0xfb1f73d2, 0xa883239a), TOBN(0xe12572f6, 0xcc8b8357), + TOBN(0x9d355e9c, 0xfb1f4f86), TOBN(0x89b795f8, 0xd9f3ec6e)}}, + {{TOBN(0x27be56f1, 0xb54398dc), TOBN(0x1890efd7, 0x3fedeed5), + TOBN(0x62f77f1f, 0x9c6d0140), TOBN(0x7ef0e314, 0x596f0ee4)}, + {TOBN(0x50ca6631, 0xcc61dab3), TOBN(0x4a39801d, 0xf4866e4f), + TOBN(0x66c8d032, 0xae363b39), TOBN(0x22c591e5, 0x2ead66aa)}}, + {{TOBN(0x954ba308, 0xde02a53e), TOBN(0x2a6c060f, 0xd389f357), + TOBN(0xe6cfcde8, 0xfbf40b66), TOBN(0x8e02fc56, 0xc6340ce1)}, + {TOBN(0xe4957795, 0x73adb4ba), TOBN(0x7b86122c, 0xa7b03805), + TOBN(0x63f83512, 0x0c8e6fa6), TOBN(0x83660ea0, 0x057d7804)}}, + {{TOBN(0xbad79105, 0x21ba473c), TOBN(0xb6c50bee, 0xded5389d), + TOBN(0xee2caf4d, 0xaa7c9bc0), TOBN(0xd97b8de4, 0x8c4e98a7)}, + {TOBN(0xa9f63e70, 0xab3bbddb), TOBN(0x3898aabf, 0x2597815a), + TOBN(0x7659af89, 0xac15b3d9), TOBN(0xedf7725b, 0x703ce784)}}, + {{TOBN(0x25470fab, 0xe085116b), TOBN(0x04a43375, 0x87285310), + TOBN(0x4e39187e, 0xe2bfd52f), TOBN(0x36166b44, 0x7d9ebc74)}, + {TOBN(0x92ad433c, 0xfd4b322c), TOBN(0x726aa817, 0xba79ab51), + TOBN(0xf96eacd8, 0xc1db15eb), TOBN(0xfaf71e91, 0x0476be63)}}, + {{TOBN(0xdd69a640, 0x641fad98), TOBN(0xb7995918, 0x29622559), + TOBN(0x03c6daa5, 0xde4199dc), TOBN(0x92cadc97, 0xad545eb4)}, + {TOBN(0x1028238b, 0x256534e4), TOBN(0x73e80ce6, 0x8595409a), + TOBN(0x690d4c66, 0xd05dc59b), TOBN(0xc95f7b8f, 0x981dee80)}}, + {{TOBN(0xf4337014, 0xd856ac25), TOBN(0x441bd9dd, 0xac524dca), + TOBN(0x640b3d85, 0x5f0499f5), TOBN(0x39cf84a9, 0xd5fda182)}, + {TOBN(0x04e7b055, 0xb2aa95a0), TOBN(0x29e33f0a, 0x0ddf1860), + TOBN(0x082e74b5, 0x423f6b43), TOBN(0x217edeb9, 0x0aaa2b0f)}}, + {{TOBN(0x58b83f35, 0x83cbea55), TOBN(0xc485ee4d, 0xbc185d70), + TOBN(0x833ff03b, 0x1e5f6992), TOBN(0xb5b9b9cc, 0xcf0c0dd5)}, + {TOBN(0x7caaee8e, 0x4e9e8a50), TOBN(0x462e907b, 0x6269dafd), + TOBN(0x6ed5cee9, 0xfbe791c6), TOBN(0x68ca3259, 0xed430790)}}, + {{TOBN(0x2b72bdf2, 0x13b5ba88), TOBN(0x60294c8a, 0x35ef0ac4), + TOBN(0x9c3230ed, 0x19b99b08), TOBN(0x560fff17, 0x6c2589aa)}, + {TOBN(0x552b8487, 0xd6770374), TOBN(0xa373202d, 0x9a56f685), + TOBN(0xd3e7f907, 0x45f175d9), TOBN(0x3c2f315f, 0xd080d810)}}, + {{TOBN(0x1130e9dd, 0x7b9520e8), TOBN(0xc078f9e2, 0x0af037b5), + TOBN(0x38cd2ec7, 0x1e9c104c), TOBN(0x0f684368, 0xc472fe92)}, + {TOBN(0xd3f1b5ed, 0x6247e7ef), TOBN(0xb32d33a9, 0x396dfe21), + TOBN(0x46f59cf4, 0x4a9aa2c2), TOBN(0x69cd5168, 0xff0f7e41)}}, + {{TOBN(0x3f59da0f, 0x4b3234da), TOBN(0xcf0b0235, 0xb4579ebe), + TOBN(0x6d1cbb25, 0x6d2476c7), TOBN(0x4f0837e6, 0x9dc30f08)}, + {TOBN(0x9a4075bb, 0x906f6e98), TOBN(0x253bb434, 0xc761e7d1), + TOBN(0xde2e645f, 0x6e73af10), TOBN(0xb89a4060, 0x0c5f131c)}}, + {{TOBN(0xd12840c5, 0xb8cc037f), TOBN(0x3d093a5b, 0x7405bb47), + TOBN(0x6202c253, 0x206348b8), TOBN(0xbf5d57fc, 0xc55a3ca7)}, + {TOBN(0x89f6c90c, 0x8c3bef48), TOBN(0x23ac7623, 0x5a0a960a), + TOBN(0xdfbd3d6b, 0x552b42ab), TOBN(0x3ef22458, 0x132061f6)}}, + {{TOBN(0xd74e9bda, 0xc97e6516), TOBN(0x88779360, 0xc230f49e), + TOBN(0xa6ec1de3, 0x1e74ea49), TOBN(0x581dcee5, 0x3fb645a2)}, + {TOBN(0xbaef2391, 0x8f483f14), TOBN(0x6d2dddfc, 0xd137d13b), + TOBN(0x54cde50e, 0xd2743a42), TOBN(0x89a34fc5, 0xe4d97e67)}}, + {{TOBN(0x13f1f5b3, 0x12e08ce5), TOBN(0xa80540b8, 0xa7f0b2ca), + TOBN(0x854bcf77, 0x01982805), TOBN(0xb8653ffd, 0x233bea04)}, + {TOBN(0x8e7b8787, 0x02b0b4c9), TOBN(0x2675261f, 0x9acb170a), + TOBN(0x061a9d90, 0x930c14e5), TOBN(0xb59b30e0, 0xdef0abea)}}, + {{TOBN(0x1dc19ea6, 0x0200ec7d), TOBN(0xb6f4a3f9, 0x0bce132b), + TOBN(0xb8d5de90, 0xf13e27e0), TOBN(0xbaee5ef0, 0x1fade16f)}, + {TOBN(0x6f406aaa, 0xe4c6cf38), TOBN(0xab4cfe06, 0xd1369815), + TOBN(0x0dcffe87, 0xefd550c6), TOBN(0x9d4f59c7, 0x75ff7d39)}}, + {{TOBN(0xb02553b1, 0x51deb6ad), TOBN(0x812399a4, 0xb1877749), + TOBN(0xce90f71f, 0xca6006e1), TOBN(0xc32363a6, 0xb02b6e77)}, + {TOBN(0x02284fbe, 0xdc36c64d), TOBN(0x86c81e31, 0xa7e1ae61), + TOBN(0x2576c7e5, 0xb909d94a), TOBN(0x8b6f7d02, 0x818b2bb0)}}, + {{TOBN(0xeca3ed07, 0x56faa38a), TOBN(0xa3790e6c, 0x9305bb54), + TOBN(0xd784eeda, 0x7bc73061), TOBN(0xbd56d369, 0x6dd50614)}, + {TOBN(0xd6575949, 0x229a8aa9), TOBN(0xdcca8f47, 0x4595ec28), + TOBN(0x814305c1, 0x06ab4fe6), TOBN(0xc8c39768, 0x24f43f16)}}, + {{TOBN(0xe2a45f36, 0x523f2b36), TOBN(0x995c6493, 0x920d93bb), + TOBN(0xf8afdab7, 0x90f1632b), TOBN(0x79ebbecd, 0x1c295954)}, + {TOBN(0xc7bb3ddb, 0x79592f48), TOBN(0x67216a7b, 0x5f88e998), + TOBN(0xd91f098b, 0xbc01193e), TOBN(0xf7d928a5, 0xb1db83fc)}}, + {{TOBN(0x55e38417, 0xe991f600), TOBN(0x2a91113e, 0x2981a934), + TOBN(0xcbc9d648, 0x06b13bde), TOBN(0xb011b6ac, 0x0755ff44)}, + {TOBN(0x6f4cb518, 0x045ec613), TOBN(0x522d2d31, 0xc2f5930a), + TOBN(0x5acae1af, 0x382e65de), TOBN(0x57643067, 0x27bc966f)}}, + {{TOBN(0x5e12705d, 0x1c7193f0), TOBN(0xf0f32f47, 0x3be8858e), + TOBN(0x785c3d7d, 0x96c6dfc7), TOBN(0xd75b4a20, 0xbf31795d)}, + {TOBN(0x91acf17b, 0x342659d4), TOBN(0xe596ea34, 0x44f0378f), + TOBN(0x4515708f, 0xce52129d), TOBN(0x17387e1e, 0x79f2f585)}}, + {{TOBN(0x72cfd2e9, 0x49dee168), TOBN(0x1ae05223, 0x3e2af239), + TOBN(0x009e75be, 0x1d94066a), TOBN(0x6cca31c7, 0x38abf413)}, + {TOBN(0xb50bd61d, 0x9bc49908), TOBN(0x4a9b4a8c, 0xf5e2bc1e), + TOBN(0xeb6cc5f7, 0x946f83ac), TOBN(0x27da93fc, 0xebffab28)}}, + {{TOBN(0xea314c96, 0x4821c8c5), TOBN(0x8de49ded, 0xa83c15f4), + TOBN(0x7a64cf20, 0x7af33004), TOBN(0x45f1bfeb, 0xc9627e10)}, + {TOBN(0x878b0626, 0x54b9df60), TOBN(0x5e4fdc3c, 0xa95c0b33), + TOBN(0xe54a37ca, 0xc2035d8e), TOBN(0x9087cda9, 0x80f20b8c)}}, + {{TOBN(0x36f61c23, 0x8319ade4), TOBN(0x766f287a, 0xde8cfdf8), + TOBN(0x48821948, 0x346f3705), TOBN(0x49a7b853, 0x16e4f4a2)}, + {TOBN(0xb9b3f8a7, 0x5cedadfd), TOBN(0x8f562815, 0x8db2a815), + TOBN(0xc0b7d554, 0x01f68f95), TOBN(0x12971e27, 0x688a208e)}}, + {{TOBN(0xc9f8b696, 0xd0ff34fc), TOBN(0x20824de2, 0x1222718c), + TOBN(0x7213cf9f, 0x0c95284d), TOBN(0xe2ad741b, 0xdc158240)}, + {TOBN(0x0ee3a6df, 0x54043ccf), TOBN(0x16ff479b, 0xd84412b3), + TOBN(0xf6c74ee0, 0xdfc98af0), TOBN(0xa78a169f, 0x52fcd2fb)}}, + {{TOBN(0xd8ae8746, 0x99c930e9), TOBN(0x1d33e858, 0x49e117a5), + TOBN(0x7581fcb4, 0x6624759f), TOBN(0xde50644f, 0x5bedc01d)}, + {TOBN(0xbeec5d00, 0xcaf3155e), TOBN(0x672d66ac, 0xbc73e75f), + TOBN(0x86b9d8c6, 0x270b01db), TOBN(0xd249ef83, 0x50f55b79)}}, + {{TOBN(0x6131d6d4, 0x73978fe3), TOBN(0xcc4e4542, 0x754b00a1), + TOBN(0x4e05df05, 0x57dfcfe9), TOBN(0x94b29cdd, 0x51ef6bf0)}, + {TOBN(0xe4530cff, 0x9bc7edf2), TOBN(0x8ac236fd, 0xd3da65f3), + TOBN(0x0faf7d5f, 0xc8eb0b48), TOBN(0x4d2de14c, 0x660eb039)}}, + {{TOBN(0xc006bba7, 0x60430e54), TOBN(0x10a2d0d6, 0xda3289ab), + TOBN(0x9c037a5d, 0xd7979c59), TOBN(0x04d1f3d3, 0xa116d944)}, + {TOBN(0x9ff22473, 0x8a0983cd), TOBN(0x28e25b38, 0xc883cabb), + TOBN(0xe968dba5, 0x47a58995), TOBN(0x2c80b505, 0x774eebdf)}}, + {{TOBN(0xee763b71, 0x4a953beb), TOBN(0x502e223f, 0x1642e7f6), + TOBN(0x6fe4b641, 0x61d5e722), TOBN(0x9d37c5b0, 0xdbef5316)}, + {TOBN(0x0115ed70, 0xf8330bc7), TOBN(0x139850e6, 0x75a72789), + TOBN(0x27d7faec, 0xffceccc2), TOBN(0x3016a860, 0x4fd9f7f6)}}, + {{TOBN(0xc492ec64, 0x4cd8f64c), TOBN(0x58a2d790, 0x279d7b51), + TOBN(0x0ced1fc5, 0x1fc75256), TOBN(0x3e658aed, 0x8f433017)}, + {TOBN(0x0b61942e, 0x05da59eb), TOBN(0xba3d60a3, 0x0ddc3722), + TOBN(0x7c311cd1, 0x742e7f87), TOBN(0x6473ffee, 0xf6b01b6e)}}}, + {{{TOBN(0x8303604f, 0x692ac542), TOBN(0xf079ffe1, 0x227b91d3), + TOBN(0x19f63e63, 0x15aaf9bd), TOBN(0xf99ee565, 0xf1f344fb)}, + {TOBN(0x8a1d661f, 0xd6219199), TOBN(0x8c883bc6, 0xd48ce41c), + TOBN(0x1065118f, 0x3c74d904), TOBN(0x713889ee, 0x0faf8b1b)}}, + {{TOBN(0x972b3f8f, 0x81a1b3be), TOBN(0x4f3ce145, 0xce2764a0), + TOBN(0xe2d0f1cc, 0x28c4f5f7), TOBN(0xdeee0c0d, 0xc7f3985b)}, + {TOBN(0x7df4adc0, 0xd39e25c3), TOBN(0x40619820, 0xc467a080), + TOBN(0x440ebc93, 0x61cf5a58), TOBN(0x527729a6, 0x422ad600)}}, + {{TOBN(0xca6c0937, 0xb1b76ba6), TOBN(0x1a2eab85, 0x4d2026dc), + TOBN(0xb1715e15, 0x19d9ae0a), TOBN(0xf1ad9199, 0xbac4a026)}, + {TOBN(0x35b3dfb8, 0x07ea7b0e), TOBN(0xedf5496f, 0x3ed9eb89), + TOBN(0x8932e5ff, 0x2d6d08ab), TOBN(0xf314874e, 0x25bd2731)}}, + {{TOBN(0xefb26a75, 0x3f73f449), TOBN(0x1d1c94f8, 0x8d44fc79), + TOBN(0x49f0fbc5, 0x3bc0dc4d), TOBN(0xb747ea0b, 0x3698a0d0)}, + {TOBN(0x5218c3fe, 0x228d291e), TOBN(0x35b804b5, 0x43c129d6), + TOBN(0xfac859b8, 0xd1acc516), TOBN(0x6c10697d, 0x95d6e668)}}, + {{TOBN(0xc38e438f, 0x0876fd4e), TOBN(0x45f0c307, 0x83d2f383), + TOBN(0x203cc2ec, 0xb10934cb), TOBN(0x6a8f2439, 0x2c9d46ee)}, + {TOBN(0xf16b431b, 0x65ccde7b), TOBN(0x41e2cd18, 0x27e76a6f), + TOBN(0xb9c8cf8f, 0x4e3484d7), TOBN(0x64426efd, 0x8315244a)}}, + {{TOBN(0x1c0a8e44, 0xfc94dea3), TOBN(0x34c8cdbf, 0xdad6a0b0), + TOBN(0x919c3840, 0x04113cef), TOBN(0xfd32fba4, 0x15490ffa)}, + {TOBN(0x58d190f6, 0x795dcfb7), TOBN(0xfef01b03, 0x83588baf), + TOBN(0x9e6d1d63, 0xca1fc1c0), TOBN(0x53173f96, 0xf0a41ac9)}}, + {{TOBN(0x2b1d402a, 0xba16f73b), TOBN(0x2fb31014, 0x8cf9b9fc), + TOBN(0x2d51e60e, 0x446ef7bf), TOBN(0xc731021b, 0xb91e1745)}, + {TOBN(0x9d3b4724, 0x4fee99d4), TOBN(0x4bca48b6, 0xfac5c1ea), + TOBN(0x70f5f514, 0xbbea9af7), TOBN(0x751f55a5, 0x974c283a)}}, + {{TOBN(0x6e30251a, 0xcb452fdb), TOBN(0x31ee6965, 0x50f30650), + TOBN(0xb0b3e508, 0x933548d9), TOBN(0xb8949a4f, 0xf4b0ef5b)}, + {TOBN(0x208b8326, 0x3c88f3bd), TOBN(0xab147c30, 0xdb1d9989), + TOBN(0xed6515fd, 0x44d4df03), TOBN(0x17a12f75, 0xe72eb0c5)}}, + {{TOBN(0x3b59796d, 0x36cf69db), TOBN(0x1219eee9, 0x56670c18), + TOBN(0xfe3341f7, 0x7a070d8e), TOBN(0x9b70130b, 0xa327f90c)}, + {TOBN(0x36a32462, 0x0ae18e0e), TOBN(0x2021a623, 0x46c0a638), + TOBN(0x251b5817, 0xc62eb0d4), TOBN(0x87bfbcdf, 0x4c762293)}}, + {{TOBN(0xf78ab505, 0xcdd61d64), TOBN(0x8c7a53fc, 0xc8c18857), + TOBN(0xa653ce6f, 0x16147515), TOBN(0x9c923aa5, 0xea7d52d5)}, + {TOBN(0xc24709cb, 0x5c18871f), TOBN(0x7d53bec8, 0x73b3cc74), + TOBN(0x59264aff, 0xfdd1d4c4), TOBN(0x5555917e, 0x240da582)}}, + {{TOBN(0xcae8bbda, 0x548f5a0e), TOBN(0x1910eaba, 0x3bbfbbe1), + TOBN(0xae579685, 0x7677afc3), TOBN(0x49ea61f1, 0x73ff0b5c)}, + {TOBN(0x78655478, 0x4f7c3922), TOBN(0x95d337cd, 0x20c68eef), + TOBN(0x68f1e1e5, 0xdf779ab9), TOBN(0x14b491b0, 0xb5cf69a8)}}, + {{TOBN(0x7a6cbbe0, 0x28e3fe89), TOBN(0xe7e1fee4, 0xc5aac0eb), + TOBN(0x7f47eda5, 0x697e5140), TOBN(0x4f450137, 0xb454921f)}, + {TOBN(0xdb625f84, 0x95cd8185), TOBN(0x74be0ba1, 0xcdb2e583), + TOBN(0xaee4fd7c, 0xdd5e6de4), TOBN(0x4251437d, 0xe8101739)}}, + {{TOBN(0x686d72a0, 0xac620366), TOBN(0x4be3fb9c, 0xb6d59344), + TOBN(0x6e8b44e7, 0xa1eb75b9), TOBN(0x84e39da3, 0x91a5c10c)}, + {TOBN(0x37cc1490, 0xb38f0409), TOBN(0x02951943, 0x2c2ade82), + TOBN(0x9b688783, 0x1190a2d8), TOBN(0x25627d14, 0x231182ba)}}, + {{TOBN(0x6eb550aa, 0x658a6d87), TOBN(0x1405aaa7, 0xcf9c7325), + TOBN(0xd147142e, 0x5c8748c9), TOBN(0x7f637e4f, 0x53ede0e0)}, + {TOBN(0xf8ca2776, 0x14ffad2c), TOBN(0xe58fb1bd, 0xbafb6791), + TOBN(0x17158c23, 0xbf8f93fc), TOBN(0x7f15b373, 0x0a4a4655)}}, + {{TOBN(0x39d4add2, 0xd842ca72), TOBN(0xa71e4391, 0x3ed96305), + TOBN(0x5bb09cbe, 0x6700be14), TOBN(0x68d69d54, 0xd8befcf6)}, + {TOBN(0xa45f5367, 0x37183bcf), TOBN(0x7152b7bb, 0x3370dff7), + TOBN(0xcf887baa, 0xbf12525b), TOBN(0xe7ac7bdd, 0xd6d1e3cd)}}, + {{TOBN(0x25914f78, 0x81fdad90), TOBN(0xcf638f56, 0x0d2cf6ab), + TOBN(0xb90bc03f, 0xcc054de5), TOBN(0x932811a7, 0x18b06350)}, + {TOBN(0x2f00b330, 0x9bbd11ff), TOBN(0x76108a6f, 0xb4044974), + TOBN(0x801bb9e0, 0xa851d266), TOBN(0x0dd099be, 0xbf8990c1)}}, + {{TOBN(0x58c5aaaa, 0xabe32986), TOBN(0x0fe9dd2a, 0x50d59c27), + TOBN(0x84951ff4, 0x8d307305), TOBN(0x6c23f829, 0x86529b78)}, + {TOBN(0x50bb2218, 0x0b136a79), TOBN(0x7e2174de, 0x77a20996), + TOBN(0x6f00a4b9, 0xc0bb4da6), TOBN(0x89a25a17, 0xefdde8da)}}, + {{TOBN(0xf728a27e, 0xc11ee01d), TOBN(0xf900553a, 0xe5f10dfb), + TOBN(0x189a83c8, 0x02ec893c), TOBN(0x3ca5bdc1, 0x23f66d77)}, + {TOBN(0x98781537, 0x97eada9f), TOBN(0x59c50ab3, 0x10256230), + TOBN(0x346042d9, 0x323c69b3), TOBN(0x1b715a6d, 0x2c460449)}}, + {{TOBN(0xa41dd476, 0x6ae06e0b), TOBN(0xcdd7888e, 0x9d42e25f), + TOBN(0x0f395f74, 0x56b25a20), TOBN(0xeadfe0ae, 0x8700e27e)}, + {TOBN(0xb09d52a9, 0x69950093), TOBN(0x3525d9cb, 0x327f8d40), + TOBN(0xb8235a94, 0x67df886a), TOBN(0x77e4b0dd, 0x035faec2)}}, + {{TOBN(0x115eb20a, 0x517d7061), TOBN(0x77fe3433, 0x6c2df683), + TOBN(0x6870ddc7, 0xcdc6fc67), TOBN(0xb1610588, 0x0b87de83)}, + {TOBN(0x343584ca, 0xd9c4ddbe), TOBN(0xb3164f1c, 0x3d754be2), + TOBN(0x0731ed3a, 0xc1e6c894), TOBN(0x26327dec, 0x4f6b904c)}}, + {{TOBN(0x9d49c6de, 0x97b5cd32), TOBN(0x40835dae, 0xb5eceecd), + TOBN(0xc66350ed, 0xd9ded7fe), TOBN(0x8aeebb5c, 0x7a678804)}, + {TOBN(0x51d42fb7, 0x5b8ee9ec), TOBN(0xd7a17bdd, 0x8e3ca118), + TOBN(0x40d7511a, 0x2ef4400e), TOBN(0xc48990ac, 0x875a66f4)}}, + {{TOBN(0x8de07d2a, 0x2199e347), TOBN(0xbee75556, 0x2a39e051), + TOBN(0x56918786, 0x916e51dc), TOBN(0xeb191313, 0x4a2d89ec)}, + {TOBN(0x6679610d, 0x37d341ed), TOBN(0x434fbb41, 0x56d51c2b), + TOBN(0xe54b7ee7, 0xd7492dba), TOBN(0xaa33a79a, 0x59021493)}}, + {{TOBN(0x49fc5054, 0xe4bd6d3d), TOBN(0x09540f04, 0x5ab551d0), + TOBN(0x8acc9085, 0x4942d3a6), TOBN(0x231af02f, 0x2d28323b)}, + {TOBN(0x93458cac, 0x0992c163), TOBN(0x1fef8e71, 0x888e3bb4), + TOBN(0x27578da5, 0xbe8c268c), TOBN(0xcc8be792, 0xe805ec00)}}, + {{TOBN(0x29267bae, 0xc61c3855), TOBN(0xebff429d, 0x58c1fd3b), + TOBN(0x22d886c0, 0x8c0b93b8), TOBN(0xca5e00b2, 0x2ddb8953)}, + {TOBN(0xcf330117, 0xc3fed8b7), TOBN(0xd49ac6fa, 0x819c01f6), + TOBN(0x6ddaa6bd, 0x3c0fbd54), TOBN(0x91743068, 0x8049a2cf)}}, + {{TOBN(0xd67f981e, 0xaff2ef81), TOBN(0xc3654d35, 0x2818ae80), + TOBN(0x81d05044, 0x1b2aa892), TOBN(0x2db067bf, 0x3d099328)}, + {TOBN(0xe7c79e86, 0x703dcc97), TOBN(0xe66f9b37, 0xe133e215), + TOBN(0xcdf119a6, 0xe39a7a5c), TOBN(0x47c60de3, 0x876f1b61)}}, + {{TOBN(0x6e405939, 0xd860f1b2), TOBN(0x3e9a1dbc, 0xf5ed4d4a), + TOBN(0x3f23619e, 0xc9b6bcbd), TOBN(0x5ee790cf, 0x734e4497)}, + {TOBN(0xf0a834b1, 0x5bdaf9bb), TOBN(0x02cedda7, 0x4ca295f0), + TOBN(0x4619aa2b, 0xcb8e378c), TOBN(0xe5613244, 0xcc987ea4)}}, + {{TOBN(0x0bc022cc, 0x76b23a50), TOBN(0x4a2793ad, 0x0a6c21ce), + TOBN(0x38328780, 0x89cac3f5), TOBN(0x29176f1b, 0xcba26d56)}, + {TOBN(0x06296187, 0x4f6f59eb), TOBN(0x86e9bca9, 0x8bdc658e), + TOBN(0x2ca9c4d3, 0x57e30402), TOBN(0x5438b216, 0x516a09bb)}}, + {{TOBN(0x0a6a063c, 0x7672765a), TOBN(0x37a3ce64, 0x0547b9bf), + TOBN(0x42c099c8, 0x98b1a633), TOBN(0xb5ab800d, 0x05ee6961)}, + {TOBN(0xf1963f59, 0x11a5acd6), TOBN(0xbaee6157, 0x46201063), + TOBN(0x36d9a649, 0xa596210a), TOBN(0xaed04363, 0x1ba7138c)}}, + {{TOBN(0xcf817d1c, 0xa4a82b76), TOBN(0x5586960e, 0xf3806be9), + TOBN(0x7ab67c89, 0x09dc6bb5), TOBN(0x52ace7a0, 0x114fe7eb)}, + {TOBN(0xcd987618, 0xcbbc9b70), TOBN(0x4f06fd5a, 0x604ca5e1), + TOBN(0x90af14ca, 0x6dbde133), TOBN(0x1afe4322, 0x948a3264)}}, + {{TOBN(0xa70d2ca6, 0xc44b2c6c), TOBN(0xab726799, 0x0ef87dfe), + TOBN(0x310f64dc, 0x2e696377), TOBN(0x49b42e68, 0x4c8126a0)}, + {TOBN(0x0ea444c3, 0xcea0b176), TOBN(0x53a8ddf7, 0xcb269182), + TOBN(0xf3e674eb, 0xbbba9dcb), TOBN(0x0d2878a8, 0xd8669d33)}}, + {{TOBN(0x04b935d5, 0xd019b6a3), TOBN(0xbb5cf88e, 0x406f1e46), + TOBN(0xa1912d16, 0x5b57c111), TOBN(0x9803fc21, 0x19ebfd78)}, + {TOBN(0x4f231c9e, 0xc07764a9), TOBN(0xd93286ee, 0xb75bd055), + TOBN(0x83a9457d, 0x8ee6c9de), TOBN(0x04695915, 0x6087ec90)}}, + {{TOBN(0x14c6dd8a, 0x58d6cd46), TOBN(0x9cb633b5, 0x8e6634d2), + TOBN(0xc1305047, 0xf81bc328), TOBN(0x12ede0e2, 0x26a177e5)}, + {TOBN(0x332cca62, 0x065a6f4f), TOBN(0xc3a47ecd, 0x67be487b), + TOBN(0x741eb187, 0x0f47ed1c), TOBN(0x99e66e58, 0xe7598b14)}}, + {{TOBN(0x6f0544ca, 0x63d0ff12), TOBN(0xe5efc784, 0xb610a05f), + TOBN(0xf72917b1, 0x7cad7b47), TOBN(0x3ff6ea20, 0xf2cac0c0)}, + {TOBN(0xcc23791b, 0xf21db8b7), TOBN(0x7dac70b1, 0xd7d93565), + TOBN(0x682cda1d, 0x694bdaad), TOBN(0xeb88bb8c, 0x1023516d)}}, + {{TOBN(0xc4c634b4, 0xdfdbeb1b), TOBN(0x22f5ca72, 0xb4ee4dea), + TOBN(0x1045a368, 0xe6524821), TOBN(0xed9e8a3f, 0x052b18b2)}, + {TOBN(0x9b7f2cb1, 0xb961f49a), TOBN(0x7fee2ec1, 0x7b009670), + TOBN(0x350d8754, 0x22507a6d), TOBN(0x561bd711, 0x4db55f1d)}}, + {{TOBN(0x4c189ccc, 0x320bbcaf), TOBN(0x568434cf, 0xdf1de48c), + TOBN(0x6af1b00e, 0x0fa8f128), TOBN(0xf0ba9d02, 0x8907583c)}, + {TOBN(0x735a4004, 0x32ff9f60), TOBN(0x3dd8e4b6, 0xc25dcf33), + TOBN(0xf2230f16, 0x42c74cef), TOBN(0xd8117623, 0x013fa8ad)}}, + {{TOBN(0x36822876, 0xf51fe76e), TOBN(0x8a6811cc, 0x11d62589), + TOBN(0xc3fc7e65, 0x46225718), TOBN(0xb7df2c9f, 0xc82fdbcd)}, + {TOBN(0x3b1d4e52, 0xdd7b205b), TOBN(0xb6959478, 0x47a2e414), + TOBN(0x05e4d793, 0xefa91148), TOBN(0xb47ed446, 0xfd2e9675)}}, + {{TOBN(0x1a7098b9, 0x04c9d9bf), TOBN(0x661e2881, 0x1b793048), + TOBN(0xb1a16966, 0xb01ee461), TOBN(0xbc521308, 0x2954746f)}, + {TOBN(0xc909a0fc, 0x2477de50), TOBN(0xd80bb41c, 0x7dbd51ef), + TOBN(0xa85be7ec, 0x53294905), TOBN(0x6d465b18, 0x83958f97)}}, + {{TOBN(0x16f6f330, 0xfb6840fd), TOBN(0xfaaeb214, 0x3401e6c8), + TOBN(0xaf83d30f, 0xccb5b4f8), TOBN(0x22885739, 0x266dec4b)}, + {TOBN(0x51b4367c, 0x7bc467df), TOBN(0x926562e3, 0xd842d27a), + TOBN(0xdfcb6614, 0x0fea14a6), TOBN(0xeb394dae, 0xf2734cd9)}}, + {{TOBN(0x3eeae5d2, 0x11c0be98), TOBN(0xb1e6ed11, 0x814e8165), + TOBN(0x191086bc, 0xe52bce1c), TOBN(0x14b74cc6, 0xa75a04da)}, + {TOBN(0x63cf1186, 0x8c060985), TOBN(0x071047de, 0x2dbd7f7c), + TOBN(0x4e433b8b, 0xce0942ca), TOBN(0xecbac447, 0xd8fec61d)}}, + {{TOBN(0x8f0ed0e2, 0xebf3232f), TOBN(0xfff80f9e, 0xc52a2edd), + TOBN(0xad9ab433, 0x75b55fdb), TOBN(0x73ca7820, 0xe42e0c11)}, + {TOBN(0x6dace0a0, 0xe6251b46), TOBN(0x89bc6b5c, 0x4c0d932d), + TOBN(0x3438cd77, 0x095da19a), TOBN(0x2f24a939, 0x8d48bdfb)}}, + {{TOBN(0x99b47e46, 0x766561b7), TOBN(0x736600e6, 0x0ed0322a), + TOBN(0x06a47cb1, 0x638e1865), TOBN(0x927c1c2d, 0xcb136000)}, + {TOBN(0x29542337, 0x0cc5df69), TOBN(0x99b37c02, 0x09d649a9), + TOBN(0xc5f0043c, 0x6aefdb27), TOBN(0x6cdd9987, 0x1be95c27)}}, + {{TOBN(0x69850931, 0x390420d2), TOBN(0x299c40ac, 0x0983efa4), + TOBN(0x3a05e778, 0xaf39aead), TOBN(0x84274408, 0x43a45193)}, + {TOBN(0x6bcd0fb9, 0x91a711a0), TOBN(0x461592c8, 0x9f52ab17), + TOBN(0xb49302b4, 0xda3c6ed6), TOBN(0xc51fddc7, 0x330d7067)}}, + {{TOBN(0x94babeb6, 0xda50d531), TOBN(0x521b840d, 0xa6a7b9da), + TOBN(0x5305151e, 0x404bdc89), TOBN(0x1bcde201, 0xd0d07449)}, + {TOBN(0xf427a78b, 0x3b76a59a), TOBN(0xf84841ce, 0x07791a1b), + TOBN(0xebd314be, 0xbf91ed1c), TOBN(0x8e61d34c, 0xbf172943)}}, + {{TOBN(0x1d5dc451, 0x5541b892), TOBN(0xb186ee41, 0xfc9d9e54), + TOBN(0x9d9f345e, 0xd5bf610d), TOBN(0x3e7ba65d, 0xf6acca9f)}, + {TOBN(0x9dda787a, 0xa8369486), TOBN(0x09f9dab7, 0x8eb5ba53), + TOBN(0x5afb2033, 0xd6481bc3), TOBN(0x76f4ce30, 0xafa62104)}}, + {{TOBN(0xa8fa00cf, 0xf4f066b5), TOBN(0x89ab5143, 0x461dafc2), + TOBN(0x44339ed7, 0xa3389998), TOBN(0x2ff862f1, 0xbc214903)}, + {TOBN(0x2c88f985, 0xb05556e3), TOBN(0xcd96058e, 0x3467081e), + TOBN(0x7d6a4176, 0xedc637ea), TOBN(0xe1743d09, 0x36a5acdc)}}, + {{TOBN(0x66fd72e2, 0x7eb37726), TOBN(0xf7fa264e, 0x1481a037), + TOBN(0x9fbd3bde, 0x45f4aa79), TOBN(0xed1e0147, 0x767c3e22)}, + {TOBN(0x7621f979, 0x82e7abe2), TOBN(0x19eedc72, 0x45f633f8), + TOBN(0xe69b155e, 0x6137bf3a), TOBN(0xa0ad13ce, 0x414ee94e)}}, + {{TOBN(0x93e3d524, 0x1c0e651a), TOBN(0xab1a6e2a, 0x02ce227e), + TOBN(0xe7af1797, 0x4ab27eca), TOBN(0x245446de, 0xbd444f39)}, + {TOBN(0x59e22a21, 0x56c07613), TOBN(0x43deafce, 0xf4275498), + TOBN(0x10834ccb, 0x67fd0946), TOBN(0xa75841e5, 0x47406edf)}}, + {{TOBN(0xebd6a677, 0x7b0ac93d), TOBN(0xa6e37b0d, 0x78f5e0d7), + TOBN(0x2516c096, 0x76f5492b), TOBN(0x1e4bf888, 0x9ac05f3a)}, + {TOBN(0xcdb42ce0, 0x4df0ba2b), TOBN(0x935d5cfd, 0x5062341b), + TOBN(0x8a303333, 0x82acac20), TOBN(0x429438c4, 0x5198b00e)}}, + {{TOBN(0x1d083bc9, 0x049d33fa), TOBN(0x58b82dda, 0x946f67ff), + TOBN(0xac3e2db8, 0x67a1d6a3), TOBN(0x62e6bead, 0x1798aac8)}, + {TOBN(0xfc85980f, 0xde46c58c), TOBN(0xa7f69379, 0x69c8d7be), + TOBN(0x23557927, 0x837b35ec), TOBN(0x06a933d8, 0xe0790c0c)}}, + {{TOBN(0x827c0e9b, 0x077ff55d), TOBN(0x53977798, 0xbb26e680), + TOBN(0x59530874, 0x1d9cb54f), TOBN(0xcca3f449, 0x4aac53ef)}, + {TOBN(0x11dc5c87, 0xa07eda0f), TOBN(0xc138bccf, 0xfd6400c8), + TOBN(0x549680d3, 0x13e5da72), TOBN(0xc93eed82, 0x4540617e)}}, + {{TOBN(0xfd3db157, 0x4d0b75c0), TOBN(0x9716eb42, 0x6386075b), + TOBN(0x0639605c, 0x817b2c16), TOBN(0x09915109, 0xf1e4f201)}, + {TOBN(0x35c9a928, 0x5cca6c3b), TOBN(0xb25f7d1a, 0x3505c900), + TOBN(0xeb9f7d20, 0x630480c4), TOBN(0xc3c7b8c6, 0x2a1a501c)}}, + {{TOBN(0x3f99183c, 0x5a1f8e24), TOBN(0xfdb118fa, 0x9dd255f0), + TOBN(0xb9b18b90, 0xc27f62a6), TOBN(0xe8f732f7, 0x396ec191)}, + {TOBN(0x524a2d91, 0x0be786ab), TOBN(0x5d32adef, 0x0ac5a0f5), + TOBN(0x9b53d4d6, 0x9725f694), TOBN(0x032a76c6, 0x0510ba89)}}, + {{TOBN(0x840391a3, 0xebeb1544), TOBN(0x44b7b88c, 0x3ed73ac3), + TOBN(0xd24bae7a, 0x256cb8b3), TOBN(0x7ceb151a, 0xe394cb12)}, + {TOBN(0xbd6b66d0, 0x5bc1e6a8), TOBN(0xec70cecb, 0x090f07bf), + TOBN(0x270644ed, 0x7d937589), TOBN(0xee9e1a3d, 0x5f1dccfe)}}, + {{TOBN(0xb0d40a84, 0x745b98d2), TOBN(0xda429a21, 0x2556ed40), + TOBN(0xf676eced, 0x85148cb9), TOBN(0x5a22d40c, 0xded18936)}, + {TOBN(0x3bc4b9e5, 0x70e8a4ce), TOBN(0xbfd1445b, 0x9eae0379), + TOBN(0xf23f2c0c, 0x1a0bd47e), TOBN(0xa9c0bb31, 0xe1845531)}}, + {{TOBN(0x9ddc4d60, 0x0a4c3f6b), TOBN(0xbdfaad79, 0x2c15ef44), + TOBN(0xce55a236, 0x7f484acc), TOBN(0x08653ca7, 0x055b1f15)}, + {TOBN(0x2efa8724, 0x538873a3), TOBN(0x09299e5d, 0xace1c7e7), + TOBN(0x07afab66, 0xade332ba), TOBN(0x9be1fdf6, 0x92dd71b7)}}, + {{TOBN(0xa49b5d59, 0x5758b11c), TOBN(0x0b852893, 0xc8654f40), + TOBN(0xb63ef6f4, 0x52379447), TOBN(0xd4957d29, 0x105e690c)}, + {TOBN(0x7d484363, 0x646559b0), TOBN(0xf4a8273c, 0x49788a8e), + TOBN(0xee406cb8, 0x34ce54a9), TOBN(0x1e1c260f, 0xf86fda9b)}}, + {{TOBN(0xe150e228, 0xcf6a4a81), TOBN(0x1fa3b6a3, 0x1b488772), + TOBN(0x1e6ff110, 0xc5a9c15b), TOBN(0xc6133b91, 0x8ad6aa47)}, + {TOBN(0x8ac5d55c, 0x9dffa978), TOBN(0xba1d1c1d, 0x5f3965f2), + TOBN(0xf969f4e0, 0x7732b52f), TOBN(0xfceecdb5, 0xa5172a07)}}, + {{TOBN(0xb0120a5f, 0x10f2b8f5), TOBN(0xc83a6cdf, 0x5c4c2f63), + TOBN(0x4d47a491, 0xf8f9c213), TOBN(0xd9e1cce5, 0xd3f1bbd5)}, + {TOBN(0x0d91bc7c, 0xaba7e372), TOBN(0xfcdc74c8, 0xdfd1a2db), + TOBN(0x05efa800, 0x374618e5), TOBN(0x11216969, 0x15a7925e)}}, + {{TOBN(0xd4c89823, 0xf6021c5d), TOBN(0x880d5e84, 0xeff14423), + TOBN(0x6523bc5a, 0x6dcd1396), TOBN(0xd1acfdfc, 0x113c978b)}, + {TOBN(0xb0c164e8, 0xbbb66840), TOBN(0xf7f4301e, 0x72b58459), + TOBN(0xc29ad4a6, 0xa638e8ec), TOBN(0xf5ab8961, 0x46b78699)}}, + {{TOBN(0x9dbd7974, 0x0e954750), TOBN(0x0121de88, 0x64f9d2c6), + TOBN(0x2e597b42, 0xd985232e), TOBN(0x55b6c3c5, 0x53451777)}, + {TOBN(0xbb53e547, 0x519cb9fb), TOBN(0xf134019f, 0x8428600d), + TOBN(0x5a473176, 0xe081791a), TOBN(0x2f3e2263, 0x35fb0c08)}}, + {{TOBN(0xb28c3017, 0x73d273b0), TOBN(0xccd21076, 0x7721ef9a), + TOBN(0x054cc292, 0xb650dc39), TOBN(0x662246de, 0x6188045e)}, + {TOBN(0x904b52fa, 0x6b83c0d1), TOBN(0xa72df267, 0x97e9cd46), + TOBN(0x886b43cd, 0x899725e4), TOBN(0x2b651688, 0xd849ff22)}}, + {{TOBN(0x60479b79, 0x02f34533), TOBN(0x5e354c14, 0x0c77c148), + TOBN(0xb4bb7581, 0xa8537c78), TOBN(0x188043d7, 0xefe1495f)}, + {TOBN(0x9ba12f42, 0x8c1d5026), TOBN(0x2e0c8a26, 0x93d4aaab), + TOBN(0xbdba7b8b, 0xaa57c450), TOBN(0x140c9ad6, 0x9bbdafef)}}, + {{TOBN(0x2067aa42, 0x25ac0f18), TOBN(0xf7b1295b, 0x04d1fbf3), + TOBN(0x14829111, 0xa4b04824), TOBN(0x2ce3f192, 0x33bd5e91)}, + {TOBN(0x9c7a1d55, 0x8f2e1b72), TOBN(0xfe932286, 0x302aa243), + TOBN(0x497ca7b4, 0xd4be9554), TOBN(0xb8e821b8, 0xe0547a6e)}}, + {{TOBN(0xfb2838be, 0x67e573e0), TOBN(0x05891db9, 0x4084c44b), + TOBN(0x91311373, 0x96c1c2c5), TOBN(0x6aebfa3f, 0xd958444b)}, + {TOBN(0xac9cdce9, 0xe56e55c1), TOBN(0x7148ced3, 0x2caa46d0), + TOBN(0x2e10c7ef, 0xb61fe8eb), TOBN(0x9fd835da, 0xff97cf4d)}}}, + {{{TOBN(0xa36da109, 0x081e9387), TOBN(0xfb9780d7, 0x8c935828), + TOBN(0xd5940332, 0xe540b015), TOBN(0xc9d7b51b, 0xe0f466fa)}, + {TOBN(0xfaadcd41, 0xd6d9f671), TOBN(0xba6c1e28, 0xb1a2ac17), + TOBN(0x066a7833, 0xed201e5f), TOBN(0x19d99719, 0xf90f462b)}}, + {{TOBN(0xf431f462, 0x060b5f61), TOBN(0xa56f46b4, 0x7bd057c2), + TOBN(0x348dca6c, 0x47e1bf65), TOBN(0x9a38783e, 0x41bcf1ff)}, + {TOBN(0x7a5d33a9, 0xda710718), TOBN(0x5a779987, 0x2e0aeaf6), + TOBN(0xca87314d, 0x2d29d187), TOBN(0xfa0edc3e, 0xc687d733)}}, + {{TOBN(0x9df33621, 0x6a31e09b), TOBN(0xde89e44d, 0xc1350e35), + TOBN(0x29214871, 0x4ca0cf52), TOBN(0xdf379672, 0x0b88a538)}, + {TOBN(0xc92a510a, 0x2591d61b), TOBN(0x79aa87d7, 0x585b447b), + TOBN(0xf67db604, 0xe5287f77), TOBN(0x1697c8bf, 0x5efe7a80)}}, + {{TOBN(0x1c894849, 0xcb198ac7), TOBN(0xa884a93d, 0x0f264665), + TOBN(0x2da964ef, 0x9b200678), TOBN(0x3c351b87, 0x009834e6)}, + {TOBN(0xafb2ef9f, 0xe2c4b44b), TOBN(0x580f6c47, 0x3326790c), + TOBN(0xb8480521, 0x0b02264a), TOBN(0x8ba6f9e2, 0x42a194e2)}}, + {{TOBN(0xfc87975f, 0x8fb54738), TOBN(0x35160788, 0x27c3ead3), + TOBN(0x834116d2, 0xb74a085a), TOBN(0x53c99a73, 0xa62fe996)}, + {TOBN(0x87585be0, 0x5b81c51b), TOBN(0x925bafa8, 0xbe0852b7), + TOBN(0x76a4fafd, 0xa84d19a7), TOBN(0x39a45982, 0x585206d4)}}, + {{TOBN(0x499b6ab6, 0x5eb03c0e), TOBN(0xf19b7954, 0x72bc3fde), + TOBN(0xa86b5b9c, 0x6e3a80d2), TOBN(0xe4377508, 0x6d42819f)}, + {TOBN(0xc1663650, 0xbb3ee8a3), TOBN(0x75eb14fc, 0xb132075f), + TOBN(0xa8ccc906, 0x7ad834f6), TOBN(0xea6a2474, 0xe6e92ffd)}}, + {{TOBN(0x9d72fd95, 0x0f8d6758), TOBN(0xcb84e101, 0x408c07dd), + TOBN(0xb9114bfd, 0xa5e23221), TOBN(0x358b5fe2, 0xe94e742c)}, + {TOBN(0x1c0577ec, 0x95f40e75), TOBN(0xf0155451, 0x3d73f3d6), + TOBN(0x9d55cd67, 0xbd1b9b66), TOBN(0x63e86e78, 0xaf8d63c7)}}, + {{TOBN(0x39d934ab, 0xd3c095f1), TOBN(0x04b261be, 0xe4b76d71), + TOBN(0x1d2e6970, 0xe73e6984), TOBN(0x879fb23b, 0x5e5fcb11)}, + {TOBN(0x11506c72, 0xdfd75490), TOBN(0x3a97d085, 0x61bcf1c1), + TOBN(0x43201d82, 0xbf5e7007), TOBN(0x7f0ac52f, 0x798232a7)}}, + {{TOBN(0x2715cbc4, 0x6eb564d4), TOBN(0x8d6c752c, 0x9e570e29), + TOBN(0xf80247c8, 0x9ef5fd5d), TOBN(0xc3c66b46, 0xd53eb514)}, + {TOBN(0x9666b401, 0x0f87de56), TOBN(0xce62c06f, 0xc6c603b5), + TOBN(0xae7b4c60, 0x7e4fc942), TOBN(0x38ac0b77, 0x663a9c19)}}, + {{TOBN(0xcb4d20ee, 0x4b049136), TOBN(0x8b63bf12, 0x356a4613), + TOBN(0x1221aef6, 0x70e08128), TOBN(0xe62d8c51, 0x4acb6b16)}, + {TOBN(0x71f64a67, 0x379e7896), TOBN(0xb25237a2, 0xcafd7fa5), + TOBN(0xf077bd98, 0x3841ba6a), TOBN(0xc4ac0244, 0x3cd16e7e)}}, + {{TOBN(0x548ba869, 0x21fea4ca), TOBN(0xd36d0817, 0xf3dfdac1), + TOBN(0x09d8d71f, 0xf4685faf), TOBN(0x8eff66be, 0xc52c459a)}, + {TOBN(0x182faee7, 0x0b57235e), TOBN(0xee3c39b1, 0x0106712b), + TOBN(0x5107331f, 0xc0fcdcb0), TOBN(0x669fb9dc, 0xa51054ba)}}, + {{TOBN(0xb25101fb, 0x319d7682), TOBN(0xb0293129, 0x0a982fee), + TOBN(0x51c1c9b9, 0x0261b344), TOBN(0x0e008c5b, 0xbfd371fa)}, + {TOBN(0xd866dd1c, 0x0278ca33), TOBN(0x666f76a6, 0xe5aa53b1), + TOBN(0xe5cfb779, 0x6013a2cf), TOBN(0x1d3a1aad, 0xa3521836)}}, + {{TOBN(0xcedd2531, 0x73faa485), TOBN(0xc8ee6c4f, 0xc0a76878), + TOBN(0xddbccfc9, 0x2a11667d), TOBN(0x1a418ea9, 0x1c2f695a)}, + {TOBN(0xdb11bd92, 0x51f73971), TOBN(0x3e4b3c82, 0xda2ed89f), + TOBN(0x9a44f3f4, 0xe73e0319), TOBN(0xd1e3de0f, 0x303431af)}}, + {{TOBN(0x3c5604ff, 0x50f75f9c), TOBN(0x1d8eddf3, 0x7e752b22), + TOBN(0x0ef074dd, 0x3c9a1118), TOBN(0xd0ffc172, 0xccb86d7b)}, + {TOBN(0xabd1ece3, 0x037d90f2), TOBN(0xe3f307d6, 0x6055856c), + TOBN(0x422f9328, 0x7e4c6daf), TOBN(0x902aac66, 0x334879a0)}}, + {{TOBN(0xb6a1e7bf, 0x94cdfade), TOBN(0x6c97e1ed, 0x7fc6d634), + TOBN(0x662ad24d, 0xa2fb63f8), TOBN(0xf81be1b9, 0xa5928405)}, + {TOBN(0x86d765e4, 0xd14b4206), TOBN(0xbecc2e0e, 0x8fa0db65), + TOBN(0xa28838e0, 0xb17fc76c), TOBN(0xe49a602a, 0xe37cf24e)}}, + {{TOBN(0x76b4131a, 0x567193ec), TOBN(0xaf3c305a, 0xe5f6e70b), + TOBN(0x9587bd39, 0x031eebdd), TOBN(0x5709def8, 0x71bbe831)}, + {TOBN(0x57059983, 0x0eb2b669), TOBN(0x4d80ce1b, 0x875b7029), + TOBN(0x838a7da8, 0x0364ac16), TOBN(0x2f431d23, 0xbe1c83ab)}}, + {{TOBN(0xe56812a6, 0xf9294dd3), TOBN(0xb448d01f, 0x9b4b0d77), + TOBN(0xf3ae6061, 0x04e8305c), TOBN(0x2bead645, 0x94d8c63e)}, + {TOBN(0x0a85434d, 0x84fd8b07), TOBN(0x537b983f, 0xf7a9dee5), + TOBN(0xedcc5f18, 0xef55bd85), TOBN(0x2041af62, 0x21c6cf8b)}}, + {{TOBN(0x8e52874c, 0xb940c71e), TOBN(0x211935a9, 0xdb5f4b3a), + TOBN(0x94350492, 0x301b1dc3), TOBN(0x33d2646d, 0x29958620)}, + {TOBN(0x16b0d64b, 0xef911404), TOBN(0x9d1f25ea, 0x9a3c5ef4), + TOBN(0x20f200eb, 0x4a352c78), TOBN(0x43929f2c, 0x4bd0b428)}}, + {{TOBN(0xa5656667, 0xc7196e29), TOBN(0x7992c2f0, 0x9391be48), + TOBN(0xaaa97cbd, 0x9ee0cd6e), TOBN(0x51b0310c, 0x3dc8c9bf)}, + {TOBN(0x237f8acf, 0xdd9f22cb), TOBN(0xbb1d81a1, 0xb585d584), + TOBN(0x8d5d85f5, 0x8c416388), TOBN(0x0d6e5a5a, 0x42fe474f)}}, + {{TOBN(0xe7812766, 0x38235d4e), TOBN(0x1c62bd67, 0x496e3298), + TOBN(0x8378660c, 0x3f175bc8), TOBN(0x4d04e189, 0x17afdd4d)}, + {TOBN(0x32a81601, 0x85a8068c), TOBN(0xdb58e4e1, 0x92b29a85), + TOBN(0xe8a65b86, 0xc70d8a3b), TOBN(0x5f0e6f4e, 0x98a0403b)}}, + {{TOBN(0x08129684, 0x69ed2370), TOBN(0x34dc30bd, 0x0871ee26), + TOBN(0x3a5ce948, 0x7c9c5b05), TOBN(0x7d487b80, 0x43a90c87)}, + {TOBN(0x4089ba37, 0xdd0e7179), TOBN(0x45f80191, 0xb4041811), + TOBN(0x1c3e1058, 0x98747ba5), TOBN(0x98c4e13a, 0x6e1ae592)}}, + {{TOBN(0xd44636e6, 0xe82c9f9e), TOBN(0x711db87c, 0xc33a1043), + TOBN(0x6f431263, 0xaa8aec05), TOBN(0x43ff120d, 0x2744a4aa)}, + {TOBN(0xd3bd892f, 0xae77779b), TOBN(0xf0fe0cc9, 0x8cdc9f82), + TOBN(0xca5f7fe6, 0xf1c5b1bc), TOBN(0xcc63a682, 0x44929a72)}}, + {{TOBN(0xc7eaba0c, 0x09dbe19a), TOBN(0x2f3585ad, 0x6b5c73c2), + TOBN(0x8ab8924b, 0x0ae50c30), TOBN(0x17fcd27a, 0x638b30ba)}, + {TOBN(0xaf414d34, 0x10b3d5a5), TOBN(0x09c107d2, 0x2a9accf1), + TOBN(0x15dac49f, 0x946a6242), TOBN(0xaec3df2a, 0xd707d642)}}, + {{TOBN(0x2c2492b7, 0x3f894ae0), TOBN(0xf59df3e5, 0xb75f18ce), + TOBN(0x7cb740d2, 0x8f53cad0), TOBN(0x3eb585fb, 0xc4f01294)}, + {TOBN(0x17da0c86, 0x32c7f717), TOBN(0xeb8c795b, 0xaf943f4c), + TOBN(0x4ee23fb5, 0xf67c51d2), TOBN(0xef187575, 0x68889949)}}, + {{TOBN(0xa6b4bdb2, 0x0389168b), TOBN(0xc4ecd258, 0xea577d03), + TOBN(0x3a63782b, 0x55743082), TOBN(0x6f678f4c, 0xc72f08cd)}, + {TOBN(0x553511cf, 0x65e58dd8), TOBN(0xd53b4e3e, 0xd402c0cd), + TOBN(0x37de3e29, 0xa037c14c), TOBN(0x86b6c516, 0xc05712aa)}}, + {{TOBN(0x2834da3e, 0xb38dff6f), TOBN(0xbe012c52, 0xea636be8), + TOBN(0x292d238c, 0x61dd37f8), TOBN(0x0e54523f, 0x8f8142db)}, + {TOBN(0xe31eb436, 0x036a05d8), TOBN(0x83e3cdff, 0x1e93c0ff), + TOBN(0x3fd2fe0f, 0x50821ddf), TOBN(0xc8e19b0d, 0xff9eb33b)}}, + {{TOBN(0xc8cc943f, 0xb569a5fe), TOBN(0xad0090d4, 0xd4342d75), + TOBN(0x82090b4b, 0xcaeca000), TOBN(0xca39687f, 0x1bd410eb)}, + {TOBN(0xe7bb0df7, 0x65959d77), TOBN(0x39d78218, 0x9c964999), + TOBN(0xd87f62e8, 0xb2415451), TOBN(0xe5efb774, 0xbed76108)}}, + {{TOBN(0x3ea011a4, 0xe822f0d0), TOBN(0xbc647ad1, 0x5a8704f8), + TOBN(0xbb315b35, 0x50c6820f), TOBN(0x863dec3d, 0xb7e76bec)}, + {TOBN(0x01ff5d3a, 0xf017bfc7), TOBN(0x20054439, 0x976b8229), + TOBN(0x067fca37, 0x0bbd0d3b), TOBN(0xf63dde64, 0x7f5e3d0f)}}, + {{TOBN(0x22dbefb3, 0x2a4c94e9), TOBN(0xafbff0fe, 0x96f8278a), + TOBN(0x80aea0b1, 0x3503793d), TOBN(0xb2238029, 0x5f06cd29)}, + {TOBN(0x65703e57, 0x8ec3feca), TOBN(0x06c38314, 0x393e7053), + TOBN(0xa0b751eb, 0x7c6734c4), TOBN(0xd2e8a435, 0xc59f0f1e)}}, + {{TOBN(0x147d9052, 0x5e9ca895), TOBN(0x2f4dd31e, 0x972072df), + TOBN(0xa16fda8e, 0xe6c6755c), TOBN(0xc66826ff, 0xcf196558)}, + {TOBN(0x1f1a76a3, 0x0cf43895), TOBN(0xa9d604e0, 0x83c3097b), + TOBN(0xe1908309, 0x66390e0e), TOBN(0xa50bf753, 0xb3c85eff)}}, + {{TOBN(0x0696bdde, 0xf6a70251), TOBN(0x548b801b, 0x3c6ab16a), + TOBN(0x37fcf704, 0xa4d08762), TOBN(0x090b3def, 0xdff76c4e)}, + {TOBN(0x87e8cb89, 0x69cb9158), TOBN(0x44a90744, 0x995ece43), + TOBN(0xf85395f4, 0x0ad9fbf5), TOBN(0x49b0f6c5, 0x4fb0c82d)}}, + {{TOBN(0x75d9bc15, 0xadf7cccf), TOBN(0x81a3e5d6, 0xdfa1e1b0), + TOBN(0x8c39e444, 0x249bc17e), TOBN(0xf37dccb2, 0x8ea7fd43)}, + {TOBN(0xda654873, 0x907fba12), TOBN(0x35daa6da, 0x4a372904), + TOBN(0x0564cfc6, 0x6283a6c5), TOBN(0xd09fa4f6, 0x4a9395bf)}}, + {{TOBN(0x688e9ec9, 0xaeb19a36), TOBN(0xd913f1ce, 0xc7bfbfb4), + TOBN(0x797b9a3c, 0x61c2faa6), TOBN(0x2f979bec, 0x6a0a9c12)}, + {TOBN(0xb5969d0f, 0x359679ec), TOBN(0xebcf523d, 0x079b0460), + TOBN(0xfd6b0008, 0x10fab870), TOBN(0x3f2edcda, 0x9373a39c)}}, + {{TOBN(0x0d64f9a7, 0x6f568431), TOBN(0xf848c27c, 0x02f8898c), + TOBN(0xf418ade1, 0x260b5bd5), TOBN(0xc1f3e323, 0x6973dee8)}, + {TOBN(0x46e9319c, 0x26c185dd), TOBN(0x6d85b7d8, 0x546f0ac4), + TOBN(0x427965f2, 0x247f9d57), TOBN(0xb519b636, 0xb0035f48)}}, + {{TOBN(0x6b6163a9, 0xab87d59c), TOBN(0xff9f58c3, 0x39caaa11), + TOBN(0x4ac39cde, 0x3177387b), TOBN(0x5f6557c2, 0x873e77f9)}, + {TOBN(0x67504006, 0x36a83041), TOBN(0x9b1c96ca, 0x75ef196c), + TOBN(0xf34283de, 0xb08c7940), TOBN(0x7ea09644, 0x1128c316)}}, + {{TOBN(0xb510b3b5, 0x6aa39dff), TOBN(0x59b43da2, 0x9f8e4d8c), + TOBN(0xa8ce31fd, 0x9e4c4b9f), TOBN(0x0e20be26, 0xc1303c01)}, + {TOBN(0x18187182, 0xe8ee47c9), TOBN(0xd9687cdb, 0x7db98101), + TOBN(0x7a520e4d, 0xa1e14ff6), TOBN(0x429808ba, 0x8836d572)}}, + {{TOBN(0xa37ca60d, 0x4944b663), TOBN(0xf901f7a9, 0xa3f91ae5), + TOBN(0xe4e3e76e, 0x9e36e3b1), TOBN(0x9aa219cf, 0x29d93250)}, + {TOBN(0x347fe275, 0x056a2512), TOBN(0xa4d643d9, 0xde65d95c), + TOBN(0x9669d396, 0x699fc3ed), TOBN(0xb598dee2, 0xcf8c6bbe)}}, + {{TOBN(0x682ac1e5, 0xdda9e5c6), TOBN(0x4e0d3c72, 0xcaa9fc95), + TOBN(0x17faaade, 0x772bea44), TOBN(0x5ef8428c, 0xab0009c8)}, + {TOBN(0xcc4ce47a, 0x460ff016), TOBN(0xda6d12bf, 0x725281cb), + TOBN(0x44c67848, 0x0223aad2), TOBN(0x6e342afa, 0x36256e28)}}, + {{TOBN(0x1400bb0b, 0x93a37c04), TOBN(0x62b1bc9b, 0xdd10bd96), + TOBN(0x7251adeb, 0x0dac46b7), TOBN(0x7d33b92e, 0x7be4ef51)}, + {TOBN(0x28b2a94b, 0xe61fa29a), TOBN(0x4b2be13f, 0x06422233), + TOBN(0x36d6d062, 0x330d8d37), TOBN(0x5ef80e1e, 0xb28ca005)}}, + {{TOBN(0x174d4699, 0x6d16768e), TOBN(0x9fc4ff6a, 0x628bf217), + TOBN(0x77705a94, 0x154e490d), TOBN(0x9d96dd28, 0x8d2d997a)}, + {TOBN(0x77e2d9d8, 0xce5d72c4), TOBN(0x9d06c5a4, 0xc11c714f), + TOBN(0x02aa5136, 0x79e4a03e), TOBN(0x1386b3c2, 0x030ff28b)}}, + {{TOBN(0xfe82e8a6, 0xfb283f61), TOBN(0x7df203e5, 0xf3abc3fb), + TOBN(0xeec7c351, 0x3a4d3622), TOBN(0xf7d17dbf, 0xdf762761)}, + {TOBN(0xc3956e44, 0x522055f0), TOBN(0xde3012db, 0x8fa748db), + TOBN(0xca9fcb63, 0xbf1dcc14), TOBN(0xa56d9dcf, 0xbe4e2f3a)}}, + {{TOBN(0xb86186b6, 0x8bcec9c2), TOBN(0x7cf24df9, 0x680b9f06), + TOBN(0xc46b45ea, 0xc0d29281), TOBN(0xfff42bc5, 0x07b10e12)}, + {TOBN(0x12263c40, 0x4d289427), TOBN(0x3d5f1899, 0xb4848ec4), + TOBN(0x11f97010, 0xd040800c), TOBN(0xb4c5f529, 0x300feb20)}}, + {{TOBN(0xcc543f8f, 0xde94fdcb), TOBN(0xe96af739, 0xc7c2f05e), + TOBN(0xaa5e0036, 0x882692e1), TOBN(0x09c75b68, 0x950d4ae9)}, + {TOBN(0x62f63df2, 0xb5932a7a), TOBN(0x2658252e, 0xde0979ad), + TOBN(0x2a19343f, 0xb5e69631), TOBN(0x718c7501, 0x525b666b)}}, + {{TOBN(0x26a42d69, 0xea40dc3a), TOBN(0xdc84ad22, 0xaecc018f), + TOBN(0x25c36c7b, 0x3270f04a), TOBN(0x46ba6d47, 0x50fa72ed)}, + {TOBN(0x6c37d1c5, 0x93e58a8e), TOBN(0xa2394731, 0x120c088c), + TOBN(0xc3be4263, 0xcb6e86da), TOBN(0x2c417d36, 0x7126d038)}}, + {{TOBN(0x5b70f9c5, 0x8b6f8efa), TOBN(0x671a2faa, 0x37718536), + TOBN(0xd3ced3c6, 0xb539c92b), TOBN(0xe56f1bd9, 0xa31203c2)}, + {TOBN(0x8b096ec4, 0x9ff3c8eb), TOBN(0x2deae432, 0x43491cea), + TOBN(0x2465c6eb, 0x17943794), TOBN(0x5d267e66, 0x20586843)}}, + {{TOBN(0x9d3d116d, 0xb07159d0), TOBN(0xae07a67f, 0xc1896210), + TOBN(0x8fc84d87, 0xbb961579), TOBN(0x30009e49, 0x1c1f8dd6)}, + {TOBN(0x8a8caf22, 0xe3132819), TOBN(0xcffa197c, 0xf23ab4ff), + TOBN(0x58103a44, 0x205dd687), TOBN(0x57b796c3, 0x0ded67a2)}}, + {{TOBN(0x0b9c3a6c, 0xa1779ad7), TOBN(0xa33cfe2e, 0x357c09c5), + TOBN(0x2ea29315, 0x3db4a57e), TOBN(0x91959695, 0x8ebeb52e)}, + {TOBN(0x118db9a6, 0xe546c879), TOBN(0x8e996df4, 0x6295c8d6), + TOBN(0xdd990484, 0x55ec806b), TOBN(0x24f291ca, 0x165c1035)}}, + {{TOBN(0xcca523bb, 0x440e2229), TOBN(0x324673a2, 0x73ef4d04), + TOBN(0xaf3adf34, 0x3e11ec39), TOBN(0x6136d7f1, 0xdc5968d3)}, + {TOBN(0x7a7b2899, 0xb053a927), TOBN(0x3eaa2661, 0xae067ecd), + TOBN(0x8549b9c8, 0x02779cd9), TOBN(0x061d7940, 0xc53385ea)}}, + {{TOBN(0x3e0ba883, 0xf06d18bd), TOBN(0x4ba6de53, 0xb2700843), + TOBN(0xb966b668, 0x591a9e4d), TOBN(0x93f67567, 0x7f4fa0ed)}, + {TOBN(0x5a02711b, 0x4347237b), TOBN(0xbc041e2f, 0xe794608e), + TOBN(0x55af10f5, 0x70f73d8c), TOBN(0xd2d4d4f7, 0xbb7564f7)}}, + {{TOBN(0xd7d27a89, 0xb3e93ce7), TOBN(0xf7b5a875, 0x5d3a2c1b), + TOBN(0xb29e68a0, 0x255b218a), TOBN(0xb533837e, 0x8af76754)}, + {TOBN(0xd1b05a73, 0x579fab2e), TOBN(0xb41055a1, 0xecd74385), + TOBN(0xb2369274, 0x445e9115), TOBN(0x2972a7c4, 0xf520274e)}}, + {{TOBN(0x6c08334e, 0xf678e68a), TOBN(0x4e4160f0, 0x99b057ed), + TOBN(0x3cfe11b8, 0x52ccb69a), TOBN(0x2fd1823a, 0x21c8f772)}, + {TOBN(0xdf7f072f, 0x3298f055), TOBN(0x8c0566f9, 0xfec74a6e), + TOBN(0xe549e019, 0x5bb4d041), TOBN(0x7c3930ba, 0x9208d850)}}, + {{TOBN(0xe07141fc, 0xaaa2902b), TOBN(0x539ad799, 0xe4f69ad3), + TOBN(0xa6453f94, 0x813f9ffd), TOBN(0xc58d3c48, 0x375bc2f7)}, + {TOBN(0xb3326fad, 0x5dc64e96), TOBN(0x3aafcaa9, 0xb240e354), + TOBN(0x1d1b0903, 0xaca1e7a9), TOBN(0x4ceb9767, 0x1211b8a0)}}, + {{TOBN(0xeca83e49, 0xe32a858e), TOBN(0x4c32892e, 0xae907bad), + TOBN(0xd5b42ab6, 0x2eb9b494), TOBN(0x7fde3ee2, 0x1eabae1b)}, + {TOBN(0x13b5ab09, 0xcaf54957), TOBN(0xbfb028be, 0xe5f5d5d5), + TOBN(0x928a0650, 0x2003e2c0), TOBN(0x90793aac, 0x67476843)}}, + {{TOBN(0x5e942e79, 0xc81710a0), TOBN(0x557e4a36, 0x27ccadd4), + TOBN(0x72a2bc56, 0x4bcf6d0c), TOBN(0x09ee5f43, 0x26d7b80c)}, + {TOBN(0x6b70dbe9, 0xd4292f19), TOBN(0x56f74c26, 0x63f16b18), + TOBN(0xc23db0f7, 0x35fbb42a), TOBN(0xb606bdf6, 0x6ae10040)}}, + {{TOBN(0x1eb15d4d, 0x044573ac), TOBN(0x7dc3cf86, 0x556b0ba4), + TOBN(0x97af9a33, 0xc60df6f7), TOBN(0x0b1ef85c, 0xa716ce8c)}, + {TOBN(0x2922f884, 0xc96958be), TOBN(0x7c32fa94, 0x35690963), + TOBN(0x2d7f667c, 0xeaa00061), TOBN(0xeaaf7c17, 0x3547365c)}}, + {{TOBN(0x1eb4de46, 0x87032d58), TOBN(0xc54f3d83, 0x5e2c79e0), + TOBN(0x07818df4, 0x5d04ef23), TOBN(0x55faa9c8, 0x673d41b4)}, + {TOBN(0xced64f6f, 0x89b95355), TOBN(0x4860d2ea, 0xb7415c84), + TOBN(0x5fdb9bd2, 0x050ebad3), TOBN(0xdb53e0cc, 0x6685a5bf)}}, + {{TOBN(0xb830c031, 0x9feb6593), TOBN(0xdd87f310, 0x6accff17), + TOBN(0x2303ebab, 0x9f555c10), TOBN(0x94603695, 0x287e7065)}, + {TOBN(0xf88311c3, 0x2e83358c), TOBN(0x508dd9b4, 0xeefb0178), + TOBN(0x7ca23706, 0x2dba8652), TOBN(0x62aac5a3, 0x0047abe5)}}, + {{TOBN(0x9a61d2a0, 0x8b1ea7b3), TOBN(0xd495ab63, 0xae8b1485), + TOBN(0x38740f84, 0x87052f99), TOBN(0x178ebe5b, 0xb2974eea)}, + {TOBN(0x030bbcca, 0x5b36d17f), TOBN(0xb5e4cce3, 0xaaf86eea), + TOBN(0xb51a0220, 0x68f8e9e0), TOBN(0xa4348796, 0x09eb3e75)}}, + {{TOBN(0xbe592309, 0xeef1a752), TOBN(0x5d7162d7, 0x6f2aa1ed), + TOBN(0xaebfb5ed, 0x0f007dd2), TOBN(0x255e14b2, 0xc89edd22)}, + {TOBN(0xba85e072, 0x0303b697), TOBN(0xc5d17e25, 0xf05720ff), + TOBN(0x02b58d6e, 0x5128ebb6), TOBN(0x2c80242d, 0xd754e113)}}, + {{TOBN(0x919fca5f, 0xabfae1ca), TOBN(0x937afaac, 0x1a21459b), + TOBN(0x9e0ca91c, 0x1f66a4d2), TOBN(0x194cc7f3, 0x23ec1331)}, + {TOBN(0xad25143a, 0x8aa11690), TOBN(0xbe40ad8d, 0x09b59e08), + TOBN(0x37d60d9b, 0xe750860a), TOBN(0x6c53b008, 0xc6bf434c)}}, + {{TOBN(0xb572415d, 0x1356eb80), TOBN(0xb8bf9da3, 0x9578ded8), + TOBN(0x22658e36, 0x5e8fb38b), TOBN(0x9b70ce22, 0x5af8cb22)}, + {TOBN(0x7c00018a, 0x829a8180), TOBN(0x84329f93, 0xb81ed295), + TOBN(0x7c343ea2, 0x5f3cea83), TOBN(0x38f8655f, 0x67586536)}}, + {{TOBN(0xa661a0d0, 0x1d3ec517), TOBN(0x98744652, 0x512321ae), + TOBN(0x084ca591, 0xeca92598), TOBN(0xa9bb9dc9, 0x1dcb3feb)}, + {TOBN(0x14c54355, 0x78b4c240), TOBN(0x5ed62a3b, 0x610cafdc), + TOBN(0x07512f37, 0x1b38846b), TOBN(0x571bb70a, 0xb0e38161)}}, + {{TOBN(0xb556b95b, 0x2da705d2), TOBN(0x3ef8ada6, 0xb1a08f98), + TOBN(0x85302ca7, 0xddecfbe5), TOBN(0x0e530573, 0x943105cd)}, + {TOBN(0x60554d55, 0x21a9255d), TOBN(0x63a32fa1, 0xf2f3802a), + TOBN(0x35c8c5b0, 0xcd477875), TOBN(0x97f458ea, 0x6ad42da1)}}, + {{TOBN(0x832d7080, 0xeb6b242d), TOBN(0xd30bd023, 0x3b71e246), + TOBN(0x7027991b, 0xbe31139d), TOBN(0x68797e91, 0x462e4e53)}, + {TOBN(0x423fe20a, 0x6b4e185a), TOBN(0x82f2c67e, 0x42d9b707), + TOBN(0x25c81768, 0x4cf7811b), TOBN(0xbd53005e, 0x045bb95d)}}}, + {{{TOBN(0xe5f649be, 0x9d8e68fd), TOBN(0xdb0f0533, 0x1b044320), + TOBN(0xf6fde9b3, 0xe0c33398), TOBN(0x92f4209b, 0x66c8cfae)}, + {TOBN(0xe9d1afcc, 0x1a739d4b), TOBN(0x09aea75f, 0xa28ab8de), + TOBN(0x14375fb5, 0xeac6f1d0), TOBN(0x6420b560, 0x708f7aa5)}}, + {{TOBN(0x9eae499c, 0x6254dc41), TOBN(0x7e293924, 0x7a837e7e), + TOBN(0x74aec08c, 0x090524a7), TOBN(0xf82b9219, 0x8d6f55f2)}, + {TOBN(0x493c962e, 0x1402cec5), TOBN(0x9f17ca17, 0xfa2f30e7), + TOBN(0xbcd783e8, 0xe9b879cb), TOBN(0xea3d8c14, 0x5a6f145f)}}, + {{TOBN(0xdede15e7, 0x5e0dee6e), TOBN(0x74f24872, 0xdc628aa2), + TOBN(0xd3e9c4fe, 0x7861bb93), TOBN(0x56d4822a, 0x6187b2e0)}, + {TOBN(0xb66417cf, 0xc59826f9), TOBN(0xca260969, 0x2408169e), + TOBN(0xedf69d06, 0xc79ef885), TOBN(0x00031f8a, 0xdc7d138f)}}, + {{TOBN(0x103c46e6, 0x0ebcf726), TOBN(0x4482b831, 0x6231470e), + TOBN(0x6f6dfaca, 0x487c2109), TOBN(0x2e0ace97, 0x62e666ef)}, + {TOBN(0x3246a9d3, 0x1f8d1f42), TOBN(0x1b1e83f1, 0x574944d2), + TOBN(0x13dfa63a, 0xa57f334b), TOBN(0x0cf8daed, 0x9f025d81)}}, + {{TOBN(0x30d78ea8, 0x00ee11c1), TOBN(0xeb053cd4, 0xb5e3dd75), + TOBN(0x9b65b13e, 0xd58c43c5), TOBN(0xc3ad49bd, 0xbd151663)}, + {TOBN(0x99fd8e41, 0xb6427990), TOBN(0x12cf15bd, 0x707eae1e), + TOBN(0x29ad4f1b, 0x1aabb71e), TOBN(0x5143e74d, 0x07545d0e)}}, + {{TOBN(0x30266336, 0xc88bdee1), TOBN(0x25f29306, 0x5876767c), + TOBN(0x9c078571, 0xc6731996), TOBN(0xc88690b2, 0xed552951)}, + {TOBN(0x274f2c2d, 0x852705b4), TOBN(0xb0bf8d44, 0x4e09552d), + TOBN(0x7628beeb, 0x986575d1), TOBN(0x407be238, 0x7f864651)}}, + {{TOBN(0x0e5e3049, 0xa639fc6b), TOBN(0xe75c35d9, 0x86003625), + TOBN(0x0cf35bd8, 0x5dcc1646), TOBN(0x8bcaced2, 0x6c26273a)}, + {TOBN(0xe22ecf1d, 0xb5536742), TOBN(0x013dd897, 0x1a9e068b), + TOBN(0x17f411cb, 0x8a7909c5), TOBN(0x5757ac98, 0x861dd506)}}, + {{TOBN(0x85de1f0d, 0x1e935abb), TOBN(0xdefd10b4, 0x154de37a), + TOBN(0xb8d9e392, 0x369cebb5), TOBN(0x54d5ef9b, 0x761324be)}, + {TOBN(0x4d6341ba, 0x74f17e26), TOBN(0xc0a0e3c8, 0x78c1dde4), + TOBN(0xa6d77581, 0x87d918fd), TOBN(0x66876015, 0x02ca3a13)}}, + {{TOBN(0xc7313e9c, 0xf36658f0), TOBN(0xc433ef1c, 0x71f8057e), + TOBN(0x85326246, 0x1b6a835a), TOBN(0xc8f05398, 0x7c86394c)}, + {TOBN(0xff398cdf, 0xe983c4a1), TOBN(0xbf5e8162, 0x03b7b931), + TOBN(0x93193c46, 0xb7b9045b), TOBN(0x1e4ebf5d, 0xa4a6e46b)}}, + {{TOBN(0xf9942a60, 0x43a24fe7), TOBN(0x29c1191e, 0xffb3492b), + TOBN(0x9f662449, 0x902fde05), TOBN(0xc792a7ac, 0x6713c32d)}, + {TOBN(0x2fd88ad8, 0xb737982c), TOBN(0x7e3a0319, 0xa21e60e3), + TOBN(0x09b0de44, 0x7383591a), TOBN(0x6df141ee, 0x8310a456)}}, + {{TOBN(0xaec1a039, 0xe6d6f471), TOBN(0x14b2ba0f, 0x1198d12e), + TOBN(0xebc1a160, 0x3aeee5ac), TOBN(0x401f4836, 0xe0b964ce)}, + {TOBN(0x2ee43796, 0x4fd03f66), TOBN(0x3fdb4e49, 0xdd8f3f12), + TOBN(0x6ef267f6, 0x29380f18), TOBN(0x3e8e9670, 0x8da64d16)}}, + {{TOBN(0xbc19180c, 0x207674f1), TOBN(0x112e09a7, 0x33ae8fdb), + TOBN(0x99667554, 0x6aaeb71e), TOBN(0x79432af1, 0xe101b1c7)}, + {TOBN(0xd5eb558f, 0xde2ddec6), TOBN(0x81392d1f, 0x5357753f), + TOBN(0xa7a76b97, 0x3ae1158a), TOBN(0x416fbbff, 0x4a899991)}}, + {{TOBN(0x9e65fdfd, 0x0d4a9dcf), TOBN(0x7bc29e48, 0x944ddf12), + TOBN(0xbc1a92d9, 0x3c856866), TOBN(0x273c6905, 0x6e98dfe2)}, + {TOBN(0x69fce418, 0xcdfaa6b8), TOBN(0x606bd823, 0x5061c69f), + TOBN(0x42d495a0, 0x6af75e27), TOBN(0x8ed3d505, 0x6d873a1f)}}, + {{TOBN(0xaf552841, 0x6ab25b6a), TOBN(0xc6c0ffc7, 0x2b1a4523), + TOBN(0xab18827b, 0x21c99e03), TOBN(0x060e8648, 0x9034691b)}, + {TOBN(0x5207f90f, 0x93c7f398), TOBN(0x9f4a96cb, 0x82f8d10b), + TOBN(0xdd71cd79, 0x3ad0f9e3), TOBN(0x84f435d2, 0xfc3a54f5)}}, + {{TOBN(0x4b03c55b, 0x8e33787f), TOBN(0xef42f975, 0xa6384673), + TOBN(0xff7304f7, 0x5051b9f0), TOBN(0x18aca1dc, 0x741c87c2)}, + {TOBN(0x56f120a7, 0x2d4bfe80), TOBN(0xfd823b3d, 0x053e732c), + TOBN(0x11bccfe4, 0x7537ca16), TOBN(0xdf6c9c74, 0x1b5a996b)}}, + {{TOBN(0xee7332c7, 0x904fc3fa), TOBN(0x14a23f45, 0xc7e3636a), + TOBN(0xc38659c3, 0xf091d9aa), TOBN(0x4a995e5d, 0xb12d8540)}, + {TOBN(0x20a53bec, 0xf3a5598a), TOBN(0x56534b17, 0xb1eaa995), + TOBN(0x9ed3dca4, 0xbf04e03c), TOBN(0x716c563a, 0xd8d56268)}}, + {{TOBN(0x27ba77a4, 0x1d6178e7), TOBN(0xe4c80c40, 0x68a1ff8e), + TOBN(0x75011099, 0x0a13f63d), TOBN(0x7bf33521, 0xa61d46f3)}, + {TOBN(0x0aff218e, 0x10b365bb), TOBN(0x81021804, 0x0fd7ea75), + TOBN(0x05a3fd8a, 0xa4b3a925), TOBN(0xb829e75f, 0x9b3db4e6)}}, + {{TOBN(0x6bdc75a5, 0x4d53e5fb), TOBN(0x04a5dc02, 0xd52717e3), + TOBN(0x86af502f, 0xe9a42ec2), TOBN(0x8867e8fb, 0x2630e382)}, + {TOBN(0xbf845c6e, 0xbec9889b), TOBN(0x54f491f2, 0xcb47c98d), + TOBN(0xa3091fba, 0x790c2a12), TOBN(0xd7f6fd78, 0xc20f708b)}}, + {{TOBN(0xa569ac30, 0xacde5e17), TOBN(0xd0f996d0, 0x6852b4d7), + TOBN(0xe51d4bb5, 0x4609ae54), TOBN(0x3fa37d17, 0x0daed061)}, + {TOBN(0x62a88684, 0x34b8fb41), TOBN(0x99a2acbd, 0x9efb64f1), + TOBN(0xb75c1a5e, 0x6448e1f2), TOBN(0xfa99951a, 0x42b5a069)}}, + {{TOBN(0x6d956e89, 0x2f3b26e7), TOBN(0xf4709860, 0xda875247), + TOBN(0x3ad15179, 0x2482dda3), TOBN(0xd64110e3, 0x017d82f0)}, + {TOBN(0x14928d2c, 0xfad414e4), TOBN(0x2b155f58, 0x2ed02b24), + TOBN(0x481a141b, 0xcb821bf1), TOBN(0x12e3c770, 0x4f81f5da)}}, + {{TOBN(0xe49c5de5, 0x9fff8381), TOBN(0x11053232, 0x5bbec894), + TOBN(0xa0d051cc, 0x454d88c4), TOBN(0x4f6db89c, 0x1f8e531b)}, + {TOBN(0x34fe3fd6, 0xca563a44), TOBN(0x7f5c2215, 0x58da8ab9), + TOBN(0x8445016d, 0x9474f0a1), TOBN(0x17d34d61, 0xcb7d8a0a)}}, + {{TOBN(0x8e9d3910, 0x1c474019), TOBN(0xcaff2629, 0xd52ceefb), + TOBN(0xf9cf3e32, 0xc1622c2b), TOBN(0xd4b95e3c, 0xe9071a05)}, + {TOBN(0xfbbca61f, 0x1594438c), TOBN(0x1eb6e6a6, 0x04aadedf), + TOBN(0x853027f4, 0x68e14940), TOBN(0x221d322a, 0xdfabda9c)}}, + {{TOBN(0xed8ea9f6, 0xb7cb179a), TOBN(0xdc7b764d, 0xb7934dcc), + TOBN(0xfcb13940, 0x5e09180d), TOBN(0x6629a6bf, 0xb47dc2dd)}, + {TOBN(0xbfc55e4e, 0x9f5a915e), TOBN(0xb1db9d37, 0x6204441e), + TOBN(0xf82d68cf, 0x930c5f53), TOBN(0x17d3a142, 0xcbb605b1)}}, + {{TOBN(0xdd5944ea, 0x308780f2), TOBN(0xdc8de761, 0x3845f5e4), + TOBN(0x6beaba7d, 0x7624d7a3), TOBN(0x1e709afd, 0x304df11e)}, + {TOBN(0x95364376, 0x02170456), TOBN(0xbf204b3a, 0xc8f94b64), + TOBN(0x4e53af7c, 0x5680ca68), TOBN(0x0526074a, 0xe0c67574)}}, + {{TOBN(0x95d8cef8, 0xecd92af6), TOBN(0xe6b9fa7a, 0x6cd1745a), + TOBN(0x3d546d3d, 0xa325c3e4), TOBN(0x1f57691d, 0x9ae93aae)}, + {TOBN(0xe891f3fe, 0x9d2e1a33), TOBN(0xd430093f, 0xac063d35), + TOBN(0xeda59b12, 0x5513a327), TOBN(0xdc2134f3, 0x5536f18f)}}, + {{TOBN(0xaa51fe2c, 0x5c210286), TOBN(0x3f68aaee, 0x1cab658c), + TOBN(0x5a23a00b, 0xf9357292), TOBN(0x9a626f39, 0x7efdabed)}, + {TOBN(0xfe2b3bf3, 0x199d78e3), TOBN(0xb7a2af77, 0x71bbc345), + TOBN(0x3d19827a, 0x1e59802c), TOBN(0x823bbc15, 0xb487a51c)}}, + {{TOBN(0x856139f2, 0x99d0a422), TOBN(0x9ac3df65, 0xf456c6fb), + TOBN(0xaddf65c6, 0x701f8bd6), TOBN(0x149f321e, 0x3758df87)}, + {TOBN(0xb1ecf714, 0x721b7eba), TOBN(0xe17df098, 0x31a3312a), + TOBN(0xdb2fd6ec, 0xd5c4d581), TOBN(0xfd02996f, 0x8fcea1b3)}}, + {{TOBN(0xe29fa63e, 0x7882f14f), TOBN(0xc9f6dc35, 0x07c6cadc), + TOBN(0x46f22d6f, 0xb882bed0), TOBN(0x1a45755b, 0xd118e52c)}, + {TOBN(0x9f2c7c27, 0x7c4608cf), TOBN(0x7ccbdf32, 0x568012c2), + TOBN(0xfcb0aedd, 0x61729b0e), TOBN(0x7ca2ca9e, 0xf7d75dbf)}}, + {{TOBN(0xf58fecb1, 0x6f640f62), TOBN(0xe274b92b, 0x39f51946), + TOBN(0x7f4dfc04, 0x6288af44), TOBN(0x0a91f32a, 0xeac329e5)}, + {TOBN(0x43ad274b, 0xd6aaba31), TOBN(0x719a1640, 0x0f6884f9), + TOBN(0x685d29f6, 0xdaf91e20), TOBN(0x5ec1cc33, 0x27e49d52)}}, + {{TOBN(0x38f4de96, 0x3b54a059), TOBN(0x0e0015e5, 0xefbcfdb3), + TOBN(0x177d23d9, 0x4dbb8da6), TOBN(0x98724aa2, 0x97a617ad)}, + {TOBN(0x30f0885b, 0xfdb6558e), TOBN(0xf9f7a28a, 0xc7899a96), + TOBN(0xd2ae8ac8, 0x872dc112), TOBN(0xfa0642ca, 0x73c3c459)}}, + {{TOBN(0x15296981, 0xe7dfc8d6), TOBN(0x67cd4450, 0x1fb5b94a), + TOBN(0x0ec71cf1, 0x0eddfd37), TOBN(0xc7e5eeb3, 0x9a8eddc7)}, + {TOBN(0x02ac8e3d, 0x81d95028), TOBN(0x0088f172, 0x70b0e35d), + TOBN(0xec041fab, 0xe1881fe3), TOBN(0x62cf71b8, 0xd99e7faa)}}, + {{TOBN(0x5043dea7, 0xe0f222c2), TOBN(0x309d42ac, 0x72e65142), + TOBN(0x94fe9ddd, 0x9216cd30), TOBN(0xd6539c7d, 0x0f87feec)}, + {TOBN(0x03c5a57c, 0x432ac7d7), TOBN(0x72692cf0, 0x327fda10), + TOBN(0xec28c85f, 0x280698de), TOBN(0x2331fb46, 0x7ec283b1)}}, + {{TOBN(0xd34bfa32, 0x2867e633), TOBN(0x78709a82, 0x0a9cc815), + TOBN(0xb7fe6964, 0x875e2fa5), TOBN(0x25cc064f, 0x9e98bfb5)}, + {TOBN(0x9eb0151c, 0x493a65c5), TOBN(0x5fb5d941, 0x53182464), + TOBN(0x69e6f130, 0xf04618e2), TOBN(0xa8ecec22, 0xf89c8ab6)}}, + {{TOBN(0xcd6ac88b, 0xb96209bd), TOBN(0x65fa8cdb, 0xb3e1c9e0), + TOBN(0xa47d22f5, 0x4a8d8eac), TOBN(0x83895cdf, 0x8d33f963)}, + {TOBN(0xa8adca59, 0xb56cd3d1), TOBN(0x10c8350b, 0xdaf38232), + TOBN(0x2b161fb3, 0xa5080a9f), TOBN(0xbe7f5c64, 0x3af65b3a)}}, + {{TOBN(0x2c754039, 0x97403a11), TOBN(0x94626cf7, 0x121b96af), + TOBN(0x431de7c4, 0x6a983ec2), TOBN(0x3780dd3a, 0x52cc3df7)}, + {TOBN(0xe28a0e46, 0x2baf8e3b), TOBN(0xabe68aad, 0x51d299ae), + TOBN(0x603eb8f9, 0x647a2408), TOBN(0x14c61ed6, 0x5c750981)}}, + {{TOBN(0x88b34414, 0xc53352e7), TOBN(0x5a34889c, 0x1337d46e), + TOBN(0x612c1560, 0xf95f2bc8), TOBN(0x8a3f8441, 0xd4807a3a)}, + {TOBN(0x680d9e97, 0x5224da68), TOBN(0x60cd6e88, 0xc3eb00e9), + TOBN(0x3875a98e, 0x9a6bc375), TOBN(0xdc80f924, 0x4fd554c2)}}, + {{TOBN(0x6c4b3415, 0x6ac77407), TOBN(0xa1e5ea8f, 0x25420681), + TOBN(0x541bfa14, 0x4607a458), TOBN(0x5dbc7e7a, 0x96d7fbf9)}, + {TOBN(0x646a851b, 0x31590a47), TOBN(0x039e85ba, 0x15ee6df8), + TOBN(0xd19fa231, 0xd7b43fc0), TOBN(0x84bc8be8, 0x299a0e04)}}, + {{TOBN(0x2b9d2936, 0xf20df03a), TOBN(0x24054382, 0x8608d472), + TOBN(0x76b6ba04, 0x9149202a), TOBN(0xb21c3831, 0x3670e7b7)}, + {TOBN(0xddd93059, 0xd6fdee10), TOBN(0x9da47ad3, 0x78488e71), + TOBN(0x99cc1dfd, 0xa0fcfb25), TOBN(0x42abde10, 0x64696954)}}, + {{TOBN(0x14cc15fc, 0x17eab9fe), TOBN(0xd6e863e4, 0xd3e70972), + TOBN(0x29a7765c, 0x6432112c), TOBN(0x88660001, 0x5b0774d8)}, + {TOBN(0x3729175a, 0x2c088eae), TOBN(0x13afbcae, 0x8230b8d4), + TOBN(0x44768151, 0x915f4379), TOBN(0xf086431a, 0xd8d22812)}}, + {{TOBN(0x37461955, 0xc298b974), TOBN(0x905fb5f0, 0xf8711e04), + TOBN(0x787abf3a, 0xfe969d18), TOBN(0x392167c2, 0x6f6a494e)}, + {TOBN(0xfc7a0d2d, 0x28c511da), TOBN(0xf127c7dc, 0xb66a262d), + TOBN(0xf9c4bb95, 0xfd63fdf0), TOBN(0x90016589, 0x3913ef46)}}, + {{TOBN(0x74d2a73c, 0x11aa600d), TOBN(0x2f5379bd, 0x9fb5ab52), + TOBN(0xe49e53a4, 0x7fb70068), TOBN(0x68dd39e5, 0x404aa9a7)}, + {TOBN(0xb9b0cf57, 0x2ecaa9c3), TOBN(0xba0e103b, 0xe824826b), + TOBN(0x60c2198b, 0x4631a3c4), TOBN(0xc5ff84ab, 0xfa8966a2)}}, + {{TOBN(0x2d6ebe22, 0xac95aff8), TOBN(0x1c9bb6db, 0xb5a46d09), + TOBN(0x419062da, 0x53ee4f8d), TOBN(0x7b9042d0, 0xbb97efef)}, + {TOBN(0x0f87f080, 0x830cf6bd), TOBN(0x4861d19a, 0x6ec8a6c6), + TOBN(0xd3a0daa1, 0x202f01aa), TOBN(0xb0111674, 0xf25afbd5)}}, + {{TOBN(0x6d00d6cf, 0x1afb20d9), TOBN(0x13695000, 0x40671bc5), + TOBN(0x913ab0dc, 0x2485ea9b), TOBN(0x1f2bed06, 0x9eef61ac)}, + {TOBN(0x850c8217, 0x6d799e20), TOBN(0x93415f37, 0x3271c2de), + TOBN(0x5afb06e9, 0x6c4f5910), TOBN(0x688a52df, 0xc4e9e421)}}, + {{TOBN(0x30495ba3, 0xe2a9a6db), TOBN(0x4601303d, 0x58f9268b), + TOBN(0xbe3b0dad, 0x7eb0f04f), TOBN(0x4ea47250, 0x4456936d)}, + {TOBN(0x8caf8798, 0xd33fd3e7), TOBN(0x1ccd8a89, 0xeb433708), + TOBN(0x9effe3e8, 0x87fd50ad), TOBN(0xbe240a56, 0x6b29c4df)}}, + {{TOBN(0xec4ffd98, 0xca0e7ebd), TOBN(0xf586783a, 0xe748616e), + TOBN(0xa5b00d8f, 0xc77baa99), TOBN(0x0acada29, 0xb4f34c9c)}, + {TOBN(0x36dad67d, 0x0fe723ac), TOBN(0x1d8e53a5, 0x39c36c1e), + TOBN(0xe4dd342d, 0x1f4bea41), TOBN(0x64fd5e35, 0xebc9e4e0)}}, + {{TOBN(0x96f01f90, 0x57908805), TOBN(0xb5b9ea3d, 0x5ed480dd), + TOBN(0x366c5dc2, 0x3efd2dd0), TOBN(0xed2fe305, 0x6e9dfa27)}, + {TOBN(0x4575e892, 0x6e9197e2), TOBN(0x11719c09, 0xab502a5d), + TOBN(0x264c7bec, 0xe81f213f), TOBN(0x741b9241, 0x55f5c457)}}, + {{TOBN(0x78ac7b68, 0x49a5f4f4), TOBN(0xf91d70a2, 0x9fc45b7d), + TOBN(0x39b05544, 0xb0f5f355), TOBN(0x11f06bce, 0xeef930d9)}, + {TOBN(0xdb84d25d, 0x038d05e1), TOBN(0x04838ee5, 0xbacc1d51), + TOBN(0x9da3ce86, 0x9e8ee00b), TOBN(0xc3412057, 0xc36eda1f)}}, + {{TOBN(0xae80b913, 0x64d9c2f4), TOBN(0x7468bac3, 0xa010a8ff), + TOBN(0xdfd20037, 0x37359d41), TOBN(0x1a0f5ab8, 0x15efeacc)}, + {TOBN(0x7c25ad2f, 0x659d0ce0), TOBN(0x4011bcbb, 0x6785cff1), + TOBN(0x128b9912, 0x7e2192c7), TOBN(0xa549d8e1, 0x13ccb0e8)}}, + {{TOBN(0x805588d8, 0xc85438b1), TOBN(0x5680332d, 0xbc25cb27), + TOBN(0xdcd1bc96, 0x1a4bfdf4), TOBN(0x779ff428, 0x706f6566)}, + {TOBN(0x8bbee998, 0xf059987a), TOBN(0xf6ce8cf2, 0xcc686de7), + TOBN(0xf8ad3c4a, 0x953cfdb2), TOBN(0xd1d426d9, 0x2205da36)}}, + {{TOBN(0xb3c0f13f, 0xc781a241), TOBN(0x3e89360e, 0xd75362a8), + TOBN(0xccd05863, 0xc8a91184), TOBN(0x9bd0c9b7, 0xefa8a7f4)}, + {TOBN(0x97ee4d53, 0x8a912a4b), TOBN(0xde5e15f8, 0xbcf518fd), + TOBN(0x6a055bf8, 0xc467e1e0), TOBN(0x10be4b4b, 0x1587e256)}}, + {{TOBN(0xd90c14f2, 0x668621c9), TOBN(0xd5518f51, 0xab9c92c1), + TOBN(0x8e6a0100, 0xd6d47b3c), TOBN(0xcbe980dd, 0x66716175)}, + {TOBN(0x500d3f10, 0xddd83683), TOBN(0x3b6cb35d, 0x99cac73c), + TOBN(0x53730c8b, 0x6083d550), TOBN(0xcf159767, 0xdf0a1987)}}, + {{TOBN(0x84bfcf53, 0x43ad73b3), TOBN(0x1b528c20, 0x4f035a94), + TOBN(0x4294edf7, 0x33eeac69), TOBN(0xb6283e83, 0x817f3240)}, + {TOBN(0xc3fdc959, 0x0a5f25b1), TOBN(0xefaf8aa5, 0x5844ee22), + TOBN(0xde269ba5, 0xdbdde4de), TOBN(0xe3347160, 0xc56133bf)}}, + {{TOBN(0xc1184219, 0x8d9ea9f8), TOBN(0x090de5db, 0xf3fc1ab5), + TOBN(0x404c37b1, 0x0bf22cda), TOBN(0x7de20ec8, 0xf5618894)}, + {TOBN(0x754c588e, 0xecdaecab), TOBN(0x6ca4b0ed, 0x88342743), + TOBN(0x76f08bdd, 0xf4a938ec), TOBN(0xd182de89, 0x91493ccb)}}, + {{TOBN(0xd652c53e, 0xc8a4186a), TOBN(0xb3e878db, 0x946d8e33), + TOBN(0x088453c0, 0x5f37663c), TOBN(0x5cd9daaa, 0xb407748b)}, + {TOBN(0xa1f5197f, 0x586d5e72), TOBN(0x47500be8, 0xc443ca59), + TOBN(0x78ef35b2, 0xe2652424), TOBN(0x09c5d26f, 0x6dd7767d)}}, + {{TOBN(0x7175a79a, 0xa74d3f7b), TOBN(0x0428fd8d, 0xcf5ea459), + TOBN(0x511cb97c, 0xa5d1746d), TOBN(0x36363939, 0xe71d1278)}, + {TOBN(0xcf2df955, 0x10350bf4), TOBN(0xb3817439, 0x60aae782), + TOBN(0xa748c0e4, 0x3e688809), TOBN(0x98021fbf, 0xd7a5a006)}}, + {{TOBN(0x9076a70c, 0x0e367a98), TOBN(0xbea1bc15, 0x0f62b7c2), + TOBN(0x2645a68c, 0x30fe0343), TOBN(0xacaffa78, 0x699dc14f)}, + {TOBN(0xf4469964, 0x457bf9c4), TOBN(0x0db6407b, 0x0d2ead83), + TOBN(0x68d56cad, 0xb2c6f3eb), TOBN(0x3b512e73, 0xf376356c)}}, + {{TOBN(0xe43b0e1f, 0xfce10408), TOBN(0x89ddc003, 0x5a5e257d), + TOBN(0xb0ae0d12, 0x0362e5b3), TOBN(0x07f983c7, 0xb0519161)}, + {TOBN(0xc2e94d15, 0x5d5231e7), TOBN(0xcff22aed, 0x0b4f9513), + TOBN(0xb02588dd, 0x6ad0b0b5), TOBN(0xb967d1ac, 0x11d0dcd5)}}, + {{TOBN(0x8dac6bc6, 0xcf777b6c), TOBN(0x0062bdbd, 0x4c6d1959), + TOBN(0x53da71b5, 0x0ef5cc85), TOBN(0x07012c7d, 0x4006f14f)}, + {TOBN(0x4617f962, 0xac47800d), TOBN(0x53365f2b, 0xc102ed75), + TOBN(0xb422efcb, 0x4ab8c9d3), TOBN(0x195cb26b, 0x34af31c9)}}, + {{TOBN(0x3a926e29, 0x05f2c4ce), TOBN(0xbd2bdecb, 0x9856966c), + TOBN(0x5d16ab3a, 0x85527015), TOBN(0x9f81609e, 0x4486c231)}, + {TOBN(0xd8b96b2c, 0xda350002), TOBN(0xbd054690, 0xfa1b7d36), + TOBN(0xdc90ebf5, 0xe71d79bc), TOBN(0xf241b6f9, 0x08964e4e)}}, + {{TOBN(0x7c838643, 0x2fe3cd4c), TOBN(0xe0f33acb, 0xb4bc633c), + TOBN(0xb4a9ecec, 0x3d139f1f), TOBN(0x05ce69cd, 0xdc4a1f49)}, + {TOBN(0xa19d1b16, 0xf5f98aaf), TOBN(0x45bb71d6, 0x6f23e0ef), + TOBN(0x33789fcd, 0x46cdfdd3), TOBN(0x9b8e2978, 0xcee040ca)}}, + {{TOBN(0x9c69b246, 0xae0a6828), TOBN(0xba533d24, 0x7078d5aa), + TOBN(0x7a2e42c0, 0x7bb4fbdb), TOBN(0xcfb4879a, 0x7035385c)}, + {TOBN(0x8c3dd30b, 0x3281705b), TOBN(0x7e361c6c, 0x404fe081), + TOBN(0x7b21649c, 0x3f604edf), TOBN(0x5dbf6a3f, 0xe52ffe47)}}, + {{TOBN(0xc41b7c23, 0x4b54d9bf), TOBN(0x1374e681, 0x3511c3d9), + TOBN(0x1863bf16, 0xc1b2b758), TOBN(0x90e78507, 0x1e9e6a96)}, + {TOBN(0xab4bf98d, 0x5d86f174), TOBN(0xd74e0bd3, 0x85e96fe4), + TOBN(0x8afde39f, 0xcac5d344), TOBN(0x90946dbc, 0xbd91b847)}}, + {{TOBN(0xf5b42358, 0xfe1a838c), TOBN(0x05aae6c5, 0x620ac9d8), + TOBN(0x8e193bd8, 0xa1ce5a0b), TOBN(0x8f710571, 0x4dabfd72)}, + {TOBN(0x8d8fdd48, 0x182caaac), TOBN(0x8c4aeefa, 0x040745cf), + TOBN(0x73c6c30a, 0xf3b93e6d), TOBN(0x991241f3, 0x16f42011)}}, + {{TOBN(0xa0158eea, 0xe457a477), TOBN(0xd19857db, 0xee6ddc05), + TOBN(0xb3265224, 0x18c41671), TOBN(0x3ffdfc7e, 0x3c2c0d58)}, + {TOBN(0x3a3a5254, 0x26ee7cda), TOBN(0x341b0869, 0xdf02c3a8), + TOBN(0xa023bf42, 0x723bbfc8), TOBN(0x3d15002a, 0x14452691)}}}, + {{{TOBN(0x5ef7324c, 0x85edfa30), TOBN(0x25976554, 0x87d4f3da), + TOBN(0x352f5bc0, 0xdcb50c86), TOBN(0x8f6927b0, 0x4832a96c)}, + {TOBN(0xd08ee1ba, 0x55f2f94c), TOBN(0x6a996f99, 0x344b45fa), + TOBN(0xe133cb8d, 0xa8aa455d), TOBN(0x5d0721ec, 0x758dc1f7)}}, + {{TOBN(0x6ba7a920, 0x79e5fb67), TOBN(0xe1331feb, 0x70aa725e), + TOBN(0x5080ccf5, 0x7df5d837), TOBN(0xe4cae01d, 0x7ff72e21)}, + {TOBN(0xd9243ee6, 0x0412a77d), TOBN(0x06ff7cac, 0xdf449025), + TOBN(0xbe75f7cd, 0x23ef5a31), TOBN(0xbc957822, 0x0ddef7a8)}}, + {{TOBN(0x8cf7230c, 0xb0ce1c55), TOBN(0x5b534d05, 0x0bbfb607), + TOBN(0xee1ef113, 0x0e16363b), TOBN(0x27e0aa7a, 0xb4999e82)}, + {TOBN(0xce1dac2d, 0x79362c41), TOBN(0x67920c90, 0x91bb6cb0), + TOBN(0x1e648d63, 0x2223df24), TOBN(0x0f7d9eef, 0xe32e8f28)}}, + {{TOBN(0x6943f39a, 0xfa833834), TOBN(0x22951722, 0xa6328562), + TOBN(0x81d63dd5, 0x4170fc10), TOBN(0x9f5fa58f, 0xaecc2e6d)}, + {TOBN(0xb66c8725, 0xe77d9a3b), TOBN(0x11235cea, 0x6384ebe0), + TOBN(0x06a8c118, 0x5845e24a), TOBN(0x0137b286, 0xebd093b1)}}, + {{TOBN(0xc589e1ce, 0x44ace150), TOBN(0xe0f8d3d9, 0x4381e97c), + TOBN(0x59e99b11, 0x62c5a4b8), TOBN(0x90d262f7, 0xfd0ec9f9)}, + {TOBN(0xfbc854c9, 0x283e13c9), TOBN(0x2d04fde7, 0xaedc7085), + TOBN(0x057d7765, 0x47dcbecb), TOBN(0x8dbdf591, 0x9a76fa5f)}}, + {{TOBN(0xd0150695, 0x0de1e578), TOBN(0x2e1463e7, 0xe9f72bc6), + TOBN(0xffa68441, 0x1b39eca5), TOBN(0x673c8530, 0x7c037f2f)}, + {TOBN(0xd0d6a600, 0x747f91da), TOBN(0xb08d43e1, 0xc9cb78e9), + TOBN(0x0fc0c644, 0x27b5cef5), TOBN(0x5c1d160a, 0xa60a2fd6)}}, + {{TOBN(0xf98cae53, 0x28c8e13b), TOBN(0x375f10c4, 0xb2eddcd1), + TOBN(0xd4eb8b7f, 0x5cce06ad), TOBN(0xb4669f45, 0x80a2e1ef)}, + {TOBN(0xd593f9d0, 0x5bbd8699), TOBN(0x5528a4c9, 0xe7976d13), + TOBN(0x3923e095, 0x1c7e28d3), TOBN(0xb9293790, 0x3f6bb577)}}, + {{TOBN(0xdb567d6a, 0xc42bd6d2), TOBN(0x6df86468, 0xbb1f96ae), + TOBN(0x0efe5b1a, 0x4843b28e), TOBN(0x961bbb05, 0x6379b240)}, + {TOBN(0xb6caf5f0, 0x70a6a26b), TOBN(0x70686c0d, 0x328e6e39), + TOBN(0x80da06cf, 0x895fc8d3), TOBN(0x804d8810, 0xb363fdc9)}}, + {{TOBN(0xbe22877b, 0x207f1670), TOBN(0x9b0dd188, 0x4e615291), + TOBN(0x625ae8dc, 0x97a3c2bf), TOBN(0x08584ef7, 0x439b86e8)}, + {TOBN(0xde7190a5, 0xdcd898ff), TOBN(0x26286c40, 0x2058ee3d), + TOBN(0x3db0b217, 0x5f87b1c1), TOBN(0xcc334771, 0x102a6db5)}}, + {{TOBN(0xd99de954, 0x2f770fb1), TOBN(0x97c1c620, 0x4cd7535e), + TOBN(0xd3b6c448, 0x3f09cefc), TOBN(0xd725af15, 0x5a63b4f8)}, + {TOBN(0x0c95d24f, 0xc01e20ec), TOBN(0xdfd37494, 0x9ae7121f), + TOBN(0x7d6ddb72, 0xec77b7ec), TOBN(0xfe079d3b, 0x0353a4ae)}}, + {{TOBN(0x3066e70a, 0x2e6ac8d2), TOBN(0x9c6b5a43, 0x106e5c05), + TOBN(0x52d3c6f5, 0xede59b8c), TOBN(0x30d6a5c3, 0xfccec9ae)}, + {TOBN(0xedec7c22, 0x4fc0a9ef), TOBN(0x190ff083, 0x95c16ced), + TOBN(0xbe12ec8f, 0x94de0fde), TOBN(0x0d131ab8, 0x852d3433)}}, + {{TOBN(0x42ace07e, 0x85701291), TOBN(0x94793ed9, 0x194061a8), + TOBN(0x30e83ed6, 0xd7f4a485), TOBN(0x9eec7269, 0xf9eeff4d)}, + {TOBN(0x90acba59, 0x0c9d8005), TOBN(0x5feca458, 0x1e79b9d1), + TOBN(0x8fbe5427, 0x1d506a1e), TOBN(0xa32b2c8e, 0x2439cfa7)}}, + {{TOBN(0x1671c173, 0x73dd0b4e), TOBN(0x37a28214, 0x44a054c6), + TOBN(0x81760a1b, 0x4e8b53f1), TOBN(0xa6c04224, 0xf9f93b9e)}, + {TOBN(0x18784b34, 0xcf671e3c), TOBN(0x81bbecd2, 0xcda9b994), + TOBN(0x38831979, 0xb2ab3848), TOBN(0xef54feb7, 0xf2e03c2d)}}, + {{TOBN(0xcf197ca7, 0xfb8088fa), TOBN(0x01427247, 0x4ddc96c5), + TOBN(0xa2d2550a, 0x30777176), TOBN(0x53469898, 0x4d0cf71d)}, + {TOBN(0x6ce937b8, 0x3a2aaac6), TOBN(0xe9f91dc3, 0x5af38d9b), + TOBN(0x2598ad83, 0xc8bf2899), TOBN(0x8e706ac9, 0xb5536c16)}}, + {{TOBN(0x40dc7495, 0xf688dc98), TOBN(0x26490cd7, 0x124c4afc), + TOBN(0xe651ec84, 0x1f18775c), TOBN(0x393ea6c3, 0xb4fdaf4a)}, + {TOBN(0x1e1f3343, 0x7f338e0d), TOBN(0x39fb832b, 0x6053e7b5), + TOBN(0x46e702da, 0x619e14d5), TOBN(0x859cacd1, 0xcdeef6e0)}}, + {{TOBN(0x63b99ce7, 0x4462007d), TOBN(0xb8ab48a5, 0x4cb5f5b7), + TOBN(0x9ec673d2, 0xf55edde7), TOBN(0xd1567f74, 0x8cfaefda)}, + {TOBN(0x46381b6b, 0x0887bcec), TOBN(0x694497ce, 0xe178f3c2), + TOBN(0x5e6525e3, 0x1e6266cb), TOBN(0x5931de26, 0x697d6413)}}, + {{TOBN(0x87f8df7c, 0x0e58d493), TOBN(0xb1ae5ed0, 0x58b73f12), + TOBN(0xc368f784, 0xdea0c34d), TOBN(0x9bd0a120, 0x859a91a0)}, + {TOBN(0xb00d88b7, 0xcc863c68), TOBN(0x3a1cc11e, 0x3d1f4d65), + TOBN(0xea38e0e7, 0x0aa85593), TOBN(0x37f13e98, 0x7dc4aee8)}}, + {{TOBN(0x10d38667, 0xbc947bad), TOBN(0x738e07ce, 0x2a36ee2e), + TOBN(0xc93470cd, 0xc577fcac), TOBN(0xdee1b616, 0x2782470d)}, + {TOBN(0x36a25e67, 0x2e793d12), TOBN(0xd6aa6cae, 0xe0f186da), + TOBN(0x474d0fd9, 0x80e07af7), TOBN(0xf7cdc47d, 0xba8a5cd4)}}, + {{TOBN(0x28af6d9d, 0xab15247f), TOBN(0x7c789c10, 0x493a537f), + TOBN(0x7ac9b110, 0x23a334e7), TOBN(0x0236ac09, 0x12c9c277)}, + {TOBN(0xa7e5bd25, 0x1d7a5144), TOBN(0x098b9c2a, 0xf13ec4ec), + TOBN(0x3639daca, 0xd3f0abca), TOBN(0x642da81a, 0xa23960f9)}}, + {{TOBN(0x7d2e5c05, 0x4f7269b1), TOBN(0xfcf30777, 0xe287c385), + TOBN(0x10edc84f, 0xf2a46f21), TOBN(0x35441757, 0x4f43fa36)}, + {TOBN(0xf1327899, 0xfd703431), TOBN(0xa438d7a6, 0x16dd587a), + TOBN(0x65c34c57, 0xe9c8352d), TOBN(0xa728edab, 0x5cc5a24e)}}, + {{TOBN(0xaed78abc, 0x42531689), TOBN(0x0a51a0e8, 0x010963ef), + TOBN(0x5776fa0a, 0xd717d9b3), TOBN(0xf356c239, 0x7dd3428b)}, + {TOBN(0x29903fff, 0x8d3a3dac), TOBN(0x409597fa, 0x3d94491f), + TOBN(0x4cd7a5ff, 0xbf4a56a4), TOBN(0xe5096474, 0x8adab462)}}, + {{TOBN(0xa97b5126, 0x5c3427b0), TOBN(0x6401405c, 0xd282c9bd), + TOBN(0x3629f8d7, 0x222c5c45), TOBN(0xb1c02c16, 0xe8d50aed)}, + {TOBN(0xbea2ed75, 0xd9635bc9), TOBN(0x226790c7, 0x6e24552f), + TOBN(0x3c33f2a3, 0x65f1d066), TOBN(0x2a43463e, 0x6dfccc2e)}}, + {{TOBN(0x8cc3453a, 0xdb483761), TOBN(0xe7cc6085, 0x65d5672b), + TOBN(0x277ed6cb, 0xde3efc87), TOBN(0x19f2f368, 0x69234eaf)}, + {TOBN(0x9aaf4317, 0x5c0b800b), TOBN(0x1f1e7c89, 0x8b6da6e2), + TOBN(0x6cfb4715, 0xb94ec75e), TOBN(0xd590dd5f, 0x453118c2)}}, + {{TOBN(0x14e49da1, 0x1f17a34c), TOBN(0x5420ab39, 0x235a1456), + TOBN(0xb7637241, 0x2f50363b), TOBN(0x7b15d623, 0xc3fabb6e)}, + {TOBN(0xa0ef40b1, 0xe274e49c), TOBN(0x5cf50744, 0x96b1860a), + TOBN(0xd6583fbf, 0x66afe5a4), TOBN(0x44240510, 0xf47e3e9a)}}, + {{TOBN(0x99254343, 0x11b2d595), TOBN(0xf1367499, 0xeec8df57), + TOBN(0x3cb12c61, 0x3e73dd05), TOBN(0xd248c033, 0x7dac102a)}, + {TOBN(0xcf154f13, 0xa77739f5), TOBN(0xbf4288cb, 0x23d2af42), + TOBN(0xaa64c9b6, 0x32e4a1cf), TOBN(0xee8c07a8, 0xc8a208f3)}}, + {{TOBN(0xe10d4999, 0x6fe8393f), TOBN(0x0f809a3f, 0xe91f3a32), + TOBN(0x61096d1c, 0x802f63c8), TOBN(0x289e1462, 0x57750d3d)}, + {TOBN(0xed06167e, 0x9889feea), TOBN(0xd5c9c0e2, 0xe0993909), + TOBN(0x46fca0d8, 0x56508ac6), TOBN(0x91826047, 0x4f1b8e83)}}, + {{TOBN(0x4f2c877a, 0x9a4a2751), TOBN(0x71bd0072, 0xcae6fead), + TOBN(0x38df8dcc, 0x06aa1941), TOBN(0x5a074b4c, 0x63beeaa8)}, + {TOBN(0xd6d65934, 0xc1cec8ed), TOBN(0xa6ecb49e, 0xaabc03bd), + TOBN(0xaade91c2, 0xde8a8415), TOBN(0xcfb0efdf, 0x691136e0)}}, + {{TOBN(0x11af45ee, 0x23ab3495), TOBN(0xa132df88, 0x0b77463d), + TOBN(0x8923c15c, 0x815d06f4), TOBN(0xc3ceb3f5, 0x0d61a436)}, + {TOBN(0xaf52291d, 0xe88fb1da), TOBN(0xea057974, 0x1da12179), + TOBN(0xb0d7218c, 0xd2fef720), TOBN(0x6c0899c9, 0x8e1d8845)}}, + {{TOBN(0x98157504, 0x752ddad7), TOBN(0xd60bd74f, 0xa1a68a97), + TOBN(0x7047a3a9, 0xf658fb99), TOBN(0x1f5d86d6, 0x5f8511e4)}, + {TOBN(0xb8a4bc42, 0x4b5a6d88), TOBN(0x69eb2c33, 0x1abefa7d), + TOBN(0x95bf39e8, 0x13c9c510), TOBN(0xf571960a, 0xd48aab43)}}, + {{TOBN(0x7e8cfbcf, 0x704e23c6), TOBN(0xc71b7d22, 0x28aaa65b), + TOBN(0xa041b2bd, 0x245e3c83), TOBN(0x69b98834, 0xd21854ff)}, + {TOBN(0x89d227a3, 0x963bfeec), TOBN(0x99947aaa, 0xde7da7cb), + TOBN(0x1d9ee9db, 0xee68a9b1), TOBN(0x0a08f003, 0x698ec368)}}, + {{TOBN(0xe9ea4094, 0x78ef2487), TOBN(0xc8d2d415, 0x02cfec26), + TOBN(0xc52f9a6e, 0xb7dcf328), TOBN(0x0ed489e3, 0x85b6a937)}, + {TOBN(0x9b94986b, 0xbef3366e), TOBN(0x0de59c70, 0xedddddb8), + TOBN(0xffdb748c, 0xeadddbe2), TOBN(0x9b9784bb, 0x8266ea40)}}, + {{TOBN(0x142b5502, 0x1a93507a), TOBN(0xb4cd1187, 0x8d3c06cf), + TOBN(0xdf70e76a, 0x91ec3f40), TOBN(0x484e81ad, 0x4e7553c2)}, + {TOBN(0x830f87b5, 0x272e9d6e), TOBN(0xea1c93e5, 0xc6ff514a), + TOBN(0x67cc2adc, 0xc4192a8e), TOBN(0xc77e27e2, 0x42f4535a)}}, + {{TOBN(0x9cdbab36, 0xd2b713c5), TOBN(0x86274ea0, 0xcf7b0cd3), + TOBN(0x784680f3, 0x09af826b), TOBN(0xbfcc837a, 0x0c72dea3)}, + {TOBN(0xa8bdfe9d, 0xd6529b73), TOBN(0x708aa228, 0x63a88002), + TOBN(0x6c7a9a54, 0xc91d45b9), TOBN(0xdf1a38bb, 0xfd004f56)}}, + {{TOBN(0x2e8c9a26, 0xb8bad853), TOBN(0x2d52cea3, 0x3723eae7), + TOBN(0x054d6d81, 0x56ca2830), TOBN(0xa3317d14, 0x9a8dc411)}, + {TOBN(0xa08662fe, 0xfd4ddeda), TOBN(0xed2a153a, 0xb55d792b), + TOBN(0x7035c16a, 0xbfc6e944), TOBN(0xb6bc5834, 0x00171cf3)}}, + {{TOBN(0xe27152b3, 0x83d102b6), TOBN(0xfe695a47, 0x0646b848), + TOBN(0xa5bb09d8, 0x916e6d37), TOBN(0xb4269d64, 0x0d17015e)}, + {TOBN(0x8d8156a1, 0x0a1d2285), TOBN(0xfeef6c51, 0x46d26d72), + TOBN(0x9dac57c8, 0x4c5434a7), TOBN(0x0282e5be, 0x59d39e31)}}, + {{TOBN(0xedfff181, 0x721c486d), TOBN(0x301baf10, 0xbc58824e), + TOBN(0x8136a6aa, 0x00570031), TOBN(0x55aaf78c, 0x1cddde68)}, + {TOBN(0x26829371, 0x59c63952), TOBN(0x3a3bd274, 0x8bc25baf), + TOBN(0xecdf8657, 0xb7e52dc3), TOBN(0x2dd8c087, 0xfd78e6c8)}}, + {{TOBN(0x20553274, 0xf5531461), TOBN(0x8b4a1281, 0x5d95499b), + TOBN(0xe2c8763a, 0x1a80f9d2), TOBN(0xd1dbe32b, 0x4ddec758)}, + {TOBN(0xaf12210d, 0x30c34169), TOBN(0xba74a953, 0x78baa533), + TOBN(0x3d133c6e, 0xa438f254), TOBN(0xa431531a, 0x201bef5b)}}, + {{TOBN(0x15295e22, 0xf669d7ec), TOBN(0xca374f64, 0x357fb515), + TOBN(0x8a8406ff, 0xeaa3fdb3), TOBN(0x106ae448, 0xdf3f2da8)}, + {TOBN(0x8f9b0a90, 0x33c8e9a1), TOBN(0x234645e2, 0x71ad5885), + TOBN(0x3d083224, 0x1c0aed14), TOBN(0xf10a7d3e, 0x7a942d46)}}, + {{TOBN(0x7c11deee, 0x40d5c9be), TOBN(0xb2bae7ff, 0xba84ed98), + TOBN(0x93e97139, 0xaad58ddd), TOBN(0x3d872796, 0x3f6d1fa3)}, + {TOBN(0x483aca81, 0x8569ff13), TOBN(0x8b89a5fb, 0x9a600f72), + TOBN(0x4cbc27c3, 0xc06f2b86), TOBN(0x22130713, 0x63ad9c0b)}}, + {{TOBN(0xb5358b1e, 0x48ac2840), TOBN(0x18311294, 0xecba9477), + TOBN(0xda58f990, 0xa6946b43), TOBN(0x3098baf9, 0x9ab41819)}, + {TOBN(0x66c4c158, 0x4198da52), TOBN(0xab4fc17c, 0x146bfd1b), + TOBN(0x2f0a4c3c, 0xbf36a908), TOBN(0x2ae9e34b, 0x58cf7838)}}, + {{TOBN(0xf411529e, 0x3fa11b1f), TOBN(0x21e43677, 0x974af2b4), + TOBN(0x7c20958e, 0xc230793b), TOBN(0x710ea885, 0x16e840f3)}, + {TOBN(0xfc0b21fc, 0xc5dc67cf), TOBN(0x08d51647, 0x88405718), + TOBN(0xd955c21f, 0xcfe49eb7), TOBN(0x9722a5d5, 0x56dd4a1f)}}, + {{TOBN(0xc9ef50e2, 0xc861baa5), TOBN(0xc0c21a5d, 0x9505ac3e), + TOBN(0xaf6b9a33, 0x8b7c063f), TOBN(0xc6370339, 0x2f4779c1)}, + {TOBN(0x22df99c7, 0x638167c3), TOBN(0xfe6ffe76, 0x795db30c), + TOBN(0x2b822d33, 0xa4854989), TOBN(0xfef031dd, 0x30563aa5)}}, + {{TOBN(0x16b09f82, 0xd57c667f), TOBN(0xc70312ce, 0xcc0b76f1), + TOBN(0xbf04a9e6, 0xc9118aec), TOBN(0x82fcb419, 0x3409d133)}, + {TOBN(0x1a8ab385, 0xab45d44d), TOBN(0xfba07222, 0x617b83a3), + TOBN(0xb05f50dd, 0x58e81b52), TOBN(0x1d8db553, 0x21ce5aff)}}, + {{TOBN(0x3097b8d4, 0xe344a873), TOBN(0x7d8d116d, 0xfe36d53e), + TOBN(0x6db22f58, 0x7875e750), TOBN(0x2dc5e373, 0x43e144ea)}, + {TOBN(0xc05f32e6, 0xe799eb95), TOBN(0xe9e5f4df, 0x6899e6ec), + TOBN(0xbdc3bd68, 0x1fab23d5), TOBN(0xb72b8ab7, 0x73af60e6)}}, + {{TOBN(0x8db27ae0, 0x2cecc84a), TOBN(0x600016d8, 0x7bdb871c), + TOBN(0x42a44b13, 0xd7c46f58), TOBN(0xb8919727, 0xc3a77d39)}, + {TOBN(0xcfc6bbbd, 0xdafd6088), TOBN(0x1a740146, 0x6bd20d39), + TOBN(0x8c747abd, 0x98c41072), TOBN(0x4c91e765, 0xbdf68ea1)}}, + {{TOBN(0x7c95e5ca, 0x08819a78), TOBN(0xcf48b729, 0xc9587921), + TOBN(0x091c7c5f, 0xdebbcc7d), TOBN(0x6f287404, 0xf0e05149)}, + {TOBN(0xf83b5ac2, 0x26cd44ec), TOBN(0x88ae32a6, 0xcfea250e), + TOBN(0x6ac5047a, 0x1d06ebc5), TOBN(0xc7e550b4, 0xd434f781)}}, + {{TOBN(0x61ab1cf2, 0x5c727bd2), TOBN(0x2e4badb1, 0x1cf915b0), + TOBN(0x1b4dadec, 0xf69d3920), TOBN(0xe61b1ca6, 0xf14c1dfe)}, + {TOBN(0x90b479cc, 0xbd6bd51f), TOBN(0x8024e401, 0x8045ec30), + TOBN(0xcab29ca3, 0x25ef0e62), TOBN(0x4f2e9416, 0x49e4ebc0)}}, + {{TOBN(0x45eb40ec, 0x0ccced58), TOBN(0x25cd4b9c, 0x0da44f98), + TOBN(0x43e06458, 0x871812c6), TOBN(0x99f80d55, 0x16cef651)}, + {TOBN(0x571340c9, 0xce6dc153), TOBN(0x138d5117, 0xd8665521), + TOBN(0xacdb45bc, 0x4e07014d), TOBN(0x2f34bb38, 0x84b60b91)}}, + {{TOBN(0xf44a4fd2, 0x2ae8921e), TOBN(0xb039288e, 0x892ba1e2), + TOBN(0x9da50174, 0xb1c180b2), TOBN(0x6b70ab66, 0x1693dc87)}, + {TOBN(0x7e9babc9, 0xe7057481), TOBN(0x4581ddef, 0x9c80dc41), + TOBN(0x0c890da9, 0x51294682), TOBN(0x0b5629d3, 0x3f4736e5)}}, + {{TOBN(0x2340c79e, 0xb06f5b41), TOBN(0xa42e84ce, 0x4e243469), + TOBN(0xf9a20135, 0x045a71a9), TOBN(0xefbfb415, 0xd27b6fb6)}, + {TOBN(0x25ebea23, 0x9d33cd6f), TOBN(0x9caedb88, 0xaa6c0af8), + TOBN(0x53dc7e9a, 0xd9ce6f96), TOBN(0x3897f9fd, 0x51e0b15a)}}, + {{TOBN(0xf51cb1f8, 0x8e5d788e), TOBN(0x1aec7ba8, 0xe1d490ee), + TOBN(0x265991e0, 0xcc58cb3c), TOBN(0x9f306e8c, 0x9fc3ad31)}, + {TOBN(0x5fed006e, 0x5040a0ac), TOBN(0xca9d5043, 0xfb476f2e), + TOBN(0xa19c06e8, 0xbeea7a23), TOBN(0xd2865801, 0x0edabb63)}}, + {{TOBN(0xdb92293f, 0x6967469a), TOBN(0x2894d839, 0x8d8a8ed8), + TOBN(0x87c9e406, 0xbbc77122), TOBN(0x8671c6f1, 0x2ea3a26a)}, + {TOBN(0xe42df8d6, 0xd7de9853), TOBN(0x2e3ce346, 0xb1f2bcc7), + TOBN(0xda601dfc, 0x899d50cf), TOBN(0xbfc913de, 0xfb1b598f)}}, + {{TOBN(0x81c4909f, 0xe61f7908), TOBN(0x192e304f, 0x9bbc7b29), + TOBN(0xc3ed8738, 0xc104b338), TOBN(0xedbe9e47, 0x783f5d61)}, + {TOBN(0x0c06e9be, 0x2db30660), TOBN(0xda3e613f, 0xc0eb7d8e), + TOBN(0xd8fa3e97, 0x322e096e), TOBN(0xfebd91e8, 0xd336e247)}}, + {{TOBN(0x8f13ccc4, 0xdf655a49), TOBN(0xa9e00dfc, 0x5eb20210), + TOBN(0x84631d0f, 0xc656b6ea), TOBN(0x93a058cd, 0xd8c0d947)}, + {TOBN(0x6846904a, 0x67bd3448), TOBN(0x4a3d4e1a, 0xf394fd5c), + TOBN(0xc102c1a5, 0xdb225f52), TOBN(0xe3455bba, 0xfc4f5e9a)}}, + {{TOBN(0x6b36985b, 0x4b9ad1ce), TOBN(0xa9818536, 0x5bb7f793), + TOBN(0x6c25e1d0, 0x48b1a416), TOBN(0x1381dd53, 0x3c81bee7)}, + {TOBN(0xd2a30d61, 0x7a4a7620), TOBN(0xc8412926, 0x39b8944c), + TOBN(0x3c1c6fbe, 0x7a97c33a), TOBN(0x941e541d, 0x938664e7)}}, + {{TOBN(0x417499e8, 0x4a34f239), TOBN(0x15fdb83c, 0xb90402d5), + TOBN(0xb75f46bf, 0x433aa832), TOBN(0xb61e15af, 0x63215db1)}, + {TOBN(0xaabe59d4, 0xa127f89a), TOBN(0x5d541e0c, 0x07e816da), + TOBN(0xaaba0659, 0xa618b692), TOBN(0x55327733, 0x17266026)}}, + {{TOBN(0xaf53a0fc, 0x95f57552), TOBN(0x32947650, 0x6cacb0c9), + TOBN(0x253ff58d, 0xc821be01), TOBN(0xb0309531, 0xa06f1146)}, + {TOBN(0x59bbbdf5, 0x05c2e54d), TOBN(0x158f27ad, 0x26e8dd22), + TOBN(0xcc5b7ffb, 0x397e1e53), TOBN(0xae03f65b, 0x7fc1e50d)}}, + {{TOBN(0xa9784ebd, 0x9c95f0f9), TOBN(0x5ed9deb2, 0x24640771), + TOBN(0x31244af7, 0x035561c4), TOBN(0x87332f3a, 0x7ee857de)}, + {TOBN(0x09e16e9e, 0x2b9e0d88), TOBN(0x52d910f4, 0x56a06049), + TOBN(0x507ed477, 0xa9592f48), TOBN(0x85cb917b, 0x2365d678)}}, + {{TOBN(0xf8511c93, 0x4c8998d1), TOBN(0x2186a3f1, 0x730ea58f), + TOBN(0x50189626, 0xb2029db0), TOBN(0x9137a6d9, 0x02ceb75a)}, + {TOBN(0x2fe17f37, 0x748bc82c), TOBN(0x87c2e931, 0x80469f8c), + TOBN(0x850f71cd, 0xbf891aa2), TOBN(0x0ca1b89b, 0x75ec3d8d)}}, + {{TOBN(0x516c43aa, 0x5e1cd3cd), TOBN(0x89397808, 0x9a887c28), + TOBN(0x0059c699, 0xddea1f9f), TOBN(0x7737d6fa, 0x8e6868f7)}, + {TOBN(0x6d93746a, 0x60f1524b), TOBN(0x36985e55, 0xba052aa7), + TOBN(0x41b1d322, 0xed923ea5), TOBN(0x3429759f, 0x25852a11)}}, + {{TOBN(0xbeca6ec3, 0x092e9f41), TOBN(0x3a238c66, 0x62256bbd), + TOBN(0xd82958ea, 0x70ad487d), TOBN(0x4ac8aaf9, 0x65610d93)}, + {TOBN(0x3fa101b1, 0x5e4ccab0), TOBN(0x9bf430f2, 0x9de14bfb), + TOBN(0xa10f5cc6, 0x6531899d), TOBN(0x590005fb, 0xea8ce17d)}}, + {{TOBN(0xc437912f, 0x24544cb6), TOBN(0x9987b71a, 0xd79ac2e3), + TOBN(0x13e3d9dd, 0xc058a212), TOBN(0x00075aac, 0xd2de9606)}, + {TOBN(0x80ab508b, 0x6cac8369), TOBN(0x87842be7, 0xf54f6c89), + TOBN(0xa7ad663d, 0x6bc532a4), TOBN(0x67813de7, 0x78a91bc8)}}, + {{TOBN(0x5dcb61ce, 0xc3427239), TOBN(0x5f3c7cf0, 0xc56934d9), + TOBN(0xc079e0fb, 0xe3191591), TOBN(0xe40896bd, 0xb01aada7)}, + {TOBN(0x8d466791, 0x0492d25f), TOBN(0x8aeb30c9, 0xe7408276), + TOBN(0xe9437495, 0x9287aacc), TOBN(0x23d4708d, 0x79fe03d4)}}, + {{TOBN(0x8cda9cf2, 0xd0c05199), TOBN(0x502fbc22, 0xfae78454), + TOBN(0xc0bda9df, 0xf572a182), TOBN(0x5f9b71b8, 0x6158b372)}, + {TOBN(0xe0f33a59, 0x2b82dd07), TOBN(0x76302735, 0x9523032e), + TOBN(0x7fe1a721, 0xc4505a32), TOBN(0x7b6e3e82, 0xf796409f)}}}, + {{{TOBN(0xe3417bc0, 0x35d0b34a), TOBN(0x440b386b, 0x8327c0a7), + TOBN(0x8fb7262d, 0xac0362d1), TOBN(0x2c41114c, 0xe0cdf943)}, + {TOBN(0x2ba5cef1, 0xad95a0b1), TOBN(0xc09b37a8, 0x67d54362), + TOBN(0x26d6cdd2, 0x01e486c9), TOBN(0x20477abf, 0x42ff9297)}}, + {{TOBN(0xa004dcb3, 0x292a9287), TOBN(0xddc15cf6, 0x77b092c7), + TOBN(0x083a8464, 0x806c0605), TOBN(0x4a68df70, 0x3db997b0)}, + {TOBN(0x9c134e45, 0x05bf7dd0), TOBN(0xa4e63d39, 0x8ccf7f8c), + TOBN(0xa6e6517f, 0x41b5f8af), TOBN(0xaa8b9342, 0xad7bc1cc)}}, + {{TOBN(0x126f35b5, 0x1e706ad9), TOBN(0xb99cebb4, 0xc3a9ebdf), + TOBN(0xa75389af, 0xbf608d90), TOBN(0x76113c4f, 0xc6c89858)}, + {TOBN(0x80de8eb0, 0x97e2b5aa), TOBN(0x7e1022cc, 0x63b91304), + TOBN(0x3bdab605, 0x6ccc066c), TOBN(0x33cbb144, 0xb2edf900)}}, + {{TOBN(0xc4176471, 0x7af715d2), TOBN(0xe2f7f594, 0xd0134a96), + TOBN(0x2c1873ef, 0xa41ec956), TOBN(0xe4e7b4f6, 0x77821304)}, + {TOBN(0xe5c8ff97, 0x88d5374a), TOBN(0x2b915e63, 0x80823d5b), + TOBN(0xea6bc755, 0xb2ee8fe2), TOBN(0x6657624c, 0xe7112651)}}, + {{TOBN(0x157af101, 0xdace5aca), TOBN(0xc4fdbcf2, 0x11a6a267), + TOBN(0xdaddf340, 0xc49c8609), TOBN(0x97e49f52, 0xe9604a65)}, + {TOBN(0x9be8e790, 0x937e2ad5), TOBN(0x846e2508, 0x326e17f1), + TOBN(0x3f38007a, 0x0bbbc0dc), TOBN(0xcf03603f, 0xb11e16d6)}}, + {{TOBN(0xd6f800e0, 0x7442f1d5), TOBN(0x475607d1, 0x66e0e3ab), + TOBN(0x82807f16, 0xb7c64047), TOBN(0x8858e1e3, 0xa749883d)}, + {TOBN(0x5859120b, 0x8231ee10), TOBN(0x1b80e7eb, 0x638a1ece), + TOBN(0xcb72525a, 0xc6aa73a4), TOBN(0xa7cdea3d, 0x844423ac)}}, + {{TOBN(0x5ed0c007, 0xf8ae7c38), TOBN(0x6db07a5c, 0x3d740192), + TOBN(0xbe5e9c2a, 0x5fe36db3), TOBN(0xd5b9d57a, 0x76e95046)}, + {TOBN(0x54ac32e7, 0x8eba20f2), TOBN(0xef11ca8f, 0x71b9a352), + TOBN(0x305e373e, 0xff98a658), TOBN(0xffe5a100, 0x823eb667)}}, + {{TOBN(0x57477b11, 0xe51732d2), TOBN(0xdfd6eb28, 0x2538fc0e), + TOBN(0x5c43b0cc, 0x3b39eec5), TOBN(0x6af12778, 0xcb36cc57)}, + {TOBN(0x70b0852d, 0x06c425ae), TOBN(0x6df92f8c, 0x5c221b9b), + TOBN(0x6c8d4f9e, 0xce826d9c), TOBN(0xf59aba7b, 0xb49359c3)}}, + {{TOBN(0x5c8ed8d5, 0xda64309d), TOBN(0x61a6de56, 0x91b30704), + TOBN(0xd6b52f6a, 0x2f9b5808), TOBN(0x0eee4194, 0x98c958a7)}, + {TOBN(0xcddd9aab, 0x771e4caa), TOBN(0x83965dfd, 0x78bc21be), + TOBN(0x02affce3, 0xb3b504f5), TOBN(0x30847a21, 0x561c8291)}}, + {{TOBN(0xd2eb2cf1, 0x52bfda05), TOBN(0xe0e4c4e9, 0x6197b98c), + TOBN(0x1d35076c, 0xf8a1726f), TOBN(0x6c06085b, 0x2db11e3d)}, + {TOBN(0x15c0c4d7, 0x4463ba14), TOBN(0x9d292f83, 0x0030238c), + TOBN(0x1311ee8b, 0x3727536d), TOBN(0xfeea86ef, 0xbeaedc1e)}}, + {{TOBN(0xb9d18cd3, 0x66131e2e), TOBN(0xf31d974f, 0x80fe2682), + TOBN(0xb6e49e0f, 0xe4160289), TOBN(0x7c48ec0b, 0x08e92799)}, + {TOBN(0x818111d8, 0xd1989aa7), TOBN(0xb34fa0aa, 0xebf926f9), + TOBN(0xdb5fe2f5, 0xa245474a), TOBN(0xf80a6ebb, 0x3c7ca756)}}, + {{TOBN(0xa7f96054, 0xafa05dd8), TOBN(0x26dfcf21, 0xfcaf119e), + TOBN(0xe20ef2e3, 0x0564bb59), TOBN(0xef4dca50, 0x61cb02b8)}, + {TOBN(0xcda7838a, 0x65d30672), TOBN(0x8b08d534, 0xfd657e86), + TOBN(0x4c5b4395, 0x46d595c8), TOBN(0x39b58725, 0x425cb836)}}, + {{TOBN(0x8ea61059, 0x3de9abe3), TOBN(0x40434881, 0x9cdc03be), + TOBN(0x9b261245, 0xcfedce8c), TOBN(0x78c318b4, 0xcf5234a1)}, + {TOBN(0x510bcf16, 0xfde24c99), TOBN(0x2a77cb75, 0xa2c2ff5d), + TOBN(0x9c895c2b, 0x27960fb4), TOBN(0xd30ce975, 0xb0eda42b)}}, + {{TOBN(0xfda85393, 0x1a62cc26), TOBN(0x23c69b96, 0x50c0e052), + TOBN(0xa227df15, 0xbfc633f3), TOBN(0x2ac78848, 0x1bae7d48)}, + {TOBN(0x487878f9, 0x187d073d), TOBN(0x6c2be919, 0x967f807d), + TOBN(0x765861d8, 0x336e6d8f), TOBN(0x88b8974c, 0xce528a43)}}, + {{TOBN(0x09521177, 0xff57d051), TOBN(0x2ff38037, 0xfb6a1961), + TOBN(0xfc0aba74, 0xa3d76ad4), TOBN(0x7c764803, 0x25a7ec17)}, + {TOBN(0x7532d75f, 0x48879bc8), TOBN(0xea7eacc0, 0x58ce6bc1), + TOBN(0xc82176b4, 0x8e896c16), TOBN(0x9a30e0b2, 0x2c750fed)}}, + {{TOBN(0xc37e2c2e, 0x421d3aa4), TOBN(0xf926407c, 0xe84fa840), + TOBN(0x18abc03d, 0x1454e41c), TOBN(0x26605ecd, 0x3f7af644)}, + {TOBN(0x242341a6, 0xd6a5eabf), TOBN(0x1edb84f4, 0x216b668e), + TOBN(0xd836edb8, 0x04010102), TOBN(0x5b337ce7, 0x945e1d8c)}}, + {{TOBN(0xd2075c77, 0xc055dc14), TOBN(0x2a0ffa25, 0x81d89cdf), + TOBN(0x8ce815ea, 0x6ffdcbaf), TOBN(0xa3428878, 0xfb648867)}, + {TOBN(0x277699cf, 0x884655fb), TOBN(0xfa5b5bd6, 0x364d3e41), + TOBN(0x01f680c6, 0x441e1cb7), TOBN(0x3fd61e66, 0xb70a7d67)}}, + {{TOBN(0x666ba2dc, 0xcc78cf66), TOBN(0xb3018174, 0x6fdbff77), + TOBN(0x8d4dd0db, 0x168d4668), TOBN(0x259455d0, 0x1dab3a2a)}, + {TOBN(0xf58564c5, 0xcde3acec), TOBN(0x77141925, 0x13adb276), + TOBN(0x527d725d, 0x8a303f65), TOBN(0x55deb6c9, 0xe6f38f7b)}}, + {{TOBN(0xfd5bb657, 0xb1fa70fb), TOBN(0xfa07f50f, 0xd8073a00), + TOBN(0xf72e3aa7, 0xbca02500), TOBN(0xf68f895d, 0x9975740d)}, + {TOBN(0x30112060, 0x5cae2a6a), TOBN(0x01bd7218, 0x02874842), + TOBN(0x3d423891, 0x7ce47bd3), TOBN(0xa66663c1, 0x789544f6)}}, + {{TOBN(0x864d05d7, 0x3272d838), TOBN(0xe22924f9, 0xfa6295c5), + TOBN(0x8189593f, 0x6c2fda32), TOBN(0x330d7189, 0xb184b544)}, + {TOBN(0x79efa62c, 0xbde1f714), TOBN(0x35771c94, 0xe5cb1a63), + TOBN(0x2f4826b8, 0x641c8332), TOBN(0x00a894fb, 0xc8cee854)}}, + {{TOBN(0xb4b9a39b, 0x36194d40), TOBN(0xe857a7c5, 0x77612601), + TOBN(0xf4209dd2, 0x4ecf2f58), TOBN(0x82b9e66d, 0x5a033487)}, + {TOBN(0xc1e36934, 0xe4e8b9dd), TOBN(0xd2372c9d, 0xa42377d7), + TOBN(0x51dc94c7, 0x0e3ae43b), TOBN(0x4c57761e, 0x04474f6f)}}, + {{TOBN(0xdcdacd0a, 0x1058a318), TOBN(0x369cf3f5, 0x78053a9a), + TOBN(0xc6c3de50, 0x31c68de2), TOBN(0x4653a576, 0x3c4b6d9f)}, + {TOBN(0x1688dd5a, 0xaa4e5c97), TOBN(0x5be80aa1, 0xb7ab3c74), + TOBN(0x70cefe7c, 0xbc65c283), TOBN(0x57f95f13, 0x06867091)}}, + {{TOBN(0xa39114e2, 0x4415503b), TOBN(0xc08ff7c6, 0x4cbb17e9), + TOBN(0x1eff674d, 0xd7dec966), TOBN(0x6d4690af, 0x53376f63)}, + {TOBN(0xff6fe32e, 0xea74237b), TOBN(0xc436d17e, 0xcd57508e), + TOBN(0x15aa28e1, 0xedcc40fe), TOBN(0x0d769c04, 0x581bbb44)}}, + {{TOBN(0xc240b6de, 0x34eaacda), TOBN(0xd9e116e8, 0x2ba0f1de), + TOBN(0xcbe45ec7, 0x79438e55), TOBN(0x91787c9d, 0x96f752d7)}, + {TOBN(0x897f532b, 0xf129ac2f), TOBN(0xd307b7c8, 0x5a36e22c), + TOBN(0x91940675, 0x749fb8f3), TOBN(0xd14f95d0, 0x157fdb28)}}, + {{TOBN(0xfe51d029, 0x6ae55043), TOBN(0x8931e98f, 0x44a87de1), + TOBN(0xe57f1cc6, 0x09e4fee2), TOBN(0x0d063b67, 0x4e072d92)}, + {TOBN(0x70a998b9, 0xed0e4316), TOBN(0xe74a736b, 0x306aca46), + TOBN(0xecf0fbf2, 0x4fda97c7), TOBN(0xa40f65cb, 0x3e178d93)}}, + {{TOBN(0x16253604, 0x16df4285), TOBN(0xb0c9babb, 0xd0c56ae2), + TOBN(0x73032b19, 0xcfc5cfc3), TOBN(0xe497e5c3, 0x09752056)}, + {TOBN(0x12096bb4, 0x164bda96), TOBN(0x1ee42419, 0xa0b74da1), + TOBN(0x8fc36243, 0x403826ba), TOBN(0x0c8f0069, 0xdc09e660)}}, + {{TOBN(0x8667e981, 0xc27253c9), TOBN(0x05a6aefb, 0x92b36a45), + TOBN(0xa62c4b36, 0x9cb7bb46), TOBN(0x8394f375, 0x11f7027b)}, + {TOBN(0x747bc79c, 0x5f109d0f), TOBN(0xcad88a76, 0x5b8cc60a), + TOBN(0x80c5a66b, 0x58f09e68), TOBN(0xe753d451, 0xf6127eac)}}, + {{TOBN(0xc44b74a1, 0x5b0ec6f5), TOBN(0x47989fe4, 0x5289b2b8), + TOBN(0x745f8484, 0x58d6fc73), TOBN(0xec362a6f, 0xf61c70ab)}, + {TOBN(0x070c98a7, 0xb3a8ad41), TOBN(0x73a20fc0, 0x7b63db51), + TOBN(0xed2c2173, 0xf44c35f4), TOBN(0x8a56149d, 0x9acc9dca)}}, + {{TOBN(0x98f17881, 0x9ac6e0f4), TOBN(0x360fdeaf, 0xa413b5ed), + TOBN(0x0625b8f4, 0xa300b0fd), TOBN(0xf1f4d76a, 0x5b3222d3)}, + {TOBN(0x9d6f5109, 0x587f76b8), TOBN(0x8b4ee08d, 0x2317fdb5), + TOBN(0x88089bb7, 0x8c68b095), TOBN(0x95570e9a, 0x5808d9b9)}}, + {{TOBN(0xa395c36f, 0x35d33ae7), TOBN(0x200ea123, 0x50bb5a94), + TOBN(0x20c789bd, 0x0bafe84b), TOBN(0x243ef52d, 0x0919276a)}, + {TOBN(0x3934c577, 0xe23ae233), TOBN(0xb93807af, 0xa460d1ec), + TOBN(0xb72a53b1, 0xf8fa76a4), TOBN(0xd8914cb0, 0xc3ca4491)}}, + {{TOBN(0x2e128494, 0x3fb42622), TOBN(0x3b2700ac, 0x500907d5), + TOBN(0xf370fb09, 0x1a95ec63), TOBN(0xf8f30be2, 0x31b6dfbd)}, + {TOBN(0xf2b2f8d2, 0x69e55f15), TOBN(0x1fead851, 0xcc1323e9), + TOBN(0xfa366010, 0xd9e5eef6), TOBN(0x64d487b0, 0xe316107e)}}, + {{TOBN(0x4c076b86, 0xd23ddc82), TOBN(0x03fd344c, 0x7e0143f0), + TOBN(0xa95362ff, 0x317af2c5), TOBN(0x0add3db7, 0xe18b7a4f)}, + {TOBN(0x9c673e3f, 0x8260e01b), TOBN(0xfbeb49e5, 0x54a1cc91), + TOBN(0x91351bf2, 0x92f2e433), TOBN(0xc755e7ec, 0x851141eb)}}, + {{TOBN(0xc9a95139, 0x29607745), TOBN(0x0ca07420, 0xa26f2b28), + TOBN(0xcb2790e7, 0x4bc6f9dd), TOBN(0x345bbb58, 0xadcaffc0)}, + {TOBN(0xc65ea38c, 0xbe0f27a2), TOBN(0x67c24d7c, 0x641fcb56), + TOBN(0x2c25f0a7, 0xa9e2c757), TOBN(0x93f5cdb0, 0x16f16c49)}}, + {{TOBN(0x2ca5a9d7, 0xc5ee30a1), TOBN(0xd1593635, 0xb909b729), + TOBN(0x804ce9f3, 0xdadeff48), TOBN(0xec464751, 0xb07c30c3)}, + {TOBN(0x89d65ff3, 0x9e49af6a), TOBN(0xf2d6238a, 0x6f3d01bc), + TOBN(0x1095561e, 0x0bced843), TOBN(0x51789e12, 0xc8a13fd8)}}, + {{TOBN(0xd633f929, 0x763231df), TOBN(0x46df9f7d, 0xe7cbddef), + TOBN(0x01c889c0, 0xcb265da8), TOBN(0xfce1ad10, 0xaf4336d2)}, + {TOBN(0x8d110df6, 0xfc6a0a7e), TOBN(0xdd431b98, 0x6da425dc), + TOBN(0xcdc4aeab, 0x1834aabe), TOBN(0x84deb124, 0x8439b7fc)}}, + {{TOBN(0x8796f169, 0x3c2a5998), TOBN(0x9b9247b4, 0x7947190d), + TOBN(0x55b9d9a5, 0x11597014), TOBN(0x7e9dd70d, 0x7b1566ee)}, + {TOBN(0x94ad78f7, 0xcbcd5e64), TOBN(0x0359ac17, 0x9bd4c032), + TOBN(0x3b11baaf, 0x7cc222ae), TOBN(0xa6a6e284, 0xba78e812)}}, + {{TOBN(0x8392053f, 0x24cea1a0), TOBN(0xc97bce4a, 0x33621491), + TOBN(0x7eb1db34, 0x35399ee9), TOBN(0x473f78ef, 0xece81ad1)}, + {TOBN(0x41d72fe0, 0xf63d3d0d), TOBN(0xe620b880, 0xafab62fc), + TOBN(0x92096bc9, 0x93158383), TOBN(0x41a21357, 0x8f896f6c)}}, + {{TOBN(0x1b5ee2fa, 0xc7dcfcab), TOBN(0x650acfde, 0x9546e007), + TOBN(0xc081b749, 0xb1b02e07), TOBN(0xda9e41a0, 0xf9eca03d)}, + {TOBN(0x013ba727, 0x175a54ab), TOBN(0xca0cd190, 0xea5d8d10), + TOBN(0x85ea52c0, 0x95fd96a9), TOBN(0x2c591b9f, 0xbc5c3940)}}, + {{TOBN(0x6fb4d4e4, 0x2bad4d5f), TOBN(0xfa4c3590, 0xfef0059b), + TOBN(0x6a10218a, 0xf5122294), TOBN(0x9a78a81a, 0xa85751d1)}, + {TOBN(0x04f20579, 0xa98e84e7), TOBN(0xfe1242c0, 0x4997e5b5), + TOBN(0xe77a273b, 0xca21e1e4), TOBN(0xfcc8b1ef, 0x9411939d)}}, + {{TOBN(0xe20ea302, 0x92d0487a), TOBN(0x1442dbec, 0x294b91fe), + TOBN(0x1f7a4afe, 0xbb6b0e8f), TOBN(0x1700ef74, 0x6889c318)}, + {TOBN(0xf5bbffc3, 0x70f1fc62), TOBN(0x3b31d4b6, 0x69c79cca), + TOBN(0xe8bc2aab, 0xa7f6340d), TOBN(0xb0b08ab4, 0xa725e10a)}}, + {{TOBN(0x44f05701, 0xae340050), TOBN(0xba4b3016, 0x1cf0c569), + TOBN(0x5aa29f83, 0xfbe19a51), TOBN(0x1b9ed428, 0xb71d752e)}, + {TOBN(0x1666e54e, 0xeb4819f5), TOBN(0x616cdfed, 0x9e18b75b), + TOBN(0x112ed5be, 0x3ee27b0b), TOBN(0xfbf28319, 0x44c7de4d)}}, + {{TOBN(0xd685ec85, 0xe0e60d84), TOBN(0x68037e30, 0x1db7ee78), + TOBN(0x5b65bdcd, 0x003c4d6e), TOBN(0x33e7363a, 0x93e29a6a)}, + {TOBN(0x995b3a61, 0x08d0756c), TOBN(0xd727f85c, 0x2faf134b), + TOBN(0xfac6edf7, 0x1d337823), TOBN(0x99b9aa50, 0x0439b8b4)}}, + {{TOBN(0x722eb104, 0xe2b4e075), TOBN(0x49987295, 0x437c4926), + TOBN(0xb1e4c0e4, 0x46a9b82d), TOBN(0xd0cb3197, 0x57a006f5)}, + {TOBN(0xf3de0f7d, 0xd7808c56), TOBN(0xb5c54d8f, 0x51f89772), + TOBN(0x500a114a, 0xadbd31aa), TOBN(0x9afaaaa6, 0x295f6cab)}}, + {{TOBN(0x94705e21, 0x04cf667a), TOBN(0xfc2a811b, 0x9d3935d7), + TOBN(0x560b0280, 0x6d09267c), TOBN(0xf19ed119, 0xf780e53b)}, + {TOBN(0xf0227c09, 0x067b6269), TOBN(0x967b8533, 0x5caef599), + TOBN(0x155b9243, 0x68efeebc), TOBN(0xcd6d34f5, 0xc497bae6)}}, + {{TOBN(0x1dd8d5d3, 0x6cceb370), TOBN(0x2aeac579, 0xa78d7bf9), + TOBN(0x5d65017d, 0x70b67a62), TOBN(0x70c8e44f, 0x17c53f67)}, + {TOBN(0xd1fc0950, 0x86a34d09), TOBN(0xe0fca256, 0xe7134907), + TOBN(0xe24fa29c, 0x80fdd315), TOBN(0x2c4acd03, 0xd87499ad)}}, + {{TOBN(0xbaaf7517, 0x3b5a9ba6), TOBN(0xb9cbe1f6, 0x12e51a51), + TOBN(0xd88edae3, 0x5e154897), TOBN(0xe4309c3c, 0x77b66ca0)}, + {TOBN(0xf5555805, 0xf67f3746), TOBN(0x85fc37ba, 0xa36401ff), + TOBN(0xdf86e2ca, 0xd9499a53), TOBN(0x6270b2a3, 0xecbc955b)}}, + {{TOBN(0xafae64f5, 0x974ad33b), TOBN(0x04d85977, 0xfe7b2df1), + TOBN(0x2a3db3ff, 0x4ab03f73), TOBN(0x0b87878a, 0x8702740a)}, + {TOBN(0x6d263f01, 0x5a061732), TOBN(0xc25430ce, 0xa32a1901), + TOBN(0xf7ebab3d, 0xdb155018), TOBN(0x3a86f693, 0x63a9b78e)}}, + {{TOBN(0x349ae368, 0xda9f3804), TOBN(0x470f07fe, 0xa164349c), + TOBN(0xd52f4cc9, 0x8562baa5), TOBN(0xc74a9e86, 0x2b290df3)}, + {TOBN(0xd3a1aa35, 0x43471a24), TOBN(0x239446be, 0xb8194511), + TOBN(0xbec2dd00, 0x81dcd44d), TOBN(0xca3d7f0f, 0xc42ac82d)}}, + {{TOBN(0x1f3db085, 0xfdaf4520), TOBN(0xbb6d3e80, 0x4549daf2), + TOBN(0xf5969d8a, 0x19ad5c42), TOBN(0x7052b13d, 0xdbfd1511)}, + {TOBN(0x11890d1b, 0x682b9060), TOBN(0xa71d3883, 0xac34452c), + TOBN(0xa438055b, 0x783805b4), TOBN(0x43241277, 0x4725b23e)}}, + {{TOBN(0xf20cf96e, 0x4901bbed), TOBN(0x6419c710, 0xf432a2bb), + TOBN(0x57a0fbb9, 0xdfa9cd7d), TOBN(0x589111e4, 0x00daa249)}, + {TOBN(0x19809a33, 0x7b60554e), TOBN(0xea5f8887, 0xede283a4), + TOBN(0x2d713802, 0x503bfd35), TOBN(0x151bb0af, 0x585d2a53)}}, + {{TOBN(0x40b08f74, 0x43b30ca8), TOBN(0xe10b5bba, 0xd9934583), + TOBN(0xe8a546d6, 0xb51110ad), TOBN(0x1dd50e66, 0x28e0b6c5)}, + {TOBN(0x292e9d54, 0xcff2b821), TOBN(0x3882555d, 0x47281760), + TOBN(0x134838f8, 0x3724d6e3), TOBN(0xf2c679e0, 0x22ddcda1)}}, + {{TOBN(0x40ee8815, 0x6d2a5768), TOBN(0x7f227bd2, 0x1c1e7e2d), + TOBN(0x487ba134, 0xd04ff443), TOBN(0x76e2ff3d, 0xc614e54b)}, + {TOBN(0x36b88d6f, 0xa3177ec7), TOBN(0xbf731d51, 0x2328fff5), + TOBN(0x758caea2, 0x49ba158e), TOBN(0x5ab8ff4c, 0x02938188)}}, + {{TOBN(0x33e16056, 0x35edc56d), TOBN(0x5a69d349, 0x7e940d79), + TOBN(0x6c4fd001, 0x03866dcb), TOBN(0x20a38f57, 0x4893cdef)}, + {TOBN(0xfbf3e790, 0xfac3a15b), TOBN(0x6ed7ea2e, 0x7a4f8e6b), + TOBN(0xa663eb4f, 0xbc3aca86), TOBN(0x22061ea5, 0x080d53f7)}}, + {{TOBN(0x2480dfe6, 0xf546783f), TOBN(0xd38bc6da, 0x5a0a641e), + TOBN(0xfb093cd1, 0x2ede8965), TOBN(0x89654db4, 0xacb455cf)}, + {TOBN(0x413cbf9a, 0x26e1adee), TOBN(0x291f3764, 0x373294d4), + TOBN(0x00797257, 0x648083fe), TOBN(0x25f504d3, 0x208cc341)}}, + {{TOBN(0x635a8e5e, 0xc3a0ee43), TOBN(0x70aaebca, 0x679898ff), + TOBN(0x9ee9f547, 0x5dc63d56), TOBN(0xce987966, 0xffb34d00)}, + {TOBN(0xf9f86b19, 0x5e26310a), TOBN(0x9e435484, 0x382a8ca8), + TOBN(0x253bcb81, 0xc2352fe4), TOBN(0xa4eac8b0, 0x4474b571)}}, + {{TOBN(0xc1b97512, 0xc1ad8cf8), TOBN(0x193b4e9e, 0x99e0b697), + TOBN(0x939d2716, 0x01e85df0), TOBN(0x4fb265b3, 0xcd44eafd)}, + {TOBN(0x321e7dcd, 0xe51e1ae2), TOBN(0x8e3a8ca6, 0xe3d8b096), + TOBN(0x8de46cb0, 0x52604998), TOBN(0x91099ad8, 0x39072aa7)}}, + {{TOBN(0x2617f91c, 0x93aa96b8), TOBN(0x0fc8716b, 0x7fca2e13), + TOBN(0xa7106f5e, 0x95328723), TOBN(0xd1c9c40b, 0x262e6522)}, + {TOBN(0xb9bafe86, 0x42b7c094), TOBN(0x1873439d, 0x1543c021), + TOBN(0xe1baa5de, 0x5cbefd5d), TOBN(0xa363fc5e, 0x521e8aff)}}, + {{TOBN(0xefe6320d, 0xf862eaac), TOBN(0x14419c63, 0x22c647dc), + TOBN(0x0e06707c, 0x4e46d428), TOBN(0xcb6c834f, 0x4a178f8f)}, + {TOBN(0x0f993a45, 0xd30f917c), TOBN(0xd4c4b049, 0x9879afee), + TOBN(0xb6142a1e, 0x70500063), TOBN(0x7c9b41c3, 0xa5d9d605)}}, + {{TOBN(0xbc00fc2f, 0x2f8ba2c7), TOBN(0x0966eb2f, 0x7c67aa28), + TOBN(0x13f7b516, 0x5a786972), TOBN(0x3bfb7557, 0x8a2fbba0)}, + {TOBN(0x131c4f23, 0x5a2b9620), TOBN(0xbff3ed27, 0x6faf46be), + TOBN(0x9b4473d1, 0x7e172323), TOBN(0x421e8878, 0x339f6246)}}, + {{TOBN(0x0fa8587a, 0x25a41632), TOBN(0xc0814124, 0xa35b6c93), + TOBN(0x2b18a9f5, 0x59ebb8db), TOBN(0x264e3357, 0x76edb29c)}, + {TOBN(0xaf245ccd, 0xc87c51e2), TOBN(0x16b3015b, 0x501e6214), + TOBN(0xbb31c560, 0x0a3882ce), TOBN(0x6961bb94, 0xfec11e04)}}, + {{TOBN(0x3b825b8d, 0xeff7a3a0), TOBN(0xbec33738, 0xb1df7326), + TOBN(0x68ad747c, 0x99604a1f), TOBN(0xd154c934, 0x9a3bd499)}, + {TOBN(0xac33506f, 0x1cc7a906), TOBN(0x73bb5392, 0x6c560e8f), + TOBN(0x6428fcbe, 0x263e3944), TOBN(0xc11828d5, 0x1c387434)}}, + {{TOBN(0x3cd04be1, 0x3e4b12ff), TOBN(0xc3aad9f9, 0x2d88667c), + TOBN(0xc52ddcf8, 0x248120cf), TOBN(0x985a892e, 0x2a389532)}, + {TOBN(0xfbb4b21b, 0x3bb85fa0), TOBN(0xf95375e0, 0x8dfc6269), + TOBN(0xfb4fb06c, 0x7ee2acea), TOBN(0x6785426e, 0x309c4d1f)}}, + {{TOBN(0x659b17c8, 0xd8ceb147), TOBN(0x9b649eee, 0xb70a5554), + TOBN(0x6b7fa0b5, 0xac6bc634), TOBN(0xd99fe2c7, 0x1d6e732f)}, + {TOBN(0x30e6e762, 0x8d3abba2), TOBN(0x18fee6e7, 0xa797b799), + TOBN(0x5c9d360d, 0xc696464d), TOBN(0xe3baeb48, 0x27bfde12)}}, + {{TOBN(0x2bf5db47, 0xf23206d5), TOBN(0x2f6d3420, 0x1d260152), + TOBN(0x17b87653, 0x3f8ff89a), TOBN(0x5157c30c, 0x378fa458)}, + {TOBN(0x7517c5c5, 0x2d4fb936), TOBN(0xef22f7ac, 0xe6518cdc), + TOBN(0xdeb483e6, 0xbf847a64), TOBN(0xf5084558, 0x92e0fa89)}}}, + {{{TOBN(0xab9659d8, 0xdf7304d4), TOBN(0xb71bcf1b, 0xff210e8e), + TOBN(0xa9a2438b, 0xd73fbd60), TOBN(0x4595cd1f, 0x5d11b4de)}, + {TOBN(0x9c0d329a, 0x4835859d), TOBN(0x4a0f0d2d, 0x7dbb6e56), + TOBN(0xc6038e5e, 0xdf928a4e), TOBN(0xc9429621, 0x8f5ad154)}}, + {{TOBN(0x91213462, 0xf23f2d92), TOBN(0x6cab71bd, 0x60b94078), + TOBN(0x6bdd0a63, 0x176cde20), TOBN(0x54c9b20c, 0xee4d54bc)}, + {TOBN(0x3cd2d8aa, 0x9f2ac02f), TOBN(0x03f8e617, 0x206eedb0), + TOBN(0xc7f68e16, 0x93086434), TOBN(0x831469c5, 0x92dd3db9)}}, + {{TOBN(0x8521df24, 0x8f981354), TOBN(0x587e23ec, 0x3588a259), + TOBN(0xcbedf281, 0xd7a0992c), TOBN(0x06930a55, 0x38961407)}, + {TOBN(0x09320deb, 0xbe5bbe21), TOBN(0xa7ffa5b5, 0x2491817f), + TOBN(0xe6c8b4d9, 0x09065160), TOBN(0xac4f3992, 0xfff6d2a9)}}, + {{TOBN(0x7aa7a158, 0x3ae9c1bd), TOBN(0xe0af6d98, 0xe37ce240), + TOBN(0xe54342d9, 0x28ab38b4), TOBN(0xe8b75007, 0x0a1c98ca)}, + {TOBN(0xefce86af, 0xe02358f2), TOBN(0x31b8b856, 0xea921228), + TOBN(0x052a1912, 0x0a1c67fc), TOBN(0xb4069ea4, 0xe3aead59)}}, + {{TOBN(0x3232d6e2, 0x7fa03cb3), TOBN(0xdb938e5b, 0x0fdd7d88), + TOBN(0x04c1d2cd, 0x2ccbfc5d), TOBN(0xd2f45c12, 0xaf3a580f)}, + {TOBN(0x592620b5, 0x7883e614), TOBN(0x5fd27e68, 0xbe7c5f26), + TOBN(0x139e45a9, 0x1567e1e3), TOBN(0x2cc71d2d, 0x44d8aaaf)}}, + {{TOBN(0x4a9090cd, 0xe36d0757), TOBN(0xf722d7b1, 0xd9a29382), + TOBN(0xfb7fb04c, 0x04b48ddf), TOBN(0x628ad2a7, 0xebe16f43)}, + {TOBN(0xcd3fbfb5, 0x20226040), TOBN(0x6c34ecb1, 0x5104b6c4), + TOBN(0x30c0754e, 0xc903c188), TOBN(0xec336b08, 0x2d23cab0)}}, + {{TOBN(0x473d62a2, 0x1e206ee5), TOBN(0xf1e27480, 0x8c49a633), + TOBN(0x87ab956c, 0xe9f6b2c3), TOBN(0x61830b48, 0x62b606ea)}, + {TOBN(0x67cd6846, 0xe78e815f), TOBN(0xfe40139f, 0x4c02082a), + TOBN(0x52bbbfcb, 0x952ec365), TOBN(0x74c11642, 0x6b9836ab)}}, + {{TOBN(0x9f51439e, 0x558df019), TOBN(0x230da4ba, 0xac712b27), + TOBN(0x518919e3, 0x55185a24), TOBN(0x4dcefcdd, 0x84b78f50)}, + {TOBN(0xa7d90fb2, 0xa47d4c5a), TOBN(0x55ac9abf, 0xb30e009e), + TOBN(0xfd2fc359, 0x74eed273), TOBN(0xb72d824c, 0xdbea8faf)}}, + {{TOBN(0xce721a74, 0x4513e2ca), TOBN(0x0b418612, 0x38240b2c), + TOBN(0x05199968, 0xd5baa450), TOBN(0xeb1757ed, 0x2b0e8c25)}, + {TOBN(0x6ebc3e28, 0x3dfac6d5), TOBN(0xb2431e2e, 0x48a237f5), + TOBN(0x2acb5e23, 0x52f61499), TOBN(0x5558a2a7, 0xe06c936b)}}, + {{TOBN(0xd213f923, 0xcbb13d1b), TOBN(0x98799f42, 0x5bfb9bfe), + TOBN(0x1ae8ddc9, 0x701144a9), TOBN(0x0b8b3bb6, 0x4c5595ee)}, + {TOBN(0x0ea9ef2e, 0x3ecebb21), TOBN(0x17cb6c4b, 0x3671f9a7), + TOBN(0x47ef464f, 0x726f1d1f), TOBN(0x171b9484, 0x6943a276)}}, + {{TOBN(0x51a4ae2d, 0x7ef0329c), TOBN(0x08509222, 0x91c4402a), + TOBN(0x64a61d35, 0xafd45bbc), TOBN(0x38f096fe, 0x3035a851)}, + {TOBN(0xc7468b74, 0xa1dec027), TOBN(0xe8cf10e7, 0x4fc7dcba), + TOBN(0xea35ff40, 0xf4a06353), TOBN(0x0b4c0dfa, 0x8b77dd66)}}, + {{TOBN(0x779b8552, 0xde7e5c19), TOBN(0xfab28609, 0xc1c0256c), + TOBN(0x64f58eee, 0xabd4743d), TOBN(0x4e8ef838, 0x7b6cc93b)}, + {TOBN(0xee650d26, 0x4cb1bf3d), TOBN(0x4c1f9d09, 0x73dedf61), + TOBN(0xaef7c9d7, 0xbfb70ced), TOBN(0x1ec0507e, 0x1641de1e)}}, + {{TOBN(0xcd7e5cc7, 0xcde45079), TOBN(0xde173c9a, 0x516ac9e4), + TOBN(0x517a8494, 0xc170315c), TOBN(0x438fd905, 0x91d8e8fb)}, + {TOBN(0x5145c506, 0xc7d9630b), TOBN(0x6457a87b, 0xf47d4d75), + TOBN(0xd31646bf, 0x0d9a80e8), TOBN(0x453add2b, 0xcef3aabe)}}, + {{TOBN(0xc9941109, 0xa607419d), TOBN(0xfaa71e62, 0xbb6bca80), + TOBN(0x34158c13, 0x07c431f3), TOBN(0x594abebc, 0x992bc47a)}, + {TOBN(0x6dfea691, 0xeb78399f), TOBN(0x48aafb35, 0x3f42cba4), + TOBN(0xedcd65af, 0x077c04f0), TOBN(0x1a29a366, 0xe884491a)}}, + {{TOBN(0x023a40e5, 0x1c21f2bf), TOBN(0xf99a513c, 0xa5057aee), + TOBN(0xa3fe7e25, 0xbcab072e), TOBN(0x8568d2e1, 0x40e32bcf)}, + {TOBN(0x904594eb, 0xd3f69d9f), TOBN(0x181a9733, 0x07affab1), + TOBN(0xe4d68d76, 0xb6e330f4), TOBN(0x87a6dafb, 0xc75a7fc1)}}, + {{TOBN(0x549db2b5, 0xef7d9289), TOBN(0x2480d4a8, 0x197f015a), + TOBN(0x61d5590b, 0xc40493b6), TOBN(0x3a55b52e, 0x6f780331)}, + {TOBN(0x40eb8115, 0x309eadb0), TOBN(0xdea7de5a, 0x92e5c625), + TOBN(0x64d631f0, 0xcc6a3d5a), TOBN(0x9d5e9d7c, 0x93e8dd61)}}, + {{TOBN(0xf297bef5, 0x206d3ffc), TOBN(0x23d5e033, 0x7d808bd4), + TOBN(0x4a4f6912, 0xd24cf5ba), TOBN(0xe4d8163b, 0x09cdaa8a)}, + {TOBN(0x0e0de9ef, 0xd3082e8e), TOBN(0x4fe1246c, 0x0192f360), + TOBN(0x1f900150, 0x4b8eee0a), TOBN(0x5219da81, 0xf1da391b)}}, + {{TOBN(0x7bf6a5c1, 0xf7ea25aa), TOBN(0xd165e6bf, 0xfbb07d5f), + TOBN(0xe3539361, 0x89e78671), TOBN(0xa3fcac89, 0x2bac4219)}, + {TOBN(0xdfab6fd4, 0xf0baa8ab), TOBN(0x5a4adac1, 0xe2c1c2e5), + TOBN(0x6cd75e31, 0x40d85849), TOBN(0xce263fea, 0x19b39181)}}, + {{TOBN(0xcb6803d3, 0x07032c72), TOBN(0x7f40d5ce, 0x790968c8), + TOBN(0xa6de86bd, 0xdce978f0), TOBN(0x25547c4f, 0x368f751c)}, + {TOBN(0xb1e685fd, 0x65fb2a9e), TOBN(0xce69336f, 0x1eb9179c), + TOBN(0xb15d1c27, 0x12504442), TOBN(0xb7df465c, 0xb911a06b)}}, + {{TOBN(0xb8d804a3, 0x315980cd), TOBN(0x693bc492, 0xfa3bebf7), + TOBN(0x3578aeee, 0x2253c504), TOBN(0x158de498, 0xcd2474a2)}, + {TOBN(0x1331f5c7, 0xcfda8368), TOBN(0xd2d7bbb3, 0x78d7177e), + TOBN(0xdf61133a, 0xf3c1e46e), TOBN(0x5836ce7d, 0xd30e7be8)}}, + {{TOBN(0x83084f19, 0x94f834cb), TOBN(0xd35653d4, 0x429ed782), + TOBN(0xa542f16f, 0x59e58243), TOBN(0xc2b52f65, 0x0470a22d)}, + {TOBN(0xe3b6221b, 0x18f23d96), TOBN(0xcb05abac, 0x3f5252b4), + TOBN(0xca00938b, 0x87d61402), TOBN(0x2f186cdd, 0x411933e4)}}, + {{TOBN(0xe042ece5, 0x9a29a5c5), TOBN(0xb19b3c07, 0x3b6c8402), + TOBN(0xc97667c7, 0x19d92684), TOBN(0xb5624622, 0xebc66372)}, + {TOBN(0x0cb96e65, 0x3c04fa02), TOBN(0x83a7176c, 0x8eaa39aa), + TOBN(0x2033561d, 0xeaa1633f), TOBN(0x45a9d086, 0x4533df73)}}, + {{TOBN(0xe0542c1d, 0x3dc090bc), TOBN(0x82c996ef, 0xaa59c167), + TOBN(0xe3f735e8, 0x0ee7fc4d), TOBN(0x7b179393, 0x7c35db79)}, + {TOBN(0xb6419e25, 0xf8c5dbfd), TOBN(0x4d9d7a1e, 0x1f327b04), + TOBN(0x979f6f9b, 0x298dfca8), TOBN(0xc7c5dff1, 0x8de9366a)}}, + {{TOBN(0x1b7a588d, 0x04c82bdd), TOBN(0x68005534, 0xf8319dfd), + TOBN(0xde8a55b5, 0xd8eb9580), TOBN(0x5ea886da, 0x8d5bca81)}, + {TOBN(0xe8530a01, 0x252a0b4d), TOBN(0x1bffb4fe, 0x35eaa0a1), + TOBN(0x2ad828b1, 0xd8e99563), TOBN(0x7de96ef5, 0x95f9cd87)}}, + {{TOBN(0x4abb2d0c, 0xd77d970c), TOBN(0x03cfb933, 0xd33ef9cb), + TOBN(0xb0547c01, 0x8b211fe9), TOBN(0x2fe64809, 0xa56ed1c6)}, + {TOBN(0xcb7d5624, 0xc2ac98cc), TOBN(0x2a1372c0, 0x1a393e33), + TOBN(0xc8d1ec1c, 0x29660521), TOBN(0xf3d31b04, 0xb37ac3e9)}}, + {{TOBN(0xa29ae9df, 0x5ece6e7c), TOBN(0x0603ac8f, 0x0facfb55), + TOBN(0xcfe85b7a, 0xdda233a5), TOBN(0xe618919f, 0xbd75f0b8)}, + {TOBN(0xf555a3d2, 0x99bf1603), TOBN(0x1f43afc9, 0xf184255a), + TOBN(0xdcdaf341, 0x319a3e02), TOBN(0xd3b117ef, 0x03903a39)}}, + {{TOBN(0xe095da13, 0x65d1d131), TOBN(0x86f16367, 0xc37ad03e), + TOBN(0x5f37389e, 0x462cd8dd), TOBN(0xc103fa04, 0xd67a60e6)}, + {TOBN(0x57c34344, 0xf4b478f0), TOBN(0xce91edd8, 0xe117c98d), + TOBN(0x001777b0, 0x231fc12e), TOBN(0x11ae47f2, 0xb207bccb)}}, + {{TOBN(0xd983cf8d, 0x20f8a242), TOBN(0x7aff5b1d, 0xf22e1ad8), + TOBN(0x68fd11d0, 0x7fc4feb3), TOBN(0x5d53ae90, 0xb0f1c3e1)}, + {TOBN(0x50fb7905, 0xec041803), TOBN(0x85e3c977, 0x14404888), + TOBN(0x0e67faed, 0xac628d8f), TOBN(0x2e865150, 0x6668532c)}}, + {{TOBN(0x15acaaa4, 0x6a67a6b0), TOBN(0xf4cdee25, 0xb25cec41), + TOBN(0x49ee565a, 0xe4c6701e), TOBN(0x2a04ca66, 0xfc7d63d8)}, + {TOBN(0xeb105018, 0xef0543fb), TOBN(0xf709a4f5, 0xd1b0d81d), + TOBN(0x5b906ee6, 0x2915d333), TOBN(0xf4a87412, 0x96f1f0ab)}}, + {{TOBN(0xb6b82fa7, 0x4d82f4c2), TOBN(0x90725a60, 0x6804efb3), + TOBN(0xbc82ec46, 0xadc3425e), TOBN(0xb7b80581, 0x2787843e)}, + {TOBN(0xdf46d91c, 0xdd1fc74c), TOBN(0xdc1c62cb, 0xe783a6c4), + TOBN(0x59d1b9f3, 0x1a04cbba), TOBN(0xd87f6f72, 0x95e40764)}}, + {{TOBN(0x02b4cfc1, 0x317f4a76), TOBN(0x8d2703eb, 0x91036bce), + TOBN(0x98206cc6, 0xa5e72a56), TOBN(0x57be9ed1, 0xcf53fb0f)}, + {TOBN(0x09374571, 0xef0b17ac), TOBN(0x74b2655e, 0xd9181b38), + TOBN(0xc8f80ea8, 0x89935d0e), TOBN(0xc0d9e942, 0x91529936)}}, + {{TOBN(0x19686041, 0x1e84e0e5), TOBN(0xa5db84d3, 0xaea34c93), + TOBN(0xf9d5bb19, 0x7073a732), TOBN(0xb8d2fe56, 0x6bcfd7c0)}, + {TOBN(0x45775f36, 0xf3eb82fa), TOBN(0x8cb20ccc, 0xfdff8b58), + TOBN(0x1659b65f, 0x8374c110), TOBN(0xb8b4a422, 0x330c789a)}}, + {{TOBN(0x75e3c3ea, 0x6fe8208b), TOBN(0xbd74b9e4, 0x286e78fe), + TOBN(0x0be2e81b, 0xd7d93a1a), TOBN(0x7ed06e27, 0xdd0a5aae)}, + {TOBN(0x721f5a58, 0x6be8b800), TOBN(0x428299d1, 0xd846db28), + TOBN(0x95cb8e6b, 0x5be88ed3), TOBN(0xc3186b23, 0x1c034e11)}}, + {{TOBN(0xa6312c9e, 0x8977d99b), TOBN(0xbe944331, 0x83f531e7), + TOBN(0x8232c0c2, 0x18d3b1d4), TOBN(0x617aae8b, 0xe1247b73)}, + {TOBN(0x40153fc4, 0x282aec3b), TOBN(0xc6063d2f, 0xf7b8f823), + TOBN(0x68f10e58, 0x3304f94c), TOBN(0x31efae74, 0xee676346)}}, + {{TOBN(0xbadb6c6d, 0x40a9b97c), TOBN(0x14702c63, 0x4f666256), + TOBN(0xdeb954f1, 0x5184b2e3), TOBN(0x5184a526, 0x94b6ca40)}, + {TOBN(0xfff05337, 0x003c32ea), TOBN(0x5aa374dd, 0x205974c7), + TOBN(0x9a763854, 0x4b0dd71a), TOBN(0x459cd27f, 0xdeb947ec)}}, + {{TOBN(0xa6e28161, 0x459c2b92), TOBN(0x2f020fa8, 0x75ee8ef5), + TOBN(0xb132ec2d, 0x30b06310), TOBN(0xc3e15899, 0xbc6a4530)}, + {TOBN(0xdc5f53fe, 0xaa3f451a), TOBN(0x3a3c7f23, 0xc2d9acac), + TOBN(0x2ec2f892, 0x6b27e58b), TOBN(0x68466ee7, 0xd742799f)}}, + {{TOBN(0x98324dd4, 0x1fa26613), TOBN(0xa2dc6dab, 0xbdc29d63), + TOBN(0xf9675faa, 0xd712d657), TOBN(0x813994be, 0x21fd8d15)}, + {TOBN(0x5ccbb722, 0xfd4f7553), TOBN(0x5135ff8b, 0xf3a36b20), + TOBN(0x44be28af, 0x69559df5), TOBN(0x40b65bed, 0x9d41bf30)}}, + {{TOBN(0xd98bf2a4, 0x3734e520), TOBN(0x5e3abbe3, 0x209bdcba), + TOBN(0x77c76553, 0xbc945b35), TOBN(0x5331c093, 0xc6ef14aa)}, + {TOBN(0x518ffe29, 0x76b60c80), TOBN(0x2285593b, 0x7ace16f8), + TOBN(0xab1f64cc, 0xbe2b9784), TOBN(0xe8f2c0d9, 0xab2421b6)}}, + {{TOBN(0x617d7174, 0xc1df065c), TOBN(0xafeeb5ab, 0x5f6578fa), + TOBN(0x16ff1329, 0x263b54a8), TOBN(0x45c55808, 0xc990dce3)}, + {TOBN(0x42eab6c0, 0xecc8c177), TOBN(0x799ea9b5, 0x5982ecaa), + TOBN(0xf65da244, 0xb607ef8e), TOBN(0x8ab226ce, 0x32a3fc2c)}}, + {{TOBN(0x745741e5, 0x7ea973dc), TOBN(0x5c00ca70, 0x20888f2e), + TOBN(0x7cdce3cf, 0x45fd9cf1), TOBN(0x8a741ef1, 0x5507f872)}, + {TOBN(0x47c51c2f, 0x196b4cec), TOBN(0x70d08e43, 0xc97ea618), + TOBN(0x930da15c, 0x15b18a2b), TOBN(0x33b6c678, 0x2f610514)}}, + {{TOBN(0xc662e4f8, 0x07ac9794), TOBN(0x1eccf050, 0xba06cb79), + TOBN(0x1ff08623, 0xe7d954e5), TOBN(0x6ef2c5fb, 0x24cf71c3)}, + {TOBN(0xb2c063d2, 0x67978453), TOBN(0xa0cf3796, 0x1d654af8), + TOBN(0x7cb242ea, 0x7ebdaa37), TOBN(0x206e0b10, 0xb86747e0)}}, + {{TOBN(0x481dae5f, 0xd5ecfefc), TOBN(0x07084fd8, 0xc2bff8fc), + TOBN(0x8040a01a, 0xea324596), TOBN(0x4c646980, 0xd4de4036)}, + {TOBN(0x9eb8ab4e, 0xd65abfc3), TOBN(0xe01cb91f, 0x13541ec7), + TOBN(0x8f029adb, 0xfd695012), TOBN(0x9ae28483, 0x3c7569ec)}}, + {{TOBN(0xa5614c9e, 0xa66d80a1), TOBN(0x680a3e44, 0x75f5f911), + TOBN(0x0c07b14d, 0xceba4fc1), TOBN(0x891c285b, 0xa13071c1)}, + {TOBN(0xcac67ceb, 0x799ece3c), TOBN(0x29b910a9, 0x41e07e27), + TOBN(0x66bdb409, 0xf2e43123), TOBN(0x06f8b137, 0x7ac9ecbe)}}, + {{TOBN(0x5981fafd, 0x38547090), TOBN(0x19ab8b9f, 0x85e3415d), + TOBN(0xfc28c194, 0xc7e31b27), TOBN(0x843be0aa, 0x6fbcbb42)}, + {TOBN(0xf3b1ed43, 0xa6db836c), TOBN(0x2a1330e4, 0x01a45c05), + TOBN(0x4f19f3c5, 0x95c1a377), TOBN(0xa85f39d0, 0x44b5ee33)}}, + {{TOBN(0x3da18e6d, 0x4ae52834), TOBN(0x5a403b39, 0x7423dcb0), + TOBN(0xbb555e0a, 0xf2374aef), TOBN(0x2ad599c4, 0x1e8ca111)}, + {TOBN(0x1b3a2fb9, 0x014b3bf8), TOBN(0x73092684, 0xf66d5007), + TOBN(0x079f1426, 0xc4340102), TOBN(0x1827cf81, 0x8fddf4de)}}, + {{TOBN(0xc83605f6, 0xf10ff927), TOBN(0xd3871451, 0x23739fc6), + TOBN(0x6d163450, 0xcac1c2cc), TOBN(0x6b521296, 0xa2ec1ac5)}, + {TOBN(0x0606c4f9, 0x6e3cb4a5), TOBN(0xe47d3f41, 0x778abff7), + TOBN(0x425a8d5e, 0xbe8e3a45), TOBN(0x53ea9e97, 0xa6102160)}}, + {{TOBN(0x477a106e, 0x39cbb688), TOBN(0x532401d2, 0xf3386d32), + TOBN(0x8e564f64, 0xb1b9b421), TOBN(0xca9b8388, 0x81dad33f)}, + {TOBN(0xb1422b4e, 0x2093913e), TOBN(0x533d2f92, 0x69bc8112), + TOBN(0x3fa017be, 0xebe7b2c7), TOBN(0xb2767c4a, 0xcaf197c6)}}, + {{TOBN(0xc925ff87, 0xaedbae9f), TOBN(0x7daf0eb9, 0x36880a54), + TOBN(0x9284ddf5, 0x9c4d0e71), TOBN(0x1581cf93, 0x316f8cf5)}, + {TOBN(0x3eeca887, 0x3ac1f452), TOBN(0xb417fce9, 0xfb6aeffe), + TOBN(0xa5918046, 0xeefb8dc3), TOBN(0x73d318ac, 0x02209400)}}, + {{TOBN(0xe800400f, 0x728693e5), TOBN(0xe87d814b, 0x339927ed), + TOBN(0x93e94d3b, 0x57ea9910), TOBN(0xff8a35b6, 0x2245fb69)}, + {TOBN(0x043853d7, 0x7f200d34), TOBN(0x470f1e68, 0x0f653ce1), + TOBN(0x81ac05bd, 0x59a06379), TOBN(0xa14052c2, 0x03930c29)}}, + {{TOBN(0x6b72fab5, 0x26bc2797), TOBN(0x13670d16, 0x99f16771), + TOBN(0x00170052, 0x1e3e48d1), TOBN(0x978fe401, 0xb7adf678)}, + {TOBN(0x55ecfb92, 0xd41c5dd4), TOBN(0x5ff8e247, 0xc7b27da5), + TOBN(0xe7518272, 0x013fb606), TOBN(0x5768d7e5, 0x2f547a3c)}}, + {{TOBN(0xbb24eaa3, 0x60017a5f), TOBN(0x6b18e6e4, 0x9c64ce9b), + TOBN(0xc225c655, 0x103dde07), TOBN(0xfc3672ae, 0x7592f7ea)}, + {TOBN(0x9606ad77, 0xd06283a1), TOBN(0x542fc650, 0xe4d59d99), + TOBN(0xabb57c49, 0x2a40e7c2), TOBN(0xac948f13, 0xa8db9f55)}}, + {{TOBN(0x6d4c9682, 0xb04465c3), TOBN(0xe3d062fa, 0x6468bd15), + TOBN(0xa51729ac, 0x5f318d7e), TOBN(0x1fc87df6, 0x9eb6fc95)}, + {TOBN(0x63d146a8, 0x0591f652), TOBN(0xa861b8f7, 0x589621aa), + TOBN(0x59f5f15a, 0xce31348c), TOBN(0x8f663391, 0x440da6da)}}, + {{TOBN(0xcfa778ac, 0xb591ffa3), TOBN(0x027ca9c5, 0x4cdfebce), + TOBN(0xbe8e05a5, 0x444ea6b3), TOBN(0x8aab4e69, 0xa78d8254)}, + {TOBN(0x2437f04f, 0xb474d6b8), TOBN(0x6597ffd4, 0x045b3855), + TOBN(0xbb0aea4e, 0xca47ecaa), TOBN(0x568aae83, 0x85c7ebfc)}}, + {{TOBN(0x0e966e64, 0xc73b2383), TOBN(0x49eb3447, 0xd17d8762), + TOBN(0xde107821, 0x8da05dab), TOBN(0x443d8baa, 0x016b7236)}, + {TOBN(0x163b63a5, 0xea7610d6), TOBN(0xe47e4185, 0xce1ca979), + TOBN(0xae648b65, 0x80baa132), TOBN(0xebf53de2, 0x0e0d5b64)}}, + {{TOBN(0x8d3bfcb4, 0xd3c8c1ca), TOBN(0x0d914ef3, 0x5d04b309), + TOBN(0x55ef6415, 0x3de7d395), TOBN(0xbde1666f, 0x26b850e8)}, + {TOBN(0xdbe1ca6e, 0xd449ab19), TOBN(0x8902b322, 0xe89a2672), + TOBN(0xb1674b7e, 0xdacb7a53), TOBN(0x8e9faf6e, 0xf52523ff)}}, + {{TOBN(0x6ba535da, 0x9a85788b), TOBN(0xd21f03ae, 0xbd0626d4), + TOBN(0x099f8c47, 0xe873dc64), TOBN(0xcda8564d, 0x018ec97e)}, + {TOBN(0x3e8d7a5c, 0xde92c68c), TOBN(0x78e035a1, 0x73323cc4), + TOBN(0x3ef26275, 0xf880ff7c), TOBN(0xa4ee3dff, 0x273eedaa)}}, + {{TOBN(0x58823507, 0xaf4e18f8), TOBN(0x967ec9b5, 0x0672f328), + TOBN(0x9ded19d9, 0x559d3186), TOBN(0x5e2ab3de, 0x6cdce39c)}, + {TOBN(0xabad6e4d, 0x11c226df), TOBN(0xf9783f43, 0x87723014), + TOBN(0x9a49a0cf, 0x1a885719), TOBN(0xfc0c1a5a, 0x90da9dbf)}}, + {{TOBN(0x8bbaec49, 0x571d92ac), TOBN(0x569e85fe, 0x4692517f), + TOBN(0x8333b014, 0xa14ea4af), TOBN(0x32f2a62f, 0x12e5c5ad)}, + {TOBN(0x98c2ce3a, 0x06d89b85), TOBN(0xb90741aa, 0x2ff77a08), + TOBN(0x2530defc, 0x01f795a2), TOBN(0xd6e5ba0b, 0x84b3c199)}}, + {{TOBN(0x7d8e8451, 0x12e4c936), TOBN(0xae419f7d, 0xbd0be17b), + TOBN(0xa583fc8c, 0x22262bc9), TOBN(0x6b842ac7, 0x91bfe2bd)}, + {TOBN(0x33cef4e9, 0x440d6827), TOBN(0x5f69f4de, 0xef81fb14), + TOBN(0xf16cf6f6, 0x234fbb92), TOBN(0x76ae3fc3, 0xd9e7e158)}}, + {{TOBN(0x4e89f6c2, 0xe9740b33), TOBN(0x677bc85d, 0x4962d6a1), + TOBN(0x6c6d8a7f, 0x68d10d15), TOBN(0x5f9a7224, 0x0257b1cd)}, + {TOBN(0x7096b916, 0x4ad85961), TOBN(0x5f8c47f7, 0xe657ab4a), + TOBN(0xde57d7d0, 0xf7461d7e), TOBN(0x7eb6094d, 0x80ce5ee2)}}, + {{TOBN(0x0b1e1dfd, 0x34190547), TOBN(0x8a394f43, 0xf05dd150), + TOBN(0x0a9eb24d, 0x97df44e6), TOBN(0x78ca06bf, 0x87675719)}, + {TOBN(0x6f0b3462, 0x6ffeec22), TOBN(0x9d91bcea, 0x36cdd8fb), + TOBN(0xac83363c, 0xa105be47), TOBN(0x81ba76c1, 0x069710e3)}}, + {{TOBN(0x3d1b24cb, 0x28c682c6), TOBN(0x27f25228, 0x8612575b), + TOBN(0xb587c779, 0xe8e66e98), TOBN(0x7b0c03e9, 0x405eb1fe)}, + {TOBN(0xfdf0d030, 0x15b548e7), TOBN(0xa8be76e0, 0x38b36af7), + TOBN(0x4cdab04a, 0x4f310c40), TOBN(0x6287223e, 0xf47ecaec)}}, + {{TOBN(0x678e6055, 0x8b399320), TOBN(0x61fe3fa6, 0xc01e4646), + TOBN(0xc482866b, 0x03261a5e), TOBN(0xdfcf45b8, 0x5c2f244a)}, + {TOBN(0x8fab9a51, 0x2f684b43), TOBN(0xf796c654, 0xc7220a66), + TOBN(0x1d90707e, 0xf5afa58f), TOBN(0x2c421d97, 0x4fdbe0de)}}, + {{TOBN(0xc4f4cda3, 0xaf2ebc2f), TOBN(0xa0af843d, 0xcb4efe24), + TOBN(0x53b857c1, 0x9ccd10b1), TOBN(0xddc9d1eb, 0x914d3e04)}, + {TOBN(0x7bdec8bb, 0x62771deb), TOBN(0x829277aa, 0x91c5aa81), + TOBN(0x7af18dd6, 0x832391ae), TOBN(0x1740f316, 0xc71a84ca)}}}, + {{{TOBN(0x8928e99a, 0xeeaf8c49), TOBN(0xee7aa73d, 0x6e24d728), + TOBN(0x4c5007c2, 0xe72b156c), TOBN(0x5fcf57c5, 0xed408a1d)}, + {TOBN(0x9f719e39, 0xb6057604), TOBN(0x7d343c01, 0xc2868bbf), + TOBN(0x2cca254b, 0x7e103e2d), TOBN(0xe6eb38a9, 0xf131bea2)}}, + {{TOBN(0xb33e624f, 0x8be762b4), TOBN(0x2a9ee4d1, 0x058e3413), + TOBN(0x968e6369, 0x67d805fa), TOBN(0x9848949b, 0x7db8bfd7)}, + {TOBN(0x5308d7e5, 0xd23a8417), TOBN(0x892f3b1d, 0xf3e29da5), + TOBN(0xc95c139e, 0x3dee471f), TOBN(0x8631594d, 0xd757e089)}}, + {{TOBN(0xe0c82a3c, 0xde918dcc), TOBN(0x2e7b5994, 0x26fdcf4b), + TOBN(0x82c50249, 0x32cb1b2d), TOBN(0xea613a9d, 0x7657ae07)}, + {TOBN(0xc2eb5f6c, 0xf1fdc9f7), TOBN(0xb6eae8b8, 0x879fe682), + TOBN(0x253dfee0, 0x591cbc7f), TOBN(0x000da713, 0x3e1290e6)}}, + {{TOBN(0x1083e2ea, 0x1f095615), TOBN(0x0a28ad77, 0x14e68c33), + TOBN(0x6bfc0252, 0x3d8818be), TOBN(0xb585113a, 0xf35850cd)}, + {TOBN(0x7d935f0b, 0x30df8aa1), TOBN(0xaddda07c, 0x4ab7e3ac), + TOBN(0x92c34299, 0x552f00cb), TOBN(0xc33ed1de, 0x2909df6c)}}, + {{TOBN(0x22c2195d, 0x80e87766), TOBN(0x9e99e6d8, 0x9ddf4ac0), + TOBN(0x09642e4e, 0x65e74934), TOBN(0x2610ffa2, 0xff1ff241)}, + {TOBN(0x4d1d47d4, 0x751c8159), TOBN(0x697b4985, 0xaf3a9363), + TOBN(0x0318ca46, 0x87477c33), TOBN(0xa90cb565, 0x9441eff3)}}, + {{TOBN(0x58bb3848, 0x36f024cb), TOBN(0x85be1f77, 0x36016168), + TOBN(0x6c59587c, 0xdc7e07f1), TOBN(0x191be071, 0xaf1d8f02)}, + {TOBN(0xbf169fa5, 0xcca5e55c), TOBN(0x3864ba3c, 0xf7d04eac), + TOBN(0x915e367f, 0x8d7d05db), TOBN(0xb48a876d, 0xa6549e5d)}}, + {{TOBN(0xef89c656, 0x580e40a2), TOBN(0xf194ed8c, 0x728068bc), + TOBN(0x74528045, 0xa47990c9), TOBN(0xf53fc7d7, 0x5e1a4649)}, + {TOBN(0xbec5ae9b, 0x78593e7d), TOBN(0x2cac4ee3, 0x41db65d7), + TOBN(0xa8c1eb24, 0x04a3d39b), TOBN(0x53b7d634, 0x03f8f3ef)}}, + {{TOBN(0x2dc40d48, 0x3e07113c), TOBN(0x6e4a5d39, 0x7d8b63ae), + TOBN(0x5582a94b, 0x79684c2b), TOBN(0x932b33d4, 0x622da26c)}, + {TOBN(0xf534f651, 0x0dbbf08d), TOBN(0x211d07c9, 0x64c23a52), + TOBN(0x0eeece0f, 0xee5bdc9b), TOBN(0xdf178168, 0xf7015558)}}, + {{TOBN(0xd4294635, 0x0a712229), TOBN(0x93cbe448, 0x09273f8c), + TOBN(0x00b095ef, 0x8f13bc83), TOBN(0xbb741972, 0x8798978c)}, + {TOBN(0x9d7309a2, 0x56dbe6e7), TOBN(0xe578ec56, 0x5a5d39ec), + TOBN(0x3961151b, 0x851f9a31), TOBN(0x2da7715d, 0xe5709eb4)}}, + {{TOBN(0x867f3017, 0x53dfabf0), TOBN(0x728d2078, 0xb8e39259), + TOBN(0x5c75a0cd, 0x815d9958), TOBN(0xf84867a6, 0x16603be1)}, + {TOBN(0xc865b13d, 0x70e35b1c), TOBN(0x02414468, 0x19b03e2c), + TOBN(0xe46041da, 0xac1f3121), TOBN(0x7c9017ad, 0x6f028a7c)}}, + {{TOBN(0xabc96de9, 0x0a482873), TOBN(0x4265d6b1, 0xb77e54d4), + TOBN(0x68c38e79, 0xa57d88e7), TOBN(0xd461d766, 0x9ce82de3)}, + {TOBN(0x817a9ec5, 0x64a7e489), TOBN(0xcc5675cd, 0xa0def5f2), + TOBN(0x9a00e785, 0x985d494e), TOBN(0xc626833f, 0x1b03514a)}}, + {{TOBN(0xabe7905a, 0x83cdd60e), TOBN(0x50602fb5, 0xa1170184), + TOBN(0x689886cd, 0xb023642a), TOBN(0xd568d090, 0xa6e1fb00)}, + {TOBN(0x5b1922c7, 0x0259217f), TOBN(0x93831cd9, 0xc43141e4), + TOBN(0xdfca3587, 0x0c95f86e), TOBN(0xdec2057a, 0x568ae828)}}, + {{TOBN(0xc44ea599, 0xf98a759a), TOBN(0x55a0a7a2, 0xf7c23c1d), + TOBN(0xd5ffb6e6, 0x94c4f687), TOBN(0x3563cce2, 0x12848478)}, + {TOBN(0x812b3517, 0xe7b1fbe1), TOBN(0x8a7dc979, 0x4f7338e0), + TOBN(0x211ecee9, 0x52d048db), TOBN(0x2eea4056, 0xc86ea3b8)}}, + {{TOBN(0xd8cb68a7, 0xba772b34), TOBN(0xe16ed341, 0x5f4e2541), + TOBN(0x9b32f6a6, 0x0fec14db), TOBN(0xeee376f7, 0x391698be)}, + {TOBN(0xe9a7aa17, 0x83674c02), TOBN(0x65832f97, 0x5843022a), + TOBN(0x29f3a8da, 0x5ba4990f), TOBN(0x79a59c3a, 0xfb8e3216)}}, + {{TOBN(0x9cdc4d2e, 0xbd19bb16), TOBN(0xc6c7cfd0, 0xb3262d86), + TOBN(0xd4ce14d0, 0x969c0b47), TOBN(0x1fa352b7, 0x13e56128)}, + {TOBN(0x383d55b8, 0x973db6d3), TOBN(0x71836850, 0xe8e5b7bf), + TOBN(0xc7714596, 0xe6bb571f), TOBN(0x259df31f, 0x2d5b2dd2)}}, + {{TOBN(0x568f8925, 0x913cc16d), TOBN(0x18bc5b6d, 0xe1a26f5a), + TOBN(0xdfa413be, 0xf5f499ae), TOBN(0xf8835dec, 0xc3f0ae84)}, + {TOBN(0xb6e60bd8, 0x65a40ab0), TOBN(0x65596439, 0x194b377e), + TOBN(0xbcd85625, 0x92084a69), TOBN(0x5ce433b9, 0x4f23ede0)}}, + {{TOBN(0xe8e8f04f, 0x6ad65143), TOBN(0x11511827, 0xd6e14af6), + TOBN(0x3d390a10, 0x8295c0c7), TOBN(0x71e29ee4, 0x621eba16)}, + {TOBN(0xa588fc09, 0x63717b46), TOBN(0x02be02fe, 0xe06ad4a2), + TOBN(0x931558c6, 0x04c22b22), TOBN(0xbb4d4bd6, 0x12f3c849)}}, + {{TOBN(0x54a4f496, 0x20efd662), TOBN(0x92ba6d20, 0xc5952d14), + TOBN(0x2db8ea1e, 0xcc9784c2), TOBN(0x81cc10ca, 0x4b353644)}, + {TOBN(0x40b570ad, 0x4b4d7f6c), TOBN(0x5c9f1d96, 0x84a1dcd2), + TOBN(0x01379f81, 0x3147e797), TOBN(0xe5c6097b, 0x2bd499f5)}}, + {{TOBN(0x40dcafa6, 0x328e5e20), TOBN(0xf7b5244a, 0x54815550), + TOBN(0xb9a4f118, 0x47bfc978), TOBN(0x0ea0e79f, 0xd25825b1)}, + {TOBN(0xa50f96eb, 0x646c7ecf), TOBN(0xeb811493, 0x446dea9d), + TOBN(0x2af04677, 0xdfabcf69), TOBN(0xbe3a068f, 0xc713f6e8)}}, + {{TOBN(0x860d523d, 0x42e06189), TOBN(0xbf077941, 0x4e3aff13), + TOBN(0x0b616dca, 0xc1b20650), TOBN(0xe66dd6d1, 0x2131300d)}, + {TOBN(0xd4a0fd67, 0xff99abde), TOBN(0xc9903550, 0xc7aac50d), + TOBN(0x022ecf8b, 0x7c46b2d7), TOBN(0x3333b1e8, 0x3abf92af)}}, + {{TOBN(0x11cc113c, 0x6c491c14), TOBN(0x05976688, 0x80dd3f88), + TOBN(0xf5b4d9e7, 0x29d932ed), TOBN(0xe982aad8, 0xa2c38b6d)}, + {TOBN(0x6f925347, 0x8be0dcf0), TOBN(0x700080ae, 0x65ca53f2), + TOBN(0xd8131156, 0x443ca77f), TOBN(0xe92d6942, 0xec51f984)}}, + {{TOBN(0xd2a08af8, 0x85dfe9ae), TOBN(0xd825d9a5, 0x4d2a86ca), + TOBN(0x2c53988d, 0x39dff020), TOBN(0xf38b135a, 0x430cdc40)}, + {TOBN(0x0c918ae0, 0x62a7150b), TOBN(0xf31fd8de, 0x0c340e9b), + TOBN(0xafa0e7ae, 0x4dbbf02e), TOBN(0x5847fb2a, 0x5eba6239)}}, + {{TOBN(0x6b1647dc, 0xdccbac8b), TOBN(0xb642aa78, 0x06f485c8), + TOBN(0x873f3765, 0x7038ecdf), TOBN(0x2ce5e865, 0xfa49d3fe)}, + {TOBN(0xea223788, 0xc98c4400), TOBN(0x8104a8cd, 0xf1fa5279), + TOBN(0xbcf7cc7a, 0x06becfd7), TOBN(0x49424316, 0xc8f974ae)}}, + {{TOBN(0xc0da65e7, 0x84d6365d), TOBN(0xbcb7443f, 0x8f759fb8), + TOBN(0x35c712b1, 0x7ae81930), TOBN(0x80428dff, 0x4c6e08ab)}, + {TOBN(0xf19dafef, 0xa4faf843), TOBN(0xced8538d, 0xffa9855f), + TOBN(0x20ac409c, 0xbe3ac7ce), TOBN(0x358c1fb6, 0x882da71e)}}, + {{TOBN(0xafa9c0e5, 0xfd349961), TOBN(0x2b2cfa51, 0x8421c2fc), + TOBN(0x2a80db17, 0xf3a28d38), TOBN(0xa8aba539, 0x5d138e7e)}, + {TOBN(0x52012d1d, 0x6e96eb8d), TOBN(0x65d8dea0, 0xcbaf9622), + TOBN(0x57735447, 0xb264f56c), TOBN(0xbeebef3f, 0x1b6c8da2)}}, + {{TOBN(0xfc346d98, 0xce785254), TOBN(0xd50e8d72, 0xbb64a161), + TOBN(0xc03567c7, 0x49794add), TOBN(0x15a76065, 0x752c7ef6)}, + {TOBN(0x59f3a222, 0x961f23d6), TOBN(0x378e4438, 0x73ecc0b0), + TOBN(0xc74be434, 0x5a82fde4), TOBN(0xae509af2, 0xd8b9cf34)}}, + {{TOBN(0x4a61ee46, 0x577f44a1), TOBN(0xe09b748c, 0xb611deeb), + TOBN(0xc0481b2c, 0xf5f7b884), TOBN(0x35626678, 0x61acfa6b)}, + {TOBN(0x37f4c518, 0xbf8d21e6), TOBN(0x22d96531, 0xb205a76d), + TOBN(0x37fb85e1, 0x954073c0), TOBN(0xbceafe4f, 0x65b3a567)}}, + {{TOBN(0xefecdef7, 0xbe42a582), TOBN(0xd3fc6080, 0x65046be6), + TOBN(0xc9af13c8, 0x09e8dba9), TOBN(0x1e6c9847, 0x641491ff)}, + {TOBN(0x3b574925, 0xd30c31f7), TOBN(0xb7eb72ba, 0xac2a2122), + TOBN(0x776a0dac, 0xef0859e7), TOBN(0x06fec314, 0x21900942)}}, + {{TOBN(0x2464bc10, 0xf8c22049), TOBN(0x9bfbcce7, 0x875ebf69), + TOBN(0xd7a88e2a, 0x4336326b), TOBN(0xda05261c, 0x5bc2acfa)}, + {TOBN(0xc29f5bdc, 0xeba7efc8), TOBN(0x471237ca, 0x25dbbf2e), + TOBN(0xa72773f2, 0x2975f127), TOBN(0xdc744e8e, 0x04d0b326)}}, + {{TOBN(0x38a7ed16, 0xa56edb73), TOBN(0x64357e37, 0x2c007e70), + TOBN(0xa167d15b, 0x5080b400), TOBN(0x07b41164, 0x23de4be1)}, + {TOBN(0xb2d91e32, 0x74c89883), TOBN(0x3c162821, 0x2882e7ed), + TOBN(0xad6b36ba, 0x7503e482), TOBN(0x48434e8e, 0x0ea34331)}}, + {{TOBN(0x79f4f24f, 0x2c7ae0b9), TOBN(0xc46fbf81, 0x1939b44a), + TOBN(0x76fefae8, 0x56595eb1), TOBN(0x417b66ab, 0xcd5f29c7)}, + {TOBN(0x5f2332b2, 0xc5ceec20), TOBN(0xd69661ff, 0xe1a1cae2), + TOBN(0x5ede7e52, 0x9b0286e6), TOBN(0x9d062529, 0xe276b993)}}, + {{TOBN(0x324794b0, 0x7e50122b), TOBN(0xdd744f8b, 0x4af07ca5), + TOBN(0x30a12f08, 0xd63fc97b), TOBN(0x39650f1a, 0x76626d9d)}, + {TOBN(0x101b47f7, 0x1fa38477), TOBN(0x3d815f19, 0xd4dc124f), + TOBN(0x1569ae95, 0xb26eb58a), TOBN(0xc3cde188, 0x95fb1887)}}, + {{TOBN(0x54e9f37b, 0xf9539a48), TOBN(0xb0100e06, 0x7408c1a5), + TOBN(0x821d9811, 0xea580cbb), TOBN(0x8af52d35, 0x86e50c56)}, + {TOBN(0xdfbd9d47, 0xdbbf698b), TOBN(0x2961a1ea, 0x03dc1c73), + TOBN(0x203d38f8, 0xe76a5df8), TOBN(0x08a53a68, 0x6def707a)}}, + {{TOBN(0x26eefb48, 0x1bee45d4), TOBN(0xb3cee346, 0x3c688036), + TOBN(0x463c5315, 0xc42f2469), TOBN(0x19d84d2e, 0x81378162)}, + {TOBN(0x22d7c3c5, 0x1c4d349f), TOBN(0x65965844, 0x163d59c5), + TOBN(0xcf198c56, 0xb8abceae), TOBN(0x6fb1fb1b, 0x628559d5)}}, + {{TOBN(0x8bbffd06, 0x07bf8fe3), TOBN(0x46259c58, 0x3467734b), + TOBN(0xd8953cea, 0x35f7f0d3), TOBN(0x1f0bece2, 0xd65b0ff1)}, + {TOBN(0xf7d5b4b3, 0xf3c72914), TOBN(0x29e8ea95, 0x3cb53389), + TOBN(0x4a365626, 0x836b6d46), TOBN(0xe849f910, 0xea174fde)}}, + {{TOBN(0x7ec62fbb, 0xf4737f21), TOBN(0xd8dba5ab, 0x6209f5ac), + TOBN(0x24b5d7a9, 0xa5f9adbe), TOBN(0x707d28f7, 0xa61dc768)}, + {TOBN(0x7711460b, 0xcaa999ea), TOBN(0xba7b174d, 0x1c92e4cc), + TOBN(0x3c4bab66, 0x18d4bf2d), TOBN(0xb8f0c980, 0xeb8bd279)}}, + {{TOBN(0x024bea9a, 0x324b4737), TOBN(0xfba9e423, 0x32a83bca), + TOBN(0x6e635643, 0xa232dced), TOBN(0x99619367, 0x2571c8ba)}, + {TOBN(0xe8c9f357, 0x54b7032b), TOBN(0xf936b3ba, 0x2442d54a), + TOBN(0x2263f0f0, 0x8290c65a), TOBN(0x48989780, 0xee2c7fdb)}}, + {{TOBN(0xadc5d55a, 0x13d4f95e), TOBN(0x737cff85, 0xad9b8500), + TOBN(0x271c557b, 0x8a73f43d), TOBN(0xbed617a4, 0xe18bc476)}, + {TOBN(0x66245401, 0x7dfd8ab2), TOBN(0xae7b89ae, 0x3a2870aa), + TOBN(0x1b555f53, 0x23a7e545), TOBN(0x6791e247, 0xbe057e4c)}}, + {{TOBN(0x860136ad, 0x324fa34d), TOBN(0xea111447, 0x4cbeae28), + TOBN(0x023a4270, 0xbedd3299), TOBN(0x3d5c3a7f, 0xc1c35c34)}, + {TOBN(0xb0f6db67, 0x8d0412d2), TOBN(0xd92625e2, 0xfcdc6b9a), + TOBN(0x92ae5ccc, 0x4e28a982), TOBN(0xea251c36, 0x47a3ce7e)}}, + {{TOBN(0x9d658932, 0x790691bf), TOBN(0xed610589, 0x06b736ae), + TOBN(0x712c2f04, 0xc0d63b6e), TOBN(0x5cf06fd5, 0xc63d488f)}, + {TOBN(0x97363fac, 0xd9588e41), TOBN(0x1f9bf762, 0x2b93257e), + TOBN(0xa9d1ffc4, 0x667acace), TOBN(0x1cf4a1aa, 0x0a061ecf)}}, + {{TOBN(0x40e48a49, 0xdc1818d0), TOBN(0x0643ff39, 0xa3621ab0), + TOBN(0x5768640c, 0xe39ef639), TOBN(0x1fc099ea, 0x04d86854)}, + {TOBN(0x9130b9c3, 0xeccd28fd), TOBN(0xd743cbd2, 0x7eec54ab), + TOBN(0x052b146f, 0xe5b475b6), TOBN(0x058d9a82, 0x900a7d1f)}}, + {{TOBN(0x65e02292, 0x91262b72), TOBN(0x96f924f9, 0xbb0edf03), + TOBN(0x5cfa59c8, 0xfe206842), TOBN(0xf6037004, 0x5eafa720)}, + {TOBN(0x5f30699e, 0x18d7dd96), TOBN(0x381e8782, 0xcbab2495), + TOBN(0x91669b46, 0xdd8be949), TOBN(0xb40606f5, 0x26aae8ef)}}, + {{TOBN(0x2812b839, 0xfc6751a4), TOBN(0x16196214, 0xfba800ef), + TOBN(0x4398d5ca, 0x4c1a2875), TOBN(0x720c00ee, 0x653d8349)}, + {TOBN(0xc2699eb0, 0xd820007c), TOBN(0x880ee660, 0xa39b5825), + TOBN(0x70694694, 0x471f6984), TOBN(0xf7d16ea8, 0xe3dda99a)}}, + {{TOBN(0x28d675b2, 0xc0519a23), TOBN(0x9ebf94fe, 0x4f6952e3), + TOBN(0xf28bb767, 0xa2294a8a), TOBN(0x85512b4d, 0xfe0af3f5)}, + {TOBN(0x18958ba8, 0x99b16a0d), TOBN(0x95c2430c, 0xba7548a7), + TOBN(0xb30d1b10, 0xa16be615), TOBN(0xe3ebbb97, 0x85bfb74c)}}, + {{TOBN(0xa3273cfe, 0x18549fdb), TOBN(0xf6e200bf, 0x4fcdb792), + TOBN(0x54a76e18, 0x83aba56c), TOBN(0x73ec66f6, 0x89ef6aa2)}, + {TOBN(0x8d17add7, 0xd1b9a305), TOBN(0xa959c5b9, 0xb7ae1b9d), + TOBN(0x88643522, 0x6bcc094a), TOBN(0xcc5616c4, 0xd7d429b9)}}, + {{TOBN(0xa6dada01, 0xe6a33f7c), TOBN(0xc6217a07, 0x9d4e70ad), + TOBN(0xd619a818, 0x09c15b7c), TOBN(0xea06b329, 0x0e80c854)}, + {TOBN(0x174811ce, 0xa5f5e7b9), TOBN(0x66dfc310, 0x787c65f4), + TOBN(0x4ea7bd69, 0x3316ab54), TOBN(0xc12c4acb, 0x1dcc0f70)}}, + {{TOBN(0xe4308d1a, 0x1e407dd9), TOBN(0xe8a3587c, 0x91afa997), + TOBN(0xea296c12, 0xab77b7a5), TOBN(0xb5ad49e4, 0x673c0d52)}, + {TOBN(0x40f9b2b2, 0x7006085a), TOBN(0xa88ff340, 0x87bf6ec2), + TOBN(0x978603b1, 0x4e3066a6), TOBN(0xb3f99fc2, 0xb5e486e2)}}, + {{TOBN(0x07b53f5e, 0xb2e63645), TOBN(0xbe57e547, 0x84c84232), + TOBN(0xd779c216, 0x7214d5cf), TOBN(0x617969cd, 0x029a3aca)}, + {TOBN(0xd17668cd, 0x8a7017a0), TOBN(0x77b4d19a, 0xbe9b7ee8), + TOBN(0x58fd0e93, 0x9c161776), TOBN(0xa8c4f4ef, 0xd5968a72)}}, + {{TOBN(0x296071cc, 0x67b3de77), TOBN(0xae3c0b8e, 0x634f7905), + TOBN(0x67e440c2, 0x8a7100c9), TOBN(0xbb8c3c1b, 0xeb4b9b42)}, + {TOBN(0x6d71e8ea, 0xc51b3583), TOBN(0x7591f5af, 0x9525e642), + TOBN(0xf73a2f7b, 0x13f509f3), TOBN(0x618487aa, 0x5619ac9b)}}, + {{TOBN(0x3a72e5f7, 0x9d61718a), TOBN(0x00413bcc, 0x7592d28c), + TOBN(0x7d9b11d3, 0x963c35cf), TOBN(0x77623bcf, 0xb90a46ed)}, + {TOBN(0xdeef273b, 0xdcdd2a50), TOBN(0x4a741f9b, 0x0601846e), + TOBN(0x33b89e51, 0x0ec6e929), TOBN(0xcb02319f, 0x8b7f22cd)}}, + {{TOBN(0xbbe1500d, 0x084bae24), TOBN(0x2f0ae8d7, 0x343d2693), + TOBN(0xacffb5f2, 0x7cdef811), TOBN(0xaa0c030a, 0x263fb94f)}, + {TOBN(0x6eef0d61, 0xa0f442de), TOBN(0xf92e1817, 0x27b139d3), + TOBN(0x1ae6deb7, 0x0ad8bc28), TOBN(0xa89e38dc, 0xc0514130)}}, + {{TOBN(0x81eeb865, 0xd2fdca23), TOBN(0x5a15ee08, 0xcc8ef895), + TOBN(0x768fa10a, 0x01905614), TOBN(0xeff5b8ef, 0x880ee19b)}, + {TOBN(0xf0c0cabb, 0xcb1c8a0e), TOBN(0x2e1ee9cd, 0xb8c838f9), + TOBN(0x0587d8b8, 0x8a4a14c0), TOBN(0xf6f27896, 0x2ff698e5)}}, + {{TOBN(0xed38ef1c, 0x89ee6256), TOBN(0xf44ee1fe, 0x6b353b45), + TOBN(0x9115c0c7, 0x70e903b3), TOBN(0xc78ec0a1, 0x818f31df)}, + {TOBN(0x6c003324, 0xb7dccbc6), TOBN(0xd96dd1f3, 0x163bbc25), + TOBN(0x33aa82dd, 0x5cedd805), TOBN(0x123aae4f, 0x7f7eb2f1)}}, + {{TOBN(0x1723fcf5, 0xa26262cd), TOBN(0x1f7f4d5d, 0x0060ebd5), + TOBN(0xf19c5c01, 0xb2eaa3af), TOBN(0x2ccb9b14, 0x9790accf)}, + {TOBN(0x1f9c1cad, 0x52324aa6), TOBN(0x63200526, 0x7247df54), + TOBN(0x5732fe42, 0xbac96f82), TOBN(0x52fe771f, 0x01a1c384)}}, + {{TOBN(0x546ca13d, 0xb1001684), TOBN(0xb56b4eee, 0xa1709f75), + TOBN(0x266545a9, 0xd5db8672), TOBN(0xed971c90, 0x1e8f3cfb)}, + {TOBN(0x4e7d8691, 0xe3a07b29), TOBN(0x7570d9ec, 0xe4b696b9), + TOBN(0xdc5fa067, 0x7bc7e9ae), TOBN(0x68b44caf, 0xc82c4844)}}, + {{TOBN(0x519d34b3, 0xbf44da80), TOBN(0x283834f9, 0x5ab32e66), + TOBN(0x6e608797, 0x6278a000), TOBN(0x1e62960e, 0x627312f6)}, + {TOBN(0x9b87b27b, 0xe6901c55), TOBN(0x80e78538, 0x24fdbc1f), + TOBN(0xbbbc0951, 0x2facc27d), TOBN(0x06394239, 0xac143b5a)}}, + {{TOBN(0x35bb4a40, 0x376c1944), TOBN(0x7cb62694, 0x63da1511), + TOBN(0xafd29161, 0xb7148a3b), TOBN(0xa6f9d9ed, 0x4e2ea2ee)}, + {TOBN(0x15dc2ca2, 0x880dd212), TOBN(0x903c3813, 0xa61139a9), + TOBN(0x2aa7b46d, 0x6c0f8785), TOBN(0x36ce2871, 0x901c60ff)}}, + {{TOBN(0xc683b028, 0xe10d9c12), TOBN(0x7573baa2, 0x032f33d3), + TOBN(0x87a9b1f6, 0x67a31b58), TOBN(0xfd3ed11a, 0xf4ffae12)}, + {TOBN(0x83dcaa9a, 0x0cb2748e), TOBN(0x8239f018, 0x5d6fdf16), + TOBN(0xba67b49c, 0x72753941), TOBN(0x2beec455, 0xc321cb36)}}, + {{TOBN(0x88015606, 0x3f8b84ce), TOBN(0x76417083, 0x8d38c86f), + TOBN(0x054f1ca7, 0x598953dd), TOBN(0xc939e110, 0x4e8e7429)}, + {TOBN(0x9b1ac2b3, 0x5a914f2f), TOBN(0x39e35ed3, 0xe74b8f9c), + TOBN(0xd0debdb2, 0x781b2fb0), TOBN(0x1585638f, 0x2d997ba2)}}, + {{TOBN(0x9c4b646e, 0x9e2fce99), TOBN(0x68a21081, 0x1e80857f), + TOBN(0x06d54e44, 0x3643b52a), TOBN(0xde8d6d63, 0x0d8eb843)}, + {TOBN(0x70321563, 0x42146a0a), TOBN(0x8ba826f2, 0x5eaa3622), + TOBN(0x227a58bd, 0x86138787), TOBN(0x43b6c03c, 0x10281d37)}}, + {{TOBN(0x6326afbb, 0xb54dde39), TOBN(0x744e5e8a, 0xdb6f2d5f), + TOBN(0x48b2a99a, 0xcff158e1), TOBN(0xa93c8fa0, 0xef87918f)}, + {TOBN(0x2182f956, 0xde058c5c), TOBN(0x216235d2, 0x936f9e7a), + TOBN(0xace0c0db, 0xd2e31e67), TOBN(0xc96449bf, 0xf23ac3e7)}}, + {{TOBN(0x7e9a2874, 0x170693bd), TOBN(0xa28e14fd, 0xa45e6335), + TOBN(0x5757f6b3, 0x56427344), TOBN(0x822e4556, 0xacf8edf9)}, + {TOBN(0x2b7a6ee2, 0xe6a285cd), TOBN(0x5866f211, 0xa9df3af0), + TOBN(0x40dde2dd, 0xf845b844), TOBN(0x986c3726, 0x110e5e49)}}, + {{TOBN(0x73680c2a, 0xf7172277), TOBN(0x57b94f0f, 0x0cccb244), + TOBN(0xbdff7267, 0x2d438ca7), TOBN(0xbad1ce11, 0xcf4663fd)}, + {TOBN(0x9813ed9d, 0xd8f71cae), TOBN(0xf43272a6, 0x961fdaa6), + TOBN(0xbeff0119, 0xbd6d1637), TOBN(0xfebc4f91, 0x30361978)}}, + {{TOBN(0x02b37a95, 0x2f41deff), TOBN(0x0e44a59a, 0xe63b89b7), + TOBN(0x673257dc, 0x143ff951), TOBN(0x19c02205, 0xd752baf4)}, + {TOBN(0x46c23069, 0xc4b7d692), TOBN(0x2e6392c3, 0xfd1502ac), + TOBN(0x6057b1a2, 0x1b220846), TOBN(0xe51ff946, 0x0c1b5b63)}}}, + {{{TOBN(0x6e85cb51, 0x566c5c43), TOBN(0xcff9c919, 0x3597f046), + TOBN(0x9354e90c, 0x4994d94a), TOBN(0xe0a39332, 0x2147927d)}, + {TOBN(0x8427fac1, 0x0dc1eb2b), TOBN(0x88cfd8c2, 0x2ff319fa), + TOBN(0xe2d4e684, 0x01965274), TOBN(0xfa2e067d, 0x67aaa746)}}, + {{TOBN(0xb6d92a7f, 0x3e5f9f11), TOBN(0x9afe153a, 0xd6cb3b8e), + TOBN(0x4d1a6dd7, 0xddf800bd), TOBN(0xf6c13cc0, 0xcaf17e19)}, + {TOBN(0x15f6c58e, 0x325fc3ee), TOBN(0x71095400, 0xa31dc3b2), + TOBN(0x168e7c07, 0xafa3d3e7), TOBN(0x3f8417a1, 0x94c7ae2d)}}, + {{TOBN(0xec234772, 0x813b230d), TOBN(0x634d0f5f, 0x17344427), + TOBN(0x11548ab1, 0xd77fc56a), TOBN(0x7fab1750, 0xce06af77)}, + {TOBN(0xb62c10a7, 0x4f7c4f83), TOBN(0xa7d2edc4, 0x220a67d9), + TOBN(0x1c404170, 0x921209a0), TOBN(0x0b9815a0, 0xface59f0)}}, + {{TOBN(0x2842589b, 0x319540c3), TOBN(0x18490f59, 0xa283d6f8), + TOBN(0xa2731f84, 0xdaae9fcb), TOBN(0x3db6d960, 0xc3683ba0)}, + {TOBN(0xc85c63bb, 0x14611069), TOBN(0xb19436af, 0x0788bf05), + TOBN(0x905459df, 0x347460d2), TOBN(0x73f6e094, 0xe11a7db1)}}, + {{TOBN(0xdc7f938e, 0xb6357f37), TOBN(0xc5d00f79, 0x2bd8aa62), + TOBN(0xc878dcb9, 0x2ca979fc), TOBN(0x37e83ed9, 0xeb023a99)}, + {TOBN(0x6b23e273, 0x1560bf3d), TOBN(0x1086e459, 0x1d0fae61), + TOBN(0x78248316, 0x9a9414bd), TOBN(0x1b956bc0, 0xf0ea9ea1)}}, + {{TOBN(0x7b85bb91, 0xc31b9c38), TOBN(0x0c5aa90b, 0x48ef57b5), + TOBN(0xdedeb169, 0xaf3bab6f), TOBN(0xe610ad73, 0x2d373685)}, + {TOBN(0xf13870df, 0x02ba8e15), TOBN(0x0337edb6, 0x8ca7f771), + TOBN(0xe4acf747, 0xb62c036c), TOBN(0xd921d576, 0xb6b94e81)}}, + {{TOBN(0xdbc86439, 0x2c422f7a), TOBN(0xfb635362, 0xed348898), + TOBN(0x83084668, 0xc45bfcd1), TOBN(0xc357c9e3, 0x2b315e11)}, + {TOBN(0xb173b540, 0x5b2e5b8c), TOBN(0x7e946931, 0xe102b9a4), + TOBN(0x17c890eb, 0x7b0fb199), TOBN(0xec225a83, 0xd61b662b)}}, + {{TOBN(0xf306a3c8, 0xee3c76cb), TOBN(0x3cf11623, 0xd32a1f6e), + TOBN(0xe6d5ab64, 0x6863e956), TOBN(0x3b8a4cbe, 0x5c005c26)}, + {TOBN(0xdcd529a5, 0x9ce6bb27), TOBN(0xc4afaa52, 0x04d4b16f), + TOBN(0xb0624a26, 0x7923798d), TOBN(0x85e56df6, 0x6b307fab)}}, + {{TOBN(0x0281893c, 0x2bf29698), TOBN(0x91fc19a4, 0xd7ce7603), + TOBN(0x75a5dca3, 0xad9a558f), TOBN(0x40ceb3fa, 0x4d50bf77)}, + {TOBN(0x1baf6060, 0xbc9ba369), TOBN(0x927e1037, 0x597888c2), + TOBN(0xd936bf19, 0x86a34c07), TOBN(0xd4cf10c1, 0xc34ae980)}}, + {{TOBN(0x3a3e5334, 0x859dd614), TOBN(0x9c475b5b, 0x18d0c8ee), + TOBN(0x63080d1f, 0x07cd51d5), TOBN(0xc9c0d0a6, 0xb88b4326)}, + {TOBN(0x1ac98691, 0xc234296f), TOBN(0x2a0a83a4, 0x94887fb6), + TOBN(0x56511427, 0x0cea9cf2), TOBN(0x5230a6e8, 0xa24802f5)}}, + {{TOBN(0xf7a2bf0f, 0x72e3d5c1), TOBN(0x37717446, 0x4f21439e), + TOBN(0xfedcbf25, 0x9ce30334), TOBN(0xe0030a78, 0x7ce202f9)}, + {TOBN(0x6f2d9ebf, 0x1202e9ca), TOBN(0xe79dde6c, 0x75e6e591), + TOBN(0xf52072af, 0xf1dac4f8), TOBN(0x6c8d087e, 0xbb9b404d)}}, + {{TOBN(0xad0fc73d, 0xbce913af), TOBN(0x909e587b, 0x458a07cb), + TOBN(0x1300da84, 0xd4f00c8a), TOBN(0x425cd048, 0xb54466ac)}, + {TOBN(0xb59cb9be, 0x90e9d8bf), TOBN(0x991616db, 0x3e431b0e), + TOBN(0xd3aa117a, 0x531aecff), TOBN(0x91af92d3, 0x59f4dc3b)}}, + {{TOBN(0x9b1ec292, 0xe93fda29), TOBN(0x76bb6c17, 0xe97d91bc), + TOBN(0x7509d95f, 0xaface1e6), TOBN(0x3653fe47, 0xbe855ae3)}, + {TOBN(0x73180b28, 0x0f680e75), TOBN(0x75eefd1b, 0xeeb6c26c), + TOBN(0xa4cdf29f, 0xb66d4236), TOBN(0x2d70a997, 0x6b5821d8)}}, + {{TOBN(0x7a3ee207, 0x20445c36), TOBN(0x71d1ac82, 0x59877174), + TOBN(0x0fc539f7, 0x949f73e9), TOBN(0xd05cf3d7, 0x982e3081)}, + {TOBN(0x8758e20b, 0x7b1c7129), TOBN(0xffadcc20, 0x569e61f2), + TOBN(0xb05d3a2f, 0x59544c2d), TOBN(0xbe16f5c1, 0x9fff5e53)}}, + {{TOBN(0x73cf65b8, 0xaad58135), TOBN(0x622c2119, 0x037aa5be), + TOBN(0x79373b3f, 0x646fd6a0), TOBN(0x0e029db5, 0x0d3978cf)}, + {TOBN(0x8bdfc437, 0x94fba037), TOBN(0xaefbd687, 0x620797a6), + TOBN(0x3fa5382b, 0xbd30d38e), TOBN(0x7627cfbf, 0x585d7464)}}, + {{TOBN(0xb2330fef, 0x4e4ca463), TOBN(0xbcef7287, 0x3566cc63), + TOBN(0xd161d2ca, 0xcf780900), TOBN(0x135dc539, 0x5b54827d)}, + {TOBN(0x638f052e, 0x27bf1bc6), TOBN(0x10a224f0, 0x07dfa06c), + TOBN(0xe973586d, 0x6d3321da), TOBN(0x8b0c5738, 0x26152c8f)}}, + {{TOBN(0x07ef4f2a, 0x34606074), TOBN(0x80fe7fe8, 0xa0f7047a), + TOBN(0x3d1a8152, 0xe1a0e306), TOBN(0x32cf43d8, 0x88da5222)}, + {TOBN(0xbf89a95f, 0x5f02ffe6), TOBN(0x3d9eb9a4, 0x806ad3ea), + TOBN(0x012c17bb, 0x79c8e55e), TOBN(0xfdcd1a74, 0x99c81dac)}}, + {{TOBN(0x7043178b, 0xb9556098), TOBN(0x4090a1df, 0x801c3886), + TOBN(0x759800ff, 0x9b67b912), TOBN(0x3e5c0304, 0x232620c8)}, + {TOBN(0x4b9d3c4b, 0x70dceeca), TOBN(0xbb2d3c15, 0x181f648e), + TOBN(0xf981d837, 0x6e33345c), TOBN(0xb626289b, 0x0cf2297a)}}, + {{TOBN(0x766ac659, 0x8baebdcf), TOBN(0x1a28ae09, 0x75df01e5), + TOBN(0xb71283da, 0x375876d8), TOBN(0x4865a96d, 0x607b9800)}, + {TOBN(0x25dd1bcd, 0x237936b2), TOBN(0x332f4f4b, 0x60417494), + TOBN(0xd0923d68, 0x370a2147), TOBN(0x497f5dfb, 0xdc842203)}}, + {{TOBN(0x9dc74cbd, 0x32be5e0f), TOBN(0x7475bcb7, 0x17a01375), + TOBN(0x438477c9, 0x50d872b1), TOBN(0xcec67879, 0xffe1d63d)}, + {TOBN(0x9b006014, 0xd8578c70), TOBN(0xc9ad99a8, 0x78bb6b8b), + TOBN(0x6799008e, 0x11fb3806), TOBN(0xcfe81435, 0xcd44cab3)}}, + {{TOBN(0xa2ee1582, 0x2f4fb344), TOBN(0xb8823450, 0x483fa6eb), + TOBN(0x622d323d, 0x652c7749), TOBN(0xd8474a98, 0xbeb0a15b)}, + {TOBN(0xe43c154d, 0x5d1c00d0), TOBN(0x7fd581d9, 0x0e3e7aac), + TOBN(0x2b44c619, 0x2525ddf8), TOBN(0x67a033eb, 0xb8ae9739)}}, + {{TOBN(0x113ffec1, 0x9ef2d2e4), TOBN(0x1bf6767e, 0xd5a0ea7f), + TOBN(0x57fff75e, 0x03714c0a), TOBN(0xa23c422e, 0x0a23e9ee)}, + {TOBN(0xdd5f6b2d, 0x540f83af), TOBN(0xc2c2c27e, 0x55ea46a7), + TOBN(0xeb6b4246, 0x672a1208), TOBN(0xd13599f7, 0xae634f7a)}}, + {{TOBN(0xcf914b5c, 0xd7b32c6e), TOBN(0x61a5a640, 0xeaf61814), + TOBN(0x8dc3df8b, 0x208a1bbb), TOBN(0xef627fd6, 0xb6d79aa5)}, + {TOBN(0x44232ffc, 0xc4c86bc8), TOBN(0xe6f9231b, 0x061539fe), + TOBN(0x1d04f25a, 0x958b9533), TOBN(0x180cf934, 0x49e8c885)}}, + {{TOBN(0x89689595, 0x9884aaf7), TOBN(0xb1959be3, 0x07b348a6), + TOBN(0x96250e57, 0x3c147c87), TOBN(0xae0efb3a, 0xdd0c61f8)}, + {TOBN(0xed00745e, 0xca8c325e), TOBN(0x3c911696, 0xecff3f70), + TOBN(0x73acbc65, 0x319ad41d), TOBN(0x7b01a020, 0xf0b1c7ef)}}, + {{TOBN(0xea32b293, 0x63a1483f), TOBN(0x89eabe71, 0x7a248f96), + TOBN(0x9c6231d3, 0x343157e5), TOBN(0x93a375e5, 0xdf3c546d)}, + {TOBN(0xe76e9343, 0x6a2afe69), TOBN(0xc4f89100, 0xe166c88e), + TOBN(0x248efd0d, 0x4f872093), TOBN(0xae0eb3ea, 0x8fe0ea61)}}, + {{TOBN(0xaf89790d, 0x9d79046e), TOBN(0x4d650f2d, 0x6cee0976), + TOBN(0xa3935d9a, 0x43071eca), TOBN(0x66fcd2c9, 0x283b0bfe)}, + {TOBN(0x0e665eb5, 0x696605f1), TOBN(0xe77e5d07, 0xa54cd38d), + TOBN(0x90ee050a, 0x43d950cf), TOBN(0x86ddebda, 0xd32e69b5)}}, + {{TOBN(0x6ad94a3d, 0xfddf7415), TOBN(0xf7fa1309, 0x3f6e8d5a), + TOBN(0xc4831d1d, 0xe9957f75), TOBN(0x7de28501, 0xd5817447)}, + {TOBN(0x6f1d7078, 0x9e2aeb6b), TOBN(0xba2b9ff4, 0xf67a53c2), + TOBN(0x36963767, 0xdf9defc3), TOBN(0x479deed3, 0x0d38022c)}}, + {{TOBN(0xd2edb89b, 0x3a8631e8), TOBN(0x8de855de, 0x7a213746), + TOBN(0xb2056cb7, 0xb00c5f11), TOBN(0xdeaefbd0, 0x2c9b85e4)}, + {TOBN(0x03f39a8d, 0xd150892d), TOBN(0x37b84686, 0x218b7985), + TOBN(0x36296dd8, 0xb7375f1a), TOBN(0x472cd4b1, 0xb78e898e)}}, + {{TOBN(0x15dff651, 0xe9f05de9), TOBN(0xd4045069, 0x2ce98ba9), + TOBN(0x8466a7ae, 0x9b38024c), TOBN(0xb910e700, 0xe5a6b5ef)}, + {TOBN(0xae1c56ea, 0xb3aa8f0d), TOBN(0xbab2a507, 0x7eee74a6), + TOBN(0x0dca11e2, 0x4b4c4620), TOBN(0xfd896e2e, 0x4c47d1f4)}}, + {{TOBN(0xeb45ae53, 0x308fbd93), TOBN(0x46cd5a2e, 0x02c36fda), + TOBN(0x6a3d4e90, 0xbaa48385), TOBN(0xdd55e62e, 0x9dbe9960)}, + {TOBN(0xa1406aa0, 0x2a81ede7), TOBN(0x6860dd14, 0xf9274ea7), + TOBN(0xcfdcb0c2, 0x80414f86), TOBN(0xff410b10, 0x22f94327)}}, + {{TOBN(0x5a33cc38, 0x49ad467b), TOBN(0xefb48b6c, 0x0a7335f1), + TOBN(0x14fb54a4, 0xb153a360), TOBN(0x604aa9d2, 0xb52469cc)}, + {TOBN(0x5e9dc486, 0x754e48e9), TOBN(0x693cb455, 0x37471e8e), + TOBN(0xfb2fd7cd, 0x8d3b37b6), TOBN(0x63345e16, 0xcf09ff07)}}, + {{TOBN(0x9910ba6b, 0x23a5d896), TOBN(0x1fe19e35, 0x7fe4364e), + TOBN(0x6e1da8c3, 0x9a33c677), TOBN(0x15b4488b, 0x29fd9fd0)}, + {TOBN(0x1f439254, 0x1a1f22bf), TOBN(0x920a8a70, 0xab8163e8), + TOBN(0x3fd1b249, 0x07e5658e), TOBN(0xf2c4f79c, 0xb6ec839b)}}, + {{TOBN(0x1abbc3d0, 0x4aa38d1b), TOBN(0x3b0db35c, 0xb5d9510e), + TOBN(0x1754ac78, 0x3e60dec0), TOBN(0x53272fd7, 0xea099b33)}, + {TOBN(0x5fb0494f, 0x07a8e107), TOBN(0x4a89e137, 0x6a8191fa), + TOBN(0xa113b7f6, 0x3c4ad544), TOBN(0x88a2e909, 0x6cb9897b)}}, + {{TOBN(0x17d55de3, 0xb44a3f84), TOBN(0xacb2f344, 0x17c6c690), + TOBN(0x32088168, 0x10232390), TOBN(0xf2e8a61f, 0x6c733bf7)}, + {TOBN(0xa774aab6, 0x9c2d7652), TOBN(0xfb5307e3, 0xed95c5bc), + TOBN(0xa05c73c2, 0x4981f110), TOBN(0x1baae31c, 0xa39458c9)}}, + {{TOBN(0x1def185b, 0xcbea62e7), TOBN(0xe8ac9eae, 0xeaf63059), + TOBN(0x098a8cfd, 0x9921851c), TOBN(0xd959c3f1, 0x3abe2f5b)}, + {TOBN(0xa4f19525, 0x20e40ae5), TOBN(0x320789e3, 0x07a24aa1), + TOBN(0x259e6927, 0x7392b2bc), TOBN(0x58f6c667, 0x1918668b)}}, + {{TOBN(0xce1db2bb, 0xc55d2d8b), TOBN(0x41d58bb7, 0xf4f6ca56), + TOBN(0x7650b680, 0x8f877614), TOBN(0x905e16ba, 0xf4c349ed)}, + {TOBN(0xed415140, 0xf661acac), TOBN(0x3b8784f0, 0xcb2270af), + TOBN(0x3bc280ac, 0x8a402cba), TOBN(0xd53f7146, 0x0937921a)}}, + {{TOBN(0xc03c8ee5, 0xe5681e83), TOBN(0x62126105, 0xf6ac9e4a), + TOBN(0x9503a53f, 0x936b1a38), TOBN(0x3d45e2d4, 0x782fecbd)}, + {TOBN(0x69a5c439, 0x76e8ae98), TOBN(0xb53b2eeb, 0xbfb4b00e), + TOBN(0xf1674712, 0x72386c89), TOBN(0x30ca34a2, 0x4268bce4)}}, + {{TOBN(0x7f1ed86c, 0x78341730), TOBN(0x8ef5beb8, 0xb525e248), + TOBN(0xbbc489fd, 0xb74fbf38), TOBN(0x38a92a0e, 0x91a0b382)}, + {TOBN(0x7a77ba3f, 0x22433ccf), TOBN(0xde8362d6, 0xa29f05a9), + TOBN(0x7f6a30ea, 0x61189afc), TOBN(0x693b5505, 0x59ef114f)}}, + {{TOBN(0x50266bc0, 0xcd1797a1), TOBN(0xea17b47e, 0xf4b7af2d), + TOBN(0xd6c4025c, 0x3df9483e), TOBN(0x8cbb9d9f, 0xa37b18c9)}, + {TOBN(0x91cbfd9c, 0x4d8424cf), TOBN(0xdb7048f1, 0xab1c3506), + TOBN(0x9eaf641f, 0x028206a3), TOBN(0xf986f3f9, 0x25bdf6ce)}}, + {{TOBN(0x262143b5, 0x224c08dc), TOBN(0x2bbb09b4, 0x81b50c91), + TOBN(0xc16ed709, 0xaca8c84f), TOBN(0xa6210d9d, 0xb2850ca8)}, + {TOBN(0x6d8df67a, 0x09cb54d6), TOBN(0x91eef6e0, 0x500919a4), + TOBN(0x90f61381, 0x0f132857), TOBN(0x9acede47, 0xf8d5028b)}}, + {{TOBN(0x844d1b71, 0x90b771c3), TOBN(0x563b71e4, 0xba6426be), + TOBN(0x2efa2e83, 0xbdb802ff), TOBN(0x3410cbab, 0xab5b4a41)}, + {TOBN(0x555b2d26, 0x30da84dd), TOBN(0xd0711ae9, 0xee1cc29a), + TOBN(0xcf3e8c60, 0x2f547792), TOBN(0x03d7d5de, 0xdc678b35)}}, + {{TOBN(0x071a2fa8, 0xced806b8), TOBN(0x222e6134, 0x697f1478), + TOBN(0xdc16fd5d, 0xabfcdbbf), TOBN(0x44912ebf, 0x121b53b8)}, + {TOBN(0xac943674, 0x2496c27c), TOBN(0x8ea3176c, 0x1ffc26b0), + TOBN(0xb6e224ac, 0x13debf2c), TOBN(0x524cc235, 0xf372a832)}}, + {{TOBN(0xd706e1d8, 0x9f6f1b18), TOBN(0x2552f005, 0x44cce35b), + TOBN(0x8c8326c2, 0xa88e31fc), TOBN(0xb5468b2c, 0xf9552047)}, + {TOBN(0xce683e88, 0x3ff90f2b), TOBN(0x77947bdf, 0x2f0a5423), + TOBN(0xd0a1b28b, 0xed56e328), TOBN(0xaee35253, 0xc20134ac)}}, + {{TOBN(0x7e98367d, 0x3567962f), TOBN(0x379ed61f, 0x8188bffb), + TOBN(0x73bba348, 0xfaf130a1), TOBN(0x6c1f75e1, 0x904ed734)}, + {TOBN(0x18956642, 0x3b4a79fc), TOBN(0xf20bc83d, 0x54ef4493), + TOBN(0x836d425d, 0x9111eca1), TOBN(0xe5b5c318, 0x009a8dcf)}}, + {{TOBN(0x3360b25d, 0x13221bc5), TOBN(0x707baad2, 0x6b3eeaf7), + TOBN(0xd7279ed8, 0x743a95a1), TOBN(0x7450a875, 0x969e809f)}, + {TOBN(0x32b6bd53, 0xe5d0338f), TOBN(0x1e77f7af, 0x2b883bbc), + TOBN(0x90da12cc, 0x1063ecd0), TOBN(0xe2697b58, 0xc315be47)}}, + {{TOBN(0x2771a5bd, 0xda85d534), TOBN(0x53e78c1f, 0xff980eea), + TOBN(0xadf1cf84, 0x900385e7), TOBN(0x7d3b14f6, 0xc9387b62)}, + {TOBN(0x170e74b0, 0xcb8f2bd2), TOBN(0x2d50b486, 0x827fa993), + TOBN(0xcdbe8c9a, 0xf6f32bab), TOBN(0x55e906b0, 0xc3b93ab8)}}, + {{TOBN(0x747f22fc, 0x8fe280d1), TOBN(0xcd8e0de5, 0xb2e114ab), + TOBN(0x5ab7dbeb, 0xe10b68b0), TOBN(0x9dc63a9c, 0xa480d4b2)}, + {TOBN(0x78d4bc3b, 0x4be1495f), TOBN(0x25eb3db8, 0x9359122d), + TOBN(0x3f8ac05b, 0x0809cbdc), TOBN(0xbf4187bb, 0xd37c702f)}}, + {{TOBN(0x84cea069, 0x1416a6a5), TOBN(0x8f860c79, 0x43ef881c), + TOBN(0x41311f8a, 0x38038a5d), TOBN(0xe78c2ec0, 0xfc612067)}, + {TOBN(0x494d2e81, 0x5ad73581), TOBN(0xb4cc9e00, 0x59604097), + TOBN(0xff558aec, 0xf3612cba), TOBN(0x35beef7a, 0x9e36c39e)}}, + {{TOBN(0x1845c7cf, 0xdbcf41b9), TOBN(0x5703662a, 0xaea997c0), + TOBN(0x8b925afe, 0xe402f6d8), TOBN(0xd0a1b1ae, 0x4dd72162)}, + {TOBN(0x9f47b375, 0x03c41c4b), TOBN(0xa023829b, 0x0391d042), + TOBN(0x5f5045c3, 0x503b8b0a), TOBN(0x123c2688, 0x98c010e5)}}, + {{TOBN(0x324ec0cc, 0x36ba06ee), TOBN(0xface3115, 0x3dd2cc0c), + TOBN(0xb364f3be, 0xf333e91f), TOBN(0xef8aff73, 0x28e832b0)}, + {TOBN(0x1e9bad04, 0x2d05841b), TOBN(0x42f0e3df, 0x356a21e2), + TOBN(0xa3270bcb, 0x4add627e), TOBN(0xb09a8158, 0xd322e711)}}, + {{TOBN(0x86e326a1, 0x0fee104a), TOBN(0xad7788f8, 0x3703f65d), + TOBN(0x7e765430, 0x47bc4833), TOBN(0x6cee582b, 0x2b9b893a)}, + {TOBN(0x9cd2a167, 0xe8f55a7b), TOBN(0xefbee3c6, 0xd9e4190d), + TOBN(0x33ee7185, 0xd40c2e9d), TOBN(0x844cc9c5, 0xa380b548)}}, + {{TOBN(0x323f8ecd, 0x66926e04), TOBN(0x0001e38f, 0x8110c1ba), + TOBN(0x8dbcac12, 0xfc6a7f07), TOBN(0xd65e1d58, 0x0cec0827)}, + {TOBN(0xd2cd4141, 0xbe76ca2d), TOBN(0x7895cf5c, 0xe892f33a), + TOBN(0x956d230d, 0x367139d2), TOBN(0xa91abd3e, 0xd012c4c1)}}, + {{TOBN(0x34fa4883, 0x87eb36bf), TOBN(0xc5f07102, 0x914b8fb4), + TOBN(0x90f0e579, 0xadb9c95f), TOBN(0xfe6ea8cb, 0x28888195)}, + {TOBN(0x7b9b5065, 0xedfa9284), TOBN(0x6c510bd2, 0x2b8c8d65), + TOBN(0xd7b8ebef, 0xcbe8aafd), TOBN(0xedb3af98, 0x96b1da07)}}, + {{TOBN(0x28ff779d, 0x6295d426), TOBN(0x0c4f6ac7, 0x3fa3ad7b), + TOBN(0xec44d054, 0x8b8e2604), TOBN(0x9b32a66d, 0x8b0050e1)}, + {TOBN(0x1f943366, 0xf0476ce2), TOBN(0x7554d953, 0xa602c7b4), + TOBN(0xbe35aca6, 0x524f2809), TOBN(0xb6881229, 0xfd4edbea)}}, + {{TOBN(0xe8cd0c8f, 0x508efb63), TOBN(0x9eb5b5c8, 0x6abcefc7), + TOBN(0xf5621f5f, 0xb441ab4f), TOBN(0x79e6c046, 0xb76a2b22)}, + {TOBN(0x74a4792c, 0xe37a1f69), TOBN(0xcbd252cb, 0x03542b60), + TOBN(0x785f65d5, 0xb3c20bd3), TOBN(0x8dea6143, 0x4fabc60c)}}, + {{TOBN(0x45e21446, 0xde673629), TOBN(0x57f7aa1e, 0x703c2d21), + TOBN(0xa0e99b7f, 0x98c868c7), TOBN(0x4e42f66d, 0x8b641676)}, + {TOBN(0x602884dc, 0x91077896), TOBN(0xa0d690cf, 0xc2c9885b), + TOBN(0xfeb4da33, 0x3b9a5187), TOBN(0x5f789598, 0x153c87ee)}}, + {{TOBN(0x2192dd47, 0x52b16dba), TOBN(0xdeefc0e6, 0x3524c1b1), + TOBN(0x465ea76e, 0xe4383693), TOBN(0x79401711, 0x361b8d98)}, + {TOBN(0xa5f9ace9, 0xf21a15cb), TOBN(0x73d26163, 0xefee9aeb), + TOBN(0xcca844b3, 0xe677016c), TOBN(0x6c122b07, 0x57eaee06)}}, + {{TOBN(0xb782dce7, 0x15f09690), TOBN(0x508b9b12, 0x2dfc0fc9), + TOBN(0x9015ab4b, 0x65d89fc6), TOBN(0x5e79dab7, 0xd6d5bb0f)}, + {TOBN(0x64f021f0, 0x6c775aa2), TOBN(0xdf09d8cc, 0x37c7eca1), + TOBN(0x9a761367, 0xef2fa506), TOBN(0xed4ca476, 0x5b81eec6)}}, + {{TOBN(0x262ede36, 0x10bbb8b5), TOBN(0x0737ce83, 0x0641ada3), + TOBN(0x4c94288a, 0xe9831ccc), TOBN(0x487fc1ce, 0x8065e635)}, + {TOBN(0xb13d7ab3, 0xb8bb3659), TOBN(0xdea5df3e, 0x855e4120), + TOBN(0xb9a18573, 0x85eb0244), TOBN(0x1a1b8ea3, 0xa7cfe0a3)}}, + {{TOBN(0x3b837119, 0x67b0867c), TOBN(0x8d5e0d08, 0x9d364520), + TOBN(0x52dccc1e, 0xd930f0e3), TOBN(0xefbbcec7, 0xbf20bbaf)}, + {TOBN(0x99cffcab, 0x0263ad10), TOBN(0xd8199e6d, 0xfcd18f8a), + TOBN(0x64e2773f, 0xe9f10617), TOBN(0x0079e8e1, 0x08704848)}}, + {{TOBN(0x1169989f, 0x8a342283), TOBN(0x8097799c, 0xa83012e6), + TOBN(0xece966cb, 0x8a6a9001), TOBN(0x93b3afef, 0x072ac7fc)}, + {TOBN(0xe6893a2a, 0x2db3d5ba), TOBN(0x263dc462, 0x89bf4fdc), + TOBN(0x8852dfc9, 0xe0396673), TOBN(0x7ac70895, 0x3af362b6)}}, + {{TOBN(0xbb9cce4d, 0x5c2f342b), TOBN(0xbf80907a, 0xb52d7aae), + TOBN(0x97f3d3cd, 0x2161bcd0), TOBN(0xb25b0834, 0x0962744d)}, + {TOBN(0xc5b18ea5, 0x6c3a1dda), TOBN(0xfe4ec7eb, 0x06c92317), + TOBN(0xb787b890, 0xad1c4afe), TOBN(0xdccd9a92, 0x0ede801a)}}, + {{TOBN(0x9ac6ddda, 0xdb58da1f), TOBN(0x22bbc12f, 0xb8cae6ee), + TOBN(0xc6f8bced, 0x815c4a43), TOBN(0x8105a92c, 0xf96480c7)}, + {TOBN(0x0dc3dbf3, 0x7a859d51), TOBN(0xe3ec7ce6, 0x3041196b), + TOBN(0xd9f64b25, 0x0d1067c9), TOBN(0xf2321321, 0x3d1f8dd8)}}, + {{TOBN(0x8b5c619c, 0x76497ee8), TOBN(0x5d2b0ac6, 0xc717370e), + TOBN(0x98204cb6, 0x4fcf68e1), TOBN(0x0bdec211, 0x62bc6792)}, + {TOBN(0x6973ccef, 0xa63b1011), TOBN(0xf9e3fa97, 0xe0de1ac5), + TOBN(0x5efb693e, 0x3d0e0c8b), TOBN(0x037248e9, 0xd2d4fcb4)}}}, + {{{TOBN(0x80802dc9, 0x1ec34f9e), TOBN(0xd8772d35, 0x33810603), + TOBN(0x3f06d66c, 0x530cb4f3), TOBN(0x7be5ed0d, 0xc475c129)}, + {TOBN(0xcb9e3c19, 0x31e82b10), TOBN(0xc63d2857, 0xc9ff6b4c), + TOBN(0xb92118c6, 0x92a1b45e), TOBN(0x0aec4414, 0x7285bbca)}}, + {{TOBN(0xfc189ae7, 0x1e29a3ef), TOBN(0xcbe906f0, 0x4c93302e), + TOBN(0xd0107914, 0xceaae10e), TOBN(0xb7a23f34, 0xb68e19f8)}, + {TOBN(0xe9d875c2, 0xefd2119d), TOBN(0x03198c6e, 0xfcadc9c8), + TOBN(0x65591bf6, 0x4da17113), TOBN(0x3cf0bbf8, 0x3d443038)}}, + {{TOBN(0xae485bb7, 0x2b724759), TOBN(0x945353e1, 0xb2d4c63a), + TOBN(0x82159d07, 0xde7d6f2c), TOBN(0x389caef3, 0x4ec5b109)}, + {TOBN(0x4a8ebb53, 0xdb65ef14), TOBN(0x2dc2cb7e, 0xdd99de43), + TOBN(0x816fa3ed, 0x83f2405f), TOBN(0x73429bb9, 0xc14208a3)}}, + {{TOBN(0xb618d590, 0xb01e6e27), TOBN(0x047e2ccd, 0xe180b2dc), + TOBN(0xd1b299b5, 0x04aea4a9), TOBN(0x412c9e1e, 0x9fa403a4)}, + {TOBN(0x88d28a36, 0x79407552), TOBN(0x49c50136, 0xf332b8e3), + TOBN(0x3a1b6fcc, 0xe668de19), TOBN(0x178851bc, 0x75122b97)}}, + {{TOBN(0xb1e13752, 0xfb85fa4c), TOBN(0xd61257ce, 0x383c8ce9), + TOBN(0xd43da670, 0xd2f74dae), TOBN(0xa35aa23f, 0xbf846bbb)}, + {TOBN(0x5e74235d, 0x4421fc83), TOBN(0xf6df8ee0, 0xc363473b), + TOBN(0x34d7f52a, 0x3c4aa158), TOBN(0x50d05aab, 0x9bc6d22e)}}, + {{TOBN(0x8c56e735, 0xa64785f4), TOBN(0xbc56637b, 0x5f29cd07), + TOBN(0x53b2bb80, 0x3ee35067), TOBN(0x50235a0f, 0xdc919270)}, + {TOBN(0x191ab6d8, 0xf2c4aa65), TOBN(0xc3475831, 0x8396023b), + TOBN(0x80400ba5, 0xf0f805ba), TOBN(0x8881065b, 0x5ec0f80f)}}, + {{TOBN(0xc370e522, 0xcc1b5e83), TOBN(0xde2d4ad1, 0x860b8bfb), + TOBN(0xad364df0, 0x67b256df), TOBN(0x8f12502e, 0xe0138997)}, + {TOBN(0x503fa0dc, 0x7783920a), TOBN(0xe80014ad, 0xc0bc866a), + TOBN(0x3f89b744, 0xd3064ba6), TOBN(0x03511dcd, 0xcba5dba5)}}, + {{TOBN(0x197dd46d, 0x95a7b1a2), TOBN(0x9c4e7ad6, 0x3c6341fb), + TOBN(0x426eca29, 0x484c2ece), TOBN(0x9211e489, 0xde7f4f8a)}, + {TOBN(0x14997f6e, 0xc78ef1f4), TOBN(0x2b2c0910, 0x06574586), + TOBN(0x17286a6e, 0x1c3eede8), TOBN(0x25f92e47, 0x0f60e018)}}, + {{TOBN(0x805c5646, 0x31890a36), TOBN(0x703ef600, 0x57feea5b), + TOBN(0x389f747c, 0xaf3c3030), TOBN(0xe0e5daeb, 0x54dd3739)}, + {TOBN(0xfe24a4c3, 0xc9c9f155), TOBN(0x7e4bf176, 0xb5393962), + TOBN(0x37183de2, 0xaf20bf29), TOBN(0x4a1bd7b5, 0xf95a8c3b)}}, + {{TOBN(0xa83b9699, 0x46191d3d), TOBN(0x281fc8dd, 0x7b87f257), + TOBN(0xb18e2c13, 0x54107588), TOBN(0x6372def7, 0x9b2bafe8)}, + {TOBN(0xdaf4bb48, 0x0d8972ca), TOBN(0x3f2dd4b7, 0x56167a3f), + TOBN(0x1eace32d, 0x84310cf4), TOBN(0xe3bcefaf, 0xe42700aa)}}, + {{TOBN(0x5fe5691e, 0xd785e73d), TOBN(0xa5db5ab6, 0x2ea60467), + TOBN(0x02e23d41, 0xdfc6514a), TOBN(0x35e8048e, 0xe03c3665)}, + {TOBN(0x3f8b118f, 0x1adaa0f8), TOBN(0x28ec3b45, 0x84ce1a5a), + TOBN(0xe8cacc6e, 0x2c6646b8), TOBN(0x1343d185, 0xdbd0e40f)}}, + {{TOBN(0xe5d7f844, 0xcaaa358c), TOBN(0x1a1db7e4, 0x9924182a), + TOBN(0xd64cd42d, 0x9c875d9a), TOBN(0xb37b515f, 0x042eeec8)}, + {TOBN(0x4d4dd409, 0x7b165fbe), TOBN(0xfc322ed9, 0xe206eff3), + TOBN(0x7dee4102, 0x59b7e17e), TOBN(0x55a481c0, 0x8236ca00)}}, + {{TOBN(0x8c885312, 0xc23fc975), TOBN(0x15715806, 0x05d6297b), + TOBN(0xa078868e, 0xf78edd39), TOBN(0x956b31e0, 0x03c45e52)}, + {TOBN(0x470275d5, 0xff7b33a6), TOBN(0xc8d5dc3a, 0x0c7e673f), + TOBN(0x419227b4, 0x7e2f2598), TOBN(0x8b37b634, 0x4c14a975)}}, + {{TOBN(0xd0667ed6, 0x8b11888c), TOBN(0x5e0e8c3e, 0x803e25dc), + TOBN(0x34e5d0dc, 0xb987a24a), TOBN(0x9f40ac3b, 0xae920323)}, + {TOBN(0x5463de95, 0x34e0f63a), TOBN(0xa128bf92, 0x6b6328f9), + TOBN(0x491ccd7c, 0xda64f1b7), TOBN(0x7ef1ec27, 0xc47bde35)}}, + {{TOBN(0xa857240f, 0xa36a2737), TOBN(0x35dc1366, 0x63621bc1), + TOBN(0x7a3a6453, 0xd4fb6897), TOBN(0x80f1a439, 0xc929319d)}, + {TOBN(0xfc18274b, 0xf8cb0ba0), TOBN(0xb0b53766, 0x8078c5eb), + TOBN(0xfb0d4924, 0x1e01d0ef), TOBN(0x50d7c67d, 0x372ab09c)}}, + {{TOBN(0xb4e370af, 0x3aeac968), TOBN(0xe4f7fee9, 0xc4b63266), + TOBN(0xb4acd4c2, 0xe3ac5664), TOBN(0xf8910bd2, 0xceb38cbf)}, + {TOBN(0x1c3ae50c, 0xc9c0726e), TOBN(0x15309569, 0xd97b40bf), + TOBN(0x70884b7f, 0xfd5a5a1b), TOBN(0x3890896a, 0xef8314cd)}}, + {{TOBN(0x58e1515c, 0xa5618c93), TOBN(0xe665432b, 0x77d942d1), + TOBN(0xb32181bf, 0xb6f767a8), TOBN(0x753794e8, 0x3a604110)}, + {TOBN(0x09afeb7c, 0xe8c0dbcc), TOBN(0x31e02613, 0x598673a3), + TOBN(0x5d98e557, 0x7d46db00), TOBN(0xfc21fb8c, 0x9d985b28)}}, + {{TOBN(0xc9040116, 0xb0843e0b), TOBN(0x53b1b3a8, 0x69b04531), + TOBN(0xdd1649f0, 0x85d7d830), TOBN(0xbb3bcc87, 0xcb7427e8)}, + {TOBN(0x77261100, 0xc93dce83), TOBN(0x7e79da61, 0xa1922a2a), + TOBN(0x587a2b02, 0xf3149ce8), TOBN(0x147e1384, 0xde92ec83)}}, + {{TOBN(0x484c83d3, 0xaf077f30), TOBN(0xea78f844, 0x0658b53a), + TOBN(0x912076c2, 0x027aec53), TOBN(0xf34714e3, 0x93c8177d)}, + {TOBN(0x37ef5d15, 0xc2376c84), TOBN(0x8315b659, 0x3d1aa783), + TOBN(0x3a75c484, 0xef852a90), TOBN(0x0ba0c58a, 0x16086bd4)}}, + {{TOBN(0x29688d7a, 0x529a6d48), TOBN(0x9c7f250d, 0xc2f19203), + TOBN(0x123042fb, 0x682e2df9), TOBN(0x2b7587e7, 0xad8121bc)}, + {TOBN(0x30fc0233, 0xe0182a65), TOBN(0xb82ecf87, 0xe3e1128a), + TOBN(0x71682861, 0x93fb098f), TOBN(0x043e21ae, 0x85e9e6a7)}}, + {{TOBN(0xab5b49d6, 0x66c834ea), TOBN(0x3be43e18, 0x47414287), + TOBN(0xf40fb859, 0x219a2a47), TOBN(0x0e6559e9, 0xcc58df3c)}, + {TOBN(0xfe1dfe8e, 0x0c6615b4), TOBN(0x14abc8fd, 0x56459d70), + TOBN(0x7be0fa8e, 0x05de0386), TOBN(0x8e63ef68, 0xe9035c7c)}}, + {{TOBN(0x116401b4, 0x53b31e91), TOBN(0x0cba7ad4, 0x4436b4d8), + TOBN(0x9151f9a0, 0x107afd66), TOBN(0xafaca8d0, 0x1f0ee4c4)}, + {TOBN(0x75fe5c1d, 0x9ee9761c), TOBN(0x3497a16b, 0xf0c0588f), + TOBN(0x3ee2bebd, 0x0304804c), TOBN(0xa8fb9a60, 0xc2c990b9)}}, + {{TOBN(0xd14d32fe, 0x39251114), TOBN(0x36bf25bc, 0xcac73366), + TOBN(0xc9562c66, 0xdba7495c), TOBN(0x324d301b, 0x46ad348b)}, + {TOBN(0x9f46620c, 0xd670407e), TOBN(0x0ea8d4f1, 0xe3733a01), + TOBN(0xd396d532, 0xb0c324e0), TOBN(0x5b211a0e, 0x03c317cd)}}, + {{TOBN(0x090d7d20, 0x5ffe7b37), TOBN(0x3b7f3efb, 0x1747d2da), + TOBN(0xa2cb525f, 0xb54fc519), TOBN(0x6e220932, 0xf66a971e)}, + {TOBN(0xddc160df, 0xb486d440), TOBN(0x7fcfec46, 0x3fe13465), + TOBN(0x83da7e4e, 0x76e4c151), TOBN(0xd6fa48a1, 0xd8d302b5)}}, + {{TOBN(0xc6304f26, 0x5872cd88), TOBN(0x806c1d3c, 0x278b90a1), + TOBN(0x3553e725, 0xcaf0bc1c), TOBN(0xff59e603, 0xbb9d8d5c)}, + {TOBN(0xa4550f32, 0x7a0b85dd), TOBN(0xdec5720a, 0x93ecc217), + TOBN(0x0b88b741, 0x69d62213), TOBN(0x7212f245, 0x5b365955)}}, + {{TOBN(0x20764111, 0xb5cae787), TOBN(0x13cb7f58, 0x1dfd3124), + TOBN(0x2dca77da, 0x1175aefb), TOBN(0xeb75466b, 0xffaae775)}, + {TOBN(0x74d76f3b, 0xdb6cff32), TOBN(0x7440f37a, 0x61fcda9a), + TOBN(0x1bb3ac92, 0xb525028b), TOBN(0x20fbf8f7, 0xa1975f29)}}, + {{TOBN(0x982692e1, 0xdf83097f), TOBN(0x28738f6c, 0x554b0800), + TOBN(0xdc703717, 0xa2ce2f2f), TOBN(0x7913b93c, 0x40814194)}, + {TOBN(0x04924593, 0x1fe89636), TOBN(0x7b98443f, 0xf78834a6), + TOBN(0x11c6ab01, 0x5114a5a1), TOBN(0x60deb383, 0xffba5f4c)}}, + {{TOBN(0x4caa54c6, 0x01a982e6), TOBN(0x1dd35e11, 0x3491cd26), + TOBN(0x973c315f, 0x7cbd6b05), TOBN(0xcab00775, 0x52494724)}, + {TOBN(0x04659b1f, 0x6565e15a), TOBN(0xbf30f529, 0x8c8fb026), + TOBN(0xfc21641b, 0xa8a0de37), TOBN(0xe9c7a366, 0xfa5e5114)}}, + {{TOBN(0xdb849ca5, 0x52f03ad8), TOBN(0xc7e8dbe9, 0x024e35c0), + TOBN(0xa1a2bbac, 0xcfc3c789), TOBN(0xbf733e7d, 0x9c26f262)}, + {TOBN(0x882ffbf5, 0xb8444823), TOBN(0xb7224e88, 0x6bf8483b), + TOBN(0x53023b8b, 0x65bef640), TOBN(0xaabfec91, 0xd4d5f8cd)}}, + {{TOBN(0xa40e1510, 0x079ea1bd), TOBN(0x1ad9addc, 0xd05d5d26), + TOBN(0xdb3f2eab, 0x13e68d4f), TOBN(0x1cff1ae2, 0x640f803f)}, + {TOBN(0xe0e7b749, 0xd4cee117), TOBN(0x8e9f275b, 0x4036d909), + TOBN(0xce34e31d, 0x8f4d4c38), TOBN(0x22b37f69, 0xd75130fc)}}, + {{TOBN(0x83e0f1fd, 0xb4014604), TOBN(0xa8ce9919, 0x89415078), + TOBN(0x82375b75, 0x41792efe), TOBN(0x4f59bf5c, 0x97d4515b)}, + {TOBN(0xac4f324f, 0x923a277d), TOBN(0xd9bc9b7d, 0x650f3406), + TOBN(0xc6fa87d1, 0x8a39bc51), TOBN(0x82588530, 0x5ccc108f)}}, + {{TOBN(0x5ced3c9f, 0x82e4c634), TOBN(0x8efb8314, 0x3a4464f8), + TOBN(0xe706381b, 0x7a1dca25), TOBN(0x6cd15a3c, 0x5a2a412b)}, + {TOBN(0x9347a8fd, 0xbfcd8fb5), TOBN(0x31db2eef, 0x6e54cd22), + TOBN(0xc4aeb11e, 0xf8d8932f), TOBN(0x11e7c1ed, 0x344411af)}}, + {{TOBN(0x2653050c, 0xdc9a151e), TOBN(0x9edbfc08, 0x3bb0a859), + TOBN(0x926c81c7, 0xfd5691e7), TOBN(0x9c1b2342, 0x6f39019a)}, + {TOBN(0x64a81c8b, 0x7f8474b9), TOBN(0x90657c07, 0x01761819), + TOBN(0x390b3331, 0x55e0375a), TOBN(0xc676c626, 0xb6ebc47d)}}, + {{TOBN(0x51623247, 0xb7d6dee8), TOBN(0x0948d927, 0x79659313), + TOBN(0x99700161, 0xe9ab35ed), TOBN(0x06cc32b4, 0x8ddde408)}, + {TOBN(0x6f2fd664, 0x061ef338), TOBN(0x1606fa02, 0xc202e9ed), + TOBN(0x55388bc1, 0x929ba99b), TOBN(0xc4428c5e, 0x1e81df69)}}, + {{TOBN(0xce2028ae, 0xf91b0b2a), TOBN(0xce870a23, 0xf03dfd3f), + TOBN(0x66ec2c87, 0x0affe8ed), TOBN(0xb205fb46, 0x284d0c00)}, + {TOBN(0xbf5dffe7, 0x44cefa48), TOBN(0xb6fc37a8, 0xa19876d7), + TOBN(0xbecfa84c, 0x08b72863), TOBN(0xd7205ff5, 0x2576374f)}}, + {{TOBN(0x80330d32, 0x8887de41), TOBN(0x5de0df0c, 0x869ea534), + TOBN(0x13f42753, 0x3c56ea17), TOBN(0xeb1f6069, 0x452b1a78)}, + {TOBN(0x50474396, 0xe30ea15c), TOBN(0x575816a1, 0xc1494125), + TOBN(0xbe1ce55b, 0xfe6bb38f), TOBN(0xb901a948, 0x96ae30f7)}}, + {{TOBN(0xe5af0f08, 0xd8fc3548), TOBN(0x5010b5d0, 0xd73bfd08), + TOBN(0x993d2880, 0x53fe655a), TOBN(0x99f2630b, 0x1c1309fd)}, + {TOBN(0xd8677baf, 0xb4e3b76f), TOBN(0x14e51ddc, 0xb840784b), + TOBN(0x326c750c, 0xbf0092ce), TOBN(0xc83d306b, 0xf528320f)}}, + {{TOBN(0xc4456715, 0x77d4715c), TOBN(0xd30019f9, 0x6b703235), + TOBN(0x207ccb2e, 0xd669e986), TOBN(0x57c824af, 0xf6dbfc28)}, + {TOBN(0xf0eb532f, 0xd8f92a23), TOBN(0x4a557fd4, 0x9bb98fd2), + TOBN(0xa57acea7, 0xc1e6199a), TOBN(0x0c663820, 0x8b94b1ed)}}, + {{TOBN(0x9b42be8f, 0xf83a9266), TOBN(0xc7741c97, 0x0101bd45), + TOBN(0x95770c11, 0x07bd9ceb), TOBN(0x1f50250a, 0x8b2e0744)}, + {TOBN(0xf762eec8, 0x1477b654), TOBN(0xc65b900e, 0x15efe59a), + TOBN(0x88c96148, 0x9546a897), TOBN(0x7e8025b3, 0xc30b4d7c)}}, + {{TOBN(0xae4065ef, 0x12045cf9), TOBN(0x6fcb2caf, 0x9ccce8bd), + TOBN(0x1fa0ba4e, 0xf2cf6525), TOBN(0xf683125d, 0xcb72c312)}, + {TOBN(0xa01da4ea, 0xe312410e), TOBN(0x67e28677, 0x6cd8e830), + TOBN(0xabd95752, 0x98fb3f07), TOBN(0x05f11e11, 0xeef649a5)}}, + {{TOBN(0xba47faef, 0x9d3472c2), TOBN(0x3adff697, 0xc77d1345), + TOBN(0x4761fa04, 0xdd15afee), TOBN(0x64f1f61a, 0xb9e69462)}, + {TOBN(0xfa691fab, 0x9bfb9093), TOBN(0x3df8ae8f, 0xa1133dfe), + TOBN(0xcd5f8967, 0x58cc710d), TOBN(0xfbb88d50, 0x16c7fe79)}}, + {{TOBN(0x8e011b4c, 0xe88c50d1), TOBN(0x7532e807, 0xa8771c4f), + TOBN(0x64c78a48, 0xe2278ee4), TOBN(0x0b283e83, 0x3845072a)}, + {TOBN(0x98a6f291, 0x49e69274), TOBN(0xb96e9668, 0x1868b21c), + TOBN(0x38f0adc2, 0xb1a8908e), TOBN(0x90afcff7, 0x1feb829d)}}, + {{TOBN(0x9915a383, 0x210b0856), TOBN(0xa5a80602, 0xdef04889), + TOBN(0x800e9af9, 0x7c64d509), TOBN(0x81382d0b, 0xb8996f6f)}, + {TOBN(0x490eba53, 0x81927e27), TOBN(0x46c63b32, 0x4af50182), + TOBN(0x784c5fd9, 0xd3ad62ce), TOBN(0xe4fa1870, 0xf8ae8736)}}, + {{TOBN(0x4ec9d0bc, 0xd7466b25), TOBN(0x84ddbe1a, 0xdb235c65), + TOBN(0x5e2645ee, 0x163c1688), TOBN(0x570bd00e, 0x00eba747)}, + {TOBN(0xfa51b629, 0x128bfa0f), TOBN(0x92fce1bd, 0x6c1d3b68), + TOBN(0x3e7361dc, 0xb66778b1), TOBN(0x9c7d249d, 0x5561d2bb)}}, + {{TOBN(0xa40b28bf, 0x0bbc6229), TOBN(0x1c83c05e, 0xdfd91497), + TOBN(0x5f9f5154, 0xf083df05), TOBN(0xbac38b3c, 0xeee66c9d)}, + {TOBN(0xf71db7e3, 0xec0dfcfd), TOBN(0xf2ecda8e, 0x8b0a8416), + TOBN(0x52fddd86, 0x7812aa66), TOBN(0x2896ef10, 0x4e6f4272)}}, + {{TOBN(0xff27186a, 0x0fe9a745), TOBN(0x08249fcd, 0x49ca70db), + TOBN(0x7425a2e6, 0x441cac49), TOBN(0xf4a0885a, 0xece5ff57)}, + {TOBN(0x6e2cb731, 0x7d7ead58), TOBN(0xf96cf7d6, 0x1898d104), + TOBN(0xafe67c9d, 0x4f2c9a89), TOBN(0x89895a50, 0x1c7bf5bc)}}, + {{TOBN(0xdc7cb8e5, 0x573cecfa), TOBN(0x66497eae, 0xd15f03e6), + TOBN(0x6bc0de69, 0x3f084420), TOBN(0x323b9b36, 0xacd532b0)}, + {TOBN(0xcfed390a, 0x0115a3c1), TOBN(0x9414c40b, 0x2d65ca0e), + TOBN(0x641406bd, 0x2f530c78), TOBN(0x29369a44, 0x833438f2)}}, + {{TOBN(0x996884f5, 0x903fa271), TOBN(0xe6da0fd2, 0xb9da921e), + TOBN(0xa6f2f269, 0x5db01e54), TOBN(0x1ee3e9bd, 0x6876214e)}, + {TOBN(0xa26e181c, 0xe27a9497), TOBN(0x36d254e4, 0x8e215e04), + TOBN(0x42f32a6c, 0x252cabca), TOBN(0x99481487, 0x80b57614)}}, + {{TOBN(0x4c4dfe69, 0x40d9cae1), TOBN(0x05869580, 0x11a10f09), + TOBN(0xca287b57, 0x3491b64b), TOBN(0x77862d5d, 0x3fd4a53b)}, + {TOBN(0xbf94856e, 0x50349126), TOBN(0x2be30bd1, 0x71c5268f), + TOBN(0x10393f19, 0xcbb650a6), TOBN(0x639531fe, 0x778cf9fd)}}, + {{TOBN(0x02556a11, 0xb2935359), TOBN(0xda38aa96, 0xaf8c126e), + TOBN(0x47dbe6c2, 0x0960167f), TOBN(0x37bbabb6, 0x501901cd)}, + {TOBN(0xb6e979e0, 0x2c947778), TOBN(0xd69a5175, 0x7a1a1dc6), + TOBN(0xc3ed5095, 0x9d9faf0c), TOBN(0x4dd9c096, 0x1d5fa5f0)}}, + {{TOBN(0xa0c4304d, 0x64f16ea8), TOBN(0x8b1cac16, 0x7e718623), + TOBN(0x0b576546, 0x7c67f03e), TOBN(0x559cf5ad, 0xcbd88c01)}, + {TOBN(0x074877bb, 0x0e2af19a), TOBN(0x1f717ec1, 0xa1228c92), + TOBN(0x70bcb800, 0x326e8920), TOBN(0xec6e2c5c, 0x4f312804)}}, + {{TOBN(0x426aea7d, 0x3fca4752), TOBN(0xf12c0949, 0x2211f62a), + TOBN(0x24beecd8, 0x7be7b6b5), TOBN(0xb77eaf4c, 0x36d7a27d)}, + {TOBN(0x154c2781, 0xfda78fd3), TOBN(0x848a83b0, 0x264eeabe), + TOBN(0x81287ef0, 0x4ffe2bc4), TOBN(0x7b6d88c6, 0xb6b6fc2a)}}, + {{TOBN(0x805fb947, 0xce417d99), TOBN(0x4b93dcc3, 0x8b916cc4), + TOBN(0x72e65bb3, 0x21273323), TOBN(0xbcc1badd, 0x6ea9886e)}, + {TOBN(0x0e223011, 0x4bc5ee85), TOBN(0xa561be74, 0xc18ee1e4), + TOBN(0x762fd2d4, 0xa6bcf1f1), TOBN(0x50e6a5a4, 0x95231489)}}, + {{TOBN(0xca96001f, 0xa00b500b), TOBN(0x5c098cfc, 0x5d7dcdf5), + TOBN(0xa64e2d2e, 0x8c446a85), TOBN(0xbae9bcf1, 0x971f3c62)}, + {TOBN(0x4ec22683, 0x8435a2c5), TOBN(0x8ceaed6c, 0x4bad4643), + TOBN(0xe9f8fb47, 0xccccf4e3), TOBN(0xbd4f3fa4, 0x1ce3b21e)}}, + {{TOBN(0xd79fb110, 0xa3db3292), TOBN(0xe28a37da, 0xb536c66a), + TOBN(0x279ce87b, 0x8e49e6a9), TOBN(0x70ccfe8d, 0xfdcec8e3)}, + {TOBN(0x2193e4e0, 0x3ba464b2), TOBN(0x0f39d60e, 0xaca9a398), + TOBN(0x7d7932af, 0xf82c12ab), TOBN(0xd8ff50ed, 0x91e7e0f7)}}, + {{TOBN(0xea961058, 0xfa28a7e0), TOBN(0xc726cf25, 0x0bf5ec74), + TOBN(0xe74d55c8, 0xdb229666), TOBN(0x0bd9abbf, 0xa57f5799)}, + {TOBN(0x7479ef07, 0x4dfc47b3), TOBN(0xd9c65fc3, 0x0c52f91d), + TOBN(0x8e0283fe, 0x36a8bde2), TOBN(0xa32a8b5e, 0x7d4b7280)}}, + {{TOBN(0x6a677c61, 0x12e83233), TOBN(0x0fbb3512, 0xdcc9bf28), + TOBN(0x562e8ea5, 0x0d780f61), TOBN(0x0db8b22b, 0x1dc4e89c)}, + {TOBN(0x0a6fd1fb, 0x89be0144), TOBN(0x8c77d246, 0xca57113b), + TOBN(0x4639075d, 0xff09c91c), TOBN(0x5b47b17f, 0x5060824c)}}, + {{TOBN(0x58aea2b0, 0x16287b52), TOBN(0xa1343520, 0xd0cd8eb0), + TOBN(0x6148b4d0, 0xc5d58573), TOBN(0xdd2b6170, 0x291c68ae)}, + {TOBN(0xa61b3929, 0x1da3b3b7), TOBN(0x5f946d79, 0x08c4ac10), + TOBN(0x4105d4a5, 0x7217d583), TOBN(0x5061da3d, 0x25e6de5e)}}, + {{TOBN(0x3113940d, 0xec1b4991), TOBN(0xf12195e1, 0x36f485ae), + TOBN(0xa7507fb2, 0x731a2ee0), TOBN(0x95057a8e, 0x6e9e196e)}, + {TOBN(0xa3c2c911, 0x2e130136), TOBN(0x97dfbb36, 0x33c60d15), + TOBN(0xcaf3c581, 0xb300ee2b), TOBN(0x77f25d90, 0xf4bac8b8)}}, + {{TOBN(0xdb1c4f98, 0x6d840cd6), TOBN(0x471d62c0, 0xe634288c), + TOBN(0x8ec2f85e, 0xcec8a161), TOBN(0x41f37cbc, 0xfa6f4ae2)}, + {TOBN(0x6793a20f, 0x4b709985), TOBN(0x7a7bd33b, 0xefa8985b), + TOBN(0x2c6a3fbd, 0x938e6446), TOBN(0x19042619, 0x2a8d47c1)}}, + {{TOBN(0x16848667, 0xcc36975f), TOBN(0x02acf168, 0x9d5f1dfb), + TOBN(0x62d41ad4, 0x613baa94), TOBN(0xb56fbb92, 0x9f684670)}, + {TOBN(0xce610d0d, 0xe9e40569), TOBN(0x7b99c65f, 0x35489fef), + TOBN(0x0c88ad1b, 0x3df18b97), TOBN(0x81b7d9be, 0x5d0e9edb)}}, + {{TOBN(0xd85218c0, 0xc716cc0a), TOBN(0xf4b5ff90, 0x85691c49), + TOBN(0xa4fd666b, 0xce356ac6), TOBN(0x17c72895, 0x4b327a7a)}, + {TOBN(0xf93d5085, 0xda6be7de), TOBN(0xff71530e, 0x3301d34e), + TOBN(0x4cd96442, 0xd8f448e8), TOBN(0x9283d331, 0x2ed18ffa)}}, + {{TOBN(0x4d33dd99, 0x2a849870), TOBN(0xa716964b, 0x41576335), + TOBN(0xff5e3a9b, 0x179be0e5), TOBN(0x5b9d6b1b, 0x83b13632)}, + {TOBN(0x3b8bd7d4, 0xa52f313b), TOBN(0xc9dd95a0, 0x637a4660), + TOBN(0x30035962, 0x0b3e218f), TOBN(0xce1481a3, 0xc7b28a3c)}}, + {{TOBN(0xab41b43a, 0x43228d83), TOBN(0x24ae1c30, 0x4ad63f99), + TOBN(0x8e525f1a, 0x46a51229), TOBN(0x14af860f, 0xcd26d2b4)}, + {TOBN(0xd6baef61, 0x3f714aa1), TOBN(0xf51865ad, 0xeb78795e), + TOBN(0xd3e21fce, 0xe6a9d694), TOBN(0x82ceb1dd, 0x8a37b527)}}}}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back new file mode 100644 index 000000000..8246b11b9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64-table.h.grpc_back @@ -0,0 +1,9501 @@ +/* Copyright (c) 2015, Intel Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +// This is the precomputed constant time access table for the code in +// p256-x86_64.c, for the default generator. The table consists of 37 +// subtables, each subtable contains 64 affine points. The affine points are +// encoded as eight uint64's, four for the x coordinate and four for the y. +// Both values are in little-endian order. There are 37 tables because a +// signed, 6-bit wNAF form of the scalar is used and ceil(256/(6 + 1)) = 37. +// Within each table there are 64 values because the 6-bit wNAF value can take +// 64 values, ignoring the sign bit, which is implemented by performing a +// negation of the affine point when required. We would like to align it to 2MB +// in order to increase the chances of using a large page but that appears to +// lead to invalid ELF files being produced. + +// This file is generated by make_p256-x86_64-table.go. + +static const alignas(4096) PRECOMP256_ROW ecp_nistz256_precomputed[37] = { + {{{TOBN(0x79e730d4, 0x18a9143c), TOBN(0x75ba95fc, 0x5fedb601), + TOBN(0x79fb732b, 0x77622510), TOBN(0x18905f76, 0xa53755c6)}, + {TOBN(0xddf25357, 0xce95560a), TOBN(0x8b4ab8e4, 0xba19e45c), + TOBN(0xd2e88688, 0xdd21f325), TOBN(0x8571ff18, 0x25885d85)}}, + {{TOBN(0x850046d4, 0x10ddd64d), TOBN(0xaa6ae3c1, 0xa433827d), + TOBN(0x73220503, 0x8d1490d9), TOBN(0xf6bb32e4, 0x3dcf3a3b)}, + {TOBN(0x2f3648d3, 0x61bee1a5), TOBN(0x152cd7cb, 0xeb236ff8), + TOBN(0x19a8fb0e, 0x92042dbe), TOBN(0x78c57751, 0x0a5b8a3b)}}, + {{TOBN(0xffac3f90, 0x4eebc127), TOBN(0xb027f84a, 0x087d81fb), + TOBN(0x66ad77dd, 0x87cbbc98), TOBN(0x26936a3f, 0xb6ff747e)}, + {TOBN(0xb04c5c1f, 0xc983a7eb), TOBN(0x583e47ad, 0x0861fe1a), + TOBN(0x78820831, 0x1a2ee98e), TOBN(0xd5f06a29, 0xe587cc07)}}, + {{TOBN(0x74b0b50d, 0x46918dcc), TOBN(0x4650a6ed, 0xc623c173), + TOBN(0x0cdaacac, 0xe8100af2), TOBN(0x577362f5, 0x41b0176b)}, + {TOBN(0x2d96f24c, 0xe4cbaba6), TOBN(0x17628471, 0xfad6f447), + TOBN(0x6b6c36de, 0xe5ddd22e), TOBN(0x84b14c39, 0x4c5ab863)}}, + {{TOBN(0xbe1b8aae, 0xc45c61f5), TOBN(0x90ec649a, 0x94b9537d), + TOBN(0x941cb5aa, 0xd076c20c), TOBN(0xc9079605, 0x890523c8)}, + {TOBN(0xeb309b4a, 0xe7ba4f10), TOBN(0x73c568ef, 0xe5eb882b), + TOBN(0x3540a987, 0x7e7a1f68), TOBN(0x73a076bb, 0x2dd1e916)}}, + {{TOBN(0x40394737, 0x3e77664a), TOBN(0x55ae744f, 0x346cee3e), + TOBN(0xd50a961a, 0x5b17a3ad), TOBN(0x13074b59, 0x54213673)}, + {TOBN(0x93d36220, 0xd377e44b), TOBN(0x299c2b53, 0xadff14b5), + TOBN(0xf424d44c, 0xef639f11), TOBN(0xa4c9916d, 0x4a07f75f)}}, + {{TOBN(0x0746354e, 0xa0173b4f), TOBN(0x2bd20213, 0xd23c00f7), + TOBN(0xf43eaab5, 0x0c23bb08), TOBN(0x13ba5119, 0xc3123e03)}, + {TOBN(0x2847d030, 0x3f5b9d4d), TOBN(0x6742f2f2, 0x5da67bdd), + TOBN(0xef933bdc, 0x77c94195), TOBN(0xeaedd915, 0x6e240867)}}, + {{TOBN(0x27f14cd1, 0x9499a78f), TOBN(0x462ab5c5, 0x6f9b3455), + TOBN(0x8f90f02a, 0xf02cfc6b), TOBN(0xb763891e, 0xb265230d)}, + {TOBN(0xf59da3a9, 0x532d4977), TOBN(0x21e3327d, 0xcf9eba15), + TOBN(0x123c7b84, 0xbe60bbf0), TOBN(0x56ec12f2, 0x7706df76)}}, + {{TOBN(0x75c96e8f, 0x264e20e8), TOBN(0xabe6bfed, 0x59a7a841), + TOBN(0x2cc09c04, 0x44c8eb00), TOBN(0xe05b3080, 0xf0c4e16b)}, + {TOBN(0x1eb7777a, 0xa45f3314), TOBN(0x56af7bed, 0xce5d45e3), + TOBN(0x2b6e019a, 0x88b12f1a), TOBN(0x086659cd, 0xfd835f9b)}}, + {{TOBN(0x2c18dbd1, 0x9dc21ec8), TOBN(0x98f9868a, 0x0fcf8139), + TOBN(0x737d2cd6, 0x48250b49), TOBN(0xcc61c947, 0x24b3428f)}, + {TOBN(0x0c2b4078, 0x80dd9e76), TOBN(0xc43a8991, 0x383fbe08), + TOBN(0x5f7d2d65, 0x779be5d2), TOBN(0x78719a54, 0xeb3b4ab5)}}, + {{TOBN(0xea7d260a, 0x6245e404), TOBN(0x9de40795, 0x6e7fdfe0), + TOBN(0x1ff3a415, 0x8dac1ab5), TOBN(0x3e7090f1, 0x649c9073)}, + {TOBN(0x1a768561, 0x2b944e88), TOBN(0x250f939e, 0xe57f61c8), + TOBN(0x0c0daa89, 0x1ead643d), TOBN(0x68930023, 0xe125b88e)}}, + {{TOBN(0x04b71aa7, 0xd2697768), TOBN(0xabdedef5, 0xca345a33), + TOBN(0x2409d29d, 0xee37385e), TOBN(0x4ee1df77, 0xcb83e156)}, + {TOBN(0x0cac12d9, 0x1cbb5b43), TOBN(0x170ed2f6, 0xca895637), + TOBN(0x28228cfa, 0x8ade6d66), TOBN(0x7ff57c95, 0x53238aca)}}, + {{TOBN(0xccc42563, 0x4b2ed709), TOBN(0x0e356769, 0x856fd30d), + TOBN(0xbcbcd43f, 0x559e9811), TOBN(0x738477ac, 0x5395b759)}, + {TOBN(0x35752b90, 0xc00ee17f), TOBN(0x68748390, 0x742ed2e3), + TOBN(0x7cd06422, 0xbd1f5bc1), TOBN(0xfbc08769, 0xc9e7b797)}}, + {{TOBN(0xa242a35b, 0xb0cf664a), TOBN(0x126e48f7, 0x7f9707e3), + TOBN(0x1717bf54, 0xc6832660), TOBN(0xfaae7332, 0xfd12c72e)}, + {TOBN(0x27b52db7, 0x995d586b), TOBN(0xbe29569e, 0x832237c2), + TOBN(0xe8e4193e, 0x2a65e7db), TOBN(0x152706dc, 0x2eaa1bbb)}}, + {{TOBN(0x72bcd8b7, 0xbc60055b), TOBN(0x03cc23ee, 0x56e27e4b), + TOBN(0xee337424, 0xe4819370), TOBN(0xe2aa0e43, 0x0ad3da09)}, + {TOBN(0x40b8524f, 0x6383c45d), TOBN(0xd7663554, 0x42a41b25), + TOBN(0x64efa6de, 0x778a4797), TOBN(0x2042170a, 0x7079adf4)}}, + {{TOBN(0x808b0b65, 0x0bc6fb80), TOBN(0x5882e075, 0x3ffe2e6b), + TOBN(0xd5ef2f7c, 0x2c83f549), TOBN(0x54d63c80, 0x9103b723)}, + {TOBN(0xf2f11bd6, 0x52a23f9b), TOBN(0x3670c319, 0x4b0b6587), + TOBN(0x55c4623b, 0xb1580e9e), TOBN(0x64edf7b2, 0x01efe220)}}, + {{TOBN(0x97091dcb, 0xd53c5c9d), TOBN(0xf17624b6, 0xac0a177b), + TOBN(0xb0f13975, 0x2cfe2dff), TOBN(0xc1a35c0a, 0x6c7a574e)}, + {TOBN(0x227d3146, 0x93e79987), TOBN(0x0575bf30, 0xe89cb80e), + TOBN(0x2f4e247f, 0x0d1883bb), TOBN(0xebd51226, 0x3274c3d0)}}, + {{TOBN(0x5f3e51c8, 0x56ada97a), TOBN(0x4afc964d, 0x8f8b403e), + TOBN(0xa6f247ab, 0x412e2979), TOBN(0x675abd1b, 0x6f80ebda)}, + {TOBN(0x66a2bd72, 0x5e485a1d), TOBN(0x4b2a5caf, 0x8f4f0b3c), + TOBN(0x2626927f, 0x1b847bba), TOBN(0x6c6fc7d9, 0x0502394d)}}, + {{TOBN(0xfea912ba, 0xa5659ae8), TOBN(0x68363aba, 0x25e1a16e), + TOBN(0xb8842277, 0x752c41ac), TOBN(0xfe545c28, 0x2897c3fc)}, + {TOBN(0x2d36e9e7, 0xdc4c696b), TOBN(0x5806244a, 0xfba977c5), + TOBN(0x85665e9b, 0xe39508c1), TOBN(0xf720ee25, 0x6d12597b)}}, + {{TOBN(0x8a979129, 0xd2337a31), TOBN(0x5916868f, 0x0f862bdc), + TOBN(0x048099d9, 0x5dd283ba), TOBN(0xe2d1eeb6, 0xfe5bfb4e)}, + {TOBN(0x82ef1c41, 0x7884005d), TOBN(0xa2d4ec17, 0xffffcbae), + TOBN(0x9161c53f, 0x8aa95e66), TOBN(0x5ee104e1, 0xc5fee0d0)}}, + {{TOBN(0x562e4cec, 0xc135b208), TOBN(0x74e1b265, 0x4783f47d), + TOBN(0x6d2a506c, 0x5a3f3b30), TOBN(0xecead9f4, 0xc16762fc)}, + {TOBN(0xf29dd4b2, 0xe286e5b9), TOBN(0x1b0fadc0, 0x83bb3c61), + TOBN(0x7a75023e, 0x7fac29a4), TOBN(0xc086d5f1, 0xc9477fa3)}}, + {{TOBN(0x0fc61135, 0x2f6f3076), TOBN(0xc99ffa23, 0xe3912a9a), + TOBN(0x6a0b0685, 0xd2f8ba3d), TOBN(0xfdc777e8, 0xe93358a4)}, + {TOBN(0x94a787bb, 0x35415f04), TOBN(0x640c2d6a, 0x4d23fea4), + TOBN(0x9de917da, 0x153a35b5), TOBN(0x793e8d07, 0x5d5cd074)}}, + {{TOBN(0xf4f87653, 0x2de45068), TOBN(0x37c7a7e8, 0x9e2e1f6e), + TOBN(0xd0825fa2, 0xa3584069), TOBN(0xaf2cea7c, 0x1727bf42)}, + {TOBN(0x0360a4fb, 0x9e4785a9), TOBN(0xe5fda49c, 0x27299f4a), + TOBN(0x48068e13, 0x71ac2f71), TOBN(0x83d0687b, 0x9077666f)}}, + {{TOBN(0x6d3883b2, 0x15d02819), TOBN(0x6d0d7550, 0x40dd9a35), + TOBN(0x61d7cbf9, 0x1d2b469f), TOBN(0xf97b232f, 0x2efc3115)}, + {TOBN(0xa551d750, 0xb24bcbc7), TOBN(0x11ea4949, 0x88a1e356), + TOBN(0x7669f031, 0x93cb7501), TOBN(0x595dc55e, 0xca737b8a)}}, + {{TOBN(0xa4a319ac, 0xd837879f), TOBN(0x6fc1b49e, 0xed6b67b0), + TOBN(0xe3959933, 0x32f1f3af), TOBN(0x966742eb, 0x65432a2e)}, + {TOBN(0x4b8dc9fe, 0xb4966228), TOBN(0x96cc6312, 0x43f43950), + TOBN(0x12068859, 0xc9b731ee), TOBN(0x7b948dc3, 0x56f79968)}}, + {{TOBN(0x61e4ad32, 0xed1f8008), TOBN(0xe6c9267a, 0xd8b17538), + TOBN(0x1ac7c5eb, 0x857ff6fb), TOBN(0x994baaa8, 0x55f2fb10)}, + {TOBN(0x84cf14e1, 0x1d248018), TOBN(0x5a39898b, 0x628ac508), + TOBN(0x14fde97b, 0x5fa944f5), TOBN(0xed178030, 0xd12e5ac7)}}, + {{TOBN(0x042c2af4, 0x97e2feb4), TOBN(0xd36a42d7, 0xaebf7313), + TOBN(0x49d2c9eb, 0x084ffdd7), TOBN(0x9f8aa54b, 0x2ef7c76a)}, + {TOBN(0x9200b7ba, 0x09895e70), TOBN(0x3bd0c66f, 0xddb7fb58), + TOBN(0x2d97d108, 0x78eb4cbb), TOBN(0x2d431068, 0xd84bde31)}}, + {{TOBN(0x4b523eb7, 0x172ccd1f), TOBN(0x7323cb28, 0x30a6a892), + TOBN(0x97082ec0, 0xcfe153eb), TOBN(0xe97f6b6a, 0xf2aadb97)}, + {TOBN(0x1d3d393e, 0xd1a83da1), TOBN(0xa6a7f9c7, 0x804b2a68), + TOBN(0x4a688b48, 0x2d0cb71e), TOBN(0xa9b4cc5f, 0x40585278)}}, + {{TOBN(0x5e5db46a, 0xcb66e132), TOBN(0xf1be963a, 0x0d925880), + TOBN(0x944a7027, 0x0317b9e2), TOBN(0xe266f959, 0x48603d48)}, + {TOBN(0x98db6673, 0x5c208899), TOBN(0x90472447, 0xa2fb18a3), + TOBN(0x8a966939, 0x777c619f), TOBN(0x3798142a, 0x2a3be21b)}}, + {{TOBN(0xb4241cb1, 0x3298b343), TOBN(0xa3a14e49, 0xb44f65a1), + TOBN(0xc5f4d6cd, 0x3ac77acd), TOBN(0xd0288cb5, 0x52b6fc3c)}, + {TOBN(0xd5cc8c2f, 0x1c040abc), TOBN(0xb675511e, 0x06bf9b4a), + TOBN(0xd667da37, 0x9b3aa441), TOBN(0x460d45ce, 0x51601f72)}}, + {{TOBN(0xe2f73c69, 0x6755ff89), TOBN(0xdd3cf7e7, 0x473017e6), + TOBN(0x8ef5689d, 0x3cf7600d), TOBN(0x948dc4f8, 0xb1fc87b4)}, + {TOBN(0xd9e9fe81, 0x4ea53299), TOBN(0x2d921ca2, 0x98eb6028), + TOBN(0xfaecedfd, 0x0c9803fc), TOBN(0xf38ae891, 0x4d7b4745)}}, + {{TOBN(0xd8c5fccf, 0xc5e3a3d8), TOBN(0xbefd904c, 0x4079dfbf), + TOBN(0xbc6d6a58, 0xfead0197), TOBN(0x39227077, 0x695532a4)}, + {TOBN(0x09e23e6d, 0xdbef42f5), TOBN(0x7e449b64, 0x480a9908), + TOBN(0x7b969c1a, 0xad9a2e40), TOBN(0x6231d792, 0x9591c2a4)}}, + {{TOBN(0x87151456, 0x0f664534), TOBN(0x85ceae7c, 0x4b68f103), + TOBN(0xac09c4ae, 0x65578ab9), TOBN(0x33ec6868, 0xf044b10c)}, + {TOBN(0x6ac4832b, 0x3a8ec1f1), TOBN(0x5509d128, 0x5847d5ef), + TOBN(0xf909604f, 0x763f1574), TOBN(0xb16c4303, 0xc32f63c4)}}, + {{TOBN(0xb6ab2014, 0x7ca23cd3), TOBN(0xcaa7a5c6, 0xa391849d), + TOBN(0x5b0673a3, 0x75678d94), TOBN(0xc982ddd4, 0xdd303e64)}, + {TOBN(0xfd7b000b, 0x5db6f971), TOBN(0xbba2cb1f, 0x6f876f92), + TOBN(0xc77332a3, 0x3c569426), TOBN(0xa159100c, 0x570d74f8)}}, + {{TOBN(0xfd16847f, 0xdec67ef5), TOBN(0x742ee464, 0x233e76b7), + TOBN(0x0b8e4134, 0xefc2b4c8), TOBN(0xca640b86, 0x42a3e521)}, + {TOBN(0x653a0190, 0x8ceb6aa9), TOBN(0x313c300c, 0x547852d5), + TOBN(0x24e4ab12, 0x6b237af7), TOBN(0x2ba90162, 0x8bb47af8)}}, + {{TOBN(0x3d5e58d6, 0xa8219bb7), TOBN(0xc691d0bd, 0x1b06c57f), + TOBN(0x0ae4cb10, 0xd257576e), TOBN(0x3569656c, 0xd54a3dc3)}, + {TOBN(0xe5ebaebd, 0x94cda03a), TOBN(0x934e82d3, 0x162bfe13), + TOBN(0x450ac0ba, 0xe251a0c6), TOBN(0x480b9e11, 0xdd6da526)}}, + {{TOBN(0x00467bc5, 0x8cce08b5), TOBN(0xb636458c, 0x7f178d55), + TOBN(0xc5748bae, 0xa677d806), TOBN(0x2763a387, 0xdfa394eb)}, + {TOBN(0xa12b448a, 0x7d3cebb6), TOBN(0xe7adda3e, 0x6f20d850), + TOBN(0xf63ebce5, 0x1558462c), TOBN(0x58b36143, 0x620088a8)}}, + {{TOBN(0x8a2cc3ca, 0x4d63c0ee), TOBN(0x51233117, 0x0fe948ce), + TOBN(0x7463fd85, 0x222ef33b), TOBN(0xadf0c7dc, 0x7c603d6c)}, + {TOBN(0x0ec32d3b, 0xfe7765e5), TOBN(0xccaab359, 0xbf380409), + TOBN(0xbdaa84d6, 0x8e59319c), TOBN(0xd9a4c280, 0x9c80c34d)}}, + {{TOBN(0xa9d89488, 0xa059c142), TOBN(0x6f5ae714, 0xff0b9346), + TOBN(0x068f237d, 0x16fb3664), TOBN(0x5853e4c4, 0x363186ac)}, + {TOBN(0xe2d87d23, 0x63c52f98), TOBN(0x2ec4a766, 0x81828876), + TOBN(0x47b864fa, 0xe14e7b1c), TOBN(0x0c0bc0e5, 0x69192408)}}, + {{TOBN(0xe4d7681d, 0xb82e9f3e), TOBN(0x83200f0b, 0xdf25e13c), + TOBN(0x8909984c, 0x66f27280), TOBN(0x462d7b00, 0x75f73227)}, + {TOBN(0xd90ba188, 0xf2651798), TOBN(0x74c6e18c, 0x36ab1c34), + TOBN(0xab256ea3, 0x5ef54359), TOBN(0x03466612, 0xd1aa702f)}}, + {{TOBN(0x624d6049, 0x2ed22e91), TOBN(0x6fdfe0b5, 0x6f072822), + TOBN(0xeeca1115, 0x39ce2271), TOBN(0x98100a4f, 0xdb01614f)}, + {TOBN(0xb6b0daa2, 0xa35c628f), TOBN(0xb6f94d2e, 0xc87e9a47), + TOBN(0xc6773259, 0x1d57d9ce), TOBN(0xf70bfeec, 0x03884a7b)}}, + {{TOBN(0x5fb35ccf, 0xed2bad01), TOBN(0xa155cbe3, 0x1da6a5c7), + TOBN(0xc2e2594c, 0x30a92f8f), TOBN(0x649c89ce, 0x5bfafe43)}, + {TOBN(0xd158667d, 0xe9ff257a), TOBN(0x9b359611, 0xf32c50ae), + TOBN(0x4b00b20b, 0x906014cf), TOBN(0xf3a8cfe3, 0x89bc7d3d)}}, + {{TOBN(0x4ff23ffd, 0x248a7d06), TOBN(0x80c5bfb4, 0x878873fa), + TOBN(0xb7d9ad90, 0x05745981), TOBN(0x179c85db, 0x3db01994)}, + {TOBN(0xba41b062, 0x61a6966c), TOBN(0x4d82d052, 0xeadce5a8), + TOBN(0x9e91cd3b, 0xa5e6a318), TOBN(0x47795f4f, 0x95b2dda0)}}, + {{TOBN(0xecfd7c1f, 0xd55a897c), TOBN(0x009194ab, 0xb29110fb), + TOBN(0x5f0e2046, 0xe381d3b0), TOBN(0x5f3425f6, 0xa98dd291)}, + {TOBN(0xbfa06687, 0x730d50da), TOBN(0x0423446c, 0x4b083b7f), + TOBN(0x397a247d, 0xd69d3417), TOBN(0xeb629f90, 0x387ba42a)}}, + {{TOBN(0x1ee426cc, 0xd5cd79bf), TOBN(0x0032940b, 0x946c6e18), + TOBN(0x1b1e8ae0, 0x57477f58), TOBN(0xe94f7d34, 0x6d823278)}, + {TOBN(0xc747cb96, 0x782ba21a), TOBN(0xc5254469, 0xf72b33a5), + TOBN(0x772ef6de, 0xc7f80c81), TOBN(0xd73acbfe, 0x2cd9e6b5)}}, + {{TOBN(0x4075b5b1, 0x49ee90d9), TOBN(0x785c339a, 0xa06e9eba), + TOBN(0xa1030d5b, 0xabf825e0), TOBN(0xcec684c3, 0xa42931dc)}, + {TOBN(0x42ab62c9, 0xc1586e63), TOBN(0x45431d66, 0x5ab43f2b), + TOBN(0x57c8b2c0, 0x55f7835d), TOBN(0x033da338, 0xc1b7f865)}}, + {{TOBN(0x283c7513, 0xcaa76097), TOBN(0x0a624fa9, 0x36c83906), + TOBN(0x6b20afec, 0x715af2c7), TOBN(0x4b969974, 0xeba78bfd)}, + {TOBN(0x220755cc, 0xd921d60e), TOBN(0x9b944e10, 0x7baeca13), + TOBN(0x04819d51, 0x5ded93d4), TOBN(0x9bbff86e, 0x6dddfd27)}}, + {{TOBN(0x6b344130, 0x77adc612), TOBN(0xa7496529, 0xbbd803a0), + TOBN(0x1a1baaa7, 0x6d8805bd), TOBN(0xc8403902, 0x470343ad)}, + {TOBN(0x39f59f66, 0x175adff1), TOBN(0x0b26d7fb, 0xb7d8c5b7), + TOBN(0xa875f5ce, 0x529d75e3), TOBN(0x85efc7e9, 0x41325cc2)}}, + {{TOBN(0x21950b42, 0x1ff6acd3), TOBN(0xffe70484, 0x53dc6909), + TOBN(0xff4cd0b2, 0x28766127), TOBN(0xabdbe608, 0x4fb7db2b)}, + {TOBN(0x837c9228, 0x5e1109e8), TOBN(0x26147d27, 0xf4645b5a), + TOBN(0x4d78f592, 0xf7818ed8), TOBN(0xd394077e, 0xf247fa36)}}, + {{TOBN(0x0fb9c2d0, 0x488c171a), TOBN(0xa78bfbaa, 0x13685278), + TOBN(0xedfbe268, 0xd5b1fa6a), TOBN(0x0dceb8db, 0x2b7eaba7)}, + {TOBN(0xbf9e8089, 0x9ae2b710), TOBN(0xefde7ae6, 0xa4449c96), + TOBN(0x43b7716b, 0xcc143a46), TOBN(0xd7d34194, 0xc3628c13)}}, + {{TOBN(0x508cec1c, 0x3b3f64c9), TOBN(0xe20bc0ba, 0x1e5edf3f), + TOBN(0xda1deb85, 0x2f4318d4), TOBN(0xd20ebe0d, 0x5c3fa443)}, + {TOBN(0x370b4ea7, 0x73241ea3), TOBN(0x61f1511c, 0x5e1a5f65), + TOBN(0x99a5e23d, 0x82681c62), TOBN(0xd731e383, 0xa2f54c2d)}}, + {{TOBN(0x2692f36e, 0x83445904), TOBN(0x2e0ec469, 0xaf45f9c0), + TOBN(0x905a3201, 0xc67528b7), TOBN(0x88f77f34, 0xd0e5e542)}, + {TOBN(0xf67a8d29, 0x5864687c), TOBN(0x23b92eae, 0x22df3562), + TOBN(0x5c27014b, 0x9bbec39e), TOBN(0x7ef2f226, 0x9c0f0f8d)}}, + {{TOBN(0x97359638, 0x546c4d8d), TOBN(0x5f9c3fc4, 0x92f24679), + TOBN(0x912e8bed, 0xa8c8acd9), TOBN(0xec3a318d, 0x306634b0)}, + {TOBN(0x80167f41, 0xc31cb264), TOBN(0x3db82f6f, 0x522113f2), + TOBN(0xb155bcd2, 0xdcafe197), TOBN(0xfba1da59, 0x43465283)}}, + {{TOBN(0xa0425b8e, 0xb212cf53), TOBN(0x4f2e512e, 0xf8557c5f), + TOBN(0xc1286ff9, 0x25c4d56c), TOBN(0xbb8a0fea, 0xee26c851)}, + {TOBN(0xc28f70d2, 0xe7d6107e), TOBN(0x7ee0c444, 0xe76265aa), + TOBN(0x3df277a4, 0x1d1936b1), TOBN(0x1a556e3f, 0xea9595eb)}}, + {{TOBN(0x258bbbf9, 0xe7305683), TOBN(0x31eea5bf, 0x07ef5be6), + TOBN(0x0deb0e4a, 0x46c814c1), TOBN(0x5cee8449, 0xa7b730dd)}, + {TOBN(0xeab495c5, 0xa0182bde), TOBN(0xee759f87, 0x9e27a6b4), + TOBN(0xc2cf6a68, 0x80e518ca), TOBN(0x25e8013f, 0xf14cf3f4)}}, + {{TOBN(0x8fc44140, 0x7e8d7a14), TOBN(0xbb1ff3ca, 0x9556f36a), + TOBN(0x6a844385, 0x14600044), TOBN(0xba3f0c4a, 0x7451ae63)}, + {TOBN(0xdfcac25b, 0x1f9af32a), TOBN(0x01e0db86, 0xb1f2214b), + TOBN(0x4e9a5bc2, 0xa4b596ac), TOBN(0x83927681, 0x026c2c08)}}, + {{TOBN(0x3ec832e7, 0x7acaca28), TOBN(0x1bfeea57, 0xc7385b29), + TOBN(0x068212e3, 0xfd1eaf38), TOBN(0xc1329830, 0x6acf8ccc)}, + {TOBN(0xb909f2db, 0x2aac9e59), TOBN(0x5748060d, 0xb661782a), + TOBN(0xc5ab2632, 0xc79b7a01), TOBN(0xda44c6c6, 0x00017626)}}, + {{TOBN(0xf26c00e8, 0xa7ea82f0), TOBN(0x99cac80d, 0xe4299aaf), + TOBN(0xd66fe3b6, 0x7ed78be1), TOBN(0x305f725f, 0x648d02cd)}, + {TOBN(0x33ed1bc4, 0x623fb21b), TOBN(0xfa70533e, 0x7a6319ad), + TOBN(0x17ab562d, 0xbe5ffb3e), TOBN(0x06374994, 0x56674741)}}, + {{TOBN(0x69d44ed6, 0x5c46aa8e), TOBN(0x2100d5d3, 0xa8d063d1), + TOBN(0xcb9727ea, 0xa2d17c36), TOBN(0x4c2bab1b, 0x8add53b7)}, + {TOBN(0xa084e90c, 0x15426704), TOBN(0x778afcd3, 0xa837ebea), + TOBN(0x6651f701, 0x7ce477f8), TOBN(0xa0624998, 0x46fb7a8b)}}, + {{TOBN(0xdc1e6828, 0xed8a6e19), TOBN(0x33fc2336, 0x4189d9c7), + TOBN(0x026f8fe2, 0x671c39bc), TOBN(0xd40c4ccd, 0xbc6f9915)}, + {TOBN(0xafa135bb, 0xf80e75ca), TOBN(0x12c651a0, 0x22adff2c), + TOBN(0xc40a04bd, 0x4f51ad96), TOBN(0x04820109, 0xbbe4e832)}}, + {{TOBN(0x3667eb1a, 0x7f4c04cc), TOBN(0x59556621, 0xa9404f84), + TOBN(0x71cdf653, 0x7eceb50a), TOBN(0x994a44a6, 0x9b8335fa)}, + {TOBN(0xd7faf819, 0xdbeb9b69), TOBN(0x473c5680, 0xeed4350d), + TOBN(0xb6658466, 0xda44bba2), TOBN(0x0d1bc780, 0x872bdbf3)}}, + {{TOBN(0xe535f175, 0xa1962f91), TOBN(0x6ed7e061, 0xed58f5a7), + TOBN(0x177aa4c0, 0x2089a233), TOBN(0x0dbcb03a, 0xe539b413)}, + {TOBN(0xe3dc424e, 0xbb32e38e), TOBN(0x6472e5ef, 0x6806701e), + TOBN(0xdd47ff98, 0x814be9ee), TOBN(0x6b60cfff, 0x35ace009)}}, + {{TOBN(0xb8d3d931, 0x9ff91fe5), TOBN(0x039c4800, 0xf0518eed), + TOBN(0x95c37632, 0x9182cb26), TOBN(0x0763a434, 0x82fc568d)}, + {TOBN(0x707c04d5, 0x383e76ba), TOBN(0xac98b930, 0x824e8197), + TOBN(0x92bf7c8f, 0x91230de0), TOBN(0x90876a01, 0x40959b70)}}, + {{TOBN(0xdb6d96f3, 0x05968b80), TOBN(0x380a0913, 0x089f73b9), + TOBN(0x7da70b83, 0xc2c61e01), TOBN(0x95fb8394, 0x569b38c7)}, + {TOBN(0x9a3c6512, 0x80edfe2f), TOBN(0x8f726bb9, 0x8faeaf82), + TOBN(0x8010a4a0, 0x78424bf8), TOBN(0x29672044, 0x0e844970)}}}, + {{{TOBN(0x63c5cb81, 0x7a2ad62a), TOBN(0x7ef2b6b9, 0xac62ff54), + TOBN(0x3749bba4, 0xb3ad9db5), TOBN(0xad311f2c, 0x46d5a617)}, + {TOBN(0xb77a8087, 0xc2ff3b6d), TOBN(0xb46feaf3, 0x367834ff), + TOBN(0xf8aa266d, 0x75d6b138), TOBN(0xfa38d320, 0xec008188)}}, + {{TOBN(0x486d8ffa, 0x696946fc), TOBN(0x50fbc6d8, 0xb9cba56d), + TOBN(0x7e3d423e, 0x90f35a15), TOBN(0x7c3da195, 0xc0dd962c)}, + {TOBN(0xe673fdb0, 0x3cfd5d8b), TOBN(0x0704b7c2, 0x889dfca5), + TOBN(0xf6ce581f, 0xf52305aa), TOBN(0x399d49eb, 0x914d5e53)}}, + {{TOBN(0x380a496d, 0x6ec293cd), TOBN(0x733dbda7, 0x8e7051f5), + TOBN(0x037e388d, 0xb849140a), TOBN(0xee4b32b0, 0x5946dbf6)}, + {TOBN(0xb1c4fda9, 0xcae368d1), TOBN(0x5001a7b0, 0xfdb0b2f3), + TOBN(0x6df59374, 0x2e3ac46e), TOBN(0x4af675f2, 0x39b3e656)}}, + {{TOBN(0x44e38110, 0x39949296), TOBN(0x5b63827b, 0x361db1b5), + TOBN(0x3e5323ed, 0x206eaff5), TOBN(0x942370d2, 0xc21f4290)}, + {TOBN(0xf2caaf2e, 0xe0d985a1), TOBN(0x192cc64b, 0x7239846d), + TOBN(0x7c0b8f47, 0xae6312f8), TOBN(0x7dc61f91, 0x96620108)}}, + {{TOBN(0xb830fb5b, 0xc2da7de9), TOBN(0xd0e643df, 0x0ff8d3be), + TOBN(0x31ee77ba, 0x188a9641), TOBN(0x4e8aa3aa, 0xbcf6d502)}, + {TOBN(0xf9fb6532, 0x9a49110f), TOBN(0xd18317f6, 0x2dd6b220), + TOBN(0x7e3ced41, 0x52c3ea5a), TOBN(0x0d296a14, 0x7d579c4a)}}, + {{TOBN(0x35d6a53e, 0xed4c3717), TOBN(0x9f8240cf, 0x3d0ed2a3), + TOBN(0x8c0d4d05, 0xe5543aa5), TOBN(0x45d5bbfb, 0xdd33b4b4)}, + {TOBN(0xfa04cc73, 0x137fd28e), TOBN(0x862ac6ef, 0xc73b3ffd), + TOBN(0x403ff9f5, 0x31f51ef2), TOBN(0x34d5e0fc, 0xbc73f5a2)}}, + {{TOBN(0xf2526820, 0x08913f4f), TOBN(0xea20ed61, 0xeac93d95), + TOBN(0x51ed38b4, 0x6ca6b26c), TOBN(0x8662dcbc, 0xea4327b0)}, + {TOBN(0x6daf295c, 0x725d2aaa), TOBN(0xbad2752f, 0x8e52dcda), + TOBN(0x2210e721, 0x0b17dacc), TOBN(0xa37f7912, 0xd51e8232)}}, + {{TOBN(0x4f7081e1, 0x44cc3add), TOBN(0xd5ffa1d6, 0x87be82cf), + TOBN(0x89890b6c, 0x0edd6472), TOBN(0xada26e1a, 0x3ed17863)}, + {TOBN(0x276f2715, 0x63483caa), TOBN(0xe6924cd9, 0x2f6077fd), + TOBN(0x05a7fe98, 0x0a466e3c), TOBN(0xf1c794b0, 0xb1902d1f)}}, + {{TOBN(0xe5213688, 0x82a8042c), TOBN(0xd931cfaf, 0xcd278298), + TOBN(0x069a0ae0, 0xf597a740), TOBN(0x0adbb3f3, 0xeb59107c)}, + {TOBN(0x983e951e, 0x5eaa8eb8), TOBN(0xe663a8b5, 0x11b48e78), + TOBN(0x1631cc0d, 0x8a03f2c5), TOBN(0x7577c11e, 0x11e271e2)}}, + {{TOBN(0x33b2385c, 0x08369a90), TOBN(0x2990c59b, 0x190eb4f8), + TOBN(0x819a6145, 0xc68eac80), TOBN(0x7a786d62, 0x2ec4a014)}, + {TOBN(0x33faadbe, 0x20ac3a8d), TOBN(0x31a21781, 0x5aba2d30), + TOBN(0x209d2742, 0xdba4f565), TOBN(0xdb2ce9e3, 0x55aa0fbb)}}, + {{TOBN(0x8cef334b, 0x168984df), TOBN(0xe81dce17, 0x33879638), + TOBN(0xf6e6949c, 0x263720f0), TOBN(0x5c56feaf, 0xf593cbec)}, + {TOBN(0x8bff5601, 0xfde58c84), TOBN(0x74e24117, 0x2eccb314), + TOBN(0xbcf01b61, 0x4c9a8a78), TOBN(0xa233e35e, 0x544c9868)}}, + {{TOBN(0xb3156bf3, 0x8bd7aff1), TOBN(0x1b5ee4cb, 0x1d81b146), + TOBN(0x7ba1ac41, 0xd628a915), TOBN(0x8f3a8f9c, 0xfd89699e)}, + {TOBN(0x7329b9c9, 0xa0748be7), TOBN(0x1d391c95, 0xa92e621f), + TOBN(0xe51e6b21, 0x4d10a837), TOBN(0xd255f53a, 0x4947b435)}}, + {{TOBN(0x07669e04, 0xf1788ee3), TOBN(0xc14f27af, 0xa86938a2), + TOBN(0x8b47a334, 0xe93a01c0), TOBN(0xff627438, 0xd9366808)}, + {TOBN(0x7a0985d8, 0xca2a5965), TOBN(0x3d9a5542, 0xd6e9b9b3), + TOBN(0xc23eb80b, 0x4cf972e8), TOBN(0x5c1c33bb, 0x4fdf72fd)}}, + {{TOBN(0x0c4a58d4, 0x74a86108), TOBN(0xf8048a8f, 0xee4c5d90), + TOBN(0xe3c7c924, 0xe86d4c80), TOBN(0x28c889de, 0x056a1e60)}, + {TOBN(0x57e2662e, 0xb214a040), TOBN(0xe8c48e98, 0x37e10347), + TOBN(0x87742862, 0x80ac748a), TOBN(0xf1c24022, 0x186b06f2)}}, + {{TOBN(0xac2dd4c3, 0x5f74040a), TOBN(0x409aeb71, 0xfceac957), + TOBN(0x4fbad782, 0x55c4ec23), TOBN(0xb359ed61, 0x8a7b76ec)}, + {TOBN(0x12744926, 0xed6f4a60), TOBN(0xe21e8d7f, 0x4b912de3), + TOBN(0xe2575a59, 0xfc705a59), TOBN(0x72f1d4de, 0xed2dbc0e)}}, + {{TOBN(0x3d2b24b9, 0xeb7926b8), TOBN(0xbff88cb3, 0xcdbe5509), + TOBN(0xd0f399af, 0xe4dd640b), TOBN(0x3c5fe130, 0x2f76ed45)}, + {TOBN(0x6f3562f4, 0x3764fb3d), TOBN(0x7b5af318, 0x3151b62d), + TOBN(0xd5bd0bc7, 0xd79ce5f3), TOBN(0xfdaf6b20, 0xec66890f)}}, + {{TOBN(0x735c67ec, 0x6063540c), TOBN(0x50b259c2, 0xe5f9cb8f), + TOBN(0xb8734f9a, 0x3f99c6ab), TOBN(0xf8cc13d5, 0xa3a7bc85)}, + {TOBN(0x80c1b305, 0xc5217659), TOBN(0xfe5364d4, 0x4ec12a54), + TOBN(0xbd87045e, 0x681345fe), TOBN(0x7f8efeb1, 0x582f897f)}}, + {{TOBN(0xe8cbf1e5, 0xd5923359), TOBN(0xdb0cea9d, 0x539b9fb0), + TOBN(0x0c5b34cf, 0x49859b98), TOBN(0x5e583c56, 0xa4403cc6)}, + {TOBN(0x11fc1a2d, 0xd48185b7), TOBN(0xc93fbc7e, 0x6e521787), + TOBN(0x47e7a058, 0x05105b8b), TOBN(0x7b4d4d58, 0xdb8260c8)}}, + {{TOBN(0xe33930b0, 0x46eb842a), TOBN(0x8e844a9a, 0x7bdae56d), + TOBN(0x34ef3a9e, 0x13f7fdfc), TOBN(0xb3768f82, 0x636ca176)}, + {TOBN(0x2821f4e0, 0x4e09e61c), TOBN(0x414dc3a1, 0xa0c7cddc), + TOBN(0xd5379437, 0x54945fcd), TOBN(0x151b6eef, 0xb3555ff1)}}, + {{TOBN(0xb31bd613, 0x6339c083), TOBN(0x39ff8155, 0xdfb64701), + TOBN(0x7c3388d2, 0xe29604ab), TOBN(0x1e19084b, 0xa6b10442)}, + {TOBN(0x17cf54c0, 0xeccd47ef), TOBN(0x89693385, 0x4a5dfb30), + TOBN(0x69d023fb, 0x47daf9f6), TOBN(0x9222840b, 0x7d91d959)}}, + {{TOBN(0x439108f5, 0x803bac62), TOBN(0x0b7dd91d, 0x379bd45f), + TOBN(0xd651e827, 0xca63c581), TOBN(0x5c5d75f6, 0x509c104f)}, + {TOBN(0x7d5fc738, 0x1f2dc308), TOBN(0x20faa7bf, 0xd98454be), + TOBN(0x95374bee, 0xa517b031), TOBN(0xf036b9b1, 0x642692ac)}}, + {{TOBN(0xc5106109, 0x39842194), TOBN(0xb7e2353e, 0x49d05295), + TOBN(0xfc8c1d5c, 0xefb42ee0), TOBN(0xe04884eb, 0x08ce811c)}, + {TOBN(0xf1f75d81, 0x7419f40e), TOBN(0x5b0ac162, 0xa995c241), + TOBN(0x120921bb, 0xc4c55646), TOBN(0x713520c2, 0x8d33cf97)}}, + {{TOBN(0xb4a65a5c, 0xe98c5100), TOBN(0x6cec871d, 0x2ddd0f5a), + TOBN(0x251f0b7f, 0x9ba2e78b), TOBN(0x224a8434, 0xce3a2a5f)}, + {TOBN(0x26827f61, 0x25f5c46f), TOBN(0x6a22bedc, 0x48545ec0), + TOBN(0x25ae5fa0, 0xb1bb5cdc), TOBN(0xd693682f, 0xfcb9b98f)}}, + {{TOBN(0x32027fe8, 0x91e5d7d3), TOBN(0xf14b7d17, 0x73a07678), + TOBN(0xf88497b3, 0xc0dfdd61), TOBN(0xf7c2eec0, 0x2a8c4f48)}, + {TOBN(0xaa5573f4, 0x3756e621), TOBN(0xc013a240, 0x1825b948), + TOBN(0x1c03b345, 0x63878572), TOBN(0xa0472bea, 0x653a4184)}}, + {{TOBN(0xf4222e27, 0x0ac69a80), TOBN(0x34096d25, 0xf51e54f6), + TOBN(0x00a648cb, 0x8fffa591), TOBN(0x4e87acdc, 0x69b6527f)}, + {TOBN(0x0575e037, 0xe285ccb4), TOBN(0x188089e4, 0x50ddcf52), + TOBN(0xaa96c9a8, 0x870ff719), TOBN(0x74a56cd8, 0x1fc7e369)}}, + {{TOBN(0x41d04ee2, 0x1726931a), TOBN(0x0bbbb2c8, 0x3660ecfd), + TOBN(0xa6ef6de5, 0x24818e18), TOBN(0xe421cc51, 0xe7d57887)}, + {TOBN(0xf127d208, 0xbea87be6), TOBN(0x16a475d3, 0xb1cdd682), + TOBN(0x9db1b684, 0x439b63f7), TOBN(0x5359b3db, 0xf0f113b6)}}, + {{TOBN(0xdfccf1de, 0x8bf06e31), TOBN(0x1fdf8f44, 0xdd383901), + TOBN(0x10775cad, 0x5017e7d2), TOBN(0xdfc3a597, 0x58d11eef)}, + {TOBN(0x6ec9c8a0, 0xb1ecff10), TOBN(0xee6ed6cc, 0x28400549), + TOBN(0xb5ad7bae, 0x1b4f8d73), TOBN(0x61b4f11d, 0xe00aaab9)}}, + {{TOBN(0x7b32d69b, 0xd4eff2d7), TOBN(0x88ae6771, 0x4288b60f), + TOBN(0x159461b4, 0x37a1e723), TOBN(0x1f3d4789, 0x570aae8c)}, + {TOBN(0x869118c0, 0x7f9871da), TOBN(0x35fbda78, 0xf635e278), + TOBN(0x738f3641, 0xe1541dac), TOBN(0x6794b13a, 0xc0dae45f)}}, + {{TOBN(0x065064ac, 0x09cc0917), TOBN(0x27c53729, 0xc68540fd), + TOBN(0x0d2d4c8e, 0xef227671), TOBN(0xd23a9f80, 0xa1785a04)}, + {TOBN(0x98c59528, 0x52650359), TOBN(0xfa09ad01, 0x74a1acad), + TOBN(0x082d5a29, 0x0b55bf5c), TOBN(0xa40f1c67, 0x419b8084)}}, + {{TOBN(0x3a5c752e, 0xdcc18770), TOBN(0x4baf1f2f, 0x8825c3a5), + TOBN(0xebd63f74, 0x21b153ed), TOBN(0xa2383e47, 0xb2f64723)}, + {TOBN(0xe7bf620a, 0x2646d19a), TOBN(0x56cb44ec, 0x03c83ffd), + TOBN(0xaf7267c9, 0x4f6be9f1), TOBN(0x8b2dfd7b, 0xc06bb5e9)}}, + {{TOBN(0xb87072f2, 0xa672c5c7), TOBN(0xeacb11c8, 0x0d53c5e2), + TOBN(0x22dac29d, 0xff435932), TOBN(0x37bdb99d, 0x4408693c)}, + {TOBN(0xf6e62fb6, 0x2899c20f), TOBN(0x3535d512, 0x447ece24), + TOBN(0xfbdc6b88, 0xff577ce3), TOBN(0x726693bd, 0x190575f2)}}, + {{TOBN(0x6772b0e5, 0xab4b35a2), TOBN(0x1d8b6001, 0xf5eeaacf), + TOBN(0x728f7ce4, 0x795b9580), TOBN(0x4a20ed2a, 0x41fb81da)}, + {TOBN(0x9f685cd4, 0x4fec01e6), TOBN(0x3ed7ddcc, 0xa7ff50ad), + TOBN(0x460fd264, 0x0c2d97fd), TOBN(0x3a241426, 0xeb82f4f9)}}, + {{TOBN(0x17d1df2c, 0x6a8ea820), TOBN(0xb2b50d3b, 0xf22cc254), + TOBN(0x03856cba, 0xb7291426), TOBN(0x87fd26ae, 0x04f5ee39)}, + {TOBN(0x9cb696cc, 0x02bee4ba), TOBN(0x53121804, 0x06820fd6), + TOBN(0xa5dfc269, 0x0212e985), TOBN(0x666f7ffa, 0x160f9a09)}}, + {{TOBN(0xc503cd33, 0xbccd9617), TOBN(0x365dede4, 0xba7730a3), + TOBN(0x798c6355, 0x5ddb0786), TOBN(0xa6c3200e, 0xfc9cd3bc)}, + {TOBN(0x060ffb2c, 0xe5e35efd), TOBN(0x99a4e25b, 0x5555a1c1), + TOBN(0x11d95375, 0xf70b3751), TOBN(0x0a57354a, 0x160e1bf6)}}, + {{TOBN(0xecb3ae4b, 0xf8e4b065), TOBN(0x07a834c4, 0x2e53022b), + TOBN(0x1cd300b3, 0x8692ed96), TOBN(0x16a6f792, 0x61ee14ec)}, + {TOBN(0x8f1063c6, 0x6a8649ed), TOBN(0xfbcdfcfe, 0x869f3e14), + TOBN(0x2cfb97c1, 0x00a7b3ec), TOBN(0xcea49b3c, 0x7130c2f1)}}, + {{TOBN(0x462d044f, 0xe9d96488), TOBN(0x4b53d52e, 0x8182a0c1), + TOBN(0x84b6ddd3, 0x0391e9e9), TOBN(0x80ab7b48, 0xb1741a09)}, + {TOBN(0xec0e15d4, 0x27d3317f), TOBN(0x8dfc1ddb, 0x1a64671e), + TOBN(0x93cc5d5f, 0xd49c5b92), TOBN(0xc995d53d, 0x3674a331)}}, + {{TOBN(0x302e41ec, 0x090090ae), TOBN(0x2278a0cc, 0xedb06830), + TOBN(0x1d025932, 0xfbc99690), TOBN(0x0c32fbd2, 0xb80d68da)}, + {TOBN(0xd79146da, 0xf341a6c1), TOBN(0xae0ba139, 0x1bef68a0), + TOBN(0xc6b8a563, 0x8d774b3a), TOBN(0x1cf307bd, 0x880ba4d7)}}, + {{TOBN(0xc033bdc7, 0x19803511), TOBN(0xa9f97b3b, 0x8888c3be), + TOBN(0x3d68aebc, 0x85c6d05e), TOBN(0xc3b88a9d, 0x193919eb)}, + {TOBN(0x2d300748, 0xc48b0ee3), TOBN(0x7506bc7c, 0x07a746c1), + TOBN(0xfc48437c, 0x6e6d57f3), TOBN(0x5bd71587, 0xcfeaa91a)}}, + {{TOBN(0xa4ed0408, 0xc1bc5225), TOBN(0xd0b946db, 0x2719226d), + TOBN(0x109ecd62, 0x758d2d43), TOBN(0x75c8485a, 0x2751759b)}, + {TOBN(0xb0b75f49, 0x9ce4177a), TOBN(0x4fa61a1e, 0x79c10c3d), + TOBN(0xc062d300, 0xa167fcd7), TOBN(0x4df3874c, 0x750f0fa8)}}, + {{TOBN(0x29ae2cf9, 0x83dfedc9), TOBN(0xf8437134, 0x8d87631a), + TOBN(0xaf571711, 0x7429c8d2), TOBN(0x18d15867, 0x146d9272)}, + {TOBN(0x83053ecf, 0x69769bb7), TOBN(0xc55eb856, 0xc479ab82), + TOBN(0x5ef7791c, 0x21b0f4b2), TOBN(0xaa5956ba, 0x3d491525)}}, + {{TOBN(0x407a96c2, 0x9fe20eba), TOBN(0xf27168bb, 0xe52a5ad3), + TOBN(0x43b60ab3, 0xbf1d9d89), TOBN(0xe45c51ef, 0x710e727a)}, + {TOBN(0xdfca5276, 0x099b4221), TOBN(0x8dc6407c, 0x2557a159), + TOBN(0x0ead8335, 0x91035895), TOBN(0x0a9db957, 0x9c55dc32)}}, + {{TOBN(0xe40736d3, 0xdf61bc76), TOBN(0x13a619c0, 0x3f778cdb), + TOBN(0x6dd921a4, 0xc56ea28f), TOBN(0x76a52433, 0x2fa647b4)}, + {TOBN(0x23591891, 0xac5bdc5d), TOBN(0xff4a1a72, 0xbac7dc01), + TOBN(0x9905e261, 0x62df8453), TOBN(0x3ac045df, 0xe63b265f)}}, + {{TOBN(0x8a3f341b, 0xad53dba7), TOBN(0x8ec269cc, 0x837b625a), + TOBN(0xd71a2782, 0x3ae31189), TOBN(0x8fb4f9a3, 0x55e96120)}, + {TOBN(0x804af823, 0xff9875cf), TOBN(0x23224f57, 0x5d442a9b), + TOBN(0x1c4d3b9e, 0xecc62679), TOBN(0x91da22fb, 0xa0e7ddb1)}}, + {{TOBN(0xa370324d, 0x6c04a661), TOBN(0x9710d3b6, 0x5e376d17), + TOBN(0xed8c98f0, 0x3044e357), TOBN(0xc364ebbe, 0x6422701c)}, + {TOBN(0x347f5d51, 0x7733d61c), TOBN(0xd55644b9, 0xcea826c3), + TOBN(0x80c6e0ad, 0x55a25548), TOBN(0x0aa7641d, 0x844220a7)}}, + {{TOBN(0x1438ec81, 0x31810660), TOBN(0x9dfa6507, 0xde4b4043), + TOBN(0x10b515d8, 0xcc3e0273), TOBN(0x1b6066dd, 0x28d8cfb2)}, + {TOBN(0xd3b04591, 0x9c9efebd), TOBN(0x425d4bdf, 0xa21c1ff4), + TOBN(0x5fe5af19, 0xd57607d3), TOBN(0xbbf773f7, 0x54481084)}}, + {{TOBN(0x8435bd69, 0x94b03ed1), TOBN(0xd9ad1de3, 0x634cc546), + TOBN(0x2cf423fc, 0x00e420ca), TOBN(0xeed26d80, 0xa03096dd)}, + {TOBN(0xd7f60be7, 0xa4db09d2), TOBN(0xf47f569d, 0x960622f7), + TOBN(0xe5925fd7, 0x7296c729), TOBN(0xeff2db26, 0x26ca2715)}}, + {{TOBN(0xa6fcd014, 0xb913e759), TOBN(0x53da4786, 0x8ff4de93), + TOBN(0x14616d79, 0xc32068e1), TOBN(0xb187d664, 0xccdf352e)}, + {TOBN(0xf7afb650, 0x1dc90b59), TOBN(0x8170e943, 0x7daa1b26), + TOBN(0xc8e3bdd8, 0x700c0a84), TOBN(0x6e8d345f, 0x6482bdfa)}}, + {{TOBN(0x84cfbfa1, 0xc5c5ea50), TOBN(0xd3baf14c, 0x67960681), + TOBN(0x26398403, 0x0dd50942), TOBN(0xe4b7839c, 0x4716a663)}, + {TOBN(0xd5f1f794, 0xe7de6dc0), TOBN(0x5cd0f4d4, 0x622aa7ce), + TOBN(0x5295f3f1, 0x59acfeec), TOBN(0x8d933552, 0x953e0607)}}, + {{TOBN(0xc7db8ec5, 0x776c5722), TOBN(0xdc467e62, 0x2b5f290c), + TOBN(0xd4297e70, 0x4ff425a9), TOBN(0x4be924c1, 0x0cf7bb72)}, + {TOBN(0x0d5dc5ae, 0xa1892131), TOBN(0x8bf8a8e3, 0xa705c992), + TOBN(0x73a0b064, 0x7a305ac5), TOBN(0x00c9ca4e, 0x9a8c77a8)}}, + {{TOBN(0x5dfee80f, 0x83774bdd), TOBN(0x63131602, 0x85734485), + TOBN(0xa1b524ae, 0x914a69a9), TOBN(0xebc2ffaf, 0xd4e300d7)}, + {TOBN(0x52c93db7, 0x7cfa46a5), TOBN(0x71e6161f, 0x21653b50), + TOBN(0x3574fc57, 0xa4bc580a), TOBN(0xc09015dd, 0xe1bc1253)}}, + {{TOBN(0x4b7b47b2, 0xd174d7aa), TOBN(0x4072d8e8, 0xf3a15d04), + TOBN(0xeeb7d47f, 0xd6fa07ed), TOBN(0x6f2b9ff9, 0xedbdafb1)}, + {TOBN(0x18c51615, 0x3760fe8a), TOBN(0x7a96e6bf, 0xf06c6c13), + TOBN(0x4d7a0410, 0x0ea2d071), TOBN(0xa1914e9b, 0x0be2a5ce)}}, + {{TOBN(0x5726e357, 0xd8a3c5cf), TOBN(0x1197ecc3, 0x2abb2b13), + TOBN(0x6c0d7f7f, 0x31ae88dd), TOBN(0x15b20d1a, 0xfdbb3efe)}, + {TOBN(0xcd06aa26, 0x70584039), TOBN(0x2277c969, 0xa7dc9747), + TOBN(0xbca69587, 0x7855d815), TOBN(0x899ea238, 0x5188b32a)}}, + {{TOBN(0x37d9228b, 0x760c1c9d), TOBN(0xc7efbb11, 0x9b5c18da), + TOBN(0x7f0d1bc8, 0x19f6dbc5), TOBN(0x4875384b, 0x07e6905b)}, + {TOBN(0xc7c50baa, 0x3ba8cd86), TOBN(0xb0ce40fb, 0xc2905de0), + TOBN(0x70840673, 0x7a231952), TOBN(0xa912a262, 0xcf43de26)}}, + {{TOBN(0x9c38ddcc, 0xeb5b76c1), TOBN(0x746f5285, 0x26fc0ab4), + TOBN(0x52a63a50, 0xd62c269f), TOBN(0x60049c55, 0x99458621)}, + {TOBN(0xe7f48f82, 0x3c2f7c9e), TOBN(0x6bd99043, 0x917d5cf3), + TOBN(0xeb1317a8, 0x8701f469), TOBN(0xbd3fe2ed, 0x9a449fe0)}}, + {{TOBN(0x421e79ca, 0x12ef3d36), TOBN(0x9ee3c36c, 0x3e7ea5de), + TOBN(0xe48198b5, 0xcdff36f7), TOBN(0xaff4f967, 0xc6b82228)}, + {TOBN(0x15e19dd0, 0xc47adb7e), TOBN(0x45699b23, 0x032e7dfa), + TOBN(0x40680c8b, 0x1fae026a), TOBN(0x5a347a48, 0x550dbf4d)}}, + {{TOBN(0xe652533b, 0x3cef0d7d), TOBN(0xd94f7b18, 0x2bbb4381), + TOBN(0x838752be, 0x0e80f500), TOBN(0x8e6e2488, 0x9e9c9bfb)}, + {TOBN(0xc9751697, 0x16caca6a), TOBN(0x866c49d8, 0x38531ad9), + TOBN(0xc917e239, 0x7151ade1), TOBN(0x2d016ec1, 0x6037c407)}}, + {{TOBN(0xa407ccc9, 0x00eac3f9), TOBN(0x835f6280, 0xe2ed4748), + TOBN(0xcc54c347, 0x1cc98e0d), TOBN(0x0e969937, 0xdcb572eb)}, + {TOBN(0x1b16c8e8, 0x8f30c9cb), TOBN(0xa606ae75, 0x373c4661), + TOBN(0x47aa689b, 0x35502cab), TOBN(0xf89014ae, 0x4d9bb64f)}}, + {{TOBN(0x202f6a9c, 0x31c71f7b), TOBN(0x01f95aa3, 0x296ffe5c), + TOBN(0x5fc06014, 0x53cec3a3), TOBN(0xeb991237, 0x5f498a45)}, + {TOBN(0xae9a935e, 0x5d91ba87), TOBN(0xc6ac6281, 0x0b564a19), + TOBN(0x8a8fe81c, 0x3bd44e69), TOBN(0x7c8b467f, 0x9dd11d45)}}, + {{TOBN(0xf772251f, 0xea5b8e69), TOBN(0xaeecb3bd, 0xc5b75fbc), + TOBN(0x1aca3331, 0x887ff0e5), TOBN(0xbe5d49ff, 0x19f0a131)}, + {TOBN(0x582c13aa, 0xe5c8646f), TOBN(0xdbaa12e8, 0x20e19980), + TOBN(0x8f40f31a, 0xf7abbd94), TOBN(0x1f13f5a8, 0x1dfc7663)}}, + {{TOBN(0x5d81f1ee, 0xaceb4fc0), TOBN(0x36256002, 0x5e6f0f42), + TOBN(0x4b67d6d7, 0x751370c8), TOBN(0x2608b698, 0x03e80589)}, + {TOBN(0xcfc0d2fc, 0x05268301), TOBN(0xa6943d39, 0x40309212), + TOBN(0x192a90c2, 0x1fd0e1c2), TOBN(0xb209f113, 0x37f1dc76)}}, + {{TOBN(0xefcc5e06, 0x97bf1298), TOBN(0xcbdb6730, 0x219d639e), + TOBN(0xd009c116, 0xb81e8c6f), TOBN(0xa3ffdde3, 0x1a7ce2e5)}, + {TOBN(0xc53fbaaa, 0xa914d3ba), TOBN(0x836d500f, 0x88df85ee), + TOBN(0xd98dc71b, 0x66ee0751), TOBN(0x5a3d7005, 0x714516fd)}}, + {{TOBN(0x21d3634d, 0x39eedbba), TOBN(0x35cd2e68, 0x0455a46d), + TOBN(0xc8cafe65, 0xf9d7eb0c), TOBN(0xbda3ce9e, 0x00cefb3e)}, + {TOBN(0xddc17a60, 0x2c9cf7a4), TOBN(0x01572ee4, 0x7bcb8773), + TOBN(0xa92b2b01, 0x8c7548df), TOBN(0x732fd309, 0xa84600e3)}}, + {{TOBN(0xe22109c7, 0x16543a40), TOBN(0x9acafd36, 0xfede3c6c), + TOBN(0xfb206852, 0x6824e614), TOBN(0x2a4544a9, 0xda25dca0)}, + {TOBN(0x25985262, 0x91d60b06), TOBN(0x281b7be9, 0x28753545), + TOBN(0xec667b1a, 0x90f13b27), TOBN(0x33a83aff, 0x940e2eb4)}}, + {{TOBN(0x80009862, 0xd5d721d5), TOBN(0x0c3357a3, 0x5bd3a182), + TOBN(0x27f3a83b, 0x7aa2cda4), TOBN(0xb58ae74e, 0xf6f83085)}, + {TOBN(0x2a911a81, 0x2e6dad6b), TOBN(0xde286051, 0xf43d6c5b), + TOBN(0x4bdccc41, 0xf996c4d8), TOBN(0xe7312ec0, 0x0ae1e24e)}}}, + {{{TOBN(0xf8d112e7, 0x6e6485b3), TOBN(0x4d3e24db, 0x771c52f8), + TOBN(0x48e3ee41, 0x684a2f6d), TOBN(0x7161957d, 0x21d95551)}, + {TOBN(0x19631283, 0xcdb12a6c), TOBN(0xbf3fa882, 0x2e50e164), + TOBN(0xf6254b63, 0x3166cc73), TOBN(0x3aefa7ae, 0xaee8cc38)}}, + {{TOBN(0x79b0fe62, 0x3b36f9fd), TOBN(0x26543b23, 0xfde19fc0), + TOBN(0x136e64a0, 0x958482ef), TOBN(0x23f63771, 0x9b095825)}, + {TOBN(0x14cfd596, 0xb6a1142e), TOBN(0x5ea6aac6, 0x335aac0b), + TOBN(0x86a0e8bd, 0xf3081dd5), TOBN(0x5fb89d79, 0x003dc12a)}}, + {{TOBN(0xf615c33a, 0xf72e34d4), TOBN(0x0bd9ea40, 0x110eec35), + TOBN(0x1c12bc5b, 0xc1dea34e), TOBN(0x686584c9, 0x49ae4699)}, + {TOBN(0x13ad95d3, 0x8c97b942), TOBN(0x4609561a, 0x4e5c7562), + TOBN(0x9e94a4ae, 0xf2737f89), TOBN(0xf57594c6, 0x371c78b6)}}, + {{TOBN(0x0f0165fc, 0xe3779ee3), TOBN(0xe00e7f9d, 0xbd495d9e), + TOBN(0x1fa4efa2, 0x20284e7a), TOBN(0x4564bade, 0x47ac6219)}, + {TOBN(0x90e6312a, 0xc4708e8e), TOBN(0x4f5725fb, 0xa71e9adf), + TOBN(0xe95f55ae, 0x3d684b9f), TOBN(0x47f7ccb1, 0x1e94b415)}}, + {{TOBN(0x7322851b, 0x8d946581), TOBN(0xf0d13133, 0xbdf4a012), + TOBN(0xa3510f69, 0x6584dae0), TOBN(0x03a7c171, 0x3c9f6c6d)}, + {TOBN(0x5be97f38, 0xe475381a), TOBN(0xca1ba422, 0x85823334), + TOBN(0xf83cc5c7, 0x0be17dda), TOBN(0x158b1494, 0x0b918c0f)}}, + {{TOBN(0xda3a77e5, 0x522e6b69), TOBN(0x69c908c3, 0xbbcd6c18), + TOBN(0x1f1b9e48, 0xd924fd56), TOBN(0x37c64e36, 0xaa4bb3f7)}, + {TOBN(0x5a4fdbdf, 0xee478d7d), TOBN(0xba75c8bc, 0x0193f7a0), + TOBN(0x84bc1e84, 0x56cd16df), TOBN(0x1fb08f08, 0x46fad151)}}, + {{TOBN(0x8a7cabf9, 0x842e9f30), TOBN(0xa331d4bf, 0x5eab83af), + TOBN(0xd272cfba, 0x017f2a6a), TOBN(0x27560abc, 0x83aba0e3)}, + {TOBN(0x94b83387, 0x0e3a6b75), TOBN(0x25c6aea2, 0x6b9f50f5), + TOBN(0x803d691d, 0xb5fdf6d0), TOBN(0x03b77509, 0xe6333514)}}, + {{TOBN(0x36178903, 0x61a341c1), TOBN(0x3604dc60, 0x0cfd6142), + TOBN(0x022295eb, 0x8533316c), TOBN(0x3dbde4ac, 0x44af2922)}, + {TOBN(0x898afc5d, 0x1c7eef69), TOBN(0x58896805, 0xd14f4fa1), + TOBN(0x05002160, 0x203c21ca), TOBN(0x6f0d1f30, 0x40ef730b)}}, + {{TOBN(0x8e8c44d4, 0x196224f8), TOBN(0x75a4ab95, 0x374d079d), + TOBN(0x79085ecc, 0x7d48f123), TOBN(0x56f04d31, 0x1bf65ad8)}, + {TOBN(0xe220bf1c, 0xbda602b2), TOBN(0x73ee1742, 0xf9612c69), + TOBN(0x76008fc8, 0x084fd06b), TOBN(0x4000ef9f, 0xf11380d1)}}, + {{TOBN(0x48201b4b, 0x12cfe297), TOBN(0x3eee129c, 0x292f74e5), + TOBN(0xe1fe114e, 0xc9e874e8), TOBN(0x899b055c, 0x92c5fc41)}, + {TOBN(0x4e477a64, 0x3a39c8cf), TOBN(0x82f09efe, 0x78963cc9), + TOBN(0x6fd3fd8f, 0xd333f863), TOBN(0x85132b2a, 0xdc949c63)}}, + {{TOBN(0x7e06a3ab, 0x516eb17b), TOBN(0x73bec06f, 0xd2c7372b), + TOBN(0xe4f74f55, 0xba896da6), TOBN(0xbb4afef8, 0x8e9eb40f)}, + {TOBN(0x2d75bec8, 0xe61d66b0), TOBN(0x02bda4b4, 0xef29300b), + TOBN(0x8bbaa8de, 0x026baa5a), TOBN(0xff54befd, 0xa07f4440)}}, + {{TOBN(0xbd9b8b1d, 0xbe7a2af3), TOBN(0xec51caa9, 0x4fb74a72), + TOBN(0xb9937a4b, 0x63879697), TOBN(0x7c9a9d20, 0xec2687d5)}, + {TOBN(0x1773e44f, 0x6ef5f014), TOBN(0x8abcf412, 0xe90c6900), + TOBN(0x387bd022, 0x8142161e), TOBN(0x50393755, 0xfcb6ff2a)}}, + {{TOBN(0x9813fd56, 0xed6def63), TOBN(0x53cf6482, 0x7d53106c), + TOBN(0x991a35bd, 0x431f7ac1), TOBN(0xf1e274dd, 0x63e65faf)}, + {TOBN(0xf63ffa3c, 0x44cc7880), TOBN(0x411a426b, 0x7c256981), + TOBN(0xb698b9fd, 0x93a420e0), TOBN(0x89fdddc0, 0xae53f8fe)}}, + {{TOBN(0x766e0722, 0x32398baa), TOBN(0x205fee42, 0x5cfca031), + TOBN(0xa49f5341, 0x7a029cf2), TOBN(0xa88c68b8, 0x4023890d)}, + {TOBN(0xbc275041, 0x7337aaa8), TOBN(0x9ed364ad, 0x0eb384f4), + TOBN(0xe0816f85, 0x29aba92f), TOBN(0x2e9e1941, 0x04e38a88)}}, + {{TOBN(0x57eef44a, 0x3dafd2d5), TOBN(0x35d1fae5, 0x97ed98d8), + TOBN(0x50628c09, 0x2307f9b1), TOBN(0x09d84aae, 0xd6cba5c6)}, + {TOBN(0x67071bc7, 0x88aaa691), TOBN(0x2dea57a9, 0xafe6cb03), + TOBN(0xdfe11bb4, 0x3d78ac01), TOBN(0x7286418c, 0x7fd7aa51)}}, + {{TOBN(0xfabf7709, 0x77f7195a), TOBN(0x8ec86167, 0xadeb838f), + TOBN(0xea1285a8, 0xbb4f012d), TOBN(0xd6883503, 0x9a3eab3f)}, + {TOBN(0xee5d24f8, 0x309004c2), TOBN(0xa96e4b76, 0x13ffe95e), + TOBN(0x0cdffe12, 0xbd223ea4), TOBN(0x8f5c2ee5, 0xb6739a53)}}, + {{TOBN(0x5cb4aaa5, 0xdd968198), TOBN(0xfa131c52, 0x72413a6c), + TOBN(0x53d46a90, 0x9536d903), TOBN(0xb270f0d3, 0x48606d8e)}, + {TOBN(0x518c7564, 0xa053a3bc), TOBN(0x088254b7, 0x1a86caef), + TOBN(0xb3ba8cb4, 0x0ab5efd0), TOBN(0x5c59900e, 0x4605945d)}}, + {{TOBN(0xecace1dd, 0xa1887395), TOBN(0x40960f36, 0x932a65de), + TOBN(0x9611ff5c, 0x3aa95529), TOBN(0xc58215b0, 0x7c1e5a36)}, + {TOBN(0xd48c9b58, 0xf0e1a524), TOBN(0xb406856b, 0xf590dfb8), + TOBN(0xc7605e04, 0x9cd95662), TOBN(0x0dd036ee, 0xa33ecf82)}}, + {{TOBN(0xa50171ac, 0xc33156b3), TOBN(0xf09d24ea, 0x4a80172e), + TOBN(0x4e1f72c6, 0x76dc8eef), TOBN(0xe60caadc, 0x5e3d44ee)}, + {TOBN(0x006ef8a6, 0x979b1d8f), TOBN(0x60908a1c, 0x97788d26), + TOBN(0x6e08f95b, 0x266feec0), TOBN(0x618427c2, 0x22e8c94e)}}, + {{TOBN(0x3d613339, 0x59145a65), TOBN(0xcd9bc368, 0xfa406337), + TOBN(0x82d11be3, 0x2d8a52a0), TOBN(0xf6877b27, 0x97a1c590)}, + {TOBN(0x837a819b, 0xf5cbdb25), TOBN(0x2a4fd1d8, 0xde090249), + TOBN(0x622a7de7, 0x74990e5f), TOBN(0x840fa5a0, 0x7945511b)}}, + {{TOBN(0x30b974be, 0x6558842d), TOBN(0x70df8c64, 0x17f3d0a6), + TOBN(0x7c803520, 0x7542e46d), TOBN(0x7251fe7f, 0xe4ecc823)}, + {TOBN(0xe59134cb, 0x5e9aac9a), TOBN(0x11bb0934, 0xf0045d71), + TOBN(0x53e5d9b5, 0xdbcb1d4e), TOBN(0x8d97a905, 0x92defc91)}}, + {{TOBN(0xfe289327, 0x7946d3f9), TOBN(0xe132bd24, 0x07472273), + TOBN(0xeeeb510c, 0x1eb6ae86), TOBN(0x777708c5, 0xf0595067)}, + {TOBN(0x18e2c8cd, 0x1297029e), TOBN(0x2c61095c, 0xbbf9305e), + TOBN(0xe466c258, 0x6b85d6d9), TOBN(0x8ac06c36, 0xda1ea530)}}, + {{TOBN(0xa365dc39, 0xa1304668), TOBN(0xe4a9c885, 0x07f89606), + TOBN(0x65a4898f, 0xacc7228d), TOBN(0x3e2347ff, 0x84ca8303)}, + {TOBN(0xa5f6fb77, 0xea7d23a3), TOBN(0x2fac257d, 0x672a71cd), + TOBN(0x6908bef8, 0x7e6a44d3), TOBN(0x8ff87566, 0x891d3d7a)}}, + {{TOBN(0xe58e90b3, 0x6b0cf82e), TOBN(0x6438d246, 0x2615b5e7), + TOBN(0x07b1f8fc, 0x669c145a), TOBN(0xb0d8b2da, 0x36f1e1cb)}, + {TOBN(0x54d5dadb, 0xd9184c4d), TOBN(0x3dbb18d5, 0xf93d9976), + TOBN(0x0a3e0f56, 0xd1147d47), TOBN(0x2afa8c8d, 0xa0a48609)}}, + {{TOBN(0x275353e8, 0xbc36742c), TOBN(0x898f427e, 0xeea0ed90), + TOBN(0x26f4947e, 0x3e477b00), TOBN(0x8ad8848a, 0x308741e3)}, + {TOBN(0x6c703c38, 0xd74a2a46), TOBN(0x5e3e05a9, 0x9ba17ba2), + TOBN(0xc1fa6f66, 0x4ab9a9e4), TOBN(0x474a2d9a, 0x3841d6ec)}}, + {{TOBN(0x871239ad, 0x653ae326), TOBN(0x14bcf72a, 0xa74cbb43), + TOBN(0x8737650e, 0x20d4c083), TOBN(0x3df86536, 0x110ed4af)}, + {TOBN(0xd2d86fe7, 0xb53ca555), TOBN(0x688cb00d, 0xabd5d538), + TOBN(0xcf81bda3, 0x1ad38468), TOBN(0x7ccfe3cc, 0xf01167b6)}}, + {{TOBN(0xcf4f47e0, 0x6c4c1fe6), TOBN(0x557e1f1a, 0x298bbb79), + TOBN(0xf93b974f, 0x30d45a14), TOBN(0x174a1d2d, 0x0baf97c4)}, + {TOBN(0x7a003b30, 0xc51fbf53), TOBN(0xd8940991, 0xee68b225), + TOBN(0x5b0aa7b7, 0x1c0f4173), TOBN(0x975797c9, 0xa20a7153)}}, + {{TOBN(0x26e08c07, 0xe3533d77), TOBN(0xd7222e6a, 0x2e341c99), + TOBN(0x9d60ec3d, 0x8d2dc4ed), TOBN(0xbdfe0d8f, 0x7c476cf8)}, + {TOBN(0x1fe59ab6, 0x1d056605), TOBN(0xa9ea9df6, 0x86a8551f), + TOBN(0x8489941e, 0x47fb8d8c), TOBN(0xfeb874eb, 0x4a7f1b10)}}, + {{TOBN(0xfe5fea86, 0x7ee0d98f), TOBN(0x201ad34b, 0xdbf61864), + TOBN(0x45d8fe47, 0x37c031d4), TOBN(0xd5f49fae, 0x795f0822)}, + {TOBN(0xdb0fb291, 0xc7f4a40c), TOBN(0x2e69d9c1, 0x730ddd92), + TOBN(0x754e1054, 0x49d76987), TOBN(0x8a24911d, 0x7662db87)}}, + {{TOBN(0x61fc1810, 0x60a71676), TOBN(0xe852d1a8, 0xf66a8ad1), + TOBN(0x172bbd65, 0x6417231e), TOBN(0x0d6de7bd, 0x3babb11f)}, + {TOBN(0x6fde6f88, 0xc8e347f8), TOBN(0x1c587547, 0x9bd99cc3), + TOBN(0x78e54ed0, 0x34076950), TOBN(0x97f0f334, 0x796e83ba)}}, + {{TOBN(0xe4dbe1ce, 0x4924867a), TOBN(0xbd5f51b0, 0x60b84917), + TOBN(0x37530040, 0x3cb09a79), TOBN(0xdb3fe0f8, 0xff1743d8)}, + {TOBN(0xed7894d8, 0x556fa9db), TOBN(0xfa262169, 0x23412fbf), + TOBN(0x563be0db, 0xba7b9291), TOBN(0x6ca8b8c0, 0x0c9fb234)}}, + {{TOBN(0xed406aa9, 0xbd763802), TOBN(0xc21486a0, 0x65303da1), + TOBN(0x61ae291e, 0xc7e62ec4), TOBN(0x622a0492, 0xdf99333e)}, + {TOBN(0x7fd80c9d, 0xbb7a8ee0), TOBN(0xdc2ed3bc, 0x6c01aedb), + TOBN(0x35c35a12, 0x08be74ec), TOBN(0xd540cb1a, 0x469f671f)}}, + {{TOBN(0xd16ced4e, 0xcf84f6c7), TOBN(0x8561fb9c, 0x2d090f43), + TOBN(0x7e693d79, 0x6f239db4), TOBN(0xa736f928, 0x77bd0d94)}, + {TOBN(0x07b4d929, 0x2c1950ee), TOBN(0xda177543, 0x56dc11b3), + TOBN(0xa5dfbbaa, 0x7a6a878e), TOBN(0x1c70cb29, 0x4decb08a)}}, + {{TOBN(0xfba28c8b, 0x6f0f7c50), TOBN(0xa8eba2b8, 0x854dcc6d), + TOBN(0x5ff8e89a, 0x36b78642), TOBN(0x070c1c8e, 0xf6873adf)}, + {TOBN(0xbbd3c371, 0x6484d2e4), TOBN(0xfb78318f, 0x0d414129), + TOBN(0x2621a39c, 0x6ad93b0b), TOBN(0x979d74c2, 0xa9e917f7)}}, + {{TOBN(0xfc195647, 0x61fb0428), TOBN(0x4d78954a, 0xbee624d4), + TOBN(0xb94896e0, 0xb8ae86fd), TOBN(0x6667ac0c, 0xc91c8b13)}, + {TOBN(0x9f180512, 0x43bcf832), TOBN(0xfbadf8b7, 0xa0010137), + TOBN(0xc69b4089, 0xb3ba8aa7), TOBN(0xfac4bacd, 0xe687ce85)}}, + {{TOBN(0x9164088d, 0x977eab40), TOBN(0x51f4c5b6, 0x2760b390), + TOBN(0xd238238f, 0x340dd553), TOBN(0x358566c3, 0xdb1d31c9)}, + {TOBN(0x3a5ad69e, 0x5068f5ff), TOBN(0xf31435fc, 0xdaff6b06), + TOBN(0xae549a5b, 0xd6debff0), TOBN(0x59e5f0b7, 0x75e01331)}}, + {{TOBN(0x5d492fb8, 0x98559acf), TOBN(0x96018c2e, 0x4db79b50), + TOBN(0x55f4a48f, 0x609f66aa), TOBN(0x1943b3af, 0x4900a14f)}, + {TOBN(0xc22496df, 0x15a40d39), TOBN(0xb2a44684, 0x4c20f7c5), + TOBN(0x76a35afa, 0x3b98404c), TOBN(0xbec75725, 0xff5d1b77)}}, + {{TOBN(0xb67aa163, 0xbea06444), TOBN(0x27e95bb2, 0xf724b6f2), + TOBN(0x3c20e3e9, 0xd238c8ab), TOBN(0x1213754e, 0xddd6ae17)}, + {TOBN(0x8c431020, 0x716e0f74), TOBN(0x6679c82e, 0xffc095c2), + TOBN(0x2eb3adf4, 0xd0ac2932), TOBN(0x2cc970d3, 0x01bb7a76)}}, + {{TOBN(0x70c71f2f, 0x740f0e66), TOBN(0x545c616b, 0x2b6b23cc), + TOBN(0x4528cfcb, 0xb40a8bd7), TOBN(0xff839633, 0x2ab27722)}, + {TOBN(0x049127d9, 0x025ac99a), TOBN(0xd314d4a0, 0x2b63e33b), + TOBN(0xc8c310e7, 0x28d84519), TOBN(0x0fcb8983, 0xb3bc84ba)}}, + {{TOBN(0x2cc52261, 0x38634818), TOBN(0x501814f4, 0xb44c2e0b), + TOBN(0xf7e181aa, 0x54dfdba3), TOBN(0xcfd58ff0, 0xe759718c)}, + {TOBN(0xf90cdb14, 0xd3b507a8), TOBN(0x57bd478e, 0xc50bdad8), + TOBN(0x29c197e2, 0x50e5f9aa), TOBN(0x4db6eef8, 0xe40bc855)}}, + {{TOBN(0x2cc8f21a, 0xd1fc0654), TOBN(0xc71cc963, 0x81269d73), + TOBN(0xecfbb204, 0x077f49f9), TOBN(0xdde92571, 0xca56b793)}, + {TOBN(0x9abed6a3, 0xf97ad8f7), TOBN(0xe6c19d3f, 0x924de3bd), + TOBN(0x8dce92f4, 0xa140a800), TOBN(0x85f44d1e, 0x1337af07)}}, + {{TOBN(0x5953c08b, 0x09d64c52), TOBN(0xa1b5e49f, 0xf5df9749), + TOBN(0x336a8fb8, 0x52735f7d), TOBN(0xb332b6db, 0x9add676b)}, + {TOBN(0x558b88a0, 0xb4511aa4), TOBN(0x09788752, 0xdbd5cc55), + TOBN(0x16b43b9c, 0xd8cd52bd), TOBN(0x7f0bc5a0, 0xc2a2696b)}}, + {{TOBN(0x146e12d4, 0xc11f61ef), TOBN(0x9ce10754, 0x3a83e79e), + TOBN(0x08ec73d9, 0x6cbfca15), TOBN(0x09ff29ad, 0x5b49653f)}, + {TOBN(0xe31b72bd, 0xe7da946e), TOBN(0xebf9eb3b, 0xee80a4f2), + TOBN(0xd1aabd08, 0x17598ce4), TOBN(0x18b5fef4, 0x53f37e80)}}, + {{TOBN(0xd5d5cdd3, 0x5958cd79), TOBN(0x3580a1b5, 0x1d373114), + TOBN(0xa36e4c91, 0xfa935726), TOBN(0xa38c534d, 0xef20d760)}, + {TOBN(0x7088e40a, 0x2ff5845b), TOBN(0xe5bb40bd, 0xbd78177f), + TOBN(0x4f06a7a8, 0x857f9920), TOBN(0xe3cc3e50, 0xe968f05d)}}, + {{TOBN(0x1d68b7fe, 0xe5682d26), TOBN(0x5206f76f, 0xaec7f87c), + TOBN(0x41110530, 0x041951ab), TOBN(0x58ec52c1, 0xd4b5a71a)}, + {TOBN(0xf3488f99, 0x0f75cf9a), TOBN(0xf411951f, 0xba82d0d5), + TOBN(0x27ee75be, 0x618895ab), TOBN(0xeae060d4, 0x6d8aab14)}}, + {{TOBN(0x9ae1df73, 0x7fb54dc2), TOBN(0x1f3e391b, 0x25963649), + TOBN(0x242ec32a, 0xfe055081), TOBN(0x5bd450ef, 0x8491c9bd)}, + {TOBN(0x367efc67, 0x981eb389), TOBN(0xed7e1928, 0x3a0550d5), + TOBN(0x362e776b, 0xab3ce75c), TOBN(0xe890e308, 0x1f24c523)}}, + {{TOBN(0xb961b682, 0xfeccef76), TOBN(0x8b8e11f5, 0x8bba6d92), + TOBN(0x8f2ccc4c, 0x2b2375c4), TOBN(0x0d7f7a52, 0xe2f86cfa)}, + {TOBN(0xfd94d30a, 0x9efe5633), TOBN(0x2d8d246b, 0x5451f934), + TOBN(0x2234c6e3, 0x244e6a00), TOBN(0xde2b5b0d, 0xddec8c50)}}, + {{TOBN(0x2ce53c5a, 0xbf776f5b), TOBN(0x6f724071, 0x60357b05), + TOBN(0xb2593717, 0x71bf3f7a), TOBN(0x87d2501c, 0x440c4a9f)}, + {TOBN(0x440552e1, 0x87b05340), TOBN(0xb7bf7cc8, 0x21624c32), + TOBN(0x4155a6ce, 0x22facddb), TOBN(0x5a4228cb, 0x889837ef)}}, + {{TOBN(0xef87d6d6, 0xfd4fd671), TOBN(0xa233687e, 0xc2daa10e), + TOBN(0x75622244, 0x03c0eb96), TOBN(0x7632d184, 0x8bf19be6)}, + {TOBN(0x05d0f8e9, 0x40735ff4), TOBN(0x3a3e6e13, 0xc00931f1), + TOBN(0x31ccde6a, 0xdafe3f18), TOBN(0xf381366a, 0xcfe51207)}}, + {{TOBN(0x24c222a9, 0x60167d92), TOBN(0x62f9d6f8, 0x7529f18c), + TOBN(0x412397c0, 0x0353b114), TOBN(0x334d89dc, 0xef808043)}, + {TOBN(0xd9ec63ba, 0x2a4383ce), TOBN(0xcec8e937, 0x5cf92ba0), + TOBN(0xfb8b4288, 0xc8be74c0), TOBN(0x67d6912f, 0x105d4391)}}, + {{TOBN(0x7b996c46, 0x1b913149), TOBN(0x36aae2ef, 0x3a4e02da), + TOBN(0xb68aa003, 0x972de594), TOBN(0x284ec70d, 0x4ec6d545)}, + {TOBN(0xf3d2b2d0, 0x61391d54), TOBN(0x69c5d5d6, 0xfe114e92), + TOBN(0xbe0f00b5, 0xb4482dff), TOBN(0xe1596fa5, 0xf5bf33c5)}}, + {{TOBN(0x10595b56, 0x96a71cba), TOBN(0x944938b2, 0xfdcadeb7), + TOBN(0xa282da4c, 0xfccd8471), TOBN(0x98ec05f3, 0x0d37bfe1)}, + {TOBN(0xe171ce1b, 0x0698304a), TOBN(0x2d691444, 0x21bdf79b), + TOBN(0xd0cd3b74, 0x1b21dec1), TOBN(0x712ecd8b, 0x16a15f71)}}, + {{TOBN(0x8d4c00a7, 0x00fd56e1), TOBN(0x02ec9692, 0xf9527c18), + TOBN(0x21c44937, 0x4a3e42e1), TOBN(0x9176fbab, 0x1392ae0a)}, + {TOBN(0x8726f1ba, 0x44b7b618), TOBN(0xb4d7aae9, 0xf1de491c), + TOBN(0xf91df7b9, 0x07b582c0), TOBN(0x7e116c30, 0xef60aa3a)}}, + {{TOBN(0x99270f81, 0x466265d7), TOBN(0xb15b6fe2, 0x4df7adf0), + TOBN(0xfe33b2d3, 0xf9738f7f), TOBN(0x48553ab9, 0xd6d70f95)}, + {TOBN(0x2cc72ac8, 0xc21e94db), TOBN(0x795ac38d, 0xbdc0bbee), + TOBN(0x0a1be449, 0x2e40478f), TOBN(0x81bd3394, 0x052bde55)}}, + {{TOBN(0x63c8dbe9, 0x56b3c4f2), TOBN(0x017a99cf, 0x904177cc), + TOBN(0x947bbddb, 0x4d010fc1), TOBN(0xacf9b00b, 0xbb2c9b21)}, + {TOBN(0x2970bc8d, 0x47173611), TOBN(0x1a4cbe08, 0xac7d756f), + TOBN(0x06d9f4aa, 0x67d541a2), TOBN(0xa3e8b689, 0x59c2cf44)}}, + {{TOBN(0xaad066da, 0x4d88f1dd), TOBN(0xc604f165, 0x7ad35dea), + TOBN(0x7edc0720, 0x4478ca67), TOBN(0xa10dfae0, 0xba02ce06)}, + {TOBN(0xeceb1c76, 0xaf36f4e4), TOBN(0x994b2292, 0xaf3f8f48), + TOBN(0xbf9ed77b, 0x77c8a68c), TOBN(0x74f544ea, 0x51744c9d)}}, + {{TOBN(0x82d05bb9, 0x8113a757), TOBN(0x4ef2d2b4, 0x8a9885e4), + TOBN(0x1e332be5, 0x1aa7865f), TOBN(0x22b76b18, 0x290d1a52)}, + {TOBN(0x308a2310, 0x44351683), TOBN(0x9d861896, 0xa3f22840), + TOBN(0x5959ddcd, 0x841ed947), TOBN(0x0def0c94, 0x154b73bf)}}, + {{TOBN(0xf0105417, 0x4c7c15e0), TOBN(0x539bfb02, 0x3a277c32), + TOBN(0xe699268e, 0xf9dccf5f), TOBN(0x9f5796a5, 0x0247a3bd)}, + {TOBN(0x8b839de8, 0x4f157269), TOBN(0xc825c1e5, 0x7a30196b), + TOBN(0x6ef0aabc, 0xdc8a5a91), TOBN(0xf4a8ce6c, 0x498b7fe6)}}, + {{TOBN(0x1cce35a7, 0x70cbac78), TOBN(0x83488e9b, 0xf6b23958), + TOBN(0x0341a070, 0xd76cb011), TOBN(0xda6c9d06, 0xae1b2658)}, + {TOBN(0xb701fb30, 0xdd648c52), TOBN(0x994ca02c, 0x52fb9fd1), + TOBN(0x06933117, 0x6f563086), TOBN(0x3d2b8100, 0x17856bab)}}, + {{TOBN(0xe89f48c8, 0x5963a46e), TOBN(0x658ab875, 0xa99e61c7), + TOBN(0x6e296f87, 0x4b8517b4), TOBN(0x36c4fcdc, 0xfc1bc656)}, + {TOBN(0xde5227a1, 0xa3906def), TOBN(0x9fe95f57, 0x62418945), + TOBN(0x20c91e81, 0xfdd96cde), TOBN(0x5adbe47e, 0xda4480de)}}, + {{TOBN(0xa009370f, 0x396de2b6), TOBN(0x98583d4b, 0xf0ecc7bd), + TOBN(0xf44f6b57, 0xe51d0672), TOBN(0x03d6b078, 0x556b1984)}, + {TOBN(0x27dbdd93, 0xb0b64912), TOBN(0x9b3a3434, 0x15687b09), + TOBN(0x0dba6461, 0x51ec20a9), TOBN(0xec93db7f, 0xff28187c)}}, + {{TOBN(0x00ff8c24, 0x66e48bdd), TOBN(0x2514f2f9, 0x11ccd78e), + TOBN(0xeba11f4f, 0xe1250603), TOBN(0x8a22cd41, 0x243fa156)}, + {TOBN(0xa4e58df4, 0xb283e4c6), TOBN(0x78c29859, 0x8b39783f), + TOBN(0x5235aee2, 0xa5259809), TOBN(0xc16284b5, 0x0e0227dd)}}, + {{TOBN(0xa5f57916, 0x1338830d), TOBN(0x6d4b8a6b, 0xd2123fca), + TOBN(0x236ea68a, 0xf9c546f8), TOBN(0xc1d36873, 0xfa608d36)}, + {TOBN(0xcd76e495, 0x8d436d13), TOBN(0xd4d9c221, 0x8fb080af), + TOBN(0x665c1728, 0xe8ad3fb5), TOBN(0xcf1ebe4d, 0xb3d572e0)}}, + {{TOBN(0xa7a8746a, 0x584c5e20), TOBN(0x267e4ea1, 0xb9dc7035), + TOBN(0x593a15cf, 0xb9548c9b), TOBN(0x5e6e2135, 0x4bd012f3)}, + {TOBN(0xdf31cc6a, 0x8c8f936e), TOBN(0x8af84d04, 0xb5c241dc), + TOBN(0x63990a6f, 0x345efb86), TOBN(0x6fef4e61, 0xb9b962cb)}}}, + {{{TOBN(0xf6368f09, 0x25722608), TOBN(0x131260db, 0x131cf5c6), + TOBN(0x40eb353b, 0xfab4f7ac), TOBN(0x85c78880, 0x37eee829)}, + {TOBN(0x4c1581ff, 0xc3bdf24e), TOBN(0x5bff75cb, 0xf5c3c5a8), + TOBN(0x35e8c83f, 0xa14e6f40), TOBN(0xb81d1c0f, 0x0295e0ca)}}, + {{TOBN(0xfcde7cc8, 0xf43a730f), TOBN(0xe89b6f3c, 0x33ab590e), + TOBN(0xc823f529, 0xad03240b), TOBN(0x82b79afe, 0x98bea5db)}, + {TOBN(0x568f2856, 0x962fe5de), TOBN(0x0c590adb, 0x60c591f3), + TOBN(0x1fc74a14, 0x4a28a858), TOBN(0x3b662498, 0xb3203f4c)}}, + {{TOBN(0x91e3cf0d, 0x6c39765a), TOBN(0xa2db3acd, 0xac3cca0b), + TOBN(0x288f2f08, 0xcb953b50), TOBN(0x2414582c, 0xcf43cf1a)}, + {TOBN(0x8dec8bbc, 0x60eee9a8), TOBN(0x54c79f02, 0x729aa042), + TOBN(0xd81cd5ec, 0x6532f5d5), TOBN(0xa672303a, 0xcf82e15f)}}, + {{TOBN(0x376aafa8, 0x719c0563), TOBN(0xcd8ad2dc, 0xbc5fc79f), + TOBN(0x303fdb9f, 0xcb750cd3), TOBN(0x14ff052f, 0x4418b08e)}, + {TOBN(0xf75084cf, 0x3e2d6520), TOBN(0x7ebdf0f8, 0x144ed509), + TOBN(0xf43bf0f2, 0xd3f25b98), TOBN(0x86ad71cf, 0xa354d837)}}, + {{TOBN(0xb827fe92, 0x26f43572), TOBN(0xdfd3ab5b, 0x5d824758), + TOBN(0x315dd23a, 0x539094c1), TOBN(0x85c0e37a, 0x66623d68)}, + {TOBN(0x575c7972, 0x7be19ae0), TOBN(0x616a3396, 0xdf0d36b5), + TOBN(0xa1ebb3c8, 0x26b1ff7e), TOBN(0x635b9485, 0x140ad453)}}, + {{TOBN(0x92bf3cda, 0xda430c0b), TOBN(0x4702850e, 0x3a96dac6), + TOBN(0xc91cf0a5, 0x15ac326a), TOBN(0x95de4f49, 0xab8c25e4)}, + {TOBN(0xb01bad09, 0xe265c17c), TOBN(0x24e45464, 0x087b3881), + TOBN(0xd43e583c, 0xe1fac5ca), TOBN(0xe17cb318, 0x6ead97a6)}}, + {{TOBN(0x6cc39243, 0x74dcec46), TOBN(0x33cfc02d, 0x54c2b73f), + TOBN(0x82917844, 0xf26cd99c), TOBN(0x8819dd95, 0xd1773f89)}, + {TOBN(0x09572aa6, 0x0871f427), TOBN(0x8e0cf365, 0xf6f01c34), + TOBN(0x7fa52988, 0xbff1f5af), TOBN(0x4eb357ea, 0xe75e8e50)}}, + {{TOBN(0xd9d0c8c4, 0x868af75d), TOBN(0xd7325cff, 0x45c8c7ea), + TOBN(0xab471996, 0xcc81ecb0), TOBN(0xff5d55f3, 0x611824ed)}, + {TOBN(0xbe314541, 0x1977a0ee), TOBN(0x5085c4c5, 0x722038c6), + TOBN(0x2d5335bf, 0xf94bb495), TOBN(0x894ad8a6, 0xc8e2a082)}}, + {{TOBN(0x5c3e2341, 0xada35438), TOBN(0xf4a9fc89, 0x049b8c4e), + TOBN(0xbeeb355a, 0x9f17cf34), TOBN(0x3f311e0e, 0x6c91fe10)}, + {TOBN(0xc2d20038, 0x92ab9891), TOBN(0x257bdcc1, 0x3e8ce9a9), + TOBN(0x1b2d9789, 0x88c53bee), TOBN(0x927ce89a, 0xcdba143a)}}, + {{TOBN(0xb0a32cca, 0x523db280), TOBN(0x5c889f8a, 0x50d43783), + TOBN(0x503e04b3, 0x4897d16f), TOBN(0x8cdb6e78, 0x08f5f2e8)}, + {TOBN(0x6ab91cf0, 0x179c8e74), TOBN(0xd8874e52, 0x48211d60), + TOBN(0xf948d4d5, 0xea851200), TOBN(0x4076d41e, 0xe6f9840a)}}, + {{TOBN(0xc20e263c, 0x47b517ea), TOBN(0x79a448fd, 0x30685e5e), + TOBN(0xe55f6f78, 0xf90631a0), TOBN(0x88a790b1, 0xa79e6346)}, + {TOBN(0x62160c7d, 0x80969fe8), TOBN(0x54f92fd4, 0x41491bb9), + TOBN(0xa6645c23, 0x5c957526), TOBN(0xf44cc5ae, 0xbea3ce7b)}}, + {{TOBN(0xf7628327, 0x8b1e68b7), TOBN(0xc731ad7a, 0x303f29d3), + TOBN(0xfe5a9ca9, 0x57d03ecb), TOBN(0x96c0d50c, 0x41bc97a7)}, + {TOBN(0xc4669fe7, 0x9b4f7f24), TOBN(0xfdd781d8, 0x3d9967ef), + TOBN(0x7892c7c3, 0x5d2c208d), TOBN(0x8bf64f7c, 0xae545cb3)}}, + {{TOBN(0xc01f862c, 0x467be912), TOBN(0xf4c85ee9, 0xc73d30cc), + TOBN(0x1fa6f4be, 0x6ab83ec7), TOBN(0xa07a3c1c, 0x4e3e3cf9)}, + {TOBN(0x87f8ef45, 0x0c00beb3), TOBN(0x30e2c2b3, 0x000d4c3e), + TOBN(0x1aa00b94, 0xfe08bf5b), TOBN(0x32c133aa, 0x9224ef52)}}, + {{TOBN(0x38df16bb, 0x32e5685d), TOBN(0x68a9e069, 0x58e6f544), + TOBN(0x495aaff7, 0xcdc5ebc6), TOBN(0xf894a645, 0x378b135f)}, + {TOBN(0xf316350a, 0x09e27ecf), TOBN(0xeced201e, 0x58f7179d), + TOBN(0x2eec273c, 0xe97861ba), TOBN(0x47ec2cae, 0xd693be2e)}}, + {{TOBN(0xfa4c97c4, 0xf68367ce), TOBN(0xe4f47d0b, 0xbe5a5755), + TOBN(0x17de815d, 0xb298a979), TOBN(0xd7eca659, 0xc177dc7d)}, + {TOBN(0x20fdbb71, 0x49ded0a3), TOBN(0x4cb2aad4, 0xfb34d3c5), + TOBN(0x2cf31d28, 0x60858a33), TOBN(0x3b6873ef, 0xa24aa40f)}}, + {{TOBN(0x540234b2, 0x2c11bb37), TOBN(0x2d0366dd, 0xed4c74a3), + TOBN(0xf9a968da, 0xeec5f25d), TOBN(0x36601068, 0x67b63142)}, + {TOBN(0x07cd6d2c, 0x68d7b6d4), TOBN(0xa8f74f09, 0x0c842942), + TOBN(0xe2751404, 0x7768b1ee), TOBN(0x4b5f7e89, 0xfe62aee4)}}, + {{TOBN(0xc6a77177, 0x89070d26), TOBN(0xa1f28e4e, 0xdd1c8bc7), + TOBN(0xea5f4f06, 0x469e1f17), TOBN(0x78fc242a, 0xfbdb78e0)}, + {TOBN(0xc9c7c592, 0x8b0588f1), TOBN(0xb6b7a0fd, 0x1535921e), + TOBN(0xcc5bdb91, 0xbde5ae35), TOBN(0xb42c485e, 0x12ff1864)}}, + {{TOBN(0xa1113e13, 0xdbab98aa), TOBN(0xde9d469b, 0xa17b1024), + TOBN(0x23f48b37, 0xc0462d3a), TOBN(0x3752e537, 0x7c5c078d)}, + {TOBN(0xe3a86add, 0x15544eb9), TOBN(0xf013aea7, 0x80fba279), + TOBN(0x8b5bb76c, 0xf22001b5), TOBN(0xe617ba14, 0xf02891ab)}}, + {{TOBN(0xd39182a6, 0x936219d3), TOBN(0x5ce1f194, 0xae51cb19), + TOBN(0xc78f8598, 0xbf07a74c), TOBN(0x6d7158f2, 0x22cbf1bc)}, + {TOBN(0x3b846b21, 0xe300ce18), TOBN(0x35fba630, 0x2d11275d), + TOBN(0x5fe25c36, 0xa0239b9b), TOBN(0xd8beb35d, 0xdf05d940)}}, + {{TOBN(0x4db02bb0, 0x1f7e320d), TOBN(0x0641c364, 0x6da320ea), + TOBN(0x6d95fa5d, 0x821389a3), TOBN(0x92699748, 0x8fcd8e3d)}, + {TOBN(0x316fef17, 0xceb6c143), TOBN(0x67fcb841, 0xd933762b), + TOBN(0xbb837e35, 0x118b17f8), TOBN(0x4b92552f, 0x9fd24821)}}, + {{TOBN(0xae6bc70e, 0x46aca793), TOBN(0x1cf0b0e4, 0xe579311b), + TOBN(0x8dc631be, 0x5802f716), TOBN(0x099bdc6f, 0xbddbee4d)}, + {TOBN(0xcc352bb2, 0x0caf8b05), TOBN(0xf74d505a, 0x72d63df2), + TOBN(0xb9876d4b, 0x91c4f408), TOBN(0x1ce18473, 0x9e229b2d)}}, + {{TOBN(0x49507597, 0x83abdb4a), TOBN(0x850fbcb6, 0xdee84b18), + TOBN(0x6325236e, 0x609e67dc), TOBN(0x04d831d9, 0x9336c6d8)}, + {TOBN(0x8deaae3b, 0xfa12d45d), TOBN(0xe425f8ce, 0x4746e246), + TOBN(0x8004c175, 0x24f5f31e), TOBN(0xaca16d8f, 0xad62c3b7)}}, + {{TOBN(0x0dc15a6a, 0x9152f934), TOBN(0xf1235e5d, 0xed0e12c1), + TOBN(0xc33c06ec, 0xda477dac), TOBN(0x76be8732, 0xb2ea0006)}, + {TOBN(0xcf3f7831, 0x0c0cd313), TOBN(0x3c524553, 0xa614260d), + TOBN(0x31a756f8, 0xcab22d15), TOBN(0x03ee10d1, 0x77827a20)}}, + {{TOBN(0xd1e059b2, 0x1994ef20), TOBN(0x2a653b69, 0x638ae318), + TOBN(0x70d5eb58, 0x2f699010), TOBN(0x279739f7, 0x09f5f84a)}, + {TOBN(0x5da4663c, 0x8b799336), TOBN(0xfdfdf14d, 0x203c37eb), + TOBN(0x32d8a9dc, 0xa1dbfb2d), TOBN(0xab40cff0, 0x77d48f9b)}}, + {{TOBN(0xc018b383, 0xd20b42d5), TOBN(0xf9a810ef, 0x9f78845f), + TOBN(0x40af3753, 0xbdba9df0), TOBN(0xb90bdcfc, 0x131dfdf9)}, + {TOBN(0x18720591, 0xf01ab782), TOBN(0xc823f211, 0x6af12a88), + TOBN(0xa51b80f3, 0x0dc14401), TOBN(0xde248f77, 0xfb2dfbe3)}}, + {{TOBN(0xef5a44e5, 0x0cafe751), TOBN(0x73997c9c, 0xd4dcd221), + TOBN(0x32fd86d1, 0xde854024), TOBN(0xd5b53adc, 0xa09b84bb)}, + {TOBN(0x008d7a11, 0xdcedd8d1), TOBN(0x406bd1c8, 0x74b32c84), + TOBN(0x5d4472ff, 0x05dde8b1), TOBN(0x2e25f2cd, 0xfce2b32f)}}, + {{TOBN(0xbec0dd5e, 0x29dfc254), TOBN(0x4455fcf6, 0x2b98b267), + TOBN(0x0b4d43a5, 0xc72df2ad), TOBN(0xea70e6be, 0x48a75397)}, + {TOBN(0x2aad6169, 0x5820f3bf), TOBN(0xf410d2dd, 0x9e37f68f), + TOBN(0x70fb7dba, 0x7be5ac83), TOBN(0x636bb645, 0x36ec3eec)}}, + {{TOBN(0x27104ea3, 0x9754e21c), TOBN(0xbc87a3e6, 0x8d63c373), + TOBN(0x483351d7, 0x4109db9a), TOBN(0x0fa724e3, 0x60134da7)}, + {TOBN(0x9ff44c29, 0xb0720b16), TOBN(0x2dd0cf13, 0x06aceead), + TOBN(0x5942758c, 0xe26929a6), TOBN(0x96c5db92, 0xb766a92b)}}, + {{TOBN(0xcec7d4c0, 0x5f18395e), TOBN(0xd3f22744, 0x1f80d032), + TOBN(0x7a68b37a, 0xcb86075b), TOBN(0x074764dd, 0xafef92db)}, + {TOBN(0xded1e950, 0x7bc7f389), TOBN(0xc580c850, 0xb9756460), + TOBN(0xaeeec2a4, 0x7da48157), TOBN(0x3f0b4e7f, 0x82c587b3)}}, + {{TOBN(0x231c6de8, 0xa9f19c53), TOBN(0x5717bd73, 0x6974e34e), + TOBN(0xd9e1d216, 0xf1508fa9), TOBN(0x9f112361, 0xdadaa124)}, + {TOBN(0x80145e31, 0x823b7348), TOBN(0x4dd8f0d5, 0xac634069), + TOBN(0xe3d82fc7, 0x2297c258), TOBN(0x276fcfee, 0x9cee7431)}}, + {{TOBN(0x8eb61b5e, 0x2bc0aea9), TOBN(0x4f668fd5, 0xde329431), + TOBN(0x03a32ab1, 0x38e4b87e), TOBN(0xe1374517, 0x73d0ef0b)}, + {TOBN(0x1a46f7e6, 0x853ac983), TOBN(0xc3bdf42e, 0x68e78a57), + TOBN(0xacf20785, 0x2ea96dd1), TOBN(0xa10649b9, 0xf1638460)}}, + {{TOBN(0xf2369f0b, 0x879fbbed), TOBN(0x0ff0ae86, 0xda9d1869), + TOBN(0x5251d759, 0x56766f45), TOBN(0x4984d8c0, 0x2be8d0fc)}, + {TOBN(0x7ecc95a6, 0xd21008f0), TOBN(0x29bd54a0, 0x3a1a1c49), + TOBN(0xab9828c5, 0xd26c50f3), TOBN(0x32c0087c, 0x51d0d251)}}, + {{TOBN(0x9bac3ce6, 0x0c1cdb26), TOBN(0xcd94d947, 0x557ca205), + TOBN(0x1b1bd598, 0x9db1fdcd), TOBN(0x0eda0108, 0xa3d8b149)}, + {TOBN(0x95066610, 0x56152fcc), TOBN(0xc2f037e6, 0xe7192b33), + TOBN(0xdeffb41a, 0xc92e05a4), TOBN(0x1105f6c2, 0xc2f6c62e)}}, + {{TOBN(0x68e73500, 0x8733913c), TOBN(0xcce86163, 0x3f3adc40), + TOBN(0xf407a942, 0x38a278e9), TOBN(0xd13c1b9d, 0x2ab21292)}, + {TOBN(0x93ed7ec7, 0x1c74cf5c), TOBN(0x8887dc48, 0xf1a4c1b4), + TOBN(0x3830ff30, 0x4b3a11f1), TOBN(0x358c5a3c, 0x58937cb6)}}, + {{TOBN(0x027dc404, 0x89022829), TOBN(0x40e93977, 0x3b798f79), + TOBN(0x90ad3337, 0x38be6ead), TOBN(0x9c23f6bc, 0xf34c0a5d)}, + {TOBN(0xd1711a35, 0xfbffd8bb), TOBN(0x60fcfb49, 0x1949d3dd), + TOBN(0x09c8ef4b, 0x7825d93a), TOBN(0x24233cff, 0xa0a8c968)}}, + {{TOBN(0x67ade46c, 0xe6d982af), TOBN(0xebb6bf3e, 0xe7544d7c), + TOBN(0xd6b9ba76, 0x3d8bd087), TOBN(0x46fe382d, 0x4dc61280)}, + {TOBN(0xbd39a7e8, 0xb5bdbd75), TOBN(0xab381331, 0xb8f228fe), + TOBN(0x0709a77c, 0xce1c4300), TOBN(0x6a247e56, 0xf337ceac)}}, + {{TOBN(0x8f34f21b, 0x636288be), TOBN(0x9dfdca74, 0xc8a7c305), + TOBN(0x6decfd1b, 0xea919e04), TOBN(0xcdf2688d, 0x8e1991f8)}, + {TOBN(0xe607df44, 0xd0f8a67e), TOBN(0xd985df4b, 0x0b58d010), + TOBN(0x57f834c5, 0x0c24f8f4), TOBN(0xe976ef56, 0xa0bf01ae)}}, + {{TOBN(0x536395ac, 0xa1c32373), TOBN(0x351027aa, 0x734c0a13), + TOBN(0xd2f1b5d6, 0x5e6bd5bc), TOBN(0x2b539e24, 0x223debed)}, + {TOBN(0xd4994cec, 0x0eaa1d71), TOBN(0x2a83381d, 0x661dcf65), + TOBN(0x5f1aed2f, 0x7b54c740), TOBN(0x0bea3fa5, 0xd6dda5ee)}}, + {{TOBN(0x9d4fb684, 0x36cc6134), TOBN(0x8eb9bbf3, 0xc0a443dd), + TOBN(0xfc500e2e, 0x383b7d2a), TOBN(0x7aad621c, 0x5b775257)}, + {TOBN(0x69284d74, 0x0a8f7cc0), TOBN(0xe820c2ce, 0x07562d65), + TOBN(0xbf9531b9, 0x499758ee), TOBN(0x73e95ca5, 0x6ee0cc2d)}}, + {{TOBN(0xf61790ab, 0xfbaf50a5), TOBN(0xdf55e76b, 0x684e0750), + TOBN(0xec516da7, 0xf176b005), TOBN(0x575553bb, 0x7a2dddc7)}, + {TOBN(0x37c87ca3, 0x553afa73), TOBN(0x315f3ffc, 0x4d55c251), + TOBN(0xe846442a, 0xaf3e5d35), TOBN(0x61b91149, 0x6495ff28)}}, + {{TOBN(0x23cc95d3, 0xfa326dc3), TOBN(0x1df4da1f, 0x18fc2cea), + TOBN(0x24bf9adc, 0xd0a37d59), TOBN(0xb6710053, 0x320d6e1e)}, + {TOBN(0x96f9667e, 0x618344d1), TOBN(0xcc7ce042, 0xa06445af), + TOBN(0xa02d8514, 0xd68dbc3a), TOBN(0x4ea109e4, 0x280b5a5b)}}, + {{TOBN(0x5741a7ac, 0xb40961bf), TOBN(0x4ada5937, 0x6aa56bfa), + TOBN(0x7feb9145, 0x02b765d1), TOBN(0x561e97be, 0xe6ad1582)}, + {TOBN(0xbbc4a5b6, 0xda3982f5), TOBN(0x0c2659ed, 0xb546f468), + TOBN(0xb8e7e6aa, 0x59612d20), TOBN(0xd83dfe20, 0xac19e8e0)}}, + {{TOBN(0x8530c45f, 0xb835398c), TOBN(0x6106a8bf, 0xb38a41c2), + TOBN(0x21e8f9a6, 0x35f5dcdb), TOBN(0x39707137, 0xcae498ed)}, + {TOBN(0x70c23834, 0xd8249f00), TOBN(0x9f14b58f, 0xab2537a0), + TOBN(0xd043c365, 0x5f61c0c2), TOBN(0xdc5926d6, 0x09a194a7)}}, + {{TOBN(0xddec0339, 0x8e77738a), TOBN(0xd07a63ef, 0xfba46426), + TOBN(0x2e58e79c, 0xee7f6e86), TOBN(0xe59b0459, 0xff32d241)}, + {TOBN(0xc5ec84e5, 0x20fa0338), TOBN(0x97939ac8, 0xeaff5ace), + TOBN(0x0310a4e3, 0xb4a38313), TOBN(0x9115fba2, 0x8f9d9885)}}, + {{TOBN(0x8dd710c2, 0x5fadf8c3), TOBN(0x66be38a2, 0xce19c0e2), + TOBN(0xd42a279c, 0x4cfe5022), TOBN(0x597bb530, 0x0e24e1b8)}, + {TOBN(0x3cde86b7, 0xc153ca7f), TOBN(0xa8d30fb3, 0x707d63bd), + TOBN(0xac905f92, 0xbd60d21e), TOBN(0x98e7ffb6, 0x7b9a54ab)}}, + {{TOBN(0xd7147df8, 0xe9726a30), TOBN(0xb5e216ff, 0xafce3533), + TOBN(0xb550b799, 0x2ff1ec40), TOBN(0x6b613b87, 0xa1e953fd)}, + {TOBN(0x87b88dba, 0x792d5610), TOBN(0x2ee1270a, 0xa190fbe1), + TOBN(0x02f4e2dc, 0x2ef581da), TOBN(0x016530e4, 0xeff82a95)}}, + {{TOBN(0xcbb93dfd, 0x8fd6ee89), TOBN(0x16d3d986, 0x46848fff), + TOBN(0x600eff24, 0x1da47adf), TOBN(0x1b9754a0, 0x0ad47a71)}, + {TOBN(0x8f9266df, 0x70c33b98), TOBN(0xaadc87ae, 0xdf34186e), + TOBN(0x0d2ce8e1, 0x4ad24132), TOBN(0x8a47cbfc, 0x19946eba)}}, + {{TOBN(0x47feeb66, 0x62b5f3af), TOBN(0xcefab561, 0x0abb3734), + TOBN(0x449de60e, 0x19f35cb1), TOBN(0x39f8db14, 0x157f0eb9)}, + {TOBN(0xffaecc5b, 0x3c61bfd6), TOBN(0xa5a4d41d, 0x41216703), + TOBN(0x7f8fabed, 0x224e1cc2), TOBN(0x0d5a8186, 0x871ad953)}}, + {{TOBN(0xf10774f7, 0xd22da9a9), TOBN(0x45b8a678, 0xcc8a9b0d), + TOBN(0xd9c2e722, 0xbdc32cff), TOBN(0xbf71b5f5, 0x337202a5)}, + {TOBN(0x95c57f2f, 0x69fc4db9), TOBN(0xb6dad34c, 0x765d01e1), + TOBN(0x7e0bd13f, 0xcb904635), TOBN(0x61751253, 0x763a588c)}}, + {{TOBN(0xd85c2997, 0x81af2c2d), TOBN(0xc0f7d9c4, 0x81b9d7da), + TOBN(0x838a34ae, 0x08533e8d), TOBN(0x15c4cb08, 0x311d8311)}, + {TOBN(0x97f83285, 0x8e121e14), TOBN(0xeea7dc1e, 0x85000a5f), + TOBN(0x0c6059b6, 0x5d256274), TOBN(0xec9beace, 0xb95075c0)}}, + {{TOBN(0x173daad7, 0x1df97828), TOBN(0xbf851cb5, 0xa8937877), + TOBN(0xb083c594, 0x01646f3c), TOBN(0x3bad30cf, 0x50c6d352)}, + {TOBN(0xfeb2b202, 0x496bbcea), TOBN(0x3cf9fd4f, 0x18a1e8ba), + TOBN(0xd26de7ff, 0x1c066029), TOBN(0x39c81e9e, 0x4e9ed4f8)}}, + {{TOBN(0xd8be0cb9, 0x7b390d35), TOBN(0x01df2bbd, 0x964aab27), + TOBN(0x3e8c1a65, 0xc3ef64f8), TOBN(0x567291d1, 0x716ed1dd)}, + {TOBN(0x95499c6c, 0x5f5406d3), TOBN(0x71fdda39, 0x5ba8e23f), + TOBN(0xcfeb320e, 0xd5096ece), TOBN(0xbe7ba92b, 0xca66dd16)}}, + {{TOBN(0x4608d36b, 0xc6fb5a7d), TOBN(0xe3eea15a, 0x6d2dd0e0), + TOBN(0x75b0a3eb, 0x8f97a36a), TOBN(0xf59814cc, 0x1c83de1e)}, + {TOBN(0x56c9c5b0, 0x1c33c23f), TOBN(0xa96c1da4, 0x6faa4136), + TOBN(0x46bf2074, 0xde316551), TOBN(0x3b866e7b, 0x1f756c8f)}}, + {{TOBN(0x727727d8, 0x1495ed6b), TOBN(0xb2394243, 0xb682dce7), + TOBN(0x8ab8454e, 0x758610f3), TOBN(0xc243ce84, 0x857d72a4)}, + {TOBN(0x7b320d71, 0xdbbf370f), TOBN(0xff9afa37, 0x78e0f7ca), + TOBN(0x0119d1e0, 0xea7b523f), TOBN(0xb997f8cb, 0x058c7d42)}}, + {{TOBN(0x285bcd2a, 0x37bbb184), TOBN(0x51dcec49, 0xa45d1fa6), + TOBN(0x6ade3b64, 0xe29634cb), TOBN(0x080c94a7, 0x26b86ef1)}, + {TOBN(0xba583db1, 0x2283fbe3), TOBN(0x902bddc8, 0x5a9315ed), + TOBN(0x07c1ccb3, 0x86964bec), TOBN(0x78f4eacf, 0xb6258301)}}, + {{TOBN(0x4bdf3a49, 0x56f90823), TOBN(0xba0f5080, 0x741d777b), + TOBN(0x091d71c3, 0xf38bf760), TOBN(0x9633d50f, 0x9b625b02)}, + {TOBN(0x03ecb743, 0xb8c9de61), TOBN(0xb4751254, 0x5de74720), + TOBN(0x9f9defc9, 0x74ce1cb2), TOBN(0x774a4f6a, 0x00bd32ef)}}, + {{TOBN(0xaca385f7, 0x73848f22), TOBN(0x53dad716, 0xf3f8558e), + TOBN(0xab7b34b0, 0x93c471f9), TOBN(0xf530e069, 0x19644bc7)}, + {TOBN(0x3d9fb1ff, 0xdd59d31a), TOBN(0x4382e0df, 0x08daa795), + TOBN(0x165c6f4b, 0xd5cc88d7), TOBN(0xeaa392d5, 0x4a18c900)}}, + {{TOBN(0x94203c67, 0x648024ee), TOBN(0x188763f2, 0x8c2fabcd), + TOBN(0xa80f87ac, 0xbbaec835), TOBN(0x632c96e0, 0xf29d8d54)}, + {TOBN(0x29b0a60e, 0x4c00a95e), TOBN(0x2ef17f40, 0xe011e9fa), + TOBN(0xf6c0e1d1, 0x15b77223), TOBN(0xaaec2c62, 0x14b04e32)}}, + {{TOBN(0xd35688d8, 0x3d84e58c), TOBN(0x2af5094c, 0x958571db), + TOBN(0x4fff7e19, 0x760682a6), TOBN(0x4cb27077, 0xe39a407c)}, + {TOBN(0x0f59c547, 0x4ff0e321), TOBN(0x169f34a6, 0x1b34c8ff), + TOBN(0x2bff1096, 0x52bc1ba7), TOBN(0xa25423b7, 0x83583544)}}, + {{TOBN(0x5d55d5d5, 0x0ac8b782), TOBN(0xff6622ec, 0x2db3c892), + TOBN(0x48fce741, 0x6b8bb642), TOBN(0x31d6998c, 0x69d7e3dc)}, + {TOBN(0xdbaf8004, 0xcadcaed0), TOBN(0x801b0142, 0xd81d053c), + TOBN(0x94b189fc, 0x59630ec6), TOBN(0x120e9934, 0xaf762c8e)}}, + {{TOBN(0x53a29aa4, 0xfdc6a404), TOBN(0x19d8e01e, 0xa1909948), + TOBN(0x3cfcabf1, 0xd7e89681), TOBN(0x3321a50d, 0x4e132d37)}, + {TOBN(0xd0496863, 0xe9a86111), TOBN(0x8c0cde61, 0x06a3bc65), + TOBN(0xaf866c49, 0xfc9f8eef), TOBN(0x2066350e, 0xff7f5141)}}, + {{TOBN(0x4f8a4689, 0xe56ddfbd), TOBN(0xea1b0c07, 0xfe32983a), + TOBN(0x2b317462, 0x873cb8cb), TOBN(0x658deddc, 0x2d93229f)}, + {TOBN(0x65efaf4d, 0x0f64ef58), TOBN(0xfe43287d, 0x730cc7a8), + TOBN(0xaebc0c72, 0x3d047d70), TOBN(0x92efa539, 0xd92d26c9)}}, + {{TOBN(0x06e78457, 0x94b56526), TOBN(0x415cb80f, 0x0961002d), + TOBN(0x89e5c565, 0x76dcb10f), TOBN(0x8bbb6982, 0xff9259fe)}, + {TOBN(0x4fe8795b, 0x9abc2668), TOBN(0xb5d4f534, 0x1e678fb1), + TOBN(0x6601f3be, 0x7b7da2b9), TOBN(0x98da59e2, 0xa13d6805)}}, + {{TOBN(0x190d8ea6, 0x01799a52), TOBN(0xa20cec41, 0xb86d2952), + TOBN(0x3062ffb2, 0x7fff2a7c), TOBN(0x741b32e5, 0x79f19d37)}, + {TOBN(0xf80d8181, 0x4eb57d47), TOBN(0x7a2d0ed4, 0x16aef06b), + TOBN(0x09735fb0, 0x1cecb588), TOBN(0x1641caaa, 0xc6061f5b)}}}, + {{{TOBN(0x7f99824f, 0x20151427), TOBN(0x206828b6, 0x92430206), + TOBN(0xaa9097d7, 0xe1112357), TOBN(0xacf9a2f2, 0x09e414ec)}, + {TOBN(0xdbdac9da, 0x27915356), TOBN(0x7e0734b7, 0x001efee3), + TOBN(0x54fab5bb, 0xd2b288e2), TOBN(0x4c630fc4, 0xf62dd09c)}}, + {{TOBN(0x8537107a, 0x1ac2703b), TOBN(0xb49258d8, 0x6bc857b5), + TOBN(0x57df14de, 0xbcdaccd1), TOBN(0x24ab68d7, 0xc4ae8529)}, + {TOBN(0x7ed8b5d4, 0x734e59d0), TOBN(0x5f8740c8, 0xc495cc80), + TOBN(0x84aedd5a, 0x291db9b3), TOBN(0x80b360f8, 0x4fb995be)}}, + {{TOBN(0xae915f5d, 0x5fa067d1), TOBN(0x4134b57f, 0x9668960c), + TOBN(0xbd3656d6, 0xa48edaac), TOBN(0xdac1e3e4, 0xfc1d7436)}, + {TOBN(0x674ff869, 0xd81fbb26), TOBN(0x449ed3ec, 0xb26c33d4), + TOBN(0x85138705, 0xd94203e8), TOBN(0xccde538b, 0xbeeb6f4a)}}, + {{TOBN(0x55d5c68d, 0xa61a76fa), TOBN(0x598b441d, 0xca1554dc), + TOBN(0xd39923b9, 0x773b279c), TOBN(0x33331d3c, 0x36bf9efc)}, + {TOBN(0x2d4c848e, 0x298de399), TOBN(0xcfdb8e77, 0xa1a27f56), + TOBN(0x94c855ea, 0x57b8ab70), TOBN(0xdcdb9dae, 0x6f7879ba)}}, + {{TOBN(0x7bdff8c2, 0x019f2a59), TOBN(0xb3ce5bb3, 0xcb4fbc74), + TOBN(0xea907f68, 0x8a9173dd), TOBN(0x6cd3d0d3, 0x95a75439)}, + {TOBN(0x92ecc4d6, 0xefed021c), TOBN(0x09a9f9b0, 0x6a77339a), + TOBN(0x87ca6b15, 0x7188c64a), TOBN(0x10c29968, 0x44899158)}}, + {{TOBN(0x5859a229, 0xed6e82ef), TOBN(0x16f338e3, 0x65ebaf4e), + TOBN(0x0cd31387, 0x5ead67ae), TOBN(0x1c73d228, 0x54ef0bb4)}, + {TOBN(0x4cb55131, 0x74a5c8c7), TOBN(0x01cd2970, 0x7f69ad6a), + TOBN(0xa04d00dd, 0xe966f87e), TOBN(0xd96fe447, 0x0b7b0321)}}, + {{TOBN(0x342ac06e, 0x88fbd381), TOBN(0x02cd4a84, 0x5c35a493), + TOBN(0xe8fa89de, 0x54f1bbcd), TOBN(0x341d6367, 0x2575ed4c)}, + {TOBN(0xebe357fb, 0xd238202b), TOBN(0x600b4d1a, 0xa984ead9), + TOBN(0xc35c9f44, 0x52436ea0), TOBN(0x96fe0a39, 0xa370751b)}}, + {{TOBN(0x4c4f0736, 0x7f636a38), TOBN(0x9f943fb7, 0x0e76d5cb), + TOBN(0xb03510ba, 0xa8b68b8b), TOBN(0xc246780a, 0x9ed07a1f)}, + {TOBN(0x3c051415, 0x6d549fc2), TOBN(0xc2953f31, 0x607781ca), + TOBN(0x955e2c69, 0xd8d95413), TOBN(0xb300fadc, 0x7bd282e3)}}, + {{TOBN(0x81fe7b50, 0x87e9189f), TOBN(0xdb17375c, 0xf42dda27), + TOBN(0x22f7d896, 0xcf0a5904), TOBN(0xa0e57c5a, 0xebe348e6)}, + {TOBN(0xa61011d3, 0xf40e3c80), TOBN(0xb1189321, 0x8db705c5), + TOBN(0x4ed9309e, 0x50fedec3), TOBN(0xdcf14a10, 0x4d6d5c1d)}}, + {{TOBN(0x056c265b, 0x55691342), TOBN(0xe8e08504, 0x91049dc7), + TOBN(0x131329f5, 0xc9bae20a), TOBN(0x96c8b3e8, 0xd9dccdb4)}, + {TOBN(0x8c5ff838, 0xfb4ee6b4), TOBN(0xfc5a9aeb, 0x41e8ccf0), + TOBN(0x7417b764, 0xfae050c6), TOBN(0x0953c3d7, 0x00452080)}}, + {{TOBN(0x21372682, 0x38dfe7e8), TOBN(0xea417e15, 0x2bb79d4b), + TOBN(0x59641f1c, 0x76e7cf2d), TOBN(0x271e3059, 0xea0bcfcc)}, + {TOBN(0x624c7dfd, 0x7253ecbd), TOBN(0x2f552e25, 0x4fca6186), + TOBN(0xcbf84ecd, 0x4d866e9c), TOBN(0x73967709, 0xf68d4610)}}, + {{TOBN(0xa14b1163, 0xc27901b4), TOBN(0xfd9236e0, 0x899b8bf3), + TOBN(0x42b091ec, 0xcbc6da0a), TOBN(0xbb1dac6f, 0x5ad1d297)}, + {TOBN(0x80e61d53, 0xa91cf76e), TOBN(0x4110a412, 0xd31f1ee7), + TOBN(0x2d87c3ba, 0x13efcf77), TOBN(0x1f374bb4, 0xdf450d76)}}, + {{TOBN(0x5e78e2f2, 0x0d188dab), TOBN(0xe3968ed0, 0xf4b885ef), + TOBN(0x46c0568e, 0x7314570f), TOBN(0x31616338, 0x01170521)}, + {TOBN(0x18e1e7e2, 0x4f0c8afe), TOBN(0x4caa75ff, 0xdeea78da), + TOBN(0x82db67f2, 0x7c5d8a51), TOBN(0x36a44d86, 0x6f505370)}}, + {{TOBN(0xd72c5bda, 0x0333974f), TOBN(0x5db516ae, 0x27a70146), + TOBN(0x34705281, 0x210ef921), TOBN(0xbff17a8f, 0x0c9c38e5)}, + {TOBN(0x78f4814e, 0x12476da1), TOBN(0xc1e16613, 0x33c16980), + TOBN(0x9e5b386f, 0x424d4bca), TOBN(0x4c274e87, 0xc85740de)}}, + {{TOBN(0xb6a9b88d, 0x6c2f5226), TOBN(0x14d1b944, 0x550d7ca8), + TOBN(0x580c85fc, 0x1fc41709), TOBN(0xc1da368b, 0x54c6d519)}, + {TOBN(0x2b0785ce, 0xd5113cf7), TOBN(0x0670f633, 0x5a34708f), + TOBN(0x46e23767, 0x15cc3f88), TOBN(0x1b480cfa, 0x50c72c8f)}}, + {{TOBN(0x20288602, 0x4147519a), TOBN(0xd0981eac, 0x26b372f0), + TOBN(0xa9d4a7ca, 0xa785ebc8), TOBN(0xd953c50d, 0xdbdf58e9)}, + {TOBN(0x9d6361cc, 0xfd590f8f), TOBN(0x72e9626b, 0x44e6c917), + TOBN(0x7fd96110, 0x22eb64cf), TOBN(0x863ebb7e, 0x9eb288f3)}}, + {{TOBN(0x6e6ab761, 0x6aca8ee7), TOBN(0x97d10b39, 0xd7b40358), + TOBN(0x1687d377, 0x1e5feb0d), TOBN(0xc83e50e4, 0x8265a27a)}, + {TOBN(0x8f75a9fe, 0xc954b313), TOBN(0xcc2e8f47, 0x310d1f61), + TOBN(0xf5ba81c5, 0x6557d0e0), TOBN(0x25f9680c, 0x3eaf6207)}}, + {{TOBN(0xf95c6609, 0x4354080b), TOBN(0x5225bfa5, 0x7bf2fe1c), + TOBN(0xc5c004e2, 0x5c7d98fa), TOBN(0x3561bf1c, 0x019aaf60)}, + {TOBN(0x5e6f9f17, 0xba151474), TOBN(0xdec2f934, 0xb04f6eca), + TOBN(0x64e368a1, 0x269acb1e), TOBN(0x1332d9e4, 0x0cdda493)}}, + {{TOBN(0x60d6cf69, 0xdf23de05), TOBN(0x66d17da2, 0x009339a0), + TOBN(0x9fcac985, 0x0a693923), TOBN(0xbcf057fc, 0xed7c6a6d)}, + {TOBN(0xc3c5c8c5, 0xf0b5662c), TOBN(0x25318dd8, 0xdcba4f24), + TOBN(0x60e8cb75, 0x082b69ff), TOBN(0x7c23b3ee, 0x1e728c01)}}, + {{TOBN(0x15e10a0a, 0x097e4403), TOBN(0xcb3d0a86, 0x19854665), + TOBN(0x88d8e211, 0xd67d4826), TOBN(0xb39af66e, 0x0b9d2839)}, + {TOBN(0xa5f94588, 0xbd475ca8), TOBN(0xe06b7966, 0xc077b80b), + TOBN(0xfedb1485, 0xda27c26c), TOBN(0xd290d33a, 0xfe0fd5e0)}}, + {{TOBN(0xa40bcc47, 0xf34fb0fa), TOBN(0xb4760cc8, 0x1fb1ab09), + TOBN(0x8fca0993, 0xa273bfe3), TOBN(0x13e4fe07, 0xf70b213c)}, + {TOBN(0x3bcdb992, 0xfdb05163), TOBN(0x8c484b11, 0x0c2b19b6), + TOBN(0x1acb815f, 0xaaf2e3e2), TOBN(0xc6905935, 0xb89ff1b4)}}, + {{TOBN(0xb2ad6f9d, 0x586e74e1), TOBN(0x488883ad, 0x67b80484), + TOBN(0x758aa2c7, 0x369c3ddb), TOBN(0x8ab74e69, 0x9f9afd31)}, + {TOBN(0x10fc2d28, 0x5e21beb1), TOBN(0x3484518a, 0x318c42f9), + TOBN(0x377427dc, 0x53cf40c3), TOBN(0x9de0781a, 0x391bc1d9)}}, + {{TOBN(0x8faee858, 0x693807e1), TOBN(0xa3865327, 0x4e81ccc7), + TOBN(0x02c30ff2, 0x6f835b84), TOBN(0xb604437b, 0x0d3d38d4)}, + {TOBN(0xb3fc8a98, 0x5ca1823d), TOBN(0xb82f7ec9, 0x03be0324), + TOBN(0xee36d761, 0xcf684a33), TOBN(0x5a01df0e, 0x9f29bf7d)}}, + {{TOBN(0x686202f3, 0x1306583d), TOBN(0x05b10da0, 0x437c622e), + TOBN(0xbf9aaa0f, 0x076a7bc8), TOBN(0x25e94efb, 0x8f8f4e43)}, + {TOBN(0x8a35c9b7, 0xfa3dc26d), TOBN(0xe0e5fb93, 0x96ff03c5), + TOBN(0xa77e3843, 0xebc394ce), TOBN(0xcede6595, 0x8361de60)}}, + {{TOBN(0xd27c22f6, 0xa1993545), TOBN(0xab01cc36, 0x24d671ba), + TOBN(0x63fa2877, 0xa169c28e), TOBN(0x925ef904, 0x2eb08376)}, + {TOBN(0x3b2fa3cf, 0x53aa0b32), TOBN(0xb27beb5b, 0x71c49d7a), + TOBN(0xb60e1834, 0xd105e27f), TOBN(0xd6089788, 0x4f68570d)}}, + {{TOBN(0x23094ce0, 0xd6fbc2ac), TOBN(0x738037a1, 0x815ff551), + TOBN(0xda73b1bb, 0x6bef119c), TOBN(0xdcf6c430, 0xeef506ba)}, + {TOBN(0x00e4fe7b, 0xe3ef104a), TOBN(0xebdd9a2c, 0x0a065628), + TOBN(0x853a81c3, 0x8792043e), TOBN(0x22ad6ece, 0xb3b59108)}}, + {{TOBN(0x9fb813c0, 0x39cd297d), TOBN(0x8ec7e16e, 0x05bda5d9), + TOBN(0x2834797c, 0x0d104b96), TOBN(0xcc11a2e7, 0x7c511510)}, + {TOBN(0x96ca5a53, 0x96ee6380), TOBN(0x054c8655, 0xcea38742), + TOBN(0xb5946852, 0xd54dfa7d), TOBN(0x97c422e7, 0x1f4ab207)}}, + {{TOBN(0xbf907509, 0x0c22b540), TOBN(0x2cde42aa, 0xb7c267d4), + TOBN(0xba18f9ed, 0x5ab0d693), TOBN(0x3ba62aa6, 0x6e4660d9)}, + {TOBN(0xb24bf97b, 0xab9ea96a), TOBN(0x5d039642, 0xe3b60e32), + TOBN(0x4e6a4506, 0x7c4d9bd5), TOBN(0x666c5b9e, 0x7ed4a6a4)}}, + {{TOBN(0xfa3fdcd9, 0x8edbd7cc), TOBN(0x4660bb87, 0xc6ccd753), + TOBN(0x9ae90820, 0x21e6b64f), TOBN(0x8a56a713, 0xb36bfb3f)}, + {TOBN(0xabfce096, 0x5726d47f), TOBN(0x9eed01b2, 0x0b1a9a7f), + TOBN(0x30e9cad4, 0x4eb74a37), TOBN(0x7b2524cc, 0x53e9666d)}}, + {{TOBN(0x6a29683b, 0x8f4b002f), TOBN(0xc2200d7a, 0x41f4fc20), + TOBN(0xcf3af47a, 0x3a338acc), TOBN(0x6539a4fb, 0xe7128975)}, + {TOBN(0xcec31c14, 0xc33c7fcf), TOBN(0x7eb6799b, 0xc7be322b), + TOBN(0x119ef4e9, 0x6646f623), TOBN(0x7b7a26a5, 0x54d7299b)}}, + {{TOBN(0xcb37f08d, 0x403f46f2), TOBN(0x94b8fc43, 0x1a0ec0c7), + TOBN(0xbb8514e3, 0xc332142f), TOBN(0xf3ed2c33, 0xe80d2a7a)}, + {TOBN(0x8d2080af, 0xb639126c), TOBN(0xf7b6be60, 0xe3553ade), + TOBN(0x3950aa9f, 0x1c7e2b09), TOBN(0x847ff958, 0x6410f02b)}}, + {{TOBN(0x877b7cf5, 0x678a31b0), TOBN(0xd50301ae, 0x3998b620), + TOBN(0x734257c5, 0xc00fb396), TOBN(0xf9fb18a0, 0x04e672a6)}, + {TOBN(0xff8bd8eb, 0xe8758851), TOBN(0x1e64e4c6, 0x5d99ba44), + TOBN(0x4b8eaedf, 0x7dfd93b7), TOBN(0xba2f2a98, 0x04e76b8c)}}, + {{TOBN(0x7d790cba, 0xe8053433), TOBN(0xc8e725a0, 0x3d2c9585), + TOBN(0x58c5c476, 0xcdd8f5ed), TOBN(0xd106b952, 0xefa9fe1d)}, + {TOBN(0x3c5c775b, 0x0eff13a9), TOBN(0x242442ba, 0xe057b930), + TOBN(0xe9f458d4, 0xc9b70cbd), TOBN(0x69b71448, 0xa3cdb89a)}}, + {{TOBN(0x41ee46f6, 0x0e2ed742), TOBN(0x573f1045, 0x40067493), + TOBN(0xb1e154ff, 0x9d54c304), TOBN(0x2ad0436a, 0x8d3a7502)}, + {TOBN(0xee4aaa2d, 0x431a8121), TOBN(0xcd38b3ab, 0x886f11ed), + TOBN(0x57d49ea6, 0x034a0eb7), TOBN(0xd2b773bd, 0xf7e85e58)}}, + {{TOBN(0x4a559ac4, 0x9b5c1f14), TOBN(0xc444be1a, 0x3e54df2b), + TOBN(0x13aad704, 0xeda41891), TOBN(0xcd927bec, 0x5eb5c788)}, + {TOBN(0xeb3c8516, 0xe48c8a34), TOBN(0x1b7ac812, 0x4b546669), + TOBN(0x1815f896, 0x594df8ec), TOBN(0x87c6a79c, 0x79227865)}}, + {{TOBN(0xae02a2f0, 0x9b56ddbd), TOBN(0x1339b5ac, 0x8a2f1cf3), + TOBN(0xf2b569c7, 0x839dff0d), TOBN(0xb0b9e864, 0xfee9a43d)}, + {TOBN(0x4ff8ca41, 0x77bb064e), TOBN(0x145a2812, 0xfd249f63), + TOBN(0x3ab7beac, 0xf86f689a), TOBN(0x9bafec27, 0x01d35f5e)}}, + {{TOBN(0x28054c65, 0x4265aa91), TOBN(0xa4b18304, 0x035efe42), + TOBN(0x6887b0e6, 0x9639dec7), TOBN(0xf4b8f6ad, 0x3d52aea5)}, + {TOBN(0xfb9293cc, 0x971a8a13), TOBN(0x3f159e5d, 0x4c934d07), + TOBN(0x2c50e9b1, 0x09acbc29), TOBN(0x08eb65e6, 0x7154d129)}}, + {{TOBN(0x4feff589, 0x30b75c3e), TOBN(0x0bb82fe2, 0x94491c93), + TOBN(0xd8ac377a, 0x89af62bb), TOBN(0xd7b51490, 0x9685e49f)}, + {TOBN(0xabca9a7b, 0x04497f19), TOBN(0x1b35ed0a, 0x1a7ad13f), + TOBN(0x6b601e21, 0x3ec86ed6), TOBN(0xda91fcb9, 0xce0c76f1)}}, + {{TOBN(0x9e28507b, 0xd7ab27e1), TOBN(0x7c19a555, 0x63945b7b), + TOBN(0x6b43f0a1, 0xaafc9827), TOBN(0x443b4fbd, 0x3aa55b91)}, + {TOBN(0x962b2e65, 0x6962c88f), TOBN(0x139da8d4, 0xce0db0ca), + TOBN(0xb93f05dd, 0x1b8d6c4f), TOBN(0x779cdff7, 0x180b9824)}}, + {{TOBN(0xbba23fdd, 0xae57c7b7), TOBN(0x345342f2, 0x1b932522), + TOBN(0xfd9c80fe, 0x556d4aa3), TOBN(0xa03907ba, 0x6525bb61)}, + {TOBN(0x38b010e1, 0xff218933), TOBN(0xc066b654, 0xaa52117b), + TOBN(0x8e141920, 0x94f2e6ea), TOBN(0x66a27dca, 0x0d32f2b2)}}, + {{TOBN(0x69c7f993, 0x048b3717), TOBN(0xbf5a989a, 0xb178ae1c), + TOBN(0x49fa9058, 0x564f1d6b), TOBN(0x27ec6e15, 0xd31fde4e)}, + {TOBN(0x4cce0373, 0x7276e7fc), TOBN(0x64086d79, 0x89d6bf02), + TOBN(0x5a72f046, 0x4ccdd979), TOBN(0x909c3566, 0x47775631)}}, + {{TOBN(0x1c07bc6b, 0x75dd7125), TOBN(0xb4c6bc97, 0x87a0428d), + TOBN(0x507ece52, 0xfdeb6b9d), TOBN(0xfca56512, 0xb2c95432)}, + {TOBN(0x15d97181, 0xd0e8bd06), TOBN(0x384dd317, 0xc6bb46ea), + TOBN(0x5441ea20, 0x3952b624), TOBN(0xbcf70dee, 0x4e7dc2fb)}}, + {{TOBN(0x372b016e, 0x6628e8c3), TOBN(0x07a0d667, 0xb60a7522), + TOBN(0xcf05751b, 0x0a344ee2), TOBN(0x0ec09a48, 0x118bdeec)}, + {TOBN(0x6e4b3d4e, 0xd83dce46), TOBN(0x43a6316d, 0x99d2fc6e), + TOBN(0xa99d8989, 0x56cf044c), TOBN(0x7c7f4454, 0xae3e5fb7)}}, + {{TOBN(0xb2e6b121, 0xfbabbe92), TOBN(0x281850fb, 0xe1330076), + TOBN(0x093581ec, 0x97890015), TOBN(0x69b1dded, 0x75ff77f5)}, + {TOBN(0x7cf0b18f, 0xab105105), TOBN(0x953ced31, 0xa89ccfef), + TOBN(0x3151f85f, 0xeb914009), TOBN(0x3c9f1b87, 0x88ed48ad)}}, + {{TOBN(0xc9aba1a1, 0x4a7eadcb), TOBN(0x928e7501, 0x522e71cf), + TOBN(0xeaede727, 0x3a2e4f83), TOBN(0x467e10d1, 0x1ce3bbd3)}, + {TOBN(0xf3442ac3, 0xb955dcf0), TOBN(0xba96307d, 0xd3d5e527), + TOBN(0xf763a10e, 0xfd77f474), TOBN(0x5d744bd0, 0x6a6e1ff0)}}, + {{TOBN(0xd287282a, 0xa777899e), TOBN(0xe20eda8f, 0xd03f3cde), + TOBN(0x6a7e75bb, 0x50b07d31), TOBN(0x0b7e2a94, 0x6f379de4)}, + {TOBN(0x31cb64ad, 0x19f593cf), TOBN(0x7b1a9e4f, 0x1e76ef1d), + TOBN(0xe18c9c9d, 0xb62d609c), TOBN(0x439bad6d, 0xe779a650)}}, + {{TOBN(0x219d9066, 0xe032f144), TOBN(0x1db632b8, 0xe8b2ec6a), + TOBN(0xff0d0fd4, 0xfda12f78), TOBN(0x56fb4c2d, 0x2a25d265)}, + {TOBN(0x5f4e2ee1, 0x255a03f1), TOBN(0x61cd6af2, 0xe96af176), + TOBN(0xe0317ba8, 0xd068bc97), TOBN(0x927d6bab, 0x264b988e)}}, + {{TOBN(0xa18f07e0, 0xe90fb21e), TOBN(0x00fd2b80, 0xbba7fca1), + TOBN(0x20387f27, 0x95cd67b5), TOBN(0x5b89a4e7, 0xd39707f7)}, + {TOBN(0x8f83ad3f, 0x894407ce), TOBN(0xa0025b94, 0x6c226132), + TOBN(0xc79563c7, 0xf906c13b), TOBN(0x5f548f31, 0x4e7bb025)}}, + {{TOBN(0x2b4c6b8f, 0xeac6d113), TOBN(0xa67e3f9c, 0x0e813c76), + TOBN(0x3982717c, 0x3fe1f4b9), TOBN(0x58865819, 0x26d8050e)}, + {TOBN(0x99f3640c, 0xf7f06f20), TOBN(0xdc610216, 0x2a66ebc2), + TOBN(0x52f2c175, 0x767a1e08), TOBN(0x05660e1a, 0x5999871b)}}, + {{TOBN(0x6b0f1762, 0x6d3c4693), TOBN(0xf0e7d627, 0x37ed7bea), + TOBN(0xc51758c7, 0xb75b226d), TOBN(0x40a88628, 0x1f91613b)}, + {TOBN(0x889dbaa7, 0xbbb38ce0), TOBN(0xe0404b65, 0xbddcad81), + TOBN(0xfebccd3a, 0x8bc9671f), TOBN(0xfbf9a357, 0xee1f5375)}}, + {{TOBN(0x5dc169b0, 0x28f33398), TOBN(0xb07ec11d, 0x72e90f65), + TOBN(0xae7f3b4a, 0xfaab1eb1), TOBN(0xd970195e, 0x5f17538a)}, + {TOBN(0x52b05cbe, 0x0181e640), TOBN(0xf5debd62, 0x2643313d), + TOBN(0x76148154, 0x5df31f82), TOBN(0x23e03b33, 0x3a9e13c5)}}, + {{TOBN(0xff758949, 0x4fde0c1f), TOBN(0xbf8a1abe, 0xe5b6ec20), + TOBN(0x702278fb, 0x87e1db6c), TOBN(0xc447ad7a, 0x35ed658f)}, + {TOBN(0x48d4aa38, 0x03d0ccf2), TOBN(0x80acb338, 0x819a7c03), + TOBN(0x9bc7c89e, 0x6e17cecc), TOBN(0x46736b8b, 0x03be1d82)}}, + {{TOBN(0xd65d7b60, 0xc0432f96), TOBN(0xddebe7a3, 0xdeb5442f), + TOBN(0x79a25307, 0x7dff69a2), TOBN(0x37a56d94, 0x02cf3122)}, + {TOBN(0x8bab8aed, 0xf2350d0a), TOBN(0x13c3f276, 0x037b0d9a), + TOBN(0xc664957c, 0x44c65cae), TOBN(0x88b44089, 0xc2e71a88)}}, + {{TOBN(0xdb88e5a3, 0x5cb02664), TOBN(0x5d4c0bf1, 0x8686c72e), + TOBN(0xea3d9b62, 0xa682d53e), TOBN(0x9b605ef4, 0x0b2ad431)}, + {TOBN(0x71bac202, 0xc69645d0), TOBN(0xa115f03a, 0x6a1b66e7), + TOBN(0xfe2c563a, 0x158f4dc4), TOBN(0xf715b3a0, 0x4d12a78c)}}, + {{TOBN(0x8f7f0a48, 0xd413213a), TOBN(0x2035806d, 0xc04becdb), + TOBN(0xecd34a99, 0x5d8587f5), TOBN(0x4d8c3079, 0x9f6d3a71)}, + {TOBN(0x1b2a2a67, 0x8d95a8f6), TOBN(0xc58c9d7d, 0xf2110d0d), + TOBN(0xdeee81d5, 0xcf8fba3f), TOBN(0xa42be3c0, 0x0c7cdf68)}}, + {{TOBN(0x2126f742, 0xd43b5eaa), TOBN(0x054a0766, 0xdfa59b85), + TOBN(0x9d0d5e36, 0x126bfd45), TOBN(0xa1f8fbd7, 0x384f8a8f)}, + {TOBN(0x317680f5, 0xd563fccc), TOBN(0x48ca5055, 0xf280a928), + TOBN(0xe00b81b2, 0x27b578cf), TOBN(0x10aad918, 0x2994a514)}}, + {{TOBN(0xd9e07b62, 0xb7bdc953), TOBN(0x9f0f6ff2, 0x5bc086dd), + TOBN(0x09d1ccff, 0x655eee77), TOBN(0x45475f79, 0x5bef7df1)}, + {TOBN(0x3faa28fa, 0x86f702cc), TOBN(0x92e60905, 0x0f021f07), + TOBN(0xe9e62968, 0x7f8fa8c6), TOBN(0xbd71419a, 0xf036ea2c)}}, + {{TOBN(0x171ee1cc, 0x6028da9a), TOBN(0x5352fe1a, 0xc251f573), + TOBN(0xf8ff236e, 0x3fa997f4), TOBN(0xd831b6c9, 0xa5749d5f)}, + {TOBN(0x7c872e1d, 0xe350e2c2), TOBN(0xc56240d9, 0x1e0ce403), + TOBN(0xf9deb077, 0x6974f5cb), TOBN(0x7d50ba87, 0x961c3728)}}, + {{TOBN(0xd6f89426, 0x5a3a2518), TOBN(0xcf817799, 0xc6303d43), + TOBN(0x510a0471, 0x619e5696), TOBN(0xab049ff6, 0x3a5e307b)}, + {TOBN(0xe4cdf9b0, 0xfeb13ec7), TOBN(0xd5e97117, 0x9d8ff90c), + TOBN(0xf6f64d06, 0x9afa96af), TOBN(0x00d0bf5e, 0x9d2012a2)}}, + {{TOBN(0xe63f301f, 0x358bcdc0), TOBN(0x07689e99, 0x0a9d47f8), + TOBN(0x1f689e2f, 0x4f43d43a), TOBN(0x4d542a16, 0x90920904)}, + {TOBN(0xaea293d5, 0x9ca0a707), TOBN(0xd061fe45, 0x8ac68065), + TOBN(0x1033bf1b, 0x0090008c), TOBN(0x29749558, 0xc08a6db6)}}, + {{TOBN(0x74b5fc59, 0xc1d5d034), TOBN(0xf712e9f6, 0x67e215e0), + TOBN(0xfd520cbd, 0x860200e6), TOBN(0x0229acb4, 0x3ea22588)}, + {TOBN(0x9cd1e14c, 0xfff0c82e), TOBN(0x87684b62, 0x59c69e73), + TOBN(0xda85e61c, 0x96ccb989), TOBN(0x2d5dbb02, 0xa3d06493)}}, + {{TOBN(0xf22ad33a, 0xe86b173c), TOBN(0xe8e41ea5, 0xa79ff0e3), + TOBN(0x01d2d725, 0xdd0d0c10), TOBN(0x31f39088, 0x032d28f9)}, + {TOBN(0x7b3f71e1, 0x7829839e), TOBN(0x0cf691b4, 0x4502ae58), + TOBN(0xef658dbd, 0xbefc6115), TOBN(0xa5cd6ee5, 0xb3ab5314)}}, + {{TOBN(0x206c8d7b, 0x5f1d2347), TOBN(0x794645ba, 0x4cc2253a), + TOBN(0xd517d8ff, 0x58389e08), TOBN(0x4fa20dee, 0x9f847288)}, + {TOBN(0xeba072d8, 0xd797770a), TOBN(0x7360c91d, 0xbf429e26), + TOBN(0x7200a3b3, 0x80af8279), TOBN(0x6a1c9150, 0x82dadce3)}}, + {{TOBN(0x0ee6d3a7, 0xc35d8794), TOBN(0x042e6558, 0x0356bae5), + TOBN(0x9f59698d, 0x643322fd), TOBN(0x9379ae15, 0x50a61967)}, + {TOBN(0x64b9ae62, 0xfcc9981e), TOBN(0xaed3d631, 0x6d2934c6), + TOBN(0x2454b302, 0x5e4e65eb), TOBN(0xab09f647, 0xf9950428)}}}, + {{{TOBN(0xb2083a12, 0x22248acc), TOBN(0x1f6ec0ef, 0x3264e366), + TOBN(0x5659b704, 0x5afdee28), TOBN(0x7a823a40, 0xe6430bb5)}, + {TOBN(0x24592a04, 0xe1900a79), TOBN(0xcde09d4a, 0xc9ee6576), + TOBN(0x52b6463f, 0x4b5ea54a), TOBN(0x1efe9ed3, 0xd3ca65a7)}}, + {{TOBN(0xe27a6dbe, 0x305406dd), TOBN(0x8eb7dc7f, 0xdd5d1957), + TOBN(0xf54a6876, 0x387d4d8f), TOBN(0x9c479409, 0xc7762de4)}, + {TOBN(0xbe4d5b5d, 0x99b30778), TOBN(0x25380c56, 0x6e793682), + TOBN(0x602d37f3, 0xdac740e3), TOBN(0x140deabe, 0x1566e4ae)}}, + {{TOBN(0x4481d067, 0xafd32acf), TOBN(0xd8f0fcca, 0xe1f71ccf), + TOBN(0xd208dd0c, 0xb596f2da), TOBN(0xd049d730, 0x9aad93f9)}, + {TOBN(0xc79f263d, 0x42ab580e), TOBN(0x09411bb1, 0x23f707b4), + TOBN(0x8cfde1ff, 0x835e0eda), TOBN(0x72707490, 0x90f03402)}}, + {{TOBN(0xeaee6126, 0xc49a861e), TOBN(0x024f3b65, 0xe14f0d06), + TOBN(0x51a3f1e8, 0xc69bfc17), TOBN(0xc3c3a8e9, 0xa7686381)}, + {TOBN(0x3400752c, 0xb103d4c8), TOBN(0x02bc4613, 0x9218b36b), + TOBN(0xc67f75eb, 0x7651504a), TOBN(0xd6848b56, 0xd02aebfa)}}, + {{TOBN(0xbd9802e6, 0xc30fa92b), TOBN(0x5a70d96d, 0x9a552784), + TOBN(0x9085c4ea, 0x3f83169b), TOBN(0xfa9423bb, 0x06908228)}, + {TOBN(0x2ffebe12, 0xfe97a5b9), TOBN(0x85da6049, 0x71b99118), + TOBN(0x9cbc2f7f, 0x63178846), TOBN(0xfd96bc70, 0x9153218e)}}, + {{TOBN(0x958381db, 0x1782269b), TOBN(0xae34bf79, 0x2597e550), + TOBN(0xbb5c6064, 0x5f385153), TOBN(0x6f0e96af, 0xe3088048)}, + {TOBN(0xbf6a0215, 0x77884456), TOBN(0xb3b5688c, 0x69310ea7), + TOBN(0x17c94295, 0x04fad2de), TOBN(0xe020f0e5, 0x17896d4d)}}, + {{TOBN(0x730ba0ab, 0x0976505f), TOBN(0x567f6813, 0x095e2ec5), + TOBN(0x47062010, 0x6331ab71), TOBN(0x72cfa977, 0x41d22b9f)}, + {TOBN(0x33e55ead, 0x8a2373da), TOBN(0xa8d0d5f4, 0x7ba45a68), + TOBN(0xba1d8f9c, 0x03029d15), TOBN(0x8f34f1cc, 0xfc55b9f3)}}, + {{TOBN(0xcca4428d, 0xbbe5a1a9), TOBN(0x8187fd5f, 0x3126bd67), + TOBN(0x0036973a, 0x48105826), TOBN(0xa39b6663, 0xb8bd61a0)}, + {TOBN(0x6d42deef, 0x2d65a808), TOBN(0x4969044f, 0x94636b19), + TOBN(0xf611ee47, 0xdd5d564c), TOBN(0x7b2f3a49, 0xd2873077)}}, + {{TOBN(0x94157d45, 0x300eb294), TOBN(0x2b2a656e, 0x169c1494), + TOBN(0xc000dd76, 0xd3a47aa9), TOBN(0xa2864e4f, 0xa6243ea4)}, + {TOBN(0x82716c47, 0xdb89842e), TOBN(0x12dfd7d7, 0x61479fb7), + TOBN(0x3b9a2c56, 0xe0b2f6dc), TOBN(0x46be862a, 0xd7f85d67)}}, + {{TOBN(0x03b0d8dd, 0x0f82b214), TOBN(0x460c34f9, 0xf103cbc6), + TOBN(0xf32e5c03, 0x18d79e19), TOBN(0x8b8888ba, 0xa84117f8)}, + {TOBN(0x8f3c37dc, 0xc0722677), TOBN(0x10d21be9, 0x1c1c0f27), + TOBN(0xd47c8468, 0xe0f7a0c6), TOBN(0x9bf02213, 0xadecc0e0)}}, + {{TOBN(0x0baa7d12, 0x42b48b99), TOBN(0x1bcb665d, 0x48424096), + TOBN(0x8b847cd6, 0xebfb5cfb), TOBN(0x87c2ae56, 0x9ad4d10d)}, + {TOBN(0xf1cbb122, 0x0de36726), TOBN(0xe7043c68, 0x3fdfbd21), + TOBN(0x4bd0826a, 0x4e79d460), TOBN(0x11f5e598, 0x4bd1a2cb)}}, + {{TOBN(0x97554160, 0xb7fe7b6e), TOBN(0x7d16189a, 0x400a3fb2), + TOBN(0xd73e9bea, 0xe328ca1e), TOBN(0x0dd04b97, 0xe793d8cc)}, + {TOBN(0xa9c83c9b, 0x506db8cc), TOBN(0x5cd47aae, 0xcf38814c), + TOBN(0x26fc430d, 0xb64b45e6), TOBN(0x079b5499, 0xd818ea84)}}, + {{TOBN(0xebb01102, 0xc1c24a3b), TOBN(0xca24e568, 0x1c161c1a), + TOBN(0x103eea69, 0x36f00a4a), TOBN(0x9ad76ee8, 0x76176c7b)}, + {TOBN(0x97451fc2, 0x538e0ff7), TOBN(0x94f89809, 0x6604b3b0), + TOBN(0x6311436e, 0x3249cfd7), TOBN(0x27b4a7bd, 0x41224f69)}}, + {{TOBN(0x03b5d21a, 0xe0ac2941), TOBN(0x279b0254, 0xc2d31937), + TOBN(0x3307c052, 0xcac992d0), TOBN(0x6aa7cb92, 0xefa8b1f3)}, + {TOBN(0x5a182580, 0x0d37c7a5), TOBN(0x13380c37, 0x342d5422), + TOBN(0x92ac2d66, 0xd5d2ef92), TOBN(0x035a70c9, 0x030c63c6)}}, + {{TOBN(0xc16025dd, 0x4ce4f152), TOBN(0x1f419a71, 0xf9df7c06), + TOBN(0x6d5b2214, 0x91e4bb14), TOBN(0xfc43c6cc, 0x839fb4ce)}, + {TOBN(0x49f06591, 0x925d6b2d), TOBN(0x4b37d9d3, 0x62186598), + TOBN(0x8c54a971, 0xd01b1629), TOBN(0xe1a9c29f, 0x51d50e05)}}, + {{TOBN(0x5109b785, 0x71ba1861), TOBN(0x48b22d5c, 0xd0c8f93d), + TOBN(0xe8fa84a7, 0x8633bb93), TOBN(0x53fba6ba, 0x5aebbd08)}, + {TOBN(0x7ff27df3, 0xe5eea7d8), TOBN(0x521c8796, 0x68ca7158), + TOBN(0xb9d5133b, 0xce6f1a05), TOBN(0x2d50cd53, 0xfd0ebee4)}}, + {{TOBN(0xc82115d6, 0xc5a3ef16), TOBN(0x993eff9d, 0xba079221), + TOBN(0xe4da2c5e, 0x4b5da81c), TOBN(0x9a89dbdb, 0x8033fd85)}, + {TOBN(0x60819ebf, 0x2b892891), TOBN(0x53902b21, 0x5d14a4d5), + TOBN(0x6ac35051, 0xd7fda421), TOBN(0xcc6ab885, 0x61c83284)}}, + {{TOBN(0x14eba133, 0xf74cff17), TOBN(0x240aaa03, 0xecb813f2), + TOBN(0xcfbb6540, 0x6f665bee), TOBN(0x084b1fe4, 0xa425ad73)}, + {TOBN(0x009d5d16, 0xd081f6a6), TOBN(0x35304fe8, 0xeef82c90), + TOBN(0xf20346d5, 0xaa9eaa22), TOBN(0x0ada9f07, 0xac1c91e3)}}, + {{TOBN(0xa6e21678, 0x968a6144), TOBN(0x54c1f77c, 0x07b31a1e), + TOBN(0xd6bb787e, 0x5781fbe1), TOBN(0x61bd2ee0, 0xe31f1c4a)}, + {TOBN(0xf25aa1e9, 0x781105fc), TOBN(0x9cf2971f, 0x7b2f8e80), + TOBN(0x26d15412, 0xcdff919b), TOBN(0x01db4ebe, 0x34bc896e)}}, + {{TOBN(0x7d9b3e23, 0xb40df1cf), TOBN(0x59337373, 0x94e971b4), + TOBN(0xbf57bd14, 0x669cf921), TOBN(0x865daedf, 0x0c1a1064)}, + {TOBN(0x3eb70bd3, 0x83279125), TOBN(0xbc3d5b9f, 0x34ecdaab), + TOBN(0x91e3ed7e, 0x5f755caf), TOBN(0x49699f54, 0xd41e6f02)}}, + {{TOBN(0x185770e1, 0xd4a7a15b), TOBN(0x08f3587a, 0xeaac87e7), + TOBN(0x352018db, 0x473133ea), TOBN(0x674ce719, 0x04fd30fc)}, + {TOBN(0x7b8d9835, 0x088b3e0e), TOBN(0x7a0356a9, 0x5d0d47a1), + TOBN(0x9d9e7659, 0x6474a3c4), TOBN(0x61ea48a7, 0xff66966c)}}, + {{TOBN(0x30417758, 0x0f3e4834), TOBN(0xfdbb21c2, 0x17a9afcb), + TOBN(0x756fa17f, 0x2f9a67b3), TOBN(0x2a6b2421, 0xa245c1a8)}, + {TOBN(0x64be2794, 0x4af02291), TOBN(0xade465c6, 0x2a5804fe), + TOBN(0x8dffbd39, 0xa6f08fd7), TOBN(0xc4efa84c, 0xaa14403b)}}, + {{TOBN(0xa1b91b2a, 0x442b0f5c), TOBN(0xb748e317, 0xcf997736), + TOBN(0x8d1b62bf, 0xcee90e16), TOBN(0x907ae271, 0x0b2078c0)}, + {TOBN(0xdf31534b, 0x0c9bcddd), TOBN(0x043fb054, 0x39adce83), + TOBN(0x99031043, 0xd826846a), TOBN(0x61a9c0d6, 0xb144f393)}}, + {{TOBN(0xdab48046, 0x47718427), TOBN(0xdf17ff9b, 0x6e830f8b), + TOBN(0x408d7ee8, 0xe49a1347), TOBN(0x6ac71e23, 0x91c1d4ae)}, + {TOBN(0xc8cbb9fd, 0x1defd73c), TOBN(0x19840657, 0xbbbbfec5), + TOBN(0x39db1cb5, 0x9e7ef8ea), TOBN(0x78aa8296, 0x64105f30)}}, + {{TOBN(0xa3d9b7f0, 0xa3738c29), TOBN(0x0a2f235a, 0xbc3250a3), + TOBN(0x55e506f6, 0x445e4caf), TOBN(0x0974f73d, 0x33475f7a)}, + {TOBN(0xd37dbba3, 0x5ba2f5a8), TOBN(0x542c6e63, 0x6af40066), + TOBN(0x26d99b53, 0xc5d73e2c), TOBN(0x06060d7d, 0x6c3ca33e)}}, + {{TOBN(0xcdbef1c2, 0x065fef4a), TOBN(0x77e60f7d, 0xfd5b92e3), + TOBN(0xd7c549f0, 0x26708350), TOBN(0x201b3ad0, 0x34f121bf)}, + {TOBN(0x5fcac2a1, 0x0334fc14), TOBN(0x8a9a9e09, 0x344552f6), + TOBN(0x7dd8a1d3, 0x97653082), TOBN(0x5fc0738f, 0x79d4f289)}}, + {{TOBN(0x787d244d, 0x17d2d8c3), TOBN(0xeffc6345, 0x70830684), + TOBN(0x5ddb96dd, 0xe4f73ae5), TOBN(0x8efb14b1, 0x172549a5)}, + {TOBN(0x6eb73eee, 0x2245ae7a), TOBN(0xbca4061e, 0xea11f13e), + TOBN(0xb577421d, 0x30b01f5d), TOBN(0xaa688b24, 0x782e152c)}}, + {{TOBN(0x67608e71, 0xbd3502ba), TOBN(0x4ef41f24, 0xb4de75a0), + TOBN(0xb08dde5e, 0xfd6125e5), TOBN(0xde484825, 0xa409543f)}, + {TOBN(0x1f198d98, 0x65cc2295), TOBN(0x428a3771, 0x6e0edfa2), + TOBN(0x4f9697a2, 0xadf35fc7), TOBN(0x01a43c79, 0xf7cac3c7)}}, + {{TOBN(0xb05d7059, 0x0fd3659a), TOBN(0x8927f30c, 0xbb7f2d9a), + TOBN(0x4023d1ac, 0x8cf984d3), TOBN(0x32125ed3, 0x02897a45)}, + {TOBN(0xfb572dad, 0x3d414205), TOBN(0x73000ef2, 0xe3fa82a9), + TOBN(0x4c0868e9, 0xf10a5581), TOBN(0x5b61fc67, 0x6b0b3ca5)}}, + {{TOBN(0xc1258d5b, 0x7cae440c), TOBN(0x21c08b41, 0x402b7531), + TOBN(0xf61a8955, 0xde932321), TOBN(0x3568faf8, 0x2d1408af)}, + {TOBN(0x71b15e99, 0x9ecf965b), TOBN(0xf14ed248, 0xe917276f), + TOBN(0xc6f4caa1, 0x820cf9e2), TOBN(0x681b20b2, 0x18d83c7e)}}, + {{TOBN(0x6cde738d, 0xc6c01120), TOBN(0x71db0813, 0xae70e0db), + TOBN(0x95fc0644, 0x74afe18c), TOBN(0x34619053, 0x129e2be7)}, + {TOBN(0x80615cea, 0xdb2a3b15), TOBN(0x0a49a19e, 0xdb4c7073), + TOBN(0x0e1b84c8, 0x8fd2d367), TOBN(0xd74bf462, 0x033fb8aa)}}, + {{TOBN(0x889f6d65, 0x533ef217), TOBN(0x7158c7e4, 0xc3ca2e87), + TOBN(0xfb670dfb, 0xdc2b4167), TOBN(0x75910a01, 0x844c257f)}, + {TOBN(0xf336bf07, 0xcf88577d), TOBN(0x22245250, 0xe45e2ace), + TOBN(0x2ed92e8d, 0x7ca23d85), TOBN(0x29f8be4c, 0x2b812f58)}}, + {{TOBN(0xdd9ebaa7, 0x076fe12b), TOBN(0x3f2400cb, 0xae1537f9), + TOBN(0x1aa93528, 0x17bdfb46), TOBN(0xc0f98430, 0x67883b41)}, + {TOBN(0x5590ede1, 0x0170911d), TOBN(0x7562f5bb, 0x34d4b17f), + TOBN(0xe1fa1df2, 0x1826b8d2), TOBN(0xb40b796a, 0x6bd80d59)}}, + {{TOBN(0xd65bf197, 0x3467ba92), TOBN(0x8c9b46db, 0xf70954b0), + TOBN(0x97c8a0f3, 0x0e78f15d), TOBN(0xa8f3a69a, 0x85a4c961)}, + {TOBN(0x4242660f, 0x61e4ce9b), TOBN(0xbf06aab3, 0x6ea6790c), + TOBN(0xc6706f8e, 0xec986416), TOBN(0x9e56dec1, 0x9a9fc225)}}, + {{TOBN(0x527c46f4, 0x9a9898d9), TOBN(0xd799e77b, 0x5633cdef), + TOBN(0x24eacc16, 0x7d9e4297), TOBN(0xabb61cea, 0x6b1cb734)}, + {TOBN(0xbee2e8a7, 0xf778443c), TOBN(0x3bb42bf1, 0x29de2fe6), + TOBN(0xcbed86a1, 0x3003bb6f), TOBN(0xd3918e6c, 0xd781cdf6)}}, + {{TOBN(0x4bee3271, 0x9a5103f1), TOBN(0x5243efc6, 0xf50eac06), + TOBN(0xb8e122cb, 0x6adcc119), TOBN(0x1b7faa84, 0xc0b80a08)}, + {TOBN(0x32c3d1bd, 0x6dfcd08c), TOBN(0x129dec4e, 0x0be427de), + TOBN(0x98ab679c, 0x1d263c83), TOBN(0xafc83cb7, 0xcef64eff)}}, + {{TOBN(0x85eb6088, 0x2fa6be76), TOBN(0x892585fb, 0x1328cbfe), + TOBN(0xc154d3ed, 0xcf618dda), TOBN(0xc44f601b, 0x3abaf26e)}, + {TOBN(0x7bf57d0b, 0x2be1fdfd), TOBN(0xa833bd2d, 0x21137fee), + TOBN(0x9353af36, 0x2db591a8), TOBN(0xc76f26dc, 0x5562a056)}}, + {{TOBN(0x1d87e47d, 0x3fdf5a51), TOBN(0x7afb5f93, 0x55c9cab0), + TOBN(0x91bbf58f, 0x89e0586e), TOBN(0x7c72c018, 0x0d843709)}, + {TOBN(0xa9a5aafb, 0x99b5c3dc), TOBN(0xa48a0f1d, 0x3844aeb0), + TOBN(0x7178b7dd, 0xb667e482), TOBN(0x453985e9, 0x6e23a59a)}}, + {{TOBN(0x4a54c860, 0x01b25dd8), TOBN(0x0dd37f48, 0xfb897c8a), + TOBN(0x5f8aa610, 0x0ea90cd9), TOBN(0xc8892c68, 0x16d5830d)}, + {TOBN(0xeb4befc0, 0xef514ca5), TOBN(0x478eb679, 0xe72c9ee6), + TOBN(0x9bca20da, 0xdbc40d5f), TOBN(0xf015de21, 0xdde4f64a)}}, + {{TOBN(0xaa6a4de0, 0xeaf4b8a5), TOBN(0x68cfd9ca, 0x4bc60e32), + TOBN(0x668a4b01, 0x7fd15e70), TOBN(0xd9f0694a, 0xf27dc09d)}, + {TOBN(0xf6c3cad5, 0xba708bcd), TOBN(0x5cd2ba69, 0x5bb95c2a), + TOBN(0xaa28c1d3, 0x33c0a58f), TOBN(0x23e274e3, 0xabc77870)}}, + {{TOBN(0x44c3692d, 0xdfd20a4a), TOBN(0x091c5fd3, 0x81a66653), + TOBN(0x6c0bb691, 0x09a0757d), TOBN(0x9072e8b9, 0x667343ea)}, + {TOBN(0x31d40eb0, 0x80848bec), TOBN(0x95bd480a, 0x79fd36cc), + TOBN(0x01a77c61, 0x65ed43f5), TOBN(0xafccd127, 0x2e0d40bf)}}, + {{TOBN(0xeccfc82d, 0x1cc1884b), TOBN(0xc85ac201, 0x5d4753b4), + TOBN(0xc7a6caac, 0x658e099f), TOBN(0xcf46369e, 0x04b27390)}, + {TOBN(0xe2e7d049, 0x506467ea), TOBN(0x481b63a2, 0x37cdeccc), + TOBN(0x4029abd8, 0xed80143a), TOBN(0x28bfe3c7, 0xbcb00b88)}}, + {{TOBN(0x3bec1009, 0x0643d84a), TOBN(0x885f3668, 0xabd11041), + TOBN(0xdb02432c, 0xf83a34d6), TOBN(0x32f7b360, 0x719ceebe)}, + {TOBN(0xf06c7837, 0xdad1fe7a), TOBN(0x60a157a9, 0x5441a0b0), + TOBN(0x704970e9, 0xe2d47550), TOBN(0xcd2bd553, 0x271b9020)}}, + {{TOBN(0xff57f82f, 0x33e24a0b), TOBN(0x9cbee23f, 0xf2565079), + TOBN(0x16353427, 0xeb5f5825), TOBN(0x276feec4, 0xe948d662)}, + {TOBN(0xd1b62bc6, 0xda10032b), TOBN(0x718351dd, 0xf0e72a53), + TOBN(0x93452076, 0x2420e7ba), TOBN(0x96368fff, 0x3a00118d)}}, + {{TOBN(0x00ce2d26, 0x150a49e4), TOBN(0x0c28b636, 0x3f04706b), + TOBN(0xbad65a46, 0x58b196d0), TOBN(0x6c8455fc, 0xec9f8b7c)}, + {TOBN(0xe90c895f, 0x2d71867e), TOBN(0x5c0be31b, 0xedf9f38c), + TOBN(0x2a37a15e, 0xd8f6ec04), TOBN(0x239639e7, 0x8cd85251)}}, + {{TOBN(0xd8975315, 0x9c7c4c6b), TOBN(0x603aa3c0, 0xd7409af7), + TOBN(0xb8d53d0c, 0x007132fb), TOBN(0x68d12af7, 0xa6849238)}, + {TOBN(0xbe0607e7, 0xbf5d9279), TOBN(0x9aa50055, 0xaada74ce), + TOBN(0xe81079cb, 0xba7e8ccb), TOBN(0x610c71d1, 0xa5f4ff5e)}}, + {{TOBN(0x9e2ee1a7, 0x5aa07093), TOBN(0xca84004b, 0xa75da47c), + TOBN(0x074d3951, 0x3de75401), TOBN(0xf938f756, 0xbb311592)}, + {TOBN(0x96197618, 0x00a43421), TOBN(0x39a25362, 0x07bc78c8), + TOBN(0x278f710a, 0x0a171276), TOBN(0xb28446ea, 0x8d1a8f08)}}, + {{TOBN(0x184781bf, 0xe3b6a661), TOBN(0x7751cb1d, 0xe6d279f7), + TOBN(0xf8ff95d6, 0xc59eb662), TOBN(0x186d90b7, 0x58d3dea7)}, + {TOBN(0x0e4bb6c1, 0xdfb4f754), TOBN(0x5c5cf56b, 0x2b2801dc), + TOBN(0xc561e452, 0x1f54564d), TOBN(0xb4fb8c60, 0xf0dd7f13)}}, + {{TOBN(0xf8849630, 0x33ff98c7), TOBN(0x9619fffa, 0xcf17769c), + TOBN(0xf8090bf6, 0x1bfdd80a), TOBN(0x14d9a149, 0x422cfe63)}, + {TOBN(0xb354c360, 0x6f6df9ea), TOBN(0xdbcf770d, 0x218f17ea), + TOBN(0x207db7c8, 0x79eb3480), TOBN(0x213dbda8, 0x559b6a26)}}, + {{TOBN(0xac4c200b, 0x29fc81b3), TOBN(0xebc3e09f, 0x171d87c1), + TOBN(0x91799530, 0x1481aa9e), TOBN(0x051b92e1, 0x92e114fa)}, + {TOBN(0xdf8f92e9, 0xecb5537f), TOBN(0x44b1b2cc, 0x290c7483), + TOBN(0xa711455a, 0x2adeb016), TOBN(0x964b6856, 0x81a10c2c)}}, + {{TOBN(0x4f159d99, 0xcec03623), TOBN(0x05532225, 0xef3271ea), + TOBN(0xb231bea3, 0xc5ee4849), TOBN(0x57a54f50, 0x7094f103)}, + {TOBN(0x3e2d421d, 0x9598b352), TOBN(0xe865a49c, 0x67412ab4), + TOBN(0xd2998a25, 0x1cc3a912), TOBN(0x5d092808, 0x0c74d65d)}}, + {{TOBN(0x73f45908, 0x4088567a), TOBN(0xeb6b280e, 0x1f214a61), + TOBN(0x8c9adc34, 0xcaf0c13d), TOBN(0x39d12938, 0xf561fb80)}, + {TOBN(0xb2dc3a5e, 0xbc6edfb4), TOBN(0x7485b1b1, 0xfe4d210e), + TOBN(0x062e0400, 0xe186ae72), TOBN(0x91e32d5c, 0x6eeb3b88)}}, + {{TOBN(0x6df574d7, 0x4be59224), TOBN(0xebc88ccc, 0x716d55f3), + TOBN(0x26c2e6d0, 0xcad6ed33), TOBN(0xc6e21e7d, 0x0d3e8b10)}, + {TOBN(0x2cc5840e, 0x5bcc36bb), TOBN(0x9292445e, 0x7da74f69), + TOBN(0x8be8d321, 0x4e5193a8), TOBN(0x3ec23629, 0x8df06413)}}, + {{TOBN(0xc7e9ae85, 0xb134defa), TOBN(0x6073b1d0, 0x1bb2d475), + TOBN(0xb9ad615e, 0x2863c00d), TOBN(0x9e29493d, 0x525f4ac4)}, + {TOBN(0xc32b1dea, 0x4e9acf4f), TOBN(0x3e1f01c8, 0xa50db88d), + TOBN(0xb05d70ea, 0x04da916c), TOBN(0x714b0d0a, 0xd865803e)}}, + {{TOBN(0x4bd493fc, 0x9920cb5e), TOBN(0x5b44b1f7, 0x92c7a3ac), + TOBN(0xa2a77293, 0xbcec9235), TOBN(0x5ee06e87, 0xcd378553)}, + {TOBN(0xceff8173, 0xda621607), TOBN(0x2bb03e4c, 0x99f5d290), + TOBN(0x2945106a, 0xa6f734ac), TOBN(0xb5056604, 0xd25c4732)}}, + {{TOBN(0x5945920c, 0xe079afee), TOBN(0x686e17a0, 0x6789831f), + TOBN(0x5966bee8, 0xb74a5ae5), TOBN(0x38a673a2, 0x1e258d46)}, + {TOBN(0xbd1cc1f2, 0x83141c95), TOBN(0x3b2ecf4f, 0x0e96e486), + TOBN(0xcd3aa896, 0x74e5fc78), TOBN(0x415ec10c, 0x2482fa7a)}}, + {{TOBN(0x15234419, 0x80503380), TOBN(0x513d917a, 0xd314b392), + TOBN(0xb0b52f4e, 0x63caecae), TOBN(0x07bf22ad, 0x2dc7780b)}, + {TOBN(0xe761e8a1, 0xe4306839), TOBN(0x1b3be962, 0x5dd7feaa), + TOBN(0x4fe728de, 0x74c778f1), TOBN(0xf1fa0bda, 0x5e0070f6)}}, + {{TOBN(0x85205a31, 0x6ec3f510), TOBN(0x2c7e4a14, 0xd2980475), + TOBN(0xde3c19c0, 0x6f30ebfd), TOBN(0xdb1c1f38, 0xd4b7e644)}, + {TOBN(0xfe291a75, 0x5dce364a), TOBN(0xb7b22a3c, 0x058f5be3), + TOBN(0x2cd2c302, 0x37fea38c), TOBN(0x2930967a, 0x2e17be17)}}, + {{TOBN(0x87f009de, 0x0c061c65), TOBN(0xcb014aac, 0xedc6ed44), + TOBN(0x49bd1cb4, 0x3bafb1eb), TOBN(0x81bd8b5c, 0x282d3688)}, + {TOBN(0x1cdab87e, 0xf01a17af), TOBN(0x21f37ac4, 0xe710063b), + TOBN(0x5a6c5676, 0x42fc8193), TOBN(0xf4753e70, 0x56a6015c)}}, + {{TOBN(0x020f795e, 0xa15b0a44), TOBN(0x8f37c8d7, 0x8958a958), + TOBN(0x63b7e89b, 0xa4b675b5), TOBN(0xb4fb0c0c, 0x0fc31aea)}, + {TOBN(0xed95e639, 0xa7ff1f2e), TOBN(0x9880f5a3, 0x619614fb), + TOBN(0xdeb6ff02, 0x947151ab), TOBN(0x5bc5118c, 0xa868dcdb)}}, + {{TOBN(0xd8da2055, 0x4c20cea5), TOBN(0xcac2776e, 0x14c4d69a), + TOBN(0xcccb22c1, 0x622d599b), TOBN(0xa4ddb653, 0x68a9bb50)}, + {TOBN(0x2c4ff151, 0x1b4941b4), TOBN(0xe1ff19b4, 0x6efba588), + TOBN(0x35034363, 0xc48345e0), TOBN(0x45542e3d, 0x1e29dfc4)}}, + {{TOBN(0xf197cb91, 0x349f7aed), TOBN(0x3b2b5a00, 0x8fca8420), + TOBN(0x7c175ee8, 0x23aaf6d8), TOBN(0x54dcf421, 0x35af32b6)}, + {TOBN(0x0ba14307, 0x27d6561e), TOBN(0x879d5ee4, 0xd175b1e2), + TOBN(0xc7c43673, 0x99807db5), TOBN(0x77a54455, 0x9cd55bcd)}}, + {{TOBN(0xe6c2ff13, 0x0105c072), TOBN(0x18f7a99f, 0x8dda7da4), + TOBN(0x4c301820, 0x0e2d35c1), TOBN(0x06a53ca0, 0xd9cc6c82)}, + {TOBN(0xaa21cc1e, 0xf1aa1d9e), TOBN(0x32414334, 0x4a75b1e8), + TOBN(0x2a6d1328, 0x0ebe9fdc), TOBN(0x16bd173f, 0x98a4755a)}}, + {{TOBN(0xfbb9b245, 0x2133ffd9), TOBN(0x39a8b2f1, 0x830f1a20), + TOBN(0x484bc97d, 0xd5a1f52a), TOBN(0xd6aebf56, 0xa40eddf8)}, + {TOBN(0x32257acb, 0x76ccdac6), TOBN(0xaf4d36ec, 0x1586ff27), + TOBN(0x8eaa8863, 0xf8de7dd1), TOBN(0x0045d5cf, 0x88647c16)}}}, + {{{TOBN(0xa6f3d574, 0xc005979d), TOBN(0xc2072b42, 0x6a40e350), + TOBN(0xfca5c156, 0x8de2ecf9), TOBN(0xa8c8bf5b, 0xa515344e)}, + {TOBN(0x97aee555, 0x114df14a), TOBN(0xd4374a4d, 0xfdc5ec6b), + TOBN(0x754cc28f, 0x2ca85418), TOBN(0x71cb9e27, 0xd3c41f78)}}, + {{TOBN(0x89105079, 0x03605c39), TOBN(0xf0843d9e, 0xa142c96c), + TOBN(0xf3744934, 0x16923684), TOBN(0x732caa2f, 0xfa0a2893)}, + {TOBN(0xb2e8c270, 0x61160170), TOBN(0xc32788cc, 0x437fbaa3), + TOBN(0x39cd818e, 0xa6eda3ac), TOBN(0xe2e94239, 0x9e2b2e07)}}, + {{TOBN(0x6967d39b, 0x0260e52a), TOBN(0xd42585cc, 0x90653325), + TOBN(0x0d9bd605, 0x21ca7954), TOBN(0x4fa20877, 0x81ed57b3)}, + {TOBN(0x60c1eff8, 0xe34a0bbe), TOBN(0x56b0040c, 0x84f6ef64), + TOBN(0x28be2b24, 0xb1af8483), TOBN(0xb2278163, 0xf5531614)}}, + {{TOBN(0x8df27545, 0x5922ac1c), TOBN(0xa7b3ef5c, 0xa52b3f63), + TOBN(0x8e77b214, 0x71de57c4), TOBN(0x31682c10, 0x834c008b)}, + {TOBN(0xc76824f0, 0x4bd55d31), TOBN(0xb6d1c086, 0x17b61c71), + TOBN(0x31db0903, 0xc2a5089d), TOBN(0x9c092172, 0x184e5d3f)}}, + {{TOBN(0xdd7ced5b, 0xc00cc638), TOBN(0x1a2015eb, 0x61278fc2), + TOBN(0x2e8e5288, 0x6a37f8d6), TOBN(0xc457786f, 0xe79933ad)}, + {TOBN(0xb3fe4cce, 0x2c51211a), TOBN(0xad9b10b2, 0x24c20498), + TOBN(0x90d87a4f, 0xd28db5e5), TOBN(0x698cd105, 0x3aca2fc3)}}, + {{TOBN(0x4f112d07, 0xe91b536d), TOBN(0xceb982f2, 0x9eba09d6), + TOBN(0x3c157b2c, 0x197c396f), TOBN(0xe23c2d41, 0x7b66eb24)}, + {TOBN(0x480c57d9, 0x3f330d37), TOBN(0xb3a4c8a1, 0x79108deb), + TOBN(0x702388de, 0xcb199ce5), TOBN(0x0b019211, 0xb944a8d4)}}, + {{TOBN(0x24f2a692, 0x840bb336), TOBN(0x7c353bdc, 0xa669fa7b), + TOBN(0xda20d6fc, 0xdec9c300), TOBN(0x625fbe2f, 0xa13a4f17)}, + {TOBN(0xa2b1b61a, 0xdbc17328), TOBN(0x008965bf, 0xa9515621), + TOBN(0x49690939, 0xc620ff46), TOBN(0x182dd27d, 0x8717e91c)}}, + {{TOBN(0x5ace5035, 0xea6c3997), TOBN(0x54259aaa, 0xc2610bef), + TOBN(0xef18bb3f, 0x3c80dd39), TOBN(0x6910b95b, 0x5fc3fa39)}, + {TOBN(0xfce2f510, 0x43e09aee), TOBN(0xced56c9f, 0xa7675665), + TOBN(0x10e265ac, 0xd872db61), TOBN(0x6982812e, 0xae9fce69)}}, + {{TOBN(0x29be11c6, 0xce800998), TOBN(0x72bb1752, 0xb90360d9), + TOBN(0x2c193197, 0x5a4ad590), TOBN(0x2ba2f548, 0x9fc1dbc0)}, + {TOBN(0x7fe4eebb, 0xe490ebe0), TOBN(0x12a0a4cd, 0x7fae11c0), + TOBN(0x7197cf81, 0xe903ba37), TOBN(0xcf7d4aa8, 0xde1c6dd8)}}, + {{TOBN(0x92af6bf4, 0x3fd5684c), TOBN(0x2b26eecf, 0x80360aa1), + TOBN(0xbd960f30, 0x00546a82), TOBN(0x407b3c43, 0xf59ad8fe)}, + {TOBN(0x86cae5fe, 0x249c82ba), TOBN(0x9e0faec7, 0x2463744c), + TOBN(0x87f551e8, 0x94916272), TOBN(0x033f9344, 0x6ceb0615)}}, + {{TOBN(0x1e5eb0d1, 0x8be82e84), TOBN(0x89967f0e, 0x7a582fef), + TOBN(0xbcf687d5, 0xa6e921fa), TOBN(0xdfee4cf3, 0xd37a09ba)}, + {TOBN(0x94f06965, 0xb493c465), TOBN(0x638b9a1c, 0x7635c030), + TOBN(0x76667864, 0x66f05e9f), TOBN(0xccaf6808, 0xc04da725)}}, + {{TOBN(0xca2eb690, 0x768fccfc), TOBN(0xf402d37d, 0xb835b362), + TOBN(0x0efac0d0, 0xe2fdfcce), TOBN(0xefc9cdef, 0xb638d990)}, + {TOBN(0x2af12b72, 0xd1669a8b), TOBN(0x33c536bc, 0x5774ccbd), + TOBN(0x30b21909, 0xfb34870e), TOBN(0xc38fa2f7, 0x7df25aca)}}, + {{TOBN(0x74c5f02b, 0xbf81f3f5), TOBN(0x0525a5ae, 0xaf7e4581), + TOBN(0x88d2aaba, 0x433c54ae), TOBN(0xed9775db, 0x806a56c5)}, + {TOBN(0xd320738a, 0xc0edb37d), TOBN(0x25fdb6ee, 0x66cc1f51), + TOBN(0xac661d17, 0x10600d76), TOBN(0x931ec1f3, 0xbdd1ed76)}}, + {{TOBN(0x65c11d62, 0x19ee43f1), TOBN(0x5cd57c3e, 0x60829d97), + TOBN(0xd26c91a3, 0x984be6e8), TOBN(0xf08d9309, 0x8b0c53bd)}, + {TOBN(0x94bc9e5b, 0xc016e4ea), TOBN(0xd3916839, 0x11d43d2b), + TOBN(0x886c5ad7, 0x73701155), TOBN(0xe0377626, 0x20b00715)}}, + {{TOBN(0x7f01c9ec, 0xaa80ba59), TOBN(0x3083411a, 0x68538e51), + TOBN(0x970370f1, 0xe88128af), TOBN(0x625cc3db, 0x91dec14b)}, + {TOBN(0xfef9666c, 0x01ac3107), TOBN(0xb2a8d577, 0xd5057ac3), + TOBN(0xb0f26299, 0x92be5df7), TOBN(0xf579c8e5, 0x00353924)}}, + {{TOBN(0xb8fa3d93, 0x1341ed7a), TOBN(0x4223272c, 0xa7b59d49), + TOBN(0x3dcb1947, 0x83b8c4a4), TOBN(0x4e413c01, 0xed1302e4)}, + {TOBN(0x6d999127, 0xe17e44ce), TOBN(0xee86bf75, 0x33b3adfb), + TOBN(0xf6902fe6, 0x25aa96ca), TOBN(0xb73540e4, 0xe5aae47d)}}, + {{TOBN(0x32801d7b, 0x1b4a158c), TOBN(0xe571c99e, 0x27e2a369), + TOBN(0x40cb76c0, 0x10d9f197), TOBN(0xc308c289, 0x3167c0ae)}, + {TOBN(0xa6ef9dd3, 0xeb7958f2), TOBN(0xa7226dfc, 0x300879b1), + TOBN(0x6cd0b362, 0x7edf0636), TOBN(0x4efbce6c, 0x7bc37eed)}}, + {{TOBN(0x75f92a05, 0x8d699021), TOBN(0x586d4c79, 0x772566e3), + TOBN(0x378ca5f1, 0x761ad23a), TOBN(0x650d86fc, 0x1465a8ac)}, + {TOBN(0x7a4ed457, 0x842ba251), TOBN(0x6b65e3e6, 0x42234933), + TOBN(0xaf1543b7, 0x31aad657), TOBN(0xa4cefe98, 0xcbfec369)}}, + {{TOBN(0xb587da90, 0x9f47befb), TOBN(0x6562e9fb, 0x41312d13), + TOBN(0xa691ea59, 0xeff1cefe), TOBN(0xcc30477a, 0x05fc4cf6)}, + {TOBN(0xa1632461, 0x0b0ffd3d), TOBN(0xa1f16f3b, 0x5b355956), + TOBN(0x5b148d53, 0x4224ec24), TOBN(0xdc834e7b, 0xf977012a)}}, + {{TOBN(0x7bfc5e75, 0xb2c69dbc), TOBN(0x3aa77a29, 0x03c3da6c), + TOBN(0xde0df03c, 0xca910271), TOBN(0xcbd5ca4a, 0x7806dc55)}, + {TOBN(0xe1ca5807, 0x6db476cb), TOBN(0xfde15d62, 0x5f37a31e), + TOBN(0xf49af520, 0xf41af416), TOBN(0x96c5c5b1, 0x7d342db5)}}, + {{TOBN(0x155c43b7, 0xeb4ceb9b), TOBN(0x2e993010, 0x4e77371a), + TOBN(0x1d2987da, 0x675d43af), TOBN(0xef2bc1c0, 0x8599fd72)}, + {TOBN(0x96894b7b, 0x9342f6b2), TOBN(0x201eadf2, 0x7c8e71f0), + TOBN(0xf3479d9f, 0x4a1f3efc), TOBN(0xe0f8a742, 0x702a9704)}}, + {{TOBN(0xeafd44b6, 0xb3eba40c), TOBN(0xf9739f29, 0xc1c1e0d0), + TOBN(0x0091471a, 0x619d505e), TOBN(0xc15f9c96, 0x9d7c263e)}, + {TOBN(0x5be47285, 0x83afbe33), TOBN(0xa3b6d6af, 0x04f1e092), + TOBN(0xe76526b9, 0x751a9d11), TOBN(0x2ec5b26d, 0x9a4ae4d2)}}, + {{TOBN(0xeb66f4d9, 0x02f6fb8d), TOBN(0x4063c561, 0x96912164), + TOBN(0xeb7050c1, 0x80ef3000), TOBN(0x288d1c33, 0xeaa5b3f0)}, + {TOBN(0xe87c68d6, 0x07806fd8), TOBN(0xb2f7f9d5, 0x4bbbf50f), + TOBN(0x25972f3a, 0xac8d6627), TOBN(0xf8547774, 0x10e8c13b)}}, + {{TOBN(0xcc50ef6c, 0x872b4a60), TOBN(0xab2a34a4, 0x4613521b), + TOBN(0x39c5c190, 0x983e15d1), TOBN(0x61dde5df, 0x59905512)}, + {TOBN(0xe417f621, 0x9f2275f3), TOBN(0x0750c8b6, 0x451d894b), + TOBN(0x75b04ab9, 0x78b0bdaa), TOBN(0x3bfd9fd4, 0x458589bd)}}, + {{TOBN(0xf1013e30, 0xee9120b6), TOBN(0x2b51af93, 0x23a4743e), + TOBN(0xea96ffae, 0x48d14d9e), TOBN(0x71dc0dbe, 0x698a1d32)}, + {TOBN(0x914962d2, 0x0180cca4), TOBN(0x1ae60677, 0xc3568963), + TOBN(0x8cf227b1, 0x437bc444), TOBN(0xc650c83b, 0xc9962c7a)}}, + {{TOBN(0x23c2c7dd, 0xfe7ccfc4), TOBN(0xf925c89d, 0x1b929d48), + TOBN(0x4460f74b, 0x06783c33), TOBN(0xac2c8d49, 0xa590475a)}, + {TOBN(0xfb40b407, 0xb807bba0), TOBN(0x9d1e362d, 0x69ff8f3a), + TOBN(0xa33e9681, 0xcbef64a4), TOBN(0x67ece5fa, 0x332fb4b2)}}, + {{TOBN(0x6900a99b, 0x739f10e3), TOBN(0xc3341ca9, 0xff525925), + TOBN(0xee18a626, 0xa9e2d041), TOBN(0xa5a83685, 0x29580ddd)}, + {TOBN(0xf3470c81, 0x9d7de3cd), TOBN(0xedf02586, 0x2062cf9c), + TOBN(0xf43522fa, 0xc010edb0), TOBN(0x30314135, 0x13a4b1ae)}}, + {{TOBN(0xc792e02a, 0xdb22b94b), TOBN(0x993d8ae9, 0xa1eaa45b), + TOBN(0x8aad6cd3, 0xcd1e1c63), TOBN(0x89529ca7, 0xc5ce688a)}, + {TOBN(0x2ccee3aa, 0xe572a253), TOBN(0xe02b6438, 0x02a21efb), + TOBN(0xa7091b6e, 0xc9430358), TOBN(0x06d1b1fa, 0x9d7db504)}}, + {{TOBN(0x58846d32, 0xc4744733), TOBN(0x40517c71, 0x379f9e34), + TOBN(0x2f65655f, 0x130ef6ca), TOBN(0x526e4488, 0xf1f3503f)}, + {TOBN(0x8467bd17, 0x7ee4a976), TOBN(0x1d9dc913, 0x921363d1), + TOBN(0xd8d24c33, 0xb069e041), TOBN(0x5eb5da0a, 0x2cdf7f51)}}, + {{TOBN(0x1c0f3cb1, 0x197b994f), TOBN(0x3c95a6c5, 0x2843eae9), + TOBN(0x7766ffc9, 0xa6097ea5), TOBN(0x7bea4093, 0xd723b867)}, + {TOBN(0xb48e1f73, 0x4db378f9), TOBN(0x70025b00, 0xe37b77ac), + TOBN(0x943dc8e7, 0xaf24ad46), TOBN(0xb98a15ac, 0x16d00a85)}}, + {{TOBN(0x3adc38ba, 0x2743b004), TOBN(0xb1c7f4f7, 0x334415ee), + TOBN(0xea43df8f, 0x1e62d05a), TOBN(0x32618905, 0x9d76a3b6)}, + {TOBN(0x2fbd0bb5, 0xa23a0f46), TOBN(0x5bc971db, 0x6a01918c), + TOBN(0x7801d94a, 0xb4743f94), TOBN(0xb94df65e, 0x676ae22b)}}, + {{TOBN(0xaafcbfab, 0xaf95894c), TOBN(0x7b9bdc07, 0x276b2241), + TOBN(0xeaf98362, 0x5bdda48b), TOBN(0x5977faf2, 0xa3fcb4df)}, + {TOBN(0xbed042ef, 0x052c4b5b), TOBN(0x9fe87f71, 0x067591f0), + TOBN(0xc89c73ca, 0x22f24ec7), TOBN(0x7d37fa9e, 0xe64a9f1b)}}, + {{TOBN(0x2710841a, 0x15562627), TOBN(0x2c01a613, 0xc243b034), + TOBN(0x1d135c56, 0x2bc68609), TOBN(0xc2ca1715, 0x8b03f1f6)}, + {TOBN(0xc9966c2d, 0x3eb81d82), TOBN(0xc02abf4a, 0x8f6df13e), + TOBN(0x77b34bd7, 0x8f72b43b), TOBN(0xaff6218f, 0x360c82b0)}}, + {{TOBN(0x0aa5726c, 0x8d55b9d2), TOBN(0xdc0adbe9, 0x99e9bffb), + TOBN(0x9097549c, 0xefb9e72a), TOBN(0x16755712, 0x9dfb3111)}, + {TOBN(0xdd8bf984, 0xf26847f9), TOBN(0xbcb8e387, 0xdfb30cb7), + TOBN(0xc1fd32a7, 0x5171ef9c), TOBN(0x977f3fc7, 0x389b363f)}}, + {{TOBN(0x116eaf2b, 0xf4babda0), TOBN(0xfeab68bd, 0xf7113c8e), + TOBN(0xd1e3f064, 0xb7def526), TOBN(0x1ac30885, 0xe0b3fa02)}, + {TOBN(0x1c5a6e7b, 0x40142d9d), TOBN(0x839b5603, 0x30921c0b), + TOBN(0x48f301fa, 0x36a116a3), TOBN(0x380e1107, 0xcfd9ee6d)}}, + {{TOBN(0x7945ead8, 0x58854be1), TOBN(0x4111c12e, 0xcbd4d49d), + TOBN(0xece3b1ec, 0x3a29c2ef), TOBN(0x6356d404, 0x8d3616f5)}, + {TOBN(0x9f0d6a8f, 0x594d320e), TOBN(0x0989316d, 0xf651ccd2), + TOBN(0x6c32117a, 0x0f8fdde4), TOBN(0x9abe5cc5, 0xa26a9bbc)}}, + {{TOBN(0xcff560fb, 0x9723f671), TOBN(0x21b2a12d, 0x7f3d593c), + TOBN(0xe4cb18da, 0x24ba0696), TOBN(0x186e2220, 0xc3543384)}, + {TOBN(0x722f64e0, 0x88312c29), TOBN(0x94282a99, 0x17dc7752), + TOBN(0x62467bbf, 0x5a85ee89), TOBN(0xf435c650, 0xf10076a0)}}, + {{TOBN(0xc9ff1539, 0x43b3a50b), TOBN(0x7132130c, 0x1a53efbc), + TOBN(0x31bfe063, 0xf7b0c5b7), TOBN(0xb0179a7d, 0x4ea994cc)}, + {TOBN(0x12d064b3, 0xc85f455b), TOBN(0x47259328, 0x8f6e0062), + TOBN(0xf64e590b, 0xb875d6d9), TOBN(0x22dd6225, 0xad92bcc7)}}, + {{TOBN(0xb658038e, 0xb9c3bd6d), TOBN(0x00cdb0d6, 0xfbba27c8), + TOBN(0x0c681337, 0x1062c45d), TOBN(0xd8515b8c, 0x2d33407d)}, + {TOBN(0xcb8f699e, 0x8cbb5ecf), TOBN(0x8c4347f8, 0xc608d7d8), + TOBN(0x2c11850a, 0xbb3e00db), TOBN(0x20a8dafd, 0xecb49d19)}}, + {{TOBN(0xbd781480, 0x45ee2f40), TOBN(0x75e354af, 0x416b60cf), + TOBN(0xde0b58a1, 0x8d49a8c4), TOBN(0xe40e94e2, 0xfa359536)}, + {TOBN(0xbd4fa59f, 0x62accd76), TOBN(0x05cf466a, 0x8c762837), + TOBN(0xb5abda99, 0x448c277b), TOBN(0x5a9e01bf, 0x48b13740)}}, + {{TOBN(0x9d457798, 0x326aad8d), TOBN(0xbdef4954, 0xc396f7e7), + TOBN(0x6fb274a2, 0xc253e292), TOBN(0x2800bf0a, 0x1cfe53e7)}, + {TOBN(0x22426d31, 0x44438fd4), TOBN(0xef233923, 0x5e259f9a), + TOBN(0x4188503c, 0x03f66264), TOBN(0x9e5e7f13, 0x7f9fdfab)}}, + {{TOBN(0x565eb76c, 0x5fcc1aba), TOBN(0xea632548, 0x59b5bff8), + TOBN(0x5587c087, 0xaab6d3fa), TOBN(0x92b639ea, 0x6ce39c1b)}, + {TOBN(0x0706e782, 0x953b135c), TOBN(0x7308912e, 0x425268ef), + TOBN(0x599e92c7, 0x090e7469), TOBN(0x83b90f52, 0x9bc35e75)}}, + {{TOBN(0x4750b3d0, 0x244975b3), TOBN(0xf3a44358, 0x11965d72), + TOBN(0x179c6774, 0x9c8dc751), TOBN(0xff18cdfe, 0xd23d9ff0)}, + {TOBN(0xc4013833, 0x2028e247), TOBN(0x96e280e2, 0xf3bfbc79), + TOBN(0xf60417bd, 0xd0880a84), TOBN(0x263c9f3d, 0x2a568151)}}, + {{TOBN(0x36be15b3, 0x2d2ce811), TOBN(0x846dc0c2, 0xf8291d21), + TOBN(0x5cfa0ecb, 0x789fcfdb), TOBN(0x45a0beed, 0xd7535b9a)}, + {TOBN(0xec8e9f07, 0x96d69af1), TOBN(0x31a7c5b8, 0x599ab6dc), + TOBN(0xd36d45ef, 0xf9e2e09f), TOBN(0x3cf49ef1, 0xdcee954b)}}, + {{TOBN(0x6be34cf3, 0x086cff9b), TOBN(0x88dbd491, 0x39a3360f), + TOBN(0x1e96b8cc, 0x0dbfbd1d), TOBN(0xc1e5f7bf, 0xcb7e2552)}, + {TOBN(0x0547b214, 0x28819d98), TOBN(0xc770dd9c, 0x7aea9dcb), + TOBN(0xaef0d4c7, 0x041d68c8), TOBN(0xcc2b9818, 0x13cb9ba8)}}, + {{TOBN(0x7fc7bc76, 0xfe86c607), TOBN(0x6b7b9337, 0x502a9a95), + TOBN(0x1948dc27, 0xd14dab63), TOBN(0x249dd198, 0xdae047be)}, + {TOBN(0xe8356584, 0xa981a202), TOBN(0x3531dd18, 0x3a893387), + TOBN(0x1be11f90, 0xc85c7209), TOBN(0x93d2fe1e, 0xe2a52b5a)}}, + {{TOBN(0x8225bfe2, 0xec6d6b97), TOBN(0x9cf6d6f4, 0xbd0aa5de), + TOBN(0x911459cb, 0x54779f5f), TOBN(0x5649cddb, 0x86aeb1f3)}, + {TOBN(0x32133579, 0x3f26ce5a), TOBN(0xc289a102, 0x550f431e), + TOBN(0x559dcfda, 0x73b84c6f), TOBN(0x84973819, 0xee3ac4d7)}}, + {{TOBN(0xb51e55e6, 0xf2606a82), TOBN(0xe25f7061, 0x90f2fb57), + TOBN(0xacef6c2a, 0xb1a4e37c), TOBN(0x864e359d, 0x5dcf2706)}, + {TOBN(0x479e6b18, 0x7ce57316), TOBN(0x2cab2500, 0x3a96b23d), + TOBN(0xed489862, 0x8ef16df7), TOBN(0x2056538c, 0xef3758b5)}}, + {{TOBN(0xa7df865e, 0xf15d3101), TOBN(0x80c5533a, 0x61b553d7), + TOBN(0x366e1997, 0x4ed14294), TOBN(0x6620741f, 0xb3c0bcd6)}, + {TOBN(0x21d1d9c4, 0xedc45418), TOBN(0x005b859e, 0xc1cc4a9d), + TOBN(0xdf01f630, 0xa1c462f0), TOBN(0x15d06cf3, 0xf26820c7)}}, + {{TOBN(0x9f7f24ee, 0x3484be47), TOBN(0x2ff33e96, 0x4a0c902f), + TOBN(0x00bdf457, 0x5a0bc453), TOBN(0x2378dfaf, 0x1aa238db)}, + {TOBN(0x272420ec, 0x856720f2), TOBN(0x2ad9d95b, 0x96797291), + TOBN(0xd1242cc6, 0x768a1558), TOBN(0x2e287f8b, 0x5cc86aa8)}}, + {{TOBN(0x796873d0, 0x990cecaa), TOBN(0xade55f81, 0x675d4080), + TOBN(0x2645eea3, 0x21f0cd84), TOBN(0x7a1efa0f, 0xb4e17d02)}, + {TOBN(0xf6858420, 0x037cc061), TOBN(0x682e05f0, 0xd5d43e12), + TOBN(0x59c36994, 0x27218710), TOBN(0x85cbba4d, 0x3f7cd2fc)}}, + {{TOBN(0x726f9729, 0x7a3cd22a), TOBN(0x9f8cd5dc, 0x4a628397), + TOBN(0x17b93ab9, 0xc23165ed), TOBN(0xff5f5dbf, 0x122823d4)}, + {TOBN(0xc1e4e4b5, 0x654a446d), TOBN(0xd1a9496f, 0x677257ba), + TOBN(0x6387ba94, 0xde766a56), TOBN(0x23608bc8, 0x521ec74a)}}, + {{TOBN(0x16a522d7, 0x6688c4d4), TOBN(0x9d6b4282, 0x07373abd), + TOBN(0xa62f07ac, 0xb42efaa3), TOBN(0xf73e00f7, 0xe3b90180)}, + {TOBN(0x36175fec, 0x49421c3e), TOBN(0xc4e44f9b, 0x3dcf2678), + TOBN(0x76df436b, 0x7220f09f), TOBN(0x172755fb, 0x3aa8b6cf)}}, + {{TOBN(0xbab89d57, 0x446139cc), TOBN(0x0a0a6e02, 0x5fe0208f), + TOBN(0xcdbb63e2, 0x11e5d399), TOBN(0x33ecaa12, 0xa8977f0b)}, + {TOBN(0x59598b21, 0xf7c42664), TOBN(0xb3e91b32, 0xab65d08a), + TOBN(0x035822ee, 0xf4502526), TOBN(0x1dcf0176, 0x720a82a9)}}, + {{TOBN(0x50f8598f, 0x3d589e02), TOBN(0xdf0478ff, 0xb1d63d2c), + TOBN(0x8b8068bd, 0x1571cd07), TOBN(0x30c3aa4f, 0xd79670cd)}, + {TOBN(0x25e8fd4b, 0x941ade7f), TOBN(0x3d1debdc, 0x32790011), + TOBN(0x65b6dcbd, 0x3a3f9ff0), TOBN(0x282736a4, 0x793de69c)}}, + {{TOBN(0xef69a0c3, 0xd41d3bd3), TOBN(0xb533b8c9, 0x07a26bde), + TOBN(0xe2801d97, 0xdb2edf9f), TOBN(0xdc4a8269, 0xe1877af0)}, + {TOBN(0x6c1c5851, 0x3d590dbe), TOBN(0x84632f6b, 0xee4e9357), + TOBN(0xd36d36b7, 0x79b33374), TOBN(0xb46833e3, 0x9bbca2e6)}}, + {{TOBN(0x37893913, 0xf7fc0586), TOBN(0x385315f7, 0x66bf4719), + TOBN(0x72c56293, 0xb31855dc), TOBN(0xd1416d4e, 0x849061fe)}, + {TOBN(0xbeb3ab78, 0x51047213), TOBN(0x447f6e61, 0xf040c996), + TOBN(0xd06d310d, 0x638b1d0c), TOBN(0xe28a413f, 0xbad1522e)}}, + {{TOBN(0x685a76cb, 0x82003f86), TOBN(0x610d07f7, 0x0bcdbca3), + TOBN(0x6ff66021, 0x9ca4c455), TOBN(0x7df39b87, 0xcea10eec)}, + {TOBN(0xb9255f96, 0xe22db218), TOBN(0x8cc6d9eb, 0x08a34c44), + TOBN(0xcd4ffb86, 0x859f9276), TOBN(0x8fa15eb2, 0x50d07335)}}, + {{TOBN(0xdf553845, 0xcf2c24b5), TOBN(0x89f66a9f, 0x52f9c3ba), + TOBN(0x8f22b5b9, 0xe4a7ceb3), TOBN(0xaffef809, 0x0e134686)}, + {TOBN(0x3e53e1c6, 0x8eb8fac2), TOBN(0x93c1e4eb, 0x28aec98e), + TOBN(0xb6b91ec5, 0x32a43bcb), TOBN(0x2dbfa947, 0xb2d74a51)}}, + {{TOBN(0xe065d190, 0xca84bad7), TOBN(0xfb13919f, 0xad58e65c), + TOBN(0x3c41718b, 0xf1cb6e31), TOBN(0x688969f0, 0x06d05c3f)}, + {TOBN(0xd4f94ce7, 0x21264d45), TOBN(0xfdfb65e9, 0x7367532b), + TOBN(0x5b1be8b1, 0x0945a39d), TOBN(0x229f789c, 0x2b8baf3b)}}, + {{TOBN(0xd8f41f3e, 0x6f49f15d), TOBN(0x678ce828, 0x907f0792), + TOBN(0xc69ace82, 0xfca6e867), TOBN(0x106451ae, 0xd01dcc89)}, + {TOBN(0x1bb4f7f0, 0x19fc32d2), TOBN(0x64633dfc, 0xb00c52d2), + TOBN(0x8f13549a, 0xad9ea445), TOBN(0x99a3bf50, 0xfb323705)}}, + {{TOBN(0x0c9625a2, 0x534d4dbc), TOBN(0x45b8f1d1, 0xc2a2fea3), + TOBN(0x76ec21a1, 0xa530fc1a), TOBN(0x4bac9c2a, 0x9e5bd734)}, + {TOBN(0x5996d76a, 0x7b4e3587), TOBN(0x0045cdee, 0x1182d9e3), + TOBN(0x1aee24b9, 0x1207f13d), TOBN(0x66452e97, 0x97345a41)}}, + {{TOBN(0x16e5b054, 0x9f950cd0), TOBN(0x9cc72fb1, 0xd7fdd075), + TOBN(0x6edd61e7, 0x66249663), TOBN(0xde4caa4d, 0xf043cccb)}, + {TOBN(0x11b1f57a, 0x55c7ac17), TOBN(0x779cbd44, 0x1a85e24d), + TOBN(0x78030f86, 0xe46081e7), TOBN(0xfd4a6032, 0x8e20f643)}}, + {{TOBN(0xcc7a6488, 0x0a750c0f), TOBN(0x39bacfe3, 0x4e548e83), + TOBN(0x3d418c76, 0x0c110f05), TOBN(0x3e4daa4c, 0xb1f11588)}, + {TOBN(0x2733e7b5, 0x5ffc69ff), TOBN(0x46f147bc, 0x92053127), + TOBN(0x885b2434, 0xd722df94), TOBN(0x6a444f65, 0xe6fc6b7c)}}}, + {{{TOBN(0x7a1a465a, 0xc3f16ea8), TOBN(0x115a461d, 0xb2f1d11c), + TOBN(0x4767dd95, 0x6c68a172), TOBN(0x3392f2eb, 0xd13a4698)}, + {TOBN(0xc7a99ccd, 0xe526cdc7), TOBN(0x8e537fdc, 0x22292b81), + TOBN(0x76d8cf69, 0xa6d39198), TOBN(0xffc5ff43, 0x2446852d)}}, + {{TOBN(0x97b14f7e, 0xa90567e6), TOBN(0x513257b7, 0xb6ae5cb7), + TOBN(0x85454a3c, 0x9f10903d), TOBN(0xd8d2c9ad, 0x69bc3724)}, + {TOBN(0x38da9324, 0x6b29cb44), TOBN(0xb540a21d, 0x77c8cbac), + TOBN(0x9bbfe435, 0x01918e42), TOBN(0xfffa707a, 0x56c3614e)}}, + {{TOBN(0x0ce4e3f1, 0xd4e353b7), TOBN(0x062d8a14, 0xef46b0a0), + TOBN(0x6408d5ab, 0x574b73fd), TOBN(0xbc41d1c9, 0xd3273ffd)}, + {TOBN(0x3538e1e7, 0x6be77800), TOBN(0x71fe8b37, 0xc5655031), + TOBN(0x1cd91621, 0x6b9b331a), TOBN(0xad825d0b, 0xbb388f73)}}, + {{TOBN(0x56c2e05b, 0x1cb76219), TOBN(0x0ec0bf91, 0x71567e7e), + TOBN(0xe7076f86, 0x61c4c910), TOBN(0xd67b085b, 0xbabc04d9)}, + {TOBN(0x9fb90459, 0x5e93a96a), TOBN(0x7526c1ea, 0xfbdc249a), + TOBN(0x0d44d367, 0xecdd0bb7), TOBN(0x95399917, 0x9dc0d695)}}, + {{TOBN(0x61360ee9, 0x9e240d18), TOBN(0x057cdcac, 0xb4b94466), + TOBN(0xe7667cd1, 0x2fe5325c), TOBN(0x1fa297b5, 0x21974e3b)}, + {TOBN(0xfa4081e7, 0xdb083d76), TOBN(0x31993be6, 0xf206bd15), + TOBN(0x8949269b, 0x14c19f8c), TOBN(0x21468d72, 0xa9d92357)}}, + {{TOBN(0x2ccbc583, 0xa4c506ec), TOBN(0x957ed188, 0xd1acfe97), + TOBN(0x8baed833, 0x12f1aea2), TOBN(0xef2a6cb4, 0x8325362d)}, + {TOBN(0x130dde42, 0x8e195c43), TOBN(0xc842025a, 0x0e6050c6), + TOBN(0x2da972a7, 0x08686a5d), TOBN(0xb52999a1, 0xe508b4a8)}}, + {{TOBN(0xd9f090b9, 0x10a5a8bd), TOBN(0xca91d249, 0x096864da), + TOBN(0x8e6a93be, 0x3f67dbc1), TOBN(0xacae6fba, 0xf5f4764c)}, + {TOBN(0x1563c6e0, 0xd21411a0), TOBN(0x28fa787f, 0xda0a4ad8), + TOBN(0xd524491c, 0x908c8030), TOBN(0x1257ba0e, 0x4c795f07)}}, + {{TOBN(0x83f49167, 0xceca9754), TOBN(0x426d2cf6, 0x4b7939a0), + TOBN(0x2555e355, 0x723fd0bf), TOBN(0xa96e6d06, 0xc4f144e2)}, + {TOBN(0x4768a8dd, 0x87880e61), TOBN(0x15543815, 0xe508e4d5), + TOBN(0x09d7e772, 0xb1b65e15), TOBN(0x63439dd6, 0xac302fa0)}}, + {{TOBN(0xb93f802f, 0xc14e35c2), TOBN(0x71735b7c, 0x4341333c), + TOBN(0x03a25104, 0x16d4f362), TOBN(0x3f4d069b, 0xbf433c8e)}, + {TOBN(0x0d83ae01, 0xf78f5a7c), TOBN(0x50a8ffbe, 0x7c4eed07), + TOBN(0xc74f8906, 0x76e10f83), TOBN(0x7d080966, 0x9ddaf8e1)}}, + {{TOBN(0xb11df8e1, 0x698e04cc), TOBN(0x877be203, 0x169005c8), + TOBN(0x32749e8c, 0x4f3c6179), TOBN(0x2dbc9d0a, 0x7853fc05)}, + {TOBN(0x187d4f93, 0x9454d937), TOBN(0xe682ce9d, 0xb4800e1b), + TOBN(0xa9129ad8, 0x165e68e8), TOBN(0x0fe29735, 0xbe7f785b)}}, + {{TOBN(0x5303f40c, 0x5b9e02b7), TOBN(0xa37c9692, 0x35ee04e8), + TOBN(0x5f46cc20, 0x34d6632b), TOBN(0x55ef72b2, 0x96ac545b)}, + {TOBN(0xabec5c1f, 0x7b91b062), TOBN(0x0a79e1c7, 0xbb33e821), + TOBN(0xbb04b428, 0x3a9f4117), TOBN(0x0de1f28f, 0xfd2a475a)}}, + {{TOBN(0x31019ccf, 0x3a4434b4), TOBN(0xa3458111, 0x1a7954dc), + TOBN(0xa9dac80d, 0xe34972a7), TOBN(0xb043d054, 0x74f6b8dd)}, + {TOBN(0x021c319e, 0x11137b1a), TOBN(0x00a754ce, 0xed5cc03f), + TOBN(0x0aa2c794, 0xcbea5ad4), TOBN(0x093e67f4, 0x70c015b6)}}, + {{TOBN(0x72cdfee9, 0xc97e3f6b), TOBN(0xc10bcab4, 0xb6da7461), + TOBN(0x3b02d2fc, 0xb59806b9), TOBN(0x85185e89, 0xa1de6f47)}, + {TOBN(0x39e6931f, 0x0eb6c4d4), TOBN(0x4d4440bd, 0xd4fa5b04), + TOBN(0x5418786e, 0x34be7eb8), TOBN(0x6380e521, 0x9d7259bc)}}, + {{TOBN(0x20ac0351, 0xd598d710), TOBN(0x272c4166, 0xcb3a4da4), + TOBN(0xdb82fe1a, 0xca71de1f), TOBN(0x746e79f2, 0xd8f54b0f)}, + {TOBN(0x6e7fc736, 0x4b573e9b), TOBN(0x75d03f46, 0xfd4b5040), + TOBN(0x5c1cc36d, 0x0b98d87b), TOBN(0x513ba3f1, 0x1f472da1)}}, + {{TOBN(0x79d0af26, 0xabb177dd), TOBN(0xf82ab568, 0x7891d564), + TOBN(0x2b6768a9, 0x72232173), TOBN(0xefbb3bb0, 0x8c1f6619)}, + {TOBN(0xb29c11db, 0xa6d18358), TOBN(0x519e2797, 0xb0916d3a), + TOBN(0xd4dc18f0, 0x9188e290), TOBN(0x648e86e3, 0x98b0ca7f)}}, + {{TOBN(0x859d3145, 0x983c38b5), TOBN(0xb14f176c, 0x637abc8b), + TOBN(0x2793fb9d, 0xcaff7be6), TOBN(0xebe5a55f, 0x35a66a5a)}, + {TOBN(0x7cec1dcd, 0x9f87dc59), TOBN(0x7c595cd3, 0xfbdbf560), + TOBN(0x5b543b22, 0x26eb3257), TOBN(0x69080646, 0xc4c935fd)}}, + {{TOBN(0x7f2e4403, 0x81e9ede3), TOBN(0x243c3894, 0xcaf6df0a), + TOBN(0x7c605bb1, 0x1c073b11), TOBN(0xcd06a541, 0xba6a4a62)}, + {TOBN(0x29168949, 0x49d4e2e5), TOBN(0x33649d07, 0x4af66880), + TOBN(0xbfc0c885, 0xe9a85035), TOBN(0xb4e52113, 0xfc410f4b)}}, + {{TOBN(0xdca3b706, 0x78a6513b), TOBN(0x92ea4a2a, 0x9edb1943), + TOBN(0x02642216, 0xdb6e2dd8), TOBN(0x9b45d0b4, 0x9fd57894)}, + {TOBN(0x114e70db, 0xc69d11ae), TOBN(0x1477dd19, 0x4c57595f), + TOBN(0xbc2208b4, 0xec77c272), TOBN(0x95c5b4d7, 0xdb68f59c)}}, + {{TOBN(0xb8c4fc63, 0x42e532b7), TOBN(0x386ba422, 0x9ae35290), + TOBN(0xfb5dda42, 0xd201ecbc), TOBN(0x2353dc8b, 0xa0e38fd6)}, + {TOBN(0x9a0b85ea, 0x68f7e978), TOBN(0x96ec5682, 0x2ad6d11f), + TOBN(0x5e279d6c, 0xe5f6886d), TOBN(0xd3fe03cd, 0x3cb1914d)}}, + {{TOBN(0xfe541fa4, 0x7ea67c77), TOBN(0x952bd2af, 0xe3ea810c), + TOBN(0x791fef56, 0x8d01d374), TOBN(0xa3a1c621, 0x0f11336e)}, + {TOBN(0x5ad0d5a9, 0xc7ec6d79), TOBN(0xff7038af, 0x3225c342), + TOBN(0x003c6689, 0xbc69601b), TOBN(0x25059bc7, 0x45e8747d)}}, + {{TOBN(0xfa4965b2, 0xf2086fbf), TOBN(0xf6840ea6, 0x86916078), + TOBN(0xd7ac7620, 0x70081d6c), TOBN(0xe600da31, 0xb5328645)}, + {TOBN(0x01916f63, 0x529b8a80), TOBN(0xe80e4858, 0x2d7d6f3e), + TOBN(0x29eb0fe8, 0xd664ca7c), TOBN(0xf017637b, 0xe7b43b0c)}}, + {{TOBN(0x9a75c806, 0x76cb2566), TOBN(0x8f76acb1, 0xb24892d9), + TOBN(0x7ae7b9cc, 0x1f08fe45), TOBN(0x19ef7329, 0x6a4907d8)}, + {TOBN(0x2db4ab71, 0x5f228bf0), TOBN(0xf3cdea39, 0x817032d7), + TOBN(0x0b1f482e, 0xdcabe3c0), TOBN(0x3baf76b4, 0xbb86325c)}}, + {{TOBN(0xd49065e0, 0x10089465), TOBN(0x3bab5d29, 0x8e77c596), + TOBN(0x7636c3a6, 0x193dbd95), TOBN(0xdef5d294, 0xb246e499)}, + {TOBN(0xb22c58b9, 0x286b2475), TOBN(0xa0b93939, 0xcd80862b), + TOBN(0x3002c83a, 0xf0992388), TOBN(0x6de01f9b, 0xeacbe14c)}}, + {{TOBN(0x6aac688e, 0xadd70482), TOBN(0x708de92a, 0x7b4a4e8a), + TOBN(0x75b6dd73, 0x758a6eef), TOBN(0xea4bf352, 0x725b3c43)}, + {TOBN(0x10041f2c, 0x87912868), TOBN(0xb1b1be95, 0xef09297a), + TOBN(0x19ae23c5, 0xa9f3860a), TOBN(0xc4f0f839, 0x515dcf4b)}}, + {{TOBN(0x3c7ecca3, 0x97f6306a), TOBN(0x744c44ae, 0x68a3a4b0), + TOBN(0x69cd13a0, 0xb3a1d8a2), TOBN(0x7cad0a1e, 0x5256b578)}, + {TOBN(0xea653fcd, 0x33791d9e), TOBN(0x9cc2a05d, 0x74b2e05f), + TOBN(0x73b391dc, 0xfd7affa2), TOBN(0xddb7091e, 0xb6b05442)}}, + {{TOBN(0xc71e27bf, 0x8538a5c6), TOBN(0x195c63dd, 0x89abff17), + TOBN(0xfd315285, 0x1b71e3da), TOBN(0x9cbdfda7, 0xfa680fa0)}, + {TOBN(0x9db876ca, 0x849d7eab), TOBN(0xebe2764b, 0x3c273271), + TOBN(0x663357e3, 0xf208dcea), TOBN(0x8c5bd833, 0x565b1b70)}}, + {{TOBN(0xccc3b4f5, 0x9837fc0d), TOBN(0x9b641ba8, 0xa79cf00f), + TOBN(0x7428243d, 0xdfdf3990), TOBN(0x83a594c4, 0x020786b1)}, + {TOBN(0xb712451a, 0x526c4502), TOBN(0x9d39438e, 0x6adb3f93), + TOBN(0xfdb261e3, 0xe9ff0ccd), TOBN(0x80344e3c, 0xe07af4c3)}}, + {{TOBN(0x75900d7c, 0x2fa4f126), TOBN(0x08a3b865, 0x5c99a232), + TOBN(0x2478b6bf, 0xdb25e0c3), TOBN(0x482cc2c2, 0x71db2edf)}, + {TOBN(0x37df7e64, 0x5f321bb8), TOBN(0x8a93821b, 0x9a8005b4), + TOBN(0x3fa2f10c, 0xcc8c1958), TOBN(0x0d332218, 0x2c269d0a)}}, + {{TOBN(0x20ab8119, 0xe246b0e6), TOBN(0xb39781e4, 0xd349fd17), + TOBN(0xd293231e, 0xb31aa100), TOBN(0x4b779c97, 0xbb032168)}, + {TOBN(0x4b3f19e1, 0xc8470500), TOBN(0x45b7efe9, 0x0c4c869d), + TOBN(0xdb84f38a, 0xa1a6bbcc), TOBN(0x3b59cb15, 0xb2fddbc1)}}, + {{TOBN(0xba5514df, 0x3fd165e8), TOBN(0x499fd6a9, 0x061f8811), + TOBN(0x72cd1fe0, 0xbfef9f00), TOBN(0x120a4bb9, 0x79ad7e8a)}, + {TOBN(0xf2ffd095, 0x5f4a5ac5), TOBN(0xcfd174f1, 0x95a7a2f0), + TOBN(0xd42301ba, 0x9d17baf1), TOBN(0xd2fa487a, 0x77f22089)}}, + {{TOBN(0x9cb09efe, 0xb1dc77e1), TOBN(0xe9566939, 0x21c99682), + TOBN(0x8c546901, 0x6c6067bb), TOBN(0xfd378574, 0x61c24456)}, + {TOBN(0x2b6a6cbe, 0x81796b33), TOBN(0x62d550f6, 0x58e87f8b), + TOBN(0x1b763e1c, 0x7f1b01b4), TOBN(0x4b93cfea, 0x1b1b5e12)}}, + {{TOBN(0xb9345238, 0x1d531696), TOBN(0x57201c00, 0x88cdde69), + TOBN(0xdde92251, 0x9a86afc7), TOBN(0xe3043895, 0xbd35cea8)}, + {TOBN(0x7608c1e1, 0x8555970d), TOBN(0x8267dfa9, 0x2535935e), + TOBN(0xd4c60a57, 0x322ea38b), TOBN(0xe0bf7977, 0x804ef8b5)}}, + {{TOBN(0x1a0dab28, 0xc06fece4), TOBN(0xd405991e, 0x94e7b49d), + TOBN(0xc542b6d2, 0x706dab28), TOBN(0xcb228da3, 0xa91618fb)}, + {TOBN(0x224e4164, 0x107d1cea), TOBN(0xeb9fdab3, 0xd0f5d8f1), + TOBN(0xc02ba386, 0x0d6e41cd), TOBN(0x676a72c5, 0x9b1f7146)}}, + {{TOBN(0xffd6dd98, 0x4d6cb00b), TOBN(0xcef9c5ca, 0xde2e8d7c), + TOBN(0xa1bbf5d7, 0x641c7936), TOBN(0x1b95b230, 0xee8f772e)}, + {TOBN(0xf765a92e, 0xe8ac25b1), TOBN(0xceb04cfc, 0x3a18b7c6), + TOBN(0x27944cef, 0x0acc8966), TOBN(0xcbb3c957, 0x434c1004)}}, + {{TOBN(0x9c9971a1, 0xa43ff93c), TOBN(0x5bc2db17, 0xa1e358a9), + TOBN(0x45b4862e, 0xa8d9bc82), TOBN(0x70ebfbfb, 0x2201e052)}, + {TOBN(0xafdf64c7, 0x92871591), TOBN(0xea5bcae6, 0xb42d0219), + TOBN(0xde536c55, 0x2ad8f03c), TOBN(0xcd6c3f4d, 0xa76aa33c)}}, + {{TOBN(0xbeb5f623, 0x0bca6de3), TOBN(0xdd20dd99, 0xb1e706fd), + TOBN(0x90b3ff9d, 0xac9059d4), TOBN(0x2d7b2902, 0x7ccccc4e)}, + {TOBN(0x8a090a59, 0xce98840f), TOBN(0xa5d947e0, 0x8410680a), + TOBN(0x49ae346a, 0x923379a5), TOBN(0x7dbc84f9, 0xb28a3156)}}, + {{TOBN(0xfd40d916, 0x54a1aff2), TOBN(0xabf318ba, 0x3a78fb9b), + TOBN(0x50152ed8, 0x3029f95e), TOBN(0x9fc1dd77, 0xc58ad7fa)}, + {TOBN(0x5fa57915, 0x13595c17), TOBN(0xb9504668, 0x8f62b3a9), + TOBN(0x907b5b24, 0xff3055b0), TOBN(0x2e995e35, 0x9a84f125)}}, + {{TOBN(0x87dacf69, 0x7e9bbcfb), TOBN(0x95d0c1d6, 0xe86d96e3), + TOBN(0x65726e3c, 0x2d95a75c), TOBN(0x2c3c9001, 0xacd27f21)}, + {TOBN(0x1deab561, 0x6c973f57), TOBN(0x108b7e2c, 0xa5221643), + TOBN(0x5fee9859, 0xc4ef79d4), TOBN(0xbd62b88a, 0x40d4b8c6)}}, + {{TOBN(0xb4dd29c4, 0x197c75d6), TOBN(0x266a6df2, 0xb7076feb), + TOBN(0x9512d0ea, 0x4bf2df11), TOBN(0x1320c24f, 0x6b0cc9ec)}, + {TOBN(0x6bb1e0e1, 0x01a59596), TOBN(0x8317c5bb, 0xeff9aaac), + TOBN(0x65bb405e, 0x385aa6c9), TOBN(0x613439c1, 0x8f07988f)}}, + {{TOBN(0xd730049f, 0x16a66e91), TOBN(0xe97f2820, 0xfa1b0e0d), + TOBN(0x4131e003, 0x304c28ea), TOBN(0x820ab732, 0x526bac62)}, + {TOBN(0xb2ac9ef9, 0x28714423), TOBN(0x54ecfffa, 0xadb10cb2), + TOBN(0x8781476e, 0xf886a4cc), TOBN(0x4b2c87b5, 0xdb2f8d49)}}, + {{TOBN(0xe857cd20, 0x0a44295d), TOBN(0x707d7d21, 0x58c6b044), + TOBN(0xae8521f9, 0xf596757c), TOBN(0x87448f03, 0x67b2b714)}, + {TOBN(0x13a9bc45, 0x5ebcd58d), TOBN(0x79bcced9, 0x9122d3c1), + TOBN(0x3c644247, 0x9e076642), TOBN(0x0cf22778, 0x2df4767d)}}, + {{TOBN(0x5e61aee4, 0x71d444b6), TOBN(0x211236bf, 0xc5084a1d), + TOBN(0x7e15bc9a, 0x4fd3eaf6), TOBN(0x68df2c34, 0xab622bf5)}, + {TOBN(0x9e674f0f, 0x59bf4f36), TOBN(0xf883669b, 0xd7f34d73), + TOBN(0xc48ac1b8, 0x31497b1d), TOBN(0x323b925d, 0x5106703b)}}, + {{TOBN(0x22156f42, 0x74082008), TOBN(0xeffc521a, 0xc8482bcb), + TOBN(0x5c6831bf, 0x12173479), TOBN(0xcaa2528f, 0xc4739490)}, + {TOBN(0x84d2102a, 0x8f1b3c4d), TOBN(0xcf64dfc1, 0x2d9bec0d), + TOBN(0x433febad, 0x78a546ef), TOBN(0x1f621ec3, 0x7b73cef1)}}, + {{TOBN(0x6aecd627, 0x37338615), TOBN(0x162082ab, 0x01d8edf6), + TOBN(0x833a8119, 0x19e86b66), TOBN(0x6023a251, 0xd299b5db)}, + {TOBN(0xf5bb0c3a, 0xbbf04b89), TOBN(0x6735eb69, 0xae749a44), + TOBN(0xd0e058c5, 0x4713de3b), TOBN(0xfdf2593e, 0x2c3d4ccd)}}, + {{TOBN(0x1b8f414e, 0xfdd23667), TOBN(0xdd52aaca, 0xfa2015ee), + TOBN(0x3e31b517, 0xbd9625ff), TOBN(0x5ec9322d, 0x8db5918c)}, + {TOBN(0xbc73ac85, 0xa96f5294), TOBN(0x82aa5bf3, 0x61a0666a), + TOBN(0x49755810, 0xbf08ac42), TOBN(0xd21cdfd5, 0x891cedfc)}}, + {{TOBN(0x918cb57b, 0x67f8be10), TOBN(0x365d1a7c, 0x56ffa726), + TOBN(0x2435c504, 0x6532de93), TOBN(0xc0fc5e10, 0x2674cd02)}, + {TOBN(0x6e51fcf8, 0x9cbbb142), TOBN(0x1d436e5a, 0xafc50692), + TOBN(0x766bffff, 0x3fbcae22), TOBN(0x3148c2fd, 0xfd55d3b8)}}, + {{TOBN(0x52c7fdc9, 0x233222fa), TOBN(0x89ff1092, 0xe419fb6b), + TOBN(0x3cd6db99, 0x25254977), TOBN(0x2e85a161, 0x1cf12ca7)}, + {TOBN(0xadd2547c, 0xdc810bc9), TOBN(0xea3f458f, 0x9d257c22), + TOBN(0x642c1fbe, 0x27d6b19b), TOBN(0xed07e6b5, 0x140481a6)}}, + {{TOBN(0x6ada1d42, 0x86d2e0f8), TOBN(0xe5920122, 0x0e8a9fd5), + TOBN(0x02c936af, 0x708c1b49), TOBN(0x60f30fee, 0x2b4bfaff)}, + {TOBN(0x6637ad06, 0x858e6a61), TOBN(0xce4c7767, 0x3fd374d0), + TOBN(0x39d54b2d, 0x7188defb), TOBN(0xa8c9d250, 0xf56a6b66)}}, + {{TOBN(0x58fc0f5e, 0xb24fe1dc), TOBN(0x9eaf9dee, 0x6b73f24c), + TOBN(0xa90d588b, 0x33650705), TOBN(0xde5b62c5, 0xaf2ec729)}, + {TOBN(0x5c72cfae, 0xd3c2b36e), TOBN(0x868c19d5, 0x034435da), + TOBN(0x88605f93, 0xe17ee145), TOBN(0xaa60c4ee, 0x77a5d5b1)}}, + {{TOBN(0xbcf5bfd2, 0x3b60c472), TOBN(0xaf4ef13c, 0xeb1d3049), + TOBN(0x373f44fc, 0xe13895c9), TOBN(0xf29b382f, 0x0cbc9822)}, + {TOBN(0x1bfcb853, 0x73efaef6), TOBN(0xcf56ac9c, 0xa8c96f40), + TOBN(0xd7adf109, 0x7a191e24), TOBN(0x98035f44, 0xbf8a8dc2)}}, + {{TOBN(0xf40a71b9, 0x1e750c84), TOBN(0xc57f7b0c, 0x5dc6c469), + TOBN(0x49a0e79c, 0x6fbc19c1), TOBN(0x6b0f5889, 0xa48ebdb8)}, + {TOBN(0x5d3fd084, 0xa07c4e9f), TOBN(0xc3830111, 0xab27de14), + TOBN(0x0e4929fe, 0x33e08dcc), TOBN(0xf4a5ad24, 0x40bb73a3)}}, + {{TOBN(0xde86c2bf, 0x490f97ca), TOBN(0x288f09c6, 0x67a1ce18), + TOBN(0x364bb886, 0x1844478d), TOBN(0x7840fa42, 0xceedb040)}, + {TOBN(0x1269fdd2, 0x5a631b37), TOBN(0x94761f1e, 0xa47c8b7d), + TOBN(0xfc0c2e17, 0x481c6266), TOBN(0x85e16ea2, 0x3daa5fa7)}}, + {{TOBN(0xccd86033, 0x92491048), TOBN(0x0c2f6963, 0xf4d402d7), + TOBN(0x6336f7df, 0xdf6a865c), TOBN(0x0a2a463c, 0xb5c02a87)}, + {TOBN(0xb0e29be7, 0xbf2f12ee), TOBN(0xf0a22002, 0x66bad988), + TOBN(0x27f87e03, 0x9123c1d7), TOBN(0x21669c55, 0x328a8c98)}}, + {{TOBN(0x186b9803, 0x92f14529), TOBN(0xd3d056cc, 0x63954df3), + TOBN(0x2f03fd58, 0x175a46f6), TOBN(0x63e34ebe, 0x11558558)}, + {TOBN(0xe13fedee, 0x5b80cfa5), TOBN(0xe872a120, 0xd401dbd1), + TOBN(0x52657616, 0xe8a9d667), TOBN(0xbc8da4b6, 0xe08d6693)}}, + {{TOBN(0x370fb9bb, 0x1b703e75), TOBN(0x6773b186, 0xd4338363), + TOBN(0x18dad378, 0xecef7bff), TOBN(0xaac787ed, 0x995677da)}, + {TOBN(0x4801ea8b, 0x0437164b), TOBN(0xf430ad20, 0x73fe795e), + TOBN(0xb164154d, 0x8ee5eb73), TOBN(0x0884ecd8, 0x108f7c0e)}}, + {{TOBN(0x0e6ec096, 0x5f520698), TOBN(0x640631fe, 0x44f7b8d9), + TOBN(0x92fd34fc, 0xa35a68b9), TOBN(0x9c5a4b66, 0x4d40cf4e)}, + {TOBN(0x949454bf, 0x80b6783d), TOBN(0x80e701fe, 0x3a320a10), + TOBN(0x8d1a564a, 0x1a0a39b2), TOBN(0x1436d53d, 0x320587db)}}, + {{TOBN(0xf5096e6d, 0x6556c362), TOBN(0xbc23a3c0, 0xe2455d7e), + TOBN(0x3a7aee54, 0x807230f9), TOBN(0x9ba1cfa6, 0x22ae82fd)}, + {TOBN(0x833a057a, 0x99c5d706), TOBN(0x8be85f4b, 0x842315c9), + TOBN(0xd083179a, 0x66a72f12), TOBN(0x2fc77d5d, 0xcdcc73cd)}}, + {{TOBN(0x22b88a80, 0x5616ee30), TOBN(0xfb09548f, 0xe7ab1083), + TOBN(0x8ad6ab0d, 0x511270cd), TOBN(0x61f6c57a, 0x6924d9ab)}, + {TOBN(0xa0f7bf72, 0x90aecb08), TOBN(0x849f87c9, 0x0df784a4), + TOBN(0x27c79c15, 0xcfaf1d03), TOBN(0xbbf9f675, 0xc463face)}}, + {{TOBN(0x91502c65, 0x765ba543), TOBN(0x18ce3cac, 0x42ea60dd), + TOBN(0xe5cee6ac, 0x6e43ecb3), TOBN(0x63e4e910, 0x68f2aeeb)}, + {TOBN(0x26234fa3, 0xc85932ee), TOBN(0x96883e8b, 0x4c90c44d), + TOBN(0x29b9e738, 0xa18a50f6), TOBN(0xbfc62b2a, 0x3f0420df)}}, + {{TOBN(0xd22a7d90, 0x6d3e1fa9), TOBN(0x17115618, 0xfe05b8a3), + TOBN(0x2a0c9926, 0xbb2b9c01), TOBN(0xc739fcc6, 0xe07e76a2)}, + {TOBN(0x540e9157, 0x165e439a), TOBN(0x06353a62, 0x6a9063d8), + TOBN(0x84d95594, 0x61e927a3), TOBN(0x013b9b26, 0xe2e0be7f)}}, + {{TOBN(0x4feaec3b, 0x973497f1), TOBN(0x15c0f94e, 0x093ebc2d), + TOBN(0x6af5f227, 0x33af0583), TOBN(0x0c2af206, 0xc61f3340)}, + {TOBN(0xd25dbdf1, 0x4457397c), TOBN(0x2e8ed017, 0xcabcbae0), + TOBN(0xe3010938, 0xc2815306), TOBN(0xbaa99337, 0xe8c6cd68)}}, + {{TOBN(0x08513182, 0x3b0ec7de), TOBN(0x1e1b822b, 0x58df05df), + TOBN(0x5c14842f, 0xa5c3b683), TOBN(0x98fe977e, 0x3eba34ce)}, + {TOBN(0xfd2316c2, 0x0d5e8873), TOBN(0xe48d839a, 0xbd0d427d), + TOBN(0x495b2218, 0x623fc961), TOBN(0x24ee56e7, 0xb46fba5e)}}, + {{TOBN(0x9184a55b, 0x91e4de58), TOBN(0xa7488ca5, 0xdfdea288), + TOBN(0xa723862e, 0xa8dcc943), TOBN(0x92d762b2, 0x849dc0fc)}, + {TOBN(0x3c444a12, 0x091ff4a9), TOBN(0x581113fa, 0x0cada274), + TOBN(0xb9de0a45, 0x30d8eae2), TOBN(0x5e0fcd85, 0xdf6b41ea)}}, + {{TOBN(0x6233ea68, 0xc094dbb5), TOBN(0xb77d062e, 0xd968d410), + TOBN(0x3e719bbc, 0x58b3002d), TOBN(0x68e7dd3d, 0x3dc49d58)}, + {TOBN(0x8d825740, 0x013a5e58), TOBN(0x21311747, 0x3c9e3c1b), + TOBN(0x0cb0a2a7, 0x7c99b6ab), TOBN(0x5c48a3b3, 0xc2f888f2)}}}, + {{{TOBN(0xc7913e91, 0x991724f3), TOBN(0x5eda799c, 0x39cbd686), + TOBN(0xddb595c7, 0x63d4fc1e), TOBN(0x6b63b80b, 0xac4fed54)}, + {TOBN(0x6ea0fc69, 0x7e5fb516), TOBN(0x737708ba, 0xd0f1c964), + TOBN(0x9628745f, 0x11a92ca5), TOBN(0x61f37958, 0x9a86967a)}}, + {{TOBN(0x9af39b2c, 0xaa665072), TOBN(0x78322fa4, 0xefd324ef), + TOBN(0x3d153394, 0xc327bd31), TOBN(0x81d5f271, 0x3129dab0)}, + {TOBN(0xc72e0c42, 0xf48027f5), TOBN(0xaa40cdbc, 0x8536e717), + TOBN(0xf45a657a, 0x2d369d0f), TOBN(0xb03bbfc4, 0xea7f74e6)}}, + {{TOBN(0x46a8c418, 0x0d738ded), TOBN(0x6f1a5bb0, 0xe0de5729), + TOBN(0xf10230b9, 0x8ba81675), TOBN(0x32c6f30c, 0x112b33d4)}, + {TOBN(0x7559129d, 0xd8fffb62), TOBN(0x6a281b47, 0xb459bf05), + TOBN(0x77c1bd3a, 0xfa3b6776), TOBN(0x0709b380, 0x7829973a)}}, + {{TOBN(0x8c26b232, 0xa3326505), TOBN(0x38d69272, 0xee1d41bf), + TOBN(0x0459453e, 0xffe32afa), TOBN(0xce8143ad, 0x7cb3ea87)}, + {TOBN(0x932ec1fa, 0x7e6ab666), TOBN(0x6cd2d230, 0x22286264), + TOBN(0x459a46fe, 0x6736f8ed), TOBN(0x50bf0d00, 0x9eca85bb)}}, + {{TOBN(0x0b825852, 0x877a21ec), TOBN(0x300414a7, 0x0f537a94), + TOBN(0x3f1cba40, 0x21a9a6a2), TOBN(0x50824eee, 0x76943c00)}, + {TOBN(0xa0dbfcec, 0xf83cba5d), TOBN(0xf9538148, 0x93b4f3c0), + TOBN(0x61744162, 0x48f24dd7), TOBN(0x5322d64d, 0xe4fb09dd)}}, + {{TOBN(0x57447384, 0x3d9325f3), TOBN(0xa9bef2d0, 0xf371cb84), + TOBN(0x77d2188b, 0xa61e36c5), TOBN(0xbbd6a7d7, 0xc602df72)}, + {TOBN(0xba3aa902, 0x8f61bc0b), TOBN(0xf49085ed, 0x6ed0b6a1), + TOBN(0x8bc625d6, 0xae6e8298), TOBN(0x832b0b1d, 0xa2e9c01d)}}, + {{TOBN(0xa337c447, 0xf1f0ced1), TOBN(0x800cc793, 0x9492dd2b), + TOBN(0x4b93151d, 0xbea08efa), TOBN(0x820cf3f8, 0xde0a741e)}, + {TOBN(0xff1982dc, 0x1c0f7d13), TOBN(0xef921960, 0x84dde6ca), + TOBN(0x1ad7d972, 0x45f96ee3), TOBN(0x319c8dbe, 0x29dea0c7)}}, + {{TOBN(0xd3ea3871, 0x7b82b99b), TOBN(0x75922d4d, 0x470eb624), + TOBN(0x8f66ec54, 0x3b95d466), TOBN(0x66e673cc, 0xbee1e346)}, + {TOBN(0x6afe67c4, 0xb5f2b89a), TOBN(0x3de9c1e6, 0x290e5cd3), + TOBN(0x8c278bb6, 0x310a2ada), TOBN(0x420fa384, 0x0bdb323b)}}, + {{TOBN(0x0ae1d63b, 0x0eb919b0), TOBN(0xd74ee51d, 0xa74b9620), + TOBN(0x395458d0, 0xa674290c), TOBN(0x324c930f, 0x4620a510)}, + {TOBN(0x2d1f4d19, 0xfbac27d4), TOBN(0x4086e8ca, 0x9bedeeac), + TOBN(0x0cdd211b, 0x9b679ab8), TOBN(0x5970167d, 0x7090fec4)}}, + {{TOBN(0x3420f2c9, 0xfaf1fc63), TOBN(0x616d333a, 0x328c8bb4), + TOBN(0x7d65364c, 0x57f1fe4a), TOBN(0x9343e877, 0x55e5c73a)}, + {TOBN(0x5795176b, 0xe970e78c), TOBN(0xa36ccebf, 0x60533627), + TOBN(0xfc7c7380, 0x09cdfc1b), TOBN(0xb39a2afe, 0xb3fec326)}}, + {{TOBN(0xb7ff1ba1, 0x6224408a), TOBN(0xcc856e92, 0x247cfc5e), + TOBN(0x01f102e7, 0xc18bc493), TOBN(0x4613ab74, 0x2091c727)}, + {TOBN(0xaa25e89c, 0xc420bf2b), TOBN(0x00a53176, 0x90337ec2), + TOBN(0xd2be9f43, 0x7d025fc7), TOBN(0x3316fb85, 0x6e6fe3dc)}}, + {{TOBN(0x27520af5, 0x9ac50814), TOBN(0xfdf95e78, 0x9a8e4223), + TOBN(0xb7e7df2a, 0x56bec5a0), TOBN(0xf7022f7d, 0xdf159e5d)}, + {TOBN(0x93eeeab1, 0xcac1fe8f), TOBN(0x8040188c, 0x37451168), + TOBN(0x7ee8aa8a, 0xd967dce6), TOBN(0xfa0e79e7, 0x3abc9299)}}, + {{TOBN(0x67332cfc, 0x2064cfd1), TOBN(0x339c31de, 0xb0651934), + TOBN(0x719b28d5, 0x2a3bcbea), TOBN(0xee74c82b, 0x9d6ae5c6)}, + {TOBN(0x0927d05e, 0xbaf28ee6), TOBN(0x82cecf2c, 0x9d719028), + TOBN(0x0b0d353e, 0xddb30289), TOBN(0xfe4bb977, 0xfddb2e29)}}, + {{TOBN(0xbb5bb990, 0x640bfd9e), TOBN(0xd226e277, 0x82f62108), + TOBN(0x4bf00985, 0x02ffdd56), TOBN(0x7756758a, 0x2ca1b1b5)}, + {TOBN(0xc32b62a3, 0x5285fe91), TOBN(0xedbc546a, 0x8c9cd140), + TOBN(0x1e47a013, 0xaf5cb008), TOBN(0xbca7e720, 0x073ce8f2)}}, + {{TOBN(0xe10b2ab8, 0x17a91cae), TOBN(0xb89aab65, 0x08e27f63), + TOBN(0x7b3074a7, 0xdba3ddf9), TOBN(0x1c20ce09, 0x330c2972)}, + {TOBN(0x6b9917b4, 0x5fcf7e33), TOBN(0xe6793743, 0x945ceb42), + TOBN(0x18fc2215, 0x5c633d19), TOBN(0xad1adb3c, 0xc7485474)}}, + {{TOBN(0x646f9679, 0x6424c49b), TOBN(0xf888dfe8, 0x67c241c9), + TOBN(0xe12d4b93, 0x24f68b49), TOBN(0x9a6b62d8, 0xa571df20)}, + {TOBN(0x81b4b26d, 0x179483cb), TOBN(0x666f9632, 0x9511fae2), + TOBN(0xd281b3e4, 0xd53aa51f), TOBN(0x7f96a765, 0x7f3dbd16)}}, + {{TOBN(0xa7f8b5bf, 0x074a30ce), TOBN(0xd7f52107, 0x005a32e6), + TOBN(0x6f9e0907, 0x50237ed4), TOBN(0x2f21da47, 0x8096fa2b)}, + {TOBN(0xf3e19cb4, 0xeec863a0), TOBN(0xd18f77fd, 0x9527620a), + TOBN(0x9505c81c, 0x407c1cf8), TOBN(0x9998db4e, 0x1b6ec284)}}, + {{TOBN(0x7e3389e5, 0xc247d44d), TOBN(0x12507141, 0x3f4f3d80), + TOBN(0xd4ba0110, 0x4a78a6c7), TOBN(0x312874a0, 0x767720be)}, + {TOBN(0xded059a6, 0x75944370), TOBN(0xd6123d90, 0x3b2c0bdd), + TOBN(0xa56b717b, 0x51c108e3), TOBN(0x9bb7940e, 0x070623e9)}}, + {{TOBN(0x794e2d59, 0x84ac066c), TOBN(0xf5954a92, 0xe68c69a0), + TOBN(0x28c52458, 0x4fd99dcc), TOBN(0x60e639fc, 0xb1012517)}, + {TOBN(0xc2e60125, 0x7de79248), TOBN(0xe9ef6404, 0xf12fc6d7), + TOBN(0x4c4f2808, 0x2a3b5d32), TOBN(0x865ad32e, 0xc768eb8a)}}, + {{TOBN(0xac02331b, 0x13fb70b6), TOBN(0x037b44c1, 0x95599b27), + TOBN(0x1a860fc4, 0x60bd082c), TOBN(0xa2e25745, 0xc980cd01)}, + {TOBN(0xee3387a8, 0x1da0263e), TOBN(0x931bfb95, 0x2d10f3d6), + TOBN(0x5b687270, 0xa1f24a32), TOBN(0xf140e65d, 0xca494b86)}}, + {{TOBN(0x4f4ddf91, 0xb2f1ac7a), TOBN(0xf99eaabb, 0x760fee27), + TOBN(0x57f4008a, 0x49c228e5), TOBN(0x090be440, 0x1cf713bb)}, + {TOBN(0xac91fbe4, 0x5004f022), TOBN(0xd838c2c2, 0x569e1af6), + TOBN(0xd6c7d20b, 0x0f1daaa5), TOBN(0xaa063ac1, 0x1bbb02c0)}}, + {{TOBN(0x0938a422, 0x59558a78), TOBN(0x5343c669, 0x8435da2f), + TOBN(0x96f67b18, 0x034410dc), TOBN(0x7cc1e424, 0x84510804)}, + {TOBN(0x86a1543f, 0x16dfbb7d), TOBN(0x921fa942, 0x5b5bd592), + TOBN(0x9dcccb6e, 0xb33dd03c), TOBN(0x8581ddd9, 0xb843f51e)}}, + {{TOBN(0x54935fcb, 0x81d73c9e), TOBN(0x6d07e979, 0x0a5e97ab), + TOBN(0x4dc7b30a, 0xcf3a6bab), TOBN(0x147ab1f3, 0x170bee11)}, + {TOBN(0x0aaf8e3d, 0x9fafdee4), TOBN(0xfab3dbcb, 0x538a8b95), + TOBN(0x405df4b3, 0x6ef13871), TOBN(0xf1f4e9cb, 0x088d5a49)}}, + {{TOBN(0x9bcd24d3, 0x66b33f1d), TOBN(0x3b97b820, 0x5ce445c0), + TOBN(0xe2926549, 0xba93ff61), TOBN(0xd9c341ce, 0x4dafe616)}, + {TOBN(0xfb30a76e, 0x16efb6f3), TOBN(0xdf24b8ca, 0x605b953c), + TOBN(0x8bd52afe, 0xc2fffb9f), TOBN(0xbbac5ff7, 0xe19d0b96)}}, + {{TOBN(0x43c01b87, 0x459afccd), TOBN(0x6bd45143, 0xb7432652), + TOBN(0x84734530, 0x55b5d78e), TOBN(0x81088fdb, 0x1554ba7d)}, + {TOBN(0xada0a52c, 0x1e269375), TOBN(0xf9f037c4, 0x2dc5ec10), + TOBN(0xc0660607, 0x94bfbc11), TOBN(0xc0a630bb, 0xc9c40d2f)}}, + {{TOBN(0x5efc797e, 0xab64c31e), TOBN(0xffdb1dab, 0x74507144), + TOBN(0xf6124287, 0x1ca6790c), TOBN(0xe9609d81, 0xe69bf1bf)}, + {TOBN(0xdb898595, 0x00d24fc9), TOBN(0x9c750333, 0xe51fb417), + TOBN(0x51830a91, 0xfef7bbde), TOBN(0x0ce67dc8, 0x945f585c)}}, + {{TOBN(0x9a730ed4, 0x4763eb50), TOBN(0x24a0e221, 0xc1ab0d66), + TOBN(0x643b6393, 0x648748f3), TOBN(0x1982daa1, 0x6d3c6291)}, + {TOBN(0x6f00a9f7, 0x8bbc5549), TOBN(0x7a1783e1, 0x7f36384e), + TOBN(0xe8346323, 0xde977f50), TOBN(0x91ab688d, 0xb245502a)}}, + {{TOBN(0x331ab6b5, 0x6d0bdd66), TOBN(0x0a6ef32e, 0x64b71229), + TOBN(0x1028150e, 0xfe7c352f), TOBN(0x27e04350, 0xce7b39d3)}, + {TOBN(0x2a3c8acd, 0xc1070c82), TOBN(0xfb2034d3, 0x80c9feef), + TOBN(0x2d729621, 0x709f3729), TOBN(0x8df290bf, 0x62cb4549)}}, + {{TOBN(0x02f99f33, 0xfc2e4326), TOBN(0x3b30076d, 0x5eddf032), + TOBN(0xbb21f8cf, 0x0c652fb5), TOBN(0x314fb49e, 0xed91cf7b)}, + {TOBN(0xa013eca5, 0x2f700750), TOBN(0x2b9e3c23, 0x712a4575), + TOBN(0xe5355557, 0xaf30fbb0), TOBN(0x1ada3516, 0x7c77e771)}}, + {{TOBN(0x45f6ecb2, 0x7b135670), TOBN(0xe85d19df, 0x7cfc202e), + TOBN(0x0f1b50c7, 0x58d1be9f), TOBN(0x5ebf2c0a, 0xead2e344)}, + {TOBN(0x1531fe4e, 0xabc199c9), TOBN(0xc7032592, 0x56bab0ae), + TOBN(0x16ab2e48, 0x6c1fec54), TOBN(0x0f87fda8, 0x04280188)}}, + {{TOBN(0xdc9f46fc, 0x609e4a74), TOBN(0x2a44a143, 0xba667f91), + TOBN(0xbc3d8b95, 0xb4d83436), TOBN(0xa01e4bd0, 0xc7bd2958)}, + {TOBN(0x7b182932, 0x73483c90), TOBN(0xa79c6aa1, 0xa7c7b598), + TOBN(0xbf3983c6, 0xeaaac07e), TOBN(0x8f18181e, 0x96e0d4e6)}}, + {{TOBN(0x8553d37c, 0x051af62b), TOBN(0xe9a998eb, 0x0bf94496), + TOBN(0xe0844f9f, 0xb0d59aa1), TOBN(0x983fd558, 0xe6afb813)}, + {TOBN(0x9670c0ca, 0x65d69804), TOBN(0x732b22de, 0x6ea5ff2d), + TOBN(0xd7640ba9, 0x5fd8623b), TOBN(0x9f619163, 0xa6351782)}}, + {{TOBN(0x0bfc27ee, 0xacee5043), TOBN(0xae419e73, 0x2eb10f02), + TOBN(0x19c028d1, 0x8943fb05), TOBN(0x71f01cf7, 0xff13aa2a)}, + {TOBN(0x7790737e, 0x8887a132), TOBN(0x67513309, 0x66318410), + TOBN(0x9819e8a3, 0x7ddb795e), TOBN(0xfecb8ef5, 0xdad100b2)}}, + {{TOBN(0x59f74a22, 0x3021926a), TOBN(0xb7c28a49, 0x6f9b4c1c), + TOBN(0xed1a733f, 0x912ad0ab), TOBN(0x42a910af, 0x01a5659c)}, + {TOBN(0x3842c6e0, 0x7bd68cab), TOBN(0x2b57fa38, 0x76d70ac8), + TOBN(0x8a6707a8, 0x3c53aaeb), TOBN(0x62c1c510, 0x65b4db18)}}, + {{TOBN(0x8de2c1fb, 0xb2d09dc7), TOBN(0xc3dfed12, 0x266bd23b), + TOBN(0x927d039b, 0xd5b27db6), TOBN(0x2fb2f0f1, 0x103243da)}, + {TOBN(0xf855a07b, 0x80be7399), TOBN(0xed9327ce, 0x1f9f27a8), + TOBN(0xa0bd99c7, 0x729bdef7), TOBN(0x2b67125e, 0x28250d88)}}, + {{TOBN(0x784b26e8, 0x8670ced7), TOBN(0xe3dfe41f, 0xc31bd3b4), + TOBN(0x9e353a06, 0xbcc85cbc), TOBN(0x302e2909, 0x60178a9d)}, + {TOBN(0x860abf11, 0xa6eac16e), TOBN(0x76447000, 0xaa2b3aac), + TOBN(0x46ff9d19, 0x850afdab), TOBN(0x35bdd6a5, 0xfdb2d4c1)}}, + {{TOBN(0xe82594b0, 0x7e5c9ce9), TOBN(0x0f379e53, 0x20af346e), + TOBN(0x608b31e3, 0xbc65ad4a), TOBN(0x710c6b12, 0x267c4826)}, + {TOBN(0x51c966f9, 0x71954cf1), TOBN(0xb1cec793, 0x0d0aa215), + TOBN(0x1f155989, 0x86bd23a8), TOBN(0xae2ff99c, 0xf9452e86)}}, + {{TOBN(0xd8dd953c, 0x340ceaa2), TOBN(0x26355275, 0x2e2e9333), + TOBN(0x15d4e5f9, 0x8586f06d), TOBN(0xd6bf94a8, 0xf7cab546)}, + {TOBN(0x33c59a0a, 0xb76a9af0), TOBN(0x52740ab3, 0xba095af7), + TOBN(0xc444de8a, 0x24389ca0), TOBN(0xcc6f9863, 0x706da0cb)}}, + {{TOBN(0xb5a741a7, 0x6b2515cf), TOBN(0x71c41601, 0x9585c749), + TOBN(0x78350d4f, 0xe683de97), TOBN(0x31d61524, 0x63d0b5f5)}, + {TOBN(0x7a0cc5e1, 0xfbce090b), TOBN(0xaac927ed, 0xfbcb2a5b), + TOBN(0xe920de49, 0x20d84c35), TOBN(0x8c06a0b6, 0x22b4de26)}}, + {{TOBN(0xd34dd58b, 0xafe7ddf3), TOBN(0x55851fed, 0xc1e6e55b), + TOBN(0xd1395616, 0x960696e7), TOBN(0x940304b2, 0x5f22705f)}, + {TOBN(0x6f43f861, 0xb0a2a860), TOBN(0xcf121282, 0x0e7cc981), + TOBN(0x12186212, 0x0ab64a96), TOBN(0x09215b9a, 0xb789383c)}}, + {{TOBN(0x311eb305, 0x37387c09), TOBN(0xc5832fce, 0xf03ee760), + TOBN(0x30358f58, 0x32f7ea19), TOBN(0xe01d3c34, 0x91d53551)}, + {TOBN(0x1ca5ee41, 0xda48ea80), TOBN(0x34e71e8e, 0xcf4fa4c1), + TOBN(0x312abd25, 0x7af1e1c7), TOBN(0xe3afcdeb, 0x2153f4a5)}}, + {{TOBN(0x9d5c84d7, 0x00235e9a), TOBN(0x0308d3f4, 0x8c4c836f), + TOBN(0xc0a66b04, 0x89332de5), TOBN(0x610dd399, 0x89e566ef)}, + {TOBN(0xf8eea460, 0xd1ac1635), TOBN(0x84cbb3fb, 0x20a2c0df), + TOBN(0x40afb488, 0xe74a48c5), TOBN(0x29738198, 0xd326b150)}}, + {{TOBN(0x2a17747f, 0xa6d74081), TOBN(0x60ea4c05, 0x55a26214), + TOBN(0x53514bb4, 0x1f88c5fe), TOBN(0xedd64567, 0x7e83426c)}, + {TOBN(0xd5d6cbec, 0x96460b25), TOBN(0xa12fd0ce, 0x68dc115e), + TOBN(0xc5bc3ed2, 0x697840ea), TOBN(0x969876a8, 0xa6331e31)}}, + {{TOBN(0x60c36217, 0x472ff580), TOBN(0xf4229705, 0x4ad41393), + TOBN(0x4bd99ef0, 0xa03b8b92), TOBN(0x501c7317, 0xc144f4f6)}, + {TOBN(0x159009b3, 0x18464945), TOBN(0x6d5e594c, 0x74c5c6be), + TOBN(0x2d587011, 0x321a3660), TOBN(0xd1e184b1, 0x3898d022)}}, + {{TOBN(0x5ba04752, 0x4c6a7e04), TOBN(0x47fa1e2b, 0x45550b65), + TOBN(0x9419daf0, 0x48c0a9a5), TOBN(0x66362953, 0x7c243236)}, + {TOBN(0xcd0744b1, 0x5cb12a88), TOBN(0x561b6f9a, 0x2b646188), + TOBN(0x599415a5, 0x66c2c0c0), TOBN(0xbe3f0859, 0x0f83f09a)}}, + {{TOBN(0x9141c5be, 0xb92041b8), TOBN(0x01ae38c7, 0x26477d0d), + TOBN(0xca8b71f3, 0xd12c7a94), TOBN(0xfab5b31f, 0x765c70db)}, + {TOBN(0x76ae7492, 0x487443e9), TOBN(0x8595a310, 0x990d1349), + TOBN(0xf8dbeda8, 0x7d460a37), TOBN(0x7f7ad082, 0x1e45a38f)}}, + {{TOBN(0xed1d4db6, 0x1059705a), TOBN(0xa3dd492a, 0xe6b9c697), + TOBN(0x4b92ee3a, 0x6eb38bd5), TOBN(0xbab2609d, 0x67cc0bb7)}, + {TOBN(0x7fc4fe89, 0x6e70ee82), TOBN(0xeff2c56e, 0x13e6b7e3), + TOBN(0x9b18959e, 0x34d26fca), TOBN(0x2517ab66, 0x889d6b45)}}, + {{TOBN(0xf167b4e0, 0xbdefdd4f), TOBN(0x69958465, 0xf366e401), + TOBN(0x5aa368ab, 0xa73bbec0), TOBN(0x12148709, 0x7b240c21)}, + {TOBN(0x378c3233, 0x18969006), TOBN(0xcb4d73ce, 0xe1fe53d1), + TOBN(0x5f50a80e, 0x130c4361), TOBN(0xd67f5951, 0x7ef5212b)}}, + {{TOBN(0xf145e21e, 0x9e70c72e), TOBN(0xb2e52e29, 0x5566d2fb), + TOBN(0x44eaba4a, 0x032397f5), TOBN(0x5e56937b, 0x7e31a7de)}, + {TOBN(0x68dcf517, 0x456c61e1), TOBN(0xbc2e954a, 0xa8b0a388), + TOBN(0xe3552fa7, 0x60a8b755), TOBN(0x03442dae, 0x73ad0cde)}}, + {{TOBN(0x37ffe747, 0xceb26210), TOBN(0x983545e8, 0x787baef9), + TOBN(0x8b8c8535, 0x86a3de31), TOBN(0xc621dbcb, 0xfacd46db)}, + {TOBN(0x82e442e9, 0x59266fbb), TOBN(0xa3514c37, 0x339d471c), + TOBN(0x3a11b771, 0x62cdad96), TOBN(0xf0cb3b3c, 0xecf9bdf0)}}, + {{TOBN(0x3fcbdbce, 0x478e2135), TOBN(0x7547b5cf, 0xbda35342), + TOBN(0xa97e81f1, 0x8a677af6), TOBN(0xc8c2bf83, 0x28817987)}, + {TOBN(0xdf07eaaf, 0x45580985), TOBN(0xc68d1f05, 0xc93b45cb), + TOBN(0x106aa2fe, 0xc77b4cac), TOBN(0x4c1d8afc, 0x04a7ae86)}}, + {{TOBN(0xdb41c3fd, 0x9eb45ab2), TOBN(0x5b234b5b, 0xd4b22e74), + TOBN(0xda253dec, 0xf215958a), TOBN(0x67e0606e, 0xa04edfa0)}, + {TOBN(0xabbbf070, 0xef751b11), TOBN(0xf352f175, 0xf6f06dce), + TOBN(0xdfc4b6af, 0x6839f6b4), TOBN(0x53ddf9a8, 0x9959848e)}}, + {{TOBN(0xda49c379, 0xc21520b0), TOBN(0x90864ff0, 0xdbd5d1b6), + TOBN(0x2f055d23, 0x5f49c7f7), TOBN(0xe51e4e6a, 0xa796b2d8)}, + {TOBN(0xc361a67f, 0x5c9dc340), TOBN(0x5ad53c37, 0xbca7c620), + TOBN(0xda1d6588, 0x32c756d0), TOBN(0xad60d911, 0x8bb67e13)}}, + {{TOBN(0xd6c47bdf, 0x0eeec8c6), TOBN(0x4a27fec1, 0x078a1821), + TOBN(0x081f7415, 0xc3099524), TOBN(0x8effdf0b, 0x82cd8060)}, + {TOBN(0xdb70ec1c, 0x65842df8), TOBN(0x8821b358, 0xd319a901), + TOBN(0x72ee56ee, 0xde42b529), TOBN(0x5bb39592, 0x236e4286)}}, + {{TOBN(0xd1183316, 0xfd6f7140), TOBN(0xf9fadb5b, 0xbd8e81f7), + TOBN(0x701d5e0c, 0x5a02d962), TOBN(0xfdee4dbf, 0x1b601324)}, + {TOBN(0xbed17407, 0x35d7620e), TOBN(0x04e3c2c3, 0xf48c0012), + TOBN(0x9ee29da7, 0x3455449a), TOBN(0x562cdef4, 0x91a836c4)}}, + {{TOBN(0x8f682a5f, 0x47701097), TOBN(0x617125d8, 0xff88d0c2), + TOBN(0x948fda24, 0x57bb86dd), TOBN(0x348abb8f, 0x289f7286)}, + {TOBN(0xeb10eab5, 0x99d94bbd), TOBN(0xd51ba28e, 0x4684d160), + TOBN(0xabe0e51c, 0x30c8f41a), TOBN(0x66588b45, 0x13254f4a)}}, + {{TOBN(0x147ebf01, 0xfad097a5), TOBN(0x49883ea8, 0x610e815d), + TOBN(0xe44d60ba, 0x8a11de56), TOBN(0xa970de6e, 0x827a7a6d)}, + {TOBN(0x2be41424, 0x5e17fc19), TOBN(0xd833c657, 0x01214057), + TOBN(0x1375813b, 0x363e723f), TOBN(0x6820bb88, 0xe6a52e9b)}}, + {{TOBN(0x7e7f6970, 0xd875d56a), TOBN(0xd6a0a9ac, 0x51fbf6bf), + TOBN(0x54ba8790, 0xa3083c12), TOBN(0xebaeb23d, 0x6ae7eb64)}, + {TOBN(0xa8685c3a, 0xb99a907a), TOBN(0xf1e74550, 0x026bf40b), + TOBN(0x7b73a027, 0xc802cd9e), TOBN(0x9a8a927c, 0x4fef4635)}}, + {{TOBN(0xe1b6f60c, 0x08191224), TOBN(0xc4126ebb, 0xde4ec091), + TOBN(0xe1dff4dc, 0x4ae38d84), TOBN(0xde3f57db, 0x4f2ef985)}, + {TOBN(0x34964337, 0xd446a1dd), TOBN(0x7bf217a0, 0x859e77f6), + TOBN(0x8ff10527, 0x8e1d13f5), TOBN(0xa304ef03, 0x74eeae27)}}, + {{TOBN(0xfc6f5e47, 0xd19dfa5a), TOBN(0xdb007de3, 0x7fad982b), + TOBN(0x28205ad1, 0x613715f5), TOBN(0x251e6729, 0x7889529e)}, + {TOBN(0x72705184, 0x1ae98e78), TOBN(0xf818537d, 0x271cac32), + TOBN(0xc8a15b7e, 0xb7f410f5), TOBN(0xc474356f, 0x81f62393)}}, + {{TOBN(0x92dbdc5a, 0xc242316b), TOBN(0xabe060ac, 0xdbf4aff5), + TOBN(0x6e8c38fe, 0x909a8ec6), TOBN(0x43e514e5, 0x6116cb94)}, + {TOBN(0x2078fa38, 0x07d784f9), TOBN(0x1161a880, 0xf4b5b357), + TOBN(0x5283ce79, 0x13adea3d), TOBN(0x0756c3e6, 0xcc6a910b)}}, + {{TOBN(0x60bcfe01, 0xaaa79697), TOBN(0x04a73b29, 0x56391db1), + TOBN(0xdd8dad47, 0x189b45a0), TOBN(0xbfac0dd0, 0x48d5b8d9)}, + {TOBN(0x34ab3af5, 0x7d3d2ec2), TOBN(0x6fa2fc2d, 0x207bd3af), + TOBN(0x9ff40092, 0x66550ded), TOBN(0x719b3e87, 0x1fd5b913)}}, + {{TOBN(0xa573a496, 0x6d17fbc7), TOBN(0x0cd1a70a, 0x73d2b24e), + TOBN(0x34e2c5ca, 0xb2676937), TOBN(0xe7050b06, 0xbf669f21)}, + {TOBN(0xfbe948b6, 0x1ede9046), TOBN(0xa0530051, 0x97662659), + TOBN(0x58cbd4ed, 0xf10124c5), TOBN(0xde2646e4, 0xdd6c06c8)}}, + {{TOBN(0x332f8108, 0x8cad38c0), TOBN(0x471b7e90, 0x6bd68ae2), + TOBN(0x56ac3fb2, 0x0d8e27a3), TOBN(0xb54660db, 0x136b4b0d)}, + {TOBN(0x123a1e11, 0xa6fd8de4), TOBN(0x44dbffea, 0xa37799ef), + TOBN(0x4540b977, 0xce6ac17c), TOBN(0x495173a8, 0xaf60acef)}}}, + {{{TOBN(0x9ebb284d, 0x391c2a82), TOBN(0xbcdd4863, 0x158308e8), + TOBN(0x006f16ec, 0x83f1edca), TOBN(0xa13e2c37, 0x695dc6c8)}, + {TOBN(0x2ab756f0, 0x4a057a87), TOBN(0xa8765500, 0xa6b48f98), + TOBN(0x4252face, 0x68651c44), TOBN(0xa52b540b, 0xe1765e02)}}, + {{TOBN(0x4f922fc5, 0x16a0d2bb), TOBN(0x0d5cc16c, 0x1a623499), + TOBN(0x9241cf3a, 0x57c62c8b), TOBN(0x2f5e6961, 0xfd1b667f)}, + {TOBN(0x5c15c70b, 0xf5a01797), TOBN(0x3d20b44d, 0x60956192), + TOBN(0x04911b37, 0x071fdb52), TOBN(0xf648f916, 0x8d6f0f7b)}}, + {{TOBN(0x6dc1acaf, 0xe60b7cf7), TOBN(0x25860a50, 0x84a9d869), + TOBN(0x56fc6f09, 0xe7ba8ac4), TOBN(0x828c5bd0, 0x6148d29e)}, + {TOBN(0xac6b435e, 0xdc55ae5f), TOBN(0xa527f56c, 0xc0117411), + TOBN(0x94d5045e, 0xfd24342c), TOBN(0x2c4c0a35, 0x70b67c0d)}}, + {{TOBN(0x027cc8b8, 0xfac61d9a), TOBN(0x7d25e062, 0xe3c6fe8a), + TOBN(0xe08805bf, 0xe5bff503), TOBN(0x13271e6c, 0x6ff632f7)}, + {TOBN(0x55dca6c0, 0x232f76a5), TOBN(0x8957c32d, 0x701ef426), + TOBN(0xee728bcb, 0xa10a5178), TOBN(0x5ea60411, 0xb62c5173)}}, + {{TOBN(0xfc4e964e, 0xd0b8892b), TOBN(0x9ea17683, 0x9301bb74), + TOBN(0x6265c5ae, 0xfcc48626), TOBN(0xe60cf82e, 0xbb3e9102)}, + {TOBN(0x57adf797, 0xd4df5531), TOBN(0x235b59a1, 0x8deeefe2), + TOBN(0x60adcf58, 0x3f306eb1), TOBN(0x105c2753, 0x3d09492d)}}, + {{TOBN(0x4090914b, 0xb5def996), TOBN(0x1cb69c83, 0x233dd1e7), + TOBN(0xc1e9c1d3, 0x9b3d5e76), TOBN(0x1f3338ed, 0xfccf6012)}, + {TOBN(0xb1e95d0d, 0x2f5378a8), TOBN(0xacf4c2c7, 0x2f00cd21), + TOBN(0x6e984240, 0xeb5fe290), TOBN(0xd66c038d, 0x248088ae)}}, + {{TOBN(0x804d264a, 0xf94d70cf), TOBN(0xbdb802ef, 0x7314bf7e), + TOBN(0x8fb54de2, 0x4333ed02), TOBN(0x740461e0, 0x285635d9)}, + {TOBN(0x4113b2c8, 0x365e9383), TOBN(0xea762c83, 0x3fdef652), + TOBN(0x4eec6e2e, 0x47b956c1), TOBN(0xa3d814be, 0x65620fa4)}}, + {{TOBN(0x9ad5462b, 0xb4d8bc50), TOBN(0x181c0b16, 0xa9195770), + TOBN(0xebd4fe1c, 0x78412a68), TOBN(0xae0341bc, 0xc0dff48c)}, + {TOBN(0xb6bc45cf, 0x7003e866), TOBN(0xf11a6dea, 0x8a24a41b), + TOBN(0x5407151a, 0xd04c24c2), TOBN(0x62c9d27d, 0xda5b7b68)}}, + {{TOBN(0x2e964235, 0x88cceff6), TOBN(0x8594c54f, 0x8b07ed69), + TOBN(0x1578e73c, 0xc84d0d0d), TOBN(0x7b4e1055, 0xff532868)}, + {TOBN(0xa348c0d5, 0xb5ec995a), TOBN(0xbf4b9d55, 0x14289a54), + TOBN(0x9ba155a6, 0x58fbd777), TOBN(0x186ed7a8, 0x1a84491d)}}, + {{TOBN(0xd4992b30, 0x614c0900), TOBN(0xda98d121, 0xbd00c24b), + TOBN(0x7f534dc8, 0x7ec4bfa1), TOBN(0x4a5ff674, 0x37dc34bc)}, + {TOBN(0x68c196b8, 0x1d7ea1d7), TOBN(0x38cf2893, 0x80a6d208), + TOBN(0xfd56cd09, 0xe3cbbd6e), TOBN(0xec72e27e, 0x4205a5b6)}}, + {{TOBN(0x15ea68f5, 0xa44f77f7), TOBN(0x7aa5f9fd, 0xb43c52bc), + TOBN(0x86ff676f, 0x94f0e609), TOBN(0xa4cde963, 0x2e2d432b)}, + {TOBN(0x8cafa0c0, 0xeee470af), TOBN(0x84137d0e, 0x8a3f5ec8), + TOBN(0xebb40411, 0xfaa31231), TOBN(0xa239c13f, 0x6f7f7ccf)}}, + {{TOBN(0x32865719, 0xa8afd30b), TOBN(0x86798328, 0x8a826dce), + TOBN(0xdf04e891, 0xc4a8fbe0), TOBN(0xbb6b6e1b, 0xebf56ad3)}, + {TOBN(0x0a695b11, 0x471f1ff0), TOBN(0xd76c3389, 0xbe15baf0), + TOBN(0x018edb95, 0xbe96c43e), TOBN(0xf2beaaf4, 0x90794158)}}, + {{TOBN(0x152db09e, 0xc3076a27), TOBN(0x5e82908e, 0xe416545d), + TOBN(0xa2c41272, 0x356d6f2e), TOBN(0xdc9c9642, 0x31fd74e1)}, + {TOBN(0x66ceb88d, 0x519bf615), TOBN(0xe29ecd76, 0x05a2274e), + TOBN(0x3a0473c4, 0xbf5e2fa0), TOBN(0x6b6eb671, 0x64284e67)}}, + {{TOBN(0xe8b97932, 0xb88756dd), TOBN(0xed4e8652, 0xf17e3e61), + TOBN(0xc2dd1499, 0x3ee1c4a4), TOBN(0xc0aaee17, 0x597f8c0e)}, + {TOBN(0x15c4edb9, 0x6c168af3), TOBN(0x6563c7bf, 0xb39ae875), + TOBN(0xadfadb6f, 0x20adb436), TOBN(0xad55e8c9, 0x9a042ac0)}}, + {{TOBN(0x975a1ed8, 0xb76da1f5), TOBN(0x10dfa466, 0xa58acb94), + TOBN(0x8dd7f7e3, 0xac060282), TOBN(0x6813e66a, 0x572a051e)}, + {TOBN(0xb4ccae1e, 0x350cb901), TOBN(0xb653d656, 0x50cb7822), + TOBN(0x42484710, 0xdfab3b87), TOBN(0xcd7ee537, 0x9b670fd0)}}, + {{TOBN(0x0a50b12e, 0x523b8bf6), TOBN(0x8009eb5b, 0x8f910c1b), + TOBN(0xf535af82, 0x4a167588), TOBN(0x0f835f9c, 0xfb2a2abd)}, + {TOBN(0xf59b2931, 0x2afceb62), TOBN(0xc797df2a, 0x169d383f), + TOBN(0xeb3f5fb0, 0x66ac02b0), TOBN(0x029d4c6f, 0xdaa2d0ca)}}, + {{TOBN(0xd4059bc1, 0xafab4bc5), TOBN(0x833f5c6f, 0x56783247), + TOBN(0xb5346630, 0x8d2d3605), TOBN(0x83387891, 0xd34d8433)}, + {TOBN(0xd973b30f, 0xadd9419a), TOBN(0xbcca1099, 0xafe3fce8), + TOBN(0x08178315, 0x0809aac6), TOBN(0x01b7f21a, 0x540f0f11)}}, + {{TOBN(0x65c29219, 0x909523c8), TOBN(0xa62f648f, 0xa3a1c741), + TOBN(0x88598d4f, 0x60c9e55a), TOBN(0xbce9141b, 0x0e4f347a)}, + {TOBN(0x9af97d84, 0x35f9b988), TOBN(0x0210da62, 0x320475b6), + TOBN(0x3c076e22, 0x9191476c), TOBN(0x7520dbd9, 0x44fc7834)}}, + {{TOBN(0x6a6b2cfe, 0xc1ab1bbd), TOBN(0xef8a65be, 0xdc650938), + TOBN(0x72855540, 0x805d7bc4), TOBN(0xda389396, 0xed11fdfd)}, + {TOBN(0xa9d5bd36, 0x74660876), TOBN(0x11d67c54, 0xb45dff35), + TOBN(0x6af7d148, 0xa4f5da94), TOBN(0xbb8d4c3f, 0xc0bbeb31)}}, + {{TOBN(0x87a7ebd1, 0xe0a1b12a), TOBN(0x1e4ef88d, 0x770ba95f), + TOBN(0x8c33345c, 0xdc2ae9cb), TOBN(0xcecf1276, 0x01cc8403)}, + {TOBN(0x687c012e, 0x1b39b80f), TOBN(0xfd90d0ad, 0x35c33ba4), + TOBN(0xa3ef5a67, 0x5c9661c2), TOBN(0x368fc88e, 0xe017429e)}}, + {{TOBN(0xd30c6761, 0x196a2fa2), TOBN(0x931b9817, 0xbd5b312e), + TOBN(0xba01000c, 0x72f54a31), TOBN(0xa203d2c8, 0x66eaa541)}, + {TOBN(0xf2abdee0, 0x98939db3), TOBN(0xe37d6c2c, 0x3e606c02), + TOBN(0xf2921574, 0x521ff643), TOBN(0x2781b3c4, 0xd7e2fca3)}}, + {{TOBN(0x664300b0, 0x7850ec06), TOBN(0xac5a38b9, 0x7d3a10cf), + TOBN(0x9233188d, 0xe34ab39d), TOBN(0xe77057e4, 0x5072cbb9)}, + {TOBN(0xbcf0c042, 0xb59e78df), TOBN(0x4cfc91e8, 0x1d97de52), + TOBN(0x4661a26c, 0x3ee0ca4a), TOBN(0x5620a4c1, 0xfb8507bc)}}, + {{TOBN(0x4b44d4aa, 0x049f842c), TOBN(0xceabc5d5, 0x1540e82b), + TOBN(0x306710fd, 0x15c6f156), TOBN(0xbe5ae52b, 0x63db1d72)}, + {TOBN(0x06f1e7e6, 0x334957f1), TOBN(0x57e388f0, 0x31144a70), + TOBN(0xfb69bb2f, 0xdf96447b), TOBN(0x0f78ebd3, 0x73e38a12)}}, + {{TOBN(0xb8222605, 0x2b7ce542), TOBN(0xe6d4ce99, 0x7472bde1), + TOBN(0x53e16ebe, 0x09d2f4da), TOBN(0x180ff42e, 0x53b92b2e)}, + {TOBN(0xc59bcc02, 0x2c34a1c6), TOBN(0x3803d6f9, 0x422c46c2), + TOBN(0x18aff74f, 0x5c14a8a2), TOBN(0x55aebf80, 0x10a08b28)}}, + {{TOBN(0x66097d58, 0x7135593f), TOBN(0x32e6eff7, 0x2be570cd), + TOBN(0x584e6a10, 0x2a8c860d), TOBN(0xcd185890, 0xa2eb4163)}, + {TOBN(0x7ceae99d, 0x6d97e134), TOBN(0xd42c6b70, 0xdd8447ce), + TOBN(0x59ddbb4a, 0xb8c50273), TOBN(0x03c612df, 0x3cf34e1e)}}, + {{TOBN(0x84b9ca15, 0x04b6c5a0), TOBN(0x35216f39, 0x18f0e3a3), + TOBN(0x3ec2d2bc, 0xbd986c00), TOBN(0x8bf546d9, 0xd19228fe)}, + {TOBN(0xd1c655a4, 0x4cd623c3), TOBN(0x366ce718, 0x502b8e5a), + TOBN(0x2cfc84b4, 0xeea0bfe7), TOBN(0xe01d5cee, 0xcf443e8e)}}, + {{TOBN(0x8ec045d9, 0x036520f8), TOBN(0xdfb3c3d1, 0x92d40e98), + TOBN(0x0bac4cce, 0xcc559a04), TOBN(0x35eccae5, 0x240ea6b1)}, + {TOBN(0x180b32db, 0xf8a5a0ac), TOBN(0x547972a5, 0xeb699700), + TOBN(0xa3765801, 0xca26bca0), TOBN(0x57e09d0e, 0xa647f25a)}}, + {{TOBN(0xb956970e, 0x2fdd23cc), TOBN(0xb80288bc, 0x5682e971), + TOBN(0xe6e6d91e, 0x9ae86ebc), TOBN(0x0564c83f, 0x8c9f1939)}, + {TOBN(0x551932a2, 0x39560368), TOBN(0xe893752b, 0x049c28e2), + TOBN(0x0b03cee5, 0xa6a158c3), TOBN(0xe12d656b, 0x04964263)}}, + {{TOBN(0x4b47554e, 0x63e3bc1d), TOBN(0xc719b6a2, 0x45044ff7), + TOBN(0x4f24d30a, 0xe48daa07), TOBN(0xa3f37556, 0xc8c1edc3)}, + {TOBN(0x9a47bf76, 0x0700d360), TOBN(0xbb1a1824, 0x822ae4e2), + TOBN(0x22e275a3, 0x89f1fb4c), TOBN(0x72b1aa23, 0x9968c5f5)}}, + {{TOBN(0xa75feaca, 0xbe063f64), TOBN(0x9b392f43, 0xbce47a09), + TOBN(0xd4241509, 0x1ad07aca), TOBN(0x4b0c591b, 0x8d26cd0f)}, + {TOBN(0x2d42ddfd, 0x92f1169a), TOBN(0x63aeb1ac, 0x4cbf2392), + TOBN(0x1de9e877, 0x0691a2af), TOBN(0xebe79af7, 0xd98021da)}}, + {{TOBN(0xcfdf2a4e, 0x40e50acf), TOBN(0xf0a98ad7, 0xaf01d665), + TOBN(0xefb640bf, 0x1831be1f), TOBN(0x6fe8bd2f, 0x80e9ada0)}, + {TOBN(0x94c103a1, 0x6cafbc91), TOBN(0x170f8759, 0x8308e08c), + TOBN(0x5de2d2ab, 0x9780ff4f), TOBN(0x666466bc, 0x45b201f2)}}, + {{TOBN(0x58af2010, 0xf5b343bc), TOBN(0x0f2e400a, 0xf2f142fe), + TOBN(0x3483bfde, 0xa85f4bdf), TOBN(0xf0b1d093, 0x03bfeaa9)}, + {TOBN(0x2ea01b95, 0xc7081603), TOBN(0xe943e4c9, 0x3dba1097), + TOBN(0x47be92ad, 0xb438f3a6), TOBN(0x00bb7742, 0xe5bf6636)}}, + {{TOBN(0x136b7083, 0x824297b4), TOBN(0x9d0e5580, 0x5584455f), + TOBN(0xab48cedc, 0xf1c7d69e), TOBN(0x53a9e481, 0x2a256e76)}, + {TOBN(0x0402b0e0, 0x65eb2413), TOBN(0xdadbbb84, 0x8fc407a7), + TOBN(0xa65cd5a4, 0x8d7f5492), TOBN(0x21d44293, 0x74bae294)}}, + {{TOBN(0x66917ce6, 0x3b5f1cc4), TOBN(0x37ae52ea, 0xce872e62), + TOBN(0xbb087b72, 0x2905f244), TOBN(0x12077086, 0x1e6af74f)}, + {TOBN(0x4b644e49, 0x1058edea), TOBN(0x827510e3, 0xb638ca1d), + TOBN(0x8cf2b704, 0x6038591c), TOBN(0xffc8b47a, 0xfe635063)}}, + {{TOBN(0x3ae220e6, 0x1b4d5e63), TOBN(0xbd864742, 0x9d961b4b), + TOBN(0x610c107e, 0x9bd16bed), TOBN(0x4270352a, 0x1127147b)}, + {TOBN(0x7d17ffe6, 0x64cfc50e), TOBN(0x50dee01a, 0x1e36cb42), + TOBN(0x068a7622, 0x35dc5f9a), TOBN(0x9a08d536, 0xdf53f62c)}}, + {{TOBN(0x4ed71457, 0x6be5f7de), TOBN(0xd93006f8, 0xc2263c9e), + TOBN(0xe073694c, 0xcacacb36), TOBN(0x2ff7a5b4, 0x3ae118ab)}, + {TOBN(0x3cce53f1, 0xcd871236), TOBN(0xf156a39d, 0xc2aa6d52), + TOBN(0x9cc5f271, 0xb198d76d), TOBN(0xbc615b6f, 0x81383d39)}}, + {{TOBN(0xa54538e8, 0xde3eee6b), TOBN(0x58c77538, 0xab910d91), + TOBN(0x31e5bdbc, 0x58d278bd), TOBN(0x3cde4adf, 0xb963acae)}, + {TOBN(0xb1881fd2, 0x5302169c), TOBN(0x8ca60fa0, 0xa989ed8b), + TOBN(0xa1999458, 0xff96a0ee), TOBN(0xc1141f03, 0xac6c283d)}}, + {{TOBN(0x7677408d, 0x6dfafed3), TOBN(0x33a01653, 0x39661588), + TOBN(0x3c9c15ec, 0x0b726fa0), TOBN(0x090cfd93, 0x6c9b56da)}, + {TOBN(0xe34f4bae, 0xa3c40af5), TOBN(0x3469eadb, 0xd21129f1), + TOBN(0xcc51674a, 0x1e207ce8), TOBN(0x1e293b24, 0xc83b1ef9)}}, + {{TOBN(0x17173d13, 0x1e6c0bb4), TOBN(0x19004695, 0x90776d35), + TOBN(0xe7980e34, 0x6de6f922), TOBN(0x873554cb, 0xf4dd9a22)}, + {TOBN(0x0316c627, 0xcbf18a51), TOBN(0x4d93651b, 0x3032c081), + TOBN(0x207f2771, 0x3946834d), TOBN(0x2c08d7b4, 0x30cdbf80)}}, + {{TOBN(0x137a4fb4, 0x86df2a61), TOBN(0xa1ed9c07, 0xecf7b4a2), + TOBN(0xb2e460e2, 0x7bd042ff), TOBN(0xb7f5e2fa, 0x5f62f5ec)}, + {TOBN(0x7aa6ec6b, 0xcc2423b7), TOBN(0x75ce0a7f, 0xba63eea7), + TOBN(0x67a45fb1, 0xf250a6e1), TOBN(0x93bc919c, 0xe53cdc9f)}}, + {{TOBN(0x9271f56f, 0x871942df), TOBN(0x2372ff6f, 0x7859ad66), + TOBN(0x5f4c2b96, 0x33cb1a78), TOBN(0xe3e29101, 0x5838aa83)}, + {TOBN(0xa7ed1611, 0xe4e8110c), TOBN(0x2a2d70d5, 0x330198ce), + TOBN(0xbdf132e8, 0x6720efe0), TOBN(0xe61a8962, 0x66a471bf)}}, + {{TOBN(0x796d3a85, 0x825808bd), TOBN(0x51dc3cb7, 0x3fd6e902), + TOBN(0x643c768a, 0x916219d1), TOBN(0x36cd7685, 0xa2ad7d32)}, + {TOBN(0xe3db9d05, 0xb22922a4), TOBN(0x6494c87e, 0xdba29660), + TOBN(0xf0ac91df, 0xbcd2ebc7), TOBN(0x4deb57a0, 0x45107f8d)}}, + {{TOBN(0x42271f59, 0xc3d12a73), TOBN(0x5f71687c, 0xa5c2c51d), + TOBN(0xcb1f50c6, 0x05797bcb), TOBN(0x29ed0ed9, 0xd6d34eb0)}, + {TOBN(0xe5fe5b47, 0x4683c2eb), TOBN(0x4956eeb5, 0x97447c46), + TOBN(0x5b163a43, 0x71207167), TOBN(0x93fa2fed, 0x0248c5ef)}}, + {{TOBN(0x67930af2, 0x31f63950), TOBN(0xa77797c1, 0x14caa2c9), + TOBN(0x526e80ee, 0x27ac7e62), TOBN(0xe1e6e626, 0x58b28aec)}, + {TOBN(0x636178b0, 0xb3c9fef0), TOBN(0xaf7752e0, 0x6d5f90be), + TOBN(0x94ecaf18, 0xeece51cf), TOBN(0x2864d0ed, 0xca806e1f)}}, + {{TOBN(0x6de2e383, 0x97c69134), TOBN(0x5a42c316, 0xeb291293), + TOBN(0xc7779219, 0x6a60bae0), TOBN(0xa24de346, 0x6b7599d1)}, + {TOBN(0x49d374aa, 0xb75d4941), TOBN(0x98900586, 0x2d501ff0), + TOBN(0x9f16d40e, 0xeb7974cf), TOBN(0x1033860b, 0xcdd8c115)}}, + {{TOBN(0xb6c69ac8, 0x2094cec3), TOBN(0x9976fb88, 0x403b770c), + TOBN(0x1dea026c, 0x4859590d), TOBN(0xb6acbb46, 0x8562d1fd)}, + {TOBN(0x7cd6c461, 0x44569d85), TOBN(0xc3190a36, 0x97f0891d), + TOBN(0xc6f53195, 0x48d5a17d), TOBN(0x7d919966, 0xd749abc8)}}, + {{TOBN(0x65104837, 0xdd1c8a20), TOBN(0x7e5410c8, 0x2f683419), + TOBN(0x958c3ca8, 0xbe94022e), TOBN(0x605c3197, 0x6145dac2)}, + {TOBN(0x3fc07501, 0x01683d54), TOBN(0x1d7127c5, 0x595b1234), + TOBN(0x10b8f87c, 0x9481277f), TOBN(0x677db2a8, 0xe65a1adb)}}, + {{TOBN(0xec2fccaa, 0xddce3345), TOBN(0x2a6811b7, 0x012a4350), + TOBN(0x96760ff1, 0xac598bdc), TOBN(0x054d652a, 0xd1bf4128)}, + {TOBN(0x0a1151d4, 0x92a21005), TOBN(0xad7f3971, 0x33110fdf), + TOBN(0x8c95928c, 0x1960100f), TOBN(0x6c91c825, 0x7bf03362)}}, + {{TOBN(0xc8c8b2a2, 0xce309f06), TOBN(0xfdb27b59, 0xca27204b), + TOBN(0xd223eaa5, 0x0848e32e), TOBN(0xb93e4b2e, 0xe7bfaf1e)}, + {TOBN(0xc5308ae6, 0x44aa3ded), TOBN(0x317a666a, 0xc015d573), + TOBN(0xc888ce23, 0x1a979707), TOBN(0xf141c1e6, 0x0d5c4958)}}, + {{TOBN(0xb53b7de5, 0x61906373), TOBN(0x858dbade, 0xeb999595), + TOBN(0x8cbb47b2, 0xa59e5c36), TOBN(0x660318b3, 0xdcf4e842)}, + {TOBN(0xbd161ccd, 0x12ba4b7a), TOBN(0xf399daab, 0xf8c8282a), + TOBN(0x1587633a, 0xeeb2130d), TOBN(0xa465311a, 0xda38dd7d)}}, + {{TOBN(0x5f75eec8, 0x64d3779b), TOBN(0x3c5d0476, 0xad64c171), + TOBN(0x87410371, 0x2a914428), TOBN(0x8096a891, 0x90e2fc29)}, + {TOBN(0xd3d2ae9d, 0x23b3ebc2), TOBN(0x90bdd6db, 0xa580cfd6), + TOBN(0x52dbb7f3, 0xc5b01f6c), TOBN(0xe68eded4, 0xe102a2dc)}}, + {{TOBN(0x17785b77, 0x99eb6df0), TOBN(0x26c3cc51, 0x7386b779), + TOBN(0x345ed988, 0x6417a48e), TOBN(0xe990b4e4, 0x07d6ef31)}, + {TOBN(0x0f456b7e, 0x2586abba), TOBN(0x239ca6a5, 0x59c96e9a), + TOBN(0xe327459c, 0xe2eb4206), TOBN(0x3a4c3313, 0xa002b90a)}}, + {{TOBN(0x2a114806, 0xf6a3f6fb), TOBN(0xad5cad2f, 0x85c251dd), + TOBN(0x92c1f613, 0xf5a784d3), TOBN(0xec7bfacf, 0x349766d5)}, + {TOBN(0x04b3cd33, 0x3e23cb3b), TOBN(0x3979fe84, 0xc5a64b2d), + TOBN(0x192e2720, 0x7e589106), TOBN(0xa60c43d1, 0xa15b527f)}}, + {{TOBN(0x2dae9082, 0xbe7cf3a6), TOBN(0xcc86ba92, 0xbc967274), + TOBN(0xf28a2ce8, 0xaea0a8a9), TOBN(0x404ca6d9, 0x6ee988b3)}, + {TOBN(0xfd7e9c5d, 0x005921b8), TOBN(0xf56297f1, 0x44e79bf9), + TOBN(0xa163b460, 0x0d75ddc2), TOBN(0x30b23616, 0xa1f2be87)}}, + {{TOBN(0x4b070d21, 0xbfe50e2b), TOBN(0x7ef8cfd0, 0xe1bfede1), + TOBN(0xadba0011, 0x2aac4ae0), TOBN(0x2a3e7d01, 0xb9ebd033)}, + {TOBN(0x995277ec, 0xe38d9d1c), TOBN(0xb500249e, 0x9c5d2de3), + TOBN(0x8912b820, 0xf13ca8c9), TOBN(0xc8798114, 0x877793af)}}, + {{TOBN(0x19e6125d, 0xec3f1dec), TOBN(0x07b1f040, 0x911178da), + TOBN(0xd93ededa, 0x904a6738), TOBN(0x55187a5a, 0x0bebedcd)}, + {TOBN(0xf7d04722, 0xeb329d41), TOBN(0xf449099e, 0xf170b391), + TOBN(0xfd317a69, 0xca99f828), TOBN(0x50c3db2b, 0x34a4976d)}}, + {{TOBN(0xe9ba7784, 0x3757b392), TOBN(0x326caefd, 0xaa3ca05a), + TOBN(0x78e5293b, 0xf1e593d4), TOBN(0x7842a937, 0x0d98fd13)}, + {TOBN(0xe694bf96, 0x5f96b10d), TOBN(0x373a9df6, 0x06a8cd05), + TOBN(0x997d1e51, 0xe8f0c7fc), TOBN(0x1d019790, 0x63fd972e)}}, + {{TOBN(0x0064d858, 0x5499fb32), TOBN(0x7b67bad9, 0x77a8aeb7), + TOBN(0x1d3eb977, 0x2d08eec5), TOBN(0x5fc047a6, 0xcbabae1d)}, + {TOBN(0x0577d159, 0xe54a64bb), TOBN(0x8862201b, 0xc43497e4), + TOBN(0xad6b4e28, 0x2ce0608d), TOBN(0x8b687b7d, 0x0b167aac)}}, + {{TOBN(0x6ed4d367, 0x8b2ecfa9), TOBN(0x24dfe62d, 0xa90c3c38), + TOBN(0xa1862e10, 0x3fe5c42b), TOBN(0x1ca73dca, 0xd5732a9f)}, + {TOBN(0x35f038b7, 0x76bb87ad), TOBN(0x674976ab, 0xf242b81f), + TOBN(0x4f2bde7e, 0xb0fd90cd), TOBN(0x6efc172e, 0xa7fdf092)}}, + {{TOBN(0x3806b69b, 0x92222f1f), TOBN(0x5a2459ca, 0x6cf7ae70), + TOBN(0x6789f69c, 0xa85217ee), TOBN(0x5f232b5e, 0xe3dc85ac)}, + {TOBN(0x660e3ec5, 0x48e9e516), TOBN(0x124b4e47, 0x3197eb31), + TOBN(0x10a0cb13, 0xaafcca23), TOBN(0x7bd63ba4, 0x8213224f)}}, + {{TOBN(0xaffad7cc, 0x290a7f4f), TOBN(0x6b409c9e, 0x0286b461), + TOBN(0x58ab809f, 0xffa407af), TOBN(0xc3122eed, 0xc68ac073)}, + {TOBN(0x17bf9e50, 0x4ef24d7e), TOBN(0x5d929794, 0x3e2a5811), + TOBN(0x519bc867, 0x02902e01), TOBN(0x76bba5da, 0x39c8a851)}}, + {{TOBN(0xe9f9669c, 0xda94951e), TOBN(0x4b6af58d, 0x66b8d418), + TOBN(0xfa321074, 0x17d426a4), TOBN(0xc78e66a9, 0x9dde6027)}, + {TOBN(0x0516c083, 0x4a53b964), TOBN(0xfc659d38, 0xff602330), + TOBN(0x0ab55e5c, 0x58c5c897), TOBN(0x985099b2, 0x838bc5df)}}, + {{TOBN(0x061d9efc, 0xc52fc238), TOBN(0x712b2728, 0x6ac1da3f), + TOBN(0xfb658149, 0x9283fe08), TOBN(0x4954ac94, 0xb8aaa2f7)}, + {TOBN(0x85c0ada4, 0x7fb2e74f), TOBN(0xee8ba98e, 0xb89926b0), + TOBN(0xe4f9d37d, 0x23d1af5b), TOBN(0x14ccdbf9, 0xba9b015e)}}, + {{TOBN(0xb674481b, 0x7bfe7178), TOBN(0x4e1debae, 0x65405868), + TOBN(0x061b2821, 0xc48c867d), TOBN(0x69c15b35, 0x513b30ea)}, + {TOBN(0x3b4a1666, 0x36871088), TOBN(0xe5e29f5d, 0x1220b1ff), + TOBN(0x4b82bb35, 0x233d9f4d), TOBN(0x4e076333, 0x18cdc675)}}}, + {{{TOBN(0x0d53f5c7, 0xa3e6fced), TOBN(0xe8cbbdd5, 0xf45fbdeb), + TOBN(0xf85c01df, 0x13339a70), TOBN(0x0ff71880, 0x142ceb81)}, + {TOBN(0x4c4e8774, 0xbd70437a), TOBN(0x5fb32891, 0xba0bda6a), + TOBN(0x1cdbebd2, 0xf18bd26e), TOBN(0x2f9526f1, 0x03a9d522)}}, + {{TOBN(0x40ce3051, 0x92c4d684), TOBN(0x8b04d725, 0x7612efcd), + TOBN(0xb9dcda36, 0x6f9cae20), TOBN(0x0edc4d24, 0xf058856c)}, + {TOBN(0x64f2e6bf, 0x85427900), TOBN(0x3de81295, 0xdc09dfea), + TOBN(0xd41b4487, 0x379bf26c), TOBN(0x50b62c6d, 0x6df135a9)}}, + {{TOBN(0xd4f8e3b4, 0xc72dfe67), TOBN(0xc416b0f6, 0x90e19fdf), + TOBN(0x18b9098d, 0x4c13bd35), TOBN(0xac11118a, 0x15b8cb9e)}, + {TOBN(0xf598a318, 0xf0062841), TOBN(0xbfe0602f, 0x89f356f4), + TOBN(0x7ae3637e, 0x30177a0c), TOBN(0x34097747, 0x61136537)}}, + {{TOBN(0x0db2fb5e, 0xd005832a), TOBN(0x5f5efd3b, 0x91042e4f), + TOBN(0x8c4ffdc6, 0xed70f8ca), TOBN(0xe4645d0b, 0xb52da9cc)}, + {TOBN(0x9596f58b, 0xc9001d1f), TOBN(0x52c8f0bc, 0x4e117205), + TOBN(0xfd4aa0d2, 0xe398a084), TOBN(0x815bfe3a, 0x104f49de)}}, + {{TOBN(0x97e5443f, 0x23885e5f), TOBN(0xf72f8f99, 0xe8433aab), + TOBN(0xbd00b154, 0xe4d4e604), TOBN(0xd0b35e6a, 0xe5e173ff)}, + {TOBN(0x57b2a048, 0x9164722d), TOBN(0x3e3c665b, 0x88761ec8), + TOBN(0x6bdd1397, 0x3da83832), TOBN(0x3c8b1a1e, 0x73dafe3b)}}, + {{TOBN(0x4497ace6, 0x54317cac), TOBN(0xbe600ab9, 0x521771b3), + TOBN(0xb42e409e, 0xb0dfe8b8), TOBN(0x386a67d7, 0x3942310f)}, + {TOBN(0x25548d8d, 0x4431cc28), TOBN(0xa7cff142, 0x985dc524), + TOBN(0x4d60f5a1, 0x93c4be32), TOBN(0x83ebd5c8, 0xd071c6e1)}}, + {{TOBN(0xba3a80a7, 0xb1fd2b0b), TOBN(0x9b3ad396, 0x5bec33e8), + TOBN(0xb3868d61, 0x79743fb3), TOBN(0xcfd169fc, 0xfdb462fa)}, + {TOBN(0xd3b499d7, 0x9ce0a6af), TOBN(0x55dc1cf1, 0xe42d3ff8), + TOBN(0x04fb9e6c, 0xc6c3e1b2), TOBN(0x47e6961d, 0x6f69a474)}}, + {{TOBN(0x54eb3acc, 0xe548b37b), TOBN(0xb38e7542, 0x84d40549), + TOBN(0x8c3daa51, 0x7b341b4f), TOBN(0x2f6928ec, 0x690bf7fa)}, + {TOBN(0x0496b323, 0x86ce6c41), TOBN(0x01be1c55, 0x10adadcd), + TOBN(0xc04e67e7, 0x4bb5faf9), TOBN(0x3cbaf678, 0xe15c9985)}}, + {{TOBN(0x8cd12145, 0x50ca4247), TOBN(0xba1aa47a, 0xe7dd30aa), + TOBN(0x2f81ddf1, 0xe58fee24), TOBN(0x03452936, 0xeec9b0e8)}, + {TOBN(0x8bdc3b81, 0x243aea96), TOBN(0x9a2919af, 0x15c3d0e5), + TOBN(0x9ea640ec, 0x10948361), TOBN(0x5ac86d5b, 0x6e0bcccf)}}, + {{TOBN(0xf892d918, 0xc36cf440), TOBN(0xaed3e837, 0xc939719c), + TOBN(0xb07b08d2, 0xc0218b64), TOBN(0x6f1bcbba, 0xce9790dd)}, + {TOBN(0x4a84d6ed, 0x60919b8e), TOBN(0xd8900791, 0x8ac1f9eb), + TOBN(0xf84941aa, 0x0dd5daef), TOBN(0xb22fe40a, 0x67fd62c5)}}, + {{TOBN(0x97e15ba2, 0x157f2db3), TOBN(0xbda2fc8f, 0x8e28ca9c), + TOBN(0x5d050da4, 0x37b9f454), TOBN(0x3d57eb57, 0x2379d72e)}, + {TOBN(0xe9b5eba2, 0xfb5ee997), TOBN(0x01648ca2, 0xe11538ca), + TOBN(0x32bb76f6, 0xf6327974), TOBN(0x338f14b8, 0xff3f4bb7)}}, + {{TOBN(0x524d226a, 0xd7ab9a2d), TOBN(0x9c00090d, 0x7dfae958), + TOBN(0x0ba5f539, 0x8751d8c2), TOBN(0x8afcbcdd, 0x3ab8262d)}, + {TOBN(0x57392729, 0xe99d043b), TOBN(0xef51263b, 0xaebc943a), + TOBN(0x9feace93, 0x20862935), TOBN(0x639efc03, 0xb06c817b)}}, + {{TOBN(0x1fe054b3, 0x66b4be7a), TOBN(0x3f25a9de, 0x84a37a1e), + TOBN(0xf39ef1ad, 0x78d75cd9), TOBN(0xd7b58f49, 0x5062c1b5)}, + {TOBN(0x6f74f9a9, 0xff563436), TOBN(0xf718ff29, 0xe8af51e7), + TOBN(0x5234d313, 0x15e97fec), TOBN(0xb6a8e2b1, 0x292f1c0a)}}, + {{TOBN(0xa7f53aa8, 0x327720c1), TOBN(0x956ca322, 0xba092cc8), + TOBN(0x8f03d64a, 0x28746c4d), TOBN(0x51fe1782, 0x66d0d392)}, + {TOBN(0xd19b34db, 0x3c832c80), TOBN(0x60dccc5c, 0x6da2e3b4), + TOBN(0x245dd62e, 0x0a104ccc), TOBN(0xa7ab1de1, 0x620b21fd)}}, + {{TOBN(0xb293ae0b, 0x3893d123), TOBN(0xf7b75783, 0xb15ee71c), + TOBN(0x5aa3c614, 0x42a9468b), TOBN(0xd686123c, 0xdb15d744)}, + {TOBN(0x8c616891, 0xa7ab4116), TOBN(0x6fcd72c8, 0xa4e6a459), + TOBN(0xac219110, 0x77e5fad7), TOBN(0xfb6a20e7, 0x704fa46b)}}, + {{TOBN(0xe839be7d, 0x341d81dc), TOBN(0xcddb6889, 0x32148379), + TOBN(0xda6211a1, 0xf7026ead), TOBN(0xf3b2575f, 0xf4d1cc5e)}, + {TOBN(0x40cfc8f6, 0xa7a73ae6), TOBN(0x83879a5e, 0x61d5b483), + TOBN(0xc5acb1ed, 0x41a50ebc), TOBN(0x59a60cc8, 0x3c07d8fa)}}, + {{TOBN(0x1b73bdce, 0xb1876262), TOBN(0x2b0d79f0, 0x12af4ee9), + TOBN(0x8bcf3b0b, 0xd46e1d07), TOBN(0x17d6af9d, 0xe45d152f)}, + {TOBN(0x73520461, 0x6d736451), TOBN(0x43cbbd97, 0x56b0bf5a), + TOBN(0xb0833a5b, 0xd5999b9d), TOBN(0x702614f0, 0xeb72e398)}}, + {{TOBN(0x0aadf01a, 0x59c3e9f8), TOBN(0x40200e77, 0xce6b3d16), + TOBN(0xda22bdd3, 0xdeddafad), TOBN(0x76dedaf4, 0x310d72e1)}, + {TOBN(0x49ef807c, 0x4bc2e88f), TOBN(0x6ba81291, 0x146dd5a5), + TOBN(0xa1a4077a, 0x7d8d59e9), TOBN(0x87b6a2e7, 0x802db349)}}, + {{TOBN(0xd5679997, 0x1b4e598e), TOBN(0xf499ef1f, 0x06fe4b1d), + TOBN(0x3978d3ae, 0xfcb267c5), TOBN(0xb582b557, 0x235786d0)}, + {TOBN(0x32b3b2ca, 0x1715cb07), TOBN(0x4c3de6a2, 0x8480241d), + TOBN(0x63b5ffed, 0xcb571ecd), TOBN(0xeaf53900, 0xed2fe9a9)}}, + {{TOBN(0xdec98d4a, 0xc3b81990), TOBN(0x1cb83722, 0x9e0cc8fe), + TOBN(0xfe0b0491, 0xd2b427b9), TOBN(0x0f2386ac, 0xe983a66c)}, + {TOBN(0x930c4d1e, 0xb3291213), TOBN(0xa2f82b2e, 0x59a62ae4), + TOBN(0x77233853, 0xf93e89e3), TOBN(0x7f8063ac, 0x11777c7f)}}, + {{TOBN(0xff0eb567, 0x59ad2877), TOBN(0x6f454642, 0x9865c754), + TOBN(0xe6fe701a, 0x236e9a84), TOBN(0xc586ef16, 0x06e40fc3)}, + {TOBN(0x3f62b6e0, 0x24bafad9), TOBN(0xc8b42bd2, 0x64da906a), + TOBN(0xc98e1eb4, 0xda3276a0), TOBN(0x30d0e5fc, 0x06cbf852)}}, + {{TOBN(0x1b6b2ae1, 0xe8b4dfd4), TOBN(0xd754d5c7, 0x8301cbac), + TOBN(0x66097629, 0x112a39ac), TOBN(0xf86b5999, 0x93ba4ab9)}, + {TOBN(0x26c9dea7, 0x99f9d581), TOBN(0x0473b1a8, 0xc2fafeaa), + TOBN(0x1469af55, 0x3b2505a5), TOBN(0x227d16d7, 0xd6a43323)}}, + {{TOBN(0x3316f73c, 0xad3d97f9), TOBN(0x52bf3bb5, 0x1f137455), + TOBN(0x953eafeb, 0x09954e7c), TOBN(0xa721dfed, 0xdd732411)}, + {TOBN(0xb4929821, 0x141d4579), TOBN(0x3411321c, 0xaa3bd435), + TOBN(0xafb355aa, 0x17fa6015), TOBN(0xb4e7ef4a, 0x18e42f0e)}}, + {{TOBN(0x604ac97c, 0x59371000), TOBN(0xe1c48c70, 0x7f759c18), + TOBN(0x3f62ecc5, 0xa5db6b65), TOBN(0x0a78b173, 0x38a21495)}, + {TOBN(0x6be1819d, 0xbcc8ad94), TOBN(0x70dc04f6, 0xd89c3400), + TOBN(0x462557b4, 0xa6b4840a), TOBN(0x544c6ade, 0x60bd21c0)}}, + {{TOBN(0x6a00f24e, 0x907a544b), TOBN(0xa7520dcb, 0x313da210), + TOBN(0xfe939b75, 0x11e4994b), TOBN(0x918b6ba6, 0xbc275d70)}, + {TOBN(0xd3e5e0fc, 0x644be892), TOBN(0x707a9816, 0xfdaf6c42), + TOBN(0x60145567, 0xf15c13fe), TOBN(0x4818ebaa, 0xe130a54a)}}, + {{TOBN(0x28aad3ad, 0x58d2f767), TOBN(0xdc5267fd, 0xd7e7c773), + TOBN(0x4919cc88, 0xc3afcc98), TOBN(0xaa2e6ab0, 0x2db8cd4b)}, + {TOBN(0xd46fec04, 0xd0c63eaa), TOBN(0xa1cb92c5, 0x19ffa832), + TOBN(0x678dd178, 0xe43a631f), TOBN(0xfb5ae1cd, 0x3dc788b3)}}, + {{TOBN(0x68b4fb90, 0x6e77de04), TOBN(0x7992bcf0, 0xf06dbb97), + TOBN(0x896e6a13, 0xc417c01d), TOBN(0x8d96332c, 0xb956be01)}, + {TOBN(0x902fc93a, 0x413aa2b9), TOBN(0x99a4d915, 0xfc98c8a5), + TOBN(0x52c29407, 0x565f1137), TOBN(0x4072690f, 0x21e4f281)}}, + {{TOBN(0x36e607cf, 0x02ff6072), TOBN(0xa47d2ca9, 0x8ad98cdc), + TOBN(0xbf471d1e, 0xf5f56609), TOBN(0xbcf86623, 0xf264ada0)}, + {TOBN(0xb70c0687, 0xaa9e5cb6), TOBN(0xc98124f2, 0x17401c6c), + TOBN(0x8189635f, 0xd4a61435), TOBN(0xd28fb8af, 0xa9d98ea6)}}, + {{TOBN(0xb9a67c2a, 0x40c251f8), TOBN(0x88cd5d87, 0xa2da44be), + TOBN(0x437deb96, 0xe09b5423), TOBN(0x150467db, 0x64287dc1)}, + {TOBN(0xe161debb, 0xcdabb839), TOBN(0xa79e9742, 0xf1839a3e), + TOBN(0xbb8dd3c2, 0x652d202b), TOBN(0x7b3e67f7, 0xe9f97d96)}}, + {{TOBN(0x5aa5d78f, 0xb1cb6ac9), TOBN(0xffa13e8e, 0xca1d0d45), + TOBN(0x369295dd, 0x2ba5bf95), TOBN(0xd68bd1f8, 0x39aff05e)}, + {TOBN(0xaf0d86f9, 0x26d783f2), TOBN(0x543a59b3, 0xfc3aafc1), + TOBN(0x3fcf81d2, 0x7b7da97c), TOBN(0xc990a056, 0xd25dee46)}}, + {{TOBN(0x3e6775b8, 0x519cce2c), TOBN(0xfc9af71f, 0xae13d863), + TOBN(0x774a4a6f, 0x47c1605c), TOBN(0x46ba4245, 0x2fd205e8)}, + {TOBN(0xa06feea4, 0xd3fd524d), TOBN(0x1e724641, 0x6de1acc2), + TOBN(0xf53816f1, 0x334e2b42), TOBN(0x49e5918e, 0x922f0024)}}, + {{TOBN(0x439530b6, 0x65c7322d), TOBN(0xcf12cc01, 0xb3c1b3fb), + TOBN(0xc70b0186, 0x0172f685), TOBN(0xb915ee22, 0x1b58391d)}, + {TOBN(0x9afdf03b, 0xa317db24), TOBN(0x87dec659, 0x17b8ffc4), + TOBN(0x7f46597b, 0xe4d3d050), TOBN(0x80a1c1ed, 0x006500e7)}}, + {{TOBN(0x84902a96, 0x78bf030e), TOBN(0xfb5e9c9a, 0x50560148), + TOBN(0x6dae0a92, 0x63362426), TOBN(0xdcaeecf4, 0xa9e30c40)}, + {TOBN(0xc0d887bb, 0x518d0c6b), TOBN(0x99181152, 0xcb985b9d), + TOBN(0xad186898, 0xef7bc381), TOBN(0x18168ffb, 0x9ee46201)}}, + {{TOBN(0x9a04cdaa, 0x2502753c), TOBN(0xbb279e26, 0x51407c41), + TOBN(0xeacb03aa, 0xf23564e5), TOBN(0x18336582, 0x71e61016)}, + {TOBN(0x8684b8c4, 0xeb809877), TOBN(0xb336e18d, 0xea0e672e), + TOBN(0xefb601f0, 0x34ee5867), TOBN(0x2733edbe, 0x1341cfd1)}}, + {{TOBN(0xb15e809a, 0x26025c3c), TOBN(0xe6e981a6, 0x9350df88), + TOBN(0x92376237, 0x8502fd8e), TOBN(0x4791f216, 0x0c12be9b)}, + {TOBN(0xb7256789, 0x25f02425), TOBN(0xec863194, 0x7a974443), + TOBN(0x7c0ce882, 0xfb41cc52), TOBN(0xc266ff7e, 0xf25c07f2)}}, + {{TOBN(0x3d4da8c3, 0x017025f3), TOBN(0xefcf628c, 0xfb9579b4), + TOBN(0x5c4d0016, 0x1f3716ec), TOBN(0x9c27ebc4, 0x6801116e)}, + {TOBN(0x5eba0ea1, 0x1da1767e), TOBN(0xfe151452, 0x47004c57), + TOBN(0x3ace6df6, 0x8c2373b7), TOBN(0x75c3dffe, 0x5dbc37ac)}}, + {{TOBN(0x3dc32a73, 0xddc925fc), TOBN(0xb679c841, 0x2f65ee0b), + TOBN(0x715a3295, 0x451cbfeb), TOBN(0xd9889768, 0xf76e9a29)}, + {TOBN(0xec20ce7f, 0xb28ad247), TOBN(0xe99146c4, 0x00894d79), + TOBN(0x71457d7c, 0x9f5e3ea7), TOBN(0x097b2662, 0x38030031)}}, + {{TOBN(0xdb7f6ae6, 0xcf9f82a8), TOBN(0x319decb9, 0x438f473a), + TOBN(0xa63ab386, 0x283856c3), TOBN(0x13e3172f, 0xb06a361b)}, + {TOBN(0x2959f8dc, 0x7d5a006c), TOBN(0x2dbc27c6, 0x75fba752), + TOBN(0xc1227ab2, 0x87c22c9e), TOBN(0x06f61f75, 0x71a268b2)}}, + {{TOBN(0x1b6bb971, 0x04779ce2), TOBN(0xaca83812, 0x0aadcb1d), + TOBN(0x297ae0bc, 0xaeaab2d5), TOBN(0xa5c14ee7, 0x5bfb9f13)}, + {TOBN(0xaa00c583, 0xf17a62c7), TOBN(0x39eb962c, 0x173759f6), + TOBN(0x1eeba1d4, 0x86c9a88f), TOBN(0x0ab6c37a, 0xdf016c5e)}}, + {{TOBN(0xa2a147db, 0xa28a0749), TOBN(0x246c20d6, 0xee519165), + TOBN(0x5068d1b1, 0xd3810715), TOBN(0xb1e7018c, 0x748160b9)}, + {TOBN(0x03f5b1fa, 0xf380ff62), TOBN(0xef7fb1dd, 0xf3cb2c1e), + TOBN(0xeab539a8, 0xfc91a7da), TOBN(0x83ddb707, 0xf3f9b561)}}, + {{TOBN(0xc550e211, 0xfe7df7a4), TOBN(0xa7cd07f2, 0x063f6f40), + TOBN(0xb0de3635, 0x2976879c), TOBN(0xb5f83f85, 0xe55741da)}, + {TOBN(0x4ea9d25e, 0xf3d8ac3d), TOBN(0x6fe2066f, 0x62819f02), + TOBN(0x4ab2b9c2, 0xcef4a564), TOBN(0x1e155d96, 0x5ffa2de3)}}, + {{TOBN(0x0eb0a19b, 0xc3a72d00), TOBN(0x4037665b, 0x8513c31b), + TOBN(0x2fb2b6bf, 0x04c64637), TOBN(0x45c34d6e, 0x08cdc639)}, + {TOBN(0x56f1e10f, 0xf01fd796), TOBN(0x4dfb8101, 0xfe3667b8), + TOBN(0xe0eda253, 0x9021d0c0), TOBN(0x7a94e9ff, 0x8a06c6ab)}}, + {{TOBN(0x2d3bb0d9, 0xbb9aa882), TOBN(0xea20e4e5, 0xec05fd10), + TOBN(0xed7eeb5f, 0x1a1ca64e), TOBN(0x2fa6b43c, 0xc6327cbd)}, + {TOBN(0xb577e3cf, 0x3aa91121), TOBN(0x8c6bd5ea, 0x3a34079b), + TOBN(0xd7e5ba39, 0x60e02fc0), TOBN(0xf16dd2c3, 0x90141bf8)}}, + {{TOBN(0xb57276d9, 0x80101b98), TOBN(0x760883fd, 0xb82f0f66), + TOBN(0x89d7de75, 0x4bc3eff3), TOBN(0x03b60643, 0x5dc2ab40)}, + {TOBN(0xcd6e53df, 0xe05beeac), TOBN(0xf2f1e862, 0xbc3325cd), + TOBN(0xdd0f7921, 0x774f03c3), TOBN(0x97ca7221, 0x4552cc1b)}}, + {{TOBN(0x5a0d6afe, 0x1cd19f72), TOBN(0xa20915dc, 0xf183fbeb), + TOBN(0x9fda4b40, 0x832c403c), TOBN(0x32738edd, 0xbe425442)}, + {TOBN(0x469a1df6, 0xb5eccf1a), TOBN(0x4b5aff42, 0x28bbe1f0), + TOBN(0x31359d7f, 0x570dfc93), TOBN(0xa18be235, 0xf0088628)}}, + {{TOBN(0xa5b30fba, 0xb00ed3a9), TOBN(0x34c61374, 0x73cdf8be), + TOBN(0x2c5c5f46, 0xabc56797), TOBN(0x5cecf93d, 0xb82a8ae2)}, + {TOBN(0x7d3dbe41, 0xa968fbf0), TOBN(0xd23d4583, 0x1a5c7f3d), + TOBN(0xf28f69a0, 0xc087a9c7), TOBN(0xc2d75471, 0x474471ca)}}, + {{TOBN(0x36ec9f4a, 0x4eb732ec), TOBN(0x6c943bbd, 0xb1ca6bed), + TOBN(0xd64535e1, 0xf2457892), TOBN(0x8b84a8ea, 0xf7e2ac06)}, + {TOBN(0xe0936cd3, 0x2499dd5f), TOBN(0x12053d7e, 0x0ed04e57), + TOBN(0x4bdd0076, 0xe4305d9d), TOBN(0x34a527b9, 0x1f67f0a2)}}, + {{TOBN(0xe79a4af0, 0x9cec46ea), TOBN(0xb15347a1, 0x658b9bc7), + TOBN(0x6bd2796f, 0x35af2f75), TOBN(0xac957990, 0x4051c435)}, + {TOBN(0x2669dda3, 0xc33a655d), TOBN(0x5d503c2e, 0x88514aa3), + TOBN(0xdfa11337, 0x3753dd41), TOBN(0x3f054673, 0x0b754f78)}}, + {{TOBN(0xbf185677, 0x496125bd), TOBN(0xfb0023c8, 0x3775006c), + TOBN(0xfa0f072f, 0x3a037899), TOBN(0x4222b6eb, 0x0e4aea57)}, + {TOBN(0x3dde5e76, 0x7866d25a), TOBN(0xb6eb04f8, 0x4837aa6f), + TOBN(0x5315591a, 0x2cf1cdb8), TOBN(0x6dfb4f41, 0x2d4e683c)}}, + {{TOBN(0x7e923ea4, 0x48ee1f3a), TOBN(0x9604d9f7, 0x05a2afd5), + TOBN(0xbe1d4a33, 0x40ea4948), TOBN(0x5b45f1f4, 0xb44cbd2f)}, + {TOBN(0x5faf8376, 0x4acc757e), TOBN(0xa7cf9ab8, 0x63d68ff7), + TOBN(0x8ad62f69, 0xdf0e404b), TOBN(0xd65f33c2, 0x12bdafdf)}}, + {{TOBN(0xc365de15, 0xa377b14e), TOBN(0x6bf5463b, 0x8e39f60c), + TOBN(0x62030d2d, 0x2ce68148), TOBN(0xd95867ef, 0xe6f843a8)}, + {TOBN(0xd39a0244, 0xef5ab017), TOBN(0x0bd2d8c1, 0x4ab55d12), + TOBN(0xc9503db3, 0x41639169), TOBN(0x2d4e25b0, 0xf7660c8a)}}, + {{TOBN(0x760cb3b5, 0xe224c5d7), TOBN(0xfa3baf8c, 0x68616919), + TOBN(0x9fbca113, 0x8d142552), TOBN(0x1ab18bf1, 0x7669ebf5)}, + {TOBN(0x55e6f53e, 0x9bdf25dd), TOBN(0x04cc0bf3, 0xcb6cd154), + TOBN(0x595bef49, 0x95e89080), TOBN(0xfe9459a8, 0x104a9ac1)}}, + {{TOBN(0xad2d89ca, 0xcce9bb32), TOBN(0xddea65e1, 0xf7de8285), + TOBN(0x62ed8c35, 0xb351bd4b), TOBN(0x4150ff36, 0x0c0e19a7)}, + {TOBN(0x86e3c801, 0x345f4e47), TOBN(0x3bf21f71, 0x203a266c), + TOBN(0x7ae110d4, 0x855b1f13), TOBN(0x5d6aaf6a, 0x07262517)}}, + {{TOBN(0x1e0f12e1, 0x813d28f1), TOBN(0x6000e11d, 0x7ad7a523), + TOBN(0xc7d8deef, 0xc744a17b), TOBN(0x1e990b48, 0x14c05a00)}, + {TOBN(0x68fddaee, 0x93e976d5), TOBN(0x696241d1, 0x46610d63), + TOBN(0xb204e7c3, 0x893dda88), TOBN(0x8bccfa65, 0x6a3a6946)}}, + {{TOBN(0xb59425b4, 0xc5cd1411), TOBN(0x701b4042, 0xff3658b1), + TOBN(0xe3e56bca, 0x4784cf93), TOBN(0x27de5f15, 0x8fe68d60)}, + {TOBN(0x4ab9cfce, 0xf8d53f19), TOBN(0xddb10311, 0xa40a730d), + TOBN(0x6fa73cd1, 0x4eee0a8a), TOBN(0xfd548748, 0x5249719d)}}, + {{TOBN(0x49d66316, 0xa8123ef0), TOBN(0x73c32db4, 0xe7f95438), + TOBN(0x2e2ed209, 0x0d9e7854), TOBN(0xf98a9329, 0x9d9f0507)}, + {TOBN(0xc5d33cf6, 0x0c6aa20a), TOBN(0x9a32ba14, 0x75279bb2), + TOBN(0x7e3202cb, 0x774a7307), TOBN(0x64ed4bc4, 0xe8c42dbd)}}, + {{TOBN(0xc20f1a06, 0xd4caed0d), TOBN(0xb8021407, 0x171d22b3), + TOBN(0xd426ca04, 0xd13268d7), TOBN(0x92377007, 0x25f4d126)}, + {TOBN(0x4204cbc3, 0x71f21a85), TOBN(0x18461b7a, 0xf82369ba), + TOBN(0xc0c07d31, 0x3fc858f9), TOBN(0x5deb5a50, 0xe2bab569)}}, + {{TOBN(0xd5959d46, 0xd5eea89e), TOBN(0xfdff8424, 0x08437f4b), + TOBN(0xf21071e4, 0x3cfe254f), TOBN(0x72417696, 0x95468321)}, + {TOBN(0x5d8288b9, 0x102cae3e), TOBN(0x2d143e3d, 0xf1965dff), + TOBN(0x00c9a376, 0xa078d847), TOBN(0x6fc0da31, 0x26028731)}}, + {{TOBN(0xa2baeadf, 0xe45083a2), TOBN(0x66bc7218, 0x5e5b4bcd), + TOBN(0x2c826442, 0xd04b8e7f), TOBN(0xc19f5451, 0x6c4b586b)}, + {TOBN(0x60182c49, 0x5b7eeed5), TOBN(0xd9954ecd, 0x7aa9dfa1), + TOBN(0xa403a8ec, 0xc73884ad), TOBN(0x7fb17de2, 0x9bb39041)}}, + {{TOBN(0x694b64c5, 0xabb020e8), TOBN(0x3d18c184, 0x19c4eec7), + TOBN(0x9c4673ef, 0x1c4793e5), TOBN(0xc7b8aeb5, 0x056092e6)}, + {TOBN(0x3aa1ca43, 0xf0f8c16b), TOBN(0x224ed5ec, 0xd679b2f6), + TOBN(0x0d56eeaf, 0x55a205c9), TOBN(0xbfe115ba, 0x4b8e028b)}}, + {{TOBN(0x97e60849, 0x3927f4fe), TOBN(0xf91fbf94, 0x759aa7c5), + TOBN(0x985af769, 0x6be90a51), TOBN(0xc1277b78, 0x78ccb823)}, + {TOBN(0x395b656e, 0xe7a75952), TOBN(0x00df7de0, 0x928da5f5), + TOBN(0x09c23175, 0x4ca4454f), TOBN(0x4ec971f4, 0x7aa2d3c1)}}, + {{TOBN(0x45c3c507, 0xe75d9ccc), TOBN(0x63b7be8a, 0x3dc90306), + TOBN(0x37e09c66, 0x5db44bdc), TOBN(0x50d60da1, 0x6841c6a2)}, + {TOBN(0x6f9b65ee, 0x08df1b12), TOBN(0x38734879, 0x7ff089df), + TOBN(0x9c331a66, 0x3fe8013d), TOBN(0x017f5de9, 0x5f42fcc8)}}, + {{TOBN(0x43077866, 0xe8e57567), TOBN(0xc9f781ce, 0xf9fcdb18), + TOBN(0x38131dda, 0x9b12e174), TOBN(0x25d84aa3, 0x8a03752a)}, + {TOBN(0x45e09e09, 0x4d0c0ce2), TOBN(0x1564008b, 0x92bebba5), + TOBN(0xf7e8ad31, 0xa87284c7), TOBN(0xb7c4b46c, 0x97e7bbaa)}}, + {{TOBN(0x3e22a7b3, 0x97acf4ec), TOBN(0x0426c400, 0x5ea8b640), + TOBN(0x5e3295a6, 0x4e969285), TOBN(0x22aabc59, 0xa6a45670)}, + {TOBN(0xb929714c, 0x5f5942bc), TOBN(0x9a6168bd, 0xfa3182ed), + TOBN(0x2216a665, 0x104152ba), TOBN(0x46908d03, 0xb6926368)}}}, + {{{TOBN(0xa9f5d874, 0x5a1251fb), TOBN(0x967747a8, 0xc72725c7), + TOBN(0x195c33e5, 0x31ffe89e), TOBN(0x609d210f, 0xe964935e)}, + {TOBN(0xcafd6ca8, 0x2fe12227), TOBN(0xaf9b5b96, 0x0426469d), + TOBN(0x2e9ee04c, 0x5693183c), TOBN(0x1084a333, 0xc8146fef)}}, + {{TOBN(0x96649933, 0xaed1d1f7), TOBN(0x566eaff3, 0x50563090), + TOBN(0x345057f0, 0xad2e39cf), TOBN(0x148ff65b, 0x1f832124)}, + {TOBN(0x042e89d4, 0xcf94cf0d), TOBN(0x319bec84, 0x520c58b3), + TOBN(0x2a267626, 0x5361aa0d), TOBN(0xc86fa302, 0x8fbc87ad)}}, + {{TOBN(0xfc83d2ab, 0x5c8b06d5), TOBN(0xb1a785a2, 0xfe4eac46), + TOBN(0xb99315bc, 0x846f7779), TOBN(0xcf31d816, 0xef9ea505)}, + {TOBN(0x2391fe6a, 0x15d7dc85), TOBN(0x2f132b04, 0xb4016b33), + TOBN(0x29547fe3, 0x181cb4c7), TOBN(0xdb66d8a6, 0x650155a1)}}, + {{TOBN(0x6b66d7e1, 0xadc1696f), TOBN(0x98ebe593, 0x0acd72d0), + TOBN(0x65f24550, 0xcc1b7435), TOBN(0xce231393, 0xb4b9a5ec)}, + {TOBN(0x234a22d4, 0xdb067df9), TOBN(0x98dda095, 0xcaff9b00), + TOBN(0x1bbc75a0, 0x6100c9c1), TOBN(0x1560a9c8, 0x939cf695)}}, + {{TOBN(0xcf006d3e, 0x99e0925f), TOBN(0x2dd74a96, 0x6322375a), + TOBN(0xc58b446a, 0xb56af5ba), TOBN(0x50292683, 0xe0b9b4f1)}, + {TOBN(0xe2c34cb4, 0x1aeaffa3), TOBN(0x8b17203f, 0x9b9587c1), + TOBN(0x6d559207, 0xead1350c), TOBN(0x2b66a215, 0xfb7f9604)}}, + {{TOBN(0x0850325e, 0xfe51bf74), TOBN(0x9c4f579e, 0x5e460094), + TOBN(0x5c87b92a, 0x76da2f25), TOBN(0x889de4e0, 0x6febef33)}, + {TOBN(0x6900ec06, 0x646083ce), TOBN(0xbe2a0335, 0xbfe12773), + TOBN(0xadd1da35, 0xc5344110), TOBN(0x757568b7, 0xb802cd20)}}, + {{TOBN(0x75559779, 0x00f7e6c8), TOBN(0x38e8b94f, 0x0facd2f0), + TOBN(0xfea1f3af, 0x03fde375), TOBN(0x5e11a1d8, 0x75881dfc)}, + {TOBN(0xb3a6b02e, 0xc1e2f2ef), TOBN(0x193d2bbb, 0xc605a6c5), + TOBN(0x325ffeee, 0x339a0b2d), TOBN(0x27b6a724, 0x9e0c8846)}}, + {{TOBN(0xe4050f1c, 0xf1c367ca), TOBN(0x9bc85a9b, 0xc90fbc7d), + TOBN(0xa373c4a2, 0xe1a11032), TOBN(0xb64232b7, 0xad0393a9)}, + {TOBN(0xf5577eb0, 0x167dad29), TOBN(0x1604f301, 0x94b78ab2), + TOBN(0x0baa94af, 0xe829348b), TOBN(0x77fbd8dd, 0x41654342)}}, + {{TOBN(0xdab50ea5, 0xb964e39a), TOBN(0xd4c29e3c, 0xd0d3c76e), + TOBN(0x80dae67c, 0x56d11964), TOBN(0x7307a8bf, 0xe5ffcc2f)}, + {TOBN(0x65bbc1aa, 0x91708c3b), TOBN(0xa151e62c, 0x28bf0eeb), + TOBN(0x6cb53381, 0x6fa34db7), TOBN(0x5139e05c, 0xa29403a8)}}, + {{TOBN(0x6ff651b4, 0x94a7cd2e), TOBN(0x5671ffd1, 0x0699336c), + TOBN(0x6f5fd2cc, 0x979a896a), TOBN(0x11e893a8, 0xd8148cef)}, + {TOBN(0x988906a1, 0x65cf7b10), TOBN(0x81b67178, 0xc50d8485), + TOBN(0x7c0deb35, 0x8a35b3de), TOBN(0x423ac855, 0xc1d29799)}}, + {{TOBN(0xaf580d87, 0xdac50b74), TOBN(0x28b2b89f, 0x5869734c), + TOBN(0x99a3b936, 0x874e28fb), TOBN(0xbb2c9190, 0x25f3f73a)}, + {TOBN(0x199f6918, 0x84a9d5b7), TOBN(0x7ebe2325, 0x7e770374), + TOBN(0xf442e107, 0x0738efe2), TOBN(0xcf9f3f56, 0xcf9082d2)}}, + {{TOBN(0x719f69e1, 0x09618708), TOBN(0xcc9e8364, 0xc183f9b1), + TOBN(0xec203a95, 0x366a21af), TOBN(0x6aec5d6d, 0x068b141f)}, + {TOBN(0xee2df78a, 0x994f04e9), TOBN(0xb39ccae8, 0x271245b0), + TOBN(0xb875a4a9, 0x97e43f4f), TOBN(0x507dfe11, 0xdb2cea98)}}, + {{TOBN(0x4fbf81cb, 0x489b03e9), TOBN(0xdb86ec5b, 0x6ec414fa), + TOBN(0xfad444f9, 0xf51b3ae5), TOBN(0xca7d33d6, 0x1914e3fe)}, + {TOBN(0xa9c32f5c, 0x0ae6c4d0), TOBN(0xa9ca1d1e, 0x73969568), + TOBN(0x98043c31, 0x1aa7467e), TOBN(0xe832e75c, 0xe21b5ac6)}}, + {{TOBN(0x314b7aea, 0x5232123d), TOBN(0x08307c8c, 0x65ae86db), + TOBN(0x06e7165c, 0xaa4668ed), TOBN(0xb170458b, 0xb4d3ec39)}, + {TOBN(0x4d2e3ec6, 0xc19bb986), TOBN(0xc5f34846, 0xae0304ed), + TOBN(0x917695a0, 0x6c9f9722), TOBN(0x6c7f7317, 0x4cab1c0a)}}, + {{TOBN(0x6295940e, 0x9d6d2e8b), TOBN(0xd318b8c1, 0x549f7c97), + TOBN(0x22453204, 0x97713885), TOBN(0x468d834b, 0xa8a440fe)}, + {TOBN(0xd81fe5b2, 0xbfba796e), TOBN(0x152364db, 0x6d71f116), + TOBN(0xbb8c7c59, 0xb5b66e53), TOBN(0x0b12c61b, 0x2641a192)}}, + {{TOBN(0x31f14802, 0xfcf0a7fd), TOBN(0x42fd0789, 0x5488b01e), + TOBN(0x71d78d6d, 0x9952b498), TOBN(0x8eb572d9, 0x07ac5201)}, + {TOBN(0xe0a2a44c, 0x4d194a88), TOBN(0xd2b63fd9, 0xba017e66), + TOBN(0x78efc6c8, 0xf888aefc), TOBN(0xb76f6bda, 0x4a881a11)}}, + {{TOBN(0x187f314b, 0xb46c2397), TOBN(0x004cf566, 0x5ded2819), + TOBN(0xa9ea5704, 0x38764d34), TOBN(0xbba45217, 0x78084709)}, + {TOBN(0x06474571, 0x1171121e), TOBN(0xad7b7eb1, 0xe7c9b671), + TOBN(0xdacfbc40, 0x730f7507), TOBN(0x178cd8c6, 0xc7ad7bd1)}}, + {{TOBN(0xbf0be101, 0xb2a67238), TOBN(0x3556d367, 0xaf9c14f2), + TOBN(0x104b7831, 0xa5662075), TOBN(0x58ca59bb, 0x79d9e60a)}, + {TOBN(0x4bc45392, 0xa569a73b), TOBN(0x517a52e8, 0x5698f6c9), + TOBN(0x85643da5, 0xaeadd755), TOBN(0x1aed0cd5, 0x2a581b84)}}, + {{TOBN(0xb9b4ff84, 0x80af1372), TOBN(0x244c3113, 0xf1ba5d1f), + TOBN(0x2a5dacbe, 0xf5f98d31), TOBN(0x2c3323e8, 0x4375bc2a)}, + {TOBN(0x17a3ab4a, 0x5594b1dd), TOBN(0xa1928bfb, 0xceb4797e), + TOBN(0xe83af245, 0xe4886a19), TOBN(0x8979d546, 0x72b5a74a)}}, + {{TOBN(0xa0f726bc, 0x19f9e967), TOBN(0xd9d03152, 0xe8fbbf4e), + TOBN(0xcfd6f51d, 0xb7707d40), TOBN(0x633084d9, 0x63f6e6e0)}, + {TOBN(0xedcd9cdc, 0x55667eaf), TOBN(0x73b7f92b, 0x2e44d56f), + TOBN(0xfb2e39b6, 0x4e962b14), TOBN(0x7d408f6e, 0xf671fcbf)}}, + {{TOBN(0xcc634ddc, 0x164a89bb), TOBN(0x74a42bb2, 0x3ef3bd05), + TOBN(0x1280dbb2, 0x428decbb), TOBN(0x6103f6bb, 0x402c8596)}, + {TOBN(0xfa2bf581, 0x355a5752), TOBN(0x562f96a8, 0x00946674), + TOBN(0x4e4ca16d, 0x6da0223b), TOBN(0xfe47819f, 0x28d3aa25)}}, + {{TOBN(0x9eea3075, 0xf8dfcf8a), TOBN(0xa284f0aa, 0x95669825), + TOBN(0xb3fca250, 0x867d3fd8), TOBN(0x20757b5f, 0x269d691e)}, + {TOBN(0xf2c24020, 0x93b8a5de), TOBN(0xd3f93359, 0xebc06da6), + TOBN(0x1178293e, 0xb2739c33), TOBN(0xd2a3e770, 0xbcd686e5)}}, + {{TOBN(0xa76f49f4, 0xcd941534), TOBN(0x0d37406b, 0xe3c71c0e), + TOBN(0x172d9397, 0x3b97f7e3), TOBN(0xec17e239, 0xbd7fd0de)}, + {TOBN(0xe3290551, 0x6f496ba2), TOBN(0x6a693172, 0x36ad50e7), + TOBN(0xc4e539a2, 0x83e7eff5), TOBN(0x752737e7, 0x18e1b4cf)}}, + {{TOBN(0xa2f7932c, 0x68af43ee), TOBN(0x5502468e, 0x703d00bd), + TOBN(0xe5dc978f, 0x2fb061f5), TOBN(0xc9a1904a, 0x28c815ad)}, + {TOBN(0xd3af538d, 0x470c56a4), TOBN(0x159abc5f, 0x193d8ced), + TOBN(0x2a37245f, 0x20108ef3), TOBN(0xfa17081e, 0x223f7178)}}, + {{TOBN(0x27b0fb2b, 0x10c8c0f5), TOBN(0x2102c3ea, 0x40650547), + TOBN(0x594564df, 0x8ac3bfa7), TOBN(0x98102033, 0x509dad96)}, + {TOBN(0x6989643f, 0xf1d18a13), TOBN(0x35eebd91, 0xd7fc5af0), + TOBN(0x078d096a, 0xfaeaafd8), TOBN(0xb7a89341, 0xdef3de98)}}, + {{TOBN(0x2a206e8d, 0xecf2a73a), TOBN(0x066a6397, 0x8e551994), + TOBN(0x3a6a088a, 0xb98d53a2), TOBN(0x0ce7c67c, 0x2d1124aa)}, + {TOBN(0x48cec671, 0x759a113c), TOBN(0xe3b373d3, 0x4f6f67fa), + TOBN(0x5455d479, 0xfd36727b), TOBN(0xe5a428ee, 0xa13c0d81)}}, + {{TOBN(0xb853dbc8, 0x1c86682b), TOBN(0xb78d2727, 0xb8d02b2a), + TOBN(0xaaf69bed, 0x8ebc329a), TOBN(0xdb6b40b3, 0x293b2148)}, + {TOBN(0xe42ea77d, 0xb8c4961f), TOBN(0xb1a12f7c, 0x20e5e0ab), + TOBN(0xa0ec5274, 0x79e8b05e), TOBN(0x68027391, 0xfab60a80)}}, + {{TOBN(0x6bfeea5f, 0x16b1bd5e), TOBN(0xf957e420, 0x4de30ad3), + TOBN(0xcbaf664e, 0x6a353b9e), TOBN(0x5c873312, 0x26d14feb)}, + {TOBN(0x4e87f98c, 0xb65f57cb), TOBN(0xdb60a621, 0x5e0cdd41), + TOBN(0x67c16865, 0xa6881440), TOBN(0x1093ef1a, 0x46ab52aa)}}, + {{TOBN(0xc095afb5, 0x3f4ece64), TOBN(0x6a6bb02e, 0x7604551a), + TOBN(0x55d44b4e, 0x0b26b8cd), TOBN(0xe5f9a999, 0xf971268a)}, + {TOBN(0xc08ec425, 0x11a7de84), TOBN(0x83568095, 0xfda469dd), + TOBN(0x737bfba1, 0x6c6c90a2), TOBN(0x1cb9c4a0, 0xbe229831)}}, + {{TOBN(0x93bccbba, 0xbb2eec64), TOBN(0xa0c23b64, 0xda03adbe), + TOBN(0x5f7aa00a, 0xe0e86ac4), TOBN(0x470b941e, 0xfc1401e6)}, + {TOBN(0x5ad8d679, 0x9df43574), TOBN(0x4ccfb8a9, 0x0f65d810), + TOBN(0x1bce80e3, 0xaa7fbd81), TOBN(0x273291ad, 0x9508d20a)}}, + {{TOBN(0xf5c4b46b, 0x42a92806), TOBN(0x810684ec, 0xa86ab44a), + TOBN(0x4591640b, 0xca0bc9f8), TOBN(0xb5efcdfc, 0x5c4b6054)}, + {TOBN(0x16fc8907, 0x6e9edd12), TOBN(0xe29d0b50, 0xd4d792f9), + TOBN(0xa45fd01c, 0x9b03116d), TOBN(0x85035235, 0xc81765a4)}}, + {{TOBN(0x1fe2a9b2, 0xb4b4b67c), TOBN(0xc1d10df0, 0xe8020604), + TOBN(0x9d64abfc, 0xbc8058d8), TOBN(0x8943b9b2, 0x712a0fbb)}, + {TOBN(0x90eed914, 0x3b3def04), TOBN(0x85ab3aa2, 0x4ce775ff), + TOBN(0x605fd4ca, 0x7bbc9040), TOBN(0x8b34a564, 0xe2c75dfb)}}, + {{TOBN(0x41ffc94a, 0x10358560), TOBN(0x2d8a5072, 0x9e5c28aa), + TOBN(0xe915a0fc, 0x4cc7eb15), TOBN(0xe9efab05, 0x8f6d0f5d)}, + {TOBN(0xdbab47a9, 0xd19e9b91), TOBN(0x8cfed745, 0x0276154c), + TOBN(0x154357ae, 0x2cfede0d), TOBN(0x520630df, 0x19f5a4ef)}}, + {{TOBN(0x25759f7c, 0xe382360f), TOBN(0xb6db05c9, 0x88bf5857), + TOBN(0x2917d61d, 0x6c58d46c), TOBN(0x14f8e491, 0xfd20cb7a)}, + {TOBN(0xb68a727a, 0x11c20340), TOBN(0x0386f86f, 0xaf7ccbb6), + TOBN(0x5c8bc6cc, 0xfee09a20), TOBN(0x7d76ff4a, 0xbb7eea35)}}, + {{TOBN(0xa7bdebe7, 0xdb15be7a), TOBN(0x67a08054, 0xd89f0302), + TOBN(0x56bf0ea9, 0xc1193364), TOBN(0xc8244467, 0x62837ebe)}, + {TOBN(0x32bd8e8b, 0x20d841b8), TOBN(0x127a0548, 0xdbb8a54f), + TOBN(0x83dd4ca6, 0x63b20236), TOBN(0x87714718, 0x203491fa)}}, + {{TOBN(0x4dabcaaa, 0xaa8a5288), TOBN(0x91cc0c8a, 0xaf23a1c9), + TOBN(0x34c72c6a, 0x3f220e0c), TOBN(0xbcc20bdf, 0x1232144a)}, + {TOBN(0x6e2f42da, 0xa20ede1b), TOBN(0xc441f00c, 0x74a00515), + TOBN(0xbf46a5b6, 0x734b8c4b), TOBN(0x57409503, 0x7b56c9a4)}}, + {{TOBN(0x9f735261, 0xe4585d45), TOBN(0x9231faed, 0x6734e642), + TOBN(0x1158a176, 0xbe70ee6c), TOBN(0x35f1068d, 0x7c3501bf)}, + {TOBN(0x6beef900, 0xa2d26115), TOBN(0x649406f2, 0xef0afee3), + TOBN(0x3f43a60a, 0xbc2420a1), TOBN(0x509002a7, 0xd5aee4ac)}}, + {{TOBN(0xb46836a5, 0x3ff3571b), TOBN(0x24f98b78, 0x837927c1), + TOBN(0x6254256a, 0x4533c716), TOBN(0xf27abb0b, 0xd07ee196)}, + {TOBN(0xd7cf64fc, 0x5c6d5bfd), TOBN(0x6915c751, 0xf0cd7a77), + TOBN(0xd9f59012, 0x8798f534), TOBN(0x772b0da8, 0xf81d8b5f)}}, + {{TOBN(0x1244260c, 0x2e03fa69), TOBN(0x36cf0e3a, 0x3be1a374), + TOBN(0x6e7c1633, 0xef06b960), TOBN(0xa71a4c55, 0x671f90f6)}, + {TOBN(0x7a941251, 0x33c673db), TOBN(0xc0bea510, 0x73e8c131), + TOBN(0x61a8a699, 0xd4f6c734), TOBN(0x25e78c88, 0x341ed001)}}, + {{TOBN(0x5c18acf8, 0x8e2f7d90), TOBN(0xfdbf33d7, 0x77be32cd), + TOBN(0x0a085cd7, 0xd2eb5ee9), TOBN(0x2d702cfb, 0xb3201115)}, + {TOBN(0xb6e0ebdb, 0x85c88ce8), TOBN(0x23a3ce3c, 0x1e01d617), + TOBN(0x3041618e, 0x567333ac), TOBN(0x9dd0fd8f, 0x157edb6b)}}, + {{TOBN(0x27f74702, 0xb57872b8), TOBN(0x2ef26b4f, 0x657d5fe1), + TOBN(0x95426f0a, 0x57cf3d40), TOBN(0x847e2ad1, 0x65a6067a)}, + {TOBN(0xd474d9a0, 0x09996a74), TOBN(0x16a56acd, 0x2a26115c), + TOBN(0x02a615c3, 0xd16f4d43), TOBN(0xcc3fc965, 0xaadb85b7)}}, + {{TOBN(0x386bda73, 0xce07d1b0), TOBN(0xd82910c2, 0x58ad4178), + TOBN(0x124f82cf, 0xcd2617f4), TOBN(0xcc2f5e8d, 0xef691770)}, + {TOBN(0x82702550, 0xb8c30ccc), TOBN(0x7b856aea, 0x1a8e575a), + TOBN(0xbb822fef, 0xb1ab9459), TOBN(0x085928bc, 0xec24e38e)}}, + {{TOBN(0x5d0402ec, 0xba8f4b4d), TOBN(0xc07cd4ba, 0x00b4d58b), + TOBN(0x5d8dffd5, 0x29227e7a), TOBN(0x61d44d0c, 0x31bf386f)}, + {TOBN(0xe486dc2b, 0x135e6f4d), TOBN(0x680962eb, 0xe79410ef), + TOBN(0xa61bd343, 0xf10088b5), TOBN(0x6aa76076, 0xe2e28686)}}, + {{TOBN(0x80463d11, 0x8fb98871), TOBN(0xcb26f5c3, 0xbbc76aff), + TOBN(0xd4ab8edd, 0xfbe03614), TOBN(0xc8eb579b, 0xc0cf2dee)}, + {TOBN(0xcc004c15, 0xc93bae41), TOBN(0x46fbae5d, 0x3aeca3b2), + TOBN(0x671235cf, 0x0f1e9ab1), TOBN(0xadfba934, 0x9ec285c1)}}, + {{TOBN(0x88ded013, 0xf216c980), TOBN(0xc8ac4fb8, 0xf79e0bc1), + TOBN(0xa29b89c6, 0xfb97a237), TOBN(0xb697b780, 0x9922d8e7)}, + {TOBN(0x3142c639, 0xddb945b5), TOBN(0x447b06c7, 0xe094c3a9), + TOBN(0xcdcb3642, 0x72266c90), TOBN(0x633aad08, 0xa9385046)}}, + {{TOBN(0xa36c936b, 0xb57c6477), TOBN(0x871f8b64, 0xe94dbcc6), + TOBN(0x28d0fb62, 0xa591a67b), TOBN(0x9d40e081, 0xc1d926f5)}, + {TOBN(0x3111eaf6, 0xf2d84b5a), TOBN(0x228993f9, 0xa565b644), + TOBN(0x0ccbf592, 0x2c83188b), TOBN(0xf87b30ab, 0x3df3e197)}}, + {{TOBN(0xb8658b31, 0x7642bca8), TOBN(0x1a032d7f, 0x52800f17), + TOBN(0x051dcae5, 0x79bf9445), TOBN(0xeba6b8ee, 0x54a2e253)}, + {TOBN(0x5c8b9cad, 0xd4485692), TOBN(0x84bda40e, 0x8986e9be), + TOBN(0xd16d16a4, 0x2f0db448), TOBN(0x8ec80050, 0xa14d4188)}}, + {{TOBN(0xb2b26107, 0x98fa7aaa), TOBN(0x41209ee4, 0xf073aa4e), + TOBN(0xf1570359, 0xf2d6b19b), TOBN(0xcbe6868c, 0xfc577caf)}, + {TOBN(0x186c4bdc, 0x32c04dd3), TOBN(0xa6c35fae, 0xcfeee397), + TOBN(0xb4a1b312, 0xf086c0cf), TOBN(0xe0a5ccc6, 0xd9461fe2)}}, + {{TOBN(0xc32278aa, 0x1536189f), TOBN(0x1126c55f, 0xba6df571), + TOBN(0x0f71a602, 0xb194560e), TOBN(0x8b2d7405, 0x324bd6e1)}, + {TOBN(0x8481939e, 0x3738be71), TOBN(0xb5090b1a, 0x1a4d97a9), + TOBN(0x116c65a3, 0xf05ba915), TOBN(0x21863ad3, 0xaae448aa)}}, + {{TOBN(0xd24e2679, 0xa7aae5d3), TOBN(0x7076013d, 0x0de5c1c4), + TOBN(0x2d50f8ba, 0xbb05b629), TOBN(0x73c1abe2, 0x6e66efbb)}, + {TOBN(0xefd4b422, 0xf2488af7), TOBN(0xe4105d02, 0x663ba575), + TOBN(0x7eb60a8b, 0x53a69457), TOBN(0x62210008, 0xc945973b)}}, + {{TOBN(0xfb255478, 0x77a50ec6), TOBN(0xbf0392f7, 0x0a37a72c), + TOBN(0xa0a7a19c, 0x4be18e7a), TOBN(0x90d8ea16, 0x25b1e0af)}, + {TOBN(0x7582a293, 0xef953f57), TOBN(0x90a64d05, 0xbdc5465a), + TOBN(0xca79c497, 0xe2510717), TOBN(0x560dbb7c, 0x18cb641f)}}, + {{TOBN(0x1d8e3286, 0x4b66abfb), TOBN(0xd26f52e5, 0x59030900), + TOBN(0x1ee3f643, 0x5584941a), TOBN(0x6d3b3730, 0x569f5958)}, + {TOBN(0x9ff2a62f, 0x4789dba5), TOBN(0x91fcb815, 0x72b5c9b7), + TOBN(0xf446cb7d, 0x6c8f9a0e), TOBN(0x48f625c1, 0x39b7ecb5)}}, + {{TOBN(0xbabae801, 0x1c6219b8), TOBN(0xe7a562d9, 0x28ac2f23), + TOBN(0xe1b48732, 0x26e20588), TOBN(0x06ee1cad, 0x775af051)}, + {TOBN(0xda29ae43, 0xfaff79f7), TOBN(0xc141a412, 0x652ee9e0), + TOBN(0x1e127f6f, 0x195f4bd0), TOBN(0x29c6ab4f, 0x072f34f8)}}, + {{TOBN(0x7b7c1477, 0x30448112), TOBN(0x82b51af1, 0xe4a38656), + TOBN(0x2bf2028a, 0x2f315010), TOBN(0xc9a4a01f, 0x6ea88cd4)}, + {TOBN(0xf63e95d8, 0x257e5818), TOBN(0xdd8efa10, 0xb4519b16), + TOBN(0xed8973e0, 0x0da910bf), TOBN(0xed49d077, 0x5c0fe4a9)}}, + {{TOBN(0xac3aac5e, 0xb7caee1e), TOBN(0x1033898d, 0xa7f4da57), + TOBN(0x42145c0e, 0x5c6669b9), TOBN(0x42daa688, 0xc1aa2aa0)}, + {TOBN(0x629cc15c, 0x1a1d885a), TOBN(0x25572ec0, 0xf4b76817), + TOBN(0x8312e435, 0x9c8f8f28), TOBN(0x8107f8cd, 0x81965490)}}, + {{TOBN(0x516ff3a3, 0x6fa6110c), TOBN(0x74fb1eb1, 0xfb93561f), + TOBN(0x6c0c9047, 0x8457522b), TOBN(0xcfd32104, 0x6bb8bdc6)}, + {TOBN(0x2d6884a2, 0xcc80ad57), TOBN(0x7c27fc35, 0x86a9b637), + TOBN(0x3461baed, 0xadf4e8cd), TOBN(0x1d56251a, 0x617242f0)}}, + {{TOBN(0x0b80d209, 0xc955bef4), TOBN(0xdf02cad2, 0x06adb047), + TOBN(0xf0d7cb91, 0x5ec74fee), TOBN(0xd2503375, 0x1111ba44)}, + {TOBN(0x9671755e, 0xdf53cb36), TOBN(0x54dcb612, 0x3368551b), + TOBN(0x66d69aac, 0xc8a025a4), TOBN(0x6be946c6, 0xe77ef445)}}, + {{TOBN(0x719946d1, 0xa995e094), TOBN(0x65e848f6, 0xe51e04d8), + TOBN(0xe62f3300, 0x6a1e3113), TOBN(0x1541c7c1, 0x501de503)}, + {TOBN(0x4daac9fa, 0xf4acfade), TOBN(0x0e585897, 0x44cd0b71), + TOBN(0x544fd869, 0x0a51cd77), TOBN(0x60fc20ed, 0x0031016d)}}, + {{TOBN(0x58b404ec, 0xa4276867), TOBN(0x46f6c3cc, 0x34f34993), + TOBN(0x477ca007, 0xc636e5bd), TOBN(0x8018f5e5, 0x7c458b47)}, + {TOBN(0xa1202270, 0xe47b668f), TOBN(0xcef48ccd, 0xee14f203), + TOBN(0x23f98bae, 0x62ff9b4d), TOBN(0x55acc035, 0xc589eddd)}}, + {{TOBN(0x3fe712af, 0x64db4444), TOBN(0x19e9d634, 0xbecdd480), + TOBN(0xe08bc047, 0xa930978a), TOBN(0x2dbf24ec, 0xa1280733)}, + {TOBN(0x3c0ae38c, 0x2cd706b2), TOBN(0x5b012a5b, 0x359017b9), + TOBN(0x3943c38c, 0x72e0f5ae), TOBN(0x786167ea, 0x57176fa3)}}, + {{TOBN(0xe5f9897d, 0x594881dc), TOBN(0x6b5efad8, 0xcfb820c1), + TOBN(0xb2179093, 0xd55018de), TOBN(0x39ad7d32, 0x0bac56ce)}, + {TOBN(0xb55122e0, 0x2cfc0e81), TOBN(0x117c4661, 0xf6d89daa), + TOBN(0x362d01e1, 0xcb64fa09), TOBN(0x6a309b4e, 0x3e9c4ddd)}}, + {{TOBN(0xfa979fb7, 0xabea49b1), TOBN(0xb4b1d27d, 0x10e2c6c5), + TOBN(0xbd61c2c4, 0x23afde7a), TOBN(0xeb6614f8, 0x9786d358)}, + {TOBN(0x4a5d816b, 0x7f6f7459), TOBN(0xe431a44f, 0x09360e7b), + TOBN(0x8c27a032, 0xc309914c), TOBN(0xcea5d68a, 0xcaede3d8)}}, + {{TOBN(0x3668f665, 0x3a0a3f95), TOBN(0x89369416, 0x7ceba27b), + TOBN(0x89981fad, 0xe4728fe9), TOBN(0x7102c8a0, 0x8a093562)}, + {TOBN(0xbb80310e, 0x235d21c8), TOBN(0x505e55d1, 0xbefb7f7b), + TOBN(0xa0a90811, 0x12958a67), TOBN(0xd67e106a, 0x4d851fef)}}, + {{TOBN(0xb84011a9, 0x431dd80e), TOBN(0xeb7c7cca, 0x73306cd9), + TOBN(0x20fadd29, 0xd1b3b730), TOBN(0x83858b5b, 0xfe37b3d3)}, + {TOBN(0xbf4cd193, 0xb6251d5c), TOBN(0x1cca1fd3, 0x1352d952), + TOBN(0xc66157a4, 0x90fbc051), TOBN(0x7990a638, 0x89b98636)}}}, + {{{TOBN(0xe5aa692a, 0x87dec0e1), TOBN(0x010ded8d, 0xf7b39d00), + TOBN(0x7b1b80c8, 0x54cfa0b5), TOBN(0x66beb876, 0xa0f8ea28)}, + {TOBN(0x50d7f531, 0x3476cd0e), TOBN(0xa63d0e65, 0xb08d3949), + TOBN(0x1a09eea9, 0x53479fc6), TOBN(0x82ae9891, 0xf499e742)}}, + {{TOBN(0xab58b910, 0x5ca7d866), TOBN(0x582967e2, 0x3adb3b34), + TOBN(0x89ae4447, 0xcceac0bc), TOBN(0x919c667c, 0x7bf56af5)}, + {TOBN(0x9aec17b1, 0x60f5dcd7), TOBN(0xec697b9f, 0xddcaadbc), + TOBN(0x0b98f341, 0x463467f5), TOBN(0xb187f1f7, 0xa967132f)}}, + {{TOBN(0x90fe7a1d, 0x214aeb18), TOBN(0x1506af3c, 0x741432f7), + TOBN(0xbb5565f9, 0xe591a0c4), TOBN(0x10d41a77, 0xb44f1bc3)}, + {TOBN(0xa09d65e4, 0xa84bde96), TOBN(0x42f060d8, 0xf20a6a1c), + TOBN(0x652a3bfd, 0xf27f9ce7), TOBN(0xb6bdb65c, 0x3b3d739f)}}, + {{TOBN(0xeb5ddcb6, 0xec7fae9f), TOBN(0x995f2714, 0xefb66e5a), + TOBN(0xdee95d8e, 0x69445d52), TOBN(0x1b6c2d46, 0x09e27620)}, + {TOBN(0x32621c31, 0x8129d716), TOBN(0xb03909f1, 0x0958c1aa), + TOBN(0x8c468ef9, 0x1af4af63), TOBN(0x162c429f, 0xfba5cdf6)}}, + {{TOBN(0x2f682343, 0x753b9371), TOBN(0x29cab45a, 0x5f1f9cd7), + TOBN(0x571623ab, 0xb245db96), TOBN(0xc507db09, 0x3fd79999)}, + {TOBN(0x4e2ef652, 0xaf036c32), TOBN(0x86f0cc78, 0x05018e5c), + TOBN(0xc10a73d4, 0xab8be350), TOBN(0x6519b397, 0x7e826327)}}, + {{TOBN(0xe8cb5eef, 0x9c053df7), TOBN(0x8de25b37, 0xb300ea6f), + TOBN(0xdb03fa92, 0xc849cffb), TOBN(0x242e43a7, 0xe84169bb)}, + {TOBN(0xe4fa51f4, 0xdd6f958e), TOBN(0x6925a77f, 0xf4445a8d), + TOBN(0xe6e72a50, 0xe90d8949), TOBN(0xc66648e3, 0x2b1f6390)}}, + {{TOBN(0xb2ab1957, 0x173e460c), TOBN(0x1bbbce75, 0x30704590), + TOBN(0xc0a90dbd, 0xdb1c7162), TOBN(0x505e399e, 0x15cdd65d)}, + {TOBN(0x68434dcb, 0x57797ab7), TOBN(0x60ad35ba, 0x6a2ca8e8), + TOBN(0x4bfdb1e0, 0xde3336c1), TOBN(0xbbef99eb, 0xd8b39015)}}, + {{TOBN(0x6c3b96f3, 0x1711ebec), TOBN(0x2da40f1f, 0xce98fdc4), + TOBN(0xb99774d3, 0x57b4411f), TOBN(0x87c8bdf4, 0x15b65bb6)}, + {TOBN(0xda3a89e3, 0xc2eef12d), TOBN(0xde95bb9b, 0x3c7471f3), + TOBN(0x600f225b, 0xd812c594), TOBN(0x54907c5d, 0x2b75a56b)}}, + {{TOBN(0xa93cc5f0, 0x8db60e35), TOBN(0x743e3cd6, 0xfa833319), + TOBN(0x7dad5c41, 0xf81683c9), TOBN(0x70c1e7d9, 0x9c34107e)}, + {TOBN(0x0edc4a39, 0xa6be0907), TOBN(0x36d47035, 0x86d0b7d3), + TOBN(0x8c76da03, 0x272bfa60), TOBN(0x0b4a07ea, 0x0f08a414)}}, + {{TOBN(0x699e4d29, 0x45c1dd53), TOBN(0xcadc5898, 0x231debb5), + TOBN(0xdf49fcc7, 0xa77f00e0), TOBN(0x93057bbf, 0xa73e5a0e)}, + {TOBN(0x2f8b7ecd, 0x027a4cd1), TOBN(0x114734b3, 0xc614011a), + TOBN(0xe7a01db7, 0x67677c68), TOBN(0x89d9be5e, 0x7e273f4f)}}, + {{TOBN(0xd225cb2e, 0x089808ef), TOBN(0xf1f7a27d, 0xd59e4107), + TOBN(0x53afc761, 0x8211b9c9), TOBN(0x0361bc67, 0xe6819159)}, + {TOBN(0x2a865d0b, 0x7f071426), TOBN(0x6a3c1810, 0xe7072567), + TOBN(0x3e3bca1e, 0x0d6bcabd), TOBN(0xa1b02bc1, 0x408591bc)}}, + {{TOBN(0xe0deee59, 0x31fba239), TOBN(0xf47424d3, 0x98bd91d1), + TOBN(0x0f8886f4, 0x071a3c1d), TOBN(0x3f7d41e8, 0xa819233b)}, + {TOBN(0x708623c2, 0xcf6eb998), TOBN(0x86bb49af, 0x609a287f), + TOBN(0x942bb249, 0x63c90762), TOBN(0x0ef6eea5, 0x55a9654b)}}, + {{TOBN(0x5f6d2d72, 0x36f5defe), TOBN(0xfa9922dc, 0x56f99176), + TOBN(0x6c8c5ece, 0xf78ce0c7), TOBN(0x7b44589d, 0xbe09b55e)}, + {TOBN(0xe11b3bca, 0x9ea83770), TOBN(0xd7fa2c7f, 0x2ab71547), + TOBN(0x2a3dd6fa, 0x2a1ddcc0), TOBN(0x09acb430, 0x5a7b7707)}}, + {{TOBN(0x4add4a2e, 0x649d4e57), TOBN(0xcd53a2b0, 0x1917526e), + TOBN(0xc5262330, 0x20b44ac4), TOBN(0x4028746a, 0xbaa2c31d)}, + {TOBN(0x51318390, 0x64291d4c), TOBN(0xbf48f151, 0xee5ad909), + TOBN(0xcce57f59, 0x7b185681), TOBN(0x7c3ac1b0, 0x4854d442)}}, + {{TOBN(0x65587dc3, 0xc093c171), TOBN(0xae7acb24, 0x24f42b65), + TOBN(0x5a338adb, 0x955996cb), TOBN(0xc8e65675, 0x6051f91b)}, + {TOBN(0x66711fba, 0x28b8d0b1), TOBN(0x15d74137, 0xb6c10a90), + TOBN(0x70cdd7eb, 0x3a232a80), TOBN(0xc9e2f07f, 0x6191ed24)}}, + {{TOBN(0xa80d1db6, 0xf79588c0), TOBN(0xfa52fc69, 0xb55768cc), + TOBN(0x0b4df1ae, 0x7f54438a), TOBN(0x0cadd1a7, 0xf9b46a4f)}, + {TOBN(0xb40ea6b3, 0x1803dd6f), TOBN(0x488e4fa5, 0x55eaae35), + TOBN(0x9f047d55, 0x382e4e16), TOBN(0xc9b5b7e0, 0x2f6e0c98)}}, + {{TOBN(0x6b1bd2d3, 0x95762649), TOBN(0xa9604ee7, 0xc7aea3f6), + TOBN(0x3646ff27, 0x6dc6f896), TOBN(0x9bf0e7f5, 0x2860bad1)}, + {TOBN(0x2d92c821, 0x7cb44b92), TOBN(0xa2f5ce63, 0xaea9c182), + TOBN(0xd0a2afb1, 0x9154a5fd), TOBN(0x482e474c, 0x95801da6)}}, + {{TOBN(0xc19972d0, 0xb611c24b), TOBN(0x1d468e65, 0x60a8f351), + TOBN(0xeb758069, 0x7bcf6421), TOBN(0xec9dd0ee, 0x88fbc491)}, + {TOBN(0x5b59d2bf, 0x956c2e32), TOBN(0x73dc6864, 0xdcddf94e), + TOBN(0xfd5e2321, 0xbcee7665), TOBN(0xa7b4f8ef, 0x5e9a06c4)}}, + {{TOBN(0xfba918dd, 0x7280f855), TOBN(0xbbaac260, 0x8baec688), + TOBN(0xa3b3f00f, 0x33400f42), TOBN(0x3d2dba29, 0x66f2e6e4)}, + {TOBN(0xb6f71a94, 0x98509375), TOBN(0x8f33031f, 0xcea423cc), + TOBN(0x009b8dd0, 0x4807e6fb), TOBN(0x5163cfe5, 0x5cdb954c)}}, + {{TOBN(0x03cc8f17, 0xcf41c6e8), TOBN(0xf1f03c2a, 0x037b925c), + TOBN(0xc39c19cc, 0x66d2427c), TOBN(0x823d24ba, 0x7b6c18e4)}, + {TOBN(0x32ef9013, 0x901f0b4f), TOBN(0x684360f1, 0xf8941c2e), + TOBN(0x0ebaff52, 0x2c28092e), TOBN(0x7891e4e3, 0x256c932f)}}, + {{TOBN(0x51264319, 0xac445e3d), TOBN(0x553432e7, 0x8ea74381), + TOBN(0xe6eeaa69, 0x67e9c50a), TOBN(0x27ced284, 0x62e628c7)}, + {TOBN(0x3f96d375, 0x7a4afa57), TOBN(0xde0a14c3, 0xe484c150), + TOBN(0x364a24eb, 0x38bd9923), TOBN(0x1df18da0, 0xe5177422)}}, + {{TOBN(0x174e8f82, 0xd8d38a9b), TOBN(0x2e97c600, 0xe7de1391), + TOBN(0xc5709850, 0xa1c175dd), TOBN(0x969041a0, 0x32ae5035)}, + {TOBN(0xcbfd533b, 0x76a2086b), TOBN(0xd6bba71b, 0xd7c2e8fe), + TOBN(0xb2d58ee6, 0x099dfb67), TOBN(0x3a8b342d, 0x064a85d9)}}, + {{TOBN(0x3bc07649, 0x522f9be3), TOBN(0x690c075b, 0xdf1f49a8), + TOBN(0x80e1aee8, 0x3854ec42), TOBN(0x2a7dbf44, 0x17689dc7)}, + {TOBN(0xc004fc0e, 0x3faf4078), TOBN(0xb2f02e9e, 0xdf11862c), + TOBN(0xf10a5e0f, 0xa0a1b7b3), TOBN(0x30aca623, 0x8936ec80)}}, + {{TOBN(0xf83cbf05, 0x02f40d9a), TOBN(0x4681c468, 0x2c318a4d), + TOBN(0x98575618, 0x0e9c2674), TOBN(0xbe79d046, 0x1847092e)}, + {TOBN(0xaf1e480a, 0x78bd01e0), TOBN(0x6dd359e4, 0x72a51db9), + TOBN(0x62ce3821, 0xe3afbab6), TOBN(0xc5cee5b6, 0x17733199)}}, + {{TOBN(0xe08b30d4, 0x6ffd9fbb), TOBN(0x6e5bc699, 0x36c610b7), + TOBN(0xf343cff2, 0x9ce262cf), TOBN(0xca2e4e35, 0x68b914c1)}, + {TOBN(0x011d64c0, 0x16de36c5), TOBN(0xe0b10fdd, 0x42e2b829), + TOBN(0x78942981, 0x6685aaf8), TOBN(0xe7511708, 0x230ede97)}}, + {{TOBN(0x671ed8fc, 0x3b922bf8), TOBN(0xe4d8c0a0, 0x4c29b133), + TOBN(0x87eb1239, 0x3b6e99c4), TOBN(0xaff3974c, 0x8793beba)}, + {TOBN(0x03749405, 0x2c18df9b), TOBN(0xc5c3a293, 0x91007139), + TOBN(0x6a77234f, 0xe37a0b95), TOBN(0x02c29a21, 0xb661c96b)}}, + {{TOBN(0xc3aaf1d6, 0x141ecf61), TOBN(0x9195509e, 0x3bb22f53), + TOBN(0x29597404, 0x22d51357), TOBN(0x1b083822, 0x537bed60)}, + {TOBN(0xcd7d6e35, 0xe07289f0), TOBN(0x1f94c48c, 0x6dd86eff), + TOBN(0xc8bb1f82, 0xeb0f9cfa), TOBN(0x9ee0b7e6, 0x1b2eb97d)}}, + {{TOBN(0x5a52fe2e, 0x34d74e31), TOBN(0xa352c310, 0x3bf79ab6), + TOBN(0x97ff6c5a, 0xabfeeb8f), TOBN(0xbfbe8fef, 0xf5c97305)}, + {TOBN(0xd6081ce6, 0xa7904608), TOBN(0x1f812f3a, 0xc4fca249), + TOBN(0x9b24bc9a, 0xb9e5e200), TOBN(0x91022c67, 0x38012ee8)}}, + {{TOBN(0xe83d9c5d, 0x30a713a1), TOBN(0x4876e3f0, 0x84ef0f93), + TOBN(0xc9777029, 0xc1fbf928), TOBN(0xef7a6bb3, 0xbce7d2a4)}, + {TOBN(0xb8067228, 0xdfa2a659), TOBN(0xd5cd3398, 0xd877a48f), + TOBN(0xbea4fd8f, 0x025d0f3f), TOBN(0xd67d2e35, 0x2eae7c2b)}}, + {{TOBN(0x184de7d7, 0xcc5f4394), TOBN(0xb5551b5c, 0x4536e142), + TOBN(0x2e89b212, 0xd34aa60a), TOBN(0x14a96fea, 0xf50051d5)}, + {TOBN(0x4e21ef74, 0x0d12bb0b), TOBN(0xc522f020, 0x60b9677e), + TOBN(0x8b12e467, 0x2df7731d), TOBN(0x39f80382, 0x7b326d31)}}, + {{TOBN(0xdfb8630c, 0x39024a94), TOBN(0xaacb96a8, 0x97319452), + TOBN(0xd68a3961, 0xeda3867c), TOBN(0x0c58e2b0, 0x77c4ffca)}, + {TOBN(0x3d545d63, 0x4da919fa), TOBN(0xef79b69a, 0xf15e2289), + TOBN(0x54bc3d3d, 0x808bab10), TOBN(0xc8ab3007, 0x45f82c37)}}, + {{TOBN(0xc12738b6, 0x7c4a658a), TOBN(0xb3c47639, 0x40e72182), + TOBN(0x3b77be46, 0x8798e44f), TOBN(0xdc047df2, 0x17a7f85f)}, + {TOBN(0x2439d4c5, 0x5e59d92d), TOBN(0xcedca475, 0xe8e64d8d), + TOBN(0xa724cd0d, 0x87ca9b16), TOBN(0x35e4fd59, 0xa5540dfe)}}, + {{TOBN(0xf8c1ff18, 0xe4bcf6b1), TOBN(0x856d6285, 0x295018fa), + TOBN(0x433f665c, 0x3263c949), TOBN(0xa6a76dd6, 0xa1f21409)}, + {TOBN(0x17d32334, 0xcc7b4f79), TOBN(0xa1d03122, 0x06720e4a), + TOBN(0xadb6661d, 0x81d9bed5), TOBN(0xf0d6fb02, 0x11db15d1)}}, + {{TOBN(0x7fd11ad5, 0x1fb747d2), TOBN(0xab50f959, 0x3033762b), + TOBN(0x2a7e711b, 0xfbefaf5a), TOBN(0xc7393278, 0x3fef2bbf)}, + {TOBN(0xe29fa244, 0x0df6f9be), TOBN(0x9092757b, 0x71efd215), + TOBN(0xee60e311, 0x4f3d6fd9), TOBN(0x338542d4, 0x0acfb78b)}}, + {{TOBN(0x44a23f08, 0x38961a0f), TOBN(0x1426eade, 0x986987ca), + TOBN(0x36e6ee2e, 0x4a863cc6), TOBN(0x48059420, 0x628b8b79)}, + {TOBN(0x30303ad8, 0x7396e1de), TOBN(0x5c8bdc48, 0x38c5aad1), + TOBN(0x3e40e11f, 0x5c8f5066), TOBN(0xabd6e768, 0x8d246bbd)}}, + {{TOBN(0x68aa40bb, 0x23330a01), TOBN(0xd23f5ee4, 0xc34eafa0), + TOBN(0x3bbee315, 0x5de02c21), TOBN(0x18dd4397, 0xd1d8dd06)}, + {TOBN(0x3ba1939a, 0x122d7b44), TOBN(0xe6d3b40a, 0xa33870d6), + TOBN(0x8e620f70, 0x1c4fe3f8), TOBN(0xf6bba1a5, 0xd3a50cbf)}}, + {{TOBN(0x4a78bde5, 0xcfc0aee0), TOBN(0x847edc46, 0xc08c50bd), + TOBN(0xbaa2439c, 0xad63c9b2), TOBN(0xceb4a728, 0x10fc2acb)}, + {TOBN(0xa419e40e, 0x26da033d), TOBN(0x6cc3889d, 0x03e02683), + TOBN(0x1cd28559, 0xfdccf725), TOBN(0x0fd7e0f1, 0x8d13d208)}}, + {{TOBN(0x01b9733b, 0x1f0df9d4), TOBN(0x8cc2c5f3, 0xa2b5e4f3), + TOBN(0x43053bfa, 0x3a304fd4), TOBN(0x8e87665c, 0x0a9f1aa7)}, + {TOBN(0x087f29ec, 0xd73dc965), TOBN(0x15ace455, 0x3e9023db), + TOBN(0x2370e309, 0x2bce28b4), TOBN(0xf9723442, 0xb6b1e84a)}}, + {{TOBN(0xbeee662e, 0xb72d9f26), TOBN(0xb19396de, 0xf0e47109), + TOBN(0x85b1fa73, 0xe13289d0), TOBN(0x436cf77e, 0x54e58e32)}, + {TOBN(0x0ec833b3, 0xe990ef77), TOBN(0x7373e3ed, 0x1b11fc25), + TOBN(0xbe0eda87, 0x0fc332ce), TOBN(0xced04970, 0x8d7ea856)}}, + {{TOBN(0xf85ff785, 0x7e977ca0), TOBN(0xb66ee8da, 0xdfdd5d2b), + TOBN(0xf5e37950, 0x905af461), TOBN(0x587b9090, 0x966d487c)}, + {TOBN(0x6a198a1b, 0x32ba0127), TOBN(0xa7720e07, 0x141615ac), + TOBN(0xa23f3499, 0x996ef2f2), TOBN(0xef5f64b4, 0x470bcb3d)}}, + {{TOBN(0xa526a962, 0x92b8c559), TOBN(0x0c14aac0, 0x69740a0f), + TOBN(0x0d41a9e3, 0xa6bdc0a5), TOBN(0x97d52106, 0x9c48aef4)}, + {TOBN(0xcf16bd30, 0x3e7c253b), TOBN(0xcc834b1a, 0x47fdedc1), + TOBN(0x7362c6e5, 0x373aab2e), TOBN(0x264ed85e, 0xc5f590ff)}}, + {{TOBN(0x7a46d9c0, 0x66d41870), TOBN(0xa50c20b1, 0x4787ba09), + TOBN(0x185e7e51, 0xe3d44635), TOBN(0xb3b3e080, 0x31e2d8dc)}, + {TOBN(0xbed1e558, 0xa179e9d9), TOBN(0x2daa3f79, 0x74a76781), + TOBN(0x4372baf2, 0x3a40864f), TOBN(0x46900c54, 0x4fe75cb5)}}, + {{TOBN(0xb95f171e, 0xf76765d0), TOBN(0x4ad726d2, 0x95c87502), + TOBN(0x2ec769da, 0x4d7c99bd), TOBN(0x5e2ddd19, 0xc36cdfa8)}, + {TOBN(0xc22117fc, 0xa93e6dea), TOBN(0xe8a2583b, 0x93771123), + TOBN(0xbe2f6089, 0xfa08a3a2), TOBN(0x4809d5ed, 0x8f0e1112)}}, + {{TOBN(0x3b414aa3, 0xda7a095e), TOBN(0x9049acf1, 0x26f5aadd), + TOBN(0x78d46a4d, 0x6be8b84a), TOBN(0xd66b1963, 0xb732b9b3)}, + {TOBN(0x5c2ac2a0, 0xde6e9555), TOBN(0xcf52d098, 0xb5bd8770), + TOBN(0x15a15fa6, 0x0fd28921), TOBN(0x56ccb81e, 0x8b27536d)}}, + {{TOBN(0x0f0d8ab8, 0x9f4ccbb8), TOBN(0xed5f44d2, 0xdb221729), + TOBN(0x43141988, 0x00bed10c), TOBN(0xc94348a4, 0x1d735b8b)}, + {TOBN(0x79f3e9c4, 0x29ef8479), TOBN(0x4c13a4e3, 0x614c693f), + TOBN(0x32c9af56, 0x8e143a14), TOBN(0xbc517799, 0xe29ac5c4)}}, + {{TOBN(0x05e17992, 0x2774856f), TOBN(0x6e52fb05, 0x6c1bf55f), + TOBN(0xaeda4225, 0xe4f19e16), TOBN(0x70f4728a, 0xaf5ccb26)}, + {TOBN(0x5d2118d1, 0xb2947f22), TOBN(0xc827ea16, 0x281d6fb9), + TOBN(0x8412328d, 0x8cf0eabd), TOBN(0x45ee9fb2, 0x03ef9dcf)}}, + {{TOBN(0x8e700421, 0xbb937d63), TOBN(0xdf8ff2d5, 0xcc4b37a6), + TOBN(0xa4c0d5b2, 0x5ced7b68), TOBN(0x6537c1ef, 0xc7308f59)}, + {TOBN(0x25ce6a26, 0x3b37f8e8), TOBN(0x170e9a9b, 0xdeebc6ce), + TOBN(0xdd037952, 0x8728d72c), TOBN(0x445b0e55, 0x850154bc)}}, + {{TOBN(0x4b7d0e06, 0x83a7337b), TOBN(0x1e3416d4, 0xffecf249), + TOBN(0x24840eff, 0x66a2b71f), TOBN(0xd0d9a50a, 0xb37cc26d)}, + {TOBN(0xe2198150, 0x6fe28ef7), TOBN(0x3cc5ef16, 0x23324c7f), + TOBN(0x220f3455, 0x769b5263), TOBN(0xe2ade2f1, 0xa10bf475)}}, + {{TOBN(0x28cd20fa, 0x458d3671), TOBN(0x1549722c, 0x2dc4847b), + TOBN(0x6dd01e55, 0x591941e3), TOBN(0x0e6fbcea, 0x27128ccb)}, + {TOBN(0xae1a1e6b, 0x3bef0262), TOBN(0xfa8c472c, 0x8f54e103), + TOBN(0x7539c0a8, 0x72c052ec), TOBN(0xd7b27369, 0x5a3490e9)}}, + {{TOBN(0x143fe1f1, 0x71684349), TOBN(0x36b4722e, 0x32e19b97), + TOBN(0xdc059227, 0x90980aff), TOBN(0x175c9c88, 0x9e13d674)}, + {TOBN(0xa7de5b22, 0x6e6bfdb1), TOBN(0x5ea5b7b2, 0xbedb4b46), + TOBN(0xd5570191, 0xd34a6e44), TOBN(0xfcf60d2e, 0xa24ff7e6)}}, + {{TOBN(0x614a392d, 0x677819e1), TOBN(0x7be74c7e, 0xaa5a29e8), + TOBN(0xab50fece, 0x63c85f3f), TOBN(0xaca2e2a9, 0x46cab337)}, + {TOBN(0x7f700388, 0x122a6fe3), TOBN(0xdb69f703, 0x882a04a8), + TOBN(0x9a77935d, 0xcf7aed57), TOBN(0xdf16207c, 0x8d91c86f)}}, + {{TOBN(0x2fca49ab, 0x63ed9998), TOBN(0xa3125c44, 0xa77ddf96), + TOBN(0x05dd8a86, 0x24344072), TOBN(0xa023dda2, 0xfec3fb56)}, + {TOBN(0x421b41fc, 0x0c743032), TOBN(0x4f2120c1, 0x5e438639), + TOBN(0xfb7cae51, 0xc83c1b07), TOBN(0xb2370caa, 0xcac2171a)}}, + {{TOBN(0x2eb2d962, 0x6cc820fb), TOBN(0x59feee5c, 0xb85a44bf), + TOBN(0x94620fca, 0x5b6598f0), TOBN(0x6b922cae, 0x7e314051)}, + {TOBN(0xff8745ad, 0x106bed4e), TOBN(0x546e71f5, 0xdfa1e9ab), + TOBN(0x935c1e48, 0x1ec29487), TOBN(0x9509216c, 0x4d936530)}}, + {{TOBN(0xc7ca3067, 0x85c9a2db), TOBN(0xd6ae5152, 0x6be8606f), + TOBN(0x09dbcae6, 0xe14c651d), TOBN(0xc9536e23, 0x9bc32f96)}, + {TOBN(0xa90535a9, 0x34521b03), TOBN(0xf39c526c, 0x878756ff), + TOBN(0x383172ec, 0x8aedf03c), TOBN(0x20a8075e, 0xefe0c034)}}, + {{TOBN(0xf22f9c62, 0x64026422), TOBN(0x8dd10780, 0x24b9d076), + TOBN(0x944c742a, 0x3bef2950), TOBN(0x55b9502e, 0x88a2b00b)}, + {TOBN(0xa59e14b4, 0x86a09817), TOBN(0xa39dd3ac, 0x47bb4071), + TOBN(0x55137f66, 0x3be0592f), TOBN(0x07fcafd4, 0xc9e63f5b)}}, + {{TOBN(0x963652ee, 0x346eb226), TOBN(0x7dfab085, 0xec2facb7), + TOBN(0x273bf2b8, 0x691add26), TOBN(0x30d74540, 0xf2b46c44)}, + {TOBN(0x05e8e73e, 0xf2c2d065), TOBN(0xff9b8a00, 0xd42eeac9), + TOBN(0x2fcbd205, 0x97209d22), TOBN(0xeb740ffa, 0xde14ea2c)}}, + {{TOBN(0xc71ff913, 0xa8aef518), TOBN(0x7bfc74bb, 0xfff4cfa2), + TOBN(0x1716680c, 0xb6b36048), TOBN(0x121b2cce, 0x9ef79af1)}, + {TOBN(0xbff3c836, 0xa01eb3d3), TOBN(0x50eb1c6a, 0x5f79077b), + TOBN(0xa48c32d6, 0xa004bbcf), TOBN(0x47a59316, 0x7d64f61d)}}, + {{TOBN(0x6068147f, 0x93102016), TOBN(0x12c5f654, 0x94d12576), + TOBN(0xefb071a7, 0xc9bc6b91), TOBN(0x7c2da0c5, 0x6e23ea95)}, + {TOBN(0xf4fd45b6, 0xd4a1dd5d), TOBN(0x3e7ad9b6, 0x9122b13c), + TOBN(0x342ca118, 0xe6f57a48), TOBN(0x1c2e94a7, 0x06f8288f)}}, + {{TOBN(0x99e68f07, 0x5a97d231), TOBN(0x7c80de97, 0x4d838758), + TOBN(0xbce0f5d0, 0x05872727), TOBN(0xbe5d95c2, 0x19c4d016)}, + {TOBN(0x921d5cb1, 0x9c2492ee), TOBN(0x42192dc1, 0x404d6fb3), + TOBN(0x4c84dcd1, 0x32f988d3), TOBN(0xde26d61f, 0xa17b8e85)}}, + {{TOBN(0xc466dcb6, 0x137c7408), TOBN(0x9a38d7b6, 0x36a266da), + TOBN(0x7ef5cb06, 0x83bebf1b), TOBN(0xe5cdcbbf, 0x0fd014e3)}, + {TOBN(0x30aa376d, 0xf65965a0), TOBN(0x60fe88c2, 0xebb3e95e), + TOBN(0x33fd0b61, 0x66ee6f20), TOBN(0x8827dcdb, 0x3f41f0a0)}}, + {{TOBN(0xbf8a9d24, 0x0c56c690), TOBN(0x40265dad, 0xddb7641d), + TOBN(0x522b05bf, 0x3a6b662b), TOBN(0x466d1dfe, 0xb1478c9b)}, + {TOBN(0xaa616962, 0x1484469b), TOBN(0x0db60549, 0x02df8f9f), + TOBN(0xc37bca02, 0x3cb8bf51), TOBN(0x5effe346, 0x21371ce8)}}, + {{TOBN(0xe8f65264, 0xff112c32), TOBN(0x8a9c736d, 0x7b971fb2), + TOBN(0xa4f19470, 0x7b75080d), TOBN(0xfc3f2c5a, 0x8839c59b)}, + {TOBN(0x1d6c777e, 0x5aeb49c2), TOBN(0xf3db034d, 0xda1addfe), + TOBN(0xd76fee5a, 0x5535affc), TOBN(0x0853ac70, 0xb92251fd)}}, + {{TOBN(0x37e3d594, 0x8b2a29d5), TOBN(0x28f1f457, 0x4de00ddb), + TOBN(0x8083c1b5, 0xf42c328b), TOBN(0xd8ef1d8f, 0xe493c73b)}, + {TOBN(0x96fb6260, 0x41dc61bd), TOBN(0xf74e8a9d, 0x27ee2f8a), + TOBN(0x7c605a80, 0x2c946a5d), TOBN(0xeed48d65, 0x3839ccfd)}}, + {{TOBN(0x9894344f, 0x3a29467a), TOBN(0xde81e949, 0xc51eba6d), + TOBN(0xdaea066b, 0xa5e5c2f2), TOBN(0x3fc8a614, 0x08c8c7b3)}, + {TOBN(0x7adff88f, 0x06d0de9f), TOBN(0xbbc11cf5, 0x3b75ce0a), + TOBN(0x9fbb7acc, 0xfbbc87d5), TOBN(0xa1458e26, 0x7badfde2)}}}, + {{{TOBN(0x1cb43668, 0xe039c256), TOBN(0x5f26fb8b, 0x7c17fd5d), + TOBN(0xeee426af, 0x79aa062b), TOBN(0x072002d0, 0xd78fbf04)}, + {TOBN(0x4c9ca237, 0xe84fb7e3), TOBN(0xb401d8a1, 0x0c82133d), + TOBN(0xaaa52592, 0x6d7e4181), TOBN(0xe9430833, 0x73dbb152)}}, + {{TOBN(0xf92dda31, 0xbe24319a), TOBN(0x03f7d28b, 0xe095a8e7), + TOBN(0xa52fe840, 0x98782185), TOBN(0x276ddafe, 0x29c24dbc)}, + {TOBN(0x80cd5496, 0x1d7a64eb), TOBN(0xe4360889, 0x7f1dbe42), + TOBN(0x2f81a877, 0x8438d2d5), TOBN(0x7e4d52a8, 0x85169036)}}, + {{TOBN(0x19e3d5b1, 0x1d59715d), TOBN(0xc7eaa762, 0xd788983e), + TOBN(0xe5a730b0, 0xabf1f248), TOBN(0xfbab8084, 0xfae3fd83)}, + {TOBN(0x65e50d21, 0x53765b2f), TOBN(0xbdd4e083, 0xfa127f3d), + TOBN(0x9cf3c074, 0x397b1b10), TOBN(0x59f8090c, 0xb1b59fd3)}}, + {{TOBN(0x7b15fd9d, 0x615faa8f), TOBN(0x8fa1eb40, 0x968554ed), + TOBN(0x7bb4447e, 0x7aa44882), TOBN(0x2bb2d0d1, 0x029fff32)}, + {TOBN(0x075e2a64, 0x6caa6d2f), TOBN(0x8eb879de, 0x22e7351b), + TOBN(0xbcd5624e, 0x9a506c62), TOBN(0x218eaef0, 0xa87e24dc)}}, + {{TOBN(0x37e56847, 0x44ddfa35), TOBN(0x9ccfc5c5, 0xdab3f747), + TOBN(0x9ac1df3f, 0x1ee96cf4), TOBN(0x0c0571a1, 0x3b480b8f)}, + {TOBN(0x2fbeb3d5, 0x4b3a7b3c), TOBN(0x35c03669, 0x5dcdbb99), + TOBN(0x52a0f5dc, 0xb2415b3a), TOBN(0xd57759b4, 0x4413ed9a)}}, + {{TOBN(0x1fe647d8, 0x3d30a2c5), TOBN(0x0857f77e, 0xf78a81dc), + TOBN(0x11d5a334, 0x131a4a9b), TOBN(0xc0a94af9, 0x29d393f5)}, + {TOBN(0xbc3a5c0b, 0xdaa6ec1a), TOBN(0xba9fe493, 0x88d2d7ed), + TOBN(0xbb4335b4, 0xbb614797), TOBN(0x991c4d68, 0x72f83533)}}, + {{TOBN(0x53258c28, 0xd2f01cb3), TOBN(0x93d6eaa3, 0xd75db0b1), + TOBN(0x419a2b0d, 0xe87d0db4), TOBN(0xa1e48f03, 0xd8fe8493)}, + {TOBN(0xf747faf6, 0xc508b23a), TOBN(0xf137571a, 0x35d53549), + TOBN(0x9f5e58e2, 0xfcf9b838), TOBN(0xc7186cee, 0xa7fd3cf5)}}, + {{TOBN(0x77b868ce, 0xe978a1d3), TOBN(0xe3a68b33, 0x7ab92d04), + TOBN(0x51029794, 0x87a5b862), TOBN(0x5f0606c3, 0x3a61d41d)}, + {TOBN(0x2814be27, 0x6f9326f1), TOBN(0x2f521c14, 0xc6fe3c2e), + TOBN(0x17464d7d, 0xacdf7351), TOBN(0x10f5f9d3, 0x777f7e44)}}, + {{TOBN(0xce8e616b, 0x269fb37d), TOBN(0xaaf73804, 0x7de62de5), + TOBN(0xaba11175, 0x4fdd4153), TOBN(0x515759ba, 0x3770b49b)}, + {TOBN(0x8b09ebf8, 0xaa423a61), TOBN(0x592245a1, 0xcd41fb92), + TOBN(0x1cba8ec1, 0x9b4c8936), TOBN(0xa87e91e3, 0xaf36710e)}}, + {{TOBN(0x1fd84ce4, 0x3d34a2e3), TOBN(0xee3759ce, 0xb43b5d61), + TOBN(0x895bc78c, 0x619186c7), TOBN(0xf19c3809, 0xcbb9725a)}, + {TOBN(0xc0be21aa, 0xde744b1f), TOBN(0xa7d222b0, 0x60f8056b), + TOBN(0x74be6157, 0xb23efe11), TOBN(0x6fab2b4f, 0x0cd68253)}}, + {{TOBN(0xad33ea5f, 0x4bf1d725), TOBN(0x9c1d8ee2, 0x4f6c950f), + TOBN(0x544ee78a, 0xa377af06), TOBN(0x54f489bb, 0x94a113e1)}, + {TOBN(0x8f11d634, 0x992fb7e8), TOBN(0x0169a7aa, 0xa2a44347), + TOBN(0x1d49d4af, 0x95020e00), TOBN(0x95945722, 0xe08e120b)}}, + {{TOBN(0xb6e33878, 0xa4d32282), TOBN(0xe36e029d, 0x48020ae7), + TOBN(0xe05847fb, 0x37a9b750), TOBN(0xf876812c, 0xb29e3819)}, + {TOBN(0x84ad138e, 0xd23a17f0), TOBN(0x6d7b4480, 0xf0b3950e), + TOBN(0xdfa8aef4, 0x2fd67ae0), TOBN(0x8d3eea24, 0x52333af6)}}, + {{TOBN(0x0d052075, 0xb15d5acc), TOBN(0xc6d9c79f, 0xbd815bc4), + TOBN(0x8dcafd88, 0xdfa36cf2), TOBN(0x908ccbe2, 0x38aa9070)}, + {TOBN(0x638722c4, 0xba35afce), TOBN(0x5a3da8b0, 0xfd6abf0b), + TOBN(0x2dce252c, 0xc9c335c1), TOBN(0x84e7f0de, 0x65aa799b)}}, + {{TOBN(0x2101a522, 0xb99a72cb), TOBN(0x06de6e67, 0x87618016), + TOBN(0x5ff8c7cd, 0xe6f3653e), TOBN(0x0a821ab5, 0xc7a6754a)}, + {TOBN(0x7e3fa52b, 0x7cb0b5a2), TOBN(0xa7fb121c, 0xc9048790), + TOBN(0x1a725020, 0x06ce053a), TOBN(0xb490a31f, 0x04e929b0)}}, + {{TOBN(0xe17be47d, 0x62dd61ad), TOBN(0x781a961c, 0x6be01371), + TOBN(0x1063bfd3, 0xdae3cbba), TOBN(0x35647406, 0x7f73c9ba)}, + {TOBN(0xf50e957b, 0x2736a129), TOBN(0xa6313702, 0xed13f256), + TOBN(0x9436ee65, 0x3a19fcc5), TOBN(0xcf2bdb29, 0xe7a4c8b6)}}, + {{TOBN(0xb06b1244, 0xc5f95cd8), TOBN(0xda8c8af0, 0xf4ab95f4), + TOBN(0x1bae59c2, 0xb9e5836d), TOBN(0x07d51e7e, 0x3acffffc)}, + {TOBN(0x01e15e6a, 0xc2ccbcda), TOBN(0x3bc1923f, 0x8528c3e0), + TOBN(0x43324577, 0xa49fead4), TOBN(0x61a1b884, 0x2aa7a711)}}, + {{TOBN(0xf9a86e08, 0x700230ef), TOBN(0x0af585a1, 0xbd19adf8), + TOBN(0x7645f361, 0xf55ad8f2), TOBN(0x6e676223, 0x46c3614c)}, + {TOBN(0x23cb257c, 0x4e774d3f), TOBN(0x82a38513, 0xac102d1b), + TOBN(0x9bcddd88, 0x7b126aa5), TOBN(0xe716998b, 0xeefd3ee4)}}, + {{TOBN(0x4239d571, 0xfb167583), TOBN(0xdd011c78, 0xd16c8f8a), + TOBN(0x271c2895, 0x69a27519), TOBN(0x9ce0a3b7, 0xd2d64b6a)}, + {TOBN(0x8c977289, 0xd5ec6738), TOBN(0xa3b49f9a, 0x8840ef6b), + TOBN(0x808c14c9, 0x9a453419), TOBN(0x5c00295b, 0x0cf0a2d5)}}, + {{TOBN(0x524414fb, 0x1d4bcc76), TOBN(0xb07691d2, 0x459a88f1), + TOBN(0x77f43263, 0xf70d110f), TOBN(0x64ada5e0, 0xb7abf9f3)}, + {TOBN(0xafd0f94e, 0x5b544cf5), TOBN(0xb4a13a15, 0xfd2713fe), + TOBN(0xb99b7d6e, 0x250c74f4), TOBN(0x097f2f73, 0x20324e45)}}, + {{TOBN(0x994b37d8, 0xaffa8208), TOBN(0xc3c31b0b, 0xdc29aafc), + TOBN(0x3da74651, 0x7a3a607f), TOBN(0xd8e1b8c1, 0xfe6955d6)}, + {TOBN(0x716e1815, 0xc8418682), TOBN(0x541d487f, 0x7dc91d97), + TOBN(0x48a04669, 0xc6996982), TOBN(0xf39cab15, 0x83a6502e)}}, + {{TOBN(0x025801a0, 0xe68db055), TOBN(0xf3569758, 0xba3338d5), + TOBN(0xb0c8c0aa, 0xee2afa84), TOBN(0x4f6985d3, 0xfb6562d1)}, + {TOBN(0x351f1f15, 0x132ed17a), TOBN(0x510ed0b4, 0xc04365fe), + TOBN(0xa3f98138, 0xe5b1f066), TOBN(0xbc9d95d6, 0x32df03dc)}}, + {{TOBN(0xa83ccf6e, 0x19abd09e), TOBN(0x0b4097c1, 0x4ff17edb), + TOBN(0x58a5c478, 0xd64a06ce), TOBN(0x2ddcc3fd, 0x544a58fd)}, + {TOBN(0xd449503d, 0x9e8153b8), TOBN(0x3324fd02, 0x7774179b), + TOBN(0xaf5d47c8, 0xdbd9120c), TOBN(0xeb860162, 0x34fa94db)}}, + {{TOBN(0x5817bdd1, 0x972f07f4), TOBN(0xe5579e2e, 0xd27bbceb), + TOBN(0x86847a1f, 0x5f11e5a6), TOBN(0xb39ed255, 0x7c3cf048)}, + {TOBN(0xe1076417, 0xa2f62e55), TOBN(0x6b9ab38f, 0x1bcf82a2), + TOBN(0x4bb7c319, 0x7aeb29f9), TOBN(0xf6d17da3, 0x17227a46)}}, + {{TOBN(0xab53ddbd, 0x0f968c00), TOBN(0xa03da7ec, 0x000c880b), + TOBN(0x7b239624, 0x6a9ad24d), TOBN(0x612c0401, 0x01ec60d0)}, + {TOBN(0x70d10493, 0x109f5df1), TOBN(0xfbda4030, 0x80af7550), + TOBN(0x30b93f95, 0xc6b9a9b3), TOBN(0x0c74ec71, 0x007d9418)}}, + {{TOBN(0x94175564, 0x6edb951f), TOBN(0x5f4a9d78, 0x7f22c282), + TOBN(0xb7870895, 0xb38d1196), TOBN(0xbc593df3, 0xa228ce7c)}, + {TOBN(0xc78c5bd4, 0x6af3641a), TOBN(0x7802200b, 0x3d9b3dcc), + TOBN(0x0dc73f32, 0x8be33304), TOBN(0x847ed87d, 0x61ffb79a)}}, + {{TOBN(0xf85c974e, 0x6d671192), TOBN(0x1e14100a, 0xde16f60f), + TOBN(0x45cb0d5a, 0x95c38797), TOBN(0x18923bba, 0x9b022da4)}, + {TOBN(0xef2be899, 0xbbe7e86e), TOBN(0x4a1510ee, 0x216067bf), + TOBN(0xd98c8154, 0x84d5ce3e), TOBN(0x1af777f0, 0xf92a2b90)}}, + {{TOBN(0x9fbcb400, 0x4ef65724), TOBN(0x3e04a4c9, 0x3c0ca6fe), + TOBN(0xfb3e2cb5, 0x55002994), TOBN(0x1f3a93c5, 0x5363ecab)}, + {TOBN(0x1fe00efe, 0x3923555b), TOBN(0x744bedd9, 0x1e1751ea), + TOBN(0x3fb2db59, 0x6ab69357), TOBN(0x8dbd7365, 0xf5e6618b)}}, + {{TOBN(0x99d53099, 0xdf1ea40e), TOBN(0xb3f24a0b, 0x57d61e64), + TOBN(0xd088a198, 0x596eb812), TOBN(0x22c8361b, 0x5762940b)}, + {TOBN(0x66f01f97, 0xf9c0d95c), TOBN(0x88461172, 0x8e43cdae), + TOBN(0x11599a7f, 0xb72b15c3), TOBN(0x135a7536, 0x420d95cc)}}, + {{TOBN(0x2dcdf0f7, 0x5f7ae2f6), TOBN(0x15fc6e1d, 0xd7fa6da2), + TOBN(0x81ca829a, 0xd1d441b6), TOBN(0x84c10cf8, 0x04a106b6)}, + {TOBN(0xa9b26c95, 0xa73fbbd0), TOBN(0x7f24e0cb, 0x4d8f6ee8), + TOBN(0x48b45937, 0x1e25a043), TOBN(0xf8a74fca, 0x036f3dfe)}}, + {{TOBN(0x1ed46585, 0xc9f84296), TOBN(0x7fbaa8fb, 0x3bc278b0), + TOBN(0xa8e96cd4, 0x6c4fcbd0), TOBN(0x940a1202, 0x73b60a5f)}, + {TOBN(0x34aae120, 0x55a4aec8), TOBN(0x550e9a74, 0xdbd742f0), + TOBN(0x794456d7, 0x228c68ab), TOBN(0x492f8868, 0xa4e25ec6)}}, + {{TOBN(0x682915ad, 0xb2d8f398), TOBN(0xf13b51cc, 0x5b84c953), + TOBN(0xcda90ab8, 0x5bb917d6), TOBN(0x4b615560, 0x4ea3dee1)}, + {TOBN(0x578b4e85, 0x0a52c1c8), TOBN(0xeab1a695, 0x20b75fc4), + TOBN(0x60c14f3c, 0xaa0bb3c6), TOBN(0x220f448a, 0xb8216094)}}, + {{TOBN(0x4fe7ee31, 0xb0e63d34), TOBN(0xf4600572, 0xa9e54fab), + TOBN(0xc0493334, 0xd5e7b5a4), TOBN(0x8589fb92, 0x06d54831)}, + {TOBN(0xaa70f5cc, 0x6583553a), TOBN(0x0879094a, 0xe25649e5), + TOBN(0xcc904507, 0x10044652), TOBN(0xebb0696d, 0x02541c4f)}}, + {{TOBN(0x5a171fde, 0xb9718710), TOBN(0x38f1bed8, 0xf374a9f5), + TOBN(0xc8c582e1, 0xba39bdc1), TOBN(0xfc457b0a, 0x908cc0ce)}, + {TOBN(0x9a187fd4, 0x883841e2), TOBN(0x8ec25b39, 0x38725381), + TOBN(0x2553ed05, 0x96f84395), TOBN(0x095c7661, 0x6f6c6897)}}, + {{TOBN(0x917ac85c, 0x4bdc5610), TOBN(0xb2885fe4, 0x179eb301), + TOBN(0x5fc65547, 0x8b78bdcc), TOBN(0x4a9fc893, 0xe59e4699)}, + {TOBN(0xbb7ff0cd, 0x3ce299af), TOBN(0x195be9b3, 0xadf38b20), + TOBN(0x6a929c87, 0xd38ddb8f), TOBN(0x55fcc99c, 0xb21a51b9)}}, + {{TOBN(0x2b695b4c, 0x721a4593), TOBN(0xed1e9a15, 0x768eaac2), + TOBN(0xfb63d71c, 0x7489f914), TOBN(0xf98ba31c, 0x78118910)}, + {TOBN(0x80291373, 0x9b128eb4), TOBN(0x7801214e, 0xd448af4a), + TOBN(0xdbd2e22b, 0x55418dd3), TOBN(0xeffb3c0d, 0xd3998242)}}, + {{TOBN(0xdfa6077c, 0xc7bf3827), TOBN(0xf2165bcb, 0x47f8238f), + TOBN(0xfe37cf68, 0x8564d554), TOBN(0xe5f825c4, 0x0a81fb98)}, + {TOBN(0x43cc4f67, 0xffed4d6f), TOBN(0xbc609578, 0xb50a34b0), + TOBN(0x8aa8fcf9, 0x5041faf1), TOBN(0x5659f053, 0x651773b6)}}, + {{TOBN(0xe87582c3, 0x6044d63b), TOBN(0xa6089409, 0x0cdb0ca0), + TOBN(0x8c993e0f, 0xbfb2bcf6), TOBN(0xfc64a719, 0x45985cfc)}, + {TOBN(0x15c4da80, 0x83dbedba), TOBN(0x804ae112, 0x2be67df7), + TOBN(0xda4c9658, 0xa23defde), TOBN(0x12002ddd, 0x5156e0d3)}}, + {{TOBN(0xe68eae89, 0x5dd21b96), TOBN(0x8b99f28b, 0xcf44624d), + TOBN(0x0ae00808, 0x1ec8897a), TOBN(0xdd0a9303, 0x6712f76e)}, + {TOBN(0x96237522, 0x4e233de4), TOBN(0x192445b1, 0x2b36a8a5), + TOBN(0xabf9ff74, 0x023993d9), TOBN(0x21f37bf4, 0x2aad4a8f)}}, + {{TOBN(0x340a4349, 0xf8bd2bbd), TOBN(0x1d902cd9, 0x4868195d), + TOBN(0x3d27bbf1, 0xe5fdb6f1), TOBN(0x7a5ab088, 0x124f9f1c)}, + {TOBN(0xc466ab06, 0xf7a09e03), TOBN(0x2f8a1977, 0x31f2c123), + TOBN(0xda355dc7, 0x041b6657), TOBN(0xcb840d12, 0x8ece2a7c)}}, + {{TOBN(0xb600ad9f, 0x7db32675), TOBN(0x78fea133, 0x07a06f1b), + TOBN(0x5d032269, 0xb31f6094), TOBN(0x07753ef5, 0x83ec37aa)}, + {TOBN(0x03485aed, 0x9c0bea78), TOBN(0x41bb3989, 0xbc3f4524), + TOBN(0x09403761, 0x697f726d), TOBN(0x6109beb3, 0xdf394820)}}, + {{TOBN(0x804111ea, 0x3b6d1145), TOBN(0xb6271ea9, 0xa8582654), + TOBN(0x619615e6, 0x24e66562), TOBN(0xa2554945, 0xd7b6ad9c)}, + {TOBN(0xd9c4985e, 0x99bfe35f), TOBN(0x9770ccc0, 0x7b51cdf6), + TOBN(0x7c327013, 0x92881832), TOBN(0x8777d45f, 0x286b26d1)}}, + {{TOBN(0x9bbeda22, 0xd847999d), TOBN(0x03aa33b6, 0xc3525d32), + TOBN(0x4b7b96d4, 0x28a959a1), TOBN(0xbb3786e5, 0x31e5d234)}, + {TOBN(0xaeb5d3ce, 0x6961f247), TOBN(0x20aa85af, 0x02f93d3f), + TOBN(0x9cd1ad3d, 0xd7a7ae4f), TOBN(0xbf6688f0, 0x781adaa8)}}, + {{TOBN(0xb1b40e86, 0x7469cead), TOBN(0x1904c524, 0x309fca48), + TOBN(0x9b7312af, 0x4b54bbc7), TOBN(0xbe24bf8f, 0x593affa2)}, + {TOBN(0xbe5e0790, 0xbd98764b), TOBN(0xa0f45f17, 0xa26e299e), + TOBN(0x4af0d2c2, 0x6b8fe4c7), TOBN(0xef170db1, 0x8ae8a3e6)}}, + {{TOBN(0x0e8d61a0, 0x29e0ccc1), TOBN(0xcd53e87e, 0x60ad36ca), + TOBN(0x328c6623, 0xc8173822), TOBN(0x7ee1767d, 0xa496be55)}, + {TOBN(0x89f13259, 0x648945af), TOBN(0x9e45a5fd, 0x25c8009c), + TOBN(0xaf2febd9, 0x1f61ab8c), TOBN(0x43f6bc86, 0x8a275385)}}, + {{TOBN(0x87792348, 0xf2142e79), TOBN(0x17d89259, 0xc6e6238a), + TOBN(0x7536d2f6, 0x4a839d9b), TOBN(0x1f428fce, 0x76a1fbdc)}, + {TOBN(0x1c109601, 0x0db06dfe), TOBN(0xbfc16bc1, 0x50a3a3cc), + TOBN(0xf9cbd9ec, 0x9b30f41b), TOBN(0x5b5da0d6, 0x00138cce)}}, + {{TOBN(0xec1d0a48, 0x56ef96a7), TOBN(0xb47eb848, 0x982bf842), + TOBN(0x66deae32, 0xec3f700d), TOBN(0x4e43c42c, 0xaa1181e0)}, + {TOBN(0xa1d72a31, 0xd1a4aa2a), TOBN(0x440d4668, 0xc004f3ce), + TOBN(0x0d6a2d3b, 0x45fe8a7a), TOBN(0x820e52e2, 0xfb128365)}}, + {{TOBN(0x29ac5fcf, 0x25e51b09), TOBN(0x180cd2bf, 0x2023d159), + TOBN(0xa9892171, 0xa1ebf90e), TOBN(0xf97c4c87, 0x7c132181)}, + {TOBN(0x9f1dc724, 0xc03dbb7e), TOBN(0xae043765, 0x018cbbe4), + TOBN(0xfb0b2a36, 0x0767d153), TOBN(0xa8e2f4d6, 0x249cbaeb)}}, + {{TOBN(0x172a5247, 0xd95ea168), TOBN(0x1758fada, 0x2970764a), + TOBN(0xac803a51, 0x1d978169), TOBN(0x299cfe2e, 0xde77e01b)}, + {TOBN(0x652a1e17, 0xb0a98927), TOBN(0x2e26e1d1, 0x20014495), + TOBN(0x7ae0af9f, 0x7175b56a), TOBN(0xc2e22a80, 0xd64b9f95)}}, + {{TOBN(0x4d0ff9fb, 0xd90a060a), TOBN(0x496a27db, 0xbaf38085), + TOBN(0x32305401, 0xda776bcf), TOBN(0xb8cdcef6, 0x725f209e)}, + {TOBN(0x61ba0f37, 0x436a0bba), TOBN(0x263fa108, 0x76860049), + TOBN(0x92beb98e, 0xda3542cf), TOBN(0xa2d4d14a, 0xd5849538)}}, + {{TOBN(0x989b9d68, 0x12e9a1bc), TOBN(0x61d9075c, 0x5f6e3268), + TOBN(0x352c6aa9, 0x99ace638), TOBN(0xde4e4a55, 0x920f43ff)}, + {TOBN(0xe5e4144a, 0xd673c017), TOBN(0x667417ae, 0x6f6e05ea), + TOBN(0x613416ae, 0xdcd1bd56), TOBN(0x5eb36201, 0x86693711)}}, + {{TOBN(0x2d7bc504, 0x3a1aa914), TOBN(0x175a1299, 0x76dc5975), + TOBN(0xe900e0f2, 0x3fc8125c), TOBN(0x569ef68c, 0x11198875)}, + {TOBN(0x9012db63, 0x63a113b4), TOBN(0xe3bd3f56, 0x98835766), + TOBN(0xa5c94a52, 0x76412dea), TOBN(0xad9e2a09, 0xaa735e5c)}}, + {{TOBN(0x405a984c, 0x508b65e9), TOBN(0xbde4a1d1, 0x6df1a0d1), + TOBN(0x1a9433a1, 0xdfba80da), TOBN(0xe9192ff9, 0x9440ad2e)}, + {TOBN(0x9f649696, 0x5099fe92), TOBN(0x25ddb65c, 0x0b27a54a), + TOBN(0x178279dd, 0xc590da61), TOBN(0x5479a999, 0xfbde681a)}}, + {{TOBN(0xd0e84e05, 0x013fe162), TOBN(0xbe11dc92, 0x632d471b), + TOBN(0xdf0b0c45, 0xfc0e089f), TOBN(0x04fb15b0, 0x4c144025)}, + {TOBN(0xa61d5fc2, 0x13c99927), TOBN(0xa033e9e0, 0x3de2eb35), + TOBN(0xf8185d5c, 0xb8dacbb4), TOBN(0x9a88e265, 0x8644549d)}}, + {{TOBN(0xf717af62, 0x54671ff6), TOBN(0x4bd4241b, 0x5fa58603), + TOBN(0x06fba40b, 0xe67773c0), TOBN(0xc1d933d2, 0x6a2847e9)}, + {TOBN(0xf4f5acf3, 0x689e2c70), TOBN(0x92aab0e7, 0x46bafd31), + TOBN(0x798d76aa, 0x3473f6e5), TOBN(0xcc6641db, 0x93141934)}}, + {{TOBN(0xcae27757, 0xd31e535e), TOBN(0x04cc43b6, 0x87c2ee11), + TOBN(0x8d1f9675, 0x2e029ffa), TOBN(0xc2150672, 0xe4cc7a2c)}, + {TOBN(0x3b03c1e0, 0x8d68b013), TOBN(0xa9d6816f, 0xedf298f3), + TOBN(0x1bfbb529, 0xa2804464), TOBN(0x95a52fae, 0x5db22125)}}, + {{TOBN(0x55b32160, 0x0e1cb64e), TOBN(0x004828f6, 0x7e7fc9fe), + TOBN(0x13394b82, 0x1bb0fb93), TOBN(0xb6293a2d, 0x35f1a920)}, + {TOBN(0xde35ef21, 0xd145d2d9), TOBN(0xbe6225b3, 0xbb8fa603), + TOBN(0x00fc8f6b, 0x32cf252d), TOBN(0xa28e52e6, 0x117cf8c2)}}, + {{TOBN(0x9d1dc89b, 0x4c371e6d), TOBN(0xcebe0675, 0x36ef0f28), + TOBN(0x5de05d09, 0xa4292f81), TOBN(0xa8303593, 0x353e3083)}, + {TOBN(0xa1715b0a, 0x7e37a9bb), TOBN(0x8c56f61e, 0x2b8faec3), + TOBN(0x52507431, 0x33c9b102), TOBN(0x0130cefc, 0xa44431f0)}}, + {{TOBN(0x56039fa0, 0xbd865cfb), TOBN(0x4b03e578, 0xbc5f1dd7), + TOBN(0x40edf2e4, 0xbabe7224), TOBN(0xc752496d, 0x3a1988f6)}, + {TOBN(0xd1572d3b, 0x564beb6b), TOBN(0x0db1d110, 0x39a1c608), + TOBN(0x568d1934, 0x16f60126), TOBN(0x05ae9668, 0xf354af33)}}, + {{TOBN(0x19de6d37, 0xc92544f2), TOBN(0xcc084353, 0xa35837d5), + TOBN(0xcbb6869c, 0x1a514ece), TOBN(0xb633e728, 0x2e1d1066)}, + {TOBN(0xf15dd69f, 0x936c581c), TOBN(0x96e7b8ce, 0x7439c4f9), + TOBN(0x5e676f48, 0x2e448a5b), TOBN(0xb2ca7d5b, 0xfd916bbb)}}, + {{TOBN(0xd55a2541, 0xf5024025), TOBN(0x47bc5769, 0xe4c2d937), + TOBN(0x7d31b92a, 0x0362189f), TOBN(0x83f3086e, 0xef7816f9)}, + {TOBN(0xf9f46d94, 0xb587579a), TOBN(0xec2d22d8, 0x30e76c5f), + TOBN(0x27d57461, 0xb000ffcf), TOBN(0xbb7e65f9, 0x364ffc2c)}}, + {{TOBN(0x7c7c9477, 0x6652a220), TOBN(0x61618f89, 0xd696c981), + TOBN(0x5021701d, 0x89effff3), TOBN(0xf2c8ff8e, 0x7c314163)}, + {TOBN(0x2da413ad, 0x8efb4d3e), TOBN(0x937b5adf, 0xce176d95), + TOBN(0x22867d34, 0x2a67d51c), TOBN(0x262b9b10, 0x18eb3ac9)}}, + {{TOBN(0x4e314fe4, 0xc43ff28b), TOBN(0x76476627, 0x6a664e7a), + TOBN(0x3e90e40b, 0xb7a565c2), TOBN(0x8588993a, 0xc1acf831)}, + {TOBN(0xd7b501d6, 0x8f938829), TOBN(0x996627ee, 0x3edd7d4c), + TOBN(0x37d44a62, 0x90cd34c7), TOBN(0xa8327499, 0xf3833e8d)}}, + {{TOBN(0x2e18917d, 0x4bf50353), TOBN(0x85dd726b, 0x556765fb), + TOBN(0x54fe65d6, 0x93d5ab66), TOBN(0x3ddbaced, 0x915c25fe)}, + {TOBN(0xa799d9a4, 0x12f22e85), TOBN(0xe2a24867, 0x6d06f6bc), + TOBN(0xf4f1ee56, 0x43ca1637), TOBN(0xfda2828b, 0x61ece30a)}}, + {{TOBN(0x758c1a3e, 0xa2dee7a6), TOBN(0xdcde2f3c, 0x734b2284), + TOBN(0xaba445d2, 0x4eaba6ad), TOBN(0x35aaf668, 0x76cee0a7)}, + {TOBN(0x7e0b04a9, 0xe5aa049a), TOBN(0xe74083ad, 0x91103e84), + TOBN(0xbeb183ce, 0x40afecc3), TOBN(0x6b89de9f, 0xea043f7a)}}}, + {{{TOBN(0x0e299d23, 0xfe67ba66), TOBN(0x91450760, 0x93cf2f34), + TOBN(0xf45b5ea9, 0x97fcf913), TOBN(0x5be00843, 0x8bd7ddda)}, + {TOBN(0x358c3e05, 0xd53ff04d), TOBN(0xbf7ccdc3, 0x5de91ef7), + TOBN(0xad684dbf, 0xb69ec1a0), TOBN(0x367e7cf2, 0x801fd997)}}, + {{TOBN(0x0ca1f3b7, 0xb0dc8595), TOBN(0x27de4608, 0x9f1d9f2e), + TOBN(0x1af3bf39, 0xbadd82a7), TOBN(0x79356a79, 0x65862448)}, + {TOBN(0xc0602345, 0xf5f9a052), TOBN(0x1a8b0f89, 0x139a42f9), + TOBN(0xb53eee42, 0x844d40fc), TOBN(0x93b0bfe5, 0x4e5b6368)}}, + {{TOBN(0x5434dd02, 0xc024789c), TOBN(0x90dca9ea, 0x41b57bfc), + TOBN(0x8aa898e2, 0x243398df), TOBN(0xf607c834, 0x894a94bb)}, + {TOBN(0xbb07be97, 0xc2c99b76), TOBN(0x6576ba67, 0x18c29302), + TOBN(0x3d79efcc, 0xe703a88c), TOBN(0xf259ced7, 0xb6a0d106)}}, + {{TOBN(0x0f893a5d, 0xc8de610b), TOBN(0xe8c515fb, 0x67e223ce), + TOBN(0x7774bfa6, 0x4ead6dc5), TOBN(0x89d20f95, 0x925c728f)}, + {TOBN(0x7a1e0966, 0x098583ce), TOBN(0xa2eedb94, 0x93f2a7d7), + TOBN(0x1b282097, 0x4c304d4a), TOBN(0x0842e3da, 0xc077282d)}}, + {{TOBN(0xe4d972a3, 0x3b9e2d7b), TOBN(0x7cc60b27, 0xc48218ff), + TOBN(0x8fc70838, 0x84149d91), TOBN(0x5c04346f, 0x2f461ecc)}, + {TOBN(0xebe9fdf2, 0x614650a9), TOBN(0x5e35b537, 0xc1f666ac), + TOBN(0x645613d1, 0x88babc83), TOBN(0x88cace3a, 0xc5e1c93e)}}, + {{TOBN(0x209ca375, 0x3de92e23), TOBN(0xccb03cc8, 0x5fbbb6e3), + TOBN(0xccb90f03, 0xd7b1487e), TOBN(0xfa9c2a38, 0xc710941f)}, + {TOBN(0x756c3823, 0x6724ceed), TOBN(0x3a902258, 0x192d0323), + TOBN(0xb150e519, 0xea5e038e), TOBN(0xdcba2865, 0xc7427591)}}, + {{TOBN(0xe549237f, 0x78890732), TOBN(0xc443bef9, 0x53fcb4d9), + TOBN(0x9884d8a6, 0xeb3480d6), TOBN(0x8a35b6a1, 0x3048b186)}, + {TOBN(0xb4e44716, 0x65e9a90a), TOBN(0x45bf380d, 0x653006c0), + TOBN(0x8f3f820d, 0x4fe9ae3b), TOBN(0x244a35a0, 0x979a3b71)}}, + {{TOBN(0xa1010e9d, 0x74cd06ff), TOBN(0x9c17c7df, 0xaca3eeac), + TOBN(0x74c86cd3, 0x8063aa2b), TOBN(0x8595c4b3, 0x734614ff)}, + {TOBN(0xa3de00ca, 0x990f62cc), TOBN(0xd9bed213, 0xca0c3be5), + TOBN(0x7886078a, 0xdf8ce9f5), TOBN(0xddb27ce3, 0x5cd44444)}}, + {{TOBN(0xed374a66, 0x58926ddd), TOBN(0x138b2d49, 0x908015b8), + TOBN(0x886c6579, 0xde1f7ab8), TOBN(0x888b9aa0, 0xc3020b7a)}, + {TOBN(0xd3ec034e, 0x3a96e355), TOBN(0xba65b0b8, 0xf30fbe9a), + TOBN(0x064c8e50, 0xff21367a), TOBN(0x1f508ea4, 0x0b04b46e)}}, + {{TOBN(0x98561a49, 0x747c866c), TOBN(0xbbb1e5fe, 0x0518a062), + TOBN(0x20ff4e8b, 0xecdc3608), TOBN(0x7f55cded, 0x20184027)}, + {TOBN(0x8d73ec95, 0xf38c85f0), TOBN(0x5b589fdf, 0x8bc3b8c3), + TOBN(0xbe95dd98, 0x0f12b66f), TOBN(0xf5bd1a09, 0x0e338e01)}}, + {{TOBN(0x65163ae5, 0x5e915918), TOBN(0x6158d6d9, 0x86f8a46b), + TOBN(0x8466b538, 0xeeebf99c), TOBN(0xca8761f6, 0xbca477ef)}, + {TOBN(0xaf3449c2, 0x9ebbc601), TOBN(0xef3b0f41, 0xe0c3ae2f), + TOBN(0xaa6c577d, 0x5de63752), TOBN(0xe9166601, 0x64682a51)}}, + {{TOBN(0x5a3097be, 0xfc15aa1e), TOBN(0x40d12548, 0xb54b0745), + TOBN(0x5bad4706, 0x519a5f12), TOBN(0xed03f717, 0xa439dee6)}, + {TOBN(0x0794bb6c, 0x4a02c499), TOBN(0xf725083d, 0xcffe71d2), + TOBN(0x2cad7519, 0x0f3adcaf), TOBN(0x7f68ea1c, 0x43729310)}}, + {{TOBN(0xe747c8c7, 0xb7ffd977), TOBN(0xec104c35, 0x80761a22), + TOBN(0x8395ebaf, 0x5a3ffb83), TOBN(0xfb3261f4, 0xe4b63db7)}, + {TOBN(0x53544960, 0xd883e544), TOBN(0x13520d70, 0x8cc2eeb8), + TOBN(0x08f6337b, 0xd3d65f99), TOBN(0x83997db2, 0x781cf95b)}}, + {{TOBN(0xce6ff106, 0x0dbd2c01), TOBN(0x4f8eea6b, 0x1f9ce934), + TOBN(0x546f7c4b, 0x0e993921), TOBN(0x6236a324, 0x5e753fc7)}, + {TOBN(0x65a41f84, 0xa16022e9), TOBN(0x0c18d878, 0x43d1dbb2), + TOBN(0x73c55640, 0x2d4cef9c), TOBN(0xa0428108, 0x70444c74)}}, + {{TOBN(0x68e4f15e, 0x9afdfb3c), TOBN(0x49a56143, 0x5bdfb6df), + TOBN(0xa9bc1bd4, 0x5f823d97), TOBN(0xbceb5970, 0xea111c2a)}, + {TOBN(0x366b455f, 0xb269bbc4), TOBN(0x7cd85e1e, 0xe9bc5d62), + TOBN(0xc743c41c, 0x4f18b086), TOBN(0xa4b40990, 0x95294fb9)}}, + {{TOBN(0x9c7c581d, 0x26ee8382), TOBN(0xcf17dcc5, 0x359d638e), + TOBN(0xee8273ab, 0xb728ae3d), TOBN(0x1d112926, 0xf821f047)}, + {TOBN(0x11498477, 0x50491a74), TOBN(0x687fa761, 0xfde0dfb9), + TOBN(0x2c258022, 0x7ea435ab), TOBN(0x6b8bdb94, 0x91ce7e3f)}}, + {{TOBN(0x4c5b5dc9, 0x3bf834aa), TOBN(0x04371819, 0x4f6c7e4b), + TOBN(0xc284e00a, 0x3736bcad), TOBN(0x0d881118, 0x21ae8f8d)}, + {TOBN(0xf9cf0f82, 0xf48c8e33), TOBN(0xa11fd075, 0xa1bf40db), + TOBN(0xdceab0de, 0xdc2733e5), TOBN(0xc560a8b5, 0x8e986bd7)}}, + {{TOBN(0x48dd1fe2, 0x3929d097), TOBN(0x3885b290, 0x92f188f1), + TOBN(0x0f2ae613, 0xda6fcdac), TOBN(0x9054303e, 0xb662a46c)}, + {TOBN(0xb6871e44, 0x0738042a), TOBN(0x98e6a977, 0xbdaf6449), + TOBN(0xd8bc0650, 0xd1c9df1b), TOBN(0xef3d6451, 0x36e098f9)}}, + {{TOBN(0x03fbae82, 0xb6d72d28), TOBN(0x77ca9db1, 0xf5d84080), + TOBN(0x8a112cff, 0xa58efc1c), TOBN(0x518d761c, 0xc564cb4a)}, + {TOBN(0x69b5740e, 0xf0d1b5ce), TOBN(0x717039cc, 0xe9eb1785), + TOBN(0x3fe29f90, 0x22f53382), TOBN(0x8e54ba56, 0x6bc7c95c)}}, + {{TOBN(0x9c806d8a, 0xf7f91d0f), TOBN(0x3b61b0f1, 0xa82a5728), + TOBN(0x4640032d, 0x94d76754), TOBN(0x273eb5de, 0x47d834c6)}, + {TOBN(0x2988abf7, 0x7b4e4d53), TOBN(0xb7ce66bf, 0xde401777), + TOBN(0x9fba6b32, 0x715071b3), TOBN(0x82413c24, 0xad3a1a98)}}, + {{TOBN(0x5b7fc8c4, 0xe0e8ad93), TOBN(0xb5679aee, 0x5fab868d), + TOBN(0xb1f9d2fa, 0x2b3946f3), TOBN(0x458897dc, 0x5685b50a)}, + {TOBN(0x1e98c930, 0x89d0caf3), TOBN(0x39564c5f, 0x78642e92), + TOBN(0x1b77729a, 0x0dbdaf18), TOBN(0xf9170722, 0x579e82e6)}}, + {{TOBN(0x680c0317, 0xe4515fa5), TOBN(0xf85cff84, 0xfb0c790f), + TOBN(0xc7a82aab, 0x6d2e0765), TOBN(0x7446bca9, 0x35c82b32)}, + {TOBN(0x5de607aa, 0x6d63184f), TOBN(0x7c1a46a8, 0x262803a6), + TOBN(0xd218313d, 0xaebe8035), TOBN(0x92113ffd, 0xc73c51f8)}}, + {{TOBN(0x4b38e083, 0x12e7e46c), TOBN(0x69d0a37a, 0x56126bd5), + TOBN(0xfb3f324b, 0x73c07e04), TOBN(0xa0c22f67, 0x8fda7267)}, + {TOBN(0x8f2c0051, 0x4d2c7d8f), TOBN(0xbc45ced3, 0xcbe2cae5), + TOBN(0xe1c6cf07, 0xa8f0f277), TOBN(0xbc392312, 0x1eb99a98)}}, + {{TOBN(0x75537b7e, 0x3cc8ac85), TOBN(0x8d725f57, 0xdd02753b), + TOBN(0xfd05ff64, 0xb737df2f), TOBN(0x55fe8712, 0xf6d2531d)}, + {TOBN(0x57ce04a9, 0x6ab6b01c), TOBN(0x69a02a89, 0x7cd93724), + TOBN(0x4f82ac35, 0xcf86699b), TOBN(0x8242d3ad, 0x9cb4b232)}}, + {{TOBN(0x713d0f65, 0xd62105e5), TOBN(0xbb222bfa, 0x2d29be61), + TOBN(0xf2f9a79e, 0x6cfbef09), TOBN(0xfc24d8d3, 0xd5d6782f)}, + {TOBN(0x5db77085, 0xd4129967), TOBN(0xdb81c3cc, 0xdc3c2a43), + TOBN(0x9d655fc0, 0x05d8d9a3), TOBN(0x3f5d057a, 0x54298026)}}, + {{TOBN(0x1157f56d, 0x88c54694), TOBN(0xb26baba5, 0x9b09573e), + TOBN(0x2cab03b0, 0x22adffd1), TOBN(0x60a412c8, 0xdd69f383)}, + {TOBN(0xed76e98b, 0x54b25039), TOBN(0xd4ee67d3, 0x687e714d), + TOBN(0x87739648, 0x7b00b594), TOBN(0xce419775, 0xc9ef709b)}}, + {{TOBN(0x40f76f85, 0x1c203a40), TOBN(0x30d352d6, 0xeafd8f91), + TOBN(0xaf196d3d, 0x95578dd2), TOBN(0xea4bb3d7, 0x77cc3f3d)}, + {TOBN(0x42a5bd03, 0xb98e782b), TOBN(0xac958c40, 0x0624920d), + TOBN(0xb838134c, 0xfc56fcc8), TOBN(0x86ec4ccf, 0x89572e5e)}}, + {{TOBN(0x69c43526, 0x9be47be0), TOBN(0x323b7dd8, 0xcb28fea1), + TOBN(0xfa5538ba, 0x3a6c67e5), TOBN(0xef921d70, 0x1d378e46)}, + {TOBN(0xf92961fc, 0x3c4b880e), TOBN(0x3f6f914e, 0x98940a67), + TOBN(0xa990eb0a, 0xfef0ff39), TOBN(0xa6c2920f, 0xf0eeff9c)}}, + {{TOBN(0xca804166, 0x51b8d9a3), TOBN(0x42531bc9, 0x0ffb0db1), + TOBN(0x72ce4718, 0xaa82e7ce), TOBN(0x6e199913, 0xdf574741)}, + {TOBN(0xd5f1b13d, 0xd5d36946), TOBN(0x8255dc65, 0xf68f0194), + TOBN(0xdc9df4cd, 0x8710d230), TOBN(0x3453c20f, 0x138c1988)}}, + {{TOBN(0x9af98dc0, 0x89a6ef01), TOBN(0x4dbcc3f0, 0x9857df85), + TOBN(0x34805601, 0x5c1ad924), TOBN(0x40448da5, 0xd0493046)}, + {TOBN(0xf629926d, 0x4ee343e2), TOBN(0x6343f1bd, 0x90e8a301), + TOBN(0xefc93491, 0x40815b3f), TOBN(0xf882a423, 0xde8f66fb)}}, + {{TOBN(0x3a12d5f4, 0xe7db9f57), TOBN(0x7dfba38a, 0x3c384c27), + TOBN(0x7a904bfd, 0x6fc660b1), TOBN(0xeb6c5db3, 0x2773b21c)}, + {TOBN(0xc350ee66, 0x1cdfe049), TOBN(0x9baac0ce, 0x44540f29), + TOBN(0xbc57b6ab, 0xa5ec6aad), TOBN(0x167ce8c3, 0x0a7c1baa)}}, + {{TOBN(0xb23a03a5, 0x53fb2b56), TOBN(0x6ce141e7, 0x4e057f78), + TOBN(0x796525c3, 0x89e490d9), TOBN(0x0bc95725, 0xa31a7e75)}, + {TOBN(0x1ec56791, 0x1220fd06), TOBN(0x716e3a3c, 0x408b0bd6), + TOBN(0x31cd6bf7, 0xe8ebeba9), TOBN(0xa7326ca6, 0xbee6b670)}}, + {{TOBN(0x3d9f851c, 0xcd090c43), TOBN(0x561e8f13, 0xf12c3988), + TOBN(0x50490b6a, 0x904b7be4), TOBN(0x61690ce1, 0x0410737b)}, + {TOBN(0x299e9a37, 0x0f009052), TOBN(0x258758f0, 0xf026092e), + TOBN(0x9fa255f3, 0xfdfcdc0f), TOBN(0xdbc9fb1f, 0xc0e1bcd2)}}, + {{TOBN(0x35f9dd6e, 0x24651840), TOBN(0xdca45a84, 0xa5c59abc), + TOBN(0x103d396f, 0xecca4938), TOBN(0x4532da0a, 0xb97b3f29)}, + {TOBN(0xc4135ea5, 0x1999a6bf), TOBN(0x3aa9505a, 0x5e6bf2ee), + TOBN(0xf77cef06, 0x3f5be093), TOBN(0x97d1a0f8, 0xa943152e)}}, + {{TOBN(0x2cb0ebba, 0x2e1c21dd), TOBN(0xf41b29fc, 0x2c6797c4), + TOBN(0xc6e17321, 0xb300101f), TOBN(0x4422b0e9, 0xd0d79a89)}, + {TOBN(0x49e4901c, 0x92f1bfc4), TOBN(0x06ab1f8f, 0xe1e10ed9), + TOBN(0x84d35577, 0xdb2926b8), TOBN(0xca349d39, 0x356e8ec2)}}, + {{TOBN(0x70b63d32, 0x343bf1a9), TOBN(0x8fd3bd28, 0x37d1a6b1), + TOBN(0x0454879c, 0x316865b4), TOBN(0xee959ff6, 0xc458efa2)}, + {TOBN(0x0461dcf8, 0x9706dc3f), TOBN(0x737db0e2, 0x164e4b2e), + TOBN(0x09262680, 0x2f8843c8), TOBN(0x54498bbc, 0x7745e6f6)}}, + {{TOBN(0x359473fa, 0xa29e24af), TOBN(0xfcc3c454, 0x70aa87a1), + TOBN(0xfd2c4bf5, 0x00573ace), TOBN(0xb65b514e, 0x28dd1965)}, + {TOBN(0xe46ae7cf, 0x2193e393), TOBN(0x60e9a4e1, 0xf5444d97), + TOBN(0xe7594e96, 0x00ff38ed), TOBN(0x43d84d2f, 0x0a0e0f02)}}, + {{TOBN(0x8b6db141, 0xee398a21), TOBN(0xb88a56ae, 0xe3bcc5be), + TOBN(0x0a1aa52f, 0x373460ea), TOBN(0x20da1a56, 0x160bb19b)}, + {TOBN(0xfb54999d, 0x65bf0384), TOBN(0x71a14d24, 0x5d5a180e), + TOBN(0xbc44db7b, 0x21737b04), TOBN(0xd84fcb18, 0x01dd8e92)}}, + {{TOBN(0x80de937b, 0xfa44b479), TOBN(0x53505499, 0x5c98fd4f), + TOBN(0x1edb12ab, 0x28f08727), TOBN(0x4c58b582, 0xa5f3ef53)}, + {TOBN(0xbfb236d8, 0x8327f246), TOBN(0xc3a3bfaa, 0x4d7df320), + TOBN(0xecd96c59, 0xb96024f2), TOBN(0xfc293a53, 0x7f4e0433)}}, + {{TOBN(0x5341352b, 0x5acf6e10), TOBN(0xc50343fd, 0xafe652c3), + TOBN(0x4af3792d, 0x18577a7f), TOBN(0xe1a4c617, 0xaf16823d)}, + {TOBN(0x9b26d0cd, 0x33425d0a), TOBN(0x306399ed, 0x9b7bc47f), + TOBN(0x2a792f33, 0x706bb20b), TOBN(0x31219614, 0x98111055)}}, + {{TOBN(0x864ec064, 0x87f5d28b), TOBN(0x11392d91, 0x962277fd), + TOBN(0xb5aa7942, 0xbb6aed5f), TOBN(0x080094dc, 0x47e799d9)}, + {TOBN(0x4afa588c, 0x208ba19b), TOBN(0xd3e7570f, 0x8512f284), + TOBN(0xcbae64e6, 0x02f5799a), TOBN(0xdeebe7ef, 0x514b9492)}}, + {{TOBN(0x30300f98, 0xe5c298ff), TOBN(0x17f561be, 0x3678361f), + TOBN(0xf52ff312, 0x98cb9a16), TOBN(0x6233c3bc, 0x5562d490)}, + {TOBN(0x7bfa15a1, 0x92e3a2cb), TOBN(0x961bcfd1, 0xe6365119), + TOBN(0x3bdd29bf, 0x2c8c53b1), TOBN(0x739704df, 0x822844ba)}}, + {{TOBN(0x7dacfb58, 0x7e7b754b), TOBN(0x23360791, 0xa806c9b9), + TOBN(0xe7eb88c9, 0x23504452), TOBN(0x2983e996, 0x852c1783)}, + {TOBN(0xdd4ae529, 0x958d881d), TOBN(0x026bae03, 0x262c7b3c), + TOBN(0x3a6f9193, 0x960b52d1), TOBN(0xd0980f90, 0x92696cfb)}}, + {{TOBN(0x4c1f428c, 0xd5f30851), TOBN(0x94dfed27, 0x2a4f6630), + TOBN(0x4df53772, 0xfc5d48a4), TOBN(0xdd2d5a2f, 0x933260ce)}, + {TOBN(0x574115bd, 0xd44cc7a5), TOBN(0x4ba6b20d, 0xbd12533a), + TOBN(0x30e93cb8, 0x243057c9), TOBN(0x794c486a, 0x14de320e)}}, + {{TOBN(0xe925d4ce, 0xf21496e4), TOBN(0xf951d198, 0xec696331), + TOBN(0x9810e2de, 0x3e8d812f), TOBN(0xd0a47259, 0x389294ab)}, + {TOBN(0x513ba2b5, 0x0e3bab66), TOBN(0x462caff5, 0xabad306f), + TOBN(0xe2dc6d59, 0xaf04c49e), TOBN(0x1aeb8750, 0xe0b84b0b)}}, + {{TOBN(0xc034f12f, 0x2f7d0ca2), TOBN(0x6d2e8128, 0xe06acf2f), + TOBN(0x801f4f83, 0x21facc2f), TOBN(0xa1170c03, 0xf40ef607)}, + {TOBN(0xfe0a1d4f, 0x7805a99c), TOBN(0xbde56a36, 0xcc26aba5), + TOBN(0x5b1629d0, 0x35531f40), TOBN(0xac212c2b, 0x9afa6108)}}, + {{TOBN(0x30a06bf3, 0x15697be5), TOBN(0x6f0545dc, 0x2c63c7c1), + TOBN(0x5d8cb842, 0x7ccdadaf), TOBN(0xd52e379b, 0xac7015bb)}, + {TOBN(0xc4f56147, 0xf462c23e), TOBN(0xd44a4298, 0x46bc24b0), + TOBN(0xbc73d23a, 0xe2856d4f), TOBN(0x61cedd8c, 0x0832bcdf)}}, + {{TOBN(0x60953556, 0x99f241d7), TOBN(0xee4adbd7, 0x001a349d), + TOBN(0x0b35bf6a, 0xaa89e491), TOBN(0x7f0076f4, 0x136f7546)}, + {TOBN(0xd19a18ba, 0x9264da3d), TOBN(0x6eb2d2cd, 0x62a7a28b), + TOBN(0xcdba941f, 0x8761c971), TOBN(0x1550518b, 0xa3be4a5d)}}, + {{TOBN(0xd0e8e2f0, 0x57d0b70c), TOBN(0xeea8612e, 0xcd133ba3), + TOBN(0x814670f0, 0x44416aec), TOBN(0x424db6c3, 0x30775061)}, + {TOBN(0xd96039d1, 0x16213fd1), TOBN(0xc61e7fa5, 0x18a3478f), + TOBN(0xa805bdcc, 0xcb0c5021), TOBN(0xbdd6f3a8, 0x0cc616dd)}}, + {{TOBN(0x06009667, 0x5d97f7e2), TOBN(0x31db0fc1, 0xaf0bf4b6), + TOBN(0x23680ed4, 0x5491627a), TOBN(0xb99a3c66, 0x7d741fb1)}, + {TOBN(0xe9bb5f55, 0x36b1ff92), TOBN(0x29738577, 0x512b388d), + TOBN(0xdb8a2ce7, 0x50fcf263), TOBN(0x385346d4, 0x6c4f7b47)}}, + {{TOBN(0xbe86c5ef, 0x31631f9e), TOBN(0xbf91da21, 0x03a57a29), + TOBN(0xc3b1f796, 0x7b23f821), TOBN(0x0f7d00d2, 0x770db354)}, + {TOBN(0x8ffc6c3b, 0xd8fe79da), TOBN(0xcc5e8c40, 0xd525c996), + TOBN(0x4640991d, 0xcfff632a), TOBN(0x64d97e8c, 0x67112528)}}, + {{TOBN(0xc232d973, 0x02f1cd1e), TOBN(0xce87eacb, 0x1dd212a4), + TOBN(0x6e4c8c73, 0xe69802f7), TOBN(0x12ef0290, 0x1fffddbd)}, + {TOBN(0x941ec74e, 0x1bcea6e2), TOBN(0xd0b54024, 0x3cb92cbb), + TOBN(0x809fb9d4, 0x7e8f9d05), TOBN(0x3bf16159, 0xf2992aae)}}, + {{TOBN(0xad40f279, 0xf8a7a838), TOBN(0x11aea631, 0x05615660), + TOBN(0xbf52e6f1, 0xa01f6fa1), TOBN(0xef046995, 0x3dc2aec9)}, + {TOBN(0x785dbec9, 0xd8080711), TOBN(0xe1aec60a, 0x9fdedf76), + TOBN(0xece797b5, 0xfa21c126), TOBN(0xc66e898f, 0x05e52732)}}, + {{TOBN(0x39bb69c4, 0x08811fdb), TOBN(0x8bfe1ef8, 0x2fc7f082), + TOBN(0xc8e7a393, 0x174f4138), TOBN(0xfba8ad1d, 0xd58d1f98)}, + {TOBN(0xbc21d0ce, 0xbfd2fd5b), TOBN(0x0b839a82, 0x6ee60d61), + TOBN(0xaacf7658, 0xafd22253), TOBN(0xb526bed8, 0xaae396b3)}}, + {{TOBN(0xccc1bbc2, 0x38564464), TOBN(0x9e3ff947, 0x8c45bc73), + TOBN(0xcde9bca3, 0x58188a78), TOBN(0x138b8ee0, 0xd73bf8f7)}, + {TOBN(0x5c7e234c, 0x4123c489), TOBN(0x66e69368, 0xfa643297), + TOBN(0x0629eeee, 0x39a15fa3), TOBN(0x95fab881, 0xa9e2a927)}}, + {{TOBN(0xb2497007, 0xeafbb1e1), TOBN(0xd75c9ce6, 0xe75b7a93), + TOBN(0x3558352d, 0xefb68d78), TOBN(0xa2f26699, 0x223f6396)}, + {TOBN(0xeb911ecf, 0xe469b17a), TOBN(0x62545779, 0xe72d3ec2), + TOBN(0x8ea47de7, 0x82cb113f), TOBN(0xebe4b086, 0x4e1fa98d)}}, + {{TOBN(0xec2d5ed7, 0x8cdfedb1), TOBN(0xa535c077, 0xfe211a74), + TOBN(0x9678109b, 0x11d244c5), TOBN(0xf17c8bfb, 0xbe299a76)}, + {TOBN(0xb651412e, 0xfb11fbc4), TOBN(0xea0b5482, 0x94ab3f65), + TOBN(0xd8dffd95, 0x0cf78243), TOBN(0x2e719e57, 0xce0361d4)}}, + {{TOBN(0x9007f085, 0x304ddc5b), TOBN(0x095e8c6d, 0x4daba2ea), + TOBN(0x5a33cdb4, 0x3f9d28a9), TOBN(0x85b95cd8, 0xe2283003)}, + {TOBN(0xbcd6c819, 0xb9744733), TOBN(0x29c5f538, 0xfc7f5783), + TOBN(0x6c49b2fa, 0xd59038e4), TOBN(0x68349cc1, 0x3bbe1018)}}, + {{TOBN(0xcc490c1d, 0x21830ee5), TOBN(0x36f9c4ee, 0xe9bfa297), + TOBN(0x58fd7294, 0x48de1a94), TOBN(0xaadb13a8, 0x4e8f2cdc)}, + {TOBN(0x515eaaa0, 0x81313dba), TOBN(0xc76bb468, 0xc2152dd8), + TOBN(0x357f8d75, 0xa653dbf8), TOBN(0xe4d8c4d1, 0xb14ac143)}}, + {{TOBN(0xbdb8e675, 0xb055cb40), TOBN(0x898f8e7b, 0x977b5167), + TOBN(0xecc65651, 0xb82fb863), TOBN(0x56544814, 0x6d88f01f)}, + {TOBN(0xb0928e95, 0x263a75a9), TOBN(0xcfb6836f, 0x1a22fcda), + TOBN(0x651d14db, 0x3f3bd37c), TOBN(0x1d3837fb, 0xb6ad4664)}}, + {{TOBN(0x7c5fb538, 0xff4f94ab), TOBN(0x7243c712, 0x6d7fb8f2), + TOBN(0xef13d60c, 0xa85c5287), TOBN(0x18cfb7c7, 0x4bb8dd1b)}, + {TOBN(0x82f9bfe6, 0x72908219), TOBN(0x35c4592b, 0x9d5144ab), + TOBN(0x52734f37, 0x9cf4b42f), TOBN(0x6bac55e7, 0x8c60ddc4)}}, + {{TOBN(0xb5cd811e, 0x94dea0f6), TOBN(0x259ecae4, 0xe18cc1a3), + TOBN(0x6a0e836e, 0x15e660f8), TOBN(0x6c639ea6, 0x0e02bff2)}, + {TOBN(0x8721b8cb, 0x7e1026fd), TOBN(0x9e73b50b, 0x63261942), + TOBN(0xb8c70974, 0x77f01da3), TOBN(0x1839e6a6, 0x8268f57f)}}, + {{TOBN(0x571b9415, 0x5150b805), TOBN(0x1892389e, 0xf92c7097), + TOBN(0x8d69c18e, 0x4a084b95), TOBN(0x7014c512, 0xbe5b495c)}, + {TOBN(0x4780db36, 0x1b07523c), TOBN(0x2f6219ce, 0x2c1c64fa), + TOBN(0xc38b81b0, 0x602c105a), TOBN(0xab4f4f20, 0x5dc8e360)}}, + {{TOBN(0x20d3c982, 0xcf7d62d2), TOBN(0x1f36e29d, 0x23ba8150), + TOBN(0x48ae0bf0, 0x92763f9e), TOBN(0x7a527e6b, 0x1d3a7007)}, + {TOBN(0xb4a89097, 0x581a85e3), TOBN(0x1f1a520f, 0xdc158be5), + TOBN(0xf98db37d, 0x167d726e), TOBN(0x8802786e, 0x1113e862)}}}, + {{{TOBN(0xefb2149e, 0x36f09ab0), TOBN(0x03f163ca, 0x4a10bb5b), + TOBN(0xd0297045, 0x06e20998), TOBN(0x56f0af00, 0x1b5a3bab)}, + {TOBN(0x7af4cfec, 0x70880e0d), TOBN(0x7332a66f, 0xbe3d913f), + TOBN(0x32e6c84a, 0x7eceb4bd), TOBN(0xedc4a79a, 0x9c228f55)}}, + {{TOBN(0xc37c7dd0, 0xc55c4496), TOBN(0xa6a96357, 0x25bbabd2), + TOBN(0x5b7e63f2, 0xadd7f363), TOBN(0x9dce3782, 0x2e73f1df)}, + {TOBN(0xe1e5a16a, 0xb2b91f71), TOBN(0xe4489823, 0x5ba0163c), + TOBN(0xf2759c32, 0xf6e515ad), TOBN(0xa5e2f1f8, 0x8615eecf)}}, + {{TOBN(0x74519be7, 0xabded551), TOBN(0x03d358b8, 0xc8b74410), + TOBN(0x4d00b10b, 0x0e10d9a9), TOBN(0x6392b0b1, 0x28da52b7)}, + {TOBN(0x6744a298, 0x0b75c904), TOBN(0xc305b0ae, 0xa8f7f96c), + TOBN(0x042e421d, 0x182cf932), TOBN(0xf6fc5d50, 0x9e4636ca)}}, + {{TOBN(0x795847c9, 0xd64cc78c), TOBN(0x6c50621b, 0x9b6cb27b), + TOBN(0x07099bf8, 0xdf8022ab), TOBN(0x48f862eb, 0xc04eda1d)}, + {TOBN(0xd12732ed, 0xe1603c16), TOBN(0x19a80e0f, 0x5c9a9450), + TOBN(0xe2257f54, 0xb429b4fc), TOBN(0x66d3b2c6, 0x45460515)}}, + {{TOBN(0x6ca4f87e, 0x822e37be), TOBN(0x73f237b4, 0x253bda4e), + TOBN(0xf747f3a2, 0x41190aeb), TOBN(0xf06fa36f, 0x804cf284)}, + {TOBN(0x0a6bbb6e, 0xfc621c12), TOBN(0x5d624b64, 0x40b80ec6), + TOBN(0x4b072425, 0x7ba556f3), TOBN(0x7fa0c354, 0x3e2d20a8)}}, + {{TOBN(0xe921fa31, 0xe3229d41), TOBN(0xa929c652, 0x94531bd4), + TOBN(0x84156027, 0xa6d38209), TOBN(0xf3d69f73, 0x6bdb97bd)}, + {TOBN(0x8906d19a, 0x16833631), TOBN(0x68a34c2e, 0x03d51be3), + TOBN(0xcb59583b, 0x0e511cd8), TOBN(0x99ce6bfd, 0xfdc132a8)}}, + {{TOBN(0x3facdaaa, 0xffcdb463), TOBN(0x658bbc1a, 0x34a38b08), + TOBN(0x12a801f8, 0xf1a9078d), TOBN(0x1567bcf9, 0x6ab855de)}, + {TOBN(0xe08498e0, 0x3572359b), TOBN(0xcf0353e5, 0x8659e68b), + TOBN(0xbb86e9c8, 0x7d23807c), TOBN(0xbc08728d, 0x2198e8a2)}}, + {{TOBN(0x8de2b7bc, 0x453cadd6), TOBN(0x203900a7, 0xbc0bc1f8), + TOBN(0xbcd86e47, 0xa6abd3af), TOBN(0x911cac12, 0x8502effb)}, + {TOBN(0x2d550242, 0xec965469), TOBN(0x0e9f7692, 0x29e0017e), + TOBN(0x633f078f, 0x65979885), TOBN(0xfb87d449, 0x4cf751ef)}}, + {{TOBN(0xe1790e4b, 0xfc25419a), TOBN(0x36467203, 0x4bff3cfd), + TOBN(0xc8db6386, 0x25b6e83f), TOBN(0x6cc69f23, 0x6cad6fd2)}, + {TOBN(0x0219e45a, 0x6bc68bb9), TOBN(0xe43d79b6, 0x297f7334), + TOBN(0x7d445368, 0x465dc97c), TOBN(0x4b9eea32, 0x2a0b949a)}}, + {{TOBN(0x1b96c6ba, 0x6102d021), TOBN(0xeaafac78, 0x2f4461ea), + TOBN(0xd4b85c41, 0xc49f19a8), TOBN(0x275c28e4, 0xcf538875)}, + {TOBN(0x35451a9d, 0xdd2e54e0), TOBN(0x6991adb5, 0x0605618b), + TOBN(0x5b8b4bcd, 0x7b36cd24), TOBN(0x372a4f8c, 0x56f37216)}}, + {{TOBN(0xc890bd73, 0xa6a5da60), TOBN(0x6f083da0, 0xdc4c9ff0), + TOBN(0xf4e14d94, 0xf0536e57), TOBN(0xf9ee1eda, 0xaaec8243)}, + {TOBN(0x571241ec, 0x8bdcf8e7), TOBN(0xa5db8271, 0x0b041e26), + TOBN(0x9a0b9a99, 0xe3fff040), TOBN(0xcaaf21dd, 0x7c271202)}}, + {{TOBN(0xb4e2b2e1, 0x4f0dd2e8), TOBN(0xe77e7c4f, 0x0a377ac7), + TOBN(0x69202c3f, 0x0d7a2198), TOBN(0xf759b7ff, 0x28200eb8)}, + {TOBN(0xc87526ed, 0xdcfe314e), TOBN(0xeb84c524, 0x53d5cf99), + TOBN(0xb1b52ace, 0x515138b6), TOBN(0x5aa7ff8c, 0x23fca3f4)}}, + {{TOBN(0xff0b13c3, 0xb9791a26), TOBN(0x960022da, 0xcdd58b16), + TOBN(0xdbd55c92, 0x57aad2de), TOBN(0x3baaaaa3, 0xf30fe619)}, + {TOBN(0x9a4b2346, 0x0d881efd), TOBN(0x506416c0, 0x46325e2a), + TOBN(0x91381e76, 0x035c18d4), TOBN(0xb3bb68be, 0xf27817b0)}}, + {{TOBN(0x15bfb8bf, 0x5116f937), TOBN(0x7c64a586, 0xc1268943), + TOBN(0x71e25cc3, 0x8419a2c8), TOBN(0x9fd6b0c4, 0x8335f463)}, + {TOBN(0x4bf0ba3c, 0xe8ee0e0e), TOBN(0x6f6fba60, 0x298c21fa), + TOBN(0x57d57b39, 0xae66bee0), TOBN(0x292d5130, 0x22672544)}}, + {{TOBN(0xf451105d, 0xbab093b3), TOBN(0x012f59b9, 0x02839986), + TOBN(0x8a915802, 0x3474a89c), TOBN(0x048c919c, 0x2de03e97)}, + {TOBN(0xc476a2b5, 0x91071cd5), TOBN(0x791ed89a, 0x034970a5), + TOBN(0x89bd9042, 0xe1b7994b), TOBN(0x8eaf5179, 0xa1057ffd)}}, + {{TOBN(0x6066e2a2, 0xd551ee10), TOBN(0x87a8f1d8, 0x727e09a6), + TOBN(0x00d08bab, 0x2c01148d), TOBN(0x6da8e4f1, 0x424f33fe)}, + {TOBN(0x466d17f0, 0xcf9a4e71), TOBN(0xff502010, 0x3bf5cb19), + TOBN(0xdccf97d8, 0xd062ecc0), TOBN(0x80c0d9af, 0x81d80ac4)}}, + {{TOBN(0xe87771d8, 0x033f2876), TOBN(0xb0186ec6, 0x7d5cc3db), + TOBN(0x58e8bb80, 0x3bc9bc1d), TOBN(0x4d1395cc, 0x6f6ef60e)}, + {TOBN(0xa73c62d6, 0x186244a0), TOBN(0x918e5f23, 0x110a5b53), + TOBN(0xed4878ca, 0x741b7eab), TOBN(0x3038d71a, 0xdbe03e51)}}, + {{TOBN(0x840204b7, 0xa93c3246), TOBN(0x21ab6069, 0xa0b9b4cd), + TOBN(0xf5fa6e2b, 0xb1d64218), TOBN(0x1de6ad0e, 0xf3d56191)}, + {TOBN(0x570aaa88, 0xff1929c7), TOBN(0xc6df4c6b, 0x640e87b5), + TOBN(0xde8a74f2, 0xc65f0ccc), TOBN(0x8b972fd5, 0xe6f6cc01)}}, + {{TOBN(0x3fff36b6, 0x0b846531), TOBN(0xba7e45e6, 0x10a5e475), + TOBN(0x84a1d10e, 0x4145b6c5), TOBN(0xf1f7f91a, 0x5e046d9d)}, + {TOBN(0x0317a692, 0x44de90d7), TOBN(0x951a1d4a, 0xf199c15e), + TOBN(0x91f78046, 0xc9d73deb), TOBN(0x74c82828, 0xfab8224f)}}, + {{TOBN(0xaa6778fc, 0xe7560b90), TOBN(0xb4073e61, 0xa7e824ce), + TOBN(0xff0d693c, 0xd642eba8), TOBN(0x7ce2e57a, 0x5dccef38)}, + {TOBN(0x89c2c789, 0x1df1ad46), TOBN(0x83a06922, 0x098346fd), + TOBN(0x2d715d72, 0xda2fc177), TOBN(0x7b6dd71d, 0x85b6cf1d)}}, + {{TOBN(0xc60a6d0a, 0x73fa9cb0), TOBN(0xedd3992e, 0x328bf5a9), + TOBN(0xc380ddd0, 0x832c8c82), TOBN(0xd182d410, 0xa2a0bf50)}, + {TOBN(0x7d9d7438, 0xd9a528db), TOBN(0xe8b1a0e9, 0xcaf53994), + TOBN(0xddd6e5fe, 0x0e19987c), TOBN(0xacb8df03, 0x190b059d)}}, + {{TOBN(0x53703a32, 0x8300129f), TOBN(0x1f637662, 0x68c43bfd), + TOBN(0xbcbd1913, 0x00e54051), TOBN(0x812fcc62, 0x7bf5a8c5)}, + {TOBN(0x3f969d5f, 0x29fb85da), TOBN(0x72f4e00a, 0x694759e8), + TOBN(0x426b6e52, 0x790726b7), TOBN(0x617bbc87, 0x3bdbb209)}}, + {{TOBN(0x511f8bb9, 0x97aee317), TOBN(0x812a4096, 0xe81536a8), + TOBN(0x137dfe59, 0x3ac09b9b), TOBN(0x0682238f, 0xba8c9a7a)}, + {TOBN(0x7072ead6, 0xaeccb4bd), TOBN(0x6a34e9aa, 0x692ba633), + TOBN(0xc82eaec2, 0x6fff9d33), TOBN(0xfb753512, 0x1d4d2b62)}}, + {{TOBN(0x1a0445ff, 0x1d7aadab), TOBN(0x65d38260, 0xd5f6a67c), + TOBN(0x6e62fb08, 0x91cfb26f), TOBN(0xef1e0fa5, 0x5c7d91d6)}, + {TOBN(0x47e7c7ba, 0x33db72cd), TOBN(0x017cbc09, 0xfa7c74b2), + TOBN(0x3c931590, 0xf50a503c), TOBN(0xcac54f60, 0x616baa42)}}, + {{TOBN(0x9b6cd380, 0xb2369f0f), TOBN(0x97d3a70d, 0x23c76151), + TOBN(0x5f9dd6fc, 0x9862a9c6), TOBN(0x044c4ab2, 0x12312f51)}, + {TOBN(0x035ea0fd, 0x834a2ddc), TOBN(0x49e6b862, 0xcc7b826d), + TOBN(0xb03d6883, 0x62fce490), TOBN(0x62f2497a, 0xb37e36e9)}}, + {{TOBN(0x04b005b6, 0xc6458293), TOBN(0x36bb5276, 0xe8d10af7), + TOBN(0xacf2dc13, 0x8ee617b8), TOBN(0x470d2d35, 0xb004b3d4)}, + {TOBN(0x06790832, 0xfeeb1b77), TOBN(0x2bb75c39, 0x85657f9c), + TOBN(0xd70bd4ed, 0xc0f60004), TOBN(0xfe797ecc, 0x219b018b)}}, + {{TOBN(0x9b5bec2a, 0x753aebcc), TOBN(0xdaf9f3dc, 0xc939eca5), + TOBN(0xd6bc6833, 0xd095ad09), TOBN(0x98abdd51, 0xdaa4d2fc)}, + {TOBN(0xd9840a31, 0x8d168be5), TOBN(0xcf7c10e0, 0x2325a23c), + TOBN(0xa5c02aa0, 0x7e6ecfaf), TOBN(0x2462e7e6, 0xb5bfdf18)}}, + {{TOBN(0xab2d8a8b, 0xa0cc3f12), TOBN(0x68dd485d, 0xbc672a29), + TOBN(0x72039752, 0x596f2cd3), TOBN(0x5d3eea67, 0xa0cf3d8d)}, + {TOBN(0x810a1a81, 0xe6602671), TOBN(0x8f144a40, 0x14026c0c), + TOBN(0xbc753a6d, 0x76b50f85), TOBN(0xc4dc21e8, 0x645cd4a4)}}, + {{TOBN(0xc5262dea, 0x521d0378), TOBN(0x802b8e0e, 0x05011c6f), + TOBN(0x1ba19cbb, 0x0b4c19ea), TOBN(0x21db64b5, 0xebf0aaec)}, + {TOBN(0x1f394ee9, 0x70342f9d), TOBN(0x93a10aee, 0x1bc44a14), + TOBN(0xa7eed31b, 0x3efd0baa), TOBN(0x6e7c824e, 0x1d154e65)}}, + {{TOBN(0xee23fa81, 0x9966e7ee), TOBN(0x64ec4aa8, 0x05b7920d), + TOBN(0x2d44462d, 0x2d90aad4), TOBN(0xf44dd195, 0xdf277ad5)}, + {TOBN(0x8d6471f1, 0xbb46b6a1), TOBN(0x1e65d313, 0xfd885090), + TOBN(0x33a800f5, 0x13a977b4), TOBN(0xaca9d721, 0x0797e1ef)}}, + {{TOBN(0x9a5a85a0, 0xfcff6a17), TOBN(0x9970a3f3, 0x1eca7cee), + TOBN(0xbb9f0d6b, 0xc9504be3), TOBN(0xe0c504be, 0xadd24ee2)}, + {TOBN(0x7e09d956, 0x77fcc2f4), TOBN(0xef1a5227, 0x65bb5fc4), + TOBN(0x145d4fb1, 0x8b9286aa), TOBN(0x66fd0c5d, 0x6649028b)}}, + {{TOBN(0x98857ceb, 0x1bf4581c), TOBN(0xe635e186, 0xaca7b166), + TOBN(0x278ddd22, 0x659722ac), TOBN(0xa0903c4c, 0x1db68007)}, + {TOBN(0x366e4589, 0x48f21402), TOBN(0x31b49c14, 0xb96abda2), + TOBN(0x329c4b09, 0xe0403190), TOBN(0x97197ca3, 0xd29f43fe)}}, + {{TOBN(0x8073dd1e, 0x274983d8), TOBN(0xda1a3bde, 0x55717c8f), + TOBN(0xfd3d4da2, 0x0361f9d1), TOBN(0x1332d081, 0x4c7de1ce)}, + {TOBN(0x9b7ef7a3, 0xaa6d0e10), TOBN(0x17db2e73, 0xf54f1c4a), + TOBN(0xaf3dffae, 0x4cd35567), TOBN(0xaaa2f406, 0xe56f4e71)}}, + {{TOBN(0x8966759e, 0x7ace3fc7), TOBN(0x9594eacf, 0x45a8d8c6), + TOBN(0x8de3bd8b, 0x91834e0e), TOBN(0xafe4ca53, 0x548c0421)}, + {TOBN(0xfdd7e856, 0xe6ee81c6), TOBN(0x8f671beb, 0x6b891a3a), + TOBN(0xf7a58f2b, 0xfae63829), TOBN(0x9ab186fb, 0x9c11ac9f)}}, + {{TOBN(0x8d6eb369, 0x10b5be76), TOBN(0x046b7739, 0xfb040bcd), + TOBN(0xccb4529f, 0xcb73de88), TOBN(0x1df0fefc, 0xcf26be03)}, + {TOBN(0xad7757a6, 0xbcfcd027), TOBN(0xa8786c75, 0xbb3165ca), + TOBN(0xe9db1e34, 0x7e99a4d9), TOBN(0x99ee86df, 0xb06c504b)}}, + {{TOBN(0x5b7c2ddd, 0xc15c9f0a), TOBN(0xdf87a734, 0x4295989e), + TOBN(0x59ece47c, 0x03d08fda), TOBN(0xb074d3dd, 0xad5fc702)}, + {TOBN(0x20407903, 0x51a03776), TOBN(0x2bb1f77b, 0x2a608007), + TOBN(0x25c58f4f, 0xe1153185), TOBN(0xe6df62f6, 0x766e6447)}}, + {{TOBN(0xefb3d1be, 0xed51275a), TOBN(0x5de47dc7, 0x2f0f483f), + TOBN(0x7932d98e, 0x97c2bedf), TOBN(0xd5c11927, 0x0219f8a1)}, + {TOBN(0x9d751200, 0xa73a294e), TOBN(0x5f88434a, 0x9dc20172), + TOBN(0xd28d9fd3, 0xa26f506a), TOBN(0xa890cd31, 0x9d1dcd48)}}, + {{TOBN(0x0aebaec1, 0x70f4d3b4), TOBN(0xfd1a1369, 0x0ffc8d00), + TOBN(0xb9d9c240, 0x57d57838), TOBN(0x45929d26, 0x68bac361)}, + {TOBN(0x5a2cd060, 0x25b15ca6), TOBN(0x4b3c83e1, 0x6e474446), + TOBN(0x1aac7578, 0xee1e5134), TOBN(0xa418f5d6, 0xc91e2f41)}}, + {{TOBN(0x6936fc8a, 0x213ed68b), TOBN(0x860ae7ed, 0x510a5224), + TOBN(0x63660335, 0xdef09b53), TOBN(0x641b2897, 0xcd79c98d)}, + {TOBN(0x29bd38e1, 0x01110f35), TOBN(0x79c26f42, 0x648b1937), + TOBN(0x64dae519, 0x9d9164f4), TOBN(0xd85a2310, 0x0265c273)}}, + {{TOBN(0x7173dd5d, 0x4b07e2b1), TOBN(0xd144c4cb, 0x8d9ea221), + TOBN(0xe8b04ea4, 0x1105ab14), TOBN(0x92dda542, 0xfe80d8f1)}, + {TOBN(0xe9982fa8, 0xcf03dce6), TOBN(0x8b5ea965, 0x1a22cffc), + TOBN(0xf7f4ea7f, 0x3fad88c4), TOBN(0x62db773e, 0x6a5ba95c)}}, + {{TOBN(0xd20f02fb, 0x93f24567), TOBN(0xfd46c69a, 0x315257ca), + TOBN(0x0ac74cc7, 0x8bcab987), TOBN(0x46f31c01, 0x5ceca2f5)}, + {TOBN(0x40aedb59, 0x888b219e), TOBN(0xe50ecc37, 0xe1fccd02), + TOBN(0x1bcd9dad, 0x911f816c), TOBN(0x583cc1ec, 0x8db9b00c)}}, + {{TOBN(0xf3cd2e66, 0xa483bf11), TOBN(0xfa08a6f5, 0xb1b2c169), + TOBN(0xf375e245, 0x4be9fa28), TOBN(0x99a7ffec, 0x5b6d011f)}, + {TOBN(0x6a3ebddb, 0xc4ae62da), TOBN(0x6cea00ae, 0x374aef5d), + TOBN(0xab5fb98d, 0x9d4d05bc), TOBN(0x7cba1423, 0xd560f252)}}, + {{TOBN(0x49b2cc21, 0x208490de), TOBN(0x1ca66ec3, 0xbcfb2879), + TOBN(0x7f1166b7, 0x1b6fb16f), TOBN(0xfff63e08, 0x65fe5db3)}, + {TOBN(0xb8345abe, 0x8b2610be), TOBN(0xb732ed80, 0x39de3df4), + TOBN(0x0e24ed50, 0x211c32b4), TOBN(0xd10d8a69, 0x848ff27d)}}, + {{TOBN(0xc1074398, 0xed4de248), TOBN(0xd7cedace, 0x10488927), + TOBN(0xa4aa6bf8, 0x85673e13), TOBN(0xb46bae91, 0x6daf30af)}, + {TOBN(0x07088472, 0xfcef7ad8), TOBN(0x61151608, 0xd4b35e97), + TOBN(0xbcfe8f26, 0xdde29986), TOBN(0xeb84c4c7, 0xd5a34c79)}}, + {{TOBN(0xc1eec55c, 0x164e1214), TOBN(0x891be86d, 0xa147bb03), + TOBN(0x9fab4d10, 0x0ba96835), TOBN(0xbf01e9b8, 0xa5c1ae9f)}, + {TOBN(0x6b4de139, 0xb186ebc0), TOBN(0xd5c74c26, 0x85b91bca), + TOBN(0x5086a99c, 0xc2d93854), TOBN(0xeed62a7b, 0xa7a9dfbc)}}, + {{TOBN(0x8778ed6f, 0x76b7618a), TOBN(0xbff750a5, 0x03b66062), + TOBN(0x4cb7be22, 0xb65186db), TOBN(0x369dfbf0, 0xcc3a6d13)}, + {TOBN(0xc7dab26c, 0x7191a321), TOBN(0x9edac3f9, 0x40ed718e), + TOBN(0xbc142b36, 0xd0cfd183), TOBN(0xc8af82f6, 0x7c991693)}}, + {{TOBN(0xb3d1e4d8, 0x97ce0b2a), TOBN(0xe6d7c87f, 0xc3a55cdf), + TOBN(0x35846b95, 0x68b81afe), TOBN(0x018d12af, 0xd3c239d8)}, + {TOBN(0x2b2c6208, 0x01206e15), TOBN(0xe0e42453, 0xa3b882c6), + TOBN(0x854470a3, 0xa50162d5), TOBN(0x08157478, 0x7017a62a)}}, + {{TOBN(0x18bd3fb4, 0x820357c7), TOBN(0x992039ae, 0x6f1458ad), + TOBN(0x9a1df3c5, 0x25b44aa1), TOBN(0x2d780357, 0xed3d5281)}, + {TOBN(0x58cf7e4d, 0xc77ad4d4), TOBN(0xd49a7998, 0xf9df4fc4), + TOBN(0x4465a8b5, 0x1d71205e), TOBN(0xa0ee0ea6, 0x649254aa)}}, + {{TOBN(0x4b5eeecf, 0xab7bd771), TOBN(0x6c873073, 0x35c262b9), + TOBN(0xdc5bd648, 0x3c9d61e7), TOBN(0x233d6d54, 0x321460d2)}, + {TOBN(0xd20c5626, 0xfc195bcc), TOBN(0x25445958, 0x04d78b63), + TOBN(0xe03fcb3d, 0x17ec8ef3), TOBN(0x54b690d1, 0x46b8f781)}}, + {{TOBN(0x82fa2c8a, 0x21230646), TOBN(0xf51aabb9, 0x084f418c), + TOBN(0xff4fbec1, 0x1a30ba43), TOBN(0x6a5acf73, 0x743c9df7)}, + {TOBN(0x1da2b357, 0xd635b4d5), TOBN(0xc3de68dd, 0xecd5c1da), + TOBN(0xa689080b, 0xd61af0dd), TOBN(0xdea5938a, 0xd665bf99)}}, + {{TOBN(0x0231d71a, 0xfe637294), TOBN(0x01968aa6, 0xa5a81cd8), + TOBN(0x11252d50, 0x048e63b5), TOBN(0xc446bc52, 0x6ca007e9)}, + {TOBN(0xef8c50a6, 0x96d6134b), TOBN(0x9361fbf5, 0x9e09a05c), + TOBN(0xf17f85a6, 0xdca3291a), TOBN(0xb178d548, 0xff251a21)}}, + {{TOBN(0x87f6374b, 0xa4df3915), TOBN(0x566ce1bf, 0x2fd5d608), + TOBN(0x425cba4d, 0x7de35102), TOBN(0x6b745f8f, 0x58c5d5e2)}, + {TOBN(0x88402af6, 0x63122edf), TOBN(0x3190f9ed, 0x3b989a89), + TOBN(0x4ad3d387, 0xebba3156), TOBN(0xef385ad9, 0xc7c469a5)}}, + {{TOBN(0xb08281de, 0x3f642c29), TOBN(0x20be0888, 0x910ffb88), + TOBN(0xf353dd4a, 0xd5292546), TOBN(0x3f1627de, 0x8377a262)}, + {TOBN(0xa5faa013, 0xeefcd638), TOBN(0x8f3bf626, 0x74cc77c3), + TOBN(0x32618f65, 0xa348f55e), TOBN(0x5787c0dc, 0x9fefeb9e)}}, + {{TOBN(0xf1673aa2, 0xd9a23e44), TOBN(0x88dfa993, 0x4e10690d), + TOBN(0x1ced1b36, 0x2bf91108), TOBN(0x9193ceca, 0x3af48649)}, + {TOBN(0xfb34327d, 0x2d738fc5), TOBN(0x6697b037, 0x975fee6c), + TOBN(0x2f485da0, 0xc04079a5), TOBN(0x2cdf5735, 0x2feaa1ac)}}, + {{TOBN(0x76944420, 0xbd55659e), TOBN(0x7973e32b, 0x4376090c), + TOBN(0x86bb4fe1, 0x163b591a), TOBN(0x10441aed, 0xc196f0ca)}, + {TOBN(0x3b431f4a, 0x045ad915), TOBN(0x6c11b437, 0xa4afacb1), + TOBN(0x30b0c7db, 0x71fdbbd8), TOBN(0xb642931f, 0xeda65acd)}}, + {{TOBN(0x4baae6e8, 0x9c92b235), TOBN(0xa73bbd0e, 0x6b3993a1), + TOBN(0xd06d60ec, 0x693dd031), TOBN(0x03cab91b, 0x7156881c)}, + {TOBN(0xd615862f, 0x1db3574b), TOBN(0x485b0185, 0x64bb061a), + TOBN(0x27434988, 0xa0181e06), TOBN(0x2cd61ad4, 0xc1c0c757)}}, + {{TOBN(0x3effed5a, 0x2ff9f403), TOBN(0x8dc98d8b, 0x62239029), + TOBN(0x2206021e, 0x1f17b70d), TOBN(0xafbec0ca, 0xbf510015)}, + {TOBN(0x9fed7164, 0x80130dfa), TOBN(0x306dc2b5, 0x8a02dcf5), + TOBN(0x48f06620, 0xfeb10fc0), TOBN(0x78d1e1d5, 0x5a57cf51)}}, + {{TOBN(0xadef8c5a, 0x192ef710), TOBN(0x88afbd4b, 0x3b7431f9), + TOBN(0x7e1f7407, 0x64250c9e), TOBN(0x6e31318d, 0xb58bec07)}, + {TOBN(0xfd4fc4b8, 0x24f89b4e), TOBN(0x65a5dd88, 0x48c36a2a), + TOBN(0x4f1eccff, 0xf024baa7), TOBN(0x22a21cf2, 0xcba94650)}}, + {{TOBN(0x95d29dee, 0x42a554f7), TOBN(0x828983a5, 0x002ec4ba), + TOBN(0x8112a1f7, 0x8badb73d), TOBN(0x79ea8897, 0xa27c1839)}, + {TOBN(0x8969a5a7, 0xd065fd83), TOBN(0xf49af791, 0xb262a0bc), + TOBN(0xfcdea8b6, 0xaf2b5127), TOBN(0x10e913e1, 0x564c2dbc)}}, + {{TOBN(0x51239d14, 0xbc21ef51), TOBN(0xe51c3ceb, 0x4ce57292), + TOBN(0x795ff068, 0x47bbcc3b), TOBN(0x86b46e1e, 0xbd7e11e6)}, + {TOBN(0x0ea6ba23, 0x80041ef4), TOBN(0xd72fe505, 0x6262342e), + TOBN(0x8abc6dfd, 0x31d294d4), TOBN(0xbbe017a2, 0x1278c2c9)}}, + {{TOBN(0xb1fcfa09, 0xb389328a), TOBN(0x322fbc62, 0xd01771b5), + TOBN(0x04c0d063, 0x60b045bf), TOBN(0xdb652edc, 0x10e52d01)}, + {TOBN(0x50ef932c, 0x03ec6627), TOBN(0xde1b3b2d, 0xc1ee50e3), + TOBN(0x5ab7bdc5, 0xdc37a90d), TOBN(0xfea67213, 0x31e33a96)}}, + {{TOBN(0x6482b5cb, 0x4f2999aa), TOBN(0x38476cc6, 0xb8cbf0dd), + TOBN(0x93ebfacb, 0x173405bb), TOBN(0x15cdafe7, 0xe52369ec)}, + {TOBN(0xd42d5ba4, 0xd935b7db), TOBN(0x648b6004, 0x1c99a4cd), + TOBN(0x785101bd, 0xa3b5545b), TOBN(0x4bf2c38a, 0x9dd67faf)}}, + {{TOBN(0xb1aadc63, 0x4442449c), TOBN(0xe0e9921a, 0x33ad4fb8), + TOBN(0x5c552313, 0xaa686d82), TOBN(0xdee635fa, 0x465d866c)}, + {TOBN(0xbc3c224a, 0x18ee6e8a), TOBN(0xeed748a6, 0xed42e02f), + TOBN(0xe70f930a, 0xd474cd08), TOBN(0x774ea6ec, 0xfff24adf)}}, + {{TOBN(0x03e2de1c, 0xf3480d4a), TOBN(0xf0d8edc7, 0xbc8acf1a), + TOBN(0xf23e3303, 0x68295a9c), TOBN(0xfadd5f68, 0xc546a97d)}, + {TOBN(0x895597ad, 0x96f8acb1), TOBN(0xbddd49d5, 0x671bdae2), + TOBN(0x16fcd528, 0x21dd43f4), TOBN(0xa5a45412, 0x6619141a)}}}, + {{{TOBN(0x8ce9b6bf, 0xc360e25a), TOBN(0xe6425195, 0x075a1a78), + TOBN(0x9dc756a8, 0x481732f4), TOBN(0x83c0440f, 0x5432b57a)}, + {TOBN(0xc670b3f1, 0xd720281f), TOBN(0x2205910e, 0xd135e051), + TOBN(0xded14b0e, 0xdb052be7), TOBN(0x697b3d27, 0xc568ea39)}}, + {{TOBN(0x2e599b9a, 0xfb3ff9ed), TOBN(0x28c2e0ab, 0x17f6515c), + TOBN(0x1cbee4fd, 0x474da449), TOBN(0x071279a4, 0x4f364452)}, + {TOBN(0x97abff66, 0x01fbe855), TOBN(0x3ee394e8, 0x5fda51c4), + TOBN(0x190385f6, 0x67597c0b), TOBN(0x6e9fccc6, 0xa27ee34b)}}, + {{TOBN(0x0b89de93, 0x14092ebb), TOBN(0xf17256bd, 0x428e240c), + TOBN(0xcf89a7f3, 0x93d2f064), TOBN(0x4f57841e, 0xe1ed3b14)}, + {TOBN(0x4ee14405, 0xe708d855), TOBN(0x856aae72, 0x03f1c3d0), + TOBN(0xc8e5424f, 0xbdd7eed5), TOBN(0x3333e4ef, 0x73ab4270)}}, + {{TOBN(0x3bc77ade, 0xdda492f8), TOBN(0xc11a3aea, 0x78297205), + TOBN(0x5e89a3e7, 0x34931b4c), TOBN(0x17512e2e, 0x9f5694bb)}, + {TOBN(0x5dc349f3, 0x177bf8b6), TOBN(0x232ea4ba, 0x08c7ff3e), + TOBN(0x9c4f9d16, 0xf511145d), TOBN(0xccf109a3, 0x33b379c3)}}, + {{TOBN(0xe75e7a88, 0xa1f25897), TOBN(0x7ac6961f, 0xa1b5d4d8), + TOBN(0xe3e10773, 0x08f3ed5c), TOBN(0x208a54ec, 0x0a892dfb)}, + {TOBN(0xbe826e19, 0x78660710), TOBN(0x0cf70a97, 0x237df2c8), + TOBN(0x418a7340, 0xed704da5), TOBN(0xa3eeb9a9, 0x08ca33fd)}}, + {{TOBN(0x49d96233, 0x169bca96), TOBN(0x04d286d4, 0x2da6aafb), + TOBN(0xc09606ec, 0xa0c2fa94), TOBN(0x8869d0d5, 0x23ff0fb3)}, + {TOBN(0xa99937e5, 0xd0150d65), TOBN(0xa92e2503, 0x240c14c9), + TOBN(0x656bf945, 0x108e2d49), TOBN(0x152a733a, 0xa2f59e2b)}}, + {{TOBN(0xb4323d58, 0x8434a920), TOBN(0xc0af8e93, 0x622103c5), + TOBN(0x667518ef, 0x938dbf9a), TOBN(0xa1843073, 0x83a9cdf2)}, + {TOBN(0x350a94aa, 0x5447ab80), TOBN(0xe5e5a325, 0xc75a3d61), + TOBN(0x74ba507f, 0x68411a9e), TOBN(0x10581fc1, 0x594f70c5)}}, + {{TOBN(0x60e28570, 0x80eb24a9), TOBN(0x7bedfb4d, 0x488e0cfd), + TOBN(0x721ebbd7, 0xc259cdb8), TOBN(0x0b0da855, 0xbc6390a9)}, + {TOBN(0x2b4d04db, 0xde314c70), TOBN(0xcdbf1fbc, 0x6c32e846), + TOBN(0x33833eab, 0xb162fc9e), TOBN(0x9939b48b, 0xb0dd3ab7)}}, + {{TOBN(0x5aaa98a7, 0xcb0c9c8c), TOBN(0x75105f30, 0x81c4375c), + TOBN(0xceee5057, 0x5ef1c90f), TOBN(0xb31e065f, 0xc23a17bf)}, + {TOBN(0x5364d275, 0xd4b6d45a), TOBN(0xd363f3ad, 0x62ec8996), + TOBN(0xb5d21239, 0x4391c65b), TOBN(0x84564765, 0xebb41b47)}}, + {{TOBN(0x20d18ecc, 0x37107c78), TOBN(0xacff3b6b, 0x570c2a66), + TOBN(0x22f975d9, 0x9bd0d845), TOBN(0xef0a0c46, 0xba178fa0)}, + {TOBN(0x1a419651, 0x76b6028e), TOBN(0xc49ec674, 0x248612d4), + TOBN(0x5b6ac4f2, 0x7338af55), TOBN(0x06145e62, 0x7bee5a36)}}, + {{TOBN(0x33e95d07, 0xe75746b5), TOBN(0x1c1e1f6d, 0xc40c78be), + TOBN(0x967833ef, 0x222ff8e2), TOBN(0x4bedcf6a, 0xb49180ad)}, + {TOBN(0x6b37e9c1, 0x3d7a4c8a), TOBN(0x2748887c, 0x6ddfe760), + TOBN(0xf7055123, 0xaa3a5bbc), TOBN(0x954ff225, 0x7bbb8e74)}}, + {{TOBN(0xc42b8ab1, 0x97c3dfb9), TOBN(0x55a549b0, 0xcf168154), + TOBN(0xad6748e7, 0xc1b50692), TOBN(0x2775780f, 0x6fc5cbcb)}, + {TOBN(0x4eab80b8, 0xe1c9d7c8), TOBN(0x8c69dae1, 0x3fdbcd56), + TOBN(0x47e6b4fb, 0x9969eace), TOBN(0x002f1085, 0xa705cb5a)}}, + {{TOBN(0x4e23ca44, 0x6d3fea55), TOBN(0xb4ae9c86, 0xf4810568), + TOBN(0x47bfb91b, 0x2a62f27d), TOBN(0x60deb4c9, 0xd9bac28c)}, + {TOBN(0xa892d894, 0x7de6c34c), TOBN(0x4ee68259, 0x4494587d), + TOBN(0x914ee14e, 0x1a3f8a5b), TOBN(0xbb113eaa, 0x28700385)}}, + {{TOBN(0x81ca03b9, 0x2115b4c9), TOBN(0x7c163d38, 0x8908cad1), + TOBN(0xc912a118, 0xaa18179a), TOBN(0xe09ed750, 0x886e3081)}, + {TOBN(0xa676e3fa, 0x26f516ca), TOBN(0x753cacf7, 0x8e732f91), + TOBN(0x51592aea, 0x833da8b4), TOBN(0xc626f42f, 0x4cbea8aa)}}, + {{TOBN(0xef9dc899, 0xa7b56eaf), TOBN(0x00c0e52c, 0x34ef7316), + TOBN(0x5b1e4e24, 0xfe818a86), TOBN(0x9d31e20d, 0xc538be47)}, + {TOBN(0x22eb932d, 0x3ed68974), TOBN(0xe44bbc08, 0x7c4e87c4), + TOBN(0x4121086e, 0x0dde9aef), TOBN(0x8e6b9cff, 0x134f4345)}}, + {{TOBN(0x96892c1f, 0x711b0eb9), TOBN(0xb905f2c8, 0x780ab954), + TOBN(0xace26309, 0xa20792db), TOBN(0xec8ac9b3, 0x0684e126)}, + {TOBN(0x486ad8b6, 0xb40a2447), TOBN(0x60121fc1, 0x9fe3fb24), + TOBN(0x5626fccf, 0x1a8e3b3f), TOBN(0x4e568622, 0x6ad1f394)}}, + {{TOBN(0xda7aae0d, 0x196aa5a1), TOBN(0xe0df8c77, 0x1041b5fb), + TOBN(0x451465d9, 0x26b318b7), TOBN(0xc29b6e55, 0x7ab136e9)}, + {TOBN(0x2c2ab48b, 0x71148463), TOBN(0xb5738de3, 0x64454a76), + TOBN(0x54ccf9a0, 0x5a03abe4), TOBN(0x377c0296, 0x0427d58e)}}, + {{TOBN(0x73f5f0b9, 0x2bb39c1f), TOBN(0x14373f2c, 0xe608d8c5), + TOBN(0xdcbfd314, 0x00fbb805), TOBN(0xdf18fb20, 0x83afdcfb)}, + {TOBN(0x81a57f42, 0x42b3523f), TOBN(0xe958532d, 0x87f650fb), + TOBN(0xaa8dc8b6, 0x8b0a7d7c), TOBN(0x1b75dfb7, 0x150166be)}}, + {{TOBN(0x90e4f7c9, 0x2d7d1413), TOBN(0x67e2d6b5, 0x9834f597), + TOBN(0x4fd4f4f9, 0xa808c3e8), TOBN(0xaf8237e0, 0xd5281ec1)}, + {TOBN(0x25ab5fdc, 0x84687cee), TOBN(0xc5ded6b1, 0xa5b26c09), + TOBN(0x8e4a5aec, 0xc8ea7650), TOBN(0x23b73e5c, 0x14cc417f)}}, + {{TOBN(0x2bfb4318, 0x3037bf52), TOBN(0xb61e6db5, 0x78c725d7), + TOBN(0x8efd4060, 0xbbb3e5d7), TOBN(0x2e014701, 0xdbac488e)}, + {TOBN(0xac75cf9a, 0x360aa449), TOBN(0xb70cfd05, 0x79634d08), + TOBN(0xa591536d, 0xfffb15ef), TOBN(0xb2c37582, 0xd07c106c)}}, + {{TOBN(0xb4293fdc, 0xf50225f9), TOBN(0xc52e175c, 0xb0e12b03), + TOBN(0xf649c3ba, 0xd0a8bf64), TOBN(0x745a8fef, 0xeb8ae3c6)}, + {TOBN(0x30d7e5a3, 0x58321bc3), TOBN(0xb1732be7, 0x0bc4df48), + TOBN(0x1f217993, 0xe9ea5058), TOBN(0xf7a71cde, 0x3e4fd745)}}, + {{TOBN(0x86cc533e, 0x894c5bbb), TOBN(0x6915c7d9, 0x69d83082), + TOBN(0xa6aa2d05, 0x5815c244), TOBN(0xaeeee592, 0x49b22ce5)}, + {TOBN(0x89e39d13, 0x78135486), TOBN(0x3a275c1f, 0x16b76f2f), + TOBN(0xdb6bcc1b, 0xe036e8f5), TOBN(0x4df69b21, 0x5e4709f5)}}, + {{TOBN(0xa188b250, 0x2d0f39aa), TOBN(0x622118bb, 0x15a85947), + TOBN(0x2ebf520f, 0xfde0f4fa), TOBN(0xa40e9f29, 0x4860e539)}, + {TOBN(0x7b6a51eb, 0x22b57f0f), TOBN(0x849a33b9, 0x7e80644a), + TOBN(0x50e5d16f, 0x1cf095fe), TOBN(0xd754b54e, 0xec55f002)}}, + {{TOBN(0x5cfbbb22, 0x236f4a98), TOBN(0x0b0c59e9, 0x066800bb), + TOBN(0x4ac69a8f, 0x5a9a7774), TOBN(0x2b33f804, 0xd6bec948)}, + {TOBN(0xb3729295, 0x32e6c466), TOBN(0x68956d0f, 0x4e599c73), + TOBN(0xa47a249f, 0x155c31cc), TOBN(0x24d80f0d, 0xe1ce284e)}}, + {{TOBN(0xcd821dfb, 0x988baf01), TOBN(0xe6331a7d, 0xdbb16647), + TOBN(0x1eb8ad33, 0x094cb960), TOBN(0x593cca38, 0xc91bbca5)}, + {TOBN(0x384aac8d, 0x26567456), TOBN(0x40fa0309, 0xc04b6490), + TOBN(0x97834cd6, 0xdab6c8f6), TOBN(0x68a7318d, 0x3f91e55f)}}, + {{TOBN(0xa00fd04e, 0xfc4d3157), TOBN(0xb56f8ab2, 0x2bf3bdea), + TOBN(0x014f5648, 0x4fa57172), TOBN(0x948c5860, 0x450abdb3)}, + {TOBN(0x342b5df0, 0x0ebd4f08), TOBN(0x3e5168cd, 0x0e82938e), + TOBN(0x7aedc1ce, 0xb0df5dd0), TOBN(0x6bbbc6d9, 0xe5732516)}}, + {{TOBN(0xc7bfd486, 0x605daaa6), TOBN(0x46fd72b7, 0xbb9a6c9e), + TOBN(0xe4847fb1, 0xa124fb89), TOBN(0x75959cbd, 0xa2d8ffbc)}, + {TOBN(0x42579f65, 0xc8a588ee), TOBN(0x368c92e6, 0xb80b499d), + TOBN(0xea4ef6cd, 0x999a5df1), TOBN(0xaa73bb7f, 0x936fe604)}}, + {{TOBN(0xf347a70d, 0x6457d188), TOBN(0x86eda86b, 0x8b7a388b), + TOBN(0xb7cdff06, 0x0ccd6013), TOBN(0xbeb1b6c7, 0xd0053fb2)}, + {TOBN(0x0b022387, 0x99240a9f), TOBN(0x1bbb384f, 0x776189b2), + TOBN(0x8695e71e, 0x9066193a), TOBN(0x2eb50097, 0x06ffac7e)}}, + {{TOBN(0x0654a9c0, 0x4a7d2caa), TOBN(0x6f3fb3d1, 0xa5aaa290), + TOBN(0x835db041, 0xff476e8f), TOBN(0x540b8b0b, 0xc42295e4)}, + {TOBN(0xa5c73ac9, 0x05e214f5), TOBN(0x9a74075a, 0x56a0b638), + TOBN(0x2e4b1090, 0xce9e680b), TOBN(0x57a5b479, 0x6b8d9afa)}}, + {{TOBN(0x0dca48e7, 0x26bfe65c), TOBN(0x097e391c, 0x7290c307), + TOBN(0x683c462e, 0x6669e72e), TOBN(0xf505be1e, 0x062559ac)}, + {TOBN(0x5fbe3ea1, 0xe3a3035a), TOBN(0x6431ebf6, 0x9cd50da8), + TOBN(0xfd169d5c, 0x1f6407f2), TOBN(0x8d838a95, 0x60fce6b8)}}, + {{TOBN(0x2a2bfa7f, 0x650006f0), TOBN(0xdfd7dad3, 0x50c0fbb2), + TOBN(0x92452495, 0xccf9ad96), TOBN(0x183bf494, 0xd95635f9)}, + {TOBN(0x02d5df43, 0x4a7bd989), TOBN(0x505385cc, 0xa5431095), + TOBN(0xdd98e67d, 0xfd43f53e), TOBN(0xd61e1a6c, 0x500c34a9)}}, + {{TOBN(0x5a4b46c6, 0x4a8a3d62), TOBN(0x8469c4d0, 0x247743d2), + TOBN(0x2bb3a13d, 0x88f7e433), TOBN(0x62b23a10, 0x01be5849)}, + {TOBN(0xe83596b4, 0xa63d1a4c), TOBN(0x454e7fea, 0x7d183f3e), + TOBN(0x643fce61, 0x17afb01c), TOBN(0x4e65e5e6, 0x1c4c3638)}}, + {{TOBN(0x41d85ea1, 0xef74c45b), TOBN(0x2cfbfa66, 0xae328506), + TOBN(0x98b078f5, 0x3ada7da9), TOBN(0xd985fe37, 0xec752fbb)}, + {TOBN(0xeece68fe, 0x5a0148b4), TOBN(0x6f9a55c7, 0x2d78136d), + TOBN(0x232dccc4, 0xd2b729ce), TOBN(0xa27e0dfd, 0x90aafbc4)}}, + {{TOBN(0x96474452, 0x12b4603e), TOBN(0xa876c551, 0x6b706d14), + TOBN(0xdf145fcf, 0x69a9d412), TOBN(0xe2ab75b7, 0x2d479c34)}, + {TOBN(0x12df9a76, 0x1a23ff97), TOBN(0xc6138992, 0x5d359d10), + TOBN(0x6e51c7ae, 0xfa835f22), TOBN(0x69a79cb1, 0xc0fcc4d9)}}, + {{TOBN(0xf57f350d, 0x594cc7e1), TOBN(0x3079ca63, 0x3350ab79), + TOBN(0x226fb614, 0x9aff594a), TOBN(0x35afec02, 0x6d59a62b)}, + {TOBN(0x9bee46f4, 0x06ed2c6e), TOBN(0x58da1735, 0x7d939a57), + TOBN(0x44c50402, 0x8fd1797e), TOBN(0xd8853e7c, 0x5ccea6ca)}}, + {{TOBN(0x4065508d, 0xa35fcd5f), TOBN(0x8965df8c, 0x495ccaeb), + TOBN(0x0f2da850, 0x12e1a962), TOBN(0xee471b94, 0xc1cf1cc4)}, + {TOBN(0xcef19bc8, 0x0a08fb75), TOBN(0x704958f5, 0x81de3591), + TOBN(0x2867f8b2, 0x3aef4f88), TOBN(0x8d749384, 0xea9f9a5f)}}, + {{TOBN(0x1b385537, 0x8c9049f4), TOBN(0x5be948f3, 0x7b92d8b6), + TOBN(0xd96f725d, 0xb6e2bd6b), TOBN(0x37a222bc, 0x958c454d)}, + {TOBN(0xe7c61abb, 0x8809bf61), TOBN(0x46f07fbc, 0x1346f18d), + TOBN(0xfb567a7a, 0xe87c0d1c), TOBN(0x84a461c8, 0x7ef3d07a)}}, + {{TOBN(0x0a5adce6, 0xd9278d98), TOBN(0x24d94813, 0x9dfc73e1), + TOBN(0x4f3528b6, 0x054321c3), TOBN(0x2e03fdde, 0x692ea706)}, + {TOBN(0x10e60619, 0x47b533c0), TOBN(0x1a8bc73f, 0x2ca3c055), + TOBN(0xae58d4b2, 0x1bb62b8f), TOBN(0xb2045a73, 0x584a24e3)}}, + {{TOBN(0x3ab3d5af, 0xbd76e195), TOBN(0x478dd1ad, 0x6938a810), + TOBN(0x6ffab393, 0x6ee3d5cb), TOBN(0xdfb693db, 0x22b361e4)}, + {TOBN(0xf9694496, 0x51dbf1a7), TOBN(0xcab4b4ef, 0x08a2e762), + TOBN(0xe8c92f25, 0xd39bba9a), TOBN(0x850e61bc, 0xf1464d96)}}, + {{TOBN(0xb7e830e3, 0xdc09508b), TOBN(0xfaf6d2cf, 0x74317655), + TOBN(0x72606ceb, 0xdf690355), TOBN(0x48bb92b3, 0xd0c3ded6)}, + {TOBN(0x65b75484, 0x5c7cf892), TOBN(0xf6cd7ac9, 0xd5d5f01f), + TOBN(0xc2c30a59, 0x96401d69), TOBN(0x91268650, 0xed921878)}}, + {{TOBN(0x380bf913, 0xb78c558f), TOBN(0x43c0baeb, 0xc8afdaa9), + TOBN(0x377f61d5, 0x54f169d3), TOBN(0xf8da07e3, 0xae5ff20b)}, + {TOBN(0xb676c49d, 0xa8a90ea8), TOBN(0x81c1ff2b, 0x83a29b21), + TOBN(0x383297ac, 0x2ad8d276), TOBN(0x3001122f, 0xba89f982)}}, + {{TOBN(0xe1d794be, 0x6718e448), TOBN(0x246c1482, 0x7c3e6e13), + TOBN(0x56646ef8, 0x5d26b5ef), TOBN(0x80f5091e, 0x88069cdd)}, + {TOBN(0xc5992e2f, 0x724bdd38), TOBN(0x02e915b4, 0x8471e8c7), + TOBN(0x96ff320a, 0x0d0ff2a9), TOBN(0xbf886487, 0x4384d1a0)}}, + {{TOBN(0xbbe1e6a6, 0xc93f72d6), TOBN(0xd5f75d12, 0xcad800ea), + TOBN(0xfa40a09f, 0xe7acf117), TOBN(0x32c8cdd5, 0x7581a355)}, + {TOBN(0x74221992, 0x7023c499), TOBN(0xa8afe5d7, 0x38ec3901), + TOBN(0x5691afcb, 0xa90e83f0), TOBN(0x41bcaa03, 0x0b8f8eac)}}, + {{TOBN(0xe38b5ff9, 0x8d2668d5), TOBN(0x0715281a, 0x7ad81965), + TOBN(0x1bc8fc7c, 0x03c6ce11), TOBN(0xcbbee6e2, 0x8b650436)}, + {TOBN(0x06b00fe8, 0x0cdb9808), TOBN(0x17d6e066, 0xfe3ed315), + TOBN(0x2e9d38c6, 0x4d0b5018), TOBN(0xab8bfd56, 0x844dcaef)}}, + {{TOBN(0x42894a59, 0x513aed8b), TOBN(0xf77f3b6d, 0x314bd07a), + TOBN(0xbbdecb8f, 0x8e42b582), TOBN(0xf10e2fa8, 0xd2390fe6)}, + {TOBN(0xefb95022, 0x62a2f201), TOBN(0x4d59ea50, 0x50ee32b0), + TOBN(0xd87f7728, 0x6da789a8), TOBN(0xcf98a2cf, 0xf79492c4)}}, + {{TOBN(0xf9577239, 0x720943c2), TOBN(0xba044cf5, 0x3990b9d0), + TOBN(0x5aa8e823, 0x95f2884a), TOBN(0x834de6ed, 0x0278a0af)}, + {TOBN(0xc8e1ee9a, 0x5f25bd12), TOBN(0x9259ceaa, 0x6f7ab271), + TOBN(0x7e6d97a2, 0x77d00b76), TOBN(0x5c0c6eea, 0xa437832a)}}, + {{TOBN(0x5232c20f, 0x5606b81d), TOBN(0xabd7b375, 0x0d991ee5), + TOBN(0x4d2bfe35, 0x8632d951), TOBN(0x78f85146, 0x98ed9364)}, + {TOBN(0x951873f0, 0xf30c3282), TOBN(0x0da8ac80, 0xa789230b), + TOBN(0x3ac7789c, 0x5398967f), TOBN(0xa69b8f7f, 0xbdda0fb5)}}, + {{TOBN(0xe5db7717, 0x6add8545), TOBN(0x1b71cb66, 0x72c49b66), + TOBN(0xd8560739, 0x68421d77), TOBN(0x03840fe8, 0x83e3afea)}, + {TOBN(0xb391dad5, 0x1ec69977), TOBN(0xae243fb9, 0x307f6726), + TOBN(0xc88ac87b, 0xe8ca160c), TOBN(0x5174cced, 0x4ce355f4)}}, + {{TOBN(0x98a35966, 0xe58ba37d), TOBN(0xfdcc8da2, 0x7817335d), + TOBN(0x5b752830, 0x83fbc7bf), TOBN(0x68e419d4, 0xd9c96984)}, + {TOBN(0x409a39f4, 0x02a40380), TOBN(0x88940faf, 0x1fe977bc), + TOBN(0xc640a94b, 0x8f8edea6), TOBN(0x1e22cd17, 0xed11547d)}}, + {{TOBN(0xe28568ce, 0x59ffc3e2), TOBN(0x60aa1b55, 0xc1dee4e7), + TOBN(0xc67497c8, 0x837cb363), TOBN(0x06fb438a, 0x105a2bf2)}, + {TOBN(0x30357ec4, 0x500d8e20), TOBN(0x1ad9095d, 0x0670db10), + TOBN(0x7f589a05, 0xc73b7cfd), TOBN(0xf544607d, 0x880d6d28)}}, + {{TOBN(0x17ba93b1, 0xa20ef103), TOBN(0xad859130, 0x6ba6577b), + TOBN(0x65c91cf6, 0x6fa214a0), TOBN(0xd7d49c6c, 0x27990da5)}, + {TOBN(0xecd9ec8d, 0x20bb569d), TOBN(0xbd4b2502, 0xeeffbc33), + TOBN(0x2056ca5a, 0x6bed0467), TOBN(0x7916a1f7, 0x5b63728c)}}, + {{TOBN(0xd4f9497d, 0x53a4f566), TOBN(0x89734664, 0x97b56810), + TOBN(0xf8e1da74, 0x0494a621), TOBN(0x82546a93, 0x8d011c68)}, + {TOBN(0x1f3acb19, 0xc61ac162), TOBN(0x52f8fa9c, 0xabad0d3e), + TOBN(0x15356523, 0xb4b7ea43), TOBN(0x5a16ad61, 0xae608125)}}, + {{TOBN(0xb0bcb87f, 0x4faed184), TOBN(0x5f236b1d, 0x5029f45f), + TOBN(0xd42c7607, 0x0bc6b1fc), TOBN(0xc644324e, 0x68aefce3)}, + {TOBN(0x8e191d59, 0x5c5d8446), TOBN(0xc0208077, 0x13ae1979), + TOBN(0xadcaee55, 0x3ba59cc7), TOBN(0x20ed6d6b, 0xa2cb81ba)}}, + {{TOBN(0x0952ba19, 0xb6efcffc), TOBN(0x60f12d68, 0x97c0b87c), + TOBN(0x4ee2c7c4, 0x9caa30bc), TOBN(0x767238b7, 0x97fbff4e)}, + {TOBN(0xebc73921, 0x501b5d92), TOBN(0x3279e3df, 0xc2a37737), + TOBN(0x9fc12bc8, 0x6d197543), TOBN(0xfa94dc6f, 0x0a40db4e)}}, + {{TOBN(0x7392b41a, 0x530ccbbd), TOBN(0x87c82146, 0xea823525), + TOBN(0xa52f984c, 0x05d98d0c), TOBN(0x2ae57d73, 0x5ef6974c)}, + {TOBN(0x9377f7bf, 0x3042a6dd), TOBN(0xb1a007c0, 0x19647a64), + TOBN(0xfaa9079a, 0x0cca9767), TOBN(0x3d81a25b, 0xf68f72d5)}}, + {{TOBN(0x752067f8, 0xff81578e), TOBN(0x78622150, 0x9045447d), + TOBN(0xc0c22fcf, 0x0505aa6f), TOBN(0x1030f0a6, 0x6bed1c77)}, + {TOBN(0x31f29f15, 0x1f0bd739), TOBN(0x2d7989c7, 0xe6debe85), + TOBN(0x5c070e72, 0x8e677e98), TOBN(0x0a817bd3, 0x06e81fd5)}}, + {{TOBN(0xc110d830, 0xb0f2ac95), TOBN(0x48d0995a, 0xab20e64e), + TOBN(0x0f3e00e1, 0x7729cd9a), TOBN(0x2a570c20, 0xdd556946)}, + {TOBN(0x912dbcfd, 0x4e86214d), TOBN(0x2d014ee2, 0xcf615498), + TOBN(0x55e2b1e6, 0x3530d76e), TOBN(0xc5135ae4, 0xfd0fd6d1)}}, + {{TOBN(0x0066273a, 0xd4f3049f), TOBN(0xbb8e9893, 0xe7087477), + TOBN(0x2dba1ddb, 0x14c6e5fd), TOBN(0xdba37886, 0x51f57e6c)}, + {TOBN(0x5aaee0a6, 0x5a72f2cf), TOBN(0x1208bfbf, 0x7bea5642), + TOBN(0xf5c6aa3b, 0x67872c37), TOBN(0xd726e083, 0x43f93224)}}, + {{TOBN(0x1854daa5, 0x061f1658), TOBN(0xc0016df1, 0xdf0cd2b3), + TOBN(0xc2a3f23e, 0x833d50de), TOBN(0x73b681d2, 0xbbbd3017)}, + {TOBN(0x2f046dc4, 0x3ac343c0), TOBN(0x9c847e7d, 0x85716421), + TOBN(0xe1e13c91, 0x0917eed4), TOBN(0x3fc9eebd, 0x63a1b9c6)}}, + {{TOBN(0x0f816a72, 0x7fe02299), TOBN(0x6335ccc2, 0x294f3319), + TOBN(0x3820179f, 0x4745c5be), TOBN(0xe647b782, 0x922f066e)}, + {TOBN(0xc22e49de, 0x02cafb8a), TOBN(0x299bc2ff, 0xfcc2eccc), + TOBN(0x9a8feea2, 0x6e0e8282), TOBN(0xa627278b, 0xfe893205)}}, + {{TOBN(0xa7e19733, 0x7933e47b), TOBN(0xf4ff6b13, 0x2e766402), + TOBN(0xa4d8be0a, 0x98440d9f), TOBN(0x658f5c2f, 0x38938808)}, + {TOBN(0x90b75677, 0xc95b3b3e), TOBN(0xfa044269, 0x3137b6ff), + TOBN(0x077b039b, 0x43c47c29), TOBN(0xcca95dd3, 0x8a6445b2)}}, + {{TOBN(0x0b498ba4, 0x2333fc4c), TOBN(0x274f8e68, 0xf736a1b1), + TOBN(0x6ca348fd, 0x5f1d4b2e), TOBN(0x24d3be78, 0xa8f10199)}, + {TOBN(0x8535f858, 0xca14f530), TOBN(0xa6e7f163, 0x5b982e51), + TOBN(0x847c8512, 0x36e1bf62), TOBN(0xf6a7c58e, 0x03448418)}}, + {{TOBN(0x583f3703, 0xf9374ab6), TOBN(0x864f9195, 0x6e564145), + TOBN(0x33bc3f48, 0x22526d50), TOBN(0x9f323c80, 0x1262a496)}, + {TOBN(0xaa97a7ae, 0x3f046a9a), TOBN(0x70da183e, 0xdf8a039a), + TOBN(0x5b68f71c, 0x52aa0ba6), TOBN(0x9be0fe51, 0x21459c2d)}}, + {{TOBN(0xc1e17eb6, 0xcbc613e5), TOBN(0x33131d55, 0x497ea61c), + TOBN(0x2f69d39e, 0xaf7eded5), TOBN(0x73c2f434, 0xde6af11b)}, + {TOBN(0x4ca52493, 0xa4a375fa), TOBN(0x5f06787c, 0xb833c5c2), + TOBN(0x814e091f, 0x3e6e71cf), TOBN(0x76451f57, 0x8b746666)}}}, + {{{TOBN(0x80f9bdef, 0x694db7e0), TOBN(0xedca8787, 0xb9fcddc6), + TOBN(0x51981c34, 0x03b8dce1), TOBN(0x4274dcf1, 0x70e10ba1)}, + {TOBN(0xf72743b8, 0x6def6d1a), TOBN(0xd25b1670, 0xebdb1866), + TOBN(0xc4491e8c, 0x050c6f58), TOBN(0x2be2b2ab, 0x87fbd7f5)}}, + {{TOBN(0x3e0e5c9d, 0xd111f8ec), TOBN(0xbcc33f8d, 0xb7c4e760), + TOBN(0x702f9a91, 0xbd392a51), TOBN(0x7da4a795, 0xc132e92d)}, + {TOBN(0x1a0b0ae3, 0x0bb1151b), TOBN(0x54febac8, 0x02e32251), + TOBN(0xea3a5082, 0x694e9e78), TOBN(0xe58ffec1, 0xe4fe40b8)}}, + {{TOBN(0xf85592fc, 0xd1e0cf9e), TOBN(0xdea75f0d, 0xc0e7b2e8), + TOBN(0xc04215cf, 0xc135584e), TOBN(0x174fc727, 0x2f57092a)}, + {TOBN(0xe7277877, 0xeb930bea), TOBN(0x504caccb, 0x5eb02a5a), + TOBN(0xf9fe08f7, 0xf5241b9b), TOBN(0xe7fb62f4, 0x8d5ca954)}}, + {{TOBN(0xfbb8349d, 0x29c4120b), TOBN(0x9f94391f, 0xc0d0d915), + TOBN(0xc4074fa7, 0x5410ba51), TOBN(0xa66adbf6, 0x150a5911)}, + {TOBN(0xc164543c, 0x34bfca38), TOBN(0xe0f27560, 0xb9e1ccfc), + TOBN(0x99da0f53, 0xe820219c), TOBN(0xe8234498, 0xc6b4997a)}}, + {{TOBN(0xcfb88b76, 0x9d4c5423), TOBN(0x9e56eb10, 0xb0521c49), + TOBN(0x418e0b5e, 0xbe8700a1), TOBN(0x00cbaad6, 0xf93cb58a)}, + {TOBN(0xe923fbde, 0xd92a5e67), TOBN(0xca4979ac, 0x1f347f11), + TOBN(0x89162d85, 0x6bc0585b), TOBN(0xdd6254af, 0xac3c70e3)}}, + {{TOBN(0x7b23c513, 0x516e19e4), TOBN(0x56e2e847, 0xc5c4d593), + TOBN(0x9f727d73, 0x5ce71ef6), TOBN(0x5b6304a6, 0xf79a44c5)}, + {TOBN(0x6638a736, 0x3ab7e433), TOBN(0x1adea470, 0xfe742f83), + TOBN(0xe054b854, 0x5b7fc19f), TOBN(0xf935381a, 0xba1d0698)}}, + {{TOBN(0x546eab2d, 0x799e9a74), TOBN(0x96239e0e, 0xa949f729), + TOBN(0xca274c6b, 0x7090055a), TOBN(0x835142c3, 0x9020c9b0)}, + {TOBN(0xa405667a, 0xa2e8807f), TOBN(0x29f2c085, 0x1aa3d39e), + TOBN(0xcc555d64, 0x42fc72f5), TOBN(0xe856e0e7, 0xfbeacb3c)}}, + {{TOBN(0xb5504f9d, 0x918e4936), TOBN(0x65035ef6, 0xb2513982), + TOBN(0x0553a0c2, 0x6f4d9cb9), TOBN(0x6cb10d56, 0xbea85509)}, + {TOBN(0x48d957b7, 0xa242da11), TOBN(0x16a4d3dd, 0x672b7268), + TOBN(0x3d7e637c, 0x8502a96b), TOBN(0x27c7032b, 0x730d463b)}}, + {{TOBN(0xbdc02b18, 0xe4136a14), TOBN(0xbacf969d, 0x678e32bf), + TOBN(0xc98d89a3, 0xdd9c3c03), TOBN(0x7b92420a, 0x23becc4f)}, + {TOBN(0xd4b41f78, 0xc64d565c), TOBN(0x9f969d00, 0x10f28295), + TOBN(0xec7f7f76, 0xb13d051a), TOBN(0x08945e1e, 0xa92da585)}}, + {{TOBN(0x55366b7d, 0x5846426f), TOBN(0xe7d09e89, 0x247d441d), + TOBN(0x510b404d, 0x736fbf48), TOBN(0x7fa003d0, 0xe784bd7d)}, + {TOBN(0x25f7614f, 0x17fd9596), TOBN(0x49e0e0a1, 0x35cb98db), + TOBN(0x2c65957b, 0x2e83a76a), TOBN(0x5d40da8d, 0xcddbe0f8)}}, + {{TOBN(0xf2b8c405, 0x050bad24), TOBN(0x8918426d, 0xc2aa4823), + TOBN(0x2aeab3dd, 0xa38365a7), TOBN(0x72031717, 0x7c91b690)}, + {TOBN(0x8b00d699, 0x60a94120), TOBN(0x478a255d, 0xe99eaeec), + TOBN(0xbf656a5f, 0x6f60aafd), TOBN(0xdfd7cb75, 0x5dee77b3)}}, + {{TOBN(0x37f68bb4, 0xa595939d), TOBN(0x03556479, 0x28740217), + TOBN(0x8e740e7c, 0x84ad7612), TOBN(0xd89bc843, 0x9044695f)}, + {TOBN(0xf7f3da5d, 0x85a9184d), TOBN(0x562563bb, 0x9fc0b074), + TOBN(0x06d2e6aa, 0xf88a888e), TOBN(0x612d8643, 0x161fbe7c)}}, + {{TOBN(0x465edba7, 0xf64085e7), TOBN(0xb230f304, 0x29aa8511), + TOBN(0x53388426, 0xcda2d188), TOBN(0x90885735, 0x4b666649)}, + {TOBN(0x6f02ff9a, 0x652f54f6), TOBN(0x65c82294, 0x5fae2bf0), + TOBN(0x7816ade0, 0x62f5eee3), TOBN(0xdcdbdf43, 0xfcc56d70)}}, + {{TOBN(0x9fb3bba3, 0x54530bb2), TOBN(0xbde3ef77, 0xcb0869ea), + TOBN(0x89bc9046, 0x0b431163), TOBN(0x4d03d7d2, 0xe4819a35)}, + {TOBN(0x33ae4f9e, 0x43b6a782), TOBN(0x216db307, 0x9c88a686), + TOBN(0x91dd88e0, 0x00ffedd9), TOBN(0xb280da9f, 0x12bd4840)}}, + {{TOBN(0x32a7cb8a, 0x1635e741), TOBN(0xfe14008a, 0x78be02a7), + TOBN(0x3fafb334, 0x1b7ae030), TOBN(0x7fd508e7, 0x5add0ce9)}, + {TOBN(0x72c83219, 0xd607ad51), TOBN(0x0f229c0a, 0x8d40964a), + TOBN(0x1be2c336, 0x1c878da2), TOBN(0xe0c96742, 0xeab2ab86)}}, + {{TOBN(0x458f8691, 0x3e538cd7), TOBN(0xa7001f6c, 0x8e08ad53), + TOBN(0x52b8c6e6, 0xbf5d15ff), TOBN(0x548234a4, 0x011215dd)}, + {TOBN(0xff5a9d2d, 0x3d5b4045), TOBN(0xb0ffeeb6, 0x4a904190), + TOBN(0x55a3aca4, 0x48607f8b), TOBN(0x8cbd665c, 0x30a0672a)}}, + {{TOBN(0x87f834e0, 0x42583068), TOBN(0x02da2aeb, 0xf3f6e683), + TOBN(0x6b763e5d, 0x05c12248), TOBN(0x7230378f, 0x65a8aefc)}, + {TOBN(0x93bd80b5, 0x71e8e5ca), TOBN(0x53ab041c, 0xb3b62524), + TOBN(0x1b860513, 0x6c9c552e), TOBN(0xe84d402c, 0xd5524e66)}}, + {{TOBN(0xa37f3573, 0xf37f5937), TOBN(0xeb0f6c7d, 0xd1e4fca5), + TOBN(0x2965a554, 0xac8ab0fc), TOBN(0x17fbf56c, 0x274676ac)}, + {TOBN(0x2e2f6bd9, 0xacf7d720), TOBN(0x41fc8f88, 0x10224766), + TOBN(0x517a14b3, 0x85d53bef), TOBN(0xdae327a5, 0x7d76a7d1)}}, + {{TOBN(0x6ad0a065, 0xc4818267), TOBN(0x33aa189b, 0x37c1bbc1), + TOBN(0x64970b52, 0x27392a92), TOBN(0x21699a1c, 0x2d1535ea)}, + {TOBN(0xcd20779c, 0xc2d7a7fd), TOBN(0xe3186059, 0x99c83cf2), + TOBN(0x9b69440b, 0x72c0b8c7), TOBN(0xa81497d7, 0x7b9e0e4d)}}, + {{TOBN(0x515d5c89, 0x1f5f82dc), TOBN(0x9a7f67d7, 0x6361079e), + TOBN(0xa8da81e3, 0x11a35330), TOBN(0xe44990c4, 0x4b18be1b)}, + {TOBN(0xc7d5ed95, 0xaf103e59), TOBN(0xece8aba7, 0x8dac9261), + TOBN(0xbe82b099, 0x9394b8d3), TOBN(0x6830f09a, 0x16adfe83)}}, + {{TOBN(0x250a29b4, 0x88172d01), TOBN(0x8b20bd65, 0xcaff9e02), + TOBN(0xb8a7661e, 0xe8a6329a), TOBN(0x4520304d, 0xd3fce920)}, + {TOBN(0xae45da1f, 0x2b47f7ef), TOBN(0xe07f5288, 0x5bffc540), + TOBN(0xf7997009, 0x3464f874), TOBN(0x2244c2cd, 0xa6fa1f38)}}, + {{TOBN(0x43c41ac1, 0x94d7d9b1), TOBN(0x5bafdd82, 0xc82e7f17), + TOBN(0xdf0614c1, 0x5fda0fca), TOBN(0x74b043a7, 0xa8ae37ad)}, + {TOBN(0x3ba6afa1, 0x9e71734c), TOBN(0x15d5437e, 0x9c450f2e), + TOBN(0x4a5883fe, 0x67e242b1), TOBN(0x5143bdc2, 0x2c1953c2)}}, + {{TOBN(0x542b8b53, 0xfc5e8920), TOBN(0x363bf9a8, 0x9a9cee08), + TOBN(0x02375f10, 0xc3486e08), TOBN(0x2037543b, 0x8c5e70d2)}, + {TOBN(0x7109bccc, 0x625640b4), TOBN(0xcbc1051e, 0x8bc62c3b), + TOBN(0xf8455fed, 0x803f26ea), TOBN(0x6badceab, 0xeb372424)}}, + {{TOBN(0xa2a9ce7c, 0x6b53f5f9), TOBN(0x64246595, 0x1b176d99), + TOBN(0xb1298d36, 0xb95c081b), TOBN(0x53505bb8, 0x1d9a9ee6)}, + {TOBN(0x3f6f9e61, 0xf2ba70b0), TOBN(0xd07e16c9, 0x8afad453), + TOBN(0x9f1694bb, 0xe7eb4a6a), TOBN(0xdfebced9, 0x3cb0bc8e)}}, + {{TOBN(0x92d3dcdc, 0x53868c8b), TOBN(0x174311a2, 0x386107a6), + TOBN(0x4109e07c, 0x689b4e64), TOBN(0x30e4587f, 0x2df3dcb6)}, + {TOBN(0x841aea31, 0x0811b3b2), TOBN(0x6144d41d, 0x0cce43ea), + TOBN(0x464c4581, 0x2a9a7803), TOBN(0xd03d371f, 0x3e158930)}}, + {{TOBN(0xc676d7f2, 0xb1f3390b), TOBN(0x9f7a1b8c, 0xa5b61272), + TOBN(0x4ebebfc9, 0xc2e127a9), TOBN(0x4602500c, 0x5dd997bf)}, + {TOBN(0x7f09771c, 0x4711230f), TOBN(0x058eb37c, 0x020f09c1), + TOBN(0xab693d4b, 0xfee5e38b), TOBN(0x9289eb1f, 0x4653cbc0)}}, + {{TOBN(0xbecf46ab, 0xd51b9cf5), TOBN(0xd2aa9c02, 0x9f0121af), + TOBN(0x36aaf7d2, 0xe90dc274), TOBN(0x909e4ea0, 0x48b95a3c)}, + {TOBN(0xe6b70496, 0x6f32dbdb), TOBN(0x672188a0, 0x8b030b3e), + TOBN(0xeeffe5b3, 0xcfb617e2), TOBN(0x87e947de, 0x7c82709e)}}, + {{TOBN(0xa44d2b39, 0x1770f5a7), TOBN(0xe4d4d791, 0x0e44eb82), + TOBN(0x42e69d1e, 0x3f69712a), TOBN(0xbf11c4d6, 0xac6a820e)}, + {TOBN(0xb5e7f3e5, 0x42c4224c), TOBN(0xd6b4e81c, 0x449d941c), + TOBN(0x5d72bd16, 0x5450e878), TOBN(0x6a61e28a, 0xee25ac54)}}, + {{TOBN(0x33272094, 0xe6f1cd95), TOBN(0x7512f30d, 0x0d18673f), + TOBN(0x32f7a4ca, 0x5afc1464), TOBN(0x2f095656, 0x6bbb977b)}, + {TOBN(0x586f47ca, 0xa8226200), TOBN(0x02c868ad, 0x1ac07369), + TOBN(0x4ef2b845, 0xc613acbe), TOBN(0x43d7563e, 0x0386054c)}}, + {{TOBN(0x54da9dc7, 0xab952578), TOBN(0xb5423df2, 0x26e84d0b), + TOBN(0xa8b64eeb, 0x9b872042), TOBN(0xac205782, 0x5990f6df)}, + {TOBN(0x4ff696eb, 0x21f4c77a), TOBN(0x1a79c3e4, 0xaab273af), + TOBN(0x29bc922e, 0x9436b3f1), TOBN(0xff807ef8, 0xd6d9a27a)}}, + {{TOBN(0x82acea3d, 0x778f22a0), TOBN(0xfb10b2e8, 0x5b5e7469), + TOBN(0xc0b16980, 0x2818ee7d), TOBN(0x011afff4, 0xc91c1a2f)}, + {TOBN(0x95a6d126, 0xad124418), TOBN(0x31c081a5, 0xe72e295f), + TOBN(0x36bb283a, 0xf2f4db75), TOBN(0xd115540f, 0x7acef462)}}, + {{TOBN(0xc7f3a8f8, 0x33f6746c), TOBN(0x21e46f65, 0xfea990ca), + TOBN(0x915fd5c5, 0xcaddb0a9), TOBN(0xbd41f016, 0x78614555)}, + {TOBN(0x346f4434, 0x426ffb58), TOBN(0x80559436, 0x14dbc204), + TOBN(0xf3dd20fe, 0x5a969b7f), TOBN(0x9d59e956, 0xe899a39a)}}, + {{TOBN(0xf1b0971c, 0x8ad4cf4b), TOBN(0x03448860, 0x2ffb8fb8), + TOBN(0xf071ac3c, 0x65340ba4), TOBN(0x408d0596, 0xb27fd758)}, + {TOBN(0xe7c78ea4, 0x98c364b0), TOBN(0xa4aac4a5, 0x051e8ab5), + TOBN(0xb9e1d560, 0x485d9002), TOBN(0x9acd518a, 0x88844455)}}, + {{TOBN(0xe4ca688f, 0xd06f56c0), TOBN(0xa48af70d, 0xdf027972), + TOBN(0x691f0f04, 0x5e9a609d), TOBN(0xa9dd82cd, 0xee61270e)}, + {TOBN(0x8903ca63, 0xa0ef18d3), TOBN(0x9fb7ee35, 0x3d6ca3bd), + TOBN(0xa7b4a09c, 0xabf47d03), TOBN(0x4cdada01, 0x1c67de8e)}}, + {{TOBN(0x52003749, 0x9355a244), TOBN(0xe77fd2b6, 0x4f2151a9), + TOBN(0x695d6cf6, 0x66b4efcb), TOBN(0xc5a0cacf, 0xda2cfe25)}, + {TOBN(0x104efe5c, 0xef811865), TOBN(0xf52813e8, 0x9ea5cc3d), + TOBN(0x855683dc, 0x40b58dbc), TOBN(0x0338ecde, 0x175fcb11)}}, + {{TOBN(0xf9a05637, 0x74921592), TOBN(0xb4f1261d, 0xb9bb9d31), + TOBN(0x551429b7, 0x4e9c5459), TOBN(0xbe182e6f, 0x6ea71f53)}, + {TOBN(0xd3a3b07c, 0xdfc50573), TOBN(0x9ba1afda, 0x62be8d44), + TOBN(0x9bcfd2cb, 0x52ab65d3), TOBN(0xdf11d547, 0xa9571802)}}, + {{TOBN(0x099403ee, 0x02a2404a), TOBN(0x497406f4, 0x21088a71), + TOBN(0x99479409, 0x5004ae71), TOBN(0xbdb42078, 0xa812c362)}, + {TOBN(0x2b72a30f, 0xd8828442), TOBN(0x283add27, 0xfcb5ed1c), + TOBN(0xf7c0e200, 0x66a40015), TOBN(0x3e3be641, 0x08b295ef)}}, + {{TOBN(0xac127dc1, 0xe038a675), TOBN(0x729deff3, 0x8c5c6320), + TOBN(0xb7df8fd4, 0xa90d2c53), TOBN(0x9b74b0ec, 0x681e7cd3)}, + {TOBN(0x5cb5a623, 0xdab407e5), TOBN(0xcdbd3615, 0x76b340c6), + TOBN(0xa184415a, 0x7d28392c), TOBN(0xc184c1d8, 0xe96f7830)}}, + {{TOBN(0xc3204f19, 0x81d3a80f), TOBN(0xfde0c841, 0xc8e02432), + TOBN(0x78203b3e, 0x8149e0c1), TOBN(0x5904bdbb, 0x08053a73)}, + {TOBN(0x30fc1dd1, 0x101b6805), TOBN(0x43c223bc, 0x49aa6d49), + TOBN(0x9ed67141, 0x7a174087), TOBN(0x311469a0, 0xd5997008)}}, + {{TOBN(0xb189b684, 0x5e43fc61), TOBN(0xf3282375, 0xe0d3ab57), + TOBN(0x4fa34b67, 0xb1181da8), TOBN(0x621ed0b2, 0x99ee52b8)}, + {TOBN(0x9b178de1, 0xad990676), TOBN(0xd51de67b, 0x56d54065), + TOBN(0x2a2c27c4, 0x7538c201), TOBN(0x33856ec8, 0x38a40f5c)}}, + {{TOBN(0x2522fc15, 0xbe6cdcde), TOBN(0x1e603f33, 0x9f0c6f89), + TOBN(0x7994edc3, 0x103e30a6), TOBN(0x033a00db, 0x220c853e)}, + {TOBN(0xd3cfa409, 0xf7bb7fd7), TOBN(0x70f8781e, 0x462d18f6), + TOBN(0xbbd82980, 0x687fe295), TOBN(0x6eef4c32, 0x595669f3)}}, + {{TOBN(0x86a9303b, 0x2f7e85c3), TOBN(0x5fce4621, 0x71988f9b), + TOBN(0x5b935bf6, 0xc138acb5), TOBN(0x30ea7d67, 0x25661212)}, + {TOBN(0xef1eb5f4, 0xe51ab9a2), TOBN(0x0587c98a, 0xae067c78), + TOBN(0xb3ce1b3c, 0x77ca9ca6), TOBN(0x2a553d4d, 0x54b5f057)}}, + {{TOBN(0xc7898236, 0x4da29ec2), TOBN(0xdbdd5d13, 0xb9c57316), + TOBN(0xc57d6e6b, 0x2cd80d47), TOBN(0x80b460cf, 0xfe9e7391)}, + {TOBN(0x98648cab, 0xf963c31e), TOBN(0x67f9f633, 0xcc4d32fd), + TOBN(0x0af42a9d, 0xfdf7c687), TOBN(0x55f292a3, 0x0b015ea7)}}, + {{TOBN(0x89e468b2, 0xcd21ab3d), TOBN(0xe504f022, 0xc393d392), + TOBN(0xab21e1d4, 0xa5013af9), TOBN(0xe3283f78, 0xc2c28acb)}, + {TOBN(0xf38b35f6, 0x226bf99f), TOBN(0xe8354274, 0x0e291e69), + TOBN(0x61673a15, 0xb20c162d), TOBN(0xc101dc75, 0xb04fbdbe)}}, + {{TOBN(0x8323b4c2, 0x255bd617), TOBN(0x6c969693, 0x6c2a9154), + TOBN(0xc6e65860, 0x62679387), TOBN(0x8e01db0c, 0xb8c88e23)}, + {TOBN(0x33c42873, 0x893a5559), TOBN(0x7630f04b, 0x47a3e149), + TOBN(0xb5d80805, 0xddcf35f8), TOBN(0x582ca080, 0x77dfe732)}}, + {{TOBN(0x2c7156e1, 0x0b1894a0), TOBN(0x92034001, 0xd81c68c0), + TOBN(0xed225d00, 0xc8b115b5), TOBN(0x237f9c22, 0x83b907f2)}, + {TOBN(0x0ea2f32f, 0x4470e2c0), TOBN(0xb725f7c1, 0x58be4e95), + TOBN(0x0f1dcafa, 0xb1ae5463), TOBN(0x59ed5187, 0x1ba2fc04)}}, + {{TOBN(0xf6e0f316, 0xd0115d4d), TOBN(0x5180b12f, 0xd3691599), + TOBN(0x157e32c9, 0x527f0a41), TOBN(0x7b0b081d, 0xa8e0ecc0)}, + {TOBN(0x6dbaaa8a, 0xbf4f0dd0), TOBN(0x99b289c7, 0x4d252696), + TOBN(0x79b7755e, 0xdbf864fe), TOBN(0x6974e2b1, 0x76cad3ab)}}, + {{TOBN(0x35dbbee2, 0x06ddd657), TOBN(0xe7cbdd11, 0x2ff3a96d), + TOBN(0x88381968, 0x076be758), TOBN(0x2d737e72, 0x08c91f5d)}, + {TOBN(0x5f83ab62, 0x86ec3776), TOBN(0x98aa649d, 0x945fa7a1), + TOBN(0xf477ec37, 0x72ef0933), TOBN(0x66f52b1e, 0x098c17b1)}}, + {{TOBN(0x9eec58fb, 0xd803738b), TOBN(0x91aaade7, 0xe4e86aa4), + TOBN(0x6b1ae617, 0xa5b51492), TOBN(0x63272121, 0xbbc45974)}, + {TOBN(0x7e0e28f0, 0x862c5129), TOBN(0x0a8f79a9, 0x3321a4a0), + TOBN(0xe26d1664, 0x5041c88f), TOBN(0x0571b805, 0x53233e3a)}}, + {{TOBN(0xd1b0ccde, 0xc9520711), TOBN(0x55a9e4ed, 0x3c8b84bf), + TOBN(0x9426bd39, 0xa1fef314), TOBN(0x4f5f638e, 0x6eb93f2b)}, + {TOBN(0xba2a1ed3, 0x2bf9341b), TOBN(0xd63c1321, 0x4d42d5a9), + TOBN(0xd2964a89, 0x316dc7c5), TOBN(0xd1759606, 0xca511851)}}, + {{TOBN(0xd8a9201f, 0xf9e6ed35), TOBN(0xb7b5ee45, 0x6736925a), + TOBN(0x0a83fbbc, 0x99581af7), TOBN(0x3076bc40, 0x64eeb051)}, + {TOBN(0x5511c98c, 0x02dec312), TOBN(0x270de898, 0x238dcb78), + TOBN(0x2cf4cf9c, 0x539c08c9), TOBN(0xa70cb65e, 0x38d3b06e)}}, + {{TOBN(0xb12ec10e, 0xcfe57bbd), TOBN(0x82c7b656, 0x35a0c2b5), + TOBN(0xddc7d5cd, 0x161c67bd), TOBN(0xe32e8985, 0xae3a32cc)}, + {TOBN(0x7aba9444, 0xd11a5529), TOBN(0xe964ed02, 0x2427fa1a), + TOBN(0x1528392d, 0x24a1770a), TOBN(0xa152ce2c, 0x12c72fcd)}}, + {{TOBN(0x714553a4, 0x8ec07649), TOBN(0x18b4c290, 0x459dd453), + TOBN(0xea32b714, 0x7b64b110), TOBN(0xb871bfa5, 0x2e6f07a2)}, + {TOBN(0xb67112e5, 0x9e2e3c9b), TOBN(0xfbf250e5, 0x44aa90f6), + TOBN(0xf77aedb8, 0xbd539006), TOBN(0x3b0cdf9a, 0xd172a66f)}}, + {{TOBN(0xedf69fea, 0xf8c51187), TOBN(0x05bb67ec, 0x741e4da7), + TOBN(0x47df0f32, 0x08114345), TOBN(0x56facb07, 0xbb9792b1)}, + {TOBN(0xf3e007e9, 0x8f6229e4), TOBN(0x62d103f4, 0x526fba0f), + TOBN(0x4f33bef7, 0xb0339d79), TOBN(0x9841357b, 0xb59bfec1)}}, + {{TOBN(0xfa8dbb59, 0xc34e6705), TOBN(0xc3c7180b, 0x7fdaa84c), + TOBN(0xf95872fc, 0xa4108537), TOBN(0x8750cc3b, 0x932a3e5a)}, + {TOBN(0xb61cc69d, 0xb7275d7d), TOBN(0xffa0168b, 0x2e59b2e9), + TOBN(0xca032abc, 0x6ecbb493), TOBN(0x1d86dbd3, 0x2c9082d8)}}, + {{TOBN(0xae1e0b67, 0xe28ef5ba), TOBN(0x2c9a4699, 0xcb18e169), + TOBN(0x0ecd0e33, 0x1e6bbd20), TOBN(0x571b360e, 0xaf5e81d2)}, + {TOBN(0xcd9fea58, 0x101c1d45), TOBN(0x6651788e, 0x18880452), + TOBN(0xa9972635, 0x1f8dd446), TOBN(0x44bed022, 0xe37281d0)}}, + {{TOBN(0x094b2b2d, 0x33da525d), TOBN(0xf193678e, 0x13144fd8), + TOBN(0xb8ab5ba4, 0xf4c1061d), TOBN(0x4343b5fa, 0xdccbe0f4)}, + {TOBN(0xa8702371, 0x63812713), TOBN(0x47bf6d2d, 0xf7611d93), + TOBN(0x46729b8c, 0xbd21e1d7), TOBN(0x7484d4e0, 0xd629e77d)}}, + {{TOBN(0x830e6eea, 0x60dbac1f), TOBN(0x23d8c484, 0xda06a2f7), + TOBN(0x896714b0, 0x50ca535b), TOBN(0xdc8d3644, 0xebd97a9b)}, + {TOBN(0x106ef9fa, 0xb12177b4), TOBN(0xf79bf464, 0x534d5d9c), + TOBN(0x2537a349, 0xa6ab360b), TOBN(0xc7c54253, 0xa00c744f)}}, + {{TOBN(0xb3c7a047, 0xe5911a76), TOBN(0x61ffa5c8, 0x647f1ee7), + TOBN(0x15aed36f, 0x8f56ab42), TOBN(0x6a0d41b0, 0xa3ff9ac9)}, + {TOBN(0x68f469f5, 0xcc30d357), TOBN(0xbe9adf81, 0x6b72be96), + TOBN(0x1cd926fe, 0x903ad461), TOBN(0x7e89e38f, 0xcaca441b)}}, + {{TOBN(0xf0f82de5, 0xfacf69d4), TOBN(0x363b7e76, 0x4775344c), + TOBN(0x6894f312, 0xb2e36d04), TOBN(0x3c6cb4fe, 0x11d1c9a5)}, + {TOBN(0x85d9c339, 0x4008e1f2), TOBN(0x5e9a85ea, 0x249f326c), + TOBN(0xdc35c60a, 0x678c5e06), TOBN(0xc08b944f, 0x9f86fba9)}}, + {{TOBN(0xde40c02c, 0x89f71f0f), TOBN(0xad8f3e31, 0xff3da3c0), + TOBN(0x3ea5096b, 0x42125ded), TOBN(0x13879cbf, 0xa7379183)}, + {TOBN(0x6f4714a5, 0x6b306a0b), TOBN(0x359c2ea6, 0x67646c5e), + TOBN(0xfacf8943, 0x07726368), TOBN(0x07a58935, 0x65ff431e)}}, + {{TOBN(0x24d661d1, 0x68754ab0), TOBN(0x801fce1d, 0x6f429a76), + TOBN(0xc068a85f, 0xa58ce769), TOBN(0xedc35c54, 0x5d5eca2b)}, + {TOBN(0xea31276f, 0xa3f660d1), TOBN(0xa0184ebe, 0xb8fc7167), + TOBN(0x0f20f21a, 0x1d8db0ae), TOBN(0xd96d095f, 0x56c35e12)}}, + {{TOBN(0xedf402b5, 0xf8c2a25b), TOBN(0x1bb772b9, 0x059204b6), + TOBN(0x50cbeae2, 0x19b4e34c), TOBN(0x93109d80, 0x3fa0845a)}, + {TOBN(0x54f7ccf7, 0x8ef59fb5), TOBN(0x3b438fe2, 0x88070963), + TOBN(0x9e28c659, 0x31f3ba9b), TOBN(0x9cc31b46, 0xead9da92)}}, + {{TOBN(0x3c2f0ba9, 0xb733aa5f), TOBN(0xdece47cb, 0xf05af235), + TOBN(0xf8e3f715, 0xa2ac82a5), TOBN(0xc97ba641, 0x2203f18a)}, + {TOBN(0xc3af5504, 0x09c11060), TOBN(0x56ea2c05, 0x46af512d), + TOBN(0xfac28daf, 0xf3f28146), TOBN(0x87fab43a, 0x959ef494)}}}, + {{{TOBN(0x09891641, 0xd4c5105f), TOBN(0x1ae80f8e, 0x6d7fbd65), + TOBN(0x9d67225f, 0xbee6bdb0), TOBN(0x3b433b59, 0x7fc4d860)}, + {TOBN(0x44e66db6, 0x93e85638), TOBN(0xf7b59252, 0xe3e9862f), + TOBN(0xdb785157, 0x665c32ec), TOBN(0x702fefd7, 0xae362f50)}}, + {{TOBN(0x3754475d, 0x0fefb0c3), TOBN(0xd48fb56b, 0x46d7c35d), + TOBN(0xa070b633, 0x363798a4), TOBN(0xae89f3d2, 0x8fdb98e6)}, + {TOBN(0x970b89c8, 0x6363d14c), TOBN(0x89817521, 0x67abd27d), + TOBN(0x9bf7d474, 0x44d5a021), TOBN(0xb3083baf, 0xcac72aee)}}, + {{TOBN(0x389741de, 0xbe949a44), TOBN(0x638e9388, 0x546a4fa5), + TOBN(0x3fe6419c, 0xa0047bdc), TOBN(0x7047f648, 0xaaea57ca)}, + {TOBN(0x54e48a90, 0x41fbab17), TOBN(0xda8e0b28, 0x576bdba2), + TOBN(0xe807eebc, 0xc72afddc), TOBN(0x07d3336d, 0xf42577bf)}}, + {{TOBN(0x62a8c244, 0xbfe20925), TOBN(0x91c19ac3, 0x8fdce867), + TOBN(0x5a96a5d5, 0xdd387063), TOBN(0x61d587d4, 0x21d324f6)}, + {TOBN(0xe87673a2, 0xa37173ea), TOBN(0x23848008, 0x53778b65), + TOBN(0x10f8441e, 0x05bab43e), TOBN(0xfa11fe12, 0x4621efbe)}}, + {{TOBN(0x047b772e, 0x81685d7b), TOBN(0x23f27d81, 0xbf34a976), + TOBN(0xc27608e2, 0x915f48ef), TOBN(0x3b0b43fa, 0xa521d5c3)}, + {TOBN(0x7613fb26, 0x63ca7284), TOBN(0x7f5729b4, 0x1d4db837), + TOBN(0x87b14898, 0x583b526b), TOBN(0x00b732a6, 0xbbadd3d1)}}, + {{TOBN(0x8e02f426, 0x2048e396), TOBN(0x436b50b6, 0x383d9de4), + TOBN(0xf78d3481, 0x471e85ad), TOBN(0x8b01ea6a, 0xd005c8d6)}, + {TOBN(0xd3c7afee, 0x97015c07), TOBN(0x46cdf1a9, 0x4e3ba2ae), + TOBN(0x7a42e501, 0x83d3a1d2), TOBN(0xd54b5268, 0xb541dff4)}}, + {{TOBN(0x3f24cf30, 0x4e23e9bc), TOBN(0x4387f816, 0x126e3624), + TOBN(0x26a46a03, 0x3b0b6d61), TOBN(0xaf1bc845, 0x8b2d777c)}, + {TOBN(0x25c401ba, 0x527de79c), TOBN(0x0e1346d4, 0x4261bbb6), + TOBN(0x4b96c44b, 0x287b4bc7), TOBN(0x658493c7, 0x5254562f)}}, + {{TOBN(0x23f949fe, 0xb8a24a20), TOBN(0x17ebfed1, 0xf52ca53f), + TOBN(0x9b691bbe, 0xbcfb4853), TOBN(0x5617ff6b, 0x6278a05d)}, + {TOBN(0x241b34c5, 0xe3c99ebd), TOBN(0xfc64242e, 0x1784156a), + TOBN(0x4206482f, 0x695d67df), TOBN(0xb967ce0e, 0xee27c011)}}, + {{TOBN(0x65db3751, 0x21c80b5d), TOBN(0x2e7a563c, 0xa31ecca0), + TOBN(0xe56ffc4e, 0x5238a07e), TOBN(0x3d6c2966, 0x32ced854)}, + {TOBN(0xe99d7d1a, 0xaf70b885), TOBN(0xafc3bad9, 0x2d686459), + TOBN(0x9c78bf46, 0x0cc8ba5b), TOBN(0x5a439519, 0x18955aa3)}}, + {{TOBN(0xf8b517a8, 0x5fe4e314), TOBN(0xe60234d0, 0xfcb8906f), + TOBN(0xffe542ac, 0xf2061b23), TOBN(0x287e191f, 0x6b4cb59c)}, + {TOBN(0x21857ddc, 0x09d877d8), TOBN(0x1c23478c, 0x14678941), + TOBN(0xbbf0c056, 0xb6e05ea4), TOBN(0x82da4b53, 0xb01594fe)}}, + {{TOBN(0xf7526791, 0xfadb8608), TOBN(0x049e832d, 0x7b74cdf6), + TOBN(0xa43581cc, 0xc2b90a34), TOBN(0x73639eb8, 0x9360b10c)}, + {TOBN(0x4fba331f, 0xe1e4a71b), TOBN(0x6ffd6b93, 0x8072f919), + TOBN(0x6e53271c, 0x65679032), TOBN(0x67206444, 0xf14272ce)}}, + {{TOBN(0xc0f734a3, 0xb2335834), TOBN(0x9526205a, 0x90ef6860), + TOBN(0xcb8be717, 0x04e2bb0d), TOBN(0x2418871e, 0x02f383fa)}, + {TOBN(0xd7177681, 0x4082c157), TOBN(0xcc914ad0, 0x29c20073), + TOBN(0xf186c1eb, 0xe587e728), TOBN(0x6fdb3c22, 0x61bcd5fd)}}, + {{TOBN(0x30d014a6, 0xf2f9f8e9), TOBN(0x963ece23, 0x4fec49d2), + TOBN(0x862025c5, 0x9605a8d9), TOBN(0x39874445, 0x19f8929a)}, + {TOBN(0x01b6ff65, 0x12bf476a), TOBN(0x598a64d8, 0x09cf7d91), + TOBN(0xd7ec7749, 0x93be56ca), TOBN(0x10899785, 0xcbb33615)}}, + {{TOBN(0xb8a092fd, 0x02eee3ad), TOBN(0xa86b3d35, 0x30145270), + TOBN(0x323d98c6, 0x8512b675), TOBN(0x4b8bc785, 0x62ebb40f)}, + {TOBN(0x7d301f54, 0x413f9cde), TOBN(0xa5e4fb4f, 0x2bab5664), + TOBN(0x1d2b252d, 0x1cbfec23), TOBN(0xfcd576bb, 0xe177120d)}}, + {{TOBN(0x04427d3e, 0x83731a34), TOBN(0x2bb9028e, 0xed836e8e), + TOBN(0xb36acff8, 0xb612ca7c), TOBN(0xb88fe5ef, 0xd3d9c73a)}, + {TOBN(0xbe2a6bc6, 0xedea4eb3), TOBN(0x43b93133, 0x488eec77), + TOBN(0xf41ff566, 0xb17106e1), TOBN(0x469e9172, 0x654efa32)}}, + {{TOBN(0xb4480f04, 0x41c23fa3), TOBN(0xb4712eb0, 0xc1989a2e), + TOBN(0x3ccbba0f, 0x93a29ca7), TOBN(0x6e205c14, 0xd619428c)}, + {TOBN(0x90db7957, 0xb3641686), TOBN(0x0432691d, 0x45ac8b4e), + TOBN(0x07a759ac, 0xf64e0350), TOBN(0x0514d89c, 0x9c972517)}}, + {{TOBN(0x1701147f, 0xa8e67fc3), TOBN(0x9e2e0b8b, 0xab2085be), + TOBN(0xd5651824, 0xac284e57), TOBN(0x890d4325, 0x74893664)}, + {TOBN(0x8a7c5e6e, 0xc55e68a3), TOBN(0xbf12e90b, 0x4339c85a), + TOBN(0x31846b85, 0xf922b655), TOBN(0x9a54ce4d, 0x0bf4d700)}}, + {{TOBN(0xd7f4e83a, 0xf1a14295), TOBN(0x916f955c, 0xb285d4f9), + TOBN(0xe57bb0e0, 0x99ffdaba), TOBN(0x28a43034, 0xeab0d152)}, + {TOBN(0x0a36ffa2, 0xb8a9cef8), TOBN(0x5517407e, 0xb9ec051a), + TOBN(0x9c796096, 0xea68e672), TOBN(0x853db5fb, 0xfb3c77fb)}}, + {{TOBN(0x21474ba9, 0xe864a51a), TOBN(0x6c267699, 0x6e8a1b8b), + TOBN(0x7c823626, 0x94120a28), TOBN(0xe61e9a48, 0x8383a5db)}, + {TOBN(0x7dd75003, 0x9f84216d), TOBN(0xab020d07, 0xad43cd85), + TOBN(0x9437ae48, 0xda12c659), TOBN(0x6449c2eb, 0xe65452ad)}}, + {{TOBN(0xcc7c4c1c, 0x2cf9d7c1), TOBN(0x1320886a, 0xee95e5ab), + TOBN(0xbb7b9056, 0xbeae170c), TOBN(0xc8a5b250, 0xdbc0d662)}, + {TOBN(0x4ed81432, 0xc11d2303), TOBN(0x7da66912, 0x1f03769f), + TOBN(0x3ac7a5fd, 0x84539828), TOBN(0x14dada94, 0x3bccdd02)}}, + {{TOBN(0x8b84c321, 0x7ef6b0d1), TOBN(0x52a9477a, 0x7c933f22), + TOBN(0x5ef6728a, 0xfd440b82), TOBN(0x5c3bd859, 0x6ce4bd5e)}, + {TOBN(0x918b80f5, 0xf22c2d3e), TOBN(0x368d5040, 0xb7bb6cc5), + TOBN(0xb66142a1, 0x2695a11c), TOBN(0x60ac583a, 0xeb19ea70)}}, + {{TOBN(0x317cbb98, 0x0eab2437), TOBN(0x8cc08c55, 0x5e2654c8), + TOBN(0xfe2d6520, 0xe6d8307f), TOBN(0xe9f147f3, 0x57428993)}, + {TOBN(0x5f9c7d14, 0xd2fd6cf1), TOBN(0xa3ecd064, 0x2d4fcbb0), + TOBN(0xad83fef0, 0x8e7341f7), TOBN(0x643f23a0, 0x3a63115c)}}, + {{TOBN(0xd38a78ab, 0xe65ab743), TOBN(0xbf7c75b1, 0x35edc89c), + TOBN(0x3dd8752e, 0x530df568), TOBN(0xf85c4a76, 0xe308c682)}, + {TOBN(0x4c9955b2, 0xe68acf37), TOBN(0xa544df3d, 0xab32af85), + TOBN(0x4b8ec3f5, 0xa25cf493), TOBN(0x4d8f2764, 0x1a622feb)}}, + {{TOBN(0x7bb4f7aa, 0xf0dcbc49), TOBN(0x7de551f9, 0x70bbb45b), + TOBN(0xcfd0f3e4, 0x9f2ca2e5), TOBN(0xece58709, 0x1f5c76ef)}, + {TOBN(0x32920edd, 0x167d79ae), TOBN(0x039df8a2, 0xfa7d7ec1), + TOBN(0xf46206c0, 0xbb30af91), TOBN(0x1ff5e2f5, 0x22676b59)}}, + {{TOBN(0x11f4a039, 0x6ea51d66), TOBN(0x506c1445, 0x807d7a26), + TOBN(0x60da5705, 0x755a9b24), TOBN(0x8fc8cc32, 0x1f1a319e)}, + {TOBN(0x83642d4d, 0x9433d67d), TOBN(0x7fa5cb8f, 0x6a7dd296), + TOBN(0x576591db, 0x9b7bde07), TOBN(0x13173d25, 0x419716fb)}}, + {{TOBN(0xea30599d, 0xd5b340ff), TOBN(0xfc6b5297, 0xb0fe76c5), + TOBN(0x1c6968c8, 0xab8f5adc), TOBN(0xf723c7f5, 0x901c928d)}, + {TOBN(0x4203c321, 0x9773d402), TOBN(0xdf7c6aa3, 0x1b51dd47), + TOBN(0x3d49e37a, 0x552be23c), TOBN(0x57febee8, 0x0b5a6e87)}}, + {{TOBN(0xc5ecbee4, 0x7bd8e739), TOBN(0x79d44994, 0xae63bf75), + TOBN(0x168bd00f, 0x38fb8923), TOBN(0x75d48ee4, 0xd0533130)}, + {TOBN(0x554f77aa, 0xdb5cdf33), TOBN(0x3396e896, 0x3c696769), + TOBN(0x2fdddbf2, 0xd3fd674e), TOBN(0xbbb8f6ee, 0x99d0e3e5)}}, + {{TOBN(0x51b90651, 0xcbae2f70), TOBN(0xefc4bc05, 0x93aaa8eb), + TOBN(0x8ecd8689, 0xdd1df499), TOBN(0x1aee99a8, 0x22f367a5)}, + {TOBN(0x95d485b9, 0xae8274c5), TOBN(0x6c14d445, 0x7d30b39c), + TOBN(0xbafea90b, 0xbcc1ef81), TOBN(0x7c5f317a, 0xa459a2ed)}}, + {{TOBN(0x01211075, 0x4ef44227), TOBN(0xa17bed6e, 0xdc20f496), + TOBN(0x0cdfe424, 0x819853cd), TOBN(0x13793298, 0xf71e2ce7)}, + {TOBN(0x3c1f3078, 0xdbbe307b), TOBN(0x6dd1c20e, 0x76ee9936), + TOBN(0x23ee4b57, 0x423caa20), TOBN(0x4ac3793b, 0x8efb840e)}}, + {{TOBN(0x934438eb, 0xed1f8ca0), TOBN(0x3e546658, 0x4ebb25a2), + TOBN(0xc415af0e, 0xc069896f), TOBN(0xc13eddb0, 0x9a5aa43d)}, + {TOBN(0x7a04204f, 0xd49eb8f6), TOBN(0xd0d5bdfc, 0xd74f1670), + TOBN(0x3697e286, 0x56fc0558), TOBN(0x10207371, 0x01cebade)}}, + {{TOBN(0x5f87e690, 0x0647a82b), TOBN(0x908e0ed4, 0x8f40054f), + TOBN(0xa9f633d4, 0x79853803), TOBN(0x8ed13c9a, 0x4a28b252)}, + {TOBN(0x3e2ef676, 0x1f460f64), TOBN(0x53930b9b, 0x36d06336), + TOBN(0x347073ac, 0x8fc4979b), TOBN(0x84380e0e, 0x5ecd5597)}}, + {{TOBN(0xe3b22c6b, 0xc4fe3c39), TOBN(0xba4a8153, 0x6c7bebdf), + TOBN(0xf23ab6b7, 0x25693459), TOBN(0x53bc3770, 0x14922b11)}, + {TOBN(0x4645c8ab, 0x5afc60db), TOBN(0xaa022355, 0x20b9f2a3), + TOBN(0x52a2954c, 0xce0fc507), TOBN(0x8c2731bb, 0x7ce1c2e7)}}, + {{TOBN(0xf39608ab, 0x18a0339d), TOBN(0xac7a658d, 0x3735436c), + TOBN(0xb22c2b07, 0xcd992b4f), TOBN(0x4e83daec, 0xf40dcfd4)}, + {TOBN(0x8a34c7be, 0x2f39ea3e), TOBN(0xef0c005f, 0xb0a56d2e), + TOBN(0x62731f6a, 0x6edd8038), TOBN(0x5721d740, 0x4e3cb075)}}, + {{TOBN(0x1ea41511, 0xfbeeee1b), TOBN(0xd1ef5e73, 0xef1d0c05), + TOBN(0x42feefd1, 0x73c07d35), TOBN(0xe530a00a, 0x8a329493)}, + {TOBN(0x5d55b7fe, 0xf15ebfb0), TOBN(0x549de03c, 0xd322491a), + TOBN(0xf7b5f602, 0x745b3237), TOBN(0x3632a3a2, 0x1ab6e2b6)}}, + {{TOBN(0x0d3bba89, 0x0ef59f78), TOBN(0x0dfc6443, 0xc9e52b9a), + TOBN(0x1dc79699, 0x72631447), TOBN(0xef033917, 0xb3be20b1)}, + {TOBN(0x0c92735d, 0xb1383948), TOBN(0xc1fc29a2, 0xc0dd7d7d), + TOBN(0x6485b697, 0x403ed068), TOBN(0x13bfaab3, 0xaac93bdc)}}, + {{TOBN(0x410dc6a9, 0x0deeaf52), TOBN(0xb003fb02, 0x4c641c15), + TOBN(0x1384978c, 0x5bc504c4), TOBN(0x37640487, 0x864a6a77)}, + {TOBN(0x05991bc6, 0x222a77da), TOBN(0x62260a57, 0x5e47eb11), + TOBN(0xc7af6613, 0xf21b432c), TOBN(0x22f3acc9, 0xab4953e9)}}, + {{TOBN(0x52934922, 0x8e41d155), TOBN(0x4d024568, 0x3ac059ef), + TOBN(0xb0201755, 0x4d884411), TOBN(0xce8055cf, 0xa59a178f)}, + {TOBN(0xcd77d1af, 0xf6204549), TOBN(0xa0a00a3e, 0xc7066759), + TOBN(0x471071ef, 0x0272c229), TOBN(0x009bcf6b, 0xd3c4b6b0)}}, + {{TOBN(0x2a2638a8, 0x22305177), TOBN(0xd51d59df, 0x41645bbf), + TOBN(0xa81142fd, 0xc0a7a3c0), TOBN(0xa17eca6d, 0x4c7063ee)}, + {TOBN(0x0bb887ed, 0x60d9dcec), TOBN(0xd6d28e51, 0x20ad2455), + TOBN(0xebed6308, 0xa67102ba), TOBN(0x042c3114, 0x8bffa408)}}, + {{TOBN(0xfd099ac5, 0x8aa68e30), TOBN(0x7a6a3d7c, 0x1483513e), + TOBN(0xffcc6b75, 0xba2d8f0c), TOBN(0x54dacf96, 0x1e78b954)}, + {TOBN(0xf645696f, 0xa4a9af89), TOBN(0x3a411940, 0x06ac98ec), + TOBN(0x41b8b3f6, 0x22a67a20), TOBN(0x2d0b1e0f, 0x99dec626)}}, + {{TOBN(0x27c89192, 0x40be34e8), TOBN(0xc7162b37, 0x91907f35), + TOBN(0x90188ec1, 0xa956702b), TOBN(0xca132f7d, 0xdf93769c)}, + {TOBN(0x3ece44f9, 0x0e2025b4), TOBN(0x67aaec69, 0x0c62f14c), + TOBN(0xad741418, 0x22e3cc11), TOBN(0xcf9b75c3, 0x7ff9a50e)}}, + {{TOBN(0x02fa2b16, 0x4d348272), TOBN(0xbd99d61a, 0x9959d56d), + TOBN(0xbc4f19db, 0x18762916), TOBN(0xcc7cce50, 0x49c1ac80)}, + {TOBN(0x4d59ebaa, 0xd846bd83), TOBN(0x8775a9dc, 0xa9202849), + TOBN(0x07ec4ae1, 0x6e1f4ca9), TOBN(0x27eb5875, 0xba893f11)}}, + {{TOBN(0x00284d51, 0x662cc565), TOBN(0x82353a6b, 0x0db4138d), + TOBN(0xd9c7aaaa, 0xaa32a594), TOBN(0xf5528b5e, 0xa5669c47)}, + {TOBN(0xf3220231, 0x2f23c5ff), TOBN(0xe3e8147a, 0x6affa3a1), + TOBN(0xfb423d5c, 0x202ddda0), TOBN(0x3d6414ac, 0x6b871bd4)}}, + {{TOBN(0x586f82e1, 0xa51a168a), TOBN(0xb712c671, 0x48ae5448), + TOBN(0x9a2e4bd1, 0x76233eb8), TOBN(0x0188223a, 0x78811ca9)}, + {TOBN(0x553c5e21, 0xf7c18de1), TOBN(0x7682e451, 0xb27bb286), + TOBN(0x3ed036b3, 0x0e51e929), TOBN(0xf487211b, 0xec9cb34f)}}, + {{TOBN(0x0d094277, 0x0c24efc8), TOBN(0x0349fd04, 0xbef737a4), + TOBN(0x6d1c9dd2, 0x514cdd28), TOBN(0x29c135ff, 0x30da9521)}, + {TOBN(0xea6e4508, 0xf78b0b6f), TOBN(0x176f5dd2, 0x678c143c), + TOBN(0x08148418, 0x4be21e65), TOBN(0x27f7525c, 0xe7df38c4)}}, + {{TOBN(0x1fb70e09, 0x748ab1a4), TOBN(0x9cba50a0, 0x5efe4433), + TOBN(0x7846c7a6, 0x15f75af2), TOBN(0x2a7c2c57, 0x5ee73ea8)}, + {TOBN(0x42e566a4, 0x3f0a449a), TOBN(0x45474c3b, 0xad90fc3d), + TOBN(0x7447be3d, 0x8b61d057), TOBN(0x3e9d1cf1, 0x3a4ec092)}}, + {{TOBN(0x1603e453, 0xf380a6e6), TOBN(0x0b86e431, 0x9b1437c2), + TOBN(0x7a4173f2, 0xef29610a), TOBN(0x8fa729a7, 0xf03d57f7)}, + {TOBN(0x3e186f6e, 0x6c9c217e), TOBN(0xbe1d3079, 0x91919524), + TOBN(0x92a62a70, 0x153d4fb1), TOBN(0x32ed3e34, 0xd68c2f71)}}, + {{TOBN(0xd785027f, 0x9eb1a8b7), TOBN(0xbc37eb77, 0xc5b22fe8), + TOBN(0x466b34f0, 0xb9d6a191), TOBN(0x008a89af, 0x9a05f816)}, + {TOBN(0x19b028fb, 0x7d42c10a), TOBN(0x7fe8c92f, 0x49b3f6b8), + TOBN(0x58907cc0, 0xa5a0ade3), TOBN(0xb3154f51, 0x559d1a7c)}}, + {{TOBN(0x5066efb6, 0xd9790ed6), TOBN(0xa77a0cbc, 0xa6aa793b), + TOBN(0x1a915f3c, 0x223e042e), TOBN(0x1c5def04, 0x69c5874b)}, + {TOBN(0x0e830078, 0x73b6c1da), TOBN(0x55cf85d2, 0xfcd8557a), + TOBN(0x0f7c7c76, 0x0460f3b1), TOBN(0x87052acb, 0x46e58063)}}, + {{TOBN(0x09212b80, 0x907eae66), TOBN(0x3cb068e0, 0x4d721c89), + TOBN(0xa87941ae, 0xdd45ac1c), TOBN(0xde8d5c0d, 0x0daa0dbb)}, + {TOBN(0xda421fdc, 0xe3502e6e), TOBN(0xc8944201, 0x4d89a084), + TOBN(0x7307ba5e, 0xf0c24bfb), TOBN(0xda212beb, 0x20bde0ef)}}, + {{TOBN(0xea2da24b, 0xf82ce682), TOBN(0x058d3816, 0x07f71fe4), + TOBN(0x35a02462, 0x5ffad8de), TOBN(0xcd7b05dc, 0xaadcefab)}, + {TOBN(0xd442f8ed, 0x1d9f54ec), TOBN(0x8be3d618, 0xb2d3b5ca), + TOBN(0xe2220ed0, 0xe06b2ce2), TOBN(0x82699a5f, 0x1b0da4c0)}}, + {{TOBN(0x3ff106f5, 0x71c0c3a7), TOBN(0x8f580f5a, 0x0d34180c), + TOBN(0x4ebb120e, 0x22d7d375), TOBN(0x5e5782cc, 0xe9513675)}, + {TOBN(0x2275580c, 0x99c82a70), TOBN(0xe8359fbf, 0x15ea8c4c), + TOBN(0x53b48db8, 0x7b415e70), TOBN(0xaacf2240, 0x100c6014)}}, + {{TOBN(0x9faaccf5, 0xe4652f1d), TOBN(0xbd6fdd2a, 0xd56157b2), + TOBN(0xa4f4fb1f, 0x6261ec50), TOBN(0x244e55ad, 0x476bcd52)}, + {TOBN(0x881c9305, 0x047d320b), TOBN(0x1ca983d5, 0x6181263f), + TOBN(0x354e9a44, 0x278fb8ee), TOBN(0xad2dbc0f, 0x396e4964)}}, + {{TOBN(0x723f3aa2, 0x9268b3de), TOBN(0x0d1ca29a, 0xe6e0609a), + TOBN(0x794866aa, 0x6cf44252), TOBN(0x0b59f3e3, 0x01af87ed)}, + {TOBN(0xe234e5ff, 0x7f4a6c51), TOBN(0xa8768fd2, 0x61dc2f7e), + TOBN(0xdafc7332, 0x0a94d81f), TOBN(0xd7f84282, 0x06938ce1)}}, + {{TOBN(0xae0b3c0e, 0x0546063e), TOBN(0x7fbadcb2, 0x5d61abc6), + TOBN(0xd5d7a2c9, 0x369ac400), TOBN(0xa5978d09, 0xae67d10c)}, + {TOBN(0x290f211e, 0x4f85eaac), TOBN(0xe61e2ad1, 0xfacac681), + TOBN(0xae125225, 0x388384cd), TOBN(0xa7fb68e9, 0xccfde30f)}}, + {{TOBN(0x7a59b936, 0x3daed4c2), TOBN(0x80a9aa40, 0x2606f789), + TOBN(0xb40c1ea5, 0xf6a6d90a), TOBN(0x948364d3, 0x514d5885)}, + {TOBN(0x062ebc60, 0x70985182), TOBN(0xa6db5b0e, 0x33310895), + TOBN(0x64a12175, 0xe329c2f5), TOBN(0xc5f25bd2, 0x90ea237e)}}, + {{TOBN(0x7915c524, 0x2d0a4c23), TOBN(0xeb5d26e4, 0x6bb3cc52), + TOBN(0x369a9116, 0xc09e2c92), TOBN(0x0c527f92, 0xcf182cf8)}, + {TOBN(0x9e591938, 0x2aede0ac), TOBN(0xb2922208, 0x6cc34939), + TOBN(0x3c9d8962, 0x99a34361), TOBN(0x3c81836d, 0xc1905fe6)}}, + {{TOBN(0x4bfeb57f, 0xa001ec5a), TOBN(0xe993f5bb, 0xa0dc5dba), + TOBN(0x47884109, 0x724a1380), TOBN(0x8a0369ab, 0x32fe9a04)}, + {TOBN(0xea068d60, 0x8c927db8), TOBN(0xbf5f37cf, 0x94655741), + TOBN(0x47d402a2, 0x04b6c7ea), TOBN(0x4551c295, 0x6af259cb)}}, + {{TOBN(0x698b71e7, 0xed77ee8b), TOBN(0xbddf7bd0, 0xf309d5c7), + TOBN(0x6201c22c, 0x34e780ca), TOBN(0xab04f7d8, 0x4c295ef4)}, + {TOBN(0x1c947294, 0x4313a8ce), TOBN(0xe532e4ac, 0x92ca4cfe), + TOBN(0x89738f80, 0xd0a7a97a), TOBN(0xec088c88, 0xa580fd5b)}}, + {{TOBN(0x612b1ecc, 0x42ce9e51), TOBN(0x8f9840fd, 0xb25fdd2a), + TOBN(0x3cda78c0, 0x01e7f839), TOBN(0x546b3d3a, 0xece05480)}, + {TOBN(0x271719a9, 0x80d30916), TOBN(0x45497107, 0x584c20c4), + TOBN(0xaf8f9478, 0x5bc78608), TOBN(0x28c7d484, 0x277e2a4c)}}, + {{TOBN(0xfce01767, 0x88a2ffe4), TOBN(0xdc506a35, 0x28e169a5), + TOBN(0x0ea10861, 0x7af9c93a), TOBN(0x1ed24361, 0x03fa0e08)}, + {TOBN(0x96eaaa92, 0xa3d694e7), TOBN(0xc0f43b4d, 0xef50bc74), + TOBN(0xce6aa58c, 0x64114db4), TOBN(0x8218e8ea, 0x7c000fd4)}}, + {{TOBN(0xac815dfb, 0x185f8844), TOBN(0xcd7e90cb, 0x1557abfb), + TOBN(0x23d16655, 0xafbfecdf), TOBN(0x80f3271f, 0x085cac4a)}, + {TOBN(0x7fc39aa7, 0xd0e62f47), TOBN(0x88d519d1, 0x460a48e5), + TOBN(0x59559ac4, 0xd28f101e), TOBN(0x7981d9e9, 0xca9ae816)}}, + {{TOBN(0x5c38652c, 0x9ac38203), TOBN(0x86eaf87f, 0x57657fe5), + TOBN(0x568fc472, 0xe21f5416), TOBN(0x2afff39c, 0xe7e597b5)}, + {TOBN(0x3adbbb07, 0x256d4eab), TOBN(0x22598692, 0x8285ab89), + TOBN(0x35f8112a, 0x041caefe), TOBN(0x95df02e3, 0xa5064c8b)}}, + {{TOBN(0x4d63356e, 0xc7004bf3), TOBN(0x230a08f4, 0xdb83c7de), + TOBN(0xca27b270, 0x8709a7b7), TOBN(0x0d1c4cc4, 0xcb9abd2d)}, + {TOBN(0x8a0bc66e, 0x7550fee8), TOBN(0x369cd4c7, 0x9cf7247e), + TOBN(0x75562e84, 0x92b5b7e7), TOBN(0x8fed0da0, 0x5802af7b)}}, + {{TOBN(0x6a7091c2, 0xe48fb889), TOBN(0x26882c13, 0x7b8a9d06), + TOBN(0xa2498663, 0x1b82a0e2), TOBN(0x844ed736, 0x3518152d)}, + {TOBN(0x282f476f, 0xd86e27c7), TOBN(0xa04edaca, 0x04afefdc), + TOBN(0x8b256ebc, 0x6119e34d), TOBN(0x56a413e9, 0x0787d78b)}}}, + {{{TOBN(0x82ee061d, 0x5a74be50), TOBN(0xe41781c4, 0xdea16ff5), + TOBN(0xe0b0c81e, 0x99bfc8a2), TOBN(0x624f4d69, 0x0b547e2d)}, + {TOBN(0x3a83545d, 0xbdcc9ae4), TOBN(0x2573dbb6, 0x409b1e8e), + TOBN(0x482960c4, 0xa6c93539), TOBN(0xf01059ad, 0x5ae18798)}}, + {{TOBN(0x715c9f97, 0x3112795f), TOBN(0xe8244437, 0x984e6ee1), + TOBN(0x55cb4858, 0xecb66bcd), TOBN(0x7c136735, 0xabaffbee)}, + {TOBN(0x54661595, 0x5dbec38e), TOBN(0x51c0782c, 0x388ad153), + TOBN(0x9ba4c53a, 0xc6e0952f), TOBN(0x27e6782a, 0x1b21dfa8)}}, + {{TOBN(0x682f903d, 0x4ed2dbc2), TOBN(0x0eba59c8, 0x7c3b2d83), + TOBN(0x8e9dc84d, 0x9c7e9335), TOBN(0x5f9b21b0, 0x0eb226d7)}, + {TOBN(0xe33bd394, 0xaf267bae), TOBN(0xaa86cc25, 0xbe2e15ae), + TOBN(0x4f0bf67d, 0x6a8ec500), TOBN(0x5846aa44, 0xf9630658)}}, + {{TOBN(0xfeb09740, 0xe2c2bf15), TOBN(0x627a2205, 0xa9e99704), + TOBN(0xec8d73d0, 0xc2fbc565), TOBN(0x223eed8f, 0xc20c8de8)}, + {TOBN(0x1ee32583, 0xa8363b49), TOBN(0x1a0b6cb9, 0xc9c2b0a6), + TOBN(0x49f7c3d2, 0x90dbc85c), TOBN(0xa8dfbb97, 0x1ef4c1ac)}}, + {{TOBN(0xafb34d4c, 0x65c7c2ab), TOBN(0x1d4610e7, 0xe2c5ea84), + TOBN(0x893f6d1b, 0x973c4ab5), TOBN(0xa3cdd7e9, 0x945ba5c4)}, + {TOBN(0x60514983, 0x064417ee), TOBN(0x1459b23c, 0xad6bdf2b), + TOBN(0x23b2c341, 0x5cf726c3), TOBN(0x3a829635, 0x32d6354a)}}, + {{TOBN(0x294f901f, 0xab192c18), TOBN(0xec5fcbfe, 0x7030164f), + TOBN(0xe2e2fcb7, 0xe2246ba6), TOBN(0x1e7c88b3, 0x221a1a0c)}, + {TOBN(0x72c7dd93, 0xc92d88c5), TOBN(0x41c2148e, 0x1106fb59), + TOBN(0x547dd4f5, 0xa0f60f14), TOBN(0xed9b52b2, 0x63960f31)}}, + {{TOBN(0x6c8349eb, 0xb0a5b358), TOBN(0xb154c5c2, 0x9e7e2ed6), + TOBN(0xcad5eccf, 0xeda462db), TOBN(0xf2d6dbe4, 0x2de66b69)}, + {TOBN(0x426aedf3, 0x8665e5b2), TOBN(0x488a8513, 0x7b7f5723), + TOBN(0x15cc43b3, 0x8bcbb386), TOBN(0x27ad0af3, 0xd791d879)}}, + {{TOBN(0xc16c236e, 0x846e364f), TOBN(0x7f33527c, 0xdea50ca0), + TOBN(0xc4810775, 0x0926b86d), TOBN(0x6c2a3609, 0x0598e70c)}, + {TOBN(0xa6755e52, 0xf024e924), TOBN(0xe0fa07a4, 0x9db4afca), + TOBN(0x15c3ce7d, 0x66831790), TOBN(0x5b4ef350, 0xa6cbb0d6)}}, + {{TOBN(0x2c4aafc4, 0xb6205969), TOBN(0x42563f02, 0xf6c7854f), + TOBN(0x016aced5, 0x1d983b48), TOBN(0xfeb356d8, 0x99949755)}, + {TOBN(0x8c2a2c81, 0xd1a39bd7), TOBN(0x8f44340f, 0xe6934ae9), + TOBN(0x148cf91c, 0x447904da), TOBN(0x7340185f, 0x0f51a926)}}, + {{TOBN(0x2f8f00fb, 0x7409ab46), TOBN(0x057e78e6, 0x80e289b2), + TOBN(0x03e5022c, 0xa888e5d1), TOBN(0x3c87111a, 0x9dede4e2)}, + {TOBN(0x5b9b0e1c, 0x7809460b), TOBN(0xe751c852, 0x71c9abc7), + TOBN(0x8b944e28, 0xc7cc1dc9), TOBN(0x4f201ffa, 0x1d3cfa08)}}, + {{TOBN(0x02fc905c, 0x3e6721ce), TOBN(0xd52d70da, 0xd0b3674c), + TOBN(0x5dc2e5ca, 0x18810da4), TOBN(0xa984b273, 0x5c69dd99)}, + {TOBN(0x63b92527, 0x84de5ca4), TOBN(0x2f1c9872, 0xc852dec4), + TOBN(0x18b03593, 0xc2e3de09), TOBN(0x19d70b01, 0x9813dc2f)}}, + {{TOBN(0x42806b2d, 0xa6dc1d29), TOBN(0xd3030009, 0xf871e144), + TOBN(0xa1feb333, 0xaaf49276), TOBN(0xb5583b9e, 0xc70bc04b)}, + {TOBN(0x1db0be78, 0x95695f20), TOBN(0xfc841811, 0x89d012b5), + TOBN(0x6409f272, 0x05f61643), TOBN(0x40d34174, 0xd5883128)}}, + {{TOBN(0xd79196f5, 0x67419833), TOBN(0x6059e252, 0x863b7b08), + TOBN(0x84da1817, 0x1c56700c), TOBN(0x5758ee56, 0xb28d3ec4)}, + {TOBN(0x7da2771d, 0x013b0ea6), TOBN(0xfddf524b, 0x54c5e9b9), + TOBN(0x7df4faf8, 0x24305d80), TOBN(0x58f5c1bf, 0x3a97763f)}}, + {{TOBN(0xa5af37f1, 0x7c696042), TOBN(0xd4cba22c, 0x4a2538de), + TOBN(0x211cb995, 0x9ea42600), TOBN(0xcd105f41, 0x7b069889)}, + {TOBN(0xb1e1cf19, 0xddb81e74), TOBN(0x472f2d89, 0x5157b8ca), + TOBN(0x086fb008, 0xee9db885), TOBN(0x365cd570, 0x0f26d131)}}, + {{TOBN(0x284b02bb, 0xa2be7053), TOBN(0xdcbbf7c6, 0x7ab9a6d6), + TOBN(0x4425559c, 0x20f7a530), TOBN(0x961f2dfa, 0x188767c8)}, + {TOBN(0xe2fd9435, 0x70dc80c4), TOBN(0x104d6b63, 0xf0784120), + TOBN(0x7f592bc1, 0x53567122), TOBN(0xf6bc1246, 0xf688ad77)}}, + {{TOBN(0x05214c05, 0x0f15dde9), TOBN(0xa47a76a8, 0x0d5f2b82), + TOBN(0xbb254d30, 0x62e82b62), TOBN(0x11a05fe0, 0x3ec955ee)}, + {TOBN(0x7eaff46e, 0x9d529b36), TOBN(0x55ab1301, 0x8f9e3df6), + TOBN(0xc463e371, 0x99317698), TOBN(0xfd251438, 0xccda47ad)}}, + {{TOBN(0xca9c3547, 0x23d695ea), TOBN(0x48ce626e, 0x16e589b5), + TOBN(0x6b5b64c7, 0xb187d086), TOBN(0xd02e1794, 0xb2207948)}, + {TOBN(0x8b58e98f, 0x7198111d), TOBN(0x90ca6305, 0xdcf9c3cc), + TOBN(0x5691fe72, 0xf34089b0), TOBN(0x60941af1, 0xfc7c80ff)}}, + {{TOBN(0xa09bc0a2, 0x22eb51e5), TOBN(0xc0bb7244, 0xaa9cf09a), + TOBN(0x36a8077f, 0x80159f06), TOBN(0x8b5c989e, 0xdddc560e)}, + {TOBN(0x19d2f316, 0x512e1f43), TOBN(0x02eac554, 0xad08ff62), + TOBN(0x012ab84c, 0x07d20b4e), TOBN(0x37d1e115, 0xd6d4e4e1)}}, + {{TOBN(0xb6443e1a, 0xab7b19a8), TOBN(0xf08d067e, 0xdef8cd45), + TOBN(0x63adf3e9, 0x685e03da), TOBN(0xcf15a10e, 0x4792b916)}, + {TOBN(0xf44bcce5, 0xb738a425), TOBN(0xebe131d5, 0x9636b2fd), + TOBN(0x94068841, 0x7850d605), TOBN(0x09684eaa, 0xb40d749d)}}, + {{TOBN(0x8c3c669c, 0x72ba075b), TOBN(0x89f78b55, 0xba469015), + TOBN(0x5706aade, 0x3e9f8ba8), TOBN(0x6d8bd565, 0xb32d7ed7)}, + {TOBN(0x25f4e63b, 0x805f08d6), TOBN(0x7f48200d, 0xc3bcc1b5), + TOBN(0x4e801968, 0xb025d847), TOBN(0x74afac04, 0x87cbe0a8)}}, + {{TOBN(0x43ed2c2b, 0x7e63d690), TOBN(0xefb6bbf0, 0x0223cdb8), + TOBN(0x4fec3cae, 0x2884d3fe), TOBN(0x065ecce6, 0xd75e25a4)}, + {TOBN(0x6c2294ce, 0x69f79071), TOBN(0x0d9a8e5f, 0x044b8666), + TOBN(0x5009f238, 0x17b69d8f), TOBN(0x3c29f8fe, 0xc5dfdaf7)}}, + {{TOBN(0x9067528f, 0xebae68c4), TOBN(0x5b385632, 0x30c5ba21), + TOBN(0x540df119, 0x1fdd1aec), TOBN(0xcf37825b, 0xcfba4c78)}, + {TOBN(0x77eff980, 0xbeb11454), TOBN(0x40a1a991, 0x60c1b066), + TOBN(0xe8018980, 0xf889a1c7), TOBN(0xb9c52ae9, 0x76c24be0)}}, + {{TOBN(0x05fbbcce, 0x45650ef4), TOBN(0xae000f10, 0x8aa29ac7), + TOBN(0x884b7172, 0x4f04c470), TOBN(0x7cd4fde2, 0x19bb5c25)}, + {TOBN(0x6477b22a, 0xe8840869), TOBN(0xa8868859, 0x5fbd0686), + TOBN(0xf23cc02e, 0x1116dfba), TOBN(0x76cd563f, 0xd87d7776)}}, + {{TOBN(0xe2a37598, 0xa9d82abf), TOBN(0x5f188ccb, 0xe6c170f5), + TOBN(0x81682200, 0x5066b087), TOBN(0xda22c212, 0xc7155ada)}, + {TOBN(0x151e5d3a, 0xfbddb479), TOBN(0x4b606b84, 0x6d715b99), + TOBN(0x4a73b54b, 0xf997cb2e), TOBN(0x9a1bfe43, 0x3ecd8b66)}}, + {{TOBN(0x1c312809, 0x2a67d48a), TOBN(0xcd6a671e, 0x031fa9e2), + TOBN(0xbec3312a, 0x0e43a34a), TOBN(0x1d935639, 0x55ef47d3)}, + {TOBN(0x5ea02489, 0x8fea73ea), TOBN(0x8247b364, 0xa035afb2), + TOBN(0xb58300a6, 0x5265b54c), TOBN(0x3286662f, 0x722c7148)}}, + {{TOBN(0xb77fd76b, 0xb4ec4c20), TOBN(0xf0a12fa7, 0x0f3fe3fd), + TOBN(0xf845bbf5, 0x41d8c7e8), TOBN(0xe4d969ca, 0x5ec10aa8)}, + {TOBN(0x4c0053b7, 0x43e232a3), TOBN(0xdc7a3fac, 0x37f8a45a), + TOBN(0x3c4261c5, 0x20d81c8f), TOBN(0xfd4b3453, 0xb00eab00)}}, + {{TOBN(0x76d48f86, 0xd36e3062), TOBN(0x626c5277, 0xa143ff02), + TOBN(0x538174de, 0xaf76f42e), TOBN(0x2267aa86, 0x6407ceac)}, + {TOBN(0xfad76351, 0x72e572d5), TOBN(0xab861af7, 0xba7330eb), + TOBN(0xa0a1c8c7, 0x418d8657), TOBN(0x988821cb, 0x20289a52)}}, + {{TOBN(0x79732522, 0xcccc18ad), TOBN(0xaadf3f8d, 0xf1a6e027), + TOBN(0xf7382c93, 0x17c2354d), TOBN(0x5ce1680c, 0xd818b689)}, + {TOBN(0x359ebbfc, 0xd9ecbee9), TOBN(0x4330689c, 0x1cae62ac), + TOBN(0xb55ce5b4, 0xc51ac38a), TOBN(0x7921dfea, 0xfe238ee8)}}, + {{TOBN(0x3972bef8, 0x271d1ca5), TOBN(0x3e423bc7, 0xe8aabd18), + TOBN(0x57b09f3f, 0x44a3e5e3), TOBN(0x5da886ae, 0x7b444d66)}, + {TOBN(0x68206634, 0xa9964375), TOBN(0x356a2fa3, 0x699cd0ff), + TOBN(0xaf0faa24, 0xdba515e9), TOBN(0x536e1f5c, 0xb321d79a)}}, + {{TOBN(0xd3b9913a, 0x5c04e4ea), TOBN(0xd549dcfe, 0xd6f11513), + TOBN(0xee227bf5, 0x79fd1d94), TOBN(0x9f35afee, 0xb43f2c67)}, + {TOBN(0xd2638d24, 0xf1314f53), TOBN(0x62baf948, 0xcabcd822), + TOBN(0x5542de29, 0x4ef48db0), TOBN(0xb3eb6a04, 0xfc5f6bb2)}}, + {{TOBN(0x23c110ae, 0x1208e16a), TOBN(0x1a4d15b5, 0xf8363e24), + TOBN(0x30716844, 0x164be00b), TOBN(0xa8e24824, 0xf6f4690d)}, + {TOBN(0x548773a2, 0x90b170cf), TOBN(0xa1bef331, 0x42f191f4), + TOBN(0x70f418d0, 0x9247aa97), TOBN(0xea06028e, 0x48be9147)}}, + {{TOBN(0xe13122f3, 0xdbfb894e), TOBN(0xbe9b79f6, 0xce274b18), + TOBN(0x85a49de5, 0xca58aadf), TOBN(0x24957758, 0x11487351)}, + {TOBN(0x111def61, 0xbb939099), TOBN(0x1d6a974a, 0x26d13694), + TOBN(0x4474b4ce, 0xd3fc253b), TOBN(0x3a1485e6, 0x4c5db15e)}}, + {{TOBN(0xe79667b4, 0x147c15b4), TOBN(0xe34f553b, 0x7bc61301), + TOBN(0x032b80f8, 0x17094381), TOBN(0x55d8bafd, 0x723eaa21)}, + {TOBN(0x5a987995, 0xf1c0e74e), TOBN(0x5a9b292e, 0xebba289c), + TOBN(0x413cd4b2, 0xeb4c8251), TOBN(0x98b5d243, 0xd162db0a)}}, + {{TOBN(0xbb47bf66, 0x68342520), TOBN(0x08d68949, 0xbaa862d1), + TOBN(0x11f349c7, 0xe906abcd), TOBN(0x454ce985, 0xed7bf00e)}, + {TOBN(0xacab5c9e, 0xb55b803b), TOBN(0xb03468ea, 0x31e3c16d), + TOBN(0x5c24213d, 0xd273bf12), TOBN(0x211538eb, 0x71587887)}}, + {{TOBN(0x198e4a2f, 0x731dea2d), TOBN(0xd5856cf2, 0x74ed7b2a), + TOBN(0x86a632eb, 0x13a664fe), TOBN(0x932cd909, 0xbda41291)}, + {TOBN(0x850e95d4, 0xc0c4ddc0), TOBN(0xc0f422f8, 0x347fc2c9), + TOBN(0xe68cbec4, 0x86076bcb), TOBN(0xf9e7c0c0, 0xcd6cd286)}}, + {{TOBN(0x65994ddb, 0x0f5f27ca), TOBN(0xe85461fb, 0xa80d59ff), + TOBN(0xff05481a, 0x66601023), TOBN(0xc665427a, 0xfc9ebbfb)}, + {TOBN(0xb0571a69, 0x7587fd52), TOBN(0x935289f8, 0x8d49efce), + TOBN(0x61becc60, 0xea420688), TOBN(0xb22639d9, 0x13a786af)}}, + {{TOBN(0x1a8e6220, 0x361ecf90), TOBN(0x001f23e0, 0x25506463), + TOBN(0xe4ae9b5d, 0x0a5c2b79), TOBN(0xebc9cdad, 0xd8149db5)}, + {TOBN(0xb33164a1, 0x934aa728), TOBN(0x750eb00e, 0xae9b60f3), + TOBN(0x5a91615b, 0x9b9cfbfd), TOBN(0x97015cbf, 0xef45f7f6)}}, + {{TOBN(0xb462c4a5, 0xbf5151df), TOBN(0x21adcc41, 0xb07118f2), + TOBN(0xd60c545b, 0x043fa42c), TOBN(0xfc21aa54, 0xe96be1ab)}, + {TOBN(0xe84bc32f, 0x4e51ea80), TOBN(0x3dae45f0, 0x259b5d8d), + TOBN(0xbb73c7eb, 0xc38f1b5e), TOBN(0xe405a74a, 0xe8ae617d)}}, + {{TOBN(0xbb1ae9c6, 0x9f1c56bd), TOBN(0x8c176b98, 0x49f196a4), + TOBN(0xc448f311, 0x6875092b), TOBN(0xb5afe3de, 0x9f976033)}, + {TOBN(0xa8dafd49, 0x145813e5), TOBN(0x687fc4d9, 0xe2b34226), + TOBN(0xf2dfc92d, 0x4c7ff57f), TOBN(0x004e3fc1, 0x401f1b46)}}, + {{TOBN(0x5afddab6, 0x1430c9ab), TOBN(0x0bdd41d3, 0x2238e997), + TOBN(0xf0947430, 0x418042ae), TOBN(0x71f9adda, 0xcdddc4cb)}, + {TOBN(0x7090c016, 0xc52dd907), TOBN(0xd9bdf44d, 0x29e2047f), + TOBN(0xe6f1fe80, 0x1b1011a6), TOBN(0xb63accbc, 0xd9acdc78)}}, + {{TOBN(0xcfc7e235, 0x1272a95b), TOBN(0x0c667717, 0xa6276ac8), + TOBN(0x3c0d3709, 0xe2d7eef7), TOBN(0x5add2b06, 0x9a685b3e)}, + {TOBN(0x363ad32d, 0x14ea5d65), TOBN(0xf8e01f06, 0x8d7dd506), + TOBN(0xc9ea2213, 0x75b4aac6), TOBN(0xed2a2bf9, 0x0d353466)}}, + {{TOBN(0x439d79b5, 0xe9d3a7c3), TOBN(0x8e0ee5a6, 0x81b7f34b), + TOBN(0xcf3dacf5, 0x1dc4ba75), TOBN(0x1d3d1773, 0xeb3310c7)}, + {TOBN(0xa8e67112, 0x7747ae83), TOBN(0x31f43160, 0x197d6b40), + TOBN(0x0521ccee, 0xcd961400), TOBN(0x67246f11, 0xf6535768)}}, + {{TOBN(0x702fcc5a, 0xef0c3133), TOBN(0x247cc45d, 0x7e16693b), + TOBN(0xfd484e49, 0xc729b749), TOBN(0x522cef7d, 0xb218320f)}, + {TOBN(0xe56ef405, 0x59ab93b3), TOBN(0x225fba11, 0x9f181071), + TOBN(0x33bd6595, 0x15330ed0), TOBN(0xc4be69d5, 0x1ddb32f7)}}, + {{TOBN(0x264c7668, 0x0448087c), TOBN(0xac30903f, 0x71432dae), + TOBN(0x3851b266, 0x00f9bf47), TOBN(0x400ed311, 0x6cdd6d03)}, + {TOBN(0x045e79fe, 0xf8fd2424), TOBN(0xfdfd974a, 0xfa6da98b), + TOBN(0x45c9f641, 0x0c1e673a), TOBN(0x76f2e733, 0x5b2c5168)}}, + {{TOBN(0x1adaebb5, 0x2a601753), TOBN(0xb286514c, 0xc57c2d49), + TOBN(0xd8769670, 0x1e0bfd24), TOBN(0x950c547e, 0x04478922)}, + {TOBN(0xd1d41969, 0xe5d32bfe), TOBN(0x30bc1472, 0x750d6c3e), + TOBN(0x8f3679fe, 0xe0e27f3a), TOBN(0x8f64a7dc, 0xa4a6ee0c)}}, + {{TOBN(0x2fe59937, 0x633dfb1f), TOBN(0xea82c395, 0x977f2547), + TOBN(0xcbdfdf1a, 0x661ea646), TOBN(0xc7ccc591, 0xb9085451)}, + {TOBN(0x82177962, 0x81761e13), TOBN(0xda57596f, 0x9196885c), + TOBN(0xbc17e849, 0x28ffbd70), TOBN(0x1e6e0a41, 0x2671d36f)}}, + {{TOBN(0x61ae872c, 0x4152fcf5), TOBN(0x441c87b0, 0x9e77e754), + TOBN(0xd0799dd5, 0xa34dff09), TOBN(0x766b4e44, 0x88a6b171)}, + {TOBN(0xdc06a512, 0x11f1c792), TOBN(0xea02ae93, 0x4be35c3e), + TOBN(0xe5ca4d6d, 0xe90c469e), TOBN(0x4df4368e, 0x56e4ff5c)}}, + {{TOBN(0x7817acab, 0x4baef62e), TOBN(0x9f5a2202, 0xa85b91e8), + TOBN(0x9666ebe6, 0x6ce57610), TOBN(0x32ad31f3, 0xf73bfe03)}, + {TOBN(0x628330a4, 0x25bcf4d6), TOBN(0xea950593, 0x515056e6), + TOBN(0x59811c89, 0xe1332156), TOBN(0xc89cf1fe, 0x8c11b2d7)}}, + {{TOBN(0x75b63913, 0x04e60cc0), TOBN(0xce811e8d, 0x4625d375), + TOBN(0x030e43fc, 0x2d26e562), TOBN(0xfbb30b4b, 0x608d36a0)}, + {TOBN(0x634ff82c, 0x48528118), TOBN(0x7c6fe085, 0xcd285911), + TOBN(0x7f2830c0, 0x99358f28), TOBN(0x2e60a95e, 0x665e6c09)}}, + {{TOBN(0x08407d3d, 0x9b785dbf), TOBN(0x530889ab, 0xa759bce7), + TOBN(0xf228e0e6, 0x52f61239), TOBN(0x2b6d1461, 0x6879be3c)}, + {TOBN(0xe6902c04, 0x51a7bbf7), TOBN(0x30ad99f0, 0x76f24a64), + TOBN(0x66d9317a, 0x98bc6da0), TOBN(0xf4f877f3, 0xcb596ac0)}}, + {{TOBN(0xb05ff62d, 0x4c44f119), TOBN(0x4555f536, 0xe9b77416), + TOBN(0xc7c0d059, 0x8caed63b), TOBN(0x0cd2b7ce, 0xc358b2a9)}, + {TOBN(0x3f33287b, 0x46945fa3), TOBN(0xf8785b20, 0xd67c8791), + TOBN(0xc54a7a61, 0x9637bd08), TOBN(0x54d4598c, 0x18be79d7)}}, + {{TOBN(0x889e5acb, 0xc46d7ce1), TOBN(0x9a515bb7, 0x8b085877), + TOBN(0xfac1a03d, 0x0b7a5050), TOBN(0x7d3e738a, 0xf2926035)}, + {TOBN(0x861cc2ce, 0x2a6cb0eb), TOBN(0x6f2e2955, 0x8f7adc79), + TOBN(0x61c4d451, 0x33016376), TOBN(0xd9fd2c80, 0x5ad59090)}}, + {{TOBN(0xe5a83738, 0xb2b836a1), TOBN(0x855b41a0, 0x7c0d6622), + TOBN(0x186fe317, 0x7cc19af1), TOBN(0x6465c1ff, 0xfdd99acb)}, + {TOBN(0x46e5c23f, 0x6974b99e), TOBN(0x75a7cf8b, 0xa2717cbe), + TOBN(0x4d2ebc3f, 0x062be658), TOBN(0x094b4447, 0x5f209c98)}}, + {{TOBN(0x4af285ed, 0xb940cb5a), TOBN(0x6706d792, 0x7cc82f10), + TOBN(0xc8c8776c, 0x030526fa), TOBN(0xfa8e6f76, 0xa0da9140)}, + {TOBN(0x77ea9d34, 0x591ee4f0), TOBN(0x5f46e337, 0x40274166), + TOBN(0x1bdf98bb, 0xea671457), TOBN(0xd7c08b46, 0x862a1fe2)}}, + {{TOBN(0x46cc303c, 0x1c08ad63), TOBN(0x99543440, 0x4c845e7b), + TOBN(0x1b8fbdb5, 0x48f36bf7), TOBN(0x5b82c392, 0x8c8273a7)}, + {TOBN(0x08f712c4, 0x928435d5), TOBN(0x071cf0f1, 0x79330380), + TOBN(0xc74c2d24, 0xa8da054a), TOBN(0xcb0e7201, 0x43c46b5c)}}, + {{TOBN(0x0ad7337a, 0xc0b7eff3), TOBN(0x8552225e, 0xc5e48b3c), + TOBN(0xe6f78b0c, 0x73f13a5f), TOBN(0x5e70062e, 0x82349cbe)}, + {TOBN(0x6b8d5048, 0xe7073969), TOBN(0x392d2a29, 0xc33cb3d2), + TOBN(0xee4f727c, 0x4ecaa20f), TOBN(0xa068c99e, 0x2ccde707)}}, + {{TOBN(0xfcd5651f, 0xb87a2913), TOBN(0xea3e3c15, 0x3cc252f0), + TOBN(0x777d92df, 0x3b6cd3e4), TOBN(0x7a414143, 0xc5a732e7)}, + {TOBN(0xa895951a, 0xa71ff493), TOBN(0xfe980c92, 0xbbd37cf6), + TOBN(0x45bd5e64, 0xdecfeeff), TOBN(0x910dc2a9, 0xa44c43e9)}}, + {{TOBN(0xcb403f26, 0xcca9f54d), TOBN(0x928bbdfb, 0x9303f6db), + TOBN(0x3c37951e, 0xa9eee67c), TOBN(0x3bd61a52, 0xf79961c3)}, + {TOBN(0x09a238e6, 0x395c9a79), TOBN(0x6940ca2d, 0x61eb352d), + TOBN(0x7d1e5c5e, 0xc1875631), TOBN(0x1e19742c, 0x1e1b20d1)}}, + {{TOBN(0x4633d908, 0x23fc2e6e), TOBN(0xa76e29a9, 0x08959149), + TOBN(0x61069d9c, 0x84ed7da5), TOBN(0x0baa11cf, 0x5dbcad51)}, + {TOBN(0xd01eec64, 0x961849da), TOBN(0x93b75f1f, 0xaf3d8c28), + TOBN(0x57bc4f9f, 0x1ca2ee44), TOBN(0x5a26322d, 0x00e00558)}}, + {{TOBN(0x1888d658, 0x61a023ef), TOBN(0x1d72aab4, 0xb9e5246e), + TOBN(0xa9a26348, 0xe5563ec0), TOBN(0xa0971963, 0xc3439a43)}, + {TOBN(0x567dd54b, 0xadb9b5b7), TOBN(0x73fac1a1, 0xc45a524b), + TOBN(0x8fe97ef7, 0xfe38e608), TOBN(0x608748d2, 0x3f384f48)}}, + {{TOBN(0xb0571794, 0xc486094f), TOBN(0x869254a3, 0x8bf3a8d6), + TOBN(0x148a8dd1, 0x310b0e25), TOBN(0x99ab9f3f, 0x9aa3f7d8)}, + {TOBN(0x0927c68a, 0x6706c02e), TOBN(0x22b5e76c, 0x69790e6c), + TOBN(0x6c325260, 0x6c71376c), TOBN(0x53a57690, 0x09ef6657)}}, + {{TOBN(0x8d63f852, 0xedffcf3a), TOBN(0xb4d2ed04, 0x3c0a6f55), + TOBN(0xdb3aa8de, 0x12519b9e), TOBN(0x5d38e9c4, 0x1e0a569a)}, + {TOBN(0x871528bf, 0x303747e2), TOBN(0xa208e77c, 0xf5b5c18d), + TOBN(0x9d129c88, 0xca6bf923), TOBN(0xbcbf197f, 0xbf02839f)}}, + {{TOBN(0x9b9bf030, 0x27323194), TOBN(0x3b055a8b, 0x339ca59d), + TOBN(0xb46b2312, 0x0f669520), TOBN(0x19789f1f, 0x497e5f24)}, + {TOBN(0x9c499468, 0xaaf01801), TOBN(0x72ee1190, 0x8b69d59c), + TOBN(0x8bd39595, 0xacf4c079), TOBN(0x3ee11ece, 0x8e0cd048)}}, + {{TOBN(0xebde86ec, 0x1ed66f18), TOBN(0x225d906b, 0xd61fce43), + TOBN(0x5cab07d6, 0xe8bed74d), TOBN(0x16e4617f, 0x27855ab7)}, + {TOBN(0x6568aadd, 0xb2fbc3dd), TOBN(0xedb5484f, 0x8aeddf5b), + TOBN(0x878f20e8, 0x6dcf2fad), TOBN(0x3516497c, 0x615f5699)}}}, + {{{TOBN(0xef0a3fec, 0xfa181e69), TOBN(0x9ea02f81, 0x30d69a98), + TOBN(0xb2e9cf8e, 0x66eab95d), TOBN(0x520f2beb, 0x24720021)}, + {TOBN(0x621c540a, 0x1df84361), TOBN(0x12037721, 0x71fa6d5d), + TOBN(0x6e3c7b51, 0x0ff5f6ff), TOBN(0x817a069b, 0xabb2bef3)}}, + {{TOBN(0x83572fb6, 0xb294cda6), TOBN(0x6ce9bf75, 0xb9039f34), + TOBN(0x20e012f0, 0x095cbb21), TOBN(0xa0aecc1b, 0xd063f0da)}, + {TOBN(0x57c21c3a, 0xf02909e5), TOBN(0xc7d59ecf, 0x48ce9cdc), + TOBN(0x2732b844, 0x8ae336f8), TOBN(0x056e3723, 0x3f4f85f4)}}, + {{TOBN(0x8a10b531, 0x89e800ca), TOBN(0x50fe0c17, 0x145208fd), + TOBN(0x9e43c0d3, 0xb714ba37), TOBN(0x427d200e, 0x34189acc)}, + {TOBN(0x05dee24f, 0xe616e2c0), TOBN(0x9c25f4c8, 0xee1854c1), + TOBN(0x4d3222a5, 0x8f342a73), TOBN(0x0807804f, 0xa027c952)}}, + {{TOBN(0xc222653a, 0x4f0d56f3), TOBN(0x961e4047, 0xca28b805), + TOBN(0x2c03f8b0, 0x4a73434b), TOBN(0x4c966787, 0xab712a19)}, + {TOBN(0xcc196c42, 0x864fee42), TOBN(0xc1be93da, 0x5b0ece5c), + TOBN(0xa87d9f22, 0xc131c159), TOBN(0x2bb6d593, 0xdce45655)}}, + {{TOBN(0x22c49ec9, 0xb809b7ce), TOBN(0x8a41486b, 0xe2c72c2c), + TOBN(0x813b9420, 0xfea0bf36), TOBN(0xb3d36ee9, 0xa66dac69)}, + {TOBN(0x6fddc08a, 0x328cc987), TOBN(0x0a3bcd2c, 0x3a326461), + TOBN(0x7103c49d, 0xd810dbba), TOBN(0xf9d81a28, 0x4b78a4c4)}}, + {{TOBN(0x3de865ad, 0xe4d55941), TOBN(0xdedafa5e, 0x30384087), + TOBN(0x6f414abb, 0x4ef18b9b), TOBN(0x9ee9ea42, 0xfaee5268)}, + {TOBN(0x260faa16, 0x37a55a4a), TOBN(0xeb19a514, 0x015f93b9), + TOBN(0x51d7ebd2, 0x9e9c3598), TOBN(0x523fc56d, 0x1932178e)}}, + {{TOBN(0x501d070c, 0xb98fe684), TOBN(0xd60fbe9a, 0x124a1458), + TOBN(0xa45761c8, 0x92bc6b3f), TOBN(0xf5384858, 0xfe6f27cb)}, + {TOBN(0x4b0271f7, 0xb59e763b), TOBN(0x3d4606a9, 0x5b5a8e5e), + TOBN(0x1eda5d9b, 0x05a48292), TOBN(0xda7731d0, 0xe6fec446)}}, + {{TOBN(0xa3e33693, 0x90d45871), TOBN(0xe9764040, 0x06166d8d), + TOBN(0xb5c33682, 0x89a90403), TOBN(0x4bd17983, 0x72f1d637)}, + {TOBN(0xa616679e, 0xd5d2c53a), TOBN(0x5ec4bcd8, 0xfdcf3b87), + TOBN(0xae6d7613, 0xb66a694e), TOBN(0x7460fc76, 0xe3fc27e5)}}, + {{TOBN(0x70469b82, 0x95caabee), TOBN(0xde024ca5, 0x889501e3), + TOBN(0x6bdadc06, 0x076ed265), TOBN(0x0cb1236b, 0x5a0ef8b2)}, + {TOBN(0x4065ddbf, 0x0972ebf9), TOBN(0xf1dd3875, 0x22aca432), + TOBN(0xa88b97cf, 0x744aff76), TOBN(0xd1359afd, 0xfe8e3d24)}}, + {{TOBN(0x52a3ba2b, 0x91502cf3), TOBN(0x2c3832a8, 0x084db75d), + TOBN(0x04a12ddd, 0xde30b1c9), TOBN(0x7802eabc, 0xe31fd60c)}, + {TOBN(0x33707327, 0xa37fddab), TOBN(0x65d6f2ab, 0xfaafa973), + TOBN(0x3525c5b8, 0x11e6f91a), TOBN(0x76aeb0c9, 0x5f46530b)}}, + {{TOBN(0xe8815ff6, 0x2f93a675), TOBN(0xa6ec9684, 0x05f48679), + TOBN(0x6dcbb556, 0x358ae884), TOBN(0x0af61472, 0xe19e3873)}, + {TOBN(0x72334372, 0xa5f696be), TOBN(0xc65e57ea, 0x6f22fb70), + TOBN(0x268da30c, 0x946cea90), TOBN(0x136a8a87, 0x65681b2a)}}, + {{TOBN(0xad5e81dc, 0x0f9f44d4), TOBN(0xf09a6960, 0x2c46585a), + TOBN(0xd1649164, 0xc447d1b1), TOBN(0x3b4b36c8, 0x879dc8b1)}, + {TOBN(0x20d4177b, 0x3b6b234c), TOBN(0x096a2505, 0x1730d9d0), + TOBN(0x0611b9b8, 0xef80531d), TOBN(0xba904b3b, 0x64bb495d)}}, + {{TOBN(0x1192d9d4, 0x93a3147a), TOBN(0x9f30a5dc, 0x9a565545), + TOBN(0x90b1f9cb, 0x6ef07212), TOBN(0x29958546, 0x0d87fc13)}, + {TOBN(0xd3323eff, 0xc17db9ba), TOBN(0xcb18548c, 0xcb1644a8), + TOBN(0x18a306d4, 0x4f49ffbc), TOBN(0x28d658f1, 0x4c2e8684)}}, + {{TOBN(0x44ba60cd, 0xa99f8c71), TOBN(0x67b7abdb, 0x4bf742ff), + TOBN(0x66310f9c, 0x914b3f99), TOBN(0xae430a32, 0xf412c161)}, + {TOBN(0x1e6776d3, 0x88ace52f), TOBN(0x4bc0fa24, 0x52d7067d), + TOBN(0x03c286aa, 0x8f07cd1b), TOBN(0x4cb8f38c, 0xa985b2c1)}}, + {{TOBN(0x83ccbe80, 0x8c3bff36), TOBN(0x005a0bd2, 0x5263e575), + TOBN(0x460d7dda, 0x259bdcd1), TOBN(0x4a1c5642, 0xfa5cab6b)}, + {TOBN(0x2b7bdbb9, 0x9fe4fc88), TOBN(0x09418e28, 0xcc97bbb5), + TOBN(0xd8274fb4, 0xa12321ae), TOBN(0xb137007d, 0x5c87b64e)}}, + {{TOBN(0x80531fe1, 0xc63c4962), TOBN(0x50541e89, 0x981fdb25), + TOBN(0xdc1291a1, 0xfd4c2b6b), TOBN(0xc0693a17, 0xa6df4fca)}, + {TOBN(0xb2c4604e, 0x0117f203), TOBN(0x245f1963, 0x0a99b8d0), + TOBN(0xaedc20aa, 0xc6212c44), TOBN(0xb1ed4e56, 0x520f52a8)}}, + {{TOBN(0xfe48f575, 0xf8547be3), TOBN(0x0a7033cd, 0xa9e45f98), + TOBN(0x4b45d3a9, 0x18c50100), TOBN(0xb2a6cd6a, 0xa61d41da)}, + {TOBN(0x60bbb4f5, 0x57933c6b), TOBN(0xa7538ebd, 0x2b0d7ffc), + TOBN(0x9ea3ab8d, 0x8cd626b6), TOBN(0x8273a484, 0x3601625a)}}, + {{TOBN(0x88859845, 0x0168e508), TOBN(0x8cbc9bb2, 0x99a94abd), + TOBN(0x713ac792, 0xfab0a671), TOBN(0xa3995b19, 0x6c9ebffc)}, + {TOBN(0xe711668e, 0x1239e152), TOBN(0x56892558, 0xbbb8dff4), + TOBN(0x8bfc7dab, 0xdbf17963), TOBN(0x5b59fe5a, 0xb3de1253)}}, + {{TOBN(0x7e3320eb, 0x34a9f7ae), TOBN(0xe5e8cf72, 0xd751efe4), + TOBN(0x7ea003bc, 0xd9be2f37), TOBN(0xc0f551a0, 0xb6c08ef7)}, + {TOBN(0x56606268, 0x038f6725), TOBN(0x1dd38e35, 0x6d92d3b6), + TOBN(0x07dfce7c, 0xc3cbd686), TOBN(0x4e549e04, 0x651c5da8)}}, + {{TOBN(0x4058f93b, 0x08b19340), TOBN(0xc2fae6f4, 0xcac6d89d), + TOBN(0x4bad8a8c, 0x8f159cc7), TOBN(0x0ddba4b3, 0xcb0b601c)}, + {TOBN(0xda4fc7b5, 0x1dd95f8c), TOBN(0x1d163cd7, 0xcea5c255), + TOBN(0x30707d06, 0x274a8c4c), TOBN(0x79d9e008, 0x2802e9ce)}}, + {{TOBN(0x02a29ebf, 0xe6ddd505), TOBN(0x37064e74, 0xb50bed1a), + TOBN(0x3f6bae65, 0xa7327d57), TOBN(0x3846f5f1, 0xf83920bc)}, + {TOBN(0x87c37491, 0x60df1b9b), TOBN(0x4cfb2895, 0x2d1da29f), + TOBN(0x10a478ca, 0x4ed1743c), TOBN(0x390c6030, 0x3edd47c6)}}, + {{TOBN(0x8f3e5312, 0x8c0a78de), TOBN(0xccd02bda, 0x1e85df70), + TOBN(0xd6c75c03, 0xa61b6582), TOBN(0x0762921c, 0xfc0eebd1)}, + {TOBN(0xd34d0823, 0xd85010c0), TOBN(0xd73aaacb, 0x0044cf1f), + TOBN(0xfb4159bb, 0xa3b5e78a), TOBN(0x2287c7f7, 0xe5826f3f)}}, + {{TOBN(0x4aeaf742, 0x580b1a01), TOBN(0xf080415d, 0x60423b79), + TOBN(0xe12622cd, 0xa7dea144), TOBN(0x49ea4996, 0x59d62472)}, + {TOBN(0xb42991ef, 0x571f3913), TOBN(0x0610f214, 0xf5b25a8a), + TOBN(0x47adc585, 0x30b79e8f), TOBN(0xf90e3df6, 0x07a065a2)}}, + {{TOBN(0x5d0a5deb, 0x43e2e034), TOBN(0x53fb5a34, 0x444024aa), + TOBN(0xa8628c68, 0x6b0c9f7f), TOBN(0x9c69c29c, 0xac563656)}, + {TOBN(0x5a231feb, 0xbace47b6), TOBN(0xbdce0289, 0x9ea5a2ec), + TOBN(0x05da1fac, 0x9463853e), TOBN(0x96812c52, 0x509e78aa)}}, + {{TOBN(0xd3fb5771, 0x57151692), TOBN(0xeb2721f8, 0xd98e1c44), + TOBN(0xc0506087, 0x32399be1), TOBN(0xda5a5511, 0xd979d8b8)}, + {TOBN(0x737ed55d, 0xc6f56780), TOBN(0xe20d3004, 0x0dc7a7f4), + TOBN(0x02ce7301, 0xf5941a03), TOBN(0x91ef5215, 0xed30f83a)}}, + {{TOBN(0x28727fc1, 0x4092d85f), TOBN(0x72d223c6, 0x5c49e41a), + TOBN(0xa7cf30a2, 0xba6a4d81), TOBN(0x7c086209, 0xb030d87d)}, + {TOBN(0x04844c7d, 0xfc588b09), TOBN(0x728cd499, 0x5874bbb0), + TOBN(0xcc1281ee, 0xe84c0495), TOBN(0x0769b5ba, 0xec31958f)}}, + {{TOBN(0x665c228b, 0xf99c2471), TOBN(0xf2d8a11b, 0x191eb110), + TOBN(0x4594f494, 0xd36d7024), TOBN(0x482ded8b, 0xcdcb25a1)}, + {TOBN(0xc958a9d8, 0xdadd4885), TOBN(0x7004477e, 0xf1d2b547), + TOBN(0x0a45f6ef, 0x2a0af550), TOBN(0x4fc739d6, 0x2f8d6351)}}, + {{TOBN(0x75cdaf27, 0x786f08a9), TOBN(0x8700bb26, 0x42c2737f), + TOBN(0x855a7141, 0x1c4e2670), TOBN(0x810188c1, 0x15076fef)}, + {TOBN(0xc251d0c9, 0xabcd3297), TOBN(0xae4c8967, 0xf48108eb), + TOBN(0xbd146de7, 0x18ceed30), TOBN(0xf9d4f07a, 0xc986bced)}}, + {{TOBN(0x5ad98ed5, 0x83fa1e08), TOBN(0x7780d33e, 0xbeabd1fb), + TOBN(0xe330513c, 0x903b1196), TOBN(0xba11de9e, 0xa47bc8c4)}, + {TOBN(0x684334da, 0x02c2d064), TOBN(0x7ecf360d, 0xa48de23b), + TOBN(0x57a1b474, 0x0a9089d8), TOBN(0xf28fa439, 0xff36734c)}}, + {{TOBN(0xf2a482cb, 0xea4570b3), TOBN(0xee65d68b, 0xa5ebcee9), + TOBN(0x988d0036, 0xb9694cd5), TOBN(0x53edd0e9, 0x37885d32)}, + {TOBN(0xe37e3307, 0xbeb9bc6d), TOBN(0xe9abb907, 0x9f5c6768), + TOBN(0x4396ccd5, 0x51f2160f), TOBN(0x2500888c, 0x47336da6)}}, + {{TOBN(0x383f9ed9, 0x926fce43), TOBN(0x809dd1c7, 0x04da2930), + TOBN(0x30f6f596, 0x8a4cb227), TOBN(0x0d700c7f, 0x73a56b38)}, + {TOBN(0x1825ea33, 0xab64a065), TOBN(0xaab9b735, 0x1338df80), + TOBN(0x1516100d, 0x9b63f57f), TOBN(0x2574395a, 0x27a6a634)}}, + {{TOBN(0xb5560fb6, 0x700a1acd), TOBN(0xe823fd73, 0xfd999681), + TOBN(0xda915d1f, 0x6cb4e1ba), TOBN(0x0d030118, 0x6ebe00a3)}, + {TOBN(0x744fb0c9, 0x89fca8cd), TOBN(0x970d01db, 0xf9da0e0b), + TOBN(0x0ad8c564, 0x7931d76f), TOBN(0xb15737bf, 0xf659b96a)}}, + {{TOBN(0xdc9933e8, 0xa8b484e7), TOBN(0xb2fdbdf9, 0x7a26dec7), + TOBN(0x2349e9a4, 0x9f1f0136), TOBN(0x7860368e, 0x70fddddb)}, + {TOBN(0xd93d2c1c, 0xf9ad3e18), TOBN(0x6d6c5f17, 0x689f4e79), + TOBN(0x7a544d91, 0xb24ff1b6), TOBN(0x3e12a5eb, 0xfe16cd8c)}}, + {{TOBN(0x543574e9, 0xa56b872f), TOBN(0xa1ad550c, 0xfcf68ea2), + TOBN(0x689e37d2, 0x3f560ef7), TOBN(0x8c54b9ca, 0xc9d47a8b)}, + {TOBN(0x46d40a4a, 0x088ac342), TOBN(0xec450c7c, 0x1576c6d0), + TOBN(0xb589e31c, 0x1f9689e9), TOBN(0xdacf2602, 0xb8781718)}}, + {{TOBN(0xa89237c6, 0xc8cb6b42), TOBN(0x1326fc93, 0xb96ef381), + TOBN(0x55d56c6d, 0xb5f07825), TOBN(0xacba2eea, 0x7449e22d)}, + {TOBN(0x74e0887a, 0x633c3000), TOBN(0xcb6cd172, 0xd7cbcf71), + TOBN(0x309e81de, 0xc36cf1be), TOBN(0x07a18a6d, 0x60ae399b)}}, + {{TOBN(0xb36c2679, 0x9edce57e), TOBN(0x52b892f4, 0xdf001d41), + TOBN(0xd884ae5d, 0x16a1f2c6), TOBN(0x9b329424, 0xefcc370a)}, + {TOBN(0x3120daf2, 0xbd2e21df), TOBN(0x55298d2d, 0x02470a99), + TOBN(0x0b78af6c, 0xa05db32e), TOBN(0x5c76a331, 0x601f5636)}}, + {{TOBN(0xaae861ff, 0xf8a4f29c), TOBN(0x70dc9240, 0xd68f8d49), + TOBN(0x960e649f, 0x81b1321c), TOBN(0x3d2c801b, 0x8792e4ce)}, + {TOBN(0xf479f772, 0x42521876), TOBN(0x0bed93bc, 0x416c79b1), + TOBN(0xa67fbc05, 0x263e5bc9), TOBN(0x01e8e630, 0x521db049)}}, + {{TOBN(0x76f26738, 0xc6f3431e), TOBN(0xe609cb02, 0xe3267541), + TOBN(0xb10cff2d, 0x818c877c), TOBN(0x1f0e75ce, 0x786a13cb)}, + {TOBN(0xf4fdca64, 0x1158544d), TOBN(0x5d777e89, 0x6cb71ed0), + TOBN(0x3c233737, 0xa9aa4755), TOBN(0x7b453192, 0xe527ab40)}}, + {{TOBN(0xdb59f688, 0x39f05ffe), TOBN(0x8f4f4be0, 0x6d82574e), + TOBN(0xcce3450c, 0xee292d1b), TOBN(0xaa448a12, 0x61ccd086)}, + {TOBN(0xabce91b3, 0xf7914967), TOBN(0x4537f09b, 0x1908a5ed), + TOBN(0xa812421e, 0xf51042e7), TOBN(0xfaf5cebc, 0xec0b3a34)}}, + {{TOBN(0x730ffd87, 0x4ca6b39a), TOBN(0x70fb72ed, 0x02efd342), + TOBN(0xeb4735f9, 0xd75c8edb), TOBN(0xc11f2157, 0xc278aa51)}, + {TOBN(0xc459f635, 0xbf3bfebf), TOBN(0x3a1ff0b4, 0x6bd9601f), + TOBN(0xc9d12823, 0xc420cb73), TOBN(0x3e9af3e2, 0x3c2915a3)}}, + {{TOBN(0xe0c82c72, 0xb41c3440), TOBN(0x175239e5, 0xe3039a5f), + TOBN(0xe1084b8a, 0x558795a3), TOBN(0x328d0a1d, 0xd01e5c60)}, + {TOBN(0x0a495f2e, 0xd3788a04), TOBN(0x25d8ff16, 0x66c11a9f), + TOBN(0xf5155f05, 0x9ed692d6), TOBN(0x954fa107, 0x4f425fe4)}}, + {{TOBN(0xd16aabf2, 0xe98aaa99), TOBN(0x90cd8ba0, 0x96b0f88a), + TOBN(0x957f4782, 0xc154026a), TOBN(0x54ee0734, 0x52af56d2)}, + {TOBN(0xbcf89e54, 0x45b4147a), TOBN(0x3d102f21, 0x9a52816c), + TOBN(0x6808517e, 0x39b62e77), TOBN(0x92e25421, 0x69169ad8)}}, + {{TOBN(0xd721d871, 0xbb608558), TOBN(0x60e4ebae, 0xf6d4ff9b), + TOBN(0x0ba10819, 0x41f2763e), TOBN(0xca2e45be, 0x51ee3247)}, + {TOBN(0x66d172ec, 0x2bfd7a5f), TOBN(0x528a8f2f, 0x74d0b12d), + TOBN(0xe17f1e38, 0xdabe70dc), TOBN(0x1d5d7316, 0x9f93983c)}}, + {{TOBN(0x51b2184a, 0xdf423e31), TOBN(0xcb417291, 0xaedb1a10), + TOBN(0x2054ca93, 0x625bcab9), TOBN(0x54396860, 0xa98998f0)}, + {TOBN(0x4e53f6c4, 0xa54ae57e), TOBN(0x0ffeb590, 0xee648e9d), + TOBN(0xfbbdaadc, 0x6afaf6bc), TOBN(0xf88ae796, 0xaa3bfb8a)}}, + {{TOBN(0x209f1d44, 0xd2359ed9), TOBN(0xac68dd03, 0xf3544ce2), + TOBN(0xf378da47, 0xfd51e569), TOBN(0xe1abd860, 0x2cc80097)}, + {TOBN(0x23ca18d9, 0x343b6e3a), TOBN(0x480797e8, 0xb40a1bae), + TOBN(0xd1f0c717, 0x533f3e67), TOBN(0x44896970, 0x06e6cdfc)}}, + {{TOBN(0x8ca21055, 0x52a82e8d), TOBN(0xb2caf785, 0x78460cdc), + TOBN(0x4c1b7b62, 0xe9037178), TOBN(0xefc09d2c, 0xdb514b58)}, + {TOBN(0x5f2df9ee, 0x9113be5c), TOBN(0x2fbda78f, 0xb3f9271c), + TOBN(0xe09a81af, 0x8f83fc54), TOBN(0x06b13866, 0x8afb5141)}}, + {{TOBN(0x38f6480f, 0x43e3865d), TOBN(0x72dd77a8, 0x1ddf47d9), + TOBN(0xf2a8e971, 0x4c205ff7), TOBN(0x46d449d8, 0x9d088ad8)}, + {TOBN(0x926619ea, 0x185d706f), TOBN(0xe47e02eb, 0xc7dd7f62), + TOBN(0xe7f120a7, 0x8cbc2031), TOBN(0xc18bef00, 0x998d4ac9)}}, + {{TOBN(0x18f37a9c, 0x6bdf22da), TOBN(0xefbc432f, 0x90dc82df), + TOBN(0xc52cef8e, 0x5d703651), TOBN(0x82887ba0, 0xd99881a5)}, + {TOBN(0x7cec9dda, 0xb920ec1d), TOBN(0xd0d7e8c3, 0xec3e8d3b), + TOBN(0x445bc395, 0x4ca88747), TOBN(0xedeaa2e0, 0x9fd53535)}}, + {{TOBN(0x461b1d93, 0x6cc87475), TOBN(0xd92a52e2, 0x6d2383bd), + TOBN(0xfabccb59, 0xd7903546), TOBN(0x6111a761, 0x3d14b112)}, + {TOBN(0x0ae584fe, 0xb3d5f612), TOBN(0x5ea69b8d, 0x60e828ec), + TOBN(0x6c078985, 0x54087030), TOBN(0x649cab04, 0xac4821fe)}}, + {{TOBN(0x25ecedcf, 0x8bdce214), TOBN(0xb5622f72, 0x86af7361), + TOBN(0x0e1227aa, 0x7038b9e2), TOBN(0xd0efb273, 0xac20fa77)}, + {TOBN(0x817ff88b, 0x79df975b), TOBN(0x856bf286, 0x1999503e), + TOBN(0xb4d5351f, 0x5038ec46), TOBN(0x740a52c5, 0xfc42af6e)}}, + {{TOBN(0x2e38bb15, 0x2cbb1a3f), TOBN(0xc3eb99fe, 0x17a83429), + TOBN(0xca4fcbf1, 0xdd66bb74), TOBN(0x880784d6, 0xcde5e8fc)}, + {TOBN(0xddc84c1c, 0xb4e7a0be), TOBN(0x8780510d, 0xbd15a72f), + TOBN(0x44bcf1af, 0x81ec30e1), TOBN(0x141e50a8, 0x0a61073e)}}, + {{TOBN(0x0d955718, 0x47be87ae), TOBN(0x68a61417, 0xf76a4372), + TOBN(0xf57e7e87, 0xc607c3d3), TOBN(0x043afaf8, 0x5252f332)}, + {TOBN(0xcc14e121, 0x1552a4d2), TOBN(0xb6dee692, 0xbb4d4ab4), + TOBN(0xb6ab74c8, 0xa03816a4), TOBN(0x84001ae4, 0x6f394a29)}}, + {{TOBN(0x5bed8344, 0xd795fb45), TOBN(0x57326e7d, 0xb79f55a5), + TOBN(0xc9533ce0, 0x4accdffc), TOBN(0x53473caf, 0x3993fa04)}, + {TOBN(0x7906eb93, 0xa13df4c8), TOBN(0xa73e51f6, 0x97cbe46f), + TOBN(0xd1ab3ae1, 0x0ae4ccf8), TOBN(0x25614508, 0x8a5b3dbc)}}, + {{TOBN(0x61eff962, 0x11a71b27), TOBN(0xdf71412b, 0x6bb7fa39), + TOBN(0xb31ba6b8, 0x2bd7f3ef), TOBN(0xb0b9c415, 0x69180d29)}, + {TOBN(0xeec14552, 0x014cdde5), TOBN(0x702c624b, 0x227b4bbb), + TOBN(0x2b15e8c2, 0xd3e988f3), TOBN(0xee3bcc6d, 0xa4f7fd04)}}, + {{TOBN(0x9d00822a, 0x42ac6c85), TOBN(0x2db0cea6, 0x1df9f2b7), + TOBN(0xd7cad2ab, 0x42de1e58), TOBN(0x346ed526, 0x2d6fbb61)}, + {TOBN(0xb3962995, 0x1a2faf09), TOBN(0x2fa8a580, 0x7c25612e), + TOBN(0x30ae04da, 0x7cf56490), TOBN(0x75662908, 0x0eea3961)}}, + {{TOBN(0x3609f5c5, 0x3d080847), TOBN(0xcb081d39, 0x5241d4f6), + TOBN(0xb4fb3810, 0x77961a63), TOBN(0xc20c5984, 0x2abb66fc)}, + {TOBN(0x3d40aa7c, 0xf902f245), TOBN(0x9cb12736, 0x4e536b1e), + TOBN(0x5eda24da, 0x99b3134f), TOBN(0xafbd9c69, 0x5cd011af)}}, + {{TOBN(0x9a16e30a, 0xc7088c7d), TOBN(0x5ab65710, 0x3207389f), + TOBN(0x1b09547f, 0xe7407a53), TOBN(0x2322f9d7, 0x4fdc6eab)}, + {TOBN(0xc0f2f22d, 0x7430de4d), TOBN(0x19382696, 0xe68ca9a9), + TOBN(0x17f1eff1, 0x918e5868), TOBN(0xe3b5b635, 0x586f4204)}}, + {{TOBN(0x146ef980, 0x3fbc4341), TOBN(0x359f2c80, 0x5b5eed4e), + TOBN(0x9f35744e, 0x7482e41d), TOBN(0x9a9ac3ec, 0xf3b224c2)}, + {TOBN(0x9161a6fe, 0x91fc50ae), TOBN(0x89ccc66b, 0xc613fa7c), + TOBN(0x89268b14, 0xc732f15a), TOBN(0x7cd6f4e2, 0xb467ed03)}}, + {{TOBN(0xfbf79869, 0xce56b40e), TOBN(0xf93e094c, 0xc02dde98), + TOBN(0xefe0c3a8, 0xedee2cd7), TOBN(0x90f3ffc0, 0xb268fd42)}, + {TOBN(0x81a7fd56, 0x08241aed), TOBN(0x95ab7ad8, 0x00b1afe8), + TOBN(0x40127056, 0x3e310d52), TOBN(0xd3ffdeb1, 0x09d9fc43)}}, + {{TOBN(0xc8f85c91, 0xd11a8594), TOBN(0x2e74d258, 0x31cf6db8), + TOBN(0x829c7ca3, 0x02b5dfd0), TOBN(0xe389cfbe, 0x69143c86)}, + {TOBN(0xd01b6405, 0x941768d8), TOBN(0x45103995, 0x03bf825d), + TOBN(0xcc4ee166, 0x56cd17e2), TOBN(0xbea3c283, 0xba037e79)}}, + {{TOBN(0x4e1ac06e, 0xd9a47520), TOBN(0xfbfe18aa, 0xaf852404), + TOBN(0x5615f8e2, 0x8087648a), TOBN(0x7301e47e, 0xb9d150d9)}, + {TOBN(0x79f9f9dd, 0xb299b977), TOBN(0x76697a7b, 0xa5b78314), + TOBN(0x10d67468, 0x7d7c90e7), TOBN(0x7afffe03, 0x937210b5)}}, + {{TOBN(0x5aef3e4b, 0x28c22cee), TOBN(0xefb0ecd8, 0x09fd55ae), + TOBN(0x4cea7132, 0x0d2a5d6a), TOBN(0x9cfb5fa1, 0x01db6357)}, + {TOBN(0x395e0b57, 0xf36e1ac5), TOBN(0x008fa9ad, 0x36cafb7d), + TOBN(0x8f6cdf70, 0x5308c4db), TOBN(0x51527a37, 0x95ed2477)}}, + {{TOBN(0xba0dee30, 0x5bd21311), TOBN(0x6ed41b22, 0x909c90d7), + TOBN(0xc5f6b758, 0x7c8696d3), TOBN(0x0db8eaa8, 0x3ce83a80)}, + {TOBN(0xd297fe37, 0xb24b4b6f), TOBN(0xfe58afe8, 0x522d1f0d), + TOBN(0x97358736, 0x8c98dbd9), TOBN(0x6bc226ca, 0x9454a527)}}, + {{TOBN(0xa12b384e, 0xce53c2d0), TOBN(0x779d897d, 0x5e4606da), + TOBN(0xa53e47b0, 0x73ec12b0), TOBN(0x462dbbba, 0x5756f1ad)}, + {TOBN(0x69fe09f2, 0xcafe37b6), TOBN(0x273d1ebf, 0xecce2e17), + TOBN(0x8ac1d538, 0x3cf607fd), TOBN(0x8035f7ff, 0x12e10c25)}}}, + {{{TOBN(0x854d34c7, 0x7e6c5520), TOBN(0xc27df9ef, 0xdcb9ea58), + TOBN(0x405f2369, 0xd686666d), TOBN(0x29d1febf, 0x0417aa85)}, + {TOBN(0x9846819e, 0x93470afe), TOBN(0x3e6a9669, 0xe2a27f9e), + TOBN(0x24d008a2, 0xe31e6504), TOBN(0xdba7cecf, 0x9cb7680a)}}, + {{TOBN(0xecaff541, 0x338d6e43), TOBN(0x56f7dd73, 0x4541d5cc), + TOBN(0xb5d426de, 0x96bc88ca), TOBN(0x48d94f6b, 0x9ed3a2c3)}, + {TOBN(0x6354a3bb, 0x2ef8279c), TOBN(0xd575465b, 0x0b1867f2), + TOBN(0xef99b0ff, 0x95225151), TOBN(0xf3e19d88, 0xf94500d8)}}, + {{TOBN(0x92a83268, 0xe32dd620), TOBN(0x913ec99f, 0x627849a2), + TOBN(0xedd8fdfa, 0x2c378882), TOBN(0xaf96f33e, 0xee6f8cfe)}, + {TOBN(0xc06737e5, 0xdc3fa8a5), TOBN(0x236bb531, 0xb0b03a1d), + TOBN(0x33e59f29, 0x89f037b0), TOBN(0x13f9b5a7, 0xd9a12a53)}}, + {{TOBN(0x0d0df6ce, 0x51efb310), TOBN(0xcb5b2eb4, 0x958df5be), + TOBN(0xd6459e29, 0x36158e59), TOBN(0x82aae2b9, 0x1466e336)}, + {TOBN(0xfb658a39, 0x411aa636), TOBN(0x7152ecc5, 0xd4c0a933), + TOBN(0xf10c758a, 0x49f026b7), TOBN(0xf4837f97, 0xcb09311f)}}, + {{TOBN(0xddfb02c4, 0xc753c45f), TOBN(0x18ca81b6, 0xf9c840fe), + TOBN(0x846fd09a, 0xb0f8a3e6), TOBN(0xb1162add, 0xe7733dbc)}, + {TOBN(0x7070ad20, 0x236e3ab6), TOBN(0xf88cdaf5, 0xb2a56326), + TOBN(0x05fc8719, 0x997cbc7a), TOBN(0x442cd452, 0x4b665272)}}, + {{TOBN(0x7807f364, 0xb71698f5), TOBN(0x6ba418d2, 0x9f7b605e), + TOBN(0xfd20b00f, 0xa03b2cbb), TOBN(0x883eca37, 0xda54386f)}, + {TOBN(0xff0be43f, 0xf3437f24), TOBN(0xe910b432, 0xa48bb33c), + TOBN(0x4963a128, 0x329df765), TOBN(0xac1dd556, 0xbe2fe6f7)}}, + {{TOBN(0x557610f9, 0x24a0a3fc), TOBN(0x38e17bf4, 0xe881c3f9), + TOBN(0x6ba84faf, 0xed0dac99), TOBN(0xd4a222c3, 0x59eeb918)}, + {TOBN(0xc79c1dbe, 0x13f542b6), TOBN(0x1fc65e0d, 0xe425d457), + TOBN(0xeffb754f, 0x1debb779), TOBN(0x638d8fd0, 0x9e08af60)}}, + {{TOBN(0x994f523a, 0x626332d5), TOBN(0x7bc38833, 0x5561bb44), + TOBN(0x005ed4b0, 0x3d845ea2), TOBN(0xd39d3ee1, 0xc2a1f08a)}, + {TOBN(0x6561fdd3, 0xe7676b0d), TOBN(0x620e35ff, 0xfb706017), + TOBN(0x36ce424f, 0xf264f9a8), TOBN(0xc4c3419f, 0xda2681f7)}}, + {{TOBN(0xfb6afd2f, 0x69beb6e8), TOBN(0x3a50b993, 0x6d700d03), + TOBN(0xc840b2ad, 0x0c83a14f), TOBN(0x573207be, 0x54085bef)}, + {TOBN(0x5af882e3, 0x09fe7e5b), TOBN(0x957678a4, 0x3b40a7e1), + TOBN(0x172d4bdd, 0x543056e2), TOBN(0x9c1b26b4, 0x0df13c0a)}}, + {{TOBN(0x1c30861c, 0xf405ff06), TOBN(0xebac86bd, 0x486e828b), + TOBN(0xe791a971, 0x636933fc), TOBN(0x50e7c2be, 0x7aeee947)}, + {TOBN(0xc3d4a095, 0xfa90d767), TOBN(0xae60eb7b, 0xe670ab7b), + TOBN(0x17633a64, 0x397b056d), TOBN(0x93a21f33, 0x105012aa)}}, + {{TOBN(0x663c370b, 0xabb88643), TOBN(0x91df36d7, 0x22e21599), + TOBN(0x183ba835, 0x8b761671), TOBN(0x381eea1d, 0x728f3bf1)}, + {TOBN(0xb9b2f1ba, 0x39966e6c), TOBN(0x7c464a28, 0xe7295492), + TOBN(0x0fd5f70a, 0x09b26b7f), TOBN(0xa9aba1f9, 0xfbe009df)}}, + {{TOBN(0x857c1f22, 0x369b87ad), TOBN(0x3c00e5d9, 0x32fca556), + TOBN(0x1ad74cab, 0x90b06466), TOBN(0xa7112386, 0x550faaf2)}, + {TOBN(0x7435e198, 0x6d9bd5f5), TOBN(0x2dcc7e38, 0x59c3463f), + TOBN(0xdc7df748, 0xca7bd4b2), TOBN(0x13cd4c08, 0x9dec2f31)}}, + {{TOBN(0x0d3b5df8, 0xe3237710), TOBN(0x0dadb26e, 0xcbd2f7b0), + TOBN(0x9f5966ab, 0xe4aa082b), TOBN(0x666ec8de, 0x350e966e)}, + {TOBN(0x1bfd1ed5, 0xee524216), TOBN(0xcd93c59b, 0x41dab0b6), + TOBN(0x658a8435, 0xd186d6ba), TOBN(0x1b7d34d2, 0x159d1195)}}, + {{TOBN(0x5936e460, 0x22caf46b), TOBN(0x6a45dd8f, 0x9a96fe4f), + TOBN(0xf7925434, 0xb98f474e), TOBN(0x41410412, 0x0053ef15)}, + {TOBN(0x71cf8d12, 0x41de97bf), TOBN(0xb8547b61, 0xbd80bef4), + TOBN(0xb47d3970, 0xc4db0037), TOBN(0xf1bcd328, 0xfef20dff)}}, + {{TOBN(0x31a92e09, 0x10caad67), TOBN(0x1f591960, 0x5531a1e1), + TOBN(0x3bb852e0, 0x5f4fc840), TOBN(0x63e297ca, 0x93a72c6c)}, + {TOBN(0x3c2b0b2e, 0x49abad67), TOBN(0x6ec405fc, 0xed3db0d9), + TOBN(0xdc14a530, 0x7fef1d40), TOBN(0xccd19846, 0x280896fc)}}, + {{TOBN(0x00f83176, 0x9bb81648), TOBN(0xd69eb485, 0x653120d0), + TOBN(0xd17d75f4, 0x4ccabc62), TOBN(0x34a07f82, 0xb749fcb1)}, + {TOBN(0x2c3af787, 0xbbfb5554), TOBN(0xb06ed4d0, 0x62e283f8), + TOBN(0x5722889f, 0xa19213a0), TOBN(0x162b085e, 0xdcf3c7b4)}}, + {{TOBN(0xbcaecb31, 0xe0dd3eca), TOBN(0xc6237fbc, 0xe52f13a5), + TOBN(0xcc2b6b03, 0x27bac297), TOBN(0x2ae1cac5, 0xb917f54a)}, + {TOBN(0x474807d4, 0x7845ae4f), TOBN(0xfec7dd92, 0xce5972e0), + TOBN(0xc3bd2541, 0x1d7915bb), TOBN(0x66f85dc4, 0xd94907ca)}}, + {{TOBN(0xd981b888, 0xbdbcf0ca), TOBN(0xd75f5da6, 0xdf279e9f), + TOBN(0x128bbf24, 0x7054e934), TOBN(0x3c6ff6e5, 0x81db134b)}, + {TOBN(0x795b7cf4, 0x047d26e4), TOBN(0xf370f7b8, 0x5049ec37), + TOBN(0xc6712d4d, 0xced945af), TOBN(0xdf30b5ec, 0x095642bc)}}, + {{TOBN(0x9b034c62, 0x4896246e), TOBN(0x5652c016, 0xee90bbd1), + TOBN(0xeb38636f, 0x87fedb73), TOBN(0x5e32f847, 0x0135a613)}, + {TOBN(0x0703b312, 0xcf933c83), TOBN(0xd05bb76e, 0x1a7f47e6), + TOBN(0x825e4f0c, 0x949c2415), TOBN(0x569e5622, 0x7250d6f8)}}, + {{TOBN(0xbbe9eb3a, 0x6568013e), TOBN(0x8dbd203f, 0x22f243fc), + TOBN(0x9dbd7694, 0xb342734a), TOBN(0x8f6d12f8, 0x46afa984)}, + {TOBN(0xb98610a2, 0xc9eade29), TOBN(0xbab4f323, 0x47dd0f18), + TOBN(0x5779737b, 0x671c0d46), TOBN(0x10b6a7c6, 0xd3e0a42a)}}, + {{TOBN(0xfb19ddf3, 0x3035b41c), TOBN(0xd336343f, 0x99c45895), + TOBN(0x61fe4938, 0x54c857e5), TOBN(0xc4d506be, 0xae4e57d5)}, + {TOBN(0x3cd8c8cb, 0xbbc33f75), TOBN(0x7281f08a, 0x9262c77d), + TOBN(0x083f4ea6, 0xf11a2823), TOBN(0x8895041e, 0x9fba2e33)}}, + {{TOBN(0xfcdfea49, 0x9c438edf), TOBN(0x7678dcc3, 0x91edba44), + TOBN(0xf07b3b87, 0xe2ba50f0), TOBN(0xc13888ef, 0x43948c1b)}, + {TOBN(0xc2135ad4, 0x1140af42), TOBN(0x8e5104f3, 0x926ed1a7), + TOBN(0xf24430cb, 0x88f6695f), TOBN(0x0ce0637b, 0x6d73c120)}}, + {{TOBN(0xb2db01e6, 0xfe631e8f), TOBN(0x1c5563d7, 0xd7bdd24b), + TOBN(0x8daea3ba, 0x369ad44f), TOBN(0x000c81b6, 0x8187a9f9)}, + {TOBN(0x5f48a951, 0xaae1fd9a), TOBN(0xe35626c7, 0x8d5aed8a), + TOBN(0x20952763, 0x0498c622), TOBN(0x76d17634, 0x773aa504)}}, + {{TOBN(0x36d90dda, 0xeb300f7a), TOBN(0x9dcf7dfc, 0xedb5e801), + TOBN(0x645cb268, 0x74d5244c), TOBN(0xa127ee79, 0x348e3aa2)}, + {TOBN(0x488acc53, 0x575f1dbb), TOBN(0x95037e85, 0x80e6161e), + TOBN(0x57e59283, 0x292650d0), TOBN(0xabe67d99, 0x14938216)}}, + {{TOBN(0x3c7f944b, 0x3f8e1065), TOBN(0xed908cb6, 0x330e8924), + TOBN(0x08ee8fd5, 0x6f530136), TOBN(0x2227b7d5, 0xd7ffc169)}, + {TOBN(0x4f55c893, 0xb5cd6dd5), TOBN(0x82225e11, 0xa62796e8), + TOBN(0x5c6cead1, 0xcb18e12c), TOBN(0x4381ae0c, 0x84f5a51a)}}, + {{TOBN(0x345913d3, 0x7fafa4c8), TOBN(0x3d918082, 0x0491aac0), + TOBN(0x9347871f, 0x3e69264c), TOBN(0xbea9dd3c, 0xb4f4f0cd)}, + {TOBN(0xbda5d067, 0x3eadd3e7), TOBN(0x0033c1b8, 0x0573bcd8), + TOBN(0x25589379, 0x5da2486c), TOBN(0xcb89ee5b, 0x86abbee7)}}, + {{TOBN(0x8fe0a8f3, 0x22532e5d), TOBN(0xb6410ff0, 0x727dfc4c), + TOBN(0x619b9d58, 0x226726db), TOBN(0x5ec25669, 0x7a2b2dc7)}, + {TOBN(0xaf4d2e06, 0x4c3beb01), TOBN(0x852123d0, 0x7acea556), + TOBN(0x0e9470fa, 0xf783487a), TOBN(0x75a7ea04, 0x5664b3eb)}}, + {{TOBN(0x4ad78f35, 0x6798e4ba), TOBN(0x9214e6e5, 0xc7d0e091), + TOBN(0xc420b488, 0xb1290403), TOBN(0x64049e0a, 0xfc295749)}, + {TOBN(0x03ef5af1, 0x3ae9841f), TOBN(0xdbe4ca19, 0xb0b662a6), + TOBN(0x46845c5f, 0xfa453458), TOBN(0xf8dabf19, 0x10b66722)}}, + {{TOBN(0xb650f0aa, 0xcce2793b), TOBN(0x71db851e, 0xc5ec47c1), + TOBN(0x3eb78f3e, 0x3b234fa9), TOBN(0xb0c60f35, 0xfc0106ce)}, + {TOBN(0x05427121, 0x774eadbd), TOBN(0x25367faf, 0xce323863), + TOBN(0x7541b5c9, 0xcd086976), TOBN(0x4ff069e2, 0xdc507ad1)}}, + {{TOBN(0x74145256, 0x8776e667), TOBN(0x6e76142c, 0xb23c6bb5), + TOBN(0xdbf30712, 0x1b3a8a87), TOBN(0x60e7363e, 0x98450836)}, + {TOBN(0x5741450e, 0xb7366d80), TOBN(0xe4ee14ca, 0x4837dbdf), + TOBN(0xa765eb9b, 0x69d4316f), TOBN(0x04548dca, 0x8ef43825)}}, + {{TOBN(0x9c9f4e4c, 0x5ae888eb), TOBN(0x733abb51, 0x56e9ac99), + TOBN(0xdaad3c20, 0xba6ac029), TOBN(0x9b8dd3d3, 0x2ba3e38e)}, + {TOBN(0xa9bb4c92, 0x0bc5d11a), TOBN(0xf20127a7, 0x9c5f88a3), + TOBN(0x4f52b06e, 0x161d3cb8), TOBN(0x26c1ff09, 0x6afaf0a6)}}, + {{TOBN(0x32670d2f, 0x7189e71f), TOBN(0xc6438748, 0x5ecf91e7), + TOBN(0x15758e57, 0xdb757a21), TOBN(0x427d09f8, 0x290a9ce5)}, + {TOBN(0x846a308f, 0x38384a7a), TOBN(0xaac3acb4, 0xb0732b99), + TOBN(0x9e941009, 0x17845819), TOBN(0x95cba111, 0xa7ce5e03)}}, + {{TOBN(0x6f3d4f7f, 0xb00009c4), TOBN(0xb8396c27, 0x8ff28b5f), + TOBN(0xb1a9ae43, 0x1c97975d), TOBN(0x9d7ba8af, 0xe5d9fed5)}, + {TOBN(0x338cf09f, 0x34f485b6), TOBN(0xbc0ddacc, 0x64122516), + TOBN(0xa450da12, 0x05d471fe), TOBN(0x4c3a6250, 0x628dd8c9)}}, + {{TOBN(0x69c7d103, 0xd1295837), TOBN(0xa2893e50, 0x3807eb2f), + TOBN(0xd6e1e1de, 0xbdb41491), TOBN(0xc630745b, 0x5e138235)}, + {TOBN(0xc892109e, 0x48661ae1), TOBN(0x8d17e7eb, 0xea2b2674), + TOBN(0x00ec0f87, 0xc328d6b5), TOBN(0x6d858645, 0xf079ff9e)}}, + {{TOBN(0x6cdf243e, 0x19115ead), TOBN(0x1ce1393e, 0x4bac4fcf), + TOBN(0x2c960ed0, 0x9c29f25b), TOBN(0x59be4d8e, 0x9d388a05)}, + {TOBN(0x0d46e06c, 0xd0def72b), TOBN(0xb923db5d, 0xe0342748), + TOBN(0xf7d3aacd, 0x936d4a3d), TOBN(0x558519cc, 0x0b0b099e)}}, + {{TOBN(0x3ea8ebf8, 0x827097ef), TOBN(0x259353db, 0xd054f55d), + TOBN(0x84c89abc, 0x6d2ed089), TOBN(0x5c548b69, 0x8e096a7c)}, + {TOBN(0xd587f616, 0x994b995d), TOBN(0x4d1531f6, 0xa5845601), + TOBN(0x792ab31e, 0x451fd9f0), TOBN(0xc8b57bb2, 0x65adf6ca)}}, + {{TOBN(0x68440fcb, 0x1cd5ad73), TOBN(0xb9c860e6, 0x6144da4f), + TOBN(0x2ab286aa, 0x8462beb8), TOBN(0xcc6b8fff, 0xef46797f)}, + {TOBN(0xac820da4, 0x20c8a471), TOBN(0x69ae05a1, 0x77ff7faf), + TOBN(0xb9163f39, 0xbfb5da77), TOBN(0xbd03e590, 0x2c73ab7a)}}, + {{TOBN(0x7e862b5e, 0xb2940d9e), TOBN(0x3c663d86, 0x4b9af564), + TOBN(0xd8309031, 0xbde3033d), TOBN(0x298231b2, 0xd42c5bc6)}, + {TOBN(0x42090d2c, 0x552ad093), TOBN(0xa4799d1c, 0xff854695), + TOBN(0x0a88b5d6, 0xd31f0d00), TOBN(0xf8b40825, 0xa2f26b46)}}, + {{TOBN(0xec29b1ed, 0xf1bd7218), TOBN(0xd491c53b, 0x4b24c86e), + TOBN(0xd2fe588f, 0x3395ea65), TOBN(0x6f3764f7, 0x4456ef15)}, + {TOBN(0xdb43116d, 0xcdc34800), TOBN(0xcdbcd456, 0xc1e33955), + TOBN(0xefdb5540, 0x74ab286b), TOBN(0x948c7a51, 0xd18c5d7c)}}, + {{TOBN(0xeb81aa37, 0x7378058e), TOBN(0x41c746a1, 0x04411154), + TOBN(0xa10c73bc, 0xfb828ac7), TOBN(0x6439be91, 0x9d972b29)}, + {TOBN(0x4bf3b4b0, 0x43a2fbad), TOBN(0x39e6dadf, 0x82b5e840), + TOBN(0x4f716408, 0x6397bd4c), TOBN(0x0f7de568, 0x7f1eeccb)}}, + {{TOBN(0x5865c5a1, 0xd2ffbfc1), TOBN(0xf74211fa, 0x4ccb6451), + TOBN(0x66368a88, 0xc0b32558), TOBN(0x5b539dc2, 0x9ad7812e)}, + {TOBN(0x579483d0, 0x2f3af6f6), TOBN(0x52132078, 0x99934ece), + TOBN(0x50b9650f, 0xdcc9e983), TOBN(0xca989ec9, 0xaee42b8a)}}, + {{TOBN(0x6a44c829, 0xd6f62f99), TOBN(0x8f06a309, 0x4c2a7c0c), + TOBN(0x4ea2b3a0, 0x98a0cb0a), TOBN(0x5c547b70, 0xbeee8364)}, + {TOBN(0x461d40e1, 0x682afe11), TOBN(0x9e0fc77a, 0x7b41c0a8), + TOBN(0x79e4aefd, 0xe20d5d36), TOBN(0x2916e520, 0x32dd9f63)}}, + {{TOBN(0xf59e52e8, 0x3f883faf), TOBN(0x396f9639, 0x2b868d35), + TOBN(0xc902a9df, 0x4ca19881), TOBN(0x0fc96822, 0xdb2401a6)}, + {TOBN(0x41237587, 0x66f1c68d), TOBN(0x10fc6de3, 0xfb476c0d), + TOBN(0xf8b6b579, 0x841f5d90), TOBN(0x2ba8446c, 0xfa24f44a)}}, + {{TOBN(0xa237b920, 0xef4a9975), TOBN(0x60bb6004, 0x2330435f), + TOBN(0xd6f4ab5a, 0xcfb7e7b5), TOBN(0xb2ac5097, 0x83435391)}, + {TOBN(0xf036ee2f, 0xb0d1ea67), TOBN(0xae779a6a, 0x74c56230), + TOBN(0x59bff8c8, 0xab838ae6), TOBN(0xcd83ca99, 0x9b38e6f0)}}, + {{TOBN(0xbb27bef5, 0xe33deed3), TOBN(0xe6356f6f, 0x001892a8), + TOBN(0xbf3be6cc, 0x7adfbd3e), TOBN(0xaecbc81c, 0x33d1ac9d)}, + {TOBN(0xe4feb909, 0xe6e861dc), TOBN(0x90a247a4, 0x53f5f801), + TOBN(0x01c50acb, 0x27346e57), TOBN(0xce29242e, 0x461acc1b)}}, + {{TOBN(0x04dd214a, 0x2f998a91), TOBN(0x271ee9b1, 0xd4baf27b), + TOBN(0x7e3027d1, 0xe8c26722), TOBN(0x21d1645c, 0x1820dce5)}, + {TOBN(0x086f242c, 0x7501779c), TOBN(0xf0061407, 0xfa0e8009), + TOBN(0xf23ce477, 0x60187129), TOBN(0x05bbdedb, 0x0fde9bd0)}}, + {{TOBN(0x682f4832, 0x25d98473), TOBN(0xf207fe85, 0x5c658427), + TOBN(0xb6fdd7ba, 0x4166ffa1), TOBN(0x0c314056, 0x9eed799d)}, + {TOBN(0x0db8048f, 0x4107e28f), TOBN(0x74ed3871, 0x41216840), + TOBN(0x74489f8f, 0x56a3c06e), TOBN(0x1e1c005b, 0x12777134)}}, + {{TOBN(0xdb332a73, 0xf37ec3c3), TOBN(0xc65259bd, 0xdd59eba0), + TOBN(0x2291709c, 0xdb4d3257), TOBN(0x9a793b25, 0xbd389390)}, + {TOBN(0xf39fe34b, 0xe43756f0), TOBN(0x2f76bdce, 0x9afb56c9), + TOBN(0x9f37867a, 0x61208b27), TOBN(0xea1d4307, 0x089972c3)}}, + {{TOBN(0x8c595330, 0x8bdf623a), TOBN(0x5f5accda, 0x8441fb7d), + TOBN(0xfafa9418, 0x32ddfd95), TOBN(0x6ad40c5a, 0x0fde9be7)}, + {TOBN(0x43faba89, 0xaeca8709), TOBN(0xc64a7cf1, 0x2c248a9d), + TOBN(0x16620252, 0x72637a76), TOBN(0xaee1c791, 0x22b8d1bb)}}, + {{TOBN(0xf0f798fd, 0x21a843b2), TOBN(0x56e4ed4d, 0x8d005cb1), + TOBN(0x355f7780, 0x1f0d8abe), TOBN(0x197b04cf, 0x34522326)}, + {TOBN(0x41f9b31f, 0xfd42c13f), TOBN(0x5ef7feb2, 0xb40f933d), + TOBN(0x27326f42, 0x5d60bad4), TOBN(0x027ecdb2, 0x8c92cf89)}}, + {{TOBN(0x04aae4d1, 0x4e3352fe), TOBN(0x08414d2f, 0x73591b90), + TOBN(0x5ed6124e, 0xb7da7d60), TOBN(0xb985b931, 0x4d13d4ec)}, + {TOBN(0xa592d3ab, 0x96bf36f9), TOBN(0x012dbed5, 0xbbdf51df), + TOBN(0xa57963c0, 0xdf6c177d), TOBN(0x010ec869, 0x87ca29cf)}}, + {{TOBN(0xba1700f6, 0xbf926dff), TOBN(0x7c9fdbd1, 0xf4bf6bc2), + TOBN(0xdc18dc8f, 0x64da11f5), TOBN(0xa6074b7a, 0xd938ae75)}, + {TOBN(0x14270066, 0xe84f44a4), TOBN(0x99998d38, 0xd27b954e), + TOBN(0xc1be8ab2, 0xb4f38e9a), TOBN(0x8bb55bbf, 0x15c01016)}}, + {{TOBN(0xf73472b4, 0x0ea2ab30), TOBN(0xd365a340, 0xf73d68dd), + TOBN(0xc01a7168, 0x19c2e1eb), TOBN(0x32f49e37, 0x34061719)}, + {TOBN(0xb73c57f1, 0x01d8b4d6), TOBN(0x03c8423c, 0x26b47700), + TOBN(0x321d0bc8, 0xa4d8826a), TOBN(0x6004213c, 0x4bc0e638)}}, + {{TOBN(0xf78c64a1, 0xc1c06681), TOBN(0x16e0a16f, 0xef018e50), + TOBN(0x31cbdf91, 0xdb42b2b3), TOBN(0xf8f4ffce, 0xe0d36f58)}, + {TOBN(0xcdcc71cd, 0x4cc5e3e0), TOBN(0xd55c7cfa, 0xa129e3e0), + TOBN(0xccdb6ba0, 0x0fb2cbf1), TOBN(0x6aba0005, 0xc4bce3cb)}}, + {{TOBN(0x501cdb30, 0xd232cfc4), TOBN(0x9ddcf12e, 0xd58a3cef), + TOBN(0x02d2cf9c, 0x87e09149), TOBN(0xdc5d7ec7, 0x2c976257)}, + {TOBN(0x6447986e, 0x0b50d7dd), TOBN(0x88fdbaf7, 0x807f112a), + TOBN(0x58c9822a, 0xb00ae9f6), TOBN(0x6abfb950, 0x6d3d27e0)}}, + {{TOBN(0xd0a74487, 0x8a429f4f), TOBN(0x0649712b, 0xdb516609), + TOBN(0xb826ba57, 0xe769b5df), TOBN(0x82335df2, 0x1fc7aaf2)}, + {TOBN(0x2389f067, 0x5c93d995), TOBN(0x59ac367a, 0x68677be6), + TOBN(0xa77985ff, 0x21d9951b), TOBN(0x038956fb, 0x85011cce)}}, + {{TOBN(0x608e48cb, 0xbb734e37), TOBN(0xc08c0bf2, 0x2be5b26f), + TOBN(0x17bbdd3b, 0xf9b1a0d9), TOBN(0xeac7d898, 0x10483319)}, + {TOBN(0xc95c4baf, 0xbc1a6dea), TOBN(0xfdd0e2bf, 0x172aafdb), + TOBN(0x40373cbc, 0x8235c41a), TOBN(0x14303f21, 0xfb6f41d5)}}, + {{TOBN(0xba063621, 0x0408f237), TOBN(0xcad3b09a, 0xecd2d1ed), + TOBN(0x4667855a, 0x52abb6a2), TOBN(0xba9157dc, 0xaa8b417b)}, + {TOBN(0xfe7f3507, 0x4f013efb), TOBN(0x1b112c4b, 0xaa38c4a2), + TOBN(0xa1406a60, 0x9ba64345), TOBN(0xe53cba33, 0x6993c80b)}}, + {{TOBN(0x45466063, 0xded40d23), TOBN(0x3d5f1f4d, 0x54908e25), + TOBN(0x9ebefe62, 0x403c3c31), TOBN(0x274ea0b5, 0x0672a624)}, + {TOBN(0xff818d99, 0x451d1b71), TOBN(0x80e82643, 0x8f79cf79), + TOBN(0xa165df13, 0x73ce37f5), TOBN(0xa744ef4f, 0xfe3a21fd)}}, + {{TOBN(0x73f1e7f5, 0xcf551396), TOBN(0xc616898e, 0x868c676b), + TOBN(0x671c28c7, 0x8c442c36), TOBN(0xcfe5e558, 0x5e0a317d)}, + {TOBN(0x1242d818, 0x7051f476), TOBN(0x56fad2a6, 0x14f03442), + TOBN(0x262068bc, 0x0a44d0f6), TOBN(0xdfa2cd6e, 0xce6edf4e)}}, + {{TOBN(0x0f43813a, 0xd15d1517), TOBN(0x61214cb2, 0x377d44f5), + TOBN(0xd399aa29, 0xc639b35f), TOBN(0x42136d71, 0x54c51c19)}, + {TOBN(0x9774711b, 0x08417221), TOBN(0x0a5546b3, 0x52545a57), + TOBN(0x80624c41, 0x1150582d), TOBN(0x9ec5c418, 0xfbc555bc)}}, + {{TOBN(0x2c87dcad, 0x771849f1), TOBN(0xb0c932c5, 0x01d7bf6f), + TOBN(0x6aa5cd3e, 0x89116eb2), TOBN(0xd378c25a, 0x51ca7bd3)}, + {TOBN(0xc612a0da, 0x9e6e3e31), TOBN(0x0417a54d, 0xb68ad5d0), + TOBN(0x00451e4a, 0x22c6edb8), TOBN(0x9fbfe019, 0xb42827ce)}}, + {{TOBN(0x2fa92505, 0xba9384a2), TOBN(0x21b8596e, 0x64ad69c1), + TOBN(0x8f4fcc49, 0x983b35a6), TOBN(0xde093760, 0x72754672)}, + {TOBN(0x2f14ccc8, 0xf7bffe6d), TOBN(0x27566bff, 0x5d94263d), + TOBN(0xb5b4e9c6, 0x2df3ec30), TOBN(0x94f1d7d5, 0x3e6ea6ba)}}, + {{TOBN(0x97b7851a, 0xaaca5e9b), TOBN(0x518aa521, 0x56713b97), + TOBN(0x3357e8c7, 0x150a61f6), TOBN(0x7842e7e2, 0xec2c2b69)}, + {TOBN(0x8dffaf65, 0x6868a548), TOBN(0xd963bd82, 0xe068fc81), + TOBN(0x64da5c8b, 0x65917733), TOBN(0x927090ff, 0x7b247328)}}}, + {{{TOBN(0x214bc9a7, 0xd298c241), TOBN(0xe3b697ba, 0x56807cfd), + TOBN(0xef1c7802, 0x4564eadb), TOBN(0xdde8cdcf, 0xb48149c5)}, + {TOBN(0x946bf0a7, 0x5a4d2604), TOBN(0x27154d7f, 0x6c1538af), + TOBN(0x95cc9230, 0xde5b1fcc), TOBN(0xd88519e9, 0x66864f82)}}, + {{TOBN(0xb828dd1a, 0x7cb1282c), TOBN(0xa08d7626, 0xbe46973a), + TOBN(0x6baf8d40, 0xe708d6b2), TOBN(0x72571fa1, 0x4daeb3f3)}, + {TOBN(0x85b1732f, 0xf22dfd98), TOBN(0x87ab01a7, 0x0087108d), + TOBN(0xaaaafea8, 0x5988207a), TOBN(0xccc832f8, 0x69f00755)}}, + {{TOBN(0x964d950e, 0x36ff3bf0), TOBN(0x8ad20f6f, 0xf0b34638), + TOBN(0x4d9177b3, 0xb5d7585f), TOBN(0xcf839760, 0xef3f019f)}, + {TOBN(0x582fc5b3, 0x8288c545), TOBN(0x2f8e4e9b, 0x13116bd1), + TOBN(0xf91e1b2f, 0x332120ef), TOBN(0xcf568724, 0x2a17dd23)}}, + {{TOBN(0x488f1185, 0xca8d9d1a), TOBN(0xadf2c77d, 0xd987ded2), + TOBN(0x5f3039f0, 0x60c46124), TOBN(0xe5d70b75, 0x71e095f4)}, + {TOBN(0x82d58650, 0x6260e70f), TOBN(0x39d75ea7, 0xf750d105), + TOBN(0x8cf3d0b1, 0x75bac364), TOBN(0xf3a7564d, 0x21d01329)}}, + {{TOBN(0x182f04cd, 0x2f52d2a7), TOBN(0x4fde149a, 0xe2df565a), + TOBN(0xb80c5eec, 0xa79fb2f7), TOBN(0xab491d7b, 0x22ddc897)}, + {TOBN(0x99d76c18, 0xc6312c7f), TOBN(0xca0d5f3d, 0x6aa41a57), + TOBN(0x71207325, 0xd15363a0), TOBN(0xe82aa265, 0xbeb252c2)}}, + {{TOBN(0x94ab4700, 0xec3128c2), TOBN(0x6c76d862, 0x8e383f49), + TOBN(0xdc36b150, 0xc03024eb), TOBN(0xfb439477, 0x53daac69)}, + {TOBN(0xfc68764a, 0x8dc79623), TOBN(0x5b86995d, 0xb440fbb2), + TOBN(0xd66879bf, 0xccc5ee0d), TOBN(0x05228942, 0x95aa8bd3)}}, + {{TOBN(0xb51a40a5, 0x1e6a75c1), TOBN(0x24327c76, 0x0ea7d817), + TOBN(0x06630182, 0x07774597), TOBN(0xd6fdbec3, 0x97fa7164)}, + {TOBN(0x20c99dfb, 0x13c90f48), TOBN(0xd6ac5273, 0x686ef263), + TOBN(0xc6a50bdc, 0xfef64eeb), TOBN(0xcd87b281, 0x86fdfc32)}}, + {{TOBN(0xb24aa43e, 0x3fcd3efc), TOBN(0xdd26c034, 0xb8088e9a), + TOBN(0xa5ef4dc9, 0xbd3d46ea), TOBN(0xa2f99d58, 0x8a4c6a6f)}, + {TOBN(0xddabd355, 0x2f1da46c), TOBN(0x72c3f8ce, 0x1afacdd1), + TOBN(0xd90c4eee, 0x92d40578), TOBN(0xd28bb41f, 0xca623b94)}}, + {{TOBN(0x50fc0711, 0x745edc11), TOBN(0x9dd9ad7d, 0x3dc87558), + TOBN(0xce6931fb, 0xb49d1e64), TOBN(0x6c77a0a2, 0xc98bd0f9)}, + {TOBN(0x62b9a629, 0x6baf7cb1), TOBN(0xcf065f91, 0xccf72d22), + TOBN(0x7203cce9, 0x79639071), TOBN(0x09ae4885, 0xf9cb732f)}}, + {{TOBN(0x5e7c3bec, 0xee8314f3), TOBN(0x1c068aed, 0xdbea298f), + TOBN(0x08d381f1, 0x7c80acec), TOBN(0x03b56be8, 0xe330495b)}, + {TOBN(0xaeffb8f2, 0x9222882d), TOBN(0x95ff38f6, 0xc4af8bf7), + TOBN(0x50e32d35, 0x1fc57d8c), TOBN(0x6635be52, 0x17b444f0)}}, + {{TOBN(0x04d15276, 0xa5177900), TOBN(0x4e1dbb47, 0xf6858752), + TOBN(0x5b475622, 0xc615796c), TOBN(0xa6fa0387, 0x691867bf)}, + {TOBN(0xed7f5d56, 0x2844c6d0), TOBN(0xc633cf9b, 0x03a2477d), + TOBN(0xf6be5c40, 0x2d3721d6), TOBN(0xaf312eb7, 0xe9fd68e6)}}, + {{TOBN(0x242792d2, 0xe7417ce1), TOBN(0xff42bc71, 0x970ee7f5), + TOBN(0x1ff4dc6d, 0x5c67a41e), TOBN(0x77709b7b, 0x20882a58)}, + {TOBN(0x3554731d, 0xbe217f2c), TOBN(0x2af2a8cd, 0x5bb72177), + TOBN(0x58eee769, 0x591dd059), TOBN(0xbb2930c9, 0x4bba6477)}}, + {{TOBN(0x863ee047, 0x7d930cfc), TOBN(0x4c262ad1, 0x396fd1f4), + TOBN(0xf4765bc8, 0x039af7e1), TOBN(0x2519834b, 0x5ba104f6)}, + {TOBN(0x7cd61b4c, 0xd105f961), TOBN(0xa5415da5, 0xd63bca54), + TOBN(0x778280a0, 0x88a1f17c), TOBN(0xc4968949, 0x2329512c)}}, + {{TOBN(0x174a9126, 0xcecdaa7a), TOBN(0xfc8c7e0e, 0x0b13247b), + TOBN(0x29c110d2, 0x3484c1c4), TOBN(0xf8eb8757, 0x831dfc3b)}, + {TOBN(0x022f0212, 0xc0067452), TOBN(0x3f6f69ee, 0x7b9b926c), + TOBN(0x09032da0, 0xef42daf4), TOBN(0x79f00ade, 0x83f80de4)}}, + {{TOBN(0x6210db71, 0x81236c97), TOBN(0x74f7685b, 0x3ee0781f), + TOBN(0x4df7da7b, 0xa3e41372), TOBN(0x2aae38b1, 0xb1a1553e)}, + {TOBN(0x1688e222, 0xf6dd9d1b), TOBN(0x57695448, 0x5b8b6487), + TOBN(0x478d2127, 0x4b2edeaa), TOBN(0xb2818fa5, 0x1e85956a)}}, + {{TOBN(0x1e6addda, 0xf176f2c0), TOBN(0x01ca4604, 0xe2572658), + TOBN(0x0a404ded, 0x85342ffb), TOBN(0x8cf60f96, 0x441838d6)}, + {TOBN(0x9bbc691c, 0xc9071c4a), TOBN(0xfd588744, 0x34442803), + TOBN(0x97101c85, 0x809c0d81), TOBN(0xa7fb754c, 0x8c456f7f)}}, + {{TOBN(0xc95f3c5c, 0xd51805e1), TOBN(0xab4ccd39, 0xb299dca8), + TOBN(0x3e03d20b, 0x47eaf500), TOBN(0xfa3165c1, 0xd7b80893)}, + {TOBN(0x005e8b54, 0xe160e552), TOBN(0xdc4972ba, 0x9019d11f), + TOBN(0x21a6972e, 0x0c9a4a7a), TOBN(0xa52c258f, 0x37840fd7)}}, + {{TOBN(0xf8559ff4, 0xc1e99d81), TOBN(0x08e1a7d6, 0xa3c617c0), + TOBN(0xb398fd43, 0x248c6ba7), TOBN(0x6ffedd91, 0xd1283794)}, + {TOBN(0x8a6a59d2, 0xd629d208), TOBN(0xa9d141d5, 0x3490530e), + TOBN(0x42f6fc18, 0x38505989), TOBN(0x09bf250d, 0x479d94ee)}}, + {{TOBN(0x223ad3b1, 0xb3822790), TOBN(0x6c5926c0, 0x93b8971c), + TOBN(0x609efc7e, 0x75f7fa62), TOBN(0x45d66a6d, 0x1ec2d989)}, + {TOBN(0x4422d663, 0x987d2792), TOBN(0x4a73caad, 0x3eb31d2b), + TOBN(0xf06c2ac1, 0xa32cb9e6), TOBN(0xd9445c5f, 0x91aeba84)}}, + {{TOBN(0x6af7a1d5, 0xaf71013f), TOBN(0xe68216e5, 0x0bedc946), + TOBN(0xf4cba30b, 0xd27370a0), TOBN(0x7981afbf, 0x870421cc)}, + {TOBN(0x02496a67, 0x9449f0e1), TOBN(0x86cfc4be, 0x0a47edae), + TOBN(0x3073c936, 0xb1feca22), TOBN(0xf5694612, 0x03f8f8fb)}}, + {{TOBN(0xd063b723, 0x901515ea), TOBN(0x4c6c77a5, 0x749cf038), + TOBN(0x6361e360, 0xab9e5059), TOBN(0x596cf171, 0xa76a37c0)}, + {TOBN(0x800f53fa, 0x6530ae7a), TOBN(0x0f5e631e, 0x0792a7a6), + TOBN(0x5cc29c24, 0xefdb81c9), TOBN(0xa269e868, 0x3f9c40ba)}}, + {{TOBN(0xec14f9e1, 0x2cb7191e), TOBN(0x78ea1bd8, 0xe5b08ea6), + TOBN(0x3c65aa9b, 0x46332bb9), TOBN(0x84cc22b3, 0xbf80ce25)}, + {TOBN(0x0098e9e9, 0xd49d5bf1), TOBN(0xcd4ec1c6, 0x19087da4), + TOBN(0x3c9d07c5, 0xaef6e357), TOBN(0x839a0268, 0x9f8f64b8)}}, + {{TOBN(0xc5e9eb62, 0xc6d8607f), TOBN(0x759689f5, 0x6aa995e4), + TOBN(0x70464669, 0xbbb48317), TOBN(0x921474bf, 0xe402417d)}, + {TOBN(0xcabe135b, 0x2a354c8c), TOBN(0xd51e52d2, 0x812fa4b5), + TOBN(0xec741096, 0x53311fe8), TOBN(0x4f774535, 0xb864514b)}}, + {{TOBN(0xbcadd671, 0x5bde48f8), TOBN(0xc9703873, 0x2189bc7d), + TOBN(0x5d45299e, 0xc709ee8a), TOBN(0xd1287ee2, 0x845aaff8)}, + {TOBN(0x7d1f8874, 0xdb1dbf1f), TOBN(0xea46588b, 0x990c88d6), + TOBN(0x60ba649a, 0x84368313), TOBN(0xd5fdcbce, 0x60d543ae)}}, + {{TOBN(0x90b46d43, 0x810d5ab0), TOBN(0x6739d8f9, 0x04d7e5cc), + TOBN(0x021c1a58, 0x0d337c33), TOBN(0x00a61162, 0x68e67c40)}, + {TOBN(0x95ef413b, 0x379f0a1f), TOBN(0xfe126605, 0xe9e2ab95), + TOBN(0x67578b85, 0x2f5f199c), TOBN(0xf5c00329, 0x2cb84913)}}, + {{TOBN(0xf7956430, 0x37577dd8), TOBN(0x83b82af4, 0x29c5fe88), + TOBN(0x9c1bea26, 0xcdbdc132), TOBN(0x589fa086, 0x9c04339e)}, + {TOBN(0x033e9538, 0xb13799df), TOBN(0x85fa8b21, 0xd295d034), + TOBN(0xdf17f73f, 0xbd9ddcca), TOBN(0xf32bd122, 0xddb66334)}}, + {{TOBN(0x55ef88a7, 0x858b044c), TOBN(0x1f0d69c2, 0x5aa9e397), + TOBN(0x55fd9cc3, 0x40d85559), TOBN(0xc774df72, 0x7785ddb2)}, + {TOBN(0x5dcce9f6, 0xd3bd2e1c), TOBN(0xeb30da20, 0xa85dfed0), + TOBN(0x5ed7f5bb, 0xd3ed09c4), TOBN(0x7d42a35c, 0x82a9c1bd)}}, + {{TOBN(0xcf3de995, 0x9890272d), TOBN(0x75f3432a, 0x3e713a10), + TOBN(0x5e13479f, 0xe28227b8), TOBN(0xb8561ea9, 0xfefacdc8)}, + {TOBN(0xa6a297a0, 0x8332aafd), TOBN(0x9b0d8bb5, 0x73809b62), + TOBN(0xd2fa1cfd, 0x0c63036f), TOBN(0x7a16eb55, 0xbd64bda8)}}, + {{TOBN(0x3f5cf5f6, 0x78e62ddc), TOBN(0x2267c454, 0x07fd752b), + TOBN(0x5e361b6b, 0x5e437bbe), TOBN(0x95c59501, 0x8354e075)}, + {TOBN(0xec725f85, 0xf2b254d9), TOBN(0x844b617d, 0x2cb52b4e), + TOBN(0xed8554f5, 0xcf425fb5), TOBN(0xab67703e, 0x2af9f312)}}, + {{TOBN(0x4cc34ec1, 0x3cf48283), TOBN(0xb09daa25, 0x9c8a705e), + TOBN(0xd1e9d0d0, 0x5b7d4f84), TOBN(0x4df6ef64, 0xdb38929d)}, + {TOBN(0xe16b0763, 0xaa21ba46), TOBN(0xc6b1d178, 0xa293f8fb), + TOBN(0x0ff5b602, 0xd520aabf), TOBN(0x94d671bd, 0xc339397a)}}, + {{TOBN(0x7c7d98cf, 0x4f5792fa), TOBN(0x7c5e0d67, 0x11215261), + TOBN(0x9b19a631, 0xa7c5a6d4), TOBN(0xc8511a62, 0x7a45274d)}, + {TOBN(0x0c16621c, 0xa5a60d99), TOBN(0xf7fbab88, 0xcf5e48cb), + TOBN(0xab1e6ca2, 0xf7ddee08), TOBN(0x83bd08ce, 0xe7867f3c)}}, + {{TOBN(0xf7e48e8a, 0x2ac13e27), TOBN(0x4494f6df, 0x4eb1a9f5), + TOBN(0xedbf84eb, 0x981f0a62), TOBN(0x49badc32, 0x536438f0)}, + {TOBN(0x50bea541, 0x004f7571), TOBN(0xbac67d10, 0xdf1c94ee), + TOBN(0x253d73a1, 0xb727bc31), TOBN(0xb3d01cf2, 0x30686e28)}}, + {{TOBN(0x51b77b1b, 0x55fd0b8b), TOBN(0xa099d183, 0xfeec3173), + TOBN(0x202b1fb7, 0x670e72b7), TOBN(0xadc88b33, 0xa8e1635f)}, + {TOBN(0x34e8216a, 0xf989d905), TOBN(0xc2e68d20, 0x29b58d01), + TOBN(0x11f81c92, 0x6fe55a93), TOBN(0x15f1462a, 0x8f296f40)}}, + {{TOBN(0x1915d375, 0xea3d62f2), TOBN(0xa17765a3, 0x01c8977d), + TOBN(0x7559710a, 0xe47b26f6), TOBN(0xe0bd29c8, 0x535077a5)}, + {TOBN(0x615f976d, 0x08d84858), TOBN(0x370dfe85, 0x69ced5c1), + TOBN(0xbbc7503c, 0xa734fa56), TOBN(0xfbb9f1ec, 0x91ac4574)}}, + {{TOBN(0x95d7ec53, 0x060dd7ef), TOBN(0xeef2dacd, 0x6e657979), + TOBN(0x54511af3, 0xe2a08235), TOBN(0x1e324aa4, 0x1f4aea3d)}, + {TOBN(0x550e7e71, 0xe6e67671), TOBN(0xbccd5190, 0xbf52faf7), + TOBN(0xf880d316, 0x223cc62a), TOBN(0x0d402c7e, 0x2b32eb5d)}}, + {{TOBN(0xa40bc039, 0x306a5a3b), TOBN(0x4e0a41fd, 0x96783a1b), + TOBN(0xa1e8d39a, 0x0253cdd4), TOBN(0x6480be26, 0xc7388638)}, + {TOBN(0xee365e1d, 0x2285f382), TOBN(0x188d8d8f, 0xec0b5c36), + TOBN(0x34ef1a48, 0x1f0f4d82), TOBN(0x1a8f43e1, 0xa487d29a)}}, + {{TOBN(0x8168226d, 0x77aefb3a), TOBN(0xf69a751e, 0x1e72c253), + TOBN(0x8e04359a, 0xe9594df1), TOBN(0x475ffd7d, 0xd14c0467)}, + {TOBN(0xb5a2c2b1, 0x3844e95c), TOBN(0x85caf647, 0xdd12ef94), + TOBN(0x1ecd2a9f, 0xf1063d00), TOBN(0x1dd2e229, 0x23843311)}}, + {{TOBN(0x38f0e09d, 0x73d17244), TOBN(0x3ede7746, 0x8fc653f1), + TOBN(0xae4459f5, 0xdc20e21c), TOBN(0x00db2ffa, 0x6a8599ea)}, + {TOBN(0x11682c39, 0x30cfd905), TOBN(0x4934d074, 0xa5c112a6), + TOBN(0xbdf063c5, 0x568bfe95), TOBN(0x779a440a, 0x016c441a)}}, + {{TOBN(0x0c23f218, 0x97d6fbdc), TOBN(0xd3a5cd87, 0xe0776aac), + TOBN(0xcee37f72, 0xd712e8db), TOBN(0xfb28c70d, 0x26f74e8d)}, + {TOBN(0xffe0c728, 0xb61301a0), TOBN(0xa6282168, 0xd3724354), + TOBN(0x7ff4cb00, 0x768ffedc), TOBN(0xc51b3088, 0x03b02de9)}}, + {{TOBN(0xa5a8147c, 0x3902dda5), TOBN(0x35d2f706, 0xfe6973b4), + TOBN(0x5ac2efcf, 0xc257457e), TOBN(0x933f48d4, 0x8700611b)}, + {TOBN(0xc365af88, 0x4912beb2), TOBN(0x7f5a4de6, 0x162edf94), + TOBN(0xc646ba7c, 0x0c32f34b), TOBN(0x632c6af3, 0xb2091074)}}, + {{TOBN(0x58d4f2e3, 0x753e43a9), TOBN(0x70e1d217, 0x24d4e23f), + TOBN(0xb24bf729, 0xafede6a6), TOBN(0x7f4a94d8, 0x710c8b60)}, + {TOBN(0xaad90a96, 0x8d4faa6a), TOBN(0xd9ed0b32, 0xb066b690), + TOBN(0x52fcd37b, 0x78b6dbfd), TOBN(0x0b64615e, 0x8bd2b431)}}, + {{TOBN(0x228e2048, 0xcfb9fad5), TOBN(0xbeaa386d, 0x240b76bd), + TOBN(0x2d6681c8, 0x90dad7bc), TOBN(0x3e553fc3, 0x06d38f5e)}, + {TOBN(0xf27cdb9b, 0x9d5f9750), TOBN(0x3e85c52a, 0xd28c5b0e), + TOBN(0x190795af, 0x5247c39b), TOBN(0x547831eb, 0xbddd6828)}}, + {{TOBN(0xf327a227, 0x4a82f424), TOBN(0x36919c78, 0x7e47f89d), + TOBN(0xe4783919, 0x43c7392c), TOBN(0xf101b9aa, 0x2316fefe)}, + {TOBN(0xbcdc9e9c, 0x1c5009d2), TOBN(0xfb55ea13, 0x9cd18345), + TOBN(0xf5b5e231, 0xa3ce77c7), TOBN(0xde6b4527, 0xd2f2cb3d)}}, + {{TOBN(0x10f6a333, 0x9bb26f5f), TOBN(0x1e85db8e, 0x044d85b6), + TOBN(0xc3697a08, 0x94197e54), TOBN(0x65e18cc0, 0xa7cb4ea8)}, + {TOBN(0xa38c4f50, 0xa471fe6e), TOBN(0xf031747a, 0x2f13439c), + TOBN(0x53c4a6ba, 0xc007318b), TOBN(0xa8da3ee5, 0x1deccb3d)}}, + {{TOBN(0x0555b31c, 0x558216b1), TOBN(0x90c7810c, 0x2f79e6c2), + TOBN(0x9b669f4d, 0xfe8eed3c), TOBN(0x70398ec8, 0xe0fac126)}, + {TOBN(0xa96a449e, 0xf701b235), TOBN(0x0ceecdb3, 0xeb94f395), + TOBN(0x285fc368, 0xd0cb7431), TOBN(0x0d37bb52, 0x16a18c64)}}, + {{TOBN(0x05110d38, 0xb880d2dd), TOBN(0xa60f177b, 0x65930d57), + TOBN(0x7da34a67, 0xf36235f5), TOBN(0x47f5e17c, 0x183816b9)}, + {TOBN(0xc7664b57, 0xdb394af4), TOBN(0x39ba215d, 0x7036f789), + TOBN(0x46d2ca0e, 0x2f27b472), TOBN(0xc42647ee, 0xf73a84b7)}}, + {{TOBN(0x44bc7545, 0x64488f1d), TOBN(0xaa922708, 0xf4cf85d5), + TOBN(0x721a01d5, 0x53e4df63), TOBN(0x649c0c51, 0x5db46ced)}, + {TOBN(0x6bf0d64e, 0x3cffcb6c), TOBN(0xe3bf93fe, 0x50f71d96), + TOBN(0x75044558, 0xbcc194a0), TOBN(0x16ae3372, 0x6afdc554)}}, + {{TOBN(0xbfc01adf, 0x5ca48f3f), TOBN(0x64352f06, 0xe22a9b84), + TOBN(0xcee54da1, 0xc1099e4a), TOBN(0xbbda54e8, 0xfa1b89c0)}, + {TOBN(0x166a3df5, 0x6f6e55fb), TOBN(0x1ca44a24, 0x20176f88), + TOBN(0x936afd88, 0xdfb7b5ff), TOBN(0xe34c2437, 0x8611d4a0)}}, + {{TOBN(0x7effbb75, 0x86142103), TOBN(0x6704ba1b, 0x1f34fc4d), + TOBN(0x7c2a468f, 0x10c1b122), TOBN(0x36b3a610, 0x8c6aace9)}, + {TOBN(0xabfcc0a7, 0x75a0d050), TOBN(0x066f9197, 0x3ce33e32), + TOBN(0xce905ef4, 0x29fe09be), TOBN(0x89ee25ba, 0xa8376351)}}, + {{TOBN(0x2a3ede22, 0xfd29dc76), TOBN(0x7fd32ed9, 0x36f17260), + TOBN(0x0cadcf68, 0x284b4126), TOBN(0x63422f08, 0xa7951fc8)}, + {TOBN(0x562b24f4, 0x0807e199), TOBN(0xfe9ce5d1, 0x22ad4490), + TOBN(0xc2f51b10, 0x0db2b1b4), TOBN(0xeb3613ff, 0xe4541d0d)}}, + {{TOBN(0xbd2c4a05, 0x2680813b), TOBN(0x527aa55d, 0x561b08d6), + TOBN(0xa9f8a40e, 0xa7205558), TOBN(0xe3eea56f, 0x243d0bec)}, + {TOBN(0x7b853817, 0xa0ff58b3), TOBN(0xb67d3f65, 0x1a69e627), + TOBN(0x0b76bbb9, 0xa869b5d6), TOBN(0xa3afeb82, 0x546723ed)}}, + {{TOBN(0x5f24416d, 0x3e554892), TOBN(0x8413b53d, 0x430e2a45), + TOBN(0x99c56aee, 0x9032a2a0), TOBN(0x09432bf6, 0xeec367b1)}, + {TOBN(0x552850c6, 0xdaf0ecc1), TOBN(0x49ebce55, 0x5bc92048), + TOBN(0xdfb66ba6, 0x54811307), TOBN(0x1b84f797, 0x6f298597)}}, + {{TOBN(0x79590481, 0x8d1d7a0d), TOBN(0xd9fabe03, 0x3a6fa556), + TOBN(0xa40f9c59, 0xba9e5d35), TOBN(0xcb1771c1, 0xf6247577)}, + {TOBN(0x542a47ca, 0xe9a6312b), TOBN(0xa34b3560, 0x552dd8c5), + TOBN(0xfdf94de0, 0x0d794716), TOBN(0xd46124a9, 0x9c623094)}}, + {{TOBN(0x56b7435d, 0x68afe8b4), TOBN(0x27f20540, 0x6c0d8ea1), + TOBN(0x12b77e14, 0x73186898), TOBN(0xdbc3dd46, 0x7479490f)}, + {TOBN(0x951a9842, 0xc03b0c05), TOBN(0x8b1b3bb3, 0x7921bc96), + TOBN(0xa573b346, 0x2b202e0a), TOBN(0x77e4665d, 0x47254d56)}}, + {{TOBN(0x08b70dfc, 0xd23e3984), TOBN(0xab86e8bc, 0xebd14236), + TOBN(0xaa3e07f8, 0x57114ba7), TOBN(0x5ac71689, 0xab0ef4f2)}, + {TOBN(0x88fca384, 0x0139d9af), TOBN(0x72733f88, 0x76644af0), + TOBN(0xf122f72a, 0x65d74f4a), TOBN(0x13931577, 0xa5626c7a)}}, + {{TOBN(0xd5b5d9eb, 0x70f8d5a4), TOBN(0x375adde7, 0xd7bbb228), + TOBN(0x31e88b86, 0x0c1c0b32), TOBN(0xd1f568c4, 0x173edbaa)}, + {TOBN(0x1592fc83, 0x5459df02), TOBN(0x2beac0fb, 0x0fcd9a7e), + TOBN(0xb0a6fdb8, 0x1b473b0a), TOBN(0xe3224c6f, 0x0fe8fc48)}}, + {{TOBN(0x680bd00e, 0xe87edf5b), TOBN(0x30385f02, 0x20e77cf5), + TOBN(0xe9ab98c0, 0x4d42d1b2), TOBN(0x72d191d2, 0xd3816d77)}, + {TOBN(0x1564daca, 0x0917d9e5), TOBN(0x394eab59, 0x1f8fed7f), + TOBN(0xa209aa8d, 0x7fbb3896), TOBN(0x5564f3b9, 0xbe6ac98e)}}, + {{TOBN(0xead21d05, 0xd73654ef), TOBN(0x68d1a9c4, 0x13d78d74), + TOBN(0x61e01708, 0x6d4973a0), TOBN(0x83da3500, 0x46e6d32a)}, + {TOBN(0x6a3dfca4, 0x68ae0118), TOBN(0xa1b9a4c9, 0xd02da069), + TOBN(0x0b2ff9c7, 0xebab8302), TOBN(0x98af07c3, 0x944ba436)}}, + {{TOBN(0x85997326, 0x995f0f9f), TOBN(0x467fade0, 0x71b58bc6), + TOBN(0x47e4495a, 0xbd625a2b), TOBN(0xfdd2d01d, 0x33c3b8cd)}, + {TOBN(0x2c38ae28, 0xc693f9fa), TOBN(0x48622329, 0x348f7999), + TOBN(0x97bf738e, 0x2161f583), TOBN(0x15ee2fa7, 0x565e8cc9)}}, + {{TOBN(0xa1a5c845, 0x5777e189), TOBN(0xcc10bee0, 0x456f2829), + TOBN(0x8ad95c56, 0xda762bd5), TOBN(0x152e2214, 0xe9d91da8)}, + {TOBN(0x975b0e72, 0x7cb23c74), TOBN(0xfd5d7670, 0xa90c66df), + TOBN(0xb5b5b8ad, 0x225ffc53), TOBN(0xab6dff73, 0xfaded2ae)}}, + {{TOBN(0xebd56781, 0x6f4cbe9d), TOBN(0x0ed8b249, 0x6a574bd7), + TOBN(0x41c246fe, 0x81a881fa), TOBN(0x91564805, 0xc3db9c70)}, + {TOBN(0xd7c12b08, 0x5b862809), TOBN(0x1facd1f1, 0x55858d7b), + TOBN(0x7693747c, 0xaf09e92a), TOBN(0x3b69dcba, 0x189a425f)}}, + {{TOBN(0x0be28e9f, 0x967365ef), TOBN(0x57300eb2, 0xe801f5c9), + TOBN(0x93b8ac6a, 0xd583352f), TOBN(0xa2cf1f89, 0xcd05b2b7)}, + {TOBN(0x7c0c9b74, 0x4dcc40cc), TOBN(0xfee38c45, 0xada523fb), + TOBN(0xb49a4dec, 0x1099cc4d), TOBN(0x325c377f, 0x69f069c6)}}, + {{TOBN(0xe12458ce, 0x476cc9ff), TOBN(0x580e0b6c, 0xc6d4cb63), + TOBN(0xd561c8b7, 0x9072289b), TOBN(0x0377f264, 0xa619e6da)}, + {TOBN(0x26685362, 0x88e591a5), TOBN(0xa453a7bd, 0x7523ca2b), + TOBN(0x8a9536d2, 0xc1df4533), TOBN(0xc8e50f2f, 0xbe972f79)}}, + {{TOBN(0xd433e50f, 0x6d3549cf), TOBN(0x6f33696f, 0xfacd665e), + TOBN(0x695bfdac, 0xce11fcb4), TOBN(0x810ee252, 0xaf7c9860)}, + {TOBN(0x65450fe1, 0x7159bb2c), TOBN(0xf7dfbebe, 0x758b357b), + TOBN(0x2b057e74, 0xd69fea72), TOBN(0xd485717a, 0x92731745)}}}, + {{{TOBN(0x896c42e8, 0xee36860c), TOBN(0xdaf04dfd, 0x4113c22d), + TOBN(0x1adbb7b7, 0x44104213), TOBN(0xe5fd5fa1, 0x1fd394ea)}, + {TOBN(0x68235d94, 0x1a4e0551), TOBN(0x6772cfbe, 0x18d10151), + TOBN(0x276071e3, 0x09984523), TOBN(0xe4e879de, 0x5a56ba98)}}, + {{TOBN(0xaaafafb0, 0x285b9491), TOBN(0x01a0be88, 0x1e4c705e), + TOBN(0xff1d4f5d, 0x2ad9caab), TOBN(0x6e349a4a, 0xc37a233f)}, + {TOBN(0xcf1c1246, 0x4a1c6a16), TOBN(0xd99e6b66, 0x29383260), + TOBN(0xea3d4366, 0x5f6d5471), TOBN(0x36974d04, 0xff8cc89b)}}, + {{TOBN(0xc26c49a1, 0xcfe89d80), TOBN(0xb42c026d, 0xda9c8371), + TOBN(0xca6c013a, 0xdad066d2), TOBN(0xfb8f7228, 0x56a4f3ee)}, + {TOBN(0x08b579ec, 0xd850935b), TOBN(0x34c1a74c, 0xd631e1b3), + TOBN(0xcb5fe596, 0xac198534), TOBN(0x39ff21f6, 0xe1f24f25)}}, + {{TOBN(0x27f29e14, 0x8f929057), TOBN(0x7a64ae06, 0xc0c853df), + TOBN(0x256cd183, 0x58e9c5ce), TOBN(0x9d9cce82, 0xded092a5)}, + {TOBN(0xcc6e5979, 0x6e93b7c7), TOBN(0xe1e47092, 0x31bb9e27), + TOBN(0xb70b3083, 0xaa9e29a0), TOBN(0xbf181a75, 0x3785e644)}}, + {{TOBN(0xf53f2c65, 0x8ead09f7), TOBN(0x1335e1d5, 0x9780d14d), + TOBN(0x69cc20e0, 0xcd1b66bc), TOBN(0x9b670a37, 0xbbe0bfc8)}, + {TOBN(0xce53dc81, 0x28efbeed), TOBN(0x0c74e77c, 0x8326a6e5), + TOBN(0x3604e0d2, 0xb88e9a63), TOBN(0xbab38fca, 0x13dc2248)}}, + {{TOBN(0x8ed6e8c8, 0x5c0a3f1e), TOBN(0xbcad2492, 0x7c87c37f), + TOBN(0xfdfb62bb, 0x9ee3b78d), TOBN(0xeba8e477, 0xcbceba46)}, + {TOBN(0x37d38cb0, 0xeeaede4b), TOBN(0x0bc498e8, 0x7976deb6), + TOBN(0xb2944c04, 0x6b6147fb), TOBN(0x8b123f35, 0xf71f9609)}}, + {{TOBN(0xa155dcc7, 0xde79dc24), TOBN(0xf1168a32, 0x558f69cd), + TOBN(0xbac21595, 0x0d1850df), TOBN(0x15c8295b, 0xb204c848)}, + {TOBN(0xf661aa36, 0x7d8184ff), TOBN(0xc396228e, 0x30447bdb), + TOBN(0x11cd5143, 0xbde4a59e), TOBN(0xe3a26e3b, 0x6beab5e6)}}, + {{TOBN(0xd3b3a13f, 0x1402b9d0), TOBN(0x573441c3, 0x2c7bc863), + TOBN(0x4b301ec4, 0x578c3e6e), TOBN(0xc26fc9c4, 0x0adaf57e)}, + {TOBN(0x96e71bfd, 0x7493cea3), TOBN(0xd05d4b3f, 0x1af81456), + TOBN(0xdaca2a8a, 0x6a8c608f), TOBN(0x53ef07f6, 0x0725b276)}}, + {{TOBN(0x07a5fbd2, 0x7824fc56), TOBN(0x34675218, 0x13289077), + TOBN(0x5bf69fd5, 0xe0c48349), TOBN(0xa613ddd3, 0xb6aa7875)}, + {TOBN(0x7f78c19c, 0x5450d866), TOBN(0x46f4409c, 0x8f84a481), + TOBN(0x9f1d1928, 0x90fce239), TOBN(0x016c4168, 0xb2ce44b9)}}, + {{TOBN(0xbae023f0, 0xc7435978), TOBN(0xb152c888, 0x20e30e19), + TOBN(0x9c241645, 0xe3fa6faf), TOBN(0x735d95c1, 0x84823e60)}, + {TOBN(0x03197573, 0x03955317), TOBN(0x0b4b02a9, 0xf03b4995), + TOBN(0x076bf559, 0x70274600), TOBN(0x32c5cc53, 0xaaf57508)}}, + {{TOBN(0xe8af6d1f, 0x60624129), TOBN(0xb7bc5d64, 0x9a5e2b5e), + TOBN(0x3814b048, 0x5f082d72), TOBN(0x76f267f2, 0xce19677a)}, + {TOBN(0x626c630f, 0xb36eed93), TOBN(0x55230cd7, 0x3bf56803), + TOBN(0x78837949, 0xce2736a0), TOBN(0x0d792d60, 0xaa6c55f1)}}, + {{TOBN(0x0318dbfd, 0xd5c7c5d2), TOBN(0xb38f8da7, 0x072b342d), + TOBN(0x3569bddc, 0x7b8de38a), TOBN(0xf25b5887, 0xa1c94842)}, + {TOBN(0xb2d5b284, 0x2946ad60), TOBN(0x854f29ad, 0xe9d1707e), + TOBN(0xaa5159dc, 0x2c6a4509), TOBN(0x899f94c0, 0x57189837)}}, + {{TOBN(0xcf6adc51, 0xf4a55b03), TOBN(0x261762de, 0x35e3b2d5), + TOBN(0x4cc43012, 0x04827b51), TOBN(0xcd22a113, 0xc6021442)}, + {TOBN(0xce2fd61a, 0x247c9569), TOBN(0x59a50973, 0xd152beca), + TOBN(0x6c835a11, 0x63a716d4), TOBN(0xc26455ed, 0x187dedcf)}}, + {{TOBN(0x27f536e0, 0x49ce89e7), TOBN(0x18908539, 0xcc890cb5), + TOBN(0x308909ab, 0xd83c2aa1), TOBN(0xecd3142b, 0x1ab73bd3)}, + {TOBN(0x6a85bf59, 0xb3f5ab84), TOBN(0x3c320a68, 0xf2bea4c6), + TOBN(0xad8dc538, 0x6da4541f), TOBN(0xeaf34eb0, 0xb7c41186)}}, + {{TOBN(0x1c780129, 0x977c97c4), TOBN(0x5ff9beeb, 0xc57eb9fa), + TOBN(0xa24d0524, 0xc822c478), TOBN(0xfd8eec2a, 0x461cd415)}, + {TOBN(0xfbde194e, 0xf027458c), TOBN(0xb4ff5319, 0x1d1be115), + TOBN(0x63f874d9, 0x4866d6f4), TOBN(0x35c75015, 0xb21ad0c9)}}, + {{TOBN(0xa6b5c9d6, 0x46ac49d2), TOBN(0x42c77c0b, 0x83137aa9), + TOBN(0x24d000fc, 0x68225a38), TOBN(0x0f63cfc8, 0x2fe1e907)}, + {TOBN(0x22d1b01b, 0xc6441f95), TOBN(0x7d38f719, 0xec8e448f), + TOBN(0x9b33fa5f, 0x787fb1ba), TOBN(0x94dcfda1, 0x190158df)}}, + {{TOBN(0xc47cb339, 0x5f6d4a09), TOBN(0x6b4f355c, 0xee52b826), + TOBN(0x3d100f5d, 0xf51b930a), TOBN(0xf4512fac, 0x9f668f69)}, + {TOBN(0x546781d5, 0x206c4c74), TOBN(0xd021d4d4, 0xcb4d2e48), + TOBN(0x494a54c2, 0xca085c2d), TOBN(0xf1dbaca4, 0x520850a8)}}, + {{TOBN(0x63c79326, 0x490a1aca), TOBN(0xcb64dd9c, 0x41526b02), + TOBN(0xbb772591, 0xa2979258), TOBN(0x3f582970, 0x48d97846)}, + {TOBN(0xd66b70d1, 0x7c213ba7), TOBN(0xc28febb5, 0xe8a0ced4), + TOBN(0x6b911831, 0xc10338c1), TOBN(0x0d54e389, 0xbf0126f3)}}, + {{TOBN(0x7048d460, 0x4af206ee), TOBN(0x786c88f6, 0x77e97cb9), + TOBN(0xd4375ae1, 0xac64802e), TOBN(0x469bcfe1, 0xd53ec11c)}, + {TOBN(0xfc9b340d, 0x47062230), TOBN(0xe743bb57, 0xc5b4a3ac), + TOBN(0xfe00b4aa, 0x59ef45ac), TOBN(0x29a4ef23, 0x59edf188)}}, + {{TOBN(0x40242efe, 0xb483689b), TOBN(0x2575d3f6, 0x513ac262), + TOBN(0xf30037c8, 0x0ca6db72), TOBN(0xc9fcce82, 0x98864be2)}, + {TOBN(0x84a112ff, 0x0149362d), TOBN(0x95e57582, 0x1c4ae971), + TOBN(0x1fa4b1a8, 0x945cf86c), TOBN(0x4525a734, 0x0b024a2f)}}, + {{TOBN(0xe76c8b62, 0x8f338360), TOBN(0x483ff593, 0x28edf32b), + TOBN(0x67e8e90a, 0x298b1aec), TOBN(0x9caab338, 0x736d9a21)}, + {TOBN(0x5c09d2fd, 0x66892709), TOBN(0x2496b4dc, 0xb55a1d41), + TOBN(0x93f5fb1a, 0xe24a4394), TOBN(0x08c75049, 0x6fa8f6c1)}}, + {{TOBN(0xcaead1c2, 0xc905d85f), TOBN(0xe9d7f790, 0x0733ae57), + TOBN(0x24c9a65c, 0xf07cdd94), TOBN(0x7389359c, 0xa4b55931)}, + {TOBN(0xf58709b7, 0x367e45f7), TOBN(0x1f203067, 0xcb7e7adc), + TOBN(0x82444bff, 0xc7b72818), TOBN(0x07303b35, 0xbaac8033)}}, + {{TOBN(0x1e1ee4e4, 0xd13b7ea1), TOBN(0xe6489b24, 0xe0e74180), + TOBN(0xa5f2c610, 0x7e70ef70), TOBN(0xa1655412, 0xbdd10894)}, + {TOBN(0x555ebefb, 0x7af4194e), TOBN(0x533c1c3c, 0x8e89bd9c), + TOBN(0x735b9b57, 0x89895856), TOBN(0x15fb3cd2, 0x567f5c15)}}, + {{TOBN(0x057fed45, 0x526f09fd), TOBN(0xe8a4f10c, 0x8128240a), + TOBN(0x9332efc4, 0xff2bfd8d), TOBN(0x214e77a0, 0xbd35aa31)}, + {TOBN(0x32896d73, 0x14faa40e), TOBN(0x767867ec, 0x01e5f186), + TOBN(0xc9adf8f1, 0x17a1813e), TOBN(0xcb6cda78, 0x54741795)}}, + {{TOBN(0xb7521b6d, 0x349d51aa), TOBN(0xf56b5a9e, 0xe3c7b8e9), + TOBN(0xc6f1e5c9, 0x32a096df), TOBN(0x083667c4, 0xa3635024)}, + {TOBN(0x365ea135, 0x18087f2f), TOBN(0xf1b8eaac, 0xd136e45d), + TOBN(0xc8a0e484, 0x73aec989), TOBN(0xd75a324b, 0x142c9259)}}, + {{TOBN(0xb7b4d001, 0x01dae185), TOBN(0x45434e0b, 0x9b7a94bc), + TOBN(0xf54339af, 0xfbd8cb0b), TOBN(0xdcc4569e, 0xe98ef49e)}, + {TOBN(0x7789318a, 0x09a51299), TOBN(0x81b4d206, 0xb2b025d8), + TOBN(0xf64aa418, 0xfae85792), TOBN(0x3e50258f, 0xacd7baf7)}}, + {{TOBN(0xdce84cdb, 0x2996864b), TOBN(0xa2e67089, 0x1f485fa4), + TOBN(0xb28b2bb6, 0x534c6a5a), TOBN(0x31a7ec6b, 0xc94b9d39)}, + {TOBN(0x1d217766, 0xd6bc20da), TOBN(0x4acdb5ec, 0x86761190), + TOBN(0x68726328, 0x73701063), TOBN(0x4d24ee7c, 0x2128c29b)}}, + {{TOBN(0xc072ebd3, 0xa19fd868), TOBN(0x612e481c, 0xdb8ddd3b), + TOBN(0xb4e1d754, 0x1a64d852), TOBN(0x00ef95ac, 0xc4c6c4ab)}, + {TOBN(0x1536d2ed, 0xaa0a6c46), TOBN(0x61294086, 0x43774790), + TOBN(0x54af25e8, 0x343fda10), TOBN(0x9ff9d98d, 0xfd25d6f2)}}, + {{TOBN(0x0746af7c, 0x468b8835), TOBN(0x977a31cb, 0x730ecea7), + TOBN(0xa5096b80, 0xc2cf4a81), TOBN(0xaa986833, 0x6458c37a)}, + {TOBN(0x6af29bf3, 0xa6bd9d34), TOBN(0x6a62fe9b, 0x33c5d854), + TOBN(0x50e6c304, 0xb7133b5e), TOBN(0x04b60159, 0x7d6e6848)}}, + {{TOBN(0x4cd296df, 0x5579bea4), TOBN(0x10e35ac8, 0x5ceedaf1), + TOBN(0x04c4c5fd, 0xe3bcc5b1), TOBN(0x95f9ee8a, 0x89412cf9)}, + {TOBN(0x2c9459ee, 0x82b6eb0f), TOBN(0x2e845765, 0x95c2aadd), + TOBN(0x774a84ae, 0xd327fcfe), TOBN(0xd8c93722, 0x0368d476)}}, + {{TOBN(0x0dbd5748, 0xf83e8a3b), TOBN(0xa579aa96, 0x8d2495f3), + TOBN(0x535996a0, 0xae496e9b), TOBN(0x07afbfe9, 0xb7f9bcc2)}, + {TOBN(0x3ac1dc6d, 0x5b7bd293), TOBN(0x3b592cff, 0x7022323d), + TOBN(0xba0deb98, 0x9c0a3e76), TOBN(0x18e78e9f, 0x4b197acb)}}, + {{TOBN(0x211cde10, 0x296c36ef), TOBN(0x7ee89672, 0x82c4da77), + TOBN(0xb617d270, 0xa57836da), TOBN(0xf0cd9c31, 0x9cb7560b)}, + {TOBN(0x01fdcbf7, 0xe455fe90), TOBN(0x3fb53cbb, 0x7e7334f3), + TOBN(0x781e2ea4, 0x4e7de4ec), TOBN(0x8adab3ad, 0x0b384fd0)}}, + {{TOBN(0x129eee2f, 0x53d64829), TOBN(0x7a471e17, 0xa261492b), + TOBN(0xe4f9adb9, 0xe4cb4a2c), TOBN(0x3d359f6f, 0x97ba2c2d)}, + {TOBN(0x346c6786, 0x0aacd697), TOBN(0x92b444c3, 0x75c2f8a8), + TOBN(0xc79fa117, 0xd85df44e), TOBN(0x56782372, 0x398ddf31)}}, + {{TOBN(0x60e690f2, 0xbbbab3b8), TOBN(0x4851f8ae, 0x8b04816b), + TOBN(0xc72046ab, 0x9c92e4d2), TOBN(0x518c74a1, 0x7cf3136b)}, + {TOBN(0xff4eb50a, 0xf9877d4c), TOBN(0x14578d90, 0xa919cabb), + TOBN(0x8218f8c4, 0xac5eb2b6), TOBN(0xa3ccc547, 0x542016e4)}}, + {{TOBN(0x025bf48e, 0x327f8349), TOBN(0xf3e97346, 0xf43cb641), + TOBN(0xdc2bafdf, 0x500f1085), TOBN(0x57167876, 0x2f063055)}, + {TOBN(0x5bd914b9, 0x411925a6), TOBN(0x7c078d48, 0xa1123de5), + TOBN(0xee6bf835, 0x182b165d), TOBN(0xb11b5e5b, 0xba519727)}}, + {{TOBN(0xe33ea76c, 0x1eea7b85), TOBN(0x2352b461, 0x92d4f85e), + TOBN(0xf101d334, 0xafe115bb), TOBN(0xfabc1294, 0x889175a3)}, + {TOBN(0x7f6bcdc0, 0x5233f925), TOBN(0xe0a802db, 0xe77fec55), + TOBN(0xbdb47b75, 0x8069b659), TOBN(0x1c5e12de, 0xf98fbd74)}}, + {{TOBN(0x869c58c6, 0x4b8457ee), TOBN(0xa5360f69, 0x4f7ea9f7), + TOBN(0xe576c09f, 0xf460b38f), TOBN(0x6b70d548, 0x22b7fb36)}, + {TOBN(0x3fd237f1, 0x3bfae315), TOBN(0x33797852, 0xcbdff369), + TOBN(0x97df25f5, 0x25b516f9), TOBN(0x46f388f2, 0xba38ad2d)}}, + {{TOBN(0x656c4658, 0x89d8ddbb), TOBN(0x8830b26e, 0x70f38ee8), + TOBN(0x4320fd5c, 0xde1212b0), TOBN(0xc34f30cf, 0xe4a2edb2)}, + {TOBN(0xabb131a3, 0x56ab64b8), TOBN(0x7f77f0cc, 0xd99c5d26), + TOBN(0x66856a37, 0xbf981d94), TOBN(0x19e76d09, 0x738bd76e)}}, + {{TOBN(0xe76c8ac3, 0x96238f39), TOBN(0xc0a482be, 0xa830b366), + TOBN(0xb7b8eaff, 0x0b4eb499), TOBN(0x8ecd83bc, 0x4bfb4865)}, + {TOBN(0x971b2cb7, 0xa2f3776f), TOBN(0xb42176a4, 0xf4b88adf), + TOBN(0xb9617df5, 0xbe1fa446), TOBN(0x8b32d508, 0xcd031bd2)}}, + {{TOBN(0x1c6bd47d, 0x53b618c0), TOBN(0xc424f46c, 0x6a227923), + TOBN(0x7303ffde, 0xdd92d964), TOBN(0xe9712878, 0x71b5abf2)}, + {TOBN(0x8f48a632, 0xf815561d), TOBN(0x85f48ff5, 0xd3c055d1), + TOBN(0x222a1427, 0x7525684f), TOBN(0xd0d841a0, 0x67360cc3)}}, + {{TOBN(0x4245a926, 0x0b9267c6), TOBN(0xc78913f1, 0xcf07f863), + TOBN(0xaa844c8e, 0x4d0d9e24), TOBN(0xa42ad522, 0x3d5f9017)}, + {TOBN(0xbd371749, 0xa2c989d5), TOBN(0x928292df, 0xe1f5e78e), + TOBN(0x493b383e, 0x0a1ea6da), TOBN(0x5136fd8d, 0x13aee529)}}, + {{TOBN(0x860c44b1, 0xf2c34a99), TOBN(0x3b00aca4, 0xbf5855ac), + TOBN(0xabf6aaa0, 0xfaaf37be), TOBN(0x65f43682, 0x2a53ec08)}, + {TOBN(0x1d9a5801, 0xa11b12e1), TOBN(0x78a7ab2c, 0xe20ed475), + TOBN(0x0de1067e, 0x9a41e0d5), TOBN(0x30473f5f, 0x305023ea)}}, + {{TOBN(0xdd3ae09d, 0x169c7d97), TOBN(0x5cd5baa4, 0xcfaef9cd), + TOBN(0x5cd7440b, 0x65a44803), TOBN(0xdc13966a, 0x47f364de)}, + {TOBN(0x077b2be8, 0x2b8357c1), TOBN(0x0cb1b4c5, 0xe9d57c2a), + TOBN(0x7a4ceb32, 0x05ff363e), TOBN(0xf310fa4d, 0xca35a9ef)}}, + {{TOBN(0xdbb7b352, 0xf97f68c6), TOBN(0x0c773b50, 0x0b02cf58), + TOBN(0xea2e4821, 0x3c1f96d9), TOBN(0xffb357b0, 0xeee01815)}, + {TOBN(0xb9c924cd, 0xe0f28039), TOBN(0x0b36c95a, 0x46a3fbe4), + TOBN(0x1faaaea4, 0x5e46db6c), TOBN(0xcae575c3, 0x1928aaff)}}, + {{TOBN(0x7f671302, 0xa70dab86), TOBN(0xfcbd12a9, 0x71c58cfc), + TOBN(0xcbef9acf, 0xbee0cb92), TOBN(0x573da0b9, 0xf8c1b583)}, + {TOBN(0x4752fcfe, 0x0d41d550), TOBN(0xe7eec0e3, 0x2155cffe), + TOBN(0x0fc39fcb, 0x545ae248), TOBN(0x522cb8d1, 0x8065f44e)}}, + {{TOBN(0x263c962a, 0x70cbb96c), TOBN(0xe034362a, 0xbcd124a9), + TOBN(0xf120db28, 0x3c2ae58d), TOBN(0xb9a38d49, 0xfef6d507)}, + {TOBN(0xb1fd2a82, 0x1ff140fd), TOBN(0xbd162f30, 0x20aee7e0), + TOBN(0x4e17a5d4, 0xcb251949), TOBN(0x2aebcb83, 0x4f7e1c3d)}}, + {{TOBN(0x608eb25f, 0x937b0527), TOBN(0xf42e1e47, 0xeb7d9997), + TOBN(0xeba699c4, 0xb8a53a29), TOBN(0x1f921c71, 0xe091b536)}, + {TOBN(0xcce29e7b, 0x5b26bbd5), TOBN(0x7a8ef5ed, 0x3b61a680), + TOBN(0xe5ef8043, 0xba1f1c7e), TOBN(0x16ea8217, 0x18158dda)}}, + {{TOBN(0x01778a2b, 0x599ff0f9), TOBN(0x68a923d7, 0x8104fc6b), + TOBN(0x5bfa44df, 0xda694ff3), TOBN(0x4f7199db, 0xf7667f12)}, + {TOBN(0xc06d8ff6, 0xe46f2a79), TOBN(0x08b5dead, 0xe9f8131d), + TOBN(0x02519a59, 0xabb4ce7c), TOBN(0xc4f710bc, 0xb42aec3e)}}, + {{TOBN(0x3d77b057, 0x78bde41a), TOBN(0x6474bf80, 0xb4186b5a), + TOBN(0x048b3f67, 0x88c65741), TOBN(0xc64519de, 0x03c7c154)}, + {TOBN(0xdf073846, 0x0edfcc4f), TOBN(0x319aa737, 0x48f1aa6b), + TOBN(0x8b9f8a02, 0xca909f77), TOBN(0x90258139, 0x7580bfef)}}, + {{TOBN(0xd8bfd3ca, 0xc0c22719), TOBN(0xc60209e4, 0xc9ca151e), + TOBN(0x7a744ab5, 0xd9a1a69c), TOBN(0x6de5048b, 0x14937f8f)}, + {TOBN(0x171938d8, 0xe115ac04), TOBN(0x7df70940, 0x1c6b16d2), + TOBN(0xa6aeb663, 0x7f8e94e7), TOBN(0xc130388e, 0x2a2cf094)}}, + {{TOBN(0x1850be84, 0x77f54e6e), TOBN(0x9f258a72, 0x65d60fe5), + TOBN(0xff7ff0c0, 0x6c9146d6), TOBN(0x039aaf90, 0xe63a830b)}, + {TOBN(0x38f27a73, 0x9460342f), TOBN(0x4703148c, 0x3f795f8a), + TOBN(0x1bb5467b, 0x9681a97e), TOBN(0x00931ba5, 0xecaeb594)}}, + {{TOBN(0xcdb6719d, 0x786f337c), TOBN(0xd9c01cd2, 0xe704397d), + TOBN(0x0f4a3f20, 0x555c2fef), TOBN(0x00452509, 0x7c0af223)}, + {TOBN(0x54a58047, 0x84db8e76), TOBN(0x3bacf1aa, 0x93c8aa06), + TOBN(0x11ca957c, 0xf7919422), TOBN(0x50641053, 0x78cdaa40)}}, + {{TOBN(0x7a303874, 0x9f7144ae), TOBN(0x170c963f, 0x43d4acfd), + TOBN(0x5e148149, 0x58ddd3ef), TOBN(0xa7bde582, 0x9e72dba8)}, + {TOBN(0x0769da8b, 0x6fa68750), TOBN(0xfa64e532, 0x572e0249), + TOBN(0xfcaadf9d, 0x2619ad31), TOBN(0x87882daa, 0xa7b349cd)}}, + {{TOBN(0x9f6eb731, 0x6c67a775), TOBN(0xcb10471a, 0xefc5d0b1), + TOBN(0xb433750c, 0xe1b806b2), TOBN(0x19c5714d, 0x57b1ae7e)}, + {TOBN(0xc0dc8b7b, 0xed03fd3f), TOBN(0xdd03344f, 0x31bc194e), + TOBN(0xa66c52a7, 0x8c6320b5), TOBN(0x8bc82ce3, 0xd0b6fd93)}}, + {{TOBN(0xf8e13501, 0xb35f1341), TOBN(0xe53156dd, 0x25a43e42), + TOBN(0xd3adf27e, 0x4daeb85c), TOBN(0xb81d8379, 0xbbeddeb5)}, + {TOBN(0x1b0b546e, 0x2e435867), TOBN(0x9020eb94, 0xeba5dd60), + TOBN(0x37d91161, 0x8210cb9d), TOBN(0x4c596b31, 0x5c91f1cf)}}, + {{TOBN(0xb228a90f, 0x0e0b040d), TOBN(0xbaf02d82, 0x45ff897f), + TOBN(0x2aac79e6, 0x00fa6122), TOBN(0x24828817, 0x8e36f557)}, + {TOBN(0xb9521d31, 0x113ec356), TOBN(0x9e48861e, 0x15eff1f8), + TOBN(0x2aa1d412, 0xe0d41715), TOBN(0x71f86203, 0x53f131b8)}}, + {{TOBN(0xf60da8da, 0x3fd19408), TOBN(0x4aa716dc, 0x278d9d99), + TOBN(0x394531f7, 0xa8c51c90), TOBN(0xb560b0e8, 0xf59db51c)}, + {TOBN(0xa28fc992, 0xfa34bdad), TOBN(0xf024fa14, 0x9cd4f8bd), + TOBN(0x5cf530f7, 0x23a9d0d3), TOBN(0x615ca193, 0xe28c9b56)}}, + {{TOBN(0x6d2a483d, 0x6f73c51e), TOBN(0xa4cb2412, 0xea0dc2dd), + TOBN(0x50663c41, 0x1eb917ff), TOBN(0x3d3a74cf, 0xeade299e)}, + {TOBN(0x29b3990f, 0x4a7a9202), TOBN(0xa9bccf59, 0xa7b15c3d), + TOBN(0x66a3ccdc, 0xa5df9208), TOBN(0x48027c14, 0x43f2f929)}}, + {{TOBN(0xd385377c, 0x40b557f0), TOBN(0xe001c366, 0xcd684660), + TOBN(0x1b18ed6b, 0xe2183a27), TOBN(0x879738d8, 0x63210329)}, + {TOBN(0xa687c74b, 0xbda94882), TOBN(0xd1bbcc48, 0xa684b299), + TOBN(0xaf6f1112, 0x863b3724), TOBN(0x6943d1b4, 0x2c8ce9f8)}}, + {{TOBN(0xe044a3bb, 0x098cafb4), TOBN(0x27ed2310, 0x60d48caf), + TOBN(0x542b5675, 0x3a31b84d), TOBN(0xcbf3dd50, 0xfcddbed7)}, + {TOBN(0x25031f16, 0x41b1d830), TOBN(0xa7ec851d, 0xcb0c1e27), + TOBN(0xac1c8fe0, 0xb5ae75db), TOBN(0xb24c7557, 0x08c52120)}}, + {{TOBN(0x57f811dc, 0x1d4636c3), TOBN(0xf8436526, 0x681a9939), + TOBN(0x1f6bc6d9, 0x9c81adb3), TOBN(0x840f8ac3, 0x5b7d80d4)}, + {TOBN(0x731a9811, 0xf4387f1a), TOBN(0x7c501cd3, 0xb5156880), + TOBN(0xa5ca4a07, 0xdfe68867), TOBN(0xf123d8f0, 0x5fcea120)}}, + {{TOBN(0x1fbb0e71, 0xd607039e), TOBN(0x2b70e215, 0xcd3a4546), + TOBN(0x32d2f01d, 0x53324091), TOBN(0xb796ff08, 0x180ab19b)}, + {TOBN(0x32d87a86, 0x3c57c4aa), TOBN(0x2aed9caf, 0xb7c49a27), + TOBN(0x9fb35eac, 0x31630d98), TOBN(0x338e8cdf, 0x5c3e20a3)}}, + {{TOBN(0x80f16182, 0x66cde8db), TOBN(0x4e159980, 0x2d72fd36), + TOBN(0xd7b8f13b, 0x9b6e5072), TOBN(0xf5213907, 0x3b7b5dc1)}, + {TOBN(0x4d431f1d, 0x8ce4396e), TOBN(0x37a1a680, 0xa7ed2142), + TOBN(0xbf375696, 0xd01aaf6b), TOBN(0xaa1c0c54, 0xe63aab66)}}, + {{TOBN(0x3014368b, 0x4ed80940), TOBN(0x67e6d056, 0x7a6fcedd), + TOBN(0x7c208c49, 0xca97579f), TOBN(0xfe3d7a81, 0xa23597f6)}, + {TOBN(0x5e203202, 0x7e096ae2), TOBN(0xb1f3e1e7, 0x24b39366), + TOBN(0x26da26f3, 0x2fdcdffc), TOBN(0x79422f1d, 0x6097be83)}}}, + {{{TOBN(0x263a2cfb, 0x9db3b381), TOBN(0x9c3a2dee, 0xd4df0a4b), + TOBN(0x728d06e9, 0x7d04e61f), TOBN(0x8b1adfbc, 0x42449325)}, + {TOBN(0x6ec1d939, 0x7e053a1b), TOBN(0xee2be5c7, 0x66daf707), + TOBN(0x80ba1e14, 0x810ac7ab), TOBN(0xdd2ae778, 0xf530f174)}}, + {{TOBN(0x0435d97a, 0x205b9d8b), TOBN(0x6eb8f064, 0x056756d4), + TOBN(0xd5e88a8b, 0xb6f8210e), TOBN(0x070ef12d, 0xec9fd9ea)}, + {TOBN(0x4d849505, 0x3bcc876a), TOBN(0x12a75338, 0xa7404ce3), + TOBN(0xd22b49e1, 0xb8a1db5e), TOBN(0xec1f2051, 0x14bfa5ad)}}, + {{TOBN(0xadbaeb79, 0xb6828f36), TOBN(0x9d7a0258, 0x01bd5b9e), + TOBN(0xeda01e0d, 0x1e844b0c), TOBN(0x4b625175, 0x887edfc9)}, + {TOBN(0x14109fdd, 0x9669b621), TOBN(0x88a2ca56, 0xf6f87b98), + TOBN(0xfe2eb788, 0x170df6bc), TOBN(0x0cea06f4, 0xffa473f9)}}, + {{TOBN(0x43ed81b5, 0xc4e83d33), TOBN(0xd9f35879, 0x5efd488b), + TOBN(0x164a620f, 0x9deb4d0f), TOBN(0xc6927bdb, 0xac6a7394)}, + {TOBN(0x45c28df7, 0x9f9e0f03), TOBN(0x2868661e, 0xfcd7e1a9), + TOBN(0x7cf4e8d0, 0xffa348f1), TOBN(0x6bd4c284, 0x398538e0)}}, + {{TOBN(0x2618a091, 0x289a8619), TOBN(0xef796e60, 0x6671b173), + TOBN(0x664e46e5, 0x9090c632), TOBN(0xa38062d4, 0x1e66f8fb)}, + {TOBN(0x6c744a20, 0x0573274e), TOBN(0xd07b67e4, 0xa9271394), + TOBN(0x391223b2, 0x6bdc0e20), TOBN(0xbe2d93f1, 0xeb0a05a7)}}, + {{TOBN(0xf23e2e53, 0x3f36d141), TOBN(0xe84bb3d4, 0x4dfca442), + TOBN(0xb804a48d, 0x6b7c023a), TOBN(0x1e16a8fa, 0x76431c3b)}, + {TOBN(0x1b5452ad, 0xddd472e0), TOBN(0x7d405ee7, 0x0d1ee127), + TOBN(0x50fc6f1d, 0xffa27599), TOBN(0x351ac53c, 0xbf391b35)}}, + {{TOBN(0x7efa14b8, 0x4444896b), TOBN(0x64974d2f, 0xf94027fb), + TOBN(0xefdcd0e8, 0xde84487d), TOBN(0x8c45b260, 0x2b48989b)}, + {TOBN(0xa8fcbbc2, 0xd8463487), TOBN(0xd1b2b3f7, 0x3fbc476c), + TOBN(0x21d005b7, 0xc8f443c0), TOBN(0x518f2e67, 0x40c0139c)}}, + {{TOBN(0x56036e8c, 0x06d75fc1), TOBN(0x2dcf7bb7, 0x3249a89f), + TOBN(0x81dd1d3d, 0xe245e7dd), TOBN(0xf578dc4b, 0xebd6e2a7)}, + {TOBN(0x4c028903, 0xdf2ce7a0), TOBN(0xaee36288, 0x9c39afac), + TOBN(0xdc847c31, 0x146404ab), TOBN(0x6304c0d8, 0xa4e97818)}}, + {{TOBN(0xae51dca2, 0xa91f6791), TOBN(0x2abe4190, 0x9baa9efc), + TOBN(0xd9d2e2f4, 0x559c7ac1), TOBN(0xe82f4b51, 0xfc9f773a)}, + {TOBN(0xa7713027, 0x4073e81c), TOBN(0xc0276fac, 0xfbb596fc), + TOBN(0x1d819fc9, 0xa684f70c), TOBN(0x29b47fdd, 0xc9f7b1e0)}}, + {{TOBN(0x358de103, 0x459b1940), TOBN(0xec881c59, 0x5b013e93), + TOBN(0x51574c93, 0x49532ad3), TOBN(0x2db1d445, 0xb37b46de)}, + {TOBN(0xc6445b87, 0xdf239fd8), TOBN(0xc718af75, 0x151d24ee), + TOBN(0xaea1c4a4, 0xf43c6259), TOBN(0x40c0e5d7, 0x70be02f7)}}, + {{TOBN(0x6a4590f4, 0x721b33f2), TOBN(0x2124f1fb, 0xfedf04ea), + TOBN(0xf8e53cde, 0x9745efe7), TOBN(0xe7e10432, 0x65f046d9)}, + {TOBN(0xc3fca28e, 0xe4d0c7e6), TOBN(0x847e339a, 0x87253b1b), + TOBN(0x9b595348, 0x3743e643), TOBN(0xcb6a0a0b, 0x4fd12fc5)}}, + {{TOBN(0xfb6836c3, 0x27d02dcc), TOBN(0x5ad00982, 0x7a68bcc2), + TOBN(0x1b24b44c, 0x005e912d), TOBN(0xcc83d20f, 0x811fdcfe)}, + {TOBN(0x36527ec1, 0x666fba0c), TOBN(0x69948197, 0x14754635), + TOBN(0xfcdcb1a8, 0x556da9c2), TOBN(0xa5934267, 0x81a732b2)}}, + {{TOBN(0xec1214ed, 0xa714181d), TOBN(0x609ac13b, 0x6067b341), + TOBN(0xff4b4c97, 0xa545df1f), TOBN(0xa1240501, 0x34d2076b)}, + {TOBN(0x6efa0c23, 0x1409ca97), TOBN(0x254cc1a8, 0x20638c43), + TOBN(0xd4e363af, 0xdcfb46cd), TOBN(0x62c2adc3, 0x03942a27)}}, + {{TOBN(0xc67b9df0, 0x56e46483), TOBN(0xa55abb20, 0x63736356), + TOBN(0xab93c098, 0xc551bc52), TOBN(0x382b49f9, 0xb15fe64b)}, + {TOBN(0x9ec221ad, 0x4dff8d47), TOBN(0x79caf615, 0x437df4d6), + TOBN(0x5f13dc64, 0xbb456509), TOBN(0xe4c589d9, 0x191f0714)}}, + {{TOBN(0x27b6a8ab, 0x3fd40e09), TOBN(0xe455842e, 0x77313ea9), + TOBN(0x8b51d1e2, 0x1f55988b), TOBN(0x5716dd73, 0x062bbbfc)}, + {TOBN(0x633c11e5, 0x4e8bf3de), TOBN(0x9a0e77b6, 0x1b85be3b), + TOBN(0x56510729, 0x0911cca6), TOBN(0x27e76495, 0xefa6590f)}}, + {{TOBN(0xe4ac8b33, 0x070d3aab), TOBN(0x2643672b, 0x9a2cd5e5), + TOBN(0x52eff79b, 0x1cfc9173), TOBN(0x665ca49b, 0x90a7c13f)}, + {TOBN(0x5a8dda59, 0xb3efb998), TOBN(0x8a5b922d, 0x052f1341), + TOBN(0xae9ebbab, 0x3cf9a530), TOBN(0x35986e7b, 0xf56da4d7)}}, + {{TOBN(0x3a636b5c, 0xff3513cc), TOBN(0xbb0cf8ba, 0x3198f7dd), + TOBN(0xb8d40522, 0x41f16f86), TOBN(0x760575d8, 0xde13a7bf)}, + {TOBN(0x36f74e16, 0x9f7aa181), TOBN(0x163a3ecf, 0xf509ed1c), + TOBN(0x6aead61f, 0x3c40a491), TOBN(0x158c95fc, 0xdfe8fcaa)}}, + {{TOBN(0xa3991b6e, 0x13cda46f), TOBN(0x79482415, 0x342faed0), + TOBN(0xf3ba5bde, 0x666b5970), TOBN(0x1d52e6bc, 0xb26ab6dd)}, + {TOBN(0x768ba1e7, 0x8608dd3d), TOBN(0x4930db2a, 0xea076586), + TOBN(0xd9575714, 0xe7dc1afa), TOBN(0x1fc7bf7d, 0xf7c58817)}}, + {{TOBN(0x6b47accd, 0xd9eee96c), TOBN(0x0ca277fb, 0xe58cec37), + TOBN(0x113fe413, 0xe702c42a), TOBN(0xdd1764ee, 0xc47cbe51)}, + {TOBN(0x041e7cde, 0x7b3ed739), TOBN(0x50cb7459, 0x5ce9e1c0), + TOBN(0x35568513, 0x2925b212), TOBN(0x7cff95c4, 0x001b081c)}}, + {{TOBN(0x63ee4cbd, 0x8088b454), TOBN(0xdb7f32f7, 0x9a9e0c8a), + TOBN(0xb377d418, 0x6b2447cb), TOBN(0xe3e982aa, 0xd370219b)}, + {TOBN(0x06ccc1e4, 0xc2a2a593), TOBN(0x72c36865, 0x0773f24f), + TOBN(0xa13b4da7, 0x95859423), TOBN(0x8bbf1d33, 0x75040c8f)}}, + {{TOBN(0x726f0973, 0xda50c991), TOBN(0x48afcd5b, 0x822d6ee2), + TOBN(0xe5fc718b, 0x20fd7771), TOBN(0xb9e8e77d, 0xfd0807a1)}, + {TOBN(0x7f5e0f44, 0x99a7703d), TOBN(0x6972930e, 0x618e36f3), + TOBN(0x2b7c77b8, 0x23807bbe), TOBN(0xe5b82405, 0xcb27ff50)}}, + {{TOBN(0xba8b8be3, 0xbd379062), TOBN(0xd64b7a1d, 0x2dce4a92), + TOBN(0x040a73c5, 0xb2952e37), TOBN(0x0a9e252e, 0xd438aeca)}, + {TOBN(0xdd43956b, 0xc39d3bcb), TOBN(0x1a31ca00, 0xb32b2d63), + TOBN(0xd67133b8, 0x5c417a18), TOBN(0xd08e4790, 0x2ef442c8)}}, + {{TOBN(0x98cb1ae9, 0x255c0980), TOBN(0x4bd86381, 0x2b4a739f), + TOBN(0x5a5c31e1, 0x1e4a45a1), TOBN(0x1e5d55fe, 0x9cb0db2f)}, + {TOBN(0x74661b06, 0x8ff5cc29), TOBN(0x026b389f, 0x0eb8a4f4), + TOBN(0x536b21a4, 0x58848c24), TOBN(0x2e5bf8ec, 0x81dc72b0)}}, + {{TOBN(0x03c187d0, 0xad886aac), TOBN(0x5c16878a, 0xb771b645), + TOBN(0xb07dfc6f, 0xc74045ab), TOBN(0x2c6360bf, 0x7800caed)}, + {TOBN(0x24295bb5, 0xb9c972a3), TOBN(0xc9e6f88e, 0x7c9a6dba), + TOBN(0x90ffbf24, 0x92a79aa6), TOBN(0xde29d50a, 0x41c26ac2)}}, + {{TOBN(0x9f0af483, 0xd309cbe6), TOBN(0x5b020d8a, 0xe0bced4f), + TOBN(0x606e986d, 0xb38023e3), TOBN(0xad8f2c9d, 0x1abc6933)}, + {TOBN(0x19292e1d, 0xe7400e93), TOBN(0xfe3e18a9, 0x52be5e4d), + TOBN(0xe8e9771d, 0x2e0680bf), TOBN(0x8c5bec98, 0xc54db063)}}, + {{TOBN(0x2af9662a, 0x74a55d1f), TOBN(0xe3fbf28f, 0x046f66d8), + TOBN(0xa3a72ab4, 0xd4dc4794), TOBN(0x09779f45, 0x5c7c2dd8)}, + {TOBN(0xd893bdaf, 0xc3d19d8d), TOBN(0xd5a75094, 0x57d6a6df), + TOBN(0x8cf8fef9, 0x952e6255), TOBN(0x3da67cfb, 0xda9a8aff)}}, + {{TOBN(0x4c23f62a, 0x2c160dcd), TOBN(0x34e6c5e3, 0x8f90eaef), + TOBN(0x35865519, 0xa9a65d5a), TOBN(0x07c48aae, 0x8fd38a3d)}, + {TOBN(0xb7e7aeda, 0x50068527), TOBN(0x2c09ef23, 0x1c90936a), + TOBN(0x31ecfeb6, 0xe879324c), TOBN(0xa0871f6b, 0xfb0ec938)}}, + {{TOBN(0xb1f0fb68, 0xd84d835d), TOBN(0xc90caf39, 0x861dc1e6), + TOBN(0x12e5b046, 0x7594f8d7), TOBN(0x26897ae2, 0x65012b92)}, + {TOBN(0xbcf68a08, 0xa4d6755d), TOBN(0x403ee41c, 0x0991fbda), + TOBN(0x733e343e, 0x3bbf17e8), TOBN(0xd2c7980d, 0x679b3d65)}}, + {{TOBN(0x33056232, 0xd2e11305), TOBN(0x966be492, 0xf3c07a6f), + TOBN(0x6a8878ff, 0xbb15509d), TOBN(0xff221101, 0x0a9b59a4)}, + {TOBN(0x6c9f564a, 0xabe30129), TOBN(0xc6f2c940, 0x336e64cf), + TOBN(0x0fe75262, 0x8b0c8022), TOBN(0xbe0267e9, 0x6ae8db87)}}, + {{TOBN(0x22e192f1, 0x93bc042b), TOBN(0xf085b534, 0xb237c458), + TOBN(0xa0d192bd, 0x832c4168), TOBN(0x7a76e9e3, 0xbdf6271d)}, + {TOBN(0x52a882fa, 0xb88911b5), TOBN(0xc85345e4, 0xb4db0eb5), + TOBN(0xa3be02a6, 0x81a7c3ff), TOBN(0x51889c8c, 0xf0ec0469)}}, + {{TOBN(0x9d031369, 0xa5e829e5), TOBN(0xcbb4c6fc, 0x1607aa41), + TOBN(0x75ac59a6, 0x241d84c1), TOBN(0xc043f2bf, 0x8829e0ee)}, + {TOBN(0x82a38f75, 0x8ea5e185), TOBN(0x8bda40b9, 0xd87cbd9f), + TOBN(0x9e65e75e, 0x2d8fc601), TOBN(0x3d515f74, 0xa35690b3)}}, + {{TOBN(0x534acf4f, 0xda79e5ac), TOBN(0x68b83b3a, 0x8630215f), + TOBN(0x5c748b2e, 0xd085756e), TOBN(0xb0317258, 0xe5d37cb2)}, + {TOBN(0x6735841a, 0xc5ccc2c4), TOBN(0x7d7dc96b, 0x3d9d5069), + TOBN(0xa147e410, 0xfd1754bd), TOBN(0x65296e94, 0xd399ddd5)}}, + {{TOBN(0xf6b5b2d0, 0xbc8fa5bc), TOBN(0x8a5ead67, 0x500c277b), + TOBN(0x214625e6, 0xdfa08a5d), TOBN(0x51fdfedc, 0x959cf047)}, + {TOBN(0x6bc9430b, 0x289fca32), TOBN(0xe36ff0cf, 0x9d9bdc3f), + TOBN(0x2fe187cb, 0x58ea0ede), TOBN(0xed66af20, 0x5a900b3f)}}, + {{TOBN(0x00e0968b, 0x5fa9f4d6), TOBN(0x2d4066ce, 0x37a362e7), + TOBN(0xa99a9748, 0xbd07e772), TOBN(0x710989c0, 0x06a4f1d0)}, + {TOBN(0xd5dedf35, 0xce40cbd8), TOBN(0xab55c5f0, 0x1743293d), + TOBN(0x766f1144, 0x8aa24e2c), TOBN(0x94d874f8, 0x605fbcb4)}}, + {{TOBN(0xa365f0e8, 0xa518001b), TOBN(0xee605eb6, 0x9d04ef0f), + TOBN(0x5a3915cd, 0xba8d4d25), TOBN(0x44c0e1b8, 0xb5113472)}, + {TOBN(0xcbb024e8, 0x8b6740dc), TOBN(0x89087a53, 0xee1d4f0c), + TOBN(0xa88fa05c, 0x1fc4e372), TOBN(0x8bf395cb, 0xaf8b3af2)}}, + {{TOBN(0x1e71c9a1, 0xdeb8568b), TOBN(0xa35daea0, 0x80fb3d32), + TOBN(0xe8b6f266, 0x2cf8fb81), TOBN(0x6d51afe8, 0x9490696a)}, + {TOBN(0x81beac6e, 0x51803a19), TOBN(0xe3d24b7f, 0x86219080), + TOBN(0x727cfd9d, 0xdf6f463c), TOBN(0x8c6865ca, 0x72284ee8)}}, + {{TOBN(0x32c88b7d, 0xb743f4ef), TOBN(0x3793909b, 0xe7d11dce), + TOBN(0xd398f922, 0x2ff2ebe8), TOBN(0x2c70ca44, 0xe5e49796)}, + {TOBN(0xdf4d9929, 0xcb1131b1), TOBN(0x7826f298, 0x25888e79), + TOBN(0x4d3a112c, 0xf1d8740a), TOBN(0x00384cb6, 0x270afa8b)}}, + {{TOBN(0xcb64125b, 0x3ab48095), TOBN(0x3451c256, 0x62d05106), + TOBN(0xd73d577d, 0xa4955845), TOBN(0x39570c16, 0xbf9f4433)}, + {TOBN(0xd7dfaad3, 0xadecf263), TOBN(0xf1c3d8d1, 0xdc76e102), + TOBN(0x5e774a58, 0x54c6a836), TOBN(0xdad4b672, 0x3e92d47b)}}, + {{TOBN(0xbe7e990f, 0xf0d796a0), TOBN(0x5fc62478, 0xdf0e8b02), + TOBN(0x8aae8bf4, 0x030c00ad), TOBN(0x3d2db93b, 0x9004ba0f)}, + {TOBN(0xe48c8a79, 0xd85d5ddc), TOBN(0xe907caa7, 0x6bb07f34), + TOBN(0x58db343a, 0xa39eaed5), TOBN(0x0ea6e007, 0xadaf5724)}}, + {{TOBN(0xe00df169, 0xd23233f3), TOBN(0x3e322796, 0x77cb637f), + TOBN(0x1f897c0e, 0x1da0cf6c), TOBN(0xa651f5d8, 0x31d6bbdd)}, + {TOBN(0xdd61af19, 0x1a230c76), TOBN(0xbd527272, 0xcdaa5e4a), + TOBN(0xca753636, 0xd0abcd7e), TOBN(0x78bdd37c, 0x370bd8dc)}}, + {{TOBN(0xc23916c2, 0x17cd93fe), TOBN(0x65b97a4d, 0xdadce6e2), + TOBN(0xe04ed4eb, 0x174e42f8), TOBN(0x1491ccaa, 0xbb21480a)}, + {TOBN(0x145a8280, 0x23196332), TOBN(0x3c3862d7, 0x587b479a), + TOBN(0x9f4a88a3, 0x01dcd0ed), TOBN(0x4da2b7ef, 0x3ea12f1f)}}, + {{TOBN(0xf8e7ae33, 0xb126e48e), TOBN(0x404a0b32, 0xf494e237), + TOBN(0x9beac474, 0xc55acadb), TOBN(0x4ee5cf3b, 0xcbec9fd9)}, + {TOBN(0x336b33b9, 0x7df3c8c3), TOBN(0xbd905fe3, 0xb76808fd), + TOBN(0x8f436981, 0xaa45c16a), TOBN(0x255c5bfa, 0x3dd27b62)}}, + {{TOBN(0x71965cbf, 0xc3dd9b4d), TOBN(0xce23edbf, 0xfc068a87), + TOBN(0xb78d4725, 0x745b029b), TOBN(0x74610713, 0xcefdd9bd)}, + {TOBN(0x7116f75f, 0x1266bf52), TOBN(0x02046722, 0x18e49bb6), + TOBN(0xdf43df9f, 0x3d6f19e3), TOBN(0xef1bc7d0, 0xe685cb2f)}}, + {{TOBN(0xcddb27c1, 0x7078c432), TOBN(0xe1961b9c, 0xb77fedb7), + TOBN(0x1edc2f5c, 0xc2290570), TOBN(0x2c3fefca, 0x19cbd886)}, + {TOBN(0xcf880a36, 0xc2af389a), TOBN(0x96c610fd, 0xbda71cea), + TOBN(0xf03977a9, 0x32aa8463), TOBN(0x8eb7763f, 0x8586d90a)}}, + {{TOBN(0x3f342454, 0x2a296e77), TOBN(0xc8718683, 0x42837a35), + TOBN(0x7dc71090, 0x6a09c731), TOBN(0x54778ffb, 0x51b816db)}, + {TOBN(0x6b33bfec, 0xaf06defd), TOBN(0xfe3c105f, 0x8592b70b), + TOBN(0xf937fda4, 0x61da6114), TOBN(0x3c13e651, 0x4c266ad7)}}, + {{TOBN(0xe363a829, 0x855938e8), TOBN(0x2eeb5d9e, 0x9de54b72), + TOBN(0xbeb93b0e, 0x20ccfab9), TOBN(0x3dffbb5f, 0x25e61a25)}, + {TOBN(0x7f655e43, 0x1acc093d), TOBN(0x0cb6cc3d, 0x3964ce61), + TOBN(0x6ab283a1, 0xe5e9b460), TOBN(0x55d787c5, 0xa1c7e72d)}}, + {{TOBN(0x4d2efd47, 0xdeadbf02), TOBN(0x11e80219, 0xac459068), + TOBN(0x810c7626, 0x71f311f0), TOBN(0xfa17ef8d, 0x4ab6ef53)}, + {TOBN(0xaf47fd25, 0x93e43bff), TOBN(0x5cb5ff3f, 0x0be40632), + TOBN(0x54687106, 0x8ee61da3), TOBN(0x7764196e, 0xb08afd0f)}}, + {{TOBN(0x831ab3ed, 0xf0290a8f), TOBN(0xcae81966, 0xcb47c387), + TOBN(0xaad7dece, 0x184efb4f), TOBN(0xdcfc53b3, 0x4749110e)}, + {TOBN(0x6698f23c, 0x4cb632f9), TOBN(0xc42a1ad6, 0xb91f8067), + TOBN(0xb116a81d, 0x6284180a), TOBN(0xebedf5f8, 0xe901326f)}}, + {{TOBN(0xf2274c9f, 0x97e3e044), TOBN(0x42018520, 0x11d09fc9), + TOBN(0x56a65f17, 0xd18e6e23), TOBN(0x2ea61e2a, 0x352b683c)}, + {TOBN(0x27d291bc, 0x575eaa94), TOBN(0x9e7bc721, 0xb8ff522d), + TOBN(0x5f7268bf, 0xa7f04d6f), TOBN(0x5868c73f, 0xaba41748)}}, + {{TOBN(0x9f85c2db, 0x7be0eead), TOBN(0x511e7842, 0xff719135), + TOBN(0x5a06b1e9, 0xc5ea90d7), TOBN(0x0c19e283, 0x26fab631)}, + {TOBN(0x8af8f0cf, 0xe9206c55), TOBN(0x89389cb4, 0x3553c06a), + TOBN(0x39dbed97, 0xf65f8004), TOBN(0x0621b037, 0xc508991d)}}, + {{TOBN(0x1c52e635, 0x96e78cc4), TOBN(0x5385c8b2, 0x0c06b4a8), + TOBN(0xd84ddfdb, 0xb0e87d03), TOBN(0xc49dfb66, 0x934bafad)}, + {TOBN(0x7071e170, 0x59f70772), TOBN(0x3a073a84, 0x3a1db56b), + TOBN(0x03494903, 0x3b8af190), TOBN(0x7d882de3, 0xd32920f0)}}, + {{TOBN(0x91633f0a, 0xb2cf8940), TOBN(0x72b0b178, 0x6f948f51), + TOBN(0x2d28dc30, 0x782653c8), TOBN(0x88829849, 0xdb903a05)}, + {TOBN(0xb8095d0c, 0x6a19d2bb), TOBN(0x4b9e7f0c, 0x86f782cb), + TOBN(0x7af73988, 0x2d907064), TOBN(0xd12be0fe, 0x8b32643c)}}, + {{TOBN(0x358ed23d, 0x0e165dc3), TOBN(0x3d47ce62, 0x4e2378ce), + TOBN(0x7e2bb0b9, 0xfeb8a087), TOBN(0x3246e8ae, 0xe29e10b9)}, + {TOBN(0x459f4ec7, 0x03ce2b4d), TOBN(0xe9b4ca1b, 0xbbc077cf), + TOBN(0x2613b4f2, 0x0e9940c1), TOBN(0xfc598bb9, 0x047d1eb1)}}, + {{TOBN(0x9744c62b, 0x45036099), TOBN(0xa9dee742, 0x167c65d8), + TOBN(0x0c511525, 0xdabe1943), TOBN(0xda110554, 0x93c6c624)}, + {TOBN(0xae00a52c, 0x651a3be2), TOBN(0xcda5111d, 0x884449a6), + TOBN(0x063c06f4, 0xff33bed1), TOBN(0x73baaf9a, 0x0d3d76b4)}}, + {{TOBN(0x52fb0c9d, 0x7fc63668), TOBN(0x6886c9dd, 0x0c039cde), + TOBN(0x602bd599, 0x55b22351), TOBN(0xb00cab02, 0x360c7c13)}, + {TOBN(0x8cb616bc, 0x81b69442), TOBN(0x41486700, 0xb55c3cee), + TOBN(0x71093281, 0xf49ba278), TOBN(0xad956d9c, 0x64a50710)}}, + {{TOBN(0x9561f28b, 0x638a7e81), TOBN(0x54155cdf, 0x5980ddc3), + TOBN(0xb2db4a96, 0xd26f247a), TOBN(0x9d774e4e, 0x4787d100)}, + {TOBN(0x1a9e6e2e, 0x078637d2), TOBN(0x1c363e2d, 0x5e0ae06a), + TOBN(0x7493483e, 0xe9cfa354), TOBN(0x76843cb3, 0x7f74b98d)}}, + {{TOBN(0xbaca6591, 0xd4b66947), TOBN(0xb452ce98, 0x04460a8c), + TOBN(0x6830d246, 0x43768f55), TOBN(0xf4197ed8, 0x7dff12df)}, + {TOBN(0x6521b472, 0x400dd0f7), TOBN(0x59f5ca8f, 0x4b1e7093), + TOBN(0x6feff11b, 0x080338ae), TOBN(0x0ada31f6, 0xa29ca3c6)}}, + {{TOBN(0x24794eb6, 0x94a2c215), TOBN(0xd83a43ab, 0x05a57ab4), + TOBN(0x264a543a, 0x2a6f89fe), TOBN(0x2c2a3868, 0xdd5ec7c2)}, + {TOBN(0xd3373940, 0x8439d9b2), TOBN(0x715ea672, 0x0acd1f11), + TOBN(0x42c1d235, 0xe7e6cc19), TOBN(0x81ce6e96, 0xb990585c)}}, + {{TOBN(0x04e5dfe0, 0xd809c7bd), TOBN(0xd7b2580c, 0x8f1050ab), + TOBN(0x6d91ad78, 0xd8a4176f), TOBN(0x0af556ee, 0x4e2e897c)}, + {TOBN(0x162a8b73, 0x921de0ac), TOBN(0x52ac9c22, 0x7ea78400), + TOBN(0xee2a4eea, 0xefce2174), TOBN(0xbe61844e, 0x6d637f79)}}, + {{TOBN(0x0491f1bc, 0x789a283b), TOBN(0x72d3ac3d, 0x880836f4), + TOBN(0xaa1c5ea3, 0x88e5402d), TOBN(0x1b192421, 0xd5cc473d)}, + {TOBN(0x5c0b9998, 0x9dc84cac), TOBN(0xb0a8482d, 0x9c6e75b8), + TOBN(0x639961d0, 0x3a191ce2), TOBN(0xda3bc865, 0x6d837930)}}, + {{TOBN(0xca990653, 0x056e6f8f), TOBN(0x84861c41, 0x64d133a7), + TOBN(0x8b403276, 0x746abe40), TOBN(0xb7b4d51a, 0xebf8e303)}, + {TOBN(0x05b43211, 0x220a255d), TOBN(0xc997152c, 0x02419e6e), + TOBN(0x76ff47b6, 0x630c2fea), TOBN(0x50518677, 0x281fdade)}}, + {{TOBN(0x3283b8ba, 0xcf902b0b), TOBN(0x8d4b4eb5, 0x37db303b), + TOBN(0xcc89f42d, 0x755011bc), TOBN(0xb43d74bb, 0xdd09d19b)}, + {TOBN(0x65746bc9, 0x8adba350), TOBN(0x364eaf8c, 0xb51c1927), + TOBN(0x13c76596, 0x10ad72ec), TOBN(0x30045121, 0xf8d40c20)}}, + {{TOBN(0x6d2d99b7, 0xea7b979b), TOBN(0xcd78cd74, 0xe6fb3bcd), + TOBN(0x11e45a9e, 0x86cffbfe), TOBN(0x78a61cf4, 0x637024f6)}, + {TOBN(0xd06bc872, 0x3d502295), TOBN(0xf1376854, 0x458cb288), + TOBN(0xb9db26a1, 0x342f8586), TOBN(0xf33effcf, 0x4beee09e)}}, + {{TOBN(0xd7e0c4cd, 0xb30cfb3a), TOBN(0x6d09b8c1, 0x6c9db4c8), + TOBN(0x40ba1a42, 0x07c8d9df), TOBN(0x6fd495f7, 0x1c52c66d)}, + {TOBN(0xfb0e169f, 0x275264da), TOBN(0x80c2b746, 0xe57d8362), + TOBN(0xedd987f7, 0x49ad7222), TOBN(0xfdc229af, 0x4398ec7b)}}}, + {{{TOBN(0xb0d1ed84, 0x52666a58), TOBN(0x4bcb6e00, 0xe6a9c3c2), + TOBN(0x3c57411c, 0x26906408), TOBN(0xcfc20755, 0x13556400)}, + {TOBN(0xa08b1c50, 0x5294dba3), TOBN(0xa30ba286, 0x8b7dd31e), + TOBN(0xd70ba90e, 0x991eca74), TOBN(0x094e142c, 0xe762c2b9)}}, + {{TOBN(0xb81d783e, 0x979f3925), TOBN(0x1efd130a, 0xaf4c89a7), + TOBN(0x525c2144, 0xfd1bf7fa), TOBN(0x4b296904, 0x1b265a9e)}, + {TOBN(0xed8e9634, 0xb9db65b6), TOBN(0x35c82e32, 0x03599d8a), + TOBN(0xdaa7a54f, 0x403563f3), TOBN(0x9df088ad, 0x022c38ab)}}, + {{TOBN(0xe5cfb066, 0xbb3fd30a), TOBN(0x429169da, 0xeff0354e), + TOBN(0x809cf852, 0x3524e36c), TOBN(0x136f4fb3, 0x0155be1d)}, + {TOBN(0x4826af01, 0x1fbba712), TOBN(0x6ef0f0b4, 0x506ba1a1), + TOBN(0xd9928b31, 0x77aea73e), TOBN(0xe2bf6af2, 0x5eaa244e)}}, + {{TOBN(0x8d084f12, 0x4237b64b), TOBN(0x688ebe99, 0xe3ecfd07), + TOBN(0x57b8a70c, 0xf6845dd8), TOBN(0x808fc59c, 0x5da4a325)}, + {TOBN(0xa9032b2b, 0xa3585862), TOBN(0xb66825d5, 0xedf29386), + TOBN(0xb5a5a8db, 0x431ec29b), TOBN(0xbb143a98, 0x3a1e8dc8)}}, + {{TOBN(0x35ee94ce, 0x12ae381b), TOBN(0x3a7f176c, 0x86ccda90), + TOBN(0xc63a657e, 0x4606eaca), TOBN(0x9ae5a380, 0x43cd04df)}, + {TOBN(0x9bec8d15, 0xed251b46), TOBN(0x1f5d6d30, 0xcaca5e64), + TOBN(0x347b3b35, 0x9ff20f07), TOBN(0x4d65f034, 0xf7e4b286)}}, + {{TOBN(0x9e93ba24, 0xf111661e), TOBN(0xedced484, 0xb105eb04), + TOBN(0x96dc9ba1, 0xf424b578), TOBN(0xbf8f66b7, 0xe83e9069)}, + {TOBN(0x872d4df4, 0xd7ed8216), TOBN(0xbf07f377, 0x8e2cbecf), + TOBN(0x4281d899, 0x98e73754), TOBN(0xfec85fbb, 0x8aab8708)}}, + {{TOBN(0x9a3c0dee, 0xa5ba5b0b), TOBN(0xe6a116ce, 0x42d05299), + TOBN(0xae9775fe, 0xe9b02d42), TOBN(0x72b05200, 0xa1545cb6)}, + {TOBN(0xbc506f7d, 0x31a3b4ea), TOBN(0xe5893078, 0x8bbd9b32), + TOBN(0xc8bc5f37, 0xe4b12a97), TOBN(0x6b000c06, 0x4a73b671)}}, + {{TOBN(0x13b5bf22, 0x765fa7d0), TOBN(0x59805bf0, 0x1d6a5370), + TOBN(0x67a5e29d, 0x4280db98), TOBN(0x4f53916f, 0x776b1ce3)}, + {TOBN(0x714ff61f, 0x33ddf626), TOBN(0x4206238e, 0xa085d103), + TOBN(0x1c50d4b7, 0xe5809ee3), TOBN(0x999f450d, 0x85f8eb1d)}}, + {{TOBN(0x658a6051, 0xe4c79e9b), TOBN(0x1394cb73, 0xc66a9fea), + TOBN(0x27f31ed5, 0xc6be7b23), TOBN(0xf4c88f36, 0x5aa6f8fe)}, + {TOBN(0x0fb0721f, 0x4aaa499e), TOBN(0x68b3a7d5, 0xe3fb2a6b), + TOBN(0xa788097d, 0x3a92851d), TOBN(0x060e7f8a, 0xe96f4913)}}, + {{TOBN(0x82eebe73, 0x1a3a93bc), TOBN(0x42bbf465, 0xa21adc1a), + TOBN(0xc10b6fa4, 0xef030efd), TOBN(0x247aa4c7, 0x87b097bb)}, + {TOBN(0x8b8dc632, 0xf60c77da), TOBN(0x6ffbc26a, 0xc223523e), + TOBN(0xa4f6ff11, 0x344579cf), TOBN(0x5825653c, 0x980250f6)}}, + {{TOBN(0xb2dd097e, 0xbc1aa2b9), TOBN(0x07889393, 0x37a0333a), + TOBN(0x1cf55e71, 0x37a0db38), TOBN(0x2648487f, 0x792c1613)}, + {TOBN(0xdad01336, 0x3fcef261), TOBN(0x6239c81d, 0x0eabf129), + TOBN(0x8ee761de, 0x9d276be2), TOBN(0x406a7a34, 0x1eda6ad3)}}, + {{TOBN(0x4bf367ba, 0x4a493b31), TOBN(0x54f20a52, 0x9bf7f026), + TOBN(0xb696e062, 0x9795914b), TOBN(0xcddab96d, 0x8bf236ac)}, + {TOBN(0x4ff2c70a, 0xed25ea13), TOBN(0xfa1d09eb, 0x81cbbbe7), + TOBN(0x88fc8c87, 0x468544c5), TOBN(0x847a670d, 0x696b3317)}}, + {{TOBN(0xf133421e, 0x64bcb626), TOBN(0xaea638c8, 0x26dee0b5), + TOBN(0xd6e7680b, 0xb310346c), TOBN(0xe06f4097, 0xd5d4ced3)}, + {TOBN(0x09961452, 0x7512a30b), TOBN(0xf3d867fd, 0xe589a59a), + TOBN(0x2e73254f, 0x52d0c180), TOBN(0x9063d8a3, 0x333c74ac)}}, + {{TOBN(0xeda6c595, 0xd314e7bc), TOBN(0x2ee7464b, 0x467899ed), + TOBN(0x1cef423c, 0x0a1ed5d3), TOBN(0x217e76ea, 0x69cc7613)}, + {TOBN(0x27ccce1f, 0xe7cda917), TOBN(0x12d8016b, 0x8a893f16), + TOBN(0xbcd6de84, 0x9fc74f6b), TOBN(0xfa5817e2, 0xf3144e61)}}, + {{TOBN(0x1f354164, 0x0821ee4c), TOBN(0x1583eab4, 0x0bc61992), + TOBN(0x7490caf6, 0x1d72879f), TOBN(0x998ad9f3, 0xf76ae7b2)}, + {TOBN(0x1e181950, 0xa41157f7), TOBN(0xa9d7e1e6, 0xe8da3a7e), + TOBN(0x963784eb, 0x8426b95f), TOBN(0x0ee4ed6e, 0x542e2a10)}}, + {{TOBN(0xb79d4cc5, 0xac751e7b), TOBN(0x93f96472, 0xfd4211bd), + TOBN(0x8c72d3d2, 0xc8de4fc6), TOBN(0x7b69cbf5, 0xdf44f064)}, + {TOBN(0x3da90ca2, 0xf4bf94e1), TOBN(0x1a5325f8, 0xf12894e2), + TOBN(0x0a437f6c, 0x7917d60b), TOBN(0x9be70486, 0x96c9cb5d)}}, + {{TOBN(0xb4d880bf, 0xe1dc5c05), TOBN(0xd738adda, 0xeebeeb57), + TOBN(0x6f0119d3, 0xdf0fe6a3), TOBN(0x5c686e55, 0x66eaaf5a)}, + {TOBN(0x9cb10b50, 0xdfd0b7ec), TOBN(0xbdd0264b, 0x6a497c21), + TOBN(0xfc093514, 0x8c546c96), TOBN(0x58a947fa, 0x79dbf42a)}}, + {{TOBN(0xc0b48d4e, 0x49ccd6d7), TOBN(0xff8fb02c, 0x88bd5580), + TOBN(0xc75235e9, 0x07d473b2), TOBN(0x4fab1ac5, 0xa2188af3)}, + {TOBN(0x030fa3bc, 0x97576ec0), TOBN(0xe8c946e8, 0x0b7e7d2f), + TOBN(0x40a5c9cc, 0x70305600), TOBN(0x6d8260a9, 0xc8b013b4)}}, + {{TOBN(0x0368304f, 0x70bba85c), TOBN(0xad090da1, 0xa4a0d311), + TOBN(0x7170e870, 0x2415eec1), TOBN(0xbfba35fe, 0x8461ea47)}, + {TOBN(0x6279019a, 0xc1e91938), TOBN(0xa47638f3, 0x1afc415f), + TOBN(0x36c65cbb, 0xbcba0e0f), TOBN(0x02160efb, 0x034e2c48)}}, + {{TOBN(0xe6c51073, 0x615cd9e4), TOBN(0x498ec047, 0xf1243c06), + TOBN(0x3e5a8809, 0xb17b3d8c), TOBN(0x5cd99e61, 0x0cc565f1)}, + {TOBN(0x81e312df, 0x7851dafe), TOBN(0xf156f5ba, 0xa79061e2), + TOBN(0x80d62b71, 0x880c590e), TOBN(0xbec9746f, 0x0a39faa1)}}, + {{TOBN(0x1d98a9c1, 0xc8ed1f7a), TOBN(0x09e43bb5, 0xa81d5ff2), + TOBN(0xd5f00f68, 0x0da0794a), TOBN(0x412050d9, 0x661aa836)}, + {TOBN(0xa89f7c4e, 0x90747e40), TOBN(0x6dc05ebb, 0xb62a3686), + TOBN(0xdf4de847, 0x308e3353), TOBN(0x53868fbb, 0x9fb53bb9)}}, + {{TOBN(0x2b09d2c3, 0xcfdcf7dd), TOBN(0x41a9fce3, 0x723fcab4), + TOBN(0x73d905f7, 0x07f57ca3), TOBN(0x080f9fb1, 0xac8e1555)}, + {TOBN(0x7c088e84, 0x9ba7a531), TOBN(0x07d35586, 0xed9a147f), + TOBN(0x602846ab, 0xaf48c336), TOBN(0x7320fd32, 0x0ccf0e79)}}, + {{TOBN(0xaa780798, 0xb18bd1ff), TOBN(0x52c2e300, 0xafdd2905), + TOBN(0xf27ea3d6, 0x434267cd), TOBN(0x8b96d16d, 0x15605b5f)}, + {TOBN(0x7bb31049, 0x4b45706b), TOBN(0xe7f58b8e, 0x743d25f8), + TOBN(0xe9b5e45b, 0x87f30076), TOBN(0xd19448d6, 0x5d053d5a)}}, + {{TOBN(0x1ecc8cb9, 0xd3210a04), TOBN(0x6bc7d463, 0xdafb5269), + TOBN(0x3e59b10a, 0x67c3489f), TOBN(0x1769788c, 0x65641e1b)}, + {TOBN(0x8a53b82d, 0xbd6cb838), TOBN(0x7066d6e6, 0x236d5f22), + TOBN(0x03aa1c61, 0x6908536e), TOBN(0xc971da0d, 0x66ae9809)}}, + {{TOBN(0x01b3a86b, 0xc49a2fac), TOBN(0x3b8420c0, 0x3092e77a), + TOBN(0x02057300, 0x7d6fb556), TOBN(0x6941b2a1, 0xbff40a87)}, + {TOBN(0x140b6308, 0x0658ff2a), TOBN(0x87804363, 0x3424ab36), + TOBN(0x0253bd51, 0x5751e299), TOBN(0xc75bcd76, 0x449c3e3a)}}, + {{TOBN(0x92eb4090, 0x7f8f875d), TOBN(0x9c9d754e, 0x56c26bbf), + TOBN(0x158cea61, 0x8110bbe7), TOBN(0x62a6b802, 0x745f91ea)}, + {TOBN(0xa79c41aa, 0xc6e7394b), TOBN(0x445b6a83, 0xad57ef10), + TOBN(0x0c5277eb, 0x6ea6f40c), TOBN(0x319fe96b, 0x88633365)}}, + {{TOBN(0x0b0fc61f, 0x385f63cb), TOBN(0x41250c84, 0x22bdd127), + TOBN(0x67d153f1, 0x09e942c2), TOBN(0x60920d08, 0xc021ad5d)}, + {TOBN(0x229f5746, 0x724d81a5), TOBN(0xb7ffb892, 0x5bba3299), + TOBN(0x518c51a1, 0xde413032), TOBN(0x2a9bfe77, 0x3c2fd94c)}}, + {{TOBN(0xcbcde239, 0x3191f4fd), TOBN(0x43093e16, 0xd3d6ada1), + TOBN(0x184579f3, 0x58769606), TOBN(0x2c94a8b3, 0xd236625c)}, + {TOBN(0x6922b9c0, 0x5c437d8e), TOBN(0x3d4ae423, 0xd8d9f3c8), + TOBN(0xf72c31c1, 0x2e7090a2), TOBN(0x4ac3f5f3, 0xd76a55bd)}}, + {{TOBN(0x342508fc, 0x6b6af991), TOBN(0x0d527100, 0x1b5cebbd), + TOBN(0xb84740d0, 0xdd440dd7), TOBN(0x748ef841, 0x780162fd)}, + {TOBN(0xa8dbfe0e, 0xdfc6fafb), TOBN(0xeadfdf05, 0xf7300f27), + TOBN(0x7d06555f, 0xfeba4ec9), TOBN(0x12c56f83, 0x9e25fa97)}}, + {{TOBN(0x77f84203, 0xd39b8c34), TOBN(0xed8b1be6, 0x3125eddb), + TOBN(0x5bbf2441, 0xf6e39dc5), TOBN(0xb00f6ee6, 0x6a5d678a)}, + {TOBN(0xba456ecf, 0x57d0ea99), TOBN(0xdcae0f58, 0x17e06c43), + TOBN(0x01643de4, 0x0f5b4baa), TOBN(0x2c324341, 0xd161b9be)}}, + {{TOBN(0x80177f55, 0xe126d468), TOBN(0xed325f1f, 0x76748e09), + TOBN(0x6116004a, 0xcfa9bdc2), TOBN(0x2d8607e6, 0x3a9fb468)}, + {TOBN(0x0e573e27, 0x6009d660), TOBN(0x3a525d2e, 0x8d10c5a1), + TOBN(0xd26cb45c, 0x3b9009a0), TOBN(0xb6b0cdc0, 0xde9d7448)}}, + {{TOBN(0x949c9976, 0xe1337c26), TOBN(0x6faadebd, 0xd73d68e5), + TOBN(0x9e158614, 0xf1b768d9), TOBN(0x22dfa557, 0x9cc4f069)}, + {TOBN(0xccd6da17, 0xbe93c6d6), TOBN(0x24866c61, 0xa504f5b9), + TOBN(0x2121353c, 0x8d694da1), TOBN(0x1c6ca580, 0x0140b8c6)}}, + {{TOBN(0xc245ad8c, 0xe964021e), TOBN(0xb83bffba, 0x032b82b3), + TOBN(0xfaa220c6, 0x47ef9898), TOBN(0x7e8d3ac6, 0x982c948a)}, + {TOBN(0x1faa2091, 0xbc2d124a), TOBN(0xbd54c3dd, 0x05b15ff4), + TOBN(0x386bf3ab, 0xc87c6fb7), TOBN(0xfb2b0563, 0xfdeb6f66)}}, + {{TOBN(0x4e77c557, 0x5b45afb4), TOBN(0xe9ded649, 0xefb8912d), + TOBN(0x7ec9bbf5, 0x42f6e557), TOBN(0x2570dfff, 0x62671f00)}, + {TOBN(0x2b3bfb78, 0x88e084bd), TOBN(0xa024b238, 0xf37fe5b4), + TOBN(0x44e7dc04, 0x95649aee), TOBN(0x498ca255, 0x5e7ec1d8)}}, + {{TOBN(0x3bc766ea, 0xaaa07e86), TOBN(0x0db6facb, 0xf3608586), + TOBN(0xbadd2549, 0xbdc259c8), TOBN(0x95af3c6e, 0x041c649f)}, + {TOBN(0xb36a928c, 0x02e30afb), TOBN(0x9b5356ad, 0x008a88b8), + TOBN(0x4b67a5f1, 0xcf1d9e9d), TOBN(0xc6542e47, 0xa5d8d8ce)}}, + {{TOBN(0x73061fe8, 0x7adfb6cc), TOBN(0xcc826fd3, 0x98678141), + TOBN(0x00e758b1, 0x3c80515a), TOBN(0x6afe3247, 0x41485083)}, + {TOBN(0x0fcb08b9, 0xb6ae8a75), TOBN(0xb8cf388d, 0x4acf51e1), + TOBN(0x344a5560, 0x6961b9d6), TOBN(0x1a6778b8, 0x6a97fd0c)}}, + {{TOBN(0xd840fdc1, 0xecc4c7e3), TOBN(0xde9fe47d, 0x16db68cc), + TOBN(0xe95f89de, 0xa3e216aa), TOBN(0x84f1a6a4, 0x9594a8be)}, + {TOBN(0x7ddc7d72, 0x5a7b162b), TOBN(0xc5cfda19, 0xadc817a3), + TOBN(0x80a5d350, 0x78b58d46), TOBN(0x93365b13, 0x82978f19)}}, + {{TOBN(0x2e44d225, 0x26a1fc90), TOBN(0x0d6d10d2, 0x4d70705d), + TOBN(0xd94b6b10, 0xd70c45f4), TOBN(0x0f201022, 0xb216c079)}, + {TOBN(0xcec966c5, 0x658fde41), TOBN(0xa8d2bc7d, 0x7e27601d), + TOBN(0xbfcce3e1, 0xff230be7), TOBN(0x3394ff6b, 0x0033ffb5)}}, + {{TOBN(0xd890c509, 0x8132c9af), TOBN(0xaac4b0eb, 0x361e7868), + TOBN(0x5194ded3, 0xe82d15aa), TOBN(0x4550bd2e, 0x23ae6b7d)}, + {TOBN(0x3fda318e, 0xea5399d4), TOBN(0xd989bffa, 0x91638b80), + TOBN(0x5ea124d0, 0xa14aa12d), TOBN(0x1fb1b899, 0x3667b944)}}, + {{TOBN(0x95ec7969, 0x44c44d6a), TOBN(0x91df144a, 0x57e86137), + TOBN(0x915fd620, 0x73adac44), TOBN(0x8f01732d, 0x59a83801)}, + {TOBN(0xec579d25, 0x3aa0a633), TOBN(0x06de5e7c, 0xc9d6d59c), + TOBN(0xc132f958, 0xb1ef8010), TOBN(0x29476f96, 0xe65c1a02)}}, + {{TOBN(0x336a77c0, 0xd34c3565), TOBN(0xef1105b2, 0x1b9f1e9e), + TOBN(0x63e6d08b, 0xf9e08002), TOBN(0x9aff2f21, 0xc613809e)}, + {TOBN(0xb5754f85, 0x3a80e75d), TOBN(0xde71853e, 0x6bbda681), + TOBN(0x86f041df, 0x8197fd7a), TOBN(0x8b332e08, 0x127817fa)}}, + {{TOBN(0x05d99be8, 0xb9c20cda), TOBN(0x89f7aad5, 0xd5cd0c98), + TOBN(0x7ef936fe, 0x5bb94183), TOBN(0x92ca0753, 0xb05cd7f2)}, + {TOBN(0x9d65db11, 0x74a1e035), TOBN(0x02628cc8, 0x13eaea92), + TOBN(0xf2d9e242, 0x49e4fbf2), TOBN(0x94fdfd9b, 0xe384f8b7)}}, + {{TOBN(0x65f56054, 0x63428c6b), TOBN(0x2f7205b2, 0x90b409a5), + TOBN(0xf778bb78, 0xff45ae11), TOBN(0xa13045be, 0xc5ee53b2)}, + {TOBN(0xe00a14ff, 0x03ef77fe), TOBN(0x689cd59f, 0xffef8bef), + TOBN(0x3578f0ed, 0x1e9ade22), TOBN(0xe99f3ec0, 0x6268b6a8)}}, + {{TOBN(0xa2057d91, 0xea1b3c3e), TOBN(0x2d1a7053, 0xb8823a4a), + TOBN(0xabbb336a, 0x2cca451e), TOBN(0xcd2466e3, 0x2218bb5d)}, + {TOBN(0x3ac1f42f, 0xc8cb762d), TOBN(0x7e312aae, 0x7690211f), + TOBN(0xebb9bd73, 0x45d07450), TOBN(0x207c4b82, 0x46c2213f)}}, + {{TOBN(0x99d425c1, 0x375913ec), TOBN(0x94e45e96, 0x67908220), + TOBN(0xc08f3087, 0xcd67dbf6), TOBN(0xa5670fbe, 0xc0887056)}, + {TOBN(0x6717b64a, 0x66f5b8fc), TOBN(0xd5a56aea, 0x786fec28), + TOBN(0xa8c3f55f, 0xc0ff4952), TOBN(0xa77fefae, 0x457ac49b)}}, + {{TOBN(0x29882d7c, 0x98379d44), TOBN(0xd000bdfb, 0x509edc8a), + TOBN(0xc6f95979, 0xe66fe464), TOBN(0x504a6115, 0xfa61bde0)}, + {TOBN(0x56b3b871, 0xeffea31a), TOBN(0x2d3de26d, 0xf0c21a54), + TOBN(0x21dbff31, 0x834753bf), TOBN(0xe67ecf49, 0x69269d86)}}, + {{TOBN(0x7a176952, 0x151fe690), TOBN(0x03515804, 0x7f2adb5f), + TOBN(0xee794b15, 0xd1b62a8d), TOBN(0xf004ceec, 0xaae454e6)}, + {TOBN(0x0897ea7c, 0xf0386fac), TOBN(0x3b62ff12, 0xd1fca751), + TOBN(0x154181df, 0x1b7a04ec), TOBN(0x2008e04a, 0xfb5847ec)}}, + {{TOBN(0xd147148e, 0x41dbd772), TOBN(0x2b419f73, 0x22942654), + TOBN(0x669f30d3, 0xe9c544f7), TOBN(0x52a2c223, 0xc8540149)}, + {TOBN(0x5da9ee14, 0x634dfb02), TOBN(0x5f074ff0, 0xf47869f3), + TOBN(0x74ee878d, 0xa3933acc), TOBN(0xe6510651, 0x4fe35ed1)}}, + {{TOBN(0xb3eb9482, 0xf1012e7a), TOBN(0x51013cc0, 0xa8a566ae), + TOBN(0xdd5e9243, 0x47c00d3b), TOBN(0x7fde089d, 0x946bb0e5)}, + {TOBN(0x030754fe, 0xc731b4b3), TOBN(0x12a136a4, 0x99fda062), + TOBN(0x7c1064b8, 0x5a1a35bc), TOBN(0xbf1f5763, 0x446c84ef)}}, + {{TOBN(0xed29a56d, 0xa16d4b34), TOBN(0x7fba9d09, 0xdca21c4f), + TOBN(0x66d7ac00, 0x6d8de486), TOBN(0x60061987, 0x73a2a5e1)}, + {TOBN(0x8b400f86, 0x9da28ff0), TOBN(0x3133f708, 0x43c4599c), + TOBN(0x9911c9b8, 0xee28cb0d), TOBN(0xcd7e2874, 0x8e0af61d)}}, + {{TOBN(0x5a85f0f2, 0x72ed91fc), TOBN(0x85214f31, 0x9cd4a373), + TOBN(0x881fe5be, 0x1925253c), TOBN(0xd8dc98e0, 0x91e8bc76)}, + {TOBN(0x7120affe, 0x585cc3a2), TOBN(0x724952ed, 0x735bf97a), + TOBN(0x5581e7dc, 0x3eb34581), TOBN(0x5cbff4f2, 0xe52ee57d)}}, + {{TOBN(0x8d320a0e, 0x87d8cc7b), TOBN(0x9beaa7f3, 0xf1d280d0), + TOBN(0x7a0b9571, 0x9beec704), TOBN(0x9126332e, 0x5b7f0057)}, + {TOBN(0x01fbc1b4, 0x8ed3bd6d), TOBN(0x35bb2c12, 0xd945eb24), + TOBN(0x6404694e, 0x9a8ae255), TOBN(0xb6092eec, 0x8d6abfb3)}}, + {{TOBN(0x4d76143f, 0xcc058865), TOBN(0x7b0a5af2, 0x6e249922), + TOBN(0x8aef9440, 0x6a50d353), TOBN(0xe11e4bcc, 0x64f0e07a)}, + {TOBN(0x4472993a, 0xa14a90fa), TOBN(0x7706e20c, 0xba0c51d4), + TOBN(0xf403292f, 0x1532672d), TOBN(0x52573bfa, 0x21829382)}}, + {{TOBN(0x6a7bb6a9, 0x3b5bdb83), TOBN(0x08da65c0, 0xa4a72318), + TOBN(0xc58d22aa, 0x63eb065f), TOBN(0x1717596c, 0x1b15d685)}, + {TOBN(0x112df0d0, 0xb266d88b), TOBN(0xf688ae97, 0x5941945a), + TOBN(0x487386e3, 0x7c292cac), TOBN(0x42f3b50d, 0x57d6985c)}}, + {{TOBN(0x6da4f998, 0x6a90fc34), TOBN(0xc8f257d3, 0x65ca8a8d), + TOBN(0xc2feabca, 0x6951f762), TOBN(0xe1bc81d0, 0x74c323ac)}, + {TOBN(0x1bc68f67, 0x251a2a12), TOBN(0x10d86587, 0xbe8a70dc), + TOBN(0xd648af7f, 0xf0f84d2e), TOBN(0xf0aa9ebc, 0x6a43ac92)}}, + {{TOBN(0x69e3be04, 0x27596893), TOBN(0xb6bb02a6, 0x45bf452b), + TOBN(0x0875c11a, 0xf4c698c8), TOBN(0x6652b5c7, 0xbece3794)}, + {TOBN(0x7b3755fd, 0x4f5c0499), TOBN(0x6ea16558, 0xb5532b38), + TOBN(0xd1c69889, 0xa2e96ef7), TOBN(0x9c773c3a, 0x61ed8f48)}}, + {{TOBN(0x2b653a40, 0x9b323abc), TOBN(0xe26605e1, 0xf0e1d791), + TOBN(0x45d41064, 0x4a87157a), TOBN(0x8f9a78b7, 0xcbbce616)}, + {TOBN(0xcf1e44aa, 0xc407eddd), TOBN(0x81ddd1d8, 0xa35b964f), + TOBN(0x473e339e, 0xfd083999), TOBN(0x6c94bdde, 0x8e796802)}}, + {{TOBN(0x5a304ada, 0x8545d185), TOBN(0x82ae44ea, 0x738bb8cb), + TOBN(0x628a35e3, 0xdf87e10e), TOBN(0xd3624f3d, 0xa15b9fe3)}, + {TOBN(0xcc44209b, 0x14be4254), TOBN(0x7d0efcbc, 0xbdbc2ea5), + TOBN(0x1f603362, 0x04c37bbe), TOBN(0x21f363f5, 0x56a5852c)}}, + {{TOBN(0xa1503d1c, 0xa8501550), TOBN(0x2251e0e1, 0xd8ab10bb), + TOBN(0xde129c96, 0x6961c51c), TOBN(0x1f7246a4, 0x81910f68)}, + {TOBN(0x2eb744ee, 0x5f2591f2), TOBN(0x3c47d33f, 0x5e627157), + TOBN(0x4d6d62c9, 0x22f3bd68), TOBN(0x6120a64b, 0xcb8df856)}}, + {{TOBN(0x3a9ac6c0, 0x7b5d07df), TOBN(0xa92b9558, 0x7ef39783), + TOBN(0xe128a134, 0xab3a9b4f), TOBN(0x41c18807, 0xb1252f05)}, + {TOBN(0xfc7ed089, 0x80ba9b1c), TOBN(0xac8dc6de, 0xc532a9dd), + TOBN(0xbf829cef, 0x55246809), TOBN(0x101b784f, 0x5b4ee80f)}}, + {{TOBN(0xc09945bb, 0xb6f11603), TOBN(0x57b09dbe, 0x41d2801e), + TOBN(0xfba5202f, 0xa97534a8), TOBN(0x7fd8ae5f, 0xc17b9614)}, + {TOBN(0xa50ba666, 0x78308435), TOBN(0x9572f77c, 0xd3868c4d), + TOBN(0x0cef7bfd, 0x2dd7aab0), TOBN(0xe7958e08, 0x2c7c79ff)}}, + {{TOBN(0x81262e42, 0x25346689), TOBN(0x716da290, 0xb07c7004), + TOBN(0x35f911ea, 0xb7950ee3), TOBN(0x6fd72969, 0x261d21b5)}, + {TOBN(0x52389803, 0x08b640d3), TOBN(0x5b0026ee, 0x887f12a1), + TOBN(0x20e21660, 0x742e9311), TOBN(0x0ef6d541, 0x5ff77ff7)}}, + {{TOBN(0x969127f0, 0xf9c41135), TOBN(0xf21d60c9, 0x68a64993), + TOBN(0x656e5d0c, 0xe541875c), TOBN(0xf1e0f84e, 0xa1d3c233)}, + {TOBN(0x9bcca359, 0x06002d60), TOBN(0xbe2da60c, 0x06191552), + TOBN(0x5da8bbae, 0x61181ec3), TOBN(0x9f04b823, 0x65806f19)}}, + {{TOBN(0xf1604a7d, 0xd4b79bb8), TOBN(0xaee806fb, 0x52c878c8), + TOBN(0x34144f11, 0x8d47b8e8), TOBN(0x72edf52b, 0x949f9054)}, + {TOBN(0xebfca84e, 0x2127015a), TOBN(0x9051d0c0, 0x9cb7cef3), + TOBN(0x86e8fe58, 0x296deec8), TOBN(0x33b28188, 0x41010d74)}}}, + {{{TOBN(0x01079383, 0x171b445f), TOBN(0x9bcf21e3, 0x8131ad4c), + TOBN(0x8cdfe205, 0xc93987e8), TOBN(0xe63f4152, 0xc92e8c8f)}, + {TOBN(0x729462a9, 0x30add43d), TOBN(0x62ebb143, 0xc980f05a), + TOBN(0x4f3954e5, 0x3b06e968), TOBN(0xfe1d75ad, 0x242cf6b1)}}, + {{TOBN(0x5f95c6c7, 0xaf8685c8), TOBN(0xd4c1c8ce, 0x2f8f01aa), + TOBN(0xc44bbe32, 0x2574692a), TOBN(0xb8003478, 0xd4a4a068)}, + {TOBN(0x7c8fc6e5, 0x2eca3cdb), TOBN(0xea1db16b, 0xec04d399), + TOBN(0xb05bc82e, 0x8f2bc5cf), TOBN(0x763d517f, 0xf44793d2)}}, + {{TOBN(0x4451c1b8, 0x08bd98d0), TOBN(0x644b1cd4, 0x6575f240), + TOBN(0x6907eb33, 0x7375d270), TOBN(0x56c8bebd, 0xfa2286bd)}, + {TOBN(0xc713d2ac, 0xc4632b46), TOBN(0x17da427a, 0xafd60242), + TOBN(0x313065b7, 0xc95c7546), TOBN(0xf8239898, 0xbf17a3de)}}, + {{TOBN(0xf3b7963f, 0x4c830320), TOBN(0x842c7aa0, 0x903203e3), + TOBN(0xaf22ca0a, 0xe7327afb), TOBN(0x38e13092, 0x967609b6)}, + {TOBN(0x73b8fb62, 0x757558f1), TOBN(0x3cc3e831, 0xf7eca8c1), + TOBN(0xe4174474, 0xf6331627), TOBN(0xa77989ca, 0xc3c40234)}}, + {{TOBN(0xe5fd17a1, 0x44a081e0), TOBN(0xd797fb7d, 0xb70e296a), + TOBN(0x2b472b30, 0x481f719c), TOBN(0x0e632a98, 0xfe6f8c52)}, + {TOBN(0x89ccd116, 0xc5f0c284), TOBN(0xf51088af, 0x2d987c62), + TOBN(0x2a2bccda, 0x4c2de6cf), TOBN(0x810f9efe, 0xf679f0f9)}}, + {{TOBN(0xb0f394b9, 0x7ffe4b3e), TOBN(0x0b691d21, 0xe5fa5d21), + TOBN(0xb0bd7747, 0x9dfbbc75), TOBN(0xd2830fda, 0xfaf78b00)}, + {TOBN(0xf78c249c, 0x52434f57), TOBN(0x4b1f7545, 0x98096dab), + TOBN(0x73bf6f94, 0x8ff8c0b3), TOBN(0x34aef03d, 0x454e134c)}}, + {{TOBN(0xf8d151f4, 0xb7ac7ec5), TOBN(0xd6ceb95a, 0xe50da7d5), + TOBN(0xa1b492b0, 0xdc3a0eb8), TOBN(0x75157b69, 0xb3dd2863)}, + {TOBN(0xe2c4c74e, 0xc5413d62), TOBN(0xbe329ff7, 0xbc5fc4c7), + TOBN(0x835a2aea, 0x60fa9dda), TOBN(0xf117f5ad, 0x7445cb87)}}, + {{TOBN(0xae8317f4, 0xb0166f7a), TOBN(0xfbd3e3f7, 0xceec74e6), + TOBN(0xfdb516ac, 0xe0874bfd), TOBN(0x3d846019, 0xc681f3a3)}, + {TOBN(0x0b12ee5c, 0x7c1620b0), TOBN(0xba68b4dd, 0x2b63c501), + TOBN(0xac03cd32, 0x6668c51e), TOBN(0x2a6279f7, 0x4e0bcb5b)}}, + {{TOBN(0x17bd69b0, 0x6ae85c10), TOBN(0x72946979, 0x1dfdd3a6), + TOBN(0xd9a03268, 0x2c078bec), TOBN(0x41c6a658, 0xbfd68a52)}, + {TOBN(0xcdea1024, 0x0e023900), TOBN(0xbaeec121, 0xb10d144d), + TOBN(0x5a600e74, 0x058ab8dc), TOBN(0x1333af21, 0xbb89ccdd)}}, + {{TOBN(0xdf25eae0, 0x3aaba1f1), TOBN(0x2cada16e, 0x3b7144cf), + TOBN(0x657ee27d, 0x71ab98bc), TOBN(0x99088b4c, 0x7a6fc96e)}, + {TOBN(0x05d5c0a0, 0x3549dbd4), TOBN(0x42cbdf8f, 0xf158c3ac), + TOBN(0x3fb6b3b0, 0x87edd685), TOBN(0x22071cf6, 0x86f064d0)}}, + {{TOBN(0xd2d6721f, 0xff2811e5), TOBN(0xdb81b703, 0xfe7fae8c), + TOBN(0x3cfb74ef, 0xd3f1f7bb), TOBN(0x0cdbcd76, 0x16cdeb5d)}, + {TOBN(0x4f39642a, 0x566a808c), TOBN(0x02b74454, 0x340064d6), + TOBN(0xfabbadca, 0x0528fa6f), TOBN(0xe4c3074c, 0xd3fc0bb6)}}, + {{TOBN(0xb32cb8b0, 0xb796d219), TOBN(0xc3e95f4f, 0x34741dd9), + TOBN(0x87212125, 0x68edf6f5), TOBN(0x7a03aee4, 0xa2b9cb8e)}, + {TOBN(0x0cd3c376, 0xf53a89aa), TOBN(0x0d8af9b1, 0x948a28dc), + TOBN(0xcf86a3f4, 0x902ab04f), TOBN(0x8aacb62a, 0x7f42002d)}}, + {{TOBN(0x106985eb, 0xf62ffd52), TOBN(0xe670b54e, 0x5797bf10), + TOBN(0x4b405209, 0xc5e30aef), TOBN(0x12c97a20, 0x4365b5e9)}, + {TOBN(0x104646ce, 0x1fe32093), TOBN(0x13cb4ff6, 0x3907a8c9), + TOBN(0x8b9f30d1, 0xd46e726b), TOBN(0xe1985e21, 0xaba0f499)}}, + {{TOBN(0xc573dea9, 0x10a230cd), TOBN(0x24f46a93, 0xcd30f947), + TOBN(0xf2623fcf, 0xabe2010a), TOBN(0x3f278cb2, 0x73f00e4f)}, + {TOBN(0xed55c67d, 0x50b920eb), TOBN(0xf1cb9a2d, 0x8e760571), + TOBN(0x7c50d109, 0x0895b709), TOBN(0x4207cf07, 0x190d4369)}}, + {{TOBN(0x3b027e81, 0xc4127fe1), TOBN(0xa9f8b9ad, 0x3ae9c566), + TOBN(0x5ab10851, 0xacbfbba5), TOBN(0xa747d648, 0x569556f5)}, + {TOBN(0xcc172b5c, 0x2ba97bf7), TOBN(0x15e0f77d, 0xbcfa3324), + TOBN(0xa345b797, 0x7686279d), TOBN(0x5a723480, 0xe38003d3)}}, + {{TOBN(0xfd8e139f, 0x8f5fcda8), TOBN(0xf3e558c4, 0xbdee5bfd), + TOBN(0xd76cbaf4, 0xe33f9f77), TOBN(0x3a4c97a4, 0x71771969)}, + {TOBN(0xda27e84b, 0xf6dce6a7), TOBN(0xff373d96, 0x13e6c2d1), + TOBN(0xf115193c, 0xd759a6e9), TOBN(0x3f9b7025, 0x63d2262c)}}, + {{TOBN(0xd9764a31, 0x317cd062), TOBN(0x30779d8e, 0x199f8332), + TOBN(0xd8074106, 0x16b11b0b), TOBN(0x7917ab9f, 0x78aeaed8)}, + {TOBN(0xb67a9cbe, 0x28fb1d8e), TOBN(0x2e313563, 0x136eda33), + TOBN(0x010b7069, 0xa371a86c), TOBN(0x44d90fa2, 0x6744e6b7)}}, + {{TOBN(0x68190867, 0xd6b3e243), TOBN(0x9fe6cd9d, 0x59048c48), + TOBN(0xb900b028, 0x95731538), TOBN(0xa012062f, 0x32cae04f)}, + {TOBN(0x8107c8bc, 0x9399d082), TOBN(0x47e8c54a, 0x41df12e2), + TOBN(0x14ba5117, 0xb6ef3f73), TOBN(0x22260bea, 0x81362f0b)}}, + {{TOBN(0x90ea261e, 0x1a18cc20), TOBN(0x2192999f, 0x2321d636), + TOBN(0xef64d314, 0xe311b6a0), TOBN(0xd7401e4c, 0x3b54a1f5)}, + {TOBN(0x19019983, 0x6fbca2ba), TOBN(0x46ad3293, 0x8fbffc4b), + TOBN(0xa142d3f6, 0x3786bf40), TOBN(0xeb5cbc26, 0xb67039fc)}}, + {{TOBN(0x9cb0ae6c, 0x252bd479), TOBN(0x05e0f88a, 0x12b5848f), + TOBN(0x78f6d2b2, 0xa5c97663), TOBN(0x6f6e149b, 0xc162225c)}, + {TOBN(0xe602235c, 0xde601a89), TOBN(0xd17bbe98, 0xf373be1f), + TOBN(0xcaf49a5b, 0xa8471827), TOBN(0x7e1a0a85, 0x18aaa116)}}, + {{TOBN(0x6c833196, 0x270580c3), TOBN(0x1e233839, 0xf1c98a14), + TOBN(0x67b2f7b4, 0xae34e0a5), TOBN(0x47ac8745, 0xd8ce7289)}, + {TOBN(0x2b74779a, 0x100dd467), TOBN(0x274a4337, 0x4ee50d09), + TOBN(0x603dcf13, 0x83608bc9), TOBN(0xcd9da6c3, 0xc89e8388)}}, + {{TOBN(0x2660199f, 0x355116ac), TOBN(0xcc38bb59, 0xb6d18eed), + TOBN(0x3075f31f, 0x2f4bc071), TOBN(0x9774457f, 0x265dc57e)}, + {TOBN(0x06a6a9c8, 0xc6db88bb), TOBN(0x6429d07f, 0x4ec98e04), + TOBN(0x8d05e57b, 0x05ecaa8b), TOBN(0x20f140b1, 0x7872ea7b)}}, + {{TOBN(0xdf8c0f09, 0xca494693), TOBN(0x48d3a020, 0xf252e909), + TOBN(0x4c5c29af, 0x57b14b12), TOBN(0x7e6fa37d, 0xbf47ad1c)}, + {TOBN(0x66e7b506, 0x49a0c938), TOBN(0xb72c0d48, 0x6be5f41f), + TOBN(0x6a6242b8, 0xb2359412), TOBN(0xcd35c774, 0x8e859480)}}, + {{TOBN(0x12536fea, 0x87baa627), TOBN(0x58c1fec1, 0xf72aa680), + TOBN(0x6c29b637, 0x601e5dc9), TOBN(0x9e3c3c1c, 0xde9e01b9)}, + {TOBN(0xefc8127b, 0x2bcfe0b0), TOBN(0x35107102, 0x2a12f50d), + TOBN(0x6ccd6cb1, 0x4879b397), TOBN(0xf792f804, 0xf8a82f21)}}, + {{TOBN(0x509d4804, 0xa9b46402), TOBN(0xedddf85d, 0xc10f0850), + TOBN(0x928410dc, 0x4b6208aa), TOBN(0xf6229c46, 0x391012dc)}, + {TOBN(0xc5a7c41e, 0x7727b9b6), TOBN(0x289e4e4b, 0xaa444842), + TOBN(0x049ba1d9, 0xe9a947ea), TOBN(0x44f9e47f, 0x83c8debc)}}, + {{TOBN(0xfa77a1fe, 0x611f8b8e), TOBN(0xfd2e416a, 0xf518f427), + TOBN(0xc5fffa70, 0x114ebac3), TOBN(0xfe57c4e9, 0x5d89697b)}, + {TOBN(0xfdd053ac, 0xb1aaf613), TOBN(0x31df210f, 0xea585a45), + TOBN(0x318cc10e, 0x24985034), TOBN(0x1a38efd1, 0x5f1d6130)}}, + {{TOBN(0xbf86f237, 0x0b1e9e21), TOBN(0xb258514d, 0x1dbe88aa), + TOBN(0x1e38a588, 0x90c1baf9), TOBN(0x2936a01e, 0xbdb9b692)}, + {TOBN(0xd576de98, 0x6dd5b20c), TOBN(0xb586bf71, 0x70f98ecf), + TOBN(0xcccf0f12, 0xc42d2fd7), TOBN(0x8717e61c, 0xfb35bd7b)}}, + {{TOBN(0x8b1e5722, 0x35e6fc06), TOBN(0x3477728f, 0x0b3e13d5), + TOBN(0x150c294d, 0xaa8a7372), TOBN(0xc0291d43, 0x3bfa528a)}, + {TOBN(0xc6c8bc67, 0xcec5a196), TOBN(0xdeeb31e4, 0x5c2e8a7c), + TOBN(0xba93e244, 0xfb6e1c51), TOBN(0xb9f8b71b, 0x2e28e156)}}, + {{TOBN(0xce65a287, 0x968a2ab9), TOBN(0xe3c5ce69, 0x46bbcb1f), + TOBN(0xf8c835b9, 0xe7ae3f30), TOBN(0x16bbee26, 0xff72b82b)}, + {TOBN(0x665e2017, 0xfd42cd22), TOBN(0x1e139970, 0xf8b1d2a0), + TOBN(0x125cda29, 0x79204932), TOBN(0x7aee94a5, 0x49c3bee5)}}, + {{TOBN(0x68c70160, 0x89821a66), TOBN(0xf7c37678, 0x8f981669), + TOBN(0xd90829fc, 0x48cc3645), TOBN(0x346af049, 0xd70addfc)}, + {TOBN(0x2057b232, 0x370bf29c), TOBN(0xf90c73ce, 0x42e650ee), + TOBN(0xe03386ea, 0xa126ab90), TOBN(0x0e266e7e, 0x975a087b)}}, + {{TOBN(0x80578eb9, 0x0fca65d9), TOBN(0x7e2989ea, 0x16af45b8), + TOBN(0x7438212d, 0xcac75a4e), TOBN(0x38c7ca39, 0x4fef36b8)}, + {TOBN(0x8650c494, 0xd402676a), TOBN(0x26ab5a66, 0xf72c7c48), + TOBN(0x4e6cb426, 0xce3a464e), TOBN(0xf8f99896, 0x2b72f841)}}, + {{TOBN(0x8c318491, 0x1a335cc8), TOBN(0x563459ba, 0x6a5913e4), + TOBN(0x1b920d61, 0xc7b32919), TOBN(0x805ab8b6, 0xa02425ad)}, + {TOBN(0x2ac512da, 0x8d006086), TOBN(0x6ca4846a, 0xbcf5c0fd), + TOBN(0xafea51d8, 0xac2138d7), TOBN(0xcb647545, 0x344cd443)}}, + {{TOBN(0x0429ee8f, 0xbd7d9040), TOBN(0xee66a2de, 0x819b9c96), + TOBN(0x54f9ec25, 0xdea7d744), TOBN(0x2ffea642, 0x671721bb)}, + {TOBN(0x4f19dbd1, 0x114344ea), TOBN(0x04304536, 0xfd0dbc8b), + TOBN(0x014b50aa, 0x29ec7f91), TOBN(0xb5fc22fe, 0xbb06014d)}}, + {{TOBN(0x60d963a9, 0x1ee682e0), TOBN(0xdf48abc0, 0xfe85c727), + TOBN(0x0cadba13, 0x2e707c2d), TOBN(0xde608d3a, 0xa645aeff)}, + {TOBN(0x05f1c28b, 0xedafd883), TOBN(0x3c362ede, 0xbd94de1f), + TOBN(0x8dd0629d, 0x13593e41), TOBN(0x0a5e736f, 0x766d6eaf)}}, + {{TOBN(0xbfa92311, 0xf68cf9d1), TOBN(0xa4f9ef87, 0xc1797556), + TOBN(0x10d75a1f, 0x5601c209), TOBN(0x651c374c, 0x09b07361)}, + {TOBN(0x49950b58, 0x88b5cead), TOBN(0x0ef00058, 0x6fa9dbaa), + TOBN(0xf51ddc26, 0x4e15f33a), TOBN(0x1f8b5ca6, 0x2ef46140)}}, + {{TOBN(0x343ac0a3, 0xee9523f0), TOBN(0xbb75eab2, 0x975ea978), + TOBN(0x1bccf332, 0x107387f4), TOBN(0x790f9259, 0x9ab0062e)}, + {TOBN(0xf1a363ad, 0x1e4f6a5f), TOBN(0x06e08b84, 0x62519a50), + TOBN(0x60915187, 0x7265f1ee), TOBN(0x6a80ca34, 0x93ae985e)}}, + {{TOBN(0x81b29768, 0xaaba4864), TOBN(0xb13cabf2, 0x8d52a7d6), + TOBN(0xb5c36348, 0x8ead03f1), TOBN(0xc932ad95, 0x81c7c1c0)}, + {TOBN(0x5452708e, 0xcae1e27b), TOBN(0x9dac4269, 0x1b0df648), + TOBN(0x233e3f0c, 0xdfcdb8bc), TOBN(0xe6ceccdf, 0xec540174)}}, + {{TOBN(0xbd0d845e, 0x95081181), TOBN(0xcc8a7920, 0x699355d5), + TOBN(0x111c0f6d, 0xc3b375a8), TOBN(0xfd95bc6b, 0xfd51e0dc)}, + {TOBN(0x4a106a26, 0x6888523a), TOBN(0x4d142bd6, 0xcb01a06d), + TOBN(0x79bfd289, 0xadb9b397), TOBN(0x0bdbfb94, 0xe9863914)}}, + {{TOBN(0x29d8a229, 0x1660f6a6), TOBN(0x7f6abcd6, 0x551c042d), + TOBN(0x13039deb, 0x0ac3ffe8), TOBN(0xa01be628, 0xec8523fb)}, + {TOBN(0x6ea34103, 0x0ca1c328), TOBN(0xc74114bd, 0xb903928e), + TOBN(0x8aa4ff4e, 0x9e9144b0), TOBN(0x7064091f, 0x7f9a4b17)}}, + {{TOBN(0xa3f4f521, 0xe447f2c4), TOBN(0x81b8da7a, 0x604291f0), + TOBN(0xd680bc46, 0x7d5926de), TOBN(0x84f21fd5, 0x34a1202f)}, + {TOBN(0x1d1e3181, 0x4e9df3d8), TOBN(0x1ca4861a, 0x39ab8d34), + TOBN(0x809ddeec, 0x5b19aa4a), TOBN(0x59f72f7e, 0x4d329366)}}, + {{TOBN(0xa2f93f41, 0x386d5087), TOBN(0x40bf739c, 0xdd67d64f), + TOBN(0xb4494205, 0x66702158), TOBN(0xc33c65be, 0x73b1e178)}, + {TOBN(0xcdcd657c, 0x38ca6153), TOBN(0x97f4519a, 0xdc791976), + TOBN(0xcc7c7f29, 0xcd6e1f39), TOBN(0x38de9cfb, 0x7e3c3932)}}, + {{TOBN(0xe448eba3, 0x7b793f85), TOBN(0xe9f8dbf9, 0xf067e914), + TOBN(0xc0390266, 0xf114ae87), TOBN(0x39ed75a7, 0xcd6a8e2a)}, + {TOBN(0xadb14848, 0x7ffba390), TOBN(0x67f8cb8b, 0x6af9bc09), + TOBN(0x322c3848, 0x9c7476db), TOBN(0xa320fecf, 0x52a538d6)}}, + {{TOBN(0xe0493002, 0xb2aced2b), TOBN(0xdfba1809, 0x616bd430), + TOBN(0x531c4644, 0xc331be70), TOBN(0xbc04d32e, 0x90d2e450)}, + {TOBN(0x1805a0d1, 0x0f9f142d), TOBN(0x2c44a0c5, 0x47ee5a23), + TOBN(0x31875a43, 0x3989b4e3), TOBN(0x6b1949fd, 0x0c063481)}}, + {{TOBN(0x2dfb9e08, 0xbe0f4492), TOBN(0x3ff0da03, 0xe9d5e517), + TOBN(0x03dbe9a1, 0xf79466a8), TOBN(0x0b87bcd0, 0x15ea9932)}, + {TOBN(0xeb64fc83, 0xab1f58ab), TOBN(0x6d9598da, 0x817edc8a), + TOBN(0x699cff66, 0x1d3b67e5), TOBN(0x645c0f29, 0x92635853)}}, + {{TOBN(0x253cdd82, 0xeabaf21c), TOBN(0x82b9602a, 0x2241659e), + TOBN(0x2cae07ec, 0x2d9f7091), TOBN(0xbe4c720c, 0x8b48cd9b)}, + {TOBN(0x6ce5bc03, 0x6f08d6c9), TOBN(0x36e8a997, 0xaf10bf40), + TOBN(0x83422d21, 0x3e10ff12), TOBN(0x7b26d3eb, 0xbcc12494)}}, + {{TOBN(0xb240d2d0, 0xc9469ad6), TOBN(0xc4a11b4d, 0x30afa05b), + TOBN(0x4b604ace, 0xdd6ba286), TOBN(0x18486600, 0x3ee2864c)}, + {TOBN(0x5869d6ba, 0x8d9ce5be), TOBN(0x0d8f68c5, 0xff4bfb0d), + TOBN(0xb69f210b, 0x5700cf73), TOBN(0x61f6653a, 0x6d37c135)}}, + {{TOBN(0xff3d432b, 0x5aff5a48), TOBN(0x0d81c4b9, 0x72ba3a69), + TOBN(0xee879ae9, 0xfa1899ef), TOBN(0xbac7e2a0, 0x2d6acafd)}, + {TOBN(0xd6d93f6c, 0x1c664399), TOBN(0x4c288de1, 0x5bcb135d), + TOBN(0x83031dab, 0x9dab7cbf), TOBN(0xfe23feb0, 0x3abbf5f0)}}, + {{TOBN(0x9f1b2466, 0xcdedca85), TOBN(0x140bb710, 0x1a09538c), + TOBN(0xac8ae851, 0x5e11115d), TOBN(0x0d63ff67, 0x6f03f59e)}, + {TOBN(0x755e5551, 0x7d234afb), TOBN(0x61c2db4e, 0x7e208fc1), + TOBN(0xaa9859ce, 0xf28a4b5d), TOBN(0xbdd6d4fc, 0x34af030f)}}, + {{TOBN(0xd1c4a26d, 0x3be01cb1), TOBN(0x9ba14ffc, 0x243aa07c), + TOBN(0xf95cd3a9, 0xb2503502), TOBN(0xe379bc06, 0x7d2a93ab)}, + {TOBN(0x3efc18e9, 0xd4ca8d68), TOBN(0x083558ec, 0x80bb412a), + TOBN(0xd903b940, 0x9645a968), TOBN(0xa499f0b6, 0x9ba6054f)}}, + {{TOBN(0x208b573c, 0xb8349abe), TOBN(0x3baab3e5, 0x30b4fc1c), + TOBN(0x87e978ba, 0xcb524990), TOBN(0x3524194e, 0xccdf0e80)}, + {TOBN(0x62711725, 0x7d4bcc42), TOBN(0xe90a3d9b, 0xb90109ba), + TOBN(0x3b1bdd57, 0x1323e1e0), TOBN(0xb78e9bd5, 0x5eae1599)}}, + {{TOBN(0x0794b746, 0x9e03d278), TOBN(0x80178605, 0xd70e6297), + TOBN(0x171792f8, 0x99c97855), TOBN(0x11b393ee, 0xf5a86b5c)}, + {TOBN(0x48ef6582, 0xd8884f27), TOBN(0xbd44737a, 0xbf19ba5f), + TOBN(0x8698de4c, 0xa42062c6), TOBN(0x8975eb80, 0x61ce9c54)}}, + {{TOBN(0xd50e57c7, 0xd7fe71f3), TOBN(0x15342190, 0xbc97ce38), + TOBN(0x51bda2de, 0x4df07b63), TOBN(0xba12aeae, 0x200eb87d)}, + {TOBN(0xabe135d2, 0xa9b4f8f6), TOBN(0x04619d65, 0xfad6d99c), + TOBN(0x4a6683a7, 0x7994937c), TOBN(0x7a778c8b, 0x6f94f09a)}}, + {{TOBN(0x8c508623, 0x20a71b89), TOBN(0x241a2aed, 0x1c229165), + TOBN(0x352be595, 0xaaf83a99), TOBN(0x9fbfee7f, 0x1562bac8)}, + {TOBN(0xeaf658b9, 0x5c4017e3), TOBN(0x1dc7f9e0, 0x15120b86), + TOBN(0xd84f13dd, 0x4c034d6f), TOBN(0x283dd737, 0xeaea3038)}}, + {{TOBN(0x197f2609, 0xcd85d6a2), TOBN(0x6ebbc345, 0xfae60177), + TOBN(0xb80f031b, 0x4e12fede), TOBN(0xde55d0c2, 0x07a2186b)}, + {TOBN(0x1fb3e37f, 0x24dcdd5a), TOBN(0x8d602da5, 0x7ed191fb), + TOBN(0x108fb056, 0x76023e0d), TOBN(0x70178c71, 0x459c20c0)}}, + {{TOBN(0xfad5a386, 0x3fe54cf0), TOBN(0xa4a3ec4f, 0x02bbb475), + TOBN(0x1aa5ec20, 0x919d94d7), TOBN(0x5d3b63b5, 0xa81e4ab3)}, + {TOBN(0x7fa733d8, 0x5ad3d2af), TOBN(0xfbc586dd, 0xd1ac7a37), + TOBN(0x282925de, 0x40779614), TOBN(0xfe0ffffb, 0xe74a242a)}}, + {{TOBN(0x3f39e67f, 0x906151e5), TOBN(0xcea27f5f, 0x55e10649), + TOBN(0xdca1d4e1, 0xc17cf7b7), TOBN(0x0c326d12, 0x2fe2362d)}, + {TOBN(0x05f7ac33, 0x7dd35df3), TOBN(0x0c3b7639, 0xc396dbdf), + TOBN(0x0912f5ac, 0x03b7db1c), TOBN(0x9dea4b70, 0x5c9ed4a9)}}, + {{TOBN(0x475e6e53, 0xaae3f639), TOBN(0xfaba0e7c, 0xfc278bac), + TOBN(0x16f9e221, 0x9490375f), TOBN(0xaebf9746, 0xa5a7ed0a)}, + {TOBN(0x45f9af3f, 0xf41ad5d6), TOBN(0x03c4623c, 0xb2e99224), + TOBN(0x82c5bb5c, 0xb3cf56aa), TOBN(0x64311819, 0x34567ed3)}}, + {{TOBN(0xec57f211, 0x8be489ac), TOBN(0x2821895d, 0xb9a1104b), + TOBN(0x610dc875, 0x6064e007), TOBN(0x8e526f3f, 0x5b20d0fe)}, + {TOBN(0x6e71ca77, 0x5b645aee), TOBN(0x3d1dcb9f, 0x800e10ff), + TOBN(0x36b51162, 0x189cf6de), TOBN(0x2c5a3e30, 0x6bb17353)}}, + {{TOBN(0xc186cd3e, 0x2a6c6fbf), TOBN(0xa74516fa, 0x4bf97906), + TOBN(0x5b4b8f4b, 0x279d6901), TOBN(0x0c4e57b4, 0x2b573743)}, + {TOBN(0x75fdb229, 0xb6e386b6), TOBN(0xb46793fd, 0x99deac27), + TOBN(0xeeec47ea, 0xcf712629), TOBN(0xe965f3c4, 0xcbc3b2dd)}}, + {{TOBN(0x8dd1fb83, 0x425c6559), TOBN(0x7fc00ee6, 0x0af06fda), + TOBN(0xe98c9225, 0x33d956df), TOBN(0x0f1ef335, 0x4fbdc8a2)}, + {TOBN(0x2abb5145, 0xb79b8ea2), TOBN(0x40fd2945, 0xbdbff288), + TOBN(0x6a814ac4, 0xd7185db7), TOBN(0xc4329d6f, 0xc084609a)}}, + {{TOBN(0xc9ba7b52, 0xed1be45d), TOBN(0x891dd20d, 0xe4cd2c74), + TOBN(0x5a4d4a7f, 0x824139b1), TOBN(0x66c17716, 0xb873c710)}, + {TOBN(0x5e5bc141, 0x2843c4e0), TOBN(0xd5ac4817, 0xb97eb5bf), + TOBN(0xc0f8af54, 0x450c95c7), TOBN(0xc91b3fa0, 0x318406c5)}}, + {{TOBN(0x360c340a, 0xab9d97f8), TOBN(0xfb57bd07, 0x90a2d611), + TOBN(0x4339ae3c, 0xa6a6f7e5), TOBN(0x9c1fcd2a, 0x2feb8a10)}, + {TOBN(0x972bcca9, 0xc7ea7432), TOBN(0x1b0b924c, 0x308076f6), + TOBN(0x80b2814a, 0x2a5b4ca5), TOBN(0x2f78f55b, 0x61ef3b29)}}, + {{TOBN(0xf838744a, 0xc18a414f), TOBN(0xc611eaae, 0x903d0a86), + TOBN(0x94dabc16, 0x2a453f55), TOBN(0xe6f2e3da, 0x14efb279)}, + {TOBN(0x5b7a6017, 0x9320dc3c), TOBN(0x692e382f, 0x8df6b5a4), + TOBN(0x3f5e15e0, 0x2d40fa90), TOBN(0xc87883ae, 0x643dd318)}}, + {{TOBN(0x511053e4, 0x53544774), TOBN(0x834d0ecc, 0x3adba2bc), + TOBN(0x4215d7f7, 0xbae371f5), TOBN(0xfcfd57bf, 0x6c8663bc)}, + {TOBN(0xded2383d, 0xd6901b1d), TOBN(0x3b49fbb4, 0xb5587dc3), + TOBN(0xfd44a08d, 0x07625f62), TOBN(0x3ee4d65b, 0x9de9b762)}}}, + {{{TOBN(0x64e5137d, 0x0d63d1fa), TOBN(0x658fc052, 0x02a9d89f), + TOBN(0x48894874, 0x50436309), TOBN(0xe9ae30f8, 0xd598da61)}, + {TOBN(0x2ed710d1, 0x818baf91), TOBN(0xe27e9e06, 0x8b6a0c20), + TOBN(0x1e28dcfb, 0x1c1a6b44), TOBN(0x883acb64, 0xd6ac57dc)}}, + {{TOBN(0x8735728d, 0xc2c6ff70), TOBN(0x79d6122f, 0xc5dc2235), + TOBN(0x23f5d003, 0x19e277f9), TOBN(0x7ee84e25, 0xdded8cc7)}, + {TOBN(0x91a8afb0, 0x63cd880a), TOBN(0x3f3ea7c6, 0x3574af60), + TOBN(0x0cfcdc84, 0x02de7f42), TOBN(0x62d0792f, 0xb31aa152)}}, + {{TOBN(0x8e1b4e43, 0x8a5807ce), TOBN(0xad283893, 0xe4109a7e), + TOBN(0xc30cc9cb, 0xafd59dda), TOBN(0xf65f36c6, 0x3d8d8093)}, + {TOBN(0xdf31469e, 0xa60d32b2), TOBN(0xee93df4b, 0x3e8191c8), + TOBN(0x9c1017c5, 0x355bdeb5), TOBN(0xd2623185, 0x8616aa28)}}, + {{TOBN(0xb02c83f9, 0xdec31a21), TOBN(0x988c8b23, 0x6ad9d573), + TOBN(0x53e983ae, 0xa57be365), TOBN(0xe968734d, 0x646f834e)}, + {TOBN(0x9137ea8f, 0x5da6309b), TOBN(0x10f3a624, 0xc1f1ce16), + TOBN(0x782a9ea2, 0xca440921), TOBN(0xdf94739e, 0x5b46f1b5)}}, + {{TOBN(0x9f9be006, 0xcce85c9b), TOBN(0x360e70d6, 0xa4c7c2d3), + TOBN(0x2cd5beea, 0xaefa1e60), TOBN(0x64cf63c0, 0x8c3d2b6d)}, + {TOBN(0xfb107fa3, 0xe1cf6f90), TOBN(0xb7e937c6, 0xd5e044e6), + TOBN(0x74e8ca78, 0xce34db9f), TOBN(0x4f8b36c1, 0x3e210bd0)}}, + {{TOBN(0x1df165a4, 0x34a35ea8), TOBN(0x3418e0f7, 0x4d4412f6), + TOBN(0x5af1f8af, 0x518836c3), TOBN(0x42ceef4d, 0x130e1965)}, + {TOBN(0x5560ca0b, 0x543a1957), TOBN(0xc33761e5, 0x886cb123), + TOBN(0x66624b1f, 0xfe98ed30), TOBN(0xf772f4bf, 0x1090997d)}}, + {{TOBN(0xf4e540bb, 0x4885d410), TOBN(0x7287f810, 0x9ba5f8d7), + TOBN(0x22d0d865, 0xde98dfb1), TOBN(0x49ff51a1, 0xbcfbb8a3)}, + {TOBN(0xb6b6fa53, 0x6bc3012e), TOBN(0x3d31fd72, 0x170d541d), + TOBN(0x8018724f, 0x4b0f4966), TOBN(0x79e7399f, 0x87dbde07)}}, + {{TOBN(0x56f8410e, 0xf4f8b16a), TOBN(0x97241afe, 0xc47b266a), + TOBN(0x0a406b8e, 0x6d9c87c1), TOBN(0x803f3e02, 0xcd42ab1b)}, + {TOBN(0x7f0309a8, 0x04dbec69), TOBN(0xa83b85f7, 0x3bbad05f), + TOBN(0xc6097273, 0xad8e197f), TOBN(0xc097440e, 0x5067adc1)}}, + {{TOBN(0x730eafb6, 0x3524ff16), TOBN(0xd7f9b51e, 0x823fc6ce), + TOBN(0x27bd0d32, 0x443e4ac0), TOBN(0x40c59ad9, 0x4d66f217)}, + {TOBN(0x6c33136f, 0x17c387a4), TOBN(0x5043b8d5, 0xeb86804d), + TOBN(0x74970312, 0x675a73c9), TOBN(0x838fdb31, 0xf16669b6)}}, + {{TOBN(0xc507b6dd, 0x418e7ddd), TOBN(0x39888d93, 0x472f19d6), + TOBN(0x7eae26be, 0x0c27eb4d), TOBN(0x17b53ed3, 0xfbabb884)}, + {TOBN(0xfc27021b, 0x2b01ae4f), TOBN(0x88462e87, 0xcf488682), + TOBN(0xbee096ec, 0x215e2d87), TOBN(0xeb2fea9a, 0xd242e29b)}}, + {{TOBN(0x5d985b5f, 0xb821fc28), TOBN(0x89d2e197, 0xdc1e2ad2), + TOBN(0x55b566b8, 0x9030ba62), TOBN(0xe3fd41b5, 0x4f41b1c6)}, + {TOBN(0xb738ac2e, 0xb9a96d61), TOBN(0x7f8567ca, 0x369443f4), + TOBN(0x8698622d, 0xf803a440), TOBN(0x2b586236, 0x8fe2f4dc)}}, + {{TOBN(0xbbcc00c7, 0x56b95bce), TOBN(0x5ec03906, 0x616da680), + TOBN(0x79162ee6, 0x72214252), TOBN(0x43132b63, 0x86a892d2)}, + {TOBN(0x4bdd3ff2, 0x2f3263bf), TOBN(0xd5b3733c, 0x9cd0a142), + TOBN(0x592eaa82, 0x44415ccb), TOBN(0x663e8924, 0x8d5474ea)}}, + {{TOBN(0x8058a25e, 0x5236344e), TOBN(0x82e8df9d, 0xbda76ee6), + TOBN(0xdcf6efd8, 0x11cc3d22), TOBN(0x00089cda, 0x3b4ab529)}, + {TOBN(0x91d3a071, 0xbd38a3db), TOBN(0x4ea97fc0, 0xef72b925), + TOBN(0x0c9fc15b, 0xea3edf75), TOBN(0x5a6297cd, 0xa4348ed3)}}, + {{TOBN(0x0d38ab35, 0xce7c42d4), TOBN(0x9fd493ef, 0x82feab10), + TOBN(0x46056b6d, 0x82111b45), TOBN(0xda11dae1, 0x73efc5c3)}, + {TOBN(0xdc740278, 0x5545a7fb), TOBN(0xbdb2601c, 0x40d507e6), + TOBN(0x121dfeeb, 0x7066fa58), TOBN(0x214369a8, 0x39ae8c2a)}}, + {{TOBN(0x195709cb, 0x06e0956c), TOBN(0x4c9d254f, 0x010cd34b), + TOBN(0xf51e13f7, 0x0471a532), TOBN(0xe19d6791, 0x1e73054d)}, + {TOBN(0xf702a628, 0xdb5c7be3), TOBN(0xc7141218, 0xb24dde05), + TOBN(0xdc18233c, 0xf29b2e2e), TOBN(0x3a6bd1e8, 0x85342dba)}}, + {{TOBN(0x3f747fa0, 0xb311898c), TOBN(0xe2a272e4, 0xcd0eac65), + TOBN(0x4bba5851, 0xf914d0bc), TOBN(0x7a1a9660, 0xc4a43ee3)}, + {TOBN(0xe5a367ce, 0xa1c8cde9), TOBN(0x9d958ba9, 0x7271abe3), + TOBN(0xf3ff7eb6, 0x3d1615cd), TOBN(0xa2280dce, 0xf5ae20b0)}}, + {{TOBN(0x56dba5c1, 0xcf640147), TOBN(0xea5a2e3d, 0x5e83d118), + TOBN(0x04cd6b6d, 0xda24c511), TOBN(0x1c0f4671, 0xe854d214)}, + {TOBN(0x91a6b7a9, 0x69565381), TOBN(0xdc966240, 0xdecf1f5b), + TOBN(0x1b22d21c, 0xfcf5d009), TOBN(0x2a05f641, 0x9021dbd5)}}, + {{TOBN(0x8c0ed566, 0xd4312483), TOBN(0x5179a95d, 0x643e216f), + TOBN(0xcc185fec, 0x17044493), TOBN(0xb3063339, 0x54991a21)}, + {TOBN(0xd801ecdb, 0x0081a726), TOBN(0x0149b0c6, 0x4fa89bbb), + TOBN(0xafe9065a, 0x4391b6b9), TOBN(0xedc92786, 0xd633f3a3)}}, + {{TOBN(0xe408c24a, 0xae6a8e13), TOBN(0x85833fde, 0x9f3897ab), + TOBN(0x43800e7e, 0xd81a0715), TOBN(0xde08e346, 0xb44ffc5f)}, + {TOBN(0x7094184c, 0xcdeff2e0), TOBN(0x49f9387b, 0x165eaed1), + TOBN(0x635d6129, 0x777c468a), TOBN(0x8c0dcfd1, 0x538c2dd8)}}, + {{TOBN(0xd6d9d9e3, 0x7a6a308b), TOBN(0x62375830, 0x4c2767d3), + TOBN(0x874a8bc6, 0xf38cbeb6), TOBN(0xd94d3f1a, 0xccb6fd9e)}, + {TOBN(0x92a9735b, 0xba21f248), TOBN(0x272ad0e5, 0x6cd1efb0), + TOBN(0x7437b69c, 0x05b03284), TOBN(0xe7f04702, 0x6948c225)}}, + {{TOBN(0x8a56c04a, 0xcba2ecec), TOBN(0x0c181270, 0xe3a73e41), + TOBN(0x6cb34e9d, 0x03e93725), TOBN(0xf77c8713, 0x496521a9)}, + {TOBN(0x94569183, 0xfa7f9f90), TOBN(0xf2e7aa4c, 0x8c9707ad), + TOBN(0xced2c9ba, 0x26c1c9a3), TOBN(0x9109fe96, 0x40197507)}}, + {{TOBN(0x9ae868a9, 0xe9adfe1c), TOBN(0x3984403d, 0x314e39bb), + TOBN(0xb5875720, 0xf2fe378f), TOBN(0x33f901e0, 0xba44a628)}, + {TOBN(0xea1125fe, 0x3652438c), TOBN(0xae9ec4e6, 0x9dd1f20b), + TOBN(0x1e740d9e, 0xbebf7fbd), TOBN(0x6dbd3ddc, 0x42dbe79c)}}, + {{TOBN(0x62082aec, 0xedd36776), TOBN(0xf612c478, 0xe9859039), + TOBN(0xa493b201, 0x032f7065), TOBN(0xebd4d8f2, 0x4ff9b211)}, + {TOBN(0x3f23a0aa, 0xaac4cb32), TOBN(0xea3aadb7, 0x15ed4005), + TOBN(0xacf17ea4, 0xafa27e63), TOBN(0x56125c1a, 0xc11fd66c)}}, + {{TOBN(0x266344a4, 0x3794f8dc), TOBN(0xdcca923a, 0x483c5c36), + TOBN(0x2d6b6bbf, 0x3f9d10a0), TOBN(0xb320c5ca, 0x81d9bdf3)}, + {TOBN(0x620e28ff, 0x47b50a95), TOBN(0x933e3b01, 0xcef03371), + TOBN(0xf081bf85, 0x99100153), TOBN(0x183be9a0, 0xc3a8c8d6)}}, + {{TOBN(0x4e3ddc5a, 0xd6bbe24d), TOBN(0xc6c74630, 0x53843795), + TOBN(0x78193dd7, 0x65ec2d4c), TOBN(0xb8df26cc, 0xcd3c89b2)}, + {TOBN(0x98dbe399, 0x5a483f8d), TOBN(0x72d8a957, 0x7dd3313a), + TOBN(0x65087294, 0xab0bd375), TOBN(0xfcd89248, 0x7c259d16)}}, + {{TOBN(0x8a9443d7, 0x7613aa81), TOBN(0x80100800, 0x85fe6584), + TOBN(0x70fc4dbc, 0x7fb10288), TOBN(0xf58280d3, 0xe86beee8)}, + {TOBN(0x14fdd82f, 0x7c978c38), TOBN(0xdf1204c1, 0x0de44d7b), + TOBN(0xa08a1c84, 0x4160252f), TOBN(0x591554ca, 0xc17646a5)}}, + {{TOBN(0x214a37d6, 0xa05bd525), TOBN(0x48d5f09b, 0x07957b3c), + TOBN(0x0247cdcb, 0xd7109bc9), TOBN(0x40f9e4bb, 0x30599ce7)}, + {TOBN(0xc325fa03, 0xf46ad2ec), TOBN(0x00f766cf, 0xc3e3f9ee), + TOBN(0xab556668, 0xd43a4577), TOBN(0x68d30a61, 0x3ee03b93)}}, + {{TOBN(0x7ddc81ea, 0x77b46a08), TOBN(0xcf5a6477, 0xc7480699), + TOBN(0x43a8cb34, 0x6633f683), TOBN(0x1b867e6b, 0x92363c60)}, + {TOBN(0x43921114, 0x1f60558e), TOBN(0xcdbcdd63, 0x2f41450e), + TOBN(0x7fc04601, 0xcc630e8b), TOBN(0xea7c66d5, 0x97038b43)}}, + {{TOBN(0x7259b8a5, 0x04e99fd8), TOBN(0x98a8dd12, 0x4785549a), + TOBN(0x0e459a7c, 0x840552e1), TOBN(0xcdfcf4d0, 0x4bb0909e)}, + {TOBN(0x34a86db2, 0x53758da7), TOBN(0xe643bb83, 0xeac997e1), + TOBN(0x96400bd7, 0x530c5b7e), TOBN(0x9f97af87, 0xb41c8b52)}}, + {{TOBN(0x34fc8820, 0xfbeee3f9), TOBN(0x93e53490, 0x49091afd), + TOBN(0x764b9be5, 0x9a31f35c), TOBN(0x71f37864, 0x57e3d924)}, + {TOBN(0x02fb34e0, 0x943aa75e), TOBN(0xa18c9c58, 0xab8ff6e4), + TOBN(0x080f31b1, 0x33cf0d19), TOBN(0x5c9682db, 0x083518a7)}}, + {{TOBN(0x873d4ca6, 0xb709c3de), TOBN(0x64a84262, 0x3575b8f0), + TOBN(0x6275da1f, 0x020154bb), TOBN(0x97678caa, 0xd17cf1ab)}, + {TOBN(0x8779795f, 0x951a95c3), TOBN(0xdd35b163, 0x50fccc08), + TOBN(0x32709627, 0x33d8f031), TOBN(0x3c5ab10a, 0x498dd85c)}}, + {{TOBN(0xb6c185c3, 0x41dca566), TOBN(0x7de7feda, 0xd8622aa3), + TOBN(0x99e84d92, 0x901b6dfb), TOBN(0x30a02b0e, 0x7c4ad288)}, + {TOBN(0xc7c81daa, 0x2fd3cf36), TOBN(0xd1319547, 0xdf89e59f), + TOBN(0xb2be8184, 0xcd496733), TOBN(0xd5f449eb, 0x93d3412b)}}, + {{TOBN(0x7ea41b1b, 0x25fe531d), TOBN(0xf9797432, 0x6a1d5646), + TOBN(0x86067f72, 0x2bde501a), TOBN(0xf91481c0, 0x0c85e89c)}, + {TOBN(0xca8ee465, 0xf8b05bc6), TOBN(0x1844e1cf, 0x02e83cda), + TOBN(0xca82114a, 0xb4dbe33b), TOBN(0x0f9f8769, 0x4eabfde2)}}, + {{TOBN(0x4936b1c0, 0x38b27fe2), TOBN(0x63b6359b, 0xaba402df), + TOBN(0x40c0ea2f, 0x656bdbab), TOBN(0x9c992a89, 0x6580c39c)}, + {TOBN(0x600e8f15, 0x2a60aed1), TOBN(0xeb089ca4, 0xe0bf49df), + TOBN(0x9c233d7d, 0x2d42d99a), TOBN(0x648d3f95, 0x4c6bc2fa)}}, + {{TOBN(0xdcc383a8, 0xe1add3f3), TOBN(0xf42c0c6a, 0x4f64a348), + TOBN(0x2abd176f, 0x0030dbdb), TOBN(0x4de501a3, 0x7d6c215e)}, + {TOBN(0x4a107c1f, 0x4b9a64bc), TOBN(0xa77f0ad3, 0x2496cd59), + TOBN(0xfb78ac62, 0x7688dffb), TOBN(0x7025a2ca, 0x67937d8e)}}, + {{TOBN(0xfde8b2d1, 0xd1a8f4e7), TOBN(0xf5b3da47, 0x7354927c), + TOBN(0xe48606a3, 0xd9205735), TOBN(0xac477cc6, 0xe177b917)}, + {TOBN(0xfb1f73d2, 0xa883239a), TOBN(0xe12572f6, 0xcc8b8357), + TOBN(0x9d355e9c, 0xfb1f4f86), TOBN(0x89b795f8, 0xd9f3ec6e)}}, + {{TOBN(0x27be56f1, 0xb54398dc), TOBN(0x1890efd7, 0x3fedeed5), + TOBN(0x62f77f1f, 0x9c6d0140), TOBN(0x7ef0e314, 0x596f0ee4)}, + {TOBN(0x50ca6631, 0xcc61dab3), TOBN(0x4a39801d, 0xf4866e4f), + TOBN(0x66c8d032, 0xae363b39), TOBN(0x22c591e5, 0x2ead66aa)}}, + {{TOBN(0x954ba308, 0xde02a53e), TOBN(0x2a6c060f, 0xd389f357), + TOBN(0xe6cfcde8, 0xfbf40b66), TOBN(0x8e02fc56, 0xc6340ce1)}, + {TOBN(0xe4957795, 0x73adb4ba), TOBN(0x7b86122c, 0xa7b03805), + TOBN(0x63f83512, 0x0c8e6fa6), TOBN(0x83660ea0, 0x057d7804)}}, + {{TOBN(0xbad79105, 0x21ba473c), TOBN(0xb6c50bee, 0xded5389d), + TOBN(0xee2caf4d, 0xaa7c9bc0), TOBN(0xd97b8de4, 0x8c4e98a7)}, + {TOBN(0xa9f63e70, 0xab3bbddb), TOBN(0x3898aabf, 0x2597815a), + TOBN(0x7659af89, 0xac15b3d9), TOBN(0xedf7725b, 0x703ce784)}}, + {{TOBN(0x25470fab, 0xe085116b), TOBN(0x04a43375, 0x87285310), + TOBN(0x4e39187e, 0xe2bfd52f), TOBN(0x36166b44, 0x7d9ebc74)}, + {TOBN(0x92ad433c, 0xfd4b322c), TOBN(0x726aa817, 0xba79ab51), + TOBN(0xf96eacd8, 0xc1db15eb), TOBN(0xfaf71e91, 0x0476be63)}}, + {{TOBN(0xdd69a640, 0x641fad98), TOBN(0xb7995918, 0x29622559), + TOBN(0x03c6daa5, 0xde4199dc), TOBN(0x92cadc97, 0xad545eb4)}, + {TOBN(0x1028238b, 0x256534e4), TOBN(0x73e80ce6, 0x8595409a), + TOBN(0x690d4c66, 0xd05dc59b), TOBN(0xc95f7b8f, 0x981dee80)}}, + {{TOBN(0xf4337014, 0xd856ac25), TOBN(0x441bd9dd, 0xac524dca), + TOBN(0x640b3d85, 0x5f0499f5), TOBN(0x39cf84a9, 0xd5fda182)}, + {TOBN(0x04e7b055, 0xb2aa95a0), TOBN(0x29e33f0a, 0x0ddf1860), + TOBN(0x082e74b5, 0x423f6b43), TOBN(0x217edeb9, 0x0aaa2b0f)}}, + {{TOBN(0x58b83f35, 0x83cbea55), TOBN(0xc485ee4d, 0xbc185d70), + TOBN(0x833ff03b, 0x1e5f6992), TOBN(0xb5b9b9cc, 0xcf0c0dd5)}, + {TOBN(0x7caaee8e, 0x4e9e8a50), TOBN(0x462e907b, 0x6269dafd), + TOBN(0x6ed5cee9, 0xfbe791c6), TOBN(0x68ca3259, 0xed430790)}}, + {{TOBN(0x2b72bdf2, 0x13b5ba88), TOBN(0x60294c8a, 0x35ef0ac4), + TOBN(0x9c3230ed, 0x19b99b08), TOBN(0x560fff17, 0x6c2589aa)}, + {TOBN(0x552b8487, 0xd6770374), TOBN(0xa373202d, 0x9a56f685), + TOBN(0xd3e7f907, 0x45f175d9), TOBN(0x3c2f315f, 0xd080d810)}}, + {{TOBN(0x1130e9dd, 0x7b9520e8), TOBN(0xc078f9e2, 0x0af037b5), + TOBN(0x38cd2ec7, 0x1e9c104c), TOBN(0x0f684368, 0xc472fe92)}, + {TOBN(0xd3f1b5ed, 0x6247e7ef), TOBN(0xb32d33a9, 0x396dfe21), + TOBN(0x46f59cf4, 0x4a9aa2c2), TOBN(0x69cd5168, 0xff0f7e41)}}, + {{TOBN(0x3f59da0f, 0x4b3234da), TOBN(0xcf0b0235, 0xb4579ebe), + TOBN(0x6d1cbb25, 0x6d2476c7), TOBN(0x4f0837e6, 0x9dc30f08)}, + {TOBN(0x9a4075bb, 0x906f6e98), TOBN(0x253bb434, 0xc761e7d1), + TOBN(0xde2e645f, 0x6e73af10), TOBN(0xb89a4060, 0x0c5f131c)}}, + {{TOBN(0xd12840c5, 0xb8cc037f), TOBN(0x3d093a5b, 0x7405bb47), + TOBN(0x6202c253, 0x206348b8), TOBN(0xbf5d57fc, 0xc55a3ca7)}, + {TOBN(0x89f6c90c, 0x8c3bef48), TOBN(0x23ac7623, 0x5a0a960a), + TOBN(0xdfbd3d6b, 0x552b42ab), TOBN(0x3ef22458, 0x132061f6)}}, + {{TOBN(0xd74e9bda, 0xc97e6516), TOBN(0x88779360, 0xc230f49e), + TOBN(0xa6ec1de3, 0x1e74ea49), TOBN(0x581dcee5, 0x3fb645a2)}, + {TOBN(0xbaef2391, 0x8f483f14), TOBN(0x6d2dddfc, 0xd137d13b), + TOBN(0x54cde50e, 0xd2743a42), TOBN(0x89a34fc5, 0xe4d97e67)}}, + {{TOBN(0x13f1f5b3, 0x12e08ce5), TOBN(0xa80540b8, 0xa7f0b2ca), + TOBN(0x854bcf77, 0x01982805), TOBN(0xb8653ffd, 0x233bea04)}, + {TOBN(0x8e7b8787, 0x02b0b4c9), TOBN(0x2675261f, 0x9acb170a), + TOBN(0x061a9d90, 0x930c14e5), TOBN(0xb59b30e0, 0xdef0abea)}}, + {{TOBN(0x1dc19ea6, 0x0200ec7d), TOBN(0xb6f4a3f9, 0x0bce132b), + TOBN(0xb8d5de90, 0xf13e27e0), TOBN(0xbaee5ef0, 0x1fade16f)}, + {TOBN(0x6f406aaa, 0xe4c6cf38), TOBN(0xab4cfe06, 0xd1369815), + TOBN(0x0dcffe87, 0xefd550c6), TOBN(0x9d4f59c7, 0x75ff7d39)}}, + {{TOBN(0xb02553b1, 0x51deb6ad), TOBN(0x812399a4, 0xb1877749), + TOBN(0xce90f71f, 0xca6006e1), TOBN(0xc32363a6, 0xb02b6e77)}, + {TOBN(0x02284fbe, 0xdc36c64d), TOBN(0x86c81e31, 0xa7e1ae61), + TOBN(0x2576c7e5, 0xb909d94a), TOBN(0x8b6f7d02, 0x818b2bb0)}}, + {{TOBN(0xeca3ed07, 0x56faa38a), TOBN(0xa3790e6c, 0x9305bb54), + TOBN(0xd784eeda, 0x7bc73061), TOBN(0xbd56d369, 0x6dd50614)}, + {TOBN(0xd6575949, 0x229a8aa9), TOBN(0xdcca8f47, 0x4595ec28), + TOBN(0x814305c1, 0x06ab4fe6), TOBN(0xc8c39768, 0x24f43f16)}}, + {{TOBN(0xe2a45f36, 0x523f2b36), TOBN(0x995c6493, 0x920d93bb), + TOBN(0xf8afdab7, 0x90f1632b), TOBN(0x79ebbecd, 0x1c295954)}, + {TOBN(0xc7bb3ddb, 0x79592f48), TOBN(0x67216a7b, 0x5f88e998), + TOBN(0xd91f098b, 0xbc01193e), TOBN(0xf7d928a5, 0xb1db83fc)}}, + {{TOBN(0x55e38417, 0xe991f600), TOBN(0x2a91113e, 0x2981a934), + TOBN(0xcbc9d648, 0x06b13bde), TOBN(0xb011b6ac, 0x0755ff44)}, + {TOBN(0x6f4cb518, 0x045ec613), TOBN(0x522d2d31, 0xc2f5930a), + TOBN(0x5acae1af, 0x382e65de), TOBN(0x57643067, 0x27bc966f)}}, + {{TOBN(0x5e12705d, 0x1c7193f0), TOBN(0xf0f32f47, 0x3be8858e), + TOBN(0x785c3d7d, 0x96c6dfc7), TOBN(0xd75b4a20, 0xbf31795d)}, + {TOBN(0x91acf17b, 0x342659d4), TOBN(0xe596ea34, 0x44f0378f), + TOBN(0x4515708f, 0xce52129d), TOBN(0x17387e1e, 0x79f2f585)}}, + {{TOBN(0x72cfd2e9, 0x49dee168), TOBN(0x1ae05223, 0x3e2af239), + TOBN(0x009e75be, 0x1d94066a), TOBN(0x6cca31c7, 0x38abf413)}, + {TOBN(0xb50bd61d, 0x9bc49908), TOBN(0x4a9b4a8c, 0xf5e2bc1e), + TOBN(0xeb6cc5f7, 0x946f83ac), TOBN(0x27da93fc, 0xebffab28)}}, + {{TOBN(0xea314c96, 0x4821c8c5), TOBN(0x8de49ded, 0xa83c15f4), + TOBN(0x7a64cf20, 0x7af33004), TOBN(0x45f1bfeb, 0xc9627e10)}, + {TOBN(0x878b0626, 0x54b9df60), TOBN(0x5e4fdc3c, 0xa95c0b33), + TOBN(0xe54a37ca, 0xc2035d8e), TOBN(0x9087cda9, 0x80f20b8c)}}, + {{TOBN(0x36f61c23, 0x8319ade4), TOBN(0x766f287a, 0xde8cfdf8), + TOBN(0x48821948, 0x346f3705), TOBN(0x49a7b853, 0x16e4f4a2)}, + {TOBN(0xb9b3f8a7, 0x5cedadfd), TOBN(0x8f562815, 0x8db2a815), + TOBN(0xc0b7d554, 0x01f68f95), TOBN(0x12971e27, 0x688a208e)}}, + {{TOBN(0xc9f8b696, 0xd0ff34fc), TOBN(0x20824de2, 0x1222718c), + TOBN(0x7213cf9f, 0x0c95284d), TOBN(0xe2ad741b, 0xdc158240)}, + {TOBN(0x0ee3a6df, 0x54043ccf), TOBN(0x16ff479b, 0xd84412b3), + TOBN(0xf6c74ee0, 0xdfc98af0), TOBN(0xa78a169f, 0x52fcd2fb)}}, + {{TOBN(0xd8ae8746, 0x99c930e9), TOBN(0x1d33e858, 0x49e117a5), + TOBN(0x7581fcb4, 0x6624759f), TOBN(0xde50644f, 0x5bedc01d)}, + {TOBN(0xbeec5d00, 0xcaf3155e), TOBN(0x672d66ac, 0xbc73e75f), + TOBN(0x86b9d8c6, 0x270b01db), TOBN(0xd249ef83, 0x50f55b79)}}, + {{TOBN(0x6131d6d4, 0x73978fe3), TOBN(0xcc4e4542, 0x754b00a1), + TOBN(0x4e05df05, 0x57dfcfe9), TOBN(0x94b29cdd, 0x51ef6bf0)}, + {TOBN(0xe4530cff, 0x9bc7edf2), TOBN(0x8ac236fd, 0xd3da65f3), + TOBN(0x0faf7d5f, 0xc8eb0b48), TOBN(0x4d2de14c, 0x660eb039)}}, + {{TOBN(0xc006bba7, 0x60430e54), TOBN(0x10a2d0d6, 0xda3289ab), + TOBN(0x9c037a5d, 0xd7979c59), TOBN(0x04d1f3d3, 0xa116d944)}, + {TOBN(0x9ff22473, 0x8a0983cd), TOBN(0x28e25b38, 0xc883cabb), + TOBN(0xe968dba5, 0x47a58995), TOBN(0x2c80b505, 0x774eebdf)}}, + {{TOBN(0xee763b71, 0x4a953beb), TOBN(0x502e223f, 0x1642e7f6), + TOBN(0x6fe4b641, 0x61d5e722), TOBN(0x9d37c5b0, 0xdbef5316)}, + {TOBN(0x0115ed70, 0xf8330bc7), TOBN(0x139850e6, 0x75a72789), + TOBN(0x27d7faec, 0xffceccc2), TOBN(0x3016a860, 0x4fd9f7f6)}}, + {{TOBN(0xc492ec64, 0x4cd8f64c), TOBN(0x58a2d790, 0x279d7b51), + TOBN(0x0ced1fc5, 0x1fc75256), TOBN(0x3e658aed, 0x8f433017)}, + {TOBN(0x0b61942e, 0x05da59eb), TOBN(0xba3d60a3, 0x0ddc3722), + TOBN(0x7c311cd1, 0x742e7f87), TOBN(0x6473ffee, 0xf6b01b6e)}}}, + {{{TOBN(0x8303604f, 0x692ac542), TOBN(0xf079ffe1, 0x227b91d3), + TOBN(0x19f63e63, 0x15aaf9bd), TOBN(0xf99ee565, 0xf1f344fb)}, + {TOBN(0x8a1d661f, 0xd6219199), TOBN(0x8c883bc6, 0xd48ce41c), + TOBN(0x1065118f, 0x3c74d904), TOBN(0x713889ee, 0x0faf8b1b)}}, + {{TOBN(0x972b3f8f, 0x81a1b3be), TOBN(0x4f3ce145, 0xce2764a0), + TOBN(0xe2d0f1cc, 0x28c4f5f7), TOBN(0xdeee0c0d, 0xc7f3985b)}, + {TOBN(0x7df4adc0, 0xd39e25c3), TOBN(0x40619820, 0xc467a080), + TOBN(0x440ebc93, 0x61cf5a58), TOBN(0x527729a6, 0x422ad600)}}, + {{TOBN(0xca6c0937, 0xb1b76ba6), TOBN(0x1a2eab85, 0x4d2026dc), + TOBN(0xb1715e15, 0x19d9ae0a), TOBN(0xf1ad9199, 0xbac4a026)}, + {TOBN(0x35b3dfb8, 0x07ea7b0e), TOBN(0xedf5496f, 0x3ed9eb89), + TOBN(0x8932e5ff, 0x2d6d08ab), TOBN(0xf314874e, 0x25bd2731)}}, + {{TOBN(0xefb26a75, 0x3f73f449), TOBN(0x1d1c94f8, 0x8d44fc79), + TOBN(0x49f0fbc5, 0x3bc0dc4d), TOBN(0xb747ea0b, 0x3698a0d0)}, + {TOBN(0x5218c3fe, 0x228d291e), TOBN(0x35b804b5, 0x43c129d6), + TOBN(0xfac859b8, 0xd1acc516), TOBN(0x6c10697d, 0x95d6e668)}}, + {{TOBN(0xc38e438f, 0x0876fd4e), TOBN(0x45f0c307, 0x83d2f383), + TOBN(0x203cc2ec, 0xb10934cb), TOBN(0x6a8f2439, 0x2c9d46ee)}, + {TOBN(0xf16b431b, 0x65ccde7b), TOBN(0x41e2cd18, 0x27e76a6f), + TOBN(0xb9c8cf8f, 0x4e3484d7), TOBN(0x64426efd, 0x8315244a)}}, + {{TOBN(0x1c0a8e44, 0xfc94dea3), TOBN(0x34c8cdbf, 0xdad6a0b0), + TOBN(0x919c3840, 0x04113cef), TOBN(0xfd32fba4, 0x15490ffa)}, + {TOBN(0x58d190f6, 0x795dcfb7), TOBN(0xfef01b03, 0x83588baf), + TOBN(0x9e6d1d63, 0xca1fc1c0), TOBN(0x53173f96, 0xf0a41ac9)}}, + {{TOBN(0x2b1d402a, 0xba16f73b), TOBN(0x2fb31014, 0x8cf9b9fc), + TOBN(0x2d51e60e, 0x446ef7bf), TOBN(0xc731021b, 0xb91e1745)}, + {TOBN(0x9d3b4724, 0x4fee99d4), TOBN(0x4bca48b6, 0xfac5c1ea), + TOBN(0x70f5f514, 0xbbea9af7), TOBN(0x751f55a5, 0x974c283a)}}, + {{TOBN(0x6e30251a, 0xcb452fdb), TOBN(0x31ee6965, 0x50f30650), + TOBN(0xb0b3e508, 0x933548d9), TOBN(0xb8949a4f, 0xf4b0ef5b)}, + {TOBN(0x208b8326, 0x3c88f3bd), TOBN(0xab147c30, 0xdb1d9989), + TOBN(0xed6515fd, 0x44d4df03), TOBN(0x17a12f75, 0xe72eb0c5)}}, + {{TOBN(0x3b59796d, 0x36cf69db), TOBN(0x1219eee9, 0x56670c18), + TOBN(0xfe3341f7, 0x7a070d8e), TOBN(0x9b70130b, 0xa327f90c)}, + {TOBN(0x36a32462, 0x0ae18e0e), TOBN(0x2021a623, 0x46c0a638), + TOBN(0x251b5817, 0xc62eb0d4), TOBN(0x87bfbcdf, 0x4c762293)}}, + {{TOBN(0xf78ab505, 0xcdd61d64), TOBN(0x8c7a53fc, 0xc8c18857), + TOBN(0xa653ce6f, 0x16147515), TOBN(0x9c923aa5, 0xea7d52d5)}, + {TOBN(0xc24709cb, 0x5c18871f), TOBN(0x7d53bec8, 0x73b3cc74), + TOBN(0x59264aff, 0xfdd1d4c4), TOBN(0x5555917e, 0x240da582)}}, + {{TOBN(0xcae8bbda, 0x548f5a0e), TOBN(0x1910eaba, 0x3bbfbbe1), + TOBN(0xae579685, 0x7677afc3), TOBN(0x49ea61f1, 0x73ff0b5c)}, + {TOBN(0x78655478, 0x4f7c3922), TOBN(0x95d337cd, 0x20c68eef), + TOBN(0x68f1e1e5, 0xdf779ab9), TOBN(0x14b491b0, 0xb5cf69a8)}}, + {{TOBN(0x7a6cbbe0, 0x28e3fe89), TOBN(0xe7e1fee4, 0xc5aac0eb), + TOBN(0x7f47eda5, 0x697e5140), TOBN(0x4f450137, 0xb454921f)}, + {TOBN(0xdb625f84, 0x95cd8185), TOBN(0x74be0ba1, 0xcdb2e583), + TOBN(0xaee4fd7c, 0xdd5e6de4), TOBN(0x4251437d, 0xe8101739)}}, + {{TOBN(0x686d72a0, 0xac620366), TOBN(0x4be3fb9c, 0xb6d59344), + TOBN(0x6e8b44e7, 0xa1eb75b9), TOBN(0x84e39da3, 0x91a5c10c)}, + {TOBN(0x37cc1490, 0xb38f0409), TOBN(0x02951943, 0x2c2ade82), + TOBN(0x9b688783, 0x1190a2d8), TOBN(0x25627d14, 0x231182ba)}}, + {{TOBN(0x6eb550aa, 0x658a6d87), TOBN(0x1405aaa7, 0xcf9c7325), + TOBN(0xd147142e, 0x5c8748c9), TOBN(0x7f637e4f, 0x53ede0e0)}, + {TOBN(0xf8ca2776, 0x14ffad2c), TOBN(0xe58fb1bd, 0xbafb6791), + TOBN(0x17158c23, 0xbf8f93fc), TOBN(0x7f15b373, 0x0a4a4655)}}, + {{TOBN(0x39d4add2, 0xd842ca72), TOBN(0xa71e4391, 0x3ed96305), + TOBN(0x5bb09cbe, 0x6700be14), TOBN(0x68d69d54, 0xd8befcf6)}, + {TOBN(0xa45f5367, 0x37183bcf), TOBN(0x7152b7bb, 0x3370dff7), + TOBN(0xcf887baa, 0xbf12525b), TOBN(0xe7ac7bdd, 0xd6d1e3cd)}}, + {{TOBN(0x25914f78, 0x81fdad90), TOBN(0xcf638f56, 0x0d2cf6ab), + TOBN(0xb90bc03f, 0xcc054de5), TOBN(0x932811a7, 0x18b06350)}, + {TOBN(0x2f00b330, 0x9bbd11ff), TOBN(0x76108a6f, 0xb4044974), + TOBN(0x801bb9e0, 0xa851d266), TOBN(0x0dd099be, 0xbf8990c1)}}, + {{TOBN(0x58c5aaaa, 0xabe32986), TOBN(0x0fe9dd2a, 0x50d59c27), + TOBN(0x84951ff4, 0x8d307305), TOBN(0x6c23f829, 0x86529b78)}, + {TOBN(0x50bb2218, 0x0b136a79), TOBN(0x7e2174de, 0x77a20996), + TOBN(0x6f00a4b9, 0xc0bb4da6), TOBN(0x89a25a17, 0xefdde8da)}}, + {{TOBN(0xf728a27e, 0xc11ee01d), TOBN(0xf900553a, 0xe5f10dfb), + TOBN(0x189a83c8, 0x02ec893c), TOBN(0x3ca5bdc1, 0x23f66d77)}, + {TOBN(0x98781537, 0x97eada9f), TOBN(0x59c50ab3, 0x10256230), + TOBN(0x346042d9, 0x323c69b3), TOBN(0x1b715a6d, 0x2c460449)}}, + {{TOBN(0xa41dd476, 0x6ae06e0b), TOBN(0xcdd7888e, 0x9d42e25f), + TOBN(0x0f395f74, 0x56b25a20), TOBN(0xeadfe0ae, 0x8700e27e)}, + {TOBN(0xb09d52a9, 0x69950093), TOBN(0x3525d9cb, 0x327f8d40), + TOBN(0xb8235a94, 0x67df886a), TOBN(0x77e4b0dd, 0x035faec2)}}, + {{TOBN(0x115eb20a, 0x517d7061), TOBN(0x77fe3433, 0x6c2df683), + TOBN(0x6870ddc7, 0xcdc6fc67), TOBN(0xb1610588, 0x0b87de83)}, + {TOBN(0x343584ca, 0xd9c4ddbe), TOBN(0xb3164f1c, 0x3d754be2), + TOBN(0x0731ed3a, 0xc1e6c894), TOBN(0x26327dec, 0x4f6b904c)}}, + {{TOBN(0x9d49c6de, 0x97b5cd32), TOBN(0x40835dae, 0xb5eceecd), + TOBN(0xc66350ed, 0xd9ded7fe), TOBN(0x8aeebb5c, 0x7a678804)}, + {TOBN(0x51d42fb7, 0x5b8ee9ec), TOBN(0xd7a17bdd, 0x8e3ca118), + TOBN(0x40d7511a, 0x2ef4400e), TOBN(0xc48990ac, 0x875a66f4)}}, + {{TOBN(0x8de07d2a, 0x2199e347), TOBN(0xbee75556, 0x2a39e051), + TOBN(0x56918786, 0x916e51dc), TOBN(0xeb191313, 0x4a2d89ec)}, + {TOBN(0x6679610d, 0x37d341ed), TOBN(0x434fbb41, 0x56d51c2b), + TOBN(0xe54b7ee7, 0xd7492dba), TOBN(0xaa33a79a, 0x59021493)}}, + {{TOBN(0x49fc5054, 0xe4bd6d3d), TOBN(0x09540f04, 0x5ab551d0), + TOBN(0x8acc9085, 0x4942d3a6), TOBN(0x231af02f, 0x2d28323b)}, + {TOBN(0x93458cac, 0x0992c163), TOBN(0x1fef8e71, 0x888e3bb4), + TOBN(0x27578da5, 0xbe8c268c), TOBN(0xcc8be792, 0xe805ec00)}}, + {{TOBN(0x29267bae, 0xc61c3855), TOBN(0xebff429d, 0x58c1fd3b), + TOBN(0x22d886c0, 0x8c0b93b8), TOBN(0xca5e00b2, 0x2ddb8953)}, + {TOBN(0xcf330117, 0xc3fed8b7), TOBN(0xd49ac6fa, 0x819c01f6), + TOBN(0x6ddaa6bd, 0x3c0fbd54), TOBN(0x91743068, 0x8049a2cf)}}, + {{TOBN(0xd67f981e, 0xaff2ef81), TOBN(0xc3654d35, 0x2818ae80), + TOBN(0x81d05044, 0x1b2aa892), TOBN(0x2db067bf, 0x3d099328)}, + {TOBN(0xe7c79e86, 0x703dcc97), TOBN(0xe66f9b37, 0xe133e215), + TOBN(0xcdf119a6, 0xe39a7a5c), TOBN(0x47c60de3, 0x876f1b61)}}, + {{TOBN(0x6e405939, 0xd860f1b2), TOBN(0x3e9a1dbc, 0xf5ed4d4a), + TOBN(0x3f23619e, 0xc9b6bcbd), TOBN(0x5ee790cf, 0x734e4497)}, + {TOBN(0xf0a834b1, 0x5bdaf9bb), TOBN(0x02cedda7, 0x4ca295f0), + TOBN(0x4619aa2b, 0xcb8e378c), TOBN(0xe5613244, 0xcc987ea4)}}, + {{TOBN(0x0bc022cc, 0x76b23a50), TOBN(0x4a2793ad, 0x0a6c21ce), + TOBN(0x38328780, 0x89cac3f5), TOBN(0x29176f1b, 0xcba26d56)}, + {TOBN(0x06296187, 0x4f6f59eb), TOBN(0x86e9bca9, 0x8bdc658e), + TOBN(0x2ca9c4d3, 0x57e30402), TOBN(0x5438b216, 0x516a09bb)}}, + {{TOBN(0x0a6a063c, 0x7672765a), TOBN(0x37a3ce64, 0x0547b9bf), + TOBN(0x42c099c8, 0x98b1a633), TOBN(0xb5ab800d, 0x05ee6961)}, + {TOBN(0xf1963f59, 0x11a5acd6), TOBN(0xbaee6157, 0x46201063), + TOBN(0x36d9a649, 0xa596210a), TOBN(0xaed04363, 0x1ba7138c)}}, + {{TOBN(0xcf817d1c, 0xa4a82b76), TOBN(0x5586960e, 0xf3806be9), + TOBN(0x7ab67c89, 0x09dc6bb5), TOBN(0x52ace7a0, 0x114fe7eb)}, + {TOBN(0xcd987618, 0xcbbc9b70), TOBN(0x4f06fd5a, 0x604ca5e1), + TOBN(0x90af14ca, 0x6dbde133), TOBN(0x1afe4322, 0x948a3264)}}, + {{TOBN(0xa70d2ca6, 0xc44b2c6c), TOBN(0xab726799, 0x0ef87dfe), + TOBN(0x310f64dc, 0x2e696377), TOBN(0x49b42e68, 0x4c8126a0)}, + {TOBN(0x0ea444c3, 0xcea0b176), TOBN(0x53a8ddf7, 0xcb269182), + TOBN(0xf3e674eb, 0xbbba9dcb), TOBN(0x0d2878a8, 0xd8669d33)}}, + {{TOBN(0x04b935d5, 0xd019b6a3), TOBN(0xbb5cf88e, 0x406f1e46), + TOBN(0xa1912d16, 0x5b57c111), TOBN(0x9803fc21, 0x19ebfd78)}, + {TOBN(0x4f231c9e, 0xc07764a9), TOBN(0xd93286ee, 0xb75bd055), + TOBN(0x83a9457d, 0x8ee6c9de), TOBN(0x04695915, 0x6087ec90)}}, + {{TOBN(0x14c6dd8a, 0x58d6cd46), TOBN(0x9cb633b5, 0x8e6634d2), + TOBN(0xc1305047, 0xf81bc328), TOBN(0x12ede0e2, 0x26a177e5)}, + {TOBN(0x332cca62, 0x065a6f4f), TOBN(0xc3a47ecd, 0x67be487b), + TOBN(0x741eb187, 0x0f47ed1c), TOBN(0x99e66e58, 0xe7598b14)}}, + {{TOBN(0x6f0544ca, 0x63d0ff12), TOBN(0xe5efc784, 0xb610a05f), + TOBN(0xf72917b1, 0x7cad7b47), TOBN(0x3ff6ea20, 0xf2cac0c0)}, + {TOBN(0xcc23791b, 0xf21db8b7), TOBN(0x7dac70b1, 0xd7d93565), + TOBN(0x682cda1d, 0x694bdaad), TOBN(0xeb88bb8c, 0x1023516d)}}, + {{TOBN(0xc4c634b4, 0xdfdbeb1b), TOBN(0x22f5ca72, 0xb4ee4dea), + TOBN(0x1045a368, 0xe6524821), TOBN(0xed9e8a3f, 0x052b18b2)}, + {TOBN(0x9b7f2cb1, 0xb961f49a), TOBN(0x7fee2ec1, 0x7b009670), + TOBN(0x350d8754, 0x22507a6d), TOBN(0x561bd711, 0x4db55f1d)}}, + {{TOBN(0x4c189ccc, 0x320bbcaf), TOBN(0x568434cf, 0xdf1de48c), + TOBN(0x6af1b00e, 0x0fa8f128), TOBN(0xf0ba9d02, 0x8907583c)}, + {TOBN(0x735a4004, 0x32ff9f60), TOBN(0x3dd8e4b6, 0xc25dcf33), + TOBN(0xf2230f16, 0x42c74cef), TOBN(0xd8117623, 0x013fa8ad)}}, + {{TOBN(0x36822876, 0xf51fe76e), TOBN(0x8a6811cc, 0x11d62589), + TOBN(0xc3fc7e65, 0x46225718), TOBN(0xb7df2c9f, 0xc82fdbcd)}, + {TOBN(0x3b1d4e52, 0xdd7b205b), TOBN(0xb6959478, 0x47a2e414), + TOBN(0x05e4d793, 0xefa91148), TOBN(0xb47ed446, 0xfd2e9675)}}, + {{TOBN(0x1a7098b9, 0x04c9d9bf), TOBN(0x661e2881, 0x1b793048), + TOBN(0xb1a16966, 0xb01ee461), TOBN(0xbc521308, 0x2954746f)}, + {TOBN(0xc909a0fc, 0x2477de50), TOBN(0xd80bb41c, 0x7dbd51ef), + TOBN(0xa85be7ec, 0x53294905), TOBN(0x6d465b18, 0x83958f97)}}, + {{TOBN(0x16f6f330, 0xfb6840fd), TOBN(0xfaaeb214, 0x3401e6c8), + TOBN(0xaf83d30f, 0xccb5b4f8), TOBN(0x22885739, 0x266dec4b)}, + {TOBN(0x51b4367c, 0x7bc467df), TOBN(0x926562e3, 0xd842d27a), + TOBN(0xdfcb6614, 0x0fea14a6), TOBN(0xeb394dae, 0xf2734cd9)}}, + {{TOBN(0x3eeae5d2, 0x11c0be98), TOBN(0xb1e6ed11, 0x814e8165), + TOBN(0x191086bc, 0xe52bce1c), TOBN(0x14b74cc6, 0xa75a04da)}, + {TOBN(0x63cf1186, 0x8c060985), TOBN(0x071047de, 0x2dbd7f7c), + TOBN(0x4e433b8b, 0xce0942ca), TOBN(0xecbac447, 0xd8fec61d)}}, + {{TOBN(0x8f0ed0e2, 0xebf3232f), TOBN(0xfff80f9e, 0xc52a2edd), + TOBN(0xad9ab433, 0x75b55fdb), TOBN(0x73ca7820, 0xe42e0c11)}, + {TOBN(0x6dace0a0, 0xe6251b46), TOBN(0x89bc6b5c, 0x4c0d932d), + TOBN(0x3438cd77, 0x095da19a), TOBN(0x2f24a939, 0x8d48bdfb)}}, + {{TOBN(0x99b47e46, 0x766561b7), TOBN(0x736600e6, 0x0ed0322a), + TOBN(0x06a47cb1, 0x638e1865), TOBN(0x927c1c2d, 0xcb136000)}, + {TOBN(0x29542337, 0x0cc5df69), TOBN(0x99b37c02, 0x09d649a9), + TOBN(0xc5f0043c, 0x6aefdb27), TOBN(0x6cdd9987, 0x1be95c27)}}, + {{TOBN(0x69850931, 0x390420d2), TOBN(0x299c40ac, 0x0983efa4), + TOBN(0x3a05e778, 0xaf39aead), TOBN(0x84274408, 0x43a45193)}, + {TOBN(0x6bcd0fb9, 0x91a711a0), TOBN(0x461592c8, 0x9f52ab17), + TOBN(0xb49302b4, 0xda3c6ed6), TOBN(0xc51fddc7, 0x330d7067)}}, + {{TOBN(0x94babeb6, 0xda50d531), TOBN(0x521b840d, 0xa6a7b9da), + TOBN(0x5305151e, 0x404bdc89), TOBN(0x1bcde201, 0xd0d07449)}, + {TOBN(0xf427a78b, 0x3b76a59a), TOBN(0xf84841ce, 0x07791a1b), + TOBN(0xebd314be, 0xbf91ed1c), TOBN(0x8e61d34c, 0xbf172943)}}, + {{TOBN(0x1d5dc451, 0x5541b892), TOBN(0xb186ee41, 0xfc9d9e54), + TOBN(0x9d9f345e, 0xd5bf610d), TOBN(0x3e7ba65d, 0xf6acca9f)}, + {TOBN(0x9dda787a, 0xa8369486), TOBN(0x09f9dab7, 0x8eb5ba53), + TOBN(0x5afb2033, 0xd6481bc3), TOBN(0x76f4ce30, 0xafa62104)}}, + {{TOBN(0xa8fa00cf, 0xf4f066b5), TOBN(0x89ab5143, 0x461dafc2), + TOBN(0x44339ed7, 0xa3389998), TOBN(0x2ff862f1, 0xbc214903)}, + {TOBN(0x2c88f985, 0xb05556e3), TOBN(0xcd96058e, 0x3467081e), + TOBN(0x7d6a4176, 0xedc637ea), TOBN(0xe1743d09, 0x36a5acdc)}}, + {{TOBN(0x66fd72e2, 0x7eb37726), TOBN(0xf7fa264e, 0x1481a037), + TOBN(0x9fbd3bde, 0x45f4aa79), TOBN(0xed1e0147, 0x767c3e22)}, + {TOBN(0x7621f979, 0x82e7abe2), TOBN(0x19eedc72, 0x45f633f8), + TOBN(0xe69b155e, 0x6137bf3a), TOBN(0xa0ad13ce, 0x414ee94e)}}, + {{TOBN(0x93e3d524, 0x1c0e651a), TOBN(0xab1a6e2a, 0x02ce227e), + TOBN(0xe7af1797, 0x4ab27eca), TOBN(0x245446de, 0xbd444f39)}, + {TOBN(0x59e22a21, 0x56c07613), TOBN(0x43deafce, 0xf4275498), + TOBN(0x10834ccb, 0x67fd0946), TOBN(0xa75841e5, 0x47406edf)}}, + {{TOBN(0xebd6a677, 0x7b0ac93d), TOBN(0xa6e37b0d, 0x78f5e0d7), + TOBN(0x2516c096, 0x76f5492b), TOBN(0x1e4bf888, 0x9ac05f3a)}, + {TOBN(0xcdb42ce0, 0x4df0ba2b), TOBN(0x935d5cfd, 0x5062341b), + TOBN(0x8a303333, 0x82acac20), TOBN(0x429438c4, 0x5198b00e)}}, + {{TOBN(0x1d083bc9, 0x049d33fa), TOBN(0x58b82dda, 0x946f67ff), + TOBN(0xac3e2db8, 0x67a1d6a3), TOBN(0x62e6bead, 0x1798aac8)}, + {TOBN(0xfc85980f, 0xde46c58c), TOBN(0xa7f69379, 0x69c8d7be), + TOBN(0x23557927, 0x837b35ec), TOBN(0x06a933d8, 0xe0790c0c)}}, + {{TOBN(0x827c0e9b, 0x077ff55d), TOBN(0x53977798, 0xbb26e680), + TOBN(0x59530874, 0x1d9cb54f), TOBN(0xcca3f449, 0x4aac53ef)}, + {TOBN(0x11dc5c87, 0xa07eda0f), TOBN(0xc138bccf, 0xfd6400c8), + TOBN(0x549680d3, 0x13e5da72), TOBN(0xc93eed82, 0x4540617e)}}, + {{TOBN(0xfd3db157, 0x4d0b75c0), TOBN(0x9716eb42, 0x6386075b), + TOBN(0x0639605c, 0x817b2c16), TOBN(0x09915109, 0xf1e4f201)}, + {TOBN(0x35c9a928, 0x5cca6c3b), TOBN(0xb25f7d1a, 0x3505c900), + TOBN(0xeb9f7d20, 0x630480c4), TOBN(0xc3c7b8c6, 0x2a1a501c)}}, + {{TOBN(0x3f99183c, 0x5a1f8e24), TOBN(0xfdb118fa, 0x9dd255f0), + TOBN(0xb9b18b90, 0xc27f62a6), TOBN(0xe8f732f7, 0x396ec191)}, + {TOBN(0x524a2d91, 0x0be786ab), TOBN(0x5d32adef, 0x0ac5a0f5), + TOBN(0x9b53d4d6, 0x9725f694), TOBN(0x032a76c6, 0x0510ba89)}}, + {{TOBN(0x840391a3, 0xebeb1544), TOBN(0x44b7b88c, 0x3ed73ac3), + TOBN(0xd24bae7a, 0x256cb8b3), TOBN(0x7ceb151a, 0xe394cb12)}, + {TOBN(0xbd6b66d0, 0x5bc1e6a8), TOBN(0xec70cecb, 0x090f07bf), + TOBN(0x270644ed, 0x7d937589), TOBN(0xee9e1a3d, 0x5f1dccfe)}}, + {{TOBN(0xb0d40a84, 0x745b98d2), TOBN(0xda429a21, 0x2556ed40), + TOBN(0xf676eced, 0x85148cb9), TOBN(0x5a22d40c, 0xded18936)}, + {TOBN(0x3bc4b9e5, 0x70e8a4ce), TOBN(0xbfd1445b, 0x9eae0379), + TOBN(0xf23f2c0c, 0x1a0bd47e), TOBN(0xa9c0bb31, 0xe1845531)}}, + {{TOBN(0x9ddc4d60, 0x0a4c3f6b), TOBN(0xbdfaad79, 0x2c15ef44), + TOBN(0xce55a236, 0x7f484acc), TOBN(0x08653ca7, 0x055b1f15)}, + {TOBN(0x2efa8724, 0x538873a3), TOBN(0x09299e5d, 0xace1c7e7), + TOBN(0x07afab66, 0xade332ba), TOBN(0x9be1fdf6, 0x92dd71b7)}}, + {{TOBN(0xa49b5d59, 0x5758b11c), TOBN(0x0b852893, 0xc8654f40), + TOBN(0xb63ef6f4, 0x52379447), TOBN(0xd4957d29, 0x105e690c)}, + {TOBN(0x7d484363, 0x646559b0), TOBN(0xf4a8273c, 0x49788a8e), + TOBN(0xee406cb8, 0x34ce54a9), TOBN(0x1e1c260f, 0xf86fda9b)}}, + {{TOBN(0xe150e228, 0xcf6a4a81), TOBN(0x1fa3b6a3, 0x1b488772), + TOBN(0x1e6ff110, 0xc5a9c15b), TOBN(0xc6133b91, 0x8ad6aa47)}, + {TOBN(0x8ac5d55c, 0x9dffa978), TOBN(0xba1d1c1d, 0x5f3965f2), + TOBN(0xf969f4e0, 0x7732b52f), TOBN(0xfceecdb5, 0xa5172a07)}}, + {{TOBN(0xb0120a5f, 0x10f2b8f5), TOBN(0xc83a6cdf, 0x5c4c2f63), + TOBN(0x4d47a491, 0xf8f9c213), TOBN(0xd9e1cce5, 0xd3f1bbd5)}, + {TOBN(0x0d91bc7c, 0xaba7e372), TOBN(0xfcdc74c8, 0xdfd1a2db), + TOBN(0x05efa800, 0x374618e5), TOBN(0x11216969, 0x15a7925e)}}, + {{TOBN(0xd4c89823, 0xf6021c5d), TOBN(0x880d5e84, 0xeff14423), + TOBN(0x6523bc5a, 0x6dcd1396), TOBN(0xd1acfdfc, 0x113c978b)}, + {TOBN(0xb0c164e8, 0xbbb66840), TOBN(0xf7f4301e, 0x72b58459), + TOBN(0xc29ad4a6, 0xa638e8ec), TOBN(0xf5ab8961, 0x46b78699)}}, + {{TOBN(0x9dbd7974, 0x0e954750), TOBN(0x0121de88, 0x64f9d2c6), + TOBN(0x2e597b42, 0xd985232e), TOBN(0x55b6c3c5, 0x53451777)}, + {TOBN(0xbb53e547, 0x519cb9fb), TOBN(0xf134019f, 0x8428600d), + TOBN(0x5a473176, 0xe081791a), TOBN(0x2f3e2263, 0x35fb0c08)}}, + {{TOBN(0xb28c3017, 0x73d273b0), TOBN(0xccd21076, 0x7721ef9a), + TOBN(0x054cc292, 0xb650dc39), TOBN(0x662246de, 0x6188045e)}, + {TOBN(0x904b52fa, 0x6b83c0d1), TOBN(0xa72df267, 0x97e9cd46), + TOBN(0x886b43cd, 0x899725e4), TOBN(0x2b651688, 0xd849ff22)}}, + {{TOBN(0x60479b79, 0x02f34533), TOBN(0x5e354c14, 0x0c77c148), + TOBN(0xb4bb7581, 0xa8537c78), TOBN(0x188043d7, 0xefe1495f)}, + {TOBN(0x9ba12f42, 0x8c1d5026), TOBN(0x2e0c8a26, 0x93d4aaab), + TOBN(0xbdba7b8b, 0xaa57c450), TOBN(0x140c9ad6, 0x9bbdafef)}}, + {{TOBN(0x2067aa42, 0x25ac0f18), TOBN(0xf7b1295b, 0x04d1fbf3), + TOBN(0x14829111, 0xa4b04824), TOBN(0x2ce3f192, 0x33bd5e91)}, + {TOBN(0x9c7a1d55, 0x8f2e1b72), TOBN(0xfe932286, 0x302aa243), + TOBN(0x497ca7b4, 0xd4be9554), TOBN(0xb8e821b8, 0xe0547a6e)}}, + {{TOBN(0xfb2838be, 0x67e573e0), TOBN(0x05891db9, 0x4084c44b), + TOBN(0x91311373, 0x96c1c2c5), TOBN(0x6aebfa3f, 0xd958444b)}, + {TOBN(0xac9cdce9, 0xe56e55c1), TOBN(0x7148ced3, 0x2caa46d0), + TOBN(0x2e10c7ef, 0xb61fe8eb), TOBN(0x9fd835da, 0xff97cf4d)}}}, + {{{TOBN(0xa36da109, 0x081e9387), TOBN(0xfb9780d7, 0x8c935828), + TOBN(0xd5940332, 0xe540b015), TOBN(0xc9d7b51b, 0xe0f466fa)}, + {TOBN(0xfaadcd41, 0xd6d9f671), TOBN(0xba6c1e28, 0xb1a2ac17), + TOBN(0x066a7833, 0xed201e5f), TOBN(0x19d99719, 0xf90f462b)}}, + {{TOBN(0xf431f462, 0x060b5f61), TOBN(0xa56f46b4, 0x7bd057c2), + TOBN(0x348dca6c, 0x47e1bf65), TOBN(0x9a38783e, 0x41bcf1ff)}, + {TOBN(0x7a5d33a9, 0xda710718), TOBN(0x5a779987, 0x2e0aeaf6), + TOBN(0xca87314d, 0x2d29d187), TOBN(0xfa0edc3e, 0xc687d733)}}, + {{TOBN(0x9df33621, 0x6a31e09b), TOBN(0xde89e44d, 0xc1350e35), + TOBN(0x29214871, 0x4ca0cf52), TOBN(0xdf379672, 0x0b88a538)}, + {TOBN(0xc92a510a, 0x2591d61b), TOBN(0x79aa87d7, 0x585b447b), + TOBN(0xf67db604, 0xe5287f77), TOBN(0x1697c8bf, 0x5efe7a80)}}, + {{TOBN(0x1c894849, 0xcb198ac7), TOBN(0xa884a93d, 0x0f264665), + TOBN(0x2da964ef, 0x9b200678), TOBN(0x3c351b87, 0x009834e6)}, + {TOBN(0xafb2ef9f, 0xe2c4b44b), TOBN(0x580f6c47, 0x3326790c), + TOBN(0xb8480521, 0x0b02264a), TOBN(0x8ba6f9e2, 0x42a194e2)}}, + {{TOBN(0xfc87975f, 0x8fb54738), TOBN(0x35160788, 0x27c3ead3), + TOBN(0x834116d2, 0xb74a085a), TOBN(0x53c99a73, 0xa62fe996)}, + {TOBN(0x87585be0, 0x5b81c51b), TOBN(0x925bafa8, 0xbe0852b7), + TOBN(0x76a4fafd, 0xa84d19a7), TOBN(0x39a45982, 0x585206d4)}}, + {{TOBN(0x499b6ab6, 0x5eb03c0e), TOBN(0xf19b7954, 0x72bc3fde), + TOBN(0xa86b5b9c, 0x6e3a80d2), TOBN(0xe4377508, 0x6d42819f)}, + {TOBN(0xc1663650, 0xbb3ee8a3), TOBN(0x75eb14fc, 0xb132075f), + TOBN(0xa8ccc906, 0x7ad834f6), TOBN(0xea6a2474, 0xe6e92ffd)}}, + {{TOBN(0x9d72fd95, 0x0f8d6758), TOBN(0xcb84e101, 0x408c07dd), + TOBN(0xb9114bfd, 0xa5e23221), TOBN(0x358b5fe2, 0xe94e742c)}, + {TOBN(0x1c0577ec, 0x95f40e75), TOBN(0xf0155451, 0x3d73f3d6), + TOBN(0x9d55cd67, 0xbd1b9b66), TOBN(0x63e86e78, 0xaf8d63c7)}}, + {{TOBN(0x39d934ab, 0xd3c095f1), TOBN(0x04b261be, 0xe4b76d71), + TOBN(0x1d2e6970, 0xe73e6984), TOBN(0x879fb23b, 0x5e5fcb11)}, + {TOBN(0x11506c72, 0xdfd75490), TOBN(0x3a97d085, 0x61bcf1c1), + TOBN(0x43201d82, 0xbf5e7007), TOBN(0x7f0ac52f, 0x798232a7)}}, + {{TOBN(0x2715cbc4, 0x6eb564d4), TOBN(0x8d6c752c, 0x9e570e29), + TOBN(0xf80247c8, 0x9ef5fd5d), TOBN(0xc3c66b46, 0xd53eb514)}, + {TOBN(0x9666b401, 0x0f87de56), TOBN(0xce62c06f, 0xc6c603b5), + TOBN(0xae7b4c60, 0x7e4fc942), TOBN(0x38ac0b77, 0x663a9c19)}}, + {{TOBN(0xcb4d20ee, 0x4b049136), TOBN(0x8b63bf12, 0x356a4613), + TOBN(0x1221aef6, 0x70e08128), TOBN(0xe62d8c51, 0x4acb6b16)}, + {TOBN(0x71f64a67, 0x379e7896), TOBN(0xb25237a2, 0xcafd7fa5), + TOBN(0xf077bd98, 0x3841ba6a), TOBN(0xc4ac0244, 0x3cd16e7e)}}, + {{TOBN(0x548ba869, 0x21fea4ca), TOBN(0xd36d0817, 0xf3dfdac1), + TOBN(0x09d8d71f, 0xf4685faf), TOBN(0x8eff66be, 0xc52c459a)}, + {TOBN(0x182faee7, 0x0b57235e), TOBN(0xee3c39b1, 0x0106712b), + TOBN(0x5107331f, 0xc0fcdcb0), TOBN(0x669fb9dc, 0xa51054ba)}}, + {{TOBN(0xb25101fb, 0x319d7682), TOBN(0xb0293129, 0x0a982fee), + TOBN(0x51c1c9b9, 0x0261b344), TOBN(0x0e008c5b, 0xbfd371fa)}, + {TOBN(0xd866dd1c, 0x0278ca33), TOBN(0x666f76a6, 0xe5aa53b1), + TOBN(0xe5cfb779, 0x6013a2cf), TOBN(0x1d3a1aad, 0xa3521836)}}, + {{TOBN(0xcedd2531, 0x73faa485), TOBN(0xc8ee6c4f, 0xc0a76878), + TOBN(0xddbccfc9, 0x2a11667d), TOBN(0x1a418ea9, 0x1c2f695a)}, + {TOBN(0xdb11bd92, 0x51f73971), TOBN(0x3e4b3c82, 0xda2ed89f), + TOBN(0x9a44f3f4, 0xe73e0319), TOBN(0xd1e3de0f, 0x303431af)}}, + {{TOBN(0x3c5604ff, 0x50f75f9c), TOBN(0x1d8eddf3, 0x7e752b22), + TOBN(0x0ef074dd, 0x3c9a1118), TOBN(0xd0ffc172, 0xccb86d7b)}, + {TOBN(0xabd1ece3, 0x037d90f2), TOBN(0xe3f307d6, 0x6055856c), + TOBN(0x422f9328, 0x7e4c6daf), TOBN(0x902aac66, 0x334879a0)}}, + {{TOBN(0xb6a1e7bf, 0x94cdfade), TOBN(0x6c97e1ed, 0x7fc6d634), + TOBN(0x662ad24d, 0xa2fb63f8), TOBN(0xf81be1b9, 0xa5928405)}, + {TOBN(0x86d765e4, 0xd14b4206), TOBN(0xbecc2e0e, 0x8fa0db65), + TOBN(0xa28838e0, 0xb17fc76c), TOBN(0xe49a602a, 0xe37cf24e)}}, + {{TOBN(0x76b4131a, 0x567193ec), TOBN(0xaf3c305a, 0xe5f6e70b), + TOBN(0x9587bd39, 0x031eebdd), TOBN(0x5709def8, 0x71bbe831)}, + {TOBN(0x57059983, 0x0eb2b669), TOBN(0x4d80ce1b, 0x875b7029), + TOBN(0x838a7da8, 0x0364ac16), TOBN(0x2f431d23, 0xbe1c83ab)}}, + {{TOBN(0xe56812a6, 0xf9294dd3), TOBN(0xb448d01f, 0x9b4b0d77), + TOBN(0xf3ae6061, 0x04e8305c), TOBN(0x2bead645, 0x94d8c63e)}, + {TOBN(0x0a85434d, 0x84fd8b07), TOBN(0x537b983f, 0xf7a9dee5), + TOBN(0xedcc5f18, 0xef55bd85), TOBN(0x2041af62, 0x21c6cf8b)}}, + {{TOBN(0x8e52874c, 0xb940c71e), TOBN(0x211935a9, 0xdb5f4b3a), + TOBN(0x94350492, 0x301b1dc3), TOBN(0x33d2646d, 0x29958620)}, + {TOBN(0x16b0d64b, 0xef911404), TOBN(0x9d1f25ea, 0x9a3c5ef4), + TOBN(0x20f200eb, 0x4a352c78), TOBN(0x43929f2c, 0x4bd0b428)}}, + {{TOBN(0xa5656667, 0xc7196e29), TOBN(0x7992c2f0, 0x9391be48), + TOBN(0xaaa97cbd, 0x9ee0cd6e), TOBN(0x51b0310c, 0x3dc8c9bf)}, + {TOBN(0x237f8acf, 0xdd9f22cb), TOBN(0xbb1d81a1, 0xb585d584), + TOBN(0x8d5d85f5, 0x8c416388), TOBN(0x0d6e5a5a, 0x42fe474f)}}, + {{TOBN(0xe7812766, 0x38235d4e), TOBN(0x1c62bd67, 0x496e3298), + TOBN(0x8378660c, 0x3f175bc8), TOBN(0x4d04e189, 0x17afdd4d)}, + {TOBN(0x32a81601, 0x85a8068c), TOBN(0xdb58e4e1, 0x92b29a85), + TOBN(0xe8a65b86, 0xc70d8a3b), TOBN(0x5f0e6f4e, 0x98a0403b)}}, + {{TOBN(0x08129684, 0x69ed2370), TOBN(0x34dc30bd, 0x0871ee26), + TOBN(0x3a5ce948, 0x7c9c5b05), TOBN(0x7d487b80, 0x43a90c87)}, + {TOBN(0x4089ba37, 0xdd0e7179), TOBN(0x45f80191, 0xb4041811), + TOBN(0x1c3e1058, 0x98747ba5), TOBN(0x98c4e13a, 0x6e1ae592)}}, + {{TOBN(0xd44636e6, 0xe82c9f9e), TOBN(0x711db87c, 0xc33a1043), + TOBN(0x6f431263, 0xaa8aec05), TOBN(0x43ff120d, 0x2744a4aa)}, + {TOBN(0xd3bd892f, 0xae77779b), TOBN(0xf0fe0cc9, 0x8cdc9f82), + TOBN(0xca5f7fe6, 0xf1c5b1bc), TOBN(0xcc63a682, 0x44929a72)}}, + {{TOBN(0xc7eaba0c, 0x09dbe19a), TOBN(0x2f3585ad, 0x6b5c73c2), + TOBN(0x8ab8924b, 0x0ae50c30), TOBN(0x17fcd27a, 0x638b30ba)}, + {TOBN(0xaf414d34, 0x10b3d5a5), TOBN(0x09c107d2, 0x2a9accf1), + TOBN(0x15dac49f, 0x946a6242), TOBN(0xaec3df2a, 0xd707d642)}}, + {{TOBN(0x2c2492b7, 0x3f894ae0), TOBN(0xf59df3e5, 0xb75f18ce), + TOBN(0x7cb740d2, 0x8f53cad0), TOBN(0x3eb585fb, 0xc4f01294)}, + {TOBN(0x17da0c86, 0x32c7f717), TOBN(0xeb8c795b, 0xaf943f4c), + TOBN(0x4ee23fb5, 0xf67c51d2), TOBN(0xef187575, 0x68889949)}}, + {{TOBN(0xa6b4bdb2, 0x0389168b), TOBN(0xc4ecd258, 0xea577d03), + TOBN(0x3a63782b, 0x55743082), TOBN(0x6f678f4c, 0xc72f08cd)}, + {TOBN(0x553511cf, 0x65e58dd8), TOBN(0xd53b4e3e, 0xd402c0cd), + TOBN(0x37de3e29, 0xa037c14c), TOBN(0x86b6c516, 0xc05712aa)}}, + {{TOBN(0x2834da3e, 0xb38dff6f), TOBN(0xbe012c52, 0xea636be8), + TOBN(0x292d238c, 0x61dd37f8), TOBN(0x0e54523f, 0x8f8142db)}, + {TOBN(0xe31eb436, 0x036a05d8), TOBN(0x83e3cdff, 0x1e93c0ff), + TOBN(0x3fd2fe0f, 0x50821ddf), TOBN(0xc8e19b0d, 0xff9eb33b)}}, + {{TOBN(0xc8cc943f, 0xb569a5fe), TOBN(0xad0090d4, 0xd4342d75), + TOBN(0x82090b4b, 0xcaeca000), TOBN(0xca39687f, 0x1bd410eb)}, + {TOBN(0xe7bb0df7, 0x65959d77), TOBN(0x39d78218, 0x9c964999), + TOBN(0xd87f62e8, 0xb2415451), TOBN(0xe5efb774, 0xbed76108)}}, + {{TOBN(0x3ea011a4, 0xe822f0d0), TOBN(0xbc647ad1, 0x5a8704f8), + TOBN(0xbb315b35, 0x50c6820f), TOBN(0x863dec3d, 0xb7e76bec)}, + {TOBN(0x01ff5d3a, 0xf017bfc7), TOBN(0x20054439, 0x976b8229), + TOBN(0x067fca37, 0x0bbd0d3b), TOBN(0xf63dde64, 0x7f5e3d0f)}}, + {{TOBN(0x22dbefb3, 0x2a4c94e9), TOBN(0xafbff0fe, 0x96f8278a), + TOBN(0x80aea0b1, 0x3503793d), TOBN(0xb2238029, 0x5f06cd29)}, + {TOBN(0x65703e57, 0x8ec3feca), TOBN(0x06c38314, 0x393e7053), + TOBN(0xa0b751eb, 0x7c6734c4), TOBN(0xd2e8a435, 0xc59f0f1e)}}, + {{TOBN(0x147d9052, 0x5e9ca895), TOBN(0x2f4dd31e, 0x972072df), + TOBN(0xa16fda8e, 0xe6c6755c), TOBN(0xc66826ff, 0xcf196558)}, + {TOBN(0x1f1a76a3, 0x0cf43895), TOBN(0xa9d604e0, 0x83c3097b), + TOBN(0xe1908309, 0x66390e0e), TOBN(0xa50bf753, 0xb3c85eff)}}, + {{TOBN(0x0696bdde, 0xf6a70251), TOBN(0x548b801b, 0x3c6ab16a), + TOBN(0x37fcf704, 0xa4d08762), TOBN(0x090b3def, 0xdff76c4e)}, + {TOBN(0x87e8cb89, 0x69cb9158), TOBN(0x44a90744, 0x995ece43), + TOBN(0xf85395f4, 0x0ad9fbf5), TOBN(0x49b0f6c5, 0x4fb0c82d)}}, + {{TOBN(0x75d9bc15, 0xadf7cccf), TOBN(0x81a3e5d6, 0xdfa1e1b0), + TOBN(0x8c39e444, 0x249bc17e), TOBN(0xf37dccb2, 0x8ea7fd43)}, + {TOBN(0xda654873, 0x907fba12), TOBN(0x35daa6da, 0x4a372904), + TOBN(0x0564cfc6, 0x6283a6c5), TOBN(0xd09fa4f6, 0x4a9395bf)}}, + {{TOBN(0x688e9ec9, 0xaeb19a36), TOBN(0xd913f1ce, 0xc7bfbfb4), + TOBN(0x797b9a3c, 0x61c2faa6), TOBN(0x2f979bec, 0x6a0a9c12)}, + {TOBN(0xb5969d0f, 0x359679ec), TOBN(0xebcf523d, 0x079b0460), + TOBN(0xfd6b0008, 0x10fab870), TOBN(0x3f2edcda, 0x9373a39c)}}, + {{TOBN(0x0d64f9a7, 0x6f568431), TOBN(0xf848c27c, 0x02f8898c), + TOBN(0xf418ade1, 0x260b5bd5), TOBN(0xc1f3e323, 0x6973dee8)}, + {TOBN(0x46e9319c, 0x26c185dd), TOBN(0x6d85b7d8, 0x546f0ac4), + TOBN(0x427965f2, 0x247f9d57), TOBN(0xb519b636, 0xb0035f48)}}, + {{TOBN(0x6b6163a9, 0xab87d59c), TOBN(0xff9f58c3, 0x39caaa11), + TOBN(0x4ac39cde, 0x3177387b), TOBN(0x5f6557c2, 0x873e77f9)}, + {TOBN(0x67504006, 0x36a83041), TOBN(0x9b1c96ca, 0x75ef196c), + TOBN(0xf34283de, 0xb08c7940), TOBN(0x7ea09644, 0x1128c316)}}, + {{TOBN(0xb510b3b5, 0x6aa39dff), TOBN(0x59b43da2, 0x9f8e4d8c), + TOBN(0xa8ce31fd, 0x9e4c4b9f), TOBN(0x0e20be26, 0xc1303c01)}, + {TOBN(0x18187182, 0xe8ee47c9), TOBN(0xd9687cdb, 0x7db98101), + TOBN(0x7a520e4d, 0xa1e14ff6), TOBN(0x429808ba, 0x8836d572)}}, + {{TOBN(0xa37ca60d, 0x4944b663), TOBN(0xf901f7a9, 0xa3f91ae5), + TOBN(0xe4e3e76e, 0x9e36e3b1), TOBN(0x9aa219cf, 0x29d93250)}, + {TOBN(0x347fe275, 0x056a2512), TOBN(0xa4d643d9, 0xde65d95c), + TOBN(0x9669d396, 0x699fc3ed), TOBN(0xb598dee2, 0xcf8c6bbe)}}, + {{TOBN(0x682ac1e5, 0xdda9e5c6), TOBN(0x4e0d3c72, 0xcaa9fc95), + TOBN(0x17faaade, 0x772bea44), TOBN(0x5ef8428c, 0xab0009c8)}, + {TOBN(0xcc4ce47a, 0x460ff016), TOBN(0xda6d12bf, 0x725281cb), + TOBN(0x44c67848, 0x0223aad2), TOBN(0x6e342afa, 0x36256e28)}}, + {{TOBN(0x1400bb0b, 0x93a37c04), TOBN(0x62b1bc9b, 0xdd10bd96), + TOBN(0x7251adeb, 0x0dac46b7), TOBN(0x7d33b92e, 0x7be4ef51)}, + {TOBN(0x28b2a94b, 0xe61fa29a), TOBN(0x4b2be13f, 0x06422233), + TOBN(0x36d6d062, 0x330d8d37), TOBN(0x5ef80e1e, 0xb28ca005)}}, + {{TOBN(0x174d4699, 0x6d16768e), TOBN(0x9fc4ff6a, 0x628bf217), + TOBN(0x77705a94, 0x154e490d), TOBN(0x9d96dd28, 0x8d2d997a)}, + {TOBN(0x77e2d9d8, 0xce5d72c4), TOBN(0x9d06c5a4, 0xc11c714f), + TOBN(0x02aa5136, 0x79e4a03e), TOBN(0x1386b3c2, 0x030ff28b)}}, + {{TOBN(0xfe82e8a6, 0xfb283f61), TOBN(0x7df203e5, 0xf3abc3fb), + TOBN(0xeec7c351, 0x3a4d3622), TOBN(0xf7d17dbf, 0xdf762761)}, + {TOBN(0xc3956e44, 0x522055f0), TOBN(0xde3012db, 0x8fa748db), + TOBN(0xca9fcb63, 0xbf1dcc14), TOBN(0xa56d9dcf, 0xbe4e2f3a)}}, + {{TOBN(0xb86186b6, 0x8bcec9c2), TOBN(0x7cf24df9, 0x680b9f06), + TOBN(0xc46b45ea, 0xc0d29281), TOBN(0xfff42bc5, 0x07b10e12)}, + {TOBN(0x12263c40, 0x4d289427), TOBN(0x3d5f1899, 0xb4848ec4), + TOBN(0x11f97010, 0xd040800c), TOBN(0xb4c5f529, 0x300feb20)}}, + {{TOBN(0xcc543f8f, 0xde94fdcb), TOBN(0xe96af739, 0xc7c2f05e), + TOBN(0xaa5e0036, 0x882692e1), TOBN(0x09c75b68, 0x950d4ae9)}, + {TOBN(0x62f63df2, 0xb5932a7a), TOBN(0x2658252e, 0xde0979ad), + TOBN(0x2a19343f, 0xb5e69631), TOBN(0x718c7501, 0x525b666b)}}, + {{TOBN(0x26a42d69, 0xea40dc3a), TOBN(0xdc84ad22, 0xaecc018f), + TOBN(0x25c36c7b, 0x3270f04a), TOBN(0x46ba6d47, 0x50fa72ed)}, + {TOBN(0x6c37d1c5, 0x93e58a8e), TOBN(0xa2394731, 0x120c088c), + TOBN(0xc3be4263, 0xcb6e86da), TOBN(0x2c417d36, 0x7126d038)}}, + {{TOBN(0x5b70f9c5, 0x8b6f8efa), TOBN(0x671a2faa, 0x37718536), + TOBN(0xd3ced3c6, 0xb539c92b), TOBN(0xe56f1bd9, 0xa31203c2)}, + {TOBN(0x8b096ec4, 0x9ff3c8eb), TOBN(0x2deae432, 0x43491cea), + TOBN(0x2465c6eb, 0x17943794), TOBN(0x5d267e66, 0x20586843)}}, + {{TOBN(0x9d3d116d, 0xb07159d0), TOBN(0xae07a67f, 0xc1896210), + TOBN(0x8fc84d87, 0xbb961579), TOBN(0x30009e49, 0x1c1f8dd6)}, + {TOBN(0x8a8caf22, 0xe3132819), TOBN(0xcffa197c, 0xf23ab4ff), + TOBN(0x58103a44, 0x205dd687), TOBN(0x57b796c3, 0x0ded67a2)}}, + {{TOBN(0x0b9c3a6c, 0xa1779ad7), TOBN(0xa33cfe2e, 0x357c09c5), + TOBN(0x2ea29315, 0x3db4a57e), TOBN(0x91959695, 0x8ebeb52e)}, + {TOBN(0x118db9a6, 0xe546c879), TOBN(0x8e996df4, 0x6295c8d6), + TOBN(0xdd990484, 0x55ec806b), TOBN(0x24f291ca, 0x165c1035)}}, + {{TOBN(0xcca523bb, 0x440e2229), TOBN(0x324673a2, 0x73ef4d04), + TOBN(0xaf3adf34, 0x3e11ec39), TOBN(0x6136d7f1, 0xdc5968d3)}, + {TOBN(0x7a7b2899, 0xb053a927), TOBN(0x3eaa2661, 0xae067ecd), + TOBN(0x8549b9c8, 0x02779cd9), TOBN(0x061d7940, 0xc53385ea)}}, + {{TOBN(0x3e0ba883, 0xf06d18bd), TOBN(0x4ba6de53, 0xb2700843), + TOBN(0xb966b668, 0x591a9e4d), TOBN(0x93f67567, 0x7f4fa0ed)}, + {TOBN(0x5a02711b, 0x4347237b), TOBN(0xbc041e2f, 0xe794608e), + TOBN(0x55af10f5, 0x70f73d8c), TOBN(0xd2d4d4f7, 0xbb7564f7)}}, + {{TOBN(0xd7d27a89, 0xb3e93ce7), TOBN(0xf7b5a875, 0x5d3a2c1b), + TOBN(0xb29e68a0, 0x255b218a), TOBN(0xb533837e, 0x8af76754)}, + {TOBN(0xd1b05a73, 0x579fab2e), TOBN(0xb41055a1, 0xecd74385), + TOBN(0xb2369274, 0x445e9115), TOBN(0x2972a7c4, 0xf520274e)}}, + {{TOBN(0x6c08334e, 0xf678e68a), TOBN(0x4e4160f0, 0x99b057ed), + TOBN(0x3cfe11b8, 0x52ccb69a), TOBN(0x2fd1823a, 0x21c8f772)}, + {TOBN(0xdf7f072f, 0x3298f055), TOBN(0x8c0566f9, 0xfec74a6e), + TOBN(0xe549e019, 0x5bb4d041), TOBN(0x7c3930ba, 0x9208d850)}}, + {{TOBN(0xe07141fc, 0xaaa2902b), TOBN(0x539ad799, 0xe4f69ad3), + TOBN(0xa6453f94, 0x813f9ffd), TOBN(0xc58d3c48, 0x375bc2f7)}, + {TOBN(0xb3326fad, 0x5dc64e96), TOBN(0x3aafcaa9, 0xb240e354), + TOBN(0x1d1b0903, 0xaca1e7a9), TOBN(0x4ceb9767, 0x1211b8a0)}}, + {{TOBN(0xeca83e49, 0xe32a858e), TOBN(0x4c32892e, 0xae907bad), + TOBN(0xd5b42ab6, 0x2eb9b494), TOBN(0x7fde3ee2, 0x1eabae1b)}, + {TOBN(0x13b5ab09, 0xcaf54957), TOBN(0xbfb028be, 0xe5f5d5d5), + TOBN(0x928a0650, 0x2003e2c0), TOBN(0x90793aac, 0x67476843)}}, + {{TOBN(0x5e942e79, 0xc81710a0), TOBN(0x557e4a36, 0x27ccadd4), + TOBN(0x72a2bc56, 0x4bcf6d0c), TOBN(0x09ee5f43, 0x26d7b80c)}, + {TOBN(0x6b70dbe9, 0xd4292f19), TOBN(0x56f74c26, 0x63f16b18), + TOBN(0xc23db0f7, 0x35fbb42a), TOBN(0xb606bdf6, 0x6ae10040)}}, + {{TOBN(0x1eb15d4d, 0x044573ac), TOBN(0x7dc3cf86, 0x556b0ba4), + TOBN(0x97af9a33, 0xc60df6f7), TOBN(0x0b1ef85c, 0xa716ce8c)}, + {TOBN(0x2922f884, 0xc96958be), TOBN(0x7c32fa94, 0x35690963), + TOBN(0x2d7f667c, 0xeaa00061), TOBN(0xeaaf7c17, 0x3547365c)}}, + {{TOBN(0x1eb4de46, 0x87032d58), TOBN(0xc54f3d83, 0x5e2c79e0), + TOBN(0x07818df4, 0x5d04ef23), TOBN(0x55faa9c8, 0x673d41b4)}, + {TOBN(0xced64f6f, 0x89b95355), TOBN(0x4860d2ea, 0xb7415c84), + TOBN(0x5fdb9bd2, 0x050ebad3), TOBN(0xdb53e0cc, 0x6685a5bf)}}, + {{TOBN(0xb830c031, 0x9feb6593), TOBN(0xdd87f310, 0x6accff17), + TOBN(0x2303ebab, 0x9f555c10), TOBN(0x94603695, 0x287e7065)}, + {TOBN(0xf88311c3, 0x2e83358c), TOBN(0x508dd9b4, 0xeefb0178), + TOBN(0x7ca23706, 0x2dba8652), TOBN(0x62aac5a3, 0x0047abe5)}}, + {{TOBN(0x9a61d2a0, 0x8b1ea7b3), TOBN(0xd495ab63, 0xae8b1485), + TOBN(0x38740f84, 0x87052f99), TOBN(0x178ebe5b, 0xb2974eea)}, + {TOBN(0x030bbcca, 0x5b36d17f), TOBN(0xb5e4cce3, 0xaaf86eea), + TOBN(0xb51a0220, 0x68f8e9e0), TOBN(0xa4348796, 0x09eb3e75)}}, + {{TOBN(0xbe592309, 0xeef1a752), TOBN(0x5d7162d7, 0x6f2aa1ed), + TOBN(0xaebfb5ed, 0x0f007dd2), TOBN(0x255e14b2, 0xc89edd22)}, + {TOBN(0xba85e072, 0x0303b697), TOBN(0xc5d17e25, 0xf05720ff), + TOBN(0x02b58d6e, 0x5128ebb6), TOBN(0x2c80242d, 0xd754e113)}}, + {{TOBN(0x919fca5f, 0xabfae1ca), TOBN(0x937afaac, 0x1a21459b), + TOBN(0x9e0ca91c, 0x1f66a4d2), TOBN(0x194cc7f3, 0x23ec1331)}, + {TOBN(0xad25143a, 0x8aa11690), TOBN(0xbe40ad8d, 0x09b59e08), + TOBN(0x37d60d9b, 0xe750860a), TOBN(0x6c53b008, 0xc6bf434c)}}, + {{TOBN(0xb572415d, 0x1356eb80), TOBN(0xb8bf9da3, 0x9578ded8), + TOBN(0x22658e36, 0x5e8fb38b), TOBN(0x9b70ce22, 0x5af8cb22)}, + {TOBN(0x7c00018a, 0x829a8180), TOBN(0x84329f93, 0xb81ed295), + TOBN(0x7c343ea2, 0x5f3cea83), TOBN(0x38f8655f, 0x67586536)}}, + {{TOBN(0xa661a0d0, 0x1d3ec517), TOBN(0x98744652, 0x512321ae), + TOBN(0x084ca591, 0xeca92598), TOBN(0xa9bb9dc9, 0x1dcb3feb)}, + {TOBN(0x14c54355, 0x78b4c240), TOBN(0x5ed62a3b, 0x610cafdc), + TOBN(0x07512f37, 0x1b38846b), TOBN(0x571bb70a, 0xb0e38161)}}, + {{TOBN(0xb556b95b, 0x2da705d2), TOBN(0x3ef8ada6, 0xb1a08f98), + TOBN(0x85302ca7, 0xddecfbe5), TOBN(0x0e530573, 0x943105cd)}, + {TOBN(0x60554d55, 0x21a9255d), TOBN(0x63a32fa1, 0xf2f3802a), + TOBN(0x35c8c5b0, 0xcd477875), TOBN(0x97f458ea, 0x6ad42da1)}}, + {{TOBN(0x832d7080, 0xeb6b242d), TOBN(0xd30bd023, 0x3b71e246), + TOBN(0x7027991b, 0xbe31139d), TOBN(0x68797e91, 0x462e4e53)}, + {TOBN(0x423fe20a, 0x6b4e185a), TOBN(0x82f2c67e, 0x42d9b707), + TOBN(0x25c81768, 0x4cf7811b), TOBN(0xbd53005e, 0x045bb95d)}}}, + {{{TOBN(0xe5f649be, 0x9d8e68fd), TOBN(0xdb0f0533, 0x1b044320), + TOBN(0xf6fde9b3, 0xe0c33398), TOBN(0x92f4209b, 0x66c8cfae)}, + {TOBN(0xe9d1afcc, 0x1a739d4b), TOBN(0x09aea75f, 0xa28ab8de), + TOBN(0x14375fb5, 0xeac6f1d0), TOBN(0x6420b560, 0x708f7aa5)}}, + {{TOBN(0x9eae499c, 0x6254dc41), TOBN(0x7e293924, 0x7a837e7e), + TOBN(0x74aec08c, 0x090524a7), TOBN(0xf82b9219, 0x8d6f55f2)}, + {TOBN(0x493c962e, 0x1402cec5), TOBN(0x9f17ca17, 0xfa2f30e7), + TOBN(0xbcd783e8, 0xe9b879cb), TOBN(0xea3d8c14, 0x5a6f145f)}}, + {{TOBN(0xdede15e7, 0x5e0dee6e), TOBN(0x74f24872, 0xdc628aa2), + TOBN(0xd3e9c4fe, 0x7861bb93), TOBN(0x56d4822a, 0x6187b2e0)}, + {TOBN(0xb66417cf, 0xc59826f9), TOBN(0xca260969, 0x2408169e), + TOBN(0xedf69d06, 0xc79ef885), TOBN(0x00031f8a, 0xdc7d138f)}}, + {{TOBN(0x103c46e6, 0x0ebcf726), TOBN(0x4482b831, 0x6231470e), + TOBN(0x6f6dfaca, 0x487c2109), TOBN(0x2e0ace97, 0x62e666ef)}, + {TOBN(0x3246a9d3, 0x1f8d1f42), TOBN(0x1b1e83f1, 0x574944d2), + TOBN(0x13dfa63a, 0xa57f334b), TOBN(0x0cf8daed, 0x9f025d81)}}, + {{TOBN(0x30d78ea8, 0x00ee11c1), TOBN(0xeb053cd4, 0xb5e3dd75), + TOBN(0x9b65b13e, 0xd58c43c5), TOBN(0xc3ad49bd, 0xbd151663)}, + {TOBN(0x99fd8e41, 0xb6427990), TOBN(0x12cf15bd, 0x707eae1e), + TOBN(0x29ad4f1b, 0x1aabb71e), TOBN(0x5143e74d, 0x07545d0e)}}, + {{TOBN(0x30266336, 0xc88bdee1), TOBN(0x25f29306, 0x5876767c), + TOBN(0x9c078571, 0xc6731996), TOBN(0xc88690b2, 0xed552951)}, + {TOBN(0x274f2c2d, 0x852705b4), TOBN(0xb0bf8d44, 0x4e09552d), + TOBN(0x7628beeb, 0x986575d1), TOBN(0x407be238, 0x7f864651)}}, + {{TOBN(0x0e5e3049, 0xa639fc6b), TOBN(0xe75c35d9, 0x86003625), + TOBN(0x0cf35bd8, 0x5dcc1646), TOBN(0x8bcaced2, 0x6c26273a)}, + {TOBN(0xe22ecf1d, 0xb5536742), TOBN(0x013dd897, 0x1a9e068b), + TOBN(0x17f411cb, 0x8a7909c5), TOBN(0x5757ac98, 0x861dd506)}}, + {{TOBN(0x85de1f0d, 0x1e935abb), TOBN(0xdefd10b4, 0x154de37a), + TOBN(0xb8d9e392, 0x369cebb5), TOBN(0x54d5ef9b, 0x761324be)}, + {TOBN(0x4d6341ba, 0x74f17e26), TOBN(0xc0a0e3c8, 0x78c1dde4), + TOBN(0xa6d77581, 0x87d918fd), TOBN(0x66876015, 0x02ca3a13)}}, + {{TOBN(0xc7313e9c, 0xf36658f0), TOBN(0xc433ef1c, 0x71f8057e), + TOBN(0x85326246, 0x1b6a835a), TOBN(0xc8f05398, 0x7c86394c)}, + {TOBN(0xff398cdf, 0xe983c4a1), TOBN(0xbf5e8162, 0x03b7b931), + TOBN(0x93193c46, 0xb7b9045b), TOBN(0x1e4ebf5d, 0xa4a6e46b)}}, + {{TOBN(0xf9942a60, 0x43a24fe7), TOBN(0x29c1191e, 0xffb3492b), + TOBN(0x9f662449, 0x902fde05), TOBN(0xc792a7ac, 0x6713c32d)}, + {TOBN(0x2fd88ad8, 0xb737982c), TOBN(0x7e3a0319, 0xa21e60e3), + TOBN(0x09b0de44, 0x7383591a), TOBN(0x6df141ee, 0x8310a456)}}, + {{TOBN(0xaec1a039, 0xe6d6f471), TOBN(0x14b2ba0f, 0x1198d12e), + TOBN(0xebc1a160, 0x3aeee5ac), TOBN(0x401f4836, 0xe0b964ce)}, + {TOBN(0x2ee43796, 0x4fd03f66), TOBN(0x3fdb4e49, 0xdd8f3f12), + TOBN(0x6ef267f6, 0x29380f18), TOBN(0x3e8e9670, 0x8da64d16)}}, + {{TOBN(0xbc19180c, 0x207674f1), TOBN(0x112e09a7, 0x33ae8fdb), + TOBN(0x99667554, 0x6aaeb71e), TOBN(0x79432af1, 0xe101b1c7)}, + {TOBN(0xd5eb558f, 0xde2ddec6), TOBN(0x81392d1f, 0x5357753f), + TOBN(0xa7a76b97, 0x3ae1158a), TOBN(0x416fbbff, 0x4a899991)}}, + {{TOBN(0x9e65fdfd, 0x0d4a9dcf), TOBN(0x7bc29e48, 0x944ddf12), + TOBN(0xbc1a92d9, 0x3c856866), TOBN(0x273c6905, 0x6e98dfe2)}, + {TOBN(0x69fce418, 0xcdfaa6b8), TOBN(0x606bd823, 0x5061c69f), + TOBN(0x42d495a0, 0x6af75e27), TOBN(0x8ed3d505, 0x6d873a1f)}}, + {{TOBN(0xaf552841, 0x6ab25b6a), TOBN(0xc6c0ffc7, 0x2b1a4523), + TOBN(0xab18827b, 0x21c99e03), TOBN(0x060e8648, 0x9034691b)}, + {TOBN(0x5207f90f, 0x93c7f398), TOBN(0x9f4a96cb, 0x82f8d10b), + TOBN(0xdd71cd79, 0x3ad0f9e3), TOBN(0x84f435d2, 0xfc3a54f5)}}, + {{TOBN(0x4b03c55b, 0x8e33787f), TOBN(0xef42f975, 0xa6384673), + TOBN(0xff7304f7, 0x5051b9f0), TOBN(0x18aca1dc, 0x741c87c2)}, + {TOBN(0x56f120a7, 0x2d4bfe80), TOBN(0xfd823b3d, 0x053e732c), + TOBN(0x11bccfe4, 0x7537ca16), TOBN(0xdf6c9c74, 0x1b5a996b)}}, + {{TOBN(0xee7332c7, 0x904fc3fa), TOBN(0x14a23f45, 0xc7e3636a), + TOBN(0xc38659c3, 0xf091d9aa), TOBN(0x4a995e5d, 0xb12d8540)}, + {TOBN(0x20a53bec, 0xf3a5598a), TOBN(0x56534b17, 0xb1eaa995), + TOBN(0x9ed3dca4, 0xbf04e03c), TOBN(0x716c563a, 0xd8d56268)}}, + {{TOBN(0x27ba77a4, 0x1d6178e7), TOBN(0xe4c80c40, 0x68a1ff8e), + TOBN(0x75011099, 0x0a13f63d), TOBN(0x7bf33521, 0xa61d46f3)}, + {TOBN(0x0aff218e, 0x10b365bb), TOBN(0x81021804, 0x0fd7ea75), + TOBN(0x05a3fd8a, 0xa4b3a925), TOBN(0xb829e75f, 0x9b3db4e6)}}, + {{TOBN(0x6bdc75a5, 0x4d53e5fb), TOBN(0x04a5dc02, 0xd52717e3), + TOBN(0x86af502f, 0xe9a42ec2), TOBN(0x8867e8fb, 0x2630e382)}, + {TOBN(0xbf845c6e, 0xbec9889b), TOBN(0x54f491f2, 0xcb47c98d), + TOBN(0xa3091fba, 0x790c2a12), TOBN(0xd7f6fd78, 0xc20f708b)}}, + {{TOBN(0xa569ac30, 0xacde5e17), TOBN(0xd0f996d0, 0x6852b4d7), + TOBN(0xe51d4bb5, 0x4609ae54), TOBN(0x3fa37d17, 0x0daed061)}, + {TOBN(0x62a88684, 0x34b8fb41), TOBN(0x99a2acbd, 0x9efb64f1), + TOBN(0xb75c1a5e, 0x6448e1f2), TOBN(0xfa99951a, 0x42b5a069)}}, + {{TOBN(0x6d956e89, 0x2f3b26e7), TOBN(0xf4709860, 0xda875247), + TOBN(0x3ad15179, 0x2482dda3), TOBN(0xd64110e3, 0x017d82f0)}, + {TOBN(0x14928d2c, 0xfad414e4), TOBN(0x2b155f58, 0x2ed02b24), + TOBN(0x481a141b, 0xcb821bf1), TOBN(0x12e3c770, 0x4f81f5da)}}, + {{TOBN(0xe49c5de5, 0x9fff8381), TOBN(0x11053232, 0x5bbec894), + TOBN(0xa0d051cc, 0x454d88c4), TOBN(0x4f6db89c, 0x1f8e531b)}, + {TOBN(0x34fe3fd6, 0xca563a44), TOBN(0x7f5c2215, 0x58da8ab9), + TOBN(0x8445016d, 0x9474f0a1), TOBN(0x17d34d61, 0xcb7d8a0a)}}, + {{TOBN(0x8e9d3910, 0x1c474019), TOBN(0xcaff2629, 0xd52ceefb), + TOBN(0xf9cf3e32, 0xc1622c2b), TOBN(0xd4b95e3c, 0xe9071a05)}, + {TOBN(0xfbbca61f, 0x1594438c), TOBN(0x1eb6e6a6, 0x04aadedf), + TOBN(0x853027f4, 0x68e14940), TOBN(0x221d322a, 0xdfabda9c)}}, + {{TOBN(0xed8ea9f6, 0xb7cb179a), TOBN(0xdc7b764d, 0xb7934dcc), + TOBN(0xfcb13940, 0x5e09180d), TOBN(0x6629a6bf, 0xb47dc2dd)}, + {TOBN(0xbfc55e4e, 0x9f5a915e), TOBN(0xb1db9d37, 0x6204441e), + TOBN(0xf82d68cf, 0x930c5f53), TOBN(0x17d3a142, 0xcbb605b1)}}, + {{TOBN(0xdd5944ea, 0x308780f2), TOBN(0xdc8de761, 0x3845f5e4), + TOBN(0x6beaba7d, 0x7624d7a3), TOBN(0x1e709afd, 0x304df11e)}, + {TOBN(0x95364376, 0x02170456), TOBN(0xbf204b3a, 0xc8f94b64), + TOBN(0x4e53af7c, 0x5680ca68), TOBN(0x0526074a, 0xe0c67574)}}, + {{TOBN(0x95d8cef8, 0xecd92af6), TOBN(0xe6b9fa7a, 0x6cd1745a), + TOBN(0x3d546d3d, 0xa325c3e4), TOBN(0x1f57691d, 0x9ae93aae)}, + {TOBN(0xe891f3fe, 0x9d2e1a33), TOBN(0xd430093f, 0xac063d35), + TOBN(0xeda59b12, 0x5513a327), TOBN(0xdc2134f3, 0x5536f18f)}}, + {{TOBN(0xaa51fe2c, 0x5c210286), TOBN(0x3f68aaee, 0x1cab658c), + TOBN(0x5a23a00b, 0xf9357292), TOBN(0x9a626f39, 0x7efdabed)}, + {TOBN(0xfe2b3bf3, 0x199d78e3), TOBN(0xb7a2af77, 0x71bbc345), + TOBN(0x3d19827a, 0x1e59802c), TOBN(0x823bbc15, 0xb487a51c)}}, + {{TOBN(0x856139f2, 0x99d0a422), TOBN(0x9ac3df65, 0xf456c6fb), + TOBN(0xaddf65c6, 0x701f8bd6), TOBN(0x149f321e, 0x3758df87)}, + {TOBN(0xb1ecf714, 0x721b7eba), TOBN(0xe17df098, 0x31a3312a), + TOBN(0xdb2fd6ec, 0xd5c4d581), TOBN(0xfd02996f, 0x8fcea1b3)}}, + {{TOBN(0xe29fa63e, 0x7882f14f), TOBN(0xc9f6dc35, 0x07c6cadc), + TOBN(0x46f22d6f, 0xb882bed0), TOBN(0x1a45755b, 0xd118e52c)}, + {TOBN(0x9f2c7c27, 0x7c4608cf), TOBN(0x7ccbdf32, 0x568012c2), + TOBN(0xfcb0aedd, 0x61729b0e), TOBN(0x7ca2ca9e, 0xf7d75dbf)}}, + {{TOBN(0xf58fecb1, 0x6f640f62), TOBN(0xe274b92b, 0x39f51946), + TOBN(0x7f4dfc04, 0x6288af44), TOBN(0x0a91f32a, 0xeac329e5)}, + {TOBN(0x43ad274b, 0xd6aaba31), TOBN(0x719a1640, 0x0f6884f9), + TOBN(0x685d29f6, 0xdaf91e20), TOBN(0x5ec1cc33, 0x27e49d52)}}, + {{TOBN(0x38f4de96, 0x3b54a059), TOBN(0x0e0015e5, 0xefbcfdb3), + TOBN(0x177d23d9, 0x4dbb8da6), TOBN(0x98724aa2, 0x97a617ad)}, + {TOBN(0x30f0885b, 0xfdb6558e), TOBN(0xf9f7a28a, 0xc7899a96), + TOBN(0xd2ae8ac8, 0x872dc112), TOBN(0xfa0642ca, 0x73c3c459)}}, + {{TOBN(0x15296981, 0xe7dfc8d6), TOBN(0x67cd4450, 0x1fb5b94a), + TOBN(0x0ec71cf1, 0x0eddfd37), TOBN(0xc7e5eeb3, 0x9a8eddc7)}, + {TOBN(0x02ac8e3d, 0x81d95028), TOBN(0x0088f172, 0x70b0e35d), + TOBN(0xec041fab, 0xe1881fe3), TOBN(0x62cf71b8, 0xd99e7faa)}}, + {{TOBN(0x5043dea7, 0xe0f222c2), TOBN(0x309d42ac, 0x72e65142), + TOBN(0x94fe9ddd, 0x9216cd30), TOBN(0xd6539c7d, 0x0f87feec)}, + {TOBN(0x03c5a57c, 0x432ac7d7), TOBN(0x72692cf0, 0x327fda10), + TOBN(0xec28c85f, 0x280698de), TOBN(0x2331fb46, 0x7ec283b1)}}, + {{TOBN(0xd34bfa32, 0x2867e633), TOBN(0x78709a82, 0x0a9cc815), + TOBN(0xb7fe6964, 0x875e2fa5), TOBN(0x25cc064f, 0x9e98bfb5)}, + {TOBN(0x9eb0151c, 0x493a65c5), TOBN(0x5fb5d941, 0x53182464), + TOBN(0x69e6f130, 0xf04618e2), TOBN(0xa8ecec22, 0xf89c8ab6)}}, + {{TOBN(0xcd6ac88b, 0xb96209bd), TOBN(0x65fa8cdb, 0xb3e1c9e0), + TOBN(0xa47d22f5, 0x4a8d8eac), TOBN(0x83895cdf, 0x8d33f963)}, + {TOBN(0xa8adca59, 0xb56cd3d1), TOBN(0x10c8350b, 0xdaf38232), + TOBN(0x2b161fb3, 0xa5080a9f), TOBN(0xbe7f5c64, 0x3af65b3a)}}, + {{TOBN(0x2c754039, 0x97403a11), TOBN(0x94626cf7, 0x121b96af), + TOBN(0x431de7c4, 0x6a983ec2), TOBN(0x3780dd3a, 0x52cc3df7)}, + {TOBN(0xe28a0e46, 0x2baf8e3b), TOBN(0xabe68aad, 0x51d299ae), + TOBN(0x603eb8f9, 0x647a2408), TOBN(0x14c61ed6, 0x5c750981)}}, + {{TOBN(0x88b34414, 0xc53352e7), TOBN(0x5a34889c, 0x1337d46e), + TOBN(0x612c1560, 0xf95f2bc8), TOBN(0x8a3f8441, 0xd4807a3a)}, + {TOBN(0x680d9e97, 0x5224da68), TOBN(0x60cd6e88, 0xc3eb00e9), + TOBN(0x3875a98e, 0x9a6bc375), TOBN(0xdc80f924, 0x4fd554c2)}}, + {{TOBN(0x6c4b3415, 0x6ac77407), TOBN(0xa1e5ea8f, 0x25420681), + TOBN(0x541bfa14, 0x4607a458), TOBN(0x5dbc7e7a, 0x96d7fbf9)}, + {TOBN(0x646a851b, 0x31590a47), TOBN(0x039e85ba, 0x15ee6df8), + TOBN(0xd19fa231, 0xd7b43fc0), TOBN(0x84bc8be8, 0x299a0e04)}}, + {{TOBN(0x2b9d2936, 0xf20df03a), TOBN(0x24054382, 0x8608d472), + TOBN(0x76b6ba04, 0x9149202a), TOBN(0xb21c3831, 0x3670e7b7)}, + {TOBN(0xddd93059, 0xd6fdee10), TOBN(0x9da47ad3, 0x78488e71), + TOBN(0x99cc1dfd, 0xa0fcfb25), TOBN(0x42abde10, 0x64696954)}}, + {{TOBN(0x14cc15fc, 0x17eab9fe), TOBN(0xd6e863e4, 0xd3e70972), + TOBN(0x29a7765c, 0x6432112c), TOBN(0x88660001, 0x5b0774d8)}, + {TOBN(0x3729175a, 0x2c088eae), TOBN(0x13afbcae, 0x8230b8d4), + TOBN(0x44768151, 0x915f4379), TOBN(0xf086431a, 0xd8d22812)}}, + {{TOBN(0x37461955, 0xc298b974), TOBN(0x905fb5f0, 0xf8711e04), + TOBN(0x787abf3a, 0xfe969d18), TOBN(0x392167c2, 0x6f6a494e)}, + {TOBN(0xfc7a0d2d, 0x28c511da), TOBN(0xf127c7dc, 0xb66a262d), + TOBN(0xf9c4bb95, 0xfd63fdf0), TOBN(0x90016589, 0x3913ef46)}}, + {{TOBN(0x74d2a73c, 0x11aa600d), TOBN(0x2f5379bd, 0x9fb5ab52), + TOBN(0xe49e53a4, 0x7fb70068), TOBN(0x68dd39e5, 0x404aa9a7)}, + {TOBN(0xb9b0cf57, 0x2ecaa9c3), TOBN(0xba0e103b, 0xe824826b), + TOBN(0x60c2198b, 0x4631a3c4), TOBN(0xc5ff84ab, 0xfa8966a2)}}, + {{TOBN(0x2d6ebe22, 0xac95aff8), TOBN(0x1c9bb6db, 0xb5a46d09), + TOBN(0x419062da, 0x53ee4f8d), TOBN(0x7b9042d0, 0xbb97efef)}, + {TOBN(0x0f87f080, 0x830cf6bd), TOBN(0x4861d19a, 0x6ec8a6c6), + TOBN(0xd3a0daa1, 0x202f01aa), TOBN(0xb0111674, 0xf25afbd5)}}, + {{TOBN(0x6d00d6cf, 0x1afb20d9), TOBN(0x13695000, 0x40671bc5), + TOBN(0x913ab0dc, 0x2485ea9b), TOBN(0x1f2bed06, 0x9eef61ac)}, + {TOBN(0x850c8217, 0x6d799e20), TOBN(0x93415f37, 0x3271c2de), + TOBN(0x5afb06e9, 0x6c4f5910), TOBN(0x688a52df, 0xc4e9e421)}}, + {{TOBN(0x30495ba3, 0xe2a9a6db), TOBN(0x4601303d, 0x58f9268b), + TOBN(0xbe3b0dad, 0x7eb0f04f), TOBN(0x4ea47250, 0x4456936d)}, + {TOBN(0x8caf8798, 0xd33fd3e7), TOBN(0x1ccd8a89, 0xeb433708), + TOBN(0x9effe3e8, 0x87fd50ad), TOBN(0xbe240a56, 0x6b29c4df)}}, + {{TOBN(0xec4ffd98, 0xca0e7ebd), TOBN(0xf586783a, 0xe748616e), + TOBN(0xa5b00d8f, 0xc77baa99), TOBN(0x0acada29, 0xb4f34c9c)}, + {TOBN(0x36dad67d, 0x0fe723ac), TOBN(0x1d8e53a5, 0x39c36c1e), + TOBN(0xe4dd342d, 0x1f4bea41), TOBN(0x64fd5e35, 0xebc9e4e0)}}, + {{TOBN(0x96f01f90, 0x57908805), TOBN(0xb5b9ea3d, 0x5ed480dd), + TOBN(0x366c5dc2, 0x3efd2dd0), TOBN(0xed2fe305, 0x6e9dfa27)}, + {TOBN(0x4575e892, 0x6e9197e2), TOBN(0x11719c09, 0xab502a5d), + TOBN(0x264c7bec, 0xe81f213f), TOBN(0x741b9241, 0x55f5c457)}}, + {{TOBN(0x78ac7b68, 0x49a5f4f4), TOBN(0xf91d70a2, 0x9fc45b7d), + TOBN(0x39b05544, 0xb0f5f355), TOBN(0x11f06bce, 0xeef930d9)}, + {TOBN(0xdb84d25d, 0x038d05e1), TOBN(0x04838ee5, 0xbacc1d51), + TOBN(0x9da3ce86, 0x9e8ee00b), TOBN(0xc3412057, 0xc36eda1f)}}, + {{TOBN(0xae80b913, 0x64d9c2f4), TOBN(0x7468bac3, 0xa010a8ff), + TOBN(0xdfd20037, 0x37359d41), TOBN(0x1a0f5ab8, 0x15efeacc)}, + {TOBN(0x7c25ad2f, 0x659d0ce0), TOBN(0x4011bcbb, 0x6785cff1), + TOBN(0x128b9912, 0x7e2192c7), TOBN(0xa549d8e1, 0x13ccb0e8)}}, + {{TOBN(0x805588d8, 0xc85438b1), TOBN(0x5680332d, 0xbc25cb27), + TOBN(0xdcd1bc96, 0x1a4bfdf4), TOBN(0x779ff428, 0x706f6566)}, + {TOBN(0x8bbee998, 0xf059987a), TOBN(0xf6ce8cf2, 0xcc686de7), + TOBN(0xf8ad3c4a, 0x953cfdb2), TOBN(0xd1d426d9, 0x2205da36)}}, + {{TOBN(0xb3c0f13f, 0xc781a241), TOBN(0x3e89360e, 0xd75362a8), + TOBN(0xccd05863, 0xc8a91184), TOBN(0x9bd0c9b7, 0xefa8a7f4)}, + {TOBN(0x97ee4d53, 0x8a912a4b), TOBN(0xde5e15f8, 0xbcf518fd), + TOBN(0x6a055bf8, 0xc467e1e0), TOBN(0x10be4b4b, 0x1587e256)}}, + {{TOBN(0xd90c14f2, 0x668621c9), TOBN(0xd5518f51, 0xab9c92c1), + TOBN(0x8e6a0100, 0xd6d47b3c), TOBN(0xcbe980dd, 0x66716175)}, + {TOBN(0x500d3f10, 0xddd83683), TOBN(0x3b6cb35d, 0x99cac73c), + TOBN(0x53730c8b, 0x6083d550), TOBN(0xcf159767, 0xdf0a1987)}}, + {{TOBN(0x84bfcf53, 0x43ad73b3), TOBN(0x1b528c20, 0x4f035a94), + TOBN(0x4294edf7, 0x33eeac69), TOBN(0xb6283e83, 0x817f3240)}, + {TOBN(0xc3fdc959, 0x0a5f25b1), TOBN(0xefaf8aa5, 0x5844ee22), + TOBN(0xde269ba5, 0xdbdde4de), TOBN(0xe3347160, 0xc56133bf)}}, + {{TOBN(0xc1184219, 0x8d9ea9f8), TOBN(0x090de5db, 0xf3fc1ab5), + TOBN(0x404c37b1, 0x0bf22cda), TOBN(0x7de20ec8, 0xf5618894)}, + {TOBN(0x754c588e, 0xecdaecab), TOBN(0x6ca4b0ed, 0x88342743), + TOBN(0x76f08bdd, 0xf4a938ec), TOBN(0xd182de89, 0x91493ccb)}}, + {{TOBN(0xd652c53e, 0xc8a4186a), TOBN(0xb3e878db, 0x946d8e33), + TOBN(0x088453c0, 0x5f37663c), TOBN(0x5cd9daaa, 0xb407748b)}, + {TOBN(0xa1f5197f, 0x586d5e72), TOBN(0x47500be8, 0xc443ca59), + TOBN(0x78ef35b2, 0xe2652424), TOBN(0x09c5d26f, 0x6dd7767d)}}, + {{TOBN(0x7175a79a, 0xa74d3f7b), TOBN(0x0428fd8d, 0xcf5ea459), + TOBN(0x511cb97c, 0xa5d1746d), TOBN(0x36363939, 0xe71d1278)}, + {TOBN(0xcf2df955, 0x10350bf4), TOBN(0xb3817439, 0x60aae782), + TOBN(0xa748c0e4, 0x3e688809), TOBN(0x98021fbf, 0xd7a5a006)}}, + {{TOBN(0x9076a70c, 0x0e367a98), TOBN(0xbea1bc15, 0x0f62b7c2), + TOBN(0x2645a68c, 0x30fe0343), TOBN(0xacaffa78, 0x699dc14f)}, + {TOBN(0xf4469964, 0x457bf9c4), TOBN(0x0db6407b, 0x0d2ead83), + TOBN(0x68d56cad, 0xb2c6f3eb), TOBN(0x3b512e73, 0xf376356c)}}, + {{TOBN(0xe43b0e1f, 0xfce10408), TOBN(0x89ddc003, 0x5a5e257d), + TOBN(0xb0ae0d12, 0x0362e5b3), TOBN(0x07f983c7, 0xb0519161)}, + {TOBN(0xc2e94d15, 0x5d5231e7), TOBN(0xcff22aed, 0x0b4f9513), + TOBN(0xb02588dd, 0x6ad0b0b5), TOBN(0xb967d1ac, 0x11d0dcd5)}}, + {{TOBN(0x8dac6bc6, 0xcf777b6c), TOBN(0x0062bdbd, 0x4c6d1959), + TOBN(0x53da71b5, 0x0ef5cc85), TOBN(0x07012c7d, 0x4006f14f)}, + {TOBN(0x4617f962, 0xac47800d), TOBN(0x53365f2b, 0xc102ed75), + TOBN(0xb422efcb, 0x4ab8c9d3), TOBN(0x195cb26b, 0x34af31c9)}}, + {{TOBN(0x3a926e29, 0x05f2c4ce), TOBN(0xbd2bdecb, 0x9856966c), + TOBN(0x5d16ab3a, 0x85527015), TOBN(0x9f81609e, 0x4486c231)}, + {TOBN(0xd8b96b2c, 0xda350002), TOBN(0xbd054690, 0xfa1b7d36), + TOBN(0xdc90ebf5, 0xe71d79bc), TOBN(0xf241b6f9, 0x08964e4e)}}, + {{TOBN(0x7c838643, 0x2fe3cd4c), TOBN(0xe0f33acb, 0xb4bc633c), + TOBN(0xb4a9ecec, 0x3d139f1f), TOBN(0x05ce69cd, 0xdc4a1f49)}, + {TOBN(0xa19d1b16, 0xf5f98aaf), TOBN(0x45bb71d6, 0x6f23e0ef), + TOBN(0x33789fcd, 0x46cdfdd3), TOBN(0x9b8e2978, 0xcee040ca)}}, + {{TOBN(0x9c69b246, 0xae0a6828), TOBN(0xba533d24, 0x7078d5aa), + TOBN(0x7a2e42c0, 0x7bb4fbdb), TOBN(0xcfb4879a, 0x7035385c)}, + {TOBN(0x8c3dd30b, 0x3281705b), TOBN(0x7e361c6c, 0x404fe081), + TOBN(0x7b21649c, 0x3f604edf), TOBN(0x5dbf6a3f, 0xe52ffe47)}}, + {{TOBN(0xc41b7c23, 0x4b54d9bf), TOBN(0x1374e681, 0x3511c3d9), + TOBN(0x1863bf16, 0xc1b2b758), TOBN(0x90e78507, 0x1e9e6a96)}, + {TOBN(0xab4bf98d, 0x5d86f174), TOBN(0xd74e0bd3, 0x85e96fe4), + TOBN(0x8afde39f, 0xcac5d344), TOBN(0x90946dbc, 0xbd91b847)}}, + {{TOBN(0xf5b42358, 0xfe1a838c), TOBN(0x05aae6c5, 0x620ac9d8), + TOBN(0x8e193bd8, 0xa1ce5a0b), TOBN(0x8f710571, 0x4dabfd72)}, + {TOBN(0x8d8fdd48, 0x182caaac), TOBN(0x8c4aeefa, 0x040745cf), + TOBN(0x73c6c30a, 0xf3b93e6d), TOBN(0x991241f3, 0x16f42011)}}, + {{TOBN(0xa0158eea, 0xe457a477), TOBN(0xd19857db, 0xee6ddc05), + TOBN(0xb3265224, 0x18c41671), TOBN(0x3ffdfc7e, 0x3c2c0d58)}, + {TOBN(0x3a3a5254, 0x26ee7cda), TOBN(0x341b0869, 0xdf02c3a8), + TOBN(0xa023bf42, 0x723bbfc8), TOBN(0x3d15002a, 0x14452691)}}}, + {{{TOBN(0x5ef7324c, 0x85edfa30), TOBN(0x25976554, 0x87d4f3da), + TOBN(0x352f5bc0, 0xdcb50c86), TOBN(0x8f6927b0, 0x4832a96c)}, + {TOBN(0xd08ee1ba, 0x55f2f94c), TOBN(0x6a996f99, 0x344b45fa), + TOBN(0xe133cb8d, 0xa8aa455d), TOBN(0x5d0721ec, 0x758dc1f7)}}, + {{TOBN(0x6ba7a920, 0x79e5fb67), TOBN(0xe1331feb, 0x70aa725e), + TOBN(0x5080ccf5, 0x7df5d837), TOBN(0xe4cae01d, 0x7ff72e21)}, + {TOBN(0xd9243ee6, 0x0412a77d), TOBN(0x06ff7cac, 0xdf449025), + TOBN(0xbe75f7cd, 0x23ef5a31), TOBN(0xbc957822, 0x0ddef7a8)}}, + {{TOBN(0x8cf7230c, 0xb0ce1c55), TOBN(0x5b534d05, 0x0bbfb607), + TOBN(0xee1ef113, 0x0e16363b), TOBN(0x27e0aa7a, 0xb4999e82)}, + {TOBN(0xce1dac2d, 0x79362c41), TOBN(0x67920c90, 0x91bb6cb0), + TOBN(0x1e648d63, 0x2223df24), TOBN(0x0f7d9eef, 0xe32e8f28)}}, + {{TOBN(0x6943f39a, 0xfa833834), TOBN(0x22951722, 0xa6328562), + TOBN(0x81d63dd5, 0x4170fc10), TOBN(0x9f5fa58f, 0xaecc2e6d)}, + {TOBN(0xb66c8725, 0xe77d9a3b), TOBN(0x11235cea, 0x6384ebe0), + TOBN(0x06a8c118, 0x5845e24a), TOBN(0x0137b286, 0xebd093b1)}}, + {{TOBN(0xc589e1ce, 0x44ace150), TOBN(0xe0f8d3d9, 0x4381e97c), + TOBN(0x59e99b11, 0x62c5a4b8), TOBN(0x90d262f7, 0xfd0ec9f9)}, + {TOBN(0xfbc854c9, 0x283e13c9), TOBN(0x2d04fde7, 0xaedc7085), + TOBN(0x057d7765, 0x47dcbecb), TOBN(0x8dbdf591, 0x9a76fa5f)}}, + {{TOBN(0xd0150695, 0x0de1e578), TOBN(0x2e1463e7, 0xe9f72bc6), + TOBN(0xffa68441, 0x1b39eca5), TOBN(0x673c8530, 0x7c037f2f)}, + {TOBN(0xd0d6a600, 0x747f91da), TOBN(0xb08d43e1, 0xc9cb78e9), + TOBN(0x0fc0c644, 0x27b5cef5), TOBN(0x5c1d160a, 0xa60a2fd6)}}, + {{TOBN(0xf98cae53, 0x28c8e13b), TOBN(0x375f10c4, 0xb2eddcd1), + TOBN(0xd4eb8b7f, 0x5cce06ad), TOBN(0xb4669f45, 0x80a2e1ef)}, + {TOBN(0xd593f9d0, 0x5bbd8699), TOBN(0x5528a4c9, 0xe7976d13), + TOBN(0x3923e095, 0x1c7e28d3), TOBN(0xb9293790, 0x3f6bb577)}}, + {{TOBN(0xdb567d6a, 0xc42bd6d2), TOBN(0x6df86468, 0xbb1f96ae), + TOBN(0x0efe5b1a, 0x4843b28e), TOBN(0x961bbb05, 0x6379b240)}, + {TOBN(0xb6caf5f0, 0x70a6a26b), TOBN(0x70686c0d, 0x328e6e39), + TOBN(0x80da06cf, 0x895fc8d3), TOBN(0x804d8810, 0xb363fdc9)}}, + {{TOBN(0xbe22877b, 0x207f1670), TOBN(0x9b0dd188, 0x4e615291), + TOBN(0x625ae8dc, 0x97a3c2bf), TOBN(0x08584ef7, 0x439b86e8)}, + {TOBN(0xde7190a5, 0xdcd898ff), TOBN(0x26286c40, 0x2058ee3d), + TOBN(0x3db0b217, 0x5f87b1c1), TOBN(0xcc334771, 0x102a6db5)}}, + {{TOBN(0xd99de954, 0x2f770fb1), TOBN(0x97c1c620, 0x4cd7535e), + TOBN(0xd3b6c448, 0x3f09cefc), TOBN(0xd725af15, 0x5a63b4f8)}, + {TOBN(0x0c95d24f, 0xc01e20ec), TOBN(0xdfd37494, 0x9ae7121f), + TOBN(0x7d6ddb72, 0xec77b7ec), TOBN(0xfe079d3b, 0x0353a4ae)}}, + {{TOBN(0x3066e70a, 0x2e6ac8d2), TOBN(0x9c6b5a43, 0x106e5c05), + TOBN(0x52d3c6f5, 0xede59b8c), TOBN(0x30d6a5c3, 0xfccec9ae)}, + {TOBN(0xedec7c22, 0x4fc0a9ef), TOBN(0x190ff083, 0x95c16ced), + TOBN(0xbe12ec8f, 0x94de0fde), TOBN(0x0d131ab8, 0x852d3433)}}, + {{TOBN(0x42ace07e, 0x85701291), TOBN(0x94793ed9, 0x194061a8), + TOBN(0x30e83ed6, 0xd7f4a485), TOBN(0x9eec7269, 0xf9eeff4d)}, + {TOBN(0x90acba59, 0x0c9d8005), TOBN(0x5feca458, 0x1e79b9d1), + TOBN(0x8fbe5427, 0x1d506a1e), TOBN(0xa32b2c8e, 0x2439cfa7)}}, + {{TOBN(0x1671c173, 0x73dd0b4e), TOBN(0x37a28214, 0x44a054c6), + TOBN(0x81760a1b, 0x4e8b53f1), TOBN(0xa6c04224, 0xf9f93b9e)}, + {TOBN(0x18784b34, 0xcf671e3c), TOBN(0x81bbecd2, 0xcda9b994), + TOBN(0x38831979, 0xb2ab3848), TOBN(0xef54feb7, 0xf2e03c2d)}}, + {{TOBN(0xcf197ca7, 0xfb8088fa), TOBN(0x01427247, 0x4ddc96c5), + TOBN(0xa2d2550a, 0x30777176), TOBN(0x53469898, 0x4d0cf71d)}, + {TOBN(0x6ce937b8, 0x3a2aaac6), TOBN(0xe9f91dc3, 0x5af38d9b), + TOBN(0x2598ad83, 0xc8bf2899), TOBN(0x8e706ac9, 0xb5536c16)}}, + {{TOBN(0x40dc7495, 0xf688dc98), TOBN(0x26490cd7, 0x124c4afc), + TOBN(0xe651ec84, 0x1f18775c), TOBN(0x393ea6c3, 0xb4fdaf4a)}, + {TOBN(0x1e1f3343, 0x7f338e0d), TOBN(0x39fb832b, 0x6053e7b5), + TOBN(0x46e702da, 0x619e14d5), TOBN(0x859cacd1, 0xcdeef6e0)}}, + {{TOBN(0x63b99ce7, 0x4462007d), TOBN(0xb8ab48a5, 0x4cb5f5b7), + TOBN(0x9ec673d2, 0xf55edde7), TOBN(0xd1567f74, 0x8cfaefda)}, + {TOBN(0x46381b6b, 0x0887bcec), TOBN(0x694497ce, 0xe178f3c2), + TOBN(0x5e6525e3, 0x1e6266cb), TOBN(0x5931de26, 0x697d6413)}}, + {{TOBN(0x87f8df7c, 0x0e58d493), TOBN(0xb1ae5ed0, 0x58b73f12), + TOBN(0xc368f784, 0xdea0c34d), TOBN(0x9bd0a120, 0x859a91a0)}, + {TOBN(0xb00d88b7, 0xcc863c68), TOBN(0x3a1cc11e, 0x3d1f4d65), + TOBN(0xea38e0e7, 0x0aa85593), TOBN(0x37f13e98, 0x7dc4aee8)}}, + {{TOBN(0x10d38667, 0xbc947bad), TOBN(0x738e07ce, 0x2a36ee2e), + TOBN(0xc93470cd, 0xc577fcac), TOBN(0xdee1b616, 0x2782470d)}, + {TOBN(0x36a25e67, 0x2e793d12), TOBN(0xd6aa6cae, 0xe0f186da), + TOBN(0x474d0fd9, 0x80e07af7), TOBN(0xf7cdc47d, 0xba8a5cd4)}}, + {{TOBN(0x28af6d9d, 0xab15247f), TOBN(0x7c789c10, 0x493a537f), + TOBN(0x7ac9b110, 0x23a334e7), TOBN(0x0236ac09, 0x12c9c277)}, + {TOBN(0xa7e5bd25, 0x1d7a5144), TOBN(0x098b9c2a, 0xf13ec4ec), + TOBN(0x3639daca, 0xd3f0abca), TOBN(0x642da81a, 0xa23960f9)}}, + {{TOBN(0x7d2e5c05, 0x4f7269b1), TOBN(0xfcf30777, 0xe287c385), + TOBN(0x10edc84f, 0xf2a46f21), TOBN(0x35441757, 0x4f43fa36)}, + {TOBN(0xf1327899, 0xfd703431), TOBN(0xa438d7a6, 0x16dd587a), + TOBN(0x65c34c57, 0xe9c8352d), TOBN(0xa728edab, 0x5cc5a24e)}}, + {{TOBN(0xaed78abc, 0x42531689), TOBN(0x0a51a0e8, 0x010963ef), + TOBN(0x5776fa0a, 0xd717d9b3), TOBN(0xf356c239, 0x7dd3428b)}, + {TOBN(0x29903fff, 0x8d3a3dac), TOBN(0x409597fa, 0x3d94491f), + TOBN(0x4cd7a5ff, 0xbf4a56a4), TOBN(0xe5096474, 0x8adab462)}}, + {{TOBN(0xa97b5126, 0x5c3427b0), TOBN(0x6401405c, 0xd282c9bd), + TOBN(0x3629f8d7, 0x222c5c45), TOBN(0xb1c02c16, 0xe8d50aed)}, + {TOBN(0xbea2ed75, 0xd9635bc9), TOBN(0x226790c7, 0x6e24552f), + TOBN(0x3c33f2a3, 0x65f1d066), TOBN(0x2a43463e, 0x6dfccc2e)}}, + {{TOBN(0x8cc3453a, 0xdb483761), TOBN(0xe7cc6085, 0x65d5672b), + TOBN(0x277ed6cb, 0xde3efc87), TOBN(0x19f2f368, 0x69234eaf)}, + {TOBN(0x9aaf4317, 0x5c0b800b), TOBN(0x1f1e7c89, 0x8b6da6e2), + TOBN(0x6cfb4715, 0xb94ec75e), TOBN(0xd590dd5f, 0x453118c2)}}, + {{TOBN(0x14e49da1, 0x1f17a34c), TOBN(0x5420ab39, 0x235a1456), + TOBN(0xb7637241, 0x2f50363b), TOBN(0x7b15d623, 0xc3fabb6e)}, + {TOBN(0xa0ef40b1, 0xe274e49c), TOBN(0x5cf50744, 0x96b1860a), + TOBN(0xd6583fbf, 0x66afe5a4), TOBN(0x44240510, 0xf47e3e9a)}}, + {{TOBN(0x99254343, 0x11b2d595), TOBN(0xf1367499, 0xeec8df57), + TOBN(0x3cb12c61, 0x3e73dd05), TOBN(0xd248c033, 0x7dac102a)}, + {TOBN(0xcf154f13, 0xa77739f5), TOBN(0xbf4288cb, 0x23d2af42), + TOBN(0xaa64c9b6, 0x32e4a1cf), TOBN(0xee8c07a8, 0xc8a208f3)}}, + {{TOBN(0xe10d4999, 0x6fe8393f), TOBN(0x0f809a3f, 0xe91f3a32), + TOBN(0x61096d1c, 0x802f63c8), TOBN(0x289e1462, 0x57750d3d)}, + {TOBN(0xed06167e, 0x9889feea), TOBN(0xd5c9c0e2, 0xe0993909), + TOBN(0x46fca0d8, 0x56508ac6), TOBN(0x91826047, 0x4f1b8e83)}}, + {{TOBN(0x4f2c877a, 0x9a4a2751), TOBN(0x71bd0072, 0xcae6fead), + TOBN(0x38df8dcc, 0x06aa1941), TOBN(0x5a074b4c, 0x63beeaa8)}, + {TOBN(0xd6d65934, 0xc1cec8ed), TOBN(0xa6ecb49e, 0xaabc03bd), + TOBN(0xaade91c2, 0xde8a8415), TOBN(0xcfb0efdf, 0x691136e0)}}, + {{TOBN(0x11af45ee, 0x23ab3495), TOBN(0xa132df88, 0x0b77463d), + TOBN(0x8923c15c, 0x815d06f4), TOBN(0xc3ceb3f5, 0x0d61a436)}, + {TOBN(0xaf52291d, 0xe88fb1da), TOBN(0xea057974, 0x1da12179), + TOBN(0xb0d7218c, 0xd2fef720), TOBN(0x6c0899c9, 0x8e1d8845)}}, + {{TOBN(0x98157504, 0x752ddad7), TOBN(0xd60bd74f, 0xa1a68a97), + TOBN(0x7047a3a9, 0xf658fb99), TOBN(0x1f5d86d6, 0x5f8511e4)}, + {TOBN(0xb8a4bc42, 0x4b5a6d88), TOBN(0x69eb2c33, 0x1abefa7d), + TOBN(0x95bf39e8, 0x13c9c510), TOBN(0xf571960a, 0xd48aab43)}}, + {{TOBN(0x7e8cfbcf, 0x704e23c6), TOBN(0xc71b7d22, 0x28aaa65b), + TOBN(0xa041b2bd, 0x245e3c83), TOBN(0x69b98834, 0xd21854ff)}, + {TOBN(0x89d227a3, 0x963bfeec), TOBN(0x99947aaa, 0xde7da7cb), + TOBN(0x1d9ee9db, 0xee68a9b1), TOBN(0x0a08f003, 0x698ec368)}}, + {{TOBN(0xe9ea4094, 0x78ef2487), TOBN(0xc8d2d415, 0x02cfec26), + TOBN(0xc52f9a6e, 0xb7dcf328), TOBN(0x0ed489e3, 0x85b6a937)}, + {TOBN(0x9b94986b, 0xbef3366e), TOBN(0x0de59c70, 0xedddddb8), + TOBN(0xffdb748c, 0xeadddbe2), TOBN(0x9b9784bb, 0x8266ea40)}}, + {{TOBN(0x142b5502, 0x1a93507a), TOBN(0xb4cd1187, 0x8d3c06cf), + TOBN(0xdf70e76a, 0x91ec3f40), TOBN(0x484e81ad, 0x4e7553c2)}, + {TOBN(0x830f87b5, 0x272e9d6e), TOBN(0xea1c93e5, 0xc6ff514a), + TOBN(0x67cc2adc, 0xc4192a8e), TOBN(0xc77e27e2, 0x42f4535a)}}, + {{TOBN(0x9cdbab36, 0xd2b713c5), TOBN(0x86274ea0, 0xcf7b0cd3), + TOBN(0x784680f3, 0x09af826b), TOBN(0xbfcc837a, 0x0c72dea3)}, + {TOBN(0xa8bdfe9d, 0xd6529b73), TOBN(0x708aa228, 0x63a88002), + TOBN(0x6c7a9a54, 0xc91d45b9), TOBN(0xdf1a38bb, 0xfd004f56)}}, + {{TOBN(0x2e8c9a26, 0xb8bad853), TOBN(0x2d52cea3, 0x3723eae7), + TOBN(0x054d6d81, 0x56ca2830), TOBN(0xa3317d14, 0x9a8dc411)}, + {TOBN(0xa08662fe, 0xfd4ddeda), TOBN(0xed2a153a, 0xb55d792b), + TOBN(0x7035c16a, 0xbfc6e944), TOBN(0xb6bc5834, 0x00171cf3)}}, + {{TOBN(0xe27152b3, 0x83d102b6), TOBN(0xfe695a47, 0x0646b848), + TOBN(0xa5bb09d8, 0x916e6d37), TOBN(0xb4269d64, 0x0d17015e)}, + {TOBN(0x8d8156a1, 0x0a1d2285), TOBN(0xfeef6c51, 0x46d26d72), + TOBN(0x9dac57c8, 0x4c5434a7), TOBN(0x0282e5be, 0x59d39e31)}}, + {{TOBN(0xedfff181, 0x721c486d), TOBN(0x301baf10, 0xbc58824e), + TOBN(0x8136a6aa, 0x00570031), TOBN(0x55aaf78c, 0x1cddde68)}, + {TOBN(0x26829371, 0x59c63952), TOBN(0x3a3bd274, 0x8bc25baf), + TOBN(0xecdf8657, 0xb7e52dc3), TOBN(0x2dd8c087, 0xfd78e6c8)}}, + {{TOBN(0x20553274, 0xf5531461), TOBN(0x8b4a1281, 0x5d95499b), + TOBN(0xe2c8763a, 0x1a80f9d2), TOBN(0xd1dbe32b, 0x4ddec758)}, + {TOBN(0xaf12210d, 0x30c34169), TOBN(0xba74a953, 0x78baa533), + TOBN(0x3d133c6e, 0xa438f254), TOBN(0xa431531a, 0x201bef5b)}}, + {{TOBN(0x15295e22, 0xf669d7ec), TOBN(0xca374f64, 0x357fb515), + TOBN(0x8a8406ff, 0xeaa3fdb3), TOBN(0x106ae448, 0xdf3f2da8)}, + {TOBN(0x8f9b0a90, 0x33c8e9a1), TOBN(0x234645e2, 0x71ad5885), + TOBN(0x3d083224, 0x1c0aed14), TOBN(0xf10a7d3e, 0x7a942d46)}}, + {{TOBN(0x7c11deee, 0x40d5c9be), TOBN(0xb2bae7ff, 0xba84ed98), + TOBN(0x93e97139, 0xaad58ddd), TOBN(0x3d872796, 0x3f6d1fa3)}, + {TOBN(0x483aca81, 0x8569ff13), TOBN(0x8b89a5fb, 0x9a600f72), + TOBN(0x4cbc27c3, 0xc06f2b86), TOBN(0x22130713, 0x63ad9c0b)}}, + {{TOBN(0xb5358b1e, 0x48ac2840), TOBN(0x18311294, 0xecba9477), + TOBN(0xda58f990, 0xa6946b43), TOBN(0x3098baf9, 0x9ab41819)}, + {TOBN(0x66c4c158, 0x4198da52), TOBN(0xab4fc17c, 0x146bfd1b), + TOBN(0x2f0a4c3c, 0xbf36a908), TOBN(0x2ae9e34b, 0x58cf7838)}}, + {{TOBN(0xf411529e, 0x3fa11b1f), TOBN(0x21e43677, 0x974af2b4), + TOBN(0x7c20958e, 0xc230793b), TOBN(0x710ea885, 0x16e840f3)}, + {TOBN(0xfc0b21fc, 0xc5dc67cf), TOBN(0x08d51647, 0x88405718), + TOBN(0xd955c21f, 0xcfe49eb7), TOBN(0x9722a5d5, 0x56dd4a1f)}}, + {{TOBN(0xc9ef50e2, 0xc861baa5), TOBN(0xc0c21a5d, 0x9505ac3e), + TOBN(0xaf6b9a33, 0x8b7c063f), TOBN(0xc6370339, 0x2f4779c1)}, + {TOBN(0x22df99c7, 0x638167c3), TOBN(0xfe6ffe76, 0x795db30c), + TOBN(0x2b822d33, 0xa4854989), TOBN(0xfef031dd, 0x30563aa5)}}, + {{TOBN(0x16b09f82, 0xd57c667f), TOBN(0xc70312ce, 0xcc0b76f1), + TOBN(0xbf04a9e6, 0xc9118aec), TOBN(0x82fcb419, 0x3409d133)}, + {TOBN(0x1a8ab385, 0xab45d44d), TOBN(0xfba07222, 0x617b83a3), + TOBN(0xb05f50dd, 0x58e81b52), TOBN(0x1d8db553, 0x21ce5aff)}}, + {{TOBN(0x3097b8d4, 0xe344a873), TOBN(0x7d8d116d, 0xfe36d53e), + TOBN(0x6db22f58, 0x7875e750), TOBN(0x2dc5e373, 0x43e144ea)}, + {TOBN(0xc05f32e6, 0xe799eb95), TOBN(0xe9e5f4df, 0x6899e6ec), + TOBN(0xbdc3bd68, 0x1fab23d5), TOBN(0xb72b8ab7, 0x73af60e6)}}, + {{TOBN(0x8db27ae0, 0x2cecc84a), TOBN(0x600016d8, 0x7bdb871c), + TOBN(0x42a44b13, 0xd7c46f58), TOBN(0xb8919727, 0xc3a77d39)}, + {TOBN(0xcfc6bbbd, 0xdafd6088), TOBN(0x1a740146, 0x6bd20d39), + TOBN(0x8c747abd, 0x98c41072), TOBN(0x4c91e765, 0xbdf68ea1)}}, + {{TOBN(0x7c95e5ca, 0x08819a78), TOBN(0xcf48b729, 0xc9587921), + TOBN(0x091c7c5f, 0xdebbcc7d), TOBN(0x6f287404, 0xf0e05149)}, + {TOBN(0xf83b5ac2, 0x26cd44ec), TOBN(0x88ae32a6, 0xcfea250e), + TOBN(0x6ac5047a, 0x1d06ebc5), TOBN(0xc7e550b4, 0xd434f781)}}, + {{TOBN(0x61ab1cf2, 0x5c727bd2), TOBN(0x2e4badb1, 0x1cf915b0), + TOBN(0x1b4dadec, 0xf69d3920), TOBN(0xe61b1ca6, 0xf14c1dfe)}, + {TOBN(0x90b479cc, 0xbd6bd51f), TOBN(0x8024e401, 0x8045ec30), + TOBN(0xcab29ca3, 0x25ef0e62), TOBN(0x4f2e9416, 0x49e4ebc0)}}, + {{TOBN(0x45eb40ec, 0x0ccced58), TOBN(0x25cd4b9c, 0x0da44f98), + TOBN(0x43e06458, 0x871812c6), TOBN(0x99f80d55, 0x16cef651)}, + {TOBN(0x571340c9, 0xce6dc153), TOBN(0x138d5117, 0xd8665521), + TOBN(0xacdb45bc, 0x4e07014d), TOBN(0x2f34bb38, 0x84b60b91)}}, + {{TOBN(0xf44a4fd2, 0x2ae8921e), TOBN(0xb039288e, 0x892ba1e2), + TOBN(0x9da50174, 0xb1c180b2), TOBN(0x6b70ab66, 0x1693dc87)}, + {TOBN(0x7e9babc9, 0xe7057481), TOBN(0x4581ddef, 0x9c80dc41), + TOBN(0x0c890da9, 0x51294682), TOBN(0x0b5629d3, 0x3f4736e5)}}, + {{TOBN(0x2340c79e, 0xb06f5b41), TOBN(0xa42e84ce, 0x4e243469), + TOBN(0xf9a20135, 0x045a71a9), TOBN(0xefbfb415, 0xd27b6fb6)}, + {TOBN(0x25ebea23, 0x9d33cd6f), TOBN(0x9caedb88, 0xaa6c0af8), + TOBN(0x53dc7e9a, 0xd9ce6f96), TOBN(0x3897f9fd, 0x51e0b15a)}}, + {{TOBN(0xf51cb1f8, 0x8e5d788e), TOBN(0x1aec7ba8, 0xe1d490ee), + TOBN(0x265991e0, 0xcc58cb3c), TOBN(0x9f306e8c, 0x9fc3ad31)}, + {TOBN(0x5fed006e, 0x5040a0ac), TOBN(0xca9d5043, 0xfb476f2e), + TOBN(0xa19c06e8, 0xbeea7a23), TOBN(0xd2865801, 0x0edabb63)}}, + {{TOBN(0xdb92293f, 0x6967469a), TOBN(0x2894d839, 0x8d8a8ed8), + TOBN(0x87c9e406, 0xbbc77122), TOBN(0x8671c6f1, 0x2ea3a26a)}, + {TOBN(0xe42df8d6, 0xd7de9853), TOBN(0x2e3ce346, 0xb1f2bcc7), + TOBN(0xda601dfc, 0x899d50cf), TOBN(0xbfc913de, 0xfb1b598f)}}, + {{TOBN(0x81c4909f, 0xe61f7908), TOBN(0x192e304f, 0x9bbc7b29), + TOBN(0xc3ed8738, 0xc104b338), TOBN(0xedbe9e47, 0x783f5d61)}, + {TOBN(0x0c06e9be, 0x2db30660), TOBN(0xda3e613f, 0xc0eb7d8e), + TOBN(0xd8fa3e97, 0x322e096e), TOBN(0xfebd91e8, 0xd336e247)}}, + {{TOBN(0x8f13ccc4, 0xdf655a49), TOBN(0xa9e00dfc, 0x5eb20210), + TOBN(0x84631d0f, 0xc656b6ea), TOBN(0x93a058cd, 0xd8c0d947)}, + {TOBN(0x6846904a, 0x67bd3448), TOBN(0x4a3d4e1a, 0xf394fd5c), + TOBN(0xc102c1a5, 0xdb225f52), TOBN(0xe3455bba, 0xfc4f5e9a)}}, + {{TOBN(0x6b36985b, 0x4b9ad1ce), TOBN(0xa9818536, 0x5bb7f793), + TOBN(0x6c25e1d0, 0x48b1a416), TOBN(0x1381dd53, 0x3c81bee7)}, + {TOBN(0xd2a30d61, 0x7a4a7620), TOBN(0xc8412926, 0x39b8944c), + TOBN(0x3c1c6fbe, 0x7a97c33a), TOBN(0x941e541d, 0x938664e7)}}, + {{TOBN(0x417499e8, 0x4a34f239), TOBN(0x15fdb83c, 0xb90402d5), + TOBN(0xb75f46bf, 0x433aa832), TOBN(0xb61e15af, 0x63215db1)}, + {TOBN(0xaabe59d4, 0xa127f89a), TOBN(0x5d541e0c, 0x07e816da), + TOBN(0xaaba0659, 0xa618b692), TOBN(0x55327733, 0x17266026)}}, + {{TOBN(0xaf53a0fc, 0x95f57552), TOBN(0x32947650, 0x6cacb0c9), + TOBN(0x253ff58d, 0xc821be01), TOBN(0xb0309531, 0xa06f1146)}, + {TOBN(0x59bbbdf5, 0x05c2e54d), TOBN(0x158f27ad, 0x26e8dd22), + TOBN(0xcc5b7ffb, 0x397e1e53), TOBN(0xae03f65b, 0x7fc1e50d)}}, + {{TOBN(0xa9784ebd, 0x9c95f0f9), TOBN(0x5ed9deb2, 0x24640771), + TOBN(0x31244af7, 0x035561c4), TOBN(0x87332f3a, 0x7ee857de)}, + {TOBN(0x09e16e9e, 0x2b9e0d88), TOBN(0x52d910f4, 0x56a06049), + TOBN(0x507ed477, 0xa9592f48), TOBN(0x85cb917b, 0x2365d678)}}, + {{TOBN(0xf8511c93, 0x4c8998d1), TOBN(0x2186a3f1, 0x730ea58f), + TOBN(0x50189626, 0xb2029db0), TOBN(0x9137a6d9, 0x02ceb75a)}, + {TOBN(0x2fe17f37, 0x748bc82c), TOBN(0x87c2e931, 0x80469f8c), + TOBN(0x850f71cd, 0xbf891aa2), TOBN(0x0ca1b89b, 0x75ec3d8d)}}, + {{TOBN(0x516c43aa, 0x5e1cd3cd), TOBN(0x89397808, 0x9a887c28), + TOBN(0x0059c699, 0xddea1f9f), TOBN(0x7737d6fa, 0x8e6868f7)}, + {TOBN(0x6d93746a, 0x60f1524b), TOBN(0x36985e55, 0xba052aa7), + TOBN(0x41b1d322, 0xed923ea5), TOBN(0x3429759f, 0x25852a11)}}, + {{TOBN(0xbeca6ec3, 0x092e9f41), TOBN(0x3a238c66, 0x62256bbd), + TOBN(0xd82958ea, 0x70ad487d), TOBN(0x4ac8aaf9, 0x65610d93)}, + {TOBN(0x3fa101b1, 0x5e4ccab0), TOBN(0x9bf430f2, 0x9de14bfb), + TOBN(0xa10f5cc6, 0x6531899d), TOBN(0x590005fb, 0xea8ce17d)}}, + {{TOBN(0xc437912f, 0x24544cb6), TOBN(0x9987b71a, 0xd79ac2e3), + TOBN(0x13e3d9dd, 0xc058a212), TOBN(0x00075aac, 0xd2de9606)}, + {TOBN(0x80ab508b, 0x6cac8369), TOBN(0x87842be7, 0xf54f6c89), + TOBN(0xa7ad663d, 0x6bc532a4), TOBN(0x67813de7, 0x78a91bc8)}}, + {{TOBN(0x5dcb61ce, 0xc3427239), TOBN(0x5f3c7cf0, 0xc56934d9), + TOBN(0xc079e0fb, 0xe3191591), TOBN(0xe40896bd, 0xb01aada7)}, + {TOBN(0x8d466791, 0x0492d25f), TOBN(0x8aeb30c9, 0xe7408276), + TOBN(0xe9437495, 0x9287aacc), TOBN(0x23d4708d, 0x79fe03d4)}}, + {{TOBN(0x8cda9cf2, 0xd0c05199), TOBN(0x502fbc22, 0xfae78454), + TOBN(0xc0bda9df, 0xf572a182), TOBN(0x5f9b71b8, 0x6158b372)}, + {TOBN(0xe0f33a59, 0x2b82dd07), TOBN(0x76302735, 0x9523032e), + TOBN(0x7fe1a721, 0xc4505a32), TOBN(0x7b6e3e82, 0xf796409f)}}}, + {{{TOBN(0xe3417bc0, 0x35d0b34a), TOBN(0x440b386b, 0x8327c0a7), + TOBN(0x8fb7262d, 0xac0362d1), TOBN(0x2c41114c, 0xe0cdf943)}, + {TOBN(0x2ba5cef1, 0xad95a0b1), TOBN(0xc09b37a8, 0x67d54362), + TOBN(0x26d6cdd2, 0x01e486c9), TOBN(0x20477abf, 0x42ff9297)}}, + {{TOBN(0xa004dcb3, 0x292a9287), TOBN(0xddc15cf6, 0x77b092c7), + TOBN(0x083a8464, 0x806c0605), TOBN(0x4a68df70, 0x3db997b0)}, + {TOBN(0x9c134e45, 0x05bf7dd0), TOBN(0xa4e63d39, 0x8ccf7f8c), + TOBN(0xa6e6517f, 0x41b5f8af), TOBN(0xaa8b9342, 0xad7bc1cc)}}, + {{TOBN(0x126f35b5, 0x1e706ad9), TOBN(0xb99cebb4, 0xc3a9ebdf), + TOBN(0xa75389af, 0xbf608d90), TOBN(0x76113c4f, 0xc6c89858)}, + {TOBN(0x80de8eb0, 0x97e2b5aa), TOBN(0x7e1022cc, 0x63b91304), + TOBN(0x3bdab605, 0x6ccc066c), TOBN(0x33cbb144, 0xb2edf900)}}, + {{TOBN(0xc4176471, 0x7af715d2), TOBN(0xe2f7f594, 0xd0134a96), + TOBN(0x2c1873ef, 0xa41ec956), TOBN(0xe4e7b4f6, 0x77821304)}, + {TOBN(0xe5c8ff97, 0x88d5374a), TOBN(0x2b915e63, 0x80823d5b), + TOBN(0xea6bc755, 0xb2ee8fe2), TOBN(0x6657624c, 0xe7112651)}}, + {{TOBN(0x157af101, 0xdace5aca), TOBN(0xc4fdbcf2, 0x11a6a267), + TOBN(0xdaddf340, 0xc49c8609), TOBN(0x97e49f52, 0xe9604a65)}, + {TOBN(0x9be8e790, 0x937e2ad5), TOBN(0x846e2508, 0x326e17f1), + TOBN(0x3f38007a, 0x0bbbc0dc), TOBN(0xcf03603f, 0xb11e16d6)}}, + {{TOBN(0xd6f800e0, 0x7442f1d5), TOBN(0x475607d1, 0x66e0e3ab), + TOBN(0x82807f16, 0xb7c64047), TOBN(0x8858e1e3, 0xa749883d)}, + {TOBN(0x5859120b, 0x8231ee10), TOBN(0x1b80e7eb, 0x638a1ece), + TOBN(0xcb72525a, 0xc6aa73a4), TOBN(0xa7cdea3d, 0x844423ac)}}, + {{TOBN(0x5ed0c007, 0xf8ae7c38), TOBN(0x6db07a5c, 0x3d740192), + TOBN(0xbe5e9c2a, 0x5fe36db3), TOBN(0xd5b9d57a, 0x76e95046)}, + {TOBN(0x54ac32e7, 0x8eba20f2), TOBN(0xef11ca8f, 0x71b9a352), + TOBN(0x305e373e, 0xff98a658), TOBN(0xffe5a100, 0x823eb667)}}, + {{TOBN(0x57477b11, 0xe51732d2), TOBN(0xdfd6eb28, 0x2538fc0e), + TOBN(0x5c43b0cc, 0x3b39eec5), TOBN(0x6af12778, 0xcb36cc57)}, + {TOBN(0x70b0852d, 0x06c425ae), TOBN(0x6df92f8c, 0x5c221b9b), + TOBN(0x6c8d4f9e, 0xce826d9c), TOBN(0xf59aba7b, 0xb49359c3)}}, + {{TOBN(0x5c8ed8d5, 0xda64309d), TOBN(0x61a6de56, 0x91b30704), + TOBN(0xd6b52f6a, 0x2f9b5808), TOBN(0x0eee4194, 0x98c958a7)}, + {TOBN(0xcddd9aab, 0x771e4caa), TOBN(0x83965dfd, 0x78bc21be), + TOBN(0x02affce3, 0xb3b504f5), TOBN(0x30847a21, 0x561c8291)}}, + {{TOBN(0xd2eb2cf1, 0x52bfda05), TOBN(0xe0e4c4e9, 0x6197b98c), + TOBN(0x1d35076c, 0xf8a1726f), TOBN(0x6c06085b, 0x2db11e3d)}, + {TOBN(0x15c0c4d7, 0x4463ba14), TOBN(0x9d292f83, 0x0030238c), + TOBN(0x1311ee8b, 0x3727536d), TOBN(0xfeea86ef, 0xbeaedc1e)}}, + {{TOBN(0xb9d18cd3, 0x66131e2e), TOBN(0xf31d974f, 0x80fe2682), + TOBN(0xb6e49e0f, 0xe4160289), TOBN(0x7c48ec0b, 0x08e92799)}, + {TOBN(0x818111d8, 0xd1989aa7), TOBN(0xb34fa0aa, 0xebf926f9), + TOBN(0xdb5fe2f5, 0xa245474a), TOBN(0xf80a6ebb, 0x3c7ca756)}}, + {{TOBN(0xa7f96054, 0xafa05dd8), TOBN(0x26dfcf21, 0xfcaf119e), + TOBN(0xe20ef2e3, 0x0564bb59), TOBN(0xef4dca50, 0x61cb02b8)}, + {TOBN(0xcda7838a, 0x65d30672), TOBN(0x8b08d534, 0xfd657e86), + TOBN(0x4c5b4395, 0x46d595c8), TOBN(0x39b58725, 0x425cb836)}}, + {{TOBN(0x8ea61059, 0x3de9abe3), TOBN(0x40434881, 0x9cdc03be), + TOBN(0x9b261245, 0xcfedce8c), TOBN(0x78c318b4, 0xcf5234a1)}, + {TOBN(0x510bcf16, 0xfde24c99), TOBN(0x2a77cb75, 0xa2c2ff5d), + TOBN(0x9c895c2b, 0x27960fb4), TOBN(0xd30ce975, 0xb0eda42b)}}, + {{TOBN(0xfda85393, 0x1a62cc26), TOBN(0x23c69b96, 0x50c0e052), + TOBN(0xa227df15, 0xbfc633f3), TOBN(0x2ac78848, 0x1bae7d48)}, + {TOBN(0x487878f9, 0x187d073d), TOBN(0x6c2be919, 0x967f807d), + TOBN(0x765861d8, 0x336e6d8f), TOBN(0x88b8974c, 0xce528a43)}}, + {{TOBN(0x09521177, 0xff57d051), TOBN(0x2ff38037, 0xfb6a1961), + TOBN(0xfc0aba74, 0xa3d76ad4), TOBN(0x7c764803, 0x25a7ec17)}, + {TOBN(0x7532d75f, 0x48879bc8), TOBN(0xea7eacc0, 0x58ce6bc1), + TOBN(0xc82176b4, 0x8e896c16), TOBN(0x9a30e0b2, 0x2c750fed)}}, + {{TOBN(0xc37e2c2e, 0x421d3aa4), TOBN(0xf926407c, 0xe84fa840), + TOBN(0x18abc03d, 0x1454e41c), TOBN(0x26605ecd, 0x3f7af644)}, + {TOBN(0x242341a6, 0xd6a5eabf), TOBN(0x1edb84f4, 0x216b668e), + TOBN(0xd836edb8, 0x04010102), TOBN(0x5b337ce7, 0x945e1d8c)}}, + {{TOBN(0xd2075c77, 0xc055dc14), TOBN(0x2a0ffa25, 0x81d89cdf), + TOBN(0x8ce815ea, 0x6ffdcbaf), TOBN(0xa3428878, 0xfb648867)}, + {TOBN(0x277699cf, 0x884655fb), TOBN(0xfa5b5bd6, 0x364d3e41), + TOBN(0x01f680c6, 0x441e1cb7), TOBN(0x3fd61e66, 0xb70a7d67)}}, + {{TOBN(0x666ba2dc, 0xcc78cf66), TOBN(0xb3018174, 0x6fdbff77), + TOBN(0x8d4dd0db, 0x168d4668), TOBN(0x259455d0, 0x1dab3a2a)}, + {TOBN(0xf58564c5, 0xcde3acec), TOBN(0x77141925, 0x13adb276), + TOBN(0x527d725d, 0x8a303f65), TOBN(0x55deb6c9, 0xe6f38f7b)}}, + {{TOBN(0xfd5bb657, 0xb1fa70fb), TOBN(0xfa07f50f, 0xd8073a00), + TOBN(0xf72e3aa7, 0xbca02500), TOBN(0xf68f895d, 0x9975740d)}, + {TOBN(0x30112060, 0x5cae2a6a), TOBN(0x01bd7218, 0x02874842), + TOBN(0x3d423891, 0x7ce47bd3), TOBN(0xa66663c1, 0x789544f6)}}, + {{TOBN(0x864d05d7, 0x3272d838), TOBN(0xe22924f9, 0xfa6295c5), + TOBN(0x8189593f, 0x6c2fda32), TOBN(0x330d7189, 0xb184b544)}, + {TOBN(0x79efa62c, 0xbde1f714), TOBN(0x35771c94, 0xe5cb1a63), + TOBN(0x2f4826b8, 0x641c8332), TOBN(0x00a894fb, 0xc8cee854)}}, + {{TOBN(0xb4b9a39b, 0x36194d40), TOBN(0xe857a7c5, 0x77612601), + TOBN(0xf4209dd2, 0x4ecf2f58), TOBN(0x82b9e66d, 0x5a033487)}, + {TOBN(0xc1e36934, 0xe4e8b9dd), TOBN(0xd2372c9d, 0xa42377d7), + TOBN(0x51dc94c7, 0x0e3ae43b), TOBN(0x4c57761e, 0x04474f6f)}}, + {{TOBN(0xdcdacd0a, 0x1058a318), TOBN(0x369cf3f5, 0x78053a9a), + TOBN(0xc6c3de50, 0x31c68de2), TOBN(0x4653a576, 0x3c4b6d9f)}, + {TOBN(0x1688dd5a, 0xaa4e5c97), TOBN(0x5be80aa1, 0xb7ab3c74), + TOBN(0x70cefe7c, 0xbc65c283), TOBN(0x57f95f13, 0x06867091)}}, + {{TOBN(0xa39114e2, 0x4415503b), TOBN(0xc08ff7c6, 0x4cbb17e9), + TOBN(0x1eff674d, 0xd7dec966), TOBN(0x6d4690af, 0x53376f63)}, + {TOBN(0xff6fe32e, 0xea74237b), TOBN(0xc436d17e, 0xcd57508e), + TOBN(0x15aa28e1, 0xedcc40fe), TOBN(0x0d769c04, 0x581bbb44)}}, + {{TOBN(0xc240b6de, 0x34eaacda), TOBN(0xd9e116e8, 0x2ba0f1de), + TOBN(0xcbe45ec7, 0x79438e55), TOBN(0x91787c9d, 0x96f752d7)}, + {TOBN(0x897f532b, 0xf129ac2f), TOBN(0xd307b7c8, 0x5a36e22c), + TOBN(0x91940675, 0x749fb8f3), TOBN(0xd14f95d0, 0x157fdb28)}}, + {{TOBN(0xfe51d029, 0x6ae55043), TOBN(0x8931e98f, 0x44a87de1), + TOBN(0xe57f1cc6, 0x09e4fee2), TOBN(0x0d063b67, 0x4e072d92)}, + {TOBN(0x70a998b9, 0xed0e4316), TOBN(0xe74a736b, 0x306aca46), + TOBN(0xecf0fbf2, 0x4fda97c7), TOBN(0xa40f65cb, 0x3e178d93)}}, + {{TOBN(0x16253604, 0x16df4285), TOBN(0xb0c9babb, 0xd0c56ae2), + TOBN(0x73032b19, 0xcfc5cfc3), TOBN(0xe497e5c3, 0x09752056)}, + {TOBN(0x12096bb4, 0x164bda96), TOBN(0x1ee42419, 0xa0b74da1), + TOBN(0x8fc36243, 0x403826ba), TOBN(0x0c8f0069, 0xdc09e660)}}, + {{TOBN(0x8667e981, 0xc27253c9), TOBN(0x05a6aefb, 0x92b36a45), + TOBN(0xa62c4b36, 0x9cb7bb46), TOBN(0x8394f375, 0x11f7027b)}, + {TOBN(0x747bc79c, 0x5f109d0f), TOBN(0xcad88a76, 0x5b8cc60a), + TOBN(0x80c5a66b, 0x58f09e68), TOBN(0xe753d451, 0xf6127eac)}}, + {{TOBN(0xc44b74a1, 0x5b0ec6f5), TOBN(0x47989fe4, 0x5289b2b8), + TOBN(0x745f8484, 0x58d6fc73), TOBN(0xec362a6f, 0xf61c70ab)}, + {TOBN(0x070c98a7, 0xb3a8ad41), TOBN(0x73a20fc0, 0x7b63db51), + TOBN(0xed2c2173, 0xf44c35f4), TOBN(0x8a56149d, 0x9acc9dca)}}, + {{TOBN(0x98f17881, 0x9ac6e0f4), TOBN(0x360fdeaf, 0xa413b5ed), + TOBN(0x0625b8f4, 0xa300b0fd), TOBN(0xf1f4d76a, 0x5b3222d3)}, + {TOBN(0x9d6f5109, 0x587f76b8), TOBN(0x8b4ee08d, 0x2317fdb5), + TOBN(0x88089bb7, 0x8c68b095), TOBN(0x95570e9a, 0x5808d9b9)}}, + {{TOBN(0xa395c36f, 0x35d33ae7), TOBN(0x200ea123, 0x50bb5a94), + TOBN(0x20c789bd, 0x0bafe84b), TOBN(0x243ef52d, 0x0919276a)}, + {TOBN(0x3934c577, 0xe23ae233), TOBN(0xb93807af, 0xa460d1ec), + TOBN(0xb72a53b1, 0xf8fa76a4), TOBN(0xd8914cb0, 0xc3ca4491)}}, + {{TOBN(0x2e128494, 0x3fb42622), TOBN(0x3b2700ac, 0x500907d5), + TOBN(0xf370fb09, 0x1a95ec63), TOBN(0xf8f30be2, 0x31b6dfbd)}, + {TOBN(0xf2b2f8d2, 0x69e55f15), TOBN(0x1fead851, 0xcc1323e9), + TOBN(0xfa366010, 0xd9e5eef6), TOBN(0x64d487b0, 0xe316107e)}}, + {{TOBN(0x4c076b86, 0xd23ddc82), TOBN(0x03fd344c, 0x7e0143f0), + TOBN(0xa95362ff, 0x317af2c5), TOBN(0x0add3db7, 0xe18b7a4f)}, + {TOBN(0x9c673e3f, 0x8260e01b), TOBN(0xfbeb49e5, 0x54a1cc91), + TOBN(0x91351bf2, 0x92f2e433), TOBN(0xc755e7ec, 0x851141eb)}}, + {{TOBN(0xc9a95139, 0x29607745), TOBN(0x0ca07420, 0xa26f2b28), + TOBN(0xcb2790e7, 0x4bc6f9dd), TOBN(0x345bbb58, 0xadcaffc0)}, + {TOBN(0xc65ea38c, 0xbe0f27a2), TOBN(0x67c24d7c, 0x641fcb56), + TOBN(0x2c25f0a7, 0xa9e2c757), TOBN(0x93f5cdb0, 0x16f16c49)}}, + {{TOBN(0x2ca5a9d7, 0xc5ee30a1), TOBN(0xd1593635, 0xb909b729), + TOBN(0x804ce9f3, 0xdadeff48), TOBN(0xec464751, 0xb07c30c3)}, + {TOBN(0x89d65ff3, 0x9e49af6a), TOBN(0xf2d6238a, 0x6f3d01bc), + TOBN(0x1095561e, 0x0bced843), TOBN(0x51789e12, 0xc8a13fd8)}}, + {{TOBN(0xd633f929, 0x763231df), TOBN(0x46df9f7d, 0xe7cbddef), + TOBN(0x01c889c0, 0xcb265da8), TOBN(0xfce1ad10, 0xaf4336d2)}, + {TOBN(0x8d110df6, 0xfc6a0a7e), TOBN(0xdd431b98, 0x6da425dc), + TOBN(0xcdc4aeab, 0x1834aabe), TOBN(0x84deb124, 0x8439b7fc)}}, + {{TOBN(0x8796f169, 0x3c2a5998), TOBN(0x9b9247b4, 0x7947190d), + TOBN(0x55b9d9a5, 0x11597014), TOBN(0x7e9dd70d, 0x7b1566ee)}, + {TOBN(0x94ad78f7, 0xcbcd5e64), TOBN(0x0359ac17, 0x9bd4c032), + TOBN(0x3b11baaf, 0x7cc222ae), TOBN(0xa6a6e284, 0xba78e812)}}, + {{TOBN(0x8392053f, 0x24cea1a0), TOBN(0xc97bce4a, 0x33621491), + TOBN(0x7eb1db34, 0x35399ee9), TOBN(0x473f78ef, 0xece81ad1)}, + {TOBN(0x41d72fe0, 0xf63d3d0d), TOBN(0xe620b880, 0xafab62fc), + TOBN(0x92096bc9, 0x93158383), TOBN(0x41a21357, 0x8f896f6c)}}, + {{TOBN(0x1b5ee2fa, 0xc7dcfcab), TOBN(0x650acfde, 0x9546e007), + TOBN(0xc081b749, 0xb1b02e07), TOBN(0xda9e41a0, 0xf9eca03d)}, + {TOBN(0x013ba727, 0x175a54ab), TOBN(0xca0cd190, 0xea5d8d10), + TOBN(0x85ea52c0, 0x95fd96a9), TOBN(0x2c591b9f, 0xbc5c3940)}}, + {{TOBN(0x6fb4d4e4, 0x2bad4d5f), TOBN(0xfa4c3590, 0xfef0059b), + TOBN(0x6a10218a, 0xf5122294), TOBN(0x9a78a81a, 0xa85751d1)}, + {TOBN(0x04f20579, 0xa98e84e7), TOBN(0xfe1242c0, 0x4997e5b5), + TOBN(0xe77a273b, 0xca21e1e4), TOBN(0xfcc8b1ef, 0x9411939d)}}, + {{TOBN(0xe20ea302, 0x92d0487a), TOBN(0x1442dbec, 0x294b91fe), + TOBN(0x1f7a4afe, 0xbb6b0e8f), TOBN(0x1700ef74, 0x6889c318)}, + {TOBN(0xf5bbffc3, 0x70f1fc62), TOBN(0x3b31d4b6, 0x69c79cca), + TOBN(0xe8bc2aab, 0xa7f6340d), TOBN(0xb0b08ab4, 0xa725e10a)}}, + {{TOBN(0x44f05701, 0xae340050), TOBN(0xba4b3016, 0x1cf0c569), + TOBN(0x5aa29f83, 0xfbe19a51), TOBN(0x1b9ed428, 0xb71d752e)}, + {TOBN(0x1666e54e, 0xeb4819f5), TOBN(0x616cdfed, 0x9e18b75b), + TOBN(0x112ed5be, 0x3ee27b0b), TOBN(0xfbf28319, 0x44c7de4d)}}, + {{TOBN(0xd685ec85, 0xe0e60d84), TOBN(0x68037e30, 0x1db7ee78), + TOBN(0x5b65bdcd, 0x003c4d6e), TOBN(0x33e7363a, 0x93e29a6a)}, + {TOBN(0x995b3a61, 0x08d0756c), TOBN(0xd727f85c, 0x2faf134b), + TOBN(0xfac6edf7, 0x1d337823), TOBN(0x99b9aa50, 0x0439b8b4)}}, + {{TOBN(0x722eb104, 0xe2b4e075), TOBN(0x49987295, 0x437c4926), + TOBN(0xb1e4c0e4, 0x46a9b82d), TOBN(0xd0cb3197, 0x57a006f5)}, + {TOBN(0xf3de0f7d, 0xd7808c56), TOBN(0xb5c54d8f, 0x51f89772), + TOBN(0x500a114a, 0xadbd31aa), TOBN(0x9afaaaa6, 0x295f6cab)}}, + {{TOBN(0x94705e21, 0x04cf667a), TOBN(0xfc2a811b, 0x9d3935d7), + TOBN(0x560b0280, 0x6d09267c), TOBN(0xf19ed119, 0xf780e53b)}, + {TOBN(0xf0227c09, 0x067b6269), TOBN(0x967b8533, 0x5caef599), + TOBN(0x155b9243, 0x68efeebc), TOBN(0xcd6d34f5, 0xc497bae6)}}, + {{TOBN(0x1dd8d5d3, 0x6cceb370), TOBN(0x2aeac579, 0xa78d7bf9), + TOBN(0x5d65017d, 0x70b67a62), TOBN(0x70c8e44f, 0x17c53f67)}, + {TOBN(0xd1fc0950, 0x86a34d09), TOBN(0xe0fca256, 0xe7134907), + TOBN(0xe24fa29c, 0x80fdd315), TOBN(0x2c4acd03, 0xd87499ad)}}, + {{TOBN(0xbaaf7517, 0x3b5a9ba6), TOBN(0xb9cbe1f6, 0x12e51a51), + TOBN(0xd88edae3, 0x5e154897), TOBN(0xe4309c3c, 0x77b66ca0)}, + {TOBN(0xf5555805, 0xf67f3746), TOBN(0x85fc37ba, 0xa36401ff), + TOBN(0xdf86e2ca, 0xd9499a53), TOBN(0x6270b2a3, 0xecbc955b)}}, + {{TOBN(0xafae64f5, 0x974ad33b), TOBN(0x04d85977, 0xfe7b2df1), + TOBN(0x2a3db3ff, 0x4ab03f73), TOBN(0x0b87878a, 0x8702740a)}, + {TOBN(0x6d263f01, 0x5a061732), TOBN(0xc25430ce, 0xa32a1901), + TOBN(0xf7ebab3d, 0xdb155018), TOBN(0x3a86f693, 0x63a9b78e)}}, + {{TOBN(0x349ae368, 0xda9f3804), TOBN(0x470f07fe, 0xa164349c), + TOBN(0xd52f4cc9, 0x8562baa5), TOBN(0xc74a9e86, 0x2b290df3)}, + {TOBN(0xd3a1aa35, 0x43471a24), TOBN(0x239446be, 0xb8194511), + TOBN(0xbec2dd00, 0x81dcd44d), TOBN(0xca3d7f0f, 0xc42ac82d)}}, + {{TOBN(0x1f3db085, 0xfdaf4520), TOBN(0xbb6d3e80, 0x4549daf2), + TOBN(0xf5969d8a, 0x19ad5c42), TOBN(0x7052b13d, 0xdbfd1511)}, + {TOBN(0x11890d1b, 0x682b9060), TOBN(0xa71d3883, 0xac34452c), + TOBN(0xa438055b, 0x783805b4), TOBN(0x43241277, 0x4725b23e)}}, + {{TOBN(0xf20cf96e, 0x4901bbed), TOBN(0x6419c710, 0xf432a2bb), + TOBN(0x57a0fbb9, 0xdfa9cd7d), TOBN(0x589111e4, 0x00daa249)}, + {TOBN(0x19809a33, 0x7b60554e), TOBN(0xea5f8887, 0xede283a4), + TOBN(0x2d713802, 0x503bfd35), TOBN(0x151bb0af, 0x585d2a53)}}, + {{TOBN(0x40b08f74, 0x43b30ca8), TOBN(0xe10b5bba, 0xd9934583), + TOBN(0xe8a546d6, 0xb51110ad), TOBN(0x1dd50e66, 0x28e0b6c5)}, + {TOBN(0x292e9d54, 0xcff2b821), TOBN(0x3882555d, 0x47281760), + TOBN(0x134838f8, 0x3724d6e3), TOBN(0xf2c679e0, 0x22ddcda1)}}, + {{TOBN(0x40ee8815, 0x6d2a5768), TOBN(0x7f227bd2, 0x1c1e7e2d), + TOBN(0x487ba134, 0xd04ff443), TOBN(0x76e2ff3d, 0xc614e54b)}, + {TOBN(0x36b88d6f, 0xa3177ec7), TOBN(0xbf731d51, 0x2328fff5), + TOBN(0x758caea2, 0x49ba158e), TOBN(0x5ab8ff4c, 0x02938188)}}, + {{TOBN(0x33e16056, 0x35edc56d), TOBN(0x5a69d349, 0x7e940d79), + TOBN(0x6c4fd001, 0x03866dcb), TOBN(0x20a38f57, 0x4893cdef)}, + {TOBN(0xfbf3e790, 0xfac3a15b), TOBN(0x6ed7ea2e, 0x7a4f8e6b), + TOBN(0xa663eb4f, 0xbc3aca86), TOBN(0x22061ea5, 0x080d53f7)}}, + {{TOBN(0x2480dfe6, 0xf546783f), TOBN(0xd38bc6da, 0x5a0a641e), + TOBN(0xfb093cd1, 0x2ede8965), TOBN(0x89654db4, 0xacb455cf)}, + {TOBN(0x413cbf9a, 0x26e1adee), TOBN(0x291f3764, 0x373294d4), + TOBN(0x00797257, 0x648083fe), TOBN(0x25f504d3, 0x208cc341)}}, + {{TOBN(0x635a8e5e, 0xc3a0ee43), TOBN(0x70aaebca, 0x679898ff), + TOBN(0x9ee9f547, 0x5dc63d56), TOBN(0xce987966, 0xffb34d00)}, + {TOBN(0xf9f86b19, 0x5e26310a), TOBN(0x9e435484, 0x382a8ca8), + TOBN(0x253bcb81, 0xc2352fe4), TOBN(0xa4eac8b0, 0x4474b571)}}, + {{TOBN(0xc1b97512, 0xc1ad8cf8), TOBN(0x193b4e9e, 0x99e0b697), + TOBN(0x939d2716, 0x01e85df0), TOBN(0x4fb265b3, 0xcd44eafd)}, + {TOBN(0x321e7dcd, 0xe51e1ae2), TOBN(0x8e3a8ca6, 0xe3d8b096), + TOBN(0x8de46cb0, 0x52604998), TOBN(0x91099ad8, 0x39072aa7)}}, + {{TOBN(0x2617f91c, 0x93aa96b8), TOBN(0x0fc8716b, 0x7fca2e13), + TOBN(0xa7106f5e, 0x95328723), TOBN(0xd1c9c40b, 0x262e6522)}, + {TOBN(0xb9bafe86, 0x42b7c094), TOBN(0x1873439d, 0x1543c021), + TOBN(0xe1baa5de, 0x5cbefd5d), TOBN(0xa363fc5e, 0x521e8aff)}}, + {{TOBN(0xefe6320d, 0xf862eaac), TOBN(0x14419c63, 0x22c647dc), + TOBN(0x0e06707c, 0x4e46d428), TOBN(0xcb6c834f, 0x4a178f8f)}, + {TOBN(0x0f993a45, 0xd30f917c), TOBN(0xd4c4b049, 0x9879afee), + TOBN(0xb6142a1e, 0x70500063), TOBN(0x7c9b41c3, 0xa5d9d605)}}, + {{TOBN(0xbc00fc2f, 0x2f8ba2c7), TOBN(0x0966eb2f, 0x7c67aa28), + TOBN(0x13f7b516, 0x5a786972), TOBN(0x3bfb7557, 0x8a2fbba0)}, + {TOBN(0x131c4f23, 0x5a2b9620), TOBN(0xbff3ed27, 0x6faf46be), + TOBN(0x9b4473d1, 0x7e172323), TOBN(0x421e8878, 0x339f6246)}}, + {{TOBN(0x0fa8587a, 0x25a41632), TOBN(0xc0814124, 0xa35b6c93), + TOBN(0x2b18a9f5, 0x59ebb8db), TOBN(0x264e3357, 0x76edb29c)}, + {TOBN(0xaf245ccd, 0xc87c51e2), TOBN(0x16b3015b, 0x501e6214), + TOBN(0xbb31c560, 0x0a3882ce), TOBN(0x6961bb94, 0xfec11e04)}}, + {{TOBN(0x3b825b8d, 0xeff7a3a0), TOBN(0xbec33738, 0xb1df7326), + TOBN(0x68ad747c, 0x99604a1f), TOBN(0xd154c934, 0x9a3bd499)}, + {TOBN(0xac33506f, 0x1cc7a906), TOBN(0x73bb5392, 0x6c560e8f), + TOBN(0x6428fcbe, 0x263e3944), TOBN(0xc11828d5, 0x1c387434)}}, + {{TOBN(0x3cd04be1, 0x3e4b12ff), TOBN(0xc3aad9f9, 0x2d88667c), + TOBN(0xc52ddcf8, 0x248120cf), TOBN(0x985a892e, 0x2a389532)}, + {TOBN(0xfbb4b21b, 0x3bb85fa0), TOBN(0xf95375e0, 0x8dfc6269), + TOBN(0xfb4fb06c, 0x7ee2acea), TOBN(0x6785426e, 0x309c4d1f)}}, + {{TOBN(0x659b17c8, 0xd8ceb147), TOBN(0x9b649eee, 0xb70a5554), + TOBN(0x6b7fa0b5, 0xac6bc634), TOBN(0xd99fe2c7, 0x1d6e732f)}, + {TOBN(0x30e6e762, 0x8d3abba2), TOBN(0x18fee6e7, 0xa797b799), + TOBN(0x5c9d360d, 0xc696464d), TOBN(0xe3baeb48, 0x27bfde12)}}, + {{TOBN(0x2bf5db47, 0xf23206d5), TOBN(0x2f6d3420, 0x1d260152), + TOBN(0x17b87653, 0x3f8ff89a), TOBN(0x5157c30c, 0x378fa458)}, + {TOBN(0x7517c5c5, 0x2d4fb936), TOBN(0xef22f7ac, 0xe6518cdc), + TOBN(0xdeb483e6, 0xbf847a64), TOBN(0xf5084558, 0x92e0fa89)}}}, + {{{TOBN(0xab9659d8, 0xdf7304d4), TOBN(0xb71bcf1b, 0xff210e8e), + TOBN(0xa9a2438b, 0xd73fbd60), TOBN(0x4595cd1f, 0x5d11b4de)}, + {TOBN(0x9c0d329a, 0x4835859d), TOBN(0x4a0f0d2d, 0x7dbb6e56), + TOBN(0xc6038e5e, 0xdf928a4e), TOBN(0xc9429621, 0x8f5ad154)}}, + {{TOBN(0x91213462, 0xf23f2d92), TOBN(0x6cab71bd, 0x60b94078), + TOBN(0x6bdd0a63, 0x176cde20), TOBN(0x54c9b20c, 0xee4d54bc)}, + {TOBN(0x3cd2d8aa, 0x9f2ac02f), TOBN(0x03f8e617, 0x206eedb0), + TOBN(0xc7f68e16, 0x93086434), TOBN(0x831469c5, 0x92dd3db9)}}, + {{TOBN(0x8521df24, 0x8f981354), TOBN(0x587e23ec, 0x3588a259), + TOBN(0xcbedf281, 0xd7a0992c), TOBN(0x06930a55, 0x38961407)}, + {TOBN(0x09320deb, 0xbe5bbe21), TOBN(0xa7ffa5b5, 0x2491817f), + TOBN(0xe6c8b4d9, 0x09065160), TOBN(0xac4f3992, 0xfff6d2a9)}}, + {{TOBN(0x7aa7a158, 0x3ae9c1bd), TOBN(0xe0af6d98, 0xe37ce240), + TOBN(0xe54342d9, 0x28ab38b4), TOBN(0xe8b75007, 0x0a1c98ca)}, + {TOBN(0xefce86af, 0xe02358f2), TOBN(0x31b8b856, 0xea921228), + TOBN(0x052a1912, 0x0a1c67fc), TOBN(0xb4069ea4, 0xe3aead59)}}, + {{TOBN(0x3232d6e2, 0x7fa03cb3), TOBN(0xdb938e5b, 0x0fdd7d88), + TOBN(0x04c1d2cd, 0x2ccbfc5d), TOBN(0xd2f45c12, 0xaf3a580f)}, + {TOBN(0x592620b5, 0x7883e614), TOBN(0x5fd27e68, 0xbe7c5f26), + TOBN(0x139e45a9, 0x1567e1e3), TOBN(0x2cc71d2d, 0x44d8aaaf)}}, + {{TOBN(0x4a9090cd, 0xe36d0757), TOBN(0xf722d7b1, 0xd9a29382), + TOBN(0xfb7fb04c, 0x04b48ddf), TOBN(0x628ad2a7, 0xebe16f43)}, + {TOBN(0xcd3fbfb5, 0x20226040), TOBN(0x6c34ecb1, 0x5104b6c4), + TOBN(0x30c0754e, 0xc903c188), TOBN(0xec336b08, 0x2d23cab0)}}, + {{TOBN(0x473d62a2, 0x1e206ee5), TOBN(0xf1e27480, 0x8c49a633), + TOBN(0x87ab956c, 0xe9f6b2c3), TOBN(0x61830b48, 0x62b606ea)}, + {TOBN(0x67cd6846, 0xe78e815f), TOBN(0xfe40139f, 0x4c02082a), + TOBN(0x52bbbfcb, 0x952ec365), TOBN(0x74c11642, 0x6b9836ab)}}, + {{TOBN(0x9f51439e, 0x558df019), TOBN(0x230da4ba, 0xac712b27), + TOBN(0x518919e3, 0x55185a24), TOBN(0x4dcefcdd, 0x84b78f50)}, + {TOBN(0xa7d90fb2, 0xa47d4c5a), TOBN(0x55ac9abf, 0xb30e009e), + TOBN(0xfd2fc359, 0x74eed273), TOBN(0xb72d824c, 0xdbea8faf)}}, + {{TOBN(0xce721a74, 0x4513e2ca), TOBN(0x0b418612, 0x38240b2c), + TOBN(0x05199968, 0xd5baa450), TOBN(0xeb1757ed, 0x2b0e8c25)}, + {TOBN(0x6ebc3e28, 0x3dfac6d5), TOBN(0xb2431e2e, 0x48a237f5), + TOBN(0x2acb5e23, 0x52f61499), TOBN(0x5558a2a7, 0xe06c936b)}}, + {{TOBN(0xd213f923, 0xcbb13d1b), TOBN(0x98799f42, 0x5bfb9bfe), + TOBN(0x1ae8ddc9, 0x701144a9), TOBN(0x0b8b3bb6, 0x4c5595ee)}, + {TOBN(0x0ea9ef2e, 0x3ecebb21), TOBN(0x17cb6c4b, 0x3671f9a7), + TOBN(0x47ef464f, 0x726f1d1f), TOBN(0x171b9484, 0x6943a276)}}, + {{TOBN(0x51a4ae2d, 0x7ef0329c), TOBN(0x08509222, 0x91c4402a), + TOBN(0x64a61d35, 0xafd45bbc), TOBN(0x38f096fe, 0x3035a851)}, + {TOBN(0xc7468b74, 0xa1dec027), TOBN(0xe8cf10e7, 0x4fc7dcba), + TOBN(0xea35ff40, 0xf4a06353), TOBN(0x0b4c0dfa, 0x8b77dd66)}}, + {{TOBN(0x779b8552, 0xde7e5c19), TOBN(0xfab28609, 0xc1c0256c), + TOBN(0x64f58eee, 0xabd4743d), TOBN(0x4e8ef838, 0x7b6cc93b)}, + {TOBN(0xee650d26, 0x4cb1bf3d), TOBN(0x4c1f9d09, 0x73dedf61), + TOBN(0xaef7c9d7, 0xbfb70ced), TOBN(0x1ec0507e, 0x1641de1e)}}, + {{TOBN(0xcd7e5cc7, 0xcde45079), TOBN(0xde173c9a, 0x516ac9e4), + TOBN(0x517a8494, 0xc170315c), TOBN(0x438fd905, 0x91d8e8fb)}, + {TOBN(0x5145c506, 0xc7d9630b), TOBN(0x6457a87b, 0xf47d4d75), + TOBN(0xd31646bf, 0x0d9a80e8), TOBN(0x453add2b, 0xcef3aabe)}}, + {{TOBN(0xc9941109, 0xa607419d), TOBN(0xfaa71e62, 0xbb6bca80), + TOBN(0x34158c13, 0x07c431f3), TOBN(0x594abebc, 0x992bc47a)}, + {TOBN(0x6dfea691, 0xeb78399f), TOBN(0x48aafb35, 0x3f42cba4), + TOBN(0xedcd65af, 0x077c04f0), TOBN(0x1a29a366, 0xe884491a)}}, + {{TOBN(0x023a40e5, 0x1c21f2bf), TOBN(0xf99a513c, 0xa5057aee), + TOBN(0xa3fe7e25, 0xbcab072e), TOBN(0x8568d2e1, 0x40e32bcf)}, + {TOBN(0x904594eb, 0xd3f69d9f), TOBN(0x181a9733, 0x07affab1), + TOBN(0xe4d68d76, 0xb6e330f4), TOBN(0x87a6dafb, 0xc75a7fc1)}}, + {{TOBN(0x549db2b5, 0xef7d9289), TOBN(0x2480d4a8, 0x197f015a), + TOBN(0x61d5590b, 0xc40493b6), TOBN(0x3a55b52e, 0x6f780331)}, + {TOBN(0x40eb8115, 0x309eadb0), TOBN(0xdea7de5a, 0x92e5c625), + TOBN(0x64d631f0, 0xcc6a3d5a), TOBN(0x9d5e9d7c, 0x93e8dd61)}}, + {{TOBN(0xf297bef5, 0x206d3ffc), TOBN(0x23d5e033, 0x7d808bd4), + TOBN(0x4a4f6912, 0xd24cf5ba), TOBN(0xe4d8163b, 0x09cdaa8a)}, + {TOBN(0x0e0de9ef, 0xd3082e8e), TOBN(0x4fe1246c, 0x0192f360), + TOBN(0x1f900150, 0x4b8eee0a), TOBN(0x5219da81, 0xf1da391b)}}, + {{TOBN(0x7bf6a5c1, 0xf7ea25aa), TOBN(0xd165e6bf, 0xfbb07d5f), + TOBN(0xe3539361, 0x89e78671), TOBN(0xa3fcac89, 0x2bac4219)}, + {TOBN(0xdfab6fd4, 0xf0baa8ab), TOBN(0x5a4adac1, 0xe2c1c2e5), + TOBN(0x6cd75e31, 0x40d85849), TOBN(0xce263fea, 0x19b39181)}}, + {{TOBN(0xcb6803d3, 0x07032c72), TOBN(0x7f40d5ce, 0x790968c8), + TOBN(0xa6de86bd, 0xdce978f0), TOBN(0x25547c4f, 0x368f751c)}, + {TOBN(0xb1e685fd, 0x65fb2a9e), TOBN(0xce69336f, 0x1eb9179c), + TOBN(0xb15d1c27, 0x12504442), TOBN(0xb7df465c, 0xb911a06b)}}, + {{TOBN(0xb8d804a3, 0x315980cd), TOBN(0x693bc492, 0xfa3bebf7), + TOBN(0x3578aeee, 0x2253c504), TOBN(0x158de498, 0xcd2474a2)}, + {TOBN(0x1331f5c7, 0xcfda8368), TOBN(0xd2d7bbb3, 0x78d7177e), + TOBN(0xdf61133a, 0xf3c1e46e), TOBN(0x5836ce7d, 0xd30e7be8)}}, + {{TOBN(0x83084f19, 0x94f834cb), TOBN(0xd35653d4, 0x429ed782), + TOBN(0xa542f16f, 0x59e58243), TOBN(0xc2b52f65, 0x0470a22d)}, + {TOBN(0xe3b6221b, 0x18f23d96), TOBN(0xcb05abac, 0x3f5252b4), + TOBN(0xca00938b, 0x87d61402), TOBN(0x2f186cdd, 0x411933e4)}}, + {{TOBN(0xe042ece5, 0x9a29a5c5), TOBN(0xb19b3c07, 0x3b6c8402), + TOBN(0xc97667c7, 0x19d92684), TOBN(0xb5624622, 0xebc66372)}, + {TOBN(0x0cb96e65, 0x3c04fa02), TOBN(0x83a7176c, 0x8eaa39aa), + TOBN(0x2033561d, 0xeaa1633f), TOBN(0x45a9d086, 0x4533df73)}}, + {{TOBN(0xe0542c1d, 0x3dc090bc), TOBN(0x82c996ef, 0xaa59c167), + TOBN(0xe3f735e8, 0x0ee7fc4d), TOBN(0x7b179393, 0x7c35db79)}, + {TOBN(0xb6419e25, 0xf8c5dbfd), TOBN(0x4d9d7a1e, 0x1f327b04), + TOBN(0x979f6f9b, 0x298dfca8), TOBN(0xc7c5dff1, 0x8de9366a)}}, + {{TOBN(0x1b7a588d, 0x04c82bdd), TOBN(0x68005534, 0xf8319dfd), + TOBN(0xde8a55b5, 0xd8eb9580), TOBN(0x5ea886da, 0x8d5bca81)}, + {TOBN(0xe8530a01, 0x252a0b4d), TOBN(0x1bffb4fe, 0x35eaa0a1), + TOBN(0x2ad828b1, 0xd8e99563), TOBN(0x7de96ef5, 0x95f9cd87)}}, + {{TOBN(0x4abb2d0c, 0xd77d970c), TOBN(0x03cfb933, 0xd33ef9cb), + TOBN(0xb0547c01, 0x8b211fe9), TOBN(0x2fe64809, 0xa56ed1c6)}, + {TOBN(0xcb7d5624, 0xc2ac98cc), TOBN(0x2a1372c0, 0x1a393e33), + TOBN(0xc8d1ec1c, 0x29660521), TOBN(0xf3d31b04, 0xb37ac3e9)}}, + {{TOBN(0xa29ae9df, 0x5ece6e7c), TOBN(0x0603ac8f, 0x0facfb55), + TOBN(0xcfe85b7a, 0xdda233a5), TOBN(0xe618919f, 0xbd75f0b8)}, + {TOBN(0xf555a3d2, 0x99bf1603), TOBN(0x1f43afc9, 0xf184255a), + TOBN(0xdcdaf341, 0x319a3e02), TOBN(0xd3b117ef, 0x03903a39)}}, + {{TOBN(0xe095da13, 0x65d1d131), TOBN(0x86f16367, 0xc37ad03e), + TOBN(0x5f37389e, 0x462cd8dd), TOBN(0xc103fa04, 0xd67a60e6)}, + {TOBN(0x57c34344, 0xf4b478f0), TOBN(0xce91edd8, 0xe117c98d), + TOBN(0x001777b0, 0x231fc12e), TOBN(0x11ae47f2, 0xb207bccb)}}, + {{TOBN(0xd983cf8d, 0x20f8a242), TOBN(0x7aff5b1d, 0xf22e1ad8), + TOBN(0x68fd11d0, 0x7fc4feb3), TOBN(0x5d53ae90, 0xb0f1c3e1)}, + {TOBN(0x50fb7905, 0xec041803), TOBN(0x85e3c977, 0x14404888), + TOBN(0x0e67faed, 0xac628d8f), TOBN(0x2e865150, 0x6668532c)}}, + {{TOBN(0x15acaaa4, 0x6a67a6b0), TOBN(0xf4cdee25, 0xb25cec41), + TOBN(0x49ee565a, 0xe4c6701e), TOBN(0x2a04ca66, 0xfc7d63d8)}, + {TOBN(0xeb105018, 0xef0543fb), TOBN(0xf709a4f5, 0xd1b0d81d), + TOBN(0x5b906ee6, 0x2915d333), TOBN(0xf4a87412, 0x96f1f0ab)}}, + {{TOBN(0xb6b82fa7, 0x4d82f4c2), TOBN(0x90725a60, 0x6804efb3), + TOBN(0xbc82ec46, 0xadc3425e), TOBN(0xb7b80581, 0x2787843e)}, + {TOBN(0xdf46d91c, 0xdd1fc74c), TOBN(0xdc1c62cb, 0xe783a6c4), + TOBN(0x59d1b9f3, 0x1a04cbba), TOBN(0xd87f6f72, 0x95e40764)}}, + {{TOBN(0x02b4cfc1, 0x317f4a76), TOBN(0x8d2703eb, 0x91036bce), + TOBN(0x98206cc6, 0xa5e72a56), TOBN(0x57be9ed1, 0xcf53fb0f)}, + {TOBN(0x09374571, 0xef0b17ac), TOBN(0x74b2655e, 0xd9181b38), + TOBN(0xc8f80ea8, 0x89935d0e), TOBN(0xc0d9e942, 0x91529936)}}, + {{TOBN(0x19686041, 0x1e84e0e5), TOBN(0xa5db84d3, 0xaea34c93), + TOBN(0xf9d5bb19, 0x7073a732), TOBN(0xb8d2fe56, 0x6bcfd7c0)}, + {TOBN(0x45775f36, 0xf3eb82fa), TOBN(0x8cb20ccc, 0xfdff8b58), + TOBN(0x1659b65f, 0x8374c110), TOBN(0xb8b4a422, 0x330c789a)}}, + {{TOBN(0x75e3c3ea, 0x6fe8208b), TOBN(0xbd74b9e4, 0x286e78fe), + TOBN(0x0be2e81b, 0xd7d93a1a), TOBN(0x7ed06e27, 0xdd0a5aae)}, + {TOBN(0x721f5a58, 0x6be8b800), TOBN(0x428299d1, 0xd846db28), + TOBN(0x95cb8e6b, 0x5be88ed3), TOBN(0xc3186b23, 0x1c034e11)}}, + {{TOBN(0xa6312c9e, 0x8977d99b), TOBN(0xbe944331, 0x83f531e7), + TOBN(0x8232c0c2, 0x18d3b1d4), TOBN(0x617aae8b, 0xe1247b73)}, + {TOBN(0x40153fc4, 0x282aec3b), TOBN(0xc6063d2f, 0xf7b8f823), + TOBN(0x68f10e58, 0x3304f94c), TOBN(0x31efae74, 0xee676346)}}, + {{TOBN(0xbadb6c6d, 0x40a9b97c), TOBN(0x14702c63, 0x4f666256), + TOBN(0xdeb954f1, 0x5184b2e3), TOBN(0x5184a526, 0x94b6ca40)}, + {TOBN(0xfff05337, 0x003c32ea), TOBN(0x5aa374dd, 0x205974c7), + TOBN(0x9a763854, 0x4b0dd71a), TOBN(0x459cd27f, 0xdeb947ec)}}, + {{TOBN(0xa6e28161, 0x459c2b92), TOBN(0x2f020fa8, 0x75ee8ef5), + TOBN(0xb132ec2d, 0x30b06310), TOBN(0xc3e15899, 0xbc6a4530)}, + {TOBN(0xdc5f53fe, 0xaa3f451a), TOBN(0x3a3c7f23, 0xc2d9acac), + TOBN(0x2ec2f892, 0x6b27e58b), TOBN(0x68466ee7, 0xd742799f)}}, + {{TOBN(0x98324dd4, 0x1fa26613), TOBN(0xa2dc6dab, 0xbdc29d63), + TOBN(0xf9675faa, 0xd712d657), TOBN(0x813994be, 0x21fd8d15)}, + {TOBN(0x5ccbb722, 0xfd4f7553), TOBN(0x5135ff8b, 0xf3a36b20), + TOBN(0x44be28af, 0x69559df5), TOBN(0x40b65bed, 0x9d41bf30)}}, + {{TOBN(0xd98bf2a4, 0x3734e520), TOBN(0x5e3abbe3, 0x209bdcba), + TOBN(0x77c76553, 0xbc945b35), TOBN(0x5331c093, 0xc6ef14aa)}, + {TOBN(0x518ffe29, 0x76b60c80), TOBN(0x2285593b, 0x7ace16f8), + TOBN(0xab1f64cc, 0xbe2b9784), TOBN(0xe8f2c0d9, 0xab2421b6)}}, + {{TOBN(0x617d7174, 0xc1df065c), TOBN(0xafeeb5ab, 0x5f6578fa), + TOBN(0x16ff1329, 0x263b54a8), TOBN(0x45c55808, 0xc990dce3)}, + {TOBN(0x42eab6c0, 0xecc8c177), TOBN(0x799ea9b5, 0x5982ecaa), + TOBN(0xf65da244, 0xb607ef8e), TOBN(0x8ab226ce, 0x32a3fc2c)}}, + {{TOBN(0x745741e5, 0x7ea973dc), TOBN(0x5c00ca70, 0x20888f2e), + TOBN(0x7cdce3cf, 0x45fd9cf1), TOBN(0x8a741ef1, 0x5507f872)}, + {TOBN(0x47c51c2f, 0x196b4cec), TOBN(0x70d08e43, 0xc97ea618), + TOBN(0x930da15c, 0x15b18a2b), TOBN(0x33b6c678, 0x2f610514)}}, + {{TOBN(0xc662e4f8, 0x07ac9794), TOBN(0x1eccf050, 0xba06cb79), + TOBN(0x1ff08623, 0xe7d954e5), TOBN(0x6ef2c5fb, 0x24cf71c3)}, + {TOBN(0xb2c063d2, 0x67978453), TOBN(0xa0cf3796, 0x1d654af8), + TOBN(0x7cb242ea, 0x7ebdaa37), TOBN(0x206e0b10, 0xb86747e0)}}, + {{TOBN(0x481dae5f, 0xd5ecfefc), TOBN(0x07084fd8, 0xc2bff8fc), + TOBN(0x8040a01a, 0xea324596), TOBN(0x4c646980, 0xd4de4036)}, + {TOBN(0x9eb8ab4e, 0xd65abfc3), TOBN(0xe01cb91f, 0x13541ec7), + TOBN(0x8f029adb, 0xfd695012), TOBN(0x9ae28483, 0x3c7569ec)}}, + {{TOBN(0xa5614c9e, 0xa66d80a1), TOBN(0x680a3e44, 0x75f5f911), + TOBN(0x0c07b14d, 0xceba4fc1), TOBN(0x891c285b, 0xa13071c1)}, + {TOBN(0xcac67ceb, 0x799ece3c), TOBN(0x29b910a9, 0x41e07e27), + TOBN(0x66bdb409, 0xf2e43123), TOBN(0x06f8b137, 0x7ac9ecbe)}}, + {{TOBN(0x5981fafd, 0x38547090), TOBN(0x19ab8b9f, 0x85e3415d), + TOBN(0xfc28c194, 0xc7e31b27), TOBN(0x843be0aa, 0x6fbcbb42)}, + {TOBN(0xf3b1ed43, 0xa6db836c), TOBN(0x2a1330e4, 0x01a45c05), + TOBN(0x4f19f3c5, 0x95c1a377), TOBN(0xa85f39d0, 0x44b5ee33)}}, + {{TOBN(0x3da18e6d, 0x4ae52834), TOBN(0x5a403b39, 0x7423dcb0), + TOBN(0xbb555e0a, 0xf2374aef), TOBN(0x2ad599c4, 0x1e8ca111)}, + {TOBN(0x1b3a2fb9, 0x014b3bf8), TOBN(0x73092684, 0xf66d5007), + TOBN(0x079f1426, 0xc4340102), TOBN(0x1827cf81, 0x8fddf4de)}}, + {{TOBN(0xc83605f6, 0xf10ff927), TOBN(0xd3871451, 0x23739fc6), + TOBN(0x6d163450, 0xcac1c2cc), TOBN(0x6b521296, 0xa2ec1ac5)}, + {TOBN(0x0606c4f9, 0x6e3cb4a5), TOBN(0xe47d3f41, 0x778abff7), + TOBN(0x425a8d5e, 0xbe8e3a45), TOBN(0x53ea9e97, 0xa6102160)}}, + {{TOBN(0x477a106e, 0x39cbb688), TOBN(0x532401d2, 0xf3386d32), + TOBN(0x8e564f64, 0xb1b9b421), TOBN(0xca9b8388, 0x81dad33f)}, + {TOBN(0xb1422b4e, 0x2093913e), TOBN(0x533d2f92, 0x69bc8112), + TOBN(0x3fa017be, 0xebe7b2c7), TOBN(0xb2767c4a, 0xcaf197c6)}}, + {{TOBN(0xc925ff87, 0xaedbae9f), TOBN(0x7daf0eb9, 0x36880a54), + TOBN(0x9284ddf5, 0x9c4d0e71), TOBN(0x1581cf93, 0x316f8cf5)}, + {TOBN(0x3eeca887, 0x3ac1f452), TOBN(0xb417fce9, 0xfb6aeffe), + TOBN(0xa5918046, 0xeefb8dc3), TOBN(0x73d318ac, 0x02209400)}}, + {{TOBN(0xe800400f, 0x728693e5), TOBN(0xe87d814b, 0x339927ed), + TOBN(0x93e94d3b, 0x57ea9910), TOBN(0xff8a35b6, 0x2245fb69)}, + {TOBN(0x043853d7, 0x7f200d34), TOBN(0x470f1e68, 0x0f653ce1), + TOBN(0x81ac05bd, 0x59a06379), TOBN(0xa14052c2, 0x03930c29)}}, + {{TOBN(0x6b72fab5, 0x26bc2797), TOBN(0x13670d16, 0x99f16771), + TOBN(0x00170052, 0x1e3e48d1), TOBN(0x978fe401, 0xb7adf678)}, + {TOBN(0x55ecfb92, 0xd41c5dd4), TOBN(0x5ff8e247, 0xc7b27da5), + TOBN(0xe7518272, 0x013fb606), TOBN(0x5768d7e5, 0x2f547a3c)}}, + {{TOBN(0xbb24eaa3, 0x60017a5f), TOBN(0x6b18e6e4, 0x9c64ce9b), + TOBN(0xc225c655, 0x103dde07), TOBN(0xfc3672ae, 0x7592f7ea)}, + {TOBN(0x9606ad77, 0xd06283a1), TOBN(0x542fc650, 0xe4d59d99), + TOBN(0xabb57c49, 0x2a40e7c2), TOBN(0xac948f13, 0xa8db9f55)}}, + {{TOBN(0x6d4c9682, 0xb04465c3), TOBN(0xe3d062fa, 0x6468bd15), + TOBN(0xa51729ac, 0x5f318d7e), TOBN(0x1fc87df6, 0x9eb6fc95)}, + {TOBN(0x63d146a8, 0x0591f652), TOBN(0xa861b8f7, 0x589621aa), + TOBN(0x59f5f15a, 0xce31348c), TOBN(0x8f663391, 0x440da6da)}}, + {{TOBN(0xcfa778ac, 0xb591ffa3), TOBN(0x027ca9c5, 0x4cdfebce), + TOBN(0xbe8e05a5, 0x444ea6b3), TOBN(0x8aab4e69, 0xa78d8254)}, + {TOBN(0x2437f04f, 0xb474d6b8), TOBN(0x6597ffd4, 0x045b3855), + TOBN(0xbb0aea4e, 0xca47ecaa), TOBN(0x568aae83, 0x85c7ebfc)}}, + {{TOBN(0x0e966e64, 0xc73b2383), TOBN(0x49eb3447, 0xd17d8762), + TOBN(0xde107821, 0x8da05dab), TOBN(0x443d8baa, 0x016b7236)}, + {TOBN(0x163b63a5, 0xea7610d6), TOBN(0xe47e4185, 0xce1ca979), + TOBN(0xae648b65, 0x80baa132), TOBN(0xebf53de2, 0x0e0d5b64)}}, + {{TOBN(0x8d3bfcb4, 0xd3c8c1ca), TOBN(0x0d914ef3, 0x5d04b309), + TOBN(0x55ef6415, 0x3de7d395), TOBN(0xbde1666f, 0x26b850e8)}, + {TOBN(0xdbe1ca6e, 0xd449ab19), TOBN(0x8902b322, 0xe89a2672), + TOBN(0xb1674b7e, 0xdacb7a53), TOBN(0x8e9faf6e, 0xf52523ff)}}, + {{TOBN(0x6ba535da, 0x9a85788b), TOBN(0xd21f03ae, 0xbd0626d4), + TOBN(0x099f8c47, 0xe873dc64), TOBN(0xcda8564d, 0x018ec97e)}, + {TOBN(0x3e8d7a5c, 0xde92c68c), TOBN(0x78e035a1, 0x73323cc4), + TOBN(0x3ef26275, 0xf880ff7c), TOBN(0xa4ee3dff, 0x273eedaa)}}, + {{TOBN(0x58823507, 0xaf4e18f8), TOBN(0x967ec9b5, 0x0672f328), + TOBN(0x9ded19d9, 0x559d3186), TOBN(0x5e2ab3de, 0x6cdce39c)}, + {TOBN(0xabad6e4d, 0x11c226df), TOBN(0xf9783f43, 0x87723014), + TOBN(0x9a49a0cf, 0x1a885719), TOBN(0xfc0c1a5a, 0x90da9dbf)}}, + {{TOBN(0x8bbaec49, 0x571d92ac), TOBN(0x569e85fe, 0x4692517f), + TOBN(0x8333b014, 0xa14ea4af), TOBN(0x32f2a62f, 0x12e5c5ad)}, + {TOBN(0x98c2ce3a, 0x06d89b85), TOBN(0xb90741aa, 0x2ff77a08), + TOBN(0x2530defc, 0x01f795a2), TOBN(0xd6e5ba0b, 0x84b3c199)}}, + {{TOBN(0x7d8e8451, 0x12e4c936), TOBN(0xae419f7d, 0xbd0be17b), + TOBN(0xa583fc8c, 0x22262bc9), TOBN(0x6b842ac7, 0x91bfe2bd)}, + {TOBN(0x33cef4e9, 0x440d6827), TOBN(0x5f69f4de, 0xef81fb14), + TOBN(0xf16cf6f6, 0x234fbb92), TOBN(0x76ae3fc3, 0xd9e7e158)}}, + {{TOBN(0x4e89f6c2, 0xe9740b33), TOBN(0x677bc85d, 0x4962d6a1), + TOBN(0x6c6d8a7f, 0x68d10d15), TOBN(0x5f9a7224, 0x0257b1cd)}, + {TOBN(0x7096b916, 0x4ad85961), TOBN(0x5f8c47f7, 0xe657ab4a), + TOBN(0xde57d7d0, 0xf7461d7e), TOBN(0x7eb6094d, 0x80ce5ee2)}}, + {{TOBN(0x0b1e1dfd, 0x34190547), TOBN(0x8a394f43, 0xf05dd150), + TOBN(0x0a9eb24d, 0x97df44e6), TOBN(0x78ca06bf, 0x87675719)}, + {TOBN(0x6f0b3462, 0x6ffeec22), TOBN(0x9d91bcea, 0x36cdd8fb), + TOBN(0xac83363c, 0xa105be47), TOBN(0x81ba76c1, 0x069710e3)}}, + {{TOBN(0x3d1b24cb, 0x28c682c6), TOBN(0x27f25228, 0x8612575b), + TOBN(0xb587c779, 0xe8e66e98), TOBN(0x7b0c03e9, 0x405eb1fe)}, + {TOBN(0xfdf0d030, 0x15b548e7), TOBN(0xa8be76e0, 0x38b36af7), + TOBN(0x4cdab04a, 0x4f310c40), TOBN(0x6287223e, 0xf47ecaec)}}, + {{TOBN(0x678e6055, 0x8b399320), TOBN(0x61fe3fa6, 0xc01e4646), + TOBN(0xc482866b, 0x03261a5e), TOBN(0xdfcf45b8, 0x5c2f244a)}, + {TOBN(0x8fab9a51, 0x2f684b43), TOBN(0xf796c654, 0xc7220a66), + TOBN(0x1d90707e, 0xf5afa58f), TOBN(0x2c421d97, 0x4fdbe0de)}}, + {{TOBN(0xc4f4cda3, 0xaf2ebc2f), TOBN(0xa0af843d, 0xcb4efe24), + TOBN(0x53b857c1, 0x9ccd10b1), TOBN(0xddc9d1eb, 0x914d3e04)}, + {TOBN(0x7bdec8bb, 0x62771deb), TOBN(0x829277aa, 0x91c5aa81), + TOBN(0x7af18dd6, 0x832391ae), TOBN(0x1740f316, 0xc71a84ca)}}}, + {{{TOBN(0x8928e99a, 0xeeaf8c49), TOBN(0xee7aa73d, 0x6e24d728), + TOBN(0x4c5007c2, 0xe72b156c), TOBN(0x5fcf57c5, 0xed408a1d)}, + {TOBN(0x9f719e39, 0xb6057604), TOBN(0x7d343c01, 0xc2868bbf), + TOBN(0x2cca254b, 0x7e103e2d), TOBN(0xe6eb38a9, 0xf131bea2)}}, + {{TOBN(0xb33e624f, 0x8be762b4), TOBN(0x2a9ee4d1, 0x058e3413), + TOBN(0x968e6369, 0x67d805fa), TOBN(0x9848949b, 0x7db8bfd7)}, + {TOBN(0x5308d7e5, 0xd23a8417), TOBN(0x892f3b1d, 0xf3e29da5), + TOBN(0xc95c139e, 0x3dee471f), TOBN(0x8631594d, 0xd757e089)}}, + {{TOBN(0xe0c82a3c, 0xde918dcc), TOBN(0x2e7b5994, 0x26fdcf4b), + TOBN(0x82c50249, 0x32cb1b2d), TOBN(0xea613a9d, 0x7657ae07)}, + {TOBN(0xc2eb5f6c, 0xf1fdc9f7), TOBN(0xb6eae8b8, 0x879fe682), + TOBN(0x253dfee0, 0x591cbc7f), TOBN(0x000da713, 0x3e1290e6)}}, + {{TOBN(0x1083e2ea, 0x1f095615), TOBN(0x0a28ad77, 0x14e68c33), + TOBN(0x6bfc0252, 0x3d8818be), TOBN(0xb585113a, 0xf35850cd)}, + {TOBN(0x7d935f0b, 0x30df8aa1), TOBN(0xaddda07c, 0x4ab7e3ac), + TOBN(0x92c34299, 0x552f00cb), TOBN(0xc33ed1de, 0x2909df6c)}}, + {{TOBN(0x22c2195d, 0x80e87766), TOBN(0x9e99e6d8, 0x9ddf4ac0), + TOBN(0x09642e4e, 0x65e74934), TOBN(0x2610ffa2, 0xff1ff241)}, + {TOBN(0x4d1d47d4, 0x751c8159), TOBN(0x697b4985, 0xaf3a9363), + TOBN(0x0318ca46, 0x87477c33), TOBN(0xa90cb565, 0x9441eff3)}}, + {{TOBN(0x58bb3848, 0x36f024cb), TOBN(0x85be1f77, 0x36016168), + TOBN(0x6c59587c, 0xdc7e07f1), TOBN(0x191be071, 0xaf1d8f02)}, + {TOBN(0xbf169fa5, 0xcca5e55c), TOBN(0x3864ba3c, 0xf7d04eac), + TOBN(0x915e367f, 0x8d7d05db), TOBN(0xb48a876d, 0xa6549e5d)}}, + {{TOBN(0xef89c656, 0x580e40a2), TOBN(0xf194ed8c, 0x728068bc), + TOBN(0x74528045, 0xa47990c9), TOBN(0xf53fc7d7, 0x5e1a4649)}, + {TOBN(0xbec5ae9b, 0x78593e7d), TOBN(0x2cac4ee3, 0x41db65d7), + TOBN(0xa8c1eb24, 0x04a3d39b), TOBN(0x53b7d634, 0x03f8f3ef)}}, + {{TOBN(0x2dc40d48, 0x3e07113c), TOBN(0x6e4a5d39, 0x7d8b63ae), + TOBN(0x5582a94b, 0x79684c2b), TOBN(0x932b33d4, 0x622da26c)}, + {TOBN(0xf534f651, 0x0dbbf08d), TOBN(0x211d07c9, 0x64c23a52), + TOBN(0x0eeece0f, 0xee5bdc9b), TOBN(0xdf178168, 0xf7015558)}}, + {{TOBN(0xd4294635, 0x0a712229), TOBN(0x93cbe448, 0x09273f8c), + TOBN(0x00b095ef, 0x8f13bc83), TOBN(0xbb741972, 0x8798978c)}, + {TOBN(0x9d7309a2, 0x56dbe6e7), TOBN(0xe578ec56, 0x5a5d39ec), + TOBN(0x3961151b, 0x851f9a31), TOBN(0x2da7715d, 0xe5709eb4)}}, + {{TOBN(0x867f3017, 0x53dfabf0), TOBN(0x728d2078, 0xb8e39259), + TOBN(0x5c75a0cd, 0x815d9958), TOBN(0xf84867a6, 0x16603be1)}, + {TOBN(0xc865b13d, 0x70e35b1c), TOBN(0x02414468, 0x19b03e2c), + TOBN(0xe46041da, 0xac1f3121), TOBN(0x7c9017ad, 0x6f028a7c)}}, + {{TOBN(0xabc96de9, 0x0a482873), TOBN(0x4265d6b1, 0xb77e54d4), + TOBN(0x68c38e79, 0xa57d88e7), TOBN(0xd461d766, 0x9ce82de3)}, + {TOBN(0x817a9ec5, 0x64a7e489), TOBN(0xcc5675cd, 0xa0def5f2), + TOBN(0x9a00e785, 0x985d494e), TOBN(0xc626833f, 0x1b03514a)}}, + {{TOBN(0xabe7905a, 0x83cdd60e), TOBN(0x50602fb5, 0xa1170184), + TOBN(0x689886cd, 0xb023642a), TOBN(0xd568d090, 0xa6e1fb00)}, + {TOBN(0x5b1922c7, 0x0259217f), TOBN(0x93831cd9, 0xc43141e4), + TOBN(0xdfca3587, 0x0c95f86e), TOBN(0xdec2057a, 0x568ae828)}}, + {{TOBN(0xc44ea599, 0xf98a759a), TOBN(0x55a0a7a2, 0xf7c23c1d), + TOBN(0xd5ffb6e6, 0x94c4f687), TOBN(0x3563cce2, 0x12848478)}, + {TOBN(0x812b3517, 0xe7b1fbe1), TOBN(0x8a7dc979, 0x4f7338e0), + TOBN(0x211ecee9, 0x52d048db), TOBN(0x2eea4056, 0xc86ea3b8)}}, + {{TOBN(0xd8cb68a7, 0xba772b34), TOBN(0xe16ed341, 0x5f4e2541), + TOBN(0x9b32f6a6, 0x0fec14db), TOBN(0xeee376f7, 0x391698be)}, + {TOBN(0xe9a7aa17, 0x83674c02), TOBN(0x65832f97, 0x5843022a), + TOBN(0x29f3a8da, 0x5ba4990f), TOBN(0x79a59c3a, 0xfb8e3216)}}, + {{TOBN(0x9cdc4d2e, 0xbd19bb16), TOBN(0xc6c7cfd0, 0xb3262d86), + TOBN(0xd4ce14d0, 0x969c0b47), TOBN(0x1fa352b7, 0x13e56128)}, + {TOBN(0x383d55b8, 0x973db6d3), TOBN(0x71836850, 0xe8e5b7bf), + TOBN(0xc7714596, 0xe6bb571f), TOBN(0x259df31f, 0x2d5b2dd2)}}, + {{TOBN(0x568f8925, 0x913cc16d), TOBN(0x18bc5b6d, 0xe1a26f5a), + TOBN(0xdfa413be, 0xf5f499ae), TOBN(0xf8835dec, 0xc3f0ae84)}, + {TOBN(0xb6e60bd8, 0x65a40ab0), TOBN(0x65596439, 0x194b377e), + TOBN(0xbcd85625, 0x92084a69), TOBN(0x5ce433b9, 0x4f23ede0)}}, + {{TOBN(0xe8e8f04f, 0x6ad65143), TOBN(0x11511827, 0xd6e14af6), + TOBN(0x3d390a10, 0x8295c0c7), TOBN(0x71e29ee4, 0x621eba16)}, + {TOBN(0xa588fc09, 0x63717b46), TOBN(0x02be02fe, 0xe06ad4a2), + TOBN(0x931558c6, 0x04c22b22), TOBN(0xbb4d4bd6, 0x12f3c849)}}, + {{TOBN(0x54a4f496, 0x20efd662), TOBN(0x92ba6d20, 0xc5952d14), + TOBN(0x2db8ea1e, 0xcc9784c2), TOBN(0x81cc10ca, 0x4b353644)}, + {TOBN(0x40b570ad, 0x4b4d7f6c), TOBN(0x5c9f1d96, 0x84a1dcd2), + TOBN(0x01379f81, 0x3147e797), TOBN(0xe5c6097b, 0x2bd499f5)}}, + {{TOBN(0x40dcafa6, 0x328e5e20), TOBN(0xf7b5244a, 0x54815550), + TOBN(0xb9a4f118, 0x47bfc978), TOBN(0x0ea0e79f, 0xd25825b1)}, + {TOBN(0xa50f96eb, 0x646c7ecf), TOBN(0xeb811493, 0x446dea9d), + TOBN(0x2af04677, 0xdfabcf69), TOBN(0xbe3a068f, 0xc713f6e8)}}, + {{TOBN(0x860d523d, 0x42e06189), TOBN(0xbf077941, 0x4e3aff13), + TOBN(0x0b616dca, 0xc1b20650), TOBN(0xe66dd6d1, 0x2131300d)}, + {TOBN(0xd4a0fd67, 0xff99abde), TOBN(0xc9903550, 0xc7aac50d), + TOBN(0x022ecf8b, 0x7c46b2d7), TOBN(0x3333b1e8, 0x3abf92af)}}, + {{TOBN(0x11cc113c, 0x6c491c14), TOBN(0x05976688, 0x80dd3f88), + TOBN(0xf5b4d9e7, 0x29d932ed), TOBN(0xe982aad8, 0xa2c38b6d)}, + {TOBN(0x6f925347, 0x8be0dcf0), TOBN(0x700080ae, 0x65ca53f2), + TOBN(0xd8131156, 0x443ca77f), TOBN(0xe92d6942, 0xec51f984)}}, + {{TOBN(0xd2a08af8, 0x85dfe9ae), TOBN(0xd825d9a5, 0x4d2a86ca), + TOBN(0x2c53988d, 0x39dff020), TOBN(0xf38b135a, 0x430cdc40)}, + {TOBN(0x0c918ae0, 0x62a7150b), TOBN(0xf31fd8de, 0x0c340e9b), + TOBN(0xafa0e7ae, 0x4dbbf02e), TOBN(0x5847fb2a, 0x5eba6239)}}, + {{TOBN(0x6b1647dc, 0xdccbac8b), TOBN(0xb642aa78, 0x06f485c8), + TOBN(0x873f3765, 0x7038ecdf), TOBN(0x2ce5e865, 0xfa49d3fe)}, + {TOBN(0xea223788, 0xc98c4400), TOBN(0x8104a8cd, 0xf1fa5279), + TOBN(0xbcf7cc7a, 0x06becfd7), TOBN(0x49424316, 0xc8f974ae)}}, + {{TOBN(0xc0da65e7, 0x84d6365d), TOBN(0xbcb7443f, 0x8f759fb8), + TOBN(0x35c712b1, 0x7ae81930), TOBN(0x80428dff, 0x4c6e08ab)}, + {TOBN(0xf19dafef, 0xa4faf843), TOBN(0xced8538d, 0xffa9855f), + TOBN(0x20ac409c, 0xbe3ac7ce), TOBN(0x358c1fb6, 0x882da71e)}}, + {{TOBN(0xafa9c0e5, 0xfd349961), TOBN(0x2b2cfa51, 0x8421c2fc), + TOBN(0x2a80db17, 0xf3a28d38), TOBN(0xa8aba539, 0x5d138e7e)}, + {TOBN(0x52012d1d, 0x6e96eb8d), TOBN(0x65d8dea0, 0xcbaf9622), + TOBN(0x57735447, 0xb264f56c), TOBN(0xbeebef3f, 0x1b6c8da2)}}, + {{TOBN(0xfc346d98, 0xce785254), TOBN(0xd50e8d72, 0xbb64a161), + TOBN(0xc03567c7, 0x49794add), TOBN(0x15a76065, 0x752c7ef6)}, + {TOBN(0x59f3a222, 0x961f23d6), TOBN(0x378e4438, 0x73ecc0b0), + TOBN(0xc74be434, 0x5a82fde4), TOBN(0xae509af2, 0xd8b9cf34)}}, + {{TOBN(0x4a61ee46, 0x577f44a1), TOBN(0xe09b748c, 0xb611deeb), + TOBN(0xc0481b2c, 0xf5f7b884), TOBN(0x35626678, 0x61acfa6b)}, + {TOBN(0x37f4c518, 0xbf8d21e6), TOBN(0x22d96531, 0xb205a76d), + TOBN(0x37fb85e1, 0x954073c0), TOBN(0xbceafe4f, 0x65b3a567)}}, + {{TOBN(0xefecdef7, 0xbe42a582), TOBN(0xd3fc6080, 0x65046be6), + TOBN(0xc9af13c8, 0x09e8dba9), TOBN(0x1e6c9847, 0x641491ff)}, + {TOBN(0x3b574925, 0xd30c31f7), TOBN(0xb7eb72ba, 0xac2a2122), + TOBN(0x776a0dac, 0xef0859e7), TOBN(0x06fec314, 0x21900942)}}, + {{TOBN(0x2464bc10, 0xf8c22049), TOBN(0x9bfbcce7, 0x875ebf69), + TOBN(0xd7a88e2a, 0x4336326b), TOBN(0xda05261c, 0x5bc2acfa)}, + {TOBN(0xc29f5bdc, 0xeba7efc8), TOBN(0x471237ca, 0x25dbbf2e), + TOBN(0xa72773f2, 0x2975f127), TOBN(0xdc744e8e, 0x04d0b326)}}, + {{TOBN(0x38a7ed16, 0xa56edb73), TOBN(0x64357e37, 0x2c007e70), + TOBN(0xa167d15b, 0x5080b400), TOBN(0x07b41164, 0x23de4be1)}, + {TOBN(0xb2d91e32, 0x74c89883), TOBN(0x3c162821, 0x2882e7ed), + TOBN(0xad6b36ba, 0x7503e482), TOBN(0x48434e8e, 0x0ea34331)}}, + {{TOBN(0x79f4f24f, 0x2c7ae0b9), TOBN(0xc46fbf81, 0x1939b44a), + TOBN(0x76fefae8, 0x56595eb1), TOBN(0x417b66ab, 0xcd5f29c7)}, + {TOBN(0x5f2332b2, 0xc5ceec20), TOBN(0xd69661ff, 0xe1a1cae2), + TOBN(0x5ede7e52, 0x9b0286e6), TOBN(0x9d062529, 0xe276b993)}}, + {{TOBN(0x324794b0, 0x7e50122b), TOBN(0xdd744f8b, 0x4af07ca5), + TOBN(0x30a12f08, 0xd63fc97b), TOBN(0x39650f1a, 0x76626d9d)}, + {TOBN(0x101b47f7, 0x1fa38477), TOBN(0x3d815f19, 0xd4dc124f), + TOBN(0x1569ae95, 0xb26eb58a), TOBN(0xc3cde188, 0x95fb1887)}}, + {{TOBN(0x54e9f37b, 0xf9539a48), TOBN(0xb0100e06, 0x7408c1a5), + TOBN(0x821d9811, 0xea580cbb), TOBN(0x8af52d35, 0x86e50c56)}, + {TOBN(0xdfbd9d47, 0xdbbf698b), TOBN(0x2961a1ea, 0x03dc1c73), + TOBN(0x203d38f8, 0xe76a5df8), TOBN(0x08a53a68, 0x6def707a)}}, + {{TOBN(0x26eefb48, 0x1bee45d4), TOBN(0xb3cee346, 0x3c688036), + TOBN(0x463c5315, 0xc42f2469), TOBN(0x19d84d2e, 0x81378162)}, + {TOBN(0x22d7c3c5, 0x1c4d349f), TOBN(0x65965844, 0x163d59c5), + TOBN(0xcf198c56, 0xb8abceae), TOBN(0x6fb1fb1b, 0x628559d5)}}, + {{TOBN(0x8bbffd06, 0x07bf8fe3), TOBN(0x46259c58, 0x3467734b), + TOBN(0xd8953cea, 0x35f7f0d3), TOBN(0x1f0bece2, 0xd65b0ff1)}, + {TOBN(0xf7d5b4b3, 0xf3c72914), TOBN(0x29e8ea95, 0x3cb53389), + TOBN(0x4a365626, 0x836b6d46), TOBN(0xe849f910, 0xea174fde)}}, + {{TOBN(0x7ec62fbb, 0xf4737f21), TOBN(0xd8dba5ab, 0x6209f5ac), + TOBN(0x24b5d7a9, 0xa5f9adbe), TOBN(0x707d28f7, 0xa61dc768)}, + {TOBN(0x7711460b, 0xcaa999ea), TOBN(0xba7b174d, 0x1c92e4cc), + TOBN(0x3c4bab66, 0x18d4bf2d), TOBN(0xb8f0c980, 0xeb8bd279)}}, + {{TOBN(0x024bea9a, 0x324b4737), TOBN(0xfba9e423, 0x32a83bca), + TOBN(0x6e635643, 0xa232dced), TOBN(0x99619367, 0x2571c8ba)}, + {TOBN(0xe8c9f357, 0x54b7032b), TOBN(0xf936b3ba, 0x2442d54a), + TOBN(0x2263f0f0, 0x8290c65a), TOBN(0x48989780, 0xee2c7fdb)}}, + {{TOBN(0xadc5d55a, 0x13d4f95e), TOBN(0x737cff85, 0xad9b8500), + TOBN(0x271c557b, 0x8a73f43d), TOBN(0xbed617a4, 0xe18bc476)}, + {TOBN(0x66245401, 0x7dfd8ab2), TOBN(0xae7b89ae, 0x3a2870aa), + TOBN(0x1b555f53, 0x23a7e545), TOBN(0x6791e247, 0xbe057e4c)}}, + {{TOBN(0x860136ad, 0x324fa34d), TOBN(0xea111447, 0x4cbeae28), + TOBN(0x023a4270, 0xbedd3299), TOBN(0x3d5c3a7f, 0xc1c35c34)}, + {TOBN(0xb0f6db67, 0x8d0412d2), TOBN(0xd92625e2, 0xfcdc6b9a), + TOBN(0x92ae5ccc, 0x4e28a982), TOBN(0xea251c36, 0x47a3ce7e)}}, + {{TOBN(0x9d658932, 0x790691bf), TOBN(0xed610589, 0x06b736ae), + TOBN(0x712c2f04, 0xc0d63b6e), TOBN(0x5cf06fd5, 0xc63d488f)}, + {TOBN(0x97363fac, 0xd9588e41), TOBN(0x1f9bf762, 0x2b93257e), + TOBN(0xa9d1ffc4, 0x667acace), TOBN(0x1cf4a1aa, 0x0a061ecf)}}, + {{TOBN(0x40e48a49, 0xdc1818d0), TOBN(0x0643ff39, 0xa3621ab0), + TOBN(0x5768640c, 0xe39ef639), TOBN(0x1fc099ea, 0x04d86854)}, + {TOBN(0x9130b9c3, 0xeccd28fd), TOBN(0xd743cbd2, 0x7eec54ab), + TOBN(0x052b146f, 0xe5b475b6), TOBN(0x058d9a82, 0x900a7d1f)}}, + {{TOBN(0x65e02292, 0x91262b72), TOBN(0x96f924f9, 0xbb0edf03), + TOBN(0x5cfa59c8, 0xfe206842), TOBN(0xf6037004, 0x5eafa720)}, + {TOBN(0x5f30699e, 0x18d7dd96), TOBN(0x381e8782, 0xcbab2495), + TOBN(0x91669b46, 0xdd8be949), TOBN(0xb40606f5, 0x26aae8ef)}}, + {{TOBN(0x2812b839, 0xfc6751a4), TOBN(0x16196214, 0xfba800ef), + TOBN(0x4398d5ca, 0x4c1a2875), TOBN(0x720c00ee, 0x653d8349)}, + {TOBN(0xc2699eb0, 0xd820007c), TOBN(0x880ee660, 0xa39b5825), + TOBN(0x70694694, 0x471f6984), TOBN(0xf7d16ea8, 0xe3dda99a)}}, + {{TOBN(0x28d675b2, 0xc0519a23), TOBN(0x9ebf94fe, 0x4f6952e3), + TOBN(0xf28bb767, 0xa2294a8a), TOBN(0x85512b4d, 0xfe0af3f5)}, + {TOBN(0x18958ba8, 0x99b16a0d), TOBN(0x95c2430c, 0xba7548a7), + TOBN(0xb30d1b10, 0xa16be615), TOBN(0xe3ebbb97, 0x85bfb74c)}}, + {{TOBN(0xa3273cfe, 0x18549fdb), TOBN(0xf6e200bf, 0x4fcdb792), + TOBN(0x54a76e18, 0x83aba56c), TOBN(0x73ec66f6, 0x89ef6aa2)}, + {TOBN(0x8d17add7, 0xd1b9a305), TOBN(0xa959c5b9, 0xb7ae1b9d), + TOBN(0x88643522, 0x6bcc094a), TOBN(0xcc5616c4, 0xd7d429b9)}}, + {{TOBN(0xa6dada01, 0xe6a33f7c), TOBN(0xc6217a07, 0x9d4e70ad), + TOBN(0xd619a818, 0x09c15b7c), TOBN(0xea06b329, 0x0e80c854)}, + {TOBN(0x174811ce, 0xa5f5e7b9), TOBN(0x66dfc310, 0x787c65f4), + TOBN(0x4ea7bd69, 0x3316ab54), TOBN(0xc12c4acb, 0x1dcc0f70)}}, + {{TOBN(0xe4308d1a, 0x1e407dd9), TOBN(0xe8a3587c, 0x91afa997), + TOBN(0xea296c12, 0xab77b7a5), TOBN(0xb5ad49e4, 0x673c0d52)}, + {TOBN(0x40f9b2b2, 0x7006085a), TOBN(0xa88ff340, 0x87bf6ec2), + TOBN(0x978603b1, 0x4e3066a6), TOBN(0xb3f99fc2, 0xb5e486e2)}}, + {{TOBN(0x07b53f5e, 0xb2e63645), TOBN(0xbe57e547, 0x84c84232), + TOBN(0xd779c216, 0x7214d5cf), TOBN(0x617969cd, 0x029a3aca)}, + {TOBN(0xd17668cd, 0x8a7017a0), TOBN(0x77b4d19a, 0xbe9b7ee8), + TOBN(0x58fd0e93, 0x9c161776), TOBN(0xa8c4f4ef, 0xd5968a72)}}, + {{TOBN(0x296071cc, 0x67b3de77), TOBN(0xae3c0b8e, 0x634f7905), + TOBN(0x67e440c2, 0x8a7100c9), TOBN(0xbb8c3c1b, 0xeb4b9b42)}, + {TOBN(0x6d71e8ea, 0xc51b3583), TOBN(0x7591f5af, 0x9525e642), + TOBN(0xf73a2f7b, 0x13f509f3), TOBN(0x618487aa, 0x5619ac9b)}}, + {{TOBN(0x3a72e5f7, 0x9d61718a), TOBN(0x00413bcc, 0x7592d28c), + TOBN(0x7d9b11d3, 0x963c35cf), TOBN(0x77623bcf, 0xb90a46ed)}, + {TOBN(0xdeef273b, 0xdcdd2a50), TOBN(0x4a741f9b, 0x0601846e), + TOBN(0x33b89e51, 0x0ec6e929), TOBN(0xcb02319f, 0x8b7f22cd)}}, + {{TOBN(0xbbe1500d, 0x084bae24), TOBN(0x2f0ae8d7, 0x343d2693), + TOBN(0xacffb5f2, 0x7cdef811), TOBN(0xaa0c030a, 0x263fb94f)}, + {TOBN(0x6eef0d61, 0xa0f442de), TOBN(0xf92e1817, 0x27b139d3), + TOBN(0x1ae6deb7, 0x0ad8bc28), TOBN(0xa89e38dc, 0xc0514130)}}, + {{TOBN(0x81eeb865, 0xd2fdca23), TOBN(0x5a15ee08, 0xcc8ef895), + TOBN(0x768fa10a, 0x01905614), TOBN(0xeff5b8ef, 0x880ee19b)}, + {TOBN(0xf0c0cabb, 0xcb1c8a0e), TOBN(0x2e1ee9cd, 0xb8c838f9), + TOBN(0x0587d8b8, 0x8a4a14c0), TOBN(0xf6f27896, 0x2ff698e5)}}, + {{TOBN(0xed38ef1c, 0x89ee6256), TOBN(0xf44ee1fe, 0x6b353b45), + TOBN(0x9115c0c7, 0x70e903b3), TOBN(0xc78ec0a1, 0x818f31df)}, + {TOBN(0x6c003324, 0xb7dccbc6), TOBN(0xd96dd1f3, 0x163bbc25), + TOBN(0x33aa82dd, 0x5cedd805), TOBN(0x123aae4f, 0x7f7eb2f1)}}, + {{TOBN(0x1723fcf5, 0xa26262cd), TOBN(0x1f7f4d5d, 0x0060ebd5), + TOBN(0xf19c5c01, 0xb2eaa3af), TOBN(0x2ccb9b14, 0x9790accf)}, + {TOBN(0x1f9c1cad, 0x52324aa6), TOBN(0x63200526, 0x7247df54), + TOBN(0x5732fe42, 0xbac96f82), TOBN(0x52fe771f, 0x01a1c384)}}, + {{TOBN(0x546ca13d, 0xb1001684), TOBN(0xb56b4eee, 0xa1709f75), + TOBN(0x266545a9, 0xd5db8672), TOBN(0xed971c90, 0x1e8f3cfb)}, + {TOBN(0x4e7d8691, 0xe3a07b29), TOBN(0x7570d9ec, 0xe4b696b9), + TOBN(0xdc5fa067, 0x7bc7e9ae), TOBN(0x68b44caf, 0xc82c4844)}}, + {{TOBN(0x519d34b3, 0xbf44da80), TOBN(0x283834f9, 0x5ab32e66), + TOBN(0x6e608797, 0x6278a000), TOBN(0x1e62960e, 0x627312f6)}, + {TOBN(0x9b87b27b, 0xe6901c55), TOBN(0x80e78538, 0x24fdbc1f), + TOBN(0xbbbc0951, 0x2facc27d), TOBN(0x06394239, 0xac143b5a)}}, + {{TOBN(0x35bb4a40, 0x376c1944), TOBN(0x7cb62694, 0x63da1511), + TOBN(0xafd29161, 0xb7148a3b), TOBN(0xa6f9d9ed, 0x4e2ea2ee)}, + {TOBN(0x15dc2ca2, 0x880dd212), TOBN(0x903c3813, 0xa61139a9), + TOBN(0x2aa7b46d, 0x6c0f8785), TOBN(0x36ce2871, 0x901c60ff)}}, + {{TOBN(0xc683b028, 0xe10d9c12), TOBN(0x7573baa2, 0x032f33d3), + TOBN(0x87a9b1f6, 0x67a31b58), TOBN(0xfd3ed11a, 0xf4ffae12)}, + {TOBN(0x83dcaa9a, 0x0cb2748e), TOBN(0x8239f018, 0x5d6fdf16), + TOBN(0xba67b49c, 0x72753941), TOBN(0x2beec455, 0xc321cb36)}}, + {{TOBN(0x88015606, 0x3f8b84ce), TOBN(0x76417083, 0x8d38c86f), + TOBN(0x054f1ca7, 0x598953dd), TOBN(0xc939e110, 0x4e8e7429)}, + {TOBN(0x9b1ac2b3, 0x5a914f2f), TOBN(0x39e35ed3, 0xe74b8f9c), + TOBN(0xd0debdb2, 0x781b2fb0), TOBN(0x1585638f, 0x2d997ba2)}}, + {{TOBN(0x9c4b646e, 0x9e2fce99), TOBN(0x68a21081, 0x1e80857f), + TOBN(0x06d54e44, 0x3643b52a), TOBN(0xde8d6d63, 0x0d8eb843)}, + {TOBN(0x70321563, 0x42146a0a), TOBN(0x8ba826f2, 0x5eaa3622), + TOBN(0x227a58bd, 0x86138787), TOBN(0x43b6c03c, 0x10281d37)}}, + {{TOBN(0x6326afbb, 0xb54dde39), TOBN(0x744e5e8a, 0xdb6f2d5f), + TOBN(0x48b2a99a, 0xcff158e1), TOBN(0xa93c8fa0, 0xef87918f)}, + {TOBN(0x2182f956, 0xde058c5c), TOBN(0x216235d2, 0x936f9e7a), + TOBN(0xace0c0db, 0xd2e31e67), TOBN(0xc96449bf, 0xf23ac3e7)}}, + {{TOBN(0x7e9a2874, 0x170693bd), TOBN(0xa28e14fd, 0xa45e6335), + TOBN(0x5757f6b3, 0x56427344), TOBN(0x822e4556, 0xacf8edf9)}, + {TOBN(0x2b7a6ee2, 0xe6a285cd), TOBN(0x5866f211, 0xa9df3af0), + TOBN(0x40dde2dd, 0xf845b844), TOBN(0x986c3726, 0x110e5e49)}}, + {{TOBN(0x73680c2a, 0xf7172277), TOBN(0x57b94f0f, 0x0cccb244), + TOBN(0xbdff7267, 0x2d438ca7), TOBN(0xbad1ce11, 0xcf4663fd)}, + {TOBN(0x9813ed9d, 0xd8f71cae), TOBN(0xf43272a6, 0x961fdaa6), + TOBN(0xbeff0119, 0xbd6d1637), TOBN(0xfebc4f91, 0x30361978)}}, + {{TOBN(0x02b37a95, 0x2f41deff), TOBN(0x0e44a59a, 0xe63b89b7), + TOBN(0x673257dc, 0x143ff951), TOBN(0x19c02205, 0xd752baf4)}, + {TOBN(0x46c23069, 0xc4b7d692), TOBN(0x2e6392c3, 0xfd1502ac), + TOBN(0x6057b1a2, 0x1b220846), TOBN(0xe51ff946, 0x0c1b5b63)}}}, + {{{TOBN(0x6e85cb51, 0x566c5c43), TOBN(0xcff9c919, 0x3597f046), + TOBN(0x9354e90c, 0x4994d94a), TOBN(0xe0a39332, 0x2147927d)}, + {TOBN(0x8427fac1, 0x0dc1eb2b), TOBN(0x88cfd8c2, 0x2ff319fa), + TOBN(0xe2d4e684, 0x01965274), TOBN(0xfa2e067d, 0x67aaa746)}}, + {{TOBN(0xb6d92a7f, 0x3e5f9f11), TOBN(0x9afe153a, 0xd6cb3b8e), + TOBN(0x4d1a6dd7, 0xddf800bd), TOBN(0xf6c13cc0, 0xcaf17e19)}, + {TOBN(0x15f6c58e, 0x325fc3ee), TOBN(0x71095400, 0xa31dc3b2), + TOBN(0x168e7c07, 0xafa3d3e7), TOBN(0x3f8417a1, 0x94c7ae2d)}}, + {{TOBN(0xec234772, 0x813b230d), TOBN(0x634d0f5f, 0x17344427), + TOBN(0x11548ab1, 0xd77fc56a), TOBN(0x7fab1750, 0xce06af77)}, + {TOBN(0xb62c10a7, 0x4f7c4f83), TOBN(0xa7d2edc4, 0x220a67d9), + TOBN(0x1c404170, 0x921209a0), TOBN(0x0b9815a0, 0xface59f0)}}, + {{TOBN(0x2842589b, 0x319540c3), TOBN(0x18490f59, 0xa283d6f8), + TOBN(0xa2731f84, 0xdaae9fcb), TOBN(0x3db6d960, 0xc3683ba0)}, + {TOBN(0xc85c63bb, 0x14611069), TOBN(0xb19436af, 0x0788bf05), + TOBN(0x905459df, 0x347460d2), TOBN(0x73f6e094, 0xe11a7db1)}}, + {{TOBN(0xdc7f938e, 0xb6357f37), TOBN(0xc5d00f79, 0x2bd8aa62), + TOBN(0xc878dcb9, 0x2ca979fc), TOBN(0x37e83ed9, 0xeb023a99)}, + {TOBN(0x6b23e273, 0x1560bf3d), TOBN(0x1086e459, 0x1d0fae61), + TOBN(0x78248316, 0x9a9414bd), TOBN(0x1b956bc0, 0xf0ea9ea1)}}, + {{TOBN(0x7b85bb91, 0xc31b9c38), TOBN(0x0c5aa90b, 0x48ef57b5), + TOBN(0xdedeb169, 0xaf3bab6f), TOBN(0xe610ad73, 0x2d373685)}, + {TOBN(0xf13870df, 0x02ba8e15), TOBN(0x0337edb6, 0x8ca7f771), + TOBN(0xe4acf747, 0xb62c036c), TOBN(0xd921d576, 0xb6b94e81)}}, + {{TOBN(0xdbc86439, 0x2c422f7a), TOBN(0xfb635362, 0xed348898), + TOBN(0x83084668, 0xc45bfcd1), TOBN(0xc357c9e3, 0x2b315e11)}, + {TOBN(0xb173b540, 0x5b2e5b8c), TOBN(0x7e946931, 0xe102b9a4), + TOBN(0x17c890eb, 0x7b0fb199), TOBN(0xec225a83, 0xd61b662b)}}, + {{TOBN(0xf306a3c8, 0xee3c76cb), TOBN(0x3cf11623, 0xd32a1f6e), + TOBN(0xe6d5ab64, 0x6863e956), TOBN(0x3b8a4cbe, 0x5c005c26)}, + {TOBN(0xdcd529a5, 0x9ce6bb27), TOBN(0xc4afaa52, 0x04d4b16f), + TOBN(0xb0624a26, 0x7923798d), TOBN(0x85e56df6, 0x6b307fab)}}, + {{TOBN(0x0281893c, 0x2bf29698), TOBN(0x91fc19a4, 0xd7ce7603), + TOBN(0x75a5dca3, 0xad9a558f), TOBN(0x40ceb3fa, 0x4d50bf77)}, + {TOBN(0x1baf6060, 0xbc9ba369), TOBN(0x927e1037, 0x597888c2), + TOBN(0xd936bf19, 0x86a34c07), TOBN(0xd4cf10c1, 0xc34ae980)}}, + {{TOBN(0x3a3e5334, 0x859dd614), TOBN(0x9c475b5b, 0x18d0c8ee), + TOBN(0x63080d1f, 0x07cd51d5), TOBN(0xc9c0d0a6, 0xb88b4326)}, + {TOBN(0x1ac98691, 0xc234296f), TOBN(0x2a0a83a4, 0x94887fb6), + TOBN(0x56511427, 0x0cea9cf2), TOBN(0x5230a6e8, 0xa24802f5)}}, + {{TOBN(0xf7a2bf0f, 0x72e3d5c1), TOBN(0x37717446, 0x4f21439e), + TOBN(0xfedcbf25, 0x9ce30334), TOBN(0xe0030a78, 0x7ce202f9)}, + {TOBN(0x6f2d9ebf, 0x1202e9ca), TOBN(0xe79dde6c, 0x75e6e591), + TOBN(0xf52072af, 0xf1dac4f8), TOBN(0x6c8d087e, 0xbb9b404d)}}, + {{TOBN(0xad0fc73d, 0xbce913af), TOBN(0x909e587b, 0x458a07cb), + TOBN(0x1300da84, 0xd4f00c8a), TOBN(0x425cd048, 0xb54466ac)}, + {TOBN(0xb59cb9be, 0x90e9d8bf), TOBN(0x991616db, 0x3e431b0e), + TOBN(0xd3aa117a, 0x531aecff), TOBN(0x91af92d3, 0x59f4dc3b)}}, + {{TOBN(0x9b1ec292, 0xe93fda29), TOBN(0x76bb6c17, 0xe97d91bc), + TOBN(0x7509d95f, 0xaface1e6), TOBN(0x3653fe47, 0xbe855ae3)}, + {TOBN(0x73180b28, 0x0f680e75), TOBN(0x75eefd1b, 0xeeb6c26c), + TOBN(0xa4cdf29f, 0xb66d4236), TOBN(0x2d70a997, 0x6b5821d8)}}, + {{TOBN(0x7a3ee207, 0x20445c36), TOBN(0x71d1ac82, 0x59877174), + TOBN(0x0fc539f7, 0x949f73e9), TOBN(0xd05cf3d7, 0x982e3081)}, + {TOBN(0x8758e20b, 0x7b1c7129), TOBN(0xffadcc20, 0x569e61f2), + TOBN(0xb05d3a2f, 0x59544c2d), TOBN(0xbe16f5c1, 0x9fff5e53)}}, + {{TOBN(0x73cf65b8, 0xaad58135), TOBN(0x622c2119, 0x037aa5be), + TOBN(0x79373b3f, 0x646fd6a0), TOBN(0x0e029db5, 0x0d3978cf)}, + {TOBN(0x8bdfc437, 0x94fba037), TOBN(0xaefbd687, 0x620797a6), + TOBN(0x3fa5382b, 0xbd30d38e), TOBN(0x7627cfbf, 0x585d7464)}}, + {{TOBN(0xb2330fef, 0x4e4ca463), TOBN(0xbcef7287, 0x3566cc63), + TOBN(0xd161d2ca, 0xcf780900), TOBN(0x135dc539, 0x5b54827d)}, + {TOBN(0x638f052e, 0x27bf1bc6), TOBN(0x10a224f0, 0x07dfa06c), + TOBN(0xe973586d, 0x6d3321da), TOBN(0x8b0c5738, 0x26152c8f)}}, + {{TOBN(0x07ef4f2a, 0x34606074), TOBN(0x80fe7fe8, 0xa0f7047a), + TOBN(0x3d1a8152, 0xe1a0e306), TOBN(0x32cf43d8, 0x88da5222)}, + {TOBN(0xbf89a95f, 0x5f02ffe6), TOBN(0x3d9eb9a4, 0x806ad3ea), + TOBN(0x012c17bb, 0x79c8e55e), TOBN(0xfdcd1a74, 0x99c81dac)}}, + {{TOBN(0x7043178b, 0xb9556098), TOBN(0x4090a1df, 0x801c3886), + TOBN(0x759800ff, 0x9b67b912), TOBN(0x3e5c0304, 0x232620c8)}, + {TOBN(0x4b9d3c4b, 0x70dceeca), TOBN(0xbb2d3c15, 0x181f648e), + TOBN(0xf981d837, 0x6e33345c), TOBN(0xb626289b, 0x0cf2297a)}}, + {{TOBN(0x766ac659, 0x8baebdcf), TOBN(0x1a28ae09, 0x75df01e5), + TOBN(0xb71283da, 0x375876d8), TOBN(0x4865a96d, 0x607b9800)}, + {TOBN(0x25dd1bcd, 0x237936b2), TOBN(0x332f4f4b, 0x60417494), + TOBN(0xd0923d68, 0x370a2147), TOBN(0x497f5dfb, 0xdc842203)}}, + {{TOBN(0x9dc74cbd, 0x32be5e0f), TOBN(0x7475bcb7, 0x17a01375), + TOBN(0x438477c9, 0x50d872b1), TOBN(0xcec67879, 0xffe1d63d)}, + {TOBN(0x9b006014, 0xd8578c70), TOBN(0xc9ad99a8, 0x78bb6b8b), + TOBN(0x6799008e, 0x11fb3806), TOBN(0xcfe81435, 0xcd44cab3)}}, + {{TOBN(0xa2ee1582, 0x2f4fb344), TOBN(0xb8823450, 0x483fa6eb), + TOBN(0x622d323d, 0x652c7749), TOBN(0xd8474a98, 0xbeb0a15b)}, + {TOBN(0xe43c154d, 0x5d1c00d0), TOBN(0x7fd581d9, 0x0e3e7aac), + TOBN(0x2b44c619, 0x2525ddf8), TOBN(0x67a033eb, 0xb8ae9739)}}, + {{TOBN(0x113ffec1, 0x9ef2d2e4), TOBN(0x1bf6767e, 0xd5a0ea7f), + TOBN(0x57fff75e, 0x03714c0a), TOBN(0xa23c422e, 0x0a23e9ee)}, + {TOBN(0xdd5f6b2d, 0x540f83af), TOBN(0xc2c2c27e, 0x55ea46a7), + TOBN(0xeb6b4246, 0x672a1208), TOBN(0xd13599f7, 0xae634f7a)}}, + {{TOBN(0xcf914b5c, 0xd7b32c6e), TOBN(0x61a5a640, 0xeaf61814), + TOBN(0x8dc3df8b, 0x208a1bbb), TOBN(0xef627fd6, 0xb6d79aa5)}, + {TOBN(0x44232ffc, 0xc4c86bc8), TOBN(0xe6f9231b, 0x061539fe), + TOBN(0x1d04f25a, 0x958b9533), TOBN(0x180cf934, 0x49e8c885)}}, + {{TOBN(0x89689595, 0x9884aaf7), TOBN(0xb1959be3, 0x07b348a6), + TOBN(0x96250e57, 0x3c147c87), TOBN(0xae0efb3a, 0xdd0c61f8)}, + {TOBN(0xed00745e, 0xca8c325e), TOBN(0x3c911696, 0xecff3f70), + TOBN(0x73acbc65, 0x319ad41d), TOBN(0x7b01a020, 0xf0b1c7ef)}}, + {{TOBN(0xea32b293, 0x63a1483f), TOBN(0x89eabe71, 0x7a248f96), + TOBN(0x9c6231d3, 0x343157e5), TOBN(0x93a375e5, 0xdf3c546d)}, + {TOBN(0xe76e9343, 0x6a2afe69), TOBN(0xc4f89100, 0xe166c88e), + TOBN(0x248efd0d, 0x4f872093), TOBN(0xae0eb3ea, 0x8fe0ea61)}}, + {{TOBN(0xaf89790d, 0x9d79046e), TOBN(0x4d650f2d, 0x6cee0976), + TOBN(0xa3935d9a, 0x43071eca), TOBN(0x66fcd2c9, 0x283b0bfe)}, + {TOBN(0x0e665eb5, 0x696605f1), TOBN(0xe77e5d07, 0xa54cd38d), + TOBN(0x90ee050a, 0x43d950cf), TOBN(0x86ddebda, 0xd32e69b5)}}, + {{TOBN(0x6ad94a3d, 0xfddf7415), TOBN(0xf7fa1309, 0x3f6e8d5a), + TOBN(0xc4831d1d, 0xe9957f75), TOBN(0x7de28501, 0xd5817447)}, + {TOBN(0x6f1d7078, 0x9e2aeb6b), TOBN(0xba2b9ff4, 0xf67a53c2), + TOBN(0x36963767, 0xdf9defc3), TOBN(0x479deed3, 0x0d38022c)}}, + {{TOBN(0xd2edb89b, 0x3a8631e8), TOBN(0x8de855de, 0x7a213746), + TOBN(0xb2056cb7, 0xb00c5f11), TOBN(0xdeaefbd0, 0x2c9b85e4)}, + {TOBN(0x03f39a8d, 0xd150892d), TOBN(0x37b84686, 0x218b7985), + TOBN(0x36296dd8, 0xb7375f1a), TOBN(0x472cd4b1, 0xb78e898e)}}, + {{TOBN(0x15dff651, 0xe9f05de9), TOBN(0xd4045069, 0x2ce98ba9), + TOBN(0x8466a7ae, 0x9b38024c), TOBN(0xb910e700, 0xe5a6b5ef)}, + {TOBN(0xae1c56ea, 0xb3aa8f0d), TOBN(0xbab2a507, 0x7eee74a6), + TOBN(0x0dca11e2, 0x4b4c4620), TOBN(0xfd896e2e, 0x4c47d1f4)}}, + {{TOBN(0xeb45ae53, 0x308fbd93), TOBN(0x46cd5a2e, 0x02c36fda), + TOBN(0x6a3d4e90, 0xbaa48385), TOBN(0xdd55e62e, 0x9dbe9960)}, + {TOBN(0xa1406aa0, 0x2a81ede7), TOBN(0x6860dd14, 0xf9274ea7), + TOBN(0xcfdcb0c2, 0x80414f86), TOBN(0xff410b10, 0x22f94327)}}, + {{TOBN(0x5a33cc38, 0x49ad467b), TOBN(0xefb48b6c, 0x0a7335f1), + TOBN(0x14fb54a4, 0xb153a360), TOBN(0x604aa9d2, 0xb52469cc)}, + {TOBN(0x5e9dc486, 0x754e48e9), TOBN(0x693cb455, 0x37471e8e), + TOBN(0xfb2fd7cd, 0x8d3b37b6), TOBN(0x63345e16, 0xcf09ff07)}}, + {{TOBN(0x9910ba6b, 0x23a5d896), TOBN(0x1fe19e35, 0x7fe4364e), + TOBN(0x6e1da8c3, 0x9a33c677), TOBN(0x15b4488b, 0x29fd9fd0)}, + {TOBN(0x1f439254, 0x1a1f22bf), TOBN(0x920a8a70, 0xab8163e8), + TOBN(0x3fd1b249, 0x07e5658e), TOBN(0xf2c4f79c, 0xb6ec839b)}}, + {{TOBN(0x1abbc3d0, 0x4aa38d1b), TOBN(0x3b0db35c, 0xb5d9510e), + TOBN(0x1754ac78, 0x3e60dec0), TOBN(0x53272fd7, 0xea099b33)}, + {TOBN(0x5fb0494f, 0x07a8e107), TOBN(0x4a89e137, 0x6a8191fa), + TOBN(0xa113b7f6, 0x3c4ad544), TOBN(0x88a2e909, 0x6cb9897b)}}, + {{TOBN(0x17d55de3, 0xb44a3f84), TOBN(0xacb2f344, 0x17c6c690), + TOBN(0x32088168, 0x10232390), TOBN(0xf2e8a61f, 0x6c733bf7)}, + {TOBN(0xa774aab6, 0x9c2d7652), TOBN(0xfb5307e3, 0xed95c5bc), + TOBN(0xa05c73c2, 0x4981f110), TOBN(0x1baae31c, 0xa39458c9)}}, + {{TOBN(0x1def185b, 0xcbea62e7), TOBN(0xe8ac9eae, 0xeaf63059), + TOBN(0x098a8cfd, 0x9921851c), TOBN(0xd959c3f1, 0x3abe2f5b)}, + {TOBN(0xa4f19525, 0x20e40ae5), TOBN(0x320789e3, 0x07a24aa1), + TOBN(0x259e6927, 0x7392b2bc), TOBN(0x58f6c667, 0x1918668b)}}, + {{TOBN(0xce1db2bb, 0xc55d2d8b), TOBN(0x41d58bb7, 0xf4f6ca56), + TOBN(0x7650b680, 0x8f877614), TOBN(0x905e16ba, 0xf4c349ed)}, + {TOBN(0xed415140, 0xf661acac), TOBN(0x3b8784f0, 0xcb2270af), + TOBN(0x3bc280ac, 0x8a402cba), TOBN(0xd53f7146, 0x0937921a)}}, + {{TOBN(0xc03c8ee5, 0xe5681e83), TOBN(0x62126105, 0xf6ac9e4a), + TOBN(0x9503a53f, 0x936b1a38), TOBN(0x3d45e2d4, 0x782fecbd)}, + {TOBN(0x69a5c439, 0x76e8ae98), TOBN(0xb53b2eeb, 0xbfb4b00e), + TOBN(0xf1674712, 0x72386c89), TOBN(0x30ca34a2, 0x4268bce4)}}, + {{TOBN(0x7f1ed86c, 0x78341730), TOBN(0x8ef5beb8, 0xb525e248), + TOBN(0xbbc489fd, 0xb74fbf38), TOBN(0x38a92a0e, 0x91a0b382)}, + {TOBN(0x7a77ba3f, 0x22433ccf), TOBN(0xde8362d6, 0xa29f05a9), + TOBN(0x7f6a30ea, 0x61189afc), TOBN(0x693b5505, 0x59ef114f)}}, + {{TOBN(0x50266bc0, 0xcd1797a1), TOBN(0xea17b47e, 0xf4b7af2d), + TOBN(0xd6c4025c, 0x3df9483e), TOBN(0x8cbb9d9f, 0xa37b18c9)}, + {TOBN(0x91cbfd9c, 0x4d8424cf), TOBN(0xdb7048f1, 0xab1c3506), + TOBN(0x9eaf641f, 0x028206a3), TOBN(0xf986f3f9, 0x25bdf6ce)}}, + {{TOBN(0x262143b5, 0x224c08dc), TOBN(0x2bbb09b4, 0x81b50c91), + TOBN(0xc16ed709, 0xaca8c84f), TOBN(0xa6210d9d, 0xb2850ca8)}, + {TOBN(0x6d8df67a, 0x09cb54d6), TOBN(0x91eef6e0, 0x500919a4), + TOBN(0x90f61381, 0x0f132857), TOBN(0x9acede47, 0xf8d5028b)}}, + {{TOBN(0x844d1b71, 0x90b771c3), TOBN(0x563b71e4, 0xba6426be), + TOBN(0x2efa2e83, 0xbdb802ff), TOBN(0x3410cbab, 0xab5b4a41)}, + {TOBN(0x555b2d26, 0x30da84dd), TOBN(0xd0711ae9, 0xee1cc29a), + TOBN(0xcf3e8c60, 0x2f547792), TOBN(0x03d7d5de, 0xdc678b35)}}, + {{TOBN(0x071a2fa8, 0xced806b8), TOBN(0x222e6134, 0x697f1478), + TOBN(0xdc16fd5d, 0xabfcdbbf), TOBN(0x44912ebf, 0x121b53b8)}, + {TOBN(0xac943674, 0x2496c27c), TOBN(0x8ea3176c, 0x1ffc26b0), + TOBN(0xb6e224ac, 0x13debf2c), TOBN(0x524cc235, 0xf372a832)}}, + {{TOBN(0xd706e1d8, 0x9f6f1b18), TOBN(0x2552f005, 0x44cce35b), + TOBN(0x8c8326c2, 0xa88e31fc), TOBN(0xb5468b2c, 0xf9552047)}, + {TOBN(0xce683e88, 0x3ff90f2b), TOBN(0x77947bdf, 0x2f0a5423), + TOBN(0xd0a1b28b, 0xed56e328), TOBN(0xaee35253, 0xc20134ac)}}, + {{TOBN(0x7e98367d, 0x3567962f), TOBN(0x379ed61f, 0x8188bffb), + TOBN(0x73bba348, 0xfaf130a1), TOBN(0x6c1f75e1, 0x904ed734)}, + {TOBN(0x18956642, 0x3b4a79fc), TOBN(0xf20bc83d, 0x54ef4493), + TOBN(0x836d425d, 0x9111eca1), TOBN(0xe5b5c318, 0x009a8dcf)}}, + {{TOBN(0x3360b25d, 0x13221bc5), TOBN(0x707baad2, 0x6b3eeaf7), + TOBN(0xd7279ed8, 0x743a95a1), TOBN(0x7450a875, 0x969e809f)}, + {TOBN(0x32b6bd53, 0xe5d0338f), TOBN(0x1e77f7af, 0x2b883bbc), + TOBN(0x90da12cc, 0x1063ecd0), TOBN(0xe2697b58, 0xc315be47)}}, + {{TOBN(0x2771a5bd, 0xda85d534), TOBN(0x53e78c1f, 0xff980eea), + TOBN(0xadf1cf84, 0x900385e7), TOBN(0x7d3b14f6, 0xc9387b62)}, + {TOBN(0x170e74b0, 0xcb8f2bd2), TOBN(0x2d50b486, 0x827fa993), + TOBN(0xcdbe8c9a, 0xf6f32bab), TOBN(0x55e906b0, 0xc3b93ab8)}}, + {{TOBN(0x747f22fc, 0x8fe280d1), TOBN(0xcd8e0de5, 0xb2e114ab), + TOBN(0x5ab7dbeb, 0xe10b68b0), TOBN(0x9dc63a9c, 0xa480d4b2)}, + {TOBN(0x78d4bc3b, 0x4be1495f), TOBN(0x25eb3db8, 0x9359122d), + TOBN(0x3f8ac05b, 0x0809cbdc), TOBN(0xbf4187bb, 0xd37c702f)}}, + {{TOBN(0x84cea069, 0x1416a6a5), TOBN(0x8f860c79, 0x43ef881c), + TOBN(0x41311f8a, 0x38038a5d), TOBN(0xe78c2ec0, 0xfc612067)}, + {TOBN(0x494d2e81, 0x5ad73581), TOBN(0xb4cc9e00, 0x59604097), + TOBN(0xff558aec, 0xf3612cba), TOBN(0x35beef7a, 0x9e36c39e)}}, + {{TOBN(0x1845c7cf, 0xdbcf41b9), TOBN(0x5703662a, 0xaea997c0), + TOBN(0x8b925afe, 0xe402f6d8), TOBN(0xd0a1b1ae, 0x4dd72162)}, + {TOBN(0x9f47b375, 0x03c41c4b), TOBN(0xa023829b, 0x0391d042), + TOBN(0x5f5045c3, 0x503b8b0a), TOBN(0x123c2688, 0x98c010e5)}}, + {{TOBN(0x324ec0cc, 0x36ba06ee), TOBN(0xface3115, 0x3dd2cc0c), + TOBN(0xb364f3be, 0xf333e91f), TOBN(0xef8aff73, 0x28e832b0)}, + {TOBN(0x1e9bad04, 0x2d05841b), TOBN(0x42f0e3df, 0x356a21e2), + TOBN(0xa3270bcb, 0x4add627e), TOBN(0xb09a8158, 0xd322e711)}}, + {{TOBN(0x86e326a1, 0x0fee104a), TOBN(0xad7788f8, 0x3703f65d), + TOBN(0x7e765430, 0x47bc4833), TOBN(0x6cee582b, 0x2b9b893a)}, + {TOBN(0x9cd2a167, 0xe8f55a7b), TOBN(0xefbee3c6, 0xd9e4190d), + TOBN(0x33ee7185, 0xd40c2e9d), TOBN(0x844cc9c5, 0xa380b548)}}, + {{TOBN(0x323f8ecd, 0x66926e04), TOBN(0x0001e38f, 0x8110c1ba), + TOBN(0x8dbcac12, 0xfc6a7f07), TOBN(0xd65e1d58, 0x0cec0827)}, + {TOBN(0xd2cd4141, 0xbe76ca2d), TOBN(0x7895cf5c, 0xe892f33a), + TOBN(0x956d230d, 0x367139d2), TOBN(0xa91abd3e, 0xd012c4c1)}}, + {{TOBN(0x34fa4883, 0x87eb36bf), TOBN(0xc5f07102, 0x914b8fb4), + TOBN(0x90f0e579, 0xadb9c95f), TOBN(0xfe6ea8cb, 0x28888195)}, + {TOBN(0x7b9b5065, 0xedfa9284), TOBN(0x6c510bd2, 0x2b8c8d65), + TOBN(0xd7b8ebef, 0xcbe8aafd), TOBN(0xedb3af98, 0x96b1da07)}}, + {{TOBN(0x28ff779d, 0x6295d426), TOBN(0x0c4f6ac7, 0x3fa3ad7b), + TOBN(0xec44d054, 0x8b8e2604), TOBN(0x9b32a66d, 0x8b0050e1)}, + {TOBN(0x1f943366, 0xf0476ce2), TOBN(0x7554d953, 0xa602c7b4), + TOBN(0xbe35aca6, 0x524f2809), TOBN(0xb6881229, 0xfd4edbea)}}, + {{TOBN(0xe8cd0c8f, 0x508efb63), TOBN(0x9eb5b5c8, 0x6abcefc7), + TOBN(0xf5621f5f, 0xb441ab4f), TOBN(0x79e6c046, 0xb76a2b22)}, + {TOBN(0x74a4792c, 0xe37a1f69), TOBN(0xcbd252cb, 0x03542b60), + TOBN(0x785f65d5, 0xb3c20bd3), TOBN(0x8dea6143, 0x4fabc60c)}}, + {{TOBN(0x45e21446, 0xde673629), TOBN(0x57f7aa1e, 0x703c2d21), + TOBN(0xa0e99b7f, 0x98c868c7), TOBN(0x4e42f66d, 0x8b641676)}, + {TOBN(0x602884dc, 0x91077896), TOBN(0xa0d690cf, 0xc2c9885b), + TOBN(0xfeb4da33, 0x3b9a5187), TOBN(0x5f789598, 0x153c87ee)}}, + {{TOBN(0x2192dd47, 0x52b16dba), TOBN(0xdeefc0e6, 0x3524c1b1), + TOBN(0x465ea76e, 0xe4383693), TOBN(0x79401711, 0x361b8d98)}, + {TOBN(0xa5f9ace9, 0xf21a15cb), TOBN(0x73d26163, 0xefee9aeb), + TOBN(0xcca844b3, 0xe677016c), TOBN(0x6c122b07, 0x57eaee06)}}, + {{TOBN(0xb782dce7, 0x15f09690), TOBN(0x508b9b12, 0x2dfc0fc9), + TOBN(0x9015ab4b, 0x65d89fc6), TOBN(0x5e79dab7, 0xd6d5bb0f)}, + {TOBN(0x64f021f0, 0x6c775aa2), TOBN(0xdf09d8cc, 0x37c7eca1), + TOBN(0x9a761367, 0xef2fa506), TOBN(0xed4ca476, 0x5b81eec6)}}, + {{TOBN(0x262ede36, 0x10bbb8b5), TOBN(0x0737ce83, 0x0641ada3), + TOBN(0x4c94288a, 0xe9831ccc), TOBN(0x487fc1ce, 0x8065e635)}, + {TOBN(0xb13d7ab3, 0xb8bb3659), TOBN(0xdea5df3e, 0x855e4120), + TOBN(0xb9a18573, 0x85eb0244), TOBN(0x1a1b8ea3, 0xa7cfe0a3)}}, + {{TOBN(0x3b837119, 0x67b0867c), TOBN(0x8d5e0d08, 0x9d364520), + TOBN(0x52dccc1e, 0xd930f0e3), TOBN(0xefbbcec7, 0xbf20bbaf)}, + {TOBN(0x99cffcab, 0x0263ad10), TOBN(0xd8199e6d, 0xfcd18f8a), + TOBN(0x64e2773f, 0xe9f10617), TOBN(0x0079e8e1, 0x08704848)}}, + {{TOBN(0x1169989f, 0x8a342283), TOBN(0x8097799c, 0xa83012e6), + TOBN(0xece966cb, 0x8a6a9001), TOBN(0x93b3afef, 0x072ac7fc)}, + {TOBN(0xe6893a2a, 0x2db3d5ba), TOBN(0x263dc462, 0x89bf4fdc), + TOBN(0x8852dfc9, 0xe0396673), TOBN(0x7ac70895, 0x3af362b6)}}, + {{TOBN(0xbb9cce4d, 0x5c2f342b), TOBN(0xbf80907a, 0xb52d7aae), + TOBN(0x97f3d3cd, 0x2161bcd0), TOBN(0xb25b0834, 0x0962744d)}, + {TOBN(0xc5b18ea5, 0x6c3a1dda), TOBN(0xfe4ec7eb, 0x06c92317), + TOBN(0xb787b890, 0xad1c4afe), TOBN(0xdccd9a92, 0x0ede801a)}}, + {{TOBN(0x9ac6ddda, 0xdb58da1f), TOBN(0x22bbc12f, 0xb8cae6ee), + TOBN(0xc6f8bced, 0x815c4a43), TOBN(0x8105a92c, 0xf96480c7)}, + {TOBN(0x0dc3dbf3, 0x7a859d51), TOBN(0xe3ec7ce6, 0x3041196b), + TOBN(0xd9f64b25, 0x0d1067c9), TOBN(0xf2321321, 0x3d1f8dd8)}}, + {{TOBN(0x8b5c619c, 0x76497ee8), TOBN(0x5d2b0ac6, 0xc717370e), + TOBN(0x98204cb6, 0x4fcf68e1), TOBN(0x0bdec211, 0x62bc6792)}, + {TOBN(0x6973ccef, 0xa63b1011), TOBN(0xf9e3fa97, 0xe0de1ac5), + TOBN(0x5efb693e, 0x3d0e0c8b), TOBN(0x037248e9, 0xd2d4fcb4)}}}, + {{{TOBN(0x80802dc9, 0x1ec34f9e), TOBN(0xd8772d35, 0x33810603), + TOBN(0x3f06d66c, 0x530cb4f3), TOBN(0x7be5ed0d, 0xc475c129)}, + {TOBN(0xcb9e3c19, 0x31e82b10), TOBN(0xc63d2857, 0xc9ff6b4c), + TOBN(0xb92118c6, 0x92a1b45e), TOBN(0x0aec4414, 0x7285bbca)}}, + {{TOBN(0xfc189ae7, 0x1e29a3ef), TOBN(0xcbe906f0, 0x4c93302e), + TOBN(0xd0107914, 0xceaae10e), TOBN(0xb7a23f34, 0xb68e19f8)}, + {TOBN(0xe9d875c2, 0xefd2119d), TOBN(0x03198c6e, 0xfcadc9c8), + TOBN(0x65591bf6, 0x4da17113), TOBN(0x3cf0bbf8, 0x3d443038)}}, + {{TOBN(0xae485bb7, 0x2b724759), TOBN(0x945353e1, 0xb2d4c63a), + TOBN(0x82159d07, 0xde7d6f2c), TOBN(0x389caef3, 0x4ec5b109)}, + {TOBN(0x4a8ebb53, 0xdb65ef14), TOBN(0x2dc2cb7e, 0xdd99de43), + TOBN(0x816fa3ed, 0x83f2405f), TOBN(0x73429bb9, 0xc14208a3)}}, + {{TOBN(0xb618d590, 0xb01e6e27), TOBN(0x047e2ccd, 0xe180b2dc), + TOBN(0xd1b299b5, 0x04aea4a9), TOBN(0x412c9e1e, 0x9fa403a4)}, + {TOBN(0x88d28a36, 0x79407552), TOBN(0x49c50136, 0xf332b8e3), + TOBN(0x3a1b6fcc, 0xe668de19), TOBN(0x178851bc, 0x75122b97)}}, + {{TOBN(0xb1e13752, 0xfb85fa4c), TOBN(0xd61257ce, 0x383c8ce9), + TOBN(0xd43da670, 0xd2f74dae), TOBN(0xa35aa23f, 0xbf846bbb)}, + {TOBN(0x5e74235d, 0x4421fc83), TOBN(0xf6df8ee0, 0xc363473b), + TOBN(0x34d7f52a, 0x3c4aa158), TOBN(0x50d05aab, 0x9bc6d22e)}}, + {{TOBN(0x8c56e735, 0xa64785f4), TOBN(0xbc56637b, 0x5f29cd07), + TOBN(0x53b2bb80, 0x3ee35067), TOBN(0x50235a0f, 0xdc919270)}, + {TOBN(0x191ab6d8, 0xf2c4aa65), TOBN(0xc3475831, 0x8396023b), + TOBN(0x80400ba5, 0xf0f805ba), TOBN(0x8881065b, 0x5ec0f80f)}}, + {{TOBN(0xc370e522, 0xcc1b5e83), TOBN(0xde2d4ad1, 0x860b8bfb), + TOBN(0xad364df0, 0x67b256df), TOBN(0x8f12502e, 0xe0138997)}, + {TOBN(0x503fa0dc, 0x7783920a), TOBN(0xe80014ad, 0xc0bc866a), + TOBN(0x3f89b744, 0xd3064ba6), TOBN(0x03511dcd, 0xcba5dba5)}}, + {{TOBN(0x197dd46d, 0x95a7b1a2), TOBN(0x9c4e7ad6, 0x3c6341fb), + TOBN(0x426eca29, 0x484c2ece), TOBN(0x9211e489, 0xde7f4f8a)}, + {TOBN(0x14997f6e, 0xc78ef1f4), TOBN(0x2b2c0910, 0x06574586), + TOBN(0x17286a6e, 0x1c3eede8), TOBN(0x25f92e47, 0x0f60e018)}}, + {{TOBN(0x805c5646, 0x31890a36), TOBN(0x703ef600, 0x57feea5b), + TOBN(0x389f747c, 0xaf3c3030), TOBN(0xe0e5daeb, 0x54dd3739)}, + {TOBN(0xfe24a4c3, 0xc9c9f155), TOBN(0x7e4bf176, 0xb5393962), + TOBN(0x37183de2, 0xaf20bf29), TOBN(0x4a1bd7b5, 0xf95a8c3b)}}, + {{TOBN(0xa83b9699, 0x46191d3d), TOBN(0x281fc8dd, 0x7b87f257), + TOBN(0xb18e2c13, 0x54107588), TOBN(0x6372def7, 0x9b2bafe8)}, + {TOBN(0xdaf4bb48, 0x0d8972ca), TOBN(0x3f2dd4b7, 0x56167a3f), + TOBN(0x1eace32d, 0x84310cf4), TOBN(0xe3bcefaf, 0xe42700aa)}}, + {{TOBN(0x5fe5691e, 0xd785e73d), TOBN(0xa5db5ab6, 0x2ea60467), + TOBN(0x02e23d41, 0xdfc6514a), TOBN(0x35e8048e, 0xe03c3665)}, + {TOBN(0x3f8b118f, 0x1adaa0f8), TOBN(0x28ec3b45, 0x84ce1a5a), + TOBN(0xe8cacc6e, 0x2c6646b8), TOBN(0x1343d185, 0xdbd0e40f)}}, + {{TOBN(0xe5d7f844, 0xcaaa358c), TOBN(0x1a1db7e4, 0x9924182a), + TOBN(0xd64cd42d, 0x9c875d9a), TOBN(0xb37b515f, 0x042eeec8)}, + {TOBN(0x4d4dd409, 0x7b165fbe), TOBN(0xfc322ed9, 0xe206eff3), + TOBN(0x7dee4102, 0x59b7e17e), TOBN(0x55a481c0, 0x8236ca00)}}, + {{TOBN(0x8c885312, 0xc23fc975), TOBN(0x15715806, 0x05d6297b), + TOBN(0xa078868e, 0xf78edd39), TOBN(0x956b31e0, 0x03c45e52)}, + {TOBN(0x470275d5, 0xff7b33a6), TOBN(0xc8d5dc3a, 0x0c7e673f), + TOBN(0x419227b4, 0x7e2f2598), TOBN(0x8b37b634, 0x4c14a975)}}, + {{TOBN(0xd0667ed6, 0x8b11888c), TOBN(0x5e0e8c3e, 0x803e25dc), + TOBN(0x34e5d0dc, 0xb987a24a), TOBN(0x9f40ac3b, 0xae920323)}, + {TOBN(0x5463de95, 0x34e0f63a), TOBN(0xa128bf92, 0x6b6328f9), + TOBN(0x491ccd7c, 0xda64f1b7), TOBN(0x7ef1ec27, 0xc47bde35)}}, + {{TOBN(0xa857240f, 0xa36a2737), TOBN(0x35dc1366, 0x63621bc1), + TOBN(0x7a3a6453, 0xd4fb6897), TOBN(0x80f1a439, 0xc929319d)}, + {TOBN(0xfc18274b, 0xf8cb0ba0), TOBN(0xb0b53766, 0x8078c5eb), + TOBN(0xfb0d4924, 0x1e01d0ef), TOBN(0x50d7c67d, 0x372ab09c)}}, + {{TOBN(0xb4e370af, 0x3aeac968), TOBN(0xe4f7fee9, 0xc4b63266), + TOBN(0xb4acd4c2, 0xe3ac5664), TOBN(0xf8910bd2, 0xceb38cbf)}, + {TOBN(0x1c3ae50c, 0xc9c0726e), TOBN(0x15309569, 0xd97b40bf), + TOBN(0x70884b7f, 0xfd5a5a1b), TOBN(0x3890896a, 0xef8314cd)}}, + {{TOBN(0x58e1515c, 0xa5618c93), TOBN(0xe665432b, 0x77d942d1), + TOBN(0xb32181bf, 0xb6f767a8), TOBN(0x753794e8, 0x3a604110)}, + {TOBN(0x09afeb7c, 0xe8c0dbcc), TOBN(0x31e02613, 0x598673a3), + TOBN(0x5d98e557, 0x7d46db00), TOBN(0xfc21fb8c, 0x9d985b28)}}, + {{TOBN(0xc9040116, 0xb0843e0b), TOBN(0x53b1b3a8, 0x69b04531), + TOBN(0xdd1649f0, 0x85d7d830), TOBN(0xbb3bcc87, 0xcb7427e8)}, + {TOBN(0x77261100, 0xc93dce83), TOBN(0x7e79da61, 0xa1922a2a), + TOBN(0x587a2b02, 0xf3149ce8), TOBN(0x147e1384, 0xde92ec83)}}, + {{TOBN(0x484c83d3, 0xaf077f30), TOBN(0xea78f844, 0x0658b53a), + TOBN(0x912076c2, 0x027aec53), TOBN(0xf34714e3, 0x93c8177d)}, + {TOBN(0x37ef5d15, 0xc2376c84), TOBN(0x8315b659, 0x3d1aa783), + TOBN(0x3a75c484, 0xef852a90), TOBN(0x0ba0c58a, 0x16086bd4)}}, + {{TOBN(0x29688d7a, 0x529a6d48), TOBN(0x9c7f250d, 0xc2f19203), + TOBN(0x123042fb, 0x682e2df9), TOBN(0x2b7587e7, 0xad8121bc)}, + {TOBN(0x30fc0233, 0xe0182a65), TOBN(0xb82ecf87, 0xe3e1128a), + TOBN(0x71682861, 0x93fb098f), TOBN(0x043e21ae, 0x85e9e6a7)}}, + {{TOBN(0xab5b49d6, 0x66c834ea), TOBN(0x3be43e18, 0x47414287), + TOBN(0xf40fb859, 0x219a2a47), TOBN(0x0e6559e9, 0xcc58df3c)}, + {TOBN(0xfe1dfe8e, 0x0c6615b4), TOBN(0x14abc8fd, 0x56459d70), + TOBN(0x7be0fa8e, 0x05de0386), TOBN(0x8e63ef68, 0xe9035c7c)}}, + {{TOBN(0x116401b4, 0x53b31e91), TOBN(0x0cba7ad4, 0x4436b4d8), + TOBN(0x9151f9a0, 0x107afd66), TOBN(0xafaca8d0, 0x1f0ee4c4)}, + {TOBN(0x75fe5c1d, 0x9ee9761c), TOBN(0x3497a16b, 0xf0c0588f), + TOBN(0x3ee2bebd, 0x0304804c), TOBN(0xa8fb9a60, 0xc2c990b9)}}, + {{TOBN(0xd14d32fe, 0x39251114), TOBN(0x36bf25bc, 0xcac73366), + TOBN(0xc9562c66, 0xdba7495c), TOBN(0x324d301b, 0x46ad348b)}, + {TOBN(0x9f46620c, 0xd670407e), TOBN(0x0ea8d4f1, 0xe3733a01), + TOBN(0xd396d532, 0xb0c324e0), TOBN(0x5b211a0e, 0x03c317cd)}}, + {{TOBN(0x090d7d20, 0x5ffe7b37), TOBN(0x3b7f3efb, 0x1747d2da), + TOBN(0xa2cb525f, 0xb54fc519), TOBN(0x6e220932, 0xf66a971e)}, + {TOBN(0xddc160df, 0xb486d440), TOBN(0x7fcfec46, 0x3fe13465), + TOBN(0x83da7e4e, 0x76e4c151), TOBN(0xd6fa48a1, 0xd8d302b5)}}, + {{TOBN(0xc6304f26, 0x5872cd88), TOBN(0x806c1d3c, 0x278b90a1), + TOBN(0x3553e725, 0xcaf0bc1c), TOBN(0xff59e603, 0xbb9d8d5c)}, + {TOBN(0xa4550f32, 0x7a0b85dd), TOBN(0xdec5720a, 0x93ecc217), + TOBN(0x0b88b741, 0x69d62213), TOBN(0x7212f245, 0x5b365955)}}, + {{TOBN(0x20764111, 0xb5cae787), TOBN(0x13cb7f58, 0x1dfd3124), + TOBN(0x2dca77da, 0x1175aefb), TOBN(0xeb75466b, 0xffaae775)}, + {TOBN(0x74d76f3b, 0xdb6cff32), TOBN(0x7440f37a, 0x61fcda9a), + TOBN(0x1bb3ac92, 0xb525028b), TOBN(0x20fbf8f7, 0xa1975f29)}}, + {{TOBN(0x982692e1, 0xdf83097f), TOBN(0x28738f6c, 0x554b0800), + TOBN(0xdc703717, 0xa2ce2f2f), TOBN(0x7913b93c, 0x40814194)}, + {TOBN(0x04924593, 0x1fe89636), TOBN(0x7b98443f, 0xf78834a6), + TOBN(0x11c6ab01, 0x5114a5a1), TOBN(0x60deb383, 0xffba5f4c)}}, + {{TOBN(0x4caa54c6, 0x01a982e6), TOBN(0x1dd35e11, 0x3491cd26), + TOBN(0x973c315f, 0x7cbd6b05), TOBN(0xcab00775, 0x52494724)}, + {TOBN(0x04659b1f, 0x6565e15a), TOBN(0xbf30f529, 0x8c8fb026), + TOBN(0xfc21641b, 0xa8a0de37), TOBN(0xe9c7a366, 0xfa5e5114)}}, + {{TOBN(0xdb849ca5, 0x52f03ad8), TOBN(0xc7e8dbe9, 0x024e35c0), + TOBN(0xa1a2bbac, 0xcfc3c789), TOBN(0xbf733e7d, 0x9c26f262)}, + {TOBN(0x882ffbf5, 0xb8444823), TOBN(0xb7224e88, 0x6bf8483b), + TOBN(0x53023b8b, 0x65bef640), TOBN(0xaabfec91, 0xd4d5f8cd)}}, + {{TOBN(0xa40e1510, 0x079ea1bd), TOBN(0x1ad9addc, 0xd05d5d26), + TOBN(0xdb3f2eab, 0x13e68d4f), TOBN(0x1cff1ae2, 0x640f803f)}, + {TOBN(0xe0e7b749, 0xd4cee117), TOBN(0x8e9f275b, 0x4036d909), + TOBN(0xce34e31d, 0x8f4d4c38), TOBN(0x22b37f69, 0xd75130fc)}}, + {{TOBN(0x83e0f1fd, 0xb4014604), TOBN(0xa8ce9919, 0x89415078), + TOBN(0x82375b75, 0x41792efe), TOBN(0x4f59bf5c, 0x97d4515b)}, + {TOBN(0xac4f324f, 0x923a277d), TOBN(0xd9bc9b7d, 0x650f3406), + TOBN(0xc6fa87d1, 0x8a39bc51), TOBN(0x82588530, 0x5ccc108f)}}, + {{TOBN(0x5ced3c9f, 0x82e4c634), TOBN(0x8efb8314, 0x3a4464f8), + TOBN(0xe706381b, 0x7a1dca25), TOBN(0x6cd15a3c, 0x5a2a412b)}, + {TOBN(0x9347a8fd, 0xbfcd8fb5), TOBN(0x31db2eef, 0x6e54cd22), + TOBN(0xc4aeb11e, 0xf8d8932f), TOBN(0x11e7c1ed, 0x344411af)}}, + {{TOBN(0x2653050c, 0xdc9a151e), TOBN(0x9edbfc08, 0x3bb0a859), + TOBN(0x926c81c7, 0xfd5691e7), TOBN(0x9c1b2342, 0x6f39019a)}, + {TOBN(0x64a81c8b, 0x7f8474b9), TOBN(0x90657c07, 0x01761819), + TOBN(0x390b3331, 0x55e0375a), TOBN(0xc676c626, 0xb6ebc47d)}}, + {{TOBN(0x51623247, 0xb7d6dee8), TOBN(0x0948d927, 0x79659313), + TOBN(0x99700161, 0xe9ab35ed), TOBN(0x06cc32b4, 0x8ddde408)}, + {TOBN(0x6f2fd664, 0x061ef338), TOBN(0x1606fa02, 0xc202e9ed), + TOBN(0x55388bc1, 0x929ba99b), TOBN(0xc4428c5e, 0x1e81df69)}}, + {{TOBN(0xce2028ae, 0xf91b0b2a), TOBN(0xce870a23, 0xf03dfd3f), + TOBN(0x66ec2c87, 0x0affe8ed), TOBN(0xb205fb46, 0x284d0c00)}, + {TOBN(0xbf5dffe7, 0x44cefa48), TOBN(0xb6fc37a8, 0xa19876d7), + TOBN(0xbecfa84c, 0x08b72863), TOBN(0xd7205ff5, 0x2576374f)}}, + {{TOBN(0x80330d32, 0x8887de41), TOBN(0x5de0df0c, 0x869ea534), + TOBN(0x13f42753, 0x3c56ea17), TOBN(0xeb1f6069, 0x452b1a78)}, + {TOBN(0x50474396, 0xe30ea15c), TOBN(0x575816a1, 0xc1494125), + TOBN(0xbe1ce55b, 0xfe6bb38f), TOBN(0xb901a948, 0x96ae30f7)}}, + {{TOBN(0xe5af0f08, 0xd8fc3548), TOBN(0x5010b5d0, 0xd73bfd08), + TOBN(0x993d2880, 0x53fe655a), TOBN(0x99f2630b, 0x1c1309fd)}, + {TOBN(0xd8677baf, 0xb4e3b76f), TOBN(0x14e51ddc, 0xb840784b), + TOBN(0x326c750c, 0xbf0092ce), TOBN(0xc83d306b, 0xf528320f)}}, + {{TOBN(0xc4456715, 0x77d4715c), TOBN(0xd30019f9, 0x6b703235), + TOBN(0x207ccb2e, 0xd669e986), TOBN(0x57c824af, 0xf6dbfc28)}, + {TOBN(0xf0eb532f, 0xd8f92a23), TOBN(0x4a557fd4, 0x9bb98fd2), + TOBN(0xa57acea7, 0xc1e6199a), TOBN(0x0c663820, 0x8b94b1ed)}}, + {{TOBN(0x9b42be8f, 0xf83a9266), TOBN(0xc7741c97, 0x0101bd45), + TOBN(0x95770c11, 0x07bd9ceb), TOBN(0x1f50250a, 0x8b2e0744)}, + {TOBN(0xf762eec8, 0x1477b654), TOBN(0xc65b900e, 0x15efe59a), + TOBN(0x88c96148, 0x9546a897), TOBN(0x7e8025b3, 0xc30b4d7c)}}, + {{TOBN(0xae4065ef, 0x12045cf9), TOBN(0x6fcb2caf, 0x9ccce8bd), + TOBN(0x1fa0ba4e, 0xf2cf6525), TOBN(0xf683125d, 0xcb72c312)}, + {TOBN(0xa01da4ea, 0xe312410e), TOBN(0x67e28677, 0x6cd8e830), + TOBN(0xabd95752, 0x98fb3f07), TOBN(0x05f11e11, 0xeef649a5)}}, + {{TOBN(0xba47faef, 0x9d3472c2), TOBN(0x3adff697, 0xc77d1345), + TOBN(0x4761fa04, 0xdd15afee), TOBN(0x64f1f61a, 0xb9e69462)}, + {TOBN(0xfa691fab, 0x9bfb9093), TOBN(0x3df8ae8f, 0xa1133dfe), + TOBN(0xcd5f8967, 0x58cc710d), TOBN(0xfbb88d50, 0x16c7fe79)}}, + {{TOBN(0x8e011b4c, 0xe88c50d1), TOBN(0x7532e807, 0xa8771c4f), + TOBN(0x64c78a48, 0xe2278ee4), TOBN(0x0b283e83, 0x3845072a)}, + {TOBN(0x98a6f291, 0x49e69274), TOBN(0xb96e9668, 0x1868b21c), + TOBN(0x38f0adc2, 0xb1a8908e), TOBN(0x90afcff7, 0x1feb829d)}}, + {{TOBN(0x9915a383, 0x210b0856), TOBN(0xa5a80602, 0xdef04889), + TOBN(0x800e9af9, 0x7c64d509), TOBN(0x81382d0b, 0xb8996f6f)}, + {TOBN(0x490eba53, 0x81927e27), TOBN(0x46c63b32, 0x4af50182), + TOBN(0x784c5fd9, 0xd3ad62ce), TOBN(0xe4fa1870, 0xf8ae8736)}}, + {{TOBN(0x4ec9d0bc, 0xd7466b25), TOBN(0x84ddbe1a, 0xdb235c65), + TOBN(0x5e2645ee, 0x163c1688), TOBN(0x570bd00e, 0x00eba747)}, + {TOBN(0xfa51b629, 0x128bfa0f), TOBN(0x92fce1bd, 0x6c1d3b68), + TOBN(0x3e7361dc, 0xb66778b1), TOBN(0x9c7d249d, 0x5561d2bb)}}, + {{TOBN(0xa40b28bf, 0x0bbc6229), TOBN(0x1c83c05e, 0xdfd91497), + TOBN(0x5f9f5154, 0xf083df05), TOBN(0xbac38b3c, 0xeee66c9d)}, + {TOBN(0xf71db7e3, 0xec0dfcfd), TOBN(0xf2ecda8e, 0x8b0a8416), + TOBN(0x52fddd86, 0x7812aa66), TOBN(0x2896ef10, 0x4e6f4272)}}, + {{TOBN(0xff27186a, 0x0fe9a745), TOBN(0x08249fcd, 0x49ca70db), + TOBN(0x7425a2e6, 0x441cac49), TOBN(0xf4a0885a, 0xece5ff57)}, + {TOBN(0x6e2cb731, 0x7d7ead58), TOBN(0xf96cf7d6, 0x1898d104), + TOBN(0xafe67c9d, 0x4f2c9a89), TOBN(0x89895a50, 0x1c7bf5bc)}}, + {{TOBN(0xdc7cb8e5, 0x573cecfa), TOBN(0x66497eae, 0xd15f03e6), + TOBN(0x6bc0de69, 0x3f084420), TOBN(0x323b9b36, 0xacd532b0)}, + {TOBN(0xcfed390a, 0x0115a3c1), TOBN(0x9414c40b, 0x2d65ca0e), + TOBN(0x641406bd, 0x2f530c78), TOBN(0x29369a44, 0x833438f2)}}, + {{TOBN(0x996884f5, 0x903fa271), TOBN(0xe6da0fd2, 0xb9da921e), + TOBN(0xa6f2f269, 0x5db01e54), TOBN(0x1ee3e9bd, 0x6876214e)}, + {TOBN(0xa26e181c, 0xe27a9497), TOBN(0x36d254e4, 0x8e215e04), + TOBN(0x42f32a6c, 0x252cabca), TOBN(0x99481487, 0x80b57614)}}, + {{TOBN(0x4c4dfe69, 0x40d9cae1), TOBN(0x05869580, 0x11a10f09), + TOBN(0xca287b57, 0x3491b64b), TOBN(0x77862d5d, 0x3fd4a53b)}, + {TOBN(0xbf94856e, 0x50349126), TOBN(0x2be30bd1, 0x71c5268f), + TOBN(0x10393f19, 0xcbb650a6), TOBN(0x639531fe, 0x778cf9fd)}}, + {{TOBN(0x02556a11, 0xb2935359), TOBN(0xda38aa96, 0xaf8c126e), + TOBN(0x47dbe6c2, 0x0960167f), TOBN(0x37bbabb6, 0x501901cd)}, + {TOBN(0xb6e979e0, 0x2c947778), TOBN(0xd69a5175, 0x7a1a1dc6), + TOBN(0xc3ed5095, 0x9d9faf0c), TOBN(0x4dd9c096, 0x1d5fa5f0)}}, + {{TOBN(0xa0c4304d, 0x64f16ea8), TOBN(0x8b1cac16, 0x7e718623), + TOBN(0x0b576546, 0x7c67f03e), TOBN(0x559cf5ad, 0xcbd88c01)}, + {TOBN(0x074877bb, 0x0e2af19a), TOBN(0x1f717ec1, 0xa1228c92), + TOBN(0x70bcb800, 0x326e8920), TOBN(0xec6e2c5c, 0x4f312804)}}, + {{TOBN(0x426aea7d, 0x3fca4752), TOBN(0xf12c0949, 0x2211f62a), + TOBN(0x24beecd8, 0x7be7b6b5), TOBN(0xb77eaf4c, 0x36d7a27d)}, + {TOBN(0x154c2781, 0xfda78fd3), TOBN(0x848a83b0, 0x264eeabe), + TOBN(0x81287ef0, 0x4ffe2bc4), TOBN(0x7b6d88c6, 0xb6b6fc2a)}}, + {{TOBN(0x805fb947, 0xce417d99), TOBN(0x4b93dcc3, 0x8b916cc4), + TOBN(0x72e65bb3, 0x21273323), TOBN(0xbcc1badd, 0x6ea9886e)}, + {TOBN(0x0e223011, 0x4bc5ee85), TOBN(0xa561be74, 0xc18ee1e4), + TOBN(0x762fd2d4, 0xa6bcf1f1), TOBN(0x50e6a5a4, 0x95231489)}}, + {{TOBN(0xca96001f, 0xa00b500b), TOBN(0x5c098cfc, 0x5d7dcdf5), + TOBN(0xa64e2d2e, 0x8c446a85), TOBN(0xbae9bcf1, 0x971f3c62)}, + {TOBN(0x4ec22683, 0x8435a2c5), TOBN(0x8ceaed6c, 0x4bad4643), + TOBN(0xe9f8fb47, 0xccccf4e3), TOBN(0xbd4f3fa4, 0x1ce3b21e)}}, + {{TOBN(0xd79fb110, 0xa3db3292), TOBN(0xe28a37da, 0xb536c66a), + TOBN(0x279ce87b, 0x8e49e6a9), TOBN(0x70ccfe8d, 0xfdcec8e3)}, + {TOBN(0x2193e4e0, 0x3ba464b2), TOBN(0x0f39d60e, 0xaca9a398), + TOBN(0x7d7932af, 0xf82c12ab), TOBN(0xd8ff50ed, 0x91e7e0f7)}}, + {{TOBN(0xea961058, 0xfa28a7e0), TOBN(0xc726cf25, 0x0bf5ec74), + TOBN(0xe74d55c8, 0xdb229666), TOBN(0x0bd9abbf, 0xa57f5799)}, + {TOBN(0x7479ef07, 0x4dfc47b3), TOBN(0xd9c65fc3, 0x0c52f91d), + TOBN(0x8e0283fe, 0x36a8bde2), TOBN(0xa32a8b5e, 0x7d4b7280)}}, + {{TOBN(0x6a677c61, 0x12e83233), TOBN(0x0fbb3512, 0xdcc9bf28), + TOBN(0x562e8ea5, 0x0d780f61), TOBN(0x0db8b22b, 0x1dc4e89c)}, + {TOBN(0x0a6fd1fb, 0x89be0144), TOBN(0x8c77d246, 0xca57113b), + TOBN(0x4639075d, 0xff09c91c), TOBN(0x5b47b17f, 0x5060824c)}}, + {{TOBN(0x58aea2b0, 0x16287b52), TOBN(0xa1343520, 0xd0cd8eb0), + TOBN(0x6148b4d0, 0xc5d58573), TOBN(0xdd2b6170, 0x291c68ae)}, + {TOBN(0xa61b3929, 0x1da3b3b7), TOBN(0x5f946d79, 0x08c4ac10), + TOBN(0x4105d4a5, 0x7217d583), TOBN(0x5061da3d, 0x25e6de5e)}}, + {{TOBN(0x3113940d, 0xec1b4991), TOBN(0xf12195e1, 0x36f485ae), + TOBN(0xa7507fb2, 0x731a2ee0), TOBN(0x95057a8e, 0x6e9e196e)}, + {TOBN(0xa3c2c911, 0x2e130136), TOBN(0x97dfbb36, 0x33c60d15), + TOBN(0xcaf3c581, 0xb300ee2b), TOBN(0x77f25d90, 0xf4bac8b8)}}, + {{TOBN(0xdb1c4f98, 0x6d840cd6), TOBN(0x471d62c0, 0xe634288c), + TOBN(0x8ec2f85e, 0xcec8a161), TOBN(0x41f37cbc, 0xfa6f4ae2)}, + {TOBN(0x6793a20f, 0x4b709985), TOBN(0x7a7bd33b, 0xefa8985b), + TOBN(0x2c6a3fbd, 0x938e6446), TOBN(0x19042619, 0x2a8d47c1)}}, + {{TOBN(0x16848667, 0xcc36975f), TOBN(0x02acf168, 0x9d5f1dfb), + TOBN(0x62d41ad4, 0x613baa94), TOBN(0xb56fbb92, 0x9f684670)}, + {TOBN(0xce610d0d, 0xe9e40569), TOBN(0x7b99c65f, 0x35489fef), + TOBN(0x0c88ad1b, 0x3df18b97), TOBN(0x81b7d9be, 0x5d0e9edb)}}, + {{TOBN(0xd85218c0, 0xc716cc0a), TOBN(0xf4b5ff90, 0x85691c49), + TOBN(0xa4fd666b, 0xce356ac6), TOBN(0x17c72895, 0x4b327a7a)}, + {TOBN(0xf93d5085, 0xda6be7de), TOBN(0xff71530e, 0x3301d34e), + TOBN(0x4cd96442, 0xd8f448e8), TOBN(0x9283d331, 0x2ed18ffa)}}, + {{TOBN(0x4d33dd99, 0x2a849870), TOBN(0xa716964b, 0x41576335), + TOBN(0xff5e3a9b, 0x179be0e5), TOBN(0x5b9d6b1b, 0x83b13632)}, + {TOBN(0x3b8bd7d4, 0xa52f313b), TOBN(0xc9dd95a0, 0x637a4660), + TOBN(0x30035962, 0x0b3e218f), TOBN(0xce1481a3, 0xc7b28a3c)}}, + {{TOBN(0xab41b43a, 0x43228d83), TOBN(0x24ae1c30, 0x4ad63f99), + TOBN(0x8e525f1a, 0x46a51229), TOBN(0x14af860f, 0xcd26d2b4)}, + {TOBN(0xd6baef61, 0x3f714aa1), TOBN(0xf51865ad, 0xeb78795e), + TOBN(0xd3e21fce, 0xe6a9d694), TOBN(0x82ceb1dd, 0x8a37b527)}}}}; diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c new file mode 100644 index 000000000..977b08c8e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c @@ -0,0 +1,651 @@ +/* + * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2014, Intel Corporation. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) + * (1) Intel Corporation, Israel Development Center, Haifa, Israel + * (2) University of Haifa, Israel + * + * Reference: + * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with + * 256 Bit Primes" + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "../bn/internal.h" +#include "../delocate.h" +#include "../../internal.h" +#include "internal.h" +#include "p256-x86_64.h" + + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) + +typedef P256_POINT_AFFINE PRECOMP256_ROW[64]; + +// One converted into the Montgomery domain +static const BN_ULONG ONE[P256_LIMBS] = { + TOBN(0x00000000, 0x00000001), TOBN(0xffffffff, 0x00000000), + TOBN(0xffffffff, 0xffffffff), TOBN(0x00000000, 0xfffffffe), +}; + +// Precomputed tables for the default generator +#include "p256-x86_64-table.h" + +// Recode window to a signed digit, see |ec_GFp_nistp_recode_scalar_bits| in +// util.c for details +static unsigned booth_recode_w5(unsigned in) { + unsigned s, d; + + s = ~((in >> 5) - 1); + d = (1 << 6) - in - 1; + d = (d & s) | (in & ~s); + d = (d >> 1) + (d & 1); + + return (d << 1) + (s & 1); +} + +static unsigned booth_recode_w7(unsigned in) { + unsigned s, d; + + s = ~((in >> 7) - 1); + d = (1 << 8) - in - 1; + d = (d & s) | (in & ~s); + d = (d >> 1) + (d & 1); + + return (d << 1) + (s & 1); +} + +// copy_conditional copies |src| to |dst| if |move| is one and leaves it as-is +// if |move| is zero. +// +// WARNING: this breaks the usual convention of constant-time functions +// returning masks. +static void copy_conditional(BN_ULONG dst[P256_LIMBS], + const BN_ULONG src[P256_LIMBS], BN_ULONG move) { + BN_ULONG mask1 = ((BN_ULONG)0) - move; + BN_ULONG mask2 = ~mask1; + + dst[0] = (src[0] & mask1) ^ (dst[0] & mask2); + dst[1] = (src[1] & mask1) ^ (dst[1] & mask2); + dst[2] = (src[2] & mask1) ^ (dst[2] & mask2); + dst[3] = (src[3] & mask1) ^ (dst[3] & mask2); + if (P256_LIMBS == 8) { + dst[4] = (src[4] & mask1) ^ (dst[4] & mask2); + dst[5] = (src[5] & mask1) ^ (dst[5] & mask2); + dst[6] = (src[6] & mask1) ^ (dst[6] & mask2); + dst[7] = (src[7] & mask1) ^ (dst[7] & mask2); + } +} + +// is_not_zero returns one iff in != 0 and zero otherwise. +// +// WARNING: this breaks the usual convention of constant-time functions +// returning masks. +// +// (define-fun is_not_zero ((in (_ BitVec 64))) (_ BitVec 64) +// (bvlshr (bvor in (bvsub #x0000000000000000 in)) #x000000000000003f) +// ) +// +// (declare-fun x () (_ BitVec 64)) +// +// (assert (and (= x #x0000000000000000) (= (is_not_zero x) #x0000000000000001))) +// (check-sat) +// +// (assert (and (not (= x #x0000000000000000)) (= (is_not_zero x) #x0000000000000000))) +// (check-sat) +// +static BN_ULONG is_not_zero(BN_ULONG in) { + in |= (0 - in); + in >>= BN_BITS2 - 1; + return in; +} + +// ecp_nistz256_mod_inverse_mont sets |r| to (|in| * 2^-256)^-1 * 2^256 mod p. +// That is, |r| is the modular inverse of |in| for input and output in the +// Montgomery domain. +static void ecp_nistz256_mod_inverse_mont(BN_ULONG r[P256_LIMBS], + const BN_ULONG in[P256_LIMBS]) { + /* The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff + ffffffff + We use FLT and used poly-2 as exponent */ + BN_ULONG p2[P256_LIMBS]; + BN_ULONG p4[P256_LIMBS]; + BN_ULONG p8[P256_LIMBS]; + BN_ULONG p16[P256_LIMBS]; + BN_ULONG p32[P256_LIMBS]; + BN_ULONG res[P256_LIMBS]; + int i; + + ecp_nistz256_sqr_mont(res, in); + ecp_nistz256_mul_mont(p2, res, in); // 3*p + + ecp_nistz256_sqr_mont(res, p2); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(p4, res, p2); // f*p + + ecp_nistz256_sqr_mont(res, p4); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(p8, res, p4); // ff*p + + ecp_nistz256_sqr_mont(res, p8); + for (i = 0; i < 7; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(p16, res, p8); // ffff*p + + ecp_nistz256_sqr_mont(res, p16); + for (i = 0; i < 15; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(p32, res, p16); // ffffffff*p + + ecp_nistz256_sqr_mont(res, p32); + for (i = 0; i < 31; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, in); + + for (i = 0; i < 32 * 4; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p32); + + for (i = 0; i < 32; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p32); + + for (i = 0; i < 16; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p16); + + for (i = 0; i < 8; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p8); + + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(res, res, p4); + + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(res, res, p2); + + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(r, res, in); +} + +// r = p * p_scalar +static void ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + assert(p != NULL); + assert(p_scalar != NULL); + assert(group->field.width == P256_LIMBS); + + static const unsigned kWindowSize = 5; + static const unsigned kMask = (1 << (5 /* kWindowSize */ + 1)) - 1; + + // A |P256_POINT| is (3 * 32) = 96 bytes, and the 64-byte alignment should + // add no more than 63 bytes of overhead. Thus, |table| should require + // ~1599 ((96 * 16) + 63) bytes of stack space. + alignas(64) P256_POINT table[16]; + uint8_t p_str[33]; + OPENSSL_memcpy(p_str, p_scalar->bytes, 32); + p_str[32] = 0; + + // table[0] is implicitly (0,0,0) (the point at infinity), therefore it is + // not stored. All other values are actually stored with an offset of -1 in + // table. + P256_POINT *row = table; + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(row[1 - 1].X, p->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(row[1 - 1].Y, p->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(row[1 - 1].Z, p->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + + ecp_nistz256_point_double(&row[2 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[3 - 1], &row[2 - 1], &row[1 - 1]); + ecp_nistz256_point_double(&row[4 - 1], &row[2 - 1]); + ecp_nistz256_point_double(&row[6 - 1], &row[3 - 1]); + ecp_nistz256_point_double(&row[8 - 1], &row[4 - 1]); + ecp_nistz256_point_double(&row[12 - 1], &row[6 - 1]); + ecp_nistz256_point_add(&row[5 - 1], &row[4 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[7 - 1], &row[6 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[9 - 1], &row[8 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[13 - 1], &row[12 - 1], &row[1 - 1]); + ecp_nistz256_point_double(&row[14 - 1], &row[7 - 1]); + ecp_nistz256_point_double(&row[10 - 1], &row[5 - 1]); + ecp_nistz256_point_add(&row[15 - 1], &row[14 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[11 - 1], &row[10 - 1], &row[1 - 1]); + ecp_nistz256_point_double(&row[16 - 1], &row[8 - 1]); + + BN_ULONG tmp[P256_LIMBS]; + alignas(32) P256_POINT h; + unsigned index = 255; + unsigned wvalue = p_str[(index - 1) / 8]; + wvalue = (wvalue >> ((index - 1) % 8)) & kMask; + + ecp_nistz256_select_w5(r, table, booth_recode_w5(wvalue) >> 1); + + while (index >= 5) { + if (index != 255) { + unsigned off = (index - 1) / 8; + + wvalue = p_str[off] | p_str[off + 1] << 8; + wvalue = (wvalue >> ((index - 1) % 8)) & kMask; + + wvalue = booth_recode_w5(wvalue); + + ecp_nistz256_select_w5(&h, table, wvalue >> 1); + + ecp_nistz256_neg(tmp, h.Y); + copy_conditional(h.Y, tmp, (wvalue & 1)); + + ecp_nistz256_point_add(r, r, &h); + } + + index -= kWindowSize; + + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + } + + // Final window + wvalue = p_str[0]; + wvalue = (wvalue << 1) & kMask; + + wvalue = booth_recode_w5(wvalue); + + ecp_nistz256_select_w5(&h, table, wvalue >> 1); + + ecp_nistz256_neg(tmp, h.Y); + copy_conditional(h.Y, tmp, wvalue & 1); + + ecp_nistz256_point_add(r, r, &h); +} + +typedef union { + P256_POINT p; + P256_POINT_AFFINE a; +} p256_point_union_t; + +static unsigned calc_first_wvalue(unsigned *index, const uint8_t p_str[33]) { + static const unsigned kWindowSize = 7; + static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1; + *index = kWindowSize; + + unsigned wvalue = (p_str[0] << 1) & kMask; + return booth_recode_w7(wvalue); +} + +static unsigned calc_wvalue(unsigned *index, const uint8_t p_str[33]) { + static const unsigned kWindowSize = 7; + static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1; + + const unsigned off = (*index - 1) / 8; + unsigned wvalue = p_str[off] | p_str[off + 1] << 8; + wvalue = (wvalue >> ((*index - 1) % 8)) & kMask; + *index += kWindowSize; + + return booth_recode_w7(wvalue); +} + +static void ecp_nistz256_point_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *scalar) { + alignas(32) P256_POINT out; + ecp_nistz256_windowed_mul(group, &out, p, scalar); + + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(r->X.words, out.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, out.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, out.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_point_mul_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + alignas(32) p256_point_union_t t, p; + + uint8_t p_str[33]; + OPENSSL_memcpy(p_str, scalar->bytes, 32); + p_str[32] = 0; + + // First window + unsigned index = 0; + unsigned wvalue = calc_first_wvalue(&index, p_str); + + ecp_nistz256_select_w7(&p.a, ecp_nistz256_precomputed[0], wvalue >> 1); + ecp_nistz256_neg(p.p.Z, p.p.Y); + copy_conditional(p.p.Y, p.p.Z, wvalue & 1); + + // Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p| + // is infinity and |ONE| otherwise. |p| was computed from the table, so it + // is infinity iff |wvalue >> 1| is zero. + OPENSSL_memset(p.p.Z, 0, sizeof(p.p.Z)); + copy_conditional(p.p.Z, ONE, is_not_zero(wvalue >> 1)); + + for (int i = 1; i < 37; i++) { + wvalue = calc_wvalue(&index, p_str); + + ecp_nistz256_select_w7(&t.a, ecp_nistz256_precomputed[i], wvalue >> 1); + + ecp_nistz256_neg(t.p.Z, t.a.Y); + copy_conditional(t.a.Y, t.p.Z, wvalue & 1); + + // Note |ecp_nistz256_point_add_affine| does not work if |p.p| and |t.a| + // are the same non-infinity point. + ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a); + } + + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(r->X.words, p.p.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, p.p.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, p.p.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_points_mul_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p_, + const EC_SCALAR *p_scalar) { + assert(p_ != NULL && p_scalar != NULL && g_scalar != NULL); + + alignas(32) p256_point_union_t t, p; + uint8_t p_str[33]; + OPENSSL_memcpy(p_str, g_scalar->bytes, 32); + p_str[32] = 0; + + // First window + unsigned index = 0; + unsigned wvalue = calc_first_wvalue(&index, p_str); + + // Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p| + // is infinity and |ONE| otherwise. |p| was computed from the table, so it + // is infinity iff |wvalue >> 1| is zero. + if ((wvalue >> 1) != 0) { + OPENSSL_memcpy(&p.a, &ecp_nistz256_precomputed[0][(wvalue >> 1) - 1], + sizeof(p.a)); + OPENSSL_memcpy(&p.p.Z, ONE, sizeof(p.p.Z)); + } else { + OPENSSL_memset(&p.a, 0, sizeof(p.a)); + OPENSSL_memset(p.p.Z, 0, sizeof(p.p.Z)); + } + + if ((wvalue & 1) == 1) { + ecp_nistz256_neg(p.p.Y, p.p.Y); + } + + for (int i = 1; i < 37; i++) { + wvalue = calc_wvalue(&index, p_str); + + if ((wvalue >> 1) == 0) { + continue; + } + + OPENSSL_memcpy(&t.a, &ecp_nistz256_precomputed[i][(wvalue >> 1) - 1], + sizeof(p.a)); + + if ((wvalue & 1) == 1) { + ecp_nistz256_neg(t.a.Y, t.a.Y); + } + + // Note |ecp_nistz256_point_add_affine| does not work if |p.p| and |t.a| + // are the same non-infinity point, so it is important that we compute the + // |g_scalar| term before the |p_scalar| term. + ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a); + } + + ecp_nistz256_windowed_mul(group, &t.p, p_, p_scalar); + ecp_nistz256_point_add(&p.p, &p.p, &t.p); + + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(r->X.words, p.p.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, p.p.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, p.p.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static int ecp_nistz256_get_affine(const EC_GROUP *group, + const EC_RAW_POINT *point, EC_FELEM *x, + EC_FELEM *y) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + BN_ULONG z_inv2[P256_LIMBS]; + BN_ULONG z_inv3[P256_LIMBS]; + assert(group->field.width == P256_LIMBS); + ecp_nistz256_mod_inverse_mont(z_inv3, point->Z.words); + ecp_nistz256_sqr_mont(z_inv2, z_inv3); + + // Instead of using |ecp_nistz256_from_mont| to convert the |x| coordinate + // and then calling |ecp_nistz256_from_mont| again to convert the |y| + // coordinate below, convert the common factor |z_inv2| once now, saving one + // reduction. + ecp_nistz256_from_mont(z_inv2, z_inv2); + + if (x != NULL) { + ecp_nistz256_mul_mont(x->words, z_inv2, point->X.words); + } + + if (y != NULL) { + ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2); + ecp_nistz256_mul_mont(y->words, z_inv3, point->Y.words); + } + + return 1; +} + +static void ecp_nistz256_add(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a_, const EC_RAW_POINT *b_) { + P256_POINT a, b; + OPENSSL_memcpy(a.X, a_->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Y, a_->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Z, a_->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(b.X, b_->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(b.Y, b_->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(b.Z, b_->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + ecp_nistz256_point_add(&a, &a, &b); + OPENSSL_memcpy(r->X.words, a.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, a.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, a.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a_) { + P256_POINT a; + OPENSSL_memcpy(a.X, a_->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Y, a_->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Z, a_->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + ecp_nistz256_point_double(&a, &a); + OPENSSL_memcpy(r->X.words, a.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, a.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, a.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_inv_mod_ord(const EC_GROUP *group, EC_SCALAR *out, + const EC_SCALAR *in) { + // table[i] stores a power of |in| corresponding to the matching enum value. + enum { + // The following indices specify the power in binary. + i_1 = 0, + i_10, + i_11, + i_101, + i_111, + i_1010, + i_1111, + i_10101, + i_101010, + i_101111, + // The following indices specify 2^N-1, or N ones in a row. + i_x6, + i_x8, + i_x16, + i_x32 + }; + BN_ULONG table[15][P256_LIMBS]; + + // https://briansmith.org/ecc-inversion-addition-chains-01#p256_scalar_inversion + // + // Even though this code path spares 12 squarings, 4.5%, and 13 + // multiplications, 25%, the overall sign operation is not that much faster, + // not more that 2%. Most of the performance of this function comes from the + // scalar operations. + + // Pre-calculate powers. + OPENSSL_memcpy(table[i_1], in->words, P256_LIMBS * sizeof(BN_ULONG)); + + ecp_nistz256_ord_sqr_mont(table[i_10], table[i_1], 1); + + ecp_nistz256_ord_mul_mont(table[i_11], table[i_1], table[i_10]); + + ecp_nistz256_ord_mul_mont(table[i_101], table[i_11], table[i_10]); + + ecp_nistz256_ord_mul_mont(table[i_111], table[i_101], table[i_10]); + + ecp_nistz256_ord_sqr_mont(table[i_1010], table[i_101], 1); + + ecp_nistz256_ord_mul_mont(table[i_1111], table[i_1010], table[i_101]); + + ecp_nistz256_ord_sqr_mont(table[i_10101], table[i_1010], 1); + ecp_nistz256_ord_mul_mont(table[i_10101], table[i_10101], table[i_1]); + + ecp_nistz256_ord_sqr_mont(table[i_101010], table[i_10101], 1); + + ecp_nistz256_ord_mul_mont(table[i_101111], table[i_101010], table[i_101]); + + ecp_nistz256_ord_mul_mont(table[i_x6], table[i_101010], table[i_10101]); + + ecp_nistz256_ord_sqr_mont(table[i_x8], table[i_x6], 2); + ecp_nistz256_ord_mul_mont(table[i_x8], table[i_x8], table[i_11]); + + ecp_nistz256_ord_sqr_mont(table[i_x16], table[i_x8], 8); + ecp_nistz256_ord_mul_mont(table[i_x16], table[i_x16], table[i_x8]); + + ecp_nistz256_ord_sqr_mont(table[i_x32], table[i_x16], 16); + ecp_nistz256_ord_mul_mont(table[i_x32], table[i_x32], table[i_x16]); + + // Compute |in| raised to the order-2. + ecp_nistz256_ord_sqr_mont(out->words, table[i_x32], 64); + ecp_nistz256_ord_mul_mont(out->words, out->words, table[i_x32]); + static const struct { + uint8_t p, i; + } kChain[27] = {{32, i_x32}, {6, i_101111}, {5, i_111}, {4, i_11}, + {5, i_1111}, {5, i_10101}, {4, i_101}, {3, i_101}, + {3, i_101}, {5, i_111}, {9, i_101111}, {6, i_1111}, + {2, i_1}, {5, i_1}, {6, i_1111}, {5, i_111}, + {4, i_111}, {5, i_111}, {5, i_101}, {3, i_11}, + {10, i_101111}, {2, i_11}, {5, i_11}, {5, i_11}, + {3, i_1}, {7, i_10101}, {6, i_1111}}; + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kChain); i++) { + ecp_nistz256_ord_sqr_mont(out->words, out->words, kChain[i].p); + ecp_nistz256_ord_mul_mont(out->words, out->words, table[kChain[i].i]); + } +} + +static int ecp_nistz256_mont_inv_mod_ord_vartime(const EC_GROUP *group, + EC_SCALAR *out, + const EC_SCALAR *in) { + if ((OPENSSL_ia32cap_get()[1] & (1 << 28)) == 0) { + // No AVX support; fallback to generic code. + return ec_GFp_simple_mont_inv_mod_ord_vartime(group, out, in); + } + + assert(group->order.width == P256_LIMBS); + if (!beeu_mod_inverse_vartime(out->words, in->words, group->order.d)) { + return 0; + } + + // The result should be returned in the Montgomery domain. + ec_scalar_to_montgomery(group, out, out); + return 1; +} + +static int ecp_nistz256_cmp_x_coordinate(const EC_GROUP *group, + const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (ec_GFp_simple_is_at_infinity(group, p)) { + return 0; + } + + assert(group->order.width == P256_LIMBS); + assert(group->field.width == P256_LIMBS); + + // We wish to compare X/Z^2 with r. This is equivalent to comparing X with + // r*Z^2. Note that X and Z are represented in Montgomery form, while r is + // not. + BN_ULONG r_Z2[P256_LIMBS], Z2_mont[P256_LIMBS], X[P256_LIMBS]; + ecp_nistz256_mul_mont(Z2_mont, p->Z.words, p->Z.words); + ecp_nistz256_mul_mont(r_Z2, r->words, Z2_mont); + ecp_nistz256_from_mont(X, p->X.words); + + if (OPENSSL_memcmp(r_Z2, X, sizeof(r_Z2)) == 0) { + return 1; + } + + // During signing the x coefficient is reduced modulo the group order. + // Therefore there is a small possibility, less than 1/2^128, that group_order + // < p.x < P. in that case we need not only to compare against |r| but also to + // compare against r+group_order. + if (bn_less_than_words(r->words, group->field_minus_order.words, + P256_LIMBS)) { + // We can ignore the carry because: r + group_order < p < 2^256. + bn_add_words(r_Z2, r->words, group->order.d, P256_LIMBS); + ecp_nistz256_mul_mont(r_Z2, r_Z2, Z2_mont); + if (OPENSSL_memcmp(r_Z2, X, sizeof(r_Z2)) == 0) { + return 1; + } + } + + return 0; +} + +DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistz256_method) { + out->group_init = ec_GFp_mont_group_init; + out->group_finish = ec_GFp_mont_group_finish; + out->group_set_curve = ec_GFp_mont_group_set_curve; + out->point_get_affine_coordinates = ecp_nistz256_get_affine; + out->add = ecp_nistz256_add; + out->dbl = ecp_nistz256_dbl; + out->mul = ecp_nistz256_point_mul; + out->mul_base = ecp_nistz256_point_mul_base; + out->mul_public = ecp_nistz256_points_mul_public; + out->felem_mul = ec_GFp_mont_felem_mul; + out->felem_sqr = ec_GFp_mont_felem_sqr; + out->bignum_to_felem = ec_GFp_mont_bignum_to_felem; + out->felem_to_bignum = ec_GFp_mont_felem_to_bignum; + out->scalar_inv_montgomery = ecp_nistz256_inv_mod_ord; + out->scalar_inv_montgomery_vartime = ecp_nistz256_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ecp_nistz256_cmp_x_coordinate; +} + +#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) */ diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back new file mode 100644 index 000000000..b4af54465 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.c.grpc_back @@ -0,0 +1,651 @@ +/* + * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2014, Intel Corporation. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) + * (1) Intel Corporation, Israel Development Center, Haifa, Israel + * (2) University of Haifa, Israel + * + * Reference: + * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with + * 256 Bit Primes" + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include + +#include "../bn/internal.h" +#include "../delocate.h" +#include "../../internal.h" +#include "internal.h" +#include "p256-x86_64.h" + + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) + +typedef P256_POINT_AFFINE PRECOMP256_ROW[64]; + +// One converted into the Montgomery domain +static const BN_ULONG ONE[P256_LIMBS] = { + TOBN(0x00000000, 0x00000001), TOBN(0xffffffff, 0x00000000), + TOBN(0xffffffff, 0xffffffff), TOBN(0x00000000, 0xfffffffe), +}; + +// Precomputed tables for the default generator +#include "p256-x86_64-table.h" + +// Recode window to a signed digit, see |ec_GFp_nistp_recode_scalar_bits| in +// util.c for details +static unsigned booth_recode_w5(unsigned in) { + unsigned s, d; + + s = ~((in >> 5) - 1); + d = (1 << 6) - in - 1; + d = (d & s) | (in & ~s); + d = (d >> 1) + (d & 1); + + return (d << 1) + (s & 1); +} + +static unsigned booth_recode_w7(unsigned in) { + unsigned s, d; + + s = ~((in >> 7) - 1); + d = (1 << 8) - in - 1; + d = (d & s) | (in & ~s); + d = (d >> 1) + (d & 1); + + return (d << 1) + (s & 1); +} + +// copy_conditional copies |src| to |dst| if |move| is one and leaves it as-is +// if |move| is zero. +// +// WARNING: this breaks the usual convention of constant-time functions +// returning masks. +static void copy_conditional(BN_ULONG dst[P256_LIMBS], + const BN_ULONG src[P256_LIMBS], BN_ULONG move) { + BN_ULONG mask1 = ((BN_ULONG)0) - move; + BN_ULONG mask2 = ~mask1; + + dst[0] = (src[0] & mask1) ^ (dst[0] & mask2); + dst[1] = (src[1] & mask1) ^ (dst[1] & mask2); + dst[2] = (src[2] & mask1) ^ (dst[2] & mask2); + dst[3] = (src[3] & mask1) ^ (dst[3] & mask2); + if (P256_LIMBS == 8) { + dst[4] = (src[4] & mask1) ^ (dst[4] & mask2); + dst[5] = (src[5] & mask1) ^ (dst[5] & mask2); + dst[6] = (src[6] & mask1) ^ (dst[6] & mask2); + dst[7] = (src[7] & mask1) ^ (dst[7] & mask2); + } +} + +// is_not_zero returns one iff in != 0 and zero otherwise. +// +// WARNING: this breaks the usual convention of constant-time functions +// returning masks. +// +// (define-fun is_not_zero ((in (_ BitVec 64))) (_ BitVec 64) +// (bvlshr (bvor in (bvsub #x0000000000000000 in)) #x000000000000003f) +// ) +// +// (declare-fun x () (_ BitVec 64)) +// +// (assert (and (= x #x0000000000000000) (= (is_not_zero x) #x0000000000000001))) +// (check-sat) +// +// (assert (and (not (= x #x0000000000000000)) (= (is_not_zero x) #x0000000000000000))) +// (check-sat) +// +static BN_ULONG is_not_zero(BN_ULONG in) { + in |= (0 - in); + in >>= BN_BITS2 - 1; + return in; +} + +// ecp_nistz256_mod_inverse_mont sets |r| to (|in| * 2^-256)^-1 * 2^256 mod p. +// That is, |r| is the modular inverse of |in| for input and output in the +// Montgomery domain. +static void ecp_nistz256_mod_inverse_mont(BN_ULONG r[P256_LIMBS], + const BN_ULONG in[P256_LIMBS]) { + /* The poly is ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff + ffffffff + We use FLT and used poly-2 as exponent */ + BN_ULONG p2[P256_LIMBS]; + BN_ULONG p4[P256_LIMBS]; + BN_ULONG p8[P256_LIMBS]; + BN_ULONG p16[P256_LIMBS]; + BN_ULONG p32[P256_LIMBS]; + BN_ULONG res[P256_LIMBS]; + int i; + + ecp_nistz256_sqr_mont(res, in); + ecp_nistz256_mul_mont(p2, res, in); // 3*p + + ecp_nistz256_sqr_mont(res, p2); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(p4, res, p2); // f*p + + ecp_nistz256_sqr_mont(res, p4); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(p8, res, p4); // ff*p + + ecp_nistz256_sqr_mont(res, p8); + for (i = 0; i < 7; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(p16, res, p8); // ffff*p + + ecp_nistz256_sqr_mont(res, p16); + for (i = 0; i < 15; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(p32, res, p16); // ffffffff*p + + ecp_nistz256_sqr_mont(res, p32); + for (i = 0; i < 31; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, in); + + for (i = 0; i < 32 * 4; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p32); + + for (i = 0; i < 32; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p32); + + for (i = 0; i < 16; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p16); + + for (i = 0; i < 8; i++) { + ecp_nistz256_sqr_mont(res, res); + } + ecp_nistz256_mul_mont(res, res, p8); + + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(res, res, p4); + + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(res, res, p2); + + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_sqr_mont(res, res); + ecp_nistz256_mul_mont(r, res, in); +} + +// r = p * p_scalar +static void ecp_nistz256_windowed_mul(const EC_GROUP *group, P256_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + assert(p != NULL); + assert(p_scalar != NULL); + assert(group->field.width == P256_LIMBS); + + static const unsigned kWindowSize = 5; + static const unsigned kMask = (1 << (5 /* kWindowSize */ + 1)) - 1; + + // A |P256_POINT| is (3 * 32) = 96 bytes, and the 64-byte alignment should + // add no more than 63 bytes of overhead. Thus, |table| should require + // ~1599 ((96 * 16) + 63) bytes of stack space. + alignas(64) P256_POINT table[16]; + uint8_t p_str[33]; + OPENSSL_memcpy(p_str, p_scalar->bytes, 32); + p_str[32] = 0; + + // table[0] is implicitly (0,0,0) (the point at infinity), therefore it is + // not stored. All other values are actually stored with an offset of -1 in + // table. + P256_POINT *row = table; + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(row[1 - 1].X, p->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(row[1 - 1].Y, p->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(row[1 - 1].Z, p->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + + ecp_nistz256_point_double(&row[2 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[3 - 1], &row[2 - 1], &row[1 - 1]); + ecp_nistz256_point_double(&row[4 - 1], &row[2 - 1]); + ecp_nistz256_point_double(&row[6 - 1], &row[3 - 1]); + ecp_nistz256_point_double(&row[8 - 1], &row[4 - 1]); + ecp_nistz256_point_double(&row[12 - 1], &row[6 - 1]); + ecp_nistz256_point_add(&row[5 - 1], &row[4 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[7 - 1], &row[6 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[9 - 1], &row[8 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[13 - 1], &row[12 - 1], &row[1 - 1]); + ecp_nistz256_point_double(&row[14 - 1], &row[7 - 1]); + ecp_nistz256_point_double(&row[10 - 1], &row[5 - 1]); + ecp_nistz256_point_add(&row[15 - 1], &row[14 - 1], &row[1 - 1]); + ecp_nistz256_point_add(&row[11 - 1], &row[10 - 1], &row[1 - 1]); + ecp_nistz256_point_double(&row[16 - 1], &row[8 - 1]); + + BN_ULONG tmp[P256_LIMBS]; + alignas(32) P256_POINT h; + unsigned index = 255; + unsigned wvalue = p_str[(index - 1) / 8]; + wvalue = (wvalue >> ((index - 1) % 8)) & kMask; + + ecp_nistz256_select_w5(r, table, booth_recode_w5(wvalue) >> 1); + + while (index >= 5) { + if (index != 255) { + unsigned off = (index - 1) / 8; + + wvalue = p_str[off] | p_str[off + 1] << 8; + wvalue = (wvalue >> ((index - 1) % 8)) & kMask; + + wvalue = booth_recode_w5(wvalue); + + ecp_nistz256_select_w5(&h, table, wvalue >> 1); + + ecp_nistz256_neg(tmp, h.Y); + copy_conditional(h.Y, tmp, (wvalue & 1)); + + ecp_nistz256_point_add(r, r, &h); + } + + index -= kWindowSize; + + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + ecp_nistz256_point_double(r, r); + } + + // Final window + wvalue = p_str[0]; + wvalue = (wvalue << 1) & kMask; + + wvalue = booth_recode_w5(wvalue); + + ecp_nistz256_select_w5(&h, table, wvalue >> 1); + + ecp_nistz256_neg(tmp, h.Y); + copy_conditional(h.Y, tmp, wvalue & 1); + + ecp_nistz256_point_add(r, r, &h); +} + +typedef union { + P256_POINT p; + P256_POINT_AFFINE a; +} p256_point_union_t; + +static unsigned calc_first_wvalue(unsigned *index, const uint8_t p_str[33]) { + static const unsigned kWindowSize = 7; + static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1; + *index = kWindowSize; + + unsigned wvalue = (p_str[0] << 1) & kMask; + return booth_recode_w7(wvalue); +} + +static unsigned calc_wvalue(unsigned *index, const uint8_t p_str[33]) { + static const unsigned kWindowSize = 7; + static const unsigned kMask = (1 << (7 /* kWindowSize */ + 1)) - 1; + + const unsigned off = (*index - 1) / 8; + unsigned wvalue = p_str[off] | p_str[off + 1] << 8; + wvalue = (wvalue >> ((*index - 1) % 8)) & kMask; + *index += kWindowSize; + + return booth_recode_w7(wvalue); +} + +static void ecp_nistz256_point_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *scalar) { + alignas(32) P256_POINT out; + ecp_nistz256_windowed_mul(group, &out, p, scalar); + + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(r->X.words, out.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, out.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, out.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_point_mul_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + alignas(32) p256_point_union_t t, p; + + uint8_t p_str[33]; + OPENSSL_memcpy(p_str, scalar->bytes, 32); + p_str[32] = 0; + + // First window + unsigned index = 0; + unsigned wvalue = calc_first_wvalue(&index, p_str); + + ecp_nistz256_select_w7(&p.a, ecp_nistz256_precomputed[0], wvalue >> 1); + ecp_nistz256_neg(p.p.Z, p.p.Y); + copy_conditional(p.p.Y, p.p.Z, wvalue & 1); + + // Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p| + // is infinity and |ONE| otherwise. |p| was computed from the table, so it + // is infinity iff |wvalue >> 1| is zero. + OPENSSL_memset(p.p.Z, 0, sizeof(p.p.Z)); + copy_conditional(p.p.Z, ONE, is_not_zero(wvalue >> 1)); + + for (int i = 1; i < 37; i++) { + wvalue = calc_wvalue(&index, p_str); + + ecp_nistz256_select_w7(&t.a, ecp_nistz256_precomputed[i], wvalue >> 1); + + ecp_nistz256_neg(t.p.Z, t.a.Y); + copy_conditional(t.a.Y, t.p.Z, wvalue & 1); + + // Note |ecp_nistz256_point_add_affine| does not work if |p.p| and |t.a| + // are the same non-infinity point. + ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a); + } + + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(r->X.words, p.p.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, p.p.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, p.p.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_points_mul_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p_, + const EC_SCALAR *p_scalar) { + assert(p_ != NULL && p_scalar != NULL && g_scalar != NULL); + + alignas(32) p256_point_union_t t, p; + uint8_t p_str[33]; + OPENSSL_memcpy(p_str, g_scalar->bytes, 32); + p_str[32] = 0; + + // First window + unsigned index = 0; + unsigned wvalue = calc_first_wvalue(&index, p_str); + + // Convert |p| from affine to Jacobian coordinates. We set Z to zero if |p| + // is infinity and |ONE| otherwise. |p| was computed from the table, so it + // is infinity iff |wvalue >> 1| is zero. + if ((wvalue >> 1) != 0) { + OPENSSL_memcpy(&p.a, &ecp_nistz256_precomputed[0][(wvalue >> 1) - 1], + sizeof(p.a)); + OPENSSL_memcpy(&p.p.Z, ONE, sizeof(p.p.Z)); + } else { + OPENSSL_memset(&p.a, 0, sizeof(p.a)); + OPENSSL_memset(p.p.Z, 0, sizeof(p.p.Z)); + } + + if ((wvalue & 1) == 1) { + ecp_nistz256_neg(p.p.Y, p.p.Y); + } + + for (int i = 1; i < 37; i++) { + wvalue = calc_wvalue(&index, p_str); + + if ((wvalue >> 1) == 0) { + continue; + } + + OPENSSL_memcpy(&t.a, &ecp_nistz256_precomputed[i][(wvalue >> 1) - 1], + sizeof(p.a)); + + if ((wvalue & 1) == 1) { + ecp_nistz256_neg(t.a.Y, t.a.Y); + } + + // Note |ecp_nistz256_point_add_affine| does not work if |p.p| and |t.a| + // are the same non-infinity point, so it is important that we compute the + // |g_scalar| term before the |p_scalar| term. + ecp_nistz256_point_add_affine(&p.p, &p.p, &t.a); + } + + ecp_nistz256_windowed_mul(group, &t.p, p_, p_scalar); + ecp_nistz256_point_add(&p.p, &p.p, &t.p); + + assert(group->field.width == P256_LIMBS); + OPENSSL_memcpy(r->X.words, p.p.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, p.p.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, p.p.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static int ecp_nistz256_get_affine(const EC_GROUP *group, + const EC_RAW_POINT *point, EC_FELEM *x, + EC_FELEM *y) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + BN_ULONG z_inv2[P256_LIMBS]; + BN_ULONG z_inv3[P256_LIMBS]; + assert(group->field.width == P256_LIMBS); + ecp_nistz256_mod_inverse_mont(z_inv3, point->Z.words); + ecp_nistz256_sqr_mont(z_inv2, z_inv3); + + // Instead of using |ecp_nistz256_from_mont| to convert the |x| coordinate + // and then calling |ecp_nistz256_from_mont| again to convert the |y| + // coordinate below, convert the common factor |z_inv2| once now, saving one + // reduction. + ecp_nistz256_from_mont(z_inv2, z_inv2); + + if (x != NULL) { + ecp_nistz256_mul_mont(x->words, z_inv2, point->X.words); + } + + if (y != NULL) { + ecp_nistz256_mul_mont(z_inv3, z_inv3, z_inv2); + ecp_nistz256_mul_mont(y->words, z_inv3, point->Y.words); + } + + return 1; +} + +static void ecp_nistz256_add(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a_, const EC_RAW_POINT *b_) { + P256_POINT a, b; + OPENSSL_memcpy(a.X, a_->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Y, a_->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Z, a_->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(b.X, b_->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(b.Y, b_->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(b.Z, b_->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + ecp_nistz256_point_add(&a, &a, &b); + OPENSSL_memcpy(r->X.words, a.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, a.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, a.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a_) { + P256_POINT a; + OPENSSL_memcpy(a.X, a_->X.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Y, a_->Y.words, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(a.Z, a_->Z.words, P256_LIMBS * sizeof(BN_ULONG)); + ecp_nistz256_point_double(&a, &a); + OPENSSL_memcpy(r->X.words, a.X, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Y.words, a.Y, P256_LIMBS * sizeof(BN_ULONG)); + OPENSSL_memcpy(r->Z.words, a.Z, P256_LIMBS * sizeof(BN_ULONG)); +} + +static void ecp_nistz256_inv_mod_ord(const EC_GROUP *group, EC_SCALAR *out, + const EC_SCALAR *in) { + // table[i] stores a power of |in| corresponding to the matching enum value. + enum { + // The following indices specify the power in binary. + i_1 = 0, + i_10, + i_11, + i_101, + i_111, + i_1010, + i_1111, + i_10101, + i_101010, + i_101111, + // The following indices specify 2^N-1, or N ones in a row. + i_x6, + i_x8, + i_x16, + i_x32 + }; + BN_ULONG table[15][P256_LIMBS]; + + // https://briansmith.org/ecc-inversion-addition-chains-01#p256_scalar_inversion + // + // Even though this code path spares 12 squarings, 4.5%, and 13 + // multiplications, 25%, the overall sign operation is not that much faster, + // not more that 2%. Most of the performance of this function comes from the + // scalar operations. + + // Pre-calculate powers. + OPENSSL_memcpy(table[i_1], in->words, P256_LIMBS * sizeof(BN_ULONG)); + + ecp_nistz256_ord_sqr_mont(table[i_10], table[i_1], 1); + + ecp_nistz256_ord_mul_mont(table[i_11], table[i_1], table[i_10]); + + ecp_nistz256_ord_mul_mont(table[i_101], table[i_11], table[i_10]); + + ecp_nistz256_ord_mul_mont(table[i_111], table[i_101], table[i_10]); + + ecp_nistz256_ord_sqr_mont(table[i_1010], table[i_101], 1); + + ecp_nistz256_ord_mul_mont(table[i_1111], table[i_1010], table[i_101]); + + ecp_nistz256_ord_sqr_mont(table[i_10101], table[i_1010], 1); + ecp_nistz256_ord_mul_mont(table[i_10101], table[i_10101], table[i_1]); + + ecp_nistz256_ord_sqr_mont(table[i_101010], table[i_10101], 1); + + ecp_nistz256_ord_mul_mont(table[i_101111], table[i_101010], table[i_101]); + + ecp_nistz256_ord_mul_mont(table[i_x6], table[i_101010], table[i_10101]); + + ecp_nistz256_ord_sqr_mont(table[i_x8], table[i_x6], 2); + ecp_nistz256_ord_mul_mont(table[i_x8], table[i_x8], table[i_11]); + + ecp_nistz256_ord_sqr_mont(table[i_x16], table[i_x8], 8); + ecp_nistz256_ord_mul_mont(table[i_x16], table[i_x16], table[i_x8]); + + ecp_nistz256_ord_sqr_mont(table[i_x32], table[i_x16], 16); + ecp_nistz256_ord_mul_mont(table[i_x32], table[i_x32], table[i_x16]); + + // Compute |in| raised to the order-2. + ecp_nistz256_ord_sqr_mont(out->words, table[i_x32], 64); + ecp_nistz256_ord_mul_mont(out->words, out->words, table[i_x32]); + static const struct { + uint8_t p, i; + } kChain[27] = {{32, i_x32}, {6, i_101111}, {5, i_111}, {4, i_11}, + {5, i_1111}, {5, i_10101}, {4, i_101}, {3, i_101}, + {3, i_101}, {5, i_111}, {9, i_101111}, {6, i_1111}, + {2, i_1}, {5, i_1}, {6, i_1111}, {5, i_111}, + {4, i_111}, {5, i_111}, {5, i_101}, {3, i_11}, + {10, i_101111}, {2, i_11}, {5, i_11}, {5, i_11}, + {3, i_1}, {7, i_10101}, {6, i_1111}}; + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kChain); i++) { + ecp_nistz256_ord_sqr_mont(out->words, out->words, kChain[i].p); + ecp_nistz256_ord_mul_mont(out->words, out->words, table[kChain[i].i]); + } +} + +static int ecp_nistz256_mont_inv_mod_ord_vartime(const EC_GROUP *group, + EC_SCALAR *out, + const EC_SCALAR *in) { + if ((OPENSSL_ia32cap_get()[1] & (1 << 28)) == 0) { + // No AVX support; fallback to generic code. + return ec_GFp_simple_mont_inv_mod_ord_vartime(group, out, in); + } + + assert(group->order.width == P256_LIMBS); + if (!beeu_mod_inverse_vartime(out->words, in->words, group->order.d)) { + return 0; + } + + // The result should be returned in the Montgomery domain. + ec_scalar_to_montgomery(group, out, out); + return 1; +} + +static int ecp_nistz256_cmp_x_coordinate(const EC_GROUP *group, + const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (ec_GFp_simple_is_at_infinity(group, p)) { + return 0; + } + + assert(group->order.width == P256_LIMBS); + assert(group->field.width == P256_LIMBS); + + // We wish to compare X/Z^2 with r. This is equivalent to comparing X with + // r*Z^2. Note that X and Z are represented in Montgomery form, while r is + // not. + BN_ULONG r_Z2[P256_LIMBS], Z2_mont[P256_LIMBS], X[P256_LIMBS]; + ecp_nistz256_mul_mont(Z2_mont, p->Z.words, p->Z.words); + ecp_nistz256_mul_mont(r_Z2, r->words, Z2_mont); + ecp_nistz256_from_mont(X, p->X.words); + + if (OPENSSL_memcmp(r_Z2, X, sizeof(r_Z2)) == 0) { + return 1; + } + + // During signing the x coefficient is reduced modulo the group order. + // Therefore there is a small possibility, less than 1/2^128, that group_order + // < p.x < P. in that case we need not only to compare against |r| but also to + // compare against r+group_order. + if (bn_less_than_words(r->words, group->field_minus_order.words, + P256_LIMBS)) { + // We can ignore the carry because: r + group_order < p < 2^256. + bn_add_words(r_Z2, r->words, group->order.d, P256_LIMBS); + ecp_nistz256_mul_mont(r_Z2, r_Z2, Z2_mont); + if (OPENSSL_memcmp(r_Z2, X, sizeof(r_Z2)) == 0) { + return 1; + } + } + + return 0; +} + +DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistz256_method) { + out->group_init = ec_GFp_mont_group_init; + out->group_finish = ec_GFp_mont_group_finish; + out->group_set_curve = ec_GFp_mont_group_set_curve; + out->point_get_affine_coordinates = ecp_nistz256_get_affine; + out->add = ecp_nistz256_add; + out->dbl = ecp_nistz256_dbl; + out->mul = ecp_nistz256_point_mul; + out->mul_base = ecp_nistz256_point_mul_base; + out->mul_public = ecp_nistz256_points_mul_public; + out->felem_mul = ec_GFp_mont_felem_mul; + out->felem_sqr = ec_GFp_mont_felem_sqr; + out->bignum_to_felem = ec_GFp_mont_bignum_to_felem; + out->felem_to_bignum = ec_GFp_mont_felem_to_bignum; + out->scalar_inv_montgomery = ecp_nistz256_inv_mod_ord; + out->scalar_inv_montgomery_vartime = ecp_nistz256_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ecp_nistz256_cmp_x_coordinate; +} + +#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) */ diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h new file mode 100644 index 000000000..f3492527d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h @@ -0,0 +1,153 @@ +/* + * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2014, Intel Corporation. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) + * (1) Intel Corporation, Israel Development Center, Haifa, Israel + * (2) University of Haifa, Israel + * + * Reference: + * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with + * 256 Bit Primes" + */ + +#ifndef OPENSSL_HEADER_EC_P256_X86_64_H +#define OPENSSL_HEADER_EC_P256_X86_64_H + +#include + +#include + +#include "../bn/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) + +// P-256 field operations. +// +// An element mod P in P-256 is represented as a little-endian array of +// |P256_LIMBS| |BN_ULONG|s, spanning the full range of values. +// +// The following functions take fully-reduced inputs mod P and give +// fully-reduced outputs. They may be used in-place. + +#define P256_LIMBS (256 / BN_BITS2) + +// ecp_nistz256_neg sets |res| to -|a| mod P. +void ecp_nistz256_neg(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]); + +// ecp_nistz256_mul_mont sets |res| to |a| * |b| * 2^-256 mod P. +void ecp_nistz256_mul_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG b[P256_LIMBS]); + +// ecp_nistz256_sqr_mont sets |res| to |a| * |a| * 2^-256 mod P. +void ecp_nistz256_sqr_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS]); + +// ecp_nistz256_from_mont sets |res| to |in|, converted from Montgomery domain +// by multiplying with 1. +static inline void ecp_nistz256_from_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG in[P256_LIMBS]) { + static const BN_ULONG ONE[P256_LIMBS] = { 1 }; + ecp_nistz256_mul_mont(res, in, ONE); +} + +// ecp_nistz256_to_mont sets |res| to |in|, converted to Montgomery domain +// by multiplying with RR = 2^512 mod P precomputed for NIST P256 curve. +static inline void ecp_nistz256_to_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG in[P256_LIMBS]) { + static const BN_ULONG RR[P256_LIMBS] = { + TOBN(0x00000000, 0x00000003), TOBN(0xfffffffb, 0xffffffff), + TOBN(0xffffffff, 0xfffffffe), TOBN(0x00000004, 0xfffffffd)}; + ecp_nistz256_mul_mont(res, in, RR); +} + + +// P-256 scalar operations. +// +// The following functions compute modulo N, where N is the order of P-256. They +// take fully-reduced inputs and give fully-reduced outputs. + +// ecp_nistz256_ord_mul_mont sets |res| to |a| * |b| where inputs and outputs +// are in Montgomery form. That is, |res| is |a| * |b| * 2^-256 mod N. +void ecp_nistz256_ord_mul_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG b[P256_LIMBS]); + +// ecp_nistz256_ord_sqr_mont sets |res| to |a|^(2*|rep|) where inputs and +// outputs are in Montgomery form. That is, |res| is +// (|a| * 2^-256)^(2*|rep|) * 2^256 mod N. +void ecp_nistz256_ord_sqr_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], BN_ULONG rep); + +// beeu_mod_inverse_vartime sets out = a^-1 mod p using a Euclidean algorithm. +// Assumption: 0 < a < p < 2^(256) and p is odd. +int beeu_mod_inverse_vartime(BN_ULONG out[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG p[P256_LIMBS]); + + +// P-256 point operations. +// +// The following functions may be used in-place. All coordinates are in the +// Montgomery domain. + +// A P256_POINT represents a P-256 point in Jacobian coordinates. +typedef struct { + BN_ULONG X[P256_LIMBS]; + BN_ULONG Y[P256_LIMBS]; + BN_ULONG Z[P256_LIMBS]; +} P256_POINT; + +// A P256_POINT_AFFINE represents a P-256 point in affine coordinates. Infinity +// is encoded as (0, 0). +typedef struct { + BN_ULONG X[P256_LIMBS]; + BN_ULONG Y[P256_LIMBS]; +} P256_POINT_AFFINE; + +// ecp_nistz256_select_w5 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 16 +// and all zeros (the point at infinity) if |index| is 0. This is done in +// constant time. +void ecp_nistz256_select_w5(P256_POINT *val, const P256_POINT in_t[16], + int index); + +// ecp_nistz256_select_w7 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 64 +// and all zeros (the point at infinity) if |index| is 0. This is done in +// constant time. +void ecp_nistz256_select_w7(P256_POINT_AFFINE *val, + const P256_POINT_AFFINE in_t[64], int index); + +// ecp_nistz256_point_double sets |r| to |a| doubled. +void ecp_nistz256_point_double(P256_POINT *r, const P256_POINT *a); + +// ecp_nistz256_point_add adds |a| to |b| and places the result in |r|. +void ecp_nistz256_point_add(P256_POINT *r, const P256_POINT *a, + const P256_POINT *b); + +// ecp_nistz256_point_add_affine adds |a| to |b| and places the result in +// |r|. |a| and |b| must not represent the same point unless they are both +// infinity. +void ecp_nistz256_point_add_affine(P256_POINT *r, const P256_POINT *a, + const P256_POINT_AFFINE *b); + +#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) */ + + +#if defined(__cplusplus) +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_EC_P256_X86_64_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back new file mode 100644 index 000000000..5deb81a3f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/p256-x86_64.h.grpc_back @@ -0,0 +1,153 @@ +/* + * Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright (c) 2014, Intel Corporation. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + * + * Originally written by Shay Gueron (1, 2), and Vlad Krasnov (1) + * (1) Intel Corporation, Israel Development Center, Haifa, Israel + * (2) University of Haifa, Israel + * + * Reference: + * S.Gueron and V.Krasnov, "Fast Prime Field Elliptic Curve Cryptography with + * 256 Bit Primes" + */ + +#ifndef OPENSSL_HEADER_EC_P256_X86_64_H +#define OPENSSL_HEADER_EC_P256_X86_64_H + +#include + +#include + +#include "../bn/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) + +// P-256 field operations. +// +// An element mod P in P-256 is represented as a little-endian array of +// |P256_LIMBS| |BN_ULONG|s, spanning the full range of values. +// +// The following functions take fully-reduced inputs mod P and give +// fully-reduced outputs. They may be used in-place. + +#define P256_LIMBS (256 / BN_BITS2) + +// ecp_nistz256_neg sets |res| to -|a| mod P. +void ecp_nistz256_neg(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]); + +// ecp_nistz256_mul_mont sets |res| to |a| * |b| * 2^-256 mod P. +void ecp_nistz256_mul_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG b[P256_LIMBS]); + +// ecp_nistz256_sqr_mont sets |res| to |a| * |a| * 2^-256 mod P. +void ecp_nistz256_sqr_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS]); + +// ecp_nistz256_from_mont sets |res| to |in|, converted from Montgomery domain +// by multiplying with 1. +static inline void ecp_nistz256_from_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG in[P256_LIMBS]) { + static const BN_ULONG ONE[P256_LIMBS] = { 1 }; + ecp_nistz256_mul_mont(res, in, ONE); +} + +// ecp_nistz256_to_mont sets |res| to |in|, converted to Montgomery domain +// by multiplying with RR = 2^512 mod P precomputed for NIST P256 curve. +static inline void ecp_nistz256_to_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG in[P256_LIMBS]) { + static const BN_ULONG RR[P256_LIMBS] = { + TOBN(0x00000000, 0x00000003), TOBN(0xfffffffb, 0xffffffff), + TOBN(0xffffffff, 0xfffffffe), TOBN(0x00000004, 0xfffffffd)}; + ecp_nistz256_mul_mont(res, in, RR); +} + + +// P-256 scalar operations. +// +// The following functions compute modulo N, where N is the order of P-256. They +// take fully-reduced inputs and give fully-reduced outputs. + +// ecp_nistz256_ord_mul_mont sets |res| to |a| * |b| where inputs and outputs +// are in Montgomery form. That is, |res| is |a| * |b| * 2^-256 mod N. +void ecp_nistz256_ord_mul_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG b[P256_LIMBS]); + +// ecp_nistz256_ord_sqr_mont sets |res| to |a|^(2*|rep|) where inputs and +// outputs are in Montgomery form. That is, |res| is +// (|a| * 2^-256)^(2*|rep|) * 2^256 mod N. +void ecp_nistz256_ord_sqr_mont(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], BN_ULONG rep); + +// beeu_mod_inverse_vartime sets out = a^-1 mod p using a Euclidean algorithm. +// Assumption: 0 < a < p < 2^(256) and p is odd. +int beeu_mod_inverse_vartime(BN_ULONG out[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG p[P256_LIMBS]); + + +// P-256 point operations. +// +// The following functions may be used in-place. All coordinates are in the +// Montgomery domain. + +// A P256_POINT represents a P-256 point in Jacobian coordinates. +typedef struct { + BN_ULONG X[P256_LIMBS]; + BN_ULONG Y[P256_LIMBS]; + BN_ULONG Z[P256_LIMBS]; +} P256_POINT; + +// A P256_POINT_AFFINE represents a P-256 point in affine coordinates. Infinity +// is encoded as (0, 0). +typedef struct { + BN_ULONG X[P256_LIMBS]; + BN_ULONG Y[P256_LIMBS]; +} P256_POINT_AFFINE; + +// ecp_nistz256_select_w5 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 16 +// and all zeros (the point at infinity) if |index| is 0. This is done in +// constant time. +void ecp_nistz256_select_w5(P256_POINT *val, const P256_POINT in_t[16], + int index); + +// ecp_nistz256_select_w7 sets |*val| to |in_t[index-1]| if 1 <= |index| <= 64 +// and all zeros (the point at infinity) if |index| is 0. This is done in +// constant time. +void ecp_nistz256_select_w7(P256_POINT_AFFINE *val, + const P256_POINT_AFFINE in_t[64], int index); + +// ecp_nistz256_point_double sets |r| to |a| doubled. +void ecp_nistz256_point_double(P256_POINT *r, const P256_POINT *a); + +// ecp_nistz256_point_add adds |a| to |b| and places the result in |r|. +void ecp_nistz256_point_add(P256_POINT *r, const P256_POINT *a, + const P256_POINT *b); + +// ecp_nistz256_point_add_affine adds |a| to |b| and places the result in +// |r|. |a| and |b| must not represent the same point unless they are both +// infinity. +void ecp_nistz256_point_add_affine(P256_POINT *r, const P256_POINT *a, + const P256_POINT_AFFINE *b); + +#endif /* !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && \ + !defined(OPENSSL_SMALL) */ + + +#if defined(__cplusplus) +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_EC_P256_X86_64_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c new file mode 100644 index 000000000..2caf2f075 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c @@ -0,0 +1,96 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include +#include +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const BIGNUM *in) { + if (!bn_copy_words(out->words, group->order.width, in) || + !bn_less_than_words(out->words, group->order.d, group->order.width)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_SCALAR); + return 0; + } + return 1; +} + +int ec_scalar_equal_vartime(const EC_GROUP *group, const EC_SCALAR *a, + const EC_SCALAR *b) { + return OPENSSL_memcmp(a->words, b->words, + group->order.width * sizeof(BN_ULONG)) == 0; +} + +int ec_scalar_is_zero(const EC_GROUP *group, const EC_SCALAR *a) { + BN_ULONG mask = 0; + for (int i = 0; i < group->order.width; i++) { + mask |= a->words[i]; + } + return mask == 0; +} + +int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, + const uint8_t additional_data[32]) { + return bn_rand_range_words(out->words, 1, group->order.d, group->order.width, + additional_data); +} + +void ec_scalar_add(const EC_GROUP *group, EC_SCALAR *r, const EC_SCALAR *a, + const EC_SCALAR *b) { + const BIGNUM *order = &group->order; + BN_ULONG tmp[EC_MAX_WORDS]; + bn_mod_add_words(r->words, a->words, b->words, order->d, tmp, order->width); + OPENSSL_cleanse(tmp, sizeof(tmp)); +} + +void ec_scalar_to_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + const BIGNUM *order = &group->order; + bn_to_montgomery_small(r->words, a->words, order->width, group->order_mont); +} + +void ec_scalar_from_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + const BIGNUM *order = &group->order; + bn_from_montgomery_small(r->words, a->words, order->width, group->order_mont); +} + +void ec_scalar_mul_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a, const EC_SCALAR *b) { + const BIGNUM *order = &group->order; + bn_mod_mul_montgomery_small(r->words, a->words, b->words, order->width, + group->order_mont); +} + +void ec_simple_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + const BIGNUM *order = &group->order; + bn_mod_inverse_prime_mont_small(r->words, a->words, order->width, + group->order_mont); +} + +void ec_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + group->meth->scalar_inv_montgomery(group, r, a); +} + +int ec_scalar_inv_montgomery_vartime(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + return group->meth->scalar_inv_montgomery_vartime(group, r, a); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c.grpc_back new file mode 100644 index 000000000..82f2a50b9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/scalar.c.grpc_back @@ -0,0 +1,96 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include +#include +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +int ec_bignum_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const BIGNUM *in) { + if (!bn_copy_words(out->words, group->order.width, in) || + !bn_less_than_words(out->words, group->order.d, group->order.width)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_SCALAR); + return 0; + } + return 1; +} + +int ec_scalar_equal_vartime(const EC_GROUP *group, const EC_SCALAR *a, + const EC_SCALAR *b) { + return OPENSSL_memcmp(a->words, b->words, + group->order.width * sizeof(BN_ULONG)) == 0; +} + +int ec_scalar_is_zero(const EC_GROUP *group, const EC_SCALAR *a) { + BN_ULONG mask = 0; + for (int i = 0; i < group->order.width; i++) { + mask |= a->words[i]; + } + return mask == 0; +} + +int ec_random_nonzero_scalar(const EC_GROUP *group, EC_SCALAR *out, + const uint8_t additional_data[32]) { + return bn_rand_range_words(out->words, 1, group->order.d, group->order.width, + additional_data); +} + +void ec_scalar_add(const EC_GROUP *group, EC_SCALAR *r, const EC_SCALAR *a, + const EC_SCALAR *b) { + const BIGNUM *order = &group->order; + BN_ULONG tmp[EC_MAX_WORDS]; + bn_mod_add_words(r->words, a->words, b->words, order->d, tmp, order->width); + OPENSSL_cleanse(tmp, sizeof(tmp)); +} + +void ec_scalar_to_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + const BIGNUM *order = &group->order; + bn_to_montgomery_small(r->words, a->words, order->width, group->order_mont); +} + +void ec_scalar_from_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + const BIGNUM *order = &group->order; + bn_from_montgomery_small(r->words, a->words, order->width, group->order_mont); +} + +void ec_scalar_mul_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a, const EC_SCALAR *b) { + const BIGNUM *order = &group->order; + bn_mod_mul_montgomery_small(r->words, a->words, b->words, order->width, + group->order_mont); +} + +void ec_simple_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + const BIGNUM *order = &group->order; + bn_mod_inverse_prime_mont_small(r->words, a->words, order->width, + group->order_mont); +} + +void ec_scalar_inv_montgomery(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + group->meth->scalar_inv_montgomery(group, r, a); +} + +int ec_scalar_inv_montgomery_vartime(const EC_GROUP *group, EC_SCALAR *r, + const EC_SCALAR *a) { + return group->meth->scalar_inv_montgomery_vartime(group, r, a); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c new file mode 100644 index 000000000..c9110d7e7 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c @@ -0,0 +1,380 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#include + +#include + +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// Most method functions in this file are designed to work with non-trivial +// representations of field elements if necessary (see ecp_mont.c): while +// standard modular addition and subtraction are used, the field_mul and +// field_sqr methods will be used for multiplication, and field_encode and +// field_decode (if defined) will be used for converting between +// representations. +// +// Functions here specifically assume that if a non-trivial representation is +// used, it is a Montgomery representation (i.e. 'encoding' means multiplying +// by some factor R). + +int ec_GFp_simple_group_init(EC_GROUP *group) { + BN_init(&group->field); + group->a_is_minus3 = 0; + return 1; +} + +void ec_GFp_simple_group_finish(EC_GROUP *group) { + BN_free(&group->field); +} + +int ec_GFp_simple_group_set_curve(EC_GROUP *group, const BIGNUM *p, + const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx) { + int ret = 0; + BN_CTX *new_ctx = NULL; + + // p must be a prime > 3 + if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); + return 0; + } + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + } + + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL) { + goto err; + } + + // group->field + if (!BN_copy(&group->field, p)) { + goto err; + } + BN_set_negative(&group->field, 0); + // Store the field in minimal form, so it can be used with |BN_ULONG| arrays. + bn_set_minimal_width(&group->field); + + // group->a + if (!BN_nnmod(tmp, a, &group->field, ctx) || + !ec_bignum_to_felem(group, &group->a, tmp)) { + goto err; + } + + // group->a_is_minus3 + if (!BN_add_word(tmp, 3)) { + goto err; + } + group->a_is_minus3 = (0 == BN_cmp(tmp, &group->field)); + + // group->b + if (!BN_nnmod(tmp, b, &group->field, ctx) || + !ec_bignum_to_felem(group, &group->b, tmp)) { + goto err; + } + + if (!ec_bignum_to_felem(group, &group->one, BN_value_one())) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + return ret; +} + +int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, + BIGNUM *b) { + if ((p != NULL && !BN_copy(p, &group->field)) || + (a != NULL && !ec_felem_to_bignum(group, a, &group->a)) || + (b != NULL && !ec_felem_to_bignum(group, b, &group->b))) { + return 0; + } + return 1; +} + +void ec_GFp_simple_point_init(EC_RAW_POINT *point) { + OPENSSL_memset(&point->X, 0, sizeof(EC_FELEM)); + OPENSSL_memset(&point->Y, 0, sizeof(EC_FELEM)); + OPENSSL_memset(&point->Z, 0, sizeof(EC_FELEM)); +} + +void ec_GFp_simple_point_copy(EC_RAW_POINT *dest, const EC_RAW_POINT *src) { + OPENSSL_memcpy(&dest->X, &src->X, sizeof(EC_FELEM)); + OPENSSL_memcpy(&dest->Y, &src->Y, sizeof(EC_FELEM)); + OPENSSL_memcpy(&dest->Z, &src->Z, sizeof(EC_FELEM)); +} + +void ec_GFp_simple_point_set_to_infinity(const EC_GROUP *group, + EC_RAW_POINT *point) { + // Although it is strictly only necessary to zero Z, we zero the entire point + // in case |point| was stack-allocated and yet to be initialized. + ec_GFp_simple_point_init(point); +} + +int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, + EC_RAW_POINT *point, + const BIGNUM *x, + const BIGNUM *y) { + if (x == NULL || y == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (!ec_bignum_to_felem(group, &point->X, x) || + !ec_bignum_to_felem(group, &point->Y, y)) { + return 0; + } + OPENSSL_memcpy(&point->Z, &group->one, sizeof(EC_FELEM)); + + return 1; +} + +void ec_GFp_simple_invert(const EC_GROUP *group, EC_RAW_POINT *point) { + ec_felem_neg(group, &point->Y, &point->Y); +} + +int ec_GFp_simple_is_at_infinity(const EC_GROUP *group, + const EC_RAW_POINT *point) { + return ec_felem_non_zero_mask(group, &point->Z) == 0; +} + +int ec_GFp_simple_is_on_curve(const EC_GROUP *group, + const EC_RAW_POINT *point) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + return 1; + } + + // We have a curve defined by a Weierstrass equation + // y^2 = x^3 + a*x + b. + // The point to consider is given in Jacobian projective coordinates + // where (X, Y, Z) represents (x, y) = (X/Z^2, Y/Z^3). + // Substituting this and multiplying by Z^6 transforms the above equation + // into + // Y^2 = X^3 + a*X*Z^4 + b*Z^6. + // To test this, we add up the right-hand side in 'rh'. + + void (*const felem_mul)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b) = group->meth->felem_mul; + void (*const felem_sqr)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a) = + group->meth->felem_sqr; + + // rh := X^2 + EC_FELEM rh; + felem_sqr(group, &rh, &point->X); + + EC_FELEM tmp, Z4, Z6; + if (!ec_felem_equal(group, &point->Z, &group->one)) { + felem_sqr(group, &tmp, &point->Z); + felem_sqr(group, &Z4, &tmp); + felem_mul(group, &Z6, &Z4, &tmp); + + // rh := (rh + a*Z^4)*X + if (group->a_is_minus3) { + ec_felem_add(group, &tmp, &Z4, &Z4); + ec_felem_add(group, &tmp, &tmp, &Z4); + ec_felem_sub(group, &rh, &rh, &tmp); + felem_mul(group, &rh, &rh, &point->X); + } else { + felem_mul(group, &tmp, &Z4, &group->a); + ec_felem_add(group, &rh, &rh, &tmp); + felem_mul(group, &rh, &rh, &point->X); + } + + // rh := rh + b*Z^6 + felem_mul(group, &tmp, &group->b, &Z6); + ec_felem_add(group, &rh, &rh, &tmp); + } else { + // rh := (rh + a)*X + ec_felem_add(group, &rh, &rh, &group->a); + felem_mul(group, &rh, &rh, &point->X); + // rh := rh + b + ec_felem_add(group, &rh, &rh, &group->b); + } + + // 'lh' := Y^2 + felem_sqr(group, &tmp, &point->Y); + return ec_felem_equal(group, &tmp, &rh); +} + +int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_RAW_POINT *a, + const EC_RAW_POINT *b) { + // Note this function returns zero if |a| and |b| are equal and 1 if they are + // not equal. + if (ec_GFp_simple_is_at_infinity(group, a)) { + return ec_GFp_simple_is_at_infinity(group, b) ? 0 : 1; + } + + if (ec_GFp_simple_is_at_infinity(group, b)) { + return 1; + } + + int a_Z_is_one = ec_felem_equal(group, &a->Z, &group->one); + int b_Z_is_one = ec_felem_equal(group, &b->Z, &group->one); + + if (a_Z_is_one && b_Z_is_one) { + return !ec_felem_equal(group, &a->X, &b->X) || + !ec_felem_equal(group, &a->Y, &b->Y); + } + + void (*const felem_mul)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b) = group->meth->felem_mul; + void (*const felem_sqr)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a) = + group->meth->felem_sqr; + + // We have to decide whether + // (X_a/Z_a^2, Y_a/Z_a^3) = (X_b/Z_b^2, Y_b/Z_b^3), + // or equivalently, whether + // (X_a*Z_b^2, Y_a*Z_b^3) = (X_b*Z_a^2, Y_b*Z_a^3). + + EC_FELEM tmp1, tmp2, Za23, Zb23; + const EC_FELEM *tmp1_, *tmp2_; + if (!b_Z_is_one) { + felem_sqr(group, &Zb23, &b->Z); + felem_mul(group, &tmp1, &a->X, &Zb23); + tmp1_ = &tmp1; + } else { + tmp1_ = &a->X; + } + if (!a_Z_is_one) { + felem_sqr(group, &Za23, &a->Z); + felem_mul(group, &tmp2, &b->X, &Za23); + tmp2_ = &tmp2; + } else { + tmp2_ = &b->X; + } + + // Compare X_a*Z_b^2 with X_b*Z_a^2. + if (!ec_felem_equal(group, tmp1_, tmp2_)) { + return 1; // The points differ. + } + + if (!b_Z_is_one) { + felem_mul(group, &Zb23, &Zb23, &b->Z); + felem_mul(group, &tmp1, &a->Y, &Zb23); + // tmp1_ = &tmp1 + } else { + tmp1_ = &a->Y; + } + if (!a_Z_is_one) { + felem_mul(group, &Za23, &Za23, &a->Z); + felem_mul(group, &tmp2, &b->Y, &Za23); + // tmp2_ = &tmp2 + } else { + tmp2_ = &b->Y; + } + + // Compare Y_a*Z_b^3 with Y_b*Z_a^3. + if (!ec_felem_equal(group, tmp1_, tmp2_)) { + return 1; // The points differ. + } + + // The points are equal. + return 0; +} + +int ec_GFp_simple_mont_inv_mod_ord_vartime(const EC_GROUP *group, + EC_SCALAR *out, + const EC_SCALAR *in) { + // This implementation (in fact) runs in constant time, + // even though for this interface it is not mandatory. + + // out = in^-1 in the Montgomery domain. This is + // |ec_scalar_to_montgomery| followed by |ec_scalar_inv_montgomery|, but + // |ec_scalar_inv_montgomery| followed by |ec_scalar_from_montgomery| is + // equivalent and slightly more efficient. + ec_scalar_inv_montgomery(group, out, in); + ec_scalar_from_montgomery(group, out, out); + return 1; +} + +int ec_GFp_simple_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (ec_GFp_simple_is_at_infinity(group, p)) { + // |ec_get_x_coordinate_as_scalar| will check this internally, but this way + // we do not push to the error queue. + return 0; + } + + EC_SCALAR x; + return ec_get_x_coordinate_as_scalar(group, &x, p) && + ec_scalar_equal_vartime(group, &x, r); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c.grpc_back new file mode 100644 index 000000000..c418c4e3e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple.c.grpc_back @@ -0,0 +1,380 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#include + +#include + +#include +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// Most method functions in this file are designed to work with non-trivial +// representations of field elements if necessary (see ecp_mont.c): while +// standard modular addition and subtraction are used, the field_mul and +// field_sqr methods will be used for multiplication, and field_encode and +// field_decode (if defined) will be used for converting between +// representations. +// +// Functions here specifically assume that if a non-trivial representation is +// used, it is a Montgomery representation (i.e. 'encoding' means multiplying +// by some factor R). + +int ec_GFp_simple_group_init(EC_GROUP *group) { + BN_init(&group->field); + group->a_is_minus3 = 0; + return 1; +} + +void ec_GFp_simple_group_finish(EC_GROUP *group) { + BN_free(&group->field); +} + +int ec_GFp_simple_group_set_curve(EC_GROUP *group, const BIGNUM *p, + const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx) { + int ret = 0; + BN_CTX *new_ctx = NULL; + + // p must be a prime > 3 + if (BN_num_bits(p) <= 2 || !BN_is_odd(p)) { + OPENSSL_PUT_ERROR(EC, EC_R_INVALID_FIELD); + return 0; + } + + if (ctx == NULL) { + ctx = new_ctx = BN_CTX_new(); + if (ctx == NULL) { + return 0; + } + } + + BN_CTX_start(ctx); + BIGNUM *tmp = BN_CTX_get(ctx); + if (tmp == NULL) { + goto err; + } + + // group->field + if (!BN_copy(&group->field, p)) { + goto err; + } + BN_set_negative(&group->field, 0); + // Store the field in minimal form, so it can be used with |BN_ULONG| arrays. + bn_set_minimal_width(&group->field); + + // group->a + if (!BN_nnmod(tmp, a, &group->field, ctx) || + !ec_bignum_to_felem(group, &group->a, tmp)) { + goto err; + } + + // group->a_is_minus3 + if (!BN_add_word(tmp, 3)) { + goto err; + } + group->a_is_minus3 = (0 == BN_cmp(tmp, &group->field)); + + // group->b + if (!BN_nnmod(tmp, b, &group->field, ctx) || + !ec_bignum_to_felem(group, &group->b, tmp)) { + goto err; + } + + if (!ec_bignum_to_felem(group, &group->one, BN_value_one())) { + goto err; + } + + ret = 1; + +err: + BN_CTX_end(ctx); + BN_CTX_free(new_ctx); + return ret; +} + +int ec_GFp_simple_group_get_curve(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, + BIGNUM *b) { + if ((p != NULL && !BN_copy(p, &group->field)) || + (a != NULL && !ec_felem_to_bignum(group, a, &group->a)) || + (b != NULL && !ec_felem_to_bignum(group, b, &group->b))) { + return 0; + } + return 1; +} + +void ec_GFp_simple_point_init(EC_RAW_POINT *point) { + OPENSSL_memset(&point->X, 0, sizeof(EC_FELEM)); + OPENSSL_memset(&point->Y, 0, sizeof(EC_FELEM)); + OPENSSL_memset(&point->Z, 0, sizeof(EC_FELEM)); +} + +void ec_GFp_simple_point_copy(EC_RAW_POINT *dest, const EC_RAW_POINT *src) { + OPENSSL_memcpy(&dest->X, &src->X, sizeof(EC_FELEM)); + OPENSSL_memcpy(&dest->Y, &src->Y, sizeof(EC_FELEM)); + OPENSSL_memcpy(&dest->Z, &src->Z, sizeof(EC_FELEM)); +} + +void ec_GFp_simple_point_set_to_infinity(const EC_GROUP *group, + EC_RAW_POINT *point) { + // Although it is strictly only necessary to zero Z, we zero the entire point + // in case |point| was stack-allocated and yet to be initialized. + ec_GFp_simple_point_init(point); +} + +int ec_GFp_simple_point_set_affine_coordinates(const EC_GROUP *group, + EC_RAW_POINT *point, + const BIGNUM *x, + const BIGNUM *y) { + if (x == NULL || y == NULL) { + OPENSSL_PUT_ERROR(EC, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (!ec_bignum_to_felem(group, &point->X, x) || + !ec_bignum_to_felem(group, &point->Y, y)) { + return 0; + } + OPENSSL_memcpy(&point->Z, &group->one, sizeof(EC_FELEM)); + + return 1; +} + +void ec_GFp_simple_invert(const EC_GROUP *group, EC_RAW_POINT *point) { + ec_felem_neg(group, &point->Y, &point->Y); +} + +int ec_GFp_simple_is_at_infinity(const EC_GROUP *group, + const EC_RAW_POINT *point) { + return ec_felem_non_zero_mask(group, &point->Z) == 0; +} + +int ec_GFp_simple_is_on_curve(const EC_GROUP *group, + const EC_RAW_POINT *point) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + return 1; + } + + // We have a curve defined by a Weierstrass equation + // y^2 = x^3 + a*x + b. + // The point to consider is given in Jacobian projective coordinates + // where (X, Y, Z) represents (x, y) = (X/Z^2, Y/Z^3). + // Substituting this and multiplying by Z^6 transforms the above equation + // into + // Y^2 = X^3 + a*X*Z^4 + b*Z^6. + // To test this, we add up the right-hand side in 'rh'. + + void (*const felem_mul)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b) = group->meth->felem_mul; + void (*const felem_sqr)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a) = + group->meth->felem_sqr; + + // rh := X^2 + EC_FELEM rh; + felem_sqr(group, &rh, &point->X); + + EC_FELEM tmp, Z4, Z6; + if (!ec_felem_equal(group, &point->Z, &group->one)) { + felem_sqr(group, &tmp, &point->Z); + felem_sqr(group, &Z4, &tmp); + felem_mul(group, &Z6, &Z4, &tmp); + + // rh := (rh + a*Z^4)*X + if (group->a_is_minus3) { + ec_felem_add(group, &tmp, &Z4, &Z4); + ec_felem_add(group, &tmp, &tmp, &Z4); + ec_felem_sub(group, &rh, &rh, &tmp); + felem_mul(group, &rh, &rh, &point->X); + } else { + felem_mul(group, &tmp, &Z4, &group->a); + ec_felem_add(group, &rh, &rh, &tmp); + felem_mul(group, &rh, &rh, &point->X); + } + + // rh := rh + b*Z^6 + felem_mul(group, &tmp, &group->b, &Z6); + ec_felem_add(group, &rh, &rh, &tmp); + } else { + // rh := (rh + a)*X + ec_felem_add(group, &rh, &rh, &group->a); + felem_mul(group, &rh, &rh, &point->X); + // rh := rh + b + ec_felem_add(group, &rh, &rh, &group->b); + } + + // 'lh' := Y^2 + felem_sqr(group, &tmp, &point->Y); + return ec_felem_equal(group, &tmp, &rh); +} + +int ec_GFp_simple_cmp(const EC_GROUP *group, const EC_RAW_POINT *a, + const EC_RAW_POINT *b) { + // Note this function returns zero if |a| and |b| are equal and 1 if they are + // not equal. + if (ec_GFp_simple_is_at_infinity(group, a)) { + return ec_GFp_simple_is_at_infinity(group, b) ? 0 : 1; + } + + if (ec_GFp_simple_is_at_infinity(group, b)) { + return 1; + } + + int a_Z_is_one = ec_felem_equal(group, &a->Z, &group->one); + int b_Z_is_one = ec_felem_equal(group, &b->Z, &group->one); + + if (a_Z_is_one && b_Z_is_one) { + return !ec_felem_equal(group, &a->X, &b->X) || + !ec_felem_equal(group, &a->Y, &b->Y); + } + + void (*const felem_mul)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a, + const EC_FELEM *b) = group->meth->felem_mul; + void (*const felem_sqr)(const EC_GROUP *, EC_FELEM *r, const EC_FELEM *a) = + group->meth->felem_sqr; + + // We have to decide whether + // (X_a/Z_a^2, Y_a/Z_a^3) = (X_b/Z_b^2, Y_b/Z_b^3), + // or equivalently, whether + // (X_a*Z_b^2, Y_a*Z_b^3) = (X_b*Z_a^2, Y_b*Z_a^3). + + EC_FELEM tmp1, tmp2, Za23, Zb23; + const EC_FELEM *tmp1_, *tmp2_; + if (!b_Z_is_one) { + felem_sqr(group, &Zb23, &b->Z); + felem_mul(group, &tmp1, &a->X, &Zb23); + tmp1_ = &tmp1; + } else { + tmp1_ = &a->X; + } + if (!a_Z_is_one) { + felem_sqr(group, &Za23, &a->Z); + felem_mul(group, &tmp2, &b->X, &Za23); + tmp2_ = &tmp2; + } else { + tmp2_ = &b->X; + } + + // Compare X_a*Z_b^2 with X_b*Z_a^2. + if (!ec_felem_equal(group, tmp1_, tmp2_)) { + return 1; // The points differ. + } + + if (!b_Z_is_one) { + felem_mul(group, &Zb23, &Zb23, &b->Z); + felem_mul(group, &tmp1, &a->Y, &Zb23); + // tmp1_ = &tmp1 + } else { + tmp1_ = &a->Y; + } + if (!a_Z_is_one) { + felem_mul(group, &Za23, &Za23, &a->Z); + felem_mul(group, &tmp2, &b->Y, &Za23); + // tmp2_ = &tmp2 + } else { + tmp2_ = &b->Y; + } + + // Compare Y_a*Z_b^3 with Y_b*Z_a^3. + if (!ec_felem_equal(group, tmp1_, tmp2_)) { + return 1; // The points differ. + } + + // The points are equal. + return 0; +} + +int ec_GFp_simple_mont_inv_mod_ord_vartime(const EC_GROUP *group, + EC_SCALAR *out, + const EC_SCALAR *in) { + // This implementation (in fact) runs in constant time, + // even though for this interface it is not mandatory. + + // out = in^-1 in the Montgomery domain. This is + // |ec_scalar_to_montgomery| followed by |ec_scalar_inv_montgomery|, but + // |ec_scalar_inv_montgomery| followed by |ec_scalar_from_montgomery| is + // equivalent and slightly more efficient. + ec_scalar_inv_montgomery(group, out, in); + ec_scalar_from_montgomery(group, out, out); + return 1; +} + +int ec_GFp_simple_cmp_x_coordinate(const EC_GROUP *group, const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (ec_GFp_simple_is_at_infinity(group, p)) { + // |ec_get_x_coordinate_as_scalar| will check this internally, but this way + // we do not push to the error queue. + return 0; + } + + EC_SCALAR x; + return ec_get_x_coordinate_as_scalar(group, &x, p) && + ec_scalar_equal_vartime(group, &x, r); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c new file mode 100644 index 000000000..ab043f409 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c @@ -0,0 +1,84 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +void ec_GFp_mont_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar) { + // This is a generic implementation for uncommon curves that not do not + // warrant a tuned one. It uses unsigned digits so that the doubling case in + // |ec_GFp_mont_add| is always unreachable, erring on safety and simplicity. + + // Compute a table of the first 32 multiples of |p| (including infinity). + EC_RAW_POINT precomp[32]; + ec_GFp_simple_point_set_to_infinity(group, &precomp[0]); + ec_GFp_simple_point_copy(&precomp[1], p); + for (size_t j = 2; j < OPENSSL_ARRAY_SIZE(precomp); j++) { + if (j & 1) { + ec_GFp_mont_add(group, &precomp[j], &precomp[1], &precomp[j - 1]); + } else { + ec_GFp_mont_dbl(group, &precomp[j], &precomp[j / 2]); + } + } + + // Divide bits in |scalar| into windows. + unsigned bits = BN_num_bits(&group->order); + int r_is_at_infinity = 1; + for (unsigned i = bits - 1; i < bits; i--) { + if (!r_is_at_infinity) { + ec_GFp_mont_dbl(group, r, r); + } + if (i % 5 == 0) { + // Compute the next window value. + const size_t width = group->order.width; + uint8_t window = bn_is_bit_set_words(scalar->words, width, i + 4) << 4; + window |= bn_is_bit_set_words(scalar->words, width, i + 3) << 3; + window |= bn_is_bit_set_words(scalar->words, width, i + 2) << 2; + window |= bn_is_bit_set_words(scalar->words, width, i + 1) << 1; + window |= bn_is_bit_set_words(scalar->words, width, i); + + // Select the entry in constant-time. + EC_RAW_POINT tmp; + OPENSSL_memset(&tmp, 0, sizeof(EC_RAW_POINT)); + for (size_t j = 0; j < OPENSSL_ARRAY_SIZE(precomp); j++) { + BN_ULONG mask = constant_time_eq_w(j, window); + ec_felem_select(group, &tmp.X, mask, &precomp[j].X, &tmp.X); + ec_felem_select(group, &tmp.Y, mask, &precomp[j].Y, &tmp.Y); + ec_felem_select(group, &tmp.Z, mask, &precomp[j].Z, &tmp.Z); + } + + if (r_is_at_infinity) { + ec_GFp_simple_point_copy(r, &tmp); + r_is_at_infinity = 0; + } else { + ec_GFp_mont_add(group, r, r, &tmp); + } + } + } + if (r_is_at_infinity) { + ec_GFp_simple_point_set_to_infinity(group, r); + } +} + +void ec_GFp_mont_mul_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + ec_GFp_mont_mul(group, r, &group->generator->raw, scalar); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c.grpc_back new file mode 100644 index 000000000..4ed6c48c5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/simple_mul.c.grpc_back @@ -0,0 +1,84 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +void ec_GFp_mont_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, const EC_SCALAR *scalar) { + // This is a generic implementation for uncommon curves that not do not + // warrant a tuned one. It uses unsigned digits so that the doubling case in + // |ec_GFp_mont_add| is always unreachable, erring on safety and simplicity. + + // Compute a table of the first 32 multiples of |p| (including infinity). + EC_RAW_POINT precomp[32]; + ec_GFp_simple_point_set_to_infinity(group, &precomp[0]); + ec_GFp_simple_point_copy(&precomp[1], p); + for (size_t j = 2; j < OPENSSL_ARRAY_SIZE(precomp); j++) { + if (j & 1) { + ec_GFp_mont_add(group, &precomp[j], &precomp[1], &precomp[j - 1]); + } else { + ec_GFp_mont_dbl(group, &precomp[j], &precomp[j / 2]); + } + } + + // Divide bits in |scalar| into windows. + unsigned bits = BN_num_bits(&group->order); + int r_is_at_infinity = 1; + for (unsigned i = bits - 1; i < bits; i--) { + if (!r_is_at_infinity) { + ec_GFp_mont_dbl(group, r, r); + } + if (i % 5 == 0) { + // Compute the next window value. + const size_t width = group->order.width; + uint8_t window = bn_is_bit_set_words(scalar->words, width, i + 4) << 4; + window |= bn_is_bit_set_words(scalar->words, width, i + 3) << 3; + window |= bn_is_bit_set_words(scalar->words, width, i + 2) << 2; + window |= bn_is_bit_set_words(scalar->words, width, i + 1) << 1; + window |= bn_is_bit_set_words(scalar->words, width, i); + + // Select the entry in constant-time. + EC_RAW_POINT tmp; + OPENSSL_memset(&tmp, 0, sizeof(EC_RAW_POINT)); + for (size_t j = 0; j < OPENSSL_ARRAY_SIZE(precomp); j++) { + BN_ULONG mask = constant_time_eq_w(j, window); + ec_felem_select(group, &tmp.X, mask, &precomp[j].X, &tmp.X); + ec_felem_select(group, &tmp.Y, mask, &precomp[j].Y, &tmp.Y); + ec_felem_select(group, &tmp.Z, mask, &precomp[j].Z, &tmp.Z); + } + + if (r_is_at_infinity) { + ec_GFp_simple_point_copy(r, &tmp); + r_is_at_infinity = 0; + } else { + ec_GFp_mont_add(group, r, r, &tmp); + } + } + } + if (r_is_at_infinity) { + ec_GFp_simple_point_set_to_infinity(group, r); + } +} + +void ec_GFp_mont_mul_base(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + ec_GFp_mont_mul(group, r, &group->generator->raw, scalar); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c new file mode 100644 index 000000000..47e6482ec --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c @@ -0,0 +1,255 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" + + +// This function looks at 5+1 scalar bits (5 current, 1 adjacent less +// significant bit), and recodes them into a signed digit for use in fast point +// multiplication: the use of signed rather than unsigned digits means that +// fewer points need to be precomputed, given that point inversion is easy (a +// precomputed point dP makes -dP available as well). +// +// BACKGROUND: +// +// Signed digits for multiplication were introduced by Booth ("A signed binary +// multiplication technique", Quart. Journ. Mech. and Applied Math., vol. IV, +// pt. 2 (1951), pp. 236-240), in that case for multiplication of integers. +// Booth's original encoding did not generally improve the density of nonzero +// digits over the binary representation, and was merely meant to simplify the +// handling of signed factors given in two's complement; but it has since been +// shown to be the basis of various signed-digit representations that do have +// further advantages, including the wNAF, using the following general +// approach: +// +// (1) Given a binary representation +// +// b_k ... b_2 b_1 b_0, +// +// of a nonnegative integer (b_k in {0, 1}), rewrite it in digits 0, 1, -1 +// by using bit-wise subtraction as follows: +// +// b_k b_(k-1) ... b_2 b_1 b_0 +// - b_k ... b_3 b_2 b_1 b_0 +// ----------------------------------------- +// s_(k+1) s_k ... s_3 s_2 s_1 s_0 +// +// A left-shift followed by subtraction of the original value yields a new +// representation of the same value, using signed bits s_i = b_(i-1) - b_i. +// This representation from Booth's paper has since appeared in the +// literature under a variety of different names including "reversed binary +// form", "alternating greedy expansion", "mutual opposite form", and +// "sign-alternating {+-1}-representation". +// +// An interesting property is that among the nonzero bits, values 1 and -1 +// strictly alternate. +// +// (2) Various window schemes can be applied to the Booth representation of +// integers: for example, right-to-left sliding windows yield the wNAF +// (a signed-digit encoding independently discovered by various researchers +// in the 1990s), and left-to-right sliding windows yield a left-to-right +// equivalent of the wNAF (independently discovered by various researchers +// around 2004). +// +// To prevent leaking information through side channels in point multiplication, +// we need to recode the given integer into a regular pattern: sliding windows +// as in wNAFs won't do, we need their fixed-window equivalent -- which is a few +// decades older: we'll be using the so-called "modified Booth encoding" due to +// MacSorley ("High-speed arithmetic in binary computers", Proc. IRE, vol. 49 +// (1961), pp. 67-91), in a radix-2^5 setting. That is, we always combine five +// signed bits into a signed digit: +// +// s_(5j + 4) s_(5j + 3) s_(5j + 2) s_(5j + 1) s_(5j) +// +// The sign-alternating property implies that the resulting digit values are +// integers from -16 to 16. +// +// Of course, we don't actually need to compute the signed digits s_i as an +// intermediate step (that's just a nice way to see how this scheme relates +// to the wNAF): a direct computation obtains the recoded digit from the +// six bits b_(5j + 4) ... b_(5j - 1). +// +// This function takes those six bits as an integer (0 .. 63), writing the +// recoded digit to *sign (0 for positive, 1 for negative) and *digit (absolute +// value, in the range 0 .. 16). Note that this integer essentially provides +// the input bits "shifted to the left" by one position: for example, the input +// to compute the least significant recoded digit, given that there's no bit +// b_-1, has to be b_4 b_3 b_2 b_1 b_0 0. +// +// DOUBLING CASE: +// +// Point addition formulas for short Weierstrass curves are often incomplete. +// Edge cases such as P + P or P + ∞ must be handled separately. This +// complicates constant-time requirements. P + ∞ cannot be avoided (any window +// may be zero) and is handled with constant-time selects. P + P (where P is not +// ∞) usually is not. Instead, windowing strategies are chosen to avoid this +// case. Whether this happens depends on the group order. +// +// Let w be the window width (in this function, w = 5). The non-trivial doubling +// case in single-point scalar multiplication may occur if and only if the +// 2^(w-1) bit of the group order is zero. +// +// Note the above only holds if the scalar is fully reduced and the group order +// is a prime that is much larger than 2^w. It also only holds when windows +// are applied from most significant to least significant, doubling between each +// window. It does not apply to more complex table strategies such as +// |EC_GFp_nistz256_method|. +// +// PROOF: +// +// Let n be the group order. Let l be the number of bits needed to represent n. +// Assume there exists some 0 <= k < n such that signed w-bit windowed +// multiplication hits the doubling case. +// +// Windowed multiplication consists of iterating over groups of s_i (defined +// above based on k's binary representation) from most to least significant. At +// iteration i (for i = ..., 3w, 2w, w, 0, starting from the most significant +// window), we: +// +// 1. Double the accumulator A, w times. Let A_i be the value of A at this +// point. +// +// 2. Set A to T_i + A_i, where T_i is a precomputed multiple of P +// corresponding to the window s_(i+w-1) ... s_i. +// +// Let j be the index such that A_j = T_j ≠ ∞. Looking at A_i and T_i as +// multiples of P, define a_i and t_i to be scalar coefficients of A_i and T_i. +// Thus a_j = t_j ≠ 0 (mod n). Note a_i and t_i may not be reduced mod n. t_i is +// the value of the w signed bits s_(i+w-1) ... s_i. a_i is computed as a_i = +// 2^w * (a_(i+w) + t_(i+w)). +// +// t_i is bounded by -2^(w-1) <= t_i <= 2^(w-1). Additionally, we may write it +// in terms of unsigned bits b_i. t_i consists of signed bits s_(i+w-1) ... s_i. +// This is computed as: +// +// b_(i+w-2) b_(i+w-3) ... b_i b_(i-1) +// - b_(i+w-1) b_(i+w-2) ... b_(i+1) b_i +// -------------------------------------------- +// t_i = s_(i+w-1) s_(i+w-2) ... s_(i+1) s_i +// +// Observe that b_(i+w-2) through b_i occur in both terms. Let x be the integer +// represented by that bit string, i.e. 2^(w-2)*b_(i+w-2) + ... + b_i. +// +// t_i = (2*x + b_(i-1)) - (2^(w-1)*b_(i+w-1) + x) +// = x - 2^(w-1)*b_(i+w-1) + b_(i-1) +// +// Or, using C notation for bit operations: +// +// t_i = (k>>i) & ((1<<(w-1)) - 1) - (k>>i) & (1<<(w-1)) + (k>>(i-1)) & 1 +// +// Note b_(i-1) is added in left-shifted by one (or doubled) from its place. +// This is compensated by t_(i-w)'s subtraction term. Thus, a_i may be computed +// by adding b_l b_(l-1) ... b_(i+1) b_i and an extra copy of b_(i-1). In C +// notation, this is: +// +// a_i = (k>>(i+w)) << w + ((k>>(i+w-1)) & 1) << w +// +// Observe that, while t_i may be positive or negative, a_i is bounded by +// 0 <= a_i < n + 2^w. Additionally, a_i can only be zero if b_(i+w-1) and up +// are all zero. (Note this implies a non-trivial P + (-P) is unreachable for +// all groups. That would imply the subsequent a_i is zero, which means all +// terms thus far were zero.) +// +// Returning to our doubling position, we have a_j = t_j (mod n). We now +// determine the value of a_j - t_j, which must be divisible by n. Our bounds on +// a_j and t_j imply a_j - t_j is 0 or n. If it is 0, a_j = t_j. However, 2^w +// divides a_j and -2^(w-1) <= t_j <= 2^(w-1), so this can only happen if +// a_j = t_j = 0, which is a trivial doubling. Therefore, a_j - t_j = n. +// +// Now we determine j. Suppose j > 0. w divides j, so j >= w. Then, +// +// n = a_j - t_j = (k>>(j+w)) << w + ((k>>(j+w-1)) & 1) << w - t_j +// <= k/2^j + 2^w - t_j +// < n/2^w + 2^w + 2^(w-1) +// +// n is much larger than 2^w, so this is impossible. Thus, j = 0: only the final +// addition may hit the doubling case. +// +// Finally, we consider bit patterns for n and k. Divide k into k_H + k_M + k_L +// such that k_H is the contribution from b_(l-1) .. b_w, k_M is the +// contribution from b_(w-1), and k_L is the contribution from b_(w-2) ... b_0. +// That is: +// +// - 2^w divides k_H +// - k_M is 0 or 2^(w-1) +// - 0 <= k_L < 2^(w-1) +// +// Divide n into n_H + n_M + n_L similarly. We thus have: +// +// t_0 = (k>>0) & ((1<<(w-1)) - 1) - (k>>0) & (1<<(w-1)) + (k>>(0-1)) & 1 +// = k & ((1<<(w-1)) - 1) - k & (1<<(w-1)) +// = k_L - k_M +// +// a_0 = (k>>(0+w)) << w + ((k>>(0+w-1)) & 1) << w +// = (k>>w) << w + ((k>>(w-1)) & 1) << w +// = k_H + 2*k_M +// +// n = a_0 - t_0 +// n_H + n_M + n_L = (k_H + 2*k_M) - (k_L - k_M) +// = k_H + 3*k_M - k_L +// +// k_H - k_L < k and k < n, so k_H - k_L ≠ n. Therefore k_M is not 0 and must be +// 2^(w-1). Now we consider k_H and n_H. We know k_H <= n_H. Suppose k_H = n_H. +// Then, +// +// n_M + n_L = 3*(2^(w-1)) - k_L +// > 3*(2^(w-1)) - 2^(w-1) +// = 2^w +// +// Contradiction (n_M + n_L is the bottom w bits of n). Thus k_H < n_H. Suppose +// k_H < n_H - 2*2^w. Then, +// +// n_H + n_M + n_L = k_H + 3*(2^(w-1)) - k_L +// < n_H - 2*2^w + 3*(2^(w-1)) - k_L +// n_M + n_L < -2^(w-1) - k_L +// +// Contradiction. Thus, k_H = n_H - 2^w. (Note 2^w divides n_H and k_H.) Thus, +// +// n_H + n_M + n_L = k_H + 3*(2^(w-1)) - k_L +// = n_H - 2^w + 3*(2^(w-1)) - k_L +// n_M + n_L = 2^(w-1) - k_L +// <= 2^(w-1) +// +// Equality would mean 2^(w-1) divides n, which is impossible if n is prime. +// Thus n_M + n_L < 2^(w-1), so n_M is zero, proving our condition. +// +// This proof constructs k, so, to show the converse, let k_H = n_H - 2^w, +// k_M = 2^(w-1), k_L = 2^(w-1) - n_L. This will result in a non-trivial point +// doubling in the final addition and is the only such scalar. +// +// COMMON CURVES: +// +// The group orders for common curves end in the following bit patterns: +// +// P-521: ...00001001; w = 4 is okay +// P-384: ...01110011; w = 2, 5, 6, 7 are okay +// P-256: ...01010001; w = 5, 7 are okay +// P-224: ...00111101; w = 3, 4, 5, 6 are okay +void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, + uint8_t in) { + uint8_t s, d; + + s = ~((in >> 5) - 1); /* sets all bits to MSB(in), 'in' seen as + * 6-bit value */ + d = (1 << 6) - in - 1; + d = (d & s) | (in & ~s); + d = (d >> 1) + (d & 1); + + *sign = s & 1; + *digit = d; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c.grpc_back new file mode 100644 index 000000000..4f39f18bf --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/util.c.grpc_back @@ -0,0 +1,255 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" + + +// This function looks at 5+1 scalar bits (5 current, 1 adjacent less +// significant bit), and recodes them into a signed digit for use in fast point +// multiplication: the use of signed rather than unsigned digits means that +// fewer points need to be precomputed, given that point inversion is easy (a +// precomputed point dP makes -dP available as well). +// +// BACKGROUND: +// +// Signed digits for multiplication were introduced by Booth ("A signed binary +// multiplication technique", Quart. Journ. Mech. and Applied Math., vol. IV, +// pt. 2 (1951), pp. 236-240), in that case for multiplication of integers. +// Booth's original encoding did not generally improve the density of nonzero +// digits over the binary representation, and was merely meant to simplify the +// handling of signed factors given in two's complement; but it has since been +// shown to be the basis of various signed-digit representations that do have +// further advantages, including the wNAF, using the following general +// approach: +// +// (1) Given a binary representation +// +// b_k ... b_2 b_1 b_0, +// +// of a nonnegative integer (b_k in {0, 1}), rewrite it in digits 0, 1, -1 +// by using bit-wise subtraction as follows: +// +// b_k b_(k-1) ... b_2 b_1 b_0 +// - b_k ... b_3 b_2 b_1 b_0 +// ----------------------------------------- +// s_(k+1) s_k ... s_3 s_2 s_1 s_0 +// +// A left-shift followed by subtraction of the original value yields a new +// representation of the same value, using signed bits s_i = b_(i-1) - b_i. +// This representation from Booth's paper has since appeared in the +// literature under a variety of different names including "reversed binary +// form", "alternating greedy expansion", "mutual opposite form", and +// "sign-alternating {+-1}-representation". +// +// An interesting property is that among the nonzero bits, values 1 and -1 +// strictly alternate. +// +// (2) Various window schemes can be applied to the Booth representation of +// integers: for example, right-to-left sliding windows yield the wNAF +// (a signed-digit encoding independently discovered by various researchers +// in the 1990s), and left-to-right sliding windows yield a left-to-right +// equivalent of the wNAF (independently discovered by various researchers +// around 2004). +// +// To prevent leaking information through side channels in point multiplication, +// we need to recode the given integer into a regular pattern: sliding windows +// as in wNAFs won't do, we need their fixed-window equivalent -- which is a few +// decades older: we'll be using the so-called "modified Booth encoding" due to +// MacSorley ("High-speed arithmetic in binary computers", Proc. IRE, vol. 49 +// (1961), pp. 67-91), in a radix-2^5 setting. That is, we always combine five +// signed bits into a signed digit: +// +// s_(5j + 4) s_(5j + 3) s_(5j + 2) s_(5j + 1) s_(5j) +// +// The sign-alternating property implies that the resulting digit values are +// integers from -16 to 16. +// +// Of course, we don't actually need to compute the signed digits s_i as an +// intermediate step (that's just a nice way to see how this scheme relates +// to the wNAF): a direct computation obtains the recoded digit from the +// six bits b_(5j + 4) ... b_(5j - 1). +// +// This function takes those six bits as an integer (0 .. 63), writing the +// recoded digit to *sign (0 for positive, 1 for negative) and *digit (absolute +// value, in the range 0 .. 16). Note that this integer essentially provides +// the input bits "shifted to the left" by one position: for example, the input +// to compute the least significant recoded digit, given that there's no bit +// b_-1, has to be b_4 b_3 b_2 b_1 b_0 0. +// +// DOUBLING CASE: +// +// Point addition formulas for short Weierstrass curves are often incomplete. +// Edge cases such as P + P or P + ∞ must be handled separately. This +// complicates constant-time requirements. P + ∞ cannot be avoided (any window +// may be zero) and is handled with constant-time selects. P + P (where P is not +// ∞) usually is not. Instead, windowing strategies are chosen to avoid this +// case. Whether this happens depends on the group order. +// +// Let w be the window width (in this function, w = 5). The non-trivial doubling +// case in single-point scalar multiplication may occur if and only if the +// 2^(w-1) bit of the group order is zero. +// +// Note the above only holds if the scalar is fully reduced and the group order +// is a prime that is much larger than 2^w. It also only holds when windows +// are applied from most significant to least significant, doubling between each +// window. It does not apply to more complex table strategies such as +// |EC_GFp_nistz256_method|. +// +// PROOF: +// +// Let n be the group order. Let l be the number of bits needed to represent n. +// Assume there exists some 0 <= k < n such that signed w-bit windowed +// multiplication hits the doubling case. +// +// Windowed multiplication consists of iterating over groups of s_i (defined +// above based on k's binary representation) from most to least significant. At +// iteration i (for i = ..., 3w, 2w, w, 0, starting from the most significant +// window), we: +// +// 1. Double the accumulator A, w times. Let A_i be the value of A at this +// point. +// +// 2. Set A to T_i + A_i, where T_i is a precomputed multiple of P +// corresponding to the window s_(i+w-1) ... s_i. +// +// Let j be the index such that A_j = T_j ≠ ∞. Looking at A_i and T_i as +// multiples of P, define a_i and t_i to be scalar coefficients of A_i and T_i. +// Thus a_j = t_j ≠ 0 (mod n). Note a_i and t_i may not be reduced mod n. t_i is +// the value of the w signed bits s_(i+w-1) ... s_i. a_i is computed as a_i = +// 2^w * (a_(i+w) + t_(i+w)). +// +// t_i is bounded by -2^(w-1) <= t_i <= 2^(w-1). Additionally, we may write it +// in terms of unsigned bits b_i. t_i consists of signed bits s_(i+w-1) ... s_i. +// This is computed as: +// +// b_(i+w-2) b_(i+w-3) ... b_i b_(i-1) +// - b_(i+w-1) b_(i+w-2) ... b_(i+1) b_i +// -------------------------------------------- +// t_i = s_(i+w-1) s_(i+w-2) ... s_(i+1) s_i +// +// Observe that b_(i+w-2) through b_i occur in both terms. Let x be the integer +// represented by that bit string, i.e. 2^(w-2)*b_(i+w-2) + ... + b_i. +// +// t_i = (2*x + b_(i-1)) - (2^(w-1)*b_(i+w-1) + x) +// = x - 2^(w-1)*b_(i+w-1) + b_(i-1) +// +// Or, using C notation for bit operations: +// +// t_i = (k>>i) & ((1<<(w-1)) - 1) - (k>>i) & (1<<(w-1)) + (k>>(i-1)) & 1 +// +// Note b_(i-1) is added in left-shifted by one (or doubled) from its place. +// This is compensated by t_(i-w)'s subtraction term. Thus, a_i may be computed +// by adding b_l b_(l-1) ... b_(i+1) b_i and an extra copy of b_(i-1). In C +// notation, this is: +// +// a_i = (k>>(i+w)) << w + ((k>>(i+w-1)) & 1) << w +// +// Observe that, while t_i may be positive or negative, a_i is bounded by +// 0 <= a_i < n + 2^w. Additionally, a_i can only be zero if b_(i+w-1) and up +// are all zero. (Note this implies a non-trivial P + (-P) is unreachable for +// all groups. That would imply the subsequent a_i is zero, which means all +// terms thus far were zero.) +// +// Returning to our doubling position, we have a_j = t_j (mod n). We now +// determine the value of a_j - t_j, which must be divisible by n. Our bounds on +// a_j and t_j imply a_j - t_j is 0 or n. If it is 0, a_j = t_j. However, 2^w +// divides a_j and -2^(w-1) <= t_j <= 2^(w-1), so this can only happen if +// a_j = t_j = 0, which is a trivial doubling. Therefore, a_j - t_j = n. +// +// Now we determine j. Suppose j > 0. w divides j, so j >= w. Then, +// +// n = a_j - t_j = (k>>(j+w)) << w + ((k>>(j+w-1)) & 1) << w - t_j +// <= k/2^j + 2^w - t_j +// < n/2^w + 2^w + 2^(w-1) +// +// n is much larger than 2^w, so this is impossible. Thus, j = 0: only the final +// addition may hit the doubling case. +// +// Finally, we consider bit patterns for n and k. Divide k into k_H + k_M + k_L +// such that k_H is the contribution from b_(l-1) .. b_w, k_M is the +// contribution from b_(w-1), and k_L is the contribution from b_(w-2) ... b_0. +// That is: +// +// - 2^w divides k_H +// - k_M is 0 or 2^(w-1) +// - 0 <= k_L < 2^(w-1) +// +// Divide n into n_H + n_M + n_L similarly. We thus have: +// +// t_0 = (k>>0) & ((1<<(w-1)) - 1) - (k>>0) & (1<<(w-1)) + (k>>(0-1)) & 1 +// = k & ((1<<(w-1)) - 1) - k & (1<<(w-1)) +// = k_L - k_M +// +// a_0 = (k>>(0+w)) << w + ((k>>(0+w-1)) & 1) << w +// = (k>>w) << w + ((k>>(w-1)) & 1) << w +// = k_H + 2*k_M +// +// n = a_0 - t_0 +// n_H + n_M + n_L = (k_H + 2*k_M) - (k_L - k_M) +// = k_H + 3*k_M - k_L +// +// k_H - k_L < k and k < n, so k_H - k_L ≠ n. Therefore k_M is not 0 and must be +// 2^(w-1). Now we consider k_H and n_H. We know k_H <= n_H. Suppose k_H = n_H. +// Then, +// +// n_M + n_L = 3*(2^(w-1)) - k_L +// > 3*(2^(w-1)) - 2^(w-1) +// = 2^w +// +// Contradiction (n_M + n_L is the bottom w bits of n). Thus k_H < n_H. Suppose +// k_H < n_H - 2*2^w. Then, +// +// n_H + n_M + n_L = k_H + 3*(2^(w-1)) - k_L +// < n_H - 2*2^w + 3*(2^(w-1)) - k_L +// n_M + n_L < -2^(w-1) - k_L +// +// Contradiction. Thus, k_H = n_H - 2^w. (Note 2^w divides n_H and k_H.) Thus, +// +// n_H + n_M + n_L = k_H + 3*(2^(w-1)) - k_L +// = n_H - 2^w + 3*(2^(w-1)) - k_L +// n_M + n_L = 2^(w-1) - k_L +// <= 2^(w-1) +// +// Equality would mean 2^(w-1) divides n, which is impossible if n is prime. +// Thus n_M + n_L < 2^(w-1), so n_M is zero, proving our condition. +// +// This proof constructs k, so, to show the converse, let k_H = n_H - 2^w, +// k_M = 2^(w-1), k_L = 2^(w-1) - n_L. This will result in a non-trivial point +// doubling in the final addition and is the only such scalar. +// +// COMMON CURVES: +// +// The group orders for common curves end in the following bit patterns: +// +// P-521: ...00001001; w = 4 is okay +// P-384: ...01110011; w = 2, 5, 6, 7 are okay +// P-256: ...01010001; w = 5, 7 are okay +// P-224: ...00111101; w = 3, 4, 5, 6 are okay +void ec_GFp_nistp_recode_scalar_bits(uint8_t *sign, uint8_t *digit, + uint8_t in) { + uint8_t s, d; + + s = ~((in >> 5) - 1); /* sets all bits to MSB(in), 'in' seen as + * 6-bit value */ + d = (1 << 6) - in - 1; + d = (d & s) | (in & ~s); + d = (d >> 1) + (d & 1); + + *sign = s & 1; + *digit = d; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c new file mode 100644 index 000000000..a0de817d6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c @@ -0,0 +1,227 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#include + +#include +#include + +#include +#include +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +// This file implements the wNAF-based interleaving multi-exponentiation method +// at: +// http://link.springer.com/chapter/10.1007%2F3-540-45537-X_13 +// http://www.bmoeller.de/pdf/TI-01-08.multiexp.pdf + +void ec_compute_wNAF(const EC_GROUP *group, int8_t *out, + const EC_SCALAR *scalar, size_t bits, int w) { + // 'int8_t' can represent integers with absolute values less than 2^7. + assert(0 < w && w <= 7); + assert(bits != 0); + int bit = 1 << w; // 2^w, at most 128 + int next_bit = bit << 1; // 2^(w+1), at most 256 + int mask = next_bit - 1; // at most 255 + + int window_val = scalar->words[0] & mask; + for (size_t j = 0; j < bits + 1; j++) { + assert(0 <= window_val && window_val <= next_bit); + int digit = 0; + if (window_val & 1) { + assert(0 < window_val && window_val < next_bit); + if (window_val & bit) { + digit = window_val - next_bit; + // We know -next_bit < digit < 0 and window_val - digit = next_bit. + + // modified wNAF + if (j + w + 1 >= bits) { + // special case for generating modified wNAFs: + // no new bits will be added into window_val, + // so using a positive digit here will decrease + // the total length of the representation + + digit = window_val & (mask >> 1); + // We know 0 < digit < bit and window_val - digit = bit. + } + } else { + digit = window_val; + // We know 0 < digit < bit and window_val - digit = 0. + } + + window_val -= digit; + + // Now window_val is 0 or 2^(w+1) in standard wNAF generation. + // For modified window NAFs, it may also be 2^w. + // + // See the comments above for the derivation of each of these bounds. + assert(window_val == 0 || window_val == next_bit || window_val == bit); + assert(-bit < digit && digit < bit); + + // window_val was odd, so digit is also odd. + assert(digit & 1); + } + + out[j] = digit; + + // Incorporate the next bit. Previously, |window_val| <= |next_bit|, so if + // we shift and add at most one copy of |bit|, this will continue to hold + // afterwards. + window_val >>= 1; + window_val += + bit * bn_is_bit_set_words(scalar->words, group->order.width, j + w + 1); + assert(window_val <= next_bit); + } + + // bits + 1 entries should be sufficient to consume all bits. + assert(window_val == 0); +} + +// compute_precomp sets |out[i]| to (2*i+1)*p, for i from 0 to |len|. +static void compute_precomp(const EC_GROUP *group, EC_RAW_POINT *out, + const EC_RAW_POINT *p, size_t len) { + ec_GFp_simple_point_copy(&out[0], p); + EC_RAW_POINT two_p; + ec_GFp_mont_dbl(group, &two_p, p); + for (size_t i = 1; i < len; i++) { + ec_GFp_mont_add(group, &out[i], &out[i - 1], &two_p); + } +} + +static void lookup_precomp(const EC_GROUP *group, EC_RAW_POINT *out, + const EC_RAW_POINT *precomp, int digit) { + if (digit < 0) { + digit = -digit; + ec_GFp_simple_point_copy(out, &precomp[digit >> 1]); + ec_GFp_simple_invert(group, out); + } else { + ec_GFp_simple_point_copy(out, &precomp[digit >> 1]); + } +} + +// EC_WNAF_WINDOW_BITS is the window size to use for |ec_GFp_mont_mul_public|. +#define EC_WNAF_WINDOW_BITS 4 + +// EC_WNAF_TABLE_SIZE is the table size to use for |ec_GFp_mont_mul_public|. +#define EC_WNAF_TABLE_SIZE (1 << (EC_WNAF_WINDOW_BITS - 1)) + +void ec_GFp_mont_mul_public(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + size_t bits = BN_num_bits(&group->order); + size_t wNAF_len = bits + 1; + + int8_t g_wNAF[EC_MAX_BYTES * 8 + 1]; + EC_RAW_POINT g_precomp[EC_WNAF_TABLE_SIZE]; + assert(wNAF_len <= OPENSSL_ARRAY_SIZE(g_wNAF)); + const EC_RAW_POINT *g = &group->generator->raw; + ec_compute_wNAF(group, g_wNAF, g_scalar, bits, EC_WNAF_WINDOW_BITS); + compute_precomp(group, g_precomp, g, EC_WNAF_TABLE_SIZE); + + int8_t p_wNAF[EC_MAX_BYTES * 8 + 1]; + EC_RAW_POINT p_precomp[EC_WNAF_TABLE_SIZE]; + assert(wNAF_len <= OPENSSL_ARRAY_SIZE(p_wNAF)); + ec_compute_wNAF(group, p_wNAF, p_scalar, bits, EC_WNAF_WINDOW_BITS); + compute_precomp(group, p_precomp, p, EC_WNAF_TABLE_SIZE); + + EC_RAW_POINT tmp; + int r_is_at_infinity = 1; + for (size_t k = wNAF_len - 1; k < wNAF_len; k--) { + if (!r_is_at_infinity) { + ec_GFp_mont_dbl(group, r, r); + } + + if (g_wNAF[k] != 0) { + lookup_precomp(group, &tmp, g_precomp, g_wNAF[k]); + if (r_is_at_infinity) { + ec_GFp_simple_point_copy(r, &tmp); + r_is_at_infinity = 0; + } else { + ec_GFp_mont_add(group, r, r, &tmp); + } + } + + if (p_wNAF[k] != 0) { + lookup_precomp(group, &tmp, p_precomp, p_wNAF[k]); + if (r_is_at_infinity) { + ec_GFp_simple_point_copy(r, &tmp); + r_is_at_infinity = 0; + } else { + ec_GFp_mont_add(group, r, r, &tmp); + } + } + } + + if (r_is_at_infinity) { + ec_GFp_simple_point_set_to_infinity(group, r); + } +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c.grpc_back new file mode 100644 index 000000000..fd1b480fd --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ec/wnaf.c.grpc_back @@ -0,0 +1,227 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#include + +#include +#include + +#include +#include +#include + +#include "internal.h" +#include "../bn/internal.h" +#include "../../internal.h" + + +// This file implements the wNAF-based interleaving multi-exponentiation method +// at: +// http://link.springer.com/chapter/10.1007%2F3-540-45537-X_13 +// http://www.bmoeller.de/pdf/TI-01-08.multiexp.pdf + +void ec_compute_wNAF(const EC_GROUP *group, int8_t *out, + const EC_SCALAR *scalar, size_t bits, int w) { + // 'int8_t' can represent integers with absolute values less than 2^7. + assert(0 < w && w <= 7); + assert(bits != 0); + int bit = 1 << w; // 2^w, at most 128 + int next_bit = bit << 1; // 2^(w+1), at most 256 + int mask = next_bit - 1; // at most 255 + + int window_val = scalar->words[0] & mask; + for (size_t j = 0; j < bits + 1; j++) { + assert(0 <= window_val && window_val <= next_bit); + int digit = 0; + if (window_val & 1) { + assert(0 < window_val && window_val < next_bit); + if (window_val & bit) { + digit = window_val - next_bit; + // We know -next_bit < digit < 0 and window_val - digit = next_bit. + + // modified wNAF + if (j + w + 1 >= bits) { + // special case for generating modified wNAFs: + // no new bits will be added into window_val, + // so using a positive digit here will decrease + // the total length of the representation + + digit = window_val & (mask >> 1); + // We know 0 < digit < bit and window_val - digit = bit. + } + } else { + digit = window_val; + // We know 0 < digit < bit and window_val - digit = 0. + } + + window_val -= digit; + + // Now window_val is 0 or 2^(w+1) in standard wNAF generation. + // For modified window NAFs, it may also be 2^w. + // + // See the comments above for the derivation of each of these bounds. + assert(window_val == 0 || window_val == next_bit || window_val == bit); + assert(-bit < digit && digit < bit); + + // window_val was odd, so digit is also odd. + assert(digit & 1); + } + + out[j] = digit; + + // Incorporate the next bit. Previously, |window_val| <= |next_bit|, so if + // we shift and add at most one copy of |bit|, this will continue to hold + // afterwards. + window_val >>= 1; + window_val += + bit * bn_is_bit_set_words(scalar->words, group->order.width, j + w + 1); + assert(window_val <= next_bit); + } + + // bits + 1 entries should be sufficient to consume all bits. + assert(window_val == 0); +} + +// compute_precomp sets |out[i]| to (2*i+1)*p, for i from 0 to |len|. +static void compute_precomp(const EC_GROUP *group, EC_RAW_POINT *out, + const EC_RAW_POINT *p, size_t len) { + ec_GFp_simple_point_copy(&out[0], p); + EC_RAW_POINT two_p; + ec_GFp_mont_dbl(group, &two_p, p); + for (size_t i = 1; i < len; i++) { + ec_GFp_mont_add(group, &out[i], &out[i - 1], &two_p); + } +} + +static void lookup_precomp(const EC_GROUP *group, EC_RAW_POINT *out, + const EC_RAW_POINT *precomp, int digit) { + if (digit < 0) { + digit = -digit; + ec_GFp_simple_point_copy(out, &precomp[digit >> 1]); + ec_GFp_simple_invert(group, out); + } else { + ec_GFp_simple_point_copy(out, &precomp[digit >> 1]); + } +} + +// EC_WNAF_WINDOW_BITS is the window size to use for |ec_GFp_mont_mul_public|. +#define EC_WNAF_WINDOW_BITS 4 + +// EC_WNAF_TABLE_SIZE is the table size to use for |ec_GFp_mont_mul_public|. +#define EC_WNAF_TABLE_SIZE (1 << (EC_WNAF_WINDOW_BITS - 1)) + +void ec_GFp_mont_mul_public(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { + size_t bits = BN_num_bits(&group->order); + size_t wNAF_len = bits + 1; + + int8_t g_wNAF[EC_MAX_BYTES * 8 + 1]; + EC_RAW_POINT g_precomp[EC_WNAF_TABLE_SIZE]; + assert(wNAF_len <= OPENSSL_ARRAY_SIZE(g_wNAF)); + const EC_RAW_POINT *g = &group->generator->raw; + ec_compute_wNAF(group, g_wNAF, g_scalar, bits, EC_WNAF_WINDOW_BITS); + compute_precomp(group, g_precomp, g, EC_WNAF_TABLE_SIZE); + + int8_t p_wNAF[EC_MAX_BYTES * 8 + 1]; + EC_RAW_POINT p_precomp[EC_WNAF_TABLE_SIZE]; + assert(wNAF_len <= OPENSSL_ARRAY_SIZE(p_wNAF)); + ec_compute_wNAF(group, p_wNAF, p_scalar, bits, EC_WNAF_WINDOW_BITS); + compute_precomp(group, p_precomp, p, EC_WNAF_TABLE_SIZE); + + EC_RAW_POINT tmp; + int r_is_at_infinity = 1; + for (size_t k = wNAF_len - 1; k < wNAF_len; k--) { + if (!r_is_at_infinity) { + ec_GFp_mont_dbl(group, r, r); + } + + if (g_wNAF[k] != 0) { + lookup_precomp(group, &tmp, g_precomp, g_wNAF[k]); + if (r_is_at_infinity) { + ec_GFp_simple_point_copy(r, &tmp); + r_is_at_infinity = 0; + } else { + ec_GFp_mont_add(group, r, r, &tmp); + } + } + + if (p_wNAF[k] != 0) { + lookup_precomp(group, &tmp, p_precomp, p_wNAF[k]); + if (r_is_at_infinity) { + ec_GFp_simple_point_copy(r, &tmp); + r_is_at_infinity = 0; + } else { + ec_GFp_mont_add(group, r, r, &tmp); + } + } + } + + if (r_is_at_infinity) { + ec_GFp_simple_point_set_to_infinity(group, r); + } +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c new file mode 100644 index 000000000..c7f3408bf --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c @@ -0,0 +1,122 @@ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include + +#include +#include +#include +#include +#include + +#include "../ec/internal.h" + + +int ECDH_compute_key_fips(uint8_t *out, size_t out_len, const EC_POINT *pub_key, + const EC_KEY *priv_key) { + if (priv_key->priv_key == NULL) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); + return 0; + } + const EC_SCALAR *const priv = &priv_key->priv_key->scalar; + const EC_GROUP *const group = EC_KEY_get0_group(priv_key); + if (EC_GROUP_cmp(group, pub_key->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + + EC_RAW_POINT shared_point; + uint8_t buf[EC_MAX_BYTES]; + size_t buflen; + if (!ec_point_mul_scalar(group, &shared_point, &pub_key->raw, priv) || + !ec_point_get_affine_coordinate_bytes(group, buf, NULL, &buflen, + sizeof(buf), &shared_point)) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); + return 0; + } + + switch (out_len) { + case SHA224_DIGEST_LENGTH: + SHA224(buf, buflen, out); + break; + case SHA256_DIGEST_LENGTH: + SHA256(buf, buflen, out); + break; + case SHA384_DIGEST_LENGTH: + SHA384(buf, buflen, out); + break; + case SHA512_DIGEST_LENGTH: + SHA512(buf, buflen, out); + break; + default: + OPENSSL_PUT_ERROR(ECDH, ECDH_R_UNKNOWN_DIGEST_LENGTH); + return 0; + } + + return 1; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c.grpc_back new file mode 100644 index 000000000..a7b2f08b4 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdh/ecdh.c.grpc_back @@ -0,0 +1,122 @@ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include + +#include +#include +#include +#include +#include + +#include "../ec/internal.h" + + +int ECDH_compute_key_fips(uint8_t *out, size_t out_len, const EC_POINT *pub_key, + const EC_KEY *priv_key) { + if (priv_key->priv_key == NULL) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_NO_PRIVATE_VALUE); + return 0; + } + const EC_SCALAR *const priv = &priv_key->priv_key->scalar; + const EC_GROUP *const group = EC_KEY_get0_group(priv_key); + if (EC_GROUP_cmp(group, pub_key->group, NULL) != 0) { + OPENSSL_PUT_ERROR(EC, EC_R_INCOMPATIBLE_OBJECTS); + return 0; + } + + EC_RAW_POINT shared_point; + uint8_t buf[EC_MAX_BYTES]; + size_t buflen; + if (!ec_point_mul_scalar(group, &shared_point, &pub_key->raw, priv) || + !ec_point_get_affine_coordinate_bytes(group, buf, NULL, &buflen, + sizeof(buf), &shared_point)) { + OPENSSL_PUT_ERROR(ECDH, ECDH_R_POINT_ARITHMETIC_FAILURE); + return 0; + } + + switch (out_len) { + case SHA224_DIGEST_LENGTH: + SHA224(buf, buflen, out); + break; + case SHA256_DIGEST_LENGTH: + SHA256(buf, buflen, out); + break; + case SHA384_DIGEST_LENGTH: + SHA384(buf, buflen, out); + break; + case SHA512_DIGEST_LENGTH: + SHA512(buf, buflen, out); + break; + default: + OPENSSL_PUT_ERROR(ECDH, ECDH_R_UNKNOWN_DIGEST_LENGTH); + return 0; + } + + return 1; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c new file mode 100644 index 000000000..92ebadef1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c @@ -0,0 +1,313 @@ +/* ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "../bn/internal.h" +#include "../ec/internal.h" +#include "../../internal.h" + + +// digest_to_scalar interprets |digest_len| bytes from |digest| as a scalar for +// ECDSA. Note this value is not fully reduced modulo the order, only the +// correct number of bits. +static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const uint8_t *digest, size_t digest_len) { + const BIGNUM *order = &group->order; + size_t num_bits = BN_num_bits(order); + // Need to truncate digest if it is too long: first truncate whole bytes. + size_t num_bytes = (num_bits + 7) / 8; + if (digest_len > num_bytes) { + digest_len = num_bytes; + } + OPENSSL_memset(out, 0, sizeof(EC_SCALAR)); + for (size_t i = 0; i < digest_len; i++) { + out->bytes[i] = digest[digest_len - 1 - i]; + } + + // If it is still too long, truncate remaining bits with a shift. + if (8 * digest_len > num_bits) { + bn_rshift_words(out->words, out->words, 8 - (num_bits & 0x7), order->width); + } + + // |out| now has the same bit width as |order|, but this only bounds by + // 2*|order|. Subtract the order if out of range. + // + // Montgomery multiplication accepts the looser bounds, so this isn't strictly + // necessary, but it is a cleaner abstraction and has no performance impact. + BN_ULONG tmp[EC_MAX_WORDS]; + bn_reduce_once_in_place(out->words, 0 /* no carry */, order->d, tmp, + order->width); +} + +ECDSA_SIG *ECDSA_SIG_new(void) { + ECDSA_SIG *sig = OPENSSL_malloc(sizeof(ECDSA_SIG)); + if (sig == NULL) { + return NULL; + } + sig->r = BN_new(); + sig->s = BN_new(); + if (sig->r == NULL || sig->s == NULL) { + ECDSA_SIG_free(sig); + return NULL; + } + return sig; +} + +void ECDSA_SIG_free(ECDSA_SIG *sig) { + if (sig == NULL) { + return; + } + + BN_free(sig->r); + BN_free(sig->s); + OPENSSL_free(sig); +} + +void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **out_r, + const BIGNUM **out_s) { + if (out_r != NULL) { + *out_r = sig->r; + } + if (out_s != NULL) { + *out_s = sig->s; + } +} + +int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { + if (r == NULL || s == NULL) { + return 0; + } + BN_free(sig->r); + BN_free(sig->s); + sig->r = r; + sig->s = s; + return 1; +} + +int ECDSA_do_verify(const uint8_t *digest, size_t digest_len, + const ECDSA_SIG *sig, const EC_KEY *eckey) { + const EC_GROUP *group = EC_KEY_get0_group(eckey); + const EC_POINT *pub_key = EC_KEY_get0_public_key(eckey); + if (group == NULL || pub_key == NULL || sig == NULL) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_MISSING_PARAMETERS); + return 0; + } + + EC_SCALAR r, s, u1, u2, s_inv_mont, m; + if (BN_is_zero(sig->r) || + !ec_bignum_to_scalar(group, &r, sig->r) || + BN_is_zero(sig->s) || + !ec_bignum_to_scalar(group, &s, sig->s)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + return 0; + } + + // s_inv_mont = s^-1 in the Montgomery domain. This is + ec_scalar_inv_montgomery_vartime(group, &s_inv_mont, &s); + + // u1 = m * s^-1 mod order + // u2 = r * s^-1 mod order + // + // |s_inv_mont| is in Montgomery form while |m| and |r| are not, so |u1| and + // |u2| will be taken out of Montgomery form, as desired. + digest_to_scalar(group, &m, digest, digest_len); + ec_scalar_mul_montgomery(group, &u1, &m, &s_inv_mont); + ec_scalar_mul_montgomery(group, &u2, &r, &s_inv_mont); + + EC_RAW_POINT point; + if (!ec_point_mul_scalar_public(group, &point, &u1, &pub_key->raw, &u2)) { + OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); + return 0; + } + + if (!ec_cmp_x_coordinate(group, &point, &r)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + return 0; + } + + return 1; +} + +static int ecdsa_sign_setup(const EC_KEY *eckey, EC_SCALAR *out_kinv_mont, + EC_SCALAR *out_r, const uint8_t *digest, + size_t digest_len, const EC_SCALAR *priv_key) { + // Check that the size of the group order is FIPS compliant (FIPS 186-4 + // B.5.2). + const EC_GROUP *group = EC_KEY_get0_group(eckey); + const BIGNUM *order = EC_GROUP_get0_order(group); + if (BN_num_bits(order) < 160) { + OPENSSL_PUT_ERROR(ECDSA, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + int ret = 0; + EC_SCALAR k; + EC_RAW_POINT tmp_point; + do { + // Include the private key and message digest in the k generation. + if (eckey->fixed_k != NULL) { + if (!ec_bignum_to_scalar(group, &k, eckey->fixed_k)) { + goto err; + } + } else { + // Pass a SHA512 hash of the private key and digest as additional data + // into the RBG. This is a hardening measure against entropy failure. + OPENSSL_STATIC_ASSERT(SHA512_DIGEST_LENGTH >= 32, + "additional_data is too large for SHA-512"); + SHA512_CTX sha; + uint8_t additional_data[SHA512_DIGEST_LENGTH]; + SHA512_Init(&sha); + SHA512_Update(&sha, priv_key->words, order->width * sizeof(BN_ULONG)); + SHA512_Update(&sha, digest, digest_len); + SHA512_Final(additional_data, &sha); + if (!ec_random_nonzero_scalar(group, &k, additional_data)) { + goto err; + } + } + + // Compute k^-1 in the Montgomery domain. This is |ec_scalar_to_montgomery| + // followed by |ec_scalar_inv_montgomery|, but |ec_scalar_inv_montgomery| + // followed by |ec_scalar_from_montgomery| is equivalent and slightly more + // efficient. + ec_scalar_inv_montgomery(group, out_kinv_mont, &k); + ec_scalar_from_montgomery(group, out_kinv_mont, out_kinv_mont); + + // Compute r, the x-coordinate of generator * k. + if (!ec_point_mul_scalar_base(group, &tmp_point, &k) || + !ec_get_x_coordinate_as_scalar(group, out_r, &tmp_point)) { + goto err; + } + } while (ec_scalar_is_zero(group, out_r)); + + ret = 1; + +err: + OPENSSL_cleanse(&k, sizeof(k)); + return ret; +} + +ECDSA_SIG *ECDSA_do_sign(const uint8_t *digest, size_t digest_len, + const EC_KEY *eckey) { + if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NOT_IMPLEMENTED); + return NULL; + } + + const EC_GROUP *group = EC_KEY_get0_group(eckey); + if (group == NULL || eckey->priv_key == NULL) { + OPENSSL_PUT_ERROR(ECDSA, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + const BIGNUM *order = EC_GROUP_get0_order(group); + const EC_SCALAR *priv_key = &eckey->priv_key->scalar; + + int ok = 0; + ECDSA_SIG *ret = ECDSA_SIG_new(); + EC_SCALAR kinv_mont, r_mont, s, m, tmp; + if (ret == NULL) { + OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + + digest_to_scalar(group, &m, digest, digest_len); + for (;;) { + if (!ecdsa_sign_setup(eckey, &kinv_mont, &r_mont, digest, digest_len, + priv_key) || + !bn_set_words(ret->r, r_mont.words, order->width)) { + goto err; + } + + // Compute priv_key * r (mod order). Note if only one parameter is in the + // Montgomery domain, |ec_scalar_mod_mul_montgomery| will compute the answer + // in the normal domain. + ec_scalar_to_montgomery(group, &r_mont, &r_mont); + ec_scalar_mul_montgomery(group, &s, priv_key, &r_mont); + + // Compute tmp = m + priv_key * r. + ec_scalar_add(group, &tmp, &m, &s); + + // Finally, multiply s by k^-1. That was retained in Montgomery form, so the + // same technique as the previous multiplication works. + ec_scalar_mul_montgomery(group, &s, &tmp, &kinv_mont); + if (!bn_set_words(ret->s, s.words, order->width)) { + goto err; + } + if (!BN_is_zero(ret->s)) { + // s != 0 => we have a valid signature + break; + } + } + + ok = 1; + +err: + if (!ok) { + ECDSA_SIG_free(ret); + ret = NULL; + } + OPENSSL_cleanse(&kinv_mont, sizeof(kinv_mont)); + OPENSSL_cleanse(&r_mont, sizeof(r_mont)); + OPENSSL_cleanse(&s, sizeof(s)); + OPENSSL_cleanse(&tmp, sizeof(tmp)); + OPENSSL_cleanse(&m, sizeof(m)); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back new file mode 100644 index 000000000..38771d58e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/ecdsa/ecdsa.c.grpc_back @@ -0,0 +1,313 @@ +/* ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "../bn/internal.h" +#include "../ec/internal.h" +#include "../../internal.h" + + +// digest_to_scalar interprets |digest_len| bytes from |digest| as a scalar for +// ECDSA. Note this value is not fully reduced modulo the order, only the +// correct number of bits. +static void digest_to_scalar(const EC_GROUP *group, EC_SCALAR *out, + const uint8_t *digest, size_t digest_len) { + const BIGNUM *order = &group->order; + size_t num_bits = BN_num_bits(order); + // Need to truncate digest if it is too long: first truncate whole bytes. + size_t num_bytes = (num_bits + 7) / 8; + if (digest_len > num_bytes) { + digest_len = num_bytes; + } + OPENSSL_memset(out, 0, sizeof(EC_SCALAR)); + for (size_t i = 0; i < digest_len; i++) { + out->bytes[i] = digest[digest_len - 1 - i]; + } + + // If it is still too long, truncate remaining bits with a shift. + if (8 * digest_len > num_bits) { + bn_rshift_words(out->words, out->words, 8 - (num_bits & 0x7), order->width); + } + + // |out| now has the same bit width as |order|, but this only bounds by + // 2*|order|. Subtract the order if out of range. + // + // Montgomery multiplication accepts the looser bounds, so this isn't strictly + // necessary, but it is a cleaner abstraction and has no performance impact. + BN_ULONG tmp[EC_MAX_WORDS]; + bn_reduce_once_in_place(out->words, 0 /* no carry */, order->d, tmp, + order->width); +} + +ECDSA_SIG *ECDSA_SIG_new(void) { + ECDSA_SIG *sig = OPENSSL_malloc(sizeof(ECDSA_SIG)); + if (sig == NULL) { + return NULL; + } + sig->r = BN_new(); + sig->s = BN_new(); + if (sig->r == NULL || sig->s == NULL) { + ECDSA_SIG_free(sig); + return NULL; + } + return sig; +} + +void ECDSA_SIG_free(ECDSA_SIG *sig) { + if (sig == NULL) { + return; + } + + BN_free(sig->r); + BN_free(sig->s); + OPENSSL_free(sig); +} + +void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **out_r, + const BIGNUM **out_s) { + if (out_r != NULL) { + *out_r = sig->r; + } + if (out_s != NULL) { + *out_s = sig->s; + } +} + +int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { + if (r == NULL || s == NULL) { + return 0; + } + BN_free(sig->r); + BN_free(sig->s); + sig->r = r; + sig->s = s; + return 1; +} + +int ECDSA_do_verify(const uint8_t *digest, size_t digest_len, + const ECDSA_SIG *sig, const EC_KEY *eckey) { + const EC_GROUP *group = EC_KEY_get0_group(eckey); + const EC_POINT *pub_key = EC_KEY_get0_public_key(eckey); + if (group == NULL || pub_key == NULL || sig == NULL) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_MISSING_PARAMETERS); + return 0; + } + + EC_SCALAR r, s, u1, u2, s_inv_mont, m; + if (BN_is_zero(sig->r) || + !ec_bignum_to_scalar(group, &r, sig->r) || + BN_is_zero(sig->s) || + !ec_bignum_to_scalar(group, &s, sig->s)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + return 0; + } + + // s_inv_mont = s^-1 in the Montgomery domain. This is + ec_scalar_inv_montgomery_vartime(group, &s_inv_mont, &s); + + // u1 = m * s^-1 mod order + // u2 = r * s^-1 mod order + // + // |s_inv_mont| is in Montgomery form while |m| and |r| are not, so |u1| and + // |u2| will be taken out of Montgomery form, as desired. + digest_to_scalar(group, &m, digest, digest_len); + ec_scalar_mul_montgomery(group, &u1, &m, &s_inv_mont); + ec_scalar_mul_montgomery(group, &u2, &r, &s_inv_mont); + + EC_RAW_POINT point; + if (!ec_point_mul_scalar_public(group, &point, &u1, &pub_key->raw, &u2)) { + OPENSSL_PUT_ERROR(ECDSA, ERR_R_EC_LIB); + return 0; + } + + if (!ec_cmp_x_coordinate(group, &point, &r)) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_BAD_SIGNATURE); + return 0; + } + + return 1; +} + +static int ecdsa_sign_setup(const EC_KEY *eckey, EC_SCALAR *out_kinv_mont, + EC_SCALAR *out_r, const uint8_t *digest, + size_t digest_len, const EC_SCALAR *priv_key) { + // Check that the size of the group order is FIPS compliant (FIPS 186-4 + // B.5.2). + const EC_GROUP *group = EC_KEY_get0_group(eckey); + const BIGNUM *order = EC_GROUP_get0_order(group); + if (BN_num_bits(order) < 160) { + OPENSSL_PUT_ERROR(ECDSA, EC_R_INVALID_GROUP_ORDER); + return 0; + } + + int ret = 0; + EC_SCALAR k; + EC_RAW_POINT tmp_point; + do { + // Include the private key and message digest in the k generation. + if (eckey->fixed_k != NULL) { + if (!ec_bignum_to_scalar(group, &k, eckey->fixed_k)) { + goto err; + } + } else { + // Pass a SHA512 hash of the private key and digest as additional data + // into the RBG. This is a hardening measure against entropy failure. + OPENSSL_STATIC_ASSERT(SHA512_DIGEST_LENGTH >= 32, + "additional_data is too large for SHA-512"); + SHA512_CTX sha; + uint8_t additional_data[SHA512_DIGEST_LENGTH]; + SHA512_Init(&sha); + SHA512_Update(&sha, priv_key->words, order->width * sizeof(BN_ULONG)); + SHA512_Update(&sha, digest, digest_len); + SHA512_Final(additional_data, &sha); + if (!ec_random_nonzero_scalar(group, &k, additional_data)) { + goto err; + } + } + + // Compute k^-1 in the Montgomery domain. This is |ec_scalar_to_montgomery| + // followed by |ec_scalar_inv_montgomery|, but |ec_scalar_inv_montgomery| + // followed by |ec_scalar_from_montgomery| is equivalent and slightly more + // efficient. + ec_scalar_inv_montgomery(group, out_kinv_mont, &k); + ec_scalar_from_montgomery(group, out_kinv_mont, out_kinv_mont); + + // Compute r, the x-coordinate of generator * k. + if (!ec_point_mul_scalar_base(group, &tmp_point, &k) || + !ec_get_x_coordinate_as_scalar(group, out_r, &tmp_point)) { + goto err; + } + } while (ec_scalar_is_zero(group, out_r)); + + ret = 1; + +err: + OPENSSL_cleanse(&k, sizeof(k)); + return ret; +} + +ECDSA_SIG *ECDSA_do_sign(const uint8_t *digest, size_t digest_len, + const EC_KEY *eckey) { + if (eckey->ecdsa_meth && eckey->ecdsa_meth->sign) { + OPENSSL_PUT_ERROR(ECDSA, ECDSA_R_NOT_IMPLEMENTED); + return NULL; + } + + const EC_GROUP *group = EC_KEY_get0_group(eckey); + if (group == NULL || eckey->priv_key == NULL) { + OPENSSL_PUT_ERROR(ECDSA, ERR_R_PASSED_NULL_PARAMETER); + return NULL; + } + const BIGNUM *order = EC_GROUP_get0_order(group); + const EC_SCALAR *priv_key = &eckey->priv_key->scalar; + + int ok = 0; + ECDSA_SIG *ret = ECDSA_SIG_new(); + EC_SCALAR kinv_mont, r_mont, s, m, tmp; + if (ret == NULL) { + OPENSSL_PUT_ERROR(ECDSA, ERR_R_MALLOC_FAILURE); + return NULL; + } + + digest_to_scalar(group, &m, digest, digest_len); + for (;;) { + if (!ecdsa_sign_setup(eckey, &kinv_mont, &r_mont, digest, digest_len, + priv_key) || + !bn_set_words(ret->r, r_mont.words, order->width)) { + goto err; + } + + // Compute priv_key * r (mod order). Note if only one parameter is in the + // Montgomery domain, |ec_scalar_mod_mul_montgomery| will compute the answer + // in the normal domain. + ec_scalar_to_montgomery(group, &r_mont, &r_mont); + ec_scalar_mul_montgomery(group, &s, priv_key, &r_mont); + + // Compute tmp = m + priv_key * r. + ec_scalar_add(group, &tmp, &m, &s); + + // Finally, multiply s by k^-1. That was retained in Montgomery form, so the + // same technique as the previous multiplication works. + ec_scalar_mul_montgomery(group, &s, &tmp, &kinv_mont); + if (!bn_set_words(ret->s, s.words, order->width)) { + goto err; + } + if (!BN_is_zero(ret->s)) { + // s != 0 => we have a valid signature + break; + } + } + + ok = 1; + +err: + if (!ok) { + ECDSA_SIG_free(ret); + ret = NULL; + } + OPENSSL_cleanse(&kinv_mont, sizeof(kinv_mont)); + OPENSSL_cleanse(&r_mont, sizeof(r_mont)); + OPENSSL_cleanse(&s, sizeof(s)); + OPENSSL_cleanse(&tmp, sizeof(tmp)); + OPENSSL_cleanse(&m, sizeof(m)); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c new file mode 100644 index 000000000..2a66a1f06 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c @@ -0,0 +1,32 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + + +#if defined(BORINGSSL_FIPS) && defined(BORINGSSL_SHARED_LIBRARY) +// BORINGSSL_bcm_text_hash is is default hash value for the FIPS integrity check +// that must be replaced with the real value during the build process. This +// value need only be distinct, i.e. so that we can safely search-and-replace it +// in an object file. +const uint8_t BORINGSSL_bcm_text_hash[64]; +const uint8_t BORINGSSL_bcm_text_hash[64] = { + 0xae, 0x2c, 0xea, 0x2a, 0xbd, 0xa6, 0xf3, 0xec, 0x97, 0x7f, 0x9b, + 0xf6, 0x94, 0x9a, 0xfc, 0x83, 0x68, 0x27, 0xcb, 0xa0, 0xa0, 0x9f, + 0x6b, 0x6f, 0xde, 0x52, 0xcd, 0xe2, 0xcd, 0xff, 0x31, 0x80, 0xa2, + 0xd4, 0xc3, 0x66, 0x0f, 0xc2, 0x6a, 0x7b, 0xf4, 0xbe, 0x39, 0xa2, + 0xd7, 0x25, 0xdb, 0x21, 0x98, 0xe9, 0xd5, 0x53, 0xbf, 0x5c, 0x32, + 0x06, 0x83, 0x34, 0x0c, 0x65, 0x89, 0x52, 0xbd, 0x1f, +}; +#endif // FIPS && SHARED_LIBRARY diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c.grpc_back new file mode 100644 index 000000000..2a66a1f06 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/fips_shared_support.c.grpc_back @@ -0,0 +1,32 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + + +#if defined(BORINGSSL_FIPS) && defined(BORINGSSL_SHARED_LIBRARY) +// BORINGSSL_bcm_text_hash is is default hash value for the FIPS integrity check +// that must be replaced with the real value during the build process. This +// value need only be distinct, i.e. so that we can safely search-and-replace it +// in an object file. +const uint8_t BORINGSSL_bcm_text_hash[64]; +const uint8_t BORINGSSL_bcm_text_hash[64] = { + 0xae, 0x2c, 0xea, 0x2a, 0xbd, 0xa6, 0xf3, 0xec, 0x97, 0x7f, 0x9b, + 0xf6, 0x94, 0x9a, 0xfc, 0x83, 0x68, 0x27, 0xcb, 0xa0, 0xa0, 0x9f, + 0x6b, 0x6f, 0xde, 0x52, 0xcd, 0xe2, 0xcd, 0xff, 0x31, 0x80, 0xa2, + 0xd4, 0xc3, 0x66, 0x0f, 0xc2, 0x6a, 0x7b, 0xf4, 0xbe, 0x39, 0xa2, + 0xd7, 0x25, 0xdb, 0x21, 0x98, 0xe9, 0xd5, 0x53, 0xbf, 0x5c, 0x32, + 0x06, 0x83, 0x34, 0x0c, 0x65, 0x89, 0x52, 0xbd, 0x1f, +}; +#endif // FIPS && SHARED_LIBRARY diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/hmac/hmac.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/hmac/hmac.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/hmac/hmac.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/hmac/hmac.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/hmac/hmac.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/is_fips.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/is_fips.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c index f8fd59094..aae87c5dc 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/is_fips.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c @@ -25,3 +25,5 @@ int FIPS_mode(void) { return 0; #endif } + +int FIPS_mode_set(int on) { return on == FIPS_mode(); } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/is_fips.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/is_fips.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c.grpc_back index 4182dfb7f..2f8e408f4 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/is_fips.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/is_fips.c.grpc_back @@ -25,3 +25,5 @@ int FIPS_mode(void) { return 0; #endif } + +int FIPS_mode_set(int on) { return on == FIPS_mode(); } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md4/md4.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/md4/md4.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c index 364029efe..6bff52f2a 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md4/md4.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c @@ -62,7 +62,7 @@ #include "../../internal.h" -uint8_t *MD4(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *MD4(const uint8_t *data, size_t len, uint8_t out[MD4_DIGEST_LENGTH]) { MD4_CTX ctx; MD4_Init(&ctx); MD4_Update(&ctx, data, len); @@ -88,6 +88,7 @@ void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num); #define HASH_CTX MD4_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 16 #define HASH_UPDATE MD4_Update #define HASH_TRANSFORM MD4_Transform #define HASH_FINAL MD4_Final @@ -238,6 +239,7 @@ void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { #undef DATA_ORDER_IS_LITTLE_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_UPDATE #undef HASH_TRANSFORM #undef HASH_FINAL diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md4/md4.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/md4/md4.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c.grpc_back index f0c1dcdf1..cc2a6314f 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md4/md4.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md4/md4.c.grpc_back @@ -62,7 +62,7 @@ #include "../../internal.h" -uint8_t *MD4(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *MD4(const uint8_t *data, size_t len, uint8_t out[MD4_DIGEST_LENGTH]) { MD4_CTX ctx; MD4_Init(&ctx); MD4_Update(&ctx, data, len); @@ -88,6 +88,7 @@ void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num); #define HASH_CTX MD4_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 16 #define HASH_UPDATE MD4_Update #define HASH_TRANSFORM MD4_Transform #define HASH_FINAL MD4_Final @@ -238,6 +239,7 @@ void md4_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { #undef DATA_ORDER_IS_LITTLE_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_UPDATE #undef HASH_TRANSFORM #undef HASH_FINAL diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h new file mode 100644 index 000000000..d5a3d4aa0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h @@ -0,0 +1,37 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_MD5_INTERNAL_H +#define OPENSSL_HEADER_MD5_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) +#define MD5_ASM +extern void md5_block_asm_data_order(uint32_t *state, const uint8_t *data, + size_t num); +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // OPENSSL_HEADER_MD5_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h.grpc_back new file mode 100644 index 000000000..9ee9f13a0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/internal.h.grpc_back @@ -0,0 +1,37 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_MD5_INTERNAL_H +#define OPENSSL_HEADER_MD5_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) +#define MD5_ASM +extern void md5_block_asm_data_order(uint32_t *state, const uint8_t *data, + size_t num); +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // OPENSSL_HEADER_MD5_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c index 2f07d0b56..e4ca5f350 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c @@ -60,10 +60,11 @@ #include +#include "internal.h" #include "../../internal.h" -uint8_t *MD5(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *MD5(const uint8_t *data, size_t len, uint8_t out[MD5_DIGEST_LENGTH]) { MD5_CTX ctx; MD5_Init(&ctx); MD5_Update(&ctx, data, len); @@ -81,19 +82,19 @@ int MD5_Init(MD5_CTX *md5) { return 1; } -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -#define MD5_ASM +#if defined(MD5_ASM) #define md5_block_data_order md5_block_asm_data_order +#else +static void md5_block_data_order(uint32_t *state, const uint8_t *data, + size_t num); #endif -void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num); - #define DATA_ORDER_IS_LITTLE_ENDIAN #define HASH_CTX MD5_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 16 #define HASH_UPDATE MD5_Update #define HASH_TRANSFORM MD5_Transform #define HASH_FINAL MD5_Final @@ -151,11 +152,12 @@ void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num); (a) += (b); \ } while (0) -#ifndef GRPC_SHADOW_md5_block_data_order +#ifndef MD5_ASM #ifdef X #undef X #endif -void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { +static void md5_block_data_order(uint32_t *state, const uint8_t *data, + size_t num) { uint32_t A, B, C, D, l; uint32_t XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15; @@ -280,6 +282,7 @@ void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { #undef DATA_ORDER_IS_LITTLE_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_UPDATE #undef HASH_TRANSFORM #undef HASH_FINAL diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c.grpc_back similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c.grpc_back index fd822b4ac..a48d70431 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/md5/md5.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/md5/md5.c.grpc_back @@ -60,10 +60,11 @@ #include +#include "internal.h" #include "../../internal.h" -uint8_t *MD5(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *MD5(const uint8_t *data, size_t len, uint8_t out[MD5_DIGEST_LENGTH]) { MD5_CTX ctx; MD5_Init(&ctx); MD5_Update(&ctx, data, len); @@ -81,19 +82,19 @@ int MD5_Init(MD5_CTX *md5) { return 1; } -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86_64) || defined(OPENSSL_X86)) -#define MD5_ASM +#if defined(MD5_ASM) #define md5_block_data_order md5_block_asm_data_order +#else +static void md5_block_data_order(uint32_t *state, const uint8_t *data, + size_t num); #endif -void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num); - #define DATA_ORDER_IS_LITTLE_ENDIAN #define HASH_CTX MD5_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 16 #define HASH_UPDATE MD5_Update #define HASH_TRANSFORM MD5_Transform #define HASH_FINAL MD5_Final @@ -151,11 +152,12 @@ void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num); (a) += (b); \ } while (0) -#ifndef GRPC_SHADOW_md5_block_data_order +#ifndef MD5_ASM #ifdef X #undef X #endif -void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { +static void md5_block_data_order(uint32_t *state, const uint8_t *data, + size_t num) { uint32_t A, B, C, D, l; uint32_t XX0, XX1, XX2, XX3, XX4, XX5, XX6, XX7, XX8, XX9, XX10, XX11, XX12, XX13, XX14, XX15; @@ -280,6 +282,7 @@ void md5_block_data_order(uint32_t *state, const uint8_t *data, size_t num) { #undef DATA_ORDER_IS_LITTLE_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_UPDATE #undef HASH_TRANSFORM #undef HASH_FINAL diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c new file mode 100644 index 000000000..504d31942 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c @@ -0,0 +1,167 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include +#include + +#include + +#include "internal.h" + + +void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block) { + size_t n; + const uint8_t *iv = ivec; + + assert(key != NULL && ivec != NULL); + assert(len == 0 || (in != NULL && out != NULL)); + + while (len >= 16) { + for (n = 0; n < 16; n += sizeof(size_t)) { + store_word_le(out + n, load_word_le(in + n) ^ load_word_le(iv + n)); + } + (*block)(out, out, key); + iv = out; + len -= 16; + in += 16; + out += 16; + } + + while (len) { + for (n = 0; n < 16 && n < len; ++n) { + out[n] = in[n] ^ iv[n]; + } + for (; n < 16; ++n) { + out[n] = iv[n]; + } + (*block)(out, out, key); + iv = out; + if (len <= 16) { + break; + } + len -= 16; + in += 16; + out += 16; + } + + OPENSSL_memcpy(ivec, iv, 16); +} + +void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block) { + size_t n; + union { + size_t t[16 / sizeof(size_t)]; + uint8_t c[16]; + } tmp; + + assert(key != NULL && ivec != NULL); + assert(len == 0 || (in != NULL && out != NULL)); + + const uintptr_t inptr = (uintptr_t) in; + const uintptr_t outptr = (uintptr_t) out; + // If |in| and |out| alias, |in| must be ahead. + assert(inptr >= outptr || inptr + len <= outptr); + + if ((inptr >= 32 && outptr <= inptr - 32) || inptr < outptr) { + // If |out| is at least two blocks behind |in| or completely disjoint, there + // is no need to decrypt to a temporary block. + OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be evenly divided into words"); + const uint8_t *iv = ivec; + while (len >= 16) { + (*block)(in, out, key); + for (n = 0; n < 16; n += sizeof(size_t)) { + store_word_le(out + n, load_word_le(out + n) ^ load_word_le(iv + n)); + } + iv = in; + len -= 16; + in += 16; + out += 16; + } + OPENSSL_memcpy(ivec, iv, 16); + } else { + OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be evenly divided into words"); + + while (len >= 16) { + (*block)(in, tmp.c, key); + for (n = 0; n < 16; n += sizeof(size_t)) { + size_t c = load_word_le(in + n); + store_word_le(out + n, + tmp.t[n / sizeof(size_t)] ^ load_word_le(ivec + n)); + store_word_le(ivec + n, c); + } + len -= 16; + in += 16; + out += 16; + } + } + + while (len) { + uint8_t c; + (*block)(in, tmp.c, key); + for (n = 0; n < 16 && n < len; ++n) { + c = in[n]; + out[n] = tmp.c[n] ^ ivec[n]; + ivec[n] = c; + } + if (len <= 16) { + for (; n < 16; ++n) { + ivec[n] = in[n]; + } + break; + } + len -= 16; + in += 16; + out += 16; + } +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c.grpc_back new file mode 100644 index 000000000..3f1d77766 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cbc.c.grpc_back @@ -0,0 +1,167 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include +#include + +#include + +#include "internal.h" + + +void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block) { + size_t n; + const uint8_t *iv = ivec; + + assert(key != NULL && ivec != NULL); + assert(len == 0 || (in != NULL && out != NULL)); + + while (len >= 16) { + for (n = 0; n < 16; n += sizeof(size_t)) { + store_word_le(out + n, load_word_le(in + n) ^ load_word_le(iv + n)); + } + (*block)(out, out, key); + iv = out; + len -= 16; + in += 16; + out += 16; + } + + while (len) { + for (n = 0; n < 16 && n < len; ++n) { + out[n] = in[n] ^ iv[n]; + } + for (; n < 16; ++n) { + out[n] = iv[n]; + } + (*block)(out, out, key); + iv = out; + if (len <= 16) { + break; + } + len -= 16; + in += 16; + out += 16; + } + + OPENSSL_memcpy(ivec, iv, 16); +} + +void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block) { + size_t n; + union { + size_t t[16 / sizeof(size_t)]; + uint8_t c[16]; + } tmp; + + assert(key != NULL && ivec != NULL); + assert(len == 0 || (in != NULL && out != NULL)); + + const uintptr_t inptr = (uintptr_t) in; + const uintptr_t outptr = (uintptr_t) out; + // If |in| and |out| alias, |in| must be ahead. + assert(inptr >= outptr || inptr + len <= outptr); + + if ((inptr >= 32 && outptr <= inptr - 32) || inptr < outptr) { + // If |out| is at least two blocks behind |in| or completely disjoint, there + // is no need to decrypt to a temporary block. + OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be evenly divided into words"); + const uint8_t *iv = ivec; + while (len >= 16) { + (*block)(in, out, key); + for (n = 0; n < 16; n += sizeof(size_t)) { + store_word_le(out + n, load_word_le(out + n) ^ load_word_le(iv + n)); + } + iv = in; + len -= 16; + in += 16; + out += 16; + } + OPENSSL_memcpy(ivec, iv, 16); + } else { + OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be evenly divided into words"); + + while (len >= 16) { + (*block)(in, tmp.c, key); + for (n = 0; n < 16; n += sizeof(size_t)) { + size_t c = load_word_le(in + n); + store_word_le(out + n, + tmp.t[n / sizeof(size_t)] ^ load_word_le(ivec + n)); + store_word_le(ivec + n, c); + } + len -= 16; + in += 16; + out += 16; + } + } + + while (len) { + uint8_t c; + (*block)(in, tmp.c, key); + for (n = 0; n < 16 && n < len; ++n) { + c = in[n]; + out[n] = tmp.c[n] ^ ivec[n]; + ivec[n] = c; + } + if (len <= 16) { + for (; n < 16; ++n) { + ivec[n] = in[n]; + } + break; + } + len -= 16; + in += 16; + out += 16; + } +} diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cfb.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c similarity index 84% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cfb.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c index a32e3153c..497e5e025 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cfb.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c @@ -54,13 +54,12 @@ #include "internal.h" -OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_cfb); +OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be divided into size_t"); void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, int enc, block128_f block) { - size_t l = 0; - assert(in && out && key && ivec && num); unsigned n = *num; @@ -71,21 +70,6 @@ void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, --len; n = (n + 1) % 16; } -#if STRICT_ALIGNMENT - if (((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (l < len) { - if (n == 0) { - (*block)(ivec, ivec, key); - } - out[l] = ivec[n] ^= in[l]; - ++l; - n = (n + 1) % 16; - } - *num = n; - return; - } -#endif while (len >= 16) { (*block)(ivec, ivec, key); for (; n < 16; n += sizeof(size_t)) { @@ -115,22 +99,6 @@ void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, --len; n = (n + 1) % 16; } - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (l < len) { - uint8_t c; - if (n == 0) { - (*block)(ivec, ivec, key); - } - out[l] = ivec[n] ^ (c = in[l]); - ivec[n] = c; - ++l; - n = (n + 1) % 16; - } - *num = n; - return; - } while (len >= 16) { (*block)(ivec, ivec, key); for (; n < 16; n += sizeof(size_t)) { @@ -161,7 +129,7 @@ void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, /* This expects a single block of size nbits for both in and out. Note that it corrupts any extra bits in the last byte of out */ static void cfbr_encrypt_block(const uint8_t *in, uint8_t *out, unsigned nbits, - const void *key, uint8_t ivec[16], int enc, + const AES_KEY *key, uint8_t ivec[16], int enc, block128_f block) { int n, rem, num; uint8_t ovec[16 * 2 + 1]; /* +1 because we dererefence (but don't use) one @@ -203,8 +171,8 @@ static void cfbr_encrypt_block(const uint8_t *in, uint8_t *out, unsigned nbits, // N.B. This expects the input to be packed, MS bit first void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block) { + const AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block) { size_t n; uint8_t c[1], d[1]; @@ -220,7 +188,7 @@ void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, } void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const void *key, + size_t length, const AES_KEY *key, unsigned char ivec[16], unsigned *num, int enc, block128_f block) { size_t n; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cfb.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c.grpc_back similarity index 84% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cfb.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c.grpc_back index e1b0a80e0..8ca900416 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/cfb.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/cfb.c.grpc_back @@ -54,13 +54,12 @@ #include "internal.h" -OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_cfb); +OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be divided into size_t"); void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, int enc, block128_f block) { - size_t l = 0; - assert(in && out && key && ivec && num); unsigned n = *num; @@ -71,21 +70,6 @@ void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, --len; n = (n + 1) % 16; } -#if STRICT_ALIGNMENT - if (((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (l < len) { - if (n == 0) { - (*block)(ivec, ivec, key); - } - out[l] = ivec[n] ^= in[l]; - ++l; - n = (n + 1) % 16; - } - *num = n; - return; - } -#endif while (len >= 16) { (*block)(ivec, ivec, key); for (; n < 16; n += sizeof(size_t)) { @@ -115,22 +99,6 @@ void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, --len; n = (n + 1) % 16; } - if (STRICT_ALIGNMENT && - ((uintptr_t)in | (uintptr_t)out | (uintptr_t)ivec) % sizeof(size_t) != - 0) { - while (l < len) { - uint8_t c; - if (n == 0) { - (*block)(ivec, ivec, key); - } - out[l] = ivec[n] ^ (c = in[l]); - ivec[n] = c; - ++l; - n = (n + 1) % 16; - } - *num = n; - return; - } while (len >= 16) { (*block)(ivec, ivec, key); for (; n < 16; n += sizeof(size_t)) { @@ -161,7 +129,7 @@ void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, /* This expects a single block of size nbits for both in and out. Note that it corrupts any extra bits in the last byte of out */ static void cfbr_encrypt_block(const uint8_t *in, uint8_t *out, unsigned nbits, - const void *key, uint8_t ivec[16], int enc, + const AES_KEY *key, uint8_t ivec[16], int enc, block128_f block) { int n, rem, num; uint8_t ovec[16 * 2 + 1]; /* +1 because we dererefence (but don't use) one @@ -203,8 +171,8 @@ static void cfbr_encrypt_block(const uint8_t *in, uint8_t *out, unsigned nbits, // N.B. This expects the input to be packed, MS bit first void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, - const void *key, uint8_t ivec[16], unsigned *num, - int enc, block128_f block) { + const AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block) { size_t n; uint8_t c[1], d[1]; @@ -220,7 +188,7 @@ void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, } void CRYPTO_cfb128_8_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const void *key, + size_t length, const AES_KEY *key, unsigned char ivec[16], unsigned *num, int enc, block128_f block) { size_t n; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ctr.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ctr.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c index d996388dd..ebbfad41d 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ctr.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c @@ -69,7 +69,8 @@ static void ctr128_inc(uint8_t *counter) { } while (n); } -OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_ctr); +OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be divided into size_t"); // The input encrypted as though 128bit counter mode is being used. The extra // state information to record how much of the 128bit block we have used is @@ -82,7 +83,7 @@ OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_ctr); // of the IV. This implementation takes NO responsibility for checking that // the counter doesn't overflow into the rest of the IV when incremented. void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], + const AES_KEY *key, uint8_t ivec[16], uint8_t ecount_buf[16], unsigned int *num, block128_f block) { unsigned int n; @@ -98,26 +99,6 @@ void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, --len; n = (n + 1) % 16; } - -#if STRICT_ALIGNMENT - if (((uintptr_t)in | (uintptr_t)out | - (uintptr_t)ecount_buf) % sizeof(size_t) != 0) { - size_t l = 0; - while (l < len) { - if (n == 0) { - (*block)(ivec, ecount_buf, key); - ctr128_inc(ivec); - } - out[l] = in[l] ^ ecount_buf[n]; - ++l; - n = (n + 1) % 16; - } - - *num = n; - return; - } -#endif - while (len >= 16) { (*block)(ivec, ecount_buf, key); ctr128_inc(ivec); @@ -153,11 +134,10 @@ static void ctr96_inc(uint8_t *counter) { } while (n); } -void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, - size_t len, const void *key, - uint8_t ivec[16], - uint8_t ecount_buf[16], - unsigned int *num, ctr128_f func) { +void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned int *num, + ctr128_f func) { unsigned int n, ctr32; assert(key && ecount_buf && num); diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ctr.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ctr.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c.grpc_back index 63907b43a..8b0e05947 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ctr.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ctr.c.grpc_back @@ -69,7 +69,8 @@ static void ctr128_inc(uint8_t *counter) { } while (n); } -OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_ctr); +OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be divided into size_t"); // The input encrypted as though 128bit counter mode is being used. The extra // state information to record how much of the 128bit block we have used is @@ -82,7 +83,7 @@ OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_ctr); // of the IV. This implementation takes NO responsibility for checking that // the counter doesn't overflow into the rest of the IV when incremented. void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], + const AES_KEY *key, uint8_t ivec[16], uint8_t ecount_buf[16], unsigned int *num, block128_f block) { unsigned int n; @@ -98,26 +99,6 @@ void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, --len; n = (n + 1) % 16; } - -#if STRICT_ALIGNMENT - if (((uintptr_t)in | (uintptr_t)out | - (uintptr_t)ecount_buf) % sizeof(size_t) != 0) { - size_t l = 0; - while (l < len) { - if (n == 0) { - (*block)(ivec, ecount_buf, key); - ctr128_inc(ivec); - } - out[l] = in[l] ^ ecount_buf[n]; - ++l; - n = (n + 1) % 16; - } - - *num = n; - return; - } -#endif - while (len >= 16) { (*block)(ivec, ecount_buf, key); ctr128_inc(ivec); @@ -153,11 +134,10 @@ static void ctr96_inc(uint8_t *counter) { } while (n); } -void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, - size_t len, const void *key, - uint8_t ivec[16], - uint8_t ecount_buf[16], - unsigned int *num, ctr128_f func) { +void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned int *num, + ctr128_f func) { unsigned int n, ctr32; assert(key && ecount_buf && num); diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c new file mode 100644 index 000000000..b8e56762a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c @@ -0,0 +1,729 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include +#include + +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four +// bits of a |size_t|. +static const size_t kSizeTWithoutLower4Bits = (size_t) -16; + + +#define GCM_MUL(ctx, Xi) gcm_gmult_nohw((ctx)->Xi.u, (ctx)->gcm_key.Htable) +#define GHASH(ctx, in, len) \ + gcm_ghash_nohw((ctx)->Xi.u, (ctx)->gcm_key.Htable, in, len) +// GHASH_CHUNK is "stride parameter" missioned to mitigate cache +// trashing effect. In other words idea is to hash data while it's +// still in L1 cache after encryption pass... +#define GHASH_CHUNK (3 * 1024) + +#if defined(GHASH_ASM_X86_64) || defined(GHASH_ASM_X86) +static inline void gcm_reduce_1bit(u128 *V) { + if (sizeof(size_t) == 8) { + uint64_t T = UINT64_C(0xe100000000000000) & (0 - (V->hi & 1)); + V->hi = (V->lo << 63) | (V->hi >> 1); + V->lo = (V->lo >> 1) ^ T; + } else { + uint32_t T = 0xe1000000U & (0 - (uint32_t)(V->hi & 1)); + V->hi = (V->lo << 63) | (V->hi >> 1); + V->lo = (V->lo >> 1) ^ ((uint64_t)T << 32); + } +} + +void gcm_init_ssse3(u128 Htable[16], const uint64_t H[2]) { + Htable[0].hi = 0; + Htable[0].lo = 0; + u128 V; + V.hi = H[1]; + V.lo = H[0]; + + Htable[8] = V; + gcm_reduce_1bit(&V); + Htable[4] = V; + gcm_reduce_1bit(&V); + Htable[2] = V; + gcm_reduce_1bit(&V); + Htable[1] = V; + Htable[3].hi = V.hi ^ Htable[2].hi, Htable[3].lo = V.lo ^ Htable[2].lo; + V = Htable[4]; + Htable[5].hi = V.hi ^ Htable[1].hi, Htable[5].lo = V.lo ^ Htable[1].lo; + Htable[6].hi = V.hi ^ Htable[2].hi, Htable[6].lo = V.lo ^ Htable[2].lo; + Htable[7].hi = V.hi ^ Htable[3].hi, Htable[7].lo = V.lo ^ Htable[3].lo; + V = Htable[8]; + Htable[9].hi = V.hi ^ Htable[1].hi, Htable[9].lo = V.lo ^ Htable[1].lo; + Htable[10].hi = V.hi ^ Htable[2].hi, Htable[10].lo = V.lo ^ Htable[2].lo; + Htable[11].hi = V.hi ^ Htable[3].hi, Htable[11].lo = V.lo ^ Htable[3].lo; + Htable[12].hi = V.hi ^ Htable[4].hi, Htable[12].lo = V.lo ^ Htable[4].lo; + Htable[13].hi = V.hi ^ Htable[5].hi, Htable[13].lo = V.lo ^ Htable[5].lo; + Htable[14].hi = V.hi ^ Htable[6].hi, Htable[14].lo = V.lo ^ Htable[6].lo; + Htable[15].hi = V.hi ^ Htable[7].hi, Htable[15].lo = V.lo ^ Htable[7].lo; + + // Treat |Htable| as a 16x16 byte table and transpose it. Thus, Htable[i] + // contains the i'th byte of j*H for all j. + uint8_t *Hbytes = (uint8_t *)Htable; + for (int i = 0; i < 16; i++) { + for (int j = 0; j < i; j++) { + uint8_t tmp = Hbytes[16*i + j]; + Hbytes[16*i + j] = Hbytes[16*j + i]; + Hbytes[16*j + i] = tmp; + } + } +} +#endif // GHASH_ASM_X86_64 || GHASH_ASM_X86 + +#ifdef GCM_FUNCREF +#undef GCM_MUL +#define GCM_MUL(ctx, Xi) (*gcm_gmult_p)((ctx)->Xi.u, (ctx)->gcm_key.Htable) +#undef GHASH +#define GHASH(ctx, in, len) \ + (*gcm_ghash_p)((ctx)->Xi.u, (ctx)->gcm_key.Htable, in, len) +#endif // GCM_FUNCREF + +void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, + u128 *out_key, u128 out_table[16], int *out_is_avx, + const uint8_t gcm_key[16]) { + *out_is_avx = 0; + + union { + uint64_t u[2]; + uint8_t c[16]; + } H; + + OPENSSL_memcpy(H.c, gcm_key, 16); + + // H is stored in host byte order + H.u[0] = CRYPTO_bswap8(H.u[0]); + H.u[1] = CRYPTO_bswap8(H.u[1]); + + OPENSSL_memcpy(out_key, H.c, 16); + +#if defined(GHASH_ASM_X86_64) + if (crypto_gcm_clmul_enabled()) { + if (((OPENSSL_ia32cap_get()[1] >> 22) & 0x41) == 0x41) { // AVX+MOVBE + gcm_init_avx(out_table, H.u); + *out_mult = gcm_gmult_avx; + *out_hash = gcm_ghash_avx; + *out_is_avx = 1; + return; + } + gcm_init_clmul(out_table, H.u); + *out_mult = gcm_gmult_clmul; + *out_hash = gcm_ghash_clmul; + return; + } + if (gcm_ssse3_capable()) { + gcm_init_ssse3(out_table, H.u); + *out_mult = gcm_gmult_ssse3; + *out_hash = gcm_ghash_ssse3; + return; + } +#elif defined(GHASH_ASM_X86) + if (crypto_gcm_clmul_enabled()) { + gcm_init_clmul(out_table, H.u); + *out_mult = gcm_gmult_clmul; + *out_hash = gcm_ghash_clmul; + return; + } + if (gcm_ssse3_capable()) { + gcm_init_ssse3(out_table, H.u); + *out_mult = gcm_gmult_ssse3; + *out_hash = gcm_ghash_ssse3; + return; + } +#elif defined(GHASH_ASM_ARM) + if (gcm_pmull_capable()) { + gcm_init_v8(out_table, H.u); + *out_mult = gcm_gmult_v8; + *out_hash = gcm_ghash_v8; + return; + } + + if (gcm_neon_capable()) { + gcm_init_neon(out_table, H.u); + *out_mult = gcm_gmult_neon; + *out_hash = gcm_ghash_neon; + return; + } +#elif defined(GHASH_ASM_PPC64LE) + if (CRYPTO_is_PPC64LE_vcrypto_capable()) { + gcm_init_p8(out_table, H.u); + *out_mult = gcm_gmult_p8; + *out_hash = gcm_ghash_p8; + return; + } +#endif + + gcm_init_nohw(out_table, H.u); + *out_mult = gcm_gmult_nohw; + *out_hash = gcm_ghash_nohw; +} + +void CRYPTO_gcm128_init_key(GCM128_KEY *gcm_key, const AES_KEY *aes_key, + block128_f block, int block_is_hwaes) { + OPENSSL_memset(gcm_key, 0, sizeof(*gcm_key)); + gcm_key->block = block; + + uint8_t ghash_key[16]; + OPENSSL_memset(ghash_key, 0, sizeof(ghash_key)); + (*block)(ghash_key, ghash_key, aes_key); + + int is_avx; + CRYPTO_ghash_init(&gcm_key->gmult, &gcm_key->ghash, &gcm_key->H, + gcm_key->Htable, &is_avx, ghash_key); + + gcm_key->use_aesni_gcm_crypt = (is_avx && block_is_hwaes) ? 1 : 0; +} + +void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *iv, size_t len) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; +#endif + + ctx->Yi.u[0] = 0; + ctx->Yi.u[1] = 0; + ctx->Xi.u[0] = 0; + ctx->Xi.u[1] = 0; + ctx->len.u[0] = 0; // AAD length + ctx->len.u[1] = 0; // message length + ctx->ares = 0; + ctx->mres = 0; + + uint32_t ctr; + if (len == 12) { + OPENSSL_memcpy(ctx->Yi.c, iv, 12); + ctx->Yi.c[15] = 1; + ctr = 1; + } else { + uint64_t len0 = len; + + while (len >= 16) { + for (size_t i = 0; i < 16; ++i) { + ctx->Yi.c[i] ^= iv[i]; + } + GCM_MUL(ctx, Yi); + iv += 16; + len -= 16; + } + if (len) { + for (size_t i = 0; i < len; ++i) { + ctx->Yi.c[i] ^= iv[i]; + } + GCM_MUL(ctx, Yi); + } + len0 <<= 3; + ctx->Yi.u[1] ^= CRYPTO_bswap8(len0); + + GCM_MUL(ctx, Yi); + ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + } + + (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); +} + +int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + if (ctx->len.u[1]) { + return 0; + } + + uint64_t alen = ctx->len.u[0] + len; + if (alen > (UINT64_C(1) << 61) || (sizeof(len) == 8 && alen < len)) { + return 0; + } + ctx->len.u[0] = alen; + + unsigned n = ctx->ares; + if (n) { + while (n && len) { + ctx->Xi.c[n] ^= *(aad++); + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->ares = n; + return 1; + } + } + + // Process a whole number of blocks. + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + GHASH(ctx, aad, len_blocks); + aad += len_blocks; + len -= len_blocks; + } + + // Process the remainder. + if (len != 0) { + n = (unsigned int)len; + for (size_t i = 0; i < len; ++i) { + ctx->Xi.c[i] ^= aad[i]; + } + } + + ctx->ares = n; + return 1; +} + +int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *in, uint8_t *out, size_t len) { + block128_f block = ctx->gcm_key.block; +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to encrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + size_t j = GHASH_CHUNK; + + while (j) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + j -= 16; + } + GHASH(ctx, out - GHASH_CHUNK, GHASH_CHUNK); + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + while (len >= 16) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + len -= 16; + } + GHASH(ctx, out - len_blocks, len_blocks); + } + if (len) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key, + const unsigned char *in, unsigned char *out, + size_t len) { + block128_f block = ctx->gcm_key.block; +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to decrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + uint8_t c = *(in++); + *(out++) = c ^ ctx->EKi.c[n]; + ctx->Xi.c[n] ^= c; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + size_t j = GHASH_CHUNK; + + GHASH(ctx, in, GHASH_CHUNK); + while (j) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + j -= 16; + } + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + GHASH(ctx, in, len_blocks); + while (len >= 16) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + len -= 16; + } + } + if (len) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + uint8_t c = in[n]; + ctx->Xi.c[n] ^= c; + out[n] = c ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *in, uint8_t *out, size_t len, + ctr128_f stream) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to encrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + +#if defined(AESNI_GCM) + // Check |len| to work around a C language bug. See https://crbug.com/1019588. + if (ctx->gcm_key.use_aesni_gcm_crypt && len > 0) { + // |aesni_gcm_encrypt| may not process all the input given to it. It may + // not process *any* of its input if it is deemed too small. + size_t bulk = aesni_gcm_encrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); + in += bulk; + out += bulk; + len -= bulk; + } +#endif + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); + ctr += GHASH_CHUNK / 16; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + GHASH(ctx, out, GHASH_CHUNK); + out += GHASH_CHUNK; + in += GHASH_CHUNK; + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + size_t j = len_blocks / 16; + + (*stream)(in, out, j, key, ctx->Yi.c); + ctr += (unsigned int)j; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + in += len_blocks; + len -= len_blocks; + GHASH(ctx, out, len_blocks); + out += len_blocks; + } + if (len) { + (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *in, uint8_t *out, size_t len, + ctr128_f stream) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to decrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + uint8_t c = *(in++); + *(out++) = c ^ ctx->EKi.c[n]; + ctx->Xi.c[n] ^= c; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + +#if defined(AESNI_GCM) + // Check |len| to work around a C language bug. See https://crbug.com/1019588. + if (ctx->gcm_key.use_aesni_gcm_crypt && len > 0) { + // |aesni_gcm_decrypt| may not process all the input given to it. It may + // not process *any* of its input if it is deemed too small. + size_t bulk = aesni_gcm_decrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); + in += bulk; + out += bulk; + len -= bulk; + } +#endif + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + GHASH(ctx, in, GHASH_CHUNK); + (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); + ctr += GHASH_CHUNK / 16; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + out += GHASH_CHUNK; + in += GHASH_CHUNK; + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + size_t j = len_blocks / 16; + + GHASH(ctx, in, len_blocks); + (*stream)(in, out, j, key, ctx->Yi.c); + ctr += (unsigned int)j; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + out += len_blocks; + in += len_blocks; + len -= len_blocks; + } + if (len) { + (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + uint8_t c = in[n]; + ctx->Xi.c[n] ^= c; + out[n] = c ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; +#endif + + if (ctx->mres || ctx->ares) { + GCM_MUL(ctx, Xi); + } + + ctx->Xi.u[0] ^= CRYPTO_bswap8(ctx->len.u[0] << 3); + ctx->Xi.u[1] ^= CRYPTO_bswap8(ctx->len.u[1] << 3); + GCM_MUL(ctx, Xi); + + ctx->Xi.u[0] ^= ctx->EK0.u[0]; + ctx->Xi.u[1] ^= ctx->EK0.u[1]; + + if (tag && len <= sizeof(ctx->Xi)) { + return CRYPTO_memcmp(ctx->Xi.c, tag, len) == 0; + } else { + return 0; + } +} + +void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) { + CRYPTO_gcm128_finish(ctx, NULL, 0); + OPENSSL_memcpy(tag, ctx->Xi.c, + len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c)); +} + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +int crypto_gcm_clmul_enabled(void) { +#if defined(GHASH_ASM_X86) || defined(GHASH_ASM_X86_64) + const uint32_t *ia32cap = OPENSSL_ia32cap_get(); + return (ia32cap[0] & (1 << 24)) && // check FXSR bit + (ia32cap[1] & (1 << 1)); // check PCLMULQDQ bit +#else + return 0; +#endif +} +#endif diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c.grpc_back new file mode 100644 index 000000000..14fff868c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm.c.grpc_back @@ -0,0 +1,729 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#include + +#include +#include + +#include +#include + +#include "internal.h" +#include "../../internal.h" + + +// kSizeTWithoutLower4Bits is a mask that can be used to zero the lower four +// bits of a |size_t|. +static const size_t kSizeTWithoutLower4Bits = (size_t) -16; + + +#define GCM_MUL(ctx, Xi) gcm_gmult_nohw((ctx)->Xi.u, (ctx)->gcm_key.Htable) +#define GHASH(ctx, in, len) \ + gcm_ghash_nohw((ctx)->Xi.u, (ctx)->gcm_key.Htable, in, len) +// GHASH_CHUNK is "stride parameter" missioned to mitigate cache +// trashing effect. In other words idea is to hash data while it's +// still in L1 cache after encryption pass... +#define GHASH_CHUNK (3 * 1024) + +#if defined(GHASH_ASM_X86_64) || defined(GHASH_ASM_X86) +static inline void gcm_reduce_1bit(u128 *V) { + if (sizeof(size_t) == 8) { + uint64_t T = UINT64_C(0xe100000000000000) & (0 - (V->hi & 1)); + V->hi = (V->lo << 63) | (V->hi >> 1); + V->lo = (V->lo >> 1) ^ T; + } else { + uint32_t T = 0xe1000000U & (0 - (uint32_t)(V->hi & 1)); + V->hi = (V->lo << 63) | (V->hi >> 1); + V->lo = (V->lo >> 1) ^ ((uint64_t)T << 32); + } +} + +void gcm_init_ssse3(u128 Htable[16], const uint64_t H[2]) { + Htable[0].hi = 0; + Htable[0].lo = 0; + u128 V; + V.hi = H[1]; + V.lo = H[0]; + + Htable[8] = V; + gcm_reduce_1bit(&V); + Htable[4] = V; + gcm_reduce_1bit(&V); + Htable[2] = V; + gcm_reduce_1bit(&V); + Htable[1] = V; + Htable[3].hi = V.hi ^ Htable[2].hi, Htable[3].lo = V.lo ^ Htable[2].lo; + V = Htable[4]; + Htable[5].hi = V.hi ^ Htable[1].hi, Htable[5].lo = V.lo ^ Htable[1].lo; + Htable[6].hi = V.hi ^ Htable[2].hi, Htable[6].lo = V.lo ^ Htable[2].lo; + Htable[7].hi = V.hi ^ Htable[3].hi, Htable[7].lo = V.lo ^ Htable[3].lo; + V = Htable[8]; + Htable[9].hi = V.hi ^ Htable[1].hi, Htable[9].lo = V.lo ^ Htable[1].lo; + Htable[10].hi = V.hi ^ Htable[2].hi, Htable[10].lo = V.lo ^ Htable[2].lo; + Htable[11].hi = V.hi ^ Htable[3].hi, Htable[11].lo = V.lo ^ Htable[3].lo; + Htable[12].hi = V.hi ^ Htable[4].hi, Htable[12].lo = V.lo ^ Htable[4].lo; + Htable[13].hi = V.hi ^ Htable[5].hi, Htable[13].lo = V.lo ^ Htable[5].lo; + Htable[14].hi = V.hi ^ Htable[6].hi, Htable[14].lo = V.lo ^ Htable[6].lo; + Htable[15].hi = V.hi ^ Htable[7].hi, Htable[15].lo = V.lo ^ Htable[7].lo; + + // Treat |Htable| as a 16x16 byte table and transpose it. Thus, Htable[i] + // contains the i'th byte of j*H for all j. + uint8_t *Hbytes = (uint8_t *)Htable; + for (int i = 0; i < 16; i++) { + for (int j = 0; j < i; j++) { + uint8_t tmp = Hbytes[16*i + j]; + Hbytes[16*i + j] = Hbytes[16*j + i]; + Hbytes[16*j + i] = tmp; + } + } +} +#endif // GHASH_ASM_X86_64 || GHASH_ASM_X86 + +#ifdef GCM_FUNCREF +#undef GCM_MUL +#define GCM_MUL(ctx, Xi) (*gcm_gmult_p)((ctx)->Xi.u, (ctx)->gcm_key.Htable) +#undef GHASH +#define GHASH(ctx, in, len) \ + (*gcm_ghash_p)((ctx)->Xi.u, (ctx)->gcm_key.Htable, in, len) +#endif // GCM_FUNCREF + +void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, + u128 *out_key, u128 out_table[16], int *out_is_avx, + const uint8_t gcm_key[16]) { + *out_is_avx = 0; + + union { + uint64_t u[2]; + uint8_t c[16]; + } H; + + OPENSSL_memcpy(H.c, gcm_key, 16); + + // H is stored in host byte order + H.u[0] = CRYPTO_bswap8(H.u[0]); + H.u[1] = CRYPTO_bswap8(H.u[1]); + + OPENSSL_memcpy(out_key, H.c, 16); + +#if defined(GHASH_ASM_X86_64) + if (crypto_gcm_clmul_enabled()) { + if (((OPENSSL_ia32cap_get()[1] >> 22) & 0x41) == 0x41) { // AVX+MOVBE + gcm_init_avx(out_table, H.u); + *out_mult = gcm_gmult_avx; + *out_hash = gcm_ghash_avx; + *out_is_avx = 1; + return; + } + gcm_init_clmul(out_table, H.u); + *out_mult = gcm_gmult_clmul; + *out_hash = gcm_ghash_clmul; + return; + } + if (gcm_ssse3_capable()) { + gcm_init_ssse3(out_table, H.u); + *out_mult = gcm_gmult_ssse3; + *out_hash = gcm_ghash_ssse3; + return; + } +#elif defined(GHASH_ASM_X86) + if (crypto_gcm_clmul_enabled()) { + gcm_init_clmul(out_table, H.u); + *out_mult = gcm_gmult_clmul; + *out_hash = gcm_ghash_clmul; + return; + } + if (gcm_ssse3_capable()) { + gcm_init_ssse3(out_table, H.u); + *out_mult = gcm_gmult_ssse3; + *out_hash = gcm_ghash_ssse3; + return; + } +#elif defined(GHASH_ASM_ARM) + if (gcm_pmull_capable()) { + gcm_init_v8(out_table, H.u); + *out_mult = gcm_gmult_v8; + *out_hash = gcm_ghash_v8; + return; + } + + if (gcm_neon_capable()) { + gcm_init_neon(out_table, H.u); + *out_mult = gcm_gmult_neon; + *out_hash = gcm_ghash_neon; + return; + } +#elif defined(GHASH_ASM_PPC64LE) + if (CRYPTO_is_PPC64LE_vcrypto_capable()) { + gcm_init_p8(out_table, H.u); + *out_mult = gcm_gmult_p8; + *out_hash = gcm_ghash_p8; + return; + } +#endif + + gcm_init_nohw(out_table, H.u); + *out_mult = gcm_gmult_nohw; + *out_hash = gcm_ghash_nohw; +} + +void CRYPTO_gcm128_init_key(GCM128_KEY *gcm_key, const AES_KEY *aes_key, + block128_f block, int block_is_hwaes) { + OPENSSL_memset(gcm_key, 0, sizeof(*gcm_key)); + gcm_key->block = block; + + uint8_t ghash_key[16]; + OPENSSL_memset(ghash_key, 0, sizeof(ghash_key)); + (*block)(ghash_key, ghash_key, aes_key); + + int is_avx; + CRYPTO_ghash_init(&gcm_key->gmult, &gcm_key->ghash, &gcm_key->H, + gcm_key->Htable, &is_avx, ghash_key); + + gcm_key->use_aesni_gcm_crypt = (is_avx && block_is_hwaes) ? 1 : 0; +} + +void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *iv, size_t len) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; +#endif + + ctx->Yi.u[0] = 0; + ctx->Yi.u[1] = 0; + ctx->Xi.u[0] = 0; + ctx->Xi.u[1] = 0; + ctx->len.u[0] = 0; // AAD length + ctx->len.u[1] = 0; // message length + ctx->ares = 0; + ctx->mres = 0; + + uint32_t ctr; + if (len == 12) { + OPENSSL_memcpy(ctx->Yi.c, iv, 12); + ctx->Yi.c[15] = 1; + ctr = 1; + } else { + uint64_t len0 = len; + + while (len >= 16) { + for (size_t i = 0; i < 16; ++i) { + ctx->Yi.c[i] ^= iv[i]; + } + GCM_MUL(ctx, Yi); + iv += 16; + len -= 16; + } + if (len) { + for (size_t i = 0; i < len; ++i) { + ctx->Yi.c[i] ^= iv[i]; + } + GCM_MUL(ctx, Yi); + } + len0 <<= 3; + ctx->Yi.u[1] ^= CRYPTO_bswap8(len0); + + GCM_MUL(ctx, Yi); + ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + } + + (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EK0.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); +} + +int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, size_t len) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + if (ctx->len.u[1]) { + return 0; + } + + uint64_t alen = ctx->len.u[0] + len; + if (alen > (UINT64_C(1) << 61) || (sizeof(len) == 8 && alen < len)) { + return 0; + } + ctx->len.u[0] = alen; + + unsigned n = ctx->ares; + if (n) { + while (n && len) { + ctx->Xi.c[n] ^= *(aad++); + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->ares = n; + return 1; + } + } + + // Process a whole number of blocks. + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + GHASH(ctx, aad, len_blocks); + aad += len_blocks; + len -= len_blocks; + } + + // Process the remainder. + if (len != 0) { + n = (unsigned int)len; + for (size_t i = 0; i < len; ++i) { + ctx->Xi.c[i] ^= aad[i]; + } + } + + ctx->ares = n; + return 1; +} + +int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *in, uint8_t *out, size_t len) { + block128_f block = ctx->gcm_key.block; +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to encrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + size_t j = GHASH_CHUNK; + + while (j) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + j -= 16; + } + GHASH(ctx, out - GHASH_CHUNK, GHASH_CHUNK); + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + while (len >= 16) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + len -= 16; + } + GHASH(ctx, out - len_blocks, len_blocks); + } + if (len) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, const AES_KEY *key, + const unsigned char *in, unsigned char *out, + size_t len) { + block128_f block = ctx->gcm_key.block; +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to decrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + uint8_t c = *(in++); + *(out++) = c ^ ctx->EKi.c[n]; + ctx->Xi.c[n] ^= c; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + size_t j = GHASH_CHUNK; + + GHASH(ctx, in, GHASH_CHUNK); + while (j) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + j -= 16; + } + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + GHASH(ctx, in, len_blocks); + while (len >= 16) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + for (size_t i = 0; i < 16; i += sizeof(size_t)) { + store_word_le(out + i, + load_word_le(in + i) ^ ctx->EKi.t[i / sizeof(size_t)]); + } + out += 16; + in += 16; + len -= 16; + } + } + if (len) { + (*block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + uint8_t c = in[n]; + ctx->Xi.c[n] ^= c; + out[n] = c ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *in, uint8_t *out, size_t len, + ctr128_f stream) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to encrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + ctx->Xi.c[n] ^= *(out++) = *(in++) ^ ctx->EKi.c[n]; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + +#if defined(AESNI_GCM) + // Check |len| to work around a C language bug. See https://crbug.com/1019588. + if (ctx->gcm_key.use_aesni_gcm_crypt && len > 0) { + // |aesni_gcm_encrypt| may not process all the input given to it. It may + // not process *any* of its input if it is deemed too small. + size_t bulk = aesni_gcm_encrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); + in += bulk; + out += bulk; + len -= bulk; + } +#endif + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); + ctr += GHASH_CHUNK / 16; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + GHASH(ctx, out, GHASH_CHUNK); + out += GHASH_CHUNK; + in += GHASH_CHUNK; + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + size_t j = len_blocks / 16; + + (*stream)(in, out, j, key, ctx->Yi.c); + ctr += (unsigned int)j; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + in += len_blocks; + len -= len_blocks; + GHASH(ctx, out, len_blocks); + out += len_blocks; + } + if (len) { + (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + ctx->Xi.c[n] ^= out[n] = in[n] ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *in, uint8_t *out, size_t len, + ctr128_f stream) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; + void (*gcm_ghash_p)(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) = ctx->gcm_key.ghash; +#endif + + uint64_t mlen = ctx->len.u[1] + len; + if (mlen > ((UINT64_C(1) << 36) - 32) || + (sizeof(len) == 8 && mlen < len)) { + return 0; + } + ctx->len.u[1] = mlen; + + if (ctx->ares) { + // First call to decrypt finalizes GHASH(AAD) + GCM_MUL(ctx, Xi); + ctx->ares = 0; + } + + unsigned n = ctx->mres; + if (n) { + while (n && len) { + uint8_t c = *(in++); + *(out++) = c ^ ctx->EKi.c[n]; + ctx->Xi.c[n] ^= c; + --len; + n = (n + 1) % 16; + } + if (n == 0) { + GCM_MUL(ctx, Xi); + } else { + ctx->mres = n; + return 1; + } + } + +#if defined(AESNI_GCM) + // Check |len| to work around a C language bug. See https://crbug.com/1019588. + if (ctx->gcm_key.use_aesni_gcm_crypt && len > 0) { + // |aesni_gcm_decrypt| may not process all the input given to it. It may + // not process *any* of its input if it is deemed too small. + size_t bulk = aesni_gcm_decrypt(in, out, len, key, ctx->Yi.c, ctx->Xi.u); + in += bulk; + out += bulk; + len -= bulk; + } +#endif + + uint32_t ctr = CRYPTO_bswap4(ctx->Yi.d[3]); + while (len >= GHASH_CHUNK) { + GHASH(ctx, in, GHASH_CHUNK); + (*stream)(in, out, GHASH_CHUNK / 16, key, ctx->Yi.c); + ctr += GHASH_CHUNK / 16; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + out += GHASH_CHUNK; + in += GHASH_CHUNK; + len -= GHASH_CHUNK; + } + size_t len_blocks = len & kSizeTWithoutLower4Bits; + if (len_blocks != 0) { + size_t j = len_blocks / 16; + + GHASH(ctx, in, len_blocks); + (*stream)(in, out, j, key, ctx->Yi.c); + ctr += (unsigned int)j; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + out += len_blocks; + in += len_blocks; + len -= len_blocks; + } + if (len) { + (*ctx->gcm_key.block)(ctx->Yi.c, ctx->EKi.c, key); + ++ctr; + ctx->Yi.d[3] = CRYPTO_bswap4(ctr); + while (len--) { + uint8_t c = in[n]; + ctx->Xi.c[n] ^= c; + out[n] = c ^ ctx->EKi.c[n]; + ++n; + } + } + + ctx->mres = n; + return 1; +} + +int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, size_t len) { +#ifdef GCM_FUNCREF + void (*gcm_gmult_p)(uint64_t Xi[2], const u128 Htable[16]) = + ctx->gcm_key.gmult; +#endif + + if (ctx->mres || ctx->ares) { + GCM_MUL(ctx, Xi); + } + + ctx->Xi.u[0] ^= CRYPTO_bswap8(ctx->len.u[0] << 3); + ctx->Xi.u[1] ^= CRYPTO_bswap8(ctx->len.u[1] << 3); + GCM_MUL(ctx, Xi); + + ctx->Xi.u[0] ^= ctx->EK0.u[0]; + ctx->Xi.u[1] ^= ctx->EK0.u[1]; + + if (tag && len <= sizeof(ctx->Xi)) { + return CRYPTO_memcmp(ctx->Xi.c, tag, len) == 0; + } else { + return 0; + } +} + +void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, unsigned char *tag, size_t len) { + CRYPTO_gcm128_finish(ctx, NULL, 0); + OPENSSL_memcpy(tag, ctx->Xi.c, + len <= sizeof(ctx->Xi.c) ? len : sizeof(ctx->Xi.c)); +} + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +int crypto_gcm_clmul_enabled(void) { +#if defined(GHASH_ASM_X86) || defined(GHASH_ASM_X86_64) + const uint32_t *ia32cap = OPENSSL_ia32cap_get(); + return (ia32cap[0] & (1 << 24)) && // check FXSR bit + (ia32cap[1] & (1 << 1)); // check PCLMULQDQ bit +#else + return 0; +#endif +} +#endif diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c new file mode 100644 index 000000000..9eefd47e5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c @@ -0,0 +1,304 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include "../../internal.h" +#include "internal.h" + +#if !defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_SSE2) +#include +#endif + + +// This file contains a constant-time implementation of GHASH based on the notes +// in https://bearssl.org/constanttime.html#ghash-for-gcm and the reduction +// algorithm described in +// https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf. +// +// Unlike the BearSSL notes, we use uint128_t in the 64-bit implementation. Our +// primary compilers (clang, clang-cl, and gcc) all support it. MSVC will run +// the 32-bit implementation, but we can use its intrinsics if necessary. + +#if defined(BORINGSSL_HAS_UINT128) + +static void gcm_mul64_nohw(uint64_t *out_lo, uint64_t *out_hi, uint64_t a, + uint64_t b) { + // One term every four bits means the largest term is 64/4 = 16, which barely + // overflows into the next term. Using one term every five bits would cost 25 + // multiplications instead of 16. It is faster to mask off the bottom four + // bits of |a|, giving a largest term of 60/4 = 15, and apply the bottom bits + // separately. + uint64_t a0 = a & UINT64_C(0x1111111111111110); + uint64_t a1 = a & UINT64_C(0x2222222222222220); + uint64_t a2 = a & UINT64_C(0x4444444444444440); + uint64_t a3 = a & UINT64_C(0x8888888888888880); + + uint64_t b0 = b & UINT64_C(0x1111111111111111); + uint64_t b1 = b & UINT64_C(0x2222222222222222); + uint64_t b2 = b & UINT64_C(0x4444444444444444); + uint64_t b3 = b & UINT64_C(0x8888888888888888); + + uint128_t c0 = (a0 * (uint128_t)b0) ^ (a1 * (uint128_t)b3) ^ + (a2 * (uint128_t)b2) ^ (a3 * (uint128_t)b1); + uint128_t c1 = (a0 * (uint128_t)b1) ^ (a1 * (uint128_t)b0) ^ + (a2 * (uint128_t)b3) ^ (a3 * (uint128_t)b2); + uint128_t c2 = (a0 * (uint128_t)b2) ^ (a1 * (uint128_t)b1) ^ + (a2 * (uint128_t)b0) ^ (a3 * (uint128_t)b3); + uint128_t c3 = (a0 * (uint128_t)b3) ^ (a1 * (uint128_t)b2) ^ + (a2 * (uint128_t)b1) ^ (a3 * (uint128_t)b0); + + // Multiply the bottom four bits of |a| with |b|. + uint64_t a0_mask = UINT64_C(0) - (a & 1); + uint64_t a1_mask = UINT64_C(0) - ((a >> 1) & 1); + uint64_t a2_mask = UINT64_C(0) - ((a >> 2) & 1); + uint64_t a3_mask = UINT64_C(0) - ((a >> 3) & 1); + uint128_t extra = (a0_mask & b) ^ ((uint128_t)(a1_mask & b) << 1) ^ + ((uint128_t)(a2_mask & b) << 2) ^ + ((uint128_t)(a3_mask & b) << 3); + + *out_lo = (((uint64_t)c0) & UINT64_C(0x1111111111111111)) ^ + (((uint64_t)c1) & UINT64_C(0x2222222222222222)) ^ + (((uint64_t)c2) & UINT64_C(0x4444444444444444)) ^ + (((uint64_t)c3) & UINT64_C(0x8888888888888888)) ^ ((uint64_t)extra); + *out_hi = (((uint64_t)(c0 >> 64)) & UINT64_C(0x1111111111111111)) ^ + (((uint64_t)(c1 >> 64)) & UINT64_C(0x2222222222222222)) ^ + (((uint64_t)(c2 >> 64)) & UINT64_C(0x4444444444444444)) ^ + (((uint64_t)(c3 >> 64)) & UINT64_C(0x8888888888888888)) ^ + ((uint64_t)(extra >> 64)); +} + +#elif defined(OPENSSL_SSE2) + +static __m128i gcm_mul32_nohw(uint32_t a, uint32_t b) { + // One term every four bits means the largest term is 32/4 = 8, which does not + // overflow into the next term. + __m128i aa = _mm_setr_epi32(a, 0, a, 0); + __m128i bb = _mm_setr_epi32(b, 0, b, 0); + + __m128i a0a0 = + _mm_and_si128(aa, _mm_setr_epi32(0x11111111, 0, 0x11111111, 0)); + __m128i a2a2 = + _mm_and_si128(aa, _mm_setr_epi32(0x44444444, 0, 0x44444444, 0)); + __m128i b0b1 = + _mm_and_si128(bb, _mm_setr_epi32(0x11111111, 0, 0x22222222, 0)); + __m128i b2b3 = + _mm_and_si128(bb, _mm_setr_epi32(0x44444444, 0, 0x88888888, 0)); + + __m128i c0c1 = + _mm_xor_si128(_mm_mul_epu32(a0a0, b0b1), _mm_mul_epu32(a2a2, b2b3)); + __m128i c2c3 = + _mm_xor_si128(_mm_mul_epu32(a2a2, b0b1), _mm_mul_epu32(a0a0, b2b3)); + + __m128i a1a1 = + _mm_and_si128(aa, _mm_setr_epi32(0x22222222, 0, 0x22222222, 0)); + __m128i a3a3 = + _mm_and_si128(aa, _mm_setr_epi32(0x88888888, 0, 0x88888888, 0)); + __m128i b3b0 = + _mm_and_si128(bb, _mm_setr_epi32(0x88888888, 0, 0x11111111, 0)); + __m128i b1b2 = + _mm_and_si128(bb, _mm_setr_epi32(0x22222222, 0, 0x44444444, 0)); + + c0c1 = _mm_xor_si128(c0c1, _mm_mul_epu32(a1a1, b3b0)); + c0c1 = _mm_xor_si128(c0c1, _mm_mul_epu32(a3a3, b1b2)); + c2c3 = _mm_xor_si128(c2c3, _mm_mul_epu32(a3a3, b3b0)); + c2c3 = _mm_xor_si128(c2c3, _mm_mul_epu32(a1a1, b1b2)); + + c0c1 = _mm_and_si128( + c0c1, _mm_setr_epi32(0x11111111, 0x11111111, 0x22222222, 0x22222222)); + c2c3 = _mm_and_si128( + c2c3, _mm_setr_epi32(0x44444444, 0x44444444, 0x88888888, 0x88888888)); + + c0c1 = _mm_xor_si128(c0c1, c2c3); + // c0 ^= c1 + c0c1 = _mm_xor_si128(c0c1, _mm_srli_si128(c0c1, 8)); + return c0c1; +} + +static void gcm_mul64_nohw(uint64_t *out_lo, uint64_t *out_hi, uint64_t a, + uint64_t b) { + uint32_t a0 = a & 0xffffffff; + uint32_t a1 = a >> 32; + uint32_t b0 = b & 0xffffffff; + uint32_t b1 = b >> 32; + // Karatsuba multiplication. + __m128i lo = gcm_mul32_nohw(a0, b0); + __m128i hi = gcm_mul32_nohw(a1, b1); + __m128i mid = gcm_mul32_nohw(a0 ^ a1, b0 ^ b1); + mid = _mm_xor_si128(mid, lo); + mid = _mm_xor_si128(mid, hi); + __m128i ret = _mm_unpacklo_epi64(lo, hi); + mid = _mm_slli_si128(mid, 4); + mid = _mm_and_si128(mid, _mm_setr_epi32(0, 0xffffffff, 0xffffffff, 0)); + ret = _mm_xor_si128(ret, mid); + memcpy(out_lo, &ret, 8); + memcpy(out_hi, ((char*)&ret) + 8, 8); +} + +#else // !BORINGSSL_HAS_UINT128 && !OPENSSL_SSE2 + +static uint64_t gcm_mul32_nohw(uint32_t a, uint32_t b) { + // One term every four bits means the largest term is 32/4 = 8, which does not + // overflow into the next term. + uint32_t a0 = a & 0x11111111; + uint32_t a1 = a & 0x22222222; + uint32_t a2 = a & 0x44444444; + uint32_t a3 = a & 0x88888888; + + uint32_t b0 = b & 0x11111111; + uint32_t b1 = b & 0x22222222; + uint32_t b2 = b & 0x44444444; + uint32_t b3 = b & 0x88888888; + + uint64_t c0 = (a0 * (uint64_t)b0) ^ (a1 * (uint64_t)b3) ^ + (a2 * (uint64_t)b2) ^ (a3 * (uint64_t)b1); + uint64_t c1 = (a0 * (uint64_t)b1) ^ (a1 * (uint64_t)b0) ^ + (a2 * (uint64_t)b3) ^ (a3 * (uint64_t)b2); + uint64_t c2 = (a0 * (uint64_t)b2) ^ (a1 * (uint64_t)b1) ^ + (a2 * (uint64_t)b0) ^ (a3 * (uint64_t)b3); + uint64_t c3 = (a0 * (uint64_t)b3) ^ (a1 * (uint64_t)b2) ^ + (a2 * (uint64_t)b1) ^ (a3 * (uint64_t)b0); + + return (c0 & UINT64_C(0x1111111111111111)) | + (c1 & UINT64_C(0x2222222222222222)) | + (c2 & UINT64_C(0x4444444444444444)) | + (c3 & UINT64_C(0x8888888888888888)); +} + +static void gcm_mul64_nohw(uint64_t *out_lo, uint64_t *out_hi, uint64_t a, + uint64_t b) { + uint32_t a0 = a & 0xffffffff; + uint32_t a1 = a >> 32; + uint32_t b0 = b & 0xffffffff; + uint32_t b1 = b >> 32; + // Karatsuba multiplication. + uint64_t lo = gcm_mul32_nohw(a0, b0); + uint64_t hi = gcm_mul32_nohw(a1, b1); + uint64_t mid = gcm_mul32_nohw(a0 ^ a1, b0 ^ b1) ^ lo ^ hi; + *out_lo = lo ^ (mid << 32); + *out_hi = hi ^ (mid >> 32); +} + +#endif // BORINGSSL_HAS_UINT128 + +void gcm_init_nohw(u128 Htable[16], const uint64_t Xi[2]) { + // We implement GHASH in terms of POLYVAL, as described in RFC8452. This + // avoids a shift by 1 in the multiplication, needed to account for bit + // reversal losing a bit after multiplication, that is, + // rev128(X) * rev128(Y) = rev255(X*Y). + // + // Per Appendix A, we run mulX_POLYVAL. Note this is the same transformation + // applied by |gcm_init_clmul|, etc. Note |Xi| has already been byteswapped. + // + // See also slide 16 of + // https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf + Htable[0].lo = Xi[1]; + Htable[0].hi = Xi[0]; + + uint64_t carry = Htable[0].hi >> 63; + carry = 0u - carry; + + Htable[0].hi <<= 1; + Htable[0].hi |= Htable[0].lo >> 63; + Htable[0].lo <<= 1; + + // The irreducible polynomial is 1 + x^121 + x^126 + x^127 + x^128, so we + // conditionally add 0xc200...0001. + Htable[0].lo ^= carry & 1; + Htable[0].hi ^= carry & UINT64_C(0xc200000000000000); + + // This implementation does not use the rest of |Htable|. +} + +static void gcm_polyval_nohw(uint64_t Xi[2], const u128 *H) { + // Karatsuba multiplication. The product of |Xi| and |H| is stored in |r0| + // through |r3|. Note there is no byte or bit reversal because we are + // evaluating POLYVAL. + uint64_t r0, r1; + gcm_mul64_nohw(&r0, &r1, Xi[0], H->lo); + uint64_t r2, r3; + gcm_mul64_nohw(&r2, &r3, Xi[1], H->hi); + uint64_t mid0, mid1; + gcm_mul64_nohw(&mid0, &mid1, Xi[0] ^ Xi[1], H->hi ^ H->lo); + mid0 ^= r0 ^ r2; + mid1 ^= r1 ^ r3; + r2 ^= mid1; + r1 ^= mid0; + + // Now we multiply our 256-bit result by x^-128 and reduce. |r2| and + // |r3| shifts into position and we must multiply |r0| and |r1| by x^-128. We + // have: + // + // 1 = x^121 + x^126 + x^127 + x^128 + // x^-128 = x^-7 + x^-2 + x^-1 + 1 + // + // This is the GHASH reduction step, but with bits flowing in reverse. + + // The x^-7, x^-2, and x^-1 terms shift bits past x^0, which would require + // another reduction steps. Instead, we gather the excess bits, incorporate + // them into |r0| and |r1| and reduce once. See slides 17-19 + // of https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf. + r1 ^= (r0 << 63) ^ (r0 << 62) ^ (r0 << 57); + + // 1 + r2 ^= r0; + r3 ^= r1; + + // x^-1 + r2 ^= r0 >> 1; + r2 ^= r1 << 63; + r3 ^= r1 >> 1; + + // x^-2 + r2 ^= r0 >> 2; + r2 ^= r1 << 62; + r3 ^= r1 >> 2; + + // x^-7 + r2 ^= r0 >> 7; + r2 ^= r1 << 57; + r3 ^= r1 >> 7; + + Xi[0] = r2; + Xi[1] = r3; +} + +void gcm_gmult_nohw(uint64_t Xi[2], const u128 Htable[16]) { + uint64_t swapped[2]; + swapped[0] = CRYPTO_bswap8(Xi[1]); + swapped[1] = CRYPTO_bswap8(Xi[0]); + gcm_polyval_nohw(swapped, &Htable[0]); + Xi[0] = CRYPTO_bswap8(swapped[1]); + Xi[1] = CRYPTO_bswap8(swapped[0]); +} + +void gcm_ghash_nohw(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) { + uint64_t swapped[2]; + swapped[0] = CRYPTO_bswap8(Xi[1]); + swapped[1] = CRYPTO_bswap8(Xi[0]); + + while (len >= 16) { + uint64_t block[2]; + OPENSSL_memcpy(block, inp, 16); + swapped[0] ^= CRYPTO_bswap8(block[1]); + swapped[1] ^= CRYPTO_bswap8(block[0]); + gcm_polyval_nohw(swapped, &Htable[0]); + inp += 16; + len -= 16; + } + + Xi[0] = CRYPTO_bswap8(swapped[1]); + Xi[1] = CRYPTO_bswap8(swapped[0]); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c.grpc_back new file mode 100644 index 000000000..f8618b865 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/gcm_nohw.c.grpc_back @@ -0,0 +1,304 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include "../../internal.h" +#include "internal.h" + +#if !defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_SSE2) +#include +#endif + + +// This file contains a constant-time implementation of GHASH based on the notes +// in https://bearssl.org/constanttime.html#ghash-for-gcm and the reduction +// algorithm described in +// https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf. +// +// Unlike the BearSSL notes, we use uint128_t in the 64-bit implementation. Our +// primary compilers (clang, clang-cl, and gcc) all support it. MSVC will run +// the 32-bit implementation, but we can use its intrinsics if necessary. + +#if defined(BORINGSSL_HAS_UINT128) + +static void gcm_mul64_nohw(uint64_t *out_lo, uint64_t *out_hi, uint64_t a, + uint64_t b) { + // One term every four bits means the largest term is 64/4 = 16, which barely + // overflows into the next term. Using one term every five bits would cost 25 + // multiplications instead of 16. It is faster to mask off the bottom four + // bits of |a|, giving a largest term of 60/4 = 15, and apply the bottom bits + // separately. + uint64_t a0 = a & UINT64_C(0x1111111111111110); + uint64_t a1 = a & UINT64_C(0x2222222222222220); + uint64_t a2 = a & UINT64_C(0x4444444444444440); + uint64_t a3 = a & UINT64_C(0x8888888888888880); + + uint64_t b0 = b & UINT64_C(0x1111111111111111); + uint64_t b1 = b & UINT64_C(0x2222222222222222); + uint64_t b2 = b & UINT64_C(0x4444444444444444); + uint64_t b3 = b & UINT64_C(0x8888888888888888); + + uint128_t c0 = (a0 * (uint128_t)b0) ^ (a1 * (uint128_t)b3) ^ + (a2 * (uint128_t)b2) ^ (a3 * (uint128_t)b1); + uint128_t c1 = (a0 * (uint128_t)b1) ^ (a1 * (uint128_t)b0) ^ + (a2 * (uint128_t)b3) ^ (a3 * (uint128_t)b2); + uint128_t c2 = (a0 * (uint128_t)b2) ^ (a1 * (uint128_t)b1) ^ + (a2 * (uint128_t)b0) ^ (a3 * (uint128_t)b3); + uint128_t c3 = (a0 * (uint128_t)b3) ^ (a1 * (uint128_t)b2) ^ + (a2 * (uint128_t)b1) ^ (a3 * (uint128_t)b0); + + // Multiply the bottom four bits of |a| with |b|. + uint64_t a0_mask = UINT64_C(0) - (a & 1); + uint64_t a1_mask = UINT64_C(0) - ((a >> 1) & 1); + uint64_t a2_mask = UINT64_C(0) - ((a >> 2) & 1); + uint64_t a3_mask = UINT64_C(0) - ((a >> 3) & 1); + uint128_t extra = (a0_mask & b) ^ ((uint128_t)(a1_mask & b) << 1) ^ + ((uint128_t)(a2_mask & b) << 2) ^ + ((uint128_t)(a3_mask & b) << 3); + + *out_lo = (((uint64_t)c0) & UINT64_C(0x1111111111111111)) ^ + (((uint64_t)c1) & UINT64_C(0x2222222222222222)) ^ + (((uint64_t)c2) & UINT64_C(0x4444444444444444)) ^ + (((uint64_t)c3) & UINT64_C(0x8888888888888888)) ^ ((uint64_t)extra); + *out_hi = (((uint64_t)(c0 >> 64)) & UINT64_C(0x1111111111111111)) ^ + (((uint64_t)(c1 >> 64)) & UINT64_C(0x2222222222222222)) ^ + (((uint64_t)(c2 >> 64)) & UINT64_C(0x4444444444444444)) ^ + (((uint64_t)(c3 >> 64)) & UINT64_C(0x8888888888888888)) ^ + ((uint64_t)(extra >> 64)); +} + +#elif defined(OPENSSL_SSE2) + +static __m128i gcm_mul32_nohw(uint32_t a, uint32_t b) { + // One term every four bits means the largest term is 32/4 = 8, which does not + // overflow into the next term. + __m128i aa = _mm_setr_epi32(a, 0, a, 0); + __m128i bb = _mm_setr_epi32(b, 0, b, 0); + + __m128i a0a0 = + _mm_and_si128(aa, _mm_setr_epi32(0x11111111, 0, 0x11111111, 0)); + __m128i a2a2 = + _mm_and_si128(aa, _mm_setr_epi32(0x44444444, 0, 0x44444444, 0)); + __m128i b0b1 = + _mm_and_si128(bb, _mm_setr_epi32(0x11111111, 0, 0x22222222, 0)); + __m128i b2b3 = + _mm_and_si128(bb, _mm_setr_epi32(0x44444444, 0, 0x88888888, 0)); + + __m128i c0c1 = + _mm_xor_si128(_mm_mul_epu32(a0a0, b0b1), _mm_mul_epu32(a2a2, b2b3)); + __m128i c2c3 = + _mm_xor_si128(_mm_mul_epu32(a2a2, b0b1), _mm_mul_epu32(a0a0, b2b3)); + + __m128i a1a1 = + _mm_and_si128(aa, _mm_setr_epi32(0x22222222, 0, 0x22222222, 0)); + __m128i a3a3 = + _mm_and_si128(aa, _mm_setr_epi32(0x88888888, 0, 0x88888888, 0)); + __m128i b3b0 = + _mm_and_si128(bb, _mm_setr_epi32(0x88888888, 0, 0x11111111, 0)); + __m128i b1b2 = + _mm_and_si128(bb, _mm_setr_epi32(0x22222222, 0, 0x44444444, 0)); + + c0c1 = _mm_xor_si128(c0c1, _mm_mul_epu32(a1a1, b3b0)); + c0c1 = _mm_xor_si128(c0c1, _mm_mul_epu32(a3a3, b1b2)); + c2c3 = _mm_xor_si128(c2c3, _mm_mul_epu32(a3a3, b3b0)); + c2c3 = _mm_xor_si128(c2c3, _mm_mul_epu32(a1a1, b1b2)); + + c0c1 = _mm_and_si128( + c0c1, _mm_setr_epi32(0x11111111, 0x11111111, 0x22222222, 0x22222222)); + c2c3 = _mm_and_si128( + c2c3, _mm_setr_epi32(0x44444444, 0x44444444, 0x88888888, 0x88888888)); + + c0c1 = _mm_xor_si128(c0c1, c2c3); + // c0 ^= c1 + c0c1 = _mm_xor_si128(c0c1, _mm_srli_si128(c0c1, 8)); + return c0c1; +} + +static void gcm_mul64_nohw(uint64_t *out_lo, uint64_t *out_hi, uint64_t a, + uint64_t b) { + uint32_t a0 = a & 0xffffffff; + uint32_t a1 = a >> 32; + uint32_t b0 = b & 0xffffffff; + uint32_t b1 = b >> 32; + // Karatsuba multiplication. + __m128i lo = gcm_mul32_nohw(a0, b0); + __m128i hi = gcm_mul32_nohw(a1, b1); + __m128i mid = gcm_mul32_nohw(a0 ^ a1, b0 ^ b1); + mid = _mm_xor_si128(mid, lo); + mid = _mm_xor_si128(mid, hi); + __m128i ret = _mm_unpacklo_epi64(lo, hi); + mid = _mm_slli_si128(mid, 4); + mid = _mm_and_si128(mid, _mm_setr_epi32(0, 0xffffffff, 0xffffffff, 0)); + ret = _mm_xor_si128(ret, mid); + memcpy(out_lo, &ret, 8); + memcpy(out_hi, ((char*)&ret) + 8, 8); +} + +#else // !BORINGSSL_HAS_UINT128 && !OPENSSL_SSE2 + +static uint64_t gcm_mul32_nohw(uint32_t a, uint32_t b) { + // One term every four bits means the largest term is 32/4 = 8, which does not + // overflow into the next term. + uint32_t a0 = a & 0x11111111; + uint32_t a1 = a & 0x22222222; + uint32_t a2 = a & 0x44444444; + uint32_t a3 = a & 0x88888888; + + uint32_t b0 = b & 0x11111111; + uint32_t b1 = b & 0x22222222; + uint32_t b2 = b & 0x44444444; + uint32_t b3 = b & 0x88888888; + + uint64_t c0 = (a0 * (uint64_t)b0) ^ (a1 * (uint64_t)b3) ^ + (a2 * (uint64_t)b2) ^ (a3 * (uint64_t)b1); + uint64_t c1 = (a0 * (uint64_t)b1) ^ (a1 * (uint64_t)b0) ^ + (a2 * (uint64_t)b3) ^ (a3 * (uint64_t)b2); + uint64_t c2 = (a0 * (uint64_t)b2) ^ (a1 * (uint64_t)b1) ^ + (a2 * (uint64_t)b0) ^ (a3 * (uint64_t)b3); + uint64_t c3 = (a0 * (uint64_t)b3) ^ (a1 * (uint64_t)b2) ^ + (a2 * (uint64_t)b1) ^ (a3 * (uint64_t)b0); + + return (c0 & UINT64_C(0x1111111111111111)) | + (c1 & UINT64_C(0x2222222222222222)) | + (c2 & UINT64_C(0x4444444444444444)) | + (c3 & UINT64_C(0x8888888888888888)); +} + +static void gcm_mul64_nohw(uint64_t *out_lo, uint64_t *out_hi, uint64_t a, + uint64_t b) { + uint32_t a0 = a & 0xffffffff; + uint32_t a1 = a >> 32; + uint32_t b0 = b & 0xffffffff; + uint32_t b1 = b >> 32; + // Karatsuba multiplication. + uint64_t lo = gcm_mul32_nohw(a0, b0); + uint64_t hi = gcm_mul32_nohw(a1, b1); + uint64_t mid = gcm_mul32_nohw(a0 ^ a1, b0 ^ b1) ^ lo ^ hi; + *out_lo = lo ^ (mid << 32); + *out_hi = hi ^ (mid >> 32); +} + +#endif // BORINGSSL_HAS_UINT128 + +void gcm_init_nohw(u128 Htable[16], const uint64_t Xi[2]) { + // We implement GHASH in terms of POLYVAL, as described in RFC8452. This + // avoids a shift by 1 in the multiplication, needed to account for bit + // reversal losing a bit after multiplication, that is, + // rev128(X) * rev128(Y) = rev255(X*Y). + // + // Per Appendix A, we run mulX_POLYVAL. Note this is the same transformation + // applied by |gcm_init_clmul|, etc. Note |Xi| has already been byteswapped. + // + // See also slide 16 of + // https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf + Htable[0].lo = Xi[1]; + Htable[0].hi = Xi[0]; + + uint64_t carry = Htable[0].hi >> 63; + carry = 0u - carry; + + Htable[0].hi <<= 1; + Htable[0].hi |= Htable[0].lo >> 63; + Htable[0].lo <<= 1; + + // The irreducible polynomial is 1 + x^121 + x^126 + x^127 + x^128, so we + // conditionally add 0xc200...0001. + Htable[0].lo ^= carry & 1; + Htable[0].hi ^= carry & UINT64_C(0xc200000000000000); + + // This implementation does not use the rest of |Htable|. +} + +static void gcm_polyval_nohw(uint64_t Xi[2], const u128 *H) { + // Karatsuba multiplication. The product of |Xi| and |H| is stored in |r0| + // through |r3|. Note there is no byte or bit reversal because we are + // evaluating POLYVAL. + uint64_t r0, r1; + gcm_mul64_nohw(&r0, &r1, Xi[0], H->lo); + uint64_t r2, r3; + gcm_mul64_nohw(&r2, &r3, Xi[1], H->hi); + uint64_t mid0, mid1; + gcm_mul64_nohw(&mid0, &mid1, Xi[0] ^ Xi[1], H->hi ^ H->lo); + mid0 ^= r0 ^ r2; + mid1 ^= r1 ^ r3; + r2 ^= mid1; + r1 ^= mid0; + + // Now we multiply our 256-bit result by x^-128 and reduce. |r2| and + // |r3| shifts into position and we must multiply |r0| and |r1| by x^-128. We + // have: + // + // 1 = x^121 + x^126 + x^127 + x^128 + // x^-128 = x^-7 + x^-2 + x^-1 + 1 + // + // This is the GHASH reduction step, but with bits flowing in reverse. + + // The x^-7, x^-2, and x^-1 terms shift bits past x^0, which would require + // another reduction steps. Instead, we gather the excess bits, incorporate + // them into |r0| and |r1| and reduce once. See slides 17-19 + // of https://crypto.stanford.edu/RealWorldCrypto/slides/gueron.pdf. + r1 ^= (r0 << 63) ^ (r0 << 62) ^ (r0 << 57); + + // 1 + r2 ^= r0; + r3 ^= r1; + + // x^-1 + r2 ^= r0 >> 1; + r2 ^= r1 << 63; + r3 ^= r1 >> 1; + + // x^-2 + r2 ^= r0 >> 2; + r2 ^= r1 << 62; + r3 ^= r1 >> 2; + + // x^-7 + r2 ^= r0 >> 7; + r2 ^= r1 << 57; + r3 ^= r1 >> 7; + + Xi[0] = r2; + Xi[1] = r3; +} + +void gcm_gmult_nohw(uint64_t Xi[2], const u128 Htable[16]) { + uint64_t swapped[2]; + swapped[0] = CRYPTO_bswap8(Xi[1]); + swapped[1] = CRYPTO_bswap8(Xi[0]); + gcm_polyval_nohw(swapped, &Htable[0]); + Xi[0] = CRYPTO_bswap8(swapped[1]); + Xi[1] = CRYPTO_bswap8(swapped[0]); +} + +void gcm_ghash_nohw(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len) { + uint64_t swapped[2]; + swapped[0] = CRYPTO_bswap8(Xi[1]); + swapped[1] = CRYPTO_bswap8(Xi[0]); + + while (len >= 16) { + uint64_t block[2]; + OPENSSL_memcpy(block, inp, 16); + swapped[0] ^= CRYPTO_bswap8(block[1]); + swapped[1] ^= CRYPTO_bswap8(block[0]); + gcm_polyval_nohw(swapped, &Htable[0]); + inp += 16; + len -= 16; + } + + Xi[0] = CRYPTO_bswap8(swapped[1]); + Xi[1] = CRYPTO_bswap8(swapped[0]); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h new file mode 100644 index 000000000..98dd8abef --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h @@ -0,0 +1,441 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#ifndef OPENSSL_HEADER_MODES_INTERNAL_H +#define OPENSSL_HEADER_MODES_INTERNAL_H + +#include + +#include +#include + +#include +#include + +#include "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +static inline uint32_t GETU32(const void *in) { + uint32_t v; + OPENSSL_memcpy(&v, in, sizeof(v)); + return CRYPTO_bswap4(v); +} + +static inline void PUTU32(void *out, uint32_t v) { + v = CRYPTO_bswap4(v); + OPENSSL_memcpy(out, &v, sizeof(v)); +} + +static inline size_t load_word_le(const void *in) { + size_t v; + OPENSSL_memcpy(&v, in, sizeof(v)); + return v; +} + +static inline void store_word_le(void *out, size_t v) { + OPENSSL_memcpy(out, &v, sizeof(v)); +} + +// block128_f is the type of an AES block cipher implementation. +// +// Unlike upstream OpenSSL, it and the other functions in this file hard-code +// |AES_KEY|. It is undefined in C to call a function pointer with anything +// other than the original type. Thus we either must match |block128_f| to the +// type signature of |AES_encrypt| and friends or pass in |void*| wrapper +// functions. +// +// These functions are called exclusively with AES, so we use the former. +typedef void (*block128_f)(const uint8_t in[16], uint8_t out[16], + const AES_KEY *key); + + +// CTR. + +// ctr128_f is the type of a function that performs CTR-mode encryption. +typedef void (*ctr128_f)(const uint8_t *in, uint8_t *out, size_t blocks, + const AES_KEY *key, const uint8_t ivec[16]); + +// CRYPTO_ctr128_encrypt encrypts (or decrypts, it's the same in CTR mode) +// |len| bytes from |in| to |out| using |block| in counter mode. There's no +// requirement that |len| be a multiple of any value and any partial blocks are +// stored in |ecount_buf| and |*num|, which must be zeroed before the initial +// call. The counter is a 128-bit, big-endian value in |ivec| and is +// incremented by this function. +void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned *num, + block128_f block); + +// CRYPTO_ctr128_encrypt_ctr32 acts like |CRYPTO_ctr128_encrypt| but takes +// |ctr|, a function that performs CTR mode but only deals with the lower 32 +// bits of the counter. This is useful when |ctr| can be an optimised +// function. +void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned *num, + ctr128_f ctr); + + +// GCM. +// +// This API differs from the upstream API slightly. The |GCM128_CONTEXT| does +// not have a |key| pointer that points to the key as upstream's version does. +// Instead, every function takes a |key| parameter. This way |GCM128_CONTEXT| +// can be safely copied. Additionally, |gcm_key| is split into a separate +// struct. + +typedef struct { uint64_t hi,lo; } u128; + +// gmult_func multiplies |Xi| by the GCM key and writes the result back to +// |Xi|. +typedef void (*gmult_func)(uint64_t Xi[2], const u128 Htable[16]); + +// ghash_func repeatedly multiplies |Xi| by the GCM key and adds in blocks from +// |inp|. The result is written back to |Xi| and the |len| argument must be a +// multiple of 16. +typedef void (*ghash_func)(uint64_t Xi[2], const u128 Htable[16], + const uint8_t *inp, size_t len); + +typedef struct gcm128_key_st { + // Note the MOVBE-based, x86-64, GHASH assembly requires |H| and |Htable| to + // be the first two elements of this struct. Additionally, some assembly + // routines require a 16-byte-aligned |Htable| when hashing data, but not + // initialization. |GCM128_KEY| is not itself aligned to simplify embedding in + // |EVP_AEAD_CTX|, but |Htable|'s offset must be a multiple of 16. + u128 H; + u128 Htable[16]; + gmult_func gmult; + ghash_func ghash; + + block128_f block; + + // use_aesni_gcm_crypt is true if this context should use the assembly + // functions |aesni_gcm_encrypt| and |aesni_gcm_decrypt| to process data. + unsigned use_aesni_gcm_crypt:1; +} GCM128_KEY; + +// GCM128_CONTEXT contains state for a single GCM operation. The structure +// should be zero-initialized before use. +typedef struct { + // The following 5 names follow names in GCM specification + union { + uint64_t u[2]; + uint32_t d[4]; + uint8_t c[16]; + size_t t[16 / sizeof(size_t)]; + } Yi, EKi, EK0, len, Xi; + + // Note that the order of |Xi| and |gcm_key| is fixed by the MOVBE-based, + // x86-64, GHASH assembly. Additionally, some assembly routines require + // |gcm_key| to be 16-byte aligned. |GCM128_KEY| is not itself aligned to + // simplify embedding in |EVP_AEAD_CTX|. + alignas(16) GCM128_KEY gcm_key; + + unsigned mres, ares; +} GCM128_CONTEXT; + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +// crypto_gcm_clmul_enabled returns one if the CLMUL implementation of GCM is +// used. +int crypto_gcm_clmul_enabled(void); +#endif + +// CRYPTO_ghash_init writes a precomputed table of powers of |gcm_key| to +// |out_table| and sets |*out_mult| and |*out_hash| to (potentially hardware +// accelerated) functions for performing operations in the GHASH field. If the +// AVX implementation was used |*out_is_avx| will be true. +void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, + u128 *out_key, u128 out_table[16], int *out_is_avx, + const uint8_t gcm_key[16]); + +// CRYPTO_gcm128_init_key initialises |gcm_key| to use |block| (typically AES) +// with the given key. |block_is_hwaes| is one if |block| is |aes_hw_encrypt|. +OPENSSL_EXPORT void CRYPTO_gcm128_init_key(GCM128_KEY *gcm_key, + const AES_KEY *key, block128_f block, + int block_is_hwaes); + +// CRYPTO_gcm128_setiv sets the IV (nonce) for |ctx|. The |key| must be the +// same key that was passed to |CRYPTO_gcm128_init|. +OPENSSL_EXPORT void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *iv, size_t iv_len); + +// CRYPTO_gcm128_aad sets the authenticated data for an instance of GCM. +// This must be called before and data is encrypted. It returns one on success +// and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, + size_t len); + +// CRYPTO_gcm128_encrypt encrypts |len| bytes from |in| to |out|. The |key| +// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one +// on success and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, + const AES_KEY *key, const uint8_t *in, + uint8_t *out, size_t len); + +// CRYPTO_gcm128_decrypt decrypts |len| bytes from |in| to |out|. The |key| +// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one +// on success and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, + const AES_KEY *key, const uint8_t *in, + uint8_t *out, size_t len); + +// CRYPTO_gcm128_encrypt_ctr32 encrypts |len| bytes from |in| to |out| using +// a CTR function that only handles the bottom 32 bits of the nonce, like +// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was +// passed to |CRYPTO_gcm128_init|. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, + const AES_KEY *key, + const uint8_t *in, uint8_t *out, + size_t len, ctr128_f stream); + +// CRYPTO_gcm128_decrypt_ctr32 decrypts |len| bytes from |in| to |out| using +// a CTR function that only handles the bottom 32 bits of the nonce, like +// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was +// passed to |CRYPTO_gcm128_init|. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, + const AES_KEY *key, + const uint8_t *in, uint8_t *out, + size_t len, ctr128_f stream); + +// CRYPTO_gcm128_finish calculates the authenticator and compares it against +// |len| bytes of |tag|. It returns one on success and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, + size_t len); + +// CRYPTO_gcm128_tag calculates the authenticator and copies it into |tag|. +// The minimum of |len| and 16 bytes are copied into |tag|. +OPENSSL_EXPORT void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, uint8_t *tag, + size_t len); + + +// GCM assembly. + +void gcm_init_nohw(u128 Htable[16], const uint64_t H[2]); +void gcm_gmult_nohw(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_nohw(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +#if !defined(OPENSSL_NO_ASM) + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +#define GCM_FUNCREF +void gcm_init_clmul(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_clmul(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_clmul(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +OPENSSL_INLINE char gcm_ssse3_capable(void) { + return (OPENSSL_ia32cap_get()[1] & (1 << (41 - 32))) != 0; +} + +// |gcm_gmult_ssse3| and |gcm_ghash_ssse3| require |Htable| to be +// 16-byte-aligned, but |gcm_init_ssse3| does not. +void gcm_init_ssse3(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_ssse3(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_ssse3(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, + size_t len); + +#if defined(OPENSSL_X86_64) +#define GHASH_ASM_X86_64 +void gcm_init_avx(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_avx(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, + size_t len); + +#define AESNI_GCM +size_t aesni_gcm_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], uint64_t *Xi); +size_t aesni_gcm_decrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], uint64_t *Xi); +#endif // OPENSSL_X86_64 + +#if defined(OPENSSL_X86) +#define GHASH_ASM_X86 +#endif // OPENSSL_X86 + +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) +#define GHASH_ASM_ARM +#define GCM_FUNCREF + +OPENSSL_INLINE int gcm_pmull_capable(void) { + return CRYPTO_is_ARMv8_PMULL_capable(); +} + +void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +OPENSSL_INLINE int gcm_neon_capable(void) { return CRYPTO_is_NEON_capable(); } + +void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +#elif defined(OPENSSL_PPC64LE) +#define GHASH_ASM_PPC64LE +#define GCM_FUNCREF +void gcm_init_p8(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_p8(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_p8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); +#endif +#endif // OPENSSL_NO_ASM + + +// CBC. + +// cbc128_f is the type of a function that performs CBC-mode encryption. +typedef void (*cbc128_f)(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], int enc); + +// CRYPTO_cbc128_encrypt encrypts |len| bytes from |in| to |out| using the +// given IV and block cipher in CBC mode. The input need not be a multiple of +// 128 bits long, but the output will round up to the nearest 128 bit multiple, +// zero padding the input if needed. The IV will be updated on return. +void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block); + +// CRYPTO_cbc128_decrypt decrypts |len| bytes from |in| to |out| using the +// given IV and block cipher in CBC mode. If |len| is not a multiple of 128 +// bits then only that many bytes will be written, but a multiple of 128 bits +// is always read from |in|. The IV will be updated on return. +void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block); + + +// OFB. + +// CRYPTO_ofb128_encrypt encrypts (or decrypts, it's the same with OFB mode) +// |len| bytes from |in| to |out| using |block| in OFB mode. There's no +// requirement that |len| be a multiple of any value and any partial blocks are +// stored in |ivec| and |*num|, the latter must be zero before the initial +// call. +void CRYPTO_ofb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, + block128_f block); + + +// CFB. + +// CRYPTO_cfb128_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes +// from |in| to |out| using |block| in CFB mode. There's no requirement that +// |len| be a multiple of any value and any partial blocks are stored in |ivec| +// and |*num|, the latter must be zero before the initial call. +void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, + int enc, block128_f block); + +// CRYPTO_cfb128_8_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes +// from |in| to |out| using |block| in CFB-8 mode. Prior to the first call +// |num| should be set to zero. +void CRYPTO_cfb128_8_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block); + +// CRYPTO_cfb128_1_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes +// from |in| to |out| using |block| in CFB-1 mode. Prior to the first call +// |num| should be set to zero. +void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, + const AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block); + +size_t CRYPTO_cts128_encrypt_block(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block); + + +// POLYVAL. +// +// POLYVAL is a polynomial authenticator that operates over a field very +// similar to the one that GHASH uses. See +// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02#section-3. + +typedef union { + uint64_t u[2]; + uint8_t c[16]; +} polyval_block; + +struct polyval_ctx { + // Note that the order of |S|, |H| and |Htable| is fixed by the MOVBE-based, + // x86-64, GHASH assembly. Additionally, some assembly routines require + // |Htable| to be 16-byte aligned. + polyval_block S; + u128 H; + alignas(16) u128 Htable[16]; + gmult_func gmult; + ghash_func ghash; +}; + +// CRYPTO_POLYVAL_init initialises |ctx| using |key|. +void CRYPTO_POLYVAL_init(struct polyval_ctx *ctx, const uint8_t key[16]); + +// CRYPTO_POLYVAL_update_blocks updates the accumulator in |ctx| given the +// blocks from |in|. Only a whole number of blocks can be processed so |in_len| +// must be a multiple of 16. +void CRYPTO_POLYVAL_update_blocks(struct polyval_ctx *ctx, const uint8_t *in, + size_t in_len); + +// CRYPTO_POLYVAL_finish writes the accumulator from |ctx| to |out|. +void CRYPTO_POLYVAL_finish(const struct polyval_ctx *ctx, uint8_t out[16]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_MODES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h.grpc_back new file mode 100644 index 000000000..2693fa65b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/internal.h.grpc_back @@ -0,0 +1,441 @@ +/* ==================================================================== + * Copyright (c) 2008 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== */ + +#ifndef OPENSSL_HEADER_MODES_INTERNAL_H +#define OPENSSL_HEADER_MODES_INTERNAL_H + +#include + +#include +#include + +#include +#include + +#include "../../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +static inline uint32_t GETU32(const void *in) { + uint32_t v; + OPENSSL_memcpy(&v, in, sizeof(v)); + return CRYPTO_bswap4(v); +} + +static inline void PUTU32(void *out, uint32_t v) { + v = CRYPTO_bswap4(v); + OPENSSL_memcpy(out, &v, sizeof(v)); +} + +static inline size_t load_word_le(const void *in) { + size_t v; + OPENSSL_memcpy(&v, in, sizeof(v)); + return v; +} + +static inline void store_word_le(void *out, size_t v) { + OPENSSL_memcpy(out, &v, sizeof(v)); +} + +// block128_f is the type of an AES block cipher implementation. +// +// Unlike upstream OpenSSL, it and the other functions in this file hard-code +// |AES_KEY|. It is undefined in C to call a function pointer with anything +// other than the original type. Thus we either must match |block128_f| to the +// type signature of |AES_encrypt| and friends or pass in |void*| wrapper +// functions. +// +// These functions are called exclusively with AES, so we use the former. +typedef void (*block128_f)(const uint8_t in[16], uint8_t out[16], + const AES_KEY *key); + + +// CTR. + +// ctr128_f is the type of a function that performs CTR-mode encryption. +typedef void (*ctr128_f)(const uint8_t *in, uint8_t *out, size_t blocks, + const AES_KEY *key, const uint8_t ivec[16]); + +// CRYPTO_ctr128_encrypt encrypts (or decrypts, it's the same in CTR mode) +// |len| bytes from |in| to |out| using |block| in counter mode. There's no +// requirement that |len| be a multiple of any value and any partial blocks are +// stored in |ecount_buf| and |*num|, which must be zeroed before the initial +// call. The counter is a 128-bit, big-endian value in |ivec| and is +// incremented by this function. +void CRYPTO_ctr128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned *num, + block128_f block); + +// CRYPTO_ctr128_encrypt_ctr32 acts like |CRYPTO_ctr128_encrypt| but takes +// |ctr|, a function that performs CTR mode but only deals with the lower 32 +// bits of the counter. This is useful when |ctr| can be an optimised +// function. +void CRYPTO_ctr128_encrypt_ctr32(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + uint8_t ecount_buf[16], unsigned *num, + ctr128_f ctr); + + +// GCM. +// +// This API differs from the upstream API slightly. The |GCM128_CONTEXT| does +// not have a |key| pointer that points to the key as upstream's version does. +// Instead, every function takes a |key| parameter. This way |GCM128_CONTEXT| +// can be safely copied. Additionally, |gcm_key| is split into a separate +// struct. + +typedef struct { uint64_t hi,lo; } u128; + +// gmult_func multiplies |Xi| by the GCM key and writes the result back to +// |Xi|. +typedef void (*gmult_func)(uint64_t Xi[2], const u128 Htable[16]); + +// ghash_func repeatedly multiplies |Xi| by the GCM key and adds in blocks from +// |inp|. The result is written back to |Xi| and the |len| argument must be a +// multiple of 16. +typedef void (*ghash_func)(uint64_t Xi[2], const u128 Htable[16], + const uint8_t *inp, size_t len); + +typedef struct gcm128_key_st { + // Note the MOVBE-based, x86-64, GHASH assembly requires |H| and |Htable| to + // be the first two elements of this struct. Additionally, some assembly + // routines require a 16-byte-aligned |Htable| when hashing data, but not + // initialization. |GCM128_KEY| is not itself aligned to simplify embedding in + // |EVP_AEAD_CTX|, but |Htable|'s offset must be a multiple of 16. + u128 H; + u128 Htable[16]; + gmult_func gmult; + ghash_func ghash; + + block128_f block; + + // use_aesni_gcm_crypt is true if this context should use the assembly + // functions |aesni_gcm_encrypt| and |aesni_gcm_decrypt| to process data. + unsigned use_aesni_gcm_crypt:1; +} GCM128_KEY; + +// GCM128_CONTEXT contains state for a single GCM operation. The structure +// should be zero-initialized before use. +typedef struct { + // The following 5 names follow names in GCM specification + union { + uint64_t u[2]; + uint32_t d[4]; + uint8_t c[16]; + size_t t[16 / sizeof(size_t)]; + } Yi, EKi, EK0, len, Xi; + + // Note that the order of |Xi| and |gcm_key| is fixed by the MOVBE-based, + // x86-64, GHASH assembly. Additionally, some assembly routines require + // |gcm_key| to be 16-byte aligned. |GCM128_KEY| is not itself aligned to + // simplify embedding in |EVP_AEAD_CTX|. + alignas(16) GCM128_KEY gcm_key; + + unsigned mres, ares; +} GCM128_CONTEXT; + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +// crypto_gcm_clmul_enabled returns one if the CLMUL implementation of GCM is +// used. +int crypto_gcm_clmul_enabled(void); +#endif + +// CRYPTO_ghash_init writes a precomputed table of powers of |gcm_key| to +// |out_table| and sets |*out_mult| and |*out_hash| to (potentially hardware +// accelerated) functions for performing operations in the GHASH field. If the +// AVX implementation was used |*out_is_avx| will be true. +void CRYPTO_ghash_init(gmult_func *out_mult, ghash_func *out_hash, + u128 *out_key, u128 out_table[16], int *out_is_avx, + const uint8_t gcm_key[16]); + +// CRYPTO_gcm128_init_key initialises |gcm_key| to use |block| (typically AES) +// with the given key. |block_is_hwaes| is one if |block| is |aes_hw_encrypt|. +OPENSSL_EXPORT void CRYPTO_gcm128_init_key(GCM128_KEY *gcm_key, + const AES_KEY *key, block128_f block, + int block_is_hwaes); + +// CRYPTO_gcm128_setiv sets the IV (nonce) for |ctx|. The |key| must be the +// same key that was passed to |CRYPTO_gcm128_init|. +OPENSSL_EXPORT void CRYPTO_gcm128_setiv(GCM128_CONTEXT *ctx, const AES_KEY *key, + const uint8_t *iv, size_t iv_len); + +// CRYPTO_gcm128_aad sets the authenticated data for an instance of GCM. +// This must be called before and data is encrypted. It returns one on success +// and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_aad(GCM128_CONTEXT *ctx, const uint8_t *aad, + size_t len); + +// CRYPTO_gcm128_encrypt encrypts |len| bytes from |in| to |out|. The |key| +// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one +// on success and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_encrypt(GCM128_CONTEXT *ctx, + const AES_KEY *key, const uint8_t *in, + uint8_t *out, size_t len); + +// CRYPTO_gcm128_decrypt decrypts |len| bytes from |in| to |out|. The |key| +// must be the same key that was passed to |CRYPTO_gcm128_init|. It returns one +// on success and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_decrypt(GCM128_CONTEXT *ctx, + const AES_KEY *key, const uint8_t *in, + uint8_t *out, size_t len); + +// CRYPTO_gcm128_encrypt_ctr32 encrypts |len| bytes from |in| to |out| using +// a CTR function that only handles the bottom 32 bits of the nonce, like +// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was +// passed to |CRYPTO_gcm128_init|. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, + const AES_KEY *key, + const uint8_t *in, uint8_t *out, + size_t len, ctr128_f stream); + +// CRYPTO_gcm128_decrypt_ctr32 decrypts |len| bytes from |in| to |out| using +// a CTR function that only handles the bottom 32 bits of the nonce, like +// |CRYPTO_ctr128_encrypt_ctr32|. The |key| must be the same key that was +// passed to |CRYPTO_gcm128_init|. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, + const AES_KEY *key, + const uint8_t *in, uint8_t *out, + size_t len, ctr128_f stream); + +// CRYPTO_gcm128_finish calculates the authenticator and compares it against +// |len| bytes of |tag|. It returns one on success and zero otherwise. +OPENSSL_EXPORT int CRYPTO_gcm128_finish(GCM128_CONTEXT *ctx, const uint8_t *tag, + size_t len); + +// CRYPTO_gcm128_tag calculates the authenticator and copies it into |tag|. +// The minimum of |len| and 16 bytes are copied into |tag|. +OPENSSL_EXPORT void CRYPTO_gcm128_tag(GCM128_CONTEXT *ctx, uint8_t *tag, + size_t len); + + +// GCM assembly. + +void gcm_init_nohw(u128 Htable[16], const uint64_t H[2]); +void gcm_gmult_nohw(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_nohw(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +#if !defined(OPENSSL_NO_ASM) + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +#define GCM_FUNCREF +void gcm_init_clmul(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_clmul(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_clmul(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +OPENSSL_INLINE char gcm_ssse3_capable(void) { + return (OPENSSL_ia32cap_get()[1] & (1 << (41 - 32))) != 0; +} + +// |gcm_gmult_ssse3| and |gcm_ghash_ssse3| require |Htable| to be +// 16-byte-aligned, but |gcm_init_ssse3| does not. +void gcm_init_ssse3(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_ssse3(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_ssse3(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, + size_t len); + +#if defined(OPENSSL_X86_64) +#define GHASH_ASM_X86_64 +void gcm_init_avx(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_avx(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_avx(uint64_t Xi[2], const u128 Htable[16], const uint8_t *in, + size_t len); + +#define AESNI_GCM +size_t aesni_gcm_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], uint64_t *Xi); +size_t aesni_gcm_decrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], uint64_t *Xi); +#endif // OPENSSL_X86_64 + +#if defined(OPENSSL_X86) +#define GHASH_ASM_X86 +#endif // OPENSSL_X86 + +#elif defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) +#define GHASH_ASM_ARM +#define GCM_FUNCREF + +OPENSSL_INLINE int gcm_pmull_capable(void) { + return CRYPTO_is_ARMv8_PMULL_capable(); +} + +void gcm_init_v8(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_v8(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_v8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +OPENSSL_INLINE int gcm_neon_capable(void) { return CRYPTO_is_NEON_capable(); } + +void gcm_init_neon(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_neon(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_neon(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); + +#elif defined(OPENSSL_PPC64LE) +#define GHASH_ASM_PPC64LE +#define GCM_FUNCREF +void gcm_init_p8(u128 Htable[16], const uint64_t Xi[2]); +void gcm_gmult_p8(uint64_t Xi[2], const u128 Htable[16]); +void gcm_ghash_p8(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, + size_t len); +#endif +#endif // OPENSSL_NO_ASM + + +// CBC. + +// cbc128_f is the type of a function that performs CBC-mode encryption. +typedef void (*cbc128_f)(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], int enc); + +// CRYPTO_cbc128_encrypt encrypts |len| bytes from |in| to |out| using the +// given IV and block cipher in CBC mode. The input need not be a multiple of +// 128 bits long, but the output will round up to the nearest 128 bit multiple, +// zero padding the input if needed. The IV will be updated on return. +void CRYPTO_cbc128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block); + +// CRYPTO_cbc128_decrypt decrypts |len| bytes from |in| to |out| using the +// given IV and block cipher in CBC mode. If |len| is not a multiple of 128 +// bits then only that many bytes will be written, but a multiple of 128 bits +// is always read from |in|. The IV will be updated on return. +void CRYPTO_cbc128_decrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block); + + +// OFB. + +// CRYPTO_ofb128_encrypt encrypts (or decrypts, it's the same with OFB mode) +// |len| bytes from |in| to |out| using |block| in OFB mode. There's no +// requirement that |len| be a multiple of any value and any partial blocks are +// stored in |ivec| and |*num|, the latter must be zero before the initial +// call. +void CRYPTO_ofb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, + block128_f block); + + +// CFB. + +// CRYPTO_cfb128_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes +// from |in| to |out| using |block| in CFB mode. There's no requirement that +// |len| be a multiple of any value and any partial blocks are stored in |ivec| +// and |*num|, the latter must be zero before the initial call. +void CRYPTO_cfb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, + int enc, block128_f block); + +// CRYPTO_cfb128_8_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes +// from |in| to |out| using |block| in CFB-8 mode. Prior to the first call +// |num| should be set to zero. +void CRYPTO_cfb128_8_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block); + +// CRYPTO_cfb128_1_encrypt encrypts (or decrypts, if |enc| is zero) |len| bytes +// from |in| to |out| using |block| in CFB-1 mode. Prior to the first call +// |num| should be set to zero. +void CRYPTO_cfb128_1_encrypt(const uint8_t *in, uint8_t *out, size_t bits, + const AES_KEY *key, uint8_t ivec[16], + unsigned *num, int enc, block128_f block); + +size_t CRYPTO_cts128_encrypt_block(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t ivec[16], + block128_f block); + + +// POLYVAL. +// +// POLYVAL is a polynomial authenticator that operates over a field very +// similar to the one that GHASH uses. See +// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02#section-3. + +typedef union { + uint64_t u[2]; + uint8_t c[16]; +} polyval_block; + +struct polyval_ctx { + // Note that the order of |S|, |H| and |Htable| is fixed by the MOVBE-based, + // x86-64, GHASH assembly. Additionally, some assembly routines require + // |Htable| to be 16-byte aligned. + polyval_block S; + u128 H; + alignas(16) u128 Htable[16]; + gmult_func gmult; + ghash_func ghash; +}; + +// CRYPTO_POLYVAL_init initialises |ctx| using |key|. +void CRYPTO_POLYVAL_init(struct polyval_ctx *ctx, const uint8_t key[16]); + +// CRYPTO_POLYVAL_update_blocks updates the accumulator in |ctx| given the +// blocks from |in|. Only a whole number of blocks can be processed so |in_len| +// must be a multiple of 16. +void CRYPTO_POLYVAL_update_blocks(struct polyval_ctx *ctx, const uint8_t *in, + size_t in_len); + +// CRYPTO_POLYVAL_finish writes the accumulator from |ctx| to |out|. +void CRYPTO_POLYVAL_finish(const struct polyval_ctx *ctx, uint8_t out[16]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_MODES_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ofb.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ofb.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c index 203ca2663..bbd1d9c1f 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ofb.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c @@ -54,10 +54,11 @@ #include "internal.h" -OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_ofb); +OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be divided into size_t"); void CRYPTO_ofb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, block128_f block) { assert(in && out && key && ivec && num); diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ofb.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ofb.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c.grpc_back index 63bba68b0..4c70ce670 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/ofb.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/ofb.c.grpc_back @@ -54,10 +54,11 @@ #include "internal.h" -OPENSSL_COMPILE_ASSERT((16 % sizeof(size_t)) == 0, bad_size_t_size_ofb); +OPENSSL_STATIC_ASSERT(16 % sizeof(size_t) == 0, + "block cannot be divided into size_t"); void CRYPTO_ofb128_encrypt(const uint8_t *in, uint8_t *out, size_t len, - const void *key, uint8_t ivec[16], unsigned *num, + const AES_KEY *key, uint8_t ivec[16], unsigned *num, block128_f block) { assert(in && out && key && ivec && num); diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/polyval.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/polyval.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/polyval.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/modes/polyval.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/modes/polyval.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/ctrdrbg.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/ctrdrbg.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c index dcd27bd8a..ec3f321aa 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/ctrdrbg.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c @@ -64,8 +64,8 @@ int CTR_DRBG_init(CTR_DRBG_STATE *drbg, return 1; } -OPENSSL_COMPILE_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0, - not_a_multiple_of_block_size); +OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0, + "not a multiple of AES block size"); // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a // big-endian number. diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back index f2fe8b34b..b2fda1dad 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/ctrdrbg.c.grpc_back @@ -64,8 +64,8 @@ int CTR_DRBG_init(CTR_DRBG_STATE *drbg, return 1; } -OPENSSL_COMPILE_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0, - not_a_multiple_of_block_size); +OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN % AES_BLOCK_SIZE == 0, + "not a multiple of AES block size"); // ctr_inc adds |n| to the last four bytes of |drbg->counter|, treated as a // big-endian number. diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h new file mode 100644 index 000000000..fdce8990a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h @@ -0,0 +1,127 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H + +#include +#include + +#include "../../internal.h" +#include "../modes/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_FUCHSIA) && \ + !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) +#define OPENSSL_URANDOM +#endif + +// RAND_bytes_with_additional_data samples from the RNG after mixing 32 bytes +// from |user_additional_data| in. +void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, + const uint8_t user_additional_data[32]); + +// CRYPTO_sysrand fills |len| bytes at |buf| with entropy from the operating +// system. +void CRYPTO_sysrand(uint8_t *buf, size_t len); + +#if defined(OPENSSL_URANDOM) || defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +// CRYPTO_sysrand_for_seed fills |len| bytes at |buf| with entropy from the +// operating system. It may draw from the |GRND_RANDOM| pool on Android, +// depending on the vendor's configuration. +void CRYPTO_sysrand_for_seed(uint8_t *buf, size_t len); + +// CRYPTO_sysrand_if_available fills |len| bytes at |buf| with entropy from the +// operating system, if the entropy pool is initialized. If it is uninitialized, +// it will not block and will instead fill |buf| with all zeros or early +// /dev/urandom output. +void CRYPTO_sysrand_if_available(uint8_t *buf, size_t len); +#endif + +// rand_fork_unsafe_buffering_enabled returns whether fork-unsafe buffering has +// been enabled via |RAND_enable_fork_unsafe_buffering|. +int rand_fork_unsafe_buffering_enabled(void); + +// CTR_DRBG_STATE contains the state of a CTR_DRBG based on AES-256. See SP +// 800-90Ar1. +typedef struct { + AES_KEY ks; + block128_f block; + ctr128_f ctr; + union { + uint8_t bytes[16]; + uint32_t words[4]; + } counter; + uint64_t reseed_counter; +} CTR_DRBG_STATE; + +// See SP 800-90Ar1, table 3. +#define CTR_DRBG_ENTROPY_LEN 48 +#define CTR_DRBG_MAX_GENERATE_LENGTH 65536 + +// CTR_DRBG_init initialises |*drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of +// entropy in |entropy| and, optionally, a personalization string up to +// |CTR_DRBG_ENTROPY_LEN| bytes in length. It returns one on success and zero +// on error. +OPENSSL_EXPORT int CTR_DRBG_init(CTR_DRBG_STATE *drbg, + const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], + const uint8_t *personalization, + size_t personalization_len); + +// CTR_DRBG_reseed reseeds |drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of entropy +// in |entropy| and, optionally, up to |CTR_DRBG_ENTROPY_LEN| bytes of +// additional data. It returns one on success or zero on error. +OPENSSL_EXPORT int CTR_DRBG_reseed(CTR_DRBG_STATE *drbg, + const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], + const uint8_t *additional_data, + size_t additional_data_len); + +// CTR_DRBG_generate processes to up |CTR_DRBG_ENTROPY_LEN| bytes of additional +// data (if any) and then writes |out_len| random bytes to |out|, where +// |out_len| <= |CTR_DRBG_MAX_GENERATE_LENGTH|. It returns one on success or +// zero on error. +OPENSSL_EXPORT int CTR_DRBG_generate(CTR_DRBG_STATE *drbg, uint8_t *out, + size_t out_len, + const uint8_t *additional_data, + size_t additional_data_len); + +// CTR_DRBG_clear zeroises the state of |drbg|. +OPENSSL_EXPORT void CTR_DRBG_clear(CTR_DRBG_STATE *drbg); + + +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) +OPENSSL_INLINE int have_rdrand(void) { + return (OPENSSL_ia32cap_get()[1] & (1u << 30)) != 0; +} + +// CRYPTO_rdrand writes eight bytes of random data from the hardware RNG to +// |out|. It returns one on success or zero on hardware failure. +int CRYPTO_rdrand(uint8_t out[8]); + +// CRYPTO_rdrand_multiple8_buf fills |len| bytes at |buf| with random data from +// the hardware RNG. The |len| argument must be a multiple of eight. It returns +// one on success and zero on hardware failure. +int CRYPTO_rdrand_multiple8_buf(uint8_t *buf, size_t len); +#endif // OPENSSL_X86_64 && !OPENSSL_NO_ASM + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h.grpc_back new file mode 100644 index 000000000..280aae428 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/internal.h.grpc_back @@ -0,0 +1,127 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H + +#include +#include + +#include "../../internal.h" +#include "../modes/internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_FUCHSIA) && \ + !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) && !defined(OPENSSL_TRUSTY) +#define OPENSSL_URANDOM +#endif + +// RAND_bytes_with_additional_data samples from the RNG after mixing 32 bytes +// from |user_additional_data| in. +void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, + const uint8_t user_additional_data[32]); + +// CRYPTO_sysrand fills |len| bytes at |buf| with entropy from the operating +// system. +void CRYPTO_sysrand(uint8_t *buf, size_t len); + +#if defined(OPENSSL_URANDOM) || defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +// CRYPTO_sysrand_for_seed fills |len| bytes at |buf| with entropy from the +// operating system. It may draw from the |GRND_RANDOM| pool on Android, +// depending on the vendor's configuration. +void CRYPTO_sysrand_for_seed(uint8_t *buf, size_t len); + +// CRYPTO_sysrand_if_available fills |len| bytes at |buf| with entropy from the +// operating system, if the entropy pool is initialized. If it is uninitialized, +// it will not block and will instead fill |buf| with all zeros or early +// /dev/urandom output. +void CRYPTO_sysrand_if_available(uint8_t *buf, size_t len); +#endif + +// rand_fork_unsafe_buffering_enabled returns whether fork-unsafe buffering has +// been enabled via |RAND_enable_fork_unsafe_buffering|. +int rand_fork_unsafe_buffering_enabled(void); + +// CTR_DRBG_STATE contains the state of a CTR_DRBG based on AES-256. See SP +// 800-90Ar1. +typedef struct { + AES_KEY ks; + block128_f block; + ctr128_f ctr; + union { + uint8_t bytes[16]; + uint32_t words[4]; + } counter; + uint64_t reseed_counter; +} CTR_DRBG_STATE; + +// See SP 800-90Ar1, table 3. +#define CTR_DRBG_ENTROPY_LEN 48 +#define CTR_DRBG_MAX_GENERATE_LENGTH 65536 + +// CTR_DRBG_init initialises |*drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of +// entropy in |entropy| and, optionally, a personalization string up to +// |CTR_DRBG_ENTROPY_LEN| bytes in length. It returns one on success and zero +// on error. +OPENSSL_EXPORT int CTR_DRBG_init(CTR_DRBG_STATE *drbg, + const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], + const uint8_t *personalization, + size_t personalization_len); + +// CTR_DRBG_reseed reseeds |drbg| given |CTR_DRBG_ENTROPY_LEN| bytes of entropy +// in |entropy| and, optionally, up to |CTR_DRBG_ENTROPY_LEN| bytes of +// additional data. It returns one on success or zero on error. +OPENSSL_EXPORT int CTR_DRBG_reseed(CTR_DRBG_STATE *drbg, + const uint8_t entropy[CTR_DRBG_ENTROPY_LEN], + const uint8_t *additional_data, + size_t additional_data_len); + +// CTR_DRBG_generate processes to up |CTR_DRBG_ENTROPY_LEN| bytes of additional +// data (if any) and then writes |out_len| random bytes to |out|, where +// |out_len| <= |CTR_DRBG_MAX_GENERATE_LENGTH|. It returns one on success or +// zero on error. +OPENSSL_EXPORT int CTR_DRBG_generate(CTR_DRBG_STATE *drbg, uint8_t *out, + size_t out_len, + const uint8_t *additional_data, + size_t additional_data_len); + +// CTR_DRBG_clear zeroises the state of |drbg|. +OPENSSL_EXPORT void CTR_DRBG_clear(CTR_DRBG_STATE *drbg); + + +#if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) +OPENSSL_INLINE int have_rdrand(void) { + return (OPENSSL_ia32cap_get()[1] & (1u << 30)) != 0; +} + +// CRYPTO_rdrand writes eight bytes of random data from the hardware RNG to +// |out|. It returns one on success or zero on hardware failure. +int CRYPTO_rdrand(uint8_t out[8]); + +// CRYPTO_rdrand_multiple8_buf fills |len| bytes at |buf| with random data from +// the hardware RNG. The |len| argument must be a multiple of eight. It returns +// one on success and zero on hardware failure. +int CRYPTO_rdrand_multiple8_buf(uint8_t *buf, size_t len); +#endif // OPENSSL_X86_64 && !OPENSSL_NO_ASM + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_RAND_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/rand.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/rand.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c index 6b1f6d700..ad1e59b94 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/rand.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c @@ -32,9 +32,9 @@ // It's assumed that the operating system always has an unfailing source of -// entropy which is accessed via |CRYPTO_sysrand|. (If the operating system -// entropy source fails, it's up to |CRYPTO_sysrand| to abort the process—we -// don't try to handle it.) +// entropy which is accessed via |CRYPTO_sysrand[_for_seed]|. (If the operating +// system entropy source fails, it's up to |CRYPTO_sysrand| to abort the +// process—we don't try to handle it.) // // In addition, the hardware may provide a low-latency RNG. Intel's rdrand // instruction is the canonical example of this. When a hardware RNG is @@ -61,11 +61,11 @@ struct rand_thread_state { // (re)seeded. This is bound by |kReseedInterval|. unsigned calls; // last_block_valid is non-zero iff |last_block| contains data from - // |CRYPTO_sysrand|. + // |CRYPTO_sysrand_for_seed|. int last_block_valid; #if defined(BORINGSSL_FIPS) - // last_block contains the previous block from |CRYPTO_sysrand|. + // last_block contains the previous block from |CRYPTO_sysrand_for_seed|. uint8_t last_block[CRNGT_BLOCK_SIZE]; // next and prev form a NULL-terminated, double-linked list of all states in // a process. @@ -125,15 +125,6 @@ static void rand_thread_state_free(void *state_in) { #if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) - -// These functions are defined in asm/rdrand-x86_64.pl -extern int CRYPTO_rdrand(uint8_t out[8]); -extern int CRYPTO_rdrand_multiple8_buf(uint8_t *buf, size_t len); - -static int have_rdrand(void) { - return (OPENSSL_ia32cap_get()[1] & (1u << 30)) != 0; -} - static int hwrand(uint8_t *buf, const size_t len) { if (!have_rdrand()) { return 0; @@ -178,7 +169,7 @@ static void rand_get_seed(struct rand_thread_state *state, uint8_t seed[CTR_DRBG_ENTROPY_LEN]) { if (!state->last_block_valid) { if (!hwrand(state->last_block, sizeof(state->last_block))) { - CRYPTO_sysrand(state->last_block, sizeof(state->last_block)); + CRYPTO_sysrand_for_seed(state->last_block, sizeof(state->last_block)); } state->last_block_valid = 1; } @@ -188,15 +179,16 @@ static void rand_get_seed(struct rand_thread_state *state, #define FIPS_OVERREAD 10 uint8_t entropy[CTR_DRBG_ENTROPY_LEN * FIPS_OVERREAD]; - if (!hwrand(entropy, sizeof(entropy))) { - CRYPTO_sysrand(entropy, sizeof(entropy)); + int used_hwrand = hwrand(entropy, sizeof(entropy)); + if (!used_hwrand) { + CRYPTO_sysrand_for_seed(entropy, sizeof(entropy)); } // See FIPS 140-2, section 4.9.2. This is the “continuous random number // generator test” which causes the program to randomly abort. Hopefully the // rate of failure is small enough not to be a problem in practice. if (CRYPTO_memcmp(state->last_block, entropy, CRNGT_BLOCK_SIZE) == 0) { - printf("CRNGT failed.\n"); + fprintf(stderr, "CRNGT failed.\n"); BORINGSSL_FIPS_abort(); } @@ -204,7 +196,7 @@ static void rand_get_seed(struct rand_thread_state *state, i += CRNGT_BLOCK_SIZE) { if (CRYPTO_memcmp(entropy + i - CRNGT_BLOCK_SIZE, entropy + i, CRNGT_BLOCK_SIZE) == 0) { - printf("CRNGT failed.\n"); + fprintf(stderr, "CRNGT failed.\n"); BORINGSSL_FIPS_abort(); } } @@ -219,6 +211,17 @@ static void rand_get_seed(struct rand_thread_state *state, seed[j] ^= entropy[CTR_DRBG_ENTROPY_LEN * i + j]; } } + +#if defined(OPENSSL_URANDOM) + // If we used RDRAND, also opportunistically read from the system. This avoids + // solely relying on the hardware once the entropy pool has been initialized. + if (used_hwrand) { + CRYPTO_sysrand_if_available(entropy, CTR_DRBG_ENTROPY_LEN); + for (size_t i = 0; i < CTR_DRBG_ENTROPY_LEN; i++) { + seed[i] ^= entropy[i]; + } + } +#endif } #else @@ -334,6 +337,8 @@ void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, out += todo; out_len -= todo; + // Though we only check before entering the loop, this cannot add enough to + // overflow a |size_t|. state->calls++; first_call = 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/rand.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/rand.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c.grpc_back index dafc91f7f..87d7b30a0 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rand/rand.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/rand.c.grpc_back @@ -32,9 +32,9 @@ // It's assumed that the operating system always has an unfailing source of -// entropy which is accessed via |CRYPTO_sysrand|. (If the operating system -// entropy source fails, it's up to |CRYPTO_sysrand| to abort the process—we -// don't try to handle it.) +// entropy which is accessed via |CRYPTO_sysrand[_for_seed]|. (If the operating +// system entropy source fails, it's up to |CRYPTO_sysrand| to abort the +// process—we don't try to handle it.) // // In addition, the hardware may provide a low-latency RNG. Intel's rdrand // instruction is the canonical example of this. When a hardware RNG is @@ -61,11 +61,11 @@ struct rand_thread_state { // (re)seeded. This is bound by |kReseedInterval|. unsigned calls; // last_block_valid is non-zero iff |last_block| contains data from - // |CRYPTO_sysrand|. + // |CRYPTO_sysrand_for_seed|. int last_block_valid; #if defined(BORINGSSL_FIPS) - // last_block contains the previous block from |CRYPTO_sysrand|. + // last_block contains the previous block from |CRYPTO_sysrand_for_seed|. uint8_t last_block[CRNGT_BLOCK_SIZE]; // next and prev form a NULL-terminated, double-linked list of all states in // a process. @@ -125,15 +125,6 @@ static void rand_thread_state_free(void *state_in) { #if defined(OPENSSL_X86_64) && !defined(OPENSSL_NO_ASM) && \ !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) - -// These functions are defined in asm/rdrand-x86_64.pl -extern int CRYPTO_rdrand(uint8_t out[8]); -extern int CRYPTO_rdrand_multiple8_buf(uint8_t *buf, size_t len); - -static int have_rdrand(void) { - return (OPENSSL_ia32cap_get()[1] & (1u << 30)) != 0; -} - static int hwrand(uint8_t *buf, const size_t len) { if (!have_rdrand()) { return 0; @@ -178,7 +169,7 @@ static void rand_get_seed(struct rand_thread_state *state, uint8_t seed[CTR_DRBG_ENTROPY_LEN]) { if (!state->last_block_valid) { if (!hwrand(state->last_block, sizeof(state->last_block))) { - CRYPTO_sysrand(state->last_block, sizeof(state->last_block)); + CRYPTO_sysrand_for_seed(state->last_block, sizeof(state->last_block)); } state->last_block_valid = 1; } @@ -188,15 +179,16 @@ static void rand_get_seed(struct rand_thread_state *state, #define FIPS_OVERREAD 10 uint8_t entropy[CTR_DRBG_ENTROPY_LEN * FIPS_OVERREAD]; - if (!hwrand(entropy, sizeof(entropy))) { - CRYPTO_sysrand(entropy, sizeof(entropy)); + int used_hwrand = hwrand(entropy, sizeof(entropy)); + if (!used_hwrand) { + CRYPTO_sysrand_for_seed(entropy, sizeof(entropy)); } // See FIPS 140-2, section 4.9.2. This is the “continuous random number // generator test” which causes the program to randomly abort. Hopefully the // rate of failure is small enough not to be a problem in practice. if (CRYPTO_memcmp(state->last_block, entropy, CRNGT_BLOCK_SIZE) == 0) { - printf("CRNGT failed.\n"); + fprintf(stderr, "CRNGT failed.\n"); BORINGSSL_FIPS_abort(); } @@ -204,7 +196,7 @@ static void rand_get_seed(struct rand_thread_state *state, i += CRNGT_BLOCK_SIZE) { if (CRYPTO_memcmp(entropy + i - CRNGT_BLOCK_SIZE, entropy + i, CRNGT_BLOCK_SIZE) == 0) { - printf("CRNGT failed.\n"); + fprintf(stderr, "CRNGT failed.\n"); BORINGSSL_FIPS_abort(); } } @@ -219,6 +211,17 @@ static void rand_get_seed(struct rand_thread_state *state, seed[j] ^= entropy[CTR_DRBG_ENTROPY_LEN * i + j]; } } + +#if defined(OPENSSL_URANDOM) + // If we used RDRAND, also opportunistically read from the system. This avoids + // solely relying on the hardware once the entropy pool has been initialized. + if (used_hwrand) { + CRYPTO_sysrand_if_available(entropy, CTR_DRBG_ENTROPY_LEN); + for (size_t i = 0; i < CTR_DRBG_ENTROPY_LEN; i++) { + seed[i] ^= entropy[i]; + } + } +#endif } #else @@ -334,6 +337,8 @@ void RAND_bytes_with_additional_data(uint8_t *out, size_t out_len, out += todo; out_len -= todo; + // Though we only check before entering the loop, this cannot add enough to + // overflow a |size_t|. state->calls++; first_call = 0; } diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c new file mode 100644 index 000000000..e2aa36a24 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c @@ -0,0 +1,481 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#if !defined(_GNU_SOURCE) +#define _GNU_SOURCE // needed for syscall() on Linux. +#endif + +#include + +#include "internal.h" + +#if defined(OPENSSL_URANDOM) + +#include +#include +#include +#include +#include +#include + +#if defined(OPENSSL_LINUX) +#if defined(BORINGSSL_FIPS) +#include +#include +#endif +#include + +#if defined(OPENSSL_ANDROID) +#include +#endif + +#if !defined(OPENSSL_ANDROID) +#define OPENSSL_HAS_GETAUXVAL +#endif +// glibc prior to 2.16 does not have getauxval and sys/auxv.h. Android has some +// host builds (i.e. not building for Android itself, so |OPENSSL_ANDROID| is +// unset) which are still using a 2.15 sysroot. +// +// TODO(davidben): Remove this once Android updates their sysroot. +#if defined(__GLIBC_PREREQ) +#if !__GLIBC_PREREQ(2, 16) +#undef OPENSSL_HAS_GETAUXVAL +#endif +#endif +#if defined(OPENSSL_HAS_GETAUXVAL) +#include +#endif +#endif // OPENSSL_LINUX + +#if defined(OPENSSL_MACOS) +#include +#endif + +#include +#include + +#include "../delocate.h" +#include "../../internal.h" + + +#if defined(OPENSSL_LINUX) + +#if defined(OPENSSL_X86_64) +#define EXPECTED_NR_getrandom 318 +#elif defined(OPENSSL_X86) +#define EXPECTED_NR_getrandom 355 +#elif defined(OPENSSL_AARCH64) +#define EXPECTED_NR_getrandom 278 +#elif defined(OPENSSL_ARM) +#define EXPECTED_NR_getrandom 384 +#elif defined(OPENSSL_PPC64LE) +#define EXPECTED_NR_getrandom 359 +#endif + +#if defined(EXPECTED_NR_getrandom) +#define USE_NR_getrandom + +#if defined(__NR_getrandom) + +#if __NR_getrandom != EXPECTED_NR_getrandom +#error "system call number for getrandom is not the expected value" +#endif + +#else // __NR_getrandom + +#define __NR_getrandom EXPECTED_NR_getrandom + +#endif // __NR_getrandom + +#if defined(OPENSSL_MSAN) +void __msan_unpoison(void *, size_t); +#endif + +static ssize_t boringssl_getrandom(void *buf, size_t buf_len, unsigned flags) { + ssize_t ret; + do { + ret = syscall(__NR_getrandom, buf, buf_len, flags); + } while (ret == -1 && errno == EINTR); + +#if defined(OPENSSL_MSAN) + if (ret > 0) { + // MSAN doesn't recognise |syscall| and thus doesn't notice that we have + // initialised the output buffer. + __msan_unpoison(buf, ret); + } +#endif // OPENSSL_MSAN + + return ret; +} + +#endif // EXPECTED_NR_getrandom + +#if !defined(GRND_NONBLOCK) +#define GRND_NONBLOCK 1 +#endif +#if !defined(GRND_RANDOM) +#define GRND_RANDOM 2 +#endif + +#endif // OPENSSL_LINUX + +// rand_lock is used to protect the |*_requested| variables. +DEFINE_STATIC_MUTEX(rand_lock) + +// The following constants are magic values of |urandom_fd|. +static const int kUnset = 0; +static const int kHaveGetrandom = -3; + +// urandom_fd_requested is set by |RAND_set_urandom_fd|. It's protected by +// |rand_lock|. +DEFINE_BSS_GET(int, urandom_fd_requested) + +// urandom_fd is a file descriptor to /dev/urandom. It's protected by |once|. +DEFINE_BSS_GET(int, urandom_fd) + +#if defined(USE_NR_getrandom) + +// getrandom_ready is one if |getrandom| had been initialized by the time +// |init_once| was called and zero otherwise. +DEFINE_BSS_GET(int, getrandom_ready) + +// extra_getrandom_flags_for_seed contains a value that is ORed into the flags +// for getrandom() when reading entropy for a seed. +DEFINE_BSS_GET(int, extra_getrandom_flags_for_seed) + +// On Android, check a system property to decide whether to set +// |extra_getrandom_flags_for_seed| otherwise they will default to zero. If +// ro.oem_boringcrypto_hwrand is true then |extra_getrandom_flags_for_seed| will +// be set to GRND_RANDOM, causing all random data to be drawn from the same +// source as /dev/random. +static void maybe_set_extra_getrandom_flags(void) { +#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID) + char value[PROP_VALUE_MAX + 1]; + int length = __system_property_get("ro.boringcrypto.hwrand", value); + if (length < 0 || length > PROP_VALUE_MAX) { + return; + } + + value[length] = 0; + if (strcasecmp(value, "true") == 0) { + *extra_getrandom_flags_for_seed_bss_get() = GRND_RANDOM; + } +#endif +} + +#endif // USE_NR_getrandom + +DEFINE_STATIC_ONCE(rand_once) + +// init_once initializes the state of this module to values previously +// requested. This is the only function that modifies |urandom_fd| and +// |urandom_buffering|, whose values may be read safely after calling the +// once. +static void init_once(void) { + CRYPTO_STATIC_MUTEX_lock_read(rand_lock_bss_get()); + int fd = *urandom_fd_requested_bss_get(); + CRYPTO_STATIC_MUTEX_unlock_read(rand_lock_bss_get()); + +#if defined(USE_NR_getrandom) + int have_getrandom; + uint8_t dummy; + ssize_t getrandom_ret = + boringssl_getrandom(&dummy, sizeof(dummy), GRND_NONBLOCK); + if (getrandom_ret == 1) { + *getrandom_ready_bss_get() = 1; + have_getrandom = 1; + } else if (getrandom_ret == -1 && errno == EAGAIN) { + // We have getrandom, but the entropy pool has not been initialized yet. + have_getrandom = 1; + } else if (getrandom_ret == -1 && errno == ENOSYS) { + // Fallthrough to using /dev/urandom, below. + have_getrandom = 0; + } else { + // Other errors are fatal. + perror("getrandom"); + abort(); + } + + if (have_getrandom) { + *urandom_fd_bss_get() = kHaveGetrandom; + maybe_set_extra_getrandom_flags(); + return; + } +#endif // USE_NR_getrandom + +#if defined(OPENSSL_MACOS) + // getentropy is available in macOS 10.12 and up. iOS 10 and up may also + // support it, but the header is missing. See https://crbug.com/boringssl/287. + if (__builtin_available(macos 10.12, *)) { + *urandom_fd_bss_get() = kHaveGetrandom; + return; + } +#endif + + // Android FIPS builds must support getrandom. +#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID) + perror("getrandom not found"); + abort(); +#endif + + if (fd == kUnset) { + do { + fd = open("/dev/urandom", O_RDONLY); + } while (fd == -1 && errno == EINTR); + } + + if (fd < 0) { + perror("failed to open /dev/urandom"); + abort(); + } + + assert(kUnset == 0); + if (fd == kUnset) { + // Because we want to keep |urandom_fd| in the BSS, we have to initialise + // it to zero. But zero is a valid file descriptor too. Thus if open + // returns zero for /dev/urandom, we dup it to get a non-zero number. + fd = dup(fd); + close(kUnset); + + if (fd <= 0) { + perror("failed to dup /dev/urandom fd"); + abort(); + } + } + + int flags = fcntl(fd, F_GETFD); + if (flags == -1) { + // Native Client doesn't implement |fcntl|. + if (errno != ENOSYS) { + perror("failed to get flags from urandom fd"); + abort(); + } + } else { + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) { + perror("failed to set FD_CLOEXEC on urandom fd"); + abort(); + } + } + *urandom_fd_bss_get() = fd; +} + +DEFINE_STATIC_ONCE(wait_for_entropy_once) + +static void wait_for_entropy(void) { + int fd = *urandom_fd_bss_get(); + if (fd == kHaveGetrandom) { + // |getrandom| and |getentropy| support blocking in |fill_with_entropy| + // directly. For |getrandom|, we first probe with a non-blocking call to aid + // debugging. +#if defined(USE_NR_getrandom) + if (*getrandom_ready_bss_get()) { + // The entropy pool was already initialized in |init_once|. + return; + } + + uint8_t dummy; + ssize_t getrandom_ret = + boringssl_getrandom(&dummy, sizeof(dummy), GRND_NONBLOCK); + if (getrandom_ret == -1 && errno == EAGAIN) { + // Attempt to get the path of the current process to aid in debugging when + // something blocks. + const char *current_process = ""; +#if defined(OPENSSL_HAS_GETAUXVAL) + const unsigned long getauxval_ret = getauxval(AT_EXECFN); + if (getauxval_ret != 0) { + current_process = (const char *)getauxval_ret; + } +#endif + + fprintf( + stderr, + "%s: getrandom indicates that the entropy pool has not been " + "initialized. Rather than continue with poor entropy, this process " + "will block until entropy is available.\n", + current_process); + + getrandom_ret = + boringssl_getrandom(&dummy, sizeof(dummy), 0 /* no flags */); + } + + if (getrandom_ret != 1) { + perror("getrandom"); + abort(); + } +#endif // USE_NR_getrandom + return; + } + +#if defined(BORINGSSL_FIPS) + // In FIPS mode we ensure that the kernel has sufficient entropy before + // continuing. This is automatically handled by getrandom, which requires + // that the entropy pool has been initialised, but for urandom we have to + // poll. + for (;;) { + int entropy_bits; + if (ioctl(fd, RNDGETENTCNT, &entropy_bits)) { + fprintf(stderr, + "RNDGETENTCNT on /dev/urandom failed. We cannot continue in this " + "case when in FIPS mode.\n"); + abort(); + } + + static const int kBitsNeeded = 256; + if (entropy_bits >= kBitsNeeded) { + break; + } + + usleep(250000); + } +#endif // BORINGSSL_FIPS +} + +void RAND_set_urandom_fd(int fd) { + fd = dup(fd); + if (fd < 0) { + perror("failed to dup supplied urandom fd"); + abort(); + } + + assert(kUnset == 0); + if (fd == kUnset) { + // Because we want to keep |urandom_fd| in the BSS, we have to initialise + // it to zero. But zero is a valid file descriptor too. Thus if dup + // returned zero we dup it again to get a non-zero number. + fd = dup(fd); + close(kUnset); + + if (fd <= 0) { + perror("failed to dup supplied urandom fd"); + abort(); + } + } + + CRYPTO_STATIC_MUTEX_lock_write(rand_lock_bss_get()); + *urandom_fd_requested_bss_get() = fd; + CRYPTO_STATIC_MUTEX_unlock_write(rand_lock_bss_get()); + + CRYPTO_once(rand_once_bss_get(), init_once); + if (*urandom_fd_bss_get() == kHaveGetrandom) { + close(fd); + } else if (*urandom_fd_bss_get() != fd) { + fprintf(stderr, "RAND_set_urandom_fd called after initialisation.\n"); + abort(); + } +} + +// fill_with_entropy writes |len| bytes of entropy into |out|. It returns one +// on success and zero on error. If |block| is one, this function will block +// until the entropy pool is initialized. Otherwise, this function may fail, +// setting |errno| to |EAGAIN| if the entropy pool has not yet been initialized. +// If |seed| is one, this function will OR in the value of +// |*extra_getrandom_flags_for_seed()| when using |getrandom|. +static int fill_with_entropy(uint8_t *out, size_t len, int block, int seed) { + if (len == 0) { + return 1; + } + +#if defined(USE_NR_getrandom) + int getrandom_flags = 0; + if (!block) { + getrandom_flags |= GRND_NONBLOCK; + } + if (seed) { + getrandom_flags |= *extra_getrandom_flags_for_seed_bss_get(); + } +#endif + + CRYPTO_once(rand_once_bss_get(), init_once); + if (block) { + CRYPTO_once(wait_for_entropy_once_bss_get(), wait_for_entropy); + } + + // Clear |errno| so it has defined value if |read| or |getrandom| + // "successfully" returns zero. + errno = 0; + while (len > 0) { + ssize_t r; + + if (*urandom_fd_bss_get() == kHaveGetrandom) { +#if defined(USE_NR_getrandom) + r = boringssl_getrandom(out, len, getrandom_flags); +#elif defined(OPENSSL_MACOS) + if (__builtin_available(macos 10.12, *)) { + // |getentropy| can only request 256 bytes at a time. + size_t todo = len <= 256 ? len : 256; + if (getentropy(out, todo) != 0) { + r = -1; + } else { + r = (ssize_t)todo; + } + } else { + fprintf(stderr, "urandom fd corrupt.\n"); + abort(); + } +#else // USE_NR_getrandom + fprintf(stderr, "urandom fd corrupt.\n"); + abort(); +#endif + } else { + do { + r = read(*urandom_fd_bss_get(), out, len); + } while (r == -1 && errno == EINTR); + } + + if (r <= 0) { + return 0; + } + out += r; + len -= r; + } + + return 1; +} + +// CRYPTO_sysrand puts |requested| random bytes into |out|. +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + if (!fill_with_entropy(out, requested, /*block=*/1, /*seed=*/0)) { + perror("entropy fill failed"); + abort(); + } +} + +#if defined(BORINGSSL_FIPS) +void CRYPTO_sysrand_for_seed(uint8_t *out, size_t requested) { + if (!fill_with_entropy(out, requested, /*block=*/1, /*seed=*/1)) { + perror("entropy fill failed"); + abort(); + } + +#if defined(BORINGSSL_FIPS_BREAK_CRNG) + // This breaks the "continuous random number generator test" defined in FIPS + // 140-2, section 4.9.2, and implemented in rand_get_seed(). + OPENSSL_memset(out, 0, requested); +#endif +} + +void CRYPTO_sysrand_if_available(uint8_t *out, size_t requested) { + // Return all zeros if |fill_with_entropy| fails. + OPENSSL_memset(out, 0, requested); + + if (!fill_with_entropy(out, requested, /*block=*/0, /*seed=*/0) && + errno != EAGAIN) { + perror("opportunistic entropy fill failed"); + abort(); + } +} +#endif // BORINGSSL_FIPS + +#endif // OPENSSL_URANDOM diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c.grpc_back new file mode 100644 index 000000000..4a60eb2f8 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rand/urandom.c.grpc_back @@ -0,0 +1,481 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#if !defined(_GNU_SOURCE) +#define _GNU_SOURCE // needed for syscall() on Linux. +#endif + +#include + +#include "internal.h" + +#if defined(OPENSSL_URANDOM) + +#include +#include +#include +#include +#include +#include + +#if defined(OPENSSL_LINUX) +#if defined(BORINGSSL_FIPS) +#include +#include +#endif +#include + +#if defined(OPENSSL_ANDROID) +#include +#endif + +#if !defined(OPENSSL_ANDROID) +#define OPENSSL_HAS_GETAUXVAL +#endif +// glibc prior to 2.16 does not have getauxval and sys/auxv.h. Android has some +// host builds (i.e. not building for Android itself, so |OPENSSL_ANDROID| is +// unset) which are still using a 2.15 sysroot. +// +// TODO(davidben): Remove this once Android updates their sysroot. +#if defined(__GLIBC_PREREQ) +#if !__GLIBC_PREREQ(2, 16) +#undef OPENSSL_HAS_GETAUXVAL +#endif +#endif +#if defined(OPENSSL_HAS_GETAUXVAL) +#include +#endif +#endif // OPENSSL_LINUX + +#if defined(OPENSSL_MACOS) +#include +#endif + +#include +#include + +#include "../delocate.h" +#include "../../internal.h" + + +#if defined(OPENSSL_LINUX) + +#if defined(OPENSSL_X86_64) +#define EXPECTED_NR_getrandom 318 +#elif defined(OPENSSL_X86) +#define EXPECTED_NR_getrandom 355 +#elif defined(OPENSSL_AARCH64) +#define EXPECTED_NR_getrandom 278 +#elif defined(OPENSSL_ARM) +#define EXPECTED_NR_getrandom 384 +#elif defined(OPENSSL_PPC64LE) +#define EXPECTED_NR_getrandom 359 +#endif + +#if defined(EXPECTED_NR_getrandom) +#define USE_NR_getrandom + +#if defined(__NR_getrandom) + +#if __NR_getrandom != EXPECTED_NR_getrandom +#error "system call number for getrandom is not the expected value" +#endif + +#else // __NR_getrandom + +#define __NR_getrandom EXPECTED_NR_getrandom + +#endif // __NR_getrandom + +#if defined(OPENSSL_MSAN) +void __msan_unpoison(void *, size_t); +#endif + +static ssize_t boringssl_getrandom(void *buf, size_t buf_len, unsigned flags) { + ssize_t ret; + do { + ret = syscall(__NR_getrandom, buf, buf_len, flags); + } while (ret == -1 && errno == EINTR); + +#if defined(OPENSSL_MSAN) + if (ret > 0) { + // MSAN doesn't recognise |syscall| and thus doesn't notice that we have + // initialised the output buffer. + __msan_unpoison(buf, ret); + } +#endif // OPENSSL_MSAN + + return ret; +} + +#endif // EXPECTED_NR_getrandom + +#if !defined(GRND_NONBLOCK) +#define GRND_NONBLOCK 1 +#endif +#if !defined(GRND_RANDOM) +#define GRND_RANDOM 2 +#endif + +#endif // OPENSSL_LINUX + +// rand_lock is used to protect the |*_requested| variables. +DEFINE_STATIC_MUTEX(rand_lock) + +// The following constants are magic values of |urandom_fd|. +static const int kUnset = 0; +static const int kHaveGetrandom = -3; + +// urandom_fd_requested is set by |RAND_set_urandom_fd|. It's protected by +// |rand_lock|. +DEFINE_BSS_GET(int, urandom_fd_requested) + +// urandom_fd is a file descriptor to /dev/urandom. It's protected by |once|. +DEFINE_BSS_GET(int, urandom_fd) + +#if defined(USE_NR_getrandom) + +// getrandom_ready is one if |getrandom| had been initialized by the time +// |init_once| was called and zero otherwise. +DEFINE_BSS_GET(int, getrandom_ready) + +// extra_getrandom_flags_for_seed contains a value that is ORed into the flags +// for getrandom() when reading entropy for a seed. +DEFINE_BSS_GET(int, extra_getrandom_flags_for_seed) + +// On Android, check a system property to decide whether to set +// |extra_getrandom_flags_for_seed| otherwise they will default to zero. If +// ro.oem_boringcrypto_hwrand is true then |extra_getrandom_flags_for_seed| will +// be set to GRND_RANDOM, causing all random data to be drawn from the same +// source as /dev/random. +static void maybe_set_extra_getrandom_flags(void) { +#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID) + char value[PROP_VALUE_MAX + 1]; + int length = __system_property_get("ro.boringcrypto.hwrand", value); + if (length < 0 || length > PROP_VALUE_MAX) { + return; + } + + value[length] = 0; + if (strcasecmp(value, "true") == 0) { + *extra_getrandom_flags_for_seed_bss_get() = GRND_RANDOM; + } +#endif +} + +#endif // USE_NR_getrandom + +DEFINE_STATIC_ONCE(rand_once) + +// init_once initializes the state of this module to values previously +// requested. This is the only function that modifies |urandom_fd| and +// |urandom_buffering|, whose values may be read safely after calling the +// once. +static void init_once(void) { + CRYPTO_STATIC_MUTEX_lock_read(rand_lock_bss_get()); + int fd = *urandom_fd_requested_bss_get(); + CRYPTO_STATIC_MUTEX_unlock_read(rand_lock_bss_get()); + +#if defined(USE_NR_getrandom) + int have_getrandom; + uint8_t dummy; + ssize_t getrandom_ret = + boringssl_getrandom(&dummy, sizeof(dummy), GRND_NONBLOCK); + if (getrandom_ret == 1) { + *getrandom_ready_bss_get() = 1; + have_getrandom = 1; + } else if (getrandom_ret == -1 && errno == EAGAIN) { + // We have getrandom, but the entropy pool has not been initialized yet. + have_getrandom = 1; + } else if (getrandom_ret == -1 && errno == ENOSYS) { + // Fallthrough to using /dev/urandom, below. + have_getrandom = 0; + } else { + // Other errors are fatal. + perror("getrandom"); + abort(); + } + + if (have_getrandom) { + *urandom_fd_bss_get() = kHaveGetrandom; + maybe_set_extra_getrandom_flags(); + return; + } +#endif // USE_NR_getrandom + +#if defined(OPENSSL_MACOS) + // getentropy is available in macOS 10.12 and up. iOS 10 and up may also + // support it, but the header is missing. See https://crbug.com/boringssl/287. + if (__builtin_available(macos 10.12, *)) { + *urandom_fd_bss_get() = kHaveGetrandom; + return; + } +#endif + + // Android FIPS builds must support getrandom. +#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID) + perror("getrandom not found"); + abort(); +#endif + + if (fd == kUnset) { + do { + fd = open("/dev/urandom", O_RDONLY); + } while (fd == -1 && errno == EINTR); + } + + if (fd < 0) { + perror("failed to open /dev/urandom"); + abort(); + } + + assert(kUnset == 0); + if (fd == kUnset) { + // Because we want to keep |urandom_fd| in the BSS, we have to initialise + // it to zero. But zero is a valid file descriptor too. Thus if open + // returns zero for /dev/urandom, we dup it to get a non-zero number. + fd = dup(fd); + close(kUnset); + + if (fd <= 0) { + perror("failed to dup /dev/urandom fd"); + abort(); + } + } + + int flags = fcntl(fd, F_GETFD); + if (flags == -1) { + // Native Client doesn't implement |fcntl|. + if (errno != ENOSYS) { + perror("failed to get flags from urandom fd"); + abort(); + } + } else { + flags |= FD_CLOEXEC; + if (fcntl(fd, F_SETFD, flags) == -1) { + perror("failed to set FD_CLOEXEC on urandom fd"); + abort(); + } + } + *urandom_fd_bss_get() = fd; +} + +DEFINE_STATIC_ONCE(wait_for_entropy_once) + +static void wait_for_entropy(void) { + int fd = *urandom_fd_bss_get(); + if (fd == kHaveGetrandom) { + // |getrandom| and |getentropy| support blocking in |fill_with_entropy| + // directly. For |getrandom|, we first probe with a non-blocking call to aid + // debugging. +#if defined(USE_NR_getrandom) + if (*getrandom_ready_bss_get()) { + // The entropy pool was already initialized in |init_once|. + return; + } + + uint8_t dummy; + ssize_t getrandom_ret = + boringssl_getrandom(&dummy, sizeof(dummy), GRND_NONBLOCK); + if (getrandom_ret == -1 && errno == EAGAIN) { + // Attempt to get the path of the current process to aid in debugging when + // something blocks. + const char *current_process = ""; +#if defined(OPENSSL_HAS_GETAUXVAL) + const unsigned long getauxval_ret = getauxval(AT_EXECFN); + if (getauxval_ret != 0) { + current_process = (const char *)getauxval_ret; + } +#endif + + fprintf( + stderr, + "%s: getrandom indicates that the entropy pool has not been " + "initialized. Rather than continue with poor entropy, this process " + "will block until entropy is available.\n", + current_process); + + getrandom_ret = + boringssl_getrandom(&dummy, sizeof(dummy), 0 /* no flags */); + } + + if (getrandom_ret != 1) { + perror("getrandom"); + abort(); + } +#endif // USE_NR_getrandom + return; + } + +#if defined(BORINGSSL_FIPS) + // In FIPS mode we ensure that the kernel has sufficient entropy before + // continuing. This is automatically handled by getrandom, which requires + // that the entropy pool has been initialised, but for urandom we have to + // poll. + for (;;) { + int entropy_bits; + if (ioctl(fd, RNDGETENTCNT, &entropy_bits)) { + fprintf(stderr, + "RNDGETENTCNT on /dev/urandom failed. We cannot continue in this " + "case when in FIPS mode.\n"); + abort(); + } + + static const int kBitsNeeded = 256; + if (entropy_bits >= kBitsNeeded) { + break; + } + + usleep(250000); + } +#endif // BORINGSSL_FIPS +} + +void RAND_set_urandom_fd(int fd) { + fd = dup(fd); + if (fd < 0) { + perror("failed to dup supplied urandom fd"); + abort(); + } + + assert(kUnset == 0); + if (fd == kUnset) { + // Because we want to keep |urandom_fd| in the BSS, we have to initialise + // it to zero. But zero is a valid file descriptor too. Thus if dup + // returned zero we dup it again to get a non-zero number. + fd = dup(fd); + close(kUnset); + + if (fd <= 0) { + perror("failed to dup supplied urandom fd"); + abort(); + } + } + + CRYPTO_STATIC_MUTEX_lock_write(rand_lock_bss_get()); + *urandom_fd_requested_bss_get() = fd; + CRYPTO_STATIC_MUTEX_unlock_write(rand_lock_bss_get()); + + CRYPTO_once(rand_once_bss_get(), init_once); + if (*urandom_fd_bss_get() == kHaveGetrandom) { + close(fd); + } else if (*urandom_fd_bss_get() != fd) { + fprintf(stderr, "RAND_set_urandom_fd called after initialisation.\n"); + abort(); + } +} + +// fill_with_entropy writes |len| bytes of entropy into |out|. It returns one +// on success and zero on error. If |block| is one, this function will block +// until the entropy pool is initialized. Otherwise, this function may fail, +// setting |errno| to |EAGAIN| if the entropy pool has not yet been initialized. +// If |seed| is one, this function will OR in the value of +// |*extra_getrandom_flags_for_seed()| when using |getrandom|. +static int fill_with_entropy(uint8_t *out, size_t len, int block, int seed) { + if (len == 0) { + return 1; + } + +#if defined(USE_NR_getrandom) + int getrandom_flags = 0; + if (!block) { + getrandom_flags |= GRND_NONBLOCK; + } + if (seed) { + getrandom_flags |= *extra_getrandom_flags_for_seed_bss_get(); + } +#endif + + CRYPTO_once(rand_once_bss_get(), init_once); + if (block) { + CRYPTO_once(wait_for_entropy_once_bss_get(), wait_for_entropy); + } + + // Clear |errno| so it has defined value if |read| or |getrandom| + // "successfully" returns zero. + errno = 0; + while (len > 0) { + ssize_t r; + + if (*urandom_fd_bss_get() == kHaveGetrandom) { +#if defined(USE_NR_getrandom) + r = boringssl_getrandom(out, len, getrandom_flags); +#elif defined(OPENSSL_MACOS) + if (__builtin_available(macos 10.12, *)) { + // |getentropy| can only request 256 bytes at a time. + size_t todo = len <= 256 ? len : 256; + if (getentropy(out, todo) != 0) { + r = -1; + } else { + r = (ssize_t)todo; + } + } else { + fprintf(stderr, "urandom fd corrupt.\n"); + abort(); + } +#else // USE_NR_getrandom + fprintf(stderr, "urandom fd corrupt.\n"); + abort(); +#endif + } else { + do { + r = read(*urandom_fd_bss_get(), out, len); + } while (r == -1 && errno == EINTR); + } + + if (r <= 0) { + return 0; + } + out += r; + len -= r; + } + + return 1; +} + +// CRYPTO_sysrand puts |requested| random bytes into |out|. +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + if (!fill_with_entropy(out, requested, /*block=*/1, /*seed=*/0)) { + perror("entropy fill failed"); + abort(); + } +} + +#if defined(BORINGSSL_FIPS) +void CRYPTO_sysrand_for_seed(uint8_t *out, size_t requested) { + if (!fill_with_entropy(out, requested, /*block=*/1, /*seed=*/1)) { + perror("entropy fill failed"); + abort(); + } + +#if defined(BORINGSSL_FIPS_BREAK_CRNG) + // This breaks the "continuous random number generator test" defined in FIPS + // 140-2, section 4.9.2, and implemented in rand_get_seed(). + OPENSSL_memset(out, 0, requested); +#endif +} + +void CRYPTO_sysrand_if_available(uint8_t *out, size_t requested) { + // Return all zeros if |fill_with_entropy| fails. + OPENSSL_memset(out, 0, requested); + + if (!fill_with_entropy(out, requested, /*block=*/0, /*seed=*/0) && + errno != EAGAIN) { + perror("opportunistic entropy fill failed"); + abort(); + } +} +#endif // BORINGSSL_FIPS + +#endif // OPENSSL_URANDOM diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/blinding.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/blinding.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/blinding.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/blinding.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/blinding.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/padding.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/padding.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c index a8dd0e5d5..06962381b 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/padding.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c @@ -170,7 +170,7 @@ int RSA_padding_add_PKCS1_type_2(uint8_t *to, size_t to_len, } if (from_len > to_len - RSA_PKCS1_PADDING_SIZE) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -233,6 +233,9 @@ int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, // impossible to completely avoid Bleichenbacher's attack. Consumers should // use |RSA_PADDING_NONE| and perform the padding check in constant-time // combined with a swap to a random session key or other mitigation. + CONSTTIME_DECLASSIFY(&valid_index, sizeof(valid_index)); + CONSTTIME_DECLASSIFY(&zero_index, sizeof(zero_index)); + if (!valid_index) { OPENSSL_PUT_ERROR(RSA, RSA_R_PKCS_DECODING_ERROR); return 0; @@ -254,7 +257,7 @@ int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, int RSA_padding_add_none(uint8_t *to, size_t to_len, const uint8_t *from, size_t from_len) { if (from_len > to_len) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -330,7 +333,7 @@ int RSA_padding_add_PKCS1_OAEP_mgf1(uint8_t *to, size_t to_len, size_t emlen = to_len - 1; if (from_len > emlen - 2 * mdlen - 1) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -480,7 +483,7 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *out, size_t *out_len, static const uint8_t kPSSZeroes[] = {0, 0, 0, 0, 0, 0, 0, 0}; -int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, +int RSA_verify_PKCS1_PSS_mgf1(const RSA *rsa, const uint8_t *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, const uint8_t *EM, int sLen) { int i; @@ -579,7 +582,7 @@ int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, return ret; } -int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, +int RSA_padding_add_PKCS1_PSS_mgf1(const RSA *rsa, unsigned char *EM, const unsigned char *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLenRequested) { @@ -608,7 +611,7 @@ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, } if (emLen < hLen + 2) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); goto err; } @@ -629,7 +632,7 @@ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, } if (emLen - hLen - 2 < sLen) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); goto err; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/padding.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/padding.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c.grpc_back index 9d88dba79..28f1b45b4 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/padding.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/padding.c.grpc_back @@ -170,7 +170,7 @@ int RSA_padding_add_PKCS1_type_2(uint8_t *to, size_t to_len, } if (from_len > to_len - RSA_PKCS1_PADDING_SIZE) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -233,6 +233,9 @@ int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, // impossible to completely avoid Bleichenbacher's attack. Consumers should // use |RSA_PADDING_NONE| and perform the padding check in constant-time // combined with a swap to a random session key or other mitigation. + CONSTTIME_DECLASSIFY(&valid_index, sizeof(valid_index)); + CONSTTIME_DECLASSIFY(&zero_index, sizeof(zero_index)); + if (!valid_index) { OPENSSL_PUT_ERROR(RSA, RSA_R_PKCS_DECODING_ERROR); return 0; @@ -254,7 +257,7 @@ int RSA_padding_check_PKCS1_type_2(uint8_t *out, size_t *out_len, int RSA_padding_add_none(uint8_t *to, size_t to_len, const uint8_t *from, size_t from_len) { if (from_len > to_len) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -330,7 +333,7 @@ int RSA_padding_add_PKCS1_OAEP_mgf1(uint8_t *to, size_t to_len, size_t emlen = to_len - 1; if (from_len > emlen - 2 * mdlen - 1) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); return 0; } @@ -480,7 +483,7 @@ decoding_err: static const uint8_t kPSSZeroes[] = {0, 0, 0, 0, 0, 0, 0, 0}; -int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, +int RSA_verify_PKCS1_PSS_mgf1(const RSA *rsa, const uint8_t *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, const uint8_t *EM, int sLen) { int i; @@ -579,7 +582,7 @@ err: return ret; } -int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, +int RSA_padding_add_PKCS1_PSS_mgf1(const RSA *rsa, unsigned char *EM, const unsigned char *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, int sLenRequested) { @@ -608,7 +611,7 @@ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, } if (emLen < hLen + 2) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); goto err; } @@ -629,7 +632,7 @@ int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, unsigned char *EM, } if (emLen - hLen - 2 < sLen) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE); goto err; } diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c index 89eb908bd..cfe51b393 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c @@ -76,7 +76,11 @@ #include "internal.h" -DEFINE_STATIC_EX_DATA_CLASS(g_rsa_ex_data_class); +// RSA_R_BLOCK_TYPE_IS_NOT_02 is part of the legacy SSLv23 padding scheme. +// Cryptography.io depends on this error code. +OPENSSL_DECLARE_ERROR_REASON(RSA, BLOCK_TYPE_IS_NOT_02) + +DEFINE_STATIC_EX_DATA_CLASS(g_rsa_ex_data_class) RSA *RSA_new(void) { return RSA_new_method(NULL); } @@ -805,6 +809,11 @@ int RSA_check_fips(RSA *key) { int ret = 1; // Perform partial public key validation of RSA keys (SP 800-89 5.3.3). + // Although this is not for primality testing, SP 800-89 cites an RSA + // primality testing algorithm, so we use |BN_prime_checks_for_generation| to + // match. This is only a plausibility test and we expect the value to be + // composite, so too few iterations will cause us to reject the key, not use + // an implausible one. enum bn_primality_result_t primality_result; if (BN_num_bits(key->e) <= 16 || BN_num_bits(key->e) > 256 || @@ -813,7 +822,8 @@ int RSA_check_fips(RSA *key) { !BN_gcd(&small_gcd, key->n, g_small_factors(), ctx) || !BN_is_one(&small_gcd) || !BN_enhanced_miller_rabin_primality_test(&primality_result, key->n, - BN_prime_checks, ctx, NULL) || + BN_prime_checks_for_generation, + ctx, NULL) || primality_result != bn_non_prime_power_composite) { OPENSSL_PUT_ERROR(RSA, RSA_R_PUBLIC_KEY_VALIDATION_FAILED); ret = 0; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c.grpc_back index aed87a68b..0830b0510 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa.c.grpc_back @@ -76,7 +76,11 @@ #include "internal.h" -DEFINE_STATIC_EX_DATA_CLASS(g_rsa_ex_data_class); +// RSA_R_BLOCK_TYPE_IS_NOT_02 is part of the legacy SSLv23 padding scheme. +// Cryptography.io depends on this error code. +OPENSSL_DECLARE_ERROR_REASON(RSA, BLOCK_TYPE_IS_NOT_02) + +DEFINE_STATIC_EX_DATA_CLASS(g_rsa_ex_data_class) RSA *RSA_new(void) { return RSA_new_method(NULL); } @@ -805,6 +809,11 @@ int RSA_check_fips(RSA *key) { int ret = 1; // Perform partial public key validation of RSA keys (SP 800-89 5.3.3). + // Although this is not for primality testing, SP 800-89 cites an RSA + // primality testing algorithm, so we use |BN_prime_checks_for_generation| to + // match. This is only a plausibility test and we expect the value to be + // composite, so too few iterations will cause us to reject the key, not use + // an implausible one. enum bn_primality_result_t primality_result; if (BN_num_bits(key->e) <= 16 || BN_num_bits(key->e) > 256 || @@ -813,7 +822,8 @@ int RSA_check_fips(RSA *key) { !BN_gcd(&small_gcd, key->n, g_small_factors(), ctx) || !BN_is_one(&small_gcd) || !BN_enhanced_miller_rabin_primality_test(&primality_result, key->n, - BN_prime_checks, ctx, NULL) || + BN_prime_checks_for_generation, + ctx, NULL) || primality_result != bn_non_prime_power_composite) { OPENSSL_PUT_ERROR(RSA, RSA_R_PUBLIC_KEY_VALIDATION_FAILED); ret = 0; diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa_impl.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c similarity index 82% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa_impl.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c index 94fcd3f27..e8ec84b3c 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa_impl.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c @@ -120,6 +120,8 @@ static int ensure_fixed_copy(BIGNUM **out, const BIGNUM *in, int width) { return 0; } *out = copy; + CONSTTIME_SECRET(copy->d, sizeof(BN_ULONG) * width); + return 1; } @@ -166,8 +168,13 @@ static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { } if (rsa->p != NULL && rsa->q != NULL) { + // TODO: p and q are also CONSTTIME_SECRET but not yet marked as such + // because the Montgomery code does things like test whether or not values + // are zero. So the secret marking probably needs to happen inside that + // code. + if (rsa->mont_p == NULL) { - rsa->mont_p = BN_MONT_CTX_new_for_modulus(rsa->p, ctx); + rsa->mont_p = BN_MONT_CTX_new_consttime(rsa->p, ctx); if (rsa->mont_p == NULL) { goto err; } @@ -175,7 +182,7 @@ static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { const BIGNUM *p_fixed = &rsa->mont_p->N; if (rsa->mont_q == NULL) { - rsa->mont_q = BN_MONT_CTX_new_for_modulus(rsa->q, ctx); + rsa->mont_q = BN_MONT_CTX_new_consttime(rsa->q, ctx); if (rsa->mont_q == NULL) { goto err; } @@ -224,6 +231,9 @@ static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { goto err; } rsa->inv_small_mod_large_mont = inv_small_mod_large_mont; + CONSTTIME_SECRET( + rsa->inv_small_mod_large_mont->d, + sizeof(BN_ULONG) * rsa->inv_small_mod_large_mont->width); } } } @@ -303,7 +313,7 @@ int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, if (BN_ucmp(f, rsa->n) >= 0) { // usually the padding functions would catch this - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); goto err; } @@ -335,7 +345,12 @@ int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, // MAX_BLINDINGS_PER_RSA defines the maximum number of cached BN_BLINDINGs per // RSA*. Then this limit is exceeded, BN_BLINDING objects will be created and // destroyed as needed. +#if defined(OPNESSL_TSAN) +// Smaller under TSAN so that the edge case can be hit with fewer threads. +#define MAX_BLINDINGS_PER_RSA 2 +#else #define MAX_BLINDINGS_PER_RSA 1024 +#endif // rsa_blinding_get returns a BN_BLINDING to use with |rsa|. It does this by // allocating one of the cached BN_BLINDING objects in |rsa->blindings|. If @@ -350,80 +365,84 @@ static BN_BLINDING *rsa_blinding_get(RSA *rsa, unsigned *index_used, assert(rsa->mont_n != NULL); BN_BLINDING *ret = NULL; - BN_BLINDING **new_blindings; - uint8_t *new_blindings_inuse; - char overflow = 0; - CRYPTO_MUTEX_lock_write(&rsa->lock); - unsigned i; - for (i = 0; i < rsa->num_blindings; i++) { - if (rsa->blindings_inuse[i] == 0) { - rsa->blindings_inuse[i] = 1; - ret = rsa->blindings[i]; - *index_used = i; - break; - } + uint8_t *const free_inuse_flag = + OPENSSL_memchr(rsa->blindings_inuse, 0, rsa->num_blindings); + if (free_inuse_flag != NULL) { + *free_inuse_flag = 1; + *index_used = free_inuse_flag - rsa->blindings_inuse; + ret = rsa->blindings[*index_used]; + goto out; } - if (ret != NULL) { - CRYPTO_MUTEX_unlock_write(&rsa->lock); - return ret; + if (rsa->num_blindings >= MAX_BLINDINGS_PER_RSA) { + // No |BN_BLINDING| is free and nor can the cache be extended. This index + // value is magic and indicates to |rsa_blinding_release| that a + // |BN_BLINDING| was not inserted into the array. + *index_used = MAX_BLINDINGS_PER_RSA; + ret = BN_BLINDING_new(); + goto out; } - overflow = rsa->num_blindings >= MAX_BLINDINGS_PER_RSA; - - // We didn't find a free BN_BLINDING to use so increase the length of - // the arrays by one and use the newly created element. - - CRYPTO_MUTEX_unlock_write(&rsa->lock); - ret = BN_BLINDING_new(); - if (ret == NULL) { - return NULL; + // Double the length of the cache. + OPENSSL_STATIC_ASSERT(MAX_BLINDINGS_PER_RSA < UINT_MAX / 2, + "MAX_BLINDINGS_PER_RSA too large"); + unsigned new_num_blindings = rsa->num_blindings * 2; + if (new_num_blindings == 0) { + new_num_blindings = 1; } - - if (overflow) { - // We cannot add any more cached BN_BLINDINGs so we use |ret| - // and mark it for destruction in |rsa_blinding_release|. - *index_used = MAX_BLINDINGS_PER_RSA; - return ret; + if (new_num_blindings > MAX_BLINDINGS_PER_RSA) { + new_num_blindings = MAX_BLINDINGS_PER_RSA; } + assert(new_num_blindings > rsa->num_blindings); - CRYPTO_MUTEX_lock_write(&rsa->lock); - - new_blindings = - OPENSSL_malloc(sizeof(BN_BLINDING *) * (rsa->num_blindings + 1)); - if (new_blindings == NULL) { - goto err1; + OPENSSL_STATIC_ASSERT( + MAX_BLINDINGS_PER_RSA < UINT_MAX / sizeof(BN_BLINDING *), + "MAX_BLINDINGS_PER_RSA too large"); + BN_BLINDING **new_blindings = + OPENSSL_malloc(sizeof(BN_BLINDING *) * new_num_blindings); + uint8_t *new_blindings_inuse = OPENSSL_malloc(new_num_blindings); + if (new_blindings == NULL || new_blindings_inuse == NULL) { + goto err; } + OPENSSL_memcpy(new_blindings, rsa->blindings, - sizeof(BN_BLINDING *) * rsa->num_blindings); - new_blindings[rsa->num_blindings] = ret; + sizeof(BN_BLINDING *) * rsa->num_blindings); + OPENSSL_memcpy(new_blindings_inuse, rsa->blindings_inuse, rsa->num_blindings); - new_blindings_inuse = OPENSSL_malloc(rsa->num_blindings + 1); - if (new_blindings_inuse == NULL) { - goto err2; + for (unsigned i = rsa->num_blindings; i < new_num_blindings; i++) { + new_blindings[i] = BN_BLINDING_new(); + if (new_blindings[i] == NULL) { + for (unsigned j = rsa->num_blindings; j < i; j++) { + BN_BLINDING_free(new_blindings[j]); + } + goto err; + } } - OPENSSL_memcpy(new_blindings_inuse, rsa->blindings_inuse, rsa->num_blindings); + memset(&new_blindings_inuse[rsa->num_blindings], 0, + new_num_blindings - rsa->num_blindings); + new_blindings_inuse[rsa->num_blindings] = 1; *index_used = rsa->num_blindings; + assert(*index_used != MAX_BLINDINGS_PER_RSA); + ret = new_blindings[rsa->num_blindings]; OPENSSL_free(rsa->blindings); rsa->blindings = new_blindings; OPENSSL_free(rsa->blindings_inuse); rsa->blindings_inuse = new_blindings_inuse; - rsa->num_blindings++; + rsa->num_blindings = new_num_blindings; - CRYPTO_MUTEX_unlock_write(&rsa->lock); - return ret; + goto out; -err2: +err: + OPENSSL_free(new_blindings_inuse); OPENSSL_free(new_blindings); -err1: +out: CRYPTO_MUTEX_unlock_write(&rsa->lock); - BN_BLINDING_free(ret); - return NULL; + return ret; } // rsa_blinding_release marks the cached BN_BLINDING at the given index as free @@ -480,6 +499,7 @@ int rsa_default_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out, goto err; } + CONSTTIME_DECLASSIFY(out, rsa_size); *out_len = rsa_size; ret = 1; @@ -539,8 +559,11 @@ int rsa_default_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, goto err; } + CONSTTIME_DECLASSIFY(&ret, sizeof(ret)); if (!ret) { OPENSSL_PUT_ERROR(RSA, RSA_R_PADDING_CHECK_FAILED); + } else { + CONSTTIME_DECLASSIFY(out, *out_len); } err: @@ -609,7 +632,7 @@ int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, } if (BN_ucmp(f, rsa->n) >= 0) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); goto err; } @@ -683,7 +706,7 @@ int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, if (BN_ucmp(f, rsa->n) >= 0) { // Usually the padding functions would catch this. - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); goto err; } @@ -715,7 +738,13 @@ int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, } if (rsa->p != NULL && rsa->q != NULL && rsa->e != NULL && rsa->dmp1 != NULL && - rsa->dmq1 != NULL && rsa->iqmp != NULL) { + rsa->dmq1 != NULL && rsa->iqmp != NULL && + // Require that we can reduce |f| by |rsa->p| and |rsa->q| in constant + // time, which requires primes be the same size, rounded to the Montgomery + // coefficient. (See |mod_montgomery|.) This is not required by RFC 8017, + // but it is true for keys generated by us and all common implementations. + bn_less_than_montgomery_R(rsa->q, rsa->mont_p) && + bn_less_than_montgomery_R(rsa->p, rsa->mont_q)) { if (!mod_exp(result, f, rsa, ctx)) { goto err; } @@ -753,7 +782,7 @@ int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, // that it and serializing does not leak information about the magnitude of // the result. // - // See Falko Stenzke, "Manger's Attack revisited", ICICS 2010. + // See Falko Strenzke, "Manger's Attack revisited", ICICS 2010. assert(result->width == rsa->mont_n->N.width); if (!BN_bn2bin_padded(out, len, result)) { OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); @@ -780,11 +809,11 @@ static int mod_montgomery(BIGNUM *r, const BIGNUM *I, const BIGNUM *p, const BN_MONT_CTX *mont_p, const BIGNUM *q, BN_CTX *ctx) { // Reducing in constant-time with Montgomery reduction requires I <= p * R. We - // have I < p * q, so this follows if q < R. In particular, this always holds - // if p and q are the same size, which is true for any RSA keys we or anyone - // sane generates. For other keys, we fall back to |BN_mod|. + // have I < p * q, so this follows if q < R. The caller should have checked + // this already. if (!bn_less_than_montgomery_R(q, mont_p)) { - return BN_mod(r, I, p, ctx); + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; } if (// Reduce mod p with Montgomery reduction. This computes I * R^-1 mod p. @@ -928,6 +957,8 @@ const size_t kBoringSSLRSASqrtTwoLen = OPENSSL_ARRAY_SIZE(kBoringSSLRSASqrtTwo); // relatively prime to |e|. If |p| is non-NULL, |out| will also not be close to // |p|. |sqrt2| must be ⌊2^(bits-1)×√2⌋ (or a slightly overestimate for large // sizes), and |pow2_bits_100| must be 2^(bits-100). +// +// This function fails with probability around 2^-21. static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, const BIGNUM *p, const BIGNUM *sqrt2, const BIGNUM *pow2_bits_100, BN_CTX *ctx, @@ -944,11 +975,36 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, // Use the limit from steps 4.7 and 5.8 for most values of |e|. When |e| is 3, // the 186-4 limit is too low, so we use a higher one. Note this case is not // reachable from |RSA_generate_key_fips|. + // + // |limit| determines the failure probability. We must find a prime that is + // not 1 mod |e|. By the prime number theorem, we'll find one with probability + // p = (e-1)/e * 2/(ln(2)*bits). Note the second term is doubled because we + // discard even numbers. + // + // The failure probability is thus (1-p)^limit. To convert that to a power of + // two, we take logs. -log_2((1-p)^limit) = -limit * ln(1-p) / ln(2). + // + // >>> def f(bits, e, limit): + // ... p = (e-1.0)/e * 2.0/(math.log(2)*bits) + // ... return -limit * math.log(1 - p) / math.log(2) + // ... + // >>> f(1024, 65537, 5*1024) + // 20.842750558272634 + // >>> f(1536, 65537, 5*1536) + // 20.83294549602474 + // >>> f(2048, 65537, 5*2048) + // 20.828047576234948 + // >>> f(1024, 3, 8*1024) + // 22.222147925962307 + // >>> f(1536, 3, 8*1536) + // 22.21518251065506 + // >>> f(2048, 3, 8*2048) + // 22.211701985875937 if (bits >= INT_MAX/32) { OPENSSL_PUT_ERROR(RSA, RSA_R_MODULUS_TOO_LARGE); return 0; } - int limit = BN_is_word(e, 3) ? bits * 32 : bits * 5; + int limit = BN_is_word(e, 3) ? bits * 8 : bits * 5; int ret = 0, tries = 0, rand_tries = 0; BN_CTX_start(ctx); @@ -988,7 +1044,7 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, } // RSA key generation's bottleneck is discarding composites. If it fails - // trial division, do not bother computing a GCD or performing Rabin-Miller. + // trial division, do not bother computing a GCD or performing Miller-Rabin. if (!bn_odd_number_is_obviously_composite(out)) { // Check gcd(out-1, e) is one (steps 4.5 and 5.6). int relatively_prime; @@ -999,8 +1055,8 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, if (relatively_prime) { // Test |out| for primality (steps 4.5.1 and 5.6.1). int is_probable_prime; - if (!BN_primality_test(&is_probable_prime, out, BN_prime_checks, ctx, 0, - cb)) { + if (!BN_primality_test(&is_probable_prime, out, + BN_prime_checks_for_generation, ctx, 0, cb)) { goto err; } if (is_probable_prime) { @@ -1027,7 +1083,14 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, return ret; } -int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) { +// rsa_generate_key_impl generates an RSA key using a generalized version of +// FIPS 186-4 appendix B.3. |RSA_generate_key_fips| performs additional checks +// for FIPS-compliant key generation. +// +// This function returns one on success and zero on failure. It has a failure +// probability of about 2^-20. +static int rsa_generate_key_impl(RSA *rsa, int bits, const BIGNUM *e_value, + BN_GENCB *cb) { // See FIPS 186-4 appendix B.3. This function implements a generalized version // of the FIPS algorithm. |RSA_generate_key_fips| performs additional checks // for FIPS-compliant key generation. @@ -1113,6 +1176,9 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) { do { // Generate p and q, each of size |prime_bits|, using the steps outlined in // appendix FIPS 186-4 appendix B.3.3. + // + // Each call to |generate_prime| fails with probability p = 2^-21. The + // probability that either call fails is 1 - (1-p)^2, which is around 2^-20. if (!generate_prime(rsa->p, prime_bits, rsa->e, NULL, sqrt2, pow2_prime_bits_100, ctx, cb) || !BN_GENCB_call(cb, 3, 0) || @@ -1192,6 +1258,66 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) { return ret; } +static void replace_bignum(BIGNUM **out, BIGNUM **in) { + BN_free(*out); + *out = *in; + *in = NULL; +} + +static void replace_bn_mont_ctx(BN_MONT_CTX **out, BN_MONT_CTX **in) { + BN_MONT_CTX_free(*out); + *out = *in; + *in = NULL; +} + +int RSA_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e_value, + BN_GENCB *cb) { + // |rsa_generate_key_impl|'s 2^-20 failure probability is too high at scale, + // so we run the FIPS algorithm four times, bringing it down to 2^-80. We + // should just adjust the retry limit, but FIPS 186-4 prescribes that value + // and thus results in unnecessary complexity. + for (int i = 0; i < 4; i++) { + ERR_clear_error(); + // Generate into scratch space, to avoid leaving partial work on failure. + RSA *tmp = RSA_new(); + if (tmp == NULL) { + return 0; + } + if (rsa_generate_key_impl(tmp, bits, e_value, cb)) { + replace_bignum(&rsa->n, &tmp->n); + replace_bignum(&rsa->e, &tmp->e); + replace_bignum(&rsa->d, &tmp->d); + replace_bignum(&rsa->p, &tmp->p); + replace_bignum(&rsa->q, &tmp->q); + replace_bignum(&rsa->dmp1, &tmp->dmp1); + replace_bignum(&rsa->dmq1, &tmp->dmq1); + replace_bignum(&rsa->iqmp, &tmp->iqmp); + replace_bn_mont_ctx(&rsa->mont_n, &tmp->mont_n); + replace_bn_mont_ctx(&rsa->mont_p, &tmp->mont_p); + replace_bn_mont_ctx(&rsa->mont_q, &tmp->mont_q); + replace_bignum(&rsa->d_fixed, &tmp->d_fixed); + replace_bignum(&rsa->dmp1_fixed, &tmp->dmp1_fixed); + replace_bignum(&rsa->dmq1_fixed, &tmp->dmq1_fixed); + replace_bignum(&rsa->inv_small_mod_large_mont, + &tmp->inv_small_mod_large_mont); + rsa->private_key_frozen = tmp->private_key_frozen; + RSA_free(tmp); + return 1; + } + uint32_t err = ERR_peek_error(); + RSA_free(tmp); + tmp = NULL; + // Only retry on |RSA_R_TOO_MANY_ITERATIONS|. This is so a caller-induced + // failure in |BN_GENCB_call| is still fatal. + if (ERR_GET_LIB(err) != ERR_LIB_RSA || + ERR_GET_REASON(err) != RSA_R_TOO_MANY_ITERATIONS) { + return 0; + } + } + + return 0; +} + int RSA_generate_key_fips(RSA *rsa, int bits, BN_GENCB *cb) { // FIPS 186-4 allows 2048-bit and 3072-bit RSA keys (1024-bit and 1536-bit // primes, respectively) with the prime generation method we use. diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back index 49cbc15a9..94fb75c7d 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/rsa/rsa_impl.c.grpc_back @@ -120,6 +120,8 @@ static int ensure_fixed_copy(BIGNUM **out, const BIGNUM *in, int width) { return 0; } *out = copy; + CONSTTIME_SECRET(copy->d, sizeof(BN_ULONG) * width); + return 1; } @@ -166,8 +168,13 @@ static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { } if (rsa->p != NULL && rsa->q != NULL) { + // TODO: p and q are also CONSTTIME_SECRET but not yet marked as such + // because the Montgomery code does things like test whether or not values + // are zero. So the secret marking probably needs to happen inside that + // code. + if (rsa->mont_p == NULL) { - rsa->mont_p = BN_MONT_CTX_new_for_modulus(rsa->p, ctx); + rsa->mont_p = BN_MONT_CTX_new_consttime(rsa->p, ctx); if (rsa->mont_p == NULL) { goto err; } @@ -175,7 +182,7 @@ static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { const BIGNUM *p_fixed = &rsa->mont_p->N; if (rsa->mont_q == NULL) { - rsa->mont_q = BN_MONT_CTX_new_for_modulus(rsa->q, ctx); + rsa->mont_q = BN_MONT_CTX_new_consttime(rsa->q, ctx); if (rsa->mont_q == NULL) { goto err; } @@ -224,6 +231,9 @@ static int freeze_private_key(RSA *rsa, BN_CTX *ctx) { goto err; } rsa->inv_small_mod_large_mont = inv_small_mod_large_mont; + CONSTTIME_SECRET( + rsa->inv_small_mod_large_mont->d, + sizeof(BN_ULONG) * rsa->inv_small_mod_large_mont->width); } } } @@ -303,7 +313,7 @@ int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, if (BN_ucmp(f, rsa->n) >= 0) { // usually the padding functions would catch this - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); goto err; } @@ -335,7 +345,12 @@ err: // MAX_BLINDINGS_PER_RSA defines the maximum number of cached BN_BLINDINGs per // RSA*. Then this limit is exceeded, BN_BLINDING objects will be created and // destroyed as needed. +#if defined(OPNESSL_TSAN) +// Smaller under TSAN so that the edge case can be hit with fewer threads. +#define MAX_BLINDINGS_PER_RSA 2 +#else #define MAX_BLINDINGS_PER_RSA 1024 +#endif // rsa_blinding_get returns a BN_BLINDING to use with |rsa|. It does this by // allocating one of the cached BN_BLINDING objects in |rsa->blindings|. If @@ -350,80 +365,84 @@ static BN_BLINDING *rsa_blinding_get(RSA *rsa, unsigned *index_used, assert(rsa->mont_n != NULL); BN_BLINDING *ret = NULL; - BN_BLINDING **new_blindings; - uint8_t *new_blindings_inuse; - char overflow = 0; - CRYPTO_MUTEX_lock_write(&rsa->lock); - unsigned i; - for (i = 0; i < rsa->num_blindings; i++) { - if (rsa->blindings_inuse[i] == 0) { - rsa->blindings_inuse[i] = 1; - ret = rsa->blindings[i]; - *index_used = i; - break; - } + uint8_t *const free_inuse_flag = + OPENSSL_memchr(rsa->blindings_inuse, 0, rsa->num_blindings); + if (free_inuse_flag != NULL) { + *free_inuse_flag = 1; + *index_used = free_inuse_flag - rsa->blindings_inuse; + ret = rsa->blindings[*index_used]; + goto out; } - if (ret != NULL) { - CRYPTO_MUTEX_unlock_write(&rsa->lock); - return ret; + if (rsa->num_blindings >= MAX_BLINDINGS_PER_RSA) { + // No |BN_BLINDING| is free and nor can the cache be extended. This index + // value is magic and indicates to |rsa_blinding_release| that a + // |BN_BLINDING| was not inserted into the array. + *index_used = MAX_BLINDINGS_PER_RSA; + ret = BN_BLINDING_new(); + goto out; } - overflow = rsa->num_blindings >= MAX_BLINDINGS_PER_RSA; - - // We didn't find a free BN_BLINDING to use so increase the length of - // the arrays by one and use the newly created element. - - CRYPTO_MUTEX_unlock_write(&rsa->lock); - ret = BN_BLINDING_new(); - if (ret == NULL) { - return NULL; + // Double the length of the cache. + OPENSSL_STATIC_ASSERT(MAX_BLINDINGS_PER_RSA < UINT_MAX / 2, + "MAX_BLINDINGS_PER_RSA too large"); + unsigned new_num_blindings = rsa->num_blindings * 2; + if (new_num_blindings == 0) { + new_num_blindings = 1; } - - if (overflow) { - // We cannot add any more cached BN_BLINDINGs so we use |ret| - // and mark it for destruction in |rsa_blinding_release|. - *index_used = MAX_BLINDINGS_PER_RSA; - return ret; + if (new_num_blindings > MAX_BLINDINGS_PER_RSA) { + new_num_blindings = MAX_BLINDINGS_PER_RSA; } + assert(new_num_blindings > rsa->num_blindings); - CRYPTO_MUTEX_lock_write(&rsa->lock); - - new_blindings = - OPENSSL_malloc(sizeof(BN_BLINDING *) * (rsa->num_blindings + 1)); - if (new_blindings == NULL) { - goto err1; + OPENSSL_STATIC_ASSERT( + MAX_BLINDINGS_PER_RSA < UINT_MAX / sizeof(BN_BLINDING *), + "MAX_BLINDINGS_PER_RSA too large"); + BN_BLINDING **new_blindings = + OPENSSL_malloc(sizeof(BN_BLINDING *) * new_num_blindings); + uint8_t *new_blindings_inuse = OPENSSL_malloc(new_num_blindings); + if (new_blindings == NULL || new_blindings_inuse == NULL) { + goto err; } + OPENSSL_memcpy(new_blindings, rsa->blindings, - sizeof(BN_BLINDING *) * rsa->num_blindings); - new_blindings[rsa->num_blindings] = ret; + sizeof(BN_BLINDING *) * rsa->num_blindings); + OPENSSL_memcpy(new_blindings_inuse, rsa->blindings_inuse, rsa->num_blindings); - new_blindings_inuse = OPENSSL_malloc(rsa->num_blindings + 1); - if (new_blindings_inuse == NULL) { - goto err2; + for (unsigned i = rsa->num_blindings; i < new_num_blindings; i++) { + new_blindings[i] = BN_BLINDING_new(); + if (new_blindings[i] == NULL) { + for (unsigned j = rsa->num_blindings; j < i; j++) { + BN_BLINDING_free(new_blindings[j]); + } + goto err; + } } - OPENSSL_memcpy(new_blindings_inuse, rsa->blindings_inuse, rsa->num_blindings); + memset(&new_blindings_inuse[rsa->num_blindings], 0, + new_num_blindings - rsa->num_blindings); + new_blindings_inuse[rsa->num_blindings] = 1; *index_used = rsa->num_blindings; + assert(*index_used != MAX_BLINDINGS_PER_RSA); + ret = new_blindings[rsa->num_blindings]; OPENSSL_free(rsa->blindings); rsa->blindings = new_blindings; OPENSSL_free(rsa->blindings_inuse); rsa->blindings_inuse = new_blindings_inuse; - rsa->num_blindings++; + rsa->num_blindings = new_num_blindings; - CRYPTO_MUTEX_unlock_write(&rsa->lock); - return ret; + goto out; -err2: +err: + OPENSSL_free(new_blindings_inuse); OPENSSL_free(new_blindings); -err1: +out: CRYPTO_MUTEX_unlock_write(&rsa->lock); - BN_BLINDING_free(ret); - return NULL; + return ret; } // rsa_blinding_release marks the cached BN_BLINDING at the given index as free @@ -480,6 +499,7 @@ int rsa_default_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out, goto err; } + CONSTTIME_DECLASSIFY(out, rsa_size); *out_len = rsa_size; ret = 1; @@ -539,8 +559,11 @@ int rsa_default_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, goto err; } + CONSTTIME_DECLASSIFY(&ret, sizeof(ret)); if (!ret) { OPENSSL_PUT_ERROR(RSA, RSA_R_PADDING_CHECK_FAILED); + } else { + CONSTTIME_DECLASSIFY(out, *out_len); } err: @@ -609,7 +632,7 @@ int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, } if (BN_ucmp(f, rsa->n) >= 0) { - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); goto err; } @@ -683,7 +706,7 @@ int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, if (BN_ucmp(f, rsa->n) >= 0) { // Usually the padding functions would catch this. - OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE); + OPENSSL_PUT_ERROR(RSA, RSA_R_DATA_TOO_LARGE_FOR_MODULUS); goto err; } @@ -715,7 +738,13 @@ int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, } if (rsa->p != NULL && rsa->q != NULL && rsa->e != NULL && rsa->dmp1 != NULL && - rsa->dmq1 != NULL && rsa->iqmp != NULL) { + rsa->dmq1 != NULL && rsa->iqmp != NULL && + // Require that we can reduce |f| by |rsa->p| and |rsa->q| in constant + // time, which requires primes be the same size, rounded to the Montgomery + // coefficient. (See |mod_montgomery|.) This is not required by RFC 8017, + // but it is true for keys generated by us and all common implementations. + bn_less_than_montgomery_R(rsa->q, rsa->mont_p) && + bn_less_than_montgomery_R(rsa->p, rsa->mont_q)) { if (!mod_exp(result, f, rsa, ctx)) { goto err; } @@ -753,7 +782,7 @@ int rsa_default_private_transform(RSA *rsa, uint8_t *out, const uint8_t *in, // that it and serializing does not leak information about the magnitude of // the result. // - // See Falko Stenzke, "Manger's Attack revisited", ICICS 2010. + // See Falko Strenzke, "Manger's Attack revisited", ICICS 2010. assert(result->width == rsa->mont_n->N.width); if (!BN_bn2bin_padded(out, len, result)) { OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); @@ -780,11 +809,11 @@ static int mod_montgomery(BIGNUM *r, const BIGNUM *I, const BIGNUM *p, const BN_MONT_CTX *mont_p, const BIGNUM *q, BN_CTX *ctx) { // Reducing in constant-time with Montgomery reduction requires I <= p * R. We - // have I < p * q, so this follows if q < R. In particular, this always holds - // if p and q are the same size, which is true for any RSA keys we or anyone - // sane generates. For other keys, we fall back to |BN_mod|. + // have I < p * q, so this follows if q < R. The caller should have checked + // this already. if (!bn_less_than_montgomery_R(q, mont_p)) { - return BN_mod(r, I, p, ctx); + OPENSSL_PUT_ERROR(RSA, ERR_R_INTERNAL_ERROR); + return 0; } if (// Reduce mod p with Montgomery reduction. This computes I * R^-1 mod p. @@ -928,6 +957,8 @@ const size_t kBoringSSLRSASqrtTwoLen = OPENSSL_ARRAY_SIZE(kBoringSSLRSASqrtTwo); // relatively prime to |e|. If |p| is non-NULL, |out| will also not be close to // |p|. |sqrt2| must be ⌊2^(bits-1)×√2⌋ (or a slightly overestimate for large // sizes), and |pow2_bits_100| must be 2^(bits-100). +// +// This function fails with probability around 2^-21. static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, const BIGNUM *p, const BIGNUM *sqrt2, const BIGNUM *pow2_bits_100, BN_CTX *ctx, @@ -944,11 +975,36 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, // Use the limit from steps 4.7 and 5.8 for most values of |e|. When |e| is 3, // the 186-4 limit is too low, so we use a higher one. Note this case is not // reachable from |RSA_generate_key_fips|. + // + // |limit| determines the failure probability. We must find a prime that is + // not 1 mod |e|. By the prime number theorem, we'll find one with probability + // p = (e-1)/e * 2/(ln(2)*bits). Note the second term is doubled because we + // discard even numbers. + // + // The failure probability is thus (1-p)^limit. To convert that to a power of + // two, we take logs. -log_2((1-p)^limit) = -limit * ln(1-p) / ln(2). + // + // >>> def f(bits, e, limit): + // ... p = (e-1.0)/e * 2.0/(math.log(2)*bits) + // ... return -limit * math.log(1 - p) / math.log(2) + // ... + // >>> f(1024, 65537, 5*1024) + // 20.842750558272634 + // >>> f(1536, 65537, 5*1536) + // 20.83294549602474 + // >>> f(2048, 65537, 5*2048) + // 20.828047576234948 + // >>> f(1024, 3, 8*1024) + // 22.222147925962307 + // >>> f(1536, 3, 8*1536) + // 22.21518251065506 + // >>> f(2048, 3, 8*2048) + // 22.211701985875937 if (bits >= INT_MAX/32) { OPENSSL_PUT_ERROR(RSA, RSA_R_MODULUS_TOO_LARGE); return 0; } - int limit = BN_is_word(e, 3) ? bits * 32 : bits * 5; + int limit = BN_is_word(e, 3) ? bits * 8 : bits * 5; int ret = 0, tries = 0, rand_tries = 0; BN_CTX_start(ctx); @@ -988,7 +1044,7 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, } // RSA key generation's bottleneck is discarding composites. If it fails - // trial division, do not bother computing a GCD or performing Rabin-Miller. + // trial division, do not bother computing a GCD or performing Miller-Rabin. if (!bn_odd_number_is_obviously_composite(out)) { // Check gcd(out-1, e) is one (steps 4.5 and 5.6). int relatively_prime; @@ -999,8 +1055,8 @@ static int generate_prime(BIGNUM *out, int bits, const BIGNUM *e, if (relatively_prime) { // Test |out| for primality (steps 4.5.1 and 5.6.1). int is_probable_prime; - if (!BN_primality_test(&is_probable_prime, out, BN_prime_checks, ctx, 0, - cb)) { + if (!BN_primality_test(&is_probable_prime, out, + BN_prime_checks_for_generation, ctx, 0, cb)) { goto err; } if (is_probable_prime) { @@ -1027,7 +1083,14 @@ err: return ret; } -int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) { +// rsa_generate_key_impl generates an RSA key using a generalized version of +// FIPS 186-4 appendix B.3. |RSA_generate_key_fips| performs additional checks +// for FIPS-compliant key generation. +// +// This function returns one on success and zero on failure. It has a failure +// probability of about 2^-20. +static int rsa_generate_key_impl(RSA *rsa, int bits, const BIGNUM *e_value, + BN_GENCB *cb) { // See FIPS 186-4 appendix B.3. This function implements a generalized version // of the FIPS algorithm. |RSA_generate_key_fips| performs additional checks // for FIPS-compliant key generation. @@ -1113,6 +1176,9 @@ int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e_value, BN_GENCB *cb) { do { // Generate p and q, each of size |prime_bits|, using the steps outlined in // appendix FIPS 186-4 appendix B.3.3. + // + // Each call to |generate_prime| fails with probability p = 2^-21. The + // probability that either call fails is 1 - (1-p)^2, which is around 2^-20. if (!generate_prime(rsa->p, prime_bits, rsa->e, NULL, sqrt2, pow2_prime_bits_100, ctx, cb) || !BN_GENCB_call(cb, 3, 0) || @@ -1192,6 +1258,66 @@ err: return ret; } +static void replace_bignum(BIGNUM **out, BIGNUM **in) { + BN_free(*out); + *out = *in; + *in = NULL; +} + +static void replace_bn_mont_ctx(BN_MONT_CTX **out, BN_MONT_CTX **in) { + BN_MONT_CTX_free(*out); + *out = *in; + *in = NULL; +} + +int RSA_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e_value, + BN_GENCB *cb) { + // |rsa_generate_key_impl|'s 2^-20 failure probability is too high at scale, + // so we run the FIPS algorithm four times, bringing it down to 2^-80. We + // should just adjust the retry limit, but FIPS 186-4 prescribes that value + // and thus results in unnecessary complexity. + for (int i = 0; i < 4; i++) { + ERR_clear_error(); + // Generate into scratch space, to avoid leaving partial work on failure. + RSA *tmp = RSA_new(); + if (tmp == NULL) { + return 0; + } + if (rsa_generate_key_impl(tmp, bits, e_value, cb)) { + replace_bignum(&rsa->n, &tmp->n); + replace_bignum(&rsa->e, &tmp->e); + replace_bignum(&rsa->d, &tmp->d); + replace_bignum(&rsa->p, &tmp->p); + replace_bignum(&rsa->q, &tmp->q); + replace_bignum(&rsa->dmp1, &tmp->dmp1); + replace_bignum(&rsa->dmq1, &tmp->dmq1); + replace_bignum(&rsa->iqmp, &tmp->iqmp); + replace_bn_mont_ctx(&rsa->mont_n, &tmp->mont_n); + replace_bn_mont_ctx(&rsa->mont_p, &tmp->mont_p); + replace_bn_mont_ctx(&rsa->mont_q, &tmp->mont_q); + replace_bignum(&rsa->d_fixed, &tmp->d_fixed); + replace_bignum(&rsa->dmp1_fixed, &tmp->dmp1_fixed); + replace_bignum(&rsa->dmq1_fixed, &tmp->dmq1_fixed); + replace_bignum(&rsa->inv_small_mod_large_mont, + &tmp->inv_small_mod_large_mont); + rsa->private_key_frozen = tmp->private_key_frozen; + RSA_free(tmp); + return 1; + } + uint32_t err = ERR_peek_error(); + RSA_free(tmp); + tmp = NULL; + // Only retry on |RSA_R_TOO_MANY_ITERATIONS|. This is so a caller-induced + // failure in |BN_GENCB_call| is still fatal. + if (ERR_GET_LIB(err) != ERR_LIB_RSA || + ERR_GET_REASON(err) != RSA_R_TOO_MANY_ITERATIONS) { + return 0; + } + } + + return 0; +} + int RSA_generate_key_fips(RSA *rsa, int bits, BN_GENCB *cb) { // FIPS 186-4 allows 2048-bit and 3072-bit RSA keys (1024-bit and 1536-bit // primes, respectively) with the prime generation method we use. diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/self_check/self_check.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c similarity index 88% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/self_check/self_check.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c index e21636a9c..ab5c732c9 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/self_check/self_check.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -35,20 +36,36 @@ // compile this. #if !defined(_MSC_VER) +#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID) +// FIPS builds on Android will test for flag files, named after the module hash, +// in /dev/boringssl/selftest/. If such a flag file exists, it's assumed that +// self-tests have already passed and thus do not need to be repeated. (The +// integrity tests always run, however.) +// +// If self-tests complete successfully and the environment variable named in +// |kFlagWriteEnableEnvVar| is present, then the flag file will be created. The +// flag file isn't written without the environment variable being set in order +// to avoid SELinux violations on Android. +#define BORINGSSL_FIPS_SELF_TEST_FLAG_FILE +static const char kFlagPrefix[] = "/dev/boringssl/selftest/"; +static const char kFlagWriteEnableEnvVar[] = "BORINGSSL_SELF_TEST_CREATE_FLAG"; +#endif + static void hexdump(const uint8_t *in, size_t len) { for (size_t i = 0; i < len; i++) { - printf("%02x", in[i]); + fprintf(stderr, "%02x", in[i]); } } static int check_test(const void *expected, const void *actual, size_t expected_len, const char *name) { if (OPENSSL_memcmp(actual, expected, expected_len) != 0) { - printf("%s failed.\nExpected: ", name); + fprintf(stderr, "%s failed.\nExpected: ", name); hexdump(expected, expected_len); - printf("\nCalculated: "); + fprintf(stderr, "\nCalculated: "); hexdump(actual, expected_len); - printf("\n"); + fprintf(stderr, "\n"); + fflush(stderr); return 0; } return 1; @@ -226,7 +243,42 @@ static EC_KEY *self_test_ecdsa_key(void) { return ec_key; } -int BORINGSSL_self_test(void) { +#if defined(OPENSSL_ANDROID) +static const size_t kModuleDigestSize = SHA256_DIGEST_LENGTH; +#else +static const size_t kModuleDigestSize = SHA512_DIGEST_LENGTH; +#endif + +int boringssl_fips_self_test( + const uint8_t *module_hash, size_t module_hash_len) { +#if defined(BORINGSSL_FIPS_SELF_TEST_FLAG_FILE) + char flag_path[sizeof(kFlagPrefix) + 2*kModuleDigestSize]; + if (module_hash_len != 0) { + if (module_hash_len != kModuleDigestSize) { + fprintf(stderr, + "module hash of length %zu does not match expected length %zu\n", + module_hash_len, kModuleDigestSize); + BORINGSSL_FIPS_abort(); + } + + // Test whether the flag file exists. + memcpy(flag_path, kFlagPrefix, sizeof(kFlagPrefix) - 1); + static const char kHexTable[17] = "0123456789abcdef"; + for (size_t i = 0; i < kModuleDigestSize; i++) { + flag_path[sizeof(kFlagPrefix) - 1 + 2 * i] = + kHexTable[module_hash[i] >> 4]; + flag_path[sizeof(kFlagPrefix) - 1 + 2 * i + 1] = + kHexTable[module_hash[i] & 15]; + } + flag_path[sizeof(flag_path) - 1] = 0; + + if (access(flag_path, F_OK) == 0) { + // Flag file found. Skip self-tests. + return 1; + } + } +#endif // BORINGSSL_FIPS_SELF_TEST_FLAG_FILE + static const uint8_t kAESKey[16] = "BoringCrypto Key"; static const uint8_t kAESIV[16] = {0}; static const uint8_t kPlaintext[64] = @@ -393,6 +445,7 @@ int BORINGSSL_self_test(void) { // AES-CBC Encryption KAT memcpy(aes_iv, kAESIV, sizeof(kAESIV)); if (AES_set_encrypt_key(kAESKey, 8 * sizeof(kAESKey), &aes_key) != 0) { + fprintf(stderr, "AES_set_encrypt_key failed.\n"); goto err; } AES_cbc_encrypt(kPlaintext, output, sizeof(kPlaintext), &aes_key, aes_iv, @@ -405,6 +458,7 @@ int BORINGSSL_self_test(void) { // AES-CBC Decryption KAT memcpy(aes_iv, kAESIV, sizeof(kAESIV)); if (AES_set_decrypt_key(kAESKey, 8 * sizeof(kAESKey), &aes_key) != 0) { + fprintf(stderr, "AES_set_decrypt_key failed.\n"); goto err; } AES_cbc_encrypt(kAESCBCCiphertext, output, sizeof(kAESCBCCiphertext), @@ -419,6 +473,7 @@ int BORINGSSL_self_test(void) { OPENSSL_memset(nonce, 0, sizeof(nonce)); if (!EVP_AEAD_CTX_init(&aead_ctx, EVP_aead_aes_128_gcm(), kAESKey, sizeof(kAESKey), 0, NULL)) { + fprintf(stderr, "EVP_AEAD_CTX_init for AES-128-GCM failed.\n"); goto err; } @@ -428,6 +483,7 @@ int BORINGSSL_self_test(void) { kPlaintext, sizeof(kPlaintext), NULL, 0) || !check_test(kAESGCMCiphertext, output, sizeof(kAESGCMCiphertext), "AES-GCM Encryption KAT")) { + fprintf(stderr, "EVP_AEAD_CTX_seal for AES-128-GCM failed.\n"); goto err; } @@ -438,6 +494,7 @@ int BORINGSSL_self_test(void) { 0) || !check_test(kPlaintext, output, sizeof(kPlaintext), "AES-GCM Decryption KAT")) { + fprintf(stderr, "EVP_AEAD_CTX_open for AES-128-GCM failed.\n"); goto err; } @@ -488,7 +545,7 @@ int BORINGSSL_self_test(void) { rsa_key = self_test_rsa_key(); if (rsa_key == NULL) { - printf("RSA KeyGen failed\n"); + fprintf(stderr, "RSA KeyGen failed\n"); goto err; } @@ -503,19 +560,20 @@ int BORINGSSL_self_test(void) { &sig_len, rsa_key) || !check_test(kRSASignature, output, sizeof(kRSASignature), "RSA Sign KAT")) { + fprintf(stderr, "RSA signing test failed.\n"); goto err; } // RSA Verify KAT if (!RSA_verify(NID_sha256, kPlaintextSHA256, sizeof(kPlaintextSHA256), kRSASignature, sizeof(kRSASignature), rsa_key)) { - printf("RSA Verify KAT failed.\n"); + fprintf(stderr, "RSA Verify KAT failed.\n"); goto err; } ec_key = self_test_ecdsa_key(); if (ec_key == NULL) { - printf("ECDSA KeyGen failed\n"); + fprintf(stderr, "ECDSA KeyGen failed\n"); goto err; } @@ -525,7 +583,7 @@ int BORINGSSL_self_test(void) { ec_key->fixed_k = BN_new(); if (ec_key->fixed_k == NULL || !BN_set_word(ec_key->fixed_k, 42)) { - printf("Out of memory\n"); + fprintf(stderr, "Out of memory\n"); goto err; } @@ -540,7 +598,7 @@ int BORINGSSL_self_test(void) { !BN_bn2bin(sig->s, ecdsa_s_bytes) || !check_test(kECDSASigR, ecdsa_r_bytes, sizeof(kECDSASigR), "ECDSA R") || !check_test(kECDSASigS, ecdsa_s_bytes, sizeof(kECDSASigS), "ECDSA S")) { - printf("ECDSA KAT failed.\n"); + fprintf(stderr, "ECDSA KAT failed.\n"); goto err; } @@ -557,6 +615,7 @@ int BORINGSSL_self_test(void) { sizeof(kDRBGAD)) || !check_test(kDRBGReseedOutput, output, sizeof(kDRBGReseedOutput), "DRBG Reseed KAT")) { + fprintf(stderr, "CTR-DRBG failed.\n"); goto err; } CTR_DRBG_clear(&drbg); @@ -569,6 +628,16 @@ int BORINGSSL_self_test(void) { ret = 1; +#if defined(BORINGSSL_FIPS_SELF_TEST_FLAG_FILE) + // Tests were successful. Write flag file if requested. + if (module_hash_len != 0 && getenv(kFlagWriteEnableEnvVar) != NULL) { + const int fd = open(flag_path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd >= 0) { + close(fd); + } + } +#endif // BORINGSSL_FIPS_SELF_TEST_FLAG_FILE + err: EVP_AEAD_CTX_cleanup(&aead_ctx); RSA_free(rsa_key); @@ -578,4 +647,8 @@ int BORINGSSL_self_test(void) { return ret; } +int BORINGSSL_self_test(void) { + return boringssl_fips_self_test(NULL, 0); +} + #endif // !_MSC_VER diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/self_check/self_check.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c.grpc_back similarity index 88% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/self_check/self_check.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c.grpc_back index 468fd02f2..d8a61c392 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/self_check/self_check.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/self_check/self_check.c.grpc_back @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -35,20 +36,36 @@ // compile this. #if !defined(_MSC_VER) +#if defined(BORINGSSL_FIPS) && defined(OPENSSL_ANDROID) +// FIPS builds on Android will test for flag files, named after the module hash, +// in /dev/boringssl/selftest/. If such a flag file exists, it's assumed that +// self-tests have already passed and thus do not need to be repeated. (The +// integrity tests always run, however.) +// +// If self-tests complete successfully and the environment variable named in +// |kFlagWriteEnableEnvVar| is present, then the flag file will be created. The +// flag file isn't written without the environment variable being set in order +// to avoid SELinux violations on Android. +#define BORINGSSL_FIPS_SELF_TEST_FLAG_FILE +static const char kFlagPrefix[] = "/dev/boringssl/selftest/"; +static const char kFlagWriteEnableEnvVar[] = "BORINGSSL_SELF_TEST_CREATE_FLAG"; +#endif + static void hexdump(const uint8_t *in, size_t len) { for (size_t i = 0; i < len; i++) { - printf("%02x", in[i]); + fprintf(stderr, "%02x", in[i]); } } static int check_test(const void *expected, const void *actual, size_t expected_len, const char *name) { if (OPENSSL_memcmp(actual, expected, expected_len) != 0) { - printf("%s failed.\nExpected: ", name); + fprintf(stderr, "%s failed.\nExpected: ", name); hexdump(expected, expected_len); - printf("\nCalculated: "); + fprintf(stderr, "\nCalculated: "); hexdump(actual, expected_len); - printf("\n"); + fprintf(stderr, "\n"); + fflush(stderr); return 0; } return 1; @@ -226,7 +243,42 @@ static EC_KEY *self_test_ecdsa_key(void) { return ec_key; } -int BORINGSSL_self_test(void) { +#if defined(OPENSSL_ANDROID) +static const size_t kModuleDigestSize = SHA256_DIGEST_LENGTH; +#else +static const size_t kModuleDigestSize = SHA512_DIGEST_LENGTH; +#endif + +int boringssl_fips_self_test( + const uint8_t *module_hash, size_t module_hash_len) { +#if defined(BORINGSSL_FIPS_SELF_TEST_FLAG_FILE) + char flag_path[sizeof(kFlagPrefix) + 2*kModuleDigestSize]; + if (module_hash_len != 0) { + if (module_hash_len != kModuleDigestSize) { + fprintf(stderr, + "module hash of length %zu does not match expected length %zu\n", + module_hash_len, kModuleDigestSize); + BORINGSSL_FIPS_abort(); + } + + // Test whether the flag file exists. + memcpy(flag_path, kFlagPrefix, sizeof(kFlagPrefix) - 1); + static const char kHexTable[17] = "0123456789abcdef"; + for (size_t i = 0; i < kModuleDigestSize; i++) { + flag_path[sizeof(kFlagPrefix) - 1 + 2 * i] = + kHexTable[module_hash[i] >> 4]; + flag_path[sizeof(kFlagPrefix) - 1 + 2 * i + 1] = + kHexTable[module_hash[i] & 15]; + } + flag_path[sizeof(flag_path) - 1] = 0; + + if (access(flag_path, F_OK) == 0) { + // Flag file found. Skip self-tests. + return 1; + } + } +#endif // BORINGSSL_FIPS_SELF_TEST_FLAG_FILE + static const uint8_t kAESKey[16] = "BoringCrypto Key"; static const uint8_t kAESIV[16] = {0}; static const uint8_t kPlaintext[64] = @@ -393,6 +445,7 @@ int BORINGSSL_self_test(void) { // AES-CBC Encryption KAT memcpy(aes_iv, kAESIV, sizeof(kAESIV)); if (AES_set_encrypt_key(kAESKey, 8 * sizeof(kAESKey), &aes_key) != 0) { + fprintf(stderr, "AES_set_encrypt_key failed.\n"); goto err; } AES_cbc_encrypt(kPlaintext, output, sizeof(kPlaintext), &aes_key, aes_iv, @@ -405,6 +458,7 @@ int BORINGSSL_self_test(void) { // AES-CBC Decryption KAT memcpy(aes_iv, kAESIV, sizeof(kAESIV)); if (AES_set_decrypt_key(kAESKey, 8 * sizeof(kAESKey), &aes_key) != 0) { + fprintf(stderr, "AES_set_decrypt_key failed.\n"); goto err; } AES_cbc_encrypt(kAESCBCCiphertext, output, sizeof(kAESCBCCiphertext), @@ -419,6 +473,7 @@ int BORINGSSL_self_test(void) { OPENSSL_memset(nonce, 0, sizeof(nonce)); if (!EVP_AEAD_CTX_init(&aead_ctx, EVP_aead_aes_128_gcm(), kAESKey, sizeof(kAESKey), 0, NULL)) { + fprintf(stderr, "EVP_AEAD_CTX_init for AES-128-GCM failed.\n"); goto err; } @@ -428,6 +483,7 @@ int BORINGSSL_self_test(void) { kPlaintext, sizeof(kPlaintext), NULL, 0) || !check_test(kAESGCMCiphertext, output, sizeof(kAESGCMCiphertext), "AES-GCM Encryption KAT")) { + fprintf(stderr, "EVP_AEAD_CTX_seal for AES-128-GCM failed.\n"); goto err; } @@ -438,6 +494,7 @@ int BORINGSSL_self_test(void) { 0) || !check_test(kPlaintext, output, sizeof(kPlaintext), "AES-GCM Decryption KAT")) { + fprintf(stderr, "EVP_AEAD_CTX_open for AES-128-GCM failed.\n"); goto err; } @@ -488,7 +545,7 @@ int BORINGSSL_self_test(void) { rsa_key = self_test_rsa_key(); if (rsa_key == NULL) { - printf("RSA KeyGen failed\n"); + fprintf(stderr, "RSA KeyGen failed\n"); goto err; } @@ -503,19 +560,20 @@ int BORINGSSL_self_test(void) { &sig_len, rsa_key) || !check_test(kRSASignature, output, sizeof(kRSASignature), "RSA Sign KAT")) { + fprintf(stderr, "RSA signing test failed.\n"); goto err; } // RSA Verify KAT if (!RSA_verify(NID_sha256, kPlaintextSHA256, sizeof(kPlaintextSHA256), kRSASignature, sizeof(kRSASignature), rsa_key)) { - printf("RSA Verify KAT failed.\n"); + fprintf(stderr, "RSA Verify KAT failed.\n"); goto err; } ec_key = self_test_ecdsa_key(); if (ec_key == NULL) { - printf("ECDSA KeyGen failed\n"); + fprintf(stderr, "ECDSA KeyGen failed\n"); goto err; } @@ -525,7 +583,7 @@ int BORINGSSL_self_test(void) { ec_key->fixed_k = BN_new(); if (ec_key->fixed_k == NULL || !BN_set_word(ec_key->fixed_k, 42)) { - printf("Out of memory\n"); + fprintf(stderr, "Out of memory\n"); goto err; } @@ -540,7 +598,7 @@ int BORINGSSL_self_test(void) { !BN_bn2bin(sig->s, ecdsa_s_bytes) || !check_test(kECDSASigR, ecdsa_r_bytes, sizeof(kECDSASigR), "ECDSA R") || !check_test(kECDSASigS, ecdsa_s_bytes, sizeof(kECDSASigS), "ECDSA S")) { - printf("ECDSA KAT failed.\n"); + fprintf(stderr, "ECDSA KAT failed.\n"); goto err; } @@ -557,6 +615,7 @@ int BORINGSSL_self_test(void) { sizeof(kDRBGAD)) || !check_test(kDRBGReseedOutput, output, sizeof(kDRBGReseedOutput), "DRBG Reseed KAT")) { + fprintf(stderr, "CTR-DRBG failed.\n"); goto err; } CTR_DRBG_clear(&drbg); @@ -569,6 +628,16 @@ int BORINGSSL_self_test(void) { ret = 1; +#if defined(BORINGSSL_FIPS_SELF_TEST_FLAG_FILE) + // Tests were successful. Write flag file if requested. + if (module_hash_len != 0 && getenv(kFlagWriteEnableEnvVar) != NULL) { + const int fd = open(flag_path, O_WRONLY | O_CREAT | O_TRUNC, 0644); + if (fd >= 0) { + close(fd); + } + } +#endif // BORINGSSL_FIPS_SELF_TEST_FLAG_FILE + err: EVP_AEAD_CTX_cleanup(&aead_ctx); RSA_free(rsa_key); @@ -578,4 +647,8 @@ err: return ret; } +int BORINGSSL_self_test(void) { + return boringssl_fips_self_test(NULL, 0); +} + #endif // !_MSC_VER diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h new file mode 100644 index 000000000..9891ddf07 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h @@ -0,0 +1,53 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SHA_INTERNAL_H +#define OPENSSL_HEADER_SHA_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(OPENSSL_PPC64LE) || \ + (!defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))) +// POWER has an intrinsics-based implementation of SHA-1 and thus the functions +// normally defined in assembly are available even with |OPENSSL_NO_ASM| in +// this case. +#define SHA1_ASM +void sha1_block_data_order(uint32_t *state, const uint8_t *in, + size_t num_blocks); +#endif + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +#define SHA256_ASM +#define SHA512_ASM +void sha256_block_data_order(uint32_t *state, const uint8_t *in, + size_t num_blocks); +void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num_blocks); +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // OPENSSL_HEADER_SHA_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h.grpc_back new file mode 100644 index 000000000..cc9091495 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/internal.h.grpc_back @@ -0,0 +1,53 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SHA_INTERNAL_H +#define OPENSSL_HEADER_SHA_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(OPENSSL_PPC64LE) || \ + (!defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))) +// POWER has an intrinsics-based implementation of SHA-1 and thus the functions +// normally defined in assembly are available even with |OPENSSL_NO_ASM| in +// this case. +#define SHA1_ASM +void sha1_block_data_order(uint32_t *state, const uint8_t *in, + size_t num_blocks); +#endif + +#if !defined(OPENSSL_NO_ASM) && \ + (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ + defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) +#define SHA256_ASM +#define SHA512_ASM +void sha256_block_data_order(uint32_t *state, const uint8_t *in, + size_t num_blocks); +void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num_blocks); +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // OPENSSL_HEADER_SHA_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1-altivec.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1-altivec.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1-altivec.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c index 97a4856af..1e5aaea8d 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c @@ -60,16 +60,10 @@ #include +#include "internal.h" #include "../../internal.h" -#if (!defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))) || \ - defined(OPENSSL_PPC64LE) -#define SHA1_ASM -#endif - int SHA1_Init(SHA_CTX *sha) { OPENSSL_memset(sha, 0, sizeof(SHA_CTX)); sha->h[0] = 0x67452301UL; @@ -80,7 +74,7 @@ int SHA1_Init(SHA_CTX *sha) { return 1; } -uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t out[SHA_DIGEST_LENGTH]) { SHA_CTX ctx; SHA1_Init(&ctx); SHA1_Update(&ctx, data, len); @@ -93,6 +87,7 @@ uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out) { #define HASH_CTX SHA_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 20 #define HASH_MAKE_STRING(c, s) \ do { \ uint32_t ll; \ @@ -119,10 +114,10 @@ uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out) { (ix) = (a) = ROTATE((a), 1); \ } while (0) -#ifndef SHA1_ASM -static +#if !defined(SHA1_ASM) +static void sha1_block_data_order(uint32_t *state, const uint8_t *data, + size_t num); #endif -void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num); #include "../digest/md32_common.h" @@ -192,8 +187,8 @@ void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num); * "find" this expectation reasonable:-( On order to make such * compilers generate better code I replace X[] with a bunch of * X0, X1, etc. See the function body below... -* */ -#define X(i) XX##i +* */ +#define X(i) XX##i #if !defined(SHA1_ASM) static void sha1_block_data_order(uint32_t *state, const uint8_t *data, @@ -349,6 +344,7 @@ static void sha1_block_data_order(uint32_t *state, const uint8_t *data, #undef DATA_ORDER_IS_BIG_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_MAKE_STRING #undef HASH_UPDATE #undef HASH_TRANSFORM diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c.grpc_back index e5b4ba622..3b7619486 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha1.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha1.c.grpc_back @@ -60,16 +60,10 @@ #include +#include "internal.h" #include "../../internal.h" -#if (!defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64))) || \ - defined(OPENSSL_PPC64LE) -#define SHA1_ASM -#endif - int SHA1_Init(SHA_CTX *sha) { OPENSSL_memset(sha, 0, sizeof(SHA_CTX)); sha->h[0] = 0x67452301UL; @@ -80,7 +74,7 @@ int SHA1_Init(SHA_CTX *sha) { return 1; } -uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t out[SHA_DIGEST_LENGTH]) { SHA_CTX ctx; SHA1_Init(&ctx); SHA1_Update(&ctx, data, len); @@ -93,6 +87,7 @@ uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out) { #define HASH_CTX SHA_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 20 #define HASH_MAKE_STRING(c, s) \ do { \ uint32_t ll; \ @@ -119,10 +114,10 @@ uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out) { (ix) = (a) = ROTATE((a), 1); \ } while (0) -#ifndef SHA1_ASM -static +#if !defined(SHA1_ASM) +static void sha1_block_data_order(uint32_t *state, const uint8_t *data, + size_t num); #endif -void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num); #include "../digest/md32_common.h" @@ -192,8 +187,8 @@ void sha1_block_data_order(uint32_t *state, const uint8_t *data, size_t num); * "find" this expectation reasonable:-( On order to make such * compilers generate better code I replace X[] with a bunch of * X0, X1, etc. See the function body below... -* */ -#define X(i) XX##i +* */ +#define X(i) XX##i #if !defined(SHA1_ASM) static void sha1_block_data_order(uint32_t *state, const uint8_t *data, @@ -349,6 +344,7 @@ static void sha1_block_data_order(uint32_t *state, const uint8_t *data, #undef DATA_ORDER_IS_BIG_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_MAKE_STRING #undef HASH_UPDATE #undef HASH_TRANSFORM diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha256.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha256.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c index 9524d6450..fb7355333 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha256.c +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c @@ -60,15 +60,10 @@ #include +#include "internal.h" #include "../../internal.h" -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define SHA256_ASM -#endif - int SHA224_Init(SHA256_CTX *sha) { OPENSSL_memset(sha, 0, sizeof(SHA256_CTX)); sha->h[0] = 0xc1059ed8UL; @@ -97,7 +92,8 @@ int SHA256_Init(SHA256_CTX *sha) { return 1; } -uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *SHA224(const uint8_t *data, size_t len, + uint8_t out[SHA224_DIGEST_LENGTH]) { SHA256_CTX ctx; SHA224_Init(&ctx); SHA224_Update(&ctx, data, len); @@ -106,7 +102,8 @@ uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out) { return out; } -uint8_t *SHA256(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *SHA256(const uint8_t *data, size_t len, + uint8_t out[SHA256_DIGEST_LENGTH]) { SHA256_CTX ctx; SHA256_Init(&ctx); SHA256_Update(&ctx, data, len); @@ -119,14 +116,17 @@ int SHA224_Update(SHA256_CTX *ctx, const void *data, size_t len) { return SHA256_Update(ctx, data, len); } -int SHA224_Final(uint8_t *md, SHA256_CTX *ctx) { - return SHA256_Final(md, ctx); +int SHA224_Final(uint8_t out[SHA224_DIGEST_LENGTH], SHA256_CTX *ctx) { + // SHA224_Init sets |ctx->md_len| to |SHA224_DIGEST_LENGTH|, so this has a + // smaller output. + return SHA256_Final(out, ctx); } #define DATA_ORDER_IS_BIG_ENDIAN #define HASH_CTX SHA256_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 32 // Note that FIPS180-2 discusses "Truncation of the Hash Function Output." // default: case below covers for it. It's not clear however if it's permitted @@ -172,9 +172,9 @@ int SHA224_Final(uint8_t *md, SHA256_CTX *ctx) { #define HASH_FINAL SHA256_Final #define HASH_BLOCK_DATA_ORDER sha256_block_data_order #ifndef SHA256_ASM -static +static void sha256_block_data_order(uint32_t *state, const uint8_t *in, + size_t num); #endif -void sha256_block_data_order(uint32_t *state, const uint8_t *in, size_t num); #include "../digest/md32_common.h" @@ -316,9 +316,15 @@ static void sha256_block_data_order(uint32_t *state, const uint8_t *data, #endif // !SHA256_ASM +void SHA256_TransformBlocks(uint32_t state[8], const uint8_t *data, + size_t num_blocks) { + sha256_block_data_order(state, data, num_blocks); +} + #undef DATA_ORDER_IS_BIG_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_MAKE_STRING #undef HASH_UPDATE #undef HASH_TRANSFORM diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha256.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha256.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c.grpc_back index 6d709a67b..0e4244611 100644 --- a/Pods/BoringSSL-GRPC/crypto/fipsmodule/sha/sha256.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha256.c.grpc_back @@ -60,15 +60,10 @@ #include +#include "internal.h" #include "../../internal.h" -#if !defined(OPENSSL_NO_ASM) && \ - (defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || \ - defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) -#define SHA256_ASM -#endif - int SHA224_Init(SHA256_CTX *sha) { OPENSSL_memset(sha, 0, sizeof(SHA256_CTX)); sha->h[0] = 0xc1059ed8UL; @@ -97,7 +92,8 @@ int SHA256_Init(SHA256_CTX *sha) { return 1; } -uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *SHA224(const uint8_t *data, size_t len, + uint8_t out[SHA224_DIGEST_LENGTH]) { SHA256_CTX ctx; SHA224_Init(&ctx); SHA224_Update(&ctx, data, len); @@ -106,7 +102,8 @@ uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out) { return out; } -uint8_t *SHA256(const uint8_t *data, size_t len, uint8_t *out) { +uint8_t *SHA256(const uint8_t *data, size_t len, + uint8_t out[SHA256_DIGEST_LENGTH]) { SHA256_CTX ctx; SHA256_Init(&ctx); SHA256_Update(&ctx, data, len); @@ -119,14 +116,17 @@ int SHA224_Update(SHA256_CTX *ctx, const void *data, size_t len) { return SHA256_Update(ctx, data, len); } -int SHA224_Final(uint8_t *md, SHA256_CTX *ctx) { - return SHA256_Final(md, ctx); +int SHA224_Final(uint8_t out[SHA224_DIGEST_LENGTH], SHA256_CTX *ctx) { + // SHA224_Init sets |ctx->md_len| to |SHA224_DIGEST_LENGTH|, so this has a + // smaller output. + return SHA256_Final(out, ctx); } #define DATA_ORDER_IS_BIG_ENDIAN #define HASH_CTX SHA256_CTX #define HASH_CBLOCK 64 +#define HASH_DIGEST_LENGTH 32 // Note that FIPS180-2 discusses "Truncation of the Hash Function Output." // default: case below covers for it. It's not clear however if it's permitted @@ -172,9 +172,9 @@ int SHA224_Final(uint8_t *md, SHA256_CTX *ctx) { #define HASH_FINAL SHA256_Final #define HASH_BLOCK_DATA_ORDER sha256_block_data_order #ifndef SHA256_ASM -static +static void sha256_block_data_order(uint32_t *state, const uint8_t *in, + size_t num); #endif -void sha256_block_data_order(uint32_t *state, const uint8_t *in, size_t num); #include "../digest/md32_common.h" @@ -316,9 +316,15 @@ static void sha256_block_data_order(uint32_t *state, const uint8_t *data, #endif // !SHA256_ASM +void SHA256_TransformBlocks(uint32_t state[8], const uint8_t *data, + size_t num_blocks) { + sha256_block_data_order(state, data, num_blocks); +} + #undef DATA_ORDER_IS_BIG_ENDIAN #undef HASH_CTX #undef HASH_CBLOCK +#undef HASH_DIGEST_LENGTH #undef HASH_MAKE_STRING #undef HASH_UPDATE #undef HASH_TRANSFORM diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c new file mode 100644 index 000000000..7a0b89f26 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c @@ -0,0 +1,535 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include + +#include + +#include "internal.h" +#include "../../internal.h" + + +// The 32-bit hash algorithms share a common byte-order neutral collector and +// padding function implementations that operate on unaligned data, +// ../digest/md32_common.h. SHA-512 is the only 64-bit hash algorithm, as of +// this writing, so there is no need for a common collector/padding +// implementation yet. + +int SHA384_Init(SHA512_CTX *sha) { + sha->h[0] = UINT64_C(0xcbbb9d5dc1059ed8); + sha->h[1] = UINT64_C(0x629a292a367cd507); + sha->h[2] = UINT64_C(0x9159015a3070dd17); + sha->h[3] = UINT64_C(0x152fecd8f70e5939); + sha->h[4] = UINT64_C(0x67332667ffc00b31); + sha->h[5] = UINT64_C(0x8eb44a8768581511); + sha->h[6] = UINT64_C(0xdb0c2e0d64f98fa7); + sha->h[7] = UINT64_C(0x47b5481dbefa4fa4); + + sha->Nl = 0; + sha->Nh = 0; + sha->num = 0; + sha->md_len = SHA384_DIGEST_LENGTH; + return 1; +} + + +int SHA512_Init(SHA512_CTX *sha) { + sha->h[0] = UINT64_C(0x6a09e667f3bcc908); + sha->h[1] = UINT64_C(0xbb67ae8584caa73b); + sha->h[2] = UINT64_C(0x3c6ef372fe94f82b); + sha->h[3] = UINT64_C(0xa54ff53a5f1d36f1); + sha->h[4] = UINT64_C(0x510e527fade682d1); + sha->h[5] = UINT64_C(0x9b05688c2b3e6c1f); + sha->h[6] = UINT64_C(0x1f83d9abfb41bd6b); + sha->h[7] = UINT64_C(0x5be0cd19137e2179); + + sha->Nl = 0; + sha->Nh = 0; + sha->num = 0; + sha->md_len = SHA512_DIGEST_LENGTH; + return 1; +} + +uint8_t *SHA384(const uint8_t *data, size_t len, + uint8_t out[SHA384_DIGEST_LENGTH]) { + SHA512_CTX ctx; + SHA384_Init(&ctx); + SHA384_Update(&ctx, data, len); + SHA384_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +uint8_t *SHA512(const uint8_t *data, size_t len, + uint8_t out[SHA512_DIGEST_LENGTH]) { + SHA512_CTX ctx; + SHA512_Init(&ctx); + SHA512_Update(&ctx, data, len); + SHA512_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +#if !defined(SHA512_ASM) +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num_blocks); +#endif + + +int SHA384_Final(uint8_t out[SHA384_DIGEST_LENGTH], SHA512_CTX *sha) { + // |SHA384_Init| sets |sha->md_len| to |SHA384_DIGEST_LENGTH|, so this has a + // |smaller output. + return SHA512_Final(out, sha); +} + +int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len) { + return SHA512_Update(sha, data, len); +} + +void SHA512_Transform(SHA512_CTX *c, const uint8_t block[SHA512_CBLOCK]) { + sha512_block_data_order(c->h, block, 1); +} + +int SHA512_Update(SHA512_CTX *c, const void *in_data, size_t len) { + uint64_t l; + uint8_t *p = c->p; + const uint8_t *data = in_data; + + if (len == 0) { + return 1; + } + + l = (c->Nl + (((uint64_t)len) << 3)) & UINT64_C(0xffffffffffffffff); + if (l < c->Nl) { + c->Nh++; + } + if (sizeof(len) >= 8) { + c->Nh += (((uint64_t)len) >> 61); + } + c->Nl = l; + + if (c->num != 0) { + size_t n = sizeof(c->p) - c->num; + + if (len < n) { + OPENSSL_memcpy(p + c->num, data, len); + c->num += (unsigned int)len; + return 1; + } else { + OPENSSL_memcpy(p + c->num, data, n), c->num = 0; + len -= n; + data += n; + sha512_block_data_order(c->h, p, 1); + } + } + + if (len >= sizeof(c->p)) { + sha512_block_data_order(c->h, data, len / sizeof(c->p)); + data += len; + len %= sizeof(c->p); + data -= len; + } + + if (len != 0) { + OPENSSL_memcpy(p, data, len); + c->num = (int)len; + } + + return 1; +} + +int SHA512_Final(uint8_t out[SHA512_DIGEST_LENGTH], SHA512_CTX *sha) { + uint8_t *p = sha->p; + size_t n = sha->num; + + p[n] = 0x80; // There always is a room for one + n++; + if (n > (sizeof(sha->p) - 16)) { + OPENSSL_memset(p + n, 0, sizeof(sha->p) - n); + n = 0; + sha512_block_data_order(sha->h, p, 1); + } + + OPENSSL_memset(p + n, 0, sizeof(sha->p) - 16 - n); + p[sizeof(sha->p) - 1] = (uint8_t)(sha->Nl); + p[sizeof(sha->p) - 2] = (uint8_t)(sha->Nl >> 8); + p[sizeof(sha->p) - 3] = (uint8_t)(sha->Nl >> 16); + p[sizeof(sha->p) - 4] = (uint8_t)(sha->Nl >> 24); + p[sizeof(sha->p) - 5] = (uint8_t)(sha->Nl >> 32); + p[sizeof(sha->p) - 6] = (uint8_t)(sha->Nl >> 40); + p[sizeof(sha->p) - 7] = (uint8_t)(sha->Nl >> 48); + p[sizeof(sha->p) - 8] = (uint8_t)(sha->Nl >> 56); + p[sizeof(sha->p) - 9] = (uint8_t)(sha->Nh); + p[sizeof(sha->p) - 10] = (uint8_t)(sha->Nh >> 8); + p[sizeof(sha->p) - 11] = (uint8_t)(sha->Nh >> 16); + p[sizeof(sha->p) - 12] = (uint8_t)(sha->Nh >> 24); + p[sizeof(sha->p) - 13] = (uint8_t)(sha->Nh >> 32); + p[sizeof(sha->p) - 14] = (uint8_t)(sha->Nh >> 40); + p[sizeof(sha->p) - 15] = (uint8_t)(sha->Nh >> 48); + p[sizeof(sha->p) - 16] = (uint8_t)(sha->Nh >> 56); + + sha512_block_data_order(sha->h, p, 1); + + if (out == NULL) { + // TODO(davidben): This NULL check is absent in other low-level hash 'final' + // functions and is one of the few places one can fail. + return 0; + } + + switch (sha->md_len) { + // Let compiler decide if it's appropriate to unroll... + case SHA384_DIGEST_LENGTH: + for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) { + uint64_t t = sha->h[n]; + + *(out++) = (uint8_t)(t >> 56); + *(out++) = (uint8_t)(t >> 48); + *(out++) = (uint8_t)(t >> 40); + *(out++) = (uint8_t)(t >> 32); + *(out++) = (uint8_t)(t >> 24); + *(out++) = (uint8_t)(t >> 16); + *(out++) = (uint8_t)(t >> 8); + *(out++) = (uint8_t)(t); + } + break; + case SHA512_DIGEST_LENGTH: + for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) { + uint64_t t = sha->h[n]; + + *(out++) = (uint8_t)(t >> 56); + *(out++) = (uint8_t)(t >> 48); + *(out++) = (uint8_t)(t >> 40); + *(out++) = (uint8_t)(t >> 32); + *(out++) = (uint8_t)(t >> 24); + *(out++) = (uint8_t)(t >> 16); + *(out++) = (uint8_t)(t >> 8); + *(out++) = (uint8_t)(t); + } + break; + // ... as well as make sure md_len is not abused. + default: + // TODO(davidben): This bad |md_len| case is one of the few places a + // low-level hash 'final' function can fail. This should never happen. + return 0; + } + + return 1; +} + +#ifndef SHA512_ASM +static const uint64_t K512[80] = { + UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), + UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), + UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019), + UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118), + UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe), + UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2), + UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1), + UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694), + UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3), + UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65), + UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483), + UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5), + UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210), + UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4), + UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725), + UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70), + UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926), + UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df), + UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8), + UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b), + UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001), + UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30), + UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910), + UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8), + UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53), + UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8), + UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb), + UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3), + UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60), + UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec), + UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9), + UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b), + UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207), + UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178), + UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6), + UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b), + UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493), + UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c), + UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a), + UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817), +}; + +#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) +#if defined(__x86_64) || defined(__x86_64__) +#define ROTR(a, n) \ + ({ \ + uint64_t ret; \ + __asm__("rorq %1, %0" : "=r"(ret) : "J"(n), "0"(a) : "cc"); \ + ret; \ + }) +#elif(defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) +#define ROTR(a, n) \ + ({ \ + uint64_t ret; \ + __asm__("rotrdi %0, %1, %2" : "=r"(ret) : "r"(a), "K"(n)); \ + ret; \ + }) +#elif defined(__aarch64__) +#define ROTR(a, n) \ + ({ \ + uint64_t ret; \ + __asm__("ror %0, %1, %2" : "=r"(ret) : "r"(a), "I"(n)); \ + ret; \ + }) +#endif +#elif defined(_MSC_VER) && defined(_WIN64) +#pragma intrinsic(_rotr64) +#define ROTR(a, n) _rotr64((a), n) +#endif + +#ifndef ROTR +#define ROTR(x, s) (((x) >> s) | (x) << (64 - s)) +#endif + +static inline uint64_t load_u64_be(const void *ptr) { + uint64_t ret; + OPENSSL_memcpy(&ret, ptr, sizeof(ret)); + return CRYPTO_bswap8(ret); +} + +#define Sigma0(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) +#define Sigma1(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) +#define sigma0(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) +#define sigma1(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) + +#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + + +#if defined(__i386) || defined(__i386__) || defined(_M_IX86) +// This code should give better results on 32-bit CPU with less than +// ~24 registers, both size and performance wise... +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num) { + uint64_t A, E, T; + uint64_t X[9 + 80], *F; + int i; + + while (num--) { + F = X + 80; + A = state[0]; + F[1] = state[1]; + F[2] = state[2]; + F[3] = state[3]; + E = state[4]; + F[5] = state[5]; + F[6] = state[6]; + F[7] = state[7]; + + for (i = 0; i < 16; i++, F--) { + T = load_u64_be(in + i * 8); + F[0] = A; + F[4] = E; + F[8] = T; + T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; + E = F[3] + T; + A = T + Sigma0(A) + Maj(A, F[1], F[2]); + } + + for (; i < 80; i++, F--) { + T = sigma0(F[8 + 16 - 1]); + T += sigma1(F[8 + 16 - 14]); + T += F[8 + 16] + F[8 + 16 - 9]; + + F[0] = A; + F[4] = E; + F[8] = T; + T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; + E = F[3] + T; + A = T + Sigma0(A) + Maj(A, F[1], F[2]); + } + + state[0] += A; + state[1] += F[1]; + state[2] += F[2]; + state[3] += F[3]; + state[4] += E; + state[5] += F[5]; + state[6] += F[6]; + state[7] += F[7]; + + in += 16 * 8; + } +} + +#else + +#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ + do { \ + T1 += h + Sigma1(e) + Ch(e, f, g) + K512[i]; \ + h = Sigma0(a) + Maj(a, b, c); \ + d += T1; \ + h += T1; \ + } while (0) + +#define ROUND_16_80(i, j, a, b, c, d, e, f, g, h, X) \ + do { \ + s0 = X[(j + 1) & 0x0f]; \ + s0 = sigma0(s0); \ + s1 = X[(j + 14) & 0x0f]; \ + s1 = sigma1(s1); \ + T1 = X[(j) & 0x0f] += s0 + s1 + X[(j + 9) & 0x0f]; \ + ROUND_00_15(i + j, a, b, c, d, e, f, g, h); \ + } while (0) + +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num) { + uint64_t a, b, c, d, e, f, g, h, s0, s1, T1; + uint64_t X[16]; + int i; + + while (num--) { + + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + f = state[5]; + g = state[6]; + h = state[7]; + + T1 = X[0] = load_u64_be(in); + ROUND_00_15(0, a, b, c, d, e, f, g, h); + T1 = X[1] = load_u64_be(in + 8); + ROUND_00_15(1, h, a, b, c, d, e, f, g); + T1 = X[2] = load_u64_be(in + 2 * 8); + ROUND_00_15(2, g, h, a, b, c, d, e, f); + T1 = X[3] = load_u64_be(in + 3 * 8); + ROUND_00_15(3, f, g, h, a, b, c, d, e); + T1 = X[4] = load_u64_be(in + 4 * 8); + ROUND_00_15(4, e, f, g, h, a, b, c, d); + T1 = X[5] = load_u64_be(in + 5 * 8); + ROUND_00_15(5, d, e, f, g, h, a, b, c); + T1 = X[6] = load_u64_be(in + 6 * 8); + ROUND_00_15(6, c, d, e, f, g, h, a, b); + T1 = X[7] = load_u64_be(in + 7 * 8); + ROUND_00_15(7, b, c, d, e, f, g, h, a); + T1 = X[8] = load_u64_be(in + 8 * 8); + ROUND_00_15(8, a, b, c, d, e, f, g, h); + T1 = X[9] = load_u64_be(in + 9 * 8); + ROUND_00_15(9, h, a, b, c, d, e, f, g); + T1 = X[10] = load_u64_be(in + 10 * 8); + ROUND_00_15(10, g, h, a, b, c, d, e, f); + T1 = X[11] = load_u64_be(in + 11 * 8); + ROUND_00_15(11, f, g, h, a, b, c, d, e); + T1 = X[12] = load_u64_be(in + 12 * 8); + ROUND_00_15(12, e, f, g, h, a, b, c, d); + T1 = X[13] = load_u64_be(in + 13 * 8); + ROUND_00_15(13, d, e, f, g, h, a, b, c); + T1 = X[14] = load_u64_be(in + 14 * 8); + ROUND_00_15(14, c, d, e, f, g, h, a, b); + T1 = X[15] = load_u64_be(in + 15 * 8); + ROUND_00_15(15, b, c, d, e, f, g, h, a); + + for (i = 16; i < 80; i += 16) { + ROUND_16_80(i, 0, a, b, c, d, e, f, g, h, X); + ROUND_16_80(i, 1, h, a, b, c, d, e, f, g, X); + ROUND_16_80(i, 2, g, h, a, b, c, d, e, f, X); + ROUND_16_80(i, 3, f, g, h, a, b, c, d, e, X); + ROUND_16_80(i, 4, e, f, g, h, a, b, c, d, X); + ROUND_16_80(i, 5, d, e, f, g, h, a, b, c, X); + ROUND_16_80(i, 6, c, d, e, f, g, h, a, b, X); + ROUND_16_80(i, 7, b, c, d, e, f, g, h, a, X); + ROUND_16_80(i, 8, a, b, c, d, e, f, g, h, X); + ROUND_16_80(i, 9, h, a, b, c, d, e, f, g, X); + ROUND_16_80(i, 10, g, h, a, b, c, d, e, f, X); + ROUND_16_80(i, 11, f, g, h, a, b, c, d, e, X); + ROUND_16_80(i, 12, e, f, g, h, a, b, c, d, X); + ROUND_16_80(i, 13, d, e, f, g, h, a, b, c, X); + ROUND_16_80(i, 14, c, d, e, f, g, h, a, b, X); + ROUND_16_80(i, 15, b, c, d, e, f, g, h, a, X); + } + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + state[5] += f; + state[6] += g; + state[7] += h; + + in += 16 * 8; + } +} + +#endif + +#endif // !SHA512_ASM + +#undef ROTR +#undef Sigma0 +#undef Sigma1 +#undef sigma0 +#undef sigma1 +#undef Ch +#undef Maj +#undef ROUND_00_15 +#undef ROUND_16_80 diff --git a/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c.grpc_back new file mode 100644 index 000000000..848f3b621 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/sha/sha512.c.grpc_back @@ -0,0 +1,535 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include + +#include + +#include "internal.h" +#include "../../internal.h" + + +// The 32-bit hash algorithms share a common byte-order neutral collector and +// padding function implementations that operate on unaligned data, +// ../digest/md32_common.h. SHA-512 is the only 64-bit hash algorithm, as of +// this writing, so there is no need for a common collector/padding +// implementation yet. + +int SHA384_Init(SHA512_CTX *sha) { + sha->h[0] = UINT64_C(0xcbbb9d5dc1059ed8); + sha->h[1] = UINT64_C(0x629a292a367cd507); + sha->h[2] = UINT64_C(0x9159015a3070dd17); + sha->h[3] = UINT64_C(0x152fecd8f70e5939); + sha->h[4] = UINT64_C(0x67332667ffc00b31); + sha->h[5] = UINT64_C(0x8eb44a8768581511); + sha->h[6] = UINT64_C(0xdb0c2e0d64f98fa7); + sha->h[7] = UINT64_C(0x47b5481dbefa4fa4); + + sha->Nl = 0; + sha->Nh = 0; + sha->num = 0; + sha->md_len = SHA384_DIGEST_LENGTH; + return 1; +} + + +int SHA512_Init(SHA512_CTX *sha) { + sha->h[0] = UINT64_C(0x6a09e667f3bcc908); + sha->h[1] = UINT64_C(0xbb67ae8584caa73b); + sha->h[2] = UINT64_C(0x3c6ef372fe94f82b); + sha->h[3] = UINT64_C(0xa54ff53a5f1d36f1); + sha->h[4] = UINT64_C(0x510e527fade682d1); + sha->h[5] = UINT64_C(0x9b05688c2b3e6c1f); + sha->h[6] = UINT64_C(0x1f83d9abfb41bd6b); + sha->h[7] = UINT64_C(0x5be0cd19137e2179); + + sha->Nl = 0; + sha->Nh = 0; + sha->num = 0; + sha->md_len = SHA512_DIGEST_LENGTH; + return 1; +} + +uint8_t *SHA384(const uint8_t *data, size_t len, + uint8_t out[SHA384_DIGEST_LENGTH]) { + SHA512_CTX ctx; + SHA384_Init(&ctx); + SHA384_Update(&ctx, data, len); + SHA384_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +uint8_t *SHA512(const uint8_t *data, size_t len, + uint8_t out[SHA512_DIGEST_LENGTH]) { + SHA512_CTX ctx; + SHA512_Init(&ctx); + SHA512_Update(&ctx, data, len); + SHA512_Final(out, &ctx); + OPENSSL_cleanse(&ctx, sizeof(ctx)); + return out; +} + +#if !defined(SHA512_ASM) +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num_blocks); +#endif + + +int SHA384_Final(uint8_t out[SHA384_DIGEST_LENGTH], SHA512_CTX *sha) { + // |SHA384_Init| sets |sha->md_len| to |SHA384_DIGEST_LENGTH|, so this has a + // |smaller output. + return SHA512_Final(out, sha); +} + +int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len) { + return SHA512_Update(sha, data, len); +} + +void SHA512_Transform(SHA512_CTX *c, const uint8_t block[SHA512_CBLOCK]) { + sha512_block_data_order(c->h, block, 1); +} + +int SHA512_Update(SHA512_CTX *c, const void *in_data, size_t len) { + uint64_t l; + uint8_t *p = c->p; + const uint8_t *data = in_data; + + if (len == 0) { + return 1; + } + + l = (c->Nl + (((uint64_t)len) << 3)) & UINT64_C(0xffffffffffffffff); + if (l < c->Nl) { + c->Nh++; + } + if (sizeof(len) >= 8) { + c->Nh += (((uint64_t)len) >> 61); + } + c->Nl = l; + + if (c->num != 0) { + size_t n = sizeof(c->p) - c->num; + + if (len < n) { + OPENSSL_memcpy(p + c->num, data, len); + c->num += (unsigned int)len; + return 1; + } else { + OPENSSL_memcpy(p + c->num, data, n), c->num = 0; + len -= n; + data += n; + sha512_block_data_order(c->h, p, 1); + } + } + + if (len >= sizeof(c->p)) { + sha512_block_data_order(c->h, data, len / sizeof(c->p)); + data += len; + len %= sizeof(c->p); + data -= len; + } + + if (len != 0) { + OPENSSL_memcpy(p, data, len); + c->num = (int)len; + } + + return 1; +} + +int SHA512_Final(uint8_t out[SHA512_DIGEST_LENGTH], SHA512_CTX *sha) { + uint8_t *p = sha->p; + size_t n = sha->num; + + p[n] = 0x80; // There always is a room for one + n++; + if (n > (sizeof(sha->p) - 16)) { + OPENSSL_memset(p + n, 0, sizeof(sha->p) - n); + n = 0; + sha512_block_data_order(sha->h, p, 1); + } + + OPENSSL_memset(p + n, 0, sizeof(sha->p) - 16 - n); + p[sizeof(sha->p) - 1] = (uint8_t)(sha->Nl); + p[sizeof(sha->p) - 2] = (uint8_t)(sha->Nl >> 8); + p[sizeof(sha->p) - 3] = (uint8_t)(sha->Nl >> 16); + p[sizeof(sha->p) - 4] = (uint8_t)(sha->Nl >> 24); + p[sizeof(sha->p) - 5] = (uint8_t)(sha->Nl >> 32); + p[sizeof(sha->p) - 6] = (uint8_t)(sha->Nl >> 40); + p[sizeof(sha->p) - 7] = (uint8_t)(sha->Nl >> 48); + p[sizeof(sha->p) - 8] = (uint8_t)(sha->Nl >> 56); + p[sizeof(sha->p) - 9] = (uint8_t)(sha->Nh); + p[sizeof(sha->p) - 10] = (uint8_t)(sha->Nh >> 8); + p[sizeof(sha->p) - 11] = (uint8_t)(sha->Nh >> 16); + p[sizeof(sha->p) - 12] = (uint8_t)(sha->Nh >> 24); + p[sizeof(sha->p) - 13] = (uint8_t)(sha->Nh >> 32); + p[sizeof(sha->p) - 14] = (uint8_t)(sha->Nh >> 40); + p[sizeof(sha->p) - 15] = (uint8_t)(sha->Nh >> 48); + p[sizeof(sha->p) - 16] = (uint8_t)(sha->Nh >> 56); + + sha512_block_data_order(sha->h, p, 1); + + if (out == NULL) { + // TODO(davidben): This NULL check is absent in other low-level hash 'final' + // functions and is one of the few places one can fail. + return 0; + } + + switch (sha->md_len) { + // Let compiler decide if it's appropriate to unroll... + case SHA384_DIGEST_LENGTH: + for (n = 0; n < SHA384_DIGEST_LENGTH / 8; n++) { + uint64_t t = sha->h[n]; + + *(out++) = (uint8_t)(t >> 56); + *(out++) = (uint8_t)(t >> 48); + *(out++) = (uint8_t)(t >> 40); + *(out++) = (uint8_t)(t >> 32); + *(out++) = (uint8_t)(t >> 24); + *(out++) = (uint8_t)(t >> 16); + *(out++) = (uint8_t)(t >> 8); + *(out++) = (uint8_t)(t); + } + break; + case SHA512_DIGEST_LENGTH: + for (n = 0; n < SHA512_DIGEST_LENGTH / 8; n++) { + uint64_t t = sha->h[n]; + + *(out++) = (uint8_t)(t >> 56); + *(out++) = (uint8_t)(t >> 48); + *(out++) = (uint8_t)(t >> 40); + *(out++) = (uint8_t)(t >> 32); + *(out++) = (uint8_t)(t >> 24); + *(out++) = (uint8_t)(t >> 16); + *(out++) = (uint8_t)(t >> 8); + *(out++) = (uint8_t)(t); + } + break; + // ... as well as make sure md_len is not abused. + default: + // TODO(davidben): This bad |md_len| case is one of the few places a + // low-level hash 'final' function can fail. This should never happen. + return 0; + } + + return 1; +} + +#ifndef SHA512_ASM +static const uint64_t K512[80] = { + UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), + UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), + UINT64_C(0x3956c25bf348b538), UINT64_C(0x59f111f1b605d019), + UINT64_C(0x923f82a4af194f9b), UINT64_C(0xab1c5ed5da6d8118), + UINT64_C(0xd807aa98a3030242), UINT64_C(0x12835b0145706fbe), + UINT64_C(0x243185be4ee4b28c), UINT64_C(0x550c7dc3d5ffb4e2), + UINT64_C(0x72be5d74f27b896f), UINT64_C(0x80deb1fe3b1696b1), + UINT64_C(0x9bdc06a725c71235), UINT64_C(0xc19bf174cf692694), + UINT64_C(0xe49b69c19ef14ad2), UINT64_C(0xefbe4786384f25e3), + UINT64_C(0x0fc19dc68b8cd5b5), UINT64_C(0x240ca1cc77ac9c65), + UINT64_C(0x2de92c6f592b0275), UINT64_C(0x4a7484aa6ea6e483), + UINT64_C(0x5cb0a9dcbd41fbd4), UINT64_C(0x76f988da831153b5), + UINT64_C(0x983e5152ee66dfab), UINT64_C(0xa831c66d2db43210), + UINT64_C(0xb00327c898fb213f), UINT64_C(0xbf597fc7beef0ee4), + UINT64_C(0xc6e00bf33da88fc2), UINT64_C(0xd5a79147930aa725), + UINT64_C(0x06ca6351e003826f), UINT64_C(0x142929670a0e6e70), + UINT64_C(0x27b70a8546d22ffc), UINT64_C(0x2e1b21385c26c926), + UINT64_C(0x4d2c6dfc5ac42aed), UINT64_C(0x53380d139d95b3df), + UINT64_C(0x650a73548baf63de), UINT64_C(0x766a0abb3c77b2a8), + UINT64_C(0x81c2c92e47edaee6), UINT64_C(0x92722c851482353b), + UINT64_C(0xa2bfe8a14cf10364), UINT64_C(0xa81a664bbc423001), + UINT64_C(0xc24b8b70d0f89791), UINT64_C(0xc76c51a30654be30), + UINT64_C(0xd192e819d6ef5218), UINT64_C(0xd69906245565a910), + UINT64_C(0xf40e35855771202a), UINT64_C(0x106aa07032bbd1b8), + UINT64_C(0x19a4c116b8d2d0c8), UINT64_C(0x1e376c085141ab53), + UINT64_C(0x2748774cdf8eeb99), UINT64_C(0x34b0bcb5e19b48a8), + UINT64_C(0x391c0cb3c5c95a63), UINT64_C(0x4ed8aa4ae3418acb), + UINT64_C(0x5b9cca4f7763e373), UINT64_C(0x682e6ff3d6b2b8a3), + UINT64_C(0x748f82ee5defb2fc), UINT64_C(0x78a5636f43172f60), + UINT64_C(0x84c87814a1f0ab72), UINT64_C(0x8cc702081a6439ec), + UINT64_C(0x90befffa23631e28), UINT64_C(0xa4506cebde82bde9), + UINT64_C(0xbef9a3f7b2c67915), UINT64_C(0xc67178f2e372532b), + UINT64_C(0xca273eceea26619c), UINT64_C(0xd186b8c721c0c207), + UINT64_C(0xeada7dd6cde0eb1e), UINT64_C(0xf57d4f7fee6ed178), + UINT64_C(0x06f067aa72176fba), UINT64_C(0x0a637dc5a2c898a6), + UINT64_C(0x113f9804bef90dae), UINT64_C(0x1b710b35131c471b), + UINT64_C(0x28db77f523047d84), UINT64_C(0x32caab7b40c72493), + UINT64_C(0x3c9ebe0a15c9bebc), UINT64_C(0x431d67c49c100d4c), + UINT64_C(0x4cc5d4becb3e42b6), UINT64_C(0x597f299cfc657e2a), + UINT64_C(0x5fcb6fab3ad6faec), UINT64_C(0x6c44198c4a475817), +}; + +#if defined(__GNUC__) && __GNUC__ >= 2 && !defined(OPENSSL_NO_ASM) +#if defined(__x86_64) || defined(__x86_64__) +#define ROTR(a, n) \ + ({ \ + uint64_t ret; \ + __asm__("rorq %1, %0" : "=r"(ret) : "J"(n), "0"(a) : "cc"); \ + ret; \ + }) +#elif(defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) +#define ROTR(a, n) \ + ({ \ + uint64_t ret; \ + __asm__("rotrdi %0, %1, %2" : "=r"(ret) : "r"(a), "K"(n)); \ + ret; \ + }) +#elif defined(__aarch64__) +#define ROTR(a, n) \ + ({ \ + uint64_t ret; \ + __asm__("ror %0, %1, %2" : "=r"(ret) : "r"(a), "I"(n)); \ + ret; \ + }) +#endif +#elif defined(_MSC_VER) && defined(_WIN64) +#pragma intrinsic(_rotr64) +#define ROTR(a, n) _rotr64((a), n) +#endif + +#ifndef ROTR +#define ROTR(x, s) (((x) >> s) | (x) << (64 - s)) +#endif + +static inline uint64_t load_u64_be(const void *ptr) { + uint64_t ret; + OPENSSL_memcpy(&ret, ptr, sizeof(ret)); + return CRYPTO_bswap8(ret); +} + +#define Sigma0(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) +#define Sigma1(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) +#define sigma0(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) +#define sigma1(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) + +#define Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) +#define Maj(x, y, z) (((x) & (y)) ^ ((x) & (z)) ^ ((y) & (z))) + + +#if defined(__i386) || defined(__i386__) || defined(_M_IX86) +// This code should give better results on 32-bit CPU with less than +// ~24 registers, both size and performance wise... +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num) { + uint64_t A, E, T; + uint64_t X[9 + 80], *F; + int i; + + while (num--) { + F = X + 80; + A = state[0]; + F[1] = state[1]; + F[2] = state[2]; + F[3] = state[3]; + E = state[4]; + F[5] = state[5]; + F[6] = state[6]; + F[7] = state[7]; + + for (i = 0; i < 16; i++, F--) { + T = load_u64_be(in + i * 8); + F[0] = A; + F[4] = E; + F[8] = T; + T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; + E = F[3] + T; + A = T + Sigma0(A) + Maj(A, F[1], F[2]); + } + + for (; i < 80; i++, F--) { + T = sigma0(F[8 + 16 - 1]); + T += sigma1(F[8 + 16 - 14]); + T += F[8 + 16] + F[8 + 16 - 9]; + + F[0] = A; + F[4] = E; + F[8] = T; + T += F[7] + Sigma1(E) + Ch(E, F[5], F[6]) + K512[i]; + E = F[3] + T; + A = T + Sigma0(A) + Maj(A, F[1], F[2]); + } + + state[0] += A; + state[1] += F[1]; + state[2] += F[2]; + state[3] += F[3]; + state[4] += E; + state[5] += F[5]; + state[6] += F[6]; + state[7] += F[7]; + + in += 16 * 8; + } +} + +#else + +#define ROUND_00_15(i, a, b, c, d, e, f, g, h) \ + do { \ + T1 += h + Sigma1(e) + Ch(e, f, g) + K512[i]; \ + h = Sigma0(a) + Maj(a, b, c); \ + d += T1; \ + h += T1; \ + } while (0) + +#define ROUND_16_80(i, j, a, b, c, d, e, f, g, h, X) \ + do { \ + s0 = X[(j + 1) & 0x0f]; \ + s0 = sigma0(s0); \ + s1 = X[(j + 14) & 0x0f]; \ + s1 = sigma1(s1); \ + T1 = X[(j) & 0x0f] += s0 + s1 + X[(j + 9) & 0x0f]; \ + ROUND_00_15(i + j, a, b, c, d, e, f, g, h); \ + } while (0) + +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num) { + uint64_t a, b, c, d, e, f, g, h, s0, s1, T1; + uint64_t X[16]; + int i; + + while (num--) { + + a = state[0]; + b = state[1]; + c = state[2]; + d = state[3]; + e = state[4]; + f = state[5]; + g = state[6]; + h = state[7]; + + T1 = X[0] = load_u64_be(in); + ROUND_00_15(0, a, b, c, d, e, f, g, h); + T1 = X[1] = load_u64_be(in + 8); + ROUND_00_15(1, h, a, b, c, d, e, f, g); + T1 = X[2] = load_u64_be(in + 2 * 8); + ROUND_00_15(2, g, h, a, b, c, d, e, f); + T1 = X[3] = load_u64_be(in + 3 * 8); + ROUND_00_15(3, f, g, h, a, b, c, d, e); + T1 = X[4] = load_u64_be(in + 4 * 8); + ROUND_00_15(4, e, f, g, h, a, b, c, d); + T1 = X[5] = load_u64_be(in + 5 * 8); + ROUND_00_15(5, d, e, f, g, h, a, b, c); + T1 = X[6] = load_u64_be(in + 6 * 8); + ROUND_00_15(6, c, d, e, f, g, h, a, b); + T1 = X[7] = load_u64_be(in + 7 * 8); + ROUND_00_15(7, b, c, d, e, f, g, h, a); + T1 = X[8] = load_u64_be(in + 8 * 8); + ROUND_00_15(8, a, b, c, d, e, f, g, h); + T1 = X[9] = load_u64_be(in + 9 * 8); + ROUND_00_15(9, h, a, b, c, d, e, f, g); + T1 = X[10] = load_u64_be(in + 10 * 8); + ROUND_00_15(10, g, h, a, b, c, d, e, f); + T1 = X[11] = load_u64_be(in + 11 * 8); + ROUND_00_15(11, f, g, h, a, b, c, d, e); + T1 = X[12] = load_u64_be(in + 12 * 8); + ROUND_00_15(12, e, f, g, h, a, b, c, d); + T1 = X[13] = load_u64_be(in + 13 * 8); + ROUND_00_15(13, d, e, f, g, h, a, b, c); + T1 = X[14] = load_u64_be(in + 14 * 8); + ROUND_00_15(14, c, d, e, f, g, h, a, b); + T1 = X[15] = load_u64_be(in + 15 * 8); + ROUND_00_15(15, b, c, d, e, f, g, h, a); + + for (i = 16; i < 80; i += 16) { + ROUND_16_80(i, 0, a, b, c, d, e, f, g, h, X); + ROUND_16_80(i, 1, h, a, b, c, d, e, f, g, X); + ROUND_16_80(i, 2, g, h, a, b, c, d, e, f, X); + ROUND_16_80(i, 3, f, g, h, a, b, c, d, e, X); + ROUND_16_80(i, 4, e, f, g, h, a, b, c, d, X); + ROUND_16_80(i, 5, d, e, f, g, h, a, b, c, X); + ROUND_16_80(i, 6, c, d, e, f, g, h, a, b, X); + ROUND_16_80(i, 7, b, c, d, e, f, g, h, a, X); + ROUND_16_80(i, 8, a, b, c, d, e, f, g, h, X); + ROUND_16_80(i, 9, h, a, b, c, d, e, f, g, X); + ROUND_16_80(i, 10, g, h, a, b, c, d, e, f, X); + ROUND_16_80(i, 11, f, g, h, a, b, c, d, e, X); + ROUND_16_80(i, 12, e, f, g, h, a, b, c, d, X); + ROUND_16_80(i, 13, d, e, f, g, h, a, b, c, X); + ROUND_16_80(i, 14, c, d, e, f, g, h, a, b, X); + ROUND_16_80(i, 15, b, c, d, e, f, g, h, a, X); + } + + state[0] += a; + state[1] += b; + state[2] += c; + state[3] += d; + state[4] += e; + state[5] += f; + state[6] += g; + state[7] += h; + + in += 16 * 8; + } +} + +#endif + +#endif // !SHA512_ASM + +#undef ROTR +#undef Sigma0 +#undef Sigma1 +#undef sigma0 +#undef sigma1 +#undef Ch +#undef Maj +#undef ROUND_00_15 +#undef ROUND_16_80 diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/internal.h b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/kdf.c b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/kdf.c rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c diff --git a/Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/kdf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/fipsmodule/tls/kdf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/fipsmodule/tls/kdf.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/hkdf/hkdf.c b/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/hkdf/hkdf.c rename to Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c diff --git a/Pods/BoringSSL-GRPC/crypto/hkdf/hkdf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/hkdf/hkdf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/hkdf/hkdf.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c b/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c new file mode 100644 index 000000000..2195fec35 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c @@ -0,0 +1,2100 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) +#define RESTRICT +#else +#define RESTRICT restrict +#endif + +#include "../internal.h" +#include "internal.h" + +#if defined(OPENSSL_SSE2) +#include +#endif + +#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) +#include +#endif + +// This is an implementation of [HRSS], but with a KEM transformation based on +// [SXY]. The primary references are: + +// HRSS: https://eprint.iacr.org/2017/667.pdf +// HRSSNIST: +// https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/round-1/submissions/NTRU_HRSS_KEM.zip +// SXY: https://eprint.iacr.org/2017/1005.pdf +// NTRUTN14: +// https://assets.onboardsecurity.com/static/downloads/NTRU/resources/NTRUTech014.pdf +// NTRUCOMP: https://eprint.iacr.org/2018/1174 +// SAFEGCD: https://gcd.cr.yp.to/papers.html#safegcd + + +// Vector operations. +// +// A couple of functions in this file can use vector operations to meaningful +// effect. If we're building for a target that has a supported vector unit, +// |HRSS_HAVE_VECTOR_UNIT| will be defined and |vec_t| will be typedefed to a +// 128-bit vector. The following functions abstract over the differences between +// NEON and SSE2 for implementing some vector operations. + +// TODO: MSVC can likely also be made to work with vector operations, but ^ must +// be replaced with _mm_xor_si128, etc. +#if defined(OPENSSL_SSE2) && (defined(__clang__) || !defined(_MSC_VER)) + +#define HRSS_HAVE_VECTOR_UNIT +typedef __m128i vec_t; + +// vec_capable returns one iff the current platform supports SSE2. +static int vec_capable(void) { return 1; } + +// vec_add performs a pair-wise addition of four uint16s from |a| and |b|. +static inline vec_t vec_add(vec_t a, vec_t b) { return _mm_add_epi16(a, b); } + +// vec_sub performs a pair-wise subtraction of four uint16s from |a| and |b|. +static inline vec_t vec_sub(vec_t a, vec_t b) { return _mm_sub_epi16(a, b); } + +// vec_mul multiplies each uint16_t in |a| by |b| and returns the resulting +// vector. +static inline vec_t vec_mul(vec_t a, uint16_t b) { + return _mm_mullo_epi16(a, _mm_set1_epi16(b)); +} + +// vec_fma multiplies each uint16_t in |b| by |c|, adds the result to |a|, and +// returns the resulting vector. +static inline vec_t vec_fma(vec_t a, vec_t b, uint16_t c) { + return _mm_add_epi16(a, _mm_mullo_epi16(b, _mm_set1_epi16(c))); +} + +// vec3_rshift_word right-shifts the 24 uint16_t's in |v| by one uint16. +static inline void vec3_rshift_word(vec_t v[3]) { + // Intel's left and right shifting is backwards compared to the order in + // memory because they're based on little-endian order of words (and not just + // bytes). So the shifts in this function will be backwards from what one + // might expect. + const __m128i carry0 = _mm_srli_si128(v[0], 14); + v[0] = _mm_slli_si128(v[0], 2); + + const __m128i carry1 = _mm_srli_si128(v[1], 14); + v[1] = _mm_slli_si128(v[1], 2); + v[1] |= carry0; + + v[2] = _mm_slli_si128(v[2], 2); + v[2] |= carry1; +} + +// vec4_rshift_word right-shifts the 32 uint16_t's in |v| by one uint16. +static inline void vec4_rshift_word(vec_t v[4]) { + // Intel's left and right shifting is backwards compared to the order in + // memory because they're based on little-endian order of words (and not just + // bytes). So the shifts in this function will be backwards from what one + // might expect. + const __m128i carry0 = _mm_srli_si128(v[0], 14); + v[0] = _mm_slli_si128(v[0], 2); + + const __m128i carry1 = _mm_srli_si128(v[1], 14); + v[1] = _mm_slli_si128(v[1], 2); + v[1] |= carry0; + + const __m128i carry2 = _mm_srli_si128(v[2], 14); + v[2] = _mm_slli_si128(v[2], 2); + v[2] |= carry1; + + v[3] = _mm_slli_si128(v[3], 2); + v[3] |= carry2; +} + +// vec_merge_3_5 takes the final three uint16_t's from |left|, appends the first +// five from |right|, and returns the resulting vector. +static inline vec_t vec_merge_3_5(vec_t left, vec_t right) { + return _mm_srli_si128(left, 10) | _mm_slli_si128(right, 6); +} + +// poly3_vec_lshift1 left-shifts the 768 bits in |a_s|, and in |a_a|, by one +// bit. +static inline void poly3_vec_lshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + + for (int i = 0; i < 6; i++) { + vec_t next_carry_s = _mm_srli_epi64(a_s[i], 63); + a_s[i] = _mm_slli_epi64(a_s[i], 1); + a_s[i] |= _mm_slli_si128(next_carry_s, 8); + a_s[i] |= carry_s; + carry_s = _mm_srli_si128(next_carry_s, 8); + + vec_t next_carry_a = _mm_srli_epi64(a_a[i], 63); + a_a[i] = _mm_slli_epi64(a_a[i], 1); + a_a[i] |= _mm_slli_si128(next_carry_a, 8); + a_a[i] |= carry_a; + carry_a = _mm_srli_si128(next_carry_a, 8); + } +} + +// poly3_vec_rshift1 right-shifts the 768 bits in |a_s|, and in |a_a|, by one +// bit. +static inline void poly3_vec_rshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + + for (int i = 5; i >= 0; i--) { + const vec_t next_carry_s = _mm_slli_epi64(a_s[i], 63); + a_s[i] = _mm_srli_epi64(a_s[i], 1); + a_s[i] |= _mm_srli_si128(next_carry_s, 8); + a_s[i] |= carry_s; + carry_s = _mm_slli_si128(next_carry_s, 8); + + const vec_t next_carry_a = _mm_slli_epi64(a_a[i], 63); + a_a[i] = _mm_srli_epi64(a_a[i], 1); + a_a[i] |= _mm_srli_si128(next_carry_a, 8); + a_a[i] |= carry_a; + carry_a = _mm_slli_si128(next_carry_a, 8); + } +} + +// vec_broadcast_bit duplicates the least-significant bit in |a| to all bits in +// a vector and returns the result. +static inline vec_t vec_broadcast_bit(vec_t a) { + return _mm_shuffle_epi32(_mm_srai_epi32(_mm_slli_epi64(a, 63), 31), + 0b01010101); +} + +// vec_get_word returns the |i|th uint16_t in |v|. (This is a macro because the +// compiler requires that |i| be a compile-time constant.) +#define vec_get_word(v, i) _mm_extract_epi16(v, i) + +#elif (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) + +#define HRSS_HAVE_VECTOR_UNIT +typedef uint16x8_t vec_t; + +// These functions perform the same actions as the SSE2 function of the same +// name, above. + +static int vec_capable(void) { return CRYPTO_is_NEON_capable(); } + +static inline vec_t vec_add(vec_t a, vec_t b) { return a + b; } + +static inline vec_t vec_sub(vec_t a, vec_t b) { return a - b; } + +static inline vec_t vec_mul(vec_t a, uint16_t b) { return vmulq_n_u16(a, b); } + +static inline vec_t vec_fma(vec_t a, vec_t b, uint16_t c) { + return vmlaq_n_u16(a, b, c); +} + +static inline void vec3_rshift_word(vec_t v[3]) { + const uint16x8_t kZero = {0}; + v[2] = vextq_u16(v[1], v[2], 7); + v[1] = vextq_u16(v[0], v[1], 7); + v[0] = vextq_u16(kZero, v[0], 7); +} + +static inline void vec4_rshift_word(vec_t v[4]) { + const uint16x8_t kZero = {0}; + v[3] = vextq_u16(v[2], v[3], 7); + v[2] = vextq_u16(v[1], v[2], 7); + v[1] = vextq_u16(v[0], v[1], 7); + v[0] = vextq_u16(kZero, v[0], 7); +} + +static inline vec_t vec_merge_3_5(vec_t left, vec_t right) { + return vextq_u16(left, right, 5); +} + +static inline uint16_t vec_get_word(vec_t v, unsigned i) { + return v[i]; +} + +#if !defined(OPENSSL_AARCH64) + +static inline vec_t vec_broadcast_bit(vec_t a) { + a = (vec_t)vshrq_n_s16(((int16x8_t)a) << 15, 15); + return vdupq_lane_u16(vget_low_u16(a), 0); +} + +static inline void poly3_vec_lshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + const vec_t kZero = {0}; + + for (int i = 0; i < 6; i++) { + vec_t next_carry_s = a_s[i] >> 15; + a_s[i] <<= 1; + a_s[i] |= vextq_u16(kZero, next_carry_s, 7); + a_s[i] |= carry_s; + carry_s = vextq_u16(next_carry_s, kZero, 7); + + vec_t next_carry_a = a_a[i] >> 15; + a_a[i] <<= 1; + a_a[i] |= vextq_u16(kZero, next_carry_a, 7); + a_a[i] |= carry_a; + carry_a = vextq_u16(next_carry_a, kZero, 7); + } +} + +static inline void poly3_vec_rshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + const vec_t kZero = {0}; + + for (int i = 5; i >= 0; i--) { + vec_t next_carry_s = a_s[i] << 15; + a_s[i] >>= 1; + a_s[i] |= vextq_u16(next_carry_s, kZero, 1); + a_s[i] |= carry_s; + carry_s = vextq_u16(kZero, next_carry_s, 1); + + vec_t next_carry_a = a_a[i] << 15; + a_a[i] >>= 1; + a_a[i] |= vextq_u16(next_carry_a, kZero, 1); + a_a[i] |= carry_a; + carry_a = vextq_u16(kZero, next_carry_a, 1); + } +} + +#endif // !OPENSSL_AARCH64 + +#endif // (ARM || AARCH64) && NEON + +// Polynomials in this scheme have N terms. +// #define N 701 + +// Underlying data types and arithmetic operations. +// ------------------------------------------------ + +// Binary polynomials. + +// poly2 represents a degree-N polynomial over GF(2). The words are in little- +// endian order, i.e. the coefficient of x^0 is the LSB of the first word. The +// final word is only partially used since N is not a multiple of the word size. + +// Defined in internal.h: +// struct poly2 { +// crypto_word_t v[WORDS_PER_POLY]; +// }; + +OPENSSL_UNUSED static void hexdump(const void *void_in, size_t len) { + const uint8_t *in = (const uint8_t *)void_in; + for (size_t i = 0; i < len; i++) { + printf("%02x", in[i]); + } + printf("\n"); +} + +static void poly2_zero(struct poly2 *p) { + OPENSSL_memset(&p->v[0], 0, sizeof(crypto_word_t) * WORDS_PER_POLY); +} + +// word_reverse returns |in| with the bits in reverse order. +static crypto_word_t word_reverse(crypto_word_t in) { +#if defined(OPENSSL_64_BIT) + static const crypto_word_t kMasks[6] = { + UINT64_C(0x5555555555555555), + UINT64_C(0x3333333333333333), + UINT64_C(0x0f0f0f0f0f0f0f0f), + UINT64_C(0x00ff00ff00ff00ff), + UINT64_C(0x0000ffff0000ffff), + UINT64_C(0x00000000ffffffff), + }; +#else + static const crypto_word_t kMasks[5] = { + 0x55555555, + 0x33333333, + 0x0f0f0f0f, + 0x00ff00ff, + 0x0000ffff, + }; +#endif + + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kMasks); i++) { + in = ((in >> (1 << i)) & kMasks[i]) | ((in & kMasks[i]) << (1 << i)); + } + + return in; +} + +// lsb_to_all replicates the least-significant bit of |v| to all bits of the +// word. This is used in bit-slicing operations to make a vector from a fixed +// value. +static crypto_word_t lsb_to_all(crypto_word_t v) { return 0u - (v & 1); } + +// poly2_mod_phiN reduces |p| by Φ(N). +static void poly2_mod_phiN(struct poly2 *p) { + // m is the term at x^700, replicated to every bit. + const crypto_word_t m = + lsb_to_all(p->v[WORDS_PER_POLY - 1] >> (BITS_IN_LAST_WORD - 1)); + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + p->v[i] ^= m; + } + p->v[WORDS_PER_POLY - 1] &= (UINT64_C(1) << (BITS_IN_LAST_WORD - 1)) - 1; +} + +// poly2_reverse_700 reverses the order of the first 700 bits of |in| and writes +// the result to |out|. +static void poly2_reverse_700(struct poly2 *out, const struct poly2 *in) { + struct poly2 t; + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + t.v[i] = word_reverse(in->v[i]); + } + + static const size_t shift = BITS_PER_WORD - ((N-1) % BITS_PER_WORD); + for (size_t i = 0; i < WORDS_PER_POLY-1; i++) { + out->v[i] = t.v[WORDS_PER_POLY-1-i] >> shift; + out->v[i] |= t.v[WORDS_PER_POLY-2-i] << (BITS_PER_WORD - shift); + } + out->v[WORDS_PER_POLY-1] = t.v[0] >> shift; +} + +// poly2_cswap exchanges the values of |a| and |b| if |swap| is all ones. +static void poly2_cswap(struct poly2 *a, struct poly2 *b, crypto_word_t swap) { + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + const crypto_word_t sum = swap & (a->v[i] ^ b->v[i]); + a->v[i] ^= sum; + b->v[i] ^= sum; + } +} + +// poly2_fmadd sets |out| to |out| + |in| * m, where m is either +// |CONSTTIME_TRUE_W| or |CONSTTIME_FALSE_W|. +static void poly2_fmadd(struct poly2 *out, const struct poly2 *in, + crypto_word_t m) { + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + out->v[i] ^= in->v[i] & m; + } +} + +// poly2_lshift1 left-shifts |p| by one bit. +static void poly2_lshift1(struct poly2 *p) { + crypto_word_t carry = 0; + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + const crypto_word_t next_carry = p->v[i] >> (BITS_PER_WORD - 1); + p->v[i] <<= 1; + p->v[i] |= carry; + carry = next_carry; + } +} + +// poly2_rshift1 right-shifts |p| by one bit. +static void poly2_rshift1(struct poly2 *p) { + crypto_word_t carry = 0; + for (size_t i = WORDS_PER_POLY - 1; i < WORDS_PER_POLY; i--) { + const crypto_word_t next_carry = p->v[i] & 1; + p->v[i] >>= 1; + p->v[i] |= carry << (BITS_PER_WORD - 1); + carry = next_carry; + } +} + +// poly2_clear_top_bits clears the bits in the final word that are only for +// alignment. +static void poly2_clear_top_bits(struct poly2 *p) { + p->v[WORDS_PER_POLY - 1] &= (UINT64_C(1) << BITS_IN_LAST_WORD) - 1; +} + +// poly2_top_bits_are_clear returns one iff the extra bits in the final words of +// |p| are zero. +static int poly2_top_bits_are_clear(const struct poly2 *p) { + return (p->v[WORDS_PER_POLY - 1] & + ~((UINT64_C(1) << BITS_IN_LAST_WORD) - 1)) == 0; +} + +// Ternary polynomials. + +// poly3 represents a degree-N polynomial over GF(3). Each coefficient is +// bitsliced across the |s| and |a| arrays, like this: +// +// s | a | value +// ----------------- +// 0 | 0 | 0 +// 0 | 1 | 1 +// 1 | 1 | -1 (aka 2) +// 1 | 0 | +// +// ('s' is for sign, and 'a' is the absolute value.) +// +// Once bitsliced as such, the following circuits can be used to implement +// addition and multiplication mod 3: +// +// (s3, a3) = (s1, a1) × (s2, a2) +// a3 = a1 ∧ a2 +// s3 = (s1 ⊕ s2) ∧ a3 +// +// (s3, a3) = (s1, a1) + (s2, a2) +// t = s1 ⊕ a2 +// s3 = t ∧ (s2 ⊕ a1) +// a3 = (a1 ⊕ a2) ∨ (t ⊕ s2) +// +// (s3, a3) = (s1, a1) - (s2, a2) +// t = a1 ⊕ a2 +// s3 = (s1 ⊕ a2) ∧ (t ⊕ s2) +// a3 = t ∨ (s1 ⊕ s2) +// +// Negating a value just involves XORing s by a. +// +// struct poly3 { +// struct poly2 s, a; +// }; + +OPENSSL_UNUSED static void poly3_print(const struct poly3 *in) { + struct poly3 p; + OPENSSL_memcpy(&p, in, sizeof(p)); + p.s.v[WORDS_PER_POLY - 1] &= ((crypto_word_t)1 << BITS_IN_LAST_WORD) - 1; + p.a.v[WORDS_PER_POLY - 1] &= ((crypto_word_t)1 << BITS_IN_LAST_WORD) - 1; + + printf("{["); + for (unsigned i = 0; i < WORDS_PER_POLY; i++) { + if (i) { + printf(" "); + } + printf(BN_HEX_FMT2, p.s.v[i]); + } + printf("] ["); + for (unsigned i = 0; i < WORDS_PER_POLY; i++) { + if (i) { + printf(" "); + } + printf(BN_HEX_FMT2, p.a.v[i]); + } + printf("]}\n"); +} + +static void poly3_zero(struct poly3 *p) { + poly2_zero(&p->s); + poly2_zero(&p->a); +} + +// poly3_reverse_700 reverses the order of the first 700 terms of |in| and +// writes them to |out|. +static void poly3_reverse_700(struct poly3 *out, const struct poly3 *in) { + poly2_reverse_700(&out->a, &in->a); + poly2_reverse_700(&out->s, &in->s); +} + +// poly3_word_mul sets (|out_s|, |out_a|) to (|s1|, |a1|) × (|s2|, |a2|). +static void poly3_word_mul(crypto_word_t *out_s, crypto_word_t *out_a, + const crypto_word_t s1, const crypto_word_t a1, + const crypto_word_t s2, const crypto_word_t a2) { + *out_a = a1 & a2; + *out_s = (s1 ^ s2) & *out_a; +} + +// poly3_word_add sets (|out_s|, |out_a|) to (|s1|, |a1|) + (|s2|, |a2|). +static void poly3_word_add(crypto_word_t *out_s, crypto_word_t *out_a, + const crypto_word_t s1, const crypto_word_t a1, + const crypto_word_t s2, const crypto_word_t a2) { + const crypto_word_t t = s1 ^ a2; + *out_s = t & (s2 ^ a1); + *out_a = (a1 ^ a2) | (t ^ s2); +} + +// poly3_word_sub sets (|out_s|, |out_a|) to (|s1|, |a1|) - (|s2|, |a2|). +static void poly3_word_sub(crypto_word_t *out_s, crypto_word_t *out_a, + const crypto_word_t s1, const crypto_word_t a1, + const crypto_word_t s2, const crypto_word_t a2) { + const crypto_word_t t = a1 ^ a2; + *out_s = (s1 ^ a2) & (t ^ s2); + *out_a = t | (s1 ^ s2); +} + +// poly3_mul_const sets |p| to |p|×m, where m = (ms, ma). +static void poly3_mul_const(struct poly3 *p, crypto_word_t ms, + crypto_word_t ma) { + ms = lsb_to_all(ms); + ma = lsb_to_all(ma); + + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + poly3_word_mul(&p->s.v[i], &p->a.v[i], p->s.v[i], p->a.v[i], ms, ma); + } +} + +// poly3_fmadd sets |out| to |out| - |in|×m, where m is (ms, ma). +static void poly3_fmsub(struct poly3 *RESTRICT out, + const struct poly3 *RESTRICT in, crypto_word_t ms, + crypto_word_t ma) { + crypto_word_t product_s, product_a; + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + poly3_word_mul(&product_s, &product_a, in->s.v[i], in->a.v[i], ms, ma); + poly3_word_sub(&out->s.v[i], &out->a.v[i], out->s.v[i], out->a.v[i], + product_s, product_a); + } +} + +// final_bit_to_all replicates the bit in the final position of the last word to +// all the bits in the word. +static crypto_word_t final_bit_to_all(crypto_word_t v) { + return lsb_to_all(v >> (BITS_IN_LAST_WORD - 1)); +} + +// poly3_top_bits_are_clear returns one iff the extra bits in the final words of +// |p| are zero. +OPENSSL_UNUSED static int poly3_top_bits_are_clear(const struct poly3 *p) { + return poly2_top_bits_are_clear(&p->s) && poly2_top_bits_are_clear(&p->a); +} + +// poly3_mod_phiN reduces |p| by Φ(N). +static void poly3_mod_phiN(struct poly3 *p) { + // In order to reduce by Φ(N) we subtract by the value of the greatest + // coefficient. + const crypto_word_t factor_s = final_bit_to_all(p->s.v[WORDS_PER_POLY - 1]); + const crypto_word_t factor_a = final_bit_to_all(p->a.v[WORDS_PER_POLY - 1]); + + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + poly3_word_sub(&p->s.v[i], &p->a.v[i], p->s.v[i], p->a.v[i], factor_s, + factor_a); + } + + poly2_clear_top_bits(&p->s); + poly2_clear_top_bits(&p->a); +} + +static void poly3_cswap(struct poly3 *a, struct poly3 *b, crypto_word_t swap) { + poly2_cswap(&a->s, &b->s, swap); + poly2_cswap(&a->a, &b->a, swap); +} + +static void poly3_lshift1(struct poly3 *p) { + poly2_lshift1(&p->s); + poly2_lshift1(&p->a); +} + +static void poly3_rshift1(struct poly3 *p) { + poly2_rshift1(&p->s); + poly2_rshift1(&p->a); +} + +// poly3_span represents a pointer into a poly3. +struct poly3_span { + crypto_word_t *s; + crypto_word_t *a; +}; + +// poly3_span_add adds |n| words of values from |a| and |b| and writes the +// result to |out|. +static void poly3_span_add(const struct poly3_span *out, + const struct poly3_span *a, + const struct poly3_span *b, size_t n) { + for (size_t i = 0; i < n; i++) { + poly3_word_add(&out->s[i], &out->a[i], a->s[i], a->a[i], b->s[i], b->a[i]); + } +} + +// poly3_span_sub subtracts |n| words of |b| from |n| words of |a|. +static void poly3_span_sub(const struct poly3_span *a, + const struct poly3_span *b, size_t n) { + for (size_t i = 0; i < n; i++) { + poly3_word_sub(&a->s[i], &a->a[i], a->s[i], a->a[i], b->s[i], b->a[i]); + } +} + +// poly3_mul_aux is a recursive function that multiplies |n| words from |a| and +// |b| and writes 2×|n| words to |out|. Each call uses 2*ceil(n/2) elements of +// |scratch| and the function recurses, except if |n| == 1, when |scratch| isn't +// used and the recursion stops. For |n| in {11, 22}, the transitive total +// amount of |scratch| needed happens to be 2n+2. +static void poly3_mul_aux(const struct poly3_span *out, + const struct poly3_span *scratch, + const struct poly3_span *a, + const struct poly3_span *b, size_t n) { + if (n == 1) { + crypto_word_t r_s_low = 0, r_s_high = 0, r_a_low = 0, r_a_high = 0; + crypto_word_t b_s = b->s[0], b_a = b->a[0]; + const crypto_word_t a_s = a->s[0], a_a = a->a[0]; + + for (size_t i = 0; i < BITS_PER_WORD; i++) { + // Multiply (s, a) by the next value from (b_s, b_a). + crypto_word_t m_s, m_a; + poly3_word_mul(&m_s, &m_a, a_s, a_a, lsb_to_all(b_s), lsb_to_all(b_a)); + b_s >>= 1; + b_a >>= 1; + + if (i == 0) { + // Special case otherwise the code tries to shift by BITS_PER_WORD + // below, which is undefined. + r_s_low = m_s; + r_a_low = m_a; + continue; + } + + // Shift the multiplication result to the correct position. + const crypto_word_t m_s_low = m_s << i; + const crypto_word_t m_s_high = m_s >> (BITS_PER_WORD - i); + const crypto_word_t m_a_low = m_a << i; + const crypto_word_t m_a_high = m_a >> (BITS_PER_WORD - i); + + // Add into the result. + poly3_word_add(&r_s_low, &r_a_low, r_s_low, r_a_low, m_s_low, m_a_low); + poly3_word_add(&r_s_high, &r_a_high, r_s_high, r_a_high, m_s_high, + m_a_high); + } + + out->s[0] = r_s_low; + out->s[1] = r_s_high; + out->a[0] = r_a_low; + out->a[1] = r_a_high; + return; + } + + // Karatsuba multiplication. + // https://en.wikipedia.org/wiki/Karatsuba_algorithm + + // When |n| is odd, the two "halves" will have different lengths. The first + // is always the smaller. + const size_t low_len = n / 2; + const size_t high_len = n - low_len; + const struct poly3_span a_high = {&a->s[low_len], &a->a[low_len]}; + const struct poly3_span b_high = {&b->s[low_len], &b->a[low_len]}; + + // Store a_1 + a_0 in the first half of |out| and b_1 + b_0 in the second + // half. + const struct poly3_span a_cross_sum = *out; + const struct poly3_span b_cross_sum = {&out->s[high_len], &out->a[high_len]}; + poly3_span_add(&a_cross_sum, a, &a_high, low_len); + poly3_span_add(&b_cross_sum, b, &b_high, low_len); + if (high_len != low_len) { + a_cross_sum.s[low_len] = a_high.s[low_len]; + a_cross_sum.a[low_len] = a_high.a[low_len]; + b_cross_sum.s[low_len] = b_high.s[low_len]; + b_cross_sum.a[low_len] = b_high.a[low_len]; + } + + const struct poly3_span child_scratch = {&scratch->s[2 * high_len], + &scratch->a[2 * high_len]}; + const struct poly3_span out_mid = {&out->s[low_len], &out->a[low_len]}; + const struct poly3_span out_high = {&out->s[2 * low_len], + &out->a[2 * low_len]}; + + // Calculate (a_1 + a_0) × (b_1 + b_0) and write to scratch buffer. + poly3_mul_aux(scratch, &child_scratch, &a_cross_sum, &b_cross_sum, high_len); + // Calculate a_1 × b_1. + poly3_mul_aux(&out_high, &child_scratch, &a_high, &b_high, high_len); + // Calculate a_0 × b_0. + poly3_mul_aux(out, &child_scratch, a, b, low_len); + + // Subtract those last two products from the first. + poly3_span_sub(scratch, out, low_len * 2); + poly3_span_sub(scratch, &out_high, high_len * 2); + + // Add the middle product into the output. + poly3_span_add(&out_mid, &out_mid, scratch, high_len * 2); +} + +// HRSS_poly3_mul sets |*out| to |x|×|y| mod Φ(N). +void HRSS_poly3_mul(struct poly3 *out, const struct poly3 *x, + const struct poly3 *y) { + crypto_word_t prod_s[WORDS_PER_POLY * 2]; + crypto_word_t prod_a[WORDS_PER_POLY * 2]; + crypto_word_t scratch_s[WORDS_PER_POLY * 2 + 2]; + crypto_word_t scratch_a[WORDS_PER_POLY * 2 + 2]; + const struct poly3_span prod_span = {prod_s, prod_a}; + const struct poly3_span scratch_span = {scratch_s, scratch_a}; + const struct poly3_span x_span = {(crypto_word_t *)x->s.v, + (crypto_word_t *)x->a.v}; + const struct poly3_span y_span = {(crypto_word_t *)y->s.v, + (crypto_word_t *)y->a.v}; + + poly3_mul_aux(&prod_span, &scratch_span, &x_span, &y_span, WORDS_PER_POLY); + + // |prod| needs to be reduced mod (𝑥^n - 1), which just involves adding the + // upper-half to the lower-half. However, N is 701, which isn't a multiple of + // BITS_PER_WORD, so the upper-half vectors all have to be shifted before + // being added to the lower-half. + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + crypto_word_t v_s = prod_s[WORDS_PER_POLY + i - 1] >> BITS_IN_LAST_WORD; + v_s |= prod_s[WORDS_PER_POLY + i] << (BITS_PER_WORD - BITS_IN_LAST_WORD); + crypto_word_t v_a = prod_a[WORDS_PER_POLY + i - 1] >> BITS_IN_LAST_WORD; + v_a |= prod_a[WORDS_PER_POLY + i] << (BITS_PER_WORD - BITS_IN_LAST_WORD); + + poly3_word_add(&out->s.v[i], &out->a.v[i], prod_s[i], prod_a[i], v_s, v_a); + } + + poly3_mod_phiN(out); +} + +#if defined(HRSS_HAVE_VECTOR_UNIT) && !defined(OPENSSL_AARCH64) + +// poly3_vec_cswap swaps (|a_s|, |a_a|) and (|b_s|, |b_a|) if |swap| is +// |0xff..ff|. Otherwise, |swap| must be zero. +static inline void poly3_vec_cswap(vec_t a_s[6], vec_t a_a[6], vec_t b_s[6], + vec_t b_a[6], const vec_t swap) { + for (int i = 0; i < 6; i++) { + const vec_t sum_s = swap & (a_s[i] ^ b_s[i]); + a_s[i] ^= sum_s; + b_s[i] ^= sum_s; + + const vec_t sum_a = swap & (a_a[i] ^ b_a[i]); + a_a[i] ^= sum_a; + b_a[i] ^= sum_a; + } +} + +// poly3_vec_fmsub subtracts (|ms|, |ma|) × (|b_s|, |b_a|) from (|a_s|, |a_a|). +static inline void poly3_vec_fmsub(vec_t a_s[6], vec_t a_a[6], vec_t b_s[6], + vec_t b_a[6], const vec_t ms, + const vec_t ma) { + for (int i = 0; i < 6; i++) { + // See the bitslice formula, above. + const vec_t s = b_s[i]; + const vec_t a = b_a[i]; + const vec_t product_a = a & ma; + const vec_t product_s = (s ^ ms) & product_a; + + const vec_t out_s = a_s[i]; + const vec_t out_a = a_a[i]; + const vec_t t = out_a ^ product_a; + a_s[i] = (out_s ^ product_a) & (t ^ product_s); + a_a[i] = t | (out_s ^ product_s); + } +} + +// poly3_invert_vec sets |*out| to |in|^-1, i.e. such that |out|×|in| == 1 mod +// Φ(N). +static void poly3_invert_vec(struct poly3 *out, const struct poly3 *in) { + // This algorithm is taken from section 7.1 of [SAFEGCD]. + const vec_t kZero = {0}; + const vec_t kOne = {1}; + static const uint8_t kBottomSixtyOne[sizeof(vec_t)] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f}; + + vec_t v_s[6], v_a[6], r_s[6], r_a[6], f_s[6], f_a[6], g_s[6], g_a[6]; + // v = 0 + memset(&v_s, 0, sizeof(v_s)); + memset(&v_a, 0, sizeof(v_a)); + // r = 1 + memset(&r_s, 0, sizeof(r_s)); + memset(&r_a, 0, sizeof(r_a)); + r_a[0] = kOne; + // f = all ones. + memset(f_s, 0, sizeof(f_s)); + memset(f_a, 0xff, 5 * sizeof(vec_t)); + memcpy(&f_a[5], kBottomSixtyOne, sizeof(kBottomSixtyOne)); + // g is the reversal of |in|. + struct poly3 in_reversed; + poly3_reverse_700(&in_reversed, in); + g_s[5] = kZero; + memcpy(&g_s, &in_reversed.s.v, WORDS_PER_POLY * sizeof(crypto_word_t)); + g_a[5] = kZero; + memcpy(&g_a, &in_reversed.a.v, WORDS_PER_POLY * sizeof(crypto_word_t)); + + int delta = 1; + + for (size_t i = 0; i < (2*(N-1)) - 1; i++) { + poly3_vec_lshift1(v_s, v_a); + + const crypto_word_t delta_sign_bit = (delta >> (sizeof(delta) * 8 - 1)) & 1; + const crypto_word_t delta_is_non_negative = delta_sign_bit - 1; + const crypto_word_t delta_is_non_zero = ~constant_time_is_zero_w(delta); + const vec_t g_has_constant_term = vec_broadcast_bit(g_a[0]); + const vec_t mask_w = + {delta_is_non_negative & delta_is_non_zero}; + const vec_t mask = vec_broadcast_bit(mask_w) & g_has_constant_term; + + const vec_t c_a = vec_broadcast_bit(f_a[0] & g_a[0]); + const vec_t c_s = vec_broadcast_bit((f_s[0] ^ g_s[0]) & c_a); + + delta = constant_time_select_int(lsb_to_all(mask[0]), -delta, delta); + delta++; + + poly3_vec_cswap(f_s, f_a, g_s, g_a, mask); + poly3_vec_fmsub(g_s, g_a, f_s, f_a, c_s, c_a); + poly3_vec_rshift1(g_s, g_a); + + poly3_vec_cswap(v_s, v_a, r_s, r_a, mask); + poly3_vec_fmsub(r_s, r_a, v_s, v_a, c_s, c_a); + } + + assert(delta == 0); + memcpy(out->s.v, v_s, WORDS_PER_POLY * sizeof(crypto_word_t)); + memcpy(out->a.v, v_a, WORDS_PER_POLY * sizeof(crypto_word_t)); + poly3_mul_const(out, vec_get_word(f_s[0], 0), vec_get_word(f_a[0], 0)); + poly3_reverse_700(out, out); +} + +#endif // HRSS_HAVE_VECTOR_UNIT + +// HRSS_poly3_invert sets |*out| to |in|^-1, i.e. such that |out|×|in| == 1 mod +// Φ(N). +void HRSS_poly3_invert(struct poly3 *out, const struct poly3 *in) { + // The vector version of this function seems slightly slower on AArch64, but + // is useful on ARMv7 and x86-64. +#if defined(HRSS_HAVE_VECTOR_UNIT) && !defined(OPENSSL_AARCH64) + if (vec_capable()) { + poly3_invert_vec(out, in); + return; + } +#endif + + // This algorithm is taken from section 7.1 of [SAFEGCD]. + struct poly3 v, r, f, g; + // v = 0 + poly3_zero(&v); + // r = 1 + poly3_zero(&r); + r.a.v[0] = 1; + // f = all ones. + OPENSSL_memset(&f.s, 0, sizeof(struct poly2)); + OPENSSL_memset(&f.a, 0xff, sizeof(struct poly2)); + f.a.v[WORDS_PER_POLY - 1] >>= BITS_PER_WORD - BITS_IN_LAST_WORD; + // g is the reversal of |in|. + poly3_reverse_700(&g, in); + int delta = 1; + + for (size_t i = 0; i < (2*(N-1)) - 1; i++) { + poly3_lshift1(&v); + + const crypto_word_t delta_sign_bit = (delta >> (sizeof(delta) * 8 - 1)) & 1; + const crypto_word_t delta_is_non_negative = delta_sign_bit - 1; + const crypto_word_t delta_is_non_zero = ~constant_time_is_zero_w(delta); + const crypto_word_t g_has_constant_term = lsb_to_all(g.a.v[0]); + const crypto_word_t mask = + g_has_constant_term & delta_is_non_negative & delta_is_non_zero; + + crypto_word_t c_s, c_a; + poly3_word_mul(&c_s, &c_a, f.s.v[0], f.a.v[0], g.s.v[0], g.a.v[0]); + c_s = lsb_to_all(c_s); + c_a = lsb_to_all(c_a); + + delta = constant_time_select_int(mask, -delta, delta); + delta++; + + poly3_cswap(&f, &g, mask); + poly3_fmsub(&g, &f, c_s, c_a); + poly3_rshift1(&g); + + poly3_cswap(&v, &r, mask); + poly3_fmsub(&r, &v, c_s, c_a); + } + + assert(delta == 0); + poly3_mul_const(&v, f.s.v[0], f.a.v[0]); + poly3_reverse_700(out, &v); +} + +// Polynomials in Q. + +// Coefficients are reduced mod Q. (Q is clearly not prime, therefore the +// coefficients do not form a field.) +#define Q 8192 + +// VECS_PER_POLY is the number of 128-bit vectors needed to represent a +// polynomial. +#define COEFFICIENTS_PER_VEC (sizeof(vec_t) / sizeof(uint16_t)) +#define VECS_PER_POLY ((N + COEFFICIENTS_PER_VEC - 1) / COEFFICIENTS_PER_VEC) + +// poly represents a polynomial with coefficients mod Q. Note that, while Q is a +// power of two, this does not operate in GF(Q). That would be a binary field +// but this is simply mod Q. Thus the coefficients are not a field. +// +// Coefficients are ordered little-endian, thus the coefficient of x^0 is the +// first element of the array. +struct poly { +#if defined(HRSS_HAVE_VECTOR_UNIT) + union { + // N + 3 = 704, which is a multiple of 64 and thus aligns things, esp for + // the vector code. + uint16_t v[N + 3]; + vec_t vectors[VECS_PER_POLY]; + }; +#else + // Even if !HRSS_HAVE_VECTOR_UNIT, external assembly may be called that + // requires alignment. + alignas(16) uint16_t v[N + 3]; +#endif +}; + +OPENSSL_UNUSED static void poly_print(const struct poly *p) { + printf("["); + for (unsigned i = 0; i < N; i++) { + if (i) { + printf(" "); + } + printf("%d", p->v[i]); + } + printf("]\n"); +} + +#if defined(HRSS_HAVE_VECTOR_UNIT) + +// poly_mul_vec_aux is a recursive function that multiplies |n| words from |a| +// and |b| and writes 2×|n| words to |out|. Each call uses 2*ceil(n/2) elements +// of |scratch| and the function recurses, except if |n| < 3, when |scratch| +// isn't used and the recursion stops. If |n| == |VECS_PER_POLY| then |scratch| +// needs 172 elements. +static void poly_mul_vec_aux(vec_t *restrict out, vec_t *restrict scratch, + const vec_t *restrict a, const vec_t *restrict b, + const size_t n) { + // In [HRSS], the technique they used for polynomial multiplication is + // described: they start with Toom-4 at the top level and then two layers of + // Karatsuba. Karatsuba is a specific instance of the general Toom–Cook + // decomposition, which splits an input n-ways and produces 2n-1 + // multiplications of those parts. So, starting with 704 coefficients (rounded + // up from 701 to have more factors of two), Toom-4 gives seven + // multiplications of degree-174 polynomials. Each round of Karatsuba (which + // is Toom-2) increases the number of multiplications by a factor of three + // while halving the size of the values being multiplied. So two rounds gives + // 63 multiplications of degree-44 polynomials. Then they (I think) form + // vectors by gathering all 63 coefficients of each power together, for each + // input, and doing more rounds of Karatsuba on the vectors until they bottom- + // out somewhere with schoolbook multiplication. + // + // I tried something like that for NEON. NEON vectors are 128 bits so hold + // eight coefficients. I wrote a function that did Karatsuba on eight + // multiplications at the same time, using such vectors, and a Go script that + // decomposed from degree-704, with Karatsuba in non-transposed form, until it + // reached multiplications of degree-44. It batched up those 81 + // multiplications into lots of eight with a single one left over (which was + // handled directly). + // + // It worked, but it was significantly slower than the dumb algorithm used + // below. Potentially that was because I misunderstood how [HRSS] did it, or + // because Clang is bad at generating good code from NEON intrinsics on ARMv7. + // (Which is true: the code generated by Clang for the below is pretty crap.) + // + // This algorithm is much simpler. It just does Karatsuba decomposition all + // the way down and never transposes. When it gets down to degree-16 or + // degree-24 values, they are multiplied using schoolbook multiplication and + // vector intrinsics. The vector operations form each of the eight phase- + // shifts of one of the inputs, point-wise multiply, and then add into the + // result at the correct place. This means that 33% (degree-16) or 25% + // (degree-24) of the multiplies and adds are wasted, but it does ok. + if (n == 2) { + vec_t result[4]; + vec_t vec_a[3]; + static const vec_t kZero = {0}; + vec_a[0] = a[0]; + vec_a[1] = a[1]; + vec_a[2] = kZero; + + result[0] = vec_mul(vec_a[0], vec_get_word(b[0], 0)); + result[1] = vec_mul(vec_a[1], vec_get_word(b[0], 0)); + + result[1] = vec_fma(result[1], vec_a[0], vec_get_word(b[1], 0)); + result[2] = vec_mul(vec_a[1], vec_get_word(b[1], 0)); + result[3] = kZero; + + vec3_rshift_word(vec_a); + +#define BLOCK(x, y) \ + do { \ + result[x + 0] = \ + vec_fma(result[x + 0], vec_a[0], vec_get_word(b[y / 8], y % 8)); \ + result[x + 1] = \ + vec_fma(result[x + 1], vec_a[1], vec_get_word(b[y / 8], y % 8)); \ + result[x + 2] = \ + vec_fma(result[x + 2], vec_a[2], vec_get_word(b[y / 8], y % 8)); \ + } while (0) + + BLOCK(0, 1); + BLOCK(1, 9); + + vec3_rshift_word(vec_a); + + BLOCK(0, 2); + BLOCK(1, 10); + + vec3_rshift_word(vec_a); + + BLOCK(0, 3); + BLOCK(1, 11); + + vec3_rshift_word(vec_a); + + BLOCK(0, 4); + BLOCK(1, 12); + + vec3_rshift_word(vec_a); + + BLOCK(0, 5); + BLOCK(1, 13); + + vec3_rshift_word(vec_a); + + BLOCK(0, 6); + BLOCK(1, 14); + + vec3_rshift_word(vec_a); + + BLOCK(0, 7); + BLOCK(1, 15); + +#undef BLOCK + + memcpy(out, result, sizeof(result)); + return; + } + + if (n == 3) { + vec_t result[6]; + vec_t vec_a[4]; + static const vec_t kZero = {0}; + vec_a[0] = a[0]; + vec_a[1] = a[1]; + vec_a[2] = a[2]; + vec_a[3] = kZero; + + result[0] = vec_mul(a[0], vec_get_word(b[0], 0)); + result[1] = vec_mul(a[1], vec_get_word(b[0], 0)); + result[2] = vec_mul(a[2], vec_get_word(b[0], 0)); + +#define BLOCK_PRE(x, y) \ + do { \ + result[x + 0] = \ + vec_fma(result[x + 0], vec_a[0], vec_get_word(b[y / 8], y % 8)); \ + result[x + 1] = \ + vec_fma(result[x + 1], vec_a[1], vec_get_word(b[y / 8], y % 8)); \ + result[x + 2] = vec_mul(vec_a[2], vec_get_word(b[y / 8], y % 8)); \ + } while (0) + + BLOCK_PRE(1, 8); + BLOCK_PRE(2, 16); + + result[5] = kZero; + + vec4_rshift_word(vec_a); + +#define BLOCK(x, y) \ + do { \ + result[x + 0] = \ + vec_fma(result[x + 0], vec_a[0], vec_get_word(b[y / 8], y % 8)); \ + result[x + 1] = \ + vec_fma(result[x + 1], vec_a[1], vec_get_word(b[y / 8], y % 8)); \ + result[x + 2] = \ + vec_fma(result[x + 2], vec_a[2], vec_get_word(b[y / 8], y % 8)); \ + result[x + 3] = \ + vec_fma(result[x + 3], vec_a[3], vec_get_word(b[y / 8], y % 8)); \ + } while (0) + + BLOCK(0, 1); + BLOCK(1, 9); + BLOCK(2, 17); + + vec4_rshift_word(vec_a); + + BLOCK(0, 2); + BLOCK(1, 10); + BLOCK(2, 18); + + vec4_rshift_word(vec_a); + + BLOCK(0, 3); + BLOCK(1, 11); + BLOCK(2, 19); + + vec4_rshift_word(vec_a); + + BLOCK(0, 4); + BLOCK(1, 12); + BLOCK(2, 20); + + vec4_rshift_word(vec_a); + + BLOCK(0, 5); + BLOCK(1, 13); + BLOCK(2, 21); + + vec4_rshift_word(vec_a); + + BLOCK(0, 6); + BLOCK(1, 14); + BLOCK(2, 22); + + vec4_rshift_word(vec_a); + + BLOCK(0, 7); + BLOCK(1, 15); + BLOCK(2, 23); + +#undef BLOCK +#undef BLOCK_PRE + + memcpy(out, result, sizeof(result)); + + return; + } + + // Karatsuba multiplication. + // https://en.wikipedia.org/wiki/Karatsuba_algorithm + + // When |n| is odd, the two "halves" will have different lengths. The first is + // always the smaller. + const size_t low_len = n / 2; + const size_t high_len = n - low_len; + const vec_t *a_high = &a[low_len]; + const vec_t *b_high = &b[low_len]; + + // Store a_1 + a_0 in the first half of |out| and b_1 + b_0 in the second + // half. + for (size_t i = 0; i < low_len; i++) { + out[i] = vec_add(a_high[i], a[i]); + out[high_len + i] = vec_add(b_high[i], b[i]); + } + if (high_len != low_len) { + out[low_len] = a_high[low_len]; + out[high_len + low_len] = b_high[low_len]; + } + + vec_t *const child_scratch = &scratch[2 * high_len]; + // Calculate (a_1 + a_0) × (b_1 + b_0) and write to scratch buffer. + poly_mul_vec_aux(scratch, child_scratch, out, &out[high_len], high_len); + // Calculate a_1 × b_1. + poly_mul_vec_aux(&out[low_len * 2], child_scratch, a_high, b_high, high_len); + // Calculate a_0 × b_0. + poly_mul_vec_aux(out, child_scratch, a, b, low_len); + + // Subtract those last two products from the first. + for (size_t i = 0; i < low_len * 2; i++) { + scratch[i] = vec_sub(scratch[i], vec_add(out[i], out[low_len * 2 + i])); + } + if (low_len != high_len) { + scratch[low_len * 2] = vec_sub(scratch[low_len * 2], out[low_len * 4]); + scratch[low_len * 2 + 1] = + vec_sub(scratch[low_len * 2 + 1], out[low_len * 4 + 1]); + } + + // Add the middle product into the output. + for (size_t i = 0; i < high_len * 2; i++) { + out[low_len + i] = vec_add(out[low_len + i], scratch[i]); + } +} + +// poly_mul_vec sets |*out| to |x|×|y| mod (𝑥^n - 1). +static void poly_mul_vec(struct poly *out, const struct poly *x, + const struct poly *y) { + OPENSSL_memset((uint16_t *)&x->v[N], 0, 3 * sizeof(uint16_t)); + OPENSSL_memset((uint16_t *)&y->v[N], 0, 3 * sizeof(uint16_t)); + + OPENSSL_STATIC_ASSERT(sizeof(out->v) == sizeof(vec_t) * VECS_PER_POLY, + "struct poly is the wrong size"); + OPENSSL_STATIC_ASSERT(alignof(struct poly) == alignof(vec_t), + "struct poly has incorrect alignment"); + + vec_t prod[VECS_PER_POLY * 2]; + vec_t scratch[172]; + poly_mul_vec_aux(prod, scratch, x->vectors, y->vectors, VECS_PER_POLY); + + // |prod| needs to be reduced mod (𝑥^n - 1), which just involves adding the + // upper-half to the lower-half. However, N is 701, which isn't a multiple of + // the vector size, so the upper-half vectors all have to be shifted before + // being added to the lower-half. + vec_t *out_vecs = (vec_t *)out->v; + + for (size_t i = 0; i < VECS_PER_POLY; i++) { + const vec_t prev = prod[VECS_PER_POLY - 1 + i]; + const vec_t this = prod[VECS_PER_POLY + i]; + out_vecs[i] = vec_add(prod[i], vec_merge_3_5(prev, this)); + } + + OPENSSL_memset(&out->v[N], 0, 3 * sizeof(uint16_t)); +} + +#endif // HRSS_HAVE_VECTOR_UNIT + +// poly_mul_novec_aux writes the product of |a| and |b| to |out|, using +// |scratch| as scratch space. It'll use Karatsuba if the inputs are large +// enough to warrant it. Each call uses 2*ceil(n/2) elements of |scratch| and +// the function recurses, except if |n| < 64, when |scratch| isn't used and the +// recursion stops. If |n| == |N| then |scratch| needs 1318 elements. +static void poly_mul_novec_aux(uint16_t *out, uint16_t *scratch, + const uint16_t *a, const uint16_t *b, size_t n) { + static const size_t kSchoolbookLimit = 64; + if (n < kSchoolbookLimit) { + OPENSSL_memset(out, 0, sizeof(uint16_t) * n * 2); + for (size_t i = 0; i < n; i++) { + for (size_t j = 0; j < n; j++) { + out[i + j] += (unsigned) a[i] * b[j]; + } + } + + return; + } + + // Karatsuba multiplication. + // https://en.wikipedia.org/wiki/Karatsuba_algorithm + + // When |n| is odd, the two "halves" will have different lengths. The + // first is always the smaller. + const size_t low_len = n / 2; + const size_t high_len = n - low_len; + const uint16_t *const a_high = &a[low_len]; + const uint16_t *const b_high = &b[low_len]; + + for (size_t i = 0; i < low_len; i++) { + out[i] = a_high[i] + a[i]; + out[high_len + i] = b_high[i] + b[i]; + } + if (high_len != low_len) { + out[low_len] = a_high[low_len]; + out[high_len + low_len] = b_high[low_len]; + } + + uint16_t *const child_scratch = &scratch[2 * high_len]; + poly_mul_novec_aux(scratch, child_scratch, out, &out[high_len], high_len); + poly_mul_novec_aux(&out[low_len * 2], child_scratch, a_high, b_high, + high_len); + poly_mul_novec_aux(out, child_scratch, a, b, low_len); + + for (size_t i = 0; i < low_len * 2; i++) { + scratch[i] -= out[i] + out[low_len * 2 + i]; + } + if (low_len != high_len) { + scratch[low_len * 2] -= out[low_len * 4]; + assert(out[low_len * 4 + 1] == 0); + } + + for (size_t i = 0; i < high_len * 2; i++) { + out[low_len + i] += scratch[i]; + } +} + +// poly_mul_novec sets |*out| to |x|×|y| mod (𝑥^n - 1). +static void poly_mul_novec(struct poly *out, const struct poly *x, + const struct poly *y) { + uint16_t prod[2 * N]; + uint16_t scratch[1318]; + poly_mul_novec_aux(prod, scratch, x->v, y->v, N); + + for (size_t i = 0; i < N; i++) { + out->v[i] = prod[i] + prod[i + N]; + } + OPENSSL_memset(&out->v[N], 0, 3 * sizeof(uint16_t)); +} + +static void poly_mul(struct poly *r, const struct poly *a, + const struct poly *b) { +#if defined(POLY_RQ_MUL_ASM) + const int has_avx2 = (OPENSSL_ia32cap_P[2] & (1 << 5)) != 0; + if (has_avx2) { + poly_Rq_mul(r->v, a->v, b->v); + return; + } +#endif + +#if defined(HRSS_HAVE_VECTOR_UNIT) + if (vec_capable()) { + poly_mul_vec(r, a, b); + return; + } +#endif + + // Fallback, non-vector case. + poly_mul_novec(r, a, b); +} + +// poly_mul_x_minus_1 sets |p| to |p|×(𝑥 - 1) mod (𝑥^n - 1). +static void poly_mul_x_minus_1(struct poly *p) { + // Multiplying by (𝑥 - 1) means negating each coefficient and adding in + // the value of the previous one. + const uint16_t orig_final_coefficient = p->v[N - 1]; + + for (size_t i = N - 1; i > 0; i--) { + p->v[i] = p->v[i - 1] - p->v[i]; + } + p->v[0] = orig_final_coefficient - p->v[0]; +} + +// poly_mod_phiN sets |p| to |p| mod Φ(N). +static void poly_mod_phiN(struct poly *p) { + const uint16_t coeff700 = p->v[N - 1]; + + for (unsigned i = 0; i < N; i++) { + p->v[i] -= coeff700; + } +} + +// poly_clamp reduces each coefficient mod Q. +static void poly_clamp(struct poly *p) { + for (unsigned i = 0; i < N; i++) { + p->v[i] &= Q - 1; + } +} + + +// Conversion functions +// -------------------- + +// poly2_from_poly sets |*out| to |in| mod 2. +static void poly2_from_poly(struct poly2 *out, const struct poly *in) { + crypto_word_t *words = out->v; + unsigned shift = 0; + crypto_word_t word = 0; + + for (unsigned i = 0; i < N; i++) { + word >>= 1; + word |= (crypto_word_t)(in->v[i] & 1) << (BITS_PER_WORD - 1); + shift++; + + if (shift == BITS_PER_WORD) { + *words = word; + words++; + word = 0; + shift = 0; + } + } + + word >>= BITS_PER_WORD - shift; + *words = word; +} + +// mod3 treats |a| as a signed number and returns |a| mod 3. +static uint16_t mod3(int16_t a) { + const int16_t q = ((int32_t)a * 21845) >> 16; + int16_t ret = a - 3 * q; + // At this point, |ret| is in {0, 1, 2, 3} and that needs to be mapped to {0, + // 1, 2, 0}. + return ret & ((ret & (ret >> 1)) - 1); +} + +// poly3_from_poly sets |*out| to |in|. +static void poly3_from_poly(struct poly3 *out, const struct poly *in) { + crypto_word_t *words_s = out->s.v; + crypto_word_t *words_a = out->a.v; + crypto_word_t s = 0; + crypto_word_t a = 0; + unsigned shift = 0; + + for (unsigned i = 0; i < N; i++) { + // This duplicates the 13th bit upwards to the top of the uint16, + // essentially treating it as a sign bit and converting into a signed int16. + // The signed value is reduced mod 3, yielding {0, 1, 2}. + const uint16_t v = mod3((int16_t)(in->v[i] << 3) >> 3); + s >>= 1; + const crypto_word_t s_bit = (crypto_word_t)(v & 2) << (BITS_PER_WORD - 2); + s |= s_bit; + a >>= 1; + a |= s_bit | (crypto_word_t)(v & 1) << (BITS_PER_WORD - 1); + shift++; + + if (shift == BITS_PER_WORD) { + *words_s = s; + words_s++; + *words_a = a; + words_a++; + s = a = 0; + shift = 0; + } + } + + s >>= BITS_PER_WORD - shift; + a >>= BITS_PER_WORD - shift; + *words_s = s; + *words_a = a; +} + +// poly3_from_poly_checked sets |*out| to |in|, which has coefficients in {0, 1, +// Q-1}. It returns a mask indicating whether all coefficients were found to be +// in that set. +static crypto_word_t poly3_from_poly_checked(struct poly3 *out, + const struct poly *in) { + crypto_word_t *words_s = out->s.v; + crypto_word_t *words_a = out->a.v; + crypto_word_t s = 0; + crypto_word_t a = 0; + unsigned shift = 0; + crypto_word_t ok = CONSTTIME_TRUE_W; + + for (unsigned i = 0; i < N; i++) { + const uint16_t v = in->v[i]; + // Maps {0, 1, Q-1} to {0, 1, 2}. + uint16_t mod3 = v & 3; + mod3 ^= mod3 >> 1; + const uint16_t expected = (uint16_t)((~((mod3 >> 1) - 1)) | mod3) % Q; + ok &= constant_time_eq_w(v, expected); + + s >>= 1; + const crypto_word_t s_bit = (crypto_word_t)(mod3 & 2) + << (BITS_PER_WORD - 2); + s |= s_bit; + a >>= 1; + a |= s_bit | (crypto_word_t)(mod3 & 1) << (BITS_PER_WORD - 1); + shift++; + + if (shift == BITS_PER_WORD) { + *words_s = s; + words_s++; + *words_a = a; + words_a++; + s = a = 0; + shift = 0; + } + } + + s >>= BITS_PER_WORD - shift; + a >>= BITS_PER_WORD - shift; + *words_s = s; + *words_a = a; + + return ok; +} + +static void poly_from_poly2(struct poly *out, const struct poly2 *in) { + const crypto_word_t *words = in->v; + unsigned shift = 0; + crypto_word_t word = *words; + + for (unsigned i = 0; i < N; i++) { + out->v[i] = word & 1; + word >>= 1; + shift++; + + if (shift == BITS_PER_WORD) { + words++; + word = *words; + shift = 0; + } + } +} + +static void poly_from_poly3(struct poly *out, const struct poly3 *in) { + const crypto_word_t *words_s = in->s.v; + const crypto_word_t *words_a = in->a.v; + crypto_word_t word_s = ~(*words_s); + crypto_word_t word_a = *words_a; + unsigned shift = 0; + + for (unsigned i = 0; i < N; i++) { + out->v[i] = (uint16_t)(word_s & 1) - 1; + out->v[i] |= word_a & 1; + word_s >>= 1; + word_a >>= 1; + shift++; + + if (shift == BITS_PER_WORD) { + words_s++; + words_a++; + word_s = ~(*words_s); + word_a = *words_a; + shift = 0; + } + } +} + +// Polynomial inversion +// -------------------- + +// poly_invert_mod2 sets |*out| to |in^-1| (i.e. such that |*out|×|in| = 1 mod +// Φ(N)), all mod 2. This isn't useful in itself, but is part of doing inversion +// mod Q. +static void poly_invert_mod2(struct poly *out, const struct poly *in) { + // This algorithm is taken from section 7.1 of [SAFEGCD]. + struct poly2 v, r, f, g; + + // v = 0 + poly2_zero(&v); + // r = 1 + poly2_zero(&r); + r.v[0] = 1; + // f = all ones. + OPENSSL_memset(&f, 0xff, sizeof(struct poly2)); + f.v[WORDS_PER_POLY - 1] >>= BITS_PER_WORD - BITS_IN_LAST_WORD; + // g is the reversal of |in|. + poly2_from_poly(&g, in); + poly2_mod_phiN(&g); + poly2_reverse_700(&g, &g); + int delta = 1; + + for (size_t i = 0; i < (2*(N-1)) - 1; i++) { + poly2_lshift1(&v); + + const crypto_word_t delta_sign_bit = (delta >> (sizeof(delta) * 8 - 1)) & 1; + const crypto_word_t delta_is_non_negative = delta_sign_bit - 1; + const crypto_word_t delta_is_non_zero = ~constant_time_is_zero_w(delta); + const crypto_word_t g_has_constant_term = lsb_to_all(g.v[0]); + const crypto_word_t mask = + g_has_constant_term & delta_is_non_negative & delta_is_non_zero; + + const crypto_word_t c = lsb_to_all(f.v[0] & g.v[0]); + + delta = constant_time_select_int(mask, -delta, delta); + delta++; + + poly2_cswap(&f, &g, mask); + poly2_fmadd(&g, &f, c); + poly2_rshift1(&g); + + poly2_cswap(&v, &r, mask); + poly2_fmadd(&r, &v, c); + } + + assert(delta == 0); + assert(f.v[0] & 1); + poly2_reverse_700(&v, &v); + poly_from_poly2(out, &v); +} + +// poly_invert sets |*out| to |in^-1| (i.e. such that |*out|×|in| = 1 mod Φ(N)). +static void poly_invert(struct poly *out, const struct poly *in) { + // Inversion mod Q, which is done based on the result of inverting mod + // 2. See [NTRUTN14] paper, bottom of page two. + struct poly a, *b, tmp; + + // a = -in. + for (unsigned i = 0; i < N; i++) { + a.v[i] = -in->v[i]; + } + + // b = in^-1 mod 2. + b = out; + poly_invert_mod2(b, in); + + // We are working mod Q=2**13 and we need to iterate ceil(log_2(13)) + // times, which is four. + for (unsigned i = 0; i < 4; i++) { + poly_mul(&tmp, &a, b); + tmp.v[0] += 2; + poly_mul(b, b, &tmp); + } +} + +// Marshal and unmarshal functions for various basic types. +// -------------------------------------------------------- + +#define POLY_BYTES 1138 + +// poly_marshal serialises all but the final coefficient of |in| to |out|. +static void poly_marshal(uint8_t out[POLY_BYTES], const struct poly *in) { + const uint16_t *p = in->v; + + for (size_t i = 0; i < N / 8; i++) { + out[0] = p[0]; + out[1] = (0x1f & (p[0] >> 8)) | ((p[1] & 0x07) << 5); + out[2] = p[1] >> 3; + out[3] = (3 & (p[1] >> 11)) | ((p[2] & 0x3f) << 2); + out[4] = (0x7f & (p[2] >> 6)) | ((p[3] & 0x01) << 7); + out[5] = p[3] >> 1; + out[6] = (0xf & (p[3] >> 9)) | ((p[4] & 0x0f) << 4); + out[7] = p[4] >> 4; + out[8] = (1 & (p[4] >> 12)) | ((p[5] & 0x7f) << 1); + out[9] = (0x3f & (p[5] >> 7)) | ((p[6] & 0x03) << 6); + out[10] = p[6] >> 2; + out[11] = (7 & (p[6] >> 10)) | ((p[7] & 0x1f) << 3); + out[12] = p[7] >> 5; + + p += 8; + out += 13; + } + + // There are four remaining values. + out[0] = p[0]; + out[1] = (0x1f & (p[0] >> 8)) | ((p[1] & 0x07) << 5); + out[2] = p[1] >> 3; + out[3] = (3 & (p[1] >> 11)) | ((p[2] & 0x3f) << 2); + out[4] = (0x7f & (p[2] >> 6)) | ((p[3] & 0x01) << 7); + out[5] = p[3] >> 1; + out[6] = 0xf & (p[3] >> 9); +} + +// poly_unmarshal parses the output of |poly_marshal| and sets |out| such that +// all but the final coefficients match, and the final coefficient is calculated +// such that evaluating |out| at one results in zero. It returns one on success +// or zero if |in| is an invalid encoding. +static int poly_unmarshal(struct poly *out, const uint8_t in[POLY_BYTES]) { + uint16_t *p = out->v; + + for (size_t i = 0; i < N / 8; i++) { + p[0] = (uint16_t)(in[0]) | (uint16_t)(in[1] & 0x1f) << 8; + p[1] = (uint16_t)(in[1] >> 5) | (uint16_t)(in[2]) << 3 | + (uint16_t)(in[3] & 3) << 11; + p[2] = (uint16_t)(in[3] >> 2) | (uint16_t)(in[4] & 0x7f) << 6; + p[3] = (uint16_t)(in[4] >> 7) | (uint16_t)(in[5]) << 1 | + (uint16_t)(in[6] & 0xf) << 9; + p[4] = (uint16_t)(in[6] >> 4) | (uint16_t)(in[7]) << 4 | + (uint16_t)(in[8] & 1) << 12; + p[5] = (uint16_t)(in[8] >> 1) | (uint16_t)(in[9] & 0x3f) << 7; + p[6] = (uint16_t)(in[9] >> 6) | (uint16_t)(in[10]) << 2 | + (uint16_t)(in[11] & 7) << 10; + p[7] = (uint16_t)(in[11] >> 3) | (uint16_t)(in[12]) << 5; + + p += 8; + in += 13; + } + + // There are four coefficients remaining. + p[0] = (uint16_t)(in[0]) | (uint16_t)(in[1] & 0x1f) << 8; + p[1] = (uint16_t)(in[1] >> 5) | (uint16_t)(in[2]) << 3 | + (uint16_t)(in[3] & 3) << 11; + p[2] = (uint16_t)(in[3] >> 2) | (uint16_t)(in[4] & 0x7f) << 6; + p[3] = (uint16_t)(in[4] >> 7) | (uint16_t)(in[5]) << 1 | + (uint16_t)(in[6] & 0xf) << 9; + + for (unsigned i = 0; i < N - 1; i++) { + out->v[i] = (int16_t)(out->v[i] << 3) >> 3; + } + + // There are four unused bits in the last byte. We require them to be zero. + if ((in[6] & 0xf0) != 0) { + return 0; + } + + // Set the final coefficient as specifed in [HRSSNIST] 1.9.2 step 6. + uint32_t sum = 0; + for (size_t i = 0; i < N - 1; i++) { + sum += out->v[i]; + } + + out->v[N - 1] = (uint16_t)(0u - sum); + + return 1; +} + +// mod3_from_modQ maps {0, 1, Q-1, 65535} -> {0, 1, 2, 2}. Note that |v| may +// have an invalid value when processing attacker-controlled inputs. +static uint16_t mod3_from_modQ(uint16_t v) { + v &= 3; + return v ^ (v >> 1); +} + +// poly_marshal_mod3 marshals |in| to |out| where the coefficients of |in| are +// all in {0, 1, Q-1, 65535} and |in| is mod Φ(N). (Note that coefficients may +// have invalid values when processing attacker-controlled inputs.) +static void poly_marshal_mod3(uint8_t out[HRSS_POLY3_BYTES], + const struct poly *in) { + const uint16_t *coeffs = in->v; + + // Only 700 coefficients are marshaled because in[700] must be zero. + assert(coeffs[N-1] == 0); + + for (size_t i = 0; i < HRSS_POLY3_BYTES; i++) { + const uint16_t coeffs0 = mod3_from_modQ(coeffs[0]); + const uint16_t coeffs1 = mod3_from_modQ(coeffs[1]); + const uint16_t coeffs2 = mod3_from_modQ(coeffs[2]); + const uint16_t coeffs3 = mod3_from_modQ(coeffs[3]); + const uint16_t coeffs4 = mod3_from_modQ(coeffs[4]); + out[i] = coeffs0 + coeffs1 * 3 + coeffs2 * 9 + coeffs3 * 27 + coeffs4 * 81; + coeffs += 5; + } +} + +// HRSS-specific functions +// ----------------------- + +// poly_short_sample samples a vector of values in {0xffff (i.e. -1), 0, 1}. +// This is the same action as the algorithm in [HRSSNIST] section 1.8.1, but +// with HRSS-SXY the sampling algorithm is now a private detail of the +// implementation (previously it had to match between two parties). This +// function uses that freedom to implement a flatter distribution of values. +static void poly_short_sample(struct poly *out, + const uint8_t in[HRSS_SAMPLE_BYTES]) { + OPENSSL_STATIC_ASSERT(HRSS_SAMPLE_BYTES == N - 1, + "HRSS_SAMPLE_BYTES incorrect"); + for (size_t i = 0; i < N - 1; i++) { + uint16_t v = mod3(in[i]); + // Map {0, 1, 2} -> {0, 1, 0xffff} + v |= ((v >> 1) ^ 1) - 1; + out->v[i] = v; + } + out->v[N - 1] = 0; +} + +// poly_short_sample_plus performs the T+ sample as defined in [HRSSNIST], +// section 1.8.2. +static void poly_short_sample_plus(struct poly *out, + const uint8_t in[HRSS_SAMPLE_BYTES]) { + poly_short_sample(out, in); + + // sum (and the product in the for loop) will overflow. But that's fine + // because |sum| is bound by +/- (N-2), and N < 2^15 so it works out. + uint16_t sum = 0; + for (unsigned i = 0; i < N - 2; i++) { + sum += (unsigned) out->v[i] * out->v[i + 1]; + } + + // If the sum is negative, flip the sign of even-positioned coefficients. (See + // page 8 of [HRSS].) + sum = ((int16_t) sum) >> 15; + const uint16_t scale = sum | (~sum & 1); + for (unsigned i = 0; i < N; i += 2) { + out->v[i] = (unsigned) out->v[i] * scale; + } +} + +// poly_lift computes the function discussed in [HRSS], appendix B. +static void poly_lift(struct poly *out, const struct poly *a) { + // We wish to calculate a/(𝑥-1) mod Φ(N) over GF(3), where Φ(N) is the + // Nth cyclotomic polynomial, i.e. 1 + 𝑥 + … + 𝑥^700 (since N is prime). + + // 1/(𝑥-1) has a fairly basic structure that we can exploit to speed this up: + // + // R. = PolynomialRing(GF(3)…) + // inv = R.cyclotomic_polynomial(1).inverse_mod(R.cyclotomic_polynomial(n)) + // list(inv)[:15] + // [1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2] + // + // This three-element pattern of coefficients repeats for the whole + // polynomial. + // + // Next define the overbar operator such that z̅ = z[0] + + // reverse(z[1:]). (Index zero of a polynomial here is the coefficient + // of the constant term. So index one is the coefficient of 𝑥 and so + // on.) + // + // A less odd way to define this is to see that z̅ negates the indexes, + // so z̅[0] = z[-0], z̅[1] = z[-1] and so on. + // + // The use of z̅ is that, when working mod (𝑥^701 - 1), vz[0] = , vz[1] = , …. (Where is the inner product: the sum + // of the point-wise products.) Although we calculated the inverse mod + // Φ(N), we can work mod (𝑥^N - 1) and reduce mod Φ(N) at the end. + // (That's because (𝑥^N - 1) is a multiple of Φ(N).) + // + // When working mod (𝑥^N - 1), multiplication by 𝑥 is a right-rotation + // of the list of coefficients. + // + // Thus we can consider what the pattern of z̅, 𝑥z̅, 𝑥^2z̅, … looks like: + // + // def reverse(xs): + // suffix = list(xs[1:]) + // suffix.reverse() + // return [xs[0]] + suffix + // + // def rotate(xs): + // return [xs[-1]] + xs[:-1] + // + // zoverbar = reverse(list(inv) + [0]) + // xzoverbar = rotate(reverse(list(inv) + [0])) + // x2zoverbar = rotate(rotate(reverse(list(inv) + [0]))) + // + // zoverbar[:15] + // [1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1] + // xzoverbar[:15] + // [0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0] + // x2zoverbar[:15] + // [2, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2] + // + // (For a formula for z̅, see lemma two of appendix B.) + // + // After the first three elements have been taken care of, all then have + // a repeating three-element cycle. The next value (𝑥^3z̅) involves + // three rotations of the first pattern, thus the three-element cycle + // lines up. However, the discontinuity in the first three elements + // obviously moves to a different position. Consider the difference + // between 𝑥^3z̅ and z̅: + // + // [x-y for (x,y) in zip(zoverbar, x3zoverbar)][:15] + // [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + // + // This pattern of differences is the same for all elements, although it + // obviously moves right with the rotations. + // + // From this, we reach algorithm eight of appendix B. + + // Handle the first three elements of the inner products. + out->v[0] = a->v[0] + a->v[2]; + out->v[1] = a->v[1]; + out->v[2] = -a->v[0] + a->v[2]; + + // s0, s1, s2 are added into out->v[0], out->v[1], and out->v[2], + // respectively. We do not compute s1 because it's just -(s0 + s1). + uint16_t s0 = 0, s2 = 0; + for (size_t i = 3; i < 699; i += 3) { + s0 += -a->v[i] + a->v[i + 2]; + // s1 += a->v[i] - a->v[i + 1]; + s2 += a->v[i + 1] - a->v[i + 2]; + } + + // Handle the fact that the three-element pattern doesn't fill the + // polynomial exactly (since 701 isn't a multiple of three). + s0 -= a->v[699]; + // s1 += a->v[699] - a->v[700]; + s2 += a->v[700]; + + // Note that s0 + s1 + s2 = 0. + out->v[0] += s0; + out->v[1] -= (s0 + s2); // = s1 + out->v[2] += s2; + + // Calculate the remaining inner products by taking advantage of the + // fact that the pattern repeats every three cycles and the pattern of + // differences moves with the rotation. + for (size_t i = 3; i < N; i++) { + out->v[i] = (out->v[i - 3] - (a->v[i - 2] + a->v[i - 1] + a->v[i])); + } + + // Reduce mod Φ(N) by subtracting a multiple of out[700] from every + // element and convert to mod Q. (See above about adding twice as + // subtraction.) + const crypto_word_t v = out->v[700]; + for (unsigned i = 0; i < N; i++) { + const uint16_t vi_mod3 = mod3(out->v[i] - v); + // Map {0, 1, 2} to {0, 1, 0xffff}. + out->v[i] = (~((vi_mod3 >> 1) - 1)) | vi_mod3; + } + + poly_mul_x_minus_1(out); +} + +struct public_key { + struct poly ph; +}; + +struct private_key { + struct poly3 f, f_inverse; + struct poly ph_inverse; + uint8_t hmac_key[32]; +}; + +// public_key_from_external converts an external public key pointer into an +// internal one. Externally the alignment is only specified to be eight bytes +// but we need 16-byte alignment. We could annotate the external struct with +// that alignment but we can only assume that malloced pointers are 8-byte +// aligned in any case. (Even if the underlying malloc returns values with +// 16-byte alignment, |OPENSSL_malloc| will store an 8-byte size prefix and mess +// that up.) +static struct public_key *public_key_from_external( + struct HRSS_public_key *ext) { + OPENSSL_STATIC_ASSERT( + sizeof(struct HRSS_public_key) >= sizeof(struct public_key) + 15, + "HRSS public key too small"); + + uintptr_t p = (uintptr_t)ext; + p = (p + 15) & ~15; + return (struct public_key *)p; +} + +// private_key_from_external does the same thing as |public_key_from_external|, +// but for private keys. See the comment on that function about alignment +// issues. +static struct private_key *private_key_from_external( + struct HRSS_private_key *ext) { + OPENSSL_STATIC_ASSERT( + sizeof(struct HRSS_private_key) >= sizeof(struct private_key) + 15, + "HRSS private key too small"); + + uintptr_t p = (uintptr_t)ext; + p = (p + 15) & ~15; + return (struct private_key *)p; +} + +void HRSS_generate_key( + struct HRSS_public_key *out_pub, struct HRSS_private_key *out_priv, + const uint8_t in[HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES + 32]) { + struct public_key *pub = public_key_from_external(out_pub); + struct private_key *priv = private_key_from_external(out_priv); + + OPENSSL_memcpy(priv->hmac_key, in + 2 * HRSS_SAMPLE_BYTES, + sizeof(priv->hmac_key)); + + struct poly f; + poly_short_sample_plus(&f, in); + poly3_from_poly(&priv->f, &f); + HRSS_poly3_invert(&priv->f_inverse, &priv->f); + + // pg_phi1 is p (i.e. 3) × g × Φ(1) (i.e. 𝑥-1). + struct poly pg_phi1; + poly_short_sample_plus(&pg_phi1, in + HRSS_SAMPLE_BYTES); + for (unsigned i = 0; i < N; i++) { + pg_phi1.v[i] *= 3; + } + poly_mul_x_minus_1(&pg_phi1); + + struct poly pfg_phi1; + poly_mul(&pfg_phi1, &f, &pg_phi1); + + struct poly pfg_phi1_inverse; + poly_invert(&pfg_phi1_inverse, &pfg_phi1); + + poly_mul(&pub->ph, &pfg_phi1_inverse, &pg_phi1); + poly_mul(&pub->ph, &pub->ph, &pg_phi1); + poly_clamp(&pub->ph); + + poly_mul(&priv->ph_inverse, &pfg_phi1_inverse, &f); + poly_mul(&priv->ph_inverse, &priv->ph_inverse, &f); + poly_clamp(&priv->ph_inverse); +} + +static const char kSharedKey[] = "shared key"; + +void HRSS_encap(uint8_t out_ciphertext[POLY_BYTES], + uint8_t out_shared_key[32], + const struct HRSS_public_key *in_pub, + const uint8_t in[HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES]) { + const struct public_key *pub = + public_key_from_external((struct HRSS_public_key *)in_pub); + struct poly m, r, m_lifted; + poly_short_sample(&m, in); + poly_short_sample(&r, in + HRSS_SAMPLE_BYTES); + poly_lift(&m_lifted, &m); + + struct poly prh_plus_m; + poly_mul(&prh_plus_m, &r, &pub->ph); + for (unsigned i = 0; i < N; i++) { + prh_plus_m.v[i] += m_lifted.v[i]; + } + + poly_marshal(out_ciphertext, &prh_plus_m); + + uint8_t m_bytes[HRSS_POLY3_BYTES], r_bytes[HRSS_POLY3_BYTES]; + poly_marshal_mod3(m_bytes, &m); + poly_marshal_mod3(r_bytes, &r); + + SHA256_CTX hash_ctx; + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, kSharedKey, sizeof(kSharedKey)); + SHA256_Update(&hash_ctx, m_bytes, sizeof(m_bytes)); + SHA256_Update(&hash_ctx, r_bytes, sizeof(r_bytes)); + SHA256_Update(&hash_ctx, out_ciphertext, POLY_BYTES); + SHA256_Final(out_shared_key, &hash_ctx); +} + +void HRSS_decap(uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_private_key *in_priv, + const uint8_t *ciphertext, size_t ciphertext_len) { + const struct private_key *priv = + private_key_from_external((struct HRSS_private_key *)in_priv); + + // This is HMAC, expanded inline rather than using the |HMAC| function so that + // we can avoid dealing with possible allocation failures and so keep this + // function infallible. + uint8_t masked_key[SHA256_CBLOCK]; + OPENSSL_STATIC_ASSERT(sizeof(priv->hmac_key) <= sizeof(masked_key), + "HRSS HMAC key larger than SHA-256 block size"); + for (size_t i = 0; i < sizeof(priv->hmac_key); i++) { + masked_key[i] = priv->hmac_key[i] ^ 0x36; + } + OPENSSL_memset(masked_key + sizeof(priv->hmac_key), 0x36, + sizeof(masked_key) - sizeof(priv->hmac_key)); + + SHA256_CTX hash_ctx; + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, masked_key, sizeof(masked_key)); + SHA256_Update(&hash_ctx, ciphertext, ciphertext_len); + uint8_t inner_digest[SHA256_DIGEST_LENGTH]; + SHA256_Final(inner_digest, &hash_ctx); + + for (size_t i = 0; i < sizeof(priv->hmac_key); i++) { + masked_key[i] ^= (0x5c ^ 0x36); + } + OPENSSL_memset(masked_key + sizeof(priv->hmac_key), 0x5c, + sizeof(masked_key) - sizeof(priv->hmac_key)); + + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, masked_key, sizeof(masked_key)); + SHA256_Update(&hash_ctx, inner_digest, sizeof(inner_digest)); + OPENSSL_STATIC_ASSERT(HRSS_KEY_BYTES == SHA256_DIGEST_LENGTH, + "HRSS shared key length incorrect"); + SHA256_Final(out_shared_key, &hash_ctx); + + struct poly c; + // If the ciphertext is publicly invalid then a random shared key is still + // returned to simply the logic of the caller, but this path is not constant + // time. + if (ciphertext_len != HRSS_CIPHERTEXT_BYTES || + !poly_unmarshal(&c, ciphertext)) { + return; + } + + struct poly f, cf; + struct poly3 cf3, m3; + poly_from_poly3(&f, &priv->f); + poly_mul(&cf, &c, &f); + poly3_from_poly(&cf3, &cf); + // Note that cf3 is not reduced mod Φ(N). That reduction is deferred. + HRSS_poly3_mul(&m3, &cf3, &priv->f_inverse); + + struct poly m, m_lifted; + poly_from_poly3(&m, &m3); + poly_lift(&m_lifted, &m); + + struct poly r; + for (unsigned i = 0; i < N; i++) { + r.v[i] = c.v[i] - m_lifted.v[i]; + } + poly_mul(&r, &r, &priv->ph_inverse); + poly_mod_phiN(&r); + poly_clamp(&r); + + struct poly3 r3; + crypto_word_t ok = poly3_from_poly_checked(&r3, &r); + + // [NTRUCOMP] section 5.1 includes ReEnc2 and a proof that it's valid. Rather + // than do an expensive |poly_mul|, it rebuilds |c'| from |c - lift(m)| + // (called |b|) with: + // t = (−b(1)/N) mod Q + // c' = b + tΦ(N) + lift(m) mod Q + // + // When polynomials are transmitted, the final coefficient is omitted and + // |poly_unmarshal| sets it such that f(1) == 0. Thus c(1) == 0. Also, + // |poly_lift| multiplies the result by (x-1) and therefore evaluating a + // lifted polynomial at 1 is also zero. Thus lift(m)(1) == 0 and so + // (c - lift(m))(1) == 0. + // + // Although we defer the reduction above, |b| is conceptually reduced mod + // Φ(N). In order to do that reduction one subtracts |c[N-1]| from every + // coefficient. Therefore b(1) = -c[N-1]×N. The value of |t|, above, then is + // just recovering |c[N-1]|, and adding tΦ(N) is simply undoing the reduction. + // Therefore b + tΦ(N) + lift(m) = c by construction and we don't need to + // recover |c| at all so long as we do the checks in + // |poly3_from_poly_checked|. + // + // The |poly_marshal| here then is just confirming that |poly_unmarshal| is + // strict and could be omitted. + + uint8_t expected_ciphertext[HRSS_CIPHERTEXT_BYTES]; + OPENSSL_STATIC_ASSERT(HRSS_CIPHERTEXT_BYTES == POLY_BYTES, + "ciphertext is the wrong size"); + assert(ciphertext_len == sizeof(expected_ciphertext)); + poly_marshal(expected_ciphertext, &c); + + uint8_t m_bytes[HRSS_POLY3_BYTES]; + uint8_t r_bytes[HRSS_POLY3_BYTES]; + poly_marshal_mod3(m_bytes, &m); + poly_marshal_mod3(r_bytes, &r); + + ok &= constant_time_is_zero_w(CRYPTO_memcmp(ciphertext, expected_ciphertext, + sizeof(expected_ciphertext))); + + uint8_t shared_key[32]; + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, kSharedKey, sizeof(kSharedKey)); + SHA256_Update(&hash_ctx, m_bytes, sizeof(m_bytes)); + SHA256_Update(&hash_ctx, r_bytes, sizeof(r_bytes)); + SHA256_Update(&hash_ctx, expected_ciphertext, sizeof(expected_ciphertext)); + SHA256_Final(shared_key, &hash_ctx); + + for (unsigned i = 0; i < sizeof(shared_key); i++) { + out_shared_key[i] = + constant_time_select_8(ok, shared_key[i], out_shared_key[i]); + } +} + +void HRSS_marshal_public_key(uint8_t out[HRSS_PUBLIC_KEY_BYTES], + const struct HRSS_public_key *in_pub) { + const struct public_key *pub = + public_key_from_external((struct HRSS_public_key *)in_pub); + poly_marshal(out, &pub->ph); +} + +int HRSS_parse_public_key(struct HRSS_public_key *out, + const uint8_t in[HRSS_PUBLIC_KEY_BYTES]) { + struct public_key *pub = public_key_from_external(out); + if (!poly_unmarshal(&pub->ph, in)) { + return 0; + } + OPENSSL_memset(&pub->ph.v[N], 0, 3 * sizeof(uint16_t)); + return 1; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c.grpc_back new file mode 100644 index 000000000..67ff4c168 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/hrss/hrss.c.grpc_back @@ -0,0 +1,2100 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#if defined(_MSC_VER) +#define RESTRICT +#else +#define RESTRICT restrict +#endif + +#include "../internal.h" +#include "internal.h" + +#if defined(OPENSSL_SSE2) +#include +#endif + +#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) +#include +#endif + +// This is an implementation of [HRSS], but with a KEM transformation based on +// [SXY]. The primary references are: + +// HRSS: https://eprint.iacr.org/2017/667.pdf +// HRSSNIST: +// https://csrc.nist.gov/CSRC/media/Projects/Post-Quantum-Cryptography/documents/round-1/submissions/NTRU_HRSS_KEM.zip +// SXY: https://eprint.iacr.org/2017/1005.pdf +// NTRUTN14: +// https://assets.onboardsecurity.com/static/downloads/NTRU/resources/NTRUTech014.pdf +// NTRUCOMP: https://eprint.iacr.org/2018/1174 +// SAFEGCD: https://gcd.cr.yp.to/papers.html#safegcd + + +// Vector operations. +// +// A couple of functions in this file can use vector operations to meaningful +// effect. If we're building for a target that has a supported vector unit, +// |HRSS_HAVE_VECTOR_UNIT| will be defined and |vec_t| will be typedefed to a +// 128-bit vector. The following functions abstract over the differences between +// NEON and SSE2 for implementing some vector operations. + +// TODO: MSVC can likely also be made to work with vector operations, but ^ must +// be replaced with _mm_xor_si128, etc. +#if defined(OPENSSL_SSE2) && (defined(__clang__) || !defined(_MSC_VER)) + +#define HRSS_HAVE_VECTOR_UNIT +typedef __m128i vec_t; + +// vec_capable returns one iff the current platform supports SSE2. +static int vec_capable(void) { return 1; } + +// vec_add performs a pair-wise addition of four uint16s from |a| and |b|. +static inline vec_t vec_add(vec_t a, vec_t b) { return _mm_add_epi16(a, b); } + +// vec_sub performs a pair-wise subtraction of four uint16s from |a| and |b|. +static inline vec_t vec_sub(vec_t a, vec_t b) { return _mm_sub_epi16(a, b); } + +// vec_mul multiplies each uint16_t in |a| by |b| and returns the resulting +// vector. +static inline vec_t vec_mul(vec_t a, uint16_t b) { + return _mm_mullo_epi16(a, _mm_set1_epi16(b)); +} + +// vec_fma multiplies each uint16_t in |b| by |c|, adds the result to |a|, and +// returns the resulting vector. +static inline vec_t vec_fma(vec_t a, vec_t b, uint16_t c) { + return _mm_add_epi16(a, _mm_mullo_epi16(b, _mm_set1_epi16(c))); +} + +// vec3_rshift_word right-shifts the 24 uint16_t's in |v| by one uint16. +static inline void vec3_rshift_word(vec_t v[3]) { + // Intel's left and right shifting is backwards compared to the order in + // memory because they're based on little-endian order of words (and not just + // bytes). So the shifts in this function will be backwards from what one + // might expect. + const __m128i carry0 = _mm_srli_si128(v[0], 14); + v[0] = _mm_slli_si128(v[0], 2); + + const __m128i carry1 = _mm_srli_si128(v[1], 14); + v[1] = _mm_slli_si128(v[1], 2); + v[1] |= carry0; + + v[2] = _mm_slli_si128(v[2], 2); + v[2] |= carry1; +} + +// vec4_rshift_word right-shifts the 32 uint16_t's in |v| by one uint16. +static inline void vec4_rshift_word(vec_t v[4]) { + // Intel's left and right shifting is backwards compared to the order in + // memory because they're based on little-endian order of words (and not just + // bytes). So the shifts in this function will be backwards from what one + // might expect. + const __m128i carry0 = _mm_srli_si128(v[0], 14); + v[0] = _mm_slli_si128(v[0], 2); + + const __m128i carry1 = _mm_srli_si128(v[1], 14); + v[1] = _mm_slli_si128(v[1], 2); + v[1] |= carry0; + + const __m128i carry2 = _mm_srli_si128(v[2], 14); + v[2] = _mm_slli_si128(v[2], 2); + v[2] |= carry1; + + v[3] = _mm_slli_si128(v[3], 2); + v[3] |= carry2; +} + +// vec_merge_3_5 takes the final three uint16_t's from |left|, appends the first +// five from |right|, and returns the resulting vector. +static inline vec_t vec_merge_3_5(vec_t left, vec_t right) { + return _mm_srli_si128(left, 10) | _mm_slli_si128(right, 6); +} + +// poly3_vec_lshift1 left-shifts the 768 bits in |a_s|, and in |a_a|, by one +// bit. +static inline void poly3_vec_lshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + + for (int i = 0; i < 6; i++) { + vec_t next_carry_s = _mm_srli_epi64(a_s[i], 63); + a_s[i] = _mm_slli_epi64(a_s[i], 1); + a_s[i] |= _mm_slli_si128(next_carry_s, 8); + a_s[i] |= carry_s; + carry_s = _mm_srli_si128(next_carry_s, 8); + + vec_t next_carry_a = _mm_srli_epi64(a_a[i], 63); + a_a[i] = _mm_slli_epi64(a_a[i], 1); + a_a[i] |= _mm_slli_si128(next_carry_a, 8); + a_a[i] |= carry_a; + carry_a = _mm_srli_si128(next_carry_a, 8); + } +} + +// poly3_vec_rshift1 right-shifts the 768 bits in |a_s|, and in |a_a|, by one +// bit. +static inline void poly3_vec_rshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + + for (int i = 5; i >= 0; i--) { + const vec_t next_carry_s = _mm_slli_epi64(a_s[i], 63); + a_s[i] = _mm_srli_epi64(a_s[i], 1); + a_s[i] |= _mm_srli_si128(next_carry_s, 8); + a_s[i] |= carry_s; + carry_s = _mm_slli_si128(next_carry_s, 8); + + const vec_t next_carry_a = _mm_slli_epi64(a_a[i], 63); + a_a[i] = _mm_srli_epi64(a_a[i], 1); + a_a[i] |= _mm_srli_si128(next_carry_a, 8); + a_a[i] |= carry_a; + carry_a = _mm_slli_si128(next_carry_a, 8); + } +} + +// vec_broadcast_bit duplicates the least-significant bit in |a| to all bits in +// a vector and returns the result. +static inline vec_t vec_broadcast_bit(vec_t a) { + return _mm_shuffle_epi32(_mm_srai_epi32(_mm_slli_epi64(a, 63), 31), + 0b01010101); +} + +// vec_get_word returns the |i|th uint16_t in |v|. (This is a macro because the +// compiler requires that |i| be a compile-time constant.) +#define vec_get_word(v, i) _mm_extract_epi16(v, i) + +#elif (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) + +#define HRSS_HAVE_VECTOR_UNIT +typedef uint16x8_t vec_t; + +// These functions perform the same actions as the SSE2 function of the same +// name, above. + +static int vec_capable(void) { return CRYPTO_is_NEON_capable(); } + +static inline vec_t vec_add(vec_t a, vec_t b) { return a + b; } + +static inline vec_t vec_sub(vec_t a, vec_t b) { return a - b; } + +static inline vec_t vec_mul(vec_t a, uint16_t b) { return vmulq_n_u16(a, b); } + +static inline vec_t vec_fma(vec_t a, vec_t b, uint16_t c) { + return vmlaq_n_u16(a, b, c); +} + +static inline void vec3_rshift_word(vec_t v[3]) { + const uint16x8_t kZero = {0}; + v[2] = vextq_u16(v[1], v[2], 7); + v[1] = vextq_u16(v[0], v[1], 7); + v[0] = vextq_u16(kZero, v[0], 7); +} + +static inline void vec4_rshift_word(vec_t v[4]) { + const uint16x8_t kZero = {0}; + v[3] = vextq_u16(v[2], v[3], 7); + v[2] = vextq_u16(v[1], v[2], 7); + v[1] = vextq_u16(v[0], v[1], 7); + v[0] = vextq_u16(kZero, v[0], 7); +} + +static inline vec_t vec_merge_3_5(vec_t left, vec_t right) { + return vextq_u16(left, right, 5); +} + +static inline uint16_t vec_get_word(vec_t v, unsigned i) { + return v[i]; +} + +#if !defined(OPENSSL_AARCH64) + +static inline vec_t vec_broadcast_bit(vec_t a) { + a = (vec_t)vshrq_n_s16(((int16x8_t)a) << 15, 15); + return vdupq_lane_u16(vget_low_u16(a), 0); +} + +static inline void poly3_vec_lshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + const vec_t kZero = {0}; + + for (int i = 0; i < 6; i++) { + vec_t next_carry_s = a_s[i] >> 15; + a_s[i] <<= 1; + a_s[i] |= vextq_u16(kZero, next_carry_s, 7); + a_s[i] |= carry_s; + carry_s = vextq_u16(next_carry_s, kZero, 7); + + vec_t next_carry_a = a_a[i] >> 15; + a_a[i] <<= 1; + a_a[i] |= vextq_u16(kZero, next_carry_a, 7); + a_a[i] |= carry_a; + carry_a = vextq_u16(next_carry_a, kZero, 7); + } +} + +static inline void poly3_vec_rshift1(vec_t a_s[6], vec_t a_a[6]) { + vec_t carry_s = {0}; + vec_t carry_a = {0}; + const vec_t kZero = {0}; + + for (int i = 5; i >= 0; i--) { + vec_t next_carry_s = a_s[i] << 15; + a_s[i] >>= 1; + a_s[i] |= vextq_u16(next_carry_s, kZero, 1); + a_s[i] |= carry_s; + carry_s = vextq_u16(kZero, next_carry_s, 1); + + vec_t next_carry_a = a_a[i] << 15; + a_a[i] >>= 1; + a_a[i] |= vextq_u16(next_carry_a, kZero, 1); + a_a[i] |= carry_a; + carry_a = vextq_u16(kZero, next_carry_a, 1); + } +} + +#endif // !OPENSSL_AARCH64 + +#endif // (ARM || AARCH64) && NEON + +// Polynomials in this scheme have N terms. +// #define N 701 + +// Underlying data types and arithmetic operations. +// ------------------------------------------------ + +// Binary polynomials. + +// poly2 represents a degree-N polynomial over GF(2). The words are in little- +// endian order, i.e. the coefficient of x^0 is the LSB of the first word. The +// final word is only partially used since N is not a multiple of the word size. + +// Defined in internal.h: +// struct poly2 { +// crypto_word_t v[WORDS_PER_POLY]; +// }; + +OPENSSL_UNUSED static void hexdump(const void *void_in, size_t len) { + const uint8_t *in = (const uint8_t *)void_in; + for (size_t i = 0; i < len; i++) { + printf("%02x", in[i]); + } + printf("\n"); +} + +static void poly2_zero(struct poly2 *p) { + OPENSSL_memset(&p->v[0], 0, sizeof(crypto_word_t) * WORDS_PER_POLY); +} + +// word_reverse returns |in| with the bits in reverse order. +static crypto_word_t word_reverse(crypto_word_t in) { +#if defined(OPENSSL_64_BIT) + static const crypto_word_t kMasks[6] = { + UINT64_C(0x5555555555555555), + UINT64_C(0x3333333333333333), + UINT64_C(0x0f0f0f0f0f0f0f0f), + UINT64_C(0x00ff00ff00ff00ff), + UINT64_C(0x0000ffff0000ffff), + UINT64_C(0x00000000ffffffff), + }; +#else + static const crypto_word_t kMasks[5] = { + 0x55555555, + 0x33333333, + 0x0f0f0f0f, + 0x00ff00ff, + 0x0000ffff, + }; +#endif + + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kMasks); i++) { + in = ((in >> (1 << i)) & kMasks[i]) | ((in & kMasks[i]) << (1 << i)); + } + + return in; +} + +// lsb_to_all replicates the least-significant bit of |v| to all bits of the +// word. This is used in bit-slicing operations to make a vector from a fixed +// value. +static crypto_word_t lsb_to_all(crypto_word_t v) { return 0u - (v & 1); } + +// poly2_mod_phiN reduces |p| by Φ(N). +static void poly2_mod_phiN(struct poly2 *p) { + // m is the term at x^700, replicated to every bit. + const crypto_word_t m = + lsb_to_all(p->v[WORDS_PER_POLY - 1] >> (BITS_IN_LAST_WORD - 1)); + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + p->v[i] ^= m; + } + p->v[WORDS_PER_POLY - 1] &= (UINT64_C(1) << (BITS_IN_LAST_WORD - 1)) - 1; +} + +// poly2_reverse_700 reverses the order of the first 700 bits of |in| and writes +// the result to |out|. +static void poly2_reverse_700(struct poly2 *out, const struct poly2 *in) { + struct poly2 t; + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + t.v[i] = word_reverse(in->v[i]); + } + + static const size_t shift = BITS_PER_WORD - ((N-1) % BITS_PER_WORD); + for (size_t i = 0; i < WORDS_PER_POLY-1; i++) { + out->v[i] = t.v[WORDS_PER_POLY-1-i] >> shift; + out->v[i] |= t.v[WORDS_PER_POLY-2-i] << (BITS_PER_WORD - shift); + } + out->v[WORDS_PER_POLY-1] = t.v[0] >> shift; +} + +// poly2_cswap exchanges the values of |a| and |b| if |swap| is all ones. +static void poly2_cswap(struct poly2 *a, struct poly2 *b, crypto_word_t swap) { + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + const crypto_word_t sum = swap & (a->v[i] ^ b->v[i]); + a->v[i] ^= sum; + b->v[i] ^= sum; + } +} + +// poly2_fmadd sets |out| to |out| + |in| * m, where m is either +// |CONSTTIME_TRUE_W| or |CONSTTIME_FALSE_W|. +static void poly2_fmadd(struct poly2 *out, const struct poly2 *in, + crypto_word_t m) { + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + out->v[i] ^= in->v[i] & m; + } +} + +// poly2_lshift1 left-shifts |p| by one bit. +static void poly2_lshift1(struct poly2 *p) { + crypto_word_t carry = 0; + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + const crypto_word_t next_carry = p->v[i] >> (BITS_PER_WORD - 1); + p->v[i] <<= 1; + p->v[i] |= carry; + carry = next_carry; + } +} + +// poly2_rshift1 right-shifts |p| by one bit. +static void poly2_rshift1(struct poly2 *p) { + crypto_word_t carry = 0; + for (size_t i = WORDS_PER_POLY - 1; i < WORDS_PER_POLY; i--) { + const crypto_word_t next_carry = p->v[i] & 1; + p->v[i] >>= 1; + p->v[i] |= carry << (BITS_PER_WORD - 1); + carry = next_carry; + } +} + +// poly2_clear_top_bits clears the bits in the final word that are only for +// alignment. +static void poly2_clear_top_bits(struct poly2 *p) { + p->v[WORDS_PER_POLY - 1] &= (UINT64_C(1) << BITS_IN_LAST_WORD) - 1; +} + +// poly2_top_bits_are_clear returns one iff the extra bits in the final words of +// |p| are zero. +static int poly2_top_bits_are_clear(const struct poly2 *p) { + return (p->v[WORDS_PER_POLY - 1] & + ~((UINT64_C(1) << BITS_IN_LAST_WORD) - 1)) == 0; +} + +// Ternary polynomials. + +// poly3 represents a degree-N polynomial over GF(3). Each coefficient is +// bitsliced across the |s| and |a| arrays, like this: +// +// s | a | value +// ----------------- +// 0 | 0 | 0 +// 0 | 1 | 1 +// 1 | 1 | -1 (aka 2) +// 1 | 0 | +// +// ('s' is for sign, and 'a' is the absolute value.) +// +// Once bitsliced as such, the following circuits can be used to implement +// addition and multiplication mod 3: +// +// (s3, a3) = (s1, a1) × (s2, a2) +// a3 = a1 ∧ a2 +// s3 = (s1 ⊕ s2) ∧ a3 +// +// (s3, a3) = (s1, a1) + (s2, a2) +// t = s1 ⊕ a2 +// s3 = t ∧ (s2 ⊕ a1) +// a3 = (a1 ⊕ a2) ∨ (t ⊕ s2) +// +// (s3, a3) = (s1, a1) - (s2, a2) +// t = a1 ⊕ a2 +// s3 = (s1 ⊕ a2) ∧ (t ⊕ s2) +// a3 = t ∨ (s1 ⊕ s2) +// +// Negating a value just involves XORing s by a. +// +// struct poly3 { +// struct poly2 s, a; +// }; + +OPENSSL_UNUSED static void poly3_print(const struct poly3 *in) { + struct poly3 p; + OPENSSL_memcpy(&p, in, sizeof(p)); + p.s.v[WORDS_PER_POLY - 1] &= ((crypto_word_t)1 << BITS_IN_LAST_WORD) - 1; + p.a.v[WORDS_PER_POLY - 1] &= ((crypto_word_t)1 << BITS_IN_LAST_WORD) - 1; + + printf("{["); + for (unsigned i = 0; i < WORDS_PER_POLY; i++) { + if (i) { + printf(" "); + } + printf(BN_HEX_FMT2, p.s.v[i]); + } + printf("] ["); + for (unsigned i = 0; i < WORDS_PER_POLY; i++) { + if (i) { + printf(" "); + } + printf(BN_HEX_FMT2, p.a.v[i]); + } + printf("]}\n"); +} + +static void poly3_zero(struct poly3 *p) { + poly2_zero(&p->s); + poly2_zero(&p->a); +} + +// poly3_reverse_700 reverses the order of the first 700 terms of |in| and +// writes them to |out|. +static void poly3_reverse_700(struct poly3 *out, const struct poly3 *in) { + poly2_reverse_700(&out->a, &in->a); + poly2_reverse_700(&out->s, &in->s); +} + +// poly3_word_mul sets (|out_s|, |out_a|) to (|s1|, |a1|) × (|s2|, |a2|). +static void poly3_word_mul(crypto_word_t *out_s, crypto_word_t *out_a, + const crypto_word_t s1, const crypto_word_t a1, + const crypto_word_t s2, const crypto_word_t a2) { + *out_a = a1 & a2; + *out_s = (s1 ^ s2) & *out_a; +} + +// poly3_word_add sets (|out_s|, |out_a|) to (|s1|, |a1|) + (|s2|, |a2|). +static void poly3_word_add(crypto_word_t *out_s, crypto_word_t *out_a, + const crypto_word_t s1, const crypto_word_t a1, + const crypto_word_t s2, const crypto_word_t a2) { + const crypto_word_t t = s1 ^ a2; + *out_s = t & (s2 ^ a1); + *out_a = (a1 ^ a2) | (t ^ s2); +} + +// poly3_word_sub sets (|out_s|, |out_a|) to (|s1|, |a1|) - (|s2|, |a2|). +static void poly3_word_sub(crypto_word_t *out_s, crypto_word_t *out_a, + const crypto_word_t s1, const crypto_word_t a1, + const crypto_word_t s2, const crypto_word_t a2) { + const crypto_word_t t = a1 ^ a2; + *out_s = (s1 ^ a2) & (t ^ s2); + *out_a = t | (s1 ^ s2); +} + +// poly3_mul_const sets |p| to |p|×m, where m = (ms, ma). +static void poly3_mul_const(struct poly3 *p, crypto_word_t ms, + crypto_word_t ma) { + ms = lsb_to_all(ms); + ma = lsb_to_all(ma); + + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + poly3_word_mul(&p->s.v[i], &p->a.v[i], p->s.v[i], p->a.v[i], ms, ma); + } +} + +// poly3_fmadd sets |out| to |out| - |in|×m, where m is (ms, ma). +static void poly3_fmsub(struct poly3 *RESTRICT out, + const struct poly3 *RESTRICT in, crypto_word_t ms, + crypto_word_t ma) { + crypto_word_t product_s, product_a; + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + poly3_word_mul(&product_s, &product_a, in->s.v[i], in->a.v[i], ms, ma); + poly3_word_sub(&out->s.v[i], &out->a.v[i], out->s.v[i], out->a.v[i], + product_s, product_a); + } +} + +// final_bit_to_all replicates the bit in the final position of the last word to +// all the bits in the word. +static crypto_word_t final_bit_to_all(crypto_word_t v) { + return lsb_to_all(v >> (BITS_IN_LAST_WORD - 1)); +} + +// poly3_top_bits_are_clear returns one iff the extra bits in the final words of +// |p| are zero. +OPENSSL_UNUSED static int poly3_top_bits_are_clear(const struct poly3 *p) { + return poly2_top_bits_are_clear(&p->s) && poly2_top_bits_are_clear(&p->a); +} + +// poly3_mod_phiN reduces |p| by Φ(N). +static void poly3_mod_phiN(struct poly3 *p) { + // In order to reduce by Φ(N) we subtract by the value of the greatest + // coefficient. + const crypto_word_t factor_s = final_bit_to_all(p->s.v[WORDS_PER_POLY - 1]); + const crypto_word_t factor_a = final_bit_to_all(p->a.v[WORDS_PER_POLY - 1]); + + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + poly3_word_sub(&p->s.v[i], &p->a.v[i], p->s.v[i], p->a.v[i], factor_s, + factor_a); + } + + poly2_clear_top_bits(&p->s); + poly2_clear_top_bits(&p->a); +} + +static void poly3_cswap(struct poly3 *a, struct poly3 *b, crypto_word_t swap) { + poly2_cswap(&a->s, &b->s, swap); + poly2_cswap(&a->a, &b->a, swap); +} + +static void poly3_lshift1(struct poly3 *p) { + poly2_lshift1(&p->s); + poly2_lshift1(&p->a); +} + +static void poly3_rshift1(struct poly3 *p) { + poly2_rshift1(&p->s); + poly2_rshift1(&p->a); +} + +// poly3_span represents a pointer into a poly3. +struct poly3_span { + crypto_word_t *s; + crypto_word_t *a; +}; + +// poly3_span_add adds |n| words of values from |a| and |b| and writes the +// result to |out|. +static void poly3_span_add(const struct poly3_span *out, + const struct poly3_span *a, + const struct poly3_span *b, size_t n) { + for (size_t i = 0; i < n; i++) { + poly3_word_add(&out->s[i], &out->a[i], a->s[i], a->a[i], b->s[i], b->a[i]); + } +} + +// poly3_span_sub subtracts |n| words of |b| from |n| words of |a|. +static void poly3_span_sub(const struct poly3_span *a, + const struct poly3_span *b, size_t n) { + for (size_t i = 0; i < n; i++) { + poly3_word_sub(&a->s[i], &a->a[i], a->s[i], a->a[i], b->s[i], b->a[i]); + } +} + +// poly3_mul_aux is a recursive function that multiplies |n| words from |a| and +// |b| and writes 2×|n| words to |out|. Each call uses 2*ceil(n/2) elements of +// |scratch| and the function recurses, except if |n| == 1, when |scratch| isn't +// used and the recursion stops. For |n| in {11, 22}, the transitive total +// amount of |scratch| needed happens to be 2n+2. +static void poly3_mul_aux(const struct poly3_span *out, + const struct poly3_span *scratch, + const struct poly3_span *a, + const struct poly3_span *b, size_t n) { + if (n == 1) { + crypto_word_t r_s_low = 0, r_s_high = 0, r_a_low = 0, r_a_high = 0; + crypto_word_t b_s = b->s[0], b_a = b->a[0]; + const crypto_word_t a_s = a->s[0], a_a = a->a[0]; + + for (size_t i = 0; i < BITS_PER_WORD; i++) { + // Multiply (s, a) by the next value from (b_s, b_a). + crypto_word_t m_s, m_a; + poly3_word_mul(&m_s, &m_a, a_s, a_a, lsb_to_all(b_s), lsb_to_all(b_a)); + b_s >>= 1; + b_a >>= 1; + + if (i == 0) { + // Special case otherwise the code tries to shift by BITS_PER_WORD + // below, which is undefined. + r_s_low = m_s; + r_a_low = m_a; + continue; + } + + // Shift the multiplication result to the correct position. + const crypto_word_t m_s_low = m_s << i; + const crypto_word_t m_s_high = m_s >> (BITS_PER_WORD - i); + const crypto_word_t m_a_low = m_a << i; + const crypto_word_t m_a_high = m_a >> (BITS_PER_WORD - i); + + // Add into the result. + poly3_word_add(&r_s_low, &r_a_low, r_s_low, r_a_low, m_s_low, m_a_low); + poly3_word_add(&r_s_high, &r_a_high, r_s_high, r_a_high, m_s_high, + m_a_high); + } + + out->s[0] = r_s_low; + out->s[1] = r_s_high; + out->a[0] = r_a_low; + out->a[1] = r_a_high; + return; + } + + // Karatsuba multiplication. + // https://en.wikipedia.org/wiki/Karatsuba_algorithm + + // When |n| is odd, the two "halves" will have different lengths. The first + // is always the smaller. + const size_t low_len = n / 2; + const size_t high_len = n - low_len; + const struct poly3_span a_high = {&a->s[low_len], &a->a[low_len]}; + const struct poly3_span b_high = {&b->s[low_len], &b->a[low_len]}; + + // Store a_1 + a_0 in the first half of |out| and b_1 + b_0 in the second + // half. + const struct poly3_span a_cross_sum = *out; + const struct poly3_span b_cross_sum = {&out->s[high_len], &out->a[high_len]}; + poly3_span_add(&a_cross_sum, a, &a_high, low_len); + poly3_span_add(&b_cross_sum, b, &b_high, low_len); + if (high_len != low_len) { + a_cross_sum.s[low_len] = a_high.s[low_len]; + a_cross_sum.a[low_len] = a_high.a[low_len]; + b_cross_sum.s[low_len] = b_high.s[low_len]; + b_cross_sum.a[low_len] = b_high.a[low_len]; + } + + const struct poly3_span child_scratch = {&scratch->s[2 * high_len], + &scratch->a[2 * high_len]}; + const struct poly3_span out_mid = {&out->s[low_len], &out->a[low_len]}; + const struct poly3_span out_high = {&out->s[2 * low_len], + &out->a[2 * low_len]}; + + // Calculate (a_1 + a_0) × (b_1 + b_0) and write to scratch buffer. + poly3_mul_aux(scratch, &child_scratch, &a_cross_sum, &b_cross_sum, high_len); + // Calculate a_1 × b_1. + poly3_mul_aux(&out_high, &child_scratch, &a_high, &b_high, high_len); + // Calculate a_0 × b_0. + poly3_mul_aux(out, &child_scratch, a, b, low_len); + + // Subtract those last two products from the first. + poly3_span_sub(scratch, out, low_len * 2); + poly3_span_sub(scratch, &out_high, high_len * 2); + + // Add the middle product into the output. + poly3_span_add(&out_mid, &out_mid, scratch, high_len * 2); +} + +// HRSS_poly3_mul sets |*out| to |x|×|y| mod Φ(N). +void HRSS_poly3_mul(struct poly3 *out, const struct poly3 *x, + const struct poly3 *y) { + crypto_word_t prod_s[WORDS_PER_POLY * 2]; + crypto_word_t prod_a[WORDS_PER_POLY * 2]; + crypto_word_t scratch_s[WORDS_PER_POLY * 2 + 2]; + crypto_word_t scratch_a[WORDS_PER_POLY * 2 + 2]; + const struct poly3_span prod_span = {prod_s, prod_a}; + const struct poly3_span scratch_span = {scratch_s, scratch_a}; + const struct poly3_span x_span = {(crypto_word_t *)x->s.v, + (crypto_word_t *)x->a.v}; + const struct poly3_span y_span = {(crypto_word_t *)y->s.v, + (crypto_word_t *)y->a.v}; + + poly3_mul_aux(&prod_span, &scratch_span, &x_span, &y_span, WORDS_PER_POLY); + + // |prod| needs to be reduced mod (𝑥^n - 1), which just involves adding the + // upper-half to the lower-half. However, N is 701, which isn't a multiple of + // BITS_PER_WORD, so the upper-half vectors all have to be shifted before + // being added to the lower-half. + for (size_t i = 0; i < WORDS_PER_POLY; i++) { + crypto_word_t v_s = prod_s[WORDS_PER_POLY + i - 1] >> BITS_IN_LAST_WORD; + v_s |= prod_s[WORDS_PER_POLY + i] << (BITS_PER_WORD - BITS_IN_LAST_WORD); + crypto_word_t v_a = prod_a[WORDS_PER_POLY + i - 1] >> BITS_IN_LAST_WORD; + v_a |= prod_a[WORDS_PER_POLY + i] << (BITS_PER_WORD - BITS_IN_LAST_WORD); + + poly3_word_add(&out->s.v[i], &out->a.v[i], prod_s[i], prod_a[i], v_s, v_a); + } + + poly3_mod_phiN(out); +} + +#if defined(HRSS_HAVE_VECTOR_UNIT) && !defined(OPENSSL_AARCH64) + +// poly3_vec_cswap swaps (|a_s|, |a_a|) and (|b_s|, |b_a|) if |swap| is +// |0xff..ff|. Otherwise, |swap| must be zero. +static inline void poly3_vec_cswap(vec_t a_s[6], vec_t a_a[6], vec_t b_s[6], + vec_t b_a[6], const vec_t swap) { + for (int i = 0; i < 6; i++) { + const vec_t sum_s = swap & (a_s[i] ^ b_s[i]); + a_s[i] ^= sum_s; + b_s[i] ^= sum_s; + + const vec_t sum_a = swap & (a_a[i] ^ b_a[i]); + a_a[i] ^= sum_a; + b_a[i] ^= sum_a; + } +} + +// poly3_vec_fmsub subtracts (|ms|, |ma|) × (|b_s|, |b_a|) from (|a_s|, |a_a|). +static inline void poly3_vec_fmsub(vec_t a_s[6], vec_t a_a[6], vec_t b_s[6], + vec_t b_a[6], const vec_t ms, + const vec_t ma) { + for (int i = 0; i < 6; i++) { + // See the bitslice formula, above. + const vec_t s = b_s[i]; + const vec_t a = b_a[i]; + const vec_t product_a = a & ma; + const vec_t product_s = (s ^ ms) & product_a; + + const vec_t out_s = a_s[i]; + const vec_t out_a = a_a[i]; + const vec_t t = out_a ^ product_a; + a_s[i] = (out_s ^ product_a) & (t ^ product_s); + a_a[i] = t | (out_s ^ product_s); + } +} + +// poly3_invert_vec sets |*out| to |in|^-1, i.e. such that |out|×|in| == 1 mod +// Φ(N). +static void poly3_invert_vec(struct poly3 *out, const struct poly3 *in) { + // This algorithm is taken from section 7.1 of [SAFEGCD]. + const vec_t kZero = {0}; + const vec_t kOne = {1}; + static const uint8_t kBottomSixtyOne[sizeof(vec_t)] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x1f}; + + vec_t v_s[6], v_a[6], r_s[6], r_a[6], f_s[6], f_a[6], g_s[6], g_a[6]; + // v = 0 + memset(&v_s, 0, sizeof(v_s)); + memset(&v_a, 0, sizeof(v_a)); + // r = 1 + memset(&r_s, 0, sizeof(r_s)); + memset(&r_a, 0, sizeof(r_a)); + r_a[0] = kOne; + // f = all ones. + memset(f_s, 0, sizeof(f_s)); + memset(f_a, 0xff, 5 * sizeof(vec_t)); + memcpy(&f_a[5], kBottomSixtyOne, sizeof(kBottomSixtyOne)); + // g is the reversal of |in|. + struct poly3 in_reversed; + poly3_reverse_700(&in_reversed, in); + g_s[5] = kZero; + memcpy(&g_s, &in_reversed.s.v, WORDS_PER_POLY * sizeof(crypto_word_t)); + g_a[5] = kZero; + memcpy(&g_a, &in_reversed.a.v, WORDS_PER_POLY * sizeof(crypto_word_t)); + + int delta = 1; + + for (size_t i = 0; i < (2*(N-1)) - 1; i++) { + poly3_vec_lshift1(v_s, v_a); + + const crypto_word_t delta_sign_bit = (delta >> (sizeof(delta) * 8 - 1)) & 1; + const crypto_word_t delta_is_non_negative = delta_sign_bit - 1; + const crypto_word_t delta_is_non_zero = ~constant_time_is_zero_w(delta); + const vec_t g_has_constant_term = vec_broadcast_bit(g_a[0]); + const vec_t mask_w = + {delta_is_non_negative & delta_is_non_zero}; + const vec_t mask = vec_broadcast_bit(mask_w) & g_has_constant_term; + + const vec_t c_a = vec_broadcast_bit(f_a[0] & g_a[0]); + const vec_t c_s = vec_broadcast_bit((f_s[0] ^ g_s[0]) & c_a); + + delta = constant_time_select_int(lsb_to_all(mask[0]), -delta, delta); + delta++; + + poly3_vec_cswap(f_s, f_a, g_s, g_a, mask); + poly3_vec_fmsub(g_s, g_a, f_s, f_a, c_s, c_a); + poly3_vec_rshift1(g_s, g_a); + + poly3_vec_cswap(v_s, v_a, r_s, r_a, mask); + poly3_vec_fmsub(r_s, r_a, v_s, v_a, c_s, c_a); + } + + assert(delta == 0); + memcpy(out->s.v, v_s, WORDS_PER_POLY * sizeof(crypto_word_t)); + memcpy(out->a.v, v_a, WORDS_PER_POLY * sizeof(crypto_word_t)); + poly3_mul_const(out, vec_get_word(f_s[0], 0), vec_get_word(f_a[0], 0)); + poly3_reverse_700(out, out); +} + +#endif // HRSS_HAVE_VECTOR_UNIT + +// HRSS_poly3_invert sets |*out| to |in|^-1, i.e. such that |out|×|in| == 1 mod +// Φ(N). +void HRSS_poly3_invert(struct poly3 *out, const struct poly3 *in) { + // The vector version of this function seems slightly slower on AArch64, but + // is useful on ARMv7 and x86-64. +#if defined(HRSS_HAVE_VECTOR_UNIT) && !defined(OPENSSL_AARCH64) + if (vec_capable()) { + poly3_invert_vec(out, in); + return; + } +#endif + + // This algorithm is taken from section 7.1 of [SAFEGCD]. + struct poly3 v, r, f, g; + // v = 0 + poly3_zero(&v); + // r = 1 + poly3_zero(&r); + r.a.v[0] = 1; + // f = all ones. + OPENSSL_memset(&f.s, 0, sizeof(struct poly2)); + OPENSSL_memset(&f.a, 0xff, sizeof(struct poly2)); + f.a.v[WORDS_PER_POLY - 1] >>= BITS_PER_WORD - BITS_IN_LAST_WORD; + // g is the reversal of |in|. + poly3_reverse_700(&g, in); + int delta = 1; + + for (size_t i = 0; i < (2*(N-1)) - 1; i++) { + poly3_lshift1(&v); + + const crypto_word_t delta_sign_bit = (delta >> (sizeof(delta) * 8 - 1)) & 1; + const crypto_word_t delta_is_non_negative = delta_sign_bit - 1; + const crypto_word_t delta_is_non_zero = ~constant_time_is_zero_w(delta); + const crypto_word_t g_has_constant_term = lsb_to_all(g.a.v[0]); + const crypto_word_t mask = + g_has_constant_term & delta_is_non_negative & delta_is_non_zero; + + crypto_word_t c_s, c_a; + poly3_word_mul(&c_s, &c_a, f.s.v[0], f.a.v[0], g.s.v[0], g.a.v[0]); + c_s = lsb_to_all(c_s); + c_a = lsb_to_all(c_a); + + delta = constant_time_select_int(mask, -delta, delta); + delta++; + + poly3_cswap(&f, &g, mask); + poly3_fmsub(&g, &f, c_s, c_a); + poly3_rshift1(&g); + + poly3_cswap(&v, &r, mask); + poly3_fmsub(&r, &v, c_s, c_a); + } + + assert(delta == 0); + poly3_mul_const(&v, f.s.v[0], f.a.v[0]); + poly3_reverse_700(out, &v); +} + +// Polynomials in Q. + +// Coefficients are reduced mod Q. (Q is clearly not prime, therefore the +// coefficients do not form a field.) +#define Q 8192 + +// VECS_PER_POLY is the number of 128-bit vectors needed to represent a +// polynomial. +#define COEFFICIENTS_PER_VEC (sizeof(vec_t) / sizeof(uint16_t)) +#define VECS_PER_POLY ((N + COEFFICIENTS_PER_VEC - 1) / COEFFICIENTS_PER_VEC) + +// poly represents a polynomial with coefficients mod Q. Note that, while Q is a +// power of two, this does not operate in GF(Q). That would be a binary field +// but this is simply mod Q. Thus the coefficients are not a field. +// +// Coefficients are ordered little-endian, thus the coefficient of x^0 is the +// first element of the array. +struct poly { +#if defined(HRSS_HAVE_VECTOR_UNIT) + union { + // N + 3 = 704, which is a multiple of 64 and thus aligns things, esp for + // the vector code. + uint16_t v[N + 3]; + vec_t vectors[VECS_PER_POLY]; + }; +#else + // Even if !HRSS_HAVE_VECTOR_UNIT, external assembly may be called that + // requires alignment. + alignas(16) uint16_t v[N + 3]; +#endif +}; + +OPENSSL_UNUSED static void poly_print(const struct poly *p) { + printf("["); + for (unsigned i = 0; i < N; i++) { + if (i) { + printf(" "); + } + printf("%d", p->v[i]); + } + printf("]\n"); +} + +#if defined(HRSS_HAVE_VECTOR_UNIT) + +// poly_mul_vec_aux is a recursive function that multiplies |n| words from |a| +// and |b| and writes 2×|n| words to |out|. Each call uses 2*ceil(n/2) elements +// of |scratch| and the function recurses, except if |n| < 3, when |scratch| +// isn't used and the recursion stops. If |n| == |VECS_PER_POLY| then |scratch| +// needs 172 elements. +static void poly_mul_vec_aux(vec_t *restrict out, vec_t *restrict scratch, + const vec_t *restrict a, const vec_t *restrict b, + const size_t n) { + // In [HRSS], the technique they used for polynomial multiplication is + // described: they start with Toom-4 at the top level and then two layers of + // Karatsuba. Karatsuba is a specific instance of the general Toom–Cook + // decomposition, which splits an input n-ways and produces 2n-1 + // multiplications of those parts. So, starting with 704 coefficients (rounded + // up from 701 to have more factors of two), Toom-4 gives seven + // multiplications of degree-174 polynomials. Each round of Karatsuba (which + // is Toom-2) increases the number of multiplications by a factor of three + // while halving the size of the values being multiplied. So two rounds gives + // 63 multiplications of degree-44 polynomials. Then they (I think) form + // vectors by gathering all 63 coefficients of each power together, for each + // input, and doing more rounds of Karatsuba on the vectors until they bottom- + // out somewhere with schoolbook multiplication. + // + // I tried something like that for NEON. NEON vectors are 128 bits so hold + // eight coefficients. I wrote a function that did Karatsuba on eight + // multiplications at the same time, using such vectors, and a Go script that + // decomposed from degree-704, with Karatsuba in non-transposed form, until it + // reached multiplications of degree-44. It batched up those 81 + // multiplications into lots of eight with a single one left over (which was + // handled directly). + // + // It worked, but it was significantly slower than the dumb algorithm used + // below. Potentially that was because I misunderstood how [HRSS] did it, or + // because Clang is bad at generating good code from NEON intrinsics on ARMv7. + // (Which is true: the code generated by Clang for the below is pretty crap.) + // + // This algorithm is much simpler. It just does Karatsuba decomposition all + // the way down and never transposes. When it gets down to degree-16 or + // degree-24 values, they are multiplied using schoolbook multiplication and + // vector intrinsics. The vector operations form each of the eight phase- + // shifts of one of the inputs, point-wise multiply, and then add into the + // result at the correct place. This means that 33% (degree-16) or 25% + // (degree-24) of the multiplies and adds are wasted, but it does ok. + if (n == 2) { + vec_t result[4]; + vec_t vec_a[3]; + static const vec_t kZero = {0}; + vec_a[0] = a[0]; + vec_a[1] = a[1]; + vec_a[2] = kZero; + + result[0] = vec_mul(vec_a[0], vec_get_word(b[0], 0)); + result[1] = vec_mul(vec_a[1], vec_get_word(b[0], 0)); + + result[1] = vec_fma(result[1], vec_a[0], vec_get_word(b[1], 0)); + result[2] = vec_mul(vec_a[1], vec_get_word(b[1], 0)); + result[3] = kZero; + + vec3_rshift_word(vec_a); + +#define BLOCK(x, y) \ + do { \ + result[x + 0] = \ + vec_fma(result[x + 0], vec_a[0], vec_get_word(b[y / 8], y % 8)); \ + result[x + 1] = \ + vec_fma(result[x + 1], vec_a[1], vec_get_word(b[y / 8], y % 8)); \ + result[x + 2] = \ + vec_fma(result[x + 2], vec_a[2], vec_get_word(b[y / 8], y % 8)); \ + } while (0) + + BLOCK(0, 1); + BLOCK(1, 9); + + vec3_rshift_word(vec_a); + + BLOCK(0, 2); + BLOCK(1, 10); + + vec3_rshift_word(vec_a); + + BLOCK(0, 3); + BLOCK(1, 11); + + vec3_rshift_word(vec_a); + + BLOCK(0, 4); + BLOCK(1, 12); + + vec3_rshift_word(vec_a); + + BLOCK(0, 5); + BLOCK(1, 13); + + vec3_rshift_word(vec_a); + + BLOCK(0, 6); + BLOCK(1, 14); + + vec3_rshift_word(vec_a); + + BLOCK(0, 7); + BLOCK(1, 15); + +#undef BLOCK + + memcpy(out, result, sizeof(result)); + return; + } + + if (n == 3) { + vec_t result[6]; + vec_t vec_a[4]; + static const vec_t kZero = {0}; + vec_a[0] = a[0]; + vec_a[1] = a[1]; + vec_a[2] = a[2]; + vec_a[3] = kZero; + + result[0] = vec_mul(a[0], vec_get_word(b[0], 0)); + result[1] = vec_mul(a[1], vec_get_word(b[0], 0)); + result[2] = vec_mul(a[2], vec_get_word(b[0], 0)); + +#define BLOCK_PRE(x, y) \ + do { \ + result[x + 0] = \ + vec_fma(result[x + 0], vec_a[0], vec_get_word(b[y / 8], y % 8)); \ + result[x + 1] = \ + vec_fma(result[x + 1], vec_a[1], vec_get_word(b[y / 8], y % 8)); \ + result[x + 2] = vec_mul(vec_a[2], vec_get_word(b[y / 8], y % 8)); \ + } while (0) + + BLOCK_PRE(1, 8); + BLOCK_PRE(2, 16); + + result[5] = kZero; + + vec4_rshift_word(vec_a); + +#define BLOCK(x, y) \ + do { \ + result[x + 0] = \ + vec_fma(result[x + 0], vec_a[0], vec_get_word(b[y / 8], y % 8)); \ + result[x + 1] = \ + vec_fma(result[x + 1], vec_a[1], vec_get_word(b[y / 8], y % 8)); \ + result[x + 2] = \ + vec_fma(result[x + 2], vec_a[2], vec_get_word(b[y / 8], y % 8)); \ + result[x + 3] = \ + vec_fma(result[x + 3], vec_a[3], vec_get_word(b[y / 8], y % 8)); \ + } while (0) + + BLOCK(0, 1); + BLOCK(1, 9); + BLOCK(2, 17); + + vec4_rshift_word(vec_a); + + BLOCK(0, 2); + BLOCK(1, 10); + BLOCK(2, 18); + + vec4_rshift_word(vec_a); + + BLOCK(0, 3); + BLOCK(1, 11); + BLOCK(2, 19); + + vec4_rshift_word(vec_a); + + BLOCK(0, 4); + BLOCK(1, 12); + BLOCK(2, 20); + + vec4_rshift_word(vec_a); + + BLOCK(0, 5); + BLOCK(1, 13); + BLOCK(2, 21); + + vec4_rshift_word(vec_a); + + BLOCK(0, 6); + BLOCK(1, 14); + BLOCK(2, 22); + + vec4_rshift_word(vec_a); + + BLOCK(0, 7); + BLOCK(1, 15); + BLOCK(2, 23); + +#undef BLOCK +#undef BLOCK_PRE + + memcpy(out, result, sizeof(result)); + + return; + } + + // Karatsuba multiplication. + // https://en.wikipedia.org/wiki/Karatsuba_algorithm + + // When |n| is odd, the two "halves" will have different lengths. The first is + // always the smaller. + const size_t low_len = n / 2; + const size_t high_len = n - low_len; + const vec_t *a_high = &a[low_len]; + const vec_t *b_high = &b[low_len]; + + // Store a_1 + a_0 in the first half of |out| and b_1 + b_0 in the second + // half. + for (size_t i = 0; i < low_len; i++) { + out[i] = vec_add(a_high[i], a[i]); + out[high_len + i] = vec_add(b_high[i], b[i]); + } + if (high_len != low_len) { + out[low_len] = a_high[low_len]; + out[high_len + low_len] = b_high[low_len]; + } + + vec_t *const child_scratch = &scratch[2 * high_len]; + // Calculate (a_1 + a_0) × (b_1 + b_0) and write to scratch buffer. + poly_mul_vec_aux(scratch, child_scratch, out, &out[high_len], high_len); + // Calculate a_1 × b_1. + poly_mul_vec_aux(&out[low_len * 2], child_scratch, a_high, b_high, high_len); + // Calculate a_0 × b_0. + poly_mul_vec_aux(out, child_scratch, a, b, low_len); + + // Subtract those last two products from the first. + for (size_t i = 0; i < low_len * 2; i++) { + scratch[i] = vec_sub(scratch[i], vec_add(out[i], out[low_len * 2 + i])); + } + if (low_len != high_len) { + scratch[low_len * 2] = vec_sub(scratch[low_len * 2], out[low_len * 4]); + scratch[low_len * 2 + 1] = + vec_sub(scratch[low_len * 2 + 1], out[low_len * 4 + 1]); + } + + // Add the middle product into the output. + for (size_t i = 0; i < high_len * 2; i++) { + out[low_len + i] = vec_add(out[low_len + i], scratch[i]); + } +} + +// poly_mul_vec sets |*out| to |x|×|y| mod (𝑥^n - 1). +static void poly_mul_vec(struct poly *out, const struct poly *x, + const struct poly *y) { + OPENSSL_memset((uint16_t *)&x->v[N], 0, 3 * sizeof(uint16_t)); + OPENSSL_memset((uint16_t *)&y->v[N], 0, 3 * sizeof(uint16_t)); + + OPENSSL_STATIC_ASSERT(sizeof(out->v) == sizeof(vec_t) * VECS_PER_POLY, + "struct poly is the wrong size"); + OPENSSL_STATIC_ASSERT(alignof(struct poly) == alignof(vec_t), + "struct poly has incorrect alignment"); + + vec_t prod[VECS_PER_POLY * 2]; + vec_t scratch[172]; + poly_mul_vec_aux(prod, scratch, x->vectors, y->vectors, VECS_PER_POLY); + + // |prod| needs to be reduced mod (𝑥^n - 1), which just involves adding the + // upper-half to the lower-half. However, N is 701, which isn't a multiple of + // the vector size, so the upper-half vectors all have to be shifted before + // being added to the lower-half. + vec_t *out_vecs = (vec_t *)out->v; + + for (size_t i = 0; i < VECS_PER_POLY; i++) { + const vec_t prev = prod[VECS_PER_POLY - 1 + i]; + const vec_t this = prod[VECS_PER_POLY + i]; + out_vecs[i] = vec_add(prod[i], vec_merge_3_5(prev, this)); + } + + OPENSSL_memset(&out->v[N], 0, 3 * sizeof(uint16_t)); +} + +#endif // HRSS_HAVE_VECTOR_UNIT + +// poly_mul_novec_aux writes the product of |a| and |b| to |out|, using +// |scratch| as scratch space. It'll use Karatsuba if the inputs are large +// enough to warrant it. Each call uses 2*ceil(n/2) elements of |scratch| and +// the function recurses, except if |n| < 64, when |scratch| isn't used and the +// recursion stops. If |n| == |N| then |scratch| needs 1318 elements. +static void poly_mul_novec_aux(uint16_t *out, uint16_t *scratch, + const uint16_t *a, const uint16_t *b, size_t n) { + static const size_t kSchoolbookLimit = 64; + if (n < kSchoolbookLimit) { + OPENSSL_memset(out, 0, sizeof(uint16_t) * n * 2); + for (size_t i = 0; i < n; i++) { + for (size_t j = 0; j < n; j++) { + out[i + j] += (unsigned) a[i] * b[j]; + } + } + + return; + } + + // Karatsuba multiplication. + // https://en.wikipedia.org/wiki/Karatsuba_algorithm + + // When |n| is odd, the two "halves" will have different lengths. The + // first is always the smaller. + const size_t low_len = n / 2; + const size_t high_len = n - low_len; + const uint16_t *const a_high = &a[low_len]; + const uint16_t *const b_high = &b[low_len]; + + for (size_t i = 0; i < low_len; i++) { + out[i] = a_high[i] + a[i]; + out[high_len + i] = b_high[i] + b[i]; + } + if (high_len != low_len) { + out[low_len] = a_high[low_len]; + out[high_len + low_len] = b_high[low_len]; + } + + uint16_t *const child_scratch = &scratch[2 * high_len]; + poly_mul_novec_aux(scratch, child_scratch, out, &out[high_len], high_len); + poly_mul_novec_aux(&out[low_len * 2], child_scratch, a_high, b_high, + high_len); + poly_mul_novec_aux(out, child_scratch, a, b, low_len); + + for (size_t i = 0; i < low_len * 2; i++) { + scratch[i] -= out[i] + out[low_len * 2 + i]; + } + if (low_len != high_len) { + scratch[low_len * 2] -= out[low_len * 4]; + assert(out[low_len * 4 + 1] == 0); + } + + for (size_t i = 0; i < high_len * 2; i++) { + out[low_len + i] += scratch[i]; + } +} + +// poly_mul_novec sets |*out| to |x|×|y| mod (𝑥^n - 1). +static void poly_mul_novec(struct poly *out, const struct poly *x, + const struct poly *y) { + uint16_t prod[2 * N]; + uint16_t scratch[1318]; + poly_mul_novec_aux(prod, scratch, x->v, y->v, N); + + for (size_t i = 0; i < N; i++) { + out->v[i] = prod[i] + prod[i + N]; + } + OPENSSL_memset(&out->v[N], 0, 3 * sizeof(uint16_t)); +} + +static void poly_mul(struct poly *r, const struct poly *a, + const struct poly *b) { +#if defined(POLY_RQ_MUL_ASM) + const int has_avx2 = (OPENSSL_ia32cap_P[2] & (1 << 5)) != 0; + if (has_avx2) { + poly_Rq_mul(r->v, a->v, b->v); + return; + } +#endif + +#if defined(HRSS_HAVE_VECTOR_UNIT) + if (vec_capable()) { + poly_mul_vec(r, a, b); + return; + } +#endif + + // Fallback, non-vector case. + poly_mul_novec(r, a, b); +} + +// poly_mul_x_minus_1 sets |p| to |p|×(𝑥 - 1) mod (𝑥^n - 1). +static void poly_mul_x_minus_1(struct poly *p) { + // Multiplying by (𝑥 - 1) means negating each coefficient and adding in + // the value of the previous one. + const uint16_t orig_final_coefficient = p->v[N - 1]; + + for (size_t i = N - 1; i > 0; i--) { + p->v[i] = p->v[i - 1] - p->v[i]; + } + p->v[0] = orig_final_coefficient - p->v[0]; +} + +// poly_mod_phiN sets |p| to |p| mod Φ(N). +static void poly_mod_phiN(struct poly *p) { + const uint16_t coeff700 = p->v[N - 1]; + + for (unsigned i = 0; i < N; i++) { + p->v[i] -= coeff700; + } +} + +// poly_clamp reduces each coefficient mod Q. +static void poly_clamp(struct poly *p) { + for (unsigned i = 0; i < N; i++) { + p->v[i] &= Q - 1; + } +} + + +// Conversion functions +// -------------------- + +// poly2_from_poly sets |*out| to |in| mod 2. +static void poly2_from_poly(struct poly2 *out, const struct poly *in) { + crypto_word_t *words = out->v; + unsigned shift = 0; + crypto_word_t word = 0; + + for (unsigned i = 0; i < N; i++) { + word >>= 1; + word |= (crypto_word_t)(in->v[i] & 1) << (BITS_PER_WORD - 1); + shift++; + + if (shift == BITS_PER_WORD) { + *words = word; + words++; + word = 0; + shift = 0; + } + } + + word >>= BITS_PER_WORD - shift; + *words = word; +} + +// mod3 treats |a| as a signed number and returns |a| mod 3. +static uint16_t mod3(int16_t a) { + const int16_t q = ((int32_t)a * 21845) >> 16; + int16_t ret = a - 3 * q; + // At this point, |ret| is in {0, 1, 2, 3} and that needs to be mapped to {0, + // 1, 2, 0}. + return ret & ((ret & (ret >> 1)) - 1); +} + +// poly3_from_poly sets |*out| to |in|. +static void poly3_from_poly(struct poly3 *out, const struct poly *in) { + crypto_word_t *words_s = out->s.v; + crypto_word_t *words_a = out->a.v; + crypto_word_t s = 0; + crypto_word_t a = 0; + unsigned shift = 0; + + for (unsigned i = 0; i < N; i++) { + // This duplicates the 13th bit upwards to the top of the uint16, + // essentially treating it as a sign bit and converting into a signed int16. + // The signed value is reduced mod 3, yielding {0, 1, 2}. + const uint16_t v = mod3((int16_t)(in->v[i] << 3) >> 3); + s >>= 1; + const crypto_word_t s_bit = (crypto_word_t)(v & 2) << (BITS_PER_WORD - 2); + s |= s_bit; + a >>= 1; + a |= s_bit | (crypto_word_t)(v & 1) << (BITS_PER_WORD - 1); + shift++; + + if (shift == BITS_PER_WORD) { + *words_s = s; + words_s++; + *words_a = a; + words_a++; + s = a = 0; + shift = 0; + } + } + + s >>= BITS_PER_WORD - shift; + a >>= BITS_PER_WORD - shift; + *words_s = s; + *words_a = a; +} + +// poly3_from_poly_checked sets |*out| to |in|, which has coefficients in {0, 1, +// Q-1}. It returns a mask indicating whether all coefficients were found to be +// in that set. +static crypto_word_t poly3_from_poly_checked(struct poly3 *out, + const struct poly *in) { + crypto_word_t *words_s = out->s.v; + crypto_word_t *words_a = out->a.v; + crypto_word_t s = 0; + crypto_word_t a = 0; + unsigned shift = 0; + crypto_word_t ok = CONSTTIME_TRUE_W; + + for (unsigned i = 0; i < N; i++) { + const uint16_t v = in->v[i]; + // Maps {0, 1, Q-1} to {0, 1, 2}. + uint16_t mod3 = v & 3; + mod3 ^= mod3 >> 1; + const uint16_t expected = (uint16_t)((~((mod3 >> 1) - 1)) | mod3) % Q; + ok &= constant_time_eq_w(v, expected); + + s >>= 1; + const crypto_word_t s_bit = (crypto_word_t)(mod3 & 2) + << (BITS_PER_WORD - 2); + s |= s_bit; + a >>= 1; + a |= s_bit | (crypto_word_t)(mod3 & 1) << (BITS_PER_WORD - 1); + shift++; + + if (shift == BITS_PER_WORD) { + *words_s = s; + words_s++; + *words_a = a; + words_a++; + s = a = 0; + shift = 0; + } + } + + s >>= BITS_PER_WORD - shift; + a >>= BITS_PER_WORD - shift; + *words_s = s; + *words_a = a; + + return ok; +} + +static void poly_from_poly2(struct poly *out, const struct poly2 *in) { + const crypto_word_t *words = in->v; + unsigned shift = 0; + crypto_word_t word = *words; + + for (unsigned i = 0; i < N; i++) { + out->v[i] = word & 1; + word >>= 1; + shift++; + + if (shift == BITS_PER_WORD) { + words++; + word = *words; + shift = 0; + } + } +} + +static void poly_from_poly3(struct poly *out, const struct poly3 *in) { + const crypto_word_t *words_s = in->s.v; + const crypto_word_t *words_a = in->a.v; + crypto_word_t word_s = ~(*words_s); + crypto_word_t word_a = *words_a; + unsigned shift = 0; + + for (unsigned i = 0; i < N; i++) { + out->v[i] = (uint16_t)(word_s & 1) - 1; + out->v[i] |= word_a & 1; + word_s >>= 1; + word_a >>= 1; + shift++; + + if (shift == BITS_PER_WORD) { + words_s++; + words_a++; + word_s = ~(*words_s); + word_a = *words_a; + shift = 0; + } + } +} + +// Polynomial inversion +// -------------------- + +// poly_invert_mod2 sets |*out| to |in^-1| (i.e. such that |*out|×|in| = 1 mod +// Φ(N)), all mod 2. This isn't useful in itself, but is part of doing inversion +// mod Q. +static void poly_invert_mod2(struct poly *out, const struct poly *in) { + // This algorithm is taken from section 7.1 of [SAFEGCD]. + struct poly2 v, r, f, g; + + // v = 0 + poly2_zero(&v); + // r = 1 + poly2_zero(&r); + r.v[0] = 1; + // f = all ones. + OPENSSL_memset(&f, 0xff, sizeof(struct poly2)); + f.v[WORDS_PER_POLY - 1] >>= BITS_PER_WORD - BITS_IN_LAST_WORD; + // g is the reversal of |in|. + poly2_from_poly(&g, in); + poly2_mod_phiN(&g); + poly2_reverse_700(&g, &g); + int delta = 1; + + for (size_t i = 0; i < (2*(N-1)) - 1; i++) { + poly2_lshift1(&v); + + const crypto_word_t delta_sign_bit = (delta >> (sizeof(delta) * 8 - 1)) & 1; + const crypto_word_t delta_is_non_negative = delta_sign_bit - 1; + const crypto_word_t delta_is_non_zero = ~constant_time_is_zero_w(delta); + const crypto_word_t g_has_constant_term = lsb_to_all(g.v[0]); + const crypto_word_t mask = + g_has_constant_term & delta_is_non_negative & delta_is_non_zero; + + const crypto_word_t c = lsb_to_all(f.v[0] & g.v[0]); + + delta = constant_time_select_int(mask, -delta, delta); + delta++; + + poly2_cswap(&f, &g, mask); + poly2_fmadd(&g, &f, c); + poly2_rshift1(&g); + + poly2_cswap(&v, &r, mask); + poly2_fmadd(&r, &v, c); + } + + assert(delta == 0); + assert(f.v[0] & 1); + poly2_reverse_700(&v, &v); + poly_from_poly2(out, &v); +} + +// poly_invert sets |*out| to |in^-1| (i.e. such that |*out|×|in| = 1 mod Φ(N)). +static void poly_invert(struct poly *out, const struct poly *in) { + // Inversion mod Q, which is done based on the result of inverting mod + // 2. See [NTRUTN14] paper, bottom of page two. + struct poly a, *b, tmp; + + // a = -in. + for (unsigned i = 0; i < N; i++) { + a.v[i] = -in->v[i]; + } + + // b = in^-1 mod 2. + b = out; + poly_invert_mod2(b, in); + + // We are working mod Q=2**13 and we need to iterate ceil(log_2(13)) + // times, which is four. + for (unsigned i = 0; i < 4; i++) { + poly_mul(&tmp, &a, b); + tmp.v[0] += 2; + poly_mul(b, b, &tmp); + } +} + +// Marshal and unmarshal functions for various basic types. +// -------------------------------------------------------- + +#define POLY_BYTES 1138 + +// poly_marshal serialises all but the final coefficient of |in| to |out|. +static void poly_marshal(uint8_t out[POLY_BYTES], const struct poly *in) { + const uint16_t *p = in->v; + + for (size_t i = 0; i < N / 8; i++) { + out[0] = p[0]; + out[1] = (0x1f & (p[0] >> 8)) | ((p[1] & 0x07) << 5); + out[2] = p[1] >> 3; + out[3] = (3 & (p[1] >> 11)) | ((p[2] & 0x3f) << 2); + out[4] = (0x7f & (p[2] >> 6)) | ((p[3] & 0x01) << 7); + out[5] = p[3] >> 1; + out[6] = (0xf & (p[3] >> 9)) | ((p[4] & 0x0f) << 4); + out[7] = p[4] >> 4; + out[8] = (1 & (p[4] >> 12)) | ((p[5] & 0x7f) << 1); + out[9] = (0x3f & (p[5] >> 7)) | ((p[6] & 0x03) << 6); + out[10] = p[6] >> 2; + out[11] = (7 & (p[6] >> 10)) | ((p[7] & 0x1f) << 3); + out[12] = p[7] >> 5; + + p += 8; + out += 13; + } + + // There are four remaining values. + out[0] = p[0]; + out[1] = (0x1f & (p[0] >> 8)) | ((p[1] & 0x07) << 5); + out[2] = p[1] >> 3; + out[3] = (3 & (p[1] >> 11)) | ((p[2] & 0x3f) << 2); + out[4] = (0x7f & (p[2] >> 6)) | ((p[3] & 0x01) << 7); + out[5] = p[3] >> 1; + out[6] = 0xf & (p[3] >> 9); +} + +// poly_unmarshal parses the output of |poly_marshal| and sets |out| such that +// all but the final coefficients match, and the final coefficient is calculated +// such that evaluating |out| at one results in zero. It returns one on success +// or zero if |in| is an invalid encoding. +static int poly_unmarshal(struct poly *out, const uint8_t in[POLY_BYTES]) { + uint16_t *p = out->v; + + for (size_t i = 0; i < N / 8; i++) { + p[0] = (uint16_t)(in[0]) | (uint16_t)(in[1] & 0x1f) << 8; + p[1] = (uint16_t)(in[1] >> 5) | (uint16_t)(in[2]) << 3 | + (uint16_t)(in[3] & 3) << 11; + p[2] = (uint16_t)(in[3] >> 2) | (uint16_t)(in[4] & 0x7f) << 6; + p[3] = (uint16_t)(in[4] >> 7) | (uint16_t)(in[5]) << 1 | + (uint16_t)(in[6] & 0xf) << 9; + p[4] = (uint16_t)(in[6] >> 4) | (uint16_t)(in[7]) << 4 | + (uint16_t)(in[8] & 1) << 12; + p[5] = (uint16_t)(in[8] >> 1) | (uint16_t)(in[9] & 0x3f) << 7; + p[6] = (uint16_t)(in[9] >> 6) | (uint16_t)(in[10]) << 2 | + (uint16_t)(in[11] & 7) << 10; + p[7] = (uint16_t)(in[11] >> 3) | (uint16_t)(in[12]) << 5; + + p += 8; + in += 13; + } + + // There are four coefficients remaining. + p[0] = (uint16_t)(in[0]) | (uint16_t)(in[1] & 0x1f) << 8; + p[1] = (uint16_t)(in[1] >> 5) | (uint16_t)(in[2]) << 3 | + (uint16_t)(in[3] & 3) << 11; + p[2] = (uint16_t)(in[3] >> 2) | (uint16_t)(in[4] & 0x7f) << 6; + p[3] = (uint16_t)(in[4] >> 7) | (uint16_t)(in[5]) << 1 | + (uint16_t)(in[6] & 0xf) << 9; + + for (unsigned i = 0; i < N - 1; i++) { + out->v[i] = (int16_t)(out->v[i] << 3) >> 3; + } + + // There are four unused bits in the last byte. We require them to be zero. + if ((in[6] & 0xf0) != 0) { + return 0; + } + + // Set the final coefficient as specifed in [HRSSNIST] 1.9.2 step 6. + uint32_t sum = 0; + for (size_t i = 0; i < N - 1; i++) { + sum += out->v[i]; + } + + out->v[N - 1] = (uint16_t)(0u - sum); + + return 1; +} + +// mod3_from_modQ maps {0, 1, Q-1, 65535} -> {0, 1, 2, 2}. Note that |v| may +// have an invalid value when processing attacker-controlled inputs. +static uint16_t mod3_from_modQ(uint16_t v) { + v &= 3; + return v ^ (v >> 1); +} + +// poly_marshal_mod3 marshals |in| to |out| where the coefficients of |in| are +// all in {0, 1, Q-1, 65535} and |in| is mod Φ(N). (Note that coefficients may +// have invalid values when processing attacker-controlled inputs.) +static void poly_marshal_mod3(uint8_t out[HRSS_POLY3_BYTES], + const struct poly *in) { + const uint16_t *coeffs = in->v; + + // Only 700 coefficients are marshaled because in[700] must be zero. + assert(coeffs[N-1] == 0); + + for (size_t i = 0; i < HRSS_POLY3_BYTES; i++) { + const uint16_t coeffs0 = mod3_from_modQ(coeffs[0]); + const uint16_t coeffs1 = mod3_from_modQ(coeffs[1]); + const uint16_t coeffs2 = mod3_from_modQ(coeffs[2]); + const uint16_t coeffs3 = mod3_from_modQ(coeffs[3]); + const uint16_t coeffs4 = mod3_from_modQ(coeffs[4]); + out[i] = coeffs0 + coeffs1 * 3 + coeffs2 * 9 + coeffs3 * 27 + coeffs4 * 81; + coeffs += 5; + } +} + +// HRSS-specific functions +// ----------------------- + +// poly_short_sample samples a vector of values in {0xffff (i.e. -1), 0, 1}. +// This is the same action as the algorithm in [HRSSNIST] section 1.8.1, but +// with HRSS-SXY the sampling algorithm is now a private detail of the +// implementation (previously it had to match between two parties). This +// function uses that freedom to implement a flatter distribution of values. +static void poly_short_sample(struct poly *out, + const uint8_t in[HRSS_SAMPLE_BYTES]) { + OPENSSL_STATIC_ASSERT(HRSS_SAMPLE_BYTES == N - 1, + "HRSS_SAMPLE_BYTES incorrect"); + for (size_t i = 0; i < N - 1; i++) { + uint16_t v = mod3(in[i]); + // Map {0, 1, 2} -> {0, 1, 0xffff} + v |= ((v >> 1) ^ 1) - 1; + out->v[i] = v; + } + out->v[N - 1] = 0; +} + +// poly_short_sample_plus performs the T+ sample as defined in [HRSSNIST], +// section 1.8.2. +static void poly_short_sample_plus(struct poly *out, + const uint8_t in[HRSS_SAMPLE_BYTES]) { + poly_short_sample(out, in); + + // sum (and the product in the for loop) will overflow. But that's fine + // because |sum| is bound by +/- (N-2), and N < 2^15 so it works out. + uint16_t sum = 0; + for (unsigned i = 0; i < N - 2; i++) { + sum += (unsigned) out->v[i] * out->v[i + 1]; + } + + // If the sum is negative, flip the sign of even-positioned coefficients. (See + // page 8 of [HRSS].) + sum = ((int16_t) sum) >> 15; + const uint16_t scale = sum | (~sum & 1); + for (unsigned i = 0; i < N; i += 2) { + out->v[i] = (unsigned) out->v[i] * scale; + } +} + +// poly_lift computes the function discussed in [HRSS], appendix B. +static void poly_lift(struct poly *out, const struct poly *a) { + // We wish to calculate a/(𝑥-1) mod Φ(N) over GF(3), where Φ(N) is the + // Nth cyclotomic polynomial, i.e. 1 + 𝑥 + … + 𝑥^700 (since N is prime). + + // 1/(𝑥-1) has a fairly basic structure that we can exploit to speed this up: + // + // R. = PolynomialRing(GF(3)…) + // inv = R.cyclotomic_polynomial(1).inverse_mod(R.cyclotomic_polynomial(n)) + // list(inv)[:15] + // [1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2, 1, 0, 2] + // + // This three-element pattern of coefficients repeats for the whole + // polynomial. + // + // Next define the overbar operator such that z̅ = z[0] + + // reverse(z[1:]). (Index zero of a polynomial here is the coefficient + // of the constant term. So index one is the coefficient of 𝑥 and so + // on.) + // + // A less odd way to define this is to see that z̅ negates the indexes, + // so z̅[0] = z[-0], z̅[1] = z[-1] and so on. + // + // The use of z̅ is that, when working mod (𝑥^701 - 1), vz[0] = , vz[1] = , …. (Where is the inner product: the sum + // of the point-wise products.) Although we calculated the inverse mod + // Φ(N), we can work mod (𝑥^N - 1) and reduce mod Φ(N) at the end. + // (That's because (𝑥^N - 1) is a multiple of Φ(N).) + // + // When working mod (𝑥^N - 1), multiplication by 𝑥 is a right-rotation + // of the list of coefficients. + // + // Thus we can consider what the pattern of z̅, 𝑥z̅, 𝑥^2z̅, … looks like: + // + // def reverse(xs): + // suffix = list(xs[1:]) + // suffix.reverse() + // return [xs[0]] + suffix + // + // def rotate(xs): + // return [xs[-1]] + xs[:-1] + // + // zoverbar = reverse(list(inv) + [0]) + // xzoverbar = rotate(reverse(list(inv) + [0])) + // x2zoverbar = rotate(rotate(reverse(list(inv) + [0]))) + // + // zoverbar[:15] + // [1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1] + // xzoverbar[:15] + // [0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0] + // x2zoverbar[:15] + // [2, 0, 1, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2] + // + // (For a formula for z̅, see lemma two of appendix B.) + // + // After the first three elements have been taken care of, all then have + // a repeating three-element cycle. The next value (𝑥^3z̅) involves + // three rotations of the first pattern, thus the three-element cycle + // lines up. However, the discontinuity in the first three elements + // obviously moves to a different position. Consider the difference + // between 𝑥^3z̅ and z̅: + // + // [x-y for (x,y) in zip(zoverbar, x3zoverbar)][:15] + // [0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] + // + // This pattern of differences is the same for all elements, although it + // obviously moves right with the rotations. + // + // From this, we reach algorithm eight of appendix B. + + // Handle the first three elements of the inner products. + out->v[0] = a->v[0] + a->v[2]; + out->v[1] = a->v[1]; + out->v[2] = -a->v[0] + a->v[2]; + + // s0, s1, s2 are added into out->v[0], out->v[1], and out->v[2], + // respectively. We do not compute s1 because it's just -(s0 + s1). + uint16_t s0 = 0, s2 = 0; + for (size_t i = 3; i < 699; i += 3) { + s0 += -a->v[i] + a->v[i + 2]; + // s1 += a->v[i] - a->v[i + 1]; + s2 += a->v[i + 1] - a->v[i + 2]; + } + + // Handle the fact that the three-element pattern doesn't fill the + // polynomial exactly (since 701 isn't a multiple of three). + s0 -= a->v[699]; + // s1 += a->v[699] - a->v[700]; + s2 += a->v[700]; + + // Note that s0 + s1 + s2 = 0. + out->v[0] += s0; + out->v[1] -= (s0 + s2); // = s1 + out->v[2] += s2; + + // Calculate the remaining inner products by taking advantage of the + // fact that the pattern repeats every three cycles and the pattern of + // differences moves with the rotation. + for (size_t i = 3; i < N; i++) { + out->v[i] = (out->v[i - 3] - (a->v[i - 2] + a->v[i - 1] + a->v[i])); + } + + // Reduce mod Φ(N) by subtracting a multiple of out[700] from every + // element and convert to mod Q. (See above about adding twice as + // subtraction.) + const crypto_word_t v = out->v[700]; + for (unsigned i = 0; i < N; i++) { + const uint16_t vi_mod3 = mod3(out->v[i] - v); + // Map {0, 1, 2} to {0, 1, 0xffff}. + out->v[i] = (~((vi_mod3 >> 1) - 1)) | vi_mod3; + } + + poly_mul_x_minus_1(out); +} + +struct public_key { + struct poly ph; +}; + +struct private_key { + struct poly3 f, f_inverse; + struct poly ph_inverse; + uint8_t hmac_key[32]; +}; + +// public_key_from_external converts an external public key pointer into an +// internal one. Externally the alignment is only specified to be eight bytes +// but we need 16-byte alignment. We could annotate the external struct with +// that alignment but we can only assume that malloced pointers are 8-byte +// aligned in any case. (Even if the underlying malloc returns values with +// 16-byte alignment, |OPENSSL_malloc| will store an 8-byte size prefix and mess +// that up.) +static struct public_key *public_key_from_external( + struct HRSS_public_key *ext) { + OPENSSL_STATIC_ASSERT( + sizeof(struct HRSS_public_key) >= sizeof(struct public_key) + 15, + "HRSS public key too small"); + + uintptr_t p = (uintptr_t)ext; + p = (p + 15) & ~15; + return (struct public_key *)p; +} + +// private_key_from_external does the same thing as |public_key_from_external|, +// but for private keys. See the comment on that function about alignment +// issues. +static struct private_key *private_key_from_external( + struct HRSS_private_key *ext) { + OPENSSL_STATIC_ASSERT( + sizeof(struct HRSS_private_key) >= sizeof(struct private_key) + 15, + "HRSS private key too small"); + + uintptr_t p = (uintptr_t)ext; + p = (p + 15) & ~15; + return (struct private_key *)p; +} + +void HRSS_generate_key( + struct HRSS_public_key *out_pub, struct HRSS_private_key *out_priv, + const uint8_t in[HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES + 32]) { + struct public_key *pub = public_key_from_external(out_pub); + struct private_key *priv = private_key_from_external(out_priv); + + OPENSSL_memcpy(priv->hmac_key, in + 2 * HRSS_SAMPLE_BYTES, + sizeof(priv->hmac_key)); + + struct poly f; + poly_short_sample_plus(&f, in); + poly3_from_poly(&priv->f, &f); + HRSS_poly3_invert(&priv->f_inverse, &priv->f); + + // pg_phi1 is p (i.e. 3) × g × Φ(1) (i.e. 𝑥-1). + struct poly pg_phi1; + poly_short_sample_plus(&pg_phi1, in + HRSS_SAMPLE_BYTES); + for (unsigned i = 0; i < N; i++) { + pg_phi1.v[i] *= 3; + } + poly_mul_x_minus_1(&pg_phi1); + + struct poly pfg_phi1; + poly_mul(&pfg_phi1, &f, &pg_phi1); + + struct poly pfg_phi1_inverse; + poly_invert(&pfg_phi1_inverse, &pfg_phi1); + + poly_mul(&pub->ph, &pfg_phi1_inverse, &pg_phi1); + poly_mul(&pub->ph, &pub->ph, &pg_phi1); + poly_clamp(&pub->ph); + + poly_mul(&priv->ph_inverse, &pfg_phi1_inverse, &f); + poly_mul(&priv->ph_inverse, &priv->ph_inverse, &f); + poly_clamp(&priv->ph_inverse); +} + +static const char kSharedKey[] = "shared key"; + +void HRSS_encap(uint8_t out_ciphertext[POLY_BYTES], + uint8_t out_shared_key[32], + const struct HRSS_public_key *in_pub, + const uint8_t in[HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES]) { + const struct public_key *pub = + public_key_from_external((struct HRSS_public_key *)in_pub); + struct poly m, r, m_lifted; + poly_short_sample(&m, in); + poly_short_sample(&r, in + HRSS_SAMPLE_BYTES); + poly_lift(&m_lifted, &m); + + struct poly prh_plus_m; + poly_mul(&prh_plus_m, &r, &pub->ph); + for (unsigned i = 0; i < N; i++) { + prh_plus_m.v[i] += m_lifted.v[i]; + } + + poly_marshal(out_ciphertext, &prh_plus_m); + + uint8_t m_bytes[HRSS_POLY3_BYTES], r_bytes[HRSS_POLY3_BYTES]; + poly_marshal_mod3(m_bytes, &m); + poly_marshal_mod3(r_bytes, &r); + + SHA256_CTX hash_ctx; + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, kSharedKey, sizeof(kSharedKey)); + SHA256_Update(&hash_ctx, m_bytes, sizeof(m_bytes)); + SHA256_Update(&hash_ctx, r_bytes, sizeof(r_bytes)); + SHA256_Update(&hash_ctx, out_ciphertext, POLY_BYTES); + SHA256_Final(out_shared_key, &hash_ctx); +} + +void HRSS_decap(uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_private_key *in_priv, + const uint8_t *ciphertext, size_t ciphertext_len) { + const struct private_key *priv = + private_key_from_external((struct HRSS_private_key *)in_priv); + + // This is HMAC, expanded inline rather than using the |HMAC| function so that + // we can avoid dealing with possible allocation failures and so keep this + // function infallible. + uint8_t masked_key[SHA256_CBLOCK]; + OPENSSL_STATIC_ASSERT(sizeof(priv->hmac_key) <= sizeof(masked_key), + "HRSS HMAC key larger than SHA-256 block size"); + for (size_t i = 0; i < sizeof(priv->hmac_key); i++) { + masked_key[i] = priv->hmac_key[i] ^ 0x36; + } + OPENSSL_memset(masked_key + sizeof(priv->hmac_key), 0x36, + sizeof(masked_key) - sizeof(priv->hmac_key)); + + SHA256_CTX hash_ctx; + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, masked_key, sizeof(masked_key)); + SHA256_Update(&hash_ctx, ciphertext, ciphertext_len); + uint8_t inner_digest[SHA256_DIGEST_LENGTH]; + SHA256_Final(inner_digest, &hash_ctx); + + for (size_t i = 0; i < sizeof(priv->hmac_key); i++) { + masked_key[i] ^= (0x5c ^ 0x36); + } + OPENSSL_memset(masked_key + sizeof(priv->hmac_key), 0x5c, + sizeof(masked_key) - sizeof(priv->hmac_key)); + + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, masked_key, sizeof(masked_key)); + SHA256_Update(&hash_ctx, inner_digest, sizeof(inner_digest)); + OPENSSL_STATIC_ASSERT(HRSS_KEY_BYTES == SHA256_DIGEST_LENGTH, + "HRSS shared key length incorrect"); + SHA256_Final(out_shared_key, &hash_ctx); + + struct poly c; + // If the ciphertext is publicly invalid then a random shared key is still + // returned to simply the logic of the caller, but this path is not constant + // time. + if (ciphertext_len != HRSS_CIPHERTEXT_BYTES || + !poly_unmarshal(&c, ciphertext)) { + return; + } + + struct poly f, cf; + struct poly3 cf3, m3; + poly_from_poly3(&f, &priv->f); + poly_mul(&cf, &c, &f); + poly3_from_poly(&cf3, &cf); + // Note that cf3 is not reduced mod Φ(N). That reduction is deferred. + HRSS_poly3_mul(&m3, &cf3, &priv->f_inverse); + + struct poly m, m_lifted; + poly_from_poly3(&m, &m3); + poly_lift(&m_lifted, &m); + + struct poly r; + for (unsigned i = 0; i < N; i++) { + r.v[i] = c.v[i] - m_lifted.v[i]; + } + poly_mul(&r, &r, &priv->ph_inverse); + poly_mod_phiN(&r); + poly_clamp(&r); + + struct poly3 r3; + crypto_word_t ok = poly3_from_poly_checked(&r3, &r); + + // [NTRUCOMP] section 5.1 includes ReEnc2 and a proof that it's valid. Rather + // than do an expensive |poly_mul|, it rebuilds |c'| from |c - lift(m)| + // (called |b|) with: + // t = (−b(1)/N) mod Q + // c' = b + tΦ(N) + lift(m) mod Q + // + // When polynomials are transmitted, the final coefficient is omitted and + // |poly_unmarshal| sets it such that f(1) == 0. Thus c(1) == 0. Also, + // |poly_lift| multiplies the result by (x-1) and therefore evaluating a + // lifted polynomial at 1 is also zero. Thus lift(m)(1) == 0 and so + // (c - lift(m))(1) == 0. + // + // Although we defer the reduction above, |b| is conceptually reduced mod + // Φ(N). In order to do that reduction one subtracts |c[N-1]| from every + // coefficient. Therefore b(1) = -c[N-1]×N. The value of |t|, above, then is + // just recovering |c[N-1]|, and adding tΦ(N) is simply undoing the reduction. + // Therefore b + tΦ(N) + lift(m) = c by construction and we don't need to + // recover |c| at all so long as we do the checks in + // |poly3_from_poly_checked|. + // + // The |poly_marshal| here then is just confirming that |poly_unmarshal| is + // strict and could be omitted. + + uint8_t expected_ciphertext[HRSS_CIPHERTEXT_BYTES]; + OPENSSL_STATIC_ASSERT(HRSS_CIPHERTEXT_BYTES == POLY_BYTES, + "ciphertext is the wrong size"); + assert(ciphertext_len == sizeof(expected_ciphertext)); + poly_marshal(expected_ciphertext, &c); + + uint8_t m_bytes[HRSS_POLY3_BYTES]; + uint8_t r_bytes[HRSS_POLY3_BYTES]; + poly_marshal_mod3(m_bytes, &m); + poly_marshal_mod3(r_bytes, &r); + + ok &= constant_time_is_zero_w(CRYPTO_memcmp(ciphertext, expected_ciphertext, + sizeof(expected_ciphertext))); + + uint8_t shared_key[32]; + SHA256_Init(&hash_ctx); + SHA256_Update(&hash_ctx, kSharedKey, sizeof(kSharedKey)); + SHA256_Update(&hash_ctx, m_bytes, sizeof(m_bytes)); + SHA256_Update(&hash_ctx, r_bytes, sizeof(r_bytes)); + SHA256_Update(&hash_ctx, expected_ciphertext, sizeof(expected_ciphertext)); + SHA256_Final(shared_key, &hash_ctx); + + for (unsigned i = 0; i < sizeof(shared_key); i++) { + out_shared_key[i] = + constant_time_select_8(ok, shared_key[i], out_shared_key[i]); + } +} + +void HRSS_marshal_public_key(uint8_t out[HRSS_PUBLIC_KEY_BYTES], + const struct HRSS_public_key *in_pub) { + const struct public_key *pub = + public_key_from_external((struct HRSS_public_key *)in_pub); + poly_marshal(out, &pub->ph); +} + +int HRSS_parse_public_key(struct HRSS_public_key *out, + const uint8_t in[HRSS_PUBLIC_KEY_BYTES]) { + struct public_key *pub = public_key_from_external(out); + if (!poly_unmarshal(&pub->ph, in)) { + return 0; + } + OPENSSL_memset(&pub->ph.v[N], 0, 3 * sizeof(uint16_t)); + return 1; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h b/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h new file mode 100644 index 000000000..26762ce7a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h @@ -0,0 +1,61 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HRSS_INTERNAL_H +#define OPENSSL_HEADER_HRSS_INTERNAL_H + +#include +#include "../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#define N 701 +#define BITS_PER_WORD (sizeof(crypto_word_t) * 8) +#define WORDS_PER_POLY ((N + BITS_PER_WORD - 1) / BITS_PER_WORD) +#define BITS_IN_LAST_WORD (N % BITS_PER_WORD) + +struct poly2 { + crypto_word_t v[WORDS_PER_POLY]; +}; + +struct poly3 { + struct poly2 s, a; +}; + +OPENSSL_EXPORT void HRSS_poly3_mul(struct poly3 *out, const struct poly3 *x, + const struct poly3 *y); +OPENSSL_EXPORT void HRSS_poly3_invert(struct poly3 *out, + const struct poly3 *in); + +// On x86-64, we can use the AVX2 code from [HRSS]. (The authors have given +// explicit permission for this and signed a CLA.) However it's 57KB of object +// code, so it's not used if |OPENSSL_SMALL| is defined. +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_SMALL) && \ + defined(OPENSSL_X86_64) && defined(OPENSSL_LINUX) +#define POLY_RQ_MUL_ASM +// poly_Rq_mul is defined in assembly. Inputs and outputs must be 16-byte- +// aligned. +extern void poly_Rq_mul(uint16_t r[N + 3], const uint16_t a[N + 3], + const uint16_t b[N + 3]); +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // !OPENSSL_HEADER_HRSS_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h.grpc_back new file mode 100644 index 000000000..c0d9bd249 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/hrss/internal.h.grpc_back @@ -0,0 +1,61 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HRSS_INTERNAL_H +#define OPENSSL_HEADER_HRSS_INTERNAL_H + +#include +#include "../internal.h" + +#if defined(__cplusplus) +extern "C" { +#endif + + +#define N 701 +#define BITS_PER_WORD (sizeof(crypto_word_t) * 8) +#define WORDS_PER_POLY ((N + BITS_PER_WORD - 1) / BITS_PER_WORD) +#define BITS_IN_LAST_WORD (N % BITS_PER_WORD) + +struct poly2 { + crypto_word_t v[WORDS_PER_POLY]; +}; + +struct poly3 { + struct poly2 s, a; +}; + +OPENSSL_EXPORT void HRSS_poly3_mul(struct poly3 *out, const struct poly3 *x, + const struct poly3 *y); +OPENSSL_EXPORT void HRSS_poly3_invert(struct poly3 *out, + const struct poly3 *in); + +// On x86-64, we can use the AVX2 code from [HRSS]. (The authors have given +// explicit permission for this and signed a CLA.) However it's 57KB of object +// code, so it's not used if |OPENSSL_SMALL| is defined. +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_SMALL) && \ + defined(OPENSSL_X86_64) && defined(OPENSSL_LINUX) +#define POLY_RQ_MUL_ASM +// poly_Rq_mul is defined in assembly. Inputs and outputs must be 16-byte- +// aligned. +extern void poly_Rq_mul(uint16_t r[N + 3], const uint16_t a[N + 3], + const uint16_t b[N + 3]); +#endif + + +#if defined(__cplusplus) +} // extern "C" +#endif + +#endif // !OPENSSL_HEADER_HRSS_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/internal.h b/Pods/BoringSSL-GRPC/src/crypto/internal.h new file mode 100644 index 000000000..4035328fb --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/internal.h @@ -0,0 +1,834 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_CRYPTO_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_INTERNAL_H + +#include +#include +#include + +#include +#include + +#if defined(BORINGSSL_CONSTANT_TIME_VALIDATION) +#include +#endif + +#if !defined(__cplusplus) +#if defined(_MSC_VER) +#define alignas(x) __declspec(align(x)) +#define alignof __alignof +#else +#include +#endif +#endif + +#if defined(OPENSSL_THREADS) && \ + (!defined(OPENSSL_WINDOWS) || defined(__MINGW32__)) +#include +#define OPENSSL_PTHREADS +#endif + +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_PTHREADS) && \ + defined(OPENSSL_WINDOWS) +#define OPENSSL_WINDOWS_THREADS +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM) || \ + defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE) +// OPENSSL_cpuid_setup initializes the platform-specific feature cache. +void OPENSSL_cpuid_setup(void); +#endif + +#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + !defined(OPENSSL_STATIC_ARMCAP) +// OPENSSL_get_armcap_pointer_for_test returns a pointer to |OPENSSL_armcap_P| +// for unit tests. Any modifications to the value must be made after +// |CRYPTO_library_init| but before any other function call in BoringSSL. +OPENSSL_EXPORT uint32_t *OPENSSL_get_armcap_pointer_for_test(void); +#endif + + +#if (!defined(_MSC_VER) || defined(__clang__)) && defined(OPENSSL_64_BIT) +#define BORINGSSL_HAS_UINT128 +typedef __int128_t int128_t; +typedef __uint128_t uint128_t; + +// clang-cl supports __uint128_t but modulus and division don't work. +// https://crbug.com/787617. +#if !defined(_MSC_VER) || !defined(__clang__) +#define BORINGSSL_CAN_DIVIDE_UINT128 +#endif +#endif + +#define OPENSSL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) + +// Have a generic fall-through for different versions of C/C++. +#if defined(__cplusplus) && __cplusplus >= 201703L +#define OPENSSL_FALLTHROUGH [[fallthrough]] +#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__) +#define OPENSSL_FALLTHROUGH [[clang::fallthrough]] +#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \ + __GNUC__ >= 7 +#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]] +#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7 +#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) +#elif defined(__clang__) +#if __has_attribute(fallthrough) && __clang_major__ >= 5 +// Clang 3.5, at least, complains about "error: declaration does not declare +// anything", possibily because we put a semicolon after this macro in +// practice. Thus limit it to >= Clang 5, which does work. +#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) +#else // clang versions that do not support fallthrough. +#define OPENSSL_FALLTHROUGH +#endif +#else // C++11 on gcc 6, and all other cases +#define OPENSSL_FALLTHROUGH +#endif + +// For convenience in testing 64-bit generic code, we allow disabling SSE2 +// intrinsics via |OPENSSL_NO_SSE2_FOR_TESTING|. x86_64 always has SSE2 +// available, so we would otherwise need to test such code on a non-x86_64 +// platform. +#if defined(__SSE2__) && !defined(OPENSSL_NO_SSE2_FOR_TESTING) +#define OPENSSL_SSE2 +#endif + +// buffers_alias returns one if |a| and |b| alias and zero otherwise. +static inline int buffers_alias(const uint8_t *a, size_t a_len, + const uint8_t *b, size_t b_len) { + // Cast |a| and |b| to integers. In C, pointer comparisons between unrelated + // objects are undefined whereas pointer to integer conversions are merely + // implementation-defined. We assume the implementation defined it in a sane + // way. + uintptr_t a_u = (uintptr_t)a; + uintptr_t b_u = (uintptr_t)b; + return a_u + a_len > b_u && b_u + b_len > a_u; +} + + +// Constant-time utility functions. +// +// The following methods return a bitmask of all ones (0xff...f) for true and 0 +// for false. This is useful for choosing a value based on the result of a +// conditional in constant time. For example, +// +// if (a < b) { +// c = a; +// } else { +// c = b; +// } +// +// can be written as +// +// crypto_word_t lt = constant_time_lt_w(a, b); +// c = constant_time_select_w(lt, a, b); + +// crypto_word_t is the type that most constant-time functions use. Ideally we +// would like it to be |size_t|, but NaCl builds in 64-bit mode with 32-bit +// pointers, which means that |size_t| can be 32 bits when |BN_ULONG| is 64 +// bits. Since we want to be able to do constant-time operations on a +// |BN_ULONG|, |crypto_word_t| is defined as an unsigned value with the native +// word length. +#if defined(OPENSSL_64_BIT) +typedef uint64_t crypto_word_t; +#elif defined(OPENSSL_32_BIT) +typedef uint32_t crypto_word_t; +#else +#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" +#endif + +#define CONSTTIME_TRUE_W ~((crypto_word_t)0) +#define CONSTTIME_FALSE_W ((crypto_word_t)0) +#define CONSTTIME_TRUE_8 ((uint8_t)0xff) +#define CONSTTIME_FALSE_8 ((uint8_t)0) + +// value_barrier_w returns |a|, but prevents GCC and Clang from reasoning about +// the returned value. This is used to mitigate compilers undoing constant-time +// code, until we can express our requirements directly in the language. +// +// Note the compiler is aware that |value_barrier_w| has no side effects and +// always has the same output for a given input. This allows it to eliminate +// dead code, move computations across loops, and vectorize. +static inline crypto_word_t value_barrier_w(crypto_word_t a) { +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) + __asm__("" : "+r"(a) : /* no inputs */); +#endif + return a; +} + +// value_barrier_u32 behaves like |value_barrier_w| but takes a |uint32_t|. +static inline uint32_t value_barrier_u32(uint32_t a) { +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) + __asm__("" : "+r"(a) : /* no inputs */); +#endif + return a; +} + +// value_barrier_u64 behaves like |value_barrier_w| but takes a |uint64_t|. +static inline uint64_t value_barrier_u64(uint64_t a) { +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) + __asm__("" : "+r"(a) : /* no inputs */); +#endif + return a; +} + +// constant_time_msb_w returns the given value with the MSB copied to all the +// other bits. +static inline crypto_word_t constant_time_msb_w(crypto_word_t a) { + return 0u - (a >> (sizeof(a) * 8 - 1)); +} + +// constant_time_lt_w returns 0xff..f if a < b and 0 otherwise. +static inline crypto_word_t constant_time_lt_w(crypto_word_t a, + crypto_word_t b) { + // Consider the two cases of the problem: + // msb(a) == msb(b): a < b iff the MSB of a - b is set. + // msb(a) != msb(b): a < b iff the MSB of b is set. + // + // If msb(a) == msb(b) then the following evaluates as: + // msb(a^((a^b)|((a-b)^a))) == + // msb(a^((a-b) ^ a)) == (because msb(a^b) == 0) + // msb(a^a^(a-b)) == (rearranging) + // msb(a-b) (because ∀x. x^x == 0) + // + // Else, if msb(a) != msb(b) then the following evaluates as: + // msb(a^((a^b)|((a-b)^a))) == + // msb(a^(𝟙 | ((a-b)^a))) == (because msb(a^b) == 1 and 𝟙 + // represents a value s.t. msb(𝟙) = 1) + // msb(a^𝟙) == (because ORing with 1 results in 1) + // msb(b) + // + // + // Here is an SMT-LIB verification of this formula: + // + // (define-fun lt ((a (_ BitVec 32)) (b (_ BitVec 32))) (_ BitVec 32) + // (bvxor a (bvor (bvxor a b) (bvxor (bvsub a b) a))) + // ) + // + // (declare-fun a () (_ BitVec 32)) + // (declare-fun b () (_ BitVec 32)) + // + // (assert (not (= (= #x00000001 (bvlshr (lt a b) #x0000001f)) (bvult a b)))) + // (check-sat) + // (get-model) + return constant_time_msb_w(a^((a^b)|((a-b)^a))); +} + +// constant_time_lt_8 acts like |constant_time_lt_w| but returns an 8-bit +// mask. +static inline uint8_t constant_time_lt_8(crypto_word_t a, crypto_word_t b) { + return (uint8_t)(constant_time_lt_w(a, b)); +} + +// constant_time_ge_w returns 0xff..f if a >= b and 0 otherwise. +static inline crypto_word_t constant_time_ge_w(crypto_word_t a, + crypto_word_t b) { + return ~constant_time_lt_w(a, b); +} + +// constant_time_ge_8 acts like |constant_time_ge_w| but returns an 8-bit +// mask. +static inline uint8_t constant_time_ge_8(crypto_word_t a, crypto_word_t b) { + return (uint8_t)(constant_time_ge_w(a, b)); +} + +// constant_time_is_zero returns 0xff..f if a == 0 and 0 otherwise. +static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) { + // Here is an SMT-LIB verification of this formula: + // + // (define-fun is_zero ((a (_ BitVec 32))) (_ BitVec 32) + // (bvand (bvnot a) (bvsub a #x00000001)) + // ) + // + // (declare-fun a () (_ BitVec 32)) + // + // (assert (not (= (= #x00000001 (bvlshr (is_zero a) #x0000001f)) (= a #x00000000)))) + // (check-sat) + // (get-model) + return constant_time_msb_w(~a & (a - 1)); +} + +// constant_time_is_zero_8 acts like |constant_time_is_zero_w| but returns an +// 8-bit mask. +static inline uint8_t constant_time_is_zero_8(crypto_word_t a) { + return (uint8_t)(constant_time_is_zero_w(a)); +} + +// constant_time_eq_w returns 0xff..f if a == b and 0 otherwise. +static inline crypto_word_t constant_time_eq_w(crypto_word_t a, + crypto_word_t b) { + return constant_time_is_zero_w(a ^ b); +} + +// constant_time_eq_8 acts like |constant_time_eq_w| but returns an 8-bit +// mask. +static inline uint8_t constant_time_eq_8(crypto_word_t a, crypto_word_t b) { + return (uint8_t)(constant_time_eq_w(a, b)); +} + +// constant_time_eq_int acts like |constant_time_eq_w| but works on int +// values. +static inline crypto_word_t constant_time_eq_int(int a, int b) { + return constant_time_eq_w((crypto_word_t)(a), (crypto_word_t)(b)); +} + +// constant_time_eq_int_8 acts like |constant_time_eq_int| but returns an 8-bit +// mask. +static inline uint8_t constant_time_eq_int_8(int a, int b) { + return constant_time_eq_8((crypto_word_t)(a), (crypto_word_t)(b)); +} + +// constant_time_select_w returns (mask & a) | (~mask & b). When |mask| is all +// 1s or all 0s (as returned by the methods above), the select methods return +// either |a| (if |mask| is nonzero) or |b| (if |mask| is zero). +static inline crypto_word_t constant_time_select_w(crypto_word_t mask, + crypto_word_t a, + crypto_word_t b) { + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + // + // Adding barriers to both |mask| and |~mask| breaks the relationship between + // the two, which makes the compiler stick with bitmasks. + return (value_barrier_w(mask) & a) | (value_barrier_w(~mask) & b); +} + +// constant_time_select_8 acts like |constant_time_select| but operates on +// 8-bit values. +static inline uint8_t constant_time_select_8(uint8_t mask, uint8_t a, + uint8_t b) { + return (uint8_t)(constant_time_select_w(mask, a, b)); +} + +// constant_time_select_int acts like |constant_time_select| but operates on +// ints. +static inline int constant_time_select_int(crypto_word_t mask, int a, int b) { + return (int)(constant_time_select_w(mask, (crypto_word_t)(a), + (crypto_word_t)(b))); +} + +#if defined(BORINGSSL_CONSTANT_TIME_VALIDATION) + +// CONSTTIME_SECRET takes a pointer and a number of bytes and marks that region +// of memory as secret. Secret data is tracked as it flows to registers and +// other parts of a memory. If secret data is used as a condition for a branch, +// or as a memory index, it will trigger warnings in valgrind. +#define CONSTTIME_SECRET(x, y) VALGRIND_MAKE_MEM_UNDEFINED(x, y) + +// CONSTTIME_DECLASSIFY takes a pointer and a number of bytes and marks that +// region of memory as public. Public data is not subject to constant-time +// rules. +#define CONSTTIME_DECLASSIFY(x, y) VALGRIND_MAKE_MEM_DEFINED(x, y) + +#else + +#define CONSTTIME_SECRET(x, y) +#define CONSTTIME_DECLASSIFY(x, y) + +#endif // BORINGSSL_CONSTANT_TIME_VALIDATION + + +// Thread-safe initialisation. + +#if !defined(OPENSSL_THREADS) +typedef uint32_t CRYPTO_once_t; +#define CRYPTO_ONCE_INIT 0 +#elif defined(OPENSSL_WINDOWS_THREADS) +typedef INIT_ONCE CRYPTO_once_t; +#define CRYPTO_ONCE_INIT INIT_ONCE_STATIC_INIT +#elif defined(OPENSSL_PTHREADS) +typedef pthread_once_t CRYPTO_once_t; +#define CRYPTO_ONCE_INIT PTHREAD_ONCE_INIT +#else +#error "Unknown threading library" +#endif + +// CRYPTO_once calls |init| exactly once per process. This is thread-safe: if +// concurrent threads call |CRYPTO_once| with the same |CRYPTO_once_t| argument +// then they will block until |init| completes, but |init| will have only been +// called once. +// +// The |once| argument must be a |CRYPTO_once_t| that has been initialised with +// the value |CRYPTO_ONCE_INIT|. +OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); + + +// Reference counting. + +// CRYPTO_REFCOUNT_MAX is the value at which the reference count saturates. +#define CRYPTO_REFCOUNT_MAX 0xffffffff + +// CRYPTO_refcount_inc atomically increments the value at |*count| unless the +// value would overflow. It's safe for multiple threads to concurrently call +// this or |CRYPTO_refcount_dec_and_test_zero| on the same +// |CRYPTO_refcount_t|. +OPENSSL_EXPORT void CRYPTO_refcount_inc(CRYPTO_refcount_t *count); + +// CRYPTO_refcount_dec_and_test_zero tests the value at |*count|: +// if it's zero, it crashes the address space. +// if it's the maximum value, it returns zero. +// otherwise, it atomically decrements it and returns one iff the resulting +// value is zero. +// +// It's safe for multiple threads to concurrently call this or +// |CRYPTO_refcount_inc| on the same |CRYPTO_refcount_t|. +OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count); + + +// Locks. +// +// Two types of locks are defined: |CRYPTO_MUTEX|, which can be used in +// structures as normal, and |struct CRYPTO_STATIC_MUTEX|, which can be used as +// a global lock. A global lock must be initialised to the value +// |CRYPTO_STATIC_MUTEX_INIT|. +// +// |CRYPTO_MUTEX| can appear in public structures and so is defined in +// thread.h as a structure large enough to fit the real type. The global lock is +// a different type so it may be initialized with platform initializer macros. + +#if !defined(OPENSSL_THREADS) +struct CRYPTO_STATIC_MUTEX { + char padding; // Empty structs have different sizes in C and C++. +}; +#define CRYPTO_STATIC_MUTEX_INIT { 0 } +#elif defined(OPENSSL_WINDOWS_THREADS) +struct CRYPTO_STATIC_MUTEX { + SRWLOCK lock; +}; +#define CRYPTO_STATIC_MUTEX_INIT { SRWLOCK_INIT } +#elif defined(OPENSSL_PTHREADS) +struct CRYPTO_STATIC_MUTEX { + pthread_rwlock_t lock; +}; +#define CRYPTO_STATIC_MUTEX_INIT { PTHREAD_RWLOCK_INITIALIZER } +#else +#error "Unknown threading library" +#endif + +// CRYPTO_MUTEX_init initialises |lock|. If |lock| is a static variable, use a +// |CRYPTO_STATIC_MUTEX|. +OPENSSL_EXPORT void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_lock_read locks |lock| such that other threads may also have a +// read lock, but none may have a write lock. +OPENSSL_EXPORT void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_lock_write locks |lock| such that no other thread has any type +// of lock on it. +OPENSSL_EXPORT void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_unlock_read unlocks |lock| for reading. +OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_unlock_write unlocks |lock| for writing. +OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_cleanup releases all resources held by |lock|. +OPENSSL_EXPORT void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_lock_read locks |lock| such that other threads may also +// have a read lock, but none may have a write lock. The |lock| variable does +// not need to be initialised by any function, but must have been statically +// initialised with |CRYPTO_STATIC_MUTEX_INIT|. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_read( + struct CRYPTO_STATIC_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_lock_write locks |lock| such that no other thread has +// any type of lock on it. The |lock| variable does not need to be initialised +// by any function, but must have been statically initialised with +// |CRYPTO_STATIC_MUTEX_INIT|. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_write( + struct CRYPTO_STATIC_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_unlock_read unlocks |lock| for reading. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_read( + struct CRYPTO_STATIC_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_unlock_write unlocks |lock| for writing. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_write( + struct CRYPTO_STATIC_MUTEX *lock); + +#if defined(__cplusplus) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +namespace internal { + +// MutexLockBase is a RAII helper for CRYPTO_MUTEX locking. +template +class MutexLockBase { + public: + explicit MutexLockBase(CRYPTO_MUTEX *mu) : mu_(mu) { + assert(mu_ != nullptr); + LockFunc(mu_); + } + ~MutexLockBase() { ReleaseFunc(mu_); } + MutexLockBase(const MutexLockBase &) = delete; + MutexLockBase &operator=(const MutexLockBase &) = + delete; + + private: + CRYPTO_MUTEX *const mu_; +}; + +} // namespace internal + +using MutexWriteLock = + internal::MutexLockBase; +using MutexReadLock = + internal::MutexLockBase; + +BSSL_NAMESPACE_END + +} // extern "C++" +#endif // defined(__cplusplus) + + +// Thread local storage. + +// thread_local_data_t enumerates the types of thread-local data that can be +// stored. +typedef enum { + OPENSSL_THREAD_LOCAL_ERR = 0, + OPENSSL_THREAD_LOCAL_RAND, + OPENSSL_THREAD_LOCAL_TEST, + NUM_OPENSSL_THREAD_LOCALS, +} thread_local_data_t; + +// thread_local_destructor_t is the type of a destructor function that will be +// called when a thread exits and its thread-local storage needs to be freed. +typedef void (*thread_local_destructor_t)(void *); + +// CRYPTO_get_thread_local gets the pointer value that is stored for the +// current thread for the given index, or NULL if none has been set. +OPENSSL_EXPORT void *CRYPTO_get_thread_local(thread_local_data_t value); + +// CRYPTO_set_thread_local sets a pointer value for the current thread at the +// given index. This function should only be called once per thread for a given +// |index|: rather than update the pointer value itself, update the data that +// is pointed to. +// +// The destructor function will be called when a thread exits to free this +// thread-local data. All calls to |CRYPTO_set_thread_local| with the same +// |index| should have the same |destructor| argument. The destructor may be +// called with a NULL argument if a thread that never set a thread-local +// pointer for |index|, exits. The destructor may be called concurrently with +// different arguments. +// +// This function returns one on success or zero on error. If it returns zero +// then |destructor| has been called with |value| already. +OPENSSL_EXPORT int CRYPTO_set_thread_local( + thread_local_data_t index, void *value, + thread_local_destructor_t destructor); + + +// ex_data + +typedef struct crypto_ex_data_func_st CRYPTO_EX_DATA_FUNCS; + +DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) + +// CRYPTO_EX_DATA_CLASS tracks the ex_indices registered for a type which +// supports ex_data. It should defined as a static global within the module +// which defines that type. +typedef struct { + struct CRYPTO_STATIC_MUTEX lock; + STACK_OF(CRYPTO_EX_DATA_FUNCS) *meth; + // num_reserved is one if the ex_data index zero is reserved for legacy + // |TYPE_get_app_data| functions. + uint8_t num_reserved; +} CRYPTO_EX_DATA_CLASS; + +#define CRYPTO_EX_DATA_CLASS_INIT {CRYPTO_STATIC_MUTEX_INIT, NULL, 0} +#define CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA \ + {CRYPTO_STATIC_MUTEX_INIT, NULL, 1} + +// CRYPTO_get_ex_new_index allocates a new index for |ex_data_class| and writes +// it to |*out_index|. Each class of object should provide a wrapper function +// that uses the correct |CRYPTO_EX_DATA_CLASS|. It returns one on success and +// zero otherwise. +OPENSSL_EXPORT int CRYPTO_get_ex_new_index(CRYPTO_EX_DATA_CLASS *ex_data_class, + int *out_index, long argl, + void *argp, + CRYPTO_EX_free *free_func); + +// CRYPTO_set_ex_data sets an extra data pointer on a given object. Each class +// of object should provide a wrapper function. +OPENSSL_EXPORT int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val); + +// CRYPTO_get_ex_data returns an extra data pointer for a given object, or NULL +// if no such index exists. Each class of object should provide a wrapper +// function. +OPENSSL_EXPORT void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int index); + +// CRYPTO_new_ex_data initialises a newly allocated |CRYPTO_EX_DATA|. +OPENSSL_EXPORT void CRYPTO_new_ex_data(CRYPTO_EX_DATA *ad); + +// CRYPTO_free_ex_data frees |ad|, which is embedded inside |obj|, which is an +// object of the given class. +OPENSSL_EXPORT void CRYPTO_free_ex_data(CRYPTO_EX_DATA_CLASS *ex_data_class, + void *obj, CRYPTO_EX_DATA *ad); + + +// Endianness conversions. + +#if defined(__GNUC__) && __GNUC__ >= 2 +static inline uint16_t CRYPTO_bswap2(uint16_t x) { + return __builtin_bswap16(x); +} + +static inline uint32_t CRYPTO_bswap4(uint32_t x) { + return __builtin_bswap32(x); +} + +static inline uint64_t CRYPTO_bswap8(uint64_t x) { + return __builtin_bswap64(x); +} +#elif defined(_MSC_VER) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#pragma intrinsic(_byteswap_uint64, _byteswap_ulong, _byteswap_ushort) +static inline uint16_t CRYPTO_bswap2(uint16_t x) { + return _byteswap_ushort(x); +} + +static inline uint32_t CRYPTO_bswap4(uint32_t x) { + return _byteswap_ulong(x); +} + +static inline uint64_t CRYPTO_bswap8(uint64_t x) { + return _byteswap_uint64(x); +} +#else +static inline uint16_t CRYPTO_bswap2(uint16_t x) { + return (x >> 8) | (x << 8); +} + +static inline uint32_t CRYPTO_bswap4(uint32_t x) { + x = (x >> 16) | (x << 16); + x = ((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8); + return x; +} + +static inline uint64_t CRYPTO_bswap8(uint64_t x) { + return CRYPTO_bswap4(x >> 32) | (((uint64_t)CRYPTO_bswap4(x)) << 32); +} +#endif + + +// Language bug workarounds. +// +// Most C standard library functions are undefined if passed NULL, even when the +// corresponding length is zero. This gives them (and, in turn, all functions +// which call them) surprising behavior on empty arrays. Some compilers will +// miscompile code due to this rule. See also +// https://www.imperialviolet.org/2016/06/26/nonnull.html +// +// These wrapper functions behave the same as the corresponding C standard +// functions, but behave as expected when passed NULL if the length is zero. +// +// Note |OPENSSL_memcmp| is a different function from |CRYPTO_memcmp|. + +// C++ defines |memchr| as a const-correct overload. +#if defined(__cplusplus) +extern "C++" { + +static inline const void *OPENSSL_memchr(const void *s, int c, size_t n) { + if (n == 0) { + return NULL; + } + + return memchr(s, c, n); +} + +static inline void *OPENSSL_memchr(void *s, int c, size_t n) { + if (n == 0) { + return NULL; + } + + return memchr(s, c, n); +} + +} // extern "C++" +#else // __cplusplus + +static inline void *OPENSSL_memchr(const void *s, int c, size_t n) { + if (n == 0) { + return NULL; + } + + return memchr(s, c, n); +} + +#endif // __cplusplus + +static inline int OPENSSL_memcmp(const void *s1, const void *s2, size_t n) { + if (n == 0) { + return 0; + } + + return memcmp(s1, s2, n); +} + +static inline void *OPENSSL_memcpy(void *dst, const void *src, size_t n) { + if (n == 0) { + return dst; + } + + return memcpy(dst, src, n); +} + +static inline void *OPENSSL_memmove(void *dst, const void *src, size_t n) { + if (n == 0) { + return dst; + } + + return memmove(dst, src, n); +} + +static inline void *OPENSSL_memset(void *dst, int c, size_t n) { + if (n == 0) { + return dst; + } + + return memset(dst, c, n); +} + +#if defined(BORINGSSL_FIPS) +// BORINGSSL_FIPS_abort is called when a FIPS power-on or continuous test +// fails. It prevents any further cryptographic operations by the current +// process. +void BORINGSSL_FIPS_abort(void) __attribute__((noreturn)); +#endif + +// boringssl_fips_self_test runs the FIPS KAT-based self tests. It returns one +// on success and zero on error. The argument is the integrity hash of the FIPS +// module and may be used to check and write flag files to suppress duplicate +// self-tests. If |module_hash_len| is zero then no flag file will be checked +// nor written and tests will always be run. +int boringssl_fips_self_test(const uint8_t *module_hash, + size_t module_hash_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/internal.h.grpc_back new file mode 100644 index 000000000..edba9f9d6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/internal.h.grpc_back @@ -0,0 +1,834 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_CRYPTO_INTERNAL_H +#define OPENSSL_HEADER_CRYPTO_INTERNAL_H + +#include +#include +#include + +#include +#include + +#if defined(BORINGSSL_CONSTANT_TIME_VALIDATION) +#include +#endif + +#if !defined(__cplusplus) +#if defined(_MSC_VER) +#define alignas(x) __declspec(align(x)) +#define alignof __alignof +#else +#include +#endif +#endif + +#if defined(OPENSSL_THREADS) && \ + (!defined(OPENSSL_WINDOWS) || defined(__MINGW32__)) +#include +#define OPENSSL_PTHREADS +#endif + +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_PTHREADS) && \ + defined(OPENSSL_WINDOWS) +#define OPENSSL_WINDOWS_THREADS +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) || defined(OPENSSL_ARM) || \ + defined(OPENSSL_AARCH64) || defined(OPENSSL_PPC64LE) +// OPENSSL_cpuid_setup initializes the platform-specific feature cache. +void OPENSSL_cpuid_setup(void); +#endif + +#if (defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64)) && \ + !defined(OPENSSL_STATIC_ARMCAP) +// OPENSSL_get_armcap_pointer_for_test returns a pointer to |OPENSSL_armcap_P| +// for unit tests. Any modifications to the value must be made after +// |CRYPTO_library_init| but before any other function call in BoringSSL. +OPENSSL_EXPORT uint32_t *OPENSSL_get_armcap_pointer_for_test(void); +#endif + + +#if (!defined(_MSC_VER) || defined(__clang__)) && defined(OPENSSL_64_BIT) +#define BORINGSSL_HAS_UINT128 +typedef __int128_t int128_t; +typedef __uint128_t uint128_t; + +// clang-cl supports __uint128_t but modulus and division don't work. +// https://crbug.com/787617. +#if !defined(_MSC_VER) || !defined(__clang__) +#define BORINGSSL_CAN_DIVIDE_UINT128 +#endif +#endif + +#define OPENSSL_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0])) + +// Have a generic fall-through for different versions of C/C++. +#if defined(__cplusplus) && __cplusplus >= 201703L +#define OPENSSL_FALLTHROUGH [[fallthrough]] +#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__) +#define OPENSSL_FALLTHROUGH [[clang::fallthrough]] +#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \ + __GNUC__ >= 7 +#define OPENSSL_FALLTHROUGH [[gnu::fallthrough]] +#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7 +#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) +#elif defined(__clang__) +#if __has_attribute(fallthrough) && __clang_major__ >= 5 +// Clang 3.5, at least, complains about "error: declaration does not declare +// anything", possibily because we put a semicolon after this macro in +// practice. Thus limit it to >= Clang 5, which does work. +#define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) +#else // clang versions that do not support fallthrough. +#define OPENSSL_FALLTHROUGH +#endif +#else // C++11 on gcc 6, and all other cases +#define OPENSSL_FALLTHROUGH +#endif + +// For convenience in testing 64-bit generic code, we allow disabling SSE2 +// intrinsics via |OPENSSL_NO_SSE2_FOR_TESTING|. x86_64 always has SSE2 +// available, so we would otherwise need to test such code on a non-x86_64 +// platform. +#if defined(__SSE2__) && !defined(OPENSSL_NO_SSE2_FOR_TESTING) +#define OPENSSL_SSE2 +#endif + +// buffers_alias returns one if |a| and |b| alias and zero otherwise. +static inline int buffers_alias(const uint8_t *a, size_t a_len, + const uint8_t *b, size_t b_len) { + // Cast |a| and |b| to integers. In C, pointer comparisons between unrelated + // objects are undefined whereas pointer to integer conversions are merely + // implementation-defined. We assume the implementation defined it in a sane + // way. + uintptr_t a_u = (uintptr_t)a; + uintptr_t b_u = (uintptr_t)b; + return a_u + a_len > b_u && b_u + b_len > a_u; +} + + +// Constant-time utility functions. +// +// The following methods return a bitmask of all ones (0xff...f) for true and 0 +// for false. This is useful for choosing a value based on the result of a +// conditional in constant time. For example, +// +// if (a < b) { +// c = a; +// } else { +// c = b; +// } +// +// can be written as +// +// crypto_word_t lt = constant_time_lt_w(a, b); +// c = constant_time_select_w(lt, a, b); + +// crypto_word_t is the type that most constant-time functions use. Ideally we +// would like it to be |size_t|, but NaCl builds in 64-bit mode with 32-bit +// pointers, which means that |size_t| can be 32 bits when |BN_ULONG| is 64 +// bits. Since we want to be able to do constant-time operations on a +// |BN_ULONG|, |crypto_word_t| is defined as an unsigned value with the native +// word length. +#if defined(OPENSSL_64_BIT) +typedef uint64_t crypto_word_t; +#elif defined(OPENSSL_32_BIT) +typedef uint32_t crypto_word_t; +#else +#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" +#endif + +#define CONSTTIME_TRUE_W ~((crypto_word_t)0) +#define CONSTTIME_FALSE_W ((crypto_word_t)0) +#define CONSTTIME_TRUE_8 ((uint8_t)0xff) +#define CONSTTIME_FALSE_8 ((uint8_t)0) + +// value_barrier_w returns |a|, but prevents GCC and Clang from reasoning about +// the returned value. This is used to mitigate compilers undoing constant-time +// code, until we can express our requirements directly in the language. +// +// Note the compiler is aware that |value_barrier_w| has no side effects and +// always has the same output for a given input. This allows it to eliminate +// dead code, move computations across loops, and vectorize. +static inline crypto_word_t value_barrier_w(crypto_word_t a) { +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) + __asm__("" : "+r"(a) : /* no inputs */); +#endif + return a; +} + +// value_barrier_u32 behaves like |value_barrier_w| but takes a |uint32_t|. +static inline uint32_t value_barrier_u32(uint32_t a) { +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) + __asm__("" : "+r"(a) : /* no inputs */); +#endif + return a; +} + +// value_barrier_u64 behaves like |value_barrier_w| but takes a |uint64_t|. +static inline uint64_t value_barrier_u64(uint64_t a) { +#if !defined(OPENSSL_NO_ASM) && (defined(__GNUC__) || defined(__clang__)) + __asm__("" : "+r"(a) : /* no inputs */); +#endif + return a; +} + +// constant_time_msb_w returns the given value with the MSB copied to all the +// other bits. +static inline crypto_word_t constant_time_msb_w(crypto_word_t a) { + return 0u - (a >> (sizeof(a) * 8 - 1)); +} + +// constant_time_lt_w returns 0xff..f if a < b and 0 otherwise. +static inline crypto_word_t constant_time_lt_w(crypto_word_t a, + crypto_word_t b) { + // Consider the two cases of the problem: + // msb(a) == msb(b): a < b iff the MSB of a - b is set. + // msb(a) != msb(b): a < b iff the MSB of b is set. + // + // If msb(a) == msb(b) then the following evaluates as: + // msb(a^((a^b)|((a-b)^a))) == + // msb(a^((a-b) ^ a)) == (because msb(a^b) == 0) + // msb(a^a^(a-b)) == (rearranging) + // msb(a-b) (because ∀x. x^x == 0) + // + // Else, if msb(a) != msb(b) then the following evaluates as: + // msb(a^((a^b)|((a-b)^a))) == + // msb(a^(𝟙 | ((a-b)^a))) == (because msb(a^b) == 1 and 𝟙 + // represents a value s.t. msb(𝟙) = 1) + // msb(a^𝟙) == (because ORing with 1 results in 1) + // msb(b) + // + // + // Here is an SMT-LIB verification of this formula: + // + // (define-fun lt ((a (_ BitVec 32)) (b (_ BitVec 32))) (_ BitVec 32) + // (bvxor a (bvor (bvxor a b) (bvxor (bvsub a b) a))) + // ) + // + // (declare-fun a () (_ BitVec 32)) + // (declare-fun b () (_ BitVec 32)) + // + // (assert (not (= (= #x00000001 (bvlshr (lt a b) #x0000001f)) (bvult a b)))) + // (check-sat) + // (get-model) + return constant_time_msb_w(a^((a^b)|((a-b)^a))); +} + +// constant_time_lt_8 acts like |constant_time_lt_w| but returns an 8-bit +// mask. +static inline uint8_t constant_time_lt_8(crypto_word_t a, crypto_word_t b) { + return (uint8_t)(constant_time_lt_w(a, b)); +} + +// constant_time_ge_w returns 0xff..f if a >= b and 0 otherwise. +static inline crypto_word_t constant_time_ge_w(crypto_word_t a, + crypto_word_t b) { + return ~constant_time_lt_w(a, b); +} + +// constant_time_ge_8 acts like |constant_time_ge_w| but returns an 8-bit +// mask. +static inline uint8_t constant_time_ge_8(crypto_word_t a, crypto_word_t b) { + return (uint8_t)(constant_time_ge_w(a, b)); +} + +// constant_time_is_zero returns 0xff..f if a == 0 and 0 otherwise. +static inline crypto_word_t constant_time_is_zero_w(crypto_word_t a) { + // Here is an SMT-LIB verification of this formula: + // + // (define-fun is_zero ((a (_ BitVec 32))) (_ BitVec 32) + // (bvand (bvnot a) (bvsub a #x00000001)) + // ) + // + // (declare-fun a () (_ BitVec 32)) + // + // (assert (not (= (= #x00000001 (bvlshr (is_zero a) #x0000001f)) (= a #x00000000)))) + // (check-sat) + // (get-model) + return constant_time_msb_w(~a & (a - 1)); +} + +// constant_time_is_zero_8 acts like |constant_time_is_zero_w| but returns an +// 8-bit mask. +static inline uint8_t constant_time_is_zero_8(crypto_word_t a) { + return (uint8_t)(constant_time_is_zero_w(a)); +} + +// constant_time_eq_w returns 0xff..f if a == b and 0 otherwise. +static inline crypto_word_t constant_time_eq_w(crypto_word_t a, + crypto_word_t b) { + return constant_time_is_zero_w(a ^ b); +} + +// constant_time_eq_8 acts like |constant_time_eq_w| but returns an 8-bit +// mask. +static inline uint8_t constant_time_eq_8(crypto_word_t a, crypto_word_t b) { + return (uint8_t)(constant_time_eq_w(a, b)); +} + +// constant_time_eq_int acts like |constant_time_eq_w| but works on int +// values. +static inline crypto_word_t constant_time_eq_int(int a, int b) { + return constant_time_eq_w((crypto_word_t)(a), (crypto_word_t)(b)); +} + +// constant_time_eq_int_8 acts like |constant_time_eq_int| but returns an 8-bit +// mask. +static inline uint8_t constant_time_eq_int_8(int a, int b) { + return constant_time_eq_8((crypto_word_t)(a), (crypto_word_t)(b)); +} + +// constant_time_select_w returns (mask & a) | (~mask & b). When |mask| is all +// 1s or all 0s (as returned by the methods above), the select methods return +// either |a| (if |mask| is nonzero) or |b| (if |mask| is zero). +static inline crypto_word_t constant_time_select_w(crypto_word_t mask, + crypto_word_t a, + crypto_word_t b) { + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + // + // Adding barriers to both |mask| and |~mask| breaks the relationship between + // the two, which makes the compiler stick with bitmasks. + return (value_barrier_w(mask) & a) | (value_barrier_w(~mask) & b); +} + +// constant_time_select_8 acts like |constant_time_select| but operates on +// 8-bit values. +static inline uint8_t constant_time_select_8(uint8_t mask, uint8_t a, + uint8_t b) { + return (uint8_t)(constant_time_select_w(mask, a, b)); +} + +// constant_time_select_int acts like |constant_time_select| but operates on +// ints. +static inline int constant_time_select_int(crypto_word_t mask, int a, int b) { + return (int)(constant_time_select_w(mask, (crypto_word_t)(a), + (crypto_word_t)(b))); +} + +#if defined(BORINGSSL_CONSTANT_TIME_VALIDATION) + +// CONSTTIME_SECRET takes a pointer and a number of bytes and marks that region +// of memory as secret. Secret data is tracked as it flows to registers and +// other parts of a memory. If secret data is used as a condition for a branch, +// or as a memory index, it will trigger warnings in valgrind. +#define CONSTTIME_SECRET(x, y) VALGRIND_MAKE_MEM_UNDEFINED(x, y) + +// CONSTTIME_DECLASSIFY takes a pointer and a number of bytes and marks that +// region of memory as public. Public data is not subject to constant-time +// rules. +#define CONSTTIME_DECLASSIFY(x, y) VALGRIND_MAKE_MEM_DEFINED(x, y) + +#else + +#define CONSTTIME_SECRET(x, y) +#define CONSTTIME_DECLASSIFY(x, y) + +#endif // BORINGSSL_CONSTANT_TIME_VALIDATION + + +// Thread-safe initialisation. + +#if !defined(OPENSSL_THREADS) +typedef uint32_t CRYPTO_once_t; +#define CRYPTO_ONCE_INIT 0 +#elif defined(OPENSSL_WINDOWS_THREADS) +typedef INIT_ONCE CRYPTO_once_t; +#define CRYPTO_ONCE_INIT INIT_ONCE_STATIC_INIT +#elif defined(OPENSSL_PTHREADS) +typedef pthread_once_t CRYPTO_once_t; +#define CRYPTO_ONCE_INIT PTHREAD_ONCE_INIT +#else +#error "Unknown threading library" +#endif + +// CRYPTO_once calls |init| exactly once per process. This is thread-safe: if +// concurrent threads call |CRYPTO_once| with the same |CRYPTO_once_t| argument +// then they will block until |init| completes, but |init| will have only been +// called once. +// +// The |once| argument must be a |CRYPTO_once_t| that has been initialised with +// the value |CRYPTO_ONCE_INIT|. +OPENSSL_EXPORT void CRYPTO_once(CRYPTO_once_t *once, void (*init)(void)); + + +// Reference counting. + +// CRYPTO_REFCOUNT_MAX is the value at which the reference count saturates. +#define CRYPTO_REFCOUNT_MAX 0xffffffff + +// CRYPTO_refcount_inc atomically increments the value at |*count| unless the +// value would overflow. It's safe for multiple threads to concurrently call +// this or |CRYPTO_refcount_dec_and_test_zero| on the same +// |CRYPTO_refcount_t|. +OPENSSL_EXPORT void CRYPTO_refcount_inc(CRYPTO_refcount_t *count); + +// CRYPTO_refcount_dec_and_test_zero tests the value at |*count|: +// if it's zero, it crashes the address space. +// if it's the maximum value, it returns zero. +// otherwise, it atomically decrements it and returns one iff the resulting +// value is zero. +// +// It's safe for multiple threads to concurrently call this or +// |CRYPTO_refcount_inc| on the same |CRYPTO_refcount_t|. +OPENSSL_EXPORT int CRYPTO_refcount_dec_and_test_zero(CRYPTO_refcount_t *count); + + +// Locks. +// +// Two types of locks are defined: |CRYPTO_MUTEX|, which can be used in +// structures as normal, and |struct CRYPTO_STATIC_MUTEX|, which can be used as +// a global lock. A global lock must be initialised to the value +// |CRYPTO_STATIC_MUTEX_INIT|. +// +// |CRYPTO_MUTEX| can appear in public structures and so is defined in +// thread.h as a structure large enough to fit the real type. The global lock is +// a different type so it may be initialized with platform initializer macros. + +#if !defined(OPENSSL_THREADS) +struct CRYPTO_STATIC_MUTEX { + char padding; // Empty structs have different sizes in C and C++. +}; +#define CRYPTO_STATIC_MUTEX_INIT { 0 } +#elif defined(OPENSSL_WINDOWS_THREADS) +struct CRYPTO_STATIC_MUTEX { + SRWLOCK lock; +}; +#define CRYPTO_STATIC_MUTEX_INIT { SRWLOCK_INIT } +#elif defined(OPENSSL_PTHREADS) +struct CRYPTO_STATIC_MUTEX { + pthread_rwlock_t lock; +}; +#define CRYPTO_STATIC_MUTEX_INIT { PTHREAD_RWLOCK_INITIALIZER } +#else +#error "Unknown threading library" +#endif + +// CRYPTO_MUTEX_init initialises |lock|. If |lock| is a static variable, use a +// |CRYPTO_STATIC_MUTEX|. +OPENSSL_EXPORT void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_lock_read locks |lock| such that other threads may also have a +// read lock, but none may have a write lock. +OPENSSL_EXPORT void CRYPTO_MUTEX_lock_read(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_lock_write locks |lock| such that no other thread has any type +// of lock on it. +OPENSSL_EXPORT void CRYPTO_MUTEX_lock_write(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_unlock_read unlocks |lock| for reading. +OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_read(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_unlock_write unlocks |lock| for writing. +OPENSSL_EXPORT void CRYPTO_MUTEX_unlock_write(CRYPTO_MUTEX *lock); + +// CRYPTO_MUTEX_cleanup releases all resources held by |lock|. +OPENSSL_EXPORT void CRYPTO_MUTEX_cleanup(CRYPTO_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_lock_read locks |lock| such that other threads may also +// have a read lock, but none may have a write lock. The |lock| variable does +// not need to be initialised by any function, but must have been statically +// initialised with |CRYPTO_STATIC_MUTEX_INIT|. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_read( + struct CRYPTO_STATIC_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_lock_write locks |lock| such that no other thread has +// any type of lock on it. The |lock| variable does not need to be initialised +// by any function, but must have been statically initialised with +// |CRYPTO_STATIC_MUTEX_INIT|. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_lock_write( + struct CRYPTO_STATIC_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_unlock_read unlocks |lock| for reading. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_read( + struct CRYPTO_STATIC_MUTEX *lock); + +// CRYPTO_STATIC_MUTEX_unlock_write unlocks |lock| for writing. +OPENSSL_EXPORT void CRYPTO_STATIC_MUTEX_unlock_write( + struct CRYPTO_STATIC_MUTEX *lock); + +#if defined(__cplusplus) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +namespace internal { + +// MutexLockBase is a RAII helper for CRYPTO_MUTEX locking. +template +class MutexLockBase { + public: + explicit MutexLockBase(CRYPTO_MUTEX *mu) : mu_(mu) { + assert(mu_ != nullptr); + LockFunc(mu_); + } + ~MutexLockBase() { ReleaseFunc(mu_); } + MutexLockBase(const MutexLockBase &) = delete; + MutexLockBase &operator=(const MutexLockBase &) = + delete; + + private: + CRYPTO_MUTEX *const mu_; +}; + +} // namespace internal + +using MutexWriteLock = + internal::MutexLockBase; +using MutexReadLock = + internal::MutexLockBase; + +BSSL_NAMESPACE_END + +} // extern "C++" +#endif // defined(__cplusplus) + + +// Thread local storage. + +// thread_local_data_t enumerates the types of thread-local data that can be +// stored. +typedef enum { + OPENSSL_THREAD_LOCAL_ERR = 0, + OPENSSL_THREAD_LOCAL_RAND, + OPENSSL_THREAD_LOCAL_TEST, + NUM_OPENSSL_THREAD_LOCALS, +} thread_local_data_t; + +// thread_local_destructor_t is the type of a destructor function that will be +// called when a thread exits and its thread-local storage needs to be freed. +typedef void (*thread_local_destructor_t)(void *); + +// CRYPTO_get_thread_local gets the pointer value that is stored for the +// current thread for the given index, or NULL if none has been set. +OPENSSL_EXPORT void *CRYPTO_get_thread_local(thread_local_data_t value); + +// CRYPTO_set_thread_local sets a pointer value for the current thread at the +// given index. This function should only be called once per thread for a given +// |index|: rather than update the pointer value itself, update the data that +// is pointed to. +// +// The destructor function will be called when a thread exits to free this +// thread-local data. All calls to |CRYPTO_set_thread_local| with the same +// |index| should have the same |destructor| argument. The destructor may be +// called with a NULL argument if a thread that never set a thread-local +// pointer for |index|, exits. The destructor may be called concurrently with +// different arguments. +// +// This function returns one on success or zero on error. If it returns zero +// then |destructor| has been called with |value| already. +OPENSSL_EXPORT int CRYPTO_set_thread_local( + thread_local_data_t index, void *value, + thread_local_destructor_t destructor); + + +// ex_data + +typedef struct crypto_ex_data_func_st CRYPTO_EX_DATA_FUNCS; + +DECLARE_STACK_OF(CRYPTO_EX_DATA_FUNCS) + +// CRYPTO_EX_DATA_CLASS tracks the ex_indices registered for a type which +// supports ex_data. It should defined as a static global within the module +// which defines that type. +typedef struct { + struct CRYPTO_STATIC_MUTEX lock; + STACK_OF(CRYPTO_EX_DATA_FUNCS) *meth; + // num_reserved is one if the ex_data index zero is reserved for legacy + // |TYPE_get_app_data| functions. + uint8_t num_reserved; +} CRYPTO_EX_DATA_CLASS; + +#define CRYPTO_EX_DATA_CLASS_INIT {CRYPTO_STATIC_MUTEX_INIT, NULL, 0} +#define CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA \ + {CRYPTO_STATIC_MUTEX_INIT, NULL, 1} + +// CRYPTO_get_ex_new_index allocates a new index for |ex_data_class| and writes +// it to |*out_index|. Each class of object should provide a wrapper function +// that uses the correct |CRYPTO_EX_DATA_CLASS|. It returns one on success and +// zero otherwise. +OPENSSL_EXPORT int CRYPTO_get_ex_new_index(CRYPTO_EX_DATA_CLASS *ex_data_class, + int *out_index, long argl, + void *argp, + CRYPTO_EX_free *free_func); + +// CRYPTO_set_ex_data sets an extra data pointer on a given object. Each class +// of object should provide a wrapper function. +OPENSSL_EXPORT int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int index, void *val); + +// CRYPTO_get_ex_data returns an extra data pointer for a given object, or NULL +// if no such index exists. Each class of object should provide a wrapper +// function. +OPENSSL_EXPORT void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int index); + +// CRYPTO_new_ex_data initialises a newly allocated |CRYPTO_EX_DATA|. +OPENSSL_EXPORT void CRYPTO_new_ex_data(CRYPTO_EX_DATA *ad); + +// CRYPTO_free_ex_data frees |ad|, which is embedded inside |obj|, which is an +// object of the given class. +OPENSSL_EXPORT void CRYPTO_free_ex_data(CRYPTO_EX_DATA_CLASS *ex_data_class, + void *obj, CRYPTO_EX_DATA *ad); + + +// Endianness conversions. + +#if defined(__GNUC__) && __GNUC__ >= 2 +static inline uint16_t CRYPTO_bswap2(uint16_t x) { + return __builtin_bswap16(x); +} + +static inline uint32_t CRYPTO_bswap4(uint32_t x) { + return __builtin_bswap32(x); +} + +static inline uint64_t CRYPTO_bswap8(uint64_t x) { + return __builtin_bswap64(x); +} +#elif defined(_MSC_VER) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#pragma intrinsic(_byteswap_uint64, _byteswap_ulong, _byteswap_ushort) +static inline uint16_t CRYPTO_bswap2(uint16_t x) { + return _byteswap_ushort(x); +} + +static inline uint32_t CRYPTO_bswap4(uint32_t x) { + return _byteswap_ulong(x); +} + +static inline uint64_t CRYPTO_bswap8(uint64_t x) { + return _byteswap_uint64(x); +} +#else +static inline uint16_t CRYPTO_bswap2(uint16_t x) { + return (x >> 8) | (x << 8); +} + +static inline uint32_t CRYPTO_bswap4(uint32_t x) { + x = (x >> 16) | (x << 16); + x = ((x & 0xff00ff00) >> 8) | ((x & 0x00ff00ff) << 8); + return x; +} + +static inline uint64_t CRYPTO_bswap8(uint64_t x) { + return CRYPTO_bswap4(x >> 32) | (((uint64_t)CRYPTO_bswap4(x)) << 32); +} +#endif + + +// Language bug workarounds. +// +// Most C standard library functions are undefined if passed NULL, even when the +// corresponding length is zero. This gives them (and, in turn, all functions +// which call them) surprising behavior on empty arrays. Some compilers will +// miscompile code due to this rule. See also +// https://www.imperialviolet.org/2016/06/26/nonnull.html +// +// These wrapper functions behave the same as the corresponding C standard +// functions, but behave as expected when passed NULL if the length is zero. +// +// Note |OPENSSL_memcmp| is a different function from |CRYPTO_memcmp|. + +// C++ defines |memchr| as a const-correct overload. +#if defined(__cplusplus) +extern "C++" { + +static inline const void *OPENSSL_memchr(const void *s, int c, size_t n) { + if (n == 0) { + return NULL; + } + + return memchr(s, c, n); +} + +static inline void *OPENSSL_memchr(void *s, int c, size_t n) { + if (n == 0) { + return NULL; + } + + return memchr(s, c, n); +} + +} // extern "C++" +#else // __cplusplus + +static inline void *OPENSSL_memchr(const void *s, int c, size_t n) { + if (n == 0) { + return NULL; + } + + return memchr(s, c, n); +} + +#endif // __cplusplus + +static inline int OPENSSL_memcmp(const void *s1, const void *s2, size_t n) { + if (n == 0) { + return 0; + } + + return memcmp(s1, s2, n); +} + +static inline void *OPENSSL_memcpy(void *dst, const void *src, size_t n) { + if (n == 0) { + return dst; + } + + return memcpy(dst, src, n); +} + +static inline void *OPENSSL_memmove(void *dst, const void *src, size_t n) { + if (n == 0) { + return dst; + } + + return memmove(dst, src, n); +} + +static inline void *OPENSSL_memset(void *dst, int c, size_t n) { + if (n == 0) { + return dst; + } + + return memset(dst, c, n); +} + +#if defined(BORINGSSL_FIPS) +// BORINGSSL_FIPS_abort is called when a FIPS power-on or continuous test +// fails. It prevents any further cryptographic operations by the current +// process. +void BORINGSSL_FIPS_abort(void) __attribute__((noreturn)); +#endif + +// boringssl_fips_self_test runs the FIPS KAT-based self tests. It returns one +// on success and zero on error. The argument is the integrity hash of the FIPS +// module and may be used to check and write flag files to suppress duplicate +// self-tests. If |module_hash_len| is zero then no flag file will be checked +// nor written and tests will always be run. +int boringssl_fips_self_test(const uint8_t *module_hash, + size_t module_hash_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/lhash/lhash.c b/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c similarity index 80% rename from Pods/BoringSSL-GRPC/crypto/lhash/lhash.c rename to Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c index 27e04813a..dc4cfbca7 100644 --- a/Pods/BoringSSL-GRPC/crypto/lhash/lhash.c +++ b/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c @@ -139,17 +139,17 @@ size_t lh_num_items(const _LHASH *lh) { return lh->num_items; } // not found, it returns a pointer that points to a NULL pointer. If |out_hash| // is not NULL, then it also puts the hash value of |data| in |*out_hash|. static LHASH_ITEM **get_next_ptr_and_hash(const _LHASH *lh, uint32_t *out_hash, - const void *data) { - const uint32_t hash = lh->hash(data); - LHASH_ITEM *cur, **ret; - + const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { + const uint32_t hash = call_hash_func(lh->hash, data); if (out_hash != NULL) { *out_hash = hash; } - ret = &lh->buckets[hash % lh->num_buckets]; - for (cur = *ret; cur != NULL; cur = *ret) { - if (lh->comp(cur->data, data) == 0) { + LHASH_ITEM **ret = &lh->buckets[hash % lh->num_buckets]; + for (LHASH_ITEM *cur = *ret; cur != NULL; cur = *ret) { + if (call_cmp_func(lh->comp, cur->data, data) == 0) { break; } ret = &cur->next; @@ -158,16 +158,35 @@ static LHASH_ITEM **get_next_ptr_and_hash(const _LHASH *lh, uint32_t *out_hash, return ret; } -void *lh_retrieve(const _LHASH *lh, const void *data) { - LHASH_ITEM **next_ptr; +// get_next_ptr_by_key behaves like |get_next_ptr_and_hash| but takes a key +// which may be a different type from the values stored in |lh|. +static LHASH_ITEM **get_next_ptr_by_key(const _LHASH *lh, const void *key, + uint32_t key_hash, + int (*cmp_key)(const void *key, + const void *value)) { + LHASH_ITEM **ret = &lh->buckets[key_hash % lh->num_buckets]; + for (LHASH_ITEM *cur = *ret; cur != NULL; cur = *ret) { + if (cmp_key(key, cur->data) == 0) { + break; + } + ret = &cur->next; + } - next_ptr = get_next_ptr_and_hash(lh, NULL, data); + return ret; +} - if (*next_ptr == NULL) { - return NULL; - } +void *lh_retrieve(const _LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { + LHASH_ITEM **next_ptr = + get_next_ptr_and_hash(lh, NULL, data, call_hash_func, call_cmp_func); + return *next_ptr == NULL ? NULL : (*next_ptr)->data; +} - return (*next_ptr)->data; +void *lh_retrieve_key(const _LHASH *lh, const void *key, uint32_t key_hash, + int (*cmp_key)(const void *key, const void *value)) { + LHASH_ITEM **next_ptr = get_next_ptr_by_key(lh, key, key_hash, cmp_key); + return *next_ptr == NULL ? NULL : (*next_ptr)->data; } // lh_rebucket allocates a new array of |new_num_buckets| pointers and @@ -233,12 +252,15 @@ static void lh_maybe_resize(_LHASH *lh) { } } -int lh_insert(_LHASH *lh, void **old_data, void *data) { +int lh_insert(_LHASH *lh, void **old_data, void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { uint32_t hash; LHASH_ITEM **next_ptr, *item; *old_data = NULL; - next_ptr = get_next_ptr_and_hash(lh, &hash, data); + next_ptr = + get_next_ptr_and_hash(lh, &hash, data, call_hash_func, call_cmp_func); if (*next_ptr != NULL) { @@ -265,10 +287,13 @@ int lh_insert(_LHASH *lh, void **old_data, void *data) { return 1; } -void *lh_delete(_LHASH *lh, const void *data) { +void *lh_delete(_LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { LHASH_ITEM **next_ptr, *item, *ret; - next_ptr = get_next_ptr_and_hash(lh, NULL, data); + next_ptr = + get_next_ptr_and_hash(lh, NULL, data, call_hash_func, call_cmp_func); if (*next_ptr == NULL) { // No such element. @@ -286,8 +311,7 @@ void *lh_delete(_LHASH *lh, const void *data) { return ret; } -static void lh_doall_internal(_LHASH *lh, void (*no_arg_func)(void *), - void (*arg_func)(void *, void *), void *arg) { +void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), void *arg) { if (lh == NULL) { return; } @@ -301,11 +325,7 @@ static void lh_doall_internal(_LHASH *lh, void (*no_arg_func)(void *), LHASH_ITEM *next; for (LHASH_ITEM *cur = lh->buckets[i]; cur != NULL; cur = next) { next = cur->next; - if (arg_func) { - arg_func(cur->data, arg); - } else { - no_arg_func(cur->data); - } + func(cur->data, arg); } } @@ -319,14 +339,6 @@ static void lh_doall_internal(_LHASH *lh, void (*no_arg_func)(void *), lh_maybe_resize(lh); } -void lh_doall(_LHASH *lh, void (*func)(void *)) { - lh_doall_internal(lh, func, NULL, NULL); -} - -void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), void *arg) { - lh_doall_internal(lh, NULL, func, arg); -} - uint32_t lh_strhash(const char *c) { if (c == NULL) { return 0; diff --git a/Pods/BoringSSL-GRPC/crypto/lhash/lhash.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c.grpc_back similarity index 80% rename from Pods/BoringSSL-GRPC/crypto/lhash/lhash.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c.grpc_back index 7bfd2897f..98ee60a5c 100644 --- a/Pods/BoringSSL-GRPC/crypto/lhash/lhash.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/lhash/lhash.c.grpc_back @@ -139,17 +139,17 @@ size_t lh_num_items(const _LHASH *lh) { return lh->num_items; } // not found, it returns a pointer that points to a NULL pointer. If |out_hash| // is not NULL, then it also puts the hash value of |data| in |*out_hash|. static LHASH_ITEM **get_next_ptr_and_hash(const _LHASH *lh, uint32_t *out_hash, - const void *data) { - const uint32_t hash = lh->hash(data); - LHASH_ITEM *cur, **ret; - + const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { + const uint32_t hash = call_hash_func(lh->hash, data); if (out_hash != NULL) { *out_hash = hash; } - ret = &lh->buckets[hash % lh->num_buckets]; - for (cur = *ret; cur != NULL; cur = *ret) { - if (lh->comp(cur->data, data) == 0) { + LHASH_ITEM **ret = &lh->buckets[hash % lh->num_buckets]; + for (LHASH_ITEM *cur = *ret; cur != NULL; cur = *ret) { + if (call_cmp_func(lh->comp, cur->data, data) == 0) { break; } ret = &cur->next; @@ -158,16 +158,35 @@ static LHASH_ITEM **get_next_ptr_and_hash(const _LHASH *lh, uint32_t *out_hash, return ret; } -void *lh_retrieve(const _LHASH *lh, const void *data) { - LHASH_ITEM **next_ptr; +// get_next_ptr_by_key behaves like |get_next_ptr_and_hash| but takes a key +// which may be a different type from the values stored in |lh|. +static LHASH_ITEM **get_next_ptr_by_key(const _LHASH *lh, const void *key, + uint32_t key_hash, + int (*cmp_key)(const void *key, + const void *value)) { + LHASH_ITEM **ret = &lh->buckets[key_hash % lh->num_buckets]; + for (LHASH_ITEM *cur = *ret; cur != NULL; cur = *ret) { + if (cmp_key(key, cur->data) == 0) { + break; + } + ret = &cur->next; + } - next_ptr = get_next_ptr_and_hash(lh, NULL, data); + return ret; +} - if (*next_ptr == NULL) { - return NULL; - } +void *lh_retrieve(const _LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { + LHASH_ITEM **next_ptr = + get_next_ptr_and_hash(lh, NULL, data, call_hash_func, call_cmp_func); + return *next_ptr == NULL ? NULL : (*next_ptr)->data; +} - return (*next_ptr)->data; +void *lh_retrieve_key(const _LHASH *lh, const void *key, uint32_t key_hash, + int (*cmp_key)(const void *key, const void *value)) { + LHASH_ITEM **next_ptr = get_next_ptr_by_key(lh, key, key_hash, cmp_key); + return *next_ptr == NULL ? NULL : (*next_ptr)->data; } // lh_rebucket allocates a new array of |new_num_buckets| pointers and @@ -233,12 +252,15 @@ static void lh_maybe_resize(_LHASH *lh) { } } -int lh_insert(_LHASH *lh, void **old_data, void *data) { +int lh_insert(_LHASH *lh, void **old_data, void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { uint32_t hash; LHASH_ITEM **next_ptr, *item; *old_data = NULL; - next_ptr = get_next_ptr_and_hash(lh, &hash, data); + next_ptr = + get_next_ptr_and_hash(lh, &hash, data, call_hash_func, call_cmp_func); if (*next_ptr != NULL) { @@ -265,10 +287,13 @@ int lh_insert(_LHASH *lh, void **old_data, void *data) { return 1; } -void *lh_delete(_LHASH *lh, const void *data) { +void *lh_delete(_LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func) { LHASH_ITEM **next_ptr, *item, *ret; - next_ptr = get_next_ptr_and_hash(lh, NULL, data); + next_ptr = + get_next_ptr_and_hash(lh, NULL, data, call_hash_func, call_cmp_func); if (*next_ptr == NULL) { // No such element. @@ -286,8 +311,7 @@ void *lh_delete(_LHASH *lh, const void *data) { return ret; } -static void lh_doall_internal(_LHASH *lh, void (*no_arg_func)(void *), - void (*arg_func)(void *, void *), void *arg) { +void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), void *arg) { if (lh == NULL) { return; } @@ -301,11 +325,7 @@ static void lh_doall_internal(_LHASH *lh, void (*no_arg_func)(void *), LHASH_ITEM *next; for (LHASH_ITEM *cur = lh->buckets[i]; cur != NULL; cur = next) { next = cur->next; - if (arg_func) { - arg_func(cur->data, arg); - } else { - no_arg_func(cur->data); - } + func(cur->data, arg); } } @@ -319,14 +339,6 @@ static void lh_doall_internal(_LHASH *lh, void (*no_arg_func)(void *), lh_maybe_resize(lh); } -void lh_doall(_LHASH *lh, void (*func)(void *)) { - lh_doall_internal(lh, func, NULL, NULL); -} - -void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), void *arg) { - lh_doall_internal(lh, NULL, func, arg); -} - uint32_t lh_strhash(const char *c) { if (c == NULL) { return 0; diff --git a/Pods/BoringSSL-GRPC/src/crypto/mem.c b/Pods/BoringSSL-GRPC/src/crypto/mem.c new file mode 100644 index 000000000..da8eccb54 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/mem.c @@ -0,0 +1,342 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include +#include + +#include + +#if defined(OPENSSL_WINDOWS) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include "internal.h" + + +#define OPENSSL_MALLOC_PREFIX 8 + +#if defined(OPENSSL_ASAN) +void __asan_poison_memory_region(const volatile void *addr, size_t size); +void __asan_unpoison_memory_region(const volatile void *addr, size_t size); +#else +static void __asan_poison_memory_region(const void *addr, size_t size) {} +static void __asan_unpoison_memory_region(const void *addr, size_t size) {} +#endif + +// Windows doesn't really support weak symbols as of May 2019, and Clang on +// Windows will emit strong symbols instead. See +// https://bugs.llvm.org/show_bug.cgi?id=37598 +#if defined(__GNUC__) || (defined(__clang__) && !defined(_MSC_VER)) +// sdallocx is a sized |free| function. By passing the size (which we happen to +// always know in BoringSSL), the malloc implementation can save work. We cannot +// depend on |sdallocx| being available so we declare a wrapper that falls back +// to |free| as a weak symbol. +// +// This will always be safe, but will only be overridden if the malloc +// implementation is statically linked with BoringSSL. So, if |sdallocx| is +// provided in, say, libc.so, we still won't use it because that's dynamically +// linked. This isn't an ideal result, but its helps in some cases. +void sdallocx(void *ptr, size_t size, int flags); + +__attribute((weak, noinline)) +#else +static +#endif +void sdallocx(void *ptr, size_t size, int flags) { + free(ptr); +} + +void *OPENSSL_malloc(size_t size) { + void *ptr = malloc(size + OPENSSL_MALLOC_PREFIX); + if (ptr == NULL) { + return NULL; + } + + *(size_t *)ptr = size; + + __asan_poison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + return ((uint8_t *)ptr) + OPENSSL_MALLOC_PREFIX; +} + +void OPENSSL_free(void *orig_ptr) { + if (orig_ptr == NULL) { + return; + } + + void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; + __asan_unpoison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + + size_t size = *(size_t *)ptr; + OPENSSL_cleanse(ptr, size + OPENSSL_MALLOC_PREFIX); + sdallocx(ptr, size + OPENSSL_MALLOC_PREFIX, 0 /* flags */); +} + +void *OPENSSL_realloc(void *orig_ptr, size_t new_size) { + if (orig_ptr == NULL) { + return OPENSSL_malloc(new_size); + } + + void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; + __asan_unpoison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + size_t old_size = *(size_t *)ptr; + __asan_poison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + + void *ret = OPENSSL_malloc(new_size); + if (ret == NULL) { + return NULL; + } + + size_t to_copy = new_size; + if (old_size < to_copy) { + to_copy = old_size; + } + + memcpy(ret, orig_ptr, to_copy); + OPENSSL_free(orig_ptr); + + return ret; +} + +void OPENSSL_cleanse(void *ptr, size_t len) { +#if defined(OPENSSL_WINDOWS) + SecureZeroMemory(ptr, len); +#else + OPENSSL_memset(ptr, 0, len); + +#if !defined(OPENSSL_NO_ASM) + /* As best as we can tell, this is sufficient to break any optimisations that + might try to eliminate "superfluous" memsets. If there's an easy way to + detect memset_s, it would be better to use that. */ + __asm__ __volatile__("" : : "r"(ptr) : "memory"); +#endif +#endif // !OPENSSL_NO_ASM +} + +void OPENSSL_clear_free(void *ptr, size_t unused) { + OPENSSL_free(ptr); +} + +int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) { + const uint8_t *a = in_a; + const uint8_t *b = in_b; + uint8_t x = 0; + + for (size_t i = 0; i < len; i++) { + x |= a[i] ^ b[i]; + } + + return x; +} + +uint32_t OPENSSL_hash32(const void *ptr, size_t len) { + // These are the FNV-1a parameters for 32 bits. + static const uint32_t kPrime = 16777619u; + static const uint32_t kOffsetBasis = 2166136261u; + + const uint8_t *in = ptr; + uint32_t h = kOffsetBasis; + + for (size_t i = 0; i < len; i++) { + h ^= in[i]; + h *= kPrime; + } + + return h; +} + +size_t OPENSSL_strnlen(const char *s, size_t len) { + for (size_t i = 0; i < len; i++) { + if (s[i] == 0) { + return i; + } + } + + return len; +} + +char *OPENSSL_strdup(const char *s) { + if (s == NULL) { + return NULL; + } + const size_t len = strlen(s) + 1; + char *ret = OPENSSL_malloc(len); + if (ret == NULL) { + return NULL; + } + OPENSSL_memcpy(ret, s, len); + return ret; +} + +int OPENSSL_tolower(int c) { + if (c >= 'A' && c <= 'Z') { + return c + ('a' - 'A'); + } + return c; +} + +int OPENSSL_strcasecmp(const char *a, const char *b) { + for (size_t i = 0;; i++) { + const int aa = OPENSSL_tolower(a[i]); + const int bb = OPENSSL_tolower(b[i]); + + if (aa < bb) { + return -1; + } else if (aa > bb) { + return 1; + } else if (aa == 0) { + return 0; + } + } +} + +int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) { + for (size_t i = 0; i < n; i++) { + const int aa = OPENSSL_tolower(a[i]); + const int bb = OPENSSL_tolower(b[i]); + + if (aa < bb) { + return -1; + } else if (aa > bb) { + return 1; + } else if (aa == 0) { + return 0; + } + } + + return 0; +} + +int BIO_snprintf(char *buf, size_t n, const char *format, ...) { + va_list args; + va_start(args, format); + int ret = BIO_vsnprintf(buf, n, format, args); + va_end(args); + return ret; +} + +int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) { + return vsnprintf(buf, n, format, args); +} + +char *OPENSSL_strndup(const char *str, size_t size) { + char *ret; + size_t alloc_size; + + if (str == NULL) { + return NULL; + } + + size = OPENSSL_strnlen(str, size); + + alloc_size = size + 1; + if (alloc_size < size) { + // overflow + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return NULL; + } + ret = OPENSSL_malloc(alloc_size); + if (ret == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memcpy(ret, str, size); + ret[size] = '\0'; + return ret; +} + +size_t OPENSSL_strlcpy(char *dst, const char *src, size_t dst_size) { + size_t l = 0; + + for (; dst_size > 1 && *src; dst_size--) { + *dst++ = *src++; + l++; + } + + if (dst_size) { + *dst = 0; + } + + return l + strlen(src); +} + +size_t OPENSSL_strlcat(char *dst, const char *src, size_t dst_size) { + size_t l = 0; + for (; dst_size > 0 && *dst; dst_size--, dst++) { + l++; + } + return l + OPENSSL_strlcpy(dst, src, dst_size); +} + +void *OPENSSL_memdup(const void *data, size_t size) { + if (size == 0) { + return NULL; + } + + void *ret = OPENSSL_malloc(size); + if (ret == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memcpy(ret, data, size); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/mem.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/mem.c.grpc_back new file mode 100644 index 000000000..7fc5f98e5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/mem.c.grpc_back @@ -0,0 +1,342 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include +#include + +#include + +#if defined(OPENSSL_WINDOWS) +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#endif + +#include "internal.h" + + +#define OPENSSL_MALLOC_PREFIX 8 + +#if defined(OPENSSL_ASAN) +void __asan_poison_memory_region(const volatile void *addr, size_t size); +void __asan_unpoison_memory_region(const volatile void *addr, size_t size); +#else +static void __asan_poison_memory_region(const void *addr, size_t size) {} +static void __asan_unpoison_memory_region(const void *addr, size_t size) {} +#endif + +// Windows doesn't really support weak symbols as of May 2019, and Clang on +// Windows will emit strong symbols instead. See +// https://bugs.llvm.org/show_bug.cgi?id=37598 +#if defined(__GNUC__) || (defined(__clang__) && !defined(_MSC_VER)) +// sdallocx is a sized |free| function. By passing the size (which we happen to +// always know in BoringSSL), the malloc implementation can save work. We cannot +// depend on |sdallocx| being available so we declare a wrapper that falls back +// to |free| as a weak symbol. +// +// This will always be safe, but will only be overridden if the malloc +// implementation is statically linked with BoringSSL. So, if |sdallocx| is +// provided in, say, libc.so, we still won't use it because that's dynamically +// linked. This isn't an ideal result, but its helps in some cases. +void sdallocx(void *ptr, size_t size, int flags); + +__attribute((weak, noinline)) +#else +static +#endif +void sdallocx(void *ptr, size_t size, int flags) { + free(ptr); +} + +void *OPENSSL_malloc(size_t size) { + void *ptr = malloc(size + OPENSSL_MALLOC_PREFIX); + if (ptr == NULL) { + return NULL; + } + + *(size_t *)ptr = size; + + __asan_poison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + return ((uint8_t *)ptr) + OPENSSL_MALLOC_PREFIX; +} + +void OPENSSL_free(void *orig_ptr) { + if (orig_ptr == NULL) { + return; + } + + void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; + __asan_unpoison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + + size_t size = *(size_t *)ptr; + OPENSSL_cleanse(ptr, size + OPENSSL_MALLOC_PREFIX); + sdallocx(ptr, size + OPENSSL_MALLOC_PREFIX, 0 /* flags */); +} + +void *OPENSSL_realloc(void *orig_ptr, size_t new_size) { + if (orig_ptr == NULL) { + return OPENSSL_malloc(new_size); + } + + void *ptr = ((uint8_t *)orig_ptr) - OPENSSL_MALLOC_PREFIX; + __asan_unpoison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + size_t old_size = *(size_t *)ptr; + __asan_poison_memory_region(ptr, OPENSSL_MALLOC_PREFIX); + + void *ret = OPENSSL_malloc(new_size); + if (ret == NULL) { + return NULL; + } + + size_t to_copy = new_size; + if (old_size < to_copy) { + to_copy = old_size; + } + + memcpy(ret, orig_ptr, to_copy); + OPENSSL_free(orig_ptr); + + return ret; +} + +void OPENSSL_cleanse(void *ptr, size_t len) { +#if defined(OPENSSL_WINDOWS) + SecureZeroMemory(ptr, len); +#else + OPENSSL_memset(ptr, 0, len); + +#if !defined(OPENSSL_NO_ASM) + /* As best as we can tell, this is sufficient to break any optimisations that + might try to eliminate "superfluous" memsets. If there's an easy way to + detect memset_s, it would be better to use that. */ + __asm__ __volatile__("" : : "r"(ptr) : "memory"); +#endif +#endif // !OPENSSL_NO_ASM +} + +void OPENSSL_clear_free(void *ptr, size_t unused) { + OPENSSL_free(ptr); +} + +int CRYPTO_memcmp(const void *in_a, const void *in_b, size_t len) { + const uint8_t *a = in_a; + const uint8_t *b = in_b; + uint8_t x = 0; + + for (size_t i = 0; i < len; i++) { + x |= a[i] ^ b[i]; + } + + return x; +} + +uint32_t OPENSSL_hash32(const void *ptr, size_t len) { + // These are the FNV-1a parameters for 32 bits. + static const uint32_t kPrime = 16777619u; + static const uint32_t kOffsetBasis = 2166136261u; + + const uint8_t *in = ptr; + uint32_t h = kOffsetBasis; + + for (size_t i = 0; i < len; i++) { + h ^= in[i]; + h *= kPrime; + } + + return h; +} + +size_t OPENSSL_strnlen(const char *s, size_t len) { + for (size_t i = 0; i < len; i++) { + if (s[i] == 0) { + return i; + } + } + + return len; +} + +char *OPENSSL_strdup(const char *s) { + if (s == NULL) { + return NULL; + } + const size_t len = strlen(s) + 1; + char *ret = OPENSSL_malloc(len); + if (ret == NULL) { + return NULL; + } + OPENSSL_memcpy(ret, s, len); + return ret; +} + +int OPENSSL_tolower(int c) { + if (c >= 'A' && c <= 'Z') { + return c + ('a' - 'A'); + } + return c; +} + +int OPENSSL_strcasecmp(const char *a, const char *b) { + for (size_t i = 0;; i++) { + const int aa = OPENSSL_tolower(a[i]); + const int bb = OPENSSL_tolower(b[i]); + + if (aa < bb) { + return -1; + } else if (aa > bb) { + return 1; + } else if (aa == 0) { + return 0; + } + } +} + +int OPENSSL_strncasecmp(const char *a, const char *b, size_t n) { + for (size_t i = 0; i < n; i++) { + const int aa = OPENSSL_tolower(a[i]); + const int bb = OPENSSL_tolower(b[i]); + + if (aa < bb) { + return -1; + } else if (aa > bb) { + return 1; + } else if (aa == 0) { + return 0; + } + } + + return 0; +} + +int BIO_snprintf(char *buf, size_t n, const char *format, ...) { + va_list args; + va_start(args, format); + int ret = BIO_vsnprintf(buf, n, format, args); + va_end(args); + return ret; +} + +int BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args) { + return vsnprintf(buf, n, format, args); +} + +char *OPENSSL_strndup(const char *str, size_t size) { + char *ret; + size_t alloc_size; + + if (str == NULL) { + return NULL; + } + + size = OPENSSL_strnlen(str, size); + + alloc_size = size + 1; + if (alloc_size < size) { + // overflow + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return NULL; + } + ret = OPENSSL_malloc(alloc_size); + if (ret == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memcpy(ret, str, size); + ret[size] = '\0'; + return ret; +} + +size_t OPENSSL_strlcpy(char *dst, const char *src, size_t dst_size) { + size_t l = 0; + + for (; dst_size > 1 && *src; dst_size--) { + *dst++ = *src++; + l++; + } + + if (dst_size) { + *dst = 0; + } + + return l + strlen(src); +} + +size_t OPENSSL_strlcat(char *dst, const char *src, size_t dst_size) { + size_t l = 0; + for (; dst_size > 0 && *dst; dst_size--, dst++) { + l++; + } + return l + OPENSSL_strlcpy(dst, src, dst_size); +} + +void *OPENSSL_memdup(const void *data, size_t size) { + if (size == 0) { + return NULL; + } + + void *ret = OPENSSL_malloc(size); + if (ret == NULL) { + OPENSSL_PUT_ERROR(CRYPTO, ERR_R_MALLOC_FAILURE); + return NULL; + } + + OPENSSL_memcpy(ret, data, size); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/obj/obj.c b/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/obj/obj.c rename to Pods/BoringSSL-GRPC/src/crypto/obj/obj.c index b19d5864f..ccb84259a 100644 --- a/Pods/BoringSSL-GRPC/crypto/obj/obj.c +++ b/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c @@ -54,10 +54,6 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - #include #include @@ -65,7 +61,6 @@ #include #include -#include #include #include #include @@ -76,6 +71,8 @@ #include "../internal.h" +DEFINE_LHASH_OF(ASN1_OBJECT) + static struct CRYPTO_STATIC_MUTEX global_added_lock = CRYPTO_STATIC_MUTEX_INIT; // These globals are protected by |global_added_lock|. static LHASH_OF(ASN1_OBJECT) *global_added_by_data = NULL; @@ -192,7 +189,7 @@ size_t OBJ_length(const ASN1_OBJECT *obj) { // an |ASN1_OBJECT|* that we're looking for and |element| is a pointer to an // unsigned int in the array. static int obj_cmp(const void *key, const void *element) { - unsigned nid = *((const unsigned*) element); + uint16_t nid = *((const uint16_t *)element); const ASN1_OBJECT *a = key; const ASN1_OBJECT *b = &kObjects[nid]; @@ -205,8 +202,6 @@ static int obj_cmp(const void *key, const void *element) { } int OBJ_obj2nid(const ASN1_OBJECT *obj) { - const unsigned int *nid_ptr; - if (obj == NULL) { return NID_undef; } @@ -227,8 +222,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *obj) { } CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); - nid_ptr = bsearch(obj, kNIDsInOIDOrder, OPENSSL_ARRAY_SIZE(kNIDsInOIDOrder), - sizeof(kNIDsInOIDOrder[0]), obj_cmp); + const uint16_t *nid_ptr = + bsearch(obj, kNIDsInOIDOrder, OPENSSL_ARRAY_SIZE(kNIDsInOIDOrder), + sizeof(kNIDsInOIDOrder[0]), obj_cmp); if (nid_ptr == NULL) { return NID_undef; } @@ -253,15 +249,13 @@ int OBJ_cbs2nid(const CBS *cbs) { // |key| argument is name that we're looking for and |element| is a pointer to // an unsigned int in the array. static int short_name_cmp(const void *key, const void *element) { - const char *name = (const char *) key; - unsigned nid = *((unsigned*) element); + const char *name = (const char *)key; + uint16_t nid = *((const uint16_t *)element); return strcmp(name, kObjects[nid].sn); } int OBJ_sn2nid(const char *short_name) { - const unsigned int *nid_ptr; - CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); if (global_added_by_short_name != NULL) { ASN1_OBJECT *match, template; @@ -275,9 +269,10 @@ int OBJ_sn2nid(const char *short_name) { } CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); - nid_ptr = bsearch(short_name, kNIDsInShortNameOrder, - OPENSSL_ARRAY_SIZE(kNIDsInShortNameOrder), - sizeof(kNIDsInShortNameOrder[0]), short_name_cmp); + const uint16_t *nid_ptr = + bsearch(short_name, kNIDsInShortNameOrder, + OPENSSL_ARRAY_SIZE(kNIDsInShortNameOrder), + sizeof(kNIDsInShortNameOrder[0]), short_name_cmp); if (nid_ptr == NULL) { return NID_undef; } @@ -289,15 +284,13 @@ int OBJ_sn2nid(const char *short_name) { // |key| argument is name that we're looking for and |element| is a pointer to // an unsigned int in the array. static int long_name_cmp(const void *key, const void *element) { - const char *name = (const char *) key; - unsigned nid = *((unsigned*) element); + const char *name = (const char *)key; + uint16_t nid = *((const uint16_t *)element); return strcmp(name, kObjects[nid].ln); } int OBJ_ln2nid(const char *long_name) { - const unsigned int *nid_ptr; - CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); if (global_added_by_long_name != NULL) { ASN1_OBJECT *match, template; @@ -311,9 +304,9 @@ int OBJ_ln2nid(const char *long_name) { } CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); - nid_ptr = bsearch(long_name, kNIDsInLongNameOrder, - OPENSSL_ARRAY_SIZE(kNIDsInLongNameOrder), - sizeof(kNIDsInLongNameOrder[0]), long_name_cmp); + const uint16_t *nid_ptr = bsearch( + long_name, kNIDsInLongNameOrder, OPENSSL_ARRAY_SIZE(kNIDsInLongNameOrder), + sizeof(kNIDsInLongNameOrder[0]), long_name_cmp); if (nid_ptr == NULL) { return NID_undef; } @@ -426,7 +419,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names) { } static int strlcpy_int(char *dst, const char *src, int dst_size) { - size_t ret = BUF_strlcpy(dst, src, dst_size < 0 ? 0 : (size_t)dst_size); + size_t ret = OPENSSL_strlcpy(dst, src, dst_size < 0 ? 0 : (size_t)dst_size); if (ret > INT_MAX) { OPENSSL_PUT_ERROR(OBJ, ERR_R_OVERFLOW); return -1; @@ -552,3 +545,5 @@ int OBJ_create(const char *oid, const char *short_name, const char *long_name) { } return op->nid; } + +void OBJ_cleanup(void) {} diff --git a/Pods/BoringSSL-GRPC/crypto/obj/obj.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/obj/obj.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/obj/obj.c.grpc_back index a34d6dc03..3bf1abf32 100644 --- a/Pods/BoringSSL-GRPC/crypto/obj/obj.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/obj/obj.c.grpc_back @@ -54,10 +54,6 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#if !defined(__STDC_FORMAT_MACROS) -#define __STDC_FORMAT_MACROS -#endif - #include #include @@ -65,7 +61,6 @@ #include #include -#include #include #include #include @@ -76,6 +71,8 @@ #include "../internal.h" +DEFINE_LHASH_OF(ASN1_OBJECT) + static struct CRYPTO_STATIC_MUTEX global_added_lock = CRYPTO_STATIC_MUTEX_INIT; // These globals are protected by |global_added_lock|. static LHASH_OF(ASN1_OBJECT) *global_added_by_data = NULL; @@ -192,7 +189,7 @@ size_t OBJ_length(const ASN1_OBJECT *obj) { // an |ASN1_OBJECT|* that we're looking for and |element| is a pointer to an // unsigned int in the array. static int obj_cmp(const void *key, const void *element) { - unsigned nid = *((const unsigned*) element); + uint16_t nid = *((const uint16_t *)element); const ASN1_OBJECT *a = key; const ASN1_OBJECT *b = &kObjects[nid]; @@ -205,8 +202,6 @@ static int obj_cmp(const void *key, const void *element) { } int OBJ_obj2nid(const ASN1_OBJECT *obj) { - const unsigned int *nid_ptr; - if (obj == NULL) { return NID_undef; } @@ -227,8 +222,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *obj) { } CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); - nid_ptr = bsearch(obj, kNIDsInOIDOrder, OPENSSL_ARRAY_SIZE(kNIDsInOIDOrder), - sizeof(kNIDsInOIDOrder[0]), obj_cmp); + const uint16_t *nid_ptr = + bsearch(obj, kNIDsInOIDOrder, OPENSSL_ARRAY_SIZE(kNIDsInOIDOrder), + sizeof(kNIDsInOIDOrder[0]), obj_cmp); if (nid_ptr == NULL) { return NID_undef; } @@ -253,15 +249,13 @@ int OBJ_cbs2nid(const CBS *cbs) { // |key| argument is name that we're looking for and |element| is a pointer to // an unsigned int in the array. static int short_name_cmp(const void *key, const void *element) { - const char *name = (const char *) key; - unsigned nid = *((unsigned*) element); + const char *name = (const char *)key; + uint16_t nid = *((const uint16_t *)element); return strcmp(name, kObjects[nid].sn); } int OBJ_sn2nid(const char *short_name) { - const unsigned int *nid_ptr; - CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); if (global_added_by_short_name != NULL) { ASN1_OBJECT *match, template; @@ -275,9 +269,10 @@ int OBJ_sn2nid(const char *short_name) { } CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); - nid_ptr = bsearch(short_name, kNIDsInShortNameOrder, - OPENSSL_ARRAY_SIZE(kNIDsInShortNameOrder), - sizeof(kNIDsInShortNameOrder[0]), short_name_cmp); + const uint16_t *nid_ptr = + bsearch(short_name, kNIDsInShortNameOrder, + OPENSSL_ARRAY_SIZE(kNIDsInShortNameOrder), + sizeof(kNIDsInShortNameOrder[0]), short_name_cmp); if (nid_ptr == NULL) { return NID_undef; } @@ -289,15 +284,13 @@ int OBJ_sn2nid(const char *short_name) { // |key| argument is name that we're looking for and |element| is a pointer to // an unsigned int in the array. static int long_name_cmp(const void *key, const void *element) { - const char *name = (const char *) key; - unsigned nid = *((unsigned*) element); + const char *name = (const char *)key; + uint16_t nid = *((const uint16_t *)element); return strcmp(name, kObjects[nid].ln); } int OBJ_ln2nid(const char *long_name) { - const unsigned int *nid_ptr; - CRYPTO_STATIC_MUTEX_lock_read(&global_added_lock); if (global_added_by_long_name != NULL) { ASN1_OBJECT *match, template; @@ -311,9 +304,9 @@ int OBJ_ln2nid(const char *long_name) { } CRYPTO_STATIC_MUTEX_unlock_read(&global_added_lock); - nid_ptr = bsearch(long_name, kNIDsInLongNameOrder, - OPENSSL_ARRAY_SIZE(kNIDsInLongNameOrder), - sizeof(kNIDsInLongNameOrder[0]), long_name_cmp); + const uint16_t *nid_ptr = bsearch( + long_name, kNIDsInLongNameOrder, OPENSSL_ARRAY_SIZE(kNIDsInLongNameOrder), + sizeof(kNIDsInLongNameOrder[0]), long_name_cmp); if (nid_ptr == NULL) { return NID_undef; } @@ -426,7 +419,7 @@ ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names) { } static int strlcpy_int(char *dst, const char *src, int dst_size) { - size_t ret = BUF_strlcpy(dst, src, dst_size < 0 ? 0 : (size_t)dst_size); + size_t ret = OPENSSL_strlcpy(dst, src, dst_size < 0 ? 0 : (size_t)dst_size); if (ret > INT_MAX) { OPENSSL_PUT_ERROR(OBJ, ERR_R_OVERFLOW); return -1; @@ -552,3 +545,5 @@ int OBJ_create(const char *oid, const char *short_name, const char *long_name) { } return op->nid; } + +void OBJ_cleanup(void) {} diff --git a/Pods/BoringSSL-GRPC/crypto/obj/obj_dat.h b/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h similarity index 78% rename from Pods/BoringSSL-GRPC/crypto/obj/obj_dat.h rename to Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h index dceaf03df..888ea676e 100644 --- a/Pods/BoringSSL-GRPC/crypto/obj/obj_dat.h +++ b/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h @@ -57,1763 +57,7076 @@ /* This file is generated by crypto/obj/objects.go. */ -#define NUM_NID 959 +#define NUM_NID 962 static const uint8_t kObjectData[] = { /* NID_rsadsi */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, /* NID_pkcs */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, /* NID_md2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x02, /* NID_md5 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x05, /* NID_rc4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x04, /* NID_rsaEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x01, /* NID_md2WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x02, /* NID_md5WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x04, /* NID_pbeWithMD2AndDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x01, /* NID_pbeWithMD5AndDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x03, /* NID_X500 */ 0x55, /* NID_X509 */ - 0x55, 0x04, + 0x55, + 0x04, /* NID_commonName */ - 0x55, 0x04, 0x03, + 0x55, + 0x04, + 0x03, /* NID_countryName */ - 0x55, 0x04, 0x06, + 0x55, + 0x04, + 0x06, /* NID_localityName */ - 0x55, 0x04, 0x07, + 0x55, + 0x04, + 0x07, /* NID_stateOrProvinceName */ - 0x55, 0x04, 0x08, + 0x55, + 0x04, + 0x08, /* NID_organizationName */ - 0x55, 0x04, 0x0a, + 0x55, + 0x04, + 0x0a, /* NID_organizationalUnitName */ - 0x55, 0x04, 0x0b, + 0x55, + 0x04, + 0x0b, /* NID_rsa */ - 0x55, 0x08, 0x01, 0x01, + 0x55, + 0x08, + 0x01, + 0x01, /* NID_pkcs7 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, /* NID_pkcs7_data */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x01, /* NID_pkcs7_signed */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x02, /* NID_pkcs7_enveloped */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x03, /* NID_pkcs7_signedAndEnveloped */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x04, /* NID_pkcs7_digest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x05, /* NID_pkcs7_encrypted */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x06, /* NID_pkcs3 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, /* NID_dhKeyAgreement */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, + 0x01, /* NID_des_ecb */ - 0x2b, 0x0e, 0x03, 0x02, 0x06, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x06, /* NID_des_cfb64 */ - 0x2b, 0x0e, 0x03, 0x02, 0x09, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x09, /* NID_des_cbc */ - 0x2b, 0x0e, 0x03, 0x02, 0x07, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x07, /* NID_des_ede_ecb */ - 0x2b, 0x0e, 0x03, 0x02, 0x11, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x11, /* NID_idea_cbc */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x81, 0x3c, 0x07, 0x01, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x81, + 0x3c, + 0x07, + 0x01, + 0x01, + 0x02, /* NID_rc2_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x02, /* NID_sha */ - 0x2b, 0x0e, 0x03, 0x02, 0x12, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x12, /* NID_shaWithRSAEncryption */ - 0x2b, 0x0e, 0x03, 0x02, 0x0f, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0f, /* NID_des_ede3_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x07, /* NID_des_ofb64 */ - 0x2b, 0x0e, 0x03, 0x02, 0x08, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x08, /* NID_pkcs9 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, /* NID_pkcs9_emailAddress */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x01, /* NID_pkcs9_unstructuredName */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x02, /* NID_pkcs9_contentType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x03, /* NID_pkcs9_messageDigest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x04, /* NID_pkcs9_signingTime */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x05, /* NID_pkcs9_countersignature */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x06, /* NID_pkcs9_challengePassword */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x07, /* NID_pkcs9_unstructuredAddress */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x08, /* NID_pkcs9_extCertAttributes */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x09, /* NID_netscape */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, /* NID_netscape_cert_extension */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, /* NID_netscape_data_type */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, /* NID_sha1 */ - 0x2b, 0x0e, 0x03, 0x02, 0x1a, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1a, /* NID_sha1WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x05, /* NID_dsaWithSHA */ - 0x2b, 0x0e, 0x03, 0x02, 0x0d, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0d, /* NID_dsa_2 */ - 0x2b, 0x0e, 0x03, 0x02, 0x0c, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0c, /* NID_pbeWithSHA1AndRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0b, /* NID_id_pbkdf2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0c, /* NID_dsaWithSHA1_2 */ - 0x2b, 0x0e, 0x03, 0x02, 0x1b, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1b, /* NID_netscape_cert_type */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x01, /* NID_netscape_base_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x02, /* NID_netscape_revocation_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x03, /* NID_netscape_ca_revocation_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x04, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x04, /* NID_netscape_renewal_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x07, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x07, /* NID_netscape_ca_policy_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x08, /* NID_netscape_ssl_server_name */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0c, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0c, /* NID_netscape_comment */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0d, /* NID_netscape_cert_sequence */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x02, 0x05, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, + 0x05, /* NID_id_ce */ - 0x55, 0x1d, + 0x55, + 0x1d, /* NID_subject_key_identifier */ - 0x55, 0x1d, 0x0e, + 0x55, + 0x1d, + 0x0e, /* NID_key_usage */ - 0x55, 0x1d, 0x0f, + 0x55, + 0x1d, + 0x0f, /* NID_private_key_usage_period */ - 0x55, 0x1d, 0x10, + 0x55, + 0x1d, + 0x10, /* NID_subject_alt_name */ - 0x55, 0x1d, 0x11, + 0x55, + 0x1d, + 0x11, /* NID_issuer_alt_name */ - 0x55, 0x1d, 0x12, + 0x55, + 0x1d, + 0x12, /* NID_basic_constraints */ - 0x55, 0x1d, 0x13, + 0x55, + 0x1d, + 0x13, /* NID_crl_number */ - 0x55, 0x1d, 0x14, + 0x55, + 0x1d, + 0x14, /* NID_certificate_policies */ - 0x55, 0x1d, 0x20, + 0x55, + 0x1d, + 0x20, /* NID_authority_key_identifier */ - 0x55, 0x1d, 0x23, + 0x55, + 0x1d, + 0x23, /* NID_bf_cbc */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x97, + 0x55, + 0x01, + 0x02, /* NID_mdc2 */ - 0x55, 0x08, 0x03, 0x65, + 0x55, + 0x08, + 0x03, + 0x65, /* NID_mdc2WithRSA */ - 0x55, 0x08, 0x03, 0x64, + 0x55, + 0x08, + 0x03, + 0x64, /* NID_givenName */ - 0x55, 0x04, 0x2a, + 0x55, + 0x04, + 0x2a, /* NID_surname */ - 0x55, 0x04, 0x04, + 0x55, + 0x04, + 0x04, /* NID_initials */ - 0x55, 0x04, 0x2b, + 0x55, + 0x04, + 0x2b, /* NID_crl_distribution_points */ - 0x55, 0x1d, 0x1f, + 0x55, + 0x1d, + 0x1f, /* NID_md5WithRSA */ - 0x2b, 0x0e, 0x03, 0x02, 0x03, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x03, /* NID_serialNumber */ - 0x55, 0x04, 0x05, + 0x55, + 0x04, + 0x05, /* NID_title */ - 0x55, 0x04, 0x0c, + 0x55, + 0x04, + 0x0c, /* NID_description */ - 0x55, 0x04, 0x0d, + 0x55, + 0x04, + 0x0d, /* NID_cast5_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0a, /* NID_pbeWithMD5AndCast5_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0c, /* NID_dsaWithSHA1 */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x03, /* NID_sha1WithRSA */ - 0x2b, 0x0e, 0x03, 0x02, 0x1d, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1d, /* NID_dsa */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x01, /* NID_ripemd160 */ - 0x2b, 0x24, 0x03, 0x02, 0x01, + 0x2b, + 0x24, + 0x03, + 0x02, + 0x01, /* NID_ripemd160WithRSA */ - 0x2b, 0x24, 0x03, 0x03, 0x01, 0x02, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x01, + 0x02, /* NID_rc5_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x08, /* NID_zlib_compression */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x08, /* NID_ext_key_usage */ - 0x55, 0x1d, 0x25, + 0x55, + 0x1d, + 0x25, /* NID_id_pkix */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, /* NID_id_kp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, /* NID_server_auth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x01, /* NID_client_auth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x02, /* NID_code_sign */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x03, /* NID_email_protect */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x04, /* NID_time_stamp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x08, /* NID_ms_code_ind */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x15, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x15, /* NID_ms_code_com */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x16, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x16, /* NID_ms_ctl_sign */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x01, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x01, /* NID_ms_sgc */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x03, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x03, /* NID_ms_efs */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x04, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x04, /* NID_ns_sgc */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x04, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x04, + 0x01, /* NID_delta_crl */ - 0x55, 0x1d, 0x1b, + 0x55, + 0x1d, + 0x1b, /* NID_crl_reason */ - 0x55, 0x1d, 0x15, + 0x55, + 0x1d, + 0x15, /* NID_invalidity_date */ - 0x55, 0x1d, 0x18, + 0x55, + 0x1d, + 0x18, /* NID_sxnet */ - 0x2b, 0x65, 0x01, 0x04, 0x01, + 0x2b, + 0x65, + 0x01, + 0x04, + 0x01, /* NID_pbe_WithSHA1And128BitRC4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x01, /* NID_pbe_WithSHA1And40BitRC4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x02, /* NID_pbe_WithSHA1And3_Key_TripleDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x03, /* NID_pbe_WithSHA1And2_Key_TripleDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x04, /* NID_pbe_WithSHA1And128BitRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x05, /* NID_pbe_WithSHA1And40BitRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x06, /* NID_keyBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x01, /* NID_pkcs8ShroudedKeyBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x02, /* NID_certBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x03, /* NID_crlBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x04, /* NID_secretBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x05, /* NID_safeContentsBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x06, /* NID_friendlyName */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x14, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x14, /* NID_localKeyID */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x15, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x15, /* NID_x509Certificate */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x16, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x01, /* NID_sdsiCertificate */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x16, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x02, /* NID_x509Crl */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x17, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x17, + 0x01, /* NID_pbes2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0d, /* NID_pbmac1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0e, /* NID_hmacWithSHA1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x07, /* NID_id_qt_cps */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x01, /* NID_id_qt_unotice */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x02, /* NID_SMIMECapabilities */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0f, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0f, /* NID_pbeWithMD2AndRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x04, /* NID_pbeWithMD5AndRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x06, /* NID_pbeWithSHA1AndDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0a, /* NID_ms_ext_req */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x0e, /* NID_ext_req */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0e, /* NID_name */ - 0x55, 0x04, 0x29, + 0x55, + 0x04, + 0x29, /* NID_dnQualifier */ - 0x55, 0x04, 0x2e, + 0x55, + 0x04, + 0x2e, /* NID_id_pe */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, /* NID_id_ad */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, /* NID_info_access */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x01, /* NID_ad_OCSP */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, /* NID_ad_ca_issuers */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x02, /* NID_OCSP_sign */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x09, /* NID_member_body */ 0x2a, /* NID_ISO_US */ - 0x2a, 0x86, 0x48, + 0x2a, + 0x86, + 0x48, /* NID_X9_57 */ - 0x2a, 0x86, 0x48, 0xce, 0x38, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, /* NID_X9cm */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, /* NID_pkcs1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, /* NID_pkcs5 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, /* NID_SMIME */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, /* NID_id_smime_mod */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, /* NID_id_smime_ct */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, /* NID_id_smime_aa */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, /* NID_id_smime_alg */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, /* NID_id_smime_cd */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x04, /* NID_id_smime_spq */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, /* NID_id_smime_cti */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, /* NID_id_smime_mod_cms */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x01, /* NID_id_smime_mod_ess */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x02, /* NID_id_smime_mod_oid */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x03, /* NID_id_smime_mod_msg_v3 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x04, /* NID_id_smime_mod_ets_eSignature_88 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x05, /* NID_id_smime_mod_ets_eSignature_97 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x06, /* NID_id_smime_mod_ets_eSigPolicy_88 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x07, /* NID_id_smime_mod_ets_eSigPolicy_97 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x08, /* NID_id_smime_ct_receipt */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x01, /* NID_id_smime_ct_authData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x02, /* NID_id_smime_ct_publishCert */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x03, /* NID_id_smime_ct_TSTInfo */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x04, /* NID_id_smime_ct_TDTInfo */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x05, /* NID_id_smime_ct_contentInfo */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x06, /* NID_id_smime_ct_DVCSRequestData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x07, /* NID_id_smime_ct_DVCSResponseData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x08, /* NID_id_smime_aa_receiptRequest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x01, /* NID_id_smime_aa_securityLabel */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x02, /* NID_id_smime_aa_mlExpandHistory */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x03, /* NID_id_smime_aa_contentHint */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x04, /* NID_id_smime_aa_msgSigDigest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x05, /* NID_id_smime_aa_encapContentType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x06, /* NID_id_smime_aa_contentIdentifier */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x07, /* NID_id_smime_aa_macValue */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x08, /* NID_id_smime_aa_equivalentLabels */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x09, /* NID_id_smime_aa_contentReference */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0a, /* NID_id_smime_aa_encrypKeyPref */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0b, /* NID_id_smime_aa_signingCertificate */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0c, /* NID_id_smime_aa_smimeEncryptCerts */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0d, /* NID_id_smime_aa_timeStampToken */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0e, /* NID_id_smime_aa_ets_sigPolicyId */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0f, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0f, /* NID_id_smime_aa_ets_commitmentType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x10, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x10, /* NID_id_smime_aa_ets_signerLocation */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x11, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x11, /* NID_id_smime_aa_ets_signerAttr */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x12, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x12, /* NID_id_smime_aa_ets_otherSigCert */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x13, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x13, /* NID_id_smime_aa_ets_contentTimestamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x14, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x14, /* NID_id_smime_aa_ets_CertificateRefs */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x15, - /* NID_id_smime_aa_ets_RevocationRefs */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x16, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x15, + /* NID_id_smime_aa_ets_RevocationRefs */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x16, /* NID_id_smime_aa_ets_certValues */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x17, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x17, /* NID_id_smime_aa_ets_revocationValues */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x18, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x18, /* NID_id_smime_aa_ets_escTimeStamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x19, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x19, /* NID_id_smime_aa_ets_certCRLTimestamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1a, /* NID_id_smime_aa_ets_archiveTimeStamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1b, /* NID_id_smime_aa_signatureType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1c, /* NID_id_smime_aa_dvcs_dvc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1d, /* NID_id_smime_alg_ESDHwith3DES */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x01, /* NID_id_smime_alg_ESDHwithRC2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x02, /* NID_id_smime_alg_3DESwrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x03, /* NID_id_smime_alg_RC2wrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x04, /* NID_id_smime_alg_ESDH */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x05, /* NID_id_smime_alg_CMS3DESwrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x06, /* NID_id_smime_alg_CMSRC2wrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x07, /* NID_id_smime_cd_ldap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x04, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x04, + 0x01, /* NID_id_smime_spq_ets_sqt_uri */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x05, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, + 0x01, /* NID_id_smime_spq_ets_sqt_unotice */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x05, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, + 0x02, /* NID_id_smime_cti_ets_proofOfOrigin */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x01, /* NID_id_smime_cti_ets_proofOfReceipt */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x02, /* NID_id_smime_cti_ets_proofOfDelivery */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x03, /* NID_id_smime_cti_ets_proofOfSender */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x04, /* NID_id_smime_cti_ets_proofOfApproval */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x05, /* NID_id_smime_cti_ets_proofOfCreation */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x06, /* NID_md4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x04, /* NID_id_pkix_mod */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, /* NID_id_qt */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, /* NID_id_it */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, /* NID_id_pkip */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, /* NID_id_alg */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, /* NID_id_cmc */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, /* NID_id_on */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, /* NID_id_pda */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, /* NID_id_aca */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, /* NID_id_qcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, /* NID_id_cct */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, /* NID_id_pkix1_explicit_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x01, /* NID_id_pkix1_implicit_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x02, /* NID_id_pkix1_explicit_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x03, /* NID_id_pkix1_implicit_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x04, /* NID_id_mod_crmf */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x05, /* NID_id_mod_cmc */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x06, /* NID_id_mod_kea_profile_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x07, /* NID_id_mod_kea_profile_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x08, /* NID_id_mod_cmp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x09, /* NID_id_mod_qualified_cert_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0a, /* NID_id_mod_qualified_cert_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0b, /* NID_id_mod_attribute_cert */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0c, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0c, /* NID_id_mod_timestamp_protocol */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0d, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0d, /* NID_id_mod_ocsp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0e, /* NID_id_mod_dvcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0f, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0f, /* NID_id_mod_cmp2000 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x10, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x10, /* NID_biometricInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x02, /* NID_qcStatements */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x03, /* NID_ac_auditEntity */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x04, /* NID_ac_targeting */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x05, /* NID_aaControls */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x06, /* NID_sbgp_ipAddrBlock */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x07, /* NID_sbgp_autonomousSysNum */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x08, /* NID_sbgp_routerIdentifier */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x09, /* NID_textNotice */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x03, /* NID_ipsecEndSystem */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x05, /* NID_ipsecTunnel */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x06, /* NID_ipsecUser */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x07, /* NID_dvcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x0a, /* NID_id_it_caProtEncCert */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x01, /* NID_id_it_signKeyPairTypes */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x02, /* NID_id_it_encKeyPairTypes */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x03, /* NID_id_it_preferredSymmAlg */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x04, /* NID_id_it_caKeyUpdateInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x05, /* NID_id_it_currentCRL */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x06, /* NID_id_it_unsupportedOIDs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x07, /* NID_id_it_subscriptionRequest */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x08, /* NID_id_it_subscriptionResponse */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x09, /* NID_id_it_keyPairParamReq */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0a, /* NID_id_it_keyPairParamRep */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0b, /* NID_id_it_revPassphrase */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0c, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0c, /* NID_id_it_implicitConfirm */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0d, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0d, /* NID_id_it_confirmWaitTime */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0e, /* NID_id_it_origPKIMessage */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0f, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0f, /* NID_id_regCtrl */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, /* NID_id_regInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, /* NID_id_regCtrl_regToken */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x01, /* NID_id_regCtrl_authenticator */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x02, /* NID_id_regCtrl_pkiPublicationInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x03, /* NID_id_regCtrl_pkiArchiveOptions */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x04, /* NID_id_regCtrl_oldCertID */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x05, /* NID_id_regCtrl_protocolEncrKey */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x06, /* NID_id_regInfo_utf8Pairs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x02, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x01, /* NID_id_regInfo_certReq */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x02, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x02, /* NID_id_alg_des40 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x01, /* NID_id_alg_noSignature */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x02, /* NID_id_alg_dh_sig_hmac_sha1 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x03, /* NID_id_alg_dh_pop */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x04, /* NID_id_cmc_statusInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x01, /* NID_id_cmc_identification */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x02, /* NID_id_cmc_identityProof */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x03, /* NID_id_cmc_dataReturn */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x04, /* NID_id_cmc_transactionId */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x05, /* NID_id_cmc_senderNonce */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x06, /* NID_id_cmc_recipientNonce */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x07, /* NID_id_cmc_addExtensions */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x08, /* NID_id_cmc_encryptedPOP */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x09, /* NID_id_cmc_decryptedPOP */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0a, /* NID_id_cmc_lraPOPWitness */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0b, /* NID_id_cmc_getCert */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x0f, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0f, /* NID_id_cmc_getCRL */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x10, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x10, /* NID_id_cmc_revokeRequest */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x11, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x11, /* NID_id_cmc_regInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x12, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x12, /* NID_id_cmc_responseInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x13, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x13, /* NID_id_cmc_queryPending */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x15, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x15, /* NID_id_cmc_popLinkRandom */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x16, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x16, /* NID_id_cmc_popLinkWitness */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x17, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x17, /* NID_id_cmc_confirmCertAcceptance */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x18, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x18, /* NID_id_on_personalData */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x08, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x01, /* NID_id_pda_dateOfBirth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x01, /* NID_id_pda_placeOfBirth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x02, /* NID_id_pda_gender */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x03, /* NID_id_pda_countryOfCitizenship */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x04, /* NID_id_pda_countryOfResidence */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x05, /* NID_id_aca_authenticationInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x01, /* NID_id_aca_accessIdentity */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x02, /* NID_id_aca_chargingIdentity */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x03, /* NID_id_aca_group */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x04, /* NID_id_aca_role */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x05, /* NID_id_qcs_pkixQCSyntax_v1 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0b, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, + 0x01, /* NID_id_cct_crs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x01, /* NID_id_cct_PKIData */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x02, /* NID_id_cct_PKIResponse */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x03, /* NID_ad_timeStamping */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x03, /* NID_ad_dvcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x04, /* NID_id_pkix_OCSP_basic */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x01, /* NID_id_pkix_OCSP_Nonce */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x02, /* NID_id_pkix_OCSP_CrlID */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x03, /* NID_id_pkix_OCSP_acceptableResponses */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x04, /* NID_id_pkix_OCSP_noCheck */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x05, /* NID_id_pkix_OCSP_archiveCutoff */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x06, /* NID_id_pkix_OCSP_serviceLocator */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x07, /* NID_id_pkix_OCSP_extendedStatus */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x08, /* NID_id_pkix_OCSP_valid */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x09, /* NID_id_pkix_OCSP_path */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0a, /* NID_id_pkix_OCSP_trustRoot */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0b, /* NID_algorithm */ - 0x2b, 0x0e, 0x03, 0x02, + 0x2b, + 0x0e, + 0x03, + 0x02, /* NID_rsaSignature */ - 0x2b, 0x0e, 0x03, 0x02, 0x0b, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0b, /* NID_X500algorithms */ - 0x55, 0x08, + 0x55, + 0x08, /* NID_org */ 0x2b, /* NID_dod */ - 0x2b, 0x06, + 0x2b, + 0x06, /* NID_iana */ - 0x2b, 0x06, 0x01, + 0x2b, + 0x06, + 0x01, /* NID_Directory */ - 0x2b, 0x06, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x01, /* NID_Management */ - 0x2b, 0x06, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x02, /* NID_Experimental */ - 0x2b, 0x06, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x03, /* NID_Private */ - 0x2b, 0x06, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x04, /* NID_Security */ - 0x2b, 0x06, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, /* NID_SNMPv2 */ - 0x2b, 0x06, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x06, /* NID_Mail */ - 0x2b, 0x06, 0x01, 0x07, + 0x2b, + 0x06, + 0x01, + 0x07, /* NID_Enterprises */ - 0x2b, 0x06, 0x01, 0x04, 0x01, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, /* NID_dcObject */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x8b, 0x3a, 0x82, 0x58, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x8b, + 0x3a, + 0x82, + 0x58, /* NID_domainComponent */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x19, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x19, /* NID_Domain */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x0d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0d, /* NID_selected_attribute_types */ - 0x55, 0x01, 0x05, + 0x55, + 0x01, + 0x05, /* NID_clearance */ - 0x55, 0x01, 0x05, 0x37, + 0x55, + 0x01, + 0x05, + 0x37, /* NID_md4WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x03, /* NID_ac_proxying */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0a, /* NID_sinfo_access */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0b, /* NID_id_aca_encAttrs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x06, /* NID_role */ - 0x55, 0x04, 0x48, + 0x55, + 0x04, + 0x48, /* NID_policy_constraints */ - 0x55, 0x1d, 0x24, + 0x55, + 0x1d, + 0x24, /* NID_target_information */ - 0x55, 0x1d, 0x37, + 0x55, + 0x1d, + 0x37, /* NID_no_rev_avail */ - 0x55, 0x1d, 0x38, + 0x55, + 0x1d, + 0x38, /* NID_ansi_X9_62 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, /* NID_X9_62_prime_field */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x01, /* NID_X9_62_characteristic_two_field */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, /* NID_X9_62_id_ecPublicKey */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x02, + 0x01, /* NID_X9_62_prime192v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x01, /* NID_X9_62_prime192v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x02, /* NID_X9_62_prime192v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x03, /* NID_X9_62_prime239v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x04, /* NID_X9_62_prime239v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x05, /* NID_X9_62_prime239v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x06, /* NID_X9_62_prime256v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x07, /* NID_ecdsa_with_SHA1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x01, /* NID_ms_csp_name */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x11, 0x01, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x01, /* NID_aes_128_ecb */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x01, /* NID_aes_128_cbc */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x02, /* NID_aes_128_ofb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x03, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x03, /* NID_aes_128_cfb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x04, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x04, /* NID_aes_192_ecb */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x15, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x15, /* NID_aes_192_cbc */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x16, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x16, /* NID_aes_192_ofb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x17, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x17, /* NID_aes_192_cfb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x18, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x18, /* NID_aes_256_ecb */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x29, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x29, /* NID_aes_256_cbc */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2a, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2a, /* NID_aes_256_ofb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2b, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2b, /* NID_aes_256_cfb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2c, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2c, /* NID_hold_instruction_code */ - 0x55, 0x1d, 0x17, + 0x55, + 0x1d, + 0x17, /* NID_hold_instruction_none */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x01, /* NID_hold_instruction_call_issuer */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x02, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x02, /* NID_hold_instruction_reject */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x02, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x03, /* NID_data */ 0x09, /* NID_pss */ - 0x09, 0x92, 0x26, + 0x09, + 0x92, + 0x26, /* NID_ucl */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, /* NID_pilot */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, /* NID_pilotAttributeType */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, /* NID_pilotAttributeSyntax */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x03, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, /* NID_pilotObjectClass */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, /* NID_pilotGroups */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x0a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x0a, /* NID_iA5StringSyntax */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x03, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x04, /* NID_caseIgnoreIA5StringSyntax */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x03, 0x05, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x05, /* NID_pilotObject */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x03, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x03, /* NID_pilotPerson */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x04, /* NID_account */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x05, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x05, /* NID_document */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x06, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x06, /* NID_room */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x07, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x07, /* NID_documentSeries */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x09, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x09, /* NID_rFC822localPart */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x0e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0e, /* NID_dNSDomain */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x0f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0f, /* NID_domainRelatedObject */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x11, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x11, /* NID_friendlyCountry */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x12, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x12, /* NID_simpleSecurityObject */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x13, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x13, /* NID_pilotOrganization */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x14, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x14, /* NID_pilotDSA */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x15, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x15, /* NID_qualityLabelledData */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x16, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x16, /* NID_userId */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x01, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x01, /* NID_textEncodedORAddress */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x02, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x02, /* NID_rfc822Mailbox */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x03, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x03, /* NID_info */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x04, /* NID_favouriteDrink */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x05, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x05, /* NID_roomNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x06, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x06, /* NID_photo */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x07, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x07, /* NID_userClass */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x08, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x08, /* NID_host */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x09, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x09, /* NID_manager */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0a, /* NID_documentIdentifier */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0b, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0b, /* NID_documentTitle */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0c, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0c, /* NID_documentVersion */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0d, /* NID_documentAuthor */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0e, /* NID_documentLocation */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0f, /* NID_homeTelephoneNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x14, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x14, /* NID_secretary */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x15, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x15, /* NID_otherMailbox */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x16, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x16, /* NID_lastModifiedTime */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x17, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x17, /* NID_lastModifiedBy */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x18, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x18, /* NID_aRecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1a, /* NID_pilotAttributeType27 */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1b, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1b, /* NID_mXRecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1c, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1c, /* NID_nSRecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1d, /* NID_sOARecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1e, /* NID_cNAMERecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1f, /* NID_associatedDomain */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x25, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x25, /* NID_associatedName */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x26, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x26, /* NID_homePostalAddress */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x27, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x27, /* NID_personalTitle */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x28, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x28, /* NID_mobileTelephoneNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x29, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x29, /* NID_pagerTelephoneNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2a, /* NID_friendlyCountryName */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2b, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2b, /* NID_organizationalStatus */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2d, /* NID_janetMailbox */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2e, /* NID_mailPreferenceOption */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2f, /* NID_buildingName */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x30, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x30, /* NID_dSAQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x31, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x31, /* NID_singleLevelQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x32, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x32, /* NID_subtreeMinimumQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x33, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x33, /* NID_subtreeMaximumQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x34, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x34, /* NID_personalSignature */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x35, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x35, /* NID_dITRedirect */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x36, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x36, /* NID_audio */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x37, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x37, /* NID_documentPublisher */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x38, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x38, /* NID_x500UniqueIdentifier */ - 0x55, 0x04, 0x2d, + 0x55, + 0x04, + 0x2d, /* NID_mime_mhs */ - 0x2b, 0x06, 0x01, 0x07, 0x01, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, /* NID_mime_mhs_headings */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, /* NID_mime_mhs_bodies */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x02, /* NID_id_hex_partial_message */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x01, /* NID_id_hex_multipart_message */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x02, /* NID_generationQualifier */ - 0x55, 0x04, 0x2c, + 0x55, + 0x04, + 0x2c, /* NID_pseudonym */ - 0x55, 0x04, 0x41, + 0x55, + 0x04, + 0x41, /* NID_id_set */ - 0x67, 0x2a, + 0x67, + 0x2a, /* NID_set_ctype */ - 0x67, 0x2a, 0x00, + 0x67, + 0x2a, + 0x00, /* NID_set_msgExt */ - 0x67, 0x2a, 0x01, + 0x67, + 0x2a, + 0x01, /* NID_set_attr */ - 0x67, 0x2a, 0x03, + 0x67, + 0x2a, + 0x03, /* NID_set_policy */ - 0x67, 0x2a, 0x05, + 0x67, + 0x2a, + 0x05, /* NID_set_certExt */ - 0x67, 0x2a, 0x07, + 0x67, + 0x2a, + 0x07, /* NID_set_brand */ - 0x67, 0x2a, 0x08, + 0x67, + 0x2a, + 0x08, /* NID_setct_PANData */ - 0x67, 0x2a, 0x00, 0x00, + 0x67, + 0x2a, + 0x00, + 0x00, /* NID_setct_PANToken */ - 0x67, 0x2a, 0x00, 0x01, + 0x67, + 0x2a, + 0x00, + 0x01, /* NID_setct_PANOnly */ - 0x67, 0x2a, 0x00, 0x02, + 0x67, + 0x2a, + 0x00, + 0x02, /* NID_setct_OIData */ - 0x67, 0x2a, 0x00, 0x03, + 0x67, + 0x2a, + 0x00, + 0x03, /* NID_setct_PI */ - 0x67, 0x2a, 0x00, 0x04, + 0x67, + 0x2a, + 0x00, + 0x04, /* NID_setct_PIData */ - 0x67, 0x2a, 0x00, 0x05, + 0x67, + 0x2a, + 0x00, + 0x05, /* NID_setct_PIDataUnsigned */ - 0x67, 0x2a, 0x00, 0x06, + 0x67, + 0x2a, + 0x00, + 0x06, /* NID_setct_HODInput */ - 0x67, 0x2a, 0x00, 0x07, + 0x67, + 0x2a, + 0x00, + 0x07, /* NID_setct_AuthResBaggage */ - 0x67, 0x2a, 0x00, 0x08, + 0x67, + 0x2a, + 0x00, + 0x08, /* NID_setct_AuthRevReqBaggage */ - 0x67, 0x2a, 0x00, 0x09, + 0x67, + 0x2a, + 0x00, + 0x09, /* NID_setct_AuthRevResBaggage */ - 0x67, 0x2a, 0x00, 0x0a, + 0x67, + 0x2a, + 0x00, + 0x0a, /* NID_setct_CapTokenSeq */ - 0x67, 0x2a, 0x00, 0x0b, + 0x67, + 0x2a, + 0x00, + 0x0b, /* NID_setct_PInitResData */ - 0x67, 0x2a, 0x00, 0x0c, + 0x67, + 0x2a, + 0x00, + 0x0c, /* NID_setct_PI_TBS */ - 0x67, 0x2a, 0x00, 0x0d, + 0x67, + 0x2a, + 0x00, + 0x0d, /* NID_setct_PResData */ - 0x67, 0x2a, 0x00, 0x0e, + 0x67, + 0x2a, + 0x00, + 0x0e, /* NID_setct_AuthReqTBS */ - 0x67, 0x2a, 0x00, 0x10, + 0x67, + 0x2a, + 0x00, + 0x10, /* NID_setct_AuthResTBS */ - 0x67, 0x2a, 0x00, 0x11, + 0x67, + 0x2a, + 0x00, + 0x11, /* NID_setct_AuthResTBSX */ - 0x67, 0x2a, 0x00, 0x12, + 0x67, + 0x2a, + 0x00, + 0x12, /* NID_setct_AuthTokenTBS */ - 0x67, 0x2a, 0x00, 0x13, + 0x67, + 0x2a, + 0x00, + 0x13, /* NID_setct_CapTokenData */ - 0x67, 0x2a, 0x00, 0x14, + 0x67, + 0x2a, + 0x00, + 0x14, /* NID_setct_CapTokenTBS */ - 0x67, 0x2a, 0x00, 0x15, + 0x67, + 0x2a, + 0x00, + 0x15, /* NID_setct_AcqCardCodeMsg */ - 0x67, 0x2a, 0x00, 0x16, + 0x67, + 0x2a, + 0x00, + 0x16, /* NID_setct_AuthRevReqTBS */ - 0x67, 0x2a, 0x00, 0x17, + 0x67, + 0x2a, + 0x00, + 0x17, /* NID_setct_AuthRevResData */ - 0x67, 0x2a, 0x00, 0x18, + 0x67, + 0x2a, + 0x00, + 0x18, /* NID_setct_AuthRevResTBS */ - 0x67, 0x2a, 0x00, 0x19, + 0x67, + 0x2a, + 0x00, + 0x19, /* NID_setct_CapReqTBS */ - 0x67, 0x2a, 0x00, 0x1a, + 0x67, + 0x2a, + 0x00, + 0x1a, /* NID_setct_CapReqTBSX */ - 0x67, 0x2a, 0x00, 0x1b, + 0x67, + 0x2a, + 0x00, + 0x1b, /* NID_setct_CapResData */ - 0x67, 0x2a, 0x00, 0x1c, + 0x67, + 0x2a, + 0x00, + 0x1c, /* NID_setct_CapRevReqTBS */ - 0x67, 0x2a, 0x00, 0x1d, + 0x67, + 0x2a, + 0x00, + 0x1d, /* NID_setct_CapRevReqTBSX */ - 0x67, 0x2a, 0x00, 0x1e, + 0x67, + 0x2a, + 0x00, + 0x1e, /* NID_setct_CapRevResData */ - 0x67, 0x2a, 0x00, 0x1f, + 0x67, + 0x2a, + 0x00, + 0x1f, /* NID_setct_CredReqTBS */ - 0x67, 0x2a, 0x00, 0x20, + 0x67, + 0x2a, + 0x00, + 0x20, /* NID_setct_CredReqTBSX */ - 0x67, 0x2a, 0x00, 0x21, + 0x67, + 0x2a, + 0x00, + 0x21, /* NID_setct_CredResData */ - 0x67, 0x2a, 0x00, 0x22, + 0x67, + 0x2a, + 0x00, + 0x22, /* NID_setct_CredRevReqTBS */ - 0x67, 0x2a, 0x00, 0x23, + 0x67, + 0x2a, + 0x00, + 0x23, /* NID_setct_CredRevReqTBSX */ - 0x67, 0x2a, 0x00, 0x24, + 0x67, + 0x2a, + 0x00, + 0x24, /* NID_setct_CredRevResData */ - 0x67, 0x2a, 0x00, 0x25, + 0x67, + 0x2a, + 0x00, + 0x25, /* NID_setct_PCertReqData */ - 0x67, 0x2a, 0x00, 0x26, + 0x67, + 0x2a, + 0x00, + 0x26, /* NID_setct_PCertResTBS */ - 0x67, 0x2a, 0x00, 0x27, + 0x67, + 0x2a, + 0x00, + 0x27, /* NID_setct_BatchAdminReqData */ - 0x67, 0x2a, 0x00, 0x28, + 0x67, + 0x2a, + 0x00, + 0x28, /* NID_setct_BatchAdminResData */ - 0x67, 0x2a, 0x00, 0x29, + 0x67, + 0x2a, + 0x00, + 0x29, /* NID_setct_CardCInitResTBS */ - 0x67, 0x2a, 0x00, 0x2a, + 0x67, + 0x2a, + 0x00, + 0x2a, /* NID_setct_MeAqCInitResTBS */ - 0x67, 0x2a, 0x00, 0x2b, + 0x67, + 0x2a, + 0x00, + 0x2b, /* NID_setct_RegFormResTBS */ - 0x67, 0x2a, 0x00, 0x2c, + 0x67, + 0x2a, + 0x00, + 0x2c, /* NID_setct_CertReqData */ - 0x67, 0x2a, 0x00, 0x2d, + 0x67, + 0x2a, + 0x00, + 0x2d, /* NID_setct_CertReqTBS */ - 0x67, 0x2a, 0x00, 0x2e, + 0x67, + 0x2a, + 0x00, + 0x2e, /* NID_setct_CertResData */ - 0x67, 0x2a, 0x00, 0x2f, + 0x67, + 0x2a, + 0x00, + 0x2f, /* NID_setct_CertInqReqTBS */ - 0x67, 0x2a, 0x00, 0x30, + 0x67, + 0x2a, + 0x00, + 0x30, /* NID_setct_ErrorTBS */ - 0x67, 0x2a, 0x00, 0x31, + 0x67, + 0x2a, + 0x00, + 0x31, /* NID_setct_PIDualSignedTBE */ - 0x67, 0x2a, 0x00, 0x32, + 0x67, + 0x2a, + 0x00, + 0x32, /* NID_setct_PIUnsignedTBE */ - 0x67, 0x2a, 0x00, 0x33, + 0x67, + 0x2a, + 0x00, + 0x33, /* NID_setct_AuthReqTBE */ - 0x67, 0x2a, 0x00, 0x34, + 0x67, + 0x2a, + 0x00, + 0x34, /* NID_setct_AuthResTBE */ - 0x67, 0x2a, 0x00, 0x35, + 0x67, + 0x2a, + 0x00, + 0x35, /* NID_setct_AuthResTBEX */ - 0x67, 0x2a, 0x00, 0x36, + 0x67, + 0x2a, + 0x00, + 0x36, /* NID_setct_AuthTokenTBE */ - 0x67, 0x2a, 0x00, 0x37, + 0x67, + 0x2a, + 0x00, + 0x37, /* NID_setct_CapTokenTBE */ - 0x67, 0x2a, 0x00, 0x38, + 0x67, + 0x2a, + 0x00, + 0x38, /* NID_setct_CapTokenTBEX */ - 0x67, 0x2a, 0x00, 0x39, + 0x67, + 0x2a, + 0x00, + 0x39, /* NID_setct_AcqCardCodeMsgTBE */ - 0x67, 0x2a, 0x00, 0x3a, + 0x67, + 0x2a, + 0x00, + 0x3a, /* NID_setct_AuthRevReqTBE */ - 0x67, 0x2a, 0x00, 0x3b, + 0x67, + 0x2a, + 0x00, + 0x3b, /* NID_setct_AuthRevResTBE */ - 0x67, 0x2a, 0x00, 0x3c, + 0x67, + 0x2a, + 0x00, + 0x3c, /* NID_setct_AuthRevResTBEB */ - 0x67, 0x2a, 0x00, 0x3d, + 0x67, + 0x2a, + 0x00, + 0x3d, /* NID_setct_CapReqTBE */ - 0x67, 0x2a, 0x00, 0x3e, + 0x67, + 0x2a, + 0x00, + 0x3e, /* NID_setct_CapReqTBEX */ - 0x67, 0x2a, 0x00, 0x3f, + 0x67, + 0x2a, + 0x00, + 0x3f, /* NID_setct_CapResTBE */ - 0x67, 0x2a, 0x00, 0x40, + 0x67, + 0x2a, + 0x00, + 0x40, /* NID_setct_CapRevReqTBE */ - 0x67, 0x2a, 0x00, 0x41, + 0x67, + 0x2a, + 0x00, + 0x41, /* NID_setct_CapRevReqTBEX */ - 0x67, 0x2a, 0x00, 0x42, + 0x67, + 0x2a, + 0x00, + 0x42, /* NID_setct_CapRevResTBE */ - 0x67, 0x2a, 0x00, 0x43, + 0x67, + 0x2a, + 0x00, + 0x43, /* NID_setct_CredReqTBE */ - 0x67, 0x2a, 0x00, 0x44, + 0x67, + 0x2a, + 0x00, + 0x44, /* NID_setct_CredReqTBEX */ - 0x67, 0x2a, 0x00, 0x45, + 0x67, + 0x2a, + 0x00, + 0x45, /* NID_setct_CredResTBE */ - 0x67, 0x2a, 0x00, 0x46, + 0x67, + 0x2a, + 0x00, + 0x46, /* NID_setct_CredRevReqTBE */ - 0x67, 0x2a, 0x00, 0x47, + 0x67, + 0x2a, + 0x00, + 0x47, /* NID_setct_CredRevReqTBEX */ - 0x67, 0x2a, 0x00, 0x48, + 0x67, + 0x2a, + 0x00, + 0x48, /* NID_setct_CredRevResTBE */ - 0x67, 0x2a, 0x00, 0x49, + 0x67, + 0x2a, + 0x00, + 0x49, /* NID_setct_BatchAdminReqTBE */ - 0x67, 0x2a, 0x00, 0x4a, + 0x67, + 0x2a, + 0x00, + 0x4a, /* NID_setct_BatchAdminResTBE */ - 0x67, 0x2a, 0x00, 0x4b, + 0x67, + 0x2a, + 0x00, + 0x4b, /* NID_setct_RegFormReqTBE */ - 0x67, 0x2a, 0x00, 0x4c, + 0x67, + 0x2a, + 0x00, + 0x4c, /* NID_setct_CertReqTBE */ - 0x67, 0x2a, 0x00, 0x4d, + 0x67, + 0x2a, + 0x00, + 0x4d, /* NID_setct_CertReqTBEX */ - 0x67, 0x2a, 0x00, 0x4e, + 0x67, + 0x2a, + 0x00, + 0x4e, /* NID_setct_CertResTBE */ - 0x67, 0x2a, 0x00, 0x4f, + 0x67, + 0x2a, + 0x00, + 0x4f, /* NID_setct_CRLNotificationTBS */ - 0x67, 0x2a, 0x00, 0x50, + 0x67, + 0x2a, + 0x00, + 0x50, /* NID_setct_CRLNotificationResTBS */ - 0x67, 0x2a, 0x00, 0x51, + 0x67, + 0x2a, + 0x00, + 0x51, /* NID_setct_BCIDistributionTBS */ - 0x67, 0x2a, 0x00, 0x52, + 0x67, + 0x2a, + 0x00, + 0x52, /* NID_setext_genCrypt */ - 0x67, 0x2a, 0x01, 0x01, + 0x67, + 0x2a, + 0x01, + 0x01, /* NID_setext_miAuth */ - 0x67, 0x2a, 0x01, 0x03, + 0x67, + 0x2a, + 0x01, + 0x03, /* NID_setext_pinSecure */ - 0x67, 0x2a, 0x01, 0x04, + 0x67, + 0x2a, + 0x01, + 0x04, /* NID_setext_pinAny */ - 0x67, 0x2a, 0x01, 0x05, + 0x67, + 0x2a, + 0x01, + 0x05, /* NID_setext_track2 */ - 0x67, 0x2a, 0x01, 0x07, + 0x67, + 0x2a, + 0x01, + 0x07, /* NID_setext_cv */ - 0x67, 0x2a, 0x01, 0x08, + 0x67, + 0x2a, + 0x01, + 0x08, /* NID_set_policy_root */ - 0x67, 0x2a, 0x05, 0x00, + 0x67, + 0x2a, + 0x05, + 0x00, /* NID_setCext_hashedRoot */ - 0x67, 0x2a, 0x07, 0x00, + 0x67, + 0x2a, + 0x07, + 0x00, /* NID_setCext_certType */ - 0x67, 0x2a, 0x07, 0x01, + 0x67, + 0x2a, + 0x07, + 0x01, /* NID_setCext_merchData */ - 0x67, 0x2a, 0x07, 0x02, + 0x67, + 0x2a, + 0x07, + 0x02, /* NID_setCext_cCertRequired */ - 0x67, 0x2a, 0x07, 0x03, + 0x67, + 0x2a, + 0x07, + 0x03, /* NID_setCext_tunneling */ - 0x67, 0x2a, 0x07, 0x04, + 0x67, + 0x2a, + 0x07, + 0x04, /* NID_setCext_setExt */ - 0x67, 0x2a, 0x07, 0x05, + 0x67, + 0x2a, + 0x07, + 0x05, /* NID_setCext_setQualf */ - 0x67, 0x2a, 0x07, 0x06, + 0x67, + 0x2a, + 0x07, + 0x06, /* NID_setCext_PGWYcapabilities */ - 0x67, 0x2a, 0x07, 0x07, + 0x67, + 0x2a, + 0x07, + 0x07, /* NID_setCext_TokenIdentifier */ - 0x67, 0x2a, 0x07, 0x08, + 0x67, + 0x2a, + 0x07, + 0x08, /* NID_setCext_Track2Data */ - 0x67, 0x2a, 0x07, 0x09, + 0x67, + 0x2a, + 0x07, + 0x09, /* NID_setCext_TokenType */ - 0x67, 0x2a, 0x07, 0x0a, + 0x67, + 0x2a, + 0x07, + 0x0a, /* NID_setCext_IssuerCapabilities */ - 0x67, 0x2a, 0x07, 0x0b, + 0x67, + 0x2a, + 0x07, + 0x0b, /* NID_setAttr_Cert */ - 0x67, 0x2a, 0x03, 0x00, + 0x67, + 0x2a, + 0x03, + 0x00, /* NID_setAttr_PGWYcap */ - 0x67, 0x2a, 0x03, 0x01, + 0x67, + 0x2a, + 0x03, + 0x01, /* NID_setAttr_TokenType */ - 0x67, 0x2a, 0x03, 0x02, + 0x67, + 0x2a, + 0x03, + 0x02, /* NID_setAttr_IssCap */ - 0x67, 0x2a, 0x03, 0x03, + 0x67, + 0x2a, + 0x03, + 0x03, /* NID_set_rootKeyThumb */ - 0x67, 0x2a, 0x03, 0x00, 0x00, + 0x67, + 0x2a, + 0x03, + 0x00, + 0x00, /* NID_set_addPolicy */ - 0x67, 0x2a, 0x03, 0x00, 0x01, + 0x67, + 0x2a, + 0x03, + 0x00, + 0x01, /* NID_setAttr_Token_EMV */ - 0x67, 0x2a, 0x03, 0x02, 0x01, + 0x67, + 0x2a, + 0x03, + 0x02, + 0x01, /* NID_setAttr_Token_B0Prime */ - 0x67, 0x2a, 0x03, 0x02, 0x02, + 0x67, + 0x2a, + 0x03, + 0x02, + 0x02, /* NID_setAttr_IssCap_CVM */ - 0x67, 0x2a, 0x03, 0x03, 0x03, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, /* NID_setAttr_IssCap_T2 */ - 0x67, 0x2a, 0x03, 0x03, 0x04, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, /* NID_setAttr_IssCap_Sig */ - 0x67, 0x2a, 0x03, 0x03, 0x05, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, /* NID_setAttr_GenCryptgrm */ - 0x67, 0x2a, 0x03, 0x03, 0x03, 0x01, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, + 0x01, /* NID_setAttr_T2Enc */ - 0x67, 0x2a, 0x03, 0x03, 0x04, 0x01, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x01, /* NID_setAttr_T2cleartxt */ - 0x67, 0x2a, 0x03, 0x03, 0x04, 0x02, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x02, /* NID_setAttr_TokICCsig */ - 0x67, 0x2a, 0x03, 0x03, 0x05, 0x01, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x01, /* NID_setAttr_SecDevSig */ - 0x67, 0x2a, 0x03, 0x03, 0x05, 0x02, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x02, /* NID_set_brand_IATA_ATA */ - 0x67, 0x2a, 0x08, 0x01, + 0x67, + 0x2a, + 0x08, + 0x01, /* NID_set_brand_Diners */ - 0x67, 0x2a, 0x08, 0x1e, + 0x67, + 0x2a, + 0x08, + 0x1e, /* NID_set_brand_AmericanExpress */ - 0x67, 0x2a, 0x08, 0x22, + 0x67, + 0x2a, + 0x08, + 0x22, /* NID_set_brand_JCB */ - 0x67, 0x2a, 0x08, 0x23, + 0x67, + 0x2a, + 0x08, + 0x23, /* NID_set_brand_Visa */ - 0x67, 0x2a, 0x08, 0x04, + 0x67, + 0x2a, + 0x08, + 0x04, /* NID_set_brand_MasterCard */ - 0x67, 0x2a, 0x08, 0x05, + 0x67, + 0x2a, + 0x08, + 0x05, /* NID_set_brand_Novus */ - 0x67, 0x2a, 0x08, 0xae, 0x7b, + 0x67, + 0x2a, + 0x08, + 0xae, + 0x7b, /* NID_des_cdmf */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x0a, /* NID_rsaOAEPEncryptionSET */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x06, /* NID_international_organizations */ 0x67, /* NID_ms_smartcard_login */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x14, + 0x02, + 0x02, /* NID_ms_upn */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x03, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x14, + 0x02, + 0x03, /* NID_streetAddress */ - 0x55, 0x04, 0x09, + 0x55, + 0x04, + 0x09, /* NID_postalCode */ - 0x55, 0x04, 0x11, + 0x55, + 0x04, + 0x11, /* NID_id_ppl */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, /* NID_proxyCertInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0e, /* NID_id_ppl_anyLanguage */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, 0x00, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x00, /* NID_id_ppl_inheritAll */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x01, /* NID_name_constraints */ - 0x55, 0x1d, 0x1e, + 0x55, + 0x1d, + 0x1e, /* NID_Independent */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x02, /* NID_sha256WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0b, /* NID_sha384WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0c, /* NID_sha512WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0d, /* NID_sha224WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0e, /* NID_sha256 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x01, /* NID_sha384 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x02, /* NID_sha512 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x03, /* NID_sha224 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x04, /* NID_identified_organization */ 0x2b, /* NID_certicom_arc */ - 0x2b, 0x81, 0x04, + 0x2b, + 0x81, + 0x04, /* NID_wap */ - 0x67, 0x2b, + 0x67, + 0x2b, /* NID_wap_wsg */ - 0x67, 0x2b, 0x01, + 0x67, + 0x2b, + 0x01, /* NID_X9_62_id_characteristic_two_basis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, /* NID_X9_62_onBasis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x01, /* NID_X9_62_tpBasis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x02, /* NID_X9_62_ppBasis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x03, /* NID_X9_62_c2pnb163v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x01, /* NID_X9_62_c2pnb163v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x02, /* NID_X9_62_c2pnb163v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x03, /* NID_X9_62_c2pnb176v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x04, /* NID_X9_62_c2tnb191v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x05, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x05, /* NID_X9_62_c2tnb191v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x06, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x06, /* NID_X9_62_c2tnb191v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x07, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x07, /* NID_X9_62_c2onb191v4 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x08, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x08, /* NID_X9_62_c2onb191v5 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x09, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x09, /* NID_X9_62_c2pnb208w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0a, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0a, /* NID_X9_62_c2tnb239v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0b, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0b, /* NID_X9_62_c2tnb239v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0c, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0c, /* NID_X9_62_c2tnb239v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0d, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0d, /* NID_X9_62_c2onb239v4 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0e, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0e, /* NID_X9_62_c2onb239v5 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0f, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0f, /* NID_X9_62_c2pnb272w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x10, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x10, /* NID_X9_62_c2pnb304w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x11, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x11, /* NID_X9_62_c2tnb359v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x12, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x12, /* NID_X9_62_c2pnb368w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x13, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x13, /* NID_X9_62_c2tnb431r1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x14, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x14, /* NID_secp112r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x06, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x06, /* NID_secp112r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x07, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x07, /* NID_secp128r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1c, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1c, /* NID_secp128r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x1d, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1d, /* NID_secp160k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x09, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x09, /* NID_secp160r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x08, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x08, /* NID_secp160r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x1e, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1e, /* NID_secp192k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1f, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1f, /* NID_secp224k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x20, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x20, /* NID_secp224r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x21, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x21, /* NID_secp256k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x0a, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0a, /* NID_secp384r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x22, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x22, /* NID_secp521r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x23, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x23, /* NID_sect113r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x04, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x04, /* NID_sect113r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x05, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x05, /* NID_sect131r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x16, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x16, /* NID_sect131r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x17, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x17, /* NID_sect163k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x01, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x01, /* NID_sect163r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x02, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x02, /* NID_sect163r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x0f, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0f, /* NID_sect193r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x18, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x18, /* NID_sect193r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x19, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x19, /* NID_sect233k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1a, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1a, /* NID_sect233r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1b, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1b, /* NID_sect239k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x03, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x03, /* NID_sect283k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x10, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x10, /* NID_sect283r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x11, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x11, /* NID_sect409k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x24, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x24, /* NID_sect409r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x25, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x25, /* NID_sect571k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x26, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x26, /* NID_sect571r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x27, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x27, /* NID_wap_wsg_idm_ecid_wtls1 */ - 0x67, 0x2b, 0x01, 0x04, 0x01, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x01, /* NID_wap_wsg_idm_ecid_wtls3 */ - 0x67, 0x2b, 0x01, 0x04, 0x03, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x03, /* NID_wap_wsg_idm_ecid_wtls4 */ - 0x67, 0x2b, 0x01, 0x04, 0x04, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x04, /* NID_wap_wsg_idm_ecid_wtls5 */ - 0x67, 0x2b, 0x01, 0x04, 0x05, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x05, /* NID_wap_wsg_idm_ecid_wtls6 */ - 0x67, 0x2b, 0x01, 0x04, 0x06, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x06, /* NID_wap_wsg_idm_ecid_wtls7 */ - 0x67, 0x2b, 0x01, 0x04, 0x07, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x07, /* NID_wap_wsg_idm_ecid_wtls8 */ - 0x67, 0x2b, 0x01, 0x04, 0x08, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x08, /* NID_wap_wsg_idm_ecid_wtls9 */ - 0x67, 0x2b, 0x01, 0x04, 0x09, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x09, /* NID_wap_wsg_idm_ecid_wtls10 */ - 0x67, 0x2b, 0x01, 0x04, 0x0a, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0a, /* NID_wap_wsg_idm_ecid_wtls11 */ - 0x67, 0x2b, 0x01, 0x04, 0x0b, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0b, /* NID_wap_wsg_idm_ecid_wtls12 */ - 0x67, 0x2b, 0x01, 0x04, 0x0c, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0c, /* NID_any_policy */ - 0x55, 0x1d, 0x20, 0x00, + 0x55, + 0x1d, + 0x20, + 0x00, /* NID_policy_mappings */ - 0x55, 0x1d, 0x21, + 0x55, + 0x1d, + 0x21, /* NID_inhibit_any_policy */ - 0x55, 0x1d, 0x36, + 0x55, + 0x1d, + 0x36, /* NID_camellia_128_cbc */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x01, 0x02, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x02, /* NID_camellia_192_cbc */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x01, 0x03, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x03, /* NID_camellia_256_cbc */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x01, 0x04, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x04, /* NID_camellia_128_ecb */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x01, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x01, /* NID_camellia_192_ecb */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x15, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x15, /* NID_camellia_256_ecb */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x29, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x29, /* NID_camellia_128_cfb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x04, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x04, /* NID_camellia_192_cfb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x18, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x18, /* NID_camellia_256_cfb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x2c, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2c, /* NID_camellia_128_ofb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x03, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x03, /* NID_camellia_192_ofb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x17, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x17, /* NID_camellia_256_ofb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x2b, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2b, /* NID_subject_directory_attributes */ - 0x55, 0x1d, 0x09, + 0x55, + 0x1d, + 0x09, /* NID_issuing_distribution_point */ - 0x55, 0x1d, 0x1c, + 0x55, + 0x1d, + 0x1c, /* NID_certificate_issuer */ - 0x55, 0x1d, 0x1d, + 0x55, + 0x1d, + 0x1d, /* NID_kisa */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, /* NID_seed_ecb */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x03, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x03, /* NID_seed_cbc */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x04, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x04, /* NID_seed_ofb128 */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x06, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x06, /* NID_seed_cfb128 */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x05, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x05, /* NID_hmac_md5 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x08, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x01, /* NID_hmac_sha1 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x08, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x02, /* NID_id_PasswordBasedMAC */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0d, /* NID_id_DHBasedMac */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x1e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x1e, /* NID_id_it_suppLangTags */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x10, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x10, /* NID_caRepository */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x05, /* NID_id_smime_ct_compressedData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x09, /* NID_id_ct_asciiTextWithCRLF */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x1b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x1b, /* NID_id_aes128_wrap */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x05, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x05, /* NID_id_aes192_wrap */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x19, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x19, /* NID_id_aes256_wrap */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2d, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2d, /* NID_ecdsa_with_Recommended */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x02, /* NID_ecdsa_with_Specified */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, /* NID_ecdsa_with_SHA224 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x01, /* NID_ecdsa_with_SHA256 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x02, /* NID_ecdsa_with_SHA384 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x03, /* NID_ecdsa_with_SHA512 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x04, /* NID_hmacWithMD5 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x06, /* NID_hmacWithSHA224 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x08, /* NID_hmacWithSHA256 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x09, /* NID_hmacWithSHA384 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0a, /* NID_hmacWithSHA512 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0b, /* NID_dsa_with_SHA224 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x01, /* NID_dsa_with_SHA256 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x02, /* NID_whirlpool */ - 0x28, 0xcf, 0x06, 0x03, 0x00, 0x37, + 0x28, + 0xcf, + 0x06, + 0x03, + 0x00, + 0x37, /* NID_cryptopro */ - 0x2a, 0x85, 0x03, 0x02, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, /* NID_cryptocom */ - 0x2a, 0x85, 0x03, 0x02, 0x09, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, /* NID_id_GostR3411_94_with_GostR3410_2001 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x03, /* NID_id_GostR3411_94_with_GostR3410_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x04, /* NID_id_GostR3411_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x09, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x09, /* NID_id_HMACGostR3411_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x0a, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0a, /* NID_id_GostR3410_2001 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x13, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x13, /* NID_id_GostR3410_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, /* NID_id_Gost28147_89 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x15, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x15, /* NID_id_Gost28147_89_MAC */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x16, /* NID_id_GostR3411_94_prf */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x17, /* NID_id_GostR3410_2001DH */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x62, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x62, /* NID_id_GostR3410_94DH */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x63, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x63, /* NID_id_Gost28147_89_CryptoPro_KeyMeshing */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x0e, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x01, /* NID_id_Gost28147_89_None_KeyMeshing */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x0e, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x00, /* NID_id_GostR3411_94_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1e, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x00, /* NID_id_GostR3411_94_CryptoProParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1e, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x01, /* NID_id_Gost28147_89_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x00, /* NID_id_Gost28147_89_CryptoPro_A_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x01, /* NID_id_Gost28147_89_CryptoPro_B_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x02, /* NID_id_Gost28147_89_CryptoPro_C_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x03, /* NID_id_Gost28147_89_CryptoPro_D_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x04, /* NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x05, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x05, /* NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x06, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x06, /* NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x07, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x07, /* NID_id_GostR3410_94_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x00, /* NID_id_GostR3410_94_CryptoPro_A_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x02, /* NID_id_GostR3410_94_CryptoPro_B_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x03, /* NID_id_GostR3410_94_CryptoPro_C_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x04, /* NID_id_GostR3410_94_CryptoPro_D_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x05, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x05, /* NID_id_GostR3410_94_CryptoPro_XchA_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x21, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x01, /* NID_id_GostR3410_94_CryptoPro_XchB_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x21, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x02, /* NID_id_GostR3410_94_CryptoPro_XchC_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x21, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x03, /* NID_id_GostR3410_2001_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x00, /* NID_id_GostR3410_2001_CryptoPro_A_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x01, /* NID_id_GostR3410_2001_CryptoPro_B_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x02, /* NID_id_GostR3410_2001_CryptoPro_C_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x03, /* NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x24, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x00, /* NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x24, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x01, /* NID_id_GostR3410_94_a */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x01, /* NID_id_GostR3410_94_aBis */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x02, /* NID_id_GostR3410_94_b */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x03, /* NID_id_GostR3410_94_bBis */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x04, /* NID_id_Gost28147_89_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x06, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x06, + 0x01, /* NID_id_GostR3410_94_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x05, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x03, /* NID_id_GostR3410_2001_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x05, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x04, /* NID_id_GostR3411_94_with_GostR3410_94_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x03, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x03, /* NID_id_GostR3411_94_with_GostR3410_2001_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x03, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x04, /* NID_id_GostR3410_2001_ParamSet_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x08, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x08, + 0x01, /* NID_LocalKeySet */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x11, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x02, /* NID_freshest_crl */ - 0x55, 0x1d, 0x2e, + 0x55, + 0x1d, + 0x2e, /* NID_id_on_permanentIdentifier */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x08, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x03, /* NID_searchGuide */ - 0x55, 0x04, 0x0e, + 0x55, + 0x04, + 0x0e, /* NID_businessCategory */ - 0x55, 0x04, 0x0f, + 0x55, + 0x04, + 0x0f, /* NID_postalAddress */ - 0x55, 0x04, 0x10, + 0x55, + 0x04, + 0x10, /* NID_postOfficeBox */ - 0x55, 0x04, 0x12, + 0x55, + 0x04, + 0x12, /* NID_physicalDeliveryOfficeName */ - 0x55, 0x04, 0x13, + 0x55, + 0x04, + 0x13, /* NID_telephoneNumber */ - 0x55, 0x04, 0x14, + 0x55, + 0x04, + 0x14, /* NID_telexNumber */ - 0x55, 0x04, 0x15, + 0x55, + 0x04, + 0x15, /* NID_teletexTerminalIdentifier */ - 0x55, 0x04, 0x16, + 0x55, + 0x04, + 0x16, /* NID_facsimileTelephoneNumber */ - 0x55, 0x04, 0x17, + 0x55, + 0x04, + 0x17, /* NID_x121Address */ - 0x55, 0x04, 0x18, + 0x55, + 0x04, + 0x18, /* NID_internationaliSDNNumber */ - 0x55, 0x04, 0x19, + 0x55, + 0x04, + 0x19, /* NID_registeredAddress */ - 0x55, 0x04, 0x1a, + 0x55, + 0x04, + 0x1a, /* NID_destinationIndicator */ - 0x55, 0x04, 0x1b, + 0x55, + 0x04, + 0x1b, /* NID_preferredDeliveryMethod */ - 0x55, 0x04, 0x1c, + 0x55, + 0x04, + 0x1c, /* NID_presentationAddress */ - 0x55, 0x04, 0x1d, + 0x55, + 0x04, + 0x1d, /* NID_supportedApplicationContext */ - 0x55, 0x04, 0x1e, + 0x55, + 0x04, + 0x1e, /* NID_member */ - 0x55, 0x04, 0x1f, + 0x55, + 0x04, + 0x1f, /* NID_owner */ - 0x55, 0x04, 0x20, + 0x55, + 0x04, + 0x20, /* NID_roleOccupant */ - 0x55, 0x04, 0x21, + 0x55, + 0x04, + 0x21, /* NID_seeAlso */ - 0x55, 0x04, 0x22, + 0x55, + 0x04, + 0x22, /* NID_userPassword */ - 0x55, 0x04, 0x23, + 0x55, + 0x04, + 0x23, /* NID_userCertificate */ - 0x55, 0x04, 0x24, + 0x55, + 0x04, + 0x24, /* NID_cACertificate */ - 0x55, 0x04, 0x25, + 0x55, + 0x04, + 0x25, /* NID_authorityRevocationList */ - 0x55, 0x04, 0x26, + 0x55, + 0x04, + 0x26, /* NID_certificateRevocationList */ - 0x55, 0x04, 0x27, + 0x55, + 0x04, + 0x27, /* NID_crossCertificatePair */ - 0x55, 0x04, 0x28, + 0x55, + 0x04, + 0x28, /* NID_enhancedSearchGuide */ - 0x55, 0x04, 0x2f, + 0x55, + 0x04, + 0x2f, /* NID_protocolInformation */ - 0x55, 0x04, 0x30, + 0x55, + 0x04, + 0x30, /* NID_distinguishedName */ - 0x55, 0x04, 0x31, + 0x55, + 0x04, + 0x31, /* NID_uniqueMember */ - 0x55, 0x04, 0x32, + 0x55, + 0x04, + 0x32, /* NID_houseIdentifier */ - 0x55, 0x04, 0x33, + 0x55, + 0x04, + 0x33, /* NID_supportedAlgorithms */ - 0x55, 0x04, 0x34, + 0x55, + 0x04, + 0x34, /* NID_deltaRevocationList */ - 0x55, 0x04, 0x35, + 0x55, + 0x04, + 0x35, /* NID_dmdName */ - 0x55, 0x04, 0x36, + 0x55, + 0x04, + 0x36, /* NID_id_alg_PWRI_KEK */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x09, /* NID_aes_128_gcm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x06, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x06, /* NID_aes_128_ccm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x07, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x07, /* NID_id_aes128_wrap_pad */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x08, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x08, /* NID_aes_192_gcm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x1a, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1a, /* NID_aes_192_ccm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x1b, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1b, /* NID_id_aes192_wrap_pad */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x1c, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1c, /* NID_aes_256_gcm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2e, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2e, /* NID_aes_256_ccm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2f, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2f, /* NID_id_aes256_wrap_pad */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x30, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x30, /* NID_id_camellia128_wrap */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x03, 0x02, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x02, /* NID_id_camellia192_wrap */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x03, 0x03, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x03, /* NID_id_camellia256_wrap */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x03, 0x04, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x04, /* NID_anyExtendedKeyUsage */ - 0x55, 0x1d, 0x25, 0x00, + 0x55, + 0x1d, + 0x25, + 0x00, /* NID_mgf1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x08, /* NID_rsassaPss */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0a, /* NID_rsaesOaep */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x07, /* NID_dhpublicnumber */ - 0x2a, 0x86, 0x48, 0xce, 0x3e, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3e, + 0x02, + 0x01, /* NID_brainpoolP160r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x01, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x01, /* NID_brainpoolP160t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x02, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x02, /* NID_brainpoolP192r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x03, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x03, /* NID_brainpoolP192t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x04, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x04, /* NID_brainpoolP224r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x05, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x05, /* NID_brainpoolP224t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x06, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x06, /* NID_brainpoolP256r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x07, /* NID_brainpoolP256t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x08, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x08, /* NID_brainpoolP320r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x09, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x09, /* NID_brainpoolP320t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0a, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0a, /* NID_brainpoolP384r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0b, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0b, /* NID_brainpoolP384t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0c, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0c, /* NID_brainpoolP512r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0d, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0d, /* NID_brainpoolP512t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0e, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0e, /* NID_pSpecified */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x09, /* NID_dhSinglePass_stdDH_sha1kdf_scheme */ - 0x2b, 0x81, 0x05, 0x10, 0x86, 0x48, 0x3f, 0x00, 0x02, + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x02, /* NID_dhSinglePass_stdDH_sha224kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x00, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x00, /* NID_dhSinglePass_stdDH_sha256kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x01, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x01, /* NID_dhSinglePass_stdDH_sha384kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x02, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x02, /* NID_dhSinglePass_stdDH_sha512kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x03, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x03, /* NID_dhSinglePass_cofactorDH_sha1kdf_scheme */ - 0x2b, 0x81, 0x05, 0x10, 0x86, 0x48, 0x3f, 0x00, 0x03, + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x03, /* NID_dhSinglePass_cofactorDH_sha224kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x00, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x00, /* NID_dhSinglePass_cofactorDH_sha256kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x01, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x01, /* NID_dhSinglePass_cofactorDH_sha384kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x02, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x02, /* NID_dhSinglePass_cofactorDH_sha512kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x03, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x03, + /* NID_X25519 */ + 0x2b, + 0x65, + 0x6e, /* NID_ED25519 */ - 0x2b, 0x65, 0x70, + 0x2b, + 0x65, + 0x70, + /* NID_ED448 */ + 0x2b, + 0x65, + 0x71, + /* NID_X448 */ + 0x2b, + 0x65, + 0x6f, }; static const ASN1_OBJECT kObjects[NUM_NID] = { @@ -3442,8 +8755,8 @@ static const ASN1_OBJECT kObjects[NUM_NID] = { NID_dhSinglePass_cofactorDH_sha512kdf_scheme, 6, &kObjectData[6169], 0}, {"dh-std-kdf", "dh-std-kdf", NID_dh_std_kdf, 0, NULL, 0}, {"dh-cofactor-kdf", "dh-cofactor-kdf", NID_dh_cofactor_kdf, 0, NULL, 0}, - {"X25519", "X25519", NID_X25519, 0, NULL, 0}, - {"ED25519", "ED25519", NID_ED25519, 3, &kObjectData[6175], 0}, + {"X25519", "X25519", NID_X25519, 3, &kObjectData[6175], 0}, + {"ED25519", "ED25519", NID_ED25519, 3, &kObjectData[6178], 0}, {"ChaCha20-Poly1305", "chacha20-poly1305", NID_chacha20_poly1305, 0, NULL, 0}, {"KxRSA", "kx-rsa", NID_kx_rsa, 0, NULL, 0}, @@ -3454,9 +8767,12 @@ static const ASN1_OBJECT kObjects[NUM_NID] = { {"AuthPSK", "auth-psk", NID_auth_psk, 0, NULL, 0}, {"KxANY", "kx-any", NID_kx_any, 0, NULL, 0}, {"AuthANY", "auth-any", NID_auth_any, 0, NULL, 0}, + {"CECPQ2", "CECPQ2", NID_CECPQ2, 0, NULL, 0}, + {"ED448", "ED448", NID_ED448, 3, &kObjectData[6181], 0}, + {"X448", "X448", NID_X448, 3, &kObjectData[6184], 0}, }; -static const unsigned kNIDsInShortNameOrder[] = { +static const uint16_t kNIDsInShortNameOrder[] = { 364 /* AD_DVCS */, 419 /* AES-128-CBC */, 916 /* AES-128-CBC-HMAC-SHA1 */, @@ -3515,6 +8831,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 110 /* CAST5-CFB */, 109 /* CAST5-ECB */, 111 /* CAST5-OFB */, + 959 /* CECPQ2 */, 894 /* CMAC */, 13 /* CN */, 141 /* CRLReason */, @@ -3548,6 +8865,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 67 /* DSA-old */, 297 /* DVCS */, 949 /* ED25519 */, + 960 /* ED448 */, 99 /* GN */, 855 /* HMAC */, 780 /* HMAC-MD5 */, @@ -3649,6 +8967,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 458 /* UID */, 0 /* UNDEF */, 948 /* X25519 */, + 961 /* X448 */, 11 /* X500 */, 378 /* X500algorithms */, 12 /* X509 */, @@ -4408,7 +9727,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 160 /* x509Crl */, }; -static const unsigned kNIDsInLongNameOrder[] = { +static const uint16_t kNIDsInLongNameOrder[] = { 363 /* AD Time Stamping */, 405 /* ANSI X9.62 */, 368 /* Acceptable OCSP Responses */, @@ -4419,12 +9738,14 @@ static const unsigned kNIDsInLongNameOrder[] = { 285 /* Biometric Info */, 179 /* CA Issuers */, 785 /* CA Repository */, + 959 /* CECPQ2 */, 131 /* Code Signing */, 783 /* Diffie-Hellman based MAC */, 382 /* Directory */, 392 /* Domain */, 132 /* E-mail Protection */, 949 /* ED25519 */, + 960 /* ED448 */, 389 /* Enterprises */, 384 /* Experimental */, 372 /* Extended OCSP Status */, @@ -4517,6 +9838,7 @@ static const unsigned kNIDsInLongNameOrder[] = { 133 /* Time Stamping */, 375 /* Trust Root */, 948 /* X25519 */, + 961 /* X448 */, 12 /* X509 */, 402 /* X509v3 AC Targeting */, 746 /* X509v3 Any Policy */, @@ -5360,7 +10682,7 @@ static const unsigned kNIDsInLongNameOrder[] = { 125 /* zlib compression */, }; -static const unsigned kNIDsInOIDOrder[] = { +static const uint16_t kNIDsInOIDOrder[] = { 434 /* 0.9 (OBJ_data) */, 182 /* 1.2 (OBJ_member_body) */, 379 /* 1.3 (OBJ_org) */, @@ -5376,7 +10698,10 @@ static const unsigned kNIDsInOIDOrder[] = { 435 /* 0.9.2342 (OBJ_pss) */, 183 /* 1.2.840 (OBJ_ISO_US) */, 381 /* 1.3.6.1 (OBJ_iana) */, + 948 /* 1.3.101.110 (OBJ_X25519) */, + 961 /* 1.3.101.111 (OBJ_X448) */, 949 /* 1.3.101.112 (OBJ_ED25519) */, + 960 /* 1.3.101.113 (OBJ_ED448) */, 677 /* 1.3.132 (OBJ_certicom_arc) */, 394 /* 2.5.1.5 (OBJ_selected_attribute_types) */, 13 /* 2.5.4.3 (OBJ_commonName) */, @@ -5708,9 +11033,11 @@ static const unsigned kNIDsInOIDOrder[] = { 825 /* 1.2.643.2.2.31.2 (OBJ_id_Gost28147_89_CryptoPro_B_ParamSet) */, 826 /* 1.2.643.2.2.31.3 (OBJ_id_Gost28147_89_CryptoPro_C_ParamSet) */, 827 /* 1.2.643.2.2.31.4 (OBJ_id_Gost28147_89_CryptoPro_D_ParamSet) */, - 828 /* 1.2.643.2.2.31.5 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet) */ + 828 /* 1.2.643.2.2.31.5 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet) + */ , - 829 /* 1.2.643.2.2.31.6 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet) */ + 829 /* 1.2.643.2.2.31.6 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet) + */ , 830 /* 1.2.643.2.2.31.7 (OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet) */, 831 /* 1.2.643.2.2.32.0 (OBJ_id_GostR3410_94_TestParamSet) */, diff --git a/Pods/BoringSSL-GRPC/crypto/obj/obj_dat.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h.grpc_back similarity index 78% rename from Pods/BoringSSL-GRPC/crypto/obj/obj_dat.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h.grpc_back index dceaf03df..888ea676e 100644 --- a/Pods/BoringSSL-GRPC/crypto/obj/obj_dat.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/obj/obj_dat.h.grpc_back @@ -57,1763 +57,7076 @@ /* This file is generated by crypto/obj/objects.go. */ -#define NUM_NID 959 +#define NUM_NID 962 static const uint8_t kObjectData[] = { /* NID_rsadsi */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, /* NID_pkcs */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, /* NID_md2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x02, /* NID_md5 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x05, /* NID_rc4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x04, /* NID_rsaEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x01, /* NID_md2WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x02, /* NID_md5WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x04, /* NID_pbeWithMD2AndDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x01, /* NID_pbeWithMD5AndDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x03, /* NID_X500 */ 0x55, /* NID_X509 */ - 0x55, 0x04, + 0x55, + 0x04, /* NID_commonName */ - 0x55, 0x04, 0x03, + 0x55, + 0x04, + 0x03, /* NID_countryName */ - 0x55, 0x04, 0x06, + 0x55, + 0x04, + 0x06, /* NID_localityName */ - 0x55, 0x04, 0x07, + 0x55, + 0x04, + 0x07, /* NID_stateOrProvinceName */ - 0x55, 0x04, 0x08, + 0x55, + 0x04, + 0x08, /* NID_organizationName */ - 0x55, 0x04, 0x0a, + 0x55, + 0x04, + 0x0a, /* NID_organizationalUnitName */ - 0x55, 0x04, 0x0b, + 0x55, + 0x04, + 0x0b, /* NID_rsa */ - 0x55, 0x08, 0x01, 0x01, + 0x55, + 0x08, + 0x01, + 0x01, /* NID_pkcs7 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, /* NID_pkcs7_data */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x01, /* NID_pkcs7_signed */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x02, /* NID_pkcs7_enveloped */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x03, /* NID_pkcs7_signedAndEnveloped */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x04, /* NID_pkcs7_digest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x05, /* NID_pkcs7_encrypted */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x07, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x07, + 0x06, /* NID_pkcs3 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, /* NID_dhKeyAgreement */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x03, + 0x01, /* NID_des_ecb */ - 0x2b, 0x0e, 0x03, 0x02, 0x06, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x06, /* NID_des_cfb64 */ - 0x2b, 0x0e, 0x03, 0x02, 0x09, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x09, /* NID_des_cbc */ - 0x2b, 0x0e, 0x03, 0x02, 0x07, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x07, /* NID_des_ede_ecb */ - 0x2b, 0x0e, 0x03, 0x02, 0x11, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x11, /* NID_idea_cbc */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x81, 0x3c, 0x07, 0x01, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x81, + 0x3c, + 0x07, + 0x01, + 0x01, + 0x02, /* NID_rc2_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x02, /* NID_sha */ - 0x2b, 0x0e, 0x03, 0x02, 0x12, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x12, /* NID_shaWithRSAEncryption */ - 0x2b, 0x0e, 0x03, 0x02, 0x0f, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0f, /* NID_des_ede3_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x07, /* NID_des_ofb64 */ - 0x2b, 0x0e, 0x03, 0x02, 0x08, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x08, /* NID_pkcs9 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, /* NID_pkcs9_emailAddress */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x01, /* NID_pkcs9_unstructuredName */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x02, /* NID_pkcs9_contentType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x03, /* NID_pkcs9_messageDigest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x04, /* NID_pkcs9_signingTime */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x05, /* NID_pkcs9_countersignature */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x06, /* NID_pkcs9_challengePassword */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x07, /* NID_pkcs9_unstructuredAddress */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x08, /* NID_pkcs9_extCertAttributes */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x09, /* NID_netscape */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, /* NID_netscape_cert_extension */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, /* NID_netscape_data_type */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, /* NID_sha1 */ - 0x2b, 0x0e, 0x03, 0x02, 0x1a, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1a, /* NID_sha1WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x05, /* NID_dsaWithSHA */ - 0x2b, 0x0e, 0x03, 0x02, 0x0d, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0d, /* NID_dsa_2 */ - 0x2b, 0x0e, 0x03, 0x02, 0x0c, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0c, /* NID_pbeWithSHA1AndRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0b, /* NID_id_pbkdf2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0c, /* NID_dsaWithSHA1_2 */ - 0x2b, 0x0e, 0x03, 0x02, 0x1b, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1b, /* NID_netscape_cert_type */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x01, /* NID_netscape_base_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x02, /* NID_netscape_revocation_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x03, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x03, /* NID_netscape_ca_revocation_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x04, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x04, /* NID_netscape_renewal_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x07, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x07, /* NID_netscape_ca_policy_url */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x08, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x08, /* NID_netscape_ssl_server_name */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0c, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0c, /* NID_netscape_comment */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x01, 0x0d, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x01, + 0x0d, /* NID_netscape_cert_sequence */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x02, 0x05, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x02, + 0x05, /* NID_id_ce */ - 0x55, 0x1d, + 0x55, + 0x1d, /* NID_subject_key_identifier */ - 0x55, 0x1d, 0x0e, + 0x55, + 0x1d, + 0x0e, /* NID_key_usage */ - 0x55, 0x1d, 0x0f, + 0x55, + 0x1d, + 0x0f, /* NID_private_key_usage_period */ - 0x55, 0x1d, 0x10, + 0x55, + 0x1d, + 0x10, /* NID_subject_alt_name */ - 0x55, 0x1d, 0x11, + 0x55, + 0x1d, + 0x11, /* NID_issuer_alt_name */ - 0x55, 0x1d, 0x12, + 0x55, + 0x1d, + 0x12, /* NID_basic_constraints */ - 0x55, 0x1d, 0x13, + 0x55, + 0x1d, + 0x13, /* NID_crl_number */ - 0x55, 0x1d, 0x14, + 0x55, + 0x1d, + 0x14, /* NID_certificate_policies */ - 0x55, 0x1d, 0x20, + 0x55, + 0x1d, + 0x20, /* NID_authority_key_identifier */ - 0x55, 0x1d, 0x23, + 0x55, + 0x1d, + 0x23, /* NID_bf_cbc */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x97, 0x55, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x97, + 0x55, + 0x01, + 0x02, /* NID_mdc2 */ - 0x55, 0x08, 0x03, 0x65, + 0x55, + 0x08, + 0x03, + 0x65, /* NID_mdc2WithRSA */ - 0x55, 0x08, 0x03, 0x64, + 0x55, + 0x08, + 0x03, + 0x64, /* NID_givenName */ - 0x55, 0x04, 0x2a, + 0x55, + 0x04, + 0x2a, /* NID_surname */ - 0x55, 0x04, 0x04, + 0x55, + 0x04, + 0x04, /* NID_initials */ - 0x55, 0x04, 0x2b, + 0x55, + 0x04, + 0x2b, /* NID_crl_distribution_points */ - 0x55, 0x1d, 0x1f, + 0x55, + 0x1d, + 0x1f, /* NID_md5WithRSA */ - 0x2b, 0x0e, 0x03, 0x02, 0x03, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x03, /* NID_serialNumber */ - 0x55, 0x04, 0x05, + 0x55, + 0x04, + 0x05, /* NID_title */ - 0x55, 0x04, 0x0c, + 0x55, + 0x04, + 0x0c, /* NID_description */ - 0x55, 0x04, 0x0d, + 0x55, + 0x04, + 0x0d, /* NID_cast5_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0a, /* NID_pbeWithMD5AndCast5_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0c, /* NID_dsaWithSHA1 */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x03, /* NID_sha1WithRSA */ - 0x2b, 0x0e, 0x03, 0x02, 0x1d, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x1d, /* NID_dsa */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, + 0x01, /* NID_ripemd160 */ - 0x2b, 0x24, 0x03, 0x02, 0x01, + 0x2b, + 0x24, + 0x03, + 0x02, + 0x01, /* NID_ripemd160WithRSA */ - 0x2b, 0x24, 0x03, 0x03, 0x01, 0x02, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x01, + 0x02, /* NID_rc5_cbc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x08, /* NID_zlib_compression */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x08, /* NID_ext_key_usage */ - 0x55, 0x1d, 0x25, + 0x55, + 0x1d, + 0x25, /* NID_id_pkix */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, /* NID_id_kp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, /* NID_server_auth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x01, /* NID_client_auth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x02, /* NID_code_sign */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x03, /* NID_email_protect */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x04, /* NID_time_stamp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x08, /* NID_ms_code_ind */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x15, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x15, /* NID_ms_code_com */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x16, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x16, /* NID_ms_ctl_sign */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x01, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x01, /* NID_ms_sgc */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x03, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x03, /* NID_ms_efs */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x0a, 0x03, 0x04, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x0a, + 0x03, + 0x04, /* NID_ns_sgc */ - 0x60, 0x86, 0x48, 0x01, 0x86, 0xf8, 0x42, 0x04, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x86, + 0xf8, + 0x42, + 0x04, + 0x01, /* NID_delta_crl */ - 0x55, 0x1d, 0x1b, + 0x55, + 0x1d, + 0x1b, /* NID_crl_reason */ - 0x55, 0x1d, 0x15, + 0x55, + 0x1d, + 0x15, /* NID_invalidity_date */ - 0x55, 0x1d, 0x18, + 0x55, + 0x1d, + 0x18, /* NID_sxnet */ - 0x2b, 0x65, 0x01, 0x04, 0x01, + 0x2b, + 0x65, + 0x01, + 0x04, + 0x01, /* NID_pbe_WithSHA1And128BitRC4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x01, /* NID_pbe_WithSHA1And40BitRC4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x02, /* NID_pbe_WithSHA1And3_Key_TripleDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x03, /* NID_pbe_WithSHA1And2_Key_TripleDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x04, /* NID_pbe_WithSHA1And128BitRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x05, /* NID_pbe_WithSHA1And40BitRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x01, + 0x06, /* NID_keyBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x01, /* NID_pkcs8ShroudedKeyBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x02, /* NID_certBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x03, /* NID_crlBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x04, /* NID_secretBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x05, /* NID_safeContentsBag */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x0c, + 0x0a, + 0x01, + 0x06, /* NID_friendlyName */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x14, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x14, /* NID_localKeyID */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x15, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x15, /* NID_x509Certificate */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x16, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x01, /* NID_sdsiCertificate */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x16, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x16, + 0x02, /* NID_x509Crl */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x17, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x17, + 0x01, /* NID_pbes2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0d, /* NID_pbmac1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0e, /* NID_hmacWithSHA1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x07, /* NID_id_qt_cps */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x01, /* NID_id_qt_unotice */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x02, /* NID_SMIMECapabilities */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0f, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0f, /* NID_pbeWithMD2AndRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x04, /* NID_pbeWithMD5AndRC2_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x06, /* NID_pbeWithSHA1AndDES_CBC */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, + 0x0a, /* NID_ms_ext_req */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x02, + 0x01, + 0x0e, /* NID_ext_req */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x0e, /* NID_name */ - 0x55, 0x04, 0x29, + 0x55, + 0x04, + 0x29, /* NID_dnQualifier */ - 0x55, 0x04, 0x2e, + 0x55, + 0x04, + 0x2e, /* NID_id_pe */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, /* NID_id_ad */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, /* NID_info_access */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x01, /* NID_ad_OCSP */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, /* NID_ad_ca_issuers */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x02, /* NID_OCSP_sign */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x09, /* NID_member_body */ 0x2a, /* NID_ISO_US */ - 0x2a, 0x86, 0x48, + 0x2a, + 0x86, + 0x48, /* NID_X9_57 */ - 0x2a, 0x86, 0x48, 0xce, 0x38, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, /* NID_X9cm */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x04, /* NID_pkcs1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, /* NID_pkcs5 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x05, /* NID_SMIME */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, /* NID_id_smime_mod */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, /* NID_id_smime_ct */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, /* NID_id_smime_aa */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, /* NID_id_smime_alg */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, /* NID_id_smime_cd */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x04, /* NID_id_smime_spq */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, /* NID_id_smime_cti */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, /* NID_id_smime_mod_cms */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x01, /* NID_id_smime_mod_ess */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x02, /* NID_id_smime_mod_oid */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x03, /* NID_id_smime_mod_msg_v3 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x04, /* NID_id_smime_mod_ets_eSignature_88 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x05, /* NID_id_smime_mod_ets_eSignature_97 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x06, /* NID_id_smime_mod_ets_eSigPolicy_88 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x07, /* NID_id_smime_mod_ets_eSigPolicy_97 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x00, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x00, + 0x08, /* NID_id_smime_ct_receipt */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x01, /* NID_id_smime_ct_authData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x02, /* NID_id_smime_ct_publishCert */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x03, /* NID_id_smime_ct_TSTInfo */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x04, /* NID_id_smime_ct_TDTInfo */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x05, /* NID_id_smime_ct_contentInfo */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x06, /* NID_id_smime_ct_DVCSRequestData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x07, /* NID_id_smime_ct_DVCSResponseData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x08, /* NID_id_smime_aa_receiptRequest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x01, /* NID_id_smime_aa_securityLabel */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x02, /* NID_id_smime_aa_mlExpandHistory */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x03, /* NID_id_smime_aa_contentHint */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x04, /* NID_id_smime_aa_msgSigDigest */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x05, /* NID_id_smime_aa_encapContentType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x06, /* NID_id_smime_aa_contentIdentifier */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x07, /* NID_id_smime_aa_macValue */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x08, /* NID_id_smime_aa_equivalentLabels */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x09, /* NID_id_smime_aa_contentReference */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0a, /* NID_id_smime_aa_encrypKeyPref */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0b, /* NID_id_smime_aa_signingCertificate */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0c, /* NID_id_smime_aa_smimeEncryptCerts */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0d, /* NID_id_smime_aa_timeStampToken */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0e, /* NID_id_smime_aa_ets_sigPolicyId */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x0f, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x0f, /* NID_id_smime_aa_ets_commitmentType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x10, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x10, /* NID_id_smime_aa_ets_signerLocation */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x11, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x11, /* NID_id_smime_aa_ets_signerAttr */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x12, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x12, /* NID_id_smime_aa_ets_otherSigCert */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x13, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x13, /* NID_id_smime_aa_ets_contentTimestamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x14, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x14, /* NID_id_smime_aa_ets_CertificateRefs */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x15, - /* NID_id_smime_aa_ets_RevocationRefs */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x16, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x15, + /* NID_id_smime_aa_ets_RevocationRefs */ + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x16, /* NID_id_smime_aa_ets_certValues */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x17, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x17, /* NID_id_smime_aa_ets_revocationValues */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x18, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x18, /* NID_id_smime_aa_ets_escTimeStamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x19, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x19, /* NID_id_smime_aa_ets_certCRLTimestamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1a, /* NID_id_smime_aa_ets_archiveTimeStamp */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1b, /* NID_id_smime_aa_signatureType */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1c, /* NID_id_smime_aa_dvcs_dvc */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x02, 0x1d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x02, + 0x1d, /* NID_id_smime_alg_ESDHwith3DES */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x01, /* NID_id_smime_alg_ESDHwithRC2 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x02, /* NID_id_smime_alg_3DESwrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x03, /* NID_id_smime_alg_RC2wrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x04, /* NID_id_smime_alg_ESDH */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x05, /* NID_id_smime_alg_CMS3DESwrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x06, /* NID_id_smime_alg_CMSRC2wrap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x07, /* NID_id_smime_cd_ldap */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x04, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x04, + 0x01, /* NID_id_smime_spq_ets_sqt_uri */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x05, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, + 0x01, /* NID_id_smime_spq_ets_sqt_unotice */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x05, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x05, + 0x02, /* NID_id_smime_cti_ets_proofOfOrigin */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x01, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x01, /* NID_id_smime_cti_ets_proofOfReceipt */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x02, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x02, /* NID_id_smime_cti_ets_proofOfDelivery */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x03, /* NID_id_smime_cti_ets_proofOfSender */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x04, /* NID_id_smime_cti_ets_proofOfApproval */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x05, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x05, /* NID_id_smime_cti_ets_proofOfCreation */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x06, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x06, + 0x06, /* NID_md4 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x04, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x04, /* NID_id_pkix_mod */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, /* NID_id_qt */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, /* NID_id_it */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, /* NID_id_pkip */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, /* NID_id_alg */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, /* NID_id_cmc */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, /* NID_id_on */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, /* NID_id_pda */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, /* NID_id_aca */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, /* NID_id_qcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, /* NID_id_cct */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, /* NID_id_pkix1_explicit_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x01, /* NID_id_pkix1_implicit_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x02, /* NID_id_pkix1_explicit_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x03, /* NID_id_pkix1_implicit_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x04, /* NID_id_mod_crmf */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x05, /* NID_id_mod_cmc */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x06, /* NID_id_mod_kea_profile_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x07, /* NID_id_mod_kea_profile_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x08, /* NID_id_mod_cmp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x09, /* NID_id_mod_qualified_cert_88 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0a, /* NID_id_mod_qualified_cert_93 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0b, /* NID_id_mod_attribute_cert */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0c, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0c, /* NID_id_mod_timestamp_protocol */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0d, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0d, /* NID_id_mod_ocsp */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0e, /* NID_id_mod_dvcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x0f, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x0f, /* NID_id_mod_cmp2000 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x00, 0x10, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x00, + 0x10, /* NID_biometricInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x02, /* NID_qcStatements */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x03, /* NID_ac_auditEntity */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x04, /* NID_ac_targeting */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x05, /* NID_aaControls */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x06, /* NID_sbgp_ipAddrBlock */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x07, /* NID_sbgp_autonomousSysNum */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x08, /* NID_sbgp_routerIdentifier */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x09, /* NID_textNotice */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x02, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x02, + 0x03, /* NID_ipsecEndSystem */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x05, /* NID_ipsecTunnel */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x06, /* NID_ipsecUser */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x07, /* NID_dvcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x03, + 0x0a, /* NID_id_it_caProtEncCert */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x01, /* NID_id_it_signKeyPairTypes */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x02, /* NID_id_it_encKeyPairTypes */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x03, /* NID_id_it_preferredSymmAlg */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x04, /* NID_id_it_caKeyUpdateInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x05, /* NID_id_it_currentCRL */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x06, /* NID_id_it_unsupportedOIDs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x07, /* NID_id_it_subscriptionRequest */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x08, /* NID_id_it_subscriptionResponse */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x09, /* NID_id_it_keyPairParamReq */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0a, /* NID_id_it_keyPairParamRep */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0b, /* NID_id_it_revPassphrase */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0c, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0c, /* NID_id_it_implicitConfirm */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0d, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0d, /* NID_id_it_confirmWaitTime */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0e, /* NID_id_it_origPKIMessage */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x0f, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x0f, /* NID_id_regCtrl */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, /* NID_id_regInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, /* NID_id_regCtrl_regToken */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x01, /* NID_id_regCtrl_authenticator */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x02, /* NID_id_regCtrl_pkiPublicationInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x03, /* NID_id_regCtrl_pkiArchiveOptions */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x04, /* NID_id_regCtrl_oldCertID */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x05, /* NID_id_regCtrl_protocolEncrKey */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x01, + 0x06, /* NID_id_regInfo_utf8Pairs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x02, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x01, /* NID_id_regInfo_certReq */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x05, 0x02, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x05, + 0x02, + 0x02, /* NID_id_alg_des40 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x01, /* NID_id_alg_noSignature */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x02, /* NID_id_alg_dh_sig_hmac_sha1 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x03, /* NID_id_alg_dh_pop */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x06, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x06, + 0x04, /* NID_id_cmc_statusInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x01, /* NID_id_cmc_identification */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x02, /* NID_id_cmc_identityProof */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x03, /* NID_id_cmc_dataReturn */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x04, /* NID_id_cmc_transactionId */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x05, /* NID_id_cmc_senderNonce */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x06, /* NID_id_cmc_recipientNonce */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x07, /* NID_id_cmc_addExtensions */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x08, /* NID_id_cmc_encryptedPOP */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x09, /* NID_id_cmc_decryptedPOP */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0a, /* NID_id_cmc_lraPOPWitness */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0b, /* NID_id_cmc_getCert */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x0f, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x0f, /* NID_id_cmc_getCRL */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x10, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x10, /* NID_id_cmc_revokeRequest */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x11, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x11, /* NID_id_cmc_regInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x12, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x12, /* NID_id_cmc_responseInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x13, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x13, /* NID_id_cmc_queryPending */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x15, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x15, /* NID_id_cmc_popLinkRandom */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x16, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x16, /* NID_id_cmc_popLinkWitness */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x17, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x17, /* NID_id_cmc_confirmCertAcceptance */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x07, 0x18, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x07, + 0x18, /* NID_id_on_personalData */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x08, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x01, /* NID_id_pda_dateOfBirth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x01, /* NID_id_pda_placeOfBirth */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x02, /* NID_id_pda_gender */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x03, /* NID_id_pda_countryOfCitizenship */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x04, /* NID_id_pda_countryOfResidence */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x09, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x09, + 0x05, /* NID_id_aca_authenticationInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x01, /* NID_id_aca_accessIdentity */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x02, /* NID_id_aca_chargingIdentity */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x03, /* NID_id_aca_group */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x04, /* NID_id_aca_role */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x05, /* NID_id_qcs_pkixQCSyntax_v1 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0b, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0b, + 0x01, /* NID_id_cct_crs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x01, /* NID_id_cct_PKIData */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x02, /* NID_id_cct_PKIResponse */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0c, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0c, + 0x03, /* NID_ad_timeStamping */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x03, /* NID_ad_dvcs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x04, /* NID_id_pkix_OCSP_basic */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x01, /* NID_id_pkix_OCSP_Nonce */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x02, /* NID_id_pkix_OCSP_CrlID */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x03, /* NID_id_pkix_OCSP_acceptableResponses */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x04, /* NID_id_pkix_OCSP_noCheck */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x05, /* NID_id_pkix_OCSP_archiveCutoff */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x06, /* NID_id_pkix_OCSP_serviceLocator */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x07, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x07, /* NID_id_pkix_OCSP_extendedStatus */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x08, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x08, /* NID_id_pkix_OCSP_valid */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x09, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x09, /* NID_id_pkix_OCSP_path */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0a, /* NID_id_pkix_OCSP_trustRoot */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x01, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x01, + 0x0b, /* NID_algorithm */ - 0x2b, 0x0e, 0x03, 0x02, + 0x2b, + 0x0e, + 0x03, + 0x02, /* NID_rsaSignature */ - 0x2b, 0x0e, 0x03, 0x02, 0x0b, + 0x2b, + 0x0e, + 0x03, + 0x02, + 0x0b, /* NID_X500algorithms */ - 0x55, 0x08, + 0x55, + 0x08, /* NID_org */ 0x2b, /* NID_dod */ - 0x2b, 0x06, + 0x2b, + 0x06, /* NID_iana */ - 0x2b, 0x06, 0x01, + 0x2b, + 0x06, + 0x01, /* NID_Directory */ - 0x2b, 0x06, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x01, /* NID_Management */ - 0x2b, 0x06, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x02, /* NID_Experimental */ - 0x2b, 0x06, 0x01, 0x03, + 0x2b, + 0x06, + 0x01, + 0x03, /* NID_Private */ - 0x2b, 0x06, 0x01, 0x04, + 0x2b, + 0x06, + 0x01, + 0x04, /* NID_Security */ - 0x2b, 0x06, 0x01, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, /* NID_SNMPv2 */ - 0x2b, 0x06, 0x01, 0x06, + 0x2b, + 0x06, + 0x01, + 0x06, /* NID_Mail */ - 0x2b, 0x06, 0x01, 0x07, + 0x2b, + 0x06, + 0x01, + 0x07, /* NID_Enterprises */ - 0x2b, 0x06, 0x01, 0x04, 0x01, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, /* NID_dcObject */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x8b, 0x3a, 0x82, 0x58, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x8b, + 0x3a, + 0x82, + 0x58, /* NID_domainComponent */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x19, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x19, /* NID_Domain */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x0d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0d, /* NID_selected_attribute_types */ - 0x55, 0x01, 0x05, + 0x55, + 0x01, + 0x05, /* NID_clearance */ - 0x55, 0x01, 0x05, 0x37, + 0x55, + 0x01, + 0x05, + 0x37, /* NID_md4WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x03, /* NID_ac_proxying */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0a, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0a, /* NID_sinfo_access */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0b, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0b, /* NID_id_aca_encAttrs */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x06, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x0a, + 0x06, /* NID_role */ - 0x55, 0x04, 0x48, + 0x55, + 0x04, + 0x48, /* NID_policy_constraints */ - 0x55, 0x1d, 0x24, + 0x55, + 0x1d, + 0x24, /* NID_target_information */ - 0x55, 0x1d, 0x37, + 0x55, + 0x1d, + 0x37, /* NID_no_rev_avail */ - 0x55, 0x1d, 0x38, + 0x55, + 0x1d, + 0x38, /* NID_ansi_X9_62 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, /* NID_X9_62_prime_field */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x01, /* NID_X9_62_characteristic_two_field */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, /* NID_X9_62_id_ecPublicKey */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x02, + 0x01, /* NID_X9_62_prime192v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x01, /* NID_X9_62_prime192v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x02, /* NID_X9_62_prime192v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x03, /* NID_X9_62_prime239v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x04, /* NID_X9_62_prime239v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x05, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x05, /* NID_X9_62_prime239v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x06, /* NID_X9_62_prime256v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x01, + 0x07, /* NID_ecdsa_with_SHA1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x01, /* NID_ms_csp_name */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x11, 0x01, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x01, /* NID_aes_128_ecb */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x01, /* NID_aes_128_cbc */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x02, /* NID_aes_128_ofb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x03, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x03, /* NID_aes_128_cfb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x04, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x04, /* NID_aes_192_ecb */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x15, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x15, /* NID_aes_192_cbc */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x16, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x16, /* NID_aes_192_ofb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x17, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x17, /* NID_aes_192_cfb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x18, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x18, /* NID_aes_256_ecb */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x29, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x29, /* NID_aes_256_cbc */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2a, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2a, /* NID_aes_256_ofb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2b, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2b, /* NID_aes_256_cfb128 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2c, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2c, /* NID_hold_instruction_code */ - 0x55, 0x1d, 0x17, + 0x55, + 0x1d, + 0x17, /* NID_hold_instruction_none */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x01, /* NID_hold_instruction_call_issuer */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x02, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x02, /* NID_hold_instruction_reject */ - 0x2a, 0x86, 0x48, 0xce, 0x38, 0x02, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x38, + 0x02, + 0x03, /* NID_data */ 0x09, /* NID_pss */ - 0x09, 0x92, 0x26, + 0x09, + 0x92, + 0x26, /* NID_ucl */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, /* NID_pilot */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, /* NID_pilotAttributeType */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, /* NID_pilotAttributeSyntax */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x03, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, /* NID_pilotObjectClass */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, /* NID_pilotGroups */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x0a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x0a, /* NID_iA5StringSyntax */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x03, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x04, /* NID_caseIgnoreIA5StringSyntax */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x03, 0x05, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x03, + 0x05, /* NID_pilotObject */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x03, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x03, /* NID_pilotPerson */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x04, /* NID_account */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x05, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x05, /* NID_document */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x06, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x06, /* NID_room */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x07, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x07, /* NID_documentSeries */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x09, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x09, /* NID_rFC822localPart */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x0e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0e, /* NID_dNSDomain */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x0f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x0f, /* NID_domainRelatedObject */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x11, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x11, /* NID_friendlyCountry */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x12, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x12, /* NID_simpleSecurityObject */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x13, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x13, /* NID_pilotOrganization */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x14, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x14, /* NID_pilotDSA */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x15, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x15, /* NID_qualityLabelledData */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x04, 0x16, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x04, + 0x16, /* NID_userId */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x01, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x01, /* NID_textEncodedORAddress */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x02, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x02, /* NID_rfc822Mailbox */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x03, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x03, /* NID_info */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x04, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x04, /* NID_favouriteDrink */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x05, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x05, /* NID_roomNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x06, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x06, /* NID_photo */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x07, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x07, /* NID_userClass */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x08, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x08, /* NID_host */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x09, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x09, /* NID_manager */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0a, /* NID_documentIdentifier */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0b, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0b, /* NID_documentTitle */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0c, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0c, /* NID_documentVersion */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0d, /* NID_documentAuthor */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0e, /* NID_documentLocation */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x0f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x0f, /* NID_homeTelephoneNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x14, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x14, /* NID_secretary */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x15, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x15, /* NID_otherMailbox */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x16, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x16, /* NID_lastModifiedTime */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x17, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x17, /* NID_lastModifiedBy */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x18, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x18, /* NID_aRecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1a, /* NID_pilotAttributeType27 */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1b, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1b, /* NID_mXRecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1c, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1c, /* NID_nSRecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1d, /* NID_sOARecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1e, /* NID_cNAMERecord */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x1f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x1f, /* NID_associatedDomain */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x25, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x25, /* NID_associatedName */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x26, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x26, /* NID_homePostalAddress */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x27, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x27, /* NID_personalTitle */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x28, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x28, /* NID_mobileTelephoneNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x29, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x29, /* NID_pagerTelephoneNumber */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2a, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2a, /* NID_friendlyCountryName */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2b, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2b, /* NID_organizationalStatus */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2d, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2d, /* NID_janetMailbox */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2e, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2e, /* NID_mailPreferenceOption */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x2f, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x2f, /* NID_buildingName */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x30, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x30, /* NID_dSAQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x31, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x31, /* NID_singleLevelQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x32, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x32, /* NID_subtreeMinimumQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x33, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x33, /* NID_subtreeMaximumQuality */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x34, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x34, /* NID_personalSignature */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x35, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x35, /* NID_dITRedirect */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x36, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x36, /* NID_audio */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x37, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x37, /* NID_documentPublisher */ - 0x09, 0x92, 0x26, 0x89, 0x93, 0xf2, 0x2c, 0x64, 0x01, 0x38, + 0x09, + 0x92, + 0x26, + 0x89, + 0x93, + 0xf2, + 0x2c, + 0x64, + 0x01, + 0x38, /* NID_x500UniqueIdentifier */ - 0x55, 0x04, 0x2d, + 0x55, + 0x04, + 0x2d, /* NID_mime_mhs */ - 0x2b, 0x06, 0x01, 0x07, 0x01, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, /* NID_mime_mhs_headings */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, /* NID_mime_mhs_bodies */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x02, /* NID_id_hex_partial_message */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x01, /* NID_id_hex_multipart_message */ - 0x2b, 0x06, 0x01, 0x07, 0x01, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x07, + 0x01, + 0x01, + 0x02, /* NID_generationQualifier */ - 0x55, 0x04, 0x2c, + 0x55, + 0x04, + 0x2c, /* NID_pseudonym */ - 0x55, 0x04, 0x41, + 0x55, + 0x04, + 0x41, /* NID_id_set */ - 0x67, 0x2a, + 0x67, + 0x2a, /* NID_set_ctype */ - 0x67, 0x2a, 0x00, + 0x67, + 0x2a, + 0x00, /* NID_set_msgExt */ - 0x67, 0x2a, 0x01, + 0x67, + 0x2a, + 0x01, /* NID_set_attr */ - 0x67, 0x2a, 0x03, + 0x67, + 0x2a, + 0x03, /* NID_set_policy */ - 0x67, 0x2a, 0x05, + 0x67, + 0x2a, + 0x05, /* NID_set_certExt */ - 0x67, 0x2a, 0x07, + 0x67, + 0x2a, + 0x07, /* NID_set_brand */ - 0x67, 0x2a, 0x08, + 0x67, + 0x2a, + 0x08, /* NID_setct_PANData */ - 0x67, 0x2a, 0x00, 0x00, + 0x67, + 0x2a, + 0x00, + 0x00, /* NID_setct_PANToken */ - 0x67, 0x2a, 0x00, 0x01, + 0x67, + 0x2a, + 0x00, + 0x01, /* NID_setct_PANOnly */ - 0x67, 0x2a, 0x00, 0x02, + 0x67, + 0x2a, + 0x00, + 0x02, /* NID_setct_OIData */ - 0x67, 0x2a, 0x00, 0x03, + 0x67, + 0x2a, + 0x00, + 0x03, /* NID_setct_PI */ - 0x67, 0x2a, 0x00, 0x04, + 0x67, + 0x2a, + 0x00, + 0x04, /* NID_setct_PIData */ - 0x67, 0x2a, 0x00, 0x05, + 0x67, + 0x2a, + 0x00, + 0x05, /* NID_setct_PIDataUnsigned */ - 0x67, 0x2a, 0x00, 0x06, + 0x67, + 0x2a, + 0x00, + 0x06, /* NID_setct_HODInput */ - 0x67, 0x2a, 0x00, 0x07, + 0x67, + 0x2a, + 0x00, + 0x07, /* NID_setct_AuthResBaggage */ - 0x67, 0x2a, 0x00, 0x08, + 0x67, + 0x2a, + 0x00, + 0x08, /* NID_setct_AuthRevReqBaggage */ - 0x67, 0x2a, 0x00, 0x09, + 0x67, + 0x2a, + 0x00, + 0x09, /* NID_setct_AuthRevResBaggage */ - 0x67, 0x2a, 0x00, 0x0a, + 0x67, + 0x2a, + 0x00, + 0x0a, /* NID_setct_CapTokenSeq */ - 0x67, 0x2a, 0x00, 0x0b, + 0x67, + 0x2a, + 0x00, + 0x0b, /* NID_setct_PInitResData */ - 0x67, 0x2a, 0x00, 0x0c, + 0x67, + 0x2a, + 0x00, + 0x0c, /* NID_setct_PI_TBS */ - 0x67, 0x2a, 0x00, 0x0d, + 0x67, + 0x2a, + 0x00, + 0x0d, /* NID_setct_PResData */ - 0x67, 0x2a, 0x00, 0x0e, + 0x67, + 0x2a, + 0x00, + 0x0e, /* NID_setct_AuthReqTBS */ - 0x67, 0x2a, 0x00, 0x10, + 0x67, + 0x2a, + 0x00, + 0x10, /* NID_setct_AuthResTBS */ - 0x67, 0x2a, 0x00, 0x11, + 0x67, + 0x2a, + 0x00, + 0x11, /* NID_setct_AuthResTBSX */ - 0x67, 0x2a, 0x00, 0x12, + 0x67, + 0x2a, + 0x00, + 0x12, /* NID_setct_AuthTokenTBS */ - 0x67, 0x2a, 0x00, 0x13, + 0x67, + 0x2a, + 0x00, + 0x13, /* NID_setct_CapTokenData */ - 0x67, 0x2a, 0x00, 0x14, + 0x67, + 0x2a, + 0x00, + 0x14, /* NID_setct_CapTokenTBS */ - 0x67, 0x2a, 0x00, 0x15, + 0x67, + 0x2a, + 0x00, + 0x15, /* NID_setct_AcqCardCodeMsg */ - 0x67, 0x2a, 0x00, 0x16, + 0x67, + 0x2a, + 0x00, + 0x16, /* NID_setct_AuthRevReqTBS */ - 0x67, 0x2a, 0x00, 0x17, + 0x67, + 0x2a, + 0x00, + 0x17, /* NID_setct_AuthRevResData */ - 0x67, 0x2a, 0x00, 0x18, + 0x67, + 0x2a, + 0x00, + 0x18, /* NID_setct_AuthRevResTBS */ - 0x67, 0x2a, 0x00, 0x19, + 0x67, + 0x2a, + 0x00, + 0x19, /* NID_setct_CapReqTBS */ - 0x67, 0x2a, 0x00, 0x1a, + 0x67, + 0x2a, + 0x00, + 0x1a, /* NID_setct_CapReqTBSX */ - 0x67, 0x2a, 0x00, 0x1b, + 0x67, + 0x2a, + 0x00, + 0x1b, /* NID_setct_CapResData */ - 0x67, 0x2a, 0x00, 0x1c, + 0x67, + 0x2a, + 0x00, + 0x1c, /* NID_setct_CapRevReqTBS */ - 0x67, 0x2a, 0x00, 0x1d, + 0x67, + 0x2a, + 0x00, + 0x1d, /* NID_setct_CapRevReqTBSX */ - 0x67, 0x2a, 0x00, 0x1e, + 0x67, + 0x2a, + 0x00, + 0x1e, /* NID_setct_CapRevResData */ - 0x67, 0x2a, 0x00, 0x1f, + 0x67, + 0x2a, + 0x00, + 0x1f, /* NID_setct_CredReqTBS */ - 0x67, 0x2a, 0x00, 0x20, + 0x67, + 0x2a, + 0x00, + 0x20, /* NID_setct_CredReqTBSX */ - 0x67, 0x2a, 0x00, 0x21, + 0x67, + 0x2a, + 0x00, + 0x21, /* NID_setct_CredResData */ - 0x67, 0x2a, 0x00, 0x22, + 0x67, + 0x2a, + 0x00, + 0x22, /* NID_setct_CredRevReqTBS */ - 0x67, 0x2a, 0x00, 0x23, + 0x67, + 0x2a, + 0x00, + 0x23, /* NID_setct_CredRevReqTBSX */ - 0x67, 0x2a, 0x00, 0x24, + 0x67, + 0x2a, + 0x00, + 0x24, /* NID_setct_CredRevResData */ - 0x67, 0x2a, 0x00, 0x25, + 0x67, + 0x2a, + 0x00, + 0x25, /* NID_setct_PCertReqData */ - 0x67, 0x2a, 0x00, 0x26, + 0x67, + 0x2a, + 0x00, + 0x26, /* NID_setct_PCertResTBS */ - 0x67, 0x2a, 0x00, 0x27, + 0x67, + 0x2a, + 0x00, + 0x27, /* NID_setct_BatchAdminReqData */ - 0x67, 0x2a, 0x00, 0x28, + 0x67, + 0x2a, + 0x00, + 0x28, /* NID_setct_BatchAdminResData */ - 0x67, 0x2a, 0x00, 0x29, + 0x67, + 0x2a, + 0x00, + 0x29, /* NID_setct_CardCInitResTBS */ - 0x67, 0x2a, 0x00, 0x2a, + 0x67, + 0x2a, + 0x00, + 0x2a, /* NID_setct_MeAqCInitResTBS */ - 0x67, 0x2a, 0x00, 0x2b, + 0x67, + 0x2a, + 0x00, + 0x2b, /* NID_setct_RegFormResTBS */ - 0x67, 0x2a, 0x00, 0x2c, + 0x67, + 0x2a, + 0x00, + 0x2c, /* NID_setct_CertReqData */ - 0x67, 0x2a, 0x00, 0x2d, + 0x67, + 0x2a, + 0x00, + 0x2d, /* NID_setct_CertReqTBS */ - 0x67, 0x2a, 0x00, 0x2e, + 0x67, + 0x2a, + 0x00, + 0x2e, /* NID_setct_CertResData */ - 0x67, 0x2a, 0x00, 0x2f, + 0x67, + 0x2a, + 0x00, + 0x2f, /* NID_setct_CertInqReqTBS */ - 0x67, 0x2a, 0x00, 0x30, + 0x67, + 0x2a, + 0x00, + 0x30, /* NID_setct_ErrorTBS */ - 0x67, 0x2a, 0x00, 0x31, + 0x67, + 0x2a, + 0x00, + 0x31, /* NID_setct_PIDualSignedTBE */ - 0x67, 0x2a, 0x00, 0x32, + 0x67, + 0x2a, + 0x00, + 0x32, /* NID_setct_PIUnsignedTBE */ - 0x67, 0x2a, 0x00, 0x33, + 0x67, + 0x2a, + 0x00, + 0x33, /* NID_setct_AuthReqTBE */ - 0x67, 0x2a, 0x00, 0x34, + 0x67, + 0x2a, + 0x00, + 0x34, /* NID_setct_AuthResTBE */ - 0x67, 0x2a, 0x00, 0x35, + 0x67, + 0x2a, + 0x00, + 0x35, /* NID_setct_AuthResTBEX */ - 0x67, 0x2a, 0x00, 0x36, + 0x67, + 0x2a, + 0x00, + 0x36, /* NID_setct_AuthTokenTBE */ - 0x67, 0x2a, 0x00, 0x37, + 0x67, + 0x2a, + 0x00, + 0x37, /* NID_setct_CapTokenTBE */ - 0x67, 0x2a, 0x00, 0x38, + 0x67, + 0x2a, + 0x00, + 0x38, /* NID_setct_CapTokenTBEX */ - 0x67, 0x2a, 0x00, 0x39, + 0x67, + 0x2a, + 0x00, + 0x39, /* NID_setct_AcqCardCodeMsgTBE */ - 0x67, 0x2a, 0x00, 0x3a, + 0x67, + 0x2a, + 0x00, + 0x3a, /* NID_setct_AuthRevReqTBE */ - 0x67, 0x2a, 0x00, 0x3b, + 0x67, + 0x2a, + 0x00, + 0x3b, /* NID_setct_AuthRevResTBE */ - 0x67, 0x2a, 0x00, 0x3c, + 0x67, + 0x2a, + 0x00, + 0x3c, /* NID_setct_AuthRevResTBEB */ - 0x67, 0x2a, 0x00, 0x3d, + 0x67, + 0x2a, + 0x00, + 0x3d, /* NID_setct_CapReqTBE */ - 0x67, 0x2a, 0x00, 0x3e, + 0x67, + 0x2a, + 0x00, + 0x3e, /* NID_setct_CapReqTBEX */ - 0x67, 0x2a, 0x00, 0x3f, + 0x67, + 0x2a, + 0x00, + 0x3f, /* NID_setct_CapResTBE */ - 0x67, 0x2a, 0x00, 0x40, + 0x67, + 0x2a, + 0x00, + 0x40, /* NID_setct_CapRevReqTBE */ - 0x67, 0x2a, 0x00, 0x41, + 0x67, + 0x2a, + 0x00, + 0x41, /* NID_setct_CapRevReqTBEX */ - 0x67, 0x2a, 0x00, 0x42, + 0x67, + 0x2a, + 0x00, + 0x42, /* NID_setct_CapRevResTBE */ - 0x67, 0x2a, 0x00, 0x43, + 0x67, + 0x2a, + 0x00, + 0x43, /* NID_setct_CredReqTBE */ - 0x67, 0x2a, 0x00, 0x44, + 0x67, + 0x2a, + 0x00, + 0x44, /* NID_setct_CredReqTBEX */ - 0x67, 0x2a, 0x00, 0x45, + 0x67, + 0x2a, + 0x00, + 0x45, /* NID_setct_CredResTBE */ - 0x67, 0x2a, 0x00, 0x46, + 0x67, + 0x2a, + 0x00, + 0x46, /* NID_setct_CredRevReqTBE */ - 0x67, 0x2a, 0x00, 0x47, + 0x67, + 0x2a, + 0x00, + 0x47, /* NID_setct_CredRevReqTBEX */ - 0x67, 0x2a, 0x00, 0x48, + 0x67, + 0x2a, + 0x00, + 0x48, /* NID_setct_CredRevResTBE */ - 0x67, 0x2a, 0x00, 0x49, + 0x67, + 0x2a, + 0x00, + 0x49, /* NID_setct_BatchAdminReqTBE */ - 0x67, 0x2a, 0x00, 0x4a, + 0x67, + 0x2a, + 0x00, + 0x4a, /* NID_setct_BatchAdminResTBE */ - 0x67, 0x2a, 0x00, 0x4b, + 0x67, + 0x2a, + 0x00, + 0x4b, /* NID_setct_RegFormReqTBE */ - 0x67, 0x2a, 0x00, 0x4c, + 0x67, + 0x2a, + 0x00, + 0x4c, /* NID_setct_CertReqTBE */ - 0x67, 0x2a, 0x00, 0x4d, + 0x67, + 0x2a, + 0x00, + 0x4d, /* NID_setct_CertReqTBEX */ - 0x67, 0x2a, 0x00, 0x4e, + 0x67, + 0x2a, + 0x00, + 0x4e, /* NID_setct_CertResTBE */ - 0x67, 0x2a, 0x00, 0x4f, + 0x67, + 0x2a, + 0x00, + 0x4f, /* NID_setct_CRLNotificationTBS */ - 0x67, 0x2a, 0x00, 0x50, + 0x67, + 0x2a, + 0x00, + 0x50, /* NID_setct_CRLNotificationResTBS */ - 0x67, 0x2a, 0x00, 0x51, + 0x67, + 0x2a, + 0x00, + 0x51, /* NID_setct_BCIDistributionTBS */ - 0x67, 0x2a, 0x00, 0x52, + 0x67, + 0x2a, + 0x00, + 0x52, /* NID_setext_genCrypt */ - 0x67, 0x2a, 0x01, 0x01, + 0x67, + 0x2a, + 0x01, + 0x01, /* NID_setext_miAuth */ - 0x67, 0x2a, 0x01, 0x03, + 0x67, + 0x2a, + 0x01, + 0x03, /* NID_setext_pinSecure */ - 0x67, 0x2a, 0x01, 0x04, + 0x67, + 0x2a, + 0x01, + 0x04, /* NID_setext_pinAny */ - 0x67, 0x2a, 0x01, 0x05, + 0x67, + 0x2a, + 0x01, + 0x05, /* NID_setext_track2 */ - 0x67, 0x2a, 0x01, 0x07, + 0x67, + 0x2a, + 0x01, + 0x07, /* NID_setext_cv */ - 0x67, 0x2a, 0x01, 0x08, + 0x67, + 0x2a, + 0x01, + 0x08, /* NID_set_policy_root */ - 0x67, 0x2a, 0x05, 0x00, + 0x67, + 0x2a, + 0x05, + 0x00, /* NID_setCext_hashedRoot */ - 0x67, 0x2a, 0x07, 0x00, + 0x67, + 0x2a, + 0x07, + 0x00, /* NID_setCext_certType */ - 0x67, 0x2a, 0x07, 0x01, + 0x67, + 0x2a, + 0x07, + 0x01, /* NID_setCext_merchData */ - 0x67, 0x2a, 0x07, 0x02, + 0x67, + 0x2a, + 0x07, + 0x02, /* NID_setCext_cCertRequired */ - 0x67, 0x2a, 0x07, 0x03, + 0x67, + 0x2a, + 0x07, + 0x03, /* NID_setCext_tunneling */ - 0x67, 0x2a, 0x07, 0x04, + 0x67, + 0x2a, + 0x07, + 0x04, /* NID_setCext_setExt */ - 0x67, 0x2a, 0x07, 0x05, + 0x67, + 0x2a, + 0x07, + 0x05, /* NID_setCext_setQualf */ - 0x67, 0x2a, 0x07, 0x06, + 0x67, + 0x2a, + 0x07, + 0x06, /* NID_setCext_PGWYcapabilities */ - 0x67, 0x2a, 0x07, 0x07, + 0x67, + 0x2a, + 0x07, + 0x07, /* NID_setCext_TokenIdentifier */ - 0x67, 0x2a, 0x07, 0x08, + 0x67, + 0x2a, + 0x07, + 0x08, /* NID_setCext_Track2Data */ - 0x67, 0x2a, 0x07, 0x09, + 0x67, + 0x2a, + 0x07, + 0x09, /* NID_setCext_TokenType */ - 0x67, 0x2a, 0x07, 0x0a, + 0x67, + 0x2a, + 0x07, + 0x0a, /* NID_setCext_IssuerCapabilities */ - 0x67, 0x2a, 0x07, 0x0b, + 0x67, + 0x2a, + 0x07, + 0x0b, /* NID_setAttr_Cert */ - 0x67, 0x2a, 0x03, 0x00, + 0x67, + 0x2a, + 0x03, + 0x00, /* NID_setAttr_PGWYcap */ - 0x67, 0x2a, 0x03, 0x01, + 0x67, + 0x2a, + 0x03, + 0x01, /* NID_setAttr_TokenType */ - 0x67, 0x2a, 0x03, 0x02, + 0x67, + 0x2a, + 0x03, + 0x02, /* NID_setAttr_IssCap */ - 0x67, 0x2a, 0x03, 0x03, + 0x67, + 0x2a, + 0x03, + 0x03, /* NID_set_rootKeyThumb */ - 0x67, 0x2a, 0x03, 0x00, 0x00, + 0x67, + 0x2a, + 0x03, + 0x00, + 0x00, /* NID_set_addPolicy */ - 0x67, 0x2a, 0x03, 0x00, 0x01, + 0x67, + 0x2a, + 0x03, + 0x00, + 0x01, /* NID_setAttr_Token_EMV */ - 0x67, 0x2a, 0x03, 0x02, 0x01, + 0x67, + 0x2a, + 0x03, + 0x02, + 0x01, /* NID_setAttr_Token_B0Prime */ - 0x67, 0x2a, 0x03, 0x02, 0x02, + 0x67, + 0x2a, + 0x03, + 0x02, + 0x02, /* NID_setAttr_IssCap_CVM */ - 0x67, 0x2a, 0x03, 0x03, 0x03, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, /* NID_setAttr_IssCap_T2 */ - 0x67, 0x2a, 0x03, 0x03, 0x04, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, /* NID_setAttr_IssCap_Sig */ - 0x67, 0x2a, 0x03, 0x03, 0x05, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, /* NID_setAttr_GenCryptgrm */ - 0x67, 0x2a, 0x03, 0x03, 0x03, 0x01, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x03, + 0x01, /* NID_setAttr_T2Enc */ - 0x67, 0x2a, 0x03, 0x03, 0x04, 0x01, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x01, /* NID_setAttr_T2cleartxt */ - 0x67, 0x2a, 0x03, 0x03, 0x04, 0x02, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x04, + 0x02, /* NID_setAttr_TokICCsig */ - 0x67, 0x2a, 0x03, 0x03, 0x05, 0x01, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x01, /* NID_setAttr_SecDevSig */ - 0x67, 0x2a, 0x03, 0x03, 0x05, 0x02, + 0x67, + 0x2a, + 0x03, + 0x03, + 0x05, + 0x02, /* NID_set_brand_IATA_ATA */ - 0x67, 0x2a, 0x08, 0x01, + 0x67, + 0x2a, + 0x08, + 0x01, /* NID_set_brand_Diners */ - 0x67, 0x2a, 0x08, 0x1e, + 0x67, + 0x2a, + 0x08, + 0x1e, /* NID_set_brand_AmericanExpress */ - 0x67, 0x2a, 0x08, 0x22, + 0x67, + 0x2a, + 0x08, + 0x22, /* NID_set_brand_JCB */ - 0x67, 0x2a, 0x08, 0x23, + 0x67, + 0x2a, + 0x08, + 0x23, /* NID_set_brand_Visa */ - 0x67, 0x2a, 0x08, 0x04, + 0x67, + 0x2a, + 0x08, + 0x04, /* NID_set_brand_MasterCard */ - 0x67, 0x2a, 0x08, 0x05, + 0x67, + 0x2a, + 0x08, + 0x05, /* NID_set_brand_Novus */ - 0x67, 0x2a, 0x08, 0xae, 0x7b, + 0x67, + 0x2a, + 0x08, + 0xae, + 0x7b, /* NID_des_cdmf */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x03, + 0x0a, /* NID_rsaOAEPEncryptionSET */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x06, /* NID_international_organizations */ 0x67, /* NID_ms_smartcard_login */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x14, + 0x02, + 0x02, /* NID_ms_upn */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x14, 0x02, 0x03, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x14, + 0x02, + 0x03, /* NID_streetAddress */ - 0x55, 0x04, 0x09, + 0x55, + 0x04, + 0x09, /* NID_postalCode */ - 0x55, 0x04, 0x11, + 0x55, + 0x04, + 0x11, /* NID_id_ppl */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, /* NID_proxyCertInfo */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x01, 0x0e, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x01, + 0x0e, /* NID_id_ppl_anyLanguage */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, 0x00, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x00, /* NID_id_ppl_inheritAll */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x01, /* NID_name_constraints */ - 0x55, 0x1d, 0x1e, + 0x55, + 0x1d, + 0x1e, /* NID_Independent */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x15, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x15, + 0x02, /* NID_sha256WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0b, /* NID_sha384WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0c, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0c, /* NID_sha512WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0d, /* NID_sha224WithRSAEncryption */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0e, /* NID_sha256 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x01, /* NID_sha384 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x02, /* NID_sha512 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x03, /* NID_sha224 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x02, + 0x04, /* NID_identified_organization */ 0x2b, /* NID_certicom_arc */ - 0x2b, 0x81, 0x04, + 0x2b, + 0x81, + 0x04, /* NID_wap */ - 0x67, 0x2b, + 0x67, + 0x2b, /* NID_wap_wsg */ - 0x67, 0x2b, 0x01, + 0x67, + 0x2b, + 0x01, /* NID_X9_62_id_characteristic_two_basis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, /* NID_X9_62_onBasis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x01, /* NID_X9_62_tpBasis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x02, /* NID_X9_62_ppBasis */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x01, 0x02, 0x03, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x01, + 0x02, + 0x03, + 0x03, /* NID_X9_62_c2pnb163v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x01, /* NID_X9_62_c2pnb163v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x02, /* NID_X9_62_c2pnb163v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x03, /* NID_X9_62_c2pnb176v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x04, /* NID_X9_62_c2tnb191v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x05, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x05, /* NID_X9_62_c2tnb191v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x06, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x06, /* NID_X9_62_c2tnb191v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x07, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x07, /* NID_X9_62_c2onb191v4 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x08, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x08, /* NID_X9_62_c2onb191v5 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x09, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x09, /* NID_X9_62_c2pnb208w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0a, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0a, /* NID_X9_62_c2tnb239v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0b, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0b, /* NID_X9_62_c2tnb239v2 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0c, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0c, /* NID_X9_62_c2tnb239v3 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0d, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0d, /* NID_X9_62_c2onb239v4 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0e, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0e, /* NID_X9_62_c2onb239v5 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x0f, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x0f, /* NID_X9_62_c2pnb272w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x10, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x10, /* NID_X9_62_c2pnb304w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x11, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x11, /* NID_X9_62_c2tnb359v1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x12, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x12, /* NID_X9_62_c2pnb368w1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x13, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x13, /* NID_X9_62_c2tnb431r1 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x00, 0x14, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x03, + 0x00, + 0x14, /* NID_secp112r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x06, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x06, /* NID_secp112r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x07, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x07, /* NID_secp128r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1c, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1c, /* NID_secp128r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x1d, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1d, /* NID_secp160k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x09, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x09, /* NID_secp160r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x08, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x08, /* NID_secp160r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x1e, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1e, /* NID_secp192k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1f, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1f, /* NID_secp224k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x20, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x20, /* NID_secp224r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x21, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x21, /* NID_secp256k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x0a, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0a, /* NID_secp384r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x22, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x22, /* NID_secp521r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x23, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x23, /* NID_sect113r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x04, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x04, /* NID_sect113r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x05, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x05, /* NID_sect131r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x16, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x16, /* NID_sect131r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x17, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x17, /* NID_sect163k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x01, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x01, /* NID_sect163r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x02, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x02, /* NID_sect163r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x0f, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x0f, /* NID_sect193r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x18, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x18, /* NID_sect193r2 */ - 0x2b, 0x81, 0x04, 0x00, 0x19, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x19, /* NID_sect233k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1a, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1a, /* NID_sect233r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x1b, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x1b, /* NID_sect239k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x03, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x03, /* NID_sect283k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x10, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x10, /* NID_sect283r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x11, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x11, /* NID_sect409k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x24, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x24, /* NID_sect409r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x25, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x25, /* NID_sect571k1 */ - 0x2b, 0x81, 0x04, 0x00, 0x26, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x26, /* NID_sect571r1 */ - 0x2b, 0x81, 0x04, 0x00, 0x27, + 0x2b, + 0x81, + 0x04, + 0x00, + 0x27, /* NID_wap_wsg_idm_ecid_wtls1 */ - 0x67, 0x2b, 0x01, 0x04, 0x01, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x01, /* NID_wap_wsg_idm_ecid_wtls3 */ - 0x67, 0x2b, 0x01, 0x04, 0x03, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x03, /* NID_wap_wsg_idm_ecid_wtls4 */ - 0x67, 0x2b, 0x01, 0x04, 0x04, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x04, /* NID_wap_wsg_idm_ecid_wtls5 */ - 0x67, 0x2b, 0x01, 0x04, 0x05, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x05, /* NID_wap_wsg_idm_ecid_wtls6 */ - 0x67, 0x2b, 0x01, 0x04, 0x06, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x06, /* NID_wap_wsg_idm_ecid_wtls7 */ - 0x67, 0x2b, 0x01, 0x04, 0x07, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x07, /* NID_wap_wsg_idm_ecid_wtls8 */ - 0x67, 0x2b, 0x01, 0x04, 0x08, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x08, /* NID_wap_wsg_idm_ecid_wtls9 */ - 0x67, 0x2b, 0x01, 0x04, 0x09, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x09, /* NID_wap_wsg_idm_ecid_wtls10 */ - 0x67, 0x2b, 0x01, 0x04, 0x0a, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0a, /* NID_wap_wsg_idm_ecid_wtls11 */ - 0x67, 0x2b, 0x01, 0x04, 0x0b, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0b, /* NID_wap_wsg_idm_ecid_wtls12 */ - 0x67, 0x2b, 0x01, 0x04, 0x0c, + 0x67, + 0x2b, + 0x01, + 0x04, + 0x0c, /* NID_any_policy */ - 0x55, 0x1d, 0x20, 0x00, + 0x55, + 0x1d, + 0x20, + 0x00, /* NID_policy_mappings */ - 0x55, 0x1d, 0x21, + 0x55, + 0x1d, + 0x21, /* NID_inhibit_any_policy */ - 0x55, 0x1d, 0x36, + 0x55, + 0x1d, + 0x36, /* NID_camellia_128_cbc */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x01, 0x02, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x02, /* NID_camellia_192_cbc */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x01, 0x03, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x03, /* NID_camellia_256_cbc */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x01, 0x04, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x01, + 0x04, /* NID_camellia_128_ecb */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x01, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x01, /* NID_camellia_192_ecb */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x15, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x15, /* NID_camellia_256_ecb */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x29, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x29, /* NID_camellia_128_cfb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x04, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x04, /* NID_camellia_192_cfb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x18, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x18, /* NID_camellia_256_cfb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x2c, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2c, /* NID_camellia_128_ofb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x03, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x03, /* NID_camellia_192_ofb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x17, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x17, /* NID_camellia_256_ofb128 */ - 0x03, 0xa2, 0x31, 0x05, 0x03, 0x01, 0x09, 0x2b, + 0x03, + 0xa2, + 0x31, + 0x05, + 0x03, + 0x01, + 0x09, + 0x2b, /* NID_subject_directory_attributes */ - 0x55, 0x1d, 0x09, + 0x55, + 0x1d, + 0x09, /* NID_issuing_distribution_point */ - 0x55, 0x1d, 0x1c, + 0x55, + 0x1d, + 0x1c, /* NID_certificate_issuer */ - 0x55, 0x1d, 0x1d, + 0x55, + 0x1d, + 0x1d, /* NID_kisa */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, /* NID_seed_ecb */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x03, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x03, /* NID_seed_cbc */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x04, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x04, /* NID_seed_ofb128 */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x06, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x06, /* NID_seed_cfb128 */ - 0x2a, 0x83, 0x1a, 0x8c, 0x9a, 0x44, 0x01, 0x05, + 0x2a, + 0x83, + 0x1a, + 0x8c, + 0x9a, + 0x44, + 0x01, + 0x05, /* NID_hmac_md5 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x08, 0x01, 0x01, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x01, /* NID_hmac_sha1 */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x08, 0x01, 0x02, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x08, + 0x01, + 0x02, /* NID_id_PasswordBasedMAC */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x0d, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x0d, /* NID_id_DHBasedMac */ - 0x2a, 0x86, 0x48, 0x86, 0xf6, 0x7d, 0x07, 0x42, 0x1e, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf6, + 0x7d, + 0x07, + 0x42, + 0x1e, /* NID_id_it_suppLangTags */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x04, 0x10, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x04, + 0x10, /* NID_caRepository */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x30, 0x05, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x30, + 0x05, /* NID_id_smime_ct_compressedData */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x09, /* NID_id_ct_asciiTextWithCRLF */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x01, 0x1b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x01, + 0x1b, /* NID_id_aes128_wrap */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x05, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x05, /* NID_id_aes192_wrap */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x19, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x19, /* NID_id_aes256_wrap */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2d, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2d, /* NID_ecdsa_with_Recommended */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x02, /* NID_ecdsa_with_Specified */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, /* NID_ecdsa_with_SHA224 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x01, /* NID_ecdsa_with_SHA256 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x02, /* NID_ecdsa_with_SHA384 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x03, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x03, /* NID_ecdsa_with_SHA512 */ - 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x04, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3d, + 0x04, + 0x03, + 0x04, /* NID_hmacWithMD5 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x06, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x06, /* NID_hmacWithSHA224 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x08, /* NID_hmacWithSHA256 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x09, /* NID_hmacWithSHA384 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0a, /* NID_hmacWithSHA512 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x0b, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x02, + 0x0b, /* NID_dsa_with_SHA224 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x01, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x01, /* NID_dsa_with_SHA256 */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x03, 0x02, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x03, + 0x02, /* NID_whirlpool */ - 0x28, 0xcf, 0x06, 0x03, 0x00, 0x37, + 0x28, + 0xcf, + 0x06, + 0x03, + 0x00, + 0x37, /* NID_cryptopro */ - 0x2a, 0x85, 0x03, 0x02, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, /* NID_cryptocom */ - 0x2a, 0x85, 0x03, 0x02, 0x09, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, /* NID_id_GostR3411_94_with_GostR3410_2001 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x03, /* NID_id_GostR3411_94_with_GostR3410_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x04, /* NID_id_GostR3411_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x09, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x09, /* NID_id_HMACGostR3411_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x0a, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0a, /* NID_id_GostR3410_2001 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x13, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x13, /* NID_id_GostR3410_94 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, /* NID_id_Gost28147_89 */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x15, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x15, /* NID_id_Gost28147_89_MAC */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x16, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x16, /* NID_id_GostR3411_94_prf */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x17, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x17, /* NID_id_GostR3410_2001DH */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x62, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x62, /* NID_id_GostR3410_94DH */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x63, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x63, /* NID_id_Gost28147_89_CryptoPro_KeyMeshing */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x0e, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x01, /* NID_id_Gost28147_89_None_KeyMeshing */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x0e, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x0e, + 0x00, /* NID_id_GostR3411_94_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1e, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x00, /* NID_id_GostR3411_94_CryptoProParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1e, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1e, + 0x01, /* NID_id_Gost28147_89_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x00, /* NID_id_Gost28147_89_CryptoPro_A_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x01, /* NID_id_Gost28147_89_CryptoPro_B_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x02, /* NID_id_Gost28147_89_CryptoPro_C_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x03, /* NID_id_Gost28147_89_CryptoPro_D_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x04, /* NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x05, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x05, /* NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x06, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x06, /* NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x1f, 0x07, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x1f, + 0x07, /* NID_id_GostR3410_94_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x00, /* NID_id_GostR3410_94_CryptoPro_A_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x02, /* NID_id_GostR3410_94_CryptoPro_B_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x03, /* NID_id_GostR3410_94_CryptoPro_C_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x04, /* NID_id_GostR3410_94_CryptoPro_D_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x20, 0x05, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x20, + 0x05, /* NID_id_GostR3410_94_CryptoPro_XchA_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x21, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x01, /* NID_id_GostR3410_94_CryptoPro_XchB_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x21, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x02, /* NID_id_GostR3410_94_CryptoPro_XchC_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x21, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x21, + 0x03, /* NID_id_GostR3410_2001_TestParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x00, /* NID_id_GostR3410_2001_CryptoPro_A_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x01, /* NID_id_GostR3410_2001_CryptoPro_B_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x02, /* NID_id_GostR3410_2001_CryptoPro_C_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x23, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x23, + 0x03, /* NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x24, 0x00, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x00, /* NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x24, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x24, + 0x01, /* NID_id_GostR3410_94_a */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x01, /* NID_id_GostR3410_94_aBis */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x02, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x02, /* NID_id_GostR3410_94_b */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x03, /* NID_id_GostR3410_94_bBis */ - 0x2a, 0x85, 0x03, 0x02, 0x02, 0x14, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x02, + 0x14, + 0x04, /* NID_id_Gost28147_89_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x06, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x06, + 0x01, /* NID_id_GostR3410_94_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x05, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x03, /* NID_id_GostR3410_2001_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x05, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x05, + 0x04, /* NID_id_GostR3411_94_with_GostR3410_94_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x03, 0x03, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x03, /* NID_id_GostR3411_94_with_GostR3410_2001_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x03, 0x04, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x03, + 0x04, /* NID_id_GostR3410_2001_ParamSet_cc */ - 0x2a, 0x85, 0x03, 0x02, 0x09, 0x01, 0x08, 0x01, + 0x2a, + 0x85, + 0x03, + 0x02, + 0x09, + 0x01, + 0x08, + 0x01, /* NID_LocalKeySet */ - 0x2b, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x11, 0x02, + 0x2b, + 0x06, + 0x01, + 0x04, + 0x01, + 0x82, + 0x37, + 0x11, + 0x02, /* NID_freshest_crl */ - 0x55, 0x1d, 0x2e, + 0x55, + 0x1d, + 0x2e, /* NID_id_on_permanentIdentifier */ - 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x08, 0x03, + 0x2b, + 0x06, + 0x01, + 0x05, + 0x05, + 0x07, + 0x08, + 0x03, /* NID_searchGuide */ - 0x55, 0x04, 0x0e, + 0x55, + 0x04, + 0x0e, /* NID_businessCategory */ - 0x55, 0x04, 0x0f, + 0x55, + 0x04, + 0x0f, /* NID_postalAddress */ - 0x55, 0x04, 0x10, + 0x55, + 0x04, + 0x10, /* NID_postOfficeBox */ - 0x55, 0x04, 0x12, + 0x55, + 0x04, + 0x12, /* NID_physicalDeliveryOfficeName */ - 0x55, 0x04, 0x13, + 0x55, + 0x04, + 0x13, /* NID_telephoneNumber */ - 0x55, 0x04, 0x14, + 0x55, + 0x04, + 0x14, /* NID_telexNumber */ - 0x55, 0x04, 0x15, + 0x55, + 0x04, + 0x15, /* NID_teletexTerminalIdentifier */ - 0x55, 0x04, 0x16, + 0x55, + 0x04, + 0x16, /* NID_facsimileTelephoneNumber */ - 0x55, 0x04, 0x17, + 0x55, + 0x04, + 0x17, /* NID_x121Address */ - 0x55, 0x04, 0x18, + 0x55, + 0x04, + 0x18, /* NID_internationaliSDNNumber */ - 0x55, 0x04, 0x19, + 0x55, + 0x04, + 0x19, /* NID_registeredAddress */ - 0x55, 0x04, 0x1a, + 0x55, + 0x04, + 0x1a, /* NID_destinationIndicator */ - 0x55, 0x04, 0x1b, + 0x55, + 0x04, + 0x1b, /* NID_preferredDeliveryMethod */ - 0x55, 0x04, 0x1c, + 0x55, + 0x04, + 0x1c, /* NID_presentationAddress */ - 0x55, 0x04, 0x1d, + 0x55, + 0x04, + 0x1d, /* NID_supportedApplicationContext */ - 0x55, 0x04, 0x1e, + 0x55, + 0x04, + 0x1e, /* NID_member */ - 0x55, 0x04, 0x1f, + 0x55, + 0x04, + 0x1f, /* NID_owner */ - 0x55, 0x04, 0x20, + 0x55, + 0x04, + 0x20, /* NID_roleOccupant */ - 0x55, 0x04, 0x21, + 0x55, + 0x04, + 0x21, /* NID_seeAlso */ - 0x55, 0x04, 0x22, + 0x55, + 0x04, + 0x22, /* NID_userPassword */ - 0x55, 0x04, 0x23, + 0x55, + 0x04, + 0x23, /* NID_userCertificate */ - 0x55, 0x04, 0x24, + 0x55, + 0x04, + 0x24, /* NID_cACertificate */ - 0x55, 0x04, 0x25, + 0x55, + 0x04, + 0x25, /* NID_authorityRevocationList */ - 0x55, 0x04, 0x26, + 0x55, + 0x04, + 0x26, /* NID_certificateRevocationList */ - 0x55, 0x04, 0x27, + 0x55, + 0x04, + 0x27, /* NID_crossCertificatePair */ - 0x55, 0x04, 0x28, + 0x55, + 0x04, + 0x28, /* NID_enhancedSearchGuide */ - 0x55, 0x04, 0x2f, + 0x55, + 0x04, + 0x2f, /* NID_protocolInformation */ - 0x55, 0x04, 0x30, + 0x55, + 0x04, + 0x30, /* NID_distinguishedName */ - 0x55, 0x04, 0x31, + 0x55, + 0x04, + 0x31, /* NID_uniqueMember */ - 0x55, 0x04, 0x32, + 0x55, + 0x04, + 0x32, /* NID_houseIdentifier */ - 0x55, 0x04, 0x33, + 0x55, + 0x04, + 0x33, /* NID_supportedAlgorithms */ - 0x55, 0x04, 0x34, + 0x55, + 0x04, + 0x34, /* NID_deltaRevocationList */ - 0x55, 0x04, 0x35, + 0x55, + 0x04, + 0x35, /* NID_dmdName */ - 0x55, 0x04, 0x36, + 0x55, + 0x04, + 0x36, /* NID_id_alg_PWRI_KEK */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x09, 0x10, 0x03, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x09, + 0x10, + 0x03, + 0x09, /* NID_aes_128_gcm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x06, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x06, /* NID_aes_128_ccm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x07, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x07, /* NID_id_aes128_wrap_pad */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x08, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x08, /* NID_aes_192_gcm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x1a, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1a, /* NID_aes_192_ccm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x1b, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1b, /* NID_id_aes192_wrap_pad */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x1c, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x1c, /* NID_aes_256_gcm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2e, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2e, /* NID_aes_256_ccm */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2f, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x2f, /* NID_id_aes256_wrap_pad */ - 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x30, + 0x60, + 0x86, + 0x48, + 0x01, + 0x65, + 0x03, + 0x04, + 0x01, + 0x30, /* NID_id_camellia128_wrap */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x03, 0x02, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x02, /* NID_id_camellia192_wrap */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x03, 0x03, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x03, /* NID_id_camellia256_wrap */ - 0x2a, 0x83, 0x08, 0x8c, 0x9a, 0x4b, 0x3d, 0x01, 0x01, 0x03, 0x04, + 0x2a, + 0x83, + 0x08, + 0x8c, + 0x9a, + 0x4b, + 0x3d, + 0x01, + 0x01, + 0x03, + 0x04, /* NID_anyExtendedKeyUsage */ - 0x55, 0x1d, 0x25, 0x00, + 0x55, + 0x1d, + 0x25, + 0x00, /* NID_mgf1 */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x08, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x08, /* NID_rsassaPss */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0a, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x0a, /* NID_rsaesOaep */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x07, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x07, /* NID_dhpublicnumber */ - 0x2a, 0x86, 0x48, 0xce, 0x3e, 0x02, 0x01, + 0x2a, + 0x86, + 0x48, + 0xce, + 0x3e, + 0x02, + 0x01, /* NID_brainpoolP160r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x01, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x01, /* NID_brainpoolP160t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x02, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x02, /* NID_brainpoolP192r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x03, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x03, /* NID_brainpoolP192t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x04, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x04, /* NID_brainpoolP224r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x05, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x05, /* NID_brainpoolP224t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x06, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x06, /* NID_brainpoolP256r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x07, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x07, /* NID_brainpoolP256t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x08, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x08, /* NID_brainpoolP320r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x09, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x09, /* NID_brainpoolP320t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0a, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0a, /* NID_brainpoolP384r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0b, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0b, /* NID_brainpoolP384t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0c, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0c, /* NID_brainpoolP512r1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0d, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0d, /* NID_brainpoolP512t1 */ - 0x2b, 0x24, 0x03, 0x03, 0x02, 0x08, 0x01, 0x01, 0x0e, + 0x2b, + 0x24, + 0x03, + 0x03, + 0x02, + 0x08, + 0x01, + 0x01, + 0x0e, /* NID_pSpecified */ - 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x09, + 0x2a, + 0x86, + 0x48, + 0x86, + 0xf7, + 0x0d, + 0x01, + 0x01, + 0x09, /* NID_dhSinglePass_stdDH_sha1kdf_scheme */ - 0x2b, 0x81, 0x05, 0x10, 0x86, 0x48, 0x3f, 0x00, 0x02, + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x02, /* NID_dhSinglePass_stdDH_sha224kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x00, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x00, /* NID_dhSinglePass_stdDH_sha256kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x01, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x01, /* NID_dhSinglePass_stdDH_sha384kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x02, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x02, /* NID_dhSinglePass_stdDH_sha512kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0b, 0x03, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0b, + 0x03, /* NID_dhSinglePass_cofactorDH_sha1kdf_scheme */ - 0x2b, 0x81, 0x05, 0x10, 0x86, 0x48, 0x3f, 0x00, 0x03, + 0x2b, + 0x81, + 0x05, + 0x10, + 0x86, + 0x48, + 0x3f, + 0x00, + 0x03, /* NID_dhSinglePass_cofactorDH_sha224kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x00, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x00, /* NID_dhSinglePass_cofactorDH_sha256kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x01, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x01, /* NID_dhSinglePass_cofactorDH_sha384kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x02, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x02, /* NID_dhSinglePass_cofactorDH_sha512kdf_scheme */ - 0x2b, 0x81, 0x04, 0x01, 0x0e, 0x03, + 0x2b, + 0x81, + 0x04, + 0x01, + 0x0e, + 0x03, + /* NID_X25519 */ + 0x2b, + 0x65, + 0x6e, /* NID_ED25519 */ - 0x2b, 0x65, 0x70, + 0x2b, + 0x65, + 0x70, + /* NID_ED448 */ + 0x2b, + 0x65, + 0x71, + /* NID_X448 */ + 0x2b, + 0x65, + 0x6f, }; static const ASN1_OBJECT kObjects[NUM_NID] = { @@ -3442,8 +8755,8 @@ static const ASN1_OBJECT kObjects[NUM_NID] = { NID_dhSinglePass_cofactorDH_sha512kdf_scheme, 6, &kObjectData[6169], 0}, {"dh-std-kdf", "dh-std-kdf", NID_dh_std_kdf, 0, NULL, 0}, {"dh-cofactor-kdf", "dh-cofactor-kdf", NID_dh_cofactor_kdf, 0, NULL, 0}, - {"X25519", "X25519", NID_X25519, 0, NULL, 0}, - {"ED25519", "ED25519", NID_ED25519, 3, &kObjectData[6175], 0}, + {"X25519", "X25519", NID_X25519, 3, &kObjectData[6175], 0}, + {"ED25519", "ED25519", NID_ED25519, 3, &kObjectData[6178], 0}, {"ChaCha20-Poly1305", "chacha20-poly1305", NID_chacha20_poly1305, 0, NULL, 0}, {"KxRSA", "kx-rsa", NID_kx_rsa, 0, NULL, 0}, @@ -3454,9 +8767,12 @@ static const ASN1_OBJECT kObjects[NUM_NID] = { {"AuthPSK", "auth-psk", NID_auth_psk, 0, NULL, 0}, {"KxANY", "kx-any", NID_kx_any, 0, NULL, 0}, {"AuthANY", "auth-any", NID_auth_any, 0, NULL, 0}, + {"CECPQ2", "CECPQ2", NID_CECPQ2, 0, NULL, 0}, + {"ED448", "ED448", NID_ED448, 3, &kObjectData[6181], 0}, + {"X448", "X448", NID_X448, 3, &kObjectData[6184], 0}, }; -static const unsigned kNIDsInShortNameOrder[] = { +static const uint16_t kNIDsInShortNameOrder[] = { 364 /* AD_DVCS */, 419 /* AES-128-CBC */, 916 /* AES-128-CBC-HMAC-SHA1 */, @@ -3515,6 +8831,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 110 /* CAST5-CFB */, 109 /* CAST5-ECB */, 111 /* CAST5-OFB */, + 959 /* CECPQ2 */, 894 /* CMAC */, 13 /* CN */, 141 /* CRLReason */, @@ -3548,6 +8865,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 67 /* DSA-old */, 297 /* DVCS */, 949 /* ED25519 */, + 960 /* ED448 */, 99 /* GN */, 855 /* HMAC */, 780 /* HMAC-MD5 */, @@ -3649,6 +8967,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 458 /* UID */, 0 /* UNDEF */, 948 /* X25519 */, + 961 /* X448 */, 11 /* X500 */, 378 /* X500algorithms */, 12 /* X509 */, @@ -4408,7 +9727,7 @@ static const unsigned kNIDsInShortNameOrder[] = { 160 /* x509Crl */, }; -static const unsigned kNIDsInLongNameOrder[] = { +static const uint16_t kNIDsInLongNameOrder[] = { 363 /* AD Time Stamping */, 405 /* ANSI X9.62 */, 368 /* Acceptable OCSP Responses */, @@ -4419,12 +9738,14 @@ static const unsigned kNIDsInLongNameOrder[] = { 285 /* Biometric Info */, 179 /* CA Issuers */, 785 /* CA Repository */, + 959 /* CECPQ2 */, 131 /* Code Signing */, 783 /* Diffie-Hellman based MAC */, 382 /* Directory */, 392 /* Domain */, 132 /* E-mail Protection */, 949 /* ED25519 */, + 960 /* ED448 */, 389 /* Enterprises */, 384 /* Experimental */, 372 /* Extended OCSP Status */, @@ -4517,6 +9838,7 @@ static const unsigned kNIDsInLongNameOrder[] = { 133 /* Time Stamping */, 375 /* Trust Root */, 948 /* X25519 */, + 961 /* X448 */, 12 /* X509 */, 402 /* X509v3 AC Targeting */, 746 /* X509v3 Any Policy */, @@ -5360,7 +10682,7 @@ static const unsigned kNIDsInLongNameOrder[] = { 125 /* zlib compression */, }; -static const unsigned kNIDsInOIDOrder[] = { +static const uint16_t kNIDsInOIDOrder[] = { 434 /* 0.9 (OBJ_data) */, 182 /* 1.2 (OBJ_member_body) */, 379 /* 1.3 (OBJ_org) */, @@ -5376,7 +10698,10 @@ static const unsigned kNIDsInOIDOrder[] = { 435 /* 0.9.2342 (OBJ_pss) */, 183 /* 1.2.840 (OBJ_ISO_US) */, 381 /* 1.3.6.1 (OBJ_iana) */, + 948 /* 1.3.101.110 (OBJ_X25519) */, + 961 /* 1.3.101.111 (OBJ_X448) */, 949 /* 1.3.101.112 (OBJ_ED25519) */, + 960 /* 1.3.101.113 (OBJ_ED448) */, 677 /* 1.3.132 (OBJ_certicom_arc) */, 394 /* 2.5.1.5 (OBJ_selected_attribute_types) */, 13 /* 2.5.4.3 (OBJ_commonName) */, @@ -5708,9 +11033,11 @@ static const unsigned kNIDsInOIDOrder[] = { 825 /* 1.2.643.2.2.31.2 (OBJ_id_Gost28147_89_CryptoPro_B_ParamSet) */, 826 /* 1.2.643.2.2.31.3 (OBJ_id_Gost28147_89_CryptoPro_C_ParamSet) */, 827 /* 1.2.643.2.2.31.4 (OBJ_id_Gost28147_89_CryptoPro_D_ParamSet) */, - 828 /* 1.2.643.2.2.31.5 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet) */ + 828 /* 1.2.643.2.2.31.5 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet) + */ , - 829 /* 1.2.643.2.2.31.6 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet) */ + 829 /* 1.2.643.2.2.31.6 (OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet) + */ , 830 /* 1.2.643.2.2.31.7 (OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet) */, 831 /* 1.2.643.2.2.32.0 (OBJ_id_GostR3410_94_TestParamSet) */, diff --git a/Pods/BoringSSL-GRPC/crypto/obj/obj_xref.c b/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/obj/obj_xref.c rename to Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c diff --git a/Pods/BoringSSL-GRPC/crypto/obj/obj_xref.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/obj/obj_xref.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/obj/obj_xref.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_all.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_all.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c index bf79a3fd3..1cb82429e 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_all.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c @@ -113,9 +113,7 @@ #include #include #include -/* - * #include - */ +#include #include #include @@ -127,6 +125,7 @@ IMPLEMENT_PEM_rw(X509_REQ, X509_REQ, PEM_STRING_X509_REQ, X509_REQ) IMPLEMENT_PEM_write(X509_REQ_NEW, X509_REQ, PEM_STRING_X509_REQ_OLD, X509_REQ) IMPLEMENT_PEM_rw(X509_CRL, X509_CRL, PEM_STRING_X509_CRL, X509_CRL) +IMPLEMENT_PEM_rw(PKCS7, PKCS7, PEM_STRING_PKCS7, PKCS7) /* * We treat RSA or DSA private keys as a special case. For private keys we diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_all.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_all.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c.grpc_back index e94ff2655..6b408831b 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_all.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_all.c.grpc_back @@ -113,9 +113,7 @@ #include #include #include -/* - * #include - */ +#include #include #include @@ -127,6 +125,7 @@ IMPLEMENT_PEM_rw(X509_REQ, X509_REQ, PEM_STRING_X509_REQ, X509_REQ) IMPLEMENT_PEM_write(X509_REQ_NEW, X509_REQ, PEM_STRING_X509_REQ_OLD, X509_REQ) IMPLEMENT_PEM_rw(X509_CRL, X509_CRL, PEM_STRING_X509_CRL, X509_CRL) +IMPLEMENT_PEM_rw(PKCS7, PKCS7, PEM_STRING_PKCS7, PKCS7) /* * We treat RSA or DSA private keys as a special case. For private keys we diff --git a/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c new file mode 100644 index 000000000..394044a94 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c @@ -0,0 +1,360 @@ +/* crypto/pem/pem_info.c */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifndef OPENSSL_NO_FP_API +STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + STACK_OF(X509_INFO) *ret = PEM_X509_INFO_read_bio(b, sk, cb, u); + BIO_free(b); + return ret; +} +#endif + +enum parse_result_t { + parse_ok, + parse_error, + parse_new_entry, +}; + +static enum parse_result_t parse_x509(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->x509 != NULL) { + return parse_new_entry; + } + info->x509 = d2i_X509(NULL, &data, len); + return info->x509 != NULL ? parse_ok : parse_error; +} + +static enum parse_result_t parse_x509_aux(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->x509 != NULL) { + return parse_new_entry; + } + info->x509 = d2i_X509_AUX(NULL, &data, len); + return info->x509 != NULL ? parse_ok : parse_error; +} + +static enum parse_result_t parse_crl(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->crl != NULL) { + return parse_new_entry; + } + info->crl = d2i_X509_CRL(NULL, &data, len); + return info->crl != NULL ? parse_ok : parse_error; +} + +static enum parse_result_t parse_key(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->x_pkey != NULL) { + return parse_new_entry; + } + info->x_pkey = X509_PKEY_new(); + if (info->x_pkey == NULL) { + return parse_error; + } + info->x_pkey->dec_pkey = d2i_PrivateKey(key_type, NULL, &data, len); + return info->x_pkey->dec_pkey != NULL ? parse_ok : parse_error; +} + +STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u) +{ + X509_INFO *info = NULL; + char *name = NULL, *header = NULL; + unsigned char *data = NULL; + long len; + int ok = 0; + STACK_OF(X509_INFO) *ret = NULL; + + if (sk == NULL) { + ret = sk_X509_INFO_new_null(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + return NULL; + } + } else { + ret = sk; + } + size_t orig_num = sk_X509_INFO_num(ret); + + info = X509_INFO_new(); + if (info == NULL) { + goto err; + } + + for (;;) { + if (!PEM_read_bio(bp, &name, &header, &data, &len)) { + uint32_t error = ERR_peek_last_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE) { + ERR_clear_error(); + break; + } + goto err; + } + + enum parse_result_t (*parse_function)(X509_INFO *, const uint8_t *, + size_t, int) = NULL; + int key_type = EVP_PKEY_NONE; + if (strcmp(name, PEM_STRING_X509) == 0 || + strcmp(name, PEM_STRING_X509_OLD) == 0) { + parse_function = parse_x509; + } else if (strcmp(name, PEM_STRING_X509_TRUSTED) == 0) { + parse_function = parse_x509_aux; + } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) { + parse_function = parse_crl; + } else if (strcmp(name, PEM_STRING_RSA) == 0) { + parse_function = parse_key; + key_type = EVP_PKEY_RSA; + } else if (strcmp(name, PEM_STRING_DSA) == 0) { + parse_function = parse_key; + key_type = EVP_PKEY_DSA; + } else if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) { + parse_function = parse_key; + key_type = EVP_PKEY_EC; + } + + /* If a private key has a header, assume it is encrypted. */ + if (key_type != EVP_PKEY_NONE && strlen(header) > 10) { + if (info->x_pkey != NULL) { + if (!sk_X509_INFO_push(ret, info)) { + goto err; + } + info = X509_INFO_new(); + if (info == NULL) { + goto err; + } + } + /* Historically, raw entries pushed an empty key. */ + info->x_pkey = X509_PKEY_new(); + if (info->x_pkey == NULL || + !PEM_get_EVP_CIPHER_INFO(header, &info->enc_cipher)) { + goto err; + } + info->enc_data = (char *)data; + info->enc_len = (int)len; + data = NULL; + } else if (parse_function != NULL) { + EVP_CIPHER_INFO cipher; + if (!PEM_get_EVP_CIPHER_INFO(header, &cipher) || + !PEM_do_header(&cipher, data, &len, cb, u)) { + goto err; + } + enum parse_result_t result = + parse_function(info, data, len, key_type); + if (result == parse_new_entry) { + if (!sk_X509_INFO_push(ret, info)) { + goto err; + } + info = X509_INFO_new(); + if (info == NULL) { + goto err; + } + result = parse_function(info, data, len, key_type); + } + if (result != parse_ok) { + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + goto err; + } + } + OPENSSL_free(name); + OPENSSL_free(header); + OPENSSL_free(data); + name = NULL; + header = NULL; + data = NULL; + } + + /* Push the last entry on the stack if not empty. */ + if (info->x509 != NULL || info->crl != NULL || + info->x_pkey != NULL || info->enc_data != NULL) { + if (!sk_X509_INFO_push(ret, info)) { + goto err; + } + info = NULL; + } + + ok = 1; + + err: + X509_INFO_free(info); + if (!ok) { + while (sk_X509_INFO_num(ret) > orig_num) { + X509_INFO_free(sk_X509_INFO_pop(ret)); + } + if (ret != sk) { + sk_X509_INFO_free(ret); + } + ret = NULL; + } + + OPENSSL_free(name); + OPENSSL_free(header); + OPENSSL_free(data); + return ret; +} + +/* A TJH addition */ +int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, + unsigned char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + int i, ret = 0; + unsigned char *data = NULL; + const char *objstr = NULL; + char buf[PEM_BUFSIZE]; + unsigned char *iv = NULL; + unsigned iv_len = 0; + + if (enc != NULL) { + iv_len = EVP_CIPHER_iv_length(enc); + objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); + if (objstr == NULL) { + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); + goto err; + } + } + + /* + * now for the fun part ... if we have a private key then we have to be + * able to handle a not-yet-decrypted key being written out correctly ... + * if it is decrypted or it is non-encrypted then we use the base code + */ + if (xi->x_pkey != NULL) { + if ((xi->enc_data != NULL) && (xi->enc_len > 0)) { + if (enc == NULL) { + OPENSSL_PUT_ERROR(PEM, PEM_R_CIPHER_IS_NULL); + goto err; + } + + /* copy from weirdo names into more normal things */ + iv = xi->enc_cipher.iv; + data = (unsigned char *)xi->enc_data; + i = xi->enc_len; + + /* + * we take the encryption data from the internal stuff rather + * than what the user has passed us ... as we have to match + * exactly for some strange reason + */ + objstr = OBJ_nid2sn(EVP_CIPHER_nid(xi->enc_cipher.cipher)); + if (objstr == NULL) { + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); + goto err; + } + + /* create the right magic header stuff */ + assert(strlen(objstr) + 23 + 2 * iv_len + 13 <= sizeof buf); + buf[0] = '\0'; + PEM_proc_type(buf, PEM_TYPE_ENCRYPTED); + PEM_dek_info(buf, objstr, iv_len, (char *)iv); + + /* use the normal code to write things out */ + i = PEM_write_bio(bp, PEM_STRING_RSA, buf, data, i); + if (i <= 0) + goto err; + } else { + /* Add DSA/DH */ + /* normal optionally encrypted stuff */ + if (PEM_write_bio_RSAPrivateKey(bp, + xi->x_pkey->dec_pkey->pkey.rsa, + enc, kstr, klen, cb, u) <= 0) + goto err; + } + } + + /* if we have a certificate then write it out now */ + if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp, xi->x509) <= 0)) + goto err; + + /* + * we are ignoring anything else that is loaded into the X509_INFO + * structure for the moment ... as I don't need it so I'm not coding it + * here and Eric can do it when this makes it into the base library --tjh + */ + + ret = 1; + +err: + OPENSSL_cleanse(buf, PEM_BUFSIZE); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c.grpc_back new file mode 100644 index 000000000..1cda35bce --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_info.c.grpc_back @@ -0,0 +1,360 @@ +/* crypto/pem/pem_info.c */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#ifndef OPENSSL_NO_FP_API +STACK_OF(X509_INFO) *PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u) +{ + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); + return 0; + } + STACK_OF(X509_INFO) *ret = PEM_X509_INFO_read_bio(b, sk, cb, u); + BIO_free(b); + return ret; +} +#endif + +enum parse_result_t { + parse_ok, + parse_error, + parse_new_entry, +}; + +static enum parse_result_t parse_x509(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->x509 != NULL) { + return parse_new_entry; + } + info->x509 = d2i_X509(NULL, &data, len); + return info->x509 != NULL ? parse_ok : parse_error; +} + +static enum parse_result_t parse_x509_aux(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->x509 != NULL) { + return parse_new_entry; + } + info->x509 = d2i_X509_AUX(NULL, &data, len); + return info->x509 != NULL ? parse_ok : parse_error; +} + +static enum parse_result_t parse_crl(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->crl != NULL) { + return parse_new_entry; + } + info->crl = d2i_X509_CRL(NULL, &data, len); + return info->crl != NULL ? parse_ok : parse_error; +} + +static enum parse_result_t parse_key(X509_INFO *info, const uint8_t *data, + size_t len, int key_type) +{ + if (info->x_pkey != NULL) { + return parse_new_entry; + } + info->x_pkey = X509_PKEY_new(); + if (info->x_pkey == NULL) { + return parse_error; + } + info->x_pkey->dec_pkey = d2i_PrivateKey(key_type, NULL, &data, len); + return info->x_pkey->dec_pkey != NULL ? parse_ok : parse_error; +} + +STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, + pem_password_cb *cb, void *u) +{ + X509_INFO *info = NULL; + char *name = NULL, *header = NULL; + unsigned char *data = NULL; + long len; + int ok = 0; + STACK_OF(X509_INFO) *ret = NULL; + + if (sk == NULL) { + ret = sk_X509_INFO_new_null(); + if (ret == NULL) { + OPENSSL_PUT_ERROR(PEM, ERR_R_MALLOC_FAILURE); + return NULL; + } + } else { + ret = sk; + } + size_t orig_num = sk_X509_INFO_num(ret); + + info = X509_INFO_new(); + if (info == NULL) { + goto err; + } + + for (;;) { + if (!PEM_read_bio(bp, &name, &header, &data, &len)) { + uint32_t error = ERR_peek_last_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE) { + ERR_clear_error(); + break; + } + goto err; + } + + enum parse_result_t (*parse_function)(X509_INFO *, const uint8_t *, + size_t, int) = NULL; + int key_type = EVP_PKEY_NONE; + if (strcmp(name, PEM_STRING_X509) == 0 || + strcmp(name, PEM_STRING_X509_OLD) == 0) { + parse_function = parse_x509; + } else if (strcmp(name, PEM_STRING_X509_TRUSTED) == 0) { + parse_function = parse_x509_aux; + } else if (strcmp(name, PEM_STRING_X509_CRL) == 0) { + parse_function = parse_crl; + } else if (strcmp(name, PEM_STRING_RSA) == 0) { + parse_function = parse_key; + key_type = EVP_PKEY_RSA; + } else if (strcmp(name, PEM_STRING_DSA) == 0) { + parse_function = parse_key; + key_type = EVP_PKEY_DSA; + } else if (strcmp(name, PEM_STRING_ECPRIVATEKEY) == 0) { + parse_function = parse_key; + key_type = EVP_PKEY_EC; + } + + /* If a private key has a header, assume it is encrypted. */ + if (key_type != EVP_PKEY_NONE && strlen(header) > 10) { + if (info->x_pkey != NULL) { + if (!sk_X509_INFO_push(ret, info)) { + goto err; + } + info = X509_INFO_new(); + if (info == NULL) { + goto err; + } + } + /* Historically, raw entries pushed an empty key. */ + info->x_pkey = X509_PKEY_new(); + if (info->x_pkey == NULL || + !PEM_get_EVP_CIPHER_INFO(header, &info->enc_cipher)) { + goto err; + } + info->enc_data = (char *)data; + info->enc_len = (int)len; + data = NULL; + } else if (parse_function != NULL) { + EVP_CIPHER_INFO cipher; + if (!PEM_get_EVP_CIPHER_INFO(header, &cipher) || + !PEM_do_header(&cipher, data, &len, cb, u)) { + goto err; + } + enum parse_result_t result = + parse_function(info, data, len, key_type); + if (result == parse_new_entry) { + if (!sk_X509_INFO_push(ret, info)) { + goto err; + } + info = X509_INFO_new(); + if (info == NULL) { + goto err; + } + result = parse_function(info, data, len, key_type); + } + if (result != parse_ok) { + OPENSSL_PUT_ERROR(PEM, ERR_R_ASN1_LIB); + goto err; + } + } + OPENSSL_free(name); + OPENSSL_free(header); + OPENSSL_free(data); + name = NULL; + header = NULL; + data = NULL; + } + + /* Push the last entry on the stack if not empty. */ + if (info->x509 != NULL || info->crl != NULL || + info->x_pkey != NULL || info->enc_data != NULL) { + if (!sk_X509_INFO_push(ret, info)) { + goto err; + } + info = NULL; + } + + ok = 1; + + err: + X509_INFO_free(info); + if (!ok) { + while (sk_X509_INFO_num(ret) > orig_num) { + X509_INFO_free(sk_X509_INFO_pop(ret)); + } + if (ret != sk) { + sk_X509_INFO_free(ret); + } + ret = NULL; + } + + OPENSSL_free(name); + OPENSSL_free(header); + OPENSSL_free(data); + return ret; +} + +/* A TJH addition */ +int PEM_X509_INFO_write_bio(BIO *bp, X509_INFO *xi, EVP_CIPHER *enc, + unsigned char *kstr, int klen, + pem_password_cb *cb, void *u) +{ + int i, ret = 0; + unsigned char *data = NULL; + const char *objstr = NULL; + char buf[PEM_BUFSIZE]; + unsigned char *iv = NULL; + unsigned iv_len = 0; + + if (enc != NULL) { + iv_len = EVP_CIPHER_iv_length(enc); + objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); + if (objstr == NULL) { + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); + goto err; + } + } + + /* + * now for the fun part ... if we have a private key then we have to be + * able to handle a not-yet-decrypted key being written out correctly ... + * if it is decrypted or it is non-encrypted then we use the base code + */ + if (xi->x_pkey != NULL) { + if ((xi->enc_data != NULL) && (xi->enc_len > 0)) { + if (enc == NULL) { + OPENSSL_PUT_ERROR(PEM, PEM_R_CIPHER_IS_NULL); + goto err; + } + + /* copy from weirdo names into more normal things */ + iv = xi->enc_cipher.iv; + data = (unsigned char *)xi->enc_data; + i = xi->enc_len; + + /* + * we take the encryption data from the internal stuff rather + * than what the user has passed us ... as we have to match + * exactly for some strange reason + */ + objstr = OBJ_nid2sn(EVP_CIPHER_nid(xi->enc_cipher.cipher)); + if (objstr == NULL) { + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); + goto err; + } + + /* create the right magic header stuff */ + assert(strlen(objstr) + 23 + 2 * iv_len + 13 <= sizeof buf); + buf[0] = '\0'; + PEM_proc_type(buf, PEM_TYPE_ENCRYPTED); + PEM_dek_info(buf, objstr, iv_len, (char *)iv); + + /* use the normal code to write things out */ + i = PEM_write_bio(bp, PEM_STRING_RSA, buf, data, i); + if (i <= 0) + goto err; + } else { + /* Add DSA/DH */ + /* normal optionally encrypted stuff */ + if (PEM_write_bio_RSAPrivateKey(bp, + xi->x_pkey->dec_pkey->pkey.rsa, + enc, kstr, klen, cb, u) <= 0) + goto err; + } + } + + /* if we have a certificate then write it out now */ + if ((xi->x509 != NULL) && (PEM_write_bio_X509(bp, xi->x509) <= 0)) + goto err; + + /* + * we are ignoring anything else that is loaded into the X509_INFO + * structure for the moment ... as I don't need it so I'm not coding it + * here and Eric can do it when this makes it into the base library --tjh + */ + + ret = 1; + +err: + OPENSSL_cleanse(buf, PEM_BUFSIZE); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_lib.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_lib.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c index c21676a0e..741461181 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_lib.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c @@ -92,9 +92,9 @@ void PEM_proc_type(char *buf, int type) else str = "BAD-TYPE"; - BUF_strlcat(buf, "Proc-Type: 4,", PEM_BUFSIZE); - BUF_strlcat(buf, str, PEM_BUFSIZE); - BUF_strlcat(buf, "\n", PEM_BUFSIZE); + OPENSSL_strlcat(buf, "Proc-Type: 4,", PEM_BUFSIZE); + OPENSSL_strlcat(buf, str, PEM_BUFSIZE); + OPENSSL_strlcat(buf, "\n", PEM_BUFSIZE); } void PEM_dek_info(char *buf, const char *type, int len, char *str) @@ -103,9 +103,9 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str) long i; int j; - BUF_strlcat(buf, "DEK-Info: ", PEM_BUFSIZE); - BUF_strlcat(buf, type, PEM_BUFSIZE); - BUF_strlcat(buf, ",", PEM_BUFSIZE); + OPENSSL_strlcat(buf, "DEK-Info: ", PEM_BUFSIZE); + OPENSSL_strlcat(buf, type, PEM_BUFSIZE); + OPENSSL_strlcat(buf, ",", PEM_BUFSIZE); j = strlen(buf); if (j + (len * 2) + 1 > PEM_BUFSIZE) return; @@ -121,17 +121,14 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str) void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u) { - BIO *b; - void *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return NULL; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_ASN1_read_bio(d2i, name, b, x, cb, u); + void *ret = PEM_ASN1_read_bio(d2i, name, b, x, cb, u); BIO_free(b); - return (ret); + return ret; } #endif @@ -188,6 +185,26 @@ static int check_pem(const char *nm, const char *name) return 0; } +static const EVP_CIPHER *cipher_by_name(const char *name) +{ + /* This is similar to the (deprecated) function |EVP_get_cipherbyname|. Note + * the PEM code assumes that ciphers have at least 8 bytes of IV, at most 20 + * bytes of overhead and generally behave like CBC mode. */ + if (0 == strcmp(name, SN_des_cbc)) { + return EVP_des_cbc(); + } else if (0 == strcmp(name, SN_des_ede3_cbc)) { + return EVP_des_ede3_cbc(); + } else if (0 == strcmp(name, SN_aes_128_cbc)) { + return EVP_aes_128_cbc(); + } else if (0 == strcmp(name, SN_aes_192_cbc)) { + return EVP_aes_192_cbc(); + } else if (0 == strcmp(name, SN_aes_256_cbc)) { + return EVP_aes_256_cbc(); + } else { + return NULL; + } +} + int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u) @@ -200,8 +217,11 @@ int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, for (;;) { if (!PEM_read_bio(bp, &nm, &header, &data, &len)) { - if (ERR_GET_REASON(ERR_peek_error()) == PEM_R_NO_START_LINE) + uint32_t error = ERR_peek_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE) { ERR_add_error_data(2, "Expecting: ", name); + } return 0; } if (check_pem(nm, name)) @@ -237,17 +257,14 @@ int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, void *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *callback, void *u) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_ASN1_write_bio(i2d, name, b, x, enc, kstr, klen, callback, u); + int ret = PEM_ASN1_write_bio(i2d, name, b, x, enc, kstr, klen, callback, u); BIO_free(b); - return (ret); + return ret; } #endif @@ -265,7 +282,9 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, if (enc != NULL) { objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL || EVP_CIPHER_iv_length(enc) == 0) { + if (objstr == NULL || + cipher_by_name(objstr) == NULL || + EVP_CIPHER_iv_length(enc) < 8) { OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); goto err; } @@ -393,26 +412,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, return (1); } -static const EVP_CIPHER *cipher_by_name(const char *name) -{ - /* This is similar to the (deprecated) function |EVP_get_cipherbyname|. */ - if (0 == strcmp(name, SN_rc4)) { - return EVP_rc4(); - } else if (0 == strcmp(name, SN_des_cbc)) { - return EVP_des_cbc(); - } else if (0 == strcmp(name, SN_des_ede3_cbc)) { - return EVP_des_ede3_cbc(); - } else if (0 == strcmp(name, SN_aes_128_cbc)) { - return EVP_aes_128_cbc(); - } else if (0 == strcmp(name, SN_aes_192_cbc)) { - return EVP_aes_192_cbc(); - } else if (0 == strcmp(name, SN_aes_256_cbc)) { - return EVP_aes_256_cbc(); - } else { - return NULL; - } -} - int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) { const EVP_CIPHER *enc = NULL; @@ -420,6 +419,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) char **header_pp = &header; cipher->cipher = NULL; + OPENSSL_memset(cipher->iv, 0, sizeof(cipher->iv)); if ((header == NULL) || (*header == '\0') || (*header == '\n')) return (1); if (strncmp(header, "Proc-Type: ", 11) != 0) { @@ -466,6 +466,13 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_ENCRYPTION); return (0); } + // The IV parameter must be at least 8 bytes long to be used as the salt in + // the KDF. (This should not happen given |cipher_by_name|.) + if (EVP_CIPHER_iv_length(enc) < 8) { + assert(0); + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_ENCRYPTION); + return 0; + } if (!load_iv(header_pp, &(cipher->iv[0]), EVP_CIPHER_iv_length(enc))) return (0); @@ -504,15 +511,12 @@ static int load_iv(char **fromp, unsigned char *to, int num) int PEM_write(FILE *fp, const char *name, const char *header, const unsigned char *data, long len) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_write_bio(b, name, header, data, len); + int ret = PEM_write_bio(b, name, header, data, len); BIO_free(b); return (ret); } @@ -578,15 +582,12 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header, int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, long *len) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_read_bio(b, name, header, data, len); + int ret = PEM_read_bio(b, name, header, data, len); BIO_free(b); return (ret); } @@ -771,6 +772,6 @@ int PEM_def_callback(char *buf, int size, int rwflag, void *userdata) if (len >= (size_t)size) { return 0; } - BUF_strlcpy(buf, userdata, (size_t)size); + OPENSSL_strlcpy(buf, userdata, (size_t)size); return len; } diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_lib.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_lib.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c.grpc_back index 8f8909613..00c0e0afd 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_lib.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_lib.c.grpc_back @@ -92,9 +92,9 @@ void PEM_proc_type(char *buf, int type) else str = "BAD-TYPE"; - BUF_strlcat(buf, "Proc-Type: 4,", PEM_BUFSIZE); - BUF_strlcat(buf, str, PEM_BUFSIZE); - BUF_strlcat(buf, "\n", PEM_BUFSIZE); + OPENSSL_strlcat(buf, "Proc-Type: 4,", PEM_BUFSIZE); + OPENSSL_strlcat(buf, str, PEM_BUFSIZE); + OPENSSL_strlcat(buf, "\n", PEM_BUFSIZE); } void PEM_dek_info(char *buf, const char *type, int len, char *str) @@ -103,9 +103,9 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str) long i; int j; - BUF_strlcat(buf, "DEK-Info: ", PEM_BUFSIZE); - BUF_strlcat(buf, type, PEM_BUFSIZE); - BUF_strlcat(buf, ",", PEM_BUFSIZE); + OPENSSL_strlcat(buf, "DEK-Info: ", PEM_BUFSIZE); + OPENSSL_strlcat(buf, type, PEM_BUFSIZE); + OPENSSL_strlcat(buf, ",", PEM_BUFSIZE); j = strlen(buf); if (j + (len * 2) + 1 > PEM_BUFSIZE) return; @@ -121,17 +121,14 @@ void PEM_dek_info(char *buf, const char *type, int len, char *str) void *PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u) { - BIO *b; - void *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return NULL; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_ASN1_read_bio(d2i, name, b, x, cb, u); + void *ret = PEM_ASN1_read_bio(d2i, name, b, x, cb, u); BIO_free(b); - return (ret); + return ret; } #endif @@ -188,6 +185,26 @@ static int check_pem(const char *nm, const char *name) return 0; } +static const EVP_CIPHER *cipher_by_name(const char *name) +{ + /* This is similar to the (deprecated) function |EVP_get_cipherbyname|. Note + * the PEM code assumes that ciphers have at least 8 bytes of IV, at most 20 + * bytes of overhead and generally behave like CBC mode. */ + if (0 == strcmp(name, SN_des_cbc)) { + return EVP_des_cbc(); + } else if (0 == strcmp(name, SN_des_ede3_cbc)) { + return EVP_des_ede3_cbc(); + } else if (0 == strcmp(name, SN_aes_128_cbc)) { + return EVP_aes_128_cbc(); + } else if (0 == strcmp(name, SN_aes_192_cbc)) { + return EVP_aes_192_cbc(); + } else if (0 == strcmp(name, SN_aes_256_cbc)) { + return EVP_aes_256_cbc(); + } else { + return NULL; + } +} + int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u) @@ -200,8 +217,11 @@ int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, for (;;) { if (!PEM_read_bio(bp, &nm, &header, &data, &len)) { - if (ERR_GET_REASON(ERR_peek_error()) == PEM_R_NO_START_LINE) + uint32_t error = ERR_peek_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE) { ERR_add_error_data(2, "Expecting: ", name); + } return 0; } if (check_pem(nm, name)) @@ -237,17 +257,14 @@ int PEM_ASN1_write(i2d_of_void *i2d, const char *name, FILE *fp, void *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *callback, void *u) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_ASN1_write_bio(i2d, name, b, x, enc, kstr, klen, callback, u); + int ret = PEM_ASN1_write_bio(i2d, name, b, x, enc, kstr, klen, callback, u); BIO_free(b); - return (ret); + return ret; } #endif @@ -265,7 +282,9 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, if (enc != NULL) { objstr = OBJ_nid2sn(EVP_CIPHER_nid(enc)); - if (objstr == NULL || EVP_CIPHER_iv_length(enc) == 0) { + if (objstr == NULL || + cipher_by_name(objstr) == NULL || + EVP_CIPHER_iv_length(enc) < 8) { OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_CIPHER); goto err; } @@ -393,26 +412,6 @@ int PEM_do_header(EVP_CIPHER_INFO *cipher, unsigned char *data, long *plen, return (1); } -static const EVP_CIPHER *cipher_by_name(const char *name) -{ - /* This is similar to the (deprecated) function |EVP_get_cipherbyname|. */ - if (0 == strcmp(name, SN_rc4)) { - return EVP_rc4(); - } else if (0 == strcmp(name, SN_des_cbc)) { - return EVP_des_cbc(); - } else if (0 == strcmp(name, SN_des_ede3_cbc)) { - return EVP_des_ede3_cbc(); - } else if (0 == strcmp(name, SN_aes_128_cbc)) { - return EVP_aes_128_cbc(); - } else if (0 == strcmp(name, SN_aes_192_cbc)) { - return EVP_aes_192_cbc(); - } else if (0 == strcmp(name, SN_aes_256_cbc)) { - return EVP_aes_256_cbc(); - } else { - return NULL; - } -} - int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) { const EVP_CIPHER *enc = NULL; @@ -420,6 +419,7 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) char **header_pp = &header; cipher->cipher = NULL; + OPENSSL_memset(cipher->iv, 0, sizeof(cipher->iv)); if ((header == NULL) || (*header == '\0') || (*header == '\n')) return (1); if (strncmp(header, "Proc-Type: ", 11) != 0) { @@ -466,6 +466,13 @@ int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher) OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_ENCRYPTION); return (0); } + // The IV parameter must be at least 8 bytes long to be used as the salt in + // the KDF. (This should not happen given |cipher_by_name|.) + if (EVP_CIPHER_iv_length(enc) < 8) { + assert(0); + OPENSSL_PUT_ERROR(PEM, PEM_R_UNSUPPORTED_ENCRYPTION); + return 0; + } if (!load_iv(header_pp, &(cipher->iv[0]), EVP_CIPHER_iv_length(enc))) return (0); @@ -504,15 +511,12 @@ static int load_iv(char **fromp, unsigned char *to, int num) int PEM_write(FILE *fp, const char *name, const char *header, const unsigned char *data, long len) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_write_bio(b, name, header, data, len); + int ret = PEM_write_bio(b, name, header, data, len); BIO_free(b); return (ret); } @@ -578,15 +582,12 @@ int PEM_write_bio(BIO *bp, const char *name, const char *header, int PEM_read(FILE *fp, char **name, char **header, unsigned char **data, long *len) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_read_bio(b, name, header, data, len); + int ret = PEM_read_bio(b, name, header, data, len); BIO_free(b); return (ret); } @@ -771,6 +772,6 @@ int PEM_def_callback(char *buf, int size, int rwflag, void *userdata) if (len >= (size_t)size) { return 0; } - BUF_strlcpy(buf, userdata, (size_t)size); + OPENSSL_strlcpy(buf, userdata, (size_t)size); return len; } diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_oth.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_oth.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c index ad7985574..d9df9c15b 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_oth.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c @@ -59,7 +59,6 @@ #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_oth.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_oth.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c.grpc_back index 8530c5675..797f8223d 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_oth.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_oth.c.grpc_back @@ -59,7 +59,6 @@ #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_pk8.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_pk8.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c index 533edba60..507b8e168 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_pk8.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c @@ -56,7 +56,6 @@ #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_pk8.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_pk8.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c.grpc_back index 15385ecaf..819a3292c 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_pk8.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pk8.c.grpc_back @@ -56,7 +56,6 @@ #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_pkey.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_pkey.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c index a6d1815cd..a7160a6d9 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_pkey.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -155,31 +154,26 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u) { - BIO *b; - EVP_PKEY *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return NULL; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_read_bio_PrivateKey(b, x, cb, u); + EVP_PKEY *ret = PEM_read_bio_PrivateKey(b, x, cb, u); BIO_free(b); - return (ret); + return ret; } int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { - BIO *b; - int ret; - - if ((b = BIO_new_fp(fp, BIO_NOCLOSE)) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); return 0; } - ret = PEM_write_bio_PrivateKey(b, x, enc, kstr, klen, cb, u); + int ret = PEM_write_bio_PrivateKey(b, x, enc, kstr, klen, cb, u); BIO_free(b); return ret; } @@ -212,16 +206,13 @@ DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) #ifndef OPENSSL_NO_FP_API DH *PEM_read_DHparams(FILE *fp, DH **x, pem_password_cb *cb, void *u) { - BIO *b; - DH *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return NULL; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_read_bio_DHparams(b, x, cb, u); + DH *ret = PEM_read_bio_DHparams(b, x, cb, u); BIO_free(b); - return (ret); + return ret; } #endif diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_pkey.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_pkey.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c.grpc_back index 9fbaeef8d..5776535ed 100644 --- a/Pods/BoringSSL-GRPC/crypto/pem/pem_pkey.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_pkey.c.grpc_back @@ -59,7 +59,6 @@ #include #include -#include #include #include #include @@ -155,31 +154,26 @@ int PEM_write_bio_PrivateKey(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, EVP_PKEY *PEM_read_PrivateKey(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u) { - BIO *b; - EVP_PKEY *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return NULL; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_read_bio_PrivateKey(b, x, cb, u); + EVP_PKEY *ret = PEM_read_bio_PrivateKey(b, x, cb, u); BIO_free(b); - return (ret); + return ret; } int PEM_write_PrivateKey(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cb, void *u) { - BIO *b; - int ret; - - if ((b = BIO_new_fp(fp, BIO_NOCLOSE)) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); return 0; } - ret = PEM_write_bio_PrivateKey(b, x, enc, kstr, klen, cb, u); + int ret = PEM_write_bio_PrivateKey(b, x, enc, kstr, klen, cb, u); BIO_free(b); return ret; } @@ -212,16 +206,13 @@ DH *PEM_read_bio_DHparams(BIO *bp, DH **x, pem_password_cb *cb, void *u) #ifndef OPENSSL_NO_FP_API DH *PEM_read_DHparams(FILE *fp, DH **x, pem_password_cb *cb, void *u) { - BIO *b; - DH *ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(PEM, ERR_R_BUF_LIB); - return (0); + return NULL; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = PEM_read_bio_DHparams(b, x, cb, u); + DH *ret = PEM_read_bio_DHparams(b, x, cb, u); BIO_free(b); - return (ret); + return ret; } #endif diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_x509.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_x509.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_x509.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_x509.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_x509.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_xaux.c b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_xaux.c rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c diff --git a/Pods/BoringSSL-GRPC/crypto/pem/pem_xaux.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/pem/pem_xaux.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pem/pem_xaux.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs7/internal.h b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/pkcs7/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs7/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/pkcs7/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pkcs7/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7.c b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c similarity index 88% rename from Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7.c rename to Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c index f9714bd00..3b54a7f7d 100644 --- a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c @@ -41,23 +41,14 @@ static const uint8_t kPKCS7SignedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, // It returns one on success or zero on error. On error, |*der_bytes| is // NULL. int pkcs7_parse_header(uint8_t **der_bytes, CBS *out, CBS *cbs) { - size_t der_len; CBS in, content_info, content_type, wrapped_signed_data, signed_data; uint64_t version; // The input may be in BER format. *der_bytes = NULL; - if (!CBS_asn1_ber_to_der(cbs, der_bytes, &der_len)) { - return 0; - } - if (*der_bytes != NULL) { - CBS_init(&in, *der_bytes, der_len); - } else { - CBS_init(&in, CBS_data(cbs), CBS_len(cbs)); - } - - // See https://tools.ietf.org/html/rfc2315#section-7 - if (!CBS_get_asn1(&in, &content_info, CBS_ASN1_SEQUENCE) || + if (!CBS_asn1_ber_to_der(cbs, &in, der_bytes) || + // See https://tools.ietf.org/html/rfc2315#section-7 + !CBS_get_asn1(&in, &content_info, CBS_ASN1_SEQUENCE) || !CBS_get_asn1(&content_info, &content_type, CBS_ASN1_OBJECT)) { goto err; } @@ -96,20 +87,21 @@ int PKCS7_get_raw_certificates(STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool) { CBS signed_data, certificates; uint8_t *der_bytes = NULL; - int ret = 0; + int ret = 0, has_certificates; const size_t initial_certs_len = sk_CRYPTO_BUFFER_num(out_certs); - if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs)) { - return 0; - } - // See https://tools.ietf.org/html/rfc2315#section-9.1 - if (!CBS_get_asn1(&signed_data, &certificates, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_NO_CERTIFICATES_INCLUDED); + if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs) || + !CBS_get_optional_asn1( + &signed_data, &certificates, &has_certificates, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { goto err; } + if (!has_certificates) { + CBS_init(&certificates, NULL, 0); + } + while (CBS_len(&certificates) > 0) { CBS cert; if (!CBS_get_asn1_element(&certificates, &cert, CBS_ASN1_SEQUENCE)) { @@ -142,7 +134,7 @@ int PKCS7_get_raw_certificates(STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg), const void *arg) { CBB outer_seq, oid, wrapped_seq, seq, version_bytes, digest_algos_set, - content_info; + content_info, signer_infos; // See https://tools.ietf.org/html/rfc2315#section-7 if (!CBB_add_asn1(out, &outer_seq, CBS_ASN1_SEQUENCE) || @@ -158,7 +150,8 @@ int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg), !CBB_add_asn1(&seq, &content_info, CBS_ASN1_SEQUENCE) || !CBB_add_asn1(&content_info, &oid, CBS_ASN1_OBJECT) || !CBB_add_bytes(&oid, kPKCS7Data, sizeof(kPKCS7Data)) || - !cb(&seq, arg)) { + !cb(&seq, arg) || + !CBB_add_asn1(&seq, &signer_infos, CBS_ASN1_SET)) { return 0; } diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c.grpc_back similarity index 88% rename from Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c.grpc_back index fc175a940..1d0b13902 100644 --- a/Pods/BoringSSL-GRPC/crypto/pkcs7/pkcs7.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7.c.grpc_back @@ -41,23 +41,14 @@ static const uint8_t kPKCS7SignedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, // It returns one on success or zero on error. On error, |*der_bytes| is // NULL. int pkcs7_parse_header(uint8_t **der_bytes, CBS *out, CBS *cbs) { - size_t der_len; CBS in, content_info, content_type, wrapped_signed_data, signed_data; uint64_t version; // The input may be in BER format. *der_bytes = NULL; - if (!CBS_asn1_ber_to_der(cbs, der_bytes, &der_len)) { - return 0; - } - if (*der_bytes != NULL) { - CBS_init(&in, *der_bytes, der_len); - } else { - CBS_init(&in, CBS_data(cbs), CBS_len(cbs)); - } - - // See https://tools.ietf.org/html/rfc2315#section-7 - if (!CBS_get_asn1(&in, &content_info, CBS_ASN1_SEQUENCE) || + if (!CBS_asn1_ber_to_der(cbs, &in, der_bytes) || + // See https://tools.ietf.org/html/rfc2315#section-7 + !CBS_get_asn1(&in, &content_info, CBS_ASN1_SEQUENCE) || !CBS_get_asn1(&content_info, &content_type, CBS_ASN1_OBJECT)) { goto err; } @@ -96,20 +87,21 @@ int PKCS7_get_raw_certificates(STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool) { CBS signed_data, certificates; uint8_t *der_bytes = NULL; - int ret = 0; + int ret = 0, has_certificates; const size_t initial_certs_len = sk_CRYPTO_BUFFER_num(out_certs); - if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs)) { - return 0; - } - // See https://tools.ietf.org/html/rfc2315#section-9.1 - if (!CBS_get_asn1(&signed_data, &certificates, - CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { - OPENSSL_PUT_ERROR(PKCS7, PKCS7_R_NO_CERTIFICATES_INCLUDED); + if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs) || + !CBS_get_optional_asn1( + &signed_data, &certificates, &has_certificates, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { goto err; } + if (!has_certificates) { + CBS_init(&certificates, NULL, 0); + } + while (CBS_len(&certificates) > 0) { CBS cert; if (!CBS_get_asn1_element(&certificates, &cert, CBS_ASN1_SEQUENCE)) { @@ -142,7 +134,7 @@ err: int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg), const void *arg) { CBB outer_seq, oid, wrapped_seq, seq, version_bytes, digest_algos_set, - content_info; + content_info, signer_infos; // See https://tools.ietf.org/html/rfc2315#section-7 if (!CBB_add_asn1(out, &outer_seq, CBS_ASN1_SEQUENCE) || @@ -158,7 +150,8 @@ int pkcs7_bundle(CBB *out, int (*cb)(CBB *out, const void *arg), !CBB_add_asn1(&seq, &content_info, CBS_ASN1_SEQUENCE) || !CBB_add_asn1(&content_info, &oid, CBS_ASN1_OBJECT) || !CBB_add_bytes(&oid, kPKCS7Data, sizeof(kPKCS7Data)) || - !cb(&seq, arg)) { + !cb(&seq, arg) || + !CBB_add_asn1(&seq, &signer_infos, CBS_ASN1_SET)) { return 0; } diff --git a/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c new file mode 100644 index 000000000..b4207141a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c @@ -0,0 +1,385 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../internal.h" + + +int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs) { + int ret = 0; + const size_t initial_certs_len = sk_X509_num(out_certs); + STACK_OF(CRYPTO_BUFFER) *raw = sk_CRYPTO_BUFFER_new_null(); + if (raw == NULL || + !PKCS7_get_raw_certificates(raw, cbs, NULL)) { + goto err; + } + + for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(raw); i++) { + CRYPTO_BUFFER *buf = sk_CRYPTO_BUFFER_value(raw, i); + X509 *x509 = X509_parse_from_buffer(buf); + if (x509 == NULL || + !sk_X509_push(out_certs, x509)) { + X509_free(x509); + goto err; + } + } + + ret = 1; + +err: + sk_CRYPTO_BUFFER_pop_free(raw, CRYPTO_BUFFER_free); + if (!ret) { + while (sk_X509_num(out_certs) != initial_certs_len) { + X509 *x509 = sk_X509_pop(out_certs); + X509_free(x509); + } + } + + return ret; +} + +int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs) { + CBS signed_data, crls; + uint8_t *der_bytes = NULL; + int ret = 0, has_crls; + const size_t initial_crls_len = sk_X509_CRL_num(out_crls); + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs) || + // Even if only CRLs are included, there may be an empty certificates + // block. OpenSSL does this, for example. + !CBS_get_optional_asn1( + &signed_data, NULL, NULL, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + !CBS_get_optional_asn1( + &signed_data, &crls, &has_crls, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { + goto err; + } + + if (!has_crls) { + CBS_init(&crls, NULL, 0); + } + + while (CBS_len(&crls) > 0) { + CBS crl_data; + X509_CRL *crl; + const uint8_t *inp; + + if (!CBS_get_asn1_element(&crls, &crl_data, CBS_ASN1_SEQUENCE)) { + goto err; + } + + if (CBS_len(&crl_data) > LONG_MAX) { + goto err; + } + inp = CBS_data(&crl_data); + crl = d2i_X509_CRL(NULL, &inp, (long)CBS_len(&crl_data)); + if (!crl) { + goto err; + } + + assert(inp == CBS_data(&crl_data) + CBS_len(&crl_data)); + + if (sk_X509_CRL_push(out_crls, crl) == 0) { + X509_CRL_free(crl); + goto err; + } + } + + ret = 1; + +err: + OPENSSL_free(der_bytes); + + if (!ret) { + while (sk_X509_CRL_num(out_crls) != initial_crls_len) { + X509_CRL_free(sk_X509_CRL_pop(out_crls)); + } + } + + return ret; +} + +int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, BIO *pem_bio) { + uint8_t *data; + long len; + int ret; + + // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM + // internally will actually allow several other values too, including + // "CERTIFICATE". + if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, + PEM_STRING_PKCS7, pem_bio, + NULL /* password callback */, + NULL /* password callback argument */)) { + return 0; + } + + CBS cbs; + CBS_init(&cbs, data, len); + ret = PKCS7_get_certificates(out_certs, &cbs); + OPENSSL_free(data); + return ret; +} + +int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, BIO *pem_bio) { + uint8_t *data; + long len; + int ret; + + // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM + // internally will actually allow several other values too, including + // "CERTIFICATE". + if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, + PEM_STRING_PKCS7, pem_bio, + NULL /* password callback */, + NULL /* password callback argument */)) { + return 0; + } + + CBS cbs; + CBS_init(&cbs, data, len); + ret = PKCS7_get_CRLs(out_crls, &cbs); + OPENSSL_free(data); + return ret; +} + +static int pkcs7_bundle_certificates_cb(CBB *out, const void *arg) { + const STACK_OF(X509) *certs = arg; + size_t i; + CBB certificates; + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!CBB_add_asn1(out, &certificates, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { + return 0; + } + + for (i = 0; i < sk_X509_num(certs); i++) { + X509 *x509 = sk_X509_value(certs, i); + uint8_t *buf; + int len = i2d_X509(x509, NULL); + + if (len < 0 || + !CBB_add_space(&certificates, &buf, len) || + i2d_X509(x509, &buf) < 0) { + return 0; + } + } + + return CBB_flush(out); +} + +int PKCS7_bundle_certificates(CBB *out, const STACK_OF(X509) *certs) { + return pkcs7_bundle(out, pkcs7_bundle_certificates_cb, certs); +} + +static int pkcs7_bundle_crls_cb(CBB *out, const void *arg) { + const STACK_OF(X509_CRL) *crls = arg; + size_t i; + CBB crl_data; + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!CBB_add_asn1(out, &crl_data, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { + return 0; + } + + for (i = 0; i < sk_X509_CRL_num(crls); i++) { + X509_CRL *crl = sk_X509_CRL_value(crls, i); + uint8_t *buf; + int len = i2d_X509_CRL(crl, NULL); + + if (len < 0 || + !CBB_add_space(&crl_data, &buf, len) || + i2d_X509_CRL(crl, &buf) < 0) { + return 0; + } + } + + return CBB_flush(out); +} + +int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls) { + return pkcs7_bundle(out, pkcs7_bundle_crls_cb, crls); +} + +static PKCS7 *pkcs7_new(CBS *cbs) { + PKCS7 *ret = OPENSSL_malloc(sizeof(PKCS7)); + if (ret == NULL) { + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(PKCS7)); + ret->type = (ASN1_OBJECT *)OBJ_nid2obj(NID_pkcs7_signed); + ret->d.sign = OPENSSL_malloc(sizeof(PKCS7_SIGNED)); + if (ret->d.sign == NULL) { + goto err; + } + ret->d.sign->cert = sk_X509_new_null(); + ret->d.sign->crl = sk_X509_CRL_new_null(); + CBS copy = *cbs, copy2 = *cbs; + if (ret->d.sign->cert == NULL || ret->d.sign->crl == NULL || + !PKCS7_get_certificates(ret->d.sign->cert, ©) || + !PKCS7_get_CRLs(ret->d.sign->crl, cbs)) { + goto err; + } + + if (sk_X509_num(ret->d.sign->cert) == 0) { + sk_X509_free(ret->d.sign->cert); + ret->d.sign->cert = NULL; + } + + if (sk_X509_CRL_num(ret->d.sign->crl) == 0) { + sk_X509_CRL_free(ret->d.sign->crl); + ret->d.sign->crl = NULL; + } + + ret->ber_len = CBS_len(©2) - CBS_len(cbs); + ret->ber_bytes = OPENSSL_memdup(CBS_data(©2), ret->ber_len); + if (ret->ber_bytes == NULL) { + goto err; + } + + return ret; + +err: + PKCS7_free(ret); + return NULL; +} + +PKCS7 *d2i_PKCS7(PKCS7 **out, const uint8_t **inp, + size_t len) { + CBS cbs; + CBS_init(&cbs, *inp, len); + PKCS7 *ret = pkcs7_new(&cbs); + if (ret == NULL) { + return NULL; + } + *inp = CBS_data(&cbs); + if (out != NULL) { + PKCS7_free(*out); + *out = ret; + } + return ret; +} + +PKCS7 *d2i_PKCS7_bio(BIO *bio, PKCS7 **out) { + // Use a generous bound, to allow for PKCS#7 files containing large root sets. + static const size_t kMaxSize = 4 * 1024 * 1024; + uint8_t *data; + size_t len; + if (!BIO_read_asn1(bio, &data, &len, kMaxSize)) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, data, len); + PKCS7 *ret = pkcs7_new(&cbs); + OPENSSL_free(data); + if (out != NULL && ret != NULL) { + PKCS7_free(*out); + *out = ret; + } + return ret; +} + +int i2d_PKCS7(const PKCS7 *p7, uint8_t **out) { + if (p7->ber_len > INT_MAX) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + return -1; + } + + if (out == NULL) { + return (int)p7->ber_len; + } + + if (*out == NULL) { + *out = OPENSSL_malloc(p7->ber_len); + if (*out == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + return -1; + } + OPENSSL_memcpy(*out, p7->ber_bytes, p7->ber_len); + } else { + OPENSSL_memcpy(*out, p7->ber_bytes, p7->ber_len); + *out += p7->ber_len; + } + return (int)p7->ber_len; +} + +int i2d_PKCS7_bio(BIO *bio, const PKCS7 *p7) { + return BIO_write_all(bio, p7->ber_bytes, p7->ber_len); +} + +void PKCS7_free(PKCS7 *p7) { + if (p7 == NULL) { + return; + } + + OPENSSL_free(p7->ber_bytes); + ASN1_OBJECT_free(p7->type); + // We only supported signed data. + if (p7->d.sign != NULL) { + sk_X509_pop_free(p7->d.sign->cert, X509_free); + sk_X509_CRL_pop_free(p7->d.sign->crl, X509_CRL_free); + OPENSSL_free(p7->d.sign); + } + OPENSSL_free(p7); +} + +// We only support signed data, so these getters are no-ops. +int PKCS7_type_is_data(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_digest(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_encrypted(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_enveloped(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_signed(const PKCS7 *p7) { return 1; } +int PKCS7_type_is_signedAndEnveloped(const PKCS7 *p7) { return 0; } + +PKCS7 *PKCS7_sign(X509 *sign_cert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags) { + if (sign_cert != NULL || pkey != NULL || flags != PKCS7_DETACHED) { + OPENSSL_PUT_ERROR(PKCS7, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return NULL; + } + + uint8_t *der; + size_t len; + CBB cbb; + if (!CBB_init(&cbb, 2048) || + !PKCS7_bundle_certificates(&cbb, certs) || + !CBB_finish(&cbb, &der, &len)) { + CBB_cleanup(&cbb); + return NULL; + } + + CBS cbs; + CBS_init(&cbs, der, len); + PKCS7 *ret = pkcs7_new(&cbs); + OPENSSL_free(der); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c.grpc_back new file mode 100644 index 000000000..107bdea7f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs7/pkcs7_x509.c.grpc_back @@ -0,0 +1,385 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../internal.h" + + +int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs) { + int ret = 0; + const size_t initial_certs_len = sk_X509_num(out_certs); + STACK_OF(CRYPTO_BUFFER) *raw = sk_CRYPTO_BUFFER_new_null(); + if (raw == NULL || + !PKCS7_get_raw_certificates(raw, cbs, NULL)) { + goto err; + } + + for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(raw); i++) { + CRYPTO_BUFFER *buf = sk_CRYPTO_BUFFER_value(raw, i); + X509 *x509 = X509_parse_from_buffer(buf); + if (x509 == NULL || + !sk_X509_push(out_certs, x509)) { + X509_free(x509); + goto err; + } + } + + ret = 1; + +err: + sk_CRYPTO_BUFFER_pop_free(raw, CRYPTO_BUFFER_free); + if (!ret) { + while (sk_X509_num(out_certs) != initial_certs_len) { + X509 *x509 = sk_X509_pop(out_certs); + X509_free(x509); + } + } + + return ret; +} + +int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs) { + CBS signed_data, crls; + uint8_t *der_bytes = NULL; + int ret = 0, has_crls; + const size_t initial_crls_len = sk_X509_CRL_num(out_crls); + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!pkcs7_parse_header(&der_bytes, &signed_data, cbs) || + // Even if only CRLs are included, there may be an empty certificates + // block. OpenSSL does this, for example. + !CBS_get_optional_asn1( + &signed_data, NULL, NULL, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + !CBS_get_optional_asn1( + &signed_data, &crls, &has_crls, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { + goto err; + } + + if (!has_crls) { + CBS_init(&crls, NULL, 0); + } + + while (CBS_len(&crls) > 0) { + CBS crl_data; + X509_CRL *crl; + const uint8_t *inp; + + if (!CBS_get_asn1_element(&crls, &crl_data, CBS_ASN1_SEQUENCE)) { + goto err; + } + + if (CBS_len(&crl_data) > LONG_MAX) { + goto err; + } + inp = CBS_data(&crl_data); + crl = d2i_X509_CRL(NULL, &inp, (long)CBS_len(&crl_data)); + if (!crl) { + goto err; + } + + assert(inp == CBS_data(&crl_data) + CBS_len(&crl_data)); + + if (sk_X509_CRL_push(out_crls, crl) == 0) { + X509_CRL_free(crl); + goto err; + } + } + + ret = 1; + +err: + OPENSSL_free(der_bytes); + + if (!ret) { + while (sk_X509_CRL_num(out_crls) != initial_crls_len) { + X509_CRL_free(sk_X509_CRL_pop(out_crls)); + } + } + + return ret; +} + +int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, BIO *pem_bio) { + uint8_t *data; + long len; + int ret; + + // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM + // internally will actually allow several other values too, including + // "CERTIFICATE". + if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, + PEM_STRING_PKCS7, pem_bio, + NULL /* password callback */, + NULL /* password callback argument */)) { + return 0; + } + + CBS cbs; + CBS_init(&cbs, data, len); + ret = PKCS7_get_certificates(out_certs, &cbs); + OPENSSL_free(data); + return ret; +} + +int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, BIO *pem_bio) { + uint8_t *data; + long len; + int ret; + + // Even though we pass PEM_STRING_PKCS7 as the expected PEM type here, PEM + // internally will actually allow several other values too, including + // "CERTIFICATE". + if (!PEM_bytes_read_bio(&data, &len, NULL /* PEM type output */, + PEM_STRING_PKCS7, pem_bio, + NULL /* password callback */, + NULL /* password callback argument */)) { + return 0; + } + + CBS cbs; + CBS_init(&cbs, data, len); + ret = PKCS7_get_CRLs(out_crls, &cbs); + OPENSSL_free(data); + return ret; +} + +static int pkcs7_bundle_certificates_cb(CBB *out, const void *arg) { + const STACK_OF(X509) *certs = arg; + size_t i; + CBB certificates; + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!CBB_add_asn1(out, &certificates, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { + return 0; + } + + for (i = 0; i < sk_X509_num(certs); i++) { + X509 *x509 = sk_X509_value(certs, i); + uint8_t *buf; + int len = i2d_X509(x509, NULL); + + if (len < 0 || + !CBB_add_space(&certificates, &buf, len) || + i2d_X509(x509, &buf) < 0) { + return 0; + } + } + + return CBB_flush(out); +} + +int PKCS7_bundle_certificates(CBB *out, const STACK_OF(X509) *certs) { + return pkcs7_bundle(out, pkcs7_bundle_certificates_cb, certs); +} + +static int pkcs7_bundle_crls_cb(CBB *out, const void *arg) { + const STACK_OF(X509_CRL) *crls = arg; + size_t i; + CBB crl_data; + + // See https://tools.ietf.org/html/rfc2315#section-9.1 + if (!CBB_add_asn1(out, &crl_data, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 1)) { + return 0; + } + + for (i = 0; i < sk_X509_CRL_num(crls); i++) { + X509_CRL *crl = sk_X509_CRL_value(crls, i); + uint8_t *buf; + int len = i2d_X509_CRL(crl, NULL); + + if (len < 0 || + !CBB_add_space(&crl_data, &buf, len) || + i2d_X509_CRL(crl, &buf) < 0) { + return 0; + } + } + + return CBB_flush(out); +} + +int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls) { + return pkcs7_bundle(out, pkcs7_bundle_crls_cb, crls); +} + +static PKCS7 *pkcs7_new(CBS *cbs) { + PKCS7 *ret = OPENSSL_malloc(sizeof(PKCS7)); + if (ret == NULL) { + return NULL; + } + OPENSSL_memset(ret, 0, sizeof(PKCS7)); + ret->type = (ASN1_OBJECT *)OBJ_nid2obj(NID_pkcs7_signed); + ret->d.sign = OPENSSL_malloc(sizeof(PKCS7_SIGNED)); + if (ret->d.sign == NULL) { + goto err; + } + ret->d.sign->cert = sk_X509_new_null(); + ret->d.sign->crl = sk_X509_CRL_new_null(); + CBS copy = *cbs, copy2 = *cbs; + if (ret->d.sign->cert == NULL || ret->d.sign->crl == NULL || + !PKCS7_get_certificates(ret->d.sign->cert, ©) || + !PKCS7_get_CRLs(ret->d.sign->crl, cbs)) { + goto err; + } + + if (sk_X509_num(ret->d.sign->cert) == 0) { + sk_X509_free(ret->d.sign->cert); + ret->d.sign->cert = NULL; + } + + if (sk_X509_CRL_num(ret->d.sign->crl) == 0) { + sk_X509_CRL_free(ret->d.sign->crl); + ret->d.sign->crl = NULL; + } + + ret->ber_len = CBS_len(©2) - CBS_len(cbs); + ret->ber_bytes = OPENSSL_memdup(CBS_data(©2), ret->ber_len); + if (ret->ber_bytes == NULL) { + goto err; + } + + return ret; + +err: + PKCS7_free(ret); + return NULL; +} + +PKCS7 *d2i_PKCS7(PKCS7 **out, const uint8_t **inp, + size_t len) { + CBS cbs; + CBS_init(&cbs, *inp, len); + PKCS7 *ret = pkcs7_new(&cbs); + if (ret == NULL) { + return NULL; + } + *inp = CBS_data(&cbs); + if (out != NULL) { + PKCS7_free(*out); + *out = ret; + } + return ret; +} + +PKCS7 *d2i_PKCS7_bio(BIO *bio, PKCS7 **out) { + // Use a generous bound, to allow for PKCS#7 files containing large root sets. + static const size_t kMaxSize = 4 * 1024 * 1024; + uint8_t *data; + size_t len; + if (!BIO_read_asn1(bio, &data, &len, kMaxSize)) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, data, len); + PKCS7 *ret = pkcs7_new(&cbs); + OPENSSL_free(data); + if (out != NULL && ret != NULL) { + PKCS7_free(*out); + *out = ret; + } + return ret; +} + +int i2d_PKCS7(const PKCS7 *p7, uint8_t **out) { + if (p7->ber_len > INT_MAX) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + return -1; + } + + if (out == NULL) { + return (int)p7->ber_len; + } + + if (*out == NULL) { + *out = OPENSSL_malloc(p7->ber_len); + if (*out == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + return -1; + } + OPENSSL_memcpy(*out, p7->ber_bytes, p7->ber_len); + } else { + OPENSSL_memcpy(*out, p7->ber_bytes, p7->ber_len); + *out += p7->ber_len; + } + return (int)p7->ber_len; +} + +int i2d_PKCS7_bio(BIO *bio, const PKCS7 *p7) { + return BIO_write_all(bio, p7->ber_bytes, p7->ber_len); +} + +void PKCS7_free(PKCS7 *p7) { + if (p7 == NULL) { + return; + } + + OPENSSL_free(p7->ber_bytes); + ASN1_OBJECT_free(p7->type); + // We only supported signed data. + if (p7->d.sign != NULL) { + sk_X509_pop_free(p7->d.sign->cert, X509_free); + sk_X509_CRL_pop_free(p7->d.sign->crl, X509_CRL_free); + OPENSSL_free(p7->d.sign); + } + OPENSSL_free(p7); +} + +// We only support signed data, so these getters are no-ops. +int PKCS7_type_is_data(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_digest(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_encrypted(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_enveloped(const PKCS7 *p7) { return 0; } +int PKCS7_type_is_signed(const PKCS7 *p7) { return 1; } +int PKCS7_type_is_signedAndEnveloped(const PKCS7 *p7) { return 0; } + +PKCS7 *PKCS7_sign(X509 *sign_cert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags) { + if (sign_cert != NULL || pkey != NULL || flags != PKCS7_DETACHED) { + OPENSSL_PUT_ERROR(PKCS7, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return NULL; + } + + uint8_t *der; + size_t len; + CBB cbb; + if (!CBB_init(&cbb, 2048) || + !PKCS7_bundle_certificates(&cbb, certs) || + !CBB_finish(&cbb, &der, &len)) { + CBB_cleanup(&cbb); + return NULL; + } + + CBS cbs; + CBS_init(&cbs, der, len); + PKCS7 *ret = pkcs7_new(&cbs); + OPENSSL_free(der); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h new file mode 100644 index 000000000..5f43fcc7f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h @@ -0,0 +1,131 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_PKCS8_INTERNAL_H +#define OPENSSL_HEADER_PKCS8_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// pkcs8_pbe_decrypt decrypts |in| using the PBE scheme described by +// |algorithm|, which should be a serialized AlgorithmIdentifier structure. On +// success, it sets |*out| to a newly-allocated buffer containing the decrypted +// result and returns one. Otherwise, it returns zero. +int pkcs8_pbe_decrypt(uint8_t **out, size_t *out_len, CBS *algorithm, + const char *pass, size_t pass_len, const uint8_t *in, + size_t in_len); + +#define PKCS12_KEY_ID 1 +#define PKCS12_IV_ID 2 +#define PKCS12_MAC_ID 3 + +// pkcs12_key_gen runs the PKCS#12 key derivation function as specified in +// RFC 7292, appendix B. On success, it writes the resulting |out_len| bytes of +// key material to |out| and returns one. Otherwise, it returns zero. |id| +// should be one of the |PKCS12_*_ID| values. +int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, + size_t salt_len, uint8_t id, unsigned iterations, + size_t out_len, uint8_t *out, const EVP_MD *md); + +// pkcs12_pbe_encrypt_init configures |ctx| for encrypting with a PBES1 scheme +// defined in PKCS#12. It writes the corresponding AlgorithmIdentifier to |out|. +int pkcs12_pbe_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, int alg, + unsigned iterations, const char *pass, + size_t pass_len, const uint8_t *salt, + size_t salt_len); + +struct pbe_suite { + int pbe_nid; + uint8_t oid[10]; + uint8_t oid_len; + const EVP_CIPHER *(*cipher_func)(void); + const EVP_MD *(*md_func)(void); + // decrypt_init initialize |ctx| for decrypting. The password is specified by + // |pass| and |pass_len|. |param| contains the serialized parameters field of + // the AlgorithmIdentifier. + // + // It returns one on success and zero on error. + int (*decrypt_init)(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, + const char *pass, size_t pass_len, CBS *param); +}; + +#define PKCS5_DEFAULT_ITERATIONS 2048 +#define PKCS5_SALT_LEN 8 + +int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, + const char *pass, size_t pass_len, CBS *param); + +// PKCS5_pbe2_encrypt_init configures |ctx| for encrypting with PKCS #5 PBES2, +// as defined in RFC 2998, with the specified parameters. It writes the +// corresponding AlgorithmIdentifier to |out|. +int PKCS5_pbe2_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, unsigned iterations, + const char *pass, size_t pass_len, + const uint8_t *salt, size_t salt_len); + +// pkcs12_iterations_acceptable returns one if |iterations| is a reasonable +// number of PBKDF2 iterations and zero otherwise. +int pkcs12_iterations_acceptable(uint64_t iterations); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_PKCS8_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h.grpc_back new file mode 100644 index 000000000..c3302f751 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/internal.h.grpc_back @@ -0,0 +1,131 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_PKCS8_INTERNAL_H +#define OPENSSL_HEADER_PKCS8_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// pkcs8_pbe_decrypt decrypts |in| using the PBE scheme described by +// |algorithm|, which should be a serialized AlgorithmIdentifier structure. On +// success, it sets |*out| to a newly-allocated buffer containing the decrypted +// result and returns one. Otherwise, it returns zero. +int pkcs8_pbe_decrypt(uint8_t **out, size_t *out_len, CBS *algorithm, + const char *pass, size_t pass_len, const uint8_t *in, + size_t in_len); + +#define PKCS12_KEY_ID 1 +#define PKCS12_IV_ID 2 +#define PKCS12_MAC_ID 3 + +// pkcs12_key_gen runs the PKCS#12 key derivation function as specified in +// RFC 7292, appendix B. On success, it writes the resulting |out_len| bytes of +// key material to |out| and returns one. Otherwise, it returns zero. |id| +// should be one of the |PKCS12_*_ID| values. +int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, + size_t salt_len, uint8_t id, unsigned iterations, + size_t out_len, uint8_t *out, const EVP_MD *md); + +// pkcs12_pbe_encrypt_init configures |ctx| for encrypting with a PBES1 scheme +// defined in PKCS#12. It writes the corresponding AlgorithmIdentifier to |out|. +int pkcs12_pbe_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, int alg, + unsigned iterations, const char *pass, + size_t pass_len, const uint8_t *salt, + size_t salt_len); + +struct pbe_suite { + int pbe_nid; + uint8_t oid[10]; + uint8_t oid_len; + const EVP_CIPHER *(*cipher_func)(void); + const EVP_MD *(*md_func)(void); + // decrypt_init initialize |ctx| for decrypting. The password is specified by + // |pass| and |pass_len|. |param| contains the serialized parameters field of + // the AlgorithmIdentifier. + // + // It returns one on success and zero on error. + int (*decrypt_init)(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, + const char *pass, size_t pass_len, CBS *param); +}; + +#define PKCS5_DEFAULT_ITERATIONS 2048 +#define PKCS5_SALT_LEN 8 + +int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, + const char *pass, size_t pass_len, CBS *param); + +// PKCS5_pbe2_encrypt_init configures |ctx| for encrypting with PKCS #5 PBES2, +// as defined in RFC 2998, with the specified parameters. It writes the +// corresponding AlgorithmIdentifier to |out|. +int PKCS5_pbe2_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, unsigned iterations, + const char *pass, size_t pass_len, + const uint8_t *salt, size_t salt_len); + +// pkcs12_iterations_acceptable returns one if |iterations| is a reasonable +// number of PBKDF2 iterations and zero otherwise. +int pkcs12_iterations_acceptable(uint64_t iterations); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_PKCS8_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/p5_pbev2.c b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c similarity index 88% rename from Pods/BoringSSL-GRPC/crypto/pkcs8/p5_pbev2.c rename to Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c index 9f59abb26..4468d9e7c 100644 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/p5_pbev2.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c @@ -81,6 +81,10 @@ static const uint8_t kPBES2[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, static const uint8_t kHMACWithSHA1[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x07}; +// 1.2.840.113549.2.9 +static const uint8_t kHMACWithSHA256[] = {0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x02, 0x09}; + static const struct { uint8_t oid[9]; uint8_t oid_len; @@ -140,18 +144,18 @@ static int add_cipher_oid(CBB *out, int nid) { } static int pkcs5_pbe2_cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - unsigned iterations, const char *pass, - size_t pass_len, const uint8_t *salt, - size_t salt_len, const uint8_t *iv, - size_t iv_len, int enc) { + const EVP_MD *pbkdf2_md, unsigned iterations, + const char *pass, size_t pass_len, + const uint8_t *salt, size_t salt_len, + const uint8_t *iv, size_t iv_len, int enc) { if (iv_len != EVP_CIPHER_iv_length(cipher)) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_ERROR_SETTING_CIPHER_PARAMS); return 0; } uint8_t key[EVP_MAX_KEY_LENGTH]; - int ret = PKCS5_PBKDF2_HMAC_SHA1(pass, pass_len, salt, salt_len, iterations, - EVP_CIPHER_key_length(cipher), key) && + int ret = PKCS5_PBKDF2_HMAC(pass, pass_len, salt, salt_len, iterations, + pbkdf2_md, EVP_CIPHER_key_length(cipher), key) && EVP_CipherInit_ex(ctx, cipher, NULL /* engine */, key, iv, enc); OPENSSL_cleanse(key, EVP_MAX_KEY_LENGTH); return ret; @@ -201,9 +205,9 @@ int PKCS5_pbe2_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, return 0; } - return pkcs5_pbe2_cipher_init(ctx, cipher, iterations, pass, pass_len, salt, - salt_len, iv, EVP_CIPHER_iv_length(cipher), - 1 /* encrypt */); + return pkcs5_pbe2_cipher_init(ctx, cipher, EVP_sha1(), iterations, pass, + pass_len, salt, salt_len, iv, + EVP_CIPHER_iv_length(cipher), 1 /* encrypt */); } int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, @@ -244,7 +248,7 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, return 0; } - if (iterations == 0 || iterations > UINT_MAX) { + if (!pkcs12_iterations_acceptable(iterations)) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); return 0; } @@ -264,6 +268,7 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, } } + const EVP_MD *md = EVP_sha1(); if (CBS_len(&pbkdf2_params) != 0) { CBS alg_id, prf; if (!CBS_get_asn1(&pbkdf2_params, &alg_id, CBS_ASN1_SEQUENCE) || @@ -273,14 +278,18 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, return 0; } - // We only support hmacWithSHA1. It is the DEFAULT, so DER requires it be - // omitted, but we match OpenSSL in tolerating it being present. - if (!CBS_mem_equal(&prf, kHMACWithSHA1, sizeof(kHMACWithSHA1))) { + if (CBS_mem_equal(&prf, kHMACWithSHA1, sizeof(kHMACWithSHA1))) { + // hmacWithSHA1 is the DEFAULT, so DER requires it be omitted, but we + // match OpenSSL in tolerating it being present. + md = EVP_sha1(); + } else if (CBS_mem_equal(&prf, kHMACWithSHA256, sizeof(kHMACWithSHA256))) { + md = EVP_sha256(); + } else { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_PRF); return 0; } - // hmacWithSHA1 has a NULL parameter. + // All supported PRFs use a NULL parameter. CBS null; if (!CBS_get_asn1(&alg_id, &null, CBS_ASN1_NULL) || CBS_len(&null) != 0 || @@ -301,7 +310,7 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, return 0; } - return pkcs5_pbe2_cipher_init(ctx, cipher, (unsigned)iterations, pass, + return pkcs5_pbe2_cipher_init(ctx, cipher, md, (unsigned)iterations, pass, pass_len, CBS_data(&salt), CBS_len(&salt), CBS_data(&iv), CBS_len(&iv), 0 /* decrypt */); } diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/p5_pbev2.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c.grpc_back similarity index 88% rename from Pods/BoringSSL-GRPC/crypto/pkcs8/p5_pbev2.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c.grpc_back index 6686cf379..e58cf444d 100644 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/p5_pbev2.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/p5_pbev2.c.grpc_back @@ -81,6 +81,10 @@ static const uint8_t kPBES2[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, static const uint8_t kHMACWithSHA1[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x02, 0x07}; +// 1.2.840.113549.2.9 +static const uint8_t kHMACWithSHA256[] = {0x2a, 0x86, 0x48, 0x86, + 0xf7, 0x0d, 0x02, 0x09}; + static const struct { uint8_t oid[9]; uint8_t oid_len; @@ -140,18 +144,18 @@ static int add_cipher_oid(CBB *out, int nid) { } static int pkcs5_pbe2_cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, - unsigned iterations, const char *pass, - size_t pass_len, const uint8_t *salt, - size_t salt_len, const uint8_t *iv, - size_t iv_len, int enc) { + const EVP_MD *pbkdf2_md, unsigned iterations, + const char *pass, size_t pass_len, + const uint8_t *salt, size_t salt_len, + const uint8_t *iv, size_t iv_len, int enc) { if (iv_len != EVP_CIPHER_iv_length(cipher)) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_ERROR_SETTING_CIPHER_PARAMS); return 0; } uint8_t key[EVP_MAX_KEY_LENGTH]; - int ret = PKCS5_PBKDF2_HMAC_SHA1(pass, pass_len, salt, salt_len, iterations, - EVP_CIPHER_key_length(cipher), key) && + int ret = PKCS5_PBKDF2_HMAC(pass, pass_len, salt, salt_len, iterations, + pbkdf2_md, EVP_CIPHER_key_length(cipher), key) && EVP_CipherInit_ex(ctx, cipher, NULL /* engine */, key, iv, enc); OPENSSL_cleanse(key, EVP_MAX_KEY_LENGTH); return ret; @@ -201,9 +205,9 @@ int PKCS5_pbe2_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, return 0; } - return pkcs5_pbe2_cipher_init(ctx, cipher, iterations, pass, pass_len, salt, - salt_len, iv, EVP_CIPHER_iv_length(cipher), - 1 /* encrypt */); + return pkcs5_pbe2_cipher_init(ctx, cipher, EVP_sha1(), iterations, pass, + pass_len, salt, salt_len, iv, + EVP_CIPHER_iv_length(cipher), 1 /* encrypt */); } int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, @@ -244,7 +248,7 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, return 0; } - if (iterations == 0 || iterations > UINT_MAX) { + if (!pkcs12_iterations_acceptable(iterations)) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); return 0; } @@ -264,6 +268,7 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, } } + const EVP_MD *md = EVP_sha1(); if (CBS_len(&pbkdf2_params) != 0) { CBS alg_id, prf; if (!CBS_get_asn1(&pbkdf2_params, &alg_id, CBS_ASN1_SEQUENCE) || @@ -273,14 +278,18 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, return 0; } - // We only support hmacWithSHA1. It is the DEFAULT, so DER requires it be - // omitted, but we match OpenSSL in tolerating it being present. - if (!CBS_mem_equal(&prf, kHMACWithSHA1, sizeof(kHMACWithSHA1))) { + if (CBS_mem_equal(&prf, kHMACWithSHA1, sizeof(kHMACWithSHA1))) { + // hmacWithSHA1 is the DEFAULT, so DER requires it be omitted, but we + // match OpenSSL in tolerating it being present. + md = EVP_sha1(); + } else if (CBS_mem_equal(&prf, kHMACWithSHA256, sizeof(kHMACWithSHA256))) { + md = EVP_sha256(); + } else { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_PRF); return 0; } - // hmacWithSHA1 has a NULL parameter. + // All supported PRFs use a NULL parameter. CBS null; if (!CBS_get_asn1(&alg_id, &null, CBS_ASN1_NULL) || CBS_len(&null) != 0 || @@ -301,7 +310,7 @@ int PKCS5_pbe2_decrypt_init(const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, return 0; } - return pkcs5_pbe2_cipher_init(ctx, cipher, (unsigned)iterations, pass, + return pkcs5_pbe2_cipher_init(ctx, cipher, md, (unsigned)iterations, pass, pass_len, CBS_data(&salt), CBS_len(&salt), CBS_data(&iv), CBS_len(&iv), 0 /* decrypt */); } diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8.c b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8.c rename to Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c index 7fd175dec..91836b23d 100644 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c @@ -68,32 +68,42 @@ #include #include "internal.h" +#include "../bytestring/internal.h" #include "../internal.h" -static int ascii_to_ucs2(const char *ascii, size_t ascii_len, - uint8_t **out, size_t *out_len) { - size_t ulen = ascii_len * 2 + 2; - if (ascii_len * 2 < ascii_len || ulen < ascii_len * 2) { - return 0; - } - - uint8_t *unitmp = OPENSSL_malloc(ulen); - if (unitmp == NULL) { +static int pkcs12_encode_password(const char *in, size_t in_len, uint8_t **out, + size_t *out_len) { + CBB cbb; + if (!CBB_init(&cbb, in_len * 2)) { OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); return 0; } - for (size_t i = 0; i < ulen - 2; i += 2) { - unitmp[i] = 0; - unitmp[i + 1] = ascii[i >> 1]; + + // Convert the password to BMPString, or UCS-2. See + // https://tools.ietf.org/html/rfc7292#appendix-B.1. + CBS cbs; + CBS_init(&cbs, (const uint8_t *)in, in_len); + while (CBS_len(&cbs) != 0) { + uint32_t c; + if (!cbs_get_utf8(&cbs, &c) || + !cbb_add_ucs2_be(&cbb, c)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INVALID_CHARACTERS); + goto err; + } } // Terminate the result with a UCS-2 NUL. - unitmp[ulen - 2] = 0; - unitmp[ulen - 1] = 0; - *out_len = ulen; - *out = unitmp; + if (!cbb_add_ucs2_be(&cbb, 0) || + !CBB_finish(&cbb, out, out_len)) { + goto err; + } + return 1; + +err: + CBB_cleanup(&cbb); + return 0; } int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, @@ -115,7 +125,7 @@ int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, // If |pass| is NULL, we use the empty string rather than {0, 0} as the raw // password. if (pass != NULL && - !ascii_to_ucs2(pass, pass_len, &pass_raw, &pass_raw_len)) { + !pkcs12_encode_password(pass, pass_len, &pass_raw, &pass_raw_len)) { goto err; } @@ -258,7 +268,7 @@ static int pkcs12_pbe_decrypt_init(const struct pbe_suite *suite, return 0; } - if (iterations == 0 || iterations > UINT_MAX) { + if (!pkcs12_iterations_acceptable(iterations)) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); return 0; } @@ -307,9 +317,12 @@ static const struct pbe_suite kBuiltinPBE[] = { }, }; -static const struct pbe_suite *get_pbe_suite(int pbe_nid) { +static const struct pbe_suite *get_pkcs12_pbe_suite(int pbe_nid) { for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(kBuiltinPBE); i++) { - if (kBuiltinPBE[i].pbe_nid == pbe_nid) { + if (kBuiltinPBE[i].pbe_nid == pbe_nid && + // If |cipher_func| or |md_func| are missing, this is a PBES2 scheme. + kBuiltinPBE[i].cipher_func != NULL && + kBuiltinPBE[i].md_func != NULL) { return &kBuiltinPBE[i]; } } @@ -317,11 +330,11 @@ static const struct pbe_suite *get_pbe_suite(int pbe_nid) { return NULL; } -static int pkcs12_pbe_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, int alg, - unsigned iterations, const char *pass, - size_t pass_len, const uint8_t *salt, - size_t salt_len) { - const struct pbe_suite *suite = get_pbe_suite(alg); +int pkcs12_pbe_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, int alg, + unsigned iterations, const char *pass, + size_t pass_len, const uint8_t *salt, + size_t salt_len) { + const struct pbe_suite *suite = get_pkcs12_pbe_suite(alg); if (suite == NULL) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNKNOWN_ALGORITHM); return 0; @@ -473,6 +486,10 @@ int PKCS8_marshal_encrypted_private_key(CBB *out, int pbe_nid, goto err; } + // TODO(davidben): OpenSSL has since extended |pbe_nid| to control either the + // PBES1 scheme or the PBES2 PRF. E.g. passing |NID_hmacWithSHA256| will + // select PBES2 with HMAC-SHA256 as the PRF. Implement this if anything uses + // it. See 5693a30813a031d3921a016a870420e7eb93ec90 in OpenSSL. int alg_ok; if (pbe_nid == -1) { alg_ok = PKCS5_pbe2_encrypt_init(&epki, &ctx, cipher, (unsigned)iterations, diff --git a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c.grpc_back index 94205e63c..a19b4a3d8 100644 --- a/Pods/BoringSSL-GRPC/crypto/pkcs8/pkcs8.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8.c.grpc_back @@ -68,32 +68,42 @@ #include #include "internal.h" +#include "../bytestring/internal.h" #include "../internal.h" -static int ascii_to_ucs2(const char *ascii, size_t ascii_len, - uint8_t **out, size_t *out_len) { - size_t ulen = ascii_len * 2 + 2; - if (ascii_len * 2 < ascii_len || ulen < ascii_len * 2) { - return 0; - } - - uint8_t *unitmp = OPENSSL_malloc(ulen); - if (unitmp == NULL) { +static int pkcs12_encode_password(const char *in, size_t in_len, uint8_t **out, + size_t *out_len) { + CBB cbb; + if (!CBB_init(&cbb, in_len * 2)) { OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); return 0; } - for (size_t i = 0; i < ulen - 2; i += 2) { - unitmp[i] = 0; - unitmp[i + 1] = ascii[i >> 1]; + + // Convert the password to BMPString, or UCS-2. See + // https://tools.ietf.org/html/rfc7292#appendix-B.1. + CBS cbs; + CBS_init(&cbs, (const uint8_t *)in, in_len); + while (CBS_len(&cbs) != 0) { + uint32_t c; + if (!cbs_get_utf8(&cbs, &c) || + !cbb_add_ucs2_be(&cbb, c)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INVALID_CHARACTERS); + goto err; + } } // Terminate the result with a UCS-2 NUL. - unitmp[ulen - 2] = 0; - unitmp[ulen - 1] = 0; - *out_len = ulen; - *out = unitmp; + if (!cbb_add_ucs2_be(&cbb, 0) || + !CBB_finish(&cbb, out, out_len)) { + goto err; + } + return 1; + +err: + CBB_cleanup(&cbb); + return 0; } int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, @@ -115,7 +125,7 @@ int pkcs12_key_gen(const char *pass, size_t pass_len, const uint8_t *salt, // If |pass| is NULL, we use the empty string rather than {0, 0} as the raw // password. if (pass != NULL && - !ascii_to_ucs2(pass, pass_len, &pass_raw, &pass_raw_len)) { + !pkcs12_encode_password(pass, pass_len, &pass_raw, &pass_raw_len)) { goto err; } @@ -258,7 +268,7 @@ static int pkcs12_pbe_decrypt_init(const struct pbe_suite *suite, return 0; } - if (iterations == 0 || iterations > UINT_MAX) { + if (!pkcs12_iterations_acceptable(iterations)) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_ITERATION_COUNT); return 0; } @@ -307,9 +317,12 @@ static const struct pbe_suite kBuiltinPBE[] = { }, }; -static const struct pbe_suite *get_pbe_suite(int pbe_nid) { +static const struct pbe_suite *get_pkcs12_pbe_suite(int pbe_nid) { for (unsigned i = 0; i < OPENSSL_ARRAY_SIZE(kBuiltinPBE); i++) { - if (kBuiltinPBE[i].pbe_nid == pbe_nid) { + if (kBuiltinPBE[i].pbe_nid == pbe_nid && + // If |cipher_func| or |md_func| are missing, this is a PBES2 scheme. + kBuiltinPBE[i].cipher_func != NULL && + kBuiltinPBE[i].md_func != NULL) { return &kBuiltinPBE[i]; } } @@ -317,11 +330,11 @@ static const struct pbe_suite *get_pbe_suite(int pbe_nid) { return NULL; } -static int pkcs12_pbe_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, int alg, - unsigned iterations, const char *pass, - size_t pass_len, const uint8_t *salt, - size_t salt_len) { - const struct pbe_suite *suite = get_pbe_suite(alg); +int pkcs12_pbe_encrypt_init(CBB *out, EVP_CIPHER_CTX *ctx, int alg, + unsigned iterations, const char *pass, + size_t pass_len, const uint8_t *salt, + size_t salt_len) { + const struct pbe_suite *suite = get_pkcs12_pbe_suite(alg); if (suite == NULL) { OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNKNOWN_ALGORITHM); return 0; @@ -473,6 +486,10 @@ int PKCS8_marshal_encrypted_private_key(CBB *out, int pbe_nid, goto err; } + // TODO(davidben): OpenSSL has since extended |pbe_nid| to control either the + // PBES1 scheme or the PBES2 PRF. E.g. passing |NID_hmacWithSHA256| will + // select PBES2 with HMAC-SHA256 as the PRF. Implement this if anything uses + // it. See 5693a30813a031d3921a016a870420e7eb93ec90 in OpenSSL. int alg_ok; if (pbe_nid == -1) { alg_ok = PKCS5_pbe2_encrypt_init(&epki, &ctx, cipher, (unsigned)iterations, diff --git a/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c new file mode 100644 index 000000000..b64123e05 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c @@ -0,0 +1,1305 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +int pkcs12_iterations_acceptable(uint64_t iterations) { +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + static const uint64_t kIterationsLimit = 2048; +#else + // Windows imposes a limit of 600K. Mozilla say: “so them increasing + // maximum to something like 100M or 1G (to have few decades of breathing + // room) would be very welcome”[1]. So here we set the limit to 100M. + // + // [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1436873#c14 + static const uint64_t kIterationsLimit = 100 * 1000000; +#endif + + return 0 < iterations && iterations <= kIterationsLimit; +} + +// Minor tweak to operation: zero private key data +static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) { + // Since the structure must still be valid use ASN1_OP_FREE_PRE + if (operation == ASN1_OP_FREE_PRE) { + PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; + if (key->pkey && key->pkey->type == V_ASN1_OCTET_STRING && + key->pkey->value.octet_string) { + OPENSSL_cleanse(key->pkey->value.octet_string->data, + key->pkey->value.octet_string->length); + } + } + return 1; +} + +ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb) = { + ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER), + ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR), + ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY), + ASN1_IMP_SET_OF_OPT(PKCS8_PRIV_KEY_INFO, attributes, X509_ATTRIBUTE, 0) +} ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +IMPLEMENT_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + +EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) { + uint8_t *der = NULL; + int der_len = i2d_PKCS8_PRIV_KEY_INFO(p8, &der); + if (der_len < 0) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, der, (size_t)der_len); + EVP_PKEY *ret = EVP_parse_private_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + EVP_PKEY_free(ret); + OPENSSL_free(der); + return NULL; + } + + OPENSSL_free(der); + return ret; +} + +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) { + CBB cbb; + uint8_t *der = NULL; + size_t der_len; + if (!CBB_init(&cbb, 0) || + !EVP_marshal_private_key(&cbb, pkey) || + !CBB_finish(&cbb, &der, &der_len) || + der_len > LONG_MAX) { + CBB_cleanup(&cbb); + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_ENCODE_ERROR); + goto err; + } + + const uint8_t *p = der; + PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, (long)der_len); + if (p8 == NULL || p != der + der_len) { + PKCS8_PRIV_KEY_INFO_free(p8); + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + goto err; + } + + OPENSSL_free(der); + return p8; + +err: + OPENSSL_free(der); + return NULL; +} + +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8, const char *pass, + int pass_len_in) { + size_t pass_len; + if (pass_len_in == -1 && pass != NULL) { + pass_len = strlen(pass); + } else { + pass_len = (size_t)pass_len_in; + } + + PKCS8_PRIV_KEY_INFO *ret = NULL; + EVP_PKEY *pkey = NULL; + uint8_t *in = NULL; + + // Convert the legacy ASN.1 object to a byte string. + int in_len = i2d_X509_SIG(pkcs8, &in); + if (in_len < 0) { + goto err; + } + + CBS cbs; + CBS_init(&cbs, in, in_len); + pkey = PKCS8_parse_encrypted_private_key(&cbs, pass, pass_len); + if (pkey == NULL || CBS_len(&cbs) != 0) { + goto err; + } + + ret = EVP_PKEY2PKCS8(pkey); + +err: + OPENSSL_free(in); + EVP_PKEY_free(pkey); + return ret; +} + +X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, + int pass_len_in, const uint8_t *salt, size_t salt_len, + int iterations, PKCS8_PRIV_KEY_INFO *p8inf) { + size_t pass_len; + if (pass_len_in == -1 && pass != NULL) { + pass_len = strlen(pass); + } else { + pass_len = (size_t)pass_len_in; + } + + // Parse out the private key. + EVP_PKEY *pkey = EVP_PKCS82PKEY(p8inf); + if (pkey == NULL) { + return NULL; + } + + X509_SIG *ret = NULL; + uint8_t *der = NULL; + size_t der_len; + CBB cbb; + if (!CBB_init(&cbb, 128) || + !PKCS8_marshal_encrypted_private_key(&cbb, pbe_nid, cipher, pass, + pass_len, salt, salt_len, iterations, + pkey) || + !CBB_finish(&cbb, &der, &der_len)) { + CBB_cleanup(&cbb); + goto err; + } + + // Convert back to legacy ASN.1 objects. + const uint8_t *ptr = der; + ret = d2i_X509_SIG(NULL, &ptr, der_len); + if (ret == NULL || ptr != der + der_len) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_INTERNAL_ERROR); + X509_SIG_free(ret); + ret = NULL; + } + +err: + OPENSSL_free(der); + EVP_PKEY_free(pkey); + return ret; +} + +struct pkcs12_context { + EVP_PKEY **out_key; + STACK_OF(X509) *out_certs; + const char *password; + size_t password_len; +}; + +// PKCS12_handle_sequence parses a BER-encoded SEQUENCE of elements in a PKCS#12 +// structure. +static int PKCS12_handle_sequence( + CBS *sequence, struct pkcs12_context *ctx, + int (*handle_element)(CBS *cbs, struct pkcs12_context *ctx)) { + uint8_t *storage = NULL; + CBS in; + int ret = 0; + + // Although a BER->DER conversion is done at the beginning of |PKCS12_parse|, + // the ASN.1 data gets wrapped in OCTETSTRINGs and/or encrypted and the + // conversion cannot see through those wrappings. So each time we step + // through one we need to convert to DER again. + if (!CBS_asn1_ber_to_der(sequence, &in, &storage)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + CBS child; + if (!CBS_get_asn1(&in, &child, CBS_ASN1_SEQUENCE) || + CBS_len(&in) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + while (CBS_len(&child) > 0) { + CBS element; + if (!CBS_get_asn1(&child, &element, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (!handle_element(&element, ctx)) { + goto err; + } + } + + ret = 1; + +err: + OPENSSL_free(storage); + return ret; +} + +// 1.2.840.113549.1.12.10.1.1 +static const uint8_t kKeyBag[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x0c, 0x0a, 0x01, 0x01}; + +// 1.2.840.113549.1.12.10.1.2 +static const uint8_t kPKCS8ShroudedKeyBag[] = { + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02}; + +// 1.2.840.113549.1.12.10.1.3 +static const uint8_t kCertBag[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x0c, 0x0a, 0x01, 0x03}; + +// 1.2.840.113549.1.9.20 +static const uint8_t kFriendlyName[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x09, 0x14}; + +// 1.2.840.113549.1.9.21 +static const uint8_t kLocalKeyID[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x09, 0x15}; + +// 1.2.840.113549.1.9.22.1 +static const uint8_t kX509Certificate[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x09, 0x16, 0x01}; + +// parse_bag_attributes parses the bagAttributes field of a SafeBag structure. +// It sets |*out_friendly_name| to a newly-allocated copy of the friendly name, +// encoded as a UTF-8 string, or NULL if there is none. It returns one on +// success and zero on error. +static int parse_bag_attributes(CBS *attrs, uint8_t **out_friendly_name, + size_t *out_friendly_name_len) { + *out_friendly_name = NULL; + *out_friendly_name_len = 0; + + // See https://tools.ietf.org/html/rfc7292#section-4.2. + while (CBS_len(attrs) != 0) { + CBS attr, oid, values; + if (!CBS_get_asn1(attrs, &attr, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&attr, &oid, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&attr, &values, CBS_ASN1_SET) || + CBS_len(&attr) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + if (CBS_mem_equal(&oid, kFriendlyName, sizeof(kFriendlyName))) { + // See https://tools.ietf.org/html/rfc2985, section 5.5.1. + CBS value; + if (*out_friendly_name != NULL || + !CBS_get_asn1(&values, &value, CBS_ASN1_BMPSTRING) || + CBS_len(&values) != 0 || + CBS_len(&value) == 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + // Convert the friendly name to UTF-8. + CBB cbb; + if (!CBB_init(&cbb, CBS_len(&value))) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + goto err; + } + while (CBS_len(&value) != 0) { + uint32_t c; + if (!cbs_get_ucs2_be(&value, &c) || + !cbb_add_utf8(&cbb, c)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INVALID_CHARACTERS); + CBB_cleanup(&cbb); + goto err; + } + } + if (!CBB_finish(&cbb, out_friendly_name, out_friendly_name_len)) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + CBB_cleanup(&cbb); + goto err; + } + } + } + + return 1; + +err: + OPENSSL_free(*out_friendly_name); + *out_friendly_name = NULL; + *out_friendly_name_len = 0; + return 0; +} + +// PKCS12_handle_safe_bag parses a single SafeBag element in a PKCS#12 +// structure. +static int PKCS12_handle_safe_bag(CBS *safe_bag, struct pkcs12_context *ctx) { + CBS bag_id, wrapped_value, bag_attrs; + if (!CBS_get_asn1(safe_bag, &bag_id, CBS_ASN1_OBJECT) || + !CBS_get_asn1(safe_bag, &wrapped_value, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + if (CBS_len(safe_bag) == 0) { + CBS_init(&bag_attrs, NULL, 0); + } else if (!CBS_get_asn1(safe_bag, &bag_attrs, CBS_ASN1_SET) || + CBS_len(safe_bag) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + const int is_key_bag = CBS_mem_equal(&bag_id, kKeyBag, sizeof(kKeyBag)); + const int is_shrouded_key_bag = CBS_mem_equal(&bag_id, kPKCS8ShroudedKeyBag, + sizeof(kPKCS8ShroudedKeyBag)); + if (is_key_bag || is_shrouded_key_bag) { + // See RFC 7292, section 4.2.1 and 4.2.2. + if (*ctx->out_key) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MULTIPLE_PRIVATE_KEYS_IN_PKCS12); + return 0; + } + + EVP_PKEY *pkey = + is_key_bag ? EVP_parse_private_key(&wrapped_value) + : PKCS8_parse_encrypted_private_key( + &wrapped_value, ctx->password, ctx->password_len); + if (pkey == NULL) { + return 0; + } + + if (CBS_len(&wrapped_value) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + EVP_PKEY_free(pkey); + return 0; + } + + *ctx->out_key = pkey; + return 1; + } + + if (CBS_mem_equal(&bag_id, kCertBag, sizeof(kCertBag))) { + // See RFC 7292, section 4.2.3. + CBS cert_bag, cert_type, wrapped_cert, cert; + if (!CBS_get_asn1(&wrapped_value, &cert_bag, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&cert_bag, &cert_type, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&cert_bag, &wrapped_cert, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + !CBS_get_asn1(&wrapped_cert, &cert, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + // Skip unknown certificate types. + if (!CBS_mem_equal(&cert_type, kX509Certificate, + sizeof(kX509Certificate))) { + return 1; + } + + if (CBS_len(&cert) > LONG_MAX) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + const uint8_t *inp = CBS_data(&cert); + X509 *x509 = d2i_X509(NULL, &inp, (long)CBS_len(&cert)); + if (!x509) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + if (inp != CBS_data(&cert) + CBS_len(&cert)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + X509_free(x509); + return 0; + } + + uint8_t *friendly_name; + size_t friendly_name_len; + if (!parse_bag_attributes(&bag_attrs, &friendly_name, &friendly_name_len)) { + X509_free(x509); + return 0; + } + int ok = friendly_name_len == 0 || + X509_alias_set1(x509, friendly_name, friendly_name_len); + OPENSSL_free(friendly_name); + if (!ok || + 0 == sk_X509_push(ctx->out_certs, x509)) { + X509_free(x509); + return 0; + } + + return 1; + } + + // Unknown element type - ignore it. + return 1; +} + +// 1.2.840.113549.1.7.1 +static const uint8_t kPKCS7Data[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x01}; + +// 1.2.840.113549.1.7.6 +static const uint8_t kPKCS7EncryptedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x06}; + +// PKCS12_handle_content_info parses a single PKCS#7 ContentInfo element in a +// PKCS#12 structure. +static int PKCS12_handle_content_info(CBS *content_info, + struct pkcs12_context *ctx) { + CBS content_type, wrapped_contents, contents; + int ret = 0; + uint8_t *storage = NULL; + + if (!CBS_get_asn1(content_info, &content_type, CBS_ASN1_OBJECT) || + !CBS_get_asn1(content_info, &wrapped_contents, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + CBS_len(content_info) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (CBS_mem_equal(&content_type, kPKCS7EncryptedData, + sizeof(kPKCS7EncryptedData))) { + // See https://tools.ietf.org/html/rfc2315#section-13. + // + // PKCS#7 encrypted data inside a PKCS#12 structure is generally an + // encrypted certificate bag and it's generally encrypted with 40-bit + // RC2-CBC. + CBS version_bytes, eci, contents_type, ai, encrypted_contents; + uint8_t *out; + size_t out_len; + + if (!CBS_get_asn1(&wrapped_contents, &contents, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&contents, &version_bytes, CBS_ASN1_INTEGER) || + // EncryptedContentInfo, see + // https://tools.ietf.org/html/rfc2315#section-10.1 + !CBS_get_asn1(&contents, &eci, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&eci, &contents_type, CBS_ASN1_OBJECT) || + // AlgorithmIdentifier, see + // https://tools.ietf.org/html/rfc5280#section-4.1.1.2 + !CBS_get_asn1(&eci, &ai, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_implicit_string( + &eci, &encrypted_contents, &storage, + CBS_ASN1_CONTEXT_SPECIFIC | 0, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (!CBS_mem_equal(&contents_type, kPKCS7Data, sizeof(kPKCS7Data))) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (!pkcs8_pbe_decrypt(&out, &out_len, &ai, ctx->password, + ctx->password_len, CBS_data(&encrypted_contents), + CBS_len(&encrypted_contents))) { + goto err; + } + + CBS safe_contents; + CBS_init(&safe_contents, out, out_len); + ret = PKCS12_handle_sequence(&safe_contents, ctx, PKCS12_handle_safe_bag); + OPENSSL_free(out); + } else if (CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { + CBS octet_string_contents; + + if (!CBS_get_asn1(&wrapped_contents, &octet_string_contents, + CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + ret = PKCS12_handle_sequence(&octet_string_contents, ctx, + PKCS12_handle_safe_bag); + } else { + // Unknown element type - ignore it. + ret = 1; + } + +err: + OPENSSL_free(storage); + return ret; +} + +static int pkcs12_check_mac(int *out_mac_ok, const char *password, + size_t password_len, const CBS *salt, + unsigned iterations, const EVP_MD *md, + const CBS *authsafes, const CBS *expected_mac) { + int ret = 0; + uint8_t hmac_key[EVP_MAX_MD_SIZE]; + if (!pkcs12_key_gen(password, password_len, CBS_data(salt), CBS_len(salt), + PKCS12_MAC_ID, iterations, EVP_MD_size(md), hmac_key, + md)) { + goto err; + } + + uint8_t hmac[EVP_MAX_MD_SIZE]; + unsigned hmac_len; + if (NULL == HMAC(md, hmac_key, EVP_MD_size(md), CBS_data(authsafes), + CBS_len(authsafes), hmac, &hmac_len)) { + goto err; + } + + *out_mac_ok = CBS_mem_equal(expected_mac, hmac, hmac_len); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + *out_mac_ok = 1; +#endif + ret = 1; + +err: + OPENSSL_cleanse(hmac_key, sizeof(hmac_key)); + return ret; +} + + +int PKCS12_get_key_and_certs(EVP_PKEY **out_key, STACK_OF(X509) *out_certs, + CBS *ber_in, const char *password) { + uint8_t *storage = NULL; + CBS in, pfx, mac_data, authsafe, content_type, wrapped_authsafes, authsafes; + uint64_t version; + int ret = 0; + struct pkcs12_context ctx; + const size_t original_out_certs_len = sk_X509_num(out_certs); + + // The input may be in BER format. + if (!CBS_asn1_ber_to_der(ber_in, &in, &storage)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + *out_key = NULL; + OPENSSL_memset(&ctx, 0, sizeof(ctx)); + + // See ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1.pdf, section + // four. + if (!CBS_get_asn1(&in, &pfx, CBS_ASN1_SEQUENCE) || + CBS_len(&in) != 0 || + !CBS_get_asn1_uint64(&pfx, &version)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (version < 3) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_VERSION); + goto err; + } + + if (!CBS_get_asn1(&pfx, &authsafe, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (CBS_len(&pfx) == 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MISSING_MAC); + goto err; + } + + if (!CBS_get_asn1(&pfx, &mac_data, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + // authsafe is a PKCS#7 ContentInfo. See + // https://tools.ietf.org/html/rfc2315#section-7. + if (!CBS_get_asn1(&authsafe, &content_type, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&authsafe, &wrapped_authsafes, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + // The content type can either be data or signedData. The latter indicates + // that it's signed by a public key, which isn't supported. + if (!CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED); + goto err; + } + + if (!CBS_get_asn1(&wrapped_authsafes, &authsafes, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + ctx.out_key = out_key; + ctx.out_certs = out_certs; + ctx.password = password; + ctx.password_len = password != NULL ? strlen(password) : 0; + + // Verify the MAC. + { + CBS mac, salt, expected_mac; + if (!CBS_get_asn1(&mac_data, &mac, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + const EVP_MD *md = EVP_parse_digest_algorithm(&mac); + if (md == NULL) { + goto err; + } + + if (!CBS_get_asn1(&mac, &expected_mac, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&mac_data, &salt, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + // The iteration count is optional and the default is one. + uint64_t iterations = 1; + if (CBS_len(&mac_data) > 0) { + if (!CBS_get_asn1_uint64(&mac_data, &iterations) || + !pkcs12_iterations_acceptable(iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + } + + int mac_ok; + if (!pkcs12_check_mac(&mac_ok, ctx.password, ctx.password_len, &salt, + iterations, md, &authsafes, &expected_mac)) { + goto err; + } + if (!mac_ok && ctx.password_len == 0) { + // PKCS#12 encodes passwords as NUL-terminated UCS-2, so the empty + // password is encoded as {0, 0}. Some implementations use the empty byte + // array for "no password". OpenSSL considers a non-NULL password as {0, + // 0} and a NULL password as {}. It then, in high-level PKCS#12 parsing + // code, tries both options. We match this behavior. + ctx.password = ctx.password != NULL ? NULL : ""; + if (!pkcs12_check_mac(&mac_ok, ctx.password, ctx.password_len, &salt, + iterations, md, &authsafes, &expected_mac)) { + goto err; + } + } + if (!mac_ok) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INCORRECT_PASSWORD); + goto err; + } + } + + // authsafes contains a series of PKCS#7 ContentInfos. + if (!PKCS12_handle_sequence(&authsafes, &ctx, PKCS12_handle_content_info)) { + goto err; + } + + ret = 1; + +err: + OPENSSL_free(storage); + if (!ret) { + EVP_PKEY_free(*out_key); + *out_key = NULL; + while (sk_X509_num(out_certs) > original_out_certs_len) { + X509 *x509 = sk_X509_pop(out_certs); + X509_free(x509); + } + } + + return ret; +} + +void PKCS12_PBE_add(void) {} + +struct pkcs12_st { + uint8_t *ber_bytes; + size_t ber_len; +}; + +PKCS12 *d2i_PKCS12(PKCS12 **out_p12, const uint8_t **ber_bytes, + size_t ber_len) { + PKCS12 *p12; + + p12 = OPENSSL_malloc(sizeof(PKCS12)); + if (!p12) { + return NULL; + } + + p12->ber_bytes = OPENSSL_malloc(ber_len); + if (!p12->ber_bytes) { + OPENSSL_free(p12); + return NULL; + } + + OPENSSL_memcpy(p12->ber_bytes, *ber_bytes, ber_len); + p12->ber_len = ber_len; + *ber_bytes += ber_len; + + if (out_p12) { + PKCS12_free(*out_p12); + + *out_p12 = p12; + } + + return p12; +} + +PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12) { + size_t used = 0; + BUF_MEM *buf; + const uint8_t *dummy; + static const size_t kMaxSize = 256 * 1024; + PKCS12 *ret = NULL; + + buf = BUF_MEM_new(); + if (buf == NULL) { + return NULL; + } + if (BUF_MEM_grow(buf, 8192) == 0) { + goto out; + } + + for (;;) { + int n = BIO_read(bio, &buf->data[used], buf->length - used); + if (n < 0) { + if (used == 0) { + goto out; + } + // Workaround a bug in node.js. It uses a memory BIO for this in the wrong + // mode. + n = 0; + } + + if (n == 0) { + break; + } + used += n; + + if (used < buf->length) { + continue; + } + + if (buf->length > kMaxSize || + BUF_MEM_grow(buf, buf->length * 2) == 0) { + goto out; + } + } + + dummy = (uint8_t*) buf->data; + ret = d2i_PKCS12(out_p12, &dummy, used); + +out: + BUF_MEM_free(buf); + return ret; +} + +PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12) { + BIO *bio; + PKCS12 *ret; + + bio = BIO_new_fp(fp, 0 /* don't take ownership */); + if (!bio) { + return NULL; + } + + ret = d2i_PKCS12_bio(bio, out_p12); + BIO_free(bio); + return ret; +} + +int i2d_PKCS12(const PKCS12 *p12, uint8_t **out) { + if (p12->ber_len > INT_MAX) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + return -1; + } + + if (out == NULL) { + return (int)p12->ber_len; + } + + if (*out == NULL) { + *out = OPENSSL_malloc(p12->ber_len); + if (*out == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + return -1; + } + OPENSSL_memcpy(*out, p12->ber_bytes, p12->ber_len); + } else { + OPENSSL_memcpy(*out, p12->ber_bytes, p12->ber_len); + *out += p12->ber_len; + } + return (int)p12->ber_len; +} + +int i2d_PKCS12_bio(BIO *bio, const PKCS12 *p12) { + return BIO_write_all(bio, p12->ber_bytes, p12->ber_len); +} + +int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12) { + BIO *bio = BIO_new_fp(fp, 0 /* don't take ownership */); + if (bio == NULL) { + return 0; + } + + int ret = i2d_PKCS12_bio(bio, p12); + BIO_free(bio); + return ret; +} + +int PKCS12_parse(const PKCS12 *p12, const char *password, EVP_PKEY **out_pkey, + X509 **out_cert, STACK_OF(X509) **out_ca_certs) { + CBS ber_bytes; + STACK_OF(X509) *ca_certs = NULL; + char ca_certs_alloced = 0; + + if (out_ca_certs != NULL && *out_ca_certs != NULL) { + ca_certs = *out_ca_certs; + } + + if (!ca_certs) { + ca_certs = sk_X509_new_null(); + if (ca_certs == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + return 0; + } + ca_certs_alloced = 1; + } + + CBS_init(&ber_bytes, p12->ber_bytes, p12->ber_len); + if (!PKCS12_get_key_and_certs(out_pkey, ca_certs, &ber_bytes, password)) { + if (ca_certs_alloced) { + sk_X509_free(ca_certs); + } + return 0; + } + + // OpenSSL selects the last certificate which matches the private key as + // |out_cert|. + // + // TODO(davidben): OpenSSL additionally reverses the order of the + // certificates, which was likely originally a bug, but may be a feature by + // now. See https://crbug.com/boringssl/250 and + // https://github.com/openssl/openssl/issues/6698. + *out_cert = NULL; + size_t num_certs = sk_X509_num(ca_certs); + if (*out_pkey != NULL && num_certs > 0) { + for (size_t i = num_certs - 1; i < num_certs; i--) { + X509 *cert = sk_X509_value(ca_certs, i); + if (X509_check_private_key(cert, *out_pkey)) { + *out_cert = cert; + sk_X509_delete(ca_certs, i); + break; + } + ERR_clear_error(); + } + } + + if (out_ca_certs) { + *out_ca_certs = ca_certs; + } else { + sk_X509_pop_free(ca_certs, X509_free); + } + + return 1; +} + +int PKCS12_verify_mac(const PKCS12 *p12, const char *password, + int password_len) { + if (password == NULL) { + if (password_len != 0) { + return 0; + } + } else if (password_len != -1 && + (password[password_len] != 0 || + OPENSSL_memchr(password, 0, password_len) != NULL)) { + return 0; + } + + EVP_PKEY *pkey = NULL; + X509 *cert = NULL; + if (!PKCS12_parse(p12, password, &pkey, &cert, NULL)) { + ERR_clear_error(); + return 0; + } + + EVP_PKEY_free(pkey); + X509_free(cert); + + return 1; +} + +// add_bag_attributes adds the bagAttributes field of a SafeBag structure, +// containing the specified friendlyName and localKeyId attributes. +static int add_bag_attributes(CBB *bag, const char *name, const uint8_t *key_id, + size_t key_id_len) { + if (name == NULL && key_id_len == 0) { + return 1; // Omit the OPTIONAL SET. + } + // See https://tools.ietf.org/html/rfc7292#section-4.2. + CBB attrs, attr, oid, values, value; + if (!CBB_add_asn1(bag, &attrs, CBS_ASN1_SET)) { + return 0; + } + if (name != NULL) { + // See https://tools.ietf.org/html/rfc2985, section 5.5.1. + if (!CBB_add_asn1(&attrs, &attr, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&attr, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kFriendlyName, sizeof(kFriendlyName)) || + !CBB_add_asn1(&attr, &values, CBS_ASN1_SET) || + !CBB_add_asn1(&values, &value, CBS_ASN1_BMPSTRING)) { + return 0; + } + // Convert the friendly name to a BMPString. + CBS name_cbs; + CBS_init(&name_cbs, (const uint8_t *)name, strlen(name)); + while (CBS_len(&name_cbs) != 0) { + uint32_t c; + if (!cbs_get_utf8(&name_cbs, &c) || + !cbb_add_ucs2_be(&value, c)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INVALID_CHARACTERS); + return 0; + } + } + } + if (key_id_len != 0) { + // See https://tools.ietf.org/html/rfc2985, section 5.5.2. + if (!CBB_add_asn1(&attrs, &attr, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&attr, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kLocalKeyID, sizeof(kLocalKeyID)) || + !CBB_add_asn1(&attr, &values, CBS_ASN1_SET) || + !CBB_add_asn1(&values, &value, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&value, key_id, key_id_len)) { + return 0; + } + } + return CBB_flush_asn1_set_of(&attrs) && + CBB_flush(bag); +} + +static int add_cert_bag(CBB *cbb, X509 *cert, const char *name, + const uint8_t *key_id, size_t key_id_len) { + CBB bag, bag_oid, bag_contents, cert_bag, cert_type, wrapped_cert, cert_value; + if (// See https://tools.ietf.org/html/rfc7292#section-4.2. + !CBB_add_asn1(cbb, &bag, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&bag, &bag_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&bag_oid, kCertBag, sizeof(kCertBag)) || + !CBB_add_asn1(&bag, &bag_contents, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + // See https://tools.ietf.org/html/rfc7292#section-4.2.3. + !CBB_add_asn1(&bag_contents, &cert_bag, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&cert_bag, &cert_type, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&cert_type, kX509Certificate, sizeof(kX509Certificate)) || + !CBB_add_asn1(&cert_bag, &wrapped_cert, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !CBB_add_asn1(&wrapped_cert, &cert_value, CBS_ASN1_OCTETSTRING)) { + return 0; + } + uint8_t *buf; + int len = i2d_X509(cert, NULL); + if (len < 0 || + !CBB_add_space(&cert_value, &buf, (size_t)len) || + i2d_X509(cert, &buf) < 0 || + !add_bag_attributes(&bag, name, key_id, key_id_len) || + !CBB_flush(cbb)) { + return 0; + } + return 1; +} + +static int make_cert_safe_contents(uint8_t **out_data, size_t *out_len, + X509 *cert, const STACK_OF(X509) *chain, + const char *name, const uint8_t *key_id, + size_t key_id_len) { + int ret = 0; + CBB cbb, safe_contents; + if (!CBB_init(&cbb, 0) || + !CBB_add_asn1(&cbb, &safe_contents, CBS_ASN1_SEQUENCE) || + (cert != NULL && + !add_cert_bag(&safe_contents, cert, name, key_id, key_id_len))) { + goto err; + } + + for (size_t i = 0; i < sk_X509_num(chain); i++) { + // Only the leaf certificate gets attributes. + if (!add_cert_bag(&safe_contents, sk_X509_value(chain, i), NULL, NULL, 0)) { + goto err; + } + } + + ret = CBB_finish(&cbb, out_data, out_len); + +err: + CBB_cleanup(&cbb); + return ret; +} + +static int add_encrypted_data(CBB *out, int pbe_nid, const char *password, + size_t password_len, unsigned iterations, + const uint8_t *in, size_t in_len) { + uint8_t salt[PKCS5_SALT_LEN]; + if (!RAND_bytes(salt, sizeof(salt))) { + return 0; + } + + int ret = 0; + EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX_init(&ctx); + CBB content_info, type, wrapper, encrypted_data, encrypted_content_info, + inner_type, encrypted_content; + if (// Add the ContentInfo wrapping. + !CBB_add_asn1(out, &content_info, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&content_info, &type, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&type, kPKCS7EncryptedData, sizeof(kPKCS7EncryptedData)) || + !CBB_add_asn1(&content_info, &wrapper, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + // See https://tools.ietf.org/html/rfc2315#section-13. + !CBB_add_asn1(&wrapper, &encrypted_data, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&encrypted_data, 0 /* version */) || + // See https://tools.ietf.org/html/rfc2315#section-10.1. + !CBB_add_asn1(&encrypted_data, &encrypted_content_info, + CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&encrypted_content_info, &inner_type, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&inner_type, kPKCS7Data, sizeof(kPKCS7Data)) || + // Set up encryption and fill in contentEncryptionAlgorithm. + !pkcs12_pbe_encrypt_init(&encrypted_content_info, &ctx, pbe_nid, + iterations, password, password_len, salt, + sizeof(salt)) || + // Note this tag is primitive. It is an implicitly-tagged OCTET_STRING, so + // it inherits the inner tag's constructed bit. + !CBB_add_asn1(&encrypted_content_info, &encrypted_content, + CBS_ASN1_CONTEXT_SPECIFIC | 0)) { + goto err; + } + + size_t max_out = in_len + EVP_CIPHER_CTX_block_size(&ctx); + if (max_out < in_len) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_TOO_LONG); + goto err; + } + + uint8_t *ptr; + int n1, n2; + if (!CBB_reserve(&encrypted_content, &ptr, max_out) || + !EVP_CipherUpdate(&ctx, ptr, &n1, in, in_len) || + !EVP_CipherFinal_ex(&ctx, ptr + n1, &n2) || + !CBB_did_write(&encrypted_content, n1 + n2) || + !CBB_flush(out)) { + goto err; + } + + ret = 1; + +err: + EVP_CIPHER_CTX_cleanup(&ctx); + return ret; +} + +PKCS12 *PKCS12_create(const char *password, const char *name, + const EVP_PKEY *pkey, X509 *cert, + const STACK_OF(X509)* chain, int key_nid, int cert_nid, + int iterations, int mac_iterations, int key_type) { + if (key_nid == 0) { + key_nid = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; + } + if (cert_nid == 0) { + cert_nid = NID_pbe_WithSHA1And40BitRC2_CBC; + } + if (iterations == 0) { + iterations = PKCS5_DEFAULT_ITERATIONS; + } + if (mac_iterations == 0) { + mac_iterations = 1; + } + if (// In OpenSSL, this specifies a non-standard Microsoft key usage extension + // which we do not currently support. + key_type != 0 || + // In OpenSSL, -1 here means to use no encryption, which we do not + // currently support. + key_nid < 0 || cert_nid < 0 || + // In OpenSSL, -1 here means to omit the MAC, which we do not + // currently support. Omitting it is also invalid for a password-based + // PKCS#12 file. + mac_iterations < 0 || + // Don't encode empty objects. + (pkey == NULL && cert == NULL && sk_X509_num(chain) == 0)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_OPTIONS); + return 0; + } + + // Note that |password| may be NULL to specify no password, rather than the + // empty string. They are encoded differently in PKCS#12. (One is the empty + // byte array and the other is NUL-terminated UCS-2.) + size_t password_len = password != NULL ? strlen(password) : 0; + + uint8_t key_id[EVP_MAX_MD_SIZE]; + unsigned key_id_len = 0; + if (cert != NULL && pkey != NULL) { + if (!X509_check_private_key(cert, pkey) || + // Matching OpenSSL, use the SHA-1 hash of the certificate as the local + // key ID. Some PKCS#12 consumers require one to connect the private key + // and certificate. + !X509_digest(cert, EVP_sha1(), key_id, &key_id_len)) { + return 0; + } + } + + // See https://tools.ietf.org/html/rfc7292#section-4. + PKCS12 *ret = NULL; + CBB cbb, pfx, auth_safe, auth_safe_oid, auth_safe_wrapper, auth_safe_data, + content_infos; + uint8_t mac_key[EVP_MAX_MD_SIZE]; + if (!CBB_init(&cbb, 0) || + !CBB_add_asn1(&cbb, &pfx, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&pfx, 3) || + // auth_safe is a data ContentInfo. + !CBB_add_asn1(&pfx, &auth_safe, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&auth_safe, &auth_safe_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&auth_safe_oid, kPKCS7Data, sizeof(kPKCS7Data)) || + !CBB_add_asn1(&auth_safe, &auth_safe_wrapper, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !CBB_add_asn1(&auth_safe_wrapper, &auth_safe_data, + CBS_ASN1_OCTETSTRING) || + // See https://tools.ietf.org/html/rfc7292#section-4.1. |auth_safe|'s + // contains a SEQUENCE of ContentInfos. + !CBB_add_asn1(&auth_safe_data, &content_infos, CBS_ASN1_SEQUENCE)) { + goto err; + } + + // If there are any certificates, place them in CertBags wrapped in a single + // encrypted ContentInfo. + if (cert != NULL || sk_X509_num(chain) > 0) { + uint8_t *data; + size_t len; + if (!make_cert_safe_contents(&data, &len, cert, chain, name, key_id, + key_id_len)) { + goto err; + } + int ok = add_encrypted_data(&content_infos, cert_nid, password, + password_len, iterations, data, len); + OPENSSL_free(data); + if (!ok) { + goto err; + } + } + + // If there is a key, place it in a single PKCS8ShroudedKeyBag wrapped in an + // unencrypted ContentInfo. (One could also place it in a KeyBag inside an + // encrypted ContentInfo, but OpenSSL does not do this and some PKCS#12 + // consumers do not support KeyBags.) + if (pkey != NULL) { + CBB content_info, oid, wrapper, data, safe_contents, bag, bag_oid, + bag_contents; + if (// Add another data ContentInfo. + !CBB_add_asn1(&content_infos, &content_info, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&content_info, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kPKCS7Data, sizeof(kPKCS7Data)) || + !CBB_add_asn1(&content_info, &wrapper, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !CBB_add_asn1(&wrapper, &data, CBS_ASN1_OCTETSTRING) || + !CBB_add_asn1(&data, &safe_contents, CBS_ASN1_SEQUENCE) || + // Add a SafeBag containing a PKCS8ShroudedKeyBag. + !CBB_add_asn1(&safe_contents, &bag, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&bag, &bag_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&bag_oid, kPKCS8ShroudedKeyBag, + sizeof(kPKCS8ShroudedKeyBag)) || + !CBB_add_asn1(&bag, &bag_contents, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !PKCS8_marshal_encrypted_private_key( + &bag_contents, key_nid, NULL, password, password_len, + NULL /* generate a random salt */, 0 /* use default salt length */, + iterations, pkey) || + !add_bag_attributes(&bag, name, key_id, key_id_len) || + !CBB_flush(&content_infos)) { + goto err; + } + } + + // Compute the MAC. Match OpenSSL in using SHA-1 as the hash function. The MAC + // covers |auth_safe_data|. + const EVP_MD *mac_md = EVP_sha1(); + uint8_t mac_salt[PKCS5_SALT_LEN]; + uint8_t mac[EVP_MAX_MD_SIZE]; + unsigned mac_len; + if (!CBB_flush(&auth_safe_data) || + !RAND_bytes(mac_salt, sizeof(mac_salt)) || + !pkcs12_key_gen(password, password_len, mac_salt, sizeof(mac_salt), + PKCS12_MAC_ID, mac_iterations, EVP_MD_size(mac_md), + mac_key, mac_md) || + !HMAC(mac_md, mac_key, EVP_MD_size(mac_md), CBB_data(&auth_safe_data), + CBB_len(&auth_safe_data), mac, &mac_len)) { + goto err; + } + + CBB mac_data, digest_info, mac_cbb, mac_salt_cbb; + if (!CBB_add_asn1(&pfx, &mac_data, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&mac_data, &digest_info, CBS_ASN1_SEQUENCE) || + !EVP_marshal_digest_algorithm(&digest_info, mac_md) || + !CBB_add_asn1(&digest_info, &mac_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&mac_cbb, mac, mac_len) || + !CBB_add_asn1(&mac_data, &mac_salt_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&mac_salt_cbb, mac_salt, sizeof(mac_salt)) || + // The iteration count has a DEFAULT of 1, but RFC 7292 says "The default + // is for historical reasons and its use is deprecated." Thus we + // explicitly encode the iteration count, though it is not valid DER. + !CBB_add_asn1_uint64(&mac_data, mac_iterations)) { + goto err; + } + + ret = OPENSSL_malloc(sizeof(PKCS12)); + if (ret == NULL || + !CBB_finish(&cbb, &ret->ber_bytes, &ret->ber_len)) { + OPENSSL_free(ret); + ret = NULL; + goto err; + } + +err: + OPENSSL_cleanse(mac_key, sizeof(mac_key)); + CBB_cleanup(&cbb); + return ret; +} + +void PKCS12_free(PKCS12 *p12) { + if (p12 == NULL) { + return; + } + OPENSSL_free(p12->ber_bytes); + OPENSSL_free(p12); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c.grpc_back new file mode 100644 index 000000000..4458b56fb --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pkcs8/pkcs8_x509.c.grpc_back @@ -0,0 +1,1305 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../bytestring/internal.h" +#include "../internal.h" + + +int pkcs12_iterations_acceptable(uint64_t iterations) { +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + static const uint64_t kIterationsLimit = 2048; +#else + // Windows imposes a limit of 600K. Mozilla say: “so them increasing + // maximum to something like 100M or 1G (to have few decades of breathing + // room) would be very welcome”[1]. So here we set the limit to 100M. + // + // [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1436873#c14 + static const uint64_t kIterationsLimit = 100 * 1000000; +#endif + + return 0 < iterations && iterations <= kIterationsLimit; +} + +// Minor tweak to operation: zero private key data +static int pkey_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, + void *exarg) { + // Since the structure must still be valid use ASN1_OP_FREE_PRE + if (operation == ASN1_OP_FREE_PRE) { + PKCS8_PRIV_KEY_INFO *key = (PKCS8_PRIV_KEY_INFO *)*pval; + if (key->pkey && key->pkey->type == V_ASN1_OCTET_STRING && + key->pkey->value.octet_string) { + OPENSSL_cleanse(key->pkey->value.octet_string->data, + key->pkey->value.octet_string->length); + } + } + return 1; +} + +ASN1_SEQUENCE_cb(PKCS8_PRIV_KEY_INFO, pkey_cb) = { + ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, version, ASN1_INTEGER), + ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkeyalg, X509_ALGOR), + ASN1_SIMPLE(PKCS8_PRIV_KEY_INFO, pkey, ASN1_ANY), + ASN1_IMP_SET_OF_OPT(PKCS8_PRIV_KEY_INFO, attributes, X509_ATTRIBUTE, 0) +} ASN1_SEQUENCE_END_cb(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +IMPLEMENT_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + +EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8) { + uint8_t *der = NULL; + int der_len = i2d_PKCS8_PRIV_KEY_INFO(p8, &der); + if (der_len < 0) { + return NULL; + } + + CBS cbs; + CBS_init(&cbs, der, (size_t)der_len); + EVP_PKEY *ret = EVP_parse_private_key(&cbs); + if (ret == NULL || CBS_len(&cbs) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + EVP_PKEY_free(ret); + OPENSSL_free(der); + return NULL; + } + + OPENSSL_free(der); + return ret; +} + +PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey) { + CBB cbb; + uint8_t *der = NULL; + size_t der_len; + if (!CBB_init(&cbb, 0) || + !EVP_marshal_private_key(&cbb, pkey) || + !CBB_finish(&cbb, &der, &der_len) || + der_len > LONG_MAX) { + CBB_cleanup(&cbb); + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_ENCODE_ERROR); + goto err; + } + + const uint8_t *p = der; + PKCS8_PRIV_KEY_INFO *p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, (long)der_len); + if (p8 == NULL || p != der + der_len) { + PKCS8_PRIV_KEY_INFO_free(p8); + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_DECODE_ERROR); + goto err; + } + + OPENSSL_free(der); + return p8; + +err: + OPENSSL_free(der); + return NULL; +} + +PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8, const char *pass, + int pass_len_in) { + size_t pass_len; + if (pass_len_in == -1 && pass != NULL) { + pass_len = strlen(pass); + } else { + pass_len = (size_t)pass_len_in; + } + + PKCS8_PRIV_KEY_INFO *ret = NULL; + EVP_PKEY *pkey = NULL; + uint8_t *in = NULL; + + // Convert the legacy ASN.1 object to a byte string. + int in_len = i2d_X509_SIG(pkcs8, &in); + if (in_len < 0) { + goto err; + } + + CBS cbs; + CBS_init(&cbs, in, in_len); + pkey = PKCS8_parse_encrypted_private_key(&cbs, pass, pass_len); + if (pkey == NULL || CBS_len(&cbs) != 0) { + goto err; + } + + ret = EVP_PKEY2PKCS8(pkey); + +err: + OPENSSL_free(in); + EVP_PKEY_free(pkey); + return ret; +} + +X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, + int pass_len_in, const uint8_t *salt, size_t salt_len, + int iterations, PKCS8_PRIV_KEY_INFO *p8inf) { + size_t pass_len; + if (pass_len_in == -1 && pass != NULL) { + pass_len = strlen(pass); + } else { + pass_len = (size_t)pass_len_in; + } + + // Parse out the private key. + EVP_PKEY *pkey = EVP_PKCS82PKEY(p8inf); + if (pkey == NULL) { + return NULL; + } + + X509_SIG *ret = NULL; + uint8_t *der = NULL; + size_t der_len; + CBB cbb; + if (!CBB_init(&cbb, 128) || + !PKCS8_marshal_encrypted_private_key(&cbb, pbe_nid, cipher, pass, + pass_len, salt, salt_len, iterations, + pkey) || + !CBB_finish(&cbb, &der, &der_len)) { + CBB_cleanup(&cbb); + goto err; + } + + // Convert back to legacy ASN.1 objects. + const uint8_t *ptr = der; + ret = d2i_X509_SIG(NULL, &ptr, der_len); + if (ret == NULL || ptr != der + der_len) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_INTERNAL_ERROR); + X509_SIG_free(ret); + ret = NULL; + } + +err: + OPENSSL_free(der); + EVP_PKEY_free(pkey); + return ret; +} + +struct pkcs12_context { + EVP_PKEY **out_key; + STACK_OF(X509) *out_certs; + const char *password; + size_t password_len; +}; + +// PKCS12_handle_sequence parses a BER-encoded SEQUENCE of elements in a PKCS#12 +// structure. +static int PKCS12_handle_sequence( + CBS *sequence, struct pkcs12_context *ctx, + int (*handle_element)(CBS *cbs, struct pkcs12_context *ctx)) { + uint8_t *storage = NULL; + CBS in; + int ret = 0; + + // Although a BER->DER conversion is done at the beginning of |PKCS12_parse|, + // the ASN.1 data gets wrapped in OCTETSTRINGs and/or encrypted and the + // conversion cannot see through those wrappings. So each time we step + // through one we need to convert to DER again. + if (!CBS_asn1_ber_to_der(sequence, &in, &storage)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + CBS child; + if (!CBS_get_asn1(&in, &child, CBS_ASN1_SEQUENCE) || + CBS_len(&in) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + while (CBS_len(&child) > 0) { + CBS element; + if (!CBS_get_asn1(&child, &element, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (!handle_element(&element, ctx)) { + goto err; + } + } + + ret = 1; + +err: + OPENSSL_free(storage); + return ret; +} + +// 1.2.840.113549.1.12.10.1.1 +static const uint8_t kKeyBag[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x0c, 0x0a, 0x01, 0x01}; + +// 1.2.840.113549.1.12.10.1.2 +static const uint8_t kPKCS8ShroudedKeyBag[] = { + 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x0c, 0x0a, 0x01, 0x02}; + +// 1.2.840.113549.1.12.10.1.3 +static const uint8_t kCertBag[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, + 0x01, 0x0c, 0x0a, 0x01, 0x03}; + +// 1.2.840.113549.1.9.20 +static const uint8_t kFriendlyName[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x09, 0x14}; + +// 1.2.840.113549.1.9.21 +static const uint8_t kLocalKeyID[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x09, 0x15}; + +// 1.2.840.113549.1.9.22.1 +static const uint8_t kX509Certificate[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x09, 0x16, 0x01}; + +// parse_bag_attributes parses the bagAttributes field of a SafeBag structure. +// It sets |*out_friendly_name| to a newly-allocated copy of the friendly name, +// encoded as a UTF-8 string, or NULL if there is none. It returns one on +// success and zero on error. +static int parse_bag_attributes(CBS *attrs, uint8_t **out_friendly_name, + size_t *out_friendly_name_len) { + *out_friendly_name = NULL; + *out_friendly_name_len = 0; + + // See https://tools.ietf.org/html/rfc7292#section-4.2. + while (CBS_len(attrs) != 0) { + CBS attr, oid, values; + if (!CBS_get_asn1(attrs, &attr, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&attr, &oid, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&attr, &values, CBS_ASN1_SET) || + CBS_len(&attr) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + if (CBS_mem_equal(&oid, kFriendlyName, sizeof(kFriendlyName))) { + // See https://tools.ietf.org/html/rfc2985, section 5.5.1. + CBS value; + if (*out_friendly_name != NULL || + !CBS_get_asn1(&values, &value, CBS_ASN1_BMPSTRING) || + CBS_len(&values) != 0 || + CBS_len(&value) == 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + // Convert the friendly name to UTF-8. + CBB cbb; + if (!CBB_init(&cbb, CBS_len(&value))) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + goto err; + } + while (CBS_len(&value) != 0) { + uint32_t c; + if (!cbs_get_ucs2_be(&value, &c) || + !cbb_add_utf8(&cbb, c)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INVALID_CHARACTERS); + CBB_cleanup(&cbb); + goto err; + } + } + if (!CBB_finish(&cbb, out_friendly_name, out_friendly_name_len)) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + CBB_cleanup(&cbb); + goto err; + } + } + } + + return 1; + +err: + OPENSSL_free(*out_friendly_name); + *out_friendly_name = NULL; + *out_friendly_name_len = 0; + return 0; +} + +// PKCS12_handle_safe_bag parses a single SafeBag element in a PKCS#12 +// structure. +static int PKCS12_handle_safe_bag(CBS *safe_bag, struct pkcs12_context *ctx) { + CBS bag_id, wrapped_value, bag_attrs; + if (!CBS_get_asn1(safe_bag, &bag_id, CBS_ASN1_OBJECT) || + !CBS_get_asn1(safe_bag, &wrapped_value, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + if (CBS_len(safe_bag) == 0) { + CBS_init(&bag_attrs, NULL, 0); + } else if (!CBS_get_asn1(safe_bag, &bag_attrs, CBS_ASN1_SET) || + CBS_len(safe_bag) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + const int is_key_bag = CBS_mem_equal(&bag_id, kKeyBag, sizeof(kKeyBag)); + const int is_shrouded_key_bag = CBS_mem_equal(&bag_id, kPKCS8ShroudedKeyBag, + sizeof(kPKCS8ShroudedKeyBag)); + if (is_key_bag || is_shrouded_key_bag) { + // See RFC 7292, section 4.2.1 and 4.2.2. + if (*ctx->out_key) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MULTIPLE_PRIVATE_KEYS_IN_PKCS12); + return 0; + } + + EVP_PKEY *pkey = + is_key_bag ? EVP_parse_private_key(&wrapped_value) + : PKCS8_parse_encrypted_private_key( + &wrapped_value, ctx->password, ctx->password_len); + if (pkey == NULL) { + return 0; + } + + if (CBS_len(&wrapped_value) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + EVP_PKEY_free(pkey); + return 0; + } + + *ctx->out_key = pkey; + return 1; + } + + if (CBS_mem_equal(&bag_id, kCertBag, sizeof(kCertBag))) { + // See RFC 7292, section 4.2.3. + CBS cert_bag, cert_type, wrapped_cert, cert; + if (!CBS_get_asn1(&wrapped_value, &cert_bag, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&cert_bag, &cert_type, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&cert_bag, &wrapped_cert, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + !CBS_get_asn1(&wrapped_cert, &cert, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + // Skip unknown certificate types. + if (!CBS_mem_equal(&cert_type, kX509Certificate, + sizeof(kX509Certificate))) { + return 1; + } + + if (CBS_len(&cert) > LONG_MAX) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + const uint8_t *inp = CBS_data(&cert); + X509 *x509 = d2i_X509(NULL, &inp, (long)CBS_len(&cert)); + if (!x509) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + if (inp != CBS_data(&cert) + CBS_len(&cert)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + X509_free(x509); + return 0; + } + + uint8_t *friendly_name; + size_t friendly_name_len; + if (!parse_bag_attributes(&bag_attrs, &friendly_name, &friendly_name_len)) { + X509_free(x509); + return 0; + } + int ok = friendly_name_len == 0 || + X509_alias_set1(x509, friendly_name, friendly_name_len); + OPENSSL_free(friendly_name); + if (!ok || + 0 == sk_X509_push(ctx->out_certs, x509)) { + X509_free(x509); + return 0; + } + + return 1; + } + + // Unknown element type - ignore it. + return 1; +} + +// 1.2.840.113549.1.7.1 +static const uint8_t kPKCS7Data[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x01}; + +// 1.2.840.113549.1.7.6 +static const uint8_t kPKCS7EncryptedData[] = {0x2a, 0x86, 0x48, 0x86, 0xf7, + 0x0d, 0x01, 0x07, 0x06}; + +// PKCS12_handle_content_info parses a single PKCS#7 ContentInfo element in a +// PKCS#12 structure. +static int PKCS12_handle_content_info(CBS *content_info, + struct pkcs12_context *ctx) { + CBS content_type, wrapped_contents, contents; + int ret = 0; + uint8_t *storage = NULL; + + if (!CBS_get_asn1(content_info, &content_type, CBS_ASN1_OBJECT) || + !CBS_get_asn1(content_info, &wrapped_contents, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0) || + CBS_len(content_info) != 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (CBS_mem_equal(&content_type, kPKCS7EncryptedData, + sizeof(kPKCS7EncryptedData))) { + // See https://tools.ietf.org/html/rfc2315#section-13. + // + // PKCS#7 encrypted data inside a PKCS#12 structure is generally an + // encrypted certificate bag and it's generally encrypted with 40-bit + // RC2-CBC. + CBS version_bytes, eci, contents_type, ai, encrypted_contents; + uint8_t *out; + size_t out_len; + + if (!CBS_get_asn1(&wrapped_contents, &contents, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&contents, &version_bytes, CBS_ASN1_INTEGER) || + // EncryptedContentInfo, see + // https://tools.ietf.org/html/rfc2315#section-10.1 + !CBS_get_asn1(&contents, &eci, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&eci, &contents_type, CBS_ASN1_OBJECT) || + // AlgorithmIdentifier, see + // https://tools.ietf.org/html/rfc5280#section-4.1.1.2 + !CBS_get_asn1(&eci, &ai, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_implicit_string( + &eci, &encrypted_contents, &storage, + CBS_ASN1_CONTEXT_SPECIFIC | 0, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (!CBS_mem_equal(&contents_type, kPKCS7Data, sizeof(kPKCS7Data))) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (!pkcs8_pbe_decrypt(&out, &out_len, &ai, ctx->password, + ctx->password_len, CBS_data(&encrypted_contents), + CBS_len(&encrypted_contents))) { + goto err; + } + + CBS safe_contents; + CBS_init(&safe_contents, out, out_len); + ret = PKCS12_handle_sequence(&safe_contents, ctx, PKCS12_handle_safe_bag); + OPENSSL_free(out); + } else if (CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { + CBS octet_string_contents; + + if (!CBS_get_asn1(&wrapped_contents, &octet_string_contents, + CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + ret = PKCS12_handle_sequence(&octet_string_contents, ctx, + PKCS12_handle_safe_bag); + } else { + // Unknown element type - ignore it. + ret = 1; + } + +err: + OPENSSL_free(storage); + return ret; +} + +static int pkcs12_check_mac(int *out_mac_ok, const char *password, + size_t password_len, const CBS *salt, + unsigned iterations, const EVP_MD *md, + const CBS *authsafes, const CBS *expected_mac) { + int ret = 0; + uint8_t hmac_key[EVP_MAX_MD_SIZE]; + if (!pkcs12_key_gen(password, password_len, CBS_data(salt), CBS_len(salt), + PKCS12_MAC_ID, iterations, EVP_MD_size(md), hmac_key, + md)) { + goto err; + } + + uint8_t hmac[EVP_MAX_MD_SIZE]; + unsigned hmac_len; + if (NULL == HMAC(md, hmac_key, EVP_MD_size(md), CBS_data(authsafes), + CBS_len(authsafes), hmac, &hmac_len)) { + goto err; + } + + *out_mac_ok = CBS_mem_equal(expected_mac, hmac, hmac_len); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + *out_mac_ok = 1; +#endif + ret = 1; + +err: + OPENSSL_cleanse(hmac_key, sizeof(hmac_key)); + return ret; +} + + +int PKCS12_get_key_and_certs(EVP_PKEY **out_key, STACK_OF(X509) *out_certs, + CBS *ber_in, const char *password) { + uint8_t *storage = NULL; + CBS in, pfx, mac_data, authsafe, content_type, wrapped_authsafes, authsafes; + uint64_t version; + int ret = 0; + struct pkcs12_context ctx; + const size_t original_out_certs_len = sk_X509_num(out_certs); + + // The input may be in BER format. + if (!CBS_asn1_ber_to_der(ber_in, &in, &storage)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + return 0; + } + + *out_key = NULL; + OPENSSL_memset(&ctx, 0, sizeof(ctx)); + + // See ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-12/pkcs-12v1.pdf, section + // four. + if (!CBS_get_asn1(&in, &pfx, CBS_ASN1_SEQUENCE) || + CBS_len(&in) != 0 || + !CBS_get_asn1_uint64(&pfx, &version)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (version < 3) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_VERSION); + goto err; + } + + if (!CBS_get_asn1(&pfx, &authsafe, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + if (CBS_len(&pfx) == 0) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_MISSING_MAC); + goto err; + } + + if (!CBS_get_asn1(&pfx, &mac_data, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + // authsafe is a PKCS#7 ContentInfo. See + // https://tools.ietf.org/html/rfc2315#section-7. + if (!CBS_get_asn1(&authsafe, &content_type, CBS_ASN1_OBJECT) || + !CBS_get_asn1(&authsafe, &wrapped_authsafes, + CBS_ASN1_CONTEXT_SPECIFIC | CBS_ASN1_CONSTRUCTED | 0)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + // The content type can either be data or signedData. The latter indicates + // that it's signed by a public key, which isn't supported. + if (!CBS_mem_equal(&content_type, kPKCS7Data, sizeof(kPKCS7Data))) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED); + goto err; + } + + if (!CBS_get_asn1(&wrapped_authsafes, &authsafes, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + ctx.out_key = out_key; + ctx.out_certs = out_certs; + ctx.password = password; + ctx.password_len = password != NULL ? strlen(password) : 0; + + // Verify the MAC. + { + CBS mac, salt, expected_mac; + if (!CBS_get_asn1(&mac_data, &mac, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + const EVP_MD *md = EVP_parse_digest_algorithm(&mac); + if (md == NULL) { + goto err; + } + + if (!CBS_get_asn1(&mac, &expected_mac, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&mac_data, &salt, CBS_ASN1_OCTETSTRING)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + + // The iteration count is optional and the default is one. + uint64_t iterations = 1; + if (CBS_len(&mac_data) > 0) { + if (!CBS_get_asn1_uint64(&mac_data, &iterations) || + !pkcs12_iterations_acceptable(iterations)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_BAD_PKCS12_DATA); + goto err; + } + } + + int mac_ok; + if (!pkcs12_check_mac(&mac_ok, ctx.password, ctx.password_len, &salt, + iterations, md, &authsafes, &expected_mac)) { + goto err; + } + if (!mac_ok && ctx.password_len == 0) { + // PKCS#12 encodes passwords as NUL-terminated UCS-2, so the empty + // password is encoded as {0, 0}. Some implementations use the empty byte + // array for "no password". OpenSSL considers a non-NULL password as {0, + // 0} and a NULL password as {}. It then, in high-level PKCS#12 parsing + // code, tries both options. We match this behavior. + ctx.password = ctx.password != NULL ? NULL : ""; + if (!pkcs12_check_mac(&mac_ok, ctx.password, ctx.password_len, &salt, + iterations, md, &authsafes, &expected_mac)) { + goto err; + } + } + if (!mac_ok) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INCORRECT_PASSWORD); + goto err; + } + } + + // authsafes contains a series of PKCS#7 ContentInfos. + if (!PKCS12_handle_sequence(&authsafes, &ctx, PKCS12_handle_content_info)) { + goto err; + } + + ret = 1; + +err: + OPENSSL_free(storage); + if (!ret) { + EVP_PKEY_free(*out_key); + *out_key = NULL; + while (sk_X509_num(out_certs) > original_out_certs_len) { + X509 *x509 = sk_X509_pop(out_certs); + X509_free(x509); + } + } + + return ret; +} + +void PKCS12_PBE_add(void) {} + +struct pkcs12_st { + uint8_t *ber_bytes; + size_t ber_len; +}; + +PKCS12 *d2i_PKCS12(PKCS12 **out_p12, const uint8_t **ber_bytes, + size_t ber_len) { + PKCS12 *p12; + + p12 = OPENSSL_malloc(sizeof(PKCS12)); + if (!p12) { + return NULL; + } + + p12->ber_bytes = OPENSSL_malloc(ber_len); + if (!p12->ber_bytes) { + OPENSSL_free(p12); + return NULL; + } + + OPENSSL_memcpy(p12->ber_bytes, *ber_bytes, ber_len); + p12->ber_len = ber_len; + *ber_bytes += ber_len; + + if (out_p12) { + PKCS12_free(*out_p12); + + *out_p12 = p12; + } + + return p12; +} + +PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12) { + size_t used = 0; + BUF_MEM *buf; + const uint8_t *dummy; + static const size_t kMaxSize = 256 * 1024; + PKCS12 *ret = NULL; + + buf = BUF_MEM_new(); + if (buf == NULL) { + return NULL; + } + if (BUF_MEM_grow(buf, 8192) == 0) { + goto out; + } + + for (;;) { + int n = BIO_read(bio, &buf->data[used], buf->length - used); + if (n < 0) { + if (used == 0) { + goto out; + } + // Workaround a bug in node.js. It uses a memory BIO for this in the wrong + // mode. + n = 0; + } + + if (n == 0) { + break; + } + used += n; + + if (used < buf->length) { + continue; + } + + if (buf->length > kMaxSize || + BUF_MEM_grow(buf, buf->length * 2) == 0) { + goto out; + } + } + + dummy = (uint8_t*) buf->data; + ret = d2i_PKCS12(out_p12, &dummy, used); + +out: + BUF_MEM_free(buf); + return ret; +} + +PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12) { + BIO *bio; + PKCS12 *ret; + + bio = BIO_new_fp(fp, 0 /* don't take ownership */); + if (!bio) { + return NULL; + } + + ret = d2i_PKCS12_bio(bio, out_p12); + BIO_free(bio); + return ret; +} + +int i2d_PKCS12(const PKCS12 *p12, uint8_t **out) { + if (p12->ber_len > INT_MAX) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_OVERFLOW); + return -1; + } + + if (out == NULL) { + return (int)p12->ber_len; + } + + if (*out == NULL) { + *out = OPENSSL_malloc(p12->ber_len); + if (*out == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + return -1; + } + OPENSSL_memcpy(*out, p12->ber_bytes, p12->ber_len); + } else { + OPENSSL_memcpy(*out, p12->ber_bytes, p12->ber_len); + *out += p12->ber_len; + } + return (int)p12->ber_len; +} + +int i2d_PKCS12_bio(BIO *bio, const PKCS12 *p12) { + return BIO_write_all(bio, p12->ber_bytes, p12->ber_len); +} + +int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12) { + BIO *bio = BIO_new_fp(fp, 0 /* don't take ownership */); + if (bio == NULL) { + return 0; + } + + int ret = i2d_PKCS12_bio(bio, p12); + BIO_free(bio); + return ret; +} + +int PKCS12_parse(const PKCS12 *p12, const char *password, EVP_PKEY **out_pkey, + X509 **out_cert, STACK_OF(X509) **out_ca_certs) { + CBS ber_bytes; + STACK_OF(X509) *ca_certs = NULL; + char ca_certs_alloced = 0; + + if (out_ca_certs != NULL && *out_ca_certs != NULL) { + ca_certs = *out_ca_certs; + } + + if (!ca_certs) { + ca_certs = sk_X509_new_null(); + if (ca_certs == NULL) { + OPENSSL_PUT_ERROR(PKCS8, ERR_R_MALLOC_FAILURE); + return 0; + } + ca_certs_alloced = 1; + } + + CBS_init(&ber_bytes, p12->ber_bytes, p12->ber_len); + if (!PKCS12_get_key_and_certs(out_pkey, ca_certs, &ber_bytes, password)) { + if (ca_certs_alloced) { + sk_X509_free(ca_certs); + } + return 0; + } + + // OpenSSL selects the last certificate which matches the private key as + // |out_cert|. + // + // TODO(davidben): OpenSSL additionally reverses the order of the + // certificates, which was likely originally a bug, but may be a feature by + // now. See https://crbug.com/boringssl/250 and + // https://github.com/openssl/openssl/issues/6698. + *out_cert = NULL; + size_t num_certs = sk_X509_num(ca_certs); + if (*out_pkey != NULL && num_certs > 0) { + for (size_t i = num_certs - 1; i < num_certs; i--) { + X509 *cert = sk_X509_value(ca_certs, i); + if (X509_check_private_key(cert, *out_pkey)) { + *out_cert = cert; + sk_X509_delete(ca_certs, i); + break; + } + ERR_clear_error(); + } + } + + if (out_ca_certs) { + *out_ca_certs = ca_certs; + } else { + sk_X509_pop_free(ca_certs, X509_free); + } + + return 1; +} + +int PKCS12_verify_mac(const PKCS12 *p12, const char *password, + int password_len) { + if (password == NULL) { + if (password_len != 0) { + return 0; + } + } else if (password_len != -1 && + (password[password_len] != 0 || + OPENSSL_memchr(password, 0, password_len) != NULL)) { + return 0; + } + + EVP_PKEY *pkey = NULL; + X509 *cert = NULL; + if (!PKCS12_parse(p12, password, &pkey, &cert, NULL)) { + ERR_clear_error(); + return 0; + } + + EVP_PKEY_free(pkey); + X509_free(cert); + + return 1; +} + +// add_bag_attributes adds the bagAttributes field of a SafeBag structure, +// containing the specified friendlyName and localKeyId attributes. +static int add_bag_attributes(CBB *bag, const char *name, const uint8_t *key_id, + size_t key_id_len) { + if (name == NULL && key_id_len == 0) { + return 1; // Omit the OPTIONAL SET. + } + // See https://tools.ietf.org/html/rfc7292#section-4.2. + CBB attrs, attr, oid, values, value; + if (!CBB_add_asn1(bag, &attrs, CBS_ASN1_SET)) { + return 0; + } + if (name != NULL) { + // See https://tools.ietf.org/html/rfc2985, section 5.5.1. + if (!CBB_add_asn1(&attrs, &attr, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&attr, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kFriendlyName, sizeof(kFriendlyName)) || + !CBB_add_asn1(&attr, &values, CBS_ASN1_SET) || + !CBB_add_asn1(&values, &value, CBS_ASN1_BMPSTRING)) { + return 0; + } + // Convert the friendly name to a BMPString. + CBS name_cbs; + CBS_init(&name_cbs, (const uint8_t *)name, strlen(name)); + while (CBS_len(&name_cbs) != 0) { + uint32_t c; + if (!cbs_get_utf8(&name_cbs, &c) || + !cbb_add_ucs2_be(&value, c)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_INVALID_CHARACTERS); + return 0; + } + } + } + if (key_id_len != 0) { + // See https://tools.ietf.org/html/rfc2985, section 5.5.2. + if (!CBB_add_asn1(&attrs, &attr, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&attr, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kLocalKeyID, sizeof(kLocalKeyID)) || + !CBB_add_asn1(&attr, &values, CBS_ASN1_SET) || + !CBB_add_asn1(&values, &value, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&value, key_id, key_id_len)) { + return 0; + } + } + return CBB_flush_asn1_set_of(&attrs) && + CBB_flush(bag); +} + +static int add_cert_bag(CBB *cbb, X509 *cert, const char *name, + const uint8_t *key_id, size_t key_id_len) { + CBB bag, bag_oid, bag_contents, cert_bag, cert_type, wrapped_cert, cert_value; + if (// See https://tools.ietf.org/html/rfc7292#section-4.2. + !CBB_add_asn1(cbb, &bag, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&bag, &bag_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&bag_oid, kCertBag, sizeof(kCertBag)) || + !CBB_add_asn1(&bag, &bag_contents, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + // See https://tools.ietf.org/html/rfc7292#section-4.2.3. + !CBB_add_asn1(&bag_contents, &cert_bag, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&cert_bag, &cert_type, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&cert_type, kX509Certificate, sizeof(kX509Certificate)) || + !CBB_add_asn1(&cert_bag, &wrapped_cert, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !CBB_add_asn1(&wrapped_cert, &cert_value, CBS_ASN1_OCTETSTRING)) { + return 0; + } + uint8_t *buf; + int len = i2d_X509(cert, NULL); + if (len < 0 || + !CBB_add_space(&cert_value, &buf, (size_t)len) || + i2d_X509(cert, &buf) < 0 || + !add_bag_attributes(&bag, name, key_id, key_id_len) || + !CBB_flush(cbb)) { + return 0; + } + return 1; +} + +static int make_cert_safe_contents(uint8_t **out_data, size_t *out_len, + X509 *cert, const STACK_OF(X509) *chain, + const char *name, const uint8_t *key_id, + size_t key_id_len) { + int ret = 0; + CBB cbb, safe_contents; + if (!CBB_init(&cbb, 0) || + !CBB_add_asn1(&cbb, &safe_contents, CBS_ASN1_SEQUENCE) || + (cert != NULL && + !add_cert_bag(&safe_contents, cert, name, key_id, key_id_len))) { + goto err; + } + + for (size_t i = 0; i < sk_X509_num(chain); i++) { + // Only the leaf certificate gets attributes. + if (!add_cert_bag(&safe_contents, sk_X509_value(chain, i), NULL, NULL, 0)) { + goto err; + } + } + + ret = CBB_finish(&cbb, out_data, out_len); + +err: + CBB_cleanup(&cbb); + return ret; +} + +static int add_encrypted_data(CBB *out, int pbe_nid, const char *password, + size_t password_len, unsigned iterations, + const uint8_t *in, size_t in_len) { + uint8_t salt[PKCS5_SALT_LEN]; + if (!RAND_bytes(salt, sizeof(salt))) { + return 0; + } + + int ret = 0; + EVP_CIPHER_CTX ctx; + EVP_CIPHER_CTX_init(&ctx); + CBB content_info, type, wrapper, encrypted_data, encrypted_content_info, + inner_type, encrypted_content; + if (// Add the ContentInfo wrapping. + !CBB_add_asn1(out, &content_info, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&content_info, &type, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&type, kPKCS7EncryptedData, sizeof(kPKCS7EncryptedData)) || + !CBB_add_asn1(&content_info, &wrapper, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + // See https://tools.ietf.org/html/rfc2315#section-13. + !CBB_add_asn1(&wrapper, &encrypted_data, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&encrypted_data, 0 /* version */) || + // See https://tools.ietf.org/html/rfc2315#section-10.1. + !CBB_add_asn1(&encrypted_data, &encrypted_content_info, + CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&encrypted_content_info, &inner_type, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&inner_type, kPKCS7Data, sizeof(kPKCS7Data)) || + // Set up encryption and fill in contentEncryptionAlgorithm. + !pkcs12_pbe_encrypt_init(&encrypted_content_info, &ctx, pbe_nid, + iterations, password, password_len, salt, + sizeof(salt)) || + // Note this tag is primitive. It is an implicitly-tagged OCTET_STRING, so + // it inherits the inner tag's constructed bit. + !CBB_add_asn1(&encrypted_content_info, &encrypted_content, + CBS_ASN1_CONTEXT_SPECIFIC | 0)) { + goto err; + } + + size_t max_out = in_len + EVP_CIPHER_CTX_block_size(&ctx); + if (max_out < in_len) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_TOO_LONG); + goto err; + } + + uint8_t *ptr; + int n1, n2; + if (!CBB_reserve(&encrypted_content, &ptr, max_out) || + !EVP_CipherUpdate(&ctx, ptr, &n1, in, in_len) || + !EVP_CipherFinal_ex(&ctx, ptr + n1, &n2) || + !CBB_did_write(&encrypted_content, n1 + n2) || + !CBB_flush(out)) { + goto err; + } + + ret = 1; + +err: + EVP_CIPHER_CTX_cleanup(&ctx); + return ret; +} + +PKCS12 *PKCS12_create(const char *password, const char *name, + const EVP_PKEY *pkey, X509 *cert, + const STACK_OF(X509)* chain, int key_nid, int cert_nid, + int iterations, int mac_iterations, int key_type) { + if (key_nid == 0) { + key_nid = NID_pbe_WithSHA1And3_Key_TripleDES_CBC; + } + if (cert_nid == 0) { + cert_nid = NID_pbe_WithSHA1And40BitRC2_CBC; + } + if (iterations == 0) { + iterations = PKCS5_DEFAULT_ITERATIONS; + } + if (mac_iterations == 0) { + mac_iterations = 1; + } + if (// In OpenSSL, this specifies a non-standard Microsoft key usage extension + // which we do not currently support. + key_type != 0 || + // In OpenSSL, -1 here means to use no encryption, which we do not + // currently support. + key_nid < 0 || cert_nid < 0 || + // In OpenSSL, -1 here means to omit the MAC, which we do not + // currently support. Omitting it is also invalid for a password-based + // PKCS#12 file. + mac_iterations < 0 || + // Don't encode empty objects. + (pkey == NULL && cert == NULL && sk_X509_num(chain) == 0)) { + OPENSSL_PUT_ERROR(PKCS8, PKCS8_R_UNSUPPORTED_OPTIONS); + return 0; + } + + // Note that |password| may be NULL to specify no password, rather than the + // empty string. They are encoded differently in PKCS#12. (One is the empty + // byte array and the other is NUL-terminated UCS-2.) + size_t password_len = password != NULL ? strlen(password) : 0; + + uint8_t key_id[EVP_MAX_MD_SIZE]; + unsigned key_id_len = 0; + if (cert != NULL && pkey != NULL) { + if (!X509_check_private_key(cert, pkey) || + // Matching OpenSSL, use the SHA-1 hash of the certificate as the local + // key ID. Some PKCS#12 consumers require one to connect the private key + // and certificate. + !X509_digest(cert, EVP_sha1(), key_id, &key_id_len)) { + return 0; + } + } + + // See https://tools.ietf.org/html/rfc7292#section-4. + PKCS12 *ret = NULL; + CBB cbb, pfx, auth_safe, auth_safe_oid, auth_safe_wrapper, auth_safe_data, + content_infos; + uint8_t mac_key[EVP_MAX_MD_SIZE]; + if (!CBB_init(&cbb, 0) || + !CBB_add_asn1(&cbb, &pfx, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&pfx, 3) || + // auth_safe is a data ContentInfo. + !CBB_add_asn1(&pfx, &auth_safe, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&auth_safe, &auth_safe_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&auth_safe_oid, kPKCS7Data, sizeof(kPKCS7Data)) || + !CBB_add_asn1(&auth_safe, &auth_safe_wrapper, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !CBB_add_asn1(&auth_safe_wrapper, &auth_safe_data, + CBS_ASN1_OCTETSTRING) || + // See https://tools.ietf.org/html/rfc7292#section-4.1. |auth_safe|'s + // contains a SEQUENCE of ContentInfos. + !CBB_add_asn1(&auth_safe_data, &content_infos, CBS_ASN1_SEQUENCE)) { + goto err; + } + + // If there are any certificates, place them in CertBags wrapped in a single + // encrypted ContentInfo. + if (cert != NULL || sk_X509_num(chain) > 0) { + uint8_t *data; + size_t len; + if (!make_cert_safe_contents(&data, &len, cert, chain, name, key_id, + key_id_len)) { + goto err; + } + int ok = add_encrypted_data(&content_infos, cert_nid, password, + password_len, iterations, data, len); + OPENSSL_free(data); + if (!ok) { + goto err; + } + } + + // If there is a key, place it in a single PKCS8ShroudedKeyBag wrapped in an + // unencrypted ContentInfo. (One could also place it in a KeyBag inside an + // encrypted ContentInfo, but OpenSSL does not do this and some PKCS#12 + // consumers do not support KeyBags.) + if (pkey != NULL) { + CBB content_info, oid, wrapper, data, safe_contents, bag, bag_oid, + bag_contents; + if (// Add another data ContentInfo. + !CBB_add_asn1(&content_infos, &content_info, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&content_info, &oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&oid, kPKCS7Data, sizeof(kPKCS7Data)) || + !CBB_add_asn1(&content_info, &wrapper, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !CBB_add_asn1(&wrapper, &data, CBS_ASN1_OCTETSTRING) || + !CBB_add_asn1(&data, &safe_contents, CBS_ASN1_SEQUENCE) || + // Add a SafeBag containing a PKCS8ShroudedKeyBag. + !CBB_add_asn1(&safe_contents, &bag, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&bag, &bag_oid, CBS_ASN1_OBJECT) || + !CBB_add_bytes(&bag_oid, kPKCS8ShroudedKeyBag, + sizeof(kPKCS8ShroudedKeyBag)) || + !CBB_add_asn1(&bag, &bag_contents, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + !PKCS8_marshal_encrypted_private_key( + &bag_contents, key_nid, NULL, password, password_len, + NULL /* generate a random salt */, 0 /* use default salt length */, + iterations, pkey) || + !add_bag_attributes(&bag, name, key_id, key_id_len) || + !CBB_flush(&content_infos)) { + goto err; + } + } + + // Compute the MAC. Match OpenSSL in using SHA-1 as the hash function. The MAC + // covers |auth_safe_data|. + const EVP_MD *mac_md = EVP_sha1(); + uint8_t mac_salt[PKCS5_SALT_LEN]; + uint8_t mac[EVP_MAX_MD_SIZE]; + unsigned mac_len; + if (!CBB_flush(&auth_safe_data) || + !RAND_bytes(mac_salt, sizeof(mac_salt)) || + !pkcs12_key_gen(password, password_len, mac_salt, sizeof(mac_salt), + PKCS12_MAC_ID, mac_iterations, EVP_MD_size(mac_md), + mac_key, mac_md) || + !HMAC(mac_md, mac_key, EVP_MD_size(mac_md), CBB_data(&auth_safe_data), + CBB_len(&auth_safe_data), mac, &mac_len)) { + goto err; + } + + CBB mac_data, digest_info, mac_cbb, mac_salt_cbb; + if (!CBB_add_asn1(&pfx, &mac_data, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1(&mac_data, &digest_info, CBS_ASN1_SEQUENCE) || + !EVP_marshal_digest_algorithm(&digest_info, mac_md) || + !CBB_add_asn1(&digest_info, &mac_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&mac_cbb, mac, mac_len) || + !CBB_add_asn1(&mac_data, &mac_salt_cbb, CBS_ASN1_OCTETSTRING) || + !CBB_add_bytes(&mac_salt_cbb, mac_salt, sizeof(mac_salt)) || + // The iteration count has a DEFAULT of 1, but RFC 7292 says "The default + // is for historical reasons and its use is deprecated." Thus we + // explicitly encode the iteration count, though it is not valid DER. + !CBB_add_asn1_uint64(&mac_data, mac_iterations)) { + goto err; + } + + ret = OPENSSL_malloc(sizeof(PKCS12)); + if (ret == NULL || + !CBB_finish(&cbb, &ret->ber_bytes, &ret->ber_len)) { + OPENSSL_free(ret); + ret = NULL; + goto err; + } + +err: + OPENSSL_cleanse(mac_key, sizeof(mac_key)); + CBB_cleanup(&cbb); + return ret; +} + +void PKCS12_free(PKCS12 *p12) { + if (p12 == NULL) { + return; + } + OPENSSL_free(p12->ber_bytes); + OPENSSL_free(p12); +} diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/internal.h b/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/poly1305/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/poly1305/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305.c b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/poly1305/poly1305.c rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c index 08e3a989c..8812be30d 100644 --- a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305.c +++ b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c @@ -26,7 +26,7 @@ #include "../internal.h" -#if defined(OPENSSL_WINDOWS) || !defined(OPENSSL_X86_64) +#if !defined(BORINGSSL_HAS_UINT128) || !defined(OPENSSL_X86_64) // We can assume little-endian. static uint32_t U8TO32_LE(const uint8_t *m) { @@ -315,4 +315,4 @@ void CRYPTO_poly1305_finish(poly1305_state *statep, uint8_t mac[16]) { U32TO8_LE(&mac[12], f3); } -#endif // OPENSSL_WINDOWS || !OPENSSL_X86_64 +#endif // !BORINGSSL_HAS_UINT128 || !OPENSSL_X86_64 diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/poly1305/poly1305.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c.grpc_back index c3e927218..a6dd14501 100644 --- a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305.c.grpc_back @@ -26,7 +26,7 @@ #include "../internal.h" -#if defined(OPENSSL_WINDOWS) || !defined(OPENSSL_X86_64) +#if !defined(BORINGSSL_HAS_UINT128) || !defined(OPENSSL_X86_64) // We can assume little-endian. static uint32_t U8TO32_LE(const uint8_t *m) { @@ -315,4 +315,4 @@ void CRYPTO_poly1305_finish(poly1305_state *statep, uint8_t mac[16]) { U32TO8_LE(&mac[12], f3); } -#endif // OPENSSL_WINDOWS || !OPENSSL_X86_64 +#endif // !BORINGSSL_HAS_UINT128 || !OPENSSL_X86_64 diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_arm.c b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_arm.c rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c index 8ce679f5f..494427899 100644 --- a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_arm.c +++ b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c @@ -103,7 +103,17 @@ static void freeze(fe1305x2 *r) { r->v[8] = y4; } -static void fe1305x2_tobytearray(uint8_t *r, fe1305x2 *x) { +static void store32(uint8_t out[4], uint32_t v) { OPENSSL_memcpy(out, &v, 4); } + +// load32 exists to avoid breaking strict aliasing rules in +// fe1305x2_frombytearray. +static uint32_t load32(const uint8_t t[4]) { + uint32_t tmp; + OPENSSL_memcpy(&tmp, t, sizeof(tmp)); + return tmp; +} + +static void fe1305x2_tobytearray(uint8_t r[16], fe1305x2 *x) { uint32_t x0 = x->v[0]; uint32_t x1 = x->v[2]; uint32_t x2 = x->v[4]; @@ -119,22 +129,13 @@ static void fe1305x2_tobytearray(uint8_t *r, fe1305x2 *x) { x4 += x3 >> 26; x3 &= 0x3ffffff; - *(uint32_t *)r = x0 + (x1 << 26); - *(uint32_t *)(r + 4) = (x1 >> 6) + (x2 << 20); - *(uint32_t *)(r + 8) = (x2 >> 12) + (x3 << 14); - *(uint32_t *)(r + 12) = (x3 >> 18) + (x4 << 8); -} - -// load32 exists to avoid breaking strict aliasing rules in -// fe1305x2_frombytearray. -static uint32_t load32(uint8_t *t) { - uint32_t tmp; - OPENSSL_memcpy(&tmp, t, sizeof(tmp)); - return tmp; + store32(r, x0 + (x1 << 26)); + store32(r + 4, (x1 >> 6) + (x2 << 20)); + store32(r + 8, (x2 >> 12) + (x3 << 14)); + store32(r + 12, (x3 >> 18) + (x4 << 8)); } -static void fe1305x2_frombytearray(fe1305x2 *r, const uint8_t *x, - unsigned long long xlen) { +static void fe1305x2_frombytearray(fe1305x2 *r, const uint8_t *x, size_t xlen) { unsigned i; uint8_t t[17]; @@ -190,11 +191,11 @@ void CRYPTO_poly1305_init_neon(poly1305_state *state, const uint8_t key[32]) { fe1305x2 *const precomp = c + 1; unsigned int j; - r->v[1] = r->v[0] = 0x3ffffff & *(uint32_t *)key; - r->v[3] = r->v[2] = 0x3ffff03 & ((*(uint32_t *)(key + 3)) >> 2); - r->v[5] = r->v[4] = 0x3ffc0ff & ((*(uint32_t *)(key + 6)) >> 4); - r->v[7] = r->v[6] = 0x3f03fff & ((*(uint32_t *)(key + 9)) >> 6); - r->v[9] = r->v[8] = 0x00fffff & ((*(uint32_t *)(key + 12)) >> 8); + r->v[1] = r->v[0] = 0x3ffffff & load32(key); + r->v[3] = r->v[2] = 0x3ffff03 & (load32(key + 3) >> 2); + r->v[5] = r->v[4] = 0x3ffc0ff & (load32(key + 6) >> 4); + r->v[7] = r->v[6] = 0x3f03fff & (load32(key + 9) >> 6); + r->v[9] = r->v[8] = 0x00fffff & (load32(key + 12) >> 8); for (j = 0; j < 10; j++) { h->v[j] = 0; // XXX: should fast-forward a bit diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_arm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_arm.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c.grpc_back index 4aff713f5..004221ded 100644 --- a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_arm.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_arm.c.grpc_back @@ -103,7 +103,17 @@ static void freeze(fe1305x2 *r) { r->v[8] = y4; } -static void fe1305x2_tobytearray(uint8_t *r, fe1305x2 *x) { +static void store32(uint8_t out[4], uint32_t v) { OPENSSL_memcpy(out, &v, 4); } + +// load32 exists to avoid breaking strict aliasing rules in +// fe1305x2_frombytearray. +static uint32_t load32(const uint8_t t[4]) { + uint32_t tmp; + OPENSSL_memcpy(&tmp, t, sizeof(tmp)); + return tmp; +} + +static void fe1305x2_tobytearray(uint8_t r[16], fe1305x2 *x) { uint32_t x0 = x->v[0]; uint32_t x1 = x->v[2]; uint32_t x2 = x->v[4]; @@ -119,22 +129,13 @@ static void fe1305x2_tobytearray(uint8_t *r, fe1305x2 *x) { x4 += x3 >> 26; x3 &= 0x3ffffff; - *(uint32_t *)r = x0 + (x1 << 26); - *(uint32_t *)(r + 4) = (x1 >> 6) + (x2 << 20); - *(uint32_t *)(r + 8) = (x2 >> 12) + (x3 << 14); - *(uint32_t *)(r + 12) = (x3 >> 18) + (x4 << 8); -} - -// load32 exists to avoid breaking strict aliasing rules in -// fe1305x2_frombytearray. -static uint32_t load32(uint8_t *t) { - uint32_t tmp; - OPENSSL_memcpy(&tmp, t, sizeof(tmp)); - return tmp; + store32(r, x0 + (x1 << 26)); + store32(r + 4, (x1 >> 6) + (x2 << 20)); + store32(r + 8, (x2 >> 12) + (x3 << 14)); + store32(r + 12, (x3 >> 18) + (x4 << 8)); } -static void fe1305x2_frombytearray(fe1305x2 *r, const uint8_t *x, - unsigned long long xlen) { +static void fe1305x2_frombytearray(fe1305x2 *r, const uint8_t *x, size_t xlen) { unsigned i; uint8_t t[17]; @@ -190,11 +191,11 @@ void CRYPTO_poly1305_init_neon(poly1305_state *state, const uint8_t key[32]) { fe1305x2 *const precomp = c + 1; unsigned int j; - r->v[1] = r->v[0] = 0x3ffffff & *(uint32_t *)key; - r->v[3] = r->v[2] = 0x3ffff03 & ((*(uint32_t *)(key + 3)) >> 2); - r->v[5] = r->v[4] = 0x3ffc0ff & ((*(uint32_t *)(key + 6)) >> 4); - r->v[7] = r->v[6] = 0x3f03fff & ((*(uint32_t *)(key + 9)) >> 6); - r->v[9] = r->v[8] = 0x00fffff & ((*(uint32_t *)(key + 12)) >> 8); + r->v[1] = r->v[0] = 0x3ffffff & load32(key); + r->v[3] = r->v[2] = 0x3ffff03 & (load32(key + 3) >> 2); + r->v[5] = r->v[4] = 0x3ffc0ff & (load32(key + 6) >> 4); + r->v[7] = r->v[6] = 0x3f03fff & (load32(key + 9) >> 6); + r->v[9] = r->v[8] = 0x00fffff & (load32(key + 12) >> 8); for (j = 0; j < 10; j++) { h->v[j] = 0; // XXX: should fast-forward a bit diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_vec.c b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_vec.c rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c index 44dbe7a3b..81410f4e1 100644 --- a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_vec.c +++ b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c @@ -23,13 +23,25 @@ #include "../internal.h" -#if !defined(OPENSSL_WINDOWS) && defined(OPENSSL_X86_64) +#if defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_X86_64) #include -#define U8TO64_LE(m) (*(const uint64_t *)(m)) -#define U8TO32_LE(m) (*(const uint32_t *)(m)) -#define U64TO8_LE(m, v) (*(uint64_t *)(m)) = v +static uint32_t load_u32_le(const uint8_t in[4]) { + uint32_t ret; + OPENSSL_memcpy(&ret, in, 4); + return ret; +} + +static uint64_t load_u64_le(const uint8_t in[8]) { + uint64_t ret; + OPENSSL_memcpy(&ret, in, 8); + return ret; +} + +static void store_u64_le(uint8_t out[8], uint64_t v) { + OPENSSL_memcpy(out, &v, 8); +} typedef __m128i xmmi; @@ -96,8 +108,8 @@ void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) { uint64_t t0, t1; // clamp key - t0 = U8TO64_LE(key + 0); - t1 = U8TO64_LE(key + 8); + t0 = load_u64_le(key + 0); + t1 = load_u64_le(key + 8); r0 = t0 & 0xffc0fffffff; t0 >>= 44; t0 |= t1 << 20; @@ -115,10 +127,10 @@ void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) { p->R22.d[3] = (uint32_t)(r2 >> 32); // store pad - p->R23.d[1] = U8TO32_LE(key + 16); - p->R23.d[3] = U8TO32_LE(key + 20); - p->R24.d[1] = U8TO32_LE(key + 24); - p->R24.d[3] = U8TO32_LE(key + 28); + p->R23.d[1] = load_u32_le(key + 16); + p->R23.d[3] = load_u32_le(key + 20); + p->R24.d[1] = load_u32_le(key + 24); + p->R24.d[3] = load_u32_le(key + 28); // H = 0 st->H[0] = _mm_setzero_si128(); @@ -662,6 +674,11 @@ void CRYPTO_poly1305_update(poly1305_state *state, const uint8_t *m, poly1305_state_internal *st = poly1305_aligned_state(state); size_t want; + // Work around a C language bug. See https://crbug.com/1019588. + if (bytes == 0) { + return; + } + // need at least 32 initial bytes to start the accelerated branch if (!st->started) { if ((st->leftover == 0) && (bytes > 32)) { @@ -745,8 +762,8 @@ void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) { } poly1305_donna_atleast16bytes: - t0 = U8TO64_LE(m + 0); - t1 = U8TO64_LE(m + 8); + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); h0 += t0 & 0xfffffffffff; t0 = shr128_pair(t1, t0, 44); h1 += t0 & 0xfffffffffff; @@ -785,8 +802,8 @@ void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) { OPENSSL_memset(m + leftover, 0, 16 - leftover); leftover = 16; - t0 = U8TO64_LE(m + 0); - t1 = U8TO64_LE(m + 8); + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); h0 += t0 & 0xfffffffffff; t0 = shr128_pair(t1, t0, 44); h1 += t0 & 0xfffffffffff; @@ -832,8 +849,8 @@ void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) { t1 = (t1 >> 24); h2 += (t1)+c; - U64TO8_LE(mac + 0, ((h0) | (h1 << 44))); - U64TO8_LE(mac + 8, ((h1 >> 20) | (h2 << 24))); + store_u64_le(mac + 0, ((h0) | (h1 << 44))); + store_u64_le(mac + 8, ((h1 >> 20) | (h2 << 24))); } -#endif // !OPENSSL_WINDOWS && OPENSSL_X86_64 +#endif // BORINGSSL_HAS_UINT128 && OPENSSL_X86_64 diff --git a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_vec.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_vec.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c.grpc_back index 480d9e56a..29cd5c3f3 100644 --- a/Pods/BoringSSL-GRPC/crypto/poly1305/poly1305_vec.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/poly1305/poly1305_vec.c.grpc_back @@ -23,13 +23,25 @@ #include "../internal.h" -#if !defined(OPENSSL_WINDOWS) && defined(OPENSSL_X86_64) +#if defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_X86_64) #include -#define U8TO64_LE(m) (*(const uint64_t *)(m)) -#define U8TO32_LE(m) (*(const uint32_t *)(m)) -#define U64TO8_LE(m, v) (*(uint64_t *)(m)) = v +static uint32_t load_u32_le(const uint8_t in[4]) { + uint32_t ret; + OPENSSL_memcpy(&ret, in, 4); + return ret; +} + +static uint64_t load_u64_le(const uint8_t in[8]) { + uint64_t ret; + OPENSSL_memcpy(&ret, in, 8); + return ret; +} + +static void store_u64_le(uint8_t out[8], uint64_t v) { + OPENSSL_memcpy(out, &v, 8); +} typedef __m128i xmmi; @@ -96,8 +108,8 @@ void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) { uint64_t t0, t1; // clamp key - t0 = U8TO64_LE(key + 0); - t1 = U8TO64_LE(key + 8); + t0 = load_u64_le(key + 0); + t1 = load_u64_le(key + 8); r0 = t0 & 0xffc0fffffff; t0 >>= 44; t0 |= t1 << 20; @@ -115,10 +127,10 @@ void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) { p->R22.d[3] = (uint32_t)(r2 >> 32); // store pad - p->R23.d[1] = U8TO32_LE(key + 16); - p->R23.d[3] = U8TO32_LE(key + 20); - p->R24.d[1] = U8TO32_LE(key + 24); - p->R24.d[3] = U8TO32_LE(key + 28); + p->R23.d[1] = load_u32_le(key + 16); + p->R23.d[3] = load_u32_le(key + 20); + p->R24.d[1] = load_u32_le(key + 24); + p->R24.d[3] = load_u32_le(key + 28); // H = 0 st->H[0] = _mm_setzero_si128(); @@ -662,6 +674,11 @@ void CRYPTO_poly1305_update(poly1305_state *state, const uint8_t *m, poly1305_state_internal *st = poly1305_aligned_state(state); size_t want; + // Work around a C language bug. See https://crbug.com/1019588. + if (bytes == 0) { + return; + } + // need at least 32 initial bytes to start the accelerated branch if (!st->started) { if ((st->leftover == 0) && (bytes > 32)) { @@ -745,8 +762,8 @@ void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) { } poly1305_donna_atleast16bytes: - t0 = U8TO64_LE(m + 0); - t1 = U8TO64_LE(m + 8); + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); h0 += t0 & 0xfffffffffff; t0 = shr128_pair(t1, t0, 44); h1 += t0 & 0xfffffffffff; @@ -785,8 +802,8 @@ poly1305_donna_atmost15bytes: OPENSSL_memset(m + leftover, 0, 16 - leftover); leftover = 16; - t0 = U8TO64_LE(m + 0); - t1 = U8TO64_LE(m + 8); + t0 = load_u64_le(m + 0); + t1 = load_u64_le(m + 8); h0 += t0 & 0xfffffffffff; t0 = shr128_pair(t1, t0, 44); h1 += t0 & 0xfffffffffff; @@ -832,8 +849,8 @@ poly1305_donna_finish: t1 = (t1 >> 24); h2 += (t1)+c; - U64TO8_LE(mac + 0, ((h0) | (h1 << 44))); - U64TO8_LE(mac + 8, ((h1 >> 20) | (h2 << 24))); + store_u64_le(mac + 0, ((h0) | (h1 << 44))); + store_u64_le(mac + 8, ((h1 >> 20) | (h2 << 24))); } -#endif // !OPENSSL_WINDOWS && OPENSSL_X86_64 +#endif // BORINGSSL_HAS_UINT128 && OPENSSL_X86_64 diff --git a/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h b/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h new file mode 100644 index 000000000..b8ae032b3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h @@ -0,0 +1,45 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_POOL_INTERNAL_H +#define OPENSSL_HEADER_POOL_INTERNAL_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +DECLARE_LHASH_OF(CRYPTO_BUFFER) + +struct crypto_buffer_st { + CRYPTO_BUFFER_POOL *pool; + uint8_t *data; + size_t len; + CRYPTO_refcount_t references; +}; + +struct crypto_buffer_pool_st { + LHASH_OF(CRYPTO_BUFFER) *bufs; + CRYPTO_MUTEX lock; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_POOL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h.grpc_back new file mode 100644 index 000000000..ed91de613 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/pool/internal.h.grpc_back @@ -0,0 +1,45 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_POOL_INTERNAL_H +#define OPENSSL_HEADER_POOL_INTERNAL_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +DECLARE_LHASH_OF(CRYPTO_BUFFER) + +struct crypto_buffer_st { + CRYPTO_BUFFER_POOL *pool; + uint8_t *data; + size_t len; + CRYPTO_refcount_t references; +}; + +struct crypto_buffer_pool_st { + LHASH_OF(CRYPTO_BUFFER) *bufs; + CRYPTO_MUTEX lock; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_POOL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/crypto/pool/pool.c b/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/pool/pool.c rename to Pods/BoringSSL-GRPC/src/crypto/pool/pool.c index af57f2af9..e457856a3 100644 --- a/Pods/BoringSSL-GRPC/crypto/pool/pool.c +++ b/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -26,6 +25,8 @@ #include "internal.h" +DEFINE_LHASH_OF(CRYPTO_BUFFER) + static uint32_t CRYPTO_BUFFER_hash(const CRYPTO_BUFFER *buf) { return OPENSSL_hash32(buf->data, buf->len); } @@ -97,7 +98,7 @@ CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, } OPENSSL_memset(buf, 0, sizeof(CRYPTO_BUFFER)); - buf->data = BUF_memdup(data, len); + buf->data = OPENSSL_memdup(data, len); if (len != 0 && buf->data == NULL) { OPENSSL_free(buf); return NULL; @@ -135,6 +136,25 @@ CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, return buf; } +CRYPTO_BUFFER *CRYPTO_BUFFER_alloc(uint8_t **out_data, size_t len) { + CRYPTO_BUFFER *const buf = OPENSSL_malloc(sizeof(CRYPTO_BUFFER)); + if (buf == NULL) { + return NULL; + } + OPENSSL_memset(buf, 0, sizeof(CRYPTO_BUFFER)); + + buf->data = OPENSSL_malloc(len); + if (len != 0 && buf->data == NULL) { + OPENSSL_free(buf); + return NULL; + } + buf->len = len; + buf->references = 1; + + *out_data = buf->data; + return buf; +} + CRYPTO_BUFFER* CRYPTO_BUFFER_new_from_CBS(CBS *cbs, CRYPTO_BUFFER_POOL *pool) { return CRYPTO_BUFFER_new(CBS_data(cbs), CBS_len(cbs), pool); } diff --git a/Pods/BoringSSL-GRPC/crypto/pool/pool.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/pool/pool.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/pool/pool.c.grpc_back index 9cfbf1eeb..917e43c2f 100644 --- a/Pods/BoringSSL-GRPC/crypto/pool/pool.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/pool/pool.c.grpc_back @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -26,6 +25,8 @@ #include "internal.h" +DEFINE_LHASH_OF(CRYPTO_BUFFER) + static uint32_t CRYPTO_BUFFER_hash(const CRYPTO_BUFFER *buf) { return OPENSSL_hash32(buf->data, buf->len); } @@ -97,7 +98,7 @@ CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, } OPENSSL_memset(buf, 0, sizeof(CRYPTO_BUFFER)); - buf->data = BUF_memdup(data, len); + buf->data = OPENSSL_memdup(data, len); if (len != 0 && buf->data == NULL) { OPENSSL_free(buf); return NULL; @@ -135,6 +136,25 @@ CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, return buf; } +CRYPTO_BUFFER *CRYPTO_BUFFER_alloc(uint8_t **out_data, size_t len) { + CRYPTO_BUFFER *const buf = OPENSSL_malloc(sizeof(CRYPTO_BUFFER)); + if (buf == NULL) { + return NULL; + } + OPENSSL_memset(buf, 0, sizeof(CRYPTO_BUFFER)); + + buf->data = OPENSSL_malloc(len); + if (len != 0 && buf->data == NULL) { + OPENSSL_free(buf); + return NULL; + } + buf->len = len; + buf->references = 1; + + *out_data = buf->data; + return buf; +} + CRYPTO_BUFFER* CRYPTO_BUFFER_new_from_CBS(CBS *cbs, CRYPTO_BUFFER_POOL *pool) { return CRYPTO_BUFFER_new(CBS_data(cbs), CBS_len(cbs), pool); } diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/deterministic.c b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/deterministic.c rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c index 7950da8ac..bbb16e004 100644 --- a/Pods/BoringSSL-GRPC/crypto/rand_extra/deterministic.c +++ b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c @@ -45,4 +45,12 @@ void CRYPTO_sysrand(uint8_t *out, size_t requested) { g_num_calls++; } +void CRYPTO_sysrand_for_seed(uint8_t *out, size_t requested) { + CRYPTO_sysrand(out, requested); +} + +void CRYPTO_sysrand_if_available(uint8_t *out, size_t requested) { + CRYPTO_sysrand(out, requested); +} + #endif // BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/deterministic.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/deterministic.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c.grpc_back index 17fa71e64..34547ea55 100644 --- a/Pods/BoringSSL-GRPC/crypto/rand_extra/deterministic.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/deterministic.c.grpc_back @@ -45,4 +45,12 @@ void CRYPTO_sysrand(uint8_t *out, size_t requested) { g_num_calls++; } +void CRYPTO_sysrand_for_seed(uint8_t *out, size_t requested) { + CRYPTO_sysrand(out, requested); +} + +void CRYPTO_sysrand_if_available(uint8_t *out, size_t requested) { + CRYPTO_sysrand(out, requested); +} + #endif // BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/forkunsafe.c b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/forkunsafe.c rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/forkunsafe.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/forkunsafe.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/forkunsafe.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c new file mode 100644 index 000000000..95aa311a6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c @@ -0,0 +1,30 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#if defined(OPENSSL_FUCHSIA) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + +#include +#include + +#include + +#include "../fipsmodule/rand/internal.h" + +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + zx_cprng_draw(out, requested); +} + +#endif // OPENSSL_FUCHSIA && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c.grpc_back new file mode 100644 index 000000000..0514d809c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/fuchsia.c.grpc_back @@ -0,0 +1,30 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#if defined(OPENSSL_FUCHSIA) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + +#include +#include + +#include + +#include "../fipsmodule/rand/internal.h" + +void CRYPTO_sysrand(uint8_t *out, size_t requested) { + zx_cprng_draw(out, requested); +} + +#endif // OPENSSL_FUCHSIA && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/rand_extra.c b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/rand_extra.c rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/rand_extra.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/rand_extra.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/rand_extra.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/windows.c b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/windows.c rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c diff --git a/Pods/BoringSSL-GRPC/crypto/rand_extra/windows.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rand_extra/windows.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/rand_extra/windows.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/rc4/rc4.c b/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rc4/rc4.c rename to Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c diff --git a/Pods/BoringSSL-GRPC/crypto/rc4/rc4.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rc4/rc4.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/rc4/rc4.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/refcount_c11.c b/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/refcount_c11.c rename to Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c diff --git a/Pods/BoringSSL-GRPC/crypto/refcount_c11.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/refcount_c11.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/refcount_c11.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/refcount_lock.c b/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/refcount_lock.c rename to Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c index b5de7be97..0d01352e3 100644 --- a/Pods/BoringSSL-GRPC/crypto/refcount_lock.c +++ b/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c @@ -21,8 +21,8 @@ #if !defined(OPENSSL_C11_ATOMIC) -OPENSSL_COMPILE_ASSERT((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, - CRYPTO_REFCOUNT_MAX_is_incorrect); +OPENSSL_STATIC_ASSERT((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, + "CRYPTO_REFCOUNT_MAX is incorrect"); static struct CRYPTO_STATIC_MUTEX g_refcount_lock = CRYPTO_STATIC_MUTEX_INIT; diff --git a/Pods/BoringSSL-GRPC/crypto/refcount_lock.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/refcount_lock.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c.grpc_back index 8b855d627..fb1c11f6b 100644 --- a/Pods/BoringSSL-GRPC/crypto/refcount_lock.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/refcount_lock.c.grpc_back @@ -21,8 +21,8 @@ #if !defined(OPENSSL_C11_ATOMIC) -OPENSSL_COMPILE_ASSERT((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, - CRYPTO_REFCOUNT_MAX_is_incorrect); +OPENSSL_STATIC_ASSERT((CRYPTO_refcount_t)-1 == CRYPTO_REFCOUNT_MAX, + "CRYPTO_REFCOUNT_MAX is incorrect"); static struct CRYPTO_STATIC_MUTEX g_refcount_lock = CRYPTO_STATIC_MUTEX_INIT; diff --git a/Pods/BoringSSL-GRPC/crypto/rsa_extra/rsa_asn1.c b/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rsa_extra/rsa_asn1.c rename to Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c diff --git a/Pods/BoringSSL-GRPC/crypto/rsa_extra/rsa_asn1.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/rsa_extra/rsa_asn1.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_asn1.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c b/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c new file mode 100644 index 000000000..40f6b4fd3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c @@ -0,0 +1,22 @@ +/* + * Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#include + + +int RSA_print(BIO *bio, const RSA *rsa, int indent) { + EVP_PKEY *pkey = EVP_PKEY_new(); + int ret = pkey != NULL && + EVP_PKEY_set1_RSA(pkey, (RSA *)rsa) && + EVP_PKEY_print_private(bio, pkey, indent, NULL); + EVP_PKEY_free(pkey); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c.grpc_back new file mode 100644 index 000000000..71970b8ea --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/rsa_extra/rsa_print.c.grpc_back @@ -0,0 +1,22 @@ +/* + * Copyright 2006-2017 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#include + + +int RSA_print(BIO *bio, const RSA *rsa, int indent) { + EVP_PKEY *pkey = EVP_PKEY_new(); + int ret = pkey != NULL && + EVP_PKEY_set1_RSA(pkey, (RSA *)rsa) && + EVP_PKEY_print_private(bio, pkey, indent, NULL); + EVP_PKEY_free(pkey); + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c b/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c new file mode 100644 index 000000000..26e73bfd5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c @@ -0,0 +1,82 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include +#include + +#include + +#include "../internal.h" + + +static void siphash_round(uint64_t v[4]) { + v[0] += v[1]; + v[2] += v[3]; + v[1] = (v[1] << 13) | (v[1] >> (64 - 13)); + v[3] = (v[3] << 16) | (v[3] >> (64 - 16)); + v[1] ^= v[0]; + v[3] ^= v[2]; + v[0] = (v[0] << 32) | (v[0] >> 32); + v[2] += v[1]; + v[0] += v[3]; + v[1] = (v[1] << 17) | (v[1] >> (64 - 17)); + v[3] = (v[3] << 21) | (v[3] >> (64 - 21)); + v[1] ^= v[2]; + v[3] ^= v[0]; + v[2] = (v[2] << 32) | (v[2] >> 32); +} + +uint64_t SIPHASH_24(const uint64_t key[2], const uint8_t *input, + size_t input_len) { + const size_t orig_input_len = input_len; + + uint64_t v[4]; + v[0] = key[0] ^ UINT64_C(0x736f6d6570736575); + v[1] = key[1] ^ UINT64_C(0x646f72616e646f6d); + v[2] = key[0] ^ UINT64_C(0x6c7967656e657261); + v[3] = key[1] ^ UINT64_C(0x7465646279746573); + + while (input_len >= sizeof(uint64_t)) { + uint64_t m; + memcpy(&m, input, sizeof(m)); + v[3] ^= m; + siphash_round(v); + siphash_round(v); + v[0] ^= m; + + input += sizeof(uint64_t); + input_len -= sizeof(uint64_t); + } + + union { + uint8_t bytes[8]; + uint64_t word; + } last_block; + last_block.word = 0; + OPENSSL_memcpy(last_block.bytes, input, input_len); + last_block.bytes[7] = orig_input_len & 0xff; + + v[3] ^= last_block.word; + siphash_round(v); + siphash_round(v); + v[0] ^= last_block.word; + + v[2] ^= 0xff; + siphash_round(v); + siphash_round(v); + siphash_round(v); + siphash_round(v); + + return v[0] ^ v[1] ^ v[2] ^ v[3]; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c.grpc_back new file mode 100644 index 000000000..f55c3cab4 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/siphash/siphash.c.grpc_back @@ -0,0 +1,82 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include +#include + +#include + +#include "../internal.h" + + +static void siphash_round(uint64_t v[4]) { + v[0] += v[1]; + v[2] += v[3]; + v[1] = (v[1] << 13) | (v[1] >> (64 - 13)); + v[3] = (v[3] << 16) | (v[3] >> (64 - 16)); + v[1] ^= v[0]; + v[3] ^= v[2]; + v[0] = (v[0] << 32) | (v[0] >> 32); + v[2] += v[1]; + v[0] += v[3]; + v[1] = (v[1] << 17) | (v[1] >> (64 - 17)); + v[3] = (v[3] << 21) | (v[3] >> (64 - 21)); + v[1] ^= v[2]; + v[3] ^= v[0]; + v[2] = (v[2] << 32) | (v[2] >> 32); +} + +uint64_t SIPHASH_24(const uint64_t key[2], const uint8_t *input, + size_t input_len) { + const size_t orig_input_len = input_len; + + uint64_t v[4]; + v[0] = key[0] ^ UINT64_C(0x736f6d6570736575); + v[1] = key[1] ^ UINT64_C(0x646f72616e646f6d); + v[2] = key[0] ^ UINT64_C(0x6c7967656e657261); + v[3] = key[1] ^ UINT64_C(0x7465646279746573); + + while (input_len >= sizeof(uint64_t)) { + uint64_t m; + memcpy(&m, input, sizeof(m)); + v[3] ^= m; + siphash_round(v); + siphash_round(v); + v[0] ^= m; + + input += sizeof(uint64_t); + input_len -= sizeof(uint64_t); + } + + union { + uint8_t bytes[8]; + uint64_t word; + } last_block; + last_block.word = 0; + OPENSSL_memcpy(last_block.bytes, input, input_len); + last_block.bytes[7] = orig_input_len & 0xff; + + v[3] ^= last_block.word; + siphash_round(v); + siphash_round(v); + v[0] ^= last_block.word; + + v[2] ^= 0xff; + siphash_round(v); + siphash_round(v); + siphash_round(v); + siphash_round(v); + + return v[0] ^ v[1] ^ v[2] ^ v[3]; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c b/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c new file mode 100644 index 000000000..79399dec7 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c @@ -0,0 +1,431 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include + +#include + +#include "../internal.h" + + +// kMinSize is the number of pointers that will be initially allocated in a new +// stack. +static const size_t kMinSize = 4; + +_STACK *sk_new(stack_cmp_func comp) { + _STACK *ret; + + ret = OPENSSL_malloc(sizeof(_STACK)); + if (ret == NULL) { + goto err; + } + OPENSSL_memset(ret, 0, sizeof(_STACK)); + + ret->data = OPENSSL_malloc(sizeof(void *) * kMinSize); + if (ret->data == NULL) { + goto err; + } + + OPENSSL_memset(ret->data, 0, sizeof(void *) * kMinSize); + + ret->comp = comp; + ret->num_alloc = kMinSize; + + return ret; + +err: + OPENSSL_free(ret); + return NULL; +} + +_STACK *sk_new_null(void) { return sk_new(NULL); } + +size_t sk_num(const _STACK *sk) { + if (sk == NULL) { + return 0; + } + return sk->num; +} + +void sk_zero(_STACK *sk) { + if (sk == NULL || sk->num == 0) { + return; + } + OPENSSL_memset(sk->data, 0, sizeof(void*) * sk->num); + sk->num = 0; + sk->sorted = 0; +} + +void *sk_value(const _STACK *sk, size_t i) { + if (!sk || i >= sk->num) { + return NULL; + } + return sk->data[i]; +} + +void *sk_set(_STACK *sk, size_t i, void *value) { + if (!sk || i >= sk->num) { + return NULL; + } + return sk->data[i] = value; +} + +void sk_free(_STACK *sk) { + if (sk == NULL) { + return; + } + OPENSSL_free(sk->data); + OPENSSL_free(sk); +} + +void sk_pop_free_ex(_STACK *sk, void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func) { + if (sk == NULL) { + return; + } + + for (size_t i = 0; i < sk->num; i++) { + if (sk->data[i] != NULL) { + call_free_func(free_func, sk->data[i]); + } + } + sk_free(sk); +} + +// Historically, |sk_pop_free| called the function as |stack_free_func| +// directly. This is undefined in C. Some callers called |sk_pop_free| directly, +// so we must maintain a compatibility version for now. +static void call_free_func_legacy(stack_free_func func, void *ptr) { + func(ptr); +} + +void sk_pop_free(_STACK *sk, stack_free_func free_func) { + sk_pop_free_ex(sk, call_free_func_legacy, free_func); +} + +size_t sk_insert(_STACK *sk, void *p, size_t where) { + if (sk == NULL) { + return 0; + } + + if (sk->num_alloc <= sk->num + 1) { + // Attempt to double the size of the array. + size_t new_alloc = sk->num_alloc << 1; + size_t alloc_size = new_alloc * sizeof(void *); + void **data; + + // If the doubling overflowed, try to increment. + if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { + new_alloc = sk->num_alloc + 1; + alloc_size = new_alloc * sizeof(void *); + } + + // If the increment also overflowed, fail. + if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { + return 0; + } + + data = OPENSSL_realloc(sk->data, alloc_size); + if (data == NULL) { + return 0; + } + + sk->data = data; + sk->num_alloc = new_alloc; + } + + if (where >= sk->num) { + sk->data[sk->num] = p; + } else { + OPENSSL_memmove(&sk->data[where + 1], &sk->data[where], + sizeof(void *) * (sk->num - where)); + sk->data[where] = p; + } + + sk->num++; + sk->sorted = 0; + + return sk->num; +} + +void *sk_delete(_STACK *sk, size_t where) { + void *ret; + + if (!sk || where >= sk->num) { + return NULL; + } + + ret = sk->data[where]; + + if (where != sk->num - 1) { + OPENSSL_memmove(&sk->data[where], &sk->data[where + 1], + sizeof(void *) * (sk->num - where - 1)); + } + + sk->num--; + return ret; +} + +void *sk_delete_ptr(_STACK *sk, const void *p) { + if (sk == NULL) { + return NULL; + } + + for (size_t i = 0; i < sk->num; i++) { + if (sk->data[i] == p) { + return sk_delete(sk, i); + } + } + + return NULL; +} + +int sk_find(const _STACK *sk, size_t *out_index, const void *p, + int (*call_cmp_func)(stack_cmp_func, const void **, + const void **)) { + if (sk == NULL) { + return 0; + } + + if (sk->comp == NULL) { + // Use pointer equality when no comparison function has been set. + for (size_t i = 0; i < sk->num; i++) { + if (sk->data[i] == p) { + if (out_index) { + *out_index = i; + } + return 1; + } + } + return 0; + } + + if (p == NULL) { + return 0; + } + + if (!sk_is_sorted(sk)) { + for (size_t i = 0; i < sk->num; i++) { + const void *elem = sk->data[i]; + if (call_cmp_func(sk->comp, &p, &elem) == 0) { + if (out_index) { + *out_index = i; + } + return 1; + } + } + return 0; + } + + // The stack is sorted, so binary search to find the element. + // + // |lo| and |hi| maintain a half-open interval of where the answer may be. All + // indices such that |lo <= idx < hi| are candidates. + size_t lo = 0, hi = sk->num; + while (lo < hi) { + // Bias |mid| towards |lo|. See the |r == 0| case below. + size_t mid = lo + (hi - lo - 1) / 2; + assert(lo <= mid && mid < hi); + const void *elem = sk->data[mid]; + int r = call_cmp_func(sk->comp, &p, &elem); + if (r > 0) { + lo = mid + 1; // |mid| is too low. + } else if (r < 0) { + hi = mid; // |mid| is too high. + } else { + // |mid| matches. However, this function returns the earliest match, so we + // can only return if the range has size one. + if (hi - lo == 1) { + if (out_index != NULL) { + *out_index = mid; + } + return 1; + } + // The sample is biased towards |lo|. |mid| can only be |hi - 1| if + // |hi - lo| was one, so this makes forward progress. + assert(mid + 1 < hi); + hi = mid + 1; + } + } + + assert(lo == hi); + return 0; // Not found. +} + +void *sk_shift(_STACK *sk) { + if (sk == NULL) { + return NULL; + } + if (sk->num == 0) { + return NULL; + } + return sk_delete(sk, 0); +} + +size_t sk_push(_STACK *sk, void *p) { return (sk_insert(sk, p, sk->num)); } + +void *sk_pop(_STACK *sk) { + if (sk == NULL) { + return NULL; + } + if (sk->num == 0) { + return NULL; + } + return sk_delete(sk, sk->num - 1); +} + +_STACK *sk_dup(const _STACK *sk) { + _STACK *ret; + void **s; + + if (sk == NULL) { + return NULL; + } + + ret = sk_new(sk->comp); + if (ret == NULL) { + goto err; + } + + s = (void **)OPENSSL_realloc(ret->data, sizeof(void *) * sk->num_alloc); + if (s == NULL) { + goto err; + } + ret->data = s; + + ret->num = sk->num; + OPENSSL_memcpy(ret->data, sk->data, sizeof(void *) * sk->num); + ret->sorted = sk->sorted; + ret->num_alloc = sk->num_alloc; + ret->comp = sk->comp; + return ret; + +err: + sk_free(ret); + return NULL; +} + +void sk_sort(_STACK *sk) { + if (sk == NULL || sk->comp == NULL || sk->sorted) { + return; + } + + // sk->comp is a function that takes pointers to pointers to elements, but + // qsort take a comparison function that just takes pointers to elements. + // However, since we're passing an array of pointers to qsort, we can just + // cast the comparison function and everything works. + // + // TODO(davidben): This is undefined behavior, but the call is in libc so, + // e.g., CFI does not notice. Unfortunately, |qsort| is missing a void* + // parameter in its callback and |qsort_s| / |qsort_r| are a mess of + // incompatibility. + if (sk->num >= 2) { + int (*comp_func)(const void *, const void *) = + (int (*)(const void *, const void *))(sk->comp); + qsort(sk->data, sk->num, sizeof(void *), comp_func); + } + sk->sorted = 1; +} + +int sk_is_sorted(const _STACK *sk) { + if (!sk) { + return 1; + } + return sk->sorted; +} + +stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp) { + stack_cmp_func old = sk->comp; + + if (sk->comp != comp) { + sk->sorted = 0; + } + sk->comp = comp; + + return old; +} + +_STACK *sk_deep_copy(const _STACK *sk, + void *(*call_copy_func)(stack_copy_func, void *), + stack_copy_func copy_func, + void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func) { + _STACK *ret = sk_dup(sk); + if (ret == NULL) { + return NULL; + } + + for (size_t i = 0; i < ret->num; i++) { + if (ret->data[i] == NULL) { + continue; + } + ret->data[i] = call_copy_func(copy_func, ret->data[i]); + if (ret->data[i] == NULL) { + for (size_t j = 0; j < i; j++) { + if (ret->data[j] != NULL) { + call_free_func(free_func, ret->data[j]); + } + } + sk_free(ret); + return NULL; + } + } + + return ret; +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c.grpc_back new file mode 100644 index 000000000..599bd7b1b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/stack/stack.c.grpc_back @@ -0,0 +1,431 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include + +#include + +#include "../internal.h" + + +// kMinSize is the number of pointers that will be initially allocated in a new +// stack. +static const size_t kMinSize = 4; + +_STACK *sk_new(stack_cmp_func comp) { + _STACK *ret; + + ret = OPENSSL_malloc(sizeof(_STACK)); + if (ret == NULL) { + goto err; + } + OPENSSL_memset(ret, 0, sizeof(_STACK)); + + ret->data = OPENSSL_malloc(sizeof(void *) * kMinSize); + if (ret->data == NULL) { + goto err; + } + + OPENSSL_memset(ret->data, 0, sizeof(void *) * kMinSize); + + ret->comp = comp; + ret->num_alloc = kMinSize; + + return ret; + +err: + OPENSSL_free(ret); + return NULL; +} + +_STACK *sk_new_null(void) { return sk_new(NULL); } + +size_t sk_num(const _STACK *sk) { + if (sk == NULL) { + return 0; + } + return sk->num; +} + +void sk_zero(_STACK *sk) { + if (sk == NULL || sk->num == 0) { + return; + } + OPENSSL_memset(sk->data, 0, sizeof(void*) * sk->num); + sk->num = 0; + sk->sorted = 0; +} + +void *sk_value(const _STACK *sk, size_t i) { + if (!sk || i >= sk->num) { + return NULL; + } + return sk->data[i]; +} + +void *sk_set(_STACK *sk, size_t i, void *value) { + if (!sk || i >= sk->num) { + return NULL; + } + return sk->data[i] = value; +} + +void sk_free(_STACK *sk) { + if (sk == NULL) { + return; + } + OPENSSL_free(sk->data); + OPENSSL_free(sk); +} + +void sk_pop_free_ex(_STACK *sk, void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func) { + if (sk == NULL) { + return; + } + + for (size_t i = 0; i < sk->num; i++) { + if (sk->data[i] != NULL) { + call_free_func(free_func, sk->data[i]); + } + } + sk_free(sk); +} + +// Historically, |sk_pop_free| called the function as |stack_free_func| +// directly. This is undefined in C. Some callers called |sk_pop_free| directly, +// so we must maintain a compatibility version for now. +static void call_free_func_legacy(stack_free_func func, void *ptr) { + func(ptr); +} + +void sk_pop_free(_STACK *sk, stack_free_func free_func) { + sk_pop_free_ex(sk, call_free_func_legacy, free_func); +} + +size_t sk_insert(_STACK *sk, void *p, size_t where) { + if (sk == NULL) { + return 0; + } + + if (sk->num_alloc <= sk->num + 1) { + // Attempt to double the size of the array. + size_t new_alloc = sk->num_alloc << 1; + size_t alloc_size = new_alloc * sizeof(void *); + void **data; + + // If the doubling overflowed, try to increment. + if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { + new_alloc = sk->num_alloc + 1; + alloc_size = new_alloc * sizeof(void *); + } + + // If the increment also overflowed, fail. + if (new_alloc < sk->num_alloc || alloc_size / sizeof(void *) != new_alloc) { + return 0; + } + + data = OPENSSL_realloc(sk->data, alloc_size); + if (data == NULL) { + return 0; + } + + sk->data = data; + sk->num_alloc = new_alloc; + } + + if (where >= sk->num) { + sk->data[sk->num] = p; + } else { + OPENSSL_memmove(&sk->data[where + 1], &sk->data[where], + sizeof(void *) * (sk->num - where)); + sk->data[where] = p; + } + + sk->num++; + sk->sorted = 0; + + return sk->num; +} + +void *sk_delete(_STACK *sk, size_t where) { + void *ret; + + if (!sk || where >= sk->num) { + return NULL; + } + + ret = sk->data[where]; + + if (where != sk->num - 1) { + OPENSSL_memmove(&sk->data[where], &sk->data[where + 1], + sizeof(void *) * (sk->num - where - 1)); + } + + sk->num--; + return ret; +} + +void *sk_delete_ptr(_STACK *sk, const void *p) { + if (sk == NULL) { + return NULL; + } + + for (size_t i = 0; i < sk->num; i++) { + if (sk->data[i] == p) { + return sk_delete(sk, i); + } + } + + return NULL; +} + +int sk_find(const _STACK *sk, size_t *out_index, const void *p, + int (*call_cmp_func)(stack_cmp_func, const void **, + const void **)) { + if (sk == NULL) { + return 0; + } + + if (sk->comp == NULL) { + // Use pointer equality when no comparison function has been set. + for (size_t i = 0; i < sk->num; i++) { + if (sk->data[i] == p) { + if (out_index) { + *out_index = i; + } + return 1; + } + } + return 0; + } + + if (p == NULL) { + return 0; + } + + if (!sk_is_sorted(sk)) { + for (size_t i = 0; i < sk->num; i++) { + const void *elem = sk->data[i]; + if (call_cmp_func(sk->comp, &p, &elem) == 0) { + if (out_index) { + *out_index = i; + } + return 1; + } + } + return 0; + } + + // The stack is sorted, so binary search to find the element. + // + // |lo| and |hi| maintain a half-open interval of where the answer may be. All + // indices such that |lo <= idx < hi| are candidates. + size_t lo = 0, hi = sk->num; + while (lo < hi) { + // Bias |mid| towards |lo|. See the |r == 0| case below. + size_t mid = lo + (hi - lo - 1) / 2; + assert(lo <= mid && mid < hi); + const void *elem = sk->data[mid]; + int r = call_cmp_func(sk->comp, &p, &elem); + if (r > 0) { + lo = mid + 1; // |mid| is too low. + } else if (r < 0) { + hi = mid; // |mid| is too high. + } else { + // |mid| matches. However, this function returns the earliest match, so we + // can only return if the range has size one. + if (hi - lo == 1) { + if (out_index != NULL) { + *out_index = mid; + } + return 1; + } + // The sample is biased towards |lo|. |mid| can only be |hi - 1| if + // |hi - lo| was one, so this makes forward progress. + assert(mid + 1 < hi); + hi = mid + 1; + } + } + + assert(lo == hi); + return 0; // Not found. +} + +void *sk_shift(_STACK *sk) { + if (sk == NULL) { + return NULL; + } + if (sk->num == 0) { + return NULL; + } + return sk_delete(sk, 0); +} + +size_t sk_push(_STACK *sk, void *p) { return (sk_insert(sk, p, sk->num)); } + +void *sk_pop(_STACK *sk) { + if (sk == NULL) { + return NULL; + } + if (sk->num == 0) { + return NULL; + } + return sk_delete(sk, sk->num - 1); +} + +_STACK *sk_dup(const _STACK *sk) { + _STACK *ret; + void **s; + + if (sk == NULL) { + return NULL; + } + + ret = sk_new(sk->comp); + if (ret == NULL) { + goto err; + } + + s = (void **)OPENSSL_realloc(ret->data, sizeof(void *) * sk->num_alloc); + if (s == NULL) { + goto err; + } + ret->data = s; + + ret->num = sk->num; + OPENSSL_memcpy(ret->data, sk->data, sizeof(void *) * sk->num); + ret->sorted = sk->sorted; + ret->num_alloc = sk->num_alloc; + ret->comp = sk->comp; + return ret; + +err: + sk_free(ret); + return NULL; +} + +void sk_sort(_STACK *sk) { + if (sk == NULL || sk->comp == NULL || sk->sorted) { + return; + } + + // sk->comp is a function that takes pointers to pointers to elements, but + // qsort take a comparison function that just takes pointers to elements. + // However, since we're passing an array of pointers to qsort, we can just + // cast the comparison function and everything works. + // + // TODO(davidben): This is undefined behavior, but the call is in libc so, + // e.g., CFI does not notice. Unfortunately, |qsort| is missing a void* + // parameter in its callback and |qsort_s| / |qsort_r| are a mess of + // incompatibility. + if (sk->num >= 2) { + int (*comp_func)(const void *, const void *) = + (int (*)(const void *, const void *))(sk->comp); + qsort(sk->data, sk->num, sizeof(void *), comp_func); + } + sk->sorted = 1; +} + +int sk_is_sorted(const _STACK *sk) { + if (!sk) { + return 1; + } + return sk->sorted; +} + +stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp) { + stack_cmp_func old = sk->comp; + + if (sk->comp != comp) { + sk->sorted = 0; + } + sk->comp = comp; + + return old; +} + +_STACK *sk_deep_copy(const _STACK *sk, + void *(*call_copy_func)(stack_copy_func, void *), + stack_copy_func copy_func, + void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func) { + _STACK *ret = sk_dup(sk); + if (ret == NULL) { + return NULL; + } + + for (size_t i = 0; i < ret->num; i++) { + if (ret->data[i] == NULL) { + continue; + } + ret->data[i] = call_copy_func(copy_func, ret->data[i]); + if (ret->data[i] == NULL) { + for (size_t j = 0; j < i; j++) { + if (ret->data[j] != NULL) { + call_free_func(free_func, ret->data[j]); + } + } + sk_free(ret); + return NULL; + } + } + + return ret; +} diff --git a/Pods/BoringSSL-GRPC/crypto/thread.c b/Pods/BoringSSL-GRPC/src/crypto/thread.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/thread.c rename to Pods/BoringSSL-GRPC/src/crypto/thread.c diff --git a/Pods/BoringSSL-GRPC/crypto/thread.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/thread.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/thread.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/thread.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/thread_none.c b/Pods/BoringSSL-GRPC/src/crypto/thread_none.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/thread_none.c rename to Pods/BoringSSL-GRPC/src/crypto/thread_none.c index 718d96016..4f07b9d9c 100644 --- a/Pods/BoringSSL-GRPC/crypto/thread_none.c +++ b/Pods/BoringSSL-GRPC/src/crypto/thread_none.c @@ -14,7 +14,7 @@ #include "internal.h" -#if defined(OPENSSL_NO_THREADS) +#if !defined(OPENSSL_THREADS) void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) {} @@ -56,4 +56,4 @@ int CRYPTO_set_thread_local(thread_local_data_t index, void *value, return 1; } -#endif // OPENSSL_NO_THREADS +#endif // !OPENSSL_THREADS diff --git a/Pods/BoringSSL-GRPC/crypto/thread_none.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/thread_none.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/thread_none.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/thread_none.c.grpc_back index 718d96016..4f07b9d9c 100644 --- a/Pods/BoringSSL-GRPC/crypto/thread_none.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/thread_none.c.grpc_back @@ -14,7 +14,7 @@ #include "internal.h" -#if defined(OPENSSL_NO_THREADS) +#if !defined(OPENSSL_THREADS) void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) {} @@ -56,4 +56,4 @@ int CRYPTO_set_thread_local(thread_local_data_t index, void *value, return 1; } -#endif // OPENSSL_NO_THREADS +#endif // !OPENSSL_THREADS diff --git a/Pods/BoringSSL-GRPC/crypto/thread_pthread.c b/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/thread_pthread.c rename to Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c index 1e0c35d65..3f378bf8f 100644 --- a/Pods/BoringSSL-GRPC/crypto/thread_pthread.c +++ b/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c @@ -24,8 +24,8 @@ #include -OPENSSL_COMPILE_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(pthread_rwlock_t), - CRYPTO_MUTEX_too_small); +OPENSSL_STATIC_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(pthread_rwlock_t), + "CRYPTO_MUTEX is too small"); void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) { if (pthread_rwlock_init((pthread_rwlock_t *) lock, NULL) != 0) { diff --git a/Pods/BoringSSL-GRPC/crypto/thread_pthread.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/thread_pthread.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c.grpc_back index f8bf59505..832e90e9a 100644 --- a/Pods/BoringSSL-GRPC/crypto/thread_pthread.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/thread_pthread.c.grpc_back @@ -24,8 +24,8 @@ #include -OPENSSL_COMPILE_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(pthread_rwlock_t), - CRYPTO_MUTEX_too_small); +OPENSSL_STATIC_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(pthread_rwlock_t), + "CRYPTO_MUTEX is too small"); void CRYPTO_MUTEX_init(CRYPTO_MUTEX *lock) { if (pthread_rwlock_init((pthread_rwlock_t *) lock, NULL) != 0) { diff --git a/Pods/BoringSSL-GRPC/crypto/thread_win.c b/Pods/BoringSSL-GRPC/src/crypto/thread_win.c similarity index 79% rename from Pods/BoringSSL-GRPC/crypto/thread_win.c rename to Pods/BoringSSL-GRPC/src/crypto/thread_win.c index 66183ee93..a981f033f 100644 --- a/Pods/BoringSSL-GRPC/crypto/thread_win.c +++ b/Pods/BoringSSL-GRPC/src/crypto/thread_win.c @@ -27,8 +27,8 @@ OPENSSL_MSVC_PRAGMA(warning(pop)) #include -OPENSSL_COMPILE_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(SRWLOCK), - CRYPTO_MUTEX_too_small); +OPENSSL_STATIC_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(SRWLOCK), + "CRYPTO_MUTEX is too small"); static BOOL CALLBACK call_once_init(INIT_ONCE *once, void *arg, void **out) { void (**init)(void) = (void (**)(void))arg; @@ -82,7 +82,7 @@ void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) { ReleaseSRWLockExclusive(&lock->lock); } -static CRITICAL_SECTION g_destructors_lock; +static SRWLOCK g_destructors_lock = SRWLOCK_INIT; static thread_local_destructor_t g_destructors[NUM_OPENSSL_THREAD_LOCALS]; static CRYPTO_once_t g_thread_local_init_once = CRYPTO_ONCE_INIT; @@ -90,10 +90,6 @@ static DWORD g_thread_local_key; static int g_thread_local_failed; static void thread_local_init(void) { - if (!InitializeCriticalSectionAndSpinCount(&g_destructors_lock, 0x400)) { - g_thread_local_failed = 1; - return; - } g_thread_local_key = TlsAlloc(); g_thread_local_failed = (g_thread_local_key == TLS_OUT_OF_INDEXES); } @@ -121,12 +117,11 @@ static void NTAPI thread_local_destructor(PVOID module, DWORD reason, thread_local_destructor_t destructors[NUM_OPENSSL_THREAD_LOCALS]; - EnterCriticalSection(&g_destructors_lock); + AcquireSRWLockExclusive(&g_destructors_lock); OPENSSL_memcpy(destructors, g_destructors, sizeof(destructors)); - LeaveCriticalSection(&g_destructors_lock); + ReleaseSRWLockExclusive(&g_destructors_lock); - unsigned i; - for (i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { + for (unsigned i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { if (destructors[i] != NULL) { destructors[i](pointers[i]); } @@ -146,12 +141,18 @@ static void NTAPI thread_local_destructor(PVOID module, DWORD reason, // if it's not already there. (E.g. if __declspec(thread) is not used). Force // a reference to p_thread_callback_boringssl to prevent whole program // optimization from discarding the variable. +// +// Note, in the prefixed build, |p_thread_callback_boringssl| may be a macro. +#define STRINGIFY(x) #x +#define EXPAND_AND_STRINGIFY(x) STRINGIFY(x) #ifdef _WIN64 -#pragma comment(linker, "/INCLUDE:_tls_used") -#pragma comment(linker, "/INCLUDE:p_thread_callback_boringssl") +__pragma(comment(linker, "/INCLUDE:_tls_used")) +__pragma(comment( + linker, "/INCLUDE:" EXPAND_AND_STRINGIFY(p_thread_callback_boringssl))) #else -#pragma comment(linker, "/INCLUDE:__tls_used") -#pragma comment(linker, "/INCLUDE:_p_thread_callback_boringssl") +__pragma(comment(linker, "/INCLUDE:__tls_used")) +__pragma(comment( + linker, "/INCLUDE:_" EXPAND_AND_STRINGIFY(p_thread_callback_boringssl))) #endif // .CRT$XLA to .CRT$XLZ is an array of PIMAGE_TLS_CALLBACK pointers that are @@ -190,13 +191,31 @@ PIMAGE_TLS_CALLBACK p_thread_callback_boringssl = thread_local_destructor; #endif // _WIN64 +static void **get_thread_locals(void) { + // |TlsGetValue| clears the last error even on success, so that callers may + // distinguish it successfully returning NULL or failing. It is documented to + // never fail if the argument is a valid index from |TlsAlloc|, so we do not + // need to handle this. + // + // However, this error-mangling behavior interferes with the caller's use of + // |GetLastError|. In particular |SSL_get_error| queries the error queue to + // determine whether the caller should look at the OS's errors. To avoid + // destroying state, save and restore the Windows error. + // + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms686812(v=vs.85).aspx + DWORD last_error = GetLastError(); + void **ret = TlsGetValue(g_thread_local_key); + SetLastError(last_error); + return ret; +} + void *CRYPTO_get_thread_local(thread_local_data_t index) { CRYPTO_once(&g_thread_local_init_once, thread_local_init); if (g_thread_local_failed) { return NULL; } - void **pointers = TlsGetValue(g_thread_local_key); + void **pointers = get_thread_locals(); if (pointers == NULL) { return NULL; } @@ -211,7 +230,7 @@ int CRYPTO_set_thread_local(thread_local_data_t index, void *value, return 0; } - void **pointers = TlsGetValue(g_thread_local_key); + void **pointers = get_thread_locals(); if (pointers == NULL) { pointers = OPENSSL_malloc(sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); if (pointers == NULL) { @@ -226,9 +245,9 @@ int CRYPTO_set_thread_local(thread_local_data_t index, void *value, } } - EnterCriticalSection(&g_destructors_lock); + AcquireSRWLockExclusive(&g_destructors_lock); g_destructors[index] = destructor; - LeaveCriticalSection(&g_destructors_lock); + ReleaseSRWLockExclusive(&g_destructors_lock); pointers[index] = value; return 1; diff --git a/Pods/BoringSSL-GRPC/crypto/thread_win.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/thread_win.c.grpc_back similarity index 79% rename from Pods/BoringSSL-GRPC/crypto/thread_win.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/thread_win.c.grpc_back index d6fa54849..c8e19f51f 100644 --- a/Pods/BoringSSL-GRPC/crypto/thread_win.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/thread_win.c.grpc_back @@ -27,8 +27,8 @@ OPENSSL_MSVC_PRAGMA(warning(pop)) #include -OPENSSL_COMPILE_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(SRWLOCK), - CRYPTO_MUTEX_too_small); +OPENSSL_STATIC_ASSERT(sizeof(CRYPTO_MUTEX) >= sizeof(SRWLOCK), + "CRYPTO_MUTEX is too small"); static BOOL CALLBACK call_once_init(INIT_ONCE *once, void *arg, void **out) { void (**init)(void) = (void (**)(void))arg; @@ -82,7 +82,7 @@ void CRYPTO_STATIC_MUTEX_unlock_write(struct CRYPTO_STATIC_MUTEX *lock) { ReleaseSRWLockExclusive(&lock->lock); } -static CRITICAL_SECTION g_destructors_lock; +static SRWLOCK g_destructors_lock = SRWLOCK_INIT; static thread_local_destructor_t g_destructors[NUM_OPENSSL_THREAD_LOCALS]; static CRYPTO_once_t g_thread_local_init_once = CRYPTO_ONCE_INIT; @@ -90,10 +90,6 @@ static DWORD g_thread_local_key; static int g_thread_local_failed; static void thread_local_init(void) { - if (!InitializeCriticalSectionAndSpinCount(&g_destructors_lock, 0x400)) { - g_thread_local_failed = 1; - return; - } g_thread_local_key = TlsAlloc(); g_thread_local_failed = (g_thread_local_key == TLS_OUT_OF_INDEXES); } @@ -121,12 +117,11 @@ static void NTAPI thread_local_destructor(PVOID module, DWORD reason, thread_local_destructor_t destructors[NUM_OPENSSL_THREAD_LOCALS]; - EnterCriticalSection(&g_destructors_lock); + AcquireSRWLockExclusive(&g_destructors_lock); OPENSSL_memcpy(destructors, g_destructors, sizeof(destructors)); - LeaveCriticalSection(&g_destructors_lock); + ReleaseSRWLockExclusive(&g_destructors_lock); - unsigned i; - for (i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { + for (unsigned i = 0; i < NUM_OPENSSL_THREAD_LOCALS; i++) { if (destructors[i] != NULL) { destructors[i](pointers[i]); } @@ -146,12 +141,18 @@ static void NTAPI thread_local_destructor(PVOID module, DWORD reason, // if it's not already there. (E.g. if __declspec(thread) is not used). Force // a reference to p_thread_callback_boringssl to prevent whole program // optimization from discarding the variable. +// +// Note, in the prefixed build, |p_thread_callback_boringssl| may be a macro. +#define STRINGIFY(x) #x +#define EXPAND_AND_STRINGIFY(x) STRINGIFY(x) #ifdef _WIN64 -#pragma comment(linker, "/INCLUDE:_tls_used") -#pragma comment(linker, "/INCLUDE:p_thread_callback_boringssl") +__pragma(comment(linker, "/INCLUDE:_tls_used")) +__pragma(comment( + linker, "/INCLUDE:" EXPAND_AND_STRINGIFY(p_thread_callback_boringssl))) #else -#pragma comment(linker, "/INCLUDE:__tls_used") -#pragma comment(linker, "/INCLUDE:_p_thread_callback_boringssl") +__pragma(comment(linker, "/INCLUDE:__tls_used")) +__pragma(comment( + linker, "/INCLUDE:_" EXPAND_AND_STRINGIFY(p_thread_callback_boringssl))) #endif // .CRT$XLA to .CRT$XLZ is an array of PIMAGE_TLS_CALLBACK pointers that are @@ -190,13 +191,31 @@ PIMAGE_TLS_CALLBACK p_thread_callback_boringssl = thread_local_destructor; #endif // _WIN64 +static void **get_thread_locals(void) { + // |TlsGetValue| clears the last error even on success, so that callers may + // distinguish it successfully returning NULL or failing. It is documented to + // never fail if the argument is a valid index from |TlsAlloc|, so we do not + // need to handle this. + // + // However, this error-mangling behavior interferes with the caller's use of + // |GetLastError|. In particular |SSL_get_error| queries the error queue to + // determine whether the caller should look at the OS's errors. To avoid + // destroying state, save and restore the Windows error. + // + // https://msdn.microsoft.com/en-us/library/windows/desktop/ms686812(v=vs.85).aspx + DWORD last_error = GetLastError(); + void **ret = TlsGetValue(g_thread_local_key); + SetLastError(last_error); + return ret; +} + void *CRYPTO_get_thread_local(thread_local_data_t index) { CRYPTO_once(&g_thread_local_init_once, thread_local_init); if (g_thread_local_failed) { return NULL; } - void **pointers = TlsGetValue(g_thread_local_key); + void **pointers = get_thread_locals(); if (pointers == NULL) { return NULL; } @@ -211,7 +230,7 @@ int CRYPTO_set_thread_local(thread_local_data_t index, void *value, return 0; } - void **pointers = TlsGetValue(g_thread_local_key); + void **pointers = get_thread_locals(); if (pointers == NULL) { pointers = OPENSSL_malloc(sizeof(void *) * NUM_OPENSSL_THREAD_LOCALS); if (pointers == NULL) { @@ -226,9 +245,9 @@ int CRYPTO_set_thread_local(thread_local_data_t index, void *value, } } - EnterCriticalSection(&g_destructors_lock); + AcquireSRWLockExclusive(&g_destructors_lock); g_destructors[index] = destructor; - LeaveCriticalSection(&g_destructors_lock); + ReleaseSRWLockExclusive(&g_destructors_lock); pointers[index] = value; return 1; diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_digest.c b/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/a_digest.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_digest.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/a_digest.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_digest.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_sign.c b/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/a_sign.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_sign.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/a_sign.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_sign.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_strex.c b/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509/a_strex.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c index 79c2fe919..1d89f39af 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/a_strex.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c @@ -178,18 +178,37 @@ static int do_buf(unsigned char *buf, int buflen, int type, unsigned char flags, char *quotes, char_io *io_ch, void *arg) { - int i, outlen, len; + int i, outlen, len, charwidth; unsigned char orflags, *p, *q; uint32_t c; p = buf; q = buf + buflen; outlen = 0; + charwidth = type & BUF_TYPE_WIDTH_MASK; + + switch (charwidth) { + case 4: + if (buflen & 3) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_UNIVERSALSTRING); + return -1; + } + break; + case 2: + if (buflen & 1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_BMPSTRING); + return -1; + } + break; + default: + break; + } + while (p != q) { if (p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; else orflags = 0; - switch (type & BUF_TYPE_WIDTH_MASK) { + switch (charwidth) { case 4: c = ((uint32_t)*p++) << 24; c |= ((uint32_t)*p++) << 16; @@ -210,6 +229,7 @@ static int do_buf(unsigned char *buf, int buflen, i = UTF8_getc(p, buflen, &c); if (i < 0) return -1; /* Invalid UTF8String */ + buflen -= i; p += i; break; default: diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_strex.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509/a_strex.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c.grpc_back index 465ad0867..6dc183acf 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/a_strex.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/a_strex.c.grpc_back @@ -178,18 +178,37 @@ static int do_buf(unsigned char *buf, int buflen, int type, unsigned char flags, char *quotes, char_io *io_ch, void *arg) { - int i, outlen, len; + int i, outlen, len, charwidth; unsigned char orflags, *p, *q; uint32_t c; p = buf; q = buf + buflen; outlen = 0; + charwidth = type & BUF_TYPE_WIDTH_MASK; + + switch (charwidth) { + case 4: + if (buflen & 3) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_UNIVERSALSTRING); + return -1; + } + break; + case 2: + if (buflen & 1) { + OPENSSL_PUT_ERROR(ASN1, ASN1_R_INVALID_BMPSTRING); + return -1; + } + break; + default: + break; + } + while (p != q) { if (p == buf && flags & ASN1_STRFLGS_ESC_2253) orflags = CHARTYPE_FIRST_ESC_2253; else orflags = 0; - switch (type & BUF_TYPE_WIDTH_MASK) { + switch (charwidth) { case 4: c = ((uint32_t)*p++) << 24; c |= ((uint32_t)*p++) << 16; @@ -210,6 +229,7 @@ static int do_buf(unsigned char *buf, int buflen, i = UTF8_getc(p, buflen, &c); if (i < 0) return -1; /* Invalid UTF8String */ + buflen -= i; p += i; break; default: diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_verify.c b/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/a_verify.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c index 96a275afd..f8e7a9982 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/a_verify.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c @@ -61,7 +61,6 @@ #include #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/x509/a_verify.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/a_verify.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c.grpc_back index 5b751675c..8587b5906 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/a_verify.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/a_verify.c.grpc_back @@ -61,7 +61,6 @@ #include #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/x509/algorithm.c b/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/algorithm.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/algorithm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/algorithm.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/algorithm.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/asn1_gen.c b/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/asn1_gen.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c index e0d9f536e..62b1a8e43 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/asn1_gen.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c @@ -65,6 +65,7 @@ #include #include "../internal.h" +#include "../x509v3/internal.h" /* * Although this file is in crypto/x509 for layering purposes, it emits @@ -769,7 +770,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) if (format == ASN1_GEN_FORMAT_HEX) { - if (!(rdata = string_to_hex((char *)str, &rdlen))) { + if (!(rdata = x509v3_hex_to_bytes((char *)str, &rdlen))) { OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_HEX); goto bad_str; } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/asn1_gen.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/asn1_gen.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c.grpc_back index 5b74cd1ee..98a6facd0 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/asn1_gen.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/asn1_gen.c.grpc_back @@ -65,6 +65,7 @@ #include #include "../internal.h" +#include "../x509v3/internal.h" /* * Although this file is in crypto/x509 for layering purposes, it emits @@ -769,7 +770,7 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype) if (format == ASN1_GEN_FORMAT_HEX) { - if (!(rdata = string_to_hex((char *)str, &rdlen))) { + if (!(rdata = x509v3_hex_to_bytes((char *)str, &rdlen))) { OPENSSL_PUT_ERROR(ASN1, ASN1_R_ILLEGAL_HEX); goto bad_str; } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/by_dir.c b/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/by_dir.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c index 42aac8d62..d2c04375b 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/by_dir.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c @@ -65,6 +65,8 @@ #include #include +#if !defined(OPENSSL_TRUSTY) + #include "../internal.h" typedef struct lookup_dir_hashes_st { @@ -234,7 +236,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) by_dir_entry_free(ent); return 0; } - BUF_strlcpy(ent->dir, ss, len + 1); + OPENSSL_strlcpy(ent->dir, ss, len + 1); if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { by_dir_entry_free(ent); return 0; @@ -387,6 +389,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, */ CRYPTO_MUTEX_lock_write(&xl->store_ctx->objs_lock); tmp = NULL; + sk_X509_OBJECT_sort(xl->store_ctx->objs); if (sk_X509_OBJECT_find(xl->store_ctx->objs, &idx, &stmp)) { tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, idx); } @@ -404,6 +407,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, */ if (!hent) { htmp.hash = h; + sk_BY_DIR_HASH_sort(ent->hashes); if (sk_BY_DIR_HASH_find(ent->hashes, &idx, &htmp)) hent = sk_BY_DIR_HASH_value(ent->hashes, idx); } @@ -422,6 +426,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, ok = 0; goto finish; } + sk_BY_DIR_HASH_sort(ent->hashes); } else if (hent->suffix < k) hent->suffix = k; @@ -449,3 +454,5 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, BUF_MEM_free(b); return (ok); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/x509/by_dir.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/by_dir.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c.grpc_back index 635b851f7..7b91cbd0a 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/by_dir.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/by_dir.c.grpc_back @@ -65,6 +65,8 @@ #include #include +#if !defined(OPENSSL_TRUSTY) + #include "../internal.h" typedef struct lookup_dir_hashes_st { @@ -234,7 +236,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) by_dir_entry_free(ent); return 0; } - BUF_strlcpy(ent->dir, ss, len + 1); + OPENSSL_strlcpy(ent->dir, ss, len + 1); if (!sk_BY_DIR_ENTRY_push(ctx->dirs, ent)) { by_dir_entry_free(ent); return 0; @@ -387,6 +389,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, */ CRYPTO_MUTEX_lock_write(&xl->store_ctx->objs_lock); tmp = NULL; + sk_X509_OBJECT_sort(xl->store_ctx->objs); if (sk_X509_OBJECT_find(xl->store_ctx->objs, &idx, &stmp)) { tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, idx); } @@ -404,6 +407,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, */ if (!hent) { htmp.hash = h; + sk_BY_DIR_HASH_sort(ent->hashes); if (sk_BY_DIR_HASH_find(ent->hashes, &idx, &htmp)) hent = sk_BY_DIR_HASH_value(ent->hashes, idx); } @@ -422,6 +426,7 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, ok = 0; goto finish; } + sk_BY_DIR_HASH_sort(ent->hashes); } else if (hent->suffix < k) hent->suffix = k; @@ -449,3 +454,5 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, BUF_MEM_free(b); return (ok); } + +#endif // OPENSSL_TRUSTY diff --git a/Pods/BoringSSL-GRPC/crypto/x509/by_file.c b/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/x509/by_file.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c index a83f15964..dd61302a4 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/by_file.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c @@ -57,7 +57,6 @@ #include -#include #include #include #include @@ -138,14 +137,15 @@ int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) for (;;) { x = PEM_read_bio_X509_AUX(in, NULL, NULL, NULL); if (x == NULL) { - if ((ERR_GET_REASON(ERR_peek_last_error()) == - PEM_R_NO_START_LINE) && (count > 0)) { + uint32_t error = ERR_peek_last_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE && + count > 0) { ERR_clear_error(); break; - } else { - OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); - goto err; } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; } i = X509_STORE_add_cert(ctx->store_ctx, x); if (!i) @@ -197,14 +197,15 @@ int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) for (;;) { x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); if (x == NULL) { - if ((ERR_GET_REASON(ERR_peek_last_error()) == - PEM_R_NO_START_LINE) && (count > 0)) { + uint32_t error = ERR_peek_last_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE && + count > 0) { ERR_clear_error(); break; - } else { - OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); - goto err; } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; } i = X509_STORE_add_crl(ctx->store_ctx, x); if (!i) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/by_file.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/x509/by_file.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c.grpc_back index 555cb8541..994beb9b1 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/by_file.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/by_file.c.grpc_back @@ -57,7 +57,6 @@ #include -#include #include #include #include @@ -138,14 +137,15 @@ int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type) for (;;) { x = PEM_read_bio_X509_AUX(in, NULL, NULL, NULL); if (x == NULL) { - if ((ERR_GET_REASON(ERR_peek_last_error()) == - PEM_R_NO_START_LINE) && (count > 0)) { + uint32_t error = ERR_peek_last_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE && + count > 0) { ERR_clear_error(); break; - } else { - OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); - goto err; } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; } i = X509_STORE_add_cert(ctx->store_ctx, x); if (!i) @@ -197,14 +197,15 @@ int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type) for (;;) { x = PEM_read_bio_X509_CRL(in, NULL, NULL, NULL); if (x == NULL) { - if ((ERR_GET_REASON(ERR_peek_last_error()) == - PEM_R_NO_START_LINE) && (count > 0)) { + uint32_t error = ERR_peek_last_error(); + if (ERR_GET_LIB(error) == ERR_LIB_PEM && + ERR_GET_REASON(error) == PEM_R_NO_START_LINE && + count > 0) { ERR_clear_error(); break; - } else { - OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); - goto err; } + OPENSSL_PUT_ERROR(X509, ERR_R_PEM_LIB); + goto err; } i = X509_STORE_add_crl(ctx->store_ctx, x); if (!i) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/charmap.h b/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/charmap.h rename to Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h diff --git a/Pods/BoringSSL-GRPC/crypto/x509/charmap.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/charmap.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/charmap.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/i2d_pr.c b/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/i2d_pr.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/i2d_pr.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/i2d_pr.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/i2d_pr.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/internal.h b/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/internal.h rename to Pods/BoringSSL-GRPC/src/crypto/x509/internal.h diff --git a/Pods/BoringSSL-GRPC/crypto/x509/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/rsa_pss.c b/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/rsa_pss.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/rsa_pss.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/rsa_pss.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/rsa_pss.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_crl.c b/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/x509/t_crl.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c index 305ef401f..5c03f8f78 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/t_crl.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c @@ -64,17 +64,14 @@ #ifndef OPENSSL_NO_FP_API int X509_CRL_print_fp(FILE *fp, X509_CRL *x) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = X509_CRL_print(b, x); + int ret = X509_CRL_print(b, x); BIO_free(b); - return (ret); + return ret; } #endif diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_crl.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/x509/t_crl.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c.grpc_back index 6c347cb84..dc9b87f8f 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/t_crl.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/t_crl.c.grpc_back @@ -64,17 +64,14 @@ #ifndef OPENSSL_NO_FP_API int X509_CRL_print_fp(FILE *fp, X509_CRL *x) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = X509_CRL_print(b, x); + int ret = X509_CRL_print(b, x); BIO_free(b); - return (ret); + return ret; } #endif diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_req.c b/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/t_req.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c index e17fca55d..0e3079477 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/t_req.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c @@ -65,13 +65,11 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x) { - BIO *bio = BIO_new(BIO_s_file()); + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); if (bio == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); return 0; } - - BIO_set_fp(bio, fp, BIO_NOCLOSE); int ret = X509_REQ_print(bio, x); BIO_free(bio); return ret; diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_req.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/t_req.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c.grpc_back index 39c836ccc..2fd36f8c3 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/t_req.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/t_req.c.grpc_back @@ -65,13 +65,11 @@ int X509_REQ_print_fp(FILE *fp, X509_REQ *x) { - BIO *bio = BIO_new(BIO_s_file()); + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); if (bio == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); return 0; } - - BIO_set_fp(bio, fp, BIO_NOCLOSE); int ret = X509_REQ_print(bio, x); BIO_free(bio); return ret; diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_x509.c b/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/t_x509.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c index cc99971d4..a7f2f81ab 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/t_x509.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c @@ -72,17 +72,14 @@ int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = X509_print_ex(b, x, nmflag, cflag); + int ret = X509_print_ex(b, x, nmflag, cflag); BIO_free(b); - return (ret); + return ret; } int X509_print_fp(FILE *fp, X509 *x) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_x509.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/t_x509.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c.grpc_back index 3339523c2..e45a76596 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/t_x509.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509.c.grpc_back @@ -72,17 +72,14 @@ int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag) { - BIO *b; - int ret; - - if ((b = BIO_new(BIO_s_file())) == NULL) { + BIO *b = BIO_new_fp(fp, BIO_NOCLOSE); + if (b == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_BUF_LIB); - return (0); + return 0; } - BIO_set_fp(b, fp, BIO_NOCLOSE); - ret = X509_print_ex(b, x, nmflag, cflag); + int ret = X509_print_ex(b, x, nmflag, cflag); BIO_free(b); - return (ret); + return ret; } int X509_print_fp(FILE *fp, X509 *x) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_x509a.c b/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/t_x509a.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/t_x509a.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/t_x509a.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/t_x509a.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/vpm_int.h b/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/vpm_int.h rename to Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h diff --git a/Pods/BoringSSL-GRPC/crypto/x509/vpm_int.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/vpm_int.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/vpm_int.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_att.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_att.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_att.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_att.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_att.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_cmp.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_cmp.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c index 81fb6fd9d..5d7c02ffa 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_cmp.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c @@ -58,7 +58,6 @@ #include #include -#include #include #include #include @@ -315,7 +314,7 @@ ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) return x->cert_info->key->public_key; } -int X509_check_private_key(X509 *x, EVP_PKEY *k) +int X509_check_private_key(X509 *x, const EVP_PKEY *k) { EVP_PKEY *xk; int ret; diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_cmp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_cmp.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c.grpc_back index 98236d9fe..28f2e95ed 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_cmp.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_cmp.c.grpc_back @@ -58,7 +58,6 @@ #include #include -#include #include #include #include @@ -315,7 +314,7 @@ ASN1_BIT_STRING *X509_get0_pubkey_bitstr(const X509 *x) return x->cert_info->key->public_key; } -int X509_check_private_key(X509 *x, EVP_PKEY *k) +int X509_check_private_key(X509 *x, const EVP_PKEY *k) { EVP_PKEY *xk; int ret; diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_d2.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_d2.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_d2.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_d2.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_d2.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_def.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_def.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c index 2737915b2..bcc741e76 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_def.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c @@ -60,7 +60,7 @@ /* TODO(fork): cleanup */ #if defined(OPENSSL_FUCHSIA) -#define OPENSSLDIR "/system/data/boringssl" +#define OPENSSLDIR "/config/ssl" #else #define OPENSSLDIR "/etc/ssl" #endif diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_def.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_def.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c.grpc_back index cb34ea4a9..d2bc3e5c1 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_def.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_def.c.grpc_back @@ -60,7 +60,7 @@ /* TODO(fork): cleanup */ #if defined(OPENSSL_FUCHSIA) -#define OPENSSLDIR "/system/data/boringssl" +#define OPENSSLDIR "/config/ssl" #else #define OPENSSLDIR "/etc/ssl" #endif diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_ext.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_ext.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_ext.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_ext.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_ext.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_lu.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_lu.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c index 285f8e3b4..6b1009784 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_lu.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c @@ -473,6 +473,7 @@ static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type, } size_t idx; + sk_X509_OBJECT_sort(h); if (!sk_X509_OBJECT_find(h, &idx, &stmp)) return -1; @@ -604,6 +605,7 @@ X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, size_t idx, i; X509_OBJECT *obj; + sk_X509_OBJECT_sort(h); if (!sk_X509_OBJECT_find(h, &idx, x)) { return NULL; } @@ -706,17 +708,124 @@ X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx) return ctx->param; } +void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify) +{ + ctx->verify = verify; +} + +X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx) +{ + return ctx->verify; +} + void X509_STORE_set_verify_cb(X509_STORE *ctx, - int (*verify_cb) (int, X509_STORE_CTX *)) + X509_STORE_CTX_verify_cb verify_cb) { ctx->verify_cb = verify_cb; } -void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx, - STACK_OF (X509_CRL) * - (*cb) (X509_STORE_CTX *ctx, X509_NAME *nm)) +X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(X509_STORE *ctx) +{ + return ctx->verify_cb; +} + +void X509_STORE_set_get_issuer(X509_STORE *ctx, + X509_STORE_CTX_get_issuer_fn get_issuer) +{ + ctx->get_issuer = get_issuer; +} + +X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(X509_STORE *ctx) +{ + return ctx->get_issuer; +} + +void X509_STORE_set_check_issued(X509_STORE *ctx, + X509_STORE_CTX_check_issued_fn check_issued) +{ + ctx->check_issued = check_issued; +} + +X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(X509_STORE *ctx) +{ + return ctx->check_issued; +} + +void X509_STORE_set_check_revocation(X509_STORE *ctx, + X509_STORE_CTX_check_revocation_fn check_revocation) +{ + ctx->check_revocation = check_revocation; +} + +X509_STORE_CTX_check_revocation_fn X509_STORE_get_check_revocation(X509_STORE *ctx) +{ + return ctx->check_revocation; +} + +void X509_STORE_set_get_crl(X509_STORE *ctx, + X509_STORE_CTX_get_crl_fn get_crl) +{ + ctx->get_crl = get_crl; +} + +X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(X509_STORE *ctx) +{ + return ctx->get_crl; +} + +void X509_STORE_set_check_crl(X509_STORE *ctx, + X509_STORE_CTX_check_crl_fn check_crl) +{ + ctx->check_crl = check_crl; +} + +X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(X509_STORE *ctx) +{ + return ctx->check_crl; +} + +void X509_STORE_set_cert_crl(X509_STORE *ctx, + X509_STORE_CTX_cert_crl_fn cert_crl) +{ + ctx->cert_crl = cert_crl; +} + +X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(X509_STORE *ctx) +{ + return ctx->cert_crl; +} + +void X509_STORE_set_lookup_certs(X509_STORE *ctx, + X509_STORE_CTX_lookup_certs_fn lookup_certs) +{ + ctx->lookup_certs = lookup_certs; +} + +X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(X509_STORE *ctx) +{ + return ctx->lookup_certs; +} + +void X509_STORE_set_lookup_crls(X509_STORE *ctx, + X509_STORE_CTX_lookup_crls_fn lookup_crls) +{ + ctx->lookup_crls = lookup_crls; +} + +X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(X509_STORE *ctx) +{ + return ctx->lookup_crls; +} + +void X509_STORE_set_cleanup(X509_STORE *ctx, + X509_STORE_CTX_cleanup_fn ctx_cleanup) +{ + ctx->cleanup = ctx_cleanup; +} + +X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(X509_STORE *ctx) { - ctx->lookup_crls = cb; + return ctx->cleanup; } X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_lu.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c.grpc_back similarity index 87% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_lu.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c.grpc_back index 1a841dbe6..4046c3ebf 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_lu.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_lu.c.grpc_back @@ -473,6 +473,7 @@ static int x509_object_idx_cnt(STACK_OF(X509_OBJECT) *h, int type, } size_t idx; + sk_X509_OBJECT_sort(h); if (!sk_X509_OBJECT_find(h, &idx, &stmp)) return -1; @@ -604,6 +605,7 @@ X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, size_t idx, i; X509_OBJECT *obj; + sk_X509_OBJECT_sort(h); if (!sk_X509_OBJECT_find(h, &idx, x)) { return NULL; } @@ -706,17 +708,124 @@ X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx) return ctx->param; } +void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify) +{ + ctx->verify = verify; +} + +X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx) +{ + return ctx->verify; +} + void X509_STORE_set_verify_cb(X509_STORE *ctx, - int (*verify_cb) (int, X509_STORE_CTX *)) + X509_STORE_CTX_verify_cb verify_cb) { ctx->verify_cb = verify_cb; } -void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx, - STACK_OF (X509_CRL) * - (*cb) (X509_STORE_CTX *ctx, X509_NAME *nm)) +X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(X509_STORE *ctx) +{ + return ctx->verify_cb; +} + +void X509_STORE_set_get_issuer(X509_STORE *ctx, + X509_STORE_CTX_get_issuer_fn get_issuer) +{ + ctx->get_issuer = get_issuer; +} + +X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(X509_STORE *ctx) +{ + return ctx->get_issuer; +} + +void X509_STORE_set_check_issued(X509_STORE *ctx, + X509_STORE_CTX_check_issued_fn check_issued) +{ + ctx->check_issued = check_issued; +} + +X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(X509_STORE *ctx) +{ + return ctx->check_issued; +} + +void X509_STORE_set_check_revocation(X509_STORE *ctx, + X509_STORE_CTX_check_revocation_fn check_revocation) +{ + ctx->check_revocation = check_revocation; +} + +X509_STORE_CTX_check_revocation_fn X509_STORE_get_check_revocation(X509_STORE *ctx) +{ + return ctx->check_revocation; +} + +void X509_STORE_set_get_crl(X509_STORE *ctx, + X509_STORE_CTX_get_crl_fn get_crl) +{ + ctx->get_crl = get_crl; +} + +X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(X509_STORE *ctx) +{ + return ctx->get_crl; +} + +void X509_STORE_set_check_crl(X509_STORE *ctx, + X509_STORE_CTX_check_crl_fn check_crl) +{ + ctx->check_crl = check_crl; +} + +X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(X509_STORE *ctx) +{ + return ctx->check_crl; +} + +void X509_STORE_set_cert_crl(X509_STORE *ctx, + X509_STORE_CTX_cert_crl_fn cert_crl) +{ + ctx->cert_crl = cert_crl; +} + +X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(X509_STORE *ctx) +{ + return ctx->cert_crl; +} + +void X509_STORE_set_lookup_certs(X509_STORE *ctx, + X509_STORE_CTX_lookup_certs_fn lookup_certs) +{ + ctx->lookup_certs = lookup_certs; +} + +X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(X509_STORE *ctx) +{ + return ctx->lookup_certs; +} + +void X509_STORE_set_lookup_crls(X509_STORE *ctx, + X509_STORE_CTX_lookup_crls_fn lookup_crls) +{ + ctx->lookup_crls = lookup_crls; +} + +X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(X509_STORE *ctx) +{ + return ctx->lookup_crls; +} + +void X509_STORE_set_cleanup(X509_STORE *ctx, + X509_STORE_CTX_cleanup_fn ctx_cleanup) +{ + ctx->cleanup = ctx_cleanup; +} + +X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(X509_STORE *ctx) { - ctx->lookup_crls = cb; + return ctx->cleanup; } X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_obj.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_obj.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c index 8184ce4b8..5721779e8 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_obj.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c @@ -101,7 +101,7 @@ char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) buf = b->data; OPENSSL_free(b); } - BUF_strlcpy(buf, "NO X509_NAME", len); + OPENSSL_strlcpy(buf, "NO X509_NAME", len); return buf; } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_obj.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_obj.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c.grpc_back index 65b1bfb50..520b7a079 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_obj.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_obj.c.grpc_back @@ -101,7 +101,7 @@ char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) buf = b->data; OPENSSL_free(b); } - BUF_strlcpy(buf, "NO X509_NAME", len); + OPENSSL_strlcpy(buf, "NO X509_NAME", len); return buf; } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_r2x.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_r2x.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c index a1d1d7946..24bf53a0d 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_r2x.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c @@ -56,7 +56,6 @@ #include #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_r2x.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_r2x.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c.grpc_back index 9bdf441f2..723bd4955 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_r2x.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_r2x.c.grpc_back @@ -56,7 +56,6 @@ #include #include -#include #include #include #include diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_req.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_req.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c index 6752b7f10..4478c3ca7 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_req.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -320,3 +319,23 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req, return 1; return 0; } + +void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = req->signature; + if (palg != NULL) + *palg = req->sig_alg; +} + +int X509_REQ_get_signature_nid(const X509_REQ *req) +{ + return OBJ_obj2nid(req->sig_alg->algorithm); +} + +int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp) +{ + req->req_info->enc.modified = 1; + return i2d_X509_REQ_INFO(req->req_info, pp); +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_req.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c.grpc_back similarity index 95% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_req.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c.grpc_back index 69bc6f114..d918b0970 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_req.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_req.c.grpc_back @@ -58,7 +58,6 @@ #include #include #include -#include #include #include #include @@ -320,3 +319,23 @@ int X509_REQ_add1_attr_by_txt(X509_REQ *req, return 1; return 0; } + +void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = req->signature; + if (palg != NULL) + *palg = req->sig_alg; +} + +int X509_REQ_get_signature_nid(const X509_REQ *req) +{ + return OBJ_obj2nid(req->sig_alg->algorithm); +} + +int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp) +{ + req->req_info->enc.modified = 1; + return i2d_X509_REQ_INFO(req->req_info, pp); +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_set.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_set.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c index 7200e5e0c..7c8ba9967 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_set.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c @@ -162,3 +162,8 @@ STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x) { return x->cert_info->extensions; } + +const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x) +{ + return x->cert_info->signature; +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_set.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_set.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c.grpc_back index 413a20d05..0aa92bd88 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_set.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_set.c.grpc_back @@ -162,3 +162,8 @@ STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x) { return x->cert_info->extensions; } + +const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x) +{ + return x->cert_info->signature; +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_trs.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_trs.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c index 4530d0944..f95d898fa 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_trs.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c @@ -54,7 +54,6 @@ * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). */ -#include #include #include #include @@ -158,6 +157,7 @@ int X509_TRUST_get_by_id(int id) tmp.trust = id; if (!trtable) return -1; + sk_X509_TRUST_sort(trtable); if (!sk_X509_TRUST_find(trtable, &idx, &tmp)) { return -1; } @@ -200,7 +200,7 @@ int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int), trtmp = X509_TRUST_get0(idx); /* Duplicate the supplied name. */ - name_dup = BUF_strdup(name); + name_dup = OPENSSL_strdup(name); if (name_dup == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); if (idx == -1) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_trs.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_trs.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c.grpc_back index c7dfcad60..18ac8839e 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_trs.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_trs.c.grpc_back @@ -54,7 +54,6 @@ * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). */ -#include #include #include #include @@ -158,6 +157,7 @@ int X509_TRUST_get_by_id(int id) tmp.trust = id; if (!trtable) return -1; + sk_X509_TRUST_sort(trtable); if (!sk_X509_TRUST_find(trtable, &idx, &tmp)) { return -1; } @@ -200,7 +200,7 @@ int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int), trtmp = X509_TRUST_get0(idx); /* Duplicate the supplied name. */ - name_dup = BUF_strdup(name); + name_dup = OPENSSL_strdup(name); if (name_dup == NULL) { OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE); if (idx == -1) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_txt.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_txt.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c index 87dc3469b..9a2eca8f9 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_txt.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c @@ -54,13 +54,10 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#include #include const char *X509_verify_cert_error_string(long n) { - static char buf[100]; - switch ((int)n) { case X509_V_OK: return ("ok"); @@ -198,8 +195,10 @@ const char *X509_verify_cert_error_string(long n) case X509_V_ERR_STORE_LOOKUP: return ("Issuer certificate lookup error"); + case X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS: + return "Issuer has name constraints but leaf has no SANs"; + default: - BIO_snprintf(buf, sizeof buf, "error number %ld", n); - return (buf); + return "unknown certificate verification error"; } } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_txt.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_txt.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c.grpc_back index 753e72027..8e6ac27d4 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_txt.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_txt.c.grpc_back @@ -54,13 +54,10 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ -#include #include const char *X509_verify_cert_error_string(long n) { - static char buf[100]; - switch ((int)n) { case X509_V_OK: return ("ok"); @@ -198,8 +195,10 @@ const char *X509_verify_cert_error_string(long n) case X509_V_ERR_STORE_LOOKUP: return ("Issuer certificate lookup error"); + case X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS: + return "Issuer has name constraints but leaf has no SANs"; + default: - BIO_snprintf(buf, sizeof buf, "error number %ld", n); - return (buf); + return "unknown certificate verification error"; } } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_v3.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_v3.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_v3.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_v3.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_v3.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_vfy.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_vfy.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c index 41fb6c821..3267f1213 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_vfy.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c @@ -54,11 +54,11 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ +#include #include #include #include -#include #include #include #include @@ -69,6 +69,7 @@ #include "vpm_int.h" #include "../internal.h" +#include "../x509v3/internal.h" static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; @@ -578,7 +579,7 @@ static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) static int check_chain_extensions(X509_STORE_CTX *ctx) { - int i, ok = 0, must_be_ca, plen = 0; + int i, ok = 0, plen = 0; X509 *x; int (*cb) (int xok, X509_STORE_CTX *xctx); int proxy_path_length = 0; @@ -586,15 +587,13 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) int allow_proxy_certs; cb = ctx->verify_cb; - /* - * must_be_ca can have 1 of 3 values: -1: we accept both CA and non-CA - * certificates, to allow direct use of self-signed certificates (which - * are marked as CA). 0: we only accept non-CA certificates. This is - * currently not used, but the possibility is present for future - * extensions. 1: we only accept CA certificates. This is currently used - * for all certificates in the chain except the leaf certificate. - */ - must_be_ca = -1; + enum { + // ca_or_leaf allows either type of certificate so that direct use of + // self-signed certificates works. + ca_or_leaf, + must_be_ca, + must_not_be_ca, + } ca_requirement; /* CRL path validation */ if (ctx->parent) { @@ -606,6 +605,8 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) purpose = ctx->param->purpose; } + ca_requirement = ca_or_leaf; + /* Check all untrusted certificates */ for (i = 0; i < ctx->last_untrusted; i++) { int ret; @@ -627,33 +628,30 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) if (!ok) goto end; } - ret = X509_check_ca(x); - switch (must_be_ca) { - case -1: - if ((ctx->param->flags & X509_V_FLAG_X509_STRICT) - && (ret != 1) && (ret != 0)) { - ret = 0; - ctx->error = X509_V_ERR_INVALID_CA; - } else - ret = 1; + + switch (ca_requirement) { + case ca_or_leaf: + ret = 1; break; - case 0: - if (ret != 0) { + case must_not_be_ca: + if (X509_check_ca(x)) { ret = 0; ctx->error = X509_V_ERR_INVALID_NON_CA; } else ret = 1; break; - default: - if ((ret == 0) - || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) - && (ret != 1))) { + case must_be_ca: + if (!X509_check_ca(x)) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; + default: + // impossible. + ret = 0; } + if (ret == 0) { ctx->error_depth = i; ctx->current_cert = x; @@ -662,10 +660,9 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) goto end; } if (ctx->param->purpose > 0) { - ret = X509_check_purpose(x, purpose, must_be_ca > 0); - if ((ret == 0) - || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) - && (ret != 1))) { + ret = X509_check_purpose(x, purpose, ca_requirement == must_be_ca); + if (ret != 1) { + ret = 0; ctx->error = X509_V_ERR_INVALID_PURPOSE; ctx->error_depth = i; ctx->current_cert = x; @@ -703,22 +700,50 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) goto end; } proxy_path_length++; - must_be_ca = 0; - } else - must_be_ca = 1; + ca_requirement = must_not_be_ca; + } else { + ca_requirement = must_be_ca; + } } ok = 1; end: return ok; } +static int reject_dns_name_in_common_name(X509 *x509) +{ + X509_NAME *name = X509_get_subject_name(x509); + int i = -1; + for (;;) { + i = X509_NAME_get_index_by_NID(name, NID_commonName, i); + if (i == -1) { + return X509_V_OK; + } + + X509_NAME_ENTRY *entry = X509_NAME_get_entry(name, i); + ASN1_STRING *common_name = X509_NAME_ENTRY_get_data(entry); + unsigned char *idval; + int idlen = ASN1_STRING_to_UTF8(&idval, common_name); + if (idlen < 0) { + return X509_V_ERR_OUT_OF_MEM; + } + /* Only process attributes that look like host names. Note it is + * important that this check be mirrored in |X509_check_host|. */ + int looks_like_dns = x509v3_looks_like_dns_name(idval, (size_t)idlen); + OPENSSL_free(idval); + if (looks_like_dns) { + return X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS; + } + } +} + static int check_name_constraints(X509_STORE_CTX *ctx) { - X509 *x; int i, j, rv; + int has_name_constraints = 0; /* Check name constraints for all certificates */ for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { - x = sk_X509_value(ctx->chain, i); + X509 *x = sk_X509_value(ctx->chain, i); /* Ignore self issued certs unless last in chain */ if (i && (x->ex_flags & EXFLAG_SI)) continue; @@ -731,6 +756,7 @@ static int check_name_constraints(X509_STORE_CTX *ctx) for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; if (nc) { + has_name_constraints = 1; rv = NAME_CONSTRAINTS_check(x, nc); switch (rv) { case X509_V_OK: @@ -749,6 +775,36 @@ static int check_name_constraints(X509_STORE_CTX *ctx) } } } + + /* Name constraints do not match against the common name, but + * |X509_check_host| still implements the legacy behavior where, on + * certificates lacking a SAN list, DNS-like names in the common name are + * checked instead. + * + * While we could apply the name constraints to the common name, name + * constraints are rare enough that can hold such certificates to a higher + * standard. Note this does not make "DNS-like" heuristic failures any + * worse. A decorative common-name misidentified as a DNS name would fail + * the name constraint anyway. */ + X509 *leaf = sk_X509_value(ctx->chain, 0); + if (has_name_constraints && leaf->altname == NULL) { + rv = reject_dns_name_in_common_name(leaf); + switch (rv) { + case X509_V_OK: + break; + case X509_V_ERR_OUT_OF_MEM: + ctx->error = rv; + return 0; + default: + ctx->error = rv; + ctx->error_depth = i; + ctx->current_cert = leaf; + if (!ctx->verify_cb(0, ctx)) + return 0; + break; + } + } + return 1; } @@ -1839,122 +1895,67 @@ int X509_cmp_current_time(const ASN1_TIME *ctm) int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) { - char *str; - ASN1_TIME atm; - long offset; - char buff1[24], buff2[24], *p; - int i, j, remaining; + static const size_t utctime_length = sizeof("YYMMDDHHMMSSZ") - 1; + static const size_t generalizedtime_length = sizeof("YYYYMMDDHHMMSSZ") - 1; + ASN1_TIME *asn1_cmp_time = NULL; + int i, day, sec, ret = 0; - p = buff1; - remaining = ctm->length; - str = (char *)ctm->data; /* - * Note that the following (historical) code allows much more slack in - * the time format than RFC5280. In RFC5280, the representation is fixed: - * UTCTime: YYMMDDHHMMSSZ GeneralizedTime: YYYYMMDDHHMMSSZ + * Note that ASN.1 allows much more slack in the time format than RFC5280. + * In RFC5280, the representation is fixed: + * UTCTime: YYMMDDHHMMSSZ + * GeneralizedTime: YYYYMMDDHHMMSSZ + * + * We do NOT currently enforce the following RFC 5280 requirement: + * "CAs conforming to this profile MUST always encode certificate + * validity dates through the year 2049 as UTCTime; certificate validity + * dates in 2050 or later MUST be encoded as GeneralizedTime." */ - if (ctm->type == V_ASN1_UTCTIME) { - /* YYMMDDHHMM[SS]Z or YYMMDDHHMM[SS](+-)hhmm */ - int min_length = sizeof("YYMMDDHHMMZ") - 1; - int max_length = sizeof("YYMMDDHHMMSS+hhmm") - 1; - if (remaining < min_length || remaining > max_length) + switch (ctm->type) { + case V_ASN1_UTCTIME: + if (ctm->length != (int)(utctime_length)) return 0; - OPENSSL_memcpy(p, str, 10); - p += 10; - str += 10; - remaining -= 10; - } else { - /* - * YYYYMMDDHHMM[SS[.fff]]Z or YYYYMMDDHHMM[SS[.f[f[f]]]](+-)hhmm - */ - int min_length = sizeof("YYYYMMDDHHMMZ") - 1; - int max_length = sizeof("YYYYMMDDHHMMSS.fff+hhmm") - 1; - if (remaining < min_length || remaining > max_length) + break; + case V_ASN1_GENERALIZEDTIME: + if (ctm->length != (int)(generalizedtime_length)) return 0; - OPENSSL_memcpy(p, str, 12); - p += 12; - str += 12; - remaining -= 12; + break; + default: + return 0; } - if ((*str == 'Z') || (*str == '-') || (*str == '+')) { - *(p++) = '0'; - *(p++) = '0'; - } else { - /* SS (seconds) */ - if (remaining < 2) + /** + * Verify the format: the ASN.1 functions we use below allow a more + * flexible format than what's mandated by RFC 5280. + * Digit and date ranges will be verified in the conversion methods. + */ + for (i = 0; i < ctm->length - 1; i++) { + if (!isdigit(ctm->data[i])) return 0; - *(p++) = *(str++); - *(p++) = *(str++); - remaining -= 2; - /* - * Skip any (up to three) fractional seconds... TODO(emilia): in - * RFC5280, fractional seconds are forbidden. Can we just kill them - * altogether? - */ - if (remaining && *str == '.') { - str++; - remaining--; - for (i = 0; i < 3 && remaining; i++, str++, remaining--) { - if (*str < '0' || *str > '9') - break; - } - } - } - *(p++) = 'Z'; - *(p++) = '\0'; - - /* We now need either a terminating 'Z' or an offset. */ - if (!remaining) + if (ctm->data[ctm->length - 1] != 'Z') return 0; - if (*str == 'Z') { - if (remaining != 1) - return 0; - offset = 0; - } else { - /* (+-)HHMM */ - if ((*str != '+') && (*str != '-')) - return 0; - /* - * Historical behaviour: the (+-)hhmm offset is forbidden in RFC5280. - */ - if (remaining != 5) - return 0; - if (str[1] < '0' || str[1] > '9' || str[2] < '0' || str[2] > '9' || - str[3] < '0' || str[3] > '9' || str[4] < '0' || str[4] > '9') - return 0; - offset = ((str[1] - '0') * 10 + (str[2] - '0')) * 60; - offset += (str[3] - '0') * 10 + (str[4] - '0'); - if (*str == '-') - offset = -offset; - } - atm.type = ctm->type; - atm.flags = 0; - atm.length = sizeof(buff2); - atm.data = (unsigned char *)buff2; - if (X509_time_adj(&atm, offset * 60, cmp_time) == NULL) - return 0; + /* + * There is ASN1_UTCTIME_cmp_time_t but no + * ASN1_GENERALIZEDTIME_cmp_time_t or ASN1_TIME_cmp_time_t, + * so we go through ASN.1 + */ + asn1_cmp_time = X509_time_adj(NULL, 0, cmp_time); + if (asn1_cmp_time == NULL) + goto err; + if (!ASN1_TIME_diff(&day, &sec, ctm, asn1_cmp_time)) + goto err; - if (ctm->type == V_ASN1_UTCTIME) { - i = (buff1[0] - '0') * 10 + (buff1[1] - '0'); - if (i < 50) - i += 100; /* cf. RFC 2459 */ - j = (buff2[0] - '0') * 10 + (buff2[1] - '0'); - if (j < 50) - j += 100; - - if (i < j) - return -1; - if (i > j) - return 1; - } - i = strcmp(buff1, buff2); - if (i == 0) /* wait a second then return younger :-) */ - return -1; - else - return i; + /* + * X509_cmp_time comparison is <=. + * The return value 0 is reserved for errors. + */ + ret = (day >= 0 && sec >= 0) ? -1 : 1; + + err: + ASN1_TIME_free(asn1_cmp_time); + return ret; } ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj) @@ -2434,6 +2435,11 @@ void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, X509_VERIFY_PARAM_set_time(ctx->param, t); } +X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx) +{ + return ctx->cert; +} + void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, int (*verify_cb) (int, X509_STORE_CTX *)) { diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_vfy.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_vfy.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c.grpc_back index 2b754f08e..23bbeb512 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_vfy.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vfy.c.grpc_back @@ -54,11 +54,11 @@ * copied and put under another distribution licence * [including the GNU Public Licence.] */ +#include #include #include #include -#include #include #include #include @@ -69,6 +69,7 @@ #include "vpm_int.h" #include "../internal.h" +#include "../x509v3/internal.h" static CRYPTO_EX_DATA_CLASS g_ex_data_class = CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; @@ -578,7 +579,7 @@ static int get_issuer_sk(X509 **issuer, X509_STORE_CTX *ctx, X509 *x) static int check_chain_extensions(X509_STORE_CTX *ctx) { - int i, ok = 0, must_be_ca, plen = 0; + int i, ok = 0, plen = 0; X509 *x; int (*cb) (int xok, X509_STORE_CTX *xctx); int proxy_path_length = 0; @@ -586,15 +587,13 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) int allow_proxy_certs; cb = ctx->verify_cb; - /* - * must_be_ca can have 1 of 3 values: -1: we accept both CA and non-CA - * certificates, to allow direct use of self-signed certificates (which - * are marked as CA). 0: we only accept non-CA certificates. This is - * currently not used, but the possibility is present for future - * extensions. 1: we only accept CA certificates. This is currently used - * for all certificates in the chain except the leaf certificate. - */ - must_be_ca = -1; + enum { + // ca_or_leaf allows either type of certificate so that direct use of + // self-signed certificates works. + ca_or_leaf, + must_be_ca, + must_not_be_ca, + } ca_requirement; /* CRL path validation */ if (ctx->parent) { @@ -606,6 +605,8 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) purpose = ctx->param->purpose; } + ca_requirement = ca_or_leaf; + /* Check all untrusted certificates */ for (i = 0; i < ctx->last_untrusted; i++) { int ret; @@ -627,33 +628,30 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) if (!ok) goto end; } - ret = X509_check_ca(x); - switch (must_be_ca) { - case -1: - if ((ctx->param->flags & X509_V_FLAG_X509_STRICT) - && (ret != 1) && (ret != 0)) { - ret = 0; - ctx->error = X509_V_ERR_INVALID_CA; - } else - ret = 1; + + switch (ca_requirement) { + case ca_or_leaf: + ret = 1; break; - case 0: - if (ret != 0) { + case must_not_be_ca: + if (X509_check_ca(x)) { ret = 0; ctx->error = X509_V_ERR_INVALID_NON_CA; } else ret = 1; break; - default: - if ((ret == 0) - || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) - && (ret != 1))) { + case must_be_ca: + if (!X509_check_ca(x)) { ret = 0; ctx->error = X509_V_ERR_INVALID_CA; } else ret = 1; break; + default: + // impossible. + ret = 0; } + if (ret == 0) { ctx->error_depth = i; ctx->current_cert = x; @@ -662,10 +660,9 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) goto end; } if (ctx->param->purpose > 0) { - ret = X509_check_purpose(x, purpose, must_be_ca > 0); - if ((ret == 0) - || ((ctx->param->flags & X509_V_FLAG_X509_STRICT) - && (ret != 1))) { + ret = X509_check_purpose(x, purpose, ca_requirement == must_be_ca); + if (ret != 1) { + ret = 0; ctx->error = X509_V_ERR_INVALID_PURPOSE; ctx->error_depth = i; ctx->current_cert = x; @@ -703,22 +700,50 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) goto end; } proxy_path_length++; - must_be_ca = 0; - } else - must_be_ca = 1; + ca_requirement = must_not_be_ca; + } else { + ca_requirement = must_be_ca; + } } ok = 1; end: return ok; } +static int reject_dns_name_in_common_name(X509 *x509) +{ + X509_NAME *name = X509_get_subject_name(x509); + int i = -1; + for (;;) { + i = X509_NAME_get_index_by_NID(name, NID_commonName, i); + if (i == -1) { + return X509_V_OK; + } + + X509_NAME_ENTRY *entry = X509_NAME_get_entry(name, i); + ASN1_STRING *common_name = X509_NAME_ENTRY_get_data(entry); + unsigned char *idval; + int idlen = ASN1_STRING_to_UTF8(&idval, common_name); + if (idlen < 0) { + return X509_V_ERR_OUT_OF_MEM; + } + /* Only process attributes that look like host names. Note it is + * important that this check be mirrored in |X509_check_host|. */ + int looks_like_dns = x509v3_looks_like_dns_name(idval, (size_t)idlen); + OPENSSL_free(idval); + if (looks_like_dns) { + return X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS; + } + } +} + static int check_name_constraints(X509_STORE_CTX *ctx) { - X509 *x; int i, j, rv; + int has_name_constraints = 0; /* Check name constraints for all certificates */ for (i = sk_X509_num(ctx->chain) - 1; i >= 0; i--) { - x = sk_X509_value(ctx->chain, i); + X509 *x = sk_X509_value(ctx->chain, i); /* Ignore self issued certs unless last in chain */ if (i && (x->ex_flags & EXFLAG_SI)) continue; @@ -731,6 +756,7 @@ static int check_name_constraints(X509_STORE_CTX *ctx) for (j = sk_X509_num(ctx->chain) - 1; j > i; j--) { NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; if (nc) { + has_name_constraints = 1; rv = NAME_CONSTRAINTS_check(x, nc); switch (rv) { case X509_V_OK: @@ -749,6 +775,36 @@ static int check_name_constraints(X509_STORE_CTX *ctx) } } } + + /* Name constraints do not match against the common name, but + * |X509_check_host| still implements the legacy behavior where, on + * certificates lacking a SAN list, DNS-like names in the common name are + * checked instead. + * + * While we could apply the name constraints to the common name, name + * constraints are rare enough that can hold such certificates to a higher + * standard. Note this does not make "DNS-like" heuristic failures any + * worse. A decorative common-name misidentified as a DNS name would fail + * the name constraint anyway. */ + X509 *leaf = sk_X509_value(ctx->chain, 0); + if (has_name_constraints && leaf->altname == NULL) { + rv = reject_dns_name_in_common_name(leaf); + switch (rv) { + case X509_V_OK: + break; + case X509_V_ERR_OUT_OF_MEM: + ctx->error = rv; + return 0; + default: + ctx->error = rv; + ctx->error_depth = i; + ctx->current_cert = leaf; + if (!ctx->verify_cb(0, ctx)) + return 0; + break; + } + } + return 1; } @@ -1839,122 +1895,67 @@ int X509_cmp_current_time(const ASN1_TIME *ctm) int X509_cmp_time(const ASN1_TIME *ctm, time_t *cmp_time) { - char *str; - ASN1_TIME atm; - long offset; - char buff1[24], buff2[24], *p; - int i, j, remaining; + static const size_t utctime_length = sizeof("YYMMDDHHMMSSZ") - 1; + static const size_t generalizedtime_length = sizeof("YYYYMMDDHHMMSSZ") - 1; + ASN1_TIME *asn1_cmp_time = NULL; + int i, day, sec, ret = 0; - p = buff1; - remaining = ctm->length; - str = (char *)ctm->data; /* - * Note that the following (historical) code allows much more slack in - * the time format than RFC5280. In RFC5280, the representation is fixed: - * UTCTime: YYMMDDHHMMSSZ GeneralizedTime: YYYYMMDDHHMMSSZ + * Note that ASN.1 allows much more slack in the time format than RFC5280. + * In RFC5280, the representation is fixed: + * UTCTime: YYMMDDHHMMSSZ + * GeneralizedTime: YYYYMMDDHHMMSSZ + * + * We do NOT currently enforce the following RFC 5280 requirement: + * "CAs conforming to this profile MUST always encode certificate + * validity dates through the year 2049 as UTCTime; certificate validity + * dates in 2050 or later MUST be encoded as GeneralizedTime." */ - if (ctm->type == V_ASN1_UTCTIME) { - /* YYMMDDHHMM[SS]Z or YYMMDDHHMM[SS](+-)hhmm */ - int min_length = sizeof("YYMMDDHHMMZ") - 1; - int max_length = sizeof("YYMMDDHHMMSS+hhmm") - 1; - if (remaining < min_length || remaining > max_length) + switch (ctm->type) { + case V_ASN1_UTCTIME: + if (ctm->length != (int)(utctime_length)) return 0; - OPENSSL_memcpy(p, str, 10); - p += 10; - str += 10; - remaining -= 10; - } else { - /* - * YYYYMMDDHHMM[SS[.fff]]Z or YYYYMMDDHHMM[SS[.f[f[f]]]](+-)hhmm - */ - int min_length = sizeof("YYYYMMDDHHMMZ") - 1; - int max_length = sizeof("YYYYMMDDHHMMSS.fff+hhmm") - 1; - if (remaining < min_length || remaining > max_length) + break; + case V_ASN1_GENERALIZEDTIME: + if (ctm->length != (int)(generalizedtime_length)) return 0; - OPENSSL_memcpy(p, str, 12); - p += 12; - str += 12; - remaining -= 12; + break; + default: + return 0; } - if ((*str == 'Z') || (*str == '-') || (*str == '+')) { - *(p++) = '0'; - *(p++) = '0'; - } else { - /* SS (seconds) */ - if (remaining < 2) + /** + * Verify the format: the ASN.1 functions we use below allow a more + * flexible format than what's mandated by RFC 5280. + * Digit and date ranges will be verified in the conversion methods. + */ + for (i = 0; i < ctm->length - 1; i++) { + if (!isdigit(ctm->data[i])) return 0; - *(p++) = *(str++); - *(p++) = *(str++); - remaining -= 2; - /* - * Skip any (up to three) fractional seconds... TODO(emilia): in - * RFC5280, fractional seconds are forbidden. Can we just kill them - * altogether? - */ - if (remaining && *str == '.') { - str++; - remaining--; - for (i = 0; i < 3 && remaining; i++, str++, remaining--) { - if (*str < '0' || *str > '9') - break; - } - } - } - *(p++) = 'Z'; - *(p++) = '\0'; - - /* We now need either a terminating 'Z' or an offset. */ - if (!remaining) + if (ctm->data[ctm->length - 1] != 'Z') return 0; - if (*str == 'Z') { - if (remaining != 1) - return 0; - offset = 0; - } else { - /* (+-)HHMM */ - if ((*str != '+') && (*str != '-')) - return 0; - /* - * Historical behaviour: the (+-)hhmm offset is forbidden in RFC5280. - */ - if (remaining != 5) - return 0; - if (str[1] < '0' || str[1] > '9' || str[2] < '0' || str[2] > '9' || - str[3] < '0' || str[3] > '9' || str[4] < '0' || str[4] > '9') - return 0; - offset = ((str[1] - '0') * 10 + (str[2] - '0')) * 60; - offset += (str[3] - '0') * 10 + (str[4] - '0'); - if (*str == '-') - offset = -offset; - } - atm.type = ctm->type; - atm.flags = 0; - atm.length = sizeof(buff2); - atm.data = (unsigned char *)buff2; - if (X509_time_adj(&atm, offset * 60, cmp_time) == NULL) - return 0; + /* + * There is ASN1_UTCTIME_cmp_time_t but no + * ASN1_GENERALIZEDTIME_cmp_time_t or ASN1_TIME_cmp_time_t, + * so we go through ASN.1 + */ + asn1_cmp_time = X509_time_adj(NULL, 0, cmp_time); + if (asn1_cmp_time == NULL) + goto err; + if (!ASN1_TIME_diff(&day, &sec, ctm, asn1_cmp_time)) + goto err; - if (ctm->type == V_ASN1_UTCTIME) { - i = (buff1[0] - '0') * 10 + (buff1[1] - '0'); - if (i < 50) - i += 100; /* cf. RFC 2459 */ - j = (buff2[0] - '0') * 10 + (buff2[1] - '0'); - if (j < 50) - j += 100; - - if (i < j) - return -1; - if (i > j) - return 1; - } - i = strcmp(buff1, buff2); - if (i == 0) /* wait a second then return younger :-) */ - return -1; - else - return i; + /* + * X509_cmp_time comparison is <=. + * The return value 0 is reserved for errors. + */ + ret = (day >= 0 && sec >= 0) ? -1 : 1; + + err: + ASN1_TIME_free(asn1_cmp_time); + return ret; } ASN1_TIME *X509_gmtime_adj(ASN1_TIME *s, long adj) @@ -2434,6 +2435,11 @@ void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, X509_VERIFY_PARAM_set_time(ctx->param, t); } +X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx) +{ + return ctx->cert; +} + void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, int (*verify_cb) (int, X509_STORE_CTX *)) { diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_vpm.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_vpm.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c index f4b3a7c20..41135622d 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_vpm.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c @@ -56,7 +56,6 @@ #include -#include #include #include #include @@ -106,7 +105,7 @@ static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, id->hosts = NULL; } - copy = BUF_strndup(name, namelen); + copy = OPENSSL_strndup(name, namelen); if (copy == NULL) return 0; @@ -345,7 +344,7 @@ static int int_x509_param_set1(char **pdest, size_t *pdestlen, return 0; } - tmp = BUF_memdup(src, srclen); + tmp = OPENSSL_memdup(src, srclen); if (!tmp) { return 0; } @@ -362,7 +361,7 @@ int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) { if (param->name) OPENSSL_free(param->name); - param->name = BUF_strdup(name); + param->name = OPENSSL_strdup(name); if (param->name) return 1; return 0; @@ -614,6 +613,7 @@ int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param) } else { size_t idx; + sk_X509_VERIFY_PARAM_sort(param_table); if (sk_X509_VERIFY_PARAM_find(param_table, &idx, param)) { ptmp = sk_X509_VERIFY_PARAM_value(param_table, idx); X509_VERIFY_PARAM_free(ptmp); @@ -649,6 +649,7 @@ const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name) pm.name = (char *)name; if (param_table) { size_t idx; + sk_X509_VERIFY_PARAM_sort(param_table); if (sk_X509_VERIFY_PARAM_find(param_table, &idx, &pm)) return sk_X509_VERIFY_PARAM_value(param_table, idx); } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509_vpm.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x509_vpm.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c.grpc_back index 43353c6b2..d8d1efe88 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509_vpm.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509_vpm.c.grpc_back @@ -56,7 +56,6 @@ #include -#include #include #include #include @@ -106,7 +105,7 @@ static int int_x509_param_set_hosts(X509_VERIFY_PARAM_ID *id, int mode, id->hosts = NULL; } - copy = BUF_strndup(name, namelen); + copy = OPENSSL_strndup(name, namelen); if (copy == NULL) return 0; @@ -345,7 +344,7 @@ static int int_x509_param_set1(char **pdest, size_t *pdestlen, return 0; } - tmp = BUF_memdup(src, srclen); + tmp = OPENSSL_memdup(src, srclen); if (!tmp) { return 0; } @@ -362,7 +361,7 @@ int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name) { if (param->name) OPENSSL_free(param->name); - param->name = BUF_strdup(name); + param->name = OPENSSL_strdup(name); if (param->name) return 1; return 0; @@ -614,6 +613,7 @@ int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param) } else { size_t idx; + sk_X509_VERIFY_PARAM_sort(param_table); if (sk_X509_VERIFY_PARAM_find(param_table, &idx, param)) { ptmp = sk_X509_VERIFY_PARAM_value(param_table, idx); X509_VERIFY_PARAM_free(ptmp); @@ -649,6 +649,7 @@ const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name) pm.name = (char *)name; if (param_table) { size_t idx; + sk_X509_VERIFY_PARAM_sort(param_table); if (sk_X509_VERIFY_PARAM_find(param_table, &idx, &pm)) return sk_X509_VERIFY_PARAM_value(param_table, idx); } diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509cset.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c similarity index 85% rename from Pods/BoringSSL-GRPC/crypto/x509/x509cset.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c index 2fd3f1235..d42b4235c 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509cset.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c @@ -135,6 +135,35 @@ int X509_CRL_up_ref(X509_CRL *crl) return 1; } +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl) +{ + return crl->crl->lastUpdate; +} + +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl) +{ + return crl->crl->nextUpdate; +} + +void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = crl->signature; + if (palg != NULL) + *palg = crl->sig_alg; +} + +int X509_CRL_get_signature_nid(const X509_CRL *crl) +{ + return OBJ_obj2nid(crl->sig_alg->algorithm); +} + +const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x) +{ + return x->revocationDate; +} + int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) { ASN1_TIME *in; @@ -152,6 +181,11 @@ int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) return (in != NULL); } +const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x) +{ + return x->serialNumber; +} + int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial) { ASN1_INTEGER *in; @@ -168,3 +202,9 @@ int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial) } return (in != NULL); } + +int i2d_re_X509_CRL_tbs(X509_CRL *crl, unsigned char **pp) +{ + crl->crl->enc.modified = 1; + return i2d_X509_CRL_INFO(crl->crl, pp); +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509cset.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c.grpc_back similarity index 85% rename from Pods/BoringSSL-GRPC/crypto/x509/x509cset.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c.grpc_back index 2fd48a9c8..6f2708c1d 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509cset.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509cset.c.grpc_back @@ -135,6 +135,35 @@ int X509_CRL_up_ref(X509_CRL *crl) return 1; } +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl) +{ + return crl->crl->lastUpdate; +} + +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl) +{ + return crl->crl->nextUpdate; +} + +void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg) +{ + if (psig != NULL) + *psig = crl->signature; + if (palg != NULL) + *palg = crl->sig_alg; +} + +int X509_CRL_get_signature_nid(const X509_CRL *crl) +{ + return OBJ_obj2nid(crl->sig_alg->algorithm); +} + +const ASN1_TIME *X509_REVOKED_get0_revocationDate(const X509_REVOKED *x) +{ + return x->revocationDate; +} + int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) { ASN1_TIME *in; @@ -152,6 +181,11 @@ int X509_REVOKED_set_revocationDate(X509_REVOKED *x, ASN1_TIME *tm) return (in != NULL); } +const ASN1_INTEGER *X509_REVOKED_get0_serialNumber(const X509_REVOKED *x) +{ + return x->serialNumber; +} + int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial) { ASN1_INTEGER *in; @@ -168,3 +202,9 @@ int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial) } return (in != NULL); } + +int i2d_re_X509_CRL_tbs(X509_CRL *crl, unsigned char **pp) +{ + crl->crl->enc.modified = 1; + return i2d_X509_CRL_INFO(crl->crl, pp); +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509name.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509name.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c index eca51382e..2f758bba8 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509name.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c @@ -238,6 +238,7 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, else if (loc < 0) loc = n; + inc = (set == 0); name->modified = 1; if (set == -1) { @@ -246,7 +247,6 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, inc = 1; } else { set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set; - inc = 0; } } else { /* if (set >= 0) */ @@ -257,7 +257,6 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, set = 0; } else set = sk_X509_NAME_ENTRY_value(sk, loc)->set; - inc = (set == 0) ? 1 : 0; } if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) @@ -270,7 +269,7 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, if (inc) { n = sk_X509_NAME_ENTRY_num(sk); for (i = loc + 1; i < n; i++) - sk_X509_NAME_ENTRY_value(sk, i - 1)->set += 1; + sk_X509_NAME_ENTRY_value(sk, i)->set += 1; } return (1); err: diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509name.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509/x509name.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c.grpc_back index 610de5f29..fa621f226 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x509name.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x509name.c.grpc_back @@ -238,6 +238,7 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, else if (loc < 0) loc = n; + inc = (set == 0); name->modified = 1; if (set == -1) { @@ -246,7 +247,6 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, inc = 1; } else { set = sk_X509_NAME_ENTRY_value(sk, loc - 1)->set; - inc = 0; } } else { /* if (set >= 0) */ @@ -257,7 +257,6 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, set = 0; } else set = sk_X509_NAME_ENTRY_value(sk, loc)->set; - inc = (set == 0) ? 1 : 0; } if ((new_name = X509_NAME_ENTRY_dup(ne)) == NULL) @@ -270,7 +269,7 @@ int X509_NAME_add_entry(X509_NAME *name, X509_NAME_ENTRY *ne, int loc, if (inc) { n = sk_X509_NAME_ENTRY_num(sk); for (i = loc + 1; i < n; i++) - sk_X509_NAME_ENTRY_value(sk, i - 1)->set += 1; + sk_X509_NAME_ENTRY_value(sk, i)->set += 1; } return (1); err: diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509rset.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509rset.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509rset.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509rset.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509rset.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509spki.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509spki.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x509spki.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x509spki.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x509spki.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_algor.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_algor.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_algor.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_algor.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_algor.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c new file mode 100644 index 000000000..31949a366 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c @@ -0,0 +1,399 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +int X509_verify(X509 *a, EVP_PKEY *r) +{ + if (X509_ALGOR_cmp(a->sig_alg, a->cert_info->signature)) { + OPENSSL_PUT_ERROR(X509, X509_R_SIGNATURE_ALGORITHM_MISMATCH); + return 0; + } + return (ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF), a->sig_alg, + a->signature, a->cert_info, r)); +} + +int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) +{ + return (ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO), + a->sig_alg, a->signature, a->req_info, r)); +} + +int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + x->cert_info->enc.modified = 1; + return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature, + x->sig_alg, x->signature, x->cert_info, pkey, md)); +} + +int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx) +{ + x->cert_info->enc.modified = 1; + return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CINF), + x->cert_info->signature, + x->sig_alg, x->signature, x->cert_info, ctx); +} + +int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + return (ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO), x->sig_alg, NULL, + x->signature, x->req_info, pkey, md)); +} + +int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx) +{ + return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_REQ_INFO), + x->sig_alg, NULL, x->signature, x->req_info, + ctx); +} + +int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + x->crl->enc.modified = 1; + return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CRL_INFO), x->crl->sig_alg, + x->sig_alg, x->signature, x->crl, pkey, md)); +} + +int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx) +{ + x->crl->enc.modified = 1; + return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CRL_INFO), + x->crl->sig_alg, x->sig_alg, x->signature, + x->crl, ctx); +} + +int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + return (ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, NULL, + x->signature, x->spkac, pkey, md)); +} + +int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *x, EVP_PKEY *pkey) +{ + return (ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, + x->signature, x->spkac, pkey)); +} + +#ifndef OPENSSL_NO_FP_API +X509 *d2i_X509_fp(FILE *fp, X509 **x509) +{ + return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509), fp, x509); +} + +int i2d_X509_fp(FILE *fp, X509 *x509) +{ + return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509), fp, x509); +} +#endif + +X509 *d2i_X509_bio(BIO *bp, X509 **x509) +{ + return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), bp, x509); +} + +int i2d_X509_bio(BIO *bp, X509 *x509) +{ + return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509); +} + +#ifndef OPENSSL_NO_FP_API +X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl) +{ + return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); +} + +int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) +{ + return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); +} +#endif + +X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl) +{ + return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); +} + +int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) +{ + return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); +} + +#ifndef OPENSSL_NO_FP_API +X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req) +{ + return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); +} + +int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) +{ + return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); +} +#endif + +X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req) +{ + return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); +} + +int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) +{ + return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); +} + +#ifndef OPENSSL_NO_FP_API + +#define IMPLEMENT_D2I_FP(type, name, bio_func) \ + type *name(FILE *fp, type **obj) { \ + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); \ + if (bio == NULL) { \ + return NULL; \ + } \ + type *ret = bio_func(bio, obj); \ + BIO_free(bio); \ + return ret; \ + } + +#define IMPLEMENT_I2D_FP(type, name, bio_func) \ + int name(FILE *fp, type *obj) { \ + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); \ + if (bio == NULL) { \ + return 0; \ + } \ + int ret = bio_func(bio, obj); \ + BIO_free(bio); \ + return ret; \ + } + +IMPLEMENT_D2I_FP(RSA, d2i_RSAPrivateKey_fp, d2i_RSAPrivateKey_bio) +IMPLEMENT_I2D_FP(RSA, i2d_RSAPrivateKey_fp, i2d_RSAPrivateKey_bio) + +IMPLEMENT_D2I_FP(RSA, d2i_RSAPublicKey_fp, d2i_RSAPublicKey_bio) +IMPLEMENT_I2D_FP(RSA, i2d_RSAPublicKey_fp, i2d_RSAPublicKey_bio) + +IMPLEMENT_D2I_FP(RSA, d2i_RSA_PUBKEY_fp, d2i_RSA_PUBKEY_bio) +IMPLEMENT_I2D_FP(RSA, i2d_RSA_PUBKEY_fp, i2d_RSA_PUBKEY_bio) +#endif + +#define IMPLEMENT_D2I_BIO(type, name, d2i_func) \ + type *name(BIO *bio, type **obj) { \ + uint8_t *data; \ + size_t len; \ + if (!BIO_read_asn1(bio, &data, &len, 100 * 1024)) { \ + return NULL; \ + } \ + const uint8_t *ptr = data; \ + type *ret = d2i_func(obj, &ptr, (long)len); \ + OPENSSL_free(data); \ + return ret; \ + } + +#define IMPLEMENT_I2D_BIO(type, name, i2d_func) \ + int name(BIO *bio, type *obj) { \ + uint8_t *data = NULL; \ + int len = i2d_func(obj, &data); \ + if (len < 0) { \ + return 0; \ + } \ + int ret = BIO_write_all(bio, data, len); \ + OPENSSL_free(data); \ + return ret; \ + } + +IMPLEMENT_D2I_BIO(RSA, d2i_RSAPrivateKey_bio, d2i_RSAPrivateKey) +IMPLEMENT_I2D_BIO(RSA, i2d_RSAPrivateKey_bio, i2d_RSAPrivateKey) + +IMPLEMENT_D2I_BIO(RSA, d2i_RSAPublicKey_bio, d2i_RSAPublicKey) +IMPLEMENT_I2D_BIO(RSA, i2d_RSAPublicKey_bio, i2d_RSAPublicKey) + +IMPLEMENT_D2I_BIO(RSA, d2i_RSA_PUBKEY_bio, d2i_RSA_PUBKEY) +IMPLEMENT_I2D_BIO(RSA, i2d_RSA_PUBKEY_bio, i2d_RSA_PUBKEY) + +#ifndef OPENSSL_NO_DSA +# ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(DSA, d2i_DSAPrivateKey_fp, d2i_DSAPrivateKey_bio) +IMPLEMENT_I2D_FP(DSA, i2d_DSAPrivateKey_fp, i2d_DSAPrivateKey_bio) + +IMPLEMENT_D2I_FP(DSA, d2i_DSA_PUBKEY_fp, d2i_DSA_PUBKEY_bio) +IMPLEMENT_I2D_FP(DSA, i2d_DSA_PUBKEY_fp, i2d_DSA_PUBKEY_bio) +# endif + +IMPLEMENT_D2I_BIO(DSA, d2i_DSAPrivateKey_bio, d2i_DSAPrivateKey) +IMPLEMENT_I2D_BIO(DSA, i2d_DSAPrivateKey_bio, i2d_DSAPrivateKey) + +IMPLEMENT_D2I_BIO(DSA, d2i_DSA_PUBKEY_bio, d2i_DSA_PUBKEY) +IMPLEMENT_I2D_BIO(DSA, i2d_DSA_PUBKEY_bio, i2d_DSA_PUBKEY) +#endif + +#ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(EC_KEY, d2i_ECPrivateKey_fp, d2i_ECPrivateKey_bio) +IMPLEMENT_I2D_FP(EC_KEY, i2d_ECPrivateKey_fp, i2d_ECPrivateKey_bio) + +IMPLEMENT_D2I_FP(EC_KEY, d2i_EC_PUBKEY_fp, d2i_EC_PUBKEY_bio) +IMPLEMENT_I2D_FP(EC_KEY, i2d_EC_PUBKEY_fp, i2d_EC_PUBKEY_bio) +#endif + +IMPLEMENT_D2I_BIO(EC_KEY, d2i_ECPrivateKey_bio, d2i_ECPrivateKey) +IMPLEMENT_I2D_BIO(EC_KEY, i2d_ECPrivateKey_bio, i2d_ECPrivateKey) + +IMPLEMENT_D2I_BIO(EC_KEY, d2i_EC_PUBKEY_bio, d2i_EC_PUBKEY) +IMPLEMENT_I2D_BIO(EC_KEY, i2d_EC_PUBKEY_bio, i2d_EC_PUBKEY) + +int X509_pubkey_digest(const X509 *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + ASN1_BIT_STRING *key; + key = X509_get0_pubkey_bitstr(data); + if (!key) + return 0; + return EVP_Digest(key->data, key->length, md, len, type, NULL); +} + +int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, + unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509), type, (char *)data, md, len)); +} + +int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509_CRL), type, (char *)data, md, len)); +} + +int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509_REQ), type, (char *)data, md, len)); +} + +int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509_NAME), type, (char *)data, md, len)); +} + +#ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(X509_SIG, d2i_PKCS8_fp, d2i_PKCS8_bio) +IMPLEMENT_I2D_FP(X509_SIG, i2d_PKCS8_fp, i2d_PKCS8_bio) +#endif + +IMPLEMENT_D2I_BIO(X509_SIG, d2i_PKCS8_bio, d2i_X509_SIG) +IMPLEMENT_I2D_BIO(X509_SIG, i2d_PKCS8_bio, i2d_X509_SIG) + +#ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(PKCS8_PRIV_KEY_INFO, d2i_PKCS8_PRIV_KEY_INFO_fp, + d2i_PKCS8_PRIV_KEY_INFO_bio) +IMPLEMENT_I2D_FP(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO_fp, + i2d_PKCS8_PRIV_KEY_INFO_bio) + +int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key) +{ + PKCS8_PRIV_KEY_INFO *p8inf; + int ret; + p8inf = EVP_PKEY2PKCS8(key); + if (!p8inf) + return 0; + ret = i2d_PKCS8_PRIV_KEY_INFO_fp(fp, p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return ret; +} + +IMPLEMENT_D2I_FP(EVP_PKEY, d2i_PrivateKey_fp, d2i_PrivateKey_bio) +IMPLEMENT_I2D_FP(EVP_PKEY, i2d_PrivateKey_fp, i2d_PrivateKey_bio) + +IMPLEMENT_D2I_FP(EVP_PKEY, d2i_PUBKEY_fp, d2i_PUBKEY_bio) +IMPLEMENT_I2D_FP(EVP_PKEY, i2d_PUBKEY_fp, i2d_PUBKEY_bio) + +IMPLEMENT_D2I_BIO(PKCS8_PRIV_KEY_INFO, d2i_PKCS8_PRIV_KEY_INFO_bio, + d2i_PKCS8_PRIV_KEY_INFO) +IMPLEMENT_I2D_BIO(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO_bio, + i2d_PKCS8_PRIV_KEY_INFO) + +int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key) +{ + PKCS8_PRIV_KEY_INFO *p8inf; + int ret; + p8inf = EVP_PKEY2PKCS8(key); + if (!p8inf) + return 0; + ret = i2d_PKCS8_PRIV_KEY_INFO_bio(bp, p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return ret; +} +#endif + +IMPLEMENT_D2I_BIO(EVP_PKEY, d2i_PrivateKey_bio, d2i_AutoPrivateKey) +IMPLEMENT_I2D_BIO(EVP_PKEY, i2d_PrivateKey_bio, i2d_PrivateKey) + +IMPLEMENT_D2I_BIO(EVP_PKEY, d2i_PUBKEY_bio, d2i_PUBKEY) +IMPLEMENT_I2D_BIO(EVP_PKEY, i2d_PUBKEY_bio, i2d_PUBKEY) + +IMPLEMENT_D2I_BIO(DH, d2i_DHparams_bio, d2i_DHparams) +IMPLEMENT_I2D_BIO(const DH, i2d_DHparams_bio, i2d_DHparams) diff --git a/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c.grpc_back new file mode 100644 index 000000000..33c11b685 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x_all.c.grpc_back @@ -0,0 +1,399 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +int X509_verify(X509 *a, EVP_PKEY *r) +{ + if (X509_ALGOR_cmp(a->sig_alg, a->cert_info->signature)) { + OPENSSL_PUT_ERROR(X509, X509_R_SIGNATURE_ALGORITHM_MISMATCH); + return 0; + } + return (ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF), a->sig_alg, + a->signature, a->cert_info, r)); +} + +int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r) +{ + return (ASN1_item_verify(ASN1_ITEM_rptr(X509_REQ_INFO), + a->sig_alg, a->signature, a->req_info, r)); +} + +int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + x->cert_info->enc.modified = 1; + return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CINF), x->cert_info->signature, + x->sig_alg, x->signature, x->cert_info, pkey, md)); +} + +int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx) +{ + x->cert_info->enc.modified = 1; + return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CINF), + x->cert_info->signature, + x->sig_alg, x->signature, x->cert_info, ctx); +} + +int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + return (ASN1_item_sign(ASN1_ITEM_rptr(X509_REQ_INFO), x->sig_alg, NULL, + x->signature, x->req_info, pkey, md)); +} + +int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx) +{ + return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_REQ_INFO), + x->sig_alg, NULL, x->signature, x->req_info, + ctx); +} + +int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + x->crl->enc.modified = 1; + return (ASN1_item_sign(ASN1_ITEM_rptr(X509_CRL_INFO), x->crl->sig_alg, + x->sig_alg, x->signature, x->crl, pkey, md)); +} + +int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx) +{ + x->crl->enc.modified = 1; + return ASN1_item_sign_ctx(ASN1_ITEM_rptr(X509_CRL_INFO), + x->crl->sig_alg, x->sig_alg, x->signature, + x->crl, ctx); +} + +int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md) +{ + return (ASN1_item_sign(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, NULL, + x->signature, x->spkac, pkey, md)); +} + +int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *x, EVP_PKEY *pkey) +{ + return (ASN1_item_verify(ASN1_ITEM_rptr(NETSCAPE_SPKAC), x->sig_algor, + x->signature, x->spkac, pkey)); +} + +#ifndef OPENSSL_NO_FP_API +X509 *d2i_X509_fp(FILE *fp, X509 **x509) +{ + return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509), fp, x509); +} + +int i2d_X509_fp(FILE *fp, X509 *x509) +{ + return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509), fp, x509); +} +#endif + +X509 *d2i_X509_bio(BIO *bp, X509 **x509) +{ + return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509), bp, x509); +} + +int i2d_X509_bio(BIO *bp, X509 *x509) +{ + return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509), bp, x509); +} + +#ifndef OPENSSL_NO_FP_API +X509_CRL *d2i_X509_CRL_fp(FILE *fp, X509_CRL **crl) +{ + return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); +} + +int i2d_X509_CRL_fp(FILE *fp, X509_CRL *crl) +{ + return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_CRL), fp, crl); +} +#endif + +X509_CRL *d2i_X509_CRL_bio(BIO *bp, X509_CRL **crl) +{ + return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); +} + +int i2d_X509_CRL_bio(BIO *bp, X509_CRL *crl) +{ + return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_CRL), bp, crl); +} + +#ifndef OPENSSL_NO_FP_API +X509_REQ *d2i_X509_REQ_fp(FILE *fp, X509_REQ **req) +{ + return ASN1_item_d2i_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); +} + +int i2d_X509_REQ_fp(FILE *fp, X509_REQ *req) +{ + return ASN1_item_i2d_fp(ASN1_ITEM_rptr(X509_REQ), fp, req); +} +#endif + +X509_REQ *d2i_X509_REQ_bio(BIO *bp, X509_REQ **req) +{ + return ASN1_item_d2i_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); +} + +int i2d_X509_REQ_bio(BIO *bp, X509_REQ *req) +{ + return ASN1_item_i2d_bio(ASN1_ITEM_rptr(X509_REQ), bp, req); +} + +#ifndef OPENSSL_NO_FP_API + +#define IMPLEMENT_D2I_FP(type, name, bio_func) \ + type *name(FILE *fp, type **obj) { \ + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); \ + if (bio == NULL) { \ + return NULL; \ + } \ + type *ret = bio_func(bio, obj); \ + BIO_free(bio); \ + return ret; \ + } + +#define IMPLEMENT_I2D_FP(type, name, bio_func) \ + int name(FILE *fp, type *obj) { \ + BIO *bio = BIO_new_fp(fp, BIO_NOCLOSE); \ + if (bio == NULL) { \ + return 0; \ + } \ + int ret = bio_func(bio, obj); \ + BIO_free(bio); \ + return ret; \ + } + +IMPLEMENT_D2I_FP(RSA, d2i_RSAPrivateKey_fp, d2i_RSAPrivateKey_bio) +IMPLEMENT_I2D_FP(RSA, i2d_RSAPrivateKey_fp, i2d_RSAPrivateKey_bio) + +IMPLEMENT_D2I_FP(RSA, d2i_RSAPublicKey_fp, d2i_RSAPublicKey_bio) +IMPLEMENT_I2D_FP(RSA, i2d_RSAPublicKey_fp, i2d_RSAPublicKey_bio) + +IMPLEMENT_D2I_FP(RSA, d2i_RSA_PUBKEY_fp, d2i_RSA_PUBKEY_bio) +IMPLEMENT_I2D_FP(RSA, i2d_RSA_PUBKEY_fp, i2d_RSA_PUBKEY_bio) +#endif + +#define IMPLEMENT_D2I_BIO(type, name, d2i_func) \ + type *name(BIO *bio, type **obj) { \ + uint8_t *data; \ + size_t len; \ + if (!BIO_read_asn1(bio, &data, &len, 100 * 1024)) { \ + return NULL; \ + } \ + const uint8_t *ptr = data; \ + type *ret = d2i_func(obj, &ptr, (long)len); \ + OPENSSL_free(data); \ + return ret; \ + } + +#define IMPLEMENT_I2D_BIO(type, name, i2d_func) \ + int name(BIO *bio, type *obj) { \ + uint8_t *data = NULL; \ + int len = i2d_func(obj, &data); \ + if (len < 0) { \ + return 0; \ + } \ + int ret = BIO_write_all(bio, data, len); \ + OPENSSL_free(data); \ + return ret; \ + } + +IMPLEMENT_D2I_BIO(RSA, d2i_RSAPrivateKey_bio, d2i_RSAPrivateKey) +IMPLEMENT_I2D_BIO(RSA, i2d_RSAPrivateKey_bio, i2d_RSAPrivateKey) + +IMPLEMENT_D2I_BIO(RSA, d2i_RSAPublicKey_bio, d2i_RSAPublicKey) +IMPLEMENT_I2D_BIO(RSA, i2d_RSAPublicKey_bio, i2d_RSAPublicKey) + +IMPLEMENT_D2I_BIO(RSA, d2i_RSA_PUBKEY_bio, d2i_RSA_PUBKEY) +IMPLEMENT_I2D_BIO(RSA, i2d_RSA_PUBKEY_bio, i2d_RSA_PUBKEY) + +#ifndef OPENSSL_NO_DSA +# ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(DSA, d2i_DSAPrivateKey_fp, d2i_DSAPrivateKey_bio) +IMPLEMENT_I2D_FP(DSA, i2d_DSAPrivateKey_fp, i2d_DSAPrivateKey_bio) + +IMPLEMENT_D2I_FP(DSA, d2i_DSA_PUBKEY_fp, d2i_DSA_PUBKEY_bio) +IMPLEMENT_I2D_FP(DSA, i2d_DSA_PUBKEY_fp, i2d_DSA_PUBKEY_bio) +# endif + +IMPLEMENT_D2I_BIO(DSA, d2i_DSAPrivateKey_bio, d2i_DSAPrivateKey) +IMPLEMENT_I2D_BIO(DSA, i2d_DSAPrivateKey_bio, i2d_DSAPrivateKey) + +IMPLEMENT_D2I_BIO(DSA, d2i_DSA_PUBKEY_bio, d2i_DSA_PUBKEY) +IMPLEMENT_I2D_BIO(DSA, i2d_DSA_PUBKEY_bio, i2d_DSA_PUBKEY) +#endif + +#ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(EC_KEY, d2i_ECPrivateKey_fp, d2i_ECPrivateKey_bio) +IMPLEMENT_I2D_FP(EC_KEY, i2d_ECPrivateKey_fp, i2d_ECPrivateKey_bio) + +IMPLEMENT_D2I_FP(EC_KEY, d2i_EC_PUBKEY_fp, d2i_EC_PUBKEY_bio) +IMPLEMENT_I2D_FP(EC_KEY, i2d_EC_PUBKEY_fp, i2d_EC_PUBKEY_bio) +#endif + +IMPLEMENT_D2I_BIO(EC_KEY, d2i_ECPrivateKey_bio, d2i_ECPrivateKey) +IMPLEMENT_I2D_BIO(EC_KEY, i2d_ECPrivateKey_bio, i2d_ECPrivateKey) + +IMPLEMENT_D2I_BIO(EC_KEY, d2i_EC_PUBKEY_bio, d2i_EC_PUBKEY) +IMPLEMENT_I2D_BIO(EC_KEY, i2d_EC_PUBKEY_bio, i2d_EC_PUBKEY) + +int X509_pubkey_digest(const X509 *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + ASN1_BIT_STRING *key; + key = X509_get0_pubkey_bitstr(data); + if (!key) + return 0; + return EVP_Digest(key->data, key->length, md, len, type, NULL); +} + +int X509_digest(const X509 *data, const EVP_MD *type, unsigned char *md, + unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509), type, (char *)data, md, len)); +} + +int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509_CRL), type, (char *)data, md, len)); +} + +int X509_REQ_digest(const X509_REQ *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509_REQ), type, (char *)data, md, len)); +} + +int X509_NAME_digest(const X509_NAME *data, const EVP_MD *type, + unsigned char *md, unsigned int *len) +{ + return (ASN1_item_digest + (ASN1_ITEM_rptr(X509_NAME), type, (char *)data, md, len)); +} + +#ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(X509_SIG, d2i_PKCS8_fp, d2i_PKCS8_bio) +IMPLEMENT_I2D_FP(X509_SIG, i2d_PKCS8_fp, i2d_PKCS8_bio) +#endif + +IMPLEMENT_D2I_BIO(X509_SIG, d2i_PKCS8_bio, d2i_X509_SIG) +IMPLEMENT_I2D_BIO(X509_SIG, i2d_PKCS8_bio, i2d_X509_SIG) + +#ifndef OPENSSL_NO_FP_API +IMPLEMENT_D2I_FP(PKCS8_PRIV_KEY_INFO, d2i_PKCS8_PRIV_KEY_INFO_fp, + d2i_PKCS8_PRIV_KEY_INFO_bio) +IMPLEMENT_I2D_FP(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO_fp, + i2d_PKCS8_PRIV_KEY_INFO_bio) + +int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key) +{ + PKCS8_PRIV_KEY_INFO *p8inf; + int ret; + p8inf = EVP_PKEY2PKCS8(key); + if (!p8inf) + return 0; + ret = i2d_PKCS8_PRIV_KEY_INFO_fp(fp, p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return ret; +} + +IMPLEMENT_D2I_FP(EVP_PKEY, d2i_PrivateKey_fp, d2i_PrivateKey_bio) +IMPLEMENT_I2D_FP(EVP_PKEY, i2d_PrivateKey_fp, i2d_PrivateKey_bio) + +IMPLEMENT_D2I_FP(EVP_PKEY, d2i_PUBKEY_fp, d2i_PUBKEY_bio) +IMPLEMENT_I2D_FP(EVP_PKEY, i2d_PUBKEY_fp, i2d_PUBKEY_bio) + +IMPLEMENT_D2I_BIO(PKCS8_PRIV_KEY_INFO, d2i_PKCS8_PRIV_KEY_INFO_bio, + d2i_PKCS8_PRIV_KEY_INFO) +IMPLEMENT_I2D_BIO(PKCS8_PRIV_KEY_INFO, i2d_PKCS8_PRIV_KEY_INFO_bio, + i2d_PKCS8_PRIV_KEY_INFO) + +int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key) +{ + PKCS8_PRIV_KEY_INFO *p8inf; + int ret; + p8inf = EVP_PKEY2PKCS8(key); + if (!p8inf) + return 0; + ret = i2d_PKCS8_PRIV_KEY_INFO_bio(bp, p8inf); + PKCS8_PRIV_KEY_INFO_free(p8inf); + return ret; +} +#endif + +IMPLEMENT_D2I_BIO(EVP_PKEY, d2i_PrivateKey_bio, d2i_AutoPrivateKey) +IMPLEMENT_I2D_BIO(EVP_PKEY, i2d_PrivateKey_bio, i2d_PrivateKey) + +IMPLEMENT_D2I_BIO(EVP_PKEY, d2i_PUBKEY_bio, d2i_PUBKEY) +IMPLEMENT_I2D_BIO(EVP_PKEY, i2d_PUBKEY_bio, i2d_PUBKEY) + +IMPLEMENT_D2I_BIO(DH, d2i_DHparams_bio, d2i_DHparams) +IMPLEMENT_I2D_BIO(const DH, i2d_DHparams_bio, i2d_DHparams) diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_attrib.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_attrib.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_attrib.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_attrib.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_attrib.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_crl.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_crl.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_crl.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_crl.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_crl.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_exten.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_exten.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_exten.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_exten.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_exten.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_info.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_info.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_info.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_info.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_info.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_name.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_name.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_name.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_name.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_name.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_pkey.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_pkey.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_pkey.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_pkey.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_pkey.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_pubkey.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_pubkey.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_pubkey.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_pubkey.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_pubkey.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_req.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_req.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_req.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_req.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_req.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_sig.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_sig.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_sig.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_sig.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_sig.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_spki.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_spki.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_spki.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_spki.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_spki.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_val.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_val.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_val.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_val.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_val.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_x509.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x_x509.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c index f774b7a2c..7b42b9475 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x_x509.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c @@ -313,6 +313,12 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp) return length; } +int i2d_re_X509_tbs(X509 *x, unsigned char **pp) +{ + x->cert_info->enc.modified = 1; + return i2d_X509_CINF(x->cert_info, pp); +} + void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x) { diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_x509.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509/x_x509.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c.grpc_back index 01464a1fe..9ece062d2 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509/x_x509.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509.c.grpc_back @@ -313,6 +313,12 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp) return length; } +int i2d_re_X509_tbs(X509 *x, unsigned char **pp) +{ + x->cert_info->enc.modified = 1; + return i2d_X509_CINF(x->cert_info, pp); +} + void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x) { diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_x509a.c b/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_x509a.c rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509/x_x509a.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509/x_x509a.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509/x_x509a.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/ext_dat.h b/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/ext_dat.h rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h index 78fa79362..a6ca45bf4 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/ext_dat.h +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h @@ -107,19 +107,17 @@ static const X509V3_EXT_METHOD *const standard_exts[] = { &v3_ext_ku, &v3_delta_crl, &v3_crl_reason, -#ifndef OPENSSL_NO_OCSP &v3_crl_invdate, -#endif &v3_sxnet, &v3_info, #ifndef OPENSSL_NO_OCSP &v3_ocsp_nonce, &v3_ocsp_crlid, &v3_ocsp_accresp, - &v3_ocsp_nocheck, &v3_ocsp_acutoff, &v3_ocsp_serviceloc, #endif + &v3_ocsp_nocheck, &v3_sinfo, &v3_policy_constraints, #ifndef OPENSSL_NO_OCSP diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/ext_dat.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/ext_dat.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h.grpc_back index 78fa79362..a6ca45bf4 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/ext_dat.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/ext_dat.h.grpc_back @@ -107,19 +107,17 @@ static const X509V3_EXT_METHOD *const standard_exts[] = { &v3_ext_ku, &v3_delta_crl, &v3_crl_reason, -#ifndef OPENSSL_NO_OCSP &v3_crl_invdate, -#endif &v3_sxnet, &v3_info, #ifndef OPENSSL_NO_OCSP &v3_ocsp_nonce, &v3_ocsp_crlid, &v3_ocsp_accresp, - &v3_ocsp_nocheck, &v3_ocsp_acutoff, &v3_ocsp_serviceloc, #endif + &v3_ocsp_nocheck, &v3_sinfo, &v3_policy_constraints, #ifndef OPENSSL_NO_OCSP diff --git a/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h b/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h new file mode 100644 index 000000000..edcdd6b58 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h @@ -0,0 +1,56 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_X509V3_INTERNAL_H +#define OPENSSL_HEADER_X509V3_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// x509v3_bytes_to_hex encodes |len| bytes from |buffer| to hex and returns a +// newly-allocated NUL-terminated string containing the result, or NULL on +// allocation error. +// +// Note this function was historically named |hex_to_string| in OpenSSL, not +// |string_to_hex|. +char *x509v3_bytes_to_hex(const unsigned char *buffer, long len); + +// x509v3_hex_string_to_bytes decodes |str| in hex and returns a newly-allocated +// array containing the result, or NULL on error. On success, it sets |*len| to +// the length of the result. Colon separators between bytes in the input are +// allowed and ignored. +// +// Note this function was historically named |string_to_hex| in OpenSSL, not +// |hex_to_string|. +unsigned char *x509v3_hex_to_bytes(const char *str, long *len); + +// x509v3_name_cmp returns zero if |name| is equal to |cmp| or begins with |cmp| +// followed by '.'. Otherwise, it returns a non-zero number. +int x509v3_name_cmp(const char *name, const char *cmp); + +// x509v3_looks_like_dns_name returns one if |in| looks like a DNS name and zero +// otherwise. +OPENSSL_EXPORT int x509v3_looks_like_dns_name(const unsigned char *in, + size_t len); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_X509V3_INTERNAL_H */ diff --git a/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h.grpc_back new file mode 100644 index 000000000..c143d735d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/internal.h.grpc_back @@ -0,0 +1,56 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_X509V3_INTERNAL_H +#define OPENSSL_HEADER_X509V3_INTERNAL_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// x509v3_bytes_to_hex encodes |len| bytes from |buffer| to hex and returns a +// newly-allocated NUL-terminated string containing the result, or NULL on +// allocation error. +// +// Note this function was historically named |hex_to_string| in OpenSSL, not +// |string_to_hex|. +char *x509v3_bytes_to_hex(const unsigned char *buffer, long len); + +// x509v3_hex_string_to_bytes decodes |str| in hex and returns a newly-allocated +// array containing the result, or NULL on error. On success, it sets |*len| to +// the length of the result. Colon separators between bytes in the input are +// allowed and ignored. +// +// Note this function was historically named |string_to_hex| in OpenSSL, not +// |hex_to_string|. +unsigned char *x509v3_hex_to_bytes(const char *str, long *len); + +// x509v3_name_cmp returns zero if |name| is equal to |cmp| or begins with |cmp| +// followed by '.'. Otherwise, it returns a non-zero number. +int x509v3_name_cmp(const char *name, const char *cmp); + +// x509v3_looks_like_dns_name returns one if |in| looks like a DNS name and zero +// otherwise. +OPENSSL_EXPORT int x509v3_looks_like_dns_name(const unsigned char *in, + size_t len); + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_X509V3_INTERNAL_H */ diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_cache.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_cache.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c index c1159f3ed..2aeb42662 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_cache.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c @@ -93,6 +93,7 @@ static int policy_cache_create(X509 *x, /* * Duplicate policy OIDs are illegal: reject if matches found. */ + sk_X509_POLICY_DATA_sort(cache->data); if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { if (cache->anyPolicy) { ret = -1; @@ -262,6 +263,7 @@ X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, X509_POLICY_DATA tmp; tmp.valid_policy = (ASN1_OBJECT *)id; + sk_X509_POLICY_DATA_sort(cache->data); if (!sk_X509_POLICY_DATA_find(cache->data, &idx, &tmp)) return NULL; return sk_X509_POLICY_DATA_value(cache->data, idx); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_cache.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_cache.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c.grpc_back index b8a4be274..755c07953 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_cache.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_cache.c.grpc_back @@ -93,6 +93,7 @@ static int policy_cache_create(X509 *x, /* * Duplicate policy OIDs are illegal: reject if matches found. */ + sk_X509_POLICY_DATA_sort(cache->data); if (OBJ_obj2nid(data->valid_policy) == NID_any_policy) { if (cache->anyPolicy) { ret = -1; @@ -262,6 +263,7 @@ X509_POLICY_DATA *policy_cache_find_data(const X509_POLICY_CACHE *cache, X509_POLICY_DATA tmp; tmp.valid_policy = (ASN1_OBJECT *)id; + sk_X509_POLICY_DATA_sort(cache->data); if (!sk_X509_POLICY_DATA_find(cache->data, &idx, &tmp)) return NULL; return sk_X509_POLICY_DATA_value(cache->data, idx); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_data.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_data.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_data.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_data.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_data.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_int.h b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_int.h rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_int.h.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_int.h.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_int.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_lib.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_lib.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_lib.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_lib.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_lib.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_map.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_map.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_map.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_map.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_map.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_node.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_node.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c index f4233c54c..dba4861f7 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_node.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c @@ -83,6 +83,7 @@ X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *nodes, n.valid_policy = (ASN1_OBJECT *)id; l.data = &n; + sk_X509_POLICY_NODE_sort(nodes); if (!sk_X509_POLICY_NODE_find(nodes, &idx, &l)) return NULL; diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_node.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_node.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c.grpc_back index b3edfe480..6682282c7 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_node.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_node.c.grpc_back @@ -83,6 +83,7 @@ X509_POLICY_NODE *tree_find_sk(STACK_OF(X509_POLICY_NODE) *nodes, n.valid_policy = (ASN1_OBJECT *)id; l.data = &n; + sk_X509_POLICY_NODE_sort(nodes); if (!sk_X509_POLICY_NODE_find(nodes, &idx, &l)) return NULL; diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_tree.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_tree.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c index 3ba5ed9bb..94361720e 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_tree.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c @@ -543,9 +543,11 @@ static int tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes, *pnodes = policy_node_cmp_new(); if (!*pnodes) return 0; - } else if (sk_X509_POLICY_NODE_find(*pnodes, NULL, pcy)) + } else { + sk_X509_POLICY_NODE_sort(*pnodes); + if (sk_X509_POLICY_NODE_find(*pnodes, NULL, pcy)) return 1; - + } if (!sk_X509_POLICY_NODE_push(*pnodes, pcy)) return 0; diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_tree.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/pcy_tree.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c.grpc_back index 256fe88e6..136b45f50 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/pcy_tree.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/pcy_tree.c.grpc_back @@ -543,9 +543,11 @@ static int tree_add_auth_node(STACK_OF(X509_POLICY_NODE) **pnodes, *pnodes = policy_node_cmp_new(); if (!*pnodes) return 0; - } else if (sk_X509_POLICY_NODE_find(*pnodes, NULL, pcy)) + } else { + sk_X509_POLICY_NODE_sort(*pnodes); + if (sk_X509_POLICY_NODE_find(*pnodes, NULL, pcy)) return 1; - + } if (!sk_X509_POLICY_NODE_push(*pnodes, pcy)) return 0; diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_akey.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_akey.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c index b31e03118..1cc899b5a 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_akey.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c @@ -66,6 +66,9 @@ #include #include +#include "internal.h" + + static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, AUTHORITY_KEYID *akeyid, STACK_OF(CONF_VALUE) @@ -92,14 +95,14 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, { char *tmp; if (akeyid->keyid) { - tmp = hex_to_string(akeyid->keyid->data, akeyid->keyid->length); + tmp = x509v3_bytes_to_hex(akeyid->keyid->data, akeyid->keyid->length); X509V3_add_value("keyid", tmp, &extlist); OPENSSL_free(tmp); } if (akeyid->issuer) extlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist); if (akeyid->serial) { - tmp = hex_to_string(akeyid->serial->data, akeyid->serial->length); + tmp = x509v3_bytes_to_hex(akeyid->serial->data, akeyid->serial->length); X509V3_add_value("serial", tmp, &extlist); OPENSSL_free(tmp); } diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_akey.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_akey.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c.grpc_back index 4503e6155..30c02e2c2 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_akey.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akey.c.grpc_back @@ -66,6 +66,9 @@ #include #include +#include "internal.h" + + static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, AUTHORITY_KEYID *akeyid, STACK_OF(CONF_VALUE) @@ -92,14 +95,14 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, { char *tmp; if (akeyid->keyid) { - tmp = hex_to_string(akeyid->keyid->data, akeyid->keyid->length); + tmp = x509v3_bytes_to_hex(akeyid->keyid->data, akeyid->keyid->length); X509V3_add_value("keyid", tmp, &extlist); OPENSSL_free(tmp); } if (akeyid->issuer) extlist = i2v_GENERAL_NAMES(NULL, akeyid->issuer, extlist); if (akeyid->serial) { - tmp = hex_to_string(akeyid->serial->data, akeyid->serial->length); + tmp = x509v3_bytes_to_hex(akeyid->serial->data, akeyid->serial->length); X509V3_add_value("serial", tmp, &extlist); OPENSSL_free(tmp); } diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_akeya.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_akeya.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_akeya.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_akeya.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_akeya.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_alt.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_alt.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c index bfd7a82f4..9a5cfa342 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_alt.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c @@ -64,6 +64,9 @@ #include #include +#include "internal.h" + + static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); @@ -166,9 +169,9 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, for (i = 0; i < 8; i++) { BIO_snprintf(htmp, sizeof htmp, "%X", p[0] << 8 | p[1]); p += 2; - BUF_strlcat(oline, htmp, sizeof(oline)); + OPENSSL_strlcat(oline, htmp, sizeof(oline)); if (i != 7) - BUF_strlcat(oline, ":", sizeof(oline)); + OPENSSL_strlcat(oline, ":", sizeof(oline)); } } else { if (!X509V3_add_value("IP Address", "", &ret)) @@ -207,15 +210,18 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen) break; case GEN_EMAIL: - BIO_printf(out, "email:%s", gen->d.ia5->data); + BIO_printf(out, "email:"); + ASN1_STRING_print(out, gen->d.ia5); break; case GEN_DNS: - BIO_printf(out, "DNS:%s", gen->d.ia5->data); + BIO_printf(out, "DNS:"); + ASN1_STRING_print(out, gen->d.ia5); break; case GEN_URI: - BIO_printf(out, "URI:%s", gen->d.ia5->data); + BIO_printf(out, "URI:"); + ASN1_STRING_print(out, gen->d.ia5); break; case GEN_DIRNAME: @@ -261,7 +267,7 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, } for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { cnf = sk_CONF_VALUE_value(nval, i); - if (!name_cmp(cnf->name, "issuer") && cnf->value && + if (!x509v3_name_cmp(cnf->name, "issuer") && cnf->value && !strcmp(cnf->value, "copy")) { if (!copy_issuer(ctx, gens)) goto err; @@ -331,11 +337,11 @@ static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, } for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { cnf = sk_CONF_VALUE_value(nval, i); - if (!name_cmp(cnf->name, "email") && cnf->value && + if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && !strcmp(cnf->value, "copy")) { if (!copy_email(ctx, gens, 0)) goto err; - } else if (!name_cmp(cnf->name, "email") && cnf->value && + } else if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && !strcmp(cnf->value, "move")) { if (!copy_email(ctx, gens, 1)) goto err; @@ -545,19 +551,19 @@ GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, return NULL; } - if (!name_cmp(name, "email")) + if (!x509v3_name_cmp(name, "email")) type = GEN_EMAIL; - else if (!name_cmp(name, "URI")) + else if (!x509v3_name_cmp(name, "URI")) type = GEN_URI; - else if (!name_cmp(name, "DNS")) + else if (!x509v3_name_cmp(name, "DNS")) type = GEN_DNS; - else if (!name_cmp(name, "RID")) + else if (!x509v3_name_cmp(name, "RID")) type = GEN_RID; - else if (!name_cmp(name, "IP")) + else if (!x509v3_name_cmp(name, "IP")) type = GEN_IPADD; - else if (!name_cmp(name, "dirName")) + else if (!x509v3_name_cmp(name, "dirName")) type = GEN_DIRNAME; - else if (!name_cmp(name, "otherName")) + else if (!x509v3_name_cmp(name, "otherName")) type = GEN_OTHERNAME; else { OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_OPTION); @@ -588,7 +594,7 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) objtmp = OPENSSL_malloc(objlen + 1); if (objtmp == NULL) return 0; - BUF_strlcpy(objtmp, value, objlen + 1); + OPENSSL_strlcpy(objtmp, value, objlen + 1); gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); OPENSSL_free(objtmp); if (!gen->d.otherName->type_id) diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_alt.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_alt.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c.grpc_back index b78a4105e..0e79b450a 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_alt.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_alt.c.grpc_back @@ -64,6 +64,9 @@ #include #include +#include "internal.h" + + static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); @@ -166,9 +169,9 @@ STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, for (i = 0; i < 8; i++) { BIO_snprintf(htmp, sizeof htmp, "%X", p[0] << 8 | p[1]); p += 2; - BUF_strlcat(oline, htmp, sizeof(oline)); + OPENSSL_strlcat(oline, htmp, sizeof(oline)); if (i != 7) - BUF_strlcat(oline, ":", sizeof(oline)); + OPENSSL_strlcat(oline, ":", sizeof(oline)); } } else { if (!X509V3_add_value("IP Address", "", &ret)) @@ -207,15 +210,18 @@ int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen) break; case GEN_EMAIL: - BIO_printf(out, "email:%s", gen->d.ia5->data); + BIO_printf(out, "email:"); + ASN1_STRING_print(out, gen->d.ia5); break; case GEN_DNS: - BIO_printf(out, "DNS:%s", gen->d.ia5->data); + BIO_printf(out, "DNS:"); + ASN1_STRING_print(out, gen->d.ia5); break; case GEN_URI: - BIO_printf(out, "URI:%s", gen->d.ia5->data); + BIO_printf(out, "URI:"); + ASN1_STRING_print(out, gen->d.ia5); break; case GEN_DIRNAME: @@ -261,7 +267,7 @@ static GENERAL_NAMES *v2i_issuer_alt(X509V3_EXT_METHOD *method, } for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { cnf = sk_CONF_VALUE_value(nval, i); - if (!name_cmp(cnf->name, "issuer") && cnf->value && + if (!x509v3_name_cmp(cnf->name, "issuer") && cnf->value && !strcmp(cnf->value, "copy")) { if (!copy_issuer(ctx, gens)) goto err; @@ -331,11 +337,11 @@ static GENERAL_NAMES *v2i_subject_alt(X509V3_EXT_METHOD *method, } for (i = 0; i < sk_CONF_VALUE_num(nval); i++) { cnf = sk_CONF_VALUE_value(nval, i); - if (!name_cmp(cnf->name, "email") && cnf->value && + if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && !strcmp(cnf->value, "copy")) { if (!copy_email(ctx, gens, 0)) goto err; - } else if (!name_cmp(cnf->name, "email") && cnf->value && + } else if (!x509v3_name_cmp(cnf->name, "email") && cnf->value && !strcmp(cnf->value, "move")) { if (!copy_email(ctx, gens, 1)) goto err; @@ -545,19 +551,19 @@ GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, return NULL; } - if (!name_cmp(name, "email")) + if (!x509v3_name_cmp(name, "email")) type = GEN_EMAIL; - else if (!name_cmp(name, "URI")) + else if (!x509v3_name_cmp(name, "URI")) type = GEN_URI; - else if (!name_cmp(name, "DNS")) + else if (!x509v3_name_cmp(name, "DNS")) type = GEN_DNS; - else if (!name_cmp(name, "RID")) + else if (!x509v3_name_cmp(name, "RID")) type = GEN_RID; - else if (!name_cmp(name, "IP")) + else if (!x509v3_name_cmp(name, "IP")) type = GEN_IPADD; - else if (!name_cmp(name, "dirName")) + else if (!x509v3_name_cmp(name, "dirName")) type = GEN_DIRNAME; - else if (!name_cmp(name, "otherName")) + else if (!x509v3_name_cmp(name, "otherName")) type = GEN_OTHERNAME; else { OPENSSL_PUT_ERROR(X509V3, X509V3_R_UNSUPPORTED_OPTION); @@ -588,7 +594,7 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) objtmp = OPENSSL_malloc(objlen + 1); if (objtmp == NULL) return 0; - BUF_strlcpy(objtmp, value, objlen + 1); + OPENSSL_strlcpy(objtmp, value, objlen + 1); gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); OPENSSL_free(objtmp); if (!gen->d.otherName->type_id) diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_bcons.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_bcons.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_bcons.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_bcons.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bcons.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_bitst.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_bitst.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_bitst.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_bitst.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_bitst.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_conf.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_conf.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c index e6a43322a..c346ad23b 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_conf.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c @@ -69,6 +69,7 @@ #include #include "../internal.h" +#include "internal.h" static int v3_check_critical(char **value); static int v3_check_generic(char **value); @@ -278,7 +279,7 @@ static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, } if (gen_type == 1) - ext_der = string_to_hex(value, &ext_len); + ext_der = x509v3_hex_to_bytes(value, &ext_len); else if (gen_type == 2) ext_der = generic_asn1(value, ctx, &ext_len); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_conf.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_conf.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c.grpc_back index ff2eae141..e98d0fcdc 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_conf.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_conf.c.grpc_back @@ -69,6 +69,7 @@ #include #include "../internal.h" +#include "internal.h" static int v3_check_critical(char **value); static int v3_check_generic(char **value); @@ -278,7 +279,7 @@ static X509_EXTENSION *v3_generic_extension(const char *ext, char *value, } if (gen_type == 1) - ext_der = string_to_hex(value, &ext_len); + ext_der = x509v3_hex_to_bytes(value, &ext_len); else if (gen_type == 2) ext_der = generic_asn1(value, ctx, &ext_len); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_cpols.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_cpols.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c index d6aa391ad..c20b57e64 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_cpols.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c @@ -69,6 +69,7 @@ #include #include +#include "internal.h" #include "pcy_int.h" /* Certificate policies extension support: this one is a bit complex... */ @@ -231,7 +232,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx, } pol->policyid = pobj; - } else if (!name_cmp(cnf->name, "CPS")) { + } else if (!x509v3_name_cmp(cnf->name, "CPS")) { if (!pol->qualifiers) pol->qualifiers = sk_POLICYQUALINFO_new_null(); if (!(qual = POLICYQUALINFO_new())) @@ -251,7 +252,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx, if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value, strlen(cnf->value))) goto merr; - } else if (!name_cmp(cnf->name, "userNotice")) { + } else if (!x509v3_name_cmp(cnf->name, "userNotice")) { STACK_OF(CONF_VALUE) *unot; if (*cnf->value != '@') { OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXPECTED_A_SECTION_NAME); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_cpols.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_cpols.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c.grpc_back index 4def530ab..18d260b56 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_cpols.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_cpols.c.grpc_back @@ -69,6 +69,7 @@ #include #include +#include "internal.h" #include "pcy_int.h" /* Certificate policies extension support: this one is a bit complex... */ @@ -231,7 +232,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx, } pol->policyid = pobj; - } else if (!name_cmp(cnf->name, "CPS")) { + } else if (!x509v3_name_cmp(cnf->name, "CPS")) { if (!pol->qualifiers) pol->qualifiers = sk_POLICYQUALINFO_new_null(); if (!(qual = POLICYQUALINFO_new())) @@ -251,7 +252,7 @@ static POLICYINFO *policy_section(X509V3_CTX *ctx, if (!ASN1_STRING_set(qual->d.cpsuri, cnf->value, strlen(cnf->value))) goto merr; - } else if (!name_cmp(cnf->name, "userNotice")) { + } else if (!x509v3_name_cmp(cnf->name, "userNotice")) { STACK_OF(CONF_VALUE) *unot; if (*cnf->value != '@') { OPENSSL_PUT_ERROR(X509V3, X509V3_R_EXPECTED_A_SECTION_NAME); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_crld.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_crld.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_crld.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_crld.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_crld.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_enum.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_enum.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c index 8595eb3bf..8f3c31f47 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_enum.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c @@ -57,8 +57,8 @@ #include -#include #include +#include #include static const ENUMERATED_NAMES crl_reasons[] = { @@ -94,7 +94,7 @@ char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *e) strval = ASN1_ENUMERATED_get(e); for (enam = method->usr_data; enam->lname; enam++) { if (strval == enam->bitnum) - return BUF_strdup(enam->lname); + return OPENSSL_strdup(enam->lname); } return i2s_ASN1_ENUMERATED(method, e); } diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_enum.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_enum.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c.grpc_back index 6bfb232c5..eff77e875 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_enum.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_enum.c.grpc_back @@ -57,8 +57,8 @@ #include -#include #include +#include #include static const ENUMERATED_NAMES crl_reasons[] = { @@ -94,7 +94,7 @@ char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, ASN1_ENUMERATED *e) strval = ASN1_ENUMERATED_get(e); for (enam = method->usr_data; enam->lname; enam++) { if (strval == enam->bitnum) - return BUF_strdup(enam->lname); + return OPENSSL_strdup(enam->lname); } return i2s_ASN1_ENUMERATED(method, e); } diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_extku.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_extku.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_extku.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_extku.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_extku.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_genn.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_genn.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c index 8a85cb881..ef503ce6f 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_genn.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c @@ -100,12 +100,7 @@ ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) -GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a) -{ - return (GENERAL_NAME *)ASN1_dup((i2d_of_void *)i2d_GENERAL_NAME, - (d2i_of_void *)d2i_GENERAL_NAME, - (char *)a); -} +IMPLEMENT_ASN1_DUP_FUNCTION(GENERAL_NAME) /* Returns 0 if they are equal, != 0 otherwise. */ int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_genn.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_genn.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c.grpc_back index 8c926879e..552a52443 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_genn.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_genn.c.grpc_back @@ -100,12 +100,7 @@ ASN1_ITEM_TEMPLATE_END(GENERAL_NAMES) IMPLEMENT_ASN1_FUNCTIONS(GENERAL_NAMES) -GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a) -{ - return (GENERAL_NAME *)ASN1_dup((i2d_of_void *)i2d_GENERAL_NAME, - (d2i_of_void *)d2i_GENERAL_NAME, - (char *)a); -} +IMPLEMENT_ASN1_DUP_FUNCTION(GENERAL_NAME) /* Returns 0 if they are equal, != 0 otherwise. */ int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b) diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_ia5.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_ia5.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_ia5.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_ia5.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ia5.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_info.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_info.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c index 7e9a28a2f..e566892dd 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_info.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c @@ -62,7 +62,6 @@ #include #include -#include #include #include #include @@ -137,9 +136,9 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( ntmp = OPENSSL_malloc(nlen); if (ntmp == NULL) goto err; - BUF_strlcpy(ntmp, objtmp, nlen); - BUF_strlcat(ntmp, " - ", nlen); - BUF_strlcat(ntmp, vtmp->name, nlen); + OPENSSL_strlcpy(ntmp, objtmp, nlen); + OPENSSL_strlcat(ntmp, " - ", nlen); + OPENSSL_strlcat(ntmp, vtmp->name, nlen); OPENSSL_free(vtmp->name); vtmp->name = ntmp; @@ -192,7 +191,7 @@ static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); goto err; } - BUF_strlcpy(objtmp, cnf->name, objlen + 1); + OPENSSL_strlcpy(objtmp, cnf->name, objlen + 1); acc->method = OBJ_txt2obj(objtmp, 0); if (!acc->method) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_info.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_info.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c.grpc_back index ff96489e4..7a48bd554 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_info.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_info.c.grpc_back @@ -62,7 +62,6 @@ #include #include -#include #include #include #include @@ -137,9 +136,9 @@ static STACK_OF(CONF_VALUE) *i2v_AUTHORITY_INFO_ACCESS( ntmp = OPENSSL_malloc(nlen); if (ntmp == NULL) goto err; - BUF_strlcpy(ntmp, objtmp, nlen); - BUF_strlcat(ntmp, " - ", nlen); - BUF_strlcat(ntmp, vtmp->name, nlen); + OPENSSL_strlcpy(ntmp, objtmp, nlen); + OPENSSL_strlcat(ntmp, " - ", nlen); + OPENSSL_strlcat(ntmp, vtmp->name, nlen); OPENSSL_free(vtmp->name); vtmp->name = ntmp; @@ -192,7 +191,7 @@ static AUTHORITY_INFO_ACCESS *v2i_AUTHORITY_INFO_ACCESS(X509V3_EXT_METHOD OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); goto err; } - BUF_strlcpy(objtmp, cnf->name, objlen + 1); + OPENSSL_strlcpy(objtmp, cnf->name, objlen + 1); acc->method = OBJ_txt2obj(objtmp, 0); if (!acc->method) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_BAD_OBJECT); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_int.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_int.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_int.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_int.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_int.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_lib.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_lib.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c index 24dfc3f60..262521a5a 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_lib.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c @@ -116,6 +116,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) if (!ext_list) return NULL; + sk_X509V3_EXT_METHOD_sort(ext_list); if (!sk_X509V3_EXT_METHOD_find(ext_list, &idx, &tmp)) return NULL; return sk_X509V3_EXT_METHOD_value(ext_list, idx); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_lib.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_lib.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c.grpc_back index 8f5435d70..d5eda3dd3 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_lib.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_lib.c.grpc_back @@ -116,6 +116,7 @@ const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid) if (!ext_list) return NULL; + sk_X509V3_EXT_METHOD_sort(ext_list); if (!sk_X509V3_EXT_METHOD_find(ext_list, &idx, &tmp)) return NULL; return sk_X509V3_EXT_METHOD_value(ext_list, idx); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_ncons.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_ncons.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_ncons.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_ncons.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ncons.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c new file mode 100644 index 000000000..b3bdee361 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c @@ -0,0 +1,68 @@ +/* + * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#include +#include +#include + +/* + * OCSP extensions and a couple of CRL entry extensions + */ + +static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce, + BIO *out, int indent); + +static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, + void *nocheck, BIO *out, int indent); +static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); + +const X509V3_EXT_METHOD v3_crl_invdate = { + NID_invalidity_date, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME), + 0, 0, 0, 0, + 0, 0, + 0, 0, + i2r_ocsp_acutoff, 0, + NULL +}; + +const X509V3_EXT_METHOD v3_ocsp_nocheck = { + NID_id_pkix_OCSP_noCheck, 0, ASN1_ITEM_ref(ASN1_NULL), + 0, 0, 0, 0, + 0, s2i_ocsp_nocheck, + 0, 0, + i2r_ocsp_nocheck, 0, + NULL +}; + +static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff, + BIO *bp, int ind) +{ + if (BIO_printf(bp, "%*s", ind, "") <= 0) + return 0; + if (!ASN1_GENERALIZEDTIME_print(bp, cutoff)) + return 0; + return 1; +} + +/* Nocheck is just a single NULL. Don't print anything and always set it */ + +static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck, + BIO *out, int indent) +{ + return 1; +} + +static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str) +{ + return ASN1_NULL_new(); +} diff --git a/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c.grpc_back new file mode 100644 index 000000000..c63646a29 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_ocsp.c.grpc_back @@ -0,0 +1,68 @@ +/* + * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include + +#include +#include +#include + +/* + * OCSP extensions and a couple of CRL entry extensions + */ + +static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *nonce, + BIO *out, int indent); + +static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, + void *nocheck, BIO *out, int indent); +static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str); + +const X509V3_EXT_METHOD v3_crl_invdate = { + NID_invalidity_date, 0, ASN1_ITEM_ref(ASN1_GENERALIZEDTIME), + 0, 0, 0, 0, + 0, 0, + 0, 0, + i2r_ocsp_acutoff, 0, + NULL +}; + +const X509V3_EXT_METHOD v3_ocsp_nocheck = { + NID_id_pkix_OCSP_noCheck, 0, ASN1_ITEM_ref(ASN1_NULL), + 0, 0, 0, 0, + 0, s2i_ocsp_nocheck, + 0, 0, + i2r_ocsp_nocheck, 0, + NULL +}; + +static int i2r_ocsp_acutoff(const X509V3_EXT_METHOD *method, void *cutoff, + BIO *bp, int ind) +{ + if (BIO_printf(bp, "%*s", ind, "") <= 0) + return 0; + if (!ASN1_GENERALIZEDTIME_print(bp, cutoff)) + return 0; + return 1; +} + +/* Nocheck is just a single NULL. Don't print anything and always set it */ + +static int i2r_ocsp_nocheck(const X509V3_EXT_METHOD *method, void *nocheck, + BIO *out, int indent) +{ + return 1; +} + +static void *s2i_ocsp_nocheck(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, const char *str) +{ + return ASN1_NULL_new(); +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pci.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pci.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c index 8bef4024e..9aedb25eb 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pci.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c @@ -44,6 +44,7 @@ #include #include "../internal.h" +#include "internal.h" static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, @@ -123,7 +124,7 @@ static int process_pci_value(CONF_VALUE *val, } if (strncmp(val->value, "hex:", 4) == 0) { unsigned char *tmp_data2 = - string_to_hex(val->value + 4, &val_len); + x509v3_hex_to_bytes(val->value + 4, &val_len); if (!tmp_data2) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_HEX_DIGIT); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pci.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pci.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c.grpc_back index 4352abee3..f9031c04a 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pci.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pci.c.grpc_back @@ -44,6 +44,7 @@ #include #include "../internal.h" +#include "internal.h" static int i2r_pci(X509V3_EXT_METHOD *method, PROXY_CERT_INFO_EXTENSION *ext, @@ -123,7 +124,7 @@ static int process_pci_value(CONF_VALUE *val, } if (strncmp(val->value, "hex:", 4) == 0) { unsigned char *tmp_data2 = - string_to_hex(val->value + 4, &val_len); + x509v3_hex_to_bytes(val->value + 4, &val_len); if (!tmp_data2) { OPENSSL_PUT_ERROR(X509V3, X509V3_R_ILLEGAL_HEX_DIGIT); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcia.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcia.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcia.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcia.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcia.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcons.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcons.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcons.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pcons.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pcons.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pku.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pku.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pku.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pku.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pku.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pmaps.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pmaps.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_pmaps.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_pmaps.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_pmaps.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_prn.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_prn.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_prn.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_prn.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_prn.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_purp.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_purp.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c index aae566afe..deaf58646 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_purp.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c @@ -59,7 +59,6 @@ #include -#include #include #include #include @@ -80,7 +79,6 @@ static void x509v3_cache_extensions(X509 *x); -static int check_ssl_ca(const X509 *x); static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca); static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, @@ -205,6 +203,7 @@ int X509_PURPOSE_get_by_id(int purpose) if (!xptable) return -1; + sk_X509_PURPOSE_sort(xptable); if (!sk_X509_PURPOSE_find(xptable, &idx, &tmp)) return -1; return idx + X509_PURPOSE_COUNT; @@ -237,8 +236,8 @@ int X509_PURPOSE_add(int id, int trust, int flags, ptmp = X509_PURPOSE_get0(idx); /* Duplicate the supplied names. */ - name_dup = BUF_strdup(name); - sname_dup = BUF_strdup(sname); + name_dup = OPENSSL_strdup(name); + sname_dup = OPENSSL_strdup(sname); if (name_dup == NULL || sname_dup == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); if (name_dup != NULL) @@ -562,39 +561,20 @@ static void x509v3_cache_extensions(X509 *x) CRYPTO_MUTEX_unlock_write(&x->lock); } -/* - * CA checks common to all purposes return codes: 0 not a CA 1 is a CA 2 - * basicConstraints absent so "maybe" a CA 3 basicConstraints absent but self - * signed V1. 4 basicConstraints absent but keyUsage present and keyCertSign - * asserted. - */ - +/* check_ca returns one if |x| should be considered a CA certificate and zero + * otherwise. */ static int check_ca(const X509 *x) { /* keyUsage if present should allow cert signing */ if (ku_reject(x, KU_KEY_CERT_SIGN)) return 0; - if (x->ex_flags & EXFLAG_BCONS) { - if (x->ex_flags & EXFLAG_CA) - return 1; - /* If basicConstraints says not a CA then say so */ - else - return 0; - } else { - /* we support V1 roots for... uh, I don't really know why. */ - if ((x->ex_flags & V1_ROOT) == V1_ROOT) - return 3; - /* - * If key usage present it must have certSign so tolerate it - */ - else if (x->ex_flags & EXFLAG_KUSAGE) - return 4; - /* Older certificates could have Netscape-specific CA types */ - else if (x->ex_flags & EXFLAG_NSCERT && x->ex_nscert & NS_ANY_CA) - return 5; - /* can this still be regarded a CA certificate? I doubt it */ - return 0; + /* Version 1 certificates are considered CAs and don't have extensions. */ + if ((x->ex_flags & V1_ROOT) == V1_ROOT) { + return 1; } + /* Otherwise, it's only a CA if basicConstraints says so. */ + return ((x->ex_flags & EXFLAG_BCONS) && + (x->ex_flags & EXFLAG_CA)); } int X509_check_ca(X509 *x) @@ -603,27 +583,13 @@ int X509_check_ca(X509 *x) return check_ca(x); } -/* Check SSL CA: common checks for SSL client and server */ -static int check_ssl_ca(const X509 *x) -{ - int ca_ret; - ca_ret = check_ca(x); - if (!ca_ret) - return 0; - /* check nsCertType if present */ - if (ca_ret != 5 || x->ex_nscert & NS_SSL_CA) - return ca_ret; - else - return 0; -} - static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca) { if (xku_reject(x, XKU_SSL_CLIENT)) return 0; if (ca) - return check_ssl_ca(x); + return check_ca(x); /* We need to do digital signatures or key agreement */ if (ku_reject(x, KU_DIGITAL_SIGNATURE | KU_KEY_AGREEMENT)) return 0; @@ -644,10 +610,10 @@ static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, int ca) { - if (xku_reject(x, XKU_SSL_SERVER | XKU_SGC)) + if (xku_reject(x, XKU_SSL_SERVER)) return 0; if (ca) - return check_ssl_ca(x); + return check_ca(x); if (ns_reject(x, NS_SSL_SERVER)) return 0; @@ -671,29 +637,23 @@ static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, return ret; } -/* common S/MIME checks */ +/* purpose_smime returns one if |x| is a valid S/MIME leaf (|ca| is zero) or CA + * (|ca| is one) certificate, and zero otherwise. */ static int purpose_smime(const X509 *x, int ca) { if (xku_reject(x, XKU_SMIME)) return 0; if (ca) { - int ca_ret; - ca_ret = check_ca(x); - if (!ca_ret) - return 0; /* check nsCertType if present */ - if (ca_ret != 5 || x->ex_nscert & NS_SMIME_CA) - return ca_ret; - else - return 0; + if ((x->ex_flags & EXFLAG_NSCERT) && + (x->ex_nscert & NS_SMIME_CA) == 0) { + return 0; + } + + return check_ca(x); } if (x->ex_flags & EXFLAG_NSCERT) { - if (x->ex_nscert & NS_SMIME) - return 1; - /* Workaround for some buggy certificates */ - if (x->ex_nscert & NS_SSL_CLIENT) - return 2; - return 0; + return (x->ex_nscert & NS_SMIME) == NS_SMIME; } return 1; } @@ -726,11 +686,7 @@ static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca) { if (ca) { - int ca_ret; - if ((ca_ret = check_ca(x)) != 2) - return ca_ret; - else - return 0; + return check_ca(x); } if (ku_reject(x, KU_CRL_SIGN)) return 0; @@ -744,10 +700,6 @@ static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca) { - /* - * Must be a valid CA. Should we really support the "I don't know" value - * (2)? - */ if (ca) return check_ca(x); /* leaf certificate is checked in OCSP_verify() */ @@ -864,3 +816,28 @@ int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) } return X509_V_OK; } + +uint32_t X509_get_extension_flags(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + return x->ex_flags; +} + +uint32_t X509_get_key_usage(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + if (x->ex_flags & EXFLAG_KUSAGE) + return x->ex_kusage; + return UINT32_MAX; +} + +uint32_t X509_get_extended_key_usage(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + if (x->ex_flags & EXFLAG_XKUSAGE) + return x->ex_xkusage; + return UINT32_MAX; +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_purp.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_purp.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c.grpc_back index 324de85a0..d9d105e80 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_purp.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_purp.c.grpc_back @@ -59,7 +59,6 @@ #include -#include #include #include #include @@ -80,7 +79,6 @@ static void x509v3_cache_extensions(X509 *x); -static int check_ssl_ca(const X509 *x); static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca); static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, @@ -205,6 +203,7 @@ int X509_PURPOSE_get_by_id(int purpose) if (!xptable) return -1; + sk_X509_PURPOSE_sort(xptable); if (!sk_X509_PURPOSE_find(xptable, &idx, &tmp)) return -1; return idx + X509_PURPOSE_COUNT; @@ -237,8 +236,8 @@ int X509_PURPOSE_add(int id, int trust, int flags, ptmp = X509_PURPOSE_get0(idx); /* Duplicate the supplied names. */ - name_dup = BUF_strdup(name); - sname_dup = BUF_strdup(sname); + name_dup = OPENSSL_strdup(name); + sname_dup = OPENSSL_strdup(sname); if (name_dup == NULL || sname_dup == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); if (name_dup != NULL) @@ -562,39 +561,20 @@ static void x509v3_cache_extensions(X509 *x) CRYPTO_MUTEX_unlock_write(&x->lock); } -/* - * CA checks common to all purposes return codes: 0 not a CA 1 is a CA 2 - * basicConstraints absent so "maybe" a CA 3 basicConstraints absent but self - * signed V1. 4 basicConstraints absent but keyUsage present and keyCertSign - * asserted. - */ - +/* check_ca returns one if |x| should be considered a CA certificate and zero + * otherwise. */ static int check_ca(const X509 *x) { /* keyUsage if present should allow cert signing */ if (ku_reject(x, KU_KEY_CERT_SIGN)) return 0; - if (x->ex_flags & EXFLAG_BCONS) { - if (x->ex_flags & EXFLAG_CA) - return 1; - /* If basicConstraints says not a CA then say so */ - else - return 0; - } else { - /* we support V1 roots for... uh, I don't really know why. */ - if ((x->ex_flags & V1_ROOT) == V1_ROOT) - return 3; - /* - * If key usage present it must have certSign so tolerate it - */ - else if (x->ex_flags & EXFLAG_KUSAGE) - return 4; - /* Older certificates could have Netscape-specific CA types */ - else if (x->ex_flags & EXFLAG_NSCERT && x->ex_nscert & NS_ANY_CA) - return 5; - /* can this still be regarded a CA certificate? I doubt it */ - return 0; + /* Version 1 certificates are considered CAs and don't have extensions. */ + if ((x->ex_flags & V1_ROOT) == V1_ROOT) { + return 1; } + /* Otherwise, it's only a CA if basicConstraints says so. */ + return ((x->ex_flags & EXFLAG_BCONS) && + (x->ex_flags & EXFLAG_CA)); } int X509_check_ca(X509 *x) @@ -603,27 +583,13 @@ int X509_check_ca(X509 *x) return check_ca(x); } -/* Check SSL CA: common checks for SSL client and server */ -static int check_ssl_ca(const X509 *x) -{ - int ca_ret; - ca_ret = check_ca(x); - if (!ca_ret) - return 0; - /* check nsCertType if present */ - if (ca_ret != 5 || x->ex_nscert & NS_SSL_CA) - return ca_ret; - else - return 0; -} - static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, int ca) { if (xku_reject(x, XKU_SSL_CLIENT)) return 0; if (ca) - return check_ssl_ca(x); + return check_ca(x); /* We need to do digital signatures or key agreement */ if (ku_reject(x, KU_DIGITAL_SIGNATURE | KU_KEY_AGREEMENT)) return 0; @@ -644,10 +610,10 @@ static int check_purpose_ssl_client(const X509_PURPOSE *xp, const X509 *x, static int check_purpose_ssl_server(const X509_PURPOSE *xp, const X509 *x, int ca) { - if (xku_reject(x, XKU_SSL_SERVER | XKU_SGC)) + if (xku_reject(x, XKU_SSL_SERVER)) return 0; if (ca) - return check_ssl_ca(x); + return check_ca(x); if (ns_reject(x, NS_SSL_SERVER)) return 0; @@ -671,29 +637,23 @@ static int check_purpose_ns_ssl_server(const X509_PURPOSE *xp, const X509 *x, return ret; } -/* common S/MIME checks */ +/* purpose_smime returns one if |x| is a valid S/MIME leaf (|ca| is zero) or CA + * (|ca| is one) certificate, and zero otherwise. */ static int purpose_smime(const X509 *x, int ca) { if (xku_reject(x, XKU_SMIME)) return 0; if (ca) { - int ca_ret; - ca_ret = check_ca(x); - if (!ca_ret) - return 0; /* check nsCertType if present */ - if (ca_ret != 5 || x->ex_nscert & NS_SMIME_CA) - return ca_ret; - else - return 0; + if ((x->ex_flags & EXFLAG_NSCERT) && + (x->ex_nscert & NS_SMIME_CA) == 0) { + return 0; + } + + return check_ca(x); } if (x->ex_flags & EXFLAG_NSCERT) { - if (x->ex_nscert & NS_SMIME) - return 1; - /* Workaround for some buggy certificates */ - if (x->ex_nscert & NS_SSL_CLIENT) - return 2; - return 0; + return (x->ex_nscert & NS_SMIME) == NS_SMIME; } return 1; } @@ -726,11 +686,7 @@ static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, int ca) { if (ca) { - int ca_ret; - if ((ca_ret = check_ca(x)) != 2) - return ca_ret; - else - return 0; + return check_ca(x); } if (ku_reject(x, KU_CRL_SIGN)) return 0; @@ -744,10 +700,6 @@ static int check_purpose_crl_sign(const X509_PURPOSE *xp, const X509 *x, static int ocsp_helper(const X509_PURPOSE *xp, const X509 *x, int ca) { - /* - * Must be a valid CA. Should we really support the "I don't know" value - * (2)? - */ if (ca) return check_ca(x); /* leaf certificate is checked in OCSP_verify() */ @@ -864,3 +816,28 @@ int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid) } return X509_V_OK; } + +uint32_t X509_get_extension_flags(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + return x->ex_flags; +} + +uint32_t X509_get_key_usage(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + if (x->ex_flags & EXFLAG_KUSAGE) + return x->ex_kusage; + return UINT32_MAX; +} + +uint32_t X509_get_extended_key_usage(X509 *x) +{ + /* Call for side-effect of computing hash and caching extensions */ + X509_check_purpose(x, -1, -1); + if (x->ex_flags & EXFLAG_XKUSAGE) + return x->ex_xkusage; + return UINT32_MAX; +} diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_skey.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_skey.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c index a8830b599..ffb41980b 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_skey.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c @@ -63,6 +63,9 @@ #include #include +#include "internal.h" + + static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); const X509V3_EXT_METHOD v3_skey_id = { @@ -76,7 +79,7 @@ const X509V3_EXT_METHOD v3_skey_id = { char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct) { - return hex_to_string(oct->data, oct->length); + return x509v3_bytes_to_hex(oct->data, oct->length); } ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, @@ -90,7 +93,7 @@ ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, return NULL; } - if (!(oct->data = string_to_hex(str, &length))) { + if (!(oct->data = x509v3_hex_to_bytes(str, &length))) { M_ASN1_OCTET_STRING_free(oct); return NULL; } diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_skey.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_skey.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c.grpc_back index 65f8287c1..6a16e78ef 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_skey.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_skey.c.grpc_back @@ -63,6 +63,9 @@ #include #include +#include "internal.h" + + static ASN1_OCTET_STRING *s2i_skey_id(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); const X509V3_EXT_METHOD v3_skey_id = { @@ -76,7 +79,7 @@ const X509V3_EXT_METHOD v3_skey_id = { char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *oct) { - return hex_to_string(oct->data, oct->length); + return x509v3_bytes_to_hex(oct->data, oct->length); } ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, @@ -90,7 +93,7 @@ ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, return NULL; } - if (!(oct->data = string_to_hex(str, &length))) { + if (!(oct->data = x509v3_hex_to_bytes(str, &length))) { M_ASN1_OCTET_STRING_free(oct); return NULL; } diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_sxnet.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_sxnet.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_sxnet.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_sxnet.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_sxnet.c.grpc_back diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_utl.c b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_utl.c rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c index 55d97bf7b..3f8a00c25 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_utl.c +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c @@ -63,7 +63,6 @@ #include #include -#include #include #include #include @@ -72,6 +71,7 @@ #include "../conf/internal.h" #include "../internal.h" +#include "internal.h" static char *strip_spaces(char *name); @@ -93,9 +93,9 @@ int X509V3_add_value(const char *name, const char *value, { CONF_VALUE *vtmp = NULL; char *tname = NULL, *tvalue = NULL; - if (name && !(tname = BUF_strdup(name))) + if (name && !(tname = OPENSSL_strdup(name))) goto err; - if (value && !(tvalue = BUF_strdup(value))) + if (value && !(tvalue = OPENSSL_strdup(value))) goto err; if (!(vtmp = CONF_VALUE_new())) goto err; @@ -184,11 +184,11 @@ static char *bignum_to_string(const BIGNUM *bn) /* Prepend "0x", but place it after the "-" if negative. */ if (tmp[0] == '-') { - BUF_strlcpy(ret, "-0x", len); - BUF_strlcat(ret, tmp + 1, len); + OPENSSL_strlcpy(ret, "-0x", len); + OPENSSL_strlcat(ret, tmp + 1, len); } else { - BUF_strlcpy(ret, "0x", len); - BUF_strlcat(ret, tmp, len); + OPENSSL_strlcpy(ret, "0x", len); + OPENSSL_strlcat(ret, tmp, len); } OPENSSL_free(tmp); return ret; @@ -330,7 +330,7 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line) char *linebuf; int state; /* We are going to modify the line so copy it first */ - linebuf = BUF_strdup(line); + linebuf = OPENSSL_strdup(line); if (linebuf == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); goto err; @@ -446,7 +446,7 @@ static char *strip_spaces(char *name) * on EBCDIC machines) */ -char *hex_to_string(const unsigned char *buffer, long len) +char *x509v3_bytes_to_hex(const unsigned char *buffer, long len) { char *tmp, *q; const unsigned char *p; @@ -469,11 +469,7 @@ char *hex_to_string(const unsigned char *buffer, long len) return tmp; } -/* - * Give a string of hex digits convert to a buffer - */ - -unsigned char *string_to_hex(const char *str, long *len) +unsigned char *x509v3_hex_to_bytes(const char *str, long *len) { unsigned char *hexbuf, *q; unsigned char ch, cl, *p; @@ -533,11 +529,7 @@ unsigned char *string_to_hex(const char *str, long *len) } -/* - * V2I name comparison function: returns zero if 'name' matches cmp or cmp.* - */ - -int name_cmp(const char *name, const char *cmp) +int x509v3_name_cmp(const char *name, const char *cmp) { int len, ret; char c; @@ -650,9 +642,10 @@ static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) if (!*sk) return 0; /* Don't add duplicates */ + sk_OPENSSL_STRING_sort(*sk); if (sk_OPENSSL_STRING_find(*sk, NULL, (char *)email->data)) return 1; - emtmp = BUF_strdup((char *)email->data); + emtmp = OPENSSL_strdup((char *)email->data); if (!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { X509_email_free(*sk); *sk = NULL; @@ -915,6 +908,53 @@ static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, subject, subject_len, flags); } +int x509v3_looks_like_dns_name(const unsigned char *in, size_t len) { + /* This function is used as a heuristic for whether a common name is a + * hostname to be matched, or merely a decorative name to describe the + * subject. This heuristic must be applied to both name constraints and the + * common name fallback, so it must be loose enough to accept hostname + * common names, and tight enough to reject decorative common names. */ + + if (len > 0 && in[len - 1] == '.') { + len--; + } + + /* Wildcards are allowed in front. */ + if (len >= 2 && in[0] == '*' && in[1] == '.') { + in += 2; + len -= 2; + } + + if (len == 0) { + return 0; + } + + size_t label_start = 0; + for (size_t i = 0; i < len; i++) { + unsigned char c = in[i]; + if ((c >= 'a' && c <= 'z') || + (c >= '0' && c <= '9') || + (c >= 'A' && c <= 'Z') || + (c == '-' && i > label_start) || + /* These are not valid characters in hostnames, but commonly found + * in deployments outside the Web PKI. */ + c == '_' || + c == ':') { + continue; + } + + /* Labels must not be empty. */ + if (c == '.' && i > label_start && i < len - 1) { + label_start = i + 1; + continue; + } + + return 0; + } + + return 1; +} + /* * Compare an ASN1_STRING to a supplied string. If they match return 1. If * cmp_type > 0 only compare if string matches the type, otherwise convert it @@ -922,8 +962,8 @@ static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, */ static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, - unsigned int flags, const char *b, size_t blen, - char **peername) + unsigned int flags, int check_type, const char *b, + size_t blen, char **peername) { int rv = 0; @@ -937,16 +977,26 @@ static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, else if (a->length == (int)blen && !OPENSSL_memcmp(a->data, b, blen)) rv = 1; if (rv > 0 && peername) - *peername = BUF_strndup((char *)a->data, a->length); + *peername = OPENSSL_strndup((char *)a->data, a->length); } else { int astrlen; unsigned char *astr; astrlen = ASN1_STRING_to_UTF8(&astr, a); if (astrlen < 0) return -1; - rv = equal(astr, astrlen, (unsigned char *)b, blen, flags); + /* + * We check the common name against DNS name constraints if it passes + * |x509v3_looks_like_dns_name|. Thus we must not consider common names + * for DNS fallbacks if they fail this check. + */ + if (check_type == GEN_DNS && + !x509v3_looks_like_dns_name(astr, astrlen)) { + rv = 0; + } else { + rv = equal(astr, astrlen, (unsigned char *)b, blen, flags); + } if (rv > 0 && peername) - *peername = BUF_strndup((char *)astr, astrlen); + *peername = OPENSSL_strndup((char *)astr, astrlen); OPENSSL_free(astr); } return rv; @@ -961,7 +1011,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, int j; int cnid = NID_undef; int alt_type; - int san_present = 0; int rv = 0; equal_fn equal; @@ -994,7 +1043,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, gen = sk_GENERAL_NAME_value(gens, i); if (gen->type != check_type) continue; - san_present = 1; if (check_type == GEN_EMAIL) cstr = gen->d.rfc822Name; else if (check_type == GEN_DNS) @@ -1002,21 +1050,16 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, else cstr = gen->d.iPAddress; /* Positive on success, negative on error! */ - if ((rv = do_check_string(cstr, alt_type, equal, flags, + if ((rv = do_check_string(cstr, alt_type, equal, flags, check_type, chk, chklen, peername)) != 0) break; } GENERAL_NAMES_free(gens); - if (rv != 0) - return rv; - if (cnid == NID_undef - || (san_present - && !(flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT))) - return 0; + return rv; } /* We're done if CN-ID is not pertinent */ - if (cnid == NID_undef) + if (cnid == NID_undef || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT)) return 0; j = -1; @@ -1027,7 +1070,7 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, ne = X509_NAME_get_entry(name, j); str = X509_NAME_ENTRY_get_data(ne); /* Positive on success, negative on error! */ - if ((rv = do_check_string(str, -1, equal, flags, + if ((rv = do_check_string(str, -1, equal, flags, check_type, chk, chklen, peername)) != 0) return rv; } @@ -1112,7 +1155,7 @@ ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc) p = strchr(ipasc, '/'); if (!p) return NULL; - iptmp = BUF_strdup(ipasc); + iptmp = OPENSSL_strdup(ipasc); if (!iptmp) return NULL; p = iptmp + (p - ipasc); diff --git a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_utl.c.grpc_back b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/crypto/x509v3/v3_utl.c.grpc_back rename to Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c.grpc_back index 7d109ee6e..9138ef759 100644 --- a/Pods/BoringSSL-GRPC/crypto/x509v3/v3_utl.c.grpc_back +++ b/Pods/BoringSSL-GRPC/src/crypto/x509v3/v3_utl.c.grpc_back @@ -63,7 +63,6 @@ #include #include -#include #include #include #include @@ -72,6 +71,7 @@ #include "../conf/internal.h" #include "../internal.h" +#include "internal.h" static char *strip_spaces(char *name); @@ -93,9 +93,9 @@ int X509V3_add_value(const char *name, const char *value, { CONF_VALUE *vtmp = NULL; char *tname = NULL, *tvalue = NULL; - if (name && !(tname = BUF_strdup(name))) + if (name && !(tname = OPENSSL_strdup(name))) goto err; - if (value && !(tvalue = BUF_strdup(value))) + if (value && !(tvalue = OPENSSL_strdup(value))) goto err; if (!(vtmp = CONF_VALUE_new())) goto err; @@ -184,11 +184,11 @@ static char *bignum_to_string(const BIGNUM *bn) /* Prepend "0x", but place it after the "-" if negative. */ if (tmp[0] == '-') { - BUF_strlcpy(ret, "-0x", len); - BUF_strlcat(ret, tmp + 1, len); + OPENSSL_strlcpy(ret, "-0x", len); + OPENSSL_strlcat(ret, tmp + 1, len); } else { - BUF_strlcpy(ret, "0x", len); - BUF_strlcat(ret, tmp, len); + OPENSSL_strlcpy(ret, "0x", len); + OPENSSL_strlcat(ret, tmp, len); } OPENSSL_free(tmp); return ret; @@ -330,7 +330,7 @@ STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line) char *linebuf; int state; /* We are going to modify the line so copy it first */ - linebuf = BUF_strdup(line); + linebuf = OPENSSL_strdup(line); if (linebuf == NULL) { OPENSSL_PUT_ERROR(X509V3, ERR_R_MALLOC_FAILURE); goto err; @@ -446,7 +446,7 @@ static char *strip_spaces(char *name) * on EBCDIC machines) */ -char *hex_to_string(const unsigned char *buffer, long len) +char *x509v3_bytes_to_hex(const unsigned char *buffer, long len) { char *tmp, *q; const unsigned char *p; @@ -469,11 +469,7 @@ char *hex_to_string(const unsigned char *buffer, long len) return tmp; } -/* - * Give a string of hex digits convert to a buffer - */ - -unsigned char *string_to_hex(const char *str, long *len) +unsigned char *x509v3_hex_to_bytes(const char *str, long *len) { unsigned char *hexbuf, *q; unsigned char ch, cl, *p; @@ -533,11 +529,7 @@ unsigned char *string_to_hex(const char *str, long *len) } -/* - * V2I name comparison function: returns zero if 'name' matches cmp or cmp.* - */ - -int name_cmp(const char *name, const char *cmp) +int x509v3_name_cmp(const char *name, const char *cmp) { int len, ret; char c; @@ -650,9 +642,10 @@ static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, ASN1_IA5STRING *email) if (!*sk) return 0; /* Don't add duplicates */ + sk_OPENSSL_STRING_sort(*sk); if (sk_OPENSSL_STRING_find(*sk, NULL, (char *)email->data)) return 1; - emtmp = BUF_strdup((char *)email->data); + emtmp = OPENSSL_strdup((char *)email->data); if (!emtmp || !sk_OPENSSL_STRING_push(*sk, emtmp)) { X509_email_free(*sk); *sk = NULL; @@ -915,6 +908,53 @@ static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, subject, subject_len, flags); } +int x509v3_looks_like_dns_name(const unsigned char *in, size_t len) { + /* This function is used as a heuristic for whether a common name is a + * hostname to be matched, or merely a decorative name to describe the + * subject. This heuristic must be applied to both name constraints and the + * common name fallback, so it must be loose enough to accept hostname + * common names, and tight enough to reject decorative common names. */ + + if (len > 0 && in[len - 1] == '.') { + len--; + } + + /* Wildcards are allowed in front. */ + if (len >= 2 && in[0] == '*' && in[1] == '.') { + in += 2; + len -= 2; + } + + if (len == 0) { + return 0; + } + + size_t label_start = 0; + for (size_t i = 0; i < len; i++) { + unsigned char c = in[i]; + if ((c >= 'a' && c <= 'z') || + (c >= '0' && c <= '9') || + (c >= 'A' && c <= 'Z') || + (c == '-' && i > label_start) || + /* These are not valid characters in hostnames, but commonly found + * in deployments outside the Web PKI. */ + c == '_' || + c == ':') { + continue; + } + + /* Labels must not be empty. */ + if (c == '.' && i > label_start && i < len - 1) { + label_start = i + 1; + continue; + } + + return 0; + } + + return 1; +} + /* * Compare an ASN1_STRING to a supplied string. If they match return 1. If * cmp_type > 0 only compare if string matches the type, otherwise convert it @@ -922,8 +962,8 @@ static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, */ static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, - unsigned int flags, const char *b, size_t blen, - char **peername) + unsigned int flags, int check_type, const char *b, + size_t blen, char **peername) { int rv = 0; @@ -937,16 +977,26 @@ static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, else if (a->length == (int)blen && !OPENSSL_memcmp(a->data, b, blen)) rv = 1; if (rv > 0 && peername) - *peername = BUF_strndup((char *)a->data, a->length); + *peername = OPENSSL_strndup((char *)a->data, a->length); } else { int astrlen; unsigned char *astr; astrlen = ASN1_STRING_to_UTF8(&astr, a); if (astrlen < 0) return -1; - rv = equal(astr, astrlen, (unsigned char *)b, blen, flags); + /* + * We check the common name against DNS name constraints if it passes + * |x509v3_looks_like_dns_name|. Thus we must not consider common names + * for DNS fallbacks if they fail this check. + */ + if (check_type == GEN_DNS && + !x509v3_looks_like_dns_name(astr, astrlen)) { + rv = 0; + } else { + rv = equal(astr, astrlen, (unsigned char *)b, blen, flags); + } if (rv > 0 && peername) - *peername = BUF_strndup((char *)astr, astrlen); + *peername = OPENSSL_strndup((char *)astr, astrlen); OPENSSL_free(astr); } return rv; @@ -961,7 +1011,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, int j; int cnid = NID_undef; int alt_type; - int san_present = 0; int rv = 0; equal_fn equal; @@ -994,7 +1043,6 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, gen = sk_GENERAL_NAME_value(gens, i); if (gen->type != check_type) continue; - san_present = 1; if (check_type == GEN_EMAIL) cstr = gen->d.rfc822Name; else if (check_type == GEN_DNS) @@ -1002,21 +1050,16 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, else cstr = gen->d.iPAddress; /* Positive on success, negative on error! */ - if ((rv = do_check_string(cstr, alt_type, equal, flags, + if ((rv = do_check_string(cstr, alt_type, equal, flags, check_type, chk, chklen, peername)) != 0) break; } GENERAL_NAMES_free(gens); - if (rv != 0) - return rv; - if (cnid == NID_undef - || (san_present - && !(flags & X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT))) - return 0; + return rv; } /* We're done if CN-ID is not pertinent */ - if (cnid == NID_undef) + if (cnid == NID_undef || (flags & X509_CHECK_FLAG_NEVER_CHECK_SUBJECT)) return 0; j = -1; @@ -1027,7 +1070,7 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, ne = X509_NAME_get_entry(name, j); str = X509_NAME_ENTRY_get_data(ne); /* Positive on success, negative on error! */ - if ((rv = do_check_string(str, -1, equal, flags, + if ((rv = do_check_string(str, -1, equal, flags, check_type, chk, chklen, peername)) != 0) return rv; } @@ -1112,7 +1155,7 @@ ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc) p = strchr(ipasc, '/'); if (!p) return NULL; - iptmp = BUF_strdup(ipasc); + iptmp = OPENSSL_strdup(ipasc); if (!iptmp) return NULL; p = iptmp + (p - ipasc); diff --git a/Pods/BoringSSL-GRPC/include/openssl/BoringSSL.modulemap b/Pods/BoringSSL-GRPC/src/include/openssl/BoringSSL.modulemap similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/BoringSSL.modulemap rename to Pods/BoringSSL-GRPC/src/include/openssl/BoringSSL.modulemap diff --git a/Pods/BoringSSL-GRPC/include/openssl/aead.h b/Pods/BoringSSL-GRPC/src/include/openssl/aead.h similarity index 89% rename from Pods/BoringSSL-GRPC/include/openssl/aead.h rename to Pods/BoringSSL-GRPC/src/include/openssl/aead.h index 92427aaec..acfd6f8c0 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/aead.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/aead.h @@ -91,15 +91,44 @@ extern "C" { // AEAD algorithms. // EVP_aead_aes_128_gcm is AES-128 in Galois Counter Mode. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm(void); +// EVP_aead_aes_192_gcm is AES-192 in Galois Counter Mode. +// +// WARNING: AES-192 is superfluous and shouldn't exist. NIST should never have +// defined it. Use only when interop with another system requires it, never +// de novo. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_192_gcm(void); + // EVP_aead_aes_256_gcm is AES-256 in Galois Counter Mode. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm(void); // EVP_aead_chacha20_poly1305 is the AEAD built from ChaCha20 and // Poly1305 as described in RFC 7539. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_chacha20_poly1305(void); +// EVP_aead_xchacha20_poly1305 is ChaCha20-Poly1305 with an extended nonce that +// makes random generation of nonces safe. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_xchacha20_poly1305(void); + // EVP_aead_aes_128_ctr_hmac_sha256 is AES-128 in CTR mode with HMAC-SHA256 for // authentication. The nonce is 12 bytes; the bottom 32-bits are used as the // block counter, thus the maximum plaintext size is 64GB. @@ -154,13 +183,16 @@ OPENSSL_EXPORT size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead); // AEAD operations. +union evp_aead_ctx_st_state { + uint8_t opaque[580]; + uint64_t alignment; +}; + // An EVP_AEAD_CTX represents an AEAD algorithm configured with a specific key // and message-independent IV. typedef struct evp_aead_ctx_st { const EVP_AEAD *aead; - // aead_state is an opaque pointer to whatever state the AEAD needs to - // maintain. - void *aead_state; + union evp_aead_ctx_st_state state; // tag_len may contain the actual length of the authentication tag if it is // known at initialization time. uint8_t tag_len; @@ -172,7 +204,7 @@ typedef struct evp_aead_ctx_st { // EVP_AEAD_MAX_NONCE_LENGTH contains the maximum nonce length used by // any AEAD defined in this header. -#define EVP_AEAD_MAX_NONCE_LENGTH 16 +#define EVP_AEAD_MAX_NONCE_LENGTH 24 // EVP_AEAD_MAX_OVERHEAD contains the maximum overhead used by any AEAD // defined in this header. @@ -361,19 +393,13 @@ OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls12(void); // 1.2 nonce construction. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls12(void); +// EVP_aead_aes_128_gcm_tls13 is AES-128 in Galois Counter Mode using the TLS +// 1.3 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls13(void); -// SSLv3-specific AEAD algorithms. -// -// These AEAD primitives do not meet the definition of generic AEADs. They are -// all specific to SSLv3 and should not be used outside of that context. They -// must be initialized with |EVP_AEAD_CTX_init_with_direction|, are stateful, -// and may not be used concurrently. They only accept an |ad| parameter of -// length 9 (the standard TLS one with length and version omitted). - -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_ssl3(void); -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_ssl3(void); -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_ssl3(void); -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_null_sha1_ssl3(void); +// EVP_aead_aes_256_gcm_tls13 is AES-256 in Galois Counter Mode using the TLS +// 1.3 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls13(void); // Obscure functions. @@ -393,7 +419,7 @@ OPENSSL_EXPORT int EVP_AEAD_CTX_init_with_direction( // EVP_AEAD_CTX_get_iv sets |*out_len| to the length of the IV for |ctx| and // sets |*out_iv| to point to that many bytes of the current IV. This is only -// meaningful for AEADs with implicit IVs (i.e. CBC mode in SSLv3 and TLS 1.0). +// meaningful for AEADs with implicit IVs (i.e. CBC mode in TLS 1.0). // // It returns one on success or zero on error. OPENSSL_EXPORT int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, @@ -415,7 +441,7 @@ OPENSSL_EXPORT int EVP_AEAD_CTX_tag_len(const EVP_AEAD_CTX *ctx, #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN using ScopedEVP_AEAD_CTX = internal::StackAllocated + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Authenticated Encryption with Additional Data. +// +// AEAD couples confidentiality and integrity in a single primitive. AEAD +// algorithms take a key and then can seal and open individual messages. Each +// message has a unique, per-message nonce and, optionally, additional data +// which is authenticated but not included in the ciphertext. +// +// The |EVP_AEAD_CTX_init| function initialises an |EVP_AEAD_CTX| structure and +// performs any precomputation needed to use |aead| with |key|. The length of +// the key, |key_len|, is given in bytes. +// +// The |tag_len| argument contains the length of the tags, in bytes, and allows +// for the processing of truncated authenticators. A zero value indicates that +// the default tag length should be used and this is defined as +// |EVP_AEAD_DEFAULT_TAG_LENGTH| in order to make the code clear. Using +// truncated tags increases an attacker's chance of creating a valid forgery. +// Be aware that the attacker's chance may increase more than exponentially as +// would naively be expected. +// +// When no longer needed, the initialised |EVP_AEAD_CTX| structure must be +// passed to |EVP_AEAD_CTX_cleanup|, which will deallocate any memory used. +// +// With an |EVP_AEAD_CTX| in hand, one can seal and open messages. These +// operations are intended to meet the standard notions of privacy and +// authenticity for authenticated encryption. For formal definitions see +// Bellare and Namprempre, "Authenticated encryption: relations among notions +// and analysis of the generic composition paradigm," Lecture Notes in Computer +// Science B<1976> (2000), 531–545, +// http://www-cse.ucsd.edu/~mihir/papers/oem.html. +// +// When sealing messages, a nonce must be given. The length of the nonce is +// fixed by the AEAD in use and is returned by |EVP_AEAD_nonce_length|. *The +// nonce must be unique for all messages with the same key*. This is critically +// important - nonce reuse may completely undermine the security of the AEAD. +// Nonces may be predictable and public, so long as they are unique. Uniqueness +// may be achieved with a simple counter or, if large enough, may be generated +// randomly. The nonce must be passed into the "open" operation by the receiver +// so must either be implicit (e.g. a counter), or must be transmitted along +// with the sealed message. +// +// The "seal" and "open" operations are atomic - an entire message must be +// encrypted or decrypted in a single call. Large messages may have to be split +// up in order to accommodate this. When doing so, be mindful of the need not to +// repeat nonces and the possibility that an attacker could duplicate, reorder +// or drop message chunks. For example, using a single key for a given (large) +// message and sealing chunks with nonces counting from zero would be secure as +// long as the number of chunks was securely transmitted. (Otherwise an +// attacker could truncate the message by dropping chunks from the end.) +// +// The number of chunks could be transmitted by prefixing it to the plaintext, +// for example. This also assumes that no other message would ever use the same +// key otherwise the rule that nonces must be unique for a given key would be +// violated. +// +// The "seal" and "open" operations also permit additional data to be +// authenticated via the |ad| parameter. This data is not included in the +// ciphertext and must be identical for both the "seal" and "open" call. This +// permits implicit context to be authenticated but may be empty if not needed. +// +// The "seal" and "open" operations may work in-place if the |out| and |in| +// arguments are equal. Otherwise, if |out| and |in| alias, input data may be +// overwritten before it is read. This situation will cause an error. +// +// The "seal" and "open" operations return one on success and zero on error. + + +// AEAD algorithms. + +// EVP_aead_aes_128_gcm is AES-128 in Galois Counter Mode. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm(void); + +// EVP_aead_aes_192_gcm is AES-192 in Galois Counter Mode. +// +// WARNING: AES-192 is superfluous and shouldn't exist. NIST should never have +// defined it. Use only when interop with another system requires it, never +// de novo. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_192_gcm(void); + +// EVP_aead_aes_256_gcm is AES-256 in Galois Counter Mode. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm(void); + +// EVP_aead_chacha20_poly1305 is the AEAD built from ChaCha20 and +// Poly1305 as described in RFC 7539. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_chacha20_poly1305(void); + +// EVP_aead_xchacha20_poly1305 is ChaCha20-Poly1305 with an extended nonce that +// makes random generation of nonces safe. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_xchacha20_poly1305(void); + +// EVP_aead_aes_128_ctr_hmac_sha256 is AES-128 in CTR mode with HMAC-SHA256 for +// authentication. The nonce is 12 bytes; the bottom 32-bits are used as the +// block counter, thus the maximum plaintext size is 64GB. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_ctr_hmac_sha256(void); + +// EVP_aead_aes_256_ctr_hmac_sha256 is AES-256 in CTR mode with HMAC-SHA256 for +// authentication. See |EVP_aead_aes_128_ctr_hmac_sha256| for details. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_ctr_hmac_sha256(void); + +// EVP_aead_aes_128_gcm_siv is AES-128 in GCM-SIV mode. See +// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02 +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_siv(void); + +// EVP_aead_aes_256_gcm_siv is AES-256 in GCM-SIV mode. See +// https://tools.ietf.org/html/draft-irtf-cfrg-gcmsiv-02 +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_siv(void); + +// EVP_aead_aes_128_ccm_bluetooth is AES-128-CCM with M=4 and L=2 (4-byte tags +// and 13-byte nonces), as decribed in the Bluetooth Core Specification v5.0, +// Volume 6, Part E, Section 1. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth(void); + +// EVP_aead_aes_128_ccm_bluetooth_8 is AES-128-CCM with M=8 and L=2 (8-byte tags +// and 13-byte nonces), as used in the Bluetooth Mesh Networking Specification +// v1.0. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_ccm_bluetooth_8(void); + +// EVP_has_aes_hardware returns one if we enable hardware support for fast and +// constant-time AES-GCM. +OPENSSL_EXPORT int EVP_has_aes_hardware(void); + + +// Utility functions. + +// EVP_AEAD_key_length returns the length, in bytes, of the keys used by +// |aead|. +OPENSSL_EXPORT size_t EVP_AEAD_key_length(const EVP_AEAD *aead); + +// EVP_AEAD_nonce_length returns the length, in bytes, of the per-message nonce +// for |aead|. +OPENSSL_EXPORT size_t EVP_AEAD_nonce_length(const EVP_AEAD *aead); + +// EVP_AEAD_max_overhead returns the maximum number of additional bytes added +// by the act of sealing data with |aead|. +OPENSSL_EXPORT size_t EVP_AEAD_max_overhead(const EVP_AEAD *aead); + +// EVP_AEAD_max_tag_len returns the maximum tag length when using |aead|. This +// is the largest value that can be passed as |tag_len| to +// |EVP_AEAD_CTX_init|. +OPENSSL_EXPORT size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead); + + +// AEAD operations. + +union evp_aead_ctx_st_state { + uint8_t opaque[580]; + uint64_t alignment; +}; + +// An EVP_AEAD_CTX represents an AEAD algorithm configured with a specific key +// and message-independent IV. +typedef struct evp_aead_ctx_st { + const EVP_AEAD *aead; + union evp_aead_ctx_st_state state; + // tag_len may contain the actual length of the authentication tag if it is + // known at initialization time. + uint8_t tag_len; +} EVP_AEAD_CTX; + +// EVP_AEAD_MAX_KEY_LENGTH contains the maximum key length used by +// any AEAD defined in this header. +#define EVP_AEAD_MAX_KEY_LENGTH 80 + +// EVP_AEAD_MAX_NONCE_LENGTH contains the maximum nonce length used by +// any AEAD defined in this header. +#define EVP_AEAD_MAX_NONCE_LENGTH 24 + +// EVP_AEAD_MAX_OVERHEAD contains the maximum overhead used by any AEAD +// defined in this header. +#define EVP_AEAD_MAX_OVERHEAD 64 + +// EVP_AEAD_DEFAULT_TAG_LENGTH is a magic value that can be passed to +// EVP_AEAD_CTX_init to indicate that the default tag length for an AEAD should +// be used. +#define EVP_AEAD_DEFAULT_TAG_LENGTH 0 + +// EVP_AEAD_CTX_zero sets an uninitialized |ctx| to the zero state. It must be +// initialized with |EVP_AEAD_CTX_init| before use. It is safe, but not +// necessary, to call |EVP_AEAD_CTX_cleanup| in this state. This may be used for +// more uniform cleanup of |EVP_AEAD_CTX|. +OPENSSL_EXPORT void EVP_AEAD_CTX_zero(EVP_AEAD_CTX *ctx); + +// EVP_AEAD_CTX_new allocates an |EVP_AEAD_CTX|, calls |EVP_AEAD_CTX_init| and +// returns the |EVP_AEAD_CTX|, or NULL on error. +OPENSSL_EXPORT EVP_AEAD_CTX *EVP_AEAD_CTX_new(const EVP_AEAD *aead, + const uint8_t *key, + size_t key_len, size_t tag_len); + +// EVP_AEAD_CTX_free calls |EVP_AEAD_CTX_cleanup| and |OPENSSL_free| on +// |ctx|. +OPENSSL_EXPORT void EVP_AEAD_CTX_free(EVP_AEAD_CTX *ctx); + +// EVP_AEAD_CTX_init initializes |ctx| for the given AEAD algorithm. The |impl| +// argument is ignored and should be NULL. Authentication tags may be truncated +// by passing a size as |tag_len|. A |tag_len| of zero indicates the default +// tag length and this is defined as EVP_AEAD_DEFAULT_TAG_LENGTH for +// readability. +// +// Returns 1 on success. Otherwise returns 0 and pushes to the error stack. In +// the error case, you do not need to call |EVP_AEAD_CTX_cleanup|, but it's +// harmless to do so. +OPENSSL_EXPORT int EVP_AEAD_CTX_init(EVP_AEAD_CTX *ctx, const EVP_AEAD *aead, + const uint8_t *key, size_t key_len, + size_t tag_len, ENGINE *impl); + +// EVP_AEAD_CTX_cleanup frees any data allocated by |ctx|. It is a no-op to +// call |EVP_AEAD_CTX_cleanup| on a |EVP_AEAD_CTX| that has been |memset| to +// all zeros. +OPENSSL_EXPORT void EVP_AEAD_CTX_cleanup(EVP_AEAD_CTX *ctx); + +// EVP_AEAD_CTX_seal encrypts and authenticates |in_len| bytes from |in| and +// authenticates |ad_len| bytes from |ad| and writes the result to |out|. It +// returns one on success and zero otherwise. +// +// This function may be called concurrently with itself or any other seal/open +// function on the same |EVP_AEAD_CTX|. +// +// At most |max_out_len| bytes are written to |out| and, in order to ensure +// success, |max_out_len| should be |in_len| plus the result of +// |EVP_AEAD_max_overhead|. On successful return, |*out_len| is set to the +// actual number of bytes written. +// +// The length of |nonce|, |nonce_len|, must be equal to the result of +// |EVP_AEAD_nonce_length| for this AEAD. +// +// |EVP_AEAD_CTX_seal| never results in a partial output. If |max_out_len| is +// insufficient, zero will be returned. If any error occurs, |out| will be +// filled with zero bytes and |*out_len| set to zero. +// +// If |in| and |out| alias then |out| must be == |in|. +OPENSSL_EXPORT int EVP_AEAD_CTX_seal(const EVP_AEAD_CTX *ctx, uint8_t *out, + size_t *out_len, size_t max_out_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *ad, size_t ad_len); + +// EVP_AEAD_CTX_open authenticates |in_len| bytes from |in| and |ad_len| bytes +// from |ad| and decrypts at most |in_len| bytes into |out|. It returns one on +// success and zero otherwise. +// +// This function may be called concurrently with itself or any other seal/open +// function on the same |EVP_AEAD_CTX|. +// +// At most |in_len| bytes are written to |out|. In order to ensure success, +// |max_out_len| should be at least |in_len|. On successful return, |*out_len| +// is set to the the actual number of bytes written. +// +// The length of |nonce|, |nonce_len|, must be equal to the result of +// |EVP_AEAD_nonce_length| for this AEAD. +// +// |EVP_AEAD_CTX_open| never results in a partial output. If |max_out_len| is +// insufficient, zero will be returned. If any error occurs, |out| will be +// filled with zero bytes and |*out_len| set to zero. +// +// If |in| and |out| alias then |out| must be == |in|. +OPENSSL_EXPORT int EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, uint8_t *out, + size_t *out_len, size_t max_out_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *ad, size_t ad_len); + +// EVP_AEAD_CTX_seal_scatter encrypts and authenticates |in_len| bytes from |in| +// and authenticates |ad_len| bytes from |ad|. It writes |in_len| bytes of +// ciphertext to |out| and the authentication tag to |out_tag|. It returns one +// on success and zero otherwise. +// +// This function may be called concurrently with itself or any other seal/open +// function on the same |EVP_AEAD_CTX|. +// +// Exactly |in_len| bytes are written to |out|, and up to +// |EVP_AEAD_max_overhead+extra_in_len| bytes to |out_tag|. On successful +// return, |*out_tag_len| is set to the actual number of bytes written to +// |out_tag|. +// +// |extra_in| may point to an additional plaintext input buffer if the cipher +// supports it. If present, |extra_in_len| additional bytes of plaintext are +// encrypted and authenticated, and the ciphertext is written (before the tag) +// to |out_tag|. |max_out_tag_len| must be sized to allow for the additional +// |extra_in_len| bytes. +// +// The length of |nonce|, |nonce_len|, must be equal to the result of +// |EVP_AEAD_nonce_length| for this AEAD. +// +// |EVP_AEAD_CTX_seal_scatter| never results in a partial output. If +// |max_out_tag_len| is insufficient, zero will be returned. If any error +// occurs, |out| and |out_tag| will be filled with zero bytes and |*out_tag_len| +// set to zero. +// +// If |in| and |out| alias then |out| must be == |in|. |out_tag| may not alias +// any other argument. +OPENSSL_EXPORT int EVP_AEAD_CTX_seal_scatter( + const EVP_AEAD_CTX *ctx, uint8_t *out, + uint8_t *out_tag, size_t *out_tag_len, size_t max_out_tag_len, + const uint8_t *nonce, size_t nonce_len, + const uint8_t *in, size_t in_len, + const uint8_t *extra_in, size_t extra_in_len, + const uint8_t *ad, size_t ad_len); + +// EVP_AEAD_CTX_open_gather decrypts and authenticates |in_len| bytes from |in| +// and authenticates |ad_len| bytes from |ad| using |in_tag_len| bytes of +// authentication tag from |in_tag|. If successful, it writes |in_len| bytes of +// plaintext to |out|. It returns one on success and zero otherwise. +// +// This function may be called concurrently with itself or any other seal/open +// function on the same |EVP_AEAD_CTX|. +// +// The length of |nonce|, |nonce_len|, must be equal to the result of +// |EVP_AEAD_nonce_length| for this AEAD. +// +// |EVP_AEAD_CTX_open_gather| never results in a partial output. If any error +// occurs, |out| will be filled with zero bytes. +// +// If |in| and |out| alias then |out| must be == |in|. +OPENSSL_EXPORT int EVP_AEAD_CTX_open_gather( + const EVP_AEAD_CTX *ctx, uint8_t *out, const uint8_t *nonce, + size_t nonce_len, const uint8_t *in, size_t in_len, const uint8_t *in_tag, + size_t in_tag_len, const uint8_t *ad, size_t ad_len); + +// EVP_AEAD_CTX_aead returns the underlying AEAD for |ctx|, or NULL if one has +// not been set. +OPENSSL_EXPORT const EVP_AEAD *EVP_AEAD_CTX_aead(const EVP_AEAD_CTX *ctx); + + +// TLS-specific AEAD algorithms. +// +// These AEAD primitives do not meet the definition of generic AEADs. They are +// all specific to TLS and should not be used outside of that context. They must +// be initialized with |EVP_AEAD_CTX_init_with_direction|, are stateful, and may +// not be used concurrently. Any nonces are used as IVs, so they must be +// unpredictable. They only accept an |ad| parameter of length 11 (the standard +// TLS one with length omitted). + +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_tls(void); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_tls_implicit_iv(void); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_cbc_sha256_tls(void); + +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_tls(void); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(void); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_cbc_sha256_tls(void); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_cbc_sha384_tls(void); + +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_tls(void); +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv(void); + +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_null_sha1_tls(void); + +// EVP_aead_aes_128_gcm_tls12 is AES-128 in Galois Counter Mode using the TLS +// 1.2 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls12(void); + +// EVP_aead_aes_256_gcm_tls12 is AES-256 in Galois Counter Mode using the TLS +// 1.2 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls12(void); + +// EVP_aead_aes_128_gcm_tls13 is AES-128 in Galois Counter Mode using the TLS +// 1.3 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls13(void); + +// EVP_aead_aes_256_gcm_tls13 is AES-256 in Galois Counter Mode using the TLS +// 1.3 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls13(void); + + +// Obscure functions. + +// evp_aead_direction_t denotes the direction of an AEAD operation. +enum evp_aead_direction_t { + evp_aead_open, + evp_aead_seal, +}; + +// EVP_AEAD_CTX_init_with_direction calls |EVP_AEAD_CTX_init| for normal +// AEADs. For TLS-specific and SSL3-specific AEADs, it initializes |ctx| for a +// given direction. +OPENSSL_EXPORT int EVP_AEAD_CTX_init_with_direction( + EVP_AEAD_CTX *ctx, const EVP_AEAD *aead, const uint8_t *key, size_t key_len, + size_t tag_len, enum evp_aead_direction_t dir); + +// EVP_AEAD_CTX_get_iv sets |*out_len| to the length of the IV for |ctx| and +// sets |*out_iv| to point to that many bytes of the current IV. This is only +// meaningful for AEADs with implicit IVs (i.e. CBC mode in TLS 1.0). +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, + const uint8_t **out_iv, size_t *out_len); + +// EVP_AEAD_CTX_tag_len computes the exact byte length of the tag written by +// |EVP_AEAD_CTX_seal_scatter| and writes it to |*out_tag_len|. It returns one +// on success or zero on error. |in_len| and |extra_in_len| must equal the +// arguments of the same names passed to |EVP_AEAD_CTX_seal_scatter|. +OPENSSL_EXPORT int EVP_AEAD_CTX_tag_len(const EVP_AEAD_CTX *ctx, + size_t *out_tag_len, + const size_t in_len, + const size_t extra_in_len); + + +#if defined(__cplusplus) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +using ScopedEVP_AEAD_CTX = + internal::StackAllocated; + +BORINGSSL_MAKE_DELETER(EVP_AEAD_CTX, EVP_AEAD_CTX_free) + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif + +#endif // OPENSSL_HEADER_AEAD_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/aead.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/include/openssl/aead.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/aead.h.grpc_back index 1d5019710..6d78db27d 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/aead.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/aead.h.grpc_back @@ -91,15 +91,44 @@ extern "C" { // AEAD algorithms. // EVP_aead_aes_128_gcm is AES-128 in Galois Counter Mode. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm(void); +// EVP_aead_aes_192_gcm is AES-192 in Galois Counter Mode. +// +// WARNING: AES-192 is superfluous and shouldn't exist. NIST should never have +// defined it. Use only when interop with another system requires it, never +// de novo. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_192_gcm(void); + // EVP_aead_aes_256_gcm is AES-256 in Galois Counter Mode. +// +// Note: AES-GCM should only be used with 12-byte (96-bit) nonces. Although it +// is specified to take a variable-length nonce, nonces with other lengths are +// effectively randomized, which means one must consider collisions. Unless +// implementing an existing protocol which has already specified incorrect +// parameters, only use 12-byte nonces. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm(void); // EVP_aead_chacha20_poly1305 is the AEAD built from ChaCha20 and // Poly1305 as described in RFC 7539. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_chacha20_poly1305(void); +// EVP_aead_xchacha20_poly1305 is ChaCha20-Poly1305 with an extended nonce that +// makes random generation of nonces safe. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_xchacha20_poly1305(void); + // EVP_aead_aes_128_ctr_hmac_sha256 is AES-128 in CTR mode with HMAC-SHA256 for // authentication. The nonce is 12 bytes; the bottom 32-bits are used as the // block counter, thus the maximum plaintext size is 64GB. @@ -154,13 +183,16 @@ OPENSSL_EXPORT size_t EVP_AEAD_max_tag_len(const EVP_AEAD *aead); // AEAD operations. +union evp_aead_ctx_st_state { + uint8_t opaque[580]; + uint64_t alignment; +}; + // An EVP_AEAD_CTX represents an AEAD algorithm configured with a specific key // and message-independent IV. typedef struct evp_aead_ctx_st { const EVP_AEAD *aead; - // aead_state is an opaque pointer to whatever state the AEAD needs to - // maintain. - void *aead_state; + union evp_aead_ctx_st_state state; // tag_len may contain the actual length of the authentication tag if it is // known at initialization time. uint8_t tag_len; @@ -172,7 +204,7 @@ typedef struct evp_aead_ctx_st { // EVP_AEAD_MAX_NONCE_LENGTH contains the maximum nonce length used by // any AEAD defined in this header. -#define EVP_AEAD_MAX_NONCE_LENGTH 16 +#define EVP_AEAD_MAX_NONCE_LENGTH 24 // EVP_AEAD_MAX_OVERHEAD contains the maximum overhead used by any AEAD // defined in this header. @@ -361,19 +393,13 @@ OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls12(void); // 1.2 nonce construction. OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls12(void); +// EVP_aead_aes_128_gcm_tls13 is AES-128 in Galois Counter Mode using the TLS +// 1.3 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_gcm_tls13(void); -// SSLv3-specific AEAD algorithms. -// -// These AEAD primitives do not meet the definition of generic AEADs. They are -// all specific to SSLv3 and should not be used outside of that context. They -// must be initialized with |EVP_AEAD_CTX_init_with_direction|, are stateful, -// and may not be used concurrently. They only accept an |ad| parameter of -// length 9 (the standard TLS one with length and version omitted). - -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_128_cbc_sha1_ssl3(void); -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_cbc_sha1_ssl3(void); -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_des_ede3_cbc_sha1_ssl3(void); -OPENSSL_EXPORT const EVP_AEAD *EVP_aead_null_sha1_ssl3(void); +// EVP_aead_aes_256_gcm_tls13 is AES-256 in Galois Counter Mode using the TLS +// 1.3 nonce construction. +OPENSSL_EXPORT const EVP_AEAD *EVP_aead_aes_256_gcm_tls13(void); // Obscure functions. @@ -393,7 +419,7 @@ OPENSSL_EXPORT int EVP_AEAD_CTX_init_with_direction( // EVP_AEAD_CTX_get_iv sets |*out_len| to the length of the IV for |ctx| and // sets |*out_iv| to point to that many bytes of the current IV. This is only -// meaningful for AEADs with implicit IVs (i.e. CBC mode in SSLv3 and TLS 1.0). +// meaningful for AEADs with implicit IVs (i.e. CBC mode in TLS 1.0). // // It returns one on success or zero on error. OPENSSL_EXPORT int EVP_AEAD_CTX_get_iv(const EVP_AEAD_CTX *ctx, @@ -415,7 +441,7 @@ OPENSSL_EXPORT int EVP_AEAD_CTX_tag_len(const EVP_AEAD_CTX *ctx, #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN using ScopedEVP_AEAD_CTX = internal::StackAllocated + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Raw AES functions. + + +#define AES_ENCRYPT 1 +#define AES_DECRYPT 0 + +// AES_MAXNR is the maximum number of AES rounds. +#define AES_MAXNR 14 + +#define AES_BLOCK_SIZE 16 + +// aes_key_st should be an opaque type, but EVP requires that the size be +// known. +struct aes_key_st { + uint32_t rd_key[4 * (AES_MAXNR + 1)]; + unsigned rounds; +}; +typedef struct aes_key_st AES_KEY; + +// AES_set_encrypt_key configures |aeskey| to encrypt with the |bits|-bit key, +// |key|. |key| must point to |bits|/8 bytes. It returns zero on success and a +// negative number if |bits| is an invalid AES key size. +// +// WARNING: this function breaks the usual return value convention. +OPENSSL_EXPORT int AES_set_encrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey); + +// AES_set_decrypt_key configures |aeskey| to decrypt with the |bits|-bit key, +// |key|. |key| must point to |bits|/8 bytes. It returns zero on success and a +// negative number if |bits| is an invalid AES key size. +// +// WARNING: this function breaks the usual return value convention. +OPENSSL_EXPORT int AES_set_decrypt_key(const uint8_t *key, unsigned bits, + AES_KEY *aeskey); + +// AES_encrypt encrypts a single block from |in| to |out| with |key|. The |in| +// and |out| pointers may overlap. +OPENSSL_EXPORT void AES_encrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key); + +// AES_decrypt decrypts a single block from |in| to |out| with |key|. The |in| +// and |out| pointers may overlap. +OPENSSL_EXPORT void AES_decrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key); + + +// Block cipher modes. + +// AES_ctr128_encrypt encrypts (or decrypts, it's the same in CTR mode) |len| +// bytes from |in| to |out|. The |num| parameter must be set to zero on the +// first call and |ivec| will be incremented. +OPENSSL_EXPORT void AES_ctr128_encrypt(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + uint8_t ivec[AES_BLOCK_SIZE], + uint8_t ecount_buf[AES_BLOCK_SIZE], + unsigned int *num); + +// AES_ecb_encrypt encrypts (or decrypts, if |enc| == |AES_DECRYPT|) a single, +// 16 byte block from |in| to |out|. +OPENSSL_EXPORT void AES_ecb_encrypt(const uint8_t *in, uint8_t *out, + const AES_KEY *key, const int enc); + +// AES_cbc_encrypt encrypts (or decrypts, if |enc| == |AES_DECRYPT|) |len| +// bytes from |in| to |out|. The length must be a multiple of the block size. +OPENSSL_EXPORT void AES_cbc_encrypt(const uint8_t *in, uint8_t *out, size_t len, + const AES_KEY *key, uint8_t *ivec, + const int enc); + +// AES_ofb128_encrypt encrypts (or decrypts, it's the same in OFB mode) |len| +// bytes from |in| to |out|. The |num| parameter must be set to zero on the +// first call. +OPENSSL_EXPORT void AES_ofb128_encrypt(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + uint8_t *ivec, int *num); + +// AES_cfb128_encrypt encrypts (or decrypts, if |enc| == |AES_DECRYPT|) |len| +// bytes from |in| to |out|. The |num| parameter must be set to zero on the +// first call. +OPENSSL_EXPORT void AES_cfb128_encrypt(const uint8_t *in, uint8_t *out, + size_t len, const AES_KEY *key, + uint8_t *ivec, int *num, int enc); + + +// AES key wrap. +// +// These functions implement AES Key Wrap mode, as defined in RFC 3394. They +// should never be used except to interoperate with existing systems that use +// this mode. + +// AES_wrap_key performs AES key wrap on |in| which must be a multiple of 8 +// bytes. |iv| must point to an 8 byte value or be NULL to use the default IV. +// |key| must have been configured for encryption. On success, it writes +// |in_len| + 8 bytes to |out| and returns |in_len| + 8. Otherwise, it returns +// -1. +OPENSSL_EXPORT int AES_wrap_key(const AES_KEY *key, const uint8_t *iv, + uint8_t *out, const uint8_t *in, size_t in_len); + +// AES_unwrap_key performs AES key unwrap on |in| which must be a multiple of 8 +// bytes. |iv| must point to an 8 byte value or be NULL to use the default IV. +// |key| must have been configured for decryption. On success, it writes +// |in_len| - 8 bytes to |out| and returns |in_len| - 8. Otherwise, it returns +// -1. +OPENSSL_EXPORT int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, + uint8_t *out, const uint8_t *in, + size_t in_len); + + +// AES key wrap with padding. +// +// These functions implement AES Key Wrap with Padding mode, as defined in RFC +// 5649. They should never be used except to interoperate with existing systems +// that use this mode. + +// AES_wrap_key_padded performs a padded AES key wrap on |in| which must be +// between 1 and 2^32-1 bytes. |key| must have been configured for encryption. +// On success it writes at most |max_out| bytes of ciphertext to |out|, sets +// |*out_len| to the number of bytes written, and returns one. On failure it +// returns zero. To ensure success, set |max_out| to at least |in_len| + 15. +OPENSSL_EXPORT int AES_wrap_key_padded(const AES_KEY *key, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + +// AES_unwrap_key_padded performs a padded AES key unwrap on |in| which must be +// a multiple of 8 bytes. |key| must have been configured for decryption. On +// success it writes at most |max_out| bytes to |out|, sets |*out_len| to the +// number of bytes written, and returns one. On failure it returns zero. Setting +// |max_out| to |in_len| is a sensible estimate. +OPENSSL_EXPORT int AES_unwrap_key_padded(const AES_KEY *key, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_AES_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/aes.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.grpc_back similarity index 79% rename from Pods/BoringSSL-GRPC/include/openssl/aes.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/aes.h.grpc_back index 115658542..e56062535 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/aes.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/aes.h.grpc_back @@ -6,7 +6,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -76,18 +76,18 @@ struct aes_key_st { typedef struct aes_key_st AES_KEY; // AES_set_encrypt_key configures |aeskey| to encrypt with the |bits|-bit key, -// |key|. +// |key|. |key| must point to |bits|/8 bytes. It returns zero on success and a +// negative number if |bits| is an invalid AES key size. // -// WARNING: unlike other OpenSSL functions, this returns zero on success and a -// negative number on error. +// WARNING: this function breaks the usual return value convention. OPENSSL_EXPORT int AES_set_encrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey); // AES_set_decrypt_key configures |aeskey| to decrypt with the |bits|-bit key, -// |key|. +// |key|. |key| must point to |bits|/8 bytes. It returns zero on success and a +// negative number if |bits| is an invalid AES key size. // -// WARNING: unlike other OpenSSL functions, this returns zero on success and a -// negative number on error. +// WARNING: this function breaks the usual return value convention. OPENSSL_EXPORT int AES_set_decrypt_key(const uint8_t *key, unsigned bits, AES_KEY *aeskey); @@ -163,6 +163,31 @@ OPENSSL_EXPORT int AES_unwrap_key(const AES_KEY *key, const uint8_t *iv, size_t in_len); +// AES key wrap with padding. +// +// These functions implement AES Key Wrap with Padding mode, as defined in RFC +// 5649. They should never be used except to interoperate with existing systems +// that use this mode. + +// AES_wrap_key_padded performs a padded AES key wrap on |in| which must be +// between 1 and 2^32-1 bytes. |key| must have been configured for encryption. +// On success it writes at most |max_out| bytes of ciphertext to |out|, sets +// |*out_len| to the number of bytes written, and returns one. On failure it +// returns zero. To ensure success, set |max_out| to at least |in_len| + 15. +OPENSSL_EXPORT int AES_wrap_key_padded(const AES_KEY *key, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + +// AES_unwrap_key_padded performs a padded AES key unwrap on |in| which must be +// a multiple of 8 bytes. |key| must have been configured for decryption. On +// success it writes at most |max_out| bytes to |out|, sets |*out_len| to the +// number of bytes written, and returns one. On failure it returns zero. Setting +// |max_out| to |in_len| is a sensible estimate. +OPENSSL_EXPORT int AES_unwrap_key_padded(const AES_KEY *key, uint8_t *out, + size_t *out_len, size_t max_out, + const uint8_t *in, size_t in_len); + + #if defined(__cplusplus) } // extern C #endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/arm_arch.h b/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/arm_arch.h rename to Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/arm_arch.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/arm_arch.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.grpc_back new file mode 100644 index 000000000..faa2655e5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/arm_arch.h.grpc_back @@ -0,0 +1,121 @@ +/* ==================================================================== + * Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_ARM_ARCH_H +#define OPENSSL_HEADER_ARM_ARCH_H + +#if !defined(__ARM_ARCH__) +# if defined(__CC_ARM) +# define __ARM_ARCH__ __TARGET_ARCH_ARM +# if defined(__BIG_ENDIAN) +# define __ARMEB__ +# else +# define __ARMEL__ +# endif +# elif defined(__GNUC__) +# if defined(__aarch64__) +# define __ARM_ARCH__ 8 +# if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +# define __ARMEB__ +# else +# define __ARMEL__ +# endif + // Why doesn't gcc define __ARM_ARCH__? Instead it defines + // bunch of below macros. See all_architectires[] table in + // gcc/config/arm/arm.c. On a side note it defines + // __ARMEL__/__ARMEB__ for little-/big-endian. +# elif defined(__ARM_ARCH) +# define __ARM_ARCH__ __ARM_ARCH +# elif defined(__ARM_ARCH_8A__) +# define __ARM_ARCH__ 8 +# elif defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) || \ + defined(__ARM_ARCH_7R__)|| defined(__ARM_ARCH_7M__) || \ + defined(__ARM_ARCH_7EM__) +# define __ARM_ARCH__ 7 +# elif defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) || \ + defined(__ARM_ARCH_6K__)|| defined(__ARM_ARCH_6M__) || \ + defined(__ARM_ARCH_6Z__)|| defined(__ARM_ARCH_6ZK__) || \ + defined(__ARM_ARCH_6T2__) +# define __ARM_ARCH__ 6 +# elif defined(__ARM_ARCH_5__) || defined(__ARM_ARCH_5T__) || \ + defined(__ARM_ARCH_5E__)|| defined(__ARM_ARCH_5TE__) || \ + defined(__ARM_ARCH_5TEJ__) +# define __ARM_ARCH__ 5 +# elif defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__) +# define __ARM_ARCH__ 4 +# else +# error "unsupported ARM architecture" +# endif +# endif +#endif + +// Even when building for 32-bit ARM, support for aarch64 crypto instructions +// will be included. +#define __ARM_MAX_ARCH__ 8 + +// ARMV7_NEON is true when a NEON unit is present in the current CPU. +#define ARMV7_NEON (1 << 0) + +// ARMV8_AES indicates support for hardware AES instructions. +#define ARMV8_AES (1 << 2) + +// ARMV8_SHA1 indicates support for hardware SHA-1 instructions. +#define ARMV8_SHA1 (1 << 3) + +// ARMV8_SHA256 indicates support for hardware SHA-256 instructions. +#define ARMV8_SHA256 (1 << 4) + +// ARMV8_PMULL indicates support for carryless multiplication. +#define ARMV8_PMULL (1 << 5) + + +#endif // OPENSSL_HEADER_ARM_ARCH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/asn1.h b/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/asn1.h rename to Pods/BoringSSL-GRPC/src/include/openssl/asn1.h index e41d4149d..4e2630f9c 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/asn1.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h @@ -152,6 +152,9 @@ extern "C" { /* For use with ASN1_mbstring_copy() */ #define MBSTRING_FLAG 0x1000 #define MBSTRING_UTF8 (MBSTRING_FLAG) +/* |MBSTRING_ASC| refers to Latin-1, not ASCII. It is used with TeletexString + * which, in turn, is treated as Latin-1 rather than T.61 by OpenSSL and most + * other software. */ #define MBSTRING_ASC (MBSTRING_FLAG|1) #define MBSTRING_BMP (MBSTRING_FLAG|2) #define MBSTRING_UNIV (MBSTRING_FLAG|4) @@ -295,19 +298,6 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; OPENSSL_EXPORT int fname##_print_ctx(BIO *out, stname *x, int indent, \ const ASN1_PCTX *pctx); -#define D2I_OF(type) type *(*)(type **,const unsigned char **,long) -#define I2D_OF(type) int (*)(type *,unsigned char **) -#define I2D_OF_const(type) int (*)(const type *,unsigned char **) - -#define CHECKED_D2I_OF(type, d2i) \ - ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) -#define CHECKED_I2D_OF(type, i2d) \ - ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) -#define CHECKED_NEW_OF(type, xnew) \ - ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) -#define CHECKED_PPTR_OF(type, p) \ - ((void**) (1 ? p : (type**)0)) - typedef void *d2i_of_void(void **, const unsigned char **, long); typedef int i2d_of_void(const void *, unsigned char **); @@ -676,7 +666,6 @@ OPENSSL_EXPORT int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long lengt DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) OPENSSL_EXPORT int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); OPENSSL_EXPORT ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, long length); -OPENSSL_EXPORT ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, long length); OPENSSL_EXPORT ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); OPENSSL_EXPORT int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); @@ -759,76 +748,17 @@ OPENSSL_EXPORT void ASN1_put_object(unsigned char **pp, int constructed, int len OPENSSL_EXPORT int ASN1_put_eoc(unsigned char **pp); OPENSSL_EXPORT int ASN1_object_size(int constructed, int length, int tag); -/* Used to implement other functions */ -OPENSSL_EXPORT void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); - -#define ASN1_dup_of(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_dup_of_const(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(const type, x))) - OPENSSL_EXPORT void *ASN1_item_dup(const ASN1_ITEM *it, void *x); -/* ASN1 alloc/free macros for when a type is only used internally */ - -#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) -#define M_ASN1_free_of(x, type) \ - ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) - #ifndef OPENSSL_NO_FP_API -OPENSSL_EXPORT void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); - -#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - OPENSSL_EXPORT void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); -OPENSSL_EXPORT int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); - -#define ASN1_i2d_fp_of(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_i2d_fp_of_const(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - OPENSSL_EXPORT int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); OPENSSL_EXPORT int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); #endif OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); -OPENSSL_EXPORT void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); - -#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - OPENSSL_EXPORT void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); -OPENSSL_EXPORT int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, void *x); - -#define ASN1_i2d_bio_of(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_i2d_bio_of_const(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - OPENSSL_EXPORT int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); OPENSSL_EXPORT int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); @@ -872,13 +802,13 @@ OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(ASN1_OBJECT, ASN1_OBJECT_free) BORINGSSL_MAKE_DELETER(ASN1_STRING, ASN1_STRING_free) BORINGSSL_MAKE_DELETER(ASN1_TYPE, ASN1_TYPE_free) -} // namespace bssl +BSSL_NAMESPACE_END } /* extern C++ */ @@ -926,14 +856,14 @@ BORINGSSL_MAKE_DELETER(ASN1_TYPE, ASN1_TYPE_free) #define ASN1_R_INTEGER_NOT_ASCII_FORMAT 139 #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 140 #define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 141 -#define ASN1_R_INVALID_BMPSTRING_LENGTH 142 +#define ASN1_R_INVALID_BMPSTRING 142 #define ASN1_R_INVALID_DIGIT 143 #define ASN1_R_INVALID_MODIFIER 144 #define ASN1_R_INVALID_NUMBER 145 #define ASN1_R_INVALID_OBJECT_ENCODING 146 #define ASN1_R_INVALID_SEPARATOR 147 #define ASN1_R_INVALID_TIME_FORMAT 148 -#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 149 +#define ASN1_R_INVALID_UNIVERSALSTRING 149 #define ASN1_R_INVALID_UTF8STRING 150 #define ASN1_R_LIST_ERROR 151 #define ASN1_R_MISSING_ASN1_EOS 152 diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.back new file mode 100644 index 000000000..6ae831b82 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.back @@ -0,0 +1,911 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_ASN1_H +#define HEADER_ASN1_H + +#include + +#include + +#include +#include + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Legacy ASN.1 library. + * + * This header is part of OpenSSL's ASN.1 implementation. It is retained for + * compatibility but otherwise underdocumented and not actively maintained. Use + * the new |CBS| and |CBB| library in instead. */ + + +#define V_ASN1_UNIVERSAL 0x00 +#define V_ASN1_APPLICATION 0x40 +#define V_ASN1_CONTEXT_SPECIFIC 0x80 +#define V_ASN1_PRIVATE 0xc0 + +#define V_ASN1_CONSTRUCTED 0x20 +#define V_ASN1_PRIMITIVE_TAG 0x1f + +#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ +#define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ +#define V_ASN1_ANY -4 /* used in ASN1 template code */ + +#define V_ASN1_NEG 0x100 /* negative flag */ +/* No supported universal tags may exceed this value, to avoid ambiguity with + * V_ASN1_NEG. */ +#define V_ASN1_MAX_UNIVERSAL 0xff + +#define V_ASN1_UNDEF -1 +#define V_ASN1_EOC 0 +#define V_ASN1_BOOLEAN 1 /**/ +#define V_ASN1_INTEGER 2 +#define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) +#define V_ASN1_BIT_STRING 3 +#define V_ASN1_OCTET_STRING 4 +#define V_ASN1_NULL 5 +#define V_ASN1_OBJECT 6 +#define V_ASN1_OBJECT_DESCRIPTOR 7 +#define V_ASN1_EXTERNAL 8 +#define V_ASN1_REAL 9 +#define V_ASN1_ENUMERATED 10 +#define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) +#define V_ASN1_UTF8STRING 12 +#define V_ASN1_SEQUENCE 16 +#define V_ASN1_SET 17 +#define V_ASN1_NUMERICSTRING 18 /**/ +#define V_ASN1_PRINTABLESTRING 19 +#define V_ASN1_T61STRING 20 +#define V_ASN1_TELETEXSTRING 20 /* alias */ +#define V_ASN1_VIDEOTEXSTRING 21 /**/ +#define V_ASN1_IA5STRING 22 +#define V_ASN1_UTCTIME 23 +#define V_ASN1_GENERALIZEDTIME 24 /**/ +#define V_ASN1_GRAPHICSTRING 25 /**/ +#define V_ASN1_ISO64STRING 26 /**/ +#define V_ASN1_VISIBLESTRING 26 /* alias */ +#define V_ASN1_GENERALSTRING 27 /**/ +#define V_ASN1_UNIVERSALSTRING 28 /**/ +#define V_ASN1_BMPSTRING 30 + +/* For use with d2i_ASN1_type_bytes() */ +#define B_ASN1_NUMERICSTRING 0x0001 +#define B_ASN1_PRINTABLESTRING 0x0002 +#define B_ASN1_T61STRING 0x0004 +#define B_ASN1_TELETEXSTRING 0x0004 +#define B_ASN1_VIDEOTEXSTRING 0x0008 +#define B_ASN1_IA5STRING 0x0010 +#define B_ASN1_GRAPHICSTRING 0x0020 +#define B_ASN1_ISO64STRING 0x0040 +#define B_ASN1_VISIBLESTRING 0x0040 +#define B_ASN1_GENERALSTRING 0x0080 +#define B_ASN1_UNIVERSALSTRING 0x0100 +#define B_ASN1_OCTET_STRING 0x0200 +#define B_ASN1_BIT_STRING 0x0400 +#define B_ASN1_BMPSTRING 0x0800 +#define B_ASN1_UNKNOWN 0x1000 +#define B_ASN1_UTF8STRING 0x2000 +#define B_ASN1_UTCTIME 0x4000 +#define B_ASN1_GENERALIZEDTIME 0x8000 +#define B_ASN1_SEQUENCE 0x10000 + +/* For use with ASN1_mbstring_copy() */ +#define MBSTRING_FLAG 0x1000 +#define MBSTRING_UTF8 (MBSTRING_FLAG) +/* |MBSTRING_ASC| refers to Latin-1, not ASCII. It is used with TeletexString + * which, in turn, is treated as Latin-1 rather than T.61 by OpenSSL and most + * other software. */ +#define MBSTRING_ASC (MBSTRING_FLAG|1) +#define MBSTRING_BMP (MBSTRING_FLAG|2) +#define MBSTRING_UNIV (MBSTRING_FLAG|4) + +#define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */ +#define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */ + +/* These are used internally in the ASN1_OBJECT to keep track of + * whether the names and data need to be free()ed */ +#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */ +#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */ +#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */ +struct asn1_object_st + { + const char *sn,*ln; + int nid; + int length; + const unsigned char *data; /* data remains const after init */ + int flags; /* Should we free this one */ + }; + +DEFINE_STACK_OF(ASN1_OBJECT) + +#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ +/* This indicates that the ASN1_STRING is not a real value but just a place + * holder for the location where indefinite length constructed data should + * be inserted in the memory buffer + */ +#define ASN1_STRING_FLAG_NDEF 0x010 + +/* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING + * type. + */ +#define ASN1_STRING_FLAG_MSTRING 0x040 +/* This is the base type that holds just about everything :-) */ +struct asn1_string_st + { + int length; + int type; + unsigned char *data; + /* The value of the following field depends on the type being + * held. It is mostly being used for BIT_STRING so if the + * input data has a non-zero 'unused bits' value, it will be + * handled correctly */ + long flags; + }; + +/* ASN1_ENCODING structure: this is used to save the received + * encoding of an ASN1 type. This is useful to get round + * problems with invalid encodings which can break signatures. + */ + +typedef struct ASN1_ENCODING_st + { + unsigned char *enc; /* DER encoding */ + long len; /* Length of encoding */ + int modified; /* set to 1 if 'enc' is invalid */ + /* alias_only is zero if |enc| owns the buffer that it points to + * (although |enc| may still be NULL). If one, |enc| points into a + * buffer that is owned elsewhere. */ + unsigned alias_only:1; + /* alias_only_on_next_parse is one iff the next parsing operation + * should avoid taking a copy of the input and rather set + * |alias_only|. */ + unsigned alias_only_on_next_parse:1; + } ASN1_ENCODING; + +#define STABLE_FLAGS_MALLOC 0x01 +#define STABLE_NO_MASK 0x02 +#define DIRSTRING_TYPE \ + (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING) +#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING) + +typedef struct asn1_string_table_st { + int nid; + long minsize; + long maxsize; + unsigned long mask; + unsigned long flags; +} ASN1_STRING_TABLE; + +/* size limits: this stuff is taken straight from RFC2459 */ + +#define ub_name 32768 +#define ub_common_name 64 +#define ub_locality_name 128 +#define ub_state_name 128 +#define ub_organization_name 64 +#define ub_organization_unit_name 64 +#define ub_title 64 +#define ub_email_address 128 + +/* Declarations for template structures: for full definitions + * see asn1t.h + */ +typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; +typedef struct ASN1_TLC_st ASN1_TLC; +/* This is just an opaque pointer */ +typedef struct ASN1_VALUE_st ASN1_VALUE; + +/* Declare ASN1 functions: the implement macro in in asn1t.h */ + +#define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type) + +#define DECLARE_ASN1_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name) + +#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ + OPENSSL_EXPORT type *d2i_##name(type **a, const unsigned char **in, long len); \ + OPENSSL_EXPORT int i2d_##name(type *a, unsigned char **out); \ + DECLARE_ASN1_ITEM(itname) + +#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ + OPENSSL_EXPORT type *d2i_##name(type **a, const unsigned char **in, long len); \ + OPENSSL_EXPORT int i2d_##name(const type *a, unsigned char **out); \ + DECLARE_ASN1_ITEM(name) + +#define DECLARE_ASN1_NDEF_FUNCTION(name) \ + OPENSSL_EXPORT int i2d_##name##_NDEF(name *a, unsigned char **out); + +#define DECLARE_ASN1_FUNCTIONS_const(name) \ + DECLARE_ASN1_ALLOC_FUNCTIONS(name) \ + DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name) + +#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ + OPENSSL_EXPORT type *name##_new(void); \ + OPENSSL_EXPORT void name##_free(type *a); + +#define DECLARE_ASN1_PRINT_FUNCTION(stname) \ + DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname) + +#define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \ + OPENSSL_EXPORT int fname##_print_ctx(BIO *out, stname *x, int indent, \ + const ASN1_PCTX *pctx); + +typedef void *d2i_of_void(void **, const unsigned char **, long); +typedef int i2d_of_void(const void *, unsigned char **); + +/* The following macros and typedefs allow an ASN1_ITEM + * to be embedded in a structure and referenced. Since + * the ASN1_ITEM pointers need to be globally accessible + * (possibly from shared libraries) they may exist in + * different forms. On platforms that support it the + * ASN1_ITEM structure itself will be globally exported. + * Other platforms will export a function that returns + * an ASN1_ITEM pointer. + * + * To handle both cases transparently the macros below + * should be used instead of hard coding an ASN1_ITEM + * pointer in a structure. + * + * The structure will look like this: + * + * typedef struct SOMETHING_st { + * ... + * ASN1_ITEM_EXP *iptr; + * ... + * } SOMETHING; + * + * It would be initialised as e.g.: + * + * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; + * + * and the actual pointer extracted with: + * + * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); + * + * Finally an ASN1_ITEM pointer can be extracted from an + * appropriate reference with: ASN1_ITEM_rptr(X509). This + * would be used when a function takes an ASN1_ITEM * argument. + * + */ + +/* ASN1_ITEM pointer exported type */ +typedef const ASN1_ITEM ASN1_ITEM_EXP; + +/* Macro to obtain ASN1_ITEM pointer from exported type */ +#define ASN1_ITEM_ptr(iptr) (iptr) + +/* Macro to include ASN1_ITEM pointer from base type */ +#define ASN1_ITEM_ref(iptr) (&(iptr##_it)) + +#define ASN1_ITEM_rptr(ref) (&(ref##_it)) + +#define DECLARE_ASN1_ITEM(name) \ + extern OPENSSL_EXPORT const ASN1_ITEM name##_it; + +/* Parameters used by ASN1_STRING_print_ex() */ + +/* These determine which characters to escape: + * RFC2253 special characters, control characters and + * MSB set characters + */ + +#define ASN1_STRFLGS_ESC_2253 1 +#define ASN1_STRFLGS_ESC_CTRL 2 +#define ASN1_STRFLGS_ESC_MSB 4 + + +/* This flag determines how we do escaping: normally + * RC2253 backslash only, set this to use backslash and + * quote. + */ + +#define ASN1_STRFLGS_ESC_QUOTE 8 + + +/* These three flags are internal use only. */ + +/* Character is a valid PrintableString character */ +#define CHARTYPE_PRINTABLESTRING 0x10 +/* Character needs escaping if it is the first character */ +#define CHARTYPE_FIRST_ESC_2253 0x20 +/* Character needs escaping if it is the last character */ +#define CHARTYPE_LAST_ESC_2253 0x40 + +/* NB the internal flags are safely reused below by flags + * handled at the top level. + */ + +/* If this is set we convert all character strings + * to UTF8 first + */ + +#define ASN1_STRFLGS_UTF8_CONVERT 0x10 + +/* If this is set we don't attempt to interpret content: + * just assume all strings are 1 byte per character. This + * will produce some pretty odd looking output! + */ + +#define ASN1_STRFLGS_IGNORE_TYPE 0x20 + +/* If this is set we include the string type in the output */ +#define ASN1_STRFLGS_SHOW_TYPE 0x40 + +/* This determines which strings to display and which to + * 'dump' (hex dump of content octets or DER encoding). We can + * only dump non character strings or everything. If we + * don't dump 'unknown' they are interpreted as character + * strings with 1 octet per character and are subject to + * the usual escaping options. + */ + +#define ASN1_STRFLGS_DUMP_ALL 0x80 +#define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 + +/* These determine what 'dumping' does, we can dump the + * content octets or the DER encoding: both use the + * RFC2253 #XXXXX notation. + */ + +#define ASN1_STRFLGS_DUMP_DER 0x200 + +/* All the string flags consistent with RFC2253, + * escaping control characters isn't essential in + * RFC2253 but it is advisable anyway. + */ + +#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \ + ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB | \ + ASN1_STRFLGS_UTF8_CONVERT | \ + ASN1_STRFLGS_DUMP_UNKNOWN | \ + ASN1_STRFLGS_DUMP_DER) + +DEFINE_STACK_OF(ASN1_INTEGER) +DECLARE_ASN1_SET_OF(ASN1_INTEGER) + +struct asn1_type_st + { + int type; + union { + char *ptr; + ASN1_BOOLEAN boolean; + ASN1_STRING * asn1_string; + ASN1_OBJECT * object; + ASN1_INTEGER * integer; + ASN1_ENUMERATED * enumerated; + ASN1_BIT_STRING * bit_string; + ASN1_OCTET_STRING * octet_string; + ASN1_PRINTABLESTRING * printablestring; + ASN1_T61STRING * t61string; + ASN1_IA5STRING * ia5string; + ASN1_GENERALSTRING * generalstring; + ASN1_BMPSTRING * bmpstring; + ASN1_UNIVERSALSTRING * universalstring; + ASN1_UTCTIME * utctime; + ASN1_GENERALIZEDTIME * generalizedtime; + ASN1_VISIBLESTRING * visiblestring; + ASN1_UTF8STRING * utf8string; + /* set and sequence are left complete and still + * contain the set or sequence bytes */ + ASN1_STRING * set; + ASN1_STRING * sequence; + ASN1_VALUE * asn1_value; + } value; + }; + +DEFINE_STACK_OF(ASN1_TYPE) +DECLARE_ASN1_SET_OF(ASN1_TYPE) + +typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; + +DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) +DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) + +struct X509_algor_st + { + ASN1_OBJECT *algorithm; + ASN1_TYPE *parameter; + } /* X509_ALGOR */; + +DECLARE_ASN1_FUNCTIONS(X509_ALGOR) + +/* This is used to contain a list of bit names */ +typedef struct BIT_STRING_BITNAME_st { + int bitnum; + const char *lname; + const char *sname; +} BIT_STRING_BITNAME; + + +#define M_ASN1_STRING_length(x) ((x)->length) +#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n)) +#define M_ASN1_STRING_type(x) ((x)->type) +#define M_ASN1_STRING_data(x) ((x)->data) + +/* Macros for string operations */ +#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\ + ASN1_STRING_type_new(V_ASN1_BIT_STRING) +#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\ + ASN1_STRING_dup((const ASN1_STRING *)a) +#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\ + (const ASN1_STRING *)a,(const ASN1_STRING *)b) +#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) + +#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\ + ASN1_STRING_type_new(V_ASN1_INTEGER) +#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)\ + ASN1_STRING_dup((const ASN1_STRING *)a) +#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\ + (const ASN1_STRING *)a,(const ASN1_STRING *)b) + +#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\ + ASN1_STRING_type_new(V_ASN1_ENUMERATED) +#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)\ + ASN1_STRING_dup((const ASN1_STRING *)a) +#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\ + (const ASN1_STRING *)a,(const ASN1_STRING *)b) + +#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\ + ASN1_STRING_type_new(V_ASN1_OCTET_STRING) +#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\ + ASN1_STRING_dup((const ASN1_STRING *)a) +#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\ + (const ASN1_STRING *)a,(const ASN1_STRING *)b) +#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c) +#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b) + +#define B_ASN1_TIME \ + B_ASN1_UTCTIME | \ + B_ASN1_GENERALIZEDTIME + +#define B_ASN1_PRINTABLE \ + B_ASN1_NUMERICSTRING| \ + B_ASN1_PRINTABLESTRING| \ + B_ASN1_T61STRING| \ + B_ASN1_IA5STRING| \ + B_ASN1_BIT_STRING| \ + B_ASN1_UNIVERSALSTRING|\ + B_ASN1_BMPSTRING|\ + B_ASN1_UTF8STRING|\ + B_ASN1_SEQUENCE|\ + B_ASN1_UNKNOWN + +#define B_ASN1_DIRECTORYSTRING \ + B_ASN1_PRINTABLESTRING| \ + B_ASN1_TELETEXSTRING|\ + B_ASN1_BMPSTRING|\ + B_ASN1_UNIVERSALSTRING|\ + B_ASN1_UTF8STRING + +#define B_ASN1_DISPLAYTEXT \ + B_ASN1_IA5STRING| \ + B_ASN1_VISIBLESTRING| \ + B_ASN1_BMPSTRING|\ + B_ASN1_UTF8STRING + +#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING) +#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) +#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) +#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\ + ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING) +#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\ + ASN1_STRING_type_new(V_ASN1_T61STRING) +#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\ + ASN1_STRING_type_new(V_ASN1_IA5STRING) +#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_IA5STRING_dup(a) \ + (ASN1_IA5STRING *)ASN1_STRING_dup((const ASN1_STRING *)a) + +#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\ + ASN1_STRING_type_new(V_ASN1_UTCTIME) +#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)\ + ASN1_STRING_dup((const ASN1_STRING *)a) + +#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\ + ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME) +#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\ + (const ASN1_STRING *)a) + +#define M_ASN1_TIME_new() (ASN1_TIME *)\ + ASN1_STRING_type_new(V_ASN1_UTCTIME) +#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a) +#define M_ASN1_TIME_dup(a) (ASN1_TIME *)\ + ASN1_STRING_dup((const ASN1_STRING *)a) + +#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\ + ASN1_STRING_type_new(V_ASN1_GENERALSTRING) +#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\ + ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING) +#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\ + ASN1_STRING_type_new(V_ASN1_BMPSTRING) +#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\ + ASN1_STRING_type_new(V_ASN1_VISIBLESTRING) +#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\ + ASN1_STRING_type_new(V_ASN1_UTF8STRING) +#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a) + +DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) + +OPENSSL_EXPORT int ASN1_TYPE_get(ASN1_TYPE *a); +OPENSSL_EXPORT void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); +OPENSSL_EXPORT int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); +OPENSSL_EXPORT int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); + +OPENSSL_EXPORT ASN1_OBJECT * ASN1_OBJECT_new(void ); +OPENSSL_EXPORT void ASN1_OBJECT_free(ASN1_OBJECT *a); +OPENSSL_EXPORT int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp); +OPENSSL_EXPORT ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, + long length); +OPENSSL_EXPORT ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp, + long length); + +DECLARE_ASN1_ITEM(ASN1_OBJECT) + +DECLARE_ASN1_SET_OF(ASN1_OBJECT) + +OPENSSL_EXPORT ASN1_STRING * ASN1_STRING_new(void); +OPENSSL_EXPORT void ASN1_STRING_free(ASN1_STRING *a); +OPENSSL_EXPORT int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); +OPENSSL_EXPORT ASN1_STRING * ASN1_STRING_dup(const ASN1_STRING *a); +OPENSSL_EXPORT ASN1_STRING * ASN1_STRING_type_new(int type ); +OPENSSL_EXPORT int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); + /* Since this is used to store all sorts of things, via macros, for now, make + its data void * */ +OPENSSL_EXPORT int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); +OPENSSL_EXPORT void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); +OPENSSL_EXPORT int ASN1_STRING_length(const ASN1_STRING *x); +OPENSSL_EXPORT void ASN1_STRING_length_set(ASN1_STRING *x, int n); +OPENSSL_EXPORT int ASN1_STRING_type(ASN1_STRING *x); +OPENSSL_EXPORT unsigned char * ASN1_STRING_data(ASN1_STRING *x); +OPENSSL_EXPORT const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); + +DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) +OPENSSL_EXPORT int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp); +OPENSSL_EXPORT ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp, long length); +OPENSSL_EXPORT int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length ); +OPENSSL_EXPORT int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); +OPENSSL_EXPORT int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n); +OPENSSL_EXPORT int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a, unsigned char *flags, int flags_len); + +OPENSSL_EXPORT int i2d_ASN1_BOOLEAN(int a,unsigned char **pp); +OPENSSL_EXPORT int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length); + +DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) +OPENSSL_EXPORT int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); +OPENSSL_EXPORT ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, long length); +OPENSSL_EXPORT ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); +OPENSSL_EXPORT int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); + +DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) + +OPENSSL_EXPORT int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); +OPENSSL_EXPORT ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t); +OPENSSL_EXPORT ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, int offset_day, long offset_sec); +OPENSSL_EXPORT int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); +OPENSSL_EXPORT int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); +#if 0 +time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s); +#endif + +OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); +OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t); +OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, time_t t, int offset_day, long offset_sec); +OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); +OPENSSL_EXPORT int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to); + +DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) +OPENSSL_EXPORT ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a); +OPENSSL_EXPORT int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, const ASN1_OCTET_STRING *b); +OPENSSL_EXPORT int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len); + +DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_NULL) +DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) + +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) + +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) +DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) +DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) +DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) +DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) +DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) +DECLARE_ASN1_FUNCTIONS(ASN1_TIME) + +DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) + +OPENSSL_EXPORT ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t); +OPENSSL_EXPORT ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s,time_t t, int offset_day, long offset_sec); +OPENSSL_EXPORT int ASN1_TIME_check(ASN1_TIME *t); +OPENSSL_EXPORT ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out); +OPENSSL_EXPORT int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); + +OPENSSL_EXPORT int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a); +OPENSSL_EXPORT int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a); +OPENSSL_EXPORT int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a); +OPENSSL_EXPORT int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type); +OPENSSL_EXPORT int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a); + +OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len, const char *sn, const char *ln); + +OPENSSL_EXPORT int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); +OPENSSL_EXPORT int ASN1_INTEGER_set_uint64(ASN1_INTEGER *out, uint64_t v); +OPENSSL_EXPORT long ASN1_INTEGER_get(const ASN1_INTEGER *a); +OPENSSL_EXPORT ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); +OPENSSL_EXPORT BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai,BIGNUM *bn); + +OPENSSL_EXPORT int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); +OPENSSL_EXPORT long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a); +OPENSSL_EXPORT ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai); +OPENSSL_EXPORT BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn); + +/* General */ +/* given a string, return the correct type, max is the maximum length */ +OPENSSL_EXPORT int ASN1_PRINTABLE_type(const unsigned char *s, int max); + +OPENSSL_EXPORT unsigned long ASN1_tag2bit(int tag); + +/* SPECIALS */ +OPENSSL_EXPORT int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax); +OPENSSL_EXPORT void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int xclass); +OPENSSL_EXPORT int ASN1_put_eoc(unsigned char **pp); +OPENSSL_EXPORT int ASN1_object_size(int constructed, int length, int tag); + +OPENSSL_EXPORT void *ASN1_item_dup(const ASN1_ITEM *it, void *x); + +#ifndef OPENSSL_NO_FP_API +OPENSSL_EXPORT void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); +OPENSSL_EXPORT int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); +OPENSSL_EXPORT int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); +#endif + +OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); + +OPENSSL_EXPORT void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); +OPENSSL_EXPORT int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); +OPENSSL_EXPORT int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); +OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); +OPENSSL_EXPORT int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a); +OPENSSL_EXPORT int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); +OPENSSL_EXPORT int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags); +OPENSSL_EXPORT const char *ASN1_tag2str(int tag); + +/* Used to load and write netscape format cert */ + +OPENSSL_EXPORT void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it); + +OPENSSL_EXPORT ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct); + +OPENSSL_EXPORT void ASN1_STRING_set_default_mask(unsigned long mask); +OPENSSL_EXPORT int ASN1_STRING_set_default_mask_asc(const char *p); +OPENSSL_EXPORT unsigned long ASN1_STRING_get_default_mask(void); +OPENSSL_EXPORT int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask); +OPENSSL_EXPORT int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, int inform, unsigned long mask, long minsize, long maxsize); + +OPENSSL_EXPORT ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, const unsigned char *in, int inlen, int inform, int nid); +OPENSSL_EXPORT ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); +OPENSSL_EXPORT int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); +OPENSSL_EXPORT void ASN1_STRING_TABLE_cleanup(void); + +/* ASN1 template functions */ + +/* Old API compatible functions */ +OPENSSL_EXPORT ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); +OPENSSL_EXPORT void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); +OPENSSL_EXPORT ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it); +OPENSSL_EXPORT int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); +OPENSSL_EXPORT int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); + +OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf); +OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); + + +#ifdef __cplusplus +} + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(ASN1_OBJECT, ASN1_OBJECT_free) +BORINGSSL_MAKE_DELETER(ASN1_STRING, ASN1_STRING_free) +BORINGSSL_MAKE_DELETER(ASN1_TYPE, ASN1_TYPE_free) + +BSSL_NAMESPACE_END + +} /* extern C++ */ + +#endif + +#define ASN1_R_ASN1_LENGTH_MISMATCH 100 +#define ASN1_R_AUX_ERROR 101 +#define ASN1_R_BAD_GET_ASN1_OBJECT_CALL 102 +#define ASN1_R_BAD_OBJECT_HEADER 103 +#define ASN1_R_BMPSTRING_IS_WRONG_LENGTH 104 +#define ASN1_R_BN_LIB 105 +#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106 +#define ASN1_R_BUFFER_TOO_SMALL 107 +#define ASN1_R_CONTEXT_NOT_INITIALISED 108 +#define ASN1_R_DECODE_ERROR 109 +#define ASN1_R_DEPTH_EXCEEDED 110 +#define ASN1_R_DIGEST_AND_KEY_TYPE_NOT_SUPPORTED 111 +#define ASN1_R_ENCODE_ERROR 112 +#define ASN1_R_ERROR_GETTING_TIME 113 +#define ASN1_R_EXPECTING_AN_ASN1_SEQUENCE 114 +#define ASN1_R_EXPECTING_AN_INTEGER 115 +#define ASN1_R_EXPECTING_AN_OBJECT 116 +#define ASN1_R_EXPECTING_A_BOOLEAN 117 +#define ASN1_R_EXPECTING_A_TIME 118 +#define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119 +#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120 +#define ASN1_R_FIELD_MISSING 121 +#define ASN1_R_FIRST_NUM_TOO_LARGE 122 +#define ASN1_R_HEADER_TOO_LONG 123 +#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 124 +#define ASN1_R_ILLEGAL_BOOLEAN 125 +#define ASN1_R_ILLEGAL_CHARACTERS 126 +#define ASN1_R_ILLEGAL_FORMAT 127 +#define ASN1_R_ILLEGAL_HEX 128 +#define ASN1_R_ILLEGAL_IMPLICIT_TAG 129 +#define ASN1_R_ILLEGAL_INTEGER 130 +#define ASN1_R_ILLEGAL_NESTED_TAGGING 131 +#define ASN1_R_ILLEGAL_NULL 132 +#define ASN1_R_ILLEGAL_NULL_VALUE 133 +#define ASN1_R_ILLEGAL_OBJECT 134 +#define ASN1_R_ILLEGAL_OPTIONAL_ANY 135 +#define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 136 +#define ASN1_R_ILLEGAL_TAGGED_ANY 137 +#define ASN1_R_ILLEGAL_TIME_VALUE 138 +#define ASN1_R_INTEGER_NOT_ASCII_FORMAT 139 +#define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 140 +#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 141 +#define ASN1_R_INVALID_BMPSTRING 142 +#define ASN1_R_INVALID_DIGIT 143 +#define ASN1_R_INVALID_MODIFIER 144 +#define ASN1_R_INVALID_NUMBER 145 +#define ASN1_R_INVALID_OBJECT_ENCODING 146 +#define ASN1_R_INVALID_SEPARATOR 147 +#define ASN1_R_INVALID_TIME_FORMAT 148 +#define ASN1_R_INVALID_UNIVERSALSTRING 149 +#define ASN1_R_INVALID_UTF8STRING 150 +#define ASN1_R_LIST_ERROR 151 +#define ASN1_R_MISSING_ASN1_EOS 152 +#define ASN1_R_MISSING_EOC 153 +#define ASN1_R_MISSING_SECOND_NUMBER 154 +#define ASN1_R_MISSING_VALUE 155 +#define ASN1_R_MSTRING_NOT_UNIVERSAL 156 +#define ASN1_R_MSTRING_WRONG_TAG 157 +#define ASN1_R_NESTED_ASN1_ERROR 158 +#define ASN1_R_NESTED_ASN1_STRING 159 +#define ASN1_R_NON_HEX_CHARACTERS 160 +#define ASN1_R_NOT_ASCII_FORMAT 161 +#define ASN1_R_NOT_ENOUGH_DATA 162 +#define ASN1_R_NO_MATCHING_CHOICE_TYPE 163 +#define ASN1_R_NULL_IS_WRONG_LENGTH 164 +#define ASN1_R_OBJECT_NOT_ASCII_FORMAT 165 +#define ASN1_R_ODD_NUMBER_OF_CHARS 166 +#define ASN1_R_SECOND_NUMBER_TOO_LARGE 167 +#define ASN1_R_SEQUENCE_LENGTH_MISMATCH 168 +#define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 169 +#define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 170 +#define ASN1_R_SHORT_LINE 171 +#define ASN1_R_STREAMING_NOT_SUPPORTED 172 +#define ASN1_R_STRING_TOO_LONG 173 +#define ASN1_R_STRING_TOO_SHORT 174 +#define ASN1_R_TAG_VALUE_TOO_HIGH 175 +#define ASN1_R_TIME_NOT_ASCII_FORMAT 176 +#define ASN1_R_TOO_LONG 177 +#define ASN1_R_TYPE_NOT_CONSTRUCTED 178 +#define ASN1_R_TYPE_NOT_PRIMITIVE 179 +#define ASN1_R_UNEXPECTED_EOC 180 +#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 181 +#define ASN1_R_UNKNOWN_FORMAT 182 +#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 183 +#define ASN1_R_UNKNOWN_SIGNATURE_ALGORITHM 184 +#define ASN1_R_UNKNOWN_TAG 185 +#define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 186 +#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 187 +#define ASN1_R_UNSUPPORTED_TYPE 188 +#define ASN1_R_WRONG_PUBLIC_KEY_TYPE 189 +#define ASN1_R_WRONG_TAG 190 +#define ASN1_R_WRONG_TYPE 191 +#define ASN1_R_NESTED_TOO_DEEP 192 + +#endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/asn1.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/asn1.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.grpc_back index f2e92a773..6ae831b82 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/asn1.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/asn1.h.grpc_back @@ -152,6 +152,9 @@ extern "C" { /* For use with ASN1_mbstring_copy() */ #define MBSTRING_FLAG 0x1000 #define MBSTRING_UTF8 (MBSTRING_FLAG) +/* |MBSTRING_ASC| refers to Latin-1, not ASCII. It is used with TeletexString + * which, in turn, is treated as Latin-1 rather than T.61 by OpenSSL and most + * other software. */ #define MBSTRING_ASC (MBSTRING_FLAG|1) #define MBSTRING_BMP (MBSTRING_FLAG|2) #define MBSTRING_UNIV (MBSTRING_FLAG|4) @@ -295,19 +298,6 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; OPENSSL_EXPORT int fname##_print_ctx(BIO *out, stname *x, int indent, \ const ASN1_PCTX *pctx); -#define D2I_OF(type) type *(*)(type **,const unsigned char **,long) -#define I2D_OF(type) int (*)(type *,unsigned char **) -#define I2D_OF_const(type) int (*)(const type *,unsigned char **) - -#define CHECKED_D2I_OF(type, d2i) \ - ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) -#define CHECKED_I2D_OF(type, i2d) \ - ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) -#define CHECKED_NEW_OF(type, xnew) \ - ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) -#define CHECKED_PPTR_OF(type, p) \ - ((void**) (1 ? p : (type**)0)) - typedef void *d2i_of_void(void **, const unsigned char **, long); typedef int i2d_of_void(const void *, unsigned char **); @@ -676,7 +666,6 @@ OPENSSL_EXPORT int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long lengt DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) OPENSSL_EXPORT int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp); OPENSSL_EXPORT ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp, long length); -OPENSSL_EXPORT ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp, long length); OPENSSL_EXPORT ASN1_INTEGER * ASN1_INTEGER_dup(const ASN1_INTEGER *x); OPENSSL_EXPORT int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); @@ -759,76 +748,17 @@ OPENSSL_EXPORT void ASN1_put_object(unsigned char **pp, int constructed, int len OPENSSL_EXPORT int ASN1_put_eoc(unsigned char **pp); OPENSSL_EXPORT int ASN1_object_size(int constructed, int length, int tag); -/* Used to implement other functions */ -OPENSSL_EXPORT void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x); - -#define ASN1_dup_of(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_dup_of_const(type,i2d,d2i,x) \ - ((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \ - CHECKED_D2I_OF(type, d2i), \ - CHECKED_PTR_OF(const type, x))) - OPENSSL_EXPORT void *ASN1_item_dup(const ASN1_ITEM *it, void *x); -/* ASN1 alloc/free macros for when a type is only used internally */ - -#define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) -#define M_ASN1_free_of(x, type) \ - ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) - #ifndef OPENSSL_NO_FP_API -OPENSSL_EXPORT void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x); - -#define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - OPENSSL_EXPORT void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); -OPENSSL_EXPORT int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x); - -#define ASN1_i2d_fp_of(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_i2d_fp_of_const(type,i2d,out,x) \ - (ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - OPENSSL_EXPORT int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x); OPENSSL_EXPORT int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags); #endif OPENSSL_EXPORT int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in); -OPENSSL_EXPORT void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x); - -#define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ - ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ - CHECKED_D2I_OF(type, d2i), \ - in, \ - CHECKED_PPTR_OF(type, x))) - OPENSSL_EXPORT void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x); -OPENSSL_EXPORT int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, void *x); - -#define ASN1_i2d_bio_of(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ - out, \ - CHECKED_PTR_OF(type, x))) - -#define ASN1_i2d_bio_of_const(type,i2d,out,x) \ - (ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \ - out, \ - CHECKED_PTR_OF(const type, x))) - OPENSSL_EXPORT int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x); OPENSSL_EXPORT int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); OPENSSL_EXPORT int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); @@ -872,13 +802,13 @@ OPENSSL_EXPORT ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(ASN1_OBJECT, ASN1_OBJECT_free) BORINGSSL_MAKE_DELETER(ASN1_STRING, ASN1_STRING_free) BORINGSSL_MAKE_DELETER(ASN1_TYPE, ASN1_TYPE_free) -} // namespace bssl +BSSL_NAMESPACE_END } /* extern C++ */ @@ -926,14 +856,14 @@ BORINGSSL_MAKE_DELETER(ASN1_TYPE, ASN1_TYPE_free) #define ASN1_R_INTEGER_NOT_ASCII_FORMAT 139 #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 140 #define ASN1_R_INVALID_BIT_STRING_BITS_LEFT 141 -#define ASN1_R_INVALID_BMPSTRING_LENGTH 142 +#define ASN1_R_INVALID_BMPSTRING 142 #define ASN1_R_INVALID_DIGIT 143 #define ASN1_R_INVALID_MODIFIER 144 #define ASN1_R_INVALID_NUMBER 145 #define ASN1_R_INVALID_OBJECT_ENCODING 146 #define ASN1_R_INVALID_SEPARATOR 147 #define ASN1_R_INVALID_TIME_FORMAT 148 -#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 149 +#define ASN1_R_INVALID_UNIVERSALSTRING 149 #define ASN1_R_INVALID_UTF8STRING 150 #define ASN1_R_LIST_ERROR 151 #define ASN1_R_MISSING_ASN1_EOS 152 diff --git a/Pods/BoringSSL-GRPC/include/openssl/asn1_mac.h b/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/asn1_mac.h rename to Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/asn1_mac.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/asn1_mac.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.grpc_back new file mode 100644 index 000000000..666e5696c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/asn1_mac.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "asn1.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/asn1t.h b/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/asn1t.h rename to Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/asn1t.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/asn1t.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.grpc_back new file mode 100644 index 000000000..7bd77017a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/asn1t.h.grpc_back @@ -0,0 +1,892 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 2000. + */ +/* ==================================================================== + * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +#ifndef HEADER_ASN1T_H +#define HEADER_ASN1T_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Legacy ASN.1 library template definitions. + * + * This header is used to define new types in OpenSSL's ASN.1 implementation. It + * is deprecated and will be unexported from the library. Use the new |CBS| and + * |CBB| library in instead. */ + + +/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */ +#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr)) + + +/* Macros for start and end of ASN1_ITEM definition */ + +#define ASN1_ITEM_start(itname) \ + const ASN1_ITEM itname##_it = { + +#define ASN1_ITEM_end(itname) \ + }; + +/* Macros to aid ASN1 template writing */ + +#define ASN1_ITEM_TEMPLATE(tname) \ + static const ASN1_TEMPLATE tname##_item_tt + +#define ASN1_ITEM_TEMPLATE_END(tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_PRIMITIVE,\ + -1,\ + &tname##_item_tt,\ + 0,\ + NULL,\ + 0,\ + #tname \ + ASN1_ITEM_end(tname) + + +/* This is a ASN1 type which just embeds a template */ + +/* This pair helps declare a SEQUENCE. We can do: + * + * ASN1_SEQUENCE(stname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END(stname) + * + * This will produce an ASN1_ITEM called stname_it + * for a structure called stname. + * + * If you want the same structure but a different + * name then use: + * + * ASN1_SEQUENCE(itname) = { + * ... SEQUENCE components ... + * } ASN1_SEQUENCE_END_name(stname, itname) + * + * This will create an item called itname_it using + * a structure called stname. + */ + +#define ASN1_SEQUENCE(tname) \ + static const ASN1_TEMPLATE tname##_seq_tt[] + +#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname) + +#define ASN1_SEQUENCE_END_name(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE(tname) \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \ + ASN1_SEQUENCE_cb(tname, cb) + +#define ASN1_SEQUENCE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, cb, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_BROKEN_SEQUENCE(tname) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_ref(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), cb, 0}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_SEQUENCE_enc(tname, enc, cb) \ + static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, cb, offsetof(tname, enc)}; \ + ASN1_SEQUENCE(tname) + +#define ASN1_NDEF_SEQUENCE_END(tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(tname),\ + #tname \ + ASN1_ITEM_end(tname) + +#define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname) + +#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname) + +#define ASN1_SEQUENCE_END_ref(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_NDEF_SEQUENCE,\ + V_ASN1_SEQUENCE,\ + tname##_seq_tt,\ + sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + + +/* This pair helps declare a CHOICE type. We can do: + * + * ASN1_CHOICE(chname) = { + * ... CHOICE options ... + * ASN1_CHOICE_END(chname) + * + * This will produce an ASN1_ITEM called chname_it + * for a structure called chname. The structure + * definition must look like this: + * typedef struct { + * int type; + * union { + * ASN1_SOMETHING *opt1; + * ASN1_SOMEOTHER *opt2; + * } value; + * } chname; + * + * the name of the selector must be 'type'. + * to use an alternative selector name use the + * ASN1_CHOICE_END_selector() version. + */ + +#define ASN1_CHOICE(tname) \ + static const ASN1_TEMPLATE tname##_ch_tt[] + +#define ASN1_CHOICE_cb(tname, cb) \ + static const ASN1_AUX tname##_aux = {NULL, 0, 0, cb, 0}; \ + ASN1_CHOICE(tname) + +#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname) + +#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type) + +#define ASN1_CHOICE_END_selector(stname, tname, selname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + NULL,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +#define ASN1_CHOICE_END_cb(stname, tname, selname) \ + ;\ + ASN1_ITEM_start(tname) \ + ASN1_ITYPE_CHOICE,\ + offsetof(stname,selname) ,\ + tname##_ch_tt,\ + sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\ + &tname##_aux,\ + sizeof(stname),\ + #stname \ + ASN1_ITEM_end(tname) + +/* This helps with the template wrapper form of ASN1_ITEM */ + +#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \ + (flags), (tag), 0,\ + #name, ASN1_ITEM_ref(type) } + +/* These help with SEQUENCE or CHOICE components */ + +/* used to declare other types */ + +#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \ + (flags), (tag), offsetof(stname, field),\ + #field, ASN1_ITEM_ref(type) } + +/* used when the structure is combined with the parent */ + +#define ASN1_EX_COMBINE(flags, tag, type) { \ + (flags)|ASN1_TFLG_COMBINE, (tag), 0, NULL, ASN1_ITEM_ref(type) } + +/* implicit and explicit helper macros */ + +#define ASN1_IMP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | ex, tag, stname, field, type) + +#define ASN1_EXP_EX(stname, field, type, tag, ex) \ + ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | ex, tag, stname, field, type) + +/* Any defined by macros: the field used is in the table itself */ + +#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } +#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) } +/* Plain simple type */ +#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type) + +/* OPTIONAL simple type */ +#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* IMPLICIT tagged simple type */ +#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0) + +/* IMPLICIT tagged OPTIONAL simple type */ +#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) + +/* Same as above but EXPLICIT */ + +#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0) +#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL) + +/* SEQUENCE OF type */ +#define ASN1_SEQUENCE_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type) + +/* OPTIONAL SEQUENCE OF */ +#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Same as above but for SET OF */ + +#define ASN1_SET_OF(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type) + +#define ASN1_SET_OF_OPT(stname, field, type) \ + ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type) + +/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */ + +#define ASN1_IMP_SET_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_EXP_SET_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF) + +#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) + +#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF) + +#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL) + +/* EXPLICIT using indefinite length constructed form */ +#define ASN1_NDEF_EXP(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF) + +/* EXPLICIT OPTIONAL using indefinite length constructed form */ +#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \ + ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF) + +/* Macros for the ASN1_ADB structure */ + +#define ASN1_ADB(name) \ + static const ASN1_ADB_TABLE name##_adbtbl[] + +#define ASN1_ADB_END(name, flags, field, app_table, def, none) \ + ;\ + static const ASN1_ADB name##_adb = {\ + flags,\ + offsetof(name, field),\ + app_table,\ + name##_adbtbl,\ + sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\ + def,\ + none\ + } + +#define ADB_ENTRY(val, template) {val, template} + +#define ASN1_ADB_TEMPLATE(name) \ + static const ASN1_TEMPLATE name##_tt + +/* This is the ASN1 template structure that defines + * a wrapper round the actual type. It determines the + * actual position of the field in the value structure, + * various flags such as OPTIONAL and the field name. + */ + +struct ASN1_TEMPLATE_st { +unsigned long flags; /* Various flags */ +long tag; /* tag, not used if no tagging */ +unsigned long offset; /* Offset of this field in structure */ +#ifndef NO_ASN1_FIELD_NAMES +const char *field_name; /* Field name */ +#endif +ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */ +}; + +/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */ + +#define ASN1_TEMPLATE_item(t) (t->item_ptr) +#define ASN1_TEMPLATE_adb(t) (t->item_ptr) + +typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE; +typedef struct ASN1_ADB_st ASN1_ADB; + +typedef struct asn1_must_be_null_st ASN1_MUST_BE_NULL; + +struct ASN1_ADB_st { + unsigned long flags; /* Various flags */ + unsigned long offset; /* Offset of selector field */ + ASN1_MUST_BE_NULL *unused; + const ASN1_ADB_TABLE *tbl; /* Table of possible types */ + long tblcount; /* Number of entries in tbl */ + const ASN1_TEMPLATE *default_tt; /* Type to use if no match */ + const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */ +}; + +struct ASN1_ADB_TABLE_st { + long value; /* NID for an object or value for an int */ + const ASN1_TEMPLATE tt; /* item for this value */ +}; + +/* template flags */ + +/* Field is optional */ +#define ASN1_TFLG_OPTIONAL (0x1) + +/* Field is a SET OF */ +#define ASN1_TFLG_SET_OF (0x1 << 1) + +/* Field is a SEQUENCE OF */ +#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1) + +/* Special case: this refers to a SET OF that + * will be sorted into DER order when encoded *and* + * the corresponding STACK will be modified to match + * the new order. + */ +#define ASN1_TFLG_SET_ORDER (0x3 << 1) + +/* Mask for SET OF or SEQUENCE OF */ +#define ASN1_TFLG_SK_MASK (0x3 << 1) + +/* These flags mean the tag should be taken from the + * tag field. If EXPLICIT then the underlying type + * is used for the inner tag. + */ + +/* IMPLICIT tagging */ +#define ASN1_TFLG_IMPTAG (0x1 << 3) + + +/* EXPLICIT tagging, inner tag from underlying type */ +#define ASN1_TFLG_EXPTAG (0x2 << 3) + +#define ASN1_TFLG_TAG_MASK (0x3 << 3) + +/* context specific IMPLICIT */ +#define ASN1_TFLG_IMPLICIT ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT + +/* context specific EXPLICIT */ +#define ASN1_TFLG_EXPLICIT ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT + +/* If tagging is in force these determine the + * type of tag to use. Otherwise the tag is + * determined by the underlying type. These + * values reflect the actual octet format. + */ + +/* Universal tag */ +#define ASN1_TFLG_UNIVERSAL (0x0<<6) +/* Application tag */ +#define ASN1_TFLG_APPLICATION (0x1<<6) +/* Context specific tag */ +#define ASN1_TFLG_CONTEXT (0x2<<6) +/* Private tag */ +#define ASN1_TFLG_PRIVATE (0x3<<6) + +#define ASN1_TFLG_TAG_CLASS (0x3<<6) + +/* These are for ANY DEFINED BY type. In this case + * the 'item' field points to an ASN1_ADB structure + * which contains a table of values to decode the + * relevant type + */ + +#define ASN1_TFLG_ADB_MASK (0x3<<8) + +#define ASN1_TFLG_ADB_OID (0x1<<8) + +#define ASN1_TFLG_ADB_INT (0x1<<9) + +/* This flag means a parent structure is passed + * instead of the field: this is useful is a + * SEQUENCE is being combined with a CHOICE for + * example. Since this means the structure and + * item name will differ we need to use the + * ASN1_CHOICE_END_name() macro for example. + */ + +#define ASN1_TFLG_COMBINE (0x1<<10) + +/* This flag when present in a SEQUENCE OF, SET OF + * or EXPLICIT causes indefinite length constructed + * encoding to be used if required. + */ + +#define ASN1_TFLG_NDEF (0x1<<11) + +/* This is the actual ASN1 item itself */ + +struct ASN1_ITEM_st { +char itype; /* The item type, primitive, SEQUENCE, CHOICE or extern */ +long utype; /* underlying type */ +const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains the contents */ +long tcount; /* Number of templates if SEQUENCE or CHOICE */ +const void *funcs; /* functions that handle this type */ +long size; /* Structure size (usually)*/ +#ifndef NO_ASN1_FIELD_NAMES +const char *sname; /* Structure name */ +#endif +}; + +/* These are values for the itype field and + * determine how the type is interpreted. + * + * For PRIMITIVE types the underlying type + * determines the behaviour if items is NULL. + * + * Otherwise templates must contain a single + * template and the type is treated in the + * same way as the type specified in the template. + * + * For SEQUENCE types the templates field points + * to the members, the size field is the + * structure size. + * + * For CHOICE types the templates field points + * to each possible member (typically a union) + * and the 'size' field is the offset of the + * selector. + * + * The 'funcs' field is used for application + * specific functions. + * + * For COMPAT types the funcs field gives a + * set of functions that handle this type, this + * supports the old d2i, i2d convention. + * + * The EXTERN type uses a new style d2i/i2d. + * The new style should be used where possible + * because it avoids things like the d2i IMPLICIT + * hack. + * + * MSTRING is a multiple string type, it is used + * for a CHOICE of character strings where the + * actual strings all occupy an ASN1_STRING + * structure. In this case the 'utype' field + * has a special meaning, it is used as a mask + * of acceptable types using the B_ASN1 constants. + * + * NDEF_SEQUENCE is the same as SEQUENCE except + * that it will use indefinite length constructed + * encoding if requested. + * + */ + +#define ASN1_ITYPE_PRIMITIVE 0x0 + +#define ASN1_ITYPE_SEQUENCE 0x1 + +#define ASN1_ITYPE_CHOICE 0x2 + +#define ASN1_ITYPE_COMPAT 0x3 + +#define ASN1_ITYPE_EXTERN 0x4 + +#define ASN1_ITYPE_MSTRING 0x5 + +#define ASN1_ITYPE_NDEF_SEQUENCE 0x6 + +/* Cache for ASN1 tag and length, so we + * don't keep re-reading it for things + * like CHOICE + */ + +struct ASN1_TLC_st{ + char valid; /* Values below are valid */ + int ret; /* return value */ + long plen; /* length */ + int ptag; /* class value */ + int pclass; /* class value */ + int hdrlen; /* header length */ +}; + +/* Typedefs for ASN1 function pointers */ + +typedef ASN1_VALUE * ASN1_new_func(void); +typedef void ASN1_free_func(ASN1_VALUE *a); +typedef ASN1_VALUE * ASN1_d2i_func(ASN1_VALUE **a, const unsigned char ** in, long length); +typedef int ASN1_i2d_func(ASN1_VALUE * a, unsigned char **in); + +typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); +typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it); +typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it); + +typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval, + int indent, const char *fname, + const ASN1_PCTX *pctx); + +typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); +typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); +typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent, const ASN1_PCTX *pctx); + +typedef struct ASN1_COMPAT_FUNCS_st { + ASN1_new_func *asn1_new; + ASN1_free_func *asn1_free; + ASN1_d2i_func *asn1_d2i; + ASN1_i2d_func *asn1_i2d; +} ASN1_COMPAT_FUNCS; + +typedef struct ASN1_EXTERN_FUNCS_st { + void *app_data; + ASN1_ex_new_func *asn1_ex_new; + ASN1_ex_free_func *asn1_ex_free; + ASN1_ex_free_func *asn1_ex_clear; + ASN1_ex_d2i *asn1_ex_d2i; + ASN1_ex_i2d *asn1_ex_i2d; + /* asn1_ex_print is unused. */ + ASN1_ex_print_func *asn1_ex_print; +} ASN1_EXTERN_FUNCS; + +typedef struct ASN1_PRIMITIVE_FUNCS_st { + void *app_data; + unsigned long flags; + ASN1_ex_new_func *prim_new; + ASN1_ex_free_func *prim_free; + ASN1_ex_free_func *prim_clear; + ASN1_primitive_c2i *prim_c2i; + ASN1_primitive_i2c *prim_i2c; + ASN1_primitive_print *prim_print; +} ASN1_PRIMITIVE_FUNCS; + +/* This is the ASN1_AUX structure: it handles various + * miscellaneous requirements. For example the use of + * reference counts and an informational callback. + * + * The "informational callback" is called at various + * points during the ASN1 encoding and decoding. It can + * be used to provide minor customisation of the structures + * used. This is most useful where the supplied routines + * *almost* do the right thing but need some extra help + * at a few points. If the callback returns zero then + * it is assumed a fatal error has occurred and the + * main operation should be abandoned. + * + * If major changes in the default behaviour are required + * then an external type is more appropriate. + */ + +typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it, + void *exarg); + +typedef struct ASN1_AUX_st { + void *app_data; + int flags; + int ref_offset; /* Offset of reference value */ + ASN1_aux_cb *asn1_cb; + int enc_offset; /* Offset of ASN1_ENCODING structure */ +} ASN1_AUX; + +/* For print related callbacks exarg points to this structure */ +typedef struct ASN1_PRINT_ARG_st { + BIO *out; + int indent; + const ASN1_PCTX *pctx; +} ASN1_PRINT_ARG; + +/* For streaming related callbacks exarg points to this structure */ +typedef struct ASN1_STREAM_ARG_st { + /* BIO to stream through */ + BIO *out; + /* BIO with filters appended */ + BIO *ndef_bio; + /* Streaming I/O boundary */ + unsigned char **boundary; +} ASN1_STREAM_ARG; + +/* Flags in ASN1_AUX */ + +/* Use a reference count */ +#define ASN1_AFLG_REFCOUNT 1 +/* Save the encoding of structure (useful for signatures) */ +#define ASN1_AFLG_ENCODING 2 +/* The Sequence length is invalid */ +#define ASN1_AFLG_BROKEN 4 + +/* operation values for asn1_cb */ + +#define ASN1_OP_NEW_PRE 0 +#define ASN1_OP_NEW_POST 1 +#define ASN1_OP_FREE_PRE 2 +#define ASN1_OP_FREE_POST 3 +#define ASN1_OP_D2I_PRE 4 +#define ASN1_OP_D2I_POST 5 +#define ASN1_OP_I2D_PRE 6 +#define ASN1_OP_I2D_POST 7 +#define ASN1_OP_PRINT_PRE 8 +#define ASN1_OP_PRINT_POST 9 +#define ASN1_OP_STREAM_PRE 10 +#define ASN1_OP_STREAM_POST 11 +#define ASN1_OP_DETACHED_PRE 12 +#define ASN1_OP_DETACHED_POST 13 + +/* Macro to implement a primitive type */ +#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0) +#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \ + ASN1_ITEM_end(itname) + +/* Macro to implement a multi string type */ +#define IMPLEMENT_ASN1_MSTRING(itname, mask) \ + ASN1_ITEM_start(itname) \ + ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \ + ASN1_ITEM_end(itname) + +/* Macro to implement an ASN1_ITEM in terms of old style funcs */ + +#define IMPLEMENT_COMPAT_ASN1(sname) IMPLEMENT_COMPAT_ASN1_type(sname, V_ASN1_SEQUENCE) + +#define IMPLEMENT_COMPAT_ASN1_type(sname, tag) \ + static const ASN1_COMPAT_FUNCS sname##_ff = { \ + (ASN1_new_func *)sname##_new, \ + (ASN1_free_func *)sname##_free, \ + (ASN1_d2i_func *)d2i_##sname, \ + (ASN1_i2d_func *)i2d_##sname, \ + }; \ + ASN1_ITEM_start(sname) \ + ASN1_ITYPE_COMPAT, \ + tag, \ + NULL, \ + 0, \ + &sname##_ff, \ + 0, \ + #sname \ + ASN1_ITEM_end(sname) + +#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \ + ASN1_ITEM_start(sname) \ + ASN1_ITYPE_EXTERN, \ + tag, \ + NULL, \ + 0, \ + &fptrs, \ + 0, \ + #sname \ + ASN1_ITEM_end(sname) + +/* Macro to implement standard functions in terms of ASN1_ITEM structures */ + +#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname) + +#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \ + IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname) + +#define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname) + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \ + pre stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + pre void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \ + stname *fname##_new(void) \ + { \ + return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \ + } \ + void fname##_free(stname *a) \ + { \ + ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ + } \ + int i2d_##fname(stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + } + +#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \ + int i2d_##stname##_NDEF(stname *a, unsigned char **out) \ + { \ + return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\ + } + +/* This includes evil casts to remove const: they will go away when full + * ASN1 constification is done. + */ +#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + stname *d2i_##fname(stname **a, const unsigned char **in, long len) \ + { \ + return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\ + } \ + int i2d_##fname(const stname *a, unsigned char **out) \ + { \ + return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\ + } + +#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \ + stname * stname##_dup(stname *x) \ + { \ + return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \ + } + +#define IMPLEMENT_ASN1_FUNCTIONS_const(name) \ + IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name) + +#define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \ + IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) + +/* external definitions for primitive types */ + +DECLARE_ASN1_ITEM(ASN1_BOOLEAN) +DECLARE_ASN1_ITEM(ASN1_TBOOLEAN) +DECLARE_ASN1_ITEM(ASN1_FBOOLEAN) +DECLARE_ASN1_ITEM(ASN1_SEQUENCE) + +DEFINE_STACK_OF(ASN1_VALUE) + +/* Functions used internally by the ASN1 code */ + +int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it); +void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it); + +void ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); +int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_ITEM *it, + int tag, int aclass, char opt, ASN1_TLC *ctx); + +int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, const ASN1_ITEM *it, int tag, int aclass); +void ASN1_primitive_free(ASN1_VALUE **pval, const ASN1_ITEM *it); + +int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); +int asn1_ex_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); + +int asn1_get_choice_selector(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_set_choice_selector(ASN1_VALUE **pval, int value, const ASN1_ITEM *it); + +ASN1_VALUE ** asn1_get_field_ptr(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt); + +const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr); + +void asn1_refcount_set_one(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_refcount_dec_and_test_zero(ASN1_VALUE **pval, const ASN1_ITEM *it); + +void asn1_enc_init(ASN1_VALUE **pval, const ASN1_ITEM *it); +void asn1_enc_free(ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_enc_restore(int *len, unsigned char **out, ASN1_VALUE **pval, const ASN1_ITEM *it); +int asn1_enc_save(ASN1_VALUE **pval, const unsigned char *in, int inlen, const ASN1_ITEM *it); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/base.h b/Pods/BoringSSL-GRPC/src/include/openssl/base.h similarity index 75% rename from Pods/BoringSSL-GRPC/include/openssl/base.h rename to Pods/BoringSSL-GRPC/src/include/openssl/base.h index 832b441d8..5a78ac4af 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/base.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/base.h @@ -6,7 +6,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -65,6 +65,10 @@ #include #endif +#if defined(__APPLE__) +#include +#endif + // Include a BoringSSL-only header so consumers including this header without // setting up include paths do not accidentally pick up the system // opensslconf.h. @@ -120,6 +124,14 @@ extern "C" { #if defined(__APPLE__) #define OPENSSL_APPLE +// Note |TARGET_OS_MAC| is set for all Apple OS variants. |TARGET_OS_OSX| +// targets macOS specifically. +#if defined(TARGET_OS_OSX) && TARGET_OS_OSX +#define OPENSSL_MACOS +#endif +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#define OPENSSL_IOS +#endif #endif #if defined(_WIN32) @@ -136,10 +148,27 @@ extern "C" { #if defined(TRUSTY) #define OPENSSL_TRUSTY -#define OPENSSL_NO_THREADS +#define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED +#endif + +#if defined(__ANDROID_API__) +#define OPENSSL_ANDROID #endif -#if !defined(OPENSSL_NO_THREADS) +// BoringSSL requires platform's locking APIs to make internal global state +// thread-safe, including the PRNG. On some single-threaded embedded platforms, +// locking APIs may not exist, so this dependency may be disabled with the +// following build flag. +// +// IMPORTANT: Doing so means the consumer promises the library will never be +// used in any multi-threaded context. It causes BoringSSL to be globally +// thread-unsafe. Setting it inappropriately will subtly and unpredictably +// corrupt memory and leak secret keys. +// +// Do not set this flag on any platform where threads are possible. BoringSSL +// maintainers will not provide support for any consumers that do so. Changes +// which break such unsupported configurations will not be reverted. +#if !defined(OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED) #define OPENSSL_THREADS #endif @@ -155,7 +184,7 @@ extern "C" { // A consumer may use this symbol in the preprocessor to temporarily build // against multiple revisions of BoringSSL at the same time. It is not // recommended to do so for longer than is necessary. -#define BORINGSSL_API_VERSION 7 +#define BORINGSSL_API_VERSION 9 #if defined(BORINGSSL_SHARED_LIBRARY) @@ -213,6 +242,35 @@ extern "C" { #define OPENSSL_UNUSED #endif +// C and C++ handle inline functions differently. In C++, an inline function is +// defined in just the header file, potentially emitted in multiple compilation +// units (in cases the compiler did not inline), but each copy must be identical +// to satsify ODR. In C, a non-static inline must be manually emitted in exactly +// one compilation unit with a separate extern inline declaration. +// +// In both languages, exported inline functions referencing file-local symbols +// are problematic. C forbids this altogether (though GCC and Clang seem not to +// enforce it). It works in C++, but ODR requires the definitions be identical, +// including all names in the definitions resolving to the "same entity". In +// practice, this is unlikely to be a problem, but an inline function that +// returns a pointer to a file-local symbol +// could compile oddly. +// +// Historically, we used static inline in headers. However, to satisfy ODR, use +// plain inline in C++, to allow inline consumer functions to call our header +// functions. Plain inline would also work better with C99 inline, but that is +// not used much in practice, extern inline is tedious, and there are conflicts +// with the old gnu89 model: +// https://stackoverflow.com/questions/216510/extern-inline +#if defined(__cplusplus) +#define OPENSSL_INLINE inline +#else +// Add OPENSSL_UNUSED so that, should an inline function be emitted via macro +// (e.g. a |STACK_OF(T)| implementation) in a source file without tripping +// clang's -Wunused-function. +#define OPENSSL_INLINE static inline OPENSSL_UNUSED +#endif + #if defined(BORINGSSL_UNSAFE_FUZZER_MODE) && \ !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) #define BORINGSSL_UNSAFE_DETERMINISTIC_MODE @@ -222,9 +280,38 @@ extern "C" { #if __has_feature(address_sanitizer) #define OPENSSL_ASAN #endif +#if __has_feature(thread_sanitizer) +#define OPENSSL_TSAN +#endif #if __has_feature(memory_sanitizer) #define OPENSSL_MSAN +#define OPENSSL_ASM_INCOMPATIBLE +#endif +#endif + +#if defined(OPENSSL_ASM_INCOMPATIBLE) +#undef OPENSSL_ASM_INCOMPATIBLE +#if !defined(OPENSSL_NO_ASM) +#define OPENSSL_NO_ASM #endif +#endif // OPENSSL_ASM_INCOMPATIBLE + +#if defined(__cplusplus) +// enums can be predeclared, but only in C++ and only if given an explicit type. +// C doesn't support setting an explicit type for enums thus a #define is used +// to do this only for C++. However, the ABI type between C and C++ need to have +// equal sizes, which is confirmed in a unittest. +#define BORINGSSL_ENUM_INT : int +enum ssl_early_data_reason_t BORINGSSL_ENUM_INT; +enum ssl_encryption_level_t BORINGSSL_ENUM_INT; +enum ssl_private_key_result_t BORINGSSL_ENUM_INT; +enum ssl_renegotiate_mode_t BORINGSSL_ENUM_INT; +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT; +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT; +enum ssl_ticket_aead_result_t BORINGSSL_ENUM_INT; +enum ssl_verify_result_t BORINGSSL_ENUM_INT; +#else +#define BORINGSSL_ENUM_INT #endif // CRYPTO_THREADID is a dummy value. @@ -330,6 +417,7 @@ typedef struct ssl_cipher_st SSL_CIPHER; typedef struct ssl_ctx_st SSL_CTX; typedef struct ssl_method_st SSL_METHOD; typedef struct ssl_private_key_method_st SSL_PRIVATE_KEY_METHOD; +typedef struct ssl_quic_method_st SSL_QUIC_METHOD; typedef struct ssl_session_st SSL_SESSION; typedef struct ssl_st SSL; typedef struct ssl_ticket_aead_method_st SSL_TICKET_AEAD_METHOD; @@ -355,6 +443,18 @@ typedef void *OPENSSL_BLOCK; #define BORINGSSL_NO_CXX #endif +#if defined(BORINGSSL_PREFIX) +#define BSSL_NAMESPACE_BEGIN \ + namespace bssl { \ + inline namespace BORINGSSL_PREFIX { +#define BSSL_NAMESPACE_END \ + } \ + } +#else +#define BSSL_NAMESPACE_BEGIN namespace bssl { +#define BSSL_NAMESPACE_END } +#endif + // MSVC doesn't set __cplusplus to 201103 to indicate C++11 support (see // https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l) // so MSVC is just assumed to support C++11. @@ -363,6 +463,7 @@ typedef void *OPENSSL_BLOCK; #endif #if !defined(BORINGSSL_NO_CXX) + extern "C++" { #include @@ -378,12 +479,13 @@ extern "C++" { #if defined(BORINGSSL_NO_CXX) #define BORINGSSL_MAKE_DELETER(type, deleter) +#define BORINGSSL_MAKE_UP_REF(type, up_ref_func) #else extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN namespace internal { @@ -448,7 +550,19 @@ class StackAllocated { template using UniquePtr = std::unique_ptr>; -} // namespace bssl +#define BORINGSSL_MAKE_UP_REF(type, up_ref_func) \ + inline UniquePtr UpRef(type *v) { \ + if (v != nullptr) { \ + up_ref_func(v); \ + } \ + return UniquePtr(v); \ + } \ + \ + inline UniquePtr UpRef(const UniquePtr &ptr) { \ + return UpRef(ptr.get()); \ + } + +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/base.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/base.h.back new file mode 100644 index 000000000..e347c09ae --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/base.h.back @@ -0,0 +1,571 @@ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_BASE_H +#define OPENSSL_HEADER_BASE_H + + +// This file should be the first included by all BoringSSL headers. + +#include +#include +#include + +#if defined(__MINGW32__) +// stdio.h is needed on MinGW for __MINGW_PRINTF_FORMAT. +#include +#endif + +#if defined(__APPLE__) +#include +#endif + +// Include a BoringSSL-only header so consumers including this header without +// setting up include paths do not accidentally pick up the system +// opensslconf.h. +#include +#include + +#if defined(BORINGSSL_PREFIX) +#include +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64) +#define OPENSSL_64_BIT +#define OPENSSL_X86_64 +#elif defined(__x86) || defined(__i386) || defined(__i386__) || defined(_M_IX86) +#define OPENSSL_32_BIT +#define OPENSSL_X86 +#elif defined(__aarch64__) +#define OPENSSL_64_BIT +#define OPENSSL_AARCH64 +#elif defined(__arm) || defined(__arm__) || defined(_M_ARM) +#define OPENSSL_32_BIT +#define OPENSSL_ARM +#elif (defined(__PPC64__) || defined(__powerpc64__)) && defined(_LITTLE_ENDIAN) +#define OPENSSL_64_BIT +#define OPENSSL_PPC64LE +#elif defined(__mips__) && !defined(__LP64__) +#define OPENSSL_32_BIT +#define OPENSSL_MIPS +#elif defined(__mips__) && defined(__LP64__) +#define OPENSSL_64_BIT +#define OPENSSL_MIPS64 +#elif defined(__pnacl__) +#define OPENSSL_32_BIT +#define OPENSSL_PNACL +#elif defined(__wasm__) +#define OPENSSL_32_BIT +#elif defined(__asmjs__) +#define OPENSSL_32_BIT +#elif defined(__myriad2__) +#define OPENSSL_32_BIT +#else +// Note BoringSSL only supports standard 32-bit and 64-bit two's-complement, +// little-endian architectures. Functions will not produce the correct answer +// on other systems. Run the crypto_test binary, notably +// crypto/compiler_test.cc, before adding a new architecture. +#error "Unknown target CPU" +#endif + +#if defined(__APPLE__) +#define OPENSSL_APPLE +// Note |TARGET_OS_MAC| is set for all Apple OS variants. |TARGET_OS_OSX| +// targets macOS specifically. +#if defined(TARGET_OS_OSX) && TARGET_OS_OSX +#define OPENSSL_MACOS +#endif +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#define OPENSSL_IOS +#endif +#endif + +#if defined(_WIN32) +#define OPENSSL_WINDOWS +#endif + +#if defined(__linux__) +#define OPENSSL_LINUX +#endif + +#if defined(__Fuchsia__) +#define OPENSSL_FUCHSIA +#endif + +#if defined(TRUSTY) +#define OPENSSL_TRUSTY +#define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED +#endif + +#if defined(__ANDROID_API__) +#define OPENSSL_ANDROID +#endif + +// BoringSSL requires platform's locking APIs to make internal global state +// thread-safe, including the PRNG. On some single-threaded embedded platforms, +// locking APIs may not exist, so this dependency may be disabled with the +// following build flag. +// +// IMPORTANT: Doing so means the consumer promises the library will never be +// used in any multi-threaded context. It causes BoringSSL to be globally +// thread-unsafe. Setting it inappropriately will subtly and unpredictably +// corrupt memory and leak secret keys. +// +// Do not set this flag on any platform where threads are possible. BoringSSL +// maintainers will not provide support for any consumers that do so. Changes +// which break such unsupported configurations will not be reverted. +#if !defined(OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED) +#define OPENSSL_THREADS +#endif + +#define OPENSSL_IS_BORINGSSL +#define OPENSSL_VERSION_NUMBER 0x1010007f +#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER + +// BORINGSSL_API_VERSION is a positive integer that increments as BoringSSL +// changes over time. The value itself is not meaningful. It will be incremented +// whenever is convenient to coordinate an API change with consumers. This will +// not denote any special point in development. +// +// A consumer may use this symbol in the preprocessor to temporarily build +// against multiple revisions of BoringSSL at the same time. It is not +// recommended to do so for longer than is necessary. +#define BORINGSSL_API_VERSION 9 + +#if defined(BORINGSSL_SHARED_LIBRARY) + +#if defined(OPENSSL_WINDOWS) + +#if defined(BORINGSSL_IMPLEMENTATION) +#define OPENSSL_EXPORT __declspec(dllexport) +#else +#define OPENSSL_EXPORT __declspec(dllimport) +#endif + +#else // defined(OPENSSL_WINDOWS) + +#if defined(BORINGSSL_IMPLEMENTATION) +#define OPENSSL_EXPORT __attribute__((visibility("default"))) +#else +#define OPENSSL_EXPORT +#endif + +#endif // defined(OPENSSL_WINDOWS) + +#else // defined(BORINGSSL_SHARED_LIBRARY) + +#define OPENSSL_EXPORT + +#endif // defined(BORINGSSL_SHARED_LIBRARY) + + +#if defined(__GNUC__) || defined(__clang__) +// MinGW has two different printf implementations. Ensure the format macro +// matches the selected implementation. See +// https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/. +#if defined(__MINGW_PRINTF_FORMAT) +#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) \ + __attribute__( \ + (__format__(__MINGW_PRINTF_FORMAT, string_index, first_to_check))) +#else +#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) \ + __attribute__((__format__(__printf__, string_index, first_to_check))) +#endif +#else +#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) +#endif + +// OPENSSL_MSVC_PRAGMA emits a pragma on MSVC and nothing on other compilers. +#if defined(_MSC_VER) +#define OPENSSL_MSVC_PRAGMA(arg) __pragma(arg) +#else +#define OPENSSL_MSVC_PRAGMA(arg) +#endif + +#if defined(__GNUC__) || defined(__clang__) +#define OPENSSL_UNUSED __attribute__((unused)) +#else +#define OPENSSL_UNUSED +#endif + +// C and C++ handle inline functions differently. In C++, an inline function is +// defined in just the header file, potentially emitted in multiple compilation +// units (in cases the compiler did not inline), but each copy must be identical +// to satsify ODR. In C, a non-static inline must be manually emitted in exactly +// one compilation unit with a separate extern inline declaration. +// +// In both languages, exported inline functions referencing file-local symbols +// are problematic. C forbids this altogether (though GCC and Clang seem not to +// enforce it). It works in C++, but ODR requires the definitions be identical, +// including all names in the definitions resolving to the "same entity". In +// practice, this is unlikely to be a problem, but an inline function that +// returns a pointer to a file-local symbol +// could compile oddly. +// +// Historically, we used static inline in headers. However, to satisfy ODR, use +// plain inline in C++, to allow inline consumer functions to call our header +// functions. Plain inline would also work better with C99 inline, but that is +// not used much in practice, extern inline is tedious, and there are conflicts +// with the old gnu89 model: +// https://stackoverflow.com/questions/216510/extern-inline +#if defined(__cplusplus) +#define OPENSSL_INLINE inline +#else +// Add OPENSSL_UNUSED so that, should an inline function be emitted via macro +// (e.g. a |STACK_OF(T)| implementation) in a source file without tripping +// clang's -Wunused-function. +#define OPENSSL_INLINE static inline OPENSSL_UNUSED +#endif + +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) && \ + !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +#define BORINGSSL_UNSAFE_DETERMINISTIC_MODE +#endif + +#if defined(__has_feature) +#if __has_feature(address_sanitizer) +#define OPENSSL_ASAN +#endif +#if __has_feature(thread_sanitizer) +#define OPENSSL_TSAN +#endif +#if __has_feature(memory_sanitizer) +#define OPENSSL_MSAN +#define OPENSSL_ASM_INCOMPATIBLE +#endif +#endif + +#if defined(OPENSSL_ASM_INCOMPATIBLE) +#undef OPENSSL_ASM_INCOMPATIBLE +#if !defined(OPENSSL_NO_ASM) +#define OPENSSL_NO_ASM +#endif +#endif // OPENSSL_ASM_INCOMPATIBLE + +#if defined(__cplusplus) +// enums can be predeclared, but only in C++ and only if given an explicit type. +// C doesn't support setting an explicit type for enums thus a #define is used +// to do this only for C++. However, the ABI type between C and C++ need to have +// equal sizes, which is confirmed in a unittest. +#define BORINGSSL_ENUM_INT : int +enum ssl_early_data_reason_t BORINGSSL_ENUM_INT; +enum ssl_encryption_level_t BORINGSSL_ENUM_INT; +enum ssl_private_key_result_t BORINGSSL_ENUM_INT; +enum ssl_renegotiate_mode_t BORINGSSL_ENUM_INT; +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT; +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT; +enum ssl_ticket_aead_result_t BORINGSSL_ENUM_INT; +enum ssl_verify_result_t BORINGSSL_ENUM_INT; +#else +#define BORINGSSL_ENUM_INT +#endif + +// CRYPTO_THREADID is a dummy value. +typedef int CRYPTO_THREADID; + +typedef int ASN1_BOOLEAN; +typedef int ASN1_NULL; +typedef struct ASN1_ITEM_st ASN1_ITEM; +typedef struct asn1_object_st ASN1_OBJECT; +typedef struct asn1_pctx_st ASN1_PCTX; +typedef struct asn1_string_st ASN1_BIT_STRING; +typedef struct asn1_string_st ASN1_BMPSTRING; +typedef struct asn1_string_st ASN1_ENUMERATED; +typedef struct asn1_string_st ASN1_GENERALIZEDTIME; +typedef struct asn1_string_st ASN1_GENERALSTRING; +typedef struct asn1_string_st ASN1_IA5STRING; +typedef struct asn1_string_st ASN1_INTEGER; +typedef struct asn1_string_st ASN1_OCTET_STRING; +typedef struct asn1_string_st ASN1_PRINTABLESTRING; +typedef struct asn1_string_st ASN1_STRING; +typedef struct asn1_string_st ASN1_T61STRING; +typedef struct asn1_string_st ASN1_TIME; +typedef struct asn1_string_st ASN1_UNIVERSALSTRING; +typedef struct asn1_string_st ASN1_UTCTIME; +typedef struct asn1_string_st ASN1_UTF8STRING; +typedef struct asn1_string_st ASN1_VISIBLESTRING; +typedef struct asn1_type_st ASN1_TYPE; +typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID; +typedef struct BASIC_CONSTRAINTS_st BASIC_CONSTRAINTS; +typedef struct DIST_POINT_st DIST_POINT; +typedef struct DSA_SIG_st DSA_SIG; +typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT; +typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS; +typedef struct Netscape_spkac_st NETSCAPE_SPKAC; +typedef struct Netscape_spki_st NETSCAPE_SPKI; +typedef struct RIPEMD160state_st RIPEMD160_CTX; +typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE; +typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; +typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; +typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; +typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM; +typedef struct X509_algor_st X509_ALGOR; +typedef struct X509_crl_info_st X509_CRL_INFO; +typedef struct X509_crl_st X509_CRL; +typedef struct X509_extension_st X509_EXTENSION; +typedef struct X509_info_st X509_INFO; +typedef struct X509_name_entry_st X509_NAME_ENTRY; +typedef struct X509_name_st X509_NAME; +typedef struct X509_pubkey_st X509_PUBKEY; +typedef struct X509_req_info_st X509_REQ_INFO; +typedef struct X509_req_st X509_REQ; +typedef struct X509_sig_st X509_SIG; +typedef struct X509_val_st X509_VAL; +typedef struct bignum_ctx BN_CTX; +typedef struct bignum_st BIGNUM; +typedef struct bio_method_st BIO_METHOD; +typedef struct bio_st BIO; +typedef struct bn_gencb_st BN_GENCB; +typedef struct bn_mont_ctx_st BN_MONT_CTX; +typedef struct buf_mem_st BUF_MEM; +typedef struct cbb_st CBB; +typedef struct cbs_st CBS; +typedef struct cmac_ctx_st CMAC_CTX; +typedef struct conf_st CONF; +typedef struct conf_value_st CONF_VALUE; +typedef struct crypto_buffer_pool_st CRYPTO_BUFFER_POOL; +typedef struct crypto_buffer_st CRYPTO_BUFFER; +typedef struct dh_st DH; +typedef struct dsa_st DSA; +typedef struct ec_group_st EC_GROUP; +typedef struct ec_key_st EC_KEY; +typedef struct ec_point_st EC_POINT; +typedef struct ecdsa_method_st ECDSA_METHOD; +typedef struct ecdsa_sig_st ECDSA_SIG; +typedef struct engine_st ENGINE; +typedef struct env_md_ctx_st EVP_MD_CTX; +typedef struct env_md_st EVP_MD; +typedef struct evp_aead_st EVP_AEAD; +typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX; +typedef struct evp_cipher_st EVP_CIPHER; +typedef struct evp_encode_ctx_st EVP_ENCODE_CTX; +typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD; +typedef struct evp_pkey_ctx_st EVP_PKEY_CTX; +typedef struct evp_pkey_method_st EVP_PKEY_METHOD; +typedef struct evp_pkey_st EVP_PKEY; +typedef struct hmac_ctx_st HMAC_CTX; +typedef struct md4_state_st MD4_CTX; +typedef struct md5_state_st MD5_CTX; +typedef struct ossl_init_settings_st OPENSSL_INIT_SETTINGS; +typedef struct pkcs12_st PKCS12; +typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO; +typedef struct private_key_st X509_PKEY; +typedef struct rand_meth_st RAND_METHOD; +typedef struct rc4_key_st RC4_KEY; +typedef struct rsa_meth_st RSA_METHOD; +typedef struct rsa_st RSA; +typedef struct sha256_state_st SHA256_CTX; +typedef struct sha512_state_st SHA512_CTX; +typedef struct sha_state_st SHA_CTX; +typedef struct spake2_ctx_st SPAKE2_CTX; +typedef struct srtp_protection_profile_st SRTP_PROTECTION_PROFILE; +typedef struct ssl_cipher_st SSL_CIPHER; +typedef struct ssl_ctx_st SSL_CTX; +typedef struct ssl_method_st SSL_METHOD; +typedef struct ssl_private_key_method_st SSL_PRIVATE_KEY_METHOD; +typedef struct ssl_quic_method_st SSL_QUIC_METHOD; +typedef struct ssl_session_st SSL_SESSION; +typedef struct ssl_st SSL; +typedef struct ssl_ticket_aead_method_st SSL_TICKET_AEAD_METHOD; +typedef struct st_ERR_FNS ERR_FNS; +typedef struct v3_ext_ctx X509V3_CTX; +typedef struct x509_attributes_st X509_ATTRIBUTE; +typedef struct x509_cert_aux_st X509_CERT_AUX; +typedef struct x509_cinf_st X509_CINF; +typedef struct x509_crl_method_st X509_CRL_METHOD; +typedef struct x509_lookup_st X509_LOOKUP; +typedef struct x509_revoked_st X509_REVOKED; +typedef struct x509_st X509; +typedef struct x509_store_ctx_st X509_STORE_CTX; +typedef struct x509_store_st X509_STORE; +typedef struct x509_trust_st X509_TRUST; + +typedef void *OPENSSL_BLOCK; + + +#if defined(__cplusplus) +} // extern C +#elif !defined(BORINGSSL_NO_CXX) +#define BORINGSSL_NO_CXX +#endif + +#if defined(BORINGSSL_PREFIX) +#define BSSL_NAMESPACE_BEGIN \ + namespace bssl { \ + inline namespace BORINGSSL_PREFIX { +#define BSSL_NAMESPACE_END \ + } \ + } +#else +#define BSSL_NAMESPACE_BEGIN namespace bssl { +#define BSSL_NAMESPACE_END } +#endif + +// MSVC doesn't set __cplusplus to 201103 to indicate C++11 support (see +// https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l) +// so MSVC is just assumed to support C++11. +#if !defined(BORINGSSL_NO_CXX) && __cplusplus < 201103L && !defined(_MSC_VER) +#define BORINGSSL_NO_CXX +#endif + +#if !defined(BORINGSSL_NO_CXX) + +extern "C++" { + +#include + +// STLPort, used by some Android consumers, not have std::unique_ptr. +#if defined(_STLPORT_VERSION) +#define BORINGSSL_NO_CXX +#endif + +} // extern C++ +#endif // !BORINGSSL_NO_CXX + +#if defined(BORINGSSL_NO_CXX) + +#define BORINGSSL_MAKE_DELETER(type, deleter) +#define BORINGSSL_MAKE_UP_REF(type, up_ref_func) + +#else + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +namespace internal { + +// The Enable parameter is ignored and only exists so specializations can use +// SFINAE. +template +struct DeleterImpl {}; + +template +struct Deleter { + void operator()(T *ptr) { + // Rather than specialize Deleter for each type, we specialize + // DeleterImpl. This allows bssl::UniquePtr to be used while only + // including base.h as long as the destructor is not emitted. This matches + // std::unique_ptr's behavior on forward-declared types. + // + // DeleterImpl itself is specialized in the corresponding module's header + // and must be included to release an object. If not included, the compiler + // will error that DeleterImpl does not have a method Free. + DeleterImpl::Free(ptr); + } +}; + +template +class StackAllocated { + public: + StackAllocated() { init(&ctx_); } + ~StackAllocated() { cleanup(&ctx_); } + + StackAllocated(const StackAllocated &) = delete; + T& operator=(const StackAllocated &) = delete; + + T *get() { return &ctx_; } + const T *get() const { return &ctx_; } + + T *operator->() { return &ctx_; } + const T *operator->() const { return &ctx_; } + + void Reset() { + cleanup(&ctx_); + init(&ctx_); + } + + private: + T ctx_; +}; + +} // namespace internal + +#define BORINGSSL_MAKE_DELETER(type, deleter) \ + namespace internal { \ + template <> \ + struct DeleterImpl { \ + static void Free(type *ptr) { deleter(ptr); } \ + }; \ + } + +// Holds ownership of heap-allocated BoringSSL structures. Sample usage: +// bssl::UniquePtr rsa(RSA_new()); +// bssl::UniquePtr bio(BIO_new(BIO_s_mem())); +template +using UniquePtr = std::unique_ptr>; + +#define BORINGSSL_MAKE_UP_REF(type, up_ref_func) \ + inline UniquePtr UpRef(type *v) { \ + if (v != nullptr) { \ + up_ref_func(v); \ + } \ + return UniquePtr(v); \ + } \ + \ + inline UniquePtr UpRef(const UniquePtr &ptr) { \ + return UpRef(ptr.get()); \ + } + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif // !BORINGSSL_NO_CXX + +#endif // OPENSSL_HEADER_BASE_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/base.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/base.h.grpc_back similarity index 75% rename from Pods/BoringSSL-GRPC/include/openssl/base.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/base.h.grpc_back index bd41d1142..e347c09ae 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/base.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/base.h.grpc_back @@ -6,7 +6,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -65,6 +65,10 @@ #include #endif +#if defined(__APPLE__) +#include +#endif + // Include a BoringSSL-only header so consumers including this header without // setting up include paths do not accidentally pick up the system // opensslconf.h. @@ -120,6 +124,14 @@ extern "C" { #if defined(__APPLE__) #define OPENSSL_APPLE +// Note |TARGET_OS_MAC| is set for all Apple OS variants. |TARGET_OS_OSX| +// targets macOS specifically. +#if defined(TARGET_OS_OSX) && TARGET_OS_OSX +#define OPENSSL_MACOS +#endif +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#define OPENSSL_IOS +#endif #endif #if defined(_WIN32) @@ -136,10 +148,27 @@ extern "C" { #if defined(TRUSTY) #define OPENSSL_TRUSTY -#define OPENSSL_NO_THREADS +#define OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED +#endif + +#if defined(__ANDROID_API__) +#define OPENSSL_ANDROID #endif -#if !defined(OPENSSL_NO_THREADS) +// BoringSSL requires platform's locking APIs to make internal global state +// thread-safe, including the PRNG. On some single-threaded embedded platforms, +// locking APIs may not exist, so this dependency may be disabled with the +// following build flag. +// +// IMPORTANT: Doing so means the consumer promises the library will never be +// used in any multi-threaded context. It causes BoringSSL to be globally +// thread-unsafe. Setting it inappropriately will subtly and unpredictably +// corrupt memory and leak secret keys. +// +// Do not set this flag on any platform where threads are possible. BoringSSL +// maintainers will not provide support for any consumers that do so. Changes +// which break such unsupported configurations will not be reverted. +#if !defined(OPENSSL_NO_THREADS_CORRUPT_MEMORY_AND_LEAK_SECRETS_IF_THREADED) #define OPENSSL_THREADS #endif @@ -155,7 +184,7 @@ extern "C" { // A consumer may use this symbol in the preprocessor to temporarily build // against multiple revisions of BoringSSL at the same time. It is not // recommended to do so for longer than is necessary. -#define BORINGSSL_API_VERSION 7 +#define BORINGSSL_API_VERSION 9 #if defined(BORINGSSL_SHARED_LIBRARY) @@ -213,6 +242,35 @@ extern "C" { #define OPENSSL_UNUSED #endif +// C and C++ handle inline functions differently. In C++, an inline function is +// defined in just the header file, potentially emitted in multiple compilation +// units (in cases the compiler did not inline), but each copy must be identical +// to satsify ODR. In C, a non-static inline must be manually emitted in exactly +// one compilation unit with a separate extern inline declaration. +// +// In both languages, exported inline functions referencing file-local symbols +// are problematic. C forbids this altogether (though GCC and Clang seem not to +// enforce it). It works in C++, but ODR requires the definitions be identical, +// including all names in the definitions resolving to the "same entity". In +// practice, this is unlikely to be a problem, but an inline function that +// returns a pointer to a file-local symbol +// could compile oddly. +// +// Historically, we used static inline in headers. However, to satisfy ODR, use +// plain inline in C++, to allow inline consumer functions to call our header +// functions. Plain inline would also work better with C99 inline, but that is +// not used much in practice, extern inline is tedious, and there are conflicts +// with the old gnu89 model: +// https://stackoverflow.com/questions/216510/extern-inline +#if defined(__cplusplus) +#define OPENSSL_INLINE inline +#else +// Add OPENSSL_UNUSED so that, should an inline function be emitted via macro +// (e.g. a |STACK_OF(T)| implementation) in a source file without tripping +// clang's -Wunused-function. +#define OPENSSL_INLINE static inline OPENSSL_UNUSED +#endif + #if defined(BORINGSSL_UNSAFE_FUZZER_MODE) && \ !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) #define BORINGSSL_UNSAFE_DETERMINISTIC_MODE @@ -222,9 +280,38 @@ extern "C" { #if __has_feature(address_sanitizer) #define OPENSSL_ASAN #endif +#if __has_feature(thread_sanitizer) +#define OPENSSL_TSAN +#endif #if __has_feature(memory_sanitizer) #define OPENSSL_MSAN +#define OPENSSL_ASM_INCOMPATIBLE +#endif +#endif + +#if defined(OPENSSL_ASM_INCOMPATIBLE) +#undef OPENSSL_ASM_INCOMPATIBLE +#if !defined(OPENSSL_NO_ASM) +#define OPENSSL_NO_ASM #endif +#endif // OPENSSL_ASM_INCOMPATIBLE + +#if defined(__cplusplus) +// enums can be predeclared, but only in C++ and only if given an explicit type. +// C doesn't support setting an explicit type for enums thus a #define is used +// to do this only for C++. However, the ABI type between C and C++ need to have +// equal sizes, which is confirmed in a unittest. +#define BORINGSSL_ENUM_INT : int +enum ssl_early_data_reason_t BORINGSSL_ENUM_INT; +enum ssl_encryption_level_t BORINGSSL_ENUM_INT; +enum ssl_private_key_result_t BORINGSSL_ENUM_INT; +enum ssl_renegotiate_mode_t BORINGSSL_ENUM_INT; +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT; +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT; +enum ssl_ticket_aead_result_t BORINGSSL_ENUM_INT; +enum ssl_verify_result_t BORINGSSL_ENUM_INT; +#else +#define BORINGSSL_ENUM_INT #endif // CRYPTO_THREADID is a dummy value. @@ -330,6 +417,7 @@ typedef struct ssl_cipher_st SSL_CIPHER; typedef struct ssl_ctx_st SSL_CTX; typedef struct ssl_method_st SSL_METHOD; typedef struct ssl_private_key_method_st SSL_PRIVATE_KEY_METHOD; +typedef struct ssl_quic_method_st SSL_QUIC_METHOD; typedef struct ssl_session_st SSL_SESSION; typedef struct ssl_st SSL; typedef struct ssl_ticket_aead_method_st SSL_TICKET_AEAD_METHOD; @@ -355,6 +443,18 @@ typedef void *OPENSSL_BLOCK; #define BORINGSSL_NO_CXX #endif +#if defined(BORINGSSL_PREFIX) +#define BSSL_NAMESPACE_BEGIN \ + namespace bssl { \ + inline namespace BORINGSSL_PREFIX { +#define BSSL_NAMESPACE_END \ + } \ + } +#else +#define BSSL_NAMESPACE_BEGIN namespace bssl { +#define BSSL_NAMESPACE_END } +#endif + // MSVC doesn't set __cplusplus to 201103 to indicate C++11 support (see // https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l) // so MSVC is just assumed to support C++11. @@ -363,6 +463,7 @@ typedef void *OPENSSL_BLOCK; #endif #if !defined(BORINGSSL_NO_CXX) + extern "C++" { #include @@ -378,12 +479,13 @@ extern "C++" { #if defined(BORINGSSL_NO_CXX) #define BORINGSSL_MAKE_DELETER(type, deleter) +#define BORINGSSL_MAKE_UP_REF(type, up_ref_func) #else extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN namespace internal { @@ -448,7 +550,19 @@ class StackAllocated { template using UniquePtr = std::unique_ptr>; -} // namespace bssl +#define BORINGSSL_MAKE_UP_REF(type, up_ref_func) \ + inline UniquePtr UpRef(type *v) { \ + if (v != nullptr) { \ + up_ref_func(v); \ + } \ + return UniquePtr(v); \ + } \ + \ + inline UniquePtr UpRef(const UniquePtr &ptr) { \ + return UpRef(ptr.get()); \ + } + +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/base64.h b/Pods/BoringSSL-GRPC/src/include/openssl/base64.h similarity index 97% rename from Pods/BoringSSL-GRPC/include/openssl/base64.h rename to Pods/BoringSSL-GRPC/src/include/openssl/base64.h index 415c6ebf9..a41cf5f3e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/base64.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/base64.h @@ -67,7 +67,10 @@ extern "C" { // base64 functions. // // For historical reasons, these functions have the EVP_ prefix but just do -// base64 encoding and decoding. +// base64 encoding and decoding. Note that BoringSSL is a cryptography library, +// so these functions are implemented with side channel protections, at a +// performance cost. For other base64 uses, use a general-purpose base64 +// implementation. // Encoding diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.back new file mode 100644 index 000000000..c88546d7b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.back @@ -0,0 +1,190 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_BASE64_H +#define OPENSSL_HEADER_BASE64_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// base64 functions. +// +// For historical reasons, these functions have the EVP_ prefix but just do +// base64 encoding and decoding. Note that BoringSSL is a cryptography library, +// so these functions are implemented with side channel protections, at a +// performance cost. For other base64 uses, use a general-purpose base64 +// implementation. + + +// Encoding + +// EVP_EncodeBlock encodes |src_len| bytes from |src| and writes the +// result to |dst| with a trailing NUL. It returns the number of bytes +// written, not including this trailing NUL. +OPENSSL_EXPORT size_t EVP_EncodeBlock(uint8_t *dst, const uint8_t *src, + size_t src_len); + +// EVP_EncodedLength sets |*out_len| to the number of bytes that will be needed +// to call |EVP_EncodeBlock| on an input of length |len|. This includes the +// final NUL that |EVP_EncodeBlock| writes. It returns one on success or zero +// on error. +OPENSSL_EXPORT int EVP_EncodedLength(size_t *out_len, size_t len); + + +// Decoding + +// EVP_DecodedLength sets |*out_len| to the maximum number of bytes that will +// be needed to call |EVP_DecodeBase64| on an input of length |len|. It returns +// one on success or zero if |len| is not a valid length for a base64-encoded +// string. +OPENSSL_EXPORT int EVP_DecodedLength(size_t *out_len, size_t len); + +// EVP_DecodeBase64 decodes |in_len| bytes from base64 and writes +// |*out_len| bytes to |out|. |max_out| is the size of the output +// buffer. If it is not enough for the maximum output size, the +// operation fails. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_DecodeBase64(uint8_t *out, size_t *out_len, + size_t max_out, const uint8_t *in, + size_t in_len); + + +// Deprecated functions. +// +// OpenSSL provides a streaming base64 implementation, however its behavior is +// very specific to PEM. It is also very lenient of invalid input. Use of any of +// these functions is thus deprecated. + +// EVP_EncodeInit initialises |*ctx|, which is typically stack +// allocated, for an encoding operation. +// +// NOTE: The encoding operation breaks its output with newlines every +// 64 characters of output (48 characters of input). Use +// EVP_EncodeBlock to encode raw base64. +OPENSSL_EXPORT void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); + +// EVP_EncodeUpdate encodes |in_len| bytes from |in| and writes an encoded +// version of them to |out| and sets |*out_len| to the number of bytes written. +// Some state may be contained in |ctx| so |EVP_EncodeFinal| must be used to +// flush it before using the encoded data. +OPENSSL_EXPORT void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, + int *out_len, const uint8_t *in, + size_t in_len); + +// EVP_EncodeFinal flushes any remaining output bytes from |ctx| to |out| and +// sets |*out_len| to the number of bytes written. +OPENSSL_EXPORT void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, + int *out_len); + +// EVP_DecodeInit initialises |*ctx|, which is typically stack allocated, for +// a decoding operation. +// +// TODO(davidben): This isn't a straight-up base64 decode either. Document +// and/or fix exactly what's going on here; maximum line length and such. +OPENSSL_EXPORT void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); + +// EVP_DecodeUpdate decodes |in_len| bytes from |in| and writes the decoded +// data to |out| and sets |*out_len| to the number of bytes written. Some state +// may be contained in |ctx| so |EVP_DecodeFinal| must be used to flush it +// before using the encoded data. +// +// It returns -1 on error, one if a full line of input was processed and zero +// if the line was short (i.e. it was the last line). +OPENSSL_EXPORT int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, uint8_t *out, + int *out_len, const uint8_t *in, + size_t in_len); + +// EVP_DecodeFinal flushes any remaining output bytes from |ctx| to |out| and +// sets |*out_len| to the number of bytes written. It returns one on success +// and minus one on error. +OPENSSL_EXPORT int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, uint8_t *out, + int *out_len); + +// EVP_DecodeBlock encodes |src_len| bytes from |src| and writes the result to +// |dst|. It returns the number of bytes written or -1 on error. +// +// WARNING: EVP_DecodeBlock's return value does not take padding into +// account. It also strips leading whitespace and trailing +// whitespace and minuses. +OPENSSL_EXPORT int EVP_DecodeBlock(uint8_t *dst, const uint8_t *src, + size_t src_len); + + +struct evp_encode_ctx_st { + // data_used indicates the number of bytes of |data| that are valid. When + // encoding, |data| will be filled and encoded as a lump. When decoding, only + // the first four bytes of |data| will be used. + unsigned data_used; + uint8_t data[48]; + + // eof_seen indicates that the end of the base64 data has been seen when + // decoding. Only whitespace can follow. + char eof_seen; + + // error_encountered indicates that invalid base64 data was found. This will + // cause all future calls to fail. + char error_encountered; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_BASE64_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/base64.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/include/openssl/base64.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/base64.h.grpc_back index ef760886b..c88546d7b 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/base64.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/base64.h.grpc_back @@ -67,7 +67,10 @@ extern "C" { // base64 functions. // // For historical reasons, these functions have the EVP_ prefix but just do -// base64 encoding and decoding. +// base64 encoding and decoding. Note that BoringSSL is a cryptography library, +// so these functions are implemented with side channel protections, at a +// performance cost. For other base64 uses, use a general-purpose base64 +// implementation. // Encoding diff --git a/Pods/BoringSSL-GRPC/include/openssl/bio.h b/Pods/BoringSSL-GRPC/src/include/openssl/bio.h similarity index 89% rename from Pods/BoringSSL-GRPC/include/openssl/bio.h rename to Pods/BoringSSL-GRPC/src/include/openssl/bio.h index db7f02dd8..3b0c867f5 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/bio.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bio.h @@ -117,10 +117,14 @@ OPENSSL_EXPORT int BIO_read(BIO *bio, void *data, int len); // return a line for this call, remove the warning above. OPENSSL_EXPORT int BIO_gets(BIO *bio, char *buf, int size); -// BIO_write writes |len| bytes from |data| to BIO. It returns the number of +// BIO_write writes |len| bytes from |data| to |bio|. It returns the number of // bytes written or a negative number on error. OPENSSL_EXPORT int BIO_write(BIO *bio, const void *data, int len); +// BIO_write_all writes |len| bytes from |data| to |bio|, looping as necessary. +// It returns one if all bytes were successfully written and zero on error. +OPENSSL_EXPORT int BIO_write_all(BIO *bio, const void *data, size_t len); + // BIO_puts writes a NUL terminated string from |buf| to |bio|. It returns the // number of bytes written or a negative number on error. OPENSSL_EXPORT int BIO_puts(BIO *bio, const char *buf); @@ -677,26 +681,49 @@ OPENSSL_EXPORT void BIO_set_init(BIO *bio, int init); OPENSSL_EXPORT int BIO_get_init(BIO *bio); // These are values of the |cmd| argument to |BIO_ctrl|. -#define BIO_CTRL_RESET 1 // opt - rewind/zero etc -#define BIO_CTRL_EOF 2 // opt - are we at the eof -#define BIO_CTRL_INFO 3 // opt - extra tit-bits -#define BIO_CTRL_SET 4 // man - set the 'IO' type -#define BIO_CTRL_GET 5 // man - get the 'IO' type -#define BIO_CTRL_PUSH 6 -#define BIO_CTRL_POP 7 -#define BIO_CTRL_GET_CLOSE 8 // man - set the 'close' on free -#define BIO_CTRL_SET_CLOSE 9 // man - set the 'close' on free -#define BIO_CTRL_PENDING 10 // opt - is their more data buffered -#define BIO_CTRL_FLUSH 11 // opt - 'flush' buffered output -#define BIO_CTRL_WPENDING 13 // opt - number of bytes still to write -// callback is int cb(BIO *bio,state,ret); -#define BIO_CTRL_SET_CALLBACK 14 // opt - set callback function -#define BIO_CTRL_GET_CALLBACK 15 // opt - set callback function -#define BIO_CTRL_SET_FILENAME 30 // BIO_s_file special - -// BIO_CTRL_DUP is never used, but exists to allow code to compile more -// easily. -#define BIO_CTRL_DUP 12 + +// BIO_CTRL_RESET implements |BIO_reset|. The arguments are unused. +#define BIO_CTRL_RESET 1 + +// BIO_CTRL_EOF implements |BIO_eof|. The arguments are unused. +#define BIO_CTRL_EOF 2 + +// BIO_CTRL_INFO is a legacy command that returns information specific to the +// type of |BIO|. It is not safe to call generically and should not be +// implemented in new |BIO| types. +#define BIO_CTRL_INFO 3 + +// BIO_CTRL_GET_CLOSE returns the close flag set by |BIO_CTRL_SET_CLOSE|. The +// arguments are unused. +#define BIO_CTRL_GET_CLOSE 8 + +// BIO_CTRL_SET_CLOSE implements |BIO_set_close|. The |larg| argument is the +// close flag. +#define BIO_CTRL_SET_CLOSE 9 + +// BIO_CTRL_PENDING implements |BIO_pending|. The arguments are unused. +#define BIO_CTRL_PENDING 10 + +// BIO_CTRL_FLUSH implements |BIO_flush|. The arguments are unused. +#define BIO_CTRL_FLUSH 11 + +// BIO_CTRL_WPENDING implements |BIO_wpending|. The arguments are unused. +#define BIO_CTRL_WPENDING 13 + +// BIO_CTRL_SET_CALLBACK sets an informational callback of type +// int cb(BIO *bio, int state, int ret) +#define BIO_CTRL_SET_CALLBACK 14 + +// BIO_CTRL_GET_CALLBACK returns the callback set by |BIO_CTRL_SET_CALLBACK|. +#define BIO_CTRL_GET_CALLBACK 15 + +// The following are never used, but are defined to aid porting existing code. +#define BIO_CTRL_SET 4 +#define BIO_CTRL_GET 5 +#define BIO_CTRL_PUSH 6 +#define BIO_CTRL_POP 7 +#define BIO_CTRL_DUP 12 +#define BIO_CTRL_SET_FILENAME 30 // Deprecated functions. @@ -706,6 +733,8 @@ OPENSSL_EXPORT int BIO_get_init(BIO *bio); // |BIO_flush| when done writing, to signal that no more data are to be // encoded. The flag |BIO_FLAGS_BASE64_NO_NL| may be set to encode all the data // on one line. +// +// Use |EVP_EncodeBlock| and |EVP_DecodeBase64| instead. OPENSSL_EXPORT const BIO_METHOD *BIO_f_base64(void); OPENSSL_EXPORT void BIO_set_retry_special(BIO *bio); @@ -733,8 +762,8 @@ OPENSSL_EXPORT int BIO_meth_set_puts(BIO_METHOD *method, #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL) #define BIO_FLAGS_SHOULD_RETRY 0x08 #define BIO_FLAGS_BASE64_NO_NL 0x100 -// This is used with memory BIOs: it means we shouldn't free up or change the -// data in any way. +// BIO_FLAGS_MEM_RDONLY is used with memory BIOs. It means we shouldn't free up +// or change the data in any way. #define BIO_FLAGS_MEM_RDONLY 0x200 // These are the 'types' of BIOs @@ -762,7 +791,7 @@ OPENSSL_EXPORT int BIO_meth_set_puts(BIO_METHOD *method, #define BIO_TYPE_ASN1 (22 | 0x0200) // filter #define BIO_TYPE_COMP (23 | 0x0200) // filter -// |BIO_TYPE_DESCRIPTOR| denotes that the |BIO| responds to the |BIO_C_SET_FD| +// BIO_TYPE_DESCRIPTOR denotes that the |BIO| responds to the |BIO_C_SET_FD| // (|BIO_set_fd|) and |BIO_C_GET_FD| (|BIO_get_fd|) control hooks. #define BIO_TYPE_DESCRIPTOR 0x0100 // socket, fd, connect or accept #define BIO_TYPE_FILTER 0x0200 @@ -809,61 +838,61 @@ struct bio_st { size_t num_read, num_write; }; -#define BIO_C_SET_CONNECT 100 -#define BIO_C_DO_STATE_MACHINE 101 -#define BIO_C_SET_NBIO 102 -#define BIO_C_SET_PROXY_PARAM 103 -#define BIO_C_SET_FD 104 -#define BIO_C_GET_FD 105 -#define BIO_C_SET_FILE_PTR 106 -#define BIO_C_GET_FILE_PTR 107 -#define BIO_C_SET_FILENAME 108 -#define BIO_C_SET_SSL 109 -#define BIO_C_GET_SSL 110 -#define BIO_C_SET_MD 111 -#define BIO_C_GET_MD 112 -#define BIO_C_GET_CIPHER_STATUS 113 -#define BIO_C_SET_BUF_MEM 114 -#define BIO_C_GET_BUF_MEM_PTR 115 -#define BIO_C_GET_BUFF_NUM_LINES 116 -#define BIO_C_SET_BUFF_SIZE 117 -#define BIO_C_SET_ACCEPT 118 -#define BIO_C_SSL_MODE 119 -#define BIO_C_GET_MD_CTX 120 -#define BIO_C_GET_PROXY_PARAM 121 -#define BIO_C_SET_BUFF_READ_DATA 122 // data to read first -#define BIO_C_GET_ACCEPT 124 -#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 -#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 -#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 -#define BIO_C_FILE_SEEK 128 -#define BIO_C_GET_CIPHER_CTX 129 -#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 //return end of input value -#define BIO_C_SET_BIND_MODE 131 -#define BIO_C_GET_BIND_MODE 132 -#define BIO_C_FILE_TELL 133 -#define BIO_C_GET_SOCKS 134 -#define BIO_C_SET_SOCKS 135 - -#define BIO_C_SET_WRITE_BUF_SIZE 136 // for BIO_s_bio -#define BIO_C_GET_WRITE_BUF_SIZE 137 -#define BIO_C_GET_WRITE_GUARANTEE 140 -#define BIO_C_GET_READ_REQUEST 141 -#define BIO_C_SHUTDOWN_WR 142 -#define BIO_C_NREAD0 143 -#define BIO_C_NREAD 144 -#define BIO_C_NWRITE0 145 -#define BIO_C_NWRITE 146 -#define BIO_C_RESET_READ_REQUEST 147 -#define BIO_C_SET_MD_CTX 148 - -#define BIO_C_SET_PREFIX 149 -#define BIO_C_GET_PREFIX 150 -#define BIO_C_SET_SUFFIX 151 -#define BIO_C_GET_SUFFIX 152 - -#define BIO_C_SET_EX_ARG 153 -#define BIO_C_GET_EX_ARG 154 +#define BIO_C_SET_CONNECT 100 +#define BIO_C_DO_STATE_MACHINE 101 +#define BIO_C_SET_NBIO 102 +#define BIO_C_SET_PROXY_PARAM 103 +#define BIO_C_SET_FD 104 +#define BIO_C_GET_FD 105 +#define BIO_C_SET_FILE_PTR 106 +#define BIO_C_GET_FILE_PTR 107 +#define BIO_C_SET_FILENAME 108 +#define BIO_C_SET_SSL 109 +#define BIO_C_GET_SSL 110 +#define BIO_C_SET_MD 111 +#define BIO_C_GET_MD 112 +#define BIO_C_GET_CIPHER_STATUS 113 +#define BIO_C_SET_BUF_MEM 114 +#define BIO_C_GET_BUF_MEM_PTR 115 +#define BIO_C_GET_BUFF_NUM_LINES 116 +#define BIO_C_SET_BUFF_SIZE 117 +#define BIO_C_SET_ACCEPT 118 +#define BIO_C_SSL_MODE 119 +#define BIO_C_GET_MD_CTX 120 +#define BIO_C_GET_PROXY_PARAM 121 +#define BIO_C_SET_BUFF_READ_DATA 122 // data to read first +#define BIO_C_GET_ACCEPT 124 +#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 +#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 +#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 +#define BIO_C_FILE_SEEK 128 +#define BIO_C_GET_CIPHER_CTX 129 +#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 // return end of input value +#define BIO_C_SET_BIND_MODE 131 +#define BIO_C_GET_BIND_MODE 132 +#define BIO_C_FILE_TELL 133 +#define BIO_C_GET_SOCKS 134 +#define BIO_C_SET_SOCKS 135 + +#define BIO_C_SET_WRITE_BUF_SIZE 136 // for BIO_s_bio +#define BIO_C_GET_WRITE_BUF_SIZE 137 +#define BIO_C_GET_WRITE_GUARANTEE 140 +#define BIO_C_GET_READ_REQUEST 141 +#define BIO_C_SHUTDOWN_WR 142 +#define BIO_C_NREAD0 143 +#define BIO_C_NREAD 144 +#define BIO_C_NWRITE0 145 +#define BIO_C_NWRITE 146 +#define BIO_C_RESET_READ_REQUEST 147 +#define BIO_C_SET_MD_CTX 148 + +#define BIO_C_SET_PREFIX 149 +#define BIO_C_GET_PREFIX 150 +#define BIO_C_SET_SUFFIX 151 +#define BIO_C_GET_SUFFIX 152 + +#define BIO_C_SET_EX_ARG 153 +#define BIO_C_GET_EX_ARG 154 #if defined(__cplusplus) @@ -871,11 +900,13 @@ struct bio_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(BIO, BIO_free) +BORINGSSL_MAKE_UP_REF(BIO, BIO_up_ref) +BORINGSSL_MAKE_DELETER(BIO_METHOD, BIO_meth_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.back new file mode 100644 index 000000000..da0dcdfe6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.back @@ -0,0 +1,933 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_BIO_H +#define OPENSSL_HEADER_BIO_H + +#include + +#include // For FILE + +#include +#include // for ERR_print_errors_fp +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// BIO abstracts over a file-descriptor like interface. + + +// Allocation and freeing. + +DEFINE_STACK_OF(BIO) + +// BIO_new creates a new BIO with the given method and a reference count of one. +// It returns the fresh |BIO|, or NULL on error. +OPENSSL_EXPORT BIO *BIO_new(const BIO_METHOD *method); + +// BIO_free decrements the reference count of |bio|. If the reference count +// drops to zero, it calls the destroy callback, if present, on the method and +// frees |bio| itself. It then repeats that for the next BIO in the chain, if +// any. +// +// It returns one on success or zero otherwise. +OPENSSL_EXPORT int BIO_free(BIO *bio); + +// BIO_vfree performs the same actions as |BIO_free|, but has a void return +// value. This is provided for API-compat. +// +// TODO(fork): remove. +OPENSSL_EXPORT void BIO_vfree(BIO *bio); + +// BIO_up_ref increments the reference count of |bio| and returns one. +OPENSSL_EXPORT int BIO_up_ref(BIO *bio); + + +// Basic I/O. + +// BIO_read attempts to read |len| bytes into |data|. It returns the number of +// bytes read, zero on EOF, or a negative number on error. +OPENSSL_EXPORT int BIO_read(BIO *bio, void *data, int len); + +// BIO_gets "reads a line" from |bio| and puts at most |size| bytes into |buf|. +// It returns the number of bytes read or a negative number on error. The +// phrase "reads a line" is in quotes in the previous sentence because the +// exact operation depends on the BIO's method. For example, a digest BIO will +// return the digest in response to a |BIO_gets| call. +// +// TODO(fork): audit the set of BIOs that we end up needing. If all actually +// return a line for this call, remove the warning above. +OPENSSL_EXPORT int BIO_gets(BIO *bio, char *buf, int size); + +// BIO_write writes |len| bytes from |data| to |bio|. It returns the number of +// bytes written or a negative number on error. +OPENSSL_EXPORT int BIO_write(BIO *bio, const void *data, int len); + +// BIO_write_all writes |len| bytes from |data| to |bio|, looping as necessary. +// It returns one if all bytes were successfully written and zero on error. +OPENSSL_EXPORT int BIO_write_all(BIO *bio, const void *data, size_t len); + +// BIO_puts writes a NUL terminated string from |buf| to |bio|. It returns the +// number of bytes written or a negative number on error. +OPENSSL_EXPORT int BIO_puts(BIO *bio, const char *buf); + +// BIO_flush flushes any buffered output. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int BIO_flush(BIO *bio); + + +// Low-level control functions. +// +// These are generic functions for sending control requests to a BIO. In +// general one should use the wrapper functions like |BIO_get_close|. + +// BIO_ctrl sends the control request |cmd| to |bio|. The |cmd| argument should +// be one of the |BIO_C_*| values. +OPENSSL_EXPORT long BIO_ctrl(BIO *bio, int cmd, long larg, void *parg); + +// BIO_ptr_ctrl acts like |BIO_ctrl| but passes the address of a |void*| +// pointer as |parg| and returns the value that is written to it, or NULL if +// the control request returns <= 0. +OPENSSL_EXPORT char *BIO_ptr_ctrl(BIO *bp, int cmd, long larg); + +// BIO_int_ctrl acts like |BIO_ctrl| but passes the address of a copy of |iarg| +// as |parg|. +OPENSSL_EXPORT long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg); + +// BIO_reset resets |bio| to its initial state, the precise meaning of which +// depends on the concrete type of |bio|. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int BIO_reset(BIO *bio); + +// BIO_eof returns non-zero when |bio| has reached end-of-file. The precise +// meaning of which depends on the concrete type of |bio|. Note that in the +// case of BIO_pair this always returns non-zero. +OPENSSL_EXPORT int BIO_eof(BIO *bio); + +// BIO_set_flags ORs |flags| with |bio->flags|. +OPENSSL_EXPORT void BIO_set_flags(BIO *bio, int flags); + +// BIO_test_flags returns |bio->flags| AND |flags|. +OPENSSL_EXPORT int BIO_test_flags(const BIO *bio, int flags); + +// BIO_should_read returns non-zero if |bio| encountered a temporary error +// while reading (i.e. EAGAIN), indicating that the caller should retry the +// read. +OPENSSL_EXPORT int BIO_should_read(const BIO *bio); + +// BIO_should_write returns non-zero if |bio| encountered a temporary error +// while writing (i.e. EAGAIN), indicating that the caller should retry the +// write. +OPENSSL_EXPORT int BIO_should_write(const BIO *bio); + +// BIO_should_retry returns non-zero if the reason that caused a failed I/O +// operation is temporary and thus the operation should be retried. Otherwise, +// it was a permanent error and it returns zero. +OPENSSL_EXPORT int BIO_should_retry(const BIO *bio); + +// BIO_should_io_special returns non-zero if |bio| encountered a temporary +// error while performing a special I/O operation, indicating that the caller +// should retry. The operation that caused the error is returned by +// |BIO_get_retry_reason|. +OPENSSL_EXPORT int BIO_should_io_special(const BIO *bio); + +// BIO_RR_CONNECT indicates that a connect would have blocked +#define BIO_RR_CONNECT 0x02 + +// BIO_RR_ACCEPT indicates that an accept would have blocked +#define BIO_RR_ACCEPT 0x03 + +// BIO_get_retry_reason returns the special I/O operation that needs to be +// retried. The return value is one of the |BIO_RR_*| values. +OPENSSL_EXPORT int BIO_get_retry_reason(const BIO *bio); + +// BIO_clear_flags ANDs |bio->flags| with the bitwise-complement of |flags|. +OPENSSL_EXPORT void BIO_clear_flags(BIO *bio, int flags); + +// BIO_set_retry_read sets the |BIO_FLAGS_READ| and |BIO_FLAGS_SHOULD_RETRY| +// flags on |bio|. +OPENSSL_EXPORT void BIO_set_retry_read(BIO *bio); + +// BIO_set_retry_write sets the |BIO_FLAGS_WRITE| and |BIO_FLAGS_SHOULD_RETRY| +// flags on |bio|. +OPENSSL_EXPORT void BIO_set_retry_write(BIO *bio); + +// BIO_get_retry_flags gets the |BIO_FLAGS_READ|, |BIO_FLAGS_WRITE|, +// |BIO_FLAGS_IO_SPECIAL| and |BIO_FLAGS_SHOULD_RETRY| flags from |bio|. +OPENSSL_EXPORT int BIO_get_retry_flags(BIO *bio); + +// BIO_clear_retry_flags clears the |BIO_FLAGS_READ|, |BIO_FLAGS_WRITE|, +// |BIO_FLAGS_IO_SPECIAL| and |BIO_FLAGS_SHOULD_RETRY| flags from |bio|. +OPENSSL_EXPORT void BIO_clear_retry_flags(BIO *bio); + +// BIO_method_type returns the type of |bio|, which is one of the |BIO_TYPE_*| +// values. +OPENSSL_EXPORT int BIO_method_type(const BIO *bio); + +// These are passed to the BIO callback +#define BIO_CB_FREE 0x01 +#define BIO_CB_READ 0x02 +#define BIO_CB_WRITE 0x03 +#define BIO_CB_PUTS 0x04 +#define BIO_CB_GETS 0x05 +#define BIO_CB_CTRL 0x06 + +// The callback is called before and after the underling operation, +// The BIO_CB_RETURN flag indicates if it is after the call +#define BIO_CB_RETURN 0x80 + +// bio_info_cb is the type of a callback function that can be called for most +// BIO operations. The |event| argument is one of |BIO_CB_*| and can be ORed +// with |BIO_CB_RETURN| if the callback is being made after the operation in +// question. In that case, |return_value| will contain the return value from +// the operation. +typedef long (*bio_info_cb)(BIO *bio, int event, const char *parg, int cmd, + long larg, long return_value); + +// BIO_callback_ctrl allows the callback function to be manipulated. The |cmd| +// arg will generally be |BIO_CTRL_SET_CALLBACK| but arbitrary command values +// can be interpreted by the |BIO|. +OPENSSL_EXPORT long BIO_callback_ctrl(BIO *bio, int cmd, bio_info_cb fp); + +// BIO_pending returns the number of bytes pending to be read. +OPENSSL_EXPORT size_t BIO_pending(const BIO *bio); + +// BIO_ctrl_pending calls |BIO_pending| and exists only for compatibility with +// OpenSSL. +OPENSSL_EXPORT size_t BIO_ctrl_pending(const BIO *bio); + +// BIO_wpending returns the number of bytes pending to be written. +OPENSSL_EXPORT size_t BIO_wpending(const BIO *bio); + +// BIO_set_close sets the close flag for |bio|. The meaning of which depends on +// the type of |bio| but, for example, a memory BIO interprets the close flag +// as meaning that it owns its buffer. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int BIO_set_close(BIO *bio, int close_flag); + +// BIO_number_read returns the number of bytes that have been read from +// |bio|. +OPENSSL_EXPORT size_t BIO_number_read(const BIO *bio); + +// BIO_number_written returns the number of bytes that have been written to +// |bio|. +OPENSSL_EXPORT size_t BIO_number_written(const BIO *bio); + + +// Managing chains of BIOs. +// +// BIOs can be put into chains where the output of one is used as the input of +// the next etc. The most common case is a buffering BIO, which accepts and +// buffers writes until flushed into the next BIO in the chain. + +// BIO_push adds |appended_bio| to the end of the chain with |bio| at the head. +// It returns |bio|. Note that |appended_bio| may be the head of a chain itself +// and thus this function can be used to join two chains. +// +// BIO_push takes ownership of the caller's reference to |appended_bio|. +OPENSSL_EXPORT BIO *BIO_push(BIO *bio, BIO *appended_bio); + +// BIO_pop removes |bio| from the head of a chain and returns the next BIO in +// the chain, or NULL if there is no next BIO. +// +// The caller takes ownership of the chain's reference to |bio|. +OPENSSL_EXPORT BIO *BIO_pop(BIO *bio); + +// BIO_next returns the next BIO in the chain after |bio|, or NULL if there is +// no such BIO. +OPENSSL_EXPORT BIO *BIO_next(BIO *bio); + +// BIO_free_all calls |BIO_free|. +// +// TODO(fork): update callers and remove. +OPENSSL_EXPORT void BIO_free_all(BIO *bio); + +// BIO_find_type walks a chain of BIOs and returns the first that matches +// |type|, which is one of the |BIO_TYPE_*| values. +OPENSSL_EXPORT BIO *BIO_find_type(BIO *bio, int type); + +// BIO_copy_next_retry sets the retry flags and |retry_reason| of |bio| from +// the next BIO in the chain. +OPENSSL_EXPORT void BIO_copy_next_retry(BIO *bio); + + +// Printf functions. + +// BIO_printf behaves like |printf| but outputs to |bio| rather than a |FILE|. +// It returns the number of bytes written or a negative number on error. +OPENSSL_EXPORT int BIO_printf(BIO *bio, const char *format, ...) + OPENSSL_PRINTF_FORMAT_FUNC(2, 3); + + +// Utility functions. + +// BIO_indent prints min(|indent|, |max_indent|) spaces. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int BIO_indent(BIO *bio, unsigned indent, unsigned max_indent); + +// BIO_hexdump writes a hex dump of |data| to |bio|. Each line will be indented +// by |indent| spaces. +OPENSSL_EXPORT int BIO_hexdump(BIO *bio, const uint8_t *data, size_t len, + unsigned indent); + +// ERR_print_errors prints the current contents of the error stack to |bio| +// using human readable strings where possible. +OPENSSL_EXPORT void ERR_print_errors(BIO *bio); + +// BIO_read_asn1 reads a single ASN.1 object from |bio|. If successful it sets +// |*out| to be an allocated buffer (that should be freed with |OPENSSL_free|), +// |*out_size| to the length, in bytes, of that buffer and returns one. +// Otherwise it returns zero. +// +// If the length of the object is greater than |max_len| or 2^32 then the +// function will fail. Long-form tags are not supported. If the length of the +// object is indefinite the full contents of |bio| are read, unless it would be +// greater than |max_len|, in which case the function fails. +// +// If the function fails then some unknown amount of data may have been read +// from |bio|. +OPENSSL_EXPORT int BIO_read_asn1(BIO *bio, uint8_t **out, size_t *out_len, + size_t max_len); + + +// Memory BIOs. +// +// Memory BIOs can be used as a read-only source (with |BIO_new_mem_buf|) or a +// writable sink (with |BIO_new|, |BIO_s_mem| and |BIO_mem_contents|). Data +// written to a writable, memory BIO can be recalled by reading from it. +// +// Calling |BIO_reset| on a read-only BIO resets it to the original contents. +// On a writable BIO, it clears any data. +// +// If the close flag is set to |BIO_NOCLOSE| (not the default) then the +// underlying |BUF_MEM| will not be freed when the |BIO| is freed. +// +// Memory BIOs support |BIO_gets| and |BIO_puts|. +// +// |BIO_ctrl_pending| returns the number of bytes currently stored. + +// BIO_NOCLOSE and |BIO_CLOSE| can be used as symbolic arguments when a "close +// flag" is passed to a BIO function. +#define BIO_NOCLOSE 0 +#define BIO_CLOSE 1 + +// BIO_s_mem returns a |BIO_METHOD| that uses a in-memory buffer. +OPENSSL_EXPORT const BIO_METHOD *BIO_s_mem(void); + +// BIO_new_mem_buf creates read-only BIO that reads from |len| bytes at |buf|. +// It does not take ownership of |buf|. It returns the BIO or NULL on error. +// +// If |len| is negative, then |buf| is treated as a NUL-terminated string, but +// don't depend on this in new code. +OPENSSL_EXPORT BIO *BIO_new_mem_buf(const void *buf, int len); + +// BIO_mem_contents sets |*out_contents| to point to the current contents of +// |bio| and |*out_len| to contain the length of that data. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int BIO_mem_contents(const BIO *bio, + const uint8_t **out_contents, + size_t *out_len); + +// BIO_get_mem_data sets |*contents| to point to the current contents of |bio| +// and returns the length of the data. +// +// WARNING: don't use this, use |BIO_mem_contents|. A return value of zero from +// this function can mean either that it failed or that the memory buffer is +// empty. +OPENSSL_EXPORT long BIO_get_mem_data(BIO *bio, char **contents); + +// BIO_get_mem_ptr sets |*out| to a BUF_MEM containing the current contents of +// |bio|. It returns one on success or zero on error. +OPENSSL_EXPORT int BIO_get_mem_ptr(BIO *bio, BUF_MEM **out); + +// BIO_set_mem_buf sets |b| as the contents of |bio|. If |take_ownership| is +// non-zero, then |b| will be freed when |bio| is closed. Returns one on +// success or zero otherwise. +OPENSSL_EXPORT int BIO_set_mem_buf(BIO *bio, BUF_MEM *b, int take_ownership); + +// BIO_set_mem_eof_return sets the value that will be returned from reading +// |bio| when empty. If |eof_value| is zero then an empty memory BIO will +// return EOF (that is it will return zero and |BIO_should_retry| will be +// false). If |eof_value| is non zero then it will return |eof_value| when it +// is empty and it will set the read retry flag (that is |BIO_read_retry| is +// true). To avoid ambiguity with a normal positive return value, |eof_value| +// should be set to a negative value, typically -1. +// +// For a read-only BIO, the default is zero (EOF). For a writable BIO, the +// default is -1 so that additional data can be written once exhausted. +OPENSSL_EXPORT int BIO_set_mem_eof_return(BIO *bio, int eof_value); + + +// File descriptor BIOs. +// +// File descriptor BIOs are wrappers around the system's |read| and |write| +// functions. If the close flag is set then then |close| is called on the +// underlying file descriptor when the BIO is freed. +// +// |BIO_reset| attempts to seek the file pointer to the start of file using +// |lseek|. + +// BIO_s_fd returns a |BIO_METHOD| for file descriptor fds. +OPENSSL_EXPORT const BIO_METHOD *BIO_s_fd(void); + +// BIO_new_fd creates a new file descriptor BIO wrapping |fd|. If |close_flag| +// is non-zero, then |fd| will be closed when the BIO is. +OPENSSL_EXPORT BIO *BIO_new_fd(int fd, int close_flag); + +// BIO_set_fd sets the file descriptor of |bio| to |fd|. If |close_flag| is +// non-zero then |fd| will be closed when |bio| is. It returns one on success +// or zero on error. +// +// This function may also be used with socket BIOs (see |BIO_s_socket| and +// |BIO_new_socket|). +OPENSSL_EXPORT int BIO_set_fd(BIO *bio, int fd, int close_flag); + +// BIO_get_fd returns the file descriptor currently in use by |bio| or -1 if +// |bio| does not wrap a file descriptor. If there is a file descriptor and +// |out_fd| is not NULL, it also sets |*out_fd| to the file descriptor. +// +// This function may also be used with socket BIOs (see |BIO_s_socket| and +// |BIO_new_socket|). +OPENSSL_EXPORT int BIO_get_fd(BIO *bio, int *out_fd); + + +// File BIOs. +// +// File BIOs are wrappers around a C |FILE| object. +// +// |BIO_flush| on a file BIO calls |fflush| on the wrapped stream. +// +// |BIO_reset| attempts to seek the file pointer to the start of file using +// |fseek|. +// +// Setting the close flag causes |fclose| to be called on the stream when the +// BIO is freed. + +// BIO_s_file returns a BIO_METHOD that wraps a |FILE|. +OPENSSL_EXPORT const BIO_METHOD *BIO_s_file(void); + +// BIO_new_file creates a file BIO by opening |filename| with the given mode. +// See the |fopen| manual page for details of the mode argument. +OPENSSL_EXPORT BIO *BIO_new_file(const char *filename, const char *mode); + +// BIO_new_fp creates a new file BIO that wraps the given |FILE|. If +// |close_flag| is |BIO_CLOSE|, then |fclose| will be called on |stream| when +// the BIO is closed. +OPENSSL_EXPORT BIO *BIO_new_fp(FILE *stream, int close_flag); + +// BIO_get_fp sets |*out_file| to the current |FILE| for |bio|. It returns one +// on success and zero otherwise. +OPENSSL_EXPORT int BIO_get_fp(BIO *bio, FILE **out_file); + +// BIO_set_fp sets the |FILE| for |bio|. If |close_flag| is |BIO_CLOSE| then +// |fclose| will be called on |file| when |bio| is closed. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int BIO_set_fp(BIO *bio, FILE *file, int close_flag); + +// BIO_read_filename opens |filename| for reading and sets the result as the +// |FILE| for |bio|. It returns one on success and zero otherwise. The |FILE| +// will be closed when |bio| is freed. +OPENSSL_EXPORT int BIO_read_filename(BIO *bio, const char *filename); + +// BIO_write_filename opens |filename| for writing and sets the result as the +// |FILE| for |bio|. It returns one on success and zero otherwise. The |FILE| +// will be closed when |bio| is freed. +OPENSSL_EXPORT int BIO_write_filename(BIO *bio, const char *filename); + +// BIO_append_filename opens |filename| for appending and sets the result as +// the |FILE| for |bio|. It returns one on success and zero otherwise. The +// |FILE| will be closed when |bio| is freed. +OPENSSL_EXPORT int BIO_append_filename(BIO *bio, const char *filename); + +// BIO_rw_filename opens |filename| for reading and writing and sets the result +// as the |FILE| for |bio|. It returns one on success and zero otherwise. The +// |FILE| will be closed when |bio| is freed. +OPENSSL_EXPORT int BIO_rw_filename(BIO *bio, const char *filename); + + +// Socket BIOs. +// +// Socket BIOs behave like file descriptor BIOs but, on Windows systems, wrap +// the system's |recv| and |send| functions instead of |read| and |write|. On +// Windows, file descriptors are provided by C runtime and are not +// interchangeable with sockets. +// +// Socket BIOs may be used with |BIO_set_fd| and |BIO_get_fd|. +// +// TODO(davidben): Add separate APIs and fix the internals to use |SOCKET|s +// around rather than rely on int casts. + +OPENSSL_EXPORT const BIO_METHOD *BIO_s_socket(void); + +// BIO_new_socket allocates and initialises a fresh BIO which will read and +// write to the socket |fd|. If |close_flag| is |BIO_CLOSE| then closing the +// BIO will close |fd|. It returns the fresh |BIO| or NULL on error. +OPENSSL_EXPORT BIO *BIO_new_socket(int fd, int close_flag); + + +// Connect BIOs. +// +// A connection BIO creates a network connection and transfers data over the +// resulting socket. + +OPENSSL_EXPORT const BIO_METHOD *BIO_s_connect(void); + +// BIO_new_connect returns a BIO that connects to the given hostname and port. +// The |host_and_optional_port| argument should be of the form +// "www.example.com" or "www.example.com:443". If the port is omitted, it must +// be provided with |BIO_set_conn_port|. +// +// It returns the new BIO on success, or NULL on error. +OPENSSL_EXPORT BIO *BIO_new_connect(const char *host_and_optional_port); + +// BIO_set_conn_hostname sets |host_and_optional_port| as the hostname and +// optional port that |bio| will connect to. If the port is omitted, it must be +// provided with |BIO_set_conn_port|. +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int BIO_set_conn_hostname(BIO *bio, + const char *host_and_optional_port); + +// BIO_set_conn_port sets |port_str| as the port or service name that |bio| +// will connect to. It returns one on success and zero otherwise. +OPENSSL_EXPORT int BIO_set_conn_port(BIO *bio, const char *port_str); + +// BIO_set_conn_int_port sets |*port| as the port that |bio| will connect to. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int BIO_set_conn_int_port(BIO *bio, const int *port); + +// BIO_set_nbio sets whether |bio| will use non-blocking I/O operations. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int BIO_set_nbio(BIO *bio, int on); + +// BIO_do_connect connects |bio| if it has not been connected yet. It returns +// one on success and <= 0 otherwise. +OPENSSL_EXPORT int BIO_do_connect(BIO *bio); + + +// Datagram BIOs. +// +// TODO(fork): not implemented. + +#define BIO_CTRL_DGRAM_QUERY_MTU 40 // as kernel for current MTU + +#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for MTU. want to use + this if asking the kernel fails */ + +#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU was exceed in + the previous write operation. */ + +// BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT is unsupported as it is unused by consumers +// and depends on |timeval|, which is not 2038-clean on all platforms. + +#define BIO_CTRL_DGRAM_GET_PEER 46 + +#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47 + + +// BIO Pairs. +// +// BIO pairs provide a "loopback" like system: a pair of BIOs where data +// written to one can be read from the other and vice versa. + +// BIO_new_bio_pair sets |*out1| and |*out2| to two freshly created BIOs where +// data written to one can be read from the other and vice versa. The +// |writebuf1| argument gives the size of the buffer used in |*out1| and +// |writebuf2| for |*out2|. It returns one on success and zero on error. +OPENSSL_EXPORT int BIO_new_bio_pair(BIO **out1, size_t writebuf1, BIO **out2, + size_t writebuf2); + +// BIO_ctrl_get_read_request returns the number of bytes that the other side of +// |bio| tried (unsuccessfully) to read. +OPENSSL_EXPORT size_t BIO_ctrl_get_read_request(BIO *bio); + +// BIO_ctrl_get_write_guarantee returns the number of bytes that |bio| (which +// must have been returned by |BIO_new_bio_pair|) will accept on the next +// |BIO_write| call. +OPENSSL_EXPORT size_t BIO_ctrl_get_write_guarantee(BIO *bio); + +// BIO_shutdown_wr marks |bio| as closed, from the point of view of the other +// side of the pair. Future |BIO_write| calls on |bio| will fail. It returns +// one on success and zero otherwise. +OPENSSL_EXPORT int BIO_shutdown_wr(BIO *bio); + + +// Custom BIOs. +// +// Consumers can create custom |BIO|s by filling in a |BIO_METHOD| and using +// low-level control functions to set state. + +// BIO_get_new_index returns a new "type" value for a custom |BIO|. +OPENSSL_EXPORT int BIO_get_new_index(void); + +// BIO_meth_new returns a newly-allocated |BIO_METHOD| or NULL on allocation +// error. The |type| specifies the type that will be returned by +// |BIO_method_type|. If this is unnecessary, this value may be zero. The |name| +// parameter is vestigial and may be NULL. +// +// Use the |BIO_meth_set_*| functions below to initialize the |BIO_METHOD|. The +// function implementations may use |BIO_set_data| and |BIO_get_data| to add +// method-specific state to associated |BIO|s. Additionally, |BIO_set_init| must +// be called after an associated |BIO| is fully initialized. State set via +// |BIO_set_data| may be released by configuring a destructor with +// |BIO_meth_set_destroy|. +OPENSSL_EXPORT BIO_METHOD *BIO_meth_new(int type, const char *name); + +// BIO_meth_free releases memory associated with |method|. +OPENSSL_EXPORT void BIO_meth_free(BIO_METHOD *method); + +// BIO_meth_set_create sets a function to be called on |BIO_new| for |method| +// and returns one. The function should return one on success and zero on +// error. +OPENSSL_EXPORT int BIO_meth_set_create(BIO_METHOD *method, + int (*create)(BIO *)); + +// BIO_meth_set_destroy sets a function to release data associated with a |BIO| +// and returns one. The function's return value is ignored. +OPENSSL_EXPORT int BIO_meth_set_destroy(BIO_METHOD *method, + int (*destroy)(BIO *)); + +// BIO_meth_set_write sets the implementation of |BIO_write| for |method| and +// returns one. |BIO_METHOD|s which implement |BIO_write| should also implement +// |BIO_CTRL_FLUSH|. (See |BIO_meth_set_ctrl|.) +OPENSSL_EXPORT int BIO_meth_set_write(BIO_METHOD *method, + int (*write)(BIO *, const char *, int)); + +// BIO_meth_set_read sets the implementation of |BIO_read| for |method| and +// returns one. +OPENSSL_EXPORT int BIO_meth_set_read(BIO_METHOD *method, + int (*read)(BIO *, char *, int)); + +// BIO_meth_set_gets sets the implementation of |BIO_gets| for |method| and +// returns one. +OPENSSL_EXPORT int BIO_meth_set_gets(BIO_METHOD *method, + int (*gets)(BIO *, char *, int)); + +// BIO_meth_set_ctrl sets the implementation of |BIO_ctrl| for |method| and +// returns one. +OPENSSL_EXPORT int BIO_meth_set_ctrl(BIO_METHOD *method, + long (*ctrl)(BIO *, int, long, void *)); + +// BIO_set_data sets custom data on |bio|. It may be retried with +// |BIO_get_data|. +OPENSSL_EXPORT void BIO_set_data(BIO *bio, void *ptr); + +// BIO_get_data returns custom data on |bio| set by |BIO_get_data|. +OPENSSL_EXPORT void *BIO_get_data(BIO *bio); + +// BIO_set_init sets whether |bio| has been fully initialized. Until fully +// initialized, |BIO_read| and |BIO_write| will fail. +OPENSSL_EXPORT void BIO_set_init(BIO *bio, int init); + +// BIO_get_init returns whether |bio| has been fully initialized. +OPENSSL_EXPORT int BIO_get_init(BIO *bio); + +// These are values of the |cmd| argument to |BIO_ctrl|. + +// BIO_CTRL_RESET implements |BIO_reset|. The arguments are unused. +#define BIO_CTRL_RESET 1 + +// BIO_CTRL_EOF implements |BIO_eof|. The arguments are unused. +#define BIO_CTRL_EOF 2 + +// BIO_CTRL_INFO is a legacy command that returns information specific to the +// type of |BIO|. It is not safe to call generically and should not be +// implemented in new |BIO| types. +#define BIO_CTRL_INFO 3 + +// BIO_CTRL_GET_CLOSE returns the close flag set by |BIO_CTRL_SET_CLOSE|. The +// arguments are unused. +#define BIO_CTRL_GET_CLOSE 8 + +// BIO_CTRL_SET_CLOSE implements |BIO_set_close|. The |larg| argument is the +// close flag. +#define BIO_CTRL_SET_CLOSE 9 + +// BIO_CTRL_PENDING implements |BIO_pending|. The arguments are unused. +#define BIO_CTRL_PENDING 10 + +// BIO_CTRL_FLUSH implements |BIO_flush|. The arguments are unused. +#define BIO_CTRL_FLUSH 11 + +// BIO_CTRL_WPENDING implements |BIO_wpending|. The arguments are unused. +#define BIO_CTRL_WPENDING 13 + +// BIO_CTRL_SET_CALLBACK sets an informational callback of type +// int cb(BIO *bio, int state, int ret) +#define BIO_CTRL_SET_CALLBACK 14 + +// BIO_CTRL_GET_CALLBACK returns the callback set by |BIO_CTRL_SET_CALLBACK|. +#define BIO_CTRL_GET_CALLBACK 15 + +// The following are never used, but are defined to aid porting existing code. +#define BIO_CTRL_SET 4 +#define BIO_CTRL_GET 5 +#define BIO_CTRL_PUSH 6 +#define BIO_CTRL_POP 7 +#define BIO_CTRL_DUP 12 +#define BIO_CTRL_SET_FILENAME 30 + + +// Deprecated functions. + +// BIO_f_base64 returns a filter |BIO| that base64-encodes data written into +// it, and decodes data read from it. |BIO_gets| is not supported. Call +// |BIO_flush| when done writing, to signal that no more data are to be +// encoded. The flag |BIO_FLAGS_BASE64_NO_NL| may be set to encode all the data +// on one line. +// +// Use |EVP_EncodeBlock| and |EVP_DecodeBase64| instead. +OPENSSL_EXPORT const BIO_METHOD *BIO_f_base64(void); + +OPENSSL_EXPORT void BIO_set_retry_special(BIO *bio); + +// BIO_set_write_buffer_size returns zero. +OPENSSL_EXPORT int BIO_set_write_buffer_size(BIO *bio, int buffer_size); + +// BIO_set_shutdown sets a method-specific "shutdown" bit on |bio|. +OPENSSL_EXPORT void BIO_set_shutdown(BIO *bio, int shutdown); + +// BIO_get_shutdown returns the method-specific "shutdown" bit. +OPENSSL_EXPORT int BIO_get_shutdown(BIO *bio); + +// BIO_meth_set_puts returns one. |BIO_puts| is implemented with |BIO_write| in +// BoringSSL. +OPENSSL_EXPORT int BIO_meth_set_puts(BIO_METHOD *method, + int (*puts)(BIO *, const char *)); + + +// Private functions + +#define BIO_FLAGS_READ 0x01 +#define BIO_FLAGS_WRITE 0x02 +#define BIO_FLAGS_IO_SPECIAL 0x04 +#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL) +#define BIO_FLAGS_SHOULD_RETRY 0x08 +#define BIO_FLAGS_BASE64_NO_NL 0x100 +// BIO_FLAGS_MEM_RDONLY is used with memory BIOs. It means we shouldn't free up +// or change the data in any way. +#define BIO_FLAGS_MEM_RDONLY 0x200 + +// These are the 'types' of BIOs +#define BIO_TYPE_NONE 0 +#define BIO_TYPE_MEM (1 | 0x0400) +#define BIO_TYPE_FILE (2 | 0x0400) +#define BIO_TYPE_FD (4 | 0x0400 | 0x0100) +#define BIO_TYPE_SOCKET (5 | 0x0400 | 0x0100) +#define BIO_TYPE_NULL (6 | 0x0400) +#define BIO_TYPE_SSL (7 | 0x0200) +#define BIO_TYPE_MD (8 | 0x0200) // passive filter +#define BIO_TYPE_BUFFER (9 | 0x0200) // filter +#define BIO_TYPE_CIPHER (10 | 0x0200) // filter +#define BIO_TYPE_BASE64 (11 | 0x0200) // filter +#define BIO_TYPE_CONNECT (12 | 0x0400 | 0x0100) // socket - connect +#define BIO_TYPE_ACCEPT (13 | 0x0400 | 0x0100) // socket for accept +#define BIO_TYPE_PROXY_CLIENT (14 | 0x0200) // client proxy BIO +#define BIO_TYPE_PROXY_SERVER (15 | 0x0200) // server proxy BIO +#define BIO_TYPE_NBIO_TEST (16 | 0x0200) // server proxy BIO +#define BIO_TYPE_NULL_FILTER (17 | 0x0200) +#define BIO_TYPE_BER (18 | 0x0200) // BER -> bin filter +#define BIO_TYPE_BIO (19 | 0x0400) // (half a) BIO pair +#define BIO_TYPE_LINEBUFFER (20 | 0x0200) // filter +#define BIO_TYPE_DGRAM (21 | 0x0400 | 0x0100) +#define BIO_TYPE_ASN1 (22 | 0x0200) // filter +#define BIO_TYPE_COMP (23 | 0x0200) // filter + +// BIO_TYPE_DESCRIPTOR denotes that the |BIO| responds to the |BIO_C_SET_FD| +// (|BIO_set_fd|) and |BIO_C_GET_FD| (|BIO_get_fd|) control hooks. +#define BIO_TYPE_DESCRIPTOR 0x0100 // socket, fd, connect or accept +#define BIO_TYPE_FILTER 0x0200 +#define BIO_TYPE_SOURCE_SINK 0x0400 + +// BIO_TYPE_START is the first user-allocated |BIO| type. No pre-defined type, +// flag bits aside, may exceed this value. +#define BIO_TYPE_START 128 + +struct bio_method_st { + int type; + const char *name; + int (*bwrite)(BIO *, const char *, int); + int (*bread)(BIO *, char *, int); + // TODO(fork): remove bputs. + int (*bputs)(BIO *, const char *); + int (*bgets)(BIO *, char *, int); + long (*ctrl)(BIO *, int, long, void *); + int (*create)(BIO *); + int (*destroy)(BIO *); + long (*callback_ctrl)(BIO *, int, bio_info_cb); +}; + +struct bio_st { + const BIO_METHOD *method; + + // init is non-zero if this |BIO| has been initialised. + int init; + // shutdown is often used by specific |BIO_METHOD|s to determine whether + // they own some underlying resource. This flag can often by controlled by + // |BIO_set_close|. For example, whether an fd BIO closes the underlying fd + // when it, itself, is closed. + int shutdown; + int flags; + int retry_reason; + // num is a BIO-specific value. For example, in fd BIOs it's used to store a + // file descriptor. + int num; + CRYPTO_refcount_t references; + void *ptr; + // next_bio points to the next |BIO| in a chain. This |BIO| owns a reference + // to |next_bio|. + BIO *next_bio; // used by filter BIOs + size_t num_read, num_write; +}; + +#define BIO_C_SET_CONNECT 100 +#define BIO_C_DO_STATE_MACHINE 101 +#define BIO_C_SET_NBIO 102 +#define BIO_C_SET_PROXY_PARAM 103 +#define BIO_C_SET_FD 104 +#define BIO_C_GET_FD 105 +#define BIO_C_SET_FILE_PTR 106 +#define BIO_C_GET_FILE_PTR 107 +#define BIO_C_SET_FILENAME 108 +#define BIO_C_SET_SSL 109 +#define BIO_C_GET_SSL 110 +#define BIO_C_SET_MD 111 +#define BIO_C_GET_MD 112 +#define BIO_C_GET_CIPHER_STATUS 113 +#define BIO_C_SET_BUF_MEM 114 +#define BIO_C_GET_BUF_MEM_PTR 115 +#define BIO_C_GET_BUFF_NUM_LINES 116 +#define BIO_C_SET_BUFF_SIZE 117 +#define BIO_C_SET_ACCEPT 118 +#define BIO_C_SSL_MODE 119 +#define BIO_C_GET_MD_CTX 120 +#define BIO_C_GET_PROXY_PARAM 121 +#define BIO_C_SET_BUFF_READ_DATA 122 // data to read first +#define BIO_C_GET_ACCEPT 124 +#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 +#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 +#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 +#define BIO_C_FILE_SEEK 128 +#define BIO_C_GET_CIPHER_CTX 129 +#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 // return end of input value +#define BIO_C_SET_BIND_MODE 131 +#define BIO_C_GET_BIND_MODE 132 +#define BIO_C_FILE_TELL 133 +#define BIO_C_GET_SOCKS 134 +#define BIO_C_SET_SOCKS 135 + +#define BIO_C_SET_WRITE_BUF_SIZE 136 // for BIO_s_bio +#define BIO_C_GET_WRITE_BUF_SIZE 137 +#define BIO_C_GET_WRITE_GUARANTEE 140 +#define BIO_C_GET_READ_REQUEST 141 +#define BIO_C_SHUTDOWN_WR 142 +#define BIO_C_NREAD0 143 +#define BIO_C_NREAD 144 +#define BIO_C_NWRITE0 145 +#define BIO_C_NWRITE 146 +#define BIO_C_RESET_READ_REQUEST 147 +#define BIO_C_SET_MD_CTX 148 + +#define BIO_C_SET_PREFIX 149 +#define BIO_C_GET_PREFIX 150 +#define BIO_C_SET_SUFFIX 151 +#define BIO_C_GET_SUFFIX 152 + +#define BIO_C_SET_EX_ARG 153 +#define BIO_C_GET_EX_ARG 154 + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(BIO, BIO_free) +BORINGSSL_MAKE_UP_REF(BIO, BIO_up_ref) +BORINGSSL_MAKE_DELETER(BIO_METHOD, BIO_meth_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define BIO_R_BAD_FOPEN_MODE 100 +#define BIO_R_BROKEN_PIPE 101 +#define BIO_R_CONNECT_ERROR 102 +#define BIO_R_ERROR_SETTING_NBIO 103 +#define BIO_R_INVALID_ARGUMENT 104 +#define BIO_R_IN_USE 105 +#define BIO_R_KEEPALIVE 106 +#define BIO_R_NBIO_CONNECT_ERROR 107 +#define BIO_R_NO_HOSTNAME_SPECIFIED 108 +#define BIO_R_NO_PORT_SPECIFIED 109 +#define BIO_R_NO_SUCH_FILE 110 +#define BIO_R_NULL_PARAMETER 111 +#define BIO_R_SYS_LIB 112 +#define BIO_R_UNABLE_TO_CREATE_SOCKET 113 +#define BIO_R_UNINITIALIZED 114 +#define BIO_R_UNSUPPORTED_METHOD 115 +#define BIO_R_WRITE_TO_READ_ONLY_BIO 116 + +#endif // OPENSSL_HEADER_BIO_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/bio.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/include/openssl/bio.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/bio.h.grpc_back index 5e3e2ef28..da0dcdfe6 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/bio.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bio.h.grpc_back @@ -117,10 +117,14 @@ OPENSSL_EXPORT int BIO_read(BIO *bio, void *data, int len); // return a line for this call, remove the warning above. OPENSSL_EXPORT int BIO_gets(BIO *bio, char *buf, int size); -// BIO_write writes |len| bytes from |data| to BIO. It returns the number of +// BIO_write writes |len| bytes from |data| to |bio|. It returns the number of // bytes written or a negative number on error. OPENSSL_EXPORT int BIO_write(BIO *bio, const void *data, int len); +// BIO_write_all writes |len| bytes from |data| to |bio|, looping as necessary. +// It returns one if all bytes were successfully written and zero on error. +OPENSSL_EXPORT int BIO_write_all(BIO *bio, const void *data, size_t len); + // BIO_puts writes a NUL terminated string from |buf| to |bio|. It returns the // number of bytes written or a negative number on error. OPENSSL_EXPORT int BIO_puts(BIO *bio, const char *buf); @@ -677,26 +681,49 @@ OPENSSL_EXPORT void BIO_set_init(BIO *bio, int init); OPENSSL_EXPORT int BIO_get_init(BIO *bio); // These are values of the |cmd| argument to |BIO_ctrl|. -#define BIO_CTRL_RESET 1 // opt - rewind/zero etc -#define BIO_CTRL_EOF 2 // opt - are we at the eof -#define BIO_CTRL_INFO 3 // opt - extra tit-bits -#define BIO_CTRL_SET 4 // man - set the 'IO' type -#define BIO_CTRL_GET 5 // man - get the 'IO' type -#define BIO_CTRL_PUSH 6 -#define BIO_CTRL_POP 7 -#define BIO_CTRL_GET_CLOSE 8 // man - set the 'close' on free -#define BIO_CTRL_SET_CLOSE 9 // man - set the 'close' on free -#define BIO_CTRL_PENDING 10 // opt - is their more data buffered -#define BIO_CTRL_FLUSH 11 // opt - 'flush' buffered output -#define BIO_CTRL_WPENDING 13 // opt - number of bytes still to write -// callback is int cb(BIO *bio,state,ret); -#define BIO_CTRL_SET_CALLBACK 14 // opt - set callback function -#define BIO_CTRL_GET_CALLBACK 15 // opt - set callback function -#define BIO_CTRL_SET_FILENAME 30 // BIO_s_file special - -// BIO_CTRL_DUP is never used, but exists to allow code to compile more -// easily. -#define BIO_CTRL_DUP 12 + +// BIO_CTRL_RESET implements |BIO_reset|. The arguments are unused. +#define BIO_CTRL_RESET 1 + +// BIO_CTRL_EOF implements |BIO_eof|. The arguments are unused. +#define BIO_CTRL_EOF 2 + +// BIO_CTRL_INFO is a legacy command that returns information specific to the +// type of |BIO|. It is not safe to call generically and should not be +// implemented in new |BIO| types. +#define BIO_CTRL_INFO 3 + +// BIO_CTRL_GET_CLOSE returns the close flag set by |BIO_CTRL_SET_CLOSE|. The +// arguments are unused. +#define BIO_CTRL_GET_CLOSE 8 + +// BIO_CTRL_SET_CLOSE implements |BIO_set_close|. The |larg| argument is the +// close flag. +#define BIO_CTRL_SET_CLOSE 9 + +// BIO_CTRL_PENDING implements |BIO_pending|. The arguments are unused. +#define BIO_CTRL_PENDING 10 + +// BIO_CTRL_FLUSH implements |BIO_flush|. The arguments are unused. +#define BIO_CTRL_FLUSH 11 + +// BIO_CTRL_WPENDING implements |BIO_wpending|. The arguments are unused. +#define BIO_CTRL_WPENDING 13 + +// BIO_CTRL_SET_CALLBACK sets an informational callback of type +// int cb(BIO *bio, int state, int ret) +#define BIO_CTRL_SET_CALLBACK 14 + +// BIO_CTRL_GET_CALLBACK returns the callback set by |BIO_CTRL_SET_CALLBACK|. +#define BIO_CTRL_GET_CALLBACK 15 + +// The following are never used, but are defined to aid porting existing code. +#define BIO_CTRL_SET 4 +#define BIO_CTRL_GET 5 +#define BIO_CTRL_PUSH 6 +#define BIO_CTRL_POP 7 +#define BIO_CTRL_DUP 12 +#define BIO_CTRL_SET_FILENAME 30 // Deprecated functions. @@ -706,6 +733,8 @@ OPENSSL_EXPORT int BIO_get_init(BIO *bio); // |BIO_flush| when done writing, to signal that no more data are to be // encoded. The flag |BIO_FLAGS_BASE64_NO_NL| may be set to encode all the data // on one line. +// +// Use |EVP_EncodeBlock| and |EVP_DecodeBase64| instead. OPENSSL_EXPORT const BIO_METHOD *BIO_f_base64(void); OPENSSL_EXPORT void BIO_set_retry_special(BIO *bio); @@ -733,8 +762,8 @@ OPENSSL_EXPORT int BIO_meth_set_puts(BIO_METHOD *method, #define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL) #define BIO_FLAGS_SHOULD_RETRY 0x08 #define BIO_FLAGS_BASE64_NO_NL 0x100 -// This is used with memory BIOs: it means we shouldn't free up or change the -// data in any way. +// BIO_FLAGS_MEM_RDONLY is used with memory BIOs. It means we shouldn't free up +// or change the data in any way. #define BIO_FLAGS_MEM_RDONLY 0x200 // These are the 'types' of BIOs @@ -762,7 +791,7 @@ OPENSSL_EXPORT int BIO_meth_set_puts(BIO_METHOD *method, #define BIO_TYPE_ASN1 (22 | 0x0200) // filter #define BIO_TYPE_COMP (23 | 0x0200) // filter -// |BIO_TYPE_DESCRIPTOR| denotes that the |BIO| responds to the |BIO_C_SET_FD| +// BIO_TYPE_DESCRIPTOR denotes that the |BIO| responds to the |BIO_C_SET_FD| // (|BIO_set_fd|) and |BIO_C_GET_FD| (|BIO_get_fd|) control hooks. #define BIO_TYPE_DESCRIPTOR 0x0100 // socket, fd, connect or accept #define BIO_TYPE_FILTER 0x0200 @@ -809,61 +838,61 @@ struct bio_st { size_t num_read, num_write; }; -#define BIO_C_SET_CONNECT 100 -#define BIO_C_DO_STATE_MACHINE 101 -#define BIO_C_SET_NBIO 102 -#define BIO_C_SET_PROXY_PARAM 103 -#define BIO_C_SET_FD 104 -#define BIO_C_GET_FD 105 -#define BIO_C_SET_FILE_PTR 106 -#define BIO_C_GET_FILE_PTR 107 -#define BIO_C_SET_FILENAME 108 -#define BIO_C_SET_SSL 109 -#define BIO_C_GET_SSL 110 -#define BIO_C_SET_MD 111 -#define BIO_C_GET_MD 112 -#define BIO_C_GET_CIPHER_STATUS 113 -#define BIO_C_SET_BUF_MEM 114 -#define BIO_C_GET_BUF_MEM_PTR 115 -#define BIO_C_GET_BUFF_NUM_LINES 116 -#define BIO_C_SET_BUFF_SIZE 117 -#define BIO_C_SET_ACCEPT 118 -#define BIO_C_SSL_MODE 119 -#define BIO_C_GET_MD_CTX 120 -#define BIO_C_GET_PROXY_PARAM 121 -#define BIO_C_SET_BUFF_READ_DATA 122 // data to read first -#define BIO_C_GET_ACCEPT 124 -#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 -#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 -#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 -#define BIO_C_FILE_SEEK 128 -#define BIO_C_GET_CIPHER_CTX 129 -#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 //return end of input value -#define BIO_C_SET_BIND_MODE 131 -#define BIO_C_GET_BIND_MODE 132 -#define BIO_C_FILE_TELL 133 -#define BIO_C_GET_SOCKS 134 -#define BIO_C_SET_SOCKS 135 - -#define BIO_C_SET_WRITE_BUF_SIZE 136 // for BIO_s_bio -#define BIO_C_GET_WRITE_BUF_SIZE 137 -#define BIO_C_GET_WRITE_GUARANTEE 140 -#define BIO_C_GET_READ_REQUEST 141 -#define BIO_C_SHUTDOWN_WR 142 -#define BIO_C_NREAD0 143 -#define BIO_C_NREAD 144 -#define BIO_C_NWRITE0 145 -#define BIO_C_NWRITE 146 -#define BIO_C_RESET_READ_REQUEST 147 -#define BIO_C_SET_MD_CTX 148 - -#define BIO_C_SET_PREFIX 149 -#define BIO_C_GET_PREFIX 150 -#define BIO_C_SET_SUFFIX 151 -#define BIO_C_GET_SUFFIX 152 - -#define BIO_C_SET_EX_ARG 153 -#define BIO_C_GET_EX_ARG 154 +#define BIO_C_SET_CONNECT 100 +#define BIO_C_DO_STATE_MACHINE 101 +#define BIO_C_SET_NBIO 102 +#define BIO_C_SET_PROXY_PARAM 103 +#define BIO_C_SET_FD 104 +#define BIO_C_GET_FD 105 +#define BIO_C_SET_FILE_PTR 106 +#define BIO_C_GET_FILE_PTR 107 +#define BIO_C_SET_FILENAME 108 +#define BIO_C_SET_SSL 109 +#define BIO_C_GET_SSL 110 +#define BIO_C_SET_MD 111 +#define BIO_C_GET_MD 112 +#define BIO_C_GET_CIPHER_STATUS 113 +#define BIO_C_SET_BUF_MEM 114 +#define BIO_C_GET_BUF_MEM_PTR 115 +#define BIO_C_GET_BUFF_NUM_LINES 116 +#define BIO_C_SET_BUFF_SIZE 117 +#define BIO_C_SET_ACCEPT 118 +#define BIO_C_SSL_MODE 119 +#define BIO_C_GET_MD_CTX 120 +#define BIO_C_GET_PROXY_PARAM 121 +#define BIO_C_SET_BUFF_READ_DATA 122 // data to read first +#define BIO_C_GET_ACCEPT 124 +#define BIO_C_SET_SSL_RENEGOTIATE_BYTES 125 +#define BIO_C_GET_SSL_NUM_RENEGOTIATES 126 +#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127 +#define BIO_C_FILE_SEEK 128 +#define BIO_C_GET_CIPHER_CTX 129 +#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 // return end of input value +#define BIO_C_SET_BIND_MODE 131 +#define BIO_C_GET_BIND_MODE 132 +#define BIO_C_FILE_TELL 133 +#define BIO_C_GET_SOCKS 134 +#define BIO_C_SET_SOCKS 135 + +#define BIO_C_SET_WRITE_BUF_SIZE 136 // for BIO_s_bio +#define BIO_C_GET_WRITE_BUF_SIZE 137 +#define BIO_C_GET_WRITE_GUARANTEE 140 +#define BIO_C_GET_READ_REQUEST 141 +#define BIO_C_SHUTDOWN_WR 142 +#define BIO_C_NREAD0 143 +#define BIO_C_NREAD 144 +#define BIO_C_NWRITE0 145 +#define BIO_C_NWRITE 146 +#define BIO_C_RESET_READ_REQUEST 147 +#define BIO_C_SET_MD_CTX 148 + +#define BIO_C_SET_PREFIX 149 +#define BIO_C_GET_PREFIX 150 +#define BIO_C_SET_SUFFIX 151 +#define BIO_C_GET_SUFFIX 152 + +#define BIO_C_SET_EX_ARG 153 +#define BIO_C_GET_EX_ARG 154 #if defined(__cplusplus) @@ -871,11 +900,13 @@ struct bio_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(BIO, BIO_free) +BORINGSSL_MAKE_UP_REF(BIO, BIO_up_ref) +BORINGSSL_MAKE_DELETER(BIO_METHOD, BIO_meth_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/blowfish.h b/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/blowfish.h rename to Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h index 734560085..c0e701d9c 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/blowfish.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h @@ -81,9 +81,9 @@ OPENSSL_EXPORT void BF_decrypt(uint32_t *data, const BF_KEY *key); OPENSSL_EXPORT void BF_ecb_encrypt(const uint8_t *in, uint8_t *out, const BF_KEY *key, int enc); -OPENSSL_EXPORT void BF_cbc_encrypt(const uint8_t *in, uint8_t *out, long length, - const BF_KEY *schedule, uint8_t *ivec, - int enc); +OPENSSL_EXPORT void BF_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const BF_KEY *schedule, + uint8_t *ivec, int enc); #ifdef __cplusplus diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.back new file mode 100644 index 000000000..293b1755b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.back @@ -0,0 +1,93 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_BLOWFISH_H +#define OPENSSL_HEADER_BLOWFISH_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#define BF_ENCRYPT 1 +#define BF_DECRYPT 0 + +#define BF_ROUNDS 16 +#define BF_BLOCK 8 + +typedef struct bf_key_st { + uint32_t P[BF_ROUNDS + 2]; + uint32_t S[4 * 256]; +} BF_KEY; + +OPENSSL_EXPORT void BF_set_key(BF_KEY *key, size_t len, const uint8_t *data); +OPENSSL_EXPORT void BF_encrypt(uint32_t *data, const BF_KEY *key); +OPENSSL_EXPORT void BF_decrypt(uint32_t *data, const BF_KEY *key); + +OPENSSL_EXPORT void BF_ecb_encrypt(const uint8_t *in, uint8_t *out, + const BF_KEY *key, int enc); +OPENSSL_EXPORT void BF_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const BF_KEY *schedule, + uint8_t *ivec, int enc); + + +#ifdef __cplusplus +} +#endif + +#endif // OPENSSL_HEADER_BLOWFISH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/blowfish.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/blowfish.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.grpc_back index ecf9d4561..293b1755b 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/blowfish.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/blowfish.h.grpc_back @@ -81,9 +81,9 @@ OPENSSL_EXPORT void BF_decrypt(uint32_t *data, const BF_KEY *key); OPENSSL_EXPORT void BF_ecb_encrypt(const uint8_t *in, uint8_t *out, const BF_KEY *key, int enc); -OPENSSL_EXPORT void BF_cbc_encrypt(const uint8_t *in, uint8_t *out, long length, - const BF_KEY *schedule, uint8_t *ivec, - int enc); +OPENSSL_EXPORT void BF_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const BF_KEY *schedule, + uint8_t *ivec, int enc); #ifdef __cplusplus diff --git a/Pods/BoringSSL-GRPC/include/openssl/bn.h b/Pods/BoringSSL-GRPC/src/include/openssl/bn.h similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/bn.h rename to Pods/BoringSSL-GRPC/src/include/openssl/bn.h index 7c0b5b546..e0d6b5c6a 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/bn.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bn.h @@ -142,9 +142,11 @@ extern "C" { // BN_ULONG is the native word size when working with big integers. // // Note: on some platforms, inttypes.h does not define print format macros in -// C++ unless |__STDC_FORMAT_MACROS| defined. As this is a public header, bn.h -// does not define |__STDC_FORMAT_MACROS| itself. C++ source files which use the -// FMT macros must define it externally. +// C++ unless |__STDC_FORMAT_MACROS| defined. This is due to text in C99 which +// was never adopted in any C++ standard and explicitly overruled in C++11. As +// this is a public header, bn.h does not define |__STDC_FORMAT_MACROS| itself. +// Projects which use |BN_*_FMT*| with outdated C headers may need to define it +// externally. #if defined(OPENSSL_64_BIT) #define BN_ULONG uint64_t #define BN_BITS2 64 @@ -158,7 +160,7 @@ extern "C" { #define BN_DEC_FMT1 "%" PRIu32 #define BN_DEC_FMT2 "%09" PRIu32 #define BN_HEX_FMT1 "%" PRIx32 -#define BN_HEX_FMT2 "%08" PRIx64 +#define BN_HEX_FMT2 "%08" PRIx32 #else #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" #endif @@ -630,9 +632,12 @@ OPENSSL_EXPORT int BN_rand_range_ex(BIGNUM *r, BN_ULONG min_inclusive, // BN_pseudo_rand_range is an alias for BN_rand_range. OPENSSL_EXPORT int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); -// BN_GENCB holds a callback function that is used by generation functions that -// can take a very long time to complete. Use |BN_GENCB_set| to initialise a -// |BN_GENCB| structure. +#define BN_GENCB_GENERATED 0 +#define BN_GENCB_PRIME_TEST 1 + +// bn_gencb_st, or |BN_GENCB|, holds a callback function that is used by +// generation functions that can take a very long time to complete. Use +// |BN_GENCB_set| to initialise a |BN_GENCB| structure. // // The callback receives the address of that |BN_GENCB| structure as its last // argument and the user is free to put an arbitrary pointer in |arg|. The other @@ -648,9 +653,6 @@ OPENSSL_EXPORT int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); // // When other code needs to call a BN generation function it will often take a // BN_GENCB argument and may call the function with other argument values. -#define BN_GENCB_GENERATED 0 -#define BN_GENCB_PRIME_TEST 1 - struct bn_gencb_st { void *arg; // callback-specific data int (*callback)(int event, int n, struct bn_gencb_st *); @@ -659,8 +661,7 @@ struct bn_gencb_st { // BN_GENCB_set configures |callback| to call |f| and sets |callout->arg| to // |arg|. OPENSSL_EXPORT void BN_GENCB_set(BN_GENCB *callback, - int (*f)(int event, int n, - struct bn_gencb_st *), + int (*f)(int event, int n, BN_GENCB *), void *arg); // BN_GENCB_call calls |callback|, if not NULL, and returns the return value of @@ -683,10 +684,22 @@ OPENSSL_EXPORT int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb); -// BN_prime_checks is magic value that can be used as the |checks| argument to -// the primality testing functions in order to automatically select a number of -// Miller-Rabin checks that gives a false positive rate of ~2^{-80}. -#define BN_prime_checks 0 +// BN_prime_checks_for_validation can be used as the |checks| argument to the +// primarily testing functions when validating an externally-supplied candidate +// prime. It gives a false positive rate of at most 2^{-128}. (The worst case +// false positive rate for a single iteration is 1/4, so we perform 32 +// iterations.) +#define BN_prime_checks_for_validation 32 + +// BN_prime_checks_for_generation can be used as the |checks| argument to the +// primality testing functions when generating random primes. It gives a false +// positive rate at most the security level of the corresponding RSA key size. +// +// Note this value only performs enough checks if the candidate prime was +// selected randomly. If validating an externally-supplied candidate, especially +// one that may be selected adversarially, use |BN_prime_checks_for_validation| +// instead. +#define BN_prime_checks_for_generation 0 // bn_primality_result_t enumerates the outcomes of primality-testing. enum bn_primality_result_t { @@ -697,17 +710,18 @@ enum bn_primality_result_t { // BN_enhanced_miller_rabin_primality_test tests whether |w| is probably a prime // number using the Enhanced Miller-Rabin Test (FIPS 186-4 C.3.2) with -// |iterations| iterations and returns the result in |out_result|. Enhanced +// |checks| iterations and returns the result in |out_result|. Enhanced // Miller-Rabin tests primality for odd integers greater than 3, returning // |bn_probably_prime| if the number is probably prime, // |bn_non_prime_power_composite| if the number is a composite that is not the -// power of a single prime, and |bn_composite| otherwise. If |iterations| is -// |BN_prime_checks|, then a value that results in a false positive rate lower -// than the number-field sieve security level of |w| is used. It returns one on +// power of a single prime, and |bn_composite| otherwise. It returns one on // success and zero on failure. If |cb| is not NULL, then it is called during // each iteration of the primality test. +// +// See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. OPENSSL_EXPORT int BN_enhanced_miller_rabin_primality_test( - enum bn_primality_result_t *out_result, const BIGNUM *w, int iterations, + enum bn_primality_result_t *out_result, const BIGNUM *w, int checks, BN_CTX *ctx, BN_GENCB *cb); // BN_primality_test sets |*is_probably_prime| to one if |candidate| is @@ -716,15 +730,14 @@ OPENSSL_EXPORT int BN_enhanced_miller_rabin_primality_test( // // If |do_trial_division| is non-zero then |candidate| will be tested against a // list of small primes before Miller-Rabin tests. The probability of this -// function returning a false positive is 2^{2*checks}. If |checks| is -// |BN_prime_checks| then a value that results in a false positive rate lower -// than the number-field sieve security level of |candidate| is used. If |cb| is -// not NULL then it is called during the checking process. See the comment above -// |BN_GENCB|. +// function returning a false positive is at most 2^{2*checks}. See +// |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. // -// The function returns one on success and zero on error. +// If |cb| is not NULL then it is called during the checking process. See the +// comment above |BN_GENCB|. // -// (If you are unsure whether you want |do_trial_division|, don't set it.) +// The function returns one on success and zero on error. OPENSSL_EXPORT int BN_primality_test(int *is_probably_prime, const BIGNUM *candidate, int checks, BN_CTX *ctx, int do_trial_division, @@ -735,9 +748,10 @@ OPENSSL_EXPORT int BN_primality_test(int *is_probably_prime, // // If |do_trial_division| is non-zero then |candidate| will be tested against a // list of small primes before Miller-Rabin tests. The probability of this -// function returning one when |candidate| is composite is 2^{2*checks}. If -// |checks| is |BN_prime_checks| then a value that results in a false positive -// rate lower than the number-field sieve security level of |candidate| is used. +// function returning one when |candidate| is composite is at most 2^{2*checks}. +// See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. +// // If |cb| is not NULL then it is called during the checking process. See the // comment above |BN_GENCB|. // @@ -805,10 +819,15 @@ int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, // Montgomery domain. // BN_MONT_CTX_new_for_modulus returns a fresh |BN_MONT_CTX| given the modulus, -// |mod| or NULL on error. +// |mod| or NULL on error. Note this function assumes |mod| is public. OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, BN_CTX *ctx); +// BN_MONT_CTX_new_consttime behaves like |BN_MONT_CTX_new_for_modulus| but +// treats |mod| as secret. +OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_consttime(const BIGNUM *mod, + BN_CTX *ctx); + // BN_MONT_CTX_free frees memory associated with |mont|. OPENSSL_EXPORT void BN_MONT_CTX_free(BN_MONT_CTX *mont); @@ -819,7 +838,8 @@ OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, // BN_MONT_CTX_set_locked takes |lock| and checks whether |*pmont| is NULL. If // so, it creates a new |BN_MONT_CTX| and sets the modulus for it to |mod|. It -// then stores it as |*pmont|. It returns one on success and zero on error. +// then stores it as |*pmont|. It returns one on success and zero on error. Note +// this function assumes |mod| is public. // // If |*pmont| is already non-NULL then it does nothing and returns one. int BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, @@ -832,8 +852,9 @@ OPENSSL_EXPORT int BN_to_montgomery(BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, BN_CTX *ctx); // BN_from_montgomery sets |ret| equal to |a| * R^-1, i.e. translates values out -// of the Montgomery domain. |a| is assumed to be in the range [0, n), where |n| -// is the Montgomery modulus. It returns one on success or zero on error. +// of the Montgomery domain. |a| is assumed to be in the range [0, n*R), where +// |n| is the Montgomery modulus. Note n < R, so inputs in the range [0, n*n) +// are valid. This function returns one on success or zero on error. OPENSSL_EXPORT int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, BN_CTX *ctx); @@ -862,10 +883,14 @@ OPENSSL_EXPORT int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, OPENSSL_EXPORT int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx); +// BN_mod_exp_mont behaves like |BN_mod_exp| but treats |a| as secret and +// requires 0 <= |a| < |m|. OPENSSL_EXPORT int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont); +// BN_mod_exp_mont_consttime behaves like |BN_mod_exp| but treats |a|, |p|, and +// |m| as secret and requires 0 <= |a| < |m|. OPENSSL_EXPORT int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, @@ -914,6 +939,17 @@ OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new(void); OPENSSL_EXPORT int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx); +// BN_bn2binpad behaves like |BN_bn2bin_padded|, but it returns |len| on success +// and -1 on error. +// +// Use |BN_bn2bin_padded| instead. It is |size_t|-clean. +OPENSSL_EXPORT int BN_bn2binpad(const BIGNUM *in, uint8_t *out, int len); + +// BN_prime_checks is a deprecated alias for |BN_prime_checks_for_validation|. +// Use |BN_prime_checks_for_generation| or |BN_prime_checks_for_validation| +// instead. (This defaults to the |_for_validation| value in order to be +// conservative.) + // Private functions @@ -945,9 +981,10 @@ struct bignum_st { }; struct bn_mont_ctx_st { - // RR is R^2, reduced modulo |N|. It is used to convert to Montgomery form. + // RR is R^2, reduced modulo |N|. It is used to convert to Montgomery form. It + // is guaranteed to have the same width as |N|. BIGNUM RR; - // N is the modulus. It is always stored in minimal form, so |N.top| + // N is the modulus. It is always stored in minimal form, so |N.width| // determines R. BIGNUM N; BN_ULONG n0[2]; // least significant words of (R*Ri-1)/N @@ -970,7 +1007,7 @@ OPENSSL_EXPORT unsigned BN_num_bits_word(BN_ULONG l); #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(BIGNUM, BN_free) BORINGSSL_MAKE_DELETER(BN_CTX, BN_CTX_free) @@ -988,7 +1025,7 @@ class BN_CTXScope { BN_CTXScope &operator=(BN_CTXScope &) = delete; }; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.back new file mode 100644 index 000000000..5cd2563bd --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.back @@ -0,0 +1,1056 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the Eric Young open source + * license provided above. + * + * The binary polynomial arithmetic software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_BN_H +#define OPENSSL_HEADER_BN_H + +#include +#include + +#include // for PRIu64 and friends +#include // for FILE* + +#if defined(__cplusplus) +extern "C" { +#endif + + +// BN provides support for working with arbitrary sized integers. For example, +// although the largest integer supported by the compiler might be 64 bits, BN +// will allow you to work with numbers until you run out of memory. + + +// BN_ULONG is the native word size when working with big integers. +// +// Note: on some platforms, inttypes.h does not define print format macros in +// C++ unless |__STDC_FORMAT_MACROS| defined. This is due to text in C99 which +// was never adopted in any C++ standard and explicitly overruled in C++11. As +// this is a public header, bn.h does not define |__STDC_FORMAT_MACROS| itself. +// Projects which use |BN_*_FMT*| with outdated C headers may need to define it +// externally. +#if defined(OPENSSL_64_BIT) +#define BN_ULONG uint64_t +#define BN_BITS2 64 +#define BN_DEC_FMT1 "%" PRIu64 +#define BN_DEC_FMT2 "%019" PRIu64 +#define BN_HEX_FMT1 "%" PRIx64 +#define BN_HEX_FMT2 "%016" PRIx64 +#elif defined(OPENSSL_32_BIT) +#define BN_ULONG uint32_t +#define BN_BITS2 32 +#define BN_DEC_FMT1 "%" PRIu32 +#define BN_DEC_FMT2 "%09" PRIu32 +#define BN_HEX_FMT1 "%" PRIx32 +#define BN_HEX_FMT2 "%08" PRIx32 +#else +#error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" +#endif + + +// Allocation and freeing. + +// BN_new creates a new, allocated BIGNUM and initialises it. +OPENSSL_EXPORT BIGNUM *BN_new(void); + +// BN_init initialises a stack allocated |BIGNUM|. +OPENSSL_EXPORT void BN_init(BIGNUM *bn); + +// BN_free frees the data referenced by |bn| and, if |bn| was originally +// allocated on the heap, frees |bn| also. +OPENSSL_EXPORT void BN_free(BIGNUM *bn); + +// BN_clear_free erases and frees the data referenced by |bn| and, if |bn| was +// originally allocated on the heap, frees |bn| also. +OPENSSL_EXPORT void BN_clear_free(BIGNUM *bn); + +// BN_dup allocates a new BIGNUM and sets it equal to |src|. It returns the +// allocated BIGNUM on success or NULL otherwise. +OPENSSL_EXPORT BIGNUM *BN_dup(const BIGNUM *src); + +// BN_copy sets |dest| equal to |src| and returns |dest| or NULL on allocation +// failure. +OPENSSL_EXPORT BIGNUM *BN_copy(BIGNUM *dest, const BIGNUM *src); + +// BN_clear sets |bn| to zero and erases the old data. +OPENSSL_EXPORT void BN_clear(BIGNUM *bn); + +// BN_value_one returns a static BIGNUM with value 1. +OPENSSL_EXPORT const BIGNUM *BN_value_one(void); + + +// Basic functions. + +// BN_num_bits returns the minimum number of bits needed to represent the +// absolute value of |bn|. +OPENSSL_EXPORT unsigned BN_num_bits(const BIGNUM *bn); + +// BN_num_bytes returns the minimum number of bytes needed to represent the +// absolute value of |bn|. +OPENSSL_EXPORT unsigned BN_num_bytes(const BIGNUM *bn); + +// BN_zero sets |bn| to zero. +OPENSSL_EXPORT void BN_zero(BIGNUM *bn); + +// BN_one sets |bn| to one. It returns one on success or zero on allocation +// failure. +OPENSSL_EXPORT int BN_one(BIGNUM *bn); + +// BN_set_word sets |bn| to |value|. It returns one on success or zero on +// allocation failure. +OPENSSL_EXPORT int BN_set_word(BIGNUM *bn, BN_ULONG value); + +// BN_set_u64 sets |bn| to |value|. It returns one on success or zero on +// allocation failure. +OPENSSL_EXPORT int BN_set_u64(BIGNUM *bn, uint64_t value); + +// BN_set_negative sets the sign of |bn|. +OPENSSL_EXPORT void BN_set_negative(BIGNUM *bn, int sign); + +// BN_is_negative returns one if |bn| is negative and zero otherwise. +OPENSSL_EXPORT int BN_is_negative(const BIGNUM *bn); + + +// Conversion functions. + +// BN_bin2bn sets |*ret| to the value of |len| bytes from |in|, interpreted as +// a big-endian number, and returns |ret|. If |ret| is NULL then a fresh +// |BIGNUM| is allocated and returned. It returns NULL on allocation +// failure. +OPENSSL_EXPORT BIGNUM *BN_bin2bn(const uint8_t *in, size_t len, BIGNUM *ret); + +// BN_bn2bin serialises the absolute value of |in| to |out| as a big-endian +// integer, which must have |BN_num_bytes| of space available. It returns the +// number of bytes written. Note this function leaks the magnitude of |in|. If +// |in| is secret, use |BN_bn2bin_padded| instead. +OPENSSL_EXPORT size_t BN_bn2bin(const BIGNUM *in, uint8_t *out); + +// BN_le2bn sets |*ret| to the value of |len| bytes from |in|, interpreted as +// a little-endian number, and returns |ret|. If |ret| is NULL then a fresh +// |BIGNUM| is allocated and returned. It returns NULL on allocation +// failure. +OPENSSL_EXPORT BIGNUM *BN_le2bn(const uint8_t *in, size_t len, BIGNUM *ret); + +// BN_bn2le_padded serialises the absolute value of |in| to |out| as a +// little-endian integer, which must have |len| of space available, padding +// out the remainder of out with zeros. If |len| is smaller than |BN_num_bytes|, +// the function fails and returns 0. Otherwise, it returns 1. +OPENSSL_EXPORT int BN_bn2le_padded(uint8_t *out, size_t len, const BIGNUM *in); + +// BN_bn2bin_padded serialises the absolute value of |in| to |out| as a +// big-endian integer. The integer is padded with leading zeros up to size +// |len|. If |len| is smaller than |BN_num_bytes|, the function fails and +// returns 0. Otherwise, it returns 1. +OPENSSL_EXPORT int BN_bn2bin_padded(uint8_t *out, size_t len, const BIGNUM *in); + +// BN_bn2cbb_padded behaves like |BN_bn2bin_padded| but writes to a |CBB|. +OPENSSL_EXPORT int BN_bn2cbb_padded(CBB *out, size_t len, const BIGNUM *in); + +// BN_bn2hex returns an allocated string that contains a NUL-terminated, hex +// representation of |bn|. If |bn| is negative, the first char in the resulting +// string will be '-'. Returns NULL on allocation failure. +OPENSSL_EXPORT char *BN_bn2hex(const BIGNUM *bn); + +// BN_hex2bn parses the leading hex number from |in|, which may be proceeded by +// a '-' to indicate a negative number and may contain trailing, non-hex data. +// If |outp| is not NULL, it constructs a BIGNUM equal to the hex number and +// stores it in |*outp|. If |*outp| is NULL then it allocates a new BIGNUM and +// updates |*outp|. It returns the number of bytes of |in| processed or zero on +// error. +OPENSSL_EXPORT int BN_hex2bn(BIGNUM **outp, const char *in); + +// BN_bn2dec returns an allocated string that contains a NUL-terminated, +// decimal representation of |bn|. If |bn| is negative, the first char in the +// resulting string will be '-'. Returns NULL on allocation failure. +OPENSSL_EXPORT char *BN_bn2dec(const BIGNUM *a); + +// BN_dec2bn parses the leading decimal number from |in|, which may be +// proceeded by a '-' to indicate a negative number and may contain trailing, +// non-decimal data. If |outp| is not NULL, it constructs a BIGNUM equal to the +// decimal number and stores it in |*outp|. If |*outp| is NULL then it +// allocates a new BIGNUM and updates |*outp|. It returns the number of bytes +// of |in| processed or zero on error. +OPENSSL_EXPORT int BN_dec2bn(BIGNUM **outp, const char *in); + +// BN_asc2bn acts like |BN_dec2bn| or |BN_hex2bn| depending on whether |in| +// begins with "0X" or "0x" (indicating hex) or not (indicating decimal). A +// leading '-' is still permitted and comes before the optional 0X/0x. It +// returns one on success or zero on error. +OPENSSL_EXPORT int BN_asc2bn(BIGNUM **outp, const char *in); + +// BN_print writes a hex encoding of |a| to |bio|. It returns one on success +// and zero on error. +OPENSSL_EXPORT int BN_print(BIO *bio, const BIGNUM *a); + +// BN_print_fp acts like |BIO_print|, but wraps |fp| in a |BIO| first. +OPENSSL_EXPORT int BN_print_fp(FILE *fp, const BIGNUM *a); + +// BN_get_word returns the absolute value of |bn| as a single word. If |bn| is +// too large to be represented as a single word, the maximum possible value +// will be returned. +OPENSSL_EXPORT BN_ULONG BN_get_word(const BIGNUM *bn); + +// BN_get_u64 sets |*out| to the absolute value of |bn| as a |uint64_t| and +// returns one. If |bn| is too large to be represented as a |uint64_t|, it +// returns zero. +OPENSSL_EXPORT int BN_get_u64(const BIGNUM *bn, uint64_t *out); + + +// ASN.1 functions. + +// BN_parse_asn1_unsigned parses a non-negative DER INTEGER from |cbs| writes +// the result to |ret|. It returns one on success and zero on failure. +OPENSSL_EXPORT int BN_parse_asn1_unsigned(CBS *cbs, BIGNUM *ret); + +// BN_marshal_asn1 marshals |bn| as a non-negative DER INTEGER and appends the +// result to |cbb|. It returns one on success and zero on failure. +OPENSSL_EXPORT int BN_marshal_asn1(CBB *cbb, const BIGNUM *bn); + + +// BIGNUM pools. +// +// Certain BIGNUM operations need to use many temporary variables and +// allocating and freeing them can be quite slow. Thus such operations typically +// take a |BN_CTX| parameter, which contains a pool of |BIGNUMs|. The |ctx| +// argument to a public function may be NULL, in which case a local |BN_CTX| +// will be created just for the lifetime of that call. +// +// A function must call |BN_CTX_start| first. Then, |BN_CTX_get| may be called +// repeatedly to obtain temporary |BIGNUM|s. All |BN_CTX_get| calls must be made +// before calling any other functions that use the |ctx| as an argument. +// +// Finally, |BN_CTX_end| must be called before returning from the function. +// When |BN_CTX_end| is called, the |BIGNUM| pointers obtained from +// |BN_CTX_get| become invalid. + +// BN_CTX_new returns a new, empty BN_CTX or NULL on allocation failure. +OPENSSL_EXPORT BN_CTX *BN_CTX_new(void); + +// BN_CTX_free frees all BIGNUMs contained in |ctx| and then frees |ctx| +// itself. +OPENSSL_EXPORT void BN_CTX_free(BN_CTX *ctx); + +// BN_CTX_start "pushes" a new entry onto the |ctx| stack and allows future +// calls to |BN_CTX_get|. +OPENSSL_EXPORT void BN_CTX_start(BN_CTX *ctx); + +// BN_CTX_get returns a new |BIGNUM|, or NULL on allocation failure. Once +// |BN_CTX_get| has returned NULL, all future calls will also return NULL until +// |BN_CTX_end| is called. +OPENSSL_EXPORT BIGNUM *BN_CTX_get(BN_CTX *ctx); + +// BN_CTX_end invalidates all |BIGNUM|s returned from |BN_CTX_get| since the +// matching |BN_CTX_start| call. +OPENSSL_EXPORT void BN_CTX_end(BN_CTX *ctx); + + +// Simple arithmetic + +// BN_add sets |r| = |a| + |b|, where |r| may be the same pointer as either |a| +// or |b|. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// BN_uadd sets |r| = |a| + |b|, where |a| and |b| are non-negative and |r| may +// be the same pointer as either |a| or |b|. It returns one on success and zero +// on allocation failure. +OPENSSL_EXPORT int BN_uadd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// BN_add_word adds |w| to |a|. It returns one on success and zero otherwise. +OPENSSL_EXPORT int BN_add_word(BIGNUM *a, BN_ULONG w); + +// BN_sub sets |r| = |a| - |b|, where |r| may be the same pointer as either |a| +// or |b|. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// BN_usub sets |r| = |a| - |b|, where |a| and |b| are non-negative integers, +// |b| < |a| and |r| may be the same pointer as either |a| or |b|. It returns +// one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_usub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b); + +// BN_sub_word subtracts |w| from |a|. It returns one on success and zero on +// allocation failure. +OPENSSL_EXPORT int BN_sub_word(BIGNUM *a, BN_ULONG w); + +// BN_mul sets |r| = |a| * |b|, where |r| may be the same pointer as |a| or +// |b|. Returns one on success and zero otherwise. +OPENSSL_EXPORT int BN_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx); + +// BN_mul_word sets |bn| = |bn| * |w|. It returns one on success or zero on +// allocation failure. +OPENSSL_EXPORT int BN_mul_word(BIGNUM *bn, BN_ULONG w); + +// BN_sqr sets |r| = |a|^2 (i.e. squares), where |r| may be the same pointer as +// |a|. Returns one on success and zero otherwise. This is more efficient than +// BN_mul(r, a, a, ctx). +OPENSSL_EXPORT int BN_sqr(BIGNUM *r, const BIGNUM *a, BN_CTX *ctx); + +// BN_div divides |numerator| by |divisor| and places the result in |quotient| +// and the remainder in |rem|. Either of |quotient| or |rem| may be NULL, in +// which case the respective value is not returned. The result is rounded +// towards zero; thus if |numerator| is negative, the remainder will be zero or +// negative. It returns one on success or zero on error. +OPENSSL_EXPORT int BN_div(BIGNUM *quotient, BIGNUM *rem, + const BIGNUM *numerator, const BIGNUM *divisor, + BN_CTX *ctx); + +// BN_div_word sets |numerator| = |numerator|/|divisor| and returns the +// remainder or (BN_ULONG)-1 on error. +OPENSSL_EXPORT BN_ULONG BN_div_word(BIGNUM *numerator, BN_ULONG divisor); + +// BN_sqrt sets |*out_sqrt| (which may be the same |BIGNUM| as |in|) to the +// square root of |in|, using |ctx|. It returns one on success or zero on +// error. Negative numbers and non-square numbers will result in an error with +// appropriate errors on the error queue. +OPENSSL_EXPORT int BN_sqrt(BIGNUM *out_sqrt, const BIGNUM *in, BN_CTX *ctx); + + +// Comparison functions + +// BN_cmp returns a value less than, equal to or greater than zero if |a| is +// less than, equal to or greater than |b|, respectively. +OPENSSL_EXPORT int BN_cmp(const BIGNUM *a, const BIGNUM *b); + +// BN_cmp_word is like |BN_cmp| except it takes its second argument as a +// |BN_ULONG| instead of a |BIGNUM|. +OPENSSL_EXPORT int BN_cmp_word(const BIGNUM *a, BN_ULONG b); + +// BN_ucmp returns a value less than, equal to or greater than zero if the +// absolute value of |a| is less than, equal to or greater than the absolute +// value of |b|, respectively. +OPENSSL_EXPORT int BN_ucmp(const BIGNUM *a, const BIGNUM *b); + +// BN_equal_consttime returns one if |a| is equal to |b|, and zero otherwise. +// It takes an amount of time dependent on the sizes of |a| and |b|, but +// independent of the contents (including the signs) of |a| and |b|. +OPENSSL_EXPORT int BN_equal_consttime(const BIGNUM *a, const BIGNUM *b); + +// BN_abs_is_word returns one if the absolute value of |bn| equals |w| and zero +// otherwise. +OPENSSL_EXPORT int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w); + +// BN_is_zero returns one if |bn| is zero and zero otherwise. +OPENSSL_EXPORT int BN_is_zero(const BIGNUM *bn); + +// BN_is_one returns one if |bn| equals one and zero otherwise. +OPENSSL_EXPORT int BN_is_one(const BIGNUM *bn); + +// BN_is_word returns one if |bn| is exactly |w| and zero otherwise. +OPENSSL_EXPORT int BN_is_word(const BIGNUM *bn, BN_ULONG w); + +// BN_is_odd returns one if |bn| is odd and zero otherwise. +OPENSSL_EXPORT int BN_is_odd(const BIGNUM *bn); + +// BN_is_pow2 returns 1 if |a| is a power of two, and 0 otherwise. +OPENSSL_EXPORT int BN_is_pow2(const BIGNUM *a); + + +// Bitwise operations. + +// BN_lshift sets |r| equal to |a| << n. The |a| and |r| arguments may be the +// same |BIGNUM|. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_lshift(BIGNUM *r, const BIGNUM *a, int n); + +// BN_lshift1 sets |r| equal to |a| << 1, where |r| and |a| may be the same +// pointer. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_lshift1(BIGNUM *r, const BIGNUM *a); + +// BN_rshift sets |r| equal to |a| >> n, where |r| and |a| may be the same +// pointer. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_rshift(BIGNUM *r, const BIGNUM *a, int n); + +// BN_rshift1 sets |r| equal to |a| >> 1, where |r| and |a| may be the same +// pointer. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int BN_rshift1(BIGNUM *r, const BIGNUM *a); + +// BN_set_bit sets the |n|th, least-significant bit in |a|. For example, if |a| +// is 2 then setting bit zero will make it 3. It returns one on success or zero +// on allocation failure. +OPENSSL_EXPORT int BN_set_bit(BIGNUM *a, int n); + +// BN_clear_bit clears the |n|th, least-significant bit in |a|. For example, if +// |a| is 3, clearing bit zero will make it two. It returns one on success or +// zero on allocation failure. +OPENSSL_EXPORT int BN_clear_bit(BIGNUM *a, int n); + +// BN_is_bit_set returns one if the |n|th least-significant bit in |a| exists +// and is set. Otherwise, it returns zero. +OPENSSL_EXPORT int BN_is_bit_set(const BIGNUM *a, int n); + +// BN_mask_bits truncates |a| so that it is only |n| bits long. It returns one +// on success or zero if |n| is negative. +// +// This differs from OpenSSL which additionally returns zero if |a|'s word +// length is less than or equal to |n|, rounded down to a number of words. Note +// word size is platform-dependent, so this behavior is also difficult to rely +// on in OpenSSL and not very useful. +OPENSSL_EXPORT int BN_mask_bits(BIGNUM *a, int n); + +// BN_count_low_zero_bits returns the number of low-order zero bits in |bn|, or +// the number of factors of two which divide it. It returns zero if |bn| is +// zero. +OPENSSL_EXPORT int BN_count_low_zero_bits(const BIGNUM *bn); + + +// Modulo arithmetic. + +// BN_mod_word returns |a| mod |w| or (BN_ULONG)-1 on error. +OPENSSL_EXPORT BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w); + +// BN_mod_pow2 sets |r| = |a| mod 2^|e|. It returns 1 on success and +// 0 on error. +OPENSSL_EXPORT int BN_mod_pow2(BIGNUM *r, const BIGNUM *a, size_t e); + +// BN_nnmod_pow2 sets |r| = |a| mod 2^|e| where |r| is always positive. +// It returns 1 on success and 0 on error. +OPENSSL_EXPORT int BN_nnmod_pow2(BIGNUM *r, const BIGNUM *a, size_t e); + +// BN_mod is a helper macro that calls |BN_div| and discards the quotient. +#define BN_mod(rem, numerator, divisor, ctx) \ + BN_div(NULL, (rem), (numerator), (divisor), (ctx)) + +// BN_nnmod is a non-negative modulo function. It acts like |BN_mod|, but 0 <= +// |rem| < |divisor| is always true. It returns one on success and zero on +// error. +OPENSSL_EXPORT int BN_nnmod(BIGNUM *rem, const BIGNUM *numerator, + const BIGNUM *divisor, BN_CTX *ctx); + +// BN_mod_add sets |r| = |a| + |b| mod |m|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// BN_mod_add_quick acts like |BN_mod_add| but requires that |a| and |b| be +// non-negative and less than |m|. +OPENSSL_EXPORT int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); + +// BN_mod_sub sets |r| = |a| - |b| mod |m|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int BN_mod_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// BN_mod_sub_quick acts like |BN_mod_sub| but requires that |a| and |b| be +// non-negative and less than |m|. +OPENSSL_EXPORT int BN_mod_sub_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m); + +// BN_mod_mul sets |r| = |a|*|b| mod |m|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int BN_mod_mul(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + const BIGNUM *m, BN_CTX *ctx); + +// BN_mod_sqr sets |r| = |a|^2 mod |m|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int BN_mod_sqr(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, + BN_CTX *ctx); + +// BN_mod_lshift sets |r| = (|a| << n) mod |m|, where |r| and |a| may be the +// same pointer. It returns one on success and zero on error. +OPENSSL_EXPORT int BN_mod_lshift(BIGNUM *r, const BIGNUM *a, int n, + const BIGNUM *m, BN_CTX *ctx); + +// BN_mod_lshift_quick acts like |BN_mod_lshift| but requires that |a| be +// non-negative and less than |m|. +OPENSSL_EXPORT int BN_mod_lshift_quick(BIGNUM *r, const BIGNUM *a, int n, + const BIGNUM *m); + +// BN_mod_lshift1 sets |r| = (|a| << 1) mod |m|, where |r| and |a| may be the +// same pointer. It returns one on success and zero on error. +OPENSSL_EXPORT int BN_mod_lshift1(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, + BN_CTX *ctx); + +// BN_mod_lshift1_quick acts like |BN_mod_lshift1| but requires that |a| be +// non-negative and less than |m|. +OPENSSL_EXPORT int BN_mod_lshift1_quick(BIGNUM *r, const BIGNUM *a, + const BIGNUM *m); + +// BN_mod_sqrt returns a newly-allocated |BIGNUM|, r, such that +// r^2 == a (mod p). |p| must be a prime. It returns NULL on error or if |a| is +// not a square mod |p|. In the latter case, it will add |BN_R_NOT_A_SQUARE| to +// the error queue. +OPENSSL_EXPORT BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); + + +// Random and prime number generation. + +// The following are values for the |top| parameter of |BN_rand|. +#define BN_RAND_TOP_ANY (-1) +#define BN_RAND_TOP_ONE 0 +#define BN_RAND_TOP_TWO 1 + +// The following are values for the |bottom| parameter of |BN_rand|. +#define BN_RAND_BOTTOM_ANY 0 +#define BN_RAND_BOTTOM_ODD 1 + +// BN_rand sets |rnd| to a random number of length |bits|. It returns one on +// success and zero otherwise. +// +// |top| must be one of the |BN_RAND_TOP_*| values. If |BN_RAND_TOP_ONE|, the +// most-significant bit, if any, will be set. If |BN_RAND_TOP_TWO|, the two +// most significant bits, if any, will be set. If |BN_RAND_TOP_ANY|, no extra +// action will be taken and |BN_num_bits(rnd)| may not equal |bits| if the most +// significant bits randomly ended up as zeros. +// +// |bottom| must be one of the |BN_RAND_BOTTOM_*| values. If +// |BN_RAND_BOTTOM_ODD|, the least-significant bit, if any, will be set. If +// |BN_RAND_BOTTOM_ANY|, no extra action will be taken. +OPENSSL_EXPORT int BN_rand(BIGNUM *rnd, int bits, int top, int bottom); + +// BN_pseudo_rand is an alias for |BN_rand|. +OPENSSL_EXPORT int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom); + +// BN_rand_range is equivalent to |BN_rand_range_ex| with |min_inclusive| set +// to zero and |max_exclusive| set to |range|. +OPENSSL_EXPORT int BN_rand_range(BIGNUM *rnd, const BIGNUM *range); + +// BN_rand_range_ex sets |rnd| to a random value in +// [min_inclusive..max_exclusive). It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int BN_rand_range_ex(BIGNUM *r, BN_ULONG min_inclusive, + const BIGNUM *max_exclusive); + +// BN_pseudo_rand_range is an alias for BN_rand_range. +OPENSSL_EXPORT int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); + +#define BN_GENCB_GENERATED 0 +#define BN_GENCB_PRIME_TEST 1 + +// bn_gencb_st, or |BN_GENCB|, holds a callback function that is used by +// generation functions that can take a very long time to complete. Use +// |BN_GENCB_set| to initialise a |BN_GENCB| structure. +// +// The callback receives the address of that |BN_GENCB| structure as its last +// argument and the user is free to put an arbitrary pointer in |arg|. The other +// arguments are set as follows: +// event=BN_GENCB_GENERATED, n=i: after generating the i'th possible prime +// number. +// event=BN_GENCB_PRIME_TEST, n=-1: when finished trial division primality +// checks. +// event=BN_GENCB_PRIME_TEST, n=i: when the i'th primality test has finished. +// +// The callback can return zero to abort the generation progress or one to +// allow it to continue. +// +// When other code needs to call a BN generation function it will often take a +// BN_GENCB argument and may call the function with other argument values. +struct bn_gencb_st { + void *arg; // callback-specific data + int (*callback)(int event, int n, struct bn_gencb_st *); +}; + +// BN_GENCB_set configures |callback| to call |f| and sets |callout->arg| to +// |arg|. +OPENSSL_EXPORT void BN_GENCB_set(BN_GENCB *callback, + int (*f)(int event, int n, BN_GENCB *), + void *arg); + +// BN_GENCB_call calls |callback|, if not NULL, and returns the return value of +// the callback, or 1 if |callback| is NULL. +OPENSSL_EXPORT int BN_GENCB_call(BN_GENCB *callback, int event, int n); + +// BN_generate_prime_ex sets |ret| to a prime number of |bits| length. If safe +// is non-zero then the prime will be such that (ret-1)/2 is also a prime. +// (This is needed for Diffie-Hellman groups to ensure that the only subgroups +// are of size 2 and (p-1)/2.). +// +// If |add| is not NULL, the prime will fulfill the condition |ret| % |add| == +// |rem| in order to suit a given generator. (If |rem| is NULL then |ret| % +// |add| == 1.) +// +// If |cb| is not NULL, it will be called during processing to give an +// indication of progress. See the comments for |BN_GENCB|. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, + const BIGNUM *add, const BIGNUM *rem, + BN_GENCB *cb); + +// BN_prime_checks_for_validation can be used as the |checks| argument to the +// primarily testing functions when validating an externally-supplied candidate +// prime. It gives a false positive rate of at most 2^{-128}. (The worst case +// false positive rate for a single iteration is 1/4, so we perform 32 +// iterations.) +#define BN_prime_checks_for_validation 32 + +// BN_prime_checks_for_generation can be used as the |checks| argument to the +// primality testing functions when generating random primes. It gives a false +// positive rate at most the security level of the corresponding RSA key size. +// +// Note this value only performs enough checks if the candidate prime was +// selected randomly. If validating an externally-supplied candidate, especially +// one that may be selected adversarially, use |BN_prime_checks_for_validation| +// instead. +#define BN_prime_checks_for_generation 0 + +// bn_primality_result_t enumerates the outcomes of primality-testing. +enum bn_primality_result_t { + bn_probably_prime, + bn_composite, + bn_non_prime_power_composite, +}; + +// BN_enhanced_miller_rabin_primality_test tests whether |w| is probably a prime +// number using the Enhanced Miller-Rabin Test (FIPS 186-4 C.3.2) with +// |checks| iterations and returns the result in |out_result|. Enhanced +// Miller-Rabin tests primality for odd integers greater than 3, returning +// |bn_probably_prime| if the number is probably prime, +// |bn_non_prime_power_composite| if the number is a composite that is not the +// power of a single prime, and |bn_composite| otherwise. It returns one on +// success and zero on failure. If |cb| is not NULL, then it is called during +// each iteration of the primality test. +// +// See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. +OPENSSL_EXPORT int BN_enhanced_miller_rabin_primality_test( + enum bn_primality_result_t *out_result, const BIGNUM *w, int checks, + BN_CTX *ctx, BN_GENCB *cb); + +// BN_primality_test sets |*is_probably_prime| to one if |candidate| is +// probably a prime number by the Miller-Rabin test or zero if it's certainly +// not. +// +// If |do_trial_division| is non-zero then |candidate| will be tested against a +// list of small primes before Miller-Rabin tests. The probability of this +// function returning a false positive is at most 2^{2*checks}. See +// |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. +// +// If |cb| is not NULL then it is called during the checking process. See the +// comment above |BN_GENCB|. +// +// The function returns one on success and zero on error. +OPENSSL_EXPORT int BN_primality_test(int *is_probably_prime, + const BIGNUM *candidate, int checks, + BN_CTX *ctx, int do_trial_division, + BN_GENCB *cb); + +// BN_is_prime_fasttest_ex returns one if |candidate| is probably a prime +// number by the Miller-Rabin test, zero if it's certainly not and -1 on error. +// +// If |do_trial_division| is non-zero then |candidate| will be tested against a +// list of small primes before Miller-Rabin tests. The probability of this +// function returning one when |candidate| is composite is at most 2^{2*checks}. +// See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. +// +// If |cb| is not NULL then it is called during the checking process. See the +// comment above |BN_GENCB|. +// +// WARNING: deprecated. Use |BN_primality_test|. +OPENSSL_EXPORT int BN_is_prime_fasttest_ex(const BIGNUM *candidate, int checks, + BN_CTX *ctx, int do_trial_division, + BN_GENCB *cb); + +// BN_is_prime_ex acts the same as |BN_is_prime_fasttest_ex| with +// |do_trial_division| set to zero. +// +// WARNING: deprecated: Use |BN_primality_test|. +OPENSSL_EXPORT int BN_is_prime_ex(const BIGNUM *candidate, int checks, + BN_CTX *ctx, BN_GENCB *cb); + + +// Number theory functions + +// BN_gcd sets |r| = gcd(|a|, |b|). It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, + BN_CTX *ctx); + +// BN_mod_inverse sets |out| equal to |a|^-1, mod |n|. If |out| is NULL, a +// fresh BIGNUM is allocated. It returns the result or NULL on error. +// +// If |n| is even then the operation is performed using an algorithm that avoids +// some branches but which isn't constant-time. This function shouldn't be used +// for secret values; use |BN_mod_inverse_blinded| instead. Or, if |n| is +// guaranteed to be prime, use +// |BN_mod_exp_mont_consttime(out, a, m_minus_2, m, ctx, m_mont)|, taking +// advantage of Fermat's Little Theorem. +OPENSSL_EXPORT BIGNUM *BN_mod_inverse(BIGNUM *out, const BIGNUM *a, + const BIGNUM *n, BN_CTX *ctx); + +// BN_mod_inverse_blinded sets |out| equal to |a|^-1, mod |n|, where |n| is the +// Montgomery modulus for |mont|. |a| must be non-negative and must be less +// than |n|. |n| must be greater than 1. |a| is blinded (masked by a random +// value) to protect it against side-channel attacks. On failure, if the failure +// was caused by |a| having no inverse mod |n| then |*out_no_inverse| will be +// set to one; otherwise it will be set to zero. +// +// Note this function may incorrectly report |a| has no inverse if the random +// blinding value has no inverse. It should only be used when |n| has few +// non-invertible elements, such as an RSA modulus. +int BN_mod_inverse_blinded(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +// BN_mod_inverse_odd sets |out| equal to |a|^-1, mod |n|. |a| must be +// non-negative and must be less than |n|. |n| must be odd. This function +// shouldn't be used for secret values; use |BN_mod_inverse_blinded| instead. +// Or, if |n| is guaranteed to be prime, use +// |BN_mod_exp_mont_consttime(out, a, m_minus_2, m, ctx, m_mont)|, taking +// advantage of Fermat's Little Theorem. It returns one on success or zero on +// failure. On failure, if the failure was caused by |a| having no inverse mod +// |n| then |*out_no_inverse| will be set to one; otherwise it will be set to +// zero. +int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, + const BIGNUM *n, BN_CTX *ctx); + + +// Montgomery arithmetic. + +// BN_MONT_CTX contains the precomputed values needed to work in a specific +// Montgomery domain. + +// BN_MONT_CTX_new_for_modulus returns a fresh |BN_MONT_CTX| given the modulus, +// |mod| or NULL on error. Note this function assumes |mod| is public. +OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, + BN_CTX *ctx); + +// BN_MONT_CTX_new_consttime behaves like |BN_MONT_CTX_new_for_modulus| but +// treats |mod| as secret. +OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_consttime(const BIGNUM *mod, + BN_CTX *ctx); + +// BN_MONT_CTX_free frees memory associated with |mont|. +OPENSSL_EXPORT void BN_MONT_CTX_free(BN_MONT_CTX *mont); + +// BN_MONT_CTX_copy sets |to| equal to |from|. It returns |to| on success or +// NULL on error. +OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, + const BN_MONT_CTX *from); + +// BN_MONT_CTX_set_locked takes |lock| and checks whether |*pmont| is NULL. If +// so, it creates a new |BN_MONT_CTX| and sets the modulus for it to |mod|. It +// then stores it as |*pmont|. It returns one on success and zero on error. Note +// this function assumes |mod| is public. +// +// If |*pmont| is already non-NULL then it does nothing and returns one. +int BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, + const BIGNUM *mod, BN_CTX *bn_ctx); + +// BN_to_montgomery sets |ret| equal to |a| in the Montgomery domain. |a| is +// assumed to be in the range [0, n), where |n| is the Montgomery modulus. It +// returns one on success or zero on error. +OPENSSL_EXPORT int BN_to_montgomery(BIGNUM *ret, const BIGNUM *a, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +// BN_from_montgomery sets |ret| equal to |a| * R^-1, i.e. translates values out +// of the Montgomery domain. |a| is assumed to be in the range [0, n*R), where +// |n| is the Montgomery modulus. Note n < R, so inputs in the range [0, n*n) +// are valid. This function returns one on success or zero on error. +OPENSSL_EXPORT int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, + const BN_MONT_CTX *mont, BN_CTX *ctx); + +// BN_mod_mul_montgomery set |r| equal to |a| * |b|, in the Montgomery domain. +// Both |a| and |b| must already be in the Montgomery domain (by +// |BN_to_montgomery|). In particular, |a| and |b| are assumed to be in the +// range [0, n), where |n| is the Montgomery modulus. It returns one on success +// or zero on error. +OPENSSL_EXPORT int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, + const BIGNUM *b, + const BN_MONT_CTX *mont, BN_CTX *ctx); + + +// Exponentiation. + +// BN_exp sets |r| equal to |a|^{|p|}. It does so with a square-and-multiply +// algorithm that leaks side-channel information. It returns one on success or +// zero otherwise. +OPENSSL_EXPORT int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + BN_CTX *ctx); + +// BN_mod_exp sets |r| equal to |a|^{|p|} mod |m|. It does so with the best +// algorithm for the values provided. It returns one on success or zero +// otherwise. The |BN_mod_exp_mont_consttime| variant must be used if the +// exponent is secret. +OPENSSL_EXPORT int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx); + +// BN_mod_exp_mont behaves like |BN_mod_exp| but treats |a| as secret and +// requires 0 <= |a| < |m|. +OPENSSL_EXPORT int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + const BN_MONT_CTX *mont); + +// BN_mod_exp_mont_consttime behaves like |BN_mod_exp| but treats |a|, |p|, and +// |m| as secret and requires 0 <= |a| < |m|. +OPENSSL_EXPORT int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, + const BIGNUM *p, const BIGNUM *m, + BN_CTX *ctx, + const BN_MONT_CTX *mont); + + +// Deprecated functions + +// BN_bn2mpi serialises the value of |in| to |out|, using a format that consists +// of the number's length in bytes represented as a 4-byte big-endian number, +// and the number itself in big-endian format, where the most significant bit +// signals a negative number. (The representation of numbers with the MSB set is +// prefixed with null byte). |out| must have sufficient space available; to +// find the needed amount of space, call the function with |out| set to NULL. +OPENSSL_EXPORT size_t BN_bn2mpi(const BIGNUM *in, uint8_t *out); + +// BN_mpi2bn parses |len| bytes from |in| and returns the resulting value. The +// bytes at |in| are expected to be in the format emitted by |BN_bn2mpi|. +// +// If |out| is NULL then a fresh |BIGNUM| is allocated and returned, otherwise +// |out| is reused and returned. On error, NULL is returned and the error queue +// is updated. +OPENSSL_EXPORT BIGNUM *BN_mpi2bn(const uint8_t *in, size_t len, BIGNUM *out); + +// BN_mod_exp_mont_word is like |BN_mod_exp_mont| except that the base |a| is +// given as a |BN_ULONG| instead of a |BIGNUM *|. It returns one on success +// or zero otherwise. +OPENSSL_EXPORT int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p, + const BIGNUM *m, BN_CTX *ctx, + const BN_MONT_CTX *mont); + +// BN_mod_exp2_mont calculates (a1^p1) * (a2^p2) mod m. It returns 1 on success +// or zero otherwise. +OPENSSL_EXPORT int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, + const BIGNUM *p1, const BIGNUM *a2, + const BIGNUM *p2, const BIGNUM *m, + BN_CTX *ctx, const BN_MONT_CTX *mont); + +// BN_MONT_CTX_new returns a fresh |BN_MONT_CTX| or NULL on allocation failure. +// Use |BN_MONT_CTX_new_for_modulus| instead. +OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new(void); + +// BN_MONT_CTX_set sets up a Montgomery context given the modulus, |mod|. It +// returns one on success and zero on error. Use |BN_MONT_CTX_new_for_modulus| +// instead. +OPENSSL_EXPORT int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, + BN_CTX *ctx); + +// BN_bn2binpad behaves like |BN_bn2bin_padded|, but it returns |len| on success +// and -1 on error. +// +// Use |BN_bn2bin_padded| instead. It is |size_t|-clean. +OPENSSL_EXPORT int BN_bn2binpad(const BIGNUM *in, uint8_t *out, int len); + +// BN_prime_checks is a deprecated alias for |BN_prime_checks_for_validation|. +// Use |BN_prime_checks_for_generation| or |BN_prime_checks_for_validation| +// instead. (This defaults to the |_for_validation| value in order to be +// conservative.) + + +// Private functions + +struct bignum_st { + // d is a pointer to an array of |width| |BN_BITS2|-bit chunks in + // little-endian order. This stores the absolute value of the number. + BN_ULONG *d; + // width is the number of elements of |d| which are valid. This value is not + // necessarily minimal; the most-significant words of |d| may be zero. + // |width| determines a potentially loose upper-bound on the absolute value + // of the |BIGNUM|. + // + // Functions taking |BIGNUM| inputs must compute the same answer for all + // possible widths. |bn_minimal_width|, |bn_set_minimal_width|, and other + // helpers may be used to recover the minimal width, provided it is not + // secret. If it is secret, use a different algorithm. Functions may output + // minimal or non-minimal |BIGNUM|s depending on secrecy requirements, but + // those which cause widths to unboundedly grow beyond the minimal value + // should be documented such. + // + // Note this is different from historical |BIGNUM| semantics. + int width; + // dmax is number of elements of |d| which are allocated. + int dmax; + // neg is one if the number if negative and zero otherwise. + int neg; + // flags is a bitmask of |BN_FLG_*| values + int flags; +}; + +struct bn_mont_ctx_st { + // RR is R^2, reduced modulo |N|. It is used to convert to Montgomery form. It + // is guaranteed to have the same width as |N|. + BIGNUM RR; + // N is the modulus. It is always stored in minimal form, so |N.width| + // determines R. + BIGNUM N; + BN_ULONG n0[2]; // least significant words of (R*Ri-1)/N +}; + +OPENSSL_EXPORT unsigned BN_num_bits_word(BN_ULONG l); + +#define BN_FLG_MALLOCED 0x01 +#define BN_FLG_STATIC_DATA 0x02 +// |BN_FLG_CONSTTIME| has been removed and intentionally omitted so code relying +// on it will not compile. Consumers outside BoringSSL should use the +// higher-level cryptographic algorithms exposed by other modules. Consumers +// within the library should call the appropriate timing-sensitive algorithm +// directly. + + +#if defined(__cplusplus) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(BIGNUM, BN_free) +BORINGSSL_MAKE_DELETER(BN_CTX, BN_CTX_free) +BORINGSSL_MAKE_DELETER(BN_MONT_CTX, BN_MONT_CTX_free) + +class BN_CTXScope { + public: + BN_CTXScope(BN_CTX *ctx) : ctx_(ctx) { BN_CTX_start(ctx_); } + ~BN_CTXScope() { BN_CTX_end(ctx_); } + + private: + BN_CTX *ctx_; + + BN_CTXScope(BN_CTXScope &) = delete; + BN_CTXScope &operator=(BN_CTXScope &) = delete; +}; + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif + +#define BN_R_ARG2_LT_ARG3 100 +#define BN_R_BAD_RECIPROCAL 101 +#define BN_R_BIGNUM_TOO_LONG 102 +#define BN_R_BITS_TOO_SMALL 103 +#define BN_R_CALLED_WITH_EVEN_MODULUS 104 +#define BN_R_DIV_BY_ZERO 105 +#define BN_R_EXPAND_ON_STATIC_BIGNUM_DATA 106 +#define BN_R_INPUT_NOT_REDUCED 107 +#define BN_R_INVALID_RANGE 108 +#define BN_R_NEGATIVE_NUMBER 109 +#define BN_R_NOT_A_SQUARE 110 +#define BN_R_NOT_INITIALIZED 111 +#define BN_R_NO_INVERSE 112 +#define BN_R_PRIVATE_KEY_TOO_LARGE 113 +#define BN_R_P_IS_NOT_PRIME 114 +#define BN_R_TOO_MANY_ITERATIONS 115 +#define BN_R_TOO_MANY_TEMPORARY_VARIABLES 116 +#define BN_R_BAD_ENCODING 117 +#define BN_R_ENCODE_ERROR 118 +#define BN_R_INVALID_INPUT 119 + +#endif // OPENSSL_HEADER_BN_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/bn.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/bn.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/bn.h.grpc_back index eeb25a3aa..5cd2563bd 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/bn.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bn.h.grpc_back @@ -142,9 +142,11 @@ extern "C" { // BN_ULONG is the native word size when working with big integers. // // Note: on some platforms, inttypes.h does not define print format macros in -// C++ unless |__STDC_FORMAT_MACROS| defined. As this is a public header, bn.h -// does not define |__STDC_FORMAT_MACROS| itself. C++ source files which use the -// FMT macros must define it externally. +// C++ unless |__STDC_FORMAT_MACROS| defined. This is due to text in C99 which +// was never adopted in any C++ standard and explicitly overruled in C++11. As +// this is a public header, bn.h does not define |__STDC_FORMAT_MACROS| itself. +// Projects which use |BN_*_FMT*| with outdated C headers may need to define it +// externally. #if defined(OPENSSL_64_BIT) #define BN_ULONG uint64_t #define BN_BITS2 64 @@ -158,7 +160,7 @@ extern "C" { #define BN_DEC_FMT1 "%" PRIu32 #define BN_DEC_FMT2 "%09" PRIu32 #define BN_HEX_FMT1 "%" PRIx32 -#define BN_HEX_FMT2 "%08" PRIx64 +#define BN_HEX_FMT2 "%08" PRIx32 #else #error "Must define either OPENSSL_32_BIT or OPENSSL_64_BIT" #endif @@ -630,9 +632,12 @@ OPENSSL_EXPORT int BN_rand_range_ex(BIGNUM *r, BN_ULONG min_inclusive, // BN_pseudo_rand_range is an alias for BN_rand_range. OPENSSL_EXPORT int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); -// BN_GENCB holds a callback function that is used by generation functions that -// can take a very long time to complete. Use |BN_GENCB_set| to initialise a -// |BN_GENCB| structure. +#define BN_GENCB_GENERATED 0 +#define BN_GENCB_PRIME_TEST 1 + +// bn_gencb_st, or |BN_GENCB|, holds a callback function that is used by +// generation functions that can take a very long time to complete. Use +// |BN_GENCB_set| to initialise a |BN_GENCB| structure. // // The callback receives the address of that |BN_GENCB| structure as its last // argument and the user is free to put an arbitrary pointer in |arg|. The other @@ -648,9 +653,6 @@ OPENSSL_EXPORT int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range); // // When other code needs to call a BN generation function it will often take a // BN_GENCB argument and may call the function with other argument values. -#define BN_GENCB_GENERATED 0 -#define BN_GENCB_PRIME_TEST 1 - struct bn_gencb_st { void *arg; // callback-specific data int (*callback)(int event, int n, struct bn_gencb_st *); @@ -659,8 +661,7 @@ struct bn_gencb_st { // BN_GENCB_set configures |callback| to call |f| and sets |callout->arg| to // |arg|. OPENSSL_EXPORT void BN_GENCB_set(BN_GENCB *callback, - int (*f)(int event, int n, - struct bn_gencb_st *), + int (*f)(int event, int n, BN_GENCB *), void *arg); // BN_GENCB_call calls |callback|, if not NULL, and returns the return value of @@ -683,10 +684,22 @@ OPENSSL_EXPORT int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb); -// BN_prime_checks is magic value that can be used as the |checks| argument to -// the primality testing functions in order to automatically select a number of -// Miller-Rabin checks that gives a false positive rate of ~2^{-80}. -#define BN_prime_checks 0 +// BN_prime_checks_for_validation can be used as the |checks| argument to the +// primarily testing functions when validating an externally-supplied candidate +// prime. It gives a false positive rate of at most 2^{-128}. (The worst case +// false positive rate for a single iteration is 1/4, so we perform 32 +// iterations.) +#define BN_prime_checks_for_validation 32 + +// BN_prime_checks_for_generation can be used as the |checks| argument to the +// primality testing functions when generating random primes. It gives a false +// positive rate at most the security level of the corresponding RSA key size. +// +// Note this value only performs enough checks if the candidate prime was +// selected randomly. If validating an externally-supplied candidate, especially +// one that may be selected adversarially, use |BN_prime_checks_for_validation| +// instead. +#define BN_prime_checks_for_generation 0 // bn_primality_result_t enumerates the outcomes of primality-testing. enum bn_primality_result_t { @@ -697,17 +710,18 @@ enum bn_primality_result_t { // BN_enhanced_miller_rabin_primality_test tests whether |w| is probably a prime // number using the Enhanced Miller-Rabin Test (FIPS 186-4 C.3.2) with -// |iterations| iterations and returns the result in |out_result|. Enhanced +// |checks| iterations and returns the result in |out_result|. Enhanced // Miller-Rabin tests primality for odd integers greater than 3, returning // |bn_probably_prime| if the number is probably prime, // |bn_non_prime_power_composite| if the number is a composite that is not the -// power of a single prime, and |bn_composite| otherwise. If |iterations| is -// |BN_prime_checks|, then a value that results in a false positive rate lower -// than the number-field sieve security level of |w| is used. It returns one on +// power of a single prime, and |bn_composite| otherwise. It returns one on // success and zero on failure. If |cb| is not NULL, then it is called during // each iteration of the primality test. +// +// See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. OPENSSL_EXPORT int BN_enhanced_miller_rabin_primality_test( - enum bn_primality_result_t *out_result, const BIGNUM *w, int iterations, + enum bn_primality_result_t *out_result, const BIGNUM *w, int checks, BN_CTX *ctx, BN_GENCB *cb); // BN_primality_test sets |*is_probably_prime| to one if |candidate| is @@ -716,15 +730,14 @@ OPENSSL_EXPORT int BN_enhanced_miller_rabin_primality_test( // // If |do_trial_division| is non-zero then |candidate| will be tested against a // list of small primes before Miller-Rabin tests. The probability of this -// function returning a false positive is 2^{2*checks}. If |checks| is -// |BN_prime_checks| then a value that results in a false positive rate lower -// than the number-field sieve security level of |candidate| is used. If |cb| is -// not NULL then it is called during the checking process. See the comment above -// |BN_GENCB|. +// function returning a false positive is at most 2^{2*checks}. See +// |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. // -// The function returns one on success and zero on error. +// If |cb| is not NULL then it is called during the checking process. See the +// comment above |BN_GENCB|. // -// (If you are unsure whether you want |do_trial_division|, don't set it.) +// The function returns one on success and zero on error. OPENSSL_EXPORT int BN_primality_test(int *is_probably_prime, const BIGNUM *candidate, int checks, BN_CTX *ctx, int do_trial_division, @@ -735,9 +748,10 @@ OPENSSL_EXPORT int BN_primality_test(int *is_probably_prime, // // If |do_trial_division| is non-zero then |candidate| will be tested against a // list of small primes before Miller-Rabin tests. The probability of this -// function returning one when |candidate| is composite is 2^{2*checks}. If -// |checks| is |BN_prime_checks| then a value that results in a false positive -// rate lower than the number-field sieve security level of |candidate| is used. +// function returning one when |candidate| is composite is at most 2^{2*checks}. +// See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for +// recommended values of |checks|. +// // If |cb| is not NULL then it is called during the checking process. See the // comment above |BN_GENCB|. // @@ -805,10 +819,15 @@ int BN_mod_inverse_odd(BIGNUM *out, int *out_no_inverse, const BIGNUM *a, // Montgomery domain. // BN_MONT_CTX_new_for_modulus returns a fresh |BN_MONT_CTX| given the modulus, -// |mod| or NULL on error. +// |mod| or NULL on error. Note this function assumes |mod| is public. OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_for_modulus(const BIGNUM *mod, BN_CTX *ctx); +// BN_MONT_CTX_new_consttime behaves like |BN_MONT_CTX_new_for_modulus| but +// treats |mod| as secret. +OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new_consttime(const BIGNUM *mod, + BN_CTX *ctx); + // BN_MONT_CTX_free frees memory associated with |mont|. OPENSSL_EXPORT void BN_MONT_CTX_free(BN_MONT_CTX *mont); @@ -819,7 +838,8 @@ OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, // BN_MONT_CTX_set_locked takes |lock| and checks whether |*pmont| is NULL. If // so, it creates a new |BN_MONT_CTX| and sets the modulus for it to |mod|. It -// then stores it as |*pmont|. It returns one on success and zero on error. +// then stores it as |*pmont|. It returns one on success and zero on error. Note +// this function assumes |mod| is public. // // If |*pmont| is already non-NULL then it does nothing and returns one. int BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock, @@ -832,8 +852,9 @@ OPENSSL_EXPORT int BN_to_montgomery(BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, BN_CTX *ctx); // BN_from_montgomery sets |ret| equal to |a| * R^-1, i.e. translates values out -// of the Montgomery domain. |a| is assumed to be in the range [0, n), where |n| -// is the Montgomery modulus. It returns one on success or zero on error. +// of the Montgomery domain. |a| is assumed to be in the range [0, n*R), where +// |n| is the Montgomery modulus. Note n < R, so inputs in the range [0, n*n) +// are valid. This function returns one on success or zero on error. OPENSSL_EXPORT int BN_from_montgomery(BIGNUM *ret, const BIGNUM *a, const BN_MONT_CTX *mont, BN_CTX *ctx); @@ -862,10 +883,14 @@ OPENSSL_EXPORT int BN_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, OPENSSL_EXPORT int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx); +// BN_mod_exp_mont behaves like |BN_mod_exp| but treats |a| as secret and +// requires 0 <= |a| < |m|. OPENSSL_EXPORT int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, const BN_MONT_CTX *mont); +// BN_mod_exp_mont_consttime behaves like |BN_mod_exp| but treats |a|, |p|, and +// |m| as secret and requires 0 <= |a| < |m|. OPENSSL_EXPORT int BN_mod_exp_mont_consttime(BIGNUM *rr, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, @@ -914,6 +939,17 @@ OPENSSL_EXPORT BN_MONT_CTX *BN_MONT_CTX_new(void); OPENSSL_EXPORT int BN_MONT_CTX_set(BN_MONT_CTX *mont, const BIGNUM *mod, BN_CTX *ctx); +// BN_bn2binpad behaves like |BN_bn2bin_padded|, but it returns |len| on success +// and -1 on error. +// +// Use |BN_bn2bin_padded| instead. It is |size_t|-clean. +OPENSSL_EXPORT int BN_bn2binpad(const BIGNUM *in, uint8_t *out, int len); + +// BN_prime_checks is a deprecated alias for |BN_prime_checks_for_validation|. +// Use |BN_prime_checks_for_generation| or |BN_prime_checks_for_validation| +// instead. (This defaults to the |_for_validation| value in order to be +// conservative.) + // Private functions @@ -945,9 +981,10 @@ struct bignum_st { }; struct bn_mont_ctx_st { - // RR is R^2, reduced modulo |N|. It is used to convert to Montgomery form. + // RR is R^2, reduced modulo |N|. It is used to convert to Montgomery form. It + // is guaranteed to have the same width as |N|. BIGNUM RR; - // N is the modulus. It is always stored in minimal form, so |N.top| + // N is the modulus. It is always stored in minimal form, so |N.width| // determines R. BIGNUM N; BN_ULONG n0[2]; // least significant words of (R*Ri-1)/N @@ -970,7 +1007,7 @@ OPENSSL_EXPORT unsigned BN_num_bits_word(BN_ULONG l); #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(BIGNUM, BN_free) BORINGSSL_MAKE_DELETER(BN_CTX, BN_CTX_free) @@ -988,7 +1025,7 @@ class BN_CTXScope { BN_CTXScope &operator=(BN_CTXScope &) = delete; }; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/buf.h b/Pods/BoringSSL-GRPC/src/include/openssl/buf.h similarity index 90% rename from Pods/BoringSSL-GRPC/include/openssl/buf.h rename to Pods/BoringSSL-GRPC/src/include/openssl/buf.h index b4a8bd58d..0ef0db54f 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/buf.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/buf.h @@ -97,25 +97,25 @@ OPENSSL_EXPORT size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len); // error. OPENSSL_EXPORT int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len); -// BUF_strdup returns an allocated, duplicate of |str|. + +// Deprecated functions. + +// BUF_strdup calls |OPENSSL_strdup|. OPENSSL_EXPORT char *BUF_strdup(const char *str); -// BUF_strnlen returns the number of characters in |str|, excluding the NUL -// byte, but at most |max_len|. This function never reads more than |max_len| -// bytes from |str|. +// BUF_strnlen calls |OPENSSL_strnlen|. OPENSSL_EXPORT size_t BUF_strnlen(const char *str, size_t max_len); -// BUF_strndup returns an allocated, duplicate of |str|, which is, at most, -// |size| bytes. The result is always NUL terminated. +// BUF_strndup calls |OPENSSL_strndup|. OPENSSL_EXPORT char *BUF_strndup(const char *str, size_t size); -// BUF_memdup returns an allocated, duplicate of |size| bytes from |data|. +// BUF_memdup calls |OPENSSL_memdup|. OPENSSL_EXPORT void *BUF_memdup(const void *data, size_t size); -// BUF_strlcpy acts like strlcpy(3). +// BUF_strlcpy calls |OPENSSL_strlcpy|. OPENSSL_EXPORT size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size); -// BUF_strlcat acts like strlcat(3). +// BUF_strlcat calls |OPENSSL_strlcat|. OPENSSL_EXPORT size_t BUF_strlcat(char *dst, const char *src, size_t dst_size); @@ -124,11 +124,11 @@ OPENSSL_EXPORT size_t BUF_strlcat(char *dst, const char *src, size_t dst_size); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(BUF_MEM, BUF_MEM_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.back new file mode 100644 index 000000000..a57f000a1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.back @@ -0,0 +1,137 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_BUFFER_H +#define OPENSSL_HEADER_BUFFER_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Memory and string functions, see also mem.h. + + +// buf_mem_st (aka |BUF_MEM|) is a generic buffer object used by OpenSSL. +struct buf_mem_st { + size_t length; // current number of bytes + char *data; + size_t max; // size of buffer +}; + +// BUF_MEM_new creates a new BUF_MEM which has no allocated data buffer. +OPENSSL_EXPORT BUF_MEM *BUF_MEM_new(void); + +// BUF_MEM_free frees |buf->data| if needed and then frees |buf| itself. +OPENSSL_EXPORT void BUF_MEM_free(BUF_MEM *buf); + +// BUF_MEM_reserve ensures |buf| has capacity |cap| and allocates memory if +// needed. It returns one on success and zero on error. +OPENSSL_EXPORT int BUF_MEM_reserve(BUF_MEM *buf, size_t cap); + +// BUF_MEM_grow ensures that |buf| has length |len| and allocates memory if +// needed. If the length of |buf| increased, the new bytes are filled with +// zeros. It returns the length of |buf|, or zero if there's an error. +OPENSSL_EXPORT size_t BUF_MEM_grow(BUF_MEM *buf, size_t len); + +// BUF_MEM_grow_clean calls |BUF_MEM_grow|. BoringSSL always zeros memory +// allocated memory on free. +OPENSSL_EXPORT size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len); + +// BUF_MEM_append appends |in| to |buf|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len); + + +// Deprecated functions. + +// BUF_strdup calls |OPENSSL_strdup|. +OPENSSL_EXPORT char *BUF_strdup(const char *str); + +// BUF_strnlen calls |OPENSSL_strnlen|. +OPENSSL_EXPORT size_t BUF_strnlen(const char *str, size_t max_len); + +// BUF_strndup calls |OPENSSL_strndup|. +OPENSSL_EXPORT char *BUF_strndup(const char *str, size_t size); + +// BUF_memdup calls |OPENSSL_memdup|. +OPENSSL_EXPORT void *BUF_memdup(const void *data, size_t size); + +// BUF_strlcpy calls |OPENSSL_strlcpy|. +OPENSSL_EXPORT size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size); + +// BUF_strlcat calls |OPENSSL_strlcat|. +OPENSSL_EXPORT size_t BUF_strlcat(char *dst, const char *src, size_t dst_size); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(BUF_MEM, BUF_MEM_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#endif // OPENSSL_HEADER_BUFFER_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/buf.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.grpc_back similarity index 90% rename from Pods/BoringSSL-GRPC/include/openssl/buf.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/buf.h.grpc_back index 3f961b87e..a57f000a1 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/buf.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/buf.h.grpc_back @@ -97,25 +97,25 @@ OPENSSL_EXPORT size_t BUF_MEM_grow_clean(BUF_MEM *buf, size_t len); // error. OPENSSL_EXPORT int BUF_MEM_append(BUF_MEM *buf, const void *in, size_t len); -// BUF_strdup returns an allocated, duplicate of |str|. + +// Deprecated functions. + +// BUF_strdup calls |OPENSSL_strdup|. OPENSSL_EXPORT char *BUF_strdup(const char *str); -// BUF_strnlen returns the number of characters in |str|, excluding the NUL -// byte, but at most |max_len|. This function never reads more than |max_len| -// bytes from |str|. +// BUF_strnlen calls |OPENSSL_strnlen|. OPENSSL_EXPORT size_t BUF_strnlen(const char *str, size_t max_len); -// BUF_strndup returns an allocated, duplicate of |str|, which is, at most, -// |size| bytes. The result is always NUL terminated. +// BUF_strndup calls |OPENSSL_strndup|. OPENSSL_EXPORT char *BUF_strndup(const char *str, size_t size); -// BUF_memdup returns an allocated, duplicate of |size| bytes from |data|. +// BUF_memdup calls |OPENSSL_memdup|. OPENSSL_EXPORT void *BUF_memdup(const void *data, size_t size); -// BUF_strlcpy acts like strlcpy(3). +// BUF_strlcpy calls |OPENSSL_strlcpy|. OPENSSL_EXPORT size_t BUF_strlcpy(char *dst, const char *src, size_t dst_size); -// BUF_strlcat acts like strlcat(3). +// BUF_strlcat calls |OPENSSL_strlcat|. OPENSSL_EXPORT size_t BUF_strlcat(char *dst, const char *src, size_t dst_size); @@ -124,11 +124,11 @@ OPENSSL_EXPORT size_t BUF_strlcat(char *dst, const char *src, size_t dst_size); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(BUF_MEM, BUF_MEM_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/buffer.h b/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/buffer.h rename to Pods/BoringSSL-GRPC/src/include/openssl/buffer.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/buffer.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/buffer.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.grpc_back new file mode 100644 index 000000000..c6b721c27 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/buffer.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "buf.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/bytestring.h b/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h similarity index 86% rename from Pods/BoringSSL-GRPC/include/openssl/bytestring.h rename to Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h index 1e616b3b5..5f04dfc45 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/bytestring.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h @@ -102,6 +102,10 @@ OPENSSL_EXPORT int CBS_get_u8(CBS *cbs, uint8_t *out); // advances |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_u16(CBS *cbs, uint16_t *out); +// CBS_get_u16le sets |*out| to the next, little-endian uint16_t from |cbs| and +// advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u16le(CBS *cbs, uint16_t *out); + // CBS_get_u24 sets |*out| to the next, big-endian 24-bit value from |cbs| and // advances |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_u24(CBS *cbs, uint32_t *out); @@ -110,6 +114,18 @@ OPENSSL_EXPORT int CBS_get_u24(CBS *cbs, uint32_t *out); // and advances |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_u32(CBS *cbs, uint32_t *out); +// CBS_get_u32le sets |*out| to the next, little-endian uint32_t value from +// |cbs| and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u32le(CBS *cbs, uint32_t *out); + +// CBS_get_u64 sets |*out| to the next, big-endian uint64_t value from |cbs| +// and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u64(CBS *cbs, uint64_t *out); + +// CBS_get_u64le sets |*out| to the next, little-endian uint64_t value from +// |cbs| and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u64le(CBS *cbs, uint64_t *out); + // CBS_get_last_u8 sets |*out| to the last uint8_t from |cbs| and shortens // |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_last_u8(CBS *cbs, uint8_t *out); @@ -139,8 +155,48 @@ OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out); // Parsing ASN.1 +// +// |CBS| may be used to parse DER structures. Rather than using a schema +// compiler, the following functions act on tag-length-value elements in the +// serialization itself. Thus the caller is responsible for looping over a +// SEQUENCE, branching on CHOICEs or OPTIONAL fields, checking for trailing +// data, and handling explict vs. implicit tagging. +// +// Tags are represented as |unsigned| values in memory. The upper few bits store +// the class and constructed bit, and the remaining bits store the tag +// number. Note this differs from the DER serialization, to support tag numbers +// beyond 31. Consumers must use the constants defined below to decompose or +// assemble tags. +// +// This library treats an element's constructed bit as part of its tag. In DER, +// the constructed bit is computable from the type. The constants for universal +// types have the bit set. Callers must set it correctly for tagged types. +// Explicitly-tagged types are always constructed, and implicitly-tagged types +// inherit the underlying type's bit. + +// CBS_ASN1_TAG_SHIFT is how much the in-memory representation shifts the class +// and constructed bits from the DER serialization. +#define CBS_ASN1_TAG_SHIFT 24 -// The following values are tag numbers for UNIVERSAL elements. +// CBS_ASN1_CONSTRUCTED may be ORed into a tag to set the constructed bit. +#define CBS_ASN1_CONSTRUCTED (0x20u << CBS_ASN1_TAG_SHIFT) + +// The following values specify the tag class and may be ORed into a tag number +// to produce the final tag. If none is used, the tag will be UNIVERSAL. +#define CBS_ASN1_UNIVERSAL (0u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_APPLICATION (0x40u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_CONTEXT_SPECIFIC (0x80u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_PRIVATE (0xc0u << CBS_ASN1_TAG_SHIFT) + +// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class. This will +// give one of the four values above. +#define CBS_ASN1_CLASS_MASK (0xc0u << CBS_ASN1_TAG_SHIFT) + +// CBS_ASN1_TAG_NUMBER_MASK may be ANDed with a tag to query its number. +#define CBS_ASN1_TAG_NUMBER_MASK ((1u << (5 + CBS_ASN1_TAG_SHIFT)) - 1) + +// The following values are constants for UNIVERSAL tags. Note these constants +// include the constructed bit. #define CBS_ASN1_BOOLEAN 0x1u #define CBS_ASN1_INTEGER 0x2u #define CBS_ASN1_BITSTRING 0x3u @@ -164,32 +220,6 @@ OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out); #define CBS_ASN1_UNIVERSALSTRING 0x1cu #define CBS_ASN1_BMPSTRING 0x1eu -// CBS_ASN1_TAG_SHIFT is how much the in-memory representation shifts the class -// and constructed bits from the DER serialization. This allows representing tag -// numbers beyond 31. -// -// Consumers must use the following constants to decompose or assemble tags. -#define CBS_ASN1_TAG_SHIFT 24 - -// CBS_ASN1_CONSTRUCTED may be ORed into a tag to toggle the constructed -// bit. |CBS| and |CBB| APIs consider the constructed bit to be part of the -// tag. -#define CBS_ASN1_CONSTRUCTED (0x20u << CBS_ASN1_TAG_SHIFT) - -// The following values specify the tag class and may be ORed into a tag number -// to produce the final tag. If none is used, the tag will be UNIVERSAL. -#define CBS_ASN1_UNIVERSAL (0u << CBS_ASN1_TAG_SHIFT) -#define CBS_ASN1_APPLICATION (0x40u << CBS_ASN1_TAG_SHIFT) -#define CBS_ASN1_CONTEXT_SPECIFIC (0x80u << CBS_ASN1_TAG_SHIFT) -#define CBS_ASN1_PRIVATE (0xc0u << CBS_ASN1_TAG_SHIFT) - -// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class. This will -// give one of the four values above. -#define CBS_ASN1_CLASS_MASK (0xc0u << CBS_ASN1_TAG_SHIFT) - -// CBS_ASN1_TAG_NUMBER_MASK may be ANDed with a tag to query its number. -#define CBS_ASN1_TAG_NUMBER_MASK ((1u << (5 + CBS_ASN1_TAG_SHIFT)) - 1) - // CBS_get_asn1 sets |*out| to the contents of DER-encoded, ASN.1 element (not // including tag and length bytes) and advances |cbs| over it. The ASN.1 // element must match |tag_value|. It returns one on success and zero @@ -235,6 +265,11 @@ OPENSSL_EXPORT int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, // in 64 bits. OPENSSL_EXPORT int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out); +// CBS_get_asn1_int64 gets an ASN.1 INTEGER from |cbs| using |CBS_get_asn1| +// and sets |*out| to its value. It returns one on success and zero on error, +// where error includes the integer being too large to represent in 64 bits. +OPENSSL_EXPORT int CBS_get_asn1_int64(CBS *cbs, int64_t *out); + // CBS_get_asn1_bool gets an ASN.1 BOOLEAN from |cbs| and sets |*out| to zero // or one based on its value. It returns one on success or zero on error. OPENSSL_EXPORT int CBS_get_asn1_bool(CBS *cbs, int *out); @@ -327,9 +362,9 @@ struct cbb_st { // length-prefix, or zero if no length-prefix is pending. uint8_t pending_len_len; char pending_is_asn1; - // is_top_level is true iff this is a top-level |CBB| (as opposed to a child + // is_child is true iff this is a child |CBB| (as opposed to a top-level // |CBB|). Top-level objects are valid arguments for |CBB_finish|. - char is_top_level; + char is_child; }; // CBB_zero sets an uninitialised |cbb| to the zero state. It must be @@ -340,7 +375,7 @@ OPENSSL_EXPORT void CBB_zero(CBB *cbb); // CBB_init initialises |cbb| with |initial_capacity|. Since a |CBB| grows as // needed, the |initial_capacity| is just a hint. It returns one on success or -// zero on error. +// zero on allocation failure. OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity); // CBB_init_fixed initialises |cbb| to write to |len| bytes at |buf|. Since @@ -437,6 +472,10 @@ OPENSSL_EXPORT int CBB_add_u8(CBB *cbb, uint8_t value); // returns one on success and zero otherwise. OPENSSL_EXPORT int CBB_add_u16(CBB *cbb, uint16_t value); +// CBB_add_u16le appends a 16-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u16le(CBB *cbb, uint16_t value); + // CBB_add_u24 appends a 24-bit, big-endian number from |value| to |cbb|. It // returns one on success and zero otherwise. OPENSSL_EXPORT int CBB_add_u24(CBB *cbb, uint32_t value); @@ -445,6 +484,18 @@ OPENSSL_EXPORT int CBB_add_u24(CBB *cbb, uint32_t value); // returns one on success and zero otherwise. OPENSSL_EXPORT int CBB_add_u32(CBB *cbb, uint32_t value); +// CBB_add_u32le appends a 32-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u32le(CBB *cbb, uint32_t value); + +// CBB_add_u64 appends a 64-bit, big-endian number from |value| to |cbb|. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u64(CBB *cbb, uint64_t value); + +// CBB_add_u64le appends a 64-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u64le(CBB *cbb, uint64_t value); + // CBB_discard_child discards the current unflushed child of |cbb|. Neither the // child's contents nor the length prefix will be included in the output. OPENSSL_EXPORT void CBB_discard_child(CBB *cbb); @@ -454,6 +505,11 @@ OPENSSL_EXPORT void CBB_discard_child(CBB *cbb); // error. OPENSSL_EXPORT int CBB_add_asn1_uint64(CBB *cbb, uint64_t value); +// CBB_add_asn1_int64 writes an ASN.1 INTEGER into |cbb| using |CBB_add_asn1| +// and writes |value| in its contents. It returns one on success and zero on +// error. +OPENSSL_EXPORT int CBB_add_asn1_int64(CBB *cbb, int64_t value); + // CBB_add_asn1_octet_string writes an ASN.1 OCTET STRING into |cbb| with the // given contents. It returns one on success and zero on error. OPENSSL_EXPORT int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, @@ -491,11 +547,11 @@ OPENSSL_EXPORT int CBB_flush_asn1_set_of(CBB *cbb); #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN using ScopedCBB = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.back new file mode 100644 index 000000000..1f9c87908 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.back @@ -0,0 +1,561 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_BYTESTRING_H +#define OPENSSL_HEADER_BYTESTRING_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Bytestrings are used for parsing and building TLS and ASN.1 messages. +// +// A "CBS" (CRYPTO ByteString) represents a string of bytes in memory and +// provides utility functions for safely parsing length-prefixed structures +// like TLS and ASN.1 from it. +// +// A "CBB" (CRYPTO ByteBuilder) is a memory buffer that grows as needed and +// provides utility functions for building length-prefixed messages. + + +// CRYPTO ByteString + +struct cbs_st { + const uint8_t *data; + size_t len; + +#if !defined(BORINGSSL_NO_CXX) + // Allow implicit conversions to and from bssl::Span. + cbs_st(bssl::Span span) + : data(span.data()), len(span.size()) {} + operator bssl::Span() const { + return bssl::MakeConstSpan(data, len); + } + + // Defining any constructors requires we explicitly default the others. + cbs_st() = default; + cbs_st(const cbs_st &) = default; +#endif +}; + +// CBS_init sets |cbs| to point to |data|. It does not take ownership of +// |data|. +OPENSSL_EXPORT void CBS_init(CBS *cbs, const uint8_t *data, size_t len); + +// CBS_skip advances |cbs| by |len| bytes. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int CBS_skip(CBS *cbs, size_t len); + +// CBS_data returns a pointer to the contents of |cbs|. +OPENSSL_EXPORT const uint8_t *CBS_data(const CBS *cbs); + +// CBS_len returns the number of bytes remaining in |cbs|. +OPENSSL_EXPORT size_t CBS_len(const CBS *cbs); + +// CBS_stow copies the current contents of |cbs| into |*out_ptr| and +// |*out_len|. If |*out_ptr| is not NULL, the contents are freed with +// OPENSSL_free. It returns one on success and zero on allocation failure. On +// success, |*out_ptr| should be freed with OPENSSL_free. If |cbs| is empty, +// |*out_ptr| will be NULL. +OPENSSL_EXPORT int CBS_stow(const CBS *cbs, uint8_t **out_ptr, size_t *out_len); + +// CBS_strdup copies the current contents of |cbs| into |*out_ptr| as a +// NUL-terminated C string. If |*out_ptr| is not NULL, the contents are freed +// with OPENSSL_free. It returns one on success and zero on allocation +// failure. On success, |*out_ptr| should be freed with OPENSSL_free. +// +// NOTE: If |cbs| contains NUL bytes, the string will be truncated. Call +// |CBS_contains_zero_byte(cbs)| to check for NUL bytes. +OPENSSL_EXPORT int CBS_strdup(const CBS *cbs, char **out_ptr); + +// CBS_contains_zero_byte returns one if the current contents of |cbs| contains +// a NUL byte and zero otherwise. +OPENSSL_EXPORT int CBS_contains_zero_byte(const CBS *cbs); + +// CBS_mem_equal compares the current contents of |cbs| with the |len| bytes +// starting at |data|. If they're equal, it returns one, otherwise zero. If the +// lengths match, it uses a constant-time comparison. +OPENSSL_EXPORT int CBS_mem_equal(const CBS *cbs, const uint8_t *data, + size_t len); + +// CBS_get_u8 sets |*out| to the next uint8_t from |cbs| and advances |cbs|. It +// returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u8(CBS *cbs, uint8_t *out); + +// CBS_get_u16 sets |*out| to the next, big-endian uint16_t from |cbs| and +// advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u16(CBS *cbs, uint16_t *out); + +// CBS_get_u16le sets |*out| to the next, little-endian uint16_t from |cbs| and +// advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u16le(CBS *cbs, uint16_t *out); + +// CBS_get_u24 sets |*out| to the next, big-endian 24-bit value from |cbs| and +// advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u24(CBS *cbs, uint32_t *out); + +// CBS_get_u32 sets |*out| to the next, big-endian uint32_t value from |cbs| +// and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u32(CBS *cbs, uint32_t *out); + +// CBS_get_u32le sets |*out| to the next, little-endian uint32_t value from +// |cbs| and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u32le(CBS *cbs, uint32_t *out); + +// CBS_get_u64 sets |*out| to the next, big-endian uint64_t value from |cbs| +// and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u64(CBS *cbs, uint64_t *out); + +// CBS_get_u64le sets |*out| to the next, little-endian uint64_t value from +// |cbs| and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u64le(CBS *cbs, uint64_t *out); + +// CBS_get_last_u8 sets |*out| to the last uint8_t from |cbs| and shortens +// |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_last_u8(CBS *cbs, uint8_t *out); + +// CBS_get_bytes sets |*out| to the next |len| bytes from |cbs| and advances +// |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_bytes(CBS *cbs, CBS *out, size_t len); + +// CBS_copy_bytes copies the next |len| bytes from |cbs| to |out| and advances +// |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_copy_bytes(CBS *cbs, uint8_t *out, size_t len); + +// CBS_get_u8_length_prefixed sets |*out| to the contents of an 8-bit, +// length-prefixed value from |cbs| and advances |cbs| over it. It returns one +// on success and zero on error. +OPENSSL_EXPORT int CBS_get_u8_length_prefixed(CBS *cbs, CBS *out); + +// CBS_get_u16_length_prefixed sets |*out| to the contents of a 16-bit, +// big-endian, length-prefixed value from |cbs| and advances |cbs| over it. It +// returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u16_length_prefixed(CBS *cbs, CBS *out); + +// CBS_get_u24_length_prefixed sets |*out| to the contents of a 24-bit, +// big-endian, length-prefixed value from |cbs| and advances |cbs| over it. It +// returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out); + + +// Parsing ASN.1 +// +// |CBS| may be used to parse DER structures. Rather than using a schema +// compiler, the following functions act on tag-length-value elements in the +// serialization itself. Thus the caller is responsible for looping over a +// SEQUENCE, branching on CHOICEs or OPTIONAL fields, checking for trailing +// data, and handling explict vs. implicit tagging. +// +// Tags are represented as |unsigned| values in memory. The upper few bits store +// the class and constructed bit, and the remaining bits store the tag +// number. Note this differs from the DER serialization, to support tag numbers +// beyond 31. Consumers must use the constants defined below to decompose or +// assemble tags. +// +// This library treats an element's constructed bit as part of its tag. In DER, +// the constructed bit is computable from the type. The constants for universal +// types have the bit set. Callers must set it correctly for tagged types. +// Explicitly-tagged types are always constructed, and implicitly-tagged types +// inherit the underlying type's bit. + +// CBS_ASN1_TAG_SHIFT is how much the in-memory representation shifts the class +// and constructed bits from the DER serialization. +#define CBS_ASN1_TAG_SHIFT 24 + +// CBS_ASN1_CONSTRUCTED may be ORed into a tag to set the constructed bit. +#define CBS_ASN1_CONSTRUCTED (0x20u << CBS_ASN1_TAG_SHIFT) + +// The following values specify the tag class and may be ORed into a tag number +// to produce the final tag. If none is used, the tag will be UNIVERSAL. +#define CBS_ASN1_UNIVERSAL (0u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_APPLICATION (0x40u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_CONTEXT_SPECIFIC (0x80u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_PRIVATE (0xc0u << CBS_ASN1_TAG_SHIFT) + +// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class. This will +// give one of the four values above. +#define CBS_ASN1_CLASS_MASK (0xc0u << CBS_ASN1_TAG_SHIFT) + +// CBS_ASN1_TAG_NUMBER_MASK may be ANDed with a tag to query its number. +#define CBS_ASN1_TAG_NUMBER_MASK ((1u << (5 + CBS_ASN1_TAG_SHIFT)) - 1) + +// The following values are constants for UNIVERSAL tags. Note these constants +// include the constructed bit. +#define CBS_ASN1_BOOLEAN 0x1u +#define CBS_ASN1_INTEGER 0x2u +#define CBS_ASN1_BITSTRING 0x3u +#define CBS_ASN1_OCTETSTRING 0x4u +#define CBS_ASN1_NULL 0x5u +#define CBS_ASN1_OBJECT 0x6u +#define CBS_ASN1_ENUMERATED 0xau +#define CBS_ASN1_UTF8STRING 0xcu +#define CBS_ASN1_SEQUENCE (0x10u | CBS_ASN1_CONSTRUCTED) +#define CBS_ASN1_SET (0x11u | CBS_ASN1_CONSTRUCTED) +#define CBS_ASN1_NUMERICSTRING 0x12u +#define CBS_ASN1_PRINTABLESTRING 0x13u +#define CBS_ASN1_T61STRING 0x14u +#define CBS_ASN1_VIDEOTEXSTRING 0x15u +#define CBS_ASN1_IA5STRING 0x16u +#define CBS_ASN1_UTCTIME 0x17u +#define CBS_ASN1_GENERALIZEDTIME 0x18u +#define CBS_ASN1_GRAPHICSTRING 0x19u +#define CBS_ASN1_VISIBLESTRING 0x1au +#define CBS_ASN1_GENERALSTRING 0x1bu +#define CBS_ASN1_UNIVERSALSTRING 0x1cu +#define CBS_ASN1_BMPSTRING 0x1eu + +// CBS_get_asn1 sets |*out| to the contents of DER-encoded, ASN.1 element (not +// including tag and length bytes) and advances |cbs| over it. The ASN.1 +// element must match |tag_value|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int CBS_get_asn1(CBS *cbs, CBS *out, unsigned tag_value); + +// CBS_get_asn1_element acts like |CBS_get_asn1| but |out| will include the +// ASN.1 header bytes too. +OPENSSL_EXPORT int CBS_get_asn1_element(CBS *cbs, CBS *out, unsigned tag_value); + +// CBS_peek_asn1_tag looks ahead at the next ASN.1 tag and returns one +// if the next ASN.1 element on |cbs| would have tag |tag_value|. If +// |cbs| is empty or the tag does not match, it returns zero. Note: if +// it returns one, CBS_get_asn1 may still fail if the rest of the +// element is malformed. +OPENSSL_EXPORT int CBS_peek_asn1_tag(const CBS *cbs, unsigned tag_value); + +// CBS_get_any_asn1 sets |*out| to contain the next ASN.1 element from |*cbs| +// (not including tag and length bytes), sets |*out_tag| to the tag number, and +// advances |*cbs|. It returns one on success and zero on error. Either of |out| +// and |out_tag| may be NULL to ignore the value. +OPENSSL_EXPORT int CBS_get_any_asn1(CBS *cbs, CBS *out, unsigned *out_tag); + +// CBS_get_any_asn1_element sets |*out| to contain the next ASN.1 element from +// |*cbs| (including header bytes) and advances |*cbs|. It sets |*out_tag| to +// the tag number and |*out_header_len| to the length of the ASN.1 header. Each +// of |out|, |out_tag|, and |out_header_len| may be NULL to ignore the value. +OPENSSL_EXPORT int CBS_get_any_asn1_element(CBS *cbs, CBS *out, + unsigned *out_tag, + size_t *out_header_len); + +// CBS_get_any_ber_asn1_element acts the same as |CBS_get_any_asn1_element| but +// also allows indefinite-length elements to be returned. In that case, +// |*out_header_len| and |CBS_len(out)| will both be two as only the header is +// returned, otherwise it behaves the same as the previous function. +OPENSSL_EXPORT int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, + unsigned *out_tag, + size_t *out_header_len); + +// CBS_get_asn1_uint64 gets an ASN.1 INTEGER from |cbs| using |CBS_get_asn1| +// and sets |*out| to its value. It returns one on success and zero on error, +// where error includes the integer being negative, or too large to represent +// in 64 bits. +OPENSSL_EXPORT int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out); + +// CBS_get_asn1_int64 gets an ASN.1 INTEGER from |cbs| using |CBS_get_asn1| +// and sets |*out| to its value. It returns one on success and zero on error, +// where error includes the integer being too large to represent in 64 bits. +OPENSSL_EXPORT int CBS_get_asn1_int64(CBS *cbs, int64_t *out); + +// CBS_get_asn1_bool gets an ASN.1 BOOLEAN from |cbs| and sets |*out| to zero +// or one based on its value. It returns one on success or zero on error. +OPENSSL_EXPORT int CBS_get_asn1_bool(CBS *cbs, int *out); + +// CBS_get_optional_asn1 gets an optional explicitly-tagged element from |cbs| +// tagged with |tag| and sets |*out| to its contents, or ignores it if |out| is +// NULL. If present and if |out_present| is not NULL, it sets |*out_present| to +// one, otherwise zero. It returns one on success, whether or not the element +// was present, and zero on decode failure. +OPENSSL_EXPORT int CBS_get_optional_asn1(CBS *cbs, CBS *out, int *out_present, + unsigned tag); + +// CBS_get_optional_asn1_octet_string gets an optional +// explicitly-tagged OCTET STRING from |cbs|. If present, it sets +// |*out| to the string and |*out_present| to one. Otherwise, it sets +// |*out| to empty and |*out_present| to zero. |out_present| may be +// NULL. It returns one on success, whether or not the element was +// present, and zero on decode failure. +OPENSSL_EXPORT int CBS_get_optional_asn1_octet_string(CBS *cbs, CBS *out, + int *out_present, + unsigned tag); + +// CBS_get_optional_asn1_uint64 gets an optional explicitly-tagged +// INTEGER from |cbs|. If present, it sets |*out| to the +// value. Otherwise, it sets |*out| to |default_value|. It returns one +// on success, whether or not the element was present, and zero on +// decode failure. +OPENSSL_EXPORT int CBS_get_optional_asn1_uint64(CBS *cbs, uint64_t *out, + unsigned tag, + uint64_t default_value); + +// CBS_get_optional_asn1_bool gets an optional, explicitly-tagged BOOLEAN from +// |cbs|. If present, it sets |*out| to either zero or one, based on the +// boolean. Otherwise, it sets |*out| to |default_value|. It returns one on +// success, whether or not the element was present, and zero on decode +// failure. +OPENSSL_EXPORT int CBS_get_optional_asn1_bool(CBS *cbs, int *out, unsigned tag, + int default_value); + +// CBS_is_valid_asn1_bitstring returns one if |cbs| is a valid ASN.1 BIT STRING +// and zero otherwise. +OPENSSL_EXPORT int CBS_is_valid_asn1_bitstring(const CBS *cbs); + +// CBS_asn1_bitstring_has_bit returns one if |cbs| is a valid ASN.1 BIT STRING +// and the specified bit is present and set. Otherwise, it returns zero. |bit| +// is indexed starting from zero. +OPENSSL_EXPORT int CBS_asn1_bitstring_has_bit(const CBS *cbs, unsigned bit); + +// CBS_asn1_oid_to_text interprets |cbs| as DER-encoded ASN.1 OBJECT IDENTIFIER +// contents (not including the element framing) and returns the ASCII +// representation (e.g., "1.2.840.113554.4.1.72585") in a newly-allocated +// string, or NULL on failure. The caller must release the result with +// |OPENSSL_free|. +OPENSSL_EXPORT char *CBS_asn1_oid_to_text(const CBS *cbs); + + +// CRYPTO ByteBuilder. +// +// |CBB| objects allow one to build length-prefixed serialisations. A |CBB| +// object is associated with a buffer and new buffers are created with +// |CBB_init|. Several |CBB| objects can point at the same buffer when a +// length-prefix is pending, however only a single |CBB| can be 'current' at +// any one time. For example, if one calls |CBB_add_u8_length_prefixed| then +// the new |CBB| points at the same buffer as the original. But if the original +// |CBB| is used then the length prefix is written out and the new |CBB| must +// not be used again. +// +// If one needs to force a length prefix to be written out because a |CBB| is +// going out of scope, use |CBB_flush|. If an operation on a |CBB| fails, it is +// in an undefined state and must not be used except to call |CBB_cleanup|. + +struct cbb_buffer_st { + uint8_t *buf; + size_t len; // The number of valid bytes. + size_t cap; // The size of buf. + char can_resize; /* One iff |buf| is owned by this object. If not then |buf| + cannot be resized. */ + char error; /* One iff there was an error writing to this CBB. All future + operations will fail. */ +}; + +struct cbb_st { + struct cbb_buffer_st *base; + // child points to a child CBB if a length-prefix is pending. + CBB *child; + // offset is the number of bytes from the start of |base->buf| to this |CBB|'s + // pending length prefix. + size_t offset; + // pending_len_len contains the number of bytes in this |CBB|'s pending + // length-prefix, or zero if no length-prefix is pending. + uint8_t pending_len_len; + char pending_is_asn1; + // is_child is true iff this is a child |CBB| (as opposed to a top-level + // |CBB|). Top-level objects are valid arguments for |CBB_finish|. + char is_child; +}; + +// CBB_zero sets an uninitialised |cbb| to the zero state. It must be +// initialised with |CBB_init| or |CBB_init_fixed| before use, but it is safe to +// call |CBB_cleanup| without a successful |CBB_init|. This may be used for more +// uniform cleanup of a |CBB|. +OPENSSL_EXPORT void CBB_zero(CBB *cbb); + +// CBB_init initialises |cbb| with |initial_capacity|. Since a |CBB| grows as +// needed, the |initial_capacity| is just a hint. It returns one on success or +// zero on allocation failure. +OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity); + +// CBB_init_fixed initialises |cbb| to write to |len| bytes at |buf|. Since +// |buf| cannot grow, trying to write more than |len| bytes will cause CBB +// functions to fail. It returns one on success or zero on error. +OPENSSL_EXPORT int CBB_init_fixed(CBB *cbb, uint8_t *buf, size_t len); + +// CBB_cleanup frees all resources owned by |cbb| and other |CBB| objects +// writing to the same buffer. This should be used in an error case where a +// serialisation is abandoned. +// +// This function can only be called on a "top level" |CBB|, i.e. one initialised +// with |CBB_init| or |CBB_init_fixed|, or a |CBB| set to the zero state with +// |CBB_zero|. +OPENSSL_EXPORT void CBB_cleanup(CBB *cbb); + +// CBB_finish completes any pending length prefix and sets |*out_data| to a +// malloced buffer and |*out_len| to the length of that buffer. The caller +// takes ownership of the buffer and, unless the buffer was fixed with +// |CBB_init_fixed|, must call |OPENSSL_free| when done. +// +// It can only be called on a "top level" |CBB|, i.e. one initialised with +// |CBB_init| or |CBB_init_fixed|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len); + +// CBB_flush causes any pending length prefixes to be written out and any child +// |CBB| objects of |cbb| to be invalidated. This allows |cbb| to continue to be +// used after the children go out of scope, e.g. when local |CBB| objects are +// added as children to a |CBB| that persists after a function returns. This +// function returns one on success or zero on error. +OPENSSL_EXPORT int CBB_flush(CBB *cbb); + +// CBB_data returns a pointer to the bytes written to |cbb|. It does not flush +// |cbb|. The pointer is valid until the next operation to |cbb|. +// +// To avoid unfinalized length prefixes, it is a fatal error to call this on a +// CBB with any active children. +OPENSSL_EXPORT const uint8_t *CBB_data(const CBB *cbb); + +// CBB_len returns the number of bytes written to |cbb|. It does not flush +// |cbb|. +// +// To avoid unfinalized length prefixes, it is a fatal error to call this on a +// CBB with any active children. +OPENSSL_EXPORT size_t CBB_len(const CBB *cbb); + +// CBB_add_u8_length_prefixed sets |*out_contents| to a new child of |cbb|. The +// data written to |*out_contents| will be prefixed in |cbb| with an 8-bit +// length. It returns one on success or zero on error. +OPENSSL_EXPORT int CBB_add_u8_length_prefixed(CBB *cbb, CBB *out_contents); + +// CBB_add_u16_length_prefixed sets |*out_contents| to a new child of |cbb|. +// The data written to |*out_contents| will be prefixed in |cbb| with a 16-bit, +// big-endian length. It returns one on success or zero on error. +OPENSSL_EXPORT int CBB_add_u16_length_prefixed(CBB *cbb, CBB *out_contents); + +// CBB_add_u24_length_prefixed sets |*out_contents| to a new child of |cbb|. +// The data written to |*out_contents| will be prefixed in |cbb| with a 24-bit, +// big-endian length. It returns one on success or zero on error. +OPENSSL_EXPORT int CBB_add_u24_length_prefixed(CBB *cbb, CBB *out_contents); + +// CBB_add_asn1 sets |*out_contents| to a |CBB| into which the contents of an +// ASN.1 object can be written. The |tag| argument will be used as the tag for +// the object. It returns one on success or zero on error. +OPENSSL_EXPORT int CBB_add_asn1(CBB *cbb, CBB *out_contents, unsigned tag); + +// CBB_add_bytes appends |len| bytes from |data| to |cbb|. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int CBB_add_bytes(CBB *cbb, const uint8_t *data, size_t len); + +// CBB_add_space appends |len| bytes to |cbb| and sets |*out_data| to point to +// the beginning of that space. The caller must then write |len| bytes of +// actual contents to |*out_data|. It returns one on success and zero +// otherwise. +OPENSSL_EXPORT int CBB_add_space(CBB *cbb, uint8_t **out_data, size_t len); + +// CBB_reserve ensures |cbb| has room for |len| additional bytes and sets +// |*out_data| to point to the beginning of that space. It returns one on +// success and zero otherwise. The caller may write up to |len| bytes to +// |*out_data| and call |CBB_did_write| to complete the write. |*out_data| is +// valid until the next operation on |cbb| or an ancestor |CBB|. +OPENSSL_EXPORT int CBB_reserve(CBB *cbb, uint8_t **out_data, size_t len); + +// CBB_did_write advances |cbb| by |len| bytes, assuming the space has been +// written to by the caller. It returns one on success and zero on error. +OPENSSL_EXPORT int CBB_did_write(CBB *cbb, size_t len); + +// CBB_add_u8 appends an 8-bit number from |value| to |cbb|. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u8(CBB *cbb, uint8_t value); + +// CBB_add_u16 appends a 16-bit, big-endian number from |value| to |cbb|. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u16(CBB *cbb, uint16_t value); + +// CBB_add_u16le appends a 16-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u16le(CBB *cbb, uint16_t value); + +// CBB_add_u24 appends a 24-bit, big-endian number from |value| to |cbb|. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u24(CBB *cbb, uint32_t value); + +// CBB_add_u32 appends a 32-bit, big-endian number from |value| to |cbb|. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u32(CBB *cbb, uint32_t value); + +// CBB_add_u32le appends a 32-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u32le(CBB *cbb, uint32_t value); + +// CBB_add_u64 appends a 64-bit, big-endian number from |value| to |cbb|. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u64(CBB *cbb, uint64_t value); + +// CBB_add_u64le appends a 64-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u64le(CBB *cbb, uint64_t value); + +// CBB_discard_child discards the current unflushed child of |cbb|. Neither the +// child's contents nor the length prefix will be included in the output. +OPENSSL_EXPORT void CBB_discard_child(CBB *cbb); + +// CBB_add_asn1_uint64 writes an ASN.1 INTEGER into |cbb| using |CBB_add_asn1| +// and writes |value| in its contents. It returns one on success and zero on +// error. +OPENSSL_EXPORT int CBB_add_asn1_uint64(CBB *cbb, uint64_t value); + +// CBB_add_asn1_int64 writes an ASN.1 INTEGER into |cbb| using |CBB_add_asn1| +// and writes |value| in its contents. It returns one on success and zero on +// error. +OPENSSL_EXPORT int CBB_add_asn1_int64(CBB *cbb, int64_t value); + +// CBB_add_asn1_octet_string writes an ASN.1 OCTET STRING into |cbb| with the +// given contents. It returns one on success and zero on error. +OPENSSL_EXPORT int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, + size_t data_len); + +// CBB_add_asn1_bool writes an ASN.1 BOOLEAN into |cbb| which is true iff +// |value| is non-zero. It returns one on success and zero on error. +OPENSSL_EXPORT int CBB_add_asn1_bool(CBB *cbb, int value); + +// CBB_add_asn1_oid_from_text decodes |len| bytes from |text| as an ASCII OID +// representation, e.g. "1.2.840.113554.4.1.72585", and writes the DER-encoded +// contents to |cbb|. It returns one on success and zero on malloc failure or if +// |text| was invalid. It does not include the OBJECT IDENTIFER framing, only +// the element's contents. +// +// This function considers OID strings with components which do not fit in a +// |uint64_t| to be invalid. +OPENSSL_EXPORT int CBB_add_asn1_oid_from_text(CBB *cbb, const char *text, + size_t len); + +// CBB_flush_asn1_set_of calls |CBB_flush| on |cbb| and then reorders the +// contents for a DER-encoded ASN.1 SET OF type. It returns one on success and +// zero on failure. DER canonicalizes SET OF contents by sorting +// lexicographically by encoding. Call this function when encoding a SET OF +// type in an order that is not already known to be canonical. +// +// Note a SET type has a slightly different ordering than a SET OF. +OPENSSL_EXPORT int CBB_flush_asn1_set_of(CBB *cbb); + + +#if defined(__cplusplus) +} // extern C + + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +using ScopedCBB = internal::StackAllocated; + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif + +#endif // OPENSSL_HEADER_BYTESTRING_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/bytestring.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/include/openssl/bytestring.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.grpc_back index 6ed1644f1..1f9c87908 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/bytestring.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/bytestring.h.grpc_back @@ -102,6 +102,10 @@ OPENSSL_EXPORT int CBS_get_u8(CBS *cbs, uint8_t *out); // advances |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_u16(CBS *cbs, uint16_t *out); +// CBS_get_u16le sets |*out| to the next, little-endian uint16_t from |cbs| and +// advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u16le(CBS *cbs, uint16_t *out); + // CBS_get_u24 sets |*out| to the next, big-endian 24-bit value from |cbs| and // advances |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_u24(CBS *cbs, uint32_t *out); @@ -110,6 +114,18 @@ OPENSSL_EXPORT int CBS_get_u24(CBS *cbs, uint32_t *out); // and advances |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_u32(CBS *cbs, uint32_t *out); +// CBS_get_u32le sets |*out| to the next, little-endian uint32_t value from +// |cbs| and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u32le(CBS *cbs, uint32_t *out); + +// CBS_get_u64 sets |*out| to the next, big-endian uint64_t value from |cbs| +// and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u64(CBS *cbs, uint64_t *out); + +// CBS_get_u64le sets |*out| to the next, little-endian uint64_t value from +// |cbs| and advances |cbs|. It returns one on success and zero on error. +OPENSSL_EXPORT int CBS_get_u64le(CBS *cbs, uint64_t *out); + // CBS_get_last_u8 sets |*out| to the last uint8_t from |cbs| and shortens // |cbs|. It returns one on success and zero on error. OPENSSL_EXPORT int CBS_get_last_u8(CBS *cbs, uint8_t *out); @@ -139,8 +155,48 @@ OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out); // Parsing ASN.1 +// +// |CBS| may be used to parse DER structures. Rather than using a schema +// compiler, the following functions act on tag-length-value elements in the +// serialization itself. Thus the caller is responsible for looping over a +// SEQUENCE, branching on CHOICEs or OPTIONAL fields, checking for trailing +// data, and handling explict vs. implicit tagging. +// +// Tags are represented as |unsigned| values in memory. The upper few bits store +// the class and constructed bit, and the remaining bits store the tag +// number. Note this differs from the DER serialization, to support tag numbers +// beyond 31. Consumers must use the constants defined below to decompose or +// assemble tags. +// +// This library treats an element's constructed bit as part of its tag. In DER, +// the constructed bit is computable from the type. The constants for universal +// types have the bit set. Callers must set it correctly for tagged types. +// Explicitly-tagged types are always constructed, and implicitly-tagged types +// inherit the underlying type's bit. + +// CBS_ASN1_TAG_SHIFT is how much the in-memory representation shifts the class +// and constructed bits from the DER serialization. +#define CBS_ASN1_TAG_SHIFT 24 -// The following values are tag numbers for UNIVERSAL elements. +// CBS_ASN1_CONSTRUCTED may be ORed into a tag to set the constructed bit. +#define CBS_ASN1_CONSTRUCTED (0x20u << CBS_ASN1_TAG_SHIFT) + +// The following values specify the tag class and may be ORed into a tag number +// to produce the final tag. If none is used, the tag will be UNIVERSAL. +#define CBS_ASN1_UNIVERSAL (0u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_APPLICATION (0x40u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_CONTEXT_SPECIFIC (0x80u << CBS_ASN1_TAG_SHIFT) +#define CBS_ASN1_PRIVATE (0xc0u << CBS_ASN1_TAG_SHIFT) + +// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class. This will +// give one of the four values above. +#define CBS_ASN1_CLASS_MASK (0xc0u << CBS_ASN1_TAG_SHIFT) + +// CBS_ASN1_TAG_NUMBER_MASK may be ANDed with a tag to query its number. +#define CBS_ASN1_TAG_NUMBER_MASK ((1u << (5 + CBS_ASN1_TAG_SHIFT)) - 1) + +// The following values are constants for UNIVERSAL tags. Note these constants +// include the constructed bit. #define CBS_ASN1_BOOLEAN 0x1u #define CBS_ASN1_INTEGER 0x2u #define CBS_ASN1_BITSTRING 0x3u @@ -164,32 +220,6 @@ OPENSSL_EXPORT int CBS_get_u24_length_prefixed(CBS *cbs, CBS *out); #define CBS_ASN1_UNIVERSALSTRING 0x1cu #define CBS_ASN1_BMPSTRING 0x1eu -// CBS_ASN1_TAG_SHIFT is how much the in-memory representation shifts the class -// and constructed bits from the DER serialization. This allows representing tag -// numbers beyond 31. -// -// Consumers must use the following constants to decompose or assemble tags. -#define CBS_ASN1_TAG_SHIFT 24 - -// CBS_ASN1_CONSTRUCTED may be ORed into a tag to toggle the constructed -// bit. |CBS| and |CBB| APIs consider the constructed bit to be part of the -// tag. -#define CBS_ASN1_CONSTRUCTED (0x20u << CBS_ASN1_TAG_SHIFT) - -// The following values specify the tag class and may be ORed into a tag number -// to produce the final tag. If none is used, the tag will be UNIVERSAL. -#define CBS_ASN1_UNIVERSAL (0u << CBS_ASN1_TAG_SHIFT) -#define CBS_ASN1_APPLICATION (0x40u << CBS_ASN1_TAG_SHIFT) -#define CBS_ASN1_CONTEXT_SPECIFIC (0x80u << CBS_ASN1_TAG_SHIFT) -#define CBS_ASN1_PRIVATE (0xc0u << CBS_ASN1_TAG_SHIFT) - -// CBS_ASN1_CLASS_MASK may be ANDed with a tag to query its class. This will -// give one of the four values above. -#define CBS_ASN1_CLASS_MASK (0xc0u << CBS_ASN1_TAG_SHIFT) - -// CBS_ASN1_TAG_NUMBER_MASK may be ANDed with a tag to query its number. -#define CBS_ASN1_TAG_NUMBER_MASK ((1u << (5 + CBS_ASN1_TAG_SHIFT)) - 1) - // CBS_get_asn1 sets |*out| to the contents of DER-encoded, ASN.1 element (not // including tag and length bytes) and advances |cbs| over it. The ASN.1 // element must match |tag_value|. It returns one on success and zero @@ -235,6 +265,11 @@ OPENSSL_EXPORT int CBS_get_any_ber_asn1_element(CBS *cbs, CBS *out, // in 64 bits. OPENSSL_EXPORT int CBS_get_asn1_uint64(CBS *cbs, uint64_t *out); +// CBS_get_asn1_int64 gets an ASN.1 INTEGER from |cbs| using |CBS_get_asn1| +// and sets |*out| to its value. It returns one on success and zero on error, +// where error includes the integer being too large to represent in 64 bits. +OPENSSL_EXPORT int CBS_get_asn1_int64(CBS *cbs, int64_t *out); + // CBS_get_asn1_bool gets an ASN.1 BOOLEAN from |cbs| and sets |*out| to zero // or one based on its value. It returns one on success or zero on error. OPENSSL_EXPORT int CBS_get_asn1_bool(CBS *cbs, int *out); @@ -327,9 +362,9 @@ struct cbb_st { // length-prefix, or zero if no length-prefix is pending. uint8_t pending_len_len; char pending_is_asn1; - // is_top_level is true iff this is a top-level |CBB| (as opposed to a child + // is_child is true iff this is a child |CBB| (as opposed to a top-level // |CBB|). Top-level objects are valid arguments for |CBB_finish|. - char is_top_level; + char is_child; }; // CBB_zero sets an uninitialised |cbb| to the zero state. It must be @@ -340,7 +375,7 @@ OPENSSL_EXPORT void CBB_zero(CBB *cbb); // CBB_init initialises |cbb| with |initial_capacity|. Since a |CBB| grows as // needed, the |initial_capacity| is just a hint. It returns one on success or -// zero on error. +// zero on allocation failure. OPENSSL_EXPORT int CBB_init(CBB *cbb, size_t initial_capacity); // CBB_init_fixed initialises |cbb| to write to |len| bytes at |buf|. Since @@ -437,6 +472,10 @@ OPENSSL_EXPORT int CBB_add_u8(CBB *cbb, uint8_t value); // returns one on success and zero otherwise. OPENSSL_EXPORT int CBB_add_u16(CBB *cbb, uint16_t value); +// CBB_add_u16le appends a 16-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u16le(CBB *cbb, uint16_t value); + // CBB_add_u24 appends a 24-bit, big-endian number from |value| to |cbb|. It // returns one on success and zero otherwise. OPENSSL_EXPORT int CBB_add_u24(CBB *cbb, uint32_t value); @@ -445,6 +484,18 @@ OPENSSL_EXPORT int CBB_add_u24(CBB *cbb, uint32_t value); // returns one on success and zero otherwise. OPENSSL_EXPORT int CBB_add_u32(CBB *cbb, uint32_t value); +// CBB_add_u32le appends a 32-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u32le(CBB *cbb, uint32_t value); + +// CBB_add_u64 appends a 64-bit, big-endian number from |value| to |cbb|. It +// returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u64(CBB *cbb, uint64_t value); + +// CBB_add_u64le appends a 64-bit, little-endian number from |value| to |cbb|. +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int CBB_add_u64le(CBB *cbb, uint64_t value); + // CBB_discard_child discards the current unflushed child of |cbb|. Neither the // child's contents nor the length prefix will be included in the output. OPENSSL_EXPORT void CBB_discard_child(CBB *cbb); @@ -454,6 +505,11 @@ OPENSSL_EXPORT void CBB_discard_child(CBB *cbb); // error. OPENSSL_EXPORT int CBB_add_asn1_uint64(CBB *cbb, uint64_t value); +// CBB_add_asn1_int64 writes an ASN.1 INTEGER into |cbb| using |CBB_add_asn1| +// and writes |value| in its contents. It returns one on success and zero on +// error. +OPENSSL_EXPORT int CBB_add_asn1_int64(CBB *cbb, int64_t value); + // CBB_add_asn1_octet_string writes an ASN.1 OCTET STRING into |cbb| with the // given contents. It returns one on success and zero on error. OPENSSL_EXPORT int CBB_add_asn1_octet_string(CBB *cbb, const uint8_t *data, @@ -491,11 +547,11 @@ OPENSSL_EXPORT int CBB_flush_asn1_set_of(CBB *cbb); #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN using ScopedCBB = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/cast.h b/Pods/BoringSSL-GRPC/src/include/openssl/cast.h similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/cast.h rename to Pods/BoringSSL-GRPC/src/include/openssl/cast.h index 3165f0d07..95d4f1b1e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cast.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cast.h @@ -82,11 +82,11 @@ OPENSSL_EXPORT void CAST_ecb_encrypt(const uint8_t *in, uint8_t *out, OPENSSL_EXPORT void CAST_encrypt(uint32_t *data, const CAST_KEY *key); OPENSSL_EXPORT void CAST_decrypt(uint32_t *data, const CAST_KEY *key); OPENSSL_EXPORT void CAST_cbc_encrypt(const uint8_t *in, uint8_t *out, - long length, const CAST_KEY *ks, + size_t length, const CAST_KEY *ks, uint8_t *iv, int enc); OPENSSL_EXPORT void CAST_cfb64_encrypt(const uint8_t *in, uint8_t *out, - long length, const CAST_KEY *schedule, + size_t length, const CAST_KEY *schedule, uint8_t *ivec, int *num, int enc); #ifdef __cplusplus diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.back new file mode 100644 index 000000000..1a0f82dde --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.back @@ -0,0 +1,96 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_CAST_H +#define OPENSSL_HEADER_CAST_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#define CAST_ENCRYPT 1 +#define CAST_DECRYPT 0 + +#define CAST_BLOCK 8 +#define CAST_KEY_LENGTH 16 + +typedef struct cast_key_st { + uint32_t data[32]; + int short_key; // Use reduced rounds for short key +} CAST_KEY; + +OPENSSL_EXPORT void CAST_set_key(CAST_KEY *key, size_t len, + const uint8_t *data); +OPENSSL_EXPORT void CAST_ecb_encrypt(const uint8_t *in, uint8_t *out, + const CAST_KEY *key, int enc); +OPENSSL_EXPORT void CAST_encrypt(uint32_t *data, const CAST_KEY *key); +OPENSSL_EXPORT void CAST_decrypt(uint32_t *data, const CAST_KEY *key); +OPENSSL_EXPORT void CAST_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const CAST_KEY *ks, + uint8_t *iv, int enc); + +OPENSSL_EXPORT void CAST_cfb64_encrypt(const uint8_t *in, uint8_t *out, + size_t length, const CAST_KEY *schedule, + uint8_t *ivec, int *num, int enc); + +#ifdef __cplusplus +} +#endif + +#endif // OPENSSL_HEADER_CAST_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/cast.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/cast.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/cast.h.grpc_back index 2978a67e8..1a0f82dde 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cast.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cast.h.grpc_back @@ -82,11 +82,11 @@ OPENSSL_EXPORT void CAST_ecb_encrypt(const uint8_t *in, uint8_t *out, OPENSSL_EXPORT void CAST_encrypt(uint32_t *data, const CAST_KEY *key); OPENSSL_EXPORT void CAST_decrypt(uint32_t *data, const CAST_KEY *key); OPENSSL_EXPORT void CAST_cbc_encrypt(const uint8_t *in, uint8_t *out, - long length, const CAST_KEY *ks, + size_t length, const CAST_KEY *ks, uint8_t *iv, int enc); OPENSSL_EXPORT void CAST_cfb64_encrypt(const uint8_t *in, uint8_t *out, - long length, const CAST_KEY *schedule, + size_t length, const CAST_KEY *schedule, uint8_t *ivec, int *num, int enc); #ifdef __cplusplus diff --git a/Pods/BoringSSL-GRPC/include/openssl/chacha.h b/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/chacha.h rename to Pods/BoringSSL-GRPC/src/include/openssl/chacha.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/chacha.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/chacha.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.grpc_back new file mode 100644 index 000000000..684fc5b0b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/chacha.h.grpc_back @@ -0,0 +1,41 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CHACHA_H +#define OPENSSL_HEADER_CHACHA_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +// ChaCha20. +// +// ChaCha20 is a stream cipher. See https://tools.ietf.org/html/rfc7539. + + +// CRYPTO_chacha_20 encrypts |in_len| bytes from |in| with the given key and +// nonce and writes the result to |out|. If |in| and |out| alias, they must be +// equal. The initial block counter is specified by |counter|. +OPENSSL_EXPORT void CRYPTO_chacha_20(uint8_t *out, const uint8_t *in, + size_t in_len, const uint8_t key[32], + const uint8_t nonce[12], uint32_t counter); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CHACHA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/cipher.h b/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/cipher.h rename to Pods/BoringSSL-GRPC/src/include/openssl/cipher.h index 87ed7c081..8d686debf 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cipher.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h @@ -136,8 +136,8 @@ OPENSSL_EXPORT int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); // EVP_CIPHER_CTX_reset calls |EVP_CIPHER_CTX_cleanup| followed by -// |EVP_CIPHER_CTX_init|. -OPENSSL_EXPORT void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); +// |EVP_CIPHER_CTX_init| and returns one. +OPENSSL_EXPORT int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); // Cipher context configuration. @@ -243,6 +243,10 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_CIPHER_CTX_cipher( // configured. OPENSSL_EXPORT int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); +// EVP_CIPHER_CTX_encrypting returns one if |ctx| is configured for encryption +// and zero otherwise. +OPENSSL_EXPORT int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); + // EVP_CIPHER_CTX_block_size returns the block size, in bytes, of the cipher // underlying |ctx|, or one if the cipher is a stream cipher. It will crash if // no cipher has been configured. @@ -413,14 +417,37 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ecb(void); OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_cbc(void); OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ctr(void); OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_gcm(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ofb(void); + +// EVP_des_ede3_ecb is an alias for |EVP_des_ede3|. Use the former instead. +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void); // EVP_aes_128_cfb128 is only available in decrepit. OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void); +// EVP_aes_256_cfb128 is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cfb128(void); + +// EVP_bf_ecb is Blowfish in ECB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_ecb(void); + +// EVP_bf_cbc is Blowfish in CBC mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_cbc(void); + +// EVP_bf_cfb is Blowfish in 64-bit CFB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_cfb(void); + +// EVP_cast5_ecb is CAST5 in ECB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_cast5_ecb(void); + +// EVP_cast5_cbc is CAST5 in CBC mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_cast5_cbc(void); + // The following flags do nothing and are included only to make it easier to // compile code with BoringSSL. -#define EVP_CIPH_CCM_MODE 0 -#define EVP_CIPH_WRAP_MODE 0 +#define EVP_CIPH_CCM_MODE (-1) +#define EVP_CIPH_OCB_MODE (-2) +#define EVP_CIPH_WRAP_MODE (-3) #define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0 // EVP_CIPHER_CTX_set_flags does nothing. @@ -433,7 +460,7 @@ OPENSSL_EXPORT void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, // EVP_CIPH_NO_PADDING disables padding in block ciphers. #define EVP_CIPH_NO_PADDING 0x800 -// EVP_CIPHER_CTX_ctrl commands. +// The following are |EVP_CIPHER_CTX_ctrl| commands. #define EVP_CTRL_INIT 0x0 #define EVP_CTRL_SET_KEY_LENGTH 0x1 #define EVP_CTRL_GET_RC2_KEY_BITS 0x2 @@ -443,23 +470,26 @@ OPENSSL_EXPORT void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, #define EVP_CTRL_RAND_KEY 0x6 #define EVP_CTRL_PBE_PRF_NID 0x7 #define EVP_CTRL_COPY 0x8 -#define EVP_CTRL_GCM_SET_IVLEN 0x9 -#define EVP_CTRL_GCM_GET_TAG 0x10 -#define EVP_CTRL_GCM_SET_TAG 0x11 -#define EVP_CTRL_GCM_SET_IV_FIXED 0x12 +#define EVP_CTRL_AEAD_SET_IVLEN 0x9 +#define EVP_CTRL_AEAD_GET_TAG 0x10 +#define EVP_CTRL_AEAD_SET_TAG 0x11 +#define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 #define EVP_CTRL_GCM_IV_GEN 0x13 #define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 -// Set the GCM invocation field, decrypt only +// EVP_CTRL_GCM_SET_IV_INV sets the GCM invocation field, decrypt only #define EVP_CTRL_GCM_SET_IV_INV 0x18 -// GCM TLS constants -// Length of fixed part of IV derived from PRF +// The following constants are unused. #define EVP_GCM_TLS_FIXED_IV_LEN 4 -// Length of explicit part of IV part of TLS records #define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 -// Length of tag for TLS #define EVP_GCM_TLS_TAG_LEN 16 +// The following are legacy aliases for AEAD |EVP_CIPHER_CTX_ctrl| values. +#define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED + #define EVP_MAX_KEY_LENGTH 64 #define EVP_MAX_IV_LENGTH 16 #define EVP_MAX_BLOCK_LENGTH 32 @@ -563,7 +593,7 @@ struct evp_cipher_st { #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EVP_CIPHER_CTX, EVP_CIPHER_CTX_free) @@ -571,7 +601,7 @@ using ScopedEVP_CIPHER_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.back new file mode 100644 index 000000000..d22a6c216 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.back @@ -0,0 +1,638 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_CIPHER_H +#define OPENSSL_HEADER_CIPHER_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Ciphers. + + +// Cipher primitives. +// +// The following functions return |EVP_CIPHER| objects that implement the named +// cipher algorithm. + +OPENSSL_EXPORT const EVP_CIPHER *EVP_rc4(void); + +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_cbc(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ecb(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede_cbc(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_cbc(void); + +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_ecb(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cbc(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_ctr(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_ofb(void); + +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_ecb(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cbc(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_ctr(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_ofb(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_xts(void); + +// EVP_enc_null returns a 'cipher' that passes plaintext through as +// ciphertext. +OPENSSL_EXPORT const EVP_CIPHER *EVP_enc_null(void); + +// EVP_rc2_cbc returns a cipher that implements 128-bit RC2 in CBC mode. +OPENSSL_EXPORT const EVP_CIPHER *EVP_rc2_cbc(void); + +// EVP_rc2_40_cbc returns a cipher that implements 40-bit RC2 in CBC mode. This +// is obviously very, very weak and is included only in order to read PKCS#12 +// files, which often encrypt the certificate chain using this cipher. It is +// deliberately not exported. +const EVP_CIPHER *EVP_rc2_40_cbc(void); + +// EVP_get_cipherbynid returns the cipher corresponding to the given NID, or +// NULL if no such cipher is known. +OPENSSL_EXPORT const EVP_CIPHER *EVP_get_cipherbynid(int nid); + + +// Cipher context allocation. +// +// An |EVP_CIPHER_CTX| represents the state of an encryption or decryption in +// progress. + +// EVP_CIPHER_CTX_init initialises an, already allocated, |EVP_CIPHER_CTX|. +OPENSSL_EXPORT void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_new allocates a fresh |EVP_CIPHER_CTX|, calls +// |EVP_CIPHER_CTX_init| and returns it, or NULL on allocation failure. +OPENSSL_EXPORT EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); + +// EVP_CIPHER_CTX_cleanup frees any memory referenced by |ctx|. It returns +// one. +OPENSSL_EXPORT int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_free calls |EVP_CIPHER_CTX_cleanup| on |ctx| and then frees +// |ctx| itself. +OPENSSL_EXPORT void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_copy sets |out| to be a duplicate of the current state of +// |in|. The |out| argument must have been previously initialised. +OPENSSL_EXPORT int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, + const EVP_CIPHER_CTX *in); + +// EVP_CIPHER_CTX_reset calls |EVP_CIPHER_CTX_cleanup| followed by +// |EVP_CIPHER_CTX_init| and returns one. +OPENSSL_EXPORT int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); + + +// Cipher context configuration. + +// EVP_CipherInit_ex configures |ctx| for a fresh encryption (or decryption, if +// |enc| is zero) operation using |cipher|. If |ctx| has been previously +// configured with a cipher then |cipher|, |key| and |iv| may be |NULL| and +// |enc| may be -1 to reuse the previous values. The operation will use |key| +// as the key and |iv| as the IV (if any). These should have the correct +// lengths given by |EVP_CIPHER_key_length| and |EVP_CIPHER_iv_length|. It +// returns one on success and zero on error. +OPENSSL_EXPORT int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, ENGINE *engine, + const uint8_t *key, const uint8_t *iv, + int enc); + +// EVP_EncryptInit_ex calls |EVP_CipherInit_ex| with |enc| equal to one. +OPENSSL_EXPORT int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, ENGINE *impl, + const uint8_t *key, const uint8_t *iv); + +// EVP_DecryptInit_ex calls |EVP_CipherInit_ex| with |enc| equal to zero. +OPENSSL_EXPORT int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, ENGINE *impl, + const uint8_t *key, const uint8_t *iv); + + +// Cipher operations. + +// EVP_EncryptUpdate encrypts |in_len| bytes from |in| to |out|. The number +// of output bytes may be up to |in_len| plus the block length minus one and +// |out| must have sufficient space. The number of bytes actually output is +// written to |*out_len|. It returns one on success and zero otherwise. +OPENSSL_EXPORT int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, + int *out_len, const uint8_t *in, + int in_len); + +// EVP_EncryptFinal_ex writes at most a block of ciphertext to |out| and sets +// |*out_len| to the number of bytes written. If padding is enabled (the +// default) then standard padding is applied to create the final block. If +// padding is disabled (with |EVP_CIPHER_CTX_set_padding|) then any partial +// block remaining will cause an error. The function returns one on success and +// zero otherwise. +OPENSSL_EXPORT int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, uint8_t *out, + int *out_len); + +// EVP_DecryptUpdate decrypts |in_len| bytes from |in| to |out|. The number of +// output bytes may be up to |in_len| plus the block length minus one and |out| +// must have sufficient space. The number of bytes actually output is written +// to |*out_len|. It returns one on success and zero otherwise. +OPENSSL_EXPORT int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, + int *out_len, const uint8_t *in, + int in_len); + +// EVP_DecryptFinal_ex writes at most a block of ciphertext to |out| and sets +// |*out_len| to the number of bytes written. If padding is enabled (the +// default) then padding is removed from the final block. +// +// WARNING: it is unsafe to call this function with unauthenticated +// ciphertext if padding is enabled. +OPENSSL_EXPORT int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, + int *out_len); + +// EVP_Cipher performs a one-shot encryption/decryption operation. No partial +// blocks are maintained between calls. However, any internal cipher state is +// still updated. For CBC-mode ciphers, the IV is updated to the final +// ciphertext block. For stream ciphers, the stream is advanced past the bytes +// used. It returns one on success and zero otherwise, unless |EVP_CIPHER_flags| +// has |EVP_CIPH_FLAG_CUSTOM_CIPHER| set. Then it returns the number of bytes +// written or -1 on error. +// +// WARNING: this differs from the usual return value convention when using +// |EVP_CIPH_FLAG_CUSTOM_CIPHER|. +// +// TODO(davidben): The normal ciphers currently never fail, even if, e.g., +// |in_len| is not a multiple of the block size for CBC-mode decryption. The +// input just gets rounded up while the output gets truncated. This should +// either be officially documented or fail. +OPENSSL_EXPORT int EVP_Cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, + const uint8_t *in, size_t in_len); + +// EVP_CipherUpdate calls either |EVP_EncryptUpdate| or |EVP_DecryptUpdate| +// depending on how |ctx| has been setup. +OPENSSL_EXPORT int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, uint8_t *out, + int *out_len, const uint8_t *in, + int in_len); + +// EVP_CipherFinal_ex calls either |EVP_EncryptFinal_ex| or +// |EVP_DecryptFinal_ex| depending on how |ctx| has been setup. +OPENSSL_EXPORT int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, uint8_t *out, + int *out_len); + + +// Cipher context accessors. + +// EVP_CIPHER_CTX_cipher returns the |EVP_CIPHER| underlying |ctx|, or NULL if +// none has been set. +OPENSSL_EXPORT const EVP_CIPHER *EVP_CIPHER_CTX_cipher( + const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_nid returns a NID identifying the |EVP_CIPHER| underlying +// |ctx| (e.g. |NID_aes_128_gcm|). It will crash if no cipher has been +// configured. +OPENSSL_EXPORT int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_encrypting returns one if |ctx| is configured for encryption +// and zero otherwise. +OPENSSL_EXPORT int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_block_size returns the block size, in bytes, of the cipher +// underlying |ctx|, or one if the cipher is a stream cipher. It will crash if +// no cipher has been configured. +OPENSSL_EXPORT unsigned EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_key_length returns the key size, in bytes, of the cipher +// underlying |ctx| or zero if no cipher has been configured. +OPENSSL_EXPORT unsigned EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_iv_length returns the IV size, in bytes, of the cipher +// underlying |ctx|. It will crash if no cipher has been configured. +OPENSSL_EXPORT unsigned EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_get_app_data returns the opaque, application data pointer for +// |ctx|, or NULL if none has been set. +OPENSSL_EXPORT void *EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_set_app_data sets the opaque, application data pointer for +// |ctx| to |data|. +OPENSSL_EXPORT void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, + void *data); + +// EVP_CIPHER_CTX_flags returns a value which is the OR of zero or more +// |EVP_CIPH_*| flags. It will crash if no cipher has been configured. +OPENSSL_EXPORT uint32_t EVP_CIPHER_CTX_flags(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_mode returns one of the |EVP_CIPH_*| cipher mode values +// enumerated below. It will crash if no cipher has been configured. +OPENSSL_EXPORT uint32_t EVP_CIPHER_CTX_mode(const EVP_CIPHER_CTX *ctx); + +// EVP_CIPHER_CTX_ctrl is an |ioctl| like function. The |command| argument +// should be one of the |EVP_CTRL_*| values. The |arg| and |ptr| arguments are +// specific to the command in question. +OPENSSL_EXPORT int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int command, + int arg, void *ptr); + +// EVP_CIPHER_CTX_set_padding sets whether padding is enabled for |ctx| and +// returns one. Pass a non-zero |pad| to enable padding (the default) or zero +// to disable. +OPENSSL_EXPORT int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *ctx, int pad); + +// EVP_CIPHER_CTX_set_key_length sets the key length for |ctx|. This is only +// valid for ciphers that can take a variable length key. It returns one on +// success and zero on error. +OPENSSL_EXPORT int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *ctx, + unsigned key_len); + + +// Cipher accessors. + +// EVP_CIPHER_nid returns a NID identifying |cipher|. (For example, +// |NID_aes_128_gcm|.) +OPENSSL_EXPORT int EVP_CIPHER_nid(const EVP_CIPHER *cipher); + +// EVP_CIPHER_block_size returns the block size, in bytes, for |cipher|, or one +// if |cipher| is a stream cipher. +OPENSSL_EXPORT unsigned EVP_CIPHER_block_size(const EVP_CIPHER *cipher); + +// EVP_CIPHER_key_length returns the key size, in bytes, for |cipher|. If +// |cipher| can take a variable key length then this function returns the +// default key length and |EVP_CIPHER_flags| will return a value with +// |EVP_CIPH_VARIABLE_LENGTH| set. +OPENSSL_EXPORT unsigned EVP_CIPHER_key_length(const EVP_CIPHER *cipher); + +// EVP_CIPHER_iv_length returns the IV size, in bytes, of |cipher|, or zero if +// |cipher| doesn't take an IV. +OPENSSL_EXPORT unsigned EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); + +// EVP_CIPHER_flags returns a value which is the OR of zero or more +// |EVP_CIPH_*| flags. +OPENSSL_EXPORT uint32_t EVP_CIPHER_flags(const EVP_CIPHER *cipher); + +// EVP_CIPHER_mode returns one of the cipher mode values enumerated below. +OPENSSL_EXPORT uint32_t EVP_CIPHER_mode(const EVP_CIPHER *cipher); + + +// Key derivation. + +// EVP_BytesToKey generates a key and IV for the cipher |type| by iterating +// |md| |count| times using |data| and |salt|. On entry, the |key| and |iv| +// buffers must have enough space to hold a key and IV for |type|. It returns +// the length of the key on success or zero on error. +OPENSSL_EXPORT int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, + const uint8_t *salt, const uint8_t *data, + size_t data_len, unsigned count, uint8_t *key, + uint8_t *iv); + + +// Cipher modes (for |EVP_CIPHER_mode|). + +#define EVP_CIPH_STREAM_CIPHER 0x0 +#define EVP_CIPH_ECB_MODE 0x1 +#define EVP_CIPH_CBC_MODE 0x2 +#define EVP_CIPH_CFB_MODE 0x3 +#define EVP_CIPH_OFB_MODE 0x4 +#define EVP_CIPH_CTR_MODE 0x5 +#define EVP_CIPH_GCM_MODE 0x6 +#define EVP_CIPH_XTS_MODE 0x7 + + +// Cipher flags (for |EVP_CIPHER_flags|). + +// EVP_CIPH_VARIABLE_LENGTH indicates that the cipher takes a variable length +// key. +#define EVP_CIPH_VARIABLE_LENGTH 0x40 + +// EVP_CIPH_ALWAYS_CALL_INIT indicates that the |init| function for the cipher +// should always be called when initialising a new operation, even if the key +// is NULL to indicate that the same key is being used. +#define EVP_CIPH_ALWAYS_CALL_INIT 0x80 + +// EVP_CIPH_CUSTOM_IV indicates that the cipher manages the IV itself rather +// than keeping it in the |iv| member of |EVP_CIPHER_CTX|. +#define EVP_CIPH_CUSTOM_IV 0x100 + +// EVP_CIPH_CTRL_INIT indicates that EVP_CTRL_INIT should be used when +// initialising an |EVP_CIPHER_CTX|. +#define EVP_CIPH_CTRL_INIT 0x200 + +// EVP_CIPH_FLAG_CUSTOM_CIPHER indicates that the cipher manages blocking +// itself. This causes EVP_(En|De)crypt_ex to be simple wrapper functions. +#define EVP_CIPH_FLAG_CUSTOM_CIPHER 0x400 + +// EVP_CIPH_FLAG_AEAD_CIPHER specifies that the cipher is an AEAD. This is an +// older version of the proper AEAD interface. See aead.h for the current +// one. +#define EVP_CIPH_FLAG_AEAD_CIPHER 0x800 + +// EVP_CIPH_CUSTOM_COPY indicates that the |ctrl| callback should be called +// with |EVP_CTRL_COPY| at the end of normal |EVP_CIPHER_CTX_copy| +// processing. +#define EVP_CIPH_CUSTOM_COPY 0x1000 + + +// Deprecated functions + +// EVP_CipherInit acts like EVP_CipherInit_ex except that |EVP_CIPHER_CTX_init| +// is called on |cipher| first, if |cipher| is not NULL. +OPENSSL_EXPORT int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, + const uint8_t *key, const uint8_t *iv, + int enc); + +// EVP_EncryptInit calls |EVP_CipherInit| with |enc| equal to one. +OPENSSL_EXPORT int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, const uint8_t *key, + const uint8_t *iv); + +// EVP_DecryptInit calls |EVP_CipherInit| with |enc| equal to zero. +OPENSSL_EXPORT int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, + const EVP_CIPHER *cipher, const uint8_t *key, + const uint8_t *iv); + +// EVP_add_cipher_alias does nothing and returns one. +OPENSSL_EXPORT int EVP_add_cipher_alias(const char *a, const char *b); + +// EVP_get_cipherbyname returns an |EVP_CIPHER| given a human readable name in +// |name|, or NULL if the name is unknown. +OPENSSL_EXPORT const EVP_CIPHER *EVP_get_cipherbyname(const char *name); + +// These AEADs are deprecated AES-GCM implementations that set +// |EVP_CIPH_FLAG_CUSTOM_CIPHER|. Use |EVP_aead_aes_128_gcm| and +// |EVP_aead_aes_256_gcm| instead. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_gcm(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_gcm(void); + +// These are deprecated, 192-bit version of AES. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ecb(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_cbc(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ctr(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_gcm(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ofb(void); + +// EVP_des_ede3_ecb is an alias for |EVP_des_ede3|. Use the former instead. +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void); + +// EVP_aes_128_cfb128 is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void); + +// EVP_aes_256_cfb128 is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cfb128(void); + +// EVP_bf_ecb is Blowfish in ECB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_ecb(void); + +// EVP_bf_cbc is Blowfish in CBC mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_cbc(void); + +// EVP_bf_cfb is Blowfish in 64-bit CFB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_cfb(void); + +// EVP_cast5_ecb is CAST5 in ECB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_cast5_ecb(void); + +// EVP_cast5_cbc is CAST5 in CBC mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_cast5_cbc(void); + +// The following flags do nothing and are included only to make it easier to +// compile code with BoringSSL. +#define EVP_CIPH_CCM_MODE (-1) +#define EVP_CIPH_OCB_MODE (-2) +#define EVP_CIPH_WRAP_MODE (-3) +#define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0 + +// EVP_CIPHER_CTX_set_flags does nothing. +OPENSSL_EXPORT void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, + uint32_t flags); + + +// Private functions. + +// EVP_CIPH_NO_PADDING disables padding in block ciphers. +#define EVP_CIPH_NO_PADDING 0x800 + +// The following are |EVP_CIPHER_CTX_ctrl| commands. +#define EVP_CTRL_INIT 0x0 +#define EVP_CTRL_SET_KEY_LENGTH 0x1 +#define EVP_CTRL_GET_RC2_KEY_BITS 0x2 +#define EVP_CTRL_SET_RC2_KEY_BITS 0x3 +#define EVP_CTRL_GET_RC5_ROUNDS 0x4 +#define EVP_CTRL_SET_RC5_ROUNDS 0x5 +#define EVP_CTRL_RAND_KEY 0x6 +#define EVP_CTRL_PBE_PRF_NID 0x7 +#define EVP_CTRL_COPY 0x8 +#define EVP_CTRL_AEAD_SET_IVLEN 0x9 +#define EVP_CTRL_AEAD_GET_TAG 0x10 +#define EVP_CTRL_AEAD_SET_TAG 0x11 +#define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 +#define EVP_CTRL_GCM_IV_GEN 0x13 +#define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 +// EVP_CTRL_GCM_SET_IV_INV sets the GCM invocation field, decrypt only +#define EVP_CTRL_GCM_SET_IV_INV 0x18 + +// The following constants are unused. +#define EVP_GCM_TLS_FIXED_IV_LEN 4 +#define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 +#define EVP_GCM_TLS_TAG_LEN 16 + +// The following are legacy aliases for AEAD |EVP_CIPHER_CTX_ctrl| values. +#define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED + +#define EVP_MAX_KEY_LENGTH 64 +#define EVP_MAX_IV_LENGTH 16 +#define EVP_MAX_BLOCK_LENGTH 32 + +struct evp_cipher_ctx_st { + // cipher contains the underlying cipher for this context. + const EVP_CIPHER *cipher; + + // app_data is a pointer to opaque, user data. + void *app_data; // application stuff + + // cipher_data points to the |cipher| specific state. + void *cipher_data; + + // key_len contains the length of the key, which may differ from + // |cipher->key_len| if the cipher can take a variable key length. + unsigned key_len; + + // encrypt is one if encrypting and zero if decrypting. + int encrypt; + + // flags contains the OR of zero or more |EVP_CIPH_*| flags, above. + uint32_t flags; + + // oiv contains the original IV value. + uint8_t oiv[EVP_MAX_IV_LENGTH]; + + // iv contains the current IV value, which may have been updated. + uint8_t iv[EVP_MAX_IV_LENGTH]; + + // buf contains a partial block which is used by, for example, CTR mode to + // store unused keystream bytes. + uint8_t buf[EVP_MAX_BLOCK_LENGTH]; + + // buf_len contains the number of bytes of a partial block contained in + // |buf|. + int buf_len; + + // num contains the number of bytes of |iv| which are valid for modes that + // manage partial blocks themselves. + unsigned num; + + // final_used is non-zero if the |final| buffer contains plaintext. + int final_used; + + // block_mask contains |cipher->block_size| minus one. (The block size + // assumed to be a power of two.) + int block_mask; + + uint8_t final[EVP_MAX_BLOCK_LENGTH]; // possible final block +} /* EVP_CIPHER_CTX */; + +typedef struct evp_cipher_info_st { + const EVP_CIPHER *cipher; + unsigned char iv[EVP_MAX_IV_LENGTH]; +} EVP_CIPHER_INFO; + +struct evp_cipher_st { + // type contains a NID identifing the cipher. (e.g. NID_aes_128_gcm.) + int nid; + + // block_size contains the block size, in bytes, of the cipher, or 1 for a + // stream cipher. + unsigned block_size; + + // key_len contains the key size, in bytes, for the cipher. If the cipher + // takes a variable key size then this contains the default size. + unsigned key_len; + + // iv_len contains the IV size, in bytes, or zero if inapplicable. + unsigned iv_len; + + // ctx_size contains the size, in bytes, of the per-key context for this + // cipher. + unsigned ctx_size; + + // flags contains the OR of a number of flags. See |EVP_CIPH_*|. + uint32_t flags; + + // app_data is a pointer to opaque, user data. + void *app_data; + + int (*init)(EVP_CIPHER_CTX *ctx, const uint8_t *key, const uint8_t *iv, + int enc); + + int (*cipher)(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in, + size_t inl); + + // cleanup, if non-NULL, releases memory associated with the context. It is + // called if |EVP_CTRL_INIT| succeeds. Note that |init| may not have been + // called at this point. + void (*cleanup)(EVP_CIPHER_CTX *); + + int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); +}; + + +#if defined(__cplusplus) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(EVP_CIPHER_CTX, EVP_CIPHER_CTX_free) + +using ScopedEVP_CIPHER_CTX = + internal::StackAllocated; + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif + +#define CIPHER_R_AES_KEY_SETUP_FAILED 100 +#define CIPHER_R_BAD_DECRYPT 101 +#define CIPHER_R_BAD_KEY_LENGTH 102 +#define CIPHER_R_BUFFER_TOO_SMALL 103 +#define CIPHER_R_CTRL_NOT_IMPLEMENTED 104 +#define CIPHER_R_CTRL_OPERATION_NOT_IMPLEMENTED 105 +#define CIPHER_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH 106 +#define CIPHER_R_INITIALIZATION_ERROR 107 +#define CIPHER_R_INPUT_NOT_INITIALIZED 108 +#define CIPHER_R_INVALID_AD_SIZE 109 +#define CIPHER_R_INVALID_KEY_LENGTH 110 +#define CIPHER_R_INVALID_NONCE_SIZE 111 +#define CIPHER_R_INVALID_OPERATION 112 +#define CIPHER_R_IV_TOO_LARGE 113 +#define CIPHER_R_NO_CIPHER_SET 114 +#define CIPHER_R_OUTPUT_ALIASES_INPUT 115 +#define CIPHER_R_TAG_TOO_LARGE 116 +#define CIPHER_R_TOO_LARGE 117 +#define CIPHER_R_UNSUPPORTED_AD_SIZE 118 +#define CIPHER_R_UNSUPPORTED_INPUT_SIZE 119 +#define CIPHER_R_UNSUPPORTED_KEY_SIZE 120 +#define CIPHER_R_UNSUPPORTED_NONCE_SIZE 121 +#define CIPHER_R_UNSUPPORTED_TAG_SIZE 122 +#define CIPHER_R_WRONG_FINAL_BLOCK_LENGTH 123 +#define CIPHER_R_NO_DIRECTION_SET 124 +#define CIPHER_R_INVALID_NONCE 125 + +#endif // OPENSSL_HEADER_CIPHER_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/cipher.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/cipher.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.grpc_back index 643bf040e..d22a6c216 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cipher.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cipher.h.grpc_back @@ -136,8 +136,8 @@ OPENSSL_EXPORT int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in); // EVP_CIPHER_CTX_reset calls |EVP_CIPHER_CTX_cleanup| followed by -// |EVP_CIPHER_CTX_init|. -OPENSSL_EXPORT void EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); +// |EVP_CIPHER_CTX_init| and returns one. +OPENSSL_EXPORT int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx); // Cipher context configuration. @@ -243,6 +243,10 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_CIPHER_CTX_cipher( // configured. OPENSSL_EXPORT int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); +// EVP_CIPHER_CTX_encrypting returns one if |ctx| is configured for encryption +// and zero otherwise. +OPENSSL_EXPORT int EVP_CIPHER_CTX_encrypting(const EVP_CIPHER_CTX *ctx); + // EVP_CIPHER_CTX_block_size returns the block size, in bytes, of the cipher // underlying |ctx|, or one if the cipher is a stream cipher. It will crash if // no cipher has been configured. @@ -413,14 +417,37 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ecb(void); OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_cbc(void); OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ctr(void); OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_gcm(void); +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_192_ofb(void); + +// EVP_des_ede3_ecb is an alias for |EVP_des_ede3|. Use the former instead. +OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void); // EVP_aes_128_cfb128 is only available in decrepit. OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void); +// EVP_aes_256_cfb128 is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_256_cfb128(void); + +// EVP_bf_ecb is Blowfish in ECB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_ecb(void); + +// EVP_bf_cbc is Blowfish in CBC mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_cbc(void); + +// EVP_bf_cfb is Blowfish in 64-bit CFB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_bf_cfb(void); + +// EVP_cast5_ecb is CAST5 in ECB mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_cast5_ecb(void); + +// EVP_cast5_cbc is CAST5 in CBC mode and is only available in decrepit. +OPENSSL_EXPORT const EVP_CIPHER *EVP_cast5_cbc(void); + // The following flags do nothing and are included only to make it easier to // compile code with BoringSSL. -#define EVP_CIPH_CCM_MODE 0 -#define EVP_CIPH_WRAP_MODE 0 +#define EVP_CIPH_CCM_MODE (-1) +#define EVP_CIPH_OCB_MODE (-2) +#define EVP_CIPH_WRAP_MODE (-3) #define EVP_CIPHER_CTX_FLAG_WRAP_ALLOW 0 // EVP_CIPHER_CTX_set_flags does nothing. @@ -433,7 +460,7 @@ OPENSSL_EXPORT void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, // EVP_CIPH_NO_PADDING disables padding in block ciphers. #define EVP_CIPH_NO_PADDING 0x800 -// EVP_CIPHER_CTX_ctrl commands. +// The following are |EVP_CIPHER_CTX_ctrl| commands. #define EVP_CTRL_INIT 0x0 #define EVP_CTRL_SET_KEY_LENGTH 0x1 #define EVP_CTRL_GET_RC2_KEY_BITS 0x2 @@ -443,23 +470,26 @@ OPENSSL_EXPORT void EVP_CIPHER_CTX_set_flags(const EVP_CIPHER_CTX *ctx, #define EVP_CTRL_RAND_KEY 0x6 #define EVP_CTRL_PBE_PRF_NID 0x7 #define EVP_CTRL_COPY 0x8 -#define EVP_CTRL_GCM_SET_IVLEN 0x9 -#define EVP_CTRL_GCM_GET_TAG 0x10 -#define EVP_CTRL_GCM_SET_TAG 0x11 -#define EVP_CTRL_GCM_SET_IV_FIXED 0x12 +#define EVP_CTRL_AEAD_SET_IVLEN 0x9 +#define EVP_CTRL_AEAD_GET_TAG 0x10 +#define EVP_CTRL_AEAD_SET_TAG 0x11 +#define EVP_CTRL_AEAD_SET_IV_FIXED 0x12 #define EVP_CTRL_GCM_IV_GEN 0x13 #define EVP_CTRL_AEAD_SET_MAC_KEY 0x17 -// Set the GCM invocation field, decrypt only +// EVP_CTRL_GCM_SET_IV_INV sets the GCM invocation field, decrypt only #define EVP_CTRL_GCM_SET_IV_INV 0x18 -// GCM TLS constants -// Length of fixed part of IV derived from PRF +// The following constants are unused. #define EVP_GCM_TLS_FIXED_IV_LEN 4 -// Length of explicit part of IV part of TLS records #define EVP_GCM_TLS_EXPLICIT_IV_LEN 8 -// Length of tag for TLS #define EVP_GCM_TLS_TAG_LEN 16 +// The following are legacy aliases for AEAD |EVP_CIPHER_CTX_ctrl| values. +#define EVP_CTRL_GCM_SET_IVLEN EVP_CTRL_AEAD_SET_IVLEN +#define EVP_CTRL_GCM_GET_TAG EVP_CTRL_AEAD_GET_TAG +#define EVP_CTRL_GCM_SET_TAG EVP_CTRL_AEAD_SET_TAG +#define EVP_CTRL_GCM_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED + #define EVP_MAX_KEY_LENGTH 64 #define EVP_MAX_IV_LENGTH 16 #define EVP_MAX_BLOCK_LENGTH 32 @@ -563,7 +593,7 @@ struct evp_cipher_st { #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EVP_CIPHER_CTX, EVP_CIPHER_CTX_free) @@ -571,7 +601,7 @@ using ScopedEVP_CIPHER_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/cmac.h b/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/cmac.h rename to Pods/BoringSSL-GRPC/src/include/openssl/cmac.h index 48e73f50b..4c2236020 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cmac.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h @@ -46,6 +46,10 @@ OPENSSL_EXPORT CMAC_CTX *CMAC_CTX_new(void); // CMAC_CTX_free frees a |CMAC_CTX|. OPENSSL_EXPORT void CMAC_CTX_free(CMAC_CTX *ctx); +// CMAC_CTX_copy sets |out| to be a duplicate of the current state |in|. It +// returns one on success and zero on error. +OPENSSL_EXPORT int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); + // CMAC_Init configures |ctx| to use the given |key| and |cipher|. The CMAC RFC // only specifies the use of AES-128 thus |key_len| should be 16 and |cipher| // should be |EVP_aes_128_cbc()|. However, this implementation also supports @@ -74,11 +78,11 @@ OPENSSL_EXPORT int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(CMAC_CTX, CMAC_CTX_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.back new file mode 100644 index 000000000..3e8cf929b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.back @@ -0,0 +1,91 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CMAC_H +#define OPENSSL_HEADER_CMAC_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// CMAC. +// +// CMAC is a MAC based on AES-CBC and defined in +// https://tools.ietf.org/html/rfc4493#section-2.3. + + +// One-shot functions. + +// AES_CMAC calculates the 16-byte, CMAC authenticator of |in_len| bytes of +// |in| and writes it to |out|. The |key_len| may be 16 or 32 bytes to select +// between AES-128 and AES-256. It returns one on success or zero on error. +OPENSSL_EXPORT int AES_CMAC(uint8_t out[16], const uint8_t *key, size_t key_len, + const uint8_t *in, size_t in_len); + + +// Incremental interface. + +// CMAC_CTX_new allocates a fresh |CMAC_CTX| and returns it, or NULL on +// error. +OPENSSL_EXPORT CMAC_CTX *CMAC_CTX_new(void); + +// CMAC_CTX_free frees a |CMAC_CTX|. +OPENSSL_EXPORT void CMAC_CTX_free(CMAC_CTX *ctx); + +// CMAC_CTX_copy sets |out| to be a duplicate of the current state |in|. It +// returns one on success and zero on error. +OPENSSL_EXPORT int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); + +// CMAC_Init configures |ctx| to use the given |key| and |cipher|. The CMAC RFC +// only specifies the use of AES-128 thus |key_len| should be 16 and |cipher| +// should be |EVP_aes_128_cbc()|. However, this implementation also supports +// AES-256 by setting |key_len| to 32 and |cipher| to |EVP_aes_256_cbc()|. The +// |engine| argument is ignored. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t key_len, + const EVP_CIPHER *cipher, ENGINE *engine); + + +// CMAC_Reset resets |ctx| so that a fresh message can be authenticated. +OPENSSL_EXPORT int CMAC_Reset(CMAC_CTX *ctx); + +// CMAC_Update processes |in_len| bytes of message from |in|. It returns one on +// success or zero on error. +OPENSSL_EXPORT int CMAC_Update(CMAC_CTX *ctx, const uint8_t *in, size_t in_len); + +// CMAC_Final sets |*out_len| to 16 and, if |out| is not NULL, writes 16 bytes +// of authenticator to it. It returns one on success or zero on error. +OPENSSL_EXPORT int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(CMAC_CTX, CMAC_CTX_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#endif // OPENSSL_HEADER_CMAC_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/cmac.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/cmac.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.grpc_back index dfcd37b9f..3e8cf929b 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cmac.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cmac.h.grpc_back @@ -46,6 +46,10 @@ OPENSSL_EXPORT CMAC_CTX *CMAC_CTX_new(void); // CMAC_CTX_free frees a |CMAC_CTX|. OPENSSL_EXPORT void CMAC_CTX_free(CMAC_CTX *ctx); +// CMAC_CTX_copy sets |out| to be a duplicate of the current state |in|. It +// returns one on success and zero on error. +OPENSSL_EXPORT int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in); + // CMAC_Init configures |ctx| to use the given |key| and |cipher|. The CMAC RFC // only specifies the use of AES-128 thus |key_len| should be 16 and |cipher| // should be |EVP_aes_128_cbc()|. However, this implementation also supports @@ -74,11 +78,11 @@ OPENSSL_EXPORT int CMAC_Final(CMAC_CTX *ctx, uint8_t *out, size_t *out_len); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(CMAC_CTX, CMAC_CTX_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/conf.h b/Pods/BoringSSL-GRPC/src/include/openssl/conf.h similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/conf.h rename to Pods/BoringSSL-GRPC/src/include/openssl/conf.h index 922fb9666..30c6c4450 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/conf.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/conf.h @@ -85,11 +85,8 @@ struct conf_value_st { char *value; }; -struct conf_st { - LHASH_OF(CONF_VALUE) *data; -}; - DEFINE_STACK_OF(CONF_VALUE) +DECLARE_LHASH_OF(CONF_VALUE) // NCONF_new returns a fresh, empty |CONF|, or NULL on error. The |method| @@ -162,11 +159,11 @@ OPENSSL_EXPORT void OPENSSL_no_config(void); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(CONF, NCONF_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.back new file mode 100644 index 000000000..ae718699e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.back @@ -0,0 +1,180 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_CONF_H +#define OPENSSL_HEADER_CONF_H + +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Config files look like: +// +// # Comment +// +// # This key is in the default section. +// key=value +// +// [section_name] +// key2=value2 +// +// Config files are represented by a |CONF|. + +struct conf_value_st { + char *section; + char *name; + char *value; +}; + +DEFINE_STACK_OF(CONF_VALUE) +DECLARE_LHASH_OF(CONF_VALUE) + + +// NCONF_new returns a fresh, empty |CONF|, or NULL on error. The |method| +// argument must be NULL. +OPENSSL_EXPORT CONF *NCONF_new(void *method); + +// NCONF_free frees all the data owned by |conf| and then |conf| itself. +OPENSSL_EXPORT void NCONF_free(CONF *conf); + +// NCONF_load parses the file named |filename| and adds the values found to +// |conf|. It returns one on success and zero on error. In the event of an +// error, if |out_error_line| is not NULL, |*out_error_line| is set to the +// number of the line that contained the error. +int NCONF_load(CONF *conf, const char *filename, long *out_error_line); + +// NCONF_load_bio acts like |NCONF_load| but reads from |bio| rather than from +// a named file. +int NCONF_load_bio(CONF *conf, BIO *bio, long *out_error_line); + +// NCONF_get_section returns a stack of values for a given section in |conf|. +// If |section| is NULL, the default section is returned. It returns NULL on +// error. +STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf, const char *section); + +// NCONF_get_string returns the value of the key |name|, in section |section|. +// The |section| argument may be NULL to indicate the default section. It +// returns the value or NULL on error. +const char *NCONF_get_string(const CONF *conf, const char *section, + const char *name); + + +// Utility functions + +// CONF_parse_list takes a list separated by 'sep' and calls |list_cb| giving +// the start and length of each member, optionally stripping leading and +// trailing whitespace. This can be used to parse comma separated lists for +// example. If |list_cb| returns <= 0, then the iteration is halted and that +// value is returned immediately. Otherwise it returns one. Note that |list_cb| +// may be called on an empty member. +int CONF_parse_list(const char *list, char sep, int remove_whitespace, + int (*list_cb)(const char *elem, int len, void *usr), + void *arg); + + +// Deprecated functions + +// These defines do nothing but are provided to make old code easier to +// compile. +#define CONF_MFLAGS_DEFAULT_SECTION 0 +#define CONF_MFLAGS_IGNORE_MISSING_FILE 0 + +// CONF_modules_load_file returns one. BoringSSL is defined to have no config +// file options, thus loading from |filename| always succeeds by doing nothing. +OPENSSL_EXPORT int CONF_modules_load_file(const char *filename, + const char *appname, + unsigned long flags); + +// CONF_modules_free does nothing. +OPENSSL_EXPORT void CONF_modules_free(void); + +// OPENSSL_config does nothing. +OPENSSL_EXPORT void OPENSSL_config(const char *config_name); + +// OPENSSL_no_config does nothing. +OPENSSL_EXPORT void OPENSSL_no_config(void); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(CONF, NCONF_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define CONF_R_LIST_CANNOT_BE_NULL 100 +#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 101 +#define CONF_R_MISSING_EQUAL_SIGN 102 +#define CONF_R_NO_CLOSE_BRACE 103 +#define CONF_R_UNABLE_TO_CREATE_NEW_SECTION 104 +#define CONF_R_VARIABLE_HAS_NO_VALUE 105 +#define CONF_R_VARIABLE_EXPANSION_TOO_LONG 106 + +#endif // OPENSSL_HEADER_THREAD_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/conf.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/conf.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/conf.h.grpc_back index 4ffce378a..ae718699e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/conf.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/conf.h.grpc_back @@ -85,11 +85,8 @@ struct conf_value_st { char *value; }; -struct conf_st { - LHASH_OF(CONF_VALUE) *data; -}; - DEFINE_STACK_OF(CONF_VALUE) +DECLARE_LHASH_OF(CONF_VALUE) // NCONF_new returns a fresh, empty |CONF|, or NULL on error. The |method| @@ -162,11 +159,11 @@ OPENSSL_EXPORT void OPENSSL_no_config(void); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(CONF, NCONF_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h b/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h new file mode 100644 index 000000000..fc8deef0f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h @@ -0,0 +1,212 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_CPU_H +#define OPENSSL_HEADER_CPU_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Runtime CPU feature support + + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +// OPENSSL_ia32cap_P contains the Intel CPUID bits when running on an x86 or +// x86-64 system. +// +// Index 0: +// EDX for CPUID where EAX = 1 +// Bit 20 is always zero +// Bit 28 is adjusted to reflect whether the data cache is shared between +// multiple logical cores +// Bit 30 is used to indicate an Intel CPU +// Index 1: +// ECX for CPUID where EAX = 1 +// Bit 11 is used to indicate AMD XOP support, not SDBG +// Index 2: +// EBX for CPUID where EAX = 7 +// Index 3: +// ECX for CPUID where EAX = 7 +// +// Note: the CPUID bits are pre-adjusted for the OSXSAVE bit and the YMM and XMM +// bits in XCR0, so it is not necessary to check those. +extern uint32_t OPENSSL_ia32cap_P[4]; + +#if defined(BORINGSSL_FIPS) && !defined(BORINGSSL_SHARED_LIBRARY) +const uint32_t *OPENSSL_ia32cap_get(void); +#else +OPENSSL_INLINE const uint32_t *OPENSSL_ia32cap_get(void) { + return OPENSSL_ia32cap_P; +} +#endif + +#endif + +#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + +#if defined(OPENSSL_APPLE) +// iOS builds use the static ARM configuration. +#define OPENSSL_STATIC_ARMCAP +#endif + +#if !defined(OPENSSL_STATIC_ARMCAP) + +// CRYPTO_is_NEON_capable_at_runtime returns true if the current CPU has a NEON +// unit. Note that |OPENSSL_armcap_P| also exists and contains the same +// information in a form that's easier for assembly to use. +OPENSSL_EXPORT char CRYPTO_is_NEON_capable_at_runtime(void); + +// CRYPTO_is_NEON_capable returns true if the current CPU has a NEON unit. If +// this is known statically then it returns one immediately. +OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) { + // Only statically skip the runtime lookup on aarch64. On arm, one CPU is + // known to have a broken NEON unit which is known to fail with on some + // hand-written NEON assembly. For now, continue to apply the workaround even + // when the compiler is instructed to freely emit NEON code. See + // https://crbug.com/341598 and https://crbug.com/606629. +#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && !defined(OPENSSL_ARM) + return 1; +#else + return CRYPTO_is_NEON_capable_at_runtime(); +#endif +} + +#if defined(OPENSSL_ARM) +// CRYPTO_has_broken_NEON returns one if the current CPU is known to have a +// broken NEON unit. See https://crbug.com/341598. +OPENSSL_EXPORT int CRYPTO_has_broken_NEON(void); + +// CRYPTO_needs_hwcap2_workaround returns one if the ARMv8 AArch32 AT_HWCAP2 +// workaround was needed. See https://crbug.com/boringssl/46. +OPENSSL_EXPORT int CRYPTO_needs_hwcap2_workaround(void); +#endif + +// CRYPTO_is_ARMv8_AES_capable returns true if the current CPU supports the +// ARMv8 AES instruction. +int CRYPTO_is_ARMv8_AES_capable(void); + +// CRYPTO_is_ARMv8_PMULL_capable returns true if the current CPU supports the +// ARMv8 PMULL instruction. +int CRYPTO_is_ARMv8_PMULL_capable(void); + +#else + +OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_NEON) || \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) + return 1; +#else + return 0; +#endif +} + +OPENSSL_INLINE int CRYPTO_is_ARMv8_AES_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO) + return 1; +#else + return 0; +#endif +} + +OPENSSL_INLINE int CRYPTO_is_ARMv8_PMULL_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO) + return 1; +#else + return 0; +#endif +} + +#endif // OPENSSL_STATIC_ARMCAP +#endif // OPENSSL_ARM || OPENSSL_AARCH64 + +#if defined(OPENSSL_PPC64LE) + +// CRYPTO_is_PPC64LE_vcrypto_capable returns true iff the current CPU supports +// the Vector.AES category of instructions. +int CRYPTO_is_PPC64LE_vcrypto_capable(void); + +extern unsigned long OPENSSL_ppc64le_hwcap2; + +#endif // OPENSSL_PPC64LE + +#if defined(BORINGSSL_DISPATCH_TEST) +// Runtime CPU dispatch testing support + +// BORINGSSL_function_hit is an array of flags. The following functions will +// set these flags if BORINGSSL_DISPATCH_TEST is defined. +// 0: aes_hw_ctr32_encrypt_blocks +// 1: aes_hw_encrypt +// 2: aesni_gcm_encrypt +// 3: aes_hw_set_encrypt_key +// 4: vpaes_encrypt +// 5: vpaes_set_encrypt_key +extern uint8_t BORINGSSL_function_hit[7]; +#endif // BORINGSSL_DISPATCH_TEST + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CPU_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.back new file mode 100644 index 000000000..ae5596791 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.back @@ -0,0 +1,212 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_CPU_H +#define OPENSSL_HEADER_CPU_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Runtime CPU feature support + + +#if defined(OPENSSL_X86) || defined(OPENSSL_X86_64) +// OPENSSL_ia32cap_P contains the Intel CPUID bits when running on an x86 or +// x86-64 system. +// +// Index 0: +// EDX for CPUID where EAX = 1 +// Bit 20 is always zero +// Bit 28 is adjusted to reflect whether the data cache is shared between +// multiple logical cores +// Bit 30 is used to indicate an Intel CPU +// Index 1: +// ECX for CPUID where EAX = 1 +// Bit 11 is used to indicate AMD XOP support, not SDBG +// Index 2: +// EBX for CPUID where EAX = 7 +// Index 3: +// ECX for CPUID where EAX = 7 +// +// Note: the CPUID bits are pre-adjusted for the OSXSAVE bit and the YMM and XMM +// bits in XCR0, so it is not necessary to check those. +extern uint32_t OPENSSL_ia32cap_P[4]; + +#if defined(BORINGSSL_FIPS) && !defined(BORINGSSL_SHARED_LIBRARY) +const uint32_t *OPENSSL_ia32cap_get(void); +#else +OPENSSL_INLINE const uint32_t *OPENSSL_ia32cap_get(void) { + return OPENSSL_ia32cap_P; +} +#endif + +#endif + +#if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + +#if defined(OPENSSL_APPLE) +// iOS builds use the static ARM configuration. +#define OPENSSL_STATIC_ARMCAP +#endif + +#if !defined(OPENSSL_STATIC_ARMCAP) + +// CRYPTO_is_NEON_capable_at_runtime returns true if the current CPU has a NEON +// unit. Note that |OPENSSL_armcap_P| also exists and contains the same +// information in a form that's easier for assembly to use. +OPENSSL_EXPORT char CRYPTO_is_NEON_capable_at_runtime(void); + +// CRYPTO_is_NEON_capable returns true if the current CPU has a NEON unit. If +// this is known statically then it returns one immediately. +OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) { + // Only statically skip the runtime lookup on aarch64. On arm, one CPU is + // known to have a broken NEON unit which is known to fail with on some + // hand-written NEON assembly. For now, continue to apply the workaround even + // when the compiler is instructed to freely emit NEON code. See + // https://crbug.com/341598 and https://crbug.com/606629. +#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && !defined(OPENSSL_ARM) + return 1; +#else + return CRYPTO_is_NEON_capable_at_runtime(); +#endif +} + +#if defined(OPENSSL_ARM) +// CRYPTO_has_broken_NEON returns one if the current CPU is known to have a +// broken NEON unit. See https://crbug.com/341598. +OPENSSL_EXPORT int CRYPTO_has_broken_NEON(void); + +// CRYPTO_needs_hwcap2_workaround returns one if the ARMv8 AArch32 AT_HWCAP2 +// workaround was needed. See https://crbug.com/boringssl/46. +OPENSSL_EXPORT int CRYPTO_needs_hwcap2_workaround(void); +#endif + +// CRYPTO_is_ARMv8_AES_capable returns true if the current CPU supports the +// ARMv8 AES instruction. +int CRYPTO_is_ARMv8_AES_capable(void); + +// CRYPTO_is_ARMv8_PMULL_capable returns true if the current CPU supports the +// ARMv8 PMULL instruction. +int CRYPTO_is_ARMv8_PMULL_capable(void); + +#else + +OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_NEON) || \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) + return 1; +#else + return 0; +#endif +} + +OPENSSL_INLINE int CRYPTO_is_ARMv8_AES_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO) + return 1; +#else + return 0; +#endif +} + +OPENSSL_INLINE int CRYPTO_is_ARMv8_PMULL_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO) + return 1; +#else + return 0; +#endif +} + +#endif // OPENSSL_STATIC_ARMCAP +#endif // OPENSSL_ARM || OPENSSL_AARCH64 + +#if defined(OPENSSL_PPC64LE) + +// CRYPTO_is_PPC64LE_vcrypto_capable returns true iff the current CPU supports +// the Vector.AES category of instructions. +int CRYPTO_is_PPC64LE_vcrypto_capable(void); + +extern unsigned long OPENSSL_ppc64le_hwcap2; + +#endif // OPENSSL_PPC64LE + +#if defined(BORINGSSL_DISPATCH_TEST) +// Runtime CPU dispatch testing support + +// BORINGSSL_function_hit is an array of flags. The following functions will +// set these flags if BORINGSSL_DISPATCH_TEST is defined. +// 0: aes_hw_ctr32_encrypt_blocks +// 1: aes_hw_encrypt +// 2: aesni_gcm_encrypt +// 3: aes_hw_set_encrypt_key +// 4: vpaes_encrypt +// 5: vpaes_set_encrypt_key +extern uint8_t BORINGSSL_function_hit[7]; +#endif // BORINGSSL_DISPATCH_TEST + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CPU_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/cpu.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/include/openssl/cpu.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.grpc_back index dd95ddc62..ae5596791 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/cpu.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/cpu.h.grpc_back @@ -86,16 +86,17 @@ extern "C" { // Bit 11 is used to indicate AMD XOP support, not SDBG // Index 2: // EBX for CPUID where EAX = 7 -// Index 3 is set to zero. +// Index 3: +// ECX for CPUID where EAX = 7 // // Note: the CPUID bits are pre-adjusted for the OSXSAVE bit and the YMM and XMM // bits in XCR0, so it is not necessary to check those. extern uint32_t OPENSSL_ia32cap_P[4]; -#if defined(BORINGSSL_FIPS) +#if defined(BORINGSSL_FIPS) && !defined(BORINGSSL_SHARED_LIBRARY) const uint32_t *OPENSSL_ia32cap_get(void); #else -static inline const uint32_t *OPENSSL_ia32cap_get(void) { +OPENSSL_INLINE const uint32_t *OPENSSL_ia32cap_get(void) { return OPENSSL_ia32cap_P; } #endif @@ -118,13 +119,13 @@ OPENSSL_EXPORT char CRYPTO_is_NEON_capable_at_runtime(void); // CRYPTO_is_NEON_capable returns true if the current CPU has a NEON unit. If // this is known statically then it returns one immediately. -static inline int CRYPTO_is_NEON_capable(void) { +OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) { // Only statically skip the runtime lookup on aarch64. On arm, one CPU is // known to have a broken NEON unit which is known to fail with on some // hand-written NEON assembly. For now, continue to apply the workaround even // when the compiler is instructed to freely emit NEON code. See // https://crbug.com/341598 and https://crbug.com/606629. -#if defined(__ARM_NEON__) && !defined(OPENSSL_ARM) +#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && !defined(OPENSSL_ARM) return 1; #else return CRYPTO_is_NEON_capable_at_runtime(); @@ -151,15 +152,16 @@ int CRYPTO_is_ARMv8_PMULL_capable(void); #else -static inline int CRYPTO_is_NEON_capable(void) { -#if defined(OPENSSL_STATIC_ARMCAP_NEON) || defined(__ARM_NEON__) +OPENSSL_INLINE int CRYPTO_is_NEON_capable(void) { +#if defined(OPENSSL_STATIC_ARMCAP_NEON) || \ + (defined(__ARM_NEON__) || defined(__ARM_NEON)) return 1; #else return 0; #endif } -static inline int CRYPTO_is_ARMv8_AES_capable(void) { +OPENSSL_INLINE int CRYPTO_is_ARMv8_AES_capable(void) { #if defined(OPENSSL_STATIC_ARMCAP_AES) || defined(__ARM_FEATURE_CRYPTO) return 1; #else @@ -167,7 +169,7 @@ static inline int CRYPTO_is_ARMv8_AES_capable(void) { #endif } -static inline int CRYPTO_is_ARMv8_PMULL_capable(void) { +OPENSSL_INLINE int CRYPTO_is_ARMv8_PMULL_capable(void) { #if defined(OPENSSL_STATIC_ARMCAP_PMULL) || defined(__ARM_FEATURE_CRYPTO) return 1; #else @@ -188,6 +190,20 @@ extern unsigned long OPENSSL_ppc64le_hwcap2; #endif // OPENSSL_PPC64LE +#if defined(BORINGSSL_DISPATCH_TEST) +// Runtime CPU dispatch testing support + +// BORINGSSL_function_hit is an array of flags. The following functions will +// set these flags if BORINGSSL_DISPATCH_TEST is defined. +// 0: aes_hw_ctr32_encrypt_blocks +// 1: aes_hw_encrypt +// 2: aesni_gcm_encrypt +// 3: aes_hw_set_encrypt_key +// 4: vpaes_encrypt +// 5: vpaes_set_encrypt_key +extern uint8_t BORINGSSL_function_hit[7]; +#endif // BORINGSSL_DISPATCH_TEST + #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/include/openssl/crypto.h b/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h similarity index 77% rename from Pods/BoringSSL-GRPC/include/openssl/crypto.h rename to Pods/BoringSSL-GRPC/src/include/openssl/crypto.h index 3c2b35b20..63120a9d9 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/crypto.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h @@ -16,6 +16,7 @@ #define OPENSSL_HEADER_CRYPTO_H #include +#include // Upstream OpenSSL defines |OPENSSL_malloc|, etc., in crypto.h rather than // mem.h. @@ -58,8 +59,11 @@ OPENSSL_EXPORT int CRYPTO_has_asm(void); // which case it returns one. OPENSSL_EXPORT int FIPS_mode(void); -// BORINGSSL_self_test triggers the FIPS KAT-based self tests. It returns one -// on success and zero on error. +// BORINGSSL_self_test triggers the FIPS KAT-based self tests. It returns one on +// success and zero on error. The argument is the integrity hash of the FIPS +// module and may be used to check and write flag files to suppress duplicate +// self-tests. If it is all zeros, no flag file will be checked nor written and +// tests will always be run. OPENSSL_EXPORT int BORINGSSL_self_test(void); @@ -69,17 +73,25 @@ OPENSSL_EXPORT int BORINGSSL_self_test(void); // “OpenSSL”. node.js requires a version number in this text. #define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0 (compatible; BoringSSL)" -#define SSLEAY_VERSION 0 - -// SSLeay_version is a compatibility function that returns the string -// "BoringSSL". -OPENSSL_EXPORT const char *SSLeay_version(int unused); - #define OPENSSL_VERSION 0 +#define OPENSSL_CFLAGS 1 +#define OPENSSL_BUILT_ON 2 +#define OPENSSL_PLATFORM 3 +#define OPENSSL_DIR 4 // OpenSSL_version is a compatibility function that returns the string -// "BoringSSL". -OPENSSL_EXPORT const char *OpenSSL_version(int unused); +// "BoringSSL" if |which| is |OPENSSL_VERSION| and placeholder strings +// otherwise. +OPENSSL_EXPORT const char *OpenSSL_version(int which); + +#define SSLEAY_VERSION OPENSSL_VERSION +#define SSLEAY_CFLAGS OPENSSL_CFLAGS +#define SSLEAY_BUILT_ON OPENSSL_BUILT_ON +#define SSLEAY_PLATFORM OPENSSL_PLATFORM +#define SSLEAY_DIR OPENSSL_DIR + +// SSLeay_version calls |OpenSSL_version|. +OPENSSL_EXPORT const char *SSLeay_version(int which); // SSLeay is a compatibility function that returns OPENSSL_VERSION_NUMBER from // base.h. @@ -92,6 +104,9 @@ OPENSSL_EXPORT unsigned long OpenSSL_version_num(void); // CRYPTO_malloc_init returns one. OPENSSL_EXPORT int CRYPTO_malloc_init(void); +// OPENSSL_malloc_init returns one. +OPENSSL_EXPORT int OPENSSL_malloc_init(void); + // ENGINE_load_builtin_engines does nothing. OPENSSL_EXPORT void ENGINE_load_builtin_engines(void); @@ -114,6 +129,13 @@ OPENSSL_EXPORT void OPENSSL_load_builtin_modules(void); OPENSSL_EXPORT int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); +// OPENSSL_cleanup does nothing. +OPENSSL_EXPORT void OPENSSL_cleanup(void); + +// FIPS_mode_set returns one if |on| matches whether BoringSSL was built with +// |BORINGSSL_FIPS| and zero otherwise. +OPENSSL_EXPORT int FIPS_mode_set(int on); + #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.back new file mode 100644 index 000000000..6aa661a8b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.back @@ -0,0 +1,144 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CRYPTO_H +#define OPENSSL_HEADER_CRYPTO_H + +#include +#include + +// Upstream OpenSSL defines |OPENSSL_malloc|, etc., in crypto.h rather than +// mem.h. +#include + +// Upstream OpenSSL defines |CRYPTO_LOCK|, etc., in crypto.h rather than +// thread.h. +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +// crypto.h contains functions for initializing the crypto library. + + +// CRYPTO_library_init initializes the crypto library. It must be called if the +// library is built with BORINGSSL_NO_STATIC_INITIALIZER. Otherwise, it does +// nothing and a static initializer is used instead. It is safe to call this +// function multiple times and concurrently from multiple threads. +// +// On some ARM configurations, this function may require filesystem access and +// should be called before entering a sandbox. +OPENSSL_EXPORT void CRYPTO_library_init(void); + +// CRYPTO_is_confidential_build returns one if the linked version of BoringSSL +// has been built with the BORINGSSL_CONFIDENTIAL define and zero otherwise. +// +// This is used by some consumers to identify whether they are using an +// internal version of BoringSSL. +OPENSSL_EXPORT int CRYPTO_is_confidential_build(void); + +// CRYPTO_has_asm returns one unless BoringSSL was built with OPENSSL_NO_ASM, +// in which case it returns zero. +OPENSSL_EXPORT int CRYPTO_has_asm(void); + +// FIPS_mode returns zero unless BoringSSL is built with BORINGSSL_FIPS, in +// which case it returns one. +OPENSSL_EXPORT int FIPS_mode(void); + +// BORINGSSL_self_test triggers the FIPS KAT-based self tests. It returns one on +// success and zero on error. The argument is the integrity hash of the FIPS +// module and may be used to check and write flag files to suppress duplicate +// self-tests. If it is all zeros, no flag file will be checked nor written and +// tests will always be run. +OPENSSL_EXPORT int BORINGSSL_self_test(void); + + +// Deprecated functions. + +// OPENSSL_VERSION_TEXT contains a string the identifies the version of +// “OpenSSL”. node.js requires a version number in this text. +#define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0 (compatible; BoringSSL)" + +#define OPENSSL_VERSION 0 +#define OPENSSL_CFLAGS 1 +#define OPENSSL_BUILT_ON 2 +#define OPENSSL_PLATFORM 3 +#define OPENSSL_DIR 4 + +// OpenSSL_version is a compatibility function that returns the string +// "BoringSSL" if |which| is |OPENSSL_VERSION| and placeholder strings +// otherwise. +OPENSSL_EXPORT const char *OpenSSL_version(int which); + +#define SSLEAY_VERSION OPENSSL_VERSION +#define SSLEAY_CFLAGS OPENSSL_CFLAGS +#define SSLEAY_BUILT_ON OPENSSL_BUILT_ON +#define SSLEAY_PLATFORM OPENSSL_PLATFORM +#define SSLEAY_DIR OPENSSL_DIR + +// SSLeay_version calls |OpenSSL_version|. +OPENSSL_EXPORT const char *SSLeay_version(int which); + +// SSLeay is a compatibility function that returns OPENSSL_VERSION_NUMBER from +// base.h. +OPENSSL_EXPORT unsigned long SSLeay(void); + +// OpenSSL_version_num is a compatibility function that returns +// OPENSSL_VERSION_NUMBER from base.h. +OPENSSL_EXPORT unsigned long OpenSSL_version_num(void); + +// CRYPTO_malloc_init returns one. +OPENSSL_EXPORT int CRYPTO_malloc_init(void); + +// OPENSSL_malloc_init returns one. +OPENSSL_EXPORT int OPENSSL_malloc_init(void); + +// ENGINE_load_builtin_engines does nothing. +OPENSSL_EXPORT void ENGINE_load_builtin_engines(void); + +// ENGINE_register_all_complete returns one. +OPENSSL_EXPORT int ENGINE_register_all_complete(void); + +// OPENSSL_load_builtin_modules does nothing. +OPENSSL_EXPORT void OPENSSL_load_builtin_modules(void); + +#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS 0 +#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS 0 +#define OPENSSL_INIT_ADD_ALL_CIPHERS 0 +#define OPENSSL_INIT_ADD_ALL_DIGESTS 0 +#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS 0 +#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS 0 +#define OPENSSL_INIT_LOAD_CONFIG 0 +#define OPENSSL_INIT_NO_LOAD_CONFIG 0 + +// OPENSSL_init_crypto calls |CRYPTO_library_init| and returns one. +OPENSSL_EXPORT int OPENSSL_init_crypto(uint64_t opts, + const OPENSSL_INIT_SETTINGS *settings); + +// OPENSSL_cleanup does nothing. +OPENSSL_EXPORT void OPENSSL_cleanup(void); + +// FIPS_mode_set returns one if |on| matches whether BoringSSL was built with +// |BORINGSSL_FIPS| and zero otherwise. +OPENSSL_EXPORT int FIPS_mode_set(int on); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_CRYPTO_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/crypto.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/include/openssl/crypto.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.grpc_back index ccf5012c0..6aa661a8b 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/crypto.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/crypto.h.grpc_back @@ -16,6 +16,7 @@ #define OPENSSL_HEADER_CRYPTO_H #include +#include // Upstream OpenSSL defines |OPENSSL_malloc|, etc., in crypto.h rather than // mem.h. @@ -58,8 +59,11 @@ OPENSSL_EXPORT int CRYPTO_has_asm(void); // which case it returns one. OPENSSL_EXPORT int FIPS_mode(void); -// BORINGSSL_self_test triggers the FIPS KAT-based self tests. It returns one -// on success and zero on error. +// BORINGSSL_self_test triggers the FIPS KAT-based self tests. It returns one on +// success and zero on error. The argument is the integrity hash of the FIPS +// module and may be used to check and write flag files to suppress duplicate +// self-tests. If it is all zeros, no flag file will be checked nor written and +// tests will always be run. OPENSSL_EXPORT int BORINGSSL_self_test(void); @@ -69,17 +73,25 @@ OPENSSL_EXPORT int BORINGSSL_self_test(void); // “OpenSSL”. node.js requires a version number in this text. #define OPENSSL_VERSION_TEXT "OpenSSL 1.1.0 (compatible; BoringSSL)" -#define SSLEAY_VERSION 0 - -// SSLeay_version is a compatibility function that returns the string -// "BoringSSL". -OPENSSL_EXPORT const char *SSLeay_version(int unused); - #define OPENSSL_VERSION 0 +#define OPENSSL_CFLAGS 1 +#define OPENSSL_BUILT_ON 2 +#define OPENSSL_PLATFORM 3 +#define OPENSSL_DIR 4 // OpenSSL_version is a compatibility function that returns the string -// "BoringSSL". -OPENSSL_EXPORT const char *OpenSSL_version(int unused); +// "BoringSSL" if |which| is |OPENSSL_VERSION| and placeholder strings +// otherwise. +OPENSSL_EXPORT const char *OpenSSL_version(int which); + +#define SSLEAY_VERSION OPENSSL_VERSION +#define SSLEAY_CFLAGS OPENSSL_CFLAGS +#define SSLEAY_BUILT_ON OPENSSL_BUILT_ON +#define SSLEAY_PLATFORM OPENSSL_PLATFORM +#define SSLEAY_DIR OPENSSL_DIR + +// SSLeay_version calls |OpenSSL_version|. +OPENSSL_EXPORT const char *SSLeay_version(int which); // SSLeay is a compatibility function that returns OPENSSL_VERSION_NUMBER from // base.h. @@ -92,6 +104,9 @@ OPENSSL_EXPORT unsigned long OpenSSL_version_num(void); // CRYPTO_malloc_init returns one. OPENSSL_EXPORT int CRYPTO_malloc_init(void); +// OPENSSL_malloc_init returns one. +OPENSSL_EXPORT int OPENSSL_malloc_init(void); + // ENGINE_load_builtin_engines does nothing. OPENSSL_EXPORT void ENGINE_load_builtin_engines(void); @@ -114,6 +129,13 @@ OPENSSL_EXPORT void OPENSSL_load_builtin_modules(void); OPENSSL_EXPORT int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); +// OPENSSL_cleanup does nothing. +OPENSSL_EXPORT void OPENSSL_cleanup(void); + +// FIPS_mode_set returns one if |on| matches whether BoringSSL was built with +// |BORINGSSL_FIPS| and zero otherwise. +OPENSSL_EXPORT int FIPS_mode_set(int on); + #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/include/openssl/curve25519.h b/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/curve25519.h rename to Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h index 75c88ccca..45d8aceea 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/curve25519.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h @@ -65,7 +65,7 @@ OPENSSL_EXPORT void X25519_public_from_private(uint8_t out_public_value[32], // // Note that, unlike RFC 8032's formulation, our private key representation // includes a public key suffix to make multiple key signing operations with the -// same key more efficient. The RFC 8032 key private key is referred to in this +// same key more efficient. The RFC 8032 private key is referred to in this // implementation as the "seed" and is the first 32 bytes of our private key. #define ED25519_PRIVATE_KEY_LEN 64 @@ -79,7 +79,7 @@ OPENSSL_EXPORT void ED25519_keypair(uint8_t out_public_key[32], // ED25519_sign sets |out_sig| to be a signature of |message_len| bytes from // |message| using |private_key|. It returns one on success or zero on -// error. +// allocation failure. OPENSSL_EXPORT int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, size_t message_len, const uint8_t private_key[64]); @@ -188,11 +188,11 @@ OPENSSL_EXPORT int SPAKE2_process_msg(SPAKE2_CTX *ctx, uint8_t *out_key, extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(SPAKE2_CTX, SPAKE2_CTX_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.back new file mode 100644 index 000000000..a455389c1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.back @@ -0,0 +1,201 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_CURVE25519_H +#define OPENSSL_HEADER_CURVE25519_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Curve25519. +// +// Curve25519 is an elliptic curve. See https://tools.ietf.org/html/rfc7748. + + +// X25519. +// +// X25519 is the Diffie-Hellman primitive built from curve25519. It is +// sometimes referred to as “curve25519”, but “X25519” is a more precise name. +// See http://cr.yp.to/ecdh.html and https://tools.ietf.org/html/rfc7748. + +#define X25519_PRIVATE_KEY_LEN 32 +#define X25519_PUBLIC_VALUE_LEN 32 +#define X25519_SHARED_KEY_LEN 32 + +// X25519_keypair sets |out_public_value| and |out_private_key| to a freshly +// generated, public–private key pair. +OPENSSL_EXPORT void X25519_keypair(uint8_t out_public_value[32], + uint8_t out_private_key[32]); + +// X25519 writes a shared key to |out_shared_key| that is calculated from the +// given private key and the peer's public value. It returns one on success and +// zero on error. +// +// Don't use the shared key directly, rather use a KDF and also include the two +// public values as inputs. +OPENSSL_EXPORT int X25519(uint8_t out_shared_key[32], + const uint8_t private_key[32], + const uint8_t peer_public_value[32]); + +// X25519_public_from_private calculates a Diffie-Hellman public value from the +// given private key and writes it to |out_public_value|. +OPENSSL_EXPORT void X25519_public_from_private(uint8_t out_public_value[32], + const uint8_t private_key[32]); + + +// Ed25519. +// +// Ed25519 is a signature scheme using a twisted-Edwards curve that is +// birationally equivalent to curve25519. +// +// Note that, unlike RFC 8032's formulation, our private key representation +// includes a public key suffix to make multiple key signing operations with the +// same key more efficient. The RFC 8032 private key is referred to in this +// implementation as the "seed" and is the first 32 bytes of our private key. + +#define ED25519_PRIVATE_KEY_LEN 64 +#define ED25519_PUBLIC_KEY_LEN 32 +#define ED25519_SIGNATURE_LEN 64 + +// ED25519_keypair sets |out_public_key| and |out_private_key| to a freshly +// generated, public–private key pair. +OPENSSL_EXPORT void ED25519_keypair(uint8_t out_public_key[32], + uint8_t out_private_key[64]); + +// ED25519_sign sets |out_sig| to be a signature of |message_len| bytes from +// |message| using |private_key|. It returns one on success or zero on +// allocation failure. +OPENSSL_EXPORT int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, + size_t message_len, + const uint8_t private_key[64]); + +// ED25519_verify returns one iff |signature| is a valid signature, by +// |public_key| of |message_len| bytes from |message|. It returns zero +// otherwise. +OPENSSL_EXPORT int ED25519_verify(const uint8_t *message, size_t message_len, + const uint8_t signature[64], + const uint8_t public_key[32]); + +// ED25519_keypair_from_seed calculates a public and private key from an +// Ed25519 “seed”. Seed values are not exposed by this API (although they +// happen to be the first 32 bytes of a private key) so this function is for +// interoperating with systems that may store just a seed instead of a full +// private key. +OPENSSL_EXPORT void ED25519_keypair_from_seed(uint8_t out_public_key[32], + uint8_t out_private_key[64], + const uint8_t seed[32]); + + +// SPAKE2. +// +// SPAKE2 is a password-authenticated key-exchange. It allows two parties, +// who share a low-entropy secret (i.e. password), to agree on a shared key. +// An attacker can only make one guess of the password per execution of the +// protocol. +// +// See https://tools.ietf.org/html/draft-irtf-cfrg-spake2-02. + +// spake2_role_t enumerates the different “roles” in SPAKE2. The protocol +// requires that the symmetry of the two parties be broken so one participant +// must be “Alice” and the other be “Bob”. +enum spake2_role_t { + spake2_role_alice, + spake2_role_bob, +}; + +// SPAKE2_CTX_new creates a new |SPAKE2_CTX| (which can only be used for a +// single execution of the protocol). SPAKE2 requires the symmetry of the two +// parties to be broken which is indicated via |my_role| – each party must pass +// a different value for this argument. +// +// The |my_name| and |their_name| arguments allow optional, opaque names to be +// bound into the protocol. For example MAC addresses, hostnames, usernames +// etc. These values are not exposed and can avoid context-confusion attacks +// when a password is shared between several devices. +OPENSSL_EXPORT SPAKE2_CTX *SPAKE2_CTX_new( + enum spake2_role_t my_role, + const uint8_t *my_name, size_t my_name_len, + const uint8_t *their_name, size_t their_name_len); + +// SPAKE2_CTX_free frees |ctx| and all the resources that it has allocated. +OPENSSL_EXPORT void SPAKE2_CTX_free(SPAKE2_CTX *ctx); + +// SPAKE2_MAX_MSG_SIZE is the maximum size of a SPAKE2 message. +#define SPAKE2_MAX_MSG_SIZE 32 + +// SPAKE2_generate_msg generates a SPAKE2 message given |password|, writes +// it to |out| and sets |*out_len| to the number of bytes written. +// +// At most |max_out_len| bytes are written to |out| and, in order to ensure +// success, |max_out_len| should be at least |SPAKE2_MAX_MSG_SIZE| bytes. +// +// This function can only be called once for a given |SPAKE2_CTX|. +// +// It returns one on success and zero on error. +OPENSSL_EXPORT int SPAKE2_generate_msg(SPAKE2_CTX *ctx, uint8_t *out, + size_t *out_len, size_t max_out_len, + const uint8_t *password, + size_t password_len); + +// SPAKE2_MAX_KEY_SIZE is the maximum amount of key material that SPAKE2 will +// produce. +#define SPAKE2_MAX_KEY_SIZE 64 + +// SPAKE2_process_msg completes the SPAKE2 exchange given the peer's message in +// |their_msg|, writes at most |max_out_key_len| bytes to |out_key| and sets +// |*out_key_len| to the number of bytes written. +// +// The resulting keying material is suitable for: +// a) Using directly in a key-confirmation step: i.e. each side could +// transmit a hash of their role, a channel-binding value and the key +// material to prove to the other side that they know the shared key. +// b) Using as input keying material to HKDF to generate a variety of subkeys +// for encryption etc. +// +// If |max_out_key_key| is smaller than the amount of key material generated +// then the key is silently truncated. If you want to ensure that no truncation +// occurs then |max_out_key| should be at least |SPAKE2_MAX_KEY_SIZE|. +// +// You must call |SPAKE2_generate_msg| on a given |SPAKE2_CTX| before calling +// this function. On successful return, |ctx| is complete and calling +// |SPAKE2_CTX_free| is the only acceptable operation on it. +// +// Returns one on success or zero on error. +OPENSSL_EXPORT int SPAKE2_process_msg(SPAKE2_CTX *ctx, uint8_t *out_key, + size_t *out_key_len, + size_t max_out_key_len, + const uint8_t *their_msg, + size_t their_msg_len); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(SPAKE2_CTX, SPAKE2_CTX_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#endif // OPENSSL_HEADER_CURVE25519_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/curve25519.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/curve25519.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.grpc_back index 58a181f69..a455389c1 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/curve25519.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/curve25519.h.grpc_back @@ -65,7 +65,7 @@ OPENSSL_EXPORT void X25519_public_from_private(uint8_t out_public_value[32], // // Note that, unlike RFC 8032's formulation, our private key representation // includes a public key suffix to make multiple key signing operations with the -// same key more efficient. The RFC 8032 key private key is referred to in this +// same key more efficient. The RFC 8032 private key is referred to in this // implementation as the "seed" and is the first 32 bytes of our private key. #define ED25519_PRIVATE_KEY_LEN 64 @@ -79,7 +79,7 @@ OPENSSL_EXPORT void ED25519_keypair(uint8_t out_public_key[32], // ED25519_sign sets |out_sig| to be a signature of |message_len| bytes from // |message| using |private_key|. It returns one on success or zero on -// error. +// allocation failure. OPENSSL_EXPORT int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, size_t message_len, const uint8_t private_key[64]); @@ -188,11 +188,11 @@ OPENSSL_EXPORT int SPAKE2_process_msg(SPAKE2_CTX *ctx, uint8_t *out_key, extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(SPAKE2_CTX, SPAKE2_CTX_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/des.h b/Pods/BoringSSL-GRPC/src/include/openssl/des.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/des.h rename to Pods/BoringSSL-GRPC/src/include/openssl/des.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/des.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/des.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/des.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/des.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/des.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/des.h.grpc_back new file mode 100644 index 000000000..af1c822dd --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/des.h.grpc_back @@ -0,0 +1,177 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_DES_H +#define OPENSSL_HEADER_DES_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// DES. + + +typedef struct DES_cblock_st { + uint8_t bytes[8]; +} DES_cblock; + +typedef struct DES_ks { + uint32_t subkeys[16][2]; +} DES_key_schedule; + + +#define DES_KEY_SZ (sizeof(DES_cblock)) +#define DES_SCHEDULE_SZ (sizeof(DES_key_schedule)) + +#define DES_ENCRYPT 1 +#define DES_DECRYPT 0 + +#define DES_CBC_MODE 0 +#define DES_PCBC_MODE 1 + +// DES_set_key performs a key schedule and initialises |schedule| with |key|. +OPENSSL_EXPORT void DES_set_key(const DES_cblock *key, + DES_key_schedule *schedule); + +// DES_set_odd_parity sets the parity bits (the least-significant bits in each +// byte) of |key| given the other bits in each byte. +OPENSSL_EXPORT void DES_set_odd_parity(DES_cblock *key); + +// DES_ecb_encrypt encrypts (or decrypts, if |is_encrypt| is |DES_DECRYPT|) a +// single DES block (8 bytes) from in to out, using the key configured in +// |schedule|. +OPENSSL_EXPORT void DES_ecb_encrypt(const DES_cblock *in, DES_cblock *out, + const DES_key_schedule *schedule, + int is_encrypt); + +// DES_ncbc_encrypt encrypts (or decrypts, if |enc| is |DES_DECRYPT|) |len| +// bytes from |in| to |out| with DES in CBC mode. +OPENSSL_EXPORT void DES_ncbc_encrypt(const uint8_t *in, uint8_t *out, + size_t len, + const DES_key_schedule *schedule, + DES_cblock *ivec, int enc); + +// DES_ecb3_encrypt encrypts (or decrypts, if |enc| is |DES_DECRYPT|) a single +// block (8 bytes) of data from |input| to |output| using 3DES. +OPENSSL_EXPORT void DES_ecb3_encrypt(const DES_cblock *input, + DES_cblock *output, + const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + const DES_key_schedule *ks3, + int enc); + +// DES_ede3_cbc_encrypt encrypts (or decrypts, if |enc| is |DES_DECRYPT|) |len| +// bytes from |in| to |out| with 3DES in CBC mode. 3DES uses three keys, thus +// the function takes three different |DES_key_schedule|s. +OPENSSL_EXPORT void DES_ede3_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t len, + const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + const DES_key_schedule *ks3, + DES_cblock *ivec, int enc); + +// DES_ede2_cbc_encrypt encrypts (or decrypts, if |enc| is |DES_DECRYPT|) |len| +// bytes from |in| to |out| with 3DES in CBC mode. With this keying option, the +// first and third 3DES keys are identical. Thus, this function takes only two +// different |DES_key_schedule|s. +OPENSSL_EXPORT void DES_ede2_cbc_encrypt(const uint8_t *in, uint8_t *out, + size_t len, + const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + DES_cblock *ivec, int enc); + + +// Deprecated functions. + +// DES_set_key_unchecked calls |DES_set_key|. +OPENSSL_EXPORT void DES_set_key_unchecked(const DES_cblock *key, + DES_key_schedule *schedule); + +OPENSSL_EXPORT void DES_ede3_cfb64_encrypt(const uint8_t *in, uint8_t *out, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, + DES_key_schedule *ks3, + DES_cblock *ivec, int *num, int enc); + +OPENSSL_EXPORT void DES_ede3_cfb_encrypt(const uint8_t *in, uint8_t *out, + int numbits, long length, + DES_key_schedule *ks1, + DES_key_schedule *ks2, + DES_key_schedule *ks3, + DES_cblock *ivec, int enc); + + +// Private functions. +// +// These functions are only exported for use in |decrepit|. + +OPENSSL_EXPORT void DES_decrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + const DES_key_schedule *ks3); + +OPENSSL_EXPORT void DES_encrypt3(uint32_t *data, const DES_key_schedule *ks1, + const DES_key_schedule *ks2, + const DES_key_schedule *ks3); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_DES_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/dh.h b/Pods/BoringSSL-GRPC/src/include/openssl/dh.h similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/dh.h rename to Pods/BoringSSL-GRPC/src/include/openssl/dh.h index dd9f6eae7..4c5982889 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/dh.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dh.h @@ -278,11 +278,12 @@ struct dh_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(DH, DH_free) +BORINGSSL_MAKE_UP_REF(DH, DH_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.back new file mode 100644 index 000000000..7e1030382 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.back @@ -0,0 +1,299 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_DH_H +#define OPENSSL_HEADER_DH_H + +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// DH contains functions for performing Diffie-Hellman key agreement in +// multiplicative groups. + + +// Allocation and destruction. + +// DH_new returns a new, empty DH object or NULL on error. +OPENSSL_EXPORT DH *DH_new(void); + +// DH_free decrements the reference count of |dh| and frees it if the reference +// count drops to zero. +OPENSSL_EXPORT void DH_free(DH *dh); + +// DH_up_ref increments the reference count of |dh| and returns one. +OPENSSL_EXPORT int DH_up_ref(DH *dh); + + +// Properties. + +// DH_get0_key sets |*out_pub_key| and |*out_priv_key|, if non-NULL, to |dh|'s +// public and private key, respectively. If |dh| is a public key, the private +// key will be set to NULL. +OPENSSL_EXPORT void DH_get0_key(const DH *dh, const BIGNUM **out_pub_key, + const BIGNUM **out_priv_key); + +// DH_set0_key sets |dh|'s public and private key to the specified values. If +// NULL, the field is left unchanged. On success, it takes ownership of each +// argument and returns one. Otherwise, it returns zero. +OPENSSL_EXPORT int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); + +// DH_get0_pqg sets |*out_p|, |*out_q|, and |*out_g|, if non-NULL, to |dh|'s p, +// q, and g parameters, respectively. +OPENSSL_EXPORT void DH_get0_pqg(const DH *dh, const BIGNUM **out_p, + const BIGNUM **out_q, const BIGNUM **out_g); + +// DH_set0_pqg sets |dh|'s p, q, and g parameters to the specified values. If +// NULL, the field is left unchanged. On success, it takes ownership of each +// argument and returns one. Otherwise, it returns zero. |q| may be NULL, but +// |p| and |g| must either be specified or already configured on |dh|. +OPENSSL_EXPORT int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); + + +// Standard parameters. + +// BN_get_rfc3526_prime_1536 sets |*ret| to the 1536-bit MODP group from RFC +// 3526 and returns |ret|. If |ret| is NULL then a fresh |BIGNUM| is allocated +// and returned. It returns NULL on allocation failure. +OPENSSL_EXPORT BIGNUM *BN_get_rfc3526_prime_1536(BIGNUM *ret); + + +// Parameter generation. + +#define DH_GENERATOR_2 2 +#define DH_GENERATOR_5 5 + +// DH_generate_parameters_ex generates a suitable Diffie-Hellman group with a +// prime that is |prime_bits| long and stores it in |dh|. The generator of the +// group will be |generator|, which should be |DH_GENERATOR_2| unless there's a +// good reason to use a different value. The |cb| argument contains a callback +// function that will be called during the generation. See the documentation in +// |bn.h| about this. In addition to the callback invocations from |BN|, |cb| +// will also be called with |event| equal to three when the generation is +// complete. +OPENSSL_EXPORT int DH_generate_parameters_ex(DH *dh, int prime_bits, + int generator, BN_GENCB *cb); + + +// Diffie-Hellman operations. + +// DH_generate_key generates a new, random, private key and stores it in +// |dh|. It returns one on success and zero on error. +OPENSSL_EXPORT int DH_generate_key(DH *dh); + +// DH_compute_key calculates the shared key between |dh| and |peers_key| and +// writes it as a big-endian integer into |out|, which must have |DH_size| +// bytes of space. It returns the number of bytes written, or a negative number +// on error. +OPENSSL_EXPORT int DH_compute_key(uint8_t *out, const BIGNUM *peers_key, + DH *dh); + + +// Utility functions. + +// DH_size returns the number of bytes in the DH group's prime. +OPENSSL_EXPORT int DH_size(const DH *dh); + +// DH_num_bits returns the minimum number of bits needed to represent the +// absolute value of the DH group's prime. +OPENSSL_EXPORT unsigned DH_num_bits(const DH *dh); + +#define DH_CHECK_P_NOT_PRIME 0x01 +#define DH_CHECK_P_NOT_SAFE_PRIME 0x02 +#define DH_CHECK_UNABLE_TO_CHECK_GENERATOR 0x04 +#define DH_CHECK_NOT_SUITABLE_GENERATOR 0x08 +#define DH_CHECK_Q_NOT_PRIME 0x10 +#define DH_CHECK_INVALID_Q_VALUE 0x20 +#define DH_CHECK_INVALID_J_VALUE 0x40 + +// These are compatibility defines. +#define DH_NOT_SUITABLE_GENERATOR DH_CHECK_NOT_SUITABLE_GENERATOR +#define DH_UNABLE_TO_CHECK_GENERATOR DH_CHECK_UNABLE_TO_CHECK_GENERATOR + +// DH_check checks the suitability of |dh| as a Diffie-Hellman group. and sets +// |DH_CHECK_*| flags in |*out_flags| if it finds any errors. It returns one if +// |*out_flags| was successfully set and zero on error. +// +// Note: these checks may be quite computationally expensive. +OPENSSL_EXPORT int DH_check(const DH *dh, int *out_flags); + +#define DH_CHECK_PUBKEY_TOO_SMALL 0x1 +#define DH_CHECK_PUBKEY_TOO_LARGE 0x2 +#define DH_CHECK_PUBKEY_INVALID 0x4 + +// DH_check_pub_key checks the suitability of |pub_key| as a public key for the +// DH group in |dh| and sets |DH_CHECK_PUBKEY_*| flags in |*out_flags| if it +// finds any errors. It returns one if |*out_flags| was successfully set and +// zero on error. +OPENSSL_EXPORT int DH_check_pub_key(const DH *dh, const BIGNUM *pub_key, + int *out_flags); + +// DHparams_dup allocates a fresh |DH| and copies the parameters from |dh| into +// it. It returns the new |DH| or NULL on error. +OPENSSL_EXPORT DH *DHparams_dup(const DH *dh); + + +// ASN.1 functions. + +// DH_parse_parameters decodes a DER-encoded DHParameter structure (PKCS #3) +// from |cbs| and advances |cbs|. It returns a newly-allocated |DH| or NULL on +// error. +OPENSSL_EXPORT DH *DH_parse_parameters(CBS *cbs); + +// DH_marshal_parameters marshals |dh| as a DER-encoded DHParameter structure +// (PKCS #3) and appends the result to |cbb|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int DH_marshal_parameters(CBB *cbb, const DH *dh); + + +// ex_data functions. +// +// See |ex_data.h| for details. + +OPENSSL_EXPORT int DH_get_ex_new_index(long argl, void *argp, + CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func); +OPENSSL_EXPORT int DH_set_ex_data(DH *d, int idx, void *arg); +OPENSSL_EXPORT void *DH_get_ex_data(DH *d, int idx); + + +// Deprecated functions. + +// DH_generate_parameters behaves like |DH_generate_parameters_ex|, which is +// what you should use instead. It returns NULL on error, or a newly-allocated +// |DH| on success. This function is provided for compatibility only. +OPENSSL_EXPORT DH *DH_generate_parameters(int prime_len, int generator, + void (*callback)(int, int, void *), + void *cb_arg); + +// d2i_DHparams parses an ASN.1, DER encoded Diffie-Hellman parameters structure +// from |len| bytes at |*inp|. If |ret| is not NULL then, on exit, a pointer to +// the result is in |*ret|. Note that, even if |*ret| is already non-NULL on +// entry, it will not be written to. Rather, a fresh |DH| is allocated and the +// previous one is freed. +// +// On successful exit, |*inp| is advanced past the DER structure. It +// returns the result or NULL on error. +// +// Use |DH_parse_parameters| instead. +OPENSSL_EXPORT DH *d2i_DHparams(DH **ret, const unsigned char **inp, long len); + +// i2d_DHparams marshals |in| to an ASN.1, DER structure. If |outp| is not NULL +// then the result is written to |*outp| and |*outp| is advanced just past the +// output. It returns the number of bytes in the result, whether written or +// not, or a negative value on error. +// +// Use |DH_marshal_parameters| instead. +OPENSSL_EXPORT int i2d_DHparams(const DH *in, unsigned char **outp); + + +struct dh_st { + BIGNUM *p; + BIGNUM *g; + BIGNUM *pub_key; // g^x mod p + BIGNUM *priv_key; // x + + // priv_length contains the length, in bits, of the private value. If zero, + // the private value will be the same length as |p|. + unsigned priv_length; + + CRYPTO_MUTEX method_mont_p_lock; + BN_MONT_CTX *method_mont_p; + + // Place holders if we want to do X9.42 DH + BIGNUM *q; + BIGNUM *j; + unsigned char *seed; + int seedlen; + BIGNUM *counter; + + int flags; + CRYPTO_refcount_t references; + CRYPTO_EX_DATA ex_data; +}; + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(DH, DH_free) +BORINGSSL_MAKE_UP_REF(DH, DH_up_ref) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define DH_R_BAD_GENERATOR 100 +#define DH_R_INVALID_PUBKEY 101 +#define DH_R_MODULUS_TOO_LARGE 102 +#define DH_R_NO_PRIVATE_VALUE 103 +#define DH_R_DECODE_ERROR 104 +#define DH_R_ENCODE_ERROR 105 + +#endif // OPENSSL_HEADER_DH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/dh.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/dh.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/dh.h.grpc_back index ae24c25d1..7e1030382 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/dh.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dh.h.grpc_back @@ -278,11 +278,12 @@ struct dh_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(DH, DH_free) +BORINGSSL_MAKE_UP_REF(DH, DH_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/digest.h b/Pods/BoringSSL-GRPC/src/include/openssl/digest.h similarity index 93% rename from Pods/BoringSSL-GRPC/include/openssl/digest.h rename to Pods/BoringSSL-GRPC/src/include/openssl/digest.h index f451b0052..e3644079d 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/digest.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/digest.h @@ -119,18 +119,19 @@ OPENSSL_EXPORT int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); OPENSSL_EXPORT void EVP_MD_CTX_free(EVP_MD_CTX *ctx); // EVP_MD_CTX_copy_ex sets |out|, which must already be initialised, to be a -// copy of |in|. It returns one on success and zero on error. +// copy of |in|. It returns one on success and zero on allocation failure. OPENSSL_EXPORT int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); -// EVP_MD_CTX_reset calls |EVP_MD_CTX_cleanup| followed by |EVP_MD_CTX_init|. -OPENSSL_EXPORT void EVP_MD_CTX_reset(EVP_MD_CTX *ctx); +// EVP_MD_CTX_reset calls |EVP_MD_CTX_cleanup| followed by |EVP_MD_CTX_init|. It +// returns one. +OPENSSL_EXPORT int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); // Digest operations. // EVP_DigestInit_ex configures |ctx|, which must already have been // initialised, for a fresh hashing operation using |type|. It returns one on -// success and zero otherwise. +// success and zero on allocation failure. OPENSSL_EXPORT int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine); @@ -194,7 +195,7 @@ OPENSSL_EXPORT size_t EVP_MD_size(const EVP_MD *md); // EVP_MD_block_size returns the native block-size of |md|, in bytes. OPENSSL_EXPORT size_t EVP_MD_block_size(const EVP_MD *md); -// EVP_MD_FLAG_PKEY_DIGEST indicates the the digest function is used with a +// EVP_MD_FLAG_PKEY_DIGEST indicates that the digest function is used with a // specific public key in order to verify signatures. (For example, // EVP_dss1.) #define EVP_MD_FLAG_PKEY_DIGEST 1 @@ -204,6 +205,11 @@ OPENSSL_EXPORT size_t EVP_MD_block_size(const EVP_MD *md); // undefined rather than NULL. #define EVP_MD_FLAG_DIGALGID_ABSENT 2 +// EVP_MD_FLAG_XOF indicates that the digest is an extensible-output function +// (XOF). This flag is defined for compatibility and will never be set in any +// |EVP_MD| in BoringSSL. +#define EVP_MD_FLAG_XOF 4 + // Digest operation accessors. @@ -268,6 +274,14 @@ OPENSSL_EXPORT EVP_MD_CTX *EVP_MD_CTX_create(void); // EVP_MD_CTX_destroy calls |EVP_MD_CTX_free|. OPENSSL_EXPORT void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); +// EVP_DigestFinalXOF returns zero and adds an error to the error queue. +// BoringSSL does not support any XOF digests. +OPENSSL_EXPORT int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out, + size_t len); + +// EVP_MD_meth_get_flags calls |EVP_MD_flags|. +OPENSSL_EXPORT uint32_t EVP_MD_meth_get_flags(const EVP_MD *md); + struct evp_md_pctx_ops; @@ -294,7 +308,7 @@ struct env_md_ctx_st { #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EVP_MD_CTX, EVP_MD_CTX_free) @@ -302,7 +316,7 @@ using ScopedEVP_MD_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.back new file mode 100644 index 000000000..c3ceb7f22 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.back @@ -0,0 +1,330 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_DIGEST_H +#define OPENSSL_HEADER_DIGEST_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Digest functions. +// +// An EVP_MD abstracts the details of a specific hash function allowing code to +// deal with the concept of a "hash function" without needing to know exactly +// which hash function it is. + + +// Hash algorithms. +// +// The following functions return |EVP_MD| objects that implement the named hash +// function. + +OPENSSL_EXPORT const EVP_MD *EVP_md4(void); +OPENSSL_EXPORT const EVP_MD *EVP_md5(void); +OPENSSL_EXPORT const EVP_MD *EVP_sha1(void); +OPENSSL_EXPORT const EVP_MD *EVP_sha224(void); +OPENSSL_EXPORT const EVP_MD *EVP_sha256(void); +OPENSSL_EXPORT const EVP_MD *EVP_sha384(void); +OPENSSL_EXPORT const EVP_MD *EVP_sha512(void); + +// EVP_md5_sha1 is a TLS-specific |EVP_MD| which computes the concatenation of +// MD5 and SHA-1, as used in TLS 1.1 and below. +OPENSSL_EXPORT const EVP_MD *EVP_md5_sha1(void); + +// EVP_get_digestbynid returns an |EVP_MD| for the given NID, or NULL if no +// such digest is known. +OPENSSL_EXPORT const EVP_MD *EVP_get_digestbynid(int nid); + +// EVP_get_digestbyobj returns an |EVP_MD| for the given |ASN1_OBJECT|, or NULL +// if no such digest is known. +OPENSSL_EXPORT const EVP_MD *EVP_get_digestbyobj(const ASN1_OBJECT *obj); + + +// Digest contexts. +// +// An EVP_MD_CTX represents the state of a specific digest operation in +// progress. + +// EVP_MD_CTX_init initialises an, already allocated, |EVP_MD_CTX|. This is the +// same as setting the structure to zero. +OPENSSL_EXPORT void EVP_MD_CTX_init(EVP_MD_CTX *ctx); + +// EVP_MD_CTX_new allocates and initialises a fresh |EVP_MD_CTX| and returns +// it, or NULL on allocation failure. The caller must use |EVP_MD_CTX_free| to +// release the resulting object. +OPENSSL_EXPORT EVP_MD_CTX *EVP_MD_CTX_new(void); + +// EVP_MD_CTX_cleanup frees any resources owned by |ctx| and resets it to a +// freshly initialised state. It does not free |ctx| itself. It returns one. +OPENSSL_EXPORT int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); + +// EVP_MD_CTX_free calls |EVP_MD_CTX_cleanup| and then frees |ctx| itself. +OPENSSL_EXPORT void EVP_MD_CTX_free(EVP_MD_CTX *ctx); + +// EVP_MD_CTX_copy_ex sets |out|, which must already be initialised, to be a +// copy of |in|. It returns one on success and zero on allocation failure. +OPENSSL_EXPORT int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); + +// EVP_MD_CTX_reset calls |EVP_MD_CTX_cleanup| followed by |EVP_MD_CTX_init|. It +// returns one. +OPENSSL_EXPORT int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); + + +// Digest operations. + +// EVP_DigestInit_ex configures |ctx|, which must already have been +// initialised, for a fresh hashing operation using |type|. It returns one on +// success and zero on allocation failure. +OPENSSL_EXPORT int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, + ENGINE *engine); + +// EVP_DigestInit acts like |EVP_DigestInit_ex| except that |ctx| is +// initialised before use. +OPENSSL_EXPORT int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); + +// EVP_DigestUpdate hashes |len| bytes from |data| into the hashing operation +// in |ctx|. It returns one. +OPENSSL_EXPORT int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, + size_t len); + +// EVP_MAX_MD_SIZE is the largest digest size supported, in bytes. +// Functions that output a digest generally require the buffer have +// at least this much space. +#define EVP_MAX_MD_SIZE 64 // SHA-512 is the longest so far. + +// EVP_MAX_MD_BLOCK_SIZE is the largest digest block size supported, in +// bytes. +#define EVP_MAX_MD_BLOCK_SIZE 128 // SHA-512 is the longest so far. + +// EVP_DigestFinal_ex finishes the digest in |ctx| and writes the output to +// |md_out|. |EVP_MD_CTX_size| bytes are written, which is at most +// |EVP_MAX_MD_SIZE|. If |out_size| is not NULL then |*out_size| is set to the +// number of bytes written. It returns one. After this call, the hash cannot be +// updated or finished again until |EVP_DigestInit_ex| is called to start +// another hashing operation. +OPENSSL_EXPORT int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, uint8_t *md_out, + unsigned int *out_size); + +// EVP_DigestFinal acts like |EVP_DigestFinal_ex| except that +// |EVP_MD_CTX_cleanup| is called on |ctx| before returning. +OPENSSL_EXPORT int EVP_DigestFinal(EVP_MD_CTX *ctx, uint8_t *md_out, + unsigned int *out_size); + +// EVP_Digest performs a complete hashing operation in one call. It hashes |len| +// bytes from |data| and writes the digest to |md_out|. |EVP_MD_CTX_size| bytes +// are written, which is at most |EVP_MAX_MD_SIZE|. If |out_size| is not NULL +// then |*out_size| is set to the number of bytes written. It returns one on +// success and zero otherwise. +OPENSSL_EXPORT int EVP_Digest(const void *data, size_t len, uint8_t *md_out, + unsigned int *md_out_size, const EVP_MD *type, + ENGINE *impl); + + +// Digest function accessors. +// +// These functions allow code to learn details about an abstract hash +// function. + +// EVP_MD_type returns a NID identifying |md|. (For example, |NID_sha256|.) +OPENSSL_EXPORT int EVP_MD_type(const EVP_MD *md); + +// EVP_MD_flags returns the flags for |md|, which is a set of |EVP_MD_FLAG_*| +// values, ORed together. +OPENSSL_EXPORT uint32_t EVP_MD_flags(const EVP_MD *md); + +// EVP_MD_size returns the digest size of |md|, in bytes. +OPENSSL_EXPORT size_t EVP_MD_size(const EVP_MD *md); + +// EVP_MD_block_size returns the native block-size of |md|, in bytes. +OPENSSL_EXPORT size_t EVP_MD_block_size(const EVP_MD *md); + +// EVP_MD_FLAG_PKEY_DIGEST indicates that the digest function is used with a +// specific public key in order to verify signatures. (For example, +// EVP_dss1.) +#define EVP_MD_FLAG_PKEY_DIGEST 1 + +// EVP_MD_FLAG_DIGALGID_ABSENT indicates that the parameter type in an X.509 +// DigestAlgorithmIdentifier representing this digest function should be +// undefined rather than NULL. +#define EVP_MD_FLAG_DIGALGID_ABSENT 2 + +// EVP_MD_FLAG_XOF indicates that the digest is an extensible-output function +// (XOF). This flag is defined for compatibility and will never be set in any +// |EVP_MD| in BoringSSL. +#define EVP_MD_FLAG_XOF 4 + + +// Digest operation accessors. + +// EVP_MD_CTX_md returns the underlying digest function, or NULL if one has not +// been set. +OPENSSL_EXPORT const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); + +// EVP_MD_CTX_size returns the digest size of |ctx|, in bytes. It +// will crash if a digest hasn't been set on |ctx|. +OPENSSL_EXPORT size_t EVP_MD_CTX_size(const EVP_MD_CTX *ctx); + +// EVP_MD_CTX_block_size returns the block size of the digest function used by +// |ctx|, in bytes. It will crash if a digest hasn't been set on |ctx|. +OPENSSL_EXPORT size_t EVP_MD_CTX_block_size(const EVP_MD_CTX *ctx); + +// EVP_MD_CTX_type returns a NID describing the digest function used by |ctx|. +// (For example, |NID_sha256|.) It will crash if a digest hasn't been set on +// |ctx|. +OPENSSL_EXPORT int EVP_MD_CTX_type(const EVP_MD_CTX *ctx); + + +// ASN.1 functions. +// +// These functions allow code to parse and serialize AlgorithmIdentifiers for +// hash functions. + +// EVP_parse_digest_algorithm parses an AlgorithmIdentifier structure containing +// a hash function OID (for example, 2.16.840.1.101.3.4.2.1 is SHA-256) and +// advances |cbs|. The parameters field may either be omitted or a NULL. It +// returns the digest function or NULL on error. +OPENSSL_EXPORT const EVP_MD *EVP_parse_digest_algorithm(CBS *cbs); + +// EVP_marshal_digest_algorithm marshals |md| as an AlgorithmIdentifier +// structure and appends the result to |cbb|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int EVP_marshal_digest_algorithm(CBB *cbb, const EVP_MD *md); + + +// Deprecated functions. + +// EVP_MD_CTX_copy sets |out|, which must /not/ be initialised, to be a copy of +// |in|. It returns one on success and zero on error. +OPENSSL_EXPORT int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in); + +// EVP_add_digest does nothing and returns one. It exists only for +// compatibility with OpenSSL. +OPENSSL_EXPORT int EVP_add_digest(const EVP_MD *digest); + +// EVP_get_digestbyname returns an |EVP_MD| given a human readable name in +// |name|, or NULL if the name is unknown. +OPENSSL_EXPORT const EVP_MD *EVP_get_digestbyname(const char *); + +// EVP_dss1 returns the value of EVP_sha1(). This was provided by OpenSSL to +// specifiy the original DSA signatures, which were fixed to use SHA-1. Note, +// however, that attempting to sign or verify DSA signatures with the EVP +// interface will always fail. +OPENSSL_EXPORT const EVP_MD *EVP_dss1(void); + +// EVP_MD_CTX_create calls |EVP_MD_CTX_new|. +OPENSSL_EXPORT EVP_MD_CTX *EVP_MD_CTX_create(void); + +// EVP_MD_CTX_destroy calls |EVP_MD_CTX_free|. +OPENSSL_EXPORT void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); + +// EVP_DigestFinalXOF returns zero and adds an error to the error queue. +// BoringSSL does not support any XOF digests. +OPENSSL_EXPORT int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out, + size_t len); + +// EVP_MD_meth_get_flags calls |EVP_MD_flags|. +OPENSSL_EXPORT uint32_t EVP_MD_meth_get_flags(const EVP_MD *md); + + +struct evp_md_pctx_ops; + +struct env_md_ctx_st { + // digest is the underlying digest function, or NULL if not set. + const EVP_MD *digest; + // md_data points to a block of memory that contains the hash-specific + // context. + void *md_data; + + // pctx is an opaque (at this layer) pointer to additional context that + // EVP_PKEY functions may store in this object. + EVP_PKEY_CTX *pctx; + + // pctx_ops, if not NULL, points to a vtable that contains functions to + // manipulate |pctx|. + const struct evp_md_pctx_ops *pctx_ops; +} /* EVP_MD_CTX */; + + +#if defined(__cplusplus) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(EVP_MD_CTX, EVP_MD_CTX_free) + +using ScopedEVP_MD_CTX = + internal::StackAllocated; + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif + +#define DIGEST_R_INPUT_NOT_INITIALIZED 100 +#define DIGEST_R_DECODE_ERROR 101 +#define DIGEST_R_UNKNOWN_HASH 102 + +#endif // OPENSSL_HEADER_DIGEST_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/digest.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/include/openssl/digest.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/digest.h.grpc_back index 81f58925e..c3ceb7f22 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/digest.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/digest.h.grpc_back @@ -119,18 +119,19 @@ OPENSSL_EXPORT int EVP_MD_CTX_cleanup(EVP_MD_CTX *ctx); OPENSSL_EXPORT void EVP_MD_CTX_free(EVP_MD_CTX *ctx); // EVP_MD_CTX_copy_ex sets |out|, which must already be initialised, to be a -// copy of |in|. It returns one on success and zero on error. +// copy of |in|. It returns one on success and zero on allocation failure. OPENSSL_EXPORT int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); -// EVP_MD_CTX_reset calls |EVP_MD_CTX_cleanup| followed by |EVP_MD_CTX_init|. -OPENSSL_EXPORT void EVP_MD_CTX_reset(EVP_MD_CTX *ctx); +// EVP_MD_CTX_reset calls |EVP_MD_CTX_cleanup| followed by |EVP_MD_CTX_init|. It +// returns one. +OPENSSL_EXPORT int EVP_MD_CTX_reset(EVP_MD_CTX *ctx); // Digest operations. // EVP_DigestInit_ex configures |ctx|, which must already have been // initialised, for a fresh hashing operation using |type|. It returns one on -// success and zero otherwise. +// success and zero on allocation failure. OPENSSL_EXPORT int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *engine); @@ -194,7 +195,7 @@ OPENSSL_EXPORT size_t EVP_MD_size(const EVP_MD *md); // EVP_MD_block_size returns the native block-size of |md|, in bytes. OPENSSL_EXPORT size_t EVP_MD_block_size(const EVP_MD *md); -// EVP_MD_FLAG_PKEY_DIGEST indicates the the digest function is used with a +// EVP_MD_FLAG_PKEY_DIGEST indicates that the digest function is used with a // specific public key in order to verify signatures. (For example, // EVP_dss1.) #define EVP_MD_FLAG_PKEY_DIGEST 1 @@ -204,6 +205,11 @@ OPENSSL_EXPORT size_t EVP_MD_block_size(const EVP_MD *md); // undefined rather than NULL. #define EVP_MD_FLAG_DIGALGID_ABSENT 2 +// EVP_MD_FLAG_XOF indicates that the digest is an extensible-output function +// (XOF). This flag is defined for compatibility and will never be set in any +// |EVP_MD| in BoringSSL. +#define EVP_MD_FLAG_XOF 4 + // Digest operation accessors. @@ -268,6 +274,14 @@ OPENSSL_EXPORT EVP_MD_CTX *EVP_MD_CTX_create(void); // EVP_MD_CTX_destroy calls |EVP_MD_CTX_free|. OPENSSL_EXPORT void EVP_MD_CTX_destroy(EVP_MD_CTX *ctx); +// EVP_DigestFinalXOF returns zero and adds an error to the error queue. +// BoringSSL does not support any XOF digests. +OPENSSL_EXPORT int EVP_DigestFinalXOF(EVP_MD_CTX *ctx, uint8_t *out, + size_t len); + +// EVP_MD_meth_get_flags calls |EVP_MD_flags|. +OPENSSL_EXPORT uint32_t EVP_MD_meth_get_flags(const EVP_MD *md); + struct evp_md_pctx_ops; @@ -294,7 +308,7 @@ struct env_md_ctx_st { #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EVP_MD_CTX, EVP_MD_CTX_free) @@ -302,7 +316,7 @@ using ScopedEVP_MD_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/dsa.h b/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/dsa.h rename to Pods/BoringSSL-GRPC/src/include/openssl/dsa.h index 2eaf7da2b..45fdd5b73 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/dsa.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h @@ -73,6 +73,10 @@ extern "C" { // DSA contains functions for signing and verifying with the Digital Signature // Algorithm. +// +// This module is deprecated and retained for legacy reasons only. It is not +// considered a priority for performance or hardening work. Do not use it in +// new code. Use Ed25519, ECDSA with P-256, or RSA instead. // Allocation and destruction. @@ -413,12 +417,13 @@ struct dsa_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(DSA, DSA_free) +BORINGSSL_MAKE_UP_REF(DSA, DSA_up_ref) BORINGSSL_MAKE_DELETER(DSA_SIG, DSA_SIG_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -431,5 +436,6 @@ BORINGSSL_MAKE_DELETER(DSA_SIG, DSA_SIG_free) #define DSA_R_BAD_VERSION 104 #define DSA_R_DECODE_ERROR 105 #define DSA_R_ENCODE_ERROR 106 +#define DSA_R_INVALID_PARAMETERS 107 #endif // OPENSSL_HEADER_DSA_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.back new file mode 100644 index 000000000..8e3b9b3c1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.back @@ -0,0 +1,441 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + * + * The DSS routines are based on patches supplied by + * Steven Schoch . */ + +#ifndef OPENSSL_HEADER_DSA_H +#define OPENSSL_HEADER_DSA_H + +#include + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// DSA contains functions for signing and verifying with the Digital Signature +// Algorithm. +// +// This module is deprecated and retained for legacy reasons only. It is not +// considered a priority for performance or hardening work. Do not use it in +// new code. Use Ed25519, ECDSA with P-256, or RSA instead. + + +// Allocation and destruction. + +// DSA_new returns a new, empty DSA object or NULL on error. +OPENSSL_EXPORT DSA *DSA_new(void); + +// DSA_free decrements the reference count of |dsa| and frees it if the +// reference count drops to zero. +OPENSSL_EXPORT void DSA_free(DSA *dsa); + +// DSA_up_ref increments the reference count of |dsa| and returns one. +OPENSSL_EXPORT int DSA_up_ref(DSA *dsa); + + +// Properties. + +// DSA_get0_key sets |*out_pub_key| and |*out_priv_key|, if non-NULL, to |dsa|'s +// public and private key, respectively. If |dsa| is a public key, the private +// key will be set to NULL. +OPENSSL_EXPORT void DSA_get0_key(const DSA *dsa, const BIGNUM **out_pub_key, + const BIGNUM **out_priv_key); + +// DSA_get0_pqg sets |*out_p|, |*out_q|, and |*out_g|, if non-NULL, to |dsa|'s +// p, q, and g parameters, respectively. +OPENSSL_EXPORT void DSA_get0_pqg(const DSA *dsa, const BIGNUM **out_p, + const BIGNUM **out_q, const BIGNUM **out_g); + +// DSA_set0_key sets |dsa|'s public and private key to |pub_key| and |priv_key|, +// respectively, if non-NULL. On success, it takes ownership of each argument +// and returns one. Otherwise, it returns zero. +// +// |priv_key| may be NULL, but |pub_key| must either be non-NULL or already +// configured on |dsa|. +OPENSSL_EXPORT int DSA_set0_key(DSA *dsa, BIGNUM *pub_key, BIGNUM *priv_key); + +// DSA_set0_pqg sets |dsa|'s parameters to |p|, |q|, and |g|, if non-NULL, and +// takes ownership of them. On success, it takes ownership of each argument and +// returns one. Otherwise, it returns zero. +// +// Each argument must either be non-NULL or already configured on |dsa|. +OPENSSL_EXPORT int DSA_set0_pqg(DSA *dsa, BIGNUM *p, BIGNUM *q, BIGNUM *g); + + +// Parameter generation. + +// DSA_generate_parameters_ex generates a set of DSA parameters by following +// the procedure given in FIPS 186-4, appendix A. +// (http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-4.pdf) +// +// The larger prime will have a length of |bits| (e.g. 2048). The |seed| value +// allows others to generate and verify the same parameters and should be +// random input which is kept for reference. If |out_counter| or |out_h| are +// not NULL then the counter and h value used in the generation are written to +// them. +// +// The |cb| argument is passed to |BN_generate_prime_ex| and is thus called +// during the generation process in order to indicate progress. See the +// comments for that function for details. In addition to the calls made by +// |BN_generate_prime_ex|, |DSA_generate_parameters_ex| will call it with +// |event| equal to 2 and 3 at different stages of the process. +// +// It returns one on success and zero otherwise. +OPENSSL_EXPORT int DSA_generate_parameters_ex(DSA *dsa, unsigned bits, + const uint8_t *seed, + size_t seed_len, int *out_counter, + unsigned long *out_h, + BN_GENCB *cb); + +// DSAparams_dup returns a freshly allocated |DSA| that contains a copy of the +// parameters from |dsa|. It returns NULL on error. +OPENSSL_EXPORT DSA *DSAparams_dup(const DSA *dsa); + + +// Key generation. + +// DSA_generate_key generates a public/private key pair in |dsa|, which must +// already have parameters setup. It returns one on success and zero on +// error. +OPENSSL_EXPORT int DSA_generate_key(DSA *dsa); + + +// Signatures. + +// DSA_SIG_st (aka |DSA_SIG|) contains a DSA signature as a pair of integers. +struct DSA_SIG_st { + BIGNUM *r, *s; +}; + +// DSA_SIG_new returns a freshly allocated, DIG_SIG structure or NULL on error. +// Both |r| and |s| in the signature will be NULL. +OPENSSL_EXPORT DSA_SIG *DSA_SIG_new(void); + +// DSA_SIG_free frees the contents of |sig| and then frees |sig| itself. +OPENSSL_EXPORT void DSA_SIG_free(DSA_SIG *sig); + +// DSA_do_sign returns a signature of the hash in |digest| by the key in |dsa| +// and returns an allocated, DSA_SIG structure, or NULL on error. +OPENSSL_EXPORT DSA_SIG *DSA_do_sign(const uint8_t *digest, size_t digest_len, + const DSA *dsa); + +// DSA_do_verify verifies that |sig| is a valid signature, by the public key in +// |dsa|, of the hash in |digest|. It returns one if so, zero if invalid and -1 +// on error. +// +// WARNING: do not use. This function returns -1 for error, 0 for invalid and 1 +// for valid. However, this is dangerously different to the usual OpenSSL +// convention and could be a disaster if a user did |if (DSA_do_verify(...))|. +// Because of this, |DSA_check_signature| is a safer version of this. +// +// TODO(fork): deprecate. +OPENSSL_EXPORT int DSA_do_verify(const uint8_t *digest, size_t digest_len, + DSA_SIG *sig, const DSA *dsa); + +// DSA_do_check_signature sets |*out_valid| to zero. Then it verifies that |sig| +// is a valid signature, by the public key in |dsa| of the hash in |digest| +// and, if so, it sets |*out_valid| to one. +// +// It returns one if it was able to verify the signature as valid or invalid, +// and zero on error. +OPENSSL_EXPORT int DSA_do_check_signature(int *out_valid, const uint8_t *digest, + size_t digest_len, DSA_SIG *sig, + const DSA *dsa); + + +// ASN.1 signatures. +// +// These functions also perform DSA signature operations, but deal with ASN.1 +// encoded signatures as opposed to raw |BIGNUM|s. If you don't know what +// encoding a DSA signature is in, it's probably ASN.1. + +// DSA_sign signs |digest| with the key in |dsa| and writes the resulting +// signature, in ASN.1 form, to |out_sig| and the length of the signature to +// |*out_siglen|. There must be, at least, |DSA_size(dsa)| bytes of space in +// |out_sig|. It returns one on success and zero otherwise. +// +// (The |type| argument is ignored.) +OPENSSL_EXPORT int DSA_sign(int type, const uint8_t *digest, size_t digest_len, + uint8_t *out_sig, unsigned int *out_siglen, + const DSA *dsa); + +// DSA_verify verifies that |sig| is a valid, ASN.1 signature, by the public +// key in |dsa|, of the hash in |digest|. It returns one if so, zero if invalid +// and -1 on error. +// +// (The |type| argument is ignored.) +// +// WARNING: do not use. This function returns -1 for error, 0 for invalid and 1 +// for valid. However, this is dangerously different to the usual OpenSSL +// convention and could be a disaster if a user did |if (DSA_do_verify(...))|. +// Because of this, |DSA_check_signature| is a safer version of this. +// +// TODO(fork): deprecate. +OPENSSL_EXPORT int DSA_verify(int type, const uint8_t *digest, + size_t digest_len, const uint8_t *sig, + size_t sig_len, const DSA *dsa); + +// DSA_check_signature sets |*out_valid| to zero. Then it verifies that |sig| +// is a valid, ASN.1 signature, by the public key in |dsa|, of the hash in +// |digest|. If so, it sets |*out_valid| to one. +// +// It returns one if it was able to verify the signature as valid or invalid, +// and zero on error. +OPENSSL_EXPORT int DSA_check_signature(int *out_valid, const uint8_t *digest, + size_t digest_len, const uint8_t *sig, + size_t sig_len, const DSA *dsa); + +// DSA_size returns the size, in bytes, of an ASN.1 encoded, DSA signature +// generated by |dsa|. Parameters must already have been setup in |dsa|. +OPENSSL_EXPORT int DSA_size(const DSA *dsa); + + +// ASN.1 encoding. + +// DSA_SIG_parse parses a DER-encoded DSA-Sig-Value structure from |cbs| and +// advances |cbs|. It returns a newly-allocated |DSA_SIG| or NULL on error. +OPENSSL_EXPORT DSA_SIG *DSA_SIG_parse(CBS *cbs); + +// DSA_SIG_marshal marshals |sig| as a DER-encoded DSA-Sig-Value and appends the +// result to |cbb|. It returns one on success and zero on error. +OPENSSL_EXPORT int DSA_SIG_marshal(CBB *cbb, const DSA_SIG *sig); + +// DSA_parse_public_key parses a DER-encoded DSA public key from |cbs| and +// advances |cbs|. It returns a newly-allocated |DSA| or NULL on error. +OPENSSL_EXPORT DSA *DSA_parse_public_key(CBS *cbs); + +// DSA_marshal_public_key marshals |dsa| as a DER-encoded DSA public key and +// appends the result to |cbb|. It returns one on success and zero on +// failure. +OPENSSL_EXPORT int DSA_marshal_public_key(CBB *cbb, const DSA *dsa); + +// DSA_parse_private_key parses a DER-encoded DSA private key from |cbs| and +// advances |cbs|. It returns a newly-allocated |DSA| or NULL on error. +OPENSSL_EXPORT DSA *DSA_parse_private_key(CBS *cbs); + +// DSA_marshal_private_key marshals |dsa| as a DER-encoded DSA private key and +// appends the result to |cbb|. It returns one on success and zero on +// failure. +OPENSSL_EXPORT int DSA_marshal_private_key(CBB *cbb, const DSA *dsa); + +// DSA_parse_parameters parses a DER-encoded Dss-Parms structure (RFC 3279) +// from |cbs| and advances |cbs|. It returns a newly-allocated |DSA| or NULL on +// error. +OPENSSL_EXPORT DSA *DSA_parse_parameters(CBS *cbs); + +// DSA_marshal_parameters marshals |dsa| as a DER-encoded Dss-Parms structure +// (RFC 3447) and appends the result to |cbb|. It returns one on success and +// zero on failure. +OPENSSL_EXPORT int DSA_marshal_parameters(CBB *cbb, const DSA *dsa); + + +// Conversion. + +// DSA_dup_DH returns a |DH| constructed from the parameters of |dsa|. This is +// sometimes needed when Diffie-Hellman parameters are stored in the form of +// DSA parameters. It returns an allocated |DH| on success or NULL on error. +OPENSSL_EXPORT DH *DSA_dup_DH(const DSA *dsa); + + +// ex_data functions. +// +// See |ex_data.h| for details. + +OPENSSL_EXPORT int DSA_get_ex_new_index(long argl, void *argp, + CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func); +OPENSSL_EXPORT int DSA_set_ex_data(DSA *dsa, int idx, void *arg); +OPENSSL_EXPORT void *DSA_get_ex_data(const DSA *dsa, int idx); + + +// Deprecated functions. + +// d2i_DSA_SIG parses an ASN.1, DER-encoded, DSA signature from |len| bytes at +// |*inp|. If |out_sig| is not NULL then, on exit, a pointer to the result is +// in |*out_sig|. Note that, even if |*out_sig| is already non-NULL on entry, it +// will not be written to. Rather, a fresh |DSA_SIG| is allocated and the +// previous one is freed. On successful exit, |*inp| is advanced past the DER +// structure. It returns the result or NULL on error. +// +// Use |DSA_SIG_parse| instead. +OPENSSL_EXPORT DSA_SIG *d2i_DSA_SIG(DSA_SIG **out_sig, const uint8_t **inp, + long len); + +// i2d_DSA_SIG marshals |in| to an ASN.1, DER structure. If |outp| is not NULL +// then the result is written to |*outp| and |*outp| is advanced just past the +// output. It returns the number of bytes in the result, whether written or not, +// or a negative value on error. +// +// Use |DSA_SIG_marshal| instead. +OPENSSL_EXPORT int i2d_DSA_SIG(const DSA_SIG *in, uint8_t **outp); + +// d2i_DSAPublicKey parses an ASN.1, DER-encoded, DSA public key from |len| +// bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the result +// is in |*out|. Note that, even if |*ou| is already non-NULL on entry, it will +// not be written to. Rather, a fresh |DSA| is allocated and the previous one is +// freed. On successful exit, |*inp| is advanced past the DER structure. It +// returns the result or NULL on error. +// +// Use |DSA_parse_public_key| instead. +OPENSSL_EXPORT DSA *d2i_DSAPublicKey(DSA **out, const uint8_t **inp, long len); + +// i2d_DSAPublicKey marshals a public key from |in| to an ASN.1, DER structure. +// If |outp| is not NULL then the result is written to |*outp| and |*outp| is +// advanced just past the output. It returns the number of bytes in the result, +// whether written or not, or a negative value on error. +// +// Use |DSA_marshal_public_key| instead. +OPENSSL_EXPORT int i2d_DSAPublicKey(const DSA *in, uint8_t **outp); + +// d2i_DSAPrivateKey parses an ASN.1, DER-encoded, DSA private key from |len| +// bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the result +// is in |*out|. Note that, even if |*out| is already non-NULL on entry, it will +// not be written to. Rather, a fresh |DSA| is allocated and the previous one is +// freed. On successful exit, |*inp| is advanced past the DER structure. It +// returns the result or NULL on error. +// +// Use |DSA_parse_private_key| instead. +OPENSSL_EXPORT DSA *d2i_DSAPrivateKey(DSA **out, const uint8_t **inp, long len); + +// i2d_DSAPrivateKey marshals a private key from |in| to an ASN.1, DER +// structure. If |outp| is not NULL then the result is written to |*outp| and +// |*outp| is advanced just past the output. It returns the number of bytes in +// the result, whether written or not, or a negative value on error. +// +// Use |DSA_marshal_private_key| instead. +OPENSSL_EXPORT int i2d_DSAPrivateKey(const DSA *in, uint8_t **outp); + +// d2i_DSAparams parses ASN.1, DER-encoded, DSA parameters from |len| bytes at +// |*inp|. If |out| is not NULL then, on exit, a pointer to the result is in +// |*out|. Note that, even if |*out| is already non-NULL on entry, it will not +// be written to. Rather, a fresh |DSA| is allocated and the previous one is +// freed. On successful exit, |*inp| is advanced past the DER structure. It +// returns the result or NULL on error. +// +// Use |DSA_parse_parameters| instead. +OPENSSL_EXPORT DSA *d2i_DSAparams(DSA **out, const uint8_t **inp, long len); + +// i2d_DSAparams marshals DSA parameters from |in| to an ASN.1, DER structure. +// If |outp| is not NULL then the result is written to |*outp| and |*outp| is +// advanced just past the output. It returns the number of bytes in the result, +// whether written or not, or a negative value on error. +// +// Use |DSA_marshal_parameters| instead. +OPENSSL_EXPORT int i2d_DSAparams(const DSA *in, uint8_t **outp); + +// DSA_generate_parameters is a deprecated version of +// |DSA_generate_parameters_ex| that creates and returns a |DSA*|. Don't use +// it. +OPENSSL_EXPORT DSA *DSA_generate_parameters(int bits, unsigned char *seed, + int seed_len, int *counter_ret, + unsigned long *h_ret, + void (*callback)(int, int, void *), + void *cb_arg); + + +struct dsa_st { + long version; + BIGNUM *p; + BIGNUM *q; // == 20 + BIGNUM *g; + + BIGNUM *pub_key; // y public key + BIGNUM *priv_key; // x private key + + int flags; + // Normally used to cache montgomery values + CRYPTO_MUTEX method_mont_lock; + BN_MONT_CTX *method_mont_p; + BN_MONT_CTX *method_mont_q; + CRYPTO_refcount_t references; + CRYPTO_EX_DATA ex_data; +}; + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(DSA, DSA_free) +BORINGSSL_MAKE_UP_REF(DSA, DSA_up_ref) +BORINGSSL_MAKE_DELETER(DSA_SIG, DSA_SIG_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define DSA_R_BAD_Q_VALUE 100 +#define DSA_R_MISSING_PARAMETERS 101 +#define DSA_R_MODULUS_TOO_LARGE 102 +#define DSA_R_NEED_NEW_SETUP_VALUES 103 +#define DSA_R_BAD_VERSION 104 +#define DSA_R_DECODE_ERROR 105 +#define DSA_R_ENCODE_ERROR 106 +#define DSA_R_INVALID_PARAMETERS 107 + +#endif // OPENSSL_HEADER_DSA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/dsa.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/dsa.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.grpc_back index 2966f9d5f..8e3b9b3c1 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/dsa.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dsa.h.grpc_back @@ -73,6 +73,10 @@ extern "C" { // DSA contains functions for signing and verifying with the Digital Signature // Algorithm. +// +// This module is deprecated and retained for legacy reasons only. It is not +// considered a priority for performance or hardening work. Do not use it in +// new code. Use Ed25519, ECDSA with P-256, or RSA instead. // Allocation and destruction. @@ -413,12 +417,13 @@ struct dsa_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(DSA, DSA_free) +BORINGSSL_MAKE_UP_REF(DSA, DSA_up_ref) BORINGSSL_MAKE_DELETER(DSA_SIG, DSA_SIG_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -431,5 +436,6 @@ BORINGSSL_MAKE_DELETER(DSA_SIG, DSA_SIG_free) #define DSA_R_BAD_VERSION 104 #define DSA_R_DECODE_ERROR 105 #define DSA_R_ENCODE_ERROR 106 +#define DSA_R_INVALID_PARAMETERS 107 #endif // OPENSSL_HEADER_DSA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/dtls1.h b/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/dtls1.h rename to Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/dtls1.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/dtls1.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.grpc_back new file mode 100644 index 000000000..38ca801cb --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/dtls1.h.grpc_back @@ -0,0 +1,16 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h b/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h new file mode 100644 index 000000000..4095f63ed --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h @@ -0,0 +1,18 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.back new file mode 100644 index 000000000..f2d8bac8a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.back @@ -0,0 +1,18 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.grpc_back new file mode 100644 index 000000000..f2d8bac8a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/e_os2.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include diff --git a/Pods/BoringSSL-GRPC/include/openssl/ec.h b/Pods/BoringSSL-GRPC/src/include/openssl/ec.h similarity index 91% rename from Pods/BoringSSL-GRPC/include/openssl/ec.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ec.h index 94772b0a8..6944b776c 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ec.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ec.h @@ -102,7 +102,7 @@ typedef enum { // Elliptic curve groups. // EC_GROUP_new_by_curve_name returns a fresh EC_GROUP object for the elliptic -// curve specified by |nid|, or NULL on error. +// curve specified by |nid|, or NULL on unsupported NID or allocation failure. // // The supported NIDs are: // NID_secp224r1 (P-224), @@ -114,11 +114,10 @@ typedef enum { // more modern primitives. OPENSSL_EXPORT EC_GROUP *EC_GROUP_new_by_curve_name(int nid); -// EC_GROUP_free frees |group| and the data that it points to. +// EC_GROUP_free releases a reference to |group|. OPENSSL_EXPORT void EC_GROUP_free(EC_GROUP *group); -// EC_GROUP_dup returns a fresh |EC_GROUP| which is equal to |a| or NULL on -// error. +// EC_GROUP_dup takes a reference to |a| and returns it. OPENSSL_EXPORT EC_GROUP *EC_GROUP_dup(const EC_GROUP *a); // EC_GROUP_cmp returns zero if |a| and |b| are the same group and non-zero @@ -134,6 +133,9 @@ OPENSSL_EXPORT const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); // |group| that specifies the order of the group. OPENSSL_EXPORT const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); +// EC_GROUP_order_bits returns the number of bits of the order of |group|. +OPENSSL_EXPORT int EC_GROUP_order_bits(const EC_GROUP *group); + // EC_GROUP_get_cofactor sets |*cofactor| to the cofactor of |group| using // |ctx|, if it's not NULL. It returns one on success and zero otherwise. OPENSSL_EXPORT int EC_GROUP_get_cofactor(const EC_GROUP *group, @@ -155,6 +157,16 @@ OPENSSL_EXPORT int EC_GROUP_get_curve_name(const EC_GROUP *group); // element of the field underlying |group|. OPENSSL_EXPORT unsigned EC_GROUP_get_degree(const EC_GROUP *group); +// EC_curve_nid2nist returns the NIST name of the elliptic curve specified by +// |nid|, or NULL if |nid| is not a NIST curve. For example, it returns "P-256" +// for |NID_X9_62_prime256v1|. +OPENSSL_EXPORT const char *EC_curve_nid2nist(int nid); + +// EC_curve_nist2nid returns the NID of the elliptic curve specified by the NIST +// name |name|, or |NID_undef| if |name| is not a recognized name. For example, +// it returns |NID_X9_62_prime256v1| for "P-256". +OPENSSL_EXPORT int EC_curve_nist2nid(const char *name); + // Points on elliptic curves. @@ -195,17 +207,6 @@ OPENSSL_EXPORT int EC_POINT_is_on_curve(const EC_GROUP *group, OPENSSL_EXPORT int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); -// EC_POINT_make_affine converts |point| to affine form, internally. It returns -// one on success and zero otherwise. If |ctx| is not NULL, it may be used. -OPENSSL_EXPORT int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, - BN_CTX *ctx); - -// EC_POINTs_make_affine converts |num| points from |points| to affine form, -// internally. It returns one on success and zero otherwise. If |ctx| is not -// NULL, it may be used. -OPENSSL_EXPORT int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, - EC_POINT *points[], BN_CTX *ctx); - // Point conversion. @@ -222,8 +223,14 @@ OPENSSL_EXPORT int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, // EC_POINT_set_affine_coordinates_GFp sets the value of |point| to be // (|x|, |y|). The |ctx| argument may be used if not NULL. It returns one -// on success or zero on error. Note that, unlike with OpenSSL, it's -// considered an error if the point is not on the curve. +// on success or zero on error. It's considered an error if the point is not on +// the curve. +// +// Note that the corresponding function in OpenSSL versions prior to 1.0.2s does +// not check if the point is on the curve. This is a security-critical check, so +// code additionally supporting OpenSSL should repeat the check with +// |EC_POINT_is_on_curve| or check for older OpenSSL versions with +// |OPENSSL_VERSION_NUMBER|. OPENSSL_EXPORT int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, const BIGNUM *x, @@ -247,8 +254,9 @@ OPENSSL_EXPORT int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, BN_CTX *ctx); // EC_POINT_oct2point sets |point| from |len| bytes of X9.62 format -// serialisation in |buf|. It returns one on success and zero otherwise. The -// |ctx| argument may be used if not NULL. +// serialisation in |buf|. It returns one on success and zero on error. The +// |ctx| argument may be used if not NULL. It's considered an error if |buf| +// does not represent a point on the curve. OPENSSL_EXPORT int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, const uint8_t *buf, size_t len, BN_CTX *ctx); @@ -324,10 +332,11 @@ OPENSSL_EXPORT int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, OPENSSL_EXPORT void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); #define OPENSSL_EC_NAMED_CURVE 0 +#define OPENSSL_EC_EXPLICIT_CURVE 1 typedef struct ec_method_st EC_METHOD; -// EC_GROUP_method_of returns NULL. +// EC_GROUP_method_of returns a dummy non-NULL pointer. OPENSSL_EXPORT const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); // EC_METHOD_get_field_type returns NID_X9_62_prime_field. @@ -355,21 +364,23 @@ OPENSSL_EXPORT size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, // EC_POINT_clear_free calls |EC_POINT_free|. OPENSSL_EXPORT void EC_POINT_clear_free(EC_POINT *point); -// Old code expects to get EC_KEY from ec.h. -#include - #if defined(__cplusplus) } // extern C +#endif +// Old code expects to get EC_KEY from ec.h. +#include + +#if defined(__cplusplus) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EC_POINT, EC_POINT_free) BORINGSSL_MAKE_DELETER(EC_GROUP, EC_GROUP_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.back new file mode 100644 index 000000000..cfad93e14 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.back @@ -0,0 +1,424 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_EC_H +#define OPENSSL_HEADER_EC_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Low-level operations on elliptic curves. + + +// point_conversion_form_t enumerates forms, as defined in X9.62 (ECDSA), for +// the encoding of a elliptic curve point (x,y) +typedef enum { + // POINT_CONVERSION_COMPRESSED indicates that the point is encoded as z||x, + // where the octet z specifies which solution of the quadratic equation y + // is. + POINT_CONVERSION_COMPRESSED = 2, + + // POINT_CONVERSION_UNCOMPRESSED indicates that the point is encoded as + // z||x||y, where z is the octet 0x04. + POINT_CONVERSION_UNCOMPRESSED = 4, + + // POINT_CONVERSION_HYBRID indicates that the point is encoded as z||x||y, + // where z specifies which solution of the quadratic equation y is. This is + // not supported by the code and has never been observed in use. + // + // TODO(agl): remove once node.js no longer references this. + POINT_CONVERSION_HYBRID = 6, +} point_conversion_form_t; + + +// Elliptic curve groups. + +// EC_GROUP_new_by_curve_name returns a fresh EC_GROUP object for the elliptic +// curve specified by |nid|, or NULL on unsupported NID or allocation failure. +// +// The supported NIDs are: +// NID_secp224r1 (P-224), +// NID_X9_62_prime256v1 (P-256), +// NID_secp384r1 (P-384), +// NID_secp521r1 (P-521) +// +// If in doubt, use |NID_X9_62_prime256v1|, or see the curve25519.h header for +// more modern primitives. +OPENSSL_EXPORT EC_GROUP *EC_GROUP_new_by_curve_name(int nid); + +// EC_GROUP_free releases a reference to |group|. +OPENSSL_EXPORT void EC_GROUP_free(EC_GROUP *group); + +// EC_GROUP_dup takes a reference to |a| and returns it. +OPENSSL_EXPORT EC_GROUP *EC_GROUP_dup(const EC_GROUP *a); + +// EC_GROUP_cmp returns zero if |a| and |b| are the same group and non-zero +// otherwise. +OPENSSL_EXPORT int EC_GROUP_cmp(const EC_GROUP *a, const EC_GROUP *b, + BN_CTX *ignored); + +// EC_GROUP_get0_generator returns a pointer to the internal |EC_POINT| object +// in |group| that specifies the generator for the group. +OPENSSL_EXPORT const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); + +// EC_GROUP_get0_order returns a pointer to the internal |BIGNUM| object in +// |group| that specifies the order of the group. +OPENSSL_EXPORT const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); + +// EC_GROUP_order_bits returns the number of bits of the order of |group|. +OPENSSL_EXPORT int EC_GROUP_order_bits(const EC_GROUP *group); + +// EC_GROUP_get_cofactor sets |*cofactor| to the cofactor of |group| using +// |ctx|, if it's not NULL. It returns one on success and zero otherwise. +OPENSSL_EXPORT int EC_GROUP_get_cofactor(const EC_GROUP *group, + BIGNUM *cofactor, BN_CTX *ctx); + +// EC_GROUP_get_curve_GFp gets various parameters about a group. It sets +// |*out_p| to the order of the coordinate field and |*out_a| and |*out_b| to +// the parameters of the curve when expressed as y² = x³ + ax + b. Any of the +// output parameters can be NULL. It returns one on success and zero on +// error. +OPENSSL_EXPORT int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *out_p, + BIGNUM *out_a, BIGNUM *out_b, + BN_CTX *ctx); + +// EC_GROUP_get_curve_name returns a NID that identifies |group|. +OPENSSL_EXPORT int EC_GROUP_get_curve_name(const EC_GROUP *group); + +// EC_GROUP_get_degree returns the number of bits needed to represent an +// element of the field underlying |group|. +OPENSSL_EXPORT unsigned EC_GROUP_get_degree(const EC_GROUP *group); + +// EC_curve_nid2nist returns the NIST name of the elliptic curve specified by +// |nid|, or NULL if |nid| is not a NIST curve. For example, it returns "P-256" +// for |NID_X9_62_prime256v1|. +OPENSSL_EXPORT const char *EC_curve_nid2nist(int nid); + +// EC_curve_nist2nid returns the NID of the elliptic curve specified by the NIST +// name |name|, or |NID_undef| if |name| is not a recognized name. For example, +// it returns |NID_X9_62_prime256v1| for "P-256". +OPENSSL_EXPORT int EC_curve_nist2nid(const char *name); + + +// Points on elliptic curves. + +// EC_POINT_new returns a fresh |EC_POINT| object in the given group, or NULL +// on error. +OPENSSL_EXPORT EC_POINT *EC_POINT_new(const EC_GROUP *group); + +// EC_POINT_free frees |point| and the data that it points to. +OPENSSL_EXPORT void EC_POINT_free(EC_POINT *point); + +// EC_POINT_copy sets |*dest| equal to |*src|. It returns one on success and +// zero otherwise. +OPENSSL_EXPORT int EC_POINT_copy(EC_POINT *dest, const EC_POINT *src); + +// EC_POINT_dup returns a fresh |EC_POINT| that contains the same values as +// |src|, or NULL on error. +OPENSSL_EXPORT EC_POINT *EC_POINT_dup(const EC_POINT *src, + const EC_GROUP *group); + +// EC_POINT_set_to_infinity sets |point| to be the "point at infinity" for the +// given group. +OPENSSL_EXPORT int EC_POINT_set_to_infinity(const EC_GROUP *group, + EC_POINT *point); + +// EC_POINT_is_at_infinity returns one iff |point| is the point at infinity and +// zero otherwise. +OPENSSL_EXPORT int EC_POINT_is_at_infinity(const EC_GROUP *group, + const EC_POINT *point); + +// EC_POINT_is_on_curve returns one if |point| is an element of |group| and +// and zero otherwise or when an error occurs. This is different from OpenSSL, +// which returns -1 on error. If |ctx| is non-NULL, it may be used. +OPENSSL_EXPORT int EC_POINT_is_on_curve(const EC_GROUP *group, + const EC_POINT *point, BN_CTX *ctx); + +// EC_POINT_cmp returns zero if |a| is equal to |b|, greater than zero if +// not equal and -1 on error. If |ctx| is not NULL, it may be used. +OPENSSL_EXPORT int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, + const EC_POINT *b, BN_CTX *ctx); + + +// Point conversion. + +// EC_POINT_get_affine_coordinates_GFp sets |x| and |y| to the affine value of +// |point| using |ctx|, if it's not NULL. It returns one on success and zero +// otherwise. +// +// Either |x| or |y| may be NULL to skip computing that coordinate. This is +// slightly faster in the common case where only the x-coordinate is needed. +OPENSSL_EXPORT int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, + const EC_POINT *point, + BIGNUM *x, BIGNUM *y, + BN_CTX *ctx); + +// EC_POINT_set_affine_coordinates_GFp sets the value of |point| to be +// (|x|, |y|). The |ctx| argument may be used if not NULL. It returns one +// on success or zero on error. It's considered an error if the point is not on +// the curve. +// +// Note that the corresponding function in OpenSSL versions prior to 1.0.2s does +// not check if the point is on the curve. This is a security-critical check, so +// code additionally supporting OpenSSL should repeat the check with +// |EC_POINT_is_on_curve| or check for older OpenSSL versions with +// |OPENSSL_VERSION_NUMBER|. +OPENSSL_EXPORT int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, + EC_POINT *point, + const BIGNUM *x, + const BIGNUM *y, + BN_CTX *ctx); + +// EC_POINT_point2oct serialises |point| into the X9.62 form given by |form| +// into, at most, |len| bytes at |buf|. It returns the number of bytes written +// or zero on error if |buf| is non-NULL, else the number of bytes needed. The +// |ctx| argument may be used if not NULL. +OPENSSL_EXPORT size_t EC_POINT_point2oct(const EC_GROUP *group, + const EC_POINT *point, + point_conversion_form_t form, + uint8_t *buf, size_t len, BN_CTX *ctx); + +// EC_POINT_point2cbb behaves like |EC_POINT_point2oct| but appends the +// serialised point to |cbb|. It returns one on success and zero on error. +OPENSSL_EXPORT int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, + const EC_POINT *point, + point_conversion_form_t form, + BN_CTX *ctx); + +// EC_POINT_oct2point sets |point| from |len| bytes of X9.62 format +// serialisation in |buf|. It returns one on success and zero on error. The +// |ctx| argument may be used if not NULL. It's considered an error if |buf| +// does not represent a point on the curve. +OPENSSL_EXPORT int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, + const uint8_t *buf, size_t len, + BN_CTX *ctx); + +// EC_POINT_set_compressed_coordinates_GFp sets |point| to equal the point with +// the given |x| coordinate and the y coordinate specified by |y_bit| (see +// X9.62). It returns one on success and zero otherwise. +OPENSSL_EXPORT int EC_POINT_set_compressed_coordinates_GFp( + const EC_GROUP *group, EC_POINT *point, const BIGNUM *x, int y_bit, + BN_CTX *ctx); + + +// Group operations. + +// EC_POINT_add sets |r| equal to |a| plus |b|. It returns one on success and +// zero otherwise. If |ctx| is not NULL, it may be used. +OPENSSL_EXPORT int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, + const EC_POINT *a, const EC_POINT *b, + BN_CTX *ctx); + +// EC_POINT_dbl sets |r| equal to |a| plus |a|. It returns one on success and +// zero otherwise. If |ctx| is not NULL, it may be used. +OPENSSL_EXPORT int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, + const EC_POINT *a, BN_CTX *ctx); + +// EC_POINT_invert sets |a| equal to minus |a|. It returns one on success and +// zero otherwise. If |ctx| is not NULL, it may be used. +OPENSSL_EXPORT int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, + BN_CTX *ctx); + +// EC_POINT_mul sets r = generator*n + q*m. It returns one on success and zero +// otherwise. If |ctx| is not NULL, it may be used. +OPENSSL_EXPORT int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, + const BIGNUM *n, const EC_POINT *q, + const BIGNUM *m, BN_CTX *ctx); + + +// Deprecated functions. + +// EC_GROUP_new_curve_GFp creates a new, arbitrary elliptic curve group based +// on the equation y² = x³ + a·x + b. It returns the new group or NULL on +// error. +// +// This new group has no generator. It is an error to use a generator-less group +// with any functions except for |EC_GROUP_free|, |EC_POINT_new|, +// |EC_POINT_set_affine_coordinates_GFp|, and |EC_GROUP_set_generator|. +// +// |EC_GROUP|s returned by this function will always compare as unequal via +// |EC_GROUP_cmp| (even to themselves). |EC_GROUP_get_curve_name| will always +// return |NID_undef|. +// +// Avoid using arbitrary curves and use |EC_GROUP_new_by_curve_name| instead. +OPENSSL_EXPORT EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, + const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); + +// EC_GROUP_set_generator sets the generator for |group| to |generator|, which +// must have the given order and cofactor. It may only be used with |EC_GROUP| +// objects returned by |EC_GROUP_new_curve_GFp| and may only be used once on +// each group. |generator| must have been created using |group|. +OPENSSL_EXPORT int EC_GROUP_set_generator(EC_GROUP *group, + const EC_POINT *generator, + const BIGNUM *order, + const BIGNUM *cofactor); + +// EC_GROUP_get_order sets |*order| to the order of |group|, if it's not +// NULL. It returns one on success and zero otherwise. |ctx| is ignored. Use +// |EC_GROUP_get0_order| instead. +OPENSSL_EXPORT int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, + BN_CTX *ctx); + +// EC_GROUP_set_asn1_flag does nothing. +OPENSSL_EXPORT void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); + +#define OPENSSL_EC_NAMED_CURVE 0 +#define OPENSSL_EC_EXPLICIT_CURVE 1 + +typedef struct ec_method_st EC_METHOD; + +// EC_GROUP_method_of returns a dummy non-NULL pointer. +OPENSSL_EXPORT const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); + +// EC_METHOD_get_field_type returns NID_X9_62_prime_field. +OPENSSL_EXPORT int EC_METHOD_get_field_type(const EC_METHOD *meth); + +// EC_GROUP_set_point_conversion_form aborts the process if |form| is not +// |POINT_CONVERSION_UNCOMPRESSED| and otherwise does nothing. +OPENSSL_EXPORT void EC_GROUP_set_point_conversion_form( + EC_GROUP *group, point_conversion_form_t form); + +// EC_builtin_curve describes a supported elliptic curve. +typedef struct { + int nid; + const char *comment; +} EC_builtin_curve; + +// EC_get_builtin_curves writes at most |max_num_curves| elements to +// |out_curves| and returns the total number that it would have written, had +// |max_num_curves| been large enough. +// +// The |EC_builtin_curve| items describe the supported elliptic curves. +OPENSSL_EXPORT size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, + size_t max_num_curves); + +// EC_POINT_clear_free calls |EC_POINT_free|. +OPENSSL_EXPORT void EC_POINT_clear_free(EC_POINT *point); + + +#if defined(__cplusplus) +} // extern C +#endif + +// Old code expects to get EC_KEY from ec.h. +#include + +#if defined(__cplusplus) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(EC_POINT, EC_POINT_free) +BORINGSSL_MAKE_DELETER(EC_GROUP, EC_GROUP_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define EC_R_BUFFER_TOO_SMALL 100 +#define EC_R_COORDINATES_OUT_OF_RANGE 101 +#define EC_R_D2I_ECPKPARAMETERS_FAILURE 102 +#define EC_R_EC_GROUP_NEW_BY_NAME_FAILURE 103 +#define EC_R_GROUP2PKPARAMETERS_FAILURE 104 +#define EC_R_I2D_ECPKPARAMETERS_FAILURE 105 +#define EC_R_INCOMPATIBLE_OBJECTS 106 +#define EC_R_INVALID_COMPRESSED_POINT 107 +#define EC_R_INVALID_COMPRESSION_BIT 108 +#define EC_R_INVALID_ENCODING 109 +#define EC_R_INVALID_FIELD 110 +#define EC_R_INVALID_FORM 111 +#define EC_R_INVALID_GROUP_ORDER 112 +#define EC_R_INVALID_PRIVATE_KEY 113 +#define EC_R_MISSING_PARAMETERS 114 +#define EC_R_MISSING_PRIVATE_KEY 115 +#define EC_R_NON_NAMED_CURVE 116 +#define EC_R_NOT_INITIALIZED 117 +#define EC_R_PKPARAMETERS2GROUP_FAILURE 118 +#define EC_R_POINT_AT_INFINITY 119 +#define EC_R_POINT_IS_NOT_ON_CURVE 120 +#define EC_R_SLOT_FULL 121 +#define EC_R_UNDEFINED_GENERATOR 122 +#define EC_R_UNKNOWN_GROUP 123 +#define EC_R_UNKNOWN_ORDER 124 +#define EC_R_WRONG_ORDER 125 +#define EC_R_BIGNUM_OUT_OF_RANGE 126 +#define EC_R_WRONG_CURVE_PARAMETERS 127 +#define EC_R_DECODE_ERROR 128 +#define EC_R_ENCODE_ERROR 129 +#define EC_R_GROUP_MISMATCH 130 +#define EC_R_INVALID_COFACTOR 131 +#define EC_R_PUBLIC_KEY_VALIDATION_FAILED 132 +#define EC_R_INVALID_SCALAR 133 + +#endif // OPENSSL_HEADER_EC_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ec.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/include/openssl/ec.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ec.h.grpc_back index 5eee36617..cfad93e14 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ec.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ec.h.grpc_back @@ -102,7 +102,7 @@ typedef enum { // Elliptic curve groups. // EC_GROUP_new_by_curve_name returns a fresh EC_GROUP object for the elliptic -// curve specified by |nid|, or NULL on error. +// curve specified by |nid|, or NULL on unsupported NID or allocation failure. // // The supported NIDs are: // NID_secp224r1 (P-224), @@ -114,11 +114,10 @@ typedef enum { // more modern primitives. OPENSSL_EXPORT EC_GROUP *EC_GROUP_new_by_curve_name(int nid); -// EC_GROUP_free frees |group| and the data that it points to. +// EC_GROUP_free releases a reference to |group|. OPENSSL_EXPORT void EC_GROUP_free(EC_GROUP *group); -// EC_GROUP_dup returns a fresh |EC_GROUP| which is equal to |a| or NULL on -// error. +// EC_GROUP_dup takes a reference to |a| and returns it. OPENSSL_EXPORT EC_GROUP *EC_GROUP_dup(const EC_GROUP *a); // EC_GROUP_cmp returns zero if |a| and |b| are the same group and non-zero @@ -134,6 +133,9 @@ OPENSSL_EXPORT const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); // |group| that specifies the order of the group. OPENSSL_EXPORT const BIGNUM *EC_GROUP_get0_order(const EC_GROUP *group); +// EC_GROUP_order_bits returns the number of bits of the order of |group|. +OPENSSL_EXPORT int EC_GROUP_order_bits(const EC_GROUP *group); + // EC_GROUP_get_cofactor sets |*cofactor| to the cofactor of |group| using // |ctx|, if it's not NULL. It returns one on success and zero otherwise. OPENSSL_EXPORT int EC_GROUP_get_cofactor(const EC_GROUP *group, @@ -155,6 +157,16 @@ OPENSSL_EXPORT int EC_GROUP_get_curve_name(const EC_GROUP *group); // element of the field underlying |group|. OPENSSL_EXPORT unsigned EC_GROUP_get_degree(const EC_GROUP *group); +// EC_curve_nid2nist returns the NIST name of the elliptic curve specified by +// |nid|, or NULL if |nid| is not a NIST curve. For example, it returns "P-256" +// for |NID_X9_62_prime256v1|. +OPENSSL_EXPORT const char *EC_curve_nid2nist(int nid); + +// EC_curve_nist2nid returns the NID of the elliptic curve specified by the NIST +// name |name|, or |NID_undef| if |name| is not a recognized name. For example, +// it returns |NID_X9_62_prime256v1| for "P-256". +OPENSSL_EXPORT int EC_curve_nist2nid(const char *name); + // Points on elliptic curves. @@ -195,17 +207,6 @@ OPENSSL_EXPORT int EC_POINT_is_on_curve(const EC_GROUP *group, OPENSSL_EXPORT int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); -// EC_POINT_make_affine converts |point| to affine form, internally. It returns -// one on success and zero otherwise. If |ctx| is not NULL, it may be used. -OPENSSL_EXPORT int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, - BN_CTX *ctx); - -// EC_POINTs_make_affine converts |num| points from |points| to affine form, -// internally. It returns one on success and zero otherwise. If |ctx| is not -// NULL, it may be used. -OPENSSL_EXPORT int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, - EC_POINT *points[], BN_CTX *ctx); - // Point conversion. @@ -222,8 +223,14 @@ OPENSSL_EXPORT int EC_POINT_get_affine_coordinates_GFp(const EC_GROUP *group, // EC_POINT_set_affine_coordinates_GFp sets the value of |point| to be // (|x|, |y|). The |ctx| argument may be used if not NULL. It returns one -// on success or zero on error. Note that, unlike with OpenSSL, it's -// considered an error if the point is not on the curve. +// on success or zero on error. It's considered an error if the point is not on +// the curve. +// +// Note that the corresponding function in OpenSSL versions prior to 1.0.2s does +// not check if the point is on the curve. This is a security-critical check, so +// code additionally supporting OpenSSL should repeat the check with +// |EC_POINT_is_on_curve| or check for older OpenSSL versions with +// |OPENSSL_VERSION_NUMBER|. OPENSSL_EXPORT int EC_POINT_set_affine_coordinates_GFp(const EC_GROUP *group, EC_POINT *point, const BIGNUM *x, @@ -247,8 +254,9 @@ OPENSSL_EXPORT int EC_POINT_point2cbb(CBB *out, const EC_GROUP *group, BN_CTX *ctx); // EC_POINT_oct2point sets |point| from |len| bytes of X9.62 format -// serialisation in |buf|. It returns one on success and zero otherwise. The -// |ctx| argument may be used if not NULL. +// serialisation in |buf|. It returns one on success and zero on error. The +// |ctx| argument may be used if not NULL. It's considered an error if |buf| +// does not represent a point on the curve. OPENSSL_EXPORT int EC_POINT_oct2point(const EC_GROUP *group, EC_POINT *point, const uint8_t *buf, size_t len, BN_CTX *ctx); @@ -324,10 +332,11 @@ OPENSSL_EXPORT int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, OPENSSL_EXPORT void EC_GROUP_set_asn1_flag(EC_GROUP *group, int flag); #define OPENSSL_EC_NAMED_CURVE 0 +#define OPENSSL_EC_EXPLICIT_CURVE 1 typedef struct ec_method_st EC_METHOD; -// EC_GROUP_method_of returns NULL. +// EC_GROUP_method_of returns a dummy non-NULL pointer. OPENSSL_EXPORT const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); // EC_METHOD_get_field_type returns NID_X9_62_prime_field. @@ -355,21 +364,23 @@ OPENSSL_EXPORT size_t EC_get_builtin_curves(EC_builtin_curve *out_curves, // EC_POINT_clear_free calls |EC_POINT_free|. OPENSSL_EXPORT void EC_POINT_clear_free(EC_POINT *point); -// Old code expects to get EC_KEY from ec.h. -#include - #if defined(__cplusplus) } // extern C +#endif +// Old code expects to get EC_KEY from ec.h. +#include + +#if defined(__cplusplus) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EC_POINT, EC_POINT_free) BORINGSSL_MAKE_DELETER(EC_GROUP, EC_GROUP_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/ec_key.h b/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h similarity index 86% rename from Pods/BoringSSL-GRPC/include/openssl/ec_key.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h index b3e90429d..f2052fe03 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ec_key.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h @@ -84,6 +84,12 @@ extern "C" { // EC key objects. +// +// An |EC_KEY| object represents a public or private EC key. A given object may +// be used concurrently on multiple threads by non-mutating functions, provided +// no other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. // EC_KEY_new returns a fresh |EC_KEY| object or NULL on error. OPENSSL_EXPORT EC_KEY *EC_KEY_new(void); @@ -102,7 +108,8 @@ OPENSSL_EXPORT void EC_KEY_free(EC_KEY *key); // EC_KEY_dup returns a fresh copy of |src| or NULL on error. OPENSSL_EXPORT EC_KEY *EC_KEY_dup(const EC_KEY *src); -// EC_KEY_up_ref increases the reference count of |key| and returns one. +// EC_KEY_up_ref increases the reference count of |key| and returns one. It does +// not mutate |key| for thread-safety purposes and may be used concurrently. OPENSSL_EXPORT int EC_KEY_up_ref(EC_KEY *key); // EC_KEY_is_opaque returns one if |key| is opaque and doesn't expose its key @@ -113,8 +120,8 @@ OPENSSL_EXPORT int EC_KEY_is_opaque(const EC_KEY *key); OPENSSL_EXPORT const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key); // EC_KEY_set_group sets the |EC_GROUP| object that |key| will use to |group|. -// It returns one on success and zero otherwise. If |key| already has a group, -// it is an error to change to a different one. +// It returns one on success and zero if |key| is already configured with a +// different group. OPENSSL_EXPORT int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group); // EC_KEY_get0_private_key returns a pointer to the private key inside |key|. @@ -123,7 +130,7 @@ OPENSSL_EXPORT const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key); // EC_KEY_set_private_key sets the private key of |key| to |priv|. It returns // one on success and zero otherwise. |key| must already have had a group // configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|). -OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv); +OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv); // EC_KEY_get0_public_key returns a pointer to the public key point inside // |key|. @@ -165,10 +172,18 @@ OPENSSL_EXPORT int EC_KEY_check_key(const EC_KEY *key); OPENSSL_EXPORT int EC_KEY_check_fips(const EC_KEY *key); // EC_KEY_set_public_key_affine_coordinates sets the public key in |key| to -// (|x|, |y|). It returns one on success and zero otherwise. +// (|x|, |y|). It returns one on success and zero on error. It's considered an +// error if |x| and |y| do not represent a point on |key|'s curve. OPENSSL_EXPORT int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, - BIGNUM *x, - BIGNUM *y); + const BIGNUM *x, + const BIGNUM *y); + +// EC_KEY_key2buf encodes the public key in |key| to an allocated octet string +// and sets |*out_buf| to point to it. It returns the length of the encoded +// octet string or zero if an error occurred. +OPENSSL_EXPORT size_t EC_KEY_key2buf(const EC_KEY *key, + point_conversion_form_t form, + unsigned char **out_buf, BN_CTX *ctx); // Key generation. @@ -182,6 +197,20 @@ OPENSSL_EXPORT int EC_KEY_generate_key(EC_KEY *key); // additional checks for FIPS compliance. OPENSSL_EXPORT int EC_KEY_generate_key_fips(EC_KEY *key); +// EC_KEY_derive_from_secret deterministically derives a private key for |group| +// from an input secret using HKDF-SHA256. It returns a newly-allocated |EC_KEY| +// on success or NULL on error. |secret| must not be used in any other +// algorithm. If using a base secret for multiple operations, derive separate +// values with a KDF such as HKDF first. +// +// Note this function implements an arbitrary derivation scheme, rather than any +// particular standard one. New protocols are recommended to use X25519 and +// Ed25519, which have standard byte import functions. See +// |X25519_public_from_private| and |ED25519_keypair_from_seed|. +OPENSSL_EXPORT EC_KEY *EC_KEY_derive_from_secret(const EC_GROUP *group, + const uint8_t *secret, + size_t secret_len); + // Serialisation. @@ -329,11 +358,12 @@ OPENSSL_EXPORT int i2o_ECPublicKey(const EC_KEY *key, unsigned char **outp); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EC_KEY, EC_KEY_free) +BORINGSSL_MAKE_UP_REF(EC_KEY, EC_KEY_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.back new file mode 100644 index 000000000..932ad8e6c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.back @@ -0,0 +1,372 @@ +/* Originally written by Bodo Moeller for the OpenSSL project. + * ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * The elliptic curve binary polynomial software is originally written by + * Sheueling Chang Shantz and Douglas Stebila of Sun Microsystems + * Laboratories. */ + +#ifndef OPENSSL_HEADER_EC_KEY_H +#define OPENSSL_HEADER_EC_KEY_H + +#include + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// ec_key.h contains functions that handle elliptic-curve points that are +// public/private keys. + + +// EC key objects. +// +// An |EC_KEY| object represents a public or private EC key. A given object may +// be used concurrently on multiple threads by non-mutating functions, provided +// no other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. + +// EC_KEY_new returns a fresh |EC_KEY| object or NULL on error. +OPENSSL_EXPORT EC_KEY *EC_KEY_new(void); + +// EC_KEY_new_method acts the same as |EC_KEY_new|, but takes an explicit +// |ENGINE|. +OPENSSL_EXPORT EC_KEY *EC_KEY_new_method(const ENGINE *engine); + +// EC_KEY_new_by_curve_name returns a fresh EC_KEY for group specified by |nid| +// or NULL on error. +OPENSSL_EXPORT EC_KEY *EC_KEY_new_by_curve_name(int nid); + +// EC_KEY_free frees all the data owned by |key| and |key| itself. +OPENSSL_EXPORT void EC_KEY_free(EC_KEY *key); + +// EC_KEY_dup returns a fresh copy of |src| or NULL on error. +OPENSSL_EXPORT EC_KEY *EC_KEY_dup(const EC_KEY *src); + +// EC_KEY_up_ref increases the reference count of |key| and returns one. It does +// not mutate |key| for thread-safety purposes and may be used concurrently. +OPENSSL_EXPORT int EC_KEY_up_ref(EC_KEY *key); + +// EC_KEY_is_opaque returns one if |key| is opaque and doesn't expose its key +// material. Otherwise it return zero. +OPENSSL_EXPORT int EC_KEY_is_opaque(const EC_KEY *key); + +// EC_KEY_get0_group returns a pointer to the |EC_GROUP| object inside |key|. +OPENSSL_EXPORT const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key); + +// EC_KEY_set_group sets the |EC_GROUP| object that |key| will use to |group|. +// It returns one on success and zero if |key| is already configured with a +// different group. +OPENSSL_EXPORT int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group); + +// EC_KEY_get0_private_key returns a pointer to the private key inside |key|. +OPENSSL_EXPORT const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key); + +// EC_KEY_set_private_key sets the private key of |key| to |priv|. It returns +// one on success and zero otherwise. |key| must already have had a group +// configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|). +OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv); + +// EC_KEY_get0_public_key returns a pointer to the public key point inside +// |key|. +OPENSSL_EXPORT const EC_POINT *EC_KEY_get0_public_key(const EC_KEY *key); + +// EC_KEY_set_public_key sets the public key of |key| to |pub|, by copying it. +// It returns one on success and zero otherwise. |key| must already have had a +// group configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|), and +// |pub| must also belong to that group. +OPENSSL_EXPORT int EC_KEY_set_public_key(EC_KEY *key, const EC_POINT *pub); + +#define EC_PKEY_NO_PARAMETERS 0x001 +#define EC_PKEY_NO_PUBKEY 0x002 + +// EC_KEY_get_enc_flags returns the encoding flags for |key|, which is a +// bitwise-OR of |EC_PKEY_*| values. +OPENSSL_EXPORT unsigned EC_KEY_get_enc_flags(const EC_KEY *key); + +// EC_KEY_set_enc_flags sets the encoding flags for |key|, which is a +// bitwise-OR of |EC_PKEY_*| values. +OPENSSL_EXPORT void EC_KEY_set_enc_flags(EC_KEY *key, unsigned flags); + +// EC_KEY_get_conv_form returns the conversation form that will be used by +// |key|. +OPENSSL_EXPORT point_conversion_form_t EC_KEY_get_conv_form(const EC_KEY *key); + +// EC_KEY_set_conv_form sets the conversion form to be used by |key|. +OPENSSL_EXPORT void EC_KEY_set_conv_form(EC_KEY *key, + point_conversion_form_t cform); + +// EC_KEY_check_key performs several checks on |key| (possibly including an +// expensive check that the public key is in the primary subgroup). It returns +// one if all checks pass and zero otherwise. If it returns zero then detail +// about the problem can be found on the error stack. +OPENSSL_EXPORT int EC_KEY_check_key(const EC_KEY *key); + +// EC_KEY_check_fips performs a signing pairwise consistency test (FIPS 140-2 +// 4.9.2). It returns one if it passes and zero otherwise. +OPENSSL_EXPORT int EC_KEY_check_fips(const EC_KEY *key); + +// EC_KEY_set_public_key_affine_coordinates sets the public key in |key| to +// (|x|, |y|). It returns one on success and zero on error. It's considered an +// error if |x| and |y| do not represent a point on |key|'s curve. +OPENSSL_EXPORT int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, + const BIGNUM *x, + const BIGNUM *y); + +// EC_KEY_key2buf encodes the public key in |key| to an allocated octet string +// and sets |*out_buf| to point to it. It returns the length of the encoded +// octet string or zero if an error occurred. +OPENSSL_EXPORT size_t EC_KEY_key2buf(const EC_KEY *key, + point_conversion_form_t form, + unsigned char **out_buf, BN_CTX *ctx); + + +// Key generation. + +// EC_KEY_generate_key generates a random, private key, calculates the +// corresponding public key and stores both in |key|. It returns one on success +// or zero otherwise. +OPENSSL_EXPORT int EC_KEY_generate_key(EC_KEY *key); + +// EC_KEY_generate_key_fips behaves like |EC_KEY_generate_key| but performs +// additional checks for FIPS compliance. +OPENSSL_EXPORT int EC_KEY_generate_key_fips(EC_KEY *key); + +// EC_KEY_derive_from_secret deterministically derives a private key for |group| +// from an input secret using HKDF-SHA256. It returns a newly-allocated |EC_KEY| +// on success or NULL on error. |secret| must not be used in any other +// algorithm. If using a base secret for multiple operations, derive separate +// values with a KDF such as HKDF first. +// +// Note this function implements an arbitrary derivation scheme, rather than any +// particular standard one. New protocols are recommended to use X25519 and +// Ed25519, which have standard byte import functions. See +// |X25519_public_from_private| and |ED25519_keypair_from_seed|. +OPENSSL_EXPORT EC_KEY *EC_KEY_derive_from_secret(const EC_GROUP *group, + const uint8_t *secret, + size_t secret_len); + + +// Serialisation. + +// EC_KEY_parse_private_key parses a DER-encoded ECPrivateKey structure (RFC +// 5915) from |cbs| and advances |cbs|. It returns a newly-allocated |EC_KEY| or +// NULL on error. If |group| is non-null, the parameters field of the +// ECPrivateKey may be omitted (but must match |group| if present). Otherwise, +// the parameters field is required. +OPENSSL_EXPORT EC_KEY *EC_KEY_parse_private_key(CBS *cbs, + const EC_GROUP *group); + +// EC_KEY_marshal_private_key marshals |key| as a DER-encoded ECPrivateKey +// structure (RFC 5915) and appends the result to |cbb|. It returns one on +// success and zero on failure. |enc_flags| is a combination of |EC_PKEY_*| +// values and controls whether corresponding fields are omitted. +OPENSSL_EXPORT int EC_KEY_marshal_private_key(CBB *cbb, const EC_KEY *key, + unsigned enc_flags); + +// EC_KEY_parse_curve_name parses a DER-encoded OBJECT IDENTIFIER as a curve +// name from |cbs| and advances |cbs|. It returns a newly-allocated |EC_GROUP| +// or NULL on error. +OPENSSL_EXPORT EC_GROUP *EC_KEY_parse_curve_name(CBS *cbs); + +// EC_KEY_marshal_curve_name marshals |group| as a DER-encoded OBJECT IDENTIFIER +// and appends the result to |cbb|. It returns one on success and zero on +// failure. +OPENSSL_EXPORT int EC_KEY_marshal_curve_name(CBB *cbb, const EC_GROUP *group); + +// EC_KEY_parse_parameters parses a DER-encoded ECParameters structure (RFC +// 5480) from |cbs| and advances |cbs|. It returns a newly-allocated |EC_GROUP| +// or NULL on error. It supports the namedCurve and specifiedCurve options, but +// use of specifiedCurve is deprecated. Use |EC_KEY_parse_curve_name| +// instead. +OPENSSL_EXPORT EC_GROUP *EC_KEY_parse_parameters(CBS *cbs); + + +// ex_data functions. +// +// These functions are wrappers. See |ex_data.h| for details. + +OPENSSL_EXPORT int EC_KEY_get_ex_new_index(long argl, void *argp, + CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func); +OPENSSL_EXPORT int EC_KEY_set_ex_data(EC_KEY *r, int idx, void *arg); +OPENSSL_EXPORT void *EC_KEY_get_ex_data(const EC_KEY *r, int idx); + + +// ECDSA method. + +// ECDSA_FLAG_OPAQUE specifies that this ECDSA_METHOD does not expose its key +// material. This may be set if, for instance, it is wrapping some other crypto +// API, like a platform key store. +#define ECDSA_FLAG_OPAQUE 1 + +// ecdsa_method_st is a structure of function pointers for implementing ECDSA. +// See engine.h. +struct ecdsa_method_st { + struct openssl_method_common_st common; + + void *app_data; + + int (*init)(EC_KEY *key); + int (*finish)(EC_KEY *key); + + // group_order_size returns the number of bytes needed to represent the order + // of the group. This is used to calculate the maximum size of an ECDSA + // signature in |ECDSA_size|. + size_t (*group_order_size)(const EC_KEY *key); + + // sign matches the arguments and behaviour of |ECDSA_sign|. + int (*sign)(const uint8_t *digest, size_t digest_len, uint8_t *sig, + unsigned int *sig_len, EC_KEY *eckey); + + int flags; +}; + + +// Deprecated functions. + +// EC_KEY_set_asn1_flag does nothing. +OPENSSL_EXPORT void EC_KEY_set_asn1_flag(EC_KEY *key, int flag); + +// d2i_ECPrivateKey parses an ASN.1, DER-encoded, private key from |len| bytes +// at |*inp|. If |out_key| is not NULL then, on exit, a pointer to the result +// is in |*out_key|. Note that, even if |*out_key| is already non-NULL on entry, +// it * will not be written to. Rather, a fresh |EC_KEY| is allocated and the +// previous * one is freed. On successful exit, |*inp| is advanced past the DER +// structure. It returns the result or NULL on error. +// +// On input, if |*out_key| is non-NULL and has a group configured, the +// parameters field may be omitted but must match that group if present. +// +// Use |EC_KEY_parse_private_key| instead. +OPENSSL_EXPORT EC_KEY *d2i_ECPrivateKey(EC_KEY **out_key, const uint8_t **inp, + long len); + +// i2d_ECPrivateKey marshals an EC private key from |key| to an ASN.1, DER +// structure. If |outp| is not NULL then the result is written to |*outp| and +// |*outp| is advanced just past the output. It returns the number of bytes in +// the result, whether written or not, or a negative value on error. +// +// Use |EC_KEY_marshal_private_key| instead. +OPENSSL_EXPORT int i2d_ECPrivateKey(const EC_KEY *key, uint8_t **outp); + +// d2i_ECParameters parses an ASN.1, DER-encoded, set of EC parameters from +// |len| bytes at |*inp|. If |out_key| is not NULL then, on exit, a pointer to +// the result is in |*out_key|. Note that, even if |*out_key| is already +// non-NULL on entry, it will not be written to. Rather, a fresh |EC_KEY| is +// allocated and the previous one is freed. On successful exit, |*inp| is +// advanced past the DER structure. It returns the result or NULL on error. +// +// Use |EC_KEY_parse_parameters| or |EC_KEY_parse_curve_name| instead. +OPENSSL_EXPORT EC_KEY *d2i_ECParameters(EC_KEY **out_key, const uint8_t **inp, + long len); + +// i2d_ECParameters marshals EC parameters from |key| to an ASN.1, DER +// structure. If |outp| is not NULL then the result is written to |*outp| and +// |*outp| is advanced just past the output. It returns the number of bytes in +// the result, whether written or not, or a negative value on error. +// +// Use |EC_KEY_marshal_curve_name| instead. +OPENSSL_EXPORT int i2d_ECParameters(const EC_KEY *key, uint8_t **outp); + +// o2i_ECPublicKey parses an EC point from |len| bytes at |*inp| into +// |*out_key|. Note that this differs from the d2i format in that |*out_key| +// must be non-NULL with a group set. On successful exit, |*inp| is advanced by +// |len| bytes. It returns |*out_key| or NULL on error. +// +// Use |EC_POINT_oct2point| instead. +OPENSSL_EXPORT EC_KEY *o2i_ECPublicKey(EC_KEY **out_key, const uint8_t **inp, + long len); + +// i2o_ECPublicKey marshals an EC point from |key|. If |outp| is not NULL then +// the result is written to |*outp| and |*outp| is advanced just past the +// output. It returns the number of bytes in the result, whether written or +// not, or a negative value on error. +// +// Use |EC_POINT_point2cbb| instead. +OPENSSL_EXPORT int i2o_ECPublicKey(const EC_KEY *key, unsigned char **outp); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(EC_KEY, EC_KEY_free) +BORINGSSL_MAKE_UP_REF(EC_KEY, EC_KEY_up_ref) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#endif // OPENSSL_HEADER_EC_KEY_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ec_key.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/include/openssl/ec_key.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.grpc_back index cc075e544..932ad8e6c 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ec_key.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ec_key.h.grpc_back @@ -84,6 +84,12 @@ extern "C" { // EC key objects. +// +// An |EC_KEY| object represents a public or private EC key. A given object may +// be used concurrently on multiple threads by non-mutating functions, provided +// no other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. // EC_KEY_new returns a fresh |EC_KEY| object or NULL on error. OPENSSL_EXPORT EC_KEY *EC_KEY_new(void); @@ -102,7 +108,8 @@ OPENSSL_EXPORT void EC_KEY_free(EC_KEY *key); // EC_KEY_dup returns a fresh copy of |src| or NULL on error. OPENSSL_EXPORT EC_KEY *EC_KEY_dup(const EC_KEY *src); -// EC_KEY_up_ref increases the reference count of |key| and returns one. +// EC_KEY_up_ref increases the reference count of |key| and returns one. It does +// not mutate |key| for thread-safety purposes and may be used concurrently. OPENSSL_EXPORT int EC_KEY_up_ref(EC_KEY *key); // EC_KEY_is_opaque returns one if |key| is opaque and doesn't expose its key @@ -113,8 +120,8 @@ OPENSSL_EXPORT int EC_KEY_is_opaque(const EC_KEY *key); OPENSSL_EXPORT const EC_GROUP *EC_KEY_get0_group(const EC_KEY *key); // EC_KEY_set_group sets the |EC_GROUP| object that |key| will use to |group|. -// It returns one on success and zero otherwise. If |key| already has a group, -// it is an error to change to a different one. +// It returns one on success and zero if |key| is already configured with a +// different group. OPENSSL_EXPORT int EC_KEY_set_group(EC_KEY *key, const EC_GROUP *group); // EC_KEY_get0_private_key returns a pointer to the private key inside |key|. @@ -123,7 +130,7 @@ OPENSSL_EXPORT const BIGNUM *EC_KEY_get0_private_key(const EC_KEY *key); // EC_KEY_set_private_key sets the private key of |key| to |priv|. It returns // one on success and zero otherwise. |key| must already have had a group // configured (see |EC_KEY_set_group| and |EC_KEY_new_by_curve_name|). -OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *prv); +OPENSSL_EXPORT int EC_KEY_set_private_key(EC_KEY *key, const BIGNUM *priv); // EC_KEY_get0_public_key returns a pointer to the public key point inside // |key|. @@ -165,10 +172,18 @@ OPENSSL_EXPORT int EC_KEY_check_key(const EC_KEY *key); OPENSSL_EXPORT int EC_KEY_check_fips(const EC_KEY *key); // EC_KEY_set_public_key_affine_coordinates sets the public key in |key| to -// (|x|, |y|). It returns one on success and zero otherwise. +// (|x|, |y|). It returns one on success and zero on error. It's considered an +// error if |x| and |y| do not represent a point on |key|'s curve. OPENSSL_EXPORT int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, - BIGNUM *x, - BIGNUM *y); + const BIGNUM *x, + const BIGNUM *y); + +// EC_KEY_key2buf encodes the public key in |key| to an allocated octet string +// and sets |*out_buf| to point to it. It returns the length of the encoded +// octet string or zero if an error occurred. +OPENSSL_EXPORT size_t EC_KEY_key2buf(const EC_KEY *key, + point_conversion_form_t form, + unsigned char **out_buf, BN_CTX *ctx); // Key generation. @@ -182,6 +197,20 @@ OPENSSL_EXPORT int EC_KEY_generate_key(EC_KEY *key); // additional checks for FIPS compliance. OPENSSL_EXPORT int EC_KEY_generate_key_fips(EC_KEY *key); +// EC_KEY_derive_from_secret deterministically derives a private key for |group| +// from an input secret using HKDF-SHA256. It returns a newly-allocated |EC_KEY| +// on success or NULL on error. |secret| must not be used in any other +// algorithm. If using a base secret for multiple operations, derive separate +// values with a KDF such as HKDF first. +// +// Note this function implements an arbitrary derivation scheme, rather than any +// particular standard one. New protocols are recommended to use X25519 and +// Ed25519, which have standard byte import functions. See +// |X25519_public_from_private| and |ED25519_keypair_from_seed|. +OPENSSL_EXPORT EC_KEY *EC_KEY_derive_from_secret(const EC_GROUP *group, + const uint8_t *secret, + size_t secret_len); + // Serialisation. @@ -329,11 +358,12 @@ OPENSSL_EXPORT int i2o_ECPublicKey(const EC_KEY *key, unsigned char **outp); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EC_KEY, EC_KEY_free) +BORINGSSL_MAKE_UP_REF(EC_KEY, EC_KEY_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/ecdh.h b/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h similarity index 82% rename from Pods/BoringSSL-GRPC/include/openssl/ecdh.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h index 037296eca..185736782 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ecdh.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h @@ -89,6 +89,22 @@ OPENSSL_EXPORT int ECDH_compute_key( void *out, size_t outlen, const EC_POINT *pub_key, const EC_KEY *priv_key, void *(*kdf)(const void *in, size_t inlen, void *out, size_t *outlen)); +// ECDH_compute_key_fips calculates the shared key between |pub_key| and +// |priv_key| and hashes it with the appropriate SHA function for |out_len|. The +// only value values for |out_len| are thus 24 (SHA-224), 32 (SHA-256), 48 +// (SHA-384), and 64 (SHA-512). It returns one on success and zero on error. +// +// Note that the return value is different to |ECDH_compute_key|: it returns an +// error flag (as is common for BoringSSL) rather than the number of bytes +// written. +// +// This function allows the FIPS module to compute an ECDH and KDF within the +// module boundary without taking an arbitrary function pointer for the KDF, +// which isn't very FIPSy. +OPENSSL_EXPORT int ECDH_compute_key_fips(uint8_t *out, size_t out_len, + const EC_POINT *pub_key, + const EC_KEY *priv_key); + #if defined(__cplusplus) } // extern C @@ -97,5 +113,6 @@ OPENSSL_EXPORT int ECDH_compute_key( #define ECDH_R_KDF_FAILED 100 #define ECDH_R_NO_PRIVATE_VALUE 101 #define ECDH_R_POINT_ARITHMETIC_FAILURE 102 +#define ECDH_R_UNKNOWN_DIGEST_LENGTH 103 #endif // OPENSSL_HEADER_ECDH_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.back new file mode 100644 index 000000000..0130ccc24 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.back @@ -0,0 +1,118 @@ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * The Elliptic Curve Public-Key Crypto Library (ECC Code) included + * herein is developed by SUN MICROSYSTEMS, INC., and is contributed + * to the OpenSSL project. + * + * The ECC Code is licensed pursuant to the OpenSSL open source + * license provided below. + * + * The ECDH software is originally written by Douglas Stebila of + * Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright (c) 2000-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_ECDH_H +#define OPENSSL_HEADER_ECDH_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Elliptic curve Diffie-Hellman. + + +// ECDH_compute_key calculates the shared key between |pub_key| and |priv_key|. +// If |kdf| is not NULL, then it is called with the bytes of the shared key and +// the parameter |out|. When |kdf| returns, the value of |*outlen| becomes the +// return value. Otherwise, as many bytes of the shared key as will fit are +// copied directly to, at most, |outlen| bytes at |out|. It returns the number +// of bytes written to |out|, or -1 on error. +OPENSSL_EXPORT int ECDH_compute_key( + void *out, size_t outlen, const EC_POINT *pub_key, const EC_KEY *priv_key, + void *(*kdf)(const void *in, size_t inlen, void *out, size_t *outlen)); + +// ECDH_compute_key_fips calculates the shared key between |pub_key| and +// |priv_key| and hashes it with the appropriate SHA function for |out_len|. The +// only value values for |out_len| are thus 24 (SHA-224), 32 (SHA-256), 48 +// (SHA-384), and 64 (SHA-512). It returns one on success and zero on error. +// +// Note that the return value is different to |ECDH_compute_key|: it returns an +// error flag (as is common for BoringSSL) rather than the number of bytes +// written. +// +// This function allows the FIPS module to compute an ECDH and KDF within the +// module boundary without taking an arbitrary function pointer for the KDF, +// which isn't very FIPSy. +OPENSSL_EXPORT int ECDH_compute_key_fips(uint8_t *out, size_t out_len, + const EC_POINT *pub_key, + const EC_KEY *priv_key); + + +#if defined(__cplusplus) +} // extern C +#endif + +#define ECDH_R_KDF_FAILED 100 +#define ECDH_R_NO_PRIVATE_VALUE 101 +#define ECDH_R_POINT_ARITHMETIC_FAILURE 102 +#define ECDH_R_UNKNOWN_DIGEST_LENGTH 103 + +#endif // OPENSSL_HEADER_ECDH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ecdh.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/include/openssl/ecdh.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.grpc_back index 73e2140e4..0130ccc24 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ecdh.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ecdh.h.grpc_back @@ -89,6 +89,22 @@ OPENSSL_EXPORT int ECDH_compute_key( void *out, size_t outlen, const EC_POINT *pub_key, const EC_KEY *priv_key, void *(*kdf)(const void *in, size_t inlen, void *out, size_t *outlen)); +// ECDH_compute_key_fips calculates the shared key between |pub_key| and +// |priv_key| and hashes it with the appropriate SHA function for |out_len|. The +// only value values for |out_len| are thus 24 (SHA-224), 32 (SHA-256), 48 +// (SHA-384), and 64 (SHA-512). It returns one on success and zero on error. +// +// Note that the return value is different to |ECDH_compute_key|: it returns an +// error flag (as is common for BoringSSL) rather than the number of bytes +// written. +// +// This function allows the FIPS module to compute an ECDH and KDF within the +// module boundary without taking an arbitrary function pointer for the KDF, +// which isn't very FIPSy. +OPENSSL_EXPORT int ECDH_compute_key_fips(uint8_t *out, size_t out_len, + const EC_POINT *pub_key, + const EC_KEY *priv_key); + #if defined(__cplusplus) } // extern C @@ -97,5 +113,6 @@ OPENSSL_EXPORT int ECDH_compute_key( #define ECDH_R_KDF_FAILED 100 #define ECDH_R_NO_PRIVATE_VALUE 101 #define ECDH_R_POINT_ARITHMETIC_FAILURE 102 +#define ECDH_R_UNKNOWN_DIGEST_LENGTH 103 #endif // OPENSSL_HEADER_ECDH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ecdsa.h b/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/ecdsa.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h index eb5e6a69a..116384b30 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ecdsa.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h @@ -86,7 +86,7 @@ OPENSSL_EXPORT int ECDSA_verify(int type, const uint8_t *digest, size_t sig_len, const EC_KEY *key); // ECDSA_size returns the maximum size of an ECDSA signature using |key|. It -// returns zero on error. +// returns zero if |key| is NULL or if it doesn't have a group set. OPENSSL_EXPORT size_t ECDSA_size(const EC_KEY *key); @@ -179,11 +179,11 @@ OPENSSL_EXPORT int i2d_ECDSA_SIG(const ECDSA_SIG *sig, uint8_t **outp); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(ECDSA_SIG, ECDSA_SIG_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.back new file mode 100644 index 000000000..d4d353e0c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.back @@ -0,0 +1,199 @@ +/* ==================================================================== + * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_ECDSA_H +#define OPENSSL_HEADER_ECDSA_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// ECDSA contains functions for signing and verifying with the Digital Signature +// Algorithm over elliptic curves. + + +// Signing and verifying. + +// ECDSA_sign signs |digest_len| bytes from |digest| with |key| and writes the +// resulting signature to |sig|, which must have |ECDSA_size(key)| bytes of +// space. On successful exit, |*sig_len| is set to the actual number of bytes +// written. The |type| argument should be zero. It returns one on success and +// zero otherwise. +OPENSSL_EXPORT int ECDSA_sign(int type, const uint8_t *digest, + size_t digest_len, uint8_t *sig, + unsigned int *sig_len, const EC_KEY *key); + +// ECDSA_verify verifies that |sig_len| bytes from |sig| constitute a valid +// signature by |key| of |digest|. (The |type| argument should be zero.) It +// returns one on success or zero if the signature is invalid or an error +// occurred. +OPENSSL_EXPORT int ECDSA_verify(int type, const uint8_t *digest, + size_t digest_len, const uint8_t *sig, + size_t sig_len, const EC_KEY *key); + +// ECDSA_size returns the maximum size of an ECDSA signature using |key|. It +// returns zero if |key| is NULL or if it doesn't have a group set. +OPENSSL_EXPORT size_t ECDSA_size(const EC_KEY *key); + + +// Low-level signing and verification. +// +// Low-level functions handle signatures as |ECDSA_SIG| structures which allow +// the two values in an ECDSA signature to be handled separately. + +struct ecdsa_sig_st { + BIGNUM *r; + BIGNUM *s; +}; + +// ECDSA_SIG_new returns a fresh |ECDSA_SIG| structure or NULL on error. +OPENSSL_EXPORT ECDSA_SIG *ECDSA_SIG_new(void); + +// ECDSA_SIG_free frees |sig| its member |BIGNUM|s. +OPENSSL_EXPORT void ECDSA_SIG_free(ECDSA_SIG *sig); + +// ECDSA_SIG_get0 sets |*out_r| and |*out_s|, if non-NULL, to the two +// components of |sig|. +OPENSSL_EXPORT void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **out_r, + const BIGNUM **out_s); + +// ECDSA_SIG_set0 sets |sig|'s components to |r| and |s|, neither of which may +// be NULL. On success, it takes ownership of each argument and returns one. +// Otherwise, it returns zero. +OPENSSL_EXPORT int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); + +// ECDSA_do_sign signs |digest_len| bytes from |digest| with |key| and returns +// the resulting signature structure, or NULL on error. +OPENSSL_EXPORT ECDSA_SIG *ECDSA_do_sign(const uint8_t *digest, + size_t digest_len, const EC_KEY *key); + +// ECDSA_do_verify verifies that |sig| constitutes a valid signature by |key| +// of |digest|. It returns one on success or zero if the signature is invalid +// or on error. +OPENSSL_EXPORT int ECDSA_do_verify(const uint8_t *digest, size_t digest_len, + const ECDSA_SIG *sig, const EC_KEY *key); + + +// ASN.1 functions. + +// ECDSA_SIG_parse parses a DER-encoded ECDSA-Sig-Value structure from |cbs| and +// advances |cbs|. It returns a newly-allocated |ECDSA_SIG| or NULL on error. +OPENSSL_EXPORT ECDSA_SIG *ECDSA_SIG_parse(CBS *cbs); + +// ECDSA_SIG_from_bytes parses |in| as a DER-encoded ECDSA-Sig-Value structure. +// It returns a newly-allocated |ECDSA_SIG| structure or NULL on error. +OPENSSL_EXPORT ECDSA_SIG *ECDSA_SIG_from_bytes(const uint8_t *in, + size_t in_len); + +// ECDSA_SIG_marshal marshals |sig| as a DER-encoded ECDSA-Sig-Value and appends +// the result to |cbb|. It returns one on success and zero on error. +OPENSSL_EXPORT int ECDSA_SIG_marshal(CBB *cbb, const ECDSA_SIG *sig); + +// ECDSA_SIG_to_bytes marshals |sig| as a DER-encoded ECDSA-Sig-Value and, on +// success, sets |*out_bytes| to a newly allocated buffer containing the result +// and returns one. Otherwise, it returns zero. The result should be freed with +// |OPENSSL_free|. +OPENSSL_EXPORT int ECDSA_SIG_to_bytes(uint8_t **out_bytes, size_t *out_len, + const ECDSA_SIG *sig); + +// ECDSA_SIG_max_len returns the maximum length of a DER-encoded ECDSA-Sig-Value +// structure for a group whose order is represented in |order_len| bytes, or +// zero on overflow. +OPENSSL_EXPORT size_t ECDSA_SIG_max_len(size_t order_len); + + +// Deprecated functions. + +// d2i_ECDSA_SIG parses an ASN.1, DER-encoded, signature from |len| bytes at +// |*inp|. If |out| is not NULL then, on exit, a pointer to the result is in +// |*out|. Note that, even if |*out| is already non-NULL on entry, it will not +// be written to. Rather, a fresh |ECDSA_SIG| is allocated and the previous one +// is freed. On successful exit, |*inp| is advanced past the DER structure. It +// returns the result or NULL on error. +OPENSSL_EXPORT ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **out, const uint8_t **inp, + long len); + +// i2d_ECDSA_SIG marshals a signature from |sig| to an ASN.1, DER +// structure. If |outp| is not NULL then the result is written to |*outp| and +// |*outp| is advanced just past the output. It returns the number of bytes in +// the result, whether written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_ECDSA_SIG(const ECDSA_SIG *sig, uint8_t **outp); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(ECDSA_SIG, ECDSA_SIG_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define ECDSA_R_BAD_SIGNATURE 100 +#define ECDSA_R_MISSING_PARAMETERS 101 +#define ECDSA_R_NEED_NEW_SETUP_VALUES 102 +#define ECDSA_R_NOT_IMPLEMENTED 103 +#define ECDSA_R_RANDOM_NUMBER_GENERATION_FAILED 104 +#define ECDSA_R_ENCODE_ERROR 105 + +#endif // OPENSSL_HEADER_ECDSA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ecdsa.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/ecdsa.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.grpc_back index 42da1c612..d4d353e0c 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ecdsa.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ecdsa.h.grpc_back @@ -86,7 +86,7 @@ OPENSSL_EXPORT int ECDSA_verify(int type, const uint8_t *digest, size_t sig_len, const EC_KEY *key); // ECDSA_size returns the maximum size of an ECDSA signature using |key|. It -// returns zero on error. +// returns zero if |key| is NULL or if it doesn't have a group set. OPENSSL_EXPORT size_t ECDSA_size(const EC_KEY *key); @@ -179,11 +179,11 @@ OPENSSL_EXPORT int i2d_ECDSA_SIG(const ECDSA_SIG *sig, uint8_t **outp); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(ECDSA_SIG, ECDSA_SIG_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/engine.h b/Pods/BoringSSL-GRPC/src/include/openssl/engine.h similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/engine.h rename to Pods/BoringSSL-GRPC/src/include/openssl/engine.h index 1db19a15b..ce0b35461 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/engine.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/engine.h @@ -40,8 +40,8 @@ extern "C" { OPENSSL_EXPORT ENGINE *ENGINE_new(void); // ENGINE_free decrements the reference counts for all methods linked from -// |engine| and frees |engine| itself. -OPENSSL_EXPORT void ENGINE_free(ENGINE *engine); +// |engine| and frees |engine| itself. It returns one. +OPENSSL_EXPORT int ENGINE_free(ENGINE *engine); // Method accessors. @@ -94,11 +94,11 @@ struct openssl_method_common_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(ENGINE, ENGINE_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.back new file mode 100644 index 000000000..ce60de46e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.back @@ -0,0 +1,109 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_ENGINE_H +#define OPENSSL_HEADER_ENGINE_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Engines are collections of methods. Methods are tables of function pointers, +// defined for certain algorithms, that allow operations on those algorithms to +// be overridden via a callback. This can be used, for example, to implement an +// RSA* that forwards operations to a hardware module. +// +// Methods are reference counted but |ENGINE|s are not. When creating a method, +// you should zero the whole structure and fill in the function pointers that +// you wish before setting it on an |ENGINE|. Any functions pointers that +// are NULL indicate that the default behaviour should be used. + + +// Allocation and destruction. + +// ENGINE_new returns an empty ENGINE that uses the default method for all +// algorithms. +OPENSSL_EXPORT ENGINE *ENGINE_new(void); + +// ENGINE_free decrements the reference counts for all methods linked from +// |engine| and frees |engine| itself. It returns one. +OPENSSL_EXPORT int ENGINE_free(ENGINE *engine); + + +// Method accessors. +// +// Method accessors take a method pointer and the size of the structure. The +// size allows for ABI compatibility in the case that the method structure is +// extended with extra elements at the end. Methods are always copied by the +// set functions. +// +// Set functions return one on success and zero on allocation failure. + +OPENSSL_EXPORT int ENGINE_set_RSA_method(ENGINE *engine, + const RSA_METHOD *method, + size_t method_size); +OPENSSL_EXPORT RSA_METHOD *ENGINE_get_RSA_method(const ENGINE *engine); + +OPENSSL_EXPORT int ENGINE_set_ECDSA_method(ENGINE *engine, + const ECDSA_METHOD *method, + size_t method_size); +OPENSSL_EXPORT ECDSA_METHOD *ENGINE_get_ECDSA_method(const ENGINE *engine); + + +// Generic method functions. +// +// These functions take a void* type but actually operate on all method +// structures. + +// METHOD_ref increments the reference count of |method|. This is a no-op for +// now because all methods are currently static. +void METHOD_ref(void *method); + +// METHOD_unref decrements the reference count of |method| and frees it if the +// reference count drops to zero. This is a no-op for now because all methods +// are currently static. +void METHOD_unref(void *method); + + +// Private functions. + +// openssl_method_common_st contains the common part of all method structures. +// This must be the first member of all method structures. +struct openssl_method_common_st { + int references; // dummy – not used. + char is_static; +}; + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(ENGINE, ENGINE_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define ENGINE_R_OPERATION_NOT_SUPPORTED 100 + +#endif // OPENSSL_HEADER_ENGINE_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/engine.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/engine.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/engine.h.grpc_back index 595e53c00..ce60de46e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/engine.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/engine.h.grpc_back @@ -40,8 +40,8 @@ extern "C" { OPENSSL_EXPORT ENGINE *ENGINE_new(void); // ENGINE_free decrements the reference counts for all methods linked from -// |engine| and frees |engine| itself. -OPENSSL_EXPORT void ENGINE_free(ENGINE *engine); +// |engine| and frees |engine| itself. It returns one. +OPENSSL_EXPORT int ENGINE_free(ENGINE *engine); // Method accessors. @@ -94,11 +94,11 @@ struct openssl_method_common_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(ENGINE, ENGINE_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/err.h b/Pods/BoringSSL-GRPC/src/include/openssl/err.h similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/err.h rename to Pods/BoringSSL-GRPC/src/include/openssl/err.h index 2af5d0c15..7da1fdd58 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/err.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/err.h @@ -152,6 +152,9 @@ OPENSSL_EXPORT void ERR_load_ERR_strings(void); // ERR_load_crypto_strings does nothing. OPENSSL_EXPORT void ERR_load_crypto_strings(void); +// ERR_load_RAND_strings does nothing. +OPENSSL_EXPORT void ERR_load_RAND_strings(void); + // ERR_free_strings does nothing. OPENSSL_EXPORT void ERR_free_strings(void); @@ -206,9 +209,9 @@ OPENSSL_EXPORT uint32_t ERR_peek_last_error_line_data(const char **file, int *flags); // ERR_error_string_n generates a human-readable string representing -// |packed_error| and places it at |buf|. It writes at most |len| bytes -// (including the terminating NUL) and truncates the string if necessary. If -// |len| is greater than zero then |buf| is always NUL terminated. +// |packed_error|, places it at |buf|, and returns |buf|. It writes at most +// |len| bytes (including the terminating NUL) and truncates the string if +// necessary. If |len| is greater than zero then |buf| is always NUL terminated. // // The string will have the following format: // @@ -216,8 +219,8 @@ OPENSSL_EXPORT uint32_t ERR_peek_last_error_line_data(const char **file, // // error code is an 8 digit hexadecimal number; library name and reason string // are ASCII text. -OPENSSL_EXPORT void ERR_error_string_n(uint32_t packed_error, char *buf, - size_t len); +OPENSSL_EXPORT char *ERR_error_string_n(uint32_t packed_error, char *buf, + size_t len); // ERR_lib_error_string returns a string representation of the library that // generated |packed_error|. @@ -386,10 +389,12 @@ OPENSSL_EXPORT void ERR_remove_thread_state(const CRYPTO_THREADID *tid); OPENSSL_EXPORT const char *ERR_func_error_string(uint32_t packed_error); // ERR_error_string behaves like |ERR_error_string_n| but |len| is implicitly -// |ERR_ERROR_STRING_BUF_LEN| and it returns |buf|. If |buf| is NULL, the error -// string is placed in a static buffer which is returned. (The static buffer may -// be overridden by concurrent calls in other threads so this form should not be -// used.) +// |ERR_ERROR_STRING_BUF_LEN|. +// +// Additionally, if |buf| is NULL, the error string is placed in a static buffer +// which is returned. This is not thread-safe and only exists for backwards +// compatibility with legacy callers. The static buffer will be overridden by +// calls in other threads. // // Use |ERR_error_string_n| instead. // diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/err.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/err.h.back new file mode 100644 index 000000000..f9cd9f25f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/err.h.back @@ -0,0 +1,463 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_ERR_H +#define OPENSSL_HEADER_ERR_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Error queue handling functions. +// +// Errors in OpenSSL are generally signaled by the return value of a function. +// When a function fails it may add an entry to a per-thread error queue, +// which is managed by the functions in this header. +// +// Each error contains: +// 1) The library (i.e. ec, pem, rsa) which created it. +// 2) The file and line number of the call that added the error. +// 3) A pointer to some error specific data, which may be NULL. +// +// The library identifier and reason code are packed in a uint32_t and there +// exist various functions for unpacking it. +// +// The typical behaviour is that an error will occur deep in a call queue and +// that code will push an error onto the error queue. As the error queue +// unwinds, other functions will push their own errors. Thus, the "least +// recent" error is the most specific and the other errors will provide a +// backtrace of sorts. + + +// Startup and shutdown. + +// ERR_load_BIO_strings does nothing. +// +// TODO(fork): remove. libjingle calls this. +OPENSSL_EXPORT void ERR_load_BIO_strings(void); + +// ERR_load_ERR_strings does nothing. +OPENSSL_EXPORT void ERR_load_ERR_strings(void); + +// ERR_load_crypto_strings does nothing. +OPENSSL_EXPORT void ERR_load_crypto_strings(void); + +// ERR_load_RAND_strings does nothing. +OPENSSL_EXPORT void ERR_load_RAND_strings(void); + +// ERR_free_strings does nothing. +OPENSSL_EXPORT void ERR_free_strings(void); + + +// Reading and formatting errors. + +// ERR_GET_LIB returns the library code for the error. This is one of +// the |ERR_LIB_*| values. +#define ERR_GET_LIB(packed_error) ((int)(((packed_error) >> 24) & 0xff)) + +// ERR_GET_REASON returns the reason code for the error. This is one of +// library-specific |LIB_R_*| values where |LIB| is the library (see +// |ERR_GET_LIB|). Note that reason codes are specific to the library. +#define ERR_GET_REASON(packed_error) ((int)((packed_error) & 0xfff)) + +// ERR_get_error gets the packed error code for the least recent error and +// removes that error from the queue. If there are no errors in the queue then +// it returns zero. +OPENSSL_EXPORT uint32_t ERR_get_error(void); + +// ERR_get_error_line acts like |ERR_get_error|, except that the file and line +// number of the call that added the error are also returned. +OPENSSL_EXPORT uint32_t ERR_get_error_line(const char **file, int *line); + +// ERR_FLAG_STRING means that the |data| member is a NUL-terminated string that +// can be printed. This is always set if |data| is non-NULL. +#define ERR_FLAG_STRING 1 + +// ERR_get_error_line_data acts like |ERR_get_error_line|, but also returns the +// error-specific data pointer and flags. The flags are a bitwise-OR of +// |ERR_FLAG_*| values. The error-specific data is owned by the error queue +// and the pointer becomes invalid after the next call that affects the same +// thread's error queue. If |*flags| contains |ERR_FLAG_STRING| then |*data| is +// human-readable. +OPENSSL_EXPORT uint32_t ERR_get_error_line_data(const char **file, int *line, + const char **data, int *flags); + +// The "peek" functions act like the |ERR_get_error| functions, above, but they +// do not remove the error from the queue. +OPENSSL_EXPORT uint32_t ERR_peek_error(void); +OPENSSL_EXPORT uint32_t ERR_peek_error_line(const char **file, int *line); +OPENSSL_EXPORT uint32_t ERR_peek_error_line_data(const char **file, int *line, + const char **data, int *flags); + +// The "peek last" functions act like the "peek" functions, above, except that +// they return the most recent error. +OPENSSL_EXPORT uint32_t ERR_peek_last_error(void); +OPENSSL_EXPORT uint32_t ERR_peek_last_error_line(const char **file, int *line); +OPENSSL_EXPORT uint32_t ERR_peek_last_error_line_data(const char **file, + int *line, + const char **data, + int *flags); + +// ERR_error_string_n generates a human-readable string representing +// |packed_error|, places it at |buf|, and returns |buf|. It writes at most +// |len| bytes (including the terminating NUL) and truncates the string if +// necessary. If |len| is greater than zero then |buf| is always NUL terminated. +// +// The string will have the following format: +// +// error:[error code]:[library name]:OPENSSL_internal:[reason string] +// +// error code is an 8 digit hexadecimal number; library name and reason string +// are ASCII text. +OPENSSL_EXPORT char *ERR_error_string_n(uint32_t packed_error, char *buf, + size_t len); + +// ERR_lib_error_string returns a string representation of the library that +// generated |packed_error|. +OPENSSL_EXPORT const char *ERR_lib_error_string(uint32_t packed_error); + +// ERR_reason_error_string returns a string representation of the reason for +// |packed_error|. +OPENSSL_EXPORT const char *ERR_reason_error_string(uint32_t packed_error); + +// ERR_print_errors_callback_t is the type of a function used by +// |ERR_print_errors_cb|. It takes a pointer to a human readable string (and +// its length) that describes an entry in the error queue. The |ctx| argument +// is an opaque pointer given to |ERR_print_errors_cb|. +// +// It should return one on success or zero on error, which will stop the +// iteration over the error queue. +typedef int (*ERR_print_errors_callback_t)(const char *str, size_t len, + void *ctx); + +// ERR_print_errors_cb clears the current thread's error queue, calling +// |callback| with a string representation of each error, from the least recent +// to the most recent error. +// +// The string will have the following format (which differs from +// |ERR_error_string|): +// +// [thread id]:error:[error code]:[library name]:OPENSSL_internal:[reason string]:[file]:[line number]:[optional string data] +// +// The callback can return one to continue the iteration or zero to stop it. +// The |ctx| argument is an opaque value that is passed through to the +// callback. +OPENSSL_EXPORT void ERR_print_errors_cb(ERR_print_errors_callback_t callback, + void *ctx); + +// ERR_print_errors_fp clears the current thread's error queue, printing each +// error to |file|. See |ERR_print_errors_cb| for the format. +OPENSSL_EXPORT void ERR_print_errors_fp(FILE *file); + + +// Clearing errors. + +// ERR_clear_error clears the error queue for the current thread. +OPENSSL_EXPORT void ERR_clear_error(void); + +// ERR_set_mark "marks" the most recent error for use with |ERR_pop_to_mark|. +// It returns one if an error was marked and zero if there are no errors. +OPENSSL_EXPORT int ERR_set_mark(void); + +// ERR_pop_to_mark removes errors from the most recent to the least recent +// until (and not including) a "marked" error. It returns zero if no marked +// error was found (and thus all errors were removed) and one otherwise. Errors +// are marked using |ERR_set_mark|. +OPENSSL_EXPORT int ERR_pop_to_mark(void); + + +// Custom errors. + +// ERR_get_next_error_library returns a value suitable for passing as the +// |library| argument to |ERR_put_error|. This is intended for code that wishes +// to push its own, non-standard errors to the error queue. +OPENSSL_EXPORT int ERR_get_next_error_library(void); + + +// Built-in library and reason codes. + +// The following values are built-in library codes. +enum { + ERR_LIB_NONE = 1, + ERR_LIB_SYS, + ERR_LIB_BN, + ERR_LIB_RSA, + ERR_LIB_DH, + ERR_LIB_EVP, + ERR_LIB_BUF, + ERR_LIB_OBJ, + ERR_LIB_PEM, + ERR_LIB_DSA, + ERR_LIB_X509, + ERR_LIB_ASN1, + ERR_LIB_CONF, + ERR_LIB_CRYPTO, + ERR_LIB_EC, + ERR_LIB_SSL, + ERR_LIB_BIO, + ERR_LIB_PKCS7, + ERR_LIB_PKCS8, + ERR_LIB_X509V3, + ERR_LIB_RAND, + ERR_LIB_ENGINE, + ERR_LIB_OCSP, + ERR_LIB_UI, + ERR_LIB_COMP, + ERR_LIB_ECDSA, + ERR_LIB_ECDH, + ERR_LIB_HMAC, + ERR_LIB_DIGEST, + ERR_LIB_CIPHER, + ERR_LIB_HKDF, + ERR_LIB_USER, + ERR_NUM_LIBS +}; + +// The following reason codes used to denote an error occuring in another +// library. They are sometimes used for a stack trace. +#define ERR_R_SYS_LIB ERR_LIB_SYS +#define ERR_R_BN_LIB ERR_LIB_BN +#define ERR_R_RSA_LIB ERR_LIB_RSA +#define ERR_R_DH_LIB ERR_LIB_DH +#define ERR_R_EVP_LIB ERR_LIB_EVP +#define ERR_R_BUF_LIB ERR_LIB_BUF +#define ERR_R_OBJ_LIB ERR_LIB_OBJ +#define ERR_R_PEM_LIB ERR_LIB_PEM +#define ERR_R_DSA_LIB ERR_LIB_DSA +#define ERR_R_X509_LIB ERR_LIB_X509 +#define ERR_R_ASN1_LIB ERR_LIB_ASN1 +#define ERR_R_CONF_LIB ERR_LIB_CONF +#define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO +#define ERR_R_EC_LIB ERR_LIB_EC +#define ERR_R_SSL_LIB ERR_LIB_SSL +#define ERR_R_BIO_LIB ERR_LIB_BIO +#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 +#define ERR_R_PKCS8_LIB ERR_LIB_PKCS8 +#define ERR_R_X509V3_LIB ERR_LIB_X509V3 +#define ERR_R_RAND_LIB ERR_LIB_RAND +#define ERR_R_DSO_LIB ERR_LIB_DSO +#define ERR_R_ENGINE_LIB ERR_LIB_ENGINE +#define ERR_R_OCSP_LIB ERR_LIB_OCSP +#define ERR_R_UI_LIB ERR_LIB_UI +#define ERR_R_COMP_LIB ERR_LIB_COMP +#define ERR_R_ECDSA_LIB ERR_LIB_ECDSA +#define ERR_R_ECDH_LIB ERR_LIB_ECDH +#define ERR_R_STORE_LIB ERR_LIB_STORE +#define ERR_R_FIPS_LIB ERR_LIB_FIPS +#define ERR_R_CMS_LIB ERR_LIB_CMS +#define ERR_R_TS_LIB ERR_LIB_TS +#define ERR_R_HMAC_LIB ERR_LIB_HMAC +#define ERR_R_JPAKE_LIB ERR_LIB_JPAKE +#define ERR_R_USER_LIB ERR_LIB_USER +#define ERR_R_DIGEST_LIB ERR_LIB_DIGEST +#define ERR_R_CIPHER_LIB ERR_LIB_CIPHER +#define ERR_R_HKDF_LIB ERR_LIB_HKDF + +// The following values are global reason codes. They may occur in any library. +#define ERR_R_FATAL 64 +#define ERR_R_MALLOC_FAILURE (1 | ERR_R_FATAL) +#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2 | ERR_R_FATAL) +#define ERR_R_PASSED_NULL_PARAMETER (3 | ERR_R_FATAL) +#define ERR_R_INTERNAL_ERROR (4 | ERR_R_FATAL) +#define ERR_R_OVERFLOW (5 | ERR_R_FATAL) + + +// Deprecated functions. + +// ERR_remove_state calls |ERR_clear_error|. +OPENSSL_EXPORT void ERR_remove_state(unsigned long pid); + +// ERR_remove_thread_state clears the error queue for the current thread if +// |tid| is NULL. Otherwise it calls |assert(0)|, because it's no longer +// possible to delete the error queue for other threads. +// +// Use |ERR_clear_error| instead. Note error queues are deleted automatically on +// thread exit. You do not need to call this function to release memory. +OPENSSL_EXPORT void ERR_remove_thread_state(const CRYPTO_THREADID *tid); + +// ERR_func_error_string returns the string "OPENSSL_internal". +OPENSSL_EXPORT const char *ERR_func_error_string(uint32_t packed_error); + +// ERR_error_string behaves like |ERR_error_string_n| but |len| is implicitly +// |ERR_ERROR_STRING_BUF_LEN|. +// +// Additionally, if |buf| is NULL, the error string is placed in a static buffer +// which is returned. This is not thread-safe and only exists for backwards +// compatibility with legacy callers. The static buffer will be overridden by +// calls in other threads. +// +// Use |ERR_error_string_n| instead. +// +// TODO(fork): remove this function. +OPENSSL_EXPORT char *ERR_error_string(uint32_t packed_error, char *buf); +#define ERR_ERROR_STRING_BUF_LEN 120 + +// ERR_GET_FUNC returns zero. BoringSSL errors do not report a function code. +#define ERR_GET_FUNC(packed_error) 0 + +// ERR_TXT_STRING is provided for compatibility with code that assumes that +// it's using OpenSSL. +#define ERR_TXT_STRING ERR_FLAG_STRING + + +// Private functions. + +// ERR_clear_system_error clears the system's error value (i.e. errno). +OPENSSL_EXPORT void ERR_clear_system_error(void); + +// OPENSSL_PUT_ERROR is used by OpenSSL code to add an error to the error +// queue. +#define OPENSSL_PUT_ERROR(library, reason) \ + ERR_put_error(ERR_LIB_##library, 0, reason, __FILE__, __LINE__) + +// OPENSSL_PUT_SYSTEM_ERROR is used by OpenSSL code to add an error from the +// operating system to the error queue. +// TODO(fork): include errno. +#define OPENSSL_PUT_SYSTEM_ERROR() \ + ERR_put_error(ERR_LIB_SYS, 0, 0, __FILE__, __LINE__); + +// ERR_put_error adds an error to the error queue, dropping the least recent +// error if necessary for space reasons. +OPENSSL_EXPORT void ERR_put_error(int library, int unused, int reason, + const char *file, unsigned line); + +// ERR_add_error_data takes a variable number (|count|) of const char* +// pointers, concatenates them and sets the result as the data on the most +// recent error. +OPENSSL_EXPORT void ERR_add_error_data(unsigned count, ...); + +// ERR_add_error_dataf takes a printf-style format and arguments, and sets the +// result as the data on the most recent error. +OPENSSL_EXPORT void ERR_add_error_dataf(const char *format, ...) + OPENSSL_PRINTF_FORMAT_FUNC(1, 2); + +// ERR_NUM_ERRORS is one more than the limit of the number of errors in the +// queue. +#define ERR_NUM_ERRORS 16 + +#define ERR_PACK(lib, reason) \ + (((((uint32_t)(lib)) & 0xff) << 24) | ((((uint32_t)(reason)) & 0xfff))) + +// OPENSSL_DECLARE_ERROR_REASON is used by util/make_errors.h (which generates +// the error defines) to recognise that an additional reason value is needed. +// This is needed when the reason value is used outside of an +// |OPENSSL_PUT_ERROR| macro. The resulting define will be +// ${lib}_R_${reason}. +#define OPENSSL_DECLARE_ERROR_REASON(lib, reason) + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_ERR_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/err.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/err.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/err.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/err.h.grpc_back index a39c09091..f9cd9f25f 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/err.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/err.h.grpc_back @@ -152,6 +152,9 @@ OPENSSL_EXPORT void ERR_load_ERR_strings(void); // ERR_load_crypto_strings does nothing. OPENSSL_EXPORT void ERR_load_crypto_strings(void); +// ERR_load_RAND_strings does nothing. +OPENSSL_EXPORT void ERR_load_RAND_strings(void); + // ERR_free_strings does nothing. OPENSSL_EXPORT void ERR_free_strings(void); @@ -206,9 +209,9 @@ OPENSSL_EXPORT uint32_t ERR_peek_last_error_line_data(const char **file, int *flags); // ERR_error_string_n generates a human-readable string representing -// |packed_error| and places it at |buf|. It writes at most |len| bytes -// (including the terminating NUL) and truncates the string if necessary. If -// |len| is greater than zero then |buf| is always NUL terminated. +// |packed_error|, places it at |buf|, and returns |buf|. It writes at most +// |len| bytes (including the terminating NUL) and truncates the string if +// necessary. If |len| is greater than zero then |buf| is always NUL terminated. // // The string will have the following format: // @@ -216,8 +219,8 @@ OPENSSL_EXPORT uint32_t ERR_peek_last_error_line_data(const char **file, // // error code is an 8 digit hexadecimal number; library name and reason string // are ASCII text. -OPENSSL_EXPORT void ERR_error_string_n(uint32_t packed_error, char *buf, - size_t len); +OPENSSL_EXPORT char *ERR_error_string_n(uint32_t packed_error, char *buf, + size_t len); // ERR_lib_error_string returns a string representation of the library that // generated |packed_error|. @@ -386,10 +389,12 @@ OPENSSL_EXPORT void ERR_remove_thread_state(const CRYPTO_THREADID *tid); OPENSSL_EXPORT const char *ERR_func_error_string(uint32_t packed_error); // ERR_error_string behaves like |ERR_error_string_n| but |len| is implicitly -// |ERR_ERROR_STRING_BUF_LEN| and it returns |buf|. If |buf| is NULL, the error -// string is placed in a static buffer which is returned. (The static buffer may -// be overridden by concurrent calls in other threads so this form should not be -// used.) +// |ERR_ERROR_STRING_BUF_LEN|. +// +// Additionally, if |buf| is NULL, the error string is placed in a static buffer +// which is returned. This is not thread-safe and only exists for backwards +// compatibility with legacy callers. The static buffer will be overridden by +// calls in other threads. // // Use |ERR_error_string_n| instead. // diff --git a/Pods/BoringSSL-GRPC/include/openssl/evp.h b/Pods/BoringSSL-GRPC/src/include/openssl/evp.h similarity index 77% rename from Pods/BoringSSL-GRPC/include/openssl/evp.h rename to Pods/BoringSSL-GRPC/src/include/openssl/evp.h index 7d0dcae14..71a9803ec 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/evp.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/evp.h @@ -80,6 +80,12 @@ extern "C" { // Public key objects. +// +// An |EVP_PKEY| object represents a public or private key. A given object may +// be used concurrently on multiple threads by non-mutating functions, provided +// no other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. // EVP_PKEY_new creates a new, empty public-key object and returns it or NULL // on allocation failure. @@ -89,7 +95,9 @@ OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new(void); // itself. OPENSSL_EXPORT void EVP_PKEY_free(EVP_PKEY *pkey); -// EVP_PKEY_up_ref increments the reference count of |pkey| and returns one. +// EVP_PKEY_up_ref increments the reference count of |pkey| and returns one. It +// does not mutate |pkey| for thread-safety purposes and may be used +// concurrently. OPENSSL_EXPORT int EVP_PKEY_up_ref(EVP_PKEY *pkey); // EVP_PKEY_is_opaque returns one if |pkey| is opaque. Opaque keys are backed by @@ -121,7 +129,7 @@ OPENSSL_EXPORT int EVP_PKEY_size(const EVP_PKEY *pkey); // EVP_PKEY_bits returns the "size", in bits, of |pkey|. For an RSA key, this // returns the bit length of the modulus. For an EC key, this returns the bit // length of the group order. -OPENSSL_EXPORT int EVP_PKEY_bits(EVP_PKEY *pkey); +OPENSSL_EXPORT int EVP_PKEY_bits(const EVP_PKEY *pkey); // EVP_PKEY_id returns the type of |pkey|, which is one of the |EVP_PKEY_*| // values. @@ -136,51 +144,48 @@ OPENSSL_EXPORT int EVP_PKEY_type(int nid); // // The following functions get and set the underlying public key in an // |EVP_PKEY| object. The |set1| functions take an additional reference to the -// underlying key and return one on success or zero on error. The |assign| -// functions adopt the caller's reference. The |get1| functions return a fresh -// reference to the underlying object or NULL if |pkey| is not of the correct -// type. The |get0| functions behave the same but return a non-owning -// pointer. +// underlying key and return one on success or zero if |key| is NULL. The +// |assign| functions adopt the caller's reference and return one on success or +// zero if |key| is NULL. The |get1| functions return a fresh reference to the +// underlying object or NULL if |pkey| is not of the correct type. The |get0| +// functions behave the same but return a non-owning pointer. +// +// The |get0| and |get1| functions take |const| pointers and are thus +// non-mutating for thread-safety purposes, but mutating functions on the +// returned lower-level objects are considered to also mutate the |EVP_PKEY| and +// may not be called concurrently with other operations on the |EVP_PKEY|. OPENSSL_EXPORT int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key); OPENSSL_EXPORT int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key); -OPENSSL_EXPORT RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey); -OPENSSL_EXPORT RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); +OPENSSL_EXPORT RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey); +OPENSSL_EXPORT RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey); OPENSSL_EXPORT int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key); OPENSSL_EXPORT int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key); -OPENSSL_EXPORT DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey); -OPENSSL_EXPORT DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); +OPENSSL_EXPORT DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey); +OPENSSL_EXPORT DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey); OPENSSL_EXPORT int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key); OPENSSL_EXPORT int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key); -OPENSSL_EXPORT EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey); -OPENSSL_EXPORT EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); - -// EVP_PKEY_new_ed25519_public returns a newly allocated |EVP_PKEY| wrapping an -// Ed25519 public key, or NULL on allocation error. -OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_ed25519_public( - const uint8_t public_key[32]); - -// EVP_PKEY_new_ed25519_private returns a newly allocated |EVP_PKEY| wrapping an -// Ed25519 private key, or NULL on allocation error. -OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_ed25519_private( - const uint8_t private_key[64]); +OPENSSL_EXPORT EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey); +OPENSSL_EXPORT EC_KEY *EVP_PKEY_get1_EC_KEY(const EVP_PKEY *pkey); #define EVP_PKEY_NONE NID_undef #define EVP_PKEY_RSA NID_rsaEncryption +#define EVP_PKEY_RSA_PSS NID_rsassaPss #define EVP_PKEY_DSA NID_dsa #define EVP_PKEY_EC NID_X9_62_id_ecPublicKey #define EVP_PKEY_ED25519 NID_ED25519 +#define EVP_PKEY_X25519 NID_X25519 // EVP_PKEY_assign sets the underlying key of |pkey| to |key|, which must be of -// the given type. The |type| argument should be one of the |EVP_PKEY_*| -// values. +// the given type. It returns one if successful or zero if the |type| argument +// is not one of the |EVP_PKEY_*| values or if |key| is NULL. OPENSSL_EXPORT int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); -// EVP_PKEY_set_type sets the type of |pkey| to |type|, which should be one of -// the |EVP_PKEY_*| values. It returns one if successful or zero otherwise. If -// |pkey| is NULL, it simply reports whether the type is known. +// EVP_PKEY_set_type sets the type of |pkey| to |type|. It returns one if +// successful or zero if the |type| argument is not one of the |EVP_PKEY_*| +// values. If |pkey| is NULL, it simply reports whether the type is known. OPENSSL_EXPORT int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); // EVP_PKEY_cmp_parameters compares the parameters of |a| and |b|. It returns @@ -195,7 +200,8 @@ OPENSSL_EXPORT int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, // EVP_parse_public_key decodes a DER-encoded SubjectPublicKeyInfo structure // (RFC 5280) from |cbs| and advances |cbs|. It returns a newly-allocated -// |EVP_PKEY| or NULL on error. +// |EVP_PKEY| or NULL on error. If the key is an EC key, the curve is guaranteed +// to be set. // // The caller must check the type of the parsed public key to ensure it is // suitable and validate other desired key properties such as RSA modulus size @@ -226,6 +232,48 @@ OPENSSL_EXPORT EVP_PKEY *EVP_parse_private_key(CBS *cbs); OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key); +// Raw keys +// +// Some keys types support a "raw" serialization. Currently the only supported +// raw format is Ed25519, where the public key and private key formats are those +// specified in RFC 8032. Note the RFC 8032 private key format is the 32-byte +// prefix of |ED25519_sign|'s 64-byte private key. + +// EVP_PKEY_new_raw_private_key returns a newly allocated |EVP_PKEY| wrapping a +// private key of the specified type. It returns one on success and zero on +// error. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *unused, + const uint8_t *in, + size_t len); + +// EVP_PKEY_new_raw_public_key returns a newly allocated |EVP_PKEY| wrapping a +// public key of the specified type. It returns one on success and zero on +// error. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *unused, + const uint8_t *in, + size_t len); + +// EVP_PKEY_get_raw_private_key outputs the private key for |pkey| in raw form. +// If |out| is NULL, it sets |*out_len| to the size of the raw private key. +// Otherwise, it writes at most |*out_len| bytes to |out| and sets |*out_len| to +// the number of bytes written. +// +// It returns one on success and zero if |pkey| has no private key, the key +// type does not support a raw format, or the buffer is too small. +OPENSSL_EXPORT int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, + uint8_t *out, size_t *out_len); + +// EVP_PKEY_get_raw_public_key outputs the public key for |pkey| in raw form. +// If |out| is NULL, it sets |*out_len| to the size of the raw public key. +// Otherwise, it writes at most |*out_len| bytes to |out| and sets |*out_len| to +// the number of bytes written. +// +// It returns one on success and zero if |pkey| has no public key, the key +// type does not support a raw format, or the buffer is too small. +OPENSSL_EXPORT int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, + uint8_t *out, size_t *out_len); + + // Signing // EVP_DigestSignInit sets up |ctx| for a signing operation with |type| and @@ -238,6 +286,9 @@ OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key); // Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is // present so the API is uniform. See |EVP_DigestSign|. // +// This function does not mutate |pkey| for thread-safety purposes and may be +// used concurrently with other non-mutating functions on |pkey|. +// // It returns one on success, or zero on error. OPENSSL_EXPORT int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, @@ -291,6 +342,9 @@ OPENSSL_EXPORT int EVP_DigestSign(EVP_MD_CTX *ctx, uint8_t *out_sig, // Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is // present so the API is uniform. See |EVP_DigestVerify|. // +// This function does not mutate |pkey| for thread-safety purposes and may be +// used concurrently with other non-mutating functions on |pkey|. +// // It returns one on success, or zero on error. OPENSSL_EXPORT int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, @@ -351,7 +405,9 @@ OPENSSL_EXPORT int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *data, // It returns one on success and zero otherwise. // // It does not modify |ctx|, thus it's possible to continue to use |ctx| in -// order to sign a longer message. +// order to sign a longer message. It also does not mutate |pkey| for +// thread-safety purposes and may be used concurrently with other non-mutating +// functions on |pkey|. OPENSSL_EXPORT int EVP_SignFinal(const EVP_MD_CTX *ctx, uint8_t *sig, unsigned int *out_sig_len, EVP_PKEY *pkey); @@ -384,7 +440,9 @@ OPENSSL_EXPORT int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *data, // It returns one on success and zero otherwise. // // It does not modify |ctx|, thus it's possible to continue to use |ctx| in -// order to sign a longer message. +// order to verify a longer message. It also does not mutate |pkey| for +// thread-safety purposes and may be used concurrently with other non-mutating +// functions on |pkey|. OPENSSL_EXPORT int EVP_VerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, size_t sig_len, EVP_PKEY *pkey); @@ -415,7 +473,7 @@ OPENSSL_EXPORT int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, // PKCS5_PBKDF2_HMAC computes |iterations| iterations of PBKDF2 of |password| // and |salt|, using |digest|, and outputs |key_len| bytes to |out_key|. It -// returns one on success and zero on error. +// returns one on success and zero on allocation failure or if iterations is 0. OPENSSL_EXPORT int PKCS5_PBKDF2_HMAC(const char *password, size_t password_len, const uint8_t *salt, size_t salt_len, unsigned iterations, const EVP_MD *digest, @@ -431,12 +489,20 @@ OPENSSL_EXPORT int PKCS5_PBKDF2_HMAC_SHA1(const char *password, // EVP_PBE_scrypt expands |password| into a secret key of length |key_len| using // scrypt, as described in RFC 7914, and writes the result to |out_key|. It -// returns one on success and zero on error. +// returns one on success and zero on allocation failure, if the memory required +// for the operation exceeds |max_mem|, or if any of the parameters are invalid +// as described below. // // |N|, |r|, and |p| are as described in RFC 7914 section 6. They determine the -// cost of the operation. If the memory required exceeds |max_mem|, the -// operation will fail instead. If |max_mem| is zero, a defult limit of 32MiB -// will be used. +// cost of the operation. If |max_mem| is zero, a defult limit of 32MiB will be +// used. +// +// The parameters are considered invalid under any of the following conditions: +// - |r| or |p| are zero +// - |p| > (2^30 - 1) / |r| +// - |N| is not a power of two +// - |N| > 2^32 +// - |N| > 2^(128 * |r| / 8) OPENSSL_EXPORT int EVP_PBE_scrypt(const char *password, size_t password_len, const uint8_t *salt, size_t salt_len, uint64_t N, uint64_t r, uint64_t p, @@ -613,9 +679,23 @@ OPENSSL_EXPORT int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, uint8_t *key, OPENSSL_EXPORT int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); // EVP_PKEY_keygen performs a key generation operation using the values from -// |ctx| and sets |*ppkey| to a fresh |EVP_PKEY| containing the resulting key. +// |ctx|. If |*out_pkey| is non-NULL, it overwrites |*out_pkey| with the +// resulting key. Otherwise, it sets |*out_pkey| to a newly-allocated |EVP_PKEY| +// containing the result. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey); + +// EVP_PKEY_paramgen_init initialises an |EVP_PKEY_CTX| for a parameter +// generation operation. It should be called before |EVP_PKEY_paramgen|. +// // It returns one on success or zero on error. -OPENSSL_EXPORT int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +OPENSSL_EXPORT int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_paramgen performs a parameter generation using the values from +// |ctx|. If |*out_pkey| is non-NULL, it overwrites |*out_pkey| with the +// resulting parameters, but no key. Otherwise, it sets |*out_pkey| to a +// newly-allocated |EVP_PKEY| containing the result. It returns one on success +// or zero on error. +OPENSSL_EXPORT int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey); // Generic control functions. @@ -713,6 +793,15 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, const uint8_t **out_label); +// EC specific control functions. + +// EVP_PKEY_CTX_set_ec_paramgen_curve_nid sets the curve used for +// |EVP_PKEY_keygen| or |EVP_PKEY_paramgen| operations to |nid|. It returns one +// on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, + int nid); + + // Deprecated functions. // EVP_PKEY_DH is defined for compatibility, but it is impossible to create an @@ -723,6 +812,14 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, // 2.5.8.1.1), but is no longer accepted. #define EVP_PKEY_RSA2 NID_rsa +// EVP_PKEY_X448 is defined for OpenSSL compatibility, but we do not support +// X448 and attempts to create keys will fail. +#define EVP_PKEY_X448 NID_X448 + +// EVP_PKEY_ED448 is defined for OpenSSL compatibility, but we do not support +// Ed448 and attempts to create keys will fail. +#define EVP_PKEY_ED448 NID_ED448 + // OpenSSL_add_all_algorithms does nothing. OPENSSL_EXPORT void OpenSSL_add_all_algorithms(void); @@ -769,7 +866,7 @@ OPENSSL_EXPORT int i2d_PrivateKey(const EVP_PKEY *key, uint8_t **outp); // EC keys are serialized as an EC point per SEC 1. // // Use |RSA_marshal_public_key| or |EC_POINT_point2cbb| instead. -OPENSSL_EXPORT int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp); +OPENSSL_EXPORT int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp); // d2i_PrivateKey parses an ASN.1, DER-encoded, private key from |len| bytes at // |*inp|. If |out| is not NULL then, on exit, a pointer to the result is in @@ -793,8 +890,83 @@ OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **out, OPENSSL_EXPORT EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, long len); +// d2i_PublicKey parse a public key from |len| bytes at |*inp| in a type- +// specific format specified by |type|. If |out| is not NULL then, on exit, a +// pointer to the result is in |*out|. Note that, even if |*out| is already non- +// NULL on entry, it will not be written to. Rather, a fresh |EVP_PKEY| is +// allocated and the previous one is freed. On successful exit, |*inp| is +// advanced past the decoded key. It returns the result or NULL on error. +// +// RSA keys are parsed as a DER-encoded RSAPublicKey (RFC 3447) structure. +// Parsing EC keys is not supported by this function. +// +// Use |RSA_parse_public_key| instead. +OPENSSL_EXPORT EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **out, + const uint8_t **inp, long len); + // EVP_PKEY_get0_DH returns NULL. -OPENSSL_EXPORT DH *EVP_PKEY_get0_DH(EVP_PKEY *pkey); +OPENSSL_EXPORT DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); + +// EVP_PKEY_get1_DH returns NULL. +OPENSSL_EXPORT DH *EVP_PKEY_get1_DH(const EVP_PKEY *pkey); + +// EVP_PKEY_CTX_set_ec_param_enc returns one if |encoding| is +// |OPENSSL_EC_NAMED_CURVE| or zero with an error otherwise. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, + int encoding); + +// EVP_PKEY_set1_tls_encodedpoint replaces |pkey| with a public key encoded by +// |in|. It returns one on success and zero on error. +// +// This function only works on X25519 keys. +OPENSSL_EXPORT int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, + const uint8_t *in, + size_t len); + +// EVP_PKEY_get1_tls_encodedpoint sets |*out_ptr| to a newly-allocated buffer +// containing the raw encoded public key for |pkey|. The caller must call +// |OPENSSL_free| to release this buffer. The function returns the length of the +// buffer on success and zero on error. +// +// This function only works on X25519 keys. +OPENSSL_EXPORT size_t EVP_PKEY_get1_tls_encodedpoint(const EVP_PKEY *pkey, + uint8_t **out_ptr); + +// EVP_PKEY_base_id calls |EVP_PKEY_id|. +OPENSSL_EXPORT int EVP_PKEY_base_id(const EVP_PKEY *pkey); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_md returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, + int salt_len); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + + +// Preprocessor compatibility section (hidden). +// +// Historically, a number of APIs were implemented in OpenSSL as macros and +// constants to 'ctrl' functions. To avoid breaking #ifdefs in consumers, this +// section defines a number of legacy macros. + +// |BORINGSSL_PREFIX| already makes each of these symbols into macros, so there +// is no need to define conflicting macros. +#if !defined(BORINGSSL_PREFIX) +#endif + + +// Nodejs compatibility section (hidden). +// +// These defines exist for node.js, with the hope that we can eliminate the +// need for them over time. + +#define EVPerr(function, reason) \ + ERR_put_error(ERR_LIB_EVP, 0, reason, __FILE__, __LINE__) // Private structures. @@ -824,12 +996,13 @@ struct evp_pkey_st { } // extern C extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EVP_PKEY, EVP_PKEY_free) +BORINGSSL_MAKE_UP_REF(EVP_PKEY, EVP_PKEY_up_ref) BORINGSSL_MAKE_DELETER(EVP_PKEY_CTX, EVP_PKEY_CTX_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -869,5 +1042,7 @@ BORINGSSL_MAKE_DELETER(EVP_PKEY_CTX, EVP_PKEY_CTX_free) #define EVP_R_INVALID_SIGNATURE 131 #define EVP_R_MEMORY_LIMIT_EXCEEDED 132 #define EVP_R_INVALID_PARAMETERS 133 +#define EVP_R_INVALID_PEER_KEY 134 +#define EVP_R_NOT_XOF_OR_INVALID_LENGTH 135 #endif // OPENSSL_HEADER_EVP_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.back new file mode 100644 index 000000000..d5d102ed6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.back @@ -0,0 +1,1048 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_EVP_H +#define OPENSSL_HEADER_EVP_H + +#include + +#include + +// OpenSSL included digest and cipher functions in this header so we include +// them for users that still expect that. +// +// TODO(fork): clean up callers so that they include what they use. +#include +#include +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// EVP abstracts over public/private key algorithms. + + +// Public key objects. +// +// An |EVP_PKEY| object represents a public or private key. A given object may +// be used concurrently on multiple threads by non-mutating functions, provided +// no other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. + +// EVP_PKEY_new creates a new, empty public-key object and returns it or NULL +// on allocation failure. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new(void); + +// EVP_PKEY_free frees all data referenced by |pkey| and then frees |pkey| +// itself. +OPENSSL_EXPORT void EVP_PKEY_free(EVP_PKEY *pkey); + +// EVP_PKEY_up_ref increments the reference count of |pkey| and returns one. It +// does not mutate |pkey| for thread-safety purposes and may be used +// concurrently. +OPENSSL_EXPORT int EVP_PKEY_up_ref(EVP_PKEY *pkey); + +// EVP_PKEY_is_opaque returns one if |pkey| is opaque. Opaque keys are backed by +// custom implementations which do not expose key material and parameters. It is +// an error to attempt to duplicate, export, or compare an opaque key. +OPENSSL_EXPORT int EVP_PKEY_is_opaque(const EVP_PKEY *pkey); + +// EVP_PKEY_cmp compares |a| and |b| and returns one if they are equal, zero if +// not and a negative number on error. +// +// WARNING: this differs from the traditional return value of a "cmp" +// function. +OPENSSL_EXPORT int EVP_PKEY_cmp(const EVP_PKEY *a, const EVP_PKEY *b); + +// EVP_PKEY_copy_parameters sets the parameters of |to| to equal the parameters +// of |from|. It returns one on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); + +// EVP_PKEY_missing_parameters returns one if |pkey| is missing needed +// parameters or zero if not, or if the algorithm doesn't take parameters. +OPENSSL_EXPORT int EVP_PKEY_missing_parameters(const EVP_PKEY *pkey); + +// EVP_PKEY_size returns the maximum size, in bytes, of a signature signed by +// |pkey|. For an RSA key, this returns the number of bytes needed to represent +// the modulus. For an EC key, this returns the maximum size of a DER-encoded +// ECDSA signature. +OPENSSL_EXPORT int EVP_PKEY_size(const EVP_PKEY *pkey); + +// EVP_PKEY_bits returns the "size", in bits, of |pkey|. For an RSA key, this +// returns the bit length of the modulus. For an EC key, this returns the bit +// length of the group order. +OPENSSL_EXPORT int EVP_PKEY_bits(const EVP_PKEY *pkey); + +// EVP_PKEY_id returns the type of |pkey|, which is one of the |EVP_PKEY_*| +// values. +OPENSSL_EXPORT int EVP_PKEY_id(const EVP_PKEY *pkey); + +// EVP_PKEY_type returns |nid| if |nid| is a known key type and |NID_undef| +// otherwise. +OPENSSL_EXPORT int EVP_PKEY_type(int nid); + + +// Getting and setting concrete public key types. +// +// The following functions get and set the underlying public key in an +// |EVP_PKEY| object. The |set1| functions take an additional reference to the +// underlying key and return one on success or zero if |key| is NULL. The +// |assign| functions adopt the caller's reference and return one on success or +// zero if |key| is NULL. The |get1| functions return a fresh reference to the +// underlying object or NULL if |pkey| is not of the correct type. The |get0| +// functions behave the same but return a non-owning pointer. +// +// The |get0| and |get1| functions take |const| pointers and are thus +// non-mutating for thread-safety purposes, but mutating functions on the +// returned lower-level objects are considered to also mutate the |EVP_PKEY| and +// may not be called concurrently with other operations on the |EVP_PKEY|. + +OPENSSL_EXPORT int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key); +OPENSSL_EXPORT int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key); +OPENSSL_EXPORT RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey); +OPENSSL_EXPORT RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey); + +OPENSSL_EXPORT int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key); +OPENSSL_EXPORT int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key); +OPENSSL_EXPORT DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey); +OPENSSL_EXPORT DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey); + +OPENSSL_EXPORT int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key); +OPENSSL_EXPORT int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key); +OPENSSL_EXPORT EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey); +OPENSSL_EXPORT EC_KEY *EVP_PKEY_get1_EC_KEY(const EVP_PKEY *pkey); + +#define EVP_PKEY_NONE NID_undef +#define EVP_PKEY_RSA NID_rsaEncryption +#define EVP_PKEY_RSA_PSS NID_rsassaPss +#define EVP_PKEY_DSA NID_dsa +#define EVP_PKEY_EC NID_X9_62_id_ecPublicKey +#define EVP_PKEY_ED25519 NID_ED25519 +#define EVP_PKEY_X25519 NID_X25519 + +// EVP_PKEY_assign sets the underlying key of |pkey| to |key|, which must be of +// the given type. It returns one if successful or zero if the |type| argument +// is not one of the |EVP_PKEY_*| values or if |key| is NULL. +OPENSSL_EXPORT int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); + +// EVP_PKEY_set_type sets the type of |pkey| to |type|. It returns one if +// successful or zero if the |type| argument is not one of the |EVP_PKEY_*| +// values. If |pkey| is NULL, it simply reports whether the type is known. +OPENSSL_EXPORT int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); + +// EVP_PKEY_cmp_parameters compares the parameters of |a| and |b|. It returns +// one if they match, zero if not, or a negative number of on error. +// +// WARNING: the return value differs from the usual return value convention. +OPENSSL_EXPORT int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, + const EVP_PKEY *b); + + +// ASN.1 functions + +// EVP_parse_public_key decodes a DER-encoded SubjectPublicKeyInfo structure +// (RFC 5280) from |cbs| and advances |cbs|. It returns a newly-allocated +// |EVP_PKEY| or NULL on error. If the key is an EC key, the curve is guaranteed +// to be set. +// +// The caller must check the type of the parsed public key to ensure it is +// suitable and validate other desired key properties such as RSA modulus size +// or EC curve. +OPENSSL_EXPORT EVP_PKEY *EVP_parse_public_key(CBS *cbs); + +// EVP_marshal_public_key marshals |key| as a DER-encoded SubjectPublicKeyInfo +// structure (RFC 5280) and appends the result to |cbb|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int EVP_marshal_public_key(CBB *cbb, const EVP_PKEY *key); + +// EVP_parse_private_key decodes a DER-encoded PrivateKeyInfo structure (RFC +// 5208) from |cbs| and advances |cbs|. It returns a newly-allocated |EVP_PKEY| +// or NULL on error. +// +// The caller must check the type of the parsed private key to ensure it is +// suitable and validate other desired key properties such as RSA modulus size +// or EC curve. +// +// A PrivateKeyInfo ends with an optional set of attributes. These are not +// processed and so this function will silently ignore any trailing data in the +// structure. +OPENSSL_EXPORT EVP_PKEY *EVP_parse_private_key(CBS *cbs); + +// EVP_marshal_private_key marshals |key| as a DER-encoded PrivateKeyInfo +// structure (RFC 5208) and appends the result to |cbb|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key); + + +// Raw keys +// +// Some keys types support a "raw" serialization. Currently the only supported +// raw format is Ed25519, where the public key and private key formats are those +// specified in RFC 8032. Note the RFC 8032 private key format is the 32-byte +// prefix of |ED25519_sign|'s 64-byte private key. + +// EVP_PKEY_new_raw_private_key returns a newly allocated |EVP_PKEY| wrapping a +// private key of the specified type. It returns one on success and zero on +// error. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *unused, + const uint8_t *in, + size_t len); + +// EVP_PKEY_new_raw_public_key returns a newly allocated |EVP_PKEY| wrapping a +// public key of the specified type. It returns one on success and zero on +// error. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *unused, + const uint8_t *in, + size_t len); + +// EVP_PKEY_get_raw_private_key outputs the private key for |pkey| in raw form. +// If |out| is NULL, it sets |*out_len| to the size of the raw private key. +// Otherwise, it writes at most |*out_len| bytes to |out| and sets |*out_len| to +// the number of bytes written. +// +// It returns one on success and zero if |pkey| has no private key, the key +// type does not support a raw format, or the buffer is too small. +OPENSSL_EXPORT int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, + uint8_t *out, size_t *out_len); + +// EVP_PKEY_get_raw_public_key outputs the public key for |pkey| in raw form. +// If |out| is NULL, it sets |*out_len| to the size of the raw public key. +// Otherwise, it writes at most |*out_len| bytes to |out| and sets |*out_len| to +// the number of bytes written. +// +// It returns one on success and zero if |pkey| has no public key, the key +// type does not support a raw format, or the buffer is too small. +OPENSSL_EXPORT int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, + uint8_t *out, size_t *out_len); + + +// Signing + +// EVP_DigestSignInit sets up |ctx| for a signing operation with |type| and +// |pkey|. The |ctx| argument must have been initialised with +// |EVP_MD_CTX_init|. If |pctx| is not NULL, the |EVP_PKEY_CTX| of the signing +// operation will be written to |*pctx|; this can be used to set alternative +// signing options. +// +// For single-shot signing algorithms which do not use a pre-hash, such as +// Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is +// present so the API is uniform. See |EVP_DigestSign|. +// +// This function does not mutate |pkey| for thread-safety purposes and may be +// used concurrently with other non-mutating functions on |pkey|. +// +// It returns one on success, or zero on error. +OPENSSL_EXPORT int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, + EVP_PKEY *pkey); + +// EVP_DigestSignUpdate appends |len| bytes from |data| to the data which will +// be signed in |EVP_DigestSignFinal|. It returns one. +// +// This function performs a streaming signing operation and will fail for +// signature algorithms which do not support this. Use |EVP_DigestSign| for a +// single-shot operation. +OPENSSL_EXPORT int EVP_DigestSignUpdate(EVP_MD_CTX *ctx, const void *data, + size_t len); + +// EVP_DigestSignFinal signs the data that has been included by one or more +// calls to |EVP_DigestSignUpdate|. If |out_sig| is NULL then |*out_sig_len| is +// set to the maximum number of output bytes. Otherwise, on entry, +// |*out_sig_len| must contain the length of the |out_sig| buffer. If the call +// is successful, the signature is written to |out_sig| and |*out_sig_len| is +// set to its length. +// +// This function performs a streaming signing operation and will fail for +// signature algorithms which do not support this. Use |EVP_DigestSign| for a +// single-shot operation. +// +// It returns one on success, or zero on error. +OPENSSL_EXPORT int EVP_DigestSignFinal(EVP_MD_CTX *ctx, uint8_t *out_sig, + size_t *out_sig_len); + +// EVP_DigestSign signs |data_len| bytes from |data| using |ctx|. If |out_sig| +// is NULL then |*out_sig_len| is set to the maximum number of output +// bytes. Otherwise, on entry, |*out_sig_len| must contain the length of the +// |out_sig| buffer. If the call is successful, the signature is written to +// |out_sig| and |*out_sig_len| is set to its length. +// +// It returns one on success and zero on error. +OPENSSL_EXPORT int EVP_DigestSign(EVP_MD_CTX *ctx, uint8_t *out_sig, + size_t *out_sig_len, const uint8_t *data, + size_t data_len); + + +// Verifying + +// EVP_DigestVerifyInit sets up |ctx| for a signature verification operation +// with |type| and |pkey|. The |ctx| argument must have been initialised with +// |EVP_MD_CTX_init|. If |pctx| is not NULL, the |EVP_PKEY_CTX| of the signing +// operation will be written to |*pctx|; this can be used to set alternative +// signing options. +// +// For single-shot signing algorithms which do not use a pre-hash, such as +// Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is +// present so the API is uniform. See |EVP_DigestVerify|. +// +// This function does not mutate |pkey| for thread-safety purposes and may be +// used concurrently with other non-mutating functions on |pkey|. +// +// It returns one on success, or zero on error. +OPENSSL_EXPORT int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, + const EVP_MD *type, ENGINE *e, + EVP_PKEY *pkey); + +// EVP_DigestVerifyUpdate appends |len| bytes from |data| to the data which +// will be verified by |EVP_DigestVerifyFinal|. It returns one. +// +// This function performs streaming signature verification and will fail for +// signature algorithms which do not support this. Use |EVP_PKEY_verify_message| +// for a single-shot verification. +OPENSSL_EXPORT int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *data, + size_t len); + +// EVP_DigestVerifyFinal verifies that |sig_len| bytes of |sig| are a valid +// signature for the data that has been included by one or more calls to +// |EVP_DigestVerifyUpdate|. It returns one on success and zero otherwise. +// +// This function performs streaming signature verification and will fail for +// signature algorithms which do not support this. Use |EVP_PKEY_verify_message| +// for a single-shot verification. +OPENSSL_EXPORT int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, + size_t sig_len); + +// EVP_DigestVerify verifies that |sig_len| bytes from |sig| are a valid +// signature for |data|. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_DigestVerify(EVP_MD_CTX *ctx, const uint8_t *sig, + size_t sig_len, const uint8_t *data, + size_t len); + + +// Signing (old functions) + +// EVP_SignInit_ex configures |ctx|, which must already have been initialised, +// for a fresh signing operation using the hash function |type|. It returns one +// on success and zero otherwise. +// +// (In order to initialise |ctx|, either obtain it initialised with +// |EVP_MD_CTX_create|, or use |EVP_MD_CTX_init|.) +OPENSSL_EXPORT int EVP_SignInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, + ENGINE *impl); + +// EVP_SignInit is a deprecated version of |EVP_SignInit_ex|. +// +// TODO(fork): remove. +OPENSSL_EXPORT int EVP_SignInit(EVP_MD_CTX *ctx, const EVP_MD *type); + +// EVP_SignUpdate appends |len| bytes from |data| to the data which will be +// signed in |EVP_SignFinal|. +OPENSSL_EXPORT int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *data, + size_t len); + +// EVP_SignFinal signs the data that has been included by one or more calls to +// |EVP_SignUpdate|, using the key |pkey|, and writes it to |sig|. On entry, +// |sig| must point to at least |EVP_PKEY_size(pkey)| bytes of space. The +// actual size of the signature is written to |*out_sig_len|. +// +// It returns one on success and zero otherwise. +// +// It does not modify |ctx|, thus it's possible to continue to use |ctx| in +// order to sign a longer message. It also does not mutate |pkey| for +// thread-safety purposes and may be used concurrently with other non-mutating +// functions on |pkey|. +OPENSSL_EXPORT int EVP_SignFinal(const EVP_MD_CTX *ctx, uint8_t *sig, + unsigned int *out_sig_len, EVP_PKEY *pkey); + + +// Verifying (old functions) + +// EVP_VerifyInit_ex configures |ctx|, which must already have been +// initialised, for a fresh signature verification operation using the hash +// function |type|. It returns one on success and zero otherwise. +// +// (In order to initialise |ctx|, either obtain it initialised with +// |EVP_MD_CTX_create|, or use |EVP_MD_CTX_init|.) +OPENSSL_EXPORT int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, + ENGINE *impl); + +// EVP_VerifyInit is a deprecated version of |EVP_VerifyInit_ex|. +// +// TODO(fork): remove. +OPENSSL_EXPORT int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type); + +// EVP_VerifyUpdate appends |len| bytes from |data| to the data which will be +// signed in |EVP_VerifyFinal|. +OPENSSL_EXPORT int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *data, + size_t len); + +// EVP_VerifyFinal verifies that |sig_len| bytes of |sig| are a valid +// signature, by |pkey|, for the data that has been included by one or more +// calls to |EVP_VerifyUpdate|. +// +// It returns one on success and zero otherwise. +// +// It does not modify |ctx|, thus it's possible to continue to use |ctx| in +// order to verify a longer message. It also does not mutate |pkey| for +// thread-safety purposes and may be used concurrently with other non-mutating +// functions on |pkey|. +OPENSSL_EXPORT int EVP_VerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, + size_t sig_len, EVP_PKEY *pkey); + + +// Printing + +// EVP_PKEY_print_public prints a textual representation of the public key in +// |pkey| to |out|. Returns one on success or zero otherwise. +OPENSSL_EXPORT int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); + +// EVP_PKEY_print_private prints a textual representation of the private key in +// |pkey| to |out|. Returns one on success or zero otherwise. +OPENSSL_EXPORT int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); + +// EVP_PKEY_print_params prints a textual representation of the parameters in +// |pkey| to |out|. Returns one on success or zero otherwise. +OPENSSL_EXPORT int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, + int indent, ASN1_PCTX *pctx); + + +// Password stretching. +// +// Password stretching functions take a low-entropy password and apply a slow +// function that results in a key suitable for use in symmetric +// cryptography. + +// PKCS5_PBKDF2_HMAC computes |iterations| iterations of PBKDF2 of |password| +// and |salt|, using |digest|, and outputs |key_len| bytes to |out_key|. It +// returns one on success and zero on allocation failure or if iterations is 0. +OPENSSL_EXPORT int PKCS5_PBKDF2_HMAC(const char *password, size_t password_len, + const uint8_t *salt, size_t salt_len, + unsigned iterations, const EVP_MD *digest, + size_t key_len, uint8_t *out_key); + +// PKCS5_PBKDF2_HMAC_SHA1 is the same as PKCS5_PBKDF2_HMAC, but with |digest| +// fixed to |EVP_sha1|. +OPENSSL_EXPORT int PKCS5_PBKDF2_HMAC_SHA1(const char *password, + size_t password_len, + const uint8_t *salt, size_t salt_len, + unsigned iterations, size_t key_len, + uint8_t *out_key); + +// EVP_PBE_scrypt expands |password| into a secret key of length |key_len| using +// scrypt, as described in RFC 7914, and writes the result to |out_key|. It +// returns one on success and zero on allocation failure, if the memory required +// for the operation exceeds |max_mem|, or if any of the parameters are invalid +// as described below. +// +// |N|, |r|, and |p| are as described in RFC 7914 section 6. They determine the +// cost of the operation. If |max_mem| is zero, a defult limit of 32MiB will be +// used. +// +// The parameters are considered invalid under any of the following conditions: +// - |r| or |p| are zero +// - |p| > (2^30 - 1) / |r| +// - |N| is not a power of two +// - |N| > 2^32 +// - |N| > 2^(128 * |r| / 8) +OPENSSL_EXPORT int EVP_PBE_scrypt(const char *password, size_t password_len, + const uint8_t *salt, size_t salt_len, + uint64_t N, uint64_t r, uint64_t p, + size_t max_mem, uint8_t *out_key, + size_t key_len); + + +// Public key contexts. +// +// |EVP_PKEY_CTX| objects hold the context of an operation (e.g. signing or +// encrypting) that uses a public key. + +// EVP_PKEY_CTX_new allocates a fresh |EVP_PKEY_CTX| for use with |pkey|. It +// returns the context or NULL on error. +OPENSSL_EXPORT EVP_PKEY_CTX *EVP_PKEY_CTX_new(EVP_PKEY *pkey, ENGINE *e); + +// EVP_PKEY_CTX_new_id allocates a fresh |EVP_PKEY_CTX| for a key of type |id| +// (e.g. |EVP_PKEY_HMAC|). This can be used for key generation where +// |EVP_PKEY_CTX_new| can't be used because there isn't an |EVP_PKEY| to pass +// it. It returns the context or NULL on error. +OPENSSL_EXPORT EVP_PKEY_CTX *EVP_PKEY_CTX_new_id(int id, ENGINE *e); + +// EVP_PKEY_CTX_free frees |ctx| and the data it owns. +OPENSSL_EXPORT void EVP_PKEY_CTX_free(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_CTX_dup allocates a fresh |EVP_PKEY_CTX| and sets it equal to the +// state of |ctx|. It returns the fresh |EVP_PKEY_CTX| or NULL on error. +OPENSSL_EXPORT EVP_PKEY_CTX *EVP_PKEY_CTX_dup(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_CTX_get0_pkey returns the |EVP_PKEY| associated with |ctx|. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_CTX_get0_pkey(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_sign_init initialises an |EVP_PKEY_CTX| for a signing operation. It +// should be called before |EVP_PKEY_sign|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_sign signs |digest_len| bytes from |digest| using |ctx|. If |sig| is +// NULL, the maximum size of the signature is written to +// |out_sig_len|. Otherwise, |*sig_len| must contain the number of bytes of +// space available at |sig|. If sufficient, the signature will be written to +// |sig| and |*sig_len| updated with the true length. +// +// This function expects a pre-hashed input and will fail for signature +// algorithms which do not support this. Use |EVP_DigestSignInit| to sign an +// unhashed input. +// +// WARNING: Setting |sig| to NULL only gives the maximum size of the +// signature. The actual signature may be smaller. +// +// It returns one on success or zero on error. (Note: this differs from +// OpenSSL, which can also return negative values to indicate an error. ) +OPENSSL_EXPORT int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, uint8_t *sig, + size_t *sig_len, const uint8_t *digest, + size_t digest_len); + +// EVP_PKEY_verify_init initialises an |EVP_PKEY_CTX| for a signature +// verification operation. It should be called before |EVP_PKEY_verify|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_verify verifies that |sig_len| bytes from |sig| are a valid +// signature for |digest|. +// +// This function expects a pre-hashed input and will fail for signature +// algorithms which do not support this. Use |EVP_DigestVerifyInit| to verify a +// signature given the unhashed input. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, const uint8_t *sig, + size_t sig_len, const uint8_t *digest, + size_t digest_len); + +// EVP_PKEY_encrypt_init initialises an |EVP_PKEY_CTX| for an encryption +// operation. It should be called before |EVP_PKEY_encrypt|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_encrypt encrypts |in_len| bytes from |in|. If |out| is NULL, the +// maximum size of the ciphertext is written to |out_len|. Otherwise, |*out_len| +// must contain the number of bytes of space available at |out|. If sufficient, +// the ciphertext will be written to |out| and |*out_len| updated with the true +// length. +// +// WARNING: Setting |out| to NULL only gives the maximum size of the +// ciphertext. The actual ciphertext may be smaller. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len, const uint8_t *in, + size_t in_len); + +// EVP_PKEY_decrypt_init initialises an |EVP_PKEY_CTX| for a decryption +// operation. It should be called before |EVP_PKEY_decrypt|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_decrypt decrypts |in_len| bytes from |in|. If |out| is NULL, the +// maximum size of the plaintext is written to |out_len|. Otherwise, |*out_len| +// must contain the number of bytes of space available at |out|. If sufficient, +// the ciphertext will be written to |out| and |*out_len| updated with the true +// length. +// +// WARNING: Setting |out| to NULL only gives the maximum size of the +// plaintext. The actual plaintext may be smaller. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len, const uint8_t *in, + size_t in_len); + +// EVP_PKEY_verify_recover_init initialises an |EVP_PKEY_CTX| for a public-key +// decryption operation. It should be called before |EVP_PKEY_verify_recover|. +// +// Public-key decryption is a very obscure operation that is only implemented +// by RSA keys. It is effectively a signature verification operation that +// returns the signed message directly. It is almost certainly not what you +// want. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_verify_recover decrypts |sig_len| bytes from |sig|. If |out| is +// NULL, the maximum size of the plaintext is written to |out_len|. Otherwise, +// |*out_len| must contain the number of bytes of space available at |out|. If +// sufficient, the ciphertext will be written to |out| and |*out_len| updated +// with the true length. +// +// WARNING: Setting |out| to NULL only gives the maximum size of the +// plaintext. The actual plaintext may be smaller. +// +// See the warning about this operation in |EVP_PKEY_verify_recover_init|. It +// is probably not what you want. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, uint8_t *out, + size_t *out_len, const uint8_t *sig, + size_t siglen); + +// EVP_PKEY_derive_init initialises an |EVP_PKEY_CTX| for a key derivation +// operation. It should be called before |EVP_PKEY_derive_set_peer| and +// |EVP_PKEY_derive|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_derive_set_peer sets the peer's key to be used for key derivation +// by |ctx| to |peer|. It should be called after |EVP_PKEY_derive_init|. (For +// example, this is used to set the peer's key in (EC)DH.) It returns one on +// success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); + +// EVP_PKEY_derive derives a shared key between the two keys configured in +// |ctx|. If |key| is non-NULL then, on entry, |out_key_len| must contain the +// amount of space at |key|. If sufficient then the shared key will be written +// to |key| and |*out_key_len| will be set to the length. If |key| is NULL then +// |out_key_len| will be set to the maximum length. +// +// WARNING: Setting |out| to NULL only gives the maximum size of the key. The +// actual key may be smaller. +// +// It returns one on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, uint8_t *key, + size_t *out_key_len); + +// EVP_PKEY_keygen_init initialises an |EVP_PKEY_CTX| for a key generation +// operation. It should be called before |EVP_PKEY_keygen|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_keygen performs a key generation operation using the values from +// |ctx|. If |*out_pkey| is non-NULL, it overwrites |*out_pkey| with the +// resulting key. Otherwise, it sets |*out_pkey| to a newly-allocated |EVP_PKEY| +// containing the result. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey); + +// EVP_PKEY_paramgen_init initialises an |EVP_PKEY_CTX| for a parameter +// generation operation. It should be called before |EVP_PKEY_paramgen|. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_paramgen performs a parameter generation using the values from +// |ctx|. If |*out_pkey| is non-NULL, it overwrites |*out_pkey| with the +// resulting parameters, but no key. Otherwise, it sets |*out_pkey| to a +// newly-allocated |EVP_PKEY| containing the result. It returns one on success +// or zero on error. +OPENSSL_EXPORT int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey); + + +// Generic control functions. + +// EVP_PKEY_CTX_set_signature_md sets |md| as the digest to be used in a +// signature operation. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_signature_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_get_signature_md sets |*out_md| to the digest to be used in a +// signature operation. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_get_signature_md(EVP_PKEY_CTX *ctx, + const EVP_MD **out_md); + + +// RSA specific control functions. + +// EVP_PKEY_CTX_set_rsa_padding sets the padding type to use. It should be one +// of the |RSA_*_PADDING| values. Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_padding(EVP_PKEY_CTX *ctx, int padding); + +// EVP_PKEY_CTX_get_rsa_padding sets |*out_padding| to the current padding +// value, which is one of the |RSA_*_PADDING| values. Returns one on success or +// zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_get_rsa_padding(EVP_PKEY_CTX *ctx, + int *out_padding); + +// EVP_PKEY_CTX_set_rsa_pss_saltlen sets the length of the salt in a PSS-padded +// signature. A value of -1 cause the salt to be the same length as the digest +// in the signature. A value of -2 causes the salt to be the maximum length +// that will fit when signing and recovered from the signature when verifying. +// Otherwise the value gives the size of the salt in bytes. +// +// If unsure, use -1. +// +// Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, + int salt_len); + +// EVP_PKEY_CTX_get_rsa_pss_saltlen sets |*out_salt_len| to the salt length of +// a PSS-padded signature. See the documentation for +// |EVP_PKEY_CTX_set_rsa_pss_saltlen| for details of the special values that it +// can take. +// +// Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_get_rsa_pss_saltlen(EVP_PKEY_CTX *ctx, + int *out_salt_len); + +// EVP_PKEY_CTX_set_rsa_keygen_bits sets the size of the desired RSA modulus, +// in bits, for key generation. Returns one on success or zero on +// error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_keygen_bits(EVP_PKEY_CTX *ctx, + int bits); + +// EVP_PKEY_CTX_set_rsa_keygen_pubexp sets |e| as the public exponent for key +// generation. Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_keygen_pubexp(EVP_PKEY_CTX *ctx, + BIGNUM *e); + +// EVP_PKEY_CTX_set_rsa_oaep_md sets |md| as the digest used in OAEP padding. +// Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_oaep_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_get_rsa_oaep_md sets |*out_md| to the digest function used in +// OAEP padding. Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_get_rsa_oaep_md(EVP_PKEY_CTX *ctx, + const EVP_MD **out_md); + +// EVP_PKEY_CTX_set_rsa_mgf1_md sets |md| as the digest used in MGF1. Returns +// one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_get_rsa_mgf1_md sets |*out_md| to the digest function used in +// MGF1. Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_get_rsa_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD **out_md); + +// EVP_PKEY_CTX_set0_rsa_oaep_label sets |label_len| bytes from |label| as the +// label used in OAEP. DANGER: On success, this call takes ownership of |label| +// and will call |OPENSSL_free| on it when |ctx| is destroyed. +// +// Returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set0_rsa_oaep_label(EVP_PKEY_CTX *ctx, + uint8_t *label, + size_t label_len); + +// EVP_PKEY_CTX_get0_rsa_oaep_label sets |*out_label| to point to the internal +// buffer containing the OAEP label (which may be NULL) and returns the length +// of the label or a negative value on error. +// +// WARNING: the return value differs from the usual return value convention. +OPENSSL_EXPORT int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, + const uint8_t **out_label); + + +// EC specific control functions. + +// EVP_PKEY_CTX_set_ec_paramgen_curve_nid sets the curve used for +// |EVP_PKEY_keygen| or |EVP_PKEY_paramgen| operations to |nid|. It returns one +// on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, + int nid); + + +// Deprecated functions. + +// EVP_PKEY_DH is defined for compatibility, but it is impossible to create an +// |EVP_PKEY| of that type. +#define EVP_PKEY_DH NID_dhKeyAgreement + +// EVP_PKEY_RSA2 was historically an alternate form for RSA public keys (OID +// 2.5.8.1.1), but is no longer accepted. +#define EVP_PKEY_RSA2 NID_rsa + +// EVP_PKEY_X448 is defined for OpenSSL compatibility, but we do not support +// X448 and attempts to create keys will fail. +#define EVP_PKEY_X448 NID_X448 + +// EVP_PKEY_ED448 is defined for OpenSSL compatibility, but we do not support +// Ed448 and attempts to create keys will fail. +#define EVP_PKEY_ED448 NID_ED448 + +// OpenSSL_add_all_algorithms does nothing. +OPENSSL_EXPORT void OpenSSL_add_all_algorithms(void); + +// OPENSSL_add_all_algorithms_conf does nothing. +OPENSSL_EXPORT void OPENSSL_add_all_algorithms_conf(void); + +// OpenSSL_add_all_ciphers does nothing. +OPENSSL_EXPORT void OpenSSL_add_all_ciphers(void); + +// OpenSSL_add_all_digests does nothing. +OPENSSL_EXPORT void OpenSSL_add_all_digests(void); + +// EVP_cleanup does nothing. +OPENSSL_EXPORT void EVP_cleanup(void); + +OPENSSL_EXPORT void EVP_CIPHER_do_all_sorted( + void (*callback)(const EVP_CIPHER *cipher, const char *name, + const char *unused, void *arg), + void *arg); + +OPENSSL_EXPORT void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher, + const char *name, + const char *unused, + void *arg), + void *arg); + +// i2d_PrivateKey marshals a private key from |key| to an ASN.1, DER +// structure. If |outp| is not NULL then the result is written to |*outp| and +// |*outp| is advanced just past the output. It returns the number of bytes in +// the result, whether written or not, or a negative value on error. +// +// RSA keys are serialized as a DER-encoded RSAPublicKey (RFC 3447) structure. +// EC keys are serialized as a DER-encoded ECPrivateKey (RFC 5915) structure. +// +// Use |RSA_marshal_private_key| or |EC_KEY_marshal_private_key| instead. +OPENSSL_EXPORT int i2d_PrivateKey(const EVP_PKEY *key, uint8_t **outp); + +// i2d_PublicKey marshals a public key from |key| to a type-specific format. +// If |outp| is not NULL then the result is written to |*outp| and +// |*outp| is advanced just past the output. It returns the number of bytes in +// the result, whether written or not, or a negative value on error. +// +// RSA keys are serialized as a DER-encoded RSAPublicKey (RFC 3447) structure. +// EC keys are serialized as an EC point per SEC 1. +// +// Use |RSA_marshal_public_key| or |EC_POINT_point2cbb| instead. +OPENSSL_EXPORT int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp); + +// d2i_PrivateKey parses an ASN.1, DER-encoded, private key from |len| bytes at +// |*inp|. If |out| is not NULL then, on exit, a pointer to the result is in +// |*out|. Note that, even if |*out| is already non-NULL on entry, it will not +// be written to. Rather, a fresh |EVP_PKEY| is allocated and the previous one +// is freed. On successful exit, |*inp| is advanced past the DER structure. It +// returns the result or NULL on error. +// +// This function tries to detect one of several formats. Instead, use +// |EVP_parse_private_key| for a PrivateKeyInfo, |RSA_parse_private_key| for an +// RSAPrivateKey, and |EC_parse_private_key| for an ECPrivateKey. +OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **out, + const uint8_t **inp, long len); + +// d2i_AutoPrivateKey acts the same as |d2i_PrivateKey|, but detects the type +// of the private key. +// +// This function tries to detect one of several formats. Instead, use +// |EVP_parse_private_key| for a PrivateKeyInfo, |RSA_parse_private_key| for an +// RSAPrivateKey, and |EC_parse_private_key| for an ECPrivateKey. +OPENSSL_EXPORT EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, + long len); + +// d2i_PublicKey parse a public key from |len| bytes at |*inp| in a type- +// specific format specified by |type|. If |out| is not NULL then, on exit, a +// pointer to the result is in |*out|. Note that, even if |*out| is already non- +// NULL on entry, it will not be written to. Rather, a fresh |EVP_PKEY| is +// allocated and the previous one is freed. On successful exit, |*inp| is +// advanced past the decoded key. It returns the result or NULL on error. +// +// RSA keys are parsed as a DER-encoded RSAPublicKey (RFC 3447) structure. +// Parsing EC keys is not supported by this function. +// +// Use |RSA_parse_public_key| instead. +OPENSSL_EXPORT EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **out, + const uint8_t **inp, long len); + +// EVP_PKEY_get0_DH returns NULL. +OPENSSL_EXPORT DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); + +// EVP_PKEY_get1_DH returns NULL. +OPENSSL_EXPORT DH *EVP_PKEY_get1_DH(const EVP_PKEY *pkey); + +// EVP_PKEY_CTX_set_ec_param_enc returns one if |encoding| is +// |OPENSSL_EC_NAMED_CURVE| or zero with an error otherwise. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, + int encoding); + +// EVP_PKEY_set1_tls_encodedpoint replaces |pkey| with a public key encoded by +// |in|. It returns one on success and zero on error. +// +// This function only works on X25519 keys. +OPENSSL_EXPORT int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, + const uint8_t *in, + size_t len); + +// EVP_PKEY_get1_tls_encodedpoint sets |*out_ptr| to a newly-allocated buffer +// containing the raw encoded public key for |pkey|. The caller must call +// |OPENSSL_free| to release this buffer. The function returns the length of the +// buffer on success and zero on error. +// +// This function only works on X25519 keys. +OPENSSL_EXPORT size_t EVP_PKEY_get1_tls_encodedpoint(const EVP_PKEY *pkey, + uint8_t **out_ptr); + +// EVP_PKEY_base_id calls |EVP_PKEY_id|. +OPENSSL_EXPORT int EVP_PKEY_base_id(const EVP_PKEY *pkey); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_md returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, + int salt_len); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + + +// Preprocessor compatibility section (hidden). +// +// Historically, a number of APIs were implemented in OpenSSL as macros and +// constants to 'ctrl' functions. To avoid breaking #ifdefs in consumers, this +// section defines a number of legacy macros. + +// |BORINGSSL_PREFIX| already makes each of these symbols into macros, so there +// is no need to define conflicting macros. +#if !defined(BORINGSSL_PREFIX) +#endif + + +// Nodejs compatibility section (hidden). +// +// These defines exist for node.js, with the hope that we can eliminate the +// need for them over time. + +#define EVPerr(function, reason) \ + ERR_put_error(ERR_LIB_EVP, 0, reason, __FILE__, __LINE__) + + +// Private structures. + +struct evp_pkey_st { + CRYPTO_refcount_t references; + + // type contains one of the EVP_PKEY_* values or NID_undef and determines + // which element (if any) of the |pkey| union is valid. + int type; + + union { + void *ptr; + RSA *rsa; + DSA *dsa; + DH *dh; + EC_KEY *ec; + } pkey; + + // ameth contains a pointer to a method table that contains many ASN.1 + // methods for the key type. + const EVP_PKEY_ASN1_METHOD *ameth; +} /* EVP_PKEY */; + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(EVP_PKEY, EVP_PKEY_free) +BORINGSSL_MAKE_UP_REF(EVP_PKEY, EVP_PKEY_up_ref) +BORINGSSL_MAKE_DELETER(EVP_PKEY_CTX, EVP_PKEY_CTX_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define EVP_R_BUFFER_TOO_SMALL 100 +#define EVP_R_COMMAND_NOT_SUPPORTED 101 +#define EVP_R_DECODE_ERROR 102 +#define EVP_R_DIFFERENT_KEY_TYPES 103 +#define EVP_R_DIFFERENT_PARAMETERS 104 +#define EVP_R_ENCODE_ERROR 105 +#define EVP_R_EXPECTING_AN_EC_KEY_KEY 106 +#define EVP_R_EXPECTING_AN_RSA_KEY 107 +#define EVP_R_EXPECTING_A_DSA_KEY 108 +#define EVP_R_ILLEGAL_OR_UNSUPPORTED_PADDING_MODE 109 +#define EVP_R_INVALID_DIGEST_LENGTH 110 +#define EVP_R_INVALID_DIGEST_TYPE 111 +#define EVP_R_INVALID_KEYBITS 112 +#define EVP_R_INVALID_MGF1_MD 113 +#define EVP_R_INVALID_OPERATION 114 +#define EVP_R_INVALID_PADDING_MODE 115 +#define EVP_R_INVALID_PSS_SALTLEN 116 +#define EVP_R_KEYS_NOT_SET 117 +#define EVP_R_MISSING_PARAMETERS 118 +#define EVP_R_NO_DEFAULT_DIGEST 119 +#define EVP_R_NO_KEY_SET 120 +#define EVP_R_NO_MDC2_SUPPORT 121 +#define EVP_R_NO_NID_FOR_CURVE 122 +#define EVP_R_NO_OPERATION_SET 123 +#define EVP_R_NO_PARAMETERS_SET 124 +#define EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE 125 +#define EVP_R_OPERATON_NOT_INITIALIZED 126 +#define EVP_R_UNKNOWN_PUBLIC_KEY_TYPE 127 +#define EVP_R_UNSUPPORTED_ALGORITHM 128 +#define EVP_R_UNSUPPORTED_PUBLIC_KEY_TYPE 129 +#define EVP_R_NOT_A_PRIVATE_KEY 130 +#define EVP_R_INVALID_SIGNATURE 131 +#define EVP_R_MEMORY_LIMIT_EXCEEDED 132 +#define EVP_R_INVALID_PARAMETERS 133 +#define EVP_R_INVALID_PEER_KEY 134 +#define EVP_R_NOT_XOF_OR_INVALID_LENGTH 135 + +#endif // OPENSSL_HEADER_EVP_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/evp.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/include/openssl/evp.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/evp.h.grpc_back index 7816b591b..d5d102ed6 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/evp.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/evp.h.grpc_back @@ -80,6 +80,12 @@ extern "C" { // Public key objects. +// +// An |EVP_PKEY| object represents a public or private key. A given object may +// be used concurrently on multiple threads by non-mutating functions, provided +// no other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. // EVP_PKEY_new creates a new, empty public-key object and returns it or NULL // on allocation failure. @@ -89,7 +95,9 @@ OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new(void); // itself. OPENSSL_EXPORT void EVP_PKEY_free(EVP_PKEY *pkey); -// EVP_PKEY_up_ref increments the reference count of |pkey| and returns one. +// EVP_PKEY_up_ref increments the reference count of |pkey| and returns one. It +// does not mutate |pkey| for thread-safety purposes and may be used +// concurrently. OPENSSL_EXPORT int EVP_PKEY_up_ref(EVP_PKEY *pkey); // EVP_PKEY_is_opaque returns one if |pkey| is opaque. Opaque keys are backed by @@ -121,7 +129,7 @@ OPENSSL_EXPORT int EVP_PKEY_size(const EVP_PKEY *pkey); // EVP_PKEY_bits returns the "size", in bits, of |pkey|. For an RSA key, this // returns the bit length of the modulus. For an EC key, this returns the bit // length of the group order. -OPENSSL_EXPORT int EVP_PKEY_bits(EVP_PKEY *pkey); +OPENSSL_EXPORT int EVP_PKEY_bits(const EVP_PKEY *pkey); // EVP_PKEY_id returns the type of |pkey|, which is one of the |EVP_PKEY_*| // values. @@ -136,51 +144,48 @@ OPENSSL_EXPORT int EVP_PKEY_type(int nid); // // The following functions get and set the underlying public key in an // |EVP_PKEY| object. The |set1| functions take an additional reference to the -// underlying key and return one on success or zero on error. The |assign| -// functions adopt the caller's reference. The |get1| functions return a fresh -// reference to the underlying object or NULL if |pkey| is not of the correct -// type. The |get0| functions behave the same but return a non-owning -// pointer. +// underlying key and return one on success or zero if |key| is NULL. The +// |assign| functions adopt the caller's reference and return one on success or +// zero if |key| is NULL. The |get1| functions return a fresh reference to the +// underlying object or NULL if |pkey| is not of the correct type. The |get0| +// functions behave the same but return a non-owning pointer. +// +// The |get0| and |get1| functions take |const| pointers and are thus +// non-mutating for thread-safety purposes, but mutating functions on the +// returned lower-level objects are considered to also mutate the |EVP_PKEY| and +// may not be called concurrently with other operations on the |EVP_PKEY|. OPENSSL_EXPORT int EVP_PKEY_set1_RSA(EVP_PKEY *pkey, RSA *key); OPENSSL_EXPORT int EVP_PKEY_assign_RSA(EVP_PKEY *pkey, RSA *key); -OPENSSL_EXPORT RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey); -OPENSSL_EXPORT RSA *EVP_PKEY_get1_RSA(EVP_PKEY *pkey); +OPENSSL_EXPORT RSA *EVP_PKEY_get0_RSA(const EVP_PKEY *pkey); +OPENSSL_EXPORT RSA *EVP_PKEY_get1_RSA(const EVP_PKEY *pkey); OPENSSL_EXPORT int EVP_PKEY_set1_DSA(EVP_PKEY *pkey, DSA *key); OPENSSL_EXPORT int EVP_PKEY_assign_DSA(EVP_PKEY *pkey, DSA *key); -OPENSSL_EXPORT DSA *EVP_PKEY_get0_DSA(EVP_PKEY *pkey); -OPENSSL_EXPORT DSA *EVP_PKEY_get1_DSA(EVP_PKEY *pkey); +OPENSSL_EXPORT DSA *EVP_PKEY_get0_DSA(const EVP_PKEY *pkey); +OPENSSL_EXPORT DSA *EVP_PKEY_get1_DSA(const EVP_PKEY *pkey); OPENSSL_EXPORT int EVP_PKEY_set1_EC_KEY(EVP_PKEY *pkey, EC_KEY *key); OPENSSL_EXPORT int EVP_PKEY_assign_EC_KEY(EVP_PKEY *pkey, EC_KEY *key); -OPENSSL_EXPORT EC_KEY *EVP_PKEY_get0_EC_KEY(EVP_PKEY *pkey); -OPENSSL_EXPORT EC_KEY *EVP_PKEY_get1_EC_KEY(EVP_PKEY *pkey); - -// EVP_PKEY_new_ed25519_public returns a newly allocated |EVP_PKEY| wrapping an -// Ed25519 public key, or NULL on allocation error. -OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_ed25519_public( - const uint8_t public_key[32]); - -// EVP_PKEY_new_ed25519_private returns a newly allocated |EVP_PKEY| wrapping an -// Ed25519 private key, or NULL on allocation error. -OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_ed25519_private( - const uint8_t private_key[64]); +OPENSSL_EXPORT EC_KEY *EVP_PKEY_get0_EC_KEY(const EVP_PKEY *pkey); +OPENSSL_EXPORT EC_KEY *EVP_PKEY_get1_EC_KEY(const EVP_PKEY *pkey); #define EVP_PKEY_NONE NID_undef #define EVP_PKEY_RSA NID_rsaEncryption +#define EVP_PKEY_RSA_PSS NID_rsassaPss #define EVP_PKEY_DSA NID_dsa #define EVP_PKEY_EC NID_X9_62_id_ecPublicKey #define EVP_PKEY_ED25519 NID_ED25519 +#define EVP_PKEY_X25519 NID_X25519 // EVP_PKEY_assign sets the underlying key of |pkey| to |key|, which must be of -// the given type. The |type| argument should be one of the |EVP_PKEY_*| -// values. +// the given type. It returns one if successful or zero if the |type| argument +// is not one of the |EVP_PKEY_*| values or if |key| is NULL. OPENSSL_EXPORT int EVP_PKEY_assign(EVP_PKEY *pkey, int type, void *key); -// EVP_PKEY_set_type sets the type of |pkey| to |type|, which should be one of -// the |EVP_PKEY_*| values. It returns one if successful or zero otherwise. If -// |pkey| is NULL, it simply reports whether the type is known. +// EVP_PKEY_set_type sets the type of |pkey| to |type|. It returns one if +// successful or zero if the |type| argument is not one of the |EVP_PKEY_*| +// values. If |pkey| is NULL, it simply reports whether the type is known. OPENSSL_EXPORT int EVP_PKEY_set_type(EVP_PKEY *pkey, int type); // EVP_PKEY_cmp_parameters compares the parameters of |a| and |b|. It returns @@ -195,7 +200,8 @@ OPENSSL_EXPORT int EVP_PKEY_cmp_parameters(const EVP_PKEY *a, // EVP_parse_public_key decodes a DER-encoded SubjectPublicKeyInfo structure // (RFC 5280) from |cbs| and advances |cbs|. It returns a newly-allocated -// |EVP_PKEY| or NULL on error. +// |EVP_PKEY| or NULL on error. If the key is an EC key, the curve is guaranteed +// to be set. // // The caller must check the type of the parsed public key to ensure it is // suitable and validate other desired key properties such as RSA modulus size @@ -226,6 +232,48 @@ OPENSSL_EXPORT EVP_PKEY *EVP_parse_private_key(CBS *cbs); OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key); +// Raw keys +// +// Some keys types support a "raw" serialization. Currently the only supported +// raw format is Ed25519, where the public key and private key formats are those +// specified in RFC 8032. Note the RFC 8032 private key format is the 32-byte +// prefix of |ED25519_sign|'s 64-byte private key. + +// EVP_PKEY_new_raw_private_key returns a newly allocated |EVP_PKEY| wrapping a +// private key of the specified type. It returns one on success and zero on +// error. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *unused, + const uint8_t *in, + size_t len); + +// EVP_PKEY_new_raw_public_key returns a newly allocated |EVP_PKEY| wrapping a +// public key of the specified type. It returns one on success and zero on +// error. +OPENSSL_EXPORT EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *unused, + const uint8_t *in, + size_t len); + +// EVP_PKEY_get_raw_private_key outputs the private key for |pkey| in raw form. +// If |out| is NULL, it sets |*out_len| to the size of the raw private key. +// Otherwise, it writes at most |*out_len| bytes to |out| and sets |*out_len| to +// the number of bytes written. +// +// It returns one on success and zero if |pkey| has no private key, the key +// type does not support a raw format, or the buffer is too small. +OPENSSL_EXPORT int EVP_PKEY_get_raw_private_key(const EVP_PKEY *pkey, + uint8_t *out, size_t *out_len); + +// EVP_PKEY_get_raw_public_key outputs the public key for |pkey| in raw form. +// If |out| is NULL, it sets |*out_len| to the size of the raw public key. +// Otherwise, it writes at most |*out_len| bytes to |out| and sets |*out_len| to +// the number of bytes written. +// +// It returns one on success and zero if |pkey| has no public key, the key +// type does not support a raw format, or the buffer is too small. +OPENSSL_EXPORT int EVP_PKEY_get_raw_public_key(const EVP_PKEY *pkey, + uint8_t *out, size_t *out_len); + + // Signing // EVP_DigestSignInit sets up |ctx| for a signing operation with |type| and @@ -238,6 +286,9 @@ OPENSSL_EXPORT int EVP_marshal_private_key(CBB *cbb, const EVP_PKEY *key); // Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is // present so the API is uniform. See |EVP_DigestSign|. // +// This function does not mutate |pkey| for thread-safety purposes and may be +// used concurrently with other non-mutating functions on |pkey|. +// // It returns one on success, or zero on error. OPENSSL_EXPORT int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, @@ -291,6 +342,9 @@ OPENSSL_EXPORT int EVP_DigestSign(EVP_MD_CTX *ctx, uint8_t *out_sig, // Ed25519, |type| should be NULL. The |EVP_MD_CTX| itself is unused but is // present so the API is uniform. See |EVP_DigestVerify|. // +// This function does not mutate |pkey| for thread-safety purposes and may be +// used concurrently with other non-mutating functions on |pkey|. +// // It returns one on success, or zero on error. OPENSSL_EXPORT int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, @@ -351,7 +405,9 @@ OPENSSL_EXPORT int EVP_SignUpdate(EVP_MD_CTX *ctx, const void *data, // It returns one on success and zero otherwise. // // It does not modify |ctx|, thus it's possible to continue to use |ctx| in -// order to sign a longer message. +// order to sign a longer message. It also does not mutate |pkey| for +// thread-safety purposes and may be used concurrently with other non-mutating +// functions on |pkey|. OPENSSL_EXPORT int EVP_SignFinal(const EVP_MD_CTX *ctx, uint8_t *sig, unsigned int *out_sig_len, EVP_PKEY *pkey); @@ -384,7 +440,9 @@ OPENSSL_EXPORT int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *data, // It returns one on success and zero otherwise. // // It does not modify |ctx|, thus it's possible to continue to use |ctx| in -// order to sign a longer message. +// order to verify a longer message. It also does not mutate |pkey| for +// thread-safety purposes and may be used concurrently with other non-mutating +// functions on |pkey|. OPENSSL_EXPORT int EVP_VerifyFinal(EVP_MD_CTX *ctx, const uint8_t *sig, size_t sig_len, EVP_PKEY *pkey); @@ -415,7 +473,7 @@ OPENSSL_EXPORT int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, // PKCS5_PBKDF2_HMAC computes |iterations| iterations of PBKDF2 of |password| // and |salt|, using |digest|, and outputs |key_len| bytes to |out_key|. It -// returns one on success and zero on error. +// returns one on success and zero on allocation failure or if iterations is 0. OPENSSL_EXPORT int PKCS5_PBKDF2_HMAC(const char *password, size_t password_len, const uint8_t *salt, size_t salt_len, unsigned iterations, const EVP_MD *digest, @@ -431,12 +489,20 @@ OPENSSL_EXPORT int PKCS5_PBKDF2_HMAC_SHA1(const char *password, // EVP_PBE_scrypt expands |password| into a secret key of length |key_len| using // scrypt, as described in RFC 7914, and writes the result to |out_key|. It -// returns one on success and zero on error. +// returns one on success and zero on allocation failure, if the memory required +// for the operation exceeds |max_mem|, or if any of the parameters are invalid +// as described below. // // |N|, |r|, and |p| are as described in RFC 7914 section 6. They determine the -// cost of the operation. If the memory required exceeds |max_mem|, the -// operation will fail instead. If |max_mem| is zero, a defult limit of 32MiB -// will be used. +// cost of the operation. If |max_mem| is zero, a defult limit of 32MiB will be +// used. +// +// The parameters are considered invalid under any of the following conditions: +// - |r| or |p| are zero +// - |p| > (2^30 - 1) / |r| +// - |N| is not a power of two +// - |N| > 2^32 +// - |N| > 2^(128 * |r| / 8) OPENSSL_EXPORT int EVP_PBE_scrypt(const char *password, size_t password_len, const uint8_t *salt, size_t salt_len, uint64_t N, uint64_t r, uint64_t p, @@ -613,9 +679,23 @@ OPENSSL_EXPORT int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, uint8_t *key, OPENSSL_EXPORT int EVP_PKEY_keygen_init(EVP_PKEY_CTX *ctx); // EVP_PKEY_keygen performs a key generation operation using the values from -// |ctx| and sets |*ppkey| to a fresh |EVP_PKEY| containing the resulting key. +// |ctx|. If |*out_pkey| is non-NULL, it overwrites |*out_pkey| with the +// resulting key. Otherwise, it sets |*out_pkey| to a newly-allocated |EVP_PKEY| +// containing the result. It returns one on success or zero on error. +OPENSSL_EXPORT int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey); + +// EVP_PKEY_paramgen_init initialises an |EVP_PKEY_CTX| for a parameter +// generation operation. It should be called before |EVP_PKEY_paramgen|. +// // It returns one on success or zero on error. -OPENSSL_EXPORT int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey); +OPENSSL_EXPORT int EVP_PKEY_paramgen_init(EVP_PKEY_CTX *ctx); + +// EVP_PKEY_paramgen performs a parameter generation using the values from +// |ctx|. If |*out_pkey| is non-NULL, it overwrites |*out_pkey| with the +// resulting parameters, but no key. Otherwise, it sets |*out_pkey| to a +// newly-allocated |EVP_PKEY| containing the result. It returns one on success +// or zero on error. +OPENSSL_EXPORT int EVP_PKEY_paramgen(EVP_PKEY_CTX *ctx, EVP_PKEY **out_pkey); // Generic control functions. @@ -713,6 +793,15 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, const uint8_t **out_label); +// EC specific control functions. + +// EVP_PKEY_CTX_set_ec_paramgen_curve_nid sets the curve used for +// |EVP_PKEY_keygen| or |EVP_PKEY_paramgen| operations to |nid|. It returns one +// on success and zero on error. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_paramgen_curve_nid(EVP_PKEY_CTX *ctx, + int nid); + + // Deprecated functions. // EVP_PKEY_DH is defined for compatibility, but it is impossible to create an @@ -723,6 +812,14 @@ OPENSSL_EXPORT int EVP_PKEY_CTX_get0_rsa_oaep_label(EVP_PKEY_CTX *ctx, // 2.5.8.1.1), but is no longer accepted. #define EVP_PKEY_RSA2 NID_rsa +// EVP_PKEY_X448 is defined for OpenSSL compatibility, but we do not support +// X448 and attempts to create keys will fail. +#define EVP_PKEY_X448 NID_X448 + +// EVP_PKEY_ED448 is defined for OpenSSL compatibility, but we do not support +// Ed448 and attempts to create keys will fail. +#define EVP_PKEY_ED448 NID_ED448 + // OpenSSL_add_all_algorithms does nothing. OPENSSL_EXPORT void OpenSSL_add_all_algorithms(void); @@ -769,7 +866,7 @@ OPENSSL_EXPORT int i2d_PrivateKey(const EVP_PKEY *key, uint8_t **outp); // EC keys are serialized as an EC point per SEC 1. // // Use |RSA_marshal_public_key| or |EC_POINT_point2cbb| instead. -OPENSSL_EXPORT int i2d_PublicKey(EVP_PKEY *key, uint8_t **outp); +OPENSSL_EXPORT int i2d_PublicKey(const EVP_PKEY *key, uint8_t **outp); // d2i_PrivateKey parses an ASN.1, DER-encoded, private key from |len| bytes at // |*inp|. If |out| is not NULL then, on exit, a pointer to the result is in @@ -793,8 +890,83 @@ OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **out, OPENSSL_EXPORT EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **out, const uint8_t **inp, long len); +// d2i_PublicKey parse a public key from |len| bytes at |*inp| in a type- +// specific format specified by |type|. If |out| is not NULL then, on exit, a +// pointer to the result is in |*out|. Note that, even if |*out| is already non- +// NULL on entry, it will not be written to. Rather, a fresh |EVP_PKEY| is +// allocated and the previous one is freed. On successful exit, |*inp| is +// advanced past the decoded key. It returns the result or NULL on error. +// +// RSA keys are parsed as a DER-encoded RSAPublicKey (RFC 3447) structure. +// Parsing EC keys is not supported by this function. +// +// Use |RSA_parse_public_key| instead. +OPENSSL_EXPORT EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **out, + const uint8_t **inp, long len); + // EVP_PKEY_get0_DH returns NULL. -OPENSSL_EXPORT DH *EVP_PKEY_get0_DH(EVP_PKEY *pkey); +OPENSSL_EXPORT DH *EVP_PKEY_get0_DH(const EVP_PKEY *pkey); + +// EVP_PKEY_get1_DH returns NULL. +OPENSSL_EXPORT DH *EVP_PKEY_get1_DH(const EVP_PKEY *pkey); + +// EVP_PKEY_CTX_set_ec_param_enc returns one if |encoding| is +// |OPENSSL_EC_NAMED_CURVE| or zero with an error otherwise. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_ec_param_enc(EVP_PKEY_CTX *ctx, + int encoding); + +// EVP_PKEY_set1_tls_encodedpoint replaces |pkey| with a public key encoded by +// |in|. It returns one on success and zero on error. +// +// This function only works on X25519 keys. +OPENSSL_EXPORT int EVP_PKEY_set1_tls_encodedpoint(EVP_PKEY *pkey, + const uint8_t *in, + size_t len); + +// EVP_PKEY_get1_tls_encodedpoint sets |*out_ptr| to a newly-allocated buffer +// containing the raw encoded public key for |pkey|. The caller must call +// |OPENSSL_free| to release this buffer. The function returns the length of the +// buffer on success and zero on error. +// +// This function only works on X25519 keys. +OPENSSL_EXPORT size_t EVP_PKEY_get1_tls_encodedpoint(const EVP_PKEY *pkey, + uint8_t **out_ptr); + +// EVP_PKEY_base_id calls |EVP_PKEY_id|. +OPENSSL_EXPORT int EVP_PKEY_base_id(const EVP_PKEY *pkey); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_md returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_saltlen(EVP_PKEY_CTX *ctx, + int salt_len); + +// EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md returns 0. +OPENSSL_EXPORT int EVP_PKEY_CTX_set_rsa_pss_keygen_mgf1_md(EVP_PKEY_CTX *ctx, + const EVP_MD *md); + + +// Preprocessor compatibility section (hidden). +// +// Historically, a number of APIs were implemented in OpenSSL as macros and +// constants to 'ctrl' functions. To avoid breaking #ifdefs in consumers, this +// section defines a number of legacy macros. + +// |BORINGSSL_PREFIX| already makes each of these symbols into macros, so there +// is no need to define conflicting macros. +#if !defined(BORINGSSL_PREFIX) +#endif + + +// Nodejs compatibility section (hidden). +// +// These defines exist for node.js, with the hope that we can eliminate the +// need for them over time. + +#define EVPerr(function, reason) \ + ERR_put_error(ERR_LIB_EVP, 0, reason, __FILE__, __LINE__) // Private structures. @@ -824,12 +996,13 @@ struct evp_pkey_st { } // extern C extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(EVP_PKEY, EVP_PKEY_free) +BORINGSSL_MAKE_UP_REF(EVP_PKEY, EVP_PKEY_up_ref) BORINGSSL_MAKE_DELETER(EVP_PKEY_CTX, EVP_PKEY_CTX_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -869,5 +1042,7 @@ BORINGSSL_MAKE_DELETER(EVP_PKEY_CTX, EVP_PKEY_CTX_free) #define EVP_R_INVALID_SIGNATURE 131 #define EVP_R_MEMORY_LIMIT_EXCEEDED 132 #define EVP_R_INVALID_PARAMETERS 133 +#define EVP_R_INVALID_PEER_KEY 134 +#define EVP_R_NOT_XOF_OR_INVALID_LENGTH 135 #endif // OPENSSL_HEADER_EVP_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ex_data.h b/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/ex_data.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/ex_data.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/ex_data.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.grpc_back new file mode 100644 index 000000000..102f8a8f6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ex_data.h.grpc_back @@ -0,0 +1,203 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef OPENSSL_HEADER_EX_DATA_H +#define OPENSSL_HEADER_EX_DATA_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// ex_data is a mechanism for associating arbitrary extra data with objects. +// For each type of object that supports ex_data, different users can be +// assigned indexes in which to store their data. Each index has callback +// functions that are called when an object of that type is freed or +// duplicated. + + +typedef struct crypto_ex_data_st CRYPTO_EX_DATA; + + +// Type-specific functions. +// +// Each type that supports ex_data provides three functions: + +#if 0 // Sample + +// TYPE_get_ex_new_index allocates a new index for |TYPE|. An optional +// |free_func| argument may be provided which is called when the owning object +// is destroyed. See |CRYPTO_EX_free| for details. The |argl| and |argp| +// arguments are opaque values that are passed to the callback. It returns the +// new index or a negative number on error. +OPENSSL_EXPORT int TYPE_get_ex_new_index(long argl, void *argp, + CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func); + +// TYPE_set_ex_data sets an extra data pointer on |t|. The |index| argument +// should have been returned from a previous call to |TYPE_get_ex_new_index|. +OPENSSL_EXPORT int TYPE_set_ex_data(TYPE *t, int index, void *arg); + +// TYPE_get_ex_data returns an extra data pointer for |t|, or NULL if no such +// pointer exists. The |index| argument should have been returned from a +// previous call to |TYPE_get_ex_new_index|. +OPENSSL_EXPORT void *TYPE_get_ex_data(const TYPE *t, int index); + +#endif // Sample + + +// Callback types. + +// CRYPTO_EX_free is a callback function that is called when an object of the +// class with extra data pointers is being destroyed. For example, if this +// callback has been passed to |SSL_get_ex_new_index| then it may be called each +// time an |SSL*| is destroyed. +// +// The callback is passed the new object (i.e. the |SSL*|) in |parent|. The +// arguments |argl| and |argp| contain opaque values that were given to +// |CRYPTO_get_ex_new_index|. The callback should return one on success, but +// the value is ignored. +// +// This callback may be called with a NULL value for |ptr| if |parent| has no +// value set for this index. However, the callbacks may also be skipped entirely +// if no extra data pointers are set on |parent| at all. +typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, + int index, long argl, void *argp); + + +// Deprecated functions. + +// CRYPTO_cleanup_all_ex_data does nothing. +OPENSSL_EXPORT void CRYPTO_cleanup_all_ex_data(void); + +// CRYPTO_EX_dup is a legacy callback function type which is ignored. +typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from, + void **from_d, int index, long argl, void *argp); + + +// Private structures. + +// CRYPTO_EX_unused is a placeholder for an unused callback. It is aliased to +// int to ensure non-NULL callers fail to compile rather than fail silently. +typedef int CRYPTO_EX_unused; + +struct crypto_ex_data_st { + STACK_OF(void) *sk; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_EX_DATA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/hkdf.h b/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/hkdf.h rename to Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/hkdf.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/hkdf.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.grpc_back new file mode 100644 index 000000000..59aaa4936 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hkdf.h.grpc_back @@ -0,0 +1,64 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HKDF_H +#define OPENSSL_HEADER_HKDF_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// HKDF. + + +// HKDF computes HKDF (as specified by RFC 5869) of initial keying material +// |secret| with |salt| and |info| using |digest|, and outputs |out_len| bytes +// to |out_key|. It returns one on success and zero on error. +// +// HKDF is an Extract-and-Expand algorithm. It does not do any key stretching, +// and as such, is not suited to be used alone to generate a key from a +// password. +OPENSSL_EXPORT int HKDF(uint8_t *out_key, size_t out_len, const EVP_MD *digest, + const uint8_t *secret, size_t secret_len, + const uint8_t *salt, size_t salt_len, + const uint8_t *info, size_t info_len); + +// HKDF_extract computes a HKDF PRK (as specified by RFC 5869) from initial +// keying material |secret| and salt |salt| using |digest|, and outputs +// |out_len| bytes to |out_key|. The maximum output size is |EVP_MAX_MD_SIZE|. +// It returns one on success and zero on error. +OPENSSL_EXPORT int HKDF_extract(uint8_t *out_key, size_t *out_len, + const EVP_MD *digest, const uint8_t *secret, + size_t secret_len, const uint8_t *salt, + size_t salt_len); + +// HKDF_expand computes a HKDF OKM (as specified by RFC 5869) of length +// |out_len| from the PRK |prk| and info |info| using |digest|, and outputs +// the result to |out_key|. It returns one on success and zero on error. +OPENSSL_EXPORT int HKDF_expand(uint8_t *out_key, size_t out_len, + const EVP_MD *digest, const uint8_t *prk, + size_t prk_len, const uint8_t *info, + size_t info_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#define HKDF_R_OUTPUT_TOO_LARGE 100 + +#endif // OPENSSL_HEADER_HKDF_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/hmac.h b/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/hmac.h rename to Pods/BoringSSL-GRPC/src/include/openssl/hmac.h index bd29128d8..85478859b 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/hmac.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h @@ -105,7 +105,7 @@ OPENSSL_EXPORT void HMAC_CTX_free(HMAC_CTX *ctx); // function and |key| as the key. For a non-initial call, |md| may be NULL, in // which case the previous hash function will be used. If the hash function has // not changed and |key| is NULL, |ctx| reuses the previous key. It returns one -// on success or zero otherwise. +// on success or zero on allocation failure. // // WARNING: NULL and empty keys are ambiguous on non-initial calls. Passing NULL // |key| but repeating the previous |md| reuses the previous key rather than the @@ -122,7 +122,7 @@ OPENSSL_EXPORT int HMAC_Update(HMAC_CTX *ctx, const uint8_t *data, // |out| and the sets |*out_len| to the length of the result. On entry, |out| // must contain at least |HMAC_size| bytes of space. An output size of // |EVP_MAX_MD_SIZE| will always be large enough. It returns one on success or -// zero on error. +// zero on allocation failure. OPENSSL_EXPORT int HMAC_Final(HMAC_CTX *ctx, uint8_t *out, unsigned int *out_len); @@ -169,14 +169,14 @@ struct hmac_ctx_st { #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(HMAC_CTX, HMAC_CTX_free) using ScopedHMAC_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.back new file mode 100644 index 000000000..b5d1e4209 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.back @@ -0,0 +1,186 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_HMAC_H +#define OPENSSL_HEADER_HMAC_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// HMAC contains functions for constructing PRFs from Merkle–Damgård hash +// functions using HMAC. + + +// One-shot operation. + +// HMAC calculates the HMAC of |data_len| bytes of |data|, using the given key +// and hash function, and writes the result to |out|. On entry, |out| must +// contain at least |EVP_MD_size| bytes of space. The actual length of the +// result is written to |*out_len|. An output size of |EVP_MAX_MD_SIZE| will +// always be large enough. It returns |out| or NULL on error. +OPENSSL_EXPORT uint8_t *HMAC(const EVP_MD *evp_md, const void *key, + size_t key_len, const uint8_t *data, + size_t data_len, uint8_t *out, + unsigned int *out_len); + + +// Incremental operation. + +// HMAC_CTX_init initialises |ctx| for use in an HMAC operation. It's assumed +// that HMAC_CTX objects will be allocated on the stack thus no allocation +// function is provided. +OPENSSL_EXPORT void HMAC_CTX_init(HMAC_CTX *ctx); + +// HMAC_CTX_new allocates and initialises a new |HMAC_CTX| and returns it, or +// NULL on allocation failure. The caller must use |HMAC_CTX_free| to release +// the resulting object. +OPENSSL_EXPORT HMAC_CTX *HMAC_CTX_new(void); + +// HMAC_CTX_cleanup frees data owned by |ctx|. It does not free |ctx| itself. +OPENSSL_EXPORT void HMAC_CTX_cleanup(HMAC_CTX *ctx); + +// HMAC_CTX_free calls |HMAC_CTX_cleanup| and then frees |ctx| itself. +OPENSSL_EXPORT void HMAC_CTX_free(HMAC_CTX *ctx); + +// HMAC_Init_ex sets up an initialised |HMAC_CTX| to use |md| as the hash +// function and |key| as the key. For a non-initial call, |md| may be NULL, in +// which case the previous hash function will be used. If the hash function has +// not changed and |key| is NULL, |ctx| reuses the previous key. It returns one +// on success or zero on allocation failure. +// +// WARNING: NULL and empty keys are ambiguous on non-initial calls. Passing NULL +// |key| but repeating the previous |md| reuses the previous key rather than the +// empty key. +OPENSSL_EXPORT int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, size_t key_len, + const EVP_MD *md, ENGINE *impl); + +// HMAC_Update hashes |data_len| bytes from |data| into the current HMAC +// operation in |ctx|. It returns one. +OPENSSL_EXPORT int HMAC_Update(HMAC_CTX *ctx, const uint8_t *data, + size_t data_len); + +// HMAC_Final completes the HMAC operation in |ctx| and writes the result to +// |out| and the sets |*out_len| to the length of the result. On entry, |out| +// must contain at least |HMAC_size| bytes of space. An output size of +// |EVP_MAX_MD_SIZE| will always be large enough. It returns one on success or +// zero on allocation failure. +OPENSSL_EXPORT int HMAC_Final(HMAC_CTX *ctx, uint8_t *out, + unsigned int *out_len); + + +// Utility functions. + +// HMAC_size returns the size, in bytes, of the HMAC that will be produced by +// |ctx|. On entry, |ctx| must have been setup with |HMAC_Init_ex|. +OPENSSL_EXPORT size_t HMAC_size(const HMAC_CTX *ctx); + +// HMAC_CTX_copy_ex sets |dest| equal to |src|. On entry, |dest| must have been +// initialised by calling |HMAC_CTX_init|. It returns one on success and zero +// on error. +OPENSSL_EXPORT int HMAC_CTX_copy_ex(HMAC_CTX *dest, const HMAC_CTX *src); + +// HMAC_CTX_reset calls |HMAC_CTX_cleanup| followed by |HMAC_CTX_init|. +OPENSSL_EXPORT void HMAC_CTX_reset(HMAC_CTX *ctx); + + +// Deprecated functions. + +OPENSSL_EXPORT int HMAC_Init(HMAC_CTX *ctx, const void *key, int key_len, + const EVP_MD *md); + +// HMAC_CTX_copy calls |HMAC_CTX_init| on |dest| and then sets it equal to +// |src|. On entry, |dest| must /not/ be initialised for an operation with +// |HMAC_Init_ex|. It returns one on success and zero on error. +OPENSSL_EXPORT int HMAC_CTX_copy(HMAC_CTX *dest, const HMAC_CTX *src); + + +// Private functions + +struct hmac_ctx_st { + const EVP_MD *md; + EVP_MD_CTX md_ctx; + EVP_MD_CTX i_ctx; + EVP_MD_CTX o_ctx; +} /* HMAC_CTX */; + + +#if defined(__cplusplus) +} // extern C + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(HMAC_CTX, HMAC_CTX_free) + +using ScopedHMAC_CTX = + internal::StackAllocated; + +BSSL_NAMESPACE_END + +} // extern C++ +#endif + +#endif + +#endif // OPENSSL_HEADER_HMAC_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/hmac.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/hmac.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.grpc_back index 8491b8d05..b5d1e4209 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/hmac.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hmac.h.grpc_back @@ -105,7 +105,7 @@ OPENSSL_EXPORT void HMAC_CTX_free(HMAC_CTX *ctx); // function and |key| as the key. For a non-initial call, |md| may be NULL, in // which case the previous hash function will be used. If the hash function has // not changed and |key| is NULL, |ctx| reuses the previous key. It returns one -// on success or zero otherwise. +// on success or zero on allocation failure. // // WARNING: NULL and empty keys are ambiguous on non-initial calls. Passing NULL // |key| but repeating the previous |md| reuses the previous key rather than the @@ -122,7 +122,7 @@ OPENSSL_EXPORT int HMAC_Update(HMAC_CTX *ctx, const uint8_t *data, // |out| and the sets |*out_len| to the length of the result. On entry, |out| // must contain at least |HMAC_size| bytes of space. An output size of // |EVP_MAX_MD_SIZE| will always be large enough. It returns one on success or -// zero on error. +// zero on allocation failure. OPENSSL_EXPORT int HMAC_Final(HMAC_CTX *ctx, uint8_t *out, unsigned int *out_len); @@ -169,14 +169,14 @@ struct hmac_ctx_st { #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(HMAC_CTX, HMAC_CTX_free) using ScopedHMAC_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h b/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h new file mode 100644 index 000000000..7ce7c0f6d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h @@ -0,0 +1,100 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HRSS_H +#define OPENSSL_HEADER_HRSS_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +// HRSS +// +// HRSS is a structured-lattice-based post-quantum key encapsulation mechanism. +// The best exposition is https://eprint.iacr.org/2017/667.pdf although this +// implementation uses a different KEM construction based on +// https://eprint.iacr.org/2017/1005.pdf. + +struct HRSS_private_key { + uint8_t opaque[1808]; +}; + +struct HRSS_public_key { + uint8_t opaque[1424]; +}; + +// HRSS_SAMPLE_BYTES is the number of bytes of entropy needed to generate a +// short vector. There are 701 coefficients, but the final one is always set to +// zero when sampling. Otherwise, we need one byte of input per coefficient. +#define HRSS_SAMPLE_BYTES (701 - 1) +// HRSS_GENERATE_KEY_BYTES is the number of bytes of entropy needed to generate +// an HRSS key pair. +#define HRSS_GENERATE_KEY_BYTES (HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES + 32) +// HRSS_ENCAP_BYTES is the number of bytes of entropy needed to encapsulate a +// session key. +#define HRSS_ENCAP_BYTES (HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES) +// HRSS_PUBLIC_KEY_BYTES is the number of bytes in a public key. +#define HRSS_PUBLIC_KEY_BYTES 1138 +// HRSS_CIPHERTEXT_BYTES is the number of bytes in a ciphertext. +#define HRSS_CIPHERTEXT_BYTES 1138 +// HRSS_KEY_BYTES is the number of bytes in a shared key. +#define HRSS_KEY_BYTES 32 +// HRSS_POLY3_BYTES is the number of bytes needed to serialise a mod 3 +// polynomial. +#define HRSS_POLY3_BYTES 140 +#define HRSS_PRIVATE_KEY_BYTES \ + (HRSS_POLY3_BYTES * 2 + HRSS_PUBLIC_KEY_BYTES + 2 + 32) + +// HRSS_generate_key is a deterministic function that outputs a public and +// private key based on the given entropy. +OPENSSL_EXPORT void HRSS_generate_key( + struct HRSS_public_key *out_pub, struct HRSS_private_key *out_priv, + const uint8_t input[HRSS_GENERATE_KEY_BYTES]); + +// HRSS_encap is a deterministic function the generates and encrypts a random +// session key from the given entropy, writing those values to |out_shared_key| +// and |out_ciphertext|, respectively. +OPENSSL_EXPORT void HRSS_encap(uint8_t out_ciphertext[HRSS_CIPHERTEXT_BYTES], + uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_public_key *in_pub, + const uint8_t in[HRSS_ENCAP_BYTES]); + +// HRSS_decap decrypts a session key from |ciphertext_len| bytes of +// |ciphertext|. If the ciphertext is valid, the decrypted key is written to +// |out_shared_key|. Otherwise the HMAC of |ciphertext| under a secret key (kept +// in |in_priv|) is written. If the ciphertext is the wrong length then it will +// leak which was done via side-channels. Otherwise it should perform either +// action in constant-time. +OPENSSL_EXPORT void HRSS_decap(uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_private_key *in_priv, + const uint8_t *ciphertext, + size_t ciphertext_len); + +// HRSS_marshal_public_key serialises |in_pub| to |out|. +OPENSSL_EXPORT void HRSS_marshal_public_key( + uint8_t out[HRSS_PUBLIC_KEY_BYTES], const struct HRSS_public_key *in_pub); + +// HRSS_parse_public_key sets |*out| to the public-key encoded in |in|. It +// returns true on success and zero on error. +OPENSSL_EXPORT int HRSS_parse_public_key( + struct HRSS_public_key *out, const uint8_t in[HRSS_PUBLIC_KEY_BYTES]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_HRSS_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.back new file mode 100644 index 000000000..5390696f1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.back @@ -0,0 +1,100 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HRSS_H +#define OPENSSL_HEADER_HRSS_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +// HRSS +// +// HRSS is a structured-lattice-based post-quantum key encapsulation mechanism. +// The best exposition is https://eprint.iacr.org/2017/667.pdf although this +// implementation uses a different KEM construction based on +// https://eprint.iacr.org/2017/1005.pdf. + +struct HRSS_private_key { + uint8_t opaque[1808]; +}; + +struct HRSS_public_key { + uint8_t opaque[1424]; +}; + +// HRSS_SAMPLE_BYTES is the number of bytes of entropy needed to generate a +// short vector. There are 701 coefficients, but the final one is always set to +// zero when sampling. Otherwise, we need one byte of input per coefficient. +#define HRSS_SAMPLE_BYTES (701 - 1) +// HRSS_GENERATE_KEY_BYTES is the number of bytes of entropy needed to generate +// an HRSS key pair. +#define HRSS_GENERATE_KEY_BYTES (HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES + 32) +// HRSS_ENCAP_BYTES is the number of bytes of entropy needed to encapsulate a +// session key. +#define HRSS_ENCAP_BYTES (HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES) +// HRSS_PUBLIC_KEY_BYTES is the number of bytes in a public key. +#define HRSS_PUBLIC_KEY_BYTES 1138 +// HRSS_CIPHERTEXT_BYTES is the number of bytes in a ciphertext. +#define HRSS_CIPHERTEXT_BYTES 1138 +// HRSS_KEY_BYTES is the number of bytes in a shared key. +#define HRSS_KEY_BYTES 32 +// HRSS_POLY3_BYTES is the number of bytes needed to serialise a mod 3 +// polynomial. +#define HRSS_POLY3_BYTES 140 +#define HRSS_PRIVATE_KEY_BYTES \ + (HRSS_POLY3_BYTES * 2 + HRSS_PUBLIC_KEY_BYTES + 2 + 32) + +// HRSS_generate_key is a deterministic function that outputs a public and +// private key based on the given entropy. +OPENSSL_EXPORT void HRSS_generate_key( + struct HRSS_public_key *out_pub, struct HRSS_private_key *out_priv, + const uint8_t input[HRSS_GENERATE_KEY_BYTES]); + +// HRSS_encap is a deterministic function the generates and encrypts a random +// session key from the given entropy, writing those values to |out_shared_key| +// and |out_ciphertext|, respectively. +OPENSSL_EXPORT void HRSS_encap(uint8_t out_ciphertext[HRSS_CIPHERTEXT_BYTES], + uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_public_key *in_pub, + const uint8_t in[HRSS_ENCAP_BYTES]); + +// HRSS_decap decrypts a session key from |ciphertext_len| bytes of +// |ciphertext|. If the ciphertext is valid, the decrypted key is written to +// |out_shared_key|. Otherwise the HMAC of |ciphertext| under a secret key (kept +// in |in_priv|) is written. If the ciphertext is the wrong length then it will +// leak which was done via side-channels. Otherwise it should perform either +// action in constant-time. +OPENSSL_EXPORT void HRSS_decap(uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_private_key *in_priv, + const uint8_t *ciphertext, + size_t ciphertext_len); + +// HRSS_marshal_public_key serialises |in_pub| to |out|. +OPENSSL_EXPORT void HRSS_marshal_public_key( + uint8_t out[HRSS_PUBLIC_KEY_BYTES], const struct HRSS_public_key *in_pub); + +// HRSS_parse_public_key sets |*out| to the public-key encoded in |in|. It +// returns true on success and zero on error. +OPENSSL_EXPORT int HRSS_parse_public_key( + struct HRSS_public_key *out, const uint8_t in[HRSS_PUBLIC_KEY_BYTES]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_HRSS_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.grpc_back new file mode 100644 index 000000000..5390696f1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/hrss.h.grpc_back @@ -0,0 +1,100 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_HRSS_H +#define OPENSSL_HEADER_HRSS_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + +// HRSS +// +// HRSS is a structured-lattice-based post-quantum key encapsulation mechanism. +// The best exposition is https://eprint.iacr.org/2017/667.pdf although this +// implementation uses a different KEM construction based on +// https://eprint.iacr.org/2017/1005.pdf. + +struct HRSS_private_key { + uint8_t opaque[1808]; +}; + +struct HRSS_public_key { + uint8_t opaque[1424]; +}; + +// HRSS_SAMPLE_BYTES is the number of bytes of entropy needed to generate a +// short vector. There are 701 coefficients, but the final one is always set to +// zero when sampling. Otherwise, we need one byte of input per coefficient. +#define HRSS_SAMPLE_BYTES (701 - 1) +// HRSS_GENERATE_KEY_BYTES is the number of bytes of entropy needed to generate +// an HRSS key pair. +#define HRSS_GENERATE_KEY_BYTES (HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES + 32) +// HRSS_ENCAP_BYTES is the number of bytes of entropy needed to encapsulate a +// session key. +#define HRSS_ENCAP_BYTES (HRSS_SAMPLE_BYTES + HRSS_SAMPLE_BYTES) +// HRSS_PUBLIC_KEY_BYTES is the number of bytes in a public key. +#define HRSS_PUBLIC_KEY_BYTES 1138 +// HRSS_CIPHERTEXT_BYTES is the number of bytes in a ciphertext. +#define HRSS_CIPHERTEXT_BYTES 1138 +// HRSS_KEY_BYTES is the number of bytes in a shared key. +#define HRSS_KEY_BYTES 32 +// HRSS_POLY3_BYTES is the number of bytes needed to serialise a mod 3 +// polynomial. +#define HRSS_POLY3_BYTES 140 +#define HRSS_PRIVATE_KEY_BYTES \ + (HRSS_POLY3_BYTES * 2 + HRSS_PUBLIC_KEY_BYTES + 2 + 32) + +// HRSS_generate_key is a deterministic function that outputs a public and +// private key based on the given entropy. +OPENSSL_EXPORT void HRSS_generate_key( + struct HRSS_public_key *out_pub, struct HRSS_private_key *out_priv, + const uint8_t input[HRSS_GENERATE_KEY_BYTES]); + +// HRSS_encap is a deterministic function the generates and encrypts a random +// session key from the given entropy, writing those values to |out_shared_key| +// and |out_ciphertext|, respectively. +OPENSSL_EXPORT void HRSS_encap(uint8_t out_ciphertext[HRSS_CIPHERTEXT_BYTES], + uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_public_key *in_pub, + const uint8_t in[HRSS_ENCAP_BYTES]); + +// HRSS_decap decrypts a session key from |ciphertext_len| bytes of +// |ciphertext|. If the ciphertext is valid, the decrypted key is written to +// |out_shared_key|. Otherwise the HMAC of |ciphertext| under a secret key (kept +// in |in_priv|) is written. If the ciphertext is the wrong length then it will +// leak which was done via side-channels. Otherwise it should perform either +// action in constant-time. +OPENSSL_EXPORT void HRSS_decap(uint8_t out_shared_key[HRSS_KEY_BYTES], + const struct HRSS_private_key *in_priv, + const uint8_t *ciphertext, + size_t ciphertext_len); + +// HRSS_marshal_public_key serialises |in_pub| to |out|. +OPENSSL_EXPORT void HRSS_marshal_public_key( + uint8_t out[HRSS_PUBLIC_KEY_BYTES], const struct HRSS_public_key *in_pub); + +// HRSS_parse_public_key sets |*out| to the public-key encoded in |in|. It +// returns true on success and zero on error. +OPENSSL_EXPORT int HRSS_parse_public_key( + struct HRSS_public_key *out, const uint8_t in[HRSS_PUBLIC_KEY_BYTES]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_HRSS_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/is_boringssl.h b/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/is_boringssl.h rename to Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/is_boringssl.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/is_boringssl.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.grpc_back new file mode 100644 index 000000000..302cbe292 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/is_boringssl.h.grpc_back @@ -0,0 +1,16 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +// This header is provided in order to catch include path errors in consuming +// BoringSSL. diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h b/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h new file mode 100644 index 000000000..c0cb074d4 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h @@ -0,0 +1,282 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_LHASH_H +#define OPENSSL_HEADER_LHASH_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// lhash is a traditional, chaining hash table that automatically expands and +// contracts as needed. One should not use the lh_* functions directly, rather +// use the type-safe macro wrappers: +// +// A hash table of a specific type of object has type |LHASH_OF(type)|. This +// can be defined (once) with |DEFINE_LHASH_OF(type)| and declared where needed +// with |DECLARE_LHASH_OF(type)|. For example: +// +// struct foo { +// int bar; +// }; +// +// DEFINE_LHASH_OF(struct foo) +// +// Although note that the hash table will contain /pointers/ to |foo|. +// +// A macro will be defined for each of the lh_* functions below. For +// LHASH_OF(foo), the macros would be lh_foo_new, lh_foo_num_items etc. + + +#define LHASH_OF(type) struct lhash_st_##type + +#define DECLARE_LHASH_OF(type) LHASH_OF(type); + + +// lhash_item_st is an element of a hash chain. It points to the opaque data +// for this element and to the next item in the chain. The linked-list is NULL +// terminated. +typedef struct lhash_item_st { + void *data; + struct lhash_item_st *next; + // hash contains the cached, hash value of |data|. + uint32_t hash; +} LHASH_ITEM; + +// lhash_cmp_func is a comparison function that returns a value equal, or not +// equal, to zero depending on whether |*a| is equal, or not equal to |*b|, +// respectively. Note the difference between this and |stack_cmp_func| in that +// this takes pointers to the objects directly. +// +// This function's actual type signature is int (*)(const T*, const T*). The +// low-level |lh_*| functions will be passed a type-specific wrapper to call it +// correctly. +typedef int (*lhash_cmp_func)(const void *a, const void *b); +typedef int (*lhash_cmp_func_helper)(lhash_cmp_func func, const void *a, + const void *b); + +// lhash_hash_func is a function that maps an object to a uniformly distributed +// uint32_t. +// +// This function's actual type signature is uint32_t (*)(const T*). The +// low-level |lh_*| functions will be passed a type-specific wrapper to call it +// correctly. +typedef uint32_t (*lhash_hash_func)(const void *a); +typedef uint32_t (*lhash_hash_func_helper)(lhash_hash_func func, const void *a); + +typedef struct lhash_st _LHASH; + +// lh_new returns a new, empty hash table or NULL on error. +OPENSSL_EXPORT _LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp); + +// lh_free frees the hash table itself but none of the elements. See +// |lh_doall|. +OPENSSL_EXPORT void lh_free(_LHASH *lh); + +// lh_num_items returns the number of items in |lh|. +OPENSSL_EXPORT size_t lh_num_items(const _LHASH *lh); + +// lh_retrieve finds an element equal to |data| in the hash table and returns +// it. If no such element exists, it returns NULL. +OPENSSL_EXPORT void *lh_retrieve(const _LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_retrieve_key finds an element matching |key|, given the specified hash and +// comparison function. This differs from |lh_retrieve| in that the key may be a +// different type than the values stored in |lh|. |key_hash| and |cmp_key| must +// be compatible with the functions passed into |lh_new|. +OPENSSL_EXPORT void *lh_retrieve_key(const _LHASH *lh, const void *key, + uint32_t key_hash, + int (*cmp_key)(const void *key, + const void *value)); + +// lh_insert inserts |data| into the hash table. If an existing element is +// equal to |data| (with respect to the comparison function) then |*old_data| +// will be set to that value and it will be replaced. Otherwise, or in the +// event of an error, |*old_data| will be set to NULL. It returns one on +// success or zero in the case of an allocation error. +OPENSSL_EXPORT int lh_insert(_LHASH *lh, void **old_data, void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_delete removes an element equal to |data| from the hash table and returns +// it. If no such element is found, it returns NULL. +OPENSSL_EXPORT void *lh_delete(_LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_doall_arg calls |func| on each element of the hash table and also passes +// |arg| as the second argument. +// TODO(fork): rename this +OPENSSL_EXPORT void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), + void *arg); + +// lh_strhash is the default hash function which processes NUL-terminated +// strings. +OPENSSL_EXPORT uint32_t lh_strhash(const char *c); + +#define DEFINE_LHASH_OF(type) \ + DECLARE_LHASH_OF(type) \ + \ + typedef int (*lhash_##type##_cmp_func)(const type *, const type *); \ + typedef uint32_t (*lhash_##type##_hash_func)(const type *); \ + \ + OPENSSL_INLINE int lh_##type##_call_cmp_func(lhash_cmp_func func, \ + const void *a, const void *b) { \ + return ((lhash_##type##_cmp_func)func)((const type *)a, (const type *)b); \ + } \ + \ + OPENSSL_INLINE uint32_t lh_##type##_call_hash_func(lhash_hash_func func, \ + const void *a) { \ + return ((lhash_##type##_hash_func)func)((const type *)a); \ + } \ + \ + OPENSSL_INLINE LHASH_OF(type) * \ + lh_##type##_new(lhash_##type##_hash_func hash, \ + lhash_##type##_cmp_func comp) { \ + return (LHASH_OF(type) *)lh_new((lhash_hash_func)hash, \ + (lhash_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_free(LHASH_OF(type) *lh) { \ + lh_free((_LHASH *)lh); \ + } \ + \ + OPENSSL_INLINE size_t lh_##type##_num_items(const LHASH_OF(type) *lh) { \ + return lh_num_items((const _LHASH *)lh); \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_retrieve(const LHASH_OF(type) *lh, \ + const type *data) { \ + return (type *)lh_retrieve((const _LHASH *)lh, data, \ + lh_##type##_call_hash_func, \ + lh_##type##_call_cmp_func); \ + } \ + \ + typedef struct { \ + int (*cmp_key)(const void *key, const type *value); \ + const void *key; \ + } LHASH_CMP_KEY_##type; \ + \ + OPENSSL_INLINE int lh_##type##_call_cmp_key(const void *key, \ + const void *value) { \ + const LHASH_CMP_KEY_##type *cb = (const LHASH_CMP_KEY_##type *)key; \ + return cb->cmp_key(cb->key, (const type *)value); \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_retrieve_key( \ + const LHASH_OF(type) *lh, const void *key, uint32_t key_hash, \ + int (*cmp_key)(const void *key, const type *value)) { \ + LHASH_CMP_KEY_##type cb = {cmp_key, key}; \ + return (type *)lh_retrieve_key((const _LHASH *)lh, &cb, key_hash, \ + lh_##type##_call_cmp_key); \ + } \ + \ + OPENSSL_INLINE int lh_##type##_insert(LHASH_OF(type) *lh, type **old_data, \ + type *data) { \ + void *old_data_void = NULL; \ + int ret = \ + lh_insert((_LHASH *)lh, &old_data_void, data, \ + lh_##type##_call_hash_func, lh_##type##_call_cmp_func); \ + *old_data = (type *)old_data_void; \ + return ret; \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_delete(LHASH_OF(type) *lh, \ + const type *data) { \ + return (type *)lh_delete((_LHASH *)lh, data, lh_##type##_call_hash_func, \ + lh_##type##_call_cmp_func); \ + } \ + \ + typedef struct { \ + void (*doall)(type *); \ + void (*doall_arg)(type *, void *); \ + void *arg; \ + } LHASH_DOALL_##type; \ + \ + OPENSSL_INLINE void lh_##type##_call_doall(void *value, void *arg) { \ + const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg; \ + cb->doall((type *)value); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_call_doall_arg(void *value, void *arg) { \ + const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg; \ + cb->doall_arg((type *)value, cb->arg); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_doall(LHASH_OF(type) *lh, \ + void (*func)(type *)) { \ + LHASH_DOALL_##type cb = {func, NULL, NULL}; \ + lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall, &cb); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_doall_arg( \ + LHASH_OF(type) *lh, void (*func)(type *, void *), void *arg) { \ + LHASH_DOALL_##type cb = {NULL, func, arg}; \ + lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall_arg, &cb); \ + } + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_LHASH_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.back new file mode 100644 index 000000000..29e09c839 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.back @@ -0,0 +1,282 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_LHASH_H +#define OPENSSL_HEADER_LHASH_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// lhash is a traditional, chaining hash table that automatically expands and +// contracts as needed. One should not use the lh_* functions directly, rather +// use the type-safe macro wrappers: +// +// A hash table of a specific type of object has type |LHASH_OF(type)|. This +// can be defined (once) with |DEFINE_LHASH_OF(type)| and declared where needed +// with |DECLARE_LHASH_OF(type)|. For example: +// +// struct foo { +// int bar; +// }; +// +// DEFINE_LHASH_OF(struct foo) +// +// Although note that the hash table will contain /pointers/ to |foo|. +// +// A macro will be defined for each of the lh_* functions below. For +// LHASH_OF(foo), the macros would be lh_foo_new, lh_foo_num_items etc. + + +#define LHASH_OF(type) struct lhash_st_##type + +#define DECLARE_LHASH_OF(type) LHASH_OF(type); + + +// lhash_item_st is an element of a hash chain. It points to the opaque data +// for this element and to the next item in the chain. The linked-list is NULL +// terminated. +typedef struct lhash_item_st { + void *data; + struct lhash_item_st *next; + // hash contains the cached, hash value of |data|. + uint32_t hash; +} LHASH_ITEM; + +// lhash_cmp_func is a comparison function that returns a value equal, or not +// equal, to zero depending on whether |*a| is equal, or not equal to |*b|, +// respectively. Note the difference between this and |stack_cmp_func| in that +// this takes pointers to the objects directly. +// +// This function's actual type signature is int (*)(const T*, const T*). The +// low-level |lh_*| functions will be passed a type-specific wrapper to call it +// correctly. +typedef int (*lhash_cmp_func)(const void *a, const void *b); +typedef int (*lhash_cmp_func_helper)(lhash_cmp_func func, const void *a, + const void *b); + +// lhash_hash_func is a function that maps an object to a uniformly distributed +// uint32_t. +// +// This function's actual type signature is uint32_t (*)(const T*). The +// low-level |lh_*| functions will be passed a type-specific wrapper to call it +// correctly. +typedef uint32_t (*lhash_hash_func)(const void *a); +typedef uint32_t (*lhash_hash_func_helper)(lhash_hash_func func, const void *a); + +typedef struct lhash_st _LHASH; + +// lh_new returns a new, empty hash table or NULL on error. +OPENSSL_EXPORT _LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp); + +// lh_free frees the hash table itself but none of the elements. See +// |lh_doall|. +OPENSSL_EXPORT void lh_free(_LHASH *lh); + +// lh_num_items returns the number of items in |lh|. +OPENSSL_EXPORT size_t lh_num_items(const _LHASH *lh); + +// lh_retrieve finds an element equal to |data| in the hash table and returns +// it. If no such element exists, it returns NULL. +OPENSSL_EXPORT void *lh_retrieve(const _LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_retrieve_key finds an element matching |key|, given the specified hash and +// comparison function. This differs from |lh_retrieve| in that the key may be a +// different type than the values stored in |lh|. |key_hash| and |cmp_key| must +// be compatible with the functions passed into |lh_new|. +OPENSSL_EXPORT void *lh_retrieve_key(const _LHASH *lh, const void *key, + uint32_t key_hash, + int (*cmp_key)(const void *key, + const void *value)); + +// lh_insert inserts |data| into the hash table. If an existing element is +// equal to |data| (with respect to the comparison function) then |*old_data| +// will be set to that value and it will be replaced. Otherwise, or in the +// event of an error, |*old_data| will be set to NULL. It returns one on +// success or zero in the case of an allocation error. +OPENSSL_EXPORT int lh_insert(_LHASH *lh, void **old_data, void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_delete removes an element equal to |data| from the hash table and returns +// it. If no such element is found, it returns NULL. +OPENSSL_EXPORT void *lh_delete(_LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_doall_arg calls |func| on each element of the hash table and also passes +// |arg| as the second argument. +// TODO(fork): rename this +OPENSSL_EXPORT void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), + void *arg); + +// lh_strhash is the default hash function which processes NUL-terminated +// strings. +OPENSSL_EXPORT uint32_t lh_strhash(const char *c); + +#define DEFINE_LHASH_OF(type) \ + DECLARE_LHASH_OF(type) \ + \ + typedef int (*lhash_##type##_cmp_func)(const type *, const type *); \ + typedef uint32_t (*lhash_##type##_hash_func)(const type *); \ + \ + OPENSSL_INLINE int lh_##type##_call_cmp_func(lhash_cmp_func func, \ + const void *a, const void *b) { \ + return ((lhash_##type##_cmp_func)func)((const type *)a, (const type *)b); \ + } \ + \ + OPENSSL_INLINE uint32_t lh_##type##_call_hash_func(lhash_hash_func func, \ + const void *a) { \ + return ((lhash_##type##_hash_func)func)((const type *)a); \ + } \ + \ + OPENSSL_INLINE LHASH_OF(type) * \ + lh_##type##_new(lhash_##type##_hash_func hash, \ + lhash_##type##_cmp_func comp) { \ + return (LHASH_OF(type) *)lh_new((lhash_hash_func)hash, \ + (lhash_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_free(LHASH_OF(type) *lh) { \ + lh_free((_LHASH *)lh); \ + } \ + \ + OPENSSL_INLINE size_t lh_##type##_num_items(const LHASH_OF(type) *lh) { \ + return lh_num_items((const _LHASH *)lh); \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_retrieve(const LHASH_OF(type) *lh, \ + const type *data) { \ + return (type *)lh_retrieve((const _LHASH *)lh, data, \ + lh_##type##_call_hash_func, \ + lh_##type##_call_cmp_func); \ + } \ + \ + typedef struct { \ + int (*cmp_key)(const void *key, const type *value); \ + const void *key; \ + } LHASH_CMP_KEY_##type; \ + \ + OPENSSL_INLINE int lh_##type##_call_cmp_key(const void *key, \ + const void *value) { \ + const LHASH_CMP_KEY_##type *cb = (const LHASH_CMP_KEY_##type *)key; \ + return cb->cmp_key(cb->key, (const type *)value); \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_retrieve_key( \ + const LHASH_OF(type) *lh, const void *key, uint32_t key_hash, \ + int (*cmp_key)(const void *key, const type *value)) { \ + LHASH_CMP_KEY_##type cb = {cmp_key, key}; \ + return (type *)lh_retrieve_key((const _LHASH *)lh, &cb, key_hash, \ + lh_##type##_call_cmp_key); \ + } \ + \ + OPENSSL_INLINE int lh_##type##_insert(LHASH_OF(type) *lh, type **old_data, \ + type *data) { \ + void *old_data_void = NULL; \ + int ret = \ + lh_insert((_LHASH *)lh, &old_data_void, data, \ + lh_##type##_call_hash_func, lh_##type##_call_cmp_func); \ + *old_data = (type *)old_data_void; \ + return ret; \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_delete(LHASH_OF(type) *lh, \ + const type *data) { \ + return (type *)lh_delete((_LHASH *)lh, data, lh_##type##_call_hash_func, \ + lh_##type##_call_cmp_func); \ + } \ + \ + typedef struct { \ + void (*doall)(type *); \ + void (*doall_arg)(type *, void *); \ + void *arg; \ + } LHASH_DOALL_##type; \ + \ + OPENSSL_INLINE void lh_##type##_call_doall(void *value, void *arg) { \ + const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg; \ + cb->doall((type *)value); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_call_doall_arg(void *value, void *arg) { \ + const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg; \ + cb->doall_arg((type *)value, cb->arg); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_doall(LHASH_OF(type) *lh, \ + void (*func)(type *)) { \ + LHASH_DOALL_##type cb = {func, NULL, NULL}; \ + lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall, &cb); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_doall_arg( \ + LHASH_OF(type) *lh, void (*func)(type *, void *), void *arg) { \ + LHASH_DOALL_##type cb = {NULL, func, arg}; \ + lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall_arg, &cb); \ + } + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_LHASH_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.grpc_back new file mode 100644 index 000000000..29e09c839 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/lhash.h.grpc_back @@ -0,0 +1,282 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_LHASH_H +#define OPENSSL_HEADER_LHASH_H + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// lhash is a traditional, chaining hash table that automatically expands and +// contracts as needed. One should not use the lh_* functions directly, rather +// use the type-safe macro wrappers: +// +// A hash table of a specific type of object has type |LHASH_OF(type)|. This +// can be defined (once) with |DEFINE_LHASH_OF(type)| and declared where needed +// with |DECLARE_LHASH_OF(type)|. For example: +// +// struct foo { +// int bar; +// }; +// +// DEFINE_LHASH_OF(struct foo) +// +// Although note that the hash table will contain /pointers/ to |foo|. +// +// A macro will be defined for each of the lh_* functions below. For +// LHASH_OF(foo), the macros would be lh_foo_new, lh_foo_num_items etc. + + +#define LHASH_OF(type) struct lhash_st_##type + +#define DECLARE_LHASH_OF(type) LHASH_OF(type); + + +// lhash_item_st is an element of a hash chain. It points to the opaque data +// for this element and to the next item in the chain. The linked-list is NULL +// terminated. +typedef struct lhash_item_st { + void *data; + struct lhash_item_st *next; + // hash contains the cached, hash value of |data|. + uint32_t hash; +} LHASH_ITEM; + +// lhash_cmp_func is a comparison function that returns a value equal, or not +// equal, to zero depending on whether |*a| is equal, or not equal to |*b|, +// respectively. Note the difference between this and |stack_cmp_func| in that +// this takes pointers to the objects directly. +// +// This function's actual type signature is int (*)(const T*, const T*). The +// low-level |lh_*| functions will be passed a type-specific wrapper to call it +// correctly. +typedef int (*lhash_cmp_func)(const void *a, const void *b); +typedef int (*lhash_cmp_func_helper)(lhash_cmp_func func, const void *a, + const void *b); + +// lhash_hash_func is a function that maps an object to a uniformly distributed +// uint32_t. +// +// This function's actual type signature is uint32_t (*)(const T*). The +// low-level |lh_*| functions will be passed a type-specific wrapper to call it +// correctly. +typedef uint32_t (*lhash_hash_func)(const void *a); +typedef uint32_t (*lhash_hash_func_helper)(lhash_hash_func func, const void *a); + +typedef struct lhash_st _LHASH; + +// lh_new returns a new, empty hash table or NULL on error. +OPENSSL_EXPORT _LHASH *lh_new(lhash_hash_func hash, lhash_cmp_func comp); + +// lh_free frees the hash table itself but none of the elements. See +// |lh_doall|. +OPENSSL_EXPORT void lh_free(_LHASH *lh); + +// lh_num_items returns the number of items in |lh|. +OPENSSL_EXPORT size_t lh_num_items(const _LHASH *lh); + +// lh_retrieve finds an element equal to |data| in the hash table and returns +// it. If no such element exists, it returns NULL. +OPENSSL_EXPORT void *lh_retrieve(const _LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_retrieve_key finds an element matching |key|, given the specified hash and +// comparison function. This differs from |lh_retrieve| in that the key may be a +// different type than the values stored in |lh|. |key_hash| and |cmp_key| must +// be compatible with the functions passed into |lh_new|. +OPENSSL_EXPORT void *lh_retrieve_key(const _LHASH *lh, const void *key, + uint32_t key_hash, + int (*cmp_key)(const void *key, + const void *value)); + +// lh_insert inserts |data| into the hash table. If an existing element is +// equal to |data| (with respect to the comparison function) then |*old_data| +// will be set to that value and it will be replaced. Otherwise, or in the +// event of an error, |*old_data| will be set to NULL. It returns one on +// success or zero in the case of an allocation error. +OPENSSL_EXPORT int lh_insert(_LHASH *lh, void **old_data, void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_delete removes an element equal to |data| from the hash table and returns +// it. If no such element is found, it returns NULL. +OPENSSL_EXPORT void *lh_delete(_LHASH *lh, const void *data, + lhash_hash_func_helper call_hash_func, + lhash_cmp_func_helper call_cmp_func); + +// lh_doall_arg calls |func| on each element of the hash table and also passes +// |arg| as the second argument. +// TODO(fork): rename this +OPENSSL_EXPORT void lh_doall_arg(_LHASH *lh, void (*func)(void *, void *), + void *arg); + +// lh_strhash is the default hash function which processes NUL-terminated +// strings. +OPENSSL_EXPORT uint32_t lh_strhash(const char *c); + +#define DEFINE_LHASH_OF(type) \ + DECLARE_LHASH_OF(type) \ + \ + typedef int (*lhash_##type##_cmp_func)(const type *, const type *); \ + typedef uint32_t (*lhash_##type##_hash_func)(const type *); \ + \ + OPENSSL_INLINE int lh_##type##_call_cmp_func(lhash_cmp_func func, \ + const void *a, const void *b) { \ + return ((lhash_##type##_cmp_func)func)((const type *)a, (const type *)b); \ + } \ + \ + OPENSSL_INLINE uint32_t lh_##type##_call_hash_func(lhash_hash_func func, \ + const void *a) { \ + return ((lhash_##type##_hash_func)func)((const type *)a); \ + } \ + \ + OPENSSL_INLINE LHASH_OF(type) * \ + lh_##type##_new(lhash_##type##_hash_func hash, \ + lhash_##type##_cmp_func comp) { \ + return (LHASH_OF(type) *)lh_new((lhash_hash_func)hash, \ + (lhash_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_free(LHASH_OF(type) *lh) { \ + lh_free((_LHASH *)lh); \ + } \ + \ + OPENSSL_INLINE size_t lh_##type##_num_items(const LHASH_OF(type) *lh) { \ + return lh_num_items((const _LHASH *)lh); \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_retrieve(const LHASH_OF(type) *lh, \ + const type *data) { \ + return (type *)lh_retrieve((const _LHASH *)lh, data, \ + lh_##type##_call_hash_func, \ + lh_##type##_call_cmp_func); \ + } \ + \ + typedef struct { \ + int (*cmp_key)(const void *key, const type *value); \ + const void *key; \ + } LHASH_CMP_KEY_##type; \ + \ + OPENSSL_INLINE int lh_##type##_call_cmp_key(const void *key, \ + const void *value) { \ + const LHASH_CMP_KEY_##type *cb = (const LHASH_CMP_KEY_##type *)key; \ + return cb->cmp_key(cb->key, (const type *)value); \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_retrieve_key( \ + const LHASH_OF(type) *lh, const void *key, uint32_t key_hash, \ + int (*cmp_key)(const void *key, const type *value)) { \ + LHASH_CMP_KEY_##type cb = {cmp_key, key}; \ + return (type *)lh_retrieve_key((const _LHASH *)lh, &cb, key_hash, \ + lh_##type##_call_cmp_key); \ + } \ + \ + OPENSSL_INLINE int lh_##type##_insert(LHASH_OF(type) *lh, type **old_data, \ + type *data) { \ + void *old_data_void = NULL; \ + int ret = \ + lh_insert((_LHASH *)lh, &old_data_void, data, \ + lh_##type##_call_hash_func, lh_##type##_call_cmp_func); \ + *old_data = (type *)old_data_void; \ + return ret; \ + } \ + \ + OPENSSL_INLINE type *lh_##type##_delete(LHASH_OF(type) *lh, \ + const type *data) { \ + return (type *)lh_delete((_LHASH *)lh, data, lh_##type##_call_hash_func, \ + lh_##type##_call_cmp_func); \ + } \ + \ + typedef struct { \ + void (*doall)(type *); \ + void (*doall_arg)(type *, void *); \ + void *arg; \ + } LHASH_DOALL_##type; \ + \ + OPENSSL_INLINE void lh_##type##_call_doall(void *value, void *arg) { \ + const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg; \ + cb->doall((type *)value); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_call_doall_arg(void *value, void *arg) { \ + const LHASH_DOALL_##type *cb = (const LHASH_DOALL_##type *)arg; \ + cb->doall_arg((type *)value, cb->arg); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_doall(LHASH_OF(type) *lh, \ + void (*func)(type *)) { \ + LHASH_DOALL_##type cb = {func, NULL, NULL}; \ + lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall, &cb); \ + } \ + \ + OPENSSL_INLINE void lh_##type##_doall_arg( \ + LHASH_OF(type) *lh, void (*func)(type *, void *), void *arg) { \ + LHASH_DOALL_##type cb = {NULL, func, arg}; \ + lh_doall_arg((_LHASH *)lh, lh_##type##_call_doall_arg, &cb); \ + } + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_LHASH_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/md4.h b/Pods/BoringSSL-GRPC/src/include/openssl/md4.h similarity index 91% rename from Pods/BoringSSL-GRPC/include/openssl/md4.h rename to Pods/BoringSSL-GRPC/src/include/openssl/md4.h index 151f4e437..f4e451287 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/md4.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/md4.h @@ -79,17 +79,19 @@ OPENSSL_EXPORT int MD4_Init(MD4_CTX *md4); OPENSSL_EXPORT int MD4_Update(MD4_CTX *md4, const void *data, size_t len); // MD4_Final adds the final padding to |md4| and writes the resulting digest to -// |md|, which must have at least |MD4_DIGEST_LENGTH| bytes of space. It +// |out|, which must have at least |MD4_DIGEST_LENGTH| bytes of space. It // returns one. -OPENSSL_EXPORT int MD4_Final(uint8_t *md, MD4_CTX *md4); +OPENSSL_EXPORT int MD4_Final(uint8_t out[MD4_DIGEST_LENGTH], MD4_CTX *md4); // MD4 writes the digest of |len| bytes from |data| to |out| and returns |out|. // There must be at least |MD4_DIGEST_LENGTH| bytes of space in |out|. -OPENSSL_EXPORT uint8_t *MD4(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *MD4(const uint8_t *data, size_t len, + uint8_t out[MD4_DIGEST_LENGTH]); // MD4_Transform is a low-level function that performs a single, MD4 block // transformation using the state from |md4| and 64 bytes from |block|. -OPENSSL_EXPORT void MD4_Transform(MD4_CTX *md4, const uint8_t *block); +OPENSSL_EXPORT void MD4_Transform(MD4_CTX *md4, + const uint8_t block[MD4_CBLOCK]); struct md4_state_st { uint32_t h[4]; diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.back new file mode 100644 index 000000000..b213bc627 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.back @@ -0,0 +1,108 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_MD4_H +#define OPENSSL_HEADER_MD4_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// MD4. + +// MD4_CBLOCK is the block size of MD4. +#define MD4_CBLOCK 64 + +// MD4_DIGEST_LENGTH is the length of an MD4 digest. +#define MD4_DIGEST_LENGTH 16 + +// MD4_Init initialises |md4| and returns one. +OPENSSL_EXPORT int MD4_Init(MD4_CTX *md4); + +// MD4_Update adds |len| bytes from |data| to |md4| and returns one. +OPENSSL_EXPORT int MD4_Update(MD4_CTX *md4, const void *data, size_t len); + +// MD4_Final adds the final padding to |md4| and writes the resulting digest to +// |out|, which must have at least |MD4_DIGEST_LENGTH| bytes of space. It +// returns one. +OPENSSL_EXPORT int MD4_Final(uint8_t out[MD4_DIGEST_LENGTH], MD4_CTX *md4); + +// MD4 writes the digest of |len| bytes from |data| to |out| and returns |out|. +// There must be at least |MD4_DIGEST_LENGTH| bytes of space in |out|. +OPENSSL_EXPORT uint8_t *MD4(const uint8_t *data, size_t len, + uint8_t out[MD4_DIGEST_LENGTH]); + +// MD4_Transform is a low-level function that performs a single, MD4 block +// transformation using the state from |md4| and 64 bytes from |block|. +OPENSSL_EXPORT void MD4_Transform(MD4_CTX *md4, + const uint8_t block[MD4_CBLOCK]); + +struct md4_state_st { + uint32_t h[4]; + uint32_t Nl, Nh; + uint8_t data[MD4_CBLOCK]; + unsigned num; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_MD4_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/md4.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/include/openssl/md4.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/md4.h.grpc_back index 52b88ca31..b213bc627 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/md4.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/md4.h.grpc_back @@ -79,17 +79,19 @@ OPENSSL_EXPORT int MD4_Init(MD4_CTX *md4); OPENSSL_EXPORT int MD4_Update(MD4_CTX *md4, const void *data, size_t len); // MD4_Final adds the final padding to |md4| and writes the resulting digest to -// |md|, which must have at least |MD4_DIGEST_LENGTH| bytes of space. It +// |out|, which must have at least |MD4_DIGEST_LENGTH| bytes of space. It // returns one. -OPENSSL_EXPORT int MD4_Final(uint8_t *md, MD4_CTX *md4); +OPENSSL_EXPORT int MD4_Final(uint8_t out[MD4_DIGEST_LENGTH], MD4_CTX *md4); // MD4 writes the digest of |len| bytes from |data| to |out| and returns |out|. // There must be at least |MD4_DIGEST_LENGTH| bytes of space in |out|. -OPENSSL_EXPORT uint8_t *MD4(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *MD4(const uint8_t *data, size_t len, + uint8_t out[MD4_DIGEST_LENGTH]); // MD4_Transform is a low-level function that performs a single, MD4 block // transformation using the state from |md4| and 64 bytes from |block|. -OPENSSL_EXPORT void MD4_Transform(MD4_CTX *md4, const uint8_t *block); +OPENSSL_EXPORT void MD4_Transform(MD4_CTX *md4, + const uint8_t block[MD4_CBLOCK]); struct md4_state_st { uint32_t h[4]; diff --git a/Pods/BoringSSL-GRPC/include/openssl/md5.h b/Pods/BoringSSL-GRPC/src/include/openssl/md5.h similarity index 91% rename from Pods/BoringSSL-GRPC/include/openssl/md5.h rename to Pods/BoringSSL-GRPC/src/include/openssl/md5.h index f4f33eed8..5c7705de1 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/md5.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/md5.h @@ -80,17 +80,19 @@ OPENSSL_EXPORT int MD5_Init(MD5_CTX *md5); OPENSSL_EXPORT int MD5_Update(MD5_CTX *md5, const void *data, size_t len); // MD5_Final adds the final padding to |md5| and writes the resulting digest to -// |md|, which must have at least |MD5_DIGEST_LENGTH| bytes of space. It +// |out|, which must have at least |MD5_DIGEST_LENGTH| bytes of space. It // returns one. -OPENSSL_EXPORT int MD5_Final(uint8_t *md, MD5_CTX *md5); +OPENSSL_EXPORT int MD5_Final(uint8_t out[MD5_DIGEST_LENGTH], MD5_CTX *md5); // MD5 writes the digest of |len| bytes from |data| to |out| and returns |out|. // There must be at least |MD5_DIGEST_LENGTH| bytes of space in |out|. -OPENSSL_EXPORT uint8_t *MD5(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *MD5(const uint8_t *data, size_t len, + uint8_t out[MD5_DIGEST_LENGTH]); // MD5_Transform is a low-level function that performs a single, MD5 block // transformation using the state from |md5| and 64 bytes from |block|. -OPENSSL_EXPORT void MD5_Transform(MD5_CTX *md5, const uint8_t *block); +OPENSSL_EXPORT void MD5_Transform(MD5_CTX *md5, + const uint8_t block[MD5_CBLOCK]); struct md5_state_st { uint32_t h[4]; diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.back new file mode 100644 index 000000000..548651298 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.back @@ -0,0 +1,109 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_MD5_H +#define OPENSSL_HEADER_MD5_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// MD5. + + +// MD5_CBLOCK is the block size of MD5. +#define MD5_CBLOCK 64 + +// MD5_DIGEST_LENGTH is the length of an MD5 digest. +#define MD5_DIGEST_LENGTH 16 + +// MD5_Init initialises |md5| and returns one. +OPENSSL_EXPORT int MD5_Init(MD5_CTX *md5); + +// MD5_Update adds |len| bytes from |data| to |md5| and returns one. +OPENSSL_EXPORT int MD5_Update(MD5_CTX *md5, const void *data, size_t len); + +// MD5_Final adds the final padding to |md5| and writes the resulting digest to +// |out|, which must have at least |MD5_DIGEST_LENGTH| bytes of space. It +// returns one. +OPENSSL_EXPORT int MD5_Final(uint8_t out[MD5_DIGEST_LENGTH], MD5_CTX *md5); + +// MD5 writes the digest of |len| bytes from |data| to |out| and returns |out|. +// There must be at least |MD5_DIGEST_LENGTH| bytes of space in |out|. +OPENSSL_EXPORT uint8_t *MD5(const uint8_t *data, size_t len, + uint8_t out[MD5_DIGEST_LENGTH]); + +// MD5_Transform is a low-level function that performs a single, MD5 block +// transformation using the state from |md5| and 64 bytes from |block|. +OPENSSL_EXPORT void MD5_Transform(MD5_CTX *md5, + const uint8_t block[MD5_CBLOCK]); + +struct md5_state_st { + uint32_t h[4]; + uint32_t Nl, Nh; + uint8_t data[MD5_CBLOCK]; + unsigned num; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_MD5_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/md5.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/include/openssl/md5.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/md5.h.grpc_back index de6027f5c..548651298 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/md5.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/md5.h.grpc_back @@ -80,17 +80,19 @@ OPENSSL_EXPORT int MD5_Init(MD5_CTX *md5); OPENSSL_EXPORT int MD5_Update(MD5_CTX *md5, const void *data, size_t len); // MD5_Final adds the final padding to |md5| and writes the resulting digest to -// |md|, which must have at least |MD5_DIGEST_LENGTH| bytes of space. It +// |out|, which must have at least |MD5_DIGEST_LENGTH| bytes of space. It // returns one. -OPENSSL_EXPORT int MD5_Final(uint8_t *md, MD5_CTX *md5); +OPENSSL_EXPORT int MD5_Final(uint8_t out[MD5_DIGEST_LENGTH], MD5_CTX *md5); // MD5 writes the digest of |len| bytes from |data| to |out| and returns |out|. // There must be at least |MD5_DIGEST_LENGTH| bytes of space in |out|. -OPENSSL_EXPORT uint8_t *MD5(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *MD5(const uint8_t *data, size_t len, + uint8_t out[MD5_DIGEST_LENGTH]); // MD5_Transform is a low-level function that performs a single, MD5 block // transformation using the state from |md5| and 64 bytes from |block|. -OPENSSL_EXPORT void MD5_Transform(MD5_CTX *md5, const uint8_t *block); +OPENSSL_EXPORT void MD5_Transform(MD5_CTX *md5, + const uint8_t block[MD5_CBLOCK]); struct md5_state_st { uint32_t h[4]; diff --git a/Pods/BoringSSL-GRPC/include/openssl/mem.h b/Pods/BoringSSL-GRPC/src/include/openssl/mem.h similarity index 85% rename from Pods/BoringSSL-GRPC/include/openssl/mem.h rename to Pods/BoringSSL-GRPC/src/include/openssl/mem.h index 7b81e56c6..413869538 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/mem.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/mem.h @@ -126,8 +126,23 @@ OPENSSL_EXPORT int BIO_snprintf(char *buf, size_t n, const char *format, ...) // BIO_vsnprintf has the same behavior as vsnprintf(3). OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format, - va_list args) - OPENSSL_PRINTF_FORMAT_FUNC(3, 0); + va_list args) OPENSSL_PRINTF_FORMAT_FUNC(3, 0); + +// OPENSSL_strndup returns an allocated, duplicate of |str|, which is, at most, +// |size| bytes. The result is always NUL terminated. +OPENSSL_EXPORT char *OPENSSL_strndup(const char *str, size_t size); + +// OPENSSL_memdup returns an allocated, duplicate of |size| bytes from |data| or +// NULL on allocation failure. +OPENSSL_EXPORT void *OPENSSL_memdup(const void *data, size_t size); + +// OPENSSL_strlcpy acts like strlcpy(3). +OPENSSL_EXPORT size_t OPENSSL_strlcpy(char *dst, const char *src, + size_t dst_size); + +// OPENSSL_strlcat acts like strlcat(3). +OPENSSL_EXPORT size_t OPENSSL_strlcat(char *dst, const char *src, + size_t dst_size); // Deprecated functions. @@ -136,18 +151,22 @@ OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format, #define CRYPTO_realloc OPENSSL_realloc #define CRYPTO_free OPENSSL_free +// OPENSSL_clear_free calls |OPENSSL_free|. BoringSSL automatically clears all +// allocations on free, but we define |OPENSSL_clear_free| for compatibility. +OPENSSL_EXPORT void OPENSSL_clear_free(void *ptr, size_t len); + #if defined(__cplusplus) } // extern C extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(char, OPENSSL_free) BORINGSSL_MAKE_DELETER(uint8_t, OPENSSL_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.back new file mode 100644 index 000000000..cceabcdc8 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.back @@ -0,0 +1,175 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_MEM_H +#define OPENSSL_HEADER_MEM_H + +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Memory and string functions, see also buf.h. +// +// BoringSSL has its own set of allocation functions, which keep track of +// allocation lengths and zero them out before freeing. All memory returned by +// BoringSSL API calls must therefore generally be freed using |OPENSSL_free| +// unless stated otherwise. + + +// OPENSSL_malloc acts like a regular |malloc|. +OPENSSL_EXPORT void *OPENSSL_malloc(size_t size); + +// OPENSSL_free does nothing if |ptr| is NULL. Otherwise it zeros out the +// memory allocated at |ptr| and frees it. +OPENSSL_EXPORT void OPENSSL_free(void *ptr); + +// OPENSSL_realloc returns a pointer to a buffer of |new_size| bytes that +// contains the contents of |ptr|. Unlike |realloc|, a new buffer is always +// allocated and the data at |ptr| is always wiped and freed. +OPENSSL_EXPORT void *OPENSSL_realloc(void *ptr, size_t new_size); + +// OPENSSL_cleanse zeros out |len| bytes of memory at |ptr|. This is similar to +// |memset_s| from C11. +OPENSSL_EXPORT void OPENSSL_cleanse(void *ptr, size_t len); + +// CRYPTO_memcmp returns zero iff the |len| bytes at |a| and |b| are equal. It +// takes an amount of time dependent on |len|, but independent of the contents +// of |a| and |b|. Unlike memcmp, it cannot be used to put elements into a +// defined order as the return value when a != b is undefined, other than to be +// non-zero. +OPENSSL_EXPORT int CRYPTO_memcmp(const void *a, const void *b, size_t len); + +// OPENSSL_hash32 implements the 32 bit, FNV-1a hash. +OPENSSL_EXPORT uint32_t OPENSSL_hash32(const void *ptr, size_t len); + +// OPENSSL_strdup has the same behaviour as strdup(3). +OPENSSL_EXPORT char *OPENSSL_strdup(const char *s); + +// OPENSSL_strnlen has the same behaviour as strnlen(3). +OPENSSL_EXPORT size_t OPENSSL_strnlen(const char *s, size_t len); + +// OPENSSL_tolower is a locale-independent version of tolower(3). +OPENSSL_EXPORT int OPENSSL_tolower(int c); + +// OPENSSL_strcasecmp is a locale-independent version of strcasecmp(3). +OPENSSL_EXPORT int OPENSSL_strcasecmp(const char *a, const char *b); + +// OPENSSL_strncasecmp is a locale-independent version of strncasecmp(3). +OPENSSL_EXPORT int OPENSSL_strncasecmp(const char *a, const char *b, size_t n); + +// DECIMAL_SIZE returns an upper bound for the length of the decimal +// representation of the given type. +#define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) + +// BIO_snprintf has the same behavior as snprintf(3). +OPENSSL_EXPORT int BIO_snprintf(char *buf, size_t n, const char *format, ...) + OPENSSL_PRINTF_FORMAT_FUNC(3, 4); + +// BIO_vsnprintf has the same behavior as vsnprintf(3). +OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format, + va_list args) OPENSSL_PRINTF_FORMAT_FUNC(3, 0); + +// OPENSSL_strndup returns an allocated, duplicate of |str|, which is, at most, +// |size| bytes. The result is always NUL terminated. +OPENSSL_EXPORT char *OPENSSL_strndup(const char *str, size_t size); + +// OPENSSL_memdup returns an allocated, duplicate of |size| bytes from |data| or +// NULL on allocation failure. +OPENSSL_EXPORT void *OPENSSL_memdup(const void *data, size_t size); + +// OPENSSL_strlcpy acts like strlcpy(3). +OPENSSL_EXPORT size_t OPENSSL_strlcpy(char *dst, const char *src, + size_t dst_size); + +// OPENSSL_strlcat acts like strlcat(3). +OPENSSL_EXPORT size_t OPENSSL_strlcat(char *dst, const char *src, + size_t dst_size); + + +// Deprecated functions. + +#define CRYPTO_malloc OPENSSL_malloc +#define CRYPTO_realloc OPENSSL_realloc +#define CRYPTO_free OPENSSL_free + +// OPENSSL_clear_free calls |OPENSSL_free|. BoringSSL automatically clears all +// allocations on free, but we define |OPENSSL_clear_free| for compatibility. +OPENSSL_EXPORT void OPENSSL_clear_free(void *ptr, size_t len); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(char, OPENSSL_free) +BORINGSSL_MAKE_DELETER(uint8_t, OPENSSL_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#endif // OPENSSL_HEADER_MEM_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/mem.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.grpc_back similarity index 85% rename from Pods/BoringSSL-GRPC/include/openssl/mem.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/mem.h.grpc_back index 7d7087e60..cceabcdc8 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/mem.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/mem.h.grpc_back @@ -126,8 +126,23 @@ OPENSSL_EXPORT int BIO_snprintf(char *buf, size_t n, const char *format, ...) // BIO_vsnprintf has the same behavior as vsnprintf(3). OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format, - va_list args) - OPENSSL_PRINTF_FORMAT_FUNC(3, 0); + va_list args) OPENSSL_PRINTF_FORMAT_FUNC(3, 0); + +// OPENSSL_strndup returns an allocated, duplicate of |str|, which is, at most, +// |size| bytes. The result is always NUL terminated. +OPENSSL_EXPORT char *OPENSSL_strndup(const char *str, size_t size); + +// OPENSSL_memdup returns an allocated, duplicate of |size| bytes from |data| or +// NULL on allocation failure. +OPENSSL_EXPORT void *OPENSSL_memdup(const void *data, size_t size); + +// OPENSSL_strlcpy acts like strlcpy(3). +OPENSSL_EXPORT size_t OPENSSL_strlcpy(char *dst, const char *src, + size_t dst_size); + +// OPENSSL_strlcat acts like strlcat(3). +OPENSSL_EXPORT size_t OPENSSL_strlcat(char *dst, const char *src, + size_t dst_size); // Deprecated functions. @@ -136,18 +151,22 @@ OPENSSL_EXPORT int BIO_vsnprintf(char *buf, size_t n, const char *format, #define CRYPTO_realloc OPENSSL_realloc #define CRYPTO_free OPENSSL_free +// OPENSSL_clear_free calls |OPENSSL_free|. BoringSSL automatically clears all +// allocations on free, but we define |OPENSSL_clear_free| for compatibility. +OPENSSL_EXPORT void OPENSSL_clear_free(void *ptr, size_t len); + #if defined(__cplusplus) } // extern C extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(char, OPENSSL_free) BORINGSSL_MAKE_DELETER(uint8_t, OPENSSL_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/nid.h b/Pods/BoringSSL-GRPC/src/include/openssl/nid.h similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/nid.h rename to Pods/BoringSSL-GRPC/src/include/openssl/nid.h index f035b5f57..676a19497 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/nid.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/nid.h @@ -4193,6 +4193,7 @@ extern "C" { #define SN_X25519 "X25519" #define NID_X25519 948 +#define OBJ_X25519 1L, 3L, 101L, 110L #define SN_ED25519 "ED25519" #define NID_ED25519 949 @@ -4234,6 +4235,17 @@ extern "C" { #define LN_auth_any "auth-any" #define NID_auth_any 958 +#define SN_CECPQ2 "CECPQ2" +#define NID_CECPQ2 959 + +#define SN_ED448 "ED448" +#define NID_ED448 960 +#define OBJ_ED448 1L, 3L, 101L, 113L + +#define SN_X448 "X448" +#define NID_X448 961 +#define OBJ_X448 1L, 3L, 101L, 111L + #if defined(__cplusplus) } /* extern C */ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.back new file mode 100644 index 000000000..a15f4e3d6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.back @@ -0,0 +1,4254 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +/* This file is generated by crypto/obj/objects.go. */ + +#ifndef OPENSSL_HEADER_NID_H +#define OPENSSL_HEADER_NID_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +/* The nid library provides numbered values for ASN.1 object identifiers and + * other symbols. These values are used by other libraries to identify + * cryptographic primitives. + * + * A separate objects library, obj.h, provides functions for converting between + * nids and object identifiers. However it depends on large internal tables with + * the encodings of every nid defined. Consumers concerned with binary size + * should instead embed the encodings of the few consumed OIDs and compare + * against those. + * + * These values should not be used outside of a single process; they are not + * stable identifiers. */ + + +#define SN_undef "UNDEF" +#define LN_undef "undefined" +#define NID_undef 0 +#define OBJ_undef 0L + +#define SN_rsadsi "rsadsi" +#define LN_rsadsi "RSA Data Security, Inc." +#define NID_rsadsi 1 +#define OBJ_rsadsi 1L, 2L, 840L, 113549L + +#define SN_pkcs "pkcs" +#define LN_pkcs "RSA Data Security, Inc. PKCS" +#define NID_pkcs 2 +#define OBJ_pkcs 1L, 2L, 840L, 113549L, 1L + +#define SN_md2 "MD2" +#define LN_md2 "md2" +#define NID_md2 3 +#define OBJ_md2 1L, 2L, 840L, 113549L, 2L, 2L + +#define SN_md5 "MD5" +#define LN_md5 "md5" +#define NID_md5 4 +#define OBJ_md5 1L, 2L, 840L, 113549L, 2L, 5L + +#define SN_rc4 "RC4" +#define LN_rc4 "rc4" +#define NID_rc4 5 +#define OBJ_rc4 1L, 2L, 840L, 113549L, 3L, 4L + +#define LN_rsaEncryption "rsaEncryption" +#define NID_rsaEncryption 6 +#define OBJ_rsaEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 1L + +#define SN_md2WithRSAEncryption "RSA-MD2" +#define LN_md2WithRSAEncryption "md2WithRSAEncryption" +#define NID_md2WithRSAEncryption 7 +#define OBJ_md2WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 2L + +#define SN_md5WithRSAEncryption "RSA-MD5" +#define LN_md5WithRSAEncryption "md5WithRSAEncryption" +#define NID_md5WithRSAEncryption 8 +#define OBJ_md5WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 4L + +#define SN_pbeWithMD2AndDES_CBC "PBE-MD2-DES" +#define LN_pbeWithMD2AndDES_CBC "pbeWithMD2AndDES-CBC" +#define NID_pbeWithMD2AndDES_CBC 9 +#define OBJ_pbeWithMD2AndDES_CBC 1L, 2L, 840L, 113549L, 1L, 5L, 1L + +#define SN_pbeWithMD5AndDES_CBC "PBE-MD5-DES" +#define LN_pbeWithMD5AndDES_CBC "pbeWithMD5AndDES-CBC" +#define NID_pbeWithMD5AndDES_CBC 10 +#define OBJ_pbeWithMD5AndDES_CBC 1L, 2L, 840L, 113549L, 1L, 5L, 3L + +#define SN_X500 "X500" +#define LN_X500 "directory services (X.500)" +#define NID_X500 11 +#define OBJ_X500 2L, 5L + +#define SN_X509 "X509" +#define NID_X509 12 +#define OBJ_X509 2L, 5L, 4L + +#define SN_commonName "CN" +#define LN_commonName "commonName" +#define NID_commonName 13 +#define OBJ_commonName 2L, 5L, 4L, 3L + +#define SN_countryName "C" +#define LN_countryName "countryName" +#define NID_countryName 14 +#define OBJ_countryName 2L, 5L, 4L, 6L + +#define SN_localityName "L" +#define LN_localityName "localityName" +#define NID_localityName 15 +#define OBJ_localityName 2L, 5L, 4L, 7L + +#define SN_stateOrProvinceName "ST" +#define LN_stateOrProvinceName "stateOrProvinceName" +#define NID_stateOrProvinceName 16 +#define OBJ_stateOrProvinceName 2L, 5L, 4L, 8L + +#define SN_organizationName "O" +#define LN_organizationName "organizationName" +#define NID_organizationName 17 +#define OBJ_organizationName 2L, 5L, 4L, 10L + +#define SN_organizationalUnitName "OU" +#define LN_organizationalUnitName "organizationalUnitName" +#define NID_organizationalUnitName 18 +#define OBJ_organizationalUnitName 2L, 5L, 4L, 11L + +#define SN_rsa "RSA" +#define LN_rsa "rsa" +#define NID_rsa 19 +#define OBJ_rsa 2L, 5L, 8L, 1L, 1L + +#define SN_pkcs7 "pkcs7" +#define NID_pkcs7 20 +#define OBJ_pkcs7 1L, 2L, 840L, 113549L, 1L, 7L + +#define LN_pkcs7_data "pkcs7-data" +#define NID_pkcs7_data 21 +#define OBJ_pkcs7_data 1L, 2L, 840L, 113549L, 1L, 7L, 1L + +#define LN_pkcs7_signed "pkcs7-signedData" +#define NID_pkcs7_signed 22 +#define OBJ_pkcs7_signed 1L, 2L, 840L, 113549L, 1L, 7L, 2L + +#define LN_pkcs7_enveloped "pkcs7-envelopedData" +#define NID_pkcs7_enveloped 23 +#define OBJ_pkcs7_enveloped 1L, 2L, 840L, 113549L, 1L, 7L, 3L + +#define LN_pkcs7_signedAndEnveloped "pkcs7-signedAndEnvelopedData" +#define NID_pkcs7_signedAndEnveloped 24 +#define OBJ_pkcs7_signedAndEnveloped 1L, 2L, 840L, 113549L, 1L, 7L, 4L + +#define LN_pkcs7_digest "pkcs7-digestData" +#define NID_pkcs7_digest 25 +#define OBJ_pkcs7_digest 1L, 2L, 840L, 113549L, 1L, 7L, 5L + +#define LN_pkcs7_encrypted "pkcs7-encryptedData" +#define NID_pkcs7_encrypted 26 +#define OBJ_pkcs7_encrypted 1L, 2L, 840L, 113549L, 1L, 7L, 6L + +#define SN_pkcs3 "pkcs3" +#define NID_pkcs3 27 +#define OBJ_pkcs3 1L, 2L, 840L, 113549L, 1L, 3L + +#define LN_dhKeyAgreement "dhKeyAgreement" +#define NID_dhKeyAgreement 28 +#define OBJ_dhKeyAgreement 1L, 2L, 840L, 113549L, 1L, 3L, 1L + +#define SN_des_ecb "DES-ECB" +#define LN_des_ecb "des-ecb" +#define NID_des_ecb 29 +#define OBJ_des_ecb 1L, 3L, 14L, 3L, 2L, 6L + +#define SN_des_cfb64 "DES-CFB" +#define LN_des_cfb64 "des-cfb" +#define NID_des_cfb64 30 +#define OBJ_des_cfb64 1L, 3L, 14L, 3L, 2L, 9L + +#define SN_des_cbc "DES-CBC" +#define LN_des_cbc "des-cbc" +#define NID_des_cbc 31 +#define OBJ_des_cbc 1L, 3L, 14L, 3L, 2L, 7L + +#define SN_des_ede_ecb "DES-EDE" +#define LN_des_ede_ecb "des-ede" +#define NID_des_ede_ecb 32 +#define OBJ_des_ede_ecb 1L, 3L, 14L, 3L, 2L, 17L + +#define SN_des_ede3_ecb "DES-EDE3" +#define LN_des_ede3_ecb "des-ede3" +#define NID_des_ede3_ecb 33 + +#define SN_idea_cbc "IDEA-CBC" +#define LN_idea_cbc "idea-cbc" +#define NID_idea_cbc 34 +#define OBJ_idea_cbc 1L, 3L, 6L, 1L, 4L, 1L, 188L, 7L, 1L, 1L, 2L + +#define SN_idea_cfb64 "IDEA-CFB" +#define LN_idea_cfb64 "idea-cfb" +#define NID_idea_cfb64 35 + +#define SN_idea_ecb "IDEA-ECB" +#define LN_idea_ecb "idea-ecb" +#define NID_idea_ecb 36 + +#define SN_rc2_cbc "RC2-CBC" +#define LN_rc2_cbc "rc2-cbc" +#define NID_rc2_cbc 37 +#define OBJ_rc2_cbc 1L, 2L, 840L, 113549L, 3L, 2L + +#define SN_rc2_ecb "RC2-ECB" +#define LN_rc2_ecb "rc2-ecb" +#define NID_rc2_ecb 38 + +#define SN_rc2_cfb64 "RC2-CFB" +#define LN_rc2_cfb64 "rc2-cfb" +#define NID_rc2_cfb64 39 + +#define SN_rc2_ofb64 "RC2-OFB" +#define LN_rc2_ofb64 "rc2-ofb" +#define NID_rc2_ofb64 40 + +#define SN_sha "SHA" +#define LN_sha "sha" +#define NID_sha 41 +#define OBJ_sha 1L, 3L, 14L, 3L, 2L, 18L + +#define SN_shaWithRSAEncryption "RSA-SHA" +#define LN_shaWithRSAEncryption "shaWithRSAEncryption" +#define NID_shaWithRSAEncryption 42 +#define OBJ_shaWithRSAEncryption 1L, 3L, 14L, 3L, 2L, 15L + +#define SN_des_ede_cbc "DES-EDE-CBC" +#define LN_des_ede_cbc "des-ede-cbc" +#define NID_des_ede_cbc 43 + +#define SN_des_ede3_cbc "DES-EDE3-CBC" +#define LN_des_ede3_cbc "des-ede3-cbc" +#define NID_des_ede3_cbc 44 +#define OBJ_des_ede3_cbc 1L, 2L, 840L, 113549L, 3L, 7L + +#define SN_des_ofb64 "DES-OFB" +#define LN_des_ofb64 "des-ofb" +#define NID_des_ofb64 45 +#define OBJ_des_ofb64 1L, 3L, 14L, 3L, 2L, 8L + +#define SN_idea_ofb64 "IDEA-OFB" +#define LN_idea_ofb64 "idea-ofb" +#define NID_idea_ofb64 46 + +#define SN_pkcs9 "pkcs9" +#define NID_pkcs9 47 +#define OBJ_pkcs9 1L, 2L, 840L, 113549L, 1L, 9L + +#define LN_pkcs9_emailAddress "emailAddress" +#define NID_pkcs9_emailAddress 48 +#define OBJ_pkcs9_emailAddress 1L, 2L, 840L, 113549L, 1L, 9L, 1L + +#define LN_pkcs9_unstructuredName "unstructuredName" +#define NID_pkcs9_unstructuredName 49 +#define OBJ_pkcs9_unstructuredName 1L, 2L, 840L, 113549L, 1L, 9L, 2L + +#define LN_pkcs9_contentType "contentType" +#define NID_pkcs9_contentType 50 +#define OBJ_pkcs9_contentType 1L, 2L, 840L, 113549L, 1L, 9L, 3L + +#define LN_pkcs9_messageDigest "messageDigest" +#define NID_pkcs9_messageDigest 51 +#define OBJ_pkcs9_messageDigest 1L, 2L, 840L, 113549L, 1L, 9L, 4L + +#define LN_pkcs9_signingTime "signingTime" +#define NID_pkcs9_signingTime 52 +#define OBJ_pkcs9_signingTime 1L, 2L, 840L, 113549L, 1L, 9L, 5L + +#define LN_pkcs9_countersignature "countersignature" +#define NID_pkcs9_countersignature 53 +#define OBJ_pkcs9_countersignature 1L, 2L, 840L, 113549L, 1L, 9L, 6L + +#define LN_pkcs9_challengePassword "challengePassword" +#define NID_pkcs9_challengePassword 54 +#define OBJ_pkcs9_challengePassword 1L, 2L, 840L, 113549L, 1L, 9L, 7L + +#define LN_pkcs9_unstructuredAddress "unstructuredAddress" +#define NID_pkcs9_unstructuredAddress 55 +#define OBJ_pkcs9_unstructuredAddress 1L, 2L, 840L, 113549L, 1L, 9L, 8L + +#define LN_pkcs9_extCertAttributes "extendedCertificateAttributes" +#define NID_pkcs9_extCertAttributes 56 +#define OBJ_pkcs9_extCertAttributes 1L, 2L, 840L, 113549L, 1L, 9L, 9L + +#define SN_netscape "Netscape" +#define LN_netscape "Netscape Communications Corp." +#define NID_netscape 57 +#define OBJ_netscape 2L, 16L, 840L, 1L, 113730L + +#define SN_netscape_cert_extension "nsCertExt" +#define LN_netscape_cert_extension "Netscape Certificate Extension" +#define NID_netscape_cert_extension 58 +#define OBJ_netscape_cert_extension 2L, 16L, 840L, 1L, 113730L, 1L + +#define SN_netscape_data_type "nsDataType" +#define LN_netscape_data_type "Netscape Data Type" +#define NID_netscape_data_type 59 +#define OBJ_netscape_data_type 2L, 16L, 840L, 1L, 113730L, 2L + +#define SN_des_ede_cfb64 "DES-EDE-CFB" +#define LN_des_ede_cfb64 "des-ede-cfb" +#define NID_des_ede_cfb64 60 + +#define SN_des_ede3_cfb64 "DES-EDE3-CFB" +#define LN_des_ede3_cfb64 "des-ede3-cfb" +#define NID_des_ede3_cfb64 61 + +#define SN_des_ede_ofb64 "DES-EDE-OFB" +#define LN_des_ede_ofb64 "des-ede-ofb" +#define NID_des_ede_ofb64 62 + +#define SN_des_ede3_ofb64 "DES-EDE3-OFB" +#define LN_des_ede3_ofb64 "des-ede3-ofb" +#define NID_des_ede3_ofb64 63 + +#define SN_sha1 "SHA1" +#define LN_sha1 "sha1" +#define NID_sha1 64 +#define OBJ_sha1 1L, 3L, 14L, 3L, 2L, 26L + +#define SN_sha1WithRSAEncryption "RSA-SHA1" +#define LN_sha1WithRSAEncryption "sha1WithRSAEncryption" +#define NID_sha1WithRSAEncryption 65 +#define OBJ_sha1WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 5L + +#define SN_dsaWithSHA "DSA-SHA" +#define LN_dsaWithSHA "dsaWithSHA" +#define NID_dsaWithSHA 66 +#define OBJ_dsaWithSHA 1L, 3L, 14L, 3L, 2L, 13L + +#define SN_dsa_2 "DSA-old" +#define LN_dsa_2 "dsaEncryption-old" +#define NID_dsa_2 67 +#define OBJ_dsa_2 1L, 3L, 14L, 3L, 2L, 12L + +#define SN_pbeWithSHA1AndRC2_CBC "PBE-SHA1-RC2-64" +#define LN_pbeWithSHA1AndRC2_CBC "pbeWithSHA1AndRC2-CBC" +#define NID_pbeWithSHA1AndRC2_CBC 68 +#define OBJ_pbeWithSHA1AndRC2_CBC 1L, 2L, 840L, 113549L, 1L, 5L, 11L + +#define LN_id_pbkdf2 "PBKDF2" +#define NID_id_pbkdf2 69 +#define OBJ_id_pbkdf2 1L, 2L, 840L, 113549L, 1L, 5L, 12L + +#define SN_dsaWithSHA1_2 "DSA-SHA1-old" +#define LN_dsaWithSHA1_2 "dsaWithSHA1-old" +#define NID_dsaWithSHA1_2 70 +#define OBJ_dsaWithSHA1_2 1L, 3L, 14L, 3L, 2L, 27L + +#define SN_netscape_cert_type "nsCertType" +#define LN_netscape_cert_type "Netscape Cert Type" +#define NID_netscape_cert_type 71 +#define OBJ_netscape_cert_type 2L, 16L, 840L, 1L, 113730L, 1L, 1L + +#define SN_netscape_base_url "nsBaseUrl" +#define LN_netscape_base_url "Netscape Base Url" +#define NID_netscape_base_url 72 +#define OBJ_netscape_base_url 2L, 16L, 840L, 1L, 113730L, 1L, 2L + +#define SN_netscape_revocation_url "nsRevocationUrl" +#define LN_netscape_revocation_url "Netscape Revocation Url" +#define NID_netscape_revocation_url 73 +#define OBJ_netscape_revocation_url 2L, 16L, 840L, 1L, 113730L, 1L, 3L + +#define SN_netscape_ca_revocation_url "nsCaRevocationUrl" +#define LN_netscape_ca_revocation_url "Netscape CA Revocation Url" +#define NID_netscape_ca_revocation_url 74 +#define OBJ_netscape_ca_revocation_url 2L, 16L, 840L, 1L, 113730L, 1L, 4L + +#define SN_netscape_renewal_url "nsRenewalUrl" +#define LN_netscape_renewal_url "Netscape Renewal Url" +#define NID_netscape_renewal_url 75 +#define OBJ_netscape_renewal_url 2L, 16L, 840L, 1L, 113730L, 1L, 7L + +#define SN_netscape_ca_policy_url "nsCaPolicyUrl" +#define LN_netscape_ca_policy_url "Netscape CA Policy Url" +#define NID_netscape_ca_policy_url 76 +#define OBJ_netscape_ca_policy_url 2L, 16L, 840L, 1L, 113730L, 1L, 8L + +#define SN_netscape_ssl_server_name "nsSslServerName" +#define LN_netscape_ssl_server_name "Netscape SSL Server Name" +#define NID_netscape_ssl_server_name 77 +#define OBJ_netscape_ssl_server_name 2L, 16L, 840L, 1L, 113730L, 1L, 12L + +#define SN_netscape_comment "nsComment" +#define LN_netscape_comment "Netscape Comment" +#define NID_netscape_comment 78 +#define OBJ_netscape_comment 2L, 16L, 840L, 1L, 113730L, 1L, 13L + +#define SN_netscape_cert_sequence "nsCertSequence" +#define LN_netscape_cert_sequence "Netscape Certificate Sequence" +#define NID_netscape_cert_sequence 79 +#define OBJ_netscape_cert_sequence 2L, 16L, 840L, 1L, 113730L, 2L, 5L + +#define SN_desx_cbc "DESX-CBC" +#define LN_desx_cbc "desx-cbc" +#define NID_desx_cbc 80 + +#define SN_id_ce "id-ce" +#define NID_id_ce 81 +#define OBJ_id_ce 2L, 5L, 29L + +#define SN_subject_key_identifier "subjectKeyIdentifier" +#define LN_subject_key_identifier "X509v3 Subject Key Identifier" +#define NID_subject_key_identifier 82 +#define OBJ_subject_key_identifier 2L, 5L, 29L, 14L + +#define SN_key_usage "keyUsage" +#define LN_key_usage "X509v3 Key Usage" +#define NID_key_usage 83 +#define OBJ_key_usage 2L, 5L, 29L, 15L + +#define SN_private_key_usage_period "privateKeyUsagePeriod" +#define LN_private_key_usage_period "X509v3 Private Key Usage Period" +#define NID_private_key_usage_period 84 +#define OBJ_private_key_usage_period 2L, 5L, 29L, 16L + +#define SN_subject_alt_name "subjectAltName" +#define LN_subject_alt_name "X509v3 Subject Alternative Name" +#define NID_subject_alt_name 85 +#define OBJ_subject_alt_name 2L, 5L, 29L, 17L + +#define SN_issuer_alt_name "issuerAltName" +#define LN_issuer_alt_name "X509v3 Issuer Alternative Name" +#define NID_issuer_alt_name 86 +#define OBJ_issuer_alt_name 2L, 5L, 29L, 18L + +#define SN_basic_constraints "basicConstraints" +#define LN_basic_constraints "X509v3 Basic Constraints" +#define NID_basic_constraints 87 +#define OBJ_basic_constraints 2L, 5L, 29L, 19L + +#define SN_crl_number "crlNumber" +#define LN_crl_number "X509v3 CRL Number" +#define NID_crl_number 88 +#define OBJ_crl_number 2L, 5L, 29L, 20L + +#define SN_certificate_policies "certificatePolicies" +#define LN_certificate_policies "X509v3 Certificate Policies" +#define NID_certificate_policies 89 +#define OBJ_certificate_policies 2L, 5L, 29L, 32L + +#define SN_authority_key_identifier "authorityKeyIdentifier" +#define LN_authority_key_identifier "X509v3 Authority Key Identifier" +#define NID_authority_key_identifier 90 +#define OBJ_authority_key_identifier 2L, 5L, 29L, 35L + +#define SN_bf_cbc "BF-CBC" +#define LN_bf_cbc "bf-cbc" +#define NID_bf_cbc 91 +#define OBJ_bf_cbc 1L, 3L, 6L, 1L, 4L, 1L, 3029L, 1L, 2L + +#define SN_bf_ecb "BF-ECB" +#define LN_bf_ecb "bf-ecb" +#define NID_bf_ecb 92 + +#define SN_bf_cfb64 "BF-CFB" +#define LN_bf_cfb64 "bf-cfb" +#define NID_bf_cfb64 93 + +#define SN_bf_ofb64 "BF-OFB" +#define LN_bf_ofb64 "bf-ofb" +#define NID_bf_ofb64 94 + +#define SN_mdc2 "MDC2" +#define LN_mdc2 "mdc2" +#define NID_mdc2 95 +#define OBJ_mdc2 2L, 5L, 8L, 3L, 101L + +#define SN_mdc2WithRSA "RSA-MDC2" +#define LN_mdc2WithRSA "mdc2WithRSA" +#define NID_mdc2WithRSA 96 +#define OBJ_mdc2WithRSA 2L, 5L, 8L, 3L, 100L + +#define SN_rc4_40 "RC4-40" +#define LN_rc4_40 "rc4-40" +#define NID_rc4_40 97 + +#define SN_rc2_40_cbc "RC2-40-CBC" +#define LN_rc2_40_cbc "rc2-40-cbc" +#define NID_rc2_40_cbc 98 + +#define SN_givenName "GN" +#define LN_givenName "givenName" +#define NID_givenName 99 +#define OBJ_givenName 2L, 5L, 4L, 42L + +#define SN_surname "SN" +#define LN_surname "surname" +#define NID_surname 100 +#define OBJ_surname 2L, 5L, 4L, 4L + +#define SN_initials "initials" +#define LN_initials "initials" +#define NID_initials 101 +#define OBJ_initials 2L, 5L, 4L, 43L + +#define SN_crl_distribution_points "crlDistributionPoints" +#define LN_crl_distribution_points "X509v3 CRL Distribution Points" +#define NID_crl_distribution_points 103 +#define OBJ_crl_distribution_points 2L, 5L, 29L, 31L + +#define SN_md5WithRSA "RSA-NP-MD5" +#define LN_md5WithRSA "md5WithRSA" +#define NID_md5WithRSA 104 +#define OBJ_md5WithRSA 1L, 3L, 14L, 3L, 2L, 3L + +#define LN_serialNumber "serialNumber" +#define NID_serialNumber 105 +#define OBJ_serialNumber 2L, 5L, 4L, 5L + +#define SN_title "title" +#define LN_title "title" +#define NID_title 106 +#define OBJ_title 2L, 5L, 4L, 12L + +#define LN_description "description" +#define NID_description 107 +#define OBJ_description 2L, 5L, 4L, 13L + +#define SN_cast5_cbc "CAST5-CBC" +#define LN_cast5_cbc "cast5-cbc" +#define NID_cast5_cbc 108 +#define OBJ_cast5_cbc 1L, 2L, 840L, 113533L, 7L, 66L, 10L + +#define SN_cast5_ecb "CAST5-ECB" +#define LN_cast5_ecb "cast5-ecb" +#define NID_cast5_ecb 109 + +#define SN_cast5_cfb64 "CAST5-CFB" +#define LN_cast5_cfb64 "cast5-cfb" +#define NID_cast5_cfb64 110 + +#define SN_cast5_ofb64 "CAST5-OFB" +#define LN_cast5_ofb64 "cast5-ofb" +#define NID_cast5_ofb64 111 + +#define LN_pbeWithMD5AndCast5_CBC "pbeWithMD5AndCast5CBC" +#define NID_pbeWithMD5AndCast5_CBC 112 +#define OBJ_pbeWithMD5AndCast5_CBC 1L, 2L, 840L, 113533L, 7L, 66L, 12L + +#define SN_dsaWithSHA1 "DSA-SHA1" +#define LN_dsaWithSHA1 "dsaWithSHA1" +#define NID_dsaWithSHA1 113 +#define OBJ_dsaWithSHA1 1L, 2L, 840L, 10040L, 4L, 3L + +#define SN_md5_sha1 "MD5-SHA1" +#define LN_md5_sha1 "md5-sha1" +#define NID_md5_sha1 114 + +#define SN_sha1WithRSA "RSA-SHA1-2" +#define LN_sha1WithRSA "sha1WithRSA" +#define NID_sha1WithRSA 115 +#define OBJ_sha1WithRSA 1L, 3L, 14L, 3L, 2L, 29L + +#define SN_dsa "DSA" +#define LN_dsa "dsaEncryption" +#define NID_dsa 116 +#define OBJ_dsa 1L, 2L, 840L, 10040L, 4L, 1L + +#define SN_ripemd160 "RIPEMD160" +#define LN_ripemd160 "ripemd160" +#define NID_ripemd160 117 +#define OBJ_ripemd160 1L, 3L, 36L, 3L, 2L, 1L + +#define SN_ripemd160WithRSA "RSA-RIPEMD160" +#define LN_ripemd160WithRSA "ripemd160WithRSA" +#define NID_ripemd160WithRSA 119 +#define OBJ_ripemd160WithRSA 1L, 3L, 36L, 3L, 3L, 1L, 2L + +#define SN_rc5_cbc "RC5-CBC" +#define LN_rc5_cbc "rc5-cbc" +#define NID_rc5_cbc 120 +#define OBJ_rc5_cbc 1L, 2L, 840L, 113549L, 3L, 8L + +#define SN_rc5_ecb "RC5-ECB" +#define LN_rc5_ecb "rc5-ecb" +#define NID_rc5_ecb 121 + +#define SN_rc5_cfb64 "RC5-CFB" +#define LN_rc5_cfb64 "rc5-cfb" +#define NID_rc5_cfb64 122 + +#define SN_rc5_ofb64 "RC5-OFB" +#define LN_rc5_ofb64 "rc5-ofb" +#define NID_rc5_ofb64 123 + +#define SN_zlib_compression "ZLIB" +#define LN_zlib_compression "zlib compression" +#define NID_zlib_compression 125 +#define OBJ_zlib_compression 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 8L + +#define SN_ext_key_usage "extendedKeyUsage" +#define LN_ext_key_usage "X509v3 Extended Key Usage" +#define NID_ext_key_usage 126 +#define OBJ_ext_key_usage 2L, 5L, 29L, 37L + +#define SN_id_pkix "PKIX" +#define NID_id_pkix 127 +#define OBJ_id_pkix 1L, 3L, 6L, 1L, 5L, 5L, 7L + +#define SN_id_kp "id-kp" +#define NID_id_kp 128 +#define OBJ_id_kp 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L + +#define SN_server_auth "serverAuth" +#define LN_server_auth "TLS Web Server Authentication" +#define NID_server_auth 129 +#define OBJ_server_auth 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 1L + +#define SN_client_auth "clientAuth" +#define LN_client_auth "TLS Web Client Authentication" +#define NID_client_auth 130 +#define OBJ_client_auth 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 2L + +#define SN_code_sign "codeSigning" +#define LN_code_sign "Code Signing" +#define NID_code_sign 131 +#define OBJ_code_sign 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 3L + +#define SN_email_protect "emailProtection" +#define LN_email_protect "E-mail Protection" +#define NID_email_protect 132 +#define OBJ_email_protect 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 4L + +#define SN_time_stamp "timeStamping" +#define LN_time_stamp "Time Stamping" +#define NID_time_stamp 133 +#define OBJ_time_stamp 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 8L + +#define SN_ms_code_ind "msCodeInd" +#define LN_ms_code_ind "Microsoft Individual Code Signing" +#define NID_ms_code_ind 134 +#define OBJ_ms_code_ind 1L, 3L, 6L, 1L, 4L, 1L, 311L, 2L, 1L, 21L + +#define SN_ms_code_com "msCodeCom" +#define LN_ms_code_com "Microsoft Commercial Code Signing" +#define NID_ms_code_com 135 +#define OBJ_ms_code_com 1L, 3L, 6L, 1L, 4L, 1L, 311L, 2L, 1L, 22L + +#define SN_ms_ctl_sign "msCTLSign" +#define LN_ms_ctl_sign "Microsoft Trust List Signing" +#define NID_ms_ctl_sign 136 +#define OBJ_ms_ctl_sign 1L, 3L, 6L, 1L, 4L, 1L, 311L, 10L, 3L, 1L + +#define SN_ms_sgc "msSGC" +#define LN_ms_sgc "Microsoft Server Gated Crypto" +#define NID_ms_sgc 137 +#define OBJ_ms_sgc 1L, 3L, 6L, 1L, 4L, 1L, 311L, 10L, 3L, 3L + +#define SN_ms_efs "msEFS" +#define LN_ms_efs "Microsoft Encrypted File System" +#define NID_ms_efs 138 +#define OBJ_ms_efs 1L, 3L, 6L, 1L, 4L, 1L, 311L, 10L, 3L, 4L + +#define SN_ns_sgc "nsSGC" +#define LN_ns_sgc "Netscape Server Gated Crypto" +#define NID_ns_sgc 139 +#define OBJ_ns_sgc 2L, 16L, 840L, 1L, 113730L, 4L, 1L + +#define SN_delta_crl "deltaCRL" +#define LN_delta_crl "X509v3 Delta CRL Indicator" +#define NID_delta_crl 140 +#define OBJ_delta_crl 2L, 5L, 29L, 27L + +#define SN_crl_reason "CRLReason" +#define LN_crl_reason "X509v3 CRL Reason Code" +#define NID_crl_reason 141 +#define OBJ_crl_reason 2L, 5L, 29L, 21L + +#define SN_invalidity_date "invalidityDate" +#define LN_invalidity_date "Invalidity Date" +#define NID_invalidity_date 142 +#define OBJ_invalidity_date 2L, 5L, 29L, 24L + +#define SN_sxnet "SXNetID" +#define LN_sxnet "Strong Extranet ID" +#define NID_sxnet 143 +#define OBJ_sxnet 1L, 3L, 101L, 1L, 4L, 1L + +#define SN_pbe_WithSHA1And128BitRC4 "PBE-SHA1-RC4-128" +#define LN_pbe_WithSHA1And128BitRC4 "pbeWithSHA1And128BitRC4" +#define NID_pbe_WithSHA1And128BitRC4 144 +#define OBJ_pbe_WithSHA1And128BitRC4 1L, 2L, 840L, 113549L, 1L, 12L, 1L, 1L + +#define SN_pbe_WithSHA1And40BitRC4 "PBE-SHA1-RC4-40" +#define LN_pbe_WithSHA1And40BitRC4 "pbeWithSHA1And40BitRC4" +#define NID_pbe_WithSHA1And40BitRC4 145 +#define OBJ_pbe_WithSHA1And40BitRC4 1L, 2L, 840L, 113549L, 1L, 12L, 1L, 2L + +#define SN_pbe_WithSHA1And3_Key_TripleDES_CBC "PBE-SHA1-3DES" +#define LN_pbe_WithSHA1And3_Key_TripleDES_CBC "pbeWithSHA1And3-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And3_Key_TripleDES_CBC 146 +#define OBJ_pbe_WithSHA1And3_Key_TripleDES_CBC \ + 1L, 2L, 840L, 113549L, 1L, 12L, 1L, 3L + +#define SN_pbe_WithSHA1And2_Key_TripleDES_CBC "PBE-SHA1-2DES" +#define LN_pbe_WithSHA1And2_Key_TripleDES_CBC "pbeWithSHA1And2-KeyTripleDES-CBC" +#define NID_pbe_WithSHA1And2_Key_TripleDES_CBC 147 +#define OBJ_pbe_WithSHA1And2_Key_TripleDES_CBC \ + 1L, 2L, 840L, 113549L, 1L, 12L, 1L, 4L + +#define SN_pbe_WithSHA1And128BitRC2_CBC "PBE-SHA1-RC2-128" +#define LN_pbe_WithSHA1And128BitRC2_CBC "pbeWithSHA1And128BitRC2-CBC" +#define NID_pbe_WithSHA1And128BitRC2_CBC 148 +#define OBJ_pbe_WithSHA1And128BitRC2_CBC 1L, 2L, 840L, 113549L, 1L, 12L, 1L, 5L + +#define SN_pbe_WithSHA1And40BitRC2_CBC "PBE-SHA1-RC2-40" +#define LN_pbe_WithSHA1And40BitRC2_CBC "pbeWithSHA1And40BitRC2-CBC" +#define NID_pbe_WithSHA1And40BitRC2_CBC 149 +#define OBJ_pbe_WithSHA1And40BitRC2_CBC 1L, 2L, 840L, 113549L, 1L, 12L, 1L, 6L + +#define LN_keyBag "keyBag" +#define NID_keyBag 150 +#define OBJ_keyBag 1L, 2L, 840L, 113549L, 1L, 12L, 10L, 1L, 1L + +#define LN_pkcs8ShroudedKeyBag "pkcs8ShroudedKeyBag" +#define NID_pkcs8ShroudedKeyBag 151 +#define OBJ_pkcs8ShroudedKeyBag 1L, 2L, 840L, 113549L, 1L, 12L, 10L, 1L, 2L + +#define LN_certBag "certBag" +#define NID_certBag 152 +#define OBJ_certBag 1L, 2L, 840L, 113549L, 1L, 12L, 10L, 1L, 3L + +#define LN_crlBag "crlBag" +#define NID_crlBag 153 +#define OBJ_crlBag 1L, 2L, 840L, 113549L, 1L, 12L, 10L, 1L, 4L + +#define LN_secretBag "secretBag" +#define NID_secretBag 154 +#define OBJ_secretBag 1L, 2L, 840L, 113549L, 1L, 12L, 10L, 1L, 5L + +#define LN_safeContentsBag "safeContentsBag" +#define NID_safeContentsBag 155 +#define OBJ_safeContentsBag 1L, 2L, 840L, 113549L, 1L, 12L, 10L, 1L, 6L + +#define LN_friendlyName "friendlyName" +#define NID_friendlyName 156 +#define OBJ_friendlyName 1L, 2L, 840L, 113549L, 1L, 9L, 20L + +#define LN_localKeyID "localKeyID" +#define NID_localKeyID 157 +#define OBJ_localKeyID 1L, 2L, 840L, 113549L, 1L, 9L, 21L + +#define LN_x509Certificate "x509Certificate" +#define NID_x509Certificate 158 +#define OBJ_x509Certificate 1L, 2L, 840L, 113549L, 1L, 9L, 22L, 1L + +#define LN_sdsiCertificate "sdsiCertificate" +#define NID_sdsiCertificate 159 +#define OBJ_sdsiCertificate 1L, 2L, 840L, 113549L, 1L, 9L, 22L, 2L + +#define LN_x509Crl "x509Crl" +#define NID_x509Crl 160 +#define OBJ_x509Crl 1L, 2L, 840L, 113549L, 1L, 9L, 23L, 1L + +#define LN_pbes2 "PBES2" +#define NID_pbes2 161 +#define OBJ_pbes2 1L, 2L, 840L, 113549L, 1L, 5L, 13L + +#define LN_pbmac1 "PBMAC1" +#define NID_pbmac1 162 +#define OBJ_pbmac1 1L, 2L, 840L, 113549L, 1L, 5L, 14L + +#define LN_hmacWithSHA1 "hmacWithSHA1" +#define NID_hmacWithSHA1 163 +#define OBJ_hmacWithSHA1 1L, 2L, 840L, 113549L, 2L, 7L + +#define SN_id_qt_cps "id-qt-cps" +#define LN_id_qt_cps "Policy Qualifier CPS" +#define NID_id_qt_cps 164 +#define OBJ_id_qt_cps 1L, 3L, 6L, 1L, 5L, 5L, 7L, 2L, 1L + +#define SN_id_qt_unotice "id-qt-unotice" +#define LN_id_qt_unotice "Policy Qualifier User Notice" +#define NID_id_qt_unotice 165 +#define OBJ_id_qt_unotice 1L, 3L, 6L, 1L, 5L, 5L, 7L, 2L, 2L + +#define SN_rc2_64_cbc "RC2-64-CBC" +#define LN_rc2_64_cbc "rc2-64-cbc" +#define NID_rc2_64_cbc 166 + +#define SN_SMIMECapabilities "SMIME-CAPS" +#define LN_SMIMECapabilities "S/MIME Capabilities" +#define NID_SMIMECapabilities 167 +#define OBJ_SMIMECapabilities 1L, 2L, 840L, 113549L, 1L, 9L, 15L + +#define SN_pbeWithMD2AndRC2_CBC "PBE-MD2-RC2-64" +#define LN_pbeWithMD2AndRC2_CBC "pbeWithMD2AndRC2-CBC" +#define NID_pbeWithMD2AndRC2_CBC 168 +#define OBJ_pbeWithMD2AndRC2_CBC 1L, 2L, 840L, 113549L, 1L, 5L, 4L + +#define SN_pbeWithMD5AndRC2_CBC "PBE-MD5-RC2-64" +#define LN_pbeWithMD5AndRC2_CBC "pbeWithMD5AndRC2-CBC" +#define NID_pbeWithMD5AndRC2_CBC 169 +#define OBJ_pbeWithMD5AndRC2_CBC 1L, 2L, 840L, 113549L, 1L, 5L, 6L + +#define SN_pbeWithSHA1AndDES_CBC "PBE-SHA1-DES" +#define LN_pbeWithSHA1AndDES_CBC "pbeWithSHA1AndDES-CBC" +#define NID_pbeWithSHA1AndDES_CBC 170 +#define OBJ_pbeWithSHA1AndDES_CBC 1L, 2L, 840L, 113549L, 1L, 5L, 10L + +#define SN_ms_ext_req "msExtReq" +#define LN_ms_ext_req "Microsoft Extension Request" +#define NID_ms_ext_req 171 +#define OBJ_ms_ext_req 1L, 3L, 6L, 1L, 4L, 1L, 311L, 2L, 1L, 14L + +#define SN_ext_req "extReq" +#define LN_ext_req "Extension Request" +#define NID_ext_req 172 +#define OBJ_ext_req 1L, 2L, 840L, 113549L, 1L, 9L, 14L + +#define SN_name "name" +#define LN_name "name" +#define NID_name 173 +#define OBJ_name 2L, 5L, 4L, 41L + +#define SN_dnQualifier "dnQualifier" +#define LN_dnQualifier "dnQualifier" +#define NID_dnQualifier 174 +#define OBJ_dnQualifier 2L, 5L, 4L, 46L + +#define SN_id_pe "id-pe" +#define NID_id_pe 175 +#define OBJ_id_pe 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L + +#define SN_id_ad "id-ad" +#define NID_id_ad 176 +#define OBJ_id_ad 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L + +#define SN_info_access "authorityInfoAccess" +#define LN_info_access "Authority Information Access" +#define NID_info_access 177 +#define OBJ_info_access 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 1L + +#define SN_ad_OCSP "OCSP" +#define LN_ad_OCSP "OCSP" +#define NID_ad_OCSP 178 +#define OBJ_ad_OCSP 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L + +#define SN_ad_ca_issuers "caIssuers" +#define LN_ad_ca_issuers "CA Issuers" +#define NID_ad_ca_issuers 179 +#define OBJ_ad_ca_issuers 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 2L + +#define SN_OCSP_sign "OCSPSigning" +#define LN_OCSP_sign "OCSP Signing" +#define NID_OCSP_sign 180 +#define OBJ_OCSP_sign 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 9L + +#define SN_iso "ISO" +#define LN_iso "iso" +#define NID_iso 181 +#define OBJ_iso 1L + +#define SN_member_body "member-body" +#define LN_member_body "ISO Member Body" +#define NID_member_body 182 +#define OBJ_member_body 1L, 2L + +#define SN_ISO_US "ISO-US" +#define LN_ISO_US "ISO US Member Body" +#define NID_ISO_US 183 +#define OBJ_ISO_US 1L, 2L, 840L + +#define SN_X9_57 "X9-57" +#define LN_X9_57 "X9.57" +#define NID_X9_57 184 +#define OBJ_X9_57 1L, 2L, 840L, 10040L + +#define SN_X9cm "X9cm" +#define LN_X9cm "X9.57 CM ?" +#define NID_X9cm 185 +#define OBJ_X9cm 1L, 2L, 840L, 10040L, 4L + +#define SN_pkcs1 "pkcs1" +#define NID_pkcs1 186 +#define OBJ_pkcs1 1L, 2L, 840L, 113549L, 1L, 1L + +#define SN_pkcs5 "pkcs5" +#define NID_pkcs5 187 +#define OBJ_pkcs5 1L, 2L, 840L, 113549L, 1L, 5L + +#define SN_SMIME "SMIME" +#define LN_SMIME "S/MIME" +#define NID_SMIME 188 +#define OBJ_SMIME 1L, 2L, 840L, 113549L, 1L, 9L, 16L + +#define SN_id_smime_mod "id-smime-mod" +#define NID_id_smime_mod 189 +#define OBJ_id_smime_mod 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L + +#define SN_id_smime_ct "id-smime-ct" +#define NID_id_smime_ct 190 +#define OBJ_id_smime_ct 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L + +#define SN_id_smime_aa "id-smime-aa" +#define NID_id_smime_aa 191 +#define OBJ_id_smime_aa 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L + +#define SN_id_smime_alg "id-smime-alg" +#define NID_id_smime_alg 192 +#define OBJ_id_smime_alg 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L + +#define SN_id_smime_cd "id-smime-cd" +#define NID_id_smime_cd 193 +#define OBJ_id_smime_cd 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 4L + +#define SN_id_smime_spq "id-smime-spq" +#define NID_id_smime_spq 194 +#define OBJ_id_smime_spq 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 5L + +#define SN_id_smime_cti "id-smime-cti" +#define NID_id_smime_cti 195 +#define OBJ_id_smime_cti 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L + +#define SN_id_smime_mod_cms "id-smime-mod-cms" +#define NID_id_smime_mod_cms 196 +#define OBJ_id_smime_mod_cms 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 1L + +#define SN_id_smime_mod_ess "id-smime-mod-ess" +#define NID_id_smime_mod_ess 197 +#define OBJ_id_smime_mod_ess 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 2L + +#define SN_id_smime_mod_oid "id-smime-mod-oid" +#define NID_id_smime_mod_oid 198 +#define OBJ_id_smime_mod_oid 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 3L + +#define SN_id_smime_mod_msg_v3 "id-smime-mod-msg-v3" +#define NID_id_smime_mod_msg_v3 199 +#define OBJ_id_smime_mod_msg_v3 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 4L + +#define SN_id_smime_mod_ets_eSignature_88 "id-smime-mod-ets-eSignature-88" +#define NID_id_smime_mod_ets_eSignature_88 200 +#define OBJ_id_smime_mod_ets_eSignature_88 \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 5L + +#define SN_id_smime_mod_ets_eSignature_97 "id-smime-mod-ets-eSignature-97" +#define NID_id_smime_mod_ets_eSignature_97 201 +#define OBJ_id_smime_mod_ets_eSignature_97 \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 6L + +#define SN_id_smime_mod_ets_eSigPolicy_88 "id-smime-mod-ets-eSigPolicy-88" +#define NID_id_smime_mod_ets_eSigPolicy_88 202 +#define OBJ_id_smime_mod_ets_eSigPolicy_88 \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 7L + +#define SN_id_smime_mod_ets_eSigPolicy_97 "id-smime-mod-ets-eSigPolicy-97" +#define NID_id_smime_mod_ets_eSigPolicy_97 203 +#define OBJ_id_smime_mod_ets_eSigPolicy_97 \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 0L, 8L + +#define SN_id_smime_ct_receipt "id-smime-ct-receipt" +#define NID_id_smime_ct_receipt 204 +#define OBJ_id_smime_ct_receipt 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 1L + +#define SN_id_smime_ct_authData "id-smime-ct-authData" +#define NID_id_smime_ct_authData 205 +#define OBJ_id_smime_ct_authData 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 2L + +#define SN_id_smime_ct_publishCert "id-smime-ct-publishCert" +#define NID_id_smime_ct_publishCert 206 +#define OBJ_id_smime_ct_publishCert 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 3L + +#define SN_id_smime_ct_TSTInfo "id-smime-ct-TSTInfo" +#define NID_id_smime_ct_TSTInfo 207 +#define OBJ_id_smime_ct_TSTInfo 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 4L + +#define SN_id_smime_ct_TDTInfo "id-smime-ct-TDTInfo" +#define NID_id_smime_ct_TDTInfo 208 +#define OBJ_id_smime_ct_TDTInfo 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 5L + +#define SN_id_smime_ct_contentInfo "id-smime-ct-contentInfo" +#define NID_id_smime_ct_contentInfo 209 +#define OBJ_id_smime_ct_contentInfo 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 6L + +#define SN_id_smime_ct_DVCSRequestData "id-smime-ct-DVCSRequestData" +#define NID_id_smime_ct_DVCSRequestData 210 +#define OBJ_id_smime_ct_DVCSRequestData \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 7L + +#define SN_id_smime_ct_DVCSResponseData "id-smime-ct-DVCSResponseData" +#define NID_id_smime_ct_DVCSResponseData 211 +#define OBJ_id_smime_ct_DVCSResponseData \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 8L + +#define SN_id_smime_aa_receiptRequest "id-smime-aa-receiptRequest" +#define NID_id_smime_aa_receiptRequest 212 +#define OBJ_id_smime_aa_receiptRequest \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 1L + +#define SN_id_smime_aa_securityLabel "id-smime-aa-securityLabel" +#define NID_id_smime_aa_securityLabel 213 +#define OBJ_id_smime_aa_securityLabel 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 2L + +#define SN_id_smime_aa_mlExpandHistory "id-smime-aa-mlExpandHistory" +#define NID_id_smime_aa_mlExpandHistory 214 +#define OBJ_id_smime_aa_mlExpandHistory \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 3L + +#define SN_id_smime_aa_contentHint "id-smime-aa-contentHint" +#define NID_id_smime_aa_contentHint 215 +#define OBJ_id_smime_aa_contentHint 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 4L + +#define SN_id_smime_aa_msgSigDigest "id-smime-aa-msgSigDigest" +#define NID_id_smime_aa_msgSigDigest 216 +#define OBJ_id_smime_aa_msgSigDigest 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 5L + +#define SN_id_smime_aa_encapContentType "id-smime-aa-encapContentType" +#define NID_id_smime_aa_encapContentType 217 +#define OBJ_id_smime_aa_encapContentType \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 6L + +#define SN_id_smime_aa_contentIdentifier "id-smime-aa-contentIdentifier" +#define NID_id_smime_aa_contentIdentifier 218 +#define OBJ_id_smime_aa_contentIdentifier \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 7L + +#define SN_id_smime_aa_macValue "id-smime-aa-macValue" +#define NID_id_smime_aa_macValue 219 +#define OBJ_id_smime_aa_macValue 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 8L + +#define SN_id_smime_aa_equivalentLabels "id-smime-aa-equivalentLabels" +#define NID_id_smime_aa_equivalentLabels 220 +#define OBJ_id_smime_aa_equivalentLabels \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 9L + +#define SN_id_smime_aa_contentReference "id-smime-aa-contentReference" +#define NID_id_smime_aa_contentReference 221 +#define OBJ_id_smime_aa_contentReference \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 10L + +#define SN_id_smime_aa_encrypKeyPref "id-smime-aa-encrypKeyPref" +#define NID_id_smime_aa_encrypKeyPref 222 +#define OBJ_id_smime_aa_encrypKeyPref \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 11L + +#define SN_id_smime_aa_signingCertificate "id-smime-aa-signingCertificate" +#define NID_id_smime_aa_signingCertificate 223 +#define OBJ_id_smime_aa_signingCertificate \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 12L + +#define SN_id_smime_aa_smimeEncryptCerts "id-smime-aa-smimeEncryptCerts" +#define NID_id_smime_aa_smimeEncryptCerts 224 +#define OBJ_id_smime_aa_smimeEncryptCerts \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 13L + +#define SN_id_smime_aa_timeStampToken "id-smime-aa-timeStampToken" +#define NID_id_smime_aa_timeStampToken 225 +#define OBJ_id_smime_aa_timeStampToken \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 14L + +#define SN_id_smime_aa_ets_sigPolicyId "id-smime-aa-ets-sigPolicyId" +#define NID_id_smime_aa_ets_sigPolicyId 226 +#define OBJ_id_smime_aa_ets_sigPolicyId \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 15L + +#define SN_id_smime_aa_ets_commitmentType "id-smime-aa-ets-commitmentType" +#define NID_id_smime_aa_ets_commitmentType 227 +#define OBJ_id_smime_aa_ets_commitmentType \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 16L + +#define SN_id_smime_aa_ets_signerLocation "id-smime-aa-ets-signerLocation" +#define NID_id_smime_aa_ets_signerLocation 228 +#define OBJ_id_smime_aa_ets_signerLocation \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 17L + +#define SN_id_smime_aa_ets_signerAttr "id-smime-aa-ets-signerAttr" +#define NID_id_smime_aa_ets_signerAttr 229 +#define OBJ_id_smime_aa_ets_signerAttr \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 18L + +#define SN_id_smime_aa_ets_otherSigCert "id-smime-aa-ets-otherSigCert" +#define NID_id_smime_aa_ets_otherSigCert 230 +#define OBJ_id_smime_aa_ets_otherSigCert \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 19L + +#define SN_id_smime_aa_ets_contentTimestamp "id-smime-aa-ets-contentTimestamp" +#define NID_id_smime_aa_ets_contentTimestamp 231 +#define OBJ_id_smime_aa_ets_contentTimestamp \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 20L + +#define SN_id_smime_aa_ets_CertificateRefs "id-smime-aa-ets-CertificateRefs" +#define NID_id_smime_aa_ets_CertificateRefs 232 +#define OBJ_id_smime_aa_ets_CertificateRefs \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 21L + +#define SN_id_smime_aa_ets_RevocationRefs "id-smime-aa-ets-RevocationRefs" +#define NID_id_smime_aa_ets_RevocationRefs 233 +#define OBJ_id_smime_aa_ets_RevocationRefs \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 22L + +#define SN_id_smime_aa_ets_certValues "id-smime-aa-ets-certValues" +#define NID_id_smime_aa_ets_certValues 234 +#define OBJ_id_smime_aa_ets_certValues \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 23L + +#define SN_id_smime_aa_ets_revocationValues "id-smime-aa-ets-revocationValues" +#define NID_id_smime_aa_ets_revocationValues 235 +#define OBJ_id_smime_aa_ets_revocationValues \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 24L + +#define SN_id_smime_aa_ets_escTimeStamp "id-smime-aa-ets-escTimeStamp" +#define NID_id_smime_aa_ets_escTimeStamp 236 +#define OBJ_id_smime_aa_ets_escTimeStamp \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 25L + +#define SN_id_smime_aa_ets_certCRLTimestamp "id-smime-aa-ets-certCRLTimestamp" +#define NID_id_smime_aa_ets_certCRLTimestamp 237 +#define OBJ_id_smime_aa_ets_certCRLTimestamp \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 26L + +#define SN_id_smime_aa_ets_archiveTimeStamp "id-smime-aa-ets-archiveTimeStamp" +#define NID_id_smime_aa_ets_archiveTimeStamp 238 +#define OBJ_id_smime_aa_ets_archiveTimeStamp \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 27L + +#define SN_id_smime_aa_signatureType "id-smime-aa-signatureType" +#define NID_id_smime_aa_signatureType 239 +#define OBJ_id_smime_aa_signatureType \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 28L + +#define SN_id_smime_aa_dvcs_dvc "id-smime-aa-dvcs-dvc" +#define NID_id_smime_aa_dvcs_dvc 240 +#define OBJ_id_smime_aa_dvcs_dvc 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 2L, 29L + +#define SN_id_smime_alg_ESDHwith3DES "id-smime-alg-ESDHwith3DES" +#define NID_id_smime_alg_ESDHwith3DES 241 +#define OBJ_id_smime_alg_ESDHwith3DES 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 1L + +#define SN_id_smime_alg_ESDHwithRC2 "id-smime-alg-ESDHwithRC2" +#define NID_id_smime_alg_ESDHwithRC2 242 +#define OBJ_id_smime_alg_ESDHwithRC2 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 2L + +#define SN_id_smime_alg_3DESwrap "id-smime-alg-3DESwrap" +#define NID_id_smime_alg_3DESwrap 243 +#define OBJ_id_smime_alg_3DESwrap 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 3L + +#define SN_id_smime_alg_RC2wrap "id-smime-alg-RC2wrap" +#define NID_id_smime_alg_RC2wrap 244 +#define OBJ_id_smime_alg_RC2wrap 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 4L + +#define SN_id_smime_alg_ESDH "id-smime-alg-ESDH" +#define NID_id_smime_alg_ESDH 245 +#define OBJ_id_smime_alg_ESDH 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 5L + +#define SN_id_smime_alg_CMS3DESwrap "id-smime-alg-CMS3DESwrap" +#define NID_id_smime_alg_CMS3DESwrap 246 +#define OBJ_id_smime_alg_CMS3DESwrap 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 6L + +#define SN_id_smime_alg_CMSRC2wrap "id-smime-alg-CMSRC2wrap" +#define NID_id_smime_alg_CMSRC2wrap 247 +#define OBJ_id_smime_alg_CMSRC2wrap 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 7L + +#define SN_id_smime_cd_ldap "id-smime-cd-ldap" +#define NID_id_smime_cd_ldap 248 +#define OBJ_id_smime_cd_ldap 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 4L, 1L + +#define SN_id_smime_spq_ets_sqt_uri "id-smime-spq-ets-sqt-uri" +#define NID_id_smime_spq_ets_sqt_uri 249 +#define OBJ_id_smime_spq_ets_sqt_uri 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 5L, 1L + +#define SN_id_smime_spq_ets_sqt_unotice "id-smime-spq-ets-sqt-unotice" +#define NID_id_smime_spq_ets_sqt_unotice 250 +#define OBJ_id_smime_spq_ets_sqt_unotice \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 5L, 2L + +#define SN_id_smime_cti_ets_proofOfOrigin "id-smime-cti-ets-proofOfOrigin" +#define NID_id_smime_cti_ets_proofOfOrigin 251 +#define OBJ_id_smime_cti_ets_proofOfOrigin \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L, 1L + +#define SN_id_smime_cti_ets_proofOfReceipt "id-smime-cti-ets-proofOfReceipt" +#define NID_id_smime_cti_ets_proofOfReceipt 252 +#define OBJ_id_smime_cti_ets_proofOfReceipt \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L, 2L + +#define SN_id_smime_cti_ets_proofOfDelivery "id-smime-cti-ets-proofOfDelivery" +#define NID_id_smime_cti_ets_proofOfDelivery 253 +#define OBJ_id_smime_cti_ets_proofOfDelivery \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L, 3L + +#define SN_id_smime_cti_ets_proofOfSender "id-smime-cti-ets-proofOfSender" +#define NID_id_smime_cti_ets_proofOfSender 254 +#define OBJ_id_smime_cti_ets_proofOfSender \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L, 4L + +#define SN_id_smime_cti_ets_proofOfApproval "id-smime-cti-ets-proofOfApproval" +#define NID_id_smime_cti_ets_proofOfApproval 255 +#define OBJ_id_smime_cti_ets_proofOfApproval \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L, 5L + +#define SN_id_smime_cti_ets_proofOfCreation "id-smime-cti-ets-proofOfCreation" +#define NID_id_smime_cti_ets_proofOfCreation 256 +#define OBJ_id_smime_cti_ets_proofOfCreation \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 6L, 6L + +#define SN_md4 "MD4" +#define LN_md4 "md4" +#define NID_md4 257 +#define OBJ_md4 1L, 2L, 840L, 113549L, 2L, 4L + +#define SN_id_pkix_mod "id-pkix-mod" +#define NID_id_pkix_mod 258 +#define OBJ_id_pkix_mod 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L + +#define SN_id_qt "id-qt" +#define NID_id_qt 259 +#define OBJ_id_qt 1L, 3L, 6L, 1L, 5L, 5L, 7L, 2L + +#define SN_id_it "id-it" +#define NID_id_it 260 +#define OBJ_id_it 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L + +#define SN_id_pkip "id-pkip" +#define NID_id_pkip 261 +#define OBJ_id_pkip 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L + +#define SN_id_alg "id-alg" +#define NID_id_alg 262 +#define OBJ_id_alg 1L, 3L, 6L, 1L, 5L, 5L, 7L, 6L + +#define SN_id_cmc "id-cmc" +#define NID_id_cmc 263 +#define OBJ_id_cmc 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L + +#define SN_id_on "id-on" +#define NID_id_on 264 +#define OBJ_id_on 1L, 3L, 6L, 1L, 5L, 5L, 7L, 8L + +#define SN_id_pda "id-pda" +#define NID_id_pda 265 +#define OBJ_id_pda 1L, 3L, 6L, 1L, 5L, 5L, 7L, 9L + +#define SN_id_aca "id-aca" +#define NID_id_aca 266 +#define OBJ_id_aca 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L + +#define SN_id_qcs "id-qcs" +#define NID_id_qcs 267 +#define OBJ_id_qcs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 11L + +#define SN_id_cct "id-cct" +#define NID_id_cct 268 +#define OBJ_id_cct 1L, 3L, 6L, 1L, 5L, 5L, 7L, 12L + +#define SN_id_pkix1_explicit_88 "id-pkix1-explicit-88" +#define NID_id_pkix1_explicit_88 269 +#define OBJ_id_pkix1_explicit_88 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 1L + +#define SN_id_pkix1_implicit_88 "id-pkix1-implicit-88" +#define NID_id_pkix1_implicit_88 270 +#define OBJ_id_pkix1_implicit_88 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 2L + +#define SN_id_pkix1_explicit_93 "id-pkix1-explicit-93" +#define NID_id_pkix1_explicit_93 271 +#define OBJ_id_pkix1_explicit_93 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 3L + +#define SN_id_pkix1_implicit_93 "id-pkix1-implicit-93" +#define NID_id_pkix1_implicit_93 272 +#define OBJ_id_pkix1_implicit_93 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 4L + +#define SN_id_mod_crmf "id-mod-crmf" +#define NID_id_mod_crmf 273 +#define OBJ_id_mod_crmf 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 5L + +#define SN_id_mod_cmc "id-mod-cmc" +#define NID_id_mod_cmc 274 +#define OBJ_id_mod_cmc 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 6L + +#define SN_id_mod_kea_profile_88 "id-mod-kea-profile-88" +#define NID_id_mod_kea_profile_88 275 +#define OBJ_id_mod_kea_profile_88 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 7L + +#define SN_id_mod_kea_profile_93 "id-mod-kea-profile-93" +#define NID_id_mod_kea_profile_93 276 +#define OBJ_id_mod_kea_profile_93 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 8L + +#define SN_id_mod_cmp "id-mod-cmp" +#define NID_id_mod_cmp 277 +#define OBJ_id_mod_cmp 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 9L + +#define SN_id_mod_qualified_cert_88 "id-mod-qualified-cert-88" +#define NID_id_mod_qualified_cert_88 278 +#define OBJ_id_mod_qualified_cert_88 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 10L + +#define SN_id_mod_qualified_cert_93 "id-mod-qualified-cert-93" +#define NID_id_mod_qualified_cert_93 279 +#define OBJ_id_mod_qualified_cert_93 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 11L + +#define SN_id_mod_attribute_cert "id-mod-attribute-cert" +#define NID_id_mod_attribute_cert 280 +#define OBJ_id_mod_attribute_cert 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 12L + +#define SN_id_mod_timestamp_protocol "id-mod-timestamp-protocol" +#define NID_id_mod_timestamp_protocol 281 +#define OBJ_id_mod_timestamp_protocol 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 13L + +#define SN_id_mod_ocsp "id-mod-ocsp" +#define NID_id_mod_ocsp 282 +#define OBJ_id_mod_ocsp 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 14L + +#define SN_id_mod_dvcs "id-mod-dvcs" +#define NID_id_mod_dvcs 283 +#define OBJ_id_mod_dvcs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 15L + +#define SN_id_mod_cmp2000 "id-mod-cmp2000" +#define NID_id_mod_cmp2000 284 +#define OBJ_id_mod_cmp2000 1L, 3L, 6L, 1L, 5L, 5L, 7L, 0L, 16L + +#define SN_biometricInfo "biometricInfo" +#define LN_biometricInfo "Biometric Info" +#define NID_biometricInfo 285 +#define OBJ_biometricInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 2L + +#define SN_qcStatements "qcStatements" +#define NID_qcStatements 286 +#define OBJ_qcStatements 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 3L + +#define SN_ac_auditEntity "ac-auditEntity" +#define NID_ac_auditEntity 287 +#define OBJ_ac_auditEntity 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 4L + +#define SN_ac_targeting "ac-targeting" +#define NID_ac_targeting 288 +#define OBJ_ac_targeting 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 5L + +#define SN_aaControls "aaControls" +#define NID_aaControls 289 +#define OBJ_aaControls 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 6L + +#define SN_sbgp_ipAddrBlock "sbgp-ipAddrBlock" +#define NID_sbgp_ipAddrBlock 290 +#define OBJ_sbgp_ipAddrBlock 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 7L + +#define SN_sbgp_autonomousSysNum "sbgp-autonomousSysNum" +#define NID_sbgp_autonomousSysNum 291 +#define OBJ_sbgp_autonomousSysNum 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 8L + +#define SN_sbgp_routerIdentifier "sbgp-routerIdentifier" +#define NID_sbgp_routerIdentifier 292 +#define OBJ_sbgp_routerIdentifier 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 9L + +#define SN_textNotice "textNotice" +#define NID_textNotice 293 +#define OBJ_textNotice 1L, 3L, 6L, 1L, 5L, 5L, 7L, 2L, 3L + +#define SN_ipsecEndSystem "ipsecEndSystem" +#define LN_ipsecEndSystem "IPSec End System" +#define NID_ipsecEndSystem 294 +#define OBJ_ipsecEndSystem 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 5L + +#define SN_ipsecTunnel "ipsecTunnel" +#define LN_ipsecTunnel "IPSec Tunnel" +#define NID_ipsecTunnel 295 +#define OBJ_ipsecTunnel 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 6L + +#define SN_ipsecUser "ipsecUser" +#define LN_ipsecUser "IPSec User" +#define NID_ipsecUser 296 +#define OBJ_ipsecUser 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 7L + +#define SN_dvcs "DVCS" +#define LN_dvcs "dvcs" +#define NID_dvcs 297 +#define OBJ_dvcs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 3L, 10L + +#define SN_id_it_caProtEncCert "id-it-caProtEncCert" +#define NID_id_it_caProtEncCert 298 +#define OBJ_id_it_caProtEncCert 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 1L + +#define SN_id_it_signKeyPairTypes "id-it-signKeyPairTypes" +#define NID_id_it_signKeyPairTypes 299 +#define OBJ_id_it_signKeyPairTypes 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 2L + +#define SN_id_it_encKeyPairTypes "id-it-encKeyPairTypes" +#define NID_id_it_encKeyPairTypes 300 +#define OBJ_id_it_encKeyPairTypes 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 3L + +#define SN_id_it_preferredSymmAlg "id-it-preferredSymmAlg" +#define NID_id_it_preferredSymmAlg 301 +#define OBJ_id_it_preferredSymmAlg 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 4L + +#define SN_id_it_caKeyUpdateInfo "id-it-caKeyUpdateInfo" +#define NID_id_it_caKeyUpdateInfo 302 +#define OBJ_id_it_caKeyUpdateInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 5L + +#define SN_id_it_currentCRL "id-it-currentCRL" +#define NID_id_it_currentCRL 303 +#define OBJ_id_it_currentCRL 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 6L + +#define SN_id_it_unsupportedOIDs "id-it-unsupportedOIDs" +#define NID_id_it_unsupportedOIDs 304 +#define OBJ_id_it_unsupportedOIDs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 7L + +#define SN_id_it_subscriptionRequest "id-it-subscriptionRequest" +#define NID_id_it_subscriptionRequest 305 +#define OBJ_id_it_subscriptionRequest 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 8L + +#define SN_id_it_subscriptionResponse "id-it-subscriptionResponse" +#define NID_id_it_subscriptionResponse 306 +#define OBJ_id_it_subscriptionResponse 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 9L + +#define SN_id_it_keyPairParamReq "id-it-keyPairParamReq" +#define NID_id_it_keyPairParamReq 307 +#define OBJ_id_it_keyPairParamReq 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 10L + +#define SN_id_it_keyPairParamRep "id-it-keyPairParamRep" +#define NID_id_it_keyPairParamRep 308 +#define OBJ_id_it_keyPairParamRep 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 11L + +#define SN_id_it_revPassphrase "id-it-revPassphrase" +#define NID_id_it_revPassphrase 309 +#define OBJ_id_it_revPassphrase 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 12L + +#define SN_id_it_implicitConfirm "id-it-implicitConfirm" +#define NID_id_it_implicitConfirm 310 +#define OBJ_id_it_implicitConfirm 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 13L + +#define SN_id_it_confirmWaitTime "id-it-confirmWaitTime" +#define NID_id_it_confirmWaitTime 311 +#define OBJ_id_it_confirmWaitTime 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 14L + +#define SN_id_it_origPKIMessage "id-it-origPKIMessage" +#define NID_id_it_origPKIMessage 312 +#define OBJ_id_it_origPKIMessage 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 15L + +#define SN_id_regCtrl "id-regCtrl" +#define NID_id_regCtrl 313 +#define OBJ_id_regCtrl 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L + +#define SN_id_regInfo "id-regInfo" +#define NID_id_regInfo 314 +#define OBJ_id_regInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 2L + +#define SN_id_regCtrl_regToken "id-regCtrl-regToken" +#define NID_id_regCtrl_regToken 315 +#define OBJ_id_regCtrl_regToken 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L, 1L + +#define SN_id_regCtrl_authenticator "id-regCtrl-authenticator" +#define NID_id_regCtrl_authenticator 316 +#define OBJ_id_regCtrl_authenticator 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L, 2L + +#define SN_id_regCtrl_pkiPublicationInfo "id-regCtrl-pkiPublicationInfo" +#define NID_id_regCtrl_pkiPublicationInfo 317 +#define OBJ_id_regCtrl_pkiPublicationInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L, 3L + +#define SN_id_regCtrl_pkiArchiveOptions "id-regCtrl-pkiArchiveOptions" +#define NID_id_regCtrl_pkiArchiveOptions 318 +#define OBJ_id_regCtrl_pkiArchiveOptions 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L, 4L + +#define SN_id_regCtrl_oldCertID "id-regCtrl-oldCertID" +#define NID_id_regCtrl_oldCertID 319 +#define OBJ_id_regCtrl_oldCertID 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L, 5L + +#define SN_id_regCtrl_protocolEncrKey "id-regCtrl-protocolEncrKey" +#define NID_id_regCtrl_protocolEncrKey 320 +#define OBJ_id_regCtrl_protocolEncrKey 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 1L, 6L + +#define SN_id_regInfo_utf8Pairs "id-regInfo-utf8Pairs" +#define NID_id_regInfo_utf8Pairs 321 +#define OBJ_id_regInfo_utf8Pairs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 2L, 1L + +#define SN_id_regInfo_certReq "id-regInfo-certReq" +#define NID_id_regInfo_certReq 322 +#define OBJ_id_regInfo_certReq 1L, 3L, 6L, 1L, 5L, 5L, 7L, 5L, 2L, 2L + +#define SN_id_alg_des40 "id-alg-des40" +#define NID_id_alg_des40 323 +#define OBJ_id_alg_des40 1L, 3L, 6L, 1L, 5L, 5L, 7L, 6L, 1L + +#define SN_id_alg_noSignature "id-alg-noSignature" +#define NID_id_alg_noSignature 324 +#define OBJ_id_alg_noSignature 1L, 3L, 6L, 1L, 5L, 5L, 7L, 6L, 2L + +#define SN_id_alg_dh_sig_hmac_sha1 "id-alg-dh-sig-hmac-sha1" +#define NID_id_alg_dh_sig_hmac_sha1 325 +#define OBJ_id_alg_dh_sig_hmac_sha1 1L, 3L, 6L, 1L, 5L, 5L, 7L, 6L, 3L + +#define SN_id_alg_dh_pop "id-alg-dh-pop" +#define NID_id_alg_dh_pop 326 +#define OBJ_id_alg_dh_pop 1L, 3L, 6L, 1L, 5L, 5L, 7L, 6L, 4L + +#define SN_id_cmc_statusInfo "id-cmc-statusInfo" +#define NID_id_cmc_statusInfo 327 +#define OBJ_id_cmc_statusInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 1L + +#define SN_id_cmc_identification "id-cmc-identification" +#define NID_id_cmc_identification 328 +#define OBJ_id_cmc_identification 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 2L + +#define SN_id_cmc_identityProof "id-cmc-identityProof" +#define NID_id_cmc_identityProof 329 +#define OBJ_id_cmc_identityProof 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 3L + +#define SN_id_cmc_dataReturn "id-cmc-dataReturn" +#define NID_id_cmc_dataReturn 330 +#define OBJ_id_cmc_dataReturn 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 4L + +#define SN_id_cmc_transactionId "id-cmc-transactionId" +#define NID_id_cmc_transactionId 331 +#define OBJ_id_cmc_transactionId 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 5L + +#define SN_id_cmc_senderNonce "id-cmc-senderNonce" +#define NID_id_cmc_senderNonce 332 +#define OBJ_id_cmc_senderNonce 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 6L + +#define SN_id_cmc_recipientNonce "id-cmc-recipientNonce" +#define NID_id_cmc_recipientNonce 333 +#define OBJ_id_cmc_recipientNonce 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 7L + +#define SN_id_cmc_addExtensions "id-cmc-addExtensions" +#define NID_id_cmc_addExtensions 334 +#define OBJ_id_cmc_addExtensions 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 8L + +#define SN_id_cmc_encryptedPOP "id-cmc-encryptedPOP" +#define NID_id_cmc_encryptedPOP 335 +#define OBJ_id_cmc_encryptedPOP 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 9L + +#define SN_id_cmc_decryptedPOP "id-cmc-decryptedPOP" +#define NID_id_cmc_decryptedPOP 336 +#define OBJ_id_cmc_decryptedPOP 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 10L + +#define SN_id_cmc_lraPOPWitness "id-cmc-lraPOPWitness" +#define NID_id_cmc_lraPOPWitness 337 +#define OBJ_id_cmc_lraPOPWitness 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 11L + +#define SN_id_cmc_getCert "id-cmc-getCert" +#define NID_id_cmc_getCert 338 +#define OBJ_id_cmc_getCert 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 15L + +#define SN_id_cmc_getCRL "id-cmc-getCRL" +#define NID_id_cmc_getCRL 339 +#define OBJ_id_cmc_getCRL 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 16L + +#define SN_id_cmc_revokeRequest "id-cmc-revokeRequest" +#define NID_id_cmc_revokeRequest 340 +#define OBJ_id_cmc_revokeRequest 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 17L + +#define SN_id_cmc_regInfo "id-cmc-regInfo" +#define NID_id_cmc_regInfo 341 +#define OBJ_id_cmc_regInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 18L + +#define SN_id_cmc_responseInfo "id-cmc-responseInfo" +#define NID_id_cmc_responseInfo 342 +#define OBJ_id_cmc_responseInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 19L + +#define SN_id_cmc_queryPending "id-cmc-queryPending" +#define NID_id_cmc_queryPending 343 +#define OBJ_id_cmc_queryPending 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 21L + +#define SN_id_cmc_popLinkRandom "id-cmc-popLinkRandom" +#define NID_id_cmc_popLinkRandom 344 +#define OBJ_id_cmc_popLinkRandom 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 22L + +#define SN_id_cmc_popLinkWitness "id-cmc-popLinkWitness" +#define NID_id_cmc_popLinkWitness 345 +#define OBJ_id_cmc_popLinkWitness 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 23L + +#define SN_id_cmc_confirmCertAcceptance "id-cmc-confirmCertAcceptance" +#define NID_id_cmc_confirmCertAcceptance 346 +#define OBJ_id_cmc_confirmCertAcceptance 1L, 3L, 6L, 1L, 5L, 5L, 7L, 7L, 24L + +#define SN_id_on_personalData "id-on-personalData" +#define NID_id_on_personalData 347 +#define OBJ_id_on_personalData 1L, 3L, 6L, 1L, 5L, 5L, 7L, 8L, 1L + +#define SN_id_pda_dateOfBirth "id-pda-dateOfBirth" +#define NID_id_pda_dateOfBirth 348 +#define OBJ_id_pda_dateOfBirth 1L, 3L, 6L, 1L, 5L, 5L, 7L, 9L, 1L + +#define SN_id_pda_placeOfBirth "id-pda-placeOfBirth" +#define NID_id_pda_placeOfBirth 349 +#define OBJ_id_pda_placeOfBirth 1L, 3L, 6L, 1L, 5L, 5L, 7L, 9L, 2L + +#define SN_id_pda_gender "id-pda-gender" +#define NID_id_pda_gender 351 +#define OBJ_id_pda_gender 1L, 3L, 6L, 1L, 5L, 5L, 7L, 9L, 3L + +#define SN_id_pda_countryOfCitizenship "id-pda-countryOfCitizenship" +#define NID_id_pda_countryOfCitizenship 352 +#define OBJ_id_pda_countryOfCitizenship 1L, 3L, 6L, 1L, 5L, 5L, 7L, 9L, 4L + +#define SN_id_pda_countryOfResidence "id-pda-countryOfResidence" +#define NID_id_pda_countryOfResidence 353 +#define OBJ_id_pda_countryOfResidence 1L, 3L, 6L, 1L, 5L, 5L, 7L, 9L, 5L + +#define SN_id_aca_authenticationInfo "id-aca-authenticationInfo" +#define NID_id_aca_authenticationInfo 354 +#define OBJ_id_aca_authenticationInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L, 1L + +#define SN_id_aca_accessIdentity "id-aca-accessIdentity" +#define NID_id_aca_accessIdentity 355 +#define OBJ_id_aca_accessIdentity 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L, 2L + +#define SN_id_aca_chargingIdentity "id-aca-chargingIdentity" +#define NID_id_aca_chargingIdentity 356 +#define OBJ_id_aca_chargingIdentity 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L, 3L + +#define SN_id_aca_group "id-aca-group" +#define NID_id_aca_group 357 +#define OBJ_id_aca_group 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L, 4L + +#define SN_id_aca_role "id-aca-role" +#define NID_id_aca_role 358 +#define OBJ_id_aca_role 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L, 5L + +#define SN_id_qcs_pkixQCSyntax_v1 "id-qcs-pkixQCSyntax-v1" +#define NID_id_qcs_pkixQCSyntax_v1 359 +#define OBJ_id_qcs_pkixQCSyntax_v1 1L, 3L, 6L, 1L, 5L, 5L, 7L, 11L, 1L + +#define SN_id_cct_crs "id-cct-crs" +#define NID_id_cct_crs 360 +#define OBJ_id_cct_crs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 12L, 1L + +#define SN_id_cct_PKIData "id-cct-PKIData" +#define NID_id_cct_PKIData 361 +#define OBJ_id_cct_PKIData 1L, 3L, 6L, 1L, 5L, 5L, 7L, 12L, 2L + +#define SN_id_cct_PKIResponse "id-cct-PKIResponse" +#define NID_id_cct_PKIResponse 362 +#define OBJ_id_cct_PKIResponse 1L, 3L, 6L, 1L, 5L, 5L, 7L, 12L, 3L + +#define SN_ad_timeStamping "ad_timestamping" +#define LN_ad_timeStamping "AD Time Stamping" +#define NID_ad_timeStamping 363 +#define OBJ_ad_timeStamping 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 3L + +#define SN_ad_dvcs "AD_DVCS" +#define LN_ad_dvcs "ad dvcs" +#define NID_ad_dvcs 364 +#define OBJ_ad_dvcs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 4L + +#define SN_id_pkix_OCSP_basic "basicOCSPResponse" +#define LN_id_pkix_OCSP_basic "Basic OCSP Response" +#define NID_id_pkix_OCSP_basic 365 +#define OBJ_id_pkix_OCSP_basic 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 1L + +#define SN_id_pkix_OCSP_Nonce "Nonce" +#define LN_id_pkix_OCSP_Nonce "OCSP Nonce" +#define NID_id_pkix_OCSP_Nonce 366 +#define OBJ_id_pkix_OCSP_Nonce 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 2L + +#define SN_id_pkix_OCSP_CrlID "CrlID" +#define LN_id_pkix_OCSP_CrlID "OCSP CRL ID" +#define NID_id_pkix_OCSP_CrlID 367 +#define OBJ_id_pkix_OCSP_CrlID 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 3L + +#define SN_id_pkix_OCSP_acceptableResponses "acceptableResponses" +#define LN_id_pkix_OCSP_acceptableResponses "Acceptable OCSP Responses" +#define NID_id_pkix_OCSP_acceptableResponses 368 +#define OBJ_id_pkix_OCSP_acceptableResponses \ + 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 4L + +#define SN_id_pkix_OCSP_noCheck "noCheck" +#define LN_id_pkix_OCSP_noCheck "OCSP No Check" +#define NID_id_pkix_OCSP_noCheck 369 +#define OBJ_id_pkix_OCSP_noCheck 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 5L + +#define SN_id_pkix_OCSP_archiveCutoff "archiveCutoff" +#define LN_id_pkix_OCSP_archiveCutoff "OCSP Archive Cutoff" +#define NID_id_pkix_OCSP_archiveCutoff 370 +#define OBJ_id_pkix_OCSP_archiveCutoff 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 6L + +#define SN_id_pkix_OCSP_serviceLocator "serviceLocator" +#define LN_id_pkix_OCSP_serviceLocator "OCSP Service Locator" +#define NID_id_pkix_OCSP_serviceLocator 371 +#define OBJ_id_pkix_OCSP_serviceLocator 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 7L + +#define SN_id_pkix_OCSP_extendedStatus "extendedStatus" +#define LN_id_pkix_OCSP_extendedStatus "Extended OCSP Status" +#define NID_id_pkix_OCSP_extendedStatus 372 +#define OBJ_id_pkix_OCSP_extendedStatus 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 8L + +#define SN_id_pkix_OCSP_valid "valid" +#define NID_id_pkix_OCSP_valid 373 +#define OBJ_id_pkix_OCSP_valid 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 9L + +#define SN_id_pkix_OCSP_path "path" +#define NID_id_pkix_OCSP_path 374 +#define OBJ_id_pkix_OCSP_path 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 10L + +#define SN_id_pkix_OCSP_trustRoot "trustRoot" +#define LN_id_pkix_OCSP_trustRoot "Trust Root" +#define NID_id_pkix_OCSP_trustRoot 375 +#define OBJ_id_pkix_OCSP_trustRoot 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 1L, 11L + +#define SN_algorithm "algorithm" +#define LN_algorithm "algorithm" +#define NID_algorithm 376 +#define OBJ_algorithm 1L, 3L, 14L, 3L, 2L + +#define SN_rsaSignature "rsaSignature" +#define NID_rsaSignature 377 +#define OBJ_rsaSignature 1L, 3L, 14L, 3L, 2L, 11L + +#define SN_X500algorithms "X500algorithms" +#define LN_X500algorithms "directory services - algorithms" +#define NID_X500algorithms 378 +#define OBJ_X500algorithms 2L, 5L, 8L + +#define SN_org "ORG" +#define LN_org "org" +#define NID_org 379 +#define OBJ_org 1L, 3L + +#define SN_dod "DOD" +#define LN_dod "dod" +#define NID_dod 380 +#define OBJ_dod 1L, 3L, 6L + +#define SN_iana "IANA" +#define LN_iana "iana" +#define NID_iana 381 +#define OBJ_iana 1L, 3L, 6L, 1L + +#define SN_Directory "directory" +#define LN_Directory "Directory" +#define NID_Directory 382 +#define OBJ_Directory 1L, 3L, 6L, 1L, 1L + +#define SN_Management "mgmt" +#define LN_Management "Management" +#define NID_Management 383 +#define OBJ_Management 1L, 3L, 6L, 1L, 2L + +#define SN_Experimental "experimental" +#define LN_Experimental "Experimental" +#define NID_Experimental 384 +#define OBJ_Experimental 1L, 3L, 6L, 1L, 3L + +#define SN_Private "private" +#define LN_Private "Private" +#define NID_Private 385 +#define OBJ_Private 1L, 3L, 6L, 1L, 4L + +#define SN_Security "security" +#define LN_Security "Security" +#define NID_Security 386 +#define OBJ_Security 1L, 3L, 6L, 1L, 5L + +#define SN_SNMPv2 "snmpv2" +#define LN_SNMPv2 "SNMPv2" +#define NID_SNMPv2 387 +#define OBJ_SNMPv2 1L, 3L, 6L, 1L, 6L + +#define LN_Mail "Mail" +#define NID_Mail 388 +#define OBJ_Mail 1L, 3L, 6L, 1L, 7L + +#define SN_Enterprises "enterprises" +#define LN_Enterprises "Enterprises" +#define NID_Enterprises 389 +#define OBJ_Enterprises 1L, 3L, 6L, 1L, 4L, 1L + +#define SN_dcObject "dcobject" +#define LN_dcObject "dcObject" +#define NID_dcObject 390 +#define OBJ_dcObject 1L, 3L, 6L, 1L, 4L, 1L, 1466L, 344L + +#define SN_domainComponent "DC" +#define LN_domainComponent "domainComponent" +#define NID_domainComponent 391 +#define OBJ_domainComponent 0L, 9L, 2342L, 19200300L, 100L, 1L, 25L + +#define SN_Domain "domain" +#define LN_Domain "Domain" +#define NID_Domain 392 +#define OBJ_Domain 0L, 9L, 2342L, 19200300L, 100L, 4L, 13L + +#define SN_selected_attribute_types "selected-attribute-types" +#define LN_selected_attribute_types "Selected Attribute Types" +#define NID_selected_attribute_types 394 +#define OBJ_selected_attribute_types 2L, 5L, 1L, 5L + +#define SN_clearance "clearance" +#define NID_clearance 395 +#define OBJ_clearance 2L, 5L, 1L, 5L, 55L + +#define SN_md4WithRSAEncryption "RSA-MD4" +#define LN_md4WithRSAEncryption "md4WithRSAEncryption" +#define NID_md4WithRSAEncryption 396 +#define OBJ_md4WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 3L + +#define SN_ac_proxying "ac-proxying" +#define NID_ac_proxying 397 +#define OBJ_ac_proxying 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 10L + +#define SN_sinfo_access "subjectInfoAccess" +#define LN_sinfo_access "Subject Information Access" +#define NID_sinfo_access 398 +#define OBJ_sinfo_access 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 11L + +#define SN_id_aca_encAttrs "id-aca-encAttrs" +#define NID_id_aca_encAttrs 399 +#define OBJ_id_aca_encAttrs 1L, 3L, 6L, 1L, 5L, 5L, 7L, 10L, 6L + +#define SN_role "role" +#define LN_role "role" +#define NID_role 400 +#define OBJ_role 2L, 5L, 4L, 72L + +#define SN_policy_constraints "policyConstraints" +#define LN_policy_constraints "X509v3 Policy Constraints" +#define NID_policy_constraints 401 +#define OBJ_policy_constraints 2L, 5L, 29L, 36L + +#define SN_target_information "targetInformation" +#define LN_target_information "X509v3 AC Targeting" +#define NID_target_information 402 +#define OBJ_target_information 2L, 5L, 29L, 55L + +#define SN_no_rev_avail "noRevAvail" +#define LN_no_rev_avail "X509v3 No Revocation Available" +#define NID_no_rev_avail 403 +#define OBJ_no_rev_avail 2L, 5L, 29L, 56L + +#define SN_ansi_X9_62 "ansi-X9-62" +#define LN_ansi_X9_62 "ANSI X9.62" +#define NID_ansi_X9_62 405 +#define OBJ_ansi_X9_62 1L, 2L, 840L, 10045L + +#define SN_X9_62_prime_field "prime-field" +#define NID_X9_62_prime_field 406 +#define OBJ_X9_62_prime_field 1L, 2L, 840L, 10045L, 1L, 1L + +#define SN_X9_62_characteristic_two_field "characteristic-two-field" +#define NID_X9_62_characteristic_two_field 407 +#define OBJ_X9_62_characteristic_two_field 1L, 2L, 840L, 10045L, 1L, 2L + +#define SN_X9_62_id_ecPublicKey "id-ecPublicKey" +#define NID_X9_62_id_ecPublicKey 408 +#define OBJ_X9_62_id_ecPublicKey 1L, 2L, 840L, 10045L, 2L, 1L + +#define SN_X9_62_prime192v1 "prime192v1" +#define NID_X9_62_prime192v1 409 +#define OBJ_X9_62_prime192v1 1L, 2L, 840L, 10045L, 3L, 1L, 1L + +#define SN_X9_62_prime192v2 "prime192v2" +#define NID_X9_62_prime192v2 410 +#define OBJ_X9_62_prime192v2 1L, 2L, 840L, 10045L, 3L, 1L, 2L + +#define SN_X9_62_prime192v3 "prime192v3" +#define NID_X9_62_prime192v3 411 +#define OBJ_X9_62_prime192v3 1L, 2L, 840L, 10045L, 3L, 1L, 3L + +#define SN_X9_62_prime239v1 "prime239v1" +#define NID_X9_62_prime239v1 412 +#define OBJ_X9_62_prime239v1 1L, 2L, 840L, 10045L, 3L, 1L, 4L + +#define SN_X9_62_prime239v2 "prime239v2" +#define NID_X9_62_prime239v2 413 +#define OBJ_X9_62_prime239v2 1L, 2L, 840L, 10045L, 3L, 1L, 5L + +#define SN_X9_62_prime239v3 "prime239v3" +#define NID_X9_62_prime239v3 414 +#define OBJ_X9_62_prime239v3 1L, 2L, 840L, 10045L, 3L, 1L, 6L + +#define SN_X9_62_prime256v1 "prime256v1" +#define NID_X9_62_prime256v1 415 +#define OBJ_X9_62_prime256v1 1L, 2L, 840L, 10045L, 3L, 1L, 7L + +#define SN_ecdsa_with_SHA1 "ecdsa-with-SHA1" +#define NID_ecdsa_with_SHA1 416 +#define OBJ_ecdsa_with_SHA1 1L, 2L, 840L, 10045L, 4L, 1L + +#define SN_ms_csp_name "CSPName" +#define LN_ms_csp_name "Microsoft CSP Name" +#define NID_ms_csp_name 417 +#define OBJ_ms_csp_name 1L, 3L, 6L, 1L, 4L, 1L, 311L, 17L, 1L + +#define SN_aes_128_ecb "AES-128-ECB" +#define LN_aes_128_ecb "aes-128-ecb" +#define NID_aes_128_ecb 418 +#define OBJ_aes_128_ecb 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 1L + +#define SN_aes_128_cbc "AES-128-CBC" +#define LN_aes_128_cbc "aes-128-cbc" +#define NID_aes_128_cbc 419 +#define OBJ_aes_128_cbc 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 2L + +#define SN_aes_128_ofb128 "AES-128-OFB" +#define LN_aes_128_ofb128 "aes-128-ofb" +#define NID_aes_128_ofb128 420 +#define OBJ_aes_128_ofb128 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 3L + +#define SN_aes_128_cfb128 "AES-128-CFB" +#define LN_aes_128_cfb128 "aes-128-cfb" +#define NID_aes_128_cfb128 421 +#define OBJ_aes_128_cfb128 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 4L + +#define SN_aes_192_ecb "AES-192-ECB" +#define LN_aes_192_ecb "aes-192-ecb" +#define NID_aes_192_ecb 422 +#define OBJ_aes_192_ecb 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 21L + +#define SN_aes_192_cbc "AES-192-CBC" +#define LN_aes_192_cbc "aes-192-cbc" +#define NID_aes_192_cbc 423 +#define OBJ_aes_192_cbc 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 22L + +#define SN_aes_192_ofb128 "AES-192-OFB" +#define LN_aes_192_ofb128 "aes-192-ofb" +#define NID_aes_192_ofb128 424 +#define OBJ_aes_192_ofb128 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 23L + +#define SN_aes_192_cfb128 "AES-192-CFB" +#define LN_aes_192_cfb128 "aes-192-cfb" +#define NID_aes_192_cfb128 425 +#define OBJ_aes_192_cfb128 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 24L + +#define SN_aes_256_ecb "AES-256-ECB" +#define LN_aes_256_ecb "aes-256-ecb" +#define NID_aes_256_ecb 426 +#define OBJ_aes_256_ecb 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 41L + +#define SN_aes_256_cbc "AES-256-CBC" +#define LN_aes_256_cbc "aes-256-cbc" +#define NID_aes_256_cbc 427 +#define OBJ_aes_256_cbc 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 42L + +#define SN_aes_256_ofb128 "AES-256-OFB" +#define LN_aes_256_ofb128 "aes-256-ofb" +#define NID_aes_256_ofb128 428 +#define OBJ_aes_256_ofb128 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 43L + +#define SN_aes_256_cfb128 "AES-256-CFB" +#define LN_aes_256_cfb128 "aes-256-cfb" +#define NID_aes_256_cfb128 429 +#define OBJ_aes_256_cfb128 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 44L + +#define SN_hold_instruction_code "holdInstructionCode" +#define LN_hold_instruction_code "Hold Instruction Code" +#define NID_hold_instruction_code 430 +#define OBJ_hold_instruction_code 2L, 5L, 29L, 23L + +#define SN_hold_instruction_none "holdInstructionNone" +#define LN_hold_instruction_none "Hold Instruction None" +#define NID_hold_instruction_none 431 +#define OBJ_hold_instruction_none 1L, 2L, 840L, 10040L, 2L, 1L + +#define SN_hold_instruction_call_issuer "holdInstructionCallIssuer" +#define LN_hold_instruction_call_issuer "Hold Instruction Call Issuer" +#define NID_hold_instruction_call_issuer 432 +#define OBJ_hold_instruction_call_issuer 1L, 2L, 840L, 10040L, 2L, 2L + +#define SN_hold_instruction_reject "holdInstructionReject" +#define LN_hold_instruction_reject "Hold Instruction Reject" +#define NID_hold_instruction_reject 433 +#define OBJ_hold_instruction_reject 1L, 2L, 840L, 10040L, 2L, 3L + +#define SN_data "data" +#define NID_data 434 +#define OBJ_data 0L, 9L + +#define SN_pss "pss" +#define NID_pss 435 +#define OBJ_pss 0L, 9L, 2342L + +#define SN_ucl "ucl" +#define NID_ucl 436 +#define OBJ_ucl 0L, 9L, 2342L, 19200300L + +#define SN_pilot "pilot" +#define NID_pilot 437 +#define OBJ_pilot 0L, 9L, 2342L, 19200300L, 100L + +#define LN_pilotAttributeType "pilotAttributeType" +#define NID_pilotAttributeType 438 +#define OBJ_pilotAttributeType 0L, 9L, 2342L, 19200300L, 100L, 1L + +#define LN_pilotAttributeSyntax "pilotAttributeSyntax" +#define NID_pilotAttributeSyntax 439 +#define OBJ_pilotAttributeSyntax 0L, 9L, 2342L, 19200300L, 100L, 3L + +#define LN_pilotObjectClass "pilotObjectClass" +#define NID_pilotObjectClass 440 +#define OBJ_pilotObjectClass 0L, 9L, 2342L, 19200300L, 100L, 4L + +#define LN_pilotGroups "pilotGroups" +#define NID_pilotGroups 441 +#define OBJ_pilotGroups 0L, 9L, 2342L, 19200300L, 100L, 10L + +#define LN_iA5StringSyntax "iA5StringSyntax" +#define NID_iA5StringSyntax 442 +#define OBJ_iA5StringSyntax 0L, 9L, 2342L, 19200300L, 100L, 3L, 4L + +#define LN_caseIgnoreIA5StringSyntax "caseIgnoreIA5StringSyntax" +#define NID_caseIgnoreIA5StringSyntax 443 +#define OBJ_caseIgnoreIA5StringSyntax 0L, 9L, 2342L, 19200300L, 100L, 3L, 5L + +#define LN_pilotObject "pilotObject" +#define NID_pilotObject 444 +#define OBJ_pilotObject 0L, 9L, 2342L, 19200300L, 100L, 4L, 3L + +#define LN_pilotPerson "pilotPerson" +#define NID_pilotPerson 445 +#define OBJ_pilotPerson 0L, 9L, 2342L, 19200300L, 100L, 4L, 4L + +#define SN_account "account" +#define NID_account 446 +#define OBJ_account 0L, 9L, 2342L, 19200300L, 100L, 4L, 5L + +#define SN_document "document" +#define NID_document 447 +#define OBJ_document 0L, 9L, 2342L, 19200300L, 100L, 4L, 6L + +#define SN_room "room" +#define NID_room 448 +#define OBJ_room 0L, 9L, 2342L, 19200300L, 100L, 4L, 7L + +#define LN_documentSeries "documentSeries" +#define NID_documentSeries 449 +#define OBJ_documentSeries 0L, 9L, 2342L, 19200300L, 100L, 4L, 9L + +#define LN_rFC822localPart "rFC822localPart" +#define NID_rFC822localPart 450 +#define OBJ_rFC822localPart 0L, 9L, 2342L, 19200300L, 100L, 4L, 14L + +#define LN_dNSDomain "dNSDomain" +#define NID_dNSDomain 451 +#define OBJ_dNSDomain 0L, 9L, 2342L, 19200300L, 100L, 4L, 15L + +#define LN_domainRelatedObject "domainRelatedObject" +#define NID_domainRelatedObject 452 +#define OBJ_domainRelatedObject 0L, 9L, 2342L, 19200300L, 100L, 4L, 17L + +#define LN_friendlyCountry "friendlyCountry" +#define NID_friendlyCountry 453 +#define OBJ_friendlyCountry 0L, 9L, 2342L, 19200300L, 100L, 4L, 18L + +#define LN_simpleSecurityObject "simpleSecurityObject" +#define NID_simpleSecurityObject 454 +#define OBJ_simpleSecurityObject 0L, 9L, 2342L, 19200300L, 100L, 4L, 19L + +#define LN_pilotOrganization "pilotOrganization" +#define NID_pilotOrganization 455 +#define OBJ_pilotOrganization 0L, 9L, 2342L, 19200300L, 100L, 4L, 20L + +#define LN_pilotDSA "pilotDSA" +#define NID_pilotDSA 456 +#define OBJ_pilotDSA 0L, 9L, 2342L, 19200300L, 100L, 4L, 21L + +#define LN_qualityLabelledData "qualityLabelledData" +#define NID_qualityLabelledData 457 +#define OBJ_qualityLabelledData 0L, 9L, 2342L, 19200300L, 100L, 4L, 22L + +#define SN_userId "UID" +#define LN_userId "userId" +#define NID_userId 458 +#define OBJ_userId 0L, 9L, 2342L, 19200300L, 100L, 1L, 1L + +#define LN_textEncodedORAddress "textEncodedORAddress" +#define NID_textEncodedORAddress 459 +#define OBJ_textEncodedORAddress 0L, 9L, 2342L, 19200300L, 100L, 1L, 2L + +#define SN_rfc822Mailbox "mail" +#define LN_rfc822Mailbox "rfc822Mailbox" +#define NID_rfc822Mailbox 460 +#define OBJ_rfc822Mailbox 0L, 9L, 2342L, 19200300L, 100L, 1L, 3L + +#define SN_info "info" +#define NID_info 461 +#define OBJ_info 0L, 9L, 2342L, 19200300L, 100L, 1L, 4L + +#define LN_favouriteDrink "favouriteDrink" +#define NID_favouriteDrink 462 +#define OBJ_favouriteDrink 0L, 9L, 2342L, 19200300L, 100L, 1L, 5L + +#define LN_roomNumber "roomNumber" +#define NID_roomNumber 463 +#define OBJ_roomNumber 0L, 9L, 2342L, 19200300L, 100L, 1L, 6L + +#define SN_photo "photo" +#define NID_photo 464 +#define OBJ_photo 0L, 9L, 2342L, 19200300L, 100L, 1L, 7L + +#define LN_userClass "userClass" +#define NID_userClass 465 +#define OBJ_userClass 0L, 9L, 2342L, 19200300L, 100L, 1L, 8L + +#define SN_host "host" +#define NID_host 466 +#define OBJ_host 0L, 9L, 2342L, 19200300L, 100L, 1L, 9L + +#define SN_manager "manager" +#define NID_manager 467 +#define OBJ_manager 0L, 9L, 2342L, 19200300L, 100L, 1L, 10L + +#define LN_documentIdentifier "documentIdentifier" +#define NID_documentIdentifier 468 +#define OBJ_documentIdentifier 0L, 9L, 2342L, 19200300L, 100L, 1L, 11L + +#define LN_documentTitle "documentTitle" +#define NID_documentTitle 469 +#define OBJ_documentTitle 0L, 9L, 2342L, 19200300L, 100L, 1L, 12L + +#define LN_documentVersion "documentVersion" +#define NID_documentVersion 470 +#define OBJ_documentVersion 0L, 9L, 2342L, 19200300L, 100L, 1L, 13L + +#define LN_documentAuthor "documentAuthor" +#define NID_documentAuthor 471 +#define OBJ_documentAuthor 0L, 9L, 2342L, 19200300L, 100L, 1L, 14L + +#define LN_documentLocation "documentLocation" +#define NID_documentLocation 472 +#define OBJ_documentLocation 0L, 9L, 2342L, 19200300L, 100L, 1L, 15L + +#define LN_homeTelephoneNumber "homeTelephoneNumber" +#define NID_homeTelephoneNumber 473 +#define OBJ_homeTelephoneNumber 0L, 9L, 2342L, 19200300L, 100L, 1L, 20L + +#define SN_secretary "secretary" +#define NID_secretary 474 +#define OBJ_secretary 0L, 9L, 2342L, 19200300L, 100L, 1L, 21L + +#define LN_otherMailbox "otherMailbox" +#define NID_otherMailbox 475 +#define OBJ_otherMailbox 0L, 9L, 2342L, 19200300L, 100L, 1L, 22L + +#define LN_lastModifiedTime "lastModifiedTime" +#define NID_lastModifiedTime 476 +#define OBJ_lastModifiedTime 0L, 9L, 2342L, 19200300L, 100L, 1L, 23L + +#define LN_lastModifiedBy "lastModifiedBy" +#define NID_lastModifiedBy 477 +#define OBJ_lastModifiedBy 0L, 9L, 2342L, 19200300L, 100L, 1L, 24L + +#define LN_aRecord "aRecord" +#define NID_aRecord 478 +#define OBJ_aRecord 0L, 9L, 2342L, 19200300L, 100L, 1L, 26L + +#define LN_pilotAttributeType27 "pilotAttributeType27" +#define NID_pilotAttributeType27 479 +#define OBJ_pilotAttributeType27 0L, 9L, 2342L, 19200300L, 100L, 1L, 27L + +#define LN_mXRecord "mXRecord" +#define NID_mXRecord 480 +#define OBJ_mXRecord 0L, 9L, 2342L, 19200300L, 100L, 1L, 28L + +#define LN_nSRecord "nSRecord" +#define NID_nSRecord 481 +#define OBJ_nSRecord 0L, 9L, 2342L, 19200300L, 100L, 1L, 29L + +#define LN_sOARecord "sOARecord" +#define NID_sOARecord 482 +#define OBJ_sOARecord 0L, 9L, 2342L, 19200300L, 100L, 1L, 30L + +#define LN_cNAMERecord "cNAMERecord" +#define NID_cNAMERecord 483 +#define OBJ_cNAMERecord 0L, 9L, 2342L, 19200300L, 100L, 1L, 31L + +#define LN_associatedDomain "associatedDomain" +#define NID_associatedDomain 484 +#define OBJ_associatedDomain 0L, 9L, 2342L, 19200300L, 100L, 1L, 37L + +#define LN_associatedName "associatedName" +#define NID_associatedName 485 +#define OBJ_associatedName 0L, 9L, 2342L, 19200300L, 100L, 1L, 38L + +#define LN_homePostalAddress "homePostalAddress" +#define NID_homePostalAddress 486 +#define OBJ_homePostalAddress 0L, 9L, 2342L, 19200300L, 100L, 1L, 39L + +#define LN_personalTitle "personalTitle" +#define NID_personalTitle 487 +#define OBJ_personalTitle 0L, 9L, 2342L, 19200300L, 100L, 1L, 40L + +#define LN_mobileTelephoneNumber "mobileTelephoneNumber" +#define NID_mobileTelephoneNumber 488 +#define OBJ_mobileTelephoneNumber 0L, 9L, 2342L, 19200300L, 100L, 1L, 41L + +#define LN_pagerTelephoneNumber "pagerTelephoneNumber" +#define NID_pagerTelephoneNumber 489 +#define OBJ_pagerTelephoneNumber 0L, 9L, 2342L, 19200300L, 100L, 1L, 42L + +#define LN_friendlyCountryName "friendlyCountryName" +#define NID_friendlyCountryName 490 +#define OBJ_friendlyCountryName 0L, 9L, 2342L, 19200300L, 100L, 1L, 43L + +#define LN_organizationalStatus "organizationalStatus" +#define NID_organizationalStatus 491 +#define OBJ_organizationalStatus 0L, 9L, 2342L, 19200300L, 100L, 1L, 45L + +#define LN_janetMailbox "janetMailbox" +#define NID_janetMailbox 492 +#define OBJ_janetMailbox 0L, 9L, 2342L, 19200300L, 100L, 1L, 46L + +#define LN_mailPreferenceOption "mailPreferenceOption" +#define NID_mailPreferenceOption 493 +#define OBJ_mailPreferenceOption 0L, 9L, 2342L, 19200300L, 100L, 1L, 47L + +#define LN_buildingName "buildingName" +#define NID_buildingName 494 +#define OBJ_buildingName 0L, 9L, 2342L, 19200300L, 100L, 1L, 48L + +#define LN_dSAQuality "dSAQuality" +#define NID_dSAQuality 495 +#define OBJ_dSAQuality 0L, 9L, 2342L, 19200300L, 100L, 1L, 49L + +#define LN_singleLevelQuality "singleLevelQuality" +#define NID_singleLevelQuality 496 +#define OBJ_singleLevelQuality 0L, 9L, 2342L, 19200300L, 100L, 1L, 50L + +#define LN_subtreeMinimumQuality "subtreeMinimumQuality" +#define NID_subtreeMinimumQuality 497 +#define OBJ_subtreeMinimumQuality 0L, 9L, 2342L, 19200300L, 100L, 1L, 51L + +#define LN_subtreeMaximumQuality "subtreeMaximumQuality" +#define NID_subtreeMaximumQuality 498 +#define OBJ_subtreeMaximumQuality 0L, 9L, 2342L, 19200300L, 100L, 1L, 52L + +#define LN_personalSignature "personalSignature" +#define NID_personalSignature 499 +#define OBJ_personalSignature 0L, 9L, 2342L, 19200300L, 100L, 1L, 53L + +#define LN_dITRedirect "dITRedirect" +#define NID_dITRedirect 500 +#define OBJ_dITRedirect 0L, 9L, 2342L, 19200300L, 100L, 1L, 54L + +#define SN_audio "audio" +#define NID_audio 501 +#define OBJ_audio 0L, 9L, 2342L, 19200300L, 100L, 1L, 55L + +#define LN_documentPublisher "documentPublisher" +#define NID_documentPublisher 502 +#define OBJ_documentPublisher 0L, 9L, 2342L, 19200300L, 100L, 1L, 56L + +#define LN_x500UniqueIdentifier "x500UniqueIdentifier" +#define NID_x500UniqueIdentifier 503 +#define OBJ_x500UniqueIdentifier 2L, 5L, 4L, 45L + +#define SN_mime_mhs "mime-mhs" +#define LN_mime_mhs "MIME MHS" +#define NID_mime_mhs 504 +#define OBJ_mime_mhs 1L, 3L, 6L, 1L, 7L, 1L + +#define SN_mime_mhs_headings "mime-mhs-headings" +#define LN_mime_mhs_headings "mime-mhs-headings" +#define NID_mime_mhs_headings 505 +#define OBJ_mime_mhs_headings 1L, 3L, 6L, 1L, 7L, 1L, 1L + +#define SN_mime_mhs_bodies "mime-mhs-bodies" +#define LN_mime_mhs_bodies "mime-mhs-bodies" +#define NID_mime_mhs_bodies 506 +#define OBJ_mime_mhs_bodies 1L, 3L, 6L, 1L, 7L, 1L, 2L + +#define SN_id_hex_partial_message "id-hex-partial-message" +#define LN_id_hex_partial_message "id-hex-partial-message" +#define NID_id_hex_partial_message 507 +#define OBJ_id_hex_partial_message 1L, 3L, 6L, 1L, 7L, 1L, 1L, 1L + +#define SN_id_hex_multipart_message "id-hex-multipart-message" +#define LN_id_hex_multipart_message "id-hex-multipart-message" +#define NID_id_hex_multipart_message 508 +#define OBJ_id_hex_multipart_message 1L, 3L, 6L, 1L, 7L, 1L, 1L, 2L + +#define LN_generationQualifier "generationQualifier" +#define NID_generationQualifier 509 +#define OBJ_generationQualifier 2L, 5L, 4L, 44L + +#define LN_pseudonym "pseudonym" +#define NID_pseudonym 510 +#define OBJ_pseudonym 2L, 5L, 4L, 65L + +#define SN_id_set "id-set" +#define LN_id_set "Secure Electronic Transactions" +#define NID_id_set 512 +#define OBJ_id_set 2L, 23L, 42L + +#define SN_set_ctype "set-ctype" +#define LN_set_ctype "content types" +#define NID_set_ctype 513 +#define OBJ_set_ctype 2L, 23L, 42L, 0L + +#define SN_set_msgExt "set-msgExt" +#define LN_set_msgExt "message extensions" +#define NID_set_msgExt 514 +#define OBJ_set_msgExt 2L, 23L, 42L, 1L + +#define SN_set_attr "set-attr" +#define NID_set_attr 515 +#define OBJ_set_attr 2L, 23L, 42L, 3L + +#define SN_set_policy "set-policy" +#define NID_set_policy 516 +#define OBJ_set_policy 2L, 23L, 42L, 5L + +#define SN_set_certExt "set-certExt" +#define LN_set_certExt "certificate extensions" +#define NID_set_certExt 517 +#define OBJ_set_certExt 2L, 23L, 42L, 7L + +#define SN_set_brand "set-brand" +#define NID_set_brand 518 +#define OBJ_set_brand 2L, 23L, 42L, 8L + +#define SN_setct_PANData "setct-PANData" +#define NID_setct_PANData 519 +#define OBJ_setct_PANData 2L, 23L, 42L, 0L, 0L + +#define SN_setct_PANToken "setct-PANToken" +#define NID_setct_PANToken 520 +#define OBJ_setct_PANToken 2L, 23L, 42L, 0L, 1L + +#define SN_setct_PANOnly "setct-PANOnly" +#define NID_setct_PANOnly 521 +#define OBJ_setct_PANOnly 2L, 23L, 42L, 0L, 2L + +#define SN_setct_OIData "setct-OIData" +#define NID_setct_OIData 522 +#define OBJ_setct_OIData 2L, 23L, 42L, 0L, 3L + +#define SN_setct_PI "setct-PI" +#define NID_setct_PI 523 +#define OBJ_setct_PI 2L, 23L, 42L, 0L, 4L + +#define SN_setct_PIData "setct-PIData" +#define NID_setct_PIData 524 +#define OBJ_setct_PIData 2L, 23L, 42L, 0L, 5L + +#define SN_setct_PIDataUnsigned "setct-PIDataUnsigned" +#define NID_setct_PIDataUnsigned 525 +#define OBJ_setct_PIDataUnsigned 2L, 23L, 42L, 0L, 6L + +#define SN_setct_HODInput "setct-HODInput" +#define NID_setct_HODInput 526 +#define OBJ_setct_HODInput 2L, 23L, 42L, 0L, 7L + +#define SN_setct_AuthResBaggage "setct-AuthResBaggage" +#define NID_setct_AuthResBaggage 527 +#define OBJ_setct_AuthResBaggage 2L, 23L, 42L, 0L, 8L + +#define SN_setct_AuthRevReqBaggage "setct-AuthRevReqBaggage" +#define NID_setct_AuthRevReqBaggage 528 +#define OBJ_setct_AuthRevReqBaggage 2L, 23L, 42L, 0L, 9L + +#define SN_setct_AuthRevResBaggage "setct-AuthRevResBaggage" +#define NID_setct_AuthRevResBaggage 529 +#define OBJ_setct_AuthRevResBaggage 2L, 23L, 42L, 0L, 10L + +#define SN_setct_CapTokenSeq "setct-CapTokenSeq" +#define NID_setct_CapTokenSeq 530 +#define OBJ_setct_CapTokenSeq 2L, 23L, 42L, 0L, 11L + +#define SN_setct_PInitResData "setct-PInitResData" +#define NID_setct_PInitResData 531 +#define OBJ_setct_PInitResData 2L, 23L, 42L, 0L, 12L + +#define SN_setct_PI_TBS "setct-PI-TBS" +#define NID_setct_PI_TBS 532 +#define OBJ_setct_PI_TBS 2L, 23L, 42L, 0L, 13L + +#define SN_setct_PResData "setct-PResData" +#define NID_setct_PResData 533 +#define OBJ_setct_PResData 2L, 23L, 42L, 0L, 14L + +#define SN_setct_AuthReqTBS "setct-AuthReqTBS" +#define NID_setct_AuthReqTBS 534 +#define OBJ_setct_AuthReqTBS 2L, 23L, 42L, 0L, 16L + +#define SN_setct_AuthResTBS "setct-AuthResTBS" +#define NID_setct_AuthResTBS 535 +#define OBJ_setct_AuthResTBS 2L, 23L, 42L, 0L, 17L + +#define SN_setct_AuthResTBSX "setct-AuthResTBSX" +#define NID_setct_AuthResTBSX 536 +#define OBJ_setct_AuthResTBSX 2L, 23L, 42L, 0L, 18L + +#define SN_setct_AuthTokenTBS "setct-AuthTokenTBS" +#define NID_setct_AuthTokenTBS 537 +#define OBJ_setct_AuthTokenTBS 2L, 23L, 42L, 0L, 19L + +#define SN_setct_CapTokenData "setct-CapTokenData" +#define NID_setct_CapTokenData 538 +#define OBJ_setct_CapTokenData 2L, 23L, 42L, 0L, 20L + +#define SN_setct_CapTokenTBS "setct-CapTokenTBS" +#define NID_setct_CapTokenTBS 539 +#define OBJ_setct_CapTokenTBS 2L, 23L, 42L, 0L, 21L + +#define SN_setct_AcqCardCodeMsg "setct-AcqCardCodeMsg" +#define NID_setct_AcqCardCodeMsg 540 +#define OBJ_setct_AcqCardCodeMsg 2L, 23L, 42L, 0L, 22L + +#define SN_setct_AuthRevReqTBS "setct-AuthRevReqTBS" +#define NID_setct_AuthRevReqTBS 541 +#define OBJ_setct_AuthRevReqTBS 2L, 23L, 42L, 0L, 23L + +#define SN_setct_AuthRevResData "setct-AuthRevResData" +#define NID_setct_AuthRevResData 542 +#define OBJ_setct_AuthRevResData 2L, 23L, 42L, 0L, 24L + +#define SN_setct_AuthRevResTBS "setct-AuthRevResTBS" +#define NID_setct_AuthRevResTBS 543 +#define OBJ_setct_AuthRevResTBS 2L, 23L, 42L, 0L, 25L + +#define SN_setct_CapReqTBS "setct-CapReqTBS" +#define NID_setct_CapReqTBS 544 +#define OBJ_setct_CapReqTBS 2L, 23L, 42L, 0L, 26L + +#define SN_setct_CapReqTBSX "setct-CapReqTBSX" +#define NID_setct_CapReqTBSX 545 +#define OBJ_setct_CapReqTBSX 2L, 23L, 42L, 0L, 27L + +#define SN_setct_CapResData "setct-CapResData" +#define NID_setct_CapResData 546 +#define OBJ_setct_CapResData 2L, 23L, 42L, 0L, 28L + +#define SN_setct_CapRevReqTBS "setct-CapRevReqTBS" +#define NID_setct_CapRevReqTBS 547 +#define OBJ_setct_CapRevReqTBS 2L, 23L, 42L, 0L, 29L + +#define SN_setct_CapRevReqTBSX "setct-CapRevReqTBSX" +#define NID_setct_CapRevReqTBSX 548 +#define OBJ_setct_CapRevReqTBSX 2L, 23L, 42L, 0L, 30L + +#define SN_setct_CapRevResData "setct-CapRevResData" +#define NID_setct_CapRevResData 549 +#define OBJ_setct_CapRevResData 2L, 23L, 42L, 0L, 31L + +#define SN_setct_CredReqTBS "setct-CredReqTBS" +#define NID_setct_CredReqTBS 550 +#define OBJ_setct_CredReqTBS 2L, 23L, 42L, 0L, 32L + +#define SN_setct_CredReqTBSX "setct-CredReqTBSX" +#define NID_setct_CredReqTBSX 551 +#define OBJ_setct_CredReqTBSX 2L, 23L, 42L, 0L, 33L + +#define SN_setct_CredResData "setct-CredResData" +#define NID_setct_CredResData 552 +#define OBJ_setct_CredResData 2L, 23L, 42L, 0L, 34L + +#define SN_setct_CredRevReqTBS "setct-CredRevReqTBS" +#define NID_setct_CredRevReqTBS 553 +#define OBJ_setct_CredRevReqTBS 2L, 23L, 42L, 0L, 35L + +#define SN_setct_CredRevReqTBSX "setct-CredRevReqTBSX" +#define NID_setct_CredRevReqTBSX 554 +#define OBJ_setct_CredRevReqTBSX 2L, 23L, 42L, 0L, 36L + +#define SN_setct_CredRevResData "setct-CredRevResData" +#define NID_setct_CredRevResData 555 +#define OBJ_setct_CredRevResData 2L, 23L, 42L, 0L, 37L + +#define SN_setct_PCertReqData "setct-PCertReqData" +#define NID_setct_PCertReqData 556 +#define OBJ_setct_PCertReqData 2L, 23L, 42L, 0L, 38L + +#define SN_setct_PCertResTBS "setct-PCertResTBS" +#define NID_setct_PCertResTBS 557 +#define OBJ_setct_PCertResTBS 2L, 23L, 42L, 0L, 39L + +#define SN_setct_BatchAdminReqData "setct-BatchAdminReqData" +#define NID_setct_BatchAdminReqData 558 +#define OBJ_setct_BatchAdminReqData 2L, 23L, 42L, 0L, 40L + +#define SN_setct_BatchAdminResData "setct-BatchAdminResData" +#define NID_setct_BatchAdminResData 559 +#define OBJ_setct_BatchAdminResData 2L, 23L, 42L, 0L, 41L + +#define SN_setct_CardCInitResTBS "setct-CardCInitResTBS" +#define NID_setct_CardCInitResTBS 560 +#define OBJ_setct_CardCInitResTBS 2L, 23L, 42L, 0L, 42L + +#define SN_setct_MeAqCInitResTBS "setct-MeAqCInitResTBS" +#define NID_setct_MeAqCInitResTBS 561 +#define OBJ_setct_MeAqCInitResTBS 2L, 23L, 42L, 0L, 43L + +#define SN_setct_RegFormResTBS "setct-RegFormResTBS" +#define NID_setct_RegFormResTBS 562 +#define OBJ_setct_RegFormResTBS 2L, 23L, 42L, 0L, 44L + +#define SN_setct_CertReqData "setct-CertReqData" +#define NID_setct_CertReqData 563 +#define OBJ_setct_CertReqData 2L, 23L, 42L, 0L, 45L + +#define SN_setct_CertReqTBS "setct-CertReqTBS" +#define NID_setct_CertReqTBS 564 +#define OBJ_setct_CertReqTBS 2L, 23L, 42L, 0L, 46L + +#define SN_setct_CertResData "setct-CertResData" +#define NID_setct_CertResData 565 +#define OBJ_setct_CertResData 2L, 23L, 42L, 0L, 47L + +#define SN_setct_CertInqReqTBS "setct-CertInqReqTBS" +#define NID_setct_CertInqReqTBS 566 +#define OBJ_setct_CertInqReqTBS 2L, 23L, 42L, 0L, 48L + +#define SN_setct_ErrorTBS "setct-ErrorTBS" +#define NID_setct_ErrorTBS 567 +#define OBJ_setct_ErrorTBS 2L, 23L, 42L, 0L, 49L + +#define SN_setct_PIDualSignedTBE "setct-PIDualSignedTBE" +#define NID_setct_PIDualSignedTBE 568 +#define OBJ_setct_PIDualSignedTBE 2L, 23L, 42L, 0L, 50L + +#define SN_setct_PIUnsignedTBE "setct-PIUnsignedTBE" +#define NID_setct_PIUnsignedTBE 569 +#define OBJ_setct_PIUnsignedTBE 2L, 23L, 42L, 0L, 51L + +#define SN_setct_AuthReqTBE "setct-AuthReqTBE" +#define NID_setct_AuthReqTBE 570 +#define OBJ_setct_AuthReqTBE 2L, 23L, 42L, 0L, 52L + +#define SN_setct_AuthResTBE "setct-AuthResTBE" +#define NID_setct_AuthResTBE 571 +#define OBJ_setct_AuthResTBE 2L, 23L, 42L, 0L, 53L + +#define SN_setct_AuthResTBEX "setct-AuthResTBEX" +#define NID_setct_AuthResTBEX 572 +#define OBJ_setct_AuthResTBEX 2L, 23L, 42L, 0L, 54L + +#define SN_setct_AuthTokenTBE "setct-AuthTokenTBE" +#define NID_setct_AuthTokenTBE 573 +#define OBJ_setct_AuthTokenTBE 2L, 23L, 42L, 0L, 55L + +#define SN_setct_CapTokenTBE "setct-CapTokenTBE" +#define NID_setct_CapTokenTBE 574 +#define OBJ_setct_CapTokenTBE 2L, 23L, 42L, 0L, 56L + +#define SN_setct_CapTokenTBEX "setct-CapTokenTBEX" +#define NID_setct_CapTokenTBEX 575 +#define OBJ_setct_CapTokenTBEX 2L, 23L, 42L, 0L, 57L + +#define SN_setct_AcqCardCodeMsgTBE "setct-AcqCardCodeMsgTBE" +#define NID_setct_AcqCardCodeMsgTBE 576 +#define OBJ_setct_AcqCardCodeMsgTBE 2L, 23L, 42L, 0L, 58L + +#define SN_setct_AuthRevReqTBE "setct-AuthRevReqTBE" +#define NID_setct_AuthRevReqTBE 577 +#define OBJ_setct_AuthRevReqTBE 2L, 23L, 42L, 0L, 59L + +#define SN_setct_AuthRevResTBE "setct-AuthRevResTBE" +#define NID_setct_AuthRevResTBE 578 +#define OBJ_setct_AuthRevResTBE 2L, 23L, 42L, 0L, 60L + +#define SN_setct_AuthRevResTBEB "setct-AuthRevResTBEB" +#define NID_setct_AuthRevResTBEB 579 +#define OBJ_setct_AuthRevResTBEB 2L, 23L, 42L, 0L, 61L + +#define SN_setct_CapReqTBE "setct-CapReqTBE" +#define NID_setct_CapReqTBE 580 +#define OBJ_setct_CapReqTBE 2L, 23L, 42L, 0L, 62L + +#define SN_setct_CapReqTBEX "setct-CapReqTBEX" +#define NID_setct_CapReqTBEX 581 +#define OBJ_setct_CapReqTBEX 2L, 23L, 42L, 0L, 63L + +#define SN_setct_CapResTBE "setct-CapResTBE" +#define NID_setct_CapResTBE 582 +#define OBJ_setct_CapResTBE 2L, 23L, 42L, 0L, 64L + +#define SN_setct_CapRevReqTBE "setct-CapRevReqTBE" +#define NID_setct_CapRevReqTBE 583 +#define OBJ_setct_CapRevReqTBE 2L, 23L, 42L, 0L, 65L + +#define SN_setct_CapRevReqTBEX "setct-CapRevReqTBEX" +#define NID_setct_CapRevReqTBEX 584 +#define OBJ_setct_CapRevReqTBEX 2L, 23L, 42L, 0L, 66L + +#define SN_setct_CapRevResTBE "setct-CapRevResTBE" +#define NID_setct_CapRevResTBE 585 +#define OBJ_setct_CapRevResTBE 2L, 23L, 42L, 0L, 67L + +#define SN_setct_CredReqTBE "setct-CredReqTBE" +#define NID_setct_CredReqTBE 586 +#define OBJ_setct_CredReqTBE 2L, 23L, 42L, 0L, 68L + +#define SN_setct_CredReqTBEX "setct-CredReqTBEX" +#define NID_setct_CredReqTBEX 587 +#define OBJ_setct_CredReqTBEX 2L, 23L, 42L, 0L, 69L + +#define SN_setct_CredResTBE "setct-CredResTBE" +#define NID_setct_CredResTBE 588 +#define OBJ_setct_CredResTBE 2L, 23L, 42L, 0L, 70L + +#define SN_setct_CredRevReqTBE "setct-CredRevReqTBE" +#define NID_setct_CredRevReqTBE 589 +#define OBJ_setct_CredRevReqTBE 2L, 23L, 42L, 0L, 71L + +#define SN_setct_CredRevReqTBEX "setct-CredRevReqTBEX" +#define NID_setct_CredRevReqTBEX 590 +#define OBJ_setct_CredRevReqTBEX 2L, 23L, 42L, 0L, 72L + +#define SN_setct_CredRevResTBE "setct-CredRevResTBE" +#define NID_setct_CredRevResTBE 591 +#define OBJ_setct_CredRevResTBE 2L, 23L, 42L, 0L, 73L + +#define SN_setct_BatchAdminReqTBE "setct-BatchAdminReqTBE" +#define NID_setct_BatchAdminReqTBE 592 +#define OBJ_setct_BatchAdminReqTBE 2L, 23L, 42L, 0L, 74L + +#define SN_setct_BatchAdminResTBE "setct-BatchAdminResTBE" +#define NID_setct_BatchAdminResTBE 593 +#define OBJ_setct_BatchAdminResTBE 2L, 23L, 42L, 0L, 75L + +#define SN_setct_RegFormReqTBE "setct-RegFormReqTBE" +#define NID_setct_RegFormReqTBE 594 +#define OBJ_setct_RegFormReqTBE 2L, 23L, 42L, 0L, 76L + +#define SN_setct_CertReqTBE "setct-CertReqTBE" +#define NID_setct_CertReqTBE 595 +#define OBJ_setct_CertReqTBE 2L, 23L, 42L, 0L, 77L + +#define SN_setct_CertReqTBEX "setct-CertReqTBEX" +#define NID_setct_CertReqTBEX 596 +#define OBJ_setct_CertReqTBEX 2L, 23L, 42L, 0L, 78L + +#define SN_setct_CertResTBE "setct-CertResTBE" +#define NID_setct_CertResTBE 597 +#define OBJ_setct_CertResTBE 2L, 23L, 42L, 0L, 79L + +#define SN_setct_CRLNotificationTBS "setct-CRLNotificationTBS" +#define NID_setct_CRLNotificationTBS 598 +#define OBJ_setct_CRLNotificationTBS 2L, 23L, 42L, 0L, 80L + +#define SN_setct_CRLNotificationResTBS "setct-CRLNotificationResTBS" +#define NID_setct_CRLNotificationResTBS 599 +#define OBJ_setct_CRLNotificationResTBS 2L, 23L, 42L, 0L, 81L + +#define SN_setct_BCIDistributionTBS "setct-BCIDistributionTBS" +#define NID_setct_BCIDistributionTBS 600 +#define OBJ_setct_BCIDistributionTBS 2L, 23L, 42L, 0L, 82L + +#define SN_setext_genCrypt "setext-genCrypt" +#define LN_setext_genCrypt "generic cryptogram" +#define NID_setext_genCrypt 601 +#define OBJ_setext_genCrypt 2L, 23L, 42L, 1L, 1L + +#define SN_setext_miAuth "setext-miAuth" +#define LN_setext_miAuth "merchant initiated auth" +#define NID_setext_miAuth 602 +#define OBJ_setext_miAuth 2L, 23L, 42L, 1L, 3L + +#define SN_setext_pinSecure "setext-pinSecure" +#define NID_setext_pinSecure 603 +#define OBJ_setext_pinSecure 2L, 23L, 42L, 1L, 4L + +#define SN_setext_pinAny "setext-pinAny" +#define NID_setext_pinAny 604 +#define OBJ_setext_pinAny 2L, 23L, 42L, 1L, 5L + +#define SN_setext_track2 "setext-track2" +#define NID_setext_track2 605 +#define OBJ_setext_track2 2L, 23L, 42L, 1L, 7L + +#define SN_setext_cv "setext-cv" +#define LN_setext_cv "additional verification" +#define NID_setext_cv 606 +#define OBJ_setext_cv 2L, 23L, 42L, 1L, 8L + +#define SN_set_policy_root "set-policy-root" +#define NID_set_policy_root 607 +#define OBJ_set_policy_root 2L, 23L, 42L, 5L, 0L + +#define SN_setCext_hashedRoot "setCext-hashedRoot" +#define NID_setCext_hashedRoot 608 +#define OBJ_setCext_hashedRoot 2L, 23L, 42L, 7L, 0L + +#define SN_setCext_certType "setCext-certType" +#define NID_setCext_certType 609 +#define OBJ_setCext_certType 2L, 23L, 42L, 7L, 1L + +#define SN_setCext_merchData "setCext-merchData" +#define NID_setCext_merchData 610 +#define OBJ_setCext_merchData 2L, 23L, 42L, 7L, 2L + +#define SN_setCext_cCertRequired "setCext-cCertRequired" +#define NID_setCext_cCertRequired 611 +#define OBJ_setCext_cCertRequired 2L, 23L, 42L, 7L, 3L + +#define SN_setCext_tunneling "setCext-tunneling" +#define NID_setCext_tunneling 612 +#define OBJ_setCext_tunneling 2L, 23L, 42L, 7L, 4L + +#define SN_setCext_setExt "setCext-setExt" +#define NID_setCext_setExt 613 +#define OBJ_setCext_setExt 2L, 23L, 42L, 7L, 5L + +#define SN_setCext_setQualf "setCext-setQualf" +#define NID_setCext_setQualf 614 +#define OBJ_setCext_setQualf 2L, 23L, 42L, 7L, 6L + +#define SN_setCext_PGWYcapabilities "setCext-PGWYcapabilities" +#define NID_setCext_PGWYcapabilities 615 +#define OBJ_setCext_PGWYcapabilities 2L, 23L, 42L, 7L, 7L + +#define SN_setCext_TokenIdentifier "setCext-TokenIdentifier" +#define NID_setCext_TokenIdentifier 616 +#define OBJ_setCext_TokenIdentifier 2L, 23L, 42L, 7L, 8L + +#define SN_setCext_Track2Data "setCext-Track2Data" +#define NID_setCext_Track2Data 617 +#define OBJ_setCext_Track2Data 2L, 23L, 42L, 7L, 9L + +#define SN_setCext_TokenType "setCext-TokenType" +#define NID_setCext_TokenType 618 +#define OBJ_setCext_TokenType 2L, 23L, 42L, 7L, 10L + +#define SN_setCext_IssuerCapabilities "setCext-IssuerCapabilities" +#define NID_setCext_IssuerCapabilities 619 +#define OBJ_setCext_IssuerCapabilities 2L, 23L, 42L, 7L, 11L + +#define SN_setAttr_Cert "setAttr-Cert" +#define NID_setAttr_Cert 620 +#define OBJ_setAttr_Cert 2L, 23L, 42L, 3L, 0L + +#define SN_setAttr_PGWYcap "setAttr-PGWYcap" +#define LN_setAttr_PGWYcap "payment gateway capabilities" +#define NID_setAttr_PGWYcap 621 +#define OBJ_setAttr_PGWYcap 2L, 23L, 42L, 3L, 1L + +#define SN_setAttr_TokenType "setAttr-TokenType" +#define NID_setAttr_TokenType 622 +#define OBJ_setAttr_TokenType 2L, 23L, 42L, 3L, 2L + +#define SN_setAttr_IssCap "setAttr-IssCap" +#define LN_setAttr_IssCap "issuer capabilities" +#define NID_setAttr_IssCap 623 +#define OBJ_setAttr_IssCap 2L, 23L, 42L, 3L, 3L + +#define SN_set_rootKeyThumb "set-rootKeyThumb" +#define NID_set_rootKeyThumb 624 +#define OBJ_set_rootKeyThumb 2L, 23L, 42L, 3L, 0L, 0L + +#define SN_set_addPolicy "set-addPolicy" +#define NID_set_addPolicy 625 +#define OBJ_set_addPolicy 2L, 23L, 42L, 3L, 0L, 1L + +#define SN_setAttr_Token_EMV "setAttr-Token-EMV" +#define NID_setAttr_Token_EMV 626 +#define OBJ_setAttr_Token_EMV 2L, 23L, 42L, 3L, 2L, 1L + +#define SN_setAttr_Token_B0Prime "setAttr-Token-B0Prime" +#define NID_setAttr_Token_B0Prime 627 +#define OBJ_setAttr_Token_B0Prime 2L, 23L, 42L, 3L, 2L, 2L + +#define SN_setAttr_IssCap_CVM "setAttr-IssCap-CVM" +#define NID_setAttr_IssCap_CVM 628 +#define OBJ_setAttr_IssCap_CVM 2L, 23L, 42L, 3L, 3L, 3L + +#define SN_setAttr_IssCap_T2 "setAttr-IssCap-T2" +#define NID_setAttr_IssCap_T2 629 +#define OBJ_setAttr_IssCap_T2 2L, 23L, 42L, 3L, 3L, 4L + +#define SN_setAttr_IssCap_Sig "setAttr-IssCap-Sig" +#define NID_setAttr_IssCap_Sig 630 +#define OBJ_setAttr_IssCap_Sig 2L, 23L, 42L, 3L, 3L, 5L + +#define SN_setAttr_GenCryptgrm "setAttr-GenCryptgrm" +#define LN_setAttr_GenCryptgrm "generate cryptogram" +#define NID_setAttr_GenCryptgrm 631 +#define OBJ_setAttr_GenCryptgrm 2L, 23L, 42L, 3L, 3L, 3L, 1L + +#define SN_setAttr_T2Enc "setAttr-T2Enc" +#define LN_setAttr_T2Enc "encrypted track 2" +#define NID_setAttr_T2Enc 632 +#define OBJ_setAttr_T2Enc 2L, 23L, 42L, 3L, 3L, 4L, 1L + +#define SN_setAttr_T2cleartxt "setAttr-T2cleartxt" +#define LN_setAttr_T2cleartxt "cleartext track 2" +#define NID_setAttr_T2cleartxt 633 +#define OBJ_setAttr_T2cleartxt 2L, 23L, 42L, 3L, 3L, 4L, 2L + +#define SN_setAttr_TokICCsig "setAttr-TokICCsig" +#define LN_setAttr_TokICCsig "ICC or token signature" +#define NID_setAttr_TokICCsig 634 +#define OBJ_setAttr_TokICCsig 2L, 23L, 42L, 3L, 3L, 5L, 1L + +#define SN_setAttr_SecDevSig "setAttr-SecDevSig" +#define LN_setAttr_SecDevSig "secure device signature" +#define NID_setAttr_SecDevSig 635 +#define OBJ_setAttr_SecDevSig 2L, 23L, 42L, 3L, 3L, 5L, 2L + +#define SN_set_brand_IATA_ATA "set-brand-IATA-ATA" +#define NID_set_brand_IATA_ATA 636 +#define OBJ_set_brand_IATA_ATA 2L, 23L, 42L, 8L, 1L + +#define SN_set_brand_Diners "set-brand-Diners" +#define NID_set_brand_Diners 637 +#define OBJ_set_brand_Diners 2L, 23L, 42L, 8L, 30L + +#define SN_set_brand_AmericanExpress "set-brand-AmericanExpress" +#define NID_set_brand_AmericanExpress 638 +#define OBJ_set_brand_AmericanExpress 2L, 23L, 42L, 8L, 34L + +#define SN_set_brand_JCB "set-brand-JCB" +#define NID_set_brand_JCB 639 +#define OBJ_set_brand_JCB 2L, 23L, 42L, 8L, 35L + +#define SN_set_brand_Visa "set-brand-Visa" +#define NID_set_brand_Visa 640 +#define OBJ_set_brand_Visa 2L, 23L, 42L, 8L, 4L + +#define SN_set_brand_MasterCard "set-brand-MasterCard" +#define NID_set_brand_MasterCard 641 +#define OBJ_set_brand_MasterCard 2L, 23L, 42L, 8L, 5L + +#define SN_set_brand_Novus "set-brand-Novus" +#define NID_set_brand_Novus 642 +#define OBJ_set_brand_Novus 2L, 23L, 42L, 8L, 6011L + +#define SN_des_cdmf "DES-CDMF" +#define LN_des_cdmf "des-cdmf" +#define NID_des_cdmf 643 +#define OBJ_des_cdmf 1L, 2L, 840L, 113549L, 3L, 10L + +#define SN_rsaOAEPEncryptionSET "rsaOAEPEncryptionSET" +#define NID_rsaOAEPEncryptionSET 644 +#define OBJ_rsaOAEPEncryptionSET 1L, 2L, 840L, 113549L, 1L, 1L, 6L + +#define SN_itu_t "ITU-T" +#define LN_itu_t "itu-t" +#define NID_itu_t 645 +#define OBJ_itu_t 0L + +#define SN_joint_iso_itu_t "JOINT-ISO-ITU-T" +#define LN_joint_iso_itu_t "joint-iso-itu-t" +#define NID_joint_iso_itu_t 646 +#define OBJ_joint_iso_itu_t 2L + +#define SN_international_organizations "international-organizations" +#define LN_international_organizations "International Organizations" +#define NID_international_organizations 647 +#define OBJ_international_organizations 2L, 23L + +#define SN_ms_smartcard_login "msSmartcardLogin" +#define LN_ms_smartcard_login "Microsoft Smartcardlogin" +#define NID_ms_smartcard_login 648 +#define OBJ_ms_smartcard_login 1L, 3L, 6L, 1L, 4L, 1L, 311L, 20L, 2L, 2L + +#define SN_ms_upn "msUPN" +#define LN_ms_upn "Microsoft Universal Principal Name" +#define NID_ms_upn 649 +#define OBJ_ms_upn 1L, 3L, 6L, 1L, 4L, 1L, 311L, 20L, 2L, 3L + +#define SN_aes_128_cfb1 "AES-128-CFB1" +#define LN_aes_128_cfb1 "aes-128-cfb1" +#define NID_aes_128_cfb1 650 + +#define SN_aes_192_cfb1 "AES-192-CFB1" +#define LN_aes_192_cfb1 "aes-192-cfb1" +#define NID_aes_192_cfb1 651 + +#define SN_aes_256_cfb1 "AES-256-CFB1" +#define LN_aes_256_cfb1 "aes-256-cfb1" +#define NID_aes_256_cfb1 652 + +#define SN_aes_128_cfb8 "AES-128-CFB8" +#define LN_aes_128_cfb8 "aes-128-cfb8" +#define NID_aes_128_cfb8 653 + +#define SN_aes_192_cfb8 "AES-192-CFB8" +#define LN_aes_192_cfb8 "aes-192-cfb8" +#define NID_aes_192_cfb8 654 + +#define SN_aes_256_cfb8 "AES-256-CFB8" +#define LN_aes_256_cfb8 "aes-256-cfb8" +#define NID_aes_256_cfb8 655 + +#define SN_des_cfb1 "DES-CFB1" +#define LN_des_cfb1 "des-cfb1" +#define NID_des_cfb1 656 + +#define SN_des_cfb8 "DES-CFB8" +#define LN_des_cfb8 "des-cfb8" +#define NID_des_cfb8 657 + +#define SN_des_ede3_cfb1 "DES-EDE3-CFB1" +#define LN_des_ede3_cfb1 "des-ede3-cfb1" +#define NID_des_ede3_cfb1 658 + +#define SN_des_ede3_cfb8 "DES-EDE3-CFB8" +#define LN_des_ede3_cfb8 "des-ede3-cfb8" +#define NID_des_ede3_cfb8 659 + +#define SN_streetAddress "street" +#define LN_streetAddress "streetAddress" +#define NID_streetAddress 660 +#define OBJ_streetAddress 2L, 5L, 4L, 9L + +#define LN_postalCode "postalCode" +#define NID_postalCode 661 +#define OBJ_postalCode 2L, 5L, 4L, 17L + +#define SN_id_ppl "id-ppl" +#define NID_id_ppl 662 +#define OBJ_id_ppl 1L, 3L, 6L, 1L, 5L, 5L, 7L, 21L + +#define SN_proxyCertInfo "proxyCertInfo" +#define LN_proxyCertInfo "Proxy Certificate Information" +#define NID_proxyCertInfo 663 +#define OBJ_proxyCertInfo 1L, 3L, 6L, 1L, 5L, 5L, 7L, 1L, 14L + +#define SN_id_ppl_anyLanguage "id-ppl-anyLanguage" +#define LN_id_ppl_anyLanguage "Any language" +#define NID_id_ppl_anyLanguage 664 +#define OBJ_id_ppl_anyLanguage 1L, 3L, 6L, 1L, 5L, 5L, 7L, 21L, 0L + +#define SN_id_ppl_inheritAll "id-ppl-inheritAll" +#define LN_id_ppl_inheritAll "Inherit all" +#define NID_id_ppl_inheritAll 665 +#define OBJ_id_ppl_inheritAll 1L, 3L, 6L, 1L, 5L, 5L, 7L, 21L, 1L + +#define SN_name_constraints "nameConstraints" +#define LN_name_constraints "X509v3 Name Constraints" +#define NID_name_constraints 666 +#define OBJ_name_constraints 2L, 5L, 29L, 30L + +#define SN_Independent "id-ppl-independent" +#define LN_Independent "Independent" +#define NID_Independent 667 +#define OBJ_Independent 1L, 3L, 6L, 1L, 5L, 5L, 7L, 21L, 2L + +#define SN_sha256WithRSAEncryption "RSA-SHA256" +#define LN_sha256WithRSAEncryption "sha256WithRSAEncryption" +#define NID_sha256WithRSAEncryption 668 +#define OBJ_sha256WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 11L + +#define SN_sha384WithRSAEncryption "RSA-SHA384" +#define LN_sha384WithRSAEncryption "sha384WithRSAEncryption" +#define NID_sha384WithRSAEncryption 669 +#define OBJ_sha384WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 12L + +#define SN_sha512WithRSAEncryption "RSA-SHA512" +#define LN_sha512WithRSAEncryption "sha512WithRSAEncryption" +#define NID_sha512WithRSAEncryption 670 +#define OBJ_sha512WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 13L + +#define SN_sha224WithRSAEncryption "RSA-SHA224" +#define LN_sha224WithRSAEncryption "sha224WithRSAEncryption" +#define NID_sha224WithRSAEncryption 671 +#define OBJ_sha224WithRSAEncryption 1L, 2L, 840L, 113549L, 1L, 1L, 14L + +#define SN_sha256 "SHA256" +#define LN_sha256 "sha256" +#define NID_sha256 672 +#define OBJ_sha256 2L, 16L, 840L, 1L, 101L, 3L, 4L, 2L, 1L + +#define SN_sha384 "SHA384" +#define LN_sha384 "sha384" +#define NID_sha384 673 +#define OBJ_sha384 2L, 16L, 840L, 1L, 101L, 3L, 4L, 2L, 2L + +#define SN_sha512 "SHA512" +#define LN_sha512 "sha512" +#define NID_sha512 674 +#define OBJ_sha512 2L, 16L, 840L, 1L, 101L, 3L, 4L, 2L, 3L + +#define SN_sha224 "SHA224" +#define LN_sha224 "sha224" +#define NID_sha224 675 +#define OBJ_sha224 2L, 16L, 840L, 1L, 101L, 3L, 4L, 2L, 4L + +#define SN_identified_organization "identified-organization" +#define NID_identified_organization 676 +#define OBJ_identified_organization 1L, 3L + +#define SN_certicom_arc "certicom-arc" +#define NID_certicom_arc 677 +#define OBJ_certicom_arc 1L, 3L, 132L + +#define SN_wap "wap" +#define NID_wap 678 +#define OBJ_wap 2L, 23L, 43L + +#define SN_wap_wsg "wap-wsg" +#define NID_wap_wsg 679 +#define OBJ_wap_wsg 2L, 23L, 43L, 1L + +#define SN_X9_62_id_characteristic_two_basis "id-characteristic-two-basis" +#define NID_X9_62_id_characteristic_two_basis 680 +#define OBJ_X9_62_id_characteristic_two_basis 1L, 2L, 840L, 10045L, 1L, 2L, 3L + +#define SN_X9_62_onBasis "onBasis" +#define NID_X9_62_onBasis 681 +#define OBJ_X9_62_onBasis 1L, 2L, 840L, 10045L, 1L, 2L, 3L, 1L + +#define SN_X9_62_tpBasis "tpBasis" +#define NID_X9_62_tpBasis 682 +#define OBJ_X9_62_tpBasis 1L, 2L, 840L, 10045L, 1L, 2L, 3L, 2L + +#define SN_X9_62_ppBasis "ppBasis" +#define NID_X9_62_ppBasis 683 +#define OBJ_X9_62_ppBasis 1L, 2L, 840L, 10045L, 1L, 2L, 3L, 3L + +#define SN_X9_62_c2pnb163v1 "c2pnb163v1" +#define NID_X9_62_c2pnb163v1 684 +#define OBJ_X9_62_c2pnb163v1 1L, 2L, 840L, 10045L, 3L, 0L, 1L + +#define SN_X9_62_c2pnb163v2 "c2pnb163v2" +#define NID_X9_62_c2pnb163v2 685 +#define OBJ_X9_62_c2pnb163v2 1L, 2L, 840L, 10045L, 3L, 0L, 2L + +#define SN_X9_62_c2pnb163v3 "c2pnb163v3" +#define NID_X9_62_c2pnb163v3 686 +#define OBJ_X9_62_c2pnb163v3 1L, 2L, 840L, 10045L, 3L, 0L, 3L + +#define SN_X9_62_c2pnb176v1 "c2pnb176v1" +#define NID_X9_62_c2pnb176v1 687 +#define OBJ_X9_62_c2pnb176v1 1L, 2L, 840L, 10045L, 3L, 0L, 4L + +#define SN_X9_62_c2tnb191v1 "c2tnb191v1" +#define NID_X9_62_c2tnb191v1 688 +#define OBJ_X9_62_c2tnb191v1 1L, 2L, 840L, 10045L, 3L, 0L, 5L + +#define SN_X9_62_c2tnb191v2 "c2tnb191v2" +#define NID_X9_62_c2tnb191v2 689 +#define OBJ_X9_62_c2tnb191v2 1L, 2L, 840L, 10045L, 3L, 0L, 6L + +#define SN_X9_62_c2tnb191v3 "c2tnb191v3" +#define NID_X9_62_c2tnb191v3 690 +#define OBJ_X9_62_c2tnb191v3 1L, 2L, 840L, 10045L, 3L, 0L, 7L + +#define SN_X9_62_c2onb191v4 "c2onb191v4" +#define NID_X9_62_c2onb191v4 691 +#define OBJ_X9_62_c2onb191v4 1L, 2L, 840L, 10045L, 3L, 0L, 8L + +#define SN_X9_62_c2onb191v5 "c2onb191v5" +#define NID_X9_62_c2onb191v5 692 +#define OBJ_X9_62_c2onb191v5 1L, 2L, 840L, 10045L, 3L, 0L, 9L + +#define SN_X9_62_c2pnb208w1 "c2pnb208w1" +#define NID_X9_62_c2pnb208w1 693 +#define OBJ_X9_62_c2pnb208w1 1L, 2L, 840L, 10045L, 3L, 0L, 10L + +#define SN_X9_62_c2tnb239v1 "c2tnb239v1" +#define NID_X9_62_c2tnb239v1 694 +#define OBJ_X9_62_c2tnb239v1 1L, 2L, 840L, 10045L, 3L, 0L, 11L + +#define SN_X9_62_c2tnb239v2 "c2tnb239v2" +#define NID_X9_62_c2tnb239v2 695 +#define OBJ_X9_62_c2tnb239v2 1L, 2L, 840L, 10045L, 3L, 0L, 12L + +#define SN_X9_62_c2tnb239v3 "c2tnb239v3" +#define NID_X9_62_c2tnb239v3 696 +#define OBJ_X9_62_c2tnb239v3 1L, 2L, 840L, 10045L, 3L, 0L, 13L + +#define SN_X9_62_c2onb239v4 "c2onb239v4" +#define NID_X9_62_c2onb239v4 697 +#define OBJ_X9_62_c2onb239v4 1L, 2L, 840L, 10045L, 3L, 0L, 14L + +#define SN_X9_62_c2onb239v5 "c2onb239v5" +#define NID_X9_62_c2onb239v5 698 +#define OBJ_X9_62_c2onb239v5 1L, 2L, 840L, 10045L, 3L, 0L, 15L + +#define SN_X9_62_c2pnb272w1 "c2pnb272w1" +#define NID_X9_62_c2pnb272w1 699 +#define OBJ_X9_62_c2pnb272w1 1L, 2L, 840L, 10045L, 3L, 0L, 16L + +#define SN_X9_62_c2pnb304w1 "c2pnb304w1" +#define NID_X9_62_c2pnb304w1 700 +#define OBJ_X9_62_c2pnb304w1 1L, 2L, 840L, 10045L, 3L, 0L, 17L + +#define SN_X9_62_c2tnb359v1 "c2tnb359v1" +#define NID_X9_62_c2tnb359v1 701 +#define OBJ_X9_62_c2tnb359v1 1L, 2L, 840L, 10045L, 3L, 0L, 18L + +#define SN_X9_62_c2pnb368w1 "c2pnb368w1" +#define NID_X9_62_c2pnb368w1 702 +#define OBJ_X9_62_c2pnb368w1 1L, 2L, 840L, 10045L, 3L, 0L, 19L + +#define SN_X9_62_c2tnb431r1 "c2tnb431r1" +#define NID_X9_62_c2tnb431r1 703 +#define OBJ_X9_62_c2tnb431r1 1L, 2L, 840L, 10045L, 3L, 0L, 20L + +#define SN_secp112r1 "secp112r1" +#define NID_secp112r1 704 +#define OBJ_secp112r1 1L, 3L, 132L, 0L, 6L + +#define SN_secp112r2 "secp112r2" +#define NID_secp112r2 705 +#define OBJ_secp112r2 1L, 3L, 132L, 0L, 7L + +#define SN_secp128r1 "secp128r1" +#define NID_secp128r1 706 +#define OBJ_secp128r1 1L, 3L, 132L, 0L, 28L + +#define SN_secp128r2 "secp128r2" +#define NID_secp128r2 707 +#define OBJ_secp128r2 1L, 3L, 132L, 0L, 29L + +#define SN_secp160k1 "secp160k1" +#define NID_secp160k1 708 +#define OBJ_secp160k1 1L, 3L, 132L, 0L, 9L + +#define SN_secp160r1 "secp160r1" +#define NID_secp160r1 709 +#define OBJ_secp160r1 1L, 3L, 132L, 0L, 8L + +#define SN_secp160r2 "secp160r2" +#define NID_secp160r2 710 +#define OBJ_secp160r2 1L, 3L, 132L, 0L, 30L + +#define SN_secp192k1 "secp192k1" +#define NID_secp192k1 711 +#define OBJ_secp192k1 1L, 3L, 132L, 0L, 31L + +#define SN_secp224k1 "secp224k1" +#define NID_secp224k1 712 +#define OBJ_secp224k1 1L, 3L, 132L, 0L, 32L + +#define SN_secp224r1 "secp224r1" +#define NID_secp224r1 713 +#define OBJ_secp224r1 1L, 3L, 132L, 0L, 33L + +#define SN_secp256k1 "secp256k1" +#define NID_secp256k1 714 +#define OBJ_secp256k1 1L, 3L, 132L, 0L, 10L + +#define SN_secp384r1 "secp384r1" +#define NID_secp384r1 715 +#define OBJ_secp384r1 1L, 3L, 132L, 0L, 34L + +#define SN_secp521r1 "secp521r1" +#define NID_secp521r1 716 +#define OBJ_secp521r1 1L, 3L, 132L, 0L, 35L + +#define SN_sect113r1 "sect113r1" +#define NID_sect113r1 717 +#define OBJ_sect113r1 1L, 3L, 132L, 0L, 4L + +#define SN_sect113r2 "sect113r2" +#define NID_sect113r2 718 +#define OBJ_sect113r2 1L, 3L, 132L, 0L, 5L + +#define SN_sect131r1 "sect131r1" +#define NID_sect131r1 719 +#define OBJ_sect131r1 1L, 3L, 132L, 0L, 22L + +#define SN_sect131r2 "sect131r2" +#define NID_sect131r2 720 +#define OBJ_sect131r2 1L, 3L, 132L, 0L, 23L + +#define SN_sect163k1 "sect163k1" +#define NID_sect163k1 721 +#define OBJ_sect163k1 1L, 3L, 132L, 0L, 1L + +#define SN_sect163r1 "sect163r1" +#define NID_sect163r1 722 +#define OBJ_sect163r1 1L, 3L, 132L, 0L, 2L + +#define SN_sect163r2 "sect163r2" +#define NID_sect163r2 723 +#define OBJ_sect163r2 1L, 3L, 132L, 0L, 15L + +#define SN_sect193r1 "sect193r1" +#define NID_sect193r1 724 +#define OBJ_sect193r1 1L, 3L, 132L, 0L, 24L + +#define SN_sect193r2 "sect193r2" +#define NID_sect193r2 725 +#define OBJ_sect193r2 1L, 3L, 132L, 0L, 25L + +#define SN_sect233k1 "sect233k1" +#define NID_sect233k1 726 +#define OBJ_sect233k1 1L, 3L, 132L, 0L, 26L + +#define SN_sect233r1 "sect233r1" +#define NID_sect233r1 727 +#define OBJ_sect233r1 1L, 3L, 132L, 0L, 27L + +#define SN_sect239k1 "sect239k1" +#define NID_sect239k1 728 +#define OBJ_sect239k1 1L, 3L, 132L, 0L, 3L + +#define SN_sect283k1 "sect283k1" +#define NID_sect283k1 729 +#define OBJ_sect283k1 1L, 3L, 132L, 0L, 16L + +#define SN_sect283r1 "sect283r1" +#define NID_sect283r1 730 +#define OBJ_sect283r1 1L, 3L, 132L, 0L, 17L + +#define SN_sect409k1 "sect409k1" +#define NID_sect409k1 731 +#define OBJ_sect409k1 1L, 3L, 132L, 0L, 36L + +#define SN_sect409r1 "sect409r1" +#define NID_sect409r1 732 +#define OBJ_sect409r1 1L, 3L, 132L, 0L, 37L + +#define SN_sect571k1 "sect571k1" +#define NID_sect571k1 733 +#define OBJ_sect571k1 1L, 3L, 132L, 0L, 38L + +#define SN_sect571r1 "sect571r1" +#define NID_sect571r1 734 +#define OBJ_sect571r1 1L, 3L, 132L, 0L, 39L + +#define SN_wap_wsg_idm_ecid_wtls1 "wap-wsg-idm-ecid-wtls1" +#define NID_wap_wsg_idm_ecid_wtls1 735 +#define OBJ_wap_wsg_idm_ecid_wtls1 2L, 23L, 43L, 1L, 4L, 1L + +#define SN_wap_wsg_idm_ecid_wtls3 "wap-wsg-idm-ecid-wtls3" +#define NID_wap_wsg_idm_ecid_wtls3 736 +#define OBJ_wap_wsg_idm_ecid_wtls3 2L, 23L, 43L, 1L, 4L, 3L + +#define SN_wap_wsg_idm_ecid_wtls4 "wap-wsg-idm-ecid-wtls4" +#define NID_wap_wsg_idm_ecid_wtls4 737 +#define OBJ_wap_wsg_idm_ecid_wtls4 2L, 23L, 43L, 1L, 4L, 4L + +#define SN_wap_wsg_idm_ecid_wtls5 "wap-wsg-idm-ecid-wtls5" +#define NID_wap_wsg_idm_ecid_wtls5 738 +#define OBJ_wap_wsg_idm_ecid_wtls5 2L, 23L, 43L, 1L, 4L, 5L + +#define SN_wap_wsg_idm_ecid_wtls6 "wap-wsg-idm-ecid-wtls6" +#define NID_wap_wsg_idm_ecid_wtls6 739 +#define OBJ_wap_wsg_idm_ecid_wtls6 2L, 23L, 43L, 1L, 4L, 6L + +#define SN_wap_wsg_idm_ecid_wtls7 "wap-wsg-idm-ecid-wtls7" +#define NID_wap_wsg_idm_ecid_wtls7 740 +#define OBJ_wap_wsg_idm_ecid_wtls7 2L, 23L, 43L, 1L, 4L, 7L + +#define SN_wap_wsg_idm_ecid_wtls8 "wap-wsg-idm-ecid-wtls8" +#define NID_wap_wsg_idm_ecid_wtls8 741 +#define OBJ_wap_wsg_idm_ecid_wtls8 2L, 23L, 43L, 1L, 4L, 8L + +#define SN_wap_wsg_idm_ecid_wtls9 "wap-wsg-idm-ecid-wtls9" +#define NID_wap_wsg_idm_ecid_wtls9 742 +#define OBJ_wap_wsg_idm_ecid_wtls9 2L, 23L, 43L, 1L, 4L, 9L + +#define SN_wap_wsg_idm_ecid_wtls10 "wap-wsg-idm-ecid-wtls10" +#define NID_wap_wsg_idm_ecid_wtls10 743 +#define OBJ_wap_wsg_idm_ecid_wtls10 2L, 23L, 43L, 1L, 4L, 10L + +#define SN_wap_wsg_idm_ecid_wtls11 "wap-wsg-idm-ecid-wtls11" +#define NID_wap_wsg_idm_ecid_wtls11 744 +#define OBJ_wap_wsg_idm_ecid_wtls11 2L, 23L, 43L, 1L, 4L, 11L + +#define SN_wap_wsg_idm_ecid_wtls12 "wap-wsg-idm-ecid-wtls12" +#define NID_wap_wsg_idm_ecid_wtls12 745 +#define OBJ_wap_wsg_idm_ecid_wtls12 2L, 23L, 43L, 1L, 4L, 12L + +#define SN_any_policy "anyPolicy" +#define LN_any_policy "X509v3 Any Policy" +#define NID_any_policy 746 +#define OBJ_any_policy 2L, 5L, 29L, 32L, 0L + +#define SN_policy_mappings "policyMappings" +#define LN_policy_mappings "X509v3 Policy Mappings" +#define NID_policy_mappings 747 +#define OBJ_policy_mappings 2L, 5L, 29L, 33L + +#define SN_inhibit_any_policy "inhibitAnyPolicy" +#define LN_inhibit_any_policy "X509v3 Inhibit Any Policy" +#define NID_inhibit_any_policy 748 +#define OBJ_inhibit_any_policy 2L, 5L, 29L, 54L + +#define SN_ipsec3 "Oakley-EC2N-3" +#define LN_ipsec3 "ipsec3" +#define NID_ipsec3 749 + +#define SN_ipsec4 "Oakley-EC2N-4" +#define LN_ipsec4 "ipsec4" +#define NID_ipsec4 750 + +#define SN_camellia_128_cbc "CAMELLIA-128-CBC" +#define LN_camellia_128_cbc "camellia-128-cbc" +#define NID_camellia_128_cbc 751 +#define OBJ_camellia_128_cbc 1L, 2L, 392L, 200011L, 61L, 1L, 1L, 1L, 2L + +#define SN_camellia_192_cbc "CAMELLIA-192-CBC" +#define LN_camellia_192_cbc "camellia-192-cbc" +#define NID_camellia_192_cbc 752 +#define OBJ_camellia_192_cbc 1L, 2L, 392L, 200011L, 61L, 1L, 1L, 1L, 3L + +#define SN_camellia_256_cbc "CAMELLIA-256-CBC" +#define LN_camellia_256_cbc "camellia-256-cbc" +#define NID_camellia_256_cbc 753 +#define OBJ_camellia_256_cbc 1L, 2L, 392L, 200011L, 61L, 1L, 1L, 1L, 4L + +#define SN_camellia_128_ecb "CAMELLIA-128-ECB" +#define LN_camellia_128_ecb "camellia-128-ecb" +#define NID_camellia_128_ecb 754 +#define OBJ_camellia_128_ecb 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 1L + +#define SN_camellia_192_ecb "CAMELLIA-192-ECB" +#define LN_camellia_192_ecb "camellia-192-ecb" +#define NID_camellia_192_ecb 755 +#define OBJ_camellia_192_ecb 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 21L + +#define SN_camellia_256_ecb "CAMELLIA-256-ECB" +#define LN_camellia_256_ecb "camellia-256-ecb" +#define NID_camellia_256_ecb 756 +#define OBJ_camellia_256_ecb 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 41L + +#define SN_camellia_128_cfb128 "CAMELLIA-128-CFB" +#define LN_camellia_128_cfb128 "camellia-128-cfb" +#define NID_camellia_128_cfb128 757 +#define OBJ_camellia_128_cfb128 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 4L + +#define SN_camellia_192_cfb128 "CAMELLIA-192-CFB" +#define LN_camellia_192_cfb128 "camellia-192-cfb" +#define NID_camellia_192_cfb128 758 +#define OBJ_camellia_192_cfb128 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 24L + +#define SN_camellia_256_cfb128 "CAMELLIA-256-CFB" +#define LN_camellia_256_cfb128 "camellia-256-cfb" +#define NID_camellia_256_cfb128 759 +#define OBJ_camellia_256_cfb128 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 44L + +#define SN_camellia_128_cfb1 "CAMELLIA-128-CFB1" +#define LN_camellia_128_cfb1 "camellia-128-cfb1" +#define NID_camellia_128_cfb1 760 + +#define SN_camellia_192_cfb1 "CAMELLIA-192-CFB1" +#define LN_camellia_192_cfb1 "camellia-192-cfb1" +#define NID_camellia_192_cfb1 761 + +#define SN_camellia_256_cfb1 "CAMELLIA-256-CFB1" +#define LN_camellia_256_cfb1 "camellia-256-cfb1" +#define NID_camellia_256_cfb1 762 + +#define SN_camellia_128_cfb8 "CAMELLIA-128-CFB8" +#define LN_camellia_128_cfb8 "camellia-128-cfb8" +#define NID_camellia_128_cfb8 763 + +#define SN_camellia_192_cfb8 "CAMELLIA-192-CFB8" +#define LN_camellia_192_cfb8 "camellia-192-cfb8" +#define NID_camellia_192_cfb8 764 + +#define SN_camellia_256_cfb8 "CAMELLIA-256-CFB8" +#define LN_camellia_256_cfb8 "camellia-256-cfb8" +#define NID_camellia_256_cfb8 765 + +#define SN_camellia_128_ofb128 "CAMELLIA-128-OFB" +#define LN_camellia_128_ofb128 "camellia-128-ofb" +#define NID_camellia_128_ofb128 766 +#define OBJ_camellia_128_ofb128 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 3L + +#define SN_camellia_192_ofb128 "CAMELLIA-192-OFB" +#define LN_camellia_192_ofb128 "camellia-192-ofb" +#define NID_camellia_192_ofb128 767 +#define OBJ_camellia_192_ofb128 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 23L + +#define SN_camellia_256_ofb128 "CAMELLIA-256-OFB" +#define LN_camellia_256_ofb128 "camellia-256-ofb" +#define NID_camellia_256_ofb128 768 +#define OBJ_camellia_256_ofb128 0L, 3L, 4401L, 5L, 3L, 1L, 9L, 43L + +#define SN_subject_directory_attributes "subjectDirectoryAttributes" +#define LN_subject_directory_attributes "X509v3 Subject Directory Attributes" +#define NID_subject_directory_attributes 769 +#define OBJ_subject_directory_attributes 2L, 5L, 29L, 9L + +#define SN_issuing_distribution_point "issuingDistributionPoint" +#define LN_issuing_distribution_point "X509v3 Issuing Distribution Point" +#define NID_issuing_distribution_point 770 +#define OBJ_issuing_distribution_point 2L, 5L, 29L, 28L + +#define SN_certificate_issuer "certificateIssuer" +#define LN_certificate_issuer "X509v3 Certificate Issuer" +#define NID_certificate_issuer 771 +#define OBJ_certificate_issuer 2L, 5L, 29L, 29L + +#define SN_kisa "KISA" +#define LN_kisa "kisa" +#define NID_kisa 773 +#define OBJ_kisa 1L, 2L, 410L, 200004L + +#define SN_seed_ecb "SEED-ECB" +#define LN_seed_ecb "seed-ecb" +#define NID_seed_ecb 776 +#define OBJ_seed_ecb 1L, 2L, 410L, 200004L, 1L, 3L + +#define SN_seed_cbc "SEED-CBC" +#define LN_seed_cbc "seed-cbc" +#define NID_seed_cbc 777 +#define OBJ_seed_cbc 1L, 2L, 410L, 200004L, 1L, 4L + +#define SN_seed_ofb128 "SEED-OFB" +#define LN_seed_ofb128 "seed-ofb" +#define NID_seed_ofb128 778 +#define OBJ_seed_ofb128 1L, 2L, 410L, 200004L, 1L, 6L + +#define SN_seed_cfb128 "SEED-CFB" +#define LN_seed_cfb128 "seed-cfb" +#define NID_seed_cfb128 779 +#define OBJ_seed_cfb128 1L, 2L, 410L, 200004L, 1L, 5L + +#define SN_hmac_md5 "HMAC-MD5" +#define LN_hmac_md5 "hmac-md5" +#define NID_hmac_md5 780 +#define OBJ_hmac_md5 1L, 3L, 6L, 1L, 5L, 5L, 8L, 1L, 1L + +#define SN_hmac_sha1 "HMAC-SHA1" +#define LN_hmac_sha1 "hmac-sha1" +#define NID_hmac_sha1 781 +#define OBJ_hmac_sha1 1L, 3L, 6L, 1L, 5L, 5L, 8L, 1L, 2L + +#define SN_id_PasswordBasedMAC "id-PasswordBasedMAC" +#define LN_id_PasswordBasedMAC "password based MAC" +#define NID_id_PasswordBasedMAC 782 +#define OBJ_id_PasswordBasedMAC 1L, 2L, 840L, 113533L, 7L, 66L, 13L + +#define SN_id_DHBasedMac "id-DHBasedMac" +#define LN_id_DHBasedMac "Diffie-Hellman based MAC" +#define NID_id_DHBasedMac 783 +#define OBJ_id_DHBasedMac 1L, 2L, 840L, 113533L, 7L, 66L, 30L + +#define SN_id_it_suppLangTags "id-it-suppLangTags" +#define NID_id_it_suppLangTags 784 +#define OBJ_id_it_suppLangTags 1L, 3L, 6L, 1L, 5L, 5L, 7L, 4L, 16L + +#define SN_caRepository "caRepository" +#define LN_caRepository "CA Repository" +#define NID_caRepository 785 +#define OBJ_caRepository 1L, 3L, 6L, 1L, 5L, 5L, 7L, 48L, 5L + +#define SN_id_smime_ct_compressedData "id-smime-ct-compressedData" +#define NID_id_smime_ct_compressedData 786 +#define OBJ_id_smime_ct_compressedData \ + 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 9L + +#define SN_id_ct_asciiTextWithCRLF "id-ct-asciiTextWithCRLF" +#define NID_id_ct_asciiTextWithCRLF 787 +#define OBJ_id_ct_asciiTextWithCRLF 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 1L, 27L + +#define SN_id_aes128_wrap "id-aes128-wrap" +#define NID_id_aes128_wrap 788 +#define OBJ_id_aes128_wrap 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 5L + +#define SN_id_aes192_wrap "id-aes192-wrap" +#define NID_id_aes192_wrap 789 +#define OBJ_id_aes192_wrap 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 25L + +#define SN_id_aes256_wrap "id-aes256-wrap" +#define NID_id_aes256_wrap 790 +#define OBJ_id_aes256_wrap 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 45L + +#define SN_ecdsa_with_Recommended "ecdsa-with-Recommended" +#define NID_ecdsa_with_Recommended 791 +#define OBJ_ecdsa_with_Recommended 1L, 2L, 840L, 10045L, 4L, 2L + +#define SN_ecdsa_with_Specified "ecdsa-with-Specified" +#define NID_ecdsa_with_Specified 792 +#define OBJ_ecdsa_with_Specified 1L, 2L, 840L, 10045L, 4L, 3L + +#define SN_ecdsa_with_SHA224 "ecdsa-with-SHA224" +#define NID_ecdsa_with_SHA224 793 +#define OBJ_ecdsa_with_SHA224 1L, 2L, 840L, 10045L, 4L, 3L, 1L + +#define SN_ecdsa_with_SHA256 "ecdsa-with-SHA256" +#define NID_ecdsa_with_SHA256 794 +#define OBJ_ecdsa_with_SHA256 1L, 2L, 840L, 10045L, 4L, 3L, 2L + +#define SN_ecdsa_with_SHA384 "ecdsa-with-SHA384" +#define NID_ecdsa_with_SHA384 795 +#define OBJ_ecdsa_with_SHA384 1L, 2L, 840L, 10045L, 4L, 3L, 3L + +#define SN_ecdsa_with_SHA512 "ecdsa-with-SHA512" +#define NID_ecdsa_with_SHA512 796 +#define OBJ_ecdsa_with_SHA512 1L, 2L, 840L, 10045L, 4L, 3L, 4L + +#define LN_hmacWithMD5 "hmacWithMD5" +#define NID_hmacWithMD5 797 +#define OBJ_hmacWithMD5 1L, 2L, 840L, 113549L, 2L, 6L + +#define LN_hmacWithSHA224 "hmacWithSHA224" +#define NID_hmacWithSHA224 798 +#define OBJ_hmacWithSHA224 1L, 2L, 840L, 113549L, 2L, 8L + +#define LN_hmacWithSHA256 "hmacWithSHA256" +#define NID_hmacWithSHA256 799 +#define OBJ_hmacWithSHA256 1L, 2L, 840L, 113549L, 2L, 9L + +#define LN_hmacWithSHA384 "hmacWithSHA384" +#define NID_hmacWithSHA384 800 +#define OBJ_hmacWithSHA384 1L, 2L, 840L, 113549L, 2L, 10L + +#define LN_hmacWithSHA512 "hmacWithSHA512" +#define NID_hmacWithSHA512 801 +#define OBJ_hmacWithSHA512 1L, 2L, 840L, 113549L, 2L, 11L + +#define SN_dsa_with_SHA224 "dsa_with_SHA224" +#define NID_dsa_with_SHA224 802 +#define OBJ_dsa_with_SHA224 2L, 16L, 840L, 1L, 101L, 3L, 4L, 3L, 1L + +#define SN_dsa_with_SHA256 "dsa_with_SHA256" +#define NID_dsa_with_SHA256 803 +#define OBJ_dsa_with_SHA256 2L, 16L, 840L, 1L, 101L, 3L, 4L, 3L, 2L + +#define SN_whirlpool "whirlpool" +#define NID_whirlpool 804 +#define OBJ_whirlpool 1L, 0L, 10118L, 3L, 0L, 55L + +#define SN_cryptopro "cryptopro" +#define NID_cryptopro 805 +#define OBJ_cryptopro 1L, 2L, 643L, 2L, 2L + +#define SN_cryptocom "cryptocom" +#define NID_cryptocom 806 +#define OBJ_cryptocom 1L, 2L, 643L, 2L, 9L + +#define SN_id_GostR3411_94_with_GostR3410_2001 \ + "id-GostR3411-94-with-GostR3410-2001" +#define LN_id_GostR3411_94_with_GostR3410_2001 \ + "GOST R 34.11-94 with GOST R 34.10-2001" +#define NID_id_GostR3411_94_with_GostR3410_2001 807 +#define OBJ_id_GostR3411_94_with_GostR3410_2001 1L, 2L, 643L, 2L, 2L, 3L + +#define SN_id_GostR3411_94_with_GostR3410_94 "id-GostR3411-94-with-GostR3410-94" +#define LN_id_GostR3411_94_with_GostR3410_94 \ + "GOST R 34.11-94 with GOST R 34.10-94" +#define NID_id_GostR3411_94_with_GostR3410_94 808 +#define OBJ_id_GostR3411_94_with_GostR3410_94 1L, 2L, 643L, 2L, 2L, 4L + +#define SN_id_GostR3411_94 "md_gost94" +#define LN_id_GostR3411_94 "GOST R 34.11-94" +#define NID_id_GostR3411_94 809 +#define OBJ_id_GostR3411_94 1L, 2L, 643L, 2L, 2L, 9L + +#define SN_id_HMACGostR3411_94 "id-HMACGostR3411-94" +#define LN_id_HMACGostR3411_94 "HMAC GOST 34.11-94" +#define NID_id_HMACGostR3411_94 810 +#define OBJ_id_HMACGostR3411_94 1L, 2L, 643L, 2L, 2L, 10L + +#define SN_id_GostR3410_2001 "gost2001" +#define LN_id_GostR3410_2001 "GOST R 34.10-2001" +#define NID_id_GostR3410_2001 811 +#define OBJ_id_GostR3410_2001 1L, 2L, 643L, 2L, 2L, 19L + +#define SN_id_GostR3410_94 "gost94" +#define LN_id_GostR3410_94 "GOST R 34.10-94" +#define NID_id_GostR3410_94 812 +#define OBJ_id_GostR3410_94 1L, 2L, 643L, 2L, 2L, 20L + +#define SN_id_Gost28147_89 "gost89" +#define LN_id_Gost28147_89 "GOST 28147-89" +#define NID_id_Gost28147_89 813 +#define OBJ_id_Gost28147_89 1L, 2L, 643L, 2L, 2L, 21L + +#define SN_gost89_cnt "gost89-cnt" +#define NID_gost89_cnt 814 + +#define SN_id_Gost28147_89_MAC "gost-mac" +#define LN_id_Gost28147_89_MAC "GOST 28147-89 MAC" +#define NID_id_Gost28147_89_MAC 815 +#define OBJ_id_Gost28147_89_MAC 1L, 2L, 643L, 2L, 2L, 22L + +#define SN_id_GostR3411_94_prf "prf-gostr3411-94" +#define LN_id_GostR3411_94_prf "GOST R 34.11-94 PRF" +#define NID_id_GostR3411_94_prf 816 +#define OBJ_id_GostR3411_94_prf 1L, 2L, 643L, 2L, 2L, 23L + +#define SN_id_GostR3410_2001DH "id-GostR3410-2001DH" +#define LN_id_GostR3410_2001DH "GOST R 34.10-2001 DH" +#define NID_id_GostR3410_2001DH 817 +#define OBJ_id_GostR3410_2001DH 1L, 2L, 643L, 2L, 2L, 98L + +#define SN_id_GostR3410_94DH "id-GostR3410-94DH" +#define LN_id_GostR3410_94DH "GOST R 34.10-94 DH" +#define NID_id_GostR3410_94DH 818 +#define OBJ_id_GostR3410_94DH 1L, 2L, 643L, 2L, 2L, 99L + +#define SN_id_Gost28147_89_CryptoPro_KeyMeshing \ + "id-Gost28147-89-CryptoPro-KeyMeshing" +#define NID_id_Gost28147_89_CryptoPro_KeyMeshing 819 +#define OBJ_id_Gost28147_89_CryptoPro_KeyMeshing 1L, 2L, 643L, 2L, 2L, 14L, 1L + +#define SN_id_Gost28147_89_None_KeyMeshing "id-Gost28147-89-None-KeyMeshing" +#define NID_id_Gost28147_89_None_KeyMeshing 820 +#define OBJ_id_Gost28147_89_None_KeyMeshing 1L, 2L, 643L, 2L, 2L, 14L, 0L + +#define SN_id_GostR3411_94_TestParamSet "id-GostR3411-94-TestParamSet" +#define NID_id_GostR3411_94_TestParamSet 821 +#define OBJ_id_GostR3411_94_TestParamSet 1L, 2L, 643L, 2L, 2L, 30L, 0L + +#define SN_id_GostR3411_94_CryptoProParamSet "id-GostR3411-94-CryptoProParamSet" +#define NID_id_GostR3411_94_CryptoProParamSet 822 +#define OBJ_id_GostR3411_94_CryptoProParamSet 1L, 2L, 643L, 2L, 2L, 30L, 1L + +#define SN_id_Gost28147_89_TestParamSet "id-Gost28147-89-TestParamSet" +#define NID_id_Gost28147_89_TestParamSet 823 +#define OBJ_id_Gost28147_89_TestParamSet 1L, 2L, 643L, 2L, 2L, 31L, 0L + +#define SN_id_Gost28147_89_CryptoPro_A_ParamSet \ + "id-Gost28147-89-CryptoPro-A-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_A_ParamSet 824 +#define OBJ_id_Gost28147_89_CryptoPro_A_ParamSet 1L, 2L, 643L, 2L, 2L, 31L, 1L + +#define SN_id_Gost28147_89_CryptoPro_B_ParamSet \ + "id-Gost28147-89-CryptoPro-B-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_B_ParamSet 825 +#define OBJ_id_Gost28147_89_CryptoPro_B_ParamSet 1L, 2L, 643L, 2L, 2L, 31L, 2L + +#define SN_id_Gost28147_89_CryptoPro_C_ParamSet \ + "id-Gost28147-89-CryptoPro-C-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_C_ParamSet 826 +#define OBJ_id_Gost28147_89_CryptoPro_C_ParamSet 1L, 2L, 643L, 2L, 2L, 31L, 3L + +#define SN_id_Gost28147_89_CryptoPro_D_ParamSet \ + "id-Gost28147-89-CryptoPro-D-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_D_ParamSet 827 +#define OBJ_id_Gost28147_89_CryptoPro_D_ParamSet 1L, 2L, 643L, 2L, 2L, 31L, 4L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet \ + "id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet 828 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_1_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 31L, 5L + +#define SN_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet \ + "id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet 829 +#define OBJ_id_Gost28147_89_CryptoPro_Oscar_1_0_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 31L, 6L + +#define SN_id_Gost28147_89_CryptoPro_RIC_1_ParamSet \ + "id-Gost28147-89-CryptoPro-RIC-1-ParamSet" +#define NID_id_Gost28147_89_CryptoPro_RIC_1_ParamSet 830 +#define OBJ_id_Gost28147_89_CryptoPro_RIC_1_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 31L, 7L + +#define SN_id_GostR3410_94_TestParamSet "id-GostR3410-94-TestParamSet" +#define NID_id_GostR3410_94_TestParamSet 831 +#define OBJ_id_GostR3410_94_TestParamSet 1L, 2L, 643L, 2L, 2L, 32L, 0L + +#define SN_id_GostR3410_94_CryptoPro_A_ParamSet \ + "id-GostR3410-94-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_A_ParamSet 832 +#define OBJ_id_GostR3410_94_CryptoPro_A_ParamSet 1L, 2L, 643L, 2L, 2L, 32L, 2L + +#define SN_id_GostR3410_94_CryptoPro_B_ParamSet \ + "id-GostR3410-94-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_B_ParamSet 833 +#define OBJ_id_GostR3410_94_CryptoPro_B_ParamSet 1L, 2L, 643L, 2L, 2L, 32L, 3L + +#define SN_id_GostR3410_94_CryptoPro_C_ParamSet \ + "id-GostR3410-94-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_C_ParamSet 834 +#define OBJ_id_GostR3410_94_CryptoPro_C_ParamSet 1L, 2L, 643L, 2L, 2L, 32L, 4L + +#define SN_id_GostR3410_94_CryptoPro_D_ParamSet \ + "id-GostR3410-94-CryptoPro-D-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_D_ParamSet 835 +#define OBJ_id_GostR3410_94_CryptoPro_D_ParamSet 1L, 2L, 643L, 2L, 2L, 32L, 5L + +#define SN_id_GostR3410_94_CryptoPro_XchA_ParamSet \ + "id-GostR3410-94-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchA_ParamSet 836 +#define OBJ_id_GostR3410_94_CryptoPro_XchA_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 33L, 1L + +#define SN_id_GostR3410_94_CryptoPro_XchB_ParamSet \ + "id-GostR3410-94-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchB_ParamSet 837 +#define OBJ_id_GostR3410_94_CryptoPro_XchB_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 33L, 2L + +#define SN_id_GostR3410_94_CryptoPro_XchC_ParamSet \ + "id-GostR3410-94-CryptoPro-XchC-ParamSet" +#define NID_id_GostR3410_94_CryptoPro_XchC_ParamSet 838 +#define OBJ_id_GostR3410_94_CryptoPro_XchC_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 33L, 3L + +#define SN_id_GostR3410_2001_TestParamSet "id-GostR3410-2001-TestParamSet" +#define NID_id_GostR3410_2001_TestParamSet 839 +#define OBJ_id_GostR3410_2001_TestParamSet 1L, 2L, 643L, 2L, 2L, 35L, 0L + +#define SN_id_GostR3410_2001_CryptoPro_A_ParamSet \ + "id-GostR3410-2001-CryptoPro-A-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_A_ParamSet 840 +#define OBJ_id_GostR3410_2001_CryptoPro_A_ParamSet 1L, 2L, 643L, 2L, 2L, 35L, 1L + +#define SN_id_GostR3410_2001_CryptoPro_B_ParamSet \ + "id-GostR3410-2001-CryptoPro-B-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_B_ParamSet 841 +#define OBJ_id_GostR3410_2001_CryptoPro_B_ParamSet 1L, 2L, 643L, 2L, 2L, 35L, 2L + +#define SN_id_GostR3410_2001_CryptoPro_C_ParamSet \ + "id-GostR3410-2001-CryptoPro-C-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_C_ParamSet 842 +#define OBJ_id_GostR3410_2001_CryptoPro_C_ParamSet 1L, 2L, 643L, 2L, 2L, 35L, 3L + +#define SN_id_GostR3410_2001_CryptoPro_XchA_ParamSet \ + "id-GostR3410-2001-CryptoPro-XchA-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchA_ParamSet 843 +#define OBJ_id_GostR3410_2001_CryptoPro_XchA_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 36L, 0L + +#define SN_id_GostR3410_2001_CryptoPro_XchB_ParamSet \ + "id-GostR3410-2001-CryptoPro-XchB-ParamSet" +#define NID_id_GostR3410_2001_CryptoPro_XchB_ParamSet 844 +#define OBJ_id_GostR3410_2001_CryptoPro_XchB_ParamSet \ + 1L, 2L, 643L, 2L, 2L, 36L, 1L + +#define SN_id_GostR3410_94_a "id-GostR3410-94-a" +#define NID_id_GostR3410_94_a 845 +#define OBJ_id_GostR3410_94_a 1L, 2L, 643L, 2L, 2L, 20L, 1L + +#define SN_id_GostR3410_94_aBis "id-GostR3410-94-aBis" +#define NID_id_GostR3410_94_aBis 846 +#define OBJ_id_GostR3410_94_aBis 1L, 2L, 643L, 2L, 2L, 20L, 2L + +#define SN_id_GostR3410_94_b "id-GostR3410-94-b" +#define NID_id_GostR3410_94_b 847 +#define OBJ_id_GostR3410_94_b 1L, 2L, 643L, 2L, 2L, 20L, 3L + +#define SN_id_GostR3410_94_bBis "id-GostR3410-94-bBis" +#define NID_id_GostR3410_94_bBis 848 +#define OBJ_id_GostR3410_94_bBis 1L, 2L, 643L, 2L, 2L, 20L, 4L + +#define SN_id_Gost28147_89_cc "id-Gost28147-89-cc" +#define LN_id_Gost28147_89_cc "GOST 28147-89 Cryptocom ParamSet" +#define NID_id_Gost28147_89_cc 849 +#define OBJ_id_Gost28147_89_cc 1L, 2L, 643L, 2L, 9L, 1L, 6L, 1L + +#define SN_id_GostR3410_94_cc "gost94cc" +#define LN_id_GostR3410_94_cc "GOST 34.10-94 Cryptocom" +#define NID_id_GostR3410_94_cc 850 +#define OBJ_id_GostR3410_94_cc 1L, 2L, 643L, 2L, 9L, 1L, 5L, 3L + +#define SN_id_GostR3410_2001_cc "gost2001cc" +#define LN_id_GostR3410_2001_cc "GOST 34.10-2001 Cryptocom" +#define NID_id_GostR3410_2001_cc 851 +#define OBJ_id_GostR3410_2001_cc 1L, 2L, 643L, 2L, 9L, 1L, 5L, 4L + +#define SN_id_GostR3411_94_with_GostR3410_94_cc \ + "id-GostR3411-94-with-GostR3410-94-cc" +#define LN_id_GostR3411_94_with_GostR3410_94_cc \ + "GOST R 34.11-94 with GOST R 34.10-94 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_94_cc 852 +#define OBJ_id_GostR3411_94_with_GostR3410_94_cc \ + 1L, 2L, 643L, 2L, 9L, 1L, 3L, 3L + +#define SN_id_GostR3411_94_with_GostR3410_2001_cc \ + "id-GostR3411-94-with-GostR3410-2001-cc" +#define LN_id_GostR3411_94_with_GostR3410_2001_cc \ + "GOST R 34.11-94 with GOST R 34.10-2001 Cryptocom" +#define NID_id_GostR3411_94_with_GostR3410_2001_cc 853 +#define OBJ_id_GostR3411_94_with_GostR3410_2001_cc \ + 1L, 2L, 643L, 2L, 9L, 1L, 3L, 4L + +#define SN_id_GostR3410_2001_ParamSet_cc "id-GostR3410-2001-ParamSet-cc" +#define LN_id_GostR3410_2001_ParamSet_cc \ + "GOST R 3410-2001 Parameter Set Cryptocom" +#define NID_id_GostR3410_2001_ParamSet_cc 854 +#define OBJ_id_GostR3410_2001_ParamSet_cc 1L, 2L, 643L, 2L, 9L, 1L, 8L, 1L + +#define SN_hmac "HMAC" +#define LN_hmac "hmac" +#define NID_hmac 855 + +#define SN_LocalKeySet "LocalKeySet" +#define LN_LocalKeySet "Microsoft Local Key set" +#define NID_LocalKeySet 856 +#define OBJ_LocalKeySet 1L, 3L, 6L, 1L, 4L, 1L, 311L, 17L, 2L + +#define SN_freshest_crl "freshestCRL" +#define LN_freshest_crl "X509v3 Freshest CRL" +#define NID_freshest_crl 857 +#define OBJ_freshest_crl 2L, 5L, 29L, 46L + +#define SN_id_on_permanentIdentifier "id-on-permanentIdentifier" +#define LN_id_on_permanentIdentifier "Permanent Identifier" +#define NID_id_on_permanentIdentifier 858 +#define OBJ_id_on_permanentIdentifier 1L, 3L, 6L, 1L, 5L, 5L, 7L, 8L, 3L + +#define LN_searchGuide "searchGuide" +#define NID_searchGuide 859 +#define OBJ_searchGuide 2L, 5L, 4L, 14L + +#define LN_businessCategory "businessCategory" +#define NID_businessCategory 860 +#define OBJ_businessCategory 2L, 5L, 4L, 15L + +#define LN_postalAddress "postalAddress" +#define NID_postalAddress 861 +#define OBJ_postalAddress 2L, 5L, 4L, 16L + +#define LN_postOfficeBox "postOfficeBox" +#define NID_postOfficeBox 862 +#define OBJ_postOfficeBox 2L, 5L, 4L, 18L + +#define LN_physicalDeliveryOfficeName "physicalDeliveryOfficeName" +#define NID_physicalDeliveryOfficeName 863 +#define OBJ_physicalDeliveryOfficeName 2L, 5L, 4L, 19L + +#define LN_telephoneNumber "telephoneNumber" +#define NID_telephoneNumber 864 +#define OBJ_telephoneNumber 2L, 5L, 4L, 20L + +#define LN_telexNumber "telexNumber" +#define NID_telexNumber 865 +#define OBJ_telexNumber 2L, 5L, 4L, 21L + +#define LN_teletexTerminalIdentifier "teletexTerminalIdentifier" +#define NID_teletexTerminalIdentifier 866 +#define OBJ_teletexTerminalIdentifier 2L, 5L, 4L, 22L + +#define LN_facsimileTelephoneNumber "facsimileTelephoneNumber" +#define NID_facsimileTelephoneNumber 867 +#define OBJ_facsimileTelephoneNumber 2L, 5L, 4L, 23L + +#define LN_x121Address "x121Address" +#define NID_x121Address 868 +#define OBJ_x121Address 2L, 5L, 4L, 24L + +#define LN_internationaliSDNNumber "internationaliSDNNumber" +#define NID_internationaliSDNNumber 869 +#define OBJ_internationaliSDNNumber 2L, 5L, 4L, 25L + +#define LN_registeredAddress "registeredAddress" +#define NID_registeredAddress 870 +#define OBJ_registeredAddress 2L, 5L, 4L, 26L + +#define LN_destinationIndicator "destinationIndicator" +#define NID_destinationIndicator 871 +#define OBJ_destinationIndicator 2L, 5L, 4L, 27L + +#define LN_preferredDeliveryMethod "preferredDeliveryMethod" +#define NID_preferredDeliveryMethod 872 +#define OBJ_preferredDeliveryMethod 2L, 5L, 4L, 28L + +#define LN_presentationAddress "presentationAddress" +#define NID_presentationAddress 873 +#define OBJ_presentationAddress 2L, 5L, 4L, 29L + +#define LN_supportedApplicationContext "supportedApplicationContext" +#define NID_supportedApplicationContext 874 +#define OBJ_supportedApplicationContext 2L, 5L, 4L, 30L + +#define SN_member "member" +#define NID_member 875 +#define OBJ_member 2L, 5L, 4L, 31L + +#define SN_owner "owner" +#define NID_owner 876 +#define OBJ_owner 2L, 5L, 4L, 32L + +#define LN_roleOccupant "roleOccupant" +#define NID_roleOccupant 877 +#define OBJ_roleOccupant 2L, 5L, 4L, 33L + +#define SN_seeAlso "seeAlso" +#define NID_seeAlso 878 +#define OBJ_seeAlso 2L, 5L, 4L, 34L + +#define LN_userPassword "userPassword" +#define NID_userPassword 879 +#define OBJ_userPassword 2L, 5L, 4L, 35L + +#define LN_userCertificate "userCertificate" +#define NID_userCertificate 880 +#define OBJ_userCertificate 2L, 5L, 4L, 36L + +#define LN_cACertificate "cACertificate" +#define NID_cACertificate 881 +#define OBJ_cACertificate 2L, 5L, 4L, 37L + +#define LN_authorityRevocationList "authorityRevocationList" +#define NID_authorityRevocationList 882 +#define OBJ_authorityRevocationList 2L, 5L, 4L, 38L + +#define LN_certificateRevocationList "certificateRevocationList" +#define NID_certificateRevocationList 883 +#define OBJ_certificateRevocationList 2L, 5L, 4L, 39L + +#define LN_crossCertificatePair "crossCertificatePair" +#define NID_crossCertificatePair 884 +#define OBJ_crossCertificatePair 2L, 5L, 4L, 40L + +#define LN_enhancedSearchGuide "enhancedSearchGuide" +#define NID_enhancedSearchGuide 885 +#define OBJ_enhancedSearchGuide 2L, 5L, 4L, 47L + +#define LN_protocolInformation "protocolInformation" +#define NID_protocolInformation 886 +#define OBJ_protocolInformation 2L, 5L, 4L, 48L + +#define LN_distinguishedName "distinguishedName" +#define NID_distinguishedName 887 +#define OBJ_distinguishedName 2L, 5L, 4L, 49L + +#define LN_uniqueMember "uniqueMember" +#define NID_uniqueMember 888 +#define OBJ_uniqueMember 2L, 5L, 4L, 50L + +#define LN_houseIdentifier "houseIdentifier" +#define NID_houseIdentifier 889 +#define OBJ_houseIdentifier 2L, 5L, 4L, 51L + +#define LN_supportedAlgorithms "supportedAlgorithms" +#define NID_supportedAlgorithms 890 +#define OBJ_supportedAlgorithms 2L, 5L, 4L, 52L + +#define LN_deltaRevocationList "deltaRevocationList" +#define NID_deltaRevocationList 891 +#define OBJ_deltaRevocationList 2L, 5L, 4L, 53L + +#define SN_dmdName "dmdName" +#define NID_dmdName 892 +#define OBJ_dmdName 2L, 5L, 4L, 54L + +#define SN_id_alg_PWRI_KEK "id-alg-PWRI-KEK" +#define NID_id_alg_PWRI_KEK 893 +#define OBJ_id_alg_PWRI_KEK 1L, 2L, 840L, 113549L, 1L, 9L, 16L, 3L, 9L + +#define SN_cmac "CMAC" +#define LN_cmac "cmac" +#define NID_cmac 894 + +#define SN_aes_128_gcm "id-aes128-GCM" +#define LN_aes_128_gcm "aes-128-gcm" +#define NID_aes_128_gcm 895 +#define OBJ_aes_128_gcm 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 6L + +#define SN_aes_128_ccm "id-aes128-CCM" +#define LN_aes_128_ccm "aes-128-ccm" +#define NID_aes_128_ccm 896 +#define OBJ_aes_128_ccm 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 7L + +#define SN_id_aes128_wrap_pad "id-aes128-wrap-pad" +#define NID_id_aes128_wrap_pad 897 +#define OBJ_id_aes128_wrap_pad 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 8L + +#define SN_aes_192_gcm "id-aes192-GCM" +#define LN_aes_192_gcm "aes-192-gcm" +#define NID_aes_192_gcm 898 +#define OBJ_aes_192_gcm 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 26L + +#define SN_aes_192_ccm "id-aes192-CCM" +#define LN_aes_192_ccm "aes-192-ccm" +#define NID_aes_192_ccm 899 +#define OBJ_aes_192_ccm 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 27L + +#define SN_id_aes192_wrap_pad "id-aes192-wrap-pad" +#define NID_id_aes192_wrap_pad 900 +#define OBJ_id_aes192_wrap_pad 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 28L + +#define SN_aes_256_gcm "id-aes256-GCM" +#define LN_aes_256_gcm "aes-256-gcm" +#define NID_aes_256_gcm 901 +#define OBJ_aes_256_gcm 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 46L + +#define SN_aes_256_ccm "id-aes256-CCM" +#define LN_aes_256_ccm "aes-256-ccm" +#define NID_aes_256_ccm 902 +#define OBJ_aes_256_ccm 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 47L + +#define SN_id_aes256_wrap_pad "id-aes256-wrap-pad" +#define NID_id_aes256_wrap_pad 903 +#define OBJ_id_aes256_wrap_pad 2L, 16L, 840L, 1L, 101L, 3L, 4L, 1L, 48L + +#define SN_aes_128_ctr "AES-128-CTR" +#define LN_aes_128_ctr "aes-128-ctr" +#define NID_aes_128_ctr 904 + +#define SN_aes_192_ctr "AES-192-CTR" +#define LN_aes_192_ctr "aes-192-ctr" +#define NID_aes_192_ctr 905 + +#define SN_aes_256_ctr "AES-256-CTR" +#define LN_aes_256_ctr "aes-256-ctr" +#define NID_aes_256_ctr 906 + +#define SN_id_camellia128_wrap "id-camellia128-wrap" +#define NID_id_camellia128_wrap 907 +#define OBJ_id_camellia128_wrap 1L, 2L, 392L, 200011L, 61L, 1L, 1L, 3L, 2L + +#define SN_id_camellia192_wrap "id-camellia192-wrap" +#define NID_id_camellia192_wrap 908 +#define OBJ_id_camellia192_wrap 1L, 2L, 392L, 200011L, 61L, 1L, 1L, 3L, 3L + +#define SN_id_camellia256_wrap "id-camellia256-wrap" +#define NID_id_camellia256_wrap 909 +#define OBJ_id_camellia256_wrap 1L, 2L, 392L, 200011L, 61L, 1L, 1L, 3L, 4L + +#define SN_anyExtendedKeyUsage "anyExtendedKeyUsage" +#define LN_anyExtendedKeyUsage "Any Extended Key Usage" +#define NID_anyExtendedKeyUsage 910 +#define OBJ_anyExtendedKeyUsage 2L, 5L, 29L, 37L, 0L + +#define SN_mgf1 "MGF1" +#define LN_mgf1 "mgf1" +#define NID_mgf1 911 +#define OBJ_mgf1 1L, 2L, 840L, 113549L, 1L, 1L, 8L + +#define SN_rsassaPss "RSASSA-PSS" +#define LN_rsassaPss "rsassaPss" +#define NID_rsassaPss 912 +#define OBJ_rsassaPss 1L, 2L, 840L, 113549L, 1L, 1L, 10L + +#define SN_aes_128_xts "AES-128-XTS" +#define LN_aes_128_xts "aes-128-xts" +#define NID_aes_128_xts 913 + +#define SN_aes_256_xts "AES-256-XTS" +#define LN_aes_256_xts "aes-256-xts" +#define NID_aes_256_xts 914 + +#define SN_rc4_hmac_md5 "RC4-HMAC-MD5" +#define LN_rc4_hmac_md5 "rc4-hmac-md5" +#define NID_rc4_hmac_md5 915 + +#define SN_aes_128_cbc_hmac_sha1 "AES-128-CBC-HMAC-SHA1" +#define LN_aes_128_cbc_hmac_sha1 "aes-128-cbc-hmac-sha1" +#define NID_aes_128_cbc_hmac_sha1 916 + +#define SN_aes_192_cbc_hmac_sha1 "AES-192-CBC-HMAC-SHA1" +#define LN_aes_192_cbc_hmac_sha1 "aes-192-cbc-hmac-sha1" +#define NID_aes_192_cbc_hmac_sha1 917 + +#define SN_aes_256_cbc_hmac_sha1 "AES-256-CBC-HMAC-SHA1" +#define LN_aes_256_cbc_hmac_sha1 "aes-256-cbc-hmac-sha1" +#define NID_aes_256_cbc_hmac_sha1 918 + +#define SN_rsaesOaep "RSAES-OAEP" +#define LN_rsaesOaep "rsaesOaep" +#define NID_rsaesOaep 919 +#define OBJ_rsaesOaep 1L, 2L, 840L, 113549L, 1L, 1L, 7L + +#define SN_dhpublicnumber "dhpublicnumber" +#define LN_dhpublicnumber "X9.42 DH" +#define NID_dhpublicnumber 920 +#define OBJ_dhpublicnumber 1L, 2L, 840L, 10046L, 2L, 1L + +#define SN_brainpoolP160r1 "brainpoolP160r1" +#define NID_brainpoolP160r1 921 +#define OBJ_brainpoolP160r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 1L + +#define SN_brainpoolP160t1 "brainpoolP160t1" +#define NID_brainpoolP160t1 922 +#define OBJ_brainpoolP160t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 2L + +#define SN_brainpoolP192r1 "brainpoolP192r1" +#define NID_brainpoolP192r1 923 +#define OBJ_brainpoolP192r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 3L + +#define SN_brainpoolP192t1 "brainpoolP192t1" +#define NID_brainpoolP192t1 924 +#define OBJ_brainpoolP192t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 4L + +#define SN_brainpoolP224r1 "brainpoolP224r1" +#define NID_brainpoolP224r1 925 +#define OBJ_brainpoolP224r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 5L + +#define SN_brainpoolP224t1 "brainpoolP224t1" +#define NID_brainpoolP224t1 926 +#define OBJ_brainpoolP224t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 6L + +#define SN_brainpoolP256r1 "brainpoolP256r1" +#define NID_brainpoolP256r1 927 +#define OBJ_brainpoolP256r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 7L + +#define SN_brainpoolP256t1 "brainpoolP256t1" +#define NID_brainpoolP256t1 928 +#define OBJ_brainpoolP256t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 8L + +#define SN_brainpoolP320r1 "brainpoolP320r1" +#define NID_brainpoolP320r1 929 +#define OBJ_brainpoolP320r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 9L + +#define SN_brainpoolP320t1 "brainpoolP320t1" +#define NID_brainpoolP320t1 930 +#define OBJ_brainpoolP320t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 10L + +#define SN_brainpoolP384r1 "brainpoolP384r1" +#define NID_brainpoolP384r1 931 +#define OBJ_brainpoolP384r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 11L + +#define SN_brainpoolP384t1 "brainpoolP384t1" +#define NID_brainpoolP384t1 932 +#define OBJ_brainpoolP384t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 12L + +#define SN_brainpoolP512r1 "brainpoolP512r1" +#define NID_brainpoolP512r1 933 +#define OBJ_brainpoolP512r1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 13L + +#define SN_brainpoolP512t1 "brainpoolP512t1" +#define NID_brainpoolP512t1 934 +#define OBJ_brainpoolP512t1 1L, 3L, 36L, 3L, 3L, 2L, 8L, 1L, 1L, 14L + +#define SN_pSpecified "PSPECIFIED" +#define LN_pSpecified "pSpecified" +#define NID_pSpecified 935 +#define OBJ_pSpecified 1L, 2L, 840L, 113549L, 1L, 1L, 9L + +#define SN_dhSinglePass_stdDH_sha1kdf_scheme "dhSinglePass-stdDH-sha1kdf-scheme" +#define NID_dhSinglePass_stdDH_sha1kdf_scheme 936 +#define OBJ_dhSinglePass_stdDH_sha1kdf_scheme \ + 1L, 3L, 133L, 16L, 840L, 63L, 0L, 2L + +#define SN_dhSinglePass_stdDH_sha224kdf_scheme \ + "dhSinglePass-stdDH-sha224kdf-scheme" +#define NID_dhSinglePass_stdDH_sha224kdf_scheme 937 +#define OBJ_dhSinglePass_stdDH_sha224kdf_scheme 1L, 3L, 132L, 1L, 11L, 0L + +#define SN_dhSinglePass_stdDH_sha256kdf_scheme \ + "dhSinglePass-stdDH-sha256kdf-scheme" +#define NID_dhSinglePass_stdDH_sha256kdf_scheme 938 +#define OBJ_dhSinglePass_stdDH_sha256kdf_scheme 1L, 3L, 132L, 1L, 11L, 1L + +#define SN_dhSinglePass_stdDH_sha384kdf_scheme \ + "dhSinglePass-stdDH-sha384kdf-scheme" +#define NID_dhSinglePass_stdDH_sha384kdf_scheme 939 +#define OBJ_dhSinglePass_stdDH_sha384kdf_scheme 1L, 3L, 132L, 1L, 11L, 2L + +#define SN_dhSinglePass_stdDH_sha512kdf_scheme \ + "dhSinglePass-stdDH-sha512kdf-scheme" +#define NID_dhSinglePass_stdDH_sha512kdf_scheme 940 +#define OBJ_dhSinglePass_stdDH_sha512kdf_scheme 1L, 3L, 132L, 1L, 11L, 3L + +#define SN_dhSinglePass_cofactorDH_sha1kdf_scheme \ + "dhSinglePass-cofactorDH-sha1kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha1kdf_scheme 941 +#define OBJ_dhSinglePass_cofactorDH_sha1kdf_scheme \ + 1L, 3L, 133L, 16L, 840L, 63L, 0L, 3L + +#define SN_dhSinglePass_cofactorDH_sha224kdf_scheme \ + "dhSinglePass-cofactorDH-sha224kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha224kdf_scheme 942 +#define OBJ_dhSinglePass_cofactorDH_sha224kdf_scheme 1L, 3L, 132L, 1L, 14L, 0L + +#define SN_dhSinglePass_cofactorDH_sha256kdf_scheme \ + "dhSinglePass-cofactorDH-sha256kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha256kdf_scheme 943 +#define OBJ_dhSinglePass_cofactorDH_sha256kdf_scheme 1L, 3L, 132L, 1L, 14L, 1L + +#define SN_dhSinglePass_cofactorDH_sha384kdf_scheme \ + "dhSinglePass-cofactorDH-sha384kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha384kdf_scheme 944 +#define OBJ_dhSinglePass_cofactorDH_sha384kdf_scheme 1L, 3L, 132L, 1L, 14L, 2L + +#define SN_dhSinglePass_cofactorDH_sha512kdf_scheme \ + "dhSinglePass-cofactorDH-sha512kdf-scheme" +#define NID_dhSinglePass_cofactorDH_sha512kdf_scheme 945 +#define OBJ_dhSinglePass_cofactorDH_sha512kdf_scheme 1L, 3L, 132L, 1L, 14L, 3L + +#define SN_dh_std_kdf "dh-std-kdf" +#define NID_dh_std_kdf 946 + +#define SN_dh_cofactor_kdf "dh-cofactor-kdf" +#define NID_dh_cofactor_kdf 947 + +#define SN_X25519 "X25519" +#define NID_X25519 948 +#define OBJ_X25519 1L, 3L, 101L, 110L + +#define SN_ED25519 "ED25519" +#define NID_ED25519 949 +#define OBJ_ED25519 1L, 3L, 101L, 112L + +#define SN_chacha20_poly1305 "ChaCha20-Poly1305" +#define LN_chacha20_poly1305 "chacha20-poly1305" +#define NID_chacha20_poly1305 950 + +#define SN_kx_rsa "KxRSA" +#define LN_kx_rsa "kx-rsa" +#define NID_kx_rsa 951 + +#define SN_kx_ecdhe "KxECDHE" +#define LN_kx_ecdhe "kx-ecdhe" +#define NID_kx_ecdhe 952 + +#define SN_kx_psk "KxPSK" +#define LN_kx_psk "kx-psk" +#define NID_kx_psk 953 + +#define SN_auth_rsa "AuthRSA" +#define LN_auth_rsa "auth-rsa" +#define NID_auth_rsa 954 + +#define SN_auth_ecdsa "AuthECDSA" +#define LN_auth_ecdsa "auth-ecdsa" +#define NID_auth_ecdsa 955 + +#define SN_auth_psk "AuthPSK" +#define LN_auth_psk "auth-psk" +#define NID_auth_psk 956 + +#define SN_kx_any "KxANY" +#define LN_kx_any "kx-any" +#define NID_kx_any 957 + +#define SN_auth_any "AuthANY" +#define LN_auth_any "auth-any" +#define NID_auth_any 958 + +#define SN_CECPQ2 "CECPQ2" +#define NID_CECPQ2 959 + +#define SN_ED448 "ED448" +#define NID_ED448 960 +#define OBJ_ED448 1L, 3L, 101L, 113L + +#define SN_X448 "X448" +#define NID_X448 961 +#define OBJ_X448 1L, 3L, 101L, 111L + + +#if defined(__cplusplus) +} /* extern C */ +#endif + +#endif /* OPENSSL_HEADER_NID_H */ diff --git a/Pods/BoringSSL-GRPC/include/openssl/nid.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/nid.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/nid.h.grpc_back index afeb2dea4..a15f4e3d6 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/nid.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/nid.h.grpc_back @@ -4193,6 +4193,7 @@ extern "C" { #define SN_X25519 "X25519" #define NID_X25519 948 +#define OBJ_X25519 1L, 3L, 101L, 110L #define SN_ED25519 "ED25519" #define NID_ED25519 949 @@ -4234,6 +4235,17 @@ extern "C" { #define LN_auth_any "auth-any" #define NID_auth_any 958 +#define SN_CECPQ2 "CECPQ2" +#define NID_CECPQ2 959 + +#define SN_ED448 "ED448" +#define NID_ED448 960 +#define OBJ_ED448 1L, 3L, 101L, 113L + +#define SN_X448 "X448" +#define NID_X448 961 +#define OBJ_X448 1L, 3L, 101L, 111L + #if defined(__cplusplus) } /* extern C */ diff --git a/Pods/BoringSSL-GRPC/include/openssl/obj.h b/Pods/BoringSSL-GRPC/src/include/openssl/obj.h similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/obj.h rename to Pods/BoringSSL-GRPC/src/include/openssl/obj.h index 572a21af0..41f3e9d54 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/obj.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/obj.h @@ -222,6 +222,9 @@ OPENSSL_EXPORT void OBJ_NAME_do_all(int type, void (*callback)(const OBJ_NAME *, void *arg), void *arg); +// OBJ_cleanup does nothing. +OPENSSL_EXPORT void OBJ_cleanup(void); + #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.back new file mode 100644 index 000000000..764188f48 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.back @@ -0,0 +1,236 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_OBJ_H +#define OPENSSL_HEADER_OBJ_H + +#include + +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// The objects library deals with the registration and indexing of ASN.1 object +// identifiers. These values are often written as a dotted sequence of numbers, +// e.g. 1.2.840.113549.1.9.16.3.9. +// +// Internally, OpenSSL likes to deal with these values by numbering them with +// numbers called "nids". OpenSSL has a large, built-in database of common +// object identifiers and also has both short and long names for them. +// +// This library provides functions for translating between object identifiers, +// nids, short names and long names. +// +// The nid values should not be used outside of a single process: they are not +// stable identifiers. + + +// Basic operations. + +// OBJ_dup returns a duplicate copy of |obj| or NULL on allocation failure. +OPENSSL_EXPORT ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *obj); + +// OBJ_cmp returns a value less than, equal to or greater than zero if |a| is +// less than, equal to or greater than |b|, respectively. +OPENSSL_EXPORT int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b); + +// OBJ_get0_data returns a pointer to the DER representation of |obj|. +OPENSSL_EXPORT const uint8_t *OBJ_get0_data(const ASN1_OBJECT *obj); + +// OBJ_length returns the length of the DER representation of |obj|. +OPENSSL_EXPORT size_t OBJ_length(const ASN1_OBJECT *obj); + + +// Looking up nids. + +// OBJ_obj2nid returns the nid corresponding to |obj|, or |NID_undef| if no +// such object is known. +OPENSSL_EXPORT int OBJ_obj2nid(const ASN1_OBJECT *obj); + +// OBJ_cbs2nid returns the nid corresponding to the DER data in |cbs|, or +// |NID_undef| if no such object is known. +OPENSSL_EXPORT int OBJ_cbs2nid(const CBS *cbs); + +// OBJ_sn2nid returns the nid corresponding to |short_name|, or |NID_undef| if +// no such short name is known. +OPENSSL_EXPORT int OBJ_sn2nid(const char *short_name); + +// OBJ_ln2nid returns the nid corresponding to |long_name|, or |NID_undef| if +// no such long name is known. +OPENSSL_EXPORT int OBJ_ln2nid(const char *long_name); + +// OBJ_txt2nid returns the nid corresponding to |s|, which may be a short name, +// long name, or an ASCII string containing a dotted sequence of numbers. It +// returns the nid or NID_undef if unknown. +OPENSSL_EXPORT int OBJ_txt2nid(const char *s); + + +// Getting information about nids. + +// OBJ_nid2obj returns the ASN1_OBJECT corresponding to |nid|, or NULL if |nid| +// is unknown. +OPENSSL_EXPORT const ASN1_OBJECT *OBJ_nid2obj(int nid); + +// OBJ_nid2sn returns the short name for |nid|, or NULL if |nid| is unknown. +OPENSSL_EXPORT const char *OBJ_nid2sn(int nid); + +// OBJ_nid2ln returns the long name for |nid|, or NULL if |nid| is unknown. +OPENSSL_EXPORT const char *OBJ_nid2ln(int nid); + +// OBJ_nid2cbb writes |nid| as an ASN.1 OBJECT IDENTIFIER to |out|. It returns +// one on success or zero otherwise. +OPENSSL_EXPORT int OBJ_nid2cbb(CBB *out, int nid); + + +// Dealing with textual representations of object identifiers. + +// OBJ_txt2obj returns an ASN1_OBJECT for the textual representation in |s|. +// If |dont_search_names| is zero, then |s| will be matched against the long +// and short names of a known objects to find a match. Otherwise |s| must +// contain an ASCII string with a dotted sequence of numbers. The resulting +// object need not be previously known. It returns a freshly allocated +// |ASN1_OBJECT| or NULL on error. +OPENSSL_EXPORT ASN1_OBJECT *OBJ_txt2obj(const char *s, int dont_search_names); + +// OBJ_obj2txt converts |obj| to a textual representation. If +// |always_return_oid| is zero then |obj| will be matched against known objects +// and the long (preferably) or short name will be used if found. Otherwise +// |obj| will be converted into a dotted sequence of integers. If |out| is not +// NULL, then at most |out_len| bytes of the textual form will be written +// there. If |out_len| is at least one, then string written to |out| will +// always be NUL terminated. It returns the number of characters that could +// have been written, not including the final NUL, or -1 on error. +OPENSSL_EXPORT int OBJ_obj2txt(char *out, int out_len, const ASN1_OBJECT *obj, + int always_return_oid); + + +// Adding objects at runtime. + +// OBJ_create adds a known object and returns the nid of the new object, or +// NID_undef on error. +OPENSSL_EXPORT int OBJ_create(const char *oid, const char *short_name, + const char *long_name); + + +// Handling signature algorithm identifiers. +// +// Some NIDs (e.g. sha256WithRSAEncryption) specify both a digest algorithm and +// a public key algorithm. The following functions map between pairs of digest +// and public-key algorithms and the NIDs that specify their combination. +// +// Sometimes the combination NID leaves the digest unspecified (e.g. +// rsassaPss). In these cases, the digest NID is |NID_undef|. + +// OBJ_find_sigid_algs finds the digest and public-key NIDs that correspond to +// the signing algorithm |sign_nid|. If successful, it sets |*out_digest_nid| +// and |*out_pkey_nid| and returns one. Otherwise it returns zero. Any of +// |out_digest_nid| or |out_pkey_nid| can be NULL if the caller doesn't need +// that output value. +OPENSSL_EXPORT int OBJ_find_sigid_algs(int sign_nid, int *out_digest_nid, + int *out_pkey_nid); + +// OBJ_find_sigid_by_algs finds the signature NID that corresponds to the +// combination of |digest_nid| and |pkey_nid|. If success, it sets +// |*out_sign_nid| and returns one. Otherwise it returns zero. The +// |out_sign_nid| argument can be NULL if the caller only wishes to learn +// whether the combination is valid. +OPENSSL_EXPORT int OBJ_find_sigid_by_algs(int *out_sign_nid, int digest_nid, + int pkey_nid); + + +// Deprecated functions. + +typedef struct obj_name_st { + int type; + int alias; + const char *name; + const char *data; +} OBJ_NAME; + +#define OBJ_NAME_TYPE_MD_METH 1 +#define OBJ_NAME_TYPE_CIPHER_METH 2 + +// OBJ_NAME_do_all_sorted calls |callback| zero or more times, each time with +// the name of a different primitive. If |type| is |OBJ_NAME_TYPE_MD_METH| then +// the primitives will be hash functions, alternatively if |type| is +// |OBJ_NAME_TYPE_CIPHER_METH| then the primitives will be ciphers or cipher +// modes. +// +// This function is ill-specified and should never be used. +OPENSSL_EXPORT void OBJ_NAME_do_all_sorted( + int type, void (*callback)(const OBJ_NAME *, void *arg), void *arg); + +// OBJ_NAME_do_all calls |OBJ_NAME_do_all_sorted|. +OPENSSL_EXPORT void OBJ_NAME_do_all(int type, void (*callback)(const OBJ_NAME *, + void *arg), + void *arg); + +// OBJ_cleanup does nothing. +OPENSSL_EXPORT void OBJ_cleanup(void); + + +#if defined(__cplusplus) +} // extern C +#endif + +#define OBJ_R_UNKNOWN_NID 100 +#define OBJ_R_INVALID_OID_STRING 101 + +#endif // OPENSSL_HEADER_OBJ_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/obj.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/obj.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/obj.h.grpc_back index 374658ea3..764188f48 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/obj.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/obj.h.grpc_back @@ -222,6 +222,9 @@ OPENSSL_EXPORT void OBJ_NAME_do_all(int type, void (*callback)(const OBJ_NAME *, void *arg), void *arg); +// OBJ_cleanup does nothing. +OPENSSL_EXPORT void OBJ_cleanup(void); + #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/include/openssl/obj_mac.h b/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/obj_mac.h rename to Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/obj_mac.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/obj_mac.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.grpc_back new file mode 100644 index 000000000..e7ccadc19 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/obj_mac.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "nid.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/objects.h b/Pods/BoringSSL-GRPC/src/include/openssl/objects.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/objects.h rename to Pods/BoringSSL-GRPC/src/include/openssl/objects.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/objects.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/objects.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/objects.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.grpc_back new file mode 100644 index 000000000..dd6556f26 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/objects.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "obj.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/opensslconf.h b/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/opensslconf.h rename to Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/opensslconf.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/opensslconf.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.grpc_back new file mode 100644 index 000000000..3c6ffd8be --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/opensslconf.h.grpc_back @@ -0,0 +1,67 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#ifndef OPENSSL_HEADER_OPENSSLCONF_H +#define OPENSSL_HEADER_OPENSSLCONF_H + + +#define OPENSSL_NO_ASYNC +#define OPENSSL_NO_BF +#define OPENSSL_NO_BLAKE2 +#define OPENSSL_NO_BUF_FREELISTS +#define OPENSSL_NO_CAMELLIA +#define OPENSSL_NO_CAPIENG +#define OPENSSL_NO_CAST +#define OPENSSL_NO_CMS +#define OPENSSL_NO_COMP +#define OPENSSL_NO_CT +#define OPENSSL_NO_DANE +#define OPENSSL_NO_DEPRECATED +#define OPENSSL_NO_DGRAM +#define OPENSSL_NO_DYNAMIC_ENGINE +#define OPENSSL_NO_EC_NISTP_64_GCC_128 +#define OPENSSL_NO_EC2M +#define OPENSSL_NO_EGD +#define OPENSSL_NO_ENGINE +#define OPENSSL_NO_GMP +#define OPENSSL_NO_GOST +#define OPENSSL_NO_HEARTBEATS +#define OPENSSL_NO_HW +#define OPENSSL_NO_IDEA +#define OPENSSL_NO_JPAKE +#define OPENSSL_NO_KRB5 +#define OPENSSL_NO_MD2 +#define OPENSSL_NO_MDC2 +#define OPENSSL_NO_OCB +#define OPENSSL_NO_OCSP +#define OPENSSL_NO_RC2 +#define OPENSSL_NO_RC5 +#define OPENSSL_NO_RFC3779 +#define OPENSSL_NO_RIPEMD +#define OPENSSL_NO_RMD160 +#define OPENSSL_NO_SCTP +#define OPENSSL_NO_SEED +#define OPENSSL_NO_SRP +#define OPENSSL_NO_SSL2 +#define OPENSSL_NO_SSL3 +#define OPENSSL_NO_SSL3_METHOD +#define OPENSSL_NO_STATIC_ENGINE +#define OPENSSL_NO_STORE +#define OPENSSL_NO_WHIRLPOOL + + +#endif // OPENSSL_HEADER_OPENSSLCONF_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/opensslv.h b/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/opensslv.h rename to Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/opensslv.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/opensslv.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.grpc_back new file mode 100644 index 000000000..a3555d4f8 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/opensslv.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "crypto.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/ossl_typ.h b/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/ossl_typ.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/ossl_typ.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/ossl_typ.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.grpc_back new file mode 100644 index 000000000..c2b3fe7c5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ossl_typ.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "base.h" diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pem.h b/Pods/BoringSSL-GRPC/src/include/openssl/pem.h new file mode 100644 index 000000000..f5fb945a5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pem.h @@ -0,0 +1,435 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_PEM_H +#define OPENSSL_HEADER_PEM_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* For compatibility with open-iscsi, which assumes that it can get + * |OPENSSL_malloc| from pem.h or err.h */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#define PEM_BUFSIZE 1024 + +#define PEM_STRING_X509_OLD "X509 CERTIFICATE" +#define PEM_STRING_X509 "CERTIFICATE" +#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" +#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" +#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" +#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" +#define PEM_STRING_X509_CRL "X509 CRL" +#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" +#define PEM_STRING_PUBLIC "PUBLIC KEY" +#define PEM_STRING_RSA "RSA PRIVATE KEY" +#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" +#define PEM_STRING_DSA "DSA PRIVATE KEY" +#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" +#define PEM_STRING_EC "EC PRIVATE KEY" +#define PEM_STRING_PKCS7 "PKCS7" +#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" +#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" +#define PEM_STRING_PKCS8INF "PRIVATE KEY" +#define PEM_STRING_DHPARAMS "DH PARAMETERS" +#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" +#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" +#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" +#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" +#define PEM_STRING_CMS "CMS" + +/* enc_type is one off */ +#define PEM_TYPE_ENCRYPTED 10 +#define PEM_TYPE_MIC_ONLY 20 +#define PEM_TYPE_MIC_CLEAR 30 +#define PEM_TYPE_CLEAR 40 + +/* These macros make the PEM_read/PEM_write functions easier to maintain and + * write. Now they are all implemented with either: + * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) + */ + +#ifdef OPENSSL_NO_FP_API + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ + +#else + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ + static void *pem_read_##name##_d2i(void **x, const unsigned char **inp, \ + long len) { \ + return d2i_##asn1((type **)x, inp, len); \ + } \ + OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, \ + pem_password_cb *cb, void *u) { \ + return (type *)PEM_ASN1_read(pem_read_##name##_d2i, str, fp, (void **)x, \ + cb, u); \ + } + +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, NULL, NULL, 0, \ + NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, (void *)x, NULL, \ + NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name( \ + FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, enc, kstr, klen, \ + cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name( \ + FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, enc, kstr, klen, \ + cb, u); \ + } + +#endif + +#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + static void *pem_read_bio_##name##_d2i(void **x, const unsigned char **inp, \ + long len) { \ + return d2i_##asn1((type **)x, inp, len); \ + } \ + OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, \ + pem_password_cb *cb, void *u) { \ + return (type *)PEM_ASN1_read_bio(pem_read_bio_##name##_d2i, str, bp, \ + (void **)x, cb, u); \ + } + +#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, x, NULL, \ + NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, (void *)x, \ + NULL, NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name( \ + BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, x, enc, \ + kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name( \ + BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, (void *)x, \ + enc, kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_read_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb(name, type, str, asn1) + +/* These are the same except they are for the declarations */ + +#if defined(OPENSSL_NO_FP_API) + +#define DECLARE_PEM_read_fp(name, type) /**/ +#define DECLARE_PEM_write_fp(name, type) /**/ +#define DECLARE_PEM_write_cb_fp(name, type) /**/ + +#else + +#define DECLARE_PEM_read_fp(name, type) \ + OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_fp(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x); + +#define DECLARE_PEM_write_fp_const(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x); + +#define DECLARE_PEM_write_cb_fp(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + +#endif + +#define DECLARE_PEM_read_bio(name, type) \ + OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_bio(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x); + +#define DECLARE_PEM_write_bio_const(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x); + +#define DECLARE_PEM_write_cb_bio(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + + +#define DECLARE_PEM_write(name, type) \ + DECLARE_PEM_write_bio(name, type) \ + DECLARE_PEM_write_fp(name, type) + +#define DECLARE_PEM_write_const(name, type) \ + DECLARE_PEM_write_bio_const(name, type) \ + DECLARE_PEM_write_fp_const(name, type) + +#define DECLARE_PEM_write_cb(name, type) \ + DECLARE_PEM_write_cb_bio(name, type) \ + DECLARE_PEM_write_cb_fp(name, type) + +#define DECLARE_PEM_read(name, type) \ + DECLARE_PEM_read_bio(name, type) \ + DECLARE_PEM_read_fp(name, type) + +#define DECLARE_PEM_rw(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write(name, type) + +#define DECLARE_PEM_rw_const(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_const(name, type) + +#define DECLARE_PEM_rw_cb(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_cb(name, type) + +/* "userdata": new with OpenSSL 0.9.4 */ +typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); + +OPENSSL_EXPORT int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); +OPENSSL_EXPORT int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, pem_password_cb *callback,void *u); + +OPENSSL_EXPORT int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,long *len); +OPENSSL_EXPORT int PEM_write_bio(BIO *bp,const char *name, const char *hdr, const unsigned char *data, long len); +OPENSSL_EXPORT int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); +OPENSSL_EXPORT void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp, void *x, const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); + +OPENSSL_EXPORT int PEM_read(FILE *fp, char **name, char **header, unsigned char **data,long *len); +OPENSSL_EXPORT int PEM_write(FILE *fp, const char *name, const char *hdr, const unsigned char *data, long len); +OPENSSL_EXPORT void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u); +OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); + +/* PEM_def_callback treats |userdata| as a string and copies it into |buf|, + * assuming its |size| is sufficient. Returns the length of the string, or 0 + * if there is not enough room. If either |buf| or |userdata| is NULL, 0 is + * returned. Note that this is different from OpenSSL, which prompts for a + * password. */ +OPENSSL_EXPORT int PEM_def_callback(char *buf, int size, int rwflag, void *userdata); +OPENSSL_EXPORT void PEM_proc_type(char *buf, int type); +OPENSSL_EXPORT void PEM_dek_info(char *buf, const char *type, int len, char *str); + + +DECLARE_PEM_rw(X509, X509) + +DECLARE_PEM_rw(X509_AUX, X509) + +DECLARE_PEM_rw(X509_REQ, X509_REQ) +DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) + +DECLARE_PEM_rw(X509_CRL, X509_CRL) + +DECLARE_PEM_rw(PKCS7, PKCS7) +DECLARE_PEM_rw(PKCS8, X509_SIG) + +DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) + +DECLARE_PEM_rw_const(RSAPublicKey, RSA) +DECLARE_PEM_rw(RSA_PUBKEY, RSA) + +#ifndef OPENSSL_NO_DSA + +DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) + +DECLARE_PEM_rw(DSA_PUBKEY, DSA) + +DECLARE_PEM_rw_const(DSAparams, DSA) + +#endif + +DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) +DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) + + +DECLARE_PEM_rw_const(DHparams, DH) + + +DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) + +DECLARE_PEM_rw(PUBKEY, EVP_PKEY) + +OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, char *, int, pem_password_cb *, void *); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); + + +#ifdef __cplusplus +} +#endif + +#define PEM_R_BAD_BASE64_DECODE 100 +#define PEM_R_BAD_DECRYPT 101 +#define PEM_R_BAD_END_LINE 102 +#define PEM_R_BAD_IV_CHARS 103 +#define PEM_R_BAD_PASSWORD_READ 104 +#define PEM_R_CIPHER_IS_NULL 105 +#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 106 +#define PEM_R_NOT_DEK_INFO 107 +#define PEM_R_NOT_ENCRYPTED 108 +#define PEM_R_NOT_PROC_TYPE 109 +#define PEM_R_NO_START_LINE 110 +#define PEM_R_READ_KEY 111 +#define PEM_R_SHORT_HEADER 112 +#define PEM_R_UNSUPPORTED_CIPHER 113 +#define PEM_R_UNSUPPORTED_ENCRYPTION 114 + +#endif /* OPENSSL_HEADER_PEM_H */ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.back new file mode 100644 index 000000000..9c0ff93cc --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.back @@ -0,0 +1,435 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_PEM_H +#define OPENSSL_HEADER_PEM_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* For compatibility with open-iscsi, which assumes that it can get + * |OPENSSL_malloc| from pem.h or err.h */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#define PEM_BUFSIZE 1024 + +#define PEM_STRING_X509_OLD "X509 CERTIFICATE" +#define PEM_STRING_X509 "CERTIFICATE" +#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" +#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" +#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" +#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" +#define PEM_STRING_X509_CRL "X509 CRL" +#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" +#define PEM_STRING_PUBLIC "PUBLIC KEY" +#define PEM_STRING_RSA "RSA PRIVATE KEY" +#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" +#define PEM_STRING_DSA "DSA PRIVATE KEY" +#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" +#define PEM_STRING_EC "EC PRIVATE KEY" +#define PEM_STRING_PKCS7 "PKCS7" +#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" +#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" +#define PEM_STRING_PKCS8INF "PRIVATE KEY" +#define PEM_STRING_DHPARAMS "DH PARAMETERS" +#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" +#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" +#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" +#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" +#define PEM_STRING_CMS "CMS" + +/* enc_type is one off */ +#define PEM_TYPE_ENCRYPTED 10 +#define PEM_TYPE_MIC_ONLY 20 +#define PEM_TYPE_MIC_CLEAR 30 +#define PEM_TYPE_CLEAR 40 + +/* These macros make the PEM_read/PEM_write functions easier to maintain and + * write. Now they are all implemented with either: + * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) + */ + +#ifdef OPENSSL_NO_FP_API + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ + +#else + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ + static void *pem_read_##name##_d2i(void **x, const unsigned char **inp, \ + long len) { \ + return d2i_##asn1((type **)x, inp, len); \ + } \ + OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, \ + pem_password_cb *cb, void *u) { \ + return (type *)PEM_ASN1_read(pem_read_##name##_d2i, str, fp, (void **)x, \ + cb, u); \ + } + +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, NULL, NULL, 0, \ + NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, (void *)x, NULL, \ + NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name( \ + FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, enc, kstr, klen, \ + cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name( \ + FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, enc, kstr, klen, \ + cb, u); \ + } + +#endif + +#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + static void *pem_read_bio_##name##_d2i(void **x, const unsigned char **inp, \ + long len) { \ + return d2i_##asn1((type **)x, inp, len); \ + } \ + OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, \ + pem_password_cb *cb, void *u) { \ + return (type *)PEM_ASN1_read_bio(pem_read_bio_##name##_d2i, str, bp, \ + (void **)x, cb, u); \ + } + +#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, x, NULL, \ + NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, (void *)x, \ + NULL, NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name( \ + BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, x, enc, \ + kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name( \ + BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, (void *)x, \ + enc, kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_read_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb(name, type, str, asn1) + +/* These are the same except they are for the declarations */ + +#if defined(OPENSSL_NO_FP_API) + +#define DECLARE_PEM_read_fp(name, type) /**/ +#define DECLARE_PEM_write_fp(name, type) /**/ +#define DECLARE_PEM_write_cb_fp(name, type) /**/ + +#else + +#define DECLARE_PEM_read_fp(name, type) \ + OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_fp(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x); + +#define DECLARE_PEM_write_fp_const(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x); + +#define DECLARE_PEM_write_cb_fp(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + +#endif + +#define DECLARE_PEM_read_bio(name, type) \ + OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_bio(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x); + +#define DECLARE_PEM_write_bio_const(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x); + +#define DECLARE_PEM_write_cb_bio(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + + +#define DECLARE_PEM_write(name, type) \ + DECLARE_PEM_write_bio(name, type) \ + DECLARE_PEM_write_fp(name, type) + +#define DECLARE_PEM_write_const(name, type) \ + DECLARE_PEM_write_bio_const(name, type) \ + DECLARE_PEM_write_fp_const(name, type) + +#define DECLARE_PEM_write_cb(name, type) \ + DECLARE_PEM_write_cb_bio(name, type) \ + DECLARE_PEM_write_cb_fp(name, type) + +#define DECLARE_PEM_read(name, type) \ + DECLARE_PEM_read_bio(name, type) \ + DECLARE_PEM_read_fp(name, type) + +#define DECLARE_PEM_rw(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write(name, type) + +#define DECLARE_PEM_rw_const(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_const(name, type) + +#define DECLARE_PEM_rw_cb(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_cb(name, type) + +/* "userdata": new with OpenSSL 0.9.4 */ +typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); + +OPENSSL_EXPORT int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); +OPENSSL_EXPORT int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, pem_password_cb *callback,void *u); + +OPENSSL_EXPORT int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,long *len); +OPENSSL_EXPORT int PEM_write_bio(BIO *bp,const char *name, const char *hdr, const unsigned char *data, long len); +OPENSSL_EXPORT int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); +OPENSSL_EXPORT void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp, void *x, const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); + +OPENSSL_EXPORT int PEM_read(FILE *fp, char **name, char **header, unsigned char **data,long *len); +OPENSSL_EXPORT int PEM_write(FILE *fp, const char *name, const char *hdr, const unsigned char *data, long len); +OPENSSL_EXPORT void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u); +OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); + +/* PEM_def_callback treats |userdata| as a string and copies it into |buf|, + * assuming its |size| is sufficient. Returns the length of the string, or 0 + * if there is not enough room. If either |buf| or |userdata| is NULL, 0 is + * returned. Note that this is different from OpenSSL, which prompts for a + * password. */ +OPENSSL_EXPORT int PEM_def_callback(char *buf, int size, int rwflag, void *userdata); +OPENSSL_EXPORT void PEM_proc_type(char *buf, int type); +OPENSSL_EXPORT void PEM_dek_info(char *buf, const char *type, int len, char *str); + + +DECLARE_PEM_rw(X509, X509) + +DECLARE_PEM_rw(X509_AUX, X509) + +DECLARE_PEM_rw(X509_REQ, X509_REQ) +DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) + +DECLARE_PEM_rw(X509_CRL, X509_CRL) + +DECLARE_PEM_rw(PKCS7, PKCS7) +DECLARE_PEM_rw(PKCS8, X509_SIG) + +DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) + +DECLARE_PEM_rw_const(RSAPublicKey, RSA) +DECLARE_PEM_rw(RSA_PUBKEY, RSA) + +#ifndef OPENSSL_NO_DSA + +DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) + +DECLARE_PEM_rw(DSA_PUBKEY, DSA) + +DECLARE_PEM_rw_const(DSAparams, DSA) + +#endif + +DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) +DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) + + +DECLARE_PEM_rw_const(DHparams, DH) + + +DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) + +DECLARE_PEM_rw(PUBKEY, EVP_PKEY) + +OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, char *, int, pem_password_cb *, void *); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); + + +#ifdef __cplusplus +} +#endif + +#define PEM_R_BAD_BASE64_DECODE 100 +#define PEM_R_BAD_DECRYPT 101 +#define PEM_R_BAD_END_LINE 102 +#define PEM_R_BAD_IV_CHARS 103 +#define PEM_R_BAD_PASSWORD_READ 104 +#define PEM_R_CIPHER_IS_NULL 105 +#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 106 +#define PEM_R_NOT_DEK_INFO 107 +#define PEM_R_NOT_ENCRYPTED 108 +#define PEM_R_NOT_PROC_TYPE 109 +#define PEM_R_NO_START_LINE 110 +#define PEM_R_READ_KEY 111 +#define PEM_R_SHORT_HEADER 112 +#define PEM_R_UNSUPPORTED_CIPHER 113 +#define PEM_R_UNSUPPORTED_ENCRYPTION 114 + +#endif /* OPENSSL_HEADER_PEM_H */ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.grpc_back new file mode 100644 index 000000000..9c0ff93cc --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pem.h.grpc_back @@ -0,0 +1,435 @@ +/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_PEM_H +#define OPENSSL_HEADER_PEM_H + +#include +#include +#include +#include +#include +#include +#include +#include + +/* For compatibility with open-iscsi, which assumes that it can get + * |OPENSSL_malloc| from pem.h or err.h */ +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#define PEM_BUFSIZE 1024 + +#define PEM_STRING_X509_OLD "X509 CERTIFICATE" +#define PEM_STRING_X509 "CERTIFICATE" +#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" +#define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" +#define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" +#define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" +#define PEM_STRING_X509_CRL "X509 CRL" +#define PEM_STRING_EVP_PKEY "ANY PRIVATE KEY" +#define PEM_STRING_PUBLIC "PUBLIC KEY" +#define PEM_STRING_RSA "RSA PRIVATE KEY" +#define PEM_STRING_RSA_PUBLIC "RSA PUBLIC KEY" +#define PEM_STRING_DSA "DSA PRIVATE KEY" +#define PEM_STRING_DSA_PUBLIC "DSA PUBLIC KEY" +#define PEM_STRING_EC "EC PRIVATE KEY" +#define PEM_STRING_PKCS7 "PKCS7" +#define PEM_STRING_PKCS7_SIGNED "PKCS #7 SIGNED DATA" +#define PEM_STRING_PKCS8 "ENCRYPTED PRIVATE KEY" +#define PEM_STRING_PKCS8INF "PRIVATE KEY" +#define PEM_STRING_DHPARAMS "DH PARAMETERS" +#define PEM_STRING_SSL_SESSION "SSL SESSION PARAMETERS" +#define PEM_STRING_DSAPARAMS "DSA PARAMETERS" +#define PEM_STRING_ECDSA_PUBLIC "ECDSA PUBLIC KEY" +#define PEM_STRING_ECPRIVATEKEY "EC PRIVATE KEY" +#define PEM_STRING_CMS "CMS" + +/* enc_type is one off */ +#define PEM_TYPE_ENCRYPTED 10 +#define PEM_TYPE_MIC_ONLY 20 +#define PEM_TYPE_MIC_CLEAR 30 +#define PEM_TYPE_CLEAR 40 + +/* These macros make the PEM_read/PEM_write functions easier to maintain and + * write. Now they are all implemented with either: + * IMPLEMENT_PEM_rw(...) or IMPLEMENT_PEM_rw_cb(...) + */ + +#ifdef OPENSSL_NO_FP_API + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) /**/ +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) /**/ + +#else + +#define IMPLEMENT_PEM_read_fp(name, type, str, asn1) \ + static void *pem_read_##name##_d2i(void **x, const unsigned char **inp, \ + long len) { \ + return d2i_##asn1((type **)x, inp, len); \ + } \ + OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, \ + pem_password_cb *cb, void *u) { \ + return (type *)PEM_ASN1_read(pem_read_##name##_d2i, str, fp, (void **)x, \ + cb, u); \ + } + +#define IMPLEMENT_PEM_write_fp(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, NULL, NULL, 0, \ + NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, (void *)x, NULL, \ + NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name( \ + FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, enc, kstr, klen, \ + cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) \ + static int pem_write_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_##name( \ + FILE *fp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write(pem_write_##name##_i2d, str, fp, x, enc, kstr, klen, \ + cb, u); \ + } + +#endif + +#define IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + static void *pem_read_bio_##name##_d2i(void **x, const unsigned char **inp, \ + long len) { \ + return d2i_##asn1((type **)x, inp, len); \ + } \ + OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, \ + pem_password_cb *cb, void *u) { \ + return (type *)PEM_ASN1_read_bio(pem_read_bio_##name##_d2i, str, bp, \ + (void **)x, cb, u); \ + } + +#define IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, x, NULL, \ + NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, (void *)x, \ + NULL, NULL, 0, NULL, NULL); \ + } + +#define IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name( \ + BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, x, enc, \ + kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + static int pem_write_bio_##name##_i2d(const void *x, unsigned char **outp) { \ + return i2d_##asn1((const type *)x, outp); \ + } \ + OPENSSL_EXPORT int PEM_write_bio_##name( \ + BIO *bp, type *x, const EVP_CIPHER *enc, unsigned char *kstr, int klen, \ + pem_password_cb *cb, void *u) { \ + return PEM_ASN1_write_bio(pem_write_bio_##name##_i2d, str, bp, (void *)x, \ + enc, kstr, klen, cb, u); \ + } + +#define IMPLEMENT_PEM_write(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_write_cb_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_bio_const(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb_fp_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_read_bio(name, type, str, asn1) \ + IMPLEMENT_PEM_read_fp(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_const(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_const(name, type, str, asn1) + +#define IMPLEMENT_PEM_rw_cb(name, type, str, asn1) \ + IMPLEMENT_PEM_read(name, type, str, asn1) \ + IMPLEMENT_PEM_write_cb(name, type, str, asn1) + +/* These are the same except they are for the declarations */ + +#if defined(OPENSSL_NO_FP_API) + +#define DECLARE_PEM_read_fp(name, type) /**/ +#define DECLARE_PEM_write_fp(name, type) /**/ +#define DECLARE_PEM_write_cb_fp(name, type) /**/ + +#else + +#define DECLARE_PEM_read_fp(name, type) \ + OPENSSL_EXPORT type *PEM_read_##name(FILE *fp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_fp(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x); + +#define DECLARE_PEM_write_fp_const(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, const type *x); + +#define DECLARE_PEM_write_cb_fp(name, type) \ + OPENSSL_EXPORT int PEM_write_##name(FILE *fp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + +#endif + +#define DECLARE_PEM_read_bio(name, type) \ + OPENSSL_EXPORT type *PEM_read_bio_##name(BIO *bp, type **x, pem_password_cb *cb, void *u); + +#define DECLARE_PEM_write_bio(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x); + +#define DECLARE_PEM_write_bio_const(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, const type *x); + +#define DECLARE_PEM_write_cb_bio(name, type) \ + OPENSSL_EXPORT int PEM_write_bio_##name(BIO *bp, type *x, const EVP_CIPHER *enc, \ + unsigned char *kstr, int klen, pem_password_cb *cb, void *u); + + +#define DECLARE_PEM_write(name, type) \ + DECLARE_PEM_write_bio(name, type) \ + DECLARE_PEM_write_fp(name, type) + +#define DECLARE_PEM_write_const(name, type) \ + DECLARE_PEM_write_bio_const(name, type) \ + DECLARE_PEM_write_fp_const(name, type) + +#define DECLARE_PEM_write_cb(name, type) \ + DECLARE_PEM_write_cb_bio(name, type) \ + DECLARE_PEM_write_cb_fp(name, type) + +#define DECLARE_PEM_read(name, type) \ + DECLARE_PEM_read_bio(name, type) \ + DECLARE_PEM_read_fp(name, type) + +#define DECLARE_PEM_rw(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write(name, type) + +#define DECLARE_PEM_rw_const(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_const(name, type) + +#define DECLARE_PEM_rw_cb(name, type) \ + DECLARE_PEM_read(name, type) \ + DECLARE_PEM_write_cb(name, type) + +/* "userdata": new with OpenSSL 0.9.4 */ +typedef int pem_password_cb(char *buf, int size, int rwflag, void *userdata); + +OPENSSL_EXPORT int PEM_get_EVP_CIPHER_INFO(char *header, EVP_CIPHER_INFO *cipher); +OPENSSL_EXPORT int PEM_do_header (EVP_CIPHER_INFO *cipher, unsigned char *data,long *len, pem_password_cb *callback,void *u); + +OPENSSL_EXPORT int PEM_read_bio(BIO *bp, char **name, char **header, unsigned char **data,long *len); +OPENSSL_EXPORT int PEM_write_bio(BIO *bp,const char *name, const char *hdr, const unsigned char *data, long len); +OPENSSL_EXPORT int PEM_bytes_read_bio(unsigned char **pdata, long *plen, char **pnm, const char *name, BIO *bp, pem_password_cb *cb, void *u); +OPENSSL_EXPORT void * PEM_ASN1_read_bio(d2i_of_void *d2i, const char *name, BIO *bp, void **x, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_ASN1_write_bio(i2d_of_void *i2d,const char *name,BIO *bp, void *x, const EVP_CIPHER *enc,unsigned char *kstr,int klen, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read_bio(BIO *bp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_X509_INFO_write_bio(BIO *bp,X509_INFO *xi, EVP_CIPHER *enc, unsigned char *kstr, int klen, pem_password_cb *cd, void *u); + +OPENSSL_EXPORT int PEM_read(FILE *fp, char **name, char **header, unsigned char **data,long *len); +OPENSSL_EXPORT int PEM_write(FILE *fp, const char *name, const char *hdr, const unsigned char *data, long len); +OPENSSL_EXPORT void * PEM_ASN1_read(d2i_of_void *d2i, const char *name, FILE *fp, void **x, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_ASN1_write(i2d_of_void *i2d,const char *name,FILE *fp, void *x,const EVP_CIPHER *enc,unsigned char *kstr, int klen,pem_password_cb *callback, void *u); +OPENSSL_EXPORT STACK_OF(X509_INFO) * PEM_X509_INFO_read(FILE *fp, STACK_OF(X509_INFO) *sk, pem_password_cb *cb, void *u); + +/* PEM_def_callback treats |userdata| as a string and copies it into |buf|, + * assuming its |size| is sufficient. Returns the length of the string, or 0 + * if there is not enough room. If either |buf| or |userdata| is NULL, 0 is + * returned. Note that this is different from OpenSSL, which prompts for a + * password. */ +OPENSSL_EXPORT int PEM_def_callback(char *buf, int size, int rwflag, void *userdata); +OPENSSL_EXPORT void PEM_proc_type(char *buf, int type); +OPENSSL_EXPORT void PEM_dek_info(char *buf, const char *type, int len, char *str); + + +DECLARE_PEM_rw(X509, X509) + +DECLARE_PEM_rw(X509_AUX, X509) + +DECLARE_PEM_rw(X509_REQ, X509_REQ) +DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) + +DECLARE_PEM_rw(X509_CRL, X509_CRL) + +DECLARE_PEM_rw(PKCS7, PKCS7) +DECLARE_PEM_rw(PKCS8, X509_SIG) + +DECLARE_PEM_rw(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO) + +DECLARE_PEM_rw_cb(RSAPrivateKey, RSA) + +DECLARE_PEM_rw_const(RSAPublicKey, RSA) +DECLARE_PEM_rw(RSA_PUBKEY, RSA) + +#ifndef OPENSSL_NO_DSA + +DECLARE_PEM_rw_cb(DSAPrivateKey, DSA) + +DECLARE_PEM_rw(DSA_PUBKEY, DSA) + +DECLARE_PEM_rw_const(DSAparams, DSA) + +#endif + +DECLARE_PEM_rw_cb(ECPrivateKey, EC_KEY) +DECLARE_PEM_rw(EC_PUBKEY, EC_KEY) + + +DECLARE_PEM_rw_const(DHparams, DH) + + +DECLARE_PEM_rw_cb(PrivateKey, EVP_PKEY) + +DECLARE_PEM_rw(PUBKEY, EVP_PKEY) + +OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_write_bio_PKCS8PrivateKey(BIO *, EVP_PKEY *, const EVP_CIPHER *, char *, int, pem_password_cb *, void *); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); +OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey_nid(FILE *fp, EVP_PKEY *x, int nid, char *kstr, int klen, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); + +OPENSSL_EXPORT int PEM_write_PKCS8PrivateKey(FILE *fp,EVP_PKEY *x,const EVP_CIPHER *enc, char *kstr,int klen, pem_password_cb *cd, void *u); + + +#ifdef __cplusplus +} +#endif + +#define PEM_R_BAD_BASE64_DECODE 100 +#define PEM_R_BAD_DECRYPT 101 +#define PEM_R_BAD_END_LINE 102 +#define PEM_R_BAD_IV_CHARS 103 +#define PEM_R_BAD_PASSWORD_READ 104 +#define PEM_R_CIPHER_IS_NULL 105 +#define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 106 +#define PEM_R_NOT_DEK_INFO 107 +#define PEM_R_NOT_ENCRYPTED 108 +#define PEM_R_NOT_PROC_TYPE 109 +#define PEM_R_NO_START_LINE 110 +#define PEM_R_READ_KEY 111 +#define PEM_R_SHORT_HEADER 112 +#define PEM_R_UNSUPPORTED_CIPHER 113 +#define PEM_R_UNSUPPORTED_ENCRYPTION 114 + +#endif /* OPENSSL_HEADER_PEM_H */ diff --git a/Pods/BoringSSL-GRPC/include/openssl/pkcs12.h b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/pkcs12.h rename to Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/pkcs12.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/pkcs12.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.grpc_back new file mode 100644 index 000000000..b5e951638 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs12.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "pkcs8.h" diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h new file mode 100644 index 000000000..987d7b8b6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h @@ -0,0 +1,215 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_PKCS7_H +#define OPENSSL_HEADER_PKCS7_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// PKCS#7. +// +// This library contains functions for extracting information from PKCS#7 +// structures (RFC 2315). + +DECLARE_STACK_OF(CRYPTO_BUFFER) +DECLARE_STACK_OF(X509) +DECLARE_STACK_OF(X509_CRL) + +// PKCS7_get_raw_certificates parses a PKCS#7, SignedData structure from |cbs| +// and appends the included certificates to |out_certs|. It returns one on +// success and zero on error. |cbs| is advanced passed the structure. +// +// Note that a SignedData structure may contain no certificates, in which case +// this function succeeds but does not append any certificates. +OPENSSL_EXPORT int PKCS7_get_raw_certificates( + STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool); + +// PKCS7_get_certificates behaves like |PKCS7_get_raw_certificates| but parses +// them into |X509| objects. +OPENSSL_EXPORT int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs); + +// PKCS7_bundle_certificates appends a PKCS#7, SignedData structure containing +// |certs| to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int PKCS7_bundle_certificates( + CBB *out, const STACK_OF(X509) *certs); + +// PKCS7_get_CRLs parses a PKCS#7, SignedData structure from |cbs| and appends +// the included CRLs to |out_crls|. It returns one on success and zero on error. +// |cbs| is advanced passed the structure. +// +// Note that a SignedData structure may contain no CRLs, in which case this +// function succeeds but does not append any CRLs. +OPENSSL_EXPORT int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs); + +// PKCS7_bundle_CRLs appends a PKCS#7, SignedData structure containing +// |crls| to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls); + +// PKCS7_get_PEM_certificates reads a PEM-encoded, PKCS#7, SignedData structure +// from |pem_bio| and appends the included certificates to |out_certs|. It +// returns one on success and zero on error. +// +// Note that a SignedData structure may contain no certificates, in which case +// this function succeeds but does not append any certificates. +OPENSSL_EXPORT int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, + BIO *pem_bio); + +// PKCS7_get_PEM_CRLs reads a PEM-encoded, PKCS#7, SignedData structure from +// |pem_bio| and appends the included CRLs to |out_crls|. It returns one on +// success and zero on error. +// +// Note that a SignedData structure may contain no CRLs, in which case this +// function succeeds but does not append any CRLs. +OPENSSL_EXPORT int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, + BIO *pem_bio); + + +// Deprecated functions. +// +// These functions are a compatibility layer over a subset of OpenSSL's PKCS#7 +// API. It intentionally does not implement the whole thing, only the minimum +// needed to build cryptography.io. + +typedef struct { + STACK_OF(X509) *cert; + STACK_OF(X509_CRL) *crl; +} PKCS7_SIGNED; + +typedef struct { + STACK_OF(X509) *cert; + STACK_OF(X509_CRL) *crl; +} PKCS7_SIGN_ENVELOPE; + +typedef void PKCS7_ENVELOPE; +typedef void PKCS7_DIGEST; +typedef void PKCS7_ENCRYPT; + +typedef struct { + uint8_t *ber_bytes; + size_t ber_len; + + // Unlike OpenSSL, the following fields are immutable. They filled in when the + // object is parsed and ignored in serialization. + ASN1_OBJECT *type; + union { + char *ptr; + ASN1_OCTET_STRING *data; + PKCS7_SIGNED *sign; + PKCS7_ENVELOPE *enveloped; + PKCS7_SIGN_ENVELOPE *signed_and_enveloped; + PKCS7_DIGEST *digest; + PKCS7_ENCRYPT *encrypted; + ASN1_TYPE *other; + } d; +} PKCS7; + +// d2i_PKCS7 parses a BER-encoded, PKCS#7 signed data ContentInfo structure from +// |len| bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the +// result is in |*out|. Note that, even if |*out| is already non-NULL on entry, +// it will not be written to. Rather, a fresh |PKCS7| is allocated and the +// previous one is freed. On successful exit, |*inp| is advanced past the BER +// structure. It returns the result or NULL on error. +OPENSSL_EXPORT PKCS7 *d2i_PKCS7(PKCS7 **out, const uint8_t **inp, + size_t len); + +// d2i_PKCS7_bio behaves like |d2i_PKCS7| but reads the input from |bio|. If +// the length of the object is indefinite the full contents of |bio| are read. +// +// If the function fails then some unknown amount of data may have been read +// from |bio|. +OPENSSL_EXPORT PKCS7 *d2i_PKCS7_bio(BIO *bio, PKCS7 **out); + +// i2d_PKCS7 is a dummy function which copies the contents of |p7|. If |out| is +// not NULL then the result is written to |*out| and |*out| is advanced just +// past the output. It returns the number of bytes in the result, whether +// written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_PKCS7(const PKCS7 *p7, uint8_t **out); + +// i2d_PKCS7_bio writes |p7| to |bio|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int i2d_PKCS7_bio(BIO *bio, const PKCS7 *p7); + +// PKCS7_free releases memory associated with |p7|. +OPENSSL_EXPORT void PKCS7_free(PKCS7 *p7); + +// PKCS7_type_is_data returns zero. +OPENSSL_EXPORT int PKCS7_type_is_data(const PKCS7 *p7); + +// PKCS7_type_is_digest returns zero. +OPENSSL_EXPORT int PKCS7_type_is_digest(const PKCS7 *p7); + +// PKCS7_type_is_encrypted returns zero. +OPENSSL_EXPORT int PKCS7_type_is_encrypted(const PKCS7 *p7); + +// PKCS7_type_is_enveloped returns zero. +OPENSSL_EXPORT int PKCS7_type_is_enveloped(const PKCS7 *p7); + +// PKCS7_type_is_signed returns one. (We only supporte signed data +// ContentInfos.) +OPENSSL_EXPORT int PKCS7_type_is_signed(const PKCS7 *p7); + +// PKCS7_type_is_signedAndEnveloped returns zero. +OPENSSL_EXPORT int PKCS7_type_is_signedAndEnveloped(const PKCS7 *p7); + +// PKCS7_DETACHED indicates that the PKCS#7 file specifies its data externally. +#define PKCS7_DETACHED 0x40 + +// The following flags cause |PKCS7_sign| to fail. +#define PKCS7_TEXT 0x1 +#define PKCS7_NOCERTS 0x2 +#define PKCS7_NOSIGS 0x4 +#define PKCS7_NOCHAIN 0x8 +#define PKCS7_NOINTERN 0x10 +#define PKCS7_NOVERIFY 0x20 +#define PKCS7_BINARY 0x80 +#define PKCS7_NOATTR 0x100 +#define PKCS7_NOSMIMECAP 0x200 +#define PKCS7_STREAM 0x1000 + +// PKCS7_sign assembles |certs| into a PKCS#7 signed data ContentInfo with +// external data and no signatures. It returns a newly-allocated |PKCS7| on +// success or NULL on error. |sign_cert| and |pkey| must be NULL. |data| is +// ignored. |flags| must be equal to |PKCS7_DETACHED|. +// +// Note this function only implements a subset of the corresponding OpenSSL +// function. It is provided for backwards compatibility only. +OPENSSL_EXPORT PKCS7 *PKCS7_sign(X509 *sign_cert, EVP_PKEY *pkey, + STACK_OF(X509) *certs, BIO *data, int flags); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(PKCS7, PKCS7_free) + +BSSL_NAMESPACE_END +} // extern C++ +#endif + +#define PKCS7_R_BAD_PKCS7_VERSION 100 +#define PKCS7_R_NOT_PKCS7_SIGNED_DATA 101 +#define PKCS7_R_NO_CERTIFICATES_INCLUDED 102 +#define PKCS7_R_NO_CRLS_INCLUDED 103 + +#endif // OPENSSL_HEADER_PKCS7_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.back new file mode 100644 index 000000000..cb6155ff6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.back @@ -0,0 +1,215 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_PKCS7_H +#define OPENSSL_HEADER_PKCS7_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// PKCS#7. +// +// This library contains functions for extracting information from PKCS#7 +// structures (RFC 2315). + +DECLARE_STACK_OF(CRYPTO_BUFFER) +DECLARE_STACK_OF(X509) +DECLARE_STACK_OF(X509_CRL) + +// PKCS7_get_raw_certificates parses a PKCS#7, SignedData structure from |cbs| +// and appends the included certificates to |out_certs|. It returns one on +// success and zero on error. |cbs| is advanced passed the structure. +// +// Note that a SignedData structure may contain no certificates, in which case +// this function succeeds but does not append any certificates. +OPENSSL_EXPORT int PKCS7_get_raw_certificates( + STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool); + +// PKCS7_get_certificates behaves like |PKCS7_get_raw_certificates| but parses +// them into |X509| objects. +OPENSSL_EXPORT int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs); + +// PKCS7_bundle_certificates appends a PKCS#7, SignedData structure containing +// |certs| to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int PKCS7_bundle_certificates( + CBB *out, const STACK_OF(X509) *certs); + +// PKCS7_get_CRLs parses a PKCS#7, SignedData structure from |cbs| and appends +// the included CRLs to |out_crls|. It returns one on success and zero on error. +// |cbs| is advanced passed the structure. +// +// Note that a SignedData structure may contain no CRLs, in which case this +// function succeeds but does not append any CRLs. +OPENSSL_EXPORT int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs); + +// PKCS7_bundle_CRLs appends a PKCS#7, SignedData structure containing +// |crls| to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls); + +// PKCS7_get_PEM_certificates reads a PEM-encoded, PKCS#7, SignedData structure +// from |pem_bio| and appends the included certificates to |out_certs|. It +// returns one on success and zero on error. +// +// Note that a SignedData structure may contain no certificates, in which case +// this function succeeds but does not append any certificates. +OPENSSL_EXPORT int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, + BIO *pem_bio); + +// PKCS7_get_PEM_CRLs reads a PEM-encoded, PKCS#7, SignedData structure from +// |pem_bio| and appends the included CRLs to |out_crls|. It returns one on +// success and zero on error. +// +// Note that a SignedData structure may contain no CRLs, in which case this +// function succeeds but does not append any CRLs. +OPENSSL_EXPORT int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, + BIO *pem_bio); + + +// Deprecated functions. +// +// These functions are a compatibility layer over a subset of OpenSSL's PKCS#7 +// API. It intentionally does not implement the whole thing, only the minimum +// needed to build cryptography.io. + +typedef struct { + STACK_OF(X509) *cert; + STACK_OF(X509_CRL) *crl; +} PKCS7_SIGNED; + +typedef struct { + STACK_OF(X509) *cert; + STACK_OF(X509_CRL) *crl; +} PKCS7_SIGN_ENVELOPE; + +typedef void PKCS7_ENVELOPE; +typedef void PKCS7_DIGEST; +typedef void PKCS7_ENCRYPT; + +typedef struct { + uint8_t *ber_bytes; + size_t ber_len; + + // Unlike OpenSSL, the following fields are immutable. They filled in when the + // object is parsed and ignored in serialization. + ASN1_OBJECT *type; + union { + char *ptr; + ASN1_OCTET_STRING *data; + PKCS7_SIGNED *sign; + PKCS7_ENVELOPE *enveloped; + PKCS7_SIGN_ENVELOPE *signed_and_enveloped; + PKCS7_DIGEST *digest; + PKCS7_ENCRYPT *encrypted; + ASN1_TYPE *other; + } d; +} PKCS7; + +// d2i_PKCS7 parses a BER-encoded, PKCS#7 signed data ContentInfo structure from +// |len| bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the +// result is in |*out|. Note that, even if |*out| is already non-NULL on entry, +// it will not be written to. Rather, a fresh |PKCS7| is allocated and the +// previous one is freed. On successful exit, |*inp| is advanced past the BER +// structure. It returns the result or NULL on error. +OPENSSL_EXPORT PKCS7 *d2i_PKCS7(PKCS7 **out, const uint8_t **inp, + size_t len); + +// d2i_PKCS7_bio behaves like |d2i_PKCS7| but reads the input from |bio|. If +// the length of the object is indefinite the full contents of |bio| are read. +// +// If the function fails then some unknown amount of data may have been read +// from |bio|. +OPENSSL_EXPORT PKCS7 *d2i_PKCS7_bio(BIO *bio, PKCS7 **out); + +// i2d_PKCS7 is a dummy function which copies the contents of |p7|. If |out| is +// not NULL then the result is written to |*out| and |*out| is advanced just +// past the output. It returns the number of bytes in the result, whether +// written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_PKCS7(const PKCS7 *p7, uint8_t **out); + +// i2d_PKCS7_bio writes |p7| to |bio|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int i2d_PKCS7_bio(BIO *bio, const PKCS7 *p7); + +// PKCS7_free releases memory associated with |p7|. +OPENSSL_EXPORT void PKCS7_free(PKCS7 *p7); + +// PKCS7_type_is_data returns zero. +OPENSSL_EXPORT int PKCS7_type_is_data(const PKCS7 *p7); + +// PKCS7_type_is_digest returns zero. +OPENSSL_EXPORT int PKCS7_type_is_digest(const PKCS7 *p7); + +// PKCS7_type_is_encrypted returns zero. +OPENSSL_EXPORT int PKCS7_type_is_encrypted(const PKCS7 *p7); + +// PKCS7_type_is_enveloped returns zero. +OPENSSL_EXPORT int PKCS7_type_is_enveloped(const PKCS7 *p7); + +// PKCS7_type_is_signed returns one. (We only supporte signed data +// ContentInfos.) +OPENSSL_EXPORT int PKCS7_type_is_signed(const PKCS7 *p7); + +// PKCS7_type_is_signedAndEnveloped returns zero. +OPENSSL_EXPORT int PKCS7_type_is_signedAndEnveloped(const PKCS7 *p7); + +// PKCS7_DETACHED indicates that the PKCS#7 file specifies its data externally. +#define PKCS7_DETACHED 0x40 + +// The following flags cause |PKCS7_sign| to fail. +#define PKCS7_TEXT 0x1 +#define PKCS7_NOCERTS 0x2 +#define PKCS7_NOSIGS 0x4 +#define PKCS7_NOCHAIN 0x8 +#define PKCS7_NOINTERN 0x10 +#define PKCS7_NOVERIFY 0x20 +#define PKCS7_BINARY 0x80 +#define PKCS7_NOATTR 0x100 +#define PKCS7_NOSMIMECAP 0x200 +#define PKCS7_STREAM 0x1000 + +// PKCS7_sign assembles |certs| into a PKCS#7 signed data ContentInfo with +// external data and no signatures. It returns a newly-allocated |PKCS7| on +// success or NULL on error. |sign_cert| and |pkey| must be NULL. |data| is +// ignored. |flags| must be equal to |PKCS7_DETACHED|. +// +// Note this function only implements a subset of the corresponding OpenSSL +// function. It is provided for backwards compatibility only. +OPENSSL_EXPORT PKCS7 *PKCS7_sign(X509 *sign_cert, EVP_PKEY *pkey, + STACK_OF(X509) *certs, BIO *data, int flags); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(PKCS7, PKCS7_free) + +BSSL_NAMESPACE_END +} // extern C++ +#endif + +#define PKCS7_R_BAD_PKCS7_VERSION 100 +#define PKCS7_R_NOT_PKCS7_SIGNED_DATA 101 +#define PKCS7_R_NO_CERTIFICATES_INCLUDED 102 +#define PKCS7_R_NO_CRLS_INCLUDED 103 + +#endif // OPENSSL_HEADER_PKCS7_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.grpc_back new file mode 100644 index 000000000..cb6155ff6 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs7.h.grpc_back @@ -0,0 +1,215 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_PKCS7_H +#define OPENSSL_HEADER_PKCS7_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// PKCS#7. +// +// This library contains functions for extracting information from PKCS#7 +// structures (RFC 2315). + +DECLARE_STACK_OF(CRYPTO_BUFFER) +DECLARE_STACK_OF(X509) +DECLARE_STACK_OF(X509_CRL) + +// PKCS7_get_raw_certificates parses a PKCS#7, SignedData structure from |cbs| +// and appends the included certificates to |out_certs|. It returns one on +// success and zero on error. |cbs| is advanced passed the structure. +// +// Note that a SignedData structure may contain no certificates, in which case +// this function succeeds but does not append any certificates. +OPENSSL_EXPORT int PKCS7_get_raw_certificates( + STACK_OF(CRYPTO_BUFFER) *out_certs, CBS *cbs, CRYPTO_BUFFER_POOL *pool); + +// PKCS7_get_certificates behaves like |PKCS7_get_raw_certificates| but parses +// them into |X509| objects. +OPENSSL_EXPORT int PKCS7_get_certificates(STACK_OF(X509) *out_certs, CBS *cbs); + +// PKCS7_bundle_certificates appends a PKCS#7, SignedData structure containing +// |certs| to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int PKCS7_bundle_certificates( + CBB *out, const STACK_OF(X509) *certs); + +// PKCS7_get_CRLs parses a PKCS#7, SignedData structure from |cbs| and appends +// the included CRLs to |out_crls|. It returns one on success and zero on error. +// |cbs| is advanced passed the structure. +// +// Note that a SignedData structure may contain no CRLs, in which case this +// function succeeds but does not append any CRLs. +OPENSSL_EXPORT int PKCS7_get_CRLs(STACK_OF(X509_CRL) *out_crls, CBS *cbs); + +// PKCS7_bundle_CRLs appends a PKCS#7, SignedData structure containing +// |crls| to |out|. It returns one on success and zero on error. +OPENSSL_EXPORT int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls); + +// PKCS7_get_PEM_certificates reads a PEM-encoded, PKCS#7, SignedData structure +// from |pem_bio| and appends the included certificates to |out_certs|. It +// returns one on success and zero on error. +// +// Note that a SignedData structure may contain no certificates, in which case +// this function succeeds but does not append any certificates. +OPENSSL_EXPORT int PKCS7_get_PEM_certificates(STACK_OF(X509) *out_certs, + BIO *pem_bio); + +// PKCS7_get_PEM_CRLs reads a PEM-encoded, PKCS#7, SignedData structure from +// |pem_bio| and appends the included CRLs to |out_crls|. It returns one on +// success and zero on error. +// +// Note that a SignedData structure may contain no CRLs, in which case this +// function succeeds but does not append any CRLs. +OPENSSL_EXPORT int PKCS7_get_PEM_CRLs(STACK_OF(X509_CRL) *out_crls, + BIO *pem_bio); + + +// Deprecated functions. +// +// These functions are a compatibility layer over a subset of OpenSSL's PKCS#7 +// API. It intentionally does not implement the whole thing, only the minimum +// needed to build cryptography.io. + +typedef struct { + STACK_OF(X509) *cert; + STACK_OF(X509_CRL) *crl; +} PKCS7_SIGNED; + +typedef struct { + STACK_OF(X509) *cert; + STACK_OF(X509_CRL) *crl; +} PKCS7_SIGN_ENVELOPE; + +typedef void PKCS7_ENVELOPE; +typedef void PKCS7_DIGEST; +typedef void PKCS7_ENCRYPT; + +typedef struct { + uint8_t *ber_bytes; + size_t ber_len; + + // Unlike OpenSSL, the following fields are immutable. They filled in when the + // object is parsed and ignored in serialization. + ASN1_OBJECT *type; + union { + char *ptr; + ASN1_OCTET_STRING *data; + PKCS7_SIGNED *sign; + PKCS7_ENVELOPE *enveloped; + PKCS7_SIGN_ENVELOPE *signed_and_enveloped; + PKCS7_DIGEST *digest; + PKCS7_ENCRYPT *encrypted; + ASN1_TYPE *other; + } d; +} PKCS7; + +// d2i_PKCS7 parses a BER-encoded, PKCS#7 signed data ContentInfo structure from +// |len| bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the +// result is in |*out|. Note that, even if |*out| is already non-NULL on entry, +// it will not be written to. Rather, a fresh |PKCS7| is allocated and the +// previous one is freed. On successful exit, |*inp| is advanced past the BER +// structure. It returns the result or NULL on error. +OPENSSL_EXPORT PKCS7 *d2i_PKCS7(PKCS7 **out, const uint8_t **inp, + size_t len); + +// d2i_PKCS7_bio behaves like |d2i_PKCS7| but reads the input from |bio|. If +// the length of the object is indefinite the full contents of |bio| are read. +// +// If the function fails then some unknown amount of data may have been read +// from |bio|. +OPENSSL_EXPORT PKCS7 *d2i_PKCS7_bio(BIO *bio, PKCS7 **out); + +// i2d_PKCS7 is a dummy function which copies the contents of |p7|. If |out| is +// not NULL then the result is written to |*out| and |*out| is advanced just +// past the output. It returns the number of bytes in the result, whether +// written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_PKCS7(const PKCS7 *p7, uint8_t **out); + +// i2d_PKCS7_bio writes |p7| to |bio|. It returns one on success and zero on +// error. +OPENSSL_EXPORT int i2d_PKCS7_bio(BIO *bio, const PKCS7 *p7); + +// PKCS7_free releases memory associated with |p7|. +OPENSSL_EXPORT void PKCS7_free(PKCS7 *p7); + +// PKCS7_type_is_data returns zero. +OPENSSL_EXPORT int PKCS7_type_is_data(const PKCS7 *p7); + +// PKCS7_type_is_digest returns zero. +OPENSSL_EXPORT int PKCS7_type_is_digest(const PKCS7 *p7); + +// PKCS7_type_is_encrypted returns zero. +OPENSSL_EXPORT int PKCS7_type_is_encrypted(const PKCS7 *p7); + +// PKCS7_type_is_enveloped returns zero. +OPENSSL_EXPORT int PKCS7_type_is_enveloped(const PKCS7 *p7); + +// PKCS7_type_is_signed returns one. (We only supporte signed data +// ContentInfos.) +OPENSSL_EXPORT int PKCS7_type_is_signed(const PKCS7 *p7); + +// PKCS7_type_is_signedAndEnveloped returns zero. +OPENSSL_EXPORT int PKCS7_type_is_signedAndEnveloped(const PKCS7 *p7); + +// PKCS7_DETACHED indicates that the PKCS#7 file specifies its data externally. +#define PKCS7_DETACHED 0x40 + +// The following flags cause |PKCS7_sign| to fail. +#define PKCS7_TEXT 0x1 +#define PKCS7_NOCERTS 0x2 +#define PKCS7_NOSIGS 0x4 +#define PKCS7_NOCHAIN 0x8 +#define PKCS7_NOINTERN 0x10 +#define PKCS7_NOVERIFY 0x20 +#define PKCS7_BINARY 0x80 +#define PKCS7_NOATTR 0x100 +#define PKCS7_NOSMIMECAP 0x200 +#define PKCS7_STREAM 0x1000 + +// PKCS7_sign assembles |certs| into a PKCS#7 signed data ContentInfo with +// external data and no signatures. It returns a newly-allocated |PKCS7| on +// success or NULL on error. |sign_cert| and |pkey| must be NULL. |data| is +// ignored. |flags| must be equal to |PKCS7_DETACHED|. +// +// Note this function only implements a subset of the corresponding OpenSSL +// function. It is provided for backwards compatibility only. +OPENSSL_EXPORT PKCS7 *PKCS7_sign(X509 *sign_cert, EVP_PKEY *pkey, + STACK_OF(X509) *certs, BIO *data, int flags); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(PKCS7, PKCS7_free) + +BSSL_NAMESPACE_END +} // extern C++ +#endif + +#define PKCS7_R_BAD_PKCS7_VERSION 100 +#define PKCS7_R_NOT_PKCS7_SIGNED_DATA 101 +#define PKCS7_R_NO_CERTIFICATES_INCLUDED 102 +#define PKCS7_R_NO_CRLS_INCLUDED 103 + +#endif // OPENSSL_HEADER_PKCS7_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/pkcs8.h b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h similarity index 82% rename from Pods/BoringSSL-GRPC/include/openssl/pkcs8.h rename to Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h index 69d0db219..c48a56fd3 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/pkcs8.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h @@ -152,14 +152,34 @@ OPENSSL_EXPORT PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12); // d2i_PKCS12_fp acts like |d2i_PKCS12| but reads from a |FILE|. OPENSSL_EXPORT PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12); +// i2d_PKCS12 is a dummy function which copies the contents of |p12|. If |out| +// is not NULL then the result is written to |*out| and |*out| is advanced just +// past the output. It returns the number of bytes in the result, whether +// written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_PKCS12(const PKCS12 *p12, uint8_t **out); + +// i2d_PKCS12_bio writes the contents of |p12| to |bio|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int i2d_PKCS12_bio(BIO *bio, const PKCS12 *p12); + +// i2d_PKCS12_fp writes the contents of |p12| to |fp|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12); + // PKCS12_parse calls |PKCS12_get_key_and_certs| on the ASN.1 data stored in // |p12|. The |out_pkey| and |out_cert| arguments must not be NULL and, on -// successful exit, the private key and first certificate will be stored in +// successful exit, the private key and matching certificate will be stored in // them. The |out_ca_certs| argument may be NULL but, if not, then any extra // certificates will be appended to |*out_ca_certs|. If |*out_ca_certs| is NULL // then it will be set to a freshly allocated stack containing the extra certs. // +// Note if |p12| does not contain a private key, both |*out_pkey| and +// |*out_cert| will be set to NULL and all certificates will be returned via +// |*out_ca_certs|. +// // It returns one on success and zero on error. +// +// Use |PKCS12_get_key_and_certs| instead. OPENSSL_EXPORT int PKCS12_parse(const PKCS12 *p12, const char *password, EVP_PKEY **out_pkey, X509 **out_cert, STACK_OF(X509) **out_ca_certs); @@ -175,6 +195,23 @@ OPENSSL_EXPORT int PKCS12_parse(const PKCS12 *p12, const char *password, OPENSSL_EXPORT int PKCS12_verify_mac(const PKCS12 *p12, const char *password, int password_len); +// PKCS12_create returns a newly-allocated |PKCS12| object containing |pkey|, +// |cert|, and |chain|, encrypted with the specified password. |name|, if not +// NULL, specifies a user-friendly name to encode with the key and +// certificate. The key and certificates are encrypted with |key_nid| and +// |cert_nid|, respectively, using |iterations| iterations in the +// KDF. |mac_iterations| is the number of iterations when deriving the MAC +// key. |key_type| must be zero. |pkey| and |cert| may be NULL to omit them. +// +// Each of |key_nid|, |cert_nid|, |iterations|, and |mac_iterations| may be zero +// to use defaults, which are |NID_pbe_WithSHA1And3_Key_TripleDES_CBC|, +// |NID_pbe_WithSHA1And40BitRC2_CBC|, 2048, and one, respectively. +OPENSSL_EXPORT PKCS12 *PKCS12_create(const char *password, const char *name, + const EVP_PKEY *pkey, X509 *cert, + const STACK_OF(X509) *chain, int key_nid, + int cert_nid, int iterations, + int mac_iterations, int key_type); + // PKCS12_free frees |p12| and its contents. OPENSSL_EXPORT void PKCS12_free(PKCS12 *p12); @@ -184,12 +221,12 @@ OPENSSL_EXPORT void PKCS12_free(PKCS12 *p12); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(PKCS12, PKCS12_free) BORINGSSL_MAKE_DELETER(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -226,5 +263,7 @@ BORINGSSL_MAKE_DELETER(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free) #define PKCS8_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 128 #define PKCS8_R_BAD_ITERATION_COUNT 129 #define PKCS8_R_UNSUPPORTED_PRF 130 +#define PKCS8_R_INVALID_CHARACTERS 131 +#define PKCS8_R_UNSUPPORTED_OPTIONS 132 #endif // OPENSSL_HEADER_PKCS8_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.back new file mode 100644 index 000000000..385b99504 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.back @@ -0,0 +1,269 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. + */ +/* ==================================================================== + * Copyright (c) 1999 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + + +#ifndef OPENSSL_HEADER_PKCS8_H +#define OPENSSL_HEADER_PKCS8_H + +#include +#include + + +#if defined(__cplusplus) +extern "C" { +#endif + + +// PKCS8_encrypt serializes and encrypts a PKCS8_PRIV_KEY_INFO with PBES1 or +// PBES2 as defined in PKCS #5. Only pbeWithSHAAnd128BitRC4, +// pbeWithSHAAnd3-KeyTripleDES-CBC and pbeWithSHA1And40BitRC2, defined in PKCS +// #12, and PBES2, are supported. PBES2 is selected by setting |cipher| and +// passing -1 for |pbe_nid|. Otherwise, PBES1 is used and |cipher| is ignored. +// +// |pass| is used as the password. If a PBES1 scheme from PKCS #12 is used, this +// will be converted to a raw byte string as specified in B.1 of PKCS #12. If +// |pass| is NULL, it will be encoded as the empty byte string rather than two +// zero bytes, the PKCS #12 encoding of the empty string. +// +// If |salt| is NULL, a random salt of |salt_len| bytes is generated. If +// |salt_len| is zero, a default salt length is used instead. +// +// The resulting structure is stored in an |X509_SIG| which must be freed by the +// caller. +OPENSSL_EXPORT X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, + const char *pass, int pass_len, + const uint8_t *salt, size_t salt_len, + int iterations, + PKCS8_PRIV_KEY_INFO *p8inf); + +// PKCS8_marshal_encrypted_private_key behaves like |PKCS8_encrypt| but encrypts +// an |EVP_PKEY| and writes the serialized EncryptedPrivateKeyInfo to |out|. It +// returns one on success and zero on error. +OPENSSL_EXPORT int PKCS8_marshal_encrypted_private_key( + CBB *out, int pbe_nid, const EVP_CIPHER *cipher, const char *pass, + size_t pass_len, const uint8_t *salt, size_t salt_len, int iterations, + const EVP_PKEY *pkey); + +// PKCS8_decrypt decrypts and decodes a PKCS8_PRIV_KEY_INFO with PBES1 or PBES2 +// as defined in PKCS #5. Only pbeWithSHAAnd128BitRC4, +// pbeWithSHAAnd3-KeyTripleDES-CBC and pbeWithSHA1And40BitRC2, and PBES2, +// defined in PKCS #12, are supported. +// +// |pass| is used as the password. If a PBES1 scheme from PKCS #12 is used, this +// will be converted to a raw byte string as specified in B.1 of PKCS #12. If +// |pass| is NULL, it will be encoded as the empty byte string rather than two +// zero bytes, the PKCS #12 encoding of the empty string. +// +// The resulting structure must be freed by the caller. +OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(X509_SIG *pkcs8, + const char *pass, + int pass_len); + +// PKCS8_parse_encrypted_private_key behaves like |PKCS8_decrypt| but it parses +// the EncryptedPrivateKeyInfo structure from |cbs| and advances |cbs|. It +// returns a newly-allocated |EVP_PKEY| on success and zero on error. +OPENSSL_EXPORT EVP_PKEY *PKCS8_parse_encrypted_private_key(CBS *cbs, + const char *pass, + size_t pass_len); + +// PKCS12_get_key_and_certs parses a PKCS#12 structure from |in|, authenticates +// and decrypts it using |password|, sets |*out_key| to the included private +// key and appends the included certificates to |out_certs|. It returns one on +// success and zero on error. The caller takes ownership of the outputs. +OPENSSL_EXPORT int PKCS12_get_key_and_certs(EVP_PKEY **out_key, + STACK_OF(X509) *out_certs, + CBS *in, const char *password); + + +// Deprecated functions. + +// PKCS12_PBE_add does nothing. It exists for compatibility with OpenSSL. +OPENSSL_EXPORT void PKCS12_PBE_add(void); + +// d2i_PKCS12 is a dummy function that copies |*ber_bytes| into a +// |PKCS12| structure. The |out_p12| argument should be NULL(✝). On exit, +// |*ber_bytes| will be advanced by |ber_len|. It returns a fresh |PKCS12| +// structure or NULL on error. +// +// Note: unlike other d2i functions, |d2i_PKCS12| will always consume |ber_len| +// bytes. +// +// (✝) If |out_p12| is not NULL and the function is successful, |*out_p12| will +// be freed if not NULL itself and the result will be written to |*out_p12|. +// New code should not depend on this. +OPENSSL_EXPORT PKCS12 *d2i_PKCS12(PKCS12 **out_p12, const uint8_t **ber_bytes, + size_t ber_len); + +// d2i_PKCS12_bio acts like |d2i_PKCS12| but reads from a |BIO|. +OPENSSL_EXPORT PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12); + +// d2i_PKCS12_fp acts like |d2i_PKCS12| but reads from a |FILE|. +OPENSSL_EXPORT PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12); + +// i2d_PKCS12 is a dummy function which copies the contents of |p12|. If |out| +// is not NULL then the result is written to |*out| and |*out| is advanced just +// past the output. It returns the number of bytes in the result, whether +// written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_PKCS12(const PKCS12 *p12, uint8_t **out); + +// i2d_PKCS12_bio writes the contents of |p12| to |bio|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int i2d_PKCS12_bio(BIO *bio, const PKCS12 *p12); + +// i2d_PKCS12_fp writes the contents of |p12| to |fp|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12); + +// PKCS12_parse calls |PKCS12_get_key_and_certs| on the ASN.1 data stored in +// |p12|. The |out_pkey| and |out_cert| arguments must not be NULL and, on +// successful exit, the private key and matching certificate will be stored in +// them. The |out_ca_certs| argument may be NULL but, if not, then any extra +// certificates will be appended to |*out_ca_certs|. If |*out_ca_certs| is NULL +// then it will be set to a freshly allocated stack containing the extra certs. +// +// Note if |p12| does not contain a private key, both |*out_pkey| and +// |*out_cert| will be set to NULL and all certificates will be returned via +// |*out_ca_certs|. +// +// It returns one on success and zero on error. +// +// Use |PKCS12_get_key_and_certs| instead. +OPENSSL_EXPORT int PKCS12_parse(const PKCS12 *p12, const char *password, + EVP_PKEY **out_pkey, X509 **out_cert, + STACK_OF(X509) **out_ca_certs); + +// PKCS12_verify_mac returns one if |password| is a valid password for |p12| +// and zero otherwise. Since |PKCS12_parse| doesn't take a length parameter, +// it's not actually possible to use a non-NUL-terminated password to actually +// get anything from a |PKCS12|. Thus |password| and |password_len| may be +// |NULL| and zero, respectively, or else |password_len| may be -1, or else +// |password[password_len]| must be zero and no other NUL bytes may appear in +// |password|. If the |password_len| checks fail, zero is returned +// immediately. +OPENSSL_EXPORT int PKCS12_verify_mac(const PKCS12 *p12, const char *password, + int password_len); + +// PKCS12_create returns a newly-allocated |PKCS12| object containing |pkey|, +// |cert|, and |chain|, encrypted with the specified password. |name|, if not +// NULL, specifies a user-friendly name to encode with the key and +// certificate. The key and certificates are encrypted with |key_nid| and +// |cert_nid|, respectively, using |iterations| iterations in the +// KDF. |mac_iterations| is the number of iterations when deriving the MAC +// key. |key_type| must be zero. |pkey| and |cert| may be NULL to omit them. +// +// Each of |key_nid|, |cert_nid|, |iterations|, and |mac_iterations| may be zero +// to use defaults, which are |NID_pbe_WithSHA1And3_Key_TripleDES_CBC|, +// |NID_pbe_WithSHA1And40BitRC2_CBC|, 2048, and one, respectively. +OPENSSL_EXPORT PKCS12 *PKCS12_create(const char *password, const char *name, + const EVP_PKEY *pkey, X509 *cert, + const STACK_OF(X509) *chain, int key_nid, + int cert_nid, int iterations, + int mac_iterations, int key_type); + +// PKCS12_free frees |p12| and its contents. +OPENSSL_EXPORT void PKCS12_free(PKCS12 *p12); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(PKCS12, PKCS12_free) +BORINGSSL_MAKE_DELETER(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define PKCS8_R_BAD_PKCS12_DATA 100 +#define PKCS8_R_BAD_PKCS12_VERSION 101 +#define PKCS8_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 102 +#define PKCS8_R_CRYPT_ERROR 103 +#define PKCS8_R_DECODE_ERROR 104 +#define PKCS8_R_ENCODE_ERROR 105 +#define PKCS8_R_ENCRYPT_ERROR 106 +#define PKCS8_R_ERROR_SETTING_CIPHER_PARAMS 107 +#define PKCS8_R_INCORRECT_PASSWORD 108 +#define PKCS8_R_KEYGEN_FAILURE 109 +#define PKCS8_R_KEY_GEN_ERROR 110 +#define PKCS8_R_METHOD_NOT_SUPPORTED 111 +#define PKCS8_R_MISSING_MAC 112 +#define PKCS8_R_MULTIPLE_PRIVATE_KEYS_IN_PKCS12 113 +#define PKCS8_R_PKCS12_PUBLIC_KEY_INTEGRITY_NOT_SUPPORTED 114 +#define PKCS8_R_PKCS12_TOO_DEEPLY_NESTED 115 +#define PKCS8_R_PRIVATE_KEY_DECODE_ERROR 116 +#define PKCS8_R_PRIVATE_KEY_ENCODE_ERROR 117 +#define PKCS8_R_TOO_LONG 118 +#define PKCS8_R_UNKNOWN_ALGORITHM 119 +#define PKCS8_R_UNKNOWN_CIPHER 120 +#define PKCS8_R_UNKNOWN_CIPHER_ALGORITHM 121 +#define PKCS8_R_UNKNOWN_DIGEST 122 +#define PKCS8_R_UNKNOWN_HASH 123 +#define PKCS8_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM 124 +#define PKCS8_R_UNSUPPORTED_KEYLENGTH 125 +#define PKCS8_R_UNSUPPORTED_SALT_TYPE 126 +#define PKCS8_R_UNSUPPORTED_CIPHER 127 +#define PKCS8_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 128 +#define PKCS8_R_BAD_ITERATION_COUNT 129 +#define PKCS8_R_UNSUPPORTED_PRF 130 +#define PKCS8_R_INVALID_CHARACTERS 131 +#define PKCS8_R_UNSUPPORTED_OPTIONS 132 + +#endif // OPENSSL_HEADER_PKCS8_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/pkcs8.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/include/openssl/pkcs8.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.grpc_back index f865c767e..385b99504 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/pkcs8.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pkcs8.h.grpc_back @@ -152,14 +152,34 @@ OPENSSL_EXPORT PKCS12* d2i_PKCS12_bio(BIO *bio, PKCS12 **out_p12); // d2i_PKCS12_fp acts like |d2i_PKCS12| but reads from a |FILE|. OPENSSL_EXPORT PKCS12* d2i_PKCS12_fp(FILE *fp, PKCS12 **out_p12); +// i2d_PKCS12 is a dummy function which copies the contents of |p12|. If |out| +// is not NULL then the result is written to |*out| and |*out| is advanced just +// past the output. It returns the number of bytes in the result, whether +// written or not, or a negative value on error. +OPENSSL_EXPORT int i2d_PKCS12(const PKCS12 *p12, uint8_t **out); + +// i2d_PKCS12_bio writes the contents of |p12| to |bio|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int i2d_PKCS12_bio(BIO *bio, const PKCS12 *p12); + +// i2d_PKCS12_fp writes the contents of |p12| to |fp|. It returns one on +// success and zero on error. +OPENSSL_EXPORT int i2d_PKCS12_fp(FILE *fp, const PKCS12 *p12); + // PKCS12_parse calls |PKCS12_get_key_and_certs| on the ASN.1 data stored in // |p12|. The |out_pkey| and |out_cert| arguments must not be NULL and, on -// successful exit, the private key and first certificate will be stored in +// successful exit, the private key and matching certificate will be stored in // them. The |out_ca_certs| argument may be NULL but, if not, then any extra // certificates will be appended to |*out_ca_certs|. If |*out_ca_certs| is NULL // then it will be set to a freshly allocated stack containing the extra certs. // +// Note if |p12| does not contain a private key, both |*out_pkey| and +// |*out_cert| will be set to NULL and all certificates will be returned via +// |*out_ca_certs|. +// // It returns one on success and zero on error. +// +// Use |PKCS12_get_key_and_certs| instead. OPENSSL_EXPORT int PKCS12_parse(const PKCS12 *p12, const char *password, EVP_PKEY **out_pkey, X509 **out_cert, STACK_OF(X509) **out_ca_certs); @@ -175,6 +195,23 @@ OPENSSL_EXPORT int PKCS12_parse(const PKCS12 *p12, const char *password, OPENSSL_EXPORT int PKCS12_verify_mac(const PKCS12 *p12, const char *password, int password_len); +// PKCS12_create returns a newly-allocated |PKCS12| object containing |pkey|, +// |cert|, and |chain|, encrypted with the specified password. |name|, if not +// NULL, specifies a user-friendly name to encode with the key and +// certificate. The key and certificates are encrypted with |key_nid| and +// |cert_nid|, respectively, using |iterations| iterations in the +// KDF. |mac_iterations| is the number of iterations when deriving the MAC +// key. |key_type| must be zero. |pkey| and |cert| may be NULL to omit them. +// +// Each of |key_nid|, |cert_nid|, |iterations|, and |mac_iterations| may be zero +// to use defaults, which are |NID_pbe_WithSHA1And3_Key_TripleDES_CBC|, +// |NID_pbe_WithSHA1And40BitRC2_CBC|, 2048, and one, respectively. +OPENSSL_EXPORT PKCS12 *PKCS12_create(const char *password, const char *name, + const EVP_PKEY *pkey, X509 *cert, + const STACK_OF(X509) *chain, int key_nid, + int cert_nid, int iterations, + int mac_iterations, int key_type); + // PKCS12_free frees |p12| and its contents. OPENSSL_EXPORT void PKCS12_free(PKCS12 *p12); @@ -184,12 +221,12 @@ OPENSSL_EXPORT void PKCS12_free(PKCS12 *p12); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(PKCS12, PKCS12_free) BORINGSSL_MAKE_DELETER(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -226,5 +263,7 @@ BORINGSSL_MAKE_DELETER(PKCS8_PRIV_KEY_INFO, PKCS8_PRIV_KEY_INFO_free) #define PKCS8_R_UNSUPPORTED_KEY_DERIVATION_FUNCTION 128 #define PKCS8_R_BAD_ITERATION_COUNT 129 #define PKCS8_R_UNSUPPORTED_PRF 130 +#define PKCS8_R_INVALID_CHARACTERS 131 +#define PKCS8_R_UNSUPPORTED_OPTIONS 132 #endif // OPENSSL_HEADER_PKCS8_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/poly1305.h b/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h similarity index 80% rename from Pods/BoringSSL-GRPC/include/openssl/poly1305.h rename to Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h index ae0da8171..e48823880 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/poly1305.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h @@ -28,19 +28,17 @@ typedef uint8_t poly1305_state[512]; // authentication tag with the one-time key |key|. Note that |key| is a // one-time key and therefore there is no `reset' method because that would // enable several messages to be authenticated with the same key. -OPENSSL_EXPORT void CRYPTO_poly1305_init(poly1305_state* state, +OPENSSL_EXPORT void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]); // CRYPTO_poly1305_update processes |in_len| bytes from |in|. It can be called // zero or more times after poly1305_init. -OPENSSL_EXPORT void CRYPTO_poly1305_update(poly1305_state* state, - const uint8_t* in, - size_t in_len); +OPENSSL_EXPORT void CRYPTO_poly1305_update(poly1305_state *state, + const uint8_t *in, size_t in_len); // CRYPTO_poly1305_finish completes the poly1305 calculation and writes a 16 -// byte authentication tag to |mac|. The |mac| address must be 16-byte -// aligned. -OPENSSL_EXPORT void CRYPTO_poly1305_finish(poly1305_state* state, +// byte authentication tag to |mac|. +OPENSSL_EXPORT void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]); diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.back new file mode 100644 index 000000000..a38ef2178 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.back @@ -0,0 +1,49 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_POLY1305_H +#define OPENSSL_HEADER_POLY1305_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +typedef uint8_t poly1305_state[512]; + +// CRYPTO_poly1305_init sets up |state| so that it can be used to calculate an +// authentication tag with the one-time key |key|. Note that |key| is a +// one-time key and therefore there is no `reset' method because that would +// enable several messages to be authenticated with the same key. +OPENSSL_EXPORT void CRYPTO_poly1305_init(poly1305_state *state, + const uint8_t key[32]); + +// CRYPTO_poly1305_update processes |in_len| bytes from |in|. It can be called +// zero or more times after poly1305_init. +OPENSSL_EXPORT void CRYPTO_poly1305_update(poly1305_state *state, + const uint8_t *in, size_t in_len); + +// CRYPTO_poly1305_finish completes the poly1305 calculation and writes a 16 +// byte authentication tag to |mac|. +OPENSSL_EXPORT void CRYPTO_poly1305_finish(poly1305_state *state, + uint8_t mac[16]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_POLY1305_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/poly1305.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.grpc_back similarity index 80% rename from Pods/BoringSSL-GRPC/include/openssl/poly1305.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.grpc_back index cefe2b1c7..a38ef2178 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/poly1305.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/poly1305.h.grpc_back @@ -28,19 +28,17 @@ typedef uint8_t poly1305_state[512]; // authentication tag with the one-time key |key|. Note that |key| is a // one-time key and therefore there is no `reset' method because that would // enable several messages to be authenticated with the same key. -OPENSSL_EXPORT void CRYPTO_poly1305_init(poly1305_state* state, +OPENSSL_EXPORT void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]); // CRYPTO_poly1305_update processes |in_len| bytes from |in|. It can be called // zero or more times after poly1305_init. -OPENSSL_EXPORT void CRYPTO_poly1305_update(poly1305_state* state, - const uint8_t* in, - size_t in_len); +OPENSSL_EXPORT void CRYPTO_poly1305_update(poly1305_state *state, + const uint8_t *in, size_t in_len); // CRYPTO_poly1305_finish completes the poly1305 calculation and writes a 16 -// byte authentication tag to |mac|. The |mac| address must be 16-byte -// aligned. -OPENSSL_EXPORT void CRYPTO_poly1305_finish(poly1305_state* state, +// byte authentication tag to |mac|. +OPENSSL_EXPORT void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]); diff --git a/Pods/BoringSSL-GRPC/include/openssl/pool.h b/Pods/BoringSSL-GRPC/src/include/openssl/pool.h similarity index 83% rename from Pods/BoringSSL-GRPC/include/openssl/pool.h rename to Pods/BoringSSL-GRPC/src/include/openssl/pool.h index c9433c86a..80f47c9f2 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/pool.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pool.h @@ -48,6 +48,16 @@ OPENSSL_EXPORT void CRYPTO_BUFFER_POOL_free(CRYPTO_BUFFER_POOL *pool); OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, CRYPTO_BUFFER_POOL *pool); +// CRYPTO_BUFFER_alloc creates an unpooled |CRYPTO_BUFFER| of the given size and +// writes the underlying data pointer to |*out_data|. It returns NULL on error. +// +// After calling this function, |len| bytes of contents must be written to +// |out_data| before passing the returned pointer to any other BoringSSL +// functions. Once initialized, the |CRYPTO_BUFFER| should be treated as +// immutable. +OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_alloc(uint8_t **out_data, + size_t len); + // CRYPTO_BUFFER_new_from_CBS acts the same as |CRYPTO_BUFFER_new|. OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new_from_CBS( CBS *cbs, CRYPTO_BUFFER_POOL *pool); @@ -77,12 +87,13 @@ OPENSSL_EXPORT void CRYPTO_BUFFER_init_CBS(const CRYPTO_BUFFER *buf, CBS *out); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER_POOL, CRYPTO_BUFFER_POOL_free) BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER, CRYPTO_BUFFER_free) +BORINGSSL_MAKE_UP_REF(CRYPTO_BUFFER, CRYPTO_BUFFER_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.back new file mode 100644 index 000000000..0e4bdd5c4 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.back @@ -0,0 +1,102 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_POOL_H +#define OPENSSL_HEADER_POOL_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Buffers and buffer pools. +// +// |CRYPTO_BUFFER|s are simply reference-counted blobs. A |CRYPTO_BUFFER_POOL| +// is an intern table for |CRYPTO_BUFFER|s. This allows for a single copy of a +// given blob to be kept in memory and referenced from multiple places. + + +DEFINE_STACK_OF(CRYPTO_BUFFER) + +// CRYPTO_BUFFER_POOL_new returns a freshly allocated |CRYPTO_BUFFER_POOL| or +// NULL on error. +OPENSSL_EXPORT CRYPTO_BUFFER_POOL* CRYPTO_BUFFER_POOL_new(void); + +// CRYPTO_BUFFER_POOL_free frees |pool|, which must be empty. +OPENSSL_EXPORT void CRYPTO_BUFFER_POOL_free(CRYPTO_BUFFER_POOL *pool); + +// CRYPTO_BUFFER_new returns a |CRYPTO_BUFFER| containing a copy of |data|, or +// else NULL on error. If |pool| is not NULL then the returned value may be a +// reference to a previously existing |CRYPTO_BUFFER| that contained the same +// data. Otherwise, the returned, fresh |CRYPTO_BUFFER| will be added to the +// pool. +OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, + CRYPTO_BUFFER_POOL *pool); + +// CRYPTO_BUFFER_alloc creates an unpooled |CRYPTO_BUFFER| of the given size and +// writes the underlying data pointer to |*out_data|. It returns NULL on error. +// +// After calling this function, |len| bytes of contents must be written to +// |out_data| before passing the returned pointer to any other BoringSSL +// functions. Once initialized, the |CRYPTO_BUFFER| should be treated as +// immutable. +OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_alloc(uint8_t **out_data, + size_t len); + +// CRYPTO_BUFFER_new_from_CBS acts the same as |CRYPTO_BUFFER_new|. +OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new_from_CBS( + CBS *cbs, CRYPTO_BUFFER_POOL *pool); + +// CRYPTO_BUFFER_free decrements the reference count of |buf|. If there are no +// other references, or if the only remaining reference is from a pool, then +// |buf| will be freed. +OPENSSL_EXPORT void CRYPTO_BUFFER_free(CRYPTO_BUFFER *buf); + +// CRYPTO_BUFFER_up_ref increments the reference count of |buf| and returns +// one. +OPENSSL_EXPORT int CRYPTO_BUFFER_up_ref(CRYPTO_BUFFER *buf); + +// CRYPTO_BUFFER_data returns a pointer to the data contained in |buf|. +OPENSSL_EXPORT const uint8_t *CRYPTO_BUFFER_data(const CRYPTO_BUFFER *buf); + +// CRYPTO_BUFFER_len returns the length, in bytes, of the data contained in +// |buf|. +OPENSSL_EXPORT size_t CRYPTO_BUFFER_len(const CRYPTO_BUFFER *buf); + +// CRYPTO_BUFFER_init_CBS initialises |out| to point at the data from |buf|. +OPENSSL_EXPORT void CRYPTO_BUFFER_init_CBS(const CRYPTO_BUFFER *buf, CBS *out); + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER_POOL, CRYPTO_BUFFER_POOL_free) +BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER, CRYPTO_BUFFER_free) +BORINGSSL_MAKE_UP_REF(CRYPTO_BUFFER, CRYPTO_BUFFER_up_ref) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#endif // OPENSSL_HEADER_POOL_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/pool.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.grpc_back similarity index 83% rename from Pods/BoringSSL-GRPC/include/openssl/pool.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/pool.h.grpc_back index 373952f53..0e4bdd5c4 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/pool.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/pool.h.grpc_back @@ -48,6 +48,16 @@ OPENSSL_EXPORT void CRYPTO_BUFFER_POOL_free(CRYPTO_BUFFER_POOL *pool); OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new(const uint8_t *data, size_t len, CRYPTO_BUFFER_POOL *pool); +// CRYPTO_BUFFER_alloc creates an unpooled |CRYPTO_BUFFER| of the given size and +// writes the underlying data pointer to |*out_data|. It returns NULL on error. +// +// After calling this function, |len| bytes of contents must be written to +// |out_data| before passing the returned pointer to any other BoringSSL +// functions. Once initialized, the |CRYPTO_BUFFER| should be treated as +// immutable. +OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_alloc(uint8_t **out_data, + size_t len); + // CRYPTO_BUFFER_new_from_CBS acts the same as |CRYPTO_BUFFER_new|. OPENSSL_EXPORT CRYPTO_BUFFER *CRYPTO_BUFFER_new_from_CBS( CBS *cbs, CRYPTO_BUFFER_POOL *pool); @@ -77,12 +87,13 @@ OPENSSL_EXPORT void CRYPTO_BUFFER_init_CBS(const CRYPTO_BUFFER *buf, CBS *out); extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER_POOL, CRYPTO_BUFFER_POOL_free) BORINGSSL_MAKE_DELETER(CRYPTO_BUFFER, CRYPTO_BUFFER_free) +BORINGSSL_MAKE_UP_REF(CRYPTO_BUFFER, CRYPTO_BUFFER_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/rand.h b/Pods/BoringSSL-GRPC/src/include/openssl/rand.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/rand.h rename to Pods/BoringSSL-GRPC/src/include/openssl/rand.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/rand.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/rand.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/rand.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.grpc_back new file mode 100644 index 000000000..5d02e12b3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/rand.h.grpc_back @@ -0,0 +1,125 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_RAND_H +#define OPENSSL_HEADER_RAND_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// Random number generation. + + +// RAND_bytes writes |len| bytes of random data to |buf| and returns one. +OPENSSL_EXPORT int RAND_bytes(uint8_t *buf, size_t len); + +// RAND_cleanup frees any resources used by the RNG. This is not safe if other +// threads might still be calling |RAND_bytes|. +OPENSSL_EXPORT void RAND_cleanup(void); + + +// Obscure functions. + +#if !defined(OPENSSL_WINDOWS) +// RAND_set_urandom_fd causes the module to use a copy of |fd| for system +// randomness rather opening /dev/urandom internally. The caller retains +// ownership of |fd| and is at liberty to close it at any time. This is useful +// if, due to a sandbox, /dev/urandom isn't available. If used, it must be +// called before the first call to |RAND_bytes|, and it is mutually exclusive +// with |RAND_enable_fork_unsafe_buffering|. +// +// |RAND_set_urandom_fd| does not buffer any entropy, so it is safe to call +// |fork| at any time after calling |RAND_set_urandom_fd|. +OPENSSL_EXPORT void RAND_set_urandom_fd(int fd); + +// RAND_enable_fork_unsafe_buffering enables efficient buffered reading of +// /dev/urandom. It adds an overhead of a few KB of memory per thread. It must +// be called before the first call to |RAND_bytes| and it is mutually exclusive +// with calls to |RAND_set_urandom_fd|. +// +// If |fd| is non-negative then a copy of |fd| will be used rather than opening +// /dev/urandom internally. Like |RAND_set_urandom_fd|, the caller retains +// ownership of |fd|. If |fd| is negative then /dev/urandom will be opened and +// any error from open(2) crashes the address space. +// +// It has an unusual name because the buffer is unsafe across calls to |fork|. +// Hence, this function should never be called by libraries. +OPENSSL_EXPORT void RAND_enable_fork_unsafe_buffering(int fd); +#endif + +#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +// RAND_reset_for_fuzzing resets the fuzzer-only deterministic RNG. This +// function is only defined in the fuzzer-only build configuration. +OPENSSL_EXPORT void RAND_reset_for_fuzzing(void); +#endif + + +// Deprecated functions + +// RAND_pseudo_bytes is a wrapper around |RAND_bytes|. +OPENSSL_EXPORT int RAND_pseudo_bytes(uint8_t *buf, size_t len); + +// RAND_seed reads a single byte of random data to ensure that any file +// descriptors etc are opened. +OPENSSL_EXPORT void RAND_seed(const void *buf, int num); + +// RAND_load_file returns a nonnegative number. +OPENSSL_EXPORT int RAND_load_file(const char *path, long num); + +// RAND_file_name returns NULL. +OPENSSL_EXPORT const char *RAND_file_name(char *buf, size_t num); + +// RAND_add does nothing. +OPENSSL_EXPORT void RAND_add(const void *buf, int num, double entropy); + +// RAND_egd returns 255. +OPENSSL_EXPORT int RAND_egd(const char *); + +// RAND_poll returns one. +OPENSSL_EXPORT int RAND_poll(void); + +// RAND_status returns one. +OPENSSL_EXPORT int RAND_status(void); + +// rand_meth_st is typedefed to |RAND_METHOD| in base.h. It isn't used; it +// exists only to be the return type of |RAND_SSLeay|. It's +// external so that variables of this type can be initialized. +struct rand_meth_st { + void (*seed) (const void *buf, int num); + int (*bytes) (uint8_t *buf, size_t num); + void (*cleanup) (void); + void (*add) (const void *buf, int num, double entropy); + int (*pseudorand) (uint8_t *buf, size_t num); + int (*status) (void); +}; + +// RAND_SSLeay returns a pointer to a dummy |RAND_METHOD|. +OPENSSL_EXPORT RAND_METHOD *RAND_SSLeay(void); + +// RAND_get_rand_method returns |RAND_SSLeay()|. +OPENSSL_EXPORT const RAND_METHOD *RAND_get_rand_method(void); + +// RAND_set_rand_method does nothing. +OPENSSL_EXPORT void RAND_set_rand_method(const RAND_METHOD *); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_RAND_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/rc4.h b/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/rc4.h rename to Pods/BoringSSL-GRPC/src/include/openssl/rc4.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/rc4.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/rc4.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.grpc_back new file mode 100644 index 000000000..acf56ae98 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/rc4.h.grpc_back @@ -0,0 +1,96 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_RC4_H +#define OPENSSL_HEADER_RC4_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// RC4. + + +struct rc4_key_st { + uint32_t x, y; + uint32_t data[256]; +} /* RC4_KEY */; + +// RC4_set_key performs an RC4 key schedule and initialises |rc4key| with |len| +// bytes of key material from |key|. +OPENSSL_EXPORT void RC4_set_key(RC4_KEY *rc4key, unsigned len, + const uint8_t *key); + +// RC4 encrypts (or decrypts, it's the same with RC4) |len| bytes from |in| to +// |out|. +OPENSSL_EXPORT void RC4(RC4_KEY *key, size_t len, const uint8_t *in, + uint8_t *out); + + +// Deprecated functions. + +// RC4_options returns the string "rc4(ptr,int)". +OPENSSL_EXPORT const char *RC4_options(void); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_RC4_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ripemd.h b/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/ripemd.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h index f94afa9f7..40e25e299 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ripemd.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h @@ -83,21 +83,22 @@ OPENSSL_EXPORT int RIPEMD160_Update(RIPEMD160_CTX *ctx, const void *data, size_t len); // RIPEMD160_Final adds the final padding to |ctx| and writes the resulting -// digest to |md|, which must have at least |RIPEMD160_DIGEST_LENGTH| bytes of +// digest to |out|, which must have at least |RIPEMD160_DIGEST_LENGTH| bytes of // space. It returns one. -OPENSSL_EXPORT int RIPEMD160_Final(uint8_t *md, RIPEMD160_CTX *ctx); +OPENSSL_EXPORT int RIPEMD160_Final(uint8_t out[RIPEMD160_DIGEST_LENGTH], + RIPEMD160_CTX *ctx); // RIPEMD160 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |RIPEMD160_DIGEST_LENGTH| bytes of space in // |out|. OPENSSL_EXPORT uint8_t *RIPEMD160(const uint8_t *data, size_t len, - uint8_t *out); + uint8_t out[RIPEMD160_DIGEST_LENGTH]); // RIPEMD160_Transform is a low-level function that performs a single, // RIPEMD160 block transformation using the state from |ctx| and 64 bytes from // |block|. OPENSSL_EXPORT void RIPEMD160_Transform(RIPEMD160_CTX *ctx, - const uint8_t *block); + const uint8_t block[RIPEMD160_CBLOCK]); #if defined(__cplusplus) diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.back new file mode 100644 index 000000000..d859b1ff1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.back @@ -0,0 +1,108 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_RIPEMD_H +#define OPENSSL_HEADER_RIPEMD_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +# define RIPEMD160_CBLOCK 64 +# define RIPEMD160_LBLOCK (RIPEMD160_CBLOCK/4) +# define RIPEMD160_DIGEST_LENGTH 20 + +struct RIPEMD160state_st { + uint32_t h[5]; + uint32_t Nl, Nh; + uint8_t data[RIPEMD160_CBLOCK]; + unsigned num; +}; + +// RIPEMD160_Init initialises |ctx| and returns one. +OPENSSL_EXPORT int RIPEMD160_Init(RIPEMD160_CTX *ctx); + +// RIPEMD160_Update adds |len| bytes from |data| to |ctx| and returns one. +OPENSSL_EXPORT int RIPEMD160_Update(RIPEMD160_CTX *ctx, const void *data, + size_t len); + +// RIPEMD160_Final adds the final padding to |ctx| and writes the resulting +// digest to |out|, which must have at least |RIPEMD160_DIGEST_LENGTH| bytes of +// space. It returns one. +OPENSSL_EXPORT int RIPEMD160_Final(uint8_t out[RIPEMD160_DIGEST_LENGTH], + RIPEMD160_CTX *ctx); + +// RIPEMD160 writes the digest of |len| bytes from |data| to |out| and returns +// |out|. There must be at least |RIPEMD160_DIGEST_LENGTH| bytes of space in +// |out|. +OPENSSL_EXPORT uint8_t *RIPEMD160(const uint8_t *data, size_t len, + uint8_t out[RIPEMD160_DIGEST_LENGTH]); + +// RIPEMD160_Transform is a low-level function that performs a single, +// RIPEMD160 block transformation using the state from |ctx| and 64 bytes from +// |block|. +OPENSSL_EXPORT void RIPEMD160_Transform(RIPEMD160_CTX *ctx, + const uint8_t block[RIPEMD160_CBLOCK]); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_RIPEMD_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ripemd.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/include/openssl/ripemd.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.grpc_back index fb0b50c12..d859b1ff1 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ripemd.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ripemd.h.grpc_back @@ -83,21 +83,22 @@ OPENSSL_EXPORT int RIPEMD160_Update(RIPEMD160_CTX *ctx, const void *data, size_t len); // RIPEMD160_Final adds the final padding to |ctx| and writes the resulting -// digest to |md|, which must have at least |RIPEMD160_DIGEST_LENGTH| bytes of +// digest to |out|, which must have at least |RIPEMD160_DIGEST_LENGTH| bytes of // space. It returns one. -OPENSSL_EXPORT int RIPEMD160_Final(uint8_t *md, RIPEMD160_CTX *ctx); +OPENSSL_EXPORT int RIPEMD160_Final(uint8_t out[RIPEMD160_DIGEST_LENGTH], + RIPEMD160_CTX *ctx); // RIPEMD160 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |RIPEMD160_DIGEST_LENGTH| bytes of space in // |out|. OPENSSL_EXPORT uint8_t *RIPEMD160(const uint8_t *data, size_t len, - uint8_t *out); + uint8_t out[RIPEMD160_DIGEST_LENGTH]); // RIPEMD160_Transform is a low-level function that performs a single, // RIPEMD160 block transformation using the state from |ctx| and 64 bytes from // |block|. OPENSSL_EXPORT void RIPEMD160_Transform(RIPEMD160_CTX *ctx, - const uint8_t *block); + const uint8_t block[RIPEMD160_CBLOCK]); #if defined(__cplusplus) diff --git a/Pods/BoringSSL-GRPC/include/openssl/rsa.h b/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h similarity index 93% rename from Pods/BoringSSL-GRPC/include/openssl/rsa.h rename to Pods/BoringSSL-GRPC/src/include/openssl/rsa.h index 8d5c0219a..03209f72d 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/rsa.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h @@ -72,8 +72,14 @@ extern "C" { // Allocation and destruction. +// +// An |RSA| object represents a public or private RSA key. A given object may be +// used concurrently on multiple threads by non-mutating functions, provided no +// other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. -// RSA_new returns a new, empty RSA object or NULL on error. +// RSA_new returns a new, empty |RSA| object or NULL on error. OPENSSL_EXPORT RSA *RSA_new(void); // RSA_new_method acts the same as |RSA_new| but takes an explicit |ENGINE|. @@ -83,7 +89,8 @@ OPENSSL_EXPORT RSA *RSA_new_method(const ENGINE *engine); // reference count drops to zero. OPENSSL_EXPORT void RSA_free(RSA *rsa); -// RSA_up_ref increments the reference count of |rsa| and returns one. +// RSA_up_ref increments the reference count of |rsa| and returns one. It does +// not mutate |rsa| for thread-safety purposes and may be used concurrently. OPENSSL_EXPORT int RSA_up_ref(RSA *rsa); @@ -154,7 +161,7 @@ OPENSSL_EXPORT int RSA_set0_crt_params(RSA *rsa, BIGNUM *dmp1, BIGNUM *dmq1, // with event=3 when a suitable value for |p| is found. // // It returns one on success or zero on error. -OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, +OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_GENCB *cb); // RSA_generate_key_fips behaves like |RSA_generate_key_ex| but performs @@ -164,12 +171,23 @@ OPENSSL_EXPORT int RSA_generate_key_fips(RSA *rsa, int bits, BN_GENCB *cb); // Encryption / Decryption +// +// These functions are considered non-mutating for thread-safety purposes and +// may be used concurrently. -// Padding types for encryption. +// RSA_PKCS1_PADDING denotes PKCS#1 v1.5 padding. When used with encryption, +// this is RSAES-PKCS1-v1_5. When used with signing, this is RSASSA-PKCS1-v1_5. #define RSA_PKCS1_PADDING 1 + +// RSA_NO_PADDING denotes a raw RSA operation. #define RSA_NO_PADDING 3 + +// RSA_PKCS1_OAEP_PADDING denotes the RSAES-OAEP encryption scheme. #define RSA_PKCS1_OAEP_PADDING 4 -// RSA_PKCS1_PSS_PADDING can only be used via the EVP interface. + +// RSA_PKCS1_PSS_PADDING denotes the RSASSA-PSS signature scheme. This value may +// not be passed into |RSA_sign_raw|, only |EVP_PKEY_CTX_set_rsa_padding|. See +// also |RSA_sign_pss_mgf1| and |RSA_verify_pss_mgf1|. #define RSA_PKCS1_PSS_PADDING 6 // RSA_encrypt encrypts |in_len| bytes from |in| to the public key from |rsa| @@ -231,6 +249,9 @@ OPENSSL_EXPORT int RSA_private_decrypt(size_t flen, const uint8_t *from, // Signing / Verification +// +// These functions are considered non-mutating for thread-safety purposes and +// may be used concurrently. // RSA_sign signs |in_len| bytes of digest from |in| with |rsa| using // RSASSA-PKCS1-v1_5. It writes, at most, |RSA_size(rsa)| bytes to |out|. On @@ -272,7 +293,8 @@ OPENSSL_EXPORT int RSA_sign_pss_mgf1(RSA *rsa, size_t *out_len, uint8_t *out, // // The |padding| argument must be one of the |RSA_*_PADDING| values. If in // doubt, |RSA_PKCS1_PADDING| is the most common but |RSA_PKCS1_PSS_PADDING| -// (via the |EVP_PKEY| interface) is preferred for new protocols. +// (via |RSA_sign_pss_mgf1| or the |EVP_PKEY| interface) is preferred for new +// protocols. OPENSSL_EXPORT int RSA_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, const uint8_t *in, size_t in_len, int padding); @@ -317,7 +339,8 @@ OPENSSL_EXPORT int RSA_verify_pss_mgf1(RSA *rsa, const uint8_t *msg, // // The |padding| argument must be one of the |RSA_*_PADDING| values. If in // doubt, |RSA_PKCS1_PADDING| is the most common but |RSA_PKCS1_PSS_PADDING| -// (via the |EVP_PKEY| interface) is preferred for new protocols. +// (via |RSA_verify_pss_mgf1| or the |EVP_PKEY| interface) is preferred for new +// protocols. OPENSSL_EXPORT int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, const uint8_t *in, size_t in_len, int padding); @@ -372,8 +395,9 @@ OPENSSL_EXPORT RSA *RSAPrivateKey_dup(const RSA *rsa); // returns zero then a more detailed error is available on the error queue. OPENSSL_EXPORT int RSA_check_key(const RSA *rsa); -// RSA_check_fips performs public key validity tests on |key|. It returns one -// if they pass and zero otherwise. Opaque keys always fail. +// RSA_check_fips performs public key validity tests on |key|. It returns one if +// they pass and zero otherwise. Opaque keys always fail. This function does not +// mutate |rsa| for thread-safety purposes and may be used concurrently. OPENSSL_EXPORT int RSA_check_fips(RSA *key); // RSA_verify_PKCS1_PSS_mgf1 verifies that |EM| is a correct PSS padding of @@ -390,7 +414,8 @@ OPENSSL_EXPORT int RSA_check_fips(RSA *key); // // This function implements only the low-level padding logic. Use // |RSA_verify_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, +OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(const RSA *rsa, + const uint8_t *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, const uint8_t *EM, int sLen); @@ -407,7 +432,7 @@ OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, // // This function implements only the low-level padding logic. Use // |RSA_sign_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, uint8_t *EM, +OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(const RSA *rsa, uint8_t *EM, const uint8_t *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, @@ -567,7 +592,7 @@ OPENSSL_EXPORT int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp); // // This function implements only the low-level padding logic. Use // |RSA_sign_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(RSA *rsa, uint8_t *EM, +OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(const RSA *rsa, uint8_t *EM, const uint8_t *mHash, const EVP_MD *Hash, int sLen); @@ -576,7 +601,7 @@ OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(RSA *rsa, uint8_t *EM, // // This function implements only the low-level padding logic. Use // |RSA_verify_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_verify_PKCS1_PSS(RSA *rsa, const uint8_t *mHash, +OPENSSL_EXPORT int RSA_verify_PKCS1_PSS(const RSA *rsa, const uint8_t *mHash, const EVP_MD *Hash, const uint8_t *EM, int sLen); @@ -589,6 +614,10 @@ OPENSSL_EXPORT int RSA_padding_add_PKCS1_OAEP(uint8_t *to, size_t to_len, const uint8_t *param, size_t param_len); +// RSA_print prints a textual representation of |rsa| to |bio|. It returns one +// on success or zero otherwise. +OPENSSL_EXPORT int RSA_print(BIO *bio, const RSA *rsa, int indent); + struct rsa_meth_st { struct openssl_method_common_st common; @@ -694,11 +723,12 @@ struct rsa_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(RSA, RSA_free) +BORINGSSL_MAKE_UP_REF(RSA, RSA_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -752,5 +782,6 @@ BORINGSSL_MAKE_DELETER(RSA, RSA_free) #define RSA_R_WRONG_SIGNATURE_LENGTH 145 #define RSA_R_PUBLIC_KEY_VALIDATION_FAILED 146 #define RSA_R_D_OUT_OF_RANGE 147 +#define RSA_R_BLOCK_TYPE_IS_NOT_02 148 #endif // OPENSSL_HEADER_RSA_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.back new file mode 100644 index 000000000..2e5cc894e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.back @@ -0,0 +1,787 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_RSA_H +#define OPENSSL_HEADER_RSA_H + +#include + +#include +#include +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// rsa.h contains functions for handling encryption and signature using RSA. + + +// Allocation and destruction. +// +// An |RSA| object represents a public or private RSA key. A given object may be +// used concurrently on multiple threads by non-mutating functions, provided no +// other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. + +// RSA_new returns a new, empty |RSA| object or NULL on error. +OPENSSL_EXPORT RSA *RSA_new(void); + +// RSA_new_method acts the same as |RSA_new| but takes an explicit |ENGINE|. +OPENSSL_EXPORT RSA *RSA_new_method(const ENGINE *engine); + +// RSA_free decrements the reference count of |rsa| and frees it if the +// reference count drops to zero. +OPENSSL_EXPORT void RSA_free(RSA *rsa); + +// RSA_up_ref increments the reference count of |rsa| and returns one. It does +// not mutate |rsa| for thread-safety purposes and may be used concurrently. +OPENSSL_EXPORT int RSA_up_ref(RSA *rsa); + + +// Properties. + +// RSA_bits returns the size of |rsa|, in bits. +OPENSSL_EXPORT unsigned RSA_bits(const RSA *rsa); + +// RSA_get0_key sets |*out_n|, |*out_e|, and |*out_d|, if non-NULL, to |rsa|'s +// modulus, public exponent, and private exponent, respectively. If |rsa| is a +// public key, the private exponent will be set to NULL. +OPENSSL_EXPORT void RSA_get0_key(const RSA *rsa, const BIGNUM **out_n, + const BIGNUM **out_e, const BIGNUM **out_d); + +// RSA_get0_factors sets |*out_p| and |*out_q|, if non-NULL, to |rsa|'s prime +// factors. If |rsa| is a public key, they will be set to NULL. +OPENSSL_EXPORT void RSA_get0_factors(const RSA *rsa, const BIGNUM **out_p, + const BIGNUM **out_q); + +// RSA_get0_crt_params sets |*out_dmp1|, |*out_dmq1|, and |*out_iqmp|, if +// non-NULL, to |rsa|'s CRT parameters. These are d (mod p-1), d (mod q-1) and +// q^-1 (mod p), respectively. If |rsa| is a public key, each parameter will be +// set to NULL. +OPENSSL_EXPORT void RSA_get0_crt_params(const RSA *rsa, const BIGNUM **out_dmp1, + const BIGNUM **out_dmq1, + const BIGNUM **out_iqmp); + +// RSA_set0_key sets |rsa|'s modulus, public exponent, and private exponent to +// |n|, |e|, and |d| respectively, if non-NULL. On success, it takes ownership +// of each argument and returns one. Otherwise, it returns zero. +// +// |d| may be NULL, but |n| and |e| must either be non-NULL or already +// configured on |rsa|. +// +// It is an error to call this function after |rsa| has been used for a +// cryptographic operation. Construct a new |RSA| object instead. +OPENSSL_EXPORT int RSA_set0_key(RSA *rsa, BIGNUM *n, BIGNUM *e, BIGNUM *d); + +// RSA_set0_factors sets |rsa|'s prime factors to |p| and |q|, if non-NULL, and +// takes ownership of them. On success, it takes ownership of each argument and +// returns one. Otherwise, it returns zero. +// +// Each argument must either be non-NULL or already configured on |rsa|. +// +// It is an error to call this function after |rsa| has been used for a +// cryptographic operation. Construct a new |RSA| object instead. +OPENSSL_EXPORT int RSA_set0_factors(RSA *rsa, BIGNUM *p, BIGNUM *q); + +// RSA_set0_crt_params sets |rsa|'s CRT parameters to |dmp1|, |dmq1|, and +// |iqmp|, if non-NULL, and takes ownership of them. On success, it takes +// ownership of its parameters and returns one. Otherwise, it returns zero. +// +// Each argument must either be non-NULL or already configured on |rsa|. +// +// It is an error to call this function after |rsa| has been used for a +// cryptographic operation. Construct a new |RSA| object instead. +OPENSSL_EXPORT int RSA_set0_crt_params(RSA *rsa, BIGNUM *dmp1, BIGNUM *dmq1, + BIGNUM *iqmp); + + +// Key generation. + +// RSA_generate_key_ex generates a new RSA key where the modulus has size +// |bits| and the public exponent is |e|. If unsure, |RSA_F4| is a good value +// for |e|. If |cb| is not NULL then it is called during the key generation +// process. In addition to the calls documented for |BN_generate_prime_ex|, it +// is called with event=2 when the n'th prime is rejected as unsuitable and +// with event=3 when a suitable value for |p| is found. +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, + BN_GENCB *cb); + +// RSA_generate_key_fips behaves like |RSA_generate_key_ex| but performs +// additional checks for FIPS compliance. The public exponent is always 65537 +// and |bits| must be either 2048 or 3072. +OPENSSL_EXPORT int RSA_generate_key_fips(RSA *rsa, int bits, BN_GENCB *cb); + + +// Encryption / Decryption +// +// These functions are considered non-mutating for thread-safety purposes and +// may be used concurrently. + +// RSA_PKCS1_PADDING denotes PKCS#1 v1.5 padding. When used with encryption, +// this is RSAES-PKCS1-v1_5. When used with signing, this is RSASSA-PKCS1-v1_5. +#define RSA_PKCS1_PADDING 1 + +// RSA_NO_PADDING denotes a raw RSA operation. +#define RSA_NO_PADDING 3 + +// RSA_PKCS1_OAEP_PADDING denotes the RSAES-OAEP encryption scheme. +#define RSA_PKCS1_OAEP_PADDING 4 + +// RSA_PKCS1_PSS_PADDING denotes the RSASSA-PSS signature scheme. This value may +// not be passed into |RSA_sign_raw|, only |EVP_PKEY_CTX_set_rsa_padding|. See +// also |RSA_sign_pss_mgf1| and |RSA_verify_pss_mgf1|. +#define RSA_PKCS1_PSS_PADDING 6 + +// RSA_encrypt encrypts |in_len| bytes from |in| to the public key from |rsa| +// and writes, at most, |max_out| bytes of encrypted data to |out|. The +// |max_out| argument must be, at least, |RSA_size| in order to ensure success. +// +// It returns 1 on success or zero on error. +// +// The |padding| argument must be one of the |RSA_*_PADDING| values. If in +// doubt, use |RSA_PKCS1_OAEP_PADDING| for new protocols but +// |RSA_PKCS1_PADDING| is most common. +OPENSSL_EXPORT int RSA_encrypt(RSA *rsa, size_t *out_len, uint8_t *out, + size_t max_out, const uint8_t *in, size_t in_len, + int padding); + +// RSA_decrypt decrypts |in_len| bytes from |in| with the private key from +// |rsa| and writes, at most, |max_out| bytes of plaintext to |out|. The +// |max_out| argument must be, at least, |RSA_size| in order to ensure success. +// +// It returns 1 on success or zero on error. +// +// The |padding| argument must be one of the |RSA_*_PADDING| values. If in +// doubt, use |RSA_PKCS1_OAEP_PADDING| for new protocols. +// +// Passing |RSA_PKCS1_PADDING| into this function is deprecated and insecure. If +// implementing a protocol using RSAES-PKCS1-V1_5, use |RSA_NO_PADDING| and then +// check padding in constant-time combined with a swap to a random session key +// or other mitigation. See "Chosen Ciphertext Attacks Against Protocols Based +// on the RSA Encryption Standard PKCS #1", Daniel Bleichenbacher, Advances in +// Cryptology (Crypto '98). +OPENSSL_EXPORT int RSA_decrypt(RSA *rsa, size_t *out_len, uint8_t *out, + size_t max_out, const uint8_t *in, size_t in_len, + int padding); + +// RSA_public_encrypt encrypts |flen| bytes from |from| to the public key in +// |rsa| and writes the encrypted data to |to|. The |to| buffer must have at +// least |RSA_size| bytes of space. It returns the number of bytes written, or +// -1 on error. The |padding| argument must be one of the |RSA_*_PADDING| +// values. If in doubt, use |RSA_PKCS1_OAEP_PADDING| for new protocols but +// |RSA_PKCS1_PADDING| is most common. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |RSA_encrypt| instead. +OPENSSL_EXPORT int RSA_public_encrypt(size_t flen, const uint8_t *from, + uint8_t *to, RSA *rsa, int padding); + +// RSA_private_decrypt decrypts |flen| bytes from |from| with the public key in +// |rsa| and writes the plaintext to |to|. The |to| buffer must have at least +// |RSA_size| bytes of space. It returns the number of bytes written, or -1 on +// error. The |padding| argument must be one of the |RSA_*_PADDING| values. If +// in doubt, use |RSA_PKCS1_OAEP_PADDING| for new protocols. Passing +// |RSA_PKCS1_PADDING| into this function is deprecated and insecure. See +// |RSA_decrypt|. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |RSA_decrypt| instead. +OPENSSL_EXPORT int RSA_private_decrypt(size_t flen, const uint8_t *from, + uint8_t *to, RSA *rsa, int padding); + + +// Signing / Verification +// +// These functions are considered non-mutating for thread-safety purposes and +// may be used concurrently. + +// RSA_sign signs |in_len| bytes of digest from |in| with |rsa| using +// RSASSA-PKCS1-v1_5. It writes, at most, |RSA_size(rsa)| bytes to |out|. On +// successful return, the actual number of bytes written is written to +// |*out_len|. +// +// The |hash_nid| argument identifies the hash function used to calculate |in| +// and is embedded in the resulting signature. For example, it might be +// |NID_sha256|. +// +// It returns 1 on success and zero on error. +OPENSSL_EXPORT int RSA_sign(int hash_nid, const uint8_t *in, + unsigned int in_len, uint8_t *out, + unsigned int *out_len, RSA *rsa); + +// RSA_sign_pss_mgf1 signs |in_len| bytes from |in| with the public key from +// |rsa| using RSASSA-PSS with MGF1 as the mask generation function. It writes, +// at most, |max_out| bytes of signature data to |out|. The |max_out| argument +// must be, at least, |RSA_size| in order to ensure success. It returns 1 on +// success or zero on error. +// +// The |md| and |mgf1_md| arguments identify the hash used to calculate |msg| +// and the MGF1 hash, respectively. If |mgf1_md| is NULL, |md| is +// used. +// +// |salt_len| specifies the expected salt length in bytes. If |salt_len| is -1, +// then the salt length is the same as the hash length. If -2, then the salt +// length is maximal given the size of |rsa|. If unsure, use -1. +OPENSSL_EXPORT int RSA_sign_pss_mgf1(RSA *rsa, size_t *out_len, uint8_t *out, + size_t max_out, const uint8_t *in, + size_t in_len, const EVP_MD *md, + const EVP_MD *mgf1_md, int salt_len); + +// RSA_sign_raw signs |in_len| bytes from |in| with the public key from |rsa| +// and writes, at most, |max_out| bytes of signature data to |out|. The +// |max_out| argument must be, at least, |RSA_size| in order to ensure success. +// +// It returns 1 on success or zero on error. +// +// The |padding| argument must be one of the |RSA_*_PADDING| values. If in +// doubt, |RSA_PKCS1_PADDING| is the most common but |RSA_PKCS1_PSS_PADDING| +// (via |RSA_sign_pss_mgf1| or the |EVP_PKEY| interface) is preferred for new +// protocols. +OPENSSL_EXPORT int RSA_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out, + size_t max_out, const uint8_t *in, + size_t in_len, int padding); + +// RSA_verify verifies that |sig_len| bytes from |sig| are a valid, +// RSASSA-PKCS1-v1_5 signature of |msg_len| bytes at |msg| by |rsa|. +// +// The |hash_nid| argument identifies the hash function used to calculate |msg| +// and is embedded in the resulting signature in order to prevent hash +// confusion attacks. For example, it might be |NID_sha256|. +// +// It returns one if the signature is valid and zero otherwise. +// +// WARNING: this differs from the original, OpenSSL function which additionally +// returned -1 on error. +OPENSSL_EXPORT int RSA_verify(int hash_nid, const uint8_t *msg, size_t msg_len, + const uint8_t *sig, size_t sig_len, RSA *rsa); + +// RSA_verify_pss_mgf1 verifies that |sig_len| bytes from |sig| are a valid, +// RSASSA-PSS signature of |msg_len| bytes at |msg| by |rsa|. It returns one if +// the signature is valid and zero otherwise. MGF1 is used as the mask +// generation function. +// +// The |md| and |mgf1_md| arguments identify the hash used to calculate |msg| +// and the MGF1 hash, respectively. If |mgf1_md| is NULL, |md| is +// used. |salt_len| specifies the expected salt length in bytes. +// +// If |salt_len| is -1, then the salt length is the same as the hash length. If +// -2, then the salt length is recovered and all values accepted. If unsure, use +// -1. +OPENSSL_EXPORT int RSA_verify_pss_mgf1(RSA *rsa, const uint8_t *msg, + size_t msg_len, const EVP_MD *md, + const EVP_MD *mgf1_md, int salt_len, + const uint8_t *sig, size_t sig_len); + +// RSA_verify_raw verifies |in_len| bytes of signature from |in| using the +// public key from |rsa| and writes, at most, |max_out| bytes of plaintext to +// |out|. The |max_out| argument must be, at least, |RSA_size| in order to +// ensure success. +// +// It returns 1 on success or zero on error. +// +// The |padding| argument must be one of the |RSA_*_PADDING| values. If in +// doubt, |RSA_PKCS1_PADDING| is the most common but |RSA_PKCS1_PSS_PADDING| +// (via |RSA_verify_pss_mgf1| or the |EVP_PKEY| interface) is preferred for new +// protocols. +OPENSSL_EXPORT int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, + size_t max_out, const uint8_t *in, + size_t in_len, int padding); + +// RSA_private_encrypt encrypts |flen| bytes from |from| with the private key in +// |rsa| and writes the encrypted data to |to|. The |to| buffer must have at +// least |RSA_size| bytes of space. It returns the number of bytes written, or +// -1 on error. The |padding| argument must be one of the |RSA_*_PADDING| +// values. If in doubt, |RSA_PKCS1_PADDING| is the most common but +// |RSA_PKCS1_PSS_PADDING| (via the |EVP_PKEY| interface) is preferred for new +// protocols. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |RSA_sign_raw| instead. +OPENSSL_EXPORT int RSA_private_encrypt(size_t flen, const uint8_t *from, + uint8_t *to, RSA *rsa, int padding); + +// RSA_public_decrypt verifies |flen| bytes of signature from |from| using the +// public key in |rsa| and writes the plaintext to |to|. The |to| buffer must +// have at least |RSA_size| bytes of space. It returns the number of bytes +// written, or -1 on error. The |padding| argument must be one of the +// |RSA_*_PADDING| values. If in doubt, |RSA_PKCS1_PADDING| is the most common +// but |RSA_PKCS1_PSS_PADDING| (via the |EVP_PKEY| interface) is preferred for +// new protocols. +// +// WARNING: this function is dangerous because it breaks the usual return value +// convention. Use |RSA_verify_raw| instead. +OPENSSL_EXPORT int RSA_public_decrypt(size_t flen, const uint8_t *from, + uint8_t *to, RSA *rsa, int padding); + + +// Utility functions. + +// RSA_size returns the number of bytes in the modulus, which is also the size +// of a signature or encrypted value using |rsa|. +OPENSSL_EXPORT unsigned RSA_size(const RSA *rsa); + +// RSA_is_opaque returns one if |rsa| is opaque and doesn't expose its key +// material. Otherwise it returns zero. +OPENSSL_EXPORT int RSA_is_opaque(const RSA *rsa); + +// RSAPublicKey_dup allocates a fresh |RSA| and copies the public key from +// |rsa| into it. It returns the fresh |RSA| object, or NULL on error. +OPENSSL_EXPORT RSA *RSAPublicKey_dup(const RSA *rsa); + +// RSAPrivateKey_dup allocates a fresh |RSA| and copies the private key from +// |rsa| into it. It returns the fresh |RSA| object, or NULL on error. +OPENSSL_EXPORT RSA *RSAPrivateKey_dup(const RSA *rsa); + +// RSA_check_key performs basic validity tests on |rsa|. It returns one if +// they pass and zero otherwise. Opaque keys and public keys always pass. If it +// returns zero then a more detailed error is available on the error queue. +OPENSSL_EXPORT int RSA_check_key(const RSA *rsa); + +// RSA_check_fips performs public key validity tests on |key|. It returns one if +// they pass and zero otherwise. Opaque keys always fail. This function does not +// mutate |rsa| for thread-safety purposes and may be used concurrently. +OPENSSL_EXPORT int RSA_check_fips(RSA *key); + +// RSA_verify_PKCS1_PSS_mgf1 verifies that |EM| is a correct PSS padding of +// |mHash|, where |mHash| is a digest produced by |Hash|. |EM| must point to +// exactly |RSA_size(rsa)| bytes of data. The |mgf1Hash| argument specifies the +// hash function for generating the mask. If NULL, |Hash| is used. The |sLen| +// argument specifies the expected salt length in bytes. If |sLen| is -1 then +// the salt length is the same as the hash length. If -2, then the salt length +// is recovered and all values accepted. +// +// If unsure, use -1. +// +// It returns one on success or zero on error. +// +// This function implements only the low-level padding logic. Use +// |RSA_verify_pss_mgf1| instead. +OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(const RSA *rsa, + const uint8_t *mHash, + const EVP_MD *Hash, + const EVP_MD *mgf1Hash, + const uint8_t *EM, int sLen); + +// RSA_padding_add_PKCS1_PSS_mgf1 writes a PSS padding of |mHash| to |EM|, +// where |mHash| is a digest produced by |Hash|. |RSA_size(rsa)| bytes of +// output will be written to |EM|. The |mgf1Hash| argument specifies the hash +// function for generating the mask. If NULL, |Hash| is used. The |sLen| +// argument specifies the expected salt length in bytes. If |sLen| is -1 then +// the salt length is the same as the hash length. If -2, then the salt length +// is maximal given the space in |EM|. +// +// It returns one on success or zero on error. +// +// This function implements only the low-level padding logic. Use +// |RSA_sign_pss_mgf1| instead. +OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(const RSA *rsa, uint8_t *EM, + const uint8_t *mHash, + const EVP_MD *Hash, + const EVP_MD *mgf1Hash, + int sLen); + +// RSA_padding_add_PKCS1_OAEP_mgf1 writes an OAEP padding of |from| to |to| +// with the given parameters and hash functions. If |md| is NULL then SHA-1 is +// used. If |mgf1md| is NULL then the value of |md| is used (which means SHA-1 +// if that, in turn, is NULL). +// +// It returns one on success or zero on error. +OPENSSL_EXPORT int RSA_padding_add_PKCS1_OAEP_mgf1( + uint8_t *to, size_t to_len, const uint8_t *from, size_t from_len, + const uint8_t *param, size_t param_len, const EVP_MD *md, + const EVP_MD *mgf1md); + +// RSA_add_pkcs1_prefix builds a version of |msg| prefixed with the DigestInfo +// header for the given hash function and sets |out_msg| to point to it. On +// successful return, if |*is_alloced| is one, the caller must release +// |*out_msg| with |OPENSSL_free|. +OPENSSL_EXPORT int RSA_add_pkcs1_prefix(uint8_t **out_msg, size_t *out_msg_len, + int *is_alloced, int hash_nid, + const uint8_t *msg, size_t msg_len); + + +// ASN.1 functions. + +// RSA_parse_public_key parses a DER-encoded RSAPublicKey structure (RFC 3447) +// from |cbs| and advances |cbs|. It returns a newly-allocated |RSA| or NULL on +// error. +OPENSSL_EXPORT RSA *RSA_parse_public_key(CBS *cbs); + +// RSA_public_key_from_bytes parses |in| as a DER-encoded RSAPublicKey structure +// (RFC 3447). It returns a newly-allocated |RSA| or NULL on error. +OPENSSL_EXPORT RSA *RSA_public_key_from_bytes(const uint8_t *in, size_t in_len); + +// RSA_marshal_public_key marshals |rsa| as a DER-encoded RSAPublicKey structure +// (RFC 3447) and appends the result to |cbb|. It returns one on success and +// zero on failure. +OPENSSL_EXPORT int RSA_marshal_public_key(CBB *cbb, const RSA *rsa); + +// RSA_public_key_to_bytes marshals |rsa| as a DER-encoded RSAPublicKey +// structure (RFC 3447) and, on success, sets |*out_bytes| to a newly allocated +// buffer containing the result and returns one. Otherwise, it returns zero. The +// result should be freed with |OPENSSL_free|. +OPENSSL_EXPORT int RSA_public_key_to_bytes(uint8_t **out_bytes, size_t *out_len, + const RSA *rsa); + +// RSA_parse_private_key parses a DER-encoded RSAPrivateKey structure (RFC 3447) +// from |cbs| and advances |cbs|. It returns a newly-allocated |RSA| or NULL on +// error. +OPENSSL_EXPORT RSA *RSA_parse_private_key(CBS *cbs); + +// RSA_private_key_from_bytes parses |in| as a DER-encoded RSAPrivateKey +// structure (RFC 3447). It returns a newly-allocated |RSA| or NULL on error. +OPENSSL_EXPORT RSA *RSA_private_key_from_bytes(const uint8_t *in, + size_t in_len); + +// RSA_marshal_private_key marshals |rsa| as a DER-encoded RSAPrivateKey +// structure (RFC 3447) and appends the result to |cbb|. It returns one on +// success and zero on failure. +OPENSSL_EXPORT int RSA_marshal_private_key(CBB *cbb, const RSA *rsa); + +// RSA_private_key_to_bytes marshals |rsa| as a DER-encoded RSAPrivateKey +// structure (RFC 3447) and, on success, sets |*out_bytes| to a newly allocated +// buffer containing the result and returns one. Otherwise, it returns zero. The +// result should be freed with |OPENSSL_free|. +OPENSSL_EXPORT int RSA_private_key_to_bytes(uint8_t **out_bytes, + size_t *out_len, const RSA *rsa); + + +// ex_data functions. +// +// See |ex_data.h| for details. + +OPENSSL_EXPORT int RSA_get_ex_new_index(long argl, void *argp, + CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func); +OPENSSL_EXPORT int RSA_set_ex_data(RSA *rsa, int idx, void *arg); +OPENSSL_EXPORT void *RSA_get_ex_data(const RSA *rsa, int idx); + + +// Flags. + +// RSA_FLAG_OPAQUE specifies that this RSA_METHOD does not expose its key +// material. This may be set if, for instance, it is wrapping some other crypto +// API, like a platform key store. +#define RSA_FLAG_OPAQUE 1 + +// RSA_FLAG_NO_BLINDING disables blinding of private operations, which is a +// dangerous thing to do. It is deprecated and should not be used. It will +// be ignored whenever possible. +// +// This flag must be used if a key without the public exponent |e| is used for +// private key operations; avoid using such keys whenever possible. +#define RSA_FLAG_NO_BLINDING 8 + +// RSA_FLAG_EXT_PKEY is deprecated and ignored. +#define RSA_FLAG_EXT_PKEY 0x20 + + +// RSA public exponent values. + +#define RSA_3 0x3 +#define RSA_F4 0x10001 + + +// Deprecated functions. + +#define RSA_METHOD_FLAG_NO_CHECK RSA_FLAG_OPAQUE + +// RSA_flags returns the flags for |rsa|. These are a bitwise OR of |RSA_FLAG_*| +// constants. +OPENSSL_EXPORT int RSA_flags(const RSA *rsa); + +// RSA_blinding_on returns one. +OPENSSL_EXPORT int RSA_blinding_on(RSA *rsa, BN_CTX *ctx); + +// RSA_generate_key behaves like |RSA_generate_key_ex|, which is what you +// should use instead. It returns NULL on error, or a newly-allocated |RSA| on +// success. This function is provided for compatibility only. The |callback| +// and |cb_arg| parameters must be NULL. +OPENSSL_EXPORT RSA *RSA_generate_key(int bits, unsigned long e, void *callback, + void *cb_arg); + +// d2i_RSAPublicKey parses an ASN.1, DER-encoded, RSA public key from |len| +// bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the result +// is in |*out|. Note that, even if |*out| is already non-NULL on entry, it +// will not be written to. Rather, a fresh |RSA| is allocated and the previous +// one is freed. On successful exit, |*inp| is advanced past the DER structure. +// It returns the result or NULL on error. +OPENSSL_EXPORT RSA *d2i_RSAPublicKey(RSA **out, const uint8_t **inp, long len); + +// i2d_RSAPublicKey marshals |in| to an ASN.1, DER structure. If |outp| is not +// NULL then the result is written to |*outp| and |*outp| is advanced just past +// the output. It returns the number of bytes in the result, whether written or +// not, or a negative value on error. +OPENSSL_EXPORT int i2d_RSAPublicKey(const RSA *in, uint8_t **outp); + +// d2i_RSAPrivateKey parses an ASN.1, DER-encoded, RSA private key from |len| +// bytes at |*inp|. If |out| is not NULL then, on exit, a pointer to the result +// is in |*out|. Note that, even if |*out| is already non-NULL on entry, it +// will not be written to. Rather, a fresh |RSA| is allocated and the previous +// one is freed. On successful exit, |*inp| is advanced past the DER structure. +// It returns the result or NULL on error. +OPENSSL_EXPORT RSA *d2i_RSAPrivateKey(RSA **out, const uint8_t **inp, long len); + +// i2d_RSAPrivateKey marshals |in| to an ASN.1, DER structure. If |outp| is not +// NULL then the result is written to |*outp| and |*outp| is advanced just past +// the output. It returns the number of bytes in the result, whether written or +// not, or a negative value on error. +OPENSSL_EXPORT int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp); + +// RSA_padding_add_PKCS1_PSS acts like |RSA_padding_add_PKCS1_PSS_mgf1| but the +// |mgf1Hash| parameter of the latter is implicitly set to |Hash|. +// +// This function implements only the low-level padding logic. Use +// |RSA_sign_pss_mgf1| instead. +OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(const RSA *rsa, uint8_t *EM, + const uint8_t *mHash, + const EVP_MD *Hash, int sLen); + +// RSA_verify_PKCS1_PSS acts like |RSA_verify_PKCS1_PSS_mgf1| but the +// |mgf1Hash| parameter of the latter is implicitly set to |Hash|. +// +// This function implements only the low-level padding logic. Use +// |RSA_verify_pss_mgf1| instead. +OPENSSL_EXPORT int RSA_verify_PKCS1_PSS(const RSA *rsa, const uint8_t *mHash, + const EVP_MD *Hash, const uint8_t *EM, + int sLen); + +// RSA_padding_add_PKCS1_OAEP acts like |RSA_padding_add_PKCS1_OAEP_mgf1| but +// the |md| and |mgf1md| parameters of the latter are implicitly set to NULL, +// which means SHA-1. +OPENSSL_EXPORT int RSA_padding_add_PKCS1_OAEP(uint8_t *to, size_t to_len, + const uint8_t *from, + size_t from_len, + const uint8_t *param, + size_t param_len); + +// RSA_print prints a textual representation of |rsa| to |bio|. It returns one +// on success or zero otherwise. +OPENSSL_EXPORT int RSA_print(BIO *bio, const RSA *rsa, int indent); + + +struct rsa_meth_st { + struct openssl_method_common_st common; + + void *app_data; + + int (*init)(RSA *rsa); + int (*finish)(RSA *rsa); + + // size returns the size of the RSA modulus in bytes. + size_t (*size)(const RSA *rsa); + + int (*sign)(int type, const uint8_t *m, unsigned int m_length, + uint8_t *sigret, unsigned int *siglen, const RSA *rsa); + + // These functions mirror the |RSA_*| functions of the same name. + int (*sign_raw)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, + const uint8_t *in, size_t in_len, int padding); + int (*decrypt)(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, + const uint8_t *in, size_t in_len, int padding); + + // private_transform takes a big-endian integer from |in|, calculates the + // d'th power of it, modulo the RSA modulus and writes the result as a + // big-endian integer to |out|. Both |in| and |out| are |len| bytes long and + // |len| is always equal to |RSA_size(rsa)|. If the result of the transform + // can be represented in fewer than |len| bytes, then |out| must be zero + // padded on the left. + // + // It returns one on success and zero otherwise. + // + // RSA decrypt and sign operations will call this, thus an ENGINE might wish + // to override it in order to avoid having to implement the padding + // functionality demanded by those, higher level, operations. + int (*private_transform)(RSA *rsa, uint8_t *out, const uint8_t *in, + size_t len); + + int flags; +}; + + +// Private functions. + +typedef struct bn_blinding_st BN_BLINDING; + +struct rsa_st { + RSA_METHOD *meth; + + // Access to the following fields was historically allowed, but + // deprecated. Use |RSA_get0_*| and |RSA_set0_*| instead. Access to all other + // fields is forbidden and will cause threading errors. + BIGNUM *n; + BIGNUM *e; + BIGNUM *d; + BIGNUM *p; + BIGNUM *q; + BIGNUM *dmp1; + BIGNUM *dmq1; + BIGNUM *iqmp; + + // be careful using this if the RSA structure is shared + CRYPTO_EX_DATA ex_data; + CRYPTO_refcount_t references; + int flags; + + CRYPTO_MUTEX lock; + + // Used to cache montgomery values. The creation of these values is protected + // by |lock|. + BN_MONT_CTX *mont_n; + BN_MONT_CTX *mont_p; + BN_MONT_CTX *mont_q; + + // The following fields are copies of |d|, |dmp1|, and |dmq1|, respectively, + // but with the correct widths to prevent side channels. These must use + // separate copies due to threading concerns caused by OpenSSL's API + // mistakes. See https://github.com/openssl/openssl/issues/5158 and + // the |freeze_private_key| implementation. + BIGNUM *d_fixed, *dmp1_fixed, *dmq1_fixed; + + // inv_small_mod_large_mont is q^-1 mod p in Montgomery form, using |mont_p|, + // if |p| >= |q|. Otherwise, it is p^-1 mod q in Montgomery form, using + // |mont_q|. + BIGNUM *inv_small_mod_large_mont; + + // num_blindings contains the size of the |blindings| and |blindings_inuse| + // arrays. This member and the |blindings_inuse| array are protected by + // |lock|. + unsigned num_blindings; + // blindings is an array of BN_BLINDING structures that can be reserved by a + // thread by locking |lock| and changing the corresponding element in + // |blindings_inuse| from 0 to 1. + BN_BLINDING **blindings; + unsigned char *blindings_inuse; + + // private_key_frozen is one if the key has been used for a private key + // operation and may no longer be mutated. + unsigned private_key_frozen:1; +}; + + +#if defined(__cplusplus) +} // extern C + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(RSA, RSA_free) +BORINGSSL_MAKE_UP_REF(RSA, RSA_up_ref) + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif + +#define RSA_R_BAD_ENCODING 100 +#define RSA_R_BAD_E_VALUE 101 +#define RSA_R_BAD_FIXED_HEADER_DECRYPT 102 +#define RSA_R_BAD_PAD_BYTE_COUNT 103 +#define RSA_R_BAD_RSA_PARAMETERS 104 +#define RSA_R_BAD_SIGNATURE 105 +#define RSA_R_BAD_VERSION 106 +#define RSA_R_BLOCK_TYPE_IS_NOT_01 107 +#define RSA_R_BN_NOT_INITIALIZED 108 +#define RSA_R_CANNOT_RECOVER_MULTI_PRIME_KEY 109 +#define RSA_R_CRT_PARAMS_ALREADY_GIVEN 110 +#define RSA_R_CRT_VALUES_INCORRECT 111 +#define RSA_R_DATA_LEN_NOT_EQUAL_TO_MOD_LEN 112 +#define RSA_R_DATA_TOO_LARGE 113 +#define RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 114 +#define RSA_R_DATA_TOO_LARGE_FOR_MODULUS 115 +#define RSA_R_DATA_TOO_SMALL 116 +#define RSA_R_DATA_TOO_SMALL_FOR_KEY_SIZE 117 +#define RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY 118 +#define RSA_R_D_E_NOT_CONGRUENT_TO_1 119 +#define RSA_R_EMPTY_PUBLIC_KEY 120 +#define RSA_R_ENCODE_ERROR 121 +#define RSA_R_FIRST_OCTET_INVALID 122 +#define RSA_R_INCONSISTENT_SET_OF_CRT_VALUES 123 +#define RSA_R_INTERNAL_ERROR 124 +#define RSA_R_INVALID_MESSAGE_LENGTH 125 +#define RSA_R_KEY_SIZE_TOO_SMALL 126 +#define RSA_R_LAST_OCTET_INVALID 127 +#define RSA_R_MODULUS_TOO_LARGE 128 +#define RSA_R_MUST_HAVE_AT_LEAST_TWO_PRIMES 129 +#define RSA_R_NO_PUBLIC_EXPONENT 130 +#define RSA_R_NULL_BEFORE_BLOCK_MISSING 131 +#define RSA_R_N_NOT_EQUAL_P_Q 132 +#define RSA_R_OAEP_DECODING_ERROR 133 +#define RSA_R_ONLY_ONE_OF_P_Q_GIVEN 134 +#define RSA_R_OUTPUT_BUFFER_TOO_SMALL 135 +#define RSA_R_PADDING_CHECK_FAILED 136 +#define RSA_R_PKCS_DECODING_ERROR 137 +#define RSA_R_SLEN_CHECK_FAILED 138 +#define RSA_R_SLEN_RECOVERY_FAILED 139 +#define RSA_R_TOO_LONG 140 +#define RSA_R_TOO_MANY_ITERATIONS 141 +#define RSA_R_UNKNOWN_ALGORITHM_TYPE 142 +#define RSA_R_UNKNOWN_PADDING_TYPE 143 +#define RSA_R_VALUE_MISSING 144 +#define RSA_R_WRONG_SIGNATURE_LENGTH 145 +#define RSA_R_PUBLIC_KEY_VALIDATION_FAILED 146 +#define RSA_R_D_OUT_OF_RANGE 147 +#define RSA_R_BLOCK_TYPE_IS_NOT_02 148 + +#endif // OPENSSL_HEADER_RSA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/rsa.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/include/openssl/rsa.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.grpc_back index a52fa5389..2e5cc894e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/rsa.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/rsa.h.grpc_back @@ -72,8 +72,14 @@ extern "C" { // Allocation and destruction. +// +// An |RSA| object represents a public or private RSA key. A given object may be +// used concurrently on multiple threads by non-mutating functions, provided no +// other thread is concurrently calling a mutating function. Unless otherwise +// documented, functions which take a |const| pointer are non-mutating and +// functions which take a non-|const| pointer are mutating. -// RSA_new returns a new, empty RSA object or NULL on error. +// RSA_new returns a new, empty |RSA| object or NULL on error. OPENSSL_EXPORT RSA *RSA_new(void); // RSA_new_method acts the same as |RSA_new| but takes an explicit |ENGINE|. @@ -83,7 +89,8 @@ OPENSSL_EXPORT RSA *RSA_new_method(const ENGINE *engine); // reference count drops to zero. OPENSSL_EXPORT void RSA_free(RSA *rsa); -// RSA_up_ref increments the reference count of |rsa| and returns one. +// RSA_up_ref increments the reference count of |rsa| and returns one. It does +// not mutate |rsa| for thread-safety purposes and may be used concurrently. OPENSSL_EXPORT int RSA_up_ref(RSA *rsa); @@ -154,7 +161,7 @@ OPENSSL_EXPORT int RSA_set0_crt_params(RSA *rsa, BIGNUM *dmp1, BIGNUM *dmq1, // with event=3 when a suitable value for |p| is found. // // It returns one on success or zero on error. -OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, BIGNUM *e, +OPENSSL_EXPORT int RSA_generate_key_ex(RSA *rsa, int bits, const BIGNUM *e, BN_GENCB *cb); // RSA_generate_key_fips behaves like |RSA_generate_key_ex| but performs @@ -164,12 +171,23 @@ OPENSSL_EXPORT int RSA_generate_key_fips(RSA *rsa, int bits, BN_GENCB *cb); // Encryption / Decryption +// +// These functions are considered non-mutating for thread-safety purposes and +// may be used concurrently. -// Padding types for encryption. +// RSA_PKCS1_PADDING denotes PKCS#1 v1.5 padding. When used with encryption, +// this is RSAES-PKCS1-v1_5. When used with signing, this is RSASSA-PKCS1-v1_5. #define RSA_PKCS1_PADDING 1 + +// RSA_NO_PADDING denotes a raw RSA operation. #define RSA_NO_PADDING 3 + +// RSA_PKCS1_OAEP_PADDING denotes the RSAES-OAEP encryption scheme. #define RSA_PKCS1_OAEP_PADDING 4 -// RSA_PKCS1_PSS_PADDING can only be used via the EVP interface. + +// RSA_PKCS1_PSS_PADDING denotes the RSASSA-PSS signature scheme. This value may +// not be passed into |RSA_sign_raw|, only |EVP_PKEY_CTX_set_rsa_padding|. See +// also |RSA_sign_pss_mgf1| and |RSA_verify_pss_mgf1|. #define RSA_PKCS1_PSS_PADDING 6 // RSA_encrypt encrypts |in_len| bytes from |in| to the public key from |rsa| @@ -231,6 +249,9 @@ OPENSSL_EXPORT int RSA_private_decrypt(size_t flen, const uint8_t *from, // Signing / Verification +// +// These functions are considered non-mutating for thread-safety purposes and +// may be used concurrently. // RSA_sign signs |in_len| bytes of digest from |in| with |rsa| using // RSASSA-PKCS1-v1_5. It writes, at most, |RSA_size(rsa)| bytes to |out|. On @@ -272,7 +293,8 @@ OPENSSL_EXPORT int RSA_sign_pss_mgf1(RSA *rsa, size_t *out_len, uint8_t *out, // // The |padding| argument must be one of the |RSA_*_PADDING| values. If in // doubt, |RSA_PKCS1_PADDING| is the most common but |RSA_PKCS1_PSS_PADDING| -// (via the |EVP_PKEY| interface) is preferred for new protocols. +// (via |RSA_sign_pss_mgf1| or the |EVP_PKEY| interface) is preferred for new +// protocols. OPENSSL_EXPORT int RSA_sign_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, const uint8_t *in, size_t in_len, int padding); @@ -317,7 +339,8 @@ OPENSSL_EXPORT int RSA_verify_pss_mgf1(RSA *rsa, const uint8_t *msg, // // The |padding| argument must be one of the |RSA_*_PADDING| values. If in // doubt, |RSA_PKCS1_PADDING| is the most common but |RSA_PKCS1_PSS_PADDING| -// (via the |EVP_PKEY| interface) is preferred for new protocols. +// (via |RSA_verify_pss_mgf1| or the |EVP_PKEY| interface) is preferred for new +// protocols. OPENSSL_EXPORT int RSA_verify_raw(RSA *rsa, size_t *out_len, uint8_t *out, size_t max_out, const uint8_t *in, size_t in_len, int padding); @@ -372,8 +395,9 @@ OPENSSL_EXPORT RSA *RSAPrivateKey_dup(const RSA *rsa); // returns zero then a more detailed error is available on the error queue. OPENSSL_EXPORT int RSA_check_key(const RSA *rsa); -// RSA_check_fips performs public key validity tests on |key|. It returns one -// if they pass and zero otherwise. Opaque keys always fail. +// RSA_check_fips performs public key validity tests on |key|. It returns one if +// they pass and zero otherwise. Opaque keys always fail. This function does not +// mutate |rsa| for thread-safety purposes and may be used concurrently. OPENSSL_EXPORT int RSA_check_fips(RSA *key); // RSA_verify_PKCS1_PSS_mgf1 verifies that |EM| is a correct PSS padding of @@ -390,7 +414,8 @@ OPENSSL_EXPORT int RSA_check_fips(RSA *key); // // This function implements only the low-level padding logic. Use // |RSA_verify_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, +OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(const RSA *rsa, + const uint8_t *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, const uint8_t *EM, int sLen); @@ -407,7 +432,7 @@ OPENSSL_EXPORT int RSA_verify_PKCS1_PSS_mgf1(RSA *rsa, const uint8_t *mHash, // // This function implements only the low-level padding logic. Use // |RSA_sign_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(RSA *rsa, uint8_t *EM, +OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS_mgf1(const RSA *rsa, uint8_t *EM, const uint8_t *mHash, const EVP_MD *Hash, const EVP_MD *mgf1Hash, @@ -567,7 +592,7 @@ OPENSSL_EXPORT int i2d_RSAPrivateKey(const RSA *in, uint8_t **outp); // // This function implements only the low-level padding logic. Use // |RSA_sign_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(RSA *rsa, uint8_t *EM, +OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(const RSA *rsa, uint8_t *EM, const uint8_t *mHash, const EVP_MD *Hash, int sLen); @@ -576,7 +601,7 @@ OPENSSL_EXPORT int RSA_padding_add_PKCS1_PSS(RSA *rsa, uint8_t *EM, // // This function implements only the low-level padding logic. Use // |RSA_verify_pss_mgf1| instead. -OPENSSL_EXPORT int RSA_verify_PKCS1_PSS(RSA *rsa, const uint8_t *mHash, +OPENSSL_EXPORT int RSA_verify_PKCS1_PSS(const RSA *rsa, const uint8_t *mHash, const EVP_MD *Hash, const uint8_t *EM, int sLen); @@ -589,6 +614,10 @@ OPENSSL_EXPORT int RSA_padding_add_PKCS1_OAEP(uint8_t *to, size_t to_len, const uint8_t *param, size_t param_len); +// RSA_print prints a textual representation of |rsa| to |bio|. It returns one +// on success or zero otherwise. +OPENSSL_EXPORT int RSA_print(BIO *bio, const RSA *rsa, int indent); + struct rsa_meth_st { struct openssl_method_common_st common; @@ -694,11 +723,12 @@ struct rsa_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(RSA, RSA_free) +BORINGSSL_MAKE_UP_REF(RSA, RSA_up_ref) -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ @@ -752,5 +782,6 @@ BORINGSSL_MAKE_DELETER(RSA, RSA_free) #define RSA_R_WRONG_SIGNATURE_LENGTH 145 #define RSA_R_PUBLIC_KEY_VALIDATION_FAILED 146 #define RSA_R_D_OUT_OF_RANGE 147 +#define RSA_R_BLOCK_TYPE_IS_NOT_02 148 #endif // OPENSSL_HEADER_RSA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/safestack.h b/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/safestack.h rename to Pods/BoringSSL-GRPC/src/include/openssl/safestack.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/safestack.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/safestack.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.grpc_back new file mode 100644 index 000000000..6e5e43307 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/safestack.h.grpc_back @@ -0,0 +1,16 @@ +/* Copyright (c) 2014, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ diff --git a/Pods/BoringSSL-GRPC/include/openssl/sha.h b/Pods/BoringSSL-GRPC/src/include/openssl/sha.h similarity index 76% rename from Pods/BoringSSL-GRPC/include/openssl/sha.h rename to Pods/BoringSSL-GRPC/src/include/openssl/sha.h index 620e35be2..c27189eaa 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/sha.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/sha.h @@ -79,20 +79,22 @@ OPENSSL_EXPORT int SHA1_Init(SHA_CTX *sha); // SHA1_Update adds |len| bytes from |data| to |sha| and returns one. OPENSSL_EXPORT int SHA1_Update(SHA_CTX *sha, const void *data, size_t len); -// SHA1_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA_DIGEST_LENGTH| bytes of space. It +// SHA1_Final adds the final padding to |sha| and writes the resulting digest to +// |out|, which must have at least |SHA_DIGEST_LENGTH| bytes of space. It // returns one. -OPENSSL_EXPORT int SHA1_Final(uint8_t *md, SHA_CTX *sha); +OPENSSL_EXPORT int SHA1_Final(uint8_t out[SHA_DIGEST_LENGTH], SHA_CTX *sha); // SHA1 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, + uint8_t out[SHA_DIGEST_LENGTH]); // SHA1_Transform is a low-level function that performs a single, SHA-1 block // transformation using the state from |sha| and |SHA_CBLOCK| bytes from // |block|. -OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, + const uint8_t block[SHA_CBLOCK]); struct sha_state_st { #if defined(OPENSSL_WINDOWS) @@ -132,14 +134,16 @@ OPENSSL_EXPORT int SHA224_Init(SHA256_CTX *sha); OPENSSL_EXPORT int SHA224_Update(SHA256_CTX *sha, const void *data, size_t len); // SHA224_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA224_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA224_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA224_Final(uint8_t *md, SHA256_CTX *sha); +OPENSSL_EXPORT int SHA224_Final(uint8_t out[SHA224_DIGEST_LENGTH], + SHA256_CTX *sha); // SHA224 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA224_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA224(const uint8_t *data, size_t len, + uint8_t out[SHA224_DIGEST_LENGTH]); // SHA-256. @@ -157,19 +161,30 @@ OPENSSL_EXPORT int SHA256_Init(SHA256_CTX *sha); OPENSSL_EXPORT int SHA256_Update(SHA256_CTX *sha, const void *data, size_t len); // SHA256_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA256_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA256_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA256_Final(uint8_t *md, SHA256_CTX *sha); +OPENSSL_EXPORT int SHA256_Final(uint8_t out[SHA256_DIGEST_LENGTH], + SHA256_CTX *sha); // SHA256 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA256_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA256(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA256(const uint8_t *data, size_t len, + uint8_t out[SHA256_DIGEST_LENGTH]); // SHA256_Transform is a low-level function that performs a single, SHA-256 // block transformation using the state from |sha| and |SHA256_CBLOCK| bytes // from |block|. -OPENSSL_EXPORT void SHA256_Transform(SHA256_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT void SHA256_Transform(SHA256_CTX *sha, + const uint8_t block[SHA256_CBLOCK]); + +// SHA256_TransformBlocks is a low-level function that takes |num_blocks| * +// |SHA256_CBLOCK| bytes of data and performs SHA-256 transforms on it to update +// |state|. You should not use this function unless you are implementing a +// derivative of SHA-256. +OPENSSL_EXPORT void SHA256_TransformBlocks(uint32_t state[8], + const uint8_t *data, + size_t num_blocks); struct sha256_state_st { uint32_t h[8]; @@ -194,19 +209,16 @@ OPENSSL_EXPORT int SHA384_Init(SHA512_CTX *sha); OPENSSL_EXPORT int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len); // SHA384_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA384_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA384_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA384_Final(uint8_t *md, SHA512_CTX *sha); +OPENSSL_EXPORT int SHA384_Final(uint8_t out[SHA384_DIGEST_LENGTH], + SHA512_CTX *sha); // SHA384 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA384_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA384(const uint8_t *data, size_t len, uint8_t *out); - -// SHA384_Transform is a low-level function that performs a single, SHA-384 -// block transformation using the state from |sha| and |SHA384_CBLOCK| bytes -// from |block|. -OPENSSL_EXPORT void SHA384_Transform(SHA512_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT uint8_t *SHA384(const uint8_t *data, size_t len, + uint8_t out[SHA384_DIGEST_LENGTH]); // SHA-512. @@ -224,27 +236,27 @@ OPENSSL_EXPORT int SHA512_Init(SHA512_CTX *sha); OPENSSL_EXPORT int SHA512_Update(SHA512_CTX *sha, const void *data, size_t len); // SHA512_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA512_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA512_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA512_Final(uint8_t *md, SHA512_CTX *sha); +OPENSSL_EXPORT int SHA512_Final(uint8_t out[SHA512_DIGEST_LENGTH], + SHA512_CTX *sha); // SHA512 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA512_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA512(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA512(const uint8_t *data, size_t len, + uint8_t out[SHA512_DIGEST_LENGTH]); // SHA512_Transform is a low-level function that performs a single, SHA-512 // block transformation using the state from |sha| and |SHA512_CBLOCK| bytes // from |block|. -OPENSSL_EXPORT void SHA512_Transform(SHA512_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT void SHA512_Transform(SHA512_CTX *sha, + const uint8_t block[SHA512_CBLOCK]); struct sha512_state_st { uint64_t h[8]; uint64_t Nl, Nh; - union { - uint64_t d[16]; - uint8_t p[128]; - } u; + uint8_t p[128]; unsigned num, md_len; }; diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.back new file mode 100644 index 000000000..b163e6a38 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.back @@ -0,0 +1,268 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_SHA_H +#define OPENSSL_HEADER_SHA_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// The SHA family of hash functions (SHA-1 and SHA-2). + + +// SHA_CBLOCK is the block size of SHA-1. +#define SHA_CBLOCK 64 + +// SHA_DIGEST_LENGTH is the length of a SHA-1 digest. +#define SHA_DIGEST_LENGTH 20 + +// SHA1_Init initialises |sha| and returns one. +OPENSSL_EXPORT int SHA1_Init(SHA_CTX *sha); + +// SHA1_Update adds |len| bytes from |data| to |sha| and returns one. +OPENSSL_EXPORT int SHA1_Update(SHA_CTX *sha, const void *data, size_t len); + +// SHA1_Final adds the final padding to |sha| and writes the resulting digest to +// |out|, which must have at least |SHA_DIGEST_LENGTH| bytes of space. It +// returns one. +OPENSSL_EXPORT int SHA1_Final(uint8_t out[SHA_DIGEST_LENGTH], SHA_CTX *sha); + +// SHA1 writes the digest of |len| bytes from |data| to |out| and returns +// |out|. There must be at least |SHA_DIGEST_LENGTH| bytes of space in +// |out|. +OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, + uint8_t out[SHA_DIGEST_LENGTH]); + +// SHA1_Transform is a low-level function that performs a single, SHA-1 block +// transformation using the state from |sha| and |SHA_CBLOCK| bytes from +// |block|. +OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, + const uint8_t block[SHA_CBLOCK]); + +struct sha_state_st { +#if defined(OPENSSL_WINDOWS) + uint32_t h[5]; +#else + // wpa_supplicant accesses |h0|..|h4| so we must support those names + // for compatibility with it until it can be updated. + union { + uint32_t h[5]; + struct { + uint32_t h0; + uint32_t h1; + uint32_t h2; + uint32_t h3; + uint32_t h4; + }; + }; +#endif + uint32_t Nl, Nh; + uint8_t data[SHA_CBLOCK]; + unsigned num; +}; + + +// SHA-224. + +// SHA224_CBLOCK is the block size of SHA-224. +#define SHA224_CBLOCK 64 + +// SHA224_DIGEST_LENGTH is the length of a SHA-224 digest. +#define SHA224_DIGEST_LENGTH 28 + +// SHA224_Init initialises |sha| and returns 1. +OPENSSL_EXPORT int SHA224_Init(SHA256_CTX *sha); + +// SHA224_Update adds |len| bytes from |data| to |sha| and returns 1. +OPENSSL_EXPORT int SHA224_Update(SHA256_CTX *sha, const void *data, size_t len); + +// SHA224_Final adds the final padding to |sha| and writes the resulting digest +// to |out|, which must have at least |SHA224_DIGEST_LENGTH| bytes of space. It +// returns one on success and zero on programmer error. +OPENSSL_EXPORT int SHA224_Final(uint8_t out[SHA224_DIGEST_LENGTH], + SHA256_CTX *sha); + +// SHA224 writes the digest of |len| bytes from |data| to |out| and returns +// |out|. There must be at least |SHA224_DIGEST_LENGTH| bytes of space in +// |out|. +OPENSSL_EXPORT uint8_t *SHA224(const uint8_t *data, size_t len, + uint8_t out[SHA224_DIGEST_LENGTH]); + + +// SHA-256. + +// SHA256_CBLOCK is the block size of SHA-256. +#define SHA256_CBLOCK 64 + +// SHA256_DIGEST_LENGTH is the length of a SHA-256 digest. +#define SHA256_DIGEST_LENGTH 32 + +// SHA256_Init initialises |sha| and returns 1. +OPENSSL_EXPORT int SHA256_Init(SHA256_CTX *sha); + +// SHA256_Update adds |len| bytes from |data| to |sha| and returns 1. +OPENSSL_EXPORT int SHA256_Update(SHA256_CTX *sha, const void *data, size_t len); + +// SHA256_Final adds the final padding to |sha| and writes the resulting digest +// to |out|, which must have at least |SHA256_DIGEST_LENGTH| bytes of space. It +// returns one on success and zero on programmer error. +OPENSSL_EXPORT int SHA256_Final(uint8_t out[SHA256_DIGEST_LENGTH], + SHA256_CTX *sha); + +// SHA256 writes the digest of |len| bytes from |data| to |out| and returns +// |out|. There must be at least |SHA256_DIGEST_LENGTH| bytes of space in +// |out|. +OPENSSL_EXPORT uint8_t *SHA256(const uint8_t *data, size_t len, + uint8_t out[SHA256_DIGEST_LENGTH]); + +// SHA256_Transform is a low-level function that performs a single, SHA-256 +// block transformation using the state from |sha| and |SHA256_CBLOCK| bytes +// from |block|. +OPENSSL_EXPORT void SHA256_Transform(SHA256_CTX *sha, + const uint8_t block[SHA256_CBLOCK]); + +// SHA256_TransformBlocks is a low-level function that takes |num_blocks| * +// |SHA256_CBLOCK| bytes of data and performs SHA-256 transforms on it to update +// |state|. You should not use this function unless you are implementing a +// derivative of SHA-256. +OPENSSL_EXPORT void SHA256_TransformBlocks(uint32_t state[8], + const uint8_t *data, + size_t num_blocks); + +struct sha256_state_st { + uint32_t h[8]; + uint32_t Nl, Nh; + uint8_t data[SHA256_CBLOCK]; + unsigned num, md_len; +}; + + +// SHA-384. + +// SHA384_CBLOCK is the block size of SHA-384. +#define SHA384_CBLOCK 128 + +// SHA384_DIGEST_LENGTH is the length of a SHA-384 digest. +#define SHA384_DIGEST_LENGTH 48 + +// SHA384_Init initialises |sha| and returns 1. +OPENSSL_EXPORT int SHA384_Init(SHA512_CTX *sha); + +// SHA384_Update adds |len| bytes from |data| to |sha| and returns 1. +OPENSSL_EXPORT int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len); + +// SHA384_Final adds the final padding to |sha| and writes the resulting digest +// to |out|, which must have at least |SHA384_DIGEST_LENGTH| bytes of space. It +// returns one on success and zero on programmer error. +OPENSSL_EXPORT int SHA384_Final(uint8_t out[SHA384_DIGEST_LENGTH], + SHA512_CTX *sha); + +// SHA384 writes the digest of |len| bytes from |data| to |out| and returns +// |out|. There must be at least |SHA384_DIGEST_LENGTH| bytes of space in +// |out|. +OPENSSL_EXPORT uint8_t *SHA384(const uint8_t *data, size_t len, + uint8_t out[SHA384_DIGEST_LENGTH]); + + +// SHA-512. + +// SHA512_CBLOCK is the block size of SHA-512. +#define SHA512_CBLOCK 128 + +// SHA512_DIGEST_LENGTH is the length of a SHA-512 digest. +#define SHA512_DIGEST_LENGTH 64 + +// SHA512_Init initialises |sha| and returns 1. +OPENSSL_EXPORT int SHA512_Init(SHA512_CTX *sha); + +// SHA512_Update adds |len| bytes from |data| to |sha| and returns 1. +OPENSSL_EXPORT int SHA512_Update(SHA512_CTX *sha, const void *data, size_t len); + +// SHA512_Final adds the final padding to |sha| and writes the resulting digest +// to |out|, which must have at least |SHA512_DIGEST_LENGTH| bytes of space. It +// returns one on success and zero on programmer error. +OPENSSL_EXPORT int SHA512_Final(uint8_t out[SHA512_DIGEST_LENGTH], + SHA512_CTX *sha); + +// SHA512 writes the digest of |len| bytes from |data| to |out| and returns +// |out|. There must be at least |SHA512_DIGEST_LENGTH| bytes of space in +// |out|. +OPENSSL_EXPORT uint8_t *SHA512(const uint8_t *data, size_t len, + uint8_t out[SHA512_DIGEST_LENGTH]); + +// SHA512_Transform is a low-level function that performs a single, SHA-512 +// block transformation using the state from |sha| and |SHA512_CBLOCK| bytes +// from |block|. +OPENSSL_EXPORT void SHA512_Transform(SHA512_CTX *sha, + const uint8_t block[SHA512_CBLOCK]); + +struct sha512_state_st { + uint64_t h[8]; + uint64_t Nl, Nh; + uint8_t p[128]; + unsigned num, md_len; +}; + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_SHA_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/sha.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.grpc_back similarity index 76% rename from Pods/BoringSSL-GRPC/include/openssl/sha.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/sha.h.grpc_back index fc4644bff..b163e6a38 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/sha.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/sha.h.grpc_back @@ -79,20 +79,22 @@ OPENSSL_EXPORT int SHA1_Init(SHA_CTX *sha); // SHA1_Update adds |len| bytes from |data| to |sha| and returns one. OPENSSL_EXPORT int SHA1_Update(SHA_CTX *sha, const void *data, size_t len); -// SHA1_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA_DIGEST_LENGTH| bytes of space. It +// SHA1_Final adds the final padding to |sha| and writes the resulting digest to +// |out|, which must have at least |SHA_DIGEST_LENGTH| bytes of space. It // returns one. -OPENSSL_EXPORT int SHA1_Final(uint8_t *md, SHA_CTX *sha); +OPENSSL_EXPORT int SHA1_Final(uint8_t out[SHA_DIGEST_LENGTH], SHA_CTX *sha); // SHA1 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA1(const uint8_t *data, size_t len, + uint8_t out[SHA_DIGEST_LENGTH]); // SHA1_Transform is a low-level function that performs a single, SHA-1 block // transformation using the state from |sha| and |SHA_CBLOCK| bytes from // |block|. -OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT void SHA1_Transform(SHA_CTX *sha, + const uint8_t block[SHA_CBLOCK]); struct sha_state_st { #if defined(OPENSSL_WINDOWS) @@ -132,14 +134,16 @@ OPENSSL_EXPORT int SHA224_Init(SHA256_CTX *sha); OPENSSL_EXPORT int SHA224_Update(SHA256_CTX *sha, const void *data, size_t len); // SHA224_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA224_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA224_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA224_Final(uint8_t *md, SHA256_CTX *sha); +OPENSSL_EXPORT int SHA224_Final(uint8_t out[SHA224_DIGEST_LENGTH], + SHA256_CTX *sha); // SHA224 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA224_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA224(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA224(const uint8_t *data, size_t len, + uint8_t out[SHA224_DIGEST_LENGTH]); // SHA-256. @@ -157,19 +161,30 @@ OPENSSL_EXPORT int SHA256_Init(SHA256_CTX *sha); OPENSSL_EXPORT int SHA256_Update(SHA256_CTX *sha, const void *data, size_t len); // SHA256_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA256_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA256_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA256_Final(uint8_t *md, SHA256_CTX *sha); +OPENSSL_EXPORT int SHA256_Final(uint8_t out[SHA256_DIGEST_LENGTH], + SHA256_CTX *sha); // SHA256 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA256_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA256(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA256(const uint8_t *data, size_t len, + uint8_t out[SHA256_DIGEST_LENGTH]); // SHA256_Transform is a low-level function that performs a single, SHA-256 // block transformation using the state from |sha| and |SHA256_CBLOCK| bytes // from |block|. -OPENSSL_EXPORT void SHA256_Transform(SHA256_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT void SHA256_Transform(SHA256_CTX *sha, + const uint8_t block[SHA256_CBLOCK]); + +// SHA256_TransformBlocks is a low-level function that takes |num_blocks| * +// |SHA256_CBLOCK| bytes of data and performs SHA-256 transforms on it to update +// |state|. You should not use this function unless you are implementing a +// derivative of SHA-256. +OPENSSL_EXPORT void SHA256_TransformBlocks(uint32_t state[8], + const uint8_t *data, + size_t num_blocks); struct sha256_state_st { uint32_t h[8]; @@ -194,19 +209,16 @@ OPENSSL_EXPORT int SHA384_Init(SHA512_CTX *sha); OPENSSL_EXPORT int SHA384_Update(SHA512_CTX *sha, const void *data, size_t len); // SHA384_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA384_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA384_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA384_Final(uint8_t *md, SHA512_CTX *sha); +OPENSSL_EXPORT int SHA384_Final(uint8_t out[SHA384_DIGEST_LENGTH], + SHA512_CTX *sha); // SHA384 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA384_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA384(const uint8_t *data, size_t len, uint8_t *out); - -// SHA384_Transform is a low-level function that performs a single, SHA-384 -// block transformation using the state from |sha| and |SHA384_CBLOCK| bytes -// from |block|. -OPENSSL_EXPORT void SHA384_Transform(SHA512_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT uint8_t *SHA384(const uint8_t *data, size_t len, + uint8_t out[SHA384_DIGEST_LENGTH]); // SHA-512. @@ -224,27 +236,27 @@ OPENSSL_EXPORT int SHA512_Init(SHA512_CTX *sha); OPENSSL_EXPORT int SHA512_Update(SHA512_CTX *sha, const void *data, size_t len); // SHA512_Final adds the final padding to |sha| and writes the resulting digest -// to |md|, which must have at least |SHA512_DIGEST_LENGTH| bytes of space. It +// to |out|, which must have at least |SHA512_DIGEST_LENGTH| bytes of space. It // returns one on success and zero on programmer error. -OPENSSL_EXPORT int SHA512_Final(uint8_t *md, SHA512_CTX *sha); +OPENSSL_EXPORT int SHA512_Final(uint8_t out[SHA512_DIGEST_LENGTH], + SHA512_CTX *sha); // SHA512 writes the digest of |len| bytes from |data| to |out| and returns // |out|. There must be at least |SHA512_DIGEST_LENGTH| bytes of space in // |out|. -OPENSSL_EXPORT uint8_t *SHA512(const uint8_t *data, size_t len, uint8_t *out); +OPENSSL_EXPORT uint8_t *SHA512(const uint8_t *data, size_t len, + uint8_t out[SHA512_DIGEST_LENGTH]); // SHA512_Transform is a low-level function that performs a single, SHA-512 // block transformation using the state from |sha| and |SHA512_CBLOCK| bytes // from |block|. -OPENSSL_EXPORT void SHA512_Transform(SHA512_CTX *sha, const uint8_t *block); +OPENSSL_EXPORT void SHA512_Transform(SHA512_CTX *sha, + const uint8_t block[SHA512_CBLOCK]); struct sha512_state_st { uint64_t h[8]; uint64_t Nl, Nh; - union { - uint64_t d[16]; - uint8_t p[128]; - } u; + uint8_t p[128]; unsigned num, md_len; }; diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h b/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h new file mode 100644 index 000000000..32283ef4d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h @@ -0,0 +1,37 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SIPHASH_H +#define OPENSSL_HEADER_SIPHASH_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// SipHash is a fast, secure PRF that is often used for hash tables. + + +// SIPHASH_24 implements SipHash-2-4. See https://131002.net/siphash/siphash.pdf +OPENSSL_EXPORT uint64_t SIPHASH_24(const uint64_t key[2], const uint8_t *input, + size_t input_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_SIPHASH_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.back new file mode 100644 index 000000000..fe08aa72b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.back @@ -0,0 +1,37 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SIPHASH_H +#define OPENSSL_HEADER_SIPHASH_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// SipHash is a fast, secure PRF that is often used for hash tables. + + +// SIPHASH_24 implements SipHash-2-4. See https://131002.net/siphash/siphash.pdf +OPENSSL_EXPORT uint64_t SIPHASH_24(const uint64_t key[2], const uint8_t *input, + size_t input_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_SIPHASH_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.grpc_back new file mode 100644 index 000000000..fe08aa72b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/siphash.h.grpc_back @@ -0,0 +1,37 @@ +/* Copyright (c) 2019, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SIPHASH_H +#define OPENSSL_HEADER_SIPHASH_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// SipHash is a fast, secure PRF that is often used for hash tables. + + +// SIPHASH_24 implements SipHash-2-4. See https://131002.net/siphash/siphash.pdf +OPENSSL_EXPORT uint64_t SIPHASH_24(const uint64_t key[2], const uint8_t *input, + size_t input_len); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_SIPHASH_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/span.h b/Pods/BoringSSL-GRPC/src/include/openssl/span.h new file mode 100644 index 000000000..299d24737 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/span.h @@ -0,0 +1,199 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SSL_SPAN_H +#define OPENSSL_HEADER_SSL_SPAN_H + +#include + +#if !defined(BORINGSSL_NO_CXX) + +extern "C++" { + +#include +#include +#include + +BSSL_NAMESPACE_BEGIN + +template +class Span; + +namespace internal { +template +class SpanBase { + // Put comparison operator implementations into a base class with const T, so + // they can be used with any type that implicitly converts into a Span. + static_assert(std::is_const::value, + "Span must be derived from SpanBase"); + + friend bool operator==(Span lhs, Span rhs) { + // MSVC issues warning C4996 because std::equal is unsafe. The pragma to + // suppress the warning mysteriously has no effect, hence this + // implementation. See + // https://msdn.microsoft.com/en-us/library/aa985974.aspx. + if (lhs.size() != rhs.size()) { + return false; + } + for (T *l = lhs.begin(), *r = rhs.begin(); l != lhs.end() && r != rhs.end(); + ++l, ++r) { + if (*l != *r) { + return false; + } + } + return true; + } + + friend bool operator!=(Span lhs, Span rhs) { return !(lhs == rhs); } +}; +} // namespace internal + +// A Span is a non-owning reference to a contiguous array of objects of type +// |T|. Conceptually, a Span is a simple a pointer to |T| and a count of +// elements accessible via that pointer. The elements referenced by the Span can +// be mutated if |T| is mutable. +// +// A Span can be constructed from container types implementing |data()| and +// |size()| methods. If |T| is constant, construction from a container type is +// implicit. This allows writing methods that accept data from some unspecified +// container type: +// +// // Foo views data referenced by v. +// void Foo(bssl::Span v) { ... } +// +// std::vector vec; +// Foo(vec); +// +// For mutable Spans, conversion is explicit: +// +// // FooMutate mutates data referenced by v. +// void FooMutate(bssl::Span v) { ... } +// +// FooMutate(bssl::Span(vec)); +// +// You can also use the |MakeSpan| and |MakeConstSpan| factory methods to +// construct Spans in order to deduce the type of the Span automatically. +// +// FooMutate(bssl::MakeSpan(vec)); +// +// Note that Spans have value type sematics. They are cheap to construct and +// copy, and should be passed by value whenever a method would otherwise accept +// a reference or pointer to a container or array. +template +class Span : private internal::SpanBase { + private: + // Heuristically test whether C is a container type that can be converted into + // a Span by checking for data() and size() member functions. + // + // TODO(davidben): Switch everything to std::enable_if_t when we remove + // support for MSVC 2015. Although we could write our own enable_if_t and MSVC + // 2015 has std::enable_if_t anyway, MSVC 2015's SFINAE implementation is + // problematic and does not work below unless we write the ::type at use. + template + using EnableIfContainer = std::enable_if< + std::is_convertible().data()), T *>::value && + std::is_integral().size())>::value>; + + static const size_t npos = static_cast(-1); + + public: + constexpr Span() : Span(nullptr, 0) {} + constexpr Span(T *ptr, size_t len) : data_(ptr), size_(len) {} + + template + constexpr Span(T (&array)[N]) : Span(array, N) {} + + template < + typename C, typename = typename EnableIfContainer::type, + typename = typename std::enable_if::value, C>::type> + Span(const C &container) : data_(container.data()), size_(container.size()) {} + + template < + typename C, typename = typename EnableIfContainer::type, + typename = typename std::enable_if::value, C>::type> + explicit Span(C &container) + : data_(container.data()), size_(container.size()) {} + + T *data() const { return data_; } + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + T *begin() const { return data_; } + const T *cbegin() const { return data_; } + T *end() const { return data_ + size_; } + const T *cend() const { return end(); } + + T &front() const { + if (size_ == 0) { + abort(); + } + return data_[0]; + } + T &back() const { + if (size_ == 0) { + abort(); + } + return data_[size_ - 1]; + } + + T &operator[](size_t i) const { + if (i >= size_) { + abort(); + } + return data_[i]; + } + T &at(size_t i) const { return (*this)[i]; } + + Span subspan(size_t pos = 0, size_t len = npos) const { + if (pos > size_) { + abort(); // absl::Span throws an exception here. + } + return Span(data_ + pos, std::min(size_ - pos, len)); + } + + private: + T *data_; + size_t size_; +}; + +template +const size_t Span::npos; + +template +Span MakeSpan(T *ptr, size_t size) { + return Span(ptr, size); +} + +template +auto MakeSpan(C &c) -> decltype(MakeSpan(c.data(), c.size())) { + return MakeSpan(c.data(), c.size()); +} + +template +Span MakeConstSpan(T *ptr, size_t size) { + return Span(ptr, size); +} + +template +auto MakeConstSpan(const C &c) -> decltype(MakeConstSpan(c.data(), c.size())) { + return MakeConstSpan(c.data(), c.size()); +} + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif // !defined(BORINGSSL_NO_CXX) + +#endif // OPENSSL_HEADER_SSL_SPAN_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/span.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/span.h.back new file mode 100644 index 000000000..1d732ebb5 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/span.h.back @@ -0,0 +1,199 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#ifndef OPENSSL_HEADER_SSL_SPAN_H +#define OPENSSL_HEADER_SSL_SPAN_H + +#include + +#if !defined(BORINGSSL_NO_CXX) + +extern "C++" { + +#include +#include +#include + +BSSL_NAMESPACE_BEGIN + +template +class Span; + +namespace internal { +template +class SpanBase { + // Put comparison operator implementations into a base class with const T, so + // they can be used with any type that implicitly converts into a Span. + static_assert(std::is_const::value, + "Span must be derived from SpanBase"); + + friend bool operator==(Span lhs, Span rhs) { + // MSVC issues warning C4996 because std::equal is unsafe. The pragma to + // suppress the warning mysteriously has no effect, hence this + // implementation. See + // https://msdn.microsoft.com/en-us/library/aa985974.aspx. + if (lhs.size() != rhs.size()) { + return false; + } + for (T *l = lhs.begin(), *r = rhs.begin(); l != lhs.end() && r != rhs.end(); + ++l, ++r) { + if (*l != *r) { + return false; + } + } + return true; + } + + friend bool operator!=(Span lhs, Span rhs) { return !(lhs == rhs); } +}; +} // namespace internal + +// A Span is a non-owning reference to a contiguous array of objects of type +// |T|. Conceptually, a Span is a simple a pointer to |T| and a count of +// elements accessible via that pointer. The elements referenced by the Span can +// be mutated if |T| is mutable. +// +// A Span can be constructed from container types implementing |data()| and +// |size()| methods. If |T| is constant, construction from a container type is +// implicit. This allows writing methods that accept data from some unspecified +// container type: +// +// // Foo views data referenced by v. +// void Foo(bssl::Span v) { ... } +// +// std::vector vec; +// Foo(vec); +// +// For mutable Spans, conversion is explicit: +// +// // FooMutate mutates data referenced by v. +// void FooMutate(bssl::Span v) { ... } +// +// FooMutate(bssl::Span(vec)); +// +// You can also use the |MakeSpan| and |MakeConstSpan| factory methods to +// construct Spans in order to deduce the type of the Span automatically. +// +// FooMutate(bssl::MakeSpan(vec)); +// +// Note that Spans have value type sematics. They are cheap to construct and +// copy, and should be passed by value whenever a method would otherwise accept +// a reference or pointer to a container or array. +template +class Span : private internal::SpanBase { + private: + // Heuristically test whether C is a container type that can be converted into + // a Span by checking for data() and size() member functions. + // + // TODO(davidben): Switch everything to std::enable_if_t when we remove + // support for MSVC 2015. Although we could write our own enable_if_t and MSVC + // 2015 has std::enable_if_t anyway, MSVC 2015's SFINAE implementation is + // problematic and does not work below unless we write the ::type at use. + template + using EnableIfContainer = std::enable_if< + std::is_convertible().data()), T *>::value && + std::is_integral().size())>::value>; + + static const size_t npos = static_cast(-1); + + public: + constexpr Span() : Span(nullptr, 0) {} + constexpr Span(T *ptr, size_t len) : data_(ptr), size_(len) {} + + template + constexpr Span(T (&array)[N]) : Span(array, N) {} + + template < + typename C, typename = typename EnableIfContainer::type, + typename = typename std::enable_if::value, C>::type> + Span(const C &container) : data_(container.data()), size_(container.size()) {} + + template < + typename C, typename = typename EnableIfContainer::type, + typename = typename std::enable_if::value, C>::type> + explicit Span(C &container) + : data_(container.data()), size_(container.size()) {} + + T *data() const { return data_; } + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + T *begin() const { return data_; } + const T *cbegin() const { return data_; } + T *end() const { return data_ + size_; } + const T *cend() const { return end(); } + + T &front() const { + if (size_ == 0) { + abort(); + } + return data_[0]; + } + T &back() const { + if (size_ == 0) { + abort(); + } + return data_[size_ - 1]; + } + + T &operator[](size_t i) const { + if (i >= size_) { + abort(); + } + return data_[i]; + } + T &at(size_t i) const { return (*this)[i]; } + + Span subspan(size_t pos = 0, size_t len = npos) const { + if (pos > size_) { + abort(); // absl::Span throws an exception here. + } + return Span(data_ + pos, std::min(size_ - pos, len)); + } + + private: + T *data_; + size_t size_; +}; + +template +const size_t Span::npos; + +template +Span MakeSpan(T *ptr, size_t size) { + return Span(ptr, size); +} + +template +auto MakeSpan(C &c) -> decltype(MakeSpan(c.data(), c.size())) { + return MakeSpan(c.data(), c.size()); +} + +template +Span MakeConstSpan(T *ptr, size_t size) { + return Span(ptr, size); +} + +template +auto MakeConstSpan(const C &c) -> decltype(MakeConstSpan(c.data(), c.size())) { + return MakeConstSpan(c.data(), c.size()); +} + +BSSL_NAMESPACE_END + +} // extern C++ + +#endif // !defined(BORINGSSL_NO_CXX) + +#endif // OPENSSL_HEADER_SSL_SPAN_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/span.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/span.h.grpc_back similarity index 94% rename from Pods/BoringSSL-GRPC/include/openssl/span.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/span.h.grpc_back index 3a629f794..1d732ebb5 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/span.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/span.h.grpc_back @@ -22,11 +22,10 @@ extern "C++" { #include -#include #include #include -namespace bssl { +BSSL_NAMESPACE_BEGIN template class Span; @@ -132,20 +131,29 @@ class Span : private internal::SpanBase { T *begin() const { return data_; } const T *cbegin() const { return data_; } - T *end() const { return data_ + size_; }; - const T *cend() const { return end(); }; + T *end() const { return data_ + size_; } + const T *cend() const { return end(); } T &front() const { - assert(size_ != 0); + if (size_ == 0) { + abort(); + } return data_[0]; } T &back() const { - assert(size_ != 0); + if (size_ == 0) { + abort(); + } return data_[size_ - 1]; } - T &operator[](size_t i) const { return data_[i]; } - T &at(size_t i) const { return data_[i]; } + T &operator[](size_t i) const { + if (i >= size_) { + abort(); + } + return data_[i]; + } + T &at(size_t i) const { return (*this)[i]; } Span subspan(size_t pos = 0, size_t len = npos) const { if (pos > size_) { @@ -182,7 +190,7 @@ auto MakeConstSpan(const C &c) -> decltype(MakeConstSpan(c.data(), c.size())) { return MakeConstSpan(c.data(), c.size()); } -} // namespace bssl +BSSL_NAMESPACE_END } // extern C++ diff --git a/Pods/BoringSSL-GRPC/include/openssl/srtp.h b/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/srtp.h rename to Pods/BoringSSL-GRPC/src/include/openssl/srtp.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/srtp.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/srtp.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.grpc_back new file mode 100644 index 000000000..39f6a8552 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/srtp.h.grpc_back @@ -0,0 +1,18 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +/* This header is provided in order to make compiling against code that expects + OpenSSL easier. */ + +#include "ssl.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/ssl.h b/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h similarity index 83% rename from Pods/BoringSSL-GRPC/include/openssl/ssl.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ssl.h index 571a98078..ae570af9e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ssl.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h @@ -185,7 +185,7 @@ extern "C" { // multiple threads. Once shared, functions which change the |SSL_CTX|'s // configuration may not be used. -// TLS_method is the |SSL_METHOD| used for TLS (and SSLv3) connections. +// TLS_method is the |SSL_METHOD| used for TLS connections. OPENSSL_EXPORT const SSL_METHOD *TLS_method(void); // DTLS_method is the |SSL_METHOD| used for DTLS connections. @@ -394,20 +394,43 @@ OPENSSL_EXPORT int SSL_pending(const SSL *ssl); // https://crbug.com/466303. OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num); -// SSL_shutdown shuts down |ssl|. On success, it completes in two stages. First, -// it returns 0 if |ssl| completed uni-directional shutdown; close_notify has -// been sent, but the peer's close_notify has not been received. Most callers -// may stop at this point. For bi-directional shutdown, call |SSL_shutdown| -// again. It returns 1 if close_notify has been both sent and received. -// -// If the peer's close_notify arrived first, the first stage is skipped. -// |SSL_shutdown| will return 1 once close_notify is sent and skip 0. Callers -// only interested in uni-directional shutdown must therefore allow for the -// first stage returning either 0 or 1. +// SSL_KEY_UPDATE_REQUESTED indicates that the peer should reply to a KeyUpdate +// message with its own, thus updating traffic secrets for both directions on +// the connection. +#define SSL_KEY_UPDATE_REQUESTED 1 + +// SSL_KEY_UPDATE_NOT_REQUESTED indicates that the peer should not reply with +// it's own KeyUpdate message. +#define SSL_KEY_UPDATE_NOT_REQUESTED 0 + +// SSL_key_update queues a TLS 1.3 KeyUpdate message to be sent on |ssl| +// if one is not already queued. The |request_type| argument must one of the +// |SSL_KEY_UPDATE_*| values. This function requires that |ssl| have completed a +// TLS >= 1.3 handshake. It returns one on success or zero on error. +// +// Note that this function does not _send_ the message itself. The next call to +// |SSL_write| will cause the message to be sent. |SSL_write| may be called with +// a zero length to flush a KeyUpdate message when no application data is +// pending. +OPENSSL_EXPORT int SSL_key_update(SSL *ssl, int request_type); + +// SSL_shutdown shuts down |ssl|. It runs in two stages. First, it sends +// close_notify and returns zero or one on success or -1 on failure. Zero +// indicates that close_notify was sent, but not received, and one additionally +// indicates that the peer's close_notify had already been received. +// +// To then wait for the peer's close_notify, run |SSL_shutdown| to completion a +// second time. This returns 1 on success and -1 on failure. Application data +// is considered a fatal error at this point. To process or discard it, read +// until close_notify with |SSL_read| instead. +// +// In both cases, on failure, pass the return value into |SSL_get_error| to +// determine how to proceed. // -// |SSL_shutdown| returns -1 on failure. The caller should pass the return value -// into |SSL_get_error| to determine how to proceed. If the underlying |BIO| is -// non-blocking, both stages may require retry. +// Most callers should stop at the first stage. Reading for close_notify is +// primarily used for uncommon protocols where the underlying transport is +// reused after TLS completes. Additionally, DTLS uses an unordered transport +// and is unordered, so the second stage is a no-op in DTLS. OPENSSL_EXPORT int SSL_shutdown(SSL *ssl); // SSL_CTX_set_quiet_shutdown sets quiet shutdown on |ctx| to |mode|. If @@ -535,6 +558,19 @@ OPENSSL_EXPORT int SSL_get_error(const SSL *ssl, int ret_code); #define SSL_ERROR_WANT_CERTIFICATE_VERIFY 16 #define SSL_ERROR_HANDOFF 17 +#define SSL_ERROR_HANDBACK 18 + +// SSL_ERROR_WANT_RENEGOTIATE indicates the operation is pending a response to +// a renegotiation request from the server. The caller may call +// |SSL_renegotiate| to schedule a renegotiation and retry the operation. +// +// See also |ssl_renegotiate_explicit|. +#define SSL_ERROR_WANT_RENEGOTIATE 19 + +// SSL_error_description returns a string representation of |err|, where |err| +// is one of the |SSL_ERROR_*| constants returned by |SSL_get_error|, or NULL +// if the value is unrecognized. +OPENSSL_EXPORT const char *SSL_error_description(int err); // SSL_set_mtu sets the |ssl|'s MTU in DTLS to |mtu|. It returns one on success // and zero on failure. @@ -595,8 +631,6 @@ OPENSSL_EXPORT int DTLSv1_handle_timeout(SSL *ssl); #define DTLS1_VERSION 0xfeff #define DTLS1_2_VERSION 0xfefd -#define TLS1_3_DRAFT23_VERSION 0x7f17 - // SSL_CTX_set_min_proto_version sets the minimum protocol version for |ctx| to // |version|. If |version| is zero, the default minimum version is used. It // returns one on success and zero if |version| is invalid. @@ -609,6 +643,12 @@ OPENSSL_EXPORT int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, OPENSSL_EXPORT int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version); +// SSL_CTX_get_min_proto_version returns the minimum protocol version for |ctx| +OPENSSL_EXPORT uint16_t SSL_CTX_get_min_proto_version(const SSL_CTX *ctx); + +// SSL_CTX_get_max_proto_version returns the maximum protocol version for |ctx| +OPENSSL_EXPORT uint16_t SSL_CTX_get_max_proto_version(const SSL_CTX *ctx); + // SSL_set_min_proto_version sets the minimum protocol version for |ssl| to // |version|. If |version| is zero, the default minimum version is used. It // returns one on success and zero if |version| is invalid. @@ -619,6 +659,14 @@ OPENSSL_EXPORT int SSL_set_min_proto_version(SSL *ssl, uint16_t version); // returns one on success and zero if |version| is invalid. OPENSSL_EXPORT int SSL_set_max_proto_version(SSL *ssl, uint16_t version); +// SSL_get_min_proto_version returns the minimum protocol version for |ssl|. If +// the connection's configuration has been shed, 0 is returned. +OPENSSL_EXPORT uint16_t SSL_get_min_proto_version(const SSL *ssl); + +// SSL_get_max_proto_version returns the maximum protocol version for |ssl|. If +// the connection's configuration has been shed, 0 is returned. +OPENSSL_EXPORT uint16_t SSL_get_max_proto_version(const SSL *ssl); + // SSL_version returns the TLS or DTLS protocol version used by |ssl|, which is // one of the |*_VERSION| values. (E.g. |TLS1_2_VERSION|.) Before the version // is negotiated, the result is undefined. @@ -644,7 +692,6 @@ OPENSSL_EXPORT int SSL_version(const SSL *ssl); // The following flags toggle individual protocol versions. This is deprecated. // Use |SSL_CTX_set_min_proto_version| and |SSL_CTX_set_max_proto_version| // instead. -#define SSL_OP_NO_SSLv3 0x02000000L #define SSL_OP_NO_TLSv1 0x04000000L #define SSL_OP_NO_TLSv1_2 0x08000000L #define SSL_OP_NO_TLSv1_1 0x10000000L @@ -715,10 +762,10 @@ OPENSSL_EXPORT uint32_t SSL_get_options(const SSL *ssl); // and |SSL_CB_HANDSHAKE_DONE| from |SSL_CTX_set_info_callback|. #define SSL_MODE_ENABLE_FALSE_START 0x00000080L -// SSL_MODE_CBC_RECORD_SPLITTING causes multi-byte CBC records in SSL 3.0 and -// TLS 1.0 to be split in two: the first record will contain a single byte and -// the second will contain the remainder. This effectively randomises the IV and -// prevents BEAST attacks. +// SSL_MODE_CBC_RECORD_SPLITTING causes multi-byte CBC records in TLS 1.0 to be +// split in two: the first record will contain a single byte and the second will +// contain the remainder. This effectively randomises the IV and prevents BEAST +// attacks. #define SSL_MODE_CBC_RECORD_SPLITTING 0x00000100L // SSL_MODE_NO_SESSION_CREATION will cause any attempts to create a session to @@ -860,8 +907,9 @@ OPENSSL_EXPORT int SSL_clear_chain_certs(SSL *ssl); // |SSL_get_client_CA_list| for information on the server's certificate // request. // -// On the server, the callback will be called on non-resumption handshakes, -// after extensions have been processed. +// On the server, the callback will be called after extensions have been +// processed, but before the resumption decision has been made. This differs +// from OpenSSL which handles resumption before selecting the certificate. OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), void *arg); @@ -874,19 +922,37 @@ OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx, // On the client, the callback may call |SSL_get0_certificate_types| and // |SSL_get_client_CA_list| for information on the server's certificate // request. +// +// On the server, the callback will be called after extensions have been +// processed, but before the resumption decision has been made. This differs +// from OpenSSL which handles resumption before selecting the certificate. OPENSSL_EXPORT void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg); // SSL_get0_certificate_types, for a client, sets |*out_types| to an array // containing the client certificate types requested by a server. It returns the -// length of the array. +// length of the array. Note this list is always empty in TLS 1.3. The server +// will instead send signature algorithms. See +// |SSL_get0_peer_verify_algorithms|. // // The behavior of this function is undefined except during the callbacks set by // by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the // handshake is paused because of them. -OPENSSL_EXPORT size_t SSL_get0_certificate_types(SSL *ssl, +OPENSSL_EXPORT size_t SSL_get0_certificate_types(const SSL *ssl, const uint8_t **out_types); +// SSL_get0_peer_verify_algorithms sets |*out_sigalgs| to an array containing +// the signature algorithms the peer is able to verify. It returns the length of +// the array. Note these values are only sent starting TLS 1.2 and only +// mandatory starting TLS 1.3. If not sent, the empty array is returned. For the +// historical client certificate types list, see |SSL_get0_certificate_types|. +// +// The behavior of this function is undefined except during the callbacks set by +// by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the +// handshake is paused because of them. +OPENSSL_EXPORT size_t +SSL_get0_peer_verify_algorithms(const SSL *ssl, const uint16_t **out_sigalgs); + // SSL_certs_clear resets the private key, leaf certificate, and certificate // chain of |ssl|. OPENSSL_EXPORT void SSL_certs_clear(SSL *ssl); @@ -968,9 +1034,9 @@ OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, #define SSL_SIGN_ECDSA_SECP256R1_SHA256 0x0403 #define SSL_SIGN_ECDSA_SECP384R1_SHA384 0x0503 #define SSL_SIGN_ECDSA_SECP521R1_SHA512 0x0603 -#define SSL_SIGN_RSA_PSS_SHA256 0x0804 -#define SSL_SIGN_RSA_PSS_SHA384 0x0805 -#define SSL_SIGN_RSA_PSS_SHA512 0x0806 +#define SSL_SIGN_RSA_PSS_RSAE_SHA256 0x0804 +#define SSL_SIGN_RSA_PSS_RSAE_SHA384 0x0805 +#define SSL_SIGN_RSA_PSS_RSAE_SHA512 0x0806 #define SSL_SIGN_ED25519 0x0807 // SSL_SIGN_RSA_PKCS1_MD5_SHA1 is an internal signature algorithm used to @@ -1114,7 +1180,7 @@ OPENSSL_EXPORT void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx); // Custom private keys. -enum ssl_private_key_result_t { +enum ssl_private_key_result_t BORINGSSL_ENUM_INT { ssl_private_key_success, ssl_private_key_retry, ssl_private_key_failure, @@ -1196,10 +1262,14 @@ DEFINE_CONST_STACK_OF(SSL_CIPHER) // https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4. OPENSSL_EXPORT const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value); -// SSL_CIPHER_get_id returns |cipher|'s id. It may be cast to a |uint16_t| to -// get the cipher suite value. +// SSL_CIPHER_get_id returns |cipher|'s non-IANA id. This is not its +// IANA-assigned number, which is called the "value" here, although it may be +// cast to a |uint16_t| to get it. OPENSSL_EXPORT uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *cipher); +// SSL_CIPHER_get_value returns |cipher|'s IANA-assigned number. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *cipher); + // SSL_CIPHER_is_aead returns one if |cipher| uses an AEAD cipher. OPENSSL_EXPORT int SSL_CIPHER_is_aead(const SSL_CIPHER *cipher); @@ -1250,7 +1320,8 @@ OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher); OPENSSL_EXPORT const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher); // SSL_CIPHER_get_name returns the OpenSSL name of |cipher|. For example, -// "ECDHE-RSA-AES128-GCM-SHA256". +// "ECDHE-RSA-AES128-GCM-SHA256". Callers are recommended to use +// |SSL_CIPHER_standard_name| instead. OPENSSL_EXPORT const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher); // SSL_CIPHER_get_kx_name returns a string that describes the key-exchange @@ -1317,11 +1388,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, // whose bulk cipher use the corresponding encryption scheme. Note that // |AES|, |AES128|, and |AES256| match both CBC and GCM ciphers. // -// |SHA1|, |SHA256|, and |SHA384| match legacy cipher suites using the -// corresponding hash function in their MAC. AEADs are matched by none of -// these. -// -// |SHA| is an alias for |SHA1|. +// |SHA1|, and its alias |SHA|, match legacy cipher suites using HMAC-SHA1. // // Although implemented, authentication-only ciphers match no rules and must be // explicitly selected by name. @@ -1357,7 +1424,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, // based on client preferences. An equal-preference is specified with square // brackets, combining multiple selectors separated by |. For example: // -// [ECDHE-ECDSA-CHACHA20-POLY1305|ECDHE-ECDSA-AES128-GCM-SHA256] +// [TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256|TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256] // // Once an equal-preference group is used, future directives must be // opcode-less. Inside an equal-preference group, spaces are not allowed. @@ -1460,7 +1527,7 @@ OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl); // verification. The caller does not take ownership of the result. // // This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. -OPENSSL_EXPORT STACK_OF(CRYPTO_BUFFER) * +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * SSL_get0_peer_certificates(const SSL *ssl); // SSL_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to point to @@ -1507,8 +1574,8 @@ OPENSSL_EXPORT int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, // TLS 1.3 was negotiated. Otherwise, it returns zero. OPENSSL_EXPORT int SSL_get_extms_support(const SSL *ssl); -// SSL_get_current_cipher returns the cipher used in the current outgoing -// connection state, or NULL if the null cipher is active. +// SSL_get_current_cipher returns cipher suite used by |ssl|, or NULL if it has +// not been negotiated yet. OPENSSL_EXPORT const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl); // SSL_session_reused returns one if |ssl| performed an abbreviated handshake @@ -1533,92 +1600,6 @@ OPENSSL_EXPORT int SSL_export_keying_material( const uint8_t *context, size_t context_len, int use_context); -// Custom extensions. -// -// The custom extension functions allow TLS extensions to be added to -// ClientHello and ServerHello messages. - -// SSL_custom_ext_add_cb is a callback function that is called when the -// ClientHello (for clients) or ServerHello (for servers) is constructed. In -// the case of a server, this callback will only be called for a given -// extension if the ClientHello contained that extension – it's not possible to -// inject extensions into a ServerHello that the client didn't request. -// -// When called, |extension_value| will contain the extension number that is -// being considered for addition (so that a single callback can handle multiple -// extensions). If the callback wishes to include the extension, it must set -// |*out| to point to |*out_len| bytes of extension contents and return one. In -// this case, the corresponding |SSL_custom_ext_free_cb| callback will later be -// called with the value of |*out| once that data has been copied. -// -// If the callback does not wish to add an extension it must return zero. -// -// Alternatively, the callback can abort the connection by setting -// |*out_alert_value| to a TLS alert number and returning -1. -typedef int (*SSL_custom_ext_add_cb)(SSL *ssl, unsigned extension_value, - const uint8_t **out, size_t *out_len, - int *out_alert_value, void *add_arg); - -// SSL_custom_ext_free_cb is a callback function that is called by OpenSSL iff -// an |SSL_custom_ext_add_cb| callback previously returned one. In that case, -// this callback is called and passed the |out| pointer that was returned by -// the add callback. This is to free any dynamically allocated data created by -// the add callback. -typedef void (*SSL_custom_ext_free_cb)(SSL *ssl, unsigned extension_value, - const uint8_t *out, void *add_arg); - -// SSL_custom_ext_parse_cb is a callback function that is called by OpenSSL to -// parse an extension from the peer: that is from the ServerHello for a client -// and from the ClientHello for a server. -// -// When called, |extension_value| will contain the extension number and the -// contents of the extension are |contents_len| bytes at |contents|. -// -// The callback must return one to continue the handshake. Otherwise, if it -// returns zero, a fatal alert with value |*out_alert_value| is sent and the -// handshake is aborted. -typedef int (*SSL_custom_ext_parse_cb)(SSL *ssl, unsigned extension_value, - const uint8_t *contents, - size_t contents_len, - int *out_alert_value, void *parse_arg); - -// SSL_extension_supported returns one iff OpenSSL internally handles -// extensions of type |extension_value|. This can be used to avoid registering -// custom extension handlers for extensions that a future version of OpenSSL -// may handle internally. -OPENSSL_EXPORT int SSL_extension_supported(unsigned extension_value); - -// SSL_CTX_add_client_custom_ext registers callback functions for handling -// custom TLS extensions for client connections. -// -// If |add_cb| is NULL then an empty extension will be added in each -// ClientHello. Otherwise, see the comment for |SSL_custom_ext_add_cb| about -// this callback. -// -// The |free_cb| may be NULL if |add_cb| doesn't dynamically allocate data that -// needs to be freed. -// -// It returns one on success or zero on error. It's always an error to register -// callbacks for the same extension twice, or to register callbacks for an -// extension that OpenSSL handles internally. See |SSL_extension_supported| to -// discover, at runtime, which extensions OpenSSL handles internally. -OPENSSL_EXPORT int SSL_CTX_add_client_custom_ext( - SSL_CTX *ctx, unsigned extension_value, SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, void *parse_arg); - -// SSL_CTX_add_server_custom_ext is the same as -// |SSL_CTX_add_client_custom_ext|, but for server connections. -// -// Unlike on the client side, if |add_cb| is NULL no extension will be added. -// The |add_cb|, if any, will only be called if the ClientHello contained a -// matching extension. -OPENSSL_EXPORT int SSL_CTX_add_server_custom_ext( - SSL_CTX *ctx, unsigned extension_value, SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, void *parse_arg); - - // Sessions. // // An |SSL_SESSION| represents an SSL session that may be resumed in an @@ -1660,7 +1641,7 @@ OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_from_bytes( const uint8_t *in, size_t in_len, const SSL_CTX *ctx); // SSL_SESSION_get_version returns a string describing the TLS or DTLS version -// |session| was established at. For example, "TLSv1.2" or "SSLv3". +// |session| was established at. For example, "TLSv1.2" or "DTLSv1". OPENSSL_EXPORT const char *SSL_SESSION_get_version(const SSL_SESSION *session); // SSL_SESSION_get_protocol_version returns the TLS or DTLS version |session| @@ -1674,11 +1655,20 @@ SSL_SESSION_get_protocol_version(const SSL_SESSION *session); OPENSSL_EXPORT int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version); +// SSL_MAX_SSL_SESSION_ID_LENGTH is the maximum length of an SSL session ID. +#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 + // SSL_SESSION_get_id returns a pointer to a buffer containing |session|'s // session ID and sets |*out_len| to its length. OPENSSL_EXPORT const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, unsigned *out_len); +// SSL_SESSION_set1_id sets |session|'s session ID to |sid|, It returns one on +// success and zero on error. This function may be useful in writing tests but +// otherwise should not be used. +OPENSSL_EXPORT int SSL_SESSION_set1_id(SSL_SESSION *session, const uint8_t *sid, + size_t sid_len); + // SSL_SESSION_get_time returns the time at which |session| was established in // seconds since the UNIX epoch. OPENSSL_EXPORT uint64_t SSL_SESSION_get_time(const SSL_SESSION *session); @@ -1692,6 +1682,36 @@ OPENSSL_EXPORT uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session); // TODO(davidben): This should return a const X509 *. OPENSSL_EXPORT X509 *SSL_SESSION_get0_peer(const SSL_SESSION *session); +// SSL_SESSION_get0_peer_certificates returns the peer certificate chain stored +// in |session|, or NULL if the peer did not use certificates. This is the +// unverified list of certificates as sent by the peer, not the final chain +// built during verification. The caller does not take ownership of the result. +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * + SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session); + +// SSL_SESSION_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to +// point to |*out_len| bytes of SCT information stored in |session|. This is +// only valid for client sessions. The SCT information is a +// SignedCertificateTimestampList (including the two leading length bytes). See +// https://tools.ietf.org/html/rfc6962#section-3.3 If no SCT was received then +// |*out_len| will be zero on return. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT void SSL_SESSION_get0_signed_cert_timestamp_list( + const SSL_SESSION *session, const uint8_t **out, size_t *out_len); + +// SSL_SESSION_get0_ocsp_response sets |*out| and |*out_len| to point to +// |*out_len| bytes of an OCSP response from the server. This is the DER +// encoding of an OCSPResponse type as defined in RFC 2560. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT void SSL_SESSION_get0_ocsp_response(const SSL_SESSION *session, + const uint8_t **out, + size_t *out_len); + +// SSL_MAX_MASTER_KEY_LENGTH is the maximum length of a master secret. +#define SSL_MAX_MASTER_KEY_LENGTH 48 + // SSL_SESSION_get_master_key writes up to |max_out| bytes of |session|'s master // secret to |out| and returns the number of bytes written. If |max_out| is // zero, it returns the size of the master secret. @@ -1710,6 +1730,12 @@ OPENSSL_EXPORT uint64_t SSL_SESSION_set_time(SSL_SESSION *session, OPENSSL_EXPORT uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout); +// SSL_SESSION_get0_id_context returns a pointer to a buffer containing +// |session|'s session ID context (see |SSL_CTX_set_session_id_context|) and +// sets |*out_len| to its length. +OPENSSL_EXPORT const uint8_t *SSL_SESSION_get0_id_context( + const SSL_SESSION *session, unsigned *out_len); + // SSL_SESSION_set1_id_context sets |session|'s session ID context (see // |SSL_CTX_set_session_id_context|) to |sid_ctx|. It returns one on success and // zero on error. This function may be useful in writing tests but otherwise @@ -1723,8 +1749,8 @@ OPENSSL_EXPORT int SSL_SESSION_set1_id_context(SSL_SESSION *session, // // If this function returns one, clients retain multiple sessions and use each // only once. This prevents passive observers from correlating connections with -// tickets. See draft-ietf-tls-tls13-18, appendix B.5. If it returns zero, -// |session| cannot be used without leaking a correlator. +// tickets. See RFC 8446, appendix C.4. If it returns zero, |session| cannot be +// used without leaking a correlator. OPENSSL_EXPORT int SSL_SESSION_should_be_single_use(const SSL_SESSION *session); // SSL_SESSION_is_resumable returns one if |session| is resumable and zero @@ -1742,11 +1768,40 @@ OPENSSL_EXPORT void SSL_SESSION_get0_ticket(const SSL_SESSION *session, const uint8_t **out_ticket, size_t *out_len); +// SSL_SESSION_set_ticket sets |session|'s ticket to |ticket|. It returns one on +// success and zero on error. This function may be useful in writing tests but +// otherwise should not be used. +OPENSSL_EXPORT int SSL_SESSION_set_ticket(SSL_SESSION *session, + const uint8_t *ticket, + size_t ticket_len); + // SSL_SESSION_get_ticket_lifetime_hint returns ticket lifetime hint of // |session| in seconds or zero if none was set. OPENSSL_EXPORT uint32_t SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session); +// SSL_SESSION_get0_cipher returns the cipher negotiated by the connection which +// established |session|. +// +// Note that, in TLS 1.3, there is no guarantee that resumptions with |session| +// will use that cipher. Prefer calling |SSL_get_current_cipher| on the |SSL| +// instead. +OPENSSL_EXPORT const SSL_CIPHER *SSL_SESSION_get0_cipher( + const SSL_SESSION *session); + +// SSL_SESSION_has_peer_sha256 returns one if |session| has a SHA-256 hash of +// the peer's certificate retained and zero if the peer did not present a +// certificate or if this was not enabled when |session| was created. See also +// |SSL_CTX_set_retain_only_sha256_of_client_certs|. +OPENSSL_EXPORT int SSL_SESSION_has_peer_sha256(const SSL_SESSION *session); + +// SSL_SESSION_get0_peer_sha256 sets |*out_ptr| and |*out_len| to the SHA-256 +// hash of the peer certificate retained in |session|, or NULL and zero if it +// does not have one. See also |SSL_CTX_set_retain_only_sha256_of_client_certs|. +OPENSSL_EXPORT void SSL_SESSION_get0_peer_sha256(const SSL_SESSION *session, + const uint8_t **out_ptr, + size_t *out_len); + // Session caching. // @@ -1830,7 +1885,11 @@ OPENSSL_EXPORT int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx); // SSL_set_session, for a client, configures |ssl| to offer to resume |session| // in the initial handshake and returns one. The caller retains ownership of -// |session|. +// |session|. Note that configuring a session assumes the authentication in the +// session is valid. For callers that wish to revalidate the session before +// offering, see |SSL_SESSION_get0_peer_certificates|, +// |SSL_SESSION_get0_signed_cert_timestamp_list|, and +// |SSL_SESSION_get0_ocsp_response|. // // It is an error to call this function after the handshake has begun. OPENSSL_EXPORT int SSL_set_session(SSL *ssl, SSL_SESSION *session); @@ -1863,6 +1922,9 @@ OPENSSL_EXPORT void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, // sessions created in |ctx|. OPENSSL_EXPORT uint32_t SSL_CTX_get_timeout(const SSL_CTX *ctx); +// SSL_MAX_SID_CTX_LENGTH is the maximum length of a session ID context. +#define SSL_MAX_SID_CTX_LENGTH 32 + // SSL_CTX_set_session_id_context sets |ctx|'s session ID context to |sid_ctx|. // It returns one on success and zero on error. The session ID context is an // application-defined opaque byte string. A session will not be used in a @@ -1881,7 +1943,7 @@ OPENSSL_EXPORT int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, size_t sid_ctx_len); // SSL_get0_session_id_context returns a pointer to |ssl|'s session ID context -// and sets |*out_len| to its length. +// and sets |*out_len| to its length. It returns NULL on error. OPENSSL_EXPORT const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len); @@ -2002,13 +2064,13 @@ OPENSSL_EXPORT SSL_SESSION *SSL_magic_pending_session_ptr(void); // On the client, ticket-based sessions use the same APIs as ID-based tickets. // Callers do not need to handle them differently. // -// On the server, tickets are encrypted and authenticated with a secret key. By -// default, an |SSL_CTX| generates a key on creation and uses it for the -// lifetime of the |SSL_CTX|. Tickets are minted and processed -// transparently. The following functions may be used to configure a persistent -// key or implement more custom behavior, including key rotation and sharing -// keys between multiple servers in a large deployment. There are three levels -// of customisation possible: +// On the server, tickets are encrypted and authenticated with a secret key. +// By default, an |SSL_CTX| will manage session ticket encryption keys by +// generating them internally and rotating every 48 hours. Tickets are minted +// and processed transparently. The following functions may be used to configure +// a persistent key or implement more custom behavior, including key rotation +// and sharing keys between multiple servers in a large deployment. There are +// three levels of customisation possible: // // 1) One can simply set the keys with |SSL_CTX_set_tlsext_ticket_keys|. // 2) One can configure an |EVP_CIPHER_CTX| and |HMAC_CTX| directly for @@ -2074,7 +2136,7 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_key_cb( // ssl_ticket_aead_result_t enumerates the possible results from decrypting a // ticket with an |SSL_TICKET_AEAD_METHOD|. -enum ssl_ticket_aead_result_t { +enum ssl_ticket_aead_result_t BORINGSSL_ENUM_INT { // ssl_ticket_aead_success indicates that the ticket was successfully // decrypted. ssl_ticket_aead_success, @@ -2168,6 +2230,7 @@ OPENSSL_EXPORT int SSL_set1_curves_list(SSL *ssl, const char *curves); #define SSL_CURVE_SECP384R1 24 #define SSL_CURVE_SECP521R1 25 #define SSL_CURVE_X25519 29 +#define SSL_CURVE_CECPQ2 16696 // SSL_get_curve_id returns the ID of the curve used by |ssl|'s most recently // completed handshake or 0 if not applicable. @@ -2247,7 +2310,7 @@ OPENSSL_EXPORT void SSL_set_verify(SSL *ssl, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)); -enum ssl_verify_result_t { +enum ssl_verify_result_t BORINGSSL_ENUM_INT { ssl_verify_ok, ssl_verify_invalid, ssl_verify_retry, @@ -2285,7 +2348,7 @@ OPENSSL_EXPORT void SSL_set_custom_verify( OPENSSL_EXPORT int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); // SSL_get_verify_mode returns |ssl|'s verify mode, set by |SSL_CTX_set_verify| -// or |SSL_set_verify|. +// or |SSL_set_verify|. It returns -1 on error. OPENSSL_EXPORT int SSL_get_verify_mode(const SSL *ssl); // SSL_CTX_get_verify_callback returns the callback set by @@ -2456,10 +2519,12 @@ OPENSSL_EXPORT int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store); OPENSSL_EXPORT int SSL_set1_verify_cert_store(SSL *ssl, X509_STORE *store); // SSL_CTX_set_ed25519_enabled configures whether |ctx| advertises support for -// the Ed25519 signature algorithm when using the default preference list. +// the Ed25519 signature algorithm when using the default preference list. It is +// disabled by default and may be enabled if the certificate verifier supports +// Ed25519. OPENSSL_EXPORT void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled); -// SSL_CTX_set_verify_algorithm_prefs confingures |ctx| to use |prefs| as the +// SSL_CTX_set_verify_algorithm_prefs configures |ctx| to use |prefs| as the // preference list when verifying signature's from the peer's long-term key. It // returns one on zero on error. |prefs| should not include the internal-only // value |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. @@ -2513,8 +2578,8 @@ OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); // // The returned stack is owned by |ssl|, as are its contents. It should not be // used past the point where the handshake is restarted after the callback. -OPENSSL_EXPORT STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs( - const SSL *ssl); +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * + SSL_get0_server_requested_CAs(const SSL *ssl); // SSL_CTX_get_client_CA_list returns |ctx|'s client certificate CA list. OPENSSL_EXPORT STACK_OF(X509_NAME) * @@ -2669,6 +2734,54 @@ OPENSSL_EXPORT void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled); +// Certificate compression. +// +// Certificates in TLS 1.3 can be compressed[1]. BoringSSL supports this as both +// a client and a server, but does not link against any specific compression +// libraries in order to keep dependencies to a minimum. Instead, hooks for +// compression and decompression can be installed in an |SSL_CTX| to enable +// support. +// +// [1] https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03. + +// ssl_cert_compression_func_t is a pointer to a function that performs +// compression. It must write the compressed representation of |in| to |out|, +// returning one on success and zero on error. The results of compressing +// certificates are not cached internally. Implementations may wish to implement +// their own cache if they expect it to be useful given the certificates that +// they serve. +typedef int (*ssl_cert_compression_func_t)(SSL *ssl, CBB *out, + const uint8_t *in, size_t in_len); + +// ssl_cert_decompression_func_t is a pointer to a function that performs +// decompression. The compressed data from the peer is passed as |in| and the +// decompressed result must be exactly |uncompressed_len| bytes long. It returns +// one on success, in which case |*out| must be set to the result of +// decompressing |in|, or zero on error. Setting |*out| transfers ownership, +// i.e. |CRYPTO_BUFFER_free| will be called on |*out| at some point in the +// future. The results of decompressions are not cached internally. +// Implementations may wish to implement their own cache if they expect it to be +// useful. +typedef int (*ssl_cert_decompression_func_t)(SSL *ssl, CRYPTO_BUFFER **out, + size_t uncompressed_len, + const uint8_t *in, size_t in_len); + +// SSL_CTX_add_cert_compression_alg registers a certificate compression +// algorithm on |ctx| with ID |alg_id|. (The value of |alg_id| should be an IANA +// assigned value and each can only be registered once.) +// +// One of the function pointers may be NULL to avoid having to implement both +// sides of a compression algorithm if you're only going to use it in one +// direction. In this case, the unimplemented direction acts like it was never +// configured. +// +// For a server, algorithms are registered in preference order with the most +// preferable first. It returns one on success or zero on error. +OPENSSL_EXPORT int SSL_CTX_add_cert_compression_alg( + SSL_CTX *ctx, uint16_t alg_id, ssl_cert_compression_func_t compress, + ssl_cert_decompression_func_t decompress); + + // Next protocol negotiation. // // The NPN extension (draft-agl-tls-nextprotoneg-03) is the predecessor to ALPN @@ -2938,27 +3051,7 @@ OPENSSL_EXPORT const char *SSL_get_psk_identity_hint(const SSL *ssl); OPENSSL_EXPORT const char *SSL_get_psk_identity(const SSL *ssl); -// Dummy post-quantum padding. -// -// Dummy post-quantum padding invovles the client (and later server) sending -// useless, random-looking bytes in an extension in their ClientHello or -// ServerHello. These extensions are sized to simulate a post-quantum -// key-exchange and so enable measurement of the latency impact of the -// additional bandwidth. - -// SSL_set_dummy_pq_padding_size enables the sending of a dummy PQ padding -// extension and configures its size. This is only effective for a client: a -// server will echo an extension with one of equal length when we get to that -// phase of the experiment. It returns one for success and zero otherwise. -OPENSSL_EXPORT int SSL_set_dummy_pq_padding_size(SSL *ssl, size_t num_bytes); - -// SSL_dummy_pq_padding_used returns one if the server echoed a dummy PQ padding -// extension and zero otherwise. It may only be called on a client connection -// once the ServerHello has been processed, otherwise it'll return zero. -OPENSSL_EXPORT int SSL_dummy_pq_padding_used(SSL *ssl); - - -// QUIC Transport Parameters. +// QUIC transport parameters. // // draft-ietf-quic-tls defines a new TLS extension quic_transport_parameters // used by QUIC for each endpoint to unilaterally declare its supported @@ -2990,6 +3083,176 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, size_t *out_params_len); +// Delegated credentials. +// +// *** EXPERIMENTAL — PRONE TO CHANGE *** +// +// draft-ietf-tls-subcerts is a proposed extension for TLS 1.3 and above that +// allows an end point to use its certificate to delegate credentials for +// authentication. If the peer indicates support for this extension, then this +// host may use a delegated credential to sign the handshake. Once issued, +// credentials can't be revoked. In order to mitigate the damage in case the +// credential secret key is compromised, the credential is only valid for a +// short time (days, hours, or even minutes). This library implements draft-03 +// of the protocol spec. +// +// The extension ID has not been assigned; we're using 0xff02 for the time +// being. Currently only the server side is implemented. +// +// Servers configure a DC for use in the handshake via +// |SSL_set1_delegated_credential|. It must be signed by the host's end-entity +// certificate as defined in draft-ietf-tls-subcerts-03. + +// SSL_set1_delegated_credential configures the delegated credential (DC) that +// will be sent to the peer for the current connection. |dc| is the DC in wire +// format, and |pkey| or |key_method| is the corresponding private key. +// Currently (as of draft-03), only servers may configure a DC to use in the +// handshake. +// +// The DC will only be used if the protocol version is correct and the signature +// scheme is supported by the peer. If not, the DC will not be negotiated and +// the handshake will use the private key (or private key method) associated +// with the certificate. +OPENSSL_EXPORT int SSL_set1_delegated_credential( + SSL *ssl, CRYPTO_BUFFER *dc, EVP_PKEY *pkey, + const SSL_PRIVATE_KEY_METHOD *key_method); + +// SSL_delegated_credential_used returns one if a delegated credential was used +// and zero otherwise. +OPENSSL_EXPORT int SSL_delegated_credential_used(const SSL *ssl); + + +// QUIC integration. +// +// QUIC acts as an underlying transport for the TLS 1.3 handshake. The following +// functions allow a QUIC implementation to serve as the underlying transport as +// described in draft-ietf-quic-tls. +// +// When configured for QUIC, |SSL_do_handshake| will drive the handshake as +// before, but it will not use the configured |BIO|. It will call functions on +// |SSL_QUIC_METHOD| to configure secrets and send data. If data is needed from +// the peer, it will return |SSL_ERROR_WANT_READ|. When received, the caller +// should call |SSL_provide_quic_data| and then |SSL_do_handshake| to continue +// the handshake. After the handshake is complete, the caller should call +// |SSL_provide_quic_data| for any post-handshake data, followed by +// |SSL_process_quic_post_handshake| to process it. It is an error to call +// |SSL_read| and |SSL_write| in QUIC. +// +// 0-RTT behaves similarly to |TLS_method|'s usual behavior. |SSL_do_handshake| +// returns early as soon as the client (respectively, server) is allowed to send +// 0-RTT (respectively, half-RTT) data. The caller should then call +// |SSL_do_handshake| again to consume the remaining handshake messages and +// confirm the handshake. As a client, |SSL_ERROR_EARLY_DATA_REJECTED| and +// |SSL_reset_early_data_reject| behave as usual. +// +// Note that secrets for an encryption level may be available to QUIC before the +// level is active in TLS. Callers should use |SSL_quic_read_level| to determine +// the active read level for |SSL_provide_quic_data|. |SSL_do_handshake| will +// pass the active write level to |SSL_QUIC_METHOD| when writing data. Callers +// can use |SSL_quic_write_level| to query the active write level when +// generating their own errors. +// +// See https://tools.ietf.org/html/draft-ietf-quic-tls-15#section-4.1 for more +// details. +// +// To avoid DoS attacks, the QUIC implementation must limit the amount of data +// being queued up. The implementation can call +// |SSL_quic_max_handshake_flight_len| to get the maximum buffer length at each +// encryption level. +// +// Note: 0-RTT support is incomplete and does not currently handle QUIC +// transport parameters and server SETTINGS frame. + +// ssl_encryption_level_t represents a specific QUIC encryption level used to +// transmit handshake messages. +enum ssl_encryption_level_t BORINGSSL_ENUM_INT { + ssl_encryption_initial = 0, + ssl_encryption_early_data, + ssl_encryption_handshake, + ssl_encryption_application, +}; + +// ssl_quic_method_st (aka |SSL_QUIC_METHOD|) describes custom QUIC hooks. +struct ssl_quic_method_st { + // set_encryption_secrets configures the read and write secrets for the given + // encryption level. This function will always be called before an encryption + // level other than |ssl_encryption_initial| is used. Note, however, that + // secrets for a level may be configured before TLS is ready to send or accept + // data at that level. + // + // When reading packets at a given level, the QUIC implementation must send + // ACKs at the same level, so this function provides read and write secrets + // together. The exception is |ssl_encryption_early_data|, where secrets are + // only available in the client to server direction. The other secret will be + // NULL. The server acknowledges such data at |ssl_encryption_application|, + // which will be configured in the same |SSL_do_handshake| call. + // + // This function should use |SSL_get_current_cipher| to determine the TLS + // cipher suite. + // + // It returns one on success and zero on error. + int (*set_encryption_secrets)(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *read_secret, + const uint8_t *write_secret, size_t secret_len); + // add_handshake_data adds handshake data to the current flight at the given + // encryption level. It returns one on success and zero on error. + // + // BoringSSL will pack data from a single encryption level together, but a + // single handshake flight may include multiple encryption levels. Callers + // should defer writing data to the network until |flush_flight| to better + // pack QUIC packets into transport datagrams. + int (*add_handshake_data)(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *data, size_t len); + // flush_flight is called when the current flight is complete and should be + // written to the transport. Note a flight may contain data at several + // encryption levels. It returns one on success and zero on error. + int (*flush_flight)(SSL *ssl); + // send_alert sends a fatal alert at the specified encryption level. It + // returns one on success and zero on error. + int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert); +}; + +// SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes +// that may be received at the given encryption level. This function should be +// used to limit buffering in the QUIC implementation. +// +// See https://tools.ietf.org/html/draft-ietf-quic-transport-16#section-4.4. +OPENSSL_EXPORT size_t SSL_quic_max_handshake_flight_len( + const SSL *ssl, enum ssl_encryption_level_t level); + +// SSL_quic_read_level returns the current read encryption level. +OPENSSL_EXPORT enum ssl_encryption_level_t SSL_quic_read_level(const SSL *ssl); + +// SSL_quic_write_level returns the current write encryption level. +OPENSSL_EXPORT enum ssl_encryption_level_t SSL_quic_write_level(const SSL *ssl); + +// SSL_provide_quic_data provides data from QUIC at a particular encryption +// level |level|. It is an error to call this function outside of the handshake +// or with an encryption level other than the current read level. It returns one +// on success and zero on error. +OPENSSL_EXPORT int SSL_provide_quic_data(SSL *ssl, + enum ssl_encryption_level_t level, + const uint8_t *data, size_t len); + + +// SSL_process_quic_post_handshake processes any data that QUIC has provided +// after the handshake has completed. This includes NewSessionTicket messages +// sent by the server. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_process_quic_post_handshake(SSL *ssl); + +// SSL_CTX_set_quic_method configures the QUIC hooks. This should only be +// configured with a minimum version of TLS 1.3. |quic_method| must remain valid +// for the lifetime of |ctx|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_quic_method(SSL_CTX *ctx, + const SSL_QUIC_METHOD *quic_method); + +// SSL_set_quic_method configures the QUIC hooks. This should only be +// configured with a minimum version of TLS 1.3. |quic_method| must remain valid +// for the lifetime of |ssl|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_quic_method(SSL *ssl, + const SSL_QUIC_METHOD *quic_method); + + // Early data. // // WARNING: 0-RTT support in BoringSSL is currently experimental and not fully @@ -3002,8 +3265,8 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, // WARNING: A 0-RTT handshake has different security properties from normal // handshake, so it is off by default unless opted in. In particular, early data // is replayable by a network attacker. Callers must account for this when -// sending or processing data before the handshake is confirmed. See -// draft-ietf-tls-tls13-18 for more information. +// sending or processing data before the handshake is confirmed. See RFC 8446 +// for more information. // // As a server, if early data is accepted, |SSL_do_handshake| will complete as // soon as the ClientHello is processed and server flight sent. |SSL_write| may @@ -3038,9 +3301,9 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, // properties. The caller must disregard any values from before the reset and // query again. // -// Finally, to implement the fallback described in draft-ietf-tls-tls13-18 -// appendix C.3, retry on a fresh connection without 0-RTT if the handshake -// fails with |SSL_R_WRONG_VERSION_ON_EARLY_DATA|. +// Finally, to implement the fallback described in RFC 8446 appendix D.3, retry +// on a fresh connection without 0-RTT if the handshake fails with +// |SSL_R_WRONG_VERSION_ON_EARLY_DATA|. // SSL_CTX_set_early_data_enabled sets whether early data is allowed to be used // with resumptions using |ctx|. @@ -3058,6 +3321,10 @@ OPENSSL_EXPORT void SSL_set_early_data_enabled(SSL *ssl, int enabled); // and |SSL_write| to send half-RTT data. OPENSSL_EXPORT int SSL_in_early_data(const SSL *ssl); +// SSL_SESSION_early_data_capable returns whether early data would have been +// attempted with |session| if enabled. +OPENSSL_EXPORT int SSL_SESSION_early_data_capable(const SSL_SESSION *session); + // SSL_early_data_accepted returns whether early data was accepted on the // handshake performed by |ssl|. OPENSSL_EXPORT int SSL_early_data_accepted(const SSL *ssl); @@ -3071,21 +3338,59 @@ OPENSSL_EXPORT int SSL_early_data_accepted(const SSL *ssl); // |SSL_ERROR_EARLY_DATA_REJECTED|. OPENSSL_EXPORT void SSL_reset_early_data_reject(SSL *ssl); -// SSL_export_early_keying_material behaves like |SSL_export_keying_material|, -// but it uses the early exporter. The operation will fail if |ssl| did not -// negotiate TLS 1.3 or 0-RTT. -OPENSSL_EXPORT int SSL_export_early_keying_material( - SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, - const uint8_t *context, size_t context_len); +// SSL_get_ticket_age_skew returns the difference, in seconds, between the +// client-sent ticket age and the server-computed value in TLS 1.3 server +// connections which resumed a session. +OPENSSL_EXPORT int32_t SSL_get_ticket_age_skew(const SSL *ssl); + +// An ssl_early_data_reason_t describes why 0-RTT was accepted or rejected. +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum ssl_early_data_reason_t BORINGSSL_ENUM_INT { + // The handshake has not progressed far enough for the 0-RTT status to be + // known. + ssl_early_data_unknown = 0, + // 0-RTT is disabled for this connection. + ssl_early_data_disabled = 1, + // 0-RTT was accepted. + ssl_early_data_accepted = 2, + // The negotiated protocol version does not support 0-RTT. + ssl_early_data_protocol_version = 3, + // The peer declined to offer or accept 0-RTT for an unknown reason. + ssl_early_data_peer_declined = 4, + // The client did not offer a session. + ssl_early_data_no_session_offered = 5, + // The server declined to resume the session. + ssl_early_data_session_not_resumed = 6, + // The session does not support 0-RTT. + ssl_early_data_unsupported_for_session = 7, + // The server sent a HelloRetryRequest. + ssl_early_data_hello_retry_request = 8, + // The negotiated ALPN protocol did not match the session. + ssl_early_data_alpn_mismatch = 9, + // The connection negotiated Channel ID, which is incompatible with 0-RTT. + ssl_early_data_channel_id = 10, + // The connection negotiated token binding, which is incompatible with 0-RTT. + ssl_early_data_token_binding = 11, + // The client and server ticket age were too far apart. + ssl_early_data_ticket_age_skew = 12, + // The value of the largest entry. + ssl_early_data_reason_max_value = ssl_early_data_ticket_age_skew, +}; + +// SSL_get_early_data_reason returns details why 0-RTT was accepted or rejected +// on |ssl|. This is primarily useful on the server. +OPENSSL_EXPORT enum ssl_early_data_reason_t SSL_get_early_data_reason( + const SSL *ssl); // Alerts. // -// TLS and SSL 3.0 use alerts to signal error conditions. Alerts have a type -// (warning or fatal) and description. OpenSSL internally handles fatal alerts -// with dedicated error codes (see |SSL_AD_REASON_OFFSET|). Except for -// close_notify, warning alerts are silently ignored and may only be surfaced -// with |SSL_CTX_set_info_callback|. +// TLS uses alerts to signal error conditions. Alerts have a type (warning or +// fatal) and description. OpenSSL internally handles fatal alerts with +// dedicated error codes (see |SSL_AD_REASON_OFFSET|). Except for close_notify, +// warning alerts are silently ignored and may only be surfaced with +// |SSL_CTX_set_info_callback|. // SSL_AD_REASON_OFFSET is the offset between error reasons and |SSL_AD_*| // values. Any error code under |ERR_LIB_SSL| with an error reason above this @@ -3096,7 +3401,7 @@ OPENSSL_EXPORT int SSL_export_early_keying_material( // This value must be kept in sync with reservedReasonCode in make_errors.h #define SSL_AD_REASON_OFFSET 1000 -// SSL_AD_* are alert descriptions for SSL 3.0 and TLS. +// SSL_AD_* are alert descriptions. #define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY #define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE #define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC @@ -3104,7 +3409,7 @@ OPENSSL_EXPORT int SSL_export_early_keying_material( #define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW #define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE #define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE -#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE // Not used in TLS +#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE // Legacy SSL 3.0 value #define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE #define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE #define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED @@ -3184,7 +3489,7 @@ OPENSSL_EXPORT int SSL_CTX_get_ex_new_index(long argl, void *argp, // SSL_get_ivs sets |*out_iv_len| to the length of the IVs for the ciphers // underlying |ssl| and sets |*out_read_iv| and |*out_write_iv| to point to the // current IVs for the read and write directions. This is only meaningful for -// connections with implicit IVs (i.e. CBC mode with SSLv3 or TLS 1.0). +// connections with implicit IVs (i.e. CBC mode with TLS 1.0). // // It returns one on success or zero on error. OPENSSL_EXPORT int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, @@ -3213,13 +3518,6 @@ OPENSSL_EXPORT uint64_t SSL_get_write_sequence(const SSL *ssl); // Obscure functions. -// SSL_get_structure_sizes returns the sizes of the SSL, SSL_CTX and -// SSL_SESSION structures so that a test can ensure that outside code agrees on -// these values. -OPENSSL_EXPORT void SSL_get_structure_sizes(size_t *ssl_size, - size_t *ssl_ctx_size, - size_t *ssl_session_size); - // SSL_CTX_set_msg_callback installs |cb| as the message callback for |ctx|. // This callback will be called when sending or receiving low-level record // headers, complete handshake messages, ChangeCipherSpec, and alerts. @@ -3276,11 +3574,32 @@ OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))( OPENSSL_EXPORT void SSL_CTX_set_current_time_cb( SSL_CTX *ctx, void (*cb)(const SSL *ssl, struct timeval *out_clock)); -enum ssl_renegotiate_mode_t { +// SSL_set_shed_handshake_config allows some of the configuration of |ssl| to be +// freed after its handshake completes. Once configuration has been shed, APIs +// that query it may fail. "Configuration" in this context means anything that +// was set by the caller, as distinct from information derived from the +// handshake. For example, |SSL_get_ciphers| queries how the |SSL| was +// configured by the caller, and fails after configuration has been shed, +// whereas |SSL_get_cipher| queries the result of the handshake, and is +// unaffected by configuration shedding. +// +// If configuration shedding is enabled, it is an error to call |SSL_clear|. +// +// Note that configuration shedding as a client additionally depends on +// renegotiation being disabled (see |SSL_set_renegotiate_mode|). If +// renegotiation is possible, the configuration will be retained. If +// configuration shedding is enabled and renegotiation later disabled after the +// handshake, |SSL_set_renegotiate_mode| will shed configuration then. This may +// be useful for clients which support renegotiation with some ALPN protocols, +// such as HTTP/1.1, and not others, such as HTTP/2. +OPENSSL_EXPORT void SSL_set_shed_handshake_config(SSL *ssl, int enable); + +enum ssl_renegotiate_mode_t BORINGSSL_ENUM_INT { ssl_renegotiate_never = 0, ssl_renegotiate_once, ssl_renegotiate_freely, ssl_renegotiate_ignore, + ssl_renegotiate_explicit, }; // SSL_set_renegotiate_mode configures how |ssl|, a client, reacts to @@ -3294,11 +3613,35 @@ enum ssl_renegotiate_mode_t { // Note that ignoring HelloRequest messages may cause the connection to stall // if the server waits for the renegotiation to complete. // +// If set to |ssl_renegotiate_explicit|, |SSL_read| and |SSL_peek| calls which +// encounter a HelloRequest will pause with |SSL_ERROR_WANT_RENEGOTIATE|. +// |SSL_write| will continue to work while paused. The caller may call +// |SSL_renegotiate| to begin the renegotiation at a later point. This mode may +// be used if callers wish to eagerly call |SSL_peek| without triggering a +// renegotiation. +// +// If configuration shedding is enabled (see |SSL_set_shed_handshake_config|), +// configuration is released if, at any point after the handshake, renegotiation +// is disabled. It is not possible to switch from disabling renegotiation to +// enabling it on a given connection. Callers that condition renegotiation on, +// e.g., ALPN must enable renegotiation before the handshake and conditionally +// disable it afterwards. +// // There is no support in BoringSSL for initiating renegotiations as a client // or server. OPENSSL_EXPORT void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode); +// SSL_renegotiate starts a deferred renegotiation on |ssl| if it was configured +// with |ssl_renegotiate_explicit| and has a pending HelloRequest. It returns +// one on success and zero on error. +// +// This function does not do perform any I/O. On success, a subsequent +// |SSL_do_handshake| call will run the handshake. |SSL_write| and +// |SSL_read| will also complete the handshake before sending or receiving +// application data. +OPENSSL_EXPORT int SSL_renegotiate(SSL *ssl); + // SSL_renegotiate_pending returns one if |ssl| is in the middle of a // renegotiation. OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *ssl); @@ -3307,22 +3650,6 @@ OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *ssl); // performed by |ssl|. This includes the pending renegotiation, if any. OPENSSL_EXPORT int SSL_total_renegotiations(const SSL *ssl); -enum tls13_variant_t { - tls13_default = 0, -}; - -// SSL_CTX_set_tls13_variant sets which variant of TLS 1.3 we negotiate. On the -// server, if |variant| is not |tls13_default|, all variants are enabled. On the -// client, only the configured variant is enabled. -OPENSSL_EXPORT void SSL_CTX_set_tls13_variant(SSL_CTX *ctx, - enum tls13_variant_t variant); - -// SSL_set_tls13_variant sets which variant of TLS 1.3 we negotiate. On the -// server, if |variant| is not |tls13_default|, all variants are enabled. On the -// client, only the configured variant is enabled. -OPENSSL_EXPORT void SSL_set_tls13_variant(SSL *ssl, - enum tls13_variant_t variant); - // SSL_MAX_CERT_LIST_DEFAULT is the default maximum length, in bytes, of a peer // certificate chain. #define SSL_MAX_CERT_LIST_DEFAULT (1024 * 100) @@ -3383,7 +3710,7 @@ typedef struct ssl_early_callback_ctx { // ssl_select_cert_result_t enumerates the possible results from selecting a // certificate with |select_certificate_cb|. -enum ssl_select_cert_result_t { +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT { // ssl_select_cert_success indicates that the certificate selection was // successful. ssl_select_cert_success = 1, @@ -3414,6 +3741,8 @@ OPENSSL_EXPORT int SSL_early_callback_ctx_extension_get( // high-level operation on |ssl| to be retried at a later time, which will // result in another call to |cb|. // +// |SSL_get_servername| may be used during this callback. +// // Note: The |SSL_CLIENT_HELLO| is only valid for the duration of the callback // and is not valid while the handshake is paused. OPENSSL_EXPORT void SSL_CTX_set_select_certificate_cb( @@ -3426,14 +3755,33 @@ OPENSSL_EXPORT void SSL_CTX_set_select_certificate_cb( OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb( SSL_CTX *ctx, int (*cb)(const SSL_CLIENT_HELLO *)); -// SSL_ST_* are possible values for |SSL_state| and the bitmasks that make them -// up. +// SSL_CTX_set_reverify_on_resume configures whether the certificate +// verification callback will be used to reverify stored certificates +// when resuming a session. This only works with |SSL_CTX_set_custom_verify|. +// For now, this is incompatible with |SSL_VERIFY_NONE| mode, and is only +// respected on clients. +OPENSSL_EXPORT void SSL_CTX_set_reverify_on_resume(SSL_CTX *ctx, int enabled); + +// SSL_set_enforce_rsa_key_usage configures whether the keyUsage extension of +// RSA leaf certificates will be checked for consistency with the TLS +// usage. This parameter may be set late; it will not be read until after the +// certificate verification callback. +OPENSSL_EXPORT void SSL_set_enforce_rsa_key_usage(SSL *ssl, int enabled); + +// SSL_ST_* are possible values for |SSL_state|, the bitmasks that make them up, +// and some historical values for compatibility. Only |SSL_ST_INIT| and +// |SSL_ST_OK| are ever returned. #define SSL_ST_CONNECT 0x1000 #define SSL_ST_ACCEPT 0x2000 #define SSL_ST_MASK 0x0FFF #define SSL_ST_INIT (SSL_ST_CONNECT | SSL_ST_ACCEPT) #define SSL_ST_OK 0x03 #define SSL_ST_RENEGOTIATE (0x04 | SSL_ST_INIT) +#define SSL_ST_BEFORE (0x05 | SSL_ST_INIT) + +// TLS_ST_* are aliases for |SSL_ST_*| for OpenSSL 1.1.0 compatibility. +#define TLS_ST_OK SSL_ST_OK +#define TLS_ST_BEFORE SSL_ST_BEFORE // SSL_CB_* are possible values for the |type| parameter in the info // callback and the bitmasks that make them up. @@ -3537,7 +3885,8 @@ OPENSSL_EXPORT const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl); // the SHA-256 hash of peer's certificate should be saved in memory and in the // session. This can save memory, ticket size and session cache space. If // enabled, |SSL_get_peer_certificate| will return NULL after the handshake -// completes. See the |peer_sha256| field of |SSL_SESSION| for the hash. +// completes. See |SSL_SESSION_has_peer_sha256| and +// |SSL_SESSION_get0_peer_sha256| to query the hash. OPENSSL_EXPORT void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enable); @@ -3545,7 +3894,8 @@ OPENSSL_EXPORT void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, // only the SHA-256 hash of peer's certificate should be saved in memory and in // the session. This can save memory, ticket size and session cache space. If // enabled, |SSL_get_peer_certificate| will return NULL after the handshake -// completes. See the |peer_sha256| field of |SSL_SESSION| for the hash. +// completes. See |SSL_SESSION_has_peer_sha256| and +// |SSL_SESSION_get0_peer_sha256| to query the hash. OPENSSL_EXPORT void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enable); @@ -3557,20 +3907,37 @@ OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled); // record with |ssl|. OPENSSL_EXPORT size_t SSL_max_seal_overhead(const SSL *ssl); -// SSL_get_ticket_age_skew returns the difference, in seconds, between the -// client-sent ticket age and the server-computed value in TLS 1.3 server -// connections which resumed a session. -OPENSSL_EXPORT int32_t SSL_get_ticket_age_skew(const SSL *ssl); - // SSL_CTX_set_false_start_allowed_without_alpn configures whether connections // on |ctx| may use False Start (if |SSL_MODE_ENABLE_FALSE_START| is enabled) // without negotiating ALPN. OPENSSL_EXPORT void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed); -// SSL_is_draft_downgrade returns one if the TLS 1.3 anti-downgrade mechanism -// would have aborted |ssl|'s handshake and zero otherwise. -OPENSSL_EXPORT int SSL_is_draft_downgrade(const SSL *ssl); +// SSL_CTX_set_ignore_tls13_downgrade configures whether connections on |ctx| +// ignore the downgrade signal in the server's random value. +OPENSSL_EXPORT void SSL_CTX_set_ignore_tls13_downgrade(SSL_CTX *ctx, + int ignore); + +// SSL_set_ignore_tls13_downgrade configures whether |ssl| ignores the downgrade +// signal in the server's random value. +OPENSSL_EXPORT void SSL_set_ignore_tls13_downgrade(SSL *ssl, int ignore); + +// SSL_is_tls13_downgrade returns one if the TLS 1.3 anti-downgrade +// mechanism would have aborted |ssl|'s handshake and zero otherwise. +OPENSSL_EXPORT int SSL_is_tls13_downgrade(const SSL *ssl); + +// SSL_used_hello_retry_request returns one if the TLS 1.3 HelloRetryRequest +// message has been either sent by the server or received by the client. It +// returns zero otherwise. +OPENSSL_EXPORT int SSL_used_hello_retry_request(const SSL *ssl); + +// SSL_set_jdk11_workaround configures whether to workaround various bugs in +// JDK 11's TLS 1.3 implementation by disabling TLS 1.3 for such clients. +// +// https://bugs.openjdk.java.net/browse/JDK-8211806 +// https://bugs.openjdk.java.net/browse/JDK-8212885 +// https://bugs.openjdk.java.net/browse/JDK-8213202 +OPENSSL_EXPORT void SSL_set_jdk11_workaround(SSL *ssl, int enable); // Deprecated functions. @@ -3722,17 +4089,14 @@ OPENSSL_EXPORT int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa); // SSL_CTX_get_read_ahead returns zero. OPENSSL_EXPORT int SSL_CTX_get_read_ahead(const SSL_CTX *ctx); -// SSL_CTX_set_read_ahead does nothing. -OPENSSL_EXPORT void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); +// SSL_CTX_set_read_ahead returns one. +OPENSSL_EXPORT int SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); // SSL_get_read_ahead returns zero. OPENSSL_EXPORT int SSL_get_read_ahead(const SSL *ssl); -// SSL_set_read_ahead does nothing. -OPENSSL_EXPORT void SSL_set_read_ahead(SSL *ssl, int yes); - -// SSL_renegotiate put an error on the error queue and returns zero. -OPENSSL_EXPORT int SSL_renegotiate(SSL *ssl); +// SSL_set_read_ahead returns one. +OPENSSL_EXPORT int SSL_set_read_ahead(SSL *ssl, int yes); // SSL_set_state does nothing. OPENSSL_EXPORT void SSL_set_state(SSL *ssl, int state); @@ -3741,6 +4105,11 @@ OPENSSL_EXPORT void SSL_set_state(SSL *ssl, int state); // pointer to |buf|, or NULL if |len| is less than or equal to zero. OPENSSL_EXPORT char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); +// SSL_get_shared_sigalgs returns zero. +OPENSSL_EXPORT int SSL_get_shared_sigalgs(SSL *ssl, int idx, int *psign, + int *phash, int *psignandhash, + uint8_t *rsig, uint8_t *rhash); + // SSL_MODE_HANDSHAKE_CUTTHROUGH is the same as SSL_MODE_ENABLE_FALSE_START. #define SSL_MODE_HANDSHAKE_CUTTHROUGH SSL_MODE_ENABLE_FALSE_START @@ -3800,7 +4169,7 @@ OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_compression(SSL *ssl); OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_expansion(SSL *ssl); // SSL_get_server_tmp_key returns zero. -OPENSSL_EXPORT int *SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key); +OPENSSL_EXPORT int SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key); // SSL_CTX_set_tmp_dh returns 1. OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); @@ -3817,6 +4186,53 @@ OPENSSL_EXPORT void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, int keylength)); +// SSL_CTX_set1_sigalgs takes |num_values| ints and interprets them as pairs +// where the first is the nid of a hash function and the second is an +// |EVP_PKEY_*| value. It configures the signature algorithm preferences for +// |ctx| based on them and returns one on success or zero on error. +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *values, + size_t num_values); + +// SSL_set1_sigalgs takes |num_values| ints and interprets them as pairs where +// the first is the nid of a hash function and the second is an |EVP_PKEY_*| +// value. It configures the signature algorithm preferences for |ssl| based on +// them and returns one on success or zero on error. +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_set1_sigalgs(SSL *ssl, const int *values, + size_t num_values); + +// SSL_CTX_set1_sigalgs_list takes a textual specification of a set of signature +// algorithms and configures them on |ctx|. It returns one on success and zero +// on error. See +// https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set1_sigalgs_list.html for +// a description of the text format. Also note that TLS 1.3 names (e.g. +// "rsa_pkcs1_md5_sha1") can also be used (as in OpenSSL, although OpenSSL +// doesn't document that). +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str); + +// SSL_set1_sigalgs_list takes a textual specification of a set of signature +// algorithms and configures them on |ssl|. It returns one on success and zero +// on error. See +// https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set1_sigalgs_list.html for +// a description of the text format. Also note that TLS 1.3 names (e.g. +// "rsa_pkcs1_md5_sha1") can also be used (as in OpenSSL, although OpenSSL +// doesn't document that). +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_set1_sigalgs_list(SSL *ssl, const char *str); #define SSL_set_app_data(s, arg) (SSL_set_ex_data(s, 0, (char *)(arg))) #define SSL_get_app_data(s) (SSL_get_ex_data(s, 0)) @@ -3870,8 +4286,10 @@ DEFINE_STACK_OF(SSL_COMP) #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0 #define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0 #define SSL_OP_NO_COMPRESSION 0 +#define SSL_OP_NO_RENEGOTIATION 0 // ssl_renegotiate_never is the default #define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0 #define SSL_OP_NO_SSLv2 0 +#define SSL_OP_NO_SSLv3 0 #define SSL_OP_PKCS1_CHECK_1 0 #define SSL_OP_PKCS1_CHECK_2 0 #define SSL_OP_SINGLE_DH_USE 0 @@ -3890,7 +4308,7 @@ OPENSSL_EXPORT int SSL_cache_hit(SSL *ssl); OPENSSL_EXPORT long SSL_get_default_timeout(const SSL *ssl); // SSL_get_version returns a string describing the TLS version used by |ssl|. -// For example, "TLSv1.2" or "SSLv3". +// For example, "TLSv1.2" or "DTLSv1". OPENSSL_EXPORT const char *SSL_get_version(const SSL *ssl); // SSL_get_cipher_list returns the name of the |n|th cipher in the output of @@ -3914,18 +4332,9 @@ OPENSSL_EXPORT const char *SSL_get_cipher_list(const SSL *ssl, int n); OPENSSL_EXPORT void SSL_CTX_set_client_cert_cb( SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **out_x509, EVP_PKEY **out_pkey)); -#define SSL_NOTHING 1 -#define SSL_WRITING 2 -#define SSL_READING 3 -#define SSL_X509_LOOKUP 4 -#define SSL_CHANNEL_ID_LOOKUP 5 -#define SSL_PENDING_SESSION 7 -#define SSL_CERTIFICATE_SELECTION_PENDING 8 -#define SSL_PRIVATE_KEY_OPERATION 9 -#define SSL_PENDING_TICKET 10 -#define SSL_EARLY_DATA_REJECTED 11 -#define SSL_CERTIFICATE_VERIFY 12 -#define SSL_HANDOFF 13 +#define SSL_NOTHING SSL_ERROR_NONE +#define SSL_WRITING SSL_ERROR_WANT_WRITE +#define SSL_READING SSL_ERROR_WANT_READ // SSL_want returns one of the above values to determine what the most recent // operation on |ssl| was blocked on. Use |SSL_get_error| instead. @@ -3936,15 +4345,15 @@ OPENSSL_EXPORT int SSL_want(const SSL *ssl); // SSL_get_finished writes up to |count| bytes of the Finished message sent by // |ssl| to |buf|. It returns the total untruncated length or zero if none has - // been sent yet. At SSL 3.0 or TLS 1.3 and later, it returns zero. + // been sent yet. At TLS 1.3 and later, it returns zero. // // Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count); // SSL_get_peer_finished writes up to |count| bytes of the Finished message // received from |ssl|'s peer to |buf|. It returns the total untruncated length - // or zero if none has been received yet. At SSL 3.0 or TLS 1.3 and later, it - // returns zero. + // or zero if none has been received yet. At TLS 1.3 and later, it returns + // zero. // // Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_peer_finished(const SSL *ssl, void *buf, @@ -4103,158 +4512,78 @@ OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); -#if !defined(BORINGSSL_NO_CXX) -// SSL_CTX_sess_set_get_cb is a legacy C++ overload of |SSL_CTX_sess_set_get_cb| -// which supports the old callback signature. -// -// TODO(davidben): Remove this once Node is compatible with OpenSSL 1.1.0. -extern "C++" OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( - SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)); -#endif - +// The following constants are legacy aliases for RSA-PSS with rsaEncryption +// keys. Use the new names instead. +#define SSL_SIGN_RSA_PSS_SHA256 SSL_SIGN_RSA_PSS_RSAE_SHA256 +#define SSL_SIGN_RSA_PSS_SHA384 SSL_SIGN_RSA_PSS_RSAE_SHA384 +#define SSL_SIGN_RSA_PSS_SHA512 SSL_SIGN_RSA_PSS_RSAE_SHA512 -// Private structures. +// SSL_set_tlsext_status_type configures a client to request OCSP stapling if +// |type| is |TLSEXT_STATUSTYPE_ocsp| and disables it otherwise. It returns one +// on success and zero if handshake configuration has already been shed. // -// This structures are exposed for historical reasons, but access to them is -// deprecated. +// Use |SSL_enable_ocsp_stapling| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); -// TODO(davidben): Remove this forward declaration when |SSL_SESSION| is opaque. -typedef struct ssl_x509_method_st SSL_X509_METHOD; +// SSL_get_tlsext_status_type returns |TLSEXT_STATUSTYPE_ocsp| if the client +// requested OCSP stapling and |TLSEXT_STATUSTYPE_nothing| otherwise. On the +// client, this reflects whether OCSP stapling was enabled via, e.g., +// |SSL_set_tlsext_status_type|. On the server, this is determined during the +// handshake. It may be queried in callbacks set by |SSL_CTX_set_cert_cb|. The +// result is undefined after the handshake completes. +OPENSSL_EXPORT int SSL_get_tlsext_status_type(const SSL *ssl); -#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 -#define SSL_MAX_SID_CTX_LENGTH 32 -#define SSL_MAX_MASTER_KEY_LENGTH 48 - -struct ssl_session_st { - CRYPTO_refcount_t references; - uint16_t ssl_version; // what ssl version session info is being kept in here? - - // group_id is the ID of the ECDH group used to establish this session or zero - // if not applicable or unknown. - uint16_t group_id; - - // peer_signature_algorithm is the signature algorithm used to authenticate - // the peer, or zero if not applicable or unknown. - uint16_t peer_signature_algorithm; - - // master_key, in TLS 1.2 and below, is the master secret associated with the - // session. In TLS 1.3 and up, it is the resumption secret. - int master_key_length; - uint8_t master_key[SSL_MAX_MASTER_KEY_LENGTH]; - - // session_id - valid? - unsigned int session_id_length; - uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; - // this is used to determine whether the session is being reused in - // the appropriate context. It is up to the application to set this, - // via SSL_new - uint8_t sid_ctx_length; - uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - - char *psk_identity; - - // certs contains the certificate chain from the peer, starting with the leaf - // certificate. - STACK_OF(CRYPTO_BUFFER) *certs; - - const SSL_X509_METHOD *x509_method; - - // x509_peer is the peer's certificate. - X509 *x509_peer; - - // x509_chain is the certificate chain sent by the peer. NOTE: for historical - // reasons, when a client (so the peer is a server), the chain includes - // |peer|, but when a server it does not. - STACK_OF(X509) *x509_chain; - - // x509_chain_without_leaf is a lazily constructed copy of |x509_chain| that - // omits the leaf certificate. This exists because OpenSSL, historically, - // didn't include the leaf certificate in the chain for a server, but did for - // a client. The |x509_chain| always includes it and, if an API call requires - // a chain without, it is stored here. - STACK_OF(X509) *x509_chain_without_leaf; - - // verify_result is the result of certificate verification in the case of - // non-fatal certificate errors. - long verify_result; - - // timeout is the lifetime of the session in seconds, measured from |time|. - // This is renewable up to |auth_timeout|. - uint32_t timeout; - - // auth_timeout is the non-renewable lifetime of the session in seconds, - // measured from |time|. - uint32_t auth_timeout; - - // time is the time the session was issued, measured in seconds from the UNIX - // epoch. - uint64_t time; - - const SSL_CIPHER *cipher; - - CRYPTO_EX_DATA ex_data; // application specific data - - // These are used to make removal of session-ids more efficient and to - // implement a maximum cache size. - SSL_SESSION *prev, *next; - - // RFC4507 info - uint8_t *tlsext_tick; // Session ticket - size_t tlsext_ticklen; // Session ticket length - - CRYPTO_BUFFER *signed_cert_timestamp_list; - - // The OCSP response that came with the session. - CRYPTO_BUFFER *ocsp_response; - - // peer_sha256 contains the SHA-256 hash of the peer's certificate if - // |peer_sha256_valid| is true. - uint8_t peer_sha256[SHA256_DIGEST_LENGTH]; - - // original_handshake_hash contains the handshake hash (either SHA-1+MD5 or - // SHA-2, depending on TLS version) for the original, full handshake that - // created a session. This is used by Channel IDs during resumption. - uint8_t original_handshake_hash[EVP_MAX_MD_SIZE]; - uint8_t original_handshake_hash_len; - - uint32_t tlsext_tick_lifetime_hint; // Session lifetime hint in seconds - - uint32_t ticket_age_add; - - // ticket_max_early_data is the maximum amount of data allowed to be sent as - // early data. If zero, 0-RTT is disallowed. - uint32_t ticket_max_early_data; - - // early_alpn is the ALPN protocol from the initial handshake. This is only - // stored for TLS 1.3 and above in order to enforce ALPN matching for 0-RTT - // resumptions. - uint8_t *early_alpn; - size_t early_alpn_len; - - // extended_master_secret is true if the master secret in this session was - // generated using EMS and thus isn't vulnerable to the Triple Handshake - // attack. - unsigned extended_master_secret:1; - - // peer_sha256_valid is non-zero if |peer_sha256| is valid. - unsigned peer_sha256_valid:1; // Non-zero if peer_sha256 is valid - - // not_resumable is used to indicate that session resumption is disallowed. - unsigned not_resumable:1; - - // ticket_age_add_valid is non-zero if |ticket_age_add| is valid. - unsigned ticket_age_add_valid:1; +// SSL_set_tlsext_status_ocsp_resp sets the OCSP response. It returns one on +// success and zero on error. On success, |ssl| takes ownership of |resp|, which +// must have been allocated by |OPENSSL_malloc|. +// +// Use |SSL_set_ocsp_response| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_ocsp_resp(SSL *ssl, uint8_t *resp, + size_t resp_len); - // is_server is true if this session was created by a server. - unsigned is_server:1; -}; +// SSL_get_tlsext_status_ocsp_resp sets |*out| to point to the OCSP response +// from the server. It returns the length of the response. If there was no +// response, it sets |*out| to NULL and returns zero. +// +// Use |SSL_get0_ocsp_response| instead. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT size_t SSL_get_tlsext_status_ocsp_resp(const SSL *ssl, + const uint8_t **out); + +// SSL_CTX_set_tlsext_status_cb configures the legacy OpenSSL OCSP callback and +// returns one. Though the type signature is the same, this callback has +// different behavior for client and server connections: +// +// For clients, the callback is called after certificate verification. It should +// return one for success, zero for a bad OCSP response, and a negative number +// for internal error. Instead, handle this as part of certificate verification. +// (Historically, OpenSSL verified certificates just before parsing stapled OCSP +// responses, but BoringSSL fixes this ordering. All server credentials are +// available during verification.) +// +// Do not use this callback as a server. It is provided for compatibility +// purposes only. For servers, it is called to configure server credentials. It +// should return |SSL_TLSEXT_ERR_OK| on success, |SSL_TLSEXT_ERR_NOACK| to +// ignore OCSP requests, or |SSL_TLSEXT_ERR_ALERT_FATAL| on error. It is usually +// used to fetch OCSP responses on demand, which is not ideal. Instead, treat +// OCSP responses like other server credentials, such as certificates or SCT +// lists. Configure, store, and refresh them eagerly. This avoids downtime if +// the CA's OCSP responder is briefly offline. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, + int (*callback)(SSL *ssl, + void *arg)); + +// SSL_CTX_set_tlsext_status_arg sets additional data for +// |SSL_CTX_set_tlsext_status_cb|'s callback and returns one. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); // Nodejs compatibility section (hidden). // // These defines exist for node.js, with the hope that we can eliminate the // need for them over time. + #define SSLerr(function, reason) \ ERR_put_error(ERR_LIB_SSL, 0, reason, __FILE__, __LINE__) @@ -4290,6 +4619,7 @@ struct ssl_session_st { #define SSL_CTRL_GET_NUM_RENEGOTIATIONS doesnt_exist #define SSL_CTRL_GET_READ_AHEAD doesnt_exist #define SSL_CTRL_GET_RI_SUPPORT doesnt_exist +#define SSL_CTRL_GET_SERVER_TMP_KEY doesnt_exist #define SSL_CTRL_GET_SESSION_REUSED doesnt_exist #define SSL_CTRL_GET_SESS_CACHE_MODE doesnt_exist #define SSL_CTRL_GET_SESS_CACHE_SIZE doesnt_exist @@ -4322,6 +4652,12 @@ struct ssl_session_st { #define SSL_CTRL_SET_TMP_RSA doesnt_exist #define SSL_CTRL_SET_TMP_RSA_CB doesnt_exist +// |BORINGSSL_PREFIX| already makes each of these symbols into macros, so there +// is no need to define conflicting macros. +#if !defined(BORINGSSL_PREFIX) + + +#endif // !defined(BORINGSSL_PREFIX) #if defined(__cplusplus) @@ -4331,11 +4667,13 @@ struct ssl_session_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(SSL, SSL_free) BORINGSSL_MAKE_DELETER(SSL_CTX, SSL_CTX_free) +BORINGSSL_MAKE_UP_REF(SSL_CTX, SSL_CTX_up_ref) BORINGSSL_MAKE_DELETER(SSL_SESSION, SSL_SESSION_free) +BORINGSSL_MAKE_UP_REF(SSL_SESSION, SSL_SESSION_up_ref) enum class OpenRecordResult { kOK, @@ -4410,10 +4748,10 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // state of the connection. // // Elsewhere, a fresh |SSL| can be used with |SSL_apply_handoff| to continue -// the connection. The connection from the client is fed into this |SSL| until -// the handshake completes normally. At this point (and only at this point), -// |SSL_serialize_handback| can be called to serialize the result of the -// handshake. +// the connection. The connection from the client is fed into this |SSL|, and +// the handshake resumed. When the handshake stops again and |SSL_get_error| +// indicates |SSL_ERROR_HANDBACK|, |SSL_serialize_handback| should be called to +// serialize the state of the handshake again. // // Back at the first location, a fresh |SSL| can be used with // |SSL_apply_handback|. Then the client's connection can be processed mostly @@ -4421,7 +4759,7 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // // Lastly, when a connection is in the handoff state, whether or not // |SSL_serialize_handoff| is called, |SSL_decline_handoff| will move it back -// into a normal state where the connection can procede without impact. +// into a normal state where the connection can proceed without impact. // // WARNING: Currently only works with TLS 1.0–1.2. // WARNING: The serialisation formats are not yet stable: version skew may be @@ -4434,13 +4772,23 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // WARNING: |SSL_apply_handoff| may trigger “msg” callback calls. OPENSSL_EXPORT void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on); -OPENSSL_EXPORT bool SSL_serialize_handoff(const SSL *ssl, CBB *out); +OPENSSL_EXPORT void SSL_set_handoff_mode(SSL *SSL, bool on); +OPENSSL_EXPORT bool SSL_serialize_handoff(const SSL *ssl, CBB *out, + SSL_CLIENT_HELLO *out_hello); OPENSSL_EXPORT bool SSL_decline_handoff(SSL *ssl); OPENSSL_EXPORT bool SSL_apply_handoff(SSL *ssl, Span handoff); OPENSSL_EXPORT bool SSL_serialize_handback(const SSL *ssl, CBB *out); OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); -} // namespace bssl +// SSL_get_traffic_secrets sets |*out_read_traffic_secret| and +// |*out_write_traffic_secret| to reference the TLS 1.3 traffic secrets for +// |ssl|. This function is only valid on TLS 1.3 connections that have +// completed the handshake. It returns true on success and false on error. +OPENSSL_EXPORT bool SSL_get_traffic_secrets( + const SSL *ssl, Span *out_read_traffic_secret, + Span *out_write_traffic_secret); + +BSSL_NAMESPACE_END } // extern C++ @@ -4635,6 +4983,22 @@ OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); #define SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI 285 #define SSL_R_SERVER_ECHOED_INVALID_SESSION_ID 286 #define SSL_R_PRIVATE_KEY_OPERATION_FAILED 287 +#define SSL_R_SECOND_SERVERHELLO_VERSION_MISMATCH 288 +#define SSL_R_OCSP_CB_ERROR 289 +#define SSL_R_SSL_SESSION_ID_TOO_LONG 290 +#define SSL_R_APPLICATION_DATA_ON_SHUTDOWN 291 +#define SSL_R_CERT_DECOMPRESSION_FAILED 292 +#define SSL_R_UNCOMPRESSED_CERT_TOO_LARGE 293 +#define SSL_R_UNKNOWN_CERT_COMPRESSION_ALG 294 +#define SSL_R_INVALID_SIGNATURE_ALGORITHM 295 +#define SSL_R_DUPLICATE_SIGNATURE_ALGORITHM 296 +#define SSL_R_TLS13_DOWNGRADE 297 +#define SSL_R_QUIC_INTERNAL_ERROR 298 +#define SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED 299 +#define SSL_R_TOO_MUCH_READ_EARLY_DATA 300 +#define SSL_R_INVALID_DELEGATED_CREDENTIAL 301 +#define SSL_R_KEY_USAGE_BIT_INCORRECT 302 +#define SSL_R_INCONSISTENT_CLIENT_HELLO 303 #define SSL_R_SSLV3_ALERT_CLOSE_NOTIFY 1000 #define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 #define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 @@ -4667,6 +5031,5 @@ OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); #define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 #define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115 #define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116 -#define SSL_R_TOO_MUCH_READ_EARLY_DATA 1117 #endif // OPENSSL_HEADER_SSL_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ssl.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.back similarity index 83% rename from Pods/BoringSSL-GRPC/include/openssl/ssl.h.back rename to Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.back index 902d41d3a..042ccb5be 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ssl.h.back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.back @@ -185,7 +185,7 @@ extern "C" { // multiple threads. Once shared, functions which change the |SSL_CTX|'s // configuration may not be used. -// TLS_method is the |SSL_METHOD| used for TLS (and SSLv3) connections. +// TLS_method is the |SSL_METHOD| used for TLS connections. OPENSSL_EXPORT const SSL_METHOD *TLS_method(void); // DTLS_method is the |SSL_METHOD| used for DTLS connections. @@ -394,20 +394,43 @@ OPENSSL_EXPORT int SSL_pending(const SSL *ssl); // https://crbug.com/466303. OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num); -// SSL_shutdown shuts down |ssl|. On success, it completes in two stages. First, -// it returns 0 if |ssl| completed uni-directional shutdown; close_notify has -// been sent, but the peer's close_notify has not been received. Most callers -// may stop at this point. For bi-directional shutdown, call |SSL_shutdown| -// again. It returns 1 if close_notify has been both sent and received. -// -// If the peer's close_notify arrived first, the first stage is skipped. -// |SSL_shutdown| will return 1 once close_notify is sent and skip 0. Callers -// only interested in uni-directional shutdown must therefore allow for the -// first stage returning either 0 or 1. +// SSL_KEY_UPDATE_REQUESTED indicates that the peer should reply to a KeyUpdate +// message with its own, thus updating traffic secrets for both directions on +// the connection. +#define SSL_KEY_UPDATE_REQUESTED 1 + +// SSL_KEY_UPDATE_NOT_REQUESTED indicates that the peer should not reply with +// it's own KeyUpdate message. +#define SSL_KEY_UPDATE_NOT_REQUESTED 0 + +// SSL_key_update queues a TLS 1.3 KeyUpdate message to be sent on |ssl| +// if one is not already queued. The |request_type| argument must one of the +// |SSL_KEY_UPDATE_*| values. This function requires that |ssl| have completed a +// TLS >= 1.3 handshake. It returns one on success or zero on error. +// +// Note that this function does not _send_ the message itself. The next call to +// |SSL_write| will cause the message to be sent. |SSL_write| may be called with +// a zero length to flush a KeyUpdate message when no application data is +// pending. +OPENSSL_EXPORT int SSL_key_update(SSL *ssl, int request_type); + +// SSL_shutdown shuts down |ssl|. It runs in two stages. First, it sends +// close_notify and returns zero or one on success or -1 on failure. Zero +// indicates that close_notify was sent, but not received, and one additionally +// indicates that the peer's close_notify had already been received. +// +// To then wait for the peer's close_notify, run |SSL_shutdown| to completion a +// second time. This returns 1 on success and -1 on failure. Application data +// is considered a fatal error at this point. To process or discard it, read +// until close_notify with |SSL_read| instead. +// +// In both cases, on failure, pass the return value into |SSL_get_error| to +// determine how to proceed. // -// |SSL_shutdown| returns -1 on failure. The caller should pass the return value -// into |SSL_get_error| to determine how to proceed. If the underlying |BIO| is -// non-blocking, both stages may require retry. +// Most callers should stop at the first stage. Reading for close_notify is +// primarily used for uncommon protocols where the underlying transport is +// reused after TLS completes. Additionally, DTLS uses an unordered transport +// and is unordered, so the second stage is a no-op in DTLS. OPENSSL_EXPORT int SSL_shutdown(SSL *ssl); // SSL_CTX_set_quiet_shutdown sets quiet shutdown on |ctx| to |mode|. If @@ -535,6 +558,19 @@ OPENSSL_EXPORT int SSL_get_error(const SSL *ssl, int ret_code); #define SSL_ERROR_WANT_CERTIFICATE_VERIFY 16 #define SSL_ERROR_HANDOFF 17 +#define SSL_ERROR_HANDBACK 18 + +// SSL_ERROR_WANT_RENEGOTIATE indicates the operation is pending a response to +// a renegotiation request from the server. The caller may call +// |SSL_renegotiate| to schedule a renegotiation and retry the operation. +// +// See also |ssl_renegotiate_explicit|. +#define SSL_ERROR_WANT_RENEGOTIATE 19 + +// SSL_error_description returns a string representation of |err|, where |err| +// is one of the |SSL_ERROR_*| constants returned by |SSL_get_error|, or NULL +// if the value is unrecognized. +OPENSSL_EXPORT const char *SSL_error_description(int err); // SSL_set_mtu sets the |ssl|'s MTU in DTLS to |mtu|. It returns one on success // and zero on failure. @@ -595,8 +631,6 @@ OPENSSL_EXPORT int DTLSv1_handle_timeout(SSL *ssl); #define DTLS1_VERSION 0xfeff #define DTLS1_2_VERSION 0xfefd -#define TLS1_3_DRAFT23_VERSION 0x7f17 - // SSL_CTX_set_min_proto_version sets the minimum protocol version for |ctx| to // |version|. If |version| is zero, the default minimum version is used. It // returns one on success and zero if |version| is invalid. @@ -609,6 +643,12 @@ OPENSSL_EXPORT int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, OPENSSL_EXPORT int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version); +// SSL_CTX_get_min_proto_version returns the minimum protocol version for |ctx| +OPENSSL_EXPORT uint16_t SSL_CTX_get_min_proto_version(const SSL_CTX *ctx); + +// SSL_CTX_get_max_proto_version returns the maximum protocol version for |ctx| +OPENSSL_EXPORT uint16_t SSL_CTX_get_max_proto_version(const SSL_CTX *ctx); + // SSL_set_min_proto_version sets the minimum protocol version for |ssl| to // |version|. If |version| is zero, the default minimum version is used. It // returns one on success and zero if |version| is invalid. @@ -619,6 +659,14 @@ OPENSSL_EXPORT int SSL_set_min_proto_version(SSL *ssl, uint16_t version); // returns one on success and zero if |version| is invalid. OPENSSL_EXPORT int SSL_set_max_proto_version(SSL *ssl, uint16_t version); +// SSL_get_min_proto_version returns the minimum protocol version for |ssl|. If +// the connection's configuration has been shed, 0 is returned. +OPENSSL_EXPORT uint16_t SSL_get_min_proto_version(const SSL *ssl); + +// SSL_get_max_proto_version returns the maximum protocol version for |ssl|. If +// the connection's configuration has been shed, 0 is returned. +OPENSSL_EXPORT uint16_t SSL_get_max_proto_version(const SSL *ssl); + // SSL_version returns the TLS or DTLS protocol version used by |ssl|, which is // one of the |*_VERSION| values. (E.g. |TLS1_2_VERSION|.) Before the version // is negotiated, the result is undefined. @@ -644,7 +692,6 @@ OPENSSL_EXPORT int SSL_version(const SSL *ssl); // The following flags toggle individual protocol versions. This is deprecated. // Use |SSL_CTX_set_min_proto_version| and |SSL_CTX_set_max_proto_version| // instead. -#define SSL_OP_NO_SSLv3 0x02000000L #define SSL_OP_NO_TLSv1 0x04000000L #define SSL_OP_NO_TLSv1_2 0x08000000L #define SSL_OP_NO_TLSv1_1 0x10000000L @@ -715,10 +762,10 @@ OPENSSL_EXPORT uint32_t SSL_get_options(const SSL *ssl); // and |SSL_CB_HANDSHAKE_DONE| from |SSL_CTX_set_info_callback|. #define SSL_MODE_ENABLE_FALSE_START 0x00000080L -// SSL_MODE_CBC_RECORD_SPLITTING causes multi-byte CBC records in SSL 3.0 and -// TLS 1.0 to be split in two: the first record will contain a single byte and -// the second will contain the remainder. This effectively randomises the IV and -// prevents BEAST attacks. +// SSL_MODE_CBC_RECORD_SPLITTING causes multi-byte CBC records in TLS 1.0 to be +// split in two: the first record will contain a single byte and the second will +// contain the remainder. This effectively randomises the IV and prevents BEAST +// attacks. #define SSL_MODE_CBC_RECORD_SPLITTING 0x00000100L // SSL_MODE_NO_SESSION_CREATION will cause any attempts to create a session to @@ -860,8 +907,9 @@ OPENSSL_EXPORT int SSL_clear_chain_certs(SSL *ssl); // |SSL_get_client_CA_list| for information on the server's certificate // request. // -// On the server, the callback will be called on non-resumption handshakes, -// after extensions have been processed. +// On the server, the callback will be called after extensions have been +// processed, but before the resumption decision has been made. This differs +// from OpenSSL which handles resumption before selecting the certificate. OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), void *arg); @@ -874,19 +922,37 @@ OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx, // On the client, the callback may call |SSL_get0_certificate_types| and // |SSL_get_client_CA_list| for information on the server's certificate // request. +// +// On the server, the callback will be called after extensions have been +// processed, but before the resumption decision has been made. This differs +// from OpenSSL which handles resumption before selecting the certificate. OPENSSL_EXPORT void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg); // SSL_get0_certificate_types, for a client, sets |*out_types| to an array // containing the client certificate types requested by a server. It returns the -// length of the array. +// length of the array. Note this list is always empty in TLS 1.3. The server +// will instead send signature algorithms. See +// |SSL_get0_peer_verify_algorithms|. // // The behavior of this function is undefined except during the callbacks set by // by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the // handshake is paused because of them. -OPENSSL_EXPORT size_t SSL_get0_certificate_types(SSL *ssl, +OPENSSL_EXPORT size_t SSL_get0_certificate_types(const SSL *ssl, const uint8_t **out_types); +// SSL_get0_peer_verify_algorithms sets |*out_sigalgs| to an array containing +// the signature algorithms the peer is able to verify. It returns the length of +// the array. Note these values are only sent starting TLS 1.2 and only +// mandatory starting TLS 1.3. If not sent, the empty array is returned. For the +// historical client certificate types list, see |SSL_get0_certificate_types|. +// +// The behavior of this function is undefined except during the callbacks set by +// by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the +// handshake is paused because of them. +OPENSSL_EXPORT size_t +SSL_get0_peer_verify_algorithms(const SSL *ssl, const uint16_t **out_sigalgs); + // SSL_certs_clear resets the private key, leaf certificate, and certificate // chain of |ssl|. OPENSSL_EXPORT void SSL_certs_clear(SSL *ssl); @@ -968,9 +1034,9 @@ OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, #define SSL_SIGN_ECDSA_SECP256R1_SHA256 0x0403 #define SSL_SIGN_ECDSA_SECP384R1_SHA384 0x0503 #define SSL_SIGN_ECDSA_SECP521R1_SHA512 0x0603 -#define SSL_SIGN_RSA_PSS_SHA256 0x0804 -#define SSL_SIGN_RSA_PSS_SHA384 0x0805 -#define SSL_SIGN_RSA_PSS_SHA512 0x0806 +#define SSL_SIGN_RSA_PSS_RSAE_SHA256 0x0804 +#define SSL_SIGN_RSA_PSS_RSAE_SHA384 0x0805 +#define SSL_SIGN_RSA_PSS_RSAE_SHA512 0x0806 #define SSL_SIGN_ED25519 0x0807 // SSL_SIGN_RSA_PKCS1_MD5_SHA1 is an internal signature algorithm used to @@ -1114,7 +1180,7 @@ OPENSSL_EXPORT void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx); // Custom private keys. -enum ssl_private_key_result_t { +enum ssl_private_key_result_t BORINGSSL_ENUM_INT { ssl_private_key_success, ssl_private_key_retry, ssl_private_key_failure, @@ -1196,10 +1262,14 @@ DEFINE_CONST_STACK_OF(SSL_CIPHER) // https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4. OPENSSL_EXPORT const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value); -// SSL_CIPHER_get_id returns |cipher|'s id. It may be cast to a |uint16_t| to -// get the cipher suite value. +// SSL_CIPHER_get_id returns |cipher|'s non-IANA id. This is not its +// IANA-assigned number, which is called the "value" here, although it may be +// cast to a |uint16_t| to get it. OPENSSL_EXPORT uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *cipher); +// SSL_CIPHER_get_value returns |cipher|'s IANA-assigned number. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *cipher); + // SSL_CIPHER_is_aead returns one if |cipher| uses an AEAD cipher. OPENSSL_EXPORT int SSL_CIPHER_is_aead(const SSL_CIPHER *cipher); @@ -1250,7 +1320,8 @@ OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher); OPENSSL_EXPORT const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher); // SSL_CIPHER_get_name returns the OpenSSL name of |cipher|. For example, -// "ECDHE-RSA-AES128-GCM-SHA256". +// "ECDHE-RSA-AES128-GCM-SHA256". Callers are recommended to use +// |SSL_CIPHER_standard_name| instead. OPENSSL_EXPORT const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher); // SSL_CIPHER_get_kx_name returns a string that describes the key-exchange @@ -1317,11 +1388,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, // whose bulk cipher use the corresponding encryption scheme. Note that // |AES|, |AES128|, and |AES256| match both CBC and GCM ciphers. // -// |SHA1|, |SHA256|, and |SHA384| match legacy cipher suites using the -// corresponding hash function in their MAC. AEADs are matched by none of -// these. -// -// |SHA| is an alias for |SHA1|. +// |SHA1|, and its alias |SHA|, match legacy cipher suites using HMAC-SHA1. // // Although implemented, authentication-only ciphers match no rules and must be // explicitly selected by name. @@ -1357,7 +1424,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, // based on client preferences. An equal-preference is specified with square // brackets, combining multiple selectors separated by |. For example: // -// [ECDHE-ECDSA-CHACHA20-POLY1305|ECDHE-ECDSA-AES128-GCM-SHA256] +// [TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256|TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256] // // Once an equal-preference group is used, future directives must be // opcode-less. Inside an equal-preference group, spaces are not allowed. @@ -1460,7 +1527,7 @@ OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl); // verification. The caller does not take ownership of the result. // // This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. -OPENSSL_EXPORT STACK_OF(CRYPTO_BUFFER) * +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * SSL_get0_peer_certificates(const SSL *ssl); // SSL_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to point to @@ -1507,8 +1574,8 @@ OPENSSL_EXPORT int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, // TLS 1.3 was negotiated. Otherwise, it returns zero. OPENSSL_EXPORT int SSL_get_extms_support(const SSL *ssl); -// SSL_get_current_cipher returns the cipher used in the current outgoing -// connection state, or NULL if the null cipher is active. +// SSL_get_current_cipher returns cipher suite used by |ssl|, or NULL if it has +// not been negotiated yet. OPENSSL_EXPORT const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl); // SSL_session_reused returns one if |ssl| performed an abbreviated handshake @@ -1533,92 +1600,6 @@ OPENSSL_EXPORT int SSL_export_keying_material( const uint8_t *context, size_t context_len, int use_context); -// Custom extensions. -// -// The custom extension functions allow TLS extensions to be added to -// ClientHello and ServerHello messages. - -// SSL_custom_ext_add_cb is a callback function that is called when the -// ClientHello (for clients) or ServerHello (for servers) is constructed. In -// the case of a server, this callback will only be called for a given -// extension if the ClientHello contained that extension – it's not possible to -// inject extensions into a ServerHello that the client didn't request. -// -// When called, |extension_value| will contain the extension number that is -// being considered for addition (so that a single callback can handle multiple -// extensions). If the callback wishes to include the extension, it must set -// |*out| to point to |*out_len| bytes of extension contents and return one. In -// this case, the corresponding |SSL_custom_ext_free_cb| callback will later be -// called with the value of |*out| once that data has been copied. -// -// If the callback does not wish to add an extension it must return zero. -// -// Alternatively, the callback can abort the connection by setting -// |*out_alert_value| to a TLS alert number and returning -1. -typedef int (*SSL_custom_ext_add_cb)(SSL *ssl, unsigned extension_value, - const uint8_t **out, size_t *out_len, - int *out_alert_value, void *add_arg); - -// SSL_custom_ext_free_cb is a callback function that is called by OpenSSL iff -// an |SSL_custom_ext_add_cb| callback previously returned one. In that case, -// this callback is called and passed the |out| pointer that was returned by -// the add callback. This is to free any dynamically allocated data created by -// the add callback. -typedef void (*SSL_custom_ext_free_cb)(SSL *ssl, unsigned extension_value, - const uint8_t *out, void *add_arg); - -// SSL_custom_ext_parse_cb is a callback function that is called by OpenSSL to -// parse an extension from the peer: that is from the ServerHello for a client -// and from the ClientHello for a server. -// -// When called, |extension_value| will contain the extension number and the -// contents of the extension are |contents_len| bytes at |contents|. -// -// The callback must return one to continue the handshake. Otherwise, if it -// returns zero, a fatal alert with value |*out_alert_value| is sent and the -// handshake is aborted. -typedef int (*SSL_custom_ext_parse_cb)(SSL *ssl, unsigned extension_value, - const uint8_t *contents, - size_t contents_len, - int *out_alert_value, void *parse_arg); - -// SSL_extension_supported returns one iff OpenSSL internally handles -// extensions of type |extension_value|. This can be used to avoid registering -// custom extension handlers for extensions that a future version of OpenSSL -// may handle internally. -OPENSSL_EXPORT int SSL_extension_supported(unsigned extension_value); - -// SSL_CTX_add_client_custom_ext registers callback functions for handling -// custom TLS extensions for client connections. -// -// If |add_cb| is NULL then an empty extension will be added in each -// ClientHello. Otherwise, see the comment for |SSL_custom_ext_add_cb| about -// this callback. -// -// The |free_cb| may be NULL if |add_cb| doesn't dynamically allocate data that -// needs to be freed. -// -// It returns one on success or zero on error. It's always an error to register -// callbacks for the same extension twice, or to register callbacks for an -// extension that OpenSSL handles internally. See |SSL_extension_supported| to -// discover, at runtime, which extensions OpenSSL handles internally. -OPENSSL_EXPORT int SSL_CTX_add_client_custom_ext( - SSL_CTX *ctx, unsigned extension_value, SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, void *parse_arg); - -// SSL_CTX_add_server_custom_ext is the same as -// |SSL_CTX_add_client_custom_ext|, but for server connections. -// -// Unlike on the client side, if |add_cb| is NULL no extension will be added. -// The |add_cb|, if any, will only be called if the ClientHello contained a -// matching extension. -OPENSSL_EXPORT int SSL_CTX_add_server_custom_ext( - SSL_CTX *ctx, unsigned extension_value, SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, void *parse_arg); - - // Sessions. // // An |SSL_SESSION| represents an SSL session that may be resumed in an @@ -1660,7 +1641,7 @@ OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_from_bytes( const uint8_t *in, size_t in_len, const SSL_CTX *ctx); // SSL_SESSION_get_version returns a string describing the TLS or DTLS version -// |session| was established at. For example, "TLSv1.2" or "SSLv3". +// |session| was established at. For example, "TLSv1.2" or "DTLSv1". OPENSSL_EXPORT const char *SSL_SESSION_get_version(const SSL_SESSION *session); // SSL_SESSION_get_protocol_version returns the TLS or DTLS version |session| @@ -1674,11 +1655,20 @@ SSL_SESSION_get_protocol_version(const SSL_SESSION *session); OPENSSL_EXPORT int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version); +// SSL_MAX_SSL_SESSION_ID_LENGTH is the maximum length of an SSL session ID. +#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 + // SSL_SESSION_get_id returns a pointer to a buffer containing |session|'s // session ID and sets |*out_len| to its length. OPENSSL_EXPORT const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, unsigned *out_len); +// SSL_SESSION_set1_id sets |session|'s session ID to |sid|, It returns one on +// success and zero on error. This function may be useful in writing tests but +// otherwise should not be used. +OPENSSL_EXPORT int SSL_SESSION_set1_id(SSL_SESSION *session, const uint8_t *sid, + size_t sid_len); + // SSL_SESSION_get_time returns the time at which |session| was established in // seconds since the UNIX epoch. OPENSSL_EXPORT uint64_t SSL_SESSION_get_time(const SSL_SESSION *session); @@ -1692,6 +1682,36 @@ OPENSSL_EXPORT uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session); // TODO(davidben): This should return a const X509 *. OPENSSL_EXPORT X509 *SSL_SESSION_get0_peer(const SSL_SESSION *session); +// SSL_SESSION_get0_peer_certificates returns the peer certificate chain stored +// in |session|, or NULL if the peer did not use certificates. This is the +// unverified list of certificates as sent by the peer, not the final chain +// built during verification. The caller does not take ownership of the result. +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * + SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session); + +// SSL_SESSION_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to +// point to |*out_len| bytes of SCT information stored in |session|. This is +// only valid for client sessions. The SCT information is a +// SignedCertificateTimestampList (including the two leading length bytes). See +// https://tools.ietf.org/html/rfc6962#section-3.3 If no SCT was received then +// |*out_len| will be zero on return. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT void SSL_SESSION_get0_signed_cert_timestamp_list( + const SSL_SESSION *session, const uint8_t **out, size_t *out_len); + +// SSL_SESSION_get0_ocsp_response sets |*out| and |*out_len| to point to +// |*out_len| bytes of an OCSP response from the server. This is the DER +// encoding of an OCSPResponse type as defined in RFC 2560. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT void SSL_SESSION_get0_ocsp_response(const SSL_SESSION *session, + const uint8_t **out, + size_t *out_len); + +// SSL_MAX_MASTER_KEY_LENGTH is the maximum length of a master secret. +#define SSL_MAX_MASTER_KEY_LENGTH 48 + // SSL_SESSION_get_master_key writes up to |max_out| bytes of |session|'s master // secret to |out| and returns the number of bytes written. If |max_out| is // zero, it returns the size of the master secret. @@ -1710,6 +1730,12 @@ OPENSSL_EXPORT uint64_t SSL_SESSION_set_time(SSL_SESSION *session, OPENSSL_EXPORT uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout); +// SSL_SESSION_get0_id_context returns a pointer to a buffer containing +// |session|'s session ID context (see |SSL_CTX_set_session_id_context|) and +// sets |*out_len| to its length. +OPENSSL_EXPORT const uint8_t *SSL_SESSION_get0_id_context( + const SSL_SESSION *session, unsigned *out_len); + // SSL_SESSION_set1_id_context sets |session|'s session ID context (see // |SSL_CTX_set_session_id_context|) to |sid_ctx|. It returns one on success and // zero on error. This function may be useful in writing tests but otherwise @@ -1723,8 +1749,8 @@ OPENSSL_EXPORT int SSL_SESSION_set1_id_context(SSL_SESSION *session, // // If this function returns one, clients retain multiple sessions and use each // only once. This prevents passive observers from correlating connections with -// tickets. See draft-ietf-tls-tls13-18, appendix B.5. If it returns zero, -// |session| cannot be used without leaking a correlator. +// tickets. See RFC 8446, appendix C.4. If it returns zero, |session| cannot be +// used without leaking a correlator. OPENSSL_EXPORT int SSL_SESSION_should_be_single_use(const SSL_SESSION *session); // SSL_SESSION_is_resumable returns one if |session| is resumable and zero @@ -1742,11 +1768,40 @@ OPENSSL_EXPORT void SSL_SESSION_get0_ticket(const SSL_SESSION *session, const uint8_t **out_ticket, size_t *out_len); +// SSL_SESSION_set_ticket sets |session|'s ticket to |ticket|. It returns one on +// success and zero on error. This function may be useful in writing tests but +// otherwise should not be used. +OPENSSL_EXPORT int SSL_SESSION_set_ticket(SSL_SESSION *session, + const uint8_t *ticket, + size_t ticket_len); + // SSL_SESSION_get_ticket_lifetime_hint returns ticket lifetime hint of // |session| in seconds or zero if none was set. OPENSSL_EXPORT uint32_t SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session); +// SSL_SESSION_get0_cipher returns the cipher negotiated by the connection which +// established |session|. +// +// Note that, in TLS 1.3, there is no guarantee that resumptions with |session| +// will use that cipher. Prefer calling |SSL_get_current_cipher| on the |SSL| +// instead. +OPENSSL_EXPORT const SSL_CIPHER *SSL_SESSION_get0_cipher( + const SSL_SESSION *session); + +// SSL_SESSION_has_peer_sha256 returns one if |session| has a SHA-256 hash of +// the peer's certificate retained and zero if the peer did not present a +// certificate or if this was not enabled when |session| was created. See also +// |SSL_CTX_set_retain_only_sha256_of_client_certs|. +OPENSSL_EXPORT int SSL_SESSION_has_peer_sha256(const SSL_SESSION *session); + +// SSL_SESSION_get0_peer_sha256 sets |*out_ptr| and |*out_len| to the SHA-256 +// hash of the peer certificate retained in |session|, or NULL and zero if it +// does not have one. See also |SSL_CTX_set_retain_only_sha256_of_client_certs|. +OPENSSL_EXPORT void SSL_SESSION_get0_peer_sha256(const SSL_SESSION *session, + const uint8_t **out_ptr, + size_t *out_len); + // Session caching. // @@ -1830,7 +1885,11 @@ OPENSSL_EXPORT int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx); // SSL_set_session, for a client, configures |ssl| to offer to resume |session| // in the initial handshake and returns one. The caller retains ownership of -// |session|. +// |session|. Note that configuring a session assumes the authentication in the +// session is valid. For callers that wish to revalidate the session before +// offering, see |SSL_SESSION_get0_peer_certificates|, +// |SSL_SESSION_get0_signed_cert_timestamp_list|, and +// |SSL_SESSION_get0_ocsp_response|. // // It is an error to call this function after the handshake has begun. OPENSSL_EXPORT int SSL_set_session(SSL *ssl, SSL_SESSION *session); @@ -1863,6 +1922,9 @@ OPENSSL_EXPORT void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, // sessions created in |ctx|. OPENSSL_EXPORT uint32_t SSL_CTX_get_timeout(const SSL_CTX *ctx); +// SSL_MAX_SID_CTX_LENGTH is the maximum length of a session ID context. +#define SSL_MAX_SID_CTX_LENGTH 32 + // SSL_CTX_set_session_id_context sets |ctx|'s session ID context to |sid_ctx|. // It returns one on success and zero on error. The session ID context is an // application-defined opaque byte string. A session will not be used in a @@ -1881,7 +1943,7 @@ OPENSSL_EXPORT int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, size_t sid_ctx_len); // SSL_get0_session_id_context returns a pointer to |ssl|'s session ID context -// and sets |*out_len| to its length. +// and sets |*out_len| to its length. It returns NULL on error. OPENSSL_EXPORT const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len); @@ -2002,13 +2064,13 @@ OPENSSL_EXPORT SSL_SESSION *SSL_magic_pending_session_ptr(void); // On the client, ticket-based sessions use the same APIs as ID-based tickets. // Callers do not need to handle them differently. // -// On the server, tickets are encrypted and authenticated with a secret key. By -// default, an |SSL_CTX| generates a key on creation and uses it for the -// lifetime of the |SSL_CTX|. Tickets are minted and processed -// transparently. The following functions may be used to configure a persistent -// key or implement more custom behavior, including key rotation and sharing -// keys between multiple servers in a large deployment. There are three levels -// of customisation possible: +// On the server, tickets are encrypted and authenticated with a secret key. +// By default, an |SSL_CTX| will manage session ticket encryption keys by +// generating them internally and rotating every 48 hours. Tickets are minted +// and processed transparently. The following functions may be used to configure +// a persistent key or implement more custom behavior, including key rotation +// and sharing keys between multiple servers in a large deployment. There are +// three levels of customisation possible: // // 1) One can simply set the keys with |SSL_CTX_set_tlsext_ticket_keys|. // 2) One can configure an |EVP_CIPHER_CTX| and |HMAC_CTX| directly for @@ -2074,7 +2136,7 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_key_cb( // ssl_ticket_aead_result_t enumerates the possible results from decrypting a // ticket with an |SSL_TICKET_AEAD_METHOD|. -enum ssl_ticket_aead_result_t { +enum ssl_ticket_aead_result_t BORINGSSL_ENUM_INT { // ssl_ticket_aead_success indicates that the ticket was successfully // decrypted. ssl_ticket_aead_success, @@ -2168,6 +2230,7 @@ OPENSSL_EXPORT int SSL_set1_curves_list(SSL *ssl, const char *curves); #define SSL_CURVE_SECP384R1 24 #define SSL_CURVE_SECP521R1 25 #define SSL_CURVE_X25519 29 +#define SSL_CURVE_CECPQ2 16696 // SSL_get_curve_id returns the ID of the curve used by |ssl|'s most recently // completed handshake or 0 if not applicable. @@ -2247,7 +2310,7 @@ OPENSSL_EXPORT void SSL_set_verify(SSL *ssl, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)); -enum ssl_verify_result_t { +enum ssl_verify_result_t BORINGSSL_ENUM_INT { ssl_verify_ok, ssl_verify_invalid, ssl_verify_retry, @@ -2285,7 +2348,7 @@ OPENSSL_EXPORT void SSL_set_custom_verify( OPENSSL_EXPORT int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); // SSL_get_verify_mode returns |ssl|'s verify mode, set by |SSL_CTX_set_verify| -// or |SSL_set_verify|. +// or |SSL_set_verify|. It returns -1 on error. OPENSSL_EXPORT int SSL_get_verify_mode(const SSL *ssl); // SSL_CTX_get_verify_callback returns the callback set by @@ -2456,10 +2519,12 @@ OPENSSL_EXPORT int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store); OPENSSL_EXPORT int SSL_set1_verify_cert_store(SSL *ssl, X509_STORE *store); // SSL_CTX_set_ed25519_enabled configures whether |ctx| advertises support for -// the Ed25519 signature algorithm when using the default preference list. +// the Ed25519 signature algorithm when using the default preference list. It is +// disabled by default and may be enabled if the certificate verifier supports +// Ed25519. OPENSSL_EXPORT void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled); -// SSL_CTX_set_verify_algorithm_prefs confingures |ctx| to use |prefs| as the +// SSL_CTX_set_verify_algorithm_prefs configures |ctx| to use |prefs| as the // preference list when verifying signature's from the peer's long-term key. It // returns one on zero on error. |prefs| should not include the internal-only // value |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. @@ -2513,8 +2578,8 @@ OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); // // The returned stack is owned by |ssl|, as are its contents. It should not be // used past the point where the handshake is restarted after the callback. -OPENSSL_EXPORT STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs( - const SSL *ssl); +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * + SSL_get0_server_requested_CAs(const SSL *ssl); // SSL_CTX_get_client_CA_list returns |ctx|'s client certificate CA list. OPENSSL_EXPORT STACK_OF(X509_NAME) * @@ -2669,6 +2734,54 @@ OPENSSL_EXPORT void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled); +// Certificate compression. +// +// Certificates in TLS 1.3 can be compressed[1]. BoringSSL supports this as both +// a client and a server, but does not link against any specific compression +// libraries in order to keep dependencies to a minimum. Instead, hooks for +// compression and decompression can be installed in an |SSL_CTX| to enable +// support. +// +// [1] https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03. + +// ssl_cert_compression_func_t is a pointer to a function that performs +// compression. It must write the compressed representation of |in| to |out|, +// returning one on success and zero on error. The results of compressing +// certificates are not cached internally. Implementations may wish to implement +// their own cache if they expect it to be useful given the certificates that +// they serve. +typedef int (*ssl_cert_compression_func_t)(SSL *ssl, CBB *out, + const uint8_t *in, size_t in_len); + +// ssl_cert_decompression_func_t is a pointer to a function that performs +// decompression. The compressed data from the peer is passed as |in| and the +// decompressed result must be exactly |uncompressed_len| bytes long. It returns +// one on success, in which case |*out| must be set to the result of +// decompressing |in|, or zero on error. Setting |*out| transfers ownership, +// i.e. |CRYPTO_BUFFER_free| will be called on |*out| at some point in the +// future. The results of decompressions are not cached internally. +// Implementations may wish to implement their own cache if they expect it to be +// useful. +typedef int (*ssl_cert_decompression_func_t)(SSL *ssl, CRYPTO_BUFFER **out, + size_t uncompressed_len, + const uint8_t *in, size_t in_len); + +// SSL_CTX_add_cert_compression_alg registers a certificate compression +// algorithm on |ctx| with ID |alg_id|. (The value of |alg_id| should be an IANA +// assigned value and each can only be registered once.) +// +// One of the function pointers may be NULL to avoid having to implement both +// sides of a compression algorithm if you're only going to use it in one +// direction. In this case, the unimplemented direction acts like it was never +// configured. +// +// For a server, algorithms are registered in preference order with the most +// preferable first. It returns one on success or zero on error. +OPENSSL_EXPORT int SSL_CTX_add_cert_compression_alg( + SSL_CTX *ctx, uint16_t alg_id, ssl_cert_compression_func_t compress, + ssl_cert_decompression_func_t decompress); + + // Next protocol negotiation. // // The NPN extension (draft-agl-tls-nextprotoneg-03) is the predecessor to ALPN @@ -2938,27 +3051,7 @@ OPENSSL_EXPORT const char *SSL_get_psk_identity_hint(const SSL *ssl); OPENSSL_EXPORT const char *SSL_get_psk_identity(const SSL *ssl); -// Dummy post-quantum padding. -// -// Dummy post-quantum padding invovles the client (and later server) sending -// useless, random-looking bytes in an extension in their ClientHello or -// ServerHello. These extensions are sized to simulate a post-quantum -// key-exchange and so enable measurement of the latency impact of the -// additional bandwidth. - -// SSL_set_dummy_pq_padding_size enables the sending of a dummy PQ padding -// extension and configures its size. This is only effective for a client: a -// server will echo an extension with one of equal length when we get to that -// phase of the experiment. It returns one for success and zero otherwise. -OPENSSL_EXPORT int SSL_set_dummy_pq_padding_size(SSL *ssl, size_t num_bytes); - -// SSL_dummy_pq_padding_used returns one if the server echoed a dummy PQ padding -// extension and zero otherwise. It may only be called on a client connection -// once the ServerHello has been processed, otherwise it'll return zero. -OPENSSL_EXPORT int SSL_dummy_pq_padding_used(SSL *ssl); - - -// QUIC Transport Parameters. +// QUIC transport parameters. // // draft-ietf-quic-tls defines a new TLS extension quic_transport_parameters // used by QUIC for each endpoint to unilaterally declare its supported @@ -2990,6 +3083,176 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, size_t *out_params_len); +// Delegated credentials. +// +// *** EXPERIMENTAL — PRONE TO CHANGE *** +// +// draft-ietf-tls-subcerts is a proposed extension for TLS 1.3 and above that +// allows an end point to use its certificate to delegate credentials for +// authentication. If the peer indicates support for this extension, then this +// host may use a delegated credential to sign the handshake. Once issued, +// credentials can't be revoked. In order to mitigate the damage in case the +// credential secret key is compromised, the credential is only valid for a +// short time (days, hours, or even minutes). This library implements draft-03 +// of the protocol spec. +// +// The extension ID has not been assigned; we're using 0xff02 for the time +// being. Currently only the server side is implemented. +// +// Servers configure a DC for use in the handshake via +// |SSL_set1_delegated_credential|. It must be signed by the host's end-entity +// certificate as defined in draft-ietf-tls-subcerts-03. + +// SSL_set1_delegated_credential configures the delegated credential (DC) that +// will be sent to the peer for the current connection. |dc| is the DC in wire +// format, and |pkey| or |key_method| is the corresponding private key. +// Currently (as of draft-03), only servers may configure a DC to use in the +// handshake. +// +// The DC will only be used if the protocol version is correct and the signature +// scheme is supported by the peer. If not, the DC will not be negotiated and +// the handshake will use the private key (or private key method) associated +// with the certificate. +OPENSSL_EXPORT int SSL_set1_delegated_credential( + SSL *ssl, CRYPTO_BUFFER *dc, EVP_PKEY *pkey, + const SSL_PRIVATE_KEY_METHOD *key_method); + +// SSL_delegated_credential_used returns one if a delegated credential was used +// and zero otherwise. +OPENSSL_EXPORT int SSL_delegated_credential_used(const SSL *ssl); + + +// QUIC integration. +// +// QUIC acts as an underlying transport for the TLS 1.3 handshake. The following +// functions allow a QUIC implementation to serve as the underlying transport as +// described in draft-ietf-quic-tls. +// +// When configured for QUIC, |SSL_do_handshake| will drive the handshake as +// before, but it will not use the configured |BIO|. It will call functions on +// |SSL_QUIC_METHOD| to configure secrets and send data. If data is needed from +// the peer, it will return |SSL_ERROR_WANT_READ|. When received, the caller +// should call |SSL_provide_quic_data| and then |SSL_do_handshake| to continue +// the handshake. After the handshake is complete, the caller should call +// |SSL_provide_quic_data| for any post-handshake data, followed by +// |SSL_process_quic_post_handshake| to process it. It is an error to call +// |SSL_read| and |SSL_write| in QUIC. +// +// 0-RTT behaves similarly to |TLS_method|'s usual behavior. |SSL_do_handshake| +// returns early as soon as the client (respectively, server) is allowed to send +// 0-RTT (respectively, half-RTT) data. The caller should then call +// |SSL_do_handshake| again to consume the remaining handshake messages and +// confirm the handshake. As a client, |SSL_ERROR_EARLY_DATA_REJECTED| and +// |SSL_reset_early_data_reject| behave as usual. +// +// Note that secrets for an encryption level may be available to QUIC before the +// level is active in TLS. Callers should use |SSL_quic_read_level| to determine +// the active read level for |SSL_provide_quic_data|. |SSL_do_handshake| will +// pass the active write level to |SSL_QUIC_METHOD| when writing data. Callers +// can use |SSL_quic_write_level| to query the active write level when +// generating their own errors. +// +// See https://tools.ietf.org/html/draft-ietf-quic-tls-15#section-4.1 for more +// details. +// +// To avoid DoS attacks, the QUIC implementation must limit the amount of data +// being queued up. The implementation can call +// |SSL_quic_max_handshake_flight_len| to get the maximum buffer length at each +// encryption level. +// +// Note: 0-RTT support is incomplete and does not currently handle QUIC +// transport parameters and server SETTINGS frame. + +// ssl_encryption_level_t represents a specific QUIC encryption level used to +// transmit handshake messages. +enum ssl_encryption_level_t BORINGSSL_ENUM_INT { + ssl_encryption_initial = 0, + ssl_encryption_early_data, + ssl_encryption_handshake, + ssl_encryption_application, +}; + +// ssl_quic_method_st (aka |SSL_QUIC_METHOD|) describes custom QUIC hooks. +struct ssl_quic_method_st { + // set_encryption_secrets configures the read and write secrets for the given + // encryption level. This function will always be called before an encryption + // level other than |ssl_encryption_initial| is used. Note, however, that + // secrets for a level may be configured before TLS is ready to send or accept + // data at that level. + // + // When reading packets at a given level, the QUIC implementation must send + // ACKs at the same level, so this function provides read and write secrets + // together. The exception is |ssl_encryption_early_data|, where secrets are + // only available in the client to server direction. The other secret will be + // NULL. The server acknowledges such data at |ssl_encryption_application|, + // which will be configured in the same |SSL_do_handshake| call. + // + // This function should use |SSL_get_current_cipher| to determine the TLS + // cipher suite. + // + // It returns one on success and zero on error. + int (*set_encryption_secrets)(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *read_secret, + const uint8_t *write_secret, size_t secret_len); + // add_handshake_data adds handshake data to the current flight at the given + // encryption level. It returns one on success and zero on error. + // + // BoringSSL will pack data from a single encryption level together, but a + // single handshake flight may include multiple encryption levels. Callers + // should defer writing data to the network until |flush_flight| to better + // pack QUIC packets into transport datagrams. + int (*add_handshake_data)(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *data, size_t len); + // flush_flight is called when the current flight is complete and should be + // written to the transport. Note a flight may contain data at several + // encryption levels. It returns one on success and zero on error. + int (*flush_flight)(SSL *ssl); + // send_alert sends a fatal alert at the specified encryption level. It + // returns one on success and zero on error. + int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert); +}; + +// SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes +// that may be received at the given encryption level. This function should be +// used to limit buffering in the QUIC implementation. +// +// See https://tools.ietf.org/html/draft-ietf-quic-transport-16#section-4.4. +OPENSSL_EXPORT size_t SSL_quic_max_handshake_flight_len( + const SSL *ssl, enum ssl_encryption_level_t level); + +// SSL_quic_read_level returns the current read encryption level. +OPENSSL_EXPORT enum ssl_encryption_level_t SSL_quic_read_level(const SSL *ssl); + +// SSL_quic_write_level returns the current write encryption level. +OPENSSL_EXPORT enum ssl_encryption_level_t SSL_quic_write_level(const SSL *ssl); + +// SSL_provide_quic_data provides data from QUIC at a particular encryption +// level |level|. It is an error to call this function outside of the handshake +// or with an encryption level other than the current read level. It returns one +// on success and zero on error. +OPENSSL_EXPORT int SSL_provide_quic_data(SSL *ssl, + enum ssl_encryption_level_t level, + const uint8_t *data, size_t len); + + +// SSL_process_quic_post_handshake processes any data that QUIC has provided +// after the handshake has completed. This includes NewSessionTicket messages +// sent by the server. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_process_quic_post_handshake(SSL *ssl); + +// SSL_CTX_set_quic_method configures the QUIC hooks. This should only be +// configured with a minimum version of TLS 1.3. |quic_method| must remain valid +// for the lifetime of |ctx|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_quic_method(SSL_CTX *ctx, + const SSL_QUIC_METHOD *quic_method); + +// SSL_set_quic_method configures the QUIC hooks. This should only be +// configured with a minimum version of TLS 1.3. |quic_method| must remain valid +// for the lifetime of |ssl|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_quic_method(SSL *ssl, + const SSL_QUIC_METHOD *quic_method); + + // Early data. // // WARNING: 0-RTT support in BoringSSL is currently experimental and not fully @@ -3002,8 +3265,8 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, // WARNING: A 0-RTT handshake has different security properties from normal // handshake, so it is off by default unless opted in. In particular, early data // is replayable by a network attacker. Callers must account for this when -// sending or processing data before the handshake is confirmed. See -// draft-ietf-tls-tls13-18 for more information. +// sending or processing data before the handshake is confirmed. See RFC 8446 +// for more information. // // As a server, if early data is accepted, |SSL_do_handshake| will complete as // soon as the ClientHello is processed and server flight sent. |SSL_write| may @@ -3038,9 +3301,9 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, // properties. The caller must disregard any values from before the reset and // query again. // -// Finally, to implement the fallback described in draft-ietf-tls-tls13-18 -// appendix C.3, retry on a fresh connection without 0-RTT if the handshake -// fails with |SSL_R_WRONG_VERSION_ON_EARLY_DATA|. +// Finally, to implement the fallback described in RFC 8446 appendix D.3, retry +// on a fresh connection without 0-RTT if the handshake fails with +// |SSL_R_WRONG_VERSION_ON_EARLY_DATA|. // SSL_CTX_set_early_data_enabled sets whether early data is allowed to be used // with resumptions using |ctx|. @@ -3058,6 +3321,10 @@ OPENSSL_EXPORT void SSL_set_early_data_enabled(SSL *ssl, int enabled); // and |SSL_write| to send half-RTT data. OPENSSL_EXPORT int SSL_in_early_data(const SSL *ssl); +// SSL_SESSION_early_data_capable returns whether early data would have been +// attempted with |session| if enabled. +OPENSSL_EXPORT int SSL_SESSION_early_data_capable(const SSL_SESSION *session); + // SSL_early_data_accepted returns whether early data was accepted on the // handshake performed by |ssl|. OPENSSL_EXPORT int SSL_early_data_accepted(const SSL *ssl); @@ -3071,21 +3338,59 @@ OPENSSL_EXPORT int SSL_early_data_accepted(const SSL *ssl); // |SSL_ERROR_EARLY_DATA_REJECTED|. OPENSSL_EXPORT void SSL_reset_early_data_reject(SSL *ssl); -// SSL_export_early_keying_material behaves like |SSL_export_keying_material|, -// but it uses the early exporter. The operation will fail if |ssl| did not -// negotiate TLS 1.3 or 0-RTT. -OPENSSL_EXPORT int SSL_export_early_keying_material( - SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, - const uint8_t *context, size_t context_len); +// SSL_get_ticket_age_skew returns the difference, in seconds, between the +// client-sent ticket age and the server-computed value in TLS 1.3 server +// connections which resumed a session. +OPENSSL_EXPORT int32_t SSL_get_ticket_age_skew(const SSL *ssl); + +// An ssl_early_data_reason_t describes why 0-RTT was accepted or rejected. +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum ssl_early_data_reason_t BORINGSSL_ENUM_INT { + // The handshake has not progressed far enough for the 0-RTT status to be + // known. + ssl_early_data_unknown = 0, + // 0-RTT is disabled for this connection. + ssl_early_data_disabled = 1, + // 0-RTT was accepted. + ssl_early_data_accepted = 2, + // The negotiated protocol version does not support 0-RTT. + ssl_early_data_protocol_version = 3, + // The peer declined to offer or accept 0-RTT for an unknown reason. + ssl_early_data_peer_declined = 4, + // The client did not offer a session. + ssl_early_data_no_session_offered = 5, + // The server declined to resume the session. + ssl_early_data_session_not_resumed = 6, + // The session does not support 0-RTT. + ssl_early_data_unsupported_for_session = 7, + // The server sent a HelloRetryRequest. + ssl_early_data_hello_retry_request = 8, + // The negotiated ALPN protocol did not match the session. + ssl_early_data_alpn_mismatch = 9, + // The connection negotiated Channel ID, which is incompatible with 0-RTT. + ssl_early_data_channel_id = 10, + // The connection negotiated token binding, which is incompatible with 0-RTT. + ssl_early_data_token_binding = 11, + // The client and server ticket age were too far apart. + ssl_early_data_ticket_age_skew = 12, + // The value of the largest entry. + ssl_early_data_reason_max_value = ssl_early_data_ticket_age_skew, +}; + +// SSL_get_early_data_reason returns details why 0-RTT was accepted or rejected +// on |ssl|. This is primarily useful on the server. +OPENSSL_EXPORT enum ssl_early_data_reason_t SSL_get_early_data_reason( + const SSL *ssl); // Alerts. // -// TLS and SSL 3.0 use alerts to signal error conditions. Alerts have a type -// (warning or fatal) and description. OpenSSL internally handles fatal alerts -// with dedicated error codes (see |SSL_AD_REASON_OFFSET|). Except for -// close_notify, warning alerts are silently ignored and may only be surfaced -// with |SSL_CTX_set_info_callback|. +// TLS uses alerts to signal error conditions. Alerts have a type (warning or +// fatal) and description. OpenSSL internally handles fatal alerts with +// dedicated error codes (see |SSL_AD_REASON_OFFSET|). Except for close_notify, +// warning alerts are silently ignored and may only be surfaced with +// |SSL_CTX_set_info_callback|. // SSL_AD_REASON_OFFSET is the offset between error reasons and |SSL_AD_*| // values. Any error code under |ERR_LIB_SSL| with an error reason above this @@ -3096,7 +3401,7 @@ OPENSSL_EXPORT int SSL_export_early_keying_material( // This value must be kept in sync with reservedReasonCode in make_errors.h #define SSL_AD_REASON_OFFSET 1000 -// SSL_AD_* are alert descriptions for SSL 3.0 and TLS. +// SSL_AD_* are alert descriptions. #define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY #define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE #define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC @@ -3104,7 +3409,7 @@ OPENSSL_EXPORT int SSL_export_early_keying_material( #define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW #define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE #define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE -#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE // Not used in TLS +#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE // Legacy SSL 3.0 value #define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE #define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE #define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED @@ -3184,7 +3489,7 @@ OPENSSL_EXPORT int SSL_CTX_get_ex_new_index(long argl, void *argp, // SSL_get_ivs sets |*out_iv_len| to the length of the IVs for the ciphers // underlying |ssl| and sets |*out_read_iv| and |*out_write_iv| to point to the // current IVs for the read and write directions. This is only meaningful for -// connections with implicit IVs (i.e. CBC mode with SSLv3 or TLS 1.0). +// connections with implicit IVs (i.e. CBC mode with TLS 1.0). // // It returns one on success or zero on error. OPENSSL_EXPORT int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, @@ -3213,13 +3518,6 @@ OPENSSL_EXPORT uint64_t SSL_get_write_sequence(const SSL *ssl); // Obscure functions. -// SSL_get_structure_sizes returns the sizes of the SSL, SSL_CTX and -// SSL_SESSION structures so that a test can ensure that outside code agrees on -// these values. -OPENSSL_EXPORT void SSL_get_structure_sizes(size_t *ssl_size, - size_t *ssl_ctx_size, - size_t *ssl_session_size); - // SSL_CTX_set_msg_callback installs |cb| as the message callback for |ctx|. // This callback will be called when sending or receiving low-level record // headers, complete handshake messages, ChangeCipherSpec, and alerts. @@ -3276,11 +3574,32 @@ OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))( OPENSSL_EXPORT void SSL_CTX_set_current_time_cb( SSL_CTX *ctx, void (*cb)(const SSL *ssl, struct timeval *out_clock)); -enum ssl_renegotiate_mode_t { +// SSL_set_shed_handshake_config allows some of the configuration of |ssl| to be +// freed after its handshake completes. Once configuration has been shed, APIs +// that query it may fail. "Configuration" in this context means anything that +// was set by the caller, as distinct from information derived from the +// handshake. For example, |SSL_get_ciphers| queries how the |SSL| was +// configured by the caller, and fails after configuration has been shed, +// whereas |SSL_get_cipher| queries the result of the handshake, and is +// unaffected by configuration shedding. +// +// If configuration shedding is enabled, it is an error to call |SSL_clear|. +// +// Note that configuration shedding as a client additionally depends on +// renegotiation being disabled (see |SSL_set_renegotiate_mode|). If +// renegotiation is possible, the configuration will be retained. If +// configuration shedding is enabled and renegotiation later disabled after the +// handshake, |SSL_set_renegotiate_mode| will shed configuration then. This may +// be useful for clients which support renegotiation with some ALPN protocols, +// such as HTTP/1.1, and not others, such as HTTP/2. +OPENSSL_EXPORT void SSL_set_shed_handshake_config(SSL *ssl, int enable); + +enum ssl_renegotiate_mode_t BORINGSSL_ENUM_INT { ssl_renegotiate_never = 0, ssl_renegotiate_once, ssl_renegotiate_freely, ssl_renegotiate_ignore, + ssl_renegotiate_explicit, }; // SSL_set_renegotiate_mode configures how |ssl|, a client, reacts to @@ -3294,11 +3613,35 @@ enum ssl_renegotiate_mode_t { // Note that ignoring HelloRequest messages may cause the connection to stall // if the server waits for the renegotiation to complete. // +// If set to |ssl_renegotiate_explicit|, |SSL_read| and |SSL_peek| calls which +// encounter a HelloRequest will pause with |SSL_ERROR_WANT_RENEGOTIATE|. +// |SSL_write| will continue to work while paused. The caller may call +// |SSL_renegotiate| to begin the renegotiation at a later point. This mode may +// be used if callers wish to eagerly call |SSL_peek| without triggering a +// renegotiation. +// +// If configuration shedding is enabled (see |SSL_set_shed_handshake_config|), +// configuration is released if, at any point after the handshake, renegotiation +// is disabled. It is not possible to switch from disabling renegotiation to +// enabling it on a given connection. Callers that condition renegotiation on, +// e.g., ALPN must enable renegotiation before the handshake and conditionally +// disable it afterwards. +// // There is no support in BoringSSL for initiating renegotiations as a client // or server. OPENSSL_EXPORT void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode); +// SSL_renegotiate starts a deferred renegotiation on |ssl| if it was configured +// with |ssl_renegotiate_explicit| and has a pending HelloRequest. It returns +// one on success and zero on error. +// +// This function does not do perform any I/O. On success, a subsequent +// |SSL_do_handshake| call will run the handshake. |SSL_write| and +// |SSL_read| will also complete the handshake before sending or receiving +// application data. +OPENSSL_EXPORT int SSL_renegotiate(SSL *ssl); + // SSL_renegotiate_pending returns one if |ssl| is in the middle of a // renegotiation. OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *ssl); @@ -3307,22 +3650,6 @@ OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *ssl); // performed by |ssl|. This includes the pending renegotiation, if any. OPENSSL_EXPORT int SSL_total_renegotiations(const SSL *ssl); -enum tls13_variant_t { - tls13_default = 0, -}; - -// SSL_CTX_set_tls13_variant sets which variant of TLS 1.3 we negotiate. On the -// server, if |variant| is not |tls13_default|, all variants are enabled. On the -// client, only the configured variant is enabled. -OPENSSL_EXPORT void SSL_CTX_set_tls13_variant(SSL_CTX *ctx, - enum tls13_variant_t variant); - -// SSL_set_tls13_variant sets which variant of TLS 1.3 we negotiate. On the -// server, if |variant| is not |tls13_default|, all variants are enabled. On the -// client, only the configured variant is enabled. -OPENSSL_EXPORT void SSL_set_tls13_variant(SSL *ssl, - enum tls13_variant_t variant); - // SSL_MAX_CERT_LIST_DEFAULT is the default maximum length, in bytes, of a peer // certificate chain. #define SSL_MAX_CERT_LIST_DEFAULT (1024 * 100) @@ -3383,7 +3710,7 @@ typedef struct ssl_early_callback_ctx { // ssl_select_cert_result_t enumerates the possible results from selecting a // certificate with |select_certificate_cb|. -enum ssl_select_cert_result_t { +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT { // ssl_select_cert_success indicates that the certificate selection was // successful. ssl_select_cert_success = 1, @@ -3414,6 +3741,8 @@ OPENSSL_EXPORT int SSL_early_callback_ctx_extension_get( // high-level operation on |ssl| to be retried at a later time, which will // result in another call to |cb|. // +// |SSL_get_servername| may be used during this callback. +// // Note: The |SSL_CLIENT_HELLO| is only valid for the duration of the callback // and is not valid while the handshake is paused. OPENSSL_EXPORT void SSL_CTX_set_select_certificate_cb( @@ -3426,14 +3755,33 @@ OPENSSL_EXPORT void SSL_CTX_set_select_certificate_cb( OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb( SSL_CTX *ctx, int (*cb)(const SSL_CLIENT_HELLO *)); -// SSL_ST_* are possible values for |SSL_state| and the bitmasks that make them -// up. +// SSL_CTX_set_reverify_on_resume configures whether the certificate +// verification callback will be used to reverify stored certificates +// when resuming a session. This only works with |SSL_CTX_set_custom_verify|. +// For now, this is incompatible with |SSL_VERIFY_NONE| mode, and is only +// respected on clients. +OPENSSL_EXPORT void SSL_CTX_set_reverify_on_resume(SSL_CTX *ctx, int enabled); + +// SSL_set_enforce_rsa_key_usage configures whether the keyUsage extension of +// RSA leaf certificates will be checked for consistency with the TLS +// usage. This parameter may be set late; it will not be read until after the +// certificate verification callback. +OPENSSL_EXPORT void SSL_set_enforce_rsa_key_usage(SSL *ssl, int enabled); + +// SSL_ST_* are possible values for |SSL_state|, the bitmasks that make them up, +// and some historical values for compatibility. Only |SSL_ST_INIT| and +// |SSL_ST_OK| are ever returned. #define SSL_ST_CONNECT 0x1000 #define SSL_ST_ACCEPT 0x2000 #define SSL_ST_MASK 0x0FFF #define SSL_ST_INIT (SSL_ST_CONNECT | SSL_ST_ACCEPT) #define SSL_ST_OK 0x03 #define SSL_ST_RENEGOTIATE (0x04 | SSL_ST_INIT) +#define SSL_ST_BEFORE (0x05 | SSL_ST_INIT) + +// TLS_ST_* are aliases for |SSL_ST_*| for OpenSSL 1.1.0 compatibility. +#define TLS_ST_OK SSL_ST_OK +#define TLS_ST_BEFORE SSL_ST_BEFORE // SSL_CB_* are possible values for the |type| parameter in the info // callback and the bitmasks that make them up. @@ -3537,7 +3885,8 @@ OPENSSL_EXPORT const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl); // the SHA-256 hash of peer's certificate should be saved in memory and in the // session. This can save memory, ticket size and session cache space. If // enabled, |SSL_get_peer_certificate| will return NULL after the handshake -// completes. See the |peer_sha256| field of |SSL_SESSION| for the hash. +// completes. See |SSL_SESSION_has_peer_sha256| and +// |SSL_SESSION_get0_peer_sha256| to query the hash. OPENSSL_EXPORT void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enable); @@ -3545,7 +3894,8 @@ OPENSSL_EXPORT void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, // only the SHA-256 hash of peer's certificate should be saved in memory and in // the session. This can save memory, ticket size and session cache space. If // enabled, |SSL_get_peer_certificate| will return NULL after the handshake -// completes. See the |peer_sha256| field of |SSL_SESSION| for the hash. +// completes. See |SSL_SESSION_has_peer_sha256| and +// |SSL_SESSION_get0_peer_sha256| to query the hash. OPENSSL_EXPORT void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enable); @@ -3557,20 +3907,37 @@ OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled); // record with |ssl|. OPENSSL_EXPORT size_t SSL_max_seal_overhead(const SSL *ssl); -// SSL_get_ticket_age_skew returns the difference, in seconds, between the -// client-sent ticket age and the server-computed value in TLS 1.3 server -// connections which resumed a session. -OPENSSL_EXPORT int32_t SSL_get_ticket_age_skew(const SSL *ssl); - // SSL_CTX_set_false_start_allowed_without_alpn configures whether connections // on |ctx| may use False Start (if |SSL_MODE_ENABLE_FALSE_START| is enabled) // without negotiating ALPN. OPENSSL_EXPORT void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed); -// SSL_is_draft_downgrade returns one if the TLS 1.3 anti-downgrade mechanism -// would have aborted |ssl|'s handshake and zero otherwise. -OPENSSL_EXPORT int SSL_is_draft_downgrade(const SSL *ssl); +// SSL_CTX_set_ignore_tls13_downgrade configures whether connections on |ctx| +// ignore the downgrade signal in the server's random value. +OPENSSL_EXPORT void SSL_CTX_set_ignore_tls13_downgrade(SSL_CTX *ctx, + int ignore); + +// SSL_set_ignore_tls13_downgrade configures whether |ssl| ignores the downgrade +// signal in the server's random value. +OPENSSL_EXPORT void SSL_set_ignore_tls13_downgrade(SSL *ssl, int ignore); + +// SSL_is_tls13_downgrade returns one if the TLS 1.3 anti-downgrade +// mechanism would have aborted |ssl|'s handshake and zero otherwise. +OPENSSL_EXPORT int SSL_is_tls13_downgrade(const SSL *ssl); + +// SSL_used_hello_retry_request returns one if the TLS 1.3 HelloRetryRequest +// message has been either sent by the server or received by the client. It +// returns zero otherwise. +OPENSSL_EXPORT int SSL_used_hello_retry_request(const SSL *ssl); + +// SSL_set_jdk11_workaround configures whether to workaround various bugs in +// JDK 11's TLS 1.3 implementation by disabling TLS 1.3 for such clients. +// +// https://bugs.openjdk.java.net/browse/JDK-8211806 +// https://bugs.openjdk.java.net/browse/JDK-8212885 +// https://bugs.openjdk.java.net/browse/JDK-8213202 +OPENSSL_EXPORT void SSL_set_jdk11_workaround(SSL *ssl, int enable); // Deprecated functions. @@ -3722,17 +4089,14 @@ OPENSSL_EXPORT int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa); // SSL_CTX_get_read_ahead returns zero. OPENSSL_EXPORT int SSL_CTX_get_read_ahead(const SSL_CTX *ctx); -// SSL_CTX_set_read_ahead does nothing. -OPENSSL_EXPORT void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); +// SSL_CTX_set_read_ahead returns one. +OPENSSL_EXPORT int SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); // SSL_get_read_ahead returns zero. OPENSSL_EXPORT int SSL_get_read_ahead(const SSL *ssl); -// SSL_set_read_ahead does nothing. -OPENSSL_EXPORT void SSL_set_read_ahead(SSL *ssl, int yes); - -// SSL_renegotiate put an error on the error queue and returns zero. -OPENSSL_EXPORT int SSL_renegotiate(SSL *ssl); +// SSL_set_read_ahead returns one. +OPENSSL_EXPORT int SSL_set_read_ahead(SSL *ssl, int yes); // SSL_set_state does nothing. OPENSSL_EXPORT void SSL_set_state(SSL *ssl, int state); @@ -3741,6 +4105,11 @@ OPENSSL_EXPORT void SSL_set_state(SSL *ssl, int state); // pointer to |buf|, or NULL if |len| is less than or equal to zero. OPENSSL_EXPORT char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); +// SSL_get_shared_sigalgs returns zero. +OPENSSL_EXPORT int SSL_get_shared_sigalgs(SSL *ssl, int idx, int *psign, + int *phash, int *psignandhash, + uint8_t *rsig, uint8_t *rhash); + // SSL_MODE_HANDSHAKE_CUTTHROUGH is the same as SSL_MODE_ENABLE_FALSE_START. #define SSL_MODE_HANDSHAKE_CUTTHROUGH SSL_MODE_ENABLE_FALSE_START @@ -3800,7 +4169,7 @@ OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_compression(SSL *ssl); OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_expansion(SSL *ssl); // SSL_get_server_tmp_key returns zero. -OPENSSL_EXPORT int *SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key); +OPENSSL_EXPORT int SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key); // SSL_CTX_set_tmp_dh returns 1. OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); @@ -3817,6 +4186,53 @@ OPENSSL_EXPORT void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, int keylength)); +// SSL_CTX_set1_sigalgs takes |num_values| ints and interprets them as pairs +// where the first is the nid of a hash function and the second is an +// |EVP_PKEY_*| value. It configures the signature algorithm preferences for +// |ctx| based on them and returns one on success or zero on error. +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *values, + size_t num_values); + +// SSL_set1_sigalgs takes |num_values| ints and interprets them as pairs where +// the first is the nid of a hash function and the second is an |EVP_PKEY_*| +// value. It configures the signature algorithm preferences for |ssl| based on +// them and returns one on success or zero on error. +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_set1_sigalgs(SSL *ssl, const int *values, + size_t num_values); + +// SSL_CTX_set1_sigalgs_list takes a textual specification of a set of signature +// algorithms and configures them on |ctx|. It returns one on success and zero +// on error. See +// https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set1_sigalgs_list.html for +// a description of the text format. Also note that TLS 1.3 names (e.g. +// "rsa_pkcs1_md5_sha1") can also be used (as in OpenSSL, although OpenSSL +// doesn't document that). +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str); + +// SSL_set1_sigalgs_list takes a textual specification of a set of signature +// algorithms and configures them on |ssl|. It returns one on success and zero +// on error. See +// https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set1_sigalgs_list.html for +// a description of the text format. Also note that TLS 1.3 names (e.g. +// "rsa_pkcs1_md5_sha1") can also be used (as in OpenSSL, although OpenSSL +// doesn't document that). +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_set1_sigalgs_list(SSL *ssl, const char *str); #define SSL_set_app_data(s, arg) (SSL_set_ex_data(s, 0, (char *)(arg))) #define SSL_get_app_data(s) (SSL_get_ex_data(s, 0)) @@ -3870,8 +4286,10 @@ DEFINE_STACK_OF(SSL_COMP) #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0 #define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0 #define SSL_OP_NO_COMPRESSION 0 +#define SSL_OP_NO_RENEGOTIATION 0 // ssl_renegotiate_never is the default #define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0 #define SSL_OP_NO_SSLv2 0 +#define SSL_OP_NO_SSLv3 0 #define SSL_OP_PKCS1_CHECK_1 0 #define SSL_OP_PKCS1_CHECK_2 0 #define SSL_OP_SINGLE_DH_USE 0 @@ -3890,7 +4308,7 @@ OPENSSL_EXPORT int SSL_cache_hit(SSL *ssl); OPENSSL_EXPORT long SSL_get_default_timeout(const SSL *ssl); // SSL_get_version returns a string describing the TLS version used by |ssl|. -// For example, "TLSv1.2" or "SSLv3". +// For example, "TLSv1.2" or "DTLSv1". OPENSSL_EXPORT const char *SSL_get_version(const SSL *ssl); // SSL_get_cipher_list returns the name of the |n|th cipher in the output of @@ -3914,18 +4332,9 @@ OPENSSL_EXPORT const char *SSL_get_cipher_list(const SSL *ssl, int n); OPENSSL_EXPORT void SSL_CTX_set_client_cert_cb( SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **out_x509, EVP_PKEY **out_pkey)); -#define SSL_NOTHING 1 -#define SSL_WRITING 2 -#define SSL_READING 3 -#define SSL_X509_LOOKUP 4 -#define SSL_CHANNEL_ID_LOOKUP 5 -#define SSL_PENDING_SESSION 7 -#define SSL_CERTIFICATE_SELECTION_PENDING 8 -#define SSL_PRIVATE_KEY_OPERATION 9 -#define SSL_PENDING_TICKET 10 -#define SSL_EARLY_DATA_REJECTED 11 -#define SSL_CERTIFICATE_VERIFY 12 -#define SSL_HANDOFF 13 +#define SSL_NOTHING SSL_ERROR_NONE +#define SSL_WRITING SSL_ERROR_WANT_WRITE +#define SSL_READING SSL_ERROR_WANT_READ // SSL_want returns one of the above values to determine what the most recent // operation on |ssl| was blocked on. Use |SSL_get_error| instead. @@ -3936,15 +4345,15 @@ OPENSSL_EXPORT int SSL_want(const SSL *ssl); // SSL_get_finished writes up to |count| bytes of the Finished message sent by // |ssl| to |buf|. It returns the total untruncated length or zero if none has - // been sent yet. At SSL 3.0 or TLS 1.3 and later, it returns zero. + // been sent yet. At TLS 1.3 and later, it returns zero. // // Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count); // SSL_get_peer_finished writes up to |count| bytes of the Finished message // received from |ssl|'s peer to |buf|. It returns the total untruncated length - // or zero if none has been received yet. At SSL 3.0 or TLS 1.3 and later, it - // returns zero. + // or zero if none has been received yet. At TLS 1.3 and later, it returns + // zero. // // Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_peer_finished(const SSL *ssl, void *buf, @@ -4103,158 +4512,78 @@ OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); -#if !defined(BORINGSSL_NO_CXX) -// SSL_CTX_sess_set_get_cb is a legacy C++ overload of |SSL_CTX_sess_set_get_cb| -// which supports the old callback signature. -// -// TODO(davidben): Remove this once Node is compatible with OpenSSL 1.1.0. -extern "C++" OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( - SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)); -#endif - +// The following constants are legacy aliases for RSA-PSS with rsaEncryption +// keys. Use the new names instead. +#define SSL_SIGN_RSA_PSS_SHA256 SSL_SIGN_RSA_PSS_RSAE_SHA256 +#define SSL_SIGN_RSA_PSS_SHA384 SSL_SIGN_RSA_PSS_RSAE_SHA384 +#define SSL_SIGN_RSA_PSS_SHA512 SSL_SIGN_RSA_PSS_RSAE_SHA512 -// Private structures. +// SSL_set_tlsext_status_type configures a client to request OCSP stapling if +// |type| is |TLSEXT_STATUSTYPE_ocsp| and disables it otherwise. It returns one +// on success and zero if handshake configuration has already been shed. // -// This structures are exposed for historical reasons, but access to them is -// deprecated. +// Use |SSL_enable_ocsp_stapling| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); -// TODO(davidben): Remove this forward declaration when |SSL_SESSION| is opaque. -typedef struct ssl_x509_method_st SSL_X509_METHOD; +// SSL_get_tlsext_status_type returns |TLSEXT_STATUSTYPE_ocsp| if the client +// requested OCSP stapling and |TLSEXT_STATUSTYPE_nothing| otherwise. On the +// client, this reflects whether OCSP stapling was enabled via, e.g., +// |SSL_set_tlsext_status_type|. On the server, this is determined during the +// handshake. It may be queried in callbacks set by |SSL_CTX_set_cert_cb|. The +// result is undefined after the handshake completes. +OPENSSL_EXPORT int SSL_get_tlsext_status_type(const SSL *ssl); -#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 -#define SSL_MAX_SID_CTX_LENGTH 32 -#define SSL_MAX_MASTER_KEY_LENGTH 48 - -struct ssl_session_st { - CRYPTO_refcount_t references; - uint16_t ssl_version; // what ssl version session info is being kept in here? - - // group_id is the ID of the ECDH group used to establish this session or zero - // if not applicable or unknown. - uint16_t group_id; - - // peer_signature_algorithm is the signature algorithm used to authenticate - // the peer, or zero if not applicable or unknown. - uint16_t peer_signature_algorithm; - - // master_key, in TLS 1.2 and below, is the master secret associated with the - // session. In TLS 1.3 and up, it is the resumption secret. - int master_key_length; - uint8_t master_key[SSL_MAX_MASTER_KEY_LENGTH]; - - // session_id - valid? - unsigned int session_id_length; - uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; - // this is used to determine whether the session is being reused in - // the appropriate context. It is up to the application to set this, - // via SSL_new - uint8_t sid_ctx_length; - uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - - char *psk_identity; - - // certs contains the certificate chain from the peer, starting with the leaf - // certificate. - STACK_OF(CRYPTO_BUFFER) *certs; - - const SSL_X509_METHOD *x509_method; - - // x509_peer is the peer's certificate. - X509 *x509_peer; - - // x509_chain is the certificate chain sent by the peer. NOTE: for historical - // reasons, when a client (so the peer is a server), the chain includes - // |peer|, but when a server it does not. - STACK_OF(X509) *x509_chain; - - // x509_chain_without_leaf is a lazily constructed copy of |x509_chain| that - // omits the leaf certificate. This exists because OpenSSL, historically, - // didn't include the leaf certificate in the chain for a server, but did for - // a client. The |x509_chain| always includes it and, if an API call requires - // a chain without, it is stored here. - STACK_OF(X509) *x509_chain_without_leaf; - - // verify_result is the result of certificate verification in the case of - // non-fatal certificate errors. - long verify_result; - - // timeout is the lifetime of the session in seconds, measured from |time|. - // This is renewable up to |auth_timeout|. - uint32_t timeout; - - // auth_timeout is the non-renewable lifetime of the session in seconds, - // measured from |time|. - uint32_t auth_timeout; - - // time is the time the session was issued, measured in seconds from the UNIX - // epoch. - uint64_t time; - - const SSL_CIPHER *cipher; - - CRYPTO_EX_DATA ex_data; // application specific data - - // These are used to make removal of session-ids more efficient and to - // implement a maximum cache size. - SSL_SESSION *prev, *next; - - // RFC4507 info - uint8_t *tlsext_tick; // Session ticket - size_t tlsext_ticklen; // Session ticket length - - CRYPTO_BUFFER *signed_cert_timestamp_list; - - // The OCSP response that came with the session. - CRYPTO_BUFFER *ocsp_response; - - // peer_sha256 contains the SHA-256 hash of the peer's certificate if - // |peer_sha256_valid| is true. - uint8_t peer_sha256[SHA256_DIGEST_LENGTH]; - - // original_handshake_hash contains the handshake hash (either SHA-1+MD5 or - // SHA-2, depending on TLS version) for the original, full handshake that - // created a session. This is used by Channel IDs during resumption. - uint8_t original_handshake_hash[EVP_MAX_MD_SIZE]; - uint8_t original_handshake_hash_len; - - uint32_t tlsext_tick_lifetime_hint; // Session lifetime hint in seconds - - uint32_t ticket_age_add; - - // ticket_max_early_data is the maximum amount of data allowed to be sent as - // early data. If zero, 0-RTT is disallowed. - uint32_t ticket_max_early_data; - - // early_alpn is the ALPN protocol from the initial handshake. This is only - // stored for TLS 1.3 and above in order to enforce ALPN matching for 0-RTT - // resumptions. - uint8_t *early_alpn; - size_t early_alpn_len; - - // extended_master_secret is true if the master secret in this session was - // generated using EMS and thus isn't vulnerable to the Triple Handshake - // attack. - unsigned extended_master_secret:1; - - // peer_sha256_valid is non-zero if |peer_sha256| is valid. - unsigned peer_sha256_valid:1; // Non-zero if peer_sha256 is valid - - // not_resumable is used to indicate that session resumption is disallowed. - unsigned not_resumable:1; - - // ticket_age_add_valid is non-zero if |ticket_age_add| is valid. - unsigned ticket_age_add_valid:1; +// SSL_set_tlsext_status_ocsp_resp sets the OCSP response. It returns one on +// success and zero on error. On success, |ssl| takes ownership of |resp|, which +// must have been allocated by |OPENSSL_malloc|. +// +// Use |SSL_set_ocsp_response| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_ocsp_resp(SSL *ssl, uint8_t *resp, + size_t resp_len); - // is_server is true if this session was created by a server. - unsigned is_server:1; -}; +// SSL_get_tlsext_status_ocsp_resp sets |*out| to point to the OCSP response +// from the server. It returns the length of the response. If there was no +// response, it sets |*out| to NULL and returns zero. +// +// Use |SSL_get0_ocsp_response| instead. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT size_t SSL_get_tlsext_status_ocsp_resp(const SSL *ssl, + const uint8_t **out); + +// SSL_CTX_set_tlsext_status_cb configures the legacy OpenSSL OCSP callback and +// returns one. Though the type signature is the same, this callback has +// different behavior for client and server connections: +// +// For clients, the callback is called after certificate verification. It should +// return one for success, zero for a bad OCSP response, and a negative number +// for internal error. Instead, handle this as part of certificate verification. +// (Historically, OpenSSL verified certificates just before parsing stapled OCSP +// responses, but BoringSSL fixes this ordering. All server credentials are +// available during verification.) +// +// Do not use this callback as a server. It is provided for compatibility +// purposes only. For servers, it is called to configure server credentials. It +// should return |SSL_TLSEXT_ERR_OK| on success, |SSL_TLSEXT_ERR_NOACK| to +// ignore OCSP requests, or |SSL_TLSEXT_ERR_ALERT_FATAL| on error. It is usually +// used to fetch OCSP responses on demand, which is not ideal. Instead, treat +// OCSP responses like other server credentials, such as certificates or SCT +// lists. Configure, store, and refresh them eagerly. This avoids downtime if +// the CA's OCSP responder is briefly offline. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, + int (*callback)(SSL *ssl, + void *arg)); + +// SSL_CTX_set_tlsext_status_arg sets additional data for +// |SSL_CTX_set_tlsext_status_cb|'s callback and returns one. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); // Nodejs compatibility section (hidden). // // These defines exist for node.js, with the hope that we can eliminate the // need for them over time. + #define SSLerr(function, reason) \ ERR_put_error(ERR_LIB_SSL, 0, reason, __FILE__, __LINE__) @@ -4290,6 +4619,7 @@ struct ssl_session_st { #define SSL_CTRL_GET_NUM_RENEGOTIATIONS doesnt_exist #define SSL_CTRL_GET_READ_AHEAD doesnt_exist #define SSL_CTRL_GET_RI_SUPPORT doesnt_exist +#define SSL_CTRL_GET_SERVER_TMP_KEY doesnt_exist #define SSL_CTRL_GET_SESSION_REUSED doesnt_exist #define SSL_CTRL_GET_SESS_CACHE_MODE doesnt_exist #define SSL_CTRL_GET_SESS_CACHE_SIZE doesnt_exist @@ -4322,11 +4652,17 @@ struct ssl_session_st { #define SSL_CTRL_SET_TMP_RSA doesnt_exist #define SSL_CTRL_SET_TMP_RSA_CB doesnt_exist +// |BORINGSSL_PREFIX| already makes each of these symbols into macros, so there +// is no need to define conflicting macros. +#if !defined(BORINGSSL_PREFIX) + #define SSL_CTX_set_tlsext_servername_callback \ SSL_CTX_set_tlsext_servername_callback #define SSL_get_secure_renegotiation_support \ SSL_get_secure_renegotiation_support +#endif // !defined(BORINGSSL_PREFIX) + #if defined(__cplusplus) } // extern C @@ -4335,11 +4671,13 @@ struct ssl_session_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(SSL, SSL_free) BORINGSSL_MAKE_DELETER(SSL_CTX, SSL_CTX_free) +BORINGSSL_MAKE_UP_REF(SSL_CTX, SSL_CTX_up_ref) BORINGSSL_MAKE_DELETER(SSL_SESSION, SSL_SESSION_free) +BORINGSSL_MAKE_UP_REF(SSL_SESSION, SSL_SESSION_up_ref) enum class OpenRecordResult { kOK, @@ -4414,10 +4752,10 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // state of the connection. // // Elsewhere, a fresh |SSL| can be used with |SSL_apply_handoff| to continue -// the connection. The connection from the client is fed into this |SSL| until -// the handshake completes normally. At this point (and only at this point), -// |SSL_serialize_handback| can be called to serialize the result of the -// handshake. +// the connection. The connection from the client is fed into this |SSL|, and +// the handshake resumed. When the handshake stops again and |SSL_get_error| +// indicates |SSL_ERROR_HANDBACK|, |SSL_serialize_handback| should be called to +// serialize the state of the handshake again. // // Back at the first location, a fresh |SSL| can be used with // |SSL_apply_handback|. Then the client's connection can be processed mostly @@ -4425,7 +4763,7 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // // Lastly, when a connection is in the handoff state, whether or not // |SSL_serialize_handoff| is called, |SSL_decline_handoff| will move it back -// into a normal state where the connection can procede without impact. +// into a normal state where the connection can proceed without impact. // // WARNING: Currently only works with TLS 1.0–1.2. // WARNING: The serialisation formats are not yet stable: version skew may be @@ -4438,13 +4776,23 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // WARNING: |SSL_apply_handoff| may trigger “msg” callback calls. OPENSSL_EXPORT void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on); -OPENSSL_EXPORT bool SSL_serialize_handoff(const SSL *ssl, CBB *out); +OPENSSL_EXPORT void SSL_set_handoff_mode(SSL *SSL, bool on); +OPENSSL_EXPORT bool SSL_serialize_handoff(const SSL *ssl, CBB *out, + SSL_CLIENT_HELLO *out_hello); OPENSSL_EXPORT bool SSL_decline_handoff(SSL *ssl); OPENSSL_EXPORT bool SSL_apply_handoff(SSL *ssl, Span handoff); OPENSSL_EXPORT bool SSL_serialize_handback(const SSL *ssl, CBB *out); OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); -} // namespace bssl +// SSL_get_traffic_secrets sets |*out_read_traffic_secret| and +// |*out_write_traffic_secret| to reference the TLS 1.3 traffic secrets for +// |ssl|. This function is only valid on TLS 1.3 connections that have +// completed the handshake. It returns true on success and false on error. +OPENSSL_EXPORT bool SSL_get_traffic_secrets( + const SSL *ssl, Span *out_read_traffic_secret, + Span *out_write_traffic_secret); + +BSSL_NAMESPACE_END } // extern C++ @@ -4639,6 +4987,22 @@ OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); #define SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI 285 #define SSL_R_SERVER_ECHOED_INVALID_SESSION_ID 286 #define SSL_R_PRIVATE_KEY_OPERATION_FAILED 287 +#define SSL_R_SECOND_SERVERHELLO_VERSION_MISMATCH 288 +#define SSL_R_OCSP_CB_ERROR 289 +#define SSL_R_SSL_SESSION_ID_TOO_LONG 290 +#define SSL_R_APPLICATION_DATA_ON_SHUTDOWN 291 +#define SSL_R_CERT_DECOMPRESSION_FAILED 292 +#define SSL_R_UNCOMPRESSED_CERT_TOO_LARGE 293 +#define SSL_R_UNKNOWN_CERT_COMPRESSION_ALG 294 +#define SSL_R_INVALID_SIGNATURE_ALGORITHM 295 +#define SSL_R_DUPLICATE_SIGNATURE_ALGORITHM 296 +#define SSL_R_TLS13_DOWNGRADE 297 +#define SSL_R_QUIC_INTERNAL_ERROR 298 +#define SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED 299 +#define SSL_R_TOO_MUCH_READ_EARLY_DATA 300 +#define SSL_R_INVALID_DELEGATED_CREDENTIAL 301 +#define SSL_R_KEY_USAGE_BIT_INCORRECT 302 +#define SSL_R_INCONSISTENT_CLIENT_HELLO 303 #define SSL_R_SSLV3_ALERT_CLOSE_NOTIFY 1000 #define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 #define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 @@ -4671,6 +5035,5 @@ OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); #define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 #define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115 #define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116 -#define SSL_R_TOO_MUCH_READ_EARLY_DATA 1117 #endif // OPENSSL_HEADER_SSL_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ssl.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.grpc_back similarity index 83% rename from Pods/BoringSSL-GRPC/include/openssl/ssl.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.grpc_back index b377c4528..858ccfaf5 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ssl.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ssl.h.grpc_back @@ -185,7 +185,7 @@ extern "C" { // multiple threads. Once shared, functions which change the |SSL_CTX|'s // configuration may not be used. -// TLS_method is the |SSL_METHOD| used for TLS (and SSLv3) connections. +// TLS_method is the |SSL_METHOD| used for TLS connections. OPENSSL_EXPORT const SSL_METHOD *TLS_method(void); // DTLS_method is the |SSL_METHOD| used for DTLS connections. @@ -394,20 +394,43 @@ OPENSSL_EXPORT int SSL_pending(const SSL *ssl); // https://crbug.com/466303. OPENSSL_EXPORT int SSL_write(SSL *ssl, const void *buf, int num); -// SSL_shutdown shuts down |ssl|. On success, it completes in two stages. First, -// it returns 0 if |ssl| completed uni-directional shutdown; close_notify has -// been sent, but the peer's close_notify has not been received. Most callers -// may stop at this point. For bi-directional shutdown, call |SSL_shutdown| -// again. It returns 1 if close_notify has been both sent and received. -// -// If the peer's close_notify arrived first, the first stage is skipped. -// |SSL_shutdown| will return 1 once close_notify is sent and skip 0. Callers -// only interested in uni-directional shutdown must therefore allow for the -// first stage returning either 0 or 1. +// SSL_KEY_UPDATE_REQUESTED indicates that the peer should reply to a KeyUpdate +// message with its own, thus updating traffic secrets for both directions on +// the connection. +#define SSL_KEY_UPDATE_REQUESTED 1 + +// SSL_KEY_UPDATE_NOT_REQUESTED indicates that the peer should not reply with +// it's own KeyUpdate message. +#define SSL_KEY_UPDATE_NOT_REQUESTED 0 + +// SSL_key_update queues a TLS 1.3 KeyUpdate message to be sent on |ssl| +// if one is not already queued. The |request_type| argument must one of the +// |SSL_KEY_UPDATE_*| values. This function requires that |ssl| have completed a +// TLS >= 1.3 handshake. It returns one on success or zero on error. +// +// Note that this function does not _send_ the message itself. The next call to +// |SSL_write| will cause the message to be sent. |SSL_write| may be called with +// a zero length to flush a KeyUpdate message when no application data is +// pending. +OPENSSL_EXPORT int SSL_key_update(SSL *ssl, int request_type); + +// SSL_shutdown shuts down |ssl|. It runs in two stages. First, it sends +// close_notify and returns zero or one on success or -1 on failure. Zero +// indicates that close_notify was sent, but not received, and one additionally +// indicates that the peer's close_notify had already been received. +// +// To then wait for the peer's close_notify, run |SSL_shutdown| to completion a +// second time. This returns 1 on success and -1 on failure. Application data +// is considered a fatal error at this point. To process or discard it, read +// until close_notify with |SSL_read| instead. +// +// In both cases, on failure, pass the return value into |SSL_get_error| to +// determine how to proceed. // -// |SSL_shutdown| returns -1 on failure. The caller should pass the return value -// into |SSL_get_error| to determine how to proceed. If the underlying |BIO| is -// non-blocking, both stages may require retry. +// Most callers should stop at the first stage. Reading for close_notify is +// primarily used for uncommon protocols where the underlying transport is +// reused after TLS completes. Additionally, DTLS uses an unordered transport +// and is unordered, so the second stage is a no-op in DTLS. OPENSSL_EXPORT int SSL_shutdown(SSL *ssl); // SSL_CTX_set_quiet_shutdown sets quiet shutdown on |ctx| to |mode|. If @@ -535,6 +558,19 @@ OPENSSL_EXPORT int SSL_get_error(const SSL *ssl, int ret_code); #define SSL_ERROR_WANT_CERTIFICATE_VERIFY 16 #define SSL_ERROR_HANDOFF 17 +#define SSL_ERROR_HANDBACK 18 + +// SSL_ERROR_WANT_RENEGOTIATE indicates the operation is pending a response to +// a renegotiation request from the server. The caller may call +// |SSL_renegotiate| to schedule a renegotiation and retry the operation. +// +// See also |ssl_renegotiate_explicit|. +#define SSL_ERROR_WANT_RENEGOTIATE 19 + +// SSL_error_description returns a string representation of |err|, where |err| +// is one of the |SSL_ERROR_*| constants returned by |SSL_get_error|, or NULL +// if the value is unrecognized. +OPENSSL_EXPORT const char *SSL_error_description(int err); // SSL_set_mtu sets the |ssl|'s MTU in DTLS to |mtu|. It returns one on success // and zero on failure. @@ -595,8 +631,6 @@ OPENSSL_EXPORT int DTLSv1_handle_timeout(SSL *ssl); #define DTLS1_VERSION 0xfeff #define DTLS1_2_VERSION 0xfefd -#define TLS1_3_DRAFT23_VERSION 0x7f17 - // SSL_CTX_set_min_proto_version sets the minimum protocol version for |ctx| to // |version|. If |version| is zero, the default minimum version is used. It // returns one on success and zero if |version| is invalid. @@ -609,6 +643,12 @@ OPENSSL_EXPORT int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, OPENSSL_EXPORT int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version); +// SSL_CTX_get_min_proto_version returns the minimum protocol version for |ctx| +OPENSSL_EXPORT uint16_t SSL_CTX_get_min_proto_version(const SSL_CTX *ctx); + +// SSL_CTX_get_max_proto_version returns the maximum protocol version for |ctx| +OPENSSL_EXPORT uint16_t SSL_CTX_get_max_proto_version(const SSL_CTX *ctx); + // SSL_set_min_proto_version sets the minimum protocol version for |ssl| to // |version|. If |version| is zero, the default minimum version is used. It // returns one on success and zero if |version| is invalid. @@ -619,6 +659,14 @@ OPENSSL_EXPORT int SSL_set_min_proto_version(SSL *ssl, uint16_t version); // returns one on success and zero if |version| is invalid. OPENSSL_EXPORT int SSL_set_max_proto_version(SSL *ssl, uint16_t version); +// SSL_get_min_proto_version returns the minimum protocol version for |ssl|. If +// the connection's configuration has been shed, 0 is returned. +OPENSSL_EXPORT uint16_t SSL_get_min_proto_version(const SSL *ssl); + +// SSL_get_max_proto_version returns the maximum protocol version for |ssl|. If +// the connection's configuration has been shed, 0 is returned. +OPENSSL_EXPORT uint16_t SSL_get_max_proto_version(const SSL *ssl); + // SSL_version returns the TLS or DTLS protocol version used by |ssl|, which is // one of the |*_VERSION| values. (E.g. |TLS1_2_VERSION|.) Before the version // is negotiated, the result is undefined. @@ -644,7 +692,6 @@ OPENSSL_EXPORT int SSL_version(const SSL *ssl); // The following flags toggle individual protocol versions. This is deprecated. // Use |SSL_CTX_set_min_proto_version| and |SSL_CTX_set_max_proto_version| // instead. -#define SSL_OP_NO_SSLv3 0x02000000L #define SSL_OP_NO_TLSv1 0x04000000L #define SSL_OP_NO_TLSv1_2 0x08000000L #define SSL_OP_NO_TLSv1_1 0x10000000L @@ -715,10 +762,10 @@ OPENSSL_EXPORT uint32_t SSL_get_options(const SSL *ssl); // and |SSL_CB_HANDSHAKE_DONE| from |SSL_CTX_set_info_callback|. #define SSL_MODE_ENABLE_FALSE_START 0x00000080L -// SSL_MODE_CBC_RECORD_SPLITTING causes multi-byte CBC records in SSL 3.0 and -// TLS 1.0 to be split in two: the first record will contain a single byte and -// the second will contain the remainder. This effectively randomises the IV and -// prevents BEAST attacks. +// SSL_MODE_CBC_RECORD_SPLITTING causes multi-byte CBC records in TLS 1.0 to be +// split in two: the first record will contain a single byte and the second will +// contain the remainder. This effectively randomises the IV and prevents BEAST +// attacks. #define SSL_MODE_CBC_RECORD_SPLITTING 0x00000100L // SSL_MODE_NO_SESSION_CREATION will cause any attempts to create a session to @@ -860,8 +907,9 @@ OPENSSL_EXPORT int SSL_clear_chain_certs(SSL *ssl); // |SSL_get_client_CA_list| for information on the server's certificate // request. // -// On the server, the callback will be called on non-resumption handshakes, -// after extensions have been processed. +// On the server, the callback will be called after extensions have been +// processed, but before the resumption decision has been made. This differs +// from OpenSSL which handles resumption before selecting the certificate. OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), void *arg); @@ -874,19 +922,37 @@ OPENSSL_EXPORT void SSL_CTX_set_cert_cb(SSL_CTX *ctx, // On the client, the callback may call |SSL_get0_certificate_types| and // |SSL_get_client_CA_list| for information on the server's certificate // request. +// +// On the server, the callback will be called after extensions have been +// processed, but before the resumption decision has been made. This differs +// from OpenSSL which handles resumption before selecting the certificate. OPENSSL_EXPORT void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg); // SSL_get0_certificate_types, for a client, sets |*out_types| to an array // containing the client certificate types requested by a server. It returns the -// length of the array. +// length of the array. Note this list is always empty in TLS 1.3. The server +// will instead send signature algorithms. See +// |SSL_get0_peer_verify_algorithms|. // // The behavior of this function is undefined except during the callbacks set by // by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the // handshake is paused because of them. -OPENSSL_EXPORT size_t SSL_get0_certificate_types(SSL *ssl, +OPENSSL_EXPORT size_t SSL_get0_certificate_types(const SSL *ssl, const uint8_t **out_types); +// SSL_get0_peer_verify_algorithms sets |*out_sigalgs| to an array containing +// the signature algorithms the peer is able to verify. It returns the length of +// the array. Note these values are only sent starting TLS 1.2 and only +// mandatory starting TLS 1.3. If not sent, the empty array is returned. For the +// historical client certificate types list, see |SSL_get0_certificate_types|. +// +// The behavior of this function is undefined except during the callbacks set by +// by |SSL_CTX_set_cert_cb| and |SSL_CTX_set_client_cert_cb| or when the +// handshake is paused because of them. +OPENSSL_EXPORT size_t +SSL_get0_peer_verify_algorithms(const SSL *ssl, const uint16_t **out_sigalgs); + // SSL_certs_clear resets the private key, leaf certificate, and certificate // chain of |ssl|. OPENSSL_EXPORT void SSL_certs_clear(SSL *ssl); @@ -968,9 +1034,9 @@ OPENSSL_EXPORT int SSL_set_ocsp_response(SSL *ssl, #define SSL_SIGN_ECDSA_SECP256R1_SHA256 0x0403 #define SSL_SIGN_ECDSA_SECP384R1_SHA384 0x0503 #define SSL_SIGN_ECDSA_SECP521R1_SHA512 0x0603 -#define SSL_SIGN_RSA_PSS_SHA256 0x0804 -#define SSL_SIGN_RSA_PSS_SHA384 0x0805 -#define SSL_SIGN_RSA_PSS_SHA512 0x0806 +#define SSL_SIGN_RSA_PSS_RSAE_SHA256 0x0804 +#define SSL_SIGN_RSA_PSS_RSAE_SHA384 0x0805 +#define SSL_SIGN_RSA_PSS_RSAE_SHA512 0x0806 #define SSL_SIGN_ED25519 0x0807 // SSL_SIGN_RSA_PKCS1_MD5_SHA1 is an internal signature algorithm used to @@ -1114,7 +1180,7 @@ OPENSSL_EXPORT void *SSL_CTX_get_default_passwd_cb_userdata(const SSL_CTX *ctx); // Custom private keys. -enum ssl_private_key_result_t { +enum ssl_private_key_result_t BORINGSSL_ENUM_INT { ssl_private_key_success, ssl_private_key_retry, ssl_private_key_failure, @@ -1196,10 +1262,14 @@ DEFINE_CONST_STACK_OF(SSL_CIPHER) // https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-4. OPENSSL_EXPORT const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value); -// SSL_CIPHER_get_id returns |cipher|'s id. It may be cast to a |uint16_t| to -// get the cipher suite value. +// SSL_CIPHER_get_id returns |cipher|'s non-IANA id. This is not its +// IANA-assigned number, which is called the "value" here, although it may be +// cast to a |uint16_t| to get it. OPENSSL_EXPORT uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *cipher); +// SSL_CIPHER_get_value returns |cipher|'s IANA-assigned number. +OPENSSL_EXPORT uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *cipher); + // SSL_CIPHER_is_aead returns one if |cipher| uses an AEAD cipher. OPENSSL_EXPORT int SSL_CIPHER_is_aead(const SSL_CIPHER *cipher); @@ -1250,7 +1320,8 @@ OPENSSL_EXPORT uint16_t SSL_CIPHER_get_max_version(const SSL_CIPHER *cipher); OPENSSL_EXPORT const char *SSL_CIPHER_standard_name(const SSL_CIPHER *cipher); // SSL_CIPHER_get_name returns the OpenSSL name of |cipher|. For example, -// "ECDHE-RSA-AES128-GCM-SHA256". +// "ECDHE-RSA-AES128-GCM-SHA256". Callers are recommended to use +// |SSL_CIPHER_standard_name| instead. OPENSSL_EXPORT const char *SSL_CIPHER_get_name(const SSL_CIPHER *cipher); // SSL_CIPHER_get_kx_name returns a string that describes the key-exchange @@ -1317,11 +1388,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, // whose bulk cipher use the corresponding encryption scheme. Note that // |AES|, |AES128|, and |AES256| match both CBC and GCM ciphers. // -// |SHA1|, |SHA256|, and |SHA384| match legacy cipher suites using the -// corresponding hash function in their MAC. AEADs are matched by none of -// these. -// -// |SHA| is an alias for |SHA1|. +// |SHA1|, and its alias |SHA|, match legacy cipher suites using HMAC-SHA1. // // Although implemented, authentication-only ciphers match no rules and must be // explicitly selected by name. @@ -1357,7 +1424,7 @@ OPENSSL_EXPORT int SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, // based on client preferences. An equal-preference is specified with square // brackets, combining multiple selectors separated by |. For example: // -// [ECDHE-ECDSA-CHACHA20-POLY1305|ECDHE-ECDSA-AES128-GCM-SHA256] +// [TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256|TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256] // // Once an equal-preference group is used, future directives must be // opcode-less. Inside an equal-preference group, spaces are not allowed. @@ -1460,7 +1527,7 @@ OPENSSL_EXPORT STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl); // verification. The caller does not take ownership of the result. // // This is the |CRYPTO_BUFFER| variant of |SSL_get_peer_full_cert_chain|. -OPENSSL_EXPORT STACK_OF(CRYPTO_BUFFER) * +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * SSL_get0_peer_certificates(const SSL *ssl); // SSL_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to point to @@ -1507,8 +1574,8 @@ OPENSSL_EXPORT int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, // TLS 1.3 was negotiated. Otherwise, it returns zero. OPENSSL_EXPORT int SSL_get_extms_support(const SSL *ssl); -// SSL_get_current_cipher returns the cipher used in the current outgoing -// connection state, or NULL if the null cipher is active. +// SSL_get_current_cipher returns cipher suite used by |ssl|, or NULL if it has +// not been negotiated yet. OPENSSL_EXPORT const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl); // SSL_session_reused returns one if |ssl| performed an abbreviated handshake @@ -1533,92 +1600,6 @@ OPENSSL_EXPORT int SSL_export_keying_material( const uint8_t *context, size_t context_len, int use_context); -// Custom extensions. -// -// The custom extension functions allow TLS extensions to be added to -// ClientHello and ServerHello messages. - -// SSL_custom_ext_add_cb is a callback function that is called when the -// ClientHello (for clients) or ServerHello (for servers) is constructed. In -// the case of a server, this callback will only be called for a given -// extension if the ClientHello contained that extension – it's not possible to -// inject extensions into a ServerHello that the client didn't request. -// -// When called, |extension_value| will contain the extension number that is -// being considered for addition (so that a single callback can handle multiple -// extensions). If the callback wishes to include the extension, it must set -// |*out| to point to |*out_len| bytes of extension contents and return one. In -// this case, the corresponding |SSL_custom_ext_free_cb| callback will later be -// called with the value of |*out| once that data has been copied. -// -// If the callback does not wish to add an extension it must return zero. -// -// Alternatively, the callback can abort the connection by setting -// |*out_alert_value| to a TLS alert number and returning -1. -typedef int (*SSL_custom_ext_add_cb)(SSL *ssl, unsigned extension_value, - const uint8_t **out, size_t *out_len, - int *out_alert_value, void *add_arg); - -// SSL_custom_ext_free_cb is a callback function that is called by OpenSSL iff -// an |SSL_custom_ext_add_cb| callback previously returned one. In that case, -// this callback is called and passed the |out| pointer that was returned by -// the add callback. This is to free any dynamically allocated data created by -// the add callback. -typedef void (*SSL_custom_ext_free_cb)(SSL *ssl, unsigned extension_value, - const uint8_t *out, void *add_arg); - -// SSL_custom_ext_parse_cb is a callback function that is called by OpenSSL to -// parse an extension from the peer: that is from the ServerHello for a client -// and from the ClientHello for a server. -// -// When called, |extension_value| will contain the extension number and the -// contents of the extension are |contents_len| bytes at |contents|. -// -// The callback must return one to continue the handshake. Otherwise, if it -// returns zero, a fatal alert with value |*out_alert_value| is sent and the -// handshake is aborted. -typedef int (*SSL_custom_ext_parse_cb)(SSL *ssl, unsigned extension_value, - const uint8_t *contents, - size_t contents_len, - int *out_alert_value, void *parse_arg); - -// SSL_extension_supported returns one iff OpenSSL internally handles -// extensions of type |extension_value|. This can be used to avoid registering -// custom extension handlers for extensions that a future version of OpenSSL -// may handle internally. -OPENSSL_EXPORT int SSL_extension_supported(unsigned extension_value); - -// SSL_CTX_add_client_custom_ext registers callback functions for handling -// custom TLS extensions for client connections. -// -// If |add_cb| is NULL then an empty extension will be added in each -// ClientHello. Otherwise, see the comment for |SSL_custom_ext_add_cb| about -// this callback. -// -// The |free_cb| may be NULL if |add_cb| doesn't dynamically allocate data that -// needs to be freed. -// -// It returns one on success or zero on error. It's always an error to register -// callbacks for the same extension twice, or to register callbacks for an -// extension that OpenSSL handles internally. See |SSL_extension_supported| to -// discover, at runtime, which extensions OpenSSL handles internally. -OPENSSL_EXPORT int SSL_CTX_add_client_custom_ext( - SSL_CTX *ctx, unsigned extension_value, SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, void *parse_arg); - -// SSL_CTX_add_server_custom_ext is the same as -// |SSL_CTX_add_client_custom_ext|, but for server connections. -// -// Unlike on the client side, if |add_cb| is NULL no extension will be added. -// The |add_cb|, if any, will only be called if the ClientHello contained a -// matching extension. -OPENSSL_EXPORT int SSL_CTX_add_server_custom_ext( - SSL_CTX *ctx, unsigned extension_value, SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, void *parse_arg); - - // Sessions. // // An |SSL_SESSION| represents an SSL session that may be resumed in an @@ -1660,7 +1641,7 @@ OPENSSL_EXPORT SSL_SESSION *SSL_SESSION_from_bytes( const uint8_t *in, size_t in_len, const SSL_CTX *ctx); // SSL_SESSION_get_version returns a string describing the TLS or DTLS version -// |session| was established at. For example, "TLSv1.2" or "SSLv3". +// |session| was established at. For example, "TLSv1.2" or "DTLSv1". OPENSSL_EXPORT const char *SSL_SESSION_get_version(const SSL_SESSION *session); // SSL_SESSION_get_protocol_version returns the TLS or DTLS version |session| @@ -1674,11 +1655,20 @@ SSL_SESSION_get_protocol_version(const SSL_SESSION *session); OPENSSL_EXPORT int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version); +// SSL_MAX_SSL_SESSION_ID_LENGTH is the maximum length of an SSL session ID. +#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 + // SSL_SESSION_get_id returns a pointer to a buffer containing |session|'s // session ID and sets |*out_len| to its length. OPENSSL_EXPORT const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, unsigned *out_len); +// SSL_SESSION_set1_id sets |session|'s session ID to |sid|, It returns one on +// success and zero on error. This function may be useful in writing tests but +// otherwise should not be used. +OPENSSL_EXPORT int SSL_SESSION_set1_id(SSL_SESSION *session, const uint8_t *sid, + size_t sid_len); + // SSL_SESSION_get_time returns the time at which |session| was established in // seconds since the UNIX epoch. OPENSSL_EXPORT uint64_t SSL_SESSION_get_time(const SSL_SESSION *session); @@ -1692,6 +1682,36 @@ OPENSSL_EXPORT uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session); // TODO(davidben): This should return a const X509 *. OPENSSL_EXPORT X509 *SSL_SESSION_get0_peer(const SSL_SESSION *session); +// SSL_SESSION_get0_peer_certificates returns the peer certificate chain stored +// in |session|, or NULL if the peer did not use certificates. This is the +// unverified list of certificates as sent by the peer, not the final chain +// built during verification. The caller does not take ownership of the result. +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * + SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session); + +// SSL_SESSION_get0_signed_cert_timestamp_list sets |*out| and |*out_len| to +// point to |*out_len| bytes of SCT information stored in |session|. This is +// only valid for client sessions. The SCT information is a +// SignedCertificateTimestampList (including the two leading length bytes). See +// https://tools.ietf.org/html/rfc6962#section-3.3 If no SCT was received then +// |*out_len| will be zero on return. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT void SSL_SESSION_get0_signed_cert_timestamp_list( + const SSL_SESSION *session, const uint8_t **out, size_t *out_len); + +// SSL_SESSION_get0_ocsp_response sets |*out| and |*out_len| to point to +// |*out_len| bytes of an OCSP response from the server. This is the DER +// encoding of an OCSPResponse type as defined in RFC 2560. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT void SSL_SESSION_get0_ocsp_response(const SSL_SESSION *session, + const uint8_t **out, + size_t *out_len); + +// SSL_MAX_MASTER_KEY_LENGTH is the maximum length of a master secret. +#define SSL_MAX_MASTER_KEY_LENGTH 48 + // SSL_SESSION_get_master_key writes up to |max_out| bytes of |session|'s master // secret to |out| and returns the number of bytes written. If |max_out| is // zero, it returns the size of the master secret. @@ -1710,6 +1730,12 @@ OPENSSL_EXPORT uint64_t SSL_SESSION_set_time(SSL_SESSION *session, OPENSSL_EXPORT uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout); +// SSL_SESSION_get0_id_context returns a pointer to a buffer containing +// |session|'s session ID context (see |SSL_CTX_set_session_id_context|) and +// sets |*out_len| to its length. +OPENSSL_EXPORT const uint8_t *SSL_SESSION_get0_id_context( + const SSL_SESSION *session, unsigned *out_len); + // SSL_SESSION_set1_id_context sets |session|'s session ID context (see // |SSL_CTX_set_session_id_context|) to |sid_ctx|. It returns one on success and // zero on error. This function may be useful in writing tests but otherwise @@ -1723,8 +1749,8 @@ OPENSSL_EXPORT int SSL_SESSION_set1_id_context(SSL_SESSION *session, // // If this function returns one, clients retain multiple sessions and use each // only once. This prevents passive observers from correlating connections with -// tickets. See draft-ietf-tls-tls13-18, appendix B.5. If it returns zero, -// |session| cannot be used without leaking a correlator. +// tickets. See RFC 8446, appendix C.4. If it returns zero, |session| cannot be +// used without leaking a correlator. OPENSSL_EXPORT int SSL_SESSION_should_be_single_use(const SSL_SESSION *session); // SSL_SESSION_is_resumable returns one if |session| is resumable and zero @@ -1742,11 +1768,40 @@ OPENSSL_EXPORT void SSL_SESSION_get0_ticket(const SSL_SESSION *session, const uint8_t **out_ticket, size_t *out_len); +// SSL_SESSION_set_ticket sets |session|'s ticket to |ticket|. It returns one on +// success and zero on error. This function may be useful in writing tests but +// otherwise should not be used. +OPENSSL_EXPORT int SSL_SESSION_set_ticket(SSL_SESSION *session, + const uint8_t *ticket, + size_t ticket_len); + // SSL_SESSION_get_ticket_lifetime_hint returns ticket lifetime hint of // |session| in seconds or zero if none was set. OPENSSL_EXPORT uint32_t SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session); +// SSL_SESSION_get0_cipher returns the cipher negotiated by the connection which +// established |session|. +// +// Note that, in TLS 1.3, there is no guarantee that resumptions with |session| +// will use that cipher. Prefer calling |SSL_get_current_cipher| on the |SSL| +// instead. +OPENSSL_EXPORT const SSL_CIPHER *SSL_SESSION_get0_cipher( + const SSL_SESSION *session); + +// SSL_SESSION_has_peer_sha256 returns one if |session| has a SHA-256 hash of +// the peer's certificate retained and zero if the peer did not present a +// certificate or if this was not enabled when |session| was created. See also +// |SSL_CTX_set_retain_only_sha256_of_client_certs|. +OPENSSL_EXPORT int SSL_SESSION_has_peer_sha256(const SSL_SESSION *session); + +// SSL_SESSION_get0_peer_sha256 sets |*out_ptr| and |*out_len| to the SHA-256 +// hash of the peer certificate retained in |session|, or NULL and zero if it +// does not have one. See also |SSL_CTX_set_retain_only_sha256_of_client_certs|. +OPENSSL_EXPORT void SSL_SESSION_get0_peer_sha256(const SSL_SESSION *session, + const uint8_t **out_ptr, + size_t *out_len); + // Session caching. // @@ -1830,7 +1885,11 @@ OPENSSL_EXPORT int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx); // SSL_set_session, for a client, configures |ssl| to offer to resume |session| // in the initial handshake and returns one. The caller retains ownership of -// |session|. +// |session|. Note that configuring a session assumes the authentication in the +// session is valid. For callers that wish to revalidate the session before +// offering, see |SSL_SESSION_get0_peer_certificates|, +// |SSL_SESSION_get0_signed_cert_timestamp_list|, and +// |SSL_SESSION_get0_ocsp_response|. // // It is an error to call this function after the handshake has begun. OPENSSL_EXPORT int SSL_set_session(SSL *ssl, SSL_SESSION *session); @@ -1863,6 +1922,9 @@ OPENSSL_EXPORT void SSL_CTX_set_session_psk_dhe_timeout(SSL_CTX *ctx, // sessions created in |ctx|. OPENSSL_EXPORT uint32_t SSL_CTX_get_timeout(const SSL_CTX *ctx); +// SSL_MAX_SID_CTX_LENGTH is the maximum length of a session ID context. +#define SSL_MAX_SID_CTX_LENGTH 32 + // SSL_CTX_set_session_id_context sets |ctx|'s session ID context to |sid_ctx|. // It returns one on success and zero on error. The session ID context is an // application-defined opaque byte string. A session will not be used in a @@ -1881,7 +1943,7 @@ OPENSSL_EXPORT int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, size_t sid_ctx_len); // SSL_get0_session_id_context returns a pointer to |ssl|'s session ID context -// and sets |*out_len| to its length. +// and sets |*out_len| to its length. It returns NULL on error. OPENSSL_EXPORT const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len); @@ -2002,13 +2064,13 @@ OPENSSL_EXPORT SSL_SESSION *SSL_magic_pending_session_ptr(void); // On the client, ticket-based sessions use the same APIs as ID-based tickets. // Callers do not need to handle them differently. // -// On the server, tickets are encrypted and authenticated with a secret key. By -// default, an |SSL_CTX| generates a key on creation and uses it for the -// lifetime of the |SSL_CTX|. Tickets are minted and processed -// transparently. The following functions may be used to configure a persistent -// key or implement more custom behavior, including key rotation and sharing -// keys between multiple servers in a large deployment. There are three levels -// of customisation possible: +// On the server, tickets are encrypted and authenticated with a secret key. +// By default, an |SSL_CTX| will manage session ticket encryption keys by +// generating them internally and rotating every 48 hours. Tickets are minted +// and processed transparently. The following functions may be used to configure +// a persistent key or implement more custom behavior, including key rotation +// and sharing keys between multiple servers in a large deployment. There are +// three levels of customisation possible: // // 1) One can simply set the keys with |SSL_CTX_set_tlsext_ticket_keys|. // 2) One can configure an |EVP_CIPHER_CTX| and |HMAC_CTX| directly for @@ -2074,7 +2136,7 @@ OPENSSL_EXPORT int SSL_CTX_set_tlsext_ticket_key_cb( // ssl_ticket_aead_result_t enumerates the possible results from decrypting a // ticket with an |SSL_TICKET_AEAD_METHOD|. -enum ssl_ticket_aead_result_t { +enum ssl_ticket_aead_result_t BORINGSSL_ENUM_INT { // ssl_ticket_aead_success indicates that the ticket was successfully // decrypted. ssl_ticket_aead_success, @@ -2168,6 +2230,7 @@ OPENSSL_EXPORT int SSL_set1_curves_list(SSL *ssl, const char *curves); #define SSL_CURVE_SECP384R1 24 #define SSL_CURVE_SECP521R1 25 #define SSL_CURVE_X25519 29 +#define SSL_CURVE_CECPQ2 16696 // SSL_get_curve_id returns the ID of the curve used by |ssl|'s most recently // completed handshake or 0 if not applicable. @@ -2247,7 +2310,7 @@ OPENSSL_EXPORT void SSL_set_verify(SSL *ssl, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)); -enum ssl_verify_result_t { +enum ssl_verify_result_t BORINGSSL_ENUM_INT { ssl_verify_ok, ssl_verify_invalid, ssl_verify_retry, @@ -2285,7 +2348,7 @@ OPENSSL_EXPORT void SSL_set_custom_verify( OPENSSL_EXPORT int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); // SSL_get_verify_mode returns |ssl|'s verify mode, set by |SSL_CTX_set_verify| -// or |SSL_set_verify|. +// or |SSL_set_verify|. It returns -1 on error. OPENSSL_EXPORT int SSL_get_verify_mode(const SSL *ssl); // SSL_CTX_get_verify_callback returns the callback set by @@ -2456,10 +2519,12 @@ OPENSSL_EXPORT int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store); OPENSSL_EXPORT int SSL_set1_verify_cert_store(SSL *ssl, X509_STORE *store); // SSL_CTX_set_ed25519_enabled configures whether |ctx| advertises support for -// the Ed25519 signature algorithm when using the default preference list. +// the Ed25519 signature algorithm when using the default preference list. It is +// disabled by default and may be enabled if the certificate verifier supports +// Ed25519. OPENSSL_EXPORT void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled); -// SSL_CTX_set_verify_algorithm_prefs confingures |ctx| to use |prefs| as the +// SSL_CTX_set_verify_algorithm_prefs configures |ctx| to use |prefs| as the // preference list when verifying signature's from the peer's long-term key. It // returns one on zero on error. |prefs| should not include the internal-only // value |SSL_SIGN_RSA_PKCS1_MD5_SHA1|. @@ -2513,8 +2578,8 @@ OPENSSL_EXPORT STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl); // // The returned stack is owned by |ssl|, as are its contents. It should not be // used past the point where the handshake is restarted after the callback. -OPENSSL_EXPORT STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs( - const SSL *ssl); +OPENSSL_EXPORT const STACK_OF(CRYPTO_BUFFER) * + SSL_get0_server_requested_CAs(const SSL *ssl); // SSL_CTX_get_client_CA_list returns |ctx|'s client certificate CA list. OPENSSL_EXPORT STACK_OF(X509_NAME) * @@ -2669,6 +2734,54 @@ OPENSSL_EXPORT void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled); +// Certificate compression. +// +// Certificates in TLS 1.3 can be compressed[1]. BoringSSL supports this as both +// a client and a server, but does not link against any specific compression +// libraries in order to keep dependencies to a minimum. Instead, hooks for +// compression and decompression can be installed in an |SSL_CTX| to enable +// support. +// +// [1] https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03. + +// ssl_cert_compression_func_t is a pointer to a function that performs +// compression. It must write the compressed representation of |in| to |out|, +// returning one on success and zero on error. The results of compressing +// certificates are not cached internally. Implementations may wish to implement +// their own cache if they expect it to be useful given the certificates that +// they serve. +typedef int (*ssl_cert_compression_func_t)(SSL *ssl, CBB *out, + const uint8_t *in, size_t in_len); + +// ssl_cert_decompression_func_t is a pointer to a function that performs +// decompression. The compressed data from the peer is passed as |in| and the +// decompressed result must be exactly |uncompressed_len| bytes long. It returns +// one on success, in which case |*out| must be set to the result of +// decompressing |in|, or zero on error. Setting |*out| transfers ownership, +// i.e. |CRYPTO_BUFFER_free| will be called on |*out| at some point in the +// future. The results of decompressions are not cached internally. +// Implementations may wish to implement their own cache if they expect it to be +// useful. +typedef int (*ssl_cert_decompression_func_t)(SSL *ssl, CRYPTO_BUFFER **out, + size_t uncompressed_len, + const uint8_t *in, size_t in_len); + +// SSL_CTX_add_cert_compression_alg registers a certificate compression +// algorithm on |ctx| with ID |alg_id|. (The value of |alg_id| should be an IANA +// assigned value and each can only be registered once.) +// +// One of the function pointers may be NULL to avoid having to implement both +// sides of a compression algorithm if you're only going to use it in one +// direction. In this case, the unimplemented direction acts like it was never +// configured. +// +// For a server, algorithms are registered in preference order with the most +// preferable first. It returns one on success or zero on error. +OPENSSL_EXPORT int SSL_CTX_add_cert_compression_alg( + SSL_CTX *ctx, uint16_t alg_id, ssl_cert_compression_func_t compress, + ssl_cert_decompression_func_t decompress); + + // Next protocol negotiation. // // The NPN extension (draft-agl-tls-nextprotoneg-03) is the predecessor to ALPN @@ -2938,27 +3051,7 @@ OPENSSL_EXPORT const char *SSL_get_psk_identity_hint(const SSL *ssl); OPENSSL_EXPORT const char *SSL_get_psk_identity(const SSL *ssl); -// Dummy post-quantum padding. -// -// Dummy post-quantum padding invovles the client (and later server) sending -// useless, random-looking bytes in an extension in their ClientHello or -// ServerHello. These extensions are sized to simulate a post-quantum -// key-exchange and so enable measurement of the latency impact of the -// additional bandwidth. - -// SSL_set_dummy_pq_padding_size enables the sending of a dummy PQ padding -// extension and configures its size. This is only effective for a client: a -// server will echo an extension with one of equal length when we get to that -// phase of the experiment. It returns one for success and zero otherwise. -OPENSSL_EXPORT int SSL_set_dummy_pq_padding_size(SSL *ssl, size_t num_bytes); - -// SSL_dummy_pq_padding_used returns one if the server echoed a dummy PQ padding -// extension and zero otherwise. It may only be called on a client connection -// once the ServerHello has been processed, otherwise it'll return zero. -OPENSSL_EXPORT int SSL_dummy_pq_padding_used(SSL *ssl); - - -// QUIC Transport Parameters. +// QUIC transport parameters. // // draft-ietf-quic-tls defines a new TLS extension quic_transport_parameters // used by QUIC for each endpoint to unilaterally declare its supported @@ -2990,6 +3083,176 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, size_t *out_params_len); +// Delegated credentials. +// +// *** EXPERIMENTAL — PRONE TO CHANGE *** +// +// draft-ietf-tls-subcerts is a proposed extension for TLS 1.3 and above that +// allows an end point to use its certificate to delegate credentials for +// authentication. If the peer indicates support for this extension, then this +// host may use a delegated credential to sign the handshake. Once issued, +// credentials can't be revoked. In order to mitigate the damage in case the +// credential secret key is compromised, the credential is only valid for a +// short time (days, hours, or even minutes). This library implements draft-03 +// of the protocol spec. +// +// The extension ID has not been assigned; we're using 0xff02 for the time +// being. Currently only the server side is implemented. +// +// Servers configure a DC for use in the handshake via +// |SSL_set1_delegated_credential|. It must be signed by the host's end-entity +// certificate as defined in draft-ietf-tls-subcerts-03. + +// SSL_set1_delegated_credential configures the delegated credential (DC) that +// will be sent to the peer for the current connection. |dc| is the DC in wire +// format, and |pkey| or |key_method| is the corresponding private key. +// Currently (as of draft-03), only servers may configure a DC to use in the +// handshake. +// +// The DC will only be used if the protocol version is correct and the signature +// scheme is supported by the peer. If not, the DC will not be negotiated and +// the handshake will use the private key (or private key method) associated +// with the certificate. +OPENSSL_EXPORT int SSL_set1_delegated_credential( + SSL *ssl, CRYPTO_BUFFER *dc, EVP_PKEY *pkey, + const SSL_PRIVATE_KEY_METHOD *key_method); + +// SSL_delegated_credential_used returns one if a delegated credential was used +// and zero otherwise. +OPENSSL_EXPORT int SSL_delegated_credential_used(const SSL *ssl); + + +// QUIC integration. +// +// QUIC acts as an underlying transport for the TLS 1.3 handshake. The following +// functions allow a QUIC implementation to serve as the underlying transport as +// described in draft-ietf-quic-tls. +// +// When configured for QUIC, |SSL_do_handshake| will drive the handshake as +// before, but it will not use the configured |BIO|. It will call functions on +// |SSL_QUIC_METHOD| to configure secrets and send data. If data is needed from +// the peer, it will return |SSL_ERROR_WANT_READ|. When received, the caller +// should call |SSL_provide_quic_data| and then |SSL_do_handshake| to continue +// the handshake. After the handshake is complete, the caller should call +// |SSL_provide_quic_data| for any post-handshake data, followed by +// |SSL_process_quic_post_handshake| to process it. It is an error to call +// |SSL_read| and |SSL_write| in QUIC. +// +// 0-RTT behaves similarly to |TLS_method|'s usual behavior. |SSL_do_handshake| +// returns early as soon as the client (respectively, server) is allowed to send +// 0-RTT (respectively, half-RTT) data. The caller should then call +// |SSL_do_handshake| again to consume the remaining handshake messages and +// confirm the handshake. As a client, |SSL_ERROR_EARLY_DATA_REJECTED| and +// |SSL_reset_early_data_reject| behave as usual. +// +// Note that secrets for an encryption level may be available to QUIC before the +// level is active in TLS. Callers should use |SSL_quic_read_level| to determine +// the active read level for |SSL_provide_quic_data|. |SSL_do_handshake| will +// pass the active write level to |SSL_QUIC_METHOD| when writing data. Callers +// can use |SSL_quic_write_level| to query the active write level when +// generating their own errors. +// +// See https://tools.ietf.org/html/draft-ietf-quic-tls-15#section-4.1 for more +// details. +// +// To avoid DoS attacks, the QUIC implementation must limit the amount of data +// being queued up. The implementation can call +// |SSL_quic_max_handshake_flight_len| to get the maximum buffer length at each +// encryption level. +// +// Note: 0-RTT support is incomplete and does not currently handle QUIC +// transport parameters and server SETTINGS frame. + +// ssl_encryption_level_t represents a specific QUIC encryption level used to +// transmit handshake messages. +enum ssl_encryption_level_t BORINGSSL_ENUM_INT { + ssl_encryption_initial = 0, + ssl_encryption_early_data, + ssl_encryption_handshake, + ssl_encryption_application, +}; + +// ssl_quic_method_st (aka |SSL_QUIC_METHOD|) describes custom QUIC hooks. +struct ssl_quic_method_st { + // set_encryption_secrets configures the read and write secrets for the given + // encryption level. This function will always be called before an encryption + // level other than |ssl_encryption_initial| is used. Note, however, that + // secrets for a level may be configured before TLS is ready to send or accept + // data at that level. + // + // When reading packets at a given level, the QUIC implementation must send + // ACKs at the same level, so this function provides read and write secrets + // together. The exception is |ssl_encryption_early_data|, where secrets are + // only available in the client to server direction. The other secret will be + // NULL. The server acknowledges such data at |ssl_encryption_application|, + // which will be configured in the same |SSL_do_handshake| call. + // + // This function should use |SSL_get_current_cipher| to determine the TLS + // cipher suite. + // + // It returns one on success and zero on error. + int (*set_encryption_secrets)(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *read_secret, + const uint8_t *write_secret, size_t secret_len); + // add_handshake_data adds handshake data to the current flight at the given + // encryption level. It returns one on success and zero on error. + // + // BoringSSL will pack data from a single encryption level together, but a + // single handshake flight may include multiple encryption levels. Callers + // should defer writing data to the network until |flush_flight| to better + // pack QUIC packets into transport datagrams. + int (*add_handshake_data)(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *data, size_t len); + // flush_flight is called when the current flight is complete and should be + // written to the transport. Note a flight may contain data at several + // encryption levels. It returns one on success and zero on error. + int (*flush_flight)(SSL *ssl); + // send_alert sends a fatal alert at the specified encryption level. It + // returns one on success and zero on error. + int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level, uint8_t alert); +}; + +// SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes +// that may be received at the given encryption level. This function should be +// used to limit buffering in the QUIC implementation. +// +// See https://tools.ietf.org/html/draft-ietf-quic-transport-16#section-4.4. +OPENSSL_EXPORT size_t SSL_quic_max_handshake_flight_len( + const SSL *ssl, enum ssl_encryption_level_t level); + +// SSL_quic_read_level returns the current read encryption level. +OPENSSL_EXPORT enum ssl_encryption_level_t SSL_quic_read_level(const SSL *ssl); + +// SSL_quic_write_level returns the current write encryption level. +OPENSSL_EXPORT enum ssl_encryption_level_t SSL_quic_write_level(const SSL *ssl); + +// SSL_provide_quic_data provides data from QUIC at a particular encryption +// level |level|. It is an error to call this function outside of the handshake +// or with an encryption level other than the current read level. It returns one +// on success and zero on error. +OPENSSL_EXPORT int SSL_provide_quic_data(SSL *ssl, + enum ssl_encryption_level_t level, + const uint8_t *data, size_t len); + + +// SSL_process_quic_post_handshake processes any data that QUIC has provided +// after the handshake has completed. This includes NewSessionTicket messages +// sent by the server. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_process_quic_post_handshake(SSL *ssl); + +// SSL_CTX_set_quic_method configures the QUIC hooks. This should only be +// configured with a minimum version of TLS 1.3. |quic_method| must remain valid +// for the lifetime of |ctx|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_CTX_set_quic_method(SSL_CTX *ctx, + const SSL_QUIC_METHOD *quic_method); + +// SSL_set_quic_method configures the QUIC hooks. This should only be +// configured with a minimum version of TLS 1.3. |quic_method| must remain valid +// for the lifetime of |ssl|. It returns one on success and zero on error. +OPENSSL_EXPORT int SSL_set_quic_method(SSL *ssl, + const SSL_QUIC_METHOD *quic_method); + + // Early data. // // WARNING: 0-RTT support in BoringSSL is currently experimental and not fully @@ -3002,8 +3265,8 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, // WARNING: A 0-RTT handshake has different security properties from normal // handshake, so it is off by default unless opted in. In particular, early data // is replayable by a network attacker. Callers must account for this when -// sending or processing data before the handshake is confirmed. See -// draft-ietf-tls-tls13-18 for more information. +// sending or processing data before the handshake is confirmed. See RFC 8446 +// for more information. // // As a server, if early data is accepted, |SSL_do_handshake| will complete as // soon as the ClientHello is processed and server flight sent. |SSL_write| may @@ -3038,9 +3301,9 @@ OPENSSL_EXPORT void SSL_get_peer_quic_transport_params(const SSL *ssl, // properties. The caller must disregard any values from before the reset and // query again. // -// Finally, to implement the fallback described in draft-ietf-tls-tls13-18 -// appendix C.3, retry on a fresh connection without 0-RTT if the handshake -// fails with |SSL_R_WRONG_VERSION_ON_EARLY_DATA|. +// Finally, to implement the fallback described in RFC 8446 appendix D.3, retry +// on a fresh connection without 0-RTT if the handshake fails with +// |SSL_R_WRONG_VERSION_ON_EARLY_DATA|. // SSL_CTX_set_early_data_enabled sets whether early data is allowed to be used // with resumptions using |ctx|. @@ -3058,6 +3321,10 @@ OPENSSL_EXPORT void SSL_set_early_data_enabled(SSL *ssl, int enabled); // and |SSL_write| to send half-RTT data. OPENSSL_EXPORT int SSL_in_early_data(const SSL *ssl); +// SSL_SESSION_early_data_capable returns whether early data would have been +// attempted with |session| if enabled. +OPENSSL_EXPORT int SSL_SESSION_early_data_capable(const SSL_SESSION *session); + // SSL_early_data_accepted returns whether early data was accepted on the // handshake performed by |ssl|. OPENSSL_EXPORT int SSL_early_data_accepted(const SSL *ssl); @@ -3071,21 +3338,59 @@ OPENSSL_EXPORT int SSL_early_data_accepted(const SSL *ssl); // |SSL_ERROR_EARLY_DATA_REJECTED|. OPENSSL_EXPORT void SSL_reset_early_data_reject(SSL *ssl); -// SSL_export_early_keying_material behaves like |SSL_export_keying_material|, -// but it uses the early exporter. The operation will fail if |ssl| did not -// negotiate TLS 1.3 or 0-RTT. -OPENSSL_EXPORT int SSL_export_early_keying_material( - SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, - const uint8_t *context, size_t context_len); +// SSL_get_ticket_age_skew returns the difference, in seconds, between the +// client-sent ticket age and the server-computed value in TLS 1.3 server +// connections which resumed a session. +OPENSSL_EXPORT int32_t SSL_get_ticket_age_skew(const SSL *ssl); + +// An ssl_early_data_reason_t describes why 0-RTT was accepted or rejected. +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum ssl_early_data_reason_t BORINGSSL_ENUM_INT { + // The handshake has not progressed far enough for the 0-RTT status to be + // known. + ssl_early_data_unknown = 0, + // 0-RTT is disabled for this connection. + ssl_early_data_disabled = 1, + // 0-RTT was accepted. + ssl_early_data_accepted = 2, + // The negotiated protocol version does not support 0-RTT. + ssl_early_data_protocol_version = 3, + // The peer declined to offer or accept 0-RTT for an unknown reason. + ssl_early_data_peer_declined = 4, + // The client did not offer a session. + ssl_early_data_no_session_offered = 5, + // The server declined to resume the session. + ssl_early_data_session_not_resumed = 6, + // The session does not support 0-RTT. + ssl_early_data_unsupported_for_session = 7, + // The server sent a HelloRetryRequest. + ssl_early_data_hello_retry_request = 8, + // The negotiated ALPN protocol did not match the session. + ssl_early_data_alpn_mismatch = 9, + // The connection negotiated Channel ID, which is incompatible with 0-RTT. + ssl_early_data_channel_id = 10, + // The connection negotiated token binding, which is incompatible with 0-RTT. + ssl_early_data_token_binding = 11, + // The client and server ticket age were too far apart. + ssl_early_data_ticket_age_skew = 12, + // The value of the largest entry. + ssl_early_data_reason_max_value = ssl_early_data_ticket_age_skew, +}; + +// SSL_get_early_data_reason returns details why 0-RTT was accepted or rejected +// on |ssl|. This is primarily useful on the server. +OPENSSL_EXPORT enum ssl_early_data_reason_t SSL_get_early_data_reason( + const SSL *ssl); // Alerts. // -// TLS and SSL 3.0 use alerts to signal error conditions. Alerts have a type -// (warning or fatal) and description. OpenSSL internally handles fatal alerts -// with dedicated error codes (see |SSL_AD_REASON_OFFSET|). Except for -// close_notify, warning alerts are silently ignored and may only be surfaced -// with |SSL_CTX_set_info_callback|. +// TLS uses alerts to signal error conditions. Alerts have a type (warning or +// fatal) and description. OpenSSL internally handles fatal alerts with +// dedicated error codes (see |SSL_AD_REASON_OFFSET|). Except for close_notify, +// warning alerts are silently ignored and may only be surfaced with +// |SSL_CTX_set_info_callback|. // SSL_AD_REASON_OFFSET is the offset between error reasons and |SSL_AD_*| // values. Any error code under |ERR_LIB_SSL| with an error reason above this @@ -3096,7 +3401,7 @@ OPENSSL_EXPORT int SSL_export_early_keying_material( // This value must be kept in sync with reservedReasonCode in make_errors.h #define SSL_AD_REASON_OFFSET 1000 -// SSL_AD_* are alert descriptions for SSL 3.0 and TLS. +// SSL_AD_* are alert descriptions. #define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY #define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE #define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC @@ -3104,7 +3409,7 @@ OPENSSL_EXPORT int SSL_export_early_keying_material( #define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW #define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE #define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE -#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE // Not used in TLS +#define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE // Legacy SSL 3.0 value #define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE #define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE #define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED @@ -3184,7 +3489,7 @@ OPENSSL_EXPORT int SSL_CTX_get_ex_new_index(long argl, void *argp, // SSL_get_ivs sets |*out_iv_len| to the length of the IVs for the ciphers // underlying |ssl| and sets |*out_read_iv| and |*out_write_iv| to point to the // current IVs for the read and write directions. This is only meaningful for -// connections with implicit IVs (i.e. CBC mode with SSLv3 or TLS 1.0). +// connections with implicit IVs (i.e. CBC mode with TLS 1.0). // // It returns one on success or zero on error. OPENSSL_EXPORT int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, @@ -3213,13 +3518,6 @@ OPENSSL_EXPORT uint64_t SSL_get_write_sequence(const SSL *ssl); // Obscure functions. -// SSL_get_structure_sizes returns the sizes of the SSL, SSL_CTX and -// SSL_SESSION structures so that a test can ensure that outside code agrees on -// these values. -OPENSSL_EXPORT void SSL_get_structure_sizes(size_t *ssl_size, - size_t *ssl_ctx_size, - size_t *ssl_session_size); - // SSL_CTX_set_msg_callback installs |cb| as the message callback for |ctx|. // This callback will be called when sending or receiving low-level record // headers, complete handshake messages, ChangeCipherSpec, and alerts. @@ -3276,11 +3574,32 @@ OPENSSL_EXPORT void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))( OPENSSL_EXPORT void SSL_CTX_set_current_time_cb( SSL_CTX *ctx, void (*cb)(const SSL *ssl, struct timeval *out_clock)); -enum ssl_renegotiate_mode_t { +// SSL_set_shed_handshake_config allows some of the configuration of |ssl| to be +// freed after its handshake completes. Once configuration has been shed, APIs +// that query it may fail. "Configuration" in this context means anything that +// was set by the caller, as distinct from information derived from the +// handshake. For example, |SSL_get_ciphers| queries how the |SSL| was +// configured by the caller, and fails after configuration has been shed, +// whereas |SSL_get_cipher| queries the result of the handshake, and is +// unaffected by configuration shedding. +// +// If configuration shedding is enabled, it is an error to call |SSL_clear|. +// +// Note that configuration shedding as a client additionally depends on +// renegotiation being disabled (see |SSL_set_renegotiate_mode|). If +// renegotiation is possible, the configuration will be retained. If +// configuration shedding is enabled and renegotiation later disabled after the +// handshake, |SSL_set_renegotiate_mode| will shed configuration then. This may +// be useful for clients which support renegotiation with some ALPN protocols, +// such as HTTP/1.1, and not others, such as HTTP/2. +OPENSSL_EXPORT void SSL_set_shed_handshake_config(SSL *ssl, int enable); + +enum ssl_renegotiate_mode_t BORINGSSL_ENUM_INT { ssl_renegotiate_never = 0, ssl_renegotiate_once, ssl_renegotiate_freely, ssl_renegotiate_ignore, + ssl_renegotiate_explicit, }; // SSL_set_renegotiate_mode configures how |ssl|, a client, reacts to @@ -3294,11 +3613,35 @@ enum ssl_renegotiate_mode_t { // Note that ignoring HelloRequest messages may cause the connection to stall // if the server waits for the renegotiation to complete. // +// If set to |ssl_renegotiate_explicit|, |SSL_read| and |SSL_peek| calls which +// encounter a HelloRequest will pause with |SSL_ERROR_WANT_RENEGOTIATE|. +// |SSL_write| will continue to work while paused. The caller may call +// |SSL_renegotiate| to begin the renegotiation at a later point. This mode may +// be used if callers wish to eagerly call |SSL_peek| without triggering a +// renegotiation. +// +// If configuration shedding is enabled (see |SSL_set_shed_handshake_config|), +// configuration is released if, at any point after the handshake, renegotiation +// is disabled. It is not possible to switch from disabling renegotiation to +// enabling it on a given connection. Callers that condition renegotiation on, +// e.g., ALPN must enable renegotiation before the handshake and conditionally +// disable it afterwards. +// // There is no support in BoringSSL for initiating renegotiations as a client // or server. OPENSSL_EXPORT void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode); +// SSL_renegotiate starts a deferred renegotiation on |ssl| if it was configured +// with |ssl_renegotiate_explicit| and has a pending HelloRequest. It returns +// one on success and zero on error. +// +// This function does not do perform any I/O. On success, a subsequent +// |SSL_do_handshake| call will run the handshake. |SSL_write| and +// |SSL_read| will also complete the handshake before sending or receiving +// application data. +OPENSSL_EXPORT int SSL_renegotiate(SSL *ssl); + // SSL_renegotiate_pending returns one if |ssl| is in the middle of a // renegotiation. OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *ssl); @@ -3307,22 +3650,6 @@ OPENSSL_EXPORT int SSL_renegotiate_pending(SSL *ssl); // performed by |ssl|. This includes the pending renegotiation, if any. OPENSSL_EXPORT int SSL_total_renegotiations(const SSL *ssl); -enum tls13_variant_t { - tls13_default = 0, -}; - -// SSL_CTX_set_tls13_variant sets which variant of TLS 1.3 we negotiate. On the -// server, if |variant| is not |tls13_default|, all variants are enabled. On the -// client, only the configured variant is enabled. -OPENSSL_EXPORT void SSL_CTX_set_tls13_variant(SSL_CTX *ctx, - enum tls13_variant_t variant); - -// SSL_set_tls13_variant sets which variant of TLS 1.3 we negotiate. On the -// server, if |variant| is not |tls13_default|, all variants are enabled. On the -// client, only the configured variant is enabled. -OPENSSL_EXPORT void SSL_set_tls13_variant(SSL *ssl, - enum tls13_variant_t variant); - // SSL_MAX_CERT_LIST_DEFAULT is the default maximum length, in bytes, of a peer // certificate chain. #define SSL_MAX_CERT_LIST_DEFAULT (1024 * 100) @@ -3383,7 +3710,7 @@ typedef struct ssl_early_callback_ctx { // ssl_select_cert_result_t enumerates the possible results from selecting a // certificate with |select_certificate_cb|. -enum ssl_select_cert_result_t { +enum ssl_select_cert_result_t BORINGSSL_ENUM_INT { // ssl_select_cert_success indicates that the certificate selection was // successful. ssl_select_cert_success = 1, @@ -3414,6 +3741,8 @@ OPENSSL_EXPORT int SSL_early_callback_ctx_extension_get( // high-level operation on |ssl| to be retried at a later time, which will // result in another call to |cb|. // +// |SSL_get_servername| may be used during this callback. +// // Note: The |SSL_CLIENT_HELLO| is only valid for the duration of the callback // and is not valid while the handshake is paused. OPENSSL_EXPORT void SSL_CTX_set_select_certificate_cb( @@ -3426,14 +3755,33 @@ OPENSSL_EXPORT void SSL_CTX_set_select_certificate_cb( OPENSSL_EXPORT void SSL_CTX_set_dos_protection_cb( SSL_CTX *ctx, int (*cb)(const SSL_CLIENT_HELLO *)); -// SSL_ST_* are possible values for |SSL_state| and the bitmasks that make them -// up. +// SSL_CTX_set_reverify_on_resume configures whether the certificate +// verification callback will be used to reverify stored certificates +// when resuming a session. This only works with |SSL_CTX_set_custom_verify|. +// For now, this is incompatible with |SSL_VERIFY_NONE| mode, and is only +// respected on clients. +OPENSSL_EXPORT void SSL_CTX_set_reverify_on_resume(SSL_CTX *ctx, int enabled); + +// SSL_set_enforce_rsa_key_usage configures whether the keyUsage extension of +// RSA leaf certificates will be checked for consistency with the TLS +// usage. This parameter may be set late; it will not be read until after the +// certificate verification callback. +OPENSSL_EXPORT void SSL_set_enforce_rsa_key_usage(SSL *ssl, int enabled); + +// SSL_ST_* are possible values for |SSL_state|, the bitmasks that make them up, +// and some historical values for compatibility. Only |SSL_ST_INIT| and +// |SSL_ST_OK| are ever returned. #define SSL_ST_CONNECT 0x1000 #define SSL_ST_ACCEPT 0x2000 #define SSL_ST_MASK 0x0FFF #define SSL_ST_INIT (SSL_ST_CONNECT | SSL_ST_ACCEPT) #define SSL_ST_OK 0x03 #define SSL_ST_RENEGOTIATE (0x04 | SSL_ST_INIT) +#define SSL_ST_BEFORE (0x05 | SSL_ST_INIT) + +// TLS_ST_* are aliases for |SSL_ST_*| for OpenSSL 1.1.0 compatibility. +#define TLS_ST_OK SSL_ST_OK +#define TLS_ST_BEFORE SSL_ST_BEFORE // SSL_CB_* are possible values for the |type| parameter in the info // callback and the bitmasks that make them up. @@ -3537,7 +3885,8 @@ OPENSSL_EXPORT const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl); // the SHA-256 hash of peer's certificate should be saved in memory and in the // session. This can save memory, ticket size and session cache space. If // enabled, |SSL_get_peer_certificate| will return NULL after the handshake -// completes. See the |peer_sha256| field of |SSL_SESSION| for the hash. +// completes. See |SSL_SESSION_has_peer_sha256| and +// |SSL_SESSION_get0_peer_sha256| to query the hash. OPENSSL_EXPORT void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enable); @@ -3545,7 +3894,8 @@ OPENSSL_EXPORT void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, // only the SHA-256 hash of peer's certificate should be saved in memory and in // the session. This can save memory, ticket size and session cache space. If // enabled, |SSL_get_peer_certificate| will return NULL after the handshake -// completes. See the |peer_sha256| field of |SSL_SESSION| for the hash. +// completes. See |SSL_SESSION_has_peer_sha256| and +// |SSL_SESSION_get0_peer_sha256| to query the hash. OPENSSL_EXPORT void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enable); @@ -3557,20 +3907,37 @@ OPENSSL_EXPORT void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled); // record with |ssl|. OPENSSL_EXPORT size_t SSL_max_seal_overhead(const SSL *ssl); -// SSL_get_ticket_age_skew returns the difference, in seconds, between the -// client-sent ticket age and the server-computed value in TLS 1.3 server -// connections which resumed a session. -OPENSSL_EXPORT int32_t SSL_get_ticket_age_skew(const SSL *ssl); - // SSL_CTX_set_false_start_allowed_without_alpn configures whether connections // on |ctx| may use False Start (if |SSL_MODE_ENABLE_FALSE_START| is enabled) // without negotiating ALPN. OPENSSL_EXPORT void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed); -// SSL_is_draft_downgrade returns one if the TLS 1.3 anti-downgrade mechanism -// would have aborted |ssl|'s handshake and zero otherwise. -OPENSSL_EXPORT int SSL_is_draft_downgrade(const SSL *ssl); +// SSL_CTX_set_ignore_tls13_downgrade configures whether connections on |ctx| +// ignore the downgrade signal in the server's random value. +OPENSSL_EXPORT void SSL_CTX_set_ignore_tls13_downgrade(SSL_CTX *ctx, + int ignore); + +// SSL_set_ignore_tls13_downgrade configures whether |ssl| ignores the downgrade +// signal in the server's random value. +OPENSSL_EXPORT void SSL_set_ignore_tls13_downgrade(SSL *ssl, int ignore); + +// SSL_is_tls13_downgrade returns one if the TLS 1.3 anti-downgrade +// mechanism would have aborted |ssl|'s handshake and zero otherwise. +OPENSSL_EXPORT int SSL_is_tls13_downgrade(const SSL *ssl); + +// SSL_used_hello_retry_request returns one if the TLS 1.3 HelloRetryRequest +// message has been either sent by the server or received by the client. It +// returns zero otherwise. +OPENSSL_EXPORT int SSL_used_hello_retry_request(const SSL *ssl); + +// SSL_set_jdk11_workaround configures whether to workaround various bugs in +// JDK 11's TLS 1.3 implementation by disabling TLS 1.3 for such clients. +// +// https://bugs.openjdk.java.net/browse/JDK-8211806 +// https://bugs.openjdk.java.net/browse/JDK-8212885 +// https://bugs.openjdk.java.net/browse/JDK-8213202 +OPENSSL_EXPORT void SSL_set_jdk11_workaround(SSL *ssl, int enable); // Deprecated functions. @@ -3722,17 +4089,14 @@ OPENSSL_EXPORT int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa); // SSL_CTX_get_read_ahead returns zero. OPENSSL_EXPORT int SSL_CTX_get_read_ahead(const SSL_CTX *ctx); -// SSL_CTX_set_read_ahead does nothing. -OPENSSL_EXPORT void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); +// SSL_CTX_set_read_ahead returns one. +OPENSSL_EXPORT int SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes); // SSL_get_read_ahead returns zero. OPENSSL_EXPORT int SSL_get_read_ahead(const SSL *ssl); -// SSL_set_read_ahead does nothing. -OPENSSL_EXPORT void SSL_set_read_ahead(SSL *ssl, int yes); - -// SSL_renegotiate put an error on the error queue and returns zero. -OPENSSL_EXPORT int SSL_renegotiate(SSL *ssl); +// SSL_set_read_ahead returns one. +OPENSSL_EXPORT int SSL_set_read_ahead(SSL *ssl, int yes); // SSL_set_state does nothing. OPENSSL_EXPORT void SSL_set_state(SSL *ssl, int state); @@ -3741,6 +4105,11 @@ OPENSSL_EXPORT void SSL_set_state(SSL *ssl, int state); // pointer to |buf|, or NULL if |len| is less than or equal to zero. OPENSSL_EXPORT char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len); +// SSL_get_shared_sigalgs returns zero. +OPENSSL_EXPORT int SSL_get_shared_sigalgs(SSL *ssl, int idx, int *psign, + int *phash, int *psignandhash, + uint8_t *rsig, uint8_t *rhash); + // SSL_MODE_HANDSHAKE_CUTTHROUGH is the same as SSL_MODE_ENABLE_FALSE_START. #define SSL_MODE_HANDSHAKE_CUTTHROUGH SSL_MODE_ENABLE_FALSE_START @@ -3800,7 +4169,7 @@ OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_compression(SSL *ssl); OPENSSL_EXPORT const COMP_METHOD *SSL_get_current_expansion(SSL *ssl); // SSL_get_server_tmp_key returns zero. -OPENSSL_EXPORT int *SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key); +OPENSSL_EXPORT int SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key); // SSL_CTX_set_tmp_dh returns 1. OPENSSL_EXPORT int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh); @@ -3817,6 +4186,53 @@ OPENSSL_EXPORT void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, int keylength)); +// SSL_CTX_set1_sigalgs takes |num_values| ints and interprets them as pairs +// where the first is the nid of a hash function and the second is an +// |EVP_PKEY_*| value. It configures the signature algorithm preferences for +// |ctx| based on them and returns one on success or zero on error. +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *values, + size_t num_values); + +// SSL_set1_sigalgs takes |num_values| ints and interprets them as pairs where +// the first is the nid of a hash function and the second is an |EVP_PKEY_*| +// value. It configures the signature algorithm preferences for |ssl| based on +// them and returns one on success or zero on error. +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_set1_sigalgs(SSL *ssl, const int *values, + size_t num_values); + +// SSL_CTX_set1_sigalgs_list takes a textual specification of a set of signature +// algorithms and configures them on |ctx|. It returns one on success and zero +// on error. See +// https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set1_sigalgs_list.html for +// a description of the text format. Also note that TLS 1.3 names (e.g. +// "rsa_pkcs1_md5_sha1") can also be used (as in OpenSSL, although OpenSSL +// doesn't document that). +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str); + +// SSL_set1_sigalgs_list takes a textual specification of a set of signature +// algorithms and configures them on |ssl|. It returns one on success and zero +// on error. See +// https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set1_sigalgs_list.html for +// a description of the text format. Also note that TLS 1.3 names (e.g. +// "rsa_pkcs1_md5_sha1") can also be used (as in OpenSSL, although OpenSSL +// doesn't document that). +// +// This API is compatible with OpenSSL. However, BoringSSL-specific code should +// prefer |SSL_CTX_set_signing_algorithm_prefs| because it's clearer and it's +// more convenient to codesearch for specific algorithm values. +OPENSSL_EXPORT int SSL_set1_sigalgs_list(SSL *ssl, const char *str); #define SSL_set_app_data(s, arg) (SSL_set_ex_data(s, 0, (char *)(arg))) #define SSL_get_app_data(s) (SSL_get_ex_data(s, 0)) @@ -3870,8 +4286,10 @@ DEFINE_STACK_OF(SSL_COMP) #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0 #define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0 #define SSL_OP_NO_COMPRESSION 0 +#define SSL_OP_NO_RENEGOTIATION 0 // ssl_renegotiate_never is the default #define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0 #define SSL_OP_NO_SSLv2 0 +#define SSL_OP_NO_SSLv3 0 #define SSL_OP_PKCS1_CHECK_1 0 #define SSL_OP_PKCS1_CHECK_2 0 #define SSL_OP_SINGLE_DH_USE 0 @@ -3890,7 +4308,7 @@ OPENSSL_EXPORT int SSL_cache_hit(SSL *ssl); OPENSSL_EXPORT long SSL_get_default_timeout(const SSL *ssl); // SSL_get_version returns a string describing the TLS version used by |ssl|. -// For example, "TLSv1.2" or "SSLv3". +// For example, "TLSv1.2" or "DTLSv1". OPENSSL_EXPORT const char *SSL_get_version(const SSL *ssl); // SSL_get_cipher_list returns the name of the |n|th cipher in the output of @@ -3914,18 +4332,9 @@ OPENSSL_EXPORT const char *SSL_get_cipher_list(const SSL *ssl, int n); OPENSSL_EXPORT void SSL_CTX_set_client_cert_cb( SSL_CTX *ctx, int (*cb)(SSL *ssl, X509 **out_x509, EVP_PKEY **out_pkey)); -#define SSL_NOTHING 1 -#define SSL_WRITING 2 -#define SSL_READING 3 -#define SSL_X509_LOOKUP 4 -#define SSL_CHANNEL_ID_LOOKUP 5 -#define SSL_PENDING_SESSION 7 -#define SSL_CERTIFICATE_SELECTION_PENDING 8 -#define SSL_PRIVATE_KEY_OPERATION 9 -#define SSL_PENDING_TICKET 10 -#define SSL_EARLY_DATA_REJECTED 11 -#define SSL_CERTIFICATE_VERIFY 12 -#define SSL_HANDOFF 13 +#define SSL_NOTHING SSL_ERROR_NONE +#define SSL_WRITING SSL_ERROR_WANT_WRITE +#define SSL_READING SSL_ERROR_WANT_READ // SSL_want returns one of the above values to determine what the most recent // operation on |ssl| was blocked on. Use |SSL_get_error| instead. @@ -3936,15 +4345,15 @@ OPENSSL_EXPORT int SSL_want(const SSL *ssl); // SSL_get_finished writes up to |count| bytes of the Finished message sent by // |ssl| to |buf|. It returns the total untruncated length or zero if none has - // been sent yet. At SSL 3.0 or TLS 1.3 and later, it returns zero. + // been sent yet. At TLS 1.3 and later, it returns zero. // // Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count); // SSL_get_peer_finished writes up to |count| bytes of the Finished message // received from |ssl|'s peer to |buf|. It returns the total untruncated length - // or zero if none has been received yet. At SSL 3.0 or TLS 1.3 and later, it - // returns zero. + // or zero if none has been received yet. At TLS 1.3 and later, it returns + // zero. // // Use |SSL_get_tls_unique| instead. OPENSSL_EXPORT size_t SSL_get_peer_finished(const SSL *ssl, void *buf, @@ -4103,158 +4512,78 @@ OPENSSL_EXPORT SSL_SESSION *SSL_get1_session(SSL *ssl); OPENSSL_EXPORT int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings); -#if !defined(BORINGSSL_NO_CXX) -// SSL_CTX_sess_set_get_cb is a legacy C++ overload of |SSL_CTX_sess_set_get_cb| -// which supports the old callback signature. -// -// TODO(davidben): Remove this once Node is compatible with OpenSSL 1.1.0. -extern "C++" OPENSSL_EXPORT void SSL_CTX_sess_set_get_cb( - SSL_CTX *ctx, SSL_SESSION *(*get_session_cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)); -#endif - +// The following constants are legacy aliases for RSA-PSS with rsaEncryption +// keys. Use the new names instead. +#define SSL_SIGN_RSA_PSS_SHA256 SSL_SIGN_RSA_PSS_RSAE_SHA256 +#define SSL_SIGN_RSA_PSS_SHA384 SSL_SIGN_RSA_PSS_RSAE_SHA384 +#define SSL_SIGN_RSA_PSS_SHA512 SSL_SIGN_RSA_PSS_RSAE_SHA512 -// Private structures. +// SSL_set_tlsext_status_type configures a client to request OCSP stapling if +// |type| is |TLSEXT_STATUSTYPE_ocsp| and disables it otherwise. It returns one +// on success and zero if handshake configuration has already been shed. // -// This structures are exposed for historical reasons, but access to them is -// deprecated. +// Use |SSL_enable_ocsp_stapling| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_type(SSL *ssl, int type); -// TODO(davidben): Remove this forward declaration when |SSL_SESSION| is opaque. -typedef struct ssl_x509_method_st SSL_X509_METHOD; +// SSL_get_tlsext_status_type returns |TLSEXT_STATUSTYPE_ocsp| if the client +// requested OCSP stapling and |TLSEXT_STATUSTYPE_nothing| otherwise. On the +// client, this reflects whether OCSP stapling was enabled via, e.g., +// |SSL_set_tlsext_status_type|. On the server, this is determined during the +// handshake. It may be queried in callbacks set by |SSL_CTX_set_cert_cb|. The +// result is undefined after the handshake completes. +OPENSSL_EXPORT int SSL_get_tlsext_status_type(const SSL *ssl); -#define SSL_MAX_SSL_SESSION_ID_LENGTH 32 -#define SSL_MAX_SID_CTX_LENGTH 32 -#define SSL_MAX_MASTER_KEY_LENGTH 48 - -struct ssl_session_st { - CRYPTO_refcount_t references; - uint16_t ssl_version; // what ssl version session info is being kept in here? - - // group_id is the ID of the ECDH group used to establish this session or zero - // if not applicable or unknown. - uint16_t group_id; - - // peer_signature_algorithm is the signature algorithm used to authenticate - // the peer, or zero if not applicable or unknown. - uint16_t peer_signature_algorithm; - - // master_key, in TLS 1.2 and below, is the master secret associated with the - // session. In TLS 1.3 and up, it is the resumption secret. - int master_key_length; - uint8_t master_key[SSL_MAX_MASTER_KEY_LENGTH]; - - // session_id - valid? - unsigned int session_id_length; - uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; - // this is used to determine whether the session is being reused in - // the appropriate context. It is up to the application to set this, - // via SSL_new - uint8_t sid_ctx_length; - uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - - char *psk_identity; - - // certs contains the certificate chain from the peer, starting with the leaf - // certificate. - STACK_OF(CRYPTO_BUFFER) *certs; - - const SSL_X509_METHOD *x509_method; - - // x509_peer is the peer's certificate. - X509 *x509_peer; - - // x509_chain is the certificate chain sent by the peer. NOTE: for historical - // reasons, when a client (so the peer is a server), the chain includes - // |peer|, but when a server it does not. - STACK_OF(X509) *x509_chain; - - // x509_chain_without_leaf is a lazily constructed copy of |x509_chain| that - // omits the leaf certificate. This exists because OpenSSL, historically, - // didn't include the leaf certificate in the chain for a server, but did for - // a client. The |x509_chain| always includes it and, if an API call requires - // a chain without, it is stored here. - STACK_OF(X509) *x509_chain_without_leaf; - - // verify_result is the result of certificate verification in the case of - // non-fatal certificate errors. - long verify_result; - - // timeout is the lifetime of the session in seconds, measured from |time|. - // This is renewable up to |auth_timeout|. - uint32_t timeout; - - // auth_timeout is the non-renewable lifetime of the session in seconds, - // measured from |time|. - uint32_t auth_timeout; - - // time is the time the session was issued, measured in seconds from the UNIX - // epoch. - uint64_t time; - - const SSL_CIPHER *cipher; - - CRYPTO_EX_DATA ex_data; // application specific data - - // These are used to make removal of session-ids more efficient and to - // implement a maximum cache size. - SSL_SESSION *prev, *next; - - // RFC4507 info - uint8_t *tlsext_tick; // Session ticket - size_t tlsext_ticklen; // Session ticket length - - CRYPTO_BUFFER *signed_cert_timestamp_list; - - // The OCSP response that came with the session. - CRYPTO_BUFFER *ocsp_response; - - // peer_sha256 contains the SHA-256 hash of the peer's certificate if - // |peer_sha256_valid| is true. - uint8_t peer_sha256[SHA256_DIGEST_LENGTH]; - - // original_handshake_hash contains the handshake hash (either SHA-1+MD5 or - // SHA-2, depending on TLS version) for the original, full handshake that - // created a session. This is used by Channel IDs during resumption. - uint8_t original_handshake_hash[EVP_MAX_MD_SIZE]; - uint8_t original_handshake_hash_len; - - uint32_t tlsext_tick_lifetime_hint; // Session lifetime hint in seconds - - uint32_t ticket_age_add; - - // ticket_max_early_data is the maximum amount of data allowed to be sent as - // early data. If zero, 0-RTT is disallowed. - uint32_t ticket_max_early_data; - - // early_alpn is the ALPN protocol from the initial handshake. This is only - // stored for TLS 1.3 and above in order to enforce ALPN matching for 0-RTT - // resumptions. - uint8_t *early_alpn; - size_t early_alpn_len; - - // extended_master_secret is true if the master secret in this session was - // generated using EMS and thus isn't vulnerable to the Triple Handshake - // attack. - unsigned extended_master_secret:1; - - // peer_sha256_valid is non-zero if |peer_sha256| is valid. - unsigned peer_sha256_valid:1; // Non-zero if peer_sha256 is valid - - // not_resumable is used to indicate that session resumption is disallowed. - unsigned not_resumable:1; - - // ticket_age_add_valid is non-zero if |ticket_age_add| is valid. - unsigned ticket_age_add_valid:1; +// SSL_set_tlsext_status_ocsp_resp sets the OCSP response. It returns one on +// success and zero on error. On success, |ssl| takes ownership of |resp|, which +// must have been allocated by |OPENSSL_malloc|. +// +// Use |SSL_set_ocsp_response| instead. +OPENSSL_EXPORT int SSL_set_tlsext_status_ocsp_resp(SSL *ssl, uint8_t *resp, + size_t resp_len); - // is_server is true if this session was created by a server. - unsigned is_server:1; -}; +// SSL_get_tlsext_status_ocsp_resp sets |*out| to point to the OCSP response +// from the server. It returns the length of the response. If there was no +// response, it sets |*out| to NULL and returns zero. +// +// Use |SSL_get0_ocsp_response| instead. +// +// WARNING: the returned data is not guaranteed to be well formed. +OPENSSL_EXPORT size_t SSL_get_tlsext_status_ocsp_resp(const SSL *ssl, + const uint8_t **out); + +// SSL_CTX_set_tlsext_status_cb configures the legacy OpenSSL OCSP callback and +// returns one. Though the type signature is the same, this callback has +// different behavior for client and server connections: +// +// For clients, the callback is called after certificate verification. It should +// return one for success, zero for a bad OCSP response, and a negative number +// for internal error. Instead, handle this as part of certificate verification. +// (Historically, OpenSSL verified certificates just before parsing stapled OCSP +// responses, but BoringSSL fixes this ordering. All server credentials are +// available during verification.) +// +// Do not use this callback as a server. It is provided for compatibility +// purposes only. For servers, it is called to configure server credentials. It +// should return |SSL_TLSEXT_ERR_OK| on success, |SSL_TLSEXT_ERR_NOACK| to +// ignore OCSP requests, or |SSL_TLSEXT_ERR_ALERT_FATAL| on error. It is usually +// used to fetch OCSP responses on demand, which is not ideal. Instead, treat +// OCSP responses like other server credentials, such as certificates or SCT +// lists. Configure, store, and refresh them eagerly. This avoids downtime if +// the CA's OCSP responder is briefly offline. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, + int (*callback)(SSL *ssl, + void *arg)); + +// SSL_CTX_set_tlsext_status_arg sets additional data for +// |SSL_CTX_set_tlsext_status_cb|'s callback and returns one. +OPENSSL_EXPORT int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); // Nodejs compatibility section (hidden). // // These defines exist for node.js, with the hope that we can eliminate the // need for them over time. + #define SSLerr(function, reason) \ ERR_put_error(ERR_LIB_SSL, 0, reason, __FILE__, __LINE__) @@ -4290,6 +4619,7 @@ struct ssl_session_st { #define SSL_CTRL_GET_NUM_RENEGOTIATIONS doesnt_exist #define SSL_CTRL_GET_READ_AHEAD doesnt_exist #define SSL_CTRL_GET_RI_SUPPORT doesnt_exist +#define SSL_CTRL_GET_SERVER_TMP_KEY doesnt_exist #define SSL_CTRL_GET_SESSION_REUSED doesnt_exist #define SSL_CTRL_GET_SESS_CACHE_MODE doesnt_exist #define SSL_CTRL_GET_SESS_CACHE_SIZE doesnt_exist @@ -4322,6 +4652,12 @@ struct ssl_session_st { #define SSL_CTRL_SET_TMP_RSA doesnt_exist #define SSL_CTRL_SET_TMP_RSA_CB doesnt_exist +// |BORINGSSL_PREFIX| already makes each of these symbols into macros, so there +// is no need to define conflicting macros. +#if !defined(BORINGSSL_PREFIX) + + +#endif // !defined(BORINGSSL_PREFIX) #if defined(__cplusplus) @@ -4331,11 +4667,13 @@ struct ssl_session_st { extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(SSL, SSL_free) BORINGSSL_MAKE_DELETER(SSL_CTX, SSL_CTX_free) +BORINGSSL_MAKE_UP_REF(SSL_CTX, SSL_CTX_up_ref) BORINGSSL_MAKE_DELETER(SSL_SESSION, SSL_SESSION_free) +BORINGSSL_MAKE_UP_REF(SSL_SESSION, SSL_SESSION_up_ref) enum class OpenRecordResult { kOK, @@ -4410,10 +4748,10 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // state of the connection. // // Elsewhere, a fresh |SSL| can be used with |SSL_apply_handoff| to continue -// the connection. The connection from the client is fed into this |SSL| until -// the handshake completes normally. At this point (and only at this point), -// |SSL_serialize_handback| can be called to serialize the result of the -// handshake. +// the connection. The connection from the client is fed into this |SSL|, and +// the handshake resumed. When the handshake stops again and |SSL_get_error| +// indicates |SSL_ERROR_HANDBACK|, |SSL_serialize_handback| should be called to +// serialize the state of the handshake again. // // Back at the first location, a fresh |SSL| can be used with // |SSL_apply_handback|. Then the client's connection can be processed mostly @@ -4421,7 +4759,7 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // // Lastly, when a connection is in the handoff state, whether or not // |SSL_serialize_handoff| is called, |SSL_decline_handoff| will move it back -// into a normal state where the connection can procede without impact. +// into a normal state where the connection can proceed without impact. // // WARNING: Currently only works with TLS 1.0–1.2. // WARNING: The serialisation formats are not yet stable: version skew may be @@ -4434,13 +4772,23 @@ OPENSSL_EXPORT bool SealRecord(SSL *ssl, Span out_prefix, // WARNING: |SSL_apply_handoff| may trigger “msg” callback calls. OPENSSL_EXPORT void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on); -OPENSSL_EXPORT bool SSL_serialize_handoff(const SSL *ssl, CBB *out); +OPENSSL_EXPORT void SSL_set_handoff_mode(SSL *SSL, bool on); +OPENSSL_EXPORT bool SSL_serialize_handoff(const SSL *ssl, CBB *out, + SSL_CLIENT_HELLO *out_hello); OPENSSL_EXPORT bool SSL_decline_handoff(SSL *ssl); OPENSSL_EXPORT bool SSL_apply_handoff(SSL *ssl, Span handoff); OPENSSL_EXPORT bool SSL_serialize_handback(const SSL *ssl, CBB *out); OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); -} // namespace bssl +// SSL_get_traffic_secrets sets |*out_read_traffic_secret| and +// |*out_write_traffic_secret| to reference the TLS 1.3 traffic secrets for +// |ssl|. This function is only valid on TLS 1.3 connections that have +// completed the handshake. It returns true on success and false on error. +OPENSSL_EXPORT bool SSL_get_traffic_secrets( + const SSL *ssl, Span *out_read_traffic_secret, + Span *out_write_traffic_secret); + +BSSL_NAMESPACE_END } // extern C++ @@ -4635,6 +4983,22 @@ OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); #define SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI 285 #define SSL_R_SERVER_ECHOED_INVALID_SESSION_ID 286 #define SSL_R_PRIVATE_KEY_OPERATION_FAILED 287 +#define SSL_R_SECOND_SERVERHELLO_VERSION_MISMATCH 288 +#define SSL_R_OCSP_CB_ERROR 289 +#define SSL_R_SSL_SESSION_ID_TOO_LONG 290 +#define SSL_R_APPLICATION_DATA_ON_SHUTDOWN 291 +#define SSL_R_CERT_DECOMPRESSION_FAILED 292 +#define SSL_R_UNCOMPRESSED_CERT_TOO_LARGE 293 +#define SSL_R_UNKNOWN_CERT_COMPRESSION_ALG 294 +#define SSL_R_INVALID_SIGNATURE_ALGORITHM 295 +#define SSL_R_DUPLICATE_SIGNATURE_ALGORITHM 296 +#define SSL_R_TLS13_DOWNGRADE 297 +#define SSL_R_QUIC_INTERNAL_ERROR 298 +#define SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED 299 +#define SSL_R_TOO_MUCH_READ_EARLY_DATA 300 +#define SSL_R_INVALID_DELEGATED_CREDENTIAL 301 +#define SSL_R_KEY_USAGE_BIT_INCORRECT 302 +#define SSL_R_INCONSISTENT_CLIENT_HELLO 303 #define SSL_R_SSLV3_ALERT_CLOSE_NOTIFY 1000 #define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 #define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 @@ -4667,6 +5031,5 @@ OPENSSL_EXPORT bool SSL_apply_handback(SSL *ssl, Span handback); #define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE 1114 #define SSL_R_TLSV1_UNKNOWN_PSK_IDENTITY 1115 #define SSL_R_TLSV1_CERTIFICATE_REQUIRED 1116 -#define SSL_R_TOO_MUCH_READ_EARLY_DATA 1117 #endif // OPENSSL_HEADER_SSL_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ssl3.h b/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/ssl3.h rename to Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h index 509c2a44e..0bd562eee 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ssl3.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h @@ -251,9 +251,9 @@ extern "C" { #define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \ (EVP_AEAD_MAX_OVERHEAD + EVP_AEAD_MAX_NONCE_LENGTH) -OPENSSL_COMPILE_ASSERT( - SSL3_RT_MAX_ENCRYPTED_OVERHEAD >= SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD, - max_overheads_are_consistent); +OPENSSL_STATIC_ASSERT(SSL3_RT_MAX_ENCRYPTED_OVERHEAD >= + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD, + "max overheads are inconsistent"); // SSL3_RT_MAX_COMPRESSED_LENGTH is an alias for // |SSL3_RT_MAX_PLAIN_LENGTH|. Compression is gone, so don't include the @@ -311,6 +311,7 @@ OPENSSL_COMPILE_ASSERT( #define SSL3_MT_CERTIFICATE_STATUS 22 #define SSL3_MT_SUPPLEMENTAL_DATA 23 #define SSL3_MT_KEY_UPDATE 24 +#define SSL3_MT_COMPRESSED_CERTIFICATE 25 #define SSL3_MT_NEXT_PROTO 67 #define SSL3_MT_CHANNEL_ID 203 #define SSL3_MT_MESSAGE_HASH 254 diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.back new file mode 100644 index 000000000..e3910f006 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.back @@ -0,0 +1,333 @@ +/* ssl/ssl3.h */ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef OPENSSL_HEADER_SSL3_H +#define OPENSSL_HEADER_SSL3_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +// These are kept to support clients that negotiates higher protocol versions +// using SSLv2 client hello records. +#define SSL2_MT_CLIENT_HELLO 1 +#define SSL2_VERSION 0x0002 + +// Signalling cipher suite value from RFC 5746. +#define SSL3_CK_SCSV 0x030000FF +// Fallback signalling cipher suite value from RFC 7507. +#define SSL3_CK_FALLBACK_SCSV 0x03005600 + +#define SSL3_CK_RSA_NULL_MD5 0x03000001 +#define SSL3_CK_RSA_NULL_SHA 0x03000002 +#define SSL3_CK_RSA_RC4_40_MD5 0x03000003 +#define SSL3_CK_RSA_RC4_128_MD5 0x03000004 +#define SSL3_CK_RSA_RC4_128_SHA 0x03000005 +#define SSL3_CK_RSA_RC2_40_MD5 0x03000006 +#define SSL3_CK_RSA_IDEA_128_SHA 0x03000007 +#define SSL3_CK_RSA_DES_40_CBC_SHA 0x03000008 +#define SSL3_CK_RSA_DES_64_CBC_SHA 0x03000009 +#define SSL3_CK_RSA_DES_192_CBC3_SHA 0x0300000A + +#define SSL3_CK_DH_DSS_DES_40_CBC_SHA 0x0300000B +#define SSL3_CK_DH_DSS_DES_64_CBC_SHA 0x0300000C +#define SSL3_CK_DH_DSS_DES_192_CBC3_SHA 0x0300000D +#define SSL3_CK_DH_RSA_DES_40_CBC_SHA 0x0300000E +#define SSL3_CK_DH_RSA_DES_64_CBC_SHA 0x0300000F +#define SSL3_CK_DH_RSA_DES_192_CBC3_SHA 0x03000010 + +#define SSL3_CK_EDH_DSS_DES_40_CBC_SHA 0x03000011 +#define SSL3_CK_EDH_DSS_DES_64_CBC_SHA 0x03000012 +#define SSL3_CK_EDH_DSS_DES_192_CBC3_SHA 0x03000013 +#define SSL3_CK_EDH_RSA_DES_40_CBC_SHA 0x03000014 +#define SSL3_CK_EDH_RSA_DES_64_CBC_SHA 0x03000015 +#define SSL3_CK_EDH_RSA_DES_192_CBC3_SHA 0x03000016 + +#define SSL3_CK_ADH_RC4_40_MD5 0x03000017 +#define SSL3_CK_ADH_RC4_128_MD5 0x03000018 +#define SSL3_CK_ADH_DES_40_CBC_SHA 0x03000019 +#define SSL3_CK_ADH_DES_64_CBC_SHA 0x0300001A +#define SSL3_CK_ADH_DES_192_CBC_SHA 0x0300001B + +#define SSL3_TXT_RSA_NULL_MD5 "NULL-MD5" +#define SSL3_TXT_RSA_NULL_SHA "NULL-SHA" +#define SSL3_TXT_RSA_RC4_40_MD5 "EXP-RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_MD5 "RC4-MD5" +#define SSL3_TXT_RSA_RC4_128_SHA "RC4-SHA" +#define SSL3_TXT_RSA_RC2_40_MD5 "EXP-RC2-CBC-MD5" +#define SSL3_TXT_RSA_IDEA_128_SHA "IDEA-CBC-SHA" +#define SSL3_TXT_RSA_DES_40_CBC_SHA "EXP-DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_64_CBC_SHA "DES-CBC-SHA" +#define SSL3_TXT_RSA_DES_192_CBC3_SHA "DES-CBC3-SHA" + +#define SSL3_TXT_DH_DSS_DES_40_CBC_SHA "EXP-DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_64_CBC_SHA "DH-DSS-DES-CBC-SHA" +#define SSL3_TXT_DH_DSS_DES_192_CBC3_SHA "DH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_DH_RSA_DES_40_CBC_SHA "EXP-DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_64_CBC_SHA "DH-RSA-DES-CBC-SHA" +#define SSL3_TXT_DH_RSA_DES_192_CBC3_SHA "DH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_EDH_DSS_DES_40_CBC_SHA "EXP-EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_64_CBC_SHA "EDH-DSS-DES-CBC-SHA" +#define SSL3_TXT_EDH_DSS_DES_192_CBC3_SHA "EDH-DSS-DES-CBC3-SHA" +#define SSL3_TXT_EDH_RSA_DES_40_CBC_SHA "EXP-EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_64_CBC_SHA "EDH-RSA-DES-CBC-SHA" +#define SSL3_TXT_EDH_RSA_DES_192_CBC3_SHA "EDH-RSA-DES-CBC3-SHA" + +#define SSL3_TXT_ADH_RC4_40_MD5 "EXP-ADH-RC4-MD5" +#define SSL3_TXT_ADH_RC4_128_MD5 "ADH-RC4-MD5" +#define SSL3_TXT_ADH_DES_40_CBC_SHA "EXP-ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_64_CBC_SHA "ADH-DES-CBC-SHA" +#define SSL3_TXT_ADH_DES_192_CBC_SHA "ADH-DES-CBC3-SHA" + +#define SSL3_SSL_SESSION_ID_LENGTH 32 +#define SSL3_MAX_SSL_SESSION_ID_LENGTH 32 + +#define SSL3_MASTER_SECRET_SIZE 48 +#define SSL3_RANDOM_SIZE 32 +#define SSL3_SESSION_ID_SIZE 32 +#define SSL3_RT_HEADER_LENGTH 5 + +#define SSL3_HM_HEADER_LENGTH 4 + +#ifndef SSL3_ALIGN_PAYLOAD +// Some will argue that this increases memory footprint, but it's not actually +// true. Point is that malloc has to return at least 64-bit aligned pointers, +// meaning that allocating 5 bytes wastes 3 bytes in either case. Suggested +// pre-gaping simply moves these wasted bytes from the end of allocated region +// to its front, but makes data payload aligned, which improves performance. +#define SSL3_ALIGN_PAYLOAD 8 +#else +#if (SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) != 0 +#error "insane SSL3_ALIGN_PAYLOAD" +#undef SSL3_ALIGN_PAYLOAD +#endif +#endif + +// This is the maximum MAC (digest) size used by the SSL library. Currently +// maximum of 20 is used by SHA1, but we reserve for future extension for +// 512-bit hashes. + +#define SSL3_RT_MAX_MD_SIZE 64 + +// Maximum block size used in all ciphersuites. Currently 16 for AES. + +#define SSL_RT_MAX_CIPHER_BLOCK_SIZE 16 + +// Maximum plaintext length: defined by SSL/TLS standards +#define SSL3_RT_MAX_PLAIN_LENGTH 16384 +// Maximum compression overhead: defined by SSL/TLS standards +#define SSL3_RT_MAX_COMPRESSED_OVERHEAD 1024 + +// The standards give a maximum encryption overhead of 1024 bytes. In practice +// the value is lower than this. The overhead is the maximum number of padding +// bytes (256) plus the mac size. +// +// TODO(davidben): This derivation doesn't take AEADs into account, or TLS 1.1 +// explicit nonces. It happens to work because |SSL3_RT_MAX_MD_SIZE| is larger +// than necessary and no true AEAD has variable overhead in TLS 1.2. +#define SSL3_RT_MAX_ENCRYPTED_OVERHEAD (256 + SSL3_RT_MAX_MD_SIZE) + +// SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD is the maximum overhead in encrypting a +// record. This does not include the record header. Some ciphers use explicit +// nonces, so it includes both the AEAD overhead as well as the nonce. +#define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \ + (EVP_AEAD_MAX_OVERHEAD + EVP_AEAD_MAX_NONCE_LENGTH) + +OPENSSL_STATIC_ASSERT(SSL3_RT_MAX_ENCRYPTED_OVERHEAD >= + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD, + "max overheads are inconsistent"); + +// SSL3_RT_MAX_COMPRESSED_LENGTH is an alias for +// |SSL3_RT_MAX_PLAIN_LENGTH|. Compression is gone, so don't include the +// compression overhead. +#define SSL3_RT_MAX_COMPRESSED_LENGTH SSL3_RT_MAX_PLAIN_LENGTH + +#define SSL3_RT_MAX_ENCRYPTED_LENGTH \ + (SSL3_RT_MAX_ENCRYPTED_OVERHEAD + SSL3_RT_MAX_COMPRESSED_LENGTH) +#define SSL3_RT_MAX_PACKET_SIZE \ + (SSL3_RT_MAX_ENCRYPTED_LENGTH + SSL3_RT_HEADER_LENGTH) + +#define SSL3_MD_CLIENT_FINISHED_CONST "\x43\x4C\x4E\x54" +#define SSL3_MD_SERVER_FINISHED_CONST "\x53\x52\x56\x52" + +#define SSL3_RT_CHANGE_CIPHER_SPEC 20 +#define SSL3_RT_ALERT 21 +#define SSL3_RT_HANDSHAKE 22 +#define SSL3_RT_APPLICATION_DATA 23 + +// Pseudo content type for SSL/TLS header info +#define SSL3_RT_HEADER 0x100 + +#define SSL3_AL_WARNING 1 +#define SSL3_AL_FATAL 2 + +#define SSL3_AD_CLOSE_NOTIFY 0 +#define SSL3_AD_UNEXPECTED_MESSAGE 10 // fatal +#define SSL3_AD_BAD_RECORD_MAC 20 // fatal +#define SSL3_AD_DECOMPRESSION_FAILURE 30 // fatal +#define SSL3_AD_HANDSHAKE_FAILURE 40 // fatal +#define SSL3_AD_NO_CERTIFICATE 41 +#define SSL3_AD_BAD_CERTIFICATE 42 +#define SSL3_AD_UNSUPPORTED_CERTIFICATE 43 +#define SSL3_AD_CERTIFICATE_REVOKED 44 +#define SSL3_AD_CERTIFICATE_EXPIRED 45 +#define SSL3_AD_CERTIFICATE_UNKNOWN 46 +#define SSL3_AD_ILLEGAL_PARAMETER 47 // fatal +#define SSL3_AD_INAPPROPRIATE_FALLBACK 86 // fatal + +#define SSL3_CT_RSA_SIGN 1 + +#define SSL3_MT_HELLO_REQUEST 0 +#define SSL3_MT_CLIENT_HELLO 1 +#define SSL3_MT_SERVER_HELLO 2 +#define SSL3_MT_NEW_SESSION_TICKET 4 +#define SSL3_MT_END_OF_EARLY_DATA 5 +#define SSL3_MT_ENCRYPTED_EXTENSIONS 8 +#define SSL3_MT_CERTIFICATE 11 +#define SSL3_MT_SERVER_KEY_EXCHANGE 12 +#define SSL3_MT_CERTIFICATE_REQUEST 13 +#define SSL3_MT_SERVER_HELLO_DONE 14 +#define SSL3_MT_CERTIFICATE_VERIFY 15 +#define SSL3_MT_CLIENT_KEY_EXCHANGE 16 +#define SSL3_MT_FINISHED 20 +#define SSL3_MT_CERTIFICATE_STATUS 22 +#define SSL3_MT_SUPPLEMENTAL_DATA 23 +#define SSL3_MT_KEY_UPDATE 24 +#define SSL3_MT_COMPRESSED_CERTIFICATE 25 +#define SSL3_MT_NEXT_PROTO 67 +#define SSL3_MT_CHANNEL_ID 203 +#define SSL3_MT_MESSAGE_HASH 254 +#define DTLS1_MT_HELLO_VERIFY_REQUEST 3 + +// The following are legacy aliases for consumers which use +// |SSL_CTX_set_msg_callback|. +#define SSL3_MT_SERVER_DONE SSL3_MT_SERVER_HELLO_DONE +#define SSL3_MT_NEWSESSION_TICKET SSL3_MT_NEW_SESSION_TICKET + + +#define SSL3_MT_CCS 1 + + +#ifdef __cplusplus +} // extern C +#endif + +#endif // OPENSSL_HEADER_SSL3_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/ssl3.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/include/openssl/ssl3.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.grpc_back index e32a6d73b..e3910f006 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/ssl3.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/ssl3.h.grpc_back @@ -251,9 +251,9 @@ extern "C" { #define SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD \ (EVP_AEAD_MAX_OVERHEAD + EVP_AEAD_MAX_NONCE_LENGTH) -OPENSSL_COMPILE_ASSERT( - SSL3_RT_MAX_ENCRYPTED_OVERHEAD >= SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD, - max_overheads_are_consistent); +OPENSSL_STATIC_ASSERT(SSL3_RT_MAX_ENCRYPTED_OVERHEAD >= + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD, + "max overheads are inconsistent"); // SSL3_RT_MAX_COMPRESSED_LENGTH is an alias for // |SSL3_RT_MAX_PLAIN_LENGTH|. Compression is gone, so don't include the @@ -311,6 +311,7 @@ OPENSSL_COMPILE_ASSERT( #define SSL3_MT_CERTIFICATE_STATUS 22 #define SSL3_MT_SUPPLEMENTAL_DATA 23 #define SSL3_MT_KEY_UPDATE 24 +#define SSL3_MT_COMPRESSED_CERTIFICATE 25 #define SSL3_MT_NEXT_PROTO 67 #define SSL3_MT_CHANNEL_ID 203 #define SSL3_MT_MESSAGE_HASH 254 diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/stack.h b/Pods/BoringSSL-GRPC/src/include/openssl/stack.h new file mode 100644 index 000000000..61c212cee --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/stack.h @@ -0,0 +1,542 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_STACK_H +#define OPENSSL_HEADER_STACK_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// A stack, in OpenSSL, is an array of pointers. They are the most commonly +// used collection object. +// +// This file defines macros for type safe use of the stack functions. A stack +// of a specific type of object has type |STACK_OF(type)|. This can be defined +// (once) with |DEFINE_STACK_OF(type)| and declared where needed with +// |DECLARE_STACK_OF(type)|. For example: +// +// typedef struct foo_st { +// int bar; +// } FOO; +// +// DEFINE_STACK_OF(FOO) +// +// Although note that the stack will contain /pointers/ to |FOO|. +// +// A macro will be defined for each of the sk_* functions below. For +// STACK_OF(FOO), the macros would be sk_FOO_new, sk_FOO_pop etc. + + +// stack_free_func is a function that frees an element in a stack. Note its +// actual type is void (*)(T *) for some T. Low-level |sk_*| functions will be +// passed a type-specific wrapper to call it correctly. +typedef void (*stack_free_func)(void *ptr); + +// stack_copy_func is a function that copies an element in a stack. Note its +// actual type is T *(*)(T *) for some T. Low-level |sk_*| functions will be +// passed a type-specific wrapper to call it correctly. +typedef void *(*stack_copy_func)(void *ptr); + +// stack_cmp_func is a comparison function that returns a value < 0, 0 or > 0 +// if |*a| is less than, equal to or greater than |*b|, respectively. Note the +// extra indirection - the function is given a pointer to a pointer to the +// element. This differs from the usual qsort/bsearch comparison function. +// +// Note its actual type is int (*)(const T **, const T **). Low-level |sk_*| +// functions will be passed a type-specific wrapper to call it correctly. +typedef int (*stack_cmp_func)(const void **a, const void **b); + +// stack_st contains an array of pointers. It is not designed to be used +// directly, rather the wrapper macros should be used. +typedef struct stack_st { + // num contains the number of valid pointers in |data|. + size_t num; + void **data; + // sorted is non-zero if the values pointed to by |data| are in ascending + // order, based on |comp|. + int sorted; + // num_alloc contains the number of pointers allocated in the buffer pointed + // to by |data|, which may be larger than |num|. + size_t num_alloc; + // comp is an optional comparison function. + stack_cmp_func comp; +} _STACK; + + +#define STACK_OF(type) struct stack_st_##type + +#define DECLARE_STACK_OF(type) STACK_OF(type); + +// These are the raw stack functions, you shouldn't be using them. Rather you +// should be using the type stack macros implemented above. + +// sk_new creates a new, empty stack with the given comparison function, which +// may be zero. It returns the new stack or NULL on allocation failure. +OPENSSL_EXPORT _STACK *sk_new(stack_cmp_func comp); + +// sk_new_null creates a new, empty stack. It returns the new stack or NULL on +// allocation failure. +OPENSSL_EXPORT _STACK *sk_new_null(void); + +// sk_num returns the number of elements in |s|. +OPENSSL_EXPORT size_t sk_num(const _STACK *sk); + +// sk_zero resets |sk| to the empty state but does nothing to free the +// individual elements themselves. +OPENSSL_EXPORT void sk_zero(_STACK *sk); + +// sk_value returns the |i|th pointer in |sk|, or NULL if |i| is out of +// range. +OPENSSL_EXPORT void *sk_value(const _STACK *sk, size_t i); + +// sk_set sets the |i|th pointer in |sk| to |p| and returns |p|. If |i| is out +// of range, it returns NULL. +OPENSSL_EXPORT void *sk_set(_STACK *sk, size_t i, void *p); + +// sk_free frees the given stack and array of pointers, but does nothing to +// free the individual elements. Also see |sk_pop_free_ex|. +OPENSSL_EXPORT void sk_free(_STACK *sk); + +// sk_pop_free_ex calls |free_func| on each element in the stack and then frees +// the stack itself. Note this corresponds to |sk_FOO_pop_free|. It is named +// |sk_pop_free_ex| as a workaround for existing code calling an older version +// of |sk_pop_free|. +OPENSSL_EXPORT void sk_pop_free_ex(_STACK *sk, + void (*call_free_func)(stack_free_func, + void *), + stack_free_func free_func); + +// sk_insert inserts |p| into the stack at index |where|, moving existing +// elements if needed. It returns the length of the new stack, or zero on +// error. +OPENSSL_EXPORT size_t sk_insert(_STACK *sk, void *p, size_t where); + +// sk_delete removes the pointer at index |where|, moving other elements down +// if needed. It returns the removed pointer, or NULL if |where| is out of +// range. +OPENSSL_EXPORT void *sk_delete(_STACK *sk, size_t where); + +// sk_delete_ptr removes, at most, one instance of |p| from the stack based on +// pointer equality. If an instance of |p| is found then |p| is returned, +// otherwise it returns NULL. +OPENSSL_EXPORT void *sk_delete_ptr(_STACK *sk, const void *p); + +// sk_find returns the first value in the stack equal to |p|. If a comparison +// function has been set on the stack, equality is defined by it, otherwise +// pointer equality is used. If the stack is sorted, then a binary search is +// used, otherwise a linear search is performed. If a matching element is found, +// its index is written to +// |*out_index| (if |out_index| is not NULL) and one is returned. Otherwise zero +// is returned. +// +// Note this differs from OpenSSL. The type signature is slightly different, and +// OpenSSL's sk_find will implicitly sort |sk| if it has a comparison function +// defined. +OPENSSL_EXPORT int sk_find(const _STACK *sk, size_t *out_index, const void *p, + int (*call_cmp_func)(stack_cmp_func, const void **, + const void **)); + +// sk_shift removes and returns the first element in the stack, or returns NULL +// if the stack is empty. +OPENSSL_EXPORT void *sk_shift(_STACK *sk); + +// sk_push appends |p| to the stack and returns the length of the new stack, or +// 0 on allocation failure. +OPENSSL_EXPORT size_t sk_push(_STACK *sk, void *p); + +// sk_pop returns and removes the last element on the stack, or NULL if the +// stack is empty. +OPENSSL_EXPORT void *sk_pop(_STACK *sk); + +// sk_dup performs a shallow copy of a stack and returns the new stack, or NULL +// on error. +OPENSSL_EXPORT _STACK *sk_dup(const _STACK *sk); + +// sk_sort sorts the elements of |sk| into ascending order based on the +// comparison function. The stack maintains a |sorted| flag and sorting an +// already sorted stack is a no-op. +OPENSSL_EXPORT void sk_sort(_STACK *sk); + +// sk_is_sorted returns one if |sk| is known to be sorted and zero +// otherwise. +OPENSSL_EXPORT int sk_is_sorted(const _STACK *sk); + +// sk_set_cmp_func sets the comparison function to be used by |sk| and returns +// the previous one. +OPENSSL_EXPORT stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp); + +// sk_deep_copy performs a copy of |sk| and of each of the non-NULL elements in +// |sk| by using |copy_func|. If an error occurs, |free_func| is used to free +// any copies already made and NULL is returned. +OPENSSL_EXPORT _STACK *sk_deep_copy( + const _STACK *sk, void *(*call_copy_func)(stack_copy_func, void *), + stack_copy_func copy_func, void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func); + + +// Deprecated functions. + +// sk_pop_free behaves like |sk_pop_free_ex| but performs an invalid function +// pointer cast. It exists because some existing callers called |sk_pop_free| +// directly. +// +// TODO(davidben): Migrate callers to bssl::UniquePtr and remove this. +OPENSSL_EXPORT void sk_pop_free(_STACK *sk, stack_free_func free_func); + + +// Defining stack types. +// +// This set of macros is used to emit the typed functions that act on a +// |STACK_OF(T)|. + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { +BSSL_NAMESPACE_BEGIN +namespace internal { +template +struct StackTraits {}; +} +BSSL_NAMESPACE_END +} + +#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) \ + extern "C++" { \ + BSSL_NAMESPACE_BEGIN \ + namespace internal { \ + template <> \ + struct StackTraits { \ + static constexpr bool kIsStack = true; \ + using Type = type; \ + static constexpr bool kIsConst = is_const; \ + }; \ + } \ + BSSL_NAMESPACE_END \ + } + +#else +#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) +#endif + +#define BORINGSSL_DEFINE_STACK_OF_IMPL(name, ptrtype, constptrtype) \ + DECLARE_STACK_OF(name) \ + \ + typedef void (*stack_##name##_free_func)(ptrtype); \ + typedef ptrtype (*stack_##name##_copy_func)(ptrtype); \ + typedef int (*stack_##name##_cmp_func)(constptrtype *a, constptrtype *b); \ + \ + OPENSSL_INLINE void sk_##name##_call_free_func(stack_free_func free_func, \ + void *ptr) { \ + ((stack_##name##_free_func)free_func)((ptrtype)ptr); \ + } \ + \ + OPENSSL_INLINE void *sk_##name##_call_copy_func(stack_copy_func copy_func, \ + void *ptr) { \ + return (void *)((stack_##name##_copy_func)copy_func)((ptrtype)ptr); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_call_cmp_func( \ + stack_cmp_func cmp_func, const void **a, const void **b) { \ + constptrtype a_ptr = (constptrtype)*a; \ + constptrtype b_ptr = (constptrtype)*b; \ + return ((stack_##name##_cmp_func)cmp_func)(&a_ptr, &b_ptr); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * \ + sk_##name##_new(stack_##name##_cmp_func comp) { \ + return (STACK_OF(name) *)sk_new((stack_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) *sk_##name##_new_null(void) { \ + return (STACK_OF(name) *)sk_new_null(); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_num(const STACK_OF(name) *sk) { \ + return sk_num((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_zero(STACK_OF(name) *sk) { \ + sk_zero((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_value(const STACK_OF(name) *sk, \ + size_t i) { \ + return (ptrtype)sk_value((const _STACK *)sk, i); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_set(STACK_OF(name) *sk, size_t i, \ + ptrtype p) { \ + return (ptrtype)sk_set((_STACK *)sk, i, (void *)p); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_free(STACK_OF(name) * sk) { \ + sk_free((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_pop_free( \ + STACK_OF(name) * sk, stack_##name##_free_func free_func) { \ + sk_pop_free_ex((_STACK *)sk, sk_##name##_call_free_func, \ + (stack_free_func)free_func); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_insert(STACK_OF(name) *sk, ptrtype p, \ + size_t where) { \ + return sk_insert((_STACK *)sk, (void *)p, where); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_delete(STACK_OF(name) *sk, \ + size_t where) { \ + return (ptrtype)sk_delete((_STACK *)sk, where); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_delete_ptr(STACK_OF(name) *sk, \ + constptrtype p) { \ + return (ptrtype)sk_delete_ptr((_STACK *)sk, (const void *)p); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_find(const STACK_OF(name) *sk, \ + size_t * out_index, constptrtype p) { \ + return sk_find((const _STACK *)sk, out_index, (const void *)p, \ + sk_##name##_call_cmp_func); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_shift(STACK_OF(name) *sk) { \ + return (ptrtype)sk_shift((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_push(STACK_OF(name) *sk, ptrtype p) { \ + return sk_push((_STACK *)sk, (void *)p); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_pop(STACK_OF(name) *sk) { \ + return (ptrtype)sk_pop((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * sk_##name##_dup(const STACK_OF(name) *sk) { \ + return (STACK_OF(name) *)sk_dup((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_sort(STACK_OF(name) *sk) { \ + sk_sort((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_is_sorted(const STACK_OF(name) *sk) { \ + return sk_is_sorted((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE stack_##name##_cmp_func sk_##name##_set_cmp_func( \ + STACK_OF(name) *sk, stack_##name##_cmp_func comp) { \ + return (stack_##name##_cmp_func)sk_set_cmp_func((_STACK *)sk, \ + (stack_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * \ + sk_##name##_deep_copy(const STACK_OF(name) *sk, \ + ptrtype(*copy_func)(ptrtype), \ + void (*free_func)(ptrtype)) { \ + return (STACK_OF(name) *)sk_deep_copy( \ + (const _STACK *)sk, sk_##name##_call_copy_func, \ + (stack_copy_func)copy_func, sk_##name##_call_free_func, \ + (stack_free_func)free_func); \ + } + +// DEFINE_NAMED_STACK_OF defines |STACK_OF(name)| to be a stack whose elements +// are |type| *. +#define DEFINE_NAMED_STACK_OF(name, type) \ + BORINGSSL_DEFINE_STACK_OF_IMPL(name, type *, const type *) \ + BORINGSSL_DEFINE_STACK_TRAITS(name, type, false) + +// DEFINE_STACK_OF defines |STACK_OF(type)| to be a stack whose elements are +// |type| *. +#define DEFINE_STACK_OF(type) DEFINE_NAMED_STACK_OF(type, type) + +// DEFINE_CONST_STACK_OF defines |STACK_OF(type)| to be a stack whose elements +// are const |type| *. +#define DEFINE_CONST_STACK_OF(type) \ + BORINGSSL_DEFINE_STACK_OF_IMPL(type, const type *, const type *) \ + BORINGSSL_DEFINE_STACK_TRAITS(type, const type, true) + +// DEFINE_SPECIAL_STACK_OF defines |STACK_OF(type)| to be a stack whose elements +// are |type|, where |type| must be a typedef for a pointer. +#define DEFINE_SPECIAL_STACK_OF(type) \ + OPENSSL_STATIC_ASSERT(sizeof(type) == sizeof(void *), \ + #type " is not a pointer"); \ + BORINGSSL_DEFINE_STACK_OF_IMPL(type, type, const type) + + +typedef char *OPENSSL_STRING; + +DEFINE_STACK_OF(void) +DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING) + + +#if defined(__cplusplus) +} // extern C +#endif + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +#include + +BSSL_NAMESPACE_BEGIN + +namespace internal { + +// Stacks defined with |DEFINE_CONST_STACK_OF| are freed with |sk_free|. +template +struct DeleterImpl< + Stack, typename std::enable_if::kIsConst>::type> { + static void Free(Stack *sk) { sk_free(reinterpret_cast<_STACK *>(sk)); } +}; + +// Stacks defined with |DEFINE_STACK_OF| are freed with |sk_pop_free| and the +// corresponding type's deleter. +template +struct DeleterImpl< + Stack, typename std::enable_if::kIsConst>::type> { + static void Free(Stack *sk) { + // sk_FOO_pop_free is defined by macros and bound by name, so we cannot + // access it from C++ here. + using Type = typename StackTraits::Type; + sk_pop_free_ex(reinterpret_cast<_STACK *>(sk), + [](stack_free_func /* unused */, void *ptr) { + DeleterImpl::Free(reinterpret_cast(ptr)); + }, + nullptr); + } +}; + +template +class StackIteratorImpl { + public: + using Type = typename StackTraits::Type; + // Iterators must be default-constructable. + StackIteratorImpl() : sk_(nullptr), idx_(0) {} + StackIteratorImpl(const Stack *sk, size_t idx) : sk_(sk), idx_(idx) {} + + bool operator==(StackIteratorImpl other) const { + return sk_ == other.sk_ && idx_ == other.idx_; + } + bool operator!=(StackIteratorImpl other) const { + return !(*this == other); + } + + Type *operator*() const { + return reinterpret_cast( + sk_value(reinterpret_cast(sk_), idx_)); + } + + StackIteratorImpl &operator++(/* prefix */) { + idx_++; + return *this; + } + + StackIteratorImpl operator++(int /* postfix */) { + StackIteratorImpl copy(*this); + ++(*this); + return copy; + } + + private: + const Stack *sk_; + size_t idx_; +}; + +template +using StackIterator = typename std::enable_if::kIsStack, + StackIteratorImpl>::type; + +} // namespace internal + +// PushToStack pushes |elem| to |sk|. It returns true on success and false on +// allocation failure. +template +inline + typename std::enable_if::kIsConst, bool>::type + PushToStack(Stack *sk, + UniquePtr::Type> elem) { + if (!sk_push(reinterpret_cast<_STACK *>(sk), elem.get())) { + return false; + } + // sk_push takes ownership on success. + elem.release(); + return true; +} + +BSSL_NAMESPACE_END + +// Define begin() and end() for stack types so C++ range for loops work. +template +inline bssl::internal::StackIterator begin(const Stack *sk) { + return bssl::internal::StackIterator(sk, 0); +} + +template +inline bssl::internal::StackIterator end(const Stack *sk) { + return bssl::internal::StackIterator( + sk, sk_num(reinterpret_cast(sk))); +} + +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_STACK_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.back new file mode 100644 index 000000000..04e942cb9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.back @@ -0,0 +1,542 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_STACK_H +#define OPENSSL_HEADER_STACK_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// A stack, in OpenSSL, is an array of pointers. They are the most commonly +// used collection object. +// +// This file defines macros for type safe use of the stack functions. A stack +// of a specific type of object has type |STACK_OF(type)|. This can be defined +// (once) with |DEFINE_STACK_OF(type)| and declared where needed with +// |DECLARE_STACK_OF(type)|. For example: +// +// typedef struct foo_st { +// int bar; +// } FOO; +// +// DEFINE_STACK_OF(FOO) +// +// Although note that the stack will contain /pointers/ to |FOO|. +// +// A macro will be defined for each of the sk_* functions below. For +// STACK_OF(FOO), the macros would be sk_FOO_new, sk_FOO_pop etc. + + +// stack_free_func is a function that frees an element in a stack. Note its +// actual type is void (*)(T *) for some T. Low-level |sk_*| functions will be +// passed a type-specific wrapper to call it correctly. +typedef void (*stack_free_func)(void *ptr); + +// stack_copy_func is a function that copies an element in a stack. Note its +// actual type is T *(*)(T *) for some T. Low-level |sk_*| functions will be +// passed a type-specific wrapper to call it correctly. +typedef void *(*stack_copy_func)(void *ptr); + +// stack_cmp_func is a comparison function that returns a value < 0, 0 or > 0 +// if |*a| is less than, equal to or greater than |*b|, respectively. Note the +// extra indirection - the function is given a pointer to a pointer to the +// element. This differs from the usual qsort/bsearch comparison function. +// +// Note its actual type is int (*)(const T **, const T **). Low-level |sk_*| +// functions will be passed a type-specific wrapper to call it correctly. +typedef int (*stack_cmp_func)(const void **a, const void **b); + +// stack_st contains an array of pointers. It is not designed to be used +// directly, rather the wrapper macros should be used. +typedef struct stack_st { + // num contains the number of valid pointers in |data|. + size_t num; + void **data; + // sorted is non-zero if the values pointed to by |data| are in ascending + // order, based on |comp|. + int sorted; + // num_alloc contains the number of pointers allocated in the buffer pointed + // to by |data|, which may be larger than |num|. + size_t num_alloc; + // comp is an optional comparison function. + stack_cmp_func comp; +} _STACK; + + +#define STACK_OF(type) struct stack_st_##type + +#define DECLARE_STACK_OF(type) STACK_OF(type); + +// These are the raw stack functions, you shouldn't be using them. Rather you +// should be using the type stack macros implemented above. + +// sk_new creates a new, empty stack with the given comparison function, which +// may be zero. It returns the new stack or NULL on allocation failure. +OPENSSL_EXPORT _STACK *sk_new(stack_cmp_func comp); + +// sk_new_null creates a new, empty stack. It returns the new stack or NULL on +// allocation failure. +OPENSSL_EXPORT _STACK *sk_new_null(void); + +// sk_num returns the number of elements in |s|. +OPENSSL_EXPORT size_t sk_num(const _STACK *sk); + +// sk_zero resets |sk| to the empty state but does nothing to free the +// individual elements themselves. +OPENSSL_EXPORT void sk_zero(_STACK *sk); + +// sk_value returns the |i|th pointer in |sk|, or NULL if |i| is out of +// range. +OPENSSL_EXPORT void *sk_value(const _STACK *sk, size_t i); + +// sk_set sets the |i|th pointer in |sk| to |p| and returns |p|. If |i| is out +// of range, it returns NULL. +OPENSSL_EXPORT void *sk_set(_STACK *sk, size_t i, void *p); + +// sk_free frees the given stack and array of pointers, but does nothing to +// free the individual elements. Also see |sk_pop_free_ex|. +OPENSSL_EXPORT void sk_free(_STACK *sk); + +// sk_pop_free_ex calls |free_func| on each element in the stack and then frees +// the stack itself. Note this corresponds to |sk_FOO_pop_free|. It is named +// |sk_pop_free_ex| as a workaround for existing code calling an older version +// of |sk_pop_free|. +OPENSSL_EXPORT void sk_pop_free_ex(_STACK *sk, + void (*call_free_func)(stack_free_func, + void *), + stack_free_func free_func); + +// sk_insert inserts |p| into the stack at index |where|, moving existing +// elements if needed. It returns the length of the new stack, or zero on +// error. +OPENSSL_EXPORT size_t sk_insert(_STACK *sk, void *p, size_t where); + +// sk_delete removes the pointer at index |where|, moving other elements down +// if needed. It returns the removed pointer, or NULL if |where| is out of +// range. +OPENSSL_EXPORT void *sk_delete(_STACK *sk, size_t where); + +// sk_delete_ptr removes, at most, one instance of |p| from the stack based on +// pointer equality. If an instance of |p| is found then |p| is returned, +// otherwise it returns NULL. +OPENSSL_EXPORT void *sk_delete_ptr(_STACK *sk, const void *p); + +// sk_find returns the first value in the stack equal to |p|. If a comparison +// function has been set on the stack, equality is defined by it, otherwise +// pointer equality is used. If the stack is sorted, then a binary search is +// used, otherwise a linear search is performed. If a matching element is found, +// its index is written to +// |*out_index| (if |out_index| is not NULL) and one is returned. Otherwise zero +// is returned. +// +// Note this differs from OpenSSL. The type signature is slightly different, and +// OpenSSL's sk_find will implicitly sort |sk| if it has a comparison function +// defined. +OPENSSL_EXPORT int sk_find(const _STACK *sk, size_t *out_index, const void *p, + int (*call_cmp_func)(stack_cmp_func, const void **, + const void **)); + +// sk_shift removes and returns the first element in the stack, or returns NULL +// if the stack is empty. +OPENSSL_EXPORT void *sk_shift(_STACK *sk); + +// sk_push appends |p| to the stack and returns the length of the new stack, or +// 0 on allocation failure. +OPENSSL_EXPORT size_t sk_push(_STACK *sk, void *p); + +// sk_pop returns and removes the last element on the stack, or NULL if the +// stack is empty. +OPENSSL_EXPORT void *sk_pop(_STACK *sk); + +// sk_dup performs a shallow copy of a stack and returns the new stack, or NULL +// on error. +OPENSSL_EXPORT _STACK *sk_dup(const _STACK *sk); + +// sk_sort sorts the elements of |sk| into ascending order based on the +// comparison function. The stack maintains a |sorted| flag and sorting an +// already sorted stack is a no-op. +OPENSSL_EXPORT void sk_sort(_STACK *sk); + +// sk_is_sorted returns one if |sk| is known to be sorted and zero +// otherwise. +OPENSSL_EXPORT int sk_is_sorted(const _STACK *sk); + +// sk_set_cmp_func sets the comparison function to be used by |sk| and returns +// the previous one. +OPENSSL_EXPORT stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp); + +// sk_deep_copy performs a copy of |sk| and of each of the non-NULL elements in +// |sk| by using |copy_func|. If an error occurs, |free_func| is used to free +// any copies already made and NULL is returned. +OPENSSL_EXPORT _STACK *sk_deep_copy( + const _STACK *sk, void *(*call_copy_func)(stack_copy_func, void *), + stack_copy_func copy_func, void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func); + + +// Deprecated functions. + +// sk_pop_free behaves like |sk_pop_free_ex| but performs an invalid function +// pointer cast. It exists because some existing callers called |sk_pop_free| +// directly. +// +// TODO(davidben): Migrate callers to bssl::UniquePtr and remove this. +OPENSSL_EXPORT void sk_pop_free(_STACK *sk, stack_free_func free_func); + + +// Defining stack types. +// +// This set of macros is used to emit the typed functions that act on a +// |STACK_OF(T)|. + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { +BSSL_NAMESPACE_BEGIN +namespace internal { +template +struct StackTraits {}; +} +BSSL_NAMESPACE_END +} + +#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) \ + extern "C++" { \ + BSSL_NAMESPACE_BEGIN \ + namespace internal { \ + template <> \ + struct StackTraits { \ + static constexpr bool kIsStack = true; \ + using Type = type; \ + static constexpr bool kIsConst = is_const; \ + }; \ + } \ + BSSL_NAMESPACE_END \ + } + +#else +#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) +#endif + +#define BORINGSSL_DEFINE_STACK_OF_IMPL(name, ptrtype, constptrtype) \ + DECLARE_STACK_OF(name) \ + \ + typedef void (*stack_##name##_free_func)(ptrtype); \ + typedef ptrtype (*stack_##name##_copy_func)(ptrtype); \ + typedef int (*stack_##name##_cmp_func)(constptrtype *a, constptrtype *b); \ + \ + OPENSSL_INLINE void sk_##name##_call_free_func(stack_free_func free_func, \ + void *ptr) { \ + ((stack_##name##_free_func)free_func)((ptrtype)ptr); \ + } \ + \ + OPENSSL_INLINE void *sk_##name##_call_copy_func(stack_copy_func copy_func, \ + void *ptr) { \ + return (void *)((stack_##name##_copy_func)copy_func)((ptrtype)ptr); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_call_cmp_func( \ + stack_cmp_func cmp_func, const void **a, const void **b) { \ + constptrtype a_ptr = (constptrtype)*a; \ + constptrtype b_ptr = (constptrtype)*b; \ + return ((stack_##name##_cmp_func)cmp_func)(&a_ptr, &b_ptr); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * \ + sk_##name##_new(stack_##name##_cmp_func comp) { \ + return (STACK_OF(name) *)sk_new((stack_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) *sk_##name##_new_null(void) { \ + return (STACK_OF(name) *)sk_new_null(); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_num(const STACK_OF(name) *sk) { \ + return sk_num((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_zero(STACK_OF(name) *sk) { \ + sk_zero((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_value(const STACK_OF(name) *sk, \ + size_t i) { \ + return (ptrtype)sk_value((const _STACK *)sk, i); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_set(STACK_OF(name) *sk, size_t i, \ + ptrtype p) { \ + return (ptrtype)sk_set((_STACK *)sk, i, (void *)p); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_free(STACK_OF(name) * sk) { \ + sk_free((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_pop_free( \ + STACK_OF(name) * sk, stack_##name##_free_func free_func) { \ + sk_pop_free_ex((_STACK *)sk, sk_##name##_call_free_func, \ + (stack_free_func)free_func); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_insert(STACK_OF(name) *sk, ptrtype p, \ + size_t where) { \ + return sk_insert((_STACK *)sk, (void *)p, where); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_delete(STACK_OF(name) *sk, \ + size_t where) { \ + return (ptrtype)sk_delete((_STACK *)sk, where); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_delete_ptr(STACK_OF(name) *sk, \ + constptrtype p) { \ + return (ptrtype)sk_delete_ptr((_STACK *)sk, (const void *)p); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_find(const STACK_OF(name) *sk, \ + size_t * out_index, constptrtype p) { \ + return sk_find((const _STACK *)sk, out_index, (const void *)p, \ + sk_##name##_call_cmp_func); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_shift(STACK_OF(name) *sk) { \ + return (ptrtype)sk_shift((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_push(STACK_OF(name) *sk, ptrtype p) { \ + return sk_push((_STACK *)sk, (void *)p); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_pop(STACK_OF(name) *sk) { \ + return (ptrtype)sk_pop((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * sk_##name##_dup(const STACK_OF(name) *sk) { \ + return (STACK_OF(name) *)sk_dup((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_sort(STACK_OF(name) *sk) { \ + sk_sort((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_is_sorted(const STACK_OF(name) *sk) { \ + return sk_is_sorted((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE stack_##name##_cmp_func sk_##name##_set_cmp_func( \ + STACK_OF(name) *sk, stack_##name##_cmp_func comp) { \ + return (stack_##name##_cmp_func)sk_set_cmp_func((_STACK *)sk, \ + (stack_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * \ + sk_##name##_deep_copy(const STACK_OF(name) *sk, \ + ptrtype(*copy_func)(ptrtype), \ + void (*free_func)(ptrtype)) { \ + return (STACK_OF(name) *)sk_deep_copy( \ + (const _STACK *)sk, sk_##name##_call_copy_func, \ + (stack_copy_func)copy_func, sk_##name##_call_free_func, \ + (stack_free_func)free_func); \ + } + +// DEFINE_NAMED_STACK_OF defines |STACK_OF(name)| to be a stack whose elements +// are |type| *. +#define DEFINE_NAMED_STACK_OF(name, type) \ + BORINGSSL_DEFINE_STACK_OF_IMPL(name, type *, const type *) \ + BORINGSSL_DEFINE_STACK_TRAITS(name, type, false) + +// DEFINE_STACK_OF defines |STACK_OF(type)| to be a stack whose elements are +// |type| *. +#define DEFINE_STACK_OF(type) DEFINE_NAMED_STACK_OF(type, type) + +// DEFINE_CONST_STACK_OF defines |STACK_OF(type)| to be a stack whose elements +// are const |type| *. +#define DEFINE_CONST_STACK_OF(type) \ + BORINGSSL_DEFINE_STACK_OF_IMPL(type, const type *, const type *) \ + BORINGSSL_DEFINE_STACK_TRAITS(type, const type, true) + +// DEFINE_SPECIAL_STACK_OF defines |STACK_OF(type)| to be a stack whose elements +// are |type|, where |type| must be a typedef for a pointer. +#define DEFINE_SPECIAL_STACK_OF(type) \ + OPENSSL_STATIC_ASSERT(sizeof(type) == sizeof(void *), \ + #type " is not a pointer"); \ + BORINGSSL_DEFINE_STACK_OF_IMPL(type, type, const type) + + +typedef char *OPENSSL_STRING; + +DEFINE_STACK_OF(void) +DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING) + + +#if defined(__cplusplus) +} // extern C +#endif + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +#include + +BSSL_NAMESPACE_BEGIN + +namespace internal { + +// Stacks defined with |DEFINE_CONST_STACK_OF| are freed with |sk_free|. +template +struct DeleterImpl< + Stack, typename std::enable_if::kIsConst>::type> { + static void Free(Stack *sk) { sk_free(reinterpret_cast<_STACK *>(sk)); } +}; + +// Stacks defined with |DEFINE_STACK_OF| are freed with |sk_pop_free| and the +// corresponding type's deleter. +template +struct DeleterImpl< + Stack, typename std::enable_if::kIsConst>::type> { + static void Free(Stack *sk) { + // sk_FOO_pop_free is defined by macros and bound by name, so we cannot + // access it from C++ here. + using Type = typename StackTraits::Type; + sk_pop_free_ex(reinterpret_cast<_STACK *>(sk), + [](stack_free_func /* unused */, void *ptr) { + DeleterImpl::Free(reinterpret_cast(ptr)); + }, + nullptr); + } +}; + +template +class StackIteratorImpl { + public: + using Type = typename StackTraits::Type; + // Iterators must be default-constructable. + StackIteratorImpl() : sk_(nullptr), idx_(0) {} + StackIteratorImpl(const Stack *sk, size_t idx) : sk_(sk), idx_(idx) {} + + bool operator==(StackIteratorImpl other) const { + return sk_ == other.sk_ && idx_ == other.idx_; + } + bool operator!=(StackIteratorImpl other) const { + return !(*this == other); + } + + Type *operator*() const { + return reinterpret_cast( + sk_value(reinterpret_cast(sk_), idx_)); + } + + StackIteratorImpl &operator++(/* prefix */) { + idx_++; + return *this; + } + + StackIteratorImpl operator++(int /* postfix */) { + StackIteratorImpl copy(*this); + ++(*this); + return copy; + } + + private: + const Stack *sk_; + size_t idx_; +}; + +template +using StackIterator = typename std::enable_if::kIsStack, + StackIteratorImpl>::type; + +} // namespace internal + +// PushToStack pushes |elem| to |sk|. It returns true on success and false on +// allocation failure. +template +inline + typename std::enable_if::kIsConst, bool>::type + PushToStack(Stack *sk, + UniquePtr::Type> elem) { + if (!sk_push(reinterpret_cast<_STACK *>(sk), elem.get())) { + return false; + } + // sk_push takes ownership on success. + elem.release(); + return true; +} + +BSSL_NAMESPACE_END + +// Define begin() and end() for stack types so C++ range for loops work. +template +inline bssl::internal::StackIterator begin(const Stack *sk) { + return bssl::internal::StackIterator(sk, 0); +} + +template +inline bssl::internal::StackIterator end(const Stack *sk) { + return bssl::internal::StackIterator( + sk, sk_num(reinterpret_cast(sk))); +} + +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_STACK_H diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.grpc_back new file mode 100644 index 000000000..04e942cb9 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/stack.h.grpc_back @@ -0,0 +1,542 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_STACK_H +#define OPENSSL_HEADER_STACK_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +// A stack, in OpenSSL, is an array of pointers. They are the most commonly +// used collection object. +// +// This file defines macros for type safe use of the stack functions. A stack +// of a specific type of object has type |STACK_OF(type)|. This can be defined +// (once) with |DEFINE_STACK_OF(type)| and declared where needed with +// |DECLARE_STACK_OF(type)|. For example: +// +// typedef struct foo_st { +// int bar; +// } FOO; +// +// DEFINE_STACK_OF(FOO) +// +// Although note that the stack will contain /pointers/ to |FOO|. +// +// A macro will be defined for each of the sk_* functions below. For +// STACK_OF(FOO), the macros would be sk_FOO_new, sk_FOO_pop etc. + + +// stack_free_func is a function that frees an element in a stack. Note its +// actual type is void (*)(T *) for some T. Low-level |sk_*| functions will be +// passed a type-specific wrapper to call it correctly. +typedef void (*stack_free_func)(void *ptr); + +// stack_copy_func is a function that copies an element in a stack. Note its +// actual type is T *(*)(T *) for some T. Low-level |sk_*| functions will be +// passed a type-specific wrapper to call it correctly. +typedef void *(*stack_copy_func)(void *ptr); + +// stack_cmp_func is a comparison function that returns a value < 0, 0 or > 0 +// if |*a| is less than, equal to or greater than |*b|, respectively. Note the +// extra indirection - the function is given a pointer to a pointer to the +// element. This differs from the usual qsort/bsearch comparison function. +// +// Note its actual type is int (*)(const T **, const T **). Low-level |sk_*| +// functions will be passed a type-specific wrapper to call it correctly. +typedef int (*stack_cmp_func)(const void **a, const void **b); + +// stack_st contains an array of pointers. It is not designed to be used +// directly, rather the wrapper macros should be used. +typedef struct stack_st { + // num contains the number of valid pointers in |data|. + size_t num; + void **data; + // sorted is non-zero if the values pointed to by |data| are in ascending + // order, based on |comp|. + int sorted; + // num_alloc contains the number of pointers allocated in the buffer pointed + // to by |data|, which may be larger than |num|. + size_t num_alloc; + // comp is an optional comparison function. + stack_cmp_func comp; +} _STACK; + + +#define STACK_OF(type) struct stack_st_##type + +#define DECLARE_STACK_OF(type) STACK_OF(type); + +// These are the raw stack functions, you shouldn't be using them. Rather you +// should be using the type stack macros implemented above. + +// sk_new creates a new, empty stack with the given comparison function, which +// may be zero. It returns the new stack or NULL on allocation failure. +OPENSSL_EXPORT _STACK *sk_new(stack_cmp_func comp); + +// sk_new_null creates a new, empty stack. It returns the new stack or NULL on +// allocation failure. +OPENSSL_EXPORT _STACK *sk_new_null(void); + +// sk_num returns the number of elements in |s|. +OPENSSL_EXPORT size_t sk_num(const _STACK *sk); + +// sk_zero resets |sk| to the empty state but does nothing to free the +// individual elements themselves. +OPENSSL_EXPORT void sk_zero(_STACK *sk); + +// sk_value returns the |i|th pointer in |sk|, or NULL if |i| is out of +// range. +OPENSSL_EXPORT void *sk_value(const _STACK *sk, size_t i); + +// sk_set sets the |i|th pointer in |sk| to |p| and returns |p|. If |i| is out +// of range, it returns NULL. +OPENSSL_EXPORT void *sk_set(_STACK *sk, size_t i, void *p); + +// sk_free frees the given stack and array of pointers, but does nothing to +// free the individual elements. Also see |sk_pop_free_ex|. +OPENSSL_EXPORT void sk_free(_STACK *sk); + +// sk_pop_free_ex calls |free_func| on each element in the stack and then frees +// the stack itself. Note this corresponds to |sk_FOO_pop_free|. It is named +// |sk_pop_free_ex| as a workaround for existing code calling an older version +// of |sk_pop_free|. +OPENSSL_EXPORT void sk_pop_free_ex(_STACK *sk, + void (*call_free_func)(stack_free_func, + void *), + stack_free_func free_func); + +// sk_insert inserts |p| into the stack at index |where|, moving existing +// elements if needed. It returns the length of the new stack, or zero on +// error. +OPENSSL_EXPORT size_t sk_insert(_STACK *sk, void *p, size_t where); + +// sk_delete removes the pointer at index |where|, moving other elements down +// if needed. It returns the removed pointer, or NULL if |where| is out of +// range. +OPENSSL_EXPORT void *sk_delete(_STACK *sk, size_t where); + +// sk_delete_ptr removes, at most, one instance of |p| from the stack based on +// pointer equality. If an instance of |p| is found then |p| is returned, +// otherwise it returns NULL. +OPENSSL_EXPORT void *sk_delete_ptr(_STACK *sk, const void *p); + +// sk_find returns the first value in the stack equal to |p|. If a comparison +// function has been set on the stack, equality is defined by it, otherwise +// pointer equality is used. If the stack is sorted, then a binary search is +// used, otherwise a linear search is performed. If a matching element is found, +// its index is written to +// |*out_index| (if |out_index| is not NULL) and one is returned. Otherwise zero +// is returned. +// +// Note this differs from OpenSSL. The type signature is slightly different, and +// OpenSSL's sk_find will implicitly sort |sk| if it has a comparison function +// defined. +OPENSSL_EXPORT int sk_find(const _STACK *sk, size_t *out_index, const void *p, + int (*call_cmp_func)(stack_cmp_func, const void **, + const void **)); + +// sk_shift removes and returns the first element in the stack, or returns NULL +// if the stack is empty. +OPENSSL_EXPORT void *sk_shift(_STACK *sk); + +// sk_push appends |p| to the stack and returns the length of the new stack, or +// 0 on allocation failure. +OPENSSL_EXPORT size_t sk_push(_STACK *sk, void *p); + +// sk_pop returns and removes the last element on the stack, or NULL if the +// stack is empty. +OPENSSL_EXPORT void *sk_pop(_STACK *sk); + +// sk_dup performs a shallow copy of a stack and returns the new stack, or NULL +// on error. +OPENSSL_EXPORT _STACK *sk_dup(const _STACK *sk); + +// sk_sort sorts the elements of |sk| into ascending order based on the +// comparison function. The stack maintains a |sorted| flag and sorting an +// already sorted stack is a no-op. +OPENSSL_EXPORT void sk_sort(_STACK *sk); + +// sk_is_sorted returns one if |sk| is known to be sorted and zero +// otherwise. +OPENSSL_EXPORT int sk_is_sorted(const _STACK *sk); + +// sk_set_cmp_func sets the comparison function to be used by |sk| and returns +// the previous one. +OPENSSL_EXPORT stack_cmp_func sk_set_cmp_func(_STACK *sk, stack_cmp_func comp); + +// sk_deep_copy performs a copy of |sk| and of each of the non-NULL elements in +// |sk| by using |copy_func|. If an error occurs, |free_func| is used to free +// any copies already made and NULL is returned. +OPENSSL_EXPORT _STACK *sk_deep_copy( + const _STACK *sk, void *(*call_copy_func)(stack_copy_func, void *), + stack_copy_func copy_func, void (*call_free_func)(stack_free_func, void *), + stack_free_func free_func); + + +// Deprecated functions. + +// sk_pop_free behaves like |sk_pop_free_ex| but performs an invalid function +// pointer cast. It exists because some existing callers called |sk_pop_free| +// directly. +// +// TODO(davidben): Migrate callers to bssl::UniquePtr and remove this. +OPENSSL_EXPORT void sk_pop_free(_STACK *sk, stack_free_func free_func); + + +// Defining stack types. +// +// This set of macros is used to emit the typed functions that act on a +// |STACK_OF(T)|. + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { +BSSL_NAMESPACE_BEGIN +namespace internal { +template +struct StackTraits {}; +} +BSSL_NAMESPACE_END +} + +#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) \ + extern "C++" { \ + BSSL_NAMESPACE_BEGIN \ + namespace internal { \ + template <> \ + struct StackTraits { \ + static constexpr bool kIsStack = true; \ + using Type = type; \ + static constexpr bool kIsConst = is_const; \ + }; \ + } \ + BSSL_NAMESPACE_END \ + } + +#else +#define BORINGSSL_DEFINE_STACK_TRAITS(name, type, is_const) +#endif + +#define BORINGSSL_DEFINE_STACK_OF_IMPL(name, ptrtype, constptrtype) \ + DECLARE_STACK_OF(name) \ + \ + typedef void (*stack_##name##_free_func)(ptrtype); \ + typedef ptrtype (*stack_##name##_copy_func)(ptrtype); \ + typedef int (*stack_##name##_cmp_func)(constptrtype *a, constptrtype *b); \ + \ + OPENSSL_INLINE void sk_##name##_call_free_func(stack_free_func free_func, \ + void *ptr) { \ + ((stack_##name##_free_func)free_func)((ptrtype)ptr); \ + } \ + \ + OPENSSL_INLINE void *sk_##name##_call_copy_func(stack_copy_func copy_func, \ + void *ptr) { \ + return (void *)((stack_##name##_copy_func)copy_func)((ptrtype)ptr); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_call_cmp_func( \ + stack_cmp_func cmp_func, const void **a, const void **b) { \ + constptrtype a_ptr = (constptrtype)*a; \ + constptrtype b_ptr = (constptrtype)*b; \ + return ((stack_##name##_cmp_func)cmp_func)(&a_ptr, &b_ptr); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * \ + sk_##name##_new(stack_##name##_cmp_func comp) { \ + return (STACK_OF(name) *)sk_new((stack_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) *sk_##name##_new_null(void) { \ + return (STACK_OF(name) *)sk_new_null(); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_num(const STACK_OF(name) *sk) { \ + return sk_num((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_zero(STACK_OF(name) *sk) { \ + sk_zero((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_value(const STACK_OF(name) *sk, \ + size_t i) { \ + return (ptrtype)sk_value((const _STACK *)sk, i); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_set(STACK_OF(name) *sk, size_t i, \ + ptrtype p) { \ + return (ptrtype)sk_set((_STACK *)sk, i, (void *)p); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_free(STACK_OF(name) * sk) { \ + sk_free((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_pop_free( \ + STACK_OF(name) * sk, stack_##name##_free_func free_func) { \ + sk_pop_free_ex((_STACK *)sk, sk_##name##_call_free_func, \ + (stack_free_func)free_func); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_insert(STACK_OF(name) *sk, ptrtype p, \ + size_t where) { \ + return sk_insert((_STACK *)sk, (void *)p, where); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_delete(STACK_OF(name) *sk, \ + size_t where) { \ + return (ptrtype)sk_delete((_STACK *)sk, where); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_delete_ptr(STACK_OF(name) *sk, \ + constptrtype p) { \ + return (ptrtype)sk_delete_ptr((_STACK *)sk, (const void *)p); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_find(const STACK_OF(name) *sk, \ + size_t * out_index, constptrtype p) { \ + return sk_find((const _STACK *)sk, out_index, (const void *)p, \ + sk_##name##_call_cmp_func); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_shift(STACK_OF(name) *sk) { \ + return (ptrtype)sk_shift((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE size_t sk_##name##_push(STACK_OF(name) *sk, ptrtype p) { \ + return sk_push((_STACK *)sk, (void *)p); \ + } \ + \ + OPENSSL_INLINE ptrtype sk_##name##_pop(STACK_OF(name) *sk) { \ + return (ptrtype)sk_pop((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * sk_##name##_dup(const STACK_OF(name) *sk) { \ + return (STACK_OF(name) *)sk_dup((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE void sk_##name##_sort(STACK_OF(name) *sk) { \ + sk_sort((_STACK *)sk); \ + } \ + \ + OPENSSL_INLINE int sk_##name##_is_sorted(const STACK_OF(name) *sk) { \ + return sk_is_sorted((const _STACK *)sk); \ + } \ + \ + OPENSSL_INLINE stack_##name##_cmp_func sk_##name##_set_cmp_func( \ + STACK_OF(name) *sk, stack_##name##_cmp_func comp) { \ + return (stack_##name##_cmp_func)sk_set_cmp_func((_STACK *)sk, \ + (stack_cmp_func)comp); \ + } \ + \ + OPENSSL_INLINE STACK_OF(name) * \ + sk_##name##_deep_copy(const STACK_OF(name) *sk, \ + ptrtype(*copy_func)(ptrtype), \ + void (*free_func)(ptrtype)) { \ + return (STACK_OF(name) *)sk_deep_copy( \ + (const _STACK *)sk, sk_##name##_call_copy_func, \ + (stack_copy_func)copy_func, sk_##name##_call_free_func, \ + (stack_free_func)free_func); \ + } + +// DEFINE_NAMED_STACK_OF defines |STACK_OF(name)| to be a stack whose elements +// are |type| *. +#define DEFINE_NAMED_STACK_OF(name, type) \ + BORINGSSL_DEFINE_STACK_OF_IMPL(name, type *, const type *) \ + BORINGSSL_DEFINE_STACK_TRAITS(name, type, false) + +// DEFINE_STACK_OF defines |STACK_OF(type)| to be a stack whose elements are +// |type| *. +#define DEFINE_STACK_OF(type) DEFINE_NAMED_STACK_OF(type, type) + +// DEFINE_CONST_STACK_OF defines |STACK_OF(type)| to be a stack whose elements +// are const |type| *. +#define DEFINE_CONST_STACK_OF(type) \ + BORINGSSL_DEFINE_STACK_OF_IMPL(type, const type *, const type *) \ + BORINGSSL_DEFINE_STACK_TRAITS(type, const type, true) + +// DEFINE_SPECIAL_STACK_OF defines |STACK_OF(type)| to be a stack whose elements +// are |type|, where |type| must be a typedef for a pointer. +#define DEFINE_SPECIAL_STACK_OF(type) \ + OPENSSL_STATIC_ASSERT(sizeof(type) == sizeof(void *), \ + #type " is not a pointer"); \ + BORINGSSL_DEFINE_STACK_OF_IMPL(type, type, const type) + + +typedef char *OPENSSL_STRING; + +DEFINE_STACK_OF(void) +DEFINE_SPECIAL_STACK_OF(OPENSSL_STRING) + + +#if defined(__cplusplus) +} // extern C +#endif + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +#include + +BSSL_NAMESPACE_BEGIN + +namespace internal { + +// Stacks defined with |DEFINE_CONST_STACK_OF| are freed with |sk_free|. +template +struct DeleterImpl< + Stack, typename std::enable_if::kIsConst>::type> { + static void Free(Stack *sk) { sk_free(reinterpret_cast<_STACK *>(sk)); } +}; + +// Stacks defined with |DEFINE_STACK_OF| are freed with |sk_pop_free| and the +// corresponding type's deleter. +template +struct DeleterImpl< + Stack, typename std::enable_if::kIsConst>::type> { + static void Free(Stack *sk) { + // sk_FOO_pop_free is defined by macros and bound by name, so we cannot + // access it from C++ here. + using Type = typename StackTraits::Type; + sk_pop_free_ex(reinterpret_cast<_STACK *>(sk), + [](stack_free_func /* unused */, void *ptr) { + DeleterImpl::Free(reinterpret_cast(ptr)); + }, + nullptr); + } +}; + +template +class StackIteratorImpl { + public: + using Type = typename StackTraits::Type; + // Iterators must be default-constructable. + StackIteratorImpl() : sk_(nullptr), idx_(0) {} + StackIteratorImpl(const Stack *sk, size_t idx) : sk_(sk), idx_(idx) {} + + bool operator==(StackIteratorImpl other) const { + return sk_ == other.sk_ && idx_ == other.idx_; + } + bool operator!=(StackIteratorImpl other) const { + return !(*this == other); + } + + Type *operator*() const { + return reinterpret_cast( + sk_value(reinterpret_cast(sk_), idx_)); + } + + StackIteratorImpl &operator++(/* prefix */) { + idx_++; + return *this; + } + + StackIteratorImpl operator++(int /* postfix */) { + StackIteratorImpl copy(*this); + ++(*this); + return copy; + } + + private: + const Stack *sk_; + size_t idx_; +}; + +template +using StackIterator = typename std::enable_if::kIsStack, + StackIteratorImpl>::type; + +} // namespace internal + +// PushToStack pushes |elem| to |sk|. It returns true on success and false on +// allocation failure. +template +inline + typename std::enable_if::kIsConst, bool>::type + PushToStack(Stack *sk, + UniquePtr::Type> elem) { + if (!sk_push(reinterpret_cast<_STACK *>(sk), elem.get())) { + return false; + } + // sk_push takes ownership on success. + elem.release(); + return true; +} + +BSSL_NAMESPACE_END + +// Define begin() and end() for stack types so C++ range for loops work. +template +inline bssl::internal::StackIterator begin(const Stack *sk) { + return bssl::internal::StackIterator(sk, 0); +} + +template +inline bssl::internal::StackIterator end(const Stack *sk) { + return bssl::internal::StackIterator( + sk, sk_num(reinterpret_cast(sk))); +} + +} // extern C++ +#endif + +#endif // OPENSSL_HEADER_STACK_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/thread.h b/Pods/BoringSSL-GRPC/src/include/openssl/thread.h similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/thread.h rename to Pods/BoringSSL-GRPC/src/include/openssl/thread.h index 6f62a9f61..cafd14b84 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/thread.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/thread.h @@ -66,7 +66,7 @@ extern "C" { #endif -#if defined(OPENSSL_NO_THREADS) +#if !defined(OPENSSL_THREADS) typedef struct crypto_mutex_st { char padding; // Empty structs have different sizes in C and C++. } CRYPTO_MUTEX; diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.back new file mode 100644 index 000000000..91706fec2 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.back @@ -0,0 +1,191 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_THREAD_H +#define OPENSSL_HEADER_THREAD_H + +#include + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if !defined(OPENSSL_THREADS) +typedef struct crypto_mutex_st { + char padding; // Empty structs have different sizes in C and C++. +} CRYPTO_MUTEX; +#elif defined(OPENSSL_WINDOWS) +// CRYPTO_MUTEX can appear in public header files so we really don't want to +// pull in windows.h. It's statically asserted that this structure is large +// enough to contain a Windows SRWLOCK by thread_win.c. +typedef union crypto_mutex_st { + void *handle; +} CRYPTO_MUTEX; +#elif defined(__MACH__) && defined(__APPLE__) +typedef pthread_rwlock_t CRYPTO_MUTEX; +#else +// It is reasonable to include pthread.h on non-Windows systems, however the +// |pthread_rwlock_t| that we need is hidden under feature flags, and we can't +// ensure that we'll be able to get it. It's statically asserted that this +// structure is large enough to contain a |pthread_rwlock_t| by +// thread_pthread.c. +typedef union crypto_mutex_st { + double alignment; + uint8_t padding[3*sizeof(int) + 5*sizeof(unsigned) + 16 + 8]; +} CRYPTO_MUTEX; +#endif + +// CRYPTO_refcount_t is the type of a reference count. +// +// Since some platforms use C11 atomics to access this, it should have the +// _Atomic qualifier. However, this header is included by C++ programs as well +// as C code that might not set -std=c11. So, in practice, it's not possible to +// do that. Instead we statically assert that the size and native alignment of +// a plain uint32_t and an _Atomic uint32_t are equal in refcount_c11.c. +typedef uint32_t CRYPTO_refcount_t; + + +// Deprecated functions. +// +// Historically, OpenSSL required callers to provide locking callbacks. +// BoringSSL is thread-safe by default, but some old code calls these functions +// and so no-op implementations are provided. + +// These defines do nothing but are provided to make old code easier to +// compile. +#define CRYPTO_LOCK 1 +#define CRYPTO_UNLOCK 2 +#define CRYPTO_READ 4 +#define CRYPTO_WRITE 8 + +// CRYPTO_num_locks returns one. (This is non-zero that callers who allocate +// sizeof(lock) times this value don't get zero and then fail because malloc(0) +// returned NULL.) +OPENSSL_EXPORT int CRYPTO_num_locks(void); + +// CRYPTO_set_locking_callback does nothing. +OPENSSL_EXPORT void CRYPTO_set_locking_callback( + void (*func)(int mode, int lock_num, const char *file, int line)); + +// CRYPTO_set_add_lock_callback does nothing. +OPENSSL_EXPORT void CRYPTO_set_add_lock_callback(int (*func)( + int *num, int amount, int lock_num, const char *file, int line)); + +// CRYPTO_get_locking_callback returns NULL. +OPENSSL_EXPORT void (*CRYPTO_get_locking_callback(void))(int mode, int lock_num, + const char *file, + int line); + +// CRYPTO_get_lock_name returns a fixed, dummy string. +OPENSSL_EXPORT const char *CRYPTO_get_lock_name(int lock_num); + +// CRYPTO_THREADID_set_callback returns one. +OPENSSL_EXPORT int CRYPTO_THREADID_set_callback( + void (*threadid_func)(CRYPTO_THREADID *threadid)); + +// CRYPTO_THREADID_set_numeric does nothing. +OPENSSL_EXPORT void CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, + unsigned long val); + +// CRYPTO_THREADID_set_pointer does nothing. +OPENSSL_EXPORT void CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr); + +// CRYPTO_THREADID_current does nothing. +OPENSSL_EXPORT void CRYPTO_THREADID_current(CRYPTO_THREADID *id); + +// CRYPTO_set_id_callback does nothing. +OPENSSL_EXPORT void CRYPTO_set_id_callback(unsigned long (*func)(void)); + +typedef struct { + int references; + struct CRYPTO_dynlock_value *data; +} CRYPTO_dynlock; + +// CRYPTO_set_dynlock_create_callback does nothing. +OPENSSL_EXPORT void CRYPTO_set_dynlock_create_callback( + struct CRYPTO_dynlock_value *(*dyn_create_function)(const char *file, + int line)); + +// CRYPTO_set_dynlock_lock_callback does nothing. +OPENSSL_EXPORT void CRYPTO_set_dynlock_lock_callback(void (*dyn_lock_function)( + int mode, struct CRYPTO_dynlock_value *l, const char *file, int line)); + +// CRYPTO_set_dynlock_destroy_callback does nothing. +OPENSSL_EXPORT void CRYPTO_set_dynlock_destroy_callback( + void (*dyn_destroy_function)(struct CRYPTO_dynlock_value *l, + const char *file, int line)); + +// CRYPTO_get_dynlock_create_callback returns NULL. +OPENSSL_EXPORT struct CRYPTO_dynlock_value *( + *CRYPTO_get_dynlock_create_callback(void))(const char *file, int line); + +// CRYPTO_get_dynlock_lock_callback returns NULL. +OPENSSL_EXPORT void (*CRYPTO_get_dynlock_lock_callback(void))( + int mode, struct CRYPTO_dynlock_value *l, const char *file, int line); + +// CRYPTO_get_dynlock_destroy_callback returns NULL. +OPENSSL_EXPORT void (*CRYPTO_get_dynlock_destroy_callback(void))( + struct CRYPTO_dynlock_value *l, const char *file, int line); + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_THREAD_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/thread.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/include/openssl/thread.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/thread.h.grpc_back index 98073b078..91706fec2 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/thread.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/thread.h.grpc_back @@ -66,7 +66,7 @@ extern "C" { #endif -#if defined(OPENSSL_NO_THREADS) +#if !defined(OPENSSL_THREADS) typedef struct crypto_mutex_st { char padding; // Empty structs have different sizes in C and C++. } CRYPTO_MUTEX; diff --git a/Pods/BoringSSL-GRPC/include/openssl/tls1.h b/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/tls1.h rename to Pods/BoringSSL-GRPC/src/include/openssl/tls1.h index 67dbf7727..0377670e4 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/tls1.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h @@ -205,13 +205,19 @@ extern "C" { // ExtensionType value from draft-ietf-tokbind-negotiation-10 #define TLSEXT_TYPE_token_binding 24 -// ExtensionType value from draft-ietf-quic-tls -#define TLSEXT_TYPE_quic_transport_parameters 26 +// ExtensionType value from draft-ietf-quic-tls. Note that this collides with +// TLS-LTS and, based on scans, something else too. Since it's QUIC-only, that +// shouldn't be a problem in practice. +#define TLSEXT_TYPE_quic_transport_parameters 0xffa5 + +// ExtensionType value assigned to +// https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03 +#define TLSEXT_TYPE_cert_compression 27 // ExtensionType value from RFC4507 #define TLSEXT_TYPE_session_ticket 35 -// ExtensionType values from draft-ietf-tls-tls13-18 +// ExtensionType values from RFC8446 #define TLSEXT_TYPE_supported_groups 10 #define TLSEXT_TYPE_pre_shared_key 41 #define TLSEXT_TYPE_early_data 42 @@ -219,11 +225,16 @@ extern "C" { #define TLSEXT_TYPE_cookie 44 #define TLSEXT_TYPE_psk_key_exchange_modes 45 #define TLSEXT_TYPE_certificate_authorities 47 +#define TLSEXT_TYPE_signature_algorithms_cert 50 #define TLSEXT_TYPE_key_share 51 // ExtensionType value from RFC5746 #define TLSEXT_TYPE_renegotiate 0xff01 +// ExtensionType value from draft-ietf-tls-subcerts. This is not an IANA defined +// extension number. +#define TLSEXT_TYPE_delegated_credential 0xff02 + // ExtensionType value from RFC6962 #define TLSEXT_TYPE_certificate_timestamp 18 @@ -233,10 +244,8 @@ extern "C" { // This is not an IANA defined extension number #define TLSEXT_TYPE_channel_id 30032 -// This is not an IANA defined extension number -#define TLSEXT_TYPE_dummy_pq_padding 54537 - // status request value from RFC 3546 +#define TLSEXT_STATUSTYPE_nothing (-1) #define TLSEXT_STATUSTYPE_ocsp 1 // ECPointFormat values from RFC 4492 @@ -258,6 +267,10 @@ extern "C" { #define TLSEXT_hash_sha384 5 #define TLSEXT_hash_sha512 6 +// From https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03#section-3 +#define TLSEXT_cert_compression_zlib 1 +#define TLSEXT_cert_compression_brotli 2 + #define TLSEXT_MAXLEN_host_name 255 // PSK ciphersuites from 4279 @@ -422,7 +435,7 @@ extern "C" { #define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0x0300CCA9 #define TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0x0300CCAC -// TLS 1.3 ciphersuites from draft-ietf-tls-tls13-16 +// TLS 1.3 ciphersuites from RFC 8446. #define TLS1_CK_AES_128_GCM_SHA256 0x03001301 #define TLS1_CK_AES_256_GCM_SHA384 0x03001302 #define TLS1_CK_CHACHA20_POLY1305_SHA256 0x03001303 @@ -594,10 +607,10 @@ extern "C" { #define TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 \ "ECDHE-PSK-CHACHA20-POLY1305" -// TLS 1.3 ciphersuites from draft-ietf-tls-tls13-16 -#define TLS1_TXT_AES_128_GCM_SHA256 "AEAD-AES128-GCM-SHA256" -#define TLS1_TXT_AES_256_GCM_SHA384 "AEAD-AES256-GCM-SHA384" -#define TLS1_TXT_CHACHA20_POLY1305_SHA256 "AEAD-CHACHA20-POLY1305-SHA256" +// TLS 1.3 ciphersuites from RFC 8446. +#define TLS1_TXT_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" +#define TLS1_TXT_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" +#define TLS1_TXT_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" #define TLS_CT_RSA_SIGN 1 diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.back new file mode 100644 index 000000000..8b61d5ad0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.back @@ -0,0 +1,631 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * + * Portions of the attached software ("Contribution") are developed by + * SUN MICROSYSTEMS, INC., and are contributed to the OpenSSL project. + * + * The Contribution is licensed pursuant to the OpenSSL open source + * license provided above. + * + * ECC cipher suite support in OpenSSL originally written by + * Vipul Gupta and Sumit Gupta of Sun Microsystems Laboratories. + * + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. + */ + +#ifndef OPENSSL_HEADER_TLS1_H +#define OPENSSL_HEADER_TLS1_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +#define TLS1_AD_END_OF_EARLY_DATA 1 +#define TLS1_AD_DECRYPTION_FAILED 21 +#define TLS1_AD_RECORD_OVERFLOW 22 +#define TLS1_AD_UNKNOWN_CA 48 +#define TLS1_AD_ACCESS_DENIED 49 +#define TLS1_AD_DECODE_ERROR 50 +#define TLS1_AD_DECRYPT_ERROR 51 +#define TLS1_AD_EXPORT_RESTRICTION 60 +#define TLS1_AD_PROTOCOL_VERSION 70 +#define TLS1_AD_INSUFFICIENT_SECURITY 71 +#define TLS1_AD_INTERNAL_ERROR 80 +#define TLS1_AD_USER_CANCELLED 90 +#define TLS1_AD_NO_RENEGOTIATION 100 +#define TLS1_AD_MISSING_EXTENSION 109 +// codes 110-114 are from RFC3546 +#define TLS1_AD_UNSUPPORTED_EXTENSION 110 +#define TLS1_AD_CERTIFICATE_UNOBTAINABLE 111 +#define TLS1_AD_UNRECOGNIZED_NAME 112 +#define TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE 113 +#define TLS1_AD_BAD_CERTIFICATE_HASH_VALUE 114 +#define TLS1_AD_UNKNOWN_PSK_IDENTITY 115 +#define TLS1_AD_CERTIFICATE_REQUIRED 116 + +// ExtensionType values from RFC6066 +#define TLSEXT_TYPE_server_name 0 +#define TLSEXT_TYPE_status_request 5 + +// ExtensionType values from RFC4492 +#define TLSEXT_TYPE_ec_point_formats 11 + +// ExtensionType values from RFC5246 +#define TLSEXT_TYPE_signature_algorithms 13 + +// ExtensionType value from RFC5764 +#define TLSEXT_TYPE_srtp 14 + +// ExtensionType value from RFC7301 +#define TLSEXT_TYPE_application_layer_protocol_negotiation 16 + +// ExtensionType value from RFC7685 +#define TLSEXT_TYPE_padding 21 + +// ExtensionType value from RFC7627 +#define TLSEXT_TYPE_extended_master_secret 23 + +// ExtensionType value from draft-ietf-tokbind-negotiation-10 +#define TLSEXT_TYPE_token_binding 24 + +// ExtensionType value from draft-ietf-quic-tls. Note that this collides with +// TLS-LTS and, based on scans, something else too. Since it's QUIC-only, that +// shouldn't be a problem in practice. +#define TLSEXT_TYPE_quic_transport_parameters 0xffa5 + +// ExtensionType value assigned to +// https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03 +#define TLSEXT_TYPE_cert_compression 27 + +// ExtensionType value from RFC4507 +#define TLSEXT_TYPE_session_ticket 35 + +// ExtensionType values from RFC8446 +#define TLSEXT_TYPE_supported_groups 10 +#define TLSEXT_TYPE_pre_shared_key 41 +#define TLSEXT_TYPE_early_data 42 +#define TLSEXT_TYPE_supported_versions 43 +#define TLSEXT_TYPE_cookie 44 +#define TLSEXT_TYPE_psk_key_exchange_modes 45 +#define TLSEXT_TYPE_certificate_authorities 47 +#define TLSEXT_TYPE_signature_algorithms_cert 50 +#define TLSEXT_TYPE_key_share 51 + +// ExtensionType value from RFC5746 +#define TLSEXT_TYPE_renegotiate 0xff01 + +// ExtensionType value from draft-ietf-tls-subcerts. This is not an IANA defined +// extension number. +#define TLSEXT_TYPE_delegated_credential 0xff02 + +// ExtensionType value from RFC6962 +#define TLSEXT_TYPE_certificate_timestamp 18 + +// This is not an IANA defined extension number +#define TLSEXT_TYPE_next_proto_neg 13172 + +// This is not an IANA defined extension number +#define TLSEXT_TYPE_channel_id 30032 + +// status request value from RFC 3546 +#define TLSEXT_STATUSTYPE_nothing (-1) +#define TLSEXT_STATUSTYPE_ocsp 1 + +// ECPointFormat values from RFC 4492 +#define TLSEXT_ECPOINTFORMAT_uncompressed 0 +#define TLSEXT_ECPOINTFORMAT_ansiX962_compressed_prime 1 + +// Signature and hash algorithms from RFC 5246 + +#define TLSEXT_signature_anonymous 0 +#define TLSEXT_signature_rsa 1 +#define TLSEXT_signature_dsa 2 +#define TLSEXT_signature_ecdsa 3 + +#define TLSEXT_hash_none 0 +#define TLSEXT_hash_md5 1 +#define TLSEXT_hash_sha1 2 +#define TLSEXT_hash_sha224 3 +#define TLSEXT_hash_sha256 4 +#define TLSEXT_hash_sha384 5 +#define TLSEXT_hash_sha512 6 + +// From https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03#section-3 +#define TLSEXT_cert_compression_zlib 1 +#define TLSEXT_cert_compression_brotli 2 + +#define TLSEXT_MAXLEN_host_name 255 + +// PSK ciphersuites from 4279 +#define TLS1_CK_PSK_WITH_RC4_128_SHA 0x0300008A +#define TLS1_CK_PSK_WITH_3DES_EDE_CBC_SHA 0x0300008B +#define TLS1_CK_PSK_WITH_AES_128_CBC_SHA 0x0300008C +#define TLS1_CK_PSK_WITH_AES_256_CBC_SHA 0x0300008D + +// PSK ciphersuites from RFC 5489 +#define TLS1_CK_ECDHE_PSK_WITH_AES_128_CBC_SHA 0x0300C035 +#define TLS1_CK_ECDHE_PSK_WITH_AES_256_CBC_SHA 0x0300C036 + +// Additional TLS ciphersuites from expired Internet Draft +// draft-ietf-tls-56-bit-ciphersuites-01.txt +// (available if TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES is defined, see +// s3_lib.c). We actually treat them like SSL 3.0 ciphers, which we probably +// shouldn't. Note that the first two are actually not in the IDs. +#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_MD5 0x03000060 // not in ID +#define TLS1_CK_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 0x03000061 // not in ID +#define TLS1_CK_RSA_EXPORT1024_WITH_DES_CBC_SHA 0x03000062 +#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA 0x03000063 +#define TLS1_CK_RSA_EXPORT1024_WITH_RC4_56_SHA 0x03000064 +#define TLS1_CK_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA 0x03000065 +#define TLS1_CK_DHE_DSS_WITH_RC4_128_SHA 0x03000066 + +// AES ciphersuites from RFC3268 + +#define TLS1_CK_RSA_WITH_AES_128_SHA 0x0300002F +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA 0x03000030 +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA 0x03000031 +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA 0x03000032 +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA 0x03000033 +#define TLS1_CK_ADH_WITH_AES_128_SHA 0x03000034 + +#define TLS1_CK_RSA_WITH_AES_256_SHA 0x03000035 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA 0x03000036 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA 0x03000037 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA 0x03000038 +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA 0x03000039 +#define TLS1_CK_ADH_WITH_AES_256_SHA 0x0300003A + +// TLS v1.2 ciphersuites +#define TLS1_CK_RSA_WITH_NULL_SHA256 0x0300003B +#define TLS1_CK_RSA_WITH_AES_128_SHA256 0x0300003C +#define TLS1_CK_RSA_WITH_AES_256_SHA256 0x0300003D +#define TLS1_CK_DH_DSS_WITH_AES_128_SHA256 0x0300003E +#define TLS1_CK_DH_RSA_WITH_AES_128_SHA256 0x0300003F +#define TLS1_CK_DHE_DSS_WITH_AES_128_SHA256 0x03000040 + +// Camellia ciphersuites from RFC4132 +#define TLS1_CK_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000041 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000042 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000043 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA 0x03000044 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA 0x03000045 +#define TLS1_CK_ADH_WITH_CAMELLIA_128_CBC_SHA 0x03000046 + +// TLS v1.2 ciphersuites +#define TLS1_CK_DHE_RSA_WITH_AES_128_SHA256 0x03000067 +#define TLS1_CK_DH_DSS_WITH_AES_256_SHA256 0x03000068 +#define TLS1_CK_DH_RSA_WITH_AES_256_SHA256 0x03000069 +#define TLS1_CK_DHE_DSS_WITH_AES_256_SHA256 0x0300006A +#define TLS1_CK_DHE_RSA_WITH_AES_256_SHA256 0x0300006B +#define TLS1_CK_ADH_WITH_AES_128_SHA256 0x0300006C +#define TLS1_CK_ADH_WITH_AES_256_SHA256 0x0300006D + +// Camellia ciphersuites from RFC4132 +#define TLS1_CK_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000084 +#define TLS1_CK_DH_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000085 +#define TLS1_CK_DH_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000086 +#define TLS1_CK_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA 0x03000087 +#define TLS1_CK_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA 0x03000088 +#define TLS1_CK_ADH_WITH_CAMELLIA_256_CBC_SHA 0x03000089 + +// SEED ciphersuites from RFC4162 +#define TLS1_CK_RSA_WITH_SEED_SHA 0x03000096 +#define TLS1_CK_DH_DSS_WITH_SEED_SHA 0x03000097 +#define TLS1_CK_DH_RSA_WITH_SEED_SHA 0x03000098 +#define TLS1_CK_DHE_DSS_WITH_SEED_SHA 0x03000099 +#define TLS1_CK_DHE_RSA_WITH_SEED_SHA 0x0300009A +#define TLS1_CK_ADH_WITH_SEED_SHA 0x0300009B + +// TLS v1.2 GCM ciphersuites from RFC5288 +#define TLS1_CK_RSA_WITH_AES_128_GCM_SHA256 0x0300009C +#define TLS1_CK_RSA_WITH_AES_256_GCM_SHA384 0x0300009D +#define TLS1_CK_DHE_RSA_WITH_AES_128_GCM_SHA256 0x0300009E +#define TLS1_CK_DHE_RSA_WITH_AES_256_GCM_SHA384 0x0300009F +#define TLS1_CK_DH_RSA_WITH_AES_128_GCM_SHA256 0x030000A0 +#define TLS1_CK_DH_RSA_WITH_AES_256_GCM_SHA384 0x030000A1 +#define TLS1_CK_DHE_DSS_WITH_AES_128_GCM_SHA256 0x030000A2 +#define TLS1_CK_DHE_DSS_WITH_AES_256_GCM_SHA384 0x030000A3 +#define TLS1_CK_DH_DSS_WITH_AES_128_GCM_SHA256 0x030000A4 +#define TLS1_CK_DH_DSS_WITH_AES_256_GCM_SHA384 0x030000A5 +#define TLS1_CK_ADH_WITH_AES_128_GCM_SHA256 0x030000A6 +#define TLS1_CK_ADH_WITH_AES_256_GCM_SHA384 0x030000A7 + +// ECC ciphersuites from RFC4492 +#define TLS1_CK_ECDH_ECDSA_WITH_NULL_SHA 0x0300C001 +#define TLS1_CK_ECDH_ECDSA_WITH_RC4_128_SHA 0x0300C002 +#define TLS1_CK_ECDH_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C003 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_CBC_SHA 0x0300C004 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_CBC_SHA 0x0300C005 + +#define TLS1_CK_ECDHE_ECDSA_WITH_NULL_SHA 0x0300C006 +#define TLS1_CK_ECDHE_ECDSA_WITH_RC4_128_SHA 0x0300C007 +#define TLS1_CK_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA 0x0300C008 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_CBC_SHA 0x0300C009 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_CBC_SHA 0x0300C00A + +#define TLS1_CK_ECDH_RSA_WITH_NULL_SHA 0x0300C00B +#define TLS1_CK_ECDH_RSA_WITH_RC4_128_SHA 0x0300C00C +#define TLS1_CK_ECDH_RSA_WITH_DES_192_CBC3_SHA 0x0300C00D +#define TLS1_CK_ECDH_RSA_WITH_AES_128_CBC_SHA 0x0300C00E +#define TLS1_CK_ECDH_RSA_WITH_AES_256_CBC_SHA 0x0300C00F + +#define TLS1_CK_ECDHE_RSA_WITH_NULL_SHA 0x0300C010 +#define TLS1_CK_ECDHE_RSA_WITH_RC4_128_SHA 0x0300C011 +#define TLS1_CK_ECDHE_RSA_WITH_DES_192_CBC3_SHA 0x0300C012 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_CBC_SHA 0x0300C013 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_CBC_SHA 0x0300C014 + +#define TLS1_CK_ECDH_anon_WITH_NULL_SHA 0x0300C015 +#define TLS1_CK_ECDH_anon_WITH_RC4_128_SHA 0x0300C016 +#define TLS1_CK_ECDH_anon_WITH_DES_192_CBC3_SHA 0x0300C017 +#define TLS1_CK_ECDH_anon_WITH_AES_128_CBC_SHA 0x0300C018 +#define TLS1_CK_ECDH_anon_WITH_AES_256_CBC_SHA 0x0300C019 + +// SRP ciphersuites from RFC 5054 +#define TLS1_CK_SRP_SHA_WITH_3DES_EDE_CBC_SHA 0x0300C01A +#define TLS1_CK_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA 0x0300C01B +#define TLS1_CK_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA 0x0300C01C +#define TLS1_CK_SRP_SHA_WITH_AES_128_CBC_SHA 0x0300C01D +#define TLS1_CK_SRP_SHA_RSA_WITH_AES_128_CBC_SHA 0x0300C01E +#define TLS1_CK_SRP_SHA_DSS_WITH_AES_128_CBC_SHA 0x0300C01F +#define TLS1_CK_SRP_SHA_WITH_AES_256_CBC_SHA 0x0300C020 +#define TLS1_CK_SRP_SHA_RSA_WITH_AES_256_CBC_SHA 0x0300C021 +#define TLS1_CK_SRP_SHA_DSS_WITH_AES_256_CBC_SHA 0x0300C022 + +// ECDH HMAC based ciphersuites from RFC5289 + +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256 0x0300C023 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384 0x0300C024 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_SHA256 0x0300C025 +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_SHA384 0x0300C026 +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256 0x0300C027 +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384 0x0300C028 +#define TLS1_CK_ECDH_RSA_WITH_AES_128_SHA256 0x0300C029 +#define TLS1_CK_ECDH_RSA_WITH_AES_256_SHA384 0x0300C02A + +// ECDH GCM based ciphersuites from RFC5289 +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02B +#define TLS1_CK_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02C +#define TLS1_CK_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 0x0300C02D +#define TLS1_CK_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 0x0300C02E +#define TLS1_CK_ECDHE_RSA_WITH_AES_128_GCM_SHA256 0x0300C02F +#define TLS1_CK_ECDHE_RSA_WITH_AES_256_GCM_SHA384 0x0300C030 +#define TLS1_CK_ECDH_RSA_WITH_AES_128_GCM_SHA256 0x0300C031 +#define TLS1_CK_ECDH_RSA_WITH_AES_256_GCM_SHA384 0x0300C032 + +// ChaCha20-Poly1305 cipher suites from RFC 7905. +#define TLS1_CK_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 0x0300CCA8 +#define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0x0300CCA9 +#define TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0x0300CCAC + +// TLS 1.3 ciphersuites from RFC 8446. +#define TLS1_CK_AES_128_GCM_SHA256 0x03001301 +#define TLS1_CK_AES_256_GCM_SHA384 0x03001302 +#define TLS1_CK_CHACHA20_POLY1305_SHA256 0x03001303 + +// XXX +// Inconsistency alert: +// The OpenSSL names of ciphers with ephemeral DH here include the string +// "DHE", while elsewhere it has always been "EDH". +// (The alias for the list of all such ciphers also is "EDH".) +// The specifications speak of "EDH"; maybe we should allow both forms +// for everything. +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_MD5 "EXP1024-RC4-MD5" +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC2_CBC_56_MD5 "EXP1024-RC2-CBC-MD5" +#define TLS1_TXT_RSA_EXPORT1024_WITH_DES_CBC_SHA "EXP1024-DES-CBC-SHA" +#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA \ + "EXP1024-DHE-DSS-DES-CBC-SHA" +#define TLS1_TXT_RSA_EXPORT1024_WITH_RC4_56_SHA "EXP1024-RC4-SHA" +#define TLS1_TXT_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA "EXP1024-DHE-DSS-RC4-SHA" +#define TLS1_TXT_DHE_DSS_WITH_RC4_128_SHA "DHE-DSS-RC4-SHA" + +// AES ciphersuites from RFC3268 +#define TLS1_TXT_RSA_WITH_AES_128_SHA "AES128-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA "DH-DSS-AES128-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA "DH-RSA-AES128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA "DHE-DSS-AES128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA "DHE-RSA-AES128-SHA" +#define TLS1_TXT_ADH_WITH_AES_128_SHA "ADH-AES128-SHA" + +#define TLS1_TXT_RSA_WITH_AES_256_SHA "AES256-SHA" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA "DH-DSS-AES256-SHA" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA "DH-RSA-AES256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA "DHE-DSS-AES256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA "DHE-RSA-AES256-SHA" +#define TLS1_TXT_ADH_WITH_AES_256_SHA "ADH-AES256-SHA" + +// ECC ciphersuites from RFC4492 +#define TLS1_TXT_ECDH_ECDSA_WITH_NULL_SHA "ECDH-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_RC4_128_SHA "ECDH-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_DES_192_CBC3_SHA "ECDH-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_CBC_SHA "ECDH-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_CBC_SHA "ECDH-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_ECDSA_WITH_NULL_SHA "ECDHE-ECDSA-NULL-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_RC4_128_SHA "ECDHE-ECDSA-RC4-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_DES_192_CBC3_SHA "ECDHE-ECDSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_CBC_SHA "ECDHE-ECDSA-AES128-SHA" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_CBC_SHA "ECDHE-ECDSA-AES256-SHA" + +#define TLS1_TXT_ECDH_RSA_WITH_NULL_SHA "ECDH-RSA-NULL-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_RC4_128_SHA "ECDH-RSA-RC4-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_DES_192_CBC3_SHA "ECDH-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_CBC_SHA "ECDH-RSA-AES128-SHA" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_CBC_SHA "ECDH-RSA-AES256-SHA" + +#define TLS1_TXT_ECDHE_RSA_WITH_NULL_SHA "ECDHE-RSA-NULL-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_RC4_128_SHA "ECDHE-RSA-RC4-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_DES_192_CBC3_SHA "ECDHE-RSA-DES-CBC3-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_CBC_SHA "ECDHE-RSA-AES128-SHA" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_CBC_SHA "ECDHE-RSA-AES256-SHA" + +#define TLS1_TXT_ECDH_anon_WITH_NULL_SHA "AECDH-NULL-SHA" +#define TLS1_TXT_ECDH_anon_WITH_RC4_128_SHA "AECDH-RC4-SHA" +#define TLS1_TXT_ECDH_anon_WITH_DES_192_CBC3_SHA "AECDH-DES-CBC3-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_128_CBC_SHA "AECDH-AES128-SHA" +#define TLS1_TXT_ECDH_anon_WITH_AES_256_CBC_SHA "AECDH-AES256-SHA" + +// PSK ciphersuites from RFC 4279 +#define TLS1_TXT_PSK_WITH_RC4_128_SHA "PSK-RC4-SHA" +#define TLS1_TXT_PSK_WITH_3DES_EDE_CBC_SHA "PSK-3DES-EDE-CBC-SHA" +#define TLS1_TXT_PSK_WITH_AES_128_CBC_SHA "PSK-AES128-CBC-SHA" +#define TLS1_TXT_PSK_WITH_AES_256_CBC_SHA "PSK-AES256-CBC-SHA" + +// PSK ciphersuites from RFC 5489 +#define TLS1_TXT_ECDHE_PSK_WITH_AES_128_CBC_SHA "ECDHE-PSK-AES128-CBC-SHA" +#define TLS1_TXT_ECDHE_PSK_WITH_AES_256_CBC_SHA "ECDHE-PSK-AES256-CBC-SHA" + +// SRP ciphersuite from RFC 5054 +#define TLS1_TXT_SRP_SHA_WITH_3DES_EDE_CBC_SHA "SRP-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA "SRP-RSA-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA "SRP-DSS-3DES-EDE-CBC-SHA" +#define TLS1_TXT_SRP_SHA_WITH_AES_128_CBC_SHA "SRP-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_128_CBC_SHA "SRP-RSA-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_128_CBC_SHA "SRP-DSS-AES-128-CBC-SHA" +#define TLS1_TXT_SRP_SHA_WITH_AES_256_CBC_SHA "SRP-AES-256-CBC-SHA" +#define TLS1_TXT_SRP_SHA_RSA_WITH_AES_256_CBC_SHA "SRP-RSA-AES-256-CBC-SHA" +#define TLS1_TXT_SRP_SHA_DSS_WITH_AES_256_CBC_SHA "SRP-DSS-AES-256-CBC-SHA" + +// Camellia ciphersuites from RFC4132 +#define TLS1_TXT_RSA_WITH_CAMELLIA_128_CBC_SHA "CAMELLIA128-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_128_CBC_SHA "DH-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_128_CBC_SHA "DH-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA "DHE-DSS-CAMELLIA128-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA "DHE-RSA-CAMELLIA128-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_128_CBC_SHA "ADH-CAMELLIA128-SHA" + +#define TLS1_TXT_RSA_WITH_CAMELLIA_256_CBC_SHA "CAMELLIA256-SHA" +#define TLS1_TXT_DH_DSS_WITH_CAMELLIA_256_CBC_SHA "DH-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DH_RSA_WITH_CAMELLIA_256_CBC_SHA "DH-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA "DHE-DSS-CAMELLIA256-SHA" +#define TLS1_TXT_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA "DHE-RSA-CAMELLIA256-SHA" +#define TLS1_TXT_ADH_WITH_CAMELLIA_256_CBC_SHA "ADH-CAMELLIA256-SHA" + +// SEED ciphersuites from RFC4162 +#define TLS1_TXT_RSA_WITH_SEED_SHA "SEED-SHA" +#define TLS1_TXT_DH_DSS_WITH_SEED_SHA "DH-DSS-SEED-SHA" +#define TLS1_TXT_DH_RSA_WITH_SEED_SHA "DH-RSA-SEED-SHA" +#define TLS1_TXT_DHE_DSS_WITH_SEED_SHA "DHE-DSS-SEED-SHA" +#define TLS1_TXT_DHE_RSA_WITH_SEED_SHA "DHE-RSA-SEED-SHA" +#define TLS1_TXT_ADH_WITH_SEED_SHA "ADH-SEED-SHA" + +// TLS v1.2 ciphersuites +#define TLS1_TXT_RSA_WITH_NULL_SHA256 "NULL-SHA256" +#define TLS1_TXT_RSA_WITH_AES_128_SHA256 "AES128-SHA256" +#define TLS1_TXT_RSA_WITH_AES_256_SHA256 "AES256-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_128_SHA256 "DH-DSS-AES128-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_128_SHA256 "DH-RSA-AES128-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_SHA256 "DHE-DSS-AES128-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_SHA256 "DHE-RSA-AES128-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_256_SHA256 "DH-DSS-AES256-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_256_SHA256 "DH-RSA-AES256-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_SHA256 "DHE-DSS-AES256-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_SHA256 "DHE-RSA-AES256-SHA256" +#define TLS1_TXT_ADH_WITH_AES_128_SHA256 "ADH-AES128-SHA256" +#define TLS1_TXT_ADH_WITH_AES_256_SHA256 "ADH-AES256-SHA256" + +// TLS v1.2 GCM ciphersuites from RFC5288 +#define TLS1_TXT_RSA_WITH_AES_128_GCM_SHA256 "AES128-GCM-SHA256" +#define TLS1_TXT_RSA_WITH_AES_256_GCM_SHA384 "AES256-GCM-SHA384" +#define TLS1_TXT_DHE_RSA_WITH_AES_128_GCM_SHA256 "DHE-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_RSA_WITH_AES_256_GCM_SHA384 "DHE-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_DH_RSA_WITH_AES_128_GCM_SHA256 "DH-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_DH_RSA_WITH_AES_256_GCM_SHA384 "DH-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_DHE_DSS_WITH_AES_128_GCM_SHA256 "DHE-DSS-AES128-GCM-SHA256" +#define TLS1_TXT_DHE_DSS_WITH_AES_256_GCM_SHA384 "DHE-DSS-AES256-GCM-SHA384" +#define TLS1_TXT_DH_DSS_WITH_AES_128_GCM_SHA256 "DH-DSS-AES128-GCM-SHA256" +#define TLS1_TXT_DH_DSS_WITH_AES_256_GCM_SHA384 "DH-DSS-AES256-GCM-SHA384" +#define TLS1_TXT_ADH_WITH_AES_128_GCM_SHA256 "ADH-AES128-GCM-SHA256" +#define TLS1_TXT_ADH_WITH_AES_256_GCM_SHA384 "ADH-AES256-GCM-SHA384" + +// ECDH HMAC based ciphersuites from RFC5289 + +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256 "ECDHE-ECDSA-AES128-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384 "ECDHE-ECDSA-AES256-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_SHA256 "ECDH-ECDSA-AES128-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_SHA384 "ECDH-ECDSA-AES256-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256 "ECDHE-RSA-AES128-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384 "ECDHE-RSA-AES256-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_SHA256 "ECDH-RSA-AES128-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_SHA384 "ECDH-RSA-AES256-SHA384" + +// ECDH GCM based ciphersuites from RFC5289 +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \ + "ECDHE-ECDSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 \ + "ECDHE-ECDSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 \ + "ECDH-ECDSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 \ + "ECDH-ECDSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_128_GCM_SHA256 "ECDHE-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDHE_RSA_WITH_AES_256_GCM_SHA384 "ECDHE-RSA-AES256-GCM-SHA384" +#define TLS1_TXT_ECDH_RSA_WITH_AES_128_GCM_SHA256 "ECDH-RSA-AES128-GCM-SHA256" +#define TLS1_TXT_ECDH_RSA_WITH_AES_256_GCM_SHA384 "ECDH-RSA-AES256-GCM-SHA384" + +#define TLS1_TXT_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 \ + "ECDHE-RSA-CHACHA20-POLY1305" +#define TLS1_TXT_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 \ + "ECDHE-ECDSA-CHACHA20-POLY1305" +#define TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 \ + "ECDHE-PSK-CHACHA20-POLY1305" + +// TLS 1.3 ciphersuites from RFC 8446. +#define TLS1_TXT_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" +#define TLS1_TXT_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" +#define TLS1_TXT_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" + + +#define TLS_CT_RSA_SIGN 1 +#define TLS_CT_DSS_SIGN 2 +#define TLS_CT_RSA_FIXED_DH 3 +#define TLS_CT_DSS_FIXED_DH 4 +#define TLS_CT_ECDSA_SIGN 64 +#define TLS_CT_RSA_FIXED_ECDH 65 +#define TLS_CT_ECDSA_FIXED_ECDH 66 + +#define TLS_MD_MAX_CONST_SIZE 20 + + +#ifdef __cplusplus +} // extern C +#endif + +#endif // OPENSSL_HEADER_TLS1_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/tls1.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/tls1.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.grpc_back index 3424f3dcc..8b61d5ad0 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/tls1.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/tls1.h.grpc_back @@ -205,13 +205,19 @@ extern "C" { // ExtensionType value from draft-ietf-tokbind-negotiation-10 #define TLSEXT_TYPE_token_binding 24 -// ExtensionType value from draft-ietf-quic-tls -#define TLSEXT_TYPE_quic_transport_parameters 26 +// ExtensionType value from draft-ietf-quic-tls. Note that this collides with +// TLS-LTS and, based on scans, something else too. Since it's QUIC-only, that +// shouldn't be a problem in practice. +#define TLSEXT_TYPE_quic_transport_parameters 0xffa5 + +// ExtensionType value assigned to +// https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03 +#define TLSEXT_TYPE_cert_compression 27 // ExtensionType value from RFC4507 #define TLSEXT_TYPE_session_ticket 35 -// ExtensionType values from draft-ietf-tls-tls13-18 +// ExtensionType values from RFC8446 #define TLSEXT_TYPE_supported_groups 10 #define TLSEXT_TYPE_pre_shared_key 41 #define TLSEXT_TYPE_early_data 42 @@ -219,11 +225,16 @@ extern "C" { #define TLSEXT_TYPE_cookie 44 #define TLSEXT_TYPE_psk_key_exchange_modes 45 #define TLSEXT_TYPE_certificate_authorities 47 +#define TLSEXT_TYPE_signature_algorithms_cert 50 #define TLSEXT_TYPE_key_share 51 // ExtensionType value from RFC5746 #define TLSEXT_TYPE_renegotiate 0xff01 +// ExtensionType value from draft-ietf-tls-subcerts. This is not an IANA defined +// extension number. +#define TLSEXT_TYPE_delegated_credential 0xff02 + // ExtensionType value from RFC6962 #define TLSEXT_TYPE_certificate_timestamp 18 @@ -233,10 +244,8 @@ extern "C" { // This is not an IANA defined extension number #define TLSEXT_TYPE_channel_id 30032 -// This is not an IANA defined extension number -#define TLSEXT_TYPE_dummy_pq_padding 54537 - // status request value from RFC 3546 +#define TLSEXT_STATUSTYPE_nothing (-1) #define TLSEXT_STATUSTYPE_ocsp 1 // ECPointFormat values from RFC 4492 @@ -258,6 +267,10 @@ extern "C" { #define TLSEXT_hash_sha384 5 #define TLSEXT_hash_sha512 6 +// From https://tools.ietf.org/html/draft-ietf-tls-certificate-compression-03#section-3 +#define TLSEXT_cert_compression_zlib 1 +#define TLSEXT_cert_compression_brotli 2 + #define TLSEXT_MAXLEN_host_name 255 // PSK ciphersuites from 4279 @@ -422,7 +435,7 @@ extern "C" { #define TLS1_CK_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 0x0300CCA9 #define TLS1_CK_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 0x0300CCAC -// TLS 1.3 ciphersuites from draft-ietf-tls-tls13-16 +// TLS 1.3 ciphersuites from RFC 8446. #define TLS1_CK_AES_128_GCM_SHA256 0x03001301 #define TLS1_CK_AES_256_GCM_SHA384 0x03001302 #define TLS1_CK_CHACHA20_POLY1305_SHA256 0x03001303 @@ -594,10 +607,10 @@ extern "C" { #define TLS1_TXT_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 \ "ECDHE-PSK-CHACHA20-POLY1305" -// TLS 1.3 ciphersuites from draft-ietf-tls-tls13-16 -#define TLS1_TXT_AES_128_GCM_SHA256 "AEAD-AES128-GCM-SHA256" -#define TLS1_TXT_AES_256_GCM_SHA384 "AEAD-AES256-GCM-SHA384" -#define TLS1_TXT_CHACHA20_POLY1305_SHA256 "AEAD-CHACHA20-POLY1305-SHA256" +// TLS 1.3 ciphersuites from RFC 8446. +#define TLS1_TXT_AES_128_GCM_SHA256 "TLS_AES_128_GCM_SHA256" +#define TLS1_TXT_AES_256_GCM_SHA384 "TLS_AES_256_GCM_SHA384" +#define TLS1_TXT_CHACHA20_POLY1305_SHA256 "TLS_CHACHA20_POLY1305_SHA256" #define TLS_CT_RSA_SIGN 1 diff --git a/Pods/BoringSSL-GRPC/include/openssl/type_check.h b/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h similarity index 82% rename from Pods/BoringSSL-GRPC/include/openssl/type_check.h rename to Pods/BoringSSL-GRPC/src/include/openssl/type_check.h index 928ebcaa9..fdbadea27 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/type_check.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h @@ -64,25 +64,24 @@ extern "C" { #endif -// This header file contains some common macros for enforcing type checking. -// Several, common OpenSSL structures (i.e. stack and lhash) operate on void -// pointers, but we wish to have type checking when they are used with a -// specific type. +#if defined(__cplusplus) || (defined(_MSC_VER) && !defined(__clang__)) +// In C++ and non-clang MSVC, |static_assert| is a keyword. +#define OPENSSL_STATIC_ASSERT(cond, msg) static_assert(cond, msg) +#else +// C11 defines the |_Static_assert| keyword and the |static_assert| macro in +// assert.h. While the former is available at all versions in Clang and GCC, the +// later depends on libc and, in glibc, depends on being built in C11 mode. We +// do not require this, for now, so use |_Static_assert| directly. +#define OPENSSL_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) +#endif // CHECKED_CAST casts |p| from type |from| to type |to|. +// +// TODO(davidben): Although this macro is not public API and is unused in +// BoringSSL, wpa_supplicant uses it to define its own stacks. Remove this once +// wpa_supplicant has been fixed. #define CHECKED_CAST(to, from, p) ((to) (1 ? (p) : (from)0)) -// CHECKED_PTR_OF casts a given pointer to void* and statically checks that it -// was a pointer to |type|. -#define CHECKED_PTR_OF(type, p) CHECKED_CAST(void*, type*, (p)) - -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#define OPENSSL_COMPILE_ASSERT(cond, msg) _Static_assert(cond, #msg) -#else -#define OPENSSL_COMPILE_ASSERT(cond, msg) \ - typedef char OPENSSL_COMPILE_ASSERT_##msg[((cond) ? 1 : -1)] OPENSSL_UNUSED -#endif - #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.back new file mode 100644 index 000000000..c267938c3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.back @@ -0,0 +1,90 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#ifndef OPENSSL_HEADER_TYPE_CHECK_H +#define OPENSSL_HEADER_TYPE_CHECK_H + +#include + +#if defined(__cplusplus) +extern "C" { +#endif + + +#if defined(__cplusplus) || (defined(_MSC_VER) && !defined(__clang__)) +// In C++ and non-clang MSVC, |static_assert| is a keyword. +#define OPENSSL_STATIC_ASSERT(cond, msg) static_assert(cond, msg) +#else +// C11 defines the |_Static_assert| keyword and the |static_assert| macro in +// assert.h. While the former is available at all versions in Clang and GCC, the +// later depends on libc and, in glibc, depends on being built in C11 mode. We +// do not require this, for now, so use |_Static_assert| directly. +#define OPENSSL_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) +#endif + +// CHECKED_CAST casts |p| from type |from| to type |to|. +// +// TODO(davidben): Although this macro is not public API and is unused in +// BoringSSL, wpa_supplicant uses it to define its own stacks. Remove this once +// wpa_supplicant has been fixed. +#define CHECKED_CAST(to, from, p) ((to) (1 ? (p) : (from)0)) + + +#if defined(__cplusplus) +} // extern C +#endif + +#endif // OPENSSL_HEADER_TYPE_CHECK_H diff --git a/Pods/BoringSSL-GRPC/include/openssl/type_check.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/include/openssl/type_check.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.grpc_back index da78d70c1..c267938c3 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/type_check.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/type_check.h.grpc_back @@ -64,25 +64,24 @@ extern "C" { #endif -// This header file contains some common macros for enforcing type checking. -// Several, common OpenSSL structures (i.e. stack and lhash) operate on void -// pointers, but we wish to have type checking when they are used with a -// specific type. +#if defined(__cplusplus) || (defined(_MSC_VER) && !defined(__clang__)) +// In C++ and non-clang MSVC, |static_assert| is a keyword. +#define OPENSSL_STATIC_ASSERT(cond, msg) static_assert(cond, msg) +#else +// C11 defines the |_Static_assert| keyword and the |static_assert| macro in +// assert.h. While the former is available at all versions in Clang and GCC, the +// later depends on libc and, in glibc, depends on being built in C11 mode. We +// do not require this, for now, so use |_Static_assert| directly. +#define OPENSSL_STATIC_ASSERT(cond, msg) _Static_assert(cond, msg) +#endif // CHECKED_CAST casts |p| from type |from| to type |to|. +// +// TODO(davidben): Although this macro is not public API and is unused in +// BoringSSL, wpa_supplicant uses it to define its own stacks. Remove this once +// wpa_supplicant has been fixed. #define CHECKED_CAST(to, from, p) ((to) (1 ? (p) : (from)0)) -// CHECKED_PTR_OF casts a given pointer to void* and statically checks that it -// was a pointer to |type|. -#define CHECKED_PTR_OF(type, p) CHECKED_CAST(void*, type*, (p)) - -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#define OPENSSL_COMPILE_ASSERT(cond, msg) _Static_assert(cond, #msg) -#else -#define OPENSSL_COMPILE_ASSERT(cond, msg) \ - typedef char OPENSSL_COMPILE_ASSERT_##msg[((cond) ? 1 : -1)] OPENSSL_UNUSED -#endif - #if defined(__cplusplus) } // extern C diff --git a/Pods/BoringSSL-GRPC/include/openssl/umbrella.h b/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/umbrella.h rename to Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h diff --git a/Pods/BoringSSL-GRPC/include/openssl/umbrella.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.back similarity index 100% rename from Pods/BoringSSL-GRPC/include/openssl/umbrella.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.back diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.grpc_back new file mode 100644 index 000000000..b61d9025a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/umbrella.h.grpc_back @@ -0,0 +1,38 @@ + #include "ssl.h" + #include "crypto.h" + #include "aes.h" + /* The following macros are defined by base.h. The latter is the first file included by the + other headers. */ + #if defined(OPENSSL_ARM) || defined(OPENSSL_AARCH64) + # include "arm_arch.h" + #endif + #include "asn1.h" + #include "asn1_mac.h" + #include "asn1t.h" + #include "blowfish.h" + #include "cast.h" + #include "chacha.h" + #include "cmac.h" + #include "conf.h" + #include "cpu.h" + #include "curve25519.h" + #include "des.h" + #include "dtls1.h" + #include "hkdf.h" + #include "md4.h" + #include "md5.h" + #include "obj_mac.h" + #include "objects.h" + #include "opensslv.h" + #include "ossl_typ.h" + #include "pkcs12.h" + #include "pkcs7.h" + #include "pkcs8.h" + #include "poly1305.h" + #include "rand.h" + #include "rc4.h" + #include "ripemd.h" + #include "safestack.h" + #include "srtp.h" + #include "x509.h" + #include "x509v3.h" diff --git a/Pods/BoringSSL-GRPC/include/openssl/x509.h b/Pods/BoringSSL-GRPC/src/include/openssl/x509.h similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/x509.h rename to Pods/BoringSSL-GRPC/src/include/openssl/x509.h index 7276ce65d..fb22f83ab 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/x509.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509.h @@ -531,6 +531,8 @@ extern "C" { #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) #define X509_CRL_get_issuer(x) ((x)->crl->issuer) @@ -671,6 +673,8 @@ OPENSSL_EXPORT int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); OPENSSL_EXPORT int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); +OPENSSL_EXPORT DH *d2i_DHparams_bio(BIO *bp, DH **dh); +OPENSSL_EXPORT int i2d_DHparams_bio(BIO *bp, const DH *dh); OPENSSL_EXPORT X509 *X509_dup(X509 *x509); OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); @@ -762,6 +766,8 @@ OPENSSL_EXPORT void *X509_get_ex_data(X509 *r, int idx); OPENSSL_EXPORT int i2d_X509_AUX(X509 *a,unsigned char **pp); OPENSSL_EXPORT X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); +OPENSSL_EXPORT int i2d_re_X509_tbs(X509 *x, unsigned char **pp); + OPENSSL_EXPORT void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x); OPENSSL_EXPORT int X509_get_signature_nid(const X509 *x); @@ -829,9 +835,15 @@ OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY * X509_get_pubkey(X509 *x); OPENSSL_EXPORT ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +OPENSSL_EXPORT const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); OPENSSL_EXPORT int X509_REQ_set_version(X509_REQ *x,long version); OPENSSL_EXPORT int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); +OPENSSL_EXPORT void X509_REQ_get0_signature(const X509_REQ *req, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +OPENSSL_EXPORT int X509_REQ_get_signature_nid(const X509_REQ *req); +OPENSSL_EXPORT int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); OPENSSL_EXPORT int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); OPENSSL_EXPORT int X509_REQ_extension_nid(int nid); @@ -866,7 +878,17 @@ OPENSSL_EXPORT int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); OPENSSL_EXPORT int X509_CRL_sort(X509_CRL *crl); OPENSSL_EXPORT int X509_CRL_up_ref(X509_CRL *crl); +OPENSSL_EXPORT void X509_CRL_get0_signature(const X509_CRL *crl, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +OPENSSL_EXPORT int X509_CRL_get_signature_nid(const X509_CRL *crl); +OPENSSL_EXPORT int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); + +OPENSSL_EXPORT const ASN1_INTEGER *X509_REVOKED_get0_serialNumber( + const X509_REVOKED *x); OPENSSL_EXPORT int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); +OPENSSL_EXPORT const ASN1_TIME *X509_REVOKED_get0_revocationDate( + const X509_REVOKED *x); OPENSSL_EXPORT int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); OPENSSL_EXPORT X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, @@ -874,7 +896,7 @@ OPENSSL_EXPORT X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, OPENSSL_EXPORT int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); -OPENSSL_EXPORT int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); +OPENSSL_EXPORT int X509_check_private_key(X509 *x509, const EVP_PKEY *pkey); OPENSSL_EXPORT int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain, unsigned long flags); @@ -1107,13 +1129,15 @@ DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(NETSCAPE_SPKI, NETSCAPE_SPKI_free) BORINGSSL_MAKE_DELETER(RSA_PSS_PARAMS, RSA_PSS_PARAMS_free) BORINGSSL_MAKE_DELETER(X509, X509_free) +BORINGSSL_MAKE_UP_REF(X509, X509_up_ref) BORINGSSL_MAKE_DELETER(X509_ALGOR, X509_ALGOR_free) BORINGSSL_MAKE_DELETER(X509_CRL, X509_CRL_free) +BORINGSSL_MAKE_UP_REF(X509_CRL, X509_CRL_up_ref) BORINGSSL_MAKE_DELETER(X509_CRL_METHOD, X509_CRL_METHOD_free) BORINGSSL_MAKE_DELETER(X509_EXTENSION, X509_EXTENSION_free) BORINGSSL_MAKE_DELETER(X509_INFO, X509_INFO_free) @@ -1134,7 +1158,7 @@ using ScopedX509_STORE_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } /* extern C++ */ #endif /* !BORINGSSL_NO_CXX */ @@ -1176,5 +1200,6 @@ using ScopedX509_STORE_CTX = #define X509_R_WRONG_TYPE 134 #define X509_R_NAME_TOO_LONG 135 #define X509_R_INVALID_PARAMETER 136 +#define X509_R_SIGNATURE_ALGORITHM_MISMATCH 137 #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.back new file mode 100644 index 000000000..ee3ecccc0 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.back @@ -0,0 +1,1205 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECDH support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ + +#ifndef HEADER_X509_H +#define HEADER_X509_H + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Legacy X.509 library. + * + * This header is part of OpenSSL's X.509 implementation. It is retained for + * compatibility but otherwise underdocumented and not actively maintained. In + * the future, a replacement library will be available. Meanwhile, minimize + * dependencies on this header where possible. */ + + +#define X509_FILETYPE_PEM 1 +#define X509_FILETYPE_ASN1 2 +#define X509_FILETYPE_DEFAULT 3 + +#define X509v3_KU_DIGITAL_SIGNATURE 0x0080 +#define X509v3_KU_NON_REPUDIATION 0x0040 +#define X509v3_KU_KEY_ENCIPHERMENT 0x0020 +#define X509v3_KU_DATA_ENCIPHERMENT 0x0010 +#define X509v3_KU_KEY_AGREEMENT 0x0008 +#define X509v3_KU_KEY_CERT_SIGN 0x0004 +#define X509v3_KU_CRL_SIGN 0x0002 +#define X509v3_KU_ENCIPHER_ONLY 0x0001 +#define X509v3_KU_DECIPHER_ONLY 0x8000 +#define X509v3_KU_UNDEF 0xffff + +DEFINE_STACK_OF(X509_ALGOR) +DECLARE_ASN1_SET_OF(X509_ALGOR) + +typedef STACK_OF(X509_ALGOR) X509_ALGORS; + +struct X509_val_st + { + ASN1_TIME *notBefore; + ASN1_TIME *notAfter; + } /* X509_VAL */; + +struct X509_pubkey_st + { + X509_ALGOR *algor; + ASN1_BIT_STRING *public_key; + EVP_PKEY *pkey; + }; + +struct X509_sig_st + { + X509_ALGOR *algor; + ASN1_OCTET_STRING *digest; + } /* X509_SIG */; + +struct X509_name_entry_st + { + ASN1_OBJECT *object; + ASN1_STRING *value; + int set; + int size; /* temp variable */ + } /* X509_NAME_ENTRY */; + +DEFINE_STACK_OF(X509_NAME_ENTRY) +DECLARE_ASN1_SET_OF(X509_NAME_ENTRY) + +/* we always keep X509_NAMEs in 2 forms. */ +struct X509_name_st + { + STACK_OF(X509_NAME_ENTRY) *entries; + int modified; /* true if 'bytes' needs to be built */ + BUF_MEM *bytes; +/* unsigned long hash; Keep the hash around for lookups */ + unsigned char *canon_enc; + int canon_enclen; + } /* X509_NAME */; + +DEFINE_STACK_OF(X509_NAME) + +struct X509_extension_st + { + ASN1_OBJECT *object; + ASN1_BOOLEAN critical; + ASN1_OCTET_STRING *value; + } /* X509_EXTENSION */; + +typedef STACK_OF(X509_EXTENSION) X509_EXTENSIONS; + +DEFINE_STACK_OF(X509_EXTENSION) +DECLARE_ASN1_SET_OF(X509_EXTENSION) + +/* a sequence of these are used */ +struct x509_attributes_st + { + ASN1_OBJECT *object; + int single; /* 0 for a set, 1 for a single item (which is wrong) */ + union { + char *ptr; +/* 0 */ STACK_OF(ASN1_TYPE) *set; +/* 1 */ ASN1_TYPE *single; + } value; + } /* X509_ATTRIBUTE */; + +DEFINE_STACK_OF(X509_ATTRIBUTE) +DECLARE_ASN1_SET_OF(X509_ATTRIBUTE) + + +struct X509_req_info_st + { + ASN1_ENCODING enc; + ASN1_INTEGER *version; + X509_NAME *subject; + X509_PUBKEY *pubkey; + /* d=2 hl=2 l= 0 cons: cont: 00 */ + STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */ + } /* X509_REQ_INFO */; + +struct X509_req_st + { + X509_REQ_INFO *req_info; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *signature; + CRYPTO_refcount_t references; + } /* X509_REQ */; + +struct x509_cinf_st + { + ASN1_INTEGER *version; /* [ 0 ] default of v1 */ + ASN1_INTEGER *serialNumber; + X509_ALGOR *signature; + X509_NAME *issuer; + X509_VAL *validity; + X509_NAME *subject; + X509_PUBKEY *key; + ASN1_BIT_STRING *issuerUID; /* [ 1 ] optional in v2 */ + ASN1_BIT_STRING *subjectUID; /* [ 2 ] optional in v2 */ + STACK_OF(X509_EXTENSION) *extensions; /* [ 3 ] optional in v3 */ + ASN1_ENCODING enc; + } /* X509_CINF */; + +/* This stuff is certificate "auxiliary info" + * it contains details which are useful in certificate + * stores and databases. When used this is tagged onto + * the end of the certificate itself + */ + +struct x509_cert_aux_st + { + STACK_OF(ASN1_OBJECT) *trust; /* trusted uses */ + STACK_OF(ASN1_OBJECT) *reject; /* rejected uses */ + ASN1_UTF8STRING *alias; /* "friendly name" */ + ASN1_OCTET_STRING *keyid; /* key id of private key */ + STACK_OF(X509_ALGOR) *other; /* other unspecified info */ + } /* X509_CERT_AUX */; + +DECLARE_STACK_OF(DIST_POINT) +DECLARE_STACK_OF(GENERAL_NAME) + +struct x509_st + { + X509_CINF *cert_info; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *signature; + CRYPTO_refcount_t references; + char *name; + CRYPTO_EX_DATA ex_data; + /* These contain copies of various extension values */ + long ex_pathlen; + long ex_pcpathlen; + unsigned long ex_flags; + unsigned long ex_kusage; + unsigned long ex_xkusage; + unsigned long ex_nscert; + ASN1_OCTET_STRING *skid; + AUTHORITY_KEYID *akid; + X509_POLICY_CACHE *policy_cache; + STACK_OF(DIST_POINT) *crldp; + STACK_OF(GENERAL_NAME) *altname; + NAME_CONSTRAINTS *nc; + unsigned char sha1_hash[SHA_DIGEST_LENGTH]; + X509_CERT_AUX *aux; + CRYPTO_BUFFER *buf; + CRYPTO_MUTEX lock; + } /* X509 */; + +DEFINE_STACK_OF(X509) +DECLARE_ASN1_SET_OF(X509) + +/* This is used for a table of trust checking functions */ + +struct x509_trust_st { + int trust; + int flags; + int (*check_trust)(struct x509_trust_st *, X509 *, int); + char *name; + int arg1; + void *arg2; +} /* X509_TRUST */; + +DEFINE_STACK_OF(X509_TRUST) + +/* standard trust ids */ + +#define X509_TRUST_DEFAULT (-1) /* Only valid in purpose settings */ + +#define X509_TRUST_COMPAT 1 +#define X509_TRUST_SSL_CLIENT 2 +#define X509_TRUST_SSL_SERVER 3 +#define X509_TRUST_EMAIL 4 +#define X509_TRUST_OBJECT_SIGN 5 +#define X509_TRUST_OCSP_SIGN 6 +#define X509_TRUST_OCSP_REQUEST 7 +#define X509_TRUST_TSA 8 + +/* Keep these up to date! */ +#define X509_TRUST_MIN 1 +#define X509_TRUST_MAX 8 + + +/* trust_flags values */ +#define X509_TRUST_DYNAMIC 1 +#define X509_TRUST_DYNAMIC_NAME 2 + +/* check_trust return codes */ + +#define X509_TRUST_TRUSTED 1 +#define X509_TRUST_REJECTED 2 +#define X509_TRUST_UNTRUSTED 3 + +/* Flags for X509_print_ex() */ + +#define X509_FLAG_COMPAT 0 +#define X509_FLAG_NO_HEADER 1L +#define X509_FLAG_NO_VERSION (1L << 1) +#define X509_FLAG_NO_SERIAL (1L << 2) +#define X509_FLAG_NO_SIGNAME (1L << 3) +#define X509_FLAG_NO_ISSUER (1L << 4) +#define X509_FLAG_NO_VALIDITY (1L << 5) +#define X509_FLAG_NO_SUBJECT (1L << 6) +#define X509_FLAG_NO_PUBKEY (1L << 7) +#define X509_FLAG_NO_EXTENSIONS (1L << 8) +#define X509_FLAG_NO_SIGDUMP (1L << 9) +#define X509_FLAG_NO_AUX (1L << 10) +#define X509_FLAG_NO_ATTRIBUTES (1L << 11) +#define X509_FLAG_NO_IDS (1L << 12) + +/* Flags specific to X509_NAME_print_ex() */ + +/* The field separator information */ + +#define XN_FLAG_SEP_MASK (0xf << 16) + +#define XN_FLAG_COMPAT 0 /* Traditional SSLeay: use old X509_NAME_print */ +#define XN_FLAG_SEP_COMMA_PLUS (1 << 16) /* RFC2253 ,+ */ +#define XN_FLAG_SEP_CPLUS_SPC (2 << 16) /* ,+ spaced: more readable */ +#define XN_FLAG_SEP_SPLUS_SPC (3 << 16) /* ;+ spaced */ +#define XN_FLAG_SEP_MULTILINE (4 << 16) /* One line per field */ + +#define XN_FLAG_DN_REV (1 << 20) /* Reverse DN order */ + +/* How the field name is shown */ + +#define XN_FLAG_FN_MASK (0x3 << 21) + +#define XN_FLAG_FN_SN 0 /* Object short name */ +#define XN_FLAG_FN_LN (1 << 21) /* Object long name */ +#define XN_FLAG_FN_OID (2 << 21) /* Always use OIDs */ +#define XN_FLAG_FN_NONE (3 << 21) /* No field names */ + +#define XN_FLAG_SPC_EQ (1 << 23) /* Put spaces round '=' */ + +/* This determines if we dump fields we don't recognise: + * RFC2253 requires this. + */ + +#define XN_FLAG_DUMP_UNKNOWN_FIELDS (1 << 24) + +#define XN_FLAG_FN_ALIGN (1 << 25) /* Align field names to 20 characters */ + +/* Complete set of RFC2253 flags */ + +#define XN_FLAG_RFC2253 (ASN1_STRFLGS_RFC2253 | \ + XN_FLAG_SEP_COMMA_PLUS | \ + XN_FLAG_DN_REV | \ + XN_FLAG_FN_SN | \ + XN_FLAG_DUMP_UNKNOWN_FIELDS) + +/* readable oneline form */ + +#define XN_FLAG_ONELINE (ASN1_STRFLGS_RFC2253 | \ + ASN1_STRFLGS_ESC_QUOTE | \ + XN_FLAG_SEP_CPLUS_SPC | \ + XN_FLAG_SPC_EQ | \ + XN_FLAG_FN_SN) + +/* readable multiline form */ + +#define XN_FLAG_MULTILINE (ASN1_STRFLGS_ESC_CTRL | \ + ASN1_STRFLGS_ESC_MSB | \ + XN_FLAG_SEP_MULTILINE | \ + XN_FLAG_SPC_EQ | \ + XN_FLAG_FN_LN | \ + XN_FLAG_FN_ALIGN) + +struct x509_revoked_st + { + ASN1_INTEGER *serialNumber; + ASN1_TIME *revocationDate; + STACK_OF(X509_EXTENSION) /* optional */ *extensions; + /* Set up if indirect CRL */ + STACK_OF(GENERAL_NAME) *issuer; + /* Revocation reason */ + int reason; + int sequence; /* load sequence */ + }; + +DEFINE_STACK_OF(X509_REVOKED) +DECLARE_ASN1_SET_OF(X509_REVOKED) + +struct X509_crl_info_st + { + ASN1_INTEGER *version; + X509_ALGOR *sig_alg; + X509_NAME *issuer; + ASN1_TIME *lastUpdate; + ASN1_TIME *nextUpdate; + STACK_OF(X509_REVOKED) *revoked; + STACK_OF(X509_EXTENSION) /* [0] */ *extensions; + ASN1_ENCODING enc; + } /* X509_CRL_INFO */; + +DECLARE_STACK_OF(GENERAL_NAMES) + +struct X509_crl_st + { + /* actual signature */ + X509_CRL_INFO *crl; + X509_ALGOR *sig_alg; + ASN1_BIT_STRING *signature; + CRYPTO_refcount_t references; + int flags; + /* Copies of various extensions */ + AUTHORITY_KEYID *akid; + ISSUING_DIST_POINT *idp; + /* Convenient breakdown of IDP */ + int idp_flags; + int idp_reasons; + /* CRL and base CRL numbers for delta processing */ + ASN1_INTEGER *crl_number; + ASN1_INTEGER *base_crl_number; + unsigned char sha1_hash[SHA_DIGEST_LENGTH]; + STACK_OF(GENERAL_NAMES) *issuers; + const X509_CRL_METHOD *meth; + void *meth_data; + } /* X509_CRL */; + +DEFINE_STACK_OF(X509_CRL) +DECLARE_ASN1_SET_OF(X509_CRL) + +struct private_key_st + { + int version; + /* The PKCS#8 data types */ + X509_ALGOR *enc_algor; + ASN1_OCTET_STRING *enc_pkey; /* encrypted pub key */ + + /* When decrypted, the following will not be NULL */ + EVP_PKEY *dec_pkey; + + /* used to encrypt and decrypt */ + int key_length; + char *key_data; + int key_free; /* true if we should auto free key_data */ + + /* expanded version of 'enc_algor' */ + EVP_CIPHER_INFO cipher; + } /* X509_PKEY */; + +#ifndef OPENSSL_NO_EVP +struct X509_info_st + { + X509 *x509; + X509_CRL *crl; + X509_PKEY *x_pkey; + + EVP_CIPHER_INFO enc_cipher; + int enc_len; + char *enc_data; + + } /* X509_INFO */; + +DEFINE_STACK_OF(X509_INFO) +#endif + +/* The next 2 structures and their 8 routines were sent to me by + * Pat Richard and are used to manipulate + * Netscapes spki structures - useful if you are writing a CA web page + */ +struct Netscape_spkac_st + { + X509_PUBKEY *pubkey; + ASN1_IA5STRING *challenge; /* challenge sent in atlas >= PR2 */ + } /* NETSCAPE_SPKAC */; + +struct Netscape_spki_st + { + NETSCAPE_SPKAC *spkac; /* signed public key and challenge */ + X509_ALGOR *sig_algor; + ASN1_BIT_STRING *signature; + } /* NETSCAPE_SPKI */; + +/* PKCS#8 private key info structure */ + +struct pkcs8_priv_key_info_st + { + int broken; /* Flag for various broken formats */ +#define PKCS8_OK 0 +#define PKCS8_NO_OCTET 1 +#define PKCS8_EMBEDDED_PARAM 2 +#define PKCS8_NS_DB 3 +#define PKCS8_NEG_PRIVKEY 4 + ASN1_INTEGER *version; + X509_ALGOR *pkeyalg; + ASN1_TYPE *pkey; /* Should be OCTET STRING but some are broken */ + STACK_OF(X509_ATTRIBUTE) *attributes; + }; + +#ifdef __cplusplus +} +#endif + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define X509_get_version(x) ASN1_INTEGER_get((x)->cert_info->version) +/* #define X509_get_serialNumber(x) ((x)->cert_info->serialNumber) */ +#define X509_get_notBefore(x) ((x)->cert_info->validity->notBefore) +#define X509_get_notAfter(x) ((x)->cert_info->validity->notAfter) +#define X509_get_cert_info(x) ((x)->cert_info) +#define X509_extract_key(x) X509_get_pubkey(x) /*****/ +#define X509_REQ_get_version(x) ASN1_INTEGER_get((x)->req_info->version) +#define X509_REQ_get_subject_name(x) ((x)->req_info->subject) +#define X509_REQ_extract_key(a) X509_REQ_get_pubkey(a) +#define X509_name_cmp(a,b) X509_NAME_cmp((a),(b)) +#define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) + +#define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); +#define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) +#define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) +#define X509_CRL_get_issuer(x) ((x)->crl->issuer) +#define X509_CRL_get_REVOKED(x) ((x)->crl->revoked) + +#define X509_CINF_set_modified(c) ((c)->enc.modified = 1) +#define X509_CINF_get_issuer(c) (&(c)->issuer) +#define X509_CINF_get_extensions(c) ((c)->extensions) +#define X509_CINF_get_signature(c) ((c)->signature) + +OPENSSL_EXPORT void X509_CRL_set_default_method(const X509_CRL_METHOD *meth); +OPENSSL_EXPORT X509_CRL_METHOD *X509_CRL_METHOD_new( + int (*crl_init)(X509_CRL *crl), + int (*crl_free)(X509_CRL *crl), + int (*crl_lookup)(X509_CRL *crl, X509_REVOKED **ret, + ASN1_INTEGER *ser, X509_NAME *issuer), + int (*crl_verify)(X509_CRL *crl, EVP_PKEY *pk)); +OPENSSL_EXPORT void X509_CRL_METHOD_free(X509_CRL_METHOD *m); + +OPENSSL_EXPORT void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); +OPENSSL_EXPORT void *X509_CRL_get_meth_data(X509_CRL *crl); + +/* This one is only used so that a binary form can output, as in + * i2d_X509_NAME(X509_get_X509_PUBKEY(x),&buf) */ +#define X509_get_X509_PUBKEY(x) ((x)->cert_info->key) + + +OPENSSL_EXPORT const char *X509_verify_cert_error_string(long n); + +#ifndef OPENSSL_NO_EVP +OPENSSL_EXPORT int X509_verify(X509 *a, EVP_PKEY *r); + +OPENSSL_EXPORT int X509_REQ_verify(X509_REQ *a, EVP_PKEY *r); +OPENSSL_EXPORT int X509_CRL_verify(X509_CRL *a, EVP_PKEY *r); +OPENSSL_EXPORT int NETSCAPE_SPKI_verify(NETSCAPE_SPKI *a, EVP_PKEY *r); + +OPENSSL_EXPORT NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len); +OPENSSL_EXPORT char * NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x); +OPENSSL_EXPORT EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x); +OPENSSL_EXPORT int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey); + +OPENSSL_EXPORT int NETSCAPE_SPKI_print(BIO *out, NETSCAPE_SPKI *spki); + +OPENSSL_EXPORT int X509_signature_dump(BIO *bp,const ASN1_STRING *sig, int indent); +OPENSSL_EXPORT int X509_signature_print(BIO *bp, const X509_ALGOR *alg, + const ASN1_STRING *sig); + +OPENSSL_EXPORT int X509_sign(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +OPENSSL_EXPORT int X509_sign_ctx(X509 *x, EVP_MD_CTX *ctx); +OPENSSL_EXPORT int X509_REQ_sign(X509_REQ *x, EVP_PKEY *pkey, const EVP_MD *md); +OPENSSL_EXPORT int X509_REQ_sign_ctx(X509_REQ *x, EVP_MD_CTX *ctx); +OPENSSL_EXPORT int X509_CRL_sign(X509_CRL *x, EVP_PKEY *pkey, const EVP_MD *md); +OPENSSL_EXPORT int X509_CRL_sign_ctx(X509_CRL *x, EVP_MD_CTX *ctx); +OPENSSL_EXPORT int NETSCAPE_SPKI_sign(NETSCAPE_SPKI *x, EVP_PKEY *pkey, const EVP_MD *md); + +OPENSSL_EXPORT int X509_pubkey_digest(const X509 *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +OPENSSL_EXPORT int X509_digest(const X509 *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +OPENSSL_EXPORT int X509_CRL_digest(const X509_CRL *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +OPENSSL_EXPORT int X509_REQ_digest(const X509_REQ *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +OPENSSL_EXPORT int X509_NAME_digest(const X509_NAME *data,const EVP_MD *type, + unsigned char *md, unsigned int *len); +#endif + +/* X509_parse_from_buffer parses an X.509 structure from |buf| and returns a + * fresh X509 or NULL on error. There must not be any trailing data in |buf|. + * The returned structure (if any) holds a reference to |buf| rather than + * copying parts of it as a normal |d2i_X509| call would do. */ +OPENSSL_EXPORT X509 *X509_parse_from_buffer(CRYPTO_BUFFER *buf); + +#ifndef OPENSSL_NO_FP_API +OPENSSL_EXPORT X509 *d2i_X509_fp(FILE *fp, X509 **x509); +OPENSSL_EXPORT int i2d_X509_fp(FILE *fp,X509 *x509); +OPENSSL_EXPORT X509_CRL *d2i_X509_CRL_fp(FILE *fp,X509_CRL **crl); +OPENSSL_EXPORT int i2d_X509_CRL_fp(FILE *fp,X509_CRL *crl); +OPENSSL_EXPORT X509_REQ *d2i_X509_REQ_fp(FILE *fp,X509_REQ **req); +OPENSSL_EXPORT int i2d_X509_REQ_fp(FILE *fp,X509_REQ *req); +OPENSSL_EXPORT RSA *d2i_RSAPrivateKey_fp(FILE *fp,RSA **rsa); +OPENSSL_EXPORT int i2d_RSAPrivateKey_fp(FILE *fp,RSA *rsa); +OPENSSL_EXPORT RSA *d2i_RSAPublicKey_fp(FILE *fp,RSA **rsa); +OPENSSL_EXPORT int i2d_RSAPublicKey_fp(FILE *fp,RSA *rsa); +OPENSSL_EXPORT RSA *d2i_RSA_PUBKEY_fp(FILE *fp,RSA **rsa); +OPENSSL_EXPORT int i2d_RSA_PUBKEY_fp(FILE *fp,RSA *rsa); +#ifndef OPENSSL_NO_DSA +OPENSSL_EXPORT DSA *d2i_DSA_PUBKEY_fp(FILE *fp, DSA **dsa); +OPENSSL_EXPORT int i2d_DSA_PUBKEY_fp(FILE *fp, DSA *dsa); +OPENSSL_EXPORT DSA *d2i_DSAPrivateKey_fp(FILE *fp, DSA **dsa); +OPENSSL_EXPORT int i2d_DSAPrivateKey_fp(FILE *fp, DSA *dsa); +#endif +OPENSSL_EXPORT EC_KEY *d2i_EC_PUBKEY_fp(FILE *fp, EC_KEY **eckey); +OPENSSL_EXPORT int i2d_EC_PUBKEY_fp(FILE *fp, EC_KEY *eckey); +OPENSSL_EXPORT EC_KEY *d2i_ECPrivateKey_fp(FILE *fp, EC_KEY **eckey); +OPENSSL_EXPORT int i2d_ECPrivateKey_fp(FILE *fp, EC_KEY *eckey); +OPENSSL_EXPORT X509_SIG *d2i_PKCS8_fp(FILE *fp,X509_SIG **p8); +OPENSSL_EXPORT int i2d_PKCS8_fp(FILE *fp,X509_SIG *p8); +OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_fp(FILE *fp, + PKCS8_PRIV_KEY_INFO **p8inf); +OPENSSL_EXPORT int i2d_PKCS8_PRIV_KEY_INFO_fp(FILE *fp,PKCS8_PRIV_KEY_INFO *p8inf); +OPENSSL_EXPORT int i2d_PKCS8PrivateKeyInfo_fp(FILE *fp, EVP_PKEY *key); +OPENSSL_EXPORT int i2d_PrivateKey_fp(FILE *fp, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey_fp(FILE *fp, EVP_PKEY **a); +OPENSSL_EXPORT int i2d_PUBKEY_fp(FILE *fp, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY *d2i_PUBKEY_fp(FILE *fp, EVP_PKEY **a); +#endif + +OPENSSL_EXPORT X509 *d2i_X509_bio(BIO *bp,X509 **x509); +OPENSSL_EXPORT int i2d_X509_bio(BIO *bp,X509 *x509); +OPENSSL_EXPORT X509_CRL *d2i_X509_CRL_bio(BIO *bp,X509_CRL **crl); +OPENSSL_EXPORT int i2d_X509_CRL_bio(BIO *bp,X509_CRL *crl); +OPENSSL_EXPORT X509_REQ *d2i_X509_REQ_bio(BIO *bp,X509_REQ **req); +OPENSSL_EXPORT int i2d_X509_REQ_bio(BIO *bp,X509_REQ *req); +OPENSSL_EXPORT RSA *d2i_RSAPrivateKey_bio(BIO *bp,RSA **rsa); +OPENSSL_EXPORT int i2d_RSAPrivateKey_bio(BIO *bp,RSA *rsa); +OPENSSL_EXPORT RSA *d2i_RSAPublicKey_bio(BIO *bp,RSA **rsa); +OPENSSL_EXPORT int i2d_RSAPublicKey_bio(BIO *bp,RSA *rsa); +OPENSSL_EXPORT RSA *d2i_RSA_PUBKEY_bio(BIO *bp,RSA **rsa); +OPENSSL_EXPORT int i2d_RSA_PUBKEY_bio(BIO *bp,RSA *rsa); +#ifndef OPENSSL_NO_DSA +OPENSSL_EXPORT DSA *d2i_DSA_PUBKEY_bio(BIO *bp, DSA **dsa); +OPENSSL_EXPORT int i2d_DSA_PUBKEY_bio(BIO *bp, DSA *dsa); +OPENSSL_EXPORT DSA *d2i_DSAPrivateKey_bio(BIO *bp, DSA **dsa); +OPENSSL_EXPORT int i2d_DSAPrivateKey_bio(BIO *bp, DSA *dsa); +#endif +OPENSSL_EXPORT EC_KEY *d2i_EC_PUBKEY_bio(BIO *bp, EC_KEY **eckey); +OPENSSL_EXPORT int i2d_EC_PUBKEY_bio(BIO *bp, EC_KEY *eckey); +OPENSSL_EXPORT EC_KEY *d2i_ECPrivateKey_bio(BIO *bp, EC_KEY **eckey); +OPENSSL_EXPORT int i2d_ECPrivateKey_bio(BIO *bp, EC_KEY *eckey); +OPENSSL_EXPORT X509_SIG *d2i_PKCS8_bio(BIO *bp,X509_SIG **p8); +OPENSSL_EXPORT int i2d_PKCS8_bio(BIO *bp,X509_SIG *p8); +OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *d2i_PKCS8_PRIV_KEY_INFO_bio(BIO *bp, + PKCS8_PRIV_KEY_INFO **p8inf); +OPENSSL_EXPORT int i2d_PKCS8_PRIV_KEY_INFO_bio(BIO *bp,PKCS8_PRIV_KEY_INFO *p8inf); +OPENSSL_EXPORT int i2d_PKCS8PrivateKeyInfo_bio(BIO *bp, EVP_PKEY *key); +OPENSSL_EXPORT int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); +OPENSSL_EXPORT int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); +OPENSSL_EXPORT DH *d2i_DHparams_bio(BIO *bp, DH **dh); +OPENSSL_EXPORT int i2d_DHparams_bio(BIO *bp, const DH *dh); + +OPENSSL_EXPORT X509 *X509_dup(X509 *x509); +OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); +OPENSSL_EXPORT X509_EXTENSION *X509_EXTENSION_dup(X509_EXTENSION *ex); +OPENSSL_EXPORT X509_CRL *X509_CRL_dup(X509_CRL *crl); +OPENSSL_EXPORT X509_REVOKED *X509_REVOKED_dup(X509_REVOKED *rev); +OPENSSL_EXPORT X509_REQ *X509_REQ_dup(X509_REQ *req); +OPENSSL_EXPORT X509_ALGOR *X509_ALGOR_dup(X509_ALGOR *xn); +OPENSSL_EXPORT int X509_ALGOR_set0(X509_ALGOR *alg, const ASN1_OBJECT *aobj, int ptype, void *pval); +OPENSSL_EXPORT void X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, + const void **ppval, + const X509_ALGOR *algor); +OPENSSL_EXPORT void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md); +OPENSSL_EXPORT int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b); + +OPENSSL_EXPORT X509_NAME *X509_NAME_dup(X509_NAME *xn); +OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne); +OPENSSL_EXPORT int X509_NAME_ENTRY_set(const X509_NAME_ENTRY *ne); + +OPENSSL_EXPORT int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, + size_t *pderlen); + +OPENSSL_EXPORT int X509_cmp_time(const ASN1_TIME *s, time_t *t); +OPENSSL_EXPORT int X509_cmp_current_time(const ASN1_TIME *s); +OPENSSL_EXPORT ASN1_TIME * X509_time_adj(ASN1_TIME *s, long adj, time_t *t); +OPENSSL_EXPORT ASN1_TIME * X509_time_adj_ex(ASN1_TIME *s, int offset_day, long offset_sec, time_t *t); +OPENSSL_EXPORT ASN1_TIME * X509_gmtime_adj(ASN1_TIME *s, long adj); + +OPENSSL_EXPORT const char * X509_get_default_cert_area(void ); +OPENSSL_EXPORT const char * X509_get_default_cert_dir(void ); +OPENSSL_EXPORT const char * X509_get_default_cert_file(void ); +OPENSSL_EXPORT const char * X509_get_default_cert_dir_env(void ); +OPENSSL_EXPORT const char * X509_get_default_cert_file_env(void ); +OPENSSL_EXPORT const char * X509_get_default_private_dir(void ); + +OPENSSL_EXPORT X509_REQ * X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md); +OPENSSL_EXPORT X509 * X509_REQ_to_X509(X509_REQ *r, int days,EVP_PKEY *pkey); + +DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS) +DECLARE_ASN1_FUNCTIONS(X509_VAL) + +DECLARE_ASN1_FUNCTIONS(X509_PUBKEY) + +OPENSSL_EXPORT int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); +OPENSSL_EXPORT int i2d_PUBKEY(const EVP_PKEY *a,unsigned char **pp); +OPENSSL_EXPORT EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp, + long length); +OPENSSL_EXPORT int i2d_RSA_PUBKEY(const RSA *a,unsigned char **pp); +OPENSSL_EXPORT RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp, + long length); +#ifndef OPENSSL_NO_DSA +OPENSSL_EXPORT int i2d_DSA_PUBKEY(const DSA *a,unsigned char **pp); +OPENSSL_EXPORT DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp, + long length); +#endif +OPENSSL_EXPORT int i2d_EC_PUBKEY(const EC_KEY *a, unsigned char **pp); +OPENSSL_EXPORT EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, + long length); + +DECLARE_ASN1_FUNCTIONS(X509_SIG) +DECLARE_ASN1_FUNCTIONS(X509_REQ_INFO) +DECLARE_ASN1_FUNCTIONS(X509_REQ) + +DECLARE_ASN1_FUNCTIONS(X509_ATTRIBUTE) +OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_create(int nid, int atrtype, void *value); + +DECLARE_ASN1_FUNCTIONS(X509_EXTENSION) +DECLARE_ASN1_ENCODE_FUNCTIONS(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) + +DECLARE_ASN1_FUNCTIONS(X509_NAME_ENTRY) + +DECLARE_ASN1_FUNCTIONS(X509_NAME) + +OPENSSL_EXPORT int X509_NAME_set(X509_NAME **xn, X509_NAME *name); + +DECLARE_ASN1_FUNCTIONS(X509_CINF) + +DECLARE_ASN1_FUNCTIONS(X509) +DECLARE_ASN1_FUNCTIONS(X509_CERT_AUX) + +/* X509_up_ref adds one to the reference count of |x| and returns one. */ +OPENSSL_EXPORT int X509_up_ref(X509 *x); + +OPENSSL_EXPORT int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func); +OPENSSL_EXPORT int X509_set_ex_data(X509 *r, int idx, void *arg); +OPENSSL_EXPORT void *X509_get_ex_data(X509 *r, int idx); +OPENSSL_EXPORT int i2d_X509_AUX(X509 *a,unsigned char **pp); +OPENSSL_EXPORT X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); + +OPENSSL_EXPORT int i2d_re_X509_tbs(X509 *x, unsigned char **pp); + +OPENSSL_EXPORT void X509_get0_signature(const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg, const X509 *x); +OPENSSL_EXPORT int X509_get_signature_nid(const X509 *x); + +OPENSSL_EXPORT int X509_alias_set1(X509 *x, unsigned char *name, int len); +OPENSSL_EXPORT int X509_keyid_set1(X509 *x, unsigned char *id, int len); +OPENSSL_EXPORT unsigned char * X509_alias_get0(X509 *x, int *len); +OPENSSL_EXPORT unsigned char * X509_keyid_get0(X509 *x, int *len); +OPENSSL_EXPORT int (*X509_TRUST_set_default(int (*trust)(int , X509 *, int)))(int, X509 *, int); +OPENSSL_EXPORT int X509_TRUST_set(int *t, int trust); +OPENSSL_EXPORT int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj); +OPENSSL_EXPORT int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj); +OPENSSL_EXPORT void X509_trust_clear(X509 *x); +OPENSSL_EXPORT void X509_reject_clear(X509 *x); + +DECLARE_ASN1_FUNCTIONS(X509_REVOKED) +DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO) +DECLARE_ASN1_FUNCTIONS(X509_CRL) + +OPENSSL_EXPORT int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); +OPENSSL_EXPORT int X509_CRL_get0_by_serial(X509_CRL *crl, + X509_REVOKED **ret, ASN1_INTEGER *serial); +OPENSSL_EXPORT int X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x); + +OPENSSL_EXPORT X509_PKEY * X509_PKEY_new(void ); +OPENSSL_EXPORT void X509_PKEY_free(X509_PKEY *a); + +DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) +DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) + +#ifndef OPENSSL_NO_EVP +OPENSSL_EXPORT X509_INFO * X509_INFO_new(void); +OPENSSL_EXPORT void X509_INFO_free(X509_INFO *a); +OPENSSL_EXPORT char * X509_NAME_oneline(X509_NAME *a,char *buf,int size); + +OPENSSL_EXPORT int ASN1_digest(i2d_of_void *i2d,const EVP_MD *type,char *data, + unsigned char *md,unsigned int *len); + +OPENSSL_EXPORT int ASN1_item_digest(const ASN1_ITEM *it,const EVP_MD *type,void *data, + unsigned char *md,unsigned int *len); + +OPENSSL_EXPORT int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *algor1, + ASN1_BIT_STRING *signature,void *data,EVP_PKEY *pkey); + +OPENSSL_EXPORT int ASN1_item_sign(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, + void *data, EVP_PKEY *pkey, const EVP_MD *type); +OPENSSL_EXPORT int ASN1_item_sign_ctx(const ASN1_ITEM *it, + X509_ALGOR *algor1, X509_ALGOR *algor2, + ASN1_BIT_STRING *signature, void *asn, EVP_MD_CTX *ctx); +#endif + +OPENSSL_EXPORT int X509_set_version(X509 *x,long version); +OPENSSL_EXPORT int X509_set_serialNumber(X509 *x, ASN1_INTEGER *serial); +OPENSSL_EXPORT ASN1_INTEGER * X509_get_serialNumber(X509 *x); +OPENSSL_EXPORT int X509_set_issuer_name(X509 *x, X509_NAME *name); +OPENSSL_EXPORT X509_NAME * X509_get_issuer_name(X509 *a); +OPENSSL_EXPORT int X509_set_subject_name(X509 *x, X509_NAME *name); +OPENSSL_EXPORT X509_NAME * X509_get_subject_name(X509 *a); +OPENSSL_EXPORT int X509_set_notBefore(X509 *x, const ASN1_TIME *tm); +OPENSSL_EXPORT const ASN1_TIME *X509_get0_notBefore(const X509 *x); +OPENSSL_EXPORT int X509_set_notAfter(X509 *x, const ASN1_TIME *tm); +OPENSSL_EXPORT const ASN1_TIME *X509_get0_notAfter(const X509 *x); +OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY * X509_get_pubkey(X509 *x); +OPENSSL_EXPORT ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); +OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +OPENSSL_EXPORT const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); + +OPENSSL_EXPORT int X509_REQ_set_version(X509_REQ *x,long version); +OPENSSL_EXPORT int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); +OPENSSL_EXPORT void X509_REQ_get0_signature(const X509_REQ *req, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +OPENSSL_EXPORT int X509_REQ_get_signature_nid(const X509_REQ *req); +OPENSSL_EXPORT int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); +OPENSSL_EXPORT int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); +OPENSSL_EXPORT EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); +OPENSSL_EXPORT int X509_REQ_extension_nid(int nid); +OPENSSL_EXPORT const int * X509_REQ_get_extension_nids(void); +OPENSSL_EXPORT void X509_REQ_set_extension_nids(const int *nids); +OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req); +OPENSSL_EXPORT int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts, + int nid); +OPENSSL_EXPORT int X509_REQ_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts); +OPENSSL_EXPORT int X509_REQ_get_attr_count(const X509_REQ *req); +OPENSSL_EXPORT int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, + int lastpos); +OPENSSL_EXPORT int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj, + int lastpos); +OPENSSL_EXPORT X509_ATTRIBUTE *X509_REQ_get_attr(const X509_REQ *req, int loc); +OPENSSL_EXPORT X509_ATTRIBUTE *X509_REQ_delete_attr(X509_REQ *req, int loc); +OPENSSL_EXPORT int X509_REQ_add1_attr(X509_REQ *req, X509_ATTRIBUTE *attr); +OPENSSL_EXPORT int X509_REQ_add1_attr_by_OBJ(X509_REQ *req, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +OPENSSL_EXPORT int X509_REQ_add1_attr_by_NID(X509_REQ *req, + int nid, int type, + const unsigned char *bytes, int len); +OPENSSL_EXPORT int X509_REQ_add1_attr_by_txt(X509_REQ *req, + const char *attrname, int type, + const unsigned char *bytes, int len); + +OPENSSL_EXPORT int X509_CRL_set_version(X509_CRL *x, long version); +OPENSSL_EXPORT int X509_CRL_set_issuer_name(X509_CRL *x, X509_NAME *name); +OPENSSL_EXPORT int X509_CRL_set_lastUpdate(X509_CRL *x, const ASN1_TIME *tm); +OPENSSL_EXPORT int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); +OPENSSL_EXPORT int X509_CRL_sort(X509_CRL *crl); +OPENSSL_EXPORT int X509_CRL_up_ref(X509_CRL *crl); + +OPENSSL_EXPORT void X509_CRL_get0_signature(const X509_CRL *crl, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +OPENSSL_EXPORT int X509_CRL_get_signature_nid(const X509_CRL *crl); +OPENSSL_EXPORT int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); + +OPENSSL_EXPORT const ASN1_INTEGER *X509_REVOKED_get0_serialNumber( + const X509_REVOKED *x); +OPENSSL_EXPORT int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); +OPENSSL_EXPORT const ASN1_TIME *X509_REVOKED_get0_revocationDate( + const X509_REVOKED *x); +OPENSSL_EXPORT int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); + +OPENSSL_EXPORT X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, + EVP_PKEY *skey, const EVP_MD *md, unsigned int flags); + +OPENSSL_EXPORT int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); + +OPENSSL_EXPORT int X509_check_private_key(X509 *x509, const EVP_PKEY *pkey); +OPENSSL_EXPORT int X509_chain_check_suiteb(int *perror_depth, + X509 *x, STACK_OF(X509) *chain, + unsigned long flags); +OPENSSL_EXPORT int X509_CRL_check_suiteb(X509_CRL *crl, EVP_PKEY *pk, + unsigned long flags); +OPENSSL_EXPORT STACK_OF(X509) *X509_chain_up_ref(STACK_OF(X509) *chain); + +OPENSSL_EXPORT int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); +OPENSSL_EXPORT unsigned long X509_issuer_and_serial_hash(X509 *a); + +OPENSSL_EXPORT int X509_issuer_name_cmp(const X509 *a, const X509 *b); +OPENSSL_EXPORT unsigned long X509_issuer_name_hash(X509 *a); + +OPENSSL_EXPORT int X509_subject_name_cmp(const X509 *a, const X509 *b); +OPENSSL_EXPORT unsigned long X509_subject_name_hash(X509 *x); + +OPENSSL_EXPORT unsigned long X509_issuer_name_hash_old(X509 *a); +OPENSSL_EXPORT unsigned long X509_subject_name_hash_old(X509 *x); + +OPENSSL_EXPORT int X509_cmp(const X509 *a, const X509 *b); +OPENSSL_EXPORT int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); +OPENSSL_EXPORT unsigned long X509_NAME_hash(X509_NAME *x); +OPENSSL_EXPORT unsigned long X509_NAME_hash_old(X509_NAME *x); + +OPENSSL_EXPORT int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); +OPENSSL_EXPORT int X509_CRL_match(const X509_CRL *a, const X509_CRL *b); +#ifndef OPENSSL_NO_FP_API +OPENSSL_EXPORT int X509_print_ex_fp(FILE *bp,X509 *x, unsigned long nmflag, unsigned long cflag); +OPENSSL_EXPORT int X509_print_fp(FILE *bp,X509 *x); +OPENSSL_EXPORT int X509_CRL_print_fp(FILE *bp,X509_CRL *x); +OPENSSL_EXPORT int X509_REQ_print_fp(FILE *bp,X509_REQ *req); +OPENSSL_EXPORT int X509_NAME_print_ex_fp(FILE *fp, X509_NAME *nm, int indent, unsigned long flags); +#endif + +OPENSSL_EXPORT int X509_NAME_print(BIO *bp, X509_NAME *name, int obase); +OPENSSL_EXPORT int X509_NAME_print_ex(BIO *out, X509_NAME *nm, int indent, unsigned long flags); +OPENSSL_EXPORT int X509_print_ex(BIO *bp,X509 *x, unsigned long nmflag, unsigned long cflag); +OPENSSL_EXPORT int X509_print(BIO *bp,X509 *x); +OPENSSL_EXPORT int X509_ocspid_print(BIO *bp,X509 *x); +OPENSSL_EXPORT int X509_CERT_AUX_print(BIO *bp,X509_CERT_AUX *x, int indent); +OPENSSL_EXPORT int X509_CRL_print(BIO *bp,X509_CRL *x); +OPENSSL_EXPORT int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflag, unsigned long cflag); +OPENSSL_EXPORT int X509_REQ_print(BIO *bp,X509_REQ *req); + +OPENSSL_EXPORT int X509_NAME_entry_count(X509_NAME *name); +OPENSSL_EXPORT int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, + char *buf,int len); +OPENSSL_EXPORT int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + char *buf,int len); + +/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use + * lastpos, search after that position on. */ +OPENSSL_EXPORT int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); +OPENSSL_EXPORT int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, + int lastpos); +OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *name, int loc); +OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); +OPENSSL_EXPORT int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne, + int loc, int set); +OPENSSL_EXPORT int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type, + unsigned char *bytes, int len, int loc, int set); +OPENSSL_EXPORT int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + unsigned char *bytes, int len, int loc, int set); +OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, + const char *field, int type, const unsigned char *bytes, int len); +OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type,unsigned char *bytes, int len); +OPENSSL_EXPORT int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, + const unsigned char *bytes, int len, int loc, int set); +OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, + const ASN1_OBJECT *obj, int type,const unsigned char *bytes, + int len); +OPENSSL_EXPORT int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, + const ASN1_OBJECT *obj); +OPENSSL_EXPORT int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len); +OPENSSL_EXPORT ASN1_OBJECT * X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *ne); +OPENSSL_EXPORT ASN1_STRING * X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *ne); + +OPENSSL_EXPORT int X509v3_get_ext_count(const STACK_OF(X509_EXTENSION) *x); +OPENSSL_EXPORT int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, + int nid, int lastpos); +OPENSSL_EXPORT int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *x, + const ASN1_OBJECT *obj,int lastpos); +OPENSSL_EXPORT int X509v3_get_ext_by_critical(const STACK_OF(X509_EXTENSION) *x, + int crit, int lastpos); +OPENSSL_EXPORT X509_EXTENSION *X509v3_get_ext(const STACK_OF(X509_EXTENSION) *x, int loc); +OPENSSL_EXPORT X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc); +OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, + X509_EXTENSION *ex, int loc); + +OPENSSL_EXPORT int X509_get_ext_count(X509 *x); +OPENSSL_EXPORT int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); +OPENSSL_EXPORT int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); +OPENSSL_EXPORT int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); +OPENSSL_EXPORT X509_EXTENSION *X509_get_ext(X509 *x, int loc); +OPENSSL_EXPORT X509_EXTENSION *X509_delete_ext(X509 *x, int loc); +OPENSSL_EXPORT int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); +OPENSSL_EXPORT void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); +OPENSSL_EXPORT int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, + unsigned long flags); + +OPENSSL_EXPORT int X509_CRL_get_ext_count(X509_CRL *x); +OPENSSL_EXPORT int X509_CRL_get_ext_by_NID(X509_CRL *x, int nid, int lastpos); +OPENSSL_EXPORT int X509_CRL_get_ext_by_OBJ(X509_CRL *x,ASN1_OBJECT *obj,int lastpos); +OPENSSL_EXPORT int X509_CRL_get_ext_by_critical(X509_CRL *x, int crit, int lastpos); +OPENSSL_EXPORT X509_EXTENSION *X509_CRL_get_ext(X509_CRL *x, int loc); +OPENSSL_EXPORT X509_EXTENSION *X509_CRL_delete_ext(X509_CRL *x, int loc); +OPENSSL_EXPORT int X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc); +OPENSSL_EXPORT void * X509_CRL_get_ext_d2i(X509_CRL *x, int nid, int *crit, int *idx); +OPENSSL_EXPORT int X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, + unsigned long flags); + +OPENSSL_EXPORT int X509_REVOKED_get_ext_count(X509_REVOKED *x); +OPENSSL_EXPORT int X509_REVOKED_get_ext_by_NID(X509_REVOKED *x, int nid, int lastpos); +OPENSSL_EXPORT int X509_REVOKED_get_ext_by_OBJ(X509_REVOKED *x,ASN1_OBJECT *obj,int lastpos); +OPENSSL_EXPORT int X509_REVOKED_get_ext_by_critical(X509_REVOKED *x, int crit, int lastpos); +OPENSSL_EXPORT X509_EXTENSION *X509_REVOKED_get_ext(X509_REVOKED *x, int loc); +OPENSSL_EXPORT X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); +OPENSSL_EXPORT int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); +OPENSSL_EXPORT void * X509_REVOKED_get_ext_d2i(X509_REVOKED *x, int nid, int *crit, int *idx); +OPENSSL_EXPORT int X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, + unsigned long flags); + +OPENSSL_EXPORT X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, + int nid, int crit, ASN1_OCTET_STRING *data); +OPENSSL_EXPORT X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex, + const ASN1_OBJECT *obj,int crit,ASN1_OCTET_STRING *data); +OPENSSL_EXPORT int X509_EXTENSION_set_object(X509_EXTENSION *ex,const ASN1_OBJECT *obj); +OPENSSL_EXPORT int X509_EXTENSION_set_critical(X509_EXTENSION *ex, int crit); +OPENSSL_EXPORT int X509_EXTENSION_set_data(X509_EXTENSION *ex, + ASN1_OCTET_STRING *data); +OPENSSL_EXPORT ASN1_OBJECT * X509_EXTENSION_get_object(X509_EXTENSION *ex); +OPENSSL_EXPORT ASN1_OCTET_STRING *X509_EXTENSION_get_data(X509_EXTENSION *ne); +OPENSSL_EXPORT int X509_EXTENSION_get_critical(X509_EXTENSION *ex); + +OPENSSL_EXPORT int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x); +OPENSSL_EXPORT int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid, + int lastpos); +OPENSSL_EXPORT int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk, const ASN1_OBJECT *obj, + int lastpos); +OPENSSL_EXPORT X509_ATTRIBUTE *X509at_get_attr(const STACK_OF(X509_ATTRIBUTE) *x, int loc); +OPENSSL_EXPORT X509_ATTRIBUTE *X509at_delete_attr(STACK_OF(X509_ATTRIBUTE) *x, int loc); +OPENSSL_EXPORT STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr(STACK_OF(X509_ATTRIBUTE) **x, + X509_ATTRIBUTE *attr); +OPENSSL_EXPORT STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_OBJ(STACK_OF(X509_ATTRIBUTE) **x, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); +OPENSSL_EXPORT STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_NID(STACK_OF(X509_ATTRIBUTE) **x, + int nid, int type, + const unsigned char *bytes, int len); +OPENSSL_EXPORT STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE) **x, + const char *attrname, int type, + const unsigned char *bytes, int len); +OPENSSL_EXPORT void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x, + ASN1_OBJECT *obj, int lastpos, int type); +OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_NID(X509_ATTRIBUTE **attr, int nid, + int atrtype, const void *data, int len); +OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_OBJ(X509_ATTRIBUTE **attr, + const ASN1_OBJECT *obj, int atrtype, const void *data, int len); +OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, + const char *atrname, int type, const unsigned char *bytes, int len); +OPENSSL_EXPORT int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj); +OPENSSL_EXPORT int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len); +OPENSSL_EXPORT void *X509_ATTRIBUTE_get0_data(X509_ATTRIBUTE *attr, int idx, + int atrtype, void *data); +OPENSSL_EXPORT int X509_ATTRIBUTE_count(X509_ATTRIBUTE *attr); +OPENSSL_EXPORT ASN1_OBJECT *X509_ATTRIBUTE_get0_object(X509_ATTRIBUTE *attr); +OPENSSL_EXPORT ASN1_TYPE *X509_ATTRIBUTE_get0_type(X509_ATTRIBUTE *attr, int idx); + +OPENSSL_EXPORT int X509_verify_cert(X509_STORE_CTX *ctx); + +/* lookup a cert from a X509 STACK */ +OPENSSL_EXPORT X509 *X509_find_by_issuer_and_serial(STACK_OF(X509) *sk,X509_NAME *name, + ASN1_INTEGER *serial); +OPENSSL_EXPORT X509 *X509_find_by_subject(STACK_OF(X509) *sk,X509_NAME *name); + +/* PKCS#8 utilities */ + +DECLARE_ASN1_FUNCTIONS(PKCS8_PRIV_KEY_INFO) + +OPENSSL_EXPORT EVP_PKEY *EVP_PKCS82PKEY(PKCS8_PRIV_KEY_INFO *p8); +OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(EVP_PKEY *pkey); +OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8_broken(EVP_PKEY *pkey, int broken); +OPENSSL_EXPORT PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken); + +OPENSSL_EXPORT int PKCS8_pkey_set0(PKCS8_PRIV_KEY_INFO *priv, ASN1_OBJECT *aobj, + int version, int ptype, void *pval, + unsigned char *penc, int penclen); +OPENSSL_EXPORT int PKCS8_pkey_get0(ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + X509_ALGOR **pa, + PKCS8_PRIV_KEY_INFO *p8); + +OPENSSL_EXPORT int X509_PUBKEY_set0_param(X509_PUBKEY *pub, const ASN1_OBJECT *aobj, + int ptype, void *pval, + unsigned char *penc, int penclen); +OPENSSL_EXPORT int X509_PUBKEY_get0_param(ASN1_OBJECT **ppkalg, + const unsigned char **pk, int *ppklen, + X509_ALGOR **pa, + X509_PUBKEY *pub); + +OPENSSL_EXPORT int X509_check_trust(X509 *x, int id, int flags); +OPENSSL_EXPORT int X509_TRUST_get_count(void); +OPENSSL_EXPORT X509_TRUST * X509_TRUST_get0(int idx); +OPENSSL_EXPORT int X509_TRUST_get_by_id(int id); +OPENSSL_EXPORT int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int), + char *name, int arg1, void *arg2); +OPENSSL_EXPORT void X509_TRUST_cleanup(void); +OPENSSL_EXPORT int X509_TRUST_get_flags(X509_TRUST *xp); +OPENSSL_EXPORT char *X509_TRUST_get0_name(X509_TRUST *xp); +OPENSSL_EXPORT int X509_TRUST_get_trust(X509_TRUST *xp); + + +typedef struct rsa_pss_params_st { + X509_ALGOR *hashAlgorithm; + X509_ALGOR *maskGenAlgorithm; + ASN1_INTEGER *saltLength; + ASN1_INTEGER *trailerField; +} RSA_PSS_PARAMS; + +DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) + + + +#ifdef __cplusplus +} +#endif + +#if !defined(BORINGSSL_NO_CXX) +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(NETSCAPE_SPKI, NETSCAPE_SPKI_free) +BORINGSSL_MAKE_DELETER(RSA_PSS_PARAMS, RSA_PSS_PARAMS_free) +BORINGSSL_MAKE_DELETER(X509, X509_free) +BORINGSSL_MAKE_UP_REF(X509, X509_up_ref) +BORINGSSL_MAKE_DELETER(X509_ALGOR, X509_ALGOR_free) +BORINGSSL_MAKE_DELETER(X509_CRL, X509_CRL_free) +BORINGSSL_MAKE_UP_REF(X509_CRL, X509_CRL_up_ref) +BORINGSSL_MAKE_DELETER(X509_CRL_METHOD, X509_CRL_METHOD_free) +BORINGSSL_MAKE_DELETER(X509_EXTENSION, X509_EXTENSION_free) +BORINGSSL_MAKE_DELETER(X509_INFO, X509_INFO_free) +BORINGSSL_MAKE_DELETER(X509_LOOKUP, X509_LOOKUP_free) +BORINGSSL_MAKE_DELETER(X509_NAME, X509_NAME_free) +BORINGSSL_MAKE_DELETER(X509_NAME_ENTRY, X509_NAME_ENTRY_free) +BORINGSSL_MAKE_DELETER(X509_PKEY, X509_PKEY_free) +BORINGSSL_MAKE_DELETER(X509_POLICY_TREE, X509_policy_tree_free) +BORINGSSL_MAKE_DELETER(X509_PUBKEY, X509_PUBKEY_free) +BORINGSSL_MAKE_DELETER(X509_REQ, X509_REQ_free) +BORINGSSL_MAKE_DELETER(X509_REVOKED, X509_REVOKED_free) +BORINGSSL_MAKE_DELETER(X509_SIG, X509_SIG_free) +BORINGSSL_MAKE_DELETER(X509_STORE, X509_STORE_free) +BORINGSSL_MAKE_DELETER(X509_STORE_CTX, X509_STORE_CTX_free) +BORINGSSL_MAKE_DELETER(X509_VERIFY_PARAM, X509_VERIFY_PARAM_free) + +using ScopedX509_STORE_CTX = + internal::StackAllocated; + +BSSL_NAMESPACE_END + +} /* extern C++ */ +#endif /* !BORINGSSL_NO_CXX */ + +#define X509_R_AKID_MISMATCH 100 +#define X509_R_BAD_PKCS7_VERSION 101 +#define X509_R_BAD_X509_FILETYPE 102 +#define X509_R_BASE64_DECODE_ERROR 103 +#define X509_R_CANT_CHECK_DH_KEY 104 +#define X509_R_CERT_ALREADY_IN_HASH_TABLE 105 +#define X509_R_CRL_ALREADY_DELTA 106 +#define X509_R_CRL_VERIFY_FAILURE 107 +#define X509_R_IDP_MISMATCH 108 +#define X509_R_INVALID_BIT_STRING_BITS_LEFT 109 +#define X509_R_INVALID_DIRECTORY 110 +#define X509_R_INVALID_FIELD_NAME 111 +#define X509_R_INVALID_PSS_PARAMETERS 112 +#define X509_R_INVALID_TRUST 113 +#define X509_R_ISSUER_MISMATCH 114 +#define X509_R_KEY_TYPE_MISMATCH 115 +#define X509_R_KEY_VALUES_MISMATCH 116 +#define X509_R_LOADING_CERT_DIR 117 +#define X509_R_LOADING_DEFAULTS 118 +#define X509_R_NEWER_CRL_NOT_NEWER 119 +#define X509_R_NOT_PKCS7_SIGNED_DATA 120 +#define X509_R_NO_CERTIFICATES_INCLUDED 121 +#define X509_R_NO_CERT_SET_FOR_US_TO_VERIFY 122 +#define X509_R_NO_CRLS_INCLUDED 123 +#define X509_R_NO_CRL_NUMBER 124 +#define X509_R_PUBLIC_KEY_DECODE_ERROR 125 +#define X509_R_PUBLIC_KEY_ENCODE_ERROR 126 +#define X509_R_SHOULD_RETRY 127 +#define X509_R_UNKNOWN_KEY_TYPE 128 +#define X509_R_UNKNOWN_NID 129 +#define X509_R_UNKNOWN_PURPOSE_ID 130 +#define X509_R_UNKNOWN_TRUST_ID 131 +#define X509_R_UNSUPPORTED_ALGORITHM 132 +#define X509_R_WRONG_LOOKUP_TYPE 133 +#define X509_R_WRONG_TYPE 134 +#define X509_R_NAME_TOO_LONG 135 +#define X509_R_INVALID_PARAMETER 136 +#define X509_R_SIGNATURE_ALGORITHM_MISMATCH 137 + +#endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/x509.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/include/openssl/x509.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/x509.h.grpc_back index b336e0fcc..ee3ecccc0 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/x509.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509.h.grpc_back @@ -531,6 +531,8 @@ extern "C" { #define X509_get_signature_type(x) EVP_PKEY_type(OBJ_obj2nid((x)->sig_alg->algorithm)) #define X509_CRL_get_version(x) ASN1_INTEGER_get((x)->crl->version) +const ASN1_TIME *X509_CRL_get0_lastUpdate(const X509_CRL *crl); +const ASN1_TIME *X509_CRL_get0_nextUpdate(const X509_CRL *crl); #define X509_CRL_get_lastUpdate(x) ((x)->crl->lastUpdate) #define X509_CRL_get_nextUpdate(x) ((x)->crl->nextUpdate) #define X509_CRL_get_issuer(x) ((x)->crl->issuer) @@ -671,6 +673,8 @@ OPENSSL_EXPORT int i2d_PrivateKey_bio(BIO *bp, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY *d2i_PrivateKey_bio(BIO *bp, EVP_PKEY **a); OPENSSL_EXPORT int i2d_PUBKEY_bio(BIO *bp, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY *d2i_PUBKEY_bio(BIO *bp, EVP_PKEY **a); +OPENSSL_EXPORT DH *d2i_DHparams_bio(BIO *bp, DH **dh); +OPENSSL_EXPORT int i2d_DHparams_bio(BIO *bp, const DH *dh); OPENSSL_EXPORT X509 *X509_dup(X509 *x509); OPENSSL_EXPORT X509_ATTRIBUTE *X509_ATTRIBUTE_dup(X509_ATTRIBUTE *xa); @@ -762,6 +766,8 @@ OPENSSL_EXPORT void *X509_get_ex_data(X509 *r, int idx); OPENSSL_EXPORT int i2d_X509_AUX(X509 *a,unsigned char **pp); OPENSSL_EXPORT X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); +OPENSSL_EXPORT int i2d_re_X509_tbs(X509 *x, unsigned char **pp); + OPENSSL_EXPORT void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x); OPENSSL_EXPORT int X509_get_signature_nid(const X509 *x); @@ -829,9 +835,15 @@ OPENSSL_EXPORT int X509_set_pubkey(X509 *x, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY * X509_get_pubkey(X509 *x); OPENSSL_EXPORT ASN1_BIT_STRING * X509_get0_pubkey_bitstr(const X509 *x); OPENSSL_EXPORT STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x); +OPENSSL_EXPORT const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x); OPENSSL_EXPORT int X509_REQ_set_version(X509_REQ *x,long version); OPENSSL_EXPORT int X509_REQ_set_subject_name(X509_REQ *req,X509_NAME *name); +OPENSSL_EXPORT void X509_REQ_get0_signature(const X509_REQ *req, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +OPENSSL_EXPORT int X509_REQ_get_signature_nid(const X509_REQ *req); +OPENSSL_EXPORT int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); OPENSSL_EXPORT int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); OPENSSL_EXPORT EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); OPENSSL_EXPORT int X509_REQ_extension_nid(int nid); @@ -866,7 +878,17 @@ OPENSSL_EXPORT int X509_CRL_set_nextUpdate(X509_CRL *x, const ASN1_TIME *tm); OPENSSL_EXPORT int X509_CRL_sort(X509_CRL *crl); OPENSSL_EXPORT int X509_CRL_up_ref(X509_CRL *crl); +OPENSSL_EXPORT void X509_CRL_get0_signature(const X509_CRL *crl, + const ASN1_BIT_STRING **psig, + const X509_ALGOR **palg); +OPENSSL_EXPORT int X509_CRL_get_signature_nid(const X509_CRL *crl); +OPENSSL_EXPORT int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); + +OPENSSL_EXPORT const ASN1_INTEGER *X509_REVOKED_get0_serialNumber( + const X509_REVOKED *x); OPENSSL_EXPORT int X509_REVOKED_set_serialNumber(X509_REVOKED *x, ASN1_INTEGER *serial); +OPENSSL_EXPORT const ASN1_TIME *X509_REVOKED_get0_revocationDate( + const X509_REVOKED *x); OPENSSL_EXPORT int X509_REVOKED_set_revocationDate(X509_REVOKED *r, ASN1_TIME *tm); OPENSSL_EXPORT X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, @@ -874,7 +896,7 @@ OPENSSL_EXPORT X509_CRL *X509_CRL_diff(X509_CRL *base, X509_CRL *newer, OPENSSL_EXPORT int X509_REQ_check_private_key(X509_REQ *x509,EVP_PKEY *pkey); -OPENSSL_EXPORT int X509_check_private_key(X509 *x509,EVP_PKEY *pkey); +OPENSSL_EXPORT int X509_check_private_key(X509 *x509, const EVP_PKEY *pkey); OPENSSL_EXPORT int X509_chain_check_suiteb(int *perror_depth, X509 *x, STACK_OF(X509) *chain, unsigned long flags); @@ -1107,13 +1129,15 @@ DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) #if !defined(BORINGSSL_NO_CXX) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN BORINGSSL_MAKE_DELETER(NETSCAPE_SPKI, NETSCAPE_SPKI_free) BORINGSSL_MAKE_DELETER(RSA_PSS_PARAMS, RSA_PSS_PARAMS_free) BORINGSSL_MAKE_DELETER(X509, X509_free) +BORINGSSL_MAKE_UP_REF(X509, X509_up_ref) BORINGSSL_MAKE_DELETER(X509_ALGOR, X509_ALGOR_free) BORINGSSL_MAKE_DELETER(X509_CRL, X509_CRL_free) +BORINGSSL_MAKE_UP_REF(X509_CRL, X509_CRL_up_ref) BORINGSSL_MAKE_DELETER(X509_CRL_METHOD, X509_CRL_METHOD_free) BORINGSSL_MAKE_DELETER(X509_EXTENSION, X509_EXTENSION_free) BORINGSSL_MAKE_DELETER(X509_INFO, X509_INFO_free) @@ -1134,7 +1158,7 @@ using ScopedX509_STORE_CTX = internal::StackAllocated; -} // namespace bssl +BSSL_NAMESPACE_END } /* extern C++ */ #endif /* !BORINGSSL_NO_CXX */ @@ -1176,5 +1200,6 @@ using ScopedX509_STORE_CTX = #define X509_R_WRONG_TYPE 134 #define X509_R_NAME_TOO_LONG 135 #define X509_R_INVALID_PARAMETER 136 +#define X509_R_SIGNATURE_ALGORITHM_MISMATCH 137 #endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/x509_vfy.h b/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h similarity index 81% rename from Pods/BoringSSL-GRPC/include/openssl/x509_vfy.h rename to Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h index 10b4e00d2..1ac4dae8f 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/x509_vfy.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h @@ -158,6 +158,25 @@ struct X509_VERIFY_PARAM_st DEFINE_STACK_OF(X509_VERIFY_PARAM) +typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer, + X509_STORE_CTX *ctx, X509 *x); +typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx, + X509 *x, X509 *issuer); +typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx); +typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL **crl, X509 *x); +typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl); +typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL *crl, X509 *x); +typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx); +typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx, + X509_NAME *nm); +typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(X509_STORE_CTX *ctx, + X509_NAME *nm); +typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx); + /* This is used to hold everything. It is used for all certificate * validation. Once we have a certificate chain, the 'verify' * function is then called to actually check the cert chain. */ @@ -175,26 +194,23 @@ struct x509_store_st X509_VERIFY_PARAM *param; /* Callbacks for various operations */ - int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ - int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ - int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ - int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ - int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ - int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ - int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ - int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ - STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm); - STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm); - int (*cleanup)(X509_STORE_CTX *ctx); + X509_STORE_CTX_verify_fn verify; /* called to verify a certificate */ + X509_STORE_CTX_verify_cb verify_cb; /* error callback */ + X509_STORE_CTX_get_issuer_fn get_issuer; /* get issuers cert from ctx */ + X509_STORE_CTX_check_issued_fn check_issued; /* check issued */ + X509_STORE_CTX_check_revocation_fn check_revocation; /* Check revocation status of chain */ + X509_STORE_CTX_get_crl_fn get_crl; /* retrieve CRL */ + X509_STORE_CTX_check_crl_fn check_crl; /* Check CRL validity */ + X509_STORE_CTX_cert_crl_fn cert_crl; /* Check certificate against CRL */ + X509_STORE_CTX_lookup_certs_fn lookup_certs; + X509_STORE_CTX_lookup_crls_fn lookup_crls; + X509_STORE_CTX_cleanup_fn cleanup; CRYPTO_refcount_t references; } /* X509_STORE */; OPENSSL_EXPORT int X509_STORE_set_depth(X509_STORE *store, int depth); -#define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func)) -#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) - /* This is the functions plus an instance of the local variables. */ struct x509_lookup_st { @@ -222,18 +238,18 @@ struct x509_store_ctx_st /* X509_STORE_CTX */ void *other_ctx; /* Other info for use with get_issuer() */ /* Callbacks for various operations */ - int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ - int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ - int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ - int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ - int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ - int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ - int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ - int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ - int (*check_policy)(X509_STORE_CTX *ctx); - STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm); - STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm); - int (*cleanup)(X509_STORE_CTX *ctx); + X509_STORE_CTX_verify_fn verify; /* called to verify a certificate */ + X509_STORE_CTX_verify_cb verify_cb; /* error callback */ + X509_STORE_CTX_get_issuer_fn get_issuer; /* get issuers cert from ctx */ + X509_STORE_CTX_check_issued_fn check_issued; /* check issued */ + X509_STORE_CTX_check_revocation_fn check_revocation; /* Check revocation status of chain */ + X509_STORE_CTX_get_crl_fn get_crl; /* retrieve CRL */ + X509_STORE_CTX_check_crl_fn check_crl; /* Check CRL validity */ + X509_STORE_CTX_cert_crl_fn cert_crl; /* Check certificate against CRL */ + X509_STORE_CTX_check_policy_fn check_policy; + X509_STORE_CTX_lookup_certs_fn lookup_certs; + X509_STORE_CTX_lookup_crls_fn lookup_crls; + X509_STORE_CTX_cleanup_fn cleanup; /* The following is built up */ int valid; /* if 0, rebuild chain */ @@ -354,6 +370,8 @@ OPENSSL_EXPORT void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); /* Issuer lookup error */ #define X509_V_ERR_STORE_LOOKUP 66 +#define X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS 67 + /* Certificate verify flags */ /* Send issuer+subject checks to verify_cb */ @@ -366,8 +384,8 @@ OPENSSL_EXPORT void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); #define X509_V_FLAG_CRL_CHECK_ALL 0x8 /* Ignore unhandled critical extensions */ #define X509_V_FLAG_IGNORE_CRITICAL 0x10 -/* Disable workarounds for broken certificates */ -#define X509_V_FLAG_X509_STRICT 0x20 +/* Does nothing as its functionality has been enabled by default. */ +#define X509_V_FLAG_X509_STRICT 0x00 /* Enable proxy certificate validation */ #define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 /* Enable policy checking */ @@ -441,11 +459,58 @@ OPENSSL_EXPORT X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx); OPENSSL_EXPORT void X509_STORE_set0_additional_untrusted( X509_STORE *ctx, STACK_OF(X509) *untrusted); -OPENSSL_EXPORT void X509_STORE_set_verify_cb(X509_STORE *ctx, - int (*verify_cb)(int, X509_STORE_CTX *)); +OPENSSL_EXPORT void X509_STORE_set_verify(X509_STORE *ctx, + X509_STORE_CTX_verify_fn verify); +#define X509_STORE_set_verify_func(ctx, func) \ + X509_STORE_set_verify((ctx), (func)) +OPENSSL_EXPORT void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, + X509_STORE_CTX_verify_fn verify); +OPENSSL_EXPORT X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_verify_cb( + X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb); +#define X509_STORE_set_verify_cb_func(ctx, func) \ + X509_STORE_set_verify_cb((ctx), (func)) +OPENSSL_EXPORT X509_STORE_CTX_verify_cb +X509_STORE_get_verify_cb(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_get_issuer( + X509_STORE *ctx, X509_STORE_CTX_get_issuer_fn get_issuer); +OPENSSL_EXPORT X509_STORE_CTX_get_issuer_fn +X509_STORE_get_get_issuer(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_issued( + X509_STORE *ctx, X509_STORE_CTX_check_issued_fn check_issued); +OPENSSL_EXPORT X509_STORE_CTX_check_issued_fn +X509_STORE_get_check_issued(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_revocation( + X509_STORE *ctx, X509_STORE_CTX_check_revocation_fn check_revocation); +OPENSSL_EXPORT X509_STORE_CTX_check_revocation_fn +X509_STORE_get_check_revocation(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_get_crl(X509_STORE *ctx, + X509_STORE_CTX_get_crl_fn get_crl); +OPENSSL_EXPORT X509_STORE_CTX_get_crl_fn +X509_STORE_get_get_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_crl( + X509_STORE *ctx, X509_STORE_CTX_check_crl_fn check_crl); +OPENSSL_EXPORT X509_STORE_CTX_check_crl_fn +X509_STORE_get_check_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_cert_crl( + X509_STORE *ctx, X509_STORE_CTX_cert_crl_fn cert_crl); +OPENSSL_EXPORT X509_STORE_CTX_cert_crl_fn +X509_STORE_get_cert_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_lookup_certs( + X509_STORE *ctx, X509_STORE_CTX_lookup_certs_fn lookup_certs); +OPENSSL_EXPORT X509_STORE_CTX_lookup_certs_fn +X509_STORE_get_lookup_certs(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_lookup_crls( + X509_STORE *ctx, X509_STORE_CTX_lookup_crls_fn lookup_crls); +#define X509_STORE_set_lookup_crls_cb(ctx, func) \ + X509_STORE_set_lookup_crls((ctx), (func)) +OPENSSL_EXPORT X509_STORE_CTX_lookup_crls_fn +X509_STORE_get_lookup_crls(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_cleanup(X509_STORE *ctx, + X509_STORE_CTX_cleanup_fn cleanup); +OPENSSL_EXPORT X509_STORE_CTX_cleanup_fn +X509_STORE_get_cleanup(X509_STORE *ctx); -OPENSSL_EXPORT void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx, - STACK_OF(X509_CRL)* (*cb)(X509_STORE_CTX *ctx, X509_NAME *nm)); OPENSSL_EXPORT X509_STORE_CTX *X509_STORE_CTX_new(void); @@ -459,6 +524,7 @@ OPENSSL_EXPORT void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X OPENSSL_EXPORT void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); OPENSSL_EXPORT X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); OPENSSL_EXPORT X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.back new file mode 100644 index 000000000..f26233497 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.back @@ -0,0 +1,680 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ + +#ifndef HEADER_X509_H +#include +/* openssl/x509.h ends up #include-ing this file at about the only + * appropriate moment. */ +#endif + +#ifndef HEADER_X509_VFY_H +#define HEADER_X509_VFY_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Legacy X.509 library. + * + * This header is part of OpenSSL's X.509 implementation. It is retained for + * compatibility but otherwise underdocumented and not actively maintained. In + * the future, a replacement library will be available. Meanwhile, minimize + * dependencies on this header where possible. */ + + +/*******************************/ +/* +SSL_CTX -> X509_STORE + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + -> X509_LOOKUP + ->X509_LOOKUP_METHOD + +SSL -> X509_STORE_CTX + ->X509_STORE + +The X509_STORE holds the tables etc for verification stuff. +A X509_STORE_CTX is used while validating a single certificate. +The X509_STORE has X509_LOOKUPs for looking up certs. +The X509_STORE then calls a function to actually verify the +certificate chain. +*/ + +#define X509_LU_X509 1 +#define X509_LU_CRL 2 +#define X509_LU_PKEY 3 + +typedef struct x509_object_st + { + /* one of the above types */ + int type; + union { + char *ptr; + X509 *x509; + X509_CRL *crl; + EVP_PKEY *pkey; + } data; + } X509_OBJECT; + +DEFINE_STACK_OF(X509_LOOKUP) +DEFINE_STACK_OF(X509_OBJECT) + +/* This is a static that defines the function interface */ +typedef struct x509_lookup_method_st + { + const char *name; + int (*new_item)(X509_LOOKUP *ctx); + void (*free)(X509_LOOKUP *ctx); + int (*init)(X509_LOOKUP *ctx); + int (*shutdown)(X509_LOOKUP *ctx); + int (*ctrl)(X509_LOOKUP *ctx,int cmd,const char *argc,long argl, + char **ret); + int (*get_by_subject)(X509_LOOKUP *ctx,int type,X509_NAME *name, + X509_OBJECT *ret); + int (*get_by_issuer_serial)(X509_LOOKUP *ctx,int type,X509_NAME *name, + ASN1_INTEGER *serial,X509_OBJECT *ret); + int (*get_by_fingerprint)(X509_LOOKUP *ctx,int type, + unsigned char *bytes,int len, + X509_OBJECT *ret); + int (*get_by_alias)(X509_LOOKUP *ctx,int type,char *str,int len, + X509_OBJECT *ret); + } X509_LOOKUP_METHOD; + +typedef struct X509_VERIFY_PARAM_ID_st X509_VERIFY_PARAM_ID; + +/* This structure hold all parameters associated with a verify operation + * by including an X509_VERIFY_PARAM structure in related structures the + * parameters used can be customized + */ + +struct X509_VERIFY_PARAM_st + { + char *name; + time_t check_time; /* Time to use */ + unsigned long inh_flags; /* Inheritance flags */ + unsigned long flags; /* Various verify flags */ + int purpose; /* purpose to check untrusted certificates */ + int trust; /* trust setting to check */ + int depth; /* Verify depth */ + STACK_OF(ASN1_OBJECT) *policies; /* Permissible policies */ + X509_VERIFY_PARAM_ID *id; /* opaque ID data */ + }; + +DEFINE_STACK_OF(X509_VERIFY_PARAM) + +typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer, + X509_STORE_CTX *ctx, X509 *x); +typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx, + X509 *x, X509 *issuer); +typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx); +typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL **crl, X509 *x); +typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl); +typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL *crl, X509 *x); +typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx); +typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx, + X509_NAME *nm); +typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(X509_STORE_CTX *ctx, + X509_NAME *nm); +typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx); + +/* This is used to hold everything. It is used for all certificate + * validation. Once we have a certificate chain, the 'verify' + * function is then called to actually check the cert chain. */ +struct x509_store_st + { + /* The following is a cache of trusted certs */ + int cache; /* if true, stash any hits */ + STACK_OF(X509_OBJECT) *objs; /* Cache of all objects */ + CRYPTO_MUTEX objs_lock; + STACK_OF(X509) *additional_untrusted; + + /* These are external lookup methods */ + STACK_OF(X509_LOOKUP) *get_cert_methods; + + X509_VERIFY_PARAM *param; + + /* Callbacks for various operations */ + X509_STORE_CTX_verify_fn verify; /* called to verify a certificate */ + X509_STORE_CTX_verify_cb verify_cb; /* error callback */ + X509_STORE_CTX_get_issuer_fn get_issuer; /* get issuers cert from ctx */ + X509_STORE_CTX_check_issued_fn check_issued; /* check issued */ + X509_STORE_CTX_check_revocation_fn check_revocation; /* Check revocation status of chain */ + X509_STORE_CTX_get_crl_fn get_crl; /* retrieve CRL */ + X509_STORE_CTX_check_crl_fn check_crl; /* Check CRL validity */ + X509_STORE_CTX_cert_crl_fn cert_crl; /* Check certificate against CRL */ + X509_STORE_CTX_lookup_certs_fn lookup_certs; + X509_STORE_CTX_lookup_crls_fn lookup_crls; + X509_STORE_CTX_cleanup_fn cleanup; + + CRYPTO_refcount_t references; + } /* X509_STORE */; + +OPENSSL_EXPORT int X509_STORE_set_depth(X509_STORE *store, int depth); + +/* This is the functions plus an instance of the local variables. */ +struct x509_lookup_st + { + int init; /* have we been started */ + int skip; /* don't use us. */ + X509_LOOKUP_METHOD *method; /* the functions */ + char *method_data; /* method data */ + + X509_STORE *store_ctx; /* who owns us */ + } /* X509_LOOKUP */; + +/* This is a used when verifying cert chains. Since the + * gathering of the cert chain can take some time (and have to be + * 'retried', this needs to be kept and passed around. */ +struct x509_store_ctx_st /* X509_STORE_CTX */ + { + X509_STORE *ctx; + + /* The following are set by the caller */ + X509 *cert; /* The cert to check */ + STACK_OF(X509) *untrusted; /* chain of X509s - untrusted - passed in */ + STACK_OF(X509_CRL) *crls; /* set of CRLs passed in */ + + X509_VERIFY_PARAM *param; + void *other_ctx; /* Other info for use with get_issuer() */ + + /* Callbacks for various operations */ + X509_STORE_CTX_verify_fn verify; /* called to verify a certificate */ + X509_STORE_CTX_verify_cb verify_cb; /* error callback */ + X509_STORE_CTX_get_issuer_fn get_issuer; /* get issuers cert from ctx */ + X509_STORE_CTX_check_issued_fn check_issued; /* check issued */ + X509_STORE_CTX_check_revocation_fn check_revocation; /* Check revocation status of chain */ + X509_STORE_CTX_get_crl_fn get_crl; /* retrieve CRL */ + X509_STORE_CTX_check_crl_fn check_crl; /* Check CRL validity */ + X509_STORE_CTX_cert_crl_fn cert_crl; /* Check certificate against CRL */ + X509_STORE_CTX_check_policy_fn check_policy; + X509_STORE_CTX_lookup_certs_fn lookup_certs; + X509_STORE_CTX_lookup_crls_fn lookup_crls; + X509_STORE_CTX_cleanup_fn cleanup; + + /* The following is built up */ + int valid; /* if 0, rebuild chain */ + int last_untrusted; /* index of last untrusted cert */ + STACK_OF(X509) *chain; /* chain of X509s - built up and trusted */ + X509_POLICY_TREE *tree; /* Valid policy tree */ + + int explicit_policy; /* Require explicit policy value */ + + /* When something goes wrong, this is why */ + int error_depth; + int error; + X509 *current_cert; + X509 *current_issuer; /* cert currently being tested as valid issuer */ + X509_CRL *current_crl; /* current CRL */ + + int current_crl_score; /* score of current CRL */ + unsigned int current_reasons; /* Reason mask */ + + X509_STORE_CTX *parent; /* For CRL path validation: parent context */ + + CRYPTO_EX_DATA ex_data; + } /* X509_STORE_CTX */; + +OPENSSL_EXPORT void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); + +#define X509_STORE_CTX_set_app_data(ctx,data) \ + X509_STORE_CTX_set_ex_data(ctx,0,data) +#define X509_STORE_CTX_get_app_data(ctx) \ + X509_STORE_CTX_get_ex_data(ctx,0) + +#define X509_L_FILE_LOAD 1 +#define X509_L_ADD_DIR 2 + +#define X509_LOOKUP_load_file(x,name,type) \ + X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL) + +#define X509_LOOKUP_add_dir(x,name,type) \ + X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL) + +#define X509_V_OK 0 +#define X509_V_ERR_UNSPECIFIED 1 + +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2 +#define X509_V_ERR_UNABLE_TO_GET_CRL 3 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4 +#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5 +#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6 +#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7 +#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8 +#define X509_V_ERR_CERT_NOT_YET_VALID 9 +#define X509_V_ERR_CERT_HAS_EXPIRED 10 +#define X509_V_ERR_CRL_NOT_YET_VALID 11 +#define X509_V_ERR_CRL_HAS_EXPIRED 12 +#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13 +#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14 +#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15 +#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16 +#define X509_V_ERR_OUT_OF_MEM 17 +#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18 +#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19 +#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20 +#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21 +#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22 +#define X509_V_ERR_CERT_REVOKED 23 +#define X509_V_ERR_INVALID_CA 24 +#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25 +#define X509_V_ERR_INVALID_PURPOSE 26 +#define X509_V_ERR_CERT_UNTRUSTED 27 +#define X509_V_ERR_CERT_REJECTED 28 +/* These are 'informational' when looking for issuer cert */ +#define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29 +#define X509_V_ERR_AKID_SKID_MISMATCH 30 +#define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31 +#define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32 + +#define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33 +#define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34 +#define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35 +#define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36 +#define X509_V_ERR_INVALID_NON_CA 37 +#define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38 +#define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39 +#define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40 + +#define X509_V_ERR_INVALID_EXTENSION 41 +#define X509_V_ERR_INVALID_POLICY_EXTENSION 42 +#define X509_V_ERR_NO_EXPLICIT_POLICY 43 +#define X509_V_ERR_DIFFERENT_CRL_SCOPE 44 +#define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45 + +#define X509_V_ERR_UNNESTED_RESOURCE 46 + +#define X509_V_ERR_PERMITTED_VIOLATION 47 +#define X509_V_ERR_EXCLUDED_VIOLATION 48 +#define X509_V_ERR_SUBTREE_MINMAX 49 +#define X509_V_ERR_APPLICATION_VERIFICATION 50 +#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 +#define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 +#define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 +#define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54 + +/* Suite B mode algorithm violation */ +#define X509_V_ERR_SUITE_B_INVALID_VERSION 56 +#define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57 +#define X509_V_ERR_SUITE_B_INVALID_CURVE 58 +#define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59 +#define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60 +#define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61 + +/* Host, email and IP check errors */ +#define X509_V_ERR_HOSTNAME_MISMATCH 62 +#define X509_V_ERR_EMAIL_MISMATCH 63 +#define X509_V_ERR_IP_ADDRESS_MISMATCH 64 + +/* Caller error */ +#define X509_V_ERR_INVALID_CALL 65 +/* Issuer lookup error */ +#define X509_V_ERR_STORE_LOOKUP 66 + +#define X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS 67 + +/* Certificate verify flags */ + +/* Send issuer+subject checks to verify_cb */ +#define X509_V_FLAG_CB_ISSUER_CHECK 0x1 +/* Use check time instead of current time */ +#define X509_V_FLAG_USE_CHECK_TIME 0x2 +/* Lookup CRLs */ +#define X509_V_FLAG_CRL_CHECK 0x4 +/* Lookup CRLs for whole chain */ +#define X509_V_FLAG_CRL_CHECK_ALL 0x8 +/* Ignore unhandled critical extensions */ +#define X509_V_FLAG_IGNORE_CRITICAL 0x10 +/* Does nothing as its functionality has been enabled by default. */ +#define X509_V_FLAG_X509_STRICT 0x00 +/* Enable proxy certificate validation */ +#define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 +/* Enable policy checking */ +#define X509_V_FLAG_POLICY_CHECK 0x80 +/* Policy variable require-explicit-policy */ +#define X509_V_FLAG_EXPLICIT_POLICY 0x100 +/* Policy variable inhibit-any-policy */ +#define X509_V_FLAG_INHIBIT_ANY 0x200 +/* Policy variable inhibit-policy-mapping */ +#define X509_V_FLAG_INHIBIT_MAP 0x400 +/* Notify callback that policy is OK */ +#define X509_V_FLAG_NOTIFY_POLICY 0x800 +/* Extended CRL features such as indirect CRLs, alternate CRL signing keys */ +#define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000 +/* Delta CRL support */ +#define X509_V_FLAG_USE_DELTAS 0x2000 +/* Check selfsigned CA signature */ +#define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000 +/* Use trusted store first */ +#define X509_V_FLAG_TRUSTED_FIRST 0x8000 +/* Suite B 128 bit only mode: not normally used */ +#define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000 +/* Suite B 192 bit only mode */ +#define X509_V_FLAG_SUITEB_192_LOS 0x20000 +/* Suite B 128 bit mode allowing 192 bit algorithms */ +#define X509_V_FLAG_SUITEB_128_LOS 0x30000 + +/* Allow partial chains if at least one certificate is in trusted store */ +#define X509_V_FLAG_PARTIAL_CHAIN 0x80000 + +/* If the initial chain is not trusted, do not attempt to build an alternative + * chain. Alternate chain checking was introduced in 1.0.2b. Setting this flag + * will force the behaviour to match that of previous versions. */ +#define X509_V_FLAG_NO_ALT_CHAINS 0x100000 + +#define X509_VP_FLAG_DEFAULT 0x1 +#define X509_VP_FLAG_OVERWRITE 0x2 +#define X509_VP_FLAG_RESET_FLAGS 0x4 +#define X509_VP_FLAG_LOCKED 0x8 +#define X509_VP_FLAG_ONCE 0x10 + +/* Internal use: mask of policy related options */ +#define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \ + | X509_V_FLAG_EXPLICIT_POLICY \ + | X509_V_FLAG_INHIBIT_ANY \ + | X509_V_FLAG_INHIBIT_MAP) + +OPENSSL_EXPORT int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, int type, + X509_NAME *name); +OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,int type,X509_NAME *name); +OPENSSL_EXPORT X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h, X509_OBJECT *x); +OPENSSL_EXPORT int X509_OBJECT_up_ref_count(X509_OBJECT *a); +OPENSSL_EXPORT void X509_OBJECT_free_contents(X509_OBJECT *a); +OPENSSL_EXPORT int X509_OBJECT_get_type(const X509_OBJECT *a); +OPENSSL_EXPORT X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a); +OPENSSL_EXPORT X509_STORE *X509_STORE_new(void ); +OPENSSL_EXPORT int X509_STORE_up_ref(X509_STORE *store); +OPENSSL_EXPORT void X509_STORE_free(X509_STORE *v); + +OPENSSL_EXPORT STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(X509_STORE *st); +OPENSSL_EXPORT STACK_OF(X509)* X509_STORE_get1_certs(X509_STORE_CTX *st, X509_NAME *nm); +OPENSSL_EXPORT STACK_OF(X509_CRL)* X509_STORE_get1_crls(X509_STORE_CTX *st, X509_NAME *nm); +OPENSSL_EXPORT int X509_STORE_set_flags(X509_STORE *ctx, unsigned long flags); +OPENSSL_EXPORT int X509_STORE_set_purpose(X509_STORE *ctx, int purpose); +OPENSSL_EXPORT int X509_STORE_set_trust(X509_STORE *ctx, int trust); +OPENSSL_EXPORT int X509_STORE_set1_param(X509_STORE *ctx, X509_VERIFY_PARAM *pm); +OPENSSL_EXPORT X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx); +/* X509_STORE_set0_additional_untrusted sets a stack of additional, untrusted + * certificates that are available for chain building. This function does not + * take ownership of the stack. */ +OPENSSL_EXPORT void X509_STORE_set0_additional_untrusted( + X509_STORE *ctx, STACK_OF(X509) *untrusted); + +OPENSSL_EXPORT void X509_STORE_set_verify(X509_STORE *ctx, + X509_STORE_CTX_verify_fn verify); +#define X509_STORE_set_verify_func(ctx, func) \ + X509_STORE_set_verify((ctx), (func)) +OPENSSL_EXPORT void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, + X509_STORE_CTX_verify_fn verify); +OPENSSL_EXPORT X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_verify_cb( + X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb); +#define X509_STORE_set_verify_cb_func(ctx, func) \ + X509_STORE_set_verify_cb((ctx), (func)) +OPENSSL_EXPORT X509_STORE_CTX_verify_cb +X509_STORE_get_verify_cb(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_get_issuer( + X509_STORE *ctx, X509_STORE_CTX_get_issuer_fn get_issuer); +OPENSSL_EXPORT X509_STORE_CTX_get_issuer_fn +X509_STORE_get_get_issuer(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_issued( + X509_STORE *ctx, X509_STORE_CTX_check_issued_fn check_issued); +OPENSSL_EXPORT X509_STORE_CTX_check_issued_fn +X509_STORE_get_check_issued(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_revocation( + X509_STORE *ctx, X509_STORE_CTX_check_revocation_fn check_revocation); +OPENSSL_EXPORT X509_STORE_CTX_check_revocation_fn +X509_STORE_get_check_revocation(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_get_crl(X509_STORE *ctx, + X509_STORE_CTX_get_crl_fn get_crl); +OPENSSL_EXPORT X509_STORE_CTX_get_crl_fn +X509_STORE_get_get_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_crl( + X509_STORE *ctx, X509_STORE_CTX_check_crl_fn check_crl); +OPENSSL_EXPORT X509_STORE_CTX_check_crl_fn +X509_STORE_get_check_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_cert_crl( + X509_STORE *ctx, X509_STORE_CTX_cert_crl_fn cert_crl); +OPENSSL_EXPORT X509_STORE_CTX_cert_crl_fn +X509_STORE_get_cert_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_lookup_certs( + X509_STORE *ctx, X509_STORE_CTX_lookup_certs_fn lookup_certs); +OPENSSL_EXPORT X509_STORE_CTX_lookup_certs_fn +X509_STORE_get_lookup_certs(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_lookup_crls( + X509_STORE *ctx, X509_STORE_CTX_lookup_crls_fn lookup_crls); +#define X509_STORE_set_lookup_crls_cb(ctx, func) \ + X509_STORE_set_lookup_crls((ctx), (func)) +OPENSSL_EXPORT X509_STORE_CTX_lookup_crls_fn +X509_STORE_get_lookup_crls(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_cleanup(X509_STORE *ctx, + X509_STORE_CTX_cleanup_fn cleanup); +OPENSSL_EXPORT X509_STORE_CTX_cleanup_fn +X509_STORE_get_cleanup(X509_STORE *ctx); + + +OPENSSL_EXPORT X509_STORE_CTX *X509_STORE_CTX_new(void); + +OPENSSL_EXPORT int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); + +OPENSSL_EXPORT void X509_STORE_CTX_zero(X509_STORE_CTX *ctx); +OPENSSL_EXPORT void X509_STORE_CTX_free(X509_STORE_CTX *ctx); +OPENSSL_EXPORT int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store, + X509 *x509, STACK_OF(X509) *chain); +OPENSSL_EXPORT void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); +OPENSSL_EXPORT void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); + +OPENSSL_EXPORT X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); + +OPENSSL_EXPORT X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); + +OPENSSL_EXPORT X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); +OPENSSL_EXPORT X509_LOOKUP_METHOD *X509_LOOKUP_file(void); + +OPENSSL_EXPORT int X509_STORE_add_cert(X509_STORE *ctx, X509 *x); +OPENSSL_EXPORT int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); + +OPENSSL_EXPORT int X509_STORE_get_by_subject(X509_STORE_CTX *vs,int type,X509_NAME *name, + X509_OBJECT *ret); + +OPENSSL_EXPORT int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, + long argl, char **ret); + +#ifndef OPENSSL_NO_STDIO +OPENSSL_EXPORT int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); +OPENSSL_EXPORT int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); +OPENSSL_EXPORT int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); +#endif + + +OPENSSL_EXPORT X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method); +OPENSSL_EXPORT void X509_LOOKUP_free(X509_LOOKUP *ctx); +OPENSSL_EXPORT int X509_LOOKUP_init(X509_LOOKUP *ctx); +OPENSSL_EXPORT int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, int type, X509_NAME *name, + X509_OBJECT *ret); +OPENSSL_EXPORT int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, int type, X509_NAME *name, + ASN1_INTEGER *serial, X509_OBJECT *ret); +OPENSSL_EXPORT int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, int type, + unsigned char *bytes, int len, X509_OBJECT *ret); +OPENSSL_EXPORT int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, int type, char *str, + int len, X509_OBJECT *ret); +OPENSSL_EXPORT int X509_LOOKUP_shutdown(X509_LOOKUP *ctx); + +#ifndef OPENSSL_NO_STDIO +OPENSSL_EXPORT int X509_STORE_load_locations (X509_STORE *ctx, + const char *file, const char *dir); +OPENSSL_EXPORT int X509_STORE_set_default_paths(X509_STORE *ctx); +#endif + +OPENSSL_EXPORT int X509_STORE_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func); +OPENSSL_EXPORT int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,int idx,void *data); +OPENSSL_EXPORT void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx); +OPENSSL_EXPORT int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); +OPENSSL_EXPORT void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); +OPENSSL_EXPORT int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx); +OPENSSL_EXPORT STACK_OF(X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx); +OPENSSL_EXPORT STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx); +OPENSSL_EXPORT void X509_STORE_CTX_set_cert(X509_STORE_CTX *c,X509 *x); +OPENSSL_EXPORT void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,STACK_OF(X509) *sk); +OPENSSL_EXPORT STACK_OF(X509) * + X509_STORE_CTX_get0_untrusted(X509_STORE_CTX *ctx); +OPENSSL_EXPORT void X509_STORE_CTX_set0_crls(X509_STORE_CTX *c,STACK_OF(X509_CRL) *sk); +OPENSSL_EXPORT int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose); +OPENSSL_EXPORT int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust); +OPENSSL_EXPORT int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, + int purpose, int trust); +OPENSSL_EXPORT void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); +OPENSSL_EXPORT void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, + time_t t); +OPENSSL_EXPORT void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, + int (*verify_cb)(int, X509_STORE_CTX *)); + +OPENSSL_EXPORT X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); +OPENSSL_EXPORT int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); + +OPENSSL_EXPORT X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); +OPENSSL_EXPORT void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); +OPENSSL_EXPORT int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name); + +/* X509_VERIFY_PARAM functions */ + +OPENSSL_EXPORT X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void); +OPENSSL_EXPORT void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param); +OPENSSL_EXPORT int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to, + const X509_VERIFY_PARAM *from); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags); +OPENSSL_EXPORT int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param, + unsigned long flags); +OPENSSL_EXPORT unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust); +OPENSSL_EXPORT void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); +OPENSSL_EXPORT void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t); +OPENSSL_EXPORT int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, + ASN1_OBJECT *policy); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, + STACK_OF(ASN1_OBJECT) *policies); + +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, + const char *name, size_t namelen); +OPENSSL_EXPORT int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param, + const char *name, + size_t namelen); +OPENSSL_EXPORT void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param, + unsigned int flags); +OPENSSL_EXPORT char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, + const char *email, size_t emaillen); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, + const unsigned char *ip, size_t iplen); +OPENSSL_EXPORT int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc); + +OPENSSL_EXPORT int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); +OPENSSL_EXPORT const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param); + +OPENSSL_EXPORT int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param); +OPENSSL_EXPORT int X509_VERIFY_PARAM_get_count(void); +OPENSSL_EXPORT const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id); +OPENSSL_EXPORT const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name); +OPENSSL_EXPORT void X509_VERIFY_PARAM_table_cleanup(void); + +OPENSSL_EXPORT int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy, + STACK_OF(X509) *certs, + STACK_OF(ASN1_OBJECT) *policy_oids, + unsigned int flags); + +OPENSSL_EXPORT void X509_policy_tree_free(X509_POLICY_TREE *tree); + +OPENSSL_EXPORT int X509_policy_tree_level_count(const X509_POLICY_TREE *tree); +OPENSSL_EXPORT X509_POLICY_LEVEL * + X509_policy_tree_get0_level(const X509_POLICY_TREE *tree, int i); + +OPENSSL_EXPORT STACK_OF(X509_POLICY_NODE) * + X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree); + +OPENSSL_EXPORT STACK_OF(X509_POLICY_NODE) * + X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree); + +OPENSSL_EXPORT int X509_policy_level_node_count(X509_POLICY_LEVEL *level); + +OPENSSL_EXPORT X509_POLICY_NODE *X509_policy_level_get0_node(X509_POLICY_LEVEL *level, int i); + +OPENSSL_EXPORT const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node); + +OPENSSL_EXPORT STACK_OF(POLICYQUALINFO) * + X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node); +OPENSSL_EXPORT const X509_POLICY_NODE * + X509_policy_node_get0_parent(const X509_POLICY_NODE *node); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/x509_vfy.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.grpc_back similarity index 81% rename from Pods/BoringSSL-GRPC/include/openssl/x509_vfy.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.grpc_back index 208a3807f..f26233497 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/x509_vfy.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509_vfy.h.grpc_back @@ -158,6 +158,25 @@ struct X509_VERIFY_PARAM_st DEFINE_STACK_OF(X509_VERIFY_PARAM) +typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *); +typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer, + X509_STORE_CTX *ctx, X509 *x); +typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx, + X509 *x, X509 *issuer); +typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx); +typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL **crl, X509 *x); +typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl); +typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx, + X509_CRL *crl, X509 *x); +typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx); +typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx, + X509_NAME *nm); +typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(X509_STORE_CTX *ctx, + X509_NAME *nm); +typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx); + /* This is used to hold everything. It is used for all certificate * validation. Once we have a certificate chain, the 'verify' * function is then called to actually check the cert chain. */ @@ -175,26 +194,23 @@ struct x509_store_st X509_VERIFY_PARAM *param; /* Callbacks for various operations */ - int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ - int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ - int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ - int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ - int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ - int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ - int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ - int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ - STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm); - STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm); - int (*cleanup)(X509_STORE_CTX *ctx); + X509_STORE_CTX_verify_fn verify; /* called to verify a certificate */ + X509_STORE_CTX_verify_cb verify_cb; /* error callback */ + X509_STORE_CTX_get_issuer_fn get_issuer; /* get issuers cert from ctx */ + X509_STORE_CTX_check_issued_fn check_issued; /* check issued */ + X509_STORE_CTX_check_revocation_fn check_revocation; /* Check revocation status of chain */ + X509_STORE_CTX_get_crl_fn get_crl; /* retrieve CRL */ + X509_STORE_CTX_check_crl_fn check_crl; /* Check CRL validity */ + X509_STORE_CTX_cert_crl_fn cert_crl; /* Check certificate against CRL */ + X509_STORE_CTX_lookup_certs_fn lookup_certs; + X509_STORE_CTX_lookup_crls_fn lookup_crls; + X509_STORE_CTX_cleanup_fn cleanup; CRYPTO_refcount_t references; } /* X509_STORE */; OPENSSL_EXPORT int X509_STORE_set_depth(X509_STORE *store, int depth); -#define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func)) -#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) - /* This is the functions plus an instance of the local variables. */ struct x509_lookup_st { @@ -222,18 +238,18 @@ struct x509_store_ctx_st /* X509_STORE_CTX */ void *other_ctx; /* Other info for use with get_issuer() */ /* Callbacks for various operations */ - int (*verify)(X509_STORE_CTX *ctx); /* called to verify a certificate */ - int (*verify_cb)(int ok,X509_STORE_CTX *ctx); /* error callback */ - int (*get_issuer)(X509 **issuer, X509_STORE_CTX *ctx, X509 *x); /* get issuers cert from ctx */ - int (*check_issued)(X509_STORE_CTX *ctx, X509 *x, X509 *issuer); /* check issued */ - int (*check_revocation)(X509_STORE_CTX *ctx); /* Check revocation status of chain */ - int (*get_crl)(X509_STORE_CTX *ctx, X509_CRL **crl, X509 *x); /* retrieve CRL */ - int (*check_crl)(X509_STORE_CTX *ctx, X509_CRL *crl); /* Check CRL validity */ - int (*cert_crl)(X509_STORE_CTX *ctx, X509_CRL *crl, X509 *x); /* Check certificate against CRL */ - int (*check_policy)(X509_STORE_CTX *ctx); - STACK_OF(X509) * (*lookup_certs)(X509_STORE_CTX *ctx, X509_NAME *nm); - STACK_OF(X509_CRL) * (*lookup_crls)(X509_STORE_CTX *ctx, X509_NAME *nm); - int (*cleanup)(X509_STORE_CTX *ctx); + X509_STORE_CTX_verify_fn verify; /* called to verify a certificate */ + X509_STORE_CTX_verify_cb verify_cb; /* error callback */ + X509_STORE_CTX_get_issuer_fn get_issuer; /* get issuers cert from ctx */ + X509_STORE_CTX_check_issued_fn check_issued; /* check issued */ + X509_STORE_CTX_check_revocation_fn check_revocation; /* Check revocation status of chain */ + X509_STORE_CTX_get_crl_fn get_crl; /* retrieve CRL */ + X509_STORE_CTX_check_crl_fn check_crl; /* Check CRL validity */ + X509_STORE_CTX_cert_crl_fn cert_crl; /* Check certificate against CRL */ + X509_STORE_CTX_check_policy_fn check_policy; + X509_STORE_CTX_lookup_certs_fn lookup_certs; + X509_STORE_CTX_lookup_crls_fn lookup_crls; + X509_STORE_CTX_cleanup_fn cleanup; /* The following is built up */ int valid; /* if 0, rebuild chain */ @@ -354,6 +370,8 @@ OPENSSL_EXPORT void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); /* Issuer lookup error */ #define X509_V_ERR_STORE_LOOKUP 66 +#define X509_V_ERR_NAME_CONSTRAINTS_WITHOUT_SANS 67 + /* Certificate verify flags */ /* Send issuer+subject checks to verify_cb */ @@ -366,8 +384,8 @@ OPENSSL_EXPORT void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); #define X509_V_FLAG_CRL_CHECK_ALL 0x8 /* Ignore unhandled critical extensions */ #define X509_V_FLAG_IGNORE_CRITICAL 0x10 -/* Disable workarounds for broken certificates */ -#define X509_V_FLAG_X509_STRICT 0x20 +/* Does nothing as its functionality has been enabled by default. */ +#define X509_V_FLAG_X509_STRICT 0x00 /* Enable proxy certificate validation */ #define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40 /* Enable policy checking */ @@ -441,11 +459,58 @@ OPENSSL_EXPORT X509_VERIFY_PARAM *X509_STORE_get0_param(X509_STORE *ctx); OPENSSL_EXPORT void X509_STORE_set0_additional_untrusted( X509_STORE *ctx, STACK_OF(X509) *untrusted); -OPENSSL_EXPORT void X509_STORE_set_verify_cb(X509_STORE *ctx, - int (*verify_cb)(int, X509_STORE_CTX *)); +OPENSSL_EXPORT void X509_STORE_set_verify(X509_STORE *ctx, + X509_STORE_CTX_verify_fn verify); +#define X509_STORE_set_verify_func(ctx, func) \ + X509_STORE_set_verify((ctx), (func)) +OPENSSL_EXPORT void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, + X509_STORE_CTX_verify_fn verify); +OPENSSL_EXPORT X509_STORE_CTX_verify_fn X509_STORE_get_verify(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_verify_cb( + X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb); +#define X509_STORE_set_verify_cb_func(ctx, func) \ + X509_STORE_set_verify_cb((ctx), (func)) +OPENSSL_EXPORT X509_STORE_CTX_verify_cb +X509_STORE_get_verify_cb(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_get_issuer( + X509_STORE *ctx, X509_STORE_CTX_get_issuer_fn get_issuer); +OPENSSL_EXPORT X509_STORE_CTX_get_issuer_fn +X509_STORE_get_get_issuer(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_issued( + X509_STORE *ctx, X509_STORE_CTX_check_issued_fn check_issued); +OPENSSL_EXPORT X509_STORE_CTX_check_issued_fn +X509_STORE_get_check_issued(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_revocation( + X509_STORE *ctx, X509_STORE_CTX_check_revocation_fn check_revocation); +OPENSSL_EXPORT X509_STORE_CTX_check_revocation_fn +X509_STORE_get_check_revocation(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_get_crl(X509_STORE *ctx, + X509_STORE_CTX_get_crl_fn get_crl); +OPENSSL_EXPORT X509_STORE_CTX_get_crl_fn +X509_STORE_get_get_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_check_crl( + X509_STORE *ctx, X509_STORE_CTX_check_crl_fn check_crl); +OPENSSL_EXPORT X509_STORE_CTX_check_crl_fn +X509_STORE_get_check_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_cert_crl( + X509_STORE *ctx, X509_STORE_CTX_cert_crl_fn cert_crl); +OPENSSL_EXPORT X509_STORE_CTX_cert_crl_fn +X509_STORE_get_cert_crl(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_lookup_certs( + X509_STORE *ctx, X509_STORE_CTX_lookup_certs_fn lookup_certs); +OPENSSL_EXPORT X509_STORE_CTX_lookup_certs_fn +X509_STORE_get_lookup_certs(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_lookup_crls( + X509_STORE *ctx, X509_STORE_CTX_lookup_crls_fn lookup_crls); +#define X509_STORE_set_lookup_crls_cb(ctx, func) \ + X509_STORE_set_lookup_crls((ctx), (func)) +OPENSSL_EXPORT X509_STORE_CTX_lookup_crls_fn +X509_STORE_get_lookup_crls(X509_STORE *ctx); +OPENSSL_EXPORT void X509_STORE_set_cleanup(X509_STORE *ctx, + X509_STORE_CTX_cleanup_fn cleanup); +OPENSSL_EXPORT X509_STORE_CTX_cleanup_fn +X509_STORE_get_cleanup(X509_STORE *ctx); -OPENSSL_EXPORT void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx, - STACK_OF(X509_CRL)* (*cb)(X509_STORE_CTX *ctx, X509_NAME *nm)); OPENSSL_EXPORT X509_STORE_CTX *X509_STORE_CTX_new(void); @@ -459,6 +524,7 @@ OPENSSL_EXPORT void X509_STORE_CTX_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X OPENSSL_EXPORT void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx); OPENSSL_EXPORT X509_STORE *X509_STORE_CTX_get0_store(X509_STORE_CTX *ctx); +OPENSSL_EXPORT X509 *X509_STORE_CTX_get0_cert(X509_STORE_CTX *ctx); OPENSSL_EXPORT X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m); diff --git a/Pods/BoringSSL-GRPC/include/openssl/x509v3.h b/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h similarity index 97% rename from Pods/BoringSSL-GRPC/include/openssl/x509v3.h rename to Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h index 639299553..cb67972c9 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/x509v3.h +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h @@ -57,8 +57,8 @@ #include #include -#include #include +#include #ifdef __cplusplus extern "C" { @@ -612,7 +612,11 @@ OPENSSL_EXPORT GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); OPENSSL_EXPORT void X509V3_conf_free(CONF_VALUE *val); +// X509V3_EXT_conf_nid contains the only exposed instance of an LHASH in our +// public headers. The |conf| pointer must be NULL but cryptography.io wraps +// this function so we cannot, yet, replace the type with a dummy struct. OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid, char *value); + OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value); OPENSSL_EXPORT int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk); @@ -620,9 +624,6 @@ OPENSSL_EXPORT int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *secti OPENSSL_EXPORT int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); OPENSSL_EXPORT int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); -OPENSSL_EXPORT int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_CRL *crl); - OPENSSL_EXPORT int X509V3_add_value_bool_nf(char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist); OPENSSL_EXPORT int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); @@ -665,10 +666,6 @@ OPENSSL_EXPORT int X509V3_EXT_free(int nid, void *ext_data); OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); OPENSSL_EXPORT int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); -char *hex_to_string(const unsigned char *buffer, long len); -unsigned char *string_to_hex(const char *str, long *len); -int name_cmp(const char *name, const char *cmp); - OPENSSL_EXPORT void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml); OPENSSL_EXPORT int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); @@ -682,6 +679,11 @@ OPENSSL_EXPORT int X509_supported_extension(X509_EXTENSION *ex); OPENSSL_EXPORT int X509_PURPOSE_set(int *p, int purpose); OPENSSL_EXPORT int X509_check_issued(X509 *issuer, X509 *subject); OPENSSL_EXPORT int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); + +OPENSSL_EXPORT uint32_t X509_get_extension_flags(X509 *x); +OPENSSL_EXPORT uint32_t X509_get_key_usage(X509 *x); +OPENSSL_EXPORT uint32_t X509_get_extended_key_usage(X509 *x); + OPENSSL_EXPORT int X509_PURPOSE_get_count(void); OPENSSL_EXPORT X509_PURPOSE * X509_PURPOSE_get0(int idx); OPENSSL_EXPORT int X509_PURPOSE_get_by_sname(char *sname); @@ -701,8 +703,8 @@ OPENSSL_EXPORT void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); /* Flags for X509_check_* functions */ -/* Always check subject name for host match even if subject alt names present */ -#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1 +/* Deprecated: this flag does nothing */ +#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0 /* Disable wildcard matching for dnsName fields and common name. */ #define X509_CHECK_FLAG_NO_WILDCARDS 0x2 /* Wildcards must not match a partial label. */ @@ -711,6 +713,8 @@ OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); #define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8 /* Constraint verifier subdomain patterns to match a single labels. */ #define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10 +/* Skip the subject common name fallback if subjectAltNames is missing. */ +#define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20 /* * Match reference identifiers starting with "." to any sub-domain. * This is a non-public flag, turned on implicitly when the subject @@ -746,16 +750,16 @@ DEFINE_STACK_OF(X509_POLICY_NODE) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN -BORINGSSL_MAKE_DELETER(AUTHORITY_INFO_ACCESS, AUTHORITY_INFO_ACCESS_free) +BORINGSSL_MAKE_DELETER(ACCESS_DESCRIPTION, ACCESS_DESCRIPTION_free) BORINGSSL_MAKE_DELETER(AUTHORITY_KEYID, AUTHORITY_KEYID_free) BORINGSSL_MAKE_DELETER(BASIC_CONSTRAINTS, BASIC_CONSTRAINTS_free) BORINGSSL_MAKE_DELETER(DIST_POINT, DIST_POINT_free) BORINGSSL_MAKE_DELETER(GENERAL_NAME, GENERAL_NAME_free) BORINGSSL_MAKE_DELETER(POLICYINFO, POLICYINFO_free) -} // namespace bssl +BSSL_NAMESPACE_END } /* extern C++ */ #endif diff --git a/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.back b/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.back new file mode 100644 index 000000000..b5db7157e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.back @@ -0,0 +1,831 @@ +/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL + * project 1999. */ +/* ==================================================================== + * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * licensing@OpenSSL.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). */ + +#ifndef HEADER_X509V3_H +#define HEADER_X509V3_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/* Legacy X.509 library. + * + * This header is part of OpenSSL's X.509 implementation. It is retained for + * compatibility but otherwise underdocumented and not actively maintained. In + * the future, a replacement library will be available. Meanwhile, minimize + * dependencies on this header where possible. */ + + +/* Forward reference */ +struct v3_ext_method; +struct v3_ext_ctx; + +/* Useful typedefs */ + +typedef void * (*X509V3_EXT_NEW)(void); +typedef void (*X509V3_EXT_FREE)(void *); +typedef void * (*X509V3_EXT_D2I)(void *, const unsigned char ** , long); +typedef int (*X509V3_EXT_I2D)(void *, unsigned char **); +typedef STACK_OF(CONF_VALUE) * + (*X509V3_EXT_I2V)(const struct v3_ext_method *method, void *ext, + STACK_OF(CONF_VALUE) *extlist); +typedef void * (*X509V3_EXT_V2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, + STACK_OF(CONF_VALUE) *values); +typedef char * (*X509V3_EXT_I2S)(const struct v3_ext_method *method, void *ext); +typedef void * (*X509V3_EXT_S2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, const char *str); +typedef int (*X509V3_EXT_I2R)(const struct v3_ext_method *method, void *ext, + BIO *out, int indent); +typedef void * (*X509V3_EXT_R2I)(const struct v3_ext_method *method, + struct v3_ext_ctx *ctx, const char *str); + +/* V3 extension structure */ + +struct v3_ext_method { +int ext_nid; +int ext_flags; +/* If this is set the following four fields are ignored */ +ASN1_ITEM_EXP *it; +/* Old style ASN1 calls */ +X509V3_EXT_NEW ext_new; +X509V3_EXT_FREE ext_free; +X509V3_EXT_D2I d2i; +X509V3_EXT_I2D i2d; + +/* The following pair is used for string extensions */ +X509V3_EXT_I2S i2s; +X509V3_EXT_S2I s2i; + +/* The following pair is used for multi-valued extensions */ +X509V3_EXT_I2V i2v; +X509V3_EXT_V2I v2i; + +/* The following are used for raw extensions */ +X509V3_EXT_I2R i2r; +X509V3_EXT_R2I r2i; + +void *usr_data; /* Any extension specific data */ +}; + +typedef struct X509V3_CONF_METHOD_st { +char * (*get_string)(void *db, char *section, char *value); +STACK_OF(CONF_VALUE) * (*get_section)(void *db, char *section); +void (*free_string)(void *db, char * string); +void (*free_section)(void *db, STACK_OF(CONF_VALUE) *section); +} X509V3_CONF_METHOD; + +/* Context specific info */ +struct v3_ext_ctx { +#define CTX_TEST 0x1 +int flags; +X509 *issuer_cert; +X509 *subject_cert; +X509_REQ *subject_req; +X509_CRL *crl; +const X509V3_CONF_METHOD *db_meth; +void *db; +/* Maybe more here */ +}; + +typedef struct v3_ext_method X509V3_EXT_METHOD; + +DEFINE_STACK_OF(X509V3_EXT_METHOD) + +/* ext_flags values */ +#define X509V3_EXT_DYNAMIC 0x1 +#define X509V3_EXT_CTX_DEP 0x2 +#define X509V3_EXT_MULTILINE 0x4 + +typedef BIT_STRING_BITNAME ENUMERATED_NAMES; + +struct BASIC_CONSTRAINTS_st { +int ca; +ASN1_INTEGER *pathlen; +}; + + +typedef struct PKEY_USAGE_PERIOD_st { +ASN1_GENERALIZEDTIME *notBefore; +ASN1_GENERALIZEDTIME *notAfter; +} PKEY_USAGE_PERIOD; + +typedef struct otherName_st { +ASN1_OBJECT *type_id; +ASN1_TYPE *value; +} OTHERNAME; + +typedef struct EDIPartyName_st { + ASN1_STRING *nameAssigner; + ASN1_STRING *partyName; +} EDIPARTYNAME; + +typedef struct GENERAL_NAME_st { + +#define GEN_OTHERNAME 0 +#define GEN_EMAIL 1 +#define GEN_DNS 2 +#define GEN_X400 3 +#define GEN_DIRNAME 4 +#define GEN_EDIPARTY 5 +#define GEN_URI 6 +#define GEN_IPADD 7 +#define GEN_RID 8 + +int type; +union { + char *ptr; + OTHERNAME *otherName; /* otherName */ + ASN1_IA5STRING *rfc822Name; + ASN1_IA5STRING *dNSName; + ASN1_TYPE *x400Address; + X509_NAME *directoryName; + EDIPARTYNAME *ediPartyName; + ASN1_IA5STRING *uniformResourceIdentifier; + ASN1_OCTET_STRING *iPAddress; + ASN1_OBJECT *registeredID; + + /* Old names */ + ASN1_OCTET_STRING *ip; /* iPAddress */ + X509_NAME *dirn; /* dirn */ + ASN1_IA5STRING *ia5;/* rfc822Name, dNSName, uniformResourceIdentifier */ + ASN1_OBJECT *rid; /* registeredID */ + ASN1_TYPE *other; /* x400Address */ +} d; +} GENERAL_NAME; + +DEFINE_STACK_OF(GENERAL_NAME) +DECLARE_ASN1_SET_OF(GENERAL_NAME) + +typedef STACK_OF(GENERAL_NAME) GENERAL_NAMES; + +DEFINE_STACK_OF(GENERAL_NAMES) + +typedef struct ACCESS_DESCRIPTION_st { + ASN1_OBJECT *method; + GENERAL_NAME *location; +} ACCESS_DESCRIPTION; + +DEFINE_STACK_OF(ACCESS_DESCRIPTION) +DECLARE_ASN1_SET_OF(ACCESS_DESCRIPTION) + +typedef STACK_OF(ACCESS_DESCRIPTION) AUTHORITY_INFO_ACCESS; + +typedef STACK_OF(ASN1_OBJECT) EXTENDED_KEY_USAGE; + +typedef struct DIST_POINT_NAME_st { +int type; +union { + GENERAL_NAMES *fullname; + STACK_OF(X509_NAME_ENTRY) *relativename; +} name; +/* If relativename then this contains the full distribution point name */ +X509_NAME *dpname; +} DIST_POINT_NAME; +/* All existing reasons */ +#define CRLDP_ALL_REASONS 0x807f + +#define CRL_REASON_NONE (-1) +#define CRL_REASON_UNSPECIFIED 0 +#define CRL_REASON_KEY_COMPROMISE 1 +#define CRL_REASON_CA_COMPROMISE 2 +#define CRL_REASON_AFFILIATION_CHANGED 3 +#define CRL_REASON_SUPERSEDED 4 +#define CRL_REASON_CESSATION_OF_OPERATION 5 +#define CRL_REASON_CERTIFICATE_HOLD 6 +#define CRL_REASON_REMOVE_FROM_CRL 8 +#define CRL_REASON_PRIVILEGE_WITHDRAWN 9 +#define CRL_REASON_AA_COMPROMISE 10 + +struct DIST_POINT_st { +DIST_POINT_NAME *distpoint; +ASN1_BIT_STRING *reasons; +GENERAL_NAMES *CRLissuer; +int dp_reasons; +}; + +typedef STACK_OF(DIST_POINT) CRL_DIST_POINTS; + +DEFINE_STACK_OF(DIST_POINT) +DECLARE_ASN1_SET_OF(DIST_POINT) + +struct AUTHORITY_KEYID_st { +ASN1_OCTET_STRING *keyid; +GENERAL_NAMES *issuer; +ASN1_INTEGER *serial; +}; + +/* Strong extranet structures */ + +typedef struct SXNET_ID_st { + ASN1_INTEGER *zone; + ASN1_OCTET_STRING *user; +} SXNETID; + +DEFINE_STACK_OF(SXNETID) +DECLARE_ASN1_SET_OF(SXNETID) + +typedef struct SXNET_st { + ASN1_INTEGER *version; + STACK_OF(SXNETID) *ids; +} SXNET; + +typedef struct NOTICEREF_st { + ASN1_STRING *organization; + STACK_OF(ASN1_INTEGER) *noticenos; +} NOTICEREF; + +typedef struct USERNOTICE_st { + NOTICEREF *noticeref; + ASN1_STRING *exptext; +} USERNOTICE; + +typedef struct POLICYQUALINFO_st { + ASN1_OBJECT *pqualid; + union { + ASN1_IA5STRING *cpsuri; + USERNOTICE *usernotice; + ASN1_TYPE *other; + } d; +} POLICYQUALINFO; + +DEFINE_STACK_OF(POLICYQUALINFO) +DECLARE_ASN1_SET_OF(POLICYQUALINFO) + +typedef struct POLICYINFO_st { + ASN1_OBJECT *policyid; + STACK_OF(POLICYQUALINFO) *qualifiers; +} POLICYINFO; + +typedef STACK_OF(POLICYINFO) CERTIFICATEPOLICIES; + +DEFINE_STACK_OF(POLICYINFO) +DECLARE_ASN1_SET_OF(POLICYINFO) + +typedef struct POLICY_MAPPING_st { + ASN1_OBJECT *issuerDomainPolicy; + ASN1_OBJECT *subjectDomainPolicy; +} POLICY_MAPPING; + +DEFINE_STACK_OF(POLICY_MAPPING) + +typedef STACK_OF(POLICY_MAPPING) POLICY_MAPPINGS; + +typedef struct GENERAL_SUBTREE_st { + GENERAL_NAME *base; + ASN1_INTEGER *minimum; + ASN1_INTEGER *maximum; +} GENERAL_SUBTREE; + +DEFINE_STACK_OF(GENERAL_SUBTREE) + +struct NAME_CONSTRAINTS_st { + STACK_OF(GENERAL_SUBTREE) *permittedSubtrees; + STACK_OF(GENERAL_SUBTREE) *excludedSubtrees; +}; + +typedef struct POLICY_CONSTRAINTS_st { + ASN1_INTEGER *requireExplicitPolicy; + ASN1_INTEGER *inhibitPolicyMapping; +} POLICY_CONSTRAINTS; + +/* Proxy certificate structures, see RFC 3820 */ +typedef struct PROXY_POLICY_st + { + ASN1_OBJECT *policyLanguage; + ASN1_OCTET_STRING *policy; + } PROXY_POLICY; + +typedef struct PROXY_CERT_INFO_EXTENSION_st + { + ASN1_INTEGER *pcPathLengthConstraint; + PROXY_POLICY *proxyPolicy; + } PROXY_CERT_INFO_EXTENSION; + +DECLARE_ASN1_FUNCTIONS(PROXY_POLICY) +DECLARE_ASN1_FUNCTIONS(PROXY_CERT_INFO_EXTENSION) + +struct ISSUING_DIST_POINT_st + { + DIST_POINT_NAME *distpoint; + int onlyuser; + int onlyCA; + ASN1_BIT_STRING *onlysomereasons; + int indirectCRL; + int onlyattr; + }; + +/* Values in idp_flags field */ +/* IDP present */ +#define IDP_PRESENT 0x1 +/* IDP values inconsistent */ +#define IDP_INVALID 0x2 +/* onlyuser true */ +#define IDP_ONLYUSER 0x4 +/* onlyCA true */ +#define IDP_ONLYCA 0x8 +/* onlyattr true */ +#define IDP_ONLYATTR 0x10 +/* indirectCRL true */ +#define IDP_INDIRECT 0x20 +/* onlysomereasons present */ +#define IDP_REASONS 0x40 + +#define X509V3_conf_err(val) ERR_add_error_data(6, "section:", (val)->section, \ +",name:", (val)->name, ",value:", (val)->value); + +#define X509V3_set_ctx_test(ctx) \ + X509V3_set_ctx(ctx, NULL, NULL, NULL, NULL, CTX_TEST) +#define X509V3_set_ctx_nodb(ctx) (ctx)->db = NULL; + +#define EXT_BITSTRING(nid, table) { nid, 0, ASN1_ITEM_ref(ASN1_BIT_STRING), \ + 0,0,0,0, \ + 0,0, \ + (X509V3_EXT_I2V)i2v_ASN1_BIT_STRING, \ + (X509V3_EXT_V2I)v2i_ASN1_BIT_STRING, \ + NULL, NULL, \ + (void *)(table)} + +#define EXT_IA5STRING(nid) { nid, 0, ASN1_ITEM_ref(ASN1_IA5STRING), \ + 0,0,0,0, \ + (X509V3_EXT_I2S)i2s_ASN1_IA5STRING, \ + (X509V3_EXT_S2I)s2i_ASN1_IA5STRING, \ + 0,0,0,0, \ + NULL} + +#define EXT_END { -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} + + +/* X509_PURPOSE stuff */ + +#define EXFLAG_BCONS 0x1 +#define EXFLAG_KUSAGE 0x2 +#define EXFLAG_XKUSAGE 0x4 +#define EXFLAG_NSCERT 0x8 + +#define EXFLAG_CA 0x10 +/* Really self issued not necessarily self signed */ +#define EXFLAG_SI 0x20 +#define EXFLAG_V1 0x40 +#define EXFLAG_INVALID 0x80 +#define EXFLAG_SET 0x100 +#define EXFLAG_CRITICAL 0x200 +#define EXFLAG_PROXY 0x400 + +#define EXFLAG_INVALID_POLICY 0x800 +#define EXFLAG_FRESHEST 0x1000 +/* Self signed */ +#define EXFLAG_SS 0x2000 + +#define KU_DIGITAL_SIGNATURE 0x0080 +#define KU_NON_REPUDIATION 0x0040 +#define KU_KEY_ENCIPHERMENT 0x0020 +#define KU_DATA_ENCIPHERMENT 0x0010 +#define KU_KEY_AGREEMENT 0x0008 +#define KU_KEY_CERT_SIGN 0x0004 +#define KU_CRL_SIGN 0x0002 +#define KU_ENCIPHER_ONLY 0x0001 +#define KU_DECIPHER_ONLY 0x8000 + +#define NS_SSL_CLIENT 0x80 +#define NS_SSL_SERVER 0x40 +#define NS_SMIME 0x20 +#define NS_OBJSIGN 0x10 +#define NS_SSL_CA 0x04 +#define NS_SMIME_CA 0x02 +#define NS_OBJSIGN_CA 0x01 +#define NS_ANY_CA (NS_SSL_CA|NS_SMIME_CA|NS_OBJSIGN_CA) + +#define XKU_SSL_SERVER 0x1 +#define XKU_SSL_CLIENT 0x2 +#define XKU_SMIME 0x4 +#define XKU_CODE_SIGN 0x8 +#define XKU_SGC 0x10 +#define XKU_OCSP_SIGN 0x20 +#define XKU_TIMESTAMP 0x40 +#define XKU_DVCS 0x80 +#define XKU_ANYEKU 0x100 + +#define X509_PURPOSE_DYNAMIC 0x1 +#define X509_PURPOSE_DYNAMIC_NAME 0x2 + +typedef struct x509_purpose_st { + int purpose; + int trust; /* Default trust ID */ + int flags; + int (*check_purpose)(const struct x509_purpose_st *, + const X509 *, int); + char *name; + char *sname; + void *usr_data; +} X509_PURPOSE; + +#define X509_PURPOSE_SSL_CLIENT 1 +#define X509_PURPOSE_SSL_SERVER 2 +#define X509_PURPOSE_NS_SSL_SERVER 3 +#define X509_PURPOSE_SMIME_SIGN 4 +#define X509_PURPOSE_SMIME_ENCRYPT 5 +#define X509_PURPOSE_CRL_SIGN 6 +#define X509_PURPOSE_ANY 7 +#define X509_PURPOSE_OCSP_HELPER 8 +#define X509_PURPOSE_TIMESTAMP_SIGN 9 + +#define X509_PURPOSE_MIN 1 +#define X509_PURPOSE_MAX 9 + +/* Flags for X509V3_EXT_print() */ + +#define X509V3_EXT_UNKNOWN_MASK (0xfL << 16) +/* Return error for unknown extensions */ +#define X509V3_EXT_DEFAULT 0 +/* Print error for unknown extensions */ +#define X509V3_EXT_ERROR_UNKNOWN (1L << 16) +/* ASN1 parse unknown extensions */ +#define X509V3_EXT_PARSE_UNKNOWN (2L << 16) +/* BIO_dump unknown extensions */ +#define X509V3_EXT_DUMP_UNKNOWN (3L << 16) + +/* Flags for X509V3_add1_i2d */ + +#define X509V3_ADD_OP_MASK 0xfL +#define X509V3_ADD_DEFAULT 0L +#define X509V3_ADD_APPEND 1L +#define X509V3_ADD_REPLACE 2L +#define X509V3_ADD_REPLACE_EXISTING 3L +#define X509V3_ADD_KEEP_EXISTING 4L +#define X509V3_ADD_DELETE 5L +#define X509V3_ADD_SILENT 0x10 + +DEFINE_STACK_OF(X509_PURPOSE) + +DECLARE_ASN1_FUNCTIONS(BASIC_CONSTRAINTS) + +DECLARE_ASN1_FUNCTIONS(SXNET) +DECLARE_ASN1_FUNCTIONS(SXNETID) + +int SXNET_add_id_asc(SXNET **psx, char *zone, char *user, int userlen); +int SXNET_add_id_ulong(SXNET **psx, unsigned long lzone, char *user, int userlen); +int SXNET_add_id_INTEGER(SXNET **psx, ASN1_INTEGER *izone, char *user, int userlen); + +ASN1_OCTET_STRING *SXNET_get_id_asc(SXNET *sx, char *zone); +ASN1_OCTET_STRING *SXNET_get_id_ulong(SXNET *sx, unsigned long lzone); +ASN1_OCTET_STRING *SXNET_get_id_INTEGER(SXNET *sx, ASN1_INTEGER *zone); + +DECLARE_ASN1_FUNCTIONS(AUTHORITY_KEYID) + +DECLARE_ASN1_FUNCTIONS(PKEY_USAGE_PERIOD) + +DECLARE_ASN1_FUNCTIONS(GENERAL_NAME) +OPENSSL_EXPORT GENERAL_NAME *GENERAL_NAME_dup(GENERAL_NAME *a); +OPENSSL_EXPORT int GENERAL_NAME_cmp(GENERAL_NAME *a, GENERAL_NAME *b); + + + +OPENSSL_EXPORT ASN1_BIT_STRING *v2i_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); +OPENSSL_EXPORT STACK_OF(CONF_VALUE) *i2v_ASN1_BIT_STRING(X509V3_EXT_METHOD *method, + ASN1_BIT_STRING *bits, + STACK_OF(CONF_VALUE) *extlist); + +OPENSSL_EXPORT STACK_OF(CONF_VALUE) *i2v_GENERAL_NAME(X509V3_EXT_METHOD *method, GENERAL_NAME *gen, STACK_OF(CONF_VALUE) *ret); +OPENSSL_EXPORT int GENERAL_NAME_print(BIO *out, GENERAL_NAME *gen); + +DECLARE_ASN1_FUNCTIONS(GENERAL_NAMES) + +OPENSSL_EXPORT STACK_OF(CONF_VALUE) *i2v_GENERAL_NAMES(X509V3_EXT_METHOD *method, + GENERAL_NAMES *gen, STACK_OF(CONF_VALUE) *extlist); +OPENSSL_EXPORT GENERAL_NAMES *v2i_GENERAL_NAMES(const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval); + +DECLARE_ASN1_FUNCTIONS(OTHERNAME) +DECLARE_ASN1_FUNCTIONS(EDIPARTYNAME) +OPENSSL_EXPORT int OTHERNAME_cmp(OTHERNAME *a, OTHERNAME *b); +OPENSSL_EXPORT void GENERAL_NAME_set0_value(GENERAL_NAME *a, int type, void *value); +OPENSSL_EXPORT void *GENERAL_NAME_get0_value(GENERAL_NAME *a, int *ptype); +OPENSSL_EXPORT int GENERAL_NAME_set0_othername(GENERAL_NAME *gen, + ASN1_OBJECT *oid, ASN1_TYPE *value); +OPENSSL_EXPORT int GENERAL_NAME_get0_otherName(GENERAL_NAME *gen, + ASN1_OBJECT **poid, ASN1_TYPE **pvalue); + +OPENSSL_EXPORT char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, ASN1_OCTET_STRING *ia5); +OPENSSL_EXPORT ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, X509V3_CTX *ctx, char *str); + +DECLARE_ASN1_FUNCTIONS(EXTENDED_KEY_USAGE) +OPENSSL_EXPORT int i2a_ACCESS_DESCRIPTION(BIO *bp, ACCESS_DESCRIPTION* a); + +DECLARE_ASN1_FUNCTIONS(CERTIFICATEPOLICIES) +DECLARE_ASN1_FUNCTIONS(POLICYINFO) +DECLARE_ASN1_FUNCTIONS(POLICYQUALINFO) +DECLARE_ASN1_FUNCTIONS(USERNOTICE) +DECLARE_ASN1_FUNCTIONS(NOTICEREF) + +DECLARE_ASN1_FUNCTIONS(CRL_DIST_POINTS) +DECLARE_ASN1_FUNCTIONS(DIST_POINT) +DECLARE_ASN1_FUNCTIONS(DIST_POINT_NAME) +DECLARE_ASN1_FUNCTIONS(ISSUING_DIST_POINT) + +OPENSSL_EXPORT int DIST_POINT_set_dpname(DIST_POINT_NAME *dpn, X509_NAME *iname); + +OPENSSL_EXPORT int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc); + +DECLARE_ASN1_FUNCTIONS(ACCESS_DESCRIPTION) +DECLARE_ASN1_FUNCTIONS(AUTHORITY_INFO_ACCESS) + +DECLARE_ASN1_ITEM(POLICY_MAPPING) +DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING) +DECLARE_ASN1_ITEM(POLICY_MAPPINGS) + +DECLARE_ASN1_ITEM(GENERAL_SUBTREE) +DECLARE_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE) + +DECLARE_ASN1_ITEM(NAME_CONSTRAINTS) +DECLARE_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS) + +DECLARE_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS) +DECLARE_ASN1_ITEM(POLICY_CONSTRAINTS) + +OPENSSL_EXPORT GENERAL_NAME *a2i_GENERAL_NAME(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + int gen_type, char *value, int is_nc); + +OPENSSL_EXPORT GENERAL_NAME *v2i_GENERAL_NAME(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx, + CONF_VALUE *cnf); +OPENSSL_EXPORT GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, + const X509V3_EXT_METHOD *method, + X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); +OPENSSL_EXPORT void X509V3_conf_free(CONF_VALUE *val); + +// X509V3_EXT_conf_nid contains the only exposed instance of an LHASH in our +// public headers. The |conf| pointer must be NULL but cryptography.io wraps +// this function so we cannot, yet, replace the type with a dummy struct. +OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid, char *value); + +OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); +OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value); +OPENSSL_EXPORT int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk); +OPENSSL_EXPORT int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509 *cert); +OPENSSL_EXPORT int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); +OPENSSL_EXPORT int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); + +OPENSSL_EXPORT int X509V3_add_value_bool_nf(char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +OPENSSL_EXPORT int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); +OPENSSL_EXPORT int X509V3_get_value_int(CONF_VALUE *value, ASN1_INTEGER **aint); +OPENSSL_EXPORT void X509V3_set_nconf(X509V3_CTX *ctx, CONF *conf); + +OPENSSL_EXPORT char * X509V3_get_string(X509V3_CTX *ctx, char *name, char *section); +OPENSSL_EXPORT STACK_OF(CONF_VALUE) * X509V3_get_section(X509V3_CTX *ctx, char *section); +OPENSSL_EXPORT void X509V3_string_free(X509V3_CTX *ctx, char *str); +OPENSSL_EXPORT void X509V3_section_free( X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *section); +OPENSSL_EXPORT void X509V3_set_ctx(X509V3_CTX *ctx, X509 *issuer, X509 *subject, + X509_REQ *req, X509_CRL *crl, int flags); + +OPENSSL_EXPORT int X509V3_add_value(const char *name, const char *value, + STACK_OF(CONF_VALUE) **extlist); +OPENSSL_EXPORT int X509V3_add_value_uchar(const char *name, const unsigned char *value, + STACK_OF(CONF_VALUE) **extlist); +OPENSSL_EXPORT int X509V3_add_value_bool(const char *name, int asn1_bool, + STACK_OF(CONF_VALUE) **extlist); +OPENSSL_EXPORT int X509V3_add_value_int(const char *name, ASN1_INTEGER *aint, + STACK_OF(CONF_VALUE) **extlist); +OPENSSL_EXPORT char * i2s_ASN1_INTEGER(X509V3_EXT_METHOD *meth, ASN1_INTEGER *aint); +OPENSSL_EXPORT ASN1_INTEGER * s2i_ASN1_INTEGER(X509V3_EXT_METHOD *meth, char *value); +OPENSSL_EXPORT char * i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); +OPENSSL_EXPORT char * i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *meth, ASN1_ENUMERATED *aint); +OPENSSL_EXPORT int X509V3_EXT_add(X509V3_EXT_METHOD *ext); +OPENSSL_EXPORT int X509V3_EXT_add_list(X509V3_EXT_METHOD *extlist); +OPENSSL_EXPORT int X509V3_EXT_add_alias(int nid_to, int nid_from); +OPENSSL_EXPORT void X509V3_EXT_cleanup(void); + +OPENSSL_EXPORT const X509V3_EXT_METHOD *X509V3_EXT_get(X509_EXTENSION *ext); +OPENSSL_EXPORT const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid); +OPENSSL_EXPORT int X509V3_add_standard_extensions(void); +OPENSSL_EXPORT STACK_OF(CONF_VALUE) *X509V3_parse_list(const char *line); +OPENSSL_EXPORT void *X509V3_EXT_d2i(X509_EXTENSION *ext); +OPENSSL_EXPORT void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx); +OPENSSL_EXPORT int X509V3_EXT_free(int nid, void *ext_data); + + +OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); +OPENSSL_EXPORT int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); + +OPENSSL_EXPORT void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, + int ml); +OPENSSL_EXPORT int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); +OPENSSL_EXPORT int X509V3_EXT_print_fp(FILE *out, X509_EXTENSION *ext, int flag, int indent); + +OPENSSL_EXPORT int X509V3_extensions_print(BIO *out, const char *title, STACK_OF(X509_EXTENSION) *exts, unsigned long flag, int indent); + +OPENSSL_EXPORT int X509_check_ca(X509 *x); +OPENSSL_EXPORT int X509_check_purpose(X509 *x, int id, int ca); +OPENSSL_EXPORT int X509_supported_extension(X509_EXTENSION *ex); +OPENSSL_EXPORT int X509_PURPOSE_set(int *p, int purpose); +OPENSSL_EXPORT int X509_check_issued(X509 *issuer, X509 *subject); +OPENSSL_EXPORT int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); + +OPENSSL_EXPORT uint32_t X509_get_extension_flags(X509 *x); +OPENSSL_EXPORT uint32_t X509_get_key_usage(X509 *x); +OPENSSL_EXPORT uint32_t X509_get_extended_key_usage(X509 *x); + +OPENSSL_EXPORT int X509_PURPOSE_get_count(void); +OPENSSL_EXPORT X509_PURPOSE * X509_PURPOSE_get0(int idx); +OPENSSL_EXPORT int X509_PURPOSE_get_by_sname(char *sname); +OPENSSL_EXPORT int X509_PURPOSE_get_by_id(int id); +OPENSSL_EXPORT int X509_PURPOSE_add(int id, int trust, int flags, + int (*ck)(const X509_PURPOSE *, const X509 *, int), + char *name, char *sname, void *arg); +OPENSSL_EXPORT char *X509_PURPOSE_get0_name(X509_PURPOSE *xp); +OPENSSL_EXPORT char *X509_PURPOSE_get0_sname(X509_PURPOSE *xp); +OPENSSL_EXPORT int X509_PURPOSE_get_trust(X509_PURPOSE *xp); +OPENSSL_EXPORT void X509_PURPOSE_cleanup(void); +OPENSSL_EXPORT int X509_PURPOSE_get_id(X509_PURPOSE *); + +OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); +OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); +OPENSSL_EXPORT void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); +OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); +/* Flags for X509_check_* functions */ + +/* Deprecated: this flag does nothing */ +#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0 +/* Disable wildcard matching for dnsName fields and common name. */ +#define X509_CHECK_FLAG_NO_WILDCARDS 0x2 +/* Wildcards must not match a partial label. */ +#define X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS 0x4 +/* Allow (non-partial) wildcards to match multiple labels. */ +#define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8 +/* Constraint verifier subdomain patterns to match a single labels. */ +#define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10 +/* Skip the subject common name fallback if subjectAltNames is missing. */ +#define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20 +/* + * Match reference identifiers starting with "." to any sub-domain. + * This is a non-public flag, turned on implicitly when the subject + * reference identity is a DNS name. + */ +#define _X509_CHECK_FLAG_DOT_SUBDOMAINS 0x8000 + +OPENSSL_EXPORT int X509_check_host(X509 *x, const char *chk, size_t chklen, + unsigned int flags, char **peername); +OPENSSL_EXPORT int X509_check_email(X509 *x, const char *chk, size_t chklen, + unsigned int flags); +OPENSSL_EXPORT int X509_check_ip(X509 *x, const unsigned char *chk, size_t chklen, + unsigned int flags); +OPENSSL_EXPORT int X509_check_ip_asc(X509 *x, const char *ipasc, unsigned int flags); + +OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS(const char *ipasc); +OPENSSL_EXPORT ASN1_OCTET_STRING *a2i_IPADDRESS_NC(const char *ipasc); +OPENSSL_EXPORT int a2i_ipadd(unsigned char *ipout, const char *ipasc); +OPENSSL_EXPORT int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE)*dn_sk, + unsigned long chtype); + +OPENSSL_EXPORT void X509_POLICY_NODE_print(BIO *out, X509_POLICY_NODE *node, int indent); +DEFINE_STACK_OF(X509_POLICY_NODE) + +/* BEGIN ERROR CODES */ +/* The following lines are auto generated by the script mkerr.pl. Any changes + * made after this point may be overwritten when the script is next run. + */ + + +#ifdef __cplusplus +} + +extern "C++" { + +BSSL_NAMESPACE_BEGIN + +BORINGSSL_MAKE_DELETER(ACCESS_DESCRIPTION, ACCESS_DESCRIPTION_free) +BORINGSSL_MAKE_DELETER(AUTHORITY_KEYID, AUTHORITY_KEYID_free) +BORINGSSL_MAKE_DELETER(BASIC_CONSTRAINTS, BASIC_CONSTRAINTS_free) +BORINGSSL_MAKE_DELETER(DIST_POINT, DIST_POINT_free) +BORINGSSL_MAKE_DELETER(GENERAL_NAME, GENERAL_NAME_free) +BORINGSSL_MAKE_DELETER(POLICYINFO, POLICYINFO_free) + +BSSL_NAMESPACE_END + +} /* extern C++ */ +#endif + +#define X509V3_R_BAD_IP_ADDRESS 100 +#define X509V3_R_BAD_OBJECT 101 +#define X509V3_R_BN_DEC2BN_ERROR 102 +#define X509V3_R_BN_TO_ASN1_INTEGER_ERROR 103 +#define X509V3_R_CANNOT_FIND_FREE_FUNCTION 104 +#define X509V3_R_DIRNAME_ERROR 105 +#define X509V3_R_DISTPOINT_ALREADY_SET 106 +#define X509V3_R_DUPLICATE_ZONE_ID 107 +#define X509V3_R_ERROR_CONVERTING_ZONE 108 +#define X509V3_R_ERROR_CREATING_EXTENSION 109 +#define X509V3_R_ERROR_IN_EXTENSION 110 +#define X509V3_R_EXPECTED_A_SECTION_NAME 111 +#define X509V3_R_EXTENSION_EXISTS 112 +#define X509V3_R_EXTENSION_NAME_ERROR 113 +#define X509V3_R_EXTENSION_NOT_FOUND 114 +#define X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED 115 +#define X509V3_R_EXTENSION_VALUE_ERROR 116 +#define X509V3_R_ILLEGAL_EMPTY_EXTENSION 117 +#define X509V3_R_ILLEGAL_HEX_DIGIT 118 +#define X509V3_R_INCORRECT_POLICY_SYNTAX_TAG 119 +#define X509V3_R_INVALID_BOOLEAN_STRING 120 +#define X509V3_R_INVALID_EXTENSION_STRING 121 +#define X509V3_R_INVALID_MULTIPLE_RDNS 122 +#define X509V3_R_INVALID_NAME 123 +#define X509V3_R_INVALID_NULL_ARGUMENT 124 +#define X509V3_R_INVALID_NULL_NAME 125 +#define X509V3_R_INVALID_NULL_VALUE 126 +#define X509V3_R_INVALID_NUMBER 127 +#define X509V3_R_INVALID_NUMBERS 128 +#define X509V3_R_INVALID_OBJECT_IDENTIFIER 129 +#define X509V3_R_INVALID_OPTION 130 +#define X509V3_R_INVALID_POLICY_IDENTIFIER 131 +#define X509V3_R_INVALID_PROXY_POLICY_SETTING 132 +#define X509V3_R_INVALID_PURPOSE 133 +#define X509V3_R_INVALID_SECTION 134 +#define X509V3_R_INVALID_SYNTAX 135 +#define X509V3_R_ISSUER_DECODE_ERROR 136 +#define X509V3_R_MISSING_VALUE 137 +#define X509V3_R_NEED_ORGANIZATION_AND_NUMBERS 138 +#define X509V3_R_NO_CONFIG_DATABASE 139 +#define X509V3_R_NO_ISSUER_CERTIFICATE 140 +#define X509V3_R_NO_ISSUER_DETAILS 141 +#define X509V3_R_NO_POLICY_IDENTIFIER 142 +#define X509V3_R_NO_PROXY_CERT_POLICY_LANGUAGE_DEFINED 143 +#define X509V3_R_NO_PUBLIC_KEY 144 +#define X509V3_R_NO_SUBJECT_DETAILS 145 +#define X509V3_R_ODD_NUMBER_OF_DIGITS 146 +#define X509V3_R_OPERATION_NOT_DEFINED 147 +#define X509V3_R_OTHERNAME_ERROR 148 +#define X509V3_R_POLICY_LANGUAGE_ALREADY_DEFINED 149 +#define X509V3_R_POLICY_PATH_LENGTH 150 +#define X509V3_R_POLICY_PATH_LENGTH_ALREADY_DEFINED 151 +#define X509V3_R_POLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICY 152 +#define X509V3_R_SECTION_NOT_FOUND 153 +#define X509V3_R_UNABLE_TO_GET_ISSUER_DETAILS 154 +#define X509V3_R_UNABLE_TO_GET_ISSUER_KEYID 155 +#define X509V3_R_UNKNOWN_BIT_STRING_ARGUMENT 156 +#define X509V3_R_UNKNOWN_EXTENSION 157 +#define X509V3_R_UNKNOWN_EXTENSION_NAME 158 +#define X509V3_R_UNKNOWN_OPTION 159 +#define X509V3_R_UNSUPPORTED_OPTION 160 +#define X509V3_R_UNSUPPORTED_TYPE 161 +#define X509V3_R_USER_TOO_LONG 162 + +#endif diff --git a/Pods/BoringSSL-GRPC/include/openssl/x509v3.h.grpc_back b/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/include/openssl/x509v3.h.grpc_back rename to Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.grpc_back index 4a1fe7bf4..b5db7157e 100644 --- a/Pods/BoringSSL-GRPC/include/openssl/x509v3.h.grpc_back +++ b/Pods/BoringSSL-GRPC/src/include/openssl/x509v3.h.grpc_back @@ -57,8 +57,8 @@ #include #include -#include #include +#include #ifdef __cplusplus extern "C" { @@ -612,7 +612,11 @@ OPENSSL_EXPORT GENERAL_NAME *v2i_GENERAL_NAME_ex(GENERAL_NAME *out, X509V3_CTX *ctx, CONF_VALUE *cnf, int is_nc); OPENSSL_EXPORT void X509V3_conf_free(CONF_VALUE *val); +// X509V3_EXT_conf_nid contains the only exposed instance of an LHASH in our +// public headers. The |conf| pointer must be NULL but cryptography.io wraps +// this function so we cannot, yet, replace the type with a dummy struct. OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_conf_nid(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, int ext_nid, char *value); + OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf_nid(CONF *conf, X509V3_CTX *ctx, int ext_nid, char *value); OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_nconf(CONF *conf, X509V3_CTX *ctx, char *name, char *value); OPENSSL_EXPORT int X509V3_EXT_add_nconf_sk(CONF *conf, X509V3_CTX *ctx, char *section, STACK_OF(X509_EXTENSION) **sk); @@ -620,9 +624,6 @@ OPENSSL_EXPORT int X509V3_EXT_add_nconf(CONF *conf, X509V3_CTX *ctx, char *secti OPENSSL_EXPORT int X509V3_EXT_REQ_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_REQ *req); OPENSSL_EXPORT int X509V3_EXT_CRL_add_nconf(CONF *conf, X509V3_CTX *ctx, char *section, X509_CRL *crl); -OPENSSL_EXPORT int X509V3_EXT_CRL_add_conf(LHASH_OF(CONF_VALUE) *conf, X509V3_CTX *ctx, - char *section, X509_CRL *crl); - OPENSSL_EXPORT int X509V3_add_value_bool_nf(char *name, int asn1_bool, STACK_OF(CONF_VALUE) **extlist); OPENSSL_EXPORT int X509V3_get_value_bool(CONF_VALUE *value, int *asn1_bool); @@ -665,10 +666,6 @@ OPENSSL_EXPORT int X509V3_EXT_free(int nid, void *ext_data); OPENSSL_EXPORT X509_EXTENSION *X509V3_EXT_i2d(int ext_nid, int crit, void *ext_struc); OPENSSL_EXPORT int X509V3_add1_i2d(STACK_OF(X509_EXTENSION) **x, int nid, void *value, int crit, unsigned long flags); -char *hex_to_string(const unsigned char *buffer, long len); -unsigned char *string_to_hex(const char *str, long *len); -int name_cmp(const char *name, const char *cmp); - OPENSSL_EXPORT void X509V3_EXT_val_prn(BIO *out, STACK_OF(CONF_VALUE) *val, int indent, int ml); OPENSSL_EXPORT int X509V3_EXT_print(BIO *out, X509_EXTENSION *ext, unsigned long flag, int indent); @@ -682,6 +679,11 @@ OPENSSL_EXPORT int X509_supported_extension(X509_EXTENSION *ex); OPENSSL_EXPORT int X509_PURPOSE_set(int *p, int purpose); OPENSSL_EXPORT int X509_check_issued(X509 *issuer, X509 *subject); OPENSSL_EXPORT int X509_check_akid(X509 *issuer, AUTHORITY_KEYID *akid); + +OPENSSL_EXPORT uint32_t X509_get_extension_flags(X509 *x); +OPENSSL_EXPORT uint32_t X509_get_key_usage(X509 *x); +OPENSSL_EXPORT uint32_t X509_get_extended_key_usage(X509 *x); + OPENSSL_EXPORT int X509_PURPOSE_get_count(void); OPENSSL_EXPORT X509_PURPOSE * X509_PURPOSE_get0(int idx); OPENSSL_EXPORT int X509_PURPOSE_get_by_sname(char *sname); @@ -701,8 +703,8 @@ OPENSSL_EXPORT void X509_email_free(STACK_OF(OPENSSL_STRING) *sk); OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); /* Flags for X509_check_* functions */ -/* Always check subject name for host match even if subject alt names present */ -#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0x1 +/* Deprecated: this flag does nothing */ +#define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 0 /* Disable wildcard matching for dnsName fields and common name. */ #define X509_CHECK_FLAG_NO_WILDCARDS 0x2 /* Wildcards must not match a partial label. */ @@ -711,6 +713,8 @@ OPENSSL_EXPORT STACK_OF(OPENSSL_STRING) *X509_get1_ocsp(X509 *x); #define X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS 0x8 /* Constraint verifier subdomain patterns to match a single labels. */ #define X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS 0x10 +/* Skip the subject common name fallback if subjectAltNames is missing. */ +#define X509_CHECK_FLAG_NEVER_CHECK_SUBJECT 0x20 /* * Match reference identifiers starting with "." to any sub-domain. * This is a non-public flag, turned on implicitly when the subject @@ -746,16 +750,16 @@ DEFINE_STACK_OF(X509_POLICY_NODE) extern "C++" { -namespace bssl { +BSSL_NAMESPACE_BEGIN -BORINGSSL_MAKE_DELETER(AUTHORITY_INFO_ACCESS, AUTHORITY_INFO_ACCESS_free) +BORINGSSL_MAKE_DELETER(ACCESS_DESCRIPTION, ACCESS_DESCRIPTION_free) BORINGSSL_MAKE_DELETER(AUTHORITY_KEYID, AUTHORITY_KEYID_free) BORINGSSL_MAKE_DELETER(BASIC_CONSTRAINTS, BASIC_CONSTRAINTS_free) BORINGSSL_MAKE_DELETER(DIST_POINT, DIST_POINT_free) BORINGSSL_MAKE_DELETER(GENERAL_NAME, GENERAL_NAME_free) BORINGSSL_MAKE_DELETER(POLICYINFO, POLICYINFO_free) -} // namespace bssl +BSSL_NAMESPACE_END } /* extern C++ */ #endif diff --git a/Pods/BoringSSL-GRPC/ssl/bio_ssl.cc b/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc similarity index 100% rename from Pods/BoringSSL-GRPC/ssl/bio_ssl.cc rename to Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc diff --git a/Pods/BoringSSL-GRPC/ssl/bio_ssl.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/ssl/bio_ssl.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/bio_ssl.cc.grpc_back diff --git a/Pods/BoringSSL-GRPC/ssl/d1_both.cc b/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc similarity index 97% rename from Pods/BoringSSL-GRPC/ssl/d1_both.cc rename to Pods/BoringSSL-GRPC/src/ssl/d1_both.cc index 91f9b2355..9994db0f9 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_both.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc @@ -117,7 +117,6 @@ #include #include -#include #include #include #include @@ -127,7 +126,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // TODO(davidben): 28 comes from the size of IP + UDP header. Is this reasonable // for these values? Notably, why is kMinMTU a function of the transport @@ -405,7 +404,7 @@ ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, return ssl_open_record_success; } -bool dtls1_get_message(SSL *ssl, SSLMessage *out) { +bool dtls1_get_message(const SSL *ssl, SSLMessage *out) { if (!dtls1_is_current_message_complete(ssl)) { return false; } @@ -601,15 +600,6 @@ bool dtls1_add_change_cipher_spec(SSL *ssl) { return add_outgoing(ssl, true /* ChangeCipherSpec */, Array()); } -bool dtls1_add_alert(SSL *ssl, uint8_t level, uint8_t desc) { - // The |add_alert| path is only used for warning alerts for now, which DTLS - // never sends. This will be implemented later once closure alerts are - // converted. - assert(false); - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; -} - // dtls1_update_mtu updates the current MTU from the BIO, ensuring it is above // the minimum. static void dtls1_update_mtu(SSL *ssl) { @@ -618,12 +608,12 @@ static void dtls1_update_mtu(SSL *ssl) { // |SSL_set_mtu|. Does this need to be so complex? if (ssl->d1->mtu < dtls1_min_mtu() && !(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { - long mtu = BIO_ctrl(ssl->wbio, BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); + long mtu = BIO_ctrl(ssl->wbio.get(), BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); if (mtu >= 0 && mtu <= (1 << 30) && (unsigned)mtu >= dtls1_min_mtu()) { ssl->d1->mtu = (unsigned)mtu; } else { ssl->d1->mtu = kDefaultMTU; - BIO_ctrl(ssl->wbio, BIO_CTRL_DGRAM_SET_MTU, ssl->d1->mtu, NULL); + BIO_ctrl(ssl->wbio.get(), BIO_CTRL_DGRAM_SET_MTU, ssl->d1->mtu, NULL); } } @@ -803,19 +793,19 @@ static int send_flight(SSL *ssl) { goto err; } - int bio_ret = BIO_write(ssl->wbio, packet, packet_len); + int bio_ret = BIO_write(ssl->wbio.get(), packet, packet_len); if (bio_ret <= 0) { // Retry this packet the next time around. ssl->d1->outgoing_written = old_written; ssl->d1->outgoing_offset = old_offset; - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; ret = bio_ret; goto err; } } - if (BIO_flush(ssl->wbio) <= 0) { - ssl->s3->rwstate = SSL_WRITING; + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; goto err; } @@ -848,4 +838,4 @@ unsigned int dtls1_min_mtu(void) { return kMinMTU; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/d1_both.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc.grpc_back similarity index 97% rename from Pods/BoringSSL-GRPC/ssl/d1_both.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/d1_both.cc.grpc_back index 31c83c609..2b652d1af 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_both.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_both.cc.grpc_back @@ -117,7 +117,6 @@ #include #include -#include #include #include #include @@ -127,7 +126,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // TODO(davidben): 28 comes from the size of IP + UDP header. Is this reasonable // for these values? Notably, why is kMinMTU a function of the transport @@ -405,7 +404,7 @@ ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, return ssl_open_record_success; } -bool dtls1_get_message(SSL *ssl, SSLMessage *out) { +bool dtls1_get_message(const SSL *ssl, SSLMessage *out) { if (!dtls1_is_current_message_complete(ssl)) { return false; } @@ -601,15 +600,6 @@ bool dtls1_add_change_cipher_spec(SSL *ssl) { return add_outgoing(ssl, true /* ChangeCipherSpec */, Array()); } -bool dtls1_add_alert(SSL *ssl, uint8_t level, uint8_t desc) { - // The |add_alert| path is only used for warning alerts for now, which DTLS - // never sends. This will be implemented later once closure alerts are - // converted. - assert(false); - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; -} - // dtls1_update_mtu updates the current MTU from the BIO, ensuring it is above // the minimum. static void dtls1_update_mtu(SSL *ssl) { @@ -618,12 +608,12 @@ static void dtls1_update_mtu(SSL *ssl) { // |SSL_set_mtu|. Does this need to be so complex? if (ssl->d1->mtu < dtls1_min_mtu() && !(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { - long mtu = BIO_ctrl(ssl->wbio, BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); + long mtu = BIO_ctrl(ssl->wbio.get(), BIO_CTRL_DGRAM_QUERY_MTU, 0, NULL); if (mtu >= 0 && mtu <= (1 << 30) && (unsigned)mtu >= dtls1_min_mtu()) { ssl->d1->mtu = (unsigned)mtu; } else { ssl->d1->mtu = kDefaultMTU; - BIO_ctrl(ssl->wbio, BIO_CTRL_DGRAM_SET_MTU, ssl->d1->mtu, NULL); + BIO_ctrl(ssl->wbio.get(), BIO_CTRL_DGRAM_SET_MTU, ssl->d1->mtu, NULL); } } @@ -803,19 +793,19 @@ static int send_flight(SSL *ssl) { goto err; } - int bio_ret = BIO_write(ssl->wbio, packet, packet_len); + int bio_ret = BIO_write(ssl->wbio.get(), packet, packet_len); if (bio_ret <= 0) { // Retry this packet the next time around. ssl->d1->outgoing_written = old_written; ssl->d1->outgoing_offset = old_offset; - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; ret = bio_ret; goto err; } } - if (BIO_flush(ssl->wbio) <= 0) { - ssl->s3->rwstate = SSL_WRITING; + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; goto err; } @@ -848,4 +838,4 @@ unsigned int dtls1_min_mtu(void) { return kMinMTU; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/d1_lib.cc b/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc similarity index 98% rename from Pods/BoringSSL-GRPC/ssl/d1_lib.cc rename to Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc index 2c3e642c1..118015398 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_lib.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc @@ -68,7 +68,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // DTLS1_MTU_TIMEOUTS is the maximum number of timeouts to expire // before starting to decrease the MTU. @@ -171,7 +171,8 @@ bool dtls1_check_timeout_num(SSL *ssl) { // Reduce MTU after 2 unsuccessful retransmissions if (ssl->d1->num_timeouts > DTLS1_MTU_TIMEOUTS && !(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { - long mtu = BIO_ctrl(ssl->wbio, BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + long mtu = + BIO_ctrl(ssl->wbio.get(), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, nullptr); if (mtu >= 0 && mtu <= (1 << 30) && (unsigned)mtu >= dtls1_min_mtu()) { ssl->d1->mtu = (unsigned)mtu; } @@ -186,7 +187,7 @@ bool dtls1_check_timeout_num(SSL *ssl) { return true; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; diff --git a/Pods/BoringSSL-GRPC/ssl/d1_lib.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/ssl/d1_lib.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc.grpc_back index eff06eec7..0e0b211bf 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_lib.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_lib.cc.grpc_back @@ -68,7 +68,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // DTLS1_MTU_TIMEOUTS is the maximum number of timeouts to expire // before starting to decrease the MTU. @@ -171,7 +171,8 @@ bool dtls1_check_timeout_num(SSL *ssl) { // Reduce MTU after 2 unsuccessful retransmissions if (ssl->d1->num_timeouts > DTLS1_MTU_TIMEOUTS && !(SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { - long mtu = BIO_ctrl(ssl->wbio, BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, NULL); + long mtu = + BIO_ctrl(ssl->wbio.get(), BIO_CTRL_DGRAM_GET_FALLBACK_MTU, 0, nullptr); if (mtu >= 0 && mtu <= (1 << 30) && (unsigned)mtu >= dtls1_min_mtu()) { ssl->d1->mtu = (unsigned)mtu; } @@ -186,7 +187,7 @@ bool dtls1_check_timeout_num(SSL *ssl) { return true; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; diff --git a/Pods/BoringSSL-GRPC/ssl/d1_pkt.cc b/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc similarity index 98% rename from Pods/BoringSSL-GRPC/ssl/d1_pkt.cc rename to Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc index 8fef21fd5..a34e951ad 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_pkt.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc @@ -115,7 +115,6 @@ #include #include -#include #include #include #include @@ -126,7 +125,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, size_t *out_consumed, uint8_t *out_alert, @@ -256,11 +255,11 @@ int dtls1_dispatch_alert(SSL *ssl) { if (ret <= 0) { return ret; } - ssl->s3->alert_dispatch = 0; + ssl->s3->alert_dispatch = false; // If the alert is fatal, flush the BIO now. if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) { - BIO_flush(ssl->wbio); + BIO_flush(ssl->wbio.get()); } ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); @@ -271,4 +270,4 @@ int dtls1_dispatch_alert(SSL *ssl) { return 1; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/d1_pkt.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc.grpc_back similarity index 98% rename from Pods/BoringSSL-GRPC/ssl/d1_pkt.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc.grpc_back index d29a5c284..b9b0ef931 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_pkt.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_pkt.cc.grpc_back @@ -115,7 +115,6 @@ #include #include -#include #include #include #include @@ -126,7 +125,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, size_t *out_consumed, uint8_t *out_alert, @@ -256,11 +255,11 @@ int dtls1_dispatch_alert(SSL *ssl) { if (ret <= 0) { return ret; } - ssl->s3->alert_dispatch = 0; + ssl->s3->alert_dispatch = false; // If the alert is fatal, flush the BIO now. if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) { - BIO_flush(ssl->wbio); + BIO_flush(ssl->wbio.get()); } ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); @@ -271,4 +270,4 @@ int dtls1_dispatch_alert(SSL *ssl) { return 1; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/d1_srtp.cc b/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc similarity index 93% rename from Pods/BoringSSL-GRPC/ssl/d1_srtp.cc rename to Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc index 5015e6f5d..2f55289d9 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_srtp.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc @@ -158,8 +158,9 @@ static int find_profile_by_name(const char *profile_name, return 0; } -static int ssl_ctx_make_profiles(const char *profiles_string, - STACK_OF(SRTP_PROTECTION_PROFILE) **out) { +static int ssl_ctx_make_profiles( + const char *profiles_string, + UniquePtr *out) { UniquePtr profiles( sk_SRTP_PROTECTION_PROFILE_new_null()); if (profiles == nullptr) { @@ -188,8 +189,7 @@ static int ssl_ctx_make_profiles(const char *profiles_string, } } while (col); - sk_SRTP_PROTECTION_PROFILE_free(*out); - *out = profiles.release(); + *out = std::move(profiles); return 1; } @@ -198,27 +198,27 @@ int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, const char *profiles) { } int SSL_set_srtp_profiles(SSL *ssl, const char *profiles) { - return ssl_ctx_make_profiles(profiles, &ssl->srtp_profiles); + return ssl->config != nullptr && + ssl_ctx_make_profiles(profiles, &ssl->config->srtp_profiles); } STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl) { - if (ssl == NULL) { - return NULL; + if (ssl == nullptr) { + return nullptr; } - if (ssl->srtp_profiles != NULL) { - return ssl->srtp_profiles; + if (ssl->config == nullptr) { + assert(0); + return nullptr; } - if (ssl->ctx->srtp_profiles != NULL) { - return ssl->ctx->srtp_profiles; - } - - return NULL; + return ssl->config->srtp_profiles != nullptr + ? ssl->config->srtp_profiles.get() + : ssl->ctx->srtp_profiles.get(); } const SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *ssl) { - return ssl->srtp_profile; + return ssl->s3->srtp_profile; } int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles) { diff --git a/Pods/BoringSSL-GRPC/ssl/d1_srtp.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc.grpc_back similarity index 93% rename from Pods/BoringSSL-GRPC/ssl/d1_srtp.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc.grpc_back index 1a8e08487..96d7d5132 100644 --- a/Pods/BoringSSL-GRPC/ssl/d1_srtp.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/d1_srtp.cc.grpc_back @@ -158,8 +158,9 @@ static int find_profile_by_name(const char *profile_name, return 0; } -static int ssl_ctx_make_profiles(const char *profiles_string, - STACK_OF(SRTP_PROTECTION_PROFILE) **out) { +static int ssl_ctx_make_profiles( + const char *profiles_string, + UniquePtr *out) { UniquePtr profiles( sk_SRTP_PROTECTION_PROFILE_new_null()); if (profiles == nullptr) { @@ -188,8 +189,7 @@ static int ssl_ctx_make_profiles(const char *profiles_string, } } while (col); - sk_SRTP_PROTECTION_PROFILE_free(*out); - *out = profiles.release(); + *out = std::move(profiles); return 1; } @@ -198,27 +198,27 @@ int SSL_CTX_set_srtp_profiles(SSL_CTX *ctx, const char *profiles) { } int SSL_set_srtp_profiles(SSL *ssl, const char *profiles) { - return ssl_ctx_make_profiles(profiles, &ssl->srtp_profiles); + return ssl->config != nullptr && + ssl_ctx_make_profiles(profiles, &ssl->config->srtp_profiles); } STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl) { - if (ssl == NULL) { - return NULL; + if (ssl == nullptr) { + return nullptr; } - if (ssl->srtp_profiles != NULL) { - return ssl->srtp_profiles; + if (ssl->config == nullptr) { + assert(0); + return nullptr; } - if (ssl->ctx->srtp_profiles != NULL) { - return ssl->ctx->srtp_profiles; - } - - return NULL; + return ssl->config->srtp_profiles != nullptr + ? ssl->config->srtp_profiles.get() + : ssl->ctx->srtp_profiles.get(); } const SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *ssl) { - return ssl->srtp_profile; + return ssl->s3->srtp_profile; } int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles) { diff --git a/Pods/BoringSSL-GRPC/ssl/dtls_method.cc b/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc similarity index 99% rename from Pods/BoringSSL-GRPC/ssl/dtls_method.cc rename to Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc index 0294928c6..c97e1ca5a 100644 --- a/Pods/BoringSSL-GRPC/ssl/dtls_method.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc @@ -59,7 +59,6 @@ #include #include -#include #include #include "../crypto/internal.h" @@ -121,7 +120,6 @@ static const SSL_PROTOCOL_METHOD kDTLSProtocolMethod = { dtls1_finish_message, dtls1_add_message, dtls1_add_change_cipher_spec, - dtls1_add_alert, dtls1_flush_flight, dtls1_on_handshake_complete, dtls1_set_read_state, diff --git a/Pods/BoringSSL-GRPC/ssl/dtls_method.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/ssl/dtls_method.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc.grpc_back index 8d40edf84..0ce7c1f3f 100644 --- a/Pods/BoringSSL-GRPC/ssl/dtls_method.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/dtls_method.cc.grpc_back @@ -59,7 +59,6 @@ #include #include -#include #include #include "../crypto/internal.h" @@ -121,7 +120,6 @@ static const SSL_PROTOCOL_METHOD kDTLSProtocolMethod = { dtls1_finish_message, dtls1_add_message, dtls1_add_change_cipher_spec, - dtls1_add_alert, dtls1_flush_flight, dtls1_on_handshake_complete, dtls1_set_read_state, diff --git a/Pods/BoringSSL-GRPC/ssl/dtls_record.cc b/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc similarity index 92% rename from Pods/BoringSSL-GRPC/ssl/dtls_record.cc rename to Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc index 007f4c69b..ed7708222 100644 --- a/Pods/BoringSSL-GRPC/ssl/dtls_record.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc @@ -121,7 +121,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // to_u64_be treats |in| as a 8-byte big-endian integer and returns the value as // a |uint64_t|. @@ -137,13 +137,13 @@ static uint64_t to_u64_be(const uint8_t in[8]) { // dtls1_bitmap_should_discard returns one if |seq_num| has been seen in // |bitmap| or is stale. Otherwise it returns zero. -static int dtls1_bitmap_should_discard(DTLS1_BITMAP *bitmap, - const uint8_t seq_num[8]) { +static bool dtls1_bitmap_should_discard(DTLS1_BITMAP *bitmap, + const uint8_t seq_num[8]) { const unsigned kWindowSize = sizeof(bitmap->map) * 8; uint64_t seq_num_u = to_u64_be(seq_num); if (seq_num_u > bitmap->max_seq_num) { - return 0; + return false; } uint64_t idx = bitmap->max_seq_num - seq_num_u; return idx >= kWindowSize || (bitmap->map & (((uint64_t)1) << idx)); @@ -219,8 +219,8 @@ enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, return ssl_open_record_discard; } - ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, - in.subspan(0, DTLS1_RT_HEADER_LENGTH)); + Span header = in.subspan(0, DTLS1_RT_HEADER_LENGTH); + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, header); uint16_t epoch = (((uint16_t)sequence[0]) << 8) | sequence[1]; if (epoch != ssl->d1->r_epoch || @@ -235,7 +235,7 @@ enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, // discard the body in-place. if (!ssl->s3->aead_read_ctx->Open( - out, type, version, sequence, + out, type, version, sequence, header, MakeSpan(const_cast(CBS_data(&body)), CBS_len(&body)))) { // Bad packets are silently dropped in DTLS. See section 4.2.1 of RFC 6347. // Clear the error queue of any errors decryption may have added. Drop the @@ -291,14 +291,14 @@ size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch) { get_write_aead(ssl, use_epoch)->ExplicitNonceLen(); } -int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, - uint8_t type, const uint8_t *in, size_t in_len, - enum dtls1_use_epoch_t use_epoch) { +bool dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, + uint8_t type, const uint8_t *in, size_t in_len, + enum dtls1_use_epoch_t use_epoch) { const size_t prefix = dtls_seal_prefix_len(ssl, use_epoch); if (buffers_alias(in, in_len, out, max_out) && (max_out < prefix || out + prefix != in)) { OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); - return 0; + return false; } // Determine the parameters for the current epoch. @@ -314,7 +314,7 @@ int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, if (max_out < DTLS1_RT_HEADER_LENGTH) { OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); - return 0; + return false; } out[0] = type; @@ -328,26 +328,26 @@ int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, OPENSSL_memcpy(&out[5], &seq[2], 6); size_t ciphertext_len; - if (!aead->Seal(out + DTLS1_RT_HEADER_LENGTH, &ciphertext_len, - max_out - DTLS1_RT_HEADER_LENGTH, type, record_version, - &out[3] /* seq */, in, in_len) || - !ssl_record_sequence_update(&seq[2], 6)) { - return 0; - } - - if (ciphertext_len >= 1 << 16) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; + if (!aead->CiphertextLen(&ciphertext_len, in_len, 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return false; } out[11] = ciphertext_len >> 8; out[12] = ciphertext_len & 0xff; + Span header = MakeConstSpan(out, DTLS1_RT_HEADER_LENGTH); - *out_len = DTLS1_RT_HEADER_LENGTH + ciphertext_len; - - ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, - MakeSpan(out, DTLS1_RT_HEADER_LENGTH)); + size_t len_copy; + if (!aead->Seal(out + DTLS1_RT_HEADER_LENGTH, &len_copy, + max_out - DTLS1_RT_HEADER_LENGTH, type, record_version, + &out[3] /* seq */, header, in, in_len) || + !ssl_record_sequence_update(&seq[2], 6)) { + return false; + } + assert(ciphertext_len == len_copy); - return 1; + *out_len = DTLS1_RT_HEADER_LENGTH + ciphertext_len; + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, header); + return true; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/dtls_record.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc.grpc_back similarity index 92% rename from Pods/BoringSSL-GRPC/ssl/dtls_record.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc.grpc_back index 5e795fa37..992fb526b 100644 --- a/Pods/BoringSSL-GRPC/ssl/dtls_record.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/dtls_record.cc.grpc_back @@ -121,7 +121,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // to_u64_be treats |in| as a 8-byte big-endian integer and returns the value as // a |uint64_t|. @@ -137,13 +137,13 @@ static uint64_t to_u64_be(const uint8_t in[8]) { // dtls1_bitmap_should_discard returns one if |seq_num| has been seen in // |bitmap| or is stale. Otherwise it returns zero. -static int dtls1_bitmap_should_discard(DTLS1_BITMAP *bitmap, - const uint8_t seq_num[8]) { +static bool dtls1_bitmap_should_discard(DTLS1_BITMAP *bitmap, + const uint8_t seq_num[8]) { const unsigned kWindowSize = sizeof(bitmap->map) * 8; uint64_t seq_num_u = to_u64_be(seq_num); if (seq_num_u > bitmap->max_seq_num) { - return 0; + return false; } uint64_t idx = bitmap->max_seq_num - seq_num_u; return idx >= kWindowSize || (bitmap->map & (((uint64_t)1) << idx)); @@ -219,8 +219,8 @@ enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, return ssl_open_record_discard; } - ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, - in.subspan(0, DTLS1_RT_HEADER_LENGTH)); + Span header = in.subspan(0, DTLS1_RT_HEADER_LENGTH); + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, header); uint16_t epoch = (((uint16_t)sequence[0]) << 8) | sequence[1]; if (epoch != ssl->d1->r_epoch || @@ -235,7 +235,7 @@ enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, // discard the body in-place. if (!ssl->s3->aead_read_ctx->Open( - out, type, version, sequence, + out, type, version, sequence, header, MakeSpan(const_cast(CBS_data(&body)), CBS_len(&body)))) { // Bad packets are silently dropped in DTLS. See section 4.2.1 of RFC 6347. // Clear the error queue of any errors decryption may have added. Drop the @@ -291,14 +291,14 @@ size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch) { get_write_aead(ssl, use_epoch)->ExplicitNonceLen(); } -int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, - uint8_t type, const uint8_t *in, size_t in_len, - enum dtls1_use_epoch_t use_epoch) { +bool dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, + uint8_t type, const uint8_t *in, size_t in_len, + enum dtls1_use_epoch_t use_epoch) { const size_t prefix = dtls_seal_prefix_len(ssl, use_epoch); if (buffers_alias(in, in_len, out, max_out) && (max_out < prefix || out + prefix != in)) { OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); - return 0; + return false; } // Determine the parameters for the current epoch. @@ -314,7 +314,7 @@ int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, if (max_out < DTLS1_RT_HEADER_LENGTH) { OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); - return 0; + return false; } out[0] = type; @@ -328,26 +328,26 @@ int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, OPENSSL_memcpy(&out[5], &seq[2], 6); size_t ciphertext_len; - if (!aead->Seal(out + DTLS1_RT_HEADER_LENGTH, &ciphertext_len, - max_out - DTLS1_RT_HEADER_LENGTH, type, record_version, - &out[3] /* seq */, in, in_len) || - !ssl_record_sequence_update(&seq[2], 6)) { - return 0; - } - - if (ciphertext_len >= 1 << 16) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; + if (!aead->CiphertextLen(&ciphertext_len, in_len, 0)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); + return false; } out[11] = ciphertext_len >> 8; out[12] = ciphertext_len & 0xff; + Span header = MakeConstSpan(out, DTLS1_RT_HEADER_LENGTH); - *out_len = DTLS1_RT_HEADER_LENGTH + ciphertext_len; - - ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, - MakeSpan(out, DTLS1_RT_HEADER_LENGTH)); + size_t len_copy; + if (!aead->Seal(out + DTLS1_RT_HEADER_LENGTH, &len_copy, + max_out - DTLS1_RT_HEADER_LENGTH, type, record_version, + &out[3] /* seq */, header, in, in_len) || + !ssl_record_sequence_update(&seq[2], 6)) { + return false; + } + assert(ciphertext_len == len_copy); - return 1; + *out_len = DTLS1_RT_HEADER_LENGTH + ciphertext_len; + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, header); + return true; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/handoff.cc b/Pods/BoringSSL-GRPC/src/ssl/handoff.cc new file mode 100644 index 000000000..6881d0f81 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/handoff.cc @@ -0,0 +1,586 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +constexpr int kHandoffVersion = 0; +constexpr int kHandbackVersion = 0; + +// serialize_features adds a description of features supported by this binary to +// |out|. Returns true on success and false on error. +static bool serialize_features(CBB *out) { + CBB ciphers; + if (!CBB_add_asn1(out, &ciphers, CBS_ASN1_OCTETSTRING)) { + return false; + } + Span all_ciphers = AllCiphers(); + for (const SSL_CIPHER& cipher : all_ciphers) { + if (!CBB_add_u16(&ciphers, static_cast(cipher.id))) { + return false; + } + } + CBB curves; + if (!CBB_add_asn1(out, &curves, CBS_ASN1_OCTETSTRING)) { + return false; + } + for (const NamedGroup& g : NamedGroups()) { + if (!CBB_add_u16(&curves, g.group_id)) { + return false; + } + } + return CBB_flush(out); +} + +bool SSL_serialize_handoff(const SSL *ssl, CBB *out, + SSL_CLIENT_HELLO *out_hello) { + const SSL3_STATE *const s3 = ssl->s3; + if (!ssl->server || + s3->hs == nullptr || + s3->rwstate != SSL_ERROR_HANDOFF) { + return false; + } + + CBB seq; + SSLMessage msg; + Span transcript = s3->hs->transcript.buffer(); + if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&seq, kHandoffVersion) || + !CBB_add_asn1_octet_string(&seq, transcript.data(), transcript.size()) || + !CBB_add_asn1_octet_string(&seq, + reinterpret_cast(s3->hs_buf->data), + s3->hs_buf->length) || + !serialize_features(&seq) || + !CBB_flush(out) || + !ssl->method->get_message(ssl, &msg) || + !ssl_client_hello_init(ssl, out_hello, msg)) { + return false; + } + + return true; +} + +bool SSL_decline_handoff(SSL *ssl) { + const SSL3_STATE *const s3 = ssl->s3; + if (!ssl->server || + s3->hs == nullptr || + s3->rwstate != SSL_ERROR_HANDOFF) { + return false; + } + + s3->hs->config->handoff = false; + return true; +} + +// apply_remote_features reads a list of supported features from |in| and +// (possibly) reconfigures |ssl| to disallow the negotation of features whose +// support has not been indicated. (This prevents the the handshake from +// committing to features that are not supported on the handoff/handback side.) +static bool apply_remote_features(SSL *ssl, CBS *in) { + CBS ciphers; + if (!CBS_get_asn1(in, &ciphers, CBS_ASN1_OCTETSTRING)) { + return false; + } + bssl::UniquePtr supported(sk_SSL_CIPHER_new_null()); + while (CBS_len(&ciphers)) { + uint16_t id; + if (!CBS_get_u16(&ciphers, &id)) { + return false; + } + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(id); + if (!cipher) { + continue; + } + if (!sk_SSL_CIPHER_push(supported.get(), cipher)) { + return false; + } + } + STACK_OF(SSL_CIPHER) *configured = + ssl->config->cipher_list ? ssl->config->cipher_list->ciphers.get() + : ssl->ctx->cipher_list->ciphers.get(); + bssl::UniquePtr unsupported(sk_SSL_CIPHER_new_null()); + for (const SSL_CIPHER *configured_cipher : configured) { + if (sk_SSL_CIPHER_find(supported.get(), nullptr, configured_cipher)) { + continue; + } + if (!sk_SSL_CIPHER_push(unsupported.get(), configured_cipher)) { + return false; + } + } + if (sk_SSL_CIPHER_num(unsupported.get()) && !ssl->config->cipher_list) { + ssl->config->cipher_list = bssl::MakeUnique(); + if (!ssl->config->cipher_list->Init(*ssl->ctx->cipher_list)) { + return false; + } + } + for (const SSL_CIPHER *unsupported_cipher : unsupported.get()) { + ssl->config->cipher_list->Remove(unsupported_cipher); + } + if (sk_SSL_CIPHER_num(SSL_get_ciphers(ssl)) == 0) { + return false; + } + + CBS curves; + if (!CBS_get_asn1(in, &curves, CBS_ASN1_OCTETSTRING)) { + return false; + } + Array supported_curves; + if (!supported_curves.Init(CBS_len(&curves) / 2)) { + return false; + } + size_t idx = 0; + while (CBS_len(&curves)) { + uint16_t curve; + if (!CBS_get_u16(&curves, &curve)) { + return false; + } + supported_curves[idx++] = curve; + } + Span configured_curves = + tls1_get_grouplist(ssl->s3->hs.get()); + Array new_configured_curves; + if (!new_configured_curves.Init(configured_curves.size())) { + return false; + } + idx = 0; + for (uint16_t configured_curve : configured_curves) { + bool ok = false; + for (uint16_t supported_curve : supported_curves) { + if (supported_curve == configured_curve) { + ok = true; + break; + } + } + if (ok) { + new_configured_curves[idx++] = configured_curve; + } + } + if (idx == 0) { + return false; + } + new_configured_curves.Shrink(idx); + ssl->config->supported_group_list = std::move(new_configured_curves); + + return true; +} + +// uses_disallowed_feature returns true iff |ssl| enables a feature that +// disqualifies it for split handshakes. +static bool uses_disallowed_feature(const SSL *ssl) { + return ssl->method->is_dtls || (ssl->config->cert && ssl->config->cert->dc) || + ssl->config->quic_transport_params.size() > 0; +} + +bool SSL_apply_handoff(SSL *ssl, Span handoff) { + if (uses_disallowed_feature(ssl)) { + return false; + } + + CBS seq, handoff_cbs(handoff); + uint64_t handoff_version; + if (!CBS_get_asn1(&handoff_cbs, &seq, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&seq, &handoff_version) || + handoff_version != kHandoffVersion) { + return false; + } + + CBS transcript, hs_buf; + if (!CBS_get_asn1(&seq, &transcript, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &hs_buf, CBS_ASN1_OCTETSTRING) || + !apply_remote_features(ssl, &seq)) { + return false; + } + + SSL_set_accept_state(ssl); + + SSL3_STATE *const s3 = ssl->s3; + s3->v2_hello_done = true; + s3->has_message = true; + + s3->hs_buf.reset(BUF_MEM_new()); + if (!s3->hs_buf || + !BUF_MEM_append(s3->hs_buf.get(), CBS_data(&hs_buf), CBS_len(&hs_buf))) { + return false; + } + + if (CBS_len(&transcript) != 0) { + s3->hs->transcript.Update(transcript); + s3->is_v2_hello = true; + } + s3->hs->handback = true; + + return true; +} + +bool SSL_serialize_handback(const SSL *ssl, CBB *out) { + if (!ssl->server || uses_disallowed_feature(ssl)) { + return false; + } + const SSL3_STATE *const s3 = ssl->s3; + SSL_HANDSHAKE *const hs = s3->hs.get(); + handback_t type; + switch (hs->state) { + case state12_read_change_cipher_spec: + type = handback_after_session_resumption; + break; + case state12_read_client_certificate: + type = handback_after_ecdhe; + break; + case state12_finish_server_handshake: + type = handback_after_handshake; + break; + // The outer state machine is always in |state12_tls13| for a TLS 1.3 + // handshake as TLS 1.3 uses |tls13_state|. + case state12_tls13: + type = handback_tls13; + break; + default: + return false; + } + + size_t hostname_len = 0; + if (s3->hostname) { + hostname_len = strlen(s3->hostname.get()); + } + + Span transcript; + if (type == handback_after_ecdhe || + type == handback_after_session_resumption || type == handback_tls13) { + transcript = s3->hs->transcript.buffer(); + } + size_t write_iv_len = 0; + const uint8_t *write_iv = nullptr; + if ((type == handback_after_session_resumption || + type == handback_after_handshake) && + ssl->version == TLS1_VERSION && + SSL_CIPHER_is_block_cipher(s3->aead_write_ctx->cipher()) && + !s3->aead_write_ctx->GetIV(&write_iv, &write_iv_len)) { + return false; + } + size_t read_iv_len = 0; + const uint8_t *read_iv = nullptr; + if (type == handback_after_handshake && + ssl->version == TLS1_VERSION && + SSL_CIPHER_is_block_cipher(s3->aead_read_ctx->cipher()) && + !s3->aead_read_ctx->GetIV(&read_iv, &read_iv_len)) { + return false; + } + + // TODO(mab): make sure everything is serialized. + CBB seq, key_share; + const SSL_SESSION *session; + if (type == handback_tls13) { + session = hs->new_session.get(); + } else { + session = s3->session_reused ? ssl->session.get() : hs->new_session.get(); + } + if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&seq, kHandbackVersion) || + !CBB_add_asn1_uint64(&seq, type) || + !CBB_add_asn1_octet_string(&seq, s3->read_sequence, + sizeof(s3->read_sequence)) || + !CBB_add_asn1_octet_string(&seq, s3->write_sequence, + sizeof(s3->write_sequence)) || + !CBB_add_asn1_octet_string(&seq, s3->server_random, + sizeof(s3->server_random)) || + !CBB_add_asn1_octet_string(&seq, s3->client_random, + sizeof(s3->client_random)) || + !CBB_add_asn1_octet_string(&seq, read_iv, read_iv_len) || + !CBB_add_asn1_octet_string(&seq, write_iv, write_iv_len) || + !CBB_add_asn1_bool(&seq, s3->session_reused) || + !CBB_add_asn1_bool(&seq, s3->channel_id_valid) || + !ssl_session_serialize(session, &seq) || + !CBB_add_asn1_octet_string(&seq, s3->next_proto_negotiated.data(), + s3->next_proto_negotiated.size()) || + !CBB_add_asn1_octet_string(&seq, s3->alpn_selected.data(), + s3->alpn_selected.size()) || + !CBB_add_asn1_octet_string( + &seq, reinterpret_cast(s3->hostname.get()), + hostname_len) || + !CBB_add_asn1_octet_string(&seq, s3->channel_id, + sizeof(s3->channel_id)) || + !CBB_add_asn1_bool(&seq, ssl->s3->token_binding_negotiated) || + !CBB_add_asn1_uint64(&seq, ssl->s3->negotiated_token_binding_param) || + !CBB_add_asn1_bool(&seq, s3->hs->next_proto_neg_seen) || + !CBB_add_asn1_bool(&seq, s3->hs->cert_request) || + !CBB_add_asn1_bool(&seq, s3->hs->extended_master_secret) || + !CBB_add_asn1_bool(&seq, s3->hs->ticket_expected) || + !CBB_add_asn1_uint64(&seq, SSL_CIPHER_get_id(s3->hs->new_cipher)) || + !CBB_add_asn1_octet_string(&seq, transcript.data(), transcript.size()) || + !CBB_add_asn1(&seq, &key_share, CBS_ASN1_SEQUENCE)) { + return false; + } + if (type == handback_after_ecdhe && + !s3->hs->key_shares[0]->Serialize(&key_share)) { + return false; + } + if (type == handback_tls13) { + if (!CBB_add_asn1_octet_string(&seq, hs->client_traffic_secret_0().data(), + hs->client_traffic_secret_0().size()) || + !CBB_add_asn1_octet_string(&seq, hs->server_traffic_secret_0().data(), + hs->server_traffic_secret_0().size()) || + !CBB_add_asn1_octet_string(&seq, hs->client_handshake_secret().data(), + hs->client_handshake_secret().size()) || + !CBB_add_asn1_octet_string(&seq, hs->server_handshake_secret().data(), + hs->server_handshake_secret().size()) || + !CBB_add_asn1_octet_string(&seq, hs->secret().data(), + hs->secret().size()) || + !CBB_add_asn1_octet_string(&seq, s3->exporter_secret, + s3->exporter_secret_len) || + !CBB_add_asn1_bool(&seq, s3->used_hello_retry_request) || + !CBB_add_asn1_bool(&seq, hs->accept_psk_mode) || + !CBB_add_asn1_int64(&seq, s3->ticket_age_skew)) { + return false; + } + } + return CBB_flush(out); +} + +bool SSL_apply_handback(SSL *ssl, Span handback) { + if (ssl->do_handshake != nullptr || + ssl->method->is_dtls) { + return false; + } + + SSL3_STATE *const s3 = ssl->s3; + uint64_t handback_version, negotiated_token_binding_param, cipher, type; + + CBS seq, read_seq, write_seq, server_rand, client_rand, read_iv, write_iv, + next_proto, alpn, hostname, channel_id, transcript, key_share; + int session_reused, channel_id_valid, cert_request, extended_master_secret, + ticket_expected, token_binding_negotiated, next_proto_neg_seen; + SSL_SESSION *session = nullptr; + + CBS handback_cbs(handback); + if (!CBS_get_asn1(&handback_cbs, &seq, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&seq, &handback_version) || + handback_version != kHandbackVersion || + !CBS_get_asn1_uint64(&seq, &type)) { + return false; + } + + if (!CBS_get_asn1(&seq, &read_seq, CBS_ASN1_OCTETSTRING) || + CBS_len(&read_seq) != sizeof(s3->read_sequence) || + !CBS_get_asn1(&seq, &write_seq, CBS_ASN1_OCTETSTRING) || + CBS_len(&write_seq) != sizeof(s3->write_sequence) || + !CBS_get_asn1(&seq, &server_rand, CBS_ASN1_OCTETSTRING) || + CBS_len(&server_rand) != sizeof(s3->server_random) || + !CBS_copy_bytes(&server_rand, s3->server_random, + sizeof(s3->server_random)) || + !CBS_get_asn1(&seq, &client_rand, CBS_ASN1_OCTETSTRING) || + CBS_len(&client_rand) != sizeof(s3->client_random) || + !CBS_copy_bytes(&client_rand, s3->client_random, + sizeof(s3->client_random)) || + !CBS_get_asn1(&seq, &read_iv, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &write_iv, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_bool(&seq, &session_reused) || + !CBS_get_asn1_bool(&seq, &channel_id_valid)) { + return false; + } + + s3->hs = ssl_handshake_new(ssl); + SSL_HANDSHAKE *const hs = s3->hs.get(); + if (!session_reused || type == handback_tls13) { + hs->new_session = + SSL_SESSION_parse(&seq, ssl->ctx->x509_method, ssl->ctx->pool); + session = hs->new_session.get(); + } else { + ssl->session = + SSL_SESSION_parse(&seq, ssl->ctx->x509_method, ssl->ctx->pool); + session = ssl->session.get(); + } + + if (!session || !CBS_get_asn1(&seq, &next_proto, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &alpn, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &hostname, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &channel_id, CBS_ASN1_OCTETSTRING) || + CBS_len(&channel_id) != sizeof(s3->channel_id) || + !CBS_copy_bytes(&channel_id, s3->channel_id, + sizeof(s3->channel_id)) || + !CBS_get_asn1_bool(&seq, &token_binding_negotiated) || + !CBS_get_asn1_uint64(&seq, &negotiated_token_binding_param) || + !CBS_get_asn1_bool(&seq, &next_proto_neg_seen) || + !CBS_get_asn1_bool(&seq, &cert_request) || + !CBS_get_asn1_bool(&seq, &extended_master_secret) || + !CBS_get_asn1_bool(&seq, &ticket_expected) || + !CBS_get_asn1_uint64(&seq, &cipher)) { + return false; + } + if ((hs->new_cipher = + SSL_get_cipher_by_value(static_cast(cipher))) == nullptr) { + return false; + } + if (!CBS_get_asn1(&seq, &transcript, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &key_share, CBS_ASN1_SEQUENCE)) { + return false; + } + CBS client_handshake_secret, server_handshake_secret, client_traffic_secret_0, + server_traffic_secret_0, secret, exporter_secret; + if (type == handback_tls13) { + int used_hello_retry_request, accept_psk_mode; + int64_t ticket_age_skew; + if (!CBS_get_asn1(&seq, &client_traffic_secret_0, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &server_traffic_secret_0, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &client_handshake_secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &server_handshake_secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &exporter_secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_bool(&seq, &used_hello_retry_request) || + !CBS_get_asn1_bool(&seq, &accept_psk_mode) || + !CBS_get_asn1_int64(&seq, &ticket_age_skew)) { + return false; + } + if (ticket_age_skew > std::numeric_limits::max() || + ticket_age_skew < std::numeric_limits::min()) { + return false; + } + s3->ticket_age_skew = static_cast(ticket_age_skew); + s3->used_hello_retry_request = used_hello_retry_request; + hs->accept_psk_mode = accept_psk_mode; + } + + ssl->version = session->ssl_version; + s3->have_version = true; + if (!ssl_method_supports_version(ssl->method, ssl->version) || + session->cipher != hs->new_cipher || + ssl_protocol_version(ssl) < SSL_CIPHER_get_min_version(session->cipher) || + SSL_CIPHER_get_max_version(session->cipher) < ssl_protocol_version(ssl)) { + return false; + } + ssl->do_handshake = ssl_server_handshake; + ssl->server = true; + switch (type) { + case handback_after_session_resumption: + hs->state = state12_read_change_cipher_spec; + if (!session_reused) { + return false; + } + break; + case handback_after_ecdhe: + hs->state = state12_read_client_certificate; + if (session_reused) { + return false; + } + break; + case handback_after_handshake: + hs->state = state12_finish_server_handshake; + break; + case handback_tls13: + hs->state = state12_tls13; + hs->tls13_state = state13_read_client_certificate; + break; + default: + return false; + } + s3->session_reused = session_reused; + s3->channel_id_valid = channel_id_valid; + s3->next_proto_negotiated.CopyFrom(next_proto); + s3->alpn_selected.CopyFrom(alpn); + + const size_t hostname_len = CBS_len(&hostname); + if (hostname_len == 0) { + s3->hostname.reset(); + } else { + char *hostname_str = nullptr; + if (!CBS_strdup(&hostname, &hostname_str)) { + return false; + } + s3->hostname.reset(hostname_str); + } + + s3->token_binding_negotiated = token_binding_negotiated; + s3->negotiated_token_binding_param = + static_cast(negotiated_token_binding_param); + hs->next_proto_neg_seen = next_proto_neg_seen; + hs->wait = ssl_hs_flush; + hs->extended_master_secret = extended_master_secret; + hs->ticket_expected = ticket_expected; + s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + hs->cert_request = cert_request; + + // TODO(davidben): When handoff for TLS 1.3 is added, serialize + // |early_data_reason| and stabilize the constants. + s3->early_data_reason = ssl_early_data_protocol_version; + + if ((type == handback_after_ecdhe || + type == handback_after_session_resumption || type == handback_tls13) && + (!hs->transcript.Init() || + !hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !hs->transcript.Update(transcript))) { + return false; + } + if (type == handback_tls13) { + const size_t digest_len = hs->transcript.DigestLen(); + if (digest_len != CBS_len(&client_traffic_secret_0) || + digest_len != CBS_len(&server_traffic_secret_0) || + digest_len != CBS_len(&client_handshake_secret) || + digest_len != CBS_len(&server_handshake_secret) || + digest_len != CBS_len(&secret)) { + return false; + } + hs->ResizeSecrets(digest_len); + memcpy(hs->client_traffic_secret_0().data(), + CBS_data(&client_traffic_secret_0), digest_len); + memcpy(hs->server_traffic_secret_0().data(), + CBS_data(&server_traffic_secret_0), digest_len); + memcpy(hs->client_handshake_secret().data(), + CBS_data(&client_handshake_secret), digest_len); + memcpy(hs->server_handshake_secret().data(), + CBS_data(&server_handshake_secret), digest_len); + memcpy(hs->secret().data(), CBS_data(&secret), digest_len); + + if (digest_len != CBS_len(&exporter_secret)) { + return false; + } + memcpy(s3->exporter_secret, CBS_data(&exporter_secret), digest_len); + s3->exporter_secret_len = digest_len; + } + Array key_block; + if ((type == handback_after_session_resumption || + type == handback_after_handshake) && + (!tls1_configure_aead(ssl, evp_aead_seal, &key_block, session->cipher, + write_iv) || + !CBS_copy_bytes(&write_seq, s3->write_sequence, + sizeof(s3->write_sequence)))) { + return false; + } + if (type == handback_after_handshake && + (!tls1_configure_aead(ssl, evp_aead_open, &key_block, session->cipher, + read_iv) || + !CBS_copy_bytes(&read_seq, s3->read_sequence, + sizeof(s3->read_sequence)))) { + return false; + } + if (type == handback_tls13 && + (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->client_handshake_secret()) || + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_seal, + hs->server_traffic_secret_0()))) { + return false; + } + if (type == handback_after_ecdhe && + (hs->key_shares[0] = SSLKeyShare::Create(&key_share)) == nullptr) { + return false; + } + + return CBS_len(&seq) == 0; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/handoff.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/handoff.cc.grpc_back new file mode 100644 index 000000000..a9c08fe25 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/handoff.cc.grpc_back @@ -0,0 +1,586 @@ +/* Copyright (c) 2018, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +constexpr int kHandoffVersion = 0; +constexpr int kHandbackVersion = 0; + +// serialize_features adds a description of features supported by this binary to +// |out|. Returns true on success and false on error. +static bool serialize_features(CBB *out) { + CBB ciphers; + if (!CBB_add_asn1(out, &ciphers, CBS_ASN1_OCTETSTRING)) { + return false; + } + Span all_ciphers = AllCiphers(); + for (const SSL_CIPHER& cipher : all_ciphers) { + if (!CBB_add_u16(&ciphers, static_cast(cipher.id))) { + return false; + } + } + CBB curves; + if (!CBB_add_asn1(out, &curves, CBS_ASN1_OCTETSTRING)) { + return false; + } + for (const NamedGroup& g : NamedGroups()) { + if (!CBB_add_u16(&curves, g.group_id)) { + return false; + } + } + return CBB_flush(out); +} + +bool SSL_serialize_handoff(const SSL *ssl, CBB *out, + SSL_CLIENT_HELLO *out_hello) { + const SSL3_STATE *const s3 = ssl->s3; + if (!ssl->server || + s3->hs == nullptr || + s3->rwstate != SSL_ERROR_HANDOFF) { + return false; + } + + CBB seq; + SSLMessage msg; + Span transcript = s3->hs->transcript.buffer(); + if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&seq, kHandoffVersion) || + !CBB_add_asn1_octet_string(&seq, transcript.data(), transcript.size()) || + !CBB_add_asn1_octet_string(&seq, + reinterpret_cast(s3->hs_buf->data), + s3->hs_buf->length) || + !serialize_features(&seq) || + !CBB_flush(out) || + !ssl->method->get_message(ssl, &msg) || + !ssl_client_hello_init(ssl, out_hello, msg)) { + return false; + } + + return true; +} + +bool SSL_decline_handoff(SSL *ssl) { + const SSL3_STATE *const s3 = ssl->s3; + if (!ssl->server || + s3->hs == nullptr || + s3->rwstate != SSL_ERROR_HANDOFF) { + return false; + } + + s3->hs->config->handoff = false; + return true; +} + +// apply_remote_features reads a list of supported features from |in| and +// (possibly) reconfigures |ssl| to disallow the negotation of features whose +// support has not been indicated. (This prevents the the handshake from +// committing to features that are not supported on the handoff/handback side.) +static bool apply_remote_features(SSL *ssl, CBS *in) { + CBS ciphers; + if (!CBS_get_asn1(in, &ciphers, CBS_ASN1_OCTETSTRING)) { + return false; + } + bssl::UniquePtr supported(sk_SSL_CIPHER_new_null()); + while (CBS_len(&ciphers)) { + uint16_t id; + if (!CBS_get_u16(&ciphers, &id)) { + return false; + } + const SSL_CIPHER *cipher = SSL_get_cipher_by_value(id); + if (!cipher) { + continue; + } + if (!sk_SSL_CIPHER_push(supported.get(), cipher)) { + return false; + } + } + STACK_OF(SSL_CIPHER) *configured = + ssl->config->cipher_list ? ssl->config->cipher_list->ciphers.get() + : ssl->ctx->cipher_list->ciphers.get(); + bssl::UniquePtr unsupported(sk_SSL_CIPHER_new_null()); + for (const SSL_CIPHER *configured_cipher : configured) { + if (sk_SSL_CIPHER_find(supported.get(), nullptr, configured_cipher)) { + continue; + } + if (!sk_SSL_CIPHER_push(unsupported.get(), configured_cipher)) { + return false; + } + } + if (sk_SSL_CIPHER_num(unsupported.get()) && !ssl->config->cipher_list) { + ssl->config->cipher_list = bssl::MakeUnique(); + if (!ssl->config->cipher_list->Init(*ssl->ctx->cipher_list)) { + return false; + } + } + for (const SSL_CIPHER *unsupported_cipher : unsupported.get()) { + ssl->config->cipher_list->Remove(unsupported_cipher); + } + if (sk_SSL_CIPHER_num(SSL_get_ciphers(ssl)) == 0) { + return false; + } + + CBS curves; + if (!CBS_get_asn1(in, &curves, CBS_ASN1_OCTETSTRING)) { + return false; + } + Array supported_curves; + if (!supported_curves.Init(CBS_len(&curves) / 2)) { + return false; + } + size_t idx = 0; + while (CBS_len(&curves)) { + uint16_t curve; + if (!CBS_get_u16(&curves, &curve)) { + return false; + } + supported_curves[idx++] = curve; + } + Span configured_curves = + tls1_get_grouplist(ssl->s3->hs.get()); + Array new_configured_curves; + if (!new_configured_curves.Init(configured_curves.size())) { + return false; + } + idx = 0; + for (uint16_t configured_curve : configured_curves) { + bool ok = false; + for (uint16_t supported_curve : supported_curves) { + if (supported_curve == configured_curve) { + ok = true; + break; + } + } + if (ok) { + new_configured_curves[idx++] = configured_curve; + } + } + if (idx == 0) { + return false; + } + new_configured_curves.Shrink(idx); + ssl->config->supported_group_list = std::move(new_configured_curves); + + return true; +} + +// uses_disallowed_feature returns true iff |ssl| enables a feature that +// disqualifies it for split handshakes. +static bool uses_disallowed_feature(const SSL *ssl) { + return ssl->method->is_dtls || (ssl->config->cert && ssl->config->cert->dc) || + ssl->config->quic_transport_params.size() > 0; +} + +bool SSL_apply_handoff(SSL *ssl, Span handoff) { + if (uses_disallowed_feature(ssl)) { + return false; + } + + CBS seq, handoff_cbs(handoff); + uint64_t handoff_version; + if (!CBS_get_asn1(&handoff_cbs, &seq, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&seq, &handoff_version) || + handoff_version != kHandoffVersion) { + return false; + } + + CBS transcript, hs_buf; + if (!CBS_get_asn1(&seq, &transcript, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &hs_buf, CBS_ASN1_OCTETSTRING) || + !apply_remote_features(ssl, &seq)) { + return false; + } + + SSL_set_accept_state(ssl); + + SSL3_STATE *const s3 = ssl->s3; + s3->v2_hello_done = true; + s3->has_message = true; + + s3->hs_buf.reset(BUF_MEM_new()); + if (!s3->hs_buf || + !BUF_MEM_append(s3->hs_buf.get(), CBS_data(&hs_buf), CBS_len(&hs_buf))) { + return false; + } + + if (CBS_len(&transcript) != 0) { + s3->hs->transcript.Update(transcript); + s3->is_v2_hello = true; + } + s3->hs->handback = true; + + return true; +} + +bool SSL_serialize_handback(const SSL *ssl, CBB *out) { + if (!ssl->server || uses_disallowed_feature(ssl)) { + return false; + } + const SSL3_STATE *const s3 = ssl->s3; + SSL_HANDSHAKE *const hs = s3->hs.get(); + handback_t type; + switch (hs->state) { + case state12_read_change_cipher_spec: + type = handback_after_session_resumption; + break; + case state12_read_client_certificate: + type = handback_after_ecdhe; + break; + case state12_finish_server_handshake: + type = handback_after_handshake; + break; + // The outer state machine is always in |state12_tls13| for a TLS 1.3 + // handshake as TLS 1.3 uses |tls13_state|. + case state12_tls13: + type = handback_tls13; + break; + default: + return false; + } + + size_t hostname_len = 0; + if (s3->hostname) { + hostname_len = strlen(s3->hostname.get()); + } + + Span transcript; + if (type == handback_after_ecdhe || + type == handback_after_session_resumption || type == handback_tls13) { + transcript = s3->hs->transcript.buffer(); + } + size_t write_iv_len = 0; + const uint8_t *write_iv = nullptr; + if ((type == handback_after_session_resumption || + type == handback_after_handshake) && + ssl->version == TLS1_VERSION && + SSL_CIPHER_is_block_cipher(s3->aead_write_ctx->cipher()) && + !s3->aead_write_ctx->GetIV(&write_iv, &write_iv_len)) { + return false; + } + size_t read_iv_len = 0; + const uint8_t *read_iv = nullptr; + if (type == handback_after_handshake && + ssl->version == TLS1_VERSION && + SSL_CIPHER_is_block_cipher(s3->aead_read_ctx->cipher()) && + !s3->aead_read_ctx->GetIV(&read_iv, &read_iv_len)) { + return false; + } + + // TODO(mab): make sure everything is serialized. + CBB seq, key_share; + const SSL_SESSION *session; + if (type == handback_tls13) { + session = hs->new_session.get(); + } else { + session = s3->session_reused ? ssl->session.get() : hs->new_session.get(); + } + if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || + !CBB_add_asn1_uint64(&seq, kHandbackVersion) || + !CBB_add_asn1_uint64(&seq, type) || + !CBB_add_asn1_octet_string(&seq, s3->read_sequence, + sizeof(s3->read_sequence)) || + !CBB_add_asn1_octet_string(&seq, s3->write_sequence, + sizeof(s3->write_sequence)) || + !CBB_add_asn1_octet_string(&seq, s3->server_random, + sizeof(s3->server_random)) || + !CBB_add_asn1_octet_string(&seq, s3->client_random, + sizeof(s3->client_random)) || + !CBB_add_asn1_octet_string(&seq, read_iv, read_iv_len) || + !CBB_add_asn1_octet_string(&seq, write_iv, write_iv_len) || + !CBB_add_asn1_bool(&seq, s3->session_reused) || + !CBB_add_asn1_bool(&seq, s3->channel_id_valid) || + !ssl_session_serialize(session, &seq) || + !CBB_add_asn1_octet_string(&seq, s3->next_proto_negotiated.data(), + s3->next_proto_negotiated.size()) || + !CBB_add_asn1_octet_string(&seq, s3->alpn_selected.data(), + s3->alpn_selected.size()) || + !CBB_add_asn1_octet_string( + &seq, reinterpret_cast(s3->hostname.get()), + hostname_len) || + !CBB_add_asn1_octet_string(&seq, s3->channel_id, + sizeof(s3->channel_id)) || + !CBB_add_asn1_bool(&seq, ssl->s3->token_binding_negotiated) || + !CBB_add_asn1_uint64(&seq, ssl->s3->negotiated_token_binding_param) || + !CBB_add_asn1_bool(&seq, s3->hs->next_proto_neg_seen) || + !CBB_add_asn1_bool(&seq, s3->hs->cert_request) || + !CBB_add_asn1_bool(&seq, s3->hs->extended_master_secret) || + !CBB_add_asn1_bool(&seq, s3->hs->ticket_expected) || + !CBB_add_asn1_uint64(&seq, SSL_CIPHER_get_id(s3->hs->new_cipher)) || + !CBB_add_asn1_octet_string(&seq, transcript.data(), transcript.size()) || + !CBB_add_asn1(&seq, &key_share, CBS_ASN1_SEQUENCE)) { + return false; + } + if (type == handback_after_ecdhe && + !s3->hs->key_shares[0]->Serialize(&key_share)) { + return false; + } + if (type == handback_tls13) { + if (!CBB_add_asn1_octet_string(&seq, hs->client_traffic_secret_0().data(), + hs->client_traffic_secret_0().size()) || + !CBB_add_asn1_octet_string(&seq, hs->server_traffic_secret_0().data(), + hs->server_traffic_secret_0().size()) || + !CBB_add_asn1_octet_string(&seq, hs->client_handshake_secret().data(), + hs->client_handshake_secret().size()) || + !CBB_add_asn1_octet_string(&seq, hs->server_handshake_secret().data(), + hs->server_handshake_secret().size()) || + !CBB_add_asn1_octet_string(&seq, hs->secret().data(), + hs->secret().size()) || + !CBB_add_asn1_octet_string(&seq, s3->exporter_secret, + s3->exporter_secret_len) || + !CBB_add_asn1_bool(&seq, s3->used_hello_retry_request) || + !CBB_add_asn1_bool(&seq, hs->accept_psk_mode) || + !CBB_add_asn1_int64(&seq, s3->ticket_age_skew)) { + return false; + } + } + return CBB_flush(out); +} + +bool SSL_apply_handback(SSL *ssl, Span handback) { + if (ssl->do_handshake != nullptr || + ssl->method->is_dtls) { + return false; + } + + SSL3_STATE *const s3 = ssl->s3; + uint64_t handback_version, negotiated_token_binding_param, cipher, type; + + CBS seq, read_seq, write_seq, server_rand, client_rand, read_iv, write_iv, + next_proto, alpn, hostname, channel_id, transcript, key_share; + int session_reused, channel_id_valid, cert_request, extended_master_secret, + ticket_expected, token_binding_negotiated, next_proto_neg_seen; + SSL_SESSION *session = nullptr; + + CBS handback_cbs(handback); + if (!CBS_get_asn1(&handback_cbs, &seq, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1_uint64(&seq, &handback_version) || + handback_version != kHandbackVersion || + !CBS_get_asn1_uint64(&seq, &type)) { + return false; + } + + if (!CBS_get_asn1(&seq, &read_seq, CBS_ASN1_OCTETSTRING) || + CBS_len(&read_seq) != sizeof(s3->read_sequence) || + !CBS_get_asn1(&seq, &write_seq, CBS_ASN1_OCTETSTRING) || + CBS_len(&write_seq) != sizeof(s3->write_sequence) || + !CBS_get_asn1(&seq, &server_rand, CBS_ASN1_OCTETSTRING) || + CBS_len(&server_rand) != sizeof(s3->server_random) || + !CBS_copy_bytes(&server_rand, s3->server_random, + sizeof(s3->server_random)) || + !CBS_get_asn1(&seq, &client_rand, CBS_ASN1_OCTETSTRING) || + CBS_len(&client_rand) != sizeof(s3->client_random) || + !CBS_copy_bytes(&client_rand, s3->client_random, + sizeof(s3->client_random)) || + !CBS_get_asn1(&seq, &read_iv, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &write_iv, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_bool(&seq, &session_reused) || + !CBS_get_asn1_bool(&seq, &channel_id_valid)) { + return false; + } + + s3->hs = ssl_handshake_new(ssl); + SSL_HANDSHAKE *const hs = s3->hs.get(); + if (!session_reused || type == handback_tls13) { + hs->new_session = + SSL_SESSION_parse(&seq, ssl->ctx->x509_method, ssl->ctx->pool); + session = hs->new_session.get(); + } else { + ssl->session = + SSL_SESSION_parse(&seq, ssl->ctx->x509_method, ssl->ctx->pool); + session = ssl->session.get(); + } + + if (!session || !CBS_get_asn1(&seq, &next_proto, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &alpn, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &hostname, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &channel_id, CBS_ASN1_OCTETSTRING) || + CBS_len(&channel_id) != sizeof(s3->channel_id) || + !CBS_copy_bytes(&channel_id, s3->channel_id, + sizeof(s3->channel_id)) || + !CBS_get_asn1_bool(&seq, &token_binding_negotiated) || + !CBS_get_asn1_uint64(&seq, &negotiated_token_binding_param) || + !CBS_get_asn1_bool(&seq, &next_proto_neg_seen) || + !CBS_get_asn1_bool(&seq, &cert_request) || + !CBS_get_asn1_bool(&seq, &extended_master_secret) || + !CBS_get_asn1_bool(&seq, &ticket_expected) || + !CBS_get_asn1_uint64(&seq, &cipher)) { + return false; + } + if ((hs->new_cipher = + SSL_get_cipher_by_value(static_cast(cipher))) == nullptr) { + return false; + } + if (!CBS_get_asn1(&seq, &transcript, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &key_share, CBS_ASN1_SEQUENCE)) { + return false; + } + CBS client_handshake_secret, server_handshake_secret, client_traffic_secret_0, + server_traffic_secret_0, secret, exporter_secret; + if (type == handback_tls13) { + int used_hello_retry_request, accept_psk_mode; + int64_t ticket_age_skew; + if (!CBS_get_asn1(&seq, &client_traffic_secret_0, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &server_traffic_secret_0, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &client_handshake_secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &server_handshake_secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1(&seq, &exporter_secret, CBS_ASN1_OCTETSTRING) || + !CBS_get_asn1_bool(&seq, &used_hello_retry_request) || + !CBS_get_asn1_bool(&seq, &accept_psk_mode) || + !CBS_get_asn1_int64(&seq, &ticket_age_skew)) { + return false; + } + if (ticket_age_skew > std::numeric_limits::max() || + ticket_age_skew < std::numeric_limits::min()) { + return false; + } + s3->ticket_age_skew = static_cast(ticket_age_skew); + s3->used_hello_retry_request = used_hello_retry_request; + hs->accept_psk_mode = accept_psk_mode; + } + + ssl->version = session->ssl_version; + s3->have_version = true; + if (!ssl_method_supports_version(ssl->method, ssl->version) || + session->cipher != hs->new_cipher || + ssl_protocol_version(ssl) < SSL_CIPHER_get_min_version(session->cipher) || + SSL_CIPHER_get_max_version(session->cipher) < ssl_protocol_version(ssl)) { + return false; + } + ssl->do_handshake = ssl_server_handshake; + ssl->server = true; + switch (type) { + case handback_after_session_resumption: + hs->state = state12_read_change_cipher_spec; + if (!session_reused) { + return false; + } + break; + case handback_after_ecdhe: + hs->state = state12_read_client_certificate; + if (session_reused) { + return false; + } + break; + case handback_after_handshake: + hs->state = state12_finish_server_handshake; + break; + case handback_tls13: + hs->state = state12_tls13; + hs->tls13_state = state13_read_client_certificate; + break; + default: + return false; + } + s3->session_reused = session_reused; + s3->channel_id_valid = channel_id_valid; + s3->next_proto_negotiated.CopyFrom(next_proto); + s3->alpn_selected.CopyFrom(alpn); + + const size_t hostname_len = CBS_len(&hostname); + if (hostname_len == 0) { + s3->hostname.reset(); + } else { + char *hostname_str = nullptr; + if (!CBS_strdup(&hostname, &hostname_str)) { + return false; + } + s3->hostname.reset(hostname_str); + } + + s3->token_binding_negotiated = token_binding_negotiated; + s3->negotiated_token_binding_param = + static_cast(negotiated_token_binding_param); + hs->next_proto_neg_seen = next_proto_neg_seen; + hs->wait = ssl_hs_flush; + hs->extended_master_secret = extended_master_secret; + hs->ticket_expected = ticket_expected; + s3->aead_write_ctx->SetVersionIfNullCipher(ssl->version); + hs->cert_request = cert_request; + + // TODO(davidben): When handoff for TLS 1.3 is added, serialize + // |early_data_reason| and stabilize the constants. + s3->early_data_reason = ssl_early_data_protocol_version; + + if ((type == handback_after_ecdhe || + type == handback_after_session_resumption || type == handback_tls13) && + (!hs->transcript.Init() || + !hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher) || + !hs->transcript.Update(transcript))) { + return false; + } + if (type == handback_tls13) { + const size_t digest_len = hs->transcript.DigestLen(); + if (digest_len != CBS_len(&client_traffic_secret_0) || + digest_len != CBS_len(&server_traffic_secret_0) || + digest_len != CBS_len(&client_handshake_secret) || + digest_len != CBS_len(&server_handshake_secret) || + digest_len != CBS_len(&secret)) { + return false; + } + hs->ResizeSecrets(digest_len); + memcpy(hs->client_traffic_secret_0().data(), + CBS_data(&client_traffic_secret_0), digest_len); + memcpy(hs->server_traffic_secret_0().data(), + CBS_data(&server_traffic_secret_0), digest_len); + memcpy(hs->client_handshake_secret().data(), + CBS_data(&client_handshake_secret), digest_len); + memcpy(hs->server_handshake_secret().data(), + CBS_data(&server_handshake_secret), digest_len); + memcpy(hs->secret().data(), CBS_data(&secret), digest_len); + + if (digest_len != CBS_len(&exporter_secret)) { + return false; + } + memcpy(s3->exporter_secret, CBS_data(&exporter_secret), digest_len); + s3->exporter_secret_len = digest_len; + } + Array key_block; + if ((type == handback_after_session_resumption || + type == handback_after_handshake) && + (!tls1_configure_aead(ssl, evp_aead_seal, &key_block, session->cipher, + write_iv) || + !CBS_copy_bytes(&write_seq, s3->write_sequence, + sizeof(s3->write_sequence)))) { + return false; + } + if (type == handback_after_handshake && + (!tls1_configure_aead(ssl, evp_aead_open, &key_block, session->cipher, + read_iv) || + !CBS_copy_bytes(&read_seq, s3->read_sequence, + sizeof(s3->read_sequence)))) { + return false; + } + if (type == handback_tls13 && + (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->client_handshake_secret()) || + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_seal, + hs->server_traffic_secret_0()))) { + return false; + } + if (type == handback_after_ecdhe && + (hs->key_shares[0] = SSLKeyShare::Create(&key_share)) == nullptr) { + return false; + } + + return CBS_len(&seq) == 0; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/handshake.cc b/Pods/BoringSSL-GRPC/src/ssl/handshake.cc similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/handshake.cc rename to Pods/BoringSSL-GRPC/src/ssl/handshake.cc index 610ae36e4..24d761fe5 100644 --- a/Pods/BoringSSL-GRPC/ssl/handshake.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/handshake.cc @@ -122,20 +122,18 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg) : ssl(ssl_arg), scts_requested(false), needs_psk_binder(false), - received_hello_retry_request(false), - sent_hello_retry_request(false), - received_custom_extension(false), handshake_finalized(false), accept_psk_mode(false), cert_request(false), certificate_status_expected(false), ocsp_stapling_requested(false), + delegated_credential_requested(false), should_ack_sni(false), in_false_start(false), in_early_data(false), @@ -146,17 +144,32 @@ SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg) ticket_expected(false), extended_master_secret(false), pending_private_key_op(false), - grease_seeded(false) { + grease_seeded(false), + handback(false), + cert_compression_negotiated(false), + apply_jdk11_workaround(false) { + assert(ssl); } SSL_HANDSHAKE::~SSL_HANDSHAKE() { ssl->ctx->x509_method->hs_flush_cached_ca_names(this); } +void SSL_HANDSHAKE::ResizeSecrets(size_t hash_len) { + if (hash_len > SSL_MAX_MD_SIZE) { + abort(); + } + hash_len_ = hash_len; +} + UniquePtr ssl_handshake_new(SSL *ssl) { UniquePtr hs = MakeUnique(ssl); - if (!hs || - !hs->transcript.Init()) { + if (!hs || !hs->transcript.Init()) { + return nullptr; + } + hs->config = ssl->config.get(); + if (!hs->config) { + assert(hs->config); return nullptr; } return hs; @@ -189,7 +202,8 @@ size_t ssl_max_handshake_message_len(const SSL *ssl) { static const size_t kMaxMessageLen = 16384; if (SSL_in_init(ssl)) { - if ((!ssl->server || (ssl->verify_mode & SSL_VERIFY_PEER)) && + SSL_CONFIG *config = ssl->config.get(); // SSL_in_init() implies not NULL. + if ((!ssl->server || (config->verify_mode & SSL_VERIFY_PEER)) && kMaxMessageLen < ssl->max_cert_list) { return ssl->max_cert_list; } @@ -272,16 +286,6 @@ int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert, return 1; } -static void set_crypto_buffer(CRYPTO_BUFFER **dest, CRYPTO_BUFFER *src) { - // TODO(davidben): Remove this helper once |SSL_SESSION| can use |UniquePtr| - // and |UniquePtr| has up_ref helpers. - CRYPTO_BUFFER_free(*dest); - *dest = src; - if (src != nullptr) { - CRYPTO_BUFFER_up_ref(src); - } -} - enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; const SSL_SESSION *prev_session = ssl->s3->established_session.get(); @@ -291,18 +295,19 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { // so this check is sufficient to ensure the reported peer certificate never // changes on renegotiation. assert(!ssl->server); - if (sk_CRYPTO_BUFFER_num(prev_session->certs) != - sk_CRYPTO_BUFFER_num(hs->new_session->certs)) { + if (sk_CRYPTO_BUFFER_num(prev_session->certs.get()) != + sk_CRYPTO_BUFFER_num(hs->new_session->certs.get())) { OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_CERT_CHANGED); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_verify_invalid; } - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(hs->new_session->certs); i++) { + for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()); + i++) { const CRYPTO_BUFFER *old_cert = - sk_CRYPTO_BUFFER_value(prev_session->certs, i); + sk_CRYPTO_BUFFER_value(prev_session->certs.get(), i); const CRYPTO_BUFFER *new_cert = - sk_CRYPTO_BUFFER_value(hs->new_session->certs, i); + sk_CRYPTO_BUFFER_value(hs->new_session->certs.get(), i); if (CRYPTO_BUFFER_len(old_cert) != CRYPTO_BUFFER_len(new_cert) || OPENSSL_memcmp(CRYPTO_BUFFER_data(old_cert), CRYPTO_BUFFER_data(new_cert), @@ -317,25 +322,24 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { // certificate. Since we only authenticated the previous one, copy other // authentication from the established session and ignore what was newly // received. - set_crypto_buffer(&hs->new_session->ocsp_response, - prev_session->ocsp_response); - set_crypto_buffer(&hs->new_session->signed_cert_timestamp_list, - prev_session->signed_cert_timestamp_list); + hs->new_session->ocsp_response = UpRef(prev_session->ocsp_response); + hs->new_session->signed_cert_timestamp_list = + UpRef(prev_session->signed_cert_timestamp_list); hs->new_session->verify_result = prev_session->verify_result; return ssl_verify_ok; } uint8_t alert = SSL_AD_CERTIFICATE_UNKNOWN; enum ssl_verify_result_t ret; - if (ssl->custom_verify_callback != nullptr) { - ret = ssl->custom_verify_callback(ssl, &alert); + if (hs->config->custom_verify_callback != nullptr) { + ret = hs->config->custom_verify_callback(ssl, &alert); switch (ret) { case ssl_verify_ok: hs->new_session->verify_result = X509_V_OK; break; case ssl_verify_invalid: // If |SSL_VERIFY_NONE|, the error is non-fatal, but we keep the result. - if (ssl->verify_mode == SSL_VERIFY_NONE) { + if (hs->config->verify_mode == SSL_VERIFY_NONE) { ERR_clear_error(); ret = ssl_verify_ok; } @@ -346,7 +350,7 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { } } else { ret = ssl->ctx->x509_method->session_verify_cert_chain( - hs->new_session.get(), ssl, &alert) + hs->new_session.get(), hs, &alert) ? ssl_verify_ok : ssl_verify_invalid; } @@ -356,6 +360,51 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); } + // Emulate OpenSSL's client OCSP callback. OpenSSL verifies certificates + // before it receives the OCSP, so it needs a second callback for OCSP. + if (ret == ssl_verify_ok && !ssl->server && + hs->config->ocsp_stapling_enabled && + ssl->ctx->legacy_ocsp_callback != nullptr) { + int cb_ret = + ssl->ctx->legacy_ocsp_callback(ssl, ssl->ctx->legacy_ocsp_callback_arg); + if (cb_ret <= 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OCSP_CB_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, + cb_ret == 0 ? SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE + : SSL_AD_INTERNAL_ERROR); + ret = ssl_verify_invalid; + } + } + + return ret; +} + +// Verifies a stored certificate when resuming a session. A few things are +// different from verify_peer_cert: +// 1. We can't be renegotiating if we're resuming a session. +// 2. The session is immutable, so we don't support verify_mode == +// SSL_VERIFY_NONE +// 3. We don't call the OCSP callback. +// 4. We only support custom verify callbacks. +enum ssl_verify_result_t ssl_reverify_peer_cert(SSL_HANDSHAKE *hs, + bool send_alert) { + SSL *const ssl = hs->ssl; + assert(ssl->s3->established_session == nullptr); + assert(hs->config->verify_mode != SSL_VERIFY_NONE); + + uint8_t alert = SSL_AD_CERTIFICATE_UNKNOWN; + enum ssl_verify_result_t ret = ssl_verify_invalid; + if (hs->config->custom_verify_callback != nullptr) { + ret = hs->config->custom_verify_callback(ssl, &alert); + } + + if (ret == ssl_verify_invalid) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_VERIFY_FAILED); + if (send_alert) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + } + } + return ret; } @@ -408,20 +457,18 @@ enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs) { } // Copy the Finished so we can use it for renegotiation checks. - if (ssl->version != SSL3_VERSION) { - if (finished_len > sizeof(ssl->s3->previous_client_finished) || - finished_len > sizeof(ssl->s3->previous_server_finished)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_hs_error; - } + if (finished_len > sizeof(ssl->s3->previous_client_finished) || + finished_len > sizeof(ssl->s3->previous_server_finished)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } - if (ssl->server) { - OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); - ssl->s3->previous_client_finished_len = finished_len; - } else { - OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); - ssl->s3->previous_server_finished_len = finished_len; - } + if (ssl->server) { + OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); + ssl->s3->previous_client_finished_len = finished_len; + } else { + OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); + ssl->s3->previous_server_finished_len = finished_len; } ssl->method->next_message(ssl); @@ -440,27 +487,25 @@ bool ssl_send_finished(SSL_HANDSHAKE *hs) { } // Log the master secret, if logging is enabled. - if (!ssl_log_secret(ssl, "CLIENT_RANDOM", - session->master_key, - session->master_key_length)) { + if (!ssl_log_secret( + ssl, "CLIENT_RANDOM", + MakeConstSpan(session->master_key, session->master_key_length))) { return 0; } // Copy the Finished so we can use it for renegotiation checks. - if (ssl->version != SSL3_VERSION) { - if (finished_len > sizeof(ssl->s3->previous_client_finished) || - finished_len > sizeof(ssl->s3->previous_server_finished)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } + if (finished_len > sizeof(ssl->s3->previous_client_finished) || + finished_len > sizeof(ssl->s3->previous_server_finished)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } - if (ssl->server) { - OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); - ssl->s3->previous_server_finished_len = finished_len; - } else { - OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); - ssl->s3->previous_client_finished_len = finished_len; - } + if (ssl->server) { + OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); + ssl->s3->previous_server_finished_len = finished_len; + } else { + OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); + ssl->s3->previous_client_finished_len = finished_len; } ScopedCBB cbb; @@ -475,12 +520,13 @@ bool ssl_send_finished(SSL_HANDSHAKE *hs) { return 1; } -bool ssl_output_cert_chain(SSL *ssl) { +bool ssl_output_cert_chain(SSL_HANDSHAKE *hs) { ScopedCBB cbb; CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CERTIFICATE) || - !ssl_add_cert_chain(ssl, &body) || - !ssl_add_message_cbb(ssl, cbb.get())) { + if (!hs->ssl->method->init_message(hs->ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE) || + !ssl_add_cert_chain(hs, &body) || + !ssl_add_message_cbb(hs->ssl, cbb.get())) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return false; } @@ -508,6 +554,16 @@ int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { case ssl_hs_read_server_hello: case ssl_hs_read_message: case ssl_hs_read_change_cipher_spec: { + if (ssl->quic_method) { + hs->wait = ssl_hs_ok; + // The change cipher spec is omitted in QUIC. + if (hs->wait != ssl_hs_read_change_cipher_spec) { + ssl->s3->rwstate = SSL_ERROR_WANT_READ; + return -1; + } + break; + } + uint8_t alert = SSL_AD_DECODE_ERROR; size_t consumed = 0; ssl_open_record_t ret; @@ -556,47 +612,53 @@ int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { } case ssl_hs_certificate_selection_pending: - ssl->s3->rwstate = SSL_CERTIFICATE_SELECTION_PENDING; + ssl->s3->rwstate = SSL_ERROR_PENDING_CERTIFICATE; hs->wait = ssl_hs_ok; return -1; case ssl_hs_handoff: - ssl->s3->rwstate = SSL_HANDOFF; + ssl->s3->rwstate = SSL_ERROR_HANDOFF; hs->wait = ssl_hs_ok; return -1; + case ssl_hs_handback: + ssl->s3->rwstate = SSL_ERROR_HANDBACK; + hs->wait = ssl_hs_handback; + return -1; + case ssl_hs_x509_lookup: - ssl->s3->rwstate = SSL_X509_LOOKUP; + ssl->s3->rwstate = SSL_ERROR_WANT_X509_LOOKUP; hs->wait = ssl_hs_ok; return -1; case ssl_hs_channel_id_lookup: - ssl->s3->rwstate = SSL_CHANNEL_ID_LOOKUP; + ssl->s3->rwstate = SSL_ERROR_WANT_CHANNEL_ID_LOOKUP; hs->wait = ssl_hs_ok; return -1; case ssl_hs_private_key_operation: - ssl->s3->rwstate = SSL_PRIVATE_KEY_OPERATION; + ssl->s3->rwstate = SSL_ERROR_WANT_PRIVATE_KEY_OPERATION; hs->wait = ssl_hs_ok; return -1; case ssl_hs_pending_session: - ssl->s3->rwstate = SSL_PENDING_SESSION; + ssl->s3->rwstate = SSL_ERROR_PENDING_SESSION; hs->wait = ssl_hs_ok; return -1; case ssl_hs_pending_ticket: - ssl->s3->rwstate = SSL_PENDING_TICKET; + ssl->s3->rwstate = SSL_ERROR_PENDING_TICKET; hs->wait = ssl_hs_ok; return -1; case ssl_hs_certificate_verify: - ssl->s3->rwstate = SSL_CERTIFICATE_VERIFY; + ssl->s3->rwstate = SSL_ERROR_WANT_CERTIFICATE_VERIFY; hs->wait = ssl_hs_ok; return -1; case ssl_hs_early_data_rejected: - ssl->s3->rwstate = SSL_EARLY_DATA_REJECTED; + assert(ssl->s3->early_data_reason != ssl_early_data_unknown); + ssl->s3->rwstate = SSL_ERROR_EARLY_DATA_REJECTED; // Cause |SSL_write| to start failing immediately. hs->can_early_write = false; return -1; @@ -627,4 +689,4 @@ int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { } } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/handshake.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/handshake.cc.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/handshake.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/handshake.cc.grpc_back index 64324245d..33efc81df 100644 --- a/Pods/BoringSSL-GRPC/ssl/handshake.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/handshake.cc.grpc_back @@ -122,20 +122,18 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg) : ssl(ssl_arg), scts_requested(false), needs_psk_binder(false), - received_hello_retry_request(false), - sent_hello_retry_request(false), - received_custom_extension(false), handshake_finalized(false), accept_psk_mode(false), cert_request(false), certificate_status_expected(false), ocsp_stapling_requested(false), + delegated_credential_requested(false), should_ack_sni(false), in_false_start(false), in_early_data(false), @@ -146,17 +144,32 @@ SSL_HANDSHAKE::SSL_HANDSHAKE(SSL *ssl_arg) ticket_expected(false), extended_master_secret(false), pending_private_key_op(false), - grease_seeded(false) { + grease_seeded(false), + handback(false), + cert_compression_negotiated(false), + apply_jdk11_workaround(false) { + assert(ssl); } SSL_HANDSHAKE::~SSL_HANDSHAKE() { ssl->ctx->x509_method->hs_flush_cached_ca_names(this); } +void SSL_HANDSHAKE::ResizeSecrets(size_t hash_len) { + if (hash_len > SSL_MAX_MD_SIZE) { + abort(); + } + hash_len_ = hash_len; +} + UniquePtr ssl_handshake_new(SSL *ssl) { UniquePtr hs = MakeUnique(ssl); - if (!hs || - !hs->transcript.Init()) { + if (!hs || !hs->transcript.Init()) { + return nullptr; + } + hs->config = ssl->config.get(); + if (!hs->config) { + assert(hs->config); return nullptr; } return hs; @@ -189,7 +202,8 @@ size_t ssl_max_handshake_message_len(const SSL *ssl) { static const size_t kMaxMessageLen = 16384; if (SSL_in_init(ssl)) { - if ((!ssl->server || (ssl->verify_mode & SSL_VERIFY_PEER)) && + SSL_CONFIG *config = ssl->config.get(); // SSL_in_init() implies not NULL. + if ((!ssl->server || (config->verify_mode & SSL_VERIFY_PEER)) && kMaxMessageLen < ssl->max_cert_list) { return ssl->max_cert_list; } @@ -272,16 +286,6 @@ int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert, return 1; } -static void set_crypto_buffer(CRYPTO_BUFFER **dest, CRYPTO_BUFFER *src) { - // TODO(davidben): Remove this helper once |SSL_SESSION| can use |UniquePtr| - // and |UniquePtr| has up_ref helpers. - CRYPTO_BUFFER_free(*dest); - *dest = src; - if (src != nullptr) { - CRYPTO_BUFFER_up_ref(src); - } -} - enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; const SSL_SESSION *prev_session = ssl->s3->established_session.get(); @@ -291,18 +295,19 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { // so this check is sufficient to ensure the reported peer certificate never // changes on renegotiation. assert(!ssl->server); - if (sk_CRYPTO_BUFFER_num(prev_session->certs) != - sk_CRYPTO_BUFFER_num(hs->new_session->certs)) { + if (sk_CRYPTO_BUFFER_num(prev_session->certs.get()) != + sk_CRYPTO_BUFFER_num(hs->new_session->certs.get())) { OPENSSL_PUT_ERROR(SSL, SSL_R_SERVER_CERT_CHANGED); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_verify_invalid; } - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(hs->new_session->certs); i++) { + for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()); + i++) { const CRYPTO_BUFFER *old_cert = - sk_CRYPTO_BUFFER_value(prev_session->certs, i); + sk_CRYPTO_BUFFER_value(prev_session->certs.get(), i); const CRYPTO_BUFFER *new_cert = - sk_CRYPTO_BUFFER_value(hs->new_session->certs, i); + sk_CRYPTO_BUFFER_value(hs->new_session->certs.get(), i); if (CRYPTO_BUFFER_len(old_cert) != CRYPTO_BUFFER_len(new_cert) || OPENSSL_memcmp(CRYPTO_BUFFER_data(old_cert), CRYPTO_BUFFER_data(new_cert), @@ -317,25 +322,24 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { // certificate. Since we only authenticated the previous one, copy other // authentication from the established session and ignore what was newly // received. - set_crypto_buffer(&hs->new_session->ocsp_response, - prev_session->ocsp_response); - set_crypto_buffer(&hs->new_session->signed_cert_timestamp_list, - prev_session->signed_cert_timestamp_list); + hs->new_session->ocsp_response = UpRef(prev_session->ocsp_response); + hs->new_session->signed_cert_timestamp_list = + UpRef(prev_session->signed_cert_timestamp_list); hs->new_session->verify_result = prev_session->verify_result; return ssl_verify_ok; } uint8_t alert = SSL_AD_CERTIFICATE_UNKNOWN; enum ssl_verify_result_t ret; - if (ssl->custom_verify_callback != nullptr) { - ret = ssl->custom_verify_callback(ssl, &alert); + if (hs->config->custom_verify_callback != nullptr) { + ret = hs->config->custom_verify_callback(ssl, &alert); switch (ret) { case ssl_verify_ok: hs->new_session->verify_result = X509_V_OK; break; case ssl_verify_invalid: // If |SSL_VERIFY_NONE|, the error is non-fatal, but we keep the result. - if (ssl->verify_mode == SSL_VERIFY_NONE) { + if (hs->config->verify_mode == SSL_VERIFY_NONE) { ERR_clear_error(); ret = ssl_verify_ok; } @@ -346,7 +350,7 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { } } else { ret = ssl->ctx->x509_method->session_verify_cert_chain( - hs->new_session.get(), ssl, &alert) + hs->new_session.get(), hs, &alert) ? ssl_verify_ok : ssl_verify_invalid; } @@ -356,6 +360,51 @@ enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); } + // Emulate OpenSSL's client OCSP callback. OpenSSL verifies certificates + // before it receives the OCSP, so it needs a second callback for OCSP. + if (ret == ssl_verify_ok && !ssl->server && + hs->config->ocsp_stapling_enabled && + ssl->ctx->legacy_ocsp_callback != nullptr) { + int cb_ret = + ssl->ctx->legacy_ocsp_callback(ssl, ssl->ctx->legacy_ocsp_callback_arg); + if (cb_ret <= 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_OCSP_CB_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, + cb_ret == 0 ? SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE + : SSL_AD_INTERNAL_ERROR); + ret = ssl_verify_invalid; + } + } + + return ret; +} + +// Verifies a stored certificate when resuming a session. A few things are +// different from verify_peer_cert: +// 1. We can't be renegotiating if we're resuming a session. +// 2. The session is immutable, so we don't support verify_mode == +// SSL_VERIFY_NONE +// 3. We don't call the OCSP callback. +// 4. We only support custom verify callbacks. +enum ssl_verify_result_t ssl_reverify_peer_cert(SSL_HANDSHAKE *hs, + bool send_alert) { + SSL *const ssl = hs->ssl; + assert(ssl->s3->established_session == nullptr); + assert(hs->config->verify_mode != SSL_VERIFY_NONE); + + uint8_t alert = SSL_AD_CERTIFICATE_UNKNOWN; + enum ssl_verify_result_t ret = ssl_verify_invalid; + if (hs->config->custom_verify_callback != nullptr) { + ret = hs->config->custom_verify_callback(ssl, &alert); + } + + if (ret == ssl_verify_invalid) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_VERIFY_FAILED); + if (send_alert) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + } + } + return ret; } @@ -408,20 +457,18 @@ enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs) { } // Copy the Finished so we can use it for renegotiation checks. - if (ssl->version != SSL3_VERSION) { - if (finished_len > sizeof(ssl->s3->previous_client_finished) || - finished_len > sizeof(ssl->s3->previous_server_finished)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_hs_error; - } + if (finished_len > sizeof(ssl->s3->previous_client_finished) || + finished_len > sizeof(ssl->s3->previous_server_finished)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } - if (ssl->server) { - OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); - ssl->s3->previous_client_finished_len = finished_len; - } else { - OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); - ssl->s3->previous_server_finished_len = finished_len; - } + if (ssl->server) { + OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); + ssl->s3->previous_client_finished_len = finished_len; + } else { + OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); + ssl->s3->previous_server_finished_len = finished_len; } ssl->method->next_message(ssl); @@ -440,27 +487,25 @@ bool ssl_send_finished(SSL_HANDSHAKE *hs) { } // Log the master secret, if logging is enabled. - if (!ssl_log_secret(ssl, "CLIENT_RANDOM", - session->master_key, - session->master_key_length)) { + if (!ssl_log_secret( + ssl, "CLIENT_RANDOM", + MakeConstSpan(session->master_key, session->master_key_length))) { return 0; } // Copy the Finished so we can use it for renegotiation checks. - if (ssl->version != SSL3_VERSION) { - if (finished_len > sizeof(ssl->s3->previous_client_finished) || - finished_len > sizeof(ssl->s3->previous_server_finished)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } + if (finished_len > sizeof(ssl->s3->previous_client_finished) || + finished_len > sizeof(ssl->s3->previous_server_finished)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } - if (ssl->server) { - OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); - ssl->s3->previous_server_finished_len = finished_len; - } else { - OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); - ssl->s3->previous_client_finished_len = finished_len; - } + if (ssl->server) { + OPENSSL_memcpy(ssl->s3->previous_server_finished, finished, finished_len); + ssl->s3->previous_server_finished_len = finished_len; + } else { + OPENSSL_memcpy(ssl->s3->previous_client_finished, finished, finished_len); + ssl->s3->previous_client_finished_len = finished_len; } ScopedCBB cbb; @@ -475,12 +520,13 @@ bool ssl_send_finished(SSL_HANDSHAKE *hs) { return 1; } -bool ssl_output_cert_chain(SSL *ssl) { +bool ssl_output_cert_chain(SSL_HANDSHAKE *hs) { ScopedCBB cbb; CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CERTIFICATE) || - !ssl_add_cert_chain(ssl, &body) || - !ssl_add_message_cbb(ssl, cbb.get())) { + if (!hs->ssl->method->init_message(hs->ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE) || + !ssl_add_cert_chain(hs, &body) || + !ssl_add_message_cbb(hs->ssl, cbb.get())) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return false; } @@ -508,6 +554,16 @@ int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { case ssl_hs_read_server_hello: case ssl_hs_read_message: case ssl_hs_read_change_cipher_spec: { + if (ssl->quic_method) { + hs->wait = ssl_hs_ok; + // The change cipher spec is omitted in QUIC. + if (hs->wait != ssl_hs_read_change_cipher_spec) { + ssl->s3->rwstate = SSL_ERROR_WANT_READ; + return -1; + } + break; + } + uint8_t alert = SSL_AD_DECODE_ERROR; size_t consumed = 0; ssl_open_record_t ret; @@ -556,47 +612,53 @@ int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { } case ssl_hs_certificate_selection_pending: - ssl->s3->rwstate = SSL_CERTIFICATE_SELECTION_PENDING; + ssl->s3->rwstate = SSL_ERROR_PENDING_CERTIFICATE; hs->wait = ssl_hs_ok; return -1; case ssl_hs_handoff: - ssl->s3->rwstate = SSL_HANDOFF; + ssl->s3->rwstate = SSL_ERROR_HANDOFF; hs->wait = ssl_hs_ok; return -1; + case ssl_hs_handback: + ssl->s3->rwstate = SSL_ERROR_HANDBACK; + hs->wait = ssl_hs_handback; + return -1; + case ssl_hs_x509_lookup: - ssl->s3->rwstate = SSL_X509_LOOKUP; + ssl->s3->rwstate = SSL_ERROR_WANT_X509_LOOKUP; hs->wait = ssl_hs_ok; return -1; case ssl_hs_channel_id_lookup: - ssl->s3->rwstate = SSL_CHANNEL_ID_LOOKUP; + ssl->s3->rwstate = SSL_ERROR_WANT_CHANNEL_ID_LOOKUP; hs->wait = ssl_hs_ok; return -1; case ssl_hs_private_key_operation: - ssl->s3->rwstate = SSL_PRIVATE_KEY_OPERATION; + ssl->s3->rwstate = SSL_ERROR_WANT_PRIVATE_KEY_OPERATION; hs->wait = ssl_hs_ok; return -1; case ssl_hs_pending_session: - ssl->s3->rwstate = SSL_PENDING_SESSION; + ssl->s3->rwstate = SSL_ERROR_PENDING_SESSION; hs->wait = ssl_hs_ok; return -1; case ssl_hs_pending_ticket: - ssl->s3->rwstate = SSL_PENDING_TICKET; + ssl->s3->rwstate = SSL_ERROR_PENDING_TICKET; hs->wait = ssl_hs_ok; return -1; case ssl_hs_certificate_verify: - ssl->s3->rwstate = SSL_CERTIFICATE_VERIFY; + ssl->s3->rwstate = SSL_ERROR_WANT_CERTIFICATE_VERIFY; hs->wait = ssl_hs_ok; return -1; case ssl_hs_early_data_rejected: - ssl->s3->rwstate = SSL_EARLY_DATA_REJECTED; + assert(ssl->s3->early_data_reason != ssl_early_data_unknown); + ssl->s3->rwstate = SSL_ERROR_EARLY_DATA_REJECTED; // Cause |SSL_write| to start failing immediately. hs->can_early_write = false; return -1; @@ -627,4 +689,4 @@ int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return) { } } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/handshake_client.cc b/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc similarity index 84% rename from Pods/BoringSSL-GRPC/ssl/handshake_client.cc rename to Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc index 8ac40cb5d..6ced6b4f5 100644 --- a/Pods/BoringSSL-GRPC/ssl/handshake_client.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc @@ -157,7 +157,6 @@ #include #include -#include #include #include #include @@ -166,22 +165,25 @@ #include #include #include +#include #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN enum ssl_client_hs_state_t { state_start_connect = 0, state_enter_early_data, + state_early_reverify_server_certificate, state_read_hello_verify_request, state_read_server_hello, state_tls13, state_read_server_certificate, state_read_certificate_status, state_verify_server_certificate, + state_reverify_server_certificate, state_read_server_key_exchange, state_read_certificate_request, state_read_server_hello_done, @@ -199,32 +201,32 @@ enum ssl_client_hs_state_t { // ssl_get_client_disabled sets |*out_mask_a| and |*out_mask_k| to masks of // disabled algorithms. -static void ssl_get_client_disabled(SSL *ssl, uint32_t *out_mask_a, +static void ssl_get_client_disabled(SSL_HANDSHAKE *hs, uint32_t *out_mask_a, uint32_t *out_mask_k) { *out_mask_a = 0; *out_mask_k = 0; // PSK requires a client callback. - if (ssl->psk_client_callback == NULL) { + if (hs->config->psk_client_callback == NULL) { *out_mask_a |= SSL_aPSK; *out_mask_k |= SSL_kPSK; } } -static int ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { +static bool ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; uint32_t mask_a, mask_k; - ssl_get_client_disabled(ssl, &mask_a, &mask_k); + ssl_get_client_disabled(hs, &mask_a, &mask_k); CBB child; if (!CBB_add_u16_length_prefixed(out, &child)) { - return 0; + return false; } // Add a fake cipher suite. See draft-davidben-tls-grease-01. if (ssl->ctx->grease_enabled && !CBB_add_u16(&child, ssl_get_grease_value(hs, ssl_grease_cipher))) { - return 0; + return false; } // Add TLS 1.3 ciphers. Order ChaCha20-Poly1305 relative to AES-GCM based on @@ -232,20 +234,20 @@ static int ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { if (hs->max_version >= TLS1_3_VERSION) { if (!EVP_has_aes_hardware() && !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { - return 0; + return false; } if (!CBB_add_u16(&child, TLS1_CK_AES_128_GCM_SHA256 & 0xffff) || !CBB_add_u16(&child, TLS1_CK_AES_256_GCM_SHA384 & 0xffff)) { - return 0; + return false; } if (EVP_has_aes_hardware() && !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { - return 0; + return false; } } if (hs->min_version < TLS1_3_VERSION) { - int any_enabled = 0; + bool any_enabled = false; for (const SSL_CIPHER *cipher : SSL_get_ciphers(ssl)) { // Skip disabled ciphers if ((cipher->algorithm_mkey & mask_k) || @@ -256,62 +258,53 @@ static int ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { SSL_CIPHER_get_max_version(cipher) < hs->min_version) { continue; } - any_enabled = 1; + any_enabled = true; if (!CBB_add_u16(&child, ssl_cipher_get_value(cipher))) { - return 0; + return false; } } // If all ciphers were disabled, return the error to the caller. if (!any_enabled && hs->max_version < TLS1_3_VERSION) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CIPHERS_AVAILABLE); - return 0; - } - } - - // For SSLv3, the SCSV is added. Otherwise the renegotiation extension is - // added. - if (hs->max_version == SSL3_VERSION && - !ssl->s3->initial_handshake_complete) { - if (!CBB_add_u16(&child, SSL3_CK_SCSV & 0xffff)) { - return 0; + return false; } } if (ssl->mode & SSL_MODE_SEND_FALLBACK_SCSV) { if (!CBB_add_u16(&child, SSL3_CK_FALLBACK_SCSV & 0xffff)) { - return 0; + return false; } } return CBB_flush(out); } -int ssl_write_client_hello(SSL_HANDSHAKE *hs) { +bool ssl_write_client_hello(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; ScopedCBB cbb; CBB body; if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CLIENT_HELLO)) { - return 0; + return false; } CBB child; if (!CBB_add_u16(&body, hs->client_version) || !CBB_add_bytes(&body, ssl->s3->client_random, SSL3_RANDOM_SIZE) || !CBB_add_u8_length_prefixed(&body, &child)) { - return 0; + return false; } // Do not send a session ID on renegotiation. if (!ssl->s3->initial_handshake_complete && !CBB_add_bytes(&child, hs->session_id, hs->session_id_len)) { - return 0; + return false; } if (SSL_is_dtls(ssl)) { if (!CBB_add_u8_length_prefixed(&body, &child) || !CBB_add_bytes(&child, ssl->d1->cookie, ssl->d1->cookie_len)) { - return 0; + return false; } } @@ -321,19 +314,19 @@ int ssl_write_client_hello(SSL_HANDSHAKE *hs) { !CBB_add_u8(&body, 1 /* one compression method */) || !CBB_add_u8(&body, 0 /* null compression */) || !ssl_add_clienthello_tlsext(hs, &body, header_len + CBB_len(&body))) { - return 0; + return false; } Array msg; if (!ssl->method->finish_message(ssl, cbb.get(), &msg)) { - return 0; + return false; } // Now that the length prefixes have been computed, fill in the placeholder // PSK binder. if (hs->needs_psk_binder && - !tls13_write_psk_binder(hs, msg.data(), msg.size())) { - return 0; + !tls13_write_psk_binder(hs, MakeSpan(msg))) { + return false; } return ssl->method->add_message(ssl, std::move(msg)); @@ -390,16 +383,10 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { ssl->s3->session_reused = false; // Freeze the version range. - if (!ssl_get_version_range(ssl, &hs->min_version, &hs->max_version)) { + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { return ssl_hs_error; } - // SSL 3.0 ClientHellos should use SSL 3.0 not TLS 1.0, for the record-layer - // version. - if (hs->max_version == SSL3_VERSION) { - ssl->s3->aead_write_ctx->SetVersionIfNullCipher(SSL3_VERSION); - } - // Always advertise the ClientHello version from the original maximum version, // even on renegotiation. The static RSA key exchange uses this field, and // some servers fail when it changes across handshakes. @@ -417,9 +404,9 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { if (ssl->session->is_server || !ssl_supports_version(hs, ssl->session->ssl_version) || (ssl->session->session_id_length == 0 && - ssl->session->tlsext_ticklen == 0) || + ssl->session->ticket.empty()) || ssl->session->not_resumable || - !ssl_session_is_time_valid(ssl, ssl->session)) { + !ssl_session_is_time_valid(ssl, ssl->session.get())) { ssl_set_session(ssl, NULL); } } @@ -428,8 +415,6 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - // Initialize a random session ID for the experimental TLS 1.3 variant - // requiring a session id. if (ssl->session != nullptr && !ssl->s3->initial_handshake_complete && ssl->session->session_id_length > 0) { @@ -437,6 +422,7 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { OPENSSL_memcpy(hs->session_id, ssl->session->session_id, hs->session_id_len); } else if (hs->max_version >= TLS1_3_VERSION) { + // Initialize a random session ID. hs->session_id_len = sizeof(hs->session_id); if (!RAND_bytes(hs->session_id, hs->session_id_len)) { return ssl_hs_error; @@ -469,21 +455,53 @@ static enum ssl_hs_wait_t do_enter_early_data(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (!tls13_init_early_key_schedule(hs, ssl->session->master_key, - ssl->session->master_key_length) || - !tls13_derive_early_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->early_traffic_secret, - hs->hash_len)) { + if (!tls13_init_early_key_schedule( + hs, MakeConstSpan(ssl->session->master_key, + ssl->session->master_key_length)) || + !tls13_derive_early_secret(hs)) { + return ssl_hs_error; + } + if (ssl->quic_method == nullptr && + !tls13_set_traffic_key(ssl, ssl_encryption_early_data, evp_aead_seal, + hs->early_traffic_secret())) { return ssl_hs_error; } // Stash the early data session, so connection properties may be queried out // of it. + hs->early_session = UpRef(ssl->session); + hs->state = state_early_reverify_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_early_reverify_server_certificate(SSL_HANDSHAKE *hs) { + if (hs->ssl->ctx->reverify_on_resume) { + // Don't send an alert on error. The alert be in early data, which the + // server may not accept anyway. It would also be a mismatch between QUIC + // and TCP because the QUIC early keys are deferred below. + // + // TODO(davidben): The client behavior should be to verify the certificate + // before deciding whether to offer the session and, if invalid, decline to + // send the session. + switch (ssl_reverify_peer_cert(hs, /*send_alert=*/false)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->state = state_early_reverify_server_certificate; + return ssl_hs_certificate_verify; + } + } + + // Defer releasing the 0-RTT key to after certificate reverification, so the + // QUIC implementation does not accidentally write data too early. + if (!tls13_set_early_secret_for_quic(hs)) { + return ssl_hs_error; + } + hs->in_early_data = true; - SSL_SESSION_up_ref(ssl->session); - hs->early_session.reset(ssl->session); hs->can_early_write = true; - hs->state = state_read_server_hello; return ssl_hs_early_return; } @@ -587,12 +605,13 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { } // Clear some TLS 1.3 state that no longer needs to be retained. - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); hs->key_share_bytes.Reset(); // A TLS 1.2 server would not know to skip the early data we offered. Report // an error code sooner. The caller may use this error code to implement the - // fallback described in draft-ietf-tls-tls13-18 appendix C.3. + // fallback described in RFC 8446 appendix D.3. if (hs->early_data_offered) { OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_VERSION_ON_EARLY_DATA); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_PROTOCOL_VERSION); @@ -603,22 +622,30 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { OPENSSL_memcpy(ssl->s3->server_random, CBS_data(&server_random), SSL3_RANDOM_SIZE); - // Measure, but do not enforce, the TLS 1.3 anti-downgrade feature, with a - // different value. - // - // For draft TLS 1.3 versions, it is not safe to deploy this feature. However, - // some TLS terminators are non-compliant and copy the origin server's value, - // so we wish to measure eventual compatibility impact. + // Enforce the TLS 1.3 anti-downgrade feature. if (!ssl->s3->initial_handshake_complete && - hs->max_version >= TLS1_3_VERSION && - OPENSSL_memcmp(ssl->s3->server_random + SSL3_RANDOM_SIZE - - sizeof(kDraftDowngradeRandom), - kDraftDowngradeRandom, - sizeof(kDraftDowngradeRandom)) == 0) { - ssl->s3->draft_downgrade = true; + ssl_supports_version(hs, TLS1_3_VERSION)) { + static_assert( + sizeof(kTLS12DowngradeRandom) == sizeof(kTLS13DowngradeRandom), + "downgrade signals have different size"); + static_assert( + sizeof(kJDK11DowngradeRandom) == sizeof(kTLS13DowngradeRandom), + "downgrade signals have different size"); + auto suffix = + MakeConstSpan(ssl->s3->server_random, sizeof(ssl->s3->server_random)) + .subspan(SSL3_RANDOM_SIZE - sizeof(kTLS13DowngradeRandom)); + if (suffix == kTLS12DowngradeRandom || suffix == kTLS13DowngradeRandom || + suffix == kJDK11DowngradeRandom) { + ssl->s3->tls13_downgrade = true; + if (!hs->config->ignore_tls13_downgrade) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TLS13_DOWNGRADE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + } } - if (!ssl->s3->initial_handshake_complete && ssl->session != NULL && + if (!ssl->s3->initial_handshake_complete && ssl->session != nullptr && ssl->session->session_id_length != 0 && CBS_mem_equal(&session_id, ssl->session->session_id, ssl->session->session_id_length)) { @@ -659,7 +686,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { // The cipher must be allowed in the selected version and enabled. uint32_t mask_a, mask_k; - ssl_get_client_disabled(ssl, &mask_a, &mask_k); + ssl_get_client_disabled(hs, &mask_a, &mask_k); if ((cipher->algorithm_mkey & mask_k) || (cipher->algorithm_auth & mask_a) || SSL_CIPHER_get_min_version(cipher) > ssl_protocol_version(ssl) || SSL_CIPHER_get_max_version(cipher) < ssl_protocol_version(ssl) || @@ -680,7 +707,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } - if (!ssl_session_is_context_valid(ssl, ssl->session)) { + if (!ssl_session_is_context_valid(hs, ssl->session.get())) { // This is actually a client application bug. OPENSSL_PUT_ERROR(SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); @@ -740,7 +767,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (ssl->token_binding_negotiated && + if (ssl->s3->token_binding_negotiated && (!hs->extended_master_secret || !ssl->s3->send_connection_binding)) { OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); @@ -750,7 +777,12 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { ssl->method->next_message(ssl); if (ssl->session != NULL) { - hs->state = state_read_session_ticket; + if (ssl->ctx->reverify_on_resume && + ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_reverify_server_certificate; + } else { + hs->state = state_read_session_ticket; + } return ssl_hs_ok; } @@ -788,16 +820,13 @@ static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { CBS body = msg.body; uint8_t alert = SSL_AD_DECODE_ERROR; - UniquePtr chain; - if (!ssl_parse_cert_chain(&alert, &chain, &hs->peer_pubkey, NULL, &body, - ssl->ctx->pool)) { + if (!ssl_parse_cert_chain(&alert, &hs->new_session->certs, &hs->peer_pubkey, + NULL, &body, ssl->ctx->pool)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = chain.release(); - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0 || + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0 || CBS_len(&body) != 0 || !ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); @@ -807,7 +836,7 @@ static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { if (!ssl_check_leaf_certificate( hs, hs->peer_pubkey.get(), - sk_CRYPTO_BUFFER_value(hs->new_session->certs, 0))) { + sk_CRYPTO_BUFFER_value(hs->new_session->certs.get(), 0))) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } @@ -854,9 +883,8 @@ static enum ssl_hs_wait_t do_read_certificate_status(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - CRYPTO_BUFFER_free(hs->new_session->ocsp_response); - hs->new_session->ocsp_response = - CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool); + hs->new_session->ocsp_response.reset( + CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool)); if (hs->new_session->ocsp_response == nullptr) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; @@ -888,6 +916,23 @@ static enum ssl_hs_wait_t do_verify_server_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_ok; } +static enum ssl_hs_wait_t do_reverify_server_certificate(SSL_HANDSHAKE *hs) { + assert(hs->ssl->ctx->reverify_on_resume); + + switch (ssl_reverify_peer_cert(hs, /*send_alert=*/true)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->state = state_reverify_server_certificate; + return ssl_hs_certificate_verify; + } + + hs->state = state_read_session_ticket; + return ssl_hs_ok; +} + static enum ssl_hs_wait_t do_read_server_key_exchange(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; SSLMessage msg; @@ -970,15 +1015,15 @@ static enum ssl_hs_wait_t do_read_server_key_exchange(SSL_HANDSHAKE *hs) { hs->new_session->group_id = group_id; // Ensure the group is consistent with preferences. - if (!tls1_check_group_id(ssl, group_id)) { + if (!tls1_check_group_id(hs, group_id)) { OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } // Initialize ECDH and save the peer public key for later. - hs->key_share = SSLKeyShare::Create(group_id); - if (!hs->key_share || + hs->key_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || !hs->peer_key.CopyFrom(point)) { return ssl_hs_error; } @@ -1042,13 +1087,8 @@ static enum ssl_hs_wait_t do_read_server_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - bool sig_ok = ssl_public_key_verify(ssl, signature, signature_algorithm, - hs->peer_pubkey.get(), transcript_data); -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = true; - ERR_clear_error(); -#endif - if (!sig_ok) { + if (!ssl_public_key_verify(ssl, signature, signature_algorithm, + hs->peer_pubkey.get(), transcript_data)) { // bad signature OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); @@ -1176,8 +1216,8 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } // Call cert_cb to update the certificate. - if (ssl->cert->cert_cb != NULL) { - int rv = ssl->cert->cert_cb(ssl, ssl->cert->cert_cb_arg); + if (hs->config->cert->cert_cb != NULL) { + int rv = hs->config->cert->cert_cb(ssl, hs->config->cert->cert_cb_arg); if (rv == 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_CB_ERROR); @@ -1189,23 +1229,13 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } } - if (!ssl_has_certificate(ssl)) { + if (!ssl_has_certificate(hs)) { // Without a client certificate, the handshake buffer may be released. hs->transcript.FreeBuffer(); - - // In SSL 3.0, the Certificate message is replaced with a warning alert. - if (ssl->version == SSL3_VERSION) { - if (!ssl->method->add_alert(ssl, SSL3_AL_WARNING, - SSL_AD_NO_CERTIFICATE)) { - return ssl_hs_error; - } - hs->state = state_send_client_key_exchange; - return ssl_hs_ok; - } } if (!ssl_on_certificate_selected(hs) || - !ssl_output_cert_chain(ssl)) { + !ssl_output_cert_chain(hs)) { return ssl_hs_error; } @@ -1229,21 +1259,42 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { Array pms; uint32_t alg_k = hs->new_cipher->algorithm_mkey; uint32_t alg_a = hs->new_cipher->algorithm_auth; + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + CRYPTO_BUFFER *leaf = + sk_CRYPTO_BUFFER_value(hs->new_session->certs.get(), 0); + CBS leaf_cbs; + CBS_init(&leaf_cbs, CRYPTO_BUFFER_data(leaf), CRYPTO_BUFFER_len(leaf)); + + // Check the key usage matches the cipher suite. We do this unconditionally + // for non-RSA certificates. In particular, it's needed to distinguish ECDH + // certificates, which we do not support, from ECDSA certificates. + // Historically, we have not checked RSA key usages, so it is controlled by + // a flag for now. See https://crbug.com/795089. + ssl_key_usage_t intended_use = (alg_k & SSL_kRSA) + ? key_usage_encipherment + : key_usage_digital_signature; + if (ssl->config->enforce_rsa_key_usage || + EVP_PKEY_id(hs->peer_pubkey.get()) != EVP_PKEY_RSA) { + if (!ssl_cert_check_key_usage(&leaf_cbs, intended_use)) { + return ssl_hs_error; + } + } + } // If using a PSK key exchange, prepare the pre-shared key. unsigned psk_len = 0; uint8_t psk[PSK_MAX_PSK_LEN]; if (alg_a & SSL_aPSK) { - if (ssl->psk_client_callback == NULL) { + if (hs->config->psk_client_callback == NULL) { OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_NO_CLIENT_CB); return ssl_hs_error; } char identity[PSK_MAX_IDENTITY_LEN + 1]; OPENSSL_memset(identity, 0, sizeof(identity)); - psk_len = - ssl->psk_client_callback(ssl, hs->peer_psk_identity_hint.get(), - identity, sizeof(identity), psk, sizeof(psk)); + psk_len = hs->config->psk_client_callback( + ssl, hs->peer_psk_identity_hint.get(), identity, sizeof(identity), psk, + sizeof(psk)); if (psk_len == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_NOT_FOUND); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -1251,9 +1302,8 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { } assert(psk_len <= PSK_MAX_PSK_LEN); - OPENSSL_free(hs->new_session->psk_identity); - hs->new_session->psk_identity = BUF_strdup(identity); - if (hs->new_session->psk_identity == NULL) { + hs->new_session->psk_identity.reset(OPENSSL_strdup(identity)); + if (hs->new_session->psk_identity == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return ssl_hs_error; } @@ -1286,21 +1336,14 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - CBB child, *enc_pms = &body; - size_t enc_pms_len; - // In TLS, there is a length prefix. - if (ssl->version > SSL3_VERSION) { - if (!CBB_add_u16_length_prefixed(&body, &child)) { - return ssl_hs_error; - } - enc_pms = &child; - } - + CBB enc_pms; uint8_t *ptr; - if (!CBB_reserve(enc_pms, &ptr, RSA_size(rsa)) || + size_t enc_pms_len; + if (!CBB_add_u16_length_prefixed(&body, &enc_pms) || + !CBB_reserve(&enc_pms, &ptr, RSA_size(rsa)) || !RSA_encrypt(rsa, &enc_pms_len, ptr, RSA_size(rsa), pms.data(), pms.size(), RSA_PKCS1_PADDING) || - !CBB_did_write(enc_pms, enc_pms_len) || + !CBB_did_write(&enc_pms, enc_pms_len) || !CBB_flush(&body)) { return ssl_hs_error; } @@ -1313,7 +1356,7 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { // Compute the premaster. uint8_t alert = SSL_AD_DECODE_ERROR; - if (!hs->key_share->Accept(&child, &pms, &alert, hs->peer_key)) { + if (!hs->key_shares[0]->Accept(&child, &pms, &alert, hs->peer_key)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } @@ -1322,7 +1365,8 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { } // The key exchange state may now be discarded. - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); hs->peer_key.Reset(); } else if (alg_k & SSL_kPSK) { // For plain PSK, other_secret is a block of 0s with the same length as @@ -1373,12 +1417,12 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (!hs->cert_request || !ssl_has_certificate(ssl)) { + if (!hs->cert_request || !ssl_has_certificate(hs)) { hs->state = state_send_client_finished; return ssl_hs_ok; } - assert(ssl_has_private_key(ssl)); + assert(ssl_has_private_key(hs)); ScopedCBB cbb; CBB body, child; if (!ssl->method->init_message(ssl, cbb.get(), &body, @@ -1388,6 +1432,7 @@ static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { uint16_t signature_algorithm; if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); return ssl_hs_error; } if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { @@ -1407,39 +1452,16 @@ static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { } size_t sig_len = max_sig_len; - // The SSL3 construction for CertificateVerify does not decompose into a - // single final digest and signature, and must be special-cased. - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - if (ssl->cert->key_method != NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY); - return ssl_hs_error; - } - - uint8_t digest[EVP_MAX_MD_SIZE]; - size_t digest_len; - if (!hs->transcript.GetSSL3CertVerifyHash( - digest, &digest_len, hs->new_session.get(), signature_algorithm)) { - return ssl_hs_error; - } - - UniquePtr pctx(EVP_PKEY_CTX_new(ssl->cert->privatekey, NULL)); - if (!pctx || - !EVP_PKEY_sign_init(pctx.get()) || - !EVP_PKEY_sign(pctx.get(), ptr, &sig_len, digest, digest_len)) { + switch (ssl_private_key_sign(hs, ptr, &sig_len, max_sig_len, + signature_algorithm, + hs->transcript.buffer())) { + case ssl_private_key_success: + break; + case ssl_private_key_failure: return ssl_hs_error; - } - } else { - switch (ssl_private_key_sign(hs, ptr, &sig_len, max_sig_len, - signature_algorithm, - hs->transcript.buffer())) { - case ssl_private_key_success: - break; - case ssl_private_key_failure: - return ssl_hs_error; - case ssl_private_key_retry: - hs->state = state_send_client_certificate_verify; - return ssl_hs_private_key_operation; - } + case ssl_private_key_retry: + hs->state = state_send_client_certificate_verify; + return ssl_hs_private_key_operation; } if (!CBB_did_write(&child, sig_len) || @@ -1457,12 +1479,12 @@ static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { static enum ssl_hs_wait_t do_send_client_finished(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // Resolve Channel ID first, before any non-idempotent operations. - if (ssl->s3->tlsext_channel_id_valid) { - if (!ssl_do_channel_id_callback(ssl)) { + if (ssl->s3->channel_id_valid) { + if (!ssl_do_channel_id_callback(hs)) { return ssl_hs_error; } - if (ssl->tlsext_channel_id_private == NULL) { + if (hs->config->channel_id_private == NULL) { hs->state = state_send_client_finished; return ssl_hs_channel_id_lookup; } @@ -1492,7 +1514,7 @@ static enum ssl_hs_wait_t do_send_client_finished(SSL_HANDSHAKE *hs) { } } - if (ssl->s3->tlsext_channel_id_valid) { + if (ssl->s3->channel_id_valid) { ScopedCBB cbb; CBB body; if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CHANNEL_ID) || @@ -1514,18 +1536,32 @@ static enum ssl_hs_wait_t do_send_client_finished(SSL_HANDSHAKE *hs) { static bool can_false_start(const SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - // False Start only for TLS 1.2 with an ECDHE+AEAD cipher. + // False Start bypasses the Finished check's downgrade protection. This can + // enable attacks where we send data under weaker settings than supported + // (e.g. the Logjam attack). Thus we require TLS 1.2 with an ECDHE+AEAD + // cipher, our strongest settings before TLS 1.3. + // + // Now that TLS 1.3 exists, we would like to avoid similar attacks between + // TLS 1.2 and TLS 1.3, but there are too many TLS 1.2 deployments to + // sacrifice False Start on them. TLS 1.3's downgrade signal fixes this, but + // |SSL_CTX_set_ignore_tls13_downgrade| can disable it due to compatibility + // issues. + // + // |SSL_CTX_set_ignore_tls13_downgrade| normally still retains Finished-based + // downgrade protection, but False Start bypasses that. Thus, we disable False + // Start based on the TLS 1.3 downgrade signal, even if otherwise unenforced. if (SSL_is_dtls(ssl) || SSL_version(ssl) != TLS1_2_VERSION || hs->new_cipher->algorithm_mkey != SSL_kECDHE || - hs->new_cipher->algorithm_mac != SSL_AEAD) { + hs->new_cipher->algorithm_mac != SSL_AEAD || + ssl->s3->tls13_downgrade) { return false; } // Additionally require ALPN or NPN by default. // // TODO(davidben): Can this constraint be relaxed globally now that cipher - // suite requirements have been relaxed? + // suite requirements have been tightened? if (!ssl->ctx->false_start_allowed_without_alpn && ssl->s3->alpn_selected.empty() && ssl->s3->next_proto_negotiated.empty()) { @@ -1582,8 +1618,8 @@ static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { } CBS new_session_ticket = msg.body, ticket; - uint32_t tlsext_tick_lifetime_hint; - if (!CBS_get_u32(&new_session_ticket, &tlsext_tick_lifetime_hint) || + uint32_t ticket_lifetime_hint; + if (!CBS_get_u32(&new_session_ticket, &ticket_lifetime_hint) || !CBS_get_u16_length_prefixed(&new_session_ticket, &ticket) || CBS_len(&new_session_ticket) != 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); @@ -1608,7 +1644,7 @@ static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { // immutable once established, so duplicate all but the ticket of the // existing session. renewed_session = - SSL_SESSION_dup(ssl->session, SSL_SESSION_INCLUDE_NONAUTH); + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_INCLUDE_NONAUTH); if (!renewed_session) { // This should never happen. OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); @@ -1617,28 +1653,23 @@ static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { session = renewed_session.get(); } - // |tlsext_tick_lifetime_hint| is measured from when the ticket was issued. + // |ticket_lifetime_hint| is measured from when the ticket was issued. ssl_session_rebase_time(ssl, session); - if (!CBS_stow(&ticket, &session->tlsext_tick, &session->tlsext_ticklen)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + if (!session->ticket.CopyFrom(ticket)) { return ssl_hs_error; } - session->tlsext_tick_lifetime_hint = tlsext_tick_lifetime_hint; + session->ticket_lifetime_hint = ticket_lifetime_hint; - // Generate a session ID for this session based on the session ticket. We use - // the session ID mechanism for detecting ticket resumption. This also fits in - // with assumptions elsewhere in OpenSSL. - if (!EVP_Digest(CBS_data(&ticket), CBS_len(&ticket), - session->session_id, &session->session_id_length, - EVP_sha256(), NULL)) { - return ssl_hs_error; - } + // Generate a session ID for this session. Some callers expect all sessions to + // have a session ID. Additionally, it acts as the session ID to signal + // resumption. + SHA256(CBS_data(&ticket), CBS_len(&ticket), session->session_id); + session->session_id_length = SHA256_DIGEST_LENGTH; if (renewed_session) { - session->not_resumable = 0; - SSL_SESSION_free(ssl->session); - ssl->session = renewed_session.release(); + session->not_resumable = false; + ssl->session = std::move(renewed_session); } ssl->method->next_message(ssl); @@ -1677,8 +1708,7 @@ static enum ssl_hs_wait_t do_finish_client_handshake(SSL_HANDSHAKE *hs) { ssl->method->on_handshake_complete(ssl); if (ssl->session != NULL) { - SSL_SESSION_up_ref(ssl->session); - ssl->s3->established_session.reset(ssl->session); + ssl->s3->established_session = UpRef(ssl->session); } else { // We make a copy of the session in order to maintain the immutability // of the new established_session due to False Start. The caller may @@ -1690,7 +1720,7 @@ static enum ssl_hs_wait_t do_finish_client_handshake(SSL_HANDSHAKE *hs) { } // Renegotiations do not participate in session resumption. if (!ssl->s3->initial_handshake_complete) { - ssl->s3->established_session->not_resumable = 0; + ssl->s3->established_session->not_resumable = false; } hs->new_session.reset(); @@ -1716,6 +1746,9 @@ enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs) { case state_enter_early_data: ret = do_enter_early_data(hs); break; + case state_early_reverify_server_certificate: + ret = do_early_reverify_server_certificate(hs); + break; case state_read_hello_verify_request: ret = do_read_hello_verify_request(hs); break; @@ -1734,6 +1767,9 @@ enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs) { case state_verify_server_certificate: ret = do_verify_server_certificate(hs); break; + case state_reverify_server_certificate: + ret = do_reverify_server_certificate(hs); + break; case state_read_server_key_exchange: ret = do_read_server_key_exchange(hs); break; @@ -1796,6 +1832,8 @@ const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS client start_connect"; case state_enter_early_data: return "TLS client enter_early_data"; + case state_early_reverify_server_certificate: + return "TLS client early_reverify_server_certificate"; case state_read_hello_verify_request: return "TLS client read_hello_verify_request"; case state_read_server_hello: @@ -1808,6 +1846,8 @@ const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS client read_certificate_status"; case state_verify_server_certificate: return "TLS client verify_server_certificate"; + case state_reverify_server_certificate: + return "TLS client reverify_server_certificate"; case state_read_server_key_exchange: return "TLS client read_server_key_exchange"; case state_read_certificate_request: @@ -1839,4 +1879,4 @@ const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS client unknown"; } -} +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/handshake_client.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc.grpc_back similarity index 84% rename from Pods/BoringSSL-GRPC/ssl/handshake_client.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc.grpc_back index 0b352c2b5..4041fe991 100644 --- a/Pods/BoringSSL-GRPC/ssl/handshake_client.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/handshake_client.cc.grpc_back @@ -157,7 +157,6 @@ #include #include -#include #include #include #include @@ -166,22 +165,25 @@ #include #include #include +#include #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN enum ssl_client_hs_state_t { state_start_connect = 0, state_enter_early_data, + state_early_reverify_server_certificate, state_read_hello_verify_request, state_read_server_hello, state_tls13, state_read_server_certificate, state_read_certificate_status, state_verify_server_certificate, + state_reverify_server_certificate, state_read_server_key_exchange, state_read_certificate_request, state_read_server_hello_done, @@ -199,32 +201,32 @@ enum ssl_client_hs_state_t { // ssl_get_client_disabled sets |*out_mask_a| and |*out_mask_k| to masks of // disabled algorithms. -static void ssl_get_client_disabled(SSL *ssl, uint32_t *out_mask_a, +static void ssl_get_client_disabled(SSL_HANDSHAKE *hs, uint32_t *out_mask_a, uint32_t *out_mask_k) { *out_mask_a = 0; *out_mask_k = 0; // PSK requires a client callback. - if (ssl->psk_client_callback == NULL) { + if (hs->config->psk_client_callback == NULL) { *out_mask_a |= SSL_aPSK; *out_mask_k |= SSL_kPSK; } } -static int ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { +static bool ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; uint32_t mask_a, mask_k; - ssl_get_client_disabled(ssl, &mask_a, &mask_k); + ssl_get_client_disabled(hs, &mask_a, &mask_k); CBB child; if (!CBB_add_u16_length_prefixed(out, &child)) { - return 0; + return false; } // Add a fake cipher suite. See draft-davidben-tls-grease-01. if (ssl->ctx->grease_enabled && !CBB_add_u16(&child, ssl_get_grease_value(hs, ssl_grease_cipher))) { - return 0; + return false; } // Add TLS 1.3 ciphers. Order ChaCha20-Poly1305 relative to AES-GCM based on @@ -232,20 +234,20 @@ static int ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { if (hs->max_version >= TLS1_3_VERSION) { if (!EVP_has_aes_hardware() && !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { - return 0; + return false; } if (!CBB_add_u16(&child, TLS1_CK_AES_128_GCM_SHA256 & 0xffff) || !CBB_add_u16(&child, TLS1_CK_AES_256_GCM_SHA384 & 0xffff)) { - return 0; + return false; } if (EVP_has_aes_hardware() && !CBB_add_u16(&child, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { - return 0; + return false; } } if (hs->min_version < TLS1_3_VERSION) { - int any_enabled = 0; + bool any_enabled = false; for (const SSL_CIPHER *cipher : SSL_get_ciphers(ssl)) { // Skip disabled ciphers if ((cipher->algorithm_mkey & mask_k) || @@ -256,62 +258,53 @@ static int ssl_write_client_cipher_list(SSL_HANDSHAKE *hs, CBB *out) { SSL_CIPHER_get_max_version(cipher) < hs->min_version) { continue; } - any_enabled = 1; + any_enabled = true; if (!CBB_add_u16(&child, ssl_cipher_get_value(cipher))) { - return 0; + return false; } } // If all ciphers were disabled, return the error to the caller. if (!any_enabled && hs->max_version < TLS1_3_VERSION) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CIPHERS_AVAILABLE); - return 0; - } - } - - // For SSLv3, the SCSV is added. Otherwise the renegotiation extension is - // added. - if (hs->max_version == SSL3_VERSION && - !ssl->s3->initial_handshake_complete) { - if (!CBB_add_u16(&child, SSL3_CK_SCSV & 0xffff)) { - return 0; + return false; } } if (ssl->mode & SSL_MODE_SEND_FALLBACK_SCSV) { if (!CBB_add_u16(&child, SSL3_CK_FALLBACK_SCSV & 0xffff)) { - return 0; + return false; } } return CBB_flush(out); } -int ssl_write_client_hello(SSL_HANDSHAKE *hs) { +bool ssl_write_client_hello(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; ScopedCBB cbb; CBB body; if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CLIENT_HELLO)) { - return 0; + return false; } CBB child; if (!CBB_add_u16(&body, hs->client_version) || !CBB_add_bytes(&body, ssl->s3->client_random, SSL3_RANDOM_SIZE) || !CBB_add_u8_length_prefixed(&body, &child)) { - return 0; + return false; } // Do not send a session ID on renegotiation. if (!ssl->s3->initial_handshake_complete && !CBB_add_bytes(&child, hs->session_id, hs->session_id_len)) { - return 0; + return false; } if (SSL_is_dtls(ssl)) { if (!CBB_add_u8_length_prefixed(&body, &child) || !CBB_add_bytes(&child, ssl->d1->cookie, ssl->d1->cookie_len)) { - return 0; + return false; } } @@ -321,19 +314,19 @@ int ssl_write_client_hello(SSL_HANDSHAKE *hs) { !CBB_add_u8(&body, 1 /* one compression method */) || !CBB_add_u8(&body, 0 /* null compression */) || !ssl_add_clienthello_tlsext(hs, &body, header_len + CBB_len(&body))) { - return 0; + return false; } Array msg; if (!ssl->method->finish_message(ssl, cbb.get(), &msg)) { - return 0; + return false; } // Now that the length prefixes have been computed, fill in the placeholder // PSK binder. if (hs->needs_psk_binder && - !tls13_write_psk_binder(hs, msg.data(), msg.size())) { - return 0; + !tls13_write_psk_binder(hs, MakeSpan(msg))) { + return false; } return ssl->method->add_message(ssl, std::move(msg)); @@ -390,16 +383,10 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { ssl->s3->session_reused = false; // Freeze the version range. - if (!ssl_get_version_range(ssl, &hs->min_version, &hs->max_version)) { + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { return ssl_hs_error; } - // SSL 3.0 ClientHellos should use SSL 3.0 not TLS 1.0, for the record-layer - // version. - if (hs->max_version == SSL3_VERSION) { - ssl->s3->aead_write_ctx->SetVersionIfNullCipher(SSL3_VERSION); - } - // Always advertise the ClientHello version from the original maximum version, // even on renegotiation. The static RSA key exchange uses this field, and // some servers fail when it changes across handshakes. @@ -417,9 +404,9 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { if (ssl->session->is_server || !ssl_supports_version(hs, ssl->session->ssl_version) || (ssl->session->session_id_length == 0 && - ssl->session->tlsext_ticklen == 0) || + ssl->session->ticket.empty()) || ssl->session->not_resumable || - !ssl_session_is_time_valid(ssl, ssl->session)) { + !ssl_session_is_time_valid(ssl, ssl->session.get())) { ssl_set_session(ssl, NULL); } } @@ -428,8 +415,6 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - // Initialize a random session ID for the experimental TLS 1.3 variant - // requiring a session id. if (ssl->session != nullptr && !ssl->s3->initial_handshake_complete && ssl->session->session_id_length > 0) { @@ -437,6 +422,7 @@ static enum ssl_hs_wait_t do_start_connect(SSL_HANDSHAKE *hs) { OPENSSL_memcpy(hs->session_id, ssl->session->session_id, hs->session_id_len); } else if (hs->max_version >= TLS1_3_VERSION) { + // Initialize a random session ID. hs->session_id_len = sizeof(hs->session_id); if (!RAND_bytes(hs->session_id, hs->session_id_len)) { return ssl_hs_error; @@ -469,21 +455,53 @@ static enum ssl_hs_wait_t do_enter_early_data(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (!tls13_init_early_key_schedule(hs, ssl->session->master_key, - ssl->session->master_key_length) || - !tls13_derive_early_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->early_traffic_secret, - hs->hash_len)) { + if (!tls13_init_early_key_schedule( + hs, MakeConstSpan(ssl->session->master_key, + ssl->session->master_key_length)) || + !tls13_derive_early_secret(hs)) { + return ssl_hs_error; + } + if (ssl->quic_method == nullptr && + !tls13_set_traffic_key(ssl, ssl_encryption_early_data, evp_aead_seal, + hs->early_traffic_secret())) { return ssl_hs_error; } // Stash the early data session, so connection properties may be queried out // of it. + hs->early_session = UpRef(ssl->session); + hs->state = state_early_reverify_server_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_early_reverify_server_certificate(SSL_HANDSHAKE *hs) { + if (hs->ssl->ctx->reverify_on_resume) { + // Don't send an alert on error. The alert be in early data, which the + // server may not accept anyway. It would also be a mismatch between QUIC + // and TCP because the QUIC early keys are deferred below. + // + // TODO(davidben): The client behavior should be to verify the certificate + // before deciding whether to offer the session and, if invalid, decline to + // send the session. + switch (ssl_reverify_peer_cert(hs, /*send_alert=*/false)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->state = state_early_reverify_server_certificate; + return ssl_hs_certificate_verify; + } + } + + // Defer releasing the 0-RTT key to after certificate reverification, so the + // QUIC implementation does not accidentally write data too early. + if (!tls13_set_early_secret_for_quic(hs)) { + return ssl_hs_error; + } + hs->in_early_data = true; - SSL_SESSION_up_ref(ssl->session); - hs->early_session.reset(ssl->session); hs->can_early_write = true; - hs->state = state_read_server_hello; return ssl_hs_early_return; } @@ -587,12 +605,13 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { } // Clear some TLS 1.3 state that no longer needs to be retained. - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); hs->key_share_bytes.Reset(); // A TLS 1.2 server would not know to skip the early data we offered. Report // an error code sooner. The caller may use this error code to implement the - // fallback described in draft-ietf-tls-tls13-18 appendix C.3. + // fallback described in RFC 8446 appendix D.3. if (hs->early_data_offered) { OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_VERSION_ON_EARLY_DATA); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_PROTOCOL_VERSION); @@ -603,22 +622,30 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { OPENSSL_memcpy(ssl->s3->server_random, CBS_data(&server_random), SSL3_RANDOM_SIZE); - // Measure, but do not enforce, the TLS 1.3 anti-downgrade feature, with a - // different value. - // - // For draft TLS 1.3 versions, it is not safe to deploy this feature. However, - // some TLS terminators are non-compliant and copy the origin server's value, - // so we wish to measure eventual compatibility impact. + // Enforce the TLS 1.3 anti-downgrade feature. if (!ssl->s3->initial_handshake_complete && - hs->max_version >= TLS1_3_VERSION && - OPENSSL_memcmp(ssl->s3->server_random + SSL3_RANDOM_SIZE - - sizeof(kDraftDowngradeRandom), - kDraftDowngradeRandom, - sizeof(kDraftDowngradeRandom)) == 0) { - ssl->s3->draft_downgrade = true; + ssl_supports_version(hs, TLS1_3_VERSION)) { + static_assert( + sizeof(kTLS12DowngradeRandom) == sizeof(kTLS13DowngradeRandom), + "downgrade signals have different size"); + static_assert( + sizeof(kJDK11DowngradeRandom) == sizeof(kTLS13DowngradeRandom), + "downgrade signals have different size"); + auto suffix = + MakeConstSpan(ssl->s3->server_random, sizeof(ssl->s3->server_random)) + .subspan(SSL3_RANDOM_SIZE - sizeof(kTLS13DowngradeRandom)); + if (suffix == kTLS12DowngradeRandom || suffix == kTLS13DowngradeRandom || + suffix == kJDK11DowngradeRandom) { + ssl->s3->tls13_downgrade = true; + if (!hs->config->ignore_tls13_downgrade) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TLS13_DOWNGRADE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + } } - if (!ssl->s3->initial_handshake_complete && ssl->session != NULL && + if (!ssl->s3->initial_handshake_complete && ssl->session != nullptr && ssl->session->session_id_length != 0 && CBS_mem_equal(&session_id, ssl->session->session_id, ssl->session->session_id_length)) { @@ -659,7 +686,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { // The cipher must be allowed in the selected version and enabled. uint32_t mask_a, mask_k; - ssl_get_client_disabled(ssl, &mask_a, &mask_k); + ssl_get_client_disabled(hs, &mask_a, &mask_k); if ((cipher->algorithm_mkey & mask_k) || (cipher->algorithm_auth & mask_a) || SSL_CIPHER_get_min_version(cipher) > ssl_protocol_version(ssl) || SSL_CIPHER_get_max_version(cipher) < ssl_protocol_version(ssl) || @@ -680,7 +707,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } - if (!ssl_session_is_context_valid(ssl, ssl->session)) { + if (!ssl_session_is_context_valid(hs, ssl->session.get())) { // This is actually a client application bug. OPENSSL_PUT_ERROR(SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); @@ -740,7 +767,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (ssl->token_binding_negotiated && + if (ssl->s3->token_binding_negotiated && (!hs->extended_master_secret || !ssl->s3->send_connection_binding)) { OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); @@ -750,7 +777,12 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { ssl->method->next_message(ssl); if (ssl->session != NULL) { - hs->state = state_read_session_ticket; + if (ssl->ctx->reverify_on_resume && + ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + hs->state = state_reverify_server_certificate; + } else { + hs->state = state_read_session_ticket; + } return ssl_hs_ok; } @@ -788,16 +820,13 @@ static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { CBS body = msg.body; uint8_t alert = SSL_AD_DECODE_ERROR; - UniquePtr chain; - if (!ssl_parse_cert_chain(&alert, &chain, &hs->peer_pubkey, NULL, &body, - ssl->ctx->pool)) { + if (!ssl_parse_cert_chain(&alert, &hs->new_session->certs, &hs->peer_pubkey, + NULL, &body, ssl->ctx->pool)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = chain.release(); - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0 || + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0 || CBS_len(&body) != 0 || !ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); @@ -807,7 +836,7 @@ static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { if (!ssl_check_leaf_certificate( hs, hs->peer_pubkey.get(), - sk_CRYPTO_BUFFER_value(hs->new_session->certs, 0))) { + sk_CRYPTO_BUFFER_value(hs->new_session->certs.get(), 0))) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } @@ -854,9 +883,8 @@ static enum ssl_hs_wait_t do_read_certificate_status(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - CRYPTO_BUFFER_free(hs->new_session->ocsp_response); - hs->new_session->ocsp_response = - CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool); + hs->new_session->ocsp_response.reset( + CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool)); if (hs->new_session->ocsp_response == nullptr) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; @@ -888,6 +916,23 @@ static enum ssl_hs_wait_t do_verify_server_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_ok; } +static enum ssl_hs_wait_t do_reverify_server_certificate(SSL_HANDSHAKE *hs) { + assert(hs->ssl->ctx->reverify_on_resume); + + switch (ssl_reverify_peer_cert(hs, /*send_alert=*/true)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->state = state_reverify_server_certificate; + return ssl_hs_certificate_verify; + } + + hs->state = state_read_session_ticket; + return ssl_hs_ok; +} + static enum ssl_hs_wait_t do_read_server_key_exchange(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; SSLMessage msg; @@ -970,15 +1015,15 @@ static enum ssl_hs_wait_t do_read_server_key_exchange(SSL_HANDSHAKE *hs) { hs->new_session->group_id = group_id; // Ensure the group is consistent with preferences. - if (!tls1_check_group_id(ssl, group_id)) { + if (!tls1_check_group_id(hs, group_id)) { OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } // Initialize ECDH and save the peer public key for later. - hs->key_share = SSLKeyShare::Create(group_id); - if (!hs->key_share || + hs->key_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || !hs->peer_key.CopyFrom(point)) { return ssl_hs_error; } @@ -1042,13 +1087,8 @@ static enum ssl_hs_wait_t do_read_server_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - bool sig_ok = ssl_public_key_verify(ssl, signature, signature_algorithm, - hs->peer_pubkey.get(), transcript_data); -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = true; - ERR_clear_error(); -#endif - if (!sig_ok) { + if (!ssl_public_key_verify(ssl, signature, signature_algorithm, + hs->peer_pubkey.get(), transcript_data)) { // bad signature OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); @@ -1176,8 +1216,8 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } // Call cert_cb to update the certificate. - if (ssl->cert->cert_cb != NULL) { - int rv = ssl->cert->cert_cb(ssl, ssl->cert->cert_cb_arg); + if (hs->config->cert->cert_cb != NULL) { + int rv = hs->config->cert->cert_cb(ssl, hs->config->cert->cert_cb_arg); if (rv == 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_CB_ERROR); @@ -1189,23 +1229,13 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } } - if (!ssl_has_certificate(ssl)) { + if (!ssl_has_certificate(hs)) { // Without a client certificate, the handshake buffer may be released. hs->transcript.FreeBuffer(); - - // In SSL 3.0, the Certificate message is replaced with a warning alert. - if (ssl->version == SSL3_VERSION) { - if (!ssl->method->add_alert(ssl, SSL3_AL_WARNING, - SSL_AD_NO_CERTIFICATE)) { - return ssl_hs_error; - } - hs->state = state_send_client_key_exchange; - return ssl_hs_ok; - } } if (!ssl_on_certificate_selected(hs) || - !ssl_output_cert_chain(ssl)) { + !ssl_output_cert_chain(hs)) { return ssl_hs_error; } @@ -1229,21 +1259,42 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { Array pms; uint32_t alg_k = hs->new_cipher->algorithm_mkey; uint32_t alg_a = hs->new_cipher->algorithm_auth; + if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { + CRYPTO_BUFFER *leaf = + sk_CRYPTO_BUFFER_value(hs->new_session->certs.get(), 0); + CBS leaf_cbs; + CBS_init(&leaf_cbs, CRYPTO_BUFFER_data(leaf), CRYPTO_BUFFER_len(leaf)); + + // Check the key usage matches the cipher suite. We do this unconditionally + // for non-RSA certificates. In particular, it's needed to distinguish ECDH + // certificates, which we do not support, from ECDSA certificates. + // Historically, we have not checked RSA key usages, so it is controlled by + // a flag for now. See https://crbug.com/795089. + ssl_key_usage_t intended_use = (alg_k & SSL_kRSA) + ? key_usage_encipherment + : key_usage_digital_signature; + if (ssl->config->enforce_rsa_key_usage || + EVP_PKEY_id(hs->peer_pubkey.get()) != EVP_PKEY_RSA) { + if (!ssl_cert_check_key_usage(&leaf_cbs, intended_use)) { + return ssl_hs_error; + } + } + } // If using a PSK key exchange, prepare the pre-shared key. unsigned psk_len = 0; uint8_t psk[PSK_MAX_PSK_LEN]; if (alg_a & SSL_aPSK) { - if (ssl->psk_client_callback == NULL) { + if (hs->config->psk_client_callback == NULL) { OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_NO_CLIENT_CB); return ssl_hs_error; } char identity[PSK_MAX_IDENTITY_LEN + 1]; OPENSSL_memset(identity, 0, sizeof(identity)); - psk_len = - ssl->psk_client_callback(ssl, hs->peer_psk_identity_hint.get(), - identity, sizeof(identity), psk, sizeof(psk)); + psk_len = hs->config->psk_client_callback( + ssl, hs->peer_psk_identity_hint.get(), identity, sizeof(identity), psk, + sizeof(psk)); if (psk_len == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_PSK_IDENTITY_NOT_FOUND); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -1251,9 +1302,8 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { } assert(psk_len <= PSK_MAX_PSK_LEN); - OPENSSL_free(hs->new_session->psk_identity); - hs->new_session->psk_identity = BUF_strdup(identity); - if (hs->new_session->psk_identity == NULL) { + hs->new_session->psk_identity.reset(OPENSSL_strdup(identity)); + if (hs->new_session->psk_identity == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return ssl_hs_error; } @@ -1286,21 +1336,14 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - CBB child, *enc_pms = &body; - size_t enc_pms_len; - // In TLS, there is a length prefix. - if (ssl->version > SSL3_VERSION) { - if (!CBB_add_u16_length_prefixed(&body, &child)) { - return ssl_hs_error; - } - enc_pms = &child; - } - + CBB enc_pms; uint8_t *ptr; - if (!CBB_reserve(enc_pms, &ptr, RSA_size(rsa)) || + size_t enc_pms_len; + if (!CBB_add_u16_length_prefixed(&body, &enc_pms) || + !CBB_reserve(&enc_pms, &ptr, RSA_size(rsa)) || !RSA_encrypt(rsa, &enc_pms_len, ptr, RSA_size(rsa), pms.data(), pms.size(), RSA_PKCS1_PADDING) || - !CBB_did_write(enc_pms, enc_pms_len) || + !CBB_did_write(&enc_pms, enc_pms_len) || !CBB_flush(&body)) { return ssl_hs_error; } @@ -1313,7 +1356,7 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { // Compute the premaster. uint8_t alert = SSL_AD_DECODE_ERROR; - if (!hs->key_share->Accept(&child, &pms, &alert, hs->peer_key)) { + if (!hs->key_shares[0]->Accept(&child, &pms, &alert, hs->peer_key)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } @@ -1322,7 +1365,8 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { } // The key exchange state may now be discarded. - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); hs->peer_key.Reset(); } else if (alg_k & SSL_kPSK) { // For plain PSK, other_secret is a block of 0s with the same length as @@ -1373,12 +1417,12 @@ static enum ssl_hs_wait_t do_send_client_key_exchange(SSL_HANDSHAKE *hs) { static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (!hs->cert_request || !ssl_has_certificate(ssl)) { + if (!hs->cert_request || !ssl_has_certificate(hs)) { hs->state = state_send_client_finished; return ssl_hs_ok; } - assert(ssl_has_private_key(ssl)); + assert(ssl_has_private_key(hs)); ScopedCBB cbb; CBB body, child; if (!ssl->method->init_message(ssl, cbb.get(), &body, @@ -1388,6 +1432,7 @@ static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { uint16_t signature_algorithm; if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); return ssl_hs_error; } if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { @@ -1407,39 +1452,16 @@ static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { } size_t sig_len = max_sig_len; - // The SSL3 construction for CertificateVerify does not decompose into a - // single final digest and signature, and must be special-cased. - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - if (ssl->cert->key_method != NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL_FOR_CUSTOM_KEY); - return ssl_hs_error; - } - - uint8_t digest[EVP_MAX_MD_SIZE]; - size_t digest_len; - if (!hs->transcript.GetSSL3CertVerifyHash( - digest, &digest_len, hs->new_session.get(), signature_algorithm)) { - return ssl_hs_error; - } - - UniquePtr pctx(EVP_PKEY_CTX_new(ssl->cert->privatekey, NULL)); - if (!pctx || - !EVP_PKEY_sign_init(pctx.get()) || - !EVP_PKEY_sign(pctx.get(), ptr, &sig_len, digest, digest_len)) { + switch (ssl_private_key_sign(hs, ptr, &sig_len, max_sig_len, + signature_algorithm, + hs->transcript.buffer())) { + case ssl_private_key_success: + break; + case ssl_private_key_failure: return ssl_hs_error; - } - } else { - switch (ssl_private_key_sign(hs, ptr, &sig_len, max_sig_len, - signature_algorithm, - hs->transcript.buffer())) { - case ssl_private_key_success: - break; - case ssl_private_key_failure: - return ssl_hs_error; - case ssl_private_key_retry: - hs->state = state_send_client_certificate_verify; - return ssl_hs_private_key_operation; - } + case ssl_private_key_retry: + hs->state = state_send_client_certificate_verify; + return ssl_hs_private_key_operation; } if (!CBB_did_write(&child, sig_len) || @@ -1457,12 +1479,12 @@ static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { static enum ssl_hs_wait_t do_send_client_finished(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // Resolve Channel ID first, before any non-idempotent operations. - if (ssl->s3->tlsext_channel_id_valid) { - if (!ssl_do_channel_id_callback(ssl)) { + if (ssl->s3->channel_id_valid) { + if (!ssl_do_channel_id_callback(hs)) { return ssl_hs_error; } - if (ssl->tlsext_channel_id_private == NULL) { + if (hs->config->channel_id_private == NULL) { hs->state = state_send_client_finished; return ssl_hs_channel_id_lookup; } @@ -1492,7 +1514,7 @@ static enum ssl_hs_wait_t do_send_client_finished(SSL_HANDSHAKE *hs) { } } - if (ssl->s3->tlsext_channel_id_valid) { + if (ssl->s3->channel_id_valid) { ScopedCBB cbb; CBB body; if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CHANNEL_ID) || @@ -1514,18 +1536,32 @@ static enum ssl_hs_wait_t do_send_client_finished(SSL_HANDSHAKE *hs) { static bool can_false_start(const SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - // False Start only for TLS 1.2 with an ECDHE+AEAD cipher. + // False Start bypasses the Finished check's downgrade protection. This can + // enable attacks where we send data under weaker settings than supported + // (e.g. the Logjam attack). Thus we require TLS 1.2 with an ECDHE+AEAD + // cipher, our strongest settings before TLS 1.3. + // + // Now that TLS 1.3 exists, we would like to avoid similar attacks between + // TLS 1.2 and TLS 1.3, but there are too many TLS 1.2 deployments to + // sacrifice False Start on them. TLS 1.3's downgrade signal fixes this, but + // |SSL_CTX_set_ignore_tls13_downgrade| can disable it due to compatibility + // issues. + // + // |SSL_CTX_set_ignore_tls13_downgrade| normally still retains Finished-based + // downgrade protection, but False Start bypasses that. Thus, we disable False + // Start based on the TLS 1.3 downgrade signal, even if otherwise unenforced. if (SSL_is_dtls(ssl) || SSL_version(ssl) != TLS1_2_VERSION || hs->new_cipher->algorithm_mkey != SSL_kECDHE || - hs->new_cipher->algorithm_mac != SSL_AEAD) { + hs->new_cipher->algorithm_mac != SSL_AEAD || + ssl->s3->tls13_downgrade) { return false; } // Additionally require ALPN or NPN by default. // // TODO(davidben): Can this constraint be relaxed globally now that cipher - // suite requirements have been relaxed? + // suite requirements have been tightened? if (!ssl->ctx->false_start_allowed_without_alpn && ssl->s3->alpn_selected.empty() && ssl->s3->next_proto_negotiated.empty()) { @@ -1582,8 +1618,8 @@ static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { } CBS new_session_ticket = msg.body, ticket; - uint32_t tlsext_tick_lifetime_hint; - if (!CBS_get_u32(&new_session_ticket, &tlsext_tick_lifetime_hint) || + uint32_t ticket_lifetime_hint; + if (!CBS_get_u32(&new_session_ticket, &ticket_lifetime_hint) || !CBS_get_u16_length_prefixed(&new_session_ticket, &ticket) || CBS_len(&new_session_ticket) != 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); @@ -1608,7 +1644,7 @@ static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { // immutable once established, so duplicate all but the ticket of the // existing session. renewed_session = - SSL_SESSION_dup(ssl->session, SSL_SESSION_INCLUDE_NONAUTH); + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_INCLUDE_NONAUTH); if (!renewed_session) { // This should never happen. OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); @@ -1617,28 +1653,23 @@ static enum ssl_hs_wait_t do_read_session_ticket(SSL_HANDSHAKE *hs) { session = renewed_session.get(); } - // |tlsext_tick_lifetime_hint| is measured from when the ticket was issued. + // |ticket_lifetime_hint| is measured from when the ticket was issued. ssl_session_rebase_time(ssl, session); - if (!CBS_stow(&ticket, &session->tlsext_tick, &session->tlsext_ticklen)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + if (!session->ticket.CopyFrom(ticket)) { return ssl_hs_error; } - session->tlsext_tick_lifetime_hint = tlsext_tick_lifetime_hint; + session->ticket_lifetime_hint = ticket_lifetime_hint; - // Generate a session ID for this session based on the session ticket. We use - // the session ID mechanism for detecting ticket resumption. This also fits in - // with assumptions elsewhere in OpenSSL. - if (!EVP_Digest(CBS_data(&ticket), CBS_len(&ticket), - session->session_id, &session->session_id_length, - EVP_sha256(), NULL)) { - return ssl_hs_error; - } + // Generate a session ID for this session. Some callers expect all sessions to + // have a session ID. Additionally, it acts as the session ID to signal + // resumption. + SHA256(CBS_data(&ticket), CBS_len(&ticket), session->session_id); + session->session_id_length = SHA256_DIGEST_LENGTH; if (renewed_session) { - session->not_resumable = 0; - SSL_SESSION_free(ssl->session); - ssl->session = renewed_session.release(); + session->not_resumable = false; + ssl->session = std::move(renewed_session); } ssl->method->next_message(ssl); @@ -1677,8 +1708,7 @@ static enum ssl_hs_wait_t do_finish_client_handshake(SSL_HANDSHAKE *hs) { ssl->method->on_handshake_complete(ssl); if (ssl->session != NULL) { - SSL_SESSION_up_ref(ssl->session); - ssl->s3->established_session.reset(ssl->session); + ssl->s3->established_session = UpRef(ssl->session); } else { // We make a copy of the session in order to maintain the immutability // of the new established_session due to False Start. The caller may @@ -1690,7 +1720,7 @@ static enum ssl_hs_wait_t do_finish_client_handshake(SSL_HANDSHAKE *hs) { } // Renegotiations do not participate in session resumption. if (!ssl->s3->initial_handshake_complete) { - ssl->s3->established_session->not_resumable = 0; + ssl->s3->established_session->not_resumable = false; } hs->new_session.reset(); @@ -1716,6 +1746,9 @@ enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs) { case state_enter_early_data: ret = do_enter_early_data(hs); break; + case state_early_reverify_server_certificate: + ret = do_early_reverify_server_certificate(hs); + break; case state_read_hello_verify_request: ret = do_read_hello_verify_request(hs); break; @@ -1734,6 +1767,9 @@ enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs) { case state_verify_server_certificate: ret = do_verify_server_certificate(hs); break; + case state_reverify_server_certificate: + ret = do_reverify_server_certificate(hs); + break; case state_read_server_key_exchange: ret = do_read_server_key_exchange(hs); break; @@ -1796,6 +1832,8 @@ const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS client start_connect"; case state_enter_early_data: return "TLS client enter_early_data"; + case state_early_reverify_server_certificate: + return "TLS client early_reverify_server_certificate"; case state_read_hello_verify_request: return "TLS client read_hello_verify_request"; case state_read_server_hello: @@ -1808,6 +1846,8 @@ const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS client read_certificate_status"; case state_verify_server_certificate: return "TLS client verify_server_certificate"; + case state_reverify_server_certificate: + return "TLS client reverify_server_certificate"; case state_read_server_key_exchange: return "TLS client read_server_key_exchange"; case state_read_certificate_request: @@ -1839,4 +1879,4 @@ const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS client unknown"; } -} +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/handshake_server.cc b/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc similarity index 75% rename from Pods/BoringSSL-GRPC/ssl/handshake_server.cc rename to Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc index eff28f6a9..a1ae31121 100644 --- a/Pods/BoringSSL-GRPC/ssl/handshake_server.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc @@ -152,7 +152,6 @@ #include #include -#include #include #include #include @@ -170,34 +169,10 @@ #include "../crypto/internal.h" -namespace bssl { - -enum ssl_server_hs_state_t { - state_start_accept = 0, - state_read_client_hello, - state_select_certificate, - state_tls13, - state_select_parameters, - state_send_server_hello, - state_send_server_certificate, - state_send_server_key_exchange, - state_send_server_hello_done, - state_read_client_certificate, - state_verify_client_certificate, - state_read_client_key_exchange, - state_read_client_certificate_verify, - state_read_change_cipher_spec, - state_process_change_cipher_spec, - state_read_next_proto, - state_read_channel_id, - state_read_client_finished, - state_send_server_finished, - state_finish_server_handshake, - state_done, -}; - -int ssl_client_cipher_list_contains_cipher(const SSL_CLIENT_HELLO *client_hello, - uint16_t id) { +BSSL_NAMESPACE_BEGIN + +bool ssl_client_cipher_list_contains_cipher( + const SSL_CLIENT_HELLO *client_hello, uint16_t id) { CBS cipher_suites; CBS_init(&cipher_suites, client_hello->cipher_suites, client_hello->cipher_suites_len); @@ -205,19 +180,19 @@ int ssl_client_cipher_list_contains_cipher(const SSL_CLIENT_HELLO *client_hello, while (CBS_len(&cipher_suites) > 0) { uint16_t got_id; if (!CBS_get_u16(&cipher_suites, &got_id)) { - return 0; + return false; } if (got_id == id) { - return 1; + return true; } } - return 0; + return false; } -static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, - const SSL_CLIENT_HELLO *client_hello) { +static bool negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello) { SSL *const ssl = hs->ssl; assert(!ssl->s3->have_version); CBS supported_versions, versions; @@ -228,7 +203,7 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS_len(&versions) == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); *out_alert = SSL_AD_DECODE_ERROR; - return 0; + return false; } } else { // Convert the ClientHello version to an equivalent supported_versions @@ -237,7 +212,6 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, 0x03, 0x03, // TLS 1.2 0x03, 0x02, // TLS 1.1 0x03, 0x01, // TLS 1 - 0x03, 0x00, // SSL 3 }; static const uint8_t kDTLSVersions[] = { @@ -256,12 +230,10 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, versions_len); } else { if (client_hello->version >= TLS1_2_VERSION) { - versions_len = 8; - } else if (client_hello->version >= TLS1_1_VERSION) { versions_len = 6; - } else if (client_hello->version >= TLS1_VERSION) { + } else if (client_hello->version >= TLS1_1_VERSION) { versions_len = 4; - } else if (client_hello->version >= SSL3_VERSION) { + } else if (client_hello->version >= TLS1_VERSION) { versions_len = 2; } CBS_init(&versions, kTLSVersions + sizeof(kTLSVersions) - versions_len, @@ -270,7 +242,7 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, } if (!ssl_negotiate_version(hs, out_alert, &ssl->version, &versions)) { - return 0; + return false; } // At this point, the connection's version is known and |ssl->version| is @@ -284,10 +256,10 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, ssl_protocol_version(ssl) < hs->max_version) { OPENSSL_PUT_ERROR(SSL, SSL_R_INAPPROPRIATE_FALLBACK); *out_alert = SSL3_AD_INAPPROPRIATE_FALLBACK; - return 0; + return false; } - return 1; + return true; } static UniquePtr ssl_parse_client_cipher_list( @@ -327,11 +299,10 @@ static UniquePtr ssl_parse_client_cipher_list( static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, uint32_t *out_mask_k, uint32_t *out_mask_a) { - SSL *const ssl = hs->ssl; uint32_t mask_k = 0; uint32_t mask_a = 0; - if (ssl_has_certificate(ssl)) { + if (ssl_has_certificate(hs)) { mask_a |= ssl_cipher_auth_mask_for_key(hs->local_pubkey.get()); if (EVP_PKEY_id(hs->local_pubkey.get()) == EVP_PKEY_RSA) { mask_k |= SSL_kRSA; @@ -345,7 +316,7 @@ static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, } // PSK requires a server callback. - if (ssl->psk_server_callback != NULL) { + if (hs->config->psk_server_callback != NULL) { mask_k |= SSL_kPSK; mask_a |= SSL_aPSK; } @@ -356,14 +327,14 @@ static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, static const SSL_CIPHER *ssl3_choose_cipher( SSL_HANDSHAKE *hs, const SSL_CLIENT_HELLO *client_hello, - const struct ssl_cipher_preference_list_st *server_pref) { + const SSLCipherPreferenceList *server_pref) { SSL *const ssl = hs->ssl; - STACK_OF(SSL_CIPHER) *prio, *allow; + const STACK_OF(SSL_CIPHER) *prio, *allow; // in_group_flags will either be NULL, or will point to an array of bytes // which indicate equal-preference groups in the |prio| stack. See the - // comment about |in_group_flags| in the |ssl_cipher_preference_list_st| + // comment about |in_group_flags| in the |SSLCipherPreferenceList| // struct. - const uint8_t *in_group_flags; + const bool *in_group_flags; // group_min contains the minimal index so far found in a group, or -1 if no // such value exists yet. int group_min = -1; @@ -375,13 +346,13 @@ static const SSL_CIPHER *ssl3_choose_cipher( } if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { - prio = server_pref->ciphers; + prio = server_pref->ciphers.get(); in_group_flags = server_pref->in_group_flags; allow = client_pref.get(); } else { prio = client_pref.get(); in_group_flags = NULL; - allow = server_pref->ciphers; + allow = server_pref->ciphers.get(); } uint32_t mask_k, mask_a; @@ -399,7 +370,7 @@ static const SSL_CIPHER *ssl3_choose_cipher( (c->algorithm_auth & mask_a) && // Check the cipher is in the |allow| list. sk_SSL_CIPHER_find(allow, &cipher_index, c)) { - if (in_group_flags != NULL && in_group_flags[i] == 1) { + if (in_group_flags != NULL && in_group_flags[i]) { // This element of |prio| is in a group. Update the minimum index found // so far and continue looking. if (group_min == -1 || (size_t)group_min > cipher_index) { @@ -413,7 +384,7 @@ static const SSL_CIPHER *ssl3_choose_cipher( } } - if (in_group_flags != NULL && in_group_flags[i] == 0 && group_min != -1) { + if (in_group_flags != NULL && !in_group_flags[i] && group_min != -1) { // We are about to leave a group, but we found a match in it, so that's // our answer. return sk_SSL_CIPHER_value(allow, group_min); @@ -425,10 +396,160 @@ static const SSL_CIPHER *ssl3_choose_cipher( static enum ssl_hs_wait_t do_start_accept(SSL_HANDSHAKE *hs) { ssl_do_info_callback(hs->ssl, SSL_CB_HANDSHAKE_START, 1); - hs->state = state_read_client_hello; + hs->state = state12_read_client_hello; return ssl_hs_ok; } +// is_probably_jdk11_with_tls13 returns whether |client_hello| was probably sent +// from a JDK 11 client with both TLS 1.3 and a prior version enabled. +static bool is_probably_jdk11_with_tls13(const SSL_CLIENT_HELLO *client_hello) { + // JDK 11 ClientHellos contain a number of unusual properties which should + // limit false positives. + + // JDK 11 does not support ChaCha20-Poly1305. This is unusual: many modern + // clients implement ChaCha20-Poly1305. + if (ssl_client_cipher_list_contains_cipher( + client_hello, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { + return false; + } + + // JDK 11 always sends extensions in a particular order. + constexpr uint16_t kMaxFragmentLength = 0x0001; + constexpr uint16_t kStatusRequestV2 = 0x0011; + static CONSTEXPR_ARRAY struct { + uint16_t id; + bool required; + } kJavaExtensions[] = { + {TLSEXT_TYPE_server_name, false}, + {kMaxFragmentLength, false}, + {TLSEXT_TYPE_status_request, false}, + {TLSEXT_TYPE_supported_groups, true}, + {TLSEXT_TYPE_ec_point_formats, false}, + {TLSEXT_TYPE_signature_algorithms, true}, + // Java always sends signature_algorithms_cert. + {TLSEXT_TYPE_signature_algorithms_cert, true}, + {TLSEXT_TYPE_application_layer_protocol_negotiation, false}, + {kStatusRequestV2, false}, + {TLSEXT_TYPE_extended_master_secret, false}, + {TLSEXT_TYPE_supported_versions, true}, + {TLSEXT_TYPE_cookie, false}, + {TLSEXT_TYPE_psk_key_exchange_modes, true}, + {TLSEXT_TYPE_key_share, true}, + {TLSEXT_TYPE_renegotiate, false}, + {TLSEXT_TYPE_pre_shared_key, false}, + }; + Span sigalgs, sigalgs_cert; + bool has_status_request = false, has_status_request_v2 = false; + CBS extensions, supported_groups; + CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); + for (const auto &java_extension : kJavaExtensions) { + CBS copy = extensions; + uint16_t id; + if (CBS_get_u16(©, &id) && id == java_extension.id) { + // The next extension is the one we expected. + extensions = copy; + CBS body; + if (!CBS_get_u16_length_prefixed(&extensions, &body)) { + return false; + } + switch (id) { + case TLSEXT_TYPE_status_request: + has_status_request = true; + break; + case kStatusRequestV2: + has_status_request_v2 = true; + break; + case TLSEXT_TYPE_signature_algorithms: + sigalgs = body; + break; + case TLSEXT_TYPE_signature_algorithms_cert: + sigalgs_cert = body; + break; + case TLSEXT_TYPE_supported_groups: + supported_groups = body; + break; + } + } else if (java_extension.required) { + return false; + } + } + if (CBS_len(&extensions) != 0) { + return false; + } + + // JDK 11 never advertises X25519. It is not offered by default, and + // -Djdk.tls.namedGroups=x25519 does not work. This is unusual: many modern + // clients implement X25519. + while (CBS_len(&supported_groups) > 0) { + uint16_t group; + if (!CBS_get_u16(&supported_groups, &group) || + group == SSL_CURVE_X25519) { + return false; + } + } + + if (// JDK 11 always sends the same contents in signature_algorithms and + // signature_algorithms_cert. This is unusual: signature_algorithms_cert, + // if omitted, is treated as if it were signature_algorithms. + sigalgs != sigalgs_cert || + // When TLS 1.2 or below is enabled, JDK 11 sends status_request_v2 iff it + // sends status_request. This is unusual: status_request_v2 is not widely + // implemented. + has_status_request != has_status_request_v2) { + return false; + } + + return true; +} + +static bool extract_sni(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + CBS sni; + if (!ssl_client_hello_get_extension(client_hello, &sni, + TLSEXT_TYPE_server_name)) { + // No SNI extension to parse. + return true; + } + + CBS server_name_list, host_name; + uint8_t name_type; + if (!CBS_get_u16_length_prefixed(&sni, &server_name_list) || + !CBS_get_u8(&server_name_list, &name_type) || + // Although the server_name extension was intended to be extensible to + // new name types and multiple names, OpenSSL 1.0.x had a bug which meant + // different name types will cause an error. Further, RFC 4366 originally + // defined syntax inextensibly. RFC 6066 corrected this mistake, but + // adding new name types is no longer feasible. + // + // Act as if the extensibility does not exist to simplify parsing. + !CBS_get_u16_length_prefixed(&server_name_list, &host_name) || + CBS_len(&server_name_list) != 0 || + CBS_len(&sni) != 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + if (name_type != TLSEXT_NAMETYPE_host_name || + CBS_len(&host_name) == 0 || + CBS_len(&host_name) > TLSEXT_MAXLEN_host_name || + CBS_contains_zero_byte(&host_name)) { + *out_alert = SSL_AD_UNRECOGNIZED_NAME; + return false; + } + + // Copy the hostname as a string. + char *raw = nullptr; + if (!CBS_strdup(&host_name, &raw)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + ssl->s3->hostname.reset(raw); + + hs->should_ack_sni = true; + return true; +} + static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; @@ -441,10 +562,6 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (ssl->handoff) { - return ssl_hs_handoff; - } - SSL_CLIENT_HELLO client_hello; if (!ssl_client_hello_init(ssl, &client_hello, msg)) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); @@ -452,6 +569,16 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + if (hs->config->handoff) { + return ssl_hs_handoff; + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!extract_sni(hs, &alert, &client_hello)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + // Run the early callback. if (ssl->ctx->select_certificate_cb != NULL) { switch (ssl->ctx->select_certificate_cb(&client_hello)) { @@ -470,11 +597,15 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { } // Freeze the version range after the early callback. - if (!ssl_get_version_range(ssl, &hs->min_version, &hs->max_version)) { + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { return ssl_hs_error; } - uint8_t alert = SSL_AD_DECODE_ERROR; + if (hs->config->jdk11_workaround && + is_probably_jdk11_with_tls13(&client_hello)) { + hs->apply_jdk11_workaround = true; + } + if (!negotiate_version(hs, &alert, &client_hello)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; @@ -505,7 +636,7 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - hs->state = state_select_certificate; + hs->state = state12_select_certificate; return ssl_hs_ok; } @@ -518,8 +649,8 @@ static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { } // Call |cert_cb| to update server certificates if required. - if (ssl->cert->cert_cb != NULL) { - int rv = ssl->cert->cert_cb(ssl, ssl->cert->cert_cb_arg); + if (hs->config->cert->cert_cb != NULL) { + int rv = hs->config->cert->cert_cb(ssl, hs->config->cert->cert_cb_arg); if (rv == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_CB_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); @@ -534,12 +665,30 @@ static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + if (hs->ocsp_stapling_requested && + ssl->ctx->legacy_ocsp_callback != nullptr) { + switch (ssl->ctx->legacy_ocsp_callback( + ssl, ssl->ctx->legacy_ocsp_callback_arg)) { + case SSL_TLSEXT_ERR_OK: + break; + case SSL_TLSEXT_ERR_NOACK: + hs->ocsp_stapling_requested = false; + break; + default: + OPENSSL_PUT_ERROR(SSL, SSL_R_OCSP_CB_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + } + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { // Jump to the TLS 1.3 state machine. - hs->state = state_tls13; + hs->state = state12_tls13; return ssl_hs_ok; } + ssl->s3->early_data_reason = ssl_early_data_protocol_version; + SSL_CLIENT_HELLO client_hello; if (!ssl_client_hello_init(ssl, &client_hello, msg)) { return ssl_hs_error; @@ -547,22 +696,24 @@ static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { // Negotiate the cipher suite. This must be done after |cert_cb| so the // certificate is finalized. - hs->new_cipher = - ssl3_choose_cipher(hs, &client_hello, ssl_get_cipher_preferences(ssl)); + SSLCipherPreferenceList *prefs = hs->config->cipher_list + ? hs->config->cipher_list.get() + : ssl->ctx->cipher_list.get(); + hs->new_cipher = ssl3_choose_cipher(hs, &client_hello, prefs); if (hs->new_cipher == NULL) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_CIPHER); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); return ssl_hs_error; } - hs->state = state_select_parameters; + hs->state = state12_select_parameters; return ssl_hs_ok; } static enum ssl_hs_wait_t do_tls13(SSL_HANDSHAKE *hs) { enum ssl_hs_wait_t wait = tls13_server_handshake(hs); if (wait == ssl_hs_ok) { - hs->state = state_finish_server_handshake; + hs->state = state12_finish_server_handshake; return ssl_hs_ok; } @@ -586,7 +737,7 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { UniquePtr session; bool tickets_supported = false, renew_ticket = false; enum ssl_hs_wait_t wait = ssl_get_prev_session( - ssl, &session, &tickets_supported, &renew_ticket, &client_hello); + hs, &session, &tickets_supported, &renew_ticket, &client_hello); if (wait != ssl_hs_ok) { return wait; } @@ -611,7 +762,7 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { if (session) { // Use the old session. hs->ticket_expected = renew_ticket; - ssl->session = session.release(); + ssl->session = std::move(session); ssl->s3->session_reused = true; } else { hs->ticket_expected = tickets_supported; @@ -638,10 +789,10 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { hs->new_session->cipher = hs->new_cipher; // Determine whether to request a client certificate. - hs->cert_request = !!(ssl->verify_mode & SSL_VERIFY_PEER); + hs->cert_request = !!(hs->config->verify_mode & SSL_VERIFY_PEER); // Only request a certificate if Channel ID isn't negotiated. - if ((ssl->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && - ssl->s3->tlsext_channel_id_valid) { + if ((hs->config->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && + ssl->s3->channel_id_valid) { hs->cert_request = false; } // CertificateRequest may only be sent in certificate-based ciphers. @@ -672,25 +823,32 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - // Release the handshake buffer if client authentication isn't required. - if (!hs->cert_request) { + // Handback includes the whole handshake transcript, so we cannot free the + // transcript buffer in the handback case. + if (!hs->cert_request && !hs->handback) { hs->transcript.FreeBuffer(); } ssl->method->next_message(ssl); - hs->state = state_send_server_hello; + hs->state = state12_send_server_hello; return ssl_hs_ok; } +static void copy_suffix(Span out, Span in) { + out = out.subspan(out.size() - in.size()); + assert(out.size() == in.size()); + OPENSSL_memcpy(out.data(), in.data(), in.size()); +} + static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // We only accept ChannelIDs on connections with ECDHE in order to avoid a // known attack while we fix ChannelID itself. - if (ssl->s3->tlsext_channel_id_valid && + if (ssl->s3->channel_id_valid && (hs->new_cipher->algorithm_mkey & SSL_kECDHE) == 0) { - ssl->s3->tlsext_channel_id_valid = false; + ssl->s3->channel_id_valid = false; } // If this is a resumption and the original handshake didn't support @@ -698,7 +856,7 @@ static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { // session and so cannot resume with ChannelIDs. if (ssl->session != NULL && ssl->session->original_handshake_hash_len == 0) { - ssl->s3->tlsext_channel_id_valid = false; + ssl->s3->channel_id_valid = false; } struct OPENSSL_timeval now; @@ -711,20 +869,27 @@ static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - // Implement the TLS 1.3 anti-downgrade feature, but with a different value. - // - // For draft TLS 1.3 versions, it is not safe to deploy this feature. However, - // some TLS terminators are non-compliant and copy the origin server's value, - // so we wish to measure eventual compatibility impact. - if (hs->max_version >= TLS1_3_VERSION) { - OPENSSL_memcpy(ssl->s3->server_random + SSL3_RANDOM_SIZE - - sizeof(kDraftDowngradeRandom), - kDraftDowngradeRandom, sizeof(kDraftDowngradeRandom)); + // Implement the TLS 1.3 anti-downgrade feature. + if (ssl_supports_version(hs, TLS1_3_VERSION)) { + if (ssl_protocol_version(ssl) == TLS1_2_VERSION) { + if (hs->apply_jdk11_workaround) { + // JDK 11 implements the TLS 1.3 downgrade signal, so we cannot send it + // here. However, the signal is only effective if all TLS 1.2 + // ServerHellos produced by the server are marked. Thus we send a + // different non-standard signal for the time being, until JDK 11.0.2 is + // released and clients have updated. + copy_suffix(ssl->s3->server_random, kJDK11DowngradeRandom); + } else { + copy_suffix(ssl->s3->server_random, kTLS13DowngradeRandom); + } + } else { + copy_suffix(ssl->s3->server_random, kTLS12DowngradeRandom); + } } const SSL_SESSION *session = hs->new_session.get(); - if (ssl->session != NULL) { - session = ssl->session; + if (ssl->session != nullptr) { + session = ssl->session.get(); } ScopedCBB cbb; @@ -744,9 +909,9 @@ static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { } if (ssl->session != NULL) { - hs->state = state_send_server_finished; + hs->state = state12_send_server_finished; } else { - hs->state = state_send_server_certificate; + hs->state = state12_send_server_certificate; } return ssl_hs_ok; } @@ -756,12 +921,12 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { ScopedCBB cbb; if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { - if (!ssl_has_certificate(ssl)) { + if (!ssl_has_certificate(hs)) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); return ssl_hs_error; } - if (!ssl_output_cert_chain(ssl)) { + if (!ssl_output_cert_chain(hs)) { return ssl_hs_error; } @@ -771,9 +936,10 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { SSL3_MT_CERTIFICATE_STATUS) || !CBB_add_u8(&body, TLSEXT_STATUSTYPE_ocsp) || !CBB_add_u24_length_prefixed(&body, &ocsp_response) || - !CBB_add_bytes(&ocsp_response, - CRYPTO_BUFFER_data(ssl->cert->ocsp_response), - CRYPTO_BUFFER_len(ssl->cert->ocsp_response)) || + !CBB_add_bytes( + &ocsp_response, + CRYPTO_BUFFER_data(hs->config->cert->ocsp_response.get()), + CRYPTO_BUFFER_len(hs->config->cert->ocsp_response.get())) || !ssl_add_message_cbb(ssl, cbb.get())) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return ssl_hs_error; @@ -785,8 +951,7 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { uint32_t alg_k = hs->new_cipher->algorithm_mkey; uint32_t alg_a = hs->new_cipher->algorithm_auth; if (ssl_cipher_requires_server_key_exchange(hs->new_cipher) || - ((alg_a & SSL_aPSK) && ssl->psk_identity_hint)) { - + ((alg_a & SSL_aPSK) && hs->config->psk_identity_hint)) { // Pre-allocate enough room to comfortably fit an ECDHE public key. Prepend // the client and server randoms for the signing transcript. CBB child; @@ -798,10 +963,12 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { // PSK ciphers begin with an identity hint. if (alg_a & SSL_aPSK) { - size_t len = - (ssl->psk_identity_hint == NULL) ? 0 : strlen(ssl->psk_identity_hint); + size_t len = hs->config->psk_identity_hint == nullptr + ? 0 + : strlen(hs->config->psk_identity_hint.get()); if (!CBB_add_u16_length_prefixed(cbb.get(), &child) || - !CBB_add_bytes(&child, (const uint8_t *)ssl->psk_identity_hint, + !CBB_add_bytes(&child, + (const uint8_t *)hs->config->psk_identity_hint.get(), len)) { return ssl_hs_error; } @@ -818,12 +985,12 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { hs->new_session->group_id = group_id; // Set up ECDH, generate a key, and emit the public half. - hs->key_share = SSLKeyShare::Create(group_id); - if (!hs->key_share || + hs->key_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || !CBB_add_u8(cbb.get(), NAMED_CURVE_TYPE) || !CBB_add_u16(cbb.get(), group_id) || !CBB_add_u8_length_prefixed(cbb.get(), &child) || - !hs->key_share->Offer(&child)) { + !hs->key_shares[0]->Offer(&child)) { return ssl_hs_error; } } else { @@ -835,7 +1002,7 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { } } - hs->state = state_send_server_key_exchange; + hs->state = state12_send_server_key_exchange; return ssl_hs_ok; } @@ -843,7 +1010,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; if (hs->server_params.size() == 0) { - hs->state = state_send_server_hello_done; + hs->state = state12_send_server_hello_done; return ssl_hs_ok; } @@ -860,7 +1027,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { // Add a signature. if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { - if (!ssl_has_private_key(ssl)) { + if (!ssl_has_private_key(hs)) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; } @@ -868,6 +1035,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { // Determine the signature algorithm. uint16_t signature_algorithm; if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); return ssl_hs_error; } if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { @@ -907,7 +1075,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { hs->server_params.Reset(); - hs->state = state_send_server_hello_done; + hs->state = state12_send_server_hello_done; return ssl_hs_ok; } @@ -923,12 +1091,11 @@ static enum ssl_hs_wait_t do_send_server_hello_done(SSL_HANDSHAKE *hs) { SSL3_MT_CERTIFICATE_REQUEST) || !CBB_add_u8_length_prefixed(&body, &cert_types) || !CBB_add_u8(&cert_types, SSL3_CT_RSA_SIGN) || - (ssl_protocol_version(ssl) >= TLS1_VERSION && - !CBB_add_u8(&cert_types, TLS_CT_ECDSA_SIGN)) || + !CBB_add_u8(&cert_types, TLS_CT_ECDSA_SIGN) || (ssl_protocol_version(ssl) >= TLS1_2_VERSION && (!CBB_add_u16_length_prefixed(&body, &sigalgs_cbb) || !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb))) || - !ssl_add_client_CA_list(ssl, &body) || + !ssl_add_client_CA_list(hs, &body) || !ssl_add_message_cbb(ssl, cbb.get())) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return ssl_hs_error; @@ -942,15 +1109,18 @@ static enum ssl_hs_wait_t do_send_server_hello_done(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - hs->state = state_read_client_certificate; + hs->state = state12_read_client_certificate; return ssl_hs_flush; } static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; + if (hs->handback && hs->new_cipher->algorithm_mkey == SSL_kECDHE) { + return ssl_hs_handback; + } if (!hs->cert_request) { - hs->state = state_verify_client_certificate; + hs->state = state12_verify_client_certificate; return ssl_hs_ok; } @@ -959,26 +1129,7 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_read_message; } - if (msg.type != SSL3_MT_CERTIFICATE) { - if (ssl->version == SSL3_VERSION && - msg.type == SSL3_MT_CLIENT_KEY_EXCHANGE) { - // In SSL 3.0, the Certificate message is omitted to signal no - // certificate. - if (ssl->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); - return ssl_hs_error; - } - - // OpenSSL returns X509_V_OK when no certificates are received. This is - // classed by them as a bug, but it's assumed by at least NGINX. - hs->new_session->verify_result = X509_V_OK; - hs->state = state_verify_client_certificate; - return ssl_hs_ok; - } - - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE)) { return ssl_hs_error; } @@ -988,17 +1139,14 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { CBS certificate_msg = msg.body; uint8_t alert = SSL_AD_DECODE_ERROR; - UniquePtr chain; - if (!ssl_parse_cert_chain(&alert, &chain, &hs->peer_pubkey, - ssl->retain_only_sha256_of_client_certs + if (!ssl_parse_cert_chain(&alert, &hs->new_session->certs, &hs->peer_pubkey, + hs->config->retain_only_sha256_of_client_certs ? hs->new_session->peer_sha256 - : NULL, + : nullptr, &certificate_msg, ssl->ctx->pool)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = chain.release(); if (CBS_len(&certificate_msg) != 0 || !ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { @@ -1007,19 +1155,11 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0) { + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { // No client certificate so the handshake buffer may be discarded. hs->transcript.FreeBuffer(); - // In SSL 3.0, sending no certificate is signaled by omitting the - // Certificate message. - if (ssl->version == SSL3_VERSION) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATES_RETURNED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); - return ssl_hs_error; - } - - if (ssl->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) { + if (hs->config->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) { // Fail for TLS only if we required a certificate OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -1029,18 +1169,18 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { // OpenSSL returns X509_V_OK when no certificates are received. This is // classed by them as a bug, but it's assumed by at least NGINX. hs->new_session->verify_result = X509_V_OK; - } else if (ssl->retain_only_sha256_of_client_certs) { + } else if (hs->config->retain_only_sha256_of_client_certs) { // The hash will have been filled in. hs->new_session->peer_sha256_valid = 1; } ssl->method->next_message(ssl); - hs->state = state_verify_client_certificate; + hs->state = state12_verify_client_certificate; return ssl_hs_ok; } static enum ssl_hs_wait_t do_verify_client_certificate(SSL_HANDSHAKE *hs) { - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) > 0) { + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) > 0) { switch (ssl_verify_peer_cert(hs)) { case ssl_verify_ok: break; @@ -1051,7 +1191,7 @@ static enum ssl_hs_wait_t do_verify_client_certificate(SSL_HANDSHAKE *hs) { } } - hs->state = state_read_client_key_exchange; + hs->state = state12_read_client_key_exchange; return ssl_hs_ok; } @@ -1089,28 +1229,25 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } - - if (!CBS_strdup(&psk_identity, &hs->new_session->psk_identity)) { + char *raw = nullptr; + if (!CBS_strdup(&psk_identity, &raw)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; } + hs->new_session->psk_identity.reset(raw); } // Depending on the key exchange method, compute |premaster_secret|. Array premaster_secret; if (alg_k & SSL_kRSA) { CBS encrypted_premaster_secret; - if (ssl->version > SSL3_VERSION) { - if (!CBS_get_u16_length_prefixed(&client_key_exchange, - &encrypted_premaster_secret) || - CBS_len(&client_key_exchange) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - } else { - encrypted_premaster_secret = client_key_exchange; + if (!CBS_get_u16_length_prefixed(&client_key_exchange, + &encrypted_premaster_secret) || + CBS_len(&client_key_exchange) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; } // Allocate a buffer large enough for an RSA decryption. @@ -1139,6 +1276,8 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + CONSTTIME_SECRET(decrypt_buf.data(), decrypt_len); + // Prepare a random premaster, to be used on invalid padding. See RFC 5246, // section 7.4.7.1. if (!premaster_secret.Init(SSL_MAX_MASTER_KEY_LENGTH) || @@ -1188,13 +1327,14 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { // Compute the premaster. uint8_t alert = SSL_AD_DECODE_ERROR; - if (!hs->key_share->Finish(&premaster_secret, &alert, peer_key)) { + if (!hs->key_shares[0]->Finish(&premaster_secret, &alert, peer_key)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } // The key exchange state may now be discarded. - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); } else if (!(alg_k & SSL_kPSK)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -1204,7 +1344,7 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { // For a PSK cipher suite, the actual pre-master secret is combined with the // pre-shared key. if (alg_a & SSL_aPSK) { - if (ssl->psk_server_callback == NULL) { + if (hs->config->psk_server_callback == NULL) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; @@ -1212,8 +1352,8 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { // Look up the key for the identity. uint8_t psk[PSK_MAX_PSK_LEN]; - unsigned psk_len = ssl->psk_server_callback( - ssl, hs->new_session->psk_identity, psk, sizeof(psk)); + unsigned psk_len = hs->config->psk_server_callback( + ssl, hs->new_session->psk_identity.get(), psk, sizeof(psk)); if (psk_len > PSK_MAX_PSK_LEN) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); @@ -1260,9 +1400,11 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } hs->new_session->extended_master_secret = hs->extended_master_secret; + CONSTTIME_DECLASSIFY(hs->new_session->master_key, + hs->new_session->master_key_length); ssl->method->next_message(ssl); - hs->state = state_read_client_certificate_verify; + hs->state = state12_read_client_certificate_verify; return ssl_hs_ok; } @@ -1273,7 +1415,7 @@ static enum ssl_hs_wait_t do_read_client_certificate_verify(SSL_HANDSHAKE *hs) { // CertificateVerify is required if and only if there's a client certificate. if (!hs->peer_pubkey) { hs->transcript.FreeBuffer(); - hs->state = state_read_change_cipher_spec; + hs->state = state12_read_change_cipher_spec; return ssl_hs_ok; } @@ -1317,34 +1459,8 @@ static enum ssl_hs_wait_t do_read_client_certificate_verify(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - bool sig_ok; - // The SSL3 construction for CertificateVerify does not decompose into a - // single final digest and signature, and must be special-cased. - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - uint8_t digest[EVP_MAX_MD_SIZE]; - size_t digest_len; - if (!hs->transcript.GetSSL3CertVerifyHash( - digest, &digest_len, hs->new_session.get(), signature_algorithm)) { - return ssl_hs_error; - } - - UniquePtr pctx( - EVP_PKEY_CTX_new(hs->peer_pubkey.get(), nullptr)); - sig_ok = pctx && - EVP_PKEY_verify_init(pctx.get()) && - EVP_PKEY_verify(pctx.get(), CBS_data(&signature), - CBS_len(&signature), digest, digest_len); - } else { - sig_ok = - ssl_public_key_verify(ssl, signature, signature_algorithm, - hs->peer_pubkey.get(), hs->transcript.buffer()); - } - -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = true; - ERR_clear_error(); -#endif - if (!sig_ok) { + if (!ssl_public_key_verify(ssl, signature, signature_algorithm, + hs->peer_pubkey.get(), hs->transcript.buffer())) { OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); return ssl_hs_error; @@ -1358,12 +1474,15 @@ static enum ssl_hs_wait_t do_read_client_certificate_verify(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->state = state_read_change_cipher_spec; + hs->state = state12_read_change_cipher_spec; return ssl_hs_ok; } static enum ssl_hs_wait_t do_read_change_cipher_spec(SSL_HANDSHAKE *hs) { - hs->state = state_process_change_cipher_spec; + if (hs->handback && hs->ssl->session != NULL) { + return ssl_hs_handback; + } + hs->state = state12_process_change_cipher_spec; return ssl_hs_read_change_cipher_spec; } @@ -1372,7 +1491,7 @@ static enum ssl_hs_wait_t do_process_change_cipher_spec(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - hs->state = state_read_next_proto; + hs->state = state12_read_next_proto; return ssl_hs_ok; } @@ -1380,7 +1499,7 @@ static enum ssl_hs_wait_t do_read_next_proto(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; if (!hs->next_proto_neg_seen) { - hs->state = state_read_channel_id; + hs->state = state12_read_channel_id; return ssl_hs_ok; } @@ -1408,15 +1527,15 @@ static enum ssl_hs_wait_t do_read_next_proto(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->state = state_read_channel_id; + hs->state = state12_read_channel_id; return ssl_hs_ok; } static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (!ssl->s3->tlsext_channel_id_valid) { - hs->state = state_read_client_finished; + if (!ssl->s3->channel_id_valid) { + hs->state = state12_read_client_finished; return ssl_hs_ok; } @@ -1432,7 +1551,7 @@ static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->state = state_read_client_finished; + hs->state = state12_read_client_finished; return ssl_hs_ok; } @@ -1444,15 +1563,15 @@ static enum ssl_hs_wait_t do_read_client_finished(SSL_HANDSHAKE *hs) { } if (ssl->session != NULL) { - hs->state = state_finish_server_handshake; + hs->state = state12_finish_server_handshake; } else { - hs->state = state_send_server_finished; + hs->state = state12_send_server_finished; } // If this is a full handshake with ChannelID then record the handshake // hashes in |hs->new_session| in case we need them to verify a // ChannelID signature on a resumption of this session in the future. - if (ssl->session == NULL && ssl->s3->tlsext_channel_id_valid && + if (ssl->session == NULL && ssl->s3->channel_id_valid && !tls1_record_handshake_hashes_for_channel_id(hs)) { return ssl_hs_error; } @@ -1473,7 +1592,8 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { } else { // We are renewing an existing session. Duplicate the session to adjust // the timeout. - session_copy = SSL_SESSION_dup(ssl->session, SSL_SESSION_INCLUDE_NONAUTH); + session_copy = + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_INCLUDE_NONAUTH); if (!session_copy) { return ssl_hs_error; } @@ -1488,7 +1608,7 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { SSL3_MT_NEW_SESSION_TICKET) || !CBB_add_u32(&body, session->timeout) || !CBB_add_u16_length_prefixed(&body, &ticket) || - !ssl_encrypt_ticket(ssl, &ticket, session) || + !ssl_encrypt_ticket(hs, &ticket, session) || !ssl_add_message_cbb(ssl, cbb.get())) { return ssl_hs_error; } @@ -1501,9 +1621,9 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { } if (ssl->session != NULL) { - hs->state = state_read_change_cipher_spec; + hs->state = state12_read_change_cipher_spec; } else { - hs->state = state_finish_server_handshake; + hs->state = state12_finish_server_handshake; } return ssl_hs_flush; } @@ -1511,98 +1631,101 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { static enum ssl_hs_wait_t do_finish_server_handshake(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; + if (hs->handback) { + return ssl_hs_handback; + } + ssl->method->on_handshake_complete(ssl); // If we aren't retaining peer certificates then we can discard it now. - if (hs->new_session != NULL && ssl->retain_only_sha256_of_client_certs) { - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = NULL; + if (hs->new_session != NULL && + hs->config->retain_only_sha256_of_client_certs) { + hs->new_session->certs.reset(); ssl->ctx->x509_method->session_clear(hs->new_session.get()); } if (ssl->session != NULL) { - SSL_SESSION_up_ref(ssl->session); - ssl->s3->established_session.reset(ssl->session); + ssl->s3->established_session = UpRef(ssl->session); } else { ssl->s3->established_session = std::move(hs->new_session); - ssl->s3->established_session->not_resumable = 0; + ssl->s3->established_session->not_resumable = false; } hs->handshake_finalized = true; ssl->s3->initial_handshake_complete = true; ssl_update_cache(hs, SSL_SESS_CACHE_SERVER); - hs->state = state_done; + hs->state = state12_done; return ssl_hs_ok; } enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs) { - while (hs->state != state_done) { + while (hs->state != state12_done) { enum ssl_hs_wait_t ret = ssl_hs_error; - enum ssl_server_hs_state_t state = - static_cast(hs->state); + enum tls12_server_hs_state_t state = + static_cast(hs->state); switch (state) { - case state_start_accept: + case state12_start_accept: ret = do_start_accept(hs); break; - case state_read_client_hello: + case state12_read_client_hello: ret = do_read_client_hello(hs); break; - case state_select_certificate: + case state12_select_certificate: ret = do_select_certificate(hs); break; - case state_tls13: + case state12_tls13: ret = do_tls13(hs); break; - case state_select_parameters: + case state12_select_parameters: ret = do_select_parameters(hs); break; - case state_send_server_hello: + case state12_send_server_hello: ret = do_send_server_hello(hs); break; - case state_send_server_certificate: + case state12_send_server_certificate: ret = do_send_server_certificate(hs); break; - case state_send_server_key_exchange: + case state12_send_server_key_exchange: ret = do_send_server_key_exchange(hs); break; - case state_send_server_hello_done: + case state12_send_server_hello_done: ret = do_send_server_hello_done(hs); break; - case state_read_client_certificate: + case state12_read_client_certificate: ret = do_read_client_certificate(hs); break; - case state_verify_client_certificate: + case state12_verify_client_certificate: ret = do_verify_client_certificate(hs); break; - case state_read_client_key_exchange: + case state12_read_client_key_exchange: ret = do_read_client_key_exchange(hs); break; - case state_read_client_certificate_verify: + case state12_read_client_certificate_verify: ret = do_read_client_certificate_verify(hs); break; - case state_read_change_cipher_spec: + case state12_read_change_cipher_spec: ret = do_read_change_cipher_spec(hs); break; - case state_process_change_cipher_spec: + case state12_process_change_cipher_spec: ret = do_process_change_cipher_spec(hs); break; - case state_read_next_proto: + case state12_read_next_proto: ret = do_read_next_proto(hs); break; - case state_read_channel_id: + case state12_read_channel_id: ret = do_read_channel_id(hs); break; - case state_read_client_finished: + case state12_read_client_finished: ret = do_read_client_finished(hs); break; - case state_send_server_finished: + case state12_send_server_finished: ret = do_send_server_finished(hs); break; - case state_finish_server_handshake: + case state12_finish_server_handshake: ret = do_finish_server_handshake(hs); break; - case state_done: + case state12_done: ret = ssl_hs_ok; break; } @@ -1621,54 +1744,54 @@ enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs) { } const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs) { - enum ssl_server_hs_state_t state = - static_cast(hs->state); + enum tls12_server_hs_state_t state = + static_cast(hs->state); switch (state) { - case state_start_accept: + case state12_start_accept: return "TLS server start_accept"; - case state_read_client_hello: + case state12_read_client_hello: return "TLS server read_client_hello"; - case state_select_certificate: + case state12_select_certificate: return "TLS server select_certificate"; - case state_tls13: + case state12_tls13: return tls13_server_handshake_state(hs); - case state_select_parameters: + case state12_select_parameters: return "TLS server select_parameters"; - case state_send_server_hello: + case state12_send_server_hello: return "TLS server send_server_hello"; - case state_send_server_certificate: + case state12_send_server_certificate: return "TLS server send_server_certificate"; - case state_send_server_key_exchange: + case state12_send_server_key_exchange: return "TLS server send_server_key_exchange"; - case state_send_server_hello_done: + case state12_send_server_hello_done: return "TLS server send_server_hello_done"; - case state_read_client_certificate: + case state12_read_client_certificate: return "TLS server read_client_certificate"; - case state_verify_client_certificate: + case state12_verify_client_certificate: return "TLS server verify_client_certificate"; - case state_read_client_key_exchange: + case state12_read_client_key_exchange: return "TLS server read_client_key_exchange"; - case state_read_client_certificate_verify: + case state12_read_client_certificate_verify: return "TLS server read_client_certificate_verify"; - case state_read_change_cipher_spec: + case state12_read_change_cipher_spec: return "TLS server read_change_cipher_spec"; - case state_process_change_cipher_spec: + case state12_process_change_cipher_spec: return "TLS server process_change_cipher_spec"; - case state_read_next_proto: + case state12_read_next_proto: return "TLS server read_next_proto"; - case state_read_channel_id: + case state12_read_channel_id: return "TLS server read_channel_id"; - case state_read_client_finished: + case state12_read_client_finished: return "TLS server read_client_finished"; - case state_send_server_finished: + case state12_send_server_finished: return "TLS server send_server_finished"; - case state_finish_server_handshake: + case state12_finish_server_handshake: return "TLS server finish_server_handshake"; - case state_done: + case state12_done: return "TLS server done"; } return "TLS server unknown"; } -} +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/handshake_server.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc.grpc_back similarity index 75% rename from Pods/BoringSSL-GRPC/ssl/handshake_server.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc.grpc_back index fa8a24104..dfe14bf4c 100644 --- a/Pods/BoringSSL-GRPC/ssl/handshake_server.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/handshake_server.cc.grpc_back @@ -152,7 +152,6 @@ #include #include -#include #include #include #include @@ -170,34 +169,10 @@ #include "../crypto/internal.h" -namespace bssl { - -enum ssl_server_hs_state_t { - state_start_accept = 0, - state_read_client_hello, - state_select_certificate, - state_tls13, - state_select_parameters, - state_send_server_hello, - state_send_server_certificate, - state_send_server_key_exchange, - state_send_server_hello_done, - state_read_client_certificate, - state_verify_client_certificate, - state_read_client_key_exchange, - state_read_client_certificate_verify, - state_read_change_cipher_spec, - state_process_change_cipher_spec, - state_read_next_proto, - state_read_channel_id, - state_read_client_finished, - state_send_server_finished, - state_finish_server_handshake, - state_done, -}; - -int ssl_client_cipher_list_contains_cipher(const SSL_CLIENT_HELLO *client_hello, - uint16_t id) { +BSSL_NAMESPACE_BEGIN + +bool ssl_client_cipher_list_contains_cipher( + const SSL_CLIENT_HELLO *client_hello, uint16_t id) { CBS cipher_suites; CBS_init(&cipher_suites, client_hello->cipher_suites, client_hello->cipher_suites_len); @@ -205,19 +180,19 @@ int ssl_client_cipher_list_contains_cipher(const SSL_CLIENT_HELLO *client_hello, while (CBS_len(&cipher_suites) > 0) { uint16_t got_id; if (!CBS_get_u16(&cipher_suites, &got_id)) { - return 0; + return false; } if (got_id == id) { - return 1; + return true; } } - return 0; + return false; } -static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, - const SSL_CLIENT_HELLO *client_hello) { +static bool negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello) { SSL *const ssl = hs->ssl; assert(!ssl->s3->have_version); CBS supported_versions, versions; @@ -228,7 +203,7 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS_len(&versions) == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); *out_alert = SSL_AD_DECODE_ERROR; - return 0; + return false; } } else { // Convert the ClientHello version to an equivalent supported_versions @@ -237,7 +212,6 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, 0x03, 0x03, // TLS 1.2 0x03, 0x02, // TLS 1.1 0x03, 0x01, // TLS 1 - 0x03, 0x00, // SSL 3 }; static const uint8_t kDTLSVersions[] = { @@ -256,12 +230,10 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, versions_len); } else { if (client_hello->version >= TLS1_2_VERSION) { - versions_len = 8; - } else if (client_hello->version >= TLS1_1_VERSION) { versions_len = 6; - } else if (client_hello->version >= TLS1_VERSION) { + } else if (client_hello->version >= TLS1_1_VERSION) { versions_len = 4; - } else if (client_hello->version >= SSL3_VERSION) { + } else if (client_hello->version >= TLS1_VERSION) { versions_len = 2; } CBS_init(&versions, kTLSVersions + sizeof(kTLSVersions) - versions_len, @@ -270,7 +242,7 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, } if (!ssl_negotiate_version(hs, out_alert, &ssl->version, &versions)) { - return 0; + return false; } // At this point, the connection's version is known and |ssl->version| is @@ -284,10 +256,10 @@ static int negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, ssl_protocol_version(ssl) < hs->max_version) { OPENSSL_PUT_ERROR(SSL, SSL_R_INAPPROPRIATE_FALLBACK); *out_alert = SSL3_AD_INAPPROPRIATE_FALLBACK; - return 0; + return false; } - return 1; + return true; } static UniquePtr ssl_parse_client_cipher_list( @@ -327,11 +299,10 @@ static UniquePtr ssl_parse_client_cipher_list( static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, uint32_t *out_mask_k, uint32_t *out_mask_a) { - SSL *const ssl = hs->ssl; uint32_t mask_k = 0; uint32_t mask_a = 0; - if (ssl_has_certificate(ssl)) { + if (ssl_has_certificate(hs)) { mask_a |= ssl_cipher_auth_mask_for_key(hs->local_pubkey.get()); if (EVP_PKEY_id(hs->local_pubkey.get()) == EVP_PKEY_RSA) { mask_k |= SSL_kRSA; @@ -345,7 +316,7 @@ static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, } // PSK requires a server callback. - if (ssl->psk_server_callback != NULL) { + if (hs->config->psk_server_callback != NULL) { mask_k |= SSL_kPSK; mask_a |= SSL_aPSK; } @@ -356,14 +327,14 @@ static void ssl_get_compatible_server_ciphers(SSL_HANDSHAKE *hs, static const SSL_CIPHER *ssl3_choose_cipher( SSL_HANDSHAKE *hs, const SSL_CLIENT_HELLO *client_hello, - const struct ssl_cipher_preference_list_st *server_pref) { + const SSLCipherPreferenceList *server_pref) { SSL *const ssl = hs->ssl; - STACK_OF(SSL_CIPHER) *prio, *allow; + const STACK_OF(SSL_CIPHER) *prio, *allow; // in_group_flags will either be NULL, or will point to an array of bytes // which indicate equal-preference groups in the |prio| stack. See the - // comment about |in_group_flags| in the |ssl_cipher_preference_list_st| + // comment about |in_group_flags| in the |SSLCipherPreferenceList| // struct. - const uint8_t *in_group_flags; + const bool *in_group_flags; // group_min contains the minimal index so far found in a group, or -1 if no // such value exists yet. int group_min = -1; @@ -375,13 +346,13 @@ static const SSL_CIPHER *ssl3_choose_cipher( } if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { - prio = server_pref->ciphers; + prio = server_pref->ciphers.get(); in_group_flags = server_pref->in_group_flags; allow = client_pref.get(); } else { prio = client_pref.get(); in_group_flags = NULL; - allow = server_pref->ciphers; + allow = server_pref->ciphers.get(); } uint32_t mask_k, mask_a; @@ -399,7 +370,7 @@ static const SSL_CIPHER *ssl3_choose_cipher( (c->algorithm_auth & mask_a) && // Check the cipher is in the |allow| list. sk_SSL_CIPHER_find(allow, &cipher_index, c)) { - if (in_group_flags != NULL && in_group_flags[i] == 1) { + if (in_group_flags != NULL && in_group_flags[i]) { // This element of |prio| is in a group. Update the minimum index found // so far and continue looking. if (group_min == -1 || (size_t)group_min > cipher_index) { @@ -413,7 +384,7 @@ static const SSL_CIPHER *ssl3_choose_cipher( } } - if (in_group_flags != NULL && in_group_flags[i] == 0 && group_min != -1) { + if (in_group_flags != NULL && !in_group_flags[i] && group_min != -1) { // We are about to leave a group, but we found a match in it, so that's // our answer. return sk_SSL_CIPHER_value(allow, group_min); @@ -425,10 +396,160 @@ static const SSL_CIPHER *ssl3_choose_cipher( static enum ssl_hs_wait_t do_start_accept(SSL_HANDSHAKE *hs) { ssl_do_info_callback(hs->ssl, SSL_CB_HANDSHAKE_START, 1); - hs->state = state_read_client_hello; + hs->state = state12_read_client_hello; return ssl_hs_ok; } +// is_probably_jdk11_with_tls13 returns whether |client_hello| was probably sent +// from a JDK 11 client with both TLS 1.3 and a prior version enabled. +static bool is_probably_jdk11_with_tls13(const SSL_CLIENT_HELLO *client_hello) { + // JDK 11 ClientHellos contain a number of unusual properties which should + // limit false positives. + + // JDK 11 does not support ChaCha20-Poly1305. This is unusual: many modern + // clients implement ChaCha20-Poly1305. + if (ssl_client_cipher_list_contains_cipher( + client_hello, TLS1_CK_CHACHA20_POLY1305_SHA256 & 0xffff)) { + return false; + } + + // JDK 11 always sends extensions in a particular order. + constexpr uint16_t kMaxFragmentLength = 0x0001; + constexpr uint16_t kStatusRequestV2 = 0x0011; + static CONSTEXPR_ARRAY struct { + uint16_t id; + bool required; + } kJavaExtensions[] = { + {TLSEXT_TYPE_server_name, false}, + {kMaxFragmentLength, false}, + {TLSEXT_TYPE_status_request, false}, + {TLSEXT_TYPE_supported_groups, true}, + {TLSEXT_TYPE_ec_point_formats, false}, + {TLSEXT_TYPE_signature_algorithms, true}, + // Java always sends signature_algorithms_cert. + {TLSEXT_TYPE_signature_algorithms_cert, true}, + {TLSEXT_TYPE_application_layer_protocol_negotiation, false}, + {kStatusRequestV2, false}, + {TLSEXT_TYPE_extended_master_secret, false}, + {TLSEXT_TYPE_supported_versions, true}, + {TLSEXT_TYPE_cookie, false}, + {TLSEXT_TYPE_psk_key_exchange_modes, true}, + {TLSEXT_TYPE_key_share, true}, + {TLSEXT_TYPE_renegotiate, false}, + {TLSEXT_TYPE_pre_shared_key, false}, + }; + Span sigalgs, sigalgs_cert; + bool has_status_request = false, has_status_request_v2 = false; + CBS extensions, supported_groups; + CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); + for (const auto &java_extension : kJavaExtensions) { + CBS copy = extensions; + uint16_t id; + if (CBS_get_u16(©, &id) && id == java_extension.id) { + // The next extension is the one we expected. + extensions = copy; + CBS body; + if (!CBS_get_u16_length_prefixed(&extensions, &body)) { + return false; + } + switch (id) { + case TLSEXT_TYPE_status_request: + has_status_request = true; + break; + case kStatusRequestV2: + has_status_request_v2 = true; + break; + case TLSEXT_TYPE_signature_algorithms: + sigalgs = body; + break; + case TLSEXT_TYPE_signature_algorithms_cert: + sigalgs_cert = body; + break; + case TLSEXT_TYPE_supported_groups: + supported_groups = body; + break; + } + } else if (java_extension.required) { + return false; + } + } + if (CBS_len(&extensions) != 0) { + return false; + } + + // JDK 11 never advertises X25519. It is not offered by default, and + // -Djdk.tls.namedGroups=x25519 does not work. This is unusual: many modern + // clients implement X25519. + while (CBS_len(&supported_groups) > 0) { + uint16_t group; + if (!CBS_get_u16(&supported_groups, &group) || + group == SSL_CURVE_X25519) { + return false; + } + } + + if (// JDK 11 always sends the same contents in signature_algorithms and + // signature_algorithms_cert. This is unusual: signature_algorithms_cert, + // if omitted, is treated as if it were signature_algorithms. + sigalgs != sigalgs_cert || + // When TLS 1.2 or below is enabled, JDK 11 sends status_request_v2 iff it + // sends status_request. This is unusual: status_request_v2 is not widely + // implemented. + has_status_request != has_status_request_v2) { + return false; + } + + return true; +} + +static bool extract_sni(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + CBS sni; + if (!ssl_client_hello_get_extension(client_hello, &sni, + TLSEXT_TYPE_server_name)) { + // No SNI extension to parse. + return true; + } + + CBS server_name_list, host_name; + uint8_t name_type; + if (!CBS_get_u16_length_prefixed(&sni, &server_name_list) || + !CBS_get_u8(&server_name_list, &name_type) || + // Although the server_name extension was intended to be extensible to + // new name types and multiple names, OpenSSL 1.0.x had a bug which meant + // different name types will cause an error. Further, RFC 4366 originally + // defined syntax inextensibly. RFC 6066 corrected this mistake, but + // adding new name types is no longer feasible. + // + // Act as if the extensibility does not exist to simplify parsing. + !CBS_get_u16_length_prefixed(&server_name_list, &host_name) || + CBS_len(&server_name_list) != 0 || + CBS_len(&sni) != 0) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + if (name_type != TLSEXT_NAMETYPE_host_name || + CBS_len(&host_name) == 0 || + CBS_len(&host_name) > TLSEXT_MAXLEN_host_name || + CBS_contains_zero_byte(&host_name)) { + *out_alert = SSL_AD_UNRECOGNIZED_NAME; + return false; + } + + // Copy the hostname as a string. + char *raw = nullptr; + if (!CBS_strdup(&host_name, &raw)) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } + ssl->s3->hostname.reset(raw); + + hs->should_ack_sni = true; + return true; +} + static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; @@ -441,10 +562,6 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (ssl->handoff) { - return ssl_hs_handoff; - } - SSL_CLIENT_HELLO client_hello; if (!ssl_client_hello_init(ssl, &client_hello, msg)) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); @@ -452,6 +569,16 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + if (hs->config->handoff) { + return ssl_hs_handoff; + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!extract_sni(hs, &alert, &client_hello)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + // Run the early callback. if (ssl->ctx->select_certificate_cb != NULL) { switch (ssl->ctx->select_certificate_cb(&client_hello)) { @@ -470,11 +597,15 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { } // Freeze the version range after the early callback. - if (!ssl_get_version_range(ssl, &hs->min_version, &hs->max_version)) { + if (!ssl_get_version_range(hs, &hs->min_version, &hs->max_version)) { return ssl_hs_error; } - uint8_t alert = SSL_AD_DECODE_ERROR; + if (hs->config->jdk11_workaround && + is_probably_jdk11_with_tls13(&client_hello)) { + hs->apply_jdk11_workaround = true; + } + if (!negotiate_version(hs, &alert, &client_hello)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; @@ -505,7 +636,7 @@ static enum ssl_hs_wait_t do_read_client_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - hs->state = state_select_certificate; + hs->state = state12_select_certificate; return ssl_hs_ok; } @@ -518,8 +649,8 @@ static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { } // Call |cert_cb| to update server certificates if required. - if (ssl->cert->cert_cb != NULL) { - int rv = ssl->cert->cert_cb(ssl, ssl->cert->cert_cb_arg); + if (hs->config->cert->cert_cb != NULL) { + int rv = hs->config->cert->cert_cb(ssl, hs->config->cert->cert_cb_arg); if (rv == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_CB_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); @@ -534,12 +665,30 @@ static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + if (hs->ocsp_stapling_requested && + ssl->ctx->legacy_ocsp_callback != nullptr) { + switch (ssl->ctx->legacy_ocsp_callback( + ssl, ssl->ctx->legacy_ocsp_callback_arg)) { + case SSL_TLSEXT_ERR_OK: + break; + case SSL_TLSEXT_ERR_NOACK: + hs->ocsp_stapling_requested = false; + break; + default: + OPENSSL_PUT_ERROR(SSL, SSL_R_OCSP_CB_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + } + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { // Jump to the TLS 1.3 state machine. - hs->state = state_tls13; + hs->state = state12_tls13; return ssl_hs_ok; } + ssl->s3->early_data_reason = ssl_early_data_protocol_version; + SSL_CLIENT_HELLO client_hello; if (!ssl_client_hello_init(ssl, &client_hello, msg)) { return ssl_hs_error; @@ -547,22 +696,24 @@ static enum ssl_hs_wait_t do_select_certificate(SSL_HANDSHAKE *hs) { // Negotiate the cipher suite. This must be done after |cert_cb| so the // certificate is finalized. - hs->new_cipher = - ssl3_choose_cipher(hs, &client_hello, ssl_get_cipher_preferences(ssl)); + SSLCipherPreferenceList *prefs = hs->config->cipher_list + ? hs->config->cipher_list.get() + : ssl->ctx->cipher_list.get(); + hs->new_cipher = ssl3_choose_cipher(hs, &client_hello, prefs); if (hs->new_cipher == NULL) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_CIPHER); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); return ssl_hs_error; } - hs->state = state_select_parameters; + hs->state = state12_select_parameters; return ssl_hs_ok; } static enum ssl_hs_wait_t do_tls13(SSL_HANDSHAKE *hs) { enum ssl_hs_wait_t wait = tls13_server_handshake(hs); if (wait == ssl_hs_ok) { - hs->state = state_finish_server_handshake; + hs->state = state12_finish_server_handshake; return ssl_hs_ok; } @@ -586,7 +737,7 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { UniquePtr session; bool tickets_supported = false, renew_ticket = false; enum ssl_hs_wait_t wait = ssl_get_prev_session( - ssl, &session, &tickets_supported, &renew_ticket, &client_hello); + hs, &session, &tickets_supported, &renew_ticket, &client_hello); if (wait != ssl_hs_ok) { return wait; } @@ -611,7 +762,7 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { if (session) { // Use the old session. hs->ticket_expected = renew_ticket; - ssl->session = session.release(); + ssl->session = std::move(session); ssl->s3->session_reused = true; } else { hs->ticket_expected = tickets_supported; @@ -638,10 +789,10 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { hs->new_session->cipher = hs->new_cipher; // Determine whether to request a client certificate. - hs->cert_request = !!(ssl->verify_mode & SSL_VERIFY_PEER); + hs->cert_request = !!(hs->config->verify_mode & SSL_VERIFY_PEER); // Only request a certificate if Channel ID isn't negotiated. - if ((ssl->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && - ssl->s3->tlsext_channel_id_valid) { + if ((hs->config->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && + ssl->s3->channel_id_valid) { hs->cert_request = false; } // CertificateRequest may only be sent in certificate-based ciphers. @@ -672,25 +823,32 @@ static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - // Release the handshake buffer if client authentication isn't required. - if (!hs->cert_request) { + // Handback includes the whole handshake transcript, so we cannot free the + // transcript buffer in the handback case. + if (!hs->cert_request && !hs->handback) { hs->transcript.FreeBuffer(); } ssl->method->next_message(ssl); - hs->state = state_send_server_hello; + hs->state = state12_send_server_hello; return ssl_hs_ok; } +static void copy_suffix(Span out, Span in) { + out = out.subspan(out.size() - in.size()); + assert(out.size() == in.size()); + OPENSSL_memcpy(out.data(), in.data(), in.size()); +} + static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // We only accept ChannelIDs on connections with ECDHE in order to avoid a // known attack while we fix ChannelID itself. - if (ssl->s3->tlsext_channel_id_valid && + if (ssl->s3->channel_id_valid && (hs->new_cipher->algorithm_mkey & SSL_kECDHE) == 0) { - ssl->s3->tlsext_channel_id_valid = false; + ssl->s3->channel_id_valid = false; } // If this is a resumption and the original handshake didn't support @@ -698,7 +856,7 @@ static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { // session and so cannot resume with ChannelIDs. if (ssl->session != NULL && ssl->session->original_handshake_hash_len == 0) { - ssl->s3->tlsext_channel_id_valid = false; + ssl->s3->channel_id_valid = false; } struct OPENSSL_timeval now; @@ -711,20 +869,27 @@ static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - // Implement the TLS 1.3 anti-downgrade feature, but with a different value. - // - // For draft TLS 1.3 versions, it is not safe to deploy this feature. However, - // some TLS terminators are non-compliant and copy the origin server's value, - // so we wish to measure eventual compatibility impact. - if (hs->max_version >= TLS1_3_VERSION) { - OPENSSL_memcpy(ssl->s3->server_random + SSL3_RANDOM_SIZE - - sizeof(kDraftDowngradeRandom), - kDraftDowngradeRandom, sizeof(kDraftDowngradeRandom)); + // Implement the TLS 1.3 anti-downgrade feature. + if (ssl_supports_version(hs, TLS1_3_VERSION)) { + if (ssl_protocol_version(ssl) == TLS1_2_VERSION) { + if (hs->apply_jdk11_workaround) { + // JDK 11 implements the TLS 1.3 downgrade signal, so we cannot send it + // here. However, the signal is only effective if all TLS 1.2 + // ServerHellos produced by the server are marked. Thus we send a + // different non-standard signal for the time being, until JDK 11.0.2 is + // released and clients have updated. + copy_suffix(ssl->s3->server_random, kJDK11DowngradeRandom); + } else { + copy_suffix(ssl->s3->server_random, kTLS13DowngradeRandom); + } + } else { + copy_suffix(ssl->s3->server_random, kTLS12DowngradeRandom); + } } const SSL_SESSION *session = hs->new_session.get(); - if (ssl->session != NULL) { - session = ssl->session; + if (ssl->session != nullptr) { + session = ssl->session.get(); } ScopedCBB cbb; @@ -744,9 +909,9 @@ static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { } if (ssl->session != NULL) { - hs->state = state_send_server_finished; + hs->state = state12_send_server_finished; } else { - hs->state = state_send_server_certificate; + hs->state = state12_send_server_certificate; } return ssl_hs_ok; } @@ -756,12 +921,12 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { ScopedCBB cbb; if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { - if (!ssl_has_certificate(ssl)) { + if (!ssl_has_certificate(hs)) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); return ssl_hs_error; } - if (!ssl_output_cert_chain(ssl)) { + if (!ssl_output_cert_chain(hs)) { return ssl_hs_error; } @@ -771,9 +936,10 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { SSL3_MT_CERTIFICATE_STATUS) || !CBB_add_u8(&body, TLSEXT_STATUSTYPE_ocsp) || !CBB_add_u24_length_prefixed(&body, &ocsp_response) || - !CBB_add_bytes(&ocsp_response, - CRYPTO_BUFFER_data(ssl->cert->ocsp_response), - CRYPTO_BUFFER_len(ssl->cert->ocsp_response)) || + !CBB_add_bytes( + &ocsp_response, + CRYPTO_BUFFER_data(hs->config->cert->ocsp_response.get()), + CRYPTO_BUFFER_len(hs->config->cert->ocsp_response.get())) || !ssl_add_message_cbb(ssl, cbb.get())) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return ssl_hs_error; @@ -785,8 +951,7 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { uint32_t alg_k = hs->new_cipher->algorithm_mkey; uint32_t alg_a = hs->new_cipher->algorithm_auth; if (ssl_cipher_requires_server_key_exchange(hs->new_cipher) || - ((alg_a & SSL_aPSK) && ssl->psk_identity_hint)) { - + ((alg_a & SSL_aPSK) && hs->config->psk_identity_hint)) { // Pre-allocate enough room to comfortably fit an ECDHE public key. Prepend // the client and server randoms for the signing transcript. CBB child; @@ -798,10 +963,12 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { // PSK ciphers begin with an identity hint. if (alg_a & SSL_aPSK) { - size_t len = - (ssl->psk_identity_hint == NULL) ? 0 : strlen(ssl->psk_identity_hint); + size_t len = hs->config->psk_identity_hint == nullptr + ? 0 + : strlen(hs->config->psk_identity_hint.get()); if (!CBB_add_u16_length_prefixed(cbb.get(), &child) || - !CBB_add_bytes(&child, (const uint8_t *)ssl->psk_identity_hint, + !CBB_add_bytes(&child, + (const uint8_t *)hs->config->psk_identity_hint.get(), len)) { return ssl_hs_error; } @@ -818,12 +985,12 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { hs->new_session->group_id = group_id; // Set up ECDH, generate a key, and emit the public half. - hs->key_share = SSLKeyShare::Create(group_id); - if (!hs->key_share || + hs->key_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || !CBB_add_u8(cbb.get(), NAMED_CURVE_TYPE) || !CBB_add_u16(cbb.get(), group_id) || !CBB_add_u8_length_prefixed(cbb.get(), &child) || - !hs->key_share->Offer(&child)) { + !hs->key_shares[0]->Offer(&child)) { return ssl_hs_error; } } else { @@ -835,7 +1002,7 @@ static enum ssl_hs_wait_t do_send_server_certificate(SSL_HANDSHAKE *hs) { } } - hs->state = state_send_server_key_exchange; + hs->state = state12_send_server_key_exchange; return ssl_hs_ok; } @@ -843,7 +1010,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; if (hs->server_params.size() == 0) { - hs->state = state_send_server_hello_done; + hs->state = state12_send_server_hello_done; return ssl_hs_ok; } @@ -860,7 +1027,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { // Add a signature. if (ssl_cipher_uses_certificate_auth(hs->new_cipher)) { - if (!ssl_has_private_key(ssl)) { + if (!ssl_has_private_key(hs)) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; } @@ -868,6 +1035,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { // Determine the signature algorithm. uint16_t signature_algorithm; if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); return ssl_hs_error; } if (ssl_protocol_version(ssl) >= TLS1_2_VERSION) { @@ -907,7 +1075,7 @@ static enum ssl_hs_wait_t do_send_server_key_exchange(SSL_HANDSHAKE *hs) { hs->server_params.Reset(); - hs->state = state_send_server_hello_done; + hs->state = state12_send_server_hello_done; return ssl_hs_ok; } @@ -923,12 +1091,11 @@ static enum ssl_hs_wait_t do_send_server_hello_done(SSL_HANDSHAKE *hs) { SSL3_MT_CERTIFICATE_REQUEST) || !CBB_add_u8_length_prefixed(&body, &cert_types) || !CBB_add_u8(&cert_types, SSL3_CT_RSA_SIGN) || - (ssl_protocol_version(ssl) >= TLS1_VERSION && - !CBB_add_u8(&cert_types, TLS_CT_ECDSA_SIGN)) || + !CBB_add_u8(&cert_types, TLS_CT_ECDSA_SIGN) || (ssl_protocol_version(ssl) >= TLS1_2_VERSION && (!CBB_add_u16_length_prefixed(&body, &sigalgs_cbb) || !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb))) || - !ssl_add_client_CA_list(ssl, &body) || + !ssl_add_client_CA_list(hs, &body) || !ssl_add_message_cbb(ssl, cbb.get())) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return ssl_hs_error; @@ -942,15 +1109,18 @@ static enum ssl_hs_wait_t do_send_server_hello_done(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - hs->state = state_read_client_certificate; + hs->state = state12_read_client_certificate; return ssl_hs_flush; } static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; + if (hs->handback && hs->new_cipher->algorithm_mkey == SSL_kECDHE) { + return ssl_hs_handback; + } if (!hs->cert_request) { - hs->state = state_verify_client_certificate; + hs->state = state12_verify_client_certificate; return ssl_hs_ok; } @@ -959,26 +1129,7 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_read_message; } - if (msg.type != SSL3_MT_CERTIFICATE) { - if (ssl->version == SSL3_VERSION && - msg.type == SSL3_MT_CLIENT_KEY_EXCHANGE) { - // In SSL 3.0, the Certificate message is omitted to signal no - // certificate. - if (ssl->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); - return ssl_hs_error; - } - - // OpenSSL returns X509_V_OK when no certificates are received. This is - // classed by them as a bug, but it's assumed by at least NGINX. - hs->new_session->verify_result = X509_V_OK; - hs->state = state_verify_client_certificate; - return ssl_hs_ok; - } - - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE)) { return ssl_hs_error; } @@ -988,17 +1139,14 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { CBS certificate_msg = msg.body; uint8_t alert = SSL_AD_DECODE_ERROR; - UniquePtr chain; - if (!ssl_parse_cert_chain(&alert, &chain, &hs->peer_pubkey, - ssl->retain_only_sha256_of_client_certs + if (!ssl_parse_cert_chain(&alert, &hs->new_session->certs, &hs->peer_pubkey, + hs->config->retain_only_sha256_of_client_certs ? hs->new_session->peer_sha256 - : NULL, + : nullptr, &certificate_msg, ssl->ctx->pool)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = chain.release(); if (CBS_len(&certificate_msg) != 0 || !ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { @@ -1007,19 +1155,11 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0) { + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { // No client certificate so the handshake buffer may be discarded. hs->transcript.FreeBuffer(); - // In SSL 3.0, sending no certificate is signaled by omitting the - // Certificate message. - if (ssl->version == SSL3_VERSION) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATES_RETURNED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); - return ssl_hs_error; - } - - if (ssl->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) { + if (hs->config->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) { // Fail for TLS only if we required a certificate OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -1029,18 +1169,18 @@ static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { // OpenSSL returns X509_V_OK when no certificates are received. This is // classed by them as a bug, but it's assumed by at least NGINX. hs->new_session->verify_result = X509_V_OK; - } else if (ssl->retain_only_sha256_of_client_certs) { + } else if (hs->config->retain_only_sha256_of_client_certs) { // The hash will have been filled in. hs->new_session->peer_sha256_valid = 1; } ssl->method->next_message(ssl); - hs->state = state_verify_client_certificate; + hs->state = state12_verify_client_certificate; return ssl_hs_ok; } static enum ssl_hs_wait_t do_verify_client_certificate(SSL_HANDSHAKE *hs) { - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) > 0) { + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) > 0) { switch (ssl_verify_peer_cert(hs)) { case ssl_verify_ok: break; @@ -1051,7 +1191,7 @@ static enum ssl_hs_wait_t do_verify_client_certificate(SSL_HANDSHAKE *hs) { } } - hs->state = state_read_client_key_exchange; + hs->state = state12_read_client_key_exchange; return ssl_hs_ok; } @@ -1089,28 +1229,25 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; } - - if (!CBS_strdup(&psk_identity, &hs->new_session->psk_identity)) { + char *raw = nullptr; + if (!CBS_strdup(&psk_identity, &raw)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; } + hs->new_session->psk_identity.reset(raw); } // Depending on the key exchange method, compute |premaster_secret|. Array premaster_secret; if (alg_k & SSL_kRSA) { CBS encrypted_premaster_secret; - if (ssl->version > SSL3_VERSION) { - if (!CBS_get_u16_length_prefixed(&client_key_exchange, - &encrypted_premaster_secret) || - CBS_len(&client_key_exchange) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - } else { - encrypted_premaster_secret = client_key_exchange; + if (!CBS_get_u16_length_prefixed(&client_key_exchange, + &encrypted_premaster_secret) || + CBS_len(&client_key_exchange) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; } // Allocate a buffer large enough for an RSA decryption. @@ -1139,6 +1276,8 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + CONSTTIME_SECRET(decrypt_buf.data(), decrypt_len); + // Prepare a random premaster, to be used on invalid padding. See RFC 5246, // section 7.4.7.1. if (!premaster_secret.Init(SSL_MAX_MASTER_KEY_LENGTH) || @@ -1188,13 +1327,14 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { // Compute the premaster. uint8_t alert = SSL_AD_DECODE_ERROR; - if (!hs->key_share->Finish(&premaster_secret, &alert, peer_key)) { + if (!hs->key_shares[0]->Finish(&premaster_secret, &alert, peer_key)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); return ssl_hs_error; } // The key exchange state may now be discarded. - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); } else if (!(alg_k & SSL_kPSK)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); @@ -1204,7 +1344,7 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { // For a PSK cipher suite, the actual pre-master secret is combined with the // pre-shared key. if (alg_a & SSL_aPSK) { - if (ssl->psk_server_callback == NULL) { + if (hs->config->psk_server_callback == NULL) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; @@ -1212,8 +1352,8 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { // Look up the key for the identity. uint8_t psk[PSK_MAX_PSK_LEN]; - unsigned psk_len = ssl->psk_server_callback( - ssl, hs->new_session->psk_identity, psk, sizeof(psk)); + unsigned psk_len = hs->config->psk_server_callback( + ssl, hs->new_session->psk_identity.get(), psk, sizeof(psk)); if (psk_len > PSK_MAX_PSK_LEN) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); @@ -1260,9 +1400,11 @@ static enum ssl_hs_wait_t do_read_client_key_exchange(SSL_HANDSHAKE *hs) { return ssl_hs_error; } hs->new_session->extended_master_secret = hs->extended_master_secret; + CONSTTIME_DECLASSIFY(hs->new_session->master_key, + hs->new_session->master_key_length); ssl->method->next_message(ssl); - hs->state = state_read_client_certificate_verify; + hs->state = state12_read_client_certificate_verify; return ssl_hs_ok; } @@ -1273,7 +1415,7 @@ static enum ssl_hs_wait_t do_read_client_certificate_verify(SSL_HANDSHAKE *hs) { // CertificateVerify is required if and only if there's a client certificate. if (!hs->peer_pubkey) { hs->transcript.FreeBuffer(); - hs->state = state_read_change_cipher_spec; + hs->state = state12_read_change_cipher_spec; return ssl_hs_ok; } @@ -1317,34 +1459,8 @@ static enum ssl_hs_wait_t do_read_client_certificate_verify(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - bool sig_ok; - // The SSL3 construction for CertificateVerify does not decompose into a - // single final digest and signature, and must be special-cased. - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - uint8_t digest[EVP_MAX_MD_SIZE]; - size_t digest_len; - if (!hs->transcript.GetSSL3CertVerifyHash( - digest, &digest_len, hs->new_session.get(), signature_algorithm)) { - return ssl_hs_error; - } - - UniquePtr pctx( - EVP_PKEY_CTX_new(hs->peer_pubkey.get(), nullptr)); - sig_ok = pctx && - EVP_PKEY_verify_init(pctx.get()) && - EVP_PKEY_verify(pctx.get(), CBS_data(&signature), - CBS_len(&signature), digest, digest_len); - } else { - sig_ok = - ssl_public_key_verify(ssl, signature, signature_algorithm, - hs->peer_pubkey.get(), hs->transcript.buffer()); - } - -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = true; - ERR_clear_error(); -#endif - if (!sig_ok) { + if (!ssl_public_key_verify(ssl, signature, signature_algorithm, + hs->peer_pubkey.get(), hs->transcript.buffer())) { OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); return ssl_hs_error; @@ -1358,12 +1474,15 @@ static enum ssl_hs_wait_t do_read_client_certificate_verify(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->state = state_read_change_cipher_spec; + hs->state = state12_read_change_cipher_spec; return ssl_hs_ok; } static enum ssl_hs_wait_t do_read_change_cipher_spec(SSL_HANDSHAKE *hs) { - hs->state = state_process_change_cipher_spec; + if (hs->handback && hs->ssl->session != NULL) { + return ssl_hs_handback; + } + hs->state = state12_process_change_cipher_spec; return ssl_hs_read_change_cipher_spec; } @@ -1372,7 +1491,7 @@ static enum ssl_hs_wait_t do_process_change_cipher_spec(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - hs->state = state_read_next_proto; + hs->state = state12_read_next_proto; return ssl_hs_ok; } @@ -1380,7 +1499,7 @@ static enum ssl_hs_wait_t do_read_next_proto(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; if (!hs->next_proto_neg_seen) { - hs->state = state_read_channel_id; + hs->state = state12_read_channel_id; return ssl_hs_ok; } @@ -1408,15 +1527,15 @@ static enum ssl_hs_wait_t do_read_next_proto(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->state = state_read_channel_id; + hs->state = state12_read_channel_id; return ssl_hs_ok; } static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (!ssl->s3->tlsext_channel_id_valid) { - hs->state = state_read_client_finished; + if (!ssl->s3->channel_id_valid) { + hs->state = state12_read_client_finished; return ssl_hs_ok; } @@ -1432,7 +1551,7 @@ static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->state = state_read_client_finished; + hs->state = state12_read_client_finished; return ssl_hs_ok; } @@ -1444,15 +1563,15 @@ static enum ssl_hs_wait_t do_read_client_finished(SSL_HANDSHAKE *hs) { } if (ssl->session != NULL) { - hs->state = state_finish_server_handshake; + hs->state = state12_finish_server_handshake; } else { - hs->state = state_send_server_finished; + hs->state = state12_send_server_finished; } // If this is a full handshake with ChannelID then record the handshake // hashes in |hs->new_session| in case we need them to verify a // ChannelID signature on a resumption of this session in the future. - if (ssl->session == NULL && ssl->s3->tlsext_channel_id_valid && + if (ssl->session == NULL && ssl->s3->channel_id_valid && !tls1_record_handshake_hashes_for_channel_id(hs)) { return ssl_hs_error; } @@ -1473,7 +1592,8 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { } else { // We are renewing an existing session. Duplicate the session to adjust // the timeout. - session_copy = SSL_SESSION_dup(ssl->session, SSL_SESSION_INCLUDE_NONAUTH); + session_copy = + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_INCLUDE_NONAUTH); if (!session_copy) { return ssl_hs_error; } @@ -1488,7 +1608,7 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { SSL3_MT_NEW_SESSION_TICKET) || !CBB_add_u32(&body, session->timeout) || !CBB_add_u16_length_prefixed(&body, &ticket) || - !ssl_encrypt_ticket(ssl, &ticket, session) || + !ssl_encrypt_ticket(hs, &ticket, session) || !ssl_add_message_cbb(ssl, cbb.get())) { return ssl_hs_error; } @@ -1501,9 +1621,9 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { } if (ssl->session != NULL) { - hs->state = state_read_change_cipher_spec; + hs->state = state12_read_change_cipher_spec; } else { - hs->state = state_finish_server_handshake; + hs->state = state12_finish_server_handshake; } return ssl_hs_flush; } @@ -1511,98 +1631,101 @@ static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { static enum ssl_hs_wait_t do_finish_server_handshake(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; + if (hs->handback) { + return ssl_hs_handback; + } + ssl->method->on_handshake_complete(ssl); // If we aren't retaining peer certificates then we can discard it now. - if (hs->new_session != NULL && ssl->retain_only_sha256_of_client_certs) { - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = NULL; + if (hs->new_session != NULL && + hs->config->retain_only_sha256_of_client_certs) { + hs->new_session->certs.reset(); ssl->ctx->x509_method->session_clear(hs->new_session.get()); } if (ssl->session != NULL) { - SSL_SESSION_up_ref(ssl->session); - ssl->s3->established_session.reset(ssl->session); + ssl->s3->established_session = UpRef(ssl->session); } else { ssl->s3->established_session = std::move(hs->new_session); - ssl->s3->established_session->not_resumable = 0; + ssl->s3->established_session->not_resumable = false; } hs->handshake_finalized = true; ssl->s3->initial_handshake_complete = true; ssl_update_cache(hs, SSL_SESS_CACHE_SERVER); - hs->state = state_done; + hs->state = state12_done; return ssl_hs_ok; } enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs) { - while (hs->state != state_done) { + while (hs->state != state12_done) { enum ssl_hs_wait_t ret = ssl_hs_error; - enum ssl_server_hs_state_t state = - static_cast(hs->state); + enum tls12_server_hs_state_t state = + static_cast(hs->state); switch (state) { - case state_start_accept: + case state12_start_accept: ret = do_start_accept(hs); break; - case state_read_client_hello: + case state12_read_client_hello: ret = do_read_client_hello(hs); break; - case state_select_certificate: + case state12_select_certificate: ret = do_select_certificate(hs); break; - case state_tls13: + case state12_tls13: ret = do_tls13(hs); break; - case state_select_parameters: + case state12_select_parameters: ret = do_select_parameters(hs); break; - case state_send_server_hello: + case state12_send_server_hello: ret = do_send_server_hello(hs); break; - case state_send_server_certificate: + case state12_send_server_certificate: ret = do_send_server_certificate(hs); break; - case state_send_server_key_exchange: + case state12_send_server_key_exchange: ret = do_send_server_key_exchange(hs); break; - case state_send_server_hello_done: + case state12_send_server_hello_done: ret = do_send_server_hello_done(hs); break; - case state_read_client_certificate: + case state12_read_client_certificate: ret = do_read_client_certificate(hs); break; - case state_verify_client_certificate: + case state12_verify_client_certificate: ret = do_verify_client_certificate(hs); break; - case state_read_client_key_exchange: + case state12_read_client_key_exchange: ret = do_read_client_key_exchange(hs); break; - case state_read_client_certificate_verify: + case state12_read_client_certificate_verify: ret = do_read_client_certificate_verify(hs); break; - case state_read_change_cipher_spec: + case state12_read_change_cipher_spec: ret = do_read_change_cipher_spec(hs); break; - case state_process_change_cipher_spec: + case state12_process_change_cipher_spec: ret = do_process_change_cipher_spec(hs); break; - case state_read_next_proto: + case state12_read_next_proto: ret = do_read_next_proto(hs); break; - case state_read_channel_id: + case state12_read_channel_id: ret = do_read_channel_id(hs); break; - case state_read_client_finished: + case state12_read_client_finished: ret = do_read_client_finished(hs); break; - case state_send_server_finished: + case state12_send_server_finished: ret = do_send_server_finished(hs); break; - case state_finish_server_handshake: + case state12_finish_server_handshake: ret = do_finish_server_handshake(hs); break; - case state_done: + case state12_done: ret = ssl_hs_ok; break; } @@ -1621,54 +1744,54 @@ enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs) { } const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs) { - enum ssl_server_hs_state_t state = - static_cast(hs->state); + enum tls12_server_hs_state_t state = + static_cast(hs->state); switch (state) { - case state_start_accept: + case state12_start_accept: return "TLS server start_accept"; - case state_read_client_hello: + case state12_read_client_hello: return "TLS server read_client_hello"; - case state_select_certificate: + case state12_select_certificate: return "TLS server select_certificate"; - case state_tls13: + case state12_tls13: return tls13_server_handshake_state(hs); - case state_select_parameters: + case state12_select_parameters: return "TLS server select_parameters"; - case state_send_server_hello: + case state12_send_server_hello: return "TLS server send_server_hello"; - case state_send_server_certificate: + case state12_send_server_certificate: return "TLS server send_server_certificate"; - case state_send_server_key_exchange: + case state12_send_server_key_exchange: return "TLS server send_server_key_exchange"; - case state_send_server_hello_done: + case state12_send_server_hello_done: return "TLS server send_server_hello_done"; - case state_read_client_certificate: + case state12_read_client_certificate: return "TLS server read_client_certificate"; - case state_verify_client_certificate: + case state12_verify_client_certificate: return "TLS server verify_client_certificate"; - case state_read_client_key_exchange: + case state12_read_client_key_exchange: return "TLS server read_client_key_exchange"; - case state_read_client_certificate_verify: + case state12_read_client_certificate_verify: return "TLS server read_client_certificate_verify"; - case state_read_change_cipher_spec: + case state12_read_change_cipher_spec: return "TLS server read_change_cipher_spec"; - case state_process_change_cipher_spec: + case state12_process_change_cipher_spec: return "TLS server process_change_cipher_spec"; - case state_read_next_proto: + case state12_read_next_proto: return "TLS server read_next_proto"; - case state_read_channel_id: + case state12_read_channel_id: return "TLS server read_channel_id"; - case state_read_client_finished: + case state12_read_client_finished: return "TLS server read_client_finished"; - case state_send_server_finished: + case state12_send_server_finished: return "TLS server send_server_finished"; - case state_finish_server_handshake: + case state12_finish_server_handshake: return "TLS server finish_server_handshake"; - case state_done: + case state12_done: return "TLS server done"; } return "TLS server unknown"; } -} +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/internal.h b/Pods/BoringSSL-GRPC/src/ssl/internal.h new file mode 100644 index 000000000..5bb3a374f --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/internal.h @@ -0,0 +1,3555 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. + */ + +#ifndef OPENSSL_HEADER_SSL_INTERNAL_H +#define OPENSSL_HEADER_SSL_INTERNAL_H + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/err/internal.h" +#include "../crypto/internal.h" + + +#if defined(OPENSSL_WINDOWS) +// Windows defines struct timeval in winsock2.h. +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#else +#include +#endif + + +BSSL_NAMESPACE_BEGIN + +struct SSL_CONFIG; +struct SSL_HANDSHAKE; +struct SSL_PROTOCOL_METHOD; +struct SSL_X509_METHOD; + +// C++ utilities. + +// New behaves like |new| but uses |OPENSSL_malloc| for memory allocation. It +// returns nullptr on allocation error. It only implements single-object +// allocation and not new T[n]. +// +// Note: unlike |new|, this does not support non-public constructors. +template +T *New(Args &&... args) { + void *t = OPENSSL_malloc(sizeof(T)); + if (t == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + return new (t) T(std::forward(args)...); +} + +// Delete behaves like |delete| but uses |OPENSSL_free| to release memory. +// +// Note: unlike |delete| this does not support non-public destructors. +template +void Delete(T *t) { + if (t != nullptr) { + t->~T(); + OPENSSL_free(t); + } +} + +// All types with kAllowUniquePtr set may be used with UniquePtr. Other types +// may be C structs which require a |BORINGSSL_MAKE_DELETER| registration. +namespace internal { +template +struct DeleterImpl::type> { + static void Free(T *t) { Delete(t); } +}; +} // namespace internal + +// MakeUnique behaves like |std::make_unique| but returns nullptr on allocation +// error. +template +UniquePtr MakeUnique(Args &&... args) { + return UniquePtr(New(std::forward(args)...)); +} + +#if defined(BORINGSSL_ALLOW_CXX_RUNTIME) +#define HAS_VIRTUAL_DESTRUCTOR +#define PURE_VIRTUAL = 0 +#else +// HAS_VIRTUAL_DESTRUCTOR should be declared in any base class which defines a +// virtual destructor. This avoids a dependency on |_ZdlPv| and prevents the +// class from being used with |delete|. +#define HAS_VIRTUAL_DESTRUCTOR \ + void operator delete(void *) { abort(); } + +// PURE_VIRTUAL should be used instead of = 0 when defining pure-virtual +// functions. This avoids a dependency on |__cxa_pure_virtual| but loses +// compile-time checking. +#define PURE_VIRTUAL \ + { abort(); } +#endif + +// CONSTEXPR_ARRAY works around a VS 2015 bug where ranged for loops don't work +// on constexpr arrays. +#if defined(_MSC_VER) && !defined(__clang__) && _MSC_VER < 1910 +#define CONSTEXPR_ARRAY const +#else +#define CONSTEXPR_ARRAY constexpr +#endif + +// Array is an owning array of elements of |T|. +template +class Array { + public: + // Array's default constructor creates an empty array. + Array() {} + Array(const Array &) = delete; + Array(Array &&other) { *this = std::move(other); } + + ~Array() { Reset(); } + + Array &operator=(const Array &) = delete; + Array &operator=(Array &&other) { + Reset(); + other.Release(&data_, &size_); + return *this; + } + + const T *data() const { return data_; } + T *data() { return data_; } + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + const T &operator[](size_t i) const { return data_[i]; } + T &operator[](size_t i) { return data_[i]; } + + T *begin() { return data_; } + const T *cbegin() const { return data_; } + T *end() { return data_ + size_; } + const T *cend() const { return data_ + size_; } + + void Reset() { Reset(nullptr, 0); } + + // Reset releases the current contents of the array and takes ownership of the + // raw pointer supplied by the caller. + void Reset(T *new_data, size_t new_size) { + for (size_t i = 0; i < size_; i++) { + data_[i].~T(); + } + OPENSSL_free(data_); + data_ = new_data; + size_ = new_size; + } + + // Release releases ownership of the array to a raw pointer supplied by the + // caller. + void Release(T **out, size_t *out_size) { + *out = data_; + *out_size = size_; + data_ = nullptr; + size_ = 0; + } + + // Init replaces the array with a newly-allocated array of |new_size| + // default-constructed copies of |T|. It returns true on success and false on + // error. + // + // Note that if |T| is a primitive type like |uint8_t|, it is uninitialized. + bool Init(size_t new_size) { + Reset(); + if (new_size == 0) { + return true; + } + + if (new_size > std::numeric_limits::max() / sizeof(T)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + data_ = reinterpret_cast(OPENSSL_malloc(new_size * sizeof(T))); + if (data_ == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + size_ = new_size; + for (size_t i = 0; i < size_; i++) { + new (&data_[i]) T; + } + return true; + } + + // CopyFrom replaces the array with a newly-allocated copy of |in|. It returns + // true on success and false on error. + bool CopyFrom(Span in) { + if (!Init(in.size())) { + return false; + } + OPENSSL_memcpy(data_, in.data(), sizeof(T) * in.size()); + return true; + } + + // Shrink shrinks the stored size of the array to |new_size|. It crashes if + // the new size is larger. Note this does not shrink the allocation itself. + void Shrink(size_t new_size) { + if (new_size > size_) { + abort(); + } + size_ = new_size; + } + + private: + T *data_ = nullptr; + size_t size_ = 0; +}; + +// GrowableArray is an array that owns elements of |T|, backed by an +// Array. When necessary, pushing will automatically trigger a resize. +// +// Note, for simplicity, this class currently differs from |std::vector| in that +// |T| must be efficiently default-constructible. Allocated elements beyond the +// end of the array are constructed and destructed. +template +class GrowableArray { + public: + GrowableArray() = default; + GrowableArray(const GrowableArray &) = delete; + GrowableArray(GrowableArray &&other) { *this = std::move(other); } + ~GrowableArray() {} + + GrowableArray &operator=(const GrowableArray &) = delete; + GrowableArray &operator=(GrowableArray &&other) { + size_ = other.size_; + other.size_ = 0; + array_ = std::move(other.array_); + return *this; + } + + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + const T &operator[](size_t i) const { return array_[i]; } + T &operator[](size_t i) { return array_[i]; } + + T *begin() { return array_.data(); } + const T *cbegin() const { return array_.data(); } + T *end() { return array_.data() + size_; } + const T *cend() const { return array_.data() + size_; } + + // Push adds |elem| at the end of the internal array, growing if necessary. It + // returns false when allocation fails. + bool Push(T elem) { + if (!MaybeGrow()) { + return false; + } + array_[size_] = std::move(elem); + size_++; + return true; + } + + // CopyFrom replaces the contents of the array with a copy of |in|. It returns + // true on success and false on allocation error. + bool CopyFrom(Span in) { + if (!array_.CopyFrom(in)) { + return false; + } + size_ = in.size(); + return true; + } + + private: + // If there is no room for one more element, creates a new backing array with + // double the size of the old one and copies elements over. + bool MaybeGrow() { + if (array_.size() == 0) { + return array_.Init(kDefaultSize); + } + // No need to grow if we have room for one more T. + if (size_ < array_.size()) { + return true; + } + // Double the array's size if it's safe to do so. + if (array_.size() > std::numeric_limits::max() / 2) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + Array new_array; + if (!new_array.Init(array_.size() * 2)) { + return false; + } + for (size_t i = 0; i < array_.size(); i++) { + new_array[i] = std::move(array_[i]); + } + array_ = std::move(new_array); + + return true; + } + + // |size_| is the number of elements stored in this GrowableArray. + size_t size_ = 0; + // |array_| is the backing array. Note that |array_.size()| is this + // GrowableArray's current capacity and that |size_ <= array_.size()|. + Array array_; + // |kDefaultSize| is the default initial size of the backing array. + static constexpr size_t kDefaultSize = 16; +}; + +// CBBFinishArray behaves like |CBB_finish| but stores the result in an Array. +OPENSSL_EXPORT bool CBBFinishArray(CBB *cbb, Array *out); + + +// Protocol versions. +// +// Due to DTLS's historical wire version differences, we maintain two notions of +// version. +// +// The "version" or "wire version" is the actual 16-bit value that appears on +// the wire. It uniquely identifies a version and is also used at API +// boundaries. The set of supported versions differs between TLS and DTLS. Wire +// versions are opaque values and may not be compared numerically. +// +// The "protocol version" identifies the high-level handshake variant being +// used. DTLS versions map to the corresponding TLS versions. Protocol versions +// are sequential and may be compared numerically. + +// ssl_protocol_version_from_wire sets |*out| to the protocol version +// corresponding to wire version |version| and returns true. If |version| is not +// a valid TLS or DTLS version, it returns false. +// +// Note this simultaneously handles both DTLS and TLS. Use one of the +// higher-level functions below for most operations. +bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version); + +// ssl_get_version_range sets |*out_min_version| and |*out_max_version| to the +// minimum and maximum enabled protocol versions, respectively. +bool ssl_get_version_range(const SSL_HANDSHAKE *hs, uint16_t *out_min_version, + uint16_t *out_max_version); + +// ssl_supports_version returns whether |hs| supports |version|. +bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version); + +// ssl_method_supports_version returns whether |method| supports |version|. +bool ssl_method_supports_version(const SSL_PROTOCOL_METHOD *method, + uint16_t version); + +// ssl_add_supported_versions writes the supported versions of |hs| to |cbb|, in +// decreasing preference order. +bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb); + +// ssl_negotiate_version negotiates a common version based on |hs|'s preferences +// and the peer preference list in |peer_versions|. On success, it returns true +// and sets |*out_version| to the selected version. Otherwise, it returns false +// and sets |*out_alert| to an alert to send. +bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, + uint16_t *out_version, const CBS *peer_versions); + +// ssl_protocol_version returns |ssl|'s protocol version. It is an error to +// call this function before the version is determined. +uint16_t ssl_protocol_version(const SSL *ssl); + +// Cipher suites. + +BSSL_NAMESPACE_END + +struct ssl_cipher_st { + // name is the OpenSSL name for the cipher. + const char *name; + // standard_name is the IETF name for the cipher. + const char *standard_name; + // id is the cipher suite value bitwise OR-d with 0x03000000. + uint32_t id; + + // algorithm_* determine the cipher suite. See constants below for the values. + uint32_t algorithm_mkey; + uint32_t algorithm_auth; + uint32_t algorithm_enc; + uint32_t algorithm_mac; + uint32_t algorithm_prf; +}; + +BSSL_NAMESPACE_BEGIN + +// Bits for |algorithm_mkey| (key exchange algorithm). +#define SSL_kRSA 0x00000001u +#define SSL_kECDHE 0x00000002u +// SSL_kPSK is only set for plain PSK, not ECDHE_PSK. +#define SSL_kPSK 0x00000004u +#define SSL_kGENERIC 0x00000008u + +// Bits for |algorithm_auth| (server authentication). +#define SSL_aRSA 0x00000001u +#define SSL_aECDSA 0x00000002u +// SSL_aPSK is set for both PSK and ECDHE_PSK. +#define SSL_aPSK 0x00000004u +#define SSL_aGENERIC 0x00000008u + +#define SSL_aCERT (SSL_aRSA | SSL_aECDSA) + +// Bits for |algorithm_enc| (symmetric encryption). +#define SSL_3DES 0x00000001u +#define SSL_AES128 0x00000002u +#define SSL_AES256 0x00000004u +#define SSL_AES128GCM 0x00000008u +#define SSL_AES256GCM 0x00000010u +#define SSL_eNULL 0x00000020u +#define SSL_CHACHA20POLY1305 0x00000040u + +#define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AES128GCM | SSL_AES256GCM) + +// Bits for |algorithm_mac| (symmetric authentication). +#define SSL_SHA1 0x00000001u +// SSL_AEAD is set for all AEADs. +#define SSL_AEAD 0x00000002u + +// Bits for |algorithm_prf| (handshake digest). +#define SSL_HANDSHAKE_MAC_DEFAULT 0x1 +#define SSL_HANDSHAKE_MAC_SHA256 0x2 +#define SSL_HANDSHAKE_MAC_SHA384 0x4 + +// SSL_MAX_MD_SIZE is size of the largest hash function used in TLS, SHA-384. +#define SSL_MAX_MD_SIZE 48 + +// An SSLCipherPreferenceList contains a list of SSL_CIPHERs with equal- +// preference groups. For TLS clients, the groups are moot because the server +// picks the cipher and groups cannot be expressed on the wire. However, for +// servers, the equal-preference groups allow the client's preferences to be +// partially respected. (This only has an effect with +// SSL_OP_CIPHER_SERVER_PREFERENCE). +// +// The equal-preference groups are expressed by grouping SSL_CIPHERs together. +// All elements of a group have the same priority: no ordering is expressed +// within a group. +// +// The values in |ciphers| are in one-to-one correspondence with +// |in_group_flags|. (That is, sk_SSL_CIPHER_num(ciphers) is the number of +// bytes in |in_group_flags|.) The bytes in |in_group_flags| are either 1, to +// indicate that the corresponding SSL_CIPHER is not the last element of a +// group, or 0 to indicate that it is. +// +// For example, if |in_group_flags| contains all zeros then that indicates a +// traditional, fully-ordered preference. Every SSL_CIPHER is the last element +// of the group (i.e. they are all in a one-element group). +// +// For a more complex example, consider: +// ciphers: A B C D E F +// in_group_flags: 1 1 0 0 1 0 +// +// That would express the following, order: +// +// A E +// B -> D -> F +// C +struct SSLCipherPreferenceList { + static constexpr bool kAllowUniquePtr = true; + + SSLCipherPreferenceList() = default; + ~SSLCipherPreferenceList(); + + bool Init(UniquePtr ciphers, + Span in_group_flags); + bool Init(const SSLCipherPreferenceList &); + + void Remove(const SSL_CIPHER *cipher); + + UniquePtr ciphers; + bool *in_group_flags = nullptr; +}; + +// AllCiphers returns an array of all supported ciphers, sorted by id. +Span AllCiphers(); + +// ssl_cipher_get_evp_aead sets |*out_aead| to point to the correct EVP_AEAD +// object for |cipher| protocol version |version|. It sets |*out_mac_secret_len| +// and |*out_fixed_iv_len| to the MAC key length and fixed IV length, +// respectively. The MAC key length is zero except for legacy block and stream +// ciphers. It returns true on success and false on error. +bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, + size_t *out_mac_secret_len, + size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, + uint16_t version, bool is_dtls); + +// ssl_get_handshake_digest returns the |EVP_MD| corresponding to |version| and +// |cipher|. +const EVP_MD *ssl_get_handshake_digest(uint16_t version, + const SSL_CIPHER *cipher); + +// ssl_create_cipher_list evaluates |rule_str|. It sets |*out_cipher_list| to a +// newly-allocated |SSLCipherPreferenceList| containing the result. It returns +// true on success and false on failure. If |strict| is true, nonsense will be +// rejected. If false, nonsense will be silently ignored. An empty result is +// considered an error regardless of |strict|. +bool ssl_create_cipher_list(UniquePtr *out_cipher_list, + const char *rule_str, bool strict); + +// ssl_cipher_get_value returns the cipher suite id of |cipher|. +uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher); + +// ssl_cipher_auth_mask_for_key returns the mask of cipher |algorithm_auth| +// values suitable for use with |key| in TLS 1.2 and below. +uint32_t ssl_cipher_auth_mask_for_key(const EVP_PKEY *key); + +// ssl_cipher_uses_certificate_auth returns whether |cipher| authenticates the +// server and, optionally, the client with a certificate. +bool ssl_cipher_uses_certificate_auth(const SSL_CIPHER *cipher); + +// ssl_cipher_requires_server_key_exchange returns whether |cipher| requires a +// ServerKeyExchange message. +// +// This function may return false while still allowing |cipher| an optional +// ServerKeyExchange. This is the case for plain PSK ciphers. +bool ssl_cipher_requires_server_key_exchange(const SSL_CIPHER *cipher); + +// ssl_cipher_get_record_split_len, for TLS 1.0 CBC mode ciphers, returns the +// length of an encrypted 1-byte record, for use in record-splitting. Otherwise +// it returns zero. +size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher); + +// ssl_choose_tls13_cipher returns an |SSL_CIPHER| corresponding with the best +// available from |cipher_suites| compatible with |version| and |group_id|. It +// returns NULL if there isn't a compatible cipher. +const SSL_CIPHER *ssl_choose_tls13_cipher(CBS cipher_suites, uint16_t version, + uint16_t group_id); + + +// Transcript layer. + +// SSLTranscript maintains the handshake transcript as a combination of a +// buffer and running hash. +class SSLTranscript { + public: + SSLTranscript(); + ~SSLTranscript(); + + // Init initializes the handshake transcript. If called on an existing + // transcript, it resets the transcript and hash. It returns true on success + // and false on failure. + bool Init(); + + // InitHash initializes the handshake hash based on the PRF and contents of + // the handshake transcript. Subsequent calls to |Update| will update the + // rolling hash. It returns one on success and zero on failure. It is an error + // to call this function after the handshake buffer is released. + bool InitHash(uint16_t version, const SSL_CIPHER *cipher); + + // UpdateForHelloRetryRequest resets the rolling hash with the + // HelloRetryRequest construction. It returns true on success and false on + // failure. It is an error to call this function before the handshake buffer + // is released. + bool UpdateForHelloRetryRequest(); + + // CopyToHashContext initializes |ctx| with |digest| and the data thus far in + // the transcript. It returns true on success and false on failure. If the + // handshake buffer is still present, |digest| may be any supported digest. + // Otherwise, |digest| must match the transcript hash. + bool CopyToHashContext(EVP_MD_CTX *ctx, const EVP_MD *digest); + + Span buffer() { + return MakeConstSpan(reinterpret_cast(buffer_->data), + buffer_->length); + } + + // FreeBuffer releases the handshake buffer. Subsequent calls to + // |Update| will not update the handshake buffer. + void FreeBuffer(); + + // DigestLen returns the length of the PRF hash. + size_t DigestLen() const; + + // Digest returns the PRF hash. For TLS 1.1 and below, this is + // |EVP_md5_sha1|. + const EVP_MD *Digest() const; + + // Update adds |in| to the handshake buffer and handshake hash, whichever is + // enabled. It returns true on success and false on failure. + bool Update(Span in); + + // GetHash writes the handshake hash to |out| which must have room for at + // least |DigestLen| bytes. On success, it returns true and sets |*out_len| to + // the number of bytes written. Otherwise, it returns false. + bool GetHash(uint8_t *out, size_t *out_len); + + // GetFinishedMAC computes the MAC for the Finished message into the bytes + // pointed by |out| and writes the number of bytes to |*out_len|. |out| must + // have room for |EVP_MAX_MD_SIZE| bytes. It returns true on success and false + // on failure. + bool GetFinishedMAC(uint8_t *out, size_t *out_len, const SSL_SESSION *session, + bool from_server); + + private: + // buffer_, if non-null, contains the handshake transcript. + UniquePtr buffer_; + // hash, if initialized with an |EVP_MD|, maintains the handshake hash. + ScopedEVP_MD_CTX hash_; +}; + +// tls1_prf computes the PRF function for |ssl|. It fills |out|, using |secret| +// as the secret and |label| as the label. |seed1| and |seed2| are concatenated +// to form the seed parameter. It returns true on success and false on failure. +bool tls1_prf(const EVP_MD *digest, Span out, + Span secret, Span label, + Span seed1, Span seed2); + + +// Encryption layer. + +// SSLAEADContext contains information about an AEAD that is being used to +// encrypt an SSL connection. +class SSLAEADContext { + public: + SSLAEADContext(uint16_t version, bool is_dtls, const SSL_CIPHER *cipher); + ~SSLAEADContext(); + static constexpr bool kAllowUniquePtr = true; + + SSLAEADContext(const SSLAEADContext &&) = delete; + SSLAEADContext &operator=(const SSLAEADContext &&) = delete; + + // CreateNullCipher creates an |SSLAEADContext| for the null cipher. + static UniquePtr CreateNullCipher(bool is_dtls); + + // Create creates an |SSLAEADContext| using the supplied key material. It + // returns nullptr on error. Only one of |Open| or |Seal| may be used with the + // resulting object, depending on |direction|. |version| is the normalized + // protocol version, so DTLS 1.0 is represented as 0x0301, not 0xffef. + static UniquePtr Create(enum evp_aead_direction_t direction, + uint16_t version, bool is_dtls, + const SSL_CIPHER *cipher, + Span enc_key, + Span mac_key, + Span fixed_iv); + + // CreatePlaceholderForQUIC creates a placeholder |SSLAEADContext| for the + // given cipher and version. The resulting object can be queried for various + // properties but cannot encrypt or decrypt data. + static UniquePtr CreatePlaceholderForQUIC( + uint16_t version, const SSL_CIPHER *cipher); + + // SetVersionIfNullCipher sets the version the SSLAEADContext for the null + // cipher, to make version-specific determinations in the record layer prior + // to a cipher being selected. + void SetVersionIfNullCipher(uint16_t version); + + // ProtocolVersion returns the protocol version associated with this + // SSLAEADContext. It can only be called once |version_| has been set to a + // valid value. + uint16_t ProtocolVersion() const; + + // RecordVersion returns the record version that should be used with this + // SSLAEADContext for record construction and crypto. + uint16_t RecordVersion() const; + + const SSL_CIPHER *cipher() const { return cipher_; } + + // is_null_cipher returns true if this is the null cipher. + bool is_null_cipher() const { return !cipher_; } + + // ExplicitNonceLen returns the length of the explicit nonce. + size_t ExplicitNonceLen() const; + + // MaxOverhead returns the maximum overhead of calling |Seal|. + size_t MaxOverhead() const; + + // SuffixLen calculates the suffix length written by |SealScatter| and writes + // it to |*out_suffix_len|. It returns true on success and false on error. + // |in_len| and |extra_in_len| should equal the argument of the same names + // passed to |SealScatter|. + bool SuffixLen(size_t *out_suffix_len, size_t in_len, + size_t extra_in_len) const; + + // CiphertextLen calculates the total ciphertext length written by + // |SealScatter| and writes it to |*out_len|. It returns true on success and + // false on error. |in_len| and |extra_in_len| should equal the argument of + // the same names passed to |SealScatter|. + bool CiphertextLen(size_t *out_len, size_t in_len, size_t extra_in_len) const; + + // Open authenticates and decrypts |in| in-place. On success, it sets |*out| + // to the plaintext in |in| and returns true. Otherwise, it returns + // false. The output will always be |ExplicitNonceLen| bytes ahead of |in|. + bool Open(Span *out, uint8_t type, uint16_t record_version, + const uint8_t seqnum[8], Span header, + Span in); + + // Seal encrypts and authenticates |in_len| bytes from |in| and writes the + // result to |out|. It returns true on success and false on error. + // + // If |in| and |out| alias then |out| + |ExplicitNonceLen| must be == |in|. + bool Seal(uint8_t *out, size_t *out_len, size_t max_out, uint8_t type, + uint16_t record_version, const uint8_t seqnum[8], + Span header, const uint8_t *in, size_t in_len); + + // SealScatter encrypts and authenticates |in_len| bytes from |in| and splits + // the result between |out_prefix|, |out| and |out_suffix|. It returns one on + // success and zero on error. + // + // On successful return, exactly |ExplicitNonceLen| bytes are written to + // |out_prefix|, |in_len| bytes to |out|, and |SuffixLen| bytes to + // |out_suffix|. + // + // |extra_in| may point to an additional plaintext buffer. If present, + // |extra_in_len| additional bytes are encrypted and authenticated, and the + // ciphertext is written to the beginning of |out_suffix|. |SuffixLen| should + // be used to size |out_suffix| accordingly. + // + // If |in| and |out| alias then |out| must be == |in|. Other arguments may not + // alias anything. + bool SealScatter(uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, + uint8_t type, uint16_t record_version, + const uint8_t seqnum[8], Span header, + const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len); + + bool GetIV(const uint8_t **out_iv, size_t *out_iv_len) const; + + private: + // GetAdditionalData returns the additional data, writing into |storage| if + // necessary. + Span GetAdditionalData(uint8_t storage[13], uint8_t type, + uint16_t record_version, + const uint8_t seqnum[8], + size_t plaintext_len, + Span header); + + const SSL_CIPHER *cipher_; + ScopedEVP_AEAD_CTX ctx_; + // fixed_nonce_ contains any bytes of the nonce that are fixed for all + // records. + uint8_t fixed_nonce_[12]; + uint8_t fixed_nonce_len_ = 0, variable_nonce_len_ = 0; + // version_ is the wire version that should be used with this AEAD. + uint16_t version_; + // is_dtls_ is whether DTLS is being used with this AEAD. + bool is_dtls_; + // variable_nonce_included_in_record_ is true if the variable nonce + // for a record is included as a prefix before the ciphertext. + bool variable_nonce_included_in_record_ : 1; + // random_variable_nonce_ is true if the variable nonce is + // randomly generated, rather than derived from the sequence + // number. + bool random_variable_nonce_ : 1; + // xor_fixed_nonce_ is true if the fixed nonce should be XOR'd into the + // variable nonce rather than prepended. + bool xor_fixed_nonce_ : 1; + // omit_length_in_ad_ is true if the length should be omitted in the + // AEAD's ad parameter. + bool omit_length_in_ad_ : 1; + // ad_is_header_ is true if the AEAD's ad parameter is the record header. + bool ad_is_header_ : 1; +}; + + +// DTLS replay bitmap. + +// DTLS1_BITMAP maintains a sliding window of 64 sequence numbers to detect +// replayed packets. It should be initialized by zeroing every field. +struct DTLS1_BITMAP { + // map is a bit mask of the last 64 sequence numbers. Bit + // |1< *out, size_t *out_consumed, + uint8_t *out_alert, Span in); + +// dtls_open_record implements |tls_open_record| for DTLS. It only returns +// |ssl_open_record_partial| if |in| was empty and sets |*out_consumed| to +// zero. The caller should read one packet and try again. +enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, + Span *out, + size_t *out_consumed, + uint8_t *out_alert, Span in); + +// ssl_seal_align_prefix_len returns the length of the prefix before the start +// of the bulk of the ciphertext when sealing a record with |ssl|. Callers may +// use this to align buffers. +// +// Note when TLS 1.0 CBC record-splitting is enabled, this includes the one byte +// record and is the offset into second record's ciphertext. Thus sealing a +// small record may result in a smaller output than this value. +// +// TODO(davidben): Is this alignment valuable? Record-splitting makes this a +// mess. +size_t ssl_seal_align_prefix_len(const SSL *ssl); + +// tls_seal_record seals a new record of type |type| and body |in| and writes it +// to |out|. At most |max_out| bytes will be written. It returns true on success +// and false on error. If enabled, |tls_seal_record| implements TLS 1.0 CBC +// 1/n-1 record splitting and may write two records concatenated. +// +// For a large record, the bulk of the ciphertext will begin +// |ssl_seal_align_prefix_len| bytes into out. Aligning |out| appropriately may +// improve performance. It writes at most |in_len| + |SSL_max_seal_overhead| +// bytes to |out|. +// +// |in| and |out| may not alias. +bool tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, + uint8_t type, const uint8_t *in, size_t in_len); + +enum dtls1_use_epoch_t { + dtls1_use_previous_epoch, + dtls1_use_current_epoch, +}; + +// dtls_max_seal_overhead returns the maximum overhead, in bytes, of sealing a +// record. +size_t dtls_max_seal_overhead(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); + +// dtls_seal_prefix_len returns the number of bytes of prefix to reserve in +// front of the plaintext when sealing a record in-place. +size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); + +// dtls_seal_record implements |tls_seal_record| for DTLS. |use_epoch| selects +// which epoch's cipher state to use. Unlike |tls_seal_record|, |in| and |out| +// may alias but, if they do, |in| must be exactly |dtls_seal_prefix_len| bytes +// ahead of |out|. +bool dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, + uint8_t type, const uint8_t *in, size_t in_len, + enum dtls1_use_epoch_t use_epoch); + +// ssl_process_alert processes |in| as an alert and updates |ssl|'s shutdown +// state. It returns one of |ssl_open_record_discard|, |ssl_open_record_error|, +// |ssl_open_record_close_notify|, or |ssl_open_record_fatal_alert| as +// appropriate. +enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, + Span in); + + +// Private key operations. + +// ssl_has_private_key returns whether |hs| has a private key configured. +bool ssl_has_private_key(const SSL_HANDSHAKE *hs); + +// ssl_private_key_* perform the corresponding operation on +// |SSL_PRIVATE_KEY_METHOD|. If there is a custom private key configured, they +// call the corresponding function or |complete| depending on whether there is a +// pending operation. Otherwise, they implement the operation with +// |EVP_PKEY|. + +enum ssl_private_key_result_t ssl_private_key_sign( + SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, + uint16_t sigalg, Span in); + +enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, + uint8_t *out, + size_t *out_len, + size_t max_out, + Span in); + +// ssl_private_key_supports_signature_algorithm returns whether |hs|'s private +// key supports |sigalg|. +bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, + uint16_t sigalg); + +// ssl_public_key_verify verifies that the |signature| is valid for the public +// key |pkey| and input |in|, using the signature algorithm |sigalg|. +bool ssl_public_key_verify(SSL *ssl, Span signature, + uint16_t sigalg, EVP_PKEY *pkey, + Span in); + + +// Key shares. + +// SSLKeyShare abstracts over Diffie-Hellman-like key exchanges. +class SSLKeyShare { + public: + virtual ~SSLKeyShare() {} + static constexpr bool kAllowUniquePtr = true; + HAS_VIRTUAL_DESTRUCTOR + + // Create returns a SSLKeyShare instance for use with group |group_id| or + // nullptr on error. + static UniquePtr Create(uint16_t group_id); + + // Create deserializes an SSLKeyShare instance previously serialized by + // |Serialize|. + static UniquePtr Create(CBS *in); + + // GroupID returns the group ID. + virtual uint16_t GroupID() const PURE_VIRTUAL; + + // Offer generates a keypair and writes the public value to + // |out_public_key|. It returns true on success and false on error. + virtual bool Offer(CBB *out_public_key) PURE_VIRTUAL; + + // Accept performs a key exchange against the |peer_key| generated by |Offer|. + // On success, it returns true, writes the public value to |out_public_key|, + // and sets |*out_secret| to the shared secret. On failure, it returns false + // and sets |*out_alert| to an alert to send to the peer. + // + // The default implementation calls |Offer| and then |Finish|, assuming a key + // exchange protocol where the peers are symmetric. + virtual bool Accept(CBB *out_public_key, Array *out_secret, + uint8_t *out_alert, Span peer_key); + + // Finish performs a key exchange against the |peer_key| generated by + // |Accept|. On success, it returns true and sets |*out_secret| to the shared + // secret. On failure, it returns false and sets |*out_alert| to an alert to + // send to the peer. + virtual bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) PURE_VIRTUAL; + + // Serialize writes the state of the key exchange to |out|, returning true if + // successful and false otherwise. + virtual bool Serialize(CBB *out) { return false; } + + // Deserialize initializes the state of the key exchange from |in|, returning + // true if successful and false otherwise. It is called by |Create|. + virtual bool Deserialize(CBS *in) { return false; } +}; + +struct NamedGroup { + int nid; + uint16_t group_id; + const char name[8], alias[11]; +}; + +// NamedGroups returns all supported groups. +Span NamedGroups(); + +// ssl_nid_to_group_id looks up the group corresponding to |nid|. On success, it +// sets |*out_group_id| to the group ID and returns true. Otherwise, it returns +// false. +bool ssl_nid_to_group_id(uint16_t *out_group_id, int nid); + +// ssl_name_to_group_id looks up the group corresponding to the |name| string of +// length |len|. On success, it sets |*out_group_id| to the group ID and returns +// true. Otherwise, it returns false. +bool ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len); + + +// Handshake messages. + +struct SSLMessage { + bool is_v2_hello; + uint8_t type; + CBS body; + // raw is the entire serialized handshake message, including the TLS or DTLS + // message header. + CBS raw; +}; + +// SSL_MAX_HANDSHAKE_FLIGHT is the number of messages, including +// ChangeCipherSpec, in the longest handshake flight. Currently this is the +// client's second leg in a full handshake when client certificates, NPN, and +// Channel ID, are all enabled. +#define SSL_MAX_HANDSHAKE_FLIGHT 7 + +extern const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE]; +extern const uint8_t kTLS12DowngradeRandom[8]; +extern const uint8_t kTLS13DowngradeRandom[8]; +extern const uint8_t kJDK11DowngradeRandom[8]; + +// ssl_max_handshake_message_len returns the maximum number of bytes permitted +// in a handshake message for |ssl|. +size_t ssl_max_handshake_message_len(const SSL *ssl); + +// tls_can_accept_handshake_data returns whether |ssl| is able to accept more +// data into handshake buffer. +bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert); + +// tls_has_unprocessed_handshake_data returns whether there is buffered +// handshake data that has not been consumed by |get_message|. +bool tls_has_unprocessed_handshake_data(const SSL *ssl); + +// tls_append_handshake_data appends |data| to the handshake buffer. It returns +// true on success and false on allocation failure. +bool tls_append_handshake_data(SSL *ssl, Span data); + +// dtls_has_unprocessed_handshake_data behaves like +// |tls_has_unprocessed_handshake_data| for DTLS. +bool dtls_has_unprocessed_handshake_data(const SSL *ssl); + +// tls_flush_pending_hs_data flushes any handshake plaintext data. +bool tls_flush_pending_hs_data(SSL *ssl); + +struct DTLS_OUTGOING_MESSAGE { + DTLS_OUTGOING_MESSAGE() {} + DTLS_OUTGOING_MESSAGE(const DTLS_OUTGOING_MESSAGE &) = delete; + DTLS_OUTGOING_MESSAGE &operator=(const DTLS_OUTGOING_MESSAGE &) = delete; + ~DTLS_OUTGOING_MESSAGE() { Clear(); } + + void Clear(); + + uint8_t *data = nullptr; + uint32_t len = 0; + uint16_t epoch = 0; + bool is_ccs = false; +}; + +// dtls_clear_outgoing_messages releases all buffered outgoing messages. +void dtls_clear_outgoing_messages(SSL *ssl); + + +// Callbacks. + +// ssl_do_info_callback calls |ssl|'s info callback, if set. +void ssl_do_info_callback(const SSL *ssl, int type, int value); + +// ssl_do_msg_callback calls |ssl|'s message callback, if set. +void ssl_do_msg_callback(const SSL *ssl, int is_write, int content_type, + Span in); + + +// Transport buffers. + +class SSLBuffer { + public: + SSLBuffer() {} + ~SSLBuffer() { Clear(); } + + SSLBuffer(const SSLBuffer &) = delete; + SSLBuffer &operator=(const SSLBuffer &) = delete; + + uint8_t *data() { return buf_ + offset_; } + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + size_t cap() const { return cap_; } + + Span span() { return MakeSpan(data(), size()); } + + Span remaining() { + return MakeSpan(data() + size(), cap() - size()); + } + + // Clear releases the buffer. + void Clear(); + + // EnsureCap ensures the buffer has capacity at least |new_cap|, aligned such + // that data written after |header_len| is aligned to a + // |SSL3_ALIGN_PAYLOAD|-byte boundary. It returns true on success and false + // on error. + bool EnsureCap(size_t header_len, size_t new_cap); + + // DidWrite extends the buffer by |len|. The caller must have filled in to + // this point. + void DidWrite(size_t len); + + // Consume consumes |len| bytes from the front of the buffer. The memory + // consumed will remain valid until the next call to |DiscardConsumed| or + // |Clear|. + void Consume(size_t len); + + // DiscardConsumed discards the consumed bytes from the buffer. If the buffer + // is now empty, it releases memory used by it. + void DiscardConsumed(); + + private: + // buf_ is the memory allocated for this buffer. + uint8_t *buf_ = nullptr; + // offset_ is the offset into |buf_| which the buffer contents start at. + uint16_t offset_ = 0; + // size_ is the size of the buffer contents from |buf_| + |offset_|. + uint16_t size_ = 0; + // cap_ is how much memory beyond |buf_| + |offset_| is available. + uint16_t cap_ = 0; + // inline_buf_ is a static buffer for short reads. + uint8_t inline_buf_[SSL3_RT_HEADER_LENGTH]; + // buf_allocated_ is true if |buf_| points to allocated data and must be freed + // or false if it points into |inline_buf_|. + bool buf_allocated_ = false; +}; + +// ssl_read_buffer_extend_to extends the read buffer to the desired length. For +// TLS, it reads to the end of the buffer until the buffer is |len| bytes +// long. For DTLS, it reads a new packet and ignores |len|. It returns one on +// success, zero on EOF, and a negative number on error. +// +// It is an error to call |ssl_read_buffer_extend_to| in DTLS when the buffer is +// non-empty. +int ssl_read_buffer_extend_to(SSL *ssl, size_t len); + +// ssl_handle_open_record handles the result of passing |ssl->s3->read_buffer| +// to a record-processing function. If |ret| is a success or if the caller +// should retry, it returns one and sets |*out_retry|. Otherwise, it returns <= +// 0. +int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, + size_t consumed, uint8_t alert); + +// ssl_write_buffer_flush flushes the write buffer to the transport. It returns +// one on success and <= 0 on error. For DTLS, whether or not the write +// succeeds, the write buffer will be cleared. +int ssl_write_buffer_flush(SSL *ssl); + + +// Certificate functions. + +// ssl_has_certificate returns whether a certificate and private key are +// configured. +bool ssl_has_certificate(const SSL_HANDSHAKE *hs); + +// ssl_parse_cert_chain parses a certificate list from |cbs| in the format used +// by a TLS Certificate message. On success, it advances |cbs| and returns +// true. Otherwise, it returns false and sets |*out_alert| to an alert to send +// to the peer. +// +// If the list is non-empty then |*out_chain| and |*out_pubkey| will be set to +// the certificate chain and the leaf certificate's public key +// respectively. Otherwise, both will be set to nullptr. +// +// If the list is non-empty and |out_leaf_sha256| is non-NULL, it writes the +// SHA-256 hash of the leaf to |out_leaf_sha256|. +bool ssl_parse_cert_chain(uint8_t *out_alert, + UniquePtr *out_chain, + UniquePtr *out_pubkey, + uint8_t *out_leaf_sha256, CBS *cbs, + CRYPTO_BUFFER_POOL *pool); + +// ssl_add_cert_chain adds |hs->ssl|'s certificate chain to |cbb| in the format +// used by a TLS Certificate message. If there is no certificate chain, it emits +// an empty certificate list. It returns true on success and false on error. +bool ssl_add_cert_chain(SSL_HANDSHAKE *hs, CBB *cbb); + +enum ssl_key_usage_t { + key_usage_digital_signature = 0, + key_usage_encipherment = 2, +}; + +// ssl_cert_check_key_usage parses the DER-encoded, X.509 certificate in |in| +// and returns true if doesn't specify a key usage or, if it does, if it +// includes |bit|. Otherwise it pushes to the error queue and returns false. +bool ssl_cert_check_key_usage(const CBS *in, enum ssl_key_usage_t bit); + +// ssl_cert_parse_pubkey extracts the public key from the DER-encoded, X.509 +// certificate in |in|. It returns an allocated |EVP_PKEY| or else returns +// nullptr and pushes to the error queue. +UniquePtr ssl_cert_parse_pubkey(const CBS *in); + +// ssl_parse_client_CA_list parses a CA list from |cbs| in the format used by a +// TLS CertificateRequest message. On success, it returns a newly-allocated +// |CRYPTO_BUFFER| list and advances |cbs|. Otherwise, it returns nullptr and +// sets |*out_alert| to an alert to send to the peer. +UniquePtr ssl_parse_client_CA_list(SSL *ssl, + uint8_t *out_alert, + CBS *cbs); + +// ssl_has_client_CAs returns there are configured CAs. +bool ssl_has_client_CAs(const SSL_CONFIG *cfg); + +// ssl_add_client_CA_list adds the configured CA list to |cbb| in the format +// used by a TLS CertificateRequest message. It returns true on success and +// false on error. +bool ssl_add_client_CA_list(SSL_HANDSHAKE *hs, CBB *cbb); + +// ssl_check_leaf_certificate returns one if |pkey| and |leaf| are suitable as +// a server's leaf certificate for |hs|. Otherwise, it returns zero and pushes +// an error on the error queue. +bool ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, + const CRYPTO_BUFFER *leaf); + +// ssl_on_certificate_selected is called once the certificate has been selected. +// It finalizes the certificate and initializes |hs->local_pubkey|. It returns +// true on success and false on error. +bool ssl_on_certificate_selected(SSL_HANDSHAKE *hs); + + +// TLS 1.3 key derivation. + +// tls13_init_key_schedule initializes the handshake hash and key derivation +// state, and incorporates the PSK. The cipher suite and PRF hash must have been +// selected at this point. It returns true on success and false on error. +bool tls13_init_key_schedule(SSL_HANDSHAKE *hs, Span psk); + +// tls13_init_early_key_schedule initializes the handshake hash and key +// derivation state from the resumption secret and incorporates the PSK to +// derive the early secrets. It returns one on success and zero on error. +bool tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, Span psk); + +// tls13_advance_key_schedule incorporates |in| into the key schedule with +// HKDF-Extract. It returns true on success and false on error. +bool tls13_advance_key_schedule(SSL_HANDSHAKE *hs, Span in); + +// tls13_set_traffic_key sets the read or write traffic keys to +// |traffic_secret|. It returns true on success and false on error. +bool tls13_set_traffic_key(SSL *ssl, enum ssl_encryption_level_t level, + enum evp_aead_direction_t direction, + Span traffic_secret); + +// tls13_derive_early_secret derives the early traffic secret. It returns true +// on success and false on error. Unlike with other traffic secrets, this +// function does not pass the keys to QUIC. Call +// |tls13_set_early_secret_for_quic| to do so. This is done to due to an +// ordering complication around resolving HelloRetryRequest on the server. +bool tls13_derive_early_secret(SSL_HANDSHAKE *hs); + +// tls13_set_early_secret_for_quic passes the early traffic secrets, as +// derived by |tls13_derive_early_secret|, to QUIC. It returns true on success +// and false on error. +bool tls13_set_early_secret_for_quic(SSL_HANDSHAKE *hs); + +// tls13_derive_handshake_secrets derives the handshake traffic secret. It +// returns true on success and false on error. +bool tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs); + +// tls13_rotate_traffic_key derives the next read or write traffic secret. It +// returns true on success and false on error. +bool tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction); + +// tls13_derive_application_secrets derives the initial application data traffic +// and exporter secrets based on the handshake transcripts and |master_secret|. +// It returns true on success and false on error. +bool tls13_derive_application_secrets(SSL_HANDSHAKE *hs); + +// tls13_derive_resumption_secret derives the |resumption_secret|. +bool tls13_derive_resumption_secret(SSL_HANDSHAKE *hs); + +// tls13_export_keying_material provides an exporter interface to use the +// |exporter_secret|. +bool tls13_export_keying_material(SSL *ssl, Span out, + Span secret, + Span label, + Span context); + +// tls13_finished_mac calculates the MAC of the handshake transcript to verify +// the integrity of the Finished message, and stores the result in |out| and +// length in |out_len|. |is_server| is true if this is for the Server Finished +// and false for the Client Finished. +bool tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, + bool is_server); + +// tls13_derive_session_psk calculates the PSK for this session based on the +// resumption master secret and |nonce|. It returns true on success, and false +// on failure. +bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce); + +// tls13_write_psk_binder calculates the PSK binder value and replaces the last +// bytes of |msg| with the resulting value. It returns true on success, and +// false on failure. +bool tls13_write_psk_binder(SSL_HANDSHAKE *hs, Span msg); + +// tls13_verify_psk_binder verifies that the handshake transcript, truncated up +// to the binders has a valid signature using the value of |session|'s +// resumption secret. It returns true on success, and false on failure. +bool tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, + const SSLMessage &msg, CBS *binders); + + +// Handshake functions. + +enum ssl_hs_wait_t { + ssl_hs_error, + ssl_hs_ok, + ssl_hs_read_server_hello, + ssl_hs_read_message, + ssl_hs_flush, + ssl_hs_certificate_selection_pending, + ssl_hs_handoff, + ssl_hs_handback, + ssl_hs_x509_lookup, + ssl_hs_channel_id_lookup, + ssl_hs_private_key_operation, + ssl_hs_pending_session, + ssl_hs_pending_ticket, + ssl_hs_early_return, + ssl_hs_early_data_rejected, + ssl_hs_read_end_of_early_data, + ssl_hs_read_change_cipher_spec, + ssl_hs_certificate_verify, +}; + +enum ssl_grease_index_t { + ssl_grease_cipher = 0, + ssl_grease_group, + ssl_grease_extension1, + ssl_grease_extension2, + ssl_grease_version, + ssl_grease_ticket_extension, + ssl_grease_last_index = ssl_grease_ticket_extension, +}; + +enum tls12_server_hs_state_t { + state12_start_accept = 0, + state12_read_client_hello, + state12_select_certificate, + state12_tls13, + state12_select_parameters, + state12_send_server_hello, + state12_send_server_certificate, + state12_send_server_key_exchange, + state12_send_server_hello_done, + state12_read_client_certificate, + state12_verify_client_certificate, + state12_read_client_key_exchange, + state12_read_client_certificate_verify, + state12_read_change_cipher_spec, + state12_process_change_cipher_spec, + state12_read_next_proto, + state12_read_channel_id, + state12_read_client_finished, + state12_send_server_finished, + state12_finish_server_handshake, + state12_done, +}; + +enum tls13_server_hs_state_t { + state13_select_parameters = 0, + state13_select_session, + state13_send_hello_retry_request, + state13_read_second_client_hello, + state13_send_server_hello, + state13_send_server_certificate_verify, + state13_send_server_finished, + state13_read_second_client_flight, + state13_process_end_of_early_data, + state13_read_client_certificate, + state13_read_client_certificate_verify, + state13_read_channel_id, + state13_read_client_finished, + state13_send_new_session_ticket, + state13_done, +}; + +// handback_t lists the points in the state machine where a handback can occur. +// These are the different points at which key material is no longer needed. +enum handback_t { + handback_after_session_resumption, + handback_after_ecdhe, + handback_after_handshake, + handback_tls13, +}; + + +// Delegated credentials. + +// This structure stores a delegated credential (DC) as defined by +// draft-ietf-tls-subcerts-03. +struct DC { + static constexpr bool kAllowUniquePtr = true; + ~DC(); + + // Dup returns a copy of this DC and takes references to |raw| and |pkey|. + UniquePtr Dup(); + + // Parse parses the delegated credential stored in |in|. If successful it + // returns the parsed structure, otherwise it returns |nullptr| and sets + // |*out_alert|. + static UniquePtr Parse(CRYPTO_BUFFER *in, uint8_t *out_alert); + + // raw is the delegated credential encoded as specified in draft-ietf-tls- + // subcerts-03. + UniquePtr raw; + + // expected_cert_verify_algorithm is the signature scheme of the DC public + // key. + uint16_t expected_cert_verify_algorithm = 0; + + // pkey is the public key parsed from |public_key|. + UniquePtr pkey; + + private: + friend DC* New(); + DC(); +}; + +// ssl_signing_with_dc returns true if the peer has indicated support for +// delegated credentials and this host has sent a delegated credential in +// response. If this is true then we've committed to using the DC in the +// handshake. +bool ssl_signing_with_dc(const SSL_HANDSHAKE *hs); + + +struct SSL_HANDSHAKE { + explicit SSL_HANDSHAKE(SSL *ssl); + ~SSL_HANDSHAKE(); + static constexpr bool kAllowUniquePtr = true; + + // ssl is a non-owning pointer to the parent |SSL| object. + SSL *ssl; + + // config is a non-owning pointer to the handshake configuration. + SSL_CONFIG *config; + + // wait contains the operation the handshake is currently blocking on or + // |ssl_hs_ok| if none. + enum ssl_hs_wait_t wait = ssl_hs_ok; + + // state is the internal state for the TLS 1.2 and below handshake. Its + // values depend on |do_handshake| but the starting state is always zero. + int state = 0; + + // tls13_state is the internal state for the TLS 1.3 handshake. Its values + // depend on |do_handshake| but the starting state is always zero. + int tls13_state = 0; + + // min_version is the minimum accepted protocol version, taking account both + // |SSL_OP_NO_*| and |SSL_CTX_set_min_proto_version| APIs. + uint16_t min_version = 0; + + // max_version is the maximum accepted protocol version, taking account both + // |SSL_OP_NO_*| and |SSL_CTX_set_max_proto_version| APIs. + uint16_t max_version = 0; + + private: + size_t hash_len_ = 0; + uint8_t secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t early_traffic_secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t client_handshake_secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t server_handshake_secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t client_traffic_secret_0_[SSL_MAX_MD_SIZE] = {0}; + uint8_t server_traffic_secret_0_[SSL_MAX_MD_SIZE] = {0}; + uint8_t expected_client_finished_[SSL_MAX_MD_SIZE] = {0}; + + public: + void ResizeSecrets(size_t hash_len); + + Span secret() { return MakeSpan(secret_, hash_len_); } + Span early_traffic_secret() { + return MakeSpan(early_traffic_secret_, hash_len_); + } + Span client_handshake_secret() { + return MakeSpan(client_handshake_secret_, hash_len_); + } + Span server_handshake_secret() { + return MakeSpan(server_handshake_secret_, hash_len_); + } + Span client_traffic_secret_0() { + return MakeSpan(client_traffic_secret_0_, hash_len_); + } + Span server_traffic_secret_0() { + return MakeSpan(server_traffic_secret_0_, hash_len_); + } + Span expected_client_finished() { + return MakeSpan(expected_client_finished_, hash_len_); + } + + union { + // sent is a bitset where the bits correspond to elements of kExtensions + // in t1_lib.c. Each bit is set if that extension was sent in a + // ClientHello. It's not used by servers. + uint32_t sent = 0; + // received is a bitset, like |sent|, but is used by servers to record + // which extensions were received from a client. + uint32_t received; + } extensions; + + // retry_group is the group ID selected by the server in HelloRetryRequest in + // TLS 1.3. + uint16_t retry_group = 0; + + // error, if |wait| is |ssl_hs_error|, is the error the handshake failed on. + UniquePtr error; + + // key_shares are the current key exchange instances. The second is only used + // as a client if we believe that we should offer two key shares in a + // ClientHello. + UniquePtr key_shares[2]; + + // transcript is the current handshake transcript. + SSLTranscript transcript; + + // cookie is the value of the cookie received from the server, if any. + Array cookie; + + // key_share_bytes is the value of the previously sent KeyShare extension by + // the client in TLS 1.3. + Array key_share_bytes; + + // ecdh_public_key, for servers, is the key share to be sent to the client in + // TLS 1.3. + Array ecdh_public_key; + + // peer_sigalgs are the signature algorithms that the peer supports. These are + // taken from the contents of the signature algorithms extension for a server + // or from the CertificateRequest for a client. + Array peer_sigalgs; + + // peer_supported_group_list contains the supported group IDs advertised by + // the peer. This is only set on the server's end. The server does not + // advertise this extension to the client. + Array peer_supported_group_list; + + // peer_key is the peer's ECDH key for a TLS 1.2 client. + Array peer_key; + + // negotiated_token_binding_version is used by a server to store the + // on-the-wire encoding of the Token Binding protocol version to advertise in + // the ServerHello/EncryptedExtensions if the Token Binding extension is to be + // sent. + uint16_t negotiated_token_binding_version; + + // cert_compression_alg_id, for a server, contains the negotiated certificate + // compression algorithm for this client. It is only valid if + // |cert_compression_negotiated| is true. + uint16_t cert_compression_alg_id; + + // server_params, in a TLS 1.2 server, stores the ServerKeyExchange + // parameters. It has client and server randoms prepended for signing + // convenience. + Array server_params; + + // peer_psk_identity_hint, on the client, is the psk_identity_hint sent by the + // server when using a TLS 1.2 PSK key exchange. + UniquePtr peer_psk_identity_hint; + + // ca_names, on the client, contains the list of CAs received in a + // CertificateRequest message. + UniquePtr ca_names; + + // cached_x509_ca_names contains a cache of parsed versions of the elements of + // |ca_names|. This pointer is left non-owning so only + // |ssl_crypto_x509_method| needs to link against crypto/x509. + STACK_OF(X509_NAME) *cached_x509_ca_names = nullptr; + + // certificate_types, on the client, contains the set of certificate types + // received in a CertificateRequest message. + Array certificate_types; + + // local_pubkey is the public key we are authenticating as. + UniquePtr local_pubkey; + + // peer_pubkey is the public key parsed from the peer's leaf certificate. + UniquePtr peer_pubkey; + + // new_session is the new mutable session being established by the current + // handshake. It should not be cached. + UniquePtr new_session; + + // early_session is the session corresponding to the current 0-RTT state on + // the client if |in_early_data| is true. + UniquePtr early_session; + + // new_cipher is the cipher being negotiated in this handshake. + const SSL_CIPHER *new_cipher = nullptr; + + // key_block is the record-layer key block for TLS 1.2 and earlier. + Array key_block; + + // scts_requested is true if the SCT extension is in the ClientHello. + bool scts_requested : 1; + + // needs_psk_binder is true if the ClientHello has a placeholder PSK binder to + // be filled in. + bool needs_psk_binder : 1; + + // handshake_finalized is true once the handshake has completed, at which + // point accessors should use the established state. + bool handshake_finalized : 1; + + // accept_psk_mode stores whether the client's PSK mode is compatible with our + // preferences. + bool accept_psk_mode : 1; + + // cert_request is true if a client certificate was requested. + bool cert_request : 1; + + // certificate_status_expected is true if OCSP stapling was negotiated and the + // server is expected to send a CertificateStatus message. (This is used on + // both the client and server sides.) + bool certificate_status_expected : 1; + + // ocsp_stapling_requested is true if a client requested OCSP stapling. + bool ocsp_stapling_requested : 1; + + // delegated_credential_requested is true if the peer indicated support for + // the delegated credential extension. + bool delegated_credential_requested : 1; + + // should_ack_sni is used by a server and indicates that the SNI extension + // should be echoed in the ServerHello. + bool should_ack_sni : 1; + + // in_false_start is true if there is a pending client handshake in False + // Start. The client may write data at this point. + bool in_false_start : 1; + + // in_early_data is true if there is a pending handshake that has progressed + // enough to send and receive early data. + bool in_early_data : 1; + + // early_data_offered is true if the client sent the early_data extension. + bool early_data_offered : 1; + + // can_early_read is true if application data may be read at this point in the + // handshake. + bool can_early_read : 1; + + // can_early_write is true if application data may be written at this point in + // the handshake. + bool can_early_write : 1; + + // next_proto_neg_seen is one of NPN was negotiated. + bool next_proto_neg_seen : 1; + + // ticket_expected is true if a TLS 1.2 NewSessionTicket message is to be sent + // or received. + bool ticket_expected : 1; + + // extended_master_secret is true if the extended master secret extension is + // negotiated in this handshake. + bool extended_master_secret : 1; + + // pending_private_key_op is true if there is a pending private key operation + // in progress. + bool pending_private_key_op : 1; + + // grease_seeded is true if |grease_seed| has been initialized. + bool grease_seeded : 1; + + // handback indicates that a server should pause the handshake after + // finishing operations that require private key material, in such a way that + // |SSL_get_error| returns |SSL_ERROR_HANDBACK|. It is set by + // |SSL_apply_handoff|. + bool handback : 1; + + // cert_compression_negotiated is true iff |cert_compression_alg_id| is valid. + bool cert_compression_negotiated : 1; + + // apply_jdk11_workaround is true if the peer is probably a JDK 11 client + // which implemented TLS 1.3 incorrectly. + bool apply_jdk11_workaround : 1; + + // client_version is the value sent or received in the ClientHello version. + uint16_t client_version = 0; + + // early_data_read is the amount of early data that has been read by the + // record layer. + uint16_t early_data_read = 0; + + // early_data_written is the amount of early data that has been written by the + // record layer. + uint16_t early_data_written = 0; + + // session_id is the session ID in the ClientHello. + uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH] = {0}; + uint8_t session_id_len = 0; + + // grease_seed is the entropy for GREASE values. It is valid if + // |grease_seeded| is true. + uint8_t grease_seed[ssl_grease_last_index + 1] = {0}; +}; + +UniquePtr ssl_handshake_new(SSL *ssl); + +// ssl_check_message_type checks if |msg| has type |type|. If so it returns +// one. Otherwise, it sends an alert and returns zero. +bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type); + +// ssl_run_handshake runs the TLS handshake. It returns one on success and <= 0 +// on error. It sets |out_early_return| to one if we've completed the handshake +// early. +int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return); + +// The following are implementations of |do_handshake| for the client and +// server. +enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs); +enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs); +enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs); +enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs); + +// The following functions return human-readable representations of the TLS +// handshake states for debugging. +const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs); +const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs); +const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs); +const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs); + +// tls13_add_key_update queues a KeyUpdate message on |ssl|. The +// |update_requested| argument must be one of |SSL_KEY_UPDATE_REQUESTED| or +// |SSL_KEY_UPDATE_NOT_REQUESTED|. +bool tls13_add_key_update(SSL *ssl, int update_requested); + +// tls13_post_handshake processes a post-handshake message. It returns true on +// success and false on failure. +bool tls13_post_handshake(SSL *ssl, const SSLMessage &msg); + +bool tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool allow_anonymous); +bool tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg); + +// tls13_process_finished processes |msg| as a Finished message from the +// peer. If |use_saved_value| is true, the verify_data is compared against +// |hs->expected_client_finished| rather than computed fresh. +bool tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool use_saved_value); + +bool tls13_add_certificate(SSL_HANDSHAKE *hs); + +// tls13_add_certificate_verify adds a TLS 1.3 CertificateVerify message to the +// handshake. If it returns |ssl_private_key_retry|, it should be called again +// to retry when the signing operation is completed. +enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs); + +bool tls13_add_finished(SSL_HANDSHAKE *hs); +bool tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg); + +bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, + Array *out_secret, + uint8_t *out_alert, CBS *contents); +bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found, + Array *out_secret, + uint8_t *out_alert, CBS *contents); +bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); + +bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents); +bool ssl_ext_pre_shared_key_parse_clienthello( + SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders, + uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello, CBS *contents); +bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); + +// ssl_is_sct_list_valid does a shallow parse of the SCT list in |contents| and +// returns whether it's valid. +bool ssl_is_sct_list_valid(const CBS *contents); + +bool ssl_write_client_hello(SSL_HANDSHAKE *hs); + +enum ssl_cert_verify_context_t { + ssl_cert_verify_server, + ssl_cert_verify_client, + ssl_cert_verify_channel_id, +}; + +// tls13_get_cert_verify_signature_input generates the message to be signed for +// TLS 1.3's CertificateVerify message. |cert_verify_context| determines the +// type of signature. It sets |*out| to a newly allocated buffer containing the +// result. This function returns true on success and false on failure. +bool tls13_get_cert_verify_signature_input( + SSL_HANDSHAKE *hs, Array *out, + enum ssl_cert_verify_context_t cert_verify_context); + +// ssl_is_alpn_protocol_allowed returns whether |protocol| is a valid server +// selection for |hs->ssl|'s client preferences. +bool ssl_is_alpn_protocol_allowed(const SSL_HANDSHAKE *hs, + Span protocol); + +// ssl_negotiate_alpn negotiates the ALPN extension, if applicable. It returns +// true on successful negotiation or if nothing was negotiated. It returns false +// and sets |*out_alert| to an alert on error. +bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello); + +struct SSL_EXTENSION_TYPE { + uint16_t type; + bool *out_present; + CBS *out_data; +}; + +// ssl_parse_extensions parses a TLS extensions block out of |cbs| and advances +// it. It writes the parsed extensions to pointers denoted by |ext_types|. On +// success, it fills in the |out_present| and |out_data| fields and returns one. +// Otherwise, it sets |*out_alert| to an alert to send and returns zero. Unknown +// extensions are rejected unless |ignore_unknown| is 1. +int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert, + const SSL_EXTENSION_TYPE *ext_types, + size_t num_ext_types, int ignore_unknown); + +// ssl_verify_peer_cert verifies the peer certificate for |hs|. +enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs); +// ssl_reverify_peer_cert verifies the peer certificate for |hs| when resuming a +// session. +enum ssl_verify_result_t ssl_reverify_peer_cert(SSL_HANDSHAKE *hs, + bool send_alert); + +enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs); +bool ssl_send_finished(SSL_HANDSHAKE *hs); +bool ssl_output_cert_chain(SSL_HANDSHAKE *hs); + +// SSLKEYLOGFILE functions. + +// ssl_log_secret logs |secret| with label |label|, if logging is enabled for +// |ssl|. It returns true on success and false on failure. +bool ssl_log_secret(const SSL *ssl, const char *label, + Span secret); + + +// ClientHello functions. + +bool ssl_client_hello_init(const SSL *ssl, SSL_CLIENT_HELLO *out, + const SSLMessage &msg); + +bool ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, + CBS *out, uint16_t extension_type); + +bool ssl_client_cipher_list_contains_cipher( + const SSL_CLIENT_HELLO *client_hello, uint16_t id); + + +// GREASE. + +// ssl_get_grease_value returns a GREASE value for |hs|. For a given +// connection, the values for each index will be deterministic. This allows the +// same ClientHello be sent twice for a HelloRetryRequest or the same group be +// advertised in both supported_groups and key_shares. +uint16_t ssl_get_grease_value(SSL_HANDSHAKE *hs, enum ssl_grease_index_t index); + + +// Signature algorithms. + +// tls1_parse_peer_sigalgs parses |sigalgs| as the list of peer signature +// algorithms and saves them on |hs|. It returns true on success and false on +// error. +bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *sigalgs); + +// tls1_get_legacy_signature_algorithm sets |*out| to the signature algorithm +// that should be used with |pkey| in TLS 1.1 and earlier. It returns true on +// success and false if |pkey| may not be used at those versions. +bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey); + +// tls1_choose_signature_algorithm sets |*out| to a signature algorithm for use +// with |hs|'s private key based on the peer's preferences and the algorithms +// supported. It returns true on success and false on error. +bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out); + +// tls1_get_peer_verify_algorithms returns the signature schemes for which the +// peer indicated support. +// +// NOTE: The related function |SSL_get0_peer_verify_algorithms| only has +// well-defined behavior during the callbacks set by |SSL_CTX_set_cert_cb| and +// |SSL_CTX_set_client_cert_cb|, or when the handshake is paused because of +// them. +Span tls1_get_peer_verify_algorithms(const SSL_HANDSHAKE *hs); + +// tls12_add_verify_sigalgs adds the signature algorithms acceptable for the +// peer signature to |out|. It returns true on success and false on error. +bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out); + +// tls12_check_peer_sigalg checks if |sigalg| is acceptable for the peer +// signature. It returns true on success and false on error, setting +// |*out_alert| to an alert to send. +bool tls12_check_peer_sigalg(const SSL *ssl, uint8_t *out_alert, + uint16_t sigalg); + + +// Underdocumented functions. +// +// Functions below here haven't been touched up and may be underdocumented. + +#define TLSEXT_CHANNEL_ID_SIZE 128 + +// From RFC4492, used in encoding the curve type in ECParameters +#define NAMED_CURVE_TYPE 3 + +struct CERT { + static constexpr bool kAllowUniquePtr = true; + + explicit CERT(const SSL_X509_METHOD *x509_method); + ~CERT(); + + UniquePtr privatekey; + + // chain contains the certificate chain, with the leaf at the beginning. The + // first element of |chain| may be NULL to indicate that the leaf certificate + // has not yet been set. + // If |chain| != NULL -> len(chain) >= 1 + // If |chain[0]| == NULL -> len(chain) >= 2. + // |chain[1..]| != NULL + UniquePtr chain; + + // x509_chain may contain a parsed copy of |chain[1..]|. This is only used as + // a cache in order to implement “get0” functions that return a non-owning + // pointer to the certificate chain. + STACK_OF(X509) *x509_chain = nullptr; + + // x509_leaf may contain a parsed copy of the first element of |chain|. This + // is only used as a cache in order to implement “get0” functions that return + // a non-owning pointer to the certificate chain. + X509 *x509_leaf = nullptr; + + // x509_stash contains the last |X509| object append to the chain. This is a + // workaround for some third-party code that continue to use an |X509| object + // even after passing ownership with an “add0” function. + X509 *x509_stash = nullptr; + + // key_method, if non-NULL, is a set of callbacks to call for private key + // operations. + const SSL_PRIVATE_KEY_METHOD *key_method = nullptr; + + // x509_method contains pointers to functions that might deal with |X509| + // compatibility, or might be a no-op, depending on the application. + const SSL_X509_METHOD *x509_method = nullptr; + + // sigalgs, if non-empty, is the set of signature algorithms supported by + // |privatekey| in decreasing order of preference. + Array sigalgs; + + // Certificate setup callback: if set is called whenever a + // certificate may be required (client or server). the callback + // can then examine any appropriate parameters and setup any + // certificates required. This allows advanced applications + // to select certificates on the fly: for example based on + // supported signature algorithms or curves. + int (*cert_cb)(SSL *ssl, void *arg) = nullptr; + void *cert_cb_arg = nullptr; + + // Optional X509_STORE for certificate validation. If NULL the parent SSL_CTX + // store is used instead. + X509_STORE *verify_store = nullptr; + + // Signed certificate timestamp list to be sent to the client, if requested + UniquePtr signed_cert_timestamp_list; + + // OCSP response to be sent to the client, if requested. + UniquePtr ocsp_response; + + // sid_ctx partitions the session space within a shared session cache or + // ticket key. Only sessions with a matching value will be accepted. + uint8_t sid_ctx_length = 0; + uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH] = {0}; + + // Delegated credentials. + + // dc is the delegated credential to send to the peer (if requested). + UniquePtr dc = nullptr; + + // dc_privatekey is used instead of |privatekey| or |key_method| to + // authenticate the host if a delegated credential is used in the handshake. + UniquePtr dc_privatekey = nullptr; + + // dc_key_method, if not NULL, is used instead of |dc_privatekey| to + // authenticate the host. + const SSL_PRIVATE_KEY_METHOD *dc_key_method = nullptr; +}; + +// |SSL_PROTOCOL_METHOD| abstracts between TLS and DTLS. +struct SSL_PROTOCOL_METHOD { + bool is_dtls; + bool (*ssl_new)(SSL *ssl); + void (*ssl_free)(SSL *ssl); + // get_message sets |*out| to the current handshake message and returns true + // if one has been received. It returns false if more input is needed. + bool (*get_message)(const SSL *ssl, SSLMessage *out); + // next_message is called to release the current handshake message. + void (*next_message)(SSL *ssl); + // Use the |ssl_open_handshake| wrapper. + ssl_open_record_t (*open_handshake)(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); + // Use the |ssl_open_change_cipher_spec| wrapper. + ssl_open_record_t (*open_change_cipher_spec)(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); + // Use the |ssl_open_app_data| wrapper. + ssl_open_record_t (*open_app_data)(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); + int (*write_app_data)(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, + int len); + int (*dispatch_alert)(SSL *ssl); + // init_message begins a new handshake message of type |type|. |cbb| is the + // root CBB to be passed into |finish_message|. |*body| is set to a child CBB + // the caller should write to. It returns true on success and false on error. + bool (*init_message)(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); + // finish_message finishes a handshake message. It sets |*out_msg| to the + // serialized message. It returns true on success and false on error. + bool (*finish_message)(SSL *ssl, CBB *cbb, bssl::Array *out_msg); + // add_message adds a handshake message to the pending flight. It returns + // true on success and false on error. + bool (*add_message)(SSL *ssl, bssl::Array msg); + // add_change_cipher_spec adds a ChangeCipherSpec record to the pending + // flight. It returns true on success and false on error. + bool (*add_change_cipher_spec)(SSL *ssl); + // flush_flight flushes the pending flight to the transport. It returns one on + // success and <= 0 on error. + int (*flush_flight)(SSL *ssl); + // on_handshake_complete is called when the handshake is complete. + void (*on_handshake_complete)(SSL *ssl); + // set_read_state sets |ssl|'s read cipher state to |aead_ctx|. It returns + // true on success and false if changing the read state is forbidden at this + // point. + bool (*set_read_state)(SSL *ssl, UniquePtr aead_ctx); + // set_write_state sets |ssl|'s write cipher state to |aead_ctx|. It returns + // true on success and false if changing the write state is forbidden at this + // point. + bool (*set_write_state)(SSL *ssl, UniquePtr aead_ctx); +}; + +// The following wrappers call |open_*| but handle |read_shutdown| correctly. + +// ssl_open_handshake processes a record from |in| for reading a handshake +// message. +ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); + +// ssl_open_change_cipher_spec processes a record from |in| for reading a +// ChangeCipherSpec. +ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); + +// ssl_open_app_data processes a record from |in| for reading application data. +// On success, it returns |ssl_open_record_success| and sets |*out| to the +// input. If it encounters a post-handshake message, it returns +// |ssl_open_record_discard|. The caller should then retry, after processing any +// messages received with |get_message|. +ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); + +struct SSL_X509_METHOD { + // check_client_CA_list returns one if |names| is a good list of X.509 + // distinguished names and zero otherwise. This is used to ensure that we can + // reject unparsable values at handshake time when using crypto/x509. + bool (*check_client_CA_list)(STACK_OF(CRYPTO_BUFFER) *names); + + // cert_clear frees and NULLs all X509 certificate-related state. + void (*cert_clear)(CERT *cert); + // cert_free frees all X509-related state. + void (*cert_free)(CERT *cert); + // cert_flush_cached_chain drops any cached |X509|-based certificate chain + // from |cert|. + // cert_dup duplicates any needed fields from |cert| to |new_cert|. + void (*cert_dup)(CERT *new_cert, const CERT *cert); + void (*cert_flush_cached_chain)(CERT *cert); + // cert_flush_cached_chain drops any cached |X509|-based leaf certificate + // from |cert|. + void (*cert_flush_cached_leaf)(CERT *cert); + + // session_cache_objects fills out |sess->x509_peer| and |sess->x509_chain| + // from |sess->certs| and erases |sess->x509_chain_without_leaf|. It returns + // true on success or false on error. + bool (*session_cache_objects)(SSL_SESSION *session); + // session_dup duplicates any needed fields from |session| to |new_session|. + // It returns true on success or false on error. + bool (*session_dup)(SSL_SESSION *new_session, const SSL_SESSION *session); + // session_clear frees any X509-related state from |session|. + void (*session_clear)(SSL_SESSION *session); + // session_verify_cert_chain verifies the certificate chain in |session|, + // sets |session->verify_result| and returns true on success or false on + // error. + bool (*session_verify_cert_chain)(SSL_SESSION *session, SSL_HANDSHAKE *ssl, + uint8_t *out_alert); + + // hs_flush_cached_ca_names drops any cached |X509_NAME|s from |hs|. + void (*hs_flush_cached_ca_names)(SSL_HANDSHAKE *hs); + // ssl_new does any necessary initialisation of |hs|. It returns true on + // success or false on error. + bool (*ssl_new)(SSL_HANDSHAKE *hs); + // ssl_free frees anything created by |ssl_new|. + void (*ssl_config_free)(SSL_CONFIG *cfg); + // ssl_flush_cached_client_CA drops any cached |X509_NAME|s from |ssl|. + void (*ssl_flush_cached_client_CA)(SSL_CONFIG *cfg); + // ssl_auto_chain_if_needed runs the deprecated auto-chaining logic if + // necessary. On success, it updates |ssl|'s certificate configuration as + // needed and returns true. Otherwise, it returns false. + bool (*ssl_auto_chain_if_needed)(SSL_HANDSHAKE *hs); + // ssl_ctx_new does any necessary initialisation of |ctx|. It returns true on + // success or false on error. + bool (*ssl_ctx_new)(SSL_CTX *ctx); + // ssl_ctx_free frees anything created by |ssl_ctx_new|. + void (*ssl_ctx_free)(SSL_CTX *ctx); + // ssl_ctx_flush_cached_client_CA drops any cached |X509_NAME|s from |ctx|. + void (*ssl_ctx_flush_cached_client_CA)(SSL_CTX *ssl); +}; + +// ssl_crypto_x509_method provides the |SSL_X509_METHOD| functions using +// crypto/x509. +extern const SSL_X509_METHOD ssl_crypto_x509_method; + +// ssl_noop_x509_method provides the |SSL_X509_METHOD| functions that avoid +// crypto/x509. +extern const SSL_X509_METHOD ssl_noop_x509_method; + +struct TicketKey { + static constexpr bool kAllowUniquePtr = true; + + uint8_t name[SSL_TICKET_KEY_NAME_LEN] = {0}; + uint8_t hmac_key[16] = {0}; + uint8_t aes_key[16] = {0}; + // next_rotation_tv_sec is the time (in seconds from the epoch) when the + // current key should be superseded by a new key, or the time when a previous + // key should be dropped. If zero, then the key should not be automatically + // rotated. + uint64_t next_rotation_tv_sec = 0; +}; + +struct CertCompressionAlg { + static constexpr bool kAllowUniquePtr = true; + + ssl_cert_compression_func_t compress = nullptr; + ssl_cert_decompression_func_t decompress = nullptr; + uint16_t alg_id = 0; +}; + +BSSL_NAMESPACE_END + +DEFINE_LHASH_OF(SSL_SESSION) + +BSSL_NAMESPACE_BEGIN + +// An ssl_shutdown_t describes the shutdown state of one end of the connection, +// whether it is alive or has been shutdown via close_notify or fatal alert. +enum ssl_shutdown_t { + ssl_shutdown_none = 0, + ssl_shutdown_close_notify = 1, + ssl_shutdown_error = 2, +}; + +struct SSL3_STATE { + static constexpr bool kAllowUniquePtr = true; + + SSL3_STATE(); + ~SSL3_STATE(); + + uint8_t read_sequence[8] = {0}; + uint8_t write_sequence[8] = {0}; + + uint8_t server_random[SSL3_RANDOM_SIZE] = {0}; + uint8_t client_random[SSL3_RANDOM_SIZE] = {0}; + + // read_buffer holds data from the transport to be processed. + SSLBuffer read_buffer; + // write_buffer holds data to be written to the transport. + SSLBuffer write_buffer; + + // pending_app_data is the unconsumed application data. It points into + // |read_buffer|. + Span pending_app_data; + + // partial write - check the numbers match + unsigned int wnum = 0; // number of bytes sent so far + int wpend_tot = 0; // number bytes written + int wpend_type = 0; + int wpend_ret = 0; // number of bytes submitted + const uint8_t *wpend_buf = nullptr; + + // read_shutdown is the shutdown state for the read half of the connection. + enum ssl_shutdown_t read_shutdown = ssl_shutdown_none; + + // write_shutdown is the shutdown state for the write half of the connection. + enum ssl_shutdown_t write_shutdown = ssl_shutdown_none; + + // read_error, if |read_shutdown| is |ssl_shutdown_error|, is the error for + // the receive half of the connection. + UniquePtr read_error; + + int total_renegotiations = 0; + + // This holds a variable that indicates what we were doing when a 0 or -1 is + // returned. This is needed for non-blocking IO so we know what request + // needs re-doing when in SSL_accept or SSL_connect + int rwstate = SSL_ERROR_NONE; + + enum ssl_encryption_level_t read_level = ssl_encryption_initial; + enum ssl_encryption_level_t write_level = ssl_encryption_initial; + + // early_data_skipped is the amount of early data that has been skipped by the + // record layer. + uint16_t early_data_skipped = 0; + + // empty_record_count is the number of consecutive empty records received. + uint8_t empty_record_count = 0; + + // warning_alert_count is the number of consecutive warning alerts + // received. + uint8_t warning_alert_count = 0; + + // key_update_count is the number of consecutive KeyUpdates received. + uint8_t key_update_count = 0; + + // The negotiated Token Binding key parameter. Only valid if + // |token_binding_negotiated| is set. + uint8_t negotiated_token_binding_param = 0; + + // skip_early_data instructs the record layer to skip unexpected early data + // messages when 0RTT is rejected. + bool skip_early_data : 1; + + // have_version is true if the connection's final version is known. Otherwise + // the version has not been negotiated yet. + bool have_version : 1; + + // v2_hello_done is true if the peer's V2ClientHello, if any, has been handled + // and future messages should use the record layer. + bool v2_hello_done : 1; + + // is_v2_hello is true if the current handshake message was derived from a + // V2ClientHello rather than received from the peer directly. + bool is_v2_hello : 1; + + // has_message is true if the current handshake message has been returned + // at least once by |get_message| and false otherwise. + bool has_message : 1; + + // initial_handshake_complete is true if the initial handshake has + // completed. + bool initial_handshake_complete : 1; + + // session_reused indicates whether a session was resumed. + bool session_reused : 1; + + // delegated_credential_used is whether we presented a delegated credential to + // the peer. + bool delegated_credential_used : 1; + + bool send_connection_binding : 1; + + // In a client, this means that the server supported Channel ID and that a + // Channel ID was sent. In a server it means that we echoed support for + // Channel IDs and that |channel_id| will be valid after the handshake. + bool channel_id_valid : 1; + + // key_update_pending is true if we have a KeyUpdate acknowledgment + // outstanding. + bool key_update_pending : 1; + + // wpend_pending is true if we have a pending write outstanding. + bool wpend_pending : 1; + + // early_data_accepted is true if early data was accepted by the server. + bool early_data_accepted : 1; + + // tls13_downgrade is whether the TLS 1.3 anti-downgrade logic fired. + bool tls13_downgrade : 1; + + // token_binding_negotiated is set if Token Binding was negotiated. + bool token_binding_negotiated : 1; + + // alert_dispatch is true there is an alert in |send_alert| to be sent. + bool alert_dispatch : 1; + + // renegotiate_pending is whether the read half of the channel is blocked on a + // HelloRequest. + bool renegotiate_pending : 1; + + // used_hello_retry_request is whether the handshake used a TLS 1.3 + // HelloRetryRequest message. + bool used_hello_retry_request : 1; + + // hs_buf is the buffer of handshake data to process. + UniquePtr hs_buf; + + // pending_hs_data contains the pending handshake data that has not yet + // been encrypted to |pending_flight|. This allows packing the handshake into + // fewer records. + UniquePtr pending_hs_data; + + // pending_flight is the pending outgoing flight. This is used to flush each + // handshake flight in a single write. |write_buffer| must be written out + // before this data. + UniquePtr pending_flight; + + // pending_flight_offset is the number of bytes of |pending_flight| which have + // been successfully written. + uint32_t pending_flight_offset = 0; + + // ticket_age_skew is the difference, in seconds, between the client-sent + // ticket age and the server-computed value in TLS 1.3 server connections + // which resumed a session. + int32_t ticket_age_skew = 0; + + // ssl_early_data_reason stores details on why 0-RTT was accepted or rejected. + enum ssl_early_data_reason_t early_data_reason = ssl_early_data_unknown; + + // aead_read_ctx is the current read cipher state. + UniquePtr aead_read_ctx; + + // aead_write_ctx is the current write cipher state. + UniquePtr aead_write_ctx; + + // hs is the handshake state for the current handshake or NULL if there isn't + // one. + UniquePtr hs; + + uint8_t write_traffic_secret[SSL_MAX_MD_SIZE] = {0}; + uint8_t read_traffic_secret[SSL_MAX_MD_SIZE] = {0}; + uint8_t exporter_secret[SSL_MAX_MD_SIZE] = {0}; + uint8_t write_traffic_secret_len = 0; + uint8_t read_traffic_secret_len = 0; + uint8_t exporter_secret_len = 0; + + // Connection binding to prevent renegotiation attacks + uint8_t previous_client_finished[12] = {0}; + uint8_t previous_client_finished_len = 0; + uint8_t previous_server_finished_len = 0; + uint8_t previous_server_finished[12] = {0}; + + uint8_t send_alert[2] = {0}; + + // established_session is the session established by the connection. This + // session is only filled upon the completion of the handshake and is + // immutable. + UniquePtr established_session; + + // Next protocol negotiation. For the client, this is the protocol that we + // sent in NextProtocol and is set when handling ServerHello extensions. + // + // For a server, this is the client's selected_protocol from NextProtocol and + // is set when handling the NextProtocol message, before the Finished + // message. + Array next_proto_negotiated; + + // ALPN information + // (we are in the process of transitioning from NPN to ALPN.) + + // In a server these point to the selected ALPN protocol after the + // ClientHello has been processed. In a client these contain the protocol + // that the server selected once the ServerHello has been processed. + Array alpn_selected; + + // hostname, on the server, is the value of the SNI extension. + UniquePtr hostname; + + // For a server: + // If |channel_id_valid| is true, then this contains the + // verified Channel ID from the client: a P256 point, (x,y), where + // each are big-endian values. + uint8_t channel_id[64] = {0}; + + // Contains the QUIC transport params received by the peer. + Array peer_quic_transport_params; + + // srtp_profile is the selected SRTP protection profile for + // DTLS-SRTP. + const SRTP_PROTECTION_PROFILE *srtp_profile = nullptr; +}; + +// lengths of messages +#define DTLS1_COOKIE_LENGTH 256 + +#define DTLS1_RT_HEADER_LENGTH 13 + +#define DTLS1_HM_HEADER_LENGTH 12 + +#define DTLS1_CCS_HEADER_LENGTH 1 + +#define DTLS1_AL_HEADER_LENGTH 2 + +struct hm_header_st { + uint8_t type; + uint32_t msg_len; + uint16_t seq; + uint32_t frag_off; + uint32_t frag_len; +}; + +// An hm_fragment is an incoming DTLS message, possibly not yet assembled. +struct hm_fragment { + static constexpr bool kAllowUniquePtr = true; + + hm_fragment() {} + hm_fragment(const hm_fragment &) = delete; + hm_fragment &operator=(const hm_fragment &) = delete; + + ~hm_fragment(); + + // type is the type of the message. + uint8_t type = 0; + // seq is the sequence number of this message. + uint16_t seq = 0; + // msg_len is the length of the message body. + uint32_t msg_len = 0; + // data is a pointer to the message, including message header. It has length + // |DTLS1_HM_HEADER_LENGTH| + |msg_len|. + uint8_t *data = nullptr; + // reassembly is a bitmask of |msg_len| bits corresponding to which parts of + // the message have been received. It is NULL if the message is complete. + uint8_t *reassembly = nullptr; +}; + +struct OPENSSL_timeval { + uint64_t tv_sec; + uint32_t tv_usec; +}; + +struct DTLS1_STATE { + static constexpr bool kAllowUniquePtr = true; + + DTLS1_STATE(); + ~DTLS1_STATE(); + + // has_change_cipher_spec is true if we have received a ChangeCipherSpec from + // the peer in this epoch. + bool has_change_cipher_spec : 1; + + // outgoing_messages_complete is true if |outgoing_messages| has been + // completed by an attempt to flush it. Future calls to |add_message| and + // |add_change_cipher_spec| will start a new flight. + bool outgoing_messages_complete : 1; + + // flight_has_reply is true if the current outgoing flight is complete and has + // processed at least one message. This is used to detect whether we or the + // peer sent the final flight. + bool flight_has_reply : 1; + + uint8_t cookie[DTLS1_COOKIE_LENGTH] = {0}; + size_t cookie_len = 0; + + // The current data and handshake epoch. This is initially undefined, and + // starts at zero once the initial handshake is completed. + uint16_t r_epoch = 0; + uint16_t w_epoch = 0; + + // records being received in the current epoch + DTLS1_BITMAP bitmap; + + uint16_t handshake_write_seq = 0; + uint16_t handshake_read_seq = 0; + + // save last sequence number for retransmissions + uint8_t last_write_sequence[8] = {0}; + UniquePtr last_aead_write_ctx; + + // incoming_messages is a ring buffer of incoming handshake messages that have + // yet to be processed. The front of the ring buffer is message number + // |handshake_read_seq|, at position |handshake_read_seq| % + // |SSL_MAX_HANDSHAKE_FLIGHT|. + UniquePtr incoming_messages[SSL_MAX_HANDSHAKE_FLIGHT]; + + // outgoing_messages is the queue of outgoing messages from the last handshake + // flight. + DTLS_OUTGOING_MESSAGE outgoing_messages[SSL_MAX_HANDSHAKE_FLIGHT]; + uint8_t outgoing_messages_len = 0; + + // outgoing_written is the number of outgoing messages that have been + // written. + uint8_t outgoing_written = 0; + // outgoing_offset is the number of bytes of the next outgoing message have + // been written. + uint32_t outgoing_offset = 0; + + unsigned mtu = 0; // max DTLS packet size + + // num_timeouts is the number of times the retransmit timer has fired since + // the last time it was reset. + unsigned num_timeouts = 0; + + // Indicates when the last handshake msg or heartbeat sent will + // timeout. + struct OPENSSL_timeval next_timeout = {0, 0}; + + // timeout_duration_ms is the timeout duration in milliseconds. + unsigned timeout_duration_ms = 0; +}; + +// SSL_CONFIG contains configuration bits that can be shed after the handshake +// completes. Objects of this type are not shared; they are unique to a +// particular |SSL|. +// +// See SSL_shed_handshake_config() for more about the conditions under which +// configuration can be shed. +struct SSL_CONFIG { + static constexpr bool kAllowUniquePtr = true; + + explicit SSL_CONFIG(SSL *ssl_arg); + ~SSL_CONFIG(); + + // ssl is a non-owning pointer to the parent |SSL| object. + SSL *const ssl = nullptr; + + // conf_max_version is the maximum acceptable version configured by + // |SSL_set_max_proto_version|. Note this version is not normalized in DTLS + // and is further constrained by |SSL_OP_NO_*|. + uint16_t conf_max_version = 0; + + // conf_min_version is the minimum acceptable version configured by + // |SSL_set_min_proto_version|. Note this version is not normalized in DTLS + // and is further constrained by |SSL_OP_NO_*|. + uint16_t conf_min_version = 0; + + X509_VERIFY_PARAM *param = nullptr; + + // crypto + UniquePtr cipher_list; + + // This is used to hold the local certificate used (i.e. the server + // certificate for a server or the client certificate for a client). + UniquePtr cert; + + int (*verify_callback)(int ok, + X509_STORE_CTX *ctx) = + nullptr; // fail if callback returns 0 + + enum ssl_verify_result_t (*custom_verify_callback)( + SSL *ssl, uint8_t *out_alert) = nullptr; + // Server-only: psk_identity_hint is the identity hint to send in + // PSK-based key exchanges. + UniquePtr psk_identity_hint; + + unsigned (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len) = nullptr; + unsigned (*psk_server_callback)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len) = nullptr; + + // for server side, keep the list of CA_dn we can use + UniquePtr client_CA; + + // cached_x509_client_CA is a cache of parsed versions of the elements of + // |client_CA|. + STACK_OF(X509_NAME) *cached_x509_client_CA = nullptr; + + Array supported_group_list; // our list + + // The client's Channel ID private key. + UniquePtr channel_id_private; + + // For a client, this contains the list of supported protocols in wire + // format. + Array alpn_client_proto_list; + + // Contains a list of supported Token Binding key parameters. + Array token_binding_params; + + // Contains the QUIC transport params that this endpoint will send. + Array quic_transport_params; + + // verify_sigalgs, if not empty, is the set of signature algorithms + // accepted from the peer in decreasing order of preference. + Array verify_sigalgs; + + // srtp_profiles is the list of configured SRTP protection profiles for + // DTLS-SRTP. + UniquePtr srtp_profiles; + + // verify_mode is a bitmask of |SSL_VERIFY_*| values. + uint8_t verify_mode = SSL_VERIFY_NONE; + + // Enable signed certificate time stamps. Currently client only. + bool signed_cert_timestamps_enabled : 1; + + // ocsp_stapling_enabled is only used by client connections and indicates + // whether OCSP stapling will be requested. + bool ocsp_stapling_enabled : 1; + + // channel_id_enabled is copied from the |SSL_CTX|. For a server, means that + // we'll accept Channel IDs from clients. For a client, means that we'll + // advertise support. + bool channel_id_enabled : 1; + + // If enforce_rsa_key_usage is true, the handshake will fail if the + // keyUsage extension is present and incompatible with the TLS usage. + // This field is not read until after certificate verification. + bool enforce_rsa_key_usage : 1; + + // retain_only_sha256_of_client_certs is true if we should compute the SHA256 + // hash of the peer's certificate and then discard it to save memory and + // session space. Only effective on the server side. + bool retain_only_sha256_of_client_certs : 1; + + // handoff indicates that a server should stop after receiving the + // ClientHello and pause the handshake in such a way that |SSL_get_error| + // returns |SSL_ERROR_HANDOFF|. This is copied in |SSL_new| from the |SSL_CTX| + // element of the same name and may be cleared if the handoff is declined. + bool handoff : 1; + + // shed_handshake_config indicates that the handshake config (this object!) + // should be freed after the handshake completes. + bool shed_handshake_config : 1; + + // ignore_tls13_downgrade is whether the connection should continue when the + // server random signals a downgrade. + bool ignore_tls13_downgrade : 1; + + // jdk11_workaround is whether to disable TLS 1.3 for JDK 11 clients, as a + // workaround for https://bugs.openjdk.java.net/browse/JDK-8211806. + bool jdk11_workaround : 1; +}; + +// From RFC 8446, used in determining PSK modes. +#define SSL_PSK_DHE_KE 0x1 + +// kMaxEarlyDataAccepted is the advertised number of plaintext bytes of early +// data that will be accepted. This value should be slightly below +// kMaxEarlyDataSkipped in tls_record.c, which is measured in ciphertext. +static const size_t kMaxEarlyDataAccepted = 14336; + +UniquePtr ssl_cert_dup(CERT *cert); +void ssl_cert_clear_certs(CERT *cert); +bool ssl_set_cert(CERT *cert, UniquePtr buffer); +bool ssl_is_key_type_supported(int key_type); +// ssl_compare_public_and_private_key returns true if |pubkey| is the public +// counterpart to |privkey|. Otherwise it returns false and pushes a helpful +// message on the error queue. +bool ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, + const EVP_PKEY *privkey); +bool ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey); +int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server); +int ssl_encrypt_ticket(SSL_HANDSHAKE *hs, CBB *out, const SSL_SESSION *session); +int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx); + +// ssl_session_new returns a newly-allocated blank |SSL_SESSION| or nullptr on +// error. +UniquePtr ssl_session_new(const SSL_X509_METHOD *x509_method); + +// ssl_hash_session_id returns a hash of |session_id|, suitable for a hash table +// keyed on session IDs. +uint32_t ssl_hash_session_id(Span session_id); + +// SSL_SESSION_parse parses an |SSL_SESSION| from |cbs| and advances |cbs| over +// the parsed data. +OPENSSL_EXPORT UniquePtr SSL_SESSION_parse( + CBS *cbs, const SSL_X509_METHOD *x509_method, CRYPTO_BUFFER_POOL *pool); + +// ssl_session_serialize writes |in| to |cbb| as if it were serialising a +// session for Session-ID resumption. It returns one on success and zero on +// error. +OPENSSL_EXPORT int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb); + +// ssl_session_is_context_valid returns one if |session|'s session ID context +// matches the one set on |hs| and zero otherwise. +int ssl_session_is_context_valid(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session); + +// ssl_session_is_time_valid returns one if |session| is still valid and zero if +// it has expired. +int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session); + +// ssl_session_is_resumable returns one if |session| is resumable for |hs| and +// zero otherwise. +int ssl_session_is_resumable(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session); + +// ssl_session_protocol_version returns the protocol version associated with +// |session|. Note that despite the name, this is not the same as +// |SSL_SESSION_get_protocol_version|. The latter is based on upstream's name. +uint16_t ssl_session_protocol_version(const SSL_SESSION *session); + +// ssl_session_get_digest returns the digest used in |session|. +const EVP_MD *ssl_session_get_digest(const SSL_SESSION *session); + +void ssl_set_session(SSL *ssl, SSL_SESSION *session); + +// ssl_get_prev_session looks up the previous session based on |client_hello|. +// On success, it sets |*out_session| to the session or nullptr if none was +// found. If the session could not be looked up synchronously, it returns +// |ssl_hs_pending_session| and should be called again. If a ticket could not be +// decrypted immediately it returns |ssl_hs_pending_ticket| and should also +// be called again. Otherwise, it returns |ssl_hs_error|. +enum ssl_hs_wait_t ssl_get_prev_session(SSL_HANDSHAKE *hs, + UniquePtr *out_session, + bool *out_tickets_supported, + bool *out_renew_ticket, + const SSL_CLIENT_HELLO *client_hello); + +// The following flags determine which parts of the session are duplicated. +#define SSL_SESSION_DUP_AUTH_ONLY 0x0 +#define SSL_SESSION_INCLUDE_TICKET 0x1 +#define SSL_SESSION_INCLUDE_NONAUTH 0x2 +#define SSL_SESSION_DUP_ALL \ + (SSL_SESSION_INCLUDE_TICKET | SSL_SESSION_INCLUDE_NONAUTH) + +// SSL_SESSION_dup returns a newly-allocated |SSL_SESSION| with a copy of the +// fields in |session| or nullptr on error. The new session is non-resumable and +// must be explicitly marked resumable once it has been filled in. +OPENSSL_EXPORT UniquePtr SSL_SESSION_dup(SSL_SESSION *session, + int dup_flags); + +// ssl_session_rebase_time updates |session|'s start time to the current time, +// adjusting the timeout so the expiration time is unchanged. +void ssl_session_rebase_time(SSL *ssl, SSL_SESSION *session); + +// ssl_session_renew_timeout calls |ssl_session_rebase_time| and renews +// |session|'s timeout to |timeout| (measured from the current time). The +// renewal is clamped to the session's auth_timeout. +void ssl_session_renew_timeout(SSL *ssl, SSL_SESSION *session, + uint32_t timeout); + +void ssl_update_cache(SSL_HANDSHAKE *hs, int mode); + +void ssl_send_alert(SSL *ssl, int level, int desc); +int ssl_send_alert_impl(SSL *ssl, int level, int desc); +bool ssl3_get_message(const SSL *ssl, SSLMessage *out); +ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); +void ssl3_next_message(SSL *ssl); + +int ssl3_dispatch_alert(SSL *ssl); +ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); +ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); +int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, + int len); + +bool ssl3_new(SSL *ssl); +void ssl3_free(SSL *ssl); + +bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); +bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); +bool ssl3_add_message(SSL *ssl, Array msg); +bool ssl3_add_change_cipher_spec(SSL *ssl); +int ssl3_flush_flight(SSL *ssl); + +bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); +bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); +bool dtls1_add_message(SSL *ssl, Array msg); +bool dtls1_add_change_cipher_spec(SSL *ssl); +int dtls1_flush_flight(SSL *ssl); + +// ssl_add_message_cbb finishes the handshake message in |cbb| and adds it to +// the pending flight. It returns true on success and false on error. +bool ssl_add_message_cbb(SSL *ssl, CBB *cbb); + +// ssl_hash_message incorporates |msg| into the handshake hash. It returns true +// on success and false on allocation failure. +bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg); + +ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); +ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); + +int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake, + const uint8_t *buf, int len); + +// dtls1_write_record sends a record. It returns one on success and <= 0 on +// error. +int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len, + enum dtls1_use_epoch_t use_epoch); + +int dtls1_retransmit_outgoing_messages(SSL *ssl); +bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, + CBS *out_body); +bool dtls1_check_timeout_num(SSL *ssl); + +void dtls1_start_timer(SSL *ssl); +void dtls1_stop_timer(SSL *ssl); +bool dtls1_is_timer_expired(SSL *ssl); +unsigned int dtls1_min_mtu(void); + +bool dtls1_new(SSL *ssl); +void dtls1_free(SSL *ssl); + +bool dtls1_get_message(const SSL *ssl, SSLMessage *out); +ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); +void dtls1_next_message(SSL *ssl); +int dtls1_dispatch_alert(SSL *ssl); + +// tls1_configure_aead configures either the read or write direction AEAD (as +// determined by |direction|) using the keys generated by the TLS KDF. The +// |key_block_cache| argument is used to store the generated key block, if +// empty. Otherwise it's assumed that the key block is already contained within +// it. Returns one on success or zero on error. +int tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction, + Array *key_block_cache, + const SSL_CIPHER *cipher, + Span iv_override); + +int tls1_change_cipher_state(SSL_HANDSHAKE *hs, evp_aead_direction_t direction); +int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, + Span premaster); + +// tls1_get_grouplist returns the locally-configured group preference list. +Span tls1_get_grouplist(const SSL_HANDSHAKE *ssl); + +// tls1_check_group_id returns whether |group_id| is consistent with locally- +// configured group preferences. +bool tls1_check_group_id(const SSL_HANDSHAKE *ssl, uint16_t group_id); + +// tls1_get_shared_group sets |*out_group_id| to the first preferred shared +// group between client and server preferences and returns true. If none may be +// found, it returns false. +bool tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id); + +// tls1_set_curves converts the array of NIDs in |curves| into a newly allocated +// array of TLS group IDs. On success, the function returns true and writes the +// array to |*out_group_ids|. Otherwise, it returns false. +bool tls1_set_curves(Array *out_group_ids, Span curves); + +// tls1_set_curves_list converts the string of curves pointed to by |curves| +// into a newly allocated array of TLS group IDs. On success, the function +// returns true and writes the array to |*out_group_ids|. Otherwise, it returns +// false. +bool tls1_set_curves_list(Array *out_group_ids, const char *curves); + +// ssl_add_clienthello_tlsext writes ClientHello extensions to |out|. It returns +// true on success and false on failure. The |header_len| argument is the length +// of the ClientHello written so far and is used to compute the padding length. +// (It does not include the record header.) +bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len); + +bool ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out); +bool ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, + const SSL_CLIENT_HELLO *client_hello); +bool ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs); + +#define tlsext_tick_md EVP_sha256 + +// ssl_process_ticket processes a session ticket from the client. It returns +// one of: +// |ssl_ticket_aead_success|: |*out_session| is set to the parsed session and +// |*out_renew_ticket| is set to whether the ticket should be renewed. +// |ssl_ticket_aead_ignore_ticket|: |*out_renew_ticket| is set to whether a +// fresh ticket should be sent, but the given ticket cannot be used. +// |ssl_ticket_aead_retry|: the ticket could not be immediately decrypted. +// Retry later. +// |ssl_ticket_aead_error|: an error occured that is fatal to the connection. +enum ssl_ticket_aead_result_t ssl_process_ticket( + SSL_HANDSHAKE *hs, UniquePtr *out_session, + bool *out_renew_ticket, Span ticket, + Span session_id); + +// tls1_verify_channel_id processes |msg| as a Channel ID message, and verifies +// the signature. If the key is valid, it saves the Channel ID and returns true. +// Otherwise, it returns false. +bool tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg); + +// tls1_write_channel_id generates a Channel ID message and puts the output in +// |cbb|. |ssl->channel_id_private| must already be set before calling. This +// function returns true on success and false on error. +bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb); + +// tls1_channel_id_hash computes the hash to be signed by Channel ID and writes +// it to |out|, which must contain at least |EVP_MAX_MD_SIZE| bytes. It returns +// true on success and false on failure. +bool tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len); + +// tls1_record_handshake_hashes_for_channel_id records the current handshake +// hashes in |hs->new_session| so that Channel ID resumptions can sign that +// data. +bool tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs); + +// ssl_do_channel_id_callback checks runs |hs->ssl->ctx->channel_id_cb| if +// necessary. It returns true on success and false on fatal error. Note that, on +// success, |hs->ssl->channel_id_private| may be unset, in which case the +// operation should be retried later. +bool ssl_do_channel_id_callback(SSL_HANDSHAKE *hs); + +// ssl_can_write returns whether |ssl| is allowed to write. +bool ssl_can_write(const SSL *ssl); + +// ssl_can_read returns wheter |ssl| is allowed to read. +bool ssl_can_read(const SSL *ssl); + +void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock); +void ssl_ctx_get_current_time(const SSL_CTX *ctx, + struct OPENSSL_timeval *out_clock); + +// ssl_reset_error_state resets state for |SSL_get_error|. +void ssl_reset_error_state(SSL *ssl); + +// ssl_set_read_error sets |ssl|'s read half into an error state, saving the +// current state of the error queue. +void ssl_set_read_error(SSL *ssl); + +BSSL_NAMESPACE_END + + +// Opaque C types. +// +// The following types are exported to C code as public typedefs, so they must +// be defined outside of the namespace. + +// ssl_method_st backs the public |SSL_METHOD| type. It is a compatibility +// structure to support the legacy version-locked methods. +struct ssl_method_st { + // version, if non-zero, is the only protocol version acceptable to an + // SSL_CTX initialized from this method. + uint16_t version; + // method is the underlying SSL_PROTOCOL_METHOD that initializes the + // SSL_CTX. + const bssl::SSL_PROTOCOL_METHOD *method; + // x509_method contains pointers to functions that might deal with |X509| + // compatibility, or might be a no-op, depending on the application. + const bssl::SSL_X509_METHOD *x509_method; +}; + +struct ssl_ctx_st { + explicit ssl_ctx_st(const SSL_METHOD *ssl_method); + ssl_ctx_st(const ssl_ctx_st &) = delete; + ssl_ctx_st &operator=(const ssl_ctx_st &) = delete; + + const bssl::SSL_PROTOCOL_METHOD *method = nullptr; + const bssl::SSL_X509_METHOD *x509_method = nullptr; + + // lock is used to protect various operations on this object. + CRYPTO_MUTEX lock; + + // conf_max_version is the maximum acceptable protocol version configured by + // |SSL_CTX_set_max_proto_version|. Note this version is normalized in DTLS + // and is further constrainted by |SSL_OP_NO_*|. + uint16_t conf_max_version = 0; + + // conf_min_version is the minimum acceptable protocol version configured by + // |SSL_CTX_set_min_proto_version|. Note this version is normalized in DTLS + // and is further constrainted by |SSL_OP_NO_*|. + uint16_t conf_min_version = 0; + + // quic_method is the method table corresponding to the QUIC hooks. + const SSL_QUIC_METHOD *quic_method = nullptr; + + bssl::UniquePtr cipher_list; + + X509_STORE *cert_store = nullptr; + LHASH_OF(SSL_SESSION) *sessions = nullptr; + // Most session-ids that will be cached, default is + // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. + unsigned long session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT; + SSL_SESSION *session_cache_head = nullptr; + SSL_SESSION *session_cache_tail = nullptr; + + // handshakes_since_cache_flush is the number of successful handshakes since + // the last cache flush. + int handshakes_since_cache_flush = 0; + + // This can have one of 2 values, ored together, + // SSL_SESS_CACHE_CLIENT, + // SSL_SESS_CACHE_SERVER, + // Default is SSL_SESSION_CACHE_SERVER, which means only + // SSL_accept which cache SSL_SESSIONS. + int session_cache_mode = SSL_SESS_CACHE_SERVER; + + // session_timeout is the default lifetime for new sessions in TLS 1.2 and + // earlier, in seconds. + uint32_t session_timeout = SSL_DEFAULT_SESSION_TIMEOUT; + + // session_psk_dhe_timeout is the default lifetime for new sessions in TLS + // 1.3, in seconds. + uint32_t session_psk_dhe_timeout = SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT; + + // If this callback is not null, it will be called each time a session id is + // added to the cache. If this function returns 1, it means that the + // callback will do a SSL_SESSION_free() when it has finished using it. + // Otherwise, on 0, it means the callback has finished with it. If + // remove_session_cb is not null, it will be called when a session-id is + // removed from the cache. After the call, OpenSSL will SSL_SESSION_free() + // it. + int (*new_session_cb)(SSL *ssl, SSL_SESSION *sess) = nullptr; + void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess) = nullptr; + SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, + int *copy) = nullptr; + + CRYPTO_refcount_t references = 1; + + // if defined, these override the X509_verify_cert() calls + int (*app_verify_callback)(X509_STORE_CTX *store_ctx, void *arg) = nullptr; + void *app_verify_arg = nullptr; + + ssl_verify_result_t (*custom_verify_callback)(SSL *ssl, + uint8_t *out_alert) = nullptr; + + // Default password callback. + pem_password_cb *default_passwd_callback = nullptr; + + // Default password callback user data. + void *default_passwd_callback_userdata = nullptr; + + // get client cert callback + int (*client_cert_cb)(SSL *ssl, X509 **out_x509, + EVP_PKEY **out_pkey) = nullptr; + + // get channel id callback + void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey) = nullptr; + + CRYPTO_EX_DATA ex_data; + + // Default values used when no per-SSL value is defined follow + + void (*info_callback)(const SSL *ssl, int type, int value) = nullptr; + + // what we put in client cert requests + bssl::UniquePtr client_CA; + + // cached_x509_client_CA is a cache of parsed versions of the elements of + // |client_CA|. + STACK_OF(X509_NAME) *cached_x509_client_CA = nullptr; + + + // Default values to use in SSL structures follow (these are copied by + // SSL_new) + + uint32_t options = 0; + // Disable the auto-chaining feature by default. wpa_supplicant relies on this + // feature, but require callers opt into it. + uint32_t mode = SSL_MODE_NO_AUTO_CHAIN; + uint32_t max_cert_list = SSL_MAX_CERT_LIST_DEFAULT; + + bssl::UniquePtr cert; + + // callback that allows applications to peek at protocol messages + void (*msg_callback)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, + void *arg) = nullptr; + void *msg_callback_arg = nullptr; + + int verify_mode = SSL_VERIFY_NONE; + int (*default_verify_callback)(int ok, X509_STORE_CTX *ctx) = + nullptr; // called 'verify_callback' in the SSL + + X509_VERIFY_PARAM *param = nullptr; + + // select_certificate_cb is called before most ClientHello processing and + // before the decision whether to resume a session is made. See + // |ssl_select_cert_result_t| for details of the return values. + ssl_select_cert_result_t (*select_certificate_cb)(const SSL_CLIENT_HELLO *) = + nullptr; + + // dos_protection_cb is called once the resumption decision for a ClientHello + // has been made. It returns one to continue the handshake or zero to + // abort. + int (*dos_protection_cb)(const SSL_CLIENT_HELLO *) = nullptr; + + // Controls whether to verify certificates when resuming connections. They + // were already verified when the connection was first made, so the default is + // false. For now, this is only respected on clients, not servers. + bool reverify_on_resume = false; + + // Maximum amount of data to send in one fragment. actual record size can be + // more than this due to padding and MAC overheads. + uint16_t max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; + + // TLS extensions servername callback + int (*servername_callback)(SSL *, int *, void *) = nullptr; + void *servername_arg = nullptr; + + // RFC 4507 session ticket keys. |ticket_key_current| may be NULL before the + // first handshake and |ticket_key_prev| may be NULL at any time. + // Automatically generated ticket keys are rotated as needed at handshake + // time. Hence, all access must be synchronized through |lock|. + bssl::UniquePtr ticket_key_current; + bssl::UniquePtr ticket_key_prev; + + // Callback to support customisation of ticket key setting + int (*ticket_key_cb)(SSL *ssl, uint8_t *name, uint8_t *iv, + EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc) = nullptr; + + // Server-only: psk_identity_hint is the default identity hint to send in + // PSK-based key exchanges. + bssl::UniquePtr psk_identity_hint; + + unsigned (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len) = nullptr; + unsigned (*psk_server_callback)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len) = nullptr; + + + // Next protocol negotiation information + // (for experimental NPN extension). + + // For a server, this contains a callback function by which the set of + // advertised protocols can be provided. + int (*next_protos_advertised_cb)(SSL *ssl, const uint8_t **out, + unsigned *out_len, void *arg) = nullptr; + void *next_protos_advertised_cb_arg = nullptr; + // For a client, this contains a callback function that selects the + // next protocol from the list provided by the server. + int (*next_proto_select_cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, + void *arg) = nullptr; + void *next_proto_select_cb_arg = nullptr; + + // ALPN information + // (we are in the process of transitioning from NPN to ALPN.) + + // For a server, this contains a callback function that allows the + // server to select the protocol for the connection. + // out: on successful return, this must point to the raw protocol + // name (without the length prefix). + // outlen: on successful return, this contains the length of |*out|. + // in: points to the client's list of supported protocols in + // wire-format. + // inlen: the length of |in|. + int (*alpn_select_cb)(SSL *ssl, const uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, + void *arg) = nullptr; + void *alpn_select_cb_arg = nullptr; + + // For a client, this contains the list of supported protocols in wire + // format. + bssl::Array alpn_client_proto_list; + + // SRTP profiles we are willing to do from RFC 5764 + bssl::UniquePtr srtp_profiles; + + // Defined compression algorithms for certificates. + bssl::GrowableArray cert_compression_algs; + + // Supported group values inherited by SSL structure + bssl::Array supported_group_list; + + // The client's Channel ID private key. + bssl::UniquePtr channel_id_private; + + // keylog_callback, if not NULL, is the key logging callback. See + // |SSL_CTX_set_keylog_callback|. + void (*keylog_callback)(const SSL *ssl, const char *line) = nullptr; + + // current_time_cb, if not NULL, is the function to use to get the current + // time. It sets |*out_clock| to the current time. The |ssl| argument is + // always NULL. See |SSL_CTX_set_current_time_cb|. + void (*current_time_cb)(const SSL *ssl, struct timeval *out_clock) = nullptr; + + // pool is used for all |CRYPTO_BUFFER|s in case we wish to share certificate + // memory. + CRYPTO_BUFFER_POOL *pool = nullptr; + + // ticket_aead_method contains function pointers for opening and sealing + // session tickets. + const SSL_TICKET_AEAD_METHOD *ticket_aead_method = nullptr; + + // legacy_ocsp_callback implements an OCSP-related callback for OpenSSL + // compatibility. + int (*legacy_ocsp_callback)(SSL *ssl, void *arg) = nullptr; + void *legacy_ocsp_callback_arg = nullptr; + + // verify_sigalgs, if not empty, is the set of signature algorithms + // accepted from the peer in decreasing order of preference. + bssl::Array verify_sigalgs; + + // retain_only_sha256_of_client_certs is true if we should compute the SHA256 + // hash of the peer's certificate and then discard it to save memory and + // session space. Only effective on the server side. + bool retain_only_sha256_of_client_certs : 1; + + // quiet_shutdown is true if the connection should not send a close_notify on + // shutdown. + bool quiet_shutdown : 1; + + // ocsp_stapling_enabled is only used by client connections and indicates + // whether OCSP stapling will be requested. + bool ocsp_stapling_enabled : 1; + + // If true, a client will request certificate timestamps. + bool signed_cert_timestamps_enabled : 1; + + // channel_id_enabled is whether Channel ID is enabled. For a server, means + // that we'll accept Channel IDs from clients. For a client, means that we'll + // advertise support. + bool channel_id_enabled : 1; + + // grease_enabled is whether draft-davidben-tls-grease-01 is enabled. + bool grease_enabled : 1; + + // allow_unknown_alpn_protos is whether the client allows unsolicited ALPN + // protocols from the peer. + bool allow_unknown_alpn_protos : 1; + + // ed25519_enabled is whether Ed25519 is advertised in the handshake. + bool ed25519_enabled : 1; + + // false_start_allowed_without_alpn is whether False Start (if + // |SSL_MODE_ENABLE_FALSE_START| is enabled) is allowed without ALPN. + bool false_start_allowed_without_alpn : 1; + + // ignore_tls13_downgrade is whether a connection should continue when the + // server random signals a downgrade. + bool ignore_tls13_downgrade:1; + + // handoff indicates that a server should stop after receiving the + // ClientHello and pause the handshake in such a way that |SSL_get_error| + // returns |SSL_ERROR_HANDOFF|. + bool handoff : 1; + + // If enable_early_data is true, early data can be sent and accepted. + bool enable_early_data : 1; + + private: + ~ssl_ctx_st(); + friend void SSL_CTX_free(SSL_CTX *); +}; + +struct ssl_st { + explicit ssl_st(SSL_CTX *ctx_arg); + ssl_st(const ssl_st &) = delete; + ssl_st &operator=(const ssl_st &) = delete; + ~ssl_st(); + + // method is the method table corresponding to the current protocol (DTLS or + // TLS). + const bssl::SSL_PROTOCOL_METHOD *method = nullptr; + + // config is a container for handshake configuration. Accesses to this field + // should check for nullptr, since configuration may be shed after the + // handshake completes. (If you have the |SSL_HANDSHAKE| object at hand, use + // that instead, and skip the null check.) + bssl::UniquePtr config; + + // version is the protocol version. + uint16_t version = 0; + + uint16_t max_send_fragment = 0; + + // There are 2 BIO's even though they are normally both the same. This is so + // data can be read and written to different handlers + + bssl::UniquePtr rbio; // used by SSL_read + bssl::UniquePtr wbio; // used by SSL_write + + // do_handshake runs the handshake. On completion, it returns |ssl_hs_ok|. + // Otherwise, it returns a value corresponding to what operation is needed to + // progress. + bssl::ssl_hs_wait_t (*do_handshake)(bssl::SSL_HANDSHAKE *hs) = nullptr; + + bssl::SSL3_STATE *s3 = nullptr; // TLS variables + bssl::DTLS1_STATE *d1 = nullptr; // DTLS variables + + // callback that allows applications to peek at protocol messages + void (*msg_callback)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, + void *arg) = nullptr; + void *msg_callback_arg = nullptr; + + // session info + + // initial_timeout_duration_ms is the default DTLS timeout duration in + // milliseconds. It's used to initialize the timer any time it's restarted. + // + // RFC 6347 states that implementations SHOULD use an initial timer value of 1 + // second. + unsigned initial_timeout_duration_ms = 1000; + + // session is the configured session to be offered by the client. This session + // is immutable. + bssl::UniquePtr session; + + void (*info_callback)(const SSL *ssl, int type, int value) = nullptr; + + bssl::UniquePtr ctx; + + // session_ctx is the |SSL_CTX| used for the session cache and related + // settings. + bssl::UniquePtr session_ctx; + + // extra application data + CRYPTO_EX_DATA ex_data; + + uint32_t options = 0; // protocol behaviour + uint32_t mode = 0; // API behaviour + uint32_t max_cert_list = 0; + bssl::UniquePtr hostname; + + // quic_method is the method table corresponding to the QUIC hooks. + const SSL_QUIC_METHOD *quic_method = nullptr; + + // renegotiate_mode controls how peer renegotiation attempts are handled. + ssl_renegotiate_mode_t renegotiate_mode = ssl_renegotiate_never; + + // server is true iff the this SSL* is the server half. Note: before the SSL* + // is initialized by either SSL_set_accept_state or SSL_set_connect_state, + // the side is not determined. In this state, server is always false. + bool server : 1; + + // quiet_shutdown is true if the connection should not send a close_notify on + // shutdown. + bool quiet_shutdown : 1; + + // If enable_early_data is true, early data can be sent and accepted. + bool enable_early_data : 1; +}; + +struct ssl_session_st { + explicit ssl_session_st(const bssl::SSL_X509_METHOD *method); + ssl_session_st(const ssl_session_st &) = delete; + ssl_session_st &operator=(const ssl_session_st &) = delete; + + CRYPTO_refcount_t references = 1; + + // ssl_version is the (D)TLS version that established the session. + uint16_t ssl_version = 0; + + // group_id is the ID of the ECDH group used to establish this session or zero + // if not applicable or unknown. + uint16_t group_id = 0; + + // peer_signature_algorithm is the signature algorithm used to authenticate + // the peer, or zero if not applicable or unknown. + uint16_t peer_signature_algorithm = 0; + + // master_key, in TLS 1.2 and below, is the master secret associated with the + // session. In TLS 1.3 and up, it is the resumption secret. + int master_key_length = 0; + uint8_t master_key[SSL_MAX_MASTER_KEY_LENGTH] = {0}; + + // session_id - valid? + unsigned session_id_length = 0; + uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH] = {0}; + // this is used to determine whether the session is being reused in + // the appropriate context. It is up to the application to set this, + // via SSL_new + uint8_t sid_ctx_length = 0; + uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH] = {0}; + + bssl::UniquePtr psk_identity; + + // certs contains the certificate chain from the peer, starting with the leaf + // certificate. + bssl::UniquePtr certs; + + const bssl::SSL_X509_METHOD *x509_method = nullptr; + + // x509_peer is the peer's certificate. + X509 *x509_peer = nullptr; + + // x509_chain is the certificate chain sent by the peer. NOTE: for historical + // reasons, when a client (so the peer is a server), the chain includes + // |peer|, but when a server it does not. + STACK_OF(X509) *x509_chain = nullptr; + + // x509_chain_without_leaf is a lazily constructed copy of |x509_chain| that + // omits the leaf certificate. This exists because OpenSSL, historically, + // didn't include the leaf certificate in the chain for a server, but did for + // a client. The |x509_chain| always includes it and, if an API call requires + // a chain without, it is stored here. + STACK_OF(X509) *x509_chain_without_leaf = nullptr; + + // verify_result is the result of certificate verification in the case of + // non-fatal certificate errors. + long verify_result = X509_V_ERR_INVALID_CALL; + + // timeout is the lifetime of the session in seconds, measured from |time|. + // This is renewable up to |auth_timeout|. + uint32_t timeout = SSL_DEFAULT_SESSION_TIMEOUT; + + // auth_timeout is the non-renewable lifetime of the session in seconds, + // measured from |time|. + uint32_t auth_timeout = SSL_DEFAULT_SESSION_TIMEOUT; + + // time is the time the session was issued, measured in seconds from the UNIX + // epoch. + uint64_t time = 0; + + const SSL_CIPHER *cipher = nullptr; + + CRYPTO_EX_DATA ex_data; // application specific data + + // These are used to make removal of session-ids more efficient and to + // implement a maximum cache size. + SSL_SESSION *prev = nullptr, *next = nullptr; + + bssl::Array ticket; + + bssl::UniquePtr signed_cert_timestamp_list; + + // The OCSP response that came with the session. + bssl::UniquePtr ocsp_response; + + // peer_sha256 contains the SHA-256 hash of the peer's certificate if + // |peer_sha256_valid| is true. + uint8_t peer_sha256[SHA256_DIGEST_LENGTH] = {0}; + + // original_handshake_hash contains the handshake hash (either SHA-1+MD5 or + // SHA-2, depending on TLS version) for the original, full handshake that + // created a session. This is used by Channel IDs during resumption. + uint8_t original_handshake_hash[EVP_MAX_MD_SIZE] = {0}; + uint8_t original_handshake_hash_len = 0; + + uint32_t ticket_lifetime_hint = 0; // Session lifetime hint in seconds + + uint32_t ticket_age_add = 0; + + // ticket_max_early_data is the maximum amount of data allowed to be sent as + // early data. If zero, 0-RTT is disallowed. + uint32_t ticket_max_early_data = 0; + + // early_alpn is the ALPN protocol from the initial handshake. This is only + // stored for TLS 1.3 and above in order to enforce ALPN matching for 0-RTT + // resumptions. + bssl::Array early_alpn; + + // extended_master_secret is whether the master secret in this session was + // generated using EMS and thus isn't vulnerable to the Triple Handshake + // attack. + bool extended_master_secret : 1; + + // peer_sha256_valid is whether |peer_sha256| is valid. + bool peer_sha256_valid : 1; // Non-zero if peer_sha256 is valid + + // not_resumable is used to indicate that session resumption is disallowed. + bool not_resumable : 1; + + // ticket_age_add_valid is whether |ticket_age_add| is valid. + bool ticket_age_add_valid : 1; + + // is_server is whether this session was created by a server. + bool is_server : 1; + + private: + ~ssl_session_st(); + friend void SSL_SESSION_free(SSL_SESSION *); +}; + + +#endif // OPENSSL_HEADER_SSL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/src/ssl/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/internal.h.grpc_back new file mode 100644 index 000000000..bf4dd2f05 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/internal.h.grpc_back @@ -0,0 +1,3555 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. + */ + +#ifndef OPENSSL_HEADER_SSL_INTERNAL_H +#define OPENSSL_HEADER_SSL_INTERNAL_H + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/err/internal.h" +#include "../crypto/internal.h" + + +#if defined(OPENSSL_WINDOWS) +// Windows defines struct timeval in winsock2.h. +OPENSSL_MSVC_PRAGMA(warning(push, 3)) +#include +OPENSSL_MSVC_PRAGMA(warning(pop)) +#else +#include +#endif + + +BSSL_NAMESPACE_BEGIN + +struct SSL_CONFIG; +struct SSL_HANDSHAKE; +struct SSL_PROTOCOL_METHOD; +struct SSL_X509_METHOD; + +// C++ utilities. + +// New behaves like |new| but uses |OPENSSL_malloc| for memory allocation. It +// returns nullptr on allocation error. It only implements single-object +// allocation and not new T[n]. +// +// Note: unlike |new|, this does not support non-public constructors. +template +T *New(Args &&... args) { + void *t = OPENSSL_malloc(sizeof(T)); + if (t == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + return new (t) T(std::forward(args)...); +} + +// Delete behaves like |delete| but uses |OPENSSL_free| to release memory. +// +// Note: unlike |delete| this does not support non-public destructors. +template +void Delete(T *t) { + if (t != nullptr) { + t->~T(); + OPENSSL_free(t); + } +} + +// All types with kAllowUniquePtr set may be used with UniquePtr. Other types +// may be C structs which require a |BORINGSSL_MAKE_DELETER| registration. +namespace internal { +template +struct DeleterImpl::type> { + static void Free(T *t) { Delete(t); } +}; +} // namespace internal + +// MakeUnique behaves like |std::make_unique| but returns nullptr on allocation +// error. +template +UniquePtr MakeUnique(Args &&... args) { + return UniquePtr(New(std::forward(args)...)); +} + +#if defined(BORINGSSL_ALLOW_CXX_RUNTIME) +#define HAS_VIRTUAL_DESTRUCTOR +#define PURE_VIRTUAL = 0 +#else +// HAS_VIRTUAL_DESTRUCTOR should be declared in any base class which defines a +// virtual destructor. This avoids a dependency on |_ZdlPv| and prevents the +// class from being used with |delete|. +#define HAS_VIRTUAL_DESTRUCTOR \ + void operator delete(void *) { abort(); } + +// PURE_VIRTUAL should be used instead of = 0 when defining pure-virtual +// functions. This avoids a dependency on |__cxa_pure_virtual| but loses +// compile-time checking. +#define PURE_VIRTUAL \ + { abort(); } +#endif + +// CONSTEXPR_ARRAY works around a VS 2015 bug where ranged for loops don't work +// on constexpr arrays. +#if defined(_MSC_VER) && !defined(__clang__) && _MSC_VER < 1910 +#define CONSTEXPR_ARRAY const +#else +#define CONSTEXPR_ARRAY constexpr +#endif + +// Array is an owning array of elements of |T|. +template +class Array { + public: + // Array's default constructor creates an empty array. + Array() {} + Array(const Array &) = delete; + Array(Array &&other) { *this = std::move(other); } + + ~Array() { Reset(); } + + Array &operator=(const Array &) = delete; + Array &operator=(Array &&other) { + Reset(); + other.Release(&data_, &size_); + return *this; + } + + const T *data() const { return data_; } + T *data() { return data_; } + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + const T &operator[](size_t i) const { return data_[i]; } + T &operator[](size_t i) { return data_[i]; } + + T *begin() { return data_; } + const T *cbegin() const { return data_; } + T *end() { return data_ + size_; } + const T *cend() const { return data_ + size_; } + + void Reset() { Reset(nullptr, 0); } + + // Reset releases the current contents of the array and takes ownership of the + // raw pointer supplied by the caller. + void Reset(T *new_data, size_t new_size) { + for (size_t i = 0; i < size_; i++) { + data_[i].~T(); + } + OPENSSL_free(data_); + data_ = new_data; + size_ = new_size; + } + + // Release releases ownership of the array to a raw pointer supplied by the + // caller. + void Release(T **out, size_t *out_size) { + *out = data_; + *out_size = size_; + data_ = nullptr; + size_ = 0; + } + + // Init replaces the array with a newly-allocated array of |new_size| + // default-constructed copies of |T|. It returns true on success and false on + // error. + // + // Note that if |T| is a primitive type like |uint8_t|, it is uninitialized. + bool Init(size_t new_size) { + Reset(); + if (new_size == 0) { + return true; + } + + if (new_size > std::numeric_limits::max() / sizeof(T)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + data_ = reinterpret_cast(OPENSSL_malloc(new_size * sizeof(T))); + if (data_ == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + size_ = new_size; + for (size_t i = 0; i < size_; i++) { + new (&data_[i]) T; + } + return true; + } + + // CopyFrom replaces the array with a newly-allocated copy of |in|. It returns + // true on success and false on error. + bool CopyFrom(Span in) { + if (!Init(in.size())) { + return false; + } + OPENSSL_memcpy(data_, in.data(), sizeof(T) * in.size()); + return true; + } + + // Shrink shrinks the stored size of the array to |new_size|. It crashes if + // the new size is larger. Note this does not shrink the allocation itself. + void Shrink(size_t new_size) { + if (new_size > size_) { + abort(); + } + size_ = new_size; + } + + private: + T *data_ = nullptr; + size_t size_ = 0; +}; + +// GrowableArray is an array that owns elements of |T|, backed by an +// Array. When necessary, pushing will automatically trigger a resize. +// +// Note, for simplicity, this class currently differs from |std::vector| in that +// |T| must be efficiently default-constructible. Allocated elements beyond the +// end of the array are constructed and destructed. +template +class GrowableArray { + public: + GrowableArray() = default; + GrowableArray(const GrowableArray &) = delete; + GrowableArray(GrowableArray &&other) { *this = std::move(other); } + ~GrowableArray() {} + + GrowableArray &operator=(const GrowableArray &) = delete; + GrowableArray &operator=(GrowableArray &&other) { + size_ = other.size_; + other.size_ = 0; + array_ = std::move(other.array_); + return *this; + } + + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + const T &operator[](size_t i) const { return array_[i]; } + T &operator[](size_t i) { return array_[i]; } + + T *begin() { return array_.data(); } + const T *cbegin() const { return array_.data(); } + T *end() { return array_.data() + size_; } + const T *cend() const { return array_.data() + size_; } + + // Push adds |elem| at the end of the internal array, growing if necessary. It + // returns false when allocation fails. + bool Push(T elem) { + if (!MaybeGrow()) { + return false; + } + array_[size_] = std::move(elem); + size_++; + return true; + } + + // CopyFrom replaces the contents of the array with a copy of |in|. It returns + // true on success and false on allocation error. + bool CopyFrom(Span in) { + if (!array_.CopyFrom(in)) { + return false; + } + size_ = in.size(); + return true; + } + + private: + // If there is no room for one more element, creates a new backing array with + // double the size of the old one and copies elements over. + bool MaybeGrow() { + if (array_.size() == 0) { + return array_.Init(kDefaultSize); + } + // No need to grow if we have room for one more T. + if (size_ < array_.size()) { + return true; + } + // Double the array's size if it's safe to do so. + if (array_.size() > std::numeric_limits::max() / 2) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + Array new_array; + if (!new_array.Init(array_.size() * 2)) { + return false; + } + for (size_t i = 0; i < array_.size(); i++) { + new_array[i] = std::move(array_[i]); + } + array_ = std::move(new_array); + + return true; + } + + // |size_| is the number of elements stored in this GrowableArray. + size_t size_ = 0; + // |array_| is the backing array. Note that |array_.size()| is this + // GrowableArray's current capacity and that |size_ <= array_.size()|. + Array array_; + // |kDefaultSize| is the default initial size of the backing array. + static constexpr size_t kDefaultSize = 16; +}; + +// CBBFinishArray behaves like |CBB_finish| but stores the result in an Array. +OPENSSL_EXPORT bool CBBFinishArray(CBB *cbb, Array *out); + + +// Protocol versions. +// +// Due to DTLS's historical wire version differences, we maintain two notions of +// version. +// +// The "version" or "wire version" is the actual 16-bit value that appears on +// the wire. It uniquely identifies a version and is also used at API +// boundaries. The set of supported versions differs between TLS and DTLS. Wire +// versions are opaque values and may not be compared numerically. +// +// The "protocol version" identifies the high-level handshake variant being +// used. DTLS versions map to the corresponding TLS versions. Protocol versions +// are sequential and may be compared numerically. + +// ssl_protocol_version_from_wire sets |*out| to the protocol version +// corresponding to wire version |version| and returns true. If |version| is not +// a valid TLS or DTLS version, it returns false. +// +// Note this simultaneously handles both DTLS and TLS. Use one of the +// higher-level functions below for most operations. +bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version); + +// ssl_get_version_range sets |*out_min_version| and |*out_max_version| to the +// minimum and maximum enabled protocol versions, respectively. +bool ssl_get_version_range(const SSL_HANDSHAKE *hs, uint16_t *out_min_version, + uint16_t *out_max_version); + +// ssl_supports_version returns whether |hs| supports |version|. +bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version); + +// ssl_method_supports_version returns whether |method| supports |version|. +bool ssl_method_supports_version(const SSL_PROTOCOL_METHOD *method, + uint16_t version); + +// ssl_add_supported_versions writes the supported versions of |hs| to |cbb|, in +// decreasing preference order. +bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb); + +// ssl_negotiate_version negotiates a common version based on |hs|'s preferences +// and the peer preference list in |peer_versions|. On success, it returns true +// and sets |*out_version| to the selected version. Otherwise, it returns false +// and sets |*out_alert| to an alert to send. +bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, + uint16_t *out_version, const CBS *peer_versions); + +// ssl_protocol_version returns |ssl|'s protocol version. It is an error to +// call this function before the version is determined. +uint16_t ssl_protocol_version(const SSL *ssl); + +// Cipher suites. + +BSSL_NAMESPACE_END + +struct ssl_cipher_st { + // name is the OpenSSL name for the cipher. + const char *name; + // standard_name is the IETF name for the cipher. + const char *standard_name; + // id is the cipher suite value bitwise OR-d with 0x03000000. + uint32_t id; + + // algorithm_* determine the cipher suite. See constants below for the values. + uint32_t algorithm_mkey; + uint32_t algorithm_auth; + uint32_t algorithm_enc; + uint32_t algorithm_mac; + uint32_t algorithm_prf; +}; + +BSSL_NAMESPACE_BEGIN + +// Bits for |algorithm_mkey| (key exchange algorithm). +#define SSL_kRSA 0x00000001u +#define SSL_kECDHE 0x00000002u +// SSL_kPSK is only set for plain PSK, not ECDHE_PSK. +#define SSL_kPSK 0x00000004u +#define SSL_kGENERIC 0x00000008u + +// Bits for |algorithm_auth| (server authentication). +#define SSL_aRSA 0x00000001u +#define SSL_aECDSA 0x00000002u +// SSL_aPSK is set for both PSK and ECDHE_PSK. +#define SSL_aPSK 0x00000004u +#define SSL_aGENERIC 0x00000008u + +#define SSL_aCERT (SSL_aRSA | SSL_aECDSA) + +// Bits for |algorithm_enc| (symmetric encryption). +#define SSL_3DES 0x00000001u +#define SSL_AES128 0x00000002u +#define SSL_AES256 0x00000004u +#define SSL_AES128GCM 0x00000008u +#define SSL_AES256GCM 0x00000010u +#define SSL_eNULL 0x00000020u +#define SSL_CHACHA20POLY1305 0x00000040u + +#define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AES128GCM | SSL_AES256GCM) + +// Bits for |algorithm_mac| (symmetric authentication). +#define SSL_SHA1 0x00000001u +// SSL_AEAD is set for all AEADs. +#define SSL_AEAD 0x00000002u + +// Bits for |algorithm_prf| (handshake digest). +#define SSL_HANDSHAKE_MAC_DEFAULT 0x1 +#define SSL_HANDSHAKE_MAC_SHA256 0x2 +#define SSL_HANDSHAKE_MAC_SHA384 0x4 + +// SSL_MAX_MD_SIZE is size of the largest hash function used in TLS, SHA-384. +#define SSL_MAX_MD_SIZE 48 + +// An SSLCipherPreferenceList contains a list of SSL_CIPHERs with equal- +// preference groups. For TLS clients, the groups are moot because the server +// picks the cipher and groups cannot be expressed on the wire. However, for +// servers, the equal-preference groups allow the client's preferences to be +// partially respected. (This only has an effect with +// SSL_OP_CIPHER_SERVER_PREFERENCE). +// +// The equal-preference groups are expressed by grouping SSL_CIPHERs together. +// All elements of a group have the same priority: no ordering is expressed +// within a group. +// +// The values in |ciphers| are in one-to-one correspondence with +// |in_group_flags|. (That is, sk_SSL_CIPHER_num(ciphers) is the number of +// bytes in |in_group_flags|.) The bytes in |in_group_flags| are either 1, to +// indicate that the corresponding SSL_CIPHER is not the last element of a +// group, or 0 to indicate that it is. +// +// For example, if |in_group_flags| contains all zeros then that indicates a +// traditional, fully-ordered preference. Every SSL_CIPHER is the last element +// of the group (i.e. they are all in a one-element group). +// +// For a more complex example, consider: +// ciphers: A B C D E F +// in_group_flags: 1 1 0 0 1 0 +// +// That would express the following, order: +// +// A E +// B -> D -> F +// C +struct SSLCipherPreferenceList { + static constexpr bool kAllowUniquePtr = true; + + SSLCipherPreferenceList() = default; + ~SSLCipherPreferenceList(); + + bool Init(UniquePtr ciphers, + Span in_group_flags); + bool Init(const SSLCipherPreferenceList &); + + void Remove(const SSL_CIPHER *cipher); + + UniquePtr ciphers; + bool *in_group_flags = nullptr; +}; + +// AllCiphers returns an array of all supported ciphers, sorted by id. +Span AllCiphers(); + +// ssl_cipher_get_evp_aead sets |*out_aead| to point to the correct EVP_AEAD +// object for |cipher| protocol version |version|. It sets |*out_mac_secret_len| +// and |*out_fixed_iv_len| to the MAC key length and fixed IV length, +// respectively. The MAC key length is zero except for legacy block and stream +// ciphers. It returns true on success and false on error. +bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, + size_t *out_mac_secret_len, + size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, + uint16_t version, bool is_dtls); + +// ssl_get_handshake_digest returns the |EVP_MD| corresponding to |version| and +// |cipher|. +const EVP_MD *ssl_get_handshake_digest(uint16_t version, + const SSL_CIPHER *cipher); + +// ssl_create_cipher_list evaluates |rule_str|. It sets |*out_cipher_list| to a +// newly-allocated |SSLCipherPreferenceList| containing the result. It returns +// true on success and false on failure. If |strict| is true, nonsense will be +// rejected. If false, nonsense will be silently ignored. An empty result is +// considered an error regardless of |strict|. +bool ssl_create_cipher_list(UniquePtr *out_cipher_list, + const char *rule_str, bool strict); + +// ssl_cipher_get_value returns the cipher suite id of |cipher|. +uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher); + +// ssl_cipher_auth_mask_for_key returns the mask of cipher |algorithm_auth| +// values suitable for use with |key| in TLS 1.2 and below. +uint32_t ssl_cipher_auth_mask_for_key(const EVP_PKEY *key); + +// ssl_cipher_uses_certificate_auth returns whether |cipher| authenticates the +// server and, optionally, the client with a certificate. +bool ssl_cipher_uses_certificate_auth(const SSL_CIPHER *cipher); + +// ssl_cipher_requires_server_key_exchange returns whether |cipher| requires a +// ServerKeyExchange message. +// +// This function may return false while still allowing |cipher| an optional +// ServerKeyExchange. This is the case for plain PSK ciphers. +bool ssl_cipher_requires_server_key_exchange(const SSL_CIPHER *cipher); + +// ssl_cipher_get_record_split_len, for TLS 1.0 CBC mode ciphers, returns the +// length of an encrypted 1-byte record, for use in record-splitting. Otherwise +// it returns zero. +size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher); + +// ssl_choose_tls13_cipher returns an |SSL_CIPHER| corresponding with the best +// available from |cipher_suites| compatible with |version| and |group_id|. It +// returns NULL if there isn't a compatible cipher. +const SSL_CIPHER *ssl_choose_tls13_cipher(CBS cipher_suites, uint16_t version, + uint16_t group_id); + + +// Transcript layer. + +// SSLTranscript maintains the handshake transcript as a combination of a +// buffer and running hash. +class SSLTranscript { + public: + SSLTranscript(); + ~SSLTranscript(); + + // Init initializes the handshake transcript. If called on an existing + // transcript, it resets the transcript and hash. It returns true on success + // and false on failure. + bool Init(); + + // InitHash initializes the handshake hash based on the PRF and contents of + // the handshake transcript. Subsequent calls to |Update| will update the + // rolling hash. It returns one on success and zero on failure. It is an error + // to call this function after the handshake buffer is released. + bool InitHash(uint16_t version, const SSL_CIPHER *cipher); + + // UpdateForHelloRetryRequest resets the rolling hash with the + // HelloRetryRequest construction. It returns true on success and false on + // failure. It is an error to call this function before the handshake buffer + // is released. + bool UpdateForHelloRetryRequest(); + + // CopyToHashContext initializes |ctx| with |digest| and the data thus far in + // the transcript. It returns true on success and false on failure. If the + // handshake buffer is still present, |digest| may be any supported digest. + // Otherwise, |digest| must match the transcript hash. + bool CopyToHashContext(EVP_MD_CTX *ctx, const EVP_MD *digest); + + Span buffer() { + return MakeConstSpan(reinterpret_cast(buffer_->data), + buffer_->length); + } + + // FreeBuffer releases the handshake buffer. Subsequent calls to + // |Update| will not update the handshake buffer. + void FreeBuffer(); + + // DigestLen returns the length of the PRF hash. + size_t DigestLen() const; + + // Digest returns the PRF hash. For TLS 1.1 and below, this is + // |EVP_md5_sha1|. + const EVP_MD *Digest() const; + + // Update adds |in| to the handshake buffer and handshake hash, whichever is + // enabled. It returns true on success and false on failure. + bool Update(Span in); + + // GetHash writes the handshake hash to |out| which must have room for at + // least |DigestLen| bytes. On success, it returns true and sets |*out_len| to + // the number of bytes written. Otherwise, it returns false. + bool GetHash(uint8_t *out, size_t *out_len); + + // GetFinishedMAC computes the MAC for the Finished message into the bytes + // pointed by |out| and writes the number of bytes to |*out_len|. |out| must + // have room for |EVP_MAX_MD_SIZE| bytes. It returns true on success and false + // on failure. + bool GetFinishedMAC(uint8_t *out, size_t *out_len, const SSL_SESSION *session, + bool from_server); + + private: + // buffer_, if non-null, contains the handshake transcript. + UniquePtr buffer_; + // hash, if initialized with an |EVP_MD|, maintains the handshake hash. + ScopedEVP_MD_CTX hash_; +}; + +// tls1_prf computes the PRF function for |ssl|. It fills |out|, using |secret| +// as the secret and |label| as the label. |seed1| and |seed2| are concatenated +// to form the seed parameter. It returns true on success and false on failure. +bool tls1_prf(const EVP_MD *digest, Span out, + Span secret, Span label, + Span seed1, Span seed2); + + +// Encryption layer. + +// SSLAEADContext contains information about an AEAD that is being used to +// encrypt an SSL connection. +class SSLAEADContext { + public: + SSLAEADContext(uint16_t version, bool is_dtls, const SSL_CIPHER *cipher); + ~SSLAEADContext(); + static constexpr bool kAllowUniquePtr = true; + + SSLAEADContext(const SSLAEADContext &&) = delete; + SSLAEADContext &operator=(const SSLAEADContext &&) = delete; + + // CreateNullCipher creates an |SSLAEADContext| for the null cipher. + static UniquePtr CreateNullCipher(bool is_dtls); + + // Create creates an |SSLAEADContext| using the supplied key material. It + // returns nullptr on error. Only one of |Open| or |Seal| may be used with the + // resulting object, depending on |direction|. |version| is the normalized + // protocol version, so DTLS 1.0 is represented as 0x0301, not 0xffef. + static UniquePtr Create(enum evp_aead_direction_t direction, + uint16_t version, bool is_dtls, + const SSL_CIPHER *cipher, + Span enc_key, + Span mac_key, + Span fixed_iv); + + // CreatePlaceholderForQUIC creates a placeholder |SSLAEADContext| for the + // given cipher and version. The resulting object can be queried for various + // properties but cannot encrypt or decrypt data. + static UniquePtr CreatePlaceholderForQUIC( + uint16_t version, const SSL_CIPHER *cipher); + + // SetVersionIfNullCipher sets the version the SSLAEADContext for the null + // cipher, to make version-specific determinations in the record layer prior + // to a cipher being selected. + void SetVersionIfNullCipher(uint16_t version); + + // ProtocolVersion returns the protocol version associated with this + // SSLAEADContext. It can only be called once |version_| has been set to a + // valid value. + uint16_t ProtocolVersion() const; + + // RecordVersion returns the record version that should be used with this + // SSLAEADContext for record construction and crypto. + uint16_t RecordVersion() const; + + const SSL_CIPHER *cipher() const { return cipher_; } + + // is_null_cipher returns true if this is the null cipher. + bool is_null_cipher() const { return !cipher_; } + + // ExplicitNonceLen returns the length of the explicit nonce. + size_t ExplicitNonceLen() const; + + // MaxOverhead returns the maximum overhead of calling |Seal|. + size_t MaxOverhead() const; + + // SuffixLen calculates the suffix length written by |SealScatter| and writes + // it to |*out_suffix_len|. It returns true on success and false on error. + // |in_len| and |extra_in_len| should equal the argument of the same names + // passed to |SealScatter|. + bool SuffixLen(size_t *out_suffix_len, size_t in_len, + size_t extra_in_len) const; + + // CiphertextLen calculates the total ciphertext length written by + // |SealScatter| and writes it to |*out_len|. It returns true on success and + // false on error. |in_len| and |extra_in_len| should equal the argument of + // the same names passed to |SealScatter|. + bool CiphertextLen(size_t *out_len, size_t in_len, size_t extra_in_len) const; + + // Open authenticates and decrypts |in| in-place. On success, it sets |*out| + // to the plaintext in |in| and returns true. Otherwise, it returns + // false. The output will always be |ExplicitNonceLen| bytes ahead of |in|. + bool Open(Span *out, uint8_t type, uint16_t record_version, + const uint8_t seqnum[8], Span header, + Span in); + + // Seal encrypts and authenticates |in_len| bytes from |in| and writes the + // result to |out|. It returns true on success and false on error. + // + // If |in| and |out| alias then |out| + |ExplicitNonceLen| must be == |in|. + bool Seal(uint8_t *out, size_t *out_len, size_t max_out, uint8_t type, + uint16_t record_version, const uint8_t seqnum[8], + Span header, const uint8_t *in, size_t in_len); + + // SealScatter encrypts and authenticates |in_len| bytes from |in| and splits + // the result between |out_prefix|, |out| and |out_suffix|. It returns one on + // success and zero on error. + // + // On successful return, exactly |ExplicitNonceLen| bytes are written to + // |out_prefix|, |in_len| bytes to |out|, and |SuffixLen| bytes to + // |out_suffix|. + // + // |extra_in| may point to an additional plaintext buffer. If present, + // |extra_in_len| additional bytes are encrypted and authenticated, and the + // ciphertext is written to the beginning of |out_suffix|. |SuffixLen| should + // be used to size |out_suffix| accordingly. + // + // If |in| and |out| alias then |out| must be == |in|. Other arguments may not + // alias anything. + bool SealScatter(uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, + uint8_t type, uint16_t record_version, + const uint8_t seqnum[8], Span header, + const uint8_t *in, size_t in_len, const uint8_t *extra_in, + size_t extra_in_len); + + bool GetIV(const uint8_t **out_iv, size_t *out_iv_len) const; + + private: + // GetAdditionalData returns the additional data, writing into |storage| if + // necessary. + Span GetAdditionalData(uint8_t storage[13], uint8_t type, + uint16_t record_version, + const uint8_t seqnum[8], + size_t plaintext_len, + Span header); + + const SSL_CIPHER *cipher_; + ScopedEVP_AEAD_CTX ctx_; + // fixed_nonce_ contains any bytes of the nonce that are fixed for all + // records. + uint8_t fixed_nonce_[12]; + uint8_t fixed_nonce_len_ = 0, variable_nonce_len_ = 0; + // version_ is the wire version that should be used with this AEAD. + uint16_t version_; + // is_dtls_ is whether DTLS is being used with this AEAD. + bool is_dtls_; + // variable_nonce_included_in_record_ is true if the variable nonce + // for a record is included as a prefix before the ciphertext. + bool variable_nonce_included_in_record_ : 1; + // random_variable_nonce_ is true if the variable nonce is + // randomly generated, rather than derived from the sequence + // number. + bool random_variable_nonce_ : 1; + // xor_fixed_nonce_ is true if the fixed nonce should be XOR'd into the + // variable nonce rather than prepended. + bool xor_fixed_nonce_ : 1; + // omit_length_in_ad_ is true if the length should be omitted in the + // AEAD's ad parameter. + bool omit_length_in_ad_ : 1; + // ad_is_header_ is true if the AEAD's ad parameter is the record header. + bool ad_is_header_ : 1; +}; + + +// DTLS replay bitmap. + +// DTLS1_BITMAP maintains a sliding window of 64 sequence numbers to detect +// replayed packets. It should be initialized by zeroing every field. +struct DTLS1_BITMAP { + // map is a bit mask of the last 64 sequence numbers. Bit + // |1< *out, size_t *out_consumed, + uint8_t *out_alert, Span in); + +// dtls_open_record implements |tls_open_record| for DTLS. It only returns +// |ssl_open_record_partial| if |in| was empty and sets |*out_consumed| to +// zero. The caller should read one packet and try again. +enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, + Span *out, + size_t *out_consumed, + uint8_t *out_alert, Span in); + +// ssl_seal_align_prefix_len returns the length of the prefix before the start +// of the bulk of the ciphertext when sealing a record with |ssl|. Callers may +// use this to align buffers. +// +// Note when TLS 1.0 CBC record-splitting is enabled, this includes the one byte +// record and is the offset into second record's ciphertext. Thus sealing a +// small record may result in a smaller output than this value. +// +// TODO(davidben): Is this alignment valuable? Record-splitting makes this a +// mess. +size_t ssl_seal_align_prefix_len(const SSL *ssl); + +// tls_seal_record seals a new record of type |type| and body |in| and writes it +// to |out|. At most |max_out| bytes will be written. It returns true on success +// and false on error. If enabled, |tls_seal_record| implements TLS 1.0 CBC +// 1/n-1 record splitting and may write two records concatenated. +// +// For a large record, the bulk of the ciphertext will begin +// |ssl_seal_align_prefix_len| bytes into out. Aligning |out| appropriately may +// improve performance. It writes at most |in_len| + |SSL_max_seal_overhead| +// bytes to |out|. +// +// |in| and |out| may not alias. +bool tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, + uint8_t type, const uint8_t *in, size_t in_len); + +enum dtls1_use_epoch_t { + dtls1_use_previous_epoch, + dtls1_use_current_epoch, +}; + +// dtls_max_seal_overhead returns the maximum overhead, in bytes, of sealing a +// record. +size_t dtls_max_seal_overhead(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); + +// dtls_seal_prefix_len returns the number of bytes of prefix to reserve in +// front of the plaintext when sealing a record in-place. +size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); + +// dtls_seal_record implements |tls_seal_record| for DTLS. |use_epoch| selects +// which epoch's cipher state to use. Unlike |tls_seal_record|, |in| and |out| +// may alias but, if they do, |in| must be exactly |dtls_seal_prefix_len| bytes +// ahead of |out|. +bool dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, + uint8_t type, const uint8_t *in, size_t in_len, + enum dtls1_use_epoch_t use_epoch); + +// ssl_process_alert processes |in| as an alert and updates |ssl|'s shutdown +// state. It returns one of |ssl_open_record_discard|, |ssl_open_record_error|, +// |ssl_open_record_close_notify|, or |ssl_open_record_fatal_alert| as +// appropriate. +enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, + Span in); + + +// Private key operations. + +// ssl_has_private_key returns whether |hs| has a private key configured. +bool ssl_has_private_key(const SSL_HANDSHAKE *hs); + +// ssl_private_key_* perform the corresponding operation on +// |SSL_PRIVATE_KEY_METHOD|. If there is a custom private key configured, they +// call the corresponding function or |complete| depending on whether there is a +// pending operation. Otherwise, they implement the operation with +// |EVP_PKEY|. + +enum ssl_private_key_result_t ssl_private_key_sign( + SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, + uint16_t sigalg, Span in); + +enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, + uint8_t *out, + size_t *out_len, + size_t max_out, + Span in); + +// ssl_private_key_supports_signature_algorithm returns whether |hs|'s private +// key supports |sigalg|. +bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, + uint16_t sigalg); + +// ssl_public_key_verify verifies that the |signature| is valid for the public +// key |pkey| and input |in|, using the signature algorithm |sigalg|. +bool ssl_public_key_verify(SSL *ssl, Span signature, + uint16_t sigalg, EVP_PKEY *pkey, + Span in); + + +// Key shares. + +// SSLKeyShare abstracts over Diffie-Hellman-like key exchanges. +class SSLKeyShare { + public: + virtual ~SSLKeyShare() {} + static constexpr bool kAllowUniquePtr = true; + HAS_VIRTUAL_DESTRUCTOR + + // Create returns a SSLKeyShare instance for use with group |group_id| or + // nullptr on error. + static UniquePtr Create(uint16_t group_id); + + // Create deserializes an SSLKeyShare instance previously serialized by + // |Serialize|. + static UniquePtr Create(CBS *in); + + // GroupID returns the group ID. + virtual uint16_t GroupID() const PURE_VIRTUAL; + + // Offer generates a keypair and writes the public value to + // |out_public_key|. It returns true on success and false on error. + virtual bool Offer(CBB *out_public_key) PURE_VIRTUAL; + + // Accept performs a key exchange against the |peer_key| generated by |Offer|. + // On success, it returns true, writes the public value to |out_public_key|, + // and sets |*out_secret| to the shared secret. On failure, it returns false + // and sets |*out_alert| to an alert to send to the peer. + // + // The default implementation calls |Offer| and then |Finish|, assuming a key + // exchange protocol where the peers are symmetric. + virtual bool Accept(CBB *out_public_key, Array *out_secret, + uint8_t *out_alert, Span peer_key); + + // Finish performs a key exchange against the |peer_key| generated by + // |Accept|. On success, it returns true and sets |*out_secret| to the shared + // secret. On failure, it returns false and sets |*out_alert| to an alert to + // send to the peer. + virtual bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) PURE_VIRTUAL; + + // Serialize writes the state of the key exchange to |out|, returning true if + // successful and false otherwise. + virtual bool Serialize(CBB *out) { return false; } + + // Deserialize initializes the state of the key exchange from |in|, returning + // true if successful and false otherwise. It is called by |Create|. + virtual bool Deserialize(CBS *in) { return false; } +}; + +struct NamedGroup { + int nid; + uint16_t group_id; + const char name[8], alias[11]; +}; + +// NamedGroups returns all supported groups. +Span NamedGroups(); + +// ssl_nid_to_group_id looks up the group corresponding to |nid|. On success, it +// sets |*out_group_id| to the group ID and returns true. Otherwise, it returns +// false. +bool ssl_nid_to_group_id(uint16_t *out_group_id, int nid); + +// ssl_name_to_group_id looks up the group corresponding to the |name| string of +// length |len|. On success, it sets |*out_group_id| to the group ID and returns +// true. Otherwise, it returns false. +bool ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len); + + +// Handshake messages. + +struct SSLMessage { + bool is_v2_hello; + uint8_t type; + CBS body; + // raw is the entire serialized handshake message, including the TLS or DTLS + // message header. + CBS raw; +}; + +// SSL_MAX_HANDSHAKE_FLIGHT is the number of messages, including +// ChangeCipherSpec, in the longest handshake flight. Currently this is the +// client's second leg in a full handshake when client certificates, NPN, and +// Channel ID, are all enabled. +#define SSL_MAX_HANDSHAKE_FLIGHT 7 + +extern const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE]; +extern const uint8_t kTLS12DowngradeRandom[8]; +extern const uint8_t kTLS13DowngradeRandom[8]; +extern const uint8_t kJDK11DowngradeRandom[8]; + +// ssl_max_handshake_message_len returns the maximum number of bytes permitted +// in a handshake message for |ssl|. +size_t ssl_max_handshake_message_len(const SSL *ssl); + +// tls_can_accept_handshake_data returns whether |ssl| is able to accept more +// data into handshake buffer. +bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert); + +// tls_has_unprocessed_handshake_data returns whether there is buffered +// handshake data that has not been consumed by |get_message|. +bool tls_has_unprocessed_handshake_data(const SSL *ssl); + +// tls_append_handshake_data appends |data| to the handshake buffer. It returns +// true on success and false on allocation failure. +bool tls_append_handshake_data(SSL *ssl, Span data); + +// dtls_has_unprocessed_handshake_data behaves like +// |tls_has_unprocessed_handshake_data| for DTLS. +bool dtls_has_unprocessed_handshake_data(const SSL *ssl); + +// tls_flush_pending_hs_data flushes any handshake plaintext data. +bool tls_flush_pending_hs_data(SSL *ssl); + +struct DTLS_OUTGOING_MESSAGE { + DTLS_OUTGOING_MESSAGE() {} + DTLS_OUTGOING_MESSAGE(const DTLS_OUTGOING_MESSAGE &) = delete; + DTLS_OUTGOING_MESSAGE &operator=(const DTLS_OUTGOING_MESSAGE &) = delete; + ~DTLS_OUTGOING_MESSAGE() { Clear(); } + + void Clear(); + + uint8_t *data = nullptr; + uint32_t len = 0; + uint16_t epoch = 0; + bool is_ccs = false; +}; + +// dtls_clear_outgoing_messages releases all buffered outgoing messages. +void dtls_clear_outgoing_messages(SSL *ssl); + + +// Callbacks. + +// ssl_do_info_callback calls |ssl|'s info callback, if set. +void ssl_do_info_callback(const SSL *ssl, int type, int value); + +// ssl_do_msg_callback calls |ssl|'s message callback, if set. +void ssl_do_msg_callback(const SSL *ssl, int is_write, int content_type, + Span in); + + +// Transport buffers. + +class SSLBuffer { + public: + SSLBuffer() {} + ~SSLBuffer() { Clear(); } + + SSLBuffer(const SSLBuffer &) = delete; + SSLBuffer &operator=(const SSLBuffer &) = delete; + + uint8_t *data() { return buf_ + offset_; } + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + size_t cap() const { return cap_; } + + Span span() { return MakeSpan(data(), size()); } + + Span remaining() { + return MakeSpan(data() + size(), cap() - size()); + } + + // Clear releases the buffer. + void Clear(); + + // EnsureCap ensures the buffer has capacity at least |new_cap|, aligned such + // that data written after |header_len| is aligned to a + // |SSL3_ALIGN_PAYLOAD|-byte boundary. It returns true on success and false + // on error. + bool EnsureCap(size_t header_len, size_t new_cap); + + // DidWrite extends the buffer by |len|. The caller must have filled in to + // this point. + void DidWrite(size_t len); + + // Consume consumes |len| bytes from the front of the buffer. The memory + // consumed will remain valid until the next call to |DiscardConsumed| or + // |Clear|. + void Consume(size_t len); + + // DiscardConsumed discards the consumed bytes from the buffer. If the buffer + // is now empty, it releases memory used by it. + void DiscardConsumed(); + + private: + // buf_ is the memory allocated for this buffer. + uint8_t *buf_ = nullptr; + // offset_ is the offset into |buf_| which the buffer contents start at. + uint16_t offset_ = 0; + // size_ is the size of the buffer contents from |buf_| + |offset_|. + uint16_t size_ = 0; + // cap_ is how much memory beyond |buf_| + |offset_| is available. + uint16_t cap_ = 0; + // inline_buf_ is a static buffer for short reads. + uint8_t inline_buf_[SSL3_RT_HEADER_LENGTH]; + // buf_allocated_ is true if |buf_| points to allocated data and must be freed + // or false if it points into |inline_buf_|. + bool buf_allocated_ = false; +}; + +// ssl_read_buffer_extend_to extends the read buffer to the desired length. For +// TLS, it reads to the end of the buffer until the buffer is |len| bytes +// long. For DTLS, it reads a new packet and ignores |len|. It returns one on +// success, zero on EOF, and a negative number on error. +// +// It is an error to call |ssl_read_buffer_extend_to| in DTLS when the buffer is +// non-empty. +int ssl_read_buffer_extend_to(SSL *ssl, size_t len); + +// ssl_handle_open_record handles the result of passing |ssl->s3->read_buffer| +// to a record-processing function. If |ret| is a success or if the caller +// should retry, it returns one and sets |*out_retry|. Otherwise, it returns <= +// 0. +int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, + size_t consumed, uint8_t alert); + +// ssl_write_buffer_flush flushes the write buffer to the transport. It returns +// one on success and <= 0 on error. For DTLS, whether or not the write +// succeeds, the write buffer will be cleared. +int ssl_write_buffer_flush(SSL *ssl); + + +// Certificate functions. + +// ssl_has_certificate returns whether a certificate and private key are +// configured. +bool ssl_has_certificate(const SSL_HANDSHAKE *hs); + +// ssl_parse_cert_chain parses a certificate list from |cbs| in the format used +// by a TLS Certificate message. On success, it advances |cbs| and returns +// true. Otherwise, it returns false and sets |*out_alert| to an alert to send +// to the peer. +// +// If the list is non-empty then |*out_chain| and |*out_pubkey| will be set to +// the certificate chain and the leaf certificate's public key +// respectively. Otherwise, both will be set to nullptr. +// +// If the list is non-empty and |out_leaf_sha256| is non-NULL, it writes the +// SHA-256 hash of the leaf to |out_leaf_sha256|. +bool ssl_parse_cert_chain(uint8_t *out_alert, + UniquePtr *out_chain, + UniquePtr *out_pubkey, + uint8_t *out_leaf_sha256, CBS *cbs, + CRYPTO_BUFFER_POOL *pool); + +// ssl_add_cert_chain adds |hs->ssl|'s certificate chain to |cbb| in the format +// used by a TLS Certificate message. If there is no certificate chain, it emits +// an empty certificate list. It returns true on success and false on error. +bool ssl_add_cert_chain(SSL_HANDSHAKE *hs, CBB *cbb); + +enum ssl_key_usage_t { + key_usage_digital_signature = 0, + key_usage_encipherment = 2, +}; + +// ssl_cert_check_key_usage parses the DER-encoded, X.509 certificate in |in| +// and returns true if doesn't specify a key usage or, if it does, if it +// includes |bit|. Otherwise it pushes to the error queue and returns false. +bool ssl_cert_check_key_usage(const CBS *in, enum ssl_key_usage_t bit); + +// ssl_cert_parse_pubkey extracts the public key from the DER-encoded, X.509 +// certificate in |in|. It returns an allocated |EVP_PKEY| or else returns +// nullptr and pushes to the error queue. +UniquePtr ssl_cert_parse_pubkey(const CBS *in); + +// ssl_parse_client_CA_list parses a CA list from |cbs| in the format used by a +// TLS CertificateRequest message. On success, it returns a newly-allocated +// |CRYPTO_BUFFER| list and advances |cbs|. Otherwise, it returns nullptr and +// sets |*out_alert| to an alert to send to the peer. +UniquePtr ssl_parse_client_CA_list(SSL *ssl, + uint8_t *out_alert, + CBS *cbs); + +// ssl_has_client_CAs returns there are configured CAs. +bool ssl_has_client_CAs(const SSL_CONFIG *cfg); + +// ssl_add_client_CA_list adds the configured CA list to |cbb| in the format +// used by a TLS CertificateRequest message. It returns true on success and +// false on error. +bool ssl_add_client_CA_list(SSL_HANDSHAKE *hs, CBB *cbb); + +// ssl_check_leaf_certificate returns one if |pkey| and |leaf| are suitable as +// a server's leaf certificate for |hs|. Otherwise, it returns zero and pushes +// an error on the error queue. +bool ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, + const CRYPTO_BUFFER *leaf); + +// ssl_on_certificate_selected is called once the certificate has been selected. +// It finalizes the certificate and initializes |hs->local_pubkey|. It returns +// true on success and false on error. +bool ssl_on_certificate_selected(SSL_HANDSHAKE *hs); + + +// TLS 1.3 key derivation. + +// tls13_init_key_schedule initializes the handshake hash and key derivation +// state, and incorporates the PSK. The cipher suite and PRF hash must have been +// selected at this point. It returns true on success and false on error. +bool tls13_init_key_schedule(SSL_HANDSHAKE *hs, Span psk); + +// tls13_init_early_key_schedule initializes the handshake hash and key +// derivation state from the resumption secret and incorporates the PSK to +// derive the early secrets. It returns one on success and zero on error. +bool tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, Span psk); + +// tls13_advance_key_schedule incorporates |in| into the key schedule with +// HKDF-Extract. It returns true on success and false on error. +bool tls13_advance_key_schedule(SSL_HANDSHAKE *hs, Span in); + +// tls13_set_traffic_key sets the read or write traffic keys to +// |traffic_secret|. It returns true on success and false on error. +bool tls13_set_traffic_key(SSL *ssl, enum ssl_encryption_level_t level, + enum evp_aead_direction_t direction, + Span traffic_secret); + +// tls13_derive_early_secret derives the early traffic secret. It returns true +// on success and false on error. Unlike with other traffic secrets, this +// function does not pass the keys to QUIC. Call +// |tls13_set_early_secret_for_quic| to do so. This is done to due to an +// ordering complication around resolving HelloRetryRequest on the server. +bool tls13_derive_early_secret(SSL_HANDSHAKE *hs); + +// tls13_set_early_secret_for_quic passes the early traffic secrets, as +// derived by |tls13_derive_early_secret|, to QUIC. It returns true on success +// and false on error. +bool tls13_set_early_secret_for_quic(SSL_HANDSHAKE *hs); + +// tls13_derive_handshake_secrets derives the handshake traffic secret. It +// returns true on success and false on error. +bool tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs); + +// tls13_rotate_traffic_key derives the next read or write traffic secret. It +// returns true on success and false on error. +bool tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction); + +// tls13_derive_application_secrets derives the initial application data traffic +// and exporter secrets based on the handshake transcripts and |master_secret|. +// It returns true on success and false on error. +bool tls13_derive_application_secrets(SSL_HANDSHAKE *hs); + +// tls13_derive_resumption_secret derives the |resumption_secret|. +bool tls13_derive_resumption_secret(SSL_HANDSHAKE *hs); + +// tls13_export_keying_material provides an exporter interface to use the +// |exporter_secret|. +bool tls13_export_keying_material(SSL *ssl, Span out, + Span secret, + Span label, + Span context); + +// tls13_finished_mac calculates the MAC of the handshake transcript to verify +// the integrity of the Finished message, and stores the result in |out| and +// length in |out_len|. |is_server| is true if this is for the Server Finished +// and false for the Client Finished. +bool tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, + bool is_server); + +// tls13_derive_session_psk calculates the PSK for this session based on the +// resumption master secret and |nonce|. It returns true on success, and false +// on failure. +bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce); + +// tls13_write_psk_binder calculates the PSK binder value and replaces the last +// bytes of |msg| with the resulting value. It returns true on success, and +// false on failure. +bool tls13_write_psk_binder(SSL_HANDSHAKE *hs, Span msg); + +// tls13_verify_psk_binder verifies that the handshake transcript, truncated up +// to the binders has a valid signature using the value of |session|'s +// resumption secret. It returns true on success, and false on failure. +bool tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, + const SSLMessage &msg, CBS *binders); + + +// Handshake functions. + +enum ssl_hs_wait_t { + ssl_hs_error, + ssl_hs_ok, + ssl_hs_read_server_hello, + ssl_hs_read_message, + ssl_hs_flush, + ssl_hs_certificate_selection_pending, + ssl_hs_handoff, + ssl_hs_handback, + ssl_hs_x509_lookup, + ssl_hs_channel_id_lookup, + ssl_hs_private_key_operation, + ssl_hs_pending_session, + ssl_hs_pending_ticket, + ssl_hs_early_return, + ssl_hs_early_data_rejected, + ssl_hs_read_end_of_early_data, + ssl_hs_read_change_cipher_spec, + ssl_hs_certificate_verify, +}; + +enum ssl_grease_index_t { + ssl_grease_cipher = 0, + ssl_grease_group, + ssl_grease_extension1, + ssl_grease_extension2, + ssl_grease_version, + ssl_grease_ticket_extension, + ssl_grease_last_index = ssl_grease_ticket_extension, +}; + +enum tls12_server_hs_state_t { + state12_start_accept = 0, + state12_read_client_hello, + state12_select_certificate, + state12_tls13, + state12_select_parameters, + state12_send_server_hello, + state12_send_server_certificate, + state12_send_server_key_exchange, + state12_send_server_hello_done, + state12_read_client_certificate, + state12_verify_client_certificate, + state12_read_client_key_exchange, + state12_read_client_certificate_verify, + state12_read_change_cipher_spec, + state12_process_change_cipher_spec, + state12_read_next_proto, + state12_read_channel_id, + state12_read_client_finished, + state12_send_server_finished, + state12_finish_server_handshake, + state12_done, +}; + +enum tls13_server_hs_state_t { + state13_select_parameters = 0, + state13_select_session, + state13_send_hello_retry_request, + state13_read_second_client_hello, + state13_send_server_hello, + state13_send_server_certificate_verify, + state13_send_server_finished, + state13_read_second_client_flight, + state13_process_end_of_early_data, + state13_read_client_certificate, + state13_read_client_certificate_verify, + state13_read_channel_id, + state13_read_client_finished, + state13_send_new_session_ticket, + state13_done, +}; + +// handback_t lists the points in the state machine where a handback can occur. +// These are the different points at which key material is no longer needed. +enum handback_t { + handback_after_session_resumption, + handback_after_ecdhe, + handback_after_handshake, + handback_tls13, +}; + + +// Delegated credentials. + +// This structure stores a delegated credential (DC) as defined by +// draft-ietf-tls-subcerts-03. +struct DC { + static constexpr bool kAllowUniquePtr = true; + ~DC(); + + // Dup returns a copy of this DC and takes references to |raw| and |pkey|. + UniquePtr Dup(); + + // Parse parses the delegated credential stored in |in|. If successful it + // returns the parsed structure, otherwise it returns |nullptr| and sets + // |*out_alert|. + static UniquePtr Parse(CRYPTO_BUFFER *in, uint8_t *out_alert); + + // raw is the delegated credential encoded as specified in draft-ietf-tls- + // subcerts-03. + UniquePtr raw; + + // expected_cert_verify_algorithm is the signature scheme of the DC public + // key. + uint16_t expected_cert_verify_algorithm = 0; + + // pkey is the public key parsed from |public_key|. + UniquePtr pkey; + + private: + friend DC* New(); + DC(); +}; + +// ssl_signing_with_dc returns true if the peer has indicated support for +// delegated credentials and this host has sent a delegated credential in +// response. If this is true then we've committed to using the DC in the +// handshake. +bool ssl_signing_with_dc(const SSL_HANDSHAKE *hs); + + +struct SSL_HANDSHAKE { + explicit SSL_HANDSHAKE(SSL *ssl); + ~SSL_HANDSHAKE(); + static constexpr bool kAllowUniquePtr = true; + + // ssl is a non-owning pointer to the parent |SSL| object. + SSL *ssl; + + // config is a non-owning pointer to the handshake configuration. + SSL_CONFIG *config; + + // wait contains the operation the handshake is currently blocking on or + // |ssl_hs_ok| if none. + enum ssl_hs_wait_t wait = ssl_hs_ok; + + // state is the internal state for the TLS 1.2 and below handshake. Its + // values depend on |do_handshake| but the starting state is always zero. + int state = 0; + + // tls13_state is the internal state for the TLS 1.3 handshake. Its values + // depend on |do_handshake| but the starting state is always zero. + int tls13_state = 0; + + // min_version is the minimum accepted protocol version, taking account both + // |SSL_OP_NO_*| and |SSL_CTX_set_min_proto_version| APIs. + uint16_t min_version = 0; + + // max_version is the maximum accepted protocol version, taking account both + // |SSL_OP_NO_*| and |SSL_CTX_set_max_proto_version| APIs. + uint16_t max_version = 0; + + private: + size_t hash_len_ = 0; + uint8_t secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t early_traffic_secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t client_handshake_secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t server_handshake_secret_[SSL_MAX_MD_SIZE] = {0}; + uint8_t client_traffic_secret_0_[SSL_MAX_MD_SIZE] = {0}; + uint8_t server_traffic_secret_0_[SSL_MAX_MD_SIZE] = {0}; + uint8_t expected_client_finished_[SSL_MAX_MD_SIZE] = {0}; + + public: + void ResizeSecrets(size_t hash_len); + + Span secret() { return MakeSpan(secret_, hash_len_); } + Span early_traffic_secret() { + return MakeSpan(early_traffic_secret_, hash_len_); + } + Span client_handshake_secret() { + return MakeSpan(client_handshake_secret_, hash_len_); + } + Span server_handshake_secret() { + return MakeSpan(server_handshake_secret_, hash_len_); + } + Span client_traffic_secret_0() { + return MakeSpan(client_traffic_secret_0_, hash_len_); + } + Span server_traffic_secret_0() { + return MakeSpan(server_traffic_secret_0_, hash_len_); + } + Span expected_client_finished() { + return MakeSpan(expected_client_finished_, hash_len_); + } + + union { + // sent is a bitset where the bits correspond to elements of kExtensions + // in t1_lib.c. Each bit is set if that extension was sent in a + // ClientHello. It's not used by servers. + uint32_t sent = 0; + // received is a bitset, like |sent|, but is used by servers to record + // which extensions were received from a client. + uint32_t received; + } extensions; + + // retry_group is the group ID selected by the server in HelloRetryRequest in + // TLS 1.3. + uint16_t retry_group = 0; + + // error, if |wait| is |ssl_hs_error|, is the error the handshake failed on. + UniquePtr error; + + // key_shares are the current key exchange instances. The second is only used + // as a client if we believe that we should offer two key shares in a + // ClientHello. + UniquePtr key_shares[2]; + + // transcript is the current handshake transcript. + SSLTranscript transcript; + + // cookie is the value of the cookie received from the server, if any. + Array cookie; + + // key_share_bytes is the value of the previously sent KeyShare extension by + // the client in TLS 1.3. + Array key_share_bytes; + + // ecdh_public_key, for servers, is the key share to be sent to the client in + // TLS 1.3. + Array ecdh_public_key; + + // peer_sigalgs are the signature algorithms that the peer supports. These are + // taken from the contents of the signature algorithms extension for a server + // or from the CertificateRequest for a client. + Array peer_sigalgs; + + // peer_supported_group_list contains the supported group IDs advertised by + // the peer. This is only set on the server's end. The server does not + // advertise this extension to the client. + Array peer_supported_group_list; + + // peer_key is the peer's ECDH key for a TLS 1.2 client. + Array peer_key; + + // negotiated_token_binding_version is used by a server to store the + // on-the-wire encoding of the Token Binding protocol version to advertise in + // the ServerHello/EncryptedExtensions if the Token Binding extension is to be + // sent. + uint16_t negotiated_token_binding_version; + + // cert_compression_alg_id, for a server, contains the negotiated certificate + // compression algorithm for this client. It is only valid if + // |cert_compression_negotiated| is true. + uint16_t cert_compression_alg_id; + + // server_params, in a TLS 1.2 server, stores the ServerKeyExchange + // parameters. It has client and server randoms prepended for signing + // convenience. + Array server_params; + + // peer_psk_identity_hint, on the client, is the psk_identity_hint sent by the + // server when using a TLS 1.2 PSK key exchange. + UniquePtr peer_psk_identity_hint; + + // ca_names, on the client, contains the list of CAs received in a + // CertificateRequest message. + UniquePtr ca_names; + + // cached_x509_ca_names contains a cache of parsed versions of the elements of + // |ca_names|. This pointer is left non-owning so only + // |ssl_crypto_x509_method| needs to link against crypto/x509. + STACK_OF(X509_NAME) *cached_x509_ca_names = nullptr; + + // certificate_types, on the client, contains the set of certificate types + // received in a CertificateRequest message. + Array certificate_types; + + // local_pubkey is the public key we are authenticating as. + UniquePtr local_pubkey; + + // peer_pubkey is the public key parsed from the peer's leaf certificate. + UniquePtr peer_pubkey; + + // new_session is the new mutable session being established by the current + // handshake. It should not be cached. + UniquePtr new_session; + + // early_session is the session corresponding to the current 0-RTT state on + // the client if |in_early_data| is true. + UniquePtr early_session; + + // new_cipher is the cipher being negotiated in this handshake. + const SSL_CIPHER *new_cipher = nullptr; + + // key_block is the record-layer key block for TLS 1.2 and earlier. + Array key_block; + + // scts_requested is true if the SCT extension is in the ClientHello. + bool scts_requested : 1; + + // needs_psk_binder is true if the ClientHello has a placeholder PSK binder to + // be filled in. + bool needs_psk_binder : 1; + + // handshake_finalized is true once the handshake has completed, at which + // point accessors should use the established state. + bool handshake_finalized : 1; + + // accept_psk_mode stores whether the client's PSK mode is compatible with our + // preferences. + bool accept_psk_mode : 1; + + // cert_request is true if a client certificate was requested. + bool cert_request : 1; + + // certificate_status_expected is true if OCSP stapling was negotiated and the + // server is expected to send a CertificateStatus message. (This is used on + // both the client and server sides.) + bool certificate_status_expected : 1; + + // ocsp_stapling_requested is true if a client requested OCSP stapling. + bool ocsp_stapling_requested : 1; + + // delegated_credential_requested is true if the peer indicated support for + // the delegated credential extension. + bool delegated_credential_requested : 1; + + // should_ack_sni is used by a server and indicates that the SNI extension + // should be echoed in the ServerHello. + bool should_ack_sni : 1; + + // in_false_start is true if there is a pending client handshake in False + // Start. The client may write data at this point. + bool in_false_start : 1; + + // in_early_data is true if there is a pending handshake that has progressed + // enough to send and receive early data. + bool in_early_data : 1; + + // early_data_offered is true if the client sent the early_data extension. + bool early_data_offered : 1; + + // can_early_read is true if application data may be read at this point in the + // handshake. + bool can_early_read : 1; + + // can_early_write is true if application data may be written at this point in + // the handshake. + bool can_early_write : 1; + + // next_proto_neg_seen is one of NPN was negotiated. + bool next_proto_neg_seen : 1; + + // ticket_expected is true if a TLS 1.2 NewSessionTicket message is to be sent + // or received. + bool ticket_expected : 1; + + // extended_master_secret is true if the extended master secret extension is + // negotiated in this handshake. + bool extended_master_secret : 1; + + // pending_private_key_op is true if there is a pending private key operation + // in progress. + bool pending_private_key_op : 1; + + // grease_seeded is true if |grease_seed| has been initialized. + bool grease_seeded : 1; + + // handback indicates that a server should pause the handshake after + // finishing operations that require private key material, in such a way that + // |SSL_get_error| returns |SSL_ERROR_HANDBACK|. It is set by + // |SSL_apply_handoff|. + bool handback : 1; + + // cert_compression_negotiated is true iff |cert_compression_alg_id| is valid. + bool cert_compression_negotiated : 1; + + // apply_jdk11_workaround is true if the peer is probably a JDK 11 client + // which implemented TLS 1.3 incorrectly. + bool apply_jdk11_workaround : 1; + + // client_version is the value sent or received in the ClientHello version. + uint16_t client_version = 0; + + // early_data_read is the amount of early data that has been read by the + // record layer. + uint16_t early_data_read = 0; + + // early_data_written is the amount of early data that has been written by the + // record layer. + uint16_t early_data_written = 0; + + // session_id is the session ID in the ClientHello. + uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH] = {0}; + uint8_t session_id_len = 0; + + // grease_seed is the entropy for GREASE values. It is valid if + // |grease_seeded| is true. + uint8_t grease_seed[ssl_grease_last_index + 1] = {0}; +}; + +UniquePtr ssl_handshake_new(SSL *ssl); + +// ssl_check_message_type checks if |msg| has type |type|. If so it returns +// one. Otherwise, it sends an alert and returns zero. +bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type); + +// ssl_run_handshake runs the TLS handshake. It returns one on success and <= 0 +// on error. It sets |out_early_return| to one if we've completed the handshake +// early. +int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return); + +// The following are implementations of |do_handshake| for the client and +// server. +enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs); +enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs); +enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs); +enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs); + +// The following functions return human-readable representations of the TLS +// handshake states for debugging. +const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs); +const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs); +const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs); +const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs); + +// tls13_add_key_update queues a KeyUpdate message on |ssl|. The +// |update_requested| argument must be one of |SSL_KEY_UPDATE_REQUESTED| or +// |SSL_KEY_UPDATE_NOT_REQUESTED|. +bool tls13_add_key_update(SSL *ssl, int update_requested); + +// tls13_post_handshake processes a post-handshake message. It returns true on +// success and false on failure. +bool tls13_post_handshake(SSL *ssl, const SSLMessage &msg); + +bool tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool allow_anonymous); +bool tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg); + +// tls13_process_finished processes |msg| as a Finished message from the +// peer. If |use_saved_value| is true, the verify_data is compared against +// |hs->expected_client_finished| rather than computed fresh. +bool tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool use_saved_value); + +bool tls13_add_certificate(SSL_HANDSHAKE *hs); + +// tls13_add_certificate_verify adds a TLS 1.3 CertificateVerify message to the +// handshake. If it returns |ssl_private_key_retry|, it should be called again +// to retry when the signing operation is completed. +enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs); + +bool tls13_add_finished(SSL_HANDSHAKE *hs); +bool tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg); + +bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, + Array *out_secret, + uint8_t *out_alert, CBS *contents); +bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found, + Array *out_secret, + uint8_t *out_alert, CBS *contents); +bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); + +bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents); +bool ssl_ext_pre_shared_key_parse_clienthello( + SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders, + uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello, CBS *contents); +bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); + +// ssl_is_sct_list_valid does a shallow parse of the SCT list in |contents| and +// returns whether it's valid. +bool ssl_is_sct_list_valid(const CBS *contents); + +bool ssl_write_client_hello(SSL_HANDSHAKE *hs); + +enum ssl_cert_verify_context_t { + ssl_cert_verify_server, + ssl_cert_verify_client, + ssl_cert_verify_channel_id, +}; + +// tls13_get_cert_verify_signature_input generates the message to be signed for +// TLS 1.3's CertificateVerify message. |cert_verify_context| determines the +// type of signature. It sets |*out| to a newly allocated buffer containing the +// result. This function returns true on success and false on failure. +bool tls13_get_cert_verify_signature_input( + SSL_HANDSHAKE *hs, Array *out, + enum ssl_cert_verify_context_t cert_verify_context); + +// ssl_is_alpn_protocol_allowed returns whether |protocol| is a valid server +// selection for |hs->ssl|'s client preferences. +bool ssl_is_alpn_protocol_allowed(const SSL_HANDSHAKE *hs, + Span protocol); + +// ssl_negotiate_alpn negotiates the ALPN extension, if applicable. It returns +// true on successful negotiation or if nothing was negotiated. It returns false +// and sets |*out_alert| to an alert on error. +bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello); + +struct SSL_EXTENSION_TYPE { + uint16_t type; + bool *out_present; + CBS *out_data; +}; + +// ssl_parse_extensions parses a TLS extensions block out of |cbs| and advances +// it. It writes the parsed extensions to pointers denoted by |ext_types|. On +// success, it fills in the |out_present| and |out_data| fields and returns one. +// Otherwise, it sets |*out_alert| to an alert to send and returns zero. Unknown +// extensions are rejected unless |ignore_unknown| is 1. +int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert, + const SSL_EXTENSION_TYPE *ext_types, + size_t num_ext_types, int ignore_unknown); + +// ssl_verify_peer_cert verifies the peer certificate for |hs|. +enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs); +// ssl_reverify_peer_cert verifies the peer certificate for |hs| when resuming a +// session. +enum ssl_verify_result_t ssl_reverify_peer_cert(SSL_HANDSHAKE *hs, + bool send_alert); + +enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs); +bool ssl_send_finished(SSL_HANDSHAKE *hs); +bool ssl_output_cert_chain(SSL_HANDSHAKE *hs); + +// SSLKEYLOGFILE functions. + +// ssl_log_secret logs |secret| with label |label|, if logging is enabled for +// |ssl|. It returns true on success and false on failure. +bool ssl_log_secret(const SSL *ssl, const char *label, + Span secret); + + +// ClientHello functions. + +bool ssl_client_hello_init(const SSL *ssl, SSL_CLIENT_HELLO *out, + const SSLMessage &msg); + +bool ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, + CBS *out, uint16_t extension_type); + +bool ssl_client_cipher_list_contains_cipher( + const SSL_CLIENT_HELLO *client_hello, uint16_t id); + + +// GREASE. + +// ssl_get_grease_value returns a GREASE value for |hs|. For a given +// connection, the values for each index will be deterministic. This allows the +// same ClientHello be sent twice for a HelloRetryRequest or the same group be +// advertised in both supported_groups and key_shares. +uint16_t ssl_get_grease_value(SSL_HANDSHAKE *hs, enum ssl_grease_index_t index); + + +// Signature algorithms. + +// tls1_parse_peer_sigalgs parses |sigalgs| as the list of peer signature +// algorithms and saves them on |hs|. It returns true on success and false on +// error. +bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *sigalgs); + +// tls1_get_legacy_signature_algorithm sets |*out| to the signature algorithm +// that should be used with |pkey| in TLS 1.1 and earlier. It returns true on +// success and false if |pkey| may not be used at those versions. +bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey); + +// tls1_choose_signature_algorithm sets |*out| to a signature algorithm for use +// with |hs|'s private key based on the peer's preferences and the algorithms +// supported. It returns true on success and false on error. +bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out); + +// tls1_get_peer_verify_algorithms returns the signature schemes for which the +// peer indicated support. +// +// NOTE: The related function |SSL_get0_peer_verify_algorithms| only has +// well-defined behavior during the callbacks set by |SSL_CTX_set_cert_cb| and +// |SSL_CTX_set_client_cert_cb|, or when the handshake is paused because of +// them. +Span tls1_get_peer_verify_algorithms(const SSL_HANDSHAKE *hs); + +// tls12_add_verify_sigalgs adds the signature algorithms acceptable for the +// peer signature to |out|. It returns true on success and false on error. +bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out); + +// tls12_check_peer_sigalg checks if |sigalg| is acceptable for the peer +// signature. It returns true on success and false on error, setting +// |*out_alert| to an alert to send. +bool tls12_check_peer_sigalg(const SSL *ssl, uint8_t *out_alert, + uint16_t sigalg); + + +// Underdocumented functions. +// +// Functions below here haven't been touched up and may be underdocumented. + +#define TLSEXT_CHANNEL_ID_SIZE 128 + +// From RFC4492, used in encoding the curve type in ECParameters +#define NAMED_CURVE_TYPE 3 + +struct CERT { + static constexpr bool kAllowUniquePtr = true; + + explicit CERT(const SSL_X509_METHOD *x509_method); + ~CERT(); + + UniquePtr privatekey; + + // chain contains the certificate chain, with the leaf at the beginning. The + // first element of |chain| may be NULL to indicate that the leaf certificate + // has not yet been set. + // If |chain| != NULL -> len(chain) >= 1 + // If |chain[0]| == NULL -> len(chain) >= 2. + // |chain[1..]| != NULL + UniquePtr chain; + + // x509_chain may contain a parsed copy of |chain[1..]|. This is only used as + // a cache in order to implement “get0” functions that return a non-owning + // pointer to the certificate chain. + STACK_OF(X509) *x509_chain = nullptr; + + // x509_leaf may contain a parsed copy of the first element of |chain|. This + // is only used as a cache in order to implement “get0” functions that return + // a non-owning pointer to the certificate chain. + X509 *x509_leaf = nullptr; + + // x509_stash contains the last |X509| object append to the chain. This is a + // workaround for some third-party code that continue to use an |X509| object + // even after passing ownership with an “add0” function. + X509 *x509_stash = nullptr; + + // key_method, if non-NULL, is a set of callbacks to call for private key + // operations. + const SSL_PRIVATE_KEY_METHOD *key_method = nullptr; + + // x509_method contains pointers to functions that might deal with |X509| + // compatibility, or might be a no-op, depending on the application. + const SSL_X509_METHOD *x509_method = nullptr; + + // sigalgs, if non-empty, is the set of signature algorithms supported by + // |privatekey| in decreasing order of preference. + Array sigalgs; + + // Certificate setup callback: if set is called whenever a + // certificate may be required (client or server). the callback + // can then examine any appropriate parameters and setup any + // certificates required. This allows advanced applications + // to select certificates on the fly: for example based on + // supported signature algorithms or curves. + int (*cert_cb)(SSL *ssl, void *arg) = nullptr; + void *cert_cb_arg = nullptr; + + // Optional X509_STORE for certificate validation. If NULL the parent SSL_CTX + // store is used instead. + X509_STORE *verify_store = nullptr; + + // Signed certificate timestamp list to be sent to the client, if requested + UniquePtr signed_cert_timestamp_list; + + // OCSP response to be sent to the client, if requested. + UniquePtr ocsp_response; + + // sid_ctx partitions the session space within a shared session cache or + // ticket key. Only sessions with a matching value will be accepted. + uint8_t sid_ctx_length = 0; + uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH] = {0}; + + // Delegated credentials. + + // dc is the delegated credential to send to the peer (if requested). + UniquePtr dc = nullptr; + + // dc_privatekey is used instead of |privatekey| or |key_method| to + // authenticate the host if a delegated credential is used in the handshake. + UniquePtr dc_privatekey = nullptr; + + // dc_key_method, if not NULL, is used instead of |dc_privatekey| to + // authenticate the host. + const SSL_PRIVATE_KEY_METHOD *dc_key_method = nullptr; +}; + +// |SSL_PROTOCOL_METHOD| abstracts between TLS and DTLS. +struct SSL_PROTOCOL_METHOD { + bool is_dtls; + bool (*ssl_new)(SSL *ssl); + void (*ssl_free)(SSL *ssl); + // get_message sets |*out| to the current handshake message and returns true + // if one has been received. It returns false if more input is needed. + bool (*get_message)(const SSL *ssl, SSLMessage *out); + // next_message is called to release the current handshake message. + void (*next_message)(SSL *ssl); + // Use the |ssl_open_handshake| wrapper. + ssl_open_record_t (*open_handshake)(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); + // Use the |ssl_open_change_cipher_spec| wrapper. + ssl_open_record_t (*open_change_cipher_spec)(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); + // Use the |ssl_open_app_data| wrapper. + ssl_open_record_t (*open_app_data)(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); + int (*write_app_data)(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, + int len); + int (*dispatch_alert)(SSL *ssl); + // init_message begins a new handshake message of type |type|. |cbb| is the + // root CBB to be passed into |finish_message|. |*body| is set to a child CBB + // the caller should write to. It returns true on success and false on error. + bool (*init_message)(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); + // finish_message finishes a handshake message. It sets |*out_msg| to the + // serialized message. It returns true on success and false on error. + bool (*finish_message)(SSL *ssl, CBB *cbb, bssl::Array *out_msg); + // add_message adds a handshake message to the pending flight. It returns + // true on success and false on error. + bool (*add_message)(SSL *ssl, bssl::Array msg); + // add_change_cipher_spec adds a ChangeCipherSpec record to the pending + // flight. It returns true on success and false on error. + bool (*add_change_cipher_spec)(SSL *ssl); + // flush_flight flushes the pending flight to the transport. It returns one on + // success and <= 0 on error. + int (*flush_flight)(SSL *ssl); + // on_handshake_complete is called when the handshake is complete. + void (*on_handshake_complete)(SSL *ssl); + // set_read_state sets |ssl|'s read cipher state to |aead_ctx|. It returns + // true on success and false if changing the read state is forbidden at this + // point. + bool (*set_read_state)(SSL *ssl, UniquePtr aead_ctx); + // set_write_state sets |ssl|'s write cipher state to |aead_ctx|. It returns + // true on success and false if changing the write state is forbidden at this + // point. + bool (*set_write_state)(SSL *ssl, UniquePtr aead_ctx); +}; + +// The following wrappers call |open_*| but handle |read_shutdown| correctly. + +// ssl_open_handshake processes a record from |in| for reading a handshake +// message. +ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); + +// ssl_open_change_cipher_spec processes a record from |in| for reading a +// ChangeCipherSpec. +ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); + +// ssl_open_app_data processes a record from |in| for reading application data. +// On success, it returns |ssl_open_record_success| and sets |*out| to the +// input. If it encounters a post-handshake message, it returns +// |ssl_open_record_discard|. The caller should then retry, after processing any +// messages received with |get_message|. +ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); + +struct SSL_X509_METHOD { + // check_client_CA_list returns one if |names| is a good list of X.509 + // distinguished names and zero otherwise. This is used to ensure that we can + // reject unparsable values at handshake time when using crypto/x509. + bool (*check_client_CA_list)(STACK_OF(CRYPTO_BUFFER) *names); + + // cert_clear frees and NULLs all X509 certificate-related state. + void (*cert_clear)(CERT *cert); + // cert_free frees all X509-related state. + void (*cert_free)(CERT *cert); + // cert_flush_cached_chain drops any cached |X509|-based certificate chain + // from |cert|. + // cert_dup duplicates any needed fields from |cert| to |new_cert|. + void (*cert_dup)(CERT *new_cert, const CERT *cert); + void (*cert_flush_cached_chain)(CERT *cert); + // cert_flush_cached_chain drops any cached |X509|-based leaf certificate + // from |cert|. + void (*cert_flush_cached_leaf)(CERT *cert); + + // session_cache_objects fills out |sess->x509_peer| and |sess->x509_chain| + // from |sess->certs| and erases |sess->x509_chain_without_leaf|. It returns + // true on success or false on error. + bool (*session_cache_objects)(SSL_SESSION *session); + // session_dup duplicates any needed fields from |session| to |new_session|. + // It returns true on success or false on error. + bool (*session_dup)(SSL_SESSION *new_session, const SSL_SESSION *session); + // session_clear frees any X509-related state from |session|. + void (*session_clear)(SSL_SESSION *session); + // session_verify_cert_chain verifies the certificate chain in |session|, + // sets |session->verify_result| and returns true on success or false on + // error. + bool (*session_verify_cert_chain)(SSL_SESSION *session, SSL_HANDSHAKE *ssl, + uint8_t *out_alert); + + // hs_flush_cached_ca_names drops any cached |X509_NAME|s from |hs|. + void (*hs_flush_cached_ca_names)(SSL_HANDSHAKE *hs); + // ssl_new does any necessary initialisation of |hs|. It returns true on + // success or false on error. + bool (*ssl_new)(SSL_HANDSHAKE *hs); + // ssl_free frees anything created by |ssl_new|. + void (*ssl_config_free)(SSL_CONFIG *cfg); + // ssl_flush_cached_client_CA drops any cached |X509_NAME|s from |ssl|. + void (*ssl_flush_cached_client_CA)(SSL_CONFIG *cfg); + // ssl_auto_chain_if_needed runs the deprecated auto-chaining logic if + // necessary. On success, it updates |ssl|'s certificate configuration as + // needed and returns true. Otherwise, it returns false. + bool (*ssl_auto_chain_if_needed)(SSL_HANDSHAKE *hs); + // ssl_ctx_new does any necessary initialisation of |ctx|. It returns true on + // success or false on error. + bool (*ssl_ctx_new)(SSL_CTX *ctx); + // ssl_ctx_free frees anything created by |ssl_ctx_new|. + void (*ssl_ctx_free)(SSL_CTX *ctx); + // ssl_ctx_flush_cached_client_CA drops any cached |X509_NAME|s from |ctx|. + void (*ssl_ctx_flush_cached_client_CA)(SSL_CTX *ssl); +}; + +// ssl_crypto_x509_method provides the |SSL_X509_METHOD| functions using +// crypto/x509. +extern const SSL_X509_METHOD ssl_crypto_x509_method; + +// ssl_noop_x509_method provides the |SSL_X509_METHOD| functions that avoid +// crypto/x509. +extern const SSL_X509_METHOD ssl_noop_x509_method; + +struct TicketKey { + static constexpr bool kAllowUniquePtr = true; + + uint8_t name[SSL_TICKET_KEY_NAME_LEN] = {0}; + uint8_t hmac_key[16] = {0}; + uint8_t aes_key[16] = {0}; + // next_rotation_tv_sec is the time (in seconds from the epoch) when the + // current key should be superseded by a new key, or the time when a previous + // key should be dropped. If zero, then the key should not be automatically + // rotated. + uint64_t next_rotation_tv_sec = 0; +}; + +struct CertCompressionAlg { + static constexpr bool kAllowUniquePtr = true; + + ssl_cert_compression_func_t compress = nullptr; + ssl_cert_decompression_func_t decompress = nullptr; + uint16_t alg_id = 0; +}; + +BSSL_NAMESPACE_END + +DEFINE_LHASH_OF(SSL_SESSION) + +BSSL_NAMESPACE_BEGIN + +// An ssl_shutdown_t describes the shutdown state of one end of the connection, +// whether it is alive or has been shutdown via close_notify or fatal alert. +enum ssl_shutdown_t { + ssl_shutdown_none = 0, + ssl_shutdown_close_notify = 1, + ssl_shutdown_error = 2, +}; + +struct SSL3_STATE { + static constexpr bool kAllowUniquePtr = true; + + SSL3_STATE(); + ~SSL3_STATE(); + + uint8_t read_sequence[8] = {0}; + uint8_t write_sequence[8] = {0}; + + uint8_t server_random[SSL3_RANDOM_SIZE] = {0}; + uint8_t client_random[SSL3_RANDOM_SIZE] = {0}; + + // read_buffer holds data from the transport to be processed. + SSLBuffer read_buffer; + // write_buffer holds data to be written to the transport. + SSLBuffer write_buffer; + + // pending_app_data is the unconsumed application data. It points into + // |read_buffer|. + Span pending_app_data; + + // partial write - check the numbers match + unsigned int wnum = 0; // number of bytes sent so far + int wpend_tot = 0; // number bytes written + int wpend_type = 0; + int wpend_ret = 0; // number of bytes submitted + const uint8_t *wpend_buf = nullptr; + + // read_shutdown is the shutdown state for the read half of the connection. + enum ssl_shutdown_t read_shutdown = ssl_shutdown_none; + + // write_shutdown is the shutdown state for the write half of the connection. + enum ssl_shutdown_t write_shutdown = ssl_shutdown_none; + + // read_error, if |read_shutdown| is |ssl_shutdown_error|, is the error for + // the receive half of the connection. + UniquePtr read_error; + + int total_renegotiations = 0; + + // This holds a variable that indicates what we were doing when a 0 or -1 is + // returned. This is needed for non-blocking IO so we know what request + // needs re-doing when in SSL_accept or SSL_connect + int rwstate = SSL_ERROR_NONE; + + enum ssl_encryption_level_t read_level = ssl_encryption_initial; + enum ssl_encryption_level_t write_level = ssl_encryption_initial; + + // early_data_skipped is the amount of early data that has been skipped by the + // record layer. + uint16_t early_data_skipped = 0; + + // empty_record_count is the number of consecutive empty records received. + uint8_t empty_record_count = 0; + + // warning_alert_count is the number of consecutive warning alerts + // received. + uint8_t warning_alert_count = 0; + + // key_update_count is the number of consecutive KeyUpdates received. + uint8_t key_update_count = 0; + + // The negotiated Token Binding key parameter. Only valid if + // |token_binding_negotiated| is set. + uint8_t negotiated_token_binding_param = 0; + + // skip_early_data instructs the record layer to skip unexpected early data + // messages when 0RTT is rejected. + bool skip_early_data : 1; + + // have_version is true if the connection's final version is known. Otherwise + // the version has not been negotiated yet. + bool have_version : 1; + + // v2_hello_done is true if the peer's V2ClientHello, if any, has been handled + // and future messages should use the record layer. + bool v2_hello_done : 1; + + // is_v2_hello is true if the current handshake message was derived from a + // V2ClientHello rather than received from the peer directly. + bool is_v2_hello : 1; + + // has_message is true if the current handshake message has been returned + // at least once by |get_message| and false otherwise. + bool has_message : 1; + + // initial_handshake_complete is true if the initial handshake has + // completed. + bool initial_handshake_complete : 1; + + // session_reused indicates whether a session was resumed. + bool session_reused : 1; + + // delegated_credential_used is whether we presented a delegated credential to + // the peer. + bool delegated_credential_used : 1; + + bool send_connection_binding : 1; + + // In a client, this means that the server supported Channel ID and that a + // Channel ID was sent. In a server it means that we echoed support for + // Channel IDs and that |channel_id| will be valid after the handshake. + bool channel_id_valid : 1; + + // key_update_pending is true if we have a KeyUpdate acknowledgment + // outstanding. + bool key_update_pending : 1; + + // wpend_pending is true if we have a pending write outstanding. + bool wpend_pending : 1; + + // early_data_accepted is true if early data was accepted by the server. + bool early_data_accepted : 1; + + // tls13_downgrade is whether the TLS 1.3 anti-downgrade logic fired. + bool tls13_downgrade : 1; + + // token_binding_negotiated is set if Token Binding was negotiated. + bool token_binding_negotiated : 1; + + // alert_dispatch is true there is an alert in |send_alert| to be sent. + bool alert_dispatch : 1; + + // renegotiate_pending is whether the read half of the channel is blocked on a + // HelloRequest. + bool renegotiate_pending : 1; + + // used_hello_retry_request is whether the handshake used a TLS 1.3 + // HelloRetryRequest message. + bool used_hello_retry_request : 1; + + // hs_buf is the buffer of handshake data to process. + UniquePtr hs_buf; + + // pending_hs_data contains the pending handshake data that has not yet + // been encrypted to |pending_flight|. This allows packing the handshake into + // fewer records. + UniquePtr pending_hs_data; + + // pending_flight is the pending outgoing flight. This is used to flush each + // handshake flight in a single write. |write_buffer| must be written out + // before this data. + UniquePtr pending_flight; + + // pending_flight_offset is the number of bytes of |pending_flight| which have + // been successfully written. + uint32_t pending_flight_offset = 0; + + // ticket_age_skew is the difference, in seconds, between the client-sent + // ticket age and the server-computed value in TLS 1.3 server connections + // which resumed a session. + int32_t ticket_age_skew = 0; + + // ssl_early_data_reason stores details on why 0-RTT was accepted or rejected. + enum ssl_early_data_reason_t early_data_reason = ssl_early_data_unknown; + + // aead_read_ctx is the current read cipher state. + UniquePtr aead_read_ctx; + + // aead_write_ctx is the current write cipher state. + UniquePtr aead_write_ctx; + + // hs is the handshake state for the current handshake or NULL if there isn't + // one. + UniquePtr hs; + + uint8_t write_traffic_secret[SSL_MAX_MD_SIZE] = {0}; + uint8_t read_traffic_secret[SSL_MAX_MD_SIZE] = {0}; + uint8_t exporter_secret[SSL_MAX_MD_SIZE] = {0}; + uint8_t write_traffic_secret_len = 0; + uint8_t read_traffic_secret_len = 0; + uint8_t exporter_secret_len = 0; + + // Connection binding to prevent renegotiation attacks + uint8_t previous_client_finished[12] = {0}; + uint8_t previous_client_finished_len = 0; + uint8_t previous_server_finished_len = 0; + uint8_t previous_server_finished[12] = {0}; + + uint8_t send_alert[2] = {0}; + + // established_session is the session established by the connection. This + // session is only filled upon the completion of the handshake and is + // immutable. + UniquePtr established_session; + + // Next protocol negotiation. For the client, this is the protocol that we + // sent in NextProtocol and is set when handling ServerHello extensions. + // + // For a server, this is the client's selected_protocol from NextProtocol and + // is set when handling the NextProtocol message, before the Finished + // message. + Array next_proto_negotiated; + + // ALPN information + // (we are in the process of transitioning from NPN to ALPN.) + + // In a server these point to the selected ALPN protocol after the + // ClientHello has been processed. In a client these contain the protocol + // that the server selected once the ServerHello has been processed. + Array alpn_selected; + + // hostname, on the server, is the value of the SNI extension. + UniquePtr hostname; + + // For a server: + // If |channel_id_valid| is true, then this contains the + // verified Channel ID from the client: a P256 point, (x,y), where + // each are big-endian values. + uint8_t channel_id[64] = {0}; + + // Contains the QUIC transport params received by the peer. + Array peer_quic_transport_params; + + // srtp_profile is the selected SRTP protection profile for + // DTLS-SRTP. + const SRTP_PROTECTION_PROFILE *srtp_profile = nullptr; +}; + +// lengths of messages +#define DTLS1_COOKIE_LENGTH 256 + +#define DTLS1_RT_HEADER_LENGTH 13 + +#define DTLS1_HM_HEADER_LENGTH 12 + +#define DTLS1_CCS_HEADER_LENGTH 1 + +#define DTLS1_AL_HEADER_LENGTH 2 + +struct hm_header_st { + uint8_t type; + uint32_t msg_len; + uint16_t seq; + uint32_t frag_off; + uint32_t frag_len; +}; + +// An hm_fragment is an incoming DTLS message, possibly not yet assembled. +struct hm_fragment { + static constexpr bool kAllowUniquePtr = true; + + hm_fragment() {} + hm_fragment(const hm_fragment &) = delete; + hm_fragment &operator=(const hm_fragment &) = delete; + + ~hm_fragment(); + + // type is the type of the message. + uint8_t type = 0; + // seq is the sequence number of this message. + uint16_t seq = 0; + // msg_len is the length of the message body. + uint32_t msg_len = 0; + // data is a pointer to the message, including message header. It has length + // |DTLS1_HM_HEADER_LENGTH| + |msg_len|. + uint8_t *data = nullptr; + // reassembly is a bitmask of |msg_len| bits corresponding to which parts of + // the message have been received. It is NULL if the message is complete. + uint8_t *reassembly = nullptr; +}; + +struct OPENSSL_timeval { + uint64_t tv_sec; + uint32_t tv_usec; +}; + +struct DTLS1_STATE { + static constexpr bool kAllowUniquePtr = true; + + DTLS1_STATE(); + ~DTLS1_STATE(); + + // has_change_cipher_spec is true if we have received a ChangeCipherSpec from + // the peer in this epoch. + bool has_change_cipher_spec : 1; + + // outgoing_messages_complete is true if |outgoing_messages| has been + // completed by an attempt to flush it. Future calls to |add_message| and + // |add_change_cipher_spec| will start a new flight. + bool outgoing_messages_complete : 1; + + // flight_has_reply is true if the current outgoing flight is complete and has + // processed at least one message. This is used to detect whether we or the + // peer sent the final flight. + bool flight_has_reply : 1; + + uint8_t cookie[DTLS1_COOKIE_LENGTH] = {0}; + size_t cookie_len = 0; + + // The current data and handshake epoch. This is initially undefined, and + // starts at zero once the initial handshake is completed. + uint16_t r_epoch = 0; + uint16_t w_epoch = 0; + + // records being received in the current epoch + DTLS1_BITMAP bitmap; + + uint16_t handshake_write_seq = 0; + uint16_t handshake_read_seq = 0; + + // save last sequence number for retransmissions + uint8_t last_write_sequence[8] = {0}; + UniquePtr last_aead_write_ctx; + + // incoming_messages is a ring buffer of incoming handshake messages that have + // yet to be processed. The front of the ring buffer is message number + // |handshake_read_seq|, at position |handshake_read_seq| % + // |SSL_MAX_HANDSHAKE_FLIGHT|. + UniquePtr incoming_messages[SSL_MAX_HANDSHAKE_FLIGHT]; + + // outgoing_messages is the queue of outgoing messages from the last handshake + // flight. + DTLS_OUTGOING_MESSAGE outgoing_messages[SSL_MAX_HANDSHAKE_FLIGHT]; + uint8_t outgoing_messages_len = 0; + + // outgoing_written is the number of outgoing messages that have been + // written. + uint8_t outgoing_written = 0; + // outgoing_offset is the number of bytes of the next outgoing message have + // been written. + uint32_t outgoing_offset = 0; + + unsigned mtu = 0; // max DTLS packet size + + // num_timeouts is the number of times the retransmit timer has fired since + // the last time it was reset. + unsigned num_timeouts = 0; + + // Indicates when the last handshake msg or heartbeat sent will + // timeout. + struct OPENSSL_timeval next_timeout = {0, 0}; + + // timeout_duration_ms is the timeout duration in milliseconds. + unsigned timeout_duration_ms = 0; +}; + +// SSL_CONFIG contains configuration bits that can be shed after the handshake +// completes. Objects of this type are not shared; they are unique to a +// particular |SSL|. +// +// See SSL_shed_handshake_config() for more about the conditions under which +// configuration can be shed. +struct SSL_CONFIG { + static constexpr bool kAllowUniquePtr = true; + + explicit SSL_CONFIG(SSL *ssl_arg); + ~SSL_CONFIG(); + + // ssl is a non-owning pointer to the parent |SSL| object. + SSL *const ssl = nullptr; + + // conf_max_version is the maximum acceptable version configured by + // |SSL_set_max_proto_version|. Note this version is not normalized in DTLS + // and is further constrained by |SSL_OP_NO_*|. + uint16_t conf_max_version = 0; + + // conf_min_version is the minimum acceptable version configured by + // |SSL_set_min_proto_version|. Note this version is not normalized in DTLS + // and is further constrained by |SSL_OP_NO_*|. + uint16_t conf_min_version = 0; + + X509_VERIFY_PARAM *param = nullptr; + + // crypto + UniquePtr cipher_list; + + // This is used to hold the local certificate used (i.e. the server + // certificate for a server or the client certificate for a client). + UniquePtr cert; + + int (*verify_callback)(int ok, + X509_STORE_CTX *ctx) = + nullptr; // fail if callback returns 0 + + enum ssl_verify_result_t (*custom_verify_callback)( + SSL *ssl, uint8_t *out_alert) = nullptr; + // Server-only: psk_identity_hint is the identity hint to send in + // PSK-based key exchanges. + UniquePtr psk_identity_hint; + + unsigned (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len) = nullptr; + unsigned (*psk_server_callback)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len) = nullptr; + + // for server side, keep the list of CA_dn we can use + UniquePtr client_CA; + + // cached_x509_client_CA is a cache of parsed versions of the elements of + // |client_CA|. + STACK_OF(X509_NAME) *cached_x509_client_CA = nullptr; + + Array supported_group_list; // our list + + // The client's Channel ID private key. + UniquePtr channel_id_private; + + // For a client, this contains the list of supported protocols in wire + // format. + Array alpn_client_proto_list; + + // Contains a list of supported Token Binding key parameters. + Array token_binding_params; + + // Contains the QUIC transport params that this endpoint will send. + Array quic_transport_params; + + // verify_sigalgs, if not empty, is the set of signature algorithms + // accepted from the peer in decreasing order of preference. + Array verify_sigalgs; + + // srtp_profiles is the list of configured SRTP protection profiles for + // DTLS-SRTP. + UniquePtr srtp_profiles; + + // verify_mode is a bitmask of |SSL_VERIFY_*| values. + uint8_t verify_mode = SSL_VERIFY_NONE; + + // Enable signed certificate time stamps. Currently client only. + bool signed_cert_timestamps_enabled : 1; + + // ocsp_stapling_enabled is only used by client connections and indicates + // whether OCSP stapling will be requested. + bool ocsp_stapling_enabled : 1; + + // channel_id_enabled is copied from the |SSL_CTX|. For a server, means that + // we'll accept Channel IDs from clients. For a client, means that we'll + // advertise support. + bool channel_id_enabled : 1; + + // If enforce_rsa_key_usage is true, the handshake will fail if the + // keyUsage extension is present and incompatible with the TLS usage. + // This field is not read until after certificate verification. + bool enforce_rsa_key_usage : 1; + + // retain_only_sha256_of_client_certs is true if we should compute the SHA256 + // hash of the peer's certificate and then discard it to save memory and + // session space. Only effective on the server side. + bool retain_only_sha256_of_client_certs : 1; + + // handoff indicates that a server should stop after receiving the + // ClientHello and pause the handshake in such a way that |SSL_get_error| + // returns |SSL_ERROR_HANDOFF|. This is copied in |SSL_new| from the |SSL_CTX| + // element of the same name and may be cleared if the handoff is declined. + bool handoff : 1; + + // shed_handshake_config indicates that the handshake config (this object!) + // should be freed after the handshake completes. + bool shed_handshake_config : 1; + + // ignore_tls13_downgrade is whether the connection should continue when the + // server random signals a downgrade. + bool ignore_tls13_downgrade : 1; + + // jdk11_workaround is whether to disable TLS 1.3 for JDK 11 clients, as a + // workaround for https://bugs.openjdk.java.net/browse/JDK-8211806. + bool jdk11_workaround : 1; +}; + +// From RFC 8446, used in determining PSK modes. +#define SSL_PSK_DHE_KE 0x1 + +// kMaxEarlyDataAccepted is the advertised number of plaintext bytes of early +// data that will be accepted. This value should be slightly below +// kMaxEarlyDataSkipped in tls_record.c, which is measured in ciphertext. +static const size_t kMaxEarlyDataAccepted = 14336; + +UniquePtr ssl_cert_dup(CERT *cert); +void ssl_cert_clear_certs(CERT *cert); +bool ssl_set_cert(CERT *cert, UniquePtr buffer); +bool ssl_is_key_type_supported(int key_type); +// ssl_compare_public_and_private_key returns true if |pubkey| is the public +// counterpart to |privkey|. Otherwise it returns false and pushes a helpful +// message on the error queue. +bool ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, + const EVP_PKEY *privkey); +bool ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey); +int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server); +int ssl_encrypt_ticket(SSL_HANDSHAKE *hs, CBB *out, const SSL_SESSION *session); +int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx); + +// ssl_session_new returns a newly-allocated blank |SSL_SESSION| or nullptr on +// error. +UniquePtr ssl_session_new(const SSL_X509_METHOD *x509_method); + +// ssl_hash_session_id returns a hash of |session_id|, suitable for a hash table +// keyed on session IDs. +uint32_t ssl_hash_session_id(Span session_id); + +// SSL_SESSION_parse parses an |SSL_SESSION| from |cbs| and advances |cbs| over +// the parsed data. +OPENSSL_EXPORT UniquePtr SSL_SESSION_parse( + CBS *cbs, const SSL_X509_METHOD *x509_method, CRYPTO_BUFFER_POOL *pool); + +// ssl_session_serialize writes |in| to |cbb| as if it were serialising a +// session for Session-ID resumption. It returns one on success and zero on +// error. +OPENSSL_EXPORT int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb); + +// ssl_session_is_context_valid returns one if |session|'s session ID context +// matches the one set on |hs| and zero otherwise. +int ssl_session_is_context_valid(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session); + +// ssl_session_is_time_valid returns one if |session| is still valid and zero if +// it has expired. +int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session); + +// ssl_session_is_resumable returns one if |session| is resumable for |hs| and +// zero otherwise. +int ssl_session_is_resumable(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session); + +// ssl_session_protocol_version returns the protocol version associated with +// |session|. Note that despite the name, this is not the same as +// |SSL_SESSION_get_protocol_version|. The latter is based on upstream's name. +uint16_t ssl_session_protocol_version(const SSL_SESSION *session); + +// ssl_session_get_digest returns the digest used in |session|. +const EVP_MD *ssl_session_get_digest(const SSL_SESSION *session); + +void ssl_set_session(SSL *ssl, SSL_SESSION *session); + +// ssl_get_prev_session looks up the previous session based on |client_hello|. +// On success, it sets |*out_session| to the session or nullptr if none was +// found. If the session could not be looked up synchronously, it returns +// |ssl_hs_pending_session| and should be called again. If a ticket could not be +// decrypted immediately it returns |ssl_hs_pending_ticket| and should also +// be called again. Otherwise, it returns |ssl_hs_error|. +enum ssl_hs_wait_t ssl_get_prev_session(SSL_HANDSHAKE *hs, + UniquePtr *out_session, + bool *out_tickets_supported, + bool *out_renew_ticket, + const SSL_CLIENT_HELLO *client_hello); + +// The following flags determine which parts of the session are duplicated. +#define SSL_SESSION_DUP_AUTH_ONLY 0x0 +#define SSL_SESSION_INCLUDE_TICKET 0x1 +#define SSL_SESSION_INCLUDE_NONAUTH 0x2 +#define SSL_SESSION_DUP_ALL \ + (SSL_SESSION_INCLUDE_TICKET | SSL_SESSION_INCLUDE_NONAUTH) + +// SSL_SESSION_dup returns a newly-allocated |SSL_SESSION| with a copy of the +// fields in |session| or nullptr on error. The new session is non-resumable and +// must be explicitly marked resumable once it has been filled in. +OPENSSL_EXPORT UniquePtr SSL_SESSION_dup(SSL_SESSION *session, + int dup_flags); + +// ssl_session_rebase_time updates |session|'s start time to the current time, +// adjusting the timeout so the expiration time is unchanged. +void ssl_session_rebase_time(SSL *ssl, SSL_SESSION *session); + +// ssl_session_renew_timeout calls |ssl_session_rebase_time| and renews +// |session|'s timeout to |timeout| (measured from the current time). The +// renewal is clamped to the session's auth_timeout. +void ssl_session_renew_timeout(SSL *ssl, SSL_SESSION *session, + uint32_t timeout); + +void ssl_update_cache(SSL_HANDSHAKE *hs, int mode); + +void ssl_send_alert(SSL *ssl, int level, int desc); +int ssl_send_alert_impl(SSL *ssl, int level, int desc); +bool ssl3_get_message(const SSL *ssl, SSLMessage *out); +ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); +void ssl3_next_message(SSL *ssl); + +int ssl3_dispatch_alert(SSL *ssl); +ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); +ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); +int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, + int len); + +bool ssl3_new(SSL *ssl); +void ssl3_free(SSL *ssl); + +bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); +bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); +bool ssl3_add_message(SSL *ssl, Array msg); +bool ssl3_add_change_cipher_spec(SSL *ssl); +int ssl3_flush_flight(SSL *ssl); + +bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); +bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); +bool dtls1_add_message(SSL *ssl, Array msg); +bool dtls1_add_change_cipher_spec(SSL *ssl); +int dtls1_flush_flight(SSL *ssl); + +// ssl_add_message_cbb finishes the handshake message in |cbb| and adds it to +// the pending flight. It returns true on success and false on error. +bool ssl_add_message_cbb(SSL *ssl, CBB *cbb); + +// ssl_hash_message incorporates |msg| into the handshake hash. It returns true +// on success and false on allocation failure. +bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg); + +ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in); +ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in); + +int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake, + const uint8_t *buf, int len); + +// dtls1_write_record sends a record. It returns one on success and <= 0 on +// error. +int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len, + enum dtls1_use_epoch_t use_epoch); + +int dtls1_retransmit_outgoing_messages(SSL *ssl); +bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, + CBS *out_body); +bool dtls1_check_timeout_num(SSL *ssl); + +void dtls1_start_timer(SSL *ssl); +void dtls1_stop_timer(SSL *ssl); +bool dtls1_is_timer_expired(SSL *ssl); +unsigned int dtls1_min_mtu(void); + +bool dtls1_new(SSL *ssl); +void dtls1_free(SSL *ssl); + +bool dtls1_get_message(const SSL *ssl, SSLMessage *out); +ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in); +void dtls1_next_message(SSL *ssl); +int dtls1_dispatch_alert(SSL *ssl); + +// tls1_configure_aead configures either the read or write direction AEAD (as +// determined by |direction|) using the keys generated by the TLS KDF. The +// |key_block_cache| argument is used to store the generated key block, if +// empty. Otherwise it's assumed that the key block is already contained within +// it. Returns one on success or zero on error. +int tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction, + Array *key_block_cache, + const SSL_CIPHER *cipher, + Span iv_override); + +int tls1_change_cipher_state(SSL_HANDSHAKE *hs, evp_aead_direction_t direction); +int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, + Span premaster); + +// tls1_get_grouplist returns the locally-configured group preference list. +Span tls1_get_grouplist(const SSL_HANDSHAKE *ssl); + +// tls1_check_group_id returns whether |group_id| is consistent with locally- +// configured group preferences. +bool tls1_check_group_id(const SSL_HANDSHAKE *ssl, uint16_t group_id); + +// tls1_get_shared_group sets |*out_group_id| to the first preferred shared +// group between client and server preferences and returns true. If none may be +// found, it returns false. +bool tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id); + +// tls1_set_curves converts the array of NIDs in |curves| into a newly allocated +// array of TLS group IDs. On success, the function returns true and writes the +// array to |*out_group_ids|. Otherwise, it returns false. +bool tls1_set_curves(Array *out_group_ids, Span curves); + +// tls1_set_curves_list converts the string of curves pointed to by |curves| +// into a newly allocated array of TLS group IDs. On success, the function +// returns true and writes the array to |*out_group_ids|. Otherwise, it returns +// false. +bool tls1_set_curves_list(Array *out_group_ids, const char *curves); + +// ssl_add_clienthello_tlsext writes ClientHello extensions to |out|. It returns +// true on success and false on failure. The |header_len| argument is the length +// of the ClientHello written so far and is used to compute the padding length. +// (It does not include the record header.) +bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len); + +bool ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out); +bool ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, + const SSL_CLIENT_HELLO *client_hello); +bool ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs); + +#define tlsext_tick_md EVP_sha256 + +// ssl_process_ticket processes a session ticket from the client. It returns +// one of: +// |ssl_ticket_aead_success|: |*out_session| is set to the parsed session and +// |*out_renew_ticket| is set to whether the ticket should be renewed. +// |ssl_ticket_aead_ignore_ticket|: |*out_renew_ticket| is set to whether a +// fresh ticket should be sent, but the given ticket cannot be used. +// |ssl_ticket_aead_retry|: the ticket could not be immediately decrypted. +// Retry later. +// |ssl_ticket_aead_error|: an error occured that is fatal to the connection. +enum ssl_ticket_aead_result_t ssl_process_ticket( + SSL_HANDSHAKE *hs, UniquePtr *out_session, + bool *out_renew_ticket, Span ticket, + Span session_id); + +// tls1_verify_channel_id processes |msg| as a Channel ID message, and verifies +// the signature. If the key is valid, it saves the Channel ID and returns true. +// Otherwise, it returns false. +bool tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg); + +// tls1_write_channel_id generates a Channel ID message and puts the output in +// |cbb|. |ssl->channel_id_private| must already be set before calling. This +// function returns true on success and false on error. +bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb); + +// tls1_channel_id_hash computes the hash to be signed by Channel ID and writes +// it to |out|, which must contain at least |EVP_MAX_MD_SIZE| bytes. It returns +// true on success and false on failure. +bool tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len); + +// tls1_record_handshake_hashes_for_channel_id records the current handshake +// hashes in |hs->new_session| so that Channel ID resumptions can sign that +// data. +bool tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs); + +// ssl_do_channel_id_callback checks runs |hs->ssl->ctx->channel_id_cb| if +// necessary. It returns true on success and false on fatal error. Note that, on +// success, |hs->ssl->channel_id_private| may be unset, in which case the +// operation should be retried later. +bool ssl_do_channel_id_callback(SSL_HANDSHAKE *hs); + +// ssl_can_write returns whether |ssl| is allowed to write. +bool ssl_can_write(const SSL *ssl); + +// ssl_can_read returns wheter |ssl| is allowed to read. +bool ssl_can_read(const SSL *ssl); + +void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock); +void ssl_ctx_get_current_time(const SSL_CTX *ctx, + struct OPENSSL_timeval *out_clock); + +// ssl_reset_error_state resets state for |SSL_get_error|. +void ssl_reset_error_state(SSL *ssl); + +// ssl_set_read_error sets |ssl|'s read half into an error state, saving the +// current state of the error queue. +void ssl_set_read_error(SSL *ssl); + +BSSL_NAMESPACE_END + + +// Opaque C types. +// +// The following types are exported to C code as public typedefs, so they must +// be defined outside of the namespace. + +// ssl_method_st backs the public |SSL_METHOD| type. It is a compatibility +// structure to support the legacy version-locked methods. +struct ssl_method_st { + // version, if non-zero, is the only protocol version acceptable to an + // SSL_CTX initialized from this method. + uint16_t version; + // method is the underlying SSL_PROTOCOL_METHOD that initializes the + // SSL_CTX. + const bssl::SSL_PROTOCOL_METHOD *method; + // x509_method contains pointers to functions that might deal with |X509| + // compatibility, or might be a no-op, depending on the application. + const bssl::SSL_X509_METHOD *x509_method; +}; + +struct ssl_ctx_st { + explicit ssl_ctx_st(const SSL_METHOD *ssl_method); + ssl_ctx_st(const ssl_ctx_st &) = delete; + ssl_ctx_st &operator=(const ssl_ctx_st &) = delete; + + const bssl::SSL_PROTOCOL_METHOD *method = nullptr; + const bssl::SSL_X509_METHOD *x509_method = nullptr; + + // lock is used to protect various operations on this object. + CRYPTO_MUTEX lock; + + // conf_max_version is the maximum acceptable protocol version configured by + // |SSL_CTX_set_max_proto_version|. Note this version is normalized in DTLS + // and is further constrainted by |SSL_OP_NO_*|. + uint16_t conf_max_version = 0; + + // conf_min_version is the minimum acceptable protocol version configured by + // |SSL_CTX_set_min_proto_version|. Note this version is normalized in DTLS + // and is further constrainted by |SSL_OP_NO_*|. + uint16_t conf_min_version = 0; + + // quic_method is the method table corresponding to the QUIC hooks. + const SSL_QUIC_METHOD *quic_method = nullptr; + + bssl::UniquePtr cipher_list; + + X509_STORE *cert_store = nullptr; + LHASH_OF(SSL_SESSION) *sessions = nullptr; + // Most session-ids that will be cached, default is + // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. + unsigned long session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT; + SSL_SESSION *session_cache_head = nullptr; + SSL_SESSION *session_cache_tail = nullptr; + + // handshakes_since_cache_flush is the number of successful handshakes since + // the last cache flush. + int handshakes_since_cache_flush = 0; + + // This can have one of 2 values, ored together, + // SSL_SESS_CACHE_CLIENT, + // SSL_SESS_CACHE_SERVER, + // Default is SSL_SESSION_CACHE_SERVER, which means only + // SSL_accept which cache SSL_SESSIONS. + int session_cache_mode = SSL_SESS_CACHE_SERVER; + + // session_timeout is the default lifetime for new sessions in TLS 1.2 and + // earlier, in seconds. + uint32_t session_timeout = SSL_DEFAULT_SESSION_TIMEOUT; + + // session_psk_dhe_timeout is the default lifetime for new sessions in TLS + // 1.3, in seconds. + uint32_t session_psk_dhe_timeout = SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT; + + // If this callback is not null, it will be called each time a session id is + // added to the cache. If this function returns 1, it means that the + // callback will do a SSL_SESSION_free() when it has finished using it. + // Otherwise, on 0, it means the callback has finished with it. If + // remove_session_cb is not null, it will be called when a session-id is + // removed from the cache. After the call, OpenSSL will SSL_SESSION_free() + // it. + int (*new_session_cb)(SSL *ssl, SSL_SESSION *sess) = nullptr; + void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess) = nullptr; + SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, + int *copy) = nullptr; + + CRYPTO_refcount_t references = 1; + + // if defined, these override the X509_verify_cert() calls + int (*app_verify_callback)(X509_STORE_CTX *store_ctx, void *arg) = nullptr; + void *app_verify_arg = nullptr; + + ssl_verify_result_t (*custom_verify_callback)(SSL *ssl, + uint8_t *out_alert) = nullptr; + + // Default password callback. + pem_password_cb *default_passwd_callback = nullptr; + + // Default password callback user data. + void *default_passwd_callback_userdata = nullptr; + + // get client cert callback + int (*client_cert_cb)(SSL *ssl, X509 **out_x509, + EVP_PKEY **out_pkey) = nullptr; + + // get channel id callback + void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey) = nullptr; + + CRYPTO_EX_DATA ex_data; + + // Default values used when no per-SSL value is defined follow + + void (*info_callback)(const SSL *ssl, int type, int value) = nullptr; + + // what we put in client cert requests + bssl::UniquePtr client_CA; + + // cached_x509_client_CA is a cache of parsed versions of the elements of + // |client_CA|. + STACK_OF(X509_NAME) *cached_x509_client_CA = nullptr; + + + // Default values to use in SSL structures follow (these are copied by + // SSL_new) + + uint32_t options = 0; + // Disable the auto-chaining feature by default. wpa_supplicant relies on this + // feature, but require callers opt into it. + uint32_t mode = SSL_MODE_NO_AUTO_CHAIN; + uint32_t max_cert_list = SSL_MAX_CERT_LIST_DEFAULT; + + bssl::UniquePtr cert; + + // callback that allows applications to peek at protocol messages + void (*msg_callback)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, + void *arg) = nullptr; + void *msg_callback_arg = nullptr; + + int verify_mode = SSL_VERIFY_NONE; + int (*default_verify_callback)(int ok, X509_STORE_CTX *ctx) = + nullptr; // called 'verify_callback' in the SSL + + X509_VERIFY_PARAM *param = nullptr; + + // select_certificate_cb is called before most ClientHello processing and + // before the decision whether to resume a session is made. See + // |ssl_select_cert_result_t| for details of the return values. + ssl_select_cert_result_t (*select_certificate_cb)(const SSL_CLIENT_HELLO *) = + nullptr; + + // dos_protection_cb is called once the resumption decision for a ClientHello + // has been made. It returns one to continue the handshake or zero to + // abort. + int (*dos_protection_cb)(const SSL_CLIENT_HELLO *) = nullptr; + + // Controls whether to verify certificates when resuming connections. They + // were already verified when the connection was first made, so the default is + // false. For now, this is only respected on clients, not servers. + bool reverify_on_resume = false; + + // Maximum amount of data to send in one fragment. actual record size can be + // more than this due to padding and MAC overheads. + uint16_t max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; + + // TLS extensions servername callback + int (*servername_callback)(SSL *, int *, void *) = nullptr; + void *servername_arg = nullptr; + + // RFC 4507 session ticket keys. |ticket_key_current| may be NULL before the + // first handshake and |ticket_key_prev| may be NULL at any time. + // Automatically generated ticket keys are rotated as needed at handshake + // time. Hence, all access must be synchronized through |lock|. + bssl::UniquePtr ticket_key_current; + bssl::UniquePtr ticket_key_prev; + + // Callback to support customisation of ticket key setting + int (*ticket_key_cb)(SSL *ssl, uint8_t *name, uint8_t *iv, + EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc) = nullptr; + + // Server-only: psk_identity_hint is the default identity hint to send in + // PSK-based key exchanges. + bssl::UniquePtr psk_identity_hint; + + unsigned (*psk_client_callback)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len) = nullptr; + unsigned (*psk_server_callback)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len) = nullptr; + + + // Next protocol negotiation information + // (for experimental NPN extension). + + // For a server, this contains a callback function by which the set of + // advertised protocols can be provided. + int (*next_protos_advertised_cb)(SSL *ssl, const uint8_t **out, + unsigned *out_len, void *arg) = nullptr; + void *next_protos_advertised_cb_arg = nullptr; + // For a client, this contains a callback function that selects the + // next protocol from the list provided by the server. + int (*next_proto_select_cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, + void *arg) = nullptr; + void *next_proto_select_cb_arg = nullptr; + + // ALPN information + // (we are in the process of transitioning from NPN to ALPN.) + + // For a server, this contains a callback function that allows the + // server to select the protocol for the connection. + // out: on successful return, this must point to the raw protocol + // name (without the length prefix). + // outlen: on successful return, this contains the length of |*out|. + // in: points to the client's list of supported protocols in + // wire-format. + // inlen: the length of |in|. + int (*alpn_select_cb)(SSL *ssl, const uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, + void *arg) = nullptr; + void *alpn_select_cb_arg = nullptr; + + // For a client, this contains the list of supported protocols in wire + // format. + bssl::Array alpn_client_proto_list; + + // SRTP profiles we are willing to do from RFC 5764 + bssl::UniquePtr srtp_profiles; + + // Defined compression algorithms for certificates. + bssl::GrowableArray cert_compression_algs; + + // Supported group values inherited by SSL structure + bssl::Array supported_group_list; + + // The client's Channel ID private key. + bssl::UniquePtr channel_id_private; + + // keylog_callback, if not NULL, is the key logging callback. See + // |SSL_CTX_set_keylog_callback|. + void (*keylog_callback)(const SSL *ssl, const char *line) = nullptr; + + // current_time_cb, if not NULL, is the function to use to get the current + // time. It sets |*out_clock| to the current time. The |ssl| argument is + // always NULL. See |SSL_CTX_set_current_time_cb|. + void (*current_time_cb)(const SSL *ssl, struct timeval *out_clock) = nullptr; + + // pool is used for all |CRYPTO_BUFFER|s in case we wish to share certificate + // memory. + CRYPTO_BUFFER_POOL *pool = nullptr; + + // ticket_aead_method contains function pointers for opening and sealing + // session tickets. + const SSL_TICKET_AEAD_METHOD *ticket_aead_method = nullptr; + + // legacy_ocsp_callback implements an OCSP-related callback for OpenSSL + // compatibility. + int (*legacy_ocsp_callback)(SSL *ssl, void *arg) = nullptr; + void *legacy_ocsp_callback_arg = nullptr; + + // verify_sigalgs, if not empty, is the set of signature algorithms + // accepted from the peer in decreasing order of preference. + bssl::Array verify_sigalgs; + + // retain_only_sha256_of_client_certs is true if we should compute the SHA256 + // hash of the peer's certificate and then discard it to save memory and + // session space. Only effective on the server side. + bool retain_only_sha256_of_client_certs : 1; + + // quiet_shutdown is true if the connection should not send a close_notify on + // shutdown. + bool quiet_shutdown : 1; + + // ocsp_stapling_enabled is only used by client connections and indicates + // whether OCSP stapling will be requested. + bool ocsp_stapling_enabled : 1; + + // If true, a client will request certificate timestamps. + bool signed_cert_timestamps_enabled : 1; + + // channel_id_enabled is whether Channel ID is enabled. For a server, means + // that we'll accept Channel IDs from clients. For a client, means that we'll + // advertise support. + bool channel_id_enabled : 1; + + // grease_enabled is whether draft-davidben-tls-grease-01 is enabled. + bool grease_enabled : 1; + + // allow_unknown_alpn_protos is whether the client allows unsolicited ALPN + // protocols from the peer. + bool allow_unknown_alpn_protos : 1; + + // ed25519_enabled is whether Ed25519 is advertised in the handshake. + bool ed25519_enabled : 1; + + // false_start_allowed_without_alpn is whether False Start (if + // |SSL_MODE_ENABLE_FALSE_START| is enabled) is allowed without ALPN. + bool false_start_allowed_without_alpn : 1; + + // ignore_tls13_downgrade is whether a connection should continue when the + // server random signals a downgrade. + bool ignore_tls13_downgrade:1; + + // handoff indicates that a server should stop after receiving the + // ClientHello and pause the handshake in such a way that |SSL_get_error| + // returns |SSL_ERROR_HANDOFF|. + bool handoff : 1; + + // If enable_early_data is true, early data can be sent and accepted. + bool enable_early_data : 1; + + private: + ~ssl_ctx_st(); + friend void SSL_CTX_free(SSL_CTX *); +}; + +struct ssl_st { + explicit ssl_st(SSL_CTX *ctx_arg); + ssl_st(const ssl_st &) = delete; + ssl_st &operator=(const ssl_st &) = delete; + ~ssl_st(); + + // method is the method table corresponding to the current protocol (DTLS or + // TLS). + const bssl::SSL_PROTOCOL_METHOD *method = nullptr; + + // config is a container for handshake configuration. Accesses to this field + // should check for nullptr, since configuration may be shed after the + // handshake completes. (If you have the |SSL_HANDSHAKE| object at hand, use + // that instead, and skip the null check.) + bssl::UniquePtr config; + + // version is the protocol version. + uint16_t version = 0; + + uint16_t max_send_fragment = 0; + + // There are 2 BIO's even though they are normally both the same. This is so + // data can be read and written to different handlers + + bssl::UniquePtr rbio; // used by SSL_read + bssl::UniquePtr wbio; // used by SSL_write + + // do_handshake runs the handshake. On completion, it returns |ssl_hs_ok|. + // Otherwise, it returns a value corresponding to what operation is needed to + // progress. + bssl::ssl_hs_wait_t (*do_handshake)(bssl::SSL_HANDSHAKE *hs) = nullptr; + + bssl::SSL3_STATE *s3 = nullptr; // TLS variables + bssl::DTLS1_STATE *d1 = nullptr; // DTLS variables + + // callback that allows applications to peek at protocol messages + void (*msg_callback)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, + void *arg) = nullptr; + void *msg_callback_arg = nullptr; + + // session info + + // initial_timeout_duration_ms is the default DTLS timeout duration in + // milliseconds. It's used to initialize the timer any time it's restarted. + // + // RFC 6347 states that implementations SHOULD use an initial timer value of 1 + // second. + unsigned initial_timeout_duration_ms = 1000; + + // session is the configured session to be offered by the client. This session + // is immutable. + bssl::UniquePtr session; + + void (*info_callback)(const SSL *ssl, int type, int value) = nullptr; + + bssl::UniquePtr ctx; + + // session_ctx is the |SSL_CTX| used for the session cache and related + // settings. + bssl::UniquePtr session_ctx; + + // extra application data + CRYPTO_EX_DATA ex_data; + + uint32_t options = 0; // protocol behaviour + uint32_t mode = 0; // API behaviour + uint32_t max_cert_list = 0; + bssl::UniquePtr hostname; + + // quic_method is the method table corresponding to the QUIC hooks. + const SSL_QUIC_METHOD *quic_method = nullptr; + + // renegotiate_mode controls how peer renegotiation attempts are handled. + ssl_renegotiate_mode_t renegotiate_mode = ssl_renegotiate_never; + + // server is true iff the this SSL* is the server half. Note: before the SSL* + // is initialized by either SSL_set_accept_state or SSL_set_connect_state, + // the side is not determined. In this state, server is always false. + bool server : 1; + + // quiet_shutdown is true if the connection should not send a close_notify on + // shutdown. + bool quiet_shutdown : 1; + + // If enable_early_data is true, early data can be sent and accepted. + bool enable_early_data : 1; +}; + +struct ssl_session_st { + explicit ssl_session_st(const bssl::SSL_X509_METHOD *method); + ssl_session_st(const ssl_session_st &) = delete; + ssl_session_st &operator=(const ssl_session_st &) = delete; + + CRYPTO_refcount_t references = 1; + + // ssl_version is the (D)TLS version that established the session. + uint16_t ssl_version = 0; + + // group_id is the ID of the ECDH group used to establish this session or zero + // if not applicable or unknown. + uint16_t group_id = 0; + + // peer_signature_algorithm is the signature algorithm used to authenticate + // the peer, or zero if not applicable or unknown. + uint16_t peer_signature_algorithm = 0; + + // master_key, in TLS 1.2 and below, is the master secret associated with the + // session. In TLS 1.3 and up, it is the resumption secret. + int master_key_length = 0; + uint8_t master_key[SSL_MAX_MASTER_KEY_LENGTH] = {0}; + + // session_id - valid? + unsigned session_id_length = 0; + uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH] = {0}; + // this is used to determine whether the session is being reused in + // the appropriate context. It is up to the application to set this, + // via SSL_new + uint8_t sid_ctx_length = 0; + uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH] = {0}; + + bssl::UniquePtr psk_identity; + + // certs contains the certificate chain from the peer, starting with the leaf + // certificate. + bssl::UniquePtr certs; + + const bssl::SSL_X509_METHOD *x509_method = nullptr; + + // x509_peer is the peer's certificate. + X509 *x509_peer = nullptr; + + // x509_chain is the certificate chain sent by the peer. NOTE: for historical + // reasons, when a client (so the peer is a server), the chain includes + // |peer|, but when a server it does not. + STACK_OF(X509) *x509_chain = nullptr; + + // x509_chain_without_leaf is a lazily constructed copy of |x509_chain| that + // omits the leaf certificate. This exists because OpenSSL, historically, + // didn't include the leaf certificate in the chain for a server, but did for + // a client. The |x509_chain| always includes it and, if an API call requires + // a chain without, it is stored here. + STACK_OF(X509) *x509_chain_without_leaf = nullptr; + + // verify_result is the result of certificate verification in the case of + // non-fatal certificate errors. + long verify_result = X509_V_ERR_INVALID_CALL; + + // timeout is the lifetime of the session in seconds, measured from |time|. + // This is renewable up to |auth_timeout|. + uint32_t timeout = SSL_DEFAULT_SESSION_TIMEOUT; + + // auth_timeout is the non-renewable lifetime of the session in seconds, + // measured from |time|. + uint32_t auth_timeout = SSL_DEFAULT_SESSION_TIMEOUT; + + // time is the time the session was issued, measured in seconds from the UNIX + // epoch. + uint64_t time = 0; + + const SSL_CIPHER *cipher = nullptr; + + CRYPTO_EX_DATA ex_data; // application specific data + + // These are used to make removal of session-ids more efficient and to + // implement a maximum cache size. + SSL_SESSION *prev = nullptr, *next = nullptr; + + bssl::Array ticket; + + bssl::UniquePtr signed_cert_timestamp_list; + + // The OCSP response that came with the session. + bssl::UniquePtr ocsp_response; + + // peer_sha256 contains the SHA-256 hash of the peer's certificate if + // |peer_sha256_valid| is true. + uint8_t peer_sha256[SHA256_DIGEST_LENGTH] = {0}; + + // original_handshake_hash contains the handshake hash (either SHA-1+MD5 or + // SHA-2, depending on TLS version) for the original, full handshake that + // created a session. This is used by Channel IDs during resumption. + uint8_t original_handshake_hash[EVP_MAX_MD_SIZE] = {0}; + uint8_t original_handshake_hash_len = 0; + + uint32_t ticket_lifetime_hint = 0; // Session lifetime hint in seconds + + uint32_t ticket_age_add = 0; + + // ticket_max_early_data is the maximum amount of data allowed to be sent as + // early data. If zero, 0-RTT is disallowed. + uint32_t ticket_max_early_data = 0; + + // early_alpn is the ALPN protocol from the initial handshake. This is only + // stored for TLS 1.3 and above in order to enforce ALPN matching for 0-RTT + // resumptions. + bssl::Array early_alpn; + + // extended_master_secret is whether the master secret in this session was + // generated using EMS and thus isn't vulnerable to the Triple Handshake + // attack. + bool extended_master_secret : 1; + + // peer_sha256_valid is whether |peer_sha256| is valid. + bool peer_sha256_valid : 1; // Non-zero if peer_sha256 is valid + + // not_resumable is used to indicate that session resumption is disallowed. + bool not_resumable : 1; + + // ticket_age_add_valid is whether |ticket_age_add| is valid. + bool ticket_age_add_valid : 1; + + // is_server is whether this session was created by a server. + bool is_server : 1; + + private: + ~ssl_session_st(); + friend void SSL_SESSION_free(SSL_SESSION *); +}; + + +#endif // OPENSSL_HEADER_SSL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/ssl/s3_both.cc b/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/s3_both.cc rename to Pods/BoringSSL-GRPC/src/ssl/s3_both.cc index 8c4ed7015..4f97461f8 100644 --- a/Pods/BoringSSL-GRPC/ssl/s3_both.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc @@ -116,6 +116,8 @@ #include #include +#include + #include #include #include @@ -130,10 +132,12 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN static bool add_record_to_flight(SSL *ssl, uint8_t type, Span in) { + // The caller should have flushed |pending_hs_data| first. + assert(!ssl->s3->pending_hs_data); // We'll never add a flight while in the process of writing it out. assert(ssl->s3->pending_flight_offset == 0); @@ -182,17 +186,50 @@ bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg) { } bool ssl3_add_message(SSL *ssl, Array msg) { - // Add the message to the current flight, splitting into several records if - // needed. + // Pack handshake data into the minimal number of records. This avoids + // unnecessary encryption overhead, notably in TLS 1.3 where we send several + // encrypted messages in a row. For now, we do not do this for the null + // cipher. The benefit is smaller and there is a risk of breaking buggy + // implementations. + // + // TODO(davidben): See if we can do this uniformly. Span rest = msg; - do { - Span chunk = rest.subspan(0, ssl->max_send_fragment); - rest = rest.subspan(chunk.size()); + if (ssl->quic_method == nullptr && + ssl->s3->aead_write_ctx->is_null_cipher()) { + while (!rest.empty()) { + Span chunk = rest.subspan(0, ssl->max_send_fragment); + rest = rest.subspan(chunk.size()); + + if (!add_record_to_flight(ssl, SSL3_RT_HANDSHAKE, chunk)) { + return false; + } + } + } else { + while (!rest.empty()) { + // Flush if |pending_hs_data| is full. + if (ssl->s3->pending_hs_data && + ssl->s3->pending_hs_data->length >= ssl->max_send_fragment && + !tls_flush_pending_hs_data(ssl)) { + return false; + } - if (!add_record_to_flight(ssl, SSL3_RT_HANDSHAKE, chunk)) { - return false; + size_t pending_len = + ssl->s3->pending_hs_data ? ssl->s3->pending_hs_data->length : 0; + Span chunk = + rest.subspan(0, ssl->max_send_fragment - pending_len); + assert(!chunk.empty()); + rest = rest.subspan(chunk.size()); + + if (!ssl->s3->pending_hs_data) { + ssl->s3->pending_hs_data.reset(BUF_MEM_new()); + } + if (!ssl->s3->pending_hs_data || + !BUF_MEM_append(ssl->s3->pending_hs_data.get(), chunk.data(), + chunk.size())) { + return false; + } } - } while (!rest.empty()); + } ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HANDSHAKE, msg); // TODO(svaldez): Move this up a layer to fix abstraction for SSLTranscript on @@ -204,10 +241,36 @@ bool ssl3_add_message(SSL *ssl, Array msg) { return true; } +bool tls_flush_pending_hs_data(SSL *ssl) { + if (!ssl->s3->pending_hs_data || ssl->s3->pending_hs_data->length == 0) { + return true; + } + + UniquePtr pending_hs_data = std::move(ssl->s3->pending_hs_data); + auto data = + MakeConstSpan(reinterpret_cast(pending_hs_data->data), + pending_hs_data->length); + if (ssl->quic_method) { + if (!ssl->quic_method->add_handshake_data(ssl, ssl->s3->write_level, + data.data(), data.size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return false; + } + return true; + } + + return add_record_to_flight(ssl, SSL3_RT_HANDSHAKE, data); +} + bool ssl3_add_change_cipher_spec(SSL *ssl) { static const uint8_t kChangeCipherSpec[1] = {SSL3_MT_CCS}; - if (!add_record_to_flight(ssl, SSL3_RT_CHANGE_CIPHER_SPEC, + if (!tls_flush_pending_hs_data(ssl)) { + return false; + } + + if (!ssl->quic_method && + !add_record_to_flight(ssl, SSL3_RT_CHANGE_CIPHER_SPEC, kChangeCipherSpec)) { return false; } @@ -217,18 +280,23 @@ bool ssl3_add_change_cipher_spec(SSL *ssl) { return true; } -bool ssl3_add_alert(SSL *ssl, uint8_t level, uint8_t desc) { - uint8_t alert[2] = {level, desc}; - if (!add_record_to_flight(ssl, SSL3_RT_ALERT, alert)) { - return false; +int ssl3_flush_flight(SSL *ssl) { + if (!tls_flush_pending_hs_data(ssl)) { + return -1; } - ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, alert); - ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, ((int)level << 8) | desc); - return true; -} + if (ssl->quic_method) { + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + if (!ssl->quic_method->flush_flight(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return -1; + } + } -int ssl3_flush_flight(SSL *ssl) { if (ssl->s3->pending_flight == nullptr) { return 1; } @@ -249,7 +317,7 @@ int ssl3_flush_flight(SSL *ssl) { if (!ssl->s3->write_buffer.empty()) { int ret = ssl_write_buffer_flush(ssl); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return ret; } } @@ -257,19 +325,19 @@ int ssl3_flush_flight(SSL *ssl) { // Write the pending flight. while (ssl->s3->pending_flight_offset < ssl->s3->pending_flight->length) { int ret = BIO_write( - ssl->wbio, + ssl->wbio.get(), ssl->s3->pending_flight->data + ssl->s3->pending_flight_offset, ssl->s3->pending_flight->length - ssl->s3->pending_flight_offset); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return ret; } ssl->s3->pending_flight_offset += ret; } - if (BIO_flush(ssl->wbio) <= 0) { - ssl->s3->rwstate = SSL_WRITING; + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return -1; } @@ -343,7 +411,7 @@ static ssl_open_record_t read_v2_client_hello(SSL *ssl, size_t *out_consumed, OPENSSL_memcpy(random + (SSL3_RANDOM_SIZE - rand_len), CBS_data(&challenge), rand_len); - // Write out an equivalent SSLv3 ClientHello. + // Write out an equivalent TLS ClientHello directly to the handshake buffer. size_t max_v3_client_hello = SSL3_HM_HEADER_LENGTH + 2 /* version */ + SSL3_RANDOM_SIZE + 1 /* session ID length */ + 2 /* cipher list length */ + @@ -351,7 +419,11 @@ static ssl_open_record_t read_v2_client_hello(SSL *ssl, size_t *out_consumed, 1 /* compression length */ + 1 /* compression */; ScopedCBB client_hello; CBB hello_body, cipher_suites; - if (!BUF_MEM_reserve(ssl->s3->hs_buf.get(), max_v3_client_hello) || + if (!ssl->s3->hs_buf) { + ssl->s3->hs_buf.reset(BUF_MEM_new()); + } + if (!ssl->s3->hs_buf || + !BUF_MEM_reserve(ssl->s3->hs_buf.get(), max_v3_client_hello) || !CBB_init_fixed(client_hello.get(), (uint8_t *)ssl->s3->hs_buf->data, ssl->s3->hs_buf->max) || !CBB_add_u8(client_hello.get(), SSL3_MT_CLIENT_HELLO) || @@ -424,7 +496,7 @@ static bool parse_message(const SSL *ssl, SSLMessage *out, return true; } -bool ssl3_get_message(SSL *ssl, SSLMessage *out) { +bool ssl3_get_message(const SSL *ssl, SSLMessage *out) { size_t unused; if (!parse_message(ssl, out, &unused)) { return false; @@ -471,18 +543,18 @@ bool tls_has_unprocessed_handshake_data(const SSL *ssl) { return ssl->s3->hs_buf && ssl->s3->hs_buf->length > msg_len; } -ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in) { - *out_consumed = 0; +bool tls_append_handshake_data(SSL *ssl, Span data) { // Re-create the handshake buffer if needed. if (!ssl->s3->hs_buf) { ssl->s3->hs_buf.reset(BUF_MEM_new()); - if (!ssl->s3->hs_buf) { - *out_alert = SSL_AD_INTERNAL_ERROR; - return ssl_open_record_error; - } } + return ssl->s3->hs_buf && + BUF_MEM_append(ssl->s3->hs_buf.get(), data.data(), data.size()); +} +ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in) { + *out_consumed = 0; // Bypass the record layer for the first message to handle V2ClientHello. if (ssl->server && !ssl->s3->v2_hello_done) { // Ask for the first 5 bytes, the size of the TLS record header. This is @@ -551,7 +623,7 @@ ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, } // Append the entire handshake record to the buffer. - if (!BUF_MEM_append(ssl->s3->hs_buf.get(), body.data(), body.size())) { + if (!tls_append_handshake_data(ssl, body)) { *out_alert = SSL_AD_INTERNAL_ERROR; return ssl_open_record_error; } @@ -582,4 +654,71 @@ void ssl3_next_message(SSL *ssl) { } } -} // namespace bssl +// CipherScorer produces a "score" for each possible cipher suite offered by +// the client. +class CipherScorer { + public: + CipherScorer(uint16_t group_id) + : aes_is_fine_(EVP_has_aes_hardware()), + security_128_is_fine_(group_id != SSL_CURVE_CECPQ2) {} + + typedef std::tuple Score; + + // MinScore returns a |Score| that will compare less than the score of all + // cipher suites. + Score MinScore() const { + return Score(false, false, false); + } + + Score Evaluate(const SSL_CIPHER *a) const { + return Score( + // Something is always preferable to nothing. + true, + // Either 128-bit is fine, or 256-bit is preferred. + security_128_is_fine_ || a->algorithm_enc != SSL_AES128GCM, + // Either AES is fine, or else ChaCha20 is preferred. + aes_is_fine_ || a->algorithm_enc == SSL_CHACHA20POLY1305); + } + + private: + const bool aes_is_fine_; + const bool security_128_is_fine_; +}; + +const SSL_CIPHER *ssl_choose_tls13_cipher(CBS cipher_suites, uint16_t version, + uint16_t group_id) { + if (CBS_len(&cipher_suites) % 2 != 0) { + return nullptr; + } + + const SSL_CIPHER *best = nullptr; + CipherScorer scorer(group_id); + CipherScorer::Score best_score = scorer.MinScore(); + + while (CBS_len(&cipher_suites) > 0) { + uint16_t cipher_suite; + if (!CBS_get_u16(&cipher_suites, &cipher_suite)) { + return nullptr; + } + + // Limit to TLS 1.3 ciphers we know about. + const SSL_CIPHER *candidate = SSL_get_cipher_by_value(cipher_suite); + if (candidate == nullptr || + SSL_CIPHER_get_min_version(candidate) > version || + SSL_CIPHER_get_max_version(candidate) < version) { + continue; + } + + const CipherScorer::Score candidate_score = scorer.Evaluate(candidate); + // |candidate_score| must be larger to displace the current choice. That way + // the client's order controls between ciphers with an equal score. + if (candidate_score > best_score) { + best = candidate; + best_score = candidate_score; + } + } + + return best; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/s3_both.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/s3_both.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/s3_both.cc.grpc_back index 9d1218cca..1ec596a37 100644 --- a/Pods/BoringSSL-GRPC/ssl/s3_both.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/s3_both.cc.grpc_back @@ -116,6 +116,8 @@ #include #include +#include + #include #include #include @@ -130,10 +132,12 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN static bool add_record_to_flight(SSL *ssl, uint8_t type, Span in) { + // The caller should have flushed |pending_hs_data| first. + assert(!ssl->s3->pending_hs_data); // We'll never add a flight while in the process of writing it out. assert(ssl->s3->pending_flight_offset == 0); @@ -182,17 +186,50 @@ bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg) { } bool ssl3_add_message(SSL *ssl, Array msg) { - // Add the message to the current flight, splitting into several records if - // needed. + // Pack handshake data into the minimal number of records. This avoids + // unnecessary encryption overhead, notably in TLS 1.3 where we send several + // encrypted messages in a row. For now, we do not do this for the null + // cipher. The benefit is smaller and there is a risk of breaking buggy + // implementations. + // + // TODO(davidben): See if we can do this uniformly. Span rest = msg; - do { - Span chunk = rest.subspan(0, ssl->max_send_fragment); - rest = rest.subspan(chunk.size()); + if (ssl->quic_method == nullptr && + ssl->s3->aead_write_ctx->is_null_cipher()) { + while (!rest.empty()) { + Span chunk = rest.subspan(0, ssl->max_send_fragment); + rest = rest.subspan(chunk.size()); + + if (!add_record_to_flight(ssl, SSL3_RT_HANDSHAKE, chunk)) { + return false; + } + } + } else { + while (!rest.empty()) { + // Flush if |pending_hs_data| is full. + if (ssl->s3->pending_hs_data && + ssl->s3->pending_hs_data->length >= ssl->max_send_fragment && + !tls_flush_pending_hs_data(ssl)) { + return false; + } - if (!add_record_to_flight(ssl, SSL3_RT_HANDSHAKE, chunk)) { - return false; + size_t pending_len = + ssl->s3->pending_hs_data ? ssl->s3->pending_hs_data->length : 0; + Span chunk = + rest.subspan(0, ssl->max_send_fragment - pending_len); + assert(!chunk.empty()); + rest = rest.subspan(chunk.size()); + + if (!ssl->s3->pending_hs_data) { + ssl->s3->pending_hs_data.reset(BUF_MEM_new()); + } + if (!ssl->s3->pending_hs_data || + !BUF_MEM_append(ssl->s3->pending_hs_data.get(), chunk.data(), + chunk.size())) { + return false; + } } - } while (!rest.empty()); + } ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HANDSHAKE, msg); // TODO(svaldez): Move this up a layer to fix abstraction for SSLTranscript on @@ -204,10 +241,36 @@ bool ssl3_add_message(SSL *ssl, Array msg) { return true; } +bool tls_flush_pending_hs_data(SSL *ssl) { + if (!ssl->s3->pending_hs_data || ssl->s3->pending_hs_data->length == 0) { + return true; + } + + UniquePtr pending_hs_data = std::move(ssl->s3->pending_hs_data); + auto data = + MakeConstSpan(reinterpret_cast(pending_hs_data->data), + pending_hs_data->length); + if (ssl->quic_method) { + if (!ssl->quic_method->add_handshake_data(ssl, ssl->s3->write_level, + data.data(), data.size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return false; + } + return true; + } + + return add_record_to_flight(ssl, SSL3_RT_HANDSHAKE, data); +} + bool ssl3_add_change_cipher_spec(SSL *ssl) { static const uint8_t kChangeCipherSpec[1] = {SSL3_MT_CCS}; - if (!add_record_to_flight(ssl, SSL3_RT_CHANGE_CIPHER_SPEC, + if (!tls_flush_pending_hs_data(ssl)) { + return false; + } + + if (!ssl->quic_method && + !add_record_to_flight(ssl, SSL3_RT_CHANGE_CIPHER_SPEC, kChangeCipherSpec)) { return false; } @@ -217,18 +280,23 @@ bool ssl3_add_change_cipher_spec(SSL *ssl) { return true; } -bool ssl3_add_alert(SSL *ssl, uint8_t level, uint8_t desc) { - uint8_t alert[2] = {level, desc}; - if (!add_record_to_flight(ssl, SSL3_RT_ALERT, alert)) { - return false; +int ssl3_flush_flight(SSL *ssl) { + if (!tls_flush_pending_hs_data(ssl)) { + return -1; } - ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, alert); - ssl_do_info_callback(ssl, SSL_CB_WRITE_ALERT, ((int)level << 8) | desc); - return true; -} + if (ssl->quic_method) { + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + if (!ssl->quic_method->flush_flight(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return -1; + } + } -int ssl3_flush_flight(SSL *ssl) { if (ssl->s3->pending_flight == nullptr) { return 1; } @@ -249,7 +317,7 @@ int ssl3_flush_flight(SSL *ssl) { if (!ssl->s3->write_buffer.empty()) { int ret = ssl_write_buffer_flush(ssl); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return ret; } } @@ -257,19 +325,19 @@ int ssl3_flush_flight(SSL *ssl) { // Write the pending flight. while (ssl->s3->pending_flight_offset < ssl->s3->pending_flight->length) { int ret = BIO_write( - ssl->wbio, + ssl->wbio.get(), ssl->s3->pending_flight->data + ssl->s3->pending_flight_offset, ssl->s3->pending_flight->length - ssl->s3->pending_flight_offset); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return ret; } ssl->s3->pending_flight_offset += ret; } - if (BIO_flush(ssl->wbio) <= 0) { - ssl->s3->rwstate = SSL_WRITING; + if (BIO_flush(ssl->wbio.get()) <= 0) { + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return -1; } @@ -343,7 +411,7 @@ static ssl_open_record_t read_v2_client_hello(SSL *ssl, size_t *out_consumed, OPENSSL_memcpy(random + (SSL3_RANDOM_SIZE - rand_len), CBS_data(&challenge), rand_len); - // Write out an equivalent SSLv3 ClientHello. + // Write out an equivalent TLS ClientHello directly to the handshake buffer. size_t max_v3_client_hello = SSL3_HM_HEADER_LENGTH + 2 /* version */ + SSL3_RANDOM_SIZE + 1 /* session ID length */ + 2 /* cipher list length */ + @@ -351,7 +419,11 @@ static ssl_open_record_t read_v2_client_hello(SSL *ssl, size_t *out_consumed, 1 /* compression length */ + 1 /* compression */; ScopedCBB client_hello; CBB hello_body, cipher_suites; - if (!BUF_MEM_reserve(ssl->s3->hs_buf.get(), max_v3_client_hello) || + if (!ssl->s3->hs_buf) { + ssl->s3->hs_buf.reset(BUF_MEM_new()); + } + if (!ssl->s3->hs_buf || + !BUF_MEM_reserve(ssl->s3->hs_buf.get(), max_v3_client_hello) || !CBB_init_fixed(client_hello.get(), (uint8_t *)ssl->s3->hs_buf->data, ssl->s3->hs_buf->max) || !CBB_add_u8(client_hello.get(), SSL3_MT_CLIENT_HELLO) || @@ -424,7 +496,7 @@ static bool parse_message(const SSL *ssl, SSLMessage *out, return true; } -bool ssl3_get_message(SSL *ssl, SSLMessage *out) { +bool ssl3_get_message(const SSL *ssl, SSLMessage *out) { size_t unused; if (!parse_message(ssl, out, &unused)) { return false; @@ -471,18 +543,18 @@ bool tls_has_unprocessed_handshake_data(const SSL *ssl) { return ssl->s3->hs_buf && ssl->s3->hs_buf->length > msg_len; } -ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in) { - *out_consumed = 0; +bool tls_append_handshake_data(SSL *ssl, Span data) { // Re-create the handshake buffer if needed. if (!ssl->s3->hs_buf) { ssl->s3->hs_buf.reset(BUF_MEM_new()); - if (!ssl->s3->hs_buf) { - *out_alert = SSL_AD_INTERNAL_ERROR; - return ssl_open_record_error; - } } + return ssl->s3->hs_buf && + BUF_MEM_append(ssl->s3->hs_buf.get(), data.data(), data.size()); +} +ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in) { + *out_consumed = 0; // Bypass the record layer for the first message to handle V2ClientHello. if (ssl->server && !ssl->s3->v2_hello_done) { // Ask for the first 5 bytes, the size of the TLS record header. This is @@ -551,7 +623,7 @@ ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, } // Append the entire handshake record to the buffer. - if (!BUF_MEM_append(ssl->s3->hs_buf.get(), body.data(), body.size())) { + if (!tls_append_handshake_data(ssl, body)) { *out_alert = SSL_AD_INTERNAL_ERROR; return ssl_open_record_error; } @@ -582,4 +654,71 @@ void ssl3_next_message(SSL *ssl) { } } -} // namespace bssl +// CipherScorer produces a "score" for each possible cipher suite offered by +// the client. +class CipherScorer { + public: + CipherScorer(uint16_t group_id) + : aes_is_fine_(EVP_has_aes_hardware()), + security_128_is_fine_(group_id != SSL_CURVE_CECPQ2) {} + + typedef std::tuple Score; + + // MinScore returns a |Score| that will compare less than the score of all + // cipher suites. + Score MinScore() const { + return Score(false, false, false); + } + + Score Evaluate(const SSL_CIPHER *a) const { + return Score( + // Something is always preferable to nothing. + true, + // Either 128-bit is fine, or 256-bit is preferred. + security_128_is_fine_ || a->algorithm_enc != SSL_AES128GCM, + // Either AES is fine, or else ChaCha20 is preferred. + aes_is_fine_ || a->algorithm_enc == SSL_CHACHA20POLY1305); + } + + private: + const bool aes_is_fine_; + const bool security_128_is_fine_; +}; + +const SSL_CIPHER *ssl_choose_tls13_cipher(CBS cipher_suites, uint16_t version, + uint16_t group_id) { + if (CBS_len(&cipher_suites) % 2 != 0) { + return nullptr; + } + + const SSL_CIPHER *best = nullptr; + CipherScorer scorer(group_id); + CipherScorer::Score best_score = scorer.MinScore(); + + while (CBS_len(&cipher_suites) > 0) { + uint16_t cipher_suite; + if (!CBS_get_u16(&cipher_suites, &cipher_suite)) { + return nullptr; + } + + // Limit to TLS 1.3 ciphers we know about. + const SSL_CIPHER *candidate = SSL_get_cipher_by_value(cipher_suite); + if (candidate == nullptr || + SSL_CIPHER_get_min_version(candidate) > version || + SSL_CIPHER_get_max_version(candidate) < version) { + continue; + } + + const CipherScorer::Score candidate_score = scorer.Evaluate(candidate); + // |candidate_score| must be larger to displace the current choice. That way + // the client's order controls between ciphers with an equal score. + if (candidate_score > best_score) { + best = candidate; + best_score = candidate_score; + } + } + + return best; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/s3_lib.cc b/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc similarity index 96% rename from Pods/BoringSSL-GRPC/ssl/s3_lib.cc rename to Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc index 1f1bcc021..531f9a555 100644 --- a/Pods/BoringSSL-GRPC/ssl/s3_lib.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc @@ -151,7 +151,6 @@ #include #include -#include #include #include #include @@ -162,7 +161,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN SSL3_STATE::SSL3_STATE() : skip_early_data(false), @@ -172,12 +171,17 @@ SSL3_STATE::SSL3_STATE() has_message(false), initial_handshake_complete(false), session_reused(false), + delegated_credential_used(false), send_connection_binding(false), - tlsext_channel_id_valid(false), + channel_id_valid(false), key_update_pending(false), wpend_pending(false), early_data_accepted(false), - draft_downgrade(false) {} + tls13_downgrade(false), + token_binding_negotiated(false), + alert_dispatch(false), + renegotiate_pending(false), + used_hello_retry_request(false) {} SSL3_STATE::~SSL3_STATE() {} @@ -214,13 +218,4 @@ void ssl3_free(SSL *ssl) { ssl->s3 = NULL; } -const struct ssl_cipher_preference_list_st *ssl_get_cipher_preferences( - const SSL *ssl) { - if (ssl->cipher_list != NULL) { - return ssl->cipher_list; - } - - return ssl->ctx->cipher_list; -} - -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/s3_lib.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc.grpc_back similarity index 96% rename from Pods/BoringSSL-GRPC/ssl/s3_lib.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc.grpc_back index a3fc8d7b2..978b1081c 100644 --- a/Pods/BoringSSL-GRPC/ssl/s3_lib.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/s3_lib.cc.grpc_back @@ -151,7 +151,6 @@ #include #include -#include #include #include #include @@ -162,7 +161,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN SSL3_STATE::SSL3_STATE() : skip_early_data(false), @@ -172,12 +171,17 @@ SSL3_STATE::SSL3_STATE() has_message(false), initial_handshake_complete(false), session_reused(false), + delegated_credential_used(false), send_connection_binding(false), - tlsext_channel_id_valid(false), + channel_id_valid(false), key_update_pending(false), wpend_pending(false), early_data_accepted(false), - draft_downgrade(false) {} + tls13_downgrade(false), + token_binding_negotiated(false), + alert_dispatch(false), + renegotiate_pending(false), + used_hello_retry_request(false) {} SSL3_STATE::~SSL3_STATE() {} @@ -214,13 +218,4 @@ void ssl3_free(SSL *ssl) { ssl->s3 = NULL; } -const struct ssl_cipher_preference_list_st *ssl_get_cipher_preferences( - const SSL *ssl) { - if (ssl->cipher_list != NULL) { - return ssl->cipher_list; - } - - return ssl->ctx->cipher_list; -} - -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/s3_pkt.cc b/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc similarity index 86% rename from Pods/BoringSSL-GRPC/ssl/s3_pkt.cc rename to Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc index 598a4a9d3..19652ae8c 100644 --- a/Pods/BoringSSL-GRPC/ssl/s3_pkt.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc @@ -112,17 +112,17 @@ #include #include -#include #include #include #include #include +#include "../crypto/err/internal.h" #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len); @@ -163,9 +163,11 @@ int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *in, for (;;) { // max contains the maximum number of bytes that we can put into a record. unsigned max = ssl->max_send_fragment; - if (is_early_data_write && max > ssl->session->ticket_max_early_data - - ssl->s3->hs->early_data_written) { - max = ssl->session->ticket_max_early_data - ssl->s3->hs->early_data_written; + if (is_early_data_write && + max > ssl->session->ticket_max_early_data - + ssl->s3->hs->early_data_written) { + max = + ssl->session->ticket_max_early_data - ssl->s3->hs->early_data_written; if (max == 0) { ssl->s3->wnum = tot; ssl->s3->hs->can_early_write = false; @@ -230,8 +232,8 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { return -1; } - if (len == 0) { - return 0; + if (!tls_flush_pending_hs_data(ssl)) { + return -1; } size_t flight_len = 0; @@ -240,12 +242,19 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { ssl->s3->pending_flight->length - ssl->s3->pending_flight_offset; } - size_t max_out = len + SSL_max_seal_overhead(ssl); - if (max_out < len || max_out + flight_len < max_out) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return -1; + size_t max_out = flight_len; + if (len > 0) { + const size_t max_ciphertext_len = len + SSL_max_seal_overhead(ssl); + if (max_ciphertext_len < len || max_out + max_ciphertext_len < max_out) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return -1; + } + max_out += max_ciphertext_len; + } + + if (max_out == 0) { + return 0; } - max_out += flight_len; if (!buf->EnsureCap(flight_len + ssl_seal_align_prefix_len(ssl), max_out)) { return -1; @@ -265,12 +274,14 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { buf->DidWrite(flight_len); } - size_t ciphertext_len; - if (!tls_seal_record(ssl, buf->remaining().data(), &ciphertext_len, - buf->remaining().size(), type, in, len)) { - return -1; + if (len > 0) { + size_t ciphertext_len; + if (!tls_seal_record(ssl, buf->remaining().data(), &ciphertext_len, + buf->remaining().size(), type, in, len)) { + return -1; + } + buf->DidWrite(ciphertext_len); } - buf->DidWrite(ciphertext_len); // Now that we've made progress on the connection, uncork KeyUpdate // acknowledgments. @@ -313,11 +324,7 @@ ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, return ssl_open_record_error; } - if (!ssl->s3->hs_buf) { - ssl->s3->hs_buf.reset(BUF_MEM_new()); - } - if (!ssl->s3->hs_buf || - !BUF_MEM_append(ssl->s3->hs_buf.get(), body.data(), body.size())) { + if (!tls_append_handshake_data(ssl, body)) { *out_alert = SSL_AD_INTERNAL_ERROR; return ssl_open_record_error; } @@ -374,7 +381,24 @@ ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, return ssl_open_record_success; } -int ssl_send_alert(SSL *ssl, int level, int desc) { +void ssl_send_alert(SSL *ssl, int level, int desc) { + // This function is called in response to a fatal error from the peer. Ignore + // any failures writing the alert and report only the original error. In + // particular, if the transport uses |SSL_write|, our existing error will be + // clobbered so we must save and restore the error queue. See + // https://crbug.com/959305. + // + // TODO(davidben): Return the alert out of the handshake, rather than calling + // this function internally everywhere. + // + // TODO(davidben): This does not allow retrying if the alert hit EAGAIN. See + // https://crbug.com/boringssl/130. + UniquePtr err_state(ERR_save_state()); + ssl_send_alert_impl(ssl, level, desc); + ERR_restore_state(err_state.get()); +} + +int ssl_send_alert_impl(SSL *ssl, int level, int desc) { // It is illegal to send an alert when we've already sent a closing one. if (ssl->s3->write_shutdown != ssl_shutdown_none) { OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); @@ -389,7 +413,7 @@ int ssl_send_alert(SSL *ssl, int level, int desc) { ssl->s3->write_shutdown = ssl_shutdown_error; } - ssl->s3->alert_dispatch = 1; + ssl->s3->alert_dispatch = true; ssl->s3->send_alert[0] = level; ssl->s3->send_alert[1] = desc; if (ssl->s3->write_buffer.empty()) { @@ -403,15 +427,24 @@ int ssl_send_alert(SSL *ssl, int level, int desc) { } int ssl3_dispatch_alert(SSL *ssl) { - int ret = do_ssl3_write(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2); - if (ret <= 0) { - return ret; + if (ssl->quic_method) { + if (!ssl->quic_method->send_alert(ssl, ssl->s3->write_level, + ssl->s3->send_alert[1])) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return 0; + } + } else { + int ret = do_ssl3_write(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2); + if (ret <= 0) { + return ret; + } } - ssl->s3->alert_dispatch = 0; + + ssl->s3->alert_dispatch = false; // If the alert is fatal, flush the BIO now. if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) { - BIO_flush(ssl->wbio); + BIO_flush(ssl->wbio.get()); } ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); @@ -422,4 +455,4 @@ int ssl3_dispatch_alert(SSL *ssl) { return 1; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/s3_pkt.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc.grpc_back similarity index 86% rename from Pods/BoringSSL-GRPC/ssl/s3_pkt.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc.grpc_back index 5eb68f6b1..2fcc2a532 100644 --- a/Pods/BoringSSL-GRPC/ssl/s3_pkt.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/s3_pkt.cc.grpc_back @@ -112,17 +112,17 @@ #include #include -#include #include #include #include #include +#include "../crypto/err/internal.h" #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len); @@ -163,9 +163,11 @@ int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *in, for (;;) { // max contains the maximum number of bytes that we can put into a record. unsigned max = ssl->max_send_fragment; - if (is_early_data_write && max > ssl->session->ticket_max_early_data - - ssl->s3->hs->early_data_written) { - max = ssl->session->ticket_max_early_data - ssl->s3->hs->early_data_written; + if (is_early_data_write && + max > ssl->session->ticket_max_early_data - + ssl->s3->hs->early_data_written) { + max = + ssl->session->ticket_max_early_data - ssl->s3->hs->early_data_written; if (max == 0) { ssl->s3->wnum = tot; ssl->s3->hs->can_early_write = false; @@ -230,8 +232,8 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { return -1; } - if (len == 0) { - return 0; + if (!tls_flush_pending_hs_data(ssl)) { + return -1; } size_t flight_len = 0; @@ -240,12 +242,19 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { ssl->s3->pending_flight->length - ssl->s3->pending_flight_offset; } - size_t max_out = len + SSL_max_seal_overhead(ssl); - if (max_out < len || max_out + flight_len < max_out) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return -1; + size_t max_out = flight_len; + if (len > 0) { + const size_t max_ciphertext_len = len + SSL_max_seal_overhead(ssl); + if (max_ciphertext_len < len || max_out + max_ciphertext_len < max_out) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return -1; + } + max_out += max_ciphertext_len; + } + + if (max_out == 0) { + return 0; } - max_out += flight_len; if (!buf->EnsureCap(flight_len + ssl_seal_align_prefix_len(ssl), max_out)) { return -1; @@ -265,12 +274,14 @@ static int do_ssl3_write(SSL *ssl, int type, const uint8_t *in, unsigned len) { buf->DidWrite(flight_len); } - size_t ciphertext_len; - if (!tls_seal_record(ssl, buf->remaining().data(), &ciphertext_len, - buf->remaining().size(), type, in, len)) { - return -1; + if (len > 0) { + size_t ciphertext_len; + if (!tls_seal_record(ssl, buf->remaining().data(), &ciphertext_len, + buf->remaining().size(), type, in, len)) { + return -1; + } + buf->DidWrite(ciphertext_len); } - buf->DidWrite(ciphertext_len); // Now that we've made progress on the connection, uncork KeyUpdate // acknowledgments. @@ -313,11 +324,7 @@ ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, return ssl_open_record_error; } - if (!ssl->s3->hs_buf) { - ssl->s3->hs_buf.reset(BUF_MEM_new()); - } - if (!ssl->s3->hs_buf || - !BUF_MEM_append(ssl->s3->hs_buf.get(), body.data(), body.size())) { + if (!tls_append_handshake_data(ssl, body)) { *out_alert = SSL_AD_INTERNAL_ERROR; return ssl_open_record_error; } @@ -374,7 +381,24 @@ ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, return ssl_open_record_success; } -int ssl_send_alert(SSL *ssl, int level, int desc) { +void ssl_send_alert(SSL *ssl, int level, int desc) { + // This function is called in response to a fatal error from the peer. Ignore + // any failures writing the alert and report only the original error. In + // particular, if the transport uses |SSL_write|, our existing error will be + // clobbered so we must save and restore the error queue. See + // https://crbug.com/959305. + // + // TODO(davidben): Return the alert out of the handshake, rather than calling + // this function internally everywhere. + // + // TODO(davidben): This does not allow retrying if the alert hit EAGAIN. See + // https://crbug.com/boringssl/130. + UniquePtr err_state(ERR_save_state()); + ssl_send_alert_impl(ssl, level, desc); + ERR_restore_state(err_state.get()); +} + +int ssl_send_alert_impl(SSL *ssl, int level, int desc) { // It is illegal to send an alert when we've already sent a closing one. if (ssl->s3->write_shutdown != ssl_shutdown_none) { OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); @@ -389,7 +413,7 @@ int ssl_send_alert(SSL *ssl, int level, int desc) { ssl->s3->write_shutdown = ssl_shutdown_error; } - ssl->s3->alert_dispatch = 1; + ssl->s3->alert_dispatch = true; ssl->s3->send_alert[0] = level; ssl->s3->send_alert[1] = desc; if (ssl->s3->write_buffer.empty()) { @@ -403,15 +427,24 @@ int ssl_send_alert(SSL *ssl, int level, int desc) { } int ssl3_dispatch_alert(SSL *ssl) { - int ret = do_ssl3_write(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2); - if (ret <= 0) { - return ret; + if (ssl->quic_method) { + if (!ssl->quic_method->send_alert(ssl, ssl->s3->write_level, + ssl->s3->send_alert[1])) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return 0; + } + } else { + int ret = do_ssl3_write(ssl, SSL3_RT_ALERT, &ssl->s3->send_alert[0], 2); + if (ret <= 0) { + return ret; + } } - ssl->s3->alert_dispatch = 0; + + ssl->s3->alert_dispatch = false; // If the alert is fatal, flush the BIO now. if (ssl->s3->send_alert[0] == SSL3_AL_FATAL) { - BIO_flush(ssl->wbio); + BIO_flush(ssl->wbio.get()); } ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_ALERT, ssl->s3->send_alert); @@ -422,4 +455,4 @@ int ssl3_dispatch_alert(SSL *ssl) { return 1; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_aead_ctx.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc similarity index 83% rename from Pods/BoringSSL-GRPC/ssl/ssl_aead_ctx.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc index 2705bc8fd..33d7e1b04 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_aead_ctx.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc @@ -31,7 +31,7 @@ #define FUZZER_MODE false #endif -namespace bssl { +BSSL_NAMESPACE_BEGIN SSLAEADContext::SSLAEADContext(uint16_t version_arg, bool is_dtls_arg, const SSL_CIPHER *cipher_arg) @@ -40,10 +40,9 @@ SSLAEADContext::SSLAEADContext(uint16_t version_arg, bool is_dtls_arg, is_dtls_(is_dtls_arg), variable_nonce_included_in_record_(false), random_variable_nonce_(false), + xor_fixed_nonce_(false), omit_length_in_ad_(false), - omit_version_in_ad_(false), - omit_ad_(false), - xor_fixed_nonce_(false) { + ad_is_header_(false) { OPENSSL_memset(fixed_nonce_, 0, sizeof(fixed_nonce_)); } @@ -55,7 +54,7 @@ UniquePtr SSLAEADContext::CreateNullCipher(bool is_dtls) { } UniquePtr SSLAEADContext::Create( - enum evp_aead_direction_t direction, uint16_t version, int is_dtls, + enum evp_aead_direction_t direction, uint16_t version, bool is_dtls, const SSL_CIPHER *cipher, Span enc_key, Span mac_key, Span fixed_iv) { const EVP_AEAD *aead; @@ -134,7 +133,7 @@ UniquePtr SSLAEADContext::Create( aead_ctx->xor_fixed_nonce_ = true; aead_ctx->variable_nonce_len_ = 8; aead_ctx->variable_nonce_included_in_record_ = false; - aead_ctx->omit_ad_ = true; + aead_ctx->ad_is_header_ = true; assert(fixed_iv.size() >= aead_ctx->variable_nonce_len_); } } else { @@ -142,12 +141,16 @@ UniquePtr SSLAEADContext::Create( aead_ctx->variable_nonce_included_in_record_ = true; aead_ctx->random_variable_nonce_ = true; aead_ctx->omit_length_in_ad_ = true; - aead_ctx->omit_version_in_ad_ = (protocol_version == SSL3_VERSION); } return aead_ctx; } +UniquePtr SSLAEADContext::CreatePlaceholderForQUIC( + uint16_t version, const SSL_CIPHER *cipher) { + return MakeUnique(version, false, cipher); +} + void SSLAEADContext::SetVersionIfNullCipher(uint16_t version) { if (is_null_cipher()) { version_ = version; @@ -193,6 +196,22 @@ bool SSLAEADContext::SuffixLen(size_t *out_suffix_len, const size_t in_len, extra_in_len); } +bool SSLAEADContext::CiphertextLen(size_t *out_len, const size_t in_len, + const size_t extra_in_len) const { + size_t len; + if (!SuffixLen(&len, in_len, extra_in_len)) { + return false; + } + len += ExplicitNonceLen(); + len += in_len; + if (len < in_len || len >= 0xffff) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + *out_len = len; + return true; +} + size_t SSLAEADContext::MaxOverhead() const { return ExplicitNonceLen() + (is_null_cipher() || FUZZER_MODE @@ -200,31 +219,28 @@ size_t SSLAEADContext::MaxOverhead() const { : EVP_AEAD_max_overhead(EVP_AEAD_CTX_aead(ctx_.get()))); } -size_t SSLAEADContext::GetAdditionalData(uint8_t out[13], uint8_t type, - uint16_t record_version, - const uint8_t seqnum[8], - size_t plaintext_len) { - if (omit_ad_) { - return 0; +Span SSLAEADContext::GetAdditionalData( + uint8_t storage[13], uint8_t type, uint16_t record_version, + const uint8_t seqnum[8], size_t plaintext_len, Span header) { + if (ad_is_header_) { + return header; } - OPENSSL_memcpy(out, seqnum, 8); + OPENSSL_memcpy(storage, seqnum, 8); size_t len = 8; - out[len++] = type; - if (!omit_version_in_ad_) { - out[len++] = static_cast((record_version >> 8)); - out[len++] = static_cast(record_version); - } + storage[len++] = type; + storage[len++] = static_cast((record_version >> 8)); + storage[len++] = static_cast(record_version); if (!omit_length_in_ad_) { - out[len++] = static_cast((plaintext_len >> 8)); - out[len++] = static_cast(plaintext_len); + storage[len++] = static_cast((plaintext_len >> 8)); + storage[len++] = static_cast(plaintext_len); } - return len; + return MakeConstSpan(storage, len); } bool SSLAEADContext::Open(Span *out, uint8_t type, uint16_t record_version, const uint8_t seqnum[8], - Span in) { + Span header, Span in) { if (is_null_cipher() || FUZZER_MODE) { // Handle the initial NULL cipher. *out = in; @@ -243,9 +259,10 @@ bool SSLAEADContext::Open(Span *out, uint8_t type, } plaintext_len = in.size() - overhead; } - uint8_t ad[13]; - size_t ad_len = - GetAdditionalData(ad, type, record_version, seqnum, plaintext_len); + + uint8_t ad_storage[13]; + Span ad = GetAdditionalData(ad_storage, type, record_version, + seqnum, plaintext_len, header); // Assemble the nonce. uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH]; @@ -286,7 +303,8 @@ bool SSLAEADContext::Open(Span *out, uint8_t type, // Decrypt in-place. size_t len; if (!EVP_AEAD_CTX_open(ctx_.get(), in.data(), &len, in.size(), nonce, - nonce_len, in.data(), in.size(), ad, ad_len)) { + nonce_len, in.data(), in.size(), ad.data(), + ad.size())) { return false; } *out = in.subspan(0, len); @@ -296,7 +314,8 @@ bool SSLAEADContext::Open(Span *out, uint8_t type, bool SSLAEADContext::SealScatter(uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], const uint8_t *in, + const uint8_t seqnum[8], + Span header, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len) { const size_t prefix_len = ExplicitNonceLen(); @@ -319,8 +338,9 @@ bool SSLAEADContext::SealScatter(uint8_t *out_prefix, uint8_t *out, return true; } - uint8_t ad[13]; - size_t ad_len = GetAdditionalData(ad, type, record_version, seqnum, in_len); + uint8_t ad_storage[13]; + Span ad = GetAdditionalData(ad_storage, type, record_version, + seqnum, in_len, header); // Assemble the nonce. uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH]; @@ -371,15 +391,15 @@ bool SSLAEADContext::SealScatter(uint8_t *out_prefix, uint8_t *out, size_t written_suffix_len; bool result = !!EVP_AEAD_CTX_seal_scatter( ctx_.get(), out, out_suffix, &written_suffix_len, suffix_len, nonce, - nonce_len, in, in_len, extra_in, extra_in_len, ad, ad_len); + nonce_len, in, in_len, extra_in, extra_in_len, ad.data(), ad.size()); assert(!result || written_suffix_len == suffix_len); return result; } bool SSLAEADContext::Seal(uint8_t *out, size_t *out_len, size_t max_out_len, uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], const uint8_t *in, - size_t in_len) { + const uint8_t seqnum[8], Span header, + const uint8_t *in, size_t in_len) { const size_t prefix_len = ExplicitNonceLen(); size_t suffix_len; if (!SuffixLen(&suffix_len, in_len, 0)) { @@ -397,7 +417,7 @@ bool SSLAEADContext::Seal(uint8_t *out, size_t *out_len, size_t max_out_len, } if (!SealScatter(out, out + prefix_len, out + prefix_len + in_len, type, - record_version, seqnum, in, in_len, 0, 0)) { + record_version, seqnum, header, in, in_len, 0, 0)) { return false; } *out_len = prefix_len + in_len + suffix_len; @@ -409,4 +429,4 @@ bool SSLAEADContext::GetIV(const uint8_t **out_iv, size_t *out_iv_len) const { EVP_AEAD_CTX_get_iv(ctx_.get(), out_iv, out_iv_len); } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_aead_ctx.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc.grpc_back similarity index 83% rename from Pods/BoringSSL-GRPC/ssl/ssl_aead_ctx.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc.grpc_back index 247e889e5..0bad2661a 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_aead_ctx.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_aead_ctx.cc.grpc_back @@ -31,7 +31,7 @@ #define FUZZER_MODE false #endif -namespace bssl { +BSSL_NAMESPACE_BEGIN SSLAEADContext::SSLAEADContext(uint16_t version_arg, bool is_dtls_arg, const SSL_CIPHER *cipher_arg) @@ -40,10 +40,9 @@ SSLAEADContext::SSLAEADContext(uint16_t version_arg, bool is_dtls_arg, is_dtls_(is_dtls_arg), variable_nonce_included_in_record_(false), random_variable_nonce_(false), + xor_fixed_nonce_(false), omit_length_in_ad_(false), - omit_version_in_ad_(false), - omit_ad_(false), - xor_fixed_nonce_(false) { + ad_is_header_(false) { OPENSSL_memset(fixed_nonce_, 0, sizeof(fixed_nonce_)); } @@ -55,7 +54,7 @@ UniquePtr SSLAEADContext::CreateNullCipher(bool is_dtls) { } UniquePtr SSLAEADContext::Create( - enum evp_aead_direction_t direction, uint16_t version, int is_dtls, + enum evp_aead_direction_t direction, uint16_t version, bool is_dtls, const SSL_CIPHER *cipher, Span enc_key, Span mac_key, Span fixed_iv) { const EVP_AEAD *aead; @@ -134,7 +133,7 @@ UniquePtr SSLAEADContext::Create( aead_ctx->xor_fixed_nonce_ = true; aead_ctx->variable_nonce_len_ = 8; aead_ctx->variable_nonce_included_in_record_ = false; - aead_ctx->omit_ad_ = true; + aead_ctx->ad_is_header_ = true; assert(fixed_iv.size() >= aead_ctx->variable_nonce_len_); } } else { @@ -142,12 +141,16 @@ UniquePtr SSLAEADContext::Create( aead_ctx->variable_nonce_included_in_record_ = true; aead_ctx->random_variable_nonce_ = true; aead_ctx->omit_length_in_ad_ = true; - aead_ctx->omit_version_in_ad_ = (protocol_version == SSL3_VERSION); } return aead_ctx; } +UniquePtr SSLAEADContext::CreatePlaceholderForQUIC( + uint16_t version, const SSL_CIPHER *cipher) { + return MakeUnique(version, false, cipher); +} + void SSLAEADContext::SetVersionIfNullCipher(uint16_t version) { if (is_null_cipher()) { version_ = version; @@ -193,6 +196,22 @@ bool SSLAEADContext::SuffixLen(size_t *out_suffix_len, const size_t in_len, extra_in_len); } +bool SSLAEADContext::CiphertextLen(size_t *out_len, const size_t in_len, + const size_t extra_in_len) const { + size_t len; + if (!SuffixLen(&len, in_len, extra_in_len)) { + return false; + } + len += ExplicitNonceLen(); + len += in_len; + if (len < in_len || len >= 0xffff) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return false; + } + *out_len = len; + return true; +} + size_t SSLAEADContext::MaxOverhead() const { return ExplicitNonceLen() + (is_null_cipher() || FUZZER_MODE @@ -200,31 +219,28 @@ size_t SSLAEADContext::MaxOverhead() const { : EVP_AEAD_max_overhead(EVP_AEAD_CTX_aead(ctx_.get()))); } -size_t SSLAEADContext::GetAdditionalData(uint8_t out[13], uint8_t type, - uint16_t record_version, - const uint8_t seqnum[8], - size_t plaintext_len) { - if (omit_ad_) { - return 0; +Span SSLAEADContext::GetAdditionalData( + uint8_t storage[13], uint8_t type, uint16_t record_version, + const uint8_t seqnum[8], size_t plaintext_len, Span header) { + if (ad_is_header_) { + return header; } - OPENSSL_memcpy(out, seqnum, 8); + OPENSSL_memcpy(storage, seqnum, 8); size_t len = 8; - out[len++] = type; - if (!omit_version_in_ad_) { - out[len++] = static_cast((record_version >> 8)); - out[len++] = static_cast(record_version); - } + storage[len++] = type; + storage[len++] = static_cast((record_version >> 8)); + storage[len++] = static_cast(record_version); if (!omit_length_in_ad_) { - out[len++] = static_cast((plaintext_len >> 8)); - out[len++] = static_cast(plaintext_len); + storage[len++] = static_cast((plaintext_len >> 8)); + storage[len++] = static_cast(plaintext_len); } - return len; + return MakeConstSpan(storage, len); } bool SSLAEADContext::Open(Span *out, uint8_t type, uint16_t record_version, const uint8_t seqnum[8], - Span in) { + Span header, Span in) { if (is_null_cipher() || FUZZER_MODE) { // Handle the initial NULL cipher. *out = in; @@ -243,9 +259,10 @@ bool SSLAEADContext::Open(Span *out, uint8_t type, } plaintext_len = in.size() - overhead; } - uint8_t ad[13]; - size_t ad_len = - GetAdditionalData(ad, type, record_version, seqnum, plaintext_len); + + uint8_t ad_storage[13]; + Span ad = GetAdditionalData(ad_storage, type, record_version, + seqnum, plaintext_len, header); // Assemble the nonce. uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH]; @@ -286,7 +303,8 @@ bool SSLAEADContext::Open(Span *out, uint8_t type, // Decrypt in-place. size_t len; if (!EVP_AEAD_CTX_open(ctx_.get(), in.data(), &len, in.size(), nonce, - nonce_len, in.data(), in.size(), ad, ad_len)) { + nonce_len, in.data(), in.size(), ad.data(), + ad.size())) { return false; } *out = in.subspan(0, len); @@ -296,7 +314,8 @@ bool SSLAEADContext::Open(Span *out, uint8_t type, bool SSLAEADContext::SealScatter(uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], const uint8_t *in, + const uint8_t seqnum[8], + Span header, const uint8_t *in, size_t in_len, const uint8_t *extra_in, size_t extra_in_len) { const size_t prefix_len = ExplicitNonceLen(); @@ -319,8 +338,9 @@ bool SSLAEADContext::SealScatter(uint8_t *out_prefix, uint8_t *out, return true; } - uint8_t ad[13]; - size_t ad_len = GetAdditionalData(ad, type, record_version, seqnum, in_len); + uint8_t ad_storage[13]; + Span ad = GetAdditionalData(ad_storage, type, record_version, + seqnum, in_len, header); // Assemble the nonce. uint8_t nonce[EVP_AEAD_MAX_NONCE_LENGTH]; @@ -371,15 +391,15 @@ bool SSLAEADContext::SealScatter(uint8_t *out_prefix, uint8_t *out, size_t written_suffix_len; bool result = !!EVP_AEAD_CTX_seal_scatter( ctx_.get(), out, out_suffix, &written_suffix_len, suffix_len, nonce, - nonce_len, in, in_len, extra_in, extra_in_len, ad, ad_len); + nonce_len, in, in_len, extra_in, extra_in_len, ad.data(), ad.size()); assert(!result || written_suffix_len == suffix_len); return result; } bool SSLAEADContext::Seal(uint8_t *out, size_t *out_len, size_t max_out_len, uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], const uint8_t *in, - size_t in_len) { + const uint8_t seqnum[8], Span header, + const uint8_t *in, size_t in_len) { const size_t prefix_len = ExplicitNonceLen(); size_t suffix_len; if (!SuffixLen(&suffix_len, in_len, 0)) { @@ -397,7 +417,7 @@ bool SSLAEADContext::Seal(uint8_t *out, size_t *out_len, size_t max_out_len, } if (!SealScatter(out, out + prefix_len, out + prefix_len + in_len, type, - record_version, seqnum, in, in_len, 0, 0)) { + record_version, seqnum, header, in, in_len, 0, 0)) { return false; } *out_len = prefix_len + in_len + suffix_len; @@ -409,4 +429,4 @@ bool SSLAEADContext::GetIV(const uint8_t **out_iv, size_t *out_iv_len) const { EVP_AEAD_CTX_get_iv(ctx_.get(), out_iv, out_iv_len); } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_asn1.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc similarity index 89% rename from Pods/BoringSSL-GRPC/ssl/ssl_asn1.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc index a15b51016..3aa124f52 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_asn1.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc @@ -80,13 +80,6 @@ * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR * OTHERWISE. */ -// Per C99, various stdint.h macros are unavailable in C++ unless some macros -// are defined. C++11 overruled this decision, but older Android NDKs still -// require it. -#if !defined(__STDC_LIMIT_MACROS) -#define __STDC_LIMIT_MACROS -#endif - #include #include @@ -94,7 +87,6 @@ #include -#include #include #include #include @@ -104,7 +96,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // An SSL_SESSION is serialized as the following ASN.1 structure: // @@ -224,8 +216,8 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, // The peer certificate is only serialized if the SHA-256 isn't // serialized instead. - if (sk_CRYPTO_BUFFER_num(in->certs) > 0 && !in->peer_sha256_valid) { - const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs, 0); + if (sk_CRYPTO_BUFFER_num(in->certs.get()) > 0 && !in->peer_sha256_valid) { + const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs.get(), 0); if (!CBB_add_asn1(&session, &child, kPeerTag) || !CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer))) { @@ -252,25 +244,26 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, if (in->psk_identity) { if (!CBB_add_asn1(&session, &child, kPSKIdentityTag) || - !CBB_add_asn1_octet_string(&child, (const uint8_t *)in->psk_identity, - strlen(in->psk_identity))) { + !CBB_add_asn1_octet_string(&child, + (const uint8_t *)in->psk_identity.get(), + strlen(in->psk_identity.get()))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } } - if (in->tlsext_tick_lifetime_hint > 0) { + if (in->ticket_lifetime_hint > 0) { if (!CBB_add_asn1(&session, &child, kTicketLifetimeHintTag) || - !CBB_add_asn1_uint64(&child, in->tlsext_tick_lifetime_hint)) { + !CBB_add_asn1_uint64(&child, in->ticket_lifetime_hint)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } } - if (in->tlsext_tick && !for_ticket) { + if (!in->ticket.empty() && !for_ticket) { if (!CBB_add_asn1(&session, &child, kTicketTag) || - !CBB_add_asn1_octet_string(&child, in->tlsext_tick, - in->tlsext_ticklen)) { + !CBB_add_asn1_octet_string(&child, in->ticket.data(), + in->ticket.size())) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -297,8 +290,8 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, if (in->signed_cert_timestamp_list != nullptr) { if (!CBB_add_asn1(&session, &child, kSignedCertTimestampListTag) || !CBB_add_asn1_octet_string( - &child, CRYPTO_BUFFER_data(in->signed_cert_timestamp_list), - CRYPTO_BUFFER_len(in->signed_cert_timestamp_list))) { + &child, CRYPTO_BUFFER_data(in->signed_cert_timestamp_list.get()), + CRYPTO_BUFFER_len(in->signed_cert_timestamp_list.get()))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -306,9 +299,9 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, if (in->ocsp_response != nullptr) { if (!CBB_add_asn1(&session, &child, kOCSPResponseTag) || - !CBB_add_asn1_octet_string(&child, - CRYPTO_BUFFER_data(in->ocsp_response), - CRYPTO_BUFFER_len(in->ocsp_response))) { + !CBB_add_asn1_octet_string( + &child, CRYPTO_BUFFER_data(in->ocsp_response.get()), + CRYPTO_BUFFER_len(in->ocsp_response.get()))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -333,13 +326,13 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, // serialized instead. if (in->certs != NULL && !in->peer_sha256_valid && - sk_CRYPTO_BUFFER_num(in->certs) >= 2) { + sk_CRYPTO_BUFFER_num(in->certs.get()) >= 2) { if (!CBB_add_asn1(&session, &child, kCertChainTag)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } - for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(in->certs); i++) { - const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs, i); + for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(in->certs.get()); i++) { + const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs.get(), i); if (!CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); @@ -386,10 +379,10 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, return 0; } - if (in->early_alpn) { + if (!in->early_alpn.empty()) { if (!CBB_add_asn1(&session, &child, kEarlyALPNTag) || - !CBB_add_asn1_octet_string(&child, (const uint8_t *)in->early_alpn, - in->early_alpn_len)) { + !CBB_add_asn1_octet_string(&child, in->early_alpn.data(), + in->early_alpn.size())) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -398,13 +391,11 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, return CBB_flush(cbb); } -// SSL_SESSION_parse_string gets an optional ASN.1 OCTET STRING -// explicitly tagged with |tag| from |cbs| and saves it in |*out|. On -// entry, if |*out| is not NULL, it frees the existing contents. If -// the element was not found, it sets |*out| to NULL. It returns one -// on success, whether or not the element was found, and zero on -// decode error. -static int SSL_SESSION_parse_string(CBS *cbs, char **out, unsigned tag) { +// SSL_SESSION_parse_string gets an optional ASN.1 OCTET STRING explicitly +// tagged with |tag| from |cbs| and saves it in |*out|. If the element was not +// found, it sets |*out| to NULL. It returns one on success, whether or not the +// element was found, and zero on decode error. +static int SSL_SESSION_parse_string(CBS *cbs, UniquePtr *out, unsigned tag) { CBS value; int present; if (!CBS_get_optional_asn1_octet_string(cbs, &value, &present, tag)) { @@ -416,38 +407,33 @@ static int SSL_SESSION_parse_string(CBS *cbs, char **out, unsigned tag) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); return 0; } - if (!CBS_strdup(&value, out)) { + char *raw = nullptr; + if (!CBS_strdup(&value, &raw)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } + out->reset(raw); } else { - OPENSSL_free(*out); - *out = NULL; + out->reset(); } return 1; } -// SSL_SESSION_parse_string gets an optional ASN.1 OCTET STRING -// explicitly tagged with |tag| from |cbs| and stows it in |*out_ptr| -// and |*out_len|. If |*out_ptr| is not NULL, it frees the existing -// contents. On entry, if the element was not found, it sets -// |*out_ptr| to NULL. It returns one on success, whether or not the -// element was found, and zero on decode error. -static int SSL_SESSION_parse_octet_string(CBS *cbs, uint8_t **out_ptr, - size_t *out_len, unsigned tag) { +// SSL_SESSION_parse_octet_string gets an optional ASN.1 OCTET STRING explicitly +// tagged with |tag| from |cbs| and stows it in |*out|. It returns one on +// success, whether or not the element was found, and zero on decode error. +static bool SSL_SESSION_parse_octet_string(CBS *cbs, Array *out, + unsigned tag) { CBS value; if (!CBS_get_optional_asn1_octet_string(cbs, &value, NULL, tag)) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); - return 0; + return false; } - if (!CBS_stow(&value, out_ptr, out_len)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - return 1; + return out->CopyFrom(value); } -static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, CRYPTO_BUFFER **out, +static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, + UniquePtr *out, unsigned tag, CRYPTO_BUFFER_POOL *pool) { if (!CBS_peek_asn1_tag(cbs, tag)) { @@ -461,8 +447,7 @@ static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, CRYPTO_BUFFER **out, OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); return 0; } - CRYPTO_BUFFER_free(*out); - *out = CRYPTO_BUFFER_new_from_CBS(&value, pool); + out->reset(CRYPTO_BUFFER_new_from_CBS(&value, pool)); if (*out == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; @@ -617,10 +602,9 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, if (!SSL_SESSION_parse_string(&session, &ret->psk_identity, kPSKIdentityTag) || - !SSL_SESSION_parse_u32(&session, &ret->tlsext_tick_lifetime_hint, + !SSL_SESSION_parse_u32(&session, &ret->ticket_lifetime_hint, kTicketLifetimeHintTag, 0) || - !SSL_SESSION_parse_octet_string(&session, &ret->tlsext_tick, - &ret->tlsext_ticklen, kTicketTag)) { + !SSL_SESSION_parse_octet_string(&session, &ret->ticket, kTicketTag)) { return nullptr; } @@ -680,8 +664,8 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, return nullptr; } if (has_peer || has_cert_chain) { - ret->certs = sk_CRYPTO_BUFFER_new_null(); - if (ret->certs == NULL) { + ret->certs.reset(sk_CRYPTO_BUFFER_new_null()); + if (ret->certs == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } @@ -689,7 +673,7 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, if (has_peer) { UniquePtr buffer(CRYPTO_BUFFER_new_from_CBS(&peer, pool)); if (!buffer || - !PushToStack(ret->certs, std::move(buffer))) { + !PushToStack(ret->certs.get(), std::move(buffer))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } @@ -703,21 +687,15 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, return nullptr; } - CRYPTO_BUFFER *buffer = CRYPTO_BUFFER_new_from_CBS(&cert, pool); - if (buffer == NULL || - !sk_CRYPTO_BUFFER_push(ret->certs, buffer)) { - CRYPTO_BUFFER_free(buffer); + UniquePtr buffer(CRYPTO_BUFFER_new_from_CBS(&cert, pool)); + if (buffer == nullptr || + !PushToStack(ret->certs.get(), std::move(buffer))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } } } - if (!x509_method->session_cache_objects(ret.get())) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); - return nullptr; - } - CBS age_add; int age_add_present; if (!CBS_get_optional_asn1_octet_string(&session, &age_add, &age_add_present, @@ -727,7 +705,7 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, CBS_len(&age_add) != 0) { return nullptr; } - ret->ticket_age_add_valid = age_add_present; + ret->ticket_age_add_valid = age_add_present != 0; int is_server; if (!CBS_get_optional_asn1_bool(&session, &is_server, kIsServerTag, @@ -747,12 +725,17 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, !SSL_SESSION_parse_u32(&session, &ret->auth_timeout, kAuthTimeoutTag, ret->timeout) || !SSL_SESSION_parse_octet_string(&session, &ret->early_alpn, - &ret->early_alpn_len, kEarlyALPNTag) || + kEarlyALPNTag) || CBS_len(&session) != 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); return nullptr; } + if (!x509_method->session_cache_objects(ret.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + return ret; } @@ -760,7 +743,7 @@ int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb) { return SSL_SESSION_to_bytes_full(in, cbb, 0); } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -774,7 +757,7 @@ int SSL_SESSION_to_bytes(const SSL_SESSION *in, uint8_t **out_data, static const char kNotResumableSession[] = "NOT RESUMABLE"; *out_len = strlen(kNotResumableSession); - *out_data = (uint8_t *)BUF_memdup(kNotResumableSession, *out_len); + *out_data = (uint8_t *)OPENSSL_memdup(kNotResumableSession, *out_len); if (*out_data == NULL) { return 0; } diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_asn1.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc.grpc_back similarity index 89% rename from Pods/BoringSSL-GRPC/ssl/ssl_asn1.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc.grpc_back index 078ad1f48..ea02cf40b 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_asn1.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_asn1.cc.grpc_back @@ -80,13 +80,6 @@ * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR * OTHERWISE. */ -// Per C99, various stdint.h macros are unavailable in C++ unless some macros -// are defined. C++11 overruled this decision, but older Android NDKs still -// require it. -#if !defined(__STDC_LIMIT_MACROS) -#define __STDC_LIMIT_MACROS -#endif - #include #include @@ -94,7 +87,6 @@ #include -#include #include #include #include @@ -104,7 +96,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // An SSL_SESSION is serialized as the following ASN.1 structure: // @@ -224,8 +216,8 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, // The peer certificate is only serialized if the SHA-256 isn't // serialized instead. - if (sk_CRYPTO_BUFFER_num(in->certs) > 0 && !in->peer_sha256_valid) { - const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs, 0); + if (sk_CRYPTO_BUFFER_num(in->certs.get()) > 0 && !in->peer_sha256_valid) { + const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs.get(), 0); if (!CBB_add_asn1(&session, &child, kPeerTag) || !CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer))) { @@ -252,25 +244,26 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, if (in->psk_identity) { if (!CBB_add_asn1(&session, &child, kPSKIdentityTag) || - !CBB_add_asn1_octet_string(&child, (const uint8_t *)in->psk_identity, - strlen(in->psk_identity))) { + !CBB_add_asn1_octet_string(&child, + (const uint8_t *)in->psk_identity.get(), + strlen(in->psk_identity.get()))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } } - if (in->tlsext_tick_lifetime_hint > 0) { + if (in->ticket_lifetime_hint > 0) { if (!CBB_add_asn1(&session, &child, kTicketLifetimeHintTag) || - !CBB_add_asn1_uint64(&child, in->tlsext_tick_lifetime_hint)) { + !CBB_add_asn1_uint64(&child, in->ticket_lifetime_hint)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } } - if (in->tlsext_tick && !for_ticket) { + if (!in->ticket.empty() && !for_ticket) { if (!CBB_add_asn1(&session, &child, kTicketTag) || - !CBB_add_asn1_octet_string(&child, in->tlsext_tick, - in->tlsext_ticklen)) { + !CBB_add_asn1_octet_string(&child, in->ticket.data(), + in->ticket.size())) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -297,8 +290,8 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, if (in->signed_cert_timestamp_list != nullptr) { if (!CBB_add_asn1(&session, &child, kSignedCertTimestampListTag) || !CBB_add_asn1_octet_string( - &child, CRYPTO_BUFFER_data(in->signed_cert_timestamp_list), - CRYPTO_BUFFER_len(in->signed_cert_timestamp_list))) { + &child, CRYPTO_BUFFER_data(in->signed_cert_timestamp_list.get()), + CRYPTO_BUFFER_len(in->signed_cert_timestamp_list.get()))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -306,9 +299,9 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, if (in->ocsp_response != nullptr) { if (!CBB_add_asn1(&session, &child, kOCSPResponseTag) || - !CBB_add_asn1_octet_string(&child, - CRYPTO_BUFFER_data(in->ocsp_response), - CRYPTO_BUFFER_len(in->ocsp_response))) { + !CBB_add_asn1_octet_string( + &child, CRYPTO_BUFFER_data(in->ocsp_response.get()), + CRYPTO_BUFFER_len(in->ocsp_response.get()))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -333,13 +326,13 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, // serialized instead. if (in->certs != NULL && !in->peer_sha256_valid && - sk_CRYPTO_BUFFER_num(in->certs) >= 2) { + sk_CRYPTO_BUFFER_num(in->certs.get()) >= 2) { if (!CBB_add_asn1(&session, &child, kCertChainTag)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } - for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(in->certs); i++) { - const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs, i); + for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(in->certs.get()); i++) { + const CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(in->certs.get(), i); if (!CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), CRYPTO_BUFFER_len(buffer))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); @@ -386,10 +379,10 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, return 0; } - if (in->early_alpn) { + if (!in->early_alpn.empty()) { if (!CBB_add_asn1(&session, &child, kEarlyALPNTag) || - !CBB_add_asn1_octet_string(&child, (const uint8_t *)in->early_alpn, - in->early_alpn_len)) { + !CBB_add_asn1_octet_string(&child, in->early_alpn.data(), + in->early_alpn.size())) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } @@ -398,13 +391,11 @@ static int SSL_SESSION_to_bytes_full(const SSL_SESSION *in, CBB *cbb, return CBB_flush(cbb); } -// SSL_SESSION_parse_string gets an optional ASN.1 OCTET STRING -// explicitly tagged with |tag| from |cbs| and saves it in |*out|. On -// entry, if |*out| is not NULL, it frees the existing contents. If -// the element was not found, it sets |*out| to NULL. It returns one -// on success, whether or not the element was found, and zero on -// decode error. -static int SSL_SESSION_parse_string(CBS *cbs, char **out, unsigned tag) { +// SSL_SESSION_parse_string gets an optional ASN.1 OCTET STRING explicitly +// tagged with |tag| from |cbs| and saves it in |*out|. If the element was not +// found, it sets |*out| to NULL. It returns one on success, whether or not the +// element was found, and zero on decode error. +static int SSL_SESSION_parse_string(CBS *cbs, UniquePtr *out, unsigned tag) { CBS value; int present; if (!CBS_get_optional_asn1_octet_string(cbs, &value, &present, tag)) { @@ -416,38 +407,33 @@ static int SSL_SESSION_parse_string(CBS *cbs, char **out, unsigned tag) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); return 0; } - if (!CBS_strdup(&value, out)) { + char *raw = nullptr; + if (!CBS_strdup(&value, &raw)) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; } + out->reset(raw); } else { - OPENSSL_free(*out); - *out = NULL; + out->reset(); } return 1; } -// SSL_SESSION_parse_string gets an optional ASN.1 OCTET STRING -// explicitly tagged with |tag| from |cbs| and stows it in |*out_ptr| -// and |*out_len|. If |*out_ptr| is not NULL, it frees the existing -// contents. On entry, if the element was not found, it sets -// |*out_ptr| to NULL. It returns one on success, whether or not the -// element was found, and zero on decode error. -static int SSL_SESSION_parse_octet_string(CBS *cbs, uint8_t **out_ptr, - size_t *out_len, unsigned tag) { +// SSL_SESSION_parse_octet_string gets an optional ASN.1 OCTET STRING explicitly +// tagged with |tag| from |cbs| and stows it in |*out|. It returns one on +// success, whether or not the element was found, and zero on decode error. +static bool SSL_SESSION_parse_octet_string(CBS *cbs, Array *out, + unsigned tag) { CBS value; if (!CBS_get_optional_asn1_octet_string(cbs, &value, NULL, tag)) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); - return 0; + return false; } - if (!CBS_stow(&value, out_ptr, out_len)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - return 1; + return out->CopyFrom(value); } -static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, CRYPTO_BUFFER **out, +static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, + UniquePtr *out, unsigned tag, CRYPTO_BUFFER_POOL *pool) { if (!CBS_peek_asn1_tag(cbs, tag)) { @@ -461,8 +447,7 @@ static int SSL_SESSION_parse_crypto_buffer(CBS *cbs, CRYPTO_BUFFER **out, OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); return 0; } - CRYPTO_BUFFER_free(*out); - *out = CRYPTO_BUFFER_new_from_CBS(&value, pool); + out->reset(CRYPTO_BUFFER_new_from_CBS(&value, pool)); if (*out == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return 0; @@ -617,10 +602,9 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, if (!SSL_SESSION_parse_string(&session, &ret->psk_identity, kPSKIdentityTag) || - !SSL_SESSION_parse_u32(&session, &ret->tlsext_tick_lifetime_hint, + !SSL_SESSION_parse_u32(&session, &ret->ticket_lifetime_hint, kTicketLifetimeHintTag, 0) || - !SSL_SESSION_parse_octet_string(&session, &ret->tlsext_tick, - &ret->tlsext_ticklen, kTicketTag)) { + !SSL_SESSION_parse_octet_string(&session, &ret->ticket, kTicketTag)) { return nullptr; } @@ -680,8 +664,8 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, return nullptr; } if (has_peer || has_cert_chain) { - ret->certs = sk_CRYPTO_BUFFER_new_null(); - if (ret->certs == NULL) { + ret->certs.reset(sk_CRYPTO_BUFFER_new_null()); + if (ret->certs == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } @@ -689,7 +673,7 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, if (has_peer) { UniquePtr buffer(CRYPTO_BUFFER_new_from_CBS(&peer, pool)); if (!buffer || - !PushToStack(ret->certs, std::move(buffer))) { + !PushToStack(ret->certs.get(), std::move(buffer))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } @@ -703,21 +687,15 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, return nullptr; } - CRYPTO_BUFFER *buffer = CRYPTO_BUFFER_new_from_CBS(&cert, pool); - if (buffer == NULL || - !sk_CRYPTO_BUFFER_push(ret->certs, buffer)) { - CRYPTO_BUFFER_free(buffer); + UniquePtr buffer(CRYPTO_BUFFER_new_from_CBS(&cert, pool)); + if (buffer == nullptr || + !PushToStack(ret->certs.get(), std::move(buffer))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return nullptr; } } } - if (!x509_method->session_cache_objects(ret.get())) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); - return nullptr; - } - CBS age_add; int age_add_present; if (!CBS_get_optional_asn1_octet_string(&session, &age_add, &age_add_present, @@ -727,7 +705,7 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, CBS_len(&age_add) != 0) { return nullptr; } - ret->ticket_age_add_valid = age_add_present; + ret->ticket_age_add_valid = age_add_present != 0; int is_server; if (!CBS_get_optional_asn1_bool(&session, &is_server, kIsServerTag, @@ -747,12 +725,17 @@ UniquePtr SSL_SESSION_parse(CBS *cbs, !SSL_SESSION_parse_u32(&session, &ret->auth_timeout, kAuthTimeoutTag, ret->timeout) || !SSL_SESSION_parse_octet_string(&session, &ret->early_alpn, - &ret->early_alpn_len, kEarlyALPNTag) || + kEarlyALPNTag) || CBS_len(&session) != 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); return nullptr; } + if (!x509_method->session_cache_objects(ret.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SSL_SESSION); + return nullptr; + } + return ret; } @@ -760,7 +743,7 @@ int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb) { return SSL_SESSION_to_bytes_full(in, cbb, 0); } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -774,7 +757,7 @@ int SSL_SESSION_to_bytes(const SSL_SESSION *in, uint8_t **out_data, static const char kNotResumableSession[] = "NOT RESUMABLE"; *out_len = strlen(kNotResumableSession); - *out_data = (uint8_t *)BUF_memdup(kNotResumableSession, *out_len); + *out_data = (uint8_t *)OPENSSL_memdup(kNotResumableSession, *out_len); if (*out_data == NULL) { return 0; } diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_buffer.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/ssl_buffer.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc index a1feb2290..bff1dfa4a 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_buffer.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc @@ -27,7 +27,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // BIO uses int instead of size_t. No lengths will exceed uint16_t, so this will // not overflow. @@ -37,8 +37,11 @@ static_assert((SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) == 0, "SSL3_ALIGN_PAYLOAD must be a power of 2"); void SSLBuffer::Clear() { - free(buf_); // Allocated with malloc(). + if (buf_allocated_) { + free(buf_); // Allocated with malloc(). + } buf_ = nullptr; + buf_allocated_ = false; offset_ = 0; size_ = 0; cap_ = 0; @@ -54,27 +57,43 @@ bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) { return true; } - // Add up to |SSL3_ALIGN_PAYLOAD| - 1 bytes of slack for alignment. - // - // Since this buffer gets allocated quite frequently and doesn't contain any - // sensitive data, we allocate with malloc rather than |OPENSSL_malloc| and - // avoid zeroing on free. - uint8_t *new_buf = (uint8_t *)malloc(new_cap + SSL3_ALIGN_PAYLOAD - 1); - if (new_buf == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; + uint8_t *new_buf; + bool new_buf_allocated; + size_t new_offset; + if (new_cap <= sizeof(inline_buf_)) { + // This function is called twice per TLS record, first for the five-byte + // header. To avoid allocating twice, use an inline buffer for short inputs. + new_buf = inline_buf_; + new_buf_allocated = false; + new_offset = 0; + } else { + // Add up to |SSL3_ALIGN_PAYLOAD| - 1 bytes of slack for alignment. + // + // Since this buffer gets allocated quite frequently and doesn't contain any + // sensitive data, we allocate with malloc rather than |OPENSSL_malloc| and + // avoid zeroing on free. + new_buf = (uint8_t *)malloc(new_cap + SSL3_ALIGN_PAYLOAD - 1); + if (new_buf == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + new_buf_allocated = true; + + // Offset the buffer such that the record body is aligned. + new_offset = + (0 - header_len - (uintptr_t)new_buf) & (SSL3_ALIGN_PAYLOAD - 1); } - // Offset the buffer such that the record body is aligned. - size_t new_offset = - (0 - header_len - (uintptr_t)new_buf) & (SSL3_ALIGN_PAYLOAD - 1); + // Note if the both old and new buffer are inline, the source and destination + // may alias. + OPENSSL_memmove(new_buf + new_offset, buf_ + offset_, size_); - if (buf_ != NULL) { - OPENSSL_memcpy(new_buf + new_offset, buf_ + offset_, size_); + if (buf_allocated_) { free(buf_); // Allocated with malloc(). } buf_ = new_buf; + buf_allocated_ = new_buf_allocated; offset_ = new_offset; cap_ = new_cap; return true; @@ -113,9 +132,10 @@ static int dtls_read_buffer_next_packet(SSL *ssl) { } // Read a single packet from |ssl->rbio|. |buf->cap()| must fit in an int. - int ret = BIO_read(ssl->rbio, buf->data(), static_cast(buf->cap())); + int ret = + BIO_read(ssl->rbio.get(), buf->data(), static_cast(buf->cap())); if (ret <= 0) { - ssl->s3->rwstate = SSL_READING; + ssl->s3->rwstate = SSL_ERROR_WANT_READ; return ret; } buf->DidWrite(static_cast(ret)); @@ -134,10 +154,10 @@ static int tls_read_buffer_extend_to(SSL *ssl, size_t len) { while (buf->size() < len) { // The amount of data to read is bounded by |buf->cap|, which must fit in an // int. - int ret = BIO_read(ssl->rbio, buf->data() + buf->size(), + int ret = BIO_read(ssl->rbio.get(), buf->data() + buf->size(), static_cast(len - buf->size())); if (ret <= 0) { - ssl->s3->rwstate = SSL_READING; + ssl->s3->rwstate = SSL_ERROR_WANT_READ; return ret; } buf->DidWrite(static_cast(ret)); @@ -163,7 +183,7 @@ int ssl_read_buffer_extend_to(SSL *ssl, size_t len) { return -1; } - if (ssl->rbio == NULL) { + if (ssl->rbio == nullptr) { OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); return -1; } @@ -240,9 +260,9 @@ static int tls_write_buffer_flush(SSL *ssl) { SSLBuffer *buf = &ssl->s3->write_buffer; while (!buf->empty()) { - int ret = BIO_write(ssl->wbio, buf->data(), buf->size()); + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return ret; } buf->Consume(static_cast(ret)); @@ -257,9 +277,9 @@ static int dtls_write_buffer_flush(SSL *ssl) { return 1; } - int ret = BIO_write(ssl->wbio, buf->data(), buf->size()); + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; // If the write failed, drop the write buffer anyway. Datagram transports // can't write half a packet, so the caller is expected to retry from the // top. @@ -271,7 +291,7 @@ static int dtls_write_buffer_flush(SSL *ssl) { } int ssl_write_buffer_flush(SSL *ssl) { - if (ssl->wbio == NULL) { + if (ssl->wbio == nullptr) { OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); return -1; } @@ -283,4 +303,4 @@ int ssl_write_buffer_flush(SSL *ssl) { } } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_buffer.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/ssl_buffer.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc.grpc_back index da1de9301..d73055fbf 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_buffer.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_buffer.cc.grpc_back @@ -27,7 +27,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // BIO uses int instead of size_t. No lengths will exceed uint16_t, so this will // not overflow. @@ -37,8 +37,11 @@ static_assert((SSL3_ALIGN_PAYLOAD & (SSL3_ALIGN_PAYLOAD - 1)) == 0, "SSL3_ALIGN_PAYLOAD must be a power of 2"); void SSLBuffer::Clear() { - free(buf_); // Allocated with malloc(). + if (buf_allocated_) { + free(buf_); // Allocated with malloc(). + } buf_ = nullptr; + buf_allocated_ = false; offset_ = 0; size_ = 0; cap_ = 0; @@ -54,27 +57,43 @@ bool SSLBuffer::EnsureCap(size_t header_len, size_t new_cap) { return true; } - // Add up to |SSL3_ALIGN_PAYLOAD| - 1 bytes of slack for alignment. - // - // Since this buffer gets allocated quite frequently and doesn't contain any - // sensitive data, we allocate with malloc rather than |OPENSSL_malloc| and - // avoid zeroing on free. - uint8_t *new_buf = (uint8_t *)malloc(new_cap + SSL3_ALIGN_PAYLOAD - 1); - if (new_buf == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; + uint8_t *new_buf; + bool new_buf_allocated; + size_t new_offset; + if (new_cap <= sizeof(inline_buf_)) { + // This function is called twice per TLS record, first for the five-byte + // header. To avoid allocating twice, use an inline buffer for short inputs. + new_buf = inline_buf_; + new_buf_allocated = false; + new_offset = 0; + } else { + // Add up to |SSL3_ALIGN_PAYLOAD| - 1 bytes of slack for alignment. + // + // Since this buffer gets allocated quite frequently and doesn't contain any + // sensitive data, we allocate with malloc rather than |OPENSSL_malloc| and + // avoid zeroing on free. + new_buf = (uint8_t *)malloc(new_cap + SSL3_ALIGN_PAYLOAD - 1); + if (new_buf == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + new_buf_allocated = true; + + // Offset the buffer such that the record body is aligned. + new_offset = + (0 - header_len - (uintptr_t)new_buf) & (SSL3_ALIGN_PAYLOAD - 1); } - // Offset the buffer such that the record body is aligned. - size_t new_offset = - (0 - header_len - (uintptr_t)new_buf) & (SSL3_ALIGN_PAYLOAD - 1); + // Note if the both old and new buffer are inline, the source and destination + // may alias. + OPENSSL_memmove(new_buf + new_offset, buf_ + offset_, size_); - if (buf_ != NULL) { - OPENSSL_memcpy(new_buf + new_offset, buf_ + offset_, size_); + if (buf_allocated_) { free(buf_); // Allocated with malloc(). } buf_ = new_buf; + buf_allocated_ = new_buf_allocated; offset_ = new_offset; cap_ = new_cap; return true; @@ -113,9 +132,10 @@ static int dtls_read_buffer_next_packet(SSL *ssl) { } // Read a single packet from |ssl->rbio|. |buf->cap()| must fit in an int. - int ret = BIO_read(ssl->rbio, buf->data(), static_cast(buf->cap())); + int ret = + BIO_read(ssl->rbio.get(), buf->data(), static_cast(buf->cap())); if (ret <= 0) { - ssl->s3->rwstate = SSL_READING; + ssl->s3->rwstate = SSL_ERROR_WANT_READ; return ret; } buf->DidWrite(static_cast(ret)); @@ -134,10 +154,10 @@ static int tls_read_buffer_extend_to(SSL *ssl, size_t len) { while (buf->size() < len) { // The amount of data to read is bounded by |buf->cap|, which must fit in an // int. - int ret = BIO_read(ssl->rbio, buf->data() + buf->size(), + int ret = BIO_read(ssl->rbio.get(), buf->data() + buf->size(), static_cast(len - buf->size())); if (ret <= 0) { - ssl->s3->rwstate = SSL_READING; + ssl->s3->rwstate = SSL_ERROR_WANT_READ; return ret; } buf->DidWrite(static_cast(ret)); @@ -163,7 +183,7 @@ int ssl_read_buffer_extend_to(SSL *ssl, size_t len) { return -1; } - if (ssl->rbio == NULL) { + if (ssl->rbio == nullptr) { OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); return -1; } @@ -240,9 +260,9 @@ static int tls_write_buffer_flush(SSL *ssl) { SSLBuffer *buf = &ssl->s3->write_buffer; while (!buf->empty()) { - int ret = BIO_write(ssl->wbio, buf->data(), buf->size()); + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; return ret; } buf->Consume(static_cast(ret)); @@ -257,9 +277,9 @@ static int dtls_write_buffer_flush(SSL *ssl) { return 1; } - int ret = BIO_write(ssl->wbio, buf->data(), buf->size()); + int ret = BIO_write(ssl->wbio.get(), buf->data(), buf->size()); if (ret <= 0) { - ssl->s3->rwstate = SSL_WRITING; + ssl->s3->rwstate = SSL_ERROR_WANT_WRITE; // If the write failed, drop the write buffer anyway. Datagram transports // can't write half a packet, so the caller is expected to retry from the // top. @@ -271,7 +291,7 @@ static int dtls_write_buffer_flush(SSL *ssl) { } int ssl_write_buffer_flush(SSL *ssl) { - if (ssl->wbio == NULL) { + if (ssl->wbio == nullptr) { OPENSSL_PUT_ERROR(SSL, SSL_R_BIO_NOT_SET); return -1; } @@ -283,4 +303,4 @@ int ssl_write_buffer_flush(SSL *ssl) { } } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc new file mode 100644 index 000000000..6c9ae5064 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc @@ -0,0 +1,1015 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +CERT::CERT(const SSL_X509_METHOD *x509_method_arg) + : x509_method(x509_method_arg) {} + +CERT::~CERT() { + ssl_cert_clear_certs(this); + x509_method->cert_free(this); +} + +static CRYPTO_BUFFER *buffer_up_ref(CRYPTO_BUFFER *buffer) { + CRYPTO_BUFFER_up_ref(buffer); + return buffer; +} + +UniquePtr ssl_cert_dup(CERT *cert) { + UniquePtr ret = MakeUnique(cert->x509_method); + if (!ret) { + return nullptr; + } + + if (cert->chain) { + ret->chain.reset(sk_CRYPTO_BUFFER_deep_copy( + cert->chain.get(), buffer_up_ref, CRYPTO_BUFFER_free)); + if (!ret->chain) { + return nullptr; + } + } + + ret->privatekey = UpRef(cert->privatekey); + ret->key_method = cert->key_method; + + if (!ret->sigalgs.CopyFrom(cert->sigalgs)) { + return nullptr; + } + + ret->cert_cb = cert->cert_cb; + ret->cert_cb_arg = cert->cert_cb_arg; + + ret->x509_method->cert_dup(ret.get(), cert); + + ret->signed_cert_timestamp_list = UpRef(cert->signed_cert_timestamp_list); + ret->ocsp_response = UpRef(cert->ocsp_response); + + ret->sid_ctx_length = cert->sid_ctx_length; + OPENSSL_memcpy(ret->sid_ctx, cert->sid_ctx, sizeof(ret->sid_ctx)); + + if (cert->dc) { + ret->dc = cert->dc->Dup(); + if (!ret->dc) { + return nullptr; + } + } + + ret->dc_privatekey = UpRef(cert->dc_privatekey); + ret->dc_key_method = cert->dc_key_method; + + return ret; +} + +// Free up and clear all certificates and chains +void ssl_cert_clear_certs(CERT *cert) { + if (cert == NULL) { + return; + } + + cert->x509_method->cert_clear(cert); + + cert->chain.reset(); + cert->privatekey.reset(); + cert->key_method = nullptr; + + cert->dc.reset(); + cert->dc_privatekey.reset(); + cert->dc_key_method = nullptr; +} + +static void ssl_cert_set_cert_cb(CERT *cert, int (*cb)(SSL *ssl, void *arg), + void *arg) { + cert->cert_cb = cb; + cert->cert_cb_arg = arg; +} + +enum leaf_cert_and_privkey_result_t { + leaf_cert_and_privkey_error, + leaf_cert_and_privkey_ok, + leaf_cert_and_privkey_mismatch, +}; + +// check_leaf_cert_and_privkey checks whether the certificate in |leaf_buffer| +// and the private key in |privkey| are suitable and coherent. It returns +// |leaf_cert_and_privkey_error| and pushes to the error queue if a problem is +// found. If the certificate and private key are valid, but incoherent, it +// returns |leaf_cert_and_privkey_mismatch|. Otherwise it returns +// |leaf_cert_and_privkey_ok|. +static enum leaf_cert_and_privkey_result_t check_leaf_cert_and_privkey( + CRYPTO_BUFFER *leaf_buffer, EVP_PKEY *privkey) { + CBS cert_cbs; + CRYPTO_BUFFER_init_CBS(leaf_buffer, &cert_cbs); + UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); + if (!pubkey) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return leaf_cert_and_privkey_error; + } + + if (!ssl_is_key_type_supported(pubkey->type)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); + return leaf_cert_and_privkey_error; + } + + // An ECC certificate may be usable for ECDH or ECDSA. We only support ECDSA + // certificates, so sanity-check the key usage extension. + if (pubkey->type == EVP_PKEY_EC && + !ssl_cert_check_key_usage(&cert_cbs, key_usage_digital_signature)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); + return leaf_cert_and_privkey_error; + } + + if (privkey != NULL && + // Sanity-check that the private key and the certificate match. + !ssl_compare_public_and_private_key(pubkey.get(), privkey)) { + ERR_clear_error(); + return leaf_cert_and_privkey_mismatch; + } + + return leaf_cert_and_privkey_ok; +} + +static int cert_set_chain_and_key( + CERT *cert, CRYPTO_BUFFER *const *certs, size_t num_certs, + EVP_PKEY *privkey, const SSL_PRIVATE_KEY_METHOD *privkey_method) { + if (num_certs == 0 || + (privkey == NULL && privkey_method == NULL)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (privkey != NULL && privkey_method != NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD); + return 0; + } + + switch (check_leaf_cert_and_privkey(certs[0], privkey)) { + case leaf_cert_and_privkey_error: + return 0; + case leaf_cert_and_privkey_mismatch: + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH); + return 0; + case leaf_cert_and_privkey_ok: + break; + } + + UniquePtr certs_sk(sk_CRYPTO_BUFFER_new_null()); + if (!certs_sk) { + return 0; + } + + for (size_t i = 0; i < num_certs; i++) { + if (!PushToStack(certs_sk.get(), UpRef(certs[i]))) { + return 0; + } + } + + cert->privatekey = UpRef(privkey); + cert->key_method = privkey_method; + + cert->chain = std::move(certs_sk); + return 1; +} + +bool ssl_set_cert(CERT *cert, UniquePtr buffer) { + switch (check_leaf_cert_and_privkey(buffer.get(), cert->privatekey.get())) { + case leaf_cert_and_privkey_error: + return false; + case leaf_cert_and_privkey_mismatch: + // don't fail for a cert/key mismatch, just free current private key + // (when switching to a different cert & key, first this function should + // be used, then |ssl_set_pkey|. + cert->privatekey.reset(); + break; + case leaf_cert_and_privkey_ok: + break; + } + + cert->x509_method->cert_flush_cached_leaf(cert); + + if (cert->chain != nullptr) { + CRYPTO_BUFFER_free(sk_CRYPTO_BUFFER_value(cert->chain.get(), 0)); + sk_CRYPTO_BUFFER_set(cert->chain.get(), 0, buffer.release()); + return true; + } + + cert->chain.reset(sk_CRYPTO_BUFFER_new_null()); + if (cert->chain == nullptr) { + return false; + } + + if (!PushToStack(cert->chain.get(), std::move(buffer))) { + cert->chain.reset(); + return false; + } + + return true; +} + +bool ssl_has_certificate(const SSL_HANDSHAKE *hs) { + return hs->config->cert->chain != nullptr && + sk_CRYPTO_BUFFER_value(hs->config->cert->chain.get(), 0) != nullptr && + ssl_has_private_key(hs); +} + +bool ssl_parse_cert_chain(uint8_t *out_alert, + UniquePtr *out_chain, + UniquePtr *out_pubkey, + uint8_t *out_leaf_sha256, CBS *cbs, + CRYPTO_BUFFER_POOL *pool) { + out_chain->reset(); + out_pubkey->reset(); + + CBS certificate_list; + if (!CBS_get_u24_length_prefixed(cbs, &certificate_list)) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + if (CBS_len(&certificate_list) == 0) { + return true; + } + + UniquePtr chain(sk_CRYPTO_BUFFER_new_null()); + if (!chain) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + UniquePtr pubkey; + while (CBS_len(&certificate_list) > 0) { + CBS certificate; + if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || + CBS_len(&certificate) == 0) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); + return false; + } + + if (sk_CRYPTO_BUFFER_num(chain.get()) == 0) { + pubkey = ssl_cert_parse_pubkey(&certificate); + if (!pubkey) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Retain the hash of the leaf certificate if requested. + if (out_leaf_sha256 != NULL) { + SHA256(CBS_data(&certificate), CBS_len(&certificate), out_leaf_sha256); + } + } + + UniquePtr buf( + CRYPTO_BUFFER_new_from_CBS(&certificate, pool)); + if (!buf || + !PushToStack(chain.get(), std::move(buf))) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + } + + *out_chain = std::move(chain); + *out_pubkey = std::move(pubkey); + return true; +} + +bool ssl_add_cert_chain(SSL_HANDSHAKE *hs, CBB *cbb) { + if (!ssl_has_certificate(hs)) { + return CBB_add_u24(cbb, 0); + } + + CBB certs; + if (!CBB_add_u24_length_prefixed(cbb, &certs)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + STACK_OF(CRYPTO_BUFFER) *chain = hs->config->cert->chain.get(); + for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(chain); i++) { + CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(chain, i); + CBB child; + if (!CBB_add_u24_length_prefixed(&certs, &child) || + !CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), + CRYPTO_BUFFER_len(buffer)) || + !CBB_flush(&certs)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + return CBB_flush(cbb); +} + +// ssl_cert_skip_to_spki parses a DER-encoded, X.509 certificate from |in| and +// positions |*out_tbs_cert| to cover the TBSCertificate, starting at the +// subjectPublicKeyInfo. +static bool ssl_cert_skip_to_spki(const CBS *in, CBS *out_tbs_cert) { + /* From RFC 5280, section 4.1 + * Certificate ::= SEQUENCE { + * tbsCertificate TBSCertificate, + * signatureAlgorithm AlgorithmIdentifier, + * signatureValue BIT STRING } + + * TBSCertificate ::= SEQUENCE { + * version [0] EXPLICIT Version DEFAULT v1, + * serialNumber CertificateSerialNumber, + * signature AlgorithmIdentifier, + * issuer Name, + * validity Validity, + * subject Name, + * subjectPublicKeyInfo SubjectPublicKeyInfo, + * ... } */ + CBS buf = *in; + + CBS toplevel; + if (!CBS_get_asn1(&buf, &toplevel, CBS_ASN1_SEQUENCE) || + CBS_len(&buf) != 0 || + !CBS_get_asn1(&toplevel, out_tbs_cert, CBS_ASN1_SEQUENCE) || + // version + !CBS_get_optional_asn1( + out_tbs_cert, NULL, NULL, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + // serialNumber + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_INTEGER) || + // signature algorithm + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // issuer + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // validity + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // subject + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE)) { + return false; + } + + return true; +} + +UniquePtr ssl_cert_parse_pubkey(const CBS *in) { + CBS buf = *in, tbs_cert; + if (!ssl_cert_skip_to_spki(&buf, &tbs_cert)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return nullptr; + } + + return UniquePtr(EVP_parse_public_key(&tbs_cert)); +} + +bool ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, + const EVP_PKEY *privkey) { + if (EVP_PKEY_is_opaque(privkey)) { + // We cannot check an opaque private key and have to trust that it + // matches. + return true; + } + + switch (EVP_PKEY_cmp(pubkey, privkey)) { + case 1: + return true; + case 0: + OPENSSL_PUT_ERROR(X509, X509_R_KEY_VALUES_MISMATCH); + return false; + case -1: + OPENSSL_PUT_ERROR(X509, X509_R_KEY_TYPE_MISMATCH); + return false; + case -2: + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); + return false; + } + + assert(0); + return false; +} + +bool ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey) { + if (privkey == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED); + return false; + } + + if (cert->chain == nullptr || + sk_CRYPTO_BUFFER_value(cert->chain.get(), 0) == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_ASSIGNED); + return false; + } + + CBS cert_cbs; + CRYPTO_BUFFER_init_CBS(sk_CRYPTO_BUFFER_value(cert->chain.get(), 0), + &cert_cbs); + UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); + if (!pubkey) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); + return false; + } + + return ssl_compare_public_and_private_key(pubkey.get(), privkey); +} + +bool ssl_cert_check_key_usage(const CBS *in, enum ssl_key_usage_t bit) { + CBS buf = *in; + + CBS tbs_cert, outer_extensions; + int has_extensions; + if (!ssl_cert_skip_to_spki(&buf, &tbs_cert) || + // subjectPublicKeyInfo + !CBS_get_asn1(&tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // issuerUniqueID + !CBS_get_optional_asn1( + &tbs_cert, NULL, NULL, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1) || + // subjectUniqueID + !CBS_get_optional_asn1( + &tbs_cert, NULL, NULL, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2) || + !CBS_get_optional_asn1( + &tbs_cert, &outer_extensions, &has_extensions, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + if (!has_extensions) { + return true; + } + + CBS extensions; + if (!CBS_get_asn1(&outer_extensions, &extensions, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + while (CBS_len(&extensions) > 0) { + CBS extension, oid, contents; + if (!CBS_get_asn1(&extensions, &extension, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&extension, &oid, CBS_ASN1_OBJECT) || + (CBS_peek_asn1_tag(&extension, CBS_ASN1_BOOLEAN) && + !CBS_get_asn1(&extension, NULL, CBS_ASN1_BOOLEAN)) || + !CBS_get_asn1(&extension, &contents, CBS_ASN1_OCTETSTRING) || + CBS_len(&extension) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + static const uint8_t kKeyUsageOID[3] = {0x55, 0x1d, 0x0f}; + if (CBS_len(&oid) != sizeof(kKeyUsageOID) || + OPENSSL_memcmp(CBS_data(&oid), kKeyUsageOID, sizeof(kKeyUsageOID)) != + 0) { + continue; + } + + CBS bit_string; + if (!CBS_get_asn1(&contents, &bit_string, CBS_ASN1_BITSTRING) || + CBS_len(&contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + // This is the KeyUsage extension. See + // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + if (!CBS_is_valid_asn1_bitstring(&bit_string)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + if (!CBS_asn1_bitstring_has_bit(&bit_string, bit)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_KEY_USAGE_BIT_INCORRECT); + return false; + } + + return true; + } + + // No KeyUsage extension found. + return true; +} + +UniquePtr ssl_parse_client_CA_list(SSL *ssl, + uint8_t *out_alert, + CBS *cbs) { + CRYPTO_BUFFER_POOL *const pool = ssl->ctx->pool; + + UniquePtr ret(sk_CRYPTO_BUFFER_new_null()); + if (!ret) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + CBS child; + if (!CBS_get_u16_length_prefixed(cbs, &child)) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_LENGTH_MISMATCH); + return nullptr; + } + + while (CBS_len(&child) > 0) { + CBS distinguished_name; + if (!CBS_get_u16_length_prefixed(&child, &distinguished_name)) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_CA_DN_TOO_LONG); + return nullptr; + } + + UniquePtr buffer( + CRYPTO_BUFFER_new_from_CBS(&distinguished_name, pool)); + if (!buffer || + !PushToStack(ret.get(), std::move(buffer))) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + } + + if (!ssl->ctx->x509_method->check_client_CA_list(ret.get())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return nullptr; + } + + return ret; +} + +bool ssl_has_client_CAs(const SSL_CONFIG *cfg) { + const STACK_OF(CRYPTO_BUFFER) *names = cfg->client_CA.get(); + if (names == nullptr) { + names = cfg->ssl->ctx->client_CA.get(); + } + if (names == nullptr) { + return false; + } + return sk_CRYPTO_BUFFER_num(names) > 0; +} + +bool ssl_add_client_CA_list(SSL_HANDSHAKE *hs, CBB *cbb) { + CBB child, name_cbb; + if (!CBB_add_u16_length_prefixed(cbb, &child)) { + return false; + } + + const STACK_OF(CRYPTO_BUFFER) *names = hs->config->client_CA.get(); + if (names == NULL) { + names = hs->ssl->ctx->client_CA.get(); + } + if (names == NULL) { + return CBB_flush(cbb); + } + + for (const CRYPTO_BUFFER *name : names) { + if (!CBB_add_u16_length_prefixed(&child, &name_cbb) || + !CBB_add_bytes(&name_cbb, CRYPTO_BUFFER_data(name), + CRYPTO_BUFFER_len(name))) { + return false; + } + } + + return CBB_flush(cbb); +} + +bool ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, + const CRYPTO_BUFFER *leaf) { + assert(ssl_protocol_version(hs->ssl) < TLS1_3_VERSION); + + // Check the certificate's type matches the cipher. + if (!(hs->new_cipher->algorithm_auth & ssl_cipher_auth_mask_for_key(pkey))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CERTIFICATE_TYPE); + return false; + } + + if (EVP_PKEY_id(pkey) == EVP_PKEY_EC) { + // Check the key's group and point format are acceptable. + EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(pkey); + uint16_t group_id; + if (!ssl_nid_to_group_id( + &group_id, EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key))) || + !tls1_check_group_id(hs, group_id) || + EC_KEY_get_conv_form(ec_key) != POINT_CONVERSION_UNCOMPRESSED) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECC_CERT); + return false; + } + } + + return true; +} + +bool ssl_on_certificate_selected(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!ssl_has_certificate(hs)) { + // Nothing to do. + return true; + } + + if (!ssl->ctx->x509_method->ssl_auto_chain_if_needed(hs)) { + return false; + } + + CBS leaf; + CRYPTO_BUFFER_init_CBS( + sk_CRYPTO_BUFFER_value(hs->config->cert->chain.get(), 0), &leaf); + + if (ssl_signing_with_dc(hs)) { + hs->local_pubkey = UpRef(hs->config->cert->dc->pkey); + } else { + hs->local_pubkey = ssl_cert_parse_pubkey(&leaf); + } + return hs->local_pubkey != NULL; +} + + +// Delegated credentials. + +DC::DC() = default; +DC::~DC() = default; + +UniquePtr DC::Dup() { + bssl::UniquePtr ret = MakeUnique(); + if (!ret) { + return nullptr; + } + + ret->raw = UpRef(raw); + ret->expected_cert_verify_algorithm = expected_cert_verify_algorithm; + ret->pkey = UpRef(pkey); + return ret; +} + +// static +UniquePtr DC::Parse(CRYPTO_BUFFER *in, uint8_t *out_alert) { + UniquePtr dc = MakeUnique(); + if (!dc) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return nullptr; + } + + dc->raw = UpRef(in); + + CBS pubkey, deleg, sig; + uint32_t valid_time; + uint16_t algorithm; + CRYPTO_BUFFER_init_CBS(dc->raw.get(), &deleg); + if (!CBS_get_u32(&deleg, &valid_time) || + !CBS_get_u16(&deleg, &dc->expected_cert_verify_algorithm) || + !CBS_get_u24_length_prefixed(&deleg, &pubkey) || + !CBS_get_u16(&deleg, &algorithm) || + !CBS_get_u16_length_prefixed(&deleg, &sig) || + CBS_len(&deleg) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return nullptr; + } + + dc->pkey.reset(EVP_parse_public_key(&pubkey)); + if (dc->pkey == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return nullptr; + } + + return dc; +} + +// ssl_can_serve_dc returns true if the host has configured a DC that it can +// serve in the handshake. Specifically, it checks that a DC has been +// configured and that the DC signature algorithm is supported by the peer. +static bool ssl_can_serve_dc(const SSL_HANDSHAKE *hs) { + // Check that a DC has been configured. + const CERT *cert = hs->config->cert.get(); + if (cert->dc == nullptr || + cert->dc->raw == nullptr || + (cert->dc_privatekey == nullptr && cert->dc_key_method == nullptr)) { + return false; + } + + // Check that 1.3 or higher has been negotiated. + const DC *dc = cert->dc.get(); + assert(hs->ssl->s3->have_version); + if (ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + return false; + } + + // Check that the DC signature algorithm is supported by the peer. + Span peer_sigalgs = tls1_get_peer_verify_algorithms(hs); + bool sigalg_found = false; + for (uint16_t peer_sigalg : peer_sigalgs) { + if (dc->expected_cert_verify_algorithm == peer_sigalg) { + sigalg_found = true; + break; + } + } + + return sigalg_found; +} + +bool ssl_signing_with_dc(const SSL_HANDSHAKE *hs) { + // As of draft-ietf-tls-subcert-03, only the server may use delegated + // credentials to authenticate itself. + return hs->ssl->server && + hs->delegated_credential_requested && + ssl_can_serve_dc(hs); +} + +static int cert_set_dc(CERT *cert, CRYPTO_BUFFER *const raw, EVP_PKEY *privkey, + const SSL_PRIVATE_KEY_METHOD *key_method) { + if (privkey == nullptr && key_method == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (privkey != nullptr && key_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD); + return 0; + } + + uint8_t alert; + UniquePtr dc = DC::Parse(raw, &alert); + if (dc == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_DELEGATED_CREDENTIAL); + return 0; + } + + if (privkey) { + // Check that the public and private keys match. + if (!ssl_compare_public_and_private_key(dc->pkey.get(), privkey)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH); + return 0; + } + } + + cert->dc = std::move(dc); + cert->dc_privatekey = UpRef(privkey); + cert->dc_key_method = key_method; + + return 1; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_set_chain_and_key(SSL *ssl, CRYPTO_BUFFER *const *certs, + size_t num_certs, EVP_PKEY *privkey, + const SSL_PRIVATE_KEY_METHOD *privkey_method) { + if (!ssl->config) { + return 0; + } + return cert_set_chain_and_key(ssl->config->cert.get(), certs, num_certs, + privkey, privkey_method); +} + +int SSL_CTX_set_chain_and_key(SSL_CTX *ctx, CRYPTO_BUFFER *const *certs, + size_t num_certs, EVP_PKEY *privkey, + const SSL_PRIVATE_KEY_METHOD *privkey_method) { + return cert_set_chain_and_key(ctx->cert.get(), certs, num_certs, privkey, + privkey_method); +} + +int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, + const uint8_t *der) { + UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); + if (!buffer) { + return 0; + } + + return ssl_set_cert(ctx->cert.get(), std::move(buffer)); +} + +int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { + UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); + if (!buffer || !ssl->config) { + return 0; + } + + return ssl_set_cert(ssl->config->cert.get(), std::move(buffer)); +} + +void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), + void *arg) { + ssl_cert_set_cert_cb(ctx->cert.get(), cb, arg); +} + +void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg) { + if (!ssl->config) { + return; + } + ssl_cert_set_cert_cb(ssl->config->cert.get(), cb, arg); +} + +const STACK_OF(CRYPTO_BUFFER) *SSL_get0_peer_certificates(const SSL *ssl) { + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return NULL; + } + + return session->certs.get(); +} + +const STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs(const SSL *ssl) { + if (ssl->s3->hs == NULL) { + return NULL; + } + return ssl->s3->hs->ca_names.get(); +} + +static int set_signed_cert_timestamp_list(CERT *cert, const uint8_t *list, + size_t list_len) { + CBS sct_list; + CBS_init(&sct_list, list, list_len); + if (!ssl_is_sct_list_valid(&sct_list)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SCT_LIST); + return 0; + } + + cert->signed_cert_timestamp_list.reset( + CRYPTO_BUFFER_new(CBS_data(&sct_list), CBS_len(&sct_list), nullptr)); + return cert->signed_cert_timestamp_list != nullptr; +} + +int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, const uint8_t *list, + size_t list_len) { + return set_signed_cert_timestamp_list(ctx->cert.get(), list, list_len); +} + +int SSL_set_signed_cert_timestamp_list(SSL *ssl, const uint8_t *list, + size_t list_len) { + if (!ssl->config) { + return 0; + } + return set_signed_cert_timestamp_list(ssl->config->cert.get(), list, + list_len); +} + +int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, const uint8_t *response, + size_t response_len) { + ctx->cert->ocsp_response.reset( + CRYPTO_BUFFER_new(response, response_len, nullptr)); + return ctx->cert->ocsp_response != nullptr; +} + +int SSL_set_ocsp_response(SSL *ssl, const uint8_t *response, + size_t response_len) { + if (!ssl->config) { + return 0; + } + ssl->config->cert->ocsp_response.reset( + CRYPTO_BUFFER_new(response, response_len, nullptr)); + return ssl->config->cert->ocsp_response != nullptr; +} + +void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, STACK_OF(CRYPTO_BUFFER) *name_list) { + ctx->x509_method->ssl_ctx_flush_cached_client_CA(ctx); + ctx->client_CA.reset(name_list); +} + +void SSL_set0_client_CAs(SSL *ssl, STACK_OF(CRYPTO_BUFFER) *name_list) { + if (!ssl->config) { + return; + } + ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl->config.get()); + ssl->config->client_CA.reset(name_list); +} + +int SSL_set1_delegated_credential(SSL *ssl, CRYPTO_BUFFER *dc, EVP_PKEY *pkey, + const SSL_PRIVATE_KEY_METHOD *key_method) { + if (!ssl->config) { + return 0; + } + + return cert_set_dc(ssl->config->cert.get(), dc, pkey, key_method); +} + +int SSL_delegated_credential_used(const SSL *ssl) { + return ssl->s3->delegated_credential_used; +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc.grpc_back new file mode 100644 index 000000000..4f8038232 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_cert.cc.grpc_back @@ -0,0 +1,1015 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ + +#include + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +CERT::CERT(const SSL_X509_METHOD *x509_method_arg) + : x509_method(x509_method_arg) {} + +CERT::~CERT() { + ssl_cert_clear_certs(this); + x509_method->cert_free(this); +} + +static CRYPTO_BUFFER *buffer_up_ref(CRYPTO_BUFFER *buffer) { + CRYPTO_BUFFER_up_ref(buffer); + return buffer; +} + +UniquePtr ssl_cert_dup(CERT *cert) { + UniquePtr ret = MakeUnique(cert->x509_method); + if (!ret) { + return nullptr; + } + + if (cert->chain) { + ret->chain.reset(sk_CRYPTO_BUFFER_deep_copy( + cert->chain.get(), buffer_up_ref, CRYPTO_BUFFER_free)); + if (!ret->chain) { + return nullptr; + } + } + + ret->privatekey = UpRef(cert->privatekey); + ret->key_method = cert->key_method; + + if (!ret->sigalgs.CopyFrom(cert->sigalgs)) { + return nullptr; + } + + ret->cert_cb = cert->cert_cb; + ret->cert_cb_arg = cert->cert_cb_arg; + + ret->x509_method->cert_dup(ret.get(), cert); + + ret->signed_cert_timestamp_list = UpRef(cert->signed_cert_timestamp_list); + ret->ocsp_response = UpRef(cert->ocsp_response); + + ret->sid_ctx_length = cert->sid_ctx_length; + OPENSSL_memcpy(ret->sid_ctx, cert->sid_ctx, sizeof(ret->sid_ctx)); + + if (cert->dc) { + ret->dc = cert->dc->Dup(); + if (!ret->dc) { + return nullptr; + } + } + + ret->dc_privatekey = UpRef(cert->dc_privatekey); + ret->dc_key_method = cert->dc_key_method; + + return ret; +} + +// Free up and clear all certificates and chains +void ssl_cert_clear_certs(CERT *cert) { + if (cert == NULL) { + return; + } + + cert->x509_method->cert_clear(cert); + + cert->chain.reset(); + cert->privatekey.reset(); + cert->key_method = nullptr; + + cert->dc.reset(); + cert->dc_privatekey.reset(); + cert->dc_key_method = nullptr; +} + +static void ssl_cert_set_cert_cb(CERT *cert, int (*cb)(SSL *ssl, void *arg), + void *arg) { + cert->cert_cb = cb; + cert->cert_cb_arg = arg; +} + +enum leaf_cert_and_privkey_result_t { + leaf_cert_and_privkey_error, + leaf_cert_and_privkey_ok, + leaf_cert_and_privkey_mismatch, +}; + +// check_leaf_cert_and_privkey checks whether the certificate in |leaf_buffer| +// and the private key in |privkey| are suitable and coherent. It returns +// |leaf_cert_and_privkey_error| and pushes to the error queue if a problem is +// found. If the certificate and private key are valid, but incoherent, it +// returns |leaf_cert_and_privkey_mismatch|. Otherwise it returns +// |leaf_cert_and_privkey_ok|. +static enum leaf_cert_and_privkey_result_t check_leaf_cert_and_privkey( + CRYPTO_BUFFER *leaf_buffer, EVP_PKEY *privkey) { + CBS cert_cbs; + CRYPTO_BUFFER_init_CBS(leaf_buffer, &cert_cbs); + UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); + if (!pubkey) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return leaf_cert_and_privkey_error; + } + + if (!ssl_is_key_type_supported(pubkey->type)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); + return leaf_cert_and_privkey_error; + } + + // An ECC certificate may be usable for ECDH or ECDSA. We only support ECDSA + // certificates, so sanity-check the key usage extension. + if (pubkey->type == EVP_PKEY_EC && + !ssl_cert_check_key_usage(&cert_cbs, key_usage_digital_signature)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); + return leaf_cert_and_privkey_error; + } + + if (privkey != NULL && + // Sanity-check that the private key and the certificate match. + !ssl_compare_public_and_private_key(pubkey.get(), privkey)) { + ERR_clear_error(); + return leaf_cert_and_privkey_mismatch; + } + + return leaf_cert_and_privkey_ok; +} + +static int cert_set_chain_and_key( + CERT *cert, CRYPTO_BUFFER *const *certs, size_t num_certs, + EVP_PKEY *privkey, const SSL_PRIVATE_KEY_METHOD *privkey_method) { + if (num_certs == 0 || + (privkey == NULL && privkey_method == NULL)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (privkey != NULL && privkey_method != NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD); + return 0; + } + + switch (check_leaf_cert_and_privkey(certs[0], privkey)) { + case leaf_cert_and_privkey_error: + return 0; + case leaf_cert_and_privkey_mismatch: + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH); + return 0; + case leaf_cert_and_privkey_ok: + break; + } + + UniquePtr certs_sk(sk_CRYPTO_BUFFER_new_null()); + if (!certs_sk) { + return 0; + } + + for (size_t i = 0; i < num_certs; i++) { + if (!PushToStack(certs_sk.get(), UpRef(certs[i]))) { + return 0; + } + } + + cert->privatekey = UpRef(privkey); + cert->key_method = privkey_method; + + cert->chain = std::move(certs_sk); + return 1; +} + +bool ssl_set_cert(CERT *cert, UniquePtr buffer) { + switch (check_leaf_cert_and_privkey(buffer.get(), cert->privatekey.get())) { + case leaf_cert_and_privkey_error: + return false; + case leaf_cert_and_privkey_mismatch: + // don't fail for a cert/key mismatch, just free current private key + // (when switching to a different cert & key, first this function should + // be used, then |ssl_set_pkey|. + cert->privatekey.reset(); + break; + case leaf_cert_and_privkey_ok: + break; + } + + cert->x509_method->cert_flush_cached_leaf(cert); + + if (cert->chain != nullptr) { + CRYPTO_BUFFER_free(sk_CRYPTO_BUFFER_value(cert->chain.get(), 0)); + sk_CRYPTO_BUFFER_set(cert->chain.get(), 0, buffer.release()); + return true; + } + + cert->chain.reset(sk_CRYPTO_BUFFER_new_null()); + if (cert->chain == nullptr) { + return false; + } + + if (!PushToStack(cert->chain.get(), std::move(buffer))) { + cert->chain.reset(); + return false; + } + + return true; +} + +bool ssl_has_certificate(const SSL_HANDSHAKE *hs) { + return hs->config->cert->chain != nullptr && + sk_CRYPTO_BUFFER_value(hs->config->cert->chain.get(), 0) != nullptr && + ssl_has_private_key(hs); +} + +bool ssl_parse_cert_chain(uint8_t *out_alert, + UniquePtr *out_chain, + UniquePtr *out_pubkey, + uint8_t *out_leaf_sha256, CBS *cbs, + CRYPTO_BUFFER_POOL *pool) { + out_chain->reset(); + out_pubkey->reset(); + + CBS certificate_list; + if (!CBS_get_u24_length_prefixed(cbs, &certificate_list)) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + if (CBS_len(&certificate_list) == 0) { + return true; + } + + UniquePtr chain(sk_CRYPTO_BUFFER_new_null()); + if (!chain) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + UniquePtr pubkey; + while (CBS_len(&certificate_list) > 0) { + CBS certificate; + if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || + CBS_len(&certificate) == 0) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); + return false; + } + + if (sk_CRYPTO_BUFFER_num(chain.get()) == 0) { + pubkey = ssl_cert_parse_pubkey(&certificate); + if (!pubkey) { + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Retain the hash of the leaf certificate if requested. + if (out_leaf_sha256 != NULL) { + SHA256(CBS_data(&certificate), CBS_len(&certificate), out_leaf_sha256); + } + } + + UniquePtr buf( + CRYPTO_BUFFER_new_from_CBS(&certificate, pool)); + if (!buf || + !PushToStack(chain.get(), std::move(buf))) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + } + + *out_chain = std::move(chain); + *out_pubkey = std::move(pubkey); + return true; +} + +bool ssl_add_cert_chain(SSL_HANDSHAKE *hs, CBB *cbb) { + if (!ssl_has_certificate(hs)) { + return CBB_add_u24(cbb, 0); + } + + CBB certs; + if (!CBB_add_u24_length_prefixed(cbb, &certs)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + STACK_OF(CRYPTO_BUFFER) *chain = hs->config->cert->chain.get(); + for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(chain); i++) { + CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(chain, i); + CBB child; + if (!CBB_add_u24_length_prefixed(&certs, &child) || + !CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), + CRYPTO_BUFFER_len(buffer)) || + !CBB_flush(&certs)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + return CBB_flush(cbb); +} + +// ssl_cert_skip_to_spki parses a DER-encoded, X.509 certificate from |in| and +// positions |*out_tbs_cert| to cover the TBSCertificate, starting at the +// subjectPublicKeyInfo. +static bool ssl_cert_skip_to_spki(const CBS *in, CBS *out_tbs_cert) { + /* From RFC 5280, section 4.1 + * Certificate ::= SEQUENCE { + * tbsCertificate TBSCertificate, + * signatureAlgorithm AlgorithmIdentifier, + * signatureValue BIT STRING } + + * TBSCertificate ::= SEQUENCE { + * version [0] EXPLICIT Version DEFAULT v1, + * serialNumber CertificateSerialNumber, + * signature AlgorithmIdentifier, + * issuer Name, + * validity Validity, + * subject Name, + * subjectPublicKeyInfo SubjectPublicKeyInfo, + * ... } */ + CBS buf = *in; + + CBS toplevel; + if (!CBS_get_asn1(&buf, &toplevel, CBS_ASN1_SEQUENCE) || + CBS_len(&buf) != 0 || + !CBS_get_asn1(&toplevel, out_tbs_cert, CBS_ASN1_SEQUENCE) || + // version + !CBS_get_optional_asn1( + out_tbs_cert, NULL, NULL, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || + // serialNumber + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_INTEGER) || + // signature algorithm + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // issuer + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // validity + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // subject + !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE)) { + return false; + } + + return true; +} + +UniquePtr ssl_cert_parse_pubkey(const CBS *in) { + CBS buf = *in, tbs_cert; + if (!ssl_cert_skip_to_spki(&buf, &tbs_cert)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return nullptr; + } + + return UniquePtr(EVP_parse_public_key(&tbs_cert)); +} + +bool ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, + const EVP_PKEY *privkey) { + if (EVP_PKEY_is_opaque(privkey)) { + // We cannot check an opaque private key and have to trust that it + // matches. + return true; + } + + switch (EVP_PKEY_cmp(pubkey, privkey)) { + case 1: + return true; + case 0: + OPENSSL_PUT_ERROR(X509, X509_R_KEY_VALUES_MISMATCH); + return false; + case -1: + OPENSSL_PUT_ERROR(X509, X509_R_KEY_TYPE_MISMATCH); + return false; + case -2: + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); + return false; + } + + assert(0); + return false; +} + +bool ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey) { + if (privkey == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED); + return false; + } + + if (cert->chain == nullptr || + sk_CRYPTO_BUFFER_value(cert->chain.get(), 0) == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_ASSIGNED); + return false; + } + + CBS cert_cbs; + CRYPTO_BUFFER_init_CBS(sk_CRYPTO_BUFFER_value(cert->chain.get(), 0), + &cert_cbs); + UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); + if (!pubkey) { + OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); + return false; + } + + return ssl_compare_public_and_private_key(pubkey.get(), privkey); +} + +bool ssl_cert_check_key_usage(const CBS *in, enum ssl_key_usage_t bit) { + CBS buf = *in; + + CBS tbs_cert, outer_extensions; + int has_extensions; + if (!ssl_cert_skip_to_spki(&buf, &tbs_cert) || + // subjectPublicKeyInfo + !CBS_get_asn1(&tbs_cert, NULL, CBS_ASN1_SEQUENCE) || + // issuerUniqueID + !CBS_get_optional_asn1( + &tbs_cert, NULL, NULL, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1) || + // subjectUniqueID + !CBS_get_optional_asn1( + &tbs_cert, NULL, NULL, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2) || + !CBS_get_optional_asn1( + &tbs_cert, &outer_extensions, &has_extensions, + CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + if (!has_extensions) { + return true; + } + + CBS extensions; + if (!CBS_get_asn1(&outer_extensions, &extensions, CBS_ASN1_SEQUENCE)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + while (CBS_len(&extensions) > 0) { + CBS extension, oid, contents; + if (!CBS_get_asn1(&extensions, &extension, CBS_ASN1_SEQUENCE) || + !CBS_get_asn1(&extension, &oid, CBS_ASN1_OBJECT) || + (CBS_peek_asn1_tag(&extension, CBS_ASN1_BOOLEAN) && + !CBS_get_asn1(&extension, NULL, CBS_ASN1_BOOLEAN)) || + !CBS_get_asn1(&extension, &contents, CBS_ASN1_OCTETSTRING) || + CBS_len(&extension) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + static const uint8_t kKeyUsageOID[3] = {0x55, 0x1d, 0x0f}; + if (CBS_len(&oid) != sizeof(kKeyUsageOID) || + OPENSSL_memcmp(CBS_data(&oid), kKeyUsageOID, sizeof(kKeyUsageOID)) != + 0) { + continue; + } + + CBS bit_string; + if (!CBS_get_asn1(&contents, &bit_string, CBS_ASN1_BITSTRING) || + CBS_len(&contents) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + // This is the KeyUsage extension. See + // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 + if (!CBS_is_valid_asn1_bitstring(&bit_string)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); + return false; + } + + if (!CBS_asn1_bitstring_has_bit(&bit_string, bit)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_KEY_USAGE_BIT_INCORRECT); + return false; + } + + return true; + } + + // No KeyUsage extension found. + return true; +} + +UniquePtr ssl_parse_client_CA_list(SSL *ssl, + uint8_t *out_alert, + CBS *cbs) { + CRYPTO_BUFFER_POOL *const pool = ssl->ctx->pool; + + UniquePtr ret(sk_CRYPTO_BUFFER_new_null()); + if (!ret) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + + CBS child; + if (!CBS_get_u16_length_prefixed(cbs, &child)) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_LENGTH_MISMATCH); + return nullptr; + } + + while (CBS_len(&child) > 0) { + CBS distinguished_name; + if (!CBS_get_u16_length_prefixed(&child, &distinguished_name)) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_CA_DN_TOO_LONG); + return nullptr; + } + + UniquePtr buffer( + CRYPTO_BUFFER_new_from_CBS(&distinguished_name, pool)); + if (!buffer || + !PushToStack(ret.get(), std::move(buffer))) { + *out_alert = SSL_AD_INTERNAL_ERROR; + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return nullptr; + } + } + + if (!ssl->ctx->x509_method->check_client_CA_list(ret.get())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return nullptr; + } + + return ret; +} + +bool ssl_has_client_CAs(const SSL_CONFIG *cfg) { + const STACK_OF(CRYPTO_BUFFER) *names = cfg->client_CA.get(); + if (names == nullptr) { + names = cfg->ssl->ctx->client_CA.get(); + } + if (names == nullptr) { + return false; + } + return sk_CRYPTO_BUFFER_num(names) > 0; +} + +bool ssl_add_client_CA_list(SSL_HANDSHAKE *hs, CBB *cbb) { + CBB child, name_cbb; + if (!CBB_add_u16_length_prefixed(cbb, &child)) { + return false; + } + + const STACK_OF(CRYPTO_BUFFER) *names = hs->config->client_CA.get(); + if (names == NULL) { + names = hs->ssl->ctx->client_CA.get(); + } + if (names == NULL) { + return CBB_flush(cbb); + } + + for (const CRYPTO_BUFFER *name : names) { + if (!CBB_add_u16_length_prefixed(&child, &name_cbb) || + !CBB_add_bytes(&name_cbb, CRYPTO_BUFFER_data(name), + CRYPTO_BUFFER_len(name))) { + return false; + } + } + + return CBB_flush(cbb); +} + +bool ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, + const CRYPTO_BUFFER *leaf) { + assert(ssl_protocol_version(hs->ssl) < TLS1_3_VERSION); + + // Check the certificate's type matches the cipher. + if (!(hs->new_cipher->algorithm_auth & ssl_cipher_auth_mask_for_key(pkey))) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CERTIFICATE_TYPE); + return false; + } + + if (EVP_PKEY_id(pkey) == EVP_PKEY_EC) { + // Check the key's group and point format are acceptable. + EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(pkey); + uint16_t group_id; + if (!ssl_nid_to_group_id( + &group_id, EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key))) || + !tls1_check_group_id(hs, group_id) || + EC_KEY_get_conv_form(ec_key) != POINT_CONVERSION_UNCOMPRESSED) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECC_CERT); + return false; + } + } + + return true; +} + +bool ssl_on_certificate_selected(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!ssl_has_certificate(hs)) { + // Nothing to do. + return true; + } + + if (!ssl->ctx->x509_method->ssl_auto_chain_if_needed(hs)) { + return false; + } + + CBS leaf; + CRYPTO_BUFFER_init_CBS( + sk_CRYPTO_BUFFER_value(hs->config->cert->chain.get(), 0), &leaf); + + if (ssl_signing_with_dc(hs)) { + hs->local_pubkey = UpRef(hs->config->cert->dc->pkey); + } else { + hs->local_pubkey = ssl_cert_parse_pubkey(&leaf); + } + return hs->local_pubkey != NULL; +} + + +// Delegated credentials. + +DC::DC() = default; +DC::~DC() = default; + +UniquePtr DC::Dup() { + bssl::UniquePtr ret = MakeUnique(); + if (!ret) { + return nullptr; + } + + ret->raw = UpRef(raw); + ret->expected_cert_verify_algorithm = expected_cert_verify_algorithm; + ret->pkey = UpRef(pkey); + return ret; +} + +// static +UniquePtr DC::Parse(CRYPTO_BUFFER *in, uint8_t *out_alert) { + UniquePtr dc = MakeUnique(); + if (!dc) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return nullptr; + } + + dc->raw = UpRef(in); + + CBS pubkey, deleg, sig; + uint32_t valid_time; + uint16_t algorithm; + CRYPTO_BUFFER_init_CBS(dc->raw.get(), &deleg); + if (!CBS_get_u32(&deleg, &valid_time) || + !CBS_get_u16(&deleg, &dc->expected_cert_verify_algorithm) || + !CBS_get_u24_length_prefixed(&deleg, &pubkey) || + !CBS_get_u16(&deleg, &algorithm) || + !CBS_get_u16_length_prefixed(&deleg, &sig) || + CBS_len(&deleg) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return nullptr; + } + + dc->pkey.reset(EVP_parse_public_key(&pubkey)); + if (dc->pkey == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return nullptr; + } + + return dc; +} + +// ssl_can_serve_dc returns true if the host has configured a DC that it can +// serve in the handshake. Specifically, it checks that a DC has been +// configured and that the DC signature algorithm is supported by the peer. +static bool ssl_can_serve_dc(const SSL_HANDSHAKE *hs) { + // Check that a DC has been configured. + const CERT *cert = hs->config->cert.get(); + if (cert->dc == nullptr || + cert->dc->raw == nullptr || + (cert->dc_privatekey == nullptr && cert->dc_key_method == nullptr)) { + return false; + } + + // Check that 1.3 or higher has been negotiated. + const DC *dc = cert->dc.get(); + assert(hs->ssl->s3->have_version); + if (ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + return false; + } + + // Check that the DC signature algorithm is supported by the peer. + Span peer_sigalgs = tls1_get_peer_verify_algorithms(hs); + bool sigalg_found = false; + for (uint16_t peer_sigalg : peer_sigalgs) { + if (dc->expected_cert_verify_algorithm == peer_sigalg) { + sigalg_found = true; + break; + } + } + + return sigalg_found; +} + +bool ssl_signing_with_dc(const SSL_HANDSHAKE *hs) { + // As of draft-ietf-tls-subcert-03, only the server may use delegated + // credentials to authenticate itself. + return hs->ssl->server && + hs->delegated_credential_requested && + ssl_can_serve_dc(hs); +} + +static int cert_set_dc(CERT *cert, CRYPTO_BUFFER *const raw, EVP_PKEY *privkey, + const SSL_PRIVATE_KEY_METHOD *key_method) { + if (privkey == nullptr && key_method == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + if (privkey != nullptr && key_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD); + return 0; + } + + uint8_t alert; + UniquePtr dc = DC::Parse(raw, &alert); + if (dc == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_DELEGATED_CREDENTIAL); + return 0; + } + + if (privkey) { + // Check that the public and private keys match. + if (!ssl_compare_public_and_private_key(dc->pkey.get(), privkey)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH); + return 0; + } + } + + cert->dc = std::move(dc); + cert->dc_privatekey = UpRef(privkey); + cert->dc_key_method = key_method; + + return 1; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_set_chain_and_key(SSL *ssl, CRYPTO_BUFFER *const *certs, + size_t num_certs, EVP_PKEY *privkey, + const SSL_PRIVATE_KEY_METHOD *privkey_method) { + if (!ssl->config) { + return 0; + } + return cert_set_chain_and_key(ssl->config->cert.get(), certs, num_certs, + privkey, privkey_method); +} + +int SSL_CTX_set_chain_and_key(SSL_CTX *ctx, CRYPTO_BUFFER *const *certs, + size_t num_certs, EVP_PKEY *privkey, + const SSL_PRIVATE_KEY_METHOD *privkey_method) { + return cert_set_chain_and_key(ctx->cert.get(), certs, num_certs, privkey, + privkey_method); +} + +int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, + const uint8_t *der) { + UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); + if (!buffer) { + return 0; + } + + return ssl_set_cert(ctx->cert.get(), std::move(buffer)); +} + +int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { + UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); + if (!buffer || !ssl->config) { + return 0; + } + + return ssl_set_cert(ssl->config->cert.get(), std::move(buffer)); +} + +void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), + void *arg) { + ssl_cert_set_cert_cb(ctx->cert.get(), cb, arg); +} + +void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg) { + if (!ssl->config) { + return; + } + ssl_cert_set_cert_cb(ssl->config->cert.get(), cb, arg); +} + +const STACK_OF(CRYPTO_BUFFER) *SSL_get0_peer_certificates(const SSL *ssl) { + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return NULL; + } + + return session->certs.get(); +} + +const STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs(const SSL *ssl) { + if (ssl->s3->hs == NULL) { + return NULL; + } + return ssl->s3->hs->ca_names.get(); +} + +static int set_signed_cert_timestamp_list(CERT *cert, const uint8_t *list, + size_t list_len) { + CBS sct_list; + CBS_init(&sct_list, list, list_len); + if (!ssl_is_sct_list_valid(&sct_list)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SCT_LIST); + return 0; + } + + cert->signed_cert_timestamp_list.reset( + CRYPTO_BUFFER_new(CBS_data(&sct_list), CBS_len(&sct_list), nullptr)); + return cert->signed_cert_timestamp_list != nullptr; +} + +int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, const uint8_t *list, + size_t list_len) { + return set_signed_cert_timestamp_list(ctx->cert.get(), list, list_len); +} + +int SSL_set_signed_cert_timestamp_list(SSL *ssl, const uint8_t *list, + size_t list_len) { + if (!ssl->config) { + return 0; + } + return set_signed_cert_timestamp_list(ssl->config->cert.get(), list, + list_len); +} + +int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, const uint8_t *response, + size_t response_len) { + ctx->cert->ocsp_response.reset( + CRYPTO_BUFFER_new(response, response_len, nullptr)); + return ctx->cert->ocsp_response != nullptr; +} + +int SSL_set_ocsp_response(SSL *ssl, const uint8_t *response, + size_t response_len) { + if (!ssl->config) { + return 0; + } + ssl->config->cert->ocsp_response.reset( + CRYPTO_BUFFER_new(response, response_len, nullptr)); + return ssl->config->cert->ocsp_response != nullptr; +} + +void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, STACK_OF(CRYPTO_BUFFER) *name_list) { + ctx->x509_method->ssl_ctx_flush_cached_client_CA(ctx); + ctx->client_CA.reset(name_list); +} + +void SSL_set0_client_CAs(SSL *ssl, STACK_OF(CRYPTO_BUFFER) *name_list) { + if (!ssl->config) { + return; + } + ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl->config.get()); + ssl->config->client_CA.reset(name_list); +} + +int SSL_set1_delegated_credential(SSL *ssl, CRYPTO_BUFFER *dc, EVP_PKEY *pkey, + const SSL_PRIVATE_KEY_METHOD *key_method) { + if (!ssl->config) { + return 0; + } + + return cert_set_dc(ssl->config->cert.get(), dc, pkey, key_method); +} + +int SSL_delegated_credential_used(const SSL *ssl) { + return ssl->s3->delegated_credential_used; +} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_cipher.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc similarity index 87% rename from Pods/BoringSSL-GRPC/ssl/ssl_cipher.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc index a7c5a032d..46f328e66 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_cipher.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc @@ -143,7 +143,6 @@ #include #include -#include #include #include #include @@ -154,10 +153,9 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN -// kCiphers is an array of all supported ciphers, sorted by id. -static const SSL_CIPHER kCiphers[] = { +static constexpr SSL_CIPHER kCiphers[] = { // The RSA ciphers // Cipher 02 { @@ -210,33 +208,6 @@ static const SSL_CIPHER kCiphers[] = { SSL_HANDSHAKE_MAC_DEFAULT, }, - - // TLS v1.2 ciphersuites - - // Cipher 3C - { - TLS1_TXT_RSA_WITH_AES_128_SHA256, - "TLS_RSA_WITH_AES_128_CBC_SHA256", - TLS1_CK_RSA_WITH_AES_128_SHA256, - SSL_kRSA, - SSL_aRSA, - SSL_AES128, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - - // Cipher 3D - { - TLS1_TXT_RSA_WITH_AES_256_SHA256, - "TLS_RSA_WITH_AES_256_CBC_SHA256", - TLS1_CK_RSA_WITH_AES_256_SHA256, - SSL_kRSA, - SSL_aRSA, - SSL_AES256, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - // PSK cipher suites. // Cipher 8C @@ -375,58 +346,6 @@ static const SSL_CIPHER kCiphers[] = { SSL_HANDSHAKE_MAC_DEFAULT, }, - - // HMAC based TLS v1.2 ciphersuites from RFC5289 - - // Cipher C023 - { - TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256, - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256, - SSL_kECDHE, - SSL_aECDSA, - SSL_AES128, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - - // Cipher C024 - { - TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384, - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", - TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384, - SSL_kECDHE, - SSL_aECDSA, - SSL_AES256, - SSL_SHA384, - SSL_HANDSHAKE_MAC_SHA384, - }, - - // Cipher C027 - { - TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256, - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256, - SSL_kECDHE, - SSL_aRSA, - SSL_AES128, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - - // Cipher C028 - { - TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384, - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", - TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384, - SSL_kECDHE, - SSL_aRSA, - SSL_AES256, - SSL_SHA384, - SSL_HANDSHAKE_MAC_SHA384, - }, - - // GCM based TLS v1.2 ciphersuites from RFC5289 // Cipher C02B @@ -543,7 +462,9 @@ static const SSL_CIPHER kCiphers[] = { }; -static const size_t kCiphersLen = OPENSSL_ARRAY_SIZE(kCiphers); +Span AllCiphers() { + return MakeConstSpan(kCiphers, OPENSSL_ARRAY_SIZE(kCiphers)); +} #define CIPHER_ADD 1 #define CIPHER_KILL 2 @@ -616,8 +537,6 @@ static const CIPHER_ALIAS kCipherAliases[] = { // MAC aliases {"SHA1", ~0u, ~0u, ~0u, SSL_SHA1, 0}, {"SHA", ~0u, ~0u, ~0u, SSL_SHA1, 0}, - {"SHA256", ~0u, ~0u, ~0u, SSL_SHA256, 0}, - {"SHA384", ~0u, ~0u, ~0u, SSL_SHA384, 0}, // Legacy protocol minimum version aliases. "TLSv1" is intentionally the // same as "SSLv3". @@ -628,41 +547,44 @@ static const CIPHER_ALIAS kCipherAliases[] = { // Legacy strength classes. {"HIGH", ~0u, ~0u, ~0u, ~0u, 0}, {"FIPS", ~0u, ~0u, ~0u, ~0u, 0}, + + // Temporary no-op aliases corresponding to removed SHA-2 legacy CBC + // ciphers. These should be removed after 2018-05-14. + {"SHA256", 0, 0, 0, 0, 0}, + {"SHA384", 0, 0, 0, 0, 0}, }; static const size_t kCipherAliasesLen = OPENSSL_ARRAY_SIZE(kCipherAliases); -static int ssl_cipher_id_cmp(const void *in_a, const void *in_b) { - const SSL_CIPHER *a = reinterpret_cast(in_a); - const SSL_CIPHER *b = reinterpret_cast(in_b); - - if (a->id > b->id) { - return 1; - } else if (a->id < b->id) { - return -1; - } else { - return 0; - } -} - bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, size_t *out_mac_secret_len, size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, - uint16_t version, int is_dtls) { + uint16_t version, bool is_dtls) { *out_aead = NULL; *out_mac_secret_len = 0; *out_fixed_iv_len = 0; - const int is_tls12 = version == TLS1_2_VERSION && !is_dtls; + const bool is_tls12 = version == TLS1_2_VERSION && !is_dtls; + const bool is_tls13 = version == TLS1_3_VERSION && !is_dtls; if (cipher->algorithm_mac == SSL_AEAD) { if (cipher->algorithm_enc == SSL_AES128GCM) { - *out_aead = - is_tls12 ? EVP_aead_aes_128_gcm_tls12() : EVP_aead_aes_128_gcm(); + if (is_tls12) { + *out_aead = EVP_aead_aes_128_gcm_tls12(); + } else if (is_tls13) { + *out_aead = EVP_aead_aes_128_gcm_tls13(); + } else { + *out_aead = EVP_aead_aes_128_gcm(); + } *out_fixed_iv_len = 4; } else if (cipher->algorithm_enc == SSL_AES256GCM) { - *out_aead = - is_tls12 ? EVP_aead_aes_256_gcm_tls12() : EVP_aead_aes_256_gcm(); + if (is_tls12) { + *out_aead = EVP_aead_aes_256_gcm_tls12(); + } else if (is_tls13) { + *out_aead = EVP_aead_aes_256_gcm_tls13(); + } else { + *out_aead = EVP_aead_aes_256_gcm(); + } *out_fixed_iv_len = 4; } else if (cipher->algorithm_enc == SSL_CHACHA20POLY1305) { *out_aead = EVP_aead_chacha20_poly1305(); @@ -678,36 +600,23 @@ bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, } } else if (cipher->algorithm_mac == SSL_SHA1) { if (cipher->algorithm_enc == SSL_eNULL) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_null_sha1_ssl3(); - } else { - *out_aead = EVP_aead_null_sha1_tls(); - } + *out_aead = EVP_aead_null_sha1_tls(); } else if (cipher->algorithm_enc == SSL_3DES) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_des_ede3_cbc_sha1_ssl3(); - *out_fixed_iv_len = 8; - } else if (version == TLS1_VERSION) { + if (version == TLS1_VERSION) { *out_aead = EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv(); *out_fixed_iv_len = 8; } else { *out_aead = EVP_aead_des_ede3_cbc_sha1_tls(); } } else if (cipher->algorithm_enc == SSL_AES128) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_aes_128_cbc_sha1_ssl3(); - *out_fixed_iv_len = 16; - } else if (version == TLS1_VERSION) { + if (version == TLS1_VERSION) { *out_aead = EVP_aead_aes_128_cbc_sha1_tls_implicit_iv(); *out_fixed_iv_len = 16; } else { *out_aead = EVP_aead_aes_128_cbc_sha1_tls(); } } else if (cipher->algorithm_enc == SSL_AES256) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_aes_256_cbc_sha1_ssl3(); - *out_fixed_iv_len = 16; - } else if (version == TLS1_VERSION) { + if (version == TLS1_VERSION) { *out_aead = EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(); *out_fixed_iv_len = 16; } else { @@ -718,23 +627,6 @@ bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, } *out_mac_secret_len = SHA_DIGEST_LENGTH; - } else if (cipher->algorithm_mac == SSL_SHA256) { - if (cipher->algorithm_enc == SSL_AES128) { - *out_aead = EVP_aead_aes_128_cbc_sha256_tls(); - } else if (cipher->algorithm_enc == SSL_AES256) { - *out_aead = EVP_aead_aes_256_cbc_sha256_tls(); - } else { - return false; - } - - *out_mac_secret_len = SHA256_DIGEST_LENGTH; - } else if (cipher->algorithm_mac == SSL_SHA384) { - if (cipher->algorithm_enc != SSL_AES256) { - return false; - } - - *out_aead = EVP_aead_aes_256_cbc_sha384_tls(); - *out_mac_secret_len = SHA384_DIGEST_LENGTH; } else { return false; } @@ -757,7 +649,7 @@ const EVP_MD *ssl_get_handshake_digest(uint16_t version, } } -static bool is_cipher_list_separator(char c, int is_strict) { +static bool is_cipher_list_separator(char c, bool is_strict) { if (c == ':') { return true; } @@ -811,9 +703,14 @@ static void ll_append_head(CIPHER_ORDER **head, CIPHER_ORDER *curr, *head = curr; } -static void ssl_cipher_collect_ciphers(CIPHER_ORDER *co_list, - CIPHER_ORDER **head_p, - CIPHER_ORDER **tail_p) { +static bool ssl_cipher_collect_ciphers(Array *out_co_list, + CIPHER_ORDER **out_head, + CIPHER_ORDER **out_tail) { + Array co_list; + if (!co_list.Init(OPENSSL_ARRAY_SIZE(kCiphers))) { + return false; + } + size_t co_list_num = 0; for (const SSL_CIPHER &cipher : kCiphers) { // TLS 1.3 ciphers do not participate in this mechanism. @@ -844,9 +741,60 @@ static void ssl_cipher_collect_ciphers(CIPHER_ORDER *co_list, co_list[co_list_num - 1].next = NULL; - *head_p = &co_list[0]; - *tail_p = &co_list[co_list_num - 1]; + *out_head = &co_list[0]; + *out_tail = &co_list[co_list_num - 1]; + } else { + *out_head = nullptr; + *out_tail = nullptr; + } + *out_co_list = std::move(co_list); + return true; +} + +SSLCipherPreferenceList::~SSLCipherPreferenceList() { + OPENSSL_free(in_group_flags); +} + +bool SSLCipherPreferenceList::Init(UniquePtr ciphers_arg, + Span in_group_flags_arg) { + if (sk_SSL_CIPHER_num(ciphers_arg.get()) != in_group_flags_arg.size()) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + Array copy; + if (!copy.CopyFrom(in_group_flags_arg)) { + return false; + } + ciphers = std::move(ciphers_arg); + size_t unused_len; + copy.Release(&in_group_flags, &unused_len); + return true; +} + +bool SSLCipherPreferenceList::Init(const SSLCipherPreferenceList& other) { + size_t size = sk_SSL_CIPHER_num(other.ciphers.get()); + Span other_flags(other.in_group_flags, size); + UniquePtr other_ciphers(sk_SSL_CIPHER_dup( + other.ciphers.get())); + if (!other_ciphers) { + return false; } + return Init(std::move(other_ciphers), other_flags); +} + +void SSLCipherPreferenceList::Remove(const SSL_CIPHER *cipher) { + size_t index; + if (!sk_SSL_CIPHER_find(ciphers.get(), &index, cipher)) { + return; + } + if (!in_group_flags[index] /* last element of group */ && index > 0) { + in_group_flags[index-1] = false; + } + for (size_t i = index; i < sk_SSL_CIPHER_num(ciphers.get()) - 1; ++i) { + in_group_flags[i] = in_group_flags[i+1]; + } + sk_SSL_CIPHER_delete(ciphers.get(), index); } // ssl_cipher_apply_rule applies the rule type |rule| to ciphers matching its @@ -1128,7 +1076,7 @@ static bool ssl_cipher_process_rulestr(const char *rule_str, // Look for a matching exact cipher. These aren't allowed in multipart // rules. if (!multi && ch != '+') { - for (j = 0; j < kCiphersLen; j++) { + for (j = 0; j < OPENSSL_ARRAY_SIZE(kCiphers); j++) { const SSL_CIPHER *cipher = &kCiphers[j]; if (rule_equals(cipher->name, buf, buf_len) || rule_equals(cipher->standard_name, buf, buf_len)) { @@ -1201,15 +1149,8 @@ static bool ssl_cipher_process_rulestr(const char *rule_str, return true; } -bool ssl_create_cipher_list( - struct ssl_cipher_preference_list_st **out_cipher_list, - const char *rule_str, bool strict) { - STACK_OF(SSL_CIPHER) *cipherstack = NULL; - CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr; - uint8_t *in_group_flags = NULL; - unsigned int num_in_group_flags = 0; - struct ssl_cipher_preference_list_st *pref_list = NULL; - +bool ssl_create_cipher_list(UniquePtr *out_cipher_list, + const char *rule_str, bool strict) { // Return with error if nothing to do. if (rule_str == NULL || out_cipher_list == NULL) { return false; @@ -1218,14 +1159,12 @@ bool ssl_create_cipher_list( // Now we have to collect the available ciphers from the compiled in ciphers. // We cannot get more than the number compiled in, so it is used for // allocation. - co_list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * kCiphersLen); - if (co_list == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + Array co_list; + CIPHER_ORDER *head = nullptr, *tail = nullptr; + if (!ssl_cipher_collect_ciphers(&co_list, &head, &tail)) { return false; } - ssl_cipher_collect_ciphers(co_list, &head, &tail); - // Now arrange all ciphers by preference: // TODO(davidben): Compute this order once and copy it. @@ -1285,7 +1224,7 @@ bool ssl_create_cipher_list( if (strncmp(rule_str, "DEFAULT", 7) == 0) { if (!ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail, strict)) { - goto err; + return false; } rule_p += 7; if (*rule_p == ':') { @@ -1295,80 +1234,55 @@ bool ssl_create_cipher_list( if (*rule_p != '\0' && !ssl_cipher_process_rulestr(rule_p, &head, &tail, strict)) { - goto err; + return false; } // Allocate new "cipherstack" for the result, return with error // if we cannot get one. - cipherstack = sk_SSL_CIPHER_new_null(); - if (cipherstack == NULL) { - goto err; - } - - in_group_flags = (uint8_t *)OPENSSL_malloc(kCiphersLen); - if (!in_group_flags) { - goto err; + UniquePtr cipherstack(sk_SSL_CIPHER_new_null()); + Array in_group_flags; + if (cipherstack == nullptr || + !in_group_flags.Init(OPENSSL_ARRAY_SIZE(kCiphers))) { + return false; } // The cipher selection for the list is done. The ciphers are added // to the resulting precedence to the STACK_OF(SSL_CIPHER). - for (curr = head; curr != NULL; curr = curr->next) { + size_t num_in_group_flags = 0; + for (CIPHER_ORDER *curr = head; curr != NULL; curr = curr->next) { if (curr->active) { - if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) { - goto err; + if (!sk_SSL_CIPHER_push(cipherstack.get(), curr->cipher)) { + return false; } in_group_flags[num_in_group_flags++] = curr->in_group; } } - OPENSSL_free(co_list); // Not needed any longer - co_list = NULL; - pref_list = (ssl_cipher_preference_list_st *)OPENSSL_malloc( - sizeof(struct ssl_cipher_preference_list_st)); - if (!pref_list) { - goto err; - } - pref_list->ciphers = cipherstack; - pref_list->in_group_flags = NULL; - if (num_in_group_flags) { - pref_list->in_group_flags = (uint8_t *)OPENSSL_malloc(num_in_group_flags); - if (!pref_list->in_group_flags) { - goto err; - } - OPENSSL_memcpy(pref_list->in_group_flags, in_group_flags, - num_in_group_flags); - } - OPENSSL_free(in_group_flags); - in_group_flags = NULL; - if (*out_cipher_list != NULL) { - ssl_cipher_preference_list_free(*out_cipher_list); + UniquePtr pref_list = + MakeUnique(); + if (!pref_list || + !pref_list->Init( + std::move(cipherstack), + MakeConstSpan(in_group_flags).subspan(0, num_in_group_flags))) { + return false; } - *out_cipher_list = pref_list; - pref_list = NULL; + + *out_cipher_list = std::move(pref_list); // Configuring an empty cipher list is an error but still updates the // output. - if (sk_SSL_CIPHER_num((*out_cipher_list)->ciphers) == 0) { + if (sk_SSL_CIPHER_num((*out_cipher_list)->ciphers.get()) == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CIPHER_MATCH); return false; } return true; - -err: - OPENSSL_free(co_list); - OPENSSL_free(in_group_flags); - sk_SSL_CIPHER_free(cipherstack); - if (pref_list) { - OPENSSL_free(pref_list->in_group_flags); - } - OPENSSL_free(pref_list); - return false; } uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher) { uint32_t id = cipher->id; - // All ciphers are SSLv3. + // All OpenSSL cipher IDs are prefaced with 0x03. Historically this referred + // to SSLv2 vs SSLv3. assert((id & 0xff000000) == 0x03000000); return id & 0xffff; } @@ -1417,20 +1331,55 @@ size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher) { return ret; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; +static constexpr int ssl_cipher_id_cmp_inner(const SSL_CIPHER *a, + const SSL_CIPHER *b) { + // C++11's constexpr functions must have a body consisting of just a + // return-statement. + return (a->id > b->id) ? 1 : ((a->id < b->id) ? -1 : 0); +} + +static int ssl_cipher_id_cmp(const void *in_a, const void *in_b) { + return ssl_cipher_id_cmp_inner(reinterpret_cast(in_a), + reinterpret_cast(in_b)); +} + +template +static constexpr size_t countof(T const (&)[N]) { + return N; +} + +template +static constexpr int check_order(const T (&arr)[I], size_t N) { + // C++11's constexpr functions must have a body consisting of just a + // return-statement. + return N > 1 ? ((ssl_cipher_id_cmp_inner(&arr[N - 2], &arr[N - 1]) < 0) + ? check_order(arr, N - 1) + : 0) + : 1; +} + +static_assert(check_order(kCiphers, countof(kCiphers)) == 1, + "Ciphers are not sorted, bsearch won't work"); + const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value) { SSL_CIPHER c; c.id = 0x03000000L | value; return reinterpret_cast(bsearch( - &c, kCiphers, kCiphersLen, sizeof(SSL_CIPHER), ssl_cipher_id_cmp)); + &c, kCiphers, OPENSSL_ARRAY_SIZE(kCiphers), sizeof(SSL_CIPHER), + ssl_cipher_id_cmp)); } uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *cipher) { return cipher->id; } +uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *cipher) { + return static_cast(cipher->id); +} + int SSL_CIPHER_is_aead(const SSL_CIPHER *cipher) { return (cipher->algorithm_mac & SSL_AEAD) != 0; } @@ -1462,10 +1411,6 @@ int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher) { return NID_undef; case SSL_SHA1: return NID_sha1; - case SSL_SHA256: - return NID_sha256; - case SSL_SHA384: - return NID_sha384; } assert(0); return NID_undef; @@ -1732,14 +1677,6 @@ const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, mac = "SHA1"; break; - case SSL_SHA256: - mac = "SHA256"; - break; - - case SSL_SHA384: - mac = "SHA384"; - break; - case SSL_AEAD: mac = "AEAD"; break; diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_cipher.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc.grpc_back similarity index 87% rename from Pods/BoringSSL-GRPC/ssl/ssl_cipher.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc.grpc_back index 32e6c2cdb..c4212926c 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_cipher.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_cipher.cc.grpc_back @@ -143,7 +143,6 @@ #include #include -#include #include #include #include @@ -154,10 +153,9 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN -// kCiphers is an array of all supported ciphers, sorted by id. -static const SSL_CIPHER kCiphers[] = { +static constexpr SSL_CIPHER kCiphers[] = { // The RSA ciphers // Cipher 02 { @@ -210,33 +208,6 @@ static const SSL_CIPHER kCiphers[] = { SSL_HANDSHAKE_MAC_DEFAULT, }, - - // TLS v1.2 ciphersuites - - // Cipher 3C - { - TLS1_TXT_RSA_WITH_AES_128_SHA256, - "TLS_RSA_WITH_AES_128_CBC_SHA256", - TLS1_CK_RSA_WITH_AES_128_SHA256, - SSL_kRSA, - SSL_aRSA, - SSL_AES128, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - - // Cipher 3D - { - TLS1_TXT_RSA_WITH_AES_256_SHA256, - "TLS_RSA_WITH_AES_256_CBC_SHA256", - TLS1_CK_RSA_WITH_AES_256_SHA256, - SSL_kRSA, - SSL_aRSA, - SSL_AES256, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - // PSK cipher suites. // Cipher 8C @@ -375,58 +346,6 @@ static const SSL_CIPHER kCiphers[] = { SSL_HANDSHAKE_MAC_DEFAULT, }, - - // HMAC based TLS v1.2 ciphersuites from RFC5289 - - // Cipher C023 - { - TLS1_TXT_ECDHE_ECDSA_WITH_AES_128_SHA256, - "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - TLS1_CK_ECDHE_ECDSA_WITH_AES_128_SHA256, - SSL_kECDHE, - SSL_aECDSA, - SSL_AES128, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - - // Cipher C024 - { - TLS1_TXT_ECDHE_ECDSA_WITH_AES_256_SHA384, - "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", - TLS1_CK_ECDHE_ECDSA_WITH_AES_256_SHA384, - SSL_kECDHE, - SSL_aECDSA, - SSL_AES256, - SSL_SHA384, - SSL_HANDSHAKE_MAC_SHA384, - }, - - // Cipher C027 - { - TLS1_TXT_ECDHE_RSA_WITH_AES_128_SHA256, - "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - TLS1_CK_ECDHE_RSA_WITH_AES_128_SHA256, - SSL_kECDHE, - SSL_aRSA, - SSL_AES128, - SSL_SHA256, - SSL_HANDSHAKE_MAC_SHA256, - }, - - // Cipher C028 - { - TLS1_TXT_ECDHE_RSA_WITH_AES_256_SHA384, - "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", - TLS1_CK_ECDHE_RSA_WITH_AES_256_SHA384, - SSL_kECDHE, - SSL_aRSA, - SSL_AES256, - SSL_SHA384, - SSL_HANDSHAKE_MAC_SHA384, - }, - - // GCM based TLS v1.2 ciphersuites from RFC5289 // Cipher C02B @@ -543,7 +462,9 @@ static const SSL_CIPHER kCiphers[] = { }; -static const size_t kCiphersLen = OPENSSL_ARRAY_SIZE(kCiphers); +Span AllCiphers() { + return MakeConstSpan(kCiphers, OPENSSL_ARRAY_SIZE(kCiphers)); +} #define CIPHER_ADD 1 #define CIPHER_KILL 2 @@ -616,8 +537,6 @@ static const CIPHER_ALIAS kCipherAliases[] = { // MAC aliases {"SHA1", ~0u, ~0u, ~0u, SSL_SHA1, 0}, {"SHA", ~0u, ~0u, ~0u, SSL_SHA1, 0}, - {"SHA256", ~0u, ~0u, ~0u, SSL_SHA256, 0}, - {"SHA384", ~0u, ~0u, ~0u, SSL_SHA384, 0}, // Legacy protocol minimum version aliases. "TLSv1" is intentionally the // same as "SSLv3". @@ -628,41 +547,44 @@ static const CIPHER_ALIAS kCipherAliases[] = { // Legacy strength classes. {"HIGH", ~0u, ~0u, ~0u, ~0u, 0}, {"FIPS", ~0u, ~0u, ~0u, ~0u, 0}, + + // Temporary no-op aliases corresponding to removed SHA-2 legacy CBC + // ciphers. These should be removed after 2018-05-14. + {"SHA256", 0, 0, 0, 0, 0}, + {"SHA384", 0, 0, 0, 0, 0}, }; static const size_t kCipherAliasesLen = OPENSSL_ARRAY_SIZE(kCipherAliases); -static int ssl_cipher_id_cmp(const void *in_a, const void *in_b) { - const SSL_CIPHER *a = reinterpret_cast(in_a); - const SSL_CIPHER *b = reinterpret_cast(in_b); - - if (a->id > b->id) { - return 1; - } else if (a->id < b->id) { - return -1; - } else { - return 0; - } -} - bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, size_t *out_mac_secret_len, size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, - uint16_t version, int is_dtls) { + uint16_t version, bool is_dtls) { *out_aead = NULL; *out_mac_secret_len = 0; *out_fixed_iv_len = 0; - const int is_tls12 = version == TLS1_2_VERSION && !is_dtls; + const bool is_tls12 = version == TLS1_2_VERSION && !is_dtls; + const bool is_tls13 = version == TLS1_3_VERSION && !is_dtls; if (cipher->algorithm_mac == SSL_AEAD) { if (cipher->algorithm_enc == SSL_AES128GCM) { - *out_aead = - is_tls12 ? EVP_aead_aes_128_gcm_tls12() : EVP_aead_aes_128_gcm(); + if (is_tls12) { + *out_aead = EVP_aead_aes_128_gcm_tls12(); + } else if (is_tls13) { + *out_aead = EVP_aead_aes_128_gcm_tls13(); + } else { + *out_aead = EVP_aead_aes_128_gcm(); + } *out_fixed_iv_len = 4; } else if (cipher->algorithm_enc == SSL_AES256GCM) { - *out_aead = - is_tls12 ? EVP_aead_aes_256_gcm_tls12() : EVP_aead_aes_256_gcm(); + if (is_tls12) { + *out_aead = EVP_aead_aes_256_gcm_tls12(); + } else if (is_tls13) { + *out_aead = EVP_aead_aes_256_gcm_tls13(); + } else { + *out_aead = EVP_aead_aes_256_gcm(); + } *out_fixed_iv_len = 4; } else if (cipher->algorithm_enc == SSL_CHACHA20POLY1305) { *out_aead = EVP_aead_chacha20_poly1305(); @@ -678,36 +600,23 @@ bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, } } else if (cipher->algorithm_mac == SSL_SHA1) { if (cipher->algorithm_enc == SSL_eNULL) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_null_sha1_ssl3(); - } else { - *out_aead = EVP_aead_null_sha1_tls(); - } + *out_aead = EVP_aead_null_sha1_tls(); } else if (cipher->algorithm_enc == SSL_3DES) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_des_ede3_cbc_sha1_ssl3(); - *out_fixed_iv_len = 8; - } else if (version == TLS1_VERSION) { + if (version == TLS1_VERSION) { *out_aead = EVP_aead_des_ede3_cbc_sha1_tls_implicit_iv(); *out_fixed_iv_len = 8; } else { *out_aead = EVP_aead_des_ede3_cbc_sha1_tls(); } } else if (cipher->algorithm_enc == SSL_AES128) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_aes_128_cbc_sha1_ssl3(); - *out_fixed_iv_len = 16; - } else if (version == TLS1_VERSION) { + if (version == TLS1_VERSION) { *out_aead = EVP_aead_aes_128_cbc_sha1_tls_implicit_iv(); *out_fixed_iv_len = 16; } else { *out_aead = EVP_aead_aes_128_cbc_sha1_tls(); } } else if (cipher->algorithm_enc == SSL_AES256) { - if (version == SSL3_VERSION) { - *out_aead = EVP_aead_aes_256_cbc_sha1_ssl3(); - *out_fixed_iv_len = 16; - } else if (version == TLS1_VERSION) { + if (version == TLS1_VERSION) { *out_aead = EVP_aead_aes_256_cbc_sha1_tls_implicit_iv(); *out_fixed_iv_len = 16; } else { @@ -718,23 +627,6 @@ bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, } *out_mac_secret_len = SHA_DIGEST_LENGTH; - } else if (cipher->algorithm_mac == SSL_SHA256) { - if (cipher->algorithm_enc == SSL_AES128) { - *out_aead = EVP_aead_aes_128_cbc_sha256_tls(); - } else if (cipher->algorithm_enc == SSL_AES256) { - *out_aead = EVP_aead_aes_256_cbc_sha256_tls(); - } else { - return false; - } - - *out_mac_secret_len = SHA256_DIGEST_LENGTH; - } else if (cipher->algorithm_mac == SSL_SHA384) { - if (cipher->algorithm_enc != SSL_AES256) { - return false; - } - - *out_aead = EVP_aead_aes_256_cbc_sha384_tls(); - *out_mac_secret_len = SHA384_DIGEST_LENGTH; } else { return false; } @@ -757,7 +649,7 @@ const EVP_MD *ssl_get_handshake_digest(uint16_t version, } } -static bool is_cipher_list_separator(char c, int is_strict) { +static bool is_cipher_list_separator(char c, bool is_strict) { if (c == ':') { return true; } @@ -811,9 +703,14 @@ static void ll_append_head(CIPHER_ORDER **head, CIPHER_ORDER *curr, *head = curr; } -static void ssl_cipher_collect_ciphers(CIPHER_ORDER *co_list, - CIPHER_ORDER **head_p, - CIPHER_ORDER **tail_p) { +static bool ssl_cipher_collect_ciphers(Array *out_co_list, + CIPHER_ORDER **out_head, + CIPHER_ORDER **out_tail) { + Array co_list; + if (!co_list.Init(OPENSSL_ARRAY_SIZE(kCiphers))) { + return false; + } + size_t co_list_num = 0; for (const SSL_CIPHER &cipher : kCiphers) { // TLS 1.3 ciphers do not participate in this mechanism. @@ -844,9 +741,60 @@ static void ssl_cipher_collect_ciphers(CIPHER_ORDER *co_list, co_list[co_list_num - 1].next = NULL; - *head_p = &co_list[0]; - *tail_p = &co_list[co_list_num - 1]; + *out_head = &co_list[0]; + *out_tail = &co_list[co_list_num - 1]; + } else { + *out_head = nullptr; + *out_tail = nullptr; + } + *out_co_list = std::move(co_list); + return true; +} + +SSLCipherPreferenceList::~SSLCipherPreferenceList() { + OPENSSL_free(in_group_flags); +} + +bool SSLCipherPreferenceList::Init(UniquePtr ciphers_arg, + Span in_group_flags_arg) { + if (sk_SSL_CIPHER_num(ciphers_arg.get()) != in_group_flags_arg.size()) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + Array copy; + if (!copy.CopyFrom(in_group_flags_arg)) { + return false; + } + ciphers = std::move(ciphers_arg); + size_t unused_len; + copy.Release(&in_group_flags, &unused_len); + return true; +} + +bool SSLCipherPreferenceList::Init(const SSLCipherPreferenceList& other) { + size_t size = sk_SSL_CIPHER_num(other.ciphers.get()); + Span other_flags(other.in_group_flags, size); + UniquePtr other_ciphers(sk_SSL_CIPHER_dup( + other.ciphers.get())); + if (!other_ciphers) { + return false; } + return Init(std::move(other_ciphers), other_flags); +} + +void SSLCipherPreferenceList::Remove(const SSL_CIPHER *cipher) { + size_t index; + if (!sk_SSL_CIPHER_find(ciphers.get(), &index, cipher)) { + return; + } + if (!in_group_flags[index] /* last element of group */ && index > 0) { + in_group_flags[index-1] = false; + } + for (size_t i = index; i < sk_SSL_CIPHER_num(ciphers.get()) - 1; ++i) { + in_group_flags[i] = in_group_flags[i+1]; + } + sk_SSL_CIPHER_delete(ciphers.get(), index); } // ssl_cipher_apply_rule applies the rule type |rule| to ciphers matching its @@ -1128,7 +1076,7 @@ static bool ssl_cipher_process_rulestr(const char *rule_str, // Look for a matching exact cipher. These aren't allowed in multipart // rules. if (!multi && ch != '+') { - for (j = 0; j < kCiphersLen; j++) { + for (j = 0; j < OPENSSL_ARRAY_SIZE(kCiphers); j++) { const SSL_CIPHER *cipher = &kCiphers[j]; if (rule_equals(cipher->name, buf, buf_len) || rule_equals(cipher->standard_name, buf, buf_len)) { @@ -1201,15 +1149,8 @@ static bool ssl_cipher_process_rulestr(const char *rule_str, return true; } -bool ssl_create_cipher_list( - struct ssl_cipher_preference_list_st **out_cipher_list, - const char *rule_str, bool strict) { - STACK_OF(SSL_CIPHER) *cipherstack = NULL; - CIPHER_ORDER *co_list = NULL, *head = NULL, *tail = NULL, *curr; - uint8_t *in_group_flags = NULL; - unsigned int num_in_group_flags = 0; - struct ssl_cipher_preference_list_st *pref_list = NULL; - +bool ssl_create_cipher_list(UniquePtr *out_cipher_list, + const char *rule_str, bool strict) { // Return with error if nothing to do. if (rule_str == NULL || out_cipher_list == NULL) { return false; @@ -1218,14 +1159,12 @@ bool ssl_create_cipher_list( // Now we have to collect the available ciphers from the compiled in ciphers. // We cannot get more than the number compiled in, so it is used for // allocation. - co_list = (CIPHER_ORDER *)OPENSSL_malloc(sizeof(CIPHER_ORDER) * kCiphersLen); - if (co_list == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + Array co_list; + CIPHER_ORDER *head = nullptr, *tail = nullptr; + if (!ssl_cipher_collect_ciphers(&co_list, &head, &tail)) { return false; } - ssl_cipher_collect_ciphers(co_list, &head, &tail); - // Now arrange all ciphers by preference: // TODO(davidben): Compute this order once and copy it. @@ -1285,7 +1224,7 @@ bool ssl_create_cipher_list( if (strncmp(rule_str, "DEFAULT", 7) == 0) { if (!ssl_cipher_process_rulestr(SSL_DEFAULT_CIPHER_LIST, &head, &tail, strict)) { - goto err; + return false; } rule_p += 7; if (*rule_p == ':') { @@ -1295,80 +1234,55 @@ bool ssl_create_cipher_list( if (*rule_p != '\0' && !ssl_cipher_process_rulestr(rule_p, &head, &tail, strict)) { - goto err; + return false; } // Allocate new "cipherstack" for the result, return with error // if we cannot get one. - cipherstack = sk_SSL_CIPHER_new_null(); - if (cipherstack == NULL) { - goto err; - } - - in_group_flags = (uint8_t *)OPENSSL_malloc(kCiphersLen); - if (!in_group_flags) { - goto err; + UniquePtr cipherstack(sk_SSL_CIPHER_new_null()); + Array in_group_flags; + if (cipherstack == nullptr || + !in_group_flags.Init(OPENSSL_ARRAY_SIZE(kCiphers))) { + return false; } // The cipher selection for the list is done. The ciphers are added // to the resulting precedence to the STACK_OF(SSL_CIPHER). - for (curr = head; curr != NULL; curr = curr->next) { + size_t num_in_group_flags = 0; + for (CIPHER_ORDER *curr = head; curr != NULL; curr = curr->next) { if (curr->active) { - if (!sk_SSL_CIPHER_push(cipherstack, curr->cipher)) { - goto err; + if (!sk_SSL_CIPHER_push(cipherstack.get(), curr->cipher)) { + return false; } in_group_flags[num_in_group_flags++] = curr->in_group; } } - OPENSSL_free(co_list); // Not needed any longer - co_list = NULL; - pref_list = (ssl_cipher_preference_list_st *)OPENSSL_malloc( - sizeof(struct ssl_cipher_preference_list_st)); - if (!pref_list) { - goto err; - } - pref_list->ciphers = cipherstack; - pref_list->in_group_flags = NULL; - if (num_in_group_flags) { - pref_list->in_group_flags = (uint8_t *)OPENSSL_malloc(num_in_group_flags); - if (!pref_list->in_group_flags) { - goto err; - } - OPENSSL_memcpy(pref_list->in_group_flags, in_group_flags, - num_in_group_flags); - } - OPENSSL_free(in_group_flags); - in_group_flags = NULL; - if (*out_cipher_list != NULL) { - ssl_cipher_preference_list_free(*out_cipher_list); + UniquePtr pref_list = + MakeUnique(); + if (!pref_list || + !pref_list->Init( + std::move(cipherstack), + MakeConstSpan(in_group_flags).subspan(0, num_in_group_flags))) { + return false; } - *out_cipher_list = pref_list; - pref_list = NULL; + + *out_cipher_list = std::move(pref_list); // Configuring an empty cipher list is an error but still updates the // output. - if (sk_SSL_CIPHER_num((*out_cipher_list)->ciphers) == 0) { + if (sk_SSL_CIPHER_num((*out_cipher_list)->ciphers.get()) == 0) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CIPHER_MATCH); return false; } return true; - -err: - OPENSSL_free(co_list); - OPENSSL_free(in_group_flags); - sk_SSL_CIPHER_free(cipherstack); - if (pref_list) { - OPENSSL_free(pref_list->in_group_flags); - } - OPENSSL_free(pref_list); - return false; } uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher) { uint32_t id = cipher->id; - // All ciphers are SSLv3. + // All OpenSSL cipher IDs are prefaced with 0x03. Historically this referred + // to SSLv2 vs SSLv3. assert((id & 0xff000000) == 0x03000000); return id & 0xffff; } @@ -1417,20 +1331,55 @@ size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher) { return ret; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; +static constexpr int ssl_cipher_id_cmp_inner(const SSL_CIPHER *a, + const SSL_CIPHER *b) { + // C++11's constexpr functions must have a body consisting of just a + // return-statement. + return (a->id > b->id) ? 1 : ((a->id < b->id) ? -1 : 0); +} + +static int ssl_cipher_id_cmp(const void *in_a, const void *in_b) { + return ssl_cipher_id_cmp_inner(reinterpret_cast(in_a), + reinterpret_cast(in_b)); +} + +template +static constexpr size_t countof(T const (&)[N]) { + return N; +} + +template +static constexpr int check_order(const T (&arr)[I], size_t N) { + // C++11's constexpr functions must have a body consisting of just a + // return-statement. + return N > 1 ? ((ssl_cipher_id_cmp_inner(&arr[N - 2], &arr[N - 1]) < 0) + ? check_order(arr, N - 1) + : 0) + : 1; +} + +static_assert(check_order(kCiphers, countof(kCiphers)) == 1, + "Ciphers are not sorted, bsearch won't work"); + const SSL_CIPHER *SSL_get_cipher_by_value(uint16_t value) { SSL_CIPHER c; c.id = 0x03000000L | value; return reinterpret_cast(bsearch( - &c, kCiphers, kCiphersLen, sizeof(SSL_CIPHER), ssl_cipher_id_cmp)); + &c, kCiphers, OPENSSL_ARRAY_SIZE(kCiphers), sizeof(SSL_CIPHER), + ssl_cipher_id_cmp)); } uint32_t SSL_CIPHER_get_id(const SSL_CIPHER *cipher) { return cipher->id; } +uint16_t SSL_CIPHER_get_value(const SSL_CIPHER *cipher) { + return static_cast(cipher->id); +} + int SSL_CIPHER_is_aead(const SSL_CIPHER *cipher) { return (cipher->algorithm_mac & SSL_AEAD) != 0; } @@ -1462,10 +1411,6 @@ int SSL_CIPHER_get_digest_nid(const SSL_CIPHER *cipher) { return NID_undef; case SSL_SHA1: return NID_sha1; - case SSL_SHA256: - return NID_sha256; - case SSL_SHA384: - return NID_sha384; } assert(0); return NID_undef; @@ -1732,14 +1677,6 @@ const char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, mac = "SHA1"; break; - case SSL_SHA256: - mac = "SHA256"; - break; - - case SSL_SHA384: - mac = "SHA384"; - break; - case SSL_AEAD: mac = "AEAD"; break; diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_file.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc similarity index 99% rename from Pods/BoringSSL-GRPC/ssl/ssl_file.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc index 2df6e0573..1656fb26e 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_file.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc @@ -165,6 +165,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) { } // Check for duplicates. + sk_X509_NAME_sort(sk); if (sk_X509_NAME_find(sk, NULL, xn)) { continue; } @@ -223,6 +224,7 @@ int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, } // Check for duplicates. + sk_X509_NAME_sort(stack); if (sk_X509_NAME_find(stack, NULL, xn)) { continue; } diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_file.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc.grpc_back similarity index 99% rename from Pods/BoringSSL-GRPC/ssl/ssl_file.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc.grpc_back index bafa64ab0..ca4b0be21 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_file.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_file.cc.grpc_back @@ -165,6 +165,7 @@ STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file) { } // Check for duplicates. + sk_X509_NAME_sort(sk); if (sk_X509_NAME_find(sk, NULL, xn)) { continue; } @@ -223,6 +224,7 @@ int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stack, } // Check for duplicates. + sk_X509_NAME_sort(stack); if (sk_X509_NAME_find(stack, NULL, xn)) { continue; } diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc new file mode 100644 index 000000000..059e85663 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc @@ -0,0 +1,397 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + +BSSL_NAMESPACE_BEGIN + +namespace { + +class ECKeyShare : public SSLKeyShare { + public: + ECKeyShare(int nid, uint16_t group_id) : nid_(nid), group_id_(group_id) {} + + uint16_t GroupID() const override { return group_id_; } + + bool Offer(CBB *out) override { + assert(!private_key_); + // Set up a shared |BN_CTX| for all operations. + UniquePtr bn_ctx(BN_CTX_new()); + if (!bn_ctx) { + return false; + } + BN_CTXScope scope(bn_ctx.get()); + + // Generate a private key. + UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); + private_key_.reset(BN_new()); + if (!group || !private_key_ || + !BN_rand_range_ex(private_key_.get(), 1, + EC_GROUP_get0_order(group.get()))) { + return false; + } + + // Compute the corresponding public key and serialize it. + UniquePtr public_key(EC_POINT_new(group.get())); + if (!public_key || + !EC_POINT_mul(group.get(), public_key.get(), private_key_.get(), NULL, + NULL, bn_ctx.get()) || + !EC_POINT_point2cbb(out, group.get(), public_key.get(), + POINT_CONVERSION_UNCOMPRESSED, bn_ctx.get())) { + return false; + } + + return true; + } + + bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) override { + assert(private_key_); + *out_alert = SSL_AD_INTERNAL_ERROR; + + // Set up a shared |BN_CTX| for all operations. + UniquePtr bn_ctx(BN_CTX_new()); + if (!bn_ctx) { + return false; + } + BN_CTXScope scope(bn_ctx.get()); + + UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); + if (!group) { + return false; + } + + UniquePtr peer_point(EC_POINT_new(group.get())); + UniquePtr result(EC_POINT_new(group.get())); + BIGNUM *x = BN_CTX_get(bn_ctx.get()); + if (!peer_point || !result || !x) { + return false; + } + + if (peer_key.empty() || peer_key[0] != POINT_CONVERSION_UNCOMPRESSED || + !EC_POINT_oct2point(group.get(), peer_point.get(), peer_key.data(), + peer_key.size(), bn_ctx.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Compute the x-coordinate of |peer_key| * |private_key_|. + if (!EC_POINT_mul(group.get(), result.get(), NULL, peer_point.get(), + private_key_.get(), bn_ctx.get()) || + !EC_POINT_get_affine_coordinates_GFp(group.get(), result.get(), x, NULL, + bn_ctx.get())) { + return false; + } + + // Encode the x-coordinate left-padded with zeros. + Array secret; + if (!secret.Init((EC_GROUP_get_degree(group.get()) + 7) / 8) || + !BN_bn2bin_padded(secret.data(), secret.size(), x)) { + return false; + } + + *out_secret = std::move(secret); + return true; + } + + bool Serialize(CBB *out) override { + assert(private_key_); + CBB cbb; + UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); + // Padding is added to avoid leaking the length. + size_t len = BN_num_bytes(EC_GROUP_get0_order(group.get())); + if (!CBB_add_asn1_uint64(out, group_id_) || + !CBB_add_asn1(out, &cbb, CBS_ASN1_OCTETSTRING) || + !BN_bn2cbb_padded(&cbb, len, private_key_.get()) || + !CBB_flush(out)) { + return false; + } + return true; + } + + bool Deserialize(CBS *in) override { + assert(!private_key_); + CBS private_key; + if (!CBS_get_asn1(in, &private_key, CBS_ASN1_OCTETSTRING)) { + return false; + } + private_key_.reset(BN_bin2bn(CBS_data(&private_key), + CBS_len(&private_key), nullptr)); + return private_key_ != nullptr; + } + + private: + UniquePtr private_key_; + int nid_; + uint16_t group_id_; +}; + +class X25519KeyShare : public SSLKeyShare { + public: + X25519KeyShare() {} + + uint16_t GroupID() const override { return SSL_CURVE_X25519; } + + bool Offer(CBB *out) override { + uint8_t public_key[32]; + X25519_keypair(public_key, private_key_); + return !!CBB_add_bytes(out, public_key, sizeof(public_key)); + } + + bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) override { + *out_alert = SSL_AD_INTERNAL_ERROR; + + Array secret; + if (!secret.Init(32)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + if (peer_key.size() != 32 || + !X25519(secret.data(), private_key_, peer_key.data())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + return false; + } + + *out_secret = std::move(secret); + return true; + } + + bool Serialize(CBB *out) override { + return (CBB_add_asn1_uint64(out, GroupID()) && + CBB_add_asn1_octet_string(out, private_key_, sizeof(private_key_))); + } + + bool Deserialize(CBS *in) override { + CBS key; + if (!CBS_get_asn1(in, &key, CBS_ASN1_OCTETSTRING) || + CBS_len(&key) != sizeof(private_key_) || + !CBS_copy_bytes(&key, private_key_, sizeof(private_key_))) { + return false; + } + return true; + } + + private: + uint8_t private_key_[32]; +}; + +class CECPQ2KeyShare : public SSLKeyShare { + public: + CECPQ2KeyShare() {} + + uint16_t GroupID() const override { return SSL_CURVE_CECPQ2; } + + bool Offer(CBB *out) override { + uint8_t x25519_public_key[32]; + X25519_keypair(x25519_public_key, x25519_private_key_); + + uint8_t hrss_entropy[HRSS_GENERATE_KEY_BYTES]; + HRSS_public_key hrss_public_key; + RAND_bytes(hrss_entropy, sizeof(hrss_entropy)); + HRSS_generate_key(&hrss_public_key, &hrss_private_key_, hrss_entropy); + + uint8_t hrss_public_key_bytes[HRSS_PUBLIC_KEY_BYTES]; + HRSS_marshal_public_key(hrss_public_key_bytes, &hrss_public_key); + + if (!CBB_add_bytes(out, x25519_public_key, sizeof(x25519_public_key)) || + !CBB_add_bytes(out, hrss_public_key_bytes, + sizeof(hrss_public_key_bytes))) { + return false; + } + + return true; + } + + bool Accept(CBB *out_public_key, Array *out_secret, + uint8_t *out_alert, Span peer_key) override { + Array secret; + if (!secret.Init(32 + HRSS_KEY_BYTES)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + uint8_t x25519_public_key[32]; + X25519_keypair(x25519_public_key, x25519_private_key_); + + HRSS_public_key peer_public_key; + if (peer_key.size() != 32 + HRSS_PUBLIC_KEY_BYTES || + !HRSS_parse_public_key(&peer_public_key, peer_key.data() + 32) || + !X25519(secret.data(), x25519_private_key_, peer_key.data())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + return false; + } + + uint8_t ciphertext[HRSS_CIPHERTEXT_BYTES]; + uint8_t entropy[HRSS_ENCAP_BYTES]; + RAND_bytes(entropy, sizeof(entropy)); + HRSS_encap(ciphertext, secret.data() + 32, &peer_public_key, entropy); + + if (!CBB_add_bytes(out_public_key, x25519_public_key, + sizeof(x25519_public_key)) || + !CBB_add_bytes(out_public_key, ciphertext, sizeof(ciphertext))) { + return false; + } + + *out_secret = std::move(secret); + return true; + } + + bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) override { + *out_alert = SSL_AD_INTERNAL_ERROR; + + Array secret; + if (!secret.Init(32 + HRSS_KEY_BYTES)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + if (peer_key.size() != 32 + HRSS_CIPHERTEXT_BYTES || + !X25519(secret.data(), x25519_private_key_, peer_key.data())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + return false; + } + + HRSS_decap(secret.data() + 32, &hrss_private_key_, peer_key.data() + 32, + peer_key.size() - 32); + + *out_secret = std::move(secret); + return true; + } + + private: + uint8_t x25519_private_key_[32]; + HRSS_private_key hrss_private_key_; +}; + +CONSTEXPR_ARRAY NamedGroup kNamedGroups[] = { + {NID_secp224r1, SSL_CURVE_SECP224R1, "P-224", "secp224r1"}, + {NID_X9_62_prime256v1, SSL_CURVE_SECP256R1, "P-256", "prime256v1"}, + {NID_secp384r1, SSL_CURVE_SECP384R1, "P-384", "secp384r1"}, + {NID_secp521r1, SSL_CURVE_SECP521R1, "P-521", "secp521r1"}, + {NID_X25519, SSL_CURVE_X25519, "X25519", "x25519"}, + {NID_CECPQ2, SSL_CURVE_CECPQ2, "CECPQ2", "CECPQ2"}, +}; + +} // namespace + +Span NamedGroups() { + return MakeConstSpan(kNamedGroups, OPENSSL_ARRAY_SIZE(kNamedGroups)); +} + +UniquePtr SSLKeyShare::Create(uint16_t group_id) { + switch (group_id) { + case SSL_CURVE_SECP224R1: + return UniquePtr( + New(NID_secp224r1, SSL_CURVE_SECP224R1)); + case SSL_CURVE_SECP256R1: + return UniquePtr( + New(NID_X9_62_prime256v1, SSL_CURVE_SECP256R1)); + case SSL_CURVE_SECP384R1: + return UniquePtr( + New(NID_secp384r1, SSL_CURVE_SECP384R1)); + case SSL_CURVE_SECP521R1: + return UniquePtr( + New(NID_secp521r1, SSL_CURVE_SECP521R1)); + case SSL_CURVE_X25519: + return UniquePtr(New()); + case SSL_CURVE_CECPQ2: + return UniquePtr(New()); + default: + return nullptr; + } +} + +UniquePtr SSLKeyShare::Create(CBS *in) { + uint64_t group; + if (!CBS_get_asn1_uint64(in, &group) || group > 0xffff) { + return nullptr; + } + UniquePtr key_share = Create(static_cast(group)); + if (!key_share || !key_share->Deserialize(in)) { + return nullptr; + } + return key_share; +} + + +bool SSLKeyShare::Accept(CBB *out_public_key, Array *out_secret, + uint8_t *out_alert, Span peer_key) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return Offer(out_public_key) && + Finish(out_secret, out_alert, peer_key); +} + +bool ssl_nid_to_group_id(uint16_t *out_group_id, int nid) { + for (const auto &group : kNamedGroups) { + if (group.nid == nid) { + *out_group_id = group.group_id; + return true; + } + } + return false; +} + +bool ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len) { + for (const auto &group : kNamedGroups) { + if (len == strlen(group.name) && + !strncmp(group.name, name, len)) { + *out_group_id = group.group_id; + return true; + } + if (len == strlen(group.alias) && + !strncmp(group.alias, name, len)) { + *out_group_id = group.group_id; + return true; + } + } + return false; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +const char* SSL_get_curve_name(uint16_t group_id) { + for (const auto &group : kNamedGroups) { + if (group.group_id == group_id) { + return group.name; + } + } + return nullptr; +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc.grpc_back new file mode 100644 index 000000000..6cac3cf22 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_key_share.cc.grpc_back @@ -0,0 +1,397 @@ +/* Copyright (c) 2015, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + +BSSL_NAMESPACE_BEGIN + +namespace { + +class ECKeyShare : public SSLKeyShare { + public: + ECKeyShare(int nid, uint16_t group_id) : nid_(nid), group_id_(group_id) {} + + uint16_t GroupID() const override { return group_id_; } + + bool Offer(CBB *out) override { + assert(!private_key_); + // Set up a shared |BN_CTX| for all operations. + UniquePtr bn_ctx(BN_CTX_new()); + if (!bn_ctx) { + return false; + } + BN_CTXScope scope(bn_ctx.get()); + + // Generate a private key. + UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); + private_key_.reset(BN_new()); + if (!group || !private_key_ || + !BN_rand_range_ex(private_key_.get(), 1, + EC_GROUP_get0_order(group.get()))) { + return false; + } + + // Compute the corresponding public key and serialize it. + UniquePtr public_key(EC_POINT_new(group.get())); + if (!public_key || + !EC_POINT_mul(group.get(), public_key.get(), private_key_.get(), NULL, + NULL, bn_ctx.get()) || + !EC_POINT_point2cbb(out, group.get(), public_key.get(), + POINT_CONVERSION_UNCOMPRESSED, bn_ctx.get())) { + return false; + } + + return true; + } + + bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) override { + assert(private_key_); + *out_alert = SSL_AD_INTERNAL_ERROR; + + // Set up a shared |BN_CTX| for all operations. + UniquePtr bn_ctx(BN_CTX_new()); + if (!bn_ctx) { + return false; + } + BN_CTXScope scope(bn_ctx.get()); + + UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); + if (!group) { + return false; + } + + UniquePtr peer_point(EC_POINT_new(group.get())); + UniquePtr result(EC_POINT_new(group.get())); + BIGNUM *x = BN_CTX_get(bn_ctx.get()); + if (!peer_point || !result || !x) { + return false; + } + + if (peer_key.empty() || peer_key[0] != POINT_CONVERSION_UNCOMPRESSED || + !EC_POINT_oct2point(group.get(), peer_point.get(), peer_key.data(), + peer_key.size(), bn_ctx.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + // Compute the x-coordinate of |peer_key| * |private_key_|. + if (!EC_POINT_mul(group.get(), result.get(), NULL, peer_point.get(), + private_key_.get(), bn_ctx.get()) || + !EC_POINT_get_affine_coordinates_GFp(group.get(), result.get(), x, NULL, + bn_ctx.get())) { + return false; + } + + // Encode the x-coordinate left-padded with zeros. + Array secret; + if (!secret.Init((EC_GROUP_get_degree(group.get()) + 7) / 8) || + !BN_bn2bin_padded(secret.data(), secret.size(), x)) { + return false; + } + + *out_secret = std::move(secret); + return true; + } + + bool Serialize(CBB *out) override { + assert(private_key_); + CBB cbb; + UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); + // Padding is added to avoid leaking the length. + size_t len = BN_num_bytes(EC_GROUP_get0_order(group.get())); + if (!CBB_add_asn1_uint64(out, group_id_) || + !CBB_add_asn1(out, &cbb, CBS_ASN1_OCTETSTRING) || + !BN_bn2cbb_padded(&cbb, len, private_key_.get()) || + !CBB_flush(out)) { + return false; + } + return true; + } + + bool Deserialize(CBS *in) override { + assert(!private_key_); + CBS private_key; + if (!CBS_get_asn1(in, &private_key, CBS_ASN1_OCTETSTRING)) { + return false; + } + private_key_.reset(BN_bin2bn(CBS_data(&private_key), + CBS_len(&private_key), nullptr)); + return private_key_ != nullptr; + } + + private: + UniquePtr private_key_; + int nid_; + uint16_t group_id_; +}; + +class X25519KeyShare : public SSLKeyShare { + public: + X25519KeyShare() {} + + uint16_t GroupID() const override { return SSL_CURVE_X25519; } + + bool Offer(CBB *out) override { + uint8_t public_key[32]; + X25519_keypair(public_key, private_key_); + return !!CBB_add_bytes(out, public_key, sizeof(public_key)); + } + + bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) override { + *out_alert = SSL_AD_INTERNAL_ERROR; + + Array secret; + if (!secret.Init(32)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + if (peer_key.size() != 32 || + !X25519(secret.data(), private_key_, peer_key.data())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + return false; + } + + *out_secret = std::move(secret); + return true; + } + + bool Serialize(CBB *out) override { + return (CBB_add_asn1_uint64(out, GroupID()) && + CBB_add_asn1_octet_string(out, private_key_, sizeof(private_key_))); + } + + bool Deserialize(CBS *in) override { + CBS key; + if (!CBS_get_asn1(in, &key, CBS_ASN1_OCTETSTRING) || + CBS_len(&key) != sizeof(private_key_) || + !CBS_copy_bytes(&key, private_key_, sizeof(private_key_))) { + return false; + } + return true; + } + + private: + uint8_t private_key_[32]; +}; + +class CECPQ2KeyShare : public SSLKeyShare { + public: + CECPQ2KeyShare() {} + + uint16_t GroupID() const override { return SSL_CURVE_CECPQ2; } + + bool Offer(CBB *out) override { + uint8_t x25519_public_key[32]; + X25519_keypair(x25519_public_key, x25519_private_key_); + + uint8_t hrss_entropy[HRSS_GENERATE_KEY_BYTES]; + HRSS_public_key hrss_public_key; + RAND_bytes(hrss_entropy, sizeof(hrss_entropy)); + HRSS_generate_key(&hrss_public_key, &hrss_private_key_, hrss_entropy); + + uint8_t hrss_public_key_bytes[HRSS_PUBLIC_KEY_BYTES]; + HRSS_marshal_public_key(hrss_public_key_bytes, &hrss_public_key); + + if (!CBB_add_bytes(out, x25519_public_key, sizeof(x25519_public_key)) || + !CBB_add_bytes(out, hrss_public_key_bytes, + sizeof(hrss_public_key_bytes))) { + return false; + } + + return true; + } + + bool Accept(CBB *out_public_key, Array *out_secret, + uint8_t *out_alert, Span peer_key) override { + Array secret; + if (!secret.Init(32 + HRSS_KEY_BYTES)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + uint8_t x25519_public_key[32]; + X25519_keypair(x25519_public_key, x25519_private_key_); + + HRSS_public_key peer_public_key; + if (peer_key.size() != 32 + HRSS_PUBLIC_KEY_BYTES || + !HRSS_parse_public_key(&peer_public_key, peer_key.data() + 32) || + !X25519(secret.data(), x25519_private_key_, peer_key.data())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + return false; + } + + uint8_t ciphertext[HRSS_CIPHERTEXT_BYTES]; + uint8_t entropy[HRSS_ENCAP_BYTES]; + RAND_bytes(entropy, sizeof(entropy)); + HRSS_encap(ciphertext, secret.data() + 32, &peer_public_key, entropy); + + if (!CBB_add_bytes(out_public_key, x25519_public_key, + sizeof(x25519_public_key)) || + !CBB_add_bytes(out_public_key, ciphertext, sizeof(ciphertext))) { + return false; + } + + *out_secret = std::move(secret); + return true; + } + + bool Finish(Array *out_secret, uint8_t *out_alert, + Span peer_key) override { + *out_alert = SSL_AD_INTERNAL_ERROR; + + Array secret; + if (!secret.Init(32 + HRSS_KEY_BYTES)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + if (peer_key.size() != 32 + HRSS_CIPHERTEXT_BYTES || + !X25519(secret.data(), x25519_private_key_, peer_key.data())) { + *out_alert = SSL_AD_DECODE_ERROR; + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); + return false; + } + + HRSS_decap(secret.data() + 32, &hrss_private_key_, peer_key.data() + 32, + peer_key.size() - 32); + + *out_secret = std::move(secret); + return true; + } + + private: + uint8_t x25519_private_key_[32]; + HRSS_private_key hrss_private_key_; +}; + +CONSTEXPR_ARRAY NamedGroup kNamedGroups[] = { + {NID_secp224r1, SSL_CURVE_SECP224R1, "P-224", "secp224r1"}, + {NID_X9_62_prime256v1, SSL_CURVE_SECP256R1, "P-256", "prime256v1"}, + {NID_secp384r1, SSL_CURVE_SECP384R1, "P-384", "secp384r1"}, + {NID_secp521r1, SSL_CURVE_SECP521R1, "P-521", "secp521r1"}, + {NID_X25519, SSL_CURVE_X25519, "X25519", "x25519"}, + {NID_CECPQ2, SSL_CURVE_CECPQ2, "CECPQ2", "CECPQ2"}, +}; + +} // namespace + +Span NamedGroups() { + return MakeConstSpan(kNamedGroups, OPENSSL_ARRAY_SIZE(kNamedGroups)); +} + +UniquePtr SSLKeyShare::Create(uint16_t group_id) { + switch (group_id) { + case SSL_CURVE_SECP224R1: + return UniquePtr( + New(NID_secp224r1, SSL_CURVE_SECP224R1)); + case SSL_CURVE_SECP256R1: + return UniquePtr( + New(NID_X9_62_prime256v1, SSL_CURVE_SECP256R1)); + case SSL_CURVE_SECP384R1: + return UniquePtr( + New(NID_secp384r1, SSL_CURVE_SECP384R1)); + case SSL_CURVE_SECP521R1: + return UniquePtr( + New(NID_secp521r1, SSL_CURVE_SECP521R1)); + case SSL_CURVE_X25519: + return UniquePtr(New()); + case SSL_CURVE_CECPQ2: + return UniquePtr(New()); + default: + return nullptr; + } +} + +UniquePtr SSLKeyShare::Create(CBS *in) { + uint64_t group; + if (!CBS_get_asn1_uint64(in, &group) || group > 0xffff) { + return nullptr; + } + UniquePtr key_share = Create(static_cast(group)); + if (!key_share || !key_share->Deserialize(in)) { + return nullptr; + } + return key_share; +} + + +bool SSLKeyShare::Accept(CBB *out_public_key, Array *out_secret, + uint8_t *out_alert, Span peer_key) { + *out_alert = SSL_AD_INTERNAL_ERROR; + return Offer(out_public_key) && + Finish(out_secret, out_alert, peer_key); +} + +bool ssl_nid_to_group_id(uint16_t *out_group_id, int nid) { + for (const auto &group : kNamedGroups) { + if (group.nid == nid) { + *out_group_id = group.group_id; + return true; + } + } + return false; +} + +bool ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len) { + for (const auto &group : kNamedGroups) { + if (len == strlen(group.name) && + !strncmp(group.name, name, len)) { + *out_group_id = group.group_id; + return true; + } + if (len == strlen(group.alias) && + !strncmp(group.alias, name, len)) { + *out_group_id = group.group_id; + return true; + } + } + return false; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +const char* SSL_get_curve_name(uint16_t group_id) { + for (const auto &group : kNamedGroups) { + if (group.group_id == group_id) { + return group.name; + } + } + return nullptr; +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc new file mode 100644 index 000000000..86f3a5449 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc @@ -0,0 +1,3010 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + +#if defined(OPENSSL_WINDOWS) +#include +#else +#include +#include +#endif + + +BSSL_NAMESPACE_BEGIN + +// |SSL_R_UNKNOWN_PROTOCOL| is no longer emitted, but continue to define it +// to avoid downstream churn. +OPENSSL_DECLARE_ERROR_REASON(SSL, UNKNOWN_PROTOCOL) + +// The following errors are no longer emitted, but are used in nginx without +// #ifdefs. +OPENSSL_DECLARE_ERROR_REASON(SSL, BLOCK_CIPHER_PAD_IS_WRONG) +OPENSSL_DECLARE_ERROR_REASON(SSL, NO_CIPHERS_SPECIFIED) + +// Some error codes are special. Ensure the make_errors.go script never +// regresses this. +static_assert(SSL_R_TLSV1_ALERT_NO_RENEGOTIATION == + SSL_AD_NO_RENEGOTIATION + SSL_AD_REASON_OFFSET, + "alert reason code mismatch"); + +// kMaxHandshakeSize is the maximum size, in bytes, of a handshake message. +static const size_t kMaxHandshakeSize = (1u << 24) - 1; + +static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl = + CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; +static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl_ctx = + CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; + +bool CBBFinishArray(CBB *cbb, Array *out) { + uint8_t *ptr; + size_t len; + if (!CBB_finish(cbb, &ptr, &len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + out->Reset(ptr, len); + return true; +} + +void ssl_reset_error_state(SSL *ssl) { + // Functions which use |SSL_get_error| must reset I/O and error state on + // entry. + ssl->s3->rwstate = SSL_ERROR_NONE; + ERR_clear_error(); + ERR_clear_system_error(); +} + +void ssl_set_read_error(SSL* ssl) { + ssl->s3->read_shutdown = ssl_shutdown_error; + ssl->s3->read_error.reset(ERR_save_state()); +} + +static bool check_read_error(const SSL *ssl) { + if (ssl->s3->read_shutdown == ssl_shutdown_error) { + ERR_restore_state(ssl->s3->read_error.get()); + return false; + } + return true; +} + +bool ssl_can_write(const SSL *ssl) { + return !SSL_in_init(ssl) || ssl->s3->hs->can_early_write; +} + +bool ssl_can_read(const SSL *ssl) { + return !SSL_in_init(ssl) || ssl->s3->hs->can_early_read; +} + +ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in) { + *out_consumed = 0; + if (!check_read_error(ssl)) { + *out_alert = 0; + return ssl_open_record_error; + } + auto ret = ssl->method->open_handshake(ssl, out_consumed, out_alert, in); + if (ret == ssl_open_record_error) { + ssl_set_read_error(ssl); + } + return ret; +} + +ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in) { + *out_consumed = 0; + if (!check_read_error(ssl)) { + *out_alert = 0; + return ssl_open_record_error; + } + auto ret = + ssl->method->open_change_cipher_spec(ssl, out_consumed, out_alert, in); + if (ret == ssl_open_record_error) { + ssl_set_read_error(ssl); + } + return ret; +} + +ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in) { + *out_consumed = 0; + if (!check_read_error(ssl)) { + *out_alert = 0; + return ssl_open_record_error; + } + auto ret = ssl->method->open_app_data(ssl, out, out_consumed, out_alert, in); + if (ret == ssl_open_record_error) { + ssl_set_read_error(ssl); + } + return ret; +} + +void ssl_update_cache(SSL_HANDSHAKE *hs, int mode) { + SSL *const ssl = hs->ssl; + SSL_CTX *ctx = ssl->session_ctx.get(); + // Never cache sessions with empty session IDs. + if (ssl->s3->established_session->session_id_length == 0 || + ssl->s3->established_session->not_resumable || + (ctx->session_cache_mode & mode) != mode) { + return; + } + + // Clients never use the internal session cache. + int use_internal_cache = ssl->server && !(ctx->session_cache_mode & + SSL_SESS_CACHE_NO_INTERNAL_STORE); + + // A client may see new sessions on abbreviated handshakes if the server + // decides to renew the ticket. Once the handshake is completed, it should be + // inserted into the cache. + if (ssl->s3->established_session.get() != ssl->session.get() || + (!ssl->server && hs->ticket_expected)) { + if (use_internal_cache) { + SSL_CTX_add_session(ctx, ssl->s3->established_session.get()); + } + if (ctx->new_session_cb != NULL) { + UniquePtr ref = UpRef(ssl->s3->established_session); + if (ctx->new_session_cb(ssl, ref.get())) { + // |new_session_cb|'s return value signals whether it took ownership. + ref.release(); + } + } + } + + if (use_internal_cache && + !(ctx->session_cache_mode & SSL_SESS_CACHE_NO_AUTO_CLEAR)) { + // Automatically flush the internal session cache every 255 connections. + int flush_cache = 0; + CRYPTO_MUTEX_lock_write(&ctx->lock); + ctx->handshakes_since_cache_flush++; + if (ctx->handshakes_since_cache_flush >= 255) { + flush_cache = 1; + ctx->handshakes_since_cache_flush = 0; + } + CRYPTO_MUTEX_unlock_write(&ctx->lock); + + if (flush_cache) { + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + SSL_CTX_flush_sessions(ctx, now.tv_sec); + } + } +} + +static bool cbb_add_hex(CBB *cbb, Span in) { + static const char hextable[] = "0123456789abcdef"; + uint8_t *out; + + if (!CBB_add_space(cbb, &out, in.size() * 2)) { + return false; + } + + for (uint8_t b : in) { + *(out++) = (uint8_t)hextable[b >> 4]; + *(out++) = (uint8_t)hextable[b & 0xf]; + } + + return true; +} + +bool ssl_log_secret(const SSL *ssl, const char *label, + Span secret) { + if (ssl->ctx->keylog_callback == NULL) { + return true; + } + + ScopedCBB cbb; + Array line; + if (!CBB_init(cbb.get(), strlen(label) + 1 + SSL3_RANDOM_SIZE * 2 + 1 + + secret.size() * 2 + 1) || + !CBB_add_bytes(cbb.get(), reinterpret_cast(label), + strlen(label)) || + !CBB_add_u8(cbb.get(), ' ') || + !cbb_add_hex(cbb.get(), ssl->s3->client_random) || + !CBB_add_u8(cbb.get(), ' ') || + !cbb_add_hex(cbb.get(), secret) || + !CBB_add_u8(cbb.get(), 0 /* NUL */) || + !CBBFinishArray(cbb.get(), &line)) { + return false; + } + + ssl->ctx->keylog_callback(ssl, reinterpret_cast(line.data())); + return true; +} + +void ssl_do_info_callback(const SSL *ssl, int type, int value) { + void (*cb)(const SSL *ssl, int type, int value) = NULL; + if (ssl->info_callback != NULL) { + cb = ssl->info_callback; + } else if (ssl->ctx->info_callback != NULL) { + cb = ssl->ctx->info_callback; + } + + if (cb != NULL) { + cb(ssl, type, value); + } +} + +void ssl_do_msg_callback(const SSL *ssl, int is_write, int content_type, + Span in) { + if (ssl->msg_callback == NULL) { + return; + } + + // |version| is zero when calling for |SSL3_RT_HEADER| and |SSL2_VERSION| for + // a V2ClientHello. + int version; + switch (content_type) { + case 0: + // V2ClientHello + version = SSL2_VERSION; + break; + case SSL3_RT_HEADER: + version = 0; + break; + default: + version = SSL_version(ssl); + } + + ssl->msg_callback(is_write, version, content_type, in.data(), in.size(), + const_cast(ssl), ssl->msg_callback_arg); +} + +void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock) { + // TODO(martinkr): Change callers to |ssl_ctx_get_current_time| and drop the + // |ssl| arg from |current_time_cb| if possible. + ssl_ctx_get_current_time(ssl->ctx.get(), out_clock); +} + +void ssl_ctx_get_current_time(const SSL_CTX *ctx, + struct OPENSSL_timeval *out_clock) { + if (ctx->current_time_cb != NULL) { + // TODO(davidben): Update current_time_cb to use OPENSSL_timeval. See + // https://crbug.com/boringssl/155. + struct timeval clock; + ctx->current_time_cb(nullptr /* ssl */, &clock); + if (clock.tv_sec < 0) { + assert(0); + out_clock->tv_sec = 0; + out_clock->tv_usec = 0; + } else { + out_clock->tv_sec = (uint64_t)clock.tv_sec; + out_clock->tv_usec = (uint32_t)clock.tv_usec; + } + return; + } + +#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + out_clock->tv_sec = 1234; + out_clock->tv_usec = 1234; +#elif defined(OPENSSL_WINDOWS) + struct _timeb time; + _ftime(&time); + if (time.time < 0) { + assert(0); + out_clock->tv_sec = 0; + out_clock->tv_usec = 0; + } else { + out_clock->tv_sec = time.time; + out_clock->tv_usec = time.millitm * 1000; + } +#else + struct timeval clock; + gettimeofday(&clock, NULL); + if (clock.tv_sec < 0) { + assert(0); + out_clock->tv_sec = 0; + out_clock->tv_usec = 0; + } else { + out_clock->tv_sec = (uint64_t)clock.tv_sec; + out_clock->tv_usec = (uint32_t)clock.tv_usec; + } +#endif +} + +void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on) { + ctx->handoff = on; +} + +static bool ssl_can_renegotiate(const SSL *ssl) { + if (ssl->server || SSL_is_dtls(ssl)) { + return false; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // The config has already been shed. + if (!ssl->config) { + return false; + } + + switch (ssl->renegotiate_mode) { + case ssl_renegotiate_ignore: + case ssl_renegotiate_never: + return false; + + case ssl_renegotiate_freely: + case ssl_renegotiate_explicit: + return true; + case ssl_renegotiate_once: + return ssl->s3->total_renegotiations == 0; + } + + assert(0); + return false; +} + +static void ssl_maybe_shed_handshake_config(SSL *ssl) { + if (ssl->s3->hs != nullptr || + ssl->config == nullptr || + !ssl->config->shed_handshake_config || + ssl_can_renegotiate(ssl)) { + return; + } + + ssl->config.reset(); +} + +void SSL_set_handoff_mode(SSL *ssl, bool on) { + if (!ssl->config) { + return; + } + ssl->config->handoff = on; +} + +bool SSL_get_traffic_secrets(const SSL *ssl, + Span *out_read_traffic_secret, + Span *out_write_traffic_secret) { + if (SSL_version(ssl) < TLS1_3_VERSION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); + return false; + } + + if (!ssl->s3->initial_handshake_complete) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); + return false; + } + + *out_read_traffic_secret = Span( + ssl->s3->read_traffic_secret, ssl->s3->read_traffic_secret_len); + *out_write_traffic_secret = Span( + ssl->s3->write_traffic_secret, ssl->s3->write_traffic_secret_len); + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_library_init(void) { + CRYPTO_library_init(); + return 1; +} + +int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { + CRYPTO_library_init(); + return 1; +} + +static uint32_t ssl_session_hash(const SSL_SESSION *sess) { + return ssl_hash_session_id( + MakeConstSpan(sess->session_id, sess->session_id_length)); +} + +static int ssl_session_cmp(const SSL_SESSION *a, const SSL_SESSION *b) { + if (a->session_id_length != b->session_id_length) { + return 1; + } + + return OPENSSL_memcmp(a->session_id, b->session_id, a->session_id_length); +} + +ssl_ctx_st::ssl_ctx_st(const SSL_METHOD *ssl_method) + : method(ssl_method->method), + x509_method(ssl_method->x509_method), + retain_only_sha256_of_client_certs(false), + quiet_shutdown(false), + ocsp_stapling_enabled(false), + signed_cert_timestamps_enabled(false), + channel_id_enabled(false), + grease_enabled(false), + allow_unknown_alpn_protos(false), + ed25519_enabled(false), + false_start_allowed_without_alpn(false), + ignore_tls13_downgrade(false), + handoff(false), + enable_early_data(false) { + CRYPTO_MUTEX_init(&lock); + CRYPTO_new_ex_data(&ex_data); +} + +ssl_ctx_st::~ssl_ctx_st() { + // Free the internal session cache. Note that this calls the caller-supplied + // remove callback, so we must do it before clearing ex_data. (See ticket + // [openssl.org #212].) + SSL_CTX_flush_sessions(this, 0); + + CRYPTO_free_ex_data(&g_ex_data_class_ssl_ctx, this, &ex_data); + + CRYPTO_MUTEX_cleanup(&lock); + lh_SSL_SESSION_free(sessions); + x509_method->ssl_ctx_free(this); +} + +SSL_CTX *SSL_CTX_new(const SSL_METHOD *method) { + if (method == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_METHOD_PASSED); + return nullptr; + } + + UniquePtr ret = MakeUnique(method); + if (!ret) { + return nullptr; + } + + ret->cert = MakeUnique(method->x509_method); + ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp); + ret->client_CA.reset(sk_CRYPTO_BUFFER_new_null()); + if (ret->cert == nullptr || + ret->sessions == nullptr || + ret->client_CA == nullptr || + !ret->x509_method->ssl_ctx_new(ret.get())) { + return nullptr; + } + + if (!SSL_CTX_set_strict_cipher_list(ret.get(), SSL_DEFAULT_CIPHER_LIST) || + // Lock the SSL_CTX to the specified version, for compatibility with + // legacy uses of SSL_METHOD. + !SSL_CTX_set_max_proto_version(ret.get(), method->version) || + !SSL_CTX_set_min_proto_version(ret.get(), method->version)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return nullptr; + } + + return ret.release(); +} + +int SSL_CTX_up_ref(SSL_CTX *ctx) { + CRYPTO_refcount_inc(&ctx->references); + return 1; +} + +void SSL_CTX_free(SSL_CTX *ctx) { + if (ctx == NULL || + !CRYPTO_refcount_dec_and_test_zero(&ctx->references)) { + return; + } + + ctx->~ssl_ctx_st(); + OPENSSL_free(ctx); +} + +ssl_st::ssl_st(SSL_CTX *ctx_arg) + : method(ctx_arg->method), + max_send_fragment(ctx_arg->max_send_fragment), + msg_callback(ctx_arg->msg_callback), + msg_callback_arg(ctx_arg->msg_callback_arg), + ctx(UpRef(ctx_arg)), + session_ctx(UpRef(ctx_arg)), + options(ctx->options), + mode(ctx->mode), + max_cert_list(ctx->max_cert_list), + server(false), + quiet_shutdown(ctx->quiet_shutdown), + enable_early_data(ctx->enable_early_data) { + CRYPTO_new_ex_data(&ex_data); +} + +ssl_st::~ssl_st() { + CRYPTO_free_ex_data(&g_ex_data_class_ssl, this, &ex_data); + // |config| refers to |this|, so we must release it earlier. + config.reset(); + if (method != NULL) { + method->ssl_free(this); + } +} + +SSL *SSL_new(SSL_CTX *ctx) { + if (ctx == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_CTX); + return nullptr; + } + + UniquePtr ssl = MakeUnique(ctx); + if (ssl == nullptr) { + return nullptr; + } + + ssl->config = MakeUnique(ssl.get()); + if (ssl->config == nullptr) { + return nullptr; + } + ssl->config->conf_min_version = ctx->conf_min_version; + ssl->config->conf_max_version = ctx->conf_max_version; + + ssl->config->cert = ssl_cert_dup(ctx->cert.get()); + if (ssl->config->cert == nullptr) { + return nullptr; + } + + ssl->config->verify_mode = ctx->verify_mode; + ssl->config->verify_callback = ctx->default_verify_callback; + ssl->config->custom_verify_callback = ctx->custom_verify_callback; + ssl->config->retain_only_sha256_of_client_certs = + ctx->retain_only_sha256_of_client_certs; + + if (!ssl->config->supported_group_list.CopyFrom(ctx->supported_group_list) || + !ssl->config->alpn_client_proto_list.CopyFrom( + ctx->alpn_client_proto_list) || + !ssl->config->verify_sigalgs.CopyFrom(ctx->verify_sigalgs)) { + return nullptr; + } + + if (ctx->psk_identity_hint) { + ssl->config->psk_identity_hint.reset( + OPENSSL_strdup(ctx->psk_identity_hint.get())); + if (ssl->config->psk_identity_hint == nullptr) { + return nullptr; + } + } + ssl->config->psk_client_callback = ctx->psk_client_callback; + ssl->config->psk_server_callback = ctx->psk_server_callback; + + ssl->config->channel_id_enabled = ctx->channel_id_enabled; + ssl->config->channel_id_private = UpRef(ctx->channel_id_private); + + ssl->config->signed_cert_timestamps_enabled = + ctx->signed_cert_timestamps_enabled; + ssl->config->ocsp_stapling_enabled = ctx->ocsp_stapling_enabled; + ssl->config->handoff = ctx->handoff; + ssl->config->ignore_tls13_downgrade = ctx->ignore_tls13_downgrade; + ssl->quic_method = ctx->quic_method; + + if (!ssl->method->ssl_new(ssl.get()) || + !ssl->ctx->x509_method->ssl_new(ssl->s3->hs.get())) { + return nullptr; + } + + return ssl.release(); +} + +SSL_CONFIG::SSL_CONFIG(SSL *ssl_arg) + : ssl(ssl_arg), + signed_cert_timestamps_enabled(false), + ocsp_stapling_enabled(false), + channel_id_enabled(false), + enforce_rsa_key_usage(false), + retain_only_sha256_of_client_certs(false), + handoff(false), + shed_handshake_config(false), + ignore_tls13_downgrade(false), + jdk11_workaround(false) { + assert(ssl); +} + +SSL_CONFIG::~SSL_CONFIG() { + if (ssl->ctx != nullptr) { + ssl->ctx->x509_method->ssl_config_free(this); + } +} + +void SSL_free(SSL *ssl) { + Delete(ssl); +} + +void SSL_set_connect_state(SSL *ssl) { + ssl->server = false; + ssl->do_handshake = ssl_client_handshake; +} + +void SSL_set_accept_state(SSL *ssl) { + ssl->server = true; + ssl->do_handshake = ssl_server_handshake; +} + +void SSL_set0_rbio(SSL *ssl, BIO *rbio) { + ssl->rbio.reset(rbio); +} + +void SSL_set0_wbio(SSL *ssl, BIO *wbio) { + ssl->wbio.reset(wbio); +} + +void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio) { + // For historical reasons, this function has many different cases in ownership + // handling. + + // If nothing has changed, do nothing + if (rbio == SSL_get_rbio(ssl) && wbio == SSL_get_wbio(ssl)) { + return; + } + + // If the two arguments are equal, one fewer reference is granted than + // taken. + if (rbio != NULL && rbio == wbio) { + BIO_up_ref(rbio); + } + + // If only the wbio is changed, adopt only one reference. + if (rbio == SSL_get_rbio(ssl)) { + SSL_set0_wbio(ssl, wbio); + return; + } + + // There is an asymmetry here for historical reasons. If only the rbio is + // changed AND the rbio and wbio were originally different, then we only adopt + // one reference. + if (wbio == SSL_get_wbio(ssl) && SSL_get_rbio(ssl) != SSL_get_wbio(ssl)) { + SSL_set0_rbio(ssl, rbio); + return; + } + + // Otherwise, adopt both references. + SSL_set0_rbio(ssl, rbio); + SSL_set0_wbio(ssl, wbio); +} + +BIO *SSL_get_rbio(const SSL *ssl) { return ssl->rbio.get(); } + +BIO *SSL_get_wbio(const SSL *ssl) { return ssl->wbio.get(); } + +size_t SSL_quic_max_handshake_flight_len(const SSL *ssl, + enum ssl_encryption_level_t level) { + // Limits flights to 16K by default when there are no large + // (certificate-carrying) messages. + static const size_t kDefaultLimit = 16384; + + switch (level) { + case ssl_encryption_initial: + return kDefaultLimit; + case ssl_encryption_early_data: + // QUIC does not send EndOfEarlyData. + return 0; + case ssl_encryption_handshake: + if (ssl->server) { + // Servers may receive Certificate message if configured to request + // client certificates. + if (!!(ssl->config->verify_mode & SSL_VERIFY_PEER) && + ssl->max_cert_list > kDefaultLimit) { + return ssl->max_cert_list; + } + } else { + // Clients may receive both Certificate message and a CertificateRequest + // message. + if (2*ssl->max_cert_list > kDefaultLimit) { + return 2*ssl->max_cert_list; + } + } + return kDefaultLimit; + case ssl_encryption_application: + // Note there is not actually a bound on the number of NewSessionTickets + // one may send in a row. This level may need more involved flow + // control. See https://github.com/quicwg/base-drafts/issues/1834. + return kDefaultLimit; + } + + return 0; +} + +enum ssl_encryption_level_t SSL_quic_read_level(const SSL *ssl) { + return ssl->s3->read_level; +} + +enum ssl_encryption_level_t SSL_quic_write_level(const SSL *ssl) { + return ssl->s3->write_level; +} + +int SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *data, size_t len) { + if (ssl->quic_method == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (level != ssl->s3->read_level) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED); + return 0; + } + + size_t new_len = (ssl->s3->hs_buf ? ssl->s3->hs_buf->length : 0) + len; + if (new_len < len || + new_len > SSL_quic_max_handshake_flight_len(ssl, level)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE); + return 0; + } + + return tls_append_handshake_data(ssl, MakeConstSpan(data, len)); +} + +int SSL_do_handshake(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_TYPE_NOT_SET); + return -1; + } + + if (!SSL_in_init(ssl)) { + return 1; + } + + // Run the handshake. + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + + bool early_return = false; + int ret = ssl_run_handshake(hs, &early_return); + ssl_do_info_callback( + ssl, ssl->server ? SSL_CB_ACCEPT_EXIT : SSL_CB_CONNECT_EXIT, ret); + if (ret <= 0) { + return ret; + } + + // Destroy the handshake object if the handshake has completely finished. + if (!early_return) { + ssl->s3->hs.reset(); + ssl_maybe_shed_handshake_config(ssl); + } + + return 1; +} + +int SSL_connect(SSL *ssl) { + if (ssl->do_handshake == NULL) { + // Not properly initialized yet + SSL_set_connect_state(ssl); + } + + return SSL_do_handshake(ssl); +} + +int SSL_accept(SSL *ssl) { + if (ssl->do_handshake == NULL) { + // Not properly initialized yet + SSL_set_accept_state(ssl); + } + + return SSL_do_handshake(ssl); +} + +static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) { + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return tls13_post_handshake(ssl, msg); + } + + // Check for renegotiation on the server before parsing to use the correct + // error. Renegotiation is triggered by a different message for servers. + if (ssl->server) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION); + return 0; + } + + if (msg.type != SSL3_MT_HELLO_REQUEST || CBS_len(&msg.body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HELLO_REQUEST); + return 0; + } + + if (ssl->renegotiate_mode == ssl_renegotiate_ignore) { + return 1; // Ignore the HelloRequest. + } + + ssl->s3->renegotiate_pending = true; + if (ssl->renegotiate_mode == ssl_renegotiate_explicit) { + return 1; // Handle it later. + } + + if (!SSL_renegotiate(ssl)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION); + return 0; + } + + return 1; +} + +int SSL_process_quic_post_handshake(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (SSL_in_init(ssl)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + // Replay post-handshake message errors. + if (!check_read_error(ssl)) { + return 0; + } + + // Process any buffered post-handshake messages. + SSLMessage msg; + while (ssl->method->get_message(ssl, &msg)) { + // Handle the post-handshake message and try again. + if (!ssl_do_post_handshake(ssl, msg)) { + ssl_set_read_error(ssl); + return 0; + } + ssl->method->next_message(ssl); + } + + return 1; +} + +static int ssl_read_impl(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return -1; + } + + // Replay post-handshake message errors. + if (!check_read_error(ssl)) { + return -1; + } + + while (ssl->s3->pending_app_data.empty()) { + if (ssl->s3->renegotiate_pending) { + ssl->s3->rwstate = SSL_ERROR_WANT_RENEGOTIATE; + return -1; + } + + // Complete the current handshake, if any. False Start will cause + // |SSL_do_handshake| to return mid-handshake, so this may require multiple + // iterations. + while (!ssl_can_read(ssl)) { + int ret = SSL_do_handshake(ssl); + if (ret < 0) { + return ret; + } + if (ret == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); + return -1; + } + } + + // Process any buffered post-handshake messages. + SSLMessage msg; + if (ssl->method->get_message(ssl, &msg)) { + // If we received an interrupt in early read (EndOfEarlyData), loop again + // for the handshake to process it. + if (SSL_in_init(ssl)) { + ssl->s3->hs->can_early_read = false; + continue; + } + + // Handle the post-handshake message and try again. + if (!ssl_do_post_handshake(ssl, msg)) { + ssl_set_read_error(ssl); + return -1; + } + ssl->method->next_message(ssl); + continue; // Loop again. We may have begun a new handshake. + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + size_t consumed = 0; + auto ret = ssl_open_app_data(ssl, &ssl->s3->pending_app_data, &consumed, + &alert, ssl->s3->read_buffer.span()); + bool retry; + int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert); + if (bio_ret <= 0) { + return bio_ret; + } + if (!retry) { + assert(!ssl->s3->pending_app_data.empty()); + ssl->s3->key_update_count = 0; + } + } + + return 1; +} + +int SSL_read(SSL *ssl, void *buf, int num) { + int ret = SSL_peek(ssl, buf, num); + if (ret <= 0) { + return ret; + } + // TODO(davidben): In DTLS, should the rest of the record be discarded? DTLS + // is not a stream. See https://crbug.com/boringssl/65. + ssl->s3->pending_app_data = + ssl->s3->pending_app_data.subspan(static_cast(ret)); + if (ssl->s3->pending_app_data.empty()) { + ssl->s3->read_buffer.DiscardConsumed(); + } + return ret; +} + +int SSL_peek(SSL *ssl, void *buf, int num) { + if (ssl->quic_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + int ret = ssl_read_impl(ssl); + if (ret <= 0) { + return ret; + } + if (num <= 0) { + return num; + } + size_t todo = + std::min(ssl->s3->pending_app_data.size(), static_cast(num)); + OPENSSL_memcpy(buf, ssl->s3->pending_app_data.data(), todo); + return static_cast(todo); +} + +int SSL_write(SSL *ssl, const void *buf, int num) { + ssl_reset_error_state(ssl); + + if (ssl->quic_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return -1; + } + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + int ret = 0; + bool needs_handshake = false; + do { + // If necessary, complete the handshake implicitly. + if (!ssl_can_write(ssl)) { + ret = SSL_do_handshake(ssl); + if (ret < 0) { + return ret; + } + if (ret == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); + return -1; + } + } + + ret = ssl->method->write_app_data(ssl, &needs_handshake, + (const uint8_t *)buf, num); + } while (needs_handshake); + return ret; +} + +int SSL_key_update(SSL *ssl, int request_type) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return 0; + } + + if (ssl->ctx->quic_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (!ssl->s3->initial_handshake_complete) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); + return 0; + } + + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); + return 0; + } + + if (!ssl->s3->key_update_pending && + !tls13_add_key_update(ssl, request_type)) { + return 0; + } + + return 1; +} + +int SSL_shutdown(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return -1; + } + + // If we are in the middle of a handshake, silently succeed. Consumers often + // call this function before |SSL_free|, whether the handshake succeeded or + // not. We assume the caller has already handled failed handshakes. + if (SSL_in_init(ssl)) { + return 1; + } + + if (ssl->quiet_shutdown) { + // Do nothing if configured not to send a close_notify. + ssl->s3->write_shutdown = ssl_shutdown_close_notify; + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + return 1; + } + + // This function completes in two stages. It sends a close_notify and then it + // waits for a close_notify to come in. Perform exactly one action and return + // whether or not it succeeds. + + if (ssl->s3->write_shutdown != ssl_shutdown_close_notify) { + // Send a close_notify. + if (ssl_send_alert_impl(ssl, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY) <= 0) { + return -1; + } + } else if (ssl->s3->alert_dispatch) { + // Finish sending the close_notify. + if (ssl->method->dispatch_alert(ssl) <= 0) { + return -1; + } + } else if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { + if (SSL_is_dtls(ssl)) { + // Bidirectional shutdown doesn't make sense for an unordered + // transport. DTLS alerts also aren't delivered reliably, so we may even + // time out because the peer never received our close_notify. Report to + // the caller that the channel has fully shut down. + if (ssl->s3->read_shutdown == ssl_shutdown_error) { + ERR_restore_state(ssl->s3->read_error.get()); + return -1; + } + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + } else { + // Process records until an error, close_notify, or application data. + if (ssl_read_impl(ssl) > 0) { + // We received some unexpected application data. + OPENSSL_PUT_ERROR(SSL, SSL_R_APPLICATION_DATA_ON_SHUTDOWN); + return -1; + } + if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { + return -1; + } + } + } + + // Return 0 for unidirectional shutdown and 1 for bidirectional shutdown. + return ssl->s3->read_shutdown == ssl_shutdown_close_notify; +} + +int SSL_send_fatal_alert(SSL *ssl, uint8_t alert) { + if (ssl->s3->alert_dispatch) { + if (ssl->s3->send_alert[0] != SSL3_AL_FATAL || + ssl->s3->send_alert[1] != alert) { + // We are already attempting to write a different alert. + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + return ssl->method->dispatch_alert(ssl); + } + + return ssl_send_alert_impl(ssl, SSL3_AL_FATAL, alert); +} + +int SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params, + size_t params_len) { + return ssl->config && ssl->config->quic_transport_params.CopyFrom( + MakeConstSpan(params, params_len)); +} + +void SSL_get_peer_quic_transport_params(const SSL *ssl, + const uint8_t **out_params, + size_t *out_params_len) { + *out_params = ssl->s3->peer_quic_transport_params.data(); + *out_params_len = ssl->s3->peer_quic_transport_params.size(); +} + +void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled) { + ctx->enable_early_data = !!enabled; +} + +void SSL_set_early_data_enabled(SSL *ssl, int enabled) { + ssl->enable_early_data = !!enabled; +} + +int SSL_in_early_data(const SSL *ssl) { + if (ssl->s3->hs == NULL) { + return 0; + } + return ssl->s3->hs->in_early_data; +} + +int SSL_early_data_accepted(const SSL *ssl) { + return ssl->s3->early_data_accepted; +} + +void SSL_reset_early_data_reject(SSL *ssl) { + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + if (hs == NULL || + hs->wait != ssl_hs_early_data_rejected) { + abort(); + } + + hs->wait = ssl_hs_ok; + hs->in_early_data = false; + hs->early_session.reset(); + + // Discard any unfinished writes from the perspective of |SSL_write|'s + // retry. The handshake will transparently flush out the pending record + // (discarded by the server) to keep the framing correct. + ssl->s3->wpend_pending = false; +} + +enum ssl_early_data_reason_t SSL_get_early_data_reason(const SSL *ssl) { + return ssl->s3->early_data_reason; +} + +static int bio_retry_reason_to_error(int reason) { + switch (reason) { + case BIO_RR_CONNECT: + return SSL_ERROR_WANT_CONNECT; + case BIO_RR_ACCEPT: + return SSL_ERROR_WANT_ACCEPT; + default: + return SSL_ERROR_SYSCALL; + } +} + +int SSL_get_error(const SSL *ssl, int ret_code) { + if (ret_code > 0) { + return SSL_ERROR_NONE; + } + + // Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc, + // where we do encode the error + uint32_t err = ERR_peek_error(); + if (err != 0) { + if (ERR_GET_LIB(err) == ERR_LIB_SYS) { + return SSL_ERROR_SYSCALL; + } + return SSL_ERROR_SSL; + } + + if (ret_code == 0) { + if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { + return SSL_ERROR_ZERO_RETURN; + } + // An EOF was observed which violates the protocol, and the underlying + // transport does not participate in the error queue. Bubble up to the + // caller. + return SSL_ERROR_SYSCALL; + } + + switch (ssl->s3->rwstate) { + case SSL_ERROR_PENDING_SESSION: + case SSL_ERROR_PENDING_CERTIFICATE: + case SSL_ERROR_HANDOFF: + case SSL_ERROR_HANDBACK: + case SSL_ERROR_WANT_X509_LOOKUP: + case SSL_ERROR_WANT_CHANNEL_ID_LOOKUP: + case SSL_ERROR_WANT_PRIVATE_KEY_OPERATION: + case SSL_ERROR_PENDING_TICKET: + case SSL_ERROR_EARLY_DATA_REJECTED: + case SSL_ERROR_WANT_CERTIFICATE_VERIFY: + case SSL_ERROR_WANT_RENEGOTIATE: + return ssl->s3->rwstate; + + case SSL_ERROR_WANT_READ: { + if (ssl->quic_method) { + return SSL_ERROR_WANT_READ; + } + BIO *bio = SSL_get_rbio(ssl); + if (BIO_should_read(bio)) { + return SSL_ERROR_WANT_READ; + } + + if (BIO_should_write(bio)) { + // TODO(davidben): OpenSSL historically checked for writes on the read + // BIO. Can this be removed? + return SSL_ERROR_WANT_WRITE; + } + + if (BIO_should_io_special(bio)) { + return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); + } + + break; + } + + case SSL_ERROR_WANT_WRITE: { + BIO *bio = SSL_get_wbio(ssl); + if (BIO_should_write(bio)) { + return SSL_ERROR_WANT_WRITE; + } + + if (BIO_should_read(bio)) { + // TODO(davidben): OpenSSL historically checked for reads on the write + // BIO. Can this be removed? + return SSL_ERROR_WANT_READ; + } + + if (BIO_should_io_special(bio)) { + return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); + } + + break; + } + } + + return SSL_ERROR_SYSCALL; +} + +const char *SSL_error_description(int err) { + switch (err) { + case SSL_ERROR_NONE: + return "NONE"; + case SSL_ERROR_SSL: + return "SSL"; + case SSL_ERROR_WANT_READ: + return "WANT_READ"; + case SSL_ERROR_WANT_WRITE: + return "WANT_WRITE"; + case SSL_ERROR_WANT_X509_LOOKUP: + return "WANT_X509_LOOKUP"; + case SSL_ERROR_SYSCALL: + return "SYSCALL"; + case SSL_ERROR_ZERO_RETURN: + return "ZERO_RETURN"; + case SSL_ERROR_WANT_CONNECT: + return "WANT_CONNECT"; + case SSL_ERROR_WANT_ACCEPT: + return "WANT_ACCEPT"; + case SSL_ERROR_WANT_CHANNEL_ID_LOOKUP: + return "WANT_CHANNEL_ID_LOOKUP"; + case SSL_ERROR_PENDING_SESSION: + return "PENDING_SESSION"; + case SSL_ERROR_PENDING_CERTIFICATE: + return "PENDING_CERTIFICATE"; + case SSL_ERROR_WANT_PRIVATE_KEY_OPERATION: + return "WANT_PRIVATE_KEY_OPERATION"; + case SSL_ERROR_PENDING_TICKET: + return "PENDING_TICKET"; + case SSL_ERROR_EARLY_DATA_REJECTED: + return "EARLY_DATA_REJECTED"; + case SSL_ERROR_WANT_CERTIFICATE_VERIFY: + return "WANT_CERTIFICATE_VERIFY"; + case SSL_ERROR_HANDOFF: + return "HANDOFF"; + case SSL_ERROR_HANDBACK: + return "HANDBACK"; + default: + return nullptr; + } +} + +uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options) { + ctx->options |= options; + return ctx->options; +} + +uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options) { + ctx->options &= ~options; + return ctx->options; +} + +uint32_t SSL_CTX_get_options(const SSL_CTX *ctx) { return ctx->options; } + +uint32_t SSL_set_options(SSL *ssl, uint32_t options) { + ssl->options |= options; + return ssl->options; +} + +uint32_t SSL_clear_options(SSL *ssl, uint32_t options) { + ssl->options &= ~options; + return ssl->options; +} + +uint32_t SSL_get_options(const SSL *ssl) { return ssl->options; } + +uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode) { + ctx->mode |= mode; + return ctx->mode; +} + +uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode) { + ctx->mode &= ~mode; + return ctx->mode; +} + +uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx) { return ctx->mode; } + +uint32_t SSL_set_mode(SSL *ssl, uint32_t mode) { + ssl->mode |= mode; + return ssl->mode; +} + +uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode) { + ssl->mode &= ~mode; + return ssl->mode; +} + +uint32_t SSL_get_mode(const SSL *ssl) { return ssl->mode; } + +void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, CRYPTO_BUFFER_POOL *pool) { + ctx->pool = pool; +} + +int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out) { + *out_len = 0; + OPENSSL_memset(out, 0, max_out); + + // tls-unique is not defined for TLS 1.3. + if (!ssl->s3->initial_handshake_complete || + ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 0; + } + + // The tls-unique value is the first Finished message in the handshake, which + // is the client's in a full handshake and the server's for a resumption. See + // https://tools.ietf.org/html/rfc5929#section-3.1. + const uint8_t *finished = ssl->s3->previous_client_finished; + size_t finished_len = ssl->s3->previous_client_finished_len; + if (ssl->session != NULL) { + // tls-unique is broken for resumed sessions unless EMS is used. + if (!ssl->session->extended_master_secret) { + return 0; + } + finished = ssl->s3->previous_server_finished; + finished_len = ssl->s3->previous_server_finished_len; + } + + *out_len = finished_len; + if (finished_len > max_out) { + *out_len = max_out; + } + + OPENSSL_memcpy(out, finished, *out_len); + return 1; +} + +static int set_session_id_context(CERT *cert, const uint8_t *sid_ctx, + size_t sid_ctx_len) { + if (sid_ctx_len > sizeof(cert->sid_ctx)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); + return 0; + } + + static_assert(sizeof(cert->sid_ctx) < 256, "sid_ctx too large"); + cert->sid_ctx_length = (uint8_t)sid_ctx_len; + OPENSSL_memcpy(cert->sid_ctx, sid_ctx, sid_ctx_len); + return 1; +} + +int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const uint8_t *sid_ctx, + size_t sid_ctx_len) { + return set_session_id_context(ctx->cert.get(), sid_ctx, sid_ctx_len); +} + +int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, + size_t sid_ctx_len) { + if (!ssl->config) { + return 0; + } + return set_session_id_context(ssl->config->cert.get(), sid_ctx, sid_ctx_len); +} + +const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len) { + if (!ssl->config) { + assert(ssl->config); + *out_len = 0; + return NULL; + } + *out_len = ssl->config->cert->sid_ctx_length; + return ssl->config->cert->sid_ctx; +} + +void SSL_certs_clear(SSL *ssl) { + if (!ssl->config) { + return; + } + ssl_cert_clear_certs(ssl->config->cert.get()); +} + +int SSL_get_fd(const SSL *ssl) { return SSL_get_rfd(ssl); } + +int SSL_get_rfd(const SSL *ssl) { + int ret = -1; + BIO *b = BIO_find_type(SSL_get_rbio(ssl), BIO_TYPE_DESCRIPTOR); + if (b != NULL) { + BIO_get_fd(b, &ret); + } + return ret; +} + +int SSL_get_wfd(const SSL *ssl) { + int ret = -1; + BIO *b = BIO_find_type(SSL_get_wbio(ssl), BIO_TYPE_DESCRIPTOR); + if (b != NULL) { + BIO_get_fd(b, &ret); + } + return ret; +} + +int SSL_set_fd(SSL *ssl, int fd) { + BIO *bio = BIO_new(BIO_s_socket()); + if (bio == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + return 0; + } + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(ssl, bio, bio); + return 1; +} + +int SSL_set_wfd(SSL *ssl, int fd) { + BIO *rbio = SSL_get_rbio(ssl); + if (rbio == NULL || BIO_method_type(rbio) != BIO_TYPE_SOCKET || + BIO_get_fd(rbio, NULL) != fd) { + BIO *bio = BIO_new(BIO_s_socket()); + if (bio == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + return 0; + } + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set0_wbio(ssl, bio); + } else { + // Copy the rbio over to the wbio. + BIO_up_ref(rbio); + SSL_set0_wbio(ssl, rbio); + } + + return 1; +} + +int SSL_set_rfd(SSL *ssl, int fd) { + BIO *wbio = SSL_get_wbio(ssl); + if (wbio == NULL || BIO_method_type(wbio) != BIO_TYPE_SOCKET || + BIO_get_fd(wbio, NULL) != fd) { + BIO *bio = BIO_new(BIO_s_socket()); + if (bio == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + return 0; + } + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set0_rbio(ssl, bio); + } else { + // Copy the wbio over to the rbio. + BIO_up_ref(wbio); + SSL_set0_rbio(ssl, wbio); + } + return 1; +} + +static size_t copy_finished(void *out, size_t out_len, const uint8_t *in, + size_t in_len) { + if (out_len > in_len) { + out_len = in_len; + } + OPENSSL_memcpy(out, in, out_len); + return in_len; +} + +size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count) { + if (!ssl->s3->initial_handshake_complete || + ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 0; + } + + if (ssl->server) { + return copy_finished(buf, count, ssl->s3->previous_server_finished, + ssl->s3->previous_server_finished_len); + } + + return copy_finished(buf, count, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len); +} + +size_t SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count) { + if (!ssl->s3->initial_handshake_complete || + ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 0; + } + + if (ssl->server) { + return copy_finished(buf, count, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len); + } + + return copy_finished(buf, count, ssl->s3->previous_server_finished, + ssl->s3->previous_server_finished_len); +} + +int SSL_get_verify_mode(const SSL *ssl) { + if (!ssl->config) { + assert(ssl->config); + return -1; + } + return ssl->config->verify_mode; +} + +int SSL_get_extms_support(const SSL *ssl) { + // TLS 1.3 does not require extended master secret and always reports as + // supporting it. + if (!ssl->s3->have_version) { + return 0; + } + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 1; + } + + // If the initial handshake completed, query the established session. + if (ssl->s3->established_session != NULL) { + return ssl->s3->established_session->extended_master_secret; + } + + // Otherwise, query the in-progress handshake. + if (ssl->s3->hs != NULL) { + return ssl->s3->hs->extended_master_secret; + } + assert(0); + return 0; +} + +int SSL_CTX_get_read_ahead(const SSL_CTX *ctx) { return 0; } + +int SSL_get_read_ahead(const SSL *ssl) { return 0; } + +int SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) { return 1; } + +int SSL_set_read_ahead(SSL *ssl, int yes) { return 1; } + +int SSL_pending(const SSL *ssl) { + return static_cast(ssl->s3->pending_app_data.size()); +} + +int SSL_CTX_check_private_key(const SSL_CTX *ctx) { + return ssl_cert_check_private_key(ctx->cert.get(), + ctx->cert->privatekey.get()); +} + +int SSL_check_private_key(const SSL *ssl) { + if (!ssl->config) { + return 0; + } + return ssl_cert_check_private_key(ssl->config->cert.get(), + ssl->config->cert->privatekey.get()); +} + +long SSL_get_default_timeout(const SSL *ssl) { + return SSL_DEFAULT_SESSION_TIMEOUT; +} + +int SSL_renegotiate(SSL *ssl) { + // Caller-initiated renegotiation is not supported. + if (!ssl->s3->renegotiate_pending) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (!ssl_can_renegotiate(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + return 0; + } + + // Renegotiation is only supported at quiescent points in the application + // protocol, namely in HTTPS, just before reading the HTTP response. + // Require the record-layer be idle and avoid complexities of sending a + // handshake record while an application_data record is being written. + if (!ssl->s3->write_buffer.empty() || + ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + return 0; + } + + // Begin a new handshake. + if (ssl->s3->hs != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + ssl->s3->hs = ssl_handshake_new(ssl); + if (ssl->s3->hs == nullptr) { + return 0; + } + + ssl->s3->renegotiate_pending = false; + ssl->s3->total_renegotiations++; + return 1; +} + +int SSL_renegotiate_pending(SSL *ssl) { + return SSL_in_init(ssl) && ssl->s3->initial_handshake_complete; +} + +int SSL_total_renegotiations(const SSL *ssl) { + return ssl->s3->total_renegotiations; +} + +size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx) { + return ctx->max_cert_list; +} + +void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, size_t max_cert_list) { + if (max_cert_list > kMaxHandshakeSize) { + max_cert_list = kMaxHandshakeSize; + } + ctx->max_cert_list = (uint32_t)max_cert_list; +} + +size_t SSL_get_max_cert_list(const SSL *ssl) { + return ssl->max_cert_list; +} + +void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list) { + if (max_cert_list > kMaxHandshakeSize) { + max_cert_list = kMaxHandshakeSize; + } + ssl->max_cert_list = (uint32_t)max_cert_list; +} + +int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, size_t max_send_fragment) { + if (max_send_fragment < 512) { + max_send_fragment = 512; + } + if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { + max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; + } + ctx->max_send_fragment = (uint16_t)max_send_fragment; + + return 1; +} + +int SSL_set_max_send_fragment(SSL *ssl, size_t max_send_fragment) { + if (max_send_fragment < 512) { + max_send_fragment = 512; + } + if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { + max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; + } + ssl->max_send_fragment = (uint16_t)max_send_fragment; + + return 1; +} + +int SSL_set_mtu(SSL *ssl, unsigned mtu) { + if (!SSL_is_dtls(ssl) || mtu < dtls1_min_mtu()) { + return 0; + } + ssl->d1->mtu = mtu; + return 1; +} + +int SSL_get_secure_renegotiation_support(const SSL *ssl) { + if (!ssl->s3->have_version) { + return 0; + } + return ssl_protocol_version(ssl) >= TLS1_3_VERSION || + ssl->s3->send_connection_binding; +} + +size_t SSL_CTX_sess_number(const SSL_CTX *ctx) { + MutexReadLock lock(const_cast(&ctx->lock)); + return lh_SSL_SESSION_num_items(ctx->sessions); +} + +unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, unsigned long size) { + unsigned long ret = ctx->session_cache_size; + ctx->session_cache_size = size; + return ret; +} + +unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx) { + return ctx->session_cache_size; +} + +int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode) { + int ret = ctx->session_cache_mode; + ctx->session_cache_mode = mode; + return ret; +} + +int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx) { + return ctx->session_cache_mode; +} + + +int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, size_t len) { + if (out == NULL) { + return 48; + } + if (len != 48) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); + return 0; + } + + // The default ticket keys are initialized lazily. Trigger a key + // rotation to initialize them. + if (!ssl_ctx_rotate_ticket_encryption_key(ctx)) { + return 0; + } + + uint8_t *out_bytes = reinterpret_cast(out); + MutexReadLock lock(&ctx->lock); + OPENSSL_memcpy(out_bytes, ctx->ticket_key_current->name, 16); + OPENSSL_memcpy(out_bytes + 16, ctx->ticket_key_current->hmac_key, 16); + OPENSSL_memcpy(out_bytes + 32, ctx->ticket_key_current->aes_key, 16); + return 1; +} + +int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, size_t len) { + if (in == NULL) { + return 48; + } + if (len != 48) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); + return 0; + } + auto key = MakeUnique(); + if (!key) { + return 0; + } + const uint8_t *in_bytes = reinterpret_cast(in); + OPENSSL_memcpy(key->name, in_bytes, 16); + OPENSSL_memcpy(key->hmac_key, in_bytes + 16, 16); + OPENSSL_memcpy(key->aes_key, in_bytes + 32, 16); + // Disable automatic key rotation for manually-configured keys. This is now + // the caller's responsibility. + key->next_rotation_tv_sec = 0; + ctx->ticket_key_current = std::move(key); + ctx->ticket_key_prev.reset(); + return 1; +} + +int SSL_CTX_set_tlsext_ticket_key_cb( + SSL_CTX *ctx, int (*callback)(SSL *ssl, uint8_t *key_name, uint8_t *iv, + EVP_CIPHER_CTX *ctx, HMAC_CTX *hmac_ctx, + int encrypt)) { + ctx->ticket_key_cb = callback; + return 1; +} + +int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, size_t curves_len) { + return tls1_set_curves(&ctx->supported_group_list, + MakeConstSpan(curves, curves_len)); +} + +int SSL_set1_curves(SSL *ssl, const int *curves, size_t curves_len) { + if (!ssl->config) { + return 0; + } + return tls1_set_curves(&ssl->config->supported_group_list, + MakeConstSpan(curves, curves_len)); +} + +int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves) { + return tls1_set_curves_list(&ctx->supported_group_list, curves); +} + +int SSL_set1_curves_list(SSL *ssl, const char *curves) { + if (!ssl->config) { + return 0; + } + return tls1_set_curves_list(&ssl->config->supported_group_list, curves); +} + +uint16_t SSL_get_curve_id(const SSL *ssl) { + // TODO(davidben): This checks the wrong session if there is a renegotiation + // in progress. + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return 0; + } + + return session->group_id; +} + +int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh) { + return 1; +} + +int SSL_set_tmp_dh(SSL *ssl, const DH *dh) { + return 1; +} + +STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) { + return ctx->cipher_list->ciphers.get(); +} + +int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i) { + if (i >= sk_SSL_CIPHER_num(ctx->cipher_list->ciphers.get())) { + return 0; + } + return ctx->cipher_list->in_group_flags[i]; +} + +STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl) { + if (ssl == NULL) { + return NULL; + } + if (ssl->config == NULL) { + assert(ssl->config); + return NULL; + } + + return ssl->config->cipher_list ? ssl->config->cipher_list->ciphers.get() + : ssl->ctx->cipher_list->ciphers.get(); +} + +const char *SSL_get_cipher_list(const SSL *ssl, int n) { + if (ssl == NULL) { + return NULL; + } + + STACK_OF(SSL_CIPHER) *sk = SSL_get_ciphers(ssl); + if (sk == NULL || n < 0 || (size_t)n >= sk_SSL_CIPHER_num(sk)) { + return NULL; + } + + const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, n); + if (c == NULL) { + return NULL; + } + + return c->name; +} + +int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) { + return ssl_create_cipher_list(&ctx->cipher_list, str, false /* not strict */); +} + +int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, const char *str) { + return ssl_create_cipher_list(&ctx->cipher_list, str, true /* strict */); +} + +int SSL_set_cipher_list(SSL *ssl, const char *str) { + if (!ssl->config) { + return 0; + } + return ssl_create_cipher_list(&ssl->config->cipher_list, str, + false /* not strict */); +} + +int SSL_set_strict_cipher_list(SSL *ssl, const char *str) { + if (!ssl->config) { + return 0; + } + return ssl_create_cipher_list(&ssl->config->cipher_list, str, + true /* strict */); +} + +const char *SSL_get_servername(const SSL *ssl, const int type) { + if (type != TLSEXT_NAMETYPE_host_name) { + return NULL; + } + + // Historically, |SSL_get_servername| was also the configuration getter + // corresponding to |SSL_set_tlsext_host_name|. + if (ssl->hostname != nullptr) { + return ssl->hostname.get(); + } + + return ssl->s3->hostname.get(); +} + +int SSL_get_servername_type(const SSL *ssl) { + if (SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name) == NULL) { + return -1; + } + return TLSEXT_NAMETYPE_host_name; +} + +void SSL_CTX_set_custom_verify( + SSL_CTX *ctx, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { + ctx->verify_mode = mode; + ctx->custom_verify_callback = callback; +} + +void SSL_set_custom_verify( + SSL *ssl, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { + if (!ssl->config) { + return; + } + ssl->config->verify_mode = mode; + ssl->config->custom_verify_callback = callback; +} + +void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx) { + ctx->signed_cert_timestamps_enabled = true; +} + +void SSL_enable_signed_cert_timestamps(SSL *ssl) { + if (!ssl->config) { + return; + } + ssl->config->signed_cert_timestamps_enabled = true; +} + +void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx) { + ctx->ocsp_stapling_enabled = true; +} + +void SSL_enable_ocsp_stapling(SSL *ssl) { + if (!ssl->config) { + return; + } + ssl->config->ocsp_stapling_enabled = true; +} + +void SSL_get0_signed_cert_timestamp_list(const SSL *ssl, const uint8_t **out, + size_t *out_len) { + SSL_SESSION *session = SSL_get_session(ssl); + if (ssl->server || !session || !session->signed_cert_timestamp_list) { + *out_len = 0; + *out = NULL; + return; + } + + *out = CRYPTO_BUFFER_data(session->signed_cert_timestamp_list.get()); + *out_len = CRYPTO_BUFFER_len(session->signed_cert_timestamp_list.get()); +} + +void SSL_get0_ocsp_response(const SSL *ssl, const uint8_t **out, + size_t *out_len) { + SSL_SESSION *session = SSL_get_session(ssl); + if (ssl->server || !session || !session->ocsp_response) { + *out_len = 0; + *out = NULL; + return; + } + + *out = CRYPTO_BUFFER_data(session->ocsp_response.get()); + *out_len = CRYPTO_BUFFER_len(session->ocsp_response.get()); +} + +int SSL_set_tlsext_host_name(SSL *ssl, const char *name) { + ssl->hostname.reset(); + if (name == nullptr) { + return 1; + } + + size_t len = strlen(name); + if (len == 0 || len > TLSEXT_MAXLEN_host_name) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME); + return 0; + } + ssl->hostname.reset(OPENSSL_strdup(name)); + if (ssl->hostname == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + return 1; +} + +int SSL_CTX_set_tlsext_servername_callback( + SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)) { + ctx->servername_callback = callback; + return 1; +} + +int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg) { + ctx->servername_arg = arg; + return 1; +} + +int SSL_select_next_proto(uint8_t **out, uint8_t *out_len, const uint8_t *peer, + unsigned peer_len, const uint8_t *supported, + unsigned supported_len) { + const uint8_t *result; + int status; + + // For each protocol in peer preference order, see if we support it. + for (unsigned i = 0; i < peer_len;) { + for (unsigned j = 0; j < supported_len;) { + if (peer[i] == supported[j] && + OPENSSL_memcmp(&peer[i + 1], &supported[j + 1], peer[i]) == 0) { + // We found a match + result = &peer[i]; + status = OPENSSL_NPN_NEGOTIATED; + goto found; + } + j += supported[j]; + j++; + } + i += peer[i]; + i++; + } + + // There's no overlap between our protocols and the peer's list. + result = supported; + status = OPENSSL_NPN_NO_OVERLAP; + +found: + *out = (uint8_t *)result + 1; + *out_len = result[0]; + return status; +} + +void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data, + unsigned *out_len) { + *out_data = ssl->s3->next_proto_negotiated.data(); + *out_len = ssl->s3->next_proto_negotiated.size(); +} + +void SSL_CTX_set_next_protos_advertised_cb( + SSL_CTX *ctx, + int (*cb)(SSL *ssl, const uint8_t **out, unsigned *out_len, void *arg), + void *arg) { + ctx->next_protos_advertised_cb = cb; + ctx->next_protos_advertised_cb_arg = arg; +} + +void SSL_CTX_set_next_proto_select_cb( + SSL_CTX *ctx, int (*cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, void *arg), + void *arg) { + ctx->next_proto_select_cb = cb; + ctx->next_proto_select_cb_arg = arg; +} + +int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, + unsigned protos_len) { + // Note this function's calling convention is backwards. + return ctx->alpn_client_proto_list.CopyFrom(MakeConstSpan(protos, protos_len)) + ? 0 + : 1; +} + +int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, unsigned protos_len) { + // Note this function's calling convention is backwards. + if (!ssl->config) { + return 1; + } + return ssl->config->alpn_client_proto_list.CopyFrom( + MakeConstSpan(protos, protos_len)) + ? 0 + : 1; +} + +void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, const uint8_t **out, + uint8_t *out_len, const uint8_t *in, + unsigned in_len, void *arg), + void *arg) { + ctx->alpn_select_cb = cb; + ctx->alpn_select_cb_arg = arg; +} + +void SSL_get0_alpn_selected(const SSL *ssl, const uint8_t **out_data, + unsigned *out_len) { + if (SSL_in_early_data(ssl) && !ssl->server) { + *out_data = ssl->s3->hs->early_session->early_alpn.data(); + *out_len = ssl->s3->hs->early_session->early_alpn.size(); + } else { + *out_data = ssl->s3->alpn_selected.data(); + *out_len = ssl->s3->alpn_selected.size(); + } +} + +void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled) { + ctx->allow_unknown_alpn_protos = !!enabled; +} + +int SSL_CTX_add_cert_compression_alg(SSL_CTX *ctx, uint16_t alg_id, + ssl_cert_compression_func_t compress, + ssl_cert_decompression_func_t decompress) { + assert(compress != nullptr || decompress != nullptr); + + for (const auto &alg : ctx->cert_compression_algs) { + if (alg.alg_id == alg_id) { + return 0; + } + } + + CertCompressionAlg alg; + alg.alg_id = alg_id; + alg.compress = compress; + alg.decompress = decompress; + return ctx->cert_compression_algs.Push(alg); +} + +void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, int enabled) { + ctx->channel_id_enabled = !!enabled; +} + +int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx) { + SSL_CTX_set_tls_channel_id_enabled(ctx, 1); + return 1; +} + +void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled) { + if (!ssl->config) { + return; + } + ssl->config->channel_id_enabled = !!enabled; +} + +int SSL_enable_tls_channel_id(SSL *ssl) { + SSL_set_tls_channel_id_enabled(ssl, 1); + return 1; +} + +static int is_p256_key(EVP_PKEY *private_key) { + const EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(private_key); + return ec_key != NULL && + EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)) == + NID_X9_62_prime256v1; +} + +int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, EVP_PKEY *private_key) { + if (!is_p256_key(private_key)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); + return 0; + } + + ctx->channel_id_private = UpRef(private_key); + ctx->channel_id_enabled = true; + + return 1; +} + +int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key) { + if (!ssl->config) { + return 0; + } + if (!is_p256_key(private_key)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); + return 0; + } + + ssl->config->channel_id_private = UpRef(private_key); + ssl->config->channel_id_enabled = true; + + return 1; +} + +size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, size_t max_out) { + if (!ssl->s3->channel_id_valid) { + return 0; + } + OPENSSL_memcpy(out, ssl->s3->channel_id, (max_out < 64) ? max_out : 64); + return 64; +} + +int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, size_t len) { + if (!ssl->config) { + return 0; + } + if (len > 256) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + return ssl->config->token_binding_params.CopyFrom(MakeConstSpan(params, len)); +} + +int SSL_is_token_binding_negotiated(const SSL *ssl) { + return ssl->s3->token_binding_negotiated; +} + +uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl) { + return ssl->s3->negotiated_token_binding_param; +} + +size_t SSL_get0_certificate_types(const SSL *ssl, const uint8_t **out_types) { + Span types; + if (!ssl->server && ssl->s3->hs != nullptr) { + types = ssl->s3->hs->certificate_types; + } + *out_types = types.data(); + return types.size(); +} + +size_t SSL_get0_peer_verify_algorithms(const SSL *ssl, + const uint16_t **out_sigalgs) { + Span sigalgs; + if (ssl->s3->hs != nullptr) { + sigalgs = ssl->s3->hs->peer_sigalgs; + } + *out_sigalgs = sigalgs.data(); + return sigalgs.size(); +} + +EVP_PKEY *SSL_get_privatekey(const SSL *ssl) { + if (!ssl->config) { + assert(ssl->config); + return NULL; + } + if (ssl->config->cert != NULL) { + return ssl->config->cert->privatekey.get(); + } + + return NULL; +} + +EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx) { + if (ctx->cert != NULL) { + return ctx->cert->privatekey.get(); + } + + return NULL; +} + +const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl) { + const SSL_SESSION *session = SSL_get_session(ssl); + return session == nullptr ? nullptr : session->cipher; +} + +int SSL_session_reused(const SSL *ssl) { + return ssl->s3->session_reused || SSL_in_early_data(ssl); +} + +const COMP_METHOD *SSL_get_current_compression(SSL *ssl) { return NULL; } + +const COMP_METHOD *SSL_get_current_expansion(SSL *ssl) { return NULL; } + +int SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key) { return 0; } + +void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode) { + ctx->quiet_shutdown = (mode != 0); +} + +int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx) { + return ctx->quiet_shutdown; +} + +void SSL_set_quiet_shutdown(SSL *ssl, int mode) { + ssl->quiet_shutdown = (mode != 0); +} + +int SSL_get_quiet_shutdown(const SSL *ssl) { return ssl->quiet_shutdown; } + +void SSL_set_shutdown(SSL *ssl, int mode) { + // It is an error to clear any bits that have already been set. (We can't try + // to get a second close_notify or send two.) + assert((SSL_get_shutdown(ssl) & mode) == SSL_get_shutdown(ssl)); + + if (mode & SSL_RECEIVED_SHUTDOWN && + ssl->s3->read_shutdown == ssl_shutdown_none) { + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + } + + if (mode & SSL_SENT_SHUTDOWN && + ssl->s3->write_shutdown == ssl_shutdown_none) { + ssl->s3->write_shutdown = ssl_shutdown_close_notify; + } +} + +int SSL_get_shutdown(const SSL *ssl) { + int ret = 0; + if (ssl->s3->read_shutdown != ssl_shutdown_none) { + // Historically, OpenSSL set |SSL_RECEIVED_SHUTDOWN| on both close_notify + // and fatal alert. + ret |= SSL_RECEIVED_SHUTDOWN; + } + if (ssl->s3->write_shutdown == ssl_shutdown_close_notify) { + // Historically, OpenSSL set |SSL_SENT_SHUTDOWN| on only close_notify. + ret |= SSL_SENT_SHUTDOWN; + } + return ret; +} + +SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl) { return ssl->ctx.get(); } + +SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) { + if (!ssl->config) { + return NULL; + } + if (ssl->ctx.get() == ctx) { + return ssl->ctx.get(); + } + + // One cannot change the X.509 callbacks during a connection. + if (ssl->ctx->x509_method != ctx->x509_method) { + assert(0); + return NULL; + } + + UniquePtr new_cert = ssl_cert_dup(ctx->cert.get()); + if (!new_cert) { + return nullptr; + } + + ssl->config->cert = std::move(new_cert); + ssl->ctx = UpRef(ctx); + ssl->enable_early_data = ssl->ctx->enable_early_data; + + return ssl->ctx.get(); +} + +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl, int type, int value)) { + ssl->info_callback = cb; +} + +void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, + int value) { + return ssl->info_callback; +} + +int SSL_state(const SSL *ssl) { + return SSL_in_init(ssl) ? SSL_ST_INIT : SSL_ST_OK; +} + +void SSL_set_state(SSL *ssl, int state) { } + +char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len) { + if (len <= 0) { + return NULL; + } + buf[0] = '\0'; + return buf; +} + +int SSL_get_shared_sigalgs(SSL *ssl, int idx, int *psign, int *phash, + int *psignandhash, uint8_t *rsig, uint8_t *rhash) { + return 0; +} + +int SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method) { + if (ctx->method->is_dtls) { + return 0; + } + ctx->quic_method = quic_method; + return 1; +} + +int SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method) { + if (ssl->method->is_dtls) { + return 0; + } + ssl->quic_method = quic_method; + return 1; +} + +int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func) { + int index; + if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int SSL_set_ex_data(SSL *ssl, int idx, void *data) { + return CRYPTO_set_ex_data(&ssl->ex_data, idx, data); +} + +void *SSL_get_ex_data(const SSL *ssl, int idx) { + return CRYPTO_get_ex_data(&ssl->ex_data, idx); +} + +int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func) { + int index; + if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl_ctx, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data) { + return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); +} + +void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) { + return CRYPTO_get_ex_data(&ctx->ex_data, idx); +} + +int SSL_want(const SSL *ssl) { return ssl->s3->rwstate; } + +void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, + RSA *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +void SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, + DH *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +static int use_psk_identity_hint(UniquePtr *out, + const char *identity_hint) { + if (identity_hint != NULL && strlen(identity_hint) > PSK_MAX_IDENTITY_LEN) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + return 0; + } + + // Clear currently configured hint, if any. + out->reset(); + + // Treat the empty hint as not supplying one. Plain PSK makes it possible to + // send either no hint (omit ServerKeyExchange) or an empty hint, while + // ECDHE_PSK can only spell empty hint. Having different capabilities is odd, + // so we interpret empty and missing as identical. + if (identity_hint != NULL && identity_hint[0] != '\0') { + out->reset(OPENSSL_strdup(identity_hint)); + if (*out == nullptr) { + return 0; + } + } + + return 1; +} + +int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint) { + return use_psk_identity_hint(&ctx->psk_identity_hint, identity_hint); +} + +int SSL_use_psk_identity_hint(SSL *ssl, const char *identity_hint) { + if (!ssl->config) { + return 0; + } + return use_psk_identity_hint(&ssl->config->psk_identity_hint, identity_hint); +} + +const char *SSL_get_psk_identity_hint(const SSL *ssl) { + if (ssl == NULL) { + return NULL; + } + if (ssl->config == NULL) { + assert(ssl->config); + return NULL; + } + return ssl->config->psk_identity_hint.get(); +} + +const char *SSL_get_psk_identity(const SSL *ssl) { + if (ssl == NULL) { + return NULL; + } + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return NULL; + } + return session->psk_identity.get(); +} + +void SSL_set_psk_client_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len)) { + if (!ssl->config) { + return; + } + ssl->config->psk_client_callback = cb; +} + +void SSL_CTX_set_psk_client_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len)) { + ctx->psk_client_callback = cb; +} + +void SSL_set_psk_server_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)) { + if (!ssl->config) { + return; + } + ssl->config->psk_server_callback = cb; +} + +void SSL_CTX_set_psk_server_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, + uint8_t *psk, unsigned max_psk_len)) { + ctx->psk_server_callback = cb; +} + +void SSL_CTX_set_msg_callback(SSL_CTX *ctx, + void (*cb)(int write_p, int version, + int content_type, const void *buf, + size_t len, SSL *ssl, void *arg)) { + ctx->msg_callback = cb; +} + +void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg) { + ctx->msg_callback_arg = arg; +} + +void SSL_set_msg_callback(SSL *ssl, + void (*cb)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, + void *arg)) { + ssl->msg_callback = cb; +} + +void SSL_set_msg_callback_arg(SSL *ssl, void *arg) { + ssl->msg_callback_arg = arg; +} + +void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, + void (*cb)(const SSL *ssl, const char *line)) { + ctx->keylog_callback = cb; +} + +void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))(const SSL *ssl, + const char *line) { + return ctx->keylog_callback; +} + +void SSL_CTX_set_current_time_cb(SSL_CTX *ctx, + void (*cb)(const SSL *ssl, + struct timeval *out_clock)) { + ctx->current_time_cb = cb; +} + +int SSL_is_init_finished(const SSL *ssl) { + return !SSL_in_init(ssl); +} + +int SSL_in_init(const SSL *ssl) { + // This returns false once all the handshake state has been finalized, to + // allow callbacks and getters based on SSL_in_init to return the correct + // values. + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + return hs != nullptr && !hs->handshake_finalized; +} + +int SSL_in_false_start(const SSL *ssl) { + if (ssl->s3->hs == NULL) { + return 0; + } + return ssl->s3->hs->in_false_start; +} + +int SSL_cutthrough_complete(const SSL *ssl) { + return SSL_in_false_start(ssl); +} + +int SSL_is_server(const SSL *ssl) { return ssl->server; } + +int SSL_is_dtls(const SSL *ssl) { return ssl->method->is_dtls; } + +void SSL_CTX_set_select_certificate_cb( + SSL_CTX *ctx, + enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)) { + ctx->select_certificate_cb = cb; +} + +void SSL_CTX_set_dos_protection_cb(SSL_CTX *ctx, + int (*cb)(const SSL_CLIENT_HELLO *)) { + ctx->dos_protection_cb = cb; +} + +void SSL_CTX_set_reverify_on_resume(SSL_CTX *ctx, int enabled) { + ctx->reverify_on_resume = !!enabled; +} + +void SSL_set_enforce_rsa_key_usage(SSL *ssl, int enabled) { + if (!ssl->config) { + return; + } + ssl->config->enforce_rsa_key_usage = !!enabled; +} + +void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode) { + ssl->renegotiate_mode = mode; + + // Check if |ssl_can_renegotiate| has changed and the configuration may now be + // shed. HTTP clients may initially allow renegotiation for HTTP/1.1, and then + // disable after the handshake once the ALPN protocol is known to be HTTP/2. + ssl_maybe_shed_handshake_config(ssl); +} + +int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, + const uint8_t **out_write_iv, size_t *out_iv_len) { + size_t write_iv_len; + if (!ssl->s3->aead_read_ctx->GetIV(out_read_iv, out_iv_len) || + !ssl->s3->aead_write_ctx->GetIV(out_write_iv, &write_iv_len) || + *out_iv_len != write_iv_len) { + return 0; + } + + return 1; +} + +static uint64_t be_to_u64(const uint8_t in[8]) { + return (((uint64_t)in[0]) << 56) | (((uint64_t)in[1]) << 48) | + (((uint64_t)in[2]) << 40) | (((uint64_t)in[3]) << 32) | + (((uint64_t)in[4]) << 24) | (((uint64_t)in[5]) << 16) | + (((uint64_t)in[6]) << 8) | ((uint64_t)in[7]); +} + +uint64_t SSL_get_read_sequence(const SSL *ssl) { + // TODO(davidben): Internally represent sequence numbers as uint64_t. + if (SSL_is_dtls(ssl)) { + // max_seq_num already includes the epoch. + assert(ssl->d1->r_epoch == (ssl->d1->bitmap.max_seq_num >> 48)); + return ssl->d1->bitmap.max_seq_num; + } + return be_to_u64(ssl->s3->read_sequence); +} + +uint64_t SSL_get_write_sequence(const SSL *ssl) { + uint64_t ret = be_to_u64(ssl->s3->write_sequence); + if (SSL_is_dtls(ssl)) { + assert((ret >> 48) == 0); + ret |= ((uint64_t)ssl->d1->w_epoch) << 48; + } + return ret; +} + +uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl) { + // TODO(davidben): This checks the wrong session if there is a renegotiation + // in progress. + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return 0; + } + + return session->peer_signature_algorithm; +} + +size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, size_t max_out) { + if (max_out == 0) { + return sizeof(ssl->s3->client_random); + } + if (max_out > sizeof(ssl->s3->client_random)) { + max_out = sizeof(ssl->s3->client_random); + } + OPENSSL_memcpy(out, ssl->s3->client_random, max_out); + return max_out; +} + +size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, size_t max_out) { + if (max_out == 0) { + return sizeof(ssl->s3->server_random); + } + if (max_out > sizeof(ssl->s3->server_random)) { + max_out = sizeof(ssl->s3->server_random); + } + OPENSSL_memcpy(out, ssl->s3->server_random, max_out); + return max_out; +} + +const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl) { + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + if (hs == NULL) { + return NULL; + } + return hs->new_cipher; +} + +void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enabled) { + if (!ssl->config) { + return; + } + ssl->config->retain_only_sha256_of_client_certs = !!enabled; +} + +void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enabled) { + ctx->retain_only_sha256_of_client_certs = !!enabled; +} + +void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled) { + ctx->grease_enabled = !!enabled; +} + +int32_t SSL_get_ticket_age_skew(const SSL *ssl) { + return ssl->s3->ticket_age_skew; +} + +void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed) { + ctx->false_start_allowed_without_alpn = !!allowed; +} + +int SSL_is_tls13_downgrade(const SSL *ssl) { return ssl->s3->tls13_downgrade; } + +int SSL_used_hello_retry_request(const SSL *ssl) { + return ssl->s3->used_hello_retry_request; +} + +void SSL_CTX_set_ignore_tls13_downgrade(SSL_CTX *ctx, int ignore) { + ctx->ignore_tls13_downgrade = !!ignore; +} + +void SSL_set_ignore_tls13_downgrade(SSL *ssl, int ignore) { + if (!ssl->config) { + return; + } + ssl->config->ignore_tls13_downgrade = !!ignore; +} + +void SSL_set_shed_handshake_config(SSL *ssl, int enable) { + if (!ssl->config) { + return; + } + ssl->config->shed_handshake_config = !!enable; +} + +void SSL_set_jdk11_workaround(SSL *ssl, int enable) { + if (!ssl->config) { + return; + } + ssl->config->jdk11_workaround = !!enable; +} + +int SSL_clear(SSL *ssl) { + if (!ssl->config) { + return 0; // SSL_clear may not be used after shedding config. + } + + // In OpenSSL, reusing a client |SSL| with |SSL_clear| causes the previously + // established session to be offered the next time around. wpa_supplicant + // depends on this behavior, so emulate it. + UniquePtr session; + if (!ssl->server && ssl->s3->established_session != NULL) { + session = UpRef(ssl->s3->established_session); + } + + // The ssl->d1->mtu is simultaneously configuration (preserved across + // clear) and connection-specific state (gets reset). + // + // TODO(davidben): Avoid this. + unsigned mtu = 0; + if (ssl->d1 != NULL) { + mtu = ssl->d1->mtu; + } + + ssl->method->ssl_free(ssl); + if (!ssl->method->ssl_new(ssl)) { + return 0; + } + + if (SSL_is_dtls(ssl) && (SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { + ssl->d1->mtu = mtu; + } + + if (session != nullptr) { + SSL_set_session(ssl, session.get()); + } + + return 1; +} + +int SSL_CTX_sess_connect(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_connect_good(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_accept(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_accept_good(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_hits(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_misses(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_timeouts(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_cache_full(const SSL_CTX *ctx) { return 0; } + +int SSL_num_renegotiations(const SSL *ssl) { + return SSL_total_renegotiations(ssl); +} + +int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx) { return 0; } +int SSL_need_tmp_RSA(const SSL *ssl) { return 0; } +int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa) { return 1; } +int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa) { return 1; } +void ERR_load_SSL_strings(void) {} +void SSL_load_error_strings(void) {} +int SSL_cache_hit(SSL *ssl) { return SSL_session_reused(ssl); } + +int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key) { + if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); + return SSL_CTX_set1_curves(ctx, &nid, 1); +} + +int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key) { + if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); + return SSL_set1_curves(ssl, &nid, 1); +} + +void SSL_CTX_set_ticket_aead_method(SSL_CTX *ctx, + const SSL_TICKET_AEAD_METHOD *aead_method) { + ctx->ticket_aead_method = aead_method; +} + +int SSL_set_tlsext_status_type(SSL *ssl, int type) { + if (!ssl->config) { + return 0; + } + ssl->config->ocsp_stapling_enabled = type == TLSEXT_STATUSTYPE_ocsp; + return 1; +} + +int SSL_get_tlsext_status_type(const SSL *ssl) { + if (ssl->server) { + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + return hs != nullptr && hs->ocsp_stapling_requested + ? TLSEXT_STATUSTYPE_ocsp + : TLSEXT_STATUSTYPE_nothing; + } + + return ssl->config != nullptr && ssl->config->ocsp_stapling_enabled + ? TLSEXT_STATUSTYPE_ocsp + : TLSEXT_STATUSTYPE_nothing; +} + +int SSL_set_tlsext_status_ocsp_resp(SSL *ssl, uint8_t *resp, size_t resp_len) { + if (SSL_set_ocsp_response(ssl, resp, resp_len)) { + OPENSSL_free(resp); + return 1; + } + return 0; +} + +size_t SSL_get_tlsext_status_ocsp_resp(const SSL *ssl, const uint8_t **out) { + size_t ret; + SSL_get0_ocsp_response(ssl, out, &ret); + return ret; +} + +int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, + int (*callback)(SSL *ssl, void *arg)) { + ctx->legacy_ocsp_callback = callback; + return 1; +} + +int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg) { + ctx->legacy_ocsp_callback_arg = arg; + return 1; +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc.grpc_back new file mode 100644 index 000000000..4764000c1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_lib.cc.grpc_back @@ -0,0 +1,3010 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. + * ECC cipher suite support in OpenSSL originally developed by + * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. */ + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + +#if defined(OPENSSL_WINDOWS) +#include +#else +#include +#include +#endif + + +BSSL_NAMESPACE_BEGIN + +// |SSL_R_UNKNOWN_PROTOCOL| is no longer emitted, but continue to define it +// to avoid downstream churn. +OPENSSL_DECLARE_ERROR_REASON(SSL, UNKNOWN_PROTOCOL) + +// The following errors are no longer emitted, but are used in nginx without +// #ifdefs. +OPENSSL_DECLARE_ERROR_REASON(SSL, BLOCK_CIPHER_PAD_IS_WRONG) +OPENSSL_DECLARE_ERROR_REASON(SSL, NO_CIPHERS_SPECIFIED) + +// Some error codes are special. Ensure the make_errors.go script never +// regresses this. +static_assert(SSL_R_TLSV1_ALERT_NO_RENEGOTIATION == + SSL_AD_NO_RENEGOTIATION + SSL_AD_REASON_OFFSET, + "alert reason code mismatch"); + +// kMaxHandshakeSize is the maximum size, in bytes, of a handshake message. +static const size_t kMaxHandshakeSize = (1u << 24) - 1; + +static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl = + CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; +static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl_ctx = + CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; + +bool CBBFinishArray(CBB *cbb, Array *out) { + uint8_t *ptr; + size_t len; + if (!CBB_finish(cbb, &ptr, &len)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + out->Reset(ptr, len); + return true; +} + +void ssl_reset_error_state(SSL *ssl) { + // Functions which use |SSL_get_error| must reset I/O and error state on + // entry. + ssl->s3->rwstate = SSL_ERROR_NONE; + ERR_clear_error(); + ERR_clear_system_error(); +} + +void ssl_set_read_error(SSL* ssl) { + ssl->s3->read_shutdown = ssl_shutdown_error; + ssl->s3->read_error.reset(ERR_save_state()); +} + +static bool check_read_error(const SSL *ssl) { + if (ssl->s3->read_shutdown == ssl_shutdown_error) { + ERR_restore_state(ssl->s3->read_error.get()); + return false; + } + return true; +} + +bool ssl_can_write(const SSL *ssl) { + return !SSL_in_init(ssl) || ssl->s3->hs->can_early_write; +} + +bool ssl_can_read(const SSL *ssl) { + return !SSL_in_init(ssl) || ssl->s3->hs->can_early_read; +} + +ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, Span in) { + *out_consumed = 0; + if (!check_read_error(ssl)) { + *out_alert = 0; + return ssl_open_record_error; + } + auto ret = ssl->method->open_handshake(ssl, out_consumed, out_alert, in); + if (ret == ssl_open_record_error) { + ssl_set_read_error(ssl); + } + return ret; +} + +ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, + uint8_t *out_alert, + Span in) { + *out_consumed = 0; + if (!check_read_error(ssl)) { + *out_alert = 0; + return ssl_open_record_error; + } + auto ret = + ssl->method->open_change_cipher_spec(ssl, out_consumed, out_alert, in); + if (ret == ssl_open_record_error) { + ssl_set_read_error(ssl); + } + return ret; +} + +ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, + size_t *out_consumed, uint8_t *out_alert, + Span in) { + *out_consumed = 0; + if (!check_read_error(ssl)) { + *out_alert = 0; + return ssl_open_record_error; + } + auto ret = ssl->method->open_app_data(ssl, out, out_consumed, out_alert, in); + if (ret == ssl_open_record_error) { + ssl_set_read_error(ssl); + } + return ret; +} + +void ssl_update_cache(SSL_HANDSHAKE *hs, int mode) { + SSL *const ssl = hs->ssl; + SSL_CTX *ctx = ssl->session_ctx.get(); + // Never cache sessions with empty session IDs. + if (ssl->s3->established_session->session_id_length == 0 || + ssl->s3->established_session->not_resumable || + (ctx->session_cache_mode & mode) != mode) { + return; + } + + // Clients never use the internal session cache. + int use_internal_cache = ssl->server && !(ctx->session_cache_mode & + SSL_SESS_CACHE_NO_INTERNAL_STORE); + + // A client may see new sessions on abbreviated handshakes if the server + // decides to renew the ticket. Once the handshake is completed, it should be + // inserted into the cache. + if (ssl->s3->established_session.get() != ssl->session.get() || + (!ssl->server && hs->ticket_expected)) { + if (use_internal_cache) { + SSL_CTX_add_session(ctx, ssl->s3->established_session.get()); + } + if (ctx->new_session_cb != NULL) { + UniquePtr ref = UpRef(ssl->s3->established_session); + if (ctx->new_session_cb(ssl, ref.get())) { + // |new_session_cb|'s return value signals whether it took ownership. + ref.release(); + } + } + } + + if (use_internal_cache && + !(ctx->session_cache_mode & SSL_SESS_CACHE_NO_AUTO_CLEAR)) { + // Automatically flush the internal session cache every 255 connections. + int flush_cache = 0; + CRYPTO_MUTEX_lock_write(&ctx->lock); + ctx->handshakes_since_cache_flush++; + if (ctx->handshakes_since_cache_flush >= 255) { + flush_cache = 1; + ctx->handshakes_since_cache_flush = 0; + } + CRYPTO_MUTEX_unlock_write(&ctx->lock); + + if (flush_cache) { + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + SSL_CTX_flush_sessions(ctx, now.tv_sec); + } + } +} + +static bool cbb_add_hex(CBB *cbb, Span in) { + static const char hextable[] = "0123456789abcdef"; + uint8_t *out; + + if (!CBB_add_space(cbb, &out, in.size() * 2)) { + return false; + } + + for (uint8_t b : in) { + *(out++) = (uint8_t)hextable[b >> 4]; + *(out++) = (uint8_t)hextable[b & 0xf]; + } + + return true; +} + +bool ssl_log_secret(const SSL *ssl, const char *label, + Span secret) { + if (ssl->ctx->keylog_callback == NULL) { + return true; + } + + ScopedCBB cbb; + Array line; + if (!CBB_init(cbb.get(), strlen(label) + 1 + SSL3_RANDOM_SIZE * 2 + 1 + + secret.size() * 2 + 1) || + !CBB_add_bytes(cbb.get(), reinterpret_cast(label), + strlen(label)) || + !CBB_add_u8(cbb.get(), ' ') || + !cbb_add_hex(cbb.get(), ssl->s3->client_random) || + !CBB_add_u8(cbb.get(), ' ') || + !cbb_add_hex(cbb.get(), secret) || + !CBB_add_u8(cbb.get(), 0 /* NUL */) || + !CBBFinishArray(cbb.get(), &line)) { + return false; + } + + ssl->ctx->keylog_callback(ssl, reinterpret_cast(line.data())); + return true; +} + +void ssl_do_info_callback(const SSL *ssl, int type, int value) { + void (*cb)(const SSL *ssl, int type, int value) = NULL; + if (ssl->info_callback != NULL) { + cb = ssl->info_callback; + } else if (ssl->ctx->info_callback != NULL) { + cb = ssl->ctx->info_callback; + } + + if (cb != NULL) { + cb(ssl, type, value); + } +} + +void ssl_do_msg_callback(const SSL *ssl, int is_write, int content_type, + Span in) { + if (ssl->msg_callback == NULL) { + return; + } + + // |version| is zero when calling for |SSL3_RT_HEADER| and |SSL2_VERSION| for + // a V2ClientHello. + int version; + switch (content_type) { + case 0: + // V2ClientHello + version = SSL2_VERSION; + break; + case SSL3_RT_HEADER: + version = 0; + break; + default: + version = SSL_version(ssl); + } + + ssl->msg_callback(is_write, version, content_type, in.data(), in.size(), + const_cast(ssl), ssl->msg_callback_arg); +} + +void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock) { + // TODO(martinkr): Change callers to |ssl_ctx_get_current_time| and drop the + // |ssl| arg from |current_time_cb| if possible. + ssl_ctx_get_current_time(ssl->ctx.get(), out_clock); +} + +void ssl_ctx_get_current_time(const SSL_CTX *ctx, + struct OPENSSL_timeval *out_clock) { + if (ctx->current_time_cb != NULL) { + // TODO(davidben): Update current_time_cb to use OPENSSL_timeval. See + // https://crbug.com/boringssl/155. + struct timeval clock; + ctx->current_time_cb(nullptr /* ssl */, &clock); + if (clock.tv_sec < 0) { + assert(0); + out_clock->tv_sec = 0; + out_clock->tv_usec = 0; + } else { + out_clock->tv_sec = (uint64_t)clock.tv_sec; + out_clock->tv_usec = (uint32_t)clock.tv_usec; + } + return; + } + +#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) + out_clock->tv_sec = 1234; + out_clock->tv_usec = 1234; +#elif defined(OPENSSL_WINDOWS) + struct _timeb time; + _ftime(&time); + if (time.time < 0) { + assert(0); + out_clock->tv_sec = 0; + out_clock->tv_usec = 0; + } else { + out_clock->tv_sec = time.time; + out_clock->tv_usec = time.millitm * 1000; + } +#else + struct timeval clock; + gettimeofday(&clock, NULL); + if (clock.tv_sec < 0) { + assert(0); + out_clock->tv_sec = 0; + out_clock->tv_usec = 0; + } else { + out_clock->tv_sec = (uint64_t)clock.tv_sec; + out_clock->tv_usec = (uint32_t)clock.tv_usec; + } +#endif +} + +void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on) { + ctx->handoff = on; +} + +static bool ssl_can_renegotiate(const SSL *ssl) { + if (ssl->server || SSL_is_dtls(ssl)) { + return false; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return false; + } + + // The config has already been shed. + if (!ssl->config) { + return false; + } + + switch (ssl->renegotiate_mode) { + case ssl_renegotiate_ignore: + case ssl_renegotiate_never: + return false; + + case ssl_renegotiate_freely: + case ssl_renegotiate_explicit: + return true; + case ssl_renegotiate_once: + return ssl->s3->total_renegotiations == 0; + } + + assert(0); + return false; +} + +static void ssl_maybe_shed_handshake_config(SSL *ssl) { + if (ssl->s3->hs != nullptr || + ssl->config == nullptr || + !ssl->config->shed_handshake_config || + ssl_can_renegotiate(ssl)) { + return; + } + + ssl->config.reset(); +} + +void SSL_set_handoff_mode(SSL *ssl, bool on) { + if (!ssl->config) { + return; + } + ssl->config->handoff = on; +} + +bool SSL_get_traffic_secrets(const SSL *ssl, + Span *out_read_traffic_secret, + Span *out_write_traffic_secret) { + if (SSL_version(ssl) < TLS1_3_VERSION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); + return false; + } + + if (!ssl->s3->initial_handshake_complete) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); + return false; + } + + *out_read_traffic_secret = Span( + ssl->s3->read_traffic_secret, ssl->s3->read_traffic_secret_len); + *out_write_traffic_secret = Span( + ssl->s3->write_traffic_secret, ssl->s3->write_traffic_secret_len); + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_library_init(void) { + CRYPTO_library_init(); + return 1; +} + +int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { + CRYPTO_library_init(); + return 1; +} + +static uint32_t ssl_session_hash(const SSL_SESSION *sess) { + return ssl_hash_session_id( + MakeConstSpan(sess->session_id, sess->session_id_length)); +} + +static int ssl_session_cmp(const SSL_SESSION *a, const SSL_SESSION *b) { + if (a->session_id_length != b->session_id_length) { + return 1; + } + + return OPENSSL_memcmp(a->session_id, b->session_id, a->session_id_length); +} + +ssl_ctx_st::ssl_ctx_st(const SSL_METHOD *ssl_method) + : method(ssl_method->method), + x509_method(ssl_method->x509_method), + retain_only_sha256_of_client_certs(false), + quiet_shutdown(false), + ocsp_stapling_enabled(false), + signed_cert_timestamps_enabled(false), + channel_id_enabled(false), + grease_enabled(false), + allow_unknown_alpn_protos(false), + ed25519_enabled(false), + false_start_allowed_without_alpn(false), + ignore_tls13_downgrade(false), + handoff(false), + enable_early_data(false) { + CRYPTO_MUTEX_init(&lock); + CRYPTO_new_ex_data(&ex_data); +} + +ssl_ctx_st::~ssl_ctx_st() { + // Free the internal session cache. Note that this calls the caller-supplied + // remove callback, so we must do it before clearing ex_data. (See ticket + // [openssl.org #212].) + SSL_CTX_flush_sessions(this, 0); + + CRYPTO_free_ex_data(&g_ex_data_class_ssl_ctx, this, &ex_data); + + CRYPTO_MUTEX_cleanup(&lock); + lh_SSL_SESSION_free(sessions); + x509_method->ssl_ctx_free(this); +} + +SSL_CTX *SSL_CTX_new(const SSL_METHOD *method) { + if (method == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_METHOD_PASSED); + return nullptr; + } + + UniquePtr ret = MakeUnique(method); + if (!ret) { + return nullptr; + } + + ret->cert = MakeUnique(method->x509_method); + ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp); + ret->client_CA.reset(sk_CRYPTO_BUFFER_new_null()); + if (ret->cert == nullptr || + ret->sessions == nullptr || + ret->client_CA == nullptr || + !ret->x509_method->ssl_ctx_new(ret.get())) { + return nullptr; + } + + if (!SSL_CTX_set_strict_cipher_list(ret.get(), SSL_DEFAULT_CIPHER_LIST) || + // Lock the SSL_CTX to the specified version, for compatibility with + // legacy uses of SSL_METHOD. + !SSL_CTX_set_max_proto_version(ret.get(), method->version) || + !SSL_CTX_set_min_proto_version(ret.get(), method->version)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return nullptr; + } + + return ret.release(); +} + +int SSL_CTX_up_ref(SSL_CTX *ctx) { + CRYPTO_refcount_inc(&ctx->references); + return 1; +} + +void SSL_CTX_free(SSL_CTX *ctx) { + if (ctx == NULL || + !CRYPTO_refcount_dec_and_test_zero(&ctx->references)) { + return; + } + + ctx->~ssl_ctx_st(); + OPENSSL_free(ctx); +} + +ssl_st::ssl_st(SSL_CTX *ctx_arg) + : method(ctx_arg->method), + max_send_fragment(ctx_arg->max_send_fragment), + msg_callback(ctx_arg->msg_callback), + msg_callback_arg(ctx_arg->msg_callback_arg), + ctx(UpRef(ctx_arg)), + session_ctx(UpRef(ctx_arg)), + options(ctx->options), + mode(ctx->mode), + max_cert_list(ctx->max_cert_list), + server(false), + quiet_shutdown(ctx->quiet_shutdown), + enable_early_data(ctx->enable_early_data) { + CRYPTO_new_ex_data(&ex_data); +} + +ssl_st::~ssl_st() { + CRYPTO_free_ex_data(&g_ex_data_class_ssl, this, &ex_data); + // |config| refers to |this|, so we must release it earlier. + config.reset(); + if (method != NULL) { + method->ssl_free(this); + } +} + +SSL *SSL_new(SSL_CTX *ctx) { + if (ctx == nullptr) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_CTX); + return nullptr; + } + + UniquePtr ssl = MakeUnique(ctx); + if (ssl == nullptr) { + return nullptr; + } + + ssl->config = MakeUnique(ssl.get()); + if (ssl->config == nullptr) { + return nullptr; + } + ssl->config->conf_min_version = ctx->conf_min_version; + ssl->config->conf_max_version = ctx->conf_max_version; + + ssl->config->cert = ssl_cert_dup(ctx->cert.get()); + if (ssl->config->cert == nullptr) { + return nullptr; + } + + ssl->config->verify_mode = ctx->verify_mode; + ssl->config->verify_callback = ctx->default_verify_callback; + ssl->config->custom_verify_callback = ctx->custom_verify_callback; + ssl->config->retain_only_sha256_of_client_certs = + ctx->retain_only_sha256_of_client_certs; + + if (!ssl->config->supported_group_list.CopyFrom(ctx->supported_group_list) || + !ssl->config->alpn_client_proto_list.CopyFrom( + ctx->alpn_client_proto_list) || + !ssl->config->verify_sigalgs.CopyFrom(ctx->verify_sigalgs)) { + return nullptr; + } + + if (ctx->psk_identity_hint) { + ssl->config->psk_identity_hint.reset( + OPENSSL_strdup(ctx->psk_identity_hint.get())); + if (ssl->config->psk_identity_hint == nullptr) { + return nullptr; + } + } + ssl->config->psk_client_callback = ctx->psk_client_callback; + ssl->config->psk_server_callback = ctx->psk_server_callback; + + ssl->config->channel_id_enabled = ctx->channel_id_enabled; + ssl->config->channel_id_private = UpRef(ctx->channel_id_private); + + ssl->config->signed_cert_timestamps_enabled = + ctx->signed_cert_timestamps_enabled; + ssl->config->ocsp_stapling_enabled = ctx->ocsp_stapling_enabled; + ssl->config->handoff = ctx->handoff; + ssl->config->ignore_tls13_downgrade = ctx->ignore_tls13_downgrade; + ssl->quic_method = ctx->quic_method; + + if (!ssl->method->ssl_new(ssl.get()) || + !ssl->ctx->x509_method->ssl_new(ssl->s3->hs.get())) { + return nullptr; + } + + return ssl.release(); +} + +SSL_CONFIG::SSL_CONFIG(SSL *ssl_arg) + : ssl(ssl_arg), + signed_cert_timestamps_enabled(false), + ocsp_stapling_enabled(false), + channel_id_enabled(false), + enforce_rsa_key_usage(false), + retain_only_sha256_of_client_certs(false), + handoff(false), + shed_handshake_config(false), + ignore_tls13_downgrade(false), + jdk11_workaround(false) { + assert(ssl); +} + +SSL_CONFIG::~SSL_CONFIG() { + if (ssl->ctx != nullptr) { + ssl->ctx->x509_method->ssl_config_free(this); + } +} + +void SSL_free(SSL *ssl) { + Delete(ssl); +} + +void SSL_set_connect_state(SSL *ssl) { + ssl->server = false; + ssl->do_handshake = ssl_client_handshake; +} + +void SSL_set_accept_state(SSL *ssl) { + ssl->server = true; + ssl->do_handshake = ssl_server_handshake; +} + +void SSL_set0_rbio(SSL *ssl, BIO *rbio) { + ssl->rbio.reset(rbio); +} + +void SSL_set0_wbio(SSL *ssl, BIO *wbio) { + ssl->wbio.reset(wbio); +} + +void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio) { + // For historical reasons, this function has many different cases in ownership + // handling. + + // If nothing has changed, do nothing + if (rbio == SSL_get_rbio(ssl) && wbio == SSL_get_wbio(ssl)) { + return; + } + + // If the two arguments are equal, one fewer reference is granted than + // taken. + if (rbio != NULL && rbio == wbio) { + BIO_up_ref(rbio); + } + + // If only the wbio is changed, adopt only one reference. + if (rbio == SSL_get_rbio(ssl)) { + SSL_set0_wbio(ssl, wbio); + return; + } + + // There is an asymmetry here for historical reasons. If only the rbio is + // changed AND the rbio and wbio were originally different, then we only adopt + // one reference. + if (wbio == SSL_get_wbio(ssl) && SSL_get_rbio(ssl) != SSL_get_wbio(ssl)) { + SSL_set0_rbio(ssl, rbio); + return; + } + + // Otherwise, adopt both references. + SSL_set0_rbio(ssl, rbio); + SSL_set0_wbio(ssl, wbio); +} + +BIO *SSL_get_rbio(const SSL *ssl) { return ssl->rbio.get(); } + +BIO *SSL_get_wbio(const SSL *ssl) { return ssl->wbio.get(); } + +size_t SSL_quic_max_handshake_flight_len(const SSL *ssl, + enum ssl_encryption_level_t level) { + // Limits flights to 16K by default when there are no large + // (certificate-carrying) messages. + static const size_t kDefaultLimit = 16384; + + switch (level) { + case ssl_encryption_initial: + return kDefaultLimit; + case ssl_encryption_early_data: + // QUIC does not send EndOfEarlyData. + return 0; + case ssl_encryption_handshake: + if (ssl->server) { + // Servers may receive Certificate message if configured to request + // client certificates. + if (!!(ssl->config->verify_mode & SSL_VERIFY_PEER) && + ssl->max_cert_list > kDefaultLimit) { + return ssl->max_cert_list; + } + } else { + // Clients may receive both Certificate message and a CertificateRequest + // message. + if (2*ssl->max_cert_list > kDefaultLimit) { + return 2*ssl->max_cert_list; + } + } + return kDefaultLimit; + case ssl_encryption_application: + // Note there is not actually a bound on the number of NewSessionTickets + // one may send in a row. This level may need more involved flow + // control. See https://github.com/quicwg/base-drafts/issues/1834. + return kDefaultLimit; + } + + return 0; +} + +enum ssl_encryption_level_t SSL_quic_read_level(const SSL *ssl) { + return ssl->s3->read_level; +} + +enum ssl_encryption_level_t SSL_quic_write_level(const SSL *ssl) { + return ssl->s3->write_level; +} + +int SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level, + const uint8_t *data, size_t len) { + if (ssl->quic_method == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (level != ssl->s3->read_level) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED); + return 0; + } + + size_t new_len = (ssl->s3->hs_buf ? ssl->s3->hs_buf->length : 0) + len; + if (new_len < len || + new_len > SSL_quic_max_handshake_flight_len(ssl, level)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_EXCESSIVE_MESSAGE_SIZE); + return 0; + } + + return tls_append_handshake_data(ssl, MakeConstSpan(data, len)); +} + +int SSL_do_handshake(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_TYPE_NOT_SET); + return -1; + } + + if (!SSL_in_init(ssl)) { + return 1; + } + + // Run the handshake. + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + + bool early_return = false; + int ret = ssl_run_handshake(hs, &early_return); + ssl_do_info_callback( + ssl, ssl->server ? SSL_CB_ACCEPT_EXIT : SSL_CB_CONNECT_EXIT, ret); + if (ret <= 0) { + return ret; + } + + // Destroy the handshake object if the handshake has completely finished. + if (!early_return) { + ssl->s3->hs.reset(); + ssl_maybe_shed_handshake_config(ssl); + } + + return 1; +} + +int SSL_connect(SSL *ssl) { + if (ssl->do_handshake == NULL) { + // Not properly initialized yet + SSL_set_connect_state(ssl); + } + + return SSL_do_handshake(ssl); +} + +int SSL_accept(SSL *ssl) { + if (ssl->do_handshake == NULL) { + // Not properly initialized yet + SSL_set_accept_state(ssl); + } + + return SSL_do_handshake(ssl); +} + +static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) { + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return tls13_post_handshake(ssl, msg); + } + + // Check for renegotiation on the server before parsing to use the correct + // error. Renegotiation is triggered by a different message for servers. + if (ssl->server) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION); + return 0; + } + + if (msg.type != SSL3_MT_HELLO_REQUEST || CBS_len(&msg.body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HELLO_REQUEST); + return 0; + } + + if (ssl->renegotiate_mode == ssl_renegotiate_ignore) { + return 1; // Ignore the HelloRequest. + } + + ssl->s3->renegotiate_pending = true; + if (ssl->renegotiate_mode == ssl_renegotiate_explicit) { + return 1; // Handle it later. + } + + if (!SSL_renegotiate(ssl)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION); + return 0; + } + + return 1; +} + +int SSL_process_quic_post_handshake(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (SSL_in_init(ssl)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + // Replay post-handshake message errors. + if (!check_read_error(ssl)) { + return 0; + } + + // Process any buffered post-handshake messages. + SSLMessage msg; + while (ssl->method->get_message(ssl, &msg)) { + // Handle the post-handshake message and try again. + if (!ssl_do_post_handshake(ssl, msg)) { + ssl_set_read_error(ssl); + return 0; + } + ssl->method->next_message(ssl); + } + + return 1; +} + +static int ssl_read_impl(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return -1; + } + + // Replay post-handshake message errors. + if (!check_read_error(ssl)) { + return -1; + } + + while (ssl->s3->pending_app_data.empty()) { + if (ssl->s3->renegotiate_pending) { + ssl->s3->rwstate = SSL_ERROR_WANT_RENEGOTIATE; + return -1; + } + + // Complete the current handshake, if any. False Start will cause + // |SSL_do_handshake| to return mid-handshake, so this may require multiple + // iterations. + while (!ssl_can_read(ssl)) { + int ret = SSL_do_handshake(ssl); + if (ret < 0) { + return ret; + } + if (ret == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); + return -1; + } + } + + // Process any buffered post-handshake messages. + SSLMessage msg; + if (ssl->method->get_message(ssl, &msg)) { + // If we received an interrupt in early read (EndOfEarlyData), loop again + // for the handshake to process it. + if (SSL_in_init(ssl)) { + ssl->s3->hs->can_early_read = false; + continue; + } + + // Handle the post-handshake message and try again. + if (!ssl_do_post_handshake(ssl, msg)) { + ssl_set_read_error(ssl); + return -1; + } + ssl->method->next_message(ssl); + continue; // Loop again. We may have begun a new handshake. + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + size_t consumed = 0; + auto ret = ssl_open_app_data(ssl, &ssl->s3->pending_app_data, &consumed, + &alert, ssl->s3->read_buffer.span()); + bool retry; + int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert); + if (bio_ret <= 0) { + return bio_ret; + } + if (!retry) { + assert(!ssl->s3->pending_app_data.empty()); + ssl->s3->key_update_count = 0; + } + } + + return 1; +} + +int SSL_read(SSL *ssl, void *buf, int num) { + int ret = SSL_peek(ssl, buf, num); + if (ret <= 0) { + return ret; + } + // TODO(davidben): In DTLS, should the rest of the record be discarded? DTLS + // is not a stream. See https://crbug.com/boringssl/65. + ssl->s3->pending_app_data = + ssl->s3->pending_app_data.subspan(static_cast(ret)); + if (ssl->s3->pending_app_data.empty()) { + ssl->s3->read_buffer.DiscardConsumed(); + } + return ret; +} + +int SSL_peek(SSL *ssl, void *buf, int num) { + if (ssl->quic_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + int ret = ssl_read_impl(ssl); + if (ret <= 0) { + return ret; + } + if (num <= 0) { + return num; + } + size_t todo = + std::min(ssl->s3->pending_app_data.size(), static_cast(num)); + OPENSSL_memcpy(buf, ssl->s3->pending_app_data.data(), todo); + return static_cast(todo); +} + +int SSL_write(SSL *ssl, const void *buf, int num) { + ssl_reset_error_state(ssl); + + if (ssl->quic_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return -1; + } + + if (ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + + int ret = 0; + bool needs_handshake = false; + do { + // If necessary, complete the handshake implicitly. + if (!ssl_can_write(ssl)) { + ret = SSL_do_handshake(ssl); + if (ret < 0) { + return ret; + } + if (ret == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); + return -1; + } + } + + ret = ssl->method->write_app_data(ssl, &needs_handshake, + (const uint8_t *)buf, num); + } while (needs_handshake); + return ret; +} + +int SSL_key_update(SSL *ssl, int request_type) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return 0; + } + + if (ssl->ctx->quic_method != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (!ssl->s3->initial_handshake_complete) { + OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); + return 0; + } + + if (ssl_protocol_version(ssl) < TLS1_3_VERSION) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); + return 0; + } + + if (!ssl->s3->key_update_pending && + !tls13_add_key_update(ssl, request_type)) { + return 0; + } + + return 1; +} + +int SSL_shutdown(SSL *ssl) { + ssl_reset_error_state(ssl); + + if (ssl->do_handshake == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); + return -1; + } + + // If we are in the middle of a handshake, silently succeed. Consumers often + // call this function before |SSL_free|, whether the handshake succeeded or + // not. We assume the caller has already handled failed handshakes. + if (SSL_in_init(ssl)) { + return 1; + } + + if (ssl->quiet_shutdown) { + // Do nothing if configured not to send a close_notify. + ssl->s3->write_shutdown = ssl_shutdown_close_notify; + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + return 1; + } + + // This function completes in two stages. It sends a close_notify and then it + // waits for a close_notify to come in. Perform exactly one action and return + // whether or not it succeeds. + + if (ssl->s3->write_shutdown != ssl_shutdown_close_notify) { + // Send a close_notify. + if (ssl_send_alert_impl(ssl, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY) <= 0) { + return -1; + } + } else if (ssl->s3->alert_dispatch) { + // Finish sending the close_notify. + if (ssl->method->dispatch_alert(ssl) <= 0) { + return -1; + } + } else if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { + if (SSL_is_dtls(ssl)) { + // Bidirectional shutdown doesn't make sense for an unordered + // transport. DTLS alerts also aren't delivered reliably, so we may even + // time out because the peer never received our close_notify. Report to + // the caller that the channel has fully shut down. + if (ssl->s3->read_shutdown == ssl_shutdown_error) { + ERR_restore_state(ssl->s3->read_error.get()); + return -1; + } + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + } else { + // Process records until an error, close_notify, or application data. + if (ssl_read_impl(ssl) > 0) { + // We received some unexpected application data. + OPENSSL_PUT_ERROR(SSL, SSL_R_APPLICATION_DATA_ON_SHUTDOWN); + return -1; + } + if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { + return -1; + } + } + } + + // Return 0 for unidirectional shutdown and 1 for bidirectional shutdown. + return ssl->s3->read_shutdown == ssl_shutdown_close_notify; +} + +int SSL_send_fatal_alert(SSL *ssl, uint8_t alert) { + if (ssl->s3->alert_dispatch) { + if (ssl->s3->send_alert[0] != SSL3_AL_FATAL || + ssl->s3->send_alert[1] != alert) { + // We are already attempting to write a different alert. + OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); + return -1; + } + return ssl->method->dispatch_alert(ssl); + } + + return ssl_send_alert_impl(ssl, SSL3_AL_FATAL, alert); +} + +int SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params, + size_t params_len) { + return ssl->config && ssl->config->quic_transport_params.CopyFrom( + MakeConstSpan(params, params_len)); +} + +void SSL_get_peer_quic_transport_params(const SSL *ssl, + const uint8_t **out_params, + size_t *out_params_len) { + *out_params = ssl->s3->peer_quic_transport_params.data(); + *out_params_len = ssl->s3->peer_quic_transport_params.size(); +} + +void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled) { + ctx->enable_early_data = !!enabled; +} + +void SSL_set_early_data_enabled(SSL *ssl, int enabled) { + ssl->enable_early_data = !!enabled; +} + +int SSL_in_early_data(const SSL *ssl) { + if (ssl->s3->hs == NULL) { + return 0; + } + return ssl->s3->hs->in_early_data; +} + +int SSL_early_data_accepted(const SSL *ssl) { + return ssl->s3->early_data_accepted; +} + +void SSL_reset_early_data_reject(SSL *ssl) { + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + if (hs == NULL || + hs->wait != ssl_hs_early_data_rejected) { + abort(); + } + + hs->wait = ssl_hs_ok; + hs->in_early_data = false; + hs->early_session.reset(); + + // Discard any unfinished writes from the perspective of |SSL_write|'s + // retry. The handshake will transparently flush out the pending record + // (discarded by the server) to keep the framing correct. + ssl->s3->wpend_pending = false; +} + +enum ssl_early_data_reason_t SSL_get_early_data_reason(const SSL *ssl) { + return ssl->s3->early_data_reason; +} + +static int bio_retry_reason_to_error(int reason) { + switch (reason) { + case BIO_RR_CONNECT: + return SSL_ERROR_WANT_CONNECT; + case BIO_RR_ACCEPT: + return SSL_ERROR_WANT_ACCEPT; + default: + return SSL_ERROR_SYSCALL; + } +} + +int SSL_get_error(const SSL *ssl, int ret_code) { + if (ret_code > 0) { + return SSL_ERROR_NONE; + } + + // Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc, + // where we do encode the error + uint32_t err = ERR_peek_error(); + if (err != 0) { + if (ERR_GET_LIB(err) == ERR_LIB_SYS) { + return SSL_ERROR_SYSCALL; + } + return SSL_ERROR_SSL; + } + + if (ret_code == 0) { + if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { + return SSL_ERROR_ZERO_RETURN; + } + // An EOF was observed which violates the protocol, and the underlying + // transport does not participate in the error queue. Bubble up to the + // caller. + return SSL_ERROR_SYSCALL; + } + + switch (ssl->s3->rwstate) { + case SSL_ERROR_PENDING_SESSION: + case SSL_ERROR_PENDING_CERTIFICATE: + case SSL_ERROR_HANDOFF: + case SSL_ERROR_HANDBACK: + case SSL_ERROR_WANT_X509_LOOKUP: + case SSL_ERROR_WANT_CHANNEL_ID_LOOKUP: + case SSL_ERROR_WANT_PRIVATE_KEY_OPERATION: + case SSL_ERROR_PENDING_TICKET: + case SSL_ERROR_EARLY_DATA_REJECTED: + case SSL_ERROR_WANT_CERTIFICATE_VERIFY: + case SSL_ERROR_WANT_RENEGOTIATE: + return ssl->s3->rwstate; + + case SSL_ERROR_WANT_READ: { + if (ssl->quic_method) { + return SSL_ERROR_WANT_READ; + } + BIO *bio = SSL_get_rbio(ssl); + if (BIO_should_read(bio)) { + return SSL_ERROR_WANT_READ; + } + + if (BIO_should_write(bio)) { + // TODO(davidben): OpenSSL historically checked for writes on the read + // BIO. Can this be removed? + return SSL_ERROR_WANT_WRITE; + } + + if (BIO_should_io_special(bio)) { + return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); + } + + break; + } + + case SSL_ERROR_WANT_WRITE: { + BIO *bio = SSL_get_wbio(ssl); + if (BIO_should_write(bio)) { + return SSL_ERROR_WANT_WRITE; + } + + if (BIO_should_read(bio)) { + // TODO(davidben): OpenSSL historically checked for reads on the write + // BIO. Can this be removed? + return SSL_ERROR_WANT_READ; + } + + if (BIO_should_io_special(bio)) { + return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); + } + + break; + } + } + + return SSL_ERROR_SYSCALL; +} + +const char *SSL_error_description(int err) { + switch (err) { + case SSL_ERROR_NONE: + return "NONE"; + case SSL_ERROR_SSL: + return "SSL"; + case SSL_ERROR_WANT_READ: + return "WANT_READ"; + case SSL_ERROR_WANT_WRITE: + return "WANT_WRITE"; + case SSL_ERROR_WANT_X509_LOOKUP: + return "WANT_X509_LOOKUP"; + case SSL_ERROR_SYSCALL: + return "SYSCALL"; + case SSL_ERROR_ZERO_RETURN: + return "ZERO_RETURN"; + case SSL_ERROR_WANT_CONNECT: + return "WANT_CONNECT"; + case SSL_ERROR_WANT_ACCEPT: + return "WANT_ACCEPT"; + case SSL_ERROR_WANT_CHANNEL_ID_LOOKUP: + return "WANT_CHANNEL_ID_LOOKUP"; + case SSL_ERROR_PENDING_SESSION: + return "PENDING_SESSION"; + case SSL_ERROR_PENDING_CERTIFICATE: + return "PENDING_CERTIFICATE"; + case SSL_ERROR_WANT_PRIVATE_KEY_OPERATION: + return "WANT_PRIVATE_KEY_OPERATION"; + case SSL_ERROR_PENDING_TICKET: + return "PENDING_TICKET"; + case SSL_ERROR_EARLY_DATA_REJECTED: + return "EARLY_DATA_REJECTED"; + case SSL_ERROR_WANT_CERTIFICATE_VERIFY: + return "WANT_CERTIFICATE_VERIFY"; + case SSL_ERROR_HANDOFF: + return "HANDOFF"; + case SSL_ERROR_HANDBACK: + return "HANDBACK"; + default: + return nullptr; + } +} + +uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options) { + ctx->options |= options; + return ctx->options; +} + +uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options) { + ctx->options &= ~options; + return ctx->options; +} + +uint32_t SSL_CTX_get_options(const SSL_CTX *ctx) { return ctx->options; } + +uint32_t SSL_set_options(SSL *ssl, uint32_t options) { + ssl->options |= options; + return ssl->options; +} + +uint32_t SSL_clear_options(SSL *ssl, uint32_t options) { + ssl->options &= ~options; + return ssl->options; +} + +uint32_t SSL_get_options(const SSL *ssl) { return ssl->options; } + +uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode) { + ctx->mode |= mode; + return ctx->mode; +} + +uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode) { + ctx->mode &= ~mode; + return ctx->mode; +} + +uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx) { return ctx->mode; } + +uint32_t SSL_set_mode(SSL *ssl, uint32_t mode) { + ssl->mode |= mode; + return ssl->mode; +} + +uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode) { + ssl->mode &= ~mode; + return ssl->mode; +} + +uint32_t SSL_get_mode(const SSL *ssl) { return ssl->mode; } + +void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, CRYPTO_BUFFER_POOL *pool) { + ctx->pool = pool; +} + +int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out) { + *out_len = 0; + OPENSSL_memset(out, 0, max_out); + + // tls-unique is not defined for TLS 1.3. + if (!ssl->s3->initial_handshake_complete || + ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 0; + } + + // The tls-unique value is the first Finished message in the handshake, which + // is the client's in a full handshake and the server's for a resumption. See + // https://tools.ietf.org/html/rfc5929#section-3.1. + const uint8_t *finished = ssl->s3->previous_client_finished; + size_t finished_len = ssl->s3->previous_client_finished_len; + if (ssl->session != NULL) { + // tls-unique is broken for resumed sessions unless EMS is used. + if (!ssl->session->extended_master_secret) { + return 0; + } + finished = ssl->s3->previous_server_finished; + finished_len = ssl->s3->previous_server_finished_len; + } + + *out_len = finished_len; + if (finished_len > max_out) { + *out_len = max_out; + } + + OPENSSL_memcpy(out, finished, *out_len); + return 1; +} + +static int set_session_id_context(CERT *cert, const uint8_t *sid_ctx, + size_t sid_ctx_len) { + if (sid_ctx_len > sizeof(cert->sid_ctx)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); + return 0; + } + + static_assert(sizeof(cert->sid_ctx) < 256, "sid_ctx too large"); + cert->sid_ctx_length = (uint8_t)sid_ctx_len; + OPENSSL_memcpy(cert->sid_ctx, sid_ctx, sid_ctx_len); + return 1; +} + +int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const uint8_t *sid_ctx, + size_t sid_ctx_len) { + return set_session_id_context(ctx->cert.get(), sid_ctx, sid_ctx_len); +} + +int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, + size_t sid_ctx_len) { + if (!ssl->config) { + return 0; + } + return set_session_id_context(ssl->config->cert.get(), sid_ctx, sid_ctx_len); +} + +const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len) { + if (!ssl->config) { + assert(ssl->config); + *out_len = 0; + return NULL; + } + *out_len = ssl->config->cert->sid_ctx_length; + return ssl->config->cert->sid_ctx; +} + +void SSL_certs_clear(SSL *ssl) { + if (!ssl->config) { + return; + } + ssl_cert_clear_certs(ssl->config->cert.get()); +} + +int SSL_get_fd(const SSL *ssl) { return SSL_get_rfd(ssl); } + +int SSL_get_rfd(const SSL *ssl) { + int ret = -1; + BIO *b = BIO_find_type(SSL_get_rbio(ssl), BIO_TYPE_DESCRIPTOR); + if (b != NULL) { + BIO_get_fd(b, &ret); + } + return ret; +} + +int SSL_get_wfd(const SSL *ssl) { + int ret = -1; + BIO *b = BIO_find_type(SSL_get_wbio(ssl), BIO_TYPE_DESCRIPTOR); + if (b != NULL) { + BIO_get_fd(b, &ret); + } + return ret; +} + +int SSL_set_fd(SSL *ssl, int fd) { + BIO *bio = BIO_new(BIO_s_socket()); + if (bio == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + return 0; + } + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set_bio(ssl, bio, bio); + return 1; +} + +int SSL_set_wfd(SSL *ssl, int fd) { + BIO *rbio = SSL_get_rbio(ssl); + if (rbio == NULL || BIO_method_type(rbio) != BIO_TYPE_SOCKET || + BIO_get_fd(rbio, NULL) != fd) { + BIO *bio = BIO_new(BIO_s_socket()); + if (bio == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + return 0; + } + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set0_wbio(ssl, bio); + } else { + // Copy the rbio over to the wbio. + BIO_up_ref(rbio); + SSL_set0_wbio(ssl, rbio); + } + + return 1; +} + +int SSL_set_rfd(SSL *ssl, int fd) { + BIO *wbio = SSL_get_wbio(ssl); + if (wbio == NULL || BIO_method_type(wbio) != BIO_TYPE_SOCKET || + BIO_get_fd(wbio, NULL) != fd) { + BIO *bio = BIO_new(BIO_s_socket()); + if (bio == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); + return 0; + } + BIO_set_fd(bio, fd, BIO_NOCLOSE); + SSL_set0_rbio(ssl, bio); + } else { + // Copy the wbio over to the rbio. + BIO_up_ref(wbio); + SSL_set0_rbio(ssl, wbio); + } + return 1; +} + +static size_t copy_finished(void *out, size_t out_len, const uint8_t *in, + size_t in_len) { + if (out_len > in_len) { + out_len = in_len; + } + OPENSSL_memcpy(out, in, out_len); + return in_len; +} + +size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count) { + if (!ssl->s3->initial_handshake_complete || + ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 0; + } + + if (ssl->server) { + return copy_finished(buf, count, ssl->s3->previous_server_finished, + ssl->s3->previous_server_finished_len); + } + + return copy_finished(buf, count, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len); +} + +size_t SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count) { + if (!ssl->s3->initial_handshake_complete || + ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 0; + } + + if (ssl->server) { + return copy_finished(buf, count, ssl->s3->previous_client_finished, + ssl->s3->previous_client_finished_len); + } + + return copy_finished(buf, count, ssl->s3->previous_server_finished, + ssl->s3->previous_server_finished_len); +} + +int SSL_get_verify_mode(const SSL *ssl) { + if (!ssl->config) { + assert(ssl->config); + return -1; + } + return ssl->config->verify_mode; +} + +int SSL_get_extms_support(const SSL *ssl) { + // TLS 1.3 does not require extended master secret and always reports as + // supporting it. + if (!ssl->s3->have_version) { + return 0; + } + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + return 1; + } + + // If the initial handshake completed, query the established session. + if (ssl->s3->established_session != NULL) { + return ssl->s3->established_session->extended_master_secret; + } + + // Otherwise, query the in-progress handshake. + if (ssl->s3->hs != NULL) { + return ssl->s3->hs->extended_master_secret; + } + assert(0); + return 0; +} + +int SSL_CTX_get_read_ahead(const SSL_CTX *ctx) { return 0; } + +int SSL_get_read_ahead(const SSL *ssl) { return 0; } + +int SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) { return 1; } + +int SSL_set_read_ahead(SSL *ssl, int yes) { return 1; } + +int SSL_pending(const SSL *ssl) { + return static_cast(ssl->s3->pending_app_data.size()); +} + +int SSL_CTX_check_private_key(const SSL_CTX *ctx) { + return ssl_cert_check_private_key(ctx->cert.get(), + ctx->cert->privatekey.get()); +} + +int SSL_check_private_key(const SSL *ssl) { + if (!ssl->config) { + return 0; + } + return ssl_cert_check_private_key(ssl->config->cert.get(), + ssl->config->cert->privatekey.get()); +} + +long SSL_get_default_timeout(const SSL *ssl) { + return SSL_DEFAULT_SESSION_TIMEOUT; +} + +int SSL_renegotiate(SSL *ssl) { + // Caller-initiated renegotiation is not supported. + if (!ssl->s3->renegotiate_pending) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + if (!ssl_can_renegotiate(ssl)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + return 0; + } + + // Renegotiation is only supported at quiescent points in the application + // protocol, namely in HTTPS, just before reading the HTTP response. + // Require the record-layer be idle and avoid complexities of sending a + // handshake record while an application_data record is being written. + if (!ssl->s3->write_buffer.empty() || + ssl->s3->write_shutdown != ssl_shutdown_none) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); + return 0; + } + + // Begin a new handshake. + if (ssl->s3->hs != nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + ssl->s3->hs = ssl_handshake_new(ssl); + if (ssl->s3->hs == nullptr) { + return 0; + } + + ssl->s3->renegotiate_pending = false; + ssl->s3->total_renegotiations++; + return 1; +} + +int SSL_renegotiate_pending(SSL *ssl) { + return SSL_in_init(ssl) && ssl->s3->initial_handshake_complete; +} + +int SSL_total_renegotiations(const SSL *ssl) { + return ssl->s3->total_renegotiations; +} + +size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx) { + return ctx->max_cert_list; +} + +void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, size_t max_cert_list) { + if (max_cert_list > kMaxHandshakeSize) { + max_cert_list = kMaxHandshakeSize; + } + ctx->max_cert_list = (uint32_t)max_cert_list; +} + +size_t SSL_get_max_cert_list(const SSL *ssl) { + return ssl->max_cert_list; +} + +void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list) { + if (max_cert_list > kMaxHandshakeSize) { + max_cert_list = kMaxHandshakeSize; + } + ssl->max_cert_list = (uint32_t)max_cert_list; +} + +int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, size_t max_send_fragment) { + if (max_send_fragment < 512) { + max_send_fragment = 512; + } + if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { + max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; + } + ctx->max_send_fragment = (uint16_t)max_send_fragment; + + return 1; +} + +int SSL_set_max_send_fragment(SSL *ssl, size_t max_send_fragment) { + if (max_send_fragment < 512) { + max_send_fragment = 512; + } + if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { + max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; + } + ssl->max_send_fragment = (uint16_t)max_send_fragment; + + return 1; +} + +int SSL_set_mtu(SSL *ssl, unsigned mtu) { + if (!SSL_is_dtls(ssl) || mtu < dtls1_min_mtu()) { + return 0; + } + ssl->d1->mtu = mtu; + return 1; +} + +int SSL_get_secure_renegotiation_support(const SSL *ssl) { + if (!ssl->s3->have_version) { + return 0; + } + return ssl_protocol_version(ssl) >= TLS1_3_VERSION || + ssl->s3->send_connection_binding; +} + +size_t SSL_CTX_sess_number(const SSL_CTX *ctx) { + MutexReadLock lock(const_cast(&ctx->lock)); + return lh_SSL_SESSION_num_items(ctx->sessions); +} + +unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, unsigned long size) { + unsigned long ret = ctx->session_cache_size; + ctx->session_cache_size = size; + return ret; +} + +unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx) { + return ctx->session_cache_size; +} + +int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode) { + int ret = ctx->session_cache_mode; + ctx->session_cache_mode = mode; + return ret; +} + +int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx) { + return ctx->session_cache_mode; +} + + +int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, size_t len) { + if (out == NULL) { + return 48; + } + if (len != 48) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); + return 0; + } + + // The default ticket keys are initialized lazily. Trigger a key + // rotation to initialize them. + if (!ssl_ctx_rotate_ticket_encryption_key(ctx)) { + return 0; + } + + uint8_t *out_bytes = reinterpret_cast(out); + MutexReadLock lock(&ctx->lock); + OPENSSL_memcpy(out_bytes, ctx->ticket_key_current->name, 16); + OPENSSL_memcpy(out_bytes + 16, ctx->ticket_key_current->hmac_key, 16); + OPENSSL_memcpy(out_bytes + 32, ctx->ticket_key_current->aes_key, 16); + return 1; +} + +int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, size_t len) { + if (in == NULL) { + return 48; + } + if (len != 48) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); + return 0; + } + auto key = MakeUnique(); + if (!key) { + return 0; + } + const uint8_t *in_bytes = reinterpret_cast(in); + OPENSSL_memcpy(key->name, in_bytes, 16); + OPENSSL_memcpy(key->hmac_key, in_bytes + 16, 16); + OPENSSL_memcpy(key->aes_key, in_bytes + 32, 16); + // Disable automatic key rotation for manually-configured keys. This is now + // the caller's responsibility. + key->next_rotation_tv_sec = 0; + ctx->ticket_key_current = std::move(key); + ctx->ticket_key_prev.reset(); + return 1; +} + +int SSL_CTX_set_tlsext_ticket_key_cb( + SSL_CTX *ctx, int (*callback)(SSL *ssl, uint8_t *key_name, uint8_t *iv, + EVP_CIPHER_CTX *ctx, HMAC_CTX *hmac_ctx, + int encrypt)) { + ctx->ticket_key_cb = callback; + return 1; +} + +int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, size_t curves_len) { + return tls1_set_curves(&ctx->supported_group_list, + MakeConstSpan(curves, curves_len)); +} + +int SSL_set1_curves(SSL *ssl, const int *curves, size_t curves_len) { + if (!ssl->config) { + return 0; + } + return tls1_set_curves(&ssl->config->supported_group_list, + MakeConstSpan(curves, curves_len)); +} + +int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves) { + return tls1_set_curves_list(&ctx->supported_group_list, curves); +} + +int SSL_set1_curves_list(SSL *ssl, const char *curves) { + if (!ssl->config) { + return 0; + } + return tls1_set_curves_list(&ssl->config->supported_group_list, curves); +} + +uint16_t SSL_get_curve_id(const SSL *ssl) { + // TODO(davidben): This checks the wrong session if there is a renegotiation + // in progress. + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return 0; + } + + return session->group_id; +} + +int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh) { + return 1; +} + +int SSL_set_tmp_dh(SSL *ssl, const DH *dh) { + return 1; +} + +STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) { + return ctx->cipher_list->ciphers.get(); +} + +int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i) { + if (i >= sk_SSL_CIPHER_num(ctx->cipher_list->ciphers.get())) { + return 0; + } + return ctx->cipher_list->in_group_flags[i]; +} + +STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl) { + if (ssl == NULL) { + return NULL; + } + if (ssl->config == NULL) { + assert(ssl->config); + return NULL; + } + + return ssl->config->cipher_list ? ssl->config->cipher_list->ciphers.get() + : ssl->ctx->cipher_list->ciphers.get(); +} + +const char *SSL_get_cipher_list(const SSL *ssl, int n) { + if (ssl == NULL) { + return NULL; + } + + STACK_OF(SSL_CIPHER) *sk = SSL_get_ciphers(ssl); + if (sk == NULL || n < 0 || (size_t)n >= sk_SSL_CIPHER_num(sk)) { + return NULL; + } + + const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, n); + if (c == NULL) { + return NULL; + } + + return c->name; +} + +int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) { + return ssl_create_cipher_list(&ctx->cipher_list, str, false /* not strict */); +} + +int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, const char *str) { + return ssl_create_cipher_list(&ctx->cipher_list, str, true /* strict */); +} + +int SSL_set_cipher_list(SSL *ssl, const char *str) { + if (!ssl->config) { + return 0; + } + return ssl_create_cipher_list(&ssl->config->cipher_list, str, + false /* not strict */); +} + +int SSL_set_strict_cipher_list(SSL *ssl, const char *str) { + if (!ssl->config) { + return 0; + } + return ssl_create_cipher_list(&ssl->config->cipher_list, str, + true /* strict */); +} + +const char *SSL_get_servername(const SSL *ssl, const int type) { + if (type != TLSEXT_NAMETYPE_host_name) { + return NULL; + } + + // Historically, |SSL_get_servername| was also the configuration getter + // corresponding to |SSL_set_tlsext_host_name|. + if (ssl->hostname != nullptr) { + return ssl->hostname.get(); + } + + return ssl->s3->hostname.get(); +} + +int SSL_get_servername_type(const SSL *ssl) { + if (SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name) == NULL) { + return -1; + } + return TLSEXT_NAMETYPE_host_name; +} + +void SSL_CTX_set_custom_verify( + SSL_CTX *ctx, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { + ctx->verify_mode = mode; + ctx->custom_verify_callback = callback; +} + +void SSL_set_custom_verify( + SSL *ssl, int mode, + enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { + if (!ssl->config) { + return; + } + ssl->config->verify_mode = mode; + ssl->config->custom_verify_callback = callback; +} + +void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx) { + ctx->signed_cert_timestamps_enabled = true; +} + +void SSL_enable_signed_cert_timestamps(SSL *ssl) { + if (!ssl->config) { + return; + } + ssl->config->signed_cert_timestamps_enabled = true; +} + +void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx) { + ctx->ocsp_stapling_enabled = true; +} + +void SSL_enable_ocsp_stapling(SSL *ssl) { + if (!ssl->config) { + return; + } + ssl->config->ocsp_stapling_enabled = true; +} + +void SSL_get0_signed_cert_timestamp_list(const SSL *ssl, const uint8_t **out, + size_t *out_len) { + SSL_SESSION *session = SSL_get_session(ssl); + if (ssl->server || !session || !session->signed_cert_timestamp_list) { + *out_len = 0; + *out = NULL; + return; + } + + *out = CRYPTO_BUFFER_data(session->signed_cert_timestamp_list.get()); + *out_len = CRYPTO_BUFFER_len(session->signed_cert_timestamp_list.get()); +} + +void SSL_get0_ocsp_response(const SSL *ssl, const uint8_t **out, + size_t *out_len) { + SSL_SESSION *session = SSL_get_session(ssl); + if (ssl->server || !session || !session->ocsp_response) { + *out_len = 0; + *out = NULL; + return; + } + + *out = CRYPTO_BUFFER_data(session->ocsp_response.get()); + *out_len = CRYPTO_BUFFER_len(session->ocsp_response.get()); +} + +int SSL_set_tlsext_host_name(SSL *ssl, const char *name) { + ssl->hostname.reset(); + if (name == nullptr) { + return 1; + } + + size_t len = strlen(name); + if (len == 0 || len > TLSEXT_MAXLEN_host_name) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME); + return 0; + } + ssl->hostname.reset(OPENSSL_strdup(name)); + if (ssl->hostname == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return 0; + } + return 1; +} + +int SSL_CTX_set_tlsext_servername_callback( + SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)) { + ctx->servername_callback = callback; + return 1; +} + +int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg) { + ctx->servername_arg = arg; + return 1; +} + +int SSL_select_next_proto(uint8_t **out, uint8_t *out_len, const uint8_t *peer, + unsigned peer_len, const uint8_t *supported, + unsigned supported_len) { + const uint8_t *result; + int status; + + // For each protocol in peer preference order, see if we support it. + for (unsigned i = 0; i < peer_len;) { + for (unsigned j = 0; j < supported_len;) { + if (peer[i] == supported[j] && + OPENSSL_memcmp(&peer[i + 1], &supported[j + 1], peer[i]) == 0) { + // We found a match + result = &peer[i]; + status = OPENSSL_NPN_NEGOTIATED; + goto found; + } + j += supported[j]; + j++; + } + i += peer[i]; + i++; + } + + // There's no overlap between our protocols and the peer's list. + result = supported; + status = OPENSSL_NPN_NO_OVERLAP; + +found: + *out = (uint8_t *)result + 1; + *out_len = result[0]; + return status; +} + +void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data, + unsigned *out_len) { + *out_data = ssl->s3->next_proto_negotiated.data(); + *out_len = ssl->s3->next_proto_negotiated.size(); +} + +void SSL_CTX_set_next_protos_advertised_cb( + SSL_CTX *ctx, + int (*cb)(SSL *ssl, const uint8_t **out, unsigned *out_len, void *arg), + void *arg) { + ctx->next_protos_advertised_cb = cb; + ctx->next_protos_advertised_cb_arg = arg; +} + +void SSL_CTX_set_next_proto_select_cb( + SSL_CTX *ctx, int (*cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, + const uint8_t *in, unsigned in_len, void *arg), + void *arg) { + ctx->next_proto_select_cb = cb; + ctx->next_proto_select_cb_arg = arg; +} + +int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, + unsigned protos_len) { + // Note this function's calling convention is backwards. + return ctx->alpn_client_proto_list.CopyFrom(MakeConstSpan(protos, protos_len)) + ? 0 + : 1; +} + +int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, unsigned protos_len) { + // Note this function's calling convention is backwards. + if (!ssl->config) { + return 1; + } + return ssl->config->alpn_client_proto_list.CopyFrom( + MakeConstSpan(protos, protos_len)) + ? 0 + : 1; +} + +void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, + int (*cb)(SSL *ssl, const uint8_t **out, + uint8_t *out_len, const uint8_t *in, + unsigned in_len, void *arg), + void *arg) { + ctx->alpn_select_cb = cb; + ctx->alpn_select_cb_arg = arg; +} + +void SSL_get0_alpn_selected(const SSL *ssl, const uint8_t **out_data, + unsigned *out_len) { + if (SSL_in_early_data(ssl) && !ssl->server) { + *out_data = ssl->s3->hs->early_session->early_alpn.data(); + *out_len = ssl->s3->hs->early_session->early_alpn.size(); + } else { + *out_data = ssl->s3->alpn_selected.data(); + *out_len = ssl->s3->alpn_selected.size(); + } +} + +void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled) { + ctx->allow_unknown_alpn_protos = !!enabled; +} + +int SSL_CTX_add_cert_compression_alg(SSL_CTX *ctx, uint16_t alg_id, + ssl_cert_compression_func_t compress, + ssl_cert_decompression_func_t decompress) { + assert(compress != nullptr || decompress != nullptr); + + for (const auto &alg : ctx->cert_compression_algs) { + if (alg.alg_id == alg_id) { + return 0; + } + } + + CertCompressionAlg alg; + alg.alg_id = alg_id; + alg.compress = compress; + alg.decompress = decompress; + return ctx->cert_compression_algs.Push(alg); +} + +void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, int enabled) { + ctx->channel_id_enabled = !!enabled; +} + +int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx) { + SSL_CTX_set_tls_channel_id_enabled(ctx, 1); + return 1; +} + +void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled) { + if (!ssl->config) { + return; + } + ssl->config->channel_id_enabled = !!enabled; +} + +int SSL_enable_tls_channel_id(SSL *ssl) { + SSL_set_tls_channel_id_enabled(ssl, 1); + return 1; +} + +static int is_p256_key(EVP_PKEY *private_key) { + const EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(private_key); + return ec_key != NULL && + EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)) == + NID_X9_62_prime256v1; +} + +int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, EVP_PKEY *private_key) { + if (!is_p256_key(private_key)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); + return 0; + } + + ctx->channel_id_private = UpRef(private_key); + ctx->channel_id_enabled = true; + + return 1; +} + +int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key) { + if (!ssl->config) { + return 0; + } + if (!is_p256_key(private_key)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); + return 0; + } + + ssl->config->channel_id_private = UpRef(private_key); + ssl->config->channel_id_enabled = true; + + return 1; +} + +size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, size_t max_out) { + if (!ssl->s3->channel_id_valid) { + return 0; + } + OPENSSL_memcpy(out, ssl->s3->channel_id, (max_out < 64) ? max_out : 64); + return 64; +} + +int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, size_t len) { + if (!ssl->config) { + return 0; + } + if (len > 256) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + return ssl->config->token_binding_params.CopyFrom(MakeConstSpan(params, len)); +} + +int SSL_is_token_binding_negotiated(const SSL *ssl) { + return ssl->s3->token_binding_negotiated; +} + +uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl) { + return ssl->s3->negotiated_token_binding_param; +} + +size_t SSL_get0_certificate_types(const SSL *ssl, const uint8_t **out_types) { + Span types; + if (!ssl->server && ssl->s3->hs != nullptr) { + types = ssl->s3->hs->certificate_types; + } + *out_types = types.data(); + return types.size(); +} + +size_t SSL_get0_peer_verify_algorithms(const SSL *ssl, + const uint16_t **out_sigalgs) { + Span sigalgs; + if (ssl->s3->hs != nullptr) { + sigalgs = ssl->s3->hs->peer_sigalgs; + } + *out_sigalgs = sigalgs.data(); + return sigalgs.size(); +} + +EVP_PKEY *SSL_get_privatekey(const SSL *ssl) { + if (!ssl->config) { + assert(ssl->config); + return NULL; + } + if (ssl->config->cert != NULL) { + return ssl->config->cert->privatekey.get(); + } + + return NULL; +} + +EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx) { + if (ctx->cert != NULL) { + return ctx->cert->privatekey.get(); + } + + return NULL; +} + +const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl) { + const SSL_SESSION *session = SSL_get_session(ssl); + return session == nullptr ? nullptr : session->cipher; +} + +int SSL_session_reused(const SSL *ssl) { + return ssl->s3->session_reused || SSL_in_early_data(ssl); +} + +const COMP_METHOD *SSL_get_current_compression(SSL *ssl) { return NULL; } + +const COMP_METHOD *SSL_get_current_expansion(SSL *ssl) { return NULL; } + +int SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key) { return 0; } + +void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode) { + ctx->quiet_shutdown = (mode != 0); +} + +int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx) { + return ctx->quiet_shutdown; +} + +void SSL_set_quiet_shutdown(SSL *ssl, int mode) { + ssl->quiet_shutdown = (mode != 0); +} + +int SSL_get_quiet_shutdown(const SSL *ssl) { return ssl->quiet_shutdown; } + +void SSL_set_shutdown(SSL *ssl, int mode) { + // It is an error to clear any bits that have already been set. (We can't try + // to get a second close_notify or send two.) + assert((SSL_get_shutdown(ssl) & mode) == SSL_get_shutdown(ssl)); + + if (mode & SSL_RECEIVED_SHUTDOWN && + ssl->s3->read_shutdown == ssl_shutdown_none) { + ssl->s3->read_shutdown = ssl_shutdown_close_notify; + } + + if (mode & SSL_SENT_SHUTDOWN && + ssl->s3->write_shutdown == ssl_shutdown_none) { + ssl->s3->write_shutdown = ssl_shutdown_close_notify; + } +} + +int SSL_get_shutdown(const SSL *ssl) { + int ret = 0; + if (ssl->s3->read_shutdown != ssl_shutdown_none) { + // Historically, OpenSSL set |SSL_RECEIVED_SHUTDOWN| on both close_notify + // and fatal alert. + ret |= SSL_RECEIVED_SHUTDOWN; + } + if (ssl->s3->write_shutdown == ssl_shutdown_close_notify) { + // Historically, OpenSSL set |SSL_SENT_SHUTDOWN| on only close_notify. + ret |= SSL_SENT_SHUTDOWN; + } + return ret; +} + +SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl) { return ssl->ctx.get(); } + +SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) { + if (!ssl->config) { + return NULL; + } + if (ssl->ctx.get() == ctx) { + return ssl->ctx.get(); + } + + // One cannot change the X.509 callbacks during a connection. + if (ssl->ctx->x509_method != ctx->x509_method) { + assert(0); + return NULL; + } + + UniquePtr new_cert = ssl_cert_dup(ctx->cert.get()); + if (!new_cert) { + return nullptr; + } + + ssl->config->cert = std::move(new_cert); + ssl->ctx = UpRef(ctx); + ssl->enable_early_data = ssl->ctx->enable_early_data; + + return ssl->ctx.get(); +} + +void SSL_set_info_callback(SSL *ssl, + void (*cb)(const SSL *ssl, int type, int value)) { + ssl->info_callback = cb; +} + +void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, + int value) { + return ssl->info_callback; +} + +int SSL_state(const SSL *ssl) { + return SSL_in_init(ssl) ? SSL_ST_INIT : SSL_ST_OK; +} + +void SSL_set_state(SSL *ssl, int state) { } + +char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len) { + if (len <= 0) { + return NULL; + } + buf[0] = '\0'; + return buf; +} + +int SSL_get_shared_sigalgs(SSL *ssl, int idx, int *psign, int *phash, + int *psignandhash, uint8_t *rsig, uint8_t *rhash) { + return 0; +} + +int SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method) { + if (ctx->method->is_dtls) { + return 0; + } + ctx->quic_method = quic_method; + return 1; +} + +int SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method) { + if (ssl->method->is_dtls) { + return 0; + } + ssl->quic_method = quic_method; + return 1; +} + +int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func) { + int index; + if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int SSL_set_ex_data(SSL *ssl, int idx, void *data) { + return CRYPTO_set_ex_data(&ssl->ex_data, idx, data); +} + +void *SSL_get_ex_data(const SSL *ssl, int idx) { + return CRYPTO_get_ex_data(&ssl->ex_data, idx); +} + +int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, + CRYPTO_EX_dup *dup_unused, + CRYPTO_EX_free *free_func) { + int index; + if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl_ctx, &index, argl, argp, + free_func)) { + return -1; + } + return index; +} + +int SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data) { + return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); +} + +void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) { + return CRYPTO_get_ex_data(&ctx->ex_data, idx); +} + +int SSL_want(const SSL *ssl) { return ssl->s3->rwstate; } + +void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, + RSA *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +void SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, + DH *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, + int keylength)) {} + +static int use_psk_identity_hint(UniquePtr *out, + const char *identity_hint) { + if (identity_hint != NULL && strlen(identity_hint) > PSK_MAX_IDENTITY_LEN) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); + return 0; + } + + // Clear currently configured hint, if any. + out->reset(); + + // Treat the empty hint as not supplying one. Plain PSK makes it possible to + // send either no hint (omit ServerKeyExchange) or an empty hint, while + // ECDHE_PSK can only spell empty hint. Having different capabilities is odd, + // so we interpret empty and missing as identical. + if (identity_hint != NULL && identity_hint[0] != '\0') { + out->reset(OPENSSL_strdup(identity_hint)); + if (*out == nullptr) { + return 0; + } + } + + return 1; +} + +int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint) { + return use_psk_identity_hint(&ctx->psk_identity_hint, identity_hint); +} + +int SSL_use_psk_identity_hint(SSL *ssl, const char *identity_hint) { + if (!ssl->config) { + return 0; + } + return use_psk_identity_hint(&ssl->config->psk_identity_hint, identity_hint); +} + +const char *SSL_get_psk_identity_hint(const SSL *ssl) { + if (ssl == NULL) { + return NULL; + } + if (ssl->config == NULL) { + assert(ssl->config); + return NULL; + } + return ssl->config->psk_identity_hint.get(); +} + +const char *SSL_get_psk_identity(const SSL *ssl) { + if (ssl == NULL) { + return NULL; + } + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return NULL; + } + return session->psk_identity.get(); +} + +void SSL_set_psk_client_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len)) { + if (!ssl->config) { + return; + } + ssl->config->psk_client_callback = cb; +} + +void SSL_CTX_set_psk_client_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, + unsigned max_identity_len, uint8_t *psk, + unsigned max_psk_len)) { + ctx->psk_client_callback = cb; +} + +void SSL_set_psk_server_callback( + SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, + unsigned max_psk_len)) { + if (!ssl->config) { + return; + } + ssl->config->psk_server_callback = cb; +} + +void SSL_CTX_set_psk_server_callback( + SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, + uint8_t *psk, unsigned max_psk_len)) { + ctx->psk_server_callback = cb; +} + +void SSL_CTX_set_msg_callback(SSL_CTX *ctx, + void (*cb)(int write_p, int version, + int content_type, const void *buf, + size_t len, SSL *ssl, void *arg)) { + ctx->msg_callback = cb; +} + +void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg) { + ctx->msg_callback_arg = arg; +} + +void SSL_set_msg_callback(SSL *ssl, + void (*cb)(int write_p, int version, int content_type, + const void *buf, size_t len, SSL *ssl, + void *arg)) { + ssl->msg_callback = cb; +} + +void SSL_set_msg_callback_arg(SSL *ssl, void *arg) { + ssl->msg_callback_arg = arg; +} + +void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, + void (*cb)(const SSL *ssl, const char *line)) { + ctx->keylog_callback = cb; +} + +void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))(const SSL *ssl, + const char *line) { + return ctx->keylog_callback; +} + +void SSL_CTX_set_current_time_cb(SSL_CTX *ctx, + void (*cb)(const SSL *ssl, + struct timeval *out_clock)) { + ctx->current_time_cb = cb; +} + +int SSL_is_init_finished(const SSL *ssl) { + return !SSL_in_init(ssl); +} + +int SSL_in_init(const SSL *ssl) { + // This returns false once all the handshake state has been finalized, to + // allow callbacks and getters based on SSL_in_init to return the correct + // values. + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + return hs != nullptr && !hs->handshake_finalized; +} + +int SSL_in_false_start(const SSL *ssl) { + if (ssl->s3->hs == NULL) { + return 0; + } + return ssl->s3->hs->in_false_start; +} + +int SSL_cutthrough_complete(const SSL *ssl) { + return SSL_in_false_start(ssl); +} + +int SSL_is_server(const SSL *ssl) { return ssl->server; } + +int SSL_is_dtls(const SSL *ssl) { return ssl->method->is_dtls; } + +void SSL_CTX_set_select_certificate_cb( + SSL_CTX *ctx, + enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)) { + ctx->select_certificate_cb = cb; +} + +void SSL_CTX_set_dos_protection_cb(SSL_CTX *ctx, + int (*cb)(const SSL_CLIENT_HELLO *)) { + ctx->dos_protection_cb = cb; +} + +void SSL_CTX_set_reverify_on_resume(SSL_CTX *ctx, int enabled) { + ctx->reverify_on_resume = !!enabled; +} + +void SSL_set_enforce_rsa_key_usage(SSL *ssl, int enabled) { + if (!ssl->config) { + return; + } + ssl->config->enforce_rsa_key_usage = !!enabled; +} + +void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode) { + ssl->renegotiate_mode = mode; + + // Check if |ssl_can_renegotiate| has changed and the configuration may now be + // shed. HTTP clients may initially allow renegotiation for HTTP/1.1, and then + // disable after the handshake once the ALPN protocol is known to be HTTP/2. + ssl_maybe_shed_handshake_config(ssl); +} + +int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, + const uint8_t **out_write_iv, size_t *out_iv_len) { + size_t write_iv_len; + if (!ssl->s3->aead_read_ctx->GetIV(out_read_iv, out_iv_len) || + !ssl->s3->aead_write_ctx->GetIV(out_write_iv, &write_iv_len) || + *out_iv_len != write_iv_len) { + return 0; + } + + return 1; +} + +static uint64_t be_to_u64(const uint8_t in[8]) { + return (((uint64_t)in[0]) << 56) | (((uint64_t)in[1]) << 48) | + (((uint64_t)in[2]) << 40) | (((uint64_t)in[3]) << 32) | + (((uint64_t)in[4]) << 24) | (((uint64_t)in[5]) << 16) | + (((uint64_t)in[6]) << 8) | ((uint64_t)in[7]); +} + +uint64_t SSL_get_read_sequence(const SSL *ssl) { + // TODO(davidben): Internally represent sequence numbers as uint64_t. + if (SSL_is_dtls(ssl)) { + // max_seq_num already includes the epoch. + assert(ssl->d1->r_epoch == (ssl->d1->bitmap.max_seq_num >> 48)); + return ssl->d1->bitmap.max_seq_num; + } + return be_to_u64(ssl->s3->read_sequence); +} + +uint64_t SSL_get_write_sequence(const SSL *ssl) { + uint64_t ret = be_to_u64(ssl->s3->write_sequence); + if (SSL_is_dtls(ssl)) { + assert((ret >> 48) == 0); + ret |= ((uint64_t)ssl->d1->w_epoch) << 48; + } + return ret; +} + +uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl) { + // TODO(davidben): This checks the wrong session if there is a renegotiation + // in progress. + SSL_SESSION *session = SSL_get_session(ssl); + if (session == NULL) { + return 0; + } + + return session->peer_signature_algorithm; +} + +size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, size_t max_out) { + if (max_out == 0) { + return sizeof(ssl->s3->client_random); + } + if (max_out > sizeof(ssl->s3->client_random)) { + max_out = sizeof(ssl->s3->client_random); + } + OPENSSL_memcpy(out, ssl->s3->client_random, max_out); + return max_out; +} + +size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, size_t max_out) { + if (max_out == 0) { + return sizeof(ssl->s3->server_random); + } + if (max_out > sizeof(ssl->s3->server_random)) { + max_out = sizeof(ssl->s3->server_random); + } + OPENSSL_memcpy(out, ssl->s3->server_random, max_out); + return max_out; +} + +const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl) { + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + if (hs == NULL) { + return NULL; + } + return hs->new_cipher; +} + +void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enabled) { + if (!ssl->config) { + return; + } + ssl->config->retain_only_sha256_of_client_certs = !!enabled; +} + +void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enabled) { + ctx->retain_only_sha256_of_client_certs = !!enabled; +} + +void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled) { + ctx->grease_enabled = !!enabled; +} + +int32_t SSL_get_ticket_age_skew(const SSL *ssl) { + return ssl->s3->ticket_age_skew; +} + +void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed) { + ctx->false_start_allowed_without_alpn = !!allowed; +} + +int SSL_is_tls13_downgrade(const SSL *ssl) { return ssl->s3->tls13_downgrade; } + +int SSL_used_hello_retry_request(const SSL *ssl) { + return ssl->s3->used_hello_retry_request; +} + +void SSL_CTX_set_ignore_tls13_downgrade(SSL_CTX *ctx, int ignore) { + ctx->ignore_tls13_downgrade = !!ignore; +} + +void SSL_set_ignore_tls13_downgrade(SSL *ssl, int ignore) { + if (!ssl->config) { + return; + } + ssl->config->ignore_tls13_downgrade = !!ignore; +} + +void SSL_set_shed_handshake_config(SSL *ssl, int enable) { + if (!ssl->config) { + return; + } + ssl->config->shed_handshake_config = !!enable; +} + +void SSL_set_jdk11_workaround(SSL *ssl, int enable) { + if (!ssl->config) { + return; + } + ssl->config->jdk11_workaround = !!enable; +} + +int SSL_clear(SSL *ssl) { + if (!ssl->config) { + return 0; // SSL_clear may not be used after shedding config. + } + + // In OpenSSL, reusing a client |SSL| with |SSL_clear| causes the previously + // established session to be offered the next time around. wpa_supplicant + // depends on this behavior, so emulate it. + UniquePtr session; + if (!ssl->server && ssl->s3->established_session != NULL) { + session = UpRef(ssl->s3->established_session); + } + + // The ssl->d1->mtu is simultaneously configuration (preserved across + // clear) and connection-specific state (gets reset). + // + // TODO(davidben): Avoid this. + unsigned mtu = 0; + if (ssl->d1 != NULL) { + mtu = ssl->d1->mtu; + } + + ssl->method->ssl_free(ssl); + if (!ssl->method->ssl_new(ssl)) { + return 0; + } + + if (SSL_is_dtls(ssl) && (SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { + ssl->d1->mtu = mtu; + } + + if (session != nullptr) { + SSL_set_session(ssl, session.get()); + } + + return 1; +} + +int SSL_CTX_sess_connect(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_connect_good(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_accept(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_accept_good(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_hits(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_misses(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_timeouts(const SSL_CTX *ctx) { return 0; } +int SSL_CTX_sess_cache_full(const SSL_CTX *ctx) { return 0; } + +int SSL_num_renegotiations(const SSL *ssl) { + return SSL_total_renegotiations(ssl); +} + +int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx) { return 0; } +int SSL_need_tmp_RSA(const SSL *ssl) { return 0; } +int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa) { return 1; } +int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa) { return 1; } +void ERR_load_SSL_strings(void) {} +void SSL_load_error_strings(void) {} +int SSL_cache_hit(SSL *ssl) { return SSL_session_reused(ssl); } + +int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key) { + if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); + return SSL_CTX_set1_curves(ctx, &nid, 1); +} + +int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key) { + if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); + return SSL_set1_curves(ssl, &nid, 1); +} + +void SSL_CTX_set_ticket_aead_method(SSL_CTX *ctx, + const SSL_TICKET_AEAD_METHOD *aead_method) { + ctx->ticket_aead_method = aead_method; +} + +int SSL_set_tlsext_status_type(SSL *ssl, int type) { + if (!ssl->config) { + return 0; + } + ssl->config->ocsp_stapling_enabled = type == TLSEXT_STATUSTYPE_ocsp; + return 1; +} + +int SSL_get_tlsext_status_type(const SSL *ssl) { + if (ssl->server) { + SSL_HANDSHAKE *hs = ssl->s3->hs.get(); + return hs != nullptr && hs->ocsp_stapling_requested + ? TLSEXT_STATUSTYPE_ocsp + : TLSEXT_STATUSTYPE_nothing; + } + + return ssl->config != nullptr && ssl->config->ocsp_stapling_enabled + ? TLSEXT_STATUSTYPE_ocsp + : TLSEXT_STATUSTYPE_nothing; +} + +int SSL_set_tlsext_status_ocsp_resp(SSL *ssl, uint8_t *resp, size_t resp_len) { + if (SSL_set_ocsp_response(ssl, resp, resp_len)) { + OPENSSL_free(resp); + return 1; + } + return 0; +} + +size_t SSL_get_tlsext_status_ocsp_resp(const SSL *ssl, const uint8_t **out) { + size_t ret; + SSL_get0_ocsp_response(ssl, out, &ret); + return ret; +} + +int SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, + int (*callback)(SSL *ssl, void *arg)) { + ctx->legacy_ocsp_callback = callback; + return 1; +} + +int SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg) { + ctx->legacy_ocsp_callback_arg = arg; + return 1; +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc new file mode 100644 index 000000000..f2936bbb3 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc @@ -0,0 +1,824 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +bool ssl_is_key_type_supported(int key_type) { + return key_type == EVP_PKEY_RSA || key_type == EVP_PKEY_EC || + key_type == EVP_PKEY_ED25519; +} + +static bool ssl_set_pkey(CERT *cert, EVP_PKEY *pkey) { + if (!ssl_is_key_type_supported(pkey->type)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); + return false; + } + + if (cert->chain != nullptr && + sk_CRYPTO_BUFFER_value(cert->chain.get(), 0) != nullptr && + // Sanity-check that the private key and the certificate match. + !ssl_cert_check_private_key(cert, pkey)) { + return false; + } + + cert->privatekey = UpRef(pkey); + return true; +} + +typedef struct { + uint16_t sigalg; + int pkey_type; + int curve; + const EVP_MD *(*digest_func)(void); + bool is_rsa_pss; +} SSL_SIGNATURE_ALGORITHM; + +static const SSL_SIGNATURE_ALGORITHM kSignatureAlgorithms[] = { + {SSL_SIGN_RSA_PKCS1_MD5_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_md5_sha1, + false}, + {SSL_SIGN_RSA_PKCS1_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_sha1, false}, + {SSL_SIGN_RSA_PKCS1_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, false}, + {SSL_SIGN_RSA_PKCS1_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, false}, + {SSL_SIGN_RSA_PKCS1_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, false}, + + {SSL_SIGN_RSA_PSS_RSAE_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, true}, + {SSL_SIGN_RSA_PSS_RSAE_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, true}, + {SSL_SIGN_RSA_PSS_RSAE_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, true}, + + {SSL_SIGN_ECDSA_SHA1, EVP_PKEY_EC, NID_undef, &EVP_sha1, false}, + {SSL_SIGN_ECDSA_SECP256R1_SHA256, EVP_PKEY_EC, NID_X9_62_prime256v1, + &EVP_sha256, false}, + {SSL_SIGN_ECDSA_SECP384R1_SHA384, EVP_PKEY_EC, NID_secp384r1, &EVP_sha384, + false}, + {SSL_SIGN_ECDSA_SECP521R1_SHA512, EVP_PKEY_EC, NID_secp521r1, &EVP_sha512, + false}, + + {SSL_SIGN_ED25519, EVP_PKEY_ED25519, NID_undef, nullptr, false}, +}; + +static const SSL_SIGNATURE_ALGORITHM *get_signature_algorithm(uint16_t sigalg) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kSignatureAlgorithms); i++) { + if (kSignatureAlgorithms[i].sigalg == sigalg) { + return &kSignatureAlgorithms[i]; + } + } + return NULL; +} + +bool ssl_has_private_key(const SSL_HANDSHAKE *hs) { + if (hs->config->cert->privatekey != nullptr || + hs->config->cert->key_method != nullptr || + ssl_signing_with_dc(hs)) { + return true; + } + + return false; +} + +static bool pkey_supports_algorithm(const SSL *ssl, EVP_PKEY *pkey, + uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + if (alg == NULL || + EVP_PKEY_id(pkey) != alg->pkey_type) { + return false; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + // RSA keys may only be used with RSA-PSS. + if (alg->pkey_type == EVP_PKEY_RSA && !alg->is_rsa_pss) { + return false; + } + + // EC keys have a curve requirement. + if (alg->pkey_type == EVP_PKEY_EC && + (alg->curve == NID_undef || + EC_GROUP_get_curve_name( + EC_KEY_get0_group(EVP_PKEY_get0_EC_KEY(pkey))) != alg->curve)) { + return false; + } + } + + return true; +} + +static bool setup_ctx(SSL *ssl, EVP_MD_CTX *ctx, EVP_PKEY *pkey, + uint16_t sigalg, bool is_verify) { + if (!pkey_supports_algorithm(ssl, pkey, sigalg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SIGNATURE_TYPE); + return false; + } + + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + const EVP_MD *digest = alg->digest_func != NULL ? alg->digest_func() : NULL; + EVP_PKEY_CTX *pctx; + if (is_verify) { + if (!EVP_DigestVerifyInit(ctx, &pctx, digest, NULL, pkey)) { + return false; + } + } else if (!EVP_DigestSignInit(ctx, &pctx, digest, NULL, pkey)) { + return false; + } + + if (alg->is_rsa_pss) { + if (!EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1 /* salt len = hash len */)) { + return false; + } + } + + return true; +} + +enum ssl_private_key_result_t ssl_private_key_sign( + SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, + uint16_t sigalg, Span in) { + SSL *const ssl = hs->ssl; + const SSL_PRIVATE_KEY_METHOD *key_method = hs->config->cert->key_method; + EVP_PKEY *privatekey = hs->config->cert->privatekey.get(); + if (ssl_signing_with_dc(hs)) { + key_method = hs->config->cert->dc_key_method; + privatekey = hs->config->cert->dc_privatekey.get(); + } + + if (key_method != NULL) { + enum ssl_private_key_result_t ret; + if (hs->pending_private_key_op) { + ret = key_method->complete(ssl, out, out_len, max_out); + } else { + ret = key_method->sign(ssl, out, out_len, max_out, + sigalg, in.data(), in.size()); + } + if (ret == ssl_private_key_failure) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); + } + hs->pending_private_key_op = ret == ssl_private_key_retry; + return ret; + } + + *out_len = max_out; + ScopedEVP_MD_CTX ctx; + if (!setup_ctx(ssl, ctx.get(), privatekey, sigalg, false /* sign */) || + !EVP_DigestSign(ctx.get(), out, out_len, in.data(), in.size())) { + return ssl_private_key_failure; + } + return ssl_private_key_success; +} + +bool ssl_public_key_verify(SSL *ssl, Span signature, + uint16_t sigalg, EVP_PKEY *pkey, + Span in) { + ScopedEVP_MD_CTX ctx; + if (!setup_ctx(ssl, ctx.get(), pkey, sigalg, true /* verify */)) { + return false; + } + bool ok = EVP_DigestVerify(ctx.get(), signature.data(), signature.size(), + in.data(), in.size()); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + ok = true; + ERR_clear_error(); +#endif + return ok; +} + +enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, + uint8_t *out, + size_t *out_len, + size_t max_out, + Span in) { + SSL *const ssl = hs->ssl; + if (hs->config->cert->key_method != NULL) { + enum ssl_private_key_result_t ret; + if (hs->pending_private_key_op) { + ret = hs->config->cert->key_method->complete(ssl, out, out_len, max_out); + } else { + ret = hs->config->cert->key_method->decrypt(ssl, out, out_len, max_out, + in.data(), in.size()); + } + if (ret == ssl_private_key_failure) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); + } + hs->pending_private_key_op = ret == ssl_private_key_retry; + return ret; + } + + RSA *rsa = EVP_PKEY_get0_RSA(hs->config->cert->privatekey.get()); + if (rsa == NULL) { + // Decrypt operations are only supported for RSA keys. + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + // Decrypt with no padding. PKCS#1 padding will be removed as part of the + // timing-sensitive code by the caller. + if (!RSA_decrypt(rsa, out_len, out, max_out, in.data(), in.size(), + RSA_NO_PADDING)) { + return ssl_private_key_failure; + } + return ssl_private_key_success; +} + +bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, + uint16_t sigalg) { + SSL *const ssl = hs->ssl; + if (!pkey_supports_algorithm(ssl, hs->local_pubkey.get(), sigalg)) { + return false; + } + + // Ensure the RSA key is large enough for the hash. RSASSA-PSS requires that + // emLen be at least hLen + sLen + 2. Both hLen and sLen are the size of the + // hash in TLS. Reasonable RSA key sizes are large enough for the largest + // defined RSASSA-PSS algorithm, but 1024-bit RSA is slightly too small for + // SHA-512. 1024-bit RSA is sometimes used for test credentials, so check the + // size so that we can fall back to another algorithm in that case. + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + if (alg->is_rsa_pss && (size_t)EVP_PKEY_size(hs->local_pubkey.get()) < + 2 * EVP_MD_size(alg->digest_func()) + 2) { + return false; + } + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) { + if (rsa == NULL || ssl->config == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + UniquePtr pkey(EVP_PKEY_new()); + if (!pkey || + !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); + return 0; + } + + return ssl_set_pkey(ssl->config->cert.get(), pkey.get()); +} + +int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { + UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); + if (!rsa) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_use_RSAPrivateKey(ssl, rsa.get()); +} + +int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) { + if (pkey == NULL || ssl->config == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + return ssl_set_pkey(ssl->config->cert.get(), pkey); +} + +int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const uint8_t *der, + size_t der_len) { + if (der_len > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + const uint8_t *p = der; + UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); + if (!pkey || p != der + der_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_use_PrivateKey(ssl, pkey.get()); +} + +int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) { + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + UniquePtr pkey(EVP_PKEY_new()); + if (!pkey || + !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); + return 0; + } + + return ssl_set_pkey(ctx->cert.get(), pkey.get()); +} + +int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const uint8_t *der, + size_t der_len) { + UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); + if (!rsa) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_CTX_use_RSAPrivateKey(ctx, rsa.get()); +} + +int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) { + if (pkey == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + return ssl_set_pkey(ctx->cert.get(), pkey); +} + +int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const uint8_t *der, + size_t der_len) { + if (der_len > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + const uint8_t *p = der; + UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); + if (!pkey || p != der + der_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_CTX_use_PrivateKey(ctx, pkey.get()); +} + +void SSL_set_private_key_method(SSL *ssl, + const SSL_PRIVATE_KEY_METHOD *key_method) { + if (!ssl->config) { + return; + } + ssl->config->cert->key_method = key_method; +} + +void SSL_CTX_set_private_key_method(SSL_CTX *ctx, + const SSL_PRIVATE_KEY_METHOD *key_method) { + ctx->cert->key_method = key_method; +} + +static constexpr size_t kMaxSignatureAlgorithmNameLen = 23; + +// This was "constexpr" rather than "const", but that triggered a bug in MSVC +// where it didn't pad the strings to the correct length. +static const struct { + uint16_t signature_algorithm; + const char name[kMaxSignatureAlgorithmNameLen]; +} kSignatureAlgorithmNames[] = { + {SSL_SIGN_RSA_PKCS1_MD5_SHA1, "rsa_pkcs1_md5_sha1"}, + {SSL_SIGN_RSA_PKCS1_SHA1, "rsa_pkcs1_sha1"}, + {SSL_SIGN_RSA_PKCS1_SHA256, "rsa_pkcs1_sha256"}, + {SSL_SIGN_RSA_PKCS1_SHA384, "rsa_pkcs1_sha384"}, + {SSL_SIGN_RSA_PKCS1_SHA512, "rsa_pkcs1_sha512"}, + {SSL_SIGN_ECDSA_SHA1, "ecdsa_sha1"}, + {SSL_SIGN_ECDSA_SECP256R1_SHA256, "ecdsa_secp256r1_sha256"}, + {SSL_SIGN_ECDSA_SECP384R1_SHA384, "ecdsa_secp384r1_sha384"}, + {SSL_SIGN_ECDSA_SECP521R1_SHA512, "ecdsa_secp521r1_sha512"}, + {SSL_SIGN_RSA_PSS_RSAE_SHA256, "rsa_pss_rsae_sha256"}, + {SSL_SIGN_RSA_PSS_RSAE_SHA384, "rsa_pss_rsae_sha384"}, + {SSL_SIGN_RSA_PSS_RSAE_SHA512, "rsa_pss_rsae_sha512"}, + {SSL_SIGN_ED25519, "ed25519"}, +}; + +const char *SSL_get_signature_algorithm_name(uint16_t sigalg, + int include_curve) { + if (!include_curve) { + switch (sigalg) { + case SSL_SIGN_ECDSA_SECP256R1_SHA256: + return "ecdsa_sha256"; + case SSL_SIGN_ECDSA_SECP384R1_SHA384: + return "ecdsa_sha384"; + case SSL_SIGN_ECDSA_SECP521R1_SHA512: + return "ecdsa_sha512"; + } + } + + for (const auto &candidate : kSignatureAlgorithmNames) { + if (candidate.signature_algorithm == sigalg) { + return candidate.name; + } + } + + return NULL; +} + +int SSL_get_signature_algorithm_key_type(uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + return alg != nullptr ? alg->pkey_type : EVP_PKEY_NONE; +} + +const EVP_MD *SSL_get_signature_algorithm_digest(uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + if (alg == nullptr || alg->digest_func == nullptr) { + return nullptr; + } + return alg->digest_func(); +} + +int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + return alg != nullptr && alg->is_rsa_pss; +} + +int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, + size_t num_prefs) { + return ctx->cert->sigalgs.CopyFrom(MakeConstSpan(prefs, num_prefs)); +} + +int SSL_set_signing_algorithm_prefs(SSL *ssl, const uint16_t *prefs, + size_t num_prefs) { + if (!ssl->config) { + return 0; + } + return ssl->config->cert->sigalgs.CopyFrom(MakeConstSpan(prefs, num_prefs)); +} + +static constexpr struct { + int pkey_type; + int hash_nid; + uint16_t signature_algorithm; +} kSignatureAlgorithmsMapping[] = { + {EVP_PKEY_RSA, NID_sha1, SSL_SIGN_RSA_PKCS1_SHA1}, + {EVP_PKEY_RSA, NID_sha256, SSL_SIGN_RSA_PKCS1_SHA256}, + {EVP_PKEY_RSA, NID_sha384, SSL_SIGN_RSA_PKCS1_SHA384}, + {EVP_PKEY_RSA, NID_sha512, SSL_SIGN_RSA_PKCS1_SHA512}, + {EVP_PKEY_RSA_PSS, NID_sha256, SSL_SIGN_RSA_PSS_RSAE_SHA256}, + {EVP_PKEY_RSA_PSS, NID_sha384, SSL_SIGN_RSA_PSS_RSAE_SHA384}, + {EVP_PKEY_RSA_PSS, NID_sha512, SSL_SIGN_RSA_PSS_RSAE_SHA512}, + {EVP_PKEY_EC, NID_sha1, SSL_SIGN_ECDSA_SHA1}, + {EVP_PKEY_EC, NID_sha256, SSL_SIGN_ECDSA_SECP256R1_SHA256}, + {EVP_PKEY_EC, NID_sha384, SSL_SIGN_ECDSA_SECP384R1_SHA384}, + {EVP_PKEY_EC, NID_sha512, SSL_SIGN_ECDSA_SECP521R1_SHA512}, + {EVP_PKEY_ED25519, NID_undef, SSL_SIGN_ED25519}, +}; + +static bool parse_sigalg_pairs(Array *out, const int *values, + size_t num_values) { + if ((num_values & 1) == 1) { + return false; + } + + const size_t num_pairs = num_values / 2; + if (!out->Init(num_pairs)) { + return false; + } + + for (size_t i = 0; i < num_values; i += 2) { + const int hash_nid = values[i]; + const int pkey_type = values[i+1]; + + bool found = false; + for (const auto &candidate : kSignatureAlgorithmsMapping) { + if (candidate.pkey_type == pkey_type && candidate.hash_nid == hash_nid) { + (*out)[i / 2] = candidate.signature_algorithm; + found = true; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown hash:%d pkey:%d", hash_nid, pkey_type); + return false; + } + } + + return true; +} + +static int compare_uint16_t(const void *p1, const void *p2) { + uint16_t u1 = *((const uint16_t *)p1); + uint16_t u2 = *((const uint16_t *)p2); + if (u1 < u2) { + return -1; + } else if (u1 > u2) { + return 1; + } else { + return 0; + } +} + +static bool sigalgs_unique(Span in_sigalgs) { + if (in_sigalgs.size() < 2) { + return true; + } + + Array sigalgs; + if (!sigalgs.CopyFrom(in_sigalgs)) { + return false; + } + + qsort(sigalgs.data(), sigalgs.size(), sizeof(uint16_t), compare_uint16_t); + + for (size_t i = 1; i < sigalgs.size(); i++) { + if (sigalgs[i - 1] == sigalgs[i]) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DUPLICATE_SIGNATURE_ALGORITHM); + return false; + } + } + + return true; +} + +int SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *values, size_t num_values) { + Array sigalgs; + if (!parse_sigalg_pairs(&sigalgs, values, num_values) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_CTX_set_signing_algorithm_prefs(ctx, sigalgs.data(), + sigalgs.size()) || + !ctx->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +int SSL_set1_sigalgs(SSL *ssl, const int *values, size_t num_values) { + if (!ssl->config) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + Array sigalgs; + if (!parse_sigalg_pairs(&sigalgs, values, num_values) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_set_signing_algorithm_prefs(ssl, sigalgs.data(), sigalgs.size()) || + !ssl->config->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +static bool parse_sigalgs_list(Array *out, const char *str) { + // str looks like "RSA+SHA1:ECDSA+SHA256:ecdsa_secp256r1_sha256". + + // Count colons to give the number of output elements from any successful + // parse. + size_t num_elements = 1; + size_t len = 0; + for (const char *p = str; *p; p++) { + len++; + if (*p == ':') { + num_elements++; + } + } + + if (!out->Init(num_elements)) { + return false; + } + size_t out_i = 0; + + enum { + pkey_or_name, + hash_name, + } state = pkey_or_name; + + char buf[kMaxSignatureAlgorithmNameLen]; + // buf_used is always < sizeof(buf). I.e. it's always safe to write + // buf[buf_used] = 0. + size_t buf_used = 0; + + int pkey_type = 0, hash_nid = 0; + + // Note that the loop runs to len+1, i.e. it'll process the terminating NUL. + for (size_t offset = 0; offset < len+1; offset++) { + const char c = str[offset]; + + switch (c) { + case '+': + if (state == hash_name) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("+ found in hash name at offset %zu", offset); + return false; + } + if (buf_used == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("empty public key type at offset %zu", offset); + return false; + } + buf[buf_used] = 0; + + if (strcmp(buf, "RSA") == 0) { + pkey_type = EVP_PKEY_RSA; + } else if (strcmp(buf, "RSA-PSS") == 0 || + strcmp(buf, "PSS") == 0) { + pkey_type = EVP_PKEY_RSA_PSS; + } else if (strcmp(buf, "ECDSA") == 0) { + pkey_type = EVP_PKEY_EC; + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown public key type '%s'", buf); + return false; + } + + state = hash_name; + buf_used = 0; + break; + + case ':': + OPENSSL_FALLTHROUGH; + case 0: + if (buf_used == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("empty element at offset %zu", offset); + return false; + } + + buf[buf_used] = 0; + + if (state == pkey_or_name) { + // No '+' was seen thus this is a TLS 1.3-style name. + bool found = false; + for (const auto &candidate : kSignatureAlgorithmNames) { + if (strcmp(candidate.name, buf) == 0) { + assert(out_i < num_elements); + (*out)[out_i++] = candidate.signature_algorithm; + found = true; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown signature algorithm '%s'", buf); + return false; + } + } else { + if (strcmp(buf, "SHA1") == 0) { + hash_nid = NID_sha1; + } else if (strcmp(buf, "SHA256") == 0) { + hash_nid = NID_sha256; + } else if (strcmp(buf, "SHA384") == 0) { + hash_nid = NID_sha384; + } else if (strcmp(buf, "SHA512") == 0) { + hash_nid = NID_sha512; + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown hash function '%s'", buf); + return false; + } + + bool found = false; + for (const auto &candidate : kSignatureAlgorithmsMapping) { + if (candidate.pkey_type == pkey_type && + candidate.hash_nid == hash_nid) { + assert(out_i < num_elements); + (*out)[out_i++] = candidate.signature_algorithm; + found = true; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown pkey:%d hash:%s", pkey_type, buf); + return false; + } + } + + state = pkey_or_name; + buf_used = 0; + break; + + default: + if (buf_used == sizeof(buf) - 1) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("substring too long at offset %zu", offset); + return false; + } + + if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || c == '-' || c == '_') { + buf[buf_used++] = c; + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("invalid character 0x%02x at offest %zu", c, + offset); + return false; + } + } + } + + assert(out_i == out->size()); + return true; +} + +int SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str) { + Array sigalgs; + if (!parse_sigalgs_list(&sigalgs, str) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_CTX_set_signing_algorithm_prefs(ctx, sigalgs.data(), + sigalgs.size()) || + !ctx->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +int SSL_set1_sigalgs_list(SSL *ssl, const char *str) { + if (!ssl->config) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + Array sigalgs; + if (!parse_sigalgs_list(&sigalgs, str) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_set_signing_algorithm_prefs(ssl, sigalgs.data(), sigalgs.size()) || + !ssl->config->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, + size_t num_prefs) { + return ctx->verify_sigalgs.CopyFrom(MakeConstSpan(prefs, num_prefs)); +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc.grpc_back new file mode 100644 index 000000000..23f8d1249 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_privkey.cc.grpc_back @@ -0,0 +1,824 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] */ + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +bool ssl_is_key_type_supported(int key_type) { + return key_type == EVP_PKEY_RSA || key_type == EVP_PKEY_EC || + key_type == EVP_PKEY_ED25519; +} + +static bool ssl_set_pkey(CERT *cert, EVP_PKEY *pkey) { + if (!ssl_is_key_type_supported(pkey->type)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); + return false; + } + + if (cert->chain != nullptr && + sk_CRYPTO_BUFFER_value(cert->chain.get(), 0) != nullptr && + // Sanity-check that the private key and the certificate match. + !ssl_cert_check_private_key(cert, pkey)) { + return false; + } + + cert->privatekey = UpRef(pkey); + return true; +} + +typedef struct { + uint16_t sigalg; + int pkey_type; + int curve; + const EVP_MD *(*digest_func)(void); + bool is_rsa_pss; +} SSL_SIGNATURE_ALGORITHM; + +static const SSL_SIGNATURE_ALGORITHM kSignatureAlgorithms[] = { + {SSL_SIGN_RSA_PKCS1_MD5_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_md5_sha1, + false}, + {SSL_SIGN_RSA_PKCS1_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_sha1, false}, + {SSL_SIGN_RSA_PKCS1_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, false}, + {SSL_SIGN_RSA_PKCS1_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, false}, + {SSL_SIGN_RSA_PKCS1_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, false}, + + {SSL_SIGN_RSA_PSS_RSAE_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, true}, + {SSL_SIGN_RSA_PSS_RSAE_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, true}, + {SSL_SIGN_RSA_PSS_RSAE_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, true}, + + {SSL_SIGN_ECDSA_SHA1, EVP_PKEY_EC, NID_undef, &EVP_sha1, false}, + {SSL_SIGN_ECDSA_SECP256R1_SHA256, EVP_PKEY_EC, NID_X9_62_prime256v1, + &EVP_sha256, false}, + {SSL_SIGN_ECDSA_SECP384R1_SHA384, EVP_PKEY_EC, NID_secp384r1, &EVP_sha384, + false}, + {SSL_SIGN_ECDSA_SECP521R1_SHA512, EVP_PKEY_EC, NID_secp521r1, &EVP_sha512, + false}, + + {SSL_SIGN_ED25519, EVP_PKEY_ED25519, NID_undef, nullptr, false}, +}; + +static const SSL_SIGNATURE_ALGORITHM *get_signature_algorithm(uint16_t sigalg) { + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kSignatureAlgorithms); i++) { + if (kSignatureAlgorithms[i].sigalg == sigalg) { + return &kSignatureAlgorithms[i]; + } + } + return NULL; +} + +bool ssl_has_private_key(const SSL_HANDSHAKE *hs) { + if (hs->config->cert->privatekey != nullptr || + hs->config->cert->key_method != nullptr || + ssl_signing_with_dc(hs)) { + return true; + } + + return false; +} + +static bool pkey_supports_algorithm(const SSL *ssl, EVP_PKEY *pkey, + uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + if (alg == NULL || + EVP_PKEY_id(pkey) != alg->pkey_type) { + return false; + } + + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + // RSA keys may only be used with RSA-PSS. + if (alg->pkey_type == EVP_PKEY_RSA && !alg->is_rsa_pss) { + return false; + } + + // EC keys have a curve requirement. + if (alg->pkey_type == EVP_PKEY_EC && + (alg->curve == NID_undef || + EC_GROUP_get_curve_name( + EC_KEY_get0_group(EVP_PKEY_get0_EC_KEY(pkey))) != alg->curve)) { + return false; + } + } + + return true; +} + +static bool setup_ctx(SSL *ssl, EVP_MD_CTX *ctx, EVP_PKEY *pkey, + uint16_t sigalg, bool is_verify) { + if (!pkey_supports_algorithm(ssl, pkey, sigalg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SIGNATURE_TYPE); + return false; + } + + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + const EVP_MD *digest = alg->digest_func != NULL ? alg->digest_func() : NULL; + EVP_PKEY_CTX *pctx; + if (is_verify) { + if (!EVP_DigestVerifyInit(ctx, &pctx, digest, NULL, pkey)) { + return false; + } + } else if (!EVP_DigestSignInit(ctx, &pctx, digest, NULL, pkey)) { + return false; + } + + if (alg->is_rsa_pss) { + if (!EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || + !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1 /* salt len = hash len */)) { + return false; + } + } + + return true; +} + +enum ssl_private_key_result_t ssl_private_key_sign( + SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, + uint16_t sigalg, Span in) { + SSL *const ssl = hs->ssl; + const SSL_PRIVATE_KEY_METHOD *key_method = hs->config->cert->key_method; + EVP_PKEY *privatekey = hs->config->cert->privatekey.get(); + if (ssl_signing_with_dc(hs)) { + key_method = hs->config->cert->dc_key_method; + privatekey = hs->config->cert->dc_privatekey.get(); + } + + if (key_method != NULL) { + enum ssl_private_key_result_t ret; + if (hs->pending_private_key_op) { + ret = key_method->complete(ssl, out, out_len, max_out); + } else { + ret = key_method->sign(ssl, out, out_len, max_out, + sigalg, in.data(), in.size()); + } + if (ret == ssl_private_key_failure) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); + } + hs->pending_private_key_op = ret == ssl_private_key_retry; + return ret; + } + + *out_len = max_out; + ScopedEVP_MD_CTX ctx; + if (!setup_ctx(ssl, ctx.get(), privatekey, sigalg, false /* sign */) || + !EVP_DigestSign(ctx.get(), out, out_len, in.data(), in.size())) { + return ssl_private_key_failure; + } + return ssl_private_key_success; +} + +bool ssl_public_key_verify(SSL *ssl, Span signature, + uint16_t sigalg, EVP_PKEY *pkey, + Span in) { + ScopedEVP_MD_CTX ctx; + if (!setup_ctx(ssl, ctx.get(), pkey, sigalg, true /* verify */)) { + return false; + } + bool ok = EVP_DigestVerify(ctx.get(), signature.data(), signature.size(), + in.data(), in.size()); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + ok = true; + ERR_clear_error(); +#endif + return ok; +} + +enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, + uint8_t *out, + size_t *out_len, + size_t max_out, + Span in) { + SSL *const ssl = hs->ssl; + if (hs->config->cert->key_method != NULL) { + enum ssl_private_key_result_t ret; + if (hs->pending_private_key_op) { + ret = hs->config->cert->key_method->complete(ssl, out, out_len, max_out); + } else { + ret = hs->config->cert->key_method->decrypt(ssl, out, out_len, max_out, + in.data(), in.size()); + } + if (ret == ssl_private_key_failure) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); + } + hs->pending_private_key_op = ret == ssl_private_key_retry; + return ret; + } + + RSA *rsa = EVP_PKEY_get0_RSA(hs->config->cert->privatekey.get()); + if (rsa == NULL) { + // Decrypt operations are only supported for RSA keys. + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + // Decrypt with no padding. PKCS#1 padding will be removed as part of the + // timing-sensitive code by the caller. + if (!RSA_decrypt(rsa, out_len, out, max_out, in.data(), in.size(), + RSA_NO_PADDING)) { + return ssl_private_key_failure; + } + return ssl_private_key_success; +} + +bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, + uint16_t sigalg) { + SSL *const ssl = hs->ssl; + if (!pkey_supports_algorithm(ssl, hs->local_pubkey.get(), sigalg)) { + return false; + } + + // Ensure the RSA key is large enough for the hash. RSASSA-PSS requires that + // emLen be at least hLen + sLen + 2. Both hLen and sLen are the size of the + // hash in TLS. Reasonable RSA key sizes are large enough for the largest + // defined RSASSA-PSS algorithm, but 1024-bit RSA is slightly too small for + // SHA-512. 1024-bit RSA is sometimes used for test credentials, so check the + // size so that we can fall back to another algorithm in that case. + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + if (alg->is_rsa_pss && (size_t)EVP_PKEY_size(hs->local_pubkey.get()) < + 2 * EVP_MD_size(alg->digest_func()) + 2) { + return false; + } + + return true; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) { + if (rsa == NULL || ssl->config == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + UniquePtr pkey(EVP_PKEY_new()); + if (!pkey || + !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); + return 0; + } + + return ssl_set_pkey(ssl->config->cert.get(), pkey.get()); +} + +int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { + UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); + if (!rsa) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_use_RSAPrivateKey(ssl, rsa.get()); +} + +int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) { + if (pkey == NULL || ssl->config == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + return ssl_set_pkey(ssl->config->cert.get(), pkey); +} + +int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const uint8_t *der, + size_t der_len) { + if (der_len > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + const uint8_t *p = der; + UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); + if (!pkey || p != der + der_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_use_PrivateKey(ssl, pkey.get()); +} + +int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) { + if (rsa == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + UniquePtr pkey(EVP_PKEY_new()); + if (!pkey || + !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); + return 0; + } + + return ssl_set_pkey(ctx->cert.get(), pkey.get()); +} + +int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const uint8_t *der, + size_t der_len) { + UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); + if (!rsa) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_CTX_use_RSAPrivateKey(ctx, rsa.get()); +} + +int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) { + if (pkey == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); + return 0; + } + + return ssl_set_pkey(ctx->cert.get(), pkey); +} + +int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const uint8_t *der, + size_t der_len) { + if (der_len > LONG_MAX) { + OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); + return 0; + } + + const uint8_t *p = der; + UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); + if (!pkey || p != der + der_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); + return 0; + } + + return SSL_CTX_use_PrivateKey(ctx, pkey.get()); +} + +void SSL_set_private_key_method(SSL *ssl, + const SSL_PRIVATE_KEY_METHOD *key_method) { + if (!ssl->config) { + return; + } + ssl->config->cert->key_method = key_method; +} + +void SSL_CTX_set_private_key_method(SSL_CTX *ctx, + const SSL_PRIVATE_KEY_METHOD *key_method) { + ctx->cert->key_method = key_method; +} + +static constexpr size_t kMaxSignatureAlgorithmNameLen = 23; + +// This was "constexpr" rather than "const", but that triggered a bug in MSVC +// where it didn't pad the strings to the correct length. +static const struct { + uint16_t signature_algorithm; + const char name[kMaxSignatureAlgorithmNameLen]; +} kSignatureAlgorithmNames[] = { + {SSL_SIGN_RSA_PKCS1_MD5_SHA1, "rsa_pkcs1_md5_sha1"}, + {SSL_SIGN_RSA_PKCS1_SHA1, "rsa_pkcs1_sha1"}, + {SSL_SIGN_RSA_PKCS1_SHA256, "rsa_pkcs1_sha256"}, + {SSL_SIGN_RSA_PKCS1_SHA384, "rsa_pkcs1_sha384"}, + {SSL_SIGN_RSA_PKCS1_SHA512, "rsa_pkcs1_sha512"}, + {SSL_SIGN_ECDSA_SHA1, "ecdsa_sha1"}, + {SSL_SIGN_ECDSA_SECP256R1_SHA256, "ecdsa_secp256r1_sha256"}, + {SSL_SIGN_ECDSA_SECP384R1_SHA384, "ecdsa_secp384r1_sha384"}, + {SSL_SIGN_ECDSA_SECP521R1_SHA512, "ecdsa_secp521r1_sha512"}, + {SSL_SIGN_RSA_PSS_RSAE_SHA256, "rsa_pss_rsae_sha256"}, + {SSL_SIGN_RSA_PSS_RSAE_SHA384, "rsa_pss_rsae_sha384"}, + {SSL_SIGN_RSA_PSS_RSAE_SHA512, "rsa_pss_rsae_sha512"}, + {SSL_SIGN_ED25519, "ed25519"}, +}; + +const char *SSL_get_signature_algorithm_name(uint16_t sigalg, + int include_curve) { + if (!include_curve) { + switch (sigalg) { + case SSL_SIGN_ECDSA_SECP256R1_SHA256: + return "ecdsa_sha256"; + case SSL_SIGN_ECDSA_SECP384R1_SHA384: + return "ecdsa_sha384"; + case SSL_SIGN_ECDSA_SECP521R1_SHA512: + return "ecdsa_sha512"; + } + } + + for (const auto &candidate : kSignatureAlgorithmNames) { + if (candidate.signature_algorithm == sigalg) { + return candidate.name; + } + } + + return NULL; +} + +int SSL_get_signature_algorithm_key_type(uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + return alg != nullptr ? alg->pkey_type : EVP_PKEY_NONE; +} + +const EVP_MD *SSL_get_signature_algorithm_digest(uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + if (alg == nullptr || alg->digest_func == nullptr) { + return nullptr; + } + return alg->digest_func(); +} + +int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg) { + const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); + return alg != nullptr && alg->is_rsa_pss; +} + +int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, + size_t num_prefs) { + return ctx->cert->sigalgs.CopyFrom(MakeConstSpan(prefs, num_prefs)); +} + +int SSL_set_signing_algorithm_prefs(SSL *ssl, const uint16_t *prefs, + size_t num_prefs) { + if (!ssl->config) { + return 0; + } + return ssl->config->cert->sigalgs.CopyFrom(MakeConstSpan(prefs, num_prefs)); +} + +static constexpr struct { + int pkey_type; + int hash_nid; + uint16_t signature_algorithm; +} kSignatureAlgorithmsMapping[] = { + {EVP_PKEY_RSA, NID_sha1, SSL_SIGN_RSA_PKCS1_SHA1}, + {EVP_PKEY_RSA, NID_sha256, SSL_SIGN_RSA_PKCS1_SHA256}, + {EVP_PKEY_RSA, NID_sha384, SSL_SIGN_RSA_PKCS1_SHA384}, + {EVP_PKEY_RSA, NID_sha512, SSL_SIGN_RSA_PKCS1_SHA512}, + {EVP_PKEY_RSA_PSS, NID_sha256, SSL_SIGN_RSA_PSS_RSAE_SHA256}, + {EVP_PKEY_RSA_PSS, NID_sha384, SSL_SIGN_RSA_PSS_RSAE_SHA384}, + {EVP_PKEY_RSA_PSS, NID_sha512, SSL_SIGN_RSA_PSS_RSAE_SHA512}, + {EVP_PKEY_EC, NID_sha1, SSL_SIGN_ECDSA_SHA1}, + {EVP_PKEY_EC, NID_sha256, SSL_SIGN_ECDSA_SECP256R1_SHA256}, + {EVP_PKEY_EC, NID_sha384, SSL_SIGN_ECDSA_SECP384R1_SHA384}, + {EVP_PKEY_EC, NID_sha512, SSL_SIGN_ECDSA_SECP521R1_SHA512}, + {EVP_PKEY_ED25519, NID_undef, SSL_SIGN_ED25519}, +}; + +static bool parse_sigalg_pairs(Array *out, const int *values, + size_t num_values) { + if ((num_values & 1) == 1) { + return false; + } + + const size_t num_pairs = num_values / 2; + if (!out->Init(num_pairs)) { + return false; + } + + for (size_t i = 0; i < num_values; i += 2) { + const int hash_nid = values[i]; + const int pkey_type = values[i+1]; + + bool found = false; + for (const auto &candidate : kSignatureAlgorithmsMapping) { + if (candidate.pkey_type == pkey_type && candidate.hash_nid == hash_nid) { + (*out)[i / 2] = candidate.signature_algorithm; + found = true; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown hash:%d pkey:%d", hash_nid, pkey_type); + return false; + } + } + + return true; +} + +static int compare_uint16_t(const void *p1, const void *p2) { + uint16_t u1 = *((const uint16_t *)p1); + uint16_t u2 = *((const uint16_t *)p2); + if (u1 < u2) { + return -1; + } else if (u1 > u2) { + return 1; + } else { + return 0; + } +} + +static bool sigalgs_unique(Span in_sigalgs) { + if (in_sigalgs.size() < 2) { + return true; + } + + Array sigalgs; + if (!sigalgs.CopyFrom(in_sigalgs)) { + return false; + } + + qsort(sigalgs.data(), sigalgs.size(), sizeof(uint16_t), compare_uint16_t); + + for (size_t i = 1; i < sigalgs.size(); i++) { + if (sigalgs[i - 1] == sigalgs[i]) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DUPLICATE_SIGNATURE_ALGORITHM); + return false; + } + } + + return true; +} + +int SSL_CTX_set1_sigalgs(SSL_CTX *ctx, const int *values, size_t num_values) { + Array sigalgs; + if (!parse_sigalg_pairs(&sigalgs, values, num_values) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_CTX_set_signing_algorithm_prefs(ctx, sigalgs.data(), + sigalgs.size()) || + !ctx->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +int SSL_set1_sigalgs(SSL *ssl, const int *values, size_t num_values) { + if (!ssl->config) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + Array sigalgs; + if (!parse_sigalg_pairs(&sigalgs, values, num_values) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_set_signing_algorithm_prefs(ssl, sigalgs.data(), sigalgs.size()) || + !ssl->config->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +static bool parse_sigalgs_list(Array *out, const char *str) { + // str looks like "RSA+SHA1:ECDSA+SHA256:ecdsa_secp256r1_sha256". + + // Count colons to give the number of output elements from any successful + // parse. + size_t num_elements = 1; + size_t len = 0; + for (const char *p = str; *p; p++) { + len++; + if (*p == ':') { + num_elements++; + } + } + + if (!out->Init(num_elements)) { + return false; + } + size_t out_i = 0; + + enum { + pkey_or_name, + hash_name, + } state = pkey_or_name; + + char buf[kMaxSignatureAlgorithmNameLen]; + // buf_used is always < sizeof(buf). I.e. it's always safe to write + // buf[buf_used] = 0. + size_t buf_used = 0; + + int pkey_type = 0, hash_nid = 0; + + // Note that the loop runs to len+1, i.e. it'll process the terminating NUL. + for (size_t offset = 0; offset < len+1; offset++) { + const char c = str[offset]; + + switch (c) { + case '+': + if (state == hash_name) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("+ found in hash name at offset %zu", offset); + return false; + } + if (buf_used == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("empty public key type at offset %zu", offset); + return false; + } + buf[buf_used] = 0; + + if (strcmp(buf, "RSA") == 0) { + pkey_type = EVP_PKEY_RSA; + } else if (strcmp(buf, "RSA-PSS") == 0 || + strcmp(buf, "PSS") == 0) { + pkey_type = EVP_PKEY_RSA_PSS; + } else if (strcmp(buf, "ECDSA") == 0) { + pkey_type = EVP_PKEY_EC; + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown public key type '%s'", buf); + return false; + } + + state = hash_name; + buf_used = 0; + break; + + case ':': + OPENSSL_FALLTHROUGH; + case 0: + if (buf_used == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("empty element at offset %zu", offset); + return false; + } + + buf[buf_used] = 0; + + if (state == pkey_or_name) { + // No '+' was seen thus this is a TLS 1.3-style name. + bool found = false; + for (const auto &candidate : kSignatureAlgorithmNames) { + if (strcmp(candidate.name, buf) == 0) { + assert(out_i < num_elements); + (*out)[out_i++] = candidate.signature_algorithm; + found = true; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown signature algorithm '%s'", buf); + return false; + } + } else { + if (strcmp(buf, "SHA1") == 0) { + hash_nid = NID_sha1; + } else if (strcmp(buf, "SHA256") == 0) { + hash_nid = NID_sha256; + } else if (strcmp(buf, "SHA384") == 0) { + hash_nid = NID_sha384; + } else if (strcmp(buf, "SHA512") == 0) { + hash_nid = NID_sha512; + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown hash function '%s'", buf); + return false; + } + + bool found = false; + for (const auto &candidate : kSignatureAlgorithmsMapping) { + if (candidate.pkey_type == pkey_type && + candidate.hash_nid == hash_nid) { + assert(out_i < num_elements); + (*out)[out_i++] = candidate.signature_algorithm; + found = true; + break; + } + } + + if (!found) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("unknown pkey:%d hash:%s", pkey_type, buf); + return false; + } + } + + state = pkey_or_name; + buf_used = 0; + break; + + default: + if (buf_used == sizeof(buf) - 1) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("substring too long at offset %zu", offset); + return false; + } + + if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || c == '-' || c == '_') { + buf[buf_used++] = c; + } else { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SIGNATURE_ALGORITHM); + ERR_add_error_dataf("invalid character 0x%02x at offest %zu", c, + offset); + return false; + } + } + } + + assert(out_i == out->size()); + return true; +} + +int SSL_CTX_set1_sigalgs_list(SSL_CTX *ctx, const char *str) { + Array sigalgs; + if (!parse_sigalgs_list(&sigalgs, str) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_CTX_set_signing_algorithm_prefs(ctx, sigalgs.data(), + sigalgs.size()) || + !ctx->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +int SSL_set1_sigalgs_list(SSL *ssl, const char *str) { + if (!ssl->config) { + OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + return 0; + } + + Array sigalgs; + if (!parse_sigalgs_list(&sigalgs, str) || + !sigalgs_unique(sigalgs)) { + return 0; + } + + if (!SSL_set_signing_algorithm_prefs(ssl, sigalgs.data(), sigalgs.size()) || + !ssl->config->verify_sigalgs.CopyFrom(sigalgs)) { + return 0; + } + + return 1; +} + +int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, + size_t num_prefs) { + return ctx->verify_sigalgs.CopyFrom(MakeConstSpan(prefs, num_prefs)); +} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_session.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/ssl_session.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc index 0c93c4f9f..eb77327a1 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_session.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc @@ -151,7 +151,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // The address of this is a magic value, a pointer to which is returned by // SSL_magic_pending_session_ptr(). It allows a session callback to indicate @@ -166,22 +166,27 @@ static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *session); static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *session, int lock); UniquePtr ssl_session_new(const SSL_X509_METHOD *x509_method) { - UniquePtr session( - (SSL_SESSION *)OPENSSL_malloc(sizeof(SSL_SESSION))); - if (!session) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; + return MakeUnique(x509_method); +} + +uint32_t ssl_hash_session_id(Span session_id) { + // Take the first four bytes of |session_id|. Session IDs are generated by the + // server randomly, so we can assume even using the first four bytes results + // in a good distribution. + uint8_t tmp_storage[sizeof(uint32_t)]; + if (session_id.size() < sizeof(tmp_storage)) { + OPENSSL_memset(tmp_storage, 0, sizeof(tmp_storage)); + OPENSSL_memcpy(tmp_storage, session_id.data(), session_id.size()); + session_id = tmp_storage; } - OPENSSL_memset(session.get(), 0, sizeof(SSL_SESSION)); - session->x509_method = x509_method; - session->verify_result = X509_V_ERR_INVALID_CALL; - session->references = 1; - session->timeout = SSL_DEFAULT_SESSION_TIMEOUT; - session->auth_timeout = SSL_DEFAULT_SESSION_TIMEOUT; - session->time = time(NULL); - CRYPTO_new_ex_data(&session->ex_data); - return session; + uint32_t hash = + ((uint32_t)session_id[0]) | + ((uint32_t)session_id[1] << 8) | + ((uint32_t)session_id[2] << 16) | + ((uint32_t)session_id[3] << 24); + + return hash; } UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { @@ -202,24 +207,23 @@ UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { new_session->cipher = session->cipher; // Copy authentication state. - if (session->psk_identity != NULL) { - new_session->psk_identity = BUF_strdup(session->psk_identity); - if (new_session->psk_identity == NULL) { + if (session->psk_identity != nullptr) { + new_session->psk_identity.reset( + OPENSSL_strdup(session->psk_identity.get())); + if (new_session->psk_identity == nullptr) { return nullptr; } } - if (session->certs != NULL) { - new_session->certs = sk_CRYPTO_BUFFER_new_null(); - if (new_session->certs == NULL) { + if (session->certs != nullptr) { + auto buf_up_ref = [](CRYPTO_BUFFER *buf) { + CRYPTO_BUFFER_up_ref(buf); + return buf; + }; + new_session->certs.reset(sk_CRYPTO_BUFFER_deep_copy( + session->certs.get(), buf_up_ref, CRYPTO_BUFFER_free)); + if (new_session->certs == nullptr) { return nullptr; } - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(session->certs); i++) { - CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(session->certs, i); - if (!sk_CRYPTO_BUFFER_push(new_session->certs, buffer)) { - return nullptr; - } - CRYPTO_BUFFER_up_ref(buffer); - } } if (!session->x509_method->session_dup(new_session.get(), session)) { @@ -228,16 +232,9 @@ UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { new_session->verify_result = session->verify_result; - if (session->ocsp_response != NULL) { - new_session->ocsp_response = session->ocsp_response; - CRYPTO_BUFFER_up_ref(new_session->ocsp_response); - } - - if (session->signed_cert_timestamp_list != NULL) { - new_session->signed_cert_timestamp_list = - session->signed_cert_timestamp_list; - CRYPTO_BUFFER_up_ref(new_session->signed_cert_timestamp_list); - } + new_session->ocsp_response = UpRef(session->ocsp_response); + new_session->signed_cert_timestamp_list = + UpRef(session->signed_cert_timestamp_list); OPENSSL_memcpy(new_session->peer_sha256, session->peer_sha256, SHA256_DIGEST_LENGTH); @@ -262,36 +259,25 @@ UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { session->original_handshake_hash_len); new_session->original_handshake_hash_len = session->original_handshake_hash_len; - new_session->tlsext_tick_lifetime_hint = session->tlsext_tick_lifetime_hint; + new_session->ticket_lifetime_hint = session->ticket_lifetime_hint; new_session->ticket_age_add = session->ticket_age_add; new_session->ticket_max_early_data = session->ticket_max_early_data; new_session->extended_master_secret = session->extended_master_secret; - if (session->early_alpn != NULL) { - new_session->early_alpn = - (uint8_t *)BUF_memdup(session->early_alpn, session->early_alpn_len); - if (new_session->early_alpn == NULL) { - return nullptr; - } + if (!new_session->early_alpn.CopyFrom(session->early_alpn)) { + return nullptr; } - new_session->early_alpn_len = session->early_alpn_len; } // Copy the ticket. - if (dup_flags & SSL_SESSION_INCLUDE_TICKET) { - if (session->tlsext_tick != NULL) { - new_session->tlsext_tick = - (uint8_t *)BUF_memdup(session->tlsext_tick, session->tlsext_ticklen); - if (new_session->tlsext_tick == NULL) { - return nullptr; - } - } - new_session->tlsext_ticklen = session->tlsext_ticklen; + if (dup_flags & SSL_SESSION_INCLUDE_TICKET && + !new_session->ticket.CopyFrom(session->ticket)) { + return nullptr; } // The new_session does not get a copy of the ex_data. - new_session->not_resumable = 1; + new_session->not_resumable = true; return new_session; } @@ -405,16 +391,16 @@ int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server) { session->session_id_length = 0; } - if (ssl->cert->sid_ctx_length > sizeof(session->sid_ctx)) { + if (hs->config->cert->sid_ctx_length > sizeof(session->sid_ctx)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return 0; } - OPENSSL_memcpy(session->sid_ctx, ssl->cert->sid_ctx, - ssl->cert->sid_ctx_length); - session->sid_ctx_length = ssl->cert->sid_ctx_length; + OPENSSL_memcpy(session->sid_ctx, hs->config->cert->sid_ctx, + hs->config->cert->sid_ctx_length); + session->sid_ctx_length = hs->config->cert->sid_ctx_length; // The session is marked not resumable until it is completely filled in. - session->not_resumable = 1; + session->not_resumable = true; session->verify_result = X509_V_ERR_INVALID_CALL; hs->new_session = std::move(session); @@ -429,53 +415,50 @@ int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx) { // Avoid acquiring a write lock in the common case (i.e. a non-default key // is used or the default keys have not expired yet). MutexReadLock lock(&ctx->lock); - if (ctx->tlsext_ticket_key_current && - (ctx->tlsext_ticket_key_current->next_rotation_tv_sec == 0 || - ctx->tlsext_ticket_key_current->next_rotation_tv_sec > now.tv_sec) && - (!ctx->tlsext_ticket_key_prev || - ctx->tlsext_ticket_key_prev->next_rotation_tv_sec > now.tv_sec)) { + if (ctx->ticket_key_current && + (ctx->ticket_key_current->next_rotation_tv_sec == 0 || + ctx->ticket_key_current->next_rotation_tv_sec > now.tv_sec) && + (!ctx->ticket_key_prev || + ctx->ticket_key_prev->next_rotation_tv_sec > now.tv_sec)) { return 1; } } MutexWriteLock lock(&ctx->lock); - if (!ctx->tlsext_ticket_key_current || - (ctx->tlsext_ticket_key_current->next_rotation_tv_sec != 0 && - ctx->tlsext_ticket_key_current->next_rotation_tv_sec <= now.tv_sec)) { + if (!ctx->ticket_key_current || + (ctx->ticket_key_current->next_rotation_tv_sec != 0 && + ctx->ticket_key_current->next_rotation_tv_sec <= now.tv_sec)) { // The current key has not been initialized or it is expired. - auto new_key = bssl::MakeUnique(); + auto new_key = bssl::MakeUnique(); if (!new_key) { return 0; } - OPENSSL_memset(new_key.get(), 0, sizeof(struct tlsext_ticket_key)); - if (ctx->tlsext_ticket_key_current) { + RAND_bytes(new_key->name, 16); + RAND_bytes(new_key->hmac_key, 16); + RAND_bytes(new_key->aes_key, 16); + new_key->next_rotation_tv_sec = + now.tv_sec + SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; + if (ctx->ticket_key_current) { // The current key expired. Rotate it to prev and bump up its rotation // timestamp. Note that even with the new rotation time it may still be - // expired and get droppped below. - ctx->tlsext_ticket_key_current->next_rotation_tv_sec += + // expired and get dropped below. + ctx->ticket_key_current->next_rotation_tv_sec += SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; - OPENSSL_free(ctx->tlsext_ticket_key_prev); - ctx->tlsext_ticket_key_prev = ctx->tlsext_ticket_key_current; + ctx->ticket_key_prev = std::move(ctx->ticket_key_current); } - ctx->tlsext_ticket_key_current = new_key.release(); - RAND_bytes(ctx->tlsext_ticket_key_current->name, 16); - RAND_bytes(ctx->tlsext_ticket_key_current->hmac_key, 16); - RAND_bytes(ctx->tlsext_ticket_key_current->aes_key, 16); - ctx->tlsext_ticket_key_current->next_rotation_tv_sec = - now.tv_sec + SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; + ctx->ticket_key_current = std::move(new_key); } // Drop an expired prev key. - if (ctx->tlsext_ticket_key_prev && - ctx->tlsext_ticket_key_prev->next_rotation_tv_sec <= now.tv_sec) { - OPENSSL_free(ctx->tlsext_ticket_key_prev); - ctx->tlsext_ticket_key_prev = nullptr; + if (ctx->ticket_key_prev && + ctx->ticket_key_prev->next_rotation_tv_sec <= now.tv_sec) { + ctx->ticket_key_prev.reset(); } return 1; } -static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, +static int ssl_encrypt_ticket_with_cipher_ctx(SSL_HANDSHAKE *hs, CBB *out, const uint8_t *session_buf, size_t session_len) { ScopedEVP_CIPHER_CTX ctx; @@ -493,12 +476,12 @@ static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, // Initialize HMAC and cipher contexts. If callback present it does all the // work otherwise use generated values from parent ctx. - SSL_CTX *tctx = ssl->session_ctx; + SSL_CTX *tctx = hs->ssl->session_ctx.get(); uint8_t iv[EVP_MAX_IV_LENGTH]; uint8_t key_name[16]; - if (tctx->tlsext_ticket_key_cb != NULL) { - if (tctx->tlsext_ticket_key_cb(ssl, key_name, iv, ctx.get(), hctx.get(), - 1 /* encrypt */) < 0) { + if (tctx->ticket_key_cb != NULL) { + if (tctx->ticket_key_cb(hs->ssl, key_name, iv, ctx.get(), hctx.get(), + 1 /* encrypt */) < 0) { return 0; } } else { @@ -509,12 +492,12 @@ static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, MutexReadLock lock(&tctx->lock); if (!RAND_bytes(iv, 16) || !EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_cbc(), NULL, - tctx->tlsext_ticket_key_current->aes_key, iv) || - !HMAC_Init_ex(hctx.get(), tctx->tlsext_ticket_key_current->hmac_key, 16, + tctx->ticket_key_current->aes_key, iv) || + !HMAC_Init_ex(hctx.get(), tctx->ticket_key_current->hmac_key, 16, tlsext_tick_md(), NULL)) { return 0; } - OPENSSL_memcpy(key_name, tctx->tlsext_ticket_key_current->name, 16); + OPENSSL_memcpy(key_name, tctx->ticket_key_current->name, 16); } uint8_t *ptr; @@ -554,9 +537,10 @@ static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, return 1; } -static int ssl_encrypt_ticket_with_method(SSL *ssl, CBB *out, +static int ssl_encrypt_ticket_with_method(SSL_HANDSHAKE *hs, CBB *out, const uint8_t *session_buf, size_t session_len) { + SSL *const ssl = hs->ssl; const SSL_TICKET_AEAD_METHOD *method = ssl->session_ctx->ticket_aead_method; const size_t max_overhead = method->max_overhead(ssl); const size_t max_out = session_len + max_overhead; @@ -571,7 +555,8 @@ static int ssl_encrypt_ticket_with_method(SSL *ssl, CBB *out, } size_t out_len; - if (!method->seal(ssl, ptr, &out_len, max_out, session_buf, session_len)) { + if (!method->seal(ssl, ptr, &out_len, max_out, session_buf, + session_len)) { OPENSSL_PUT_ERROR(SSL, SSL_R_TICKET_ENCRYPTION_FAILED); return 0; } @@ -583,7 +568,8 @@ static int ssl_encrypt_ticket_with_method(SSL *ssl, CBB *out, return 1; } -int ssl_encrypt_ticket(SSL *ssl, CBB *out, const SSL_SESSION *session) { +int ssl_encrypt_ticket(SSL_HANDSHAKE *hs, CBB *out, + const SSL_SESSION *session) { // Serialize the SSL_SESSION to be encoded into the ticket. uint8_t *session_buf = NULL; size_t session_len; @@ -592,25 +578,25 @@ int ssl_encrypt_ticket(SSL *ssl, CBB *out, const SSL_SESSION *session) { } int ret = 0; - if (ssl->session_ctx->ticket_aead_method) { - ret = ssl_encrypt_ticket_with_method(ssl, out, session_buf, session_len); + if (hs->ssl->session_ctx->ticket_aead_method) { + ret = ssl_encrypt_ticket_with_method(hs, out, session_buf, session_len); } else { - ret = - ssl_encrypt_ticket_with_cipher_ctx(ssl, out, session_buf, session_len); + ret = ssl_encrypt_ticket_with_cipher_ctx(hs, out, session_buf, session_len); } OPENSSL_free(session_buf); return ret; } -int ssl_session_is_context_valid(const SSL *ssl, const SSL_SESSION *session) { +int ssl_session_is_context_valid(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session) { if (session == NULL) { return 0; } - return session->sid_ctx_length == ssl->cert->sid_ctx_length && - OPENSSL_memcmp(session->sid_ctx, ssl->cert->sid_ctx, - ssl->cert->sid_ctx_length) == 0; + return session->sid_ctx_length == hs->config->cert->sid_ctx_length && + OPENSSL_memcmp(session->sid_ctx, hs->config->cert->sid_ctx, + hs->config->cert->sid_ctx_length) == 0; } int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session) { @@ -632,34 +618,35 @@ int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session) { int ssl_session_is_resumable(const SSL_HANDSHAKE *hs, const SSL_SESSION *session) { const SSL *const ssl = hs->ssl; - return ssl_session_is_context_valid(ssl, session) && + return ssl_session_is_context_valid(hs, session) && // The session must have been created by the same type of end point as // we're now using it with. ssl->server == session->is_server && // The session must not be expired. ssl_session_is_time_valid(ssl, session) && /* Only resume if the session's version matches the negotiated - * version. */ + * version. */ ssl->version == session->ssl_version && // Only resume if the session's cipher matches the negotiated one. hs->new_cipher == session->cipher && // If the session contains a client certificate (either the full // certificate or just the hash) then require that the form of the // certificate matches the current configuration. - ((sk_CRYPTO_BUFFER_num(session->certs) == 0 && + ((sk_CRYPTO_BUFFER_num(session->certs.get()) == 0 && !session->peer_sha256_valid) || session->peer_sha256_valid == - ssl->retain_only_sha256_of_client_certs); + hs->config->retain_only_sha256_of_client_certs); } // ssl_lookup_session looks up |session_id| in the session cache and sets // |*out_session| to an |SSL_SESSION| object if found. static enum ssl_hs_wait_t ssl_lookup_session( - SSL *ssl, UniquePtr *out_session, const uint8_t *session_id, - size_t session_id_len) { + SSL_HANDSHAKE *hs, UniquePtr *out_session, + Span session_id) { + SSL *const ssl = hs->ssl; out_session->reset(); - if (session_id_len == 0 || session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + if (session_id.empty() || session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { return ssl_hs_ok; } @@ -667,32 +654,26 @@ static enum ssl_hs_wait_t ssl_lookup_session( // Try the internal cache, if it exists. if (!(ssl->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) { - SSL_SESSION data; - data.ssl_version = ssl->version; - data.session_id_length = session_id_len; - OPENSSL_memcpy(data.session_id, session_id, session_id_len); - + uint32_t hash = ssl_hash_session_id(session_id); + auto cmp = [](const void *key, const SSL_SESSION *sess) -> int { + Span key_id = + *reinterpret_cast *>(key); + Span sess_id = + MakeConstSpan(sess->session_id, sess->session_id_length); + return key_id == sess_id ? 0 : 1; + }; MutexReadLock lock(&ssl->session_ctx->lock); - session.reset(lh_SSL_SESSION_retrieve(ssl->session_ctx->sessions, &data)); - if (session) { - // |lh_SSL_SESSION_retrieve| returns a non-owning pointer. - SSL_SESSION_up_ref(session.get()); - } + // |lh_SSL_SESSION_retrieve_key| returns a non-owning pointer. + session = UpRef(lh_SSL_SESSION_retrieve_key(ssl->session_ctx->sessions, + &session_id, hash, cmp)); // TODO(davidben): This should probably move it to the front of the list. } // Fall back to the external cache, if it exists. - if (!session && (ssl->session_ctx->get_session_cb != nullptr || - ssl->session_ctx->get_session_cb_legacy != nullptr)) { + if (!session && ssl->session_ctx->get_session_cb != nullptr) { int copy = 1; - if (ssl->session_ctx->get_session_cb != nullptr) { - session.reset(ssl->session_ctx->get_session_cb(ssl, session_id, - session_id_len, ©)); - } else { - session.reset(ssl->session_ctx->get_session_cb_legacy( - ssl, const_cast(session_id), session_id_len, ©)); - } - + session.reset(ssl->session_ctx->get_session_cb(ssl, session_id.data(), + session_id.size(), ©)); if (!session) { return ssl_hs_ok; } @@ -713,13 +694,13 @@ static enum ssl_hs_wait_t ssl_lookup_session( // Add the externally cached session to the internal cache if necessary. if (!(ssl->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_STORE)) { - SSL_CTX_add_session(ssl->session_ctx, session.get()); + SSL_CTX_add_session(ssl->session_ctx.get(), session.get()); } } if (session && !ssl_session_is_time_valid(ssl, session.get())) { // The session was from the cache, so remove it. - SSL_CTX_remove_session(ssl->session_ctx, session.get()); + SSL_CTX_remove_session(ssl->session_ctx.get(), session.get()); session.reset(); } @@ -727,28 +708,26 @@ static enum ssl_hs_wait_t ssl_lookup_session( return ssl_hs_ok; } -enum ssl_hs_wait_t ssl_get_prev_session(SSL *ssl, +enum ssl_hs_wait_t ssl_get_prev_session(SSL_HANDSHAKE *hs, UniquePtr *out_session, bool *out_tickets_supported, bool *out_renew_ticket, const SSL_CLIENT_HELLO *client_hello) { // This is used only by servers. - assert(ssl->server); + assert(hs->ssl->server); UniquePtr session; bool renew_ticket = false; // If tickets are disabled, always behave as if no tickets are present. - const uint8_t *ticket = NULL; - size_t ticket_len = 0; + CBS ticket; const bool tickets_supported = - !(SSL_get_options(ssl) & SSL_OP_NO_TICKET) && - ssl->version > SSL3_VERSION && - SSL_early_callback_ctx_extension_get( - client_hello, TLSEXT_TYPE_session_ticket, &ticket, &ticket_len); - if (tickets_supported && ticket_len > 0) { - switch (ssl_process_ticket(ssl, &session, &renew_ticket, ticket, ticket_len, - client_hello->session_id, - client_hello->session_id_len)) { + !(SSL_get_options(hs->ssl) & SSL_OP_NO_TICKET) && + ssl_client_hello_get_extension(client_hello, &ticket, + TLSEXT_TYPE_session_ticket); + if (tickets_supported && CBS_len(&ticket) != 0) { + switch (ssl_process_ticket(hs, &session, &renew_ticket, ticket, + MakeConstSpan(client_hello->session_id, + client_hello->session_id_len))) { case ssl_ticket_aead_success: break; case ssl_ticket_aead_ignore_ticket: @@ -762,7 +741,8 @@ enum ssl_hs_wait_t ssl_get_prev_session(SSL *ssl, } else { // The client didn't send a ticket, so the session ID is a real ID. enum ssl_hs_wait_t lookup_ret = ssl_lookup_session( - ssl, &session, client_hello->session_id, client_hello->session_id_len); + hs, &session, + MakeConstSpan(client_hello->session_id, client_hello->session_id_len)); if (lookup_ret != ssl_hs_ok) { return lookup_ret; } @@ -805,15 +785,11 @@ static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *session, int lock) { } void ssl_set_session(SSL *ssl, SSL_SESSION *session) { - if (ssl->session == session) { + if (ssl->session.get() == session) { return; } - SSL_SESSION_free(ssl->session); - ssl->session = session; - if (session != NULL) { - SSL_SESSION_up_ref(session); - } + ssl->session = UpRef(session); } // locked by SSL_CTX in the calling function @@ -863,10 +839,26 @@ static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *session) { } } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; +ssl_session_st::ssl_session_st(const SSL_X509_METHOD *method) + : x509_method(method), + extended_master_secret(false), + peer_sha256_valid(false), + not_resumable(false), + ticket_age_add_valid(false), + is_server(false) { + CRYPTO_new_ex_data(&ex_data); + time = ::time(nullptr); +} + +ssl_session_st::~ssl_session_st() { + CRYPTO_free_ex_data(&g_ex_data_class, this, &ex_data); + x509_method->session_clear(this); +} + SSL_SESSION *SSL_SESSION_new(const SSL_CTX *ctx) { return ssl_session_new(ctx->x509_method).release(); } @@ -882,17 +874,7 @@ void SSL_SESSION_free(SSL_SESSION *session) { return; } - CRYPTO_free_ex_data(&g_ex_data_class, session, &session->ex_data); - - OPENSSL_cleanse(session->master_key, sizeof(session->master_key)); - OPENSSL_cleanse(session->session_id, sizeof(session->session_id)); - sk_CRYPTO_BUFFER_pop_free(session->certs, CRYPTO_BUFFER_free); - session->x509_method->session_clear(session); - OPENSSL_free(session->tlsext_tick); - CRYPTO_BUFFER_free(session->signed_cert_timestamp_list); - CRYPTO_BUFFER_free(session->ocsp_response); - OPENSSL_free(session->psk_identity); - OPENSSL_free(session->early_alpn); + session->~ssl_session_st(); OPENSSL_free(session); } @@ -904,6 +886,19 @@ const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, return session->session_id; } +int SSL_SESSION_set1_id(SSL_SESSION *session, const uint8_t *sid, + size_t sid_len) { + if (sid_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_TOO_LONG); + return 0; + } + + // Use memmove in case someone passes in the output of |SSL_SESSION_get_id|. + OPENSSL_memmove(session->session_id, sid, sid_len); + session->session_id_length = sid_len; + return 1; +} + uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session) { return session->timeout; } @@ -920,6 +915,34 @@ X509 *SSL_SESSION_get0_peer(const SSL_SESSION *session) { return session->x509_peer; } +const STACK_OF(CRYPTO_BUFFER) * + SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session) { + return session->certs.get(); +} + +void SSL_SESSION_get0_signed_cert_timestamp_list(const SSL_SESSION *session, + const uint8_t **out, + size_t *out_len) { + if (session->signed_cert_timestamp_list) { + *out = CRYPTO_BUFFER_data(session->signed_cert_timestamp_list.get()); + *out_len = CRYPTO_BUFFER_len(session->signed_cert_timestamp_list.get()); + } else { + *out = nullptr; + *out_len = 0; + } +} + +void SSL_SESSION_get0_ocsp_response(const SSL_SESSION *session, + const uint8_t **out, size_t *out_len) { + if (session->ocsp_response) { + *out = CRYPTO_BUFFER_data(session->ocsp_response.get()); + *out_len = CRYPTO_BUFFER_len(session->ocsp_response.get()); + } else { + *out = nullptr; + *out_len = 0; + } +} + size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, uint8_t *out, size_t max_out) { // TODO(davidben): Fix master_key_length's type and remove these casts. @@ -952,6 +975,14 @@ uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout) { return 1; } +const uint8_t *SSL_SESSION_get0_id_context(const SSL_SESSION *session, + unsigned *out_len) { + if (out_len != NULL) { + *out_len = session->sid_ctx_length; + } + return session->sid_ctx; +} + int SSL_SESSION_set1_id_context(SSL_SESSION *session, const uint8_t *sid_ctx, size_t sid_ctx_len) { if (sid_ctx_len > sizeof(session->sid_ctx)) { @@ -975,19 +1006,48 @@ int SSL_SESSION_is_resumable(const SSL_SESSION *session) { } int SSL_SESSION_has_ticket(const SSL_SESSION *session) { - return session->tlsext_ticklen > 0; + return !session->ticket.empty(); } void SSL_SESSION_get0_ticket(const SSL_SESSION *session, const uint8_t **out_ticket, size_t *out_len) { if (out_ticket != nullptr) { - *out_ticket = session->tlsext_tick; + *out_ticket = session->ticket.data(); } - *out_len = session->tlsext_ticklen; + *out_len = session->ticket.size(); +} + +int SSL_SESSION_set_ticket(SSL_SESSION *session, const uint8_t *ticket, + size_t ticket_len) { + return session->ticket.CopyFrom(MakeConstSpan(ticket, ticket_len)); } uint32_t SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session) { - return session->tlsext_tick_lifetime_hint; + return session->ticket_lifetime_hint; +} + +const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *session) { + return session->cipher; +} + +int SSL_SESSION_has_peer_sha256(const SSL_SESSION *session) { + return session->peer_sha256_valid; +} + +void SSL_SESSION_get0_peer_sha256(const SSL_SESSION *session, + const uint8_t **out_ptr, size_t *out_len) { + if (session->peer_sha256_valid) { + *out_ptr = session->peer_sha256; + *out_len = sizeof(session->peer_sha256); + } else { + *out_ptr = nullptr; + *out_len = 0; + } +} + +int SSL_SESSION_early_data_capable(const SSL_SESSION *session) { + return ssl_session_protocol_version(session) >= TLS1_3_VERSION && + session->ticket_max_early_data != 0; } SSL_SESSION *SSL_magic_pending_session_ptr(void) { @@ -1008,7 +1068,7 @@ SSL_SESSION *SSL_get_session(const SSL *ssl) { if (hs->new_session) { return hs->new_session.get(); } - return ssl->session; + return ssl->session.get(); } SSL_SESSION *SSL_get1_session(SSL *ssl) { @@ -1042,8 +1102,7 @@ void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, int idx) { int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session) { // Although |session| is inserted into two structures (a doubly-linked list // and the hash table), |ctx| only takes one reference. - SSL_SESSION_up_ref(session); - UniquePtr owned_session(session); + UniquePtr owned_session = UpRef(session); SSL_SESSION *old_session; MutexWriteLock lock(&ctx->lock); @@ -1188,12 +1247,6 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, ctx->get_session_cb = cb; } -void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, - SSL_SESSION *(*cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)) { - ctx->get_session_cb_legacy = cb; -} - SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, const uint8_t *id, int id_len, diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_session.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc.grpc_back similarity index 77% rename from Pods/BoringSSL-GRPC/ssl/ssl_session.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc.grpc_back index 34e7b3174..77d3f4c2e 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_session.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_session.cc.grpc_back @@ -151,7 +151,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // The address of this is a magic value, a pointer to which is returned by // SSL_magic_pending_session_ptr(). It allows a session callback to indicate @@ -166,22 +166,27 @@ static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *session); static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *session, int lock); UniquePtr ssl_session_new(const SSL_X509_METHOD *x509_method) { - UniquePtr session( - (SSL_SESSION *)OPENSSL_malloc(sizeof(SSL_SESSION))); - if (!session) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; + return MakeUnique(x509_method); +} + +uint32_t ssl_hash_session_id(Span session_id) { + // Take the first four bytes of |session_id|. Session IDs are generated by the + // server randomly, so we can assume even using the first four bytes results + // in a good distribution. + uint8_t tmp_storage[sizeof(uint32_t)]; + if (session_id.size() < sizeof(tmp_storage)) { + OPENSSL_memset(tmp_storage, 0, sizeof(tmp_storage)); + OPENSSL_memcpy(tmp_storage, session_id.data(), session_id.size()); + session_id = tmp_storage; } - OPENSSL_memset(session.get(), 0, sizeof(SSL_SESSION)); - session->x509_method = x509_method; - session->verify_result = X509_V_ERR_INVALID_CALL; - session->references = 1; - session->timeout = SSL_DEFAULT_SESSION_TIMEOUT; - session->auth_timeout = SSL_DEFAULT_SESSION_TIMEOUT; - session->time = time(NULL); - CRYPTO_new_ex_data(&session->ex_data); - return session; + uint32_t hash = + ((uint32_t)session_id[0]) | + ((uint32_t)session_id[1] << 8) | + ((uint32_t)session_id[2] << 16) | + ((uint32_t)session_id[3] << 24); + + return hash; } UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { @@ -202,24 +207,23 @@ UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { new_session->cipher = session->cipher; // Copy authentication state. - if (session->psk_identity != NULL) { - new_session->psk_identity = BUF_strdup(session->psk_identity); - if (new_session->psk_identity == NULL) { + if (session->psk_identity != nullptr) { + new_session->psk_identity.reset( + OPENSSL_strdup(session->psk_identity.get())); + if (new_session->psk_identity == nullptr) { return nullptr; } } - if (session->certs != NULL) { - new_session->certs = sk_CRYPTO_BUFFER_new_null(); - if (new_session->certs == NULL) { + if (session->certs != nullptr) { + auto buf_up_ref = [](CRYPTO_BUFFER *buf) { + CRYPTO_BUFFER_up_ref(buf); + return buf; + }; + new_session->certs.reset(sk_CRYPTO_BUFFER_deep_copy( + session->certs.get(), buf_up_ref, CRYPTO_BUFFER_free)); + if (new_session->certs == nullptr) { return nullptr; } - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(session->certs); i++) { - CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(session->certs, i); - if (!sk_CRYPTO_BUFFER_push(new_session->certs, buffer)) { - return nullptr; - } - CRYPTO_BUFFER_up_ref(buffer); - } } if (!session->x509_method->session_dup(new_session.get(), session)) { @@ -228,16 +232,9 @@ UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { new_session->verify_result = session->verify_result; - if (session->ocsp_response != NULL) { - new_session->ocsp_response = session->ocsp_response; - CRYPTO_BUFFER_up_ref(new_session->ocsp_response); - } - - if (session->signed_cert_timestamp_list != NULL) { - new_session->signed_cert_timestamp_list = - session->signed_cert_timestamp_list; - CRYPTO_BUFFER_up_ref(new_session->signed_cert_timestamp_list); - } + new_session->ocsp_response = UpRef(session->ocsp_response); + new_session->signed_cert_timestamp_list = + UpRef(session->signed_cert_timestamp_list); OPENSSL_memcpy(new_session->peer_sha256, session->peer_sha256, SHA256_DIGEST_LENGTH); @@ -262,36 +259,25 @@ UniquePtr SSL_SESSION_dup(SSL_SESSION *session, int dup_flags) { session->original_handshake_hash_len); new_session->original_handshake_hash_len = session->original_handshake_hash_len; - new_session->tlsext_tick_lifetime_hint = session->tlsext_tick_lifetime_hint; + new_session->ticket_lifetime_hint = session->ticket_lifetime_hint; new_session->ticket_age_add = session->ticket_age_add; new_session->ticket_max_early_data = session->ticket_max_early_data; new_session->extended_master_secret = session->extended_master_secret; - if (session->early_alpn != NULL) { - new_session->early_alpn = - (uint8_t *)BUF_memdup(session->early_alpn, session->early_alpn_len); - if (new_session->early_alpn == NULL) { - return nullptr; - } + if (!new_session->early_alpn.CopyFrom(session->early_alpn)) { + return nullptr; } - new_session->early_alpn_len = session->early_alpn_len; } // Copy the ticket. - if (dup_flags & SSL_SESSION_INCLUDE_TICKET) { - if (session->tlsext_tick != NULL) { - new_session->tlsext_tick = - (uint8_t *)BUF_memdup(session->tlsext_tick, session->tlsext_ticklen); - if (new_session->tlsext_tick == NULL) { - return nullptr; - } - } - new_session->tlsext_ticklen = session->tlsext_ticklen; + if (dup_flags & SSL_SESSION_INCLUDE_TICKET && + !new_session->ticket.CopyFrom(session->ticket)) { + return nullptr; } // The new_session does not get a copy of the ex_data. - new_session->not_resumable = 1; + new_session->not_resumable = true; return new_session; } @@ -405,16 +391,16 @@ int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server) { session->session_id_length = 0; } - if (ssl->cert->sid_ctx_length > sizeof(session->sid_ctx)) { + if (hs->config->cert->sid_ctx_length > sizeof(session->sid_ctx)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return 0; } - OPENSSL_memcpy(session->sid_ctx, ssl->cert->sid_ctx, - ssl->cert->sid_ctx_length); - session->sid_ctx_length = ssl->cert->sid_ctx_length; + OPENSSL_memcpy(session->sid_ctx, hs->config->cert->sid_ctx, + hs->config->cert->sid_ctx_length); + session->sid_ctx_length = hs->config->cert->sid_ctx_length; // The session is marked not resumable until it is completely filled in. - session->not_resumable = 1; + session->not_resumable = true; session->verify_result = X509_V_ERR_INVALID_CALL; hs->new_session = std::move(session); @@ -429,53 +415,50 @@ int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx) { // Avoid acquiring a write lock in the common case (i.e. a non-default key // is used or the default keys have not expired yet). MutexReadLock lock(&ctx->lock); - if (ctx->tlsext_ticket_key_current && - (ctx->tlsext_ticket_key_current->next_rotation_tv_sec == 0 || - ctx->tlsext_ticket_key_current->next_rotation_tv_sec > now.tv_sec) && - (!ctx->tlsext_ticket_key_prev || - ctx->tlsext_ticket_key_prev->next_rotation_tv_sec > now.tv_sec)) { + if (ctx->ticket_key_current && + (ctx->ticket_key_current->next_rotation_tv_sec == 0 || + ctx->ticket_key_current->next_rotation_tv_sec > now.tv_sec) && + (!ctx->ticket_key_prev || + ctx->ticket_key_prev->next_rotation_tv_sec > now.tv_sec)) { return 1; } } MutexWriteLock lock(&ctx->lock); - if (!ctx->tlsext_ticket_key_current || - (ctx->tlsext_ticket_key_current->next_rotation_tv_sec != 0 && - ctx->tlsext_ticket_key_current->next_rotation_tv_sec <= now.tv_sec)) { + if (!ctx->ticket_key_current || + (ctx->ticket_key_current->next_rotation_tv_sec != 0 && + ctx->ticket_key_current->next_rotation_tv_sec <= now.tv_sec)) { // The current key has not been initialized or it is expired. - auto new_key = bssl::MakeUnique(); + auto new_key = bssl::MakeUnique(); if (!new_key) { return 0; } - OPENSSL_memset(new_key.get(), 0, sizeof(struct tlsext_ticket_key)); - if (ctx->tlsext_ticket_key_current) { + RAND_bytes(new_key->name, 16); + RAND_bytes(new_key->hmac_key, 16); + RAND_bytes(new_key->aes_key, 16); + new_key->next_rotation_tv_sec = + now.tv_sec + SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; + if (ctx->ticket_key_current) { // The current key expired. Rotate it to prev and bump up its rotation // timestamp. Note that even with the new rotation time it may still be - // expired and get droppped below. - ctx->tlsext_ticket_key_current->next_rotation_tv_sec += + // expired and get dropped below. + ctx->ticket_key_current->next_rotation_tv_sec += SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; - OPENSSL_free(ctx->tlsext_ticket_key_prev); - ctx->tlsext_ticket_key_prev = ctx->tlsext_ticket_key_current; + ctx->ticket_key_prev = std::move(ctx->ticket_key_current); } - ctx->tlsext_ticket_key_current = new_key.release(); - RAND_bytes(ctx->tlsext_ticket_key_current->name, 16); - RAND_bytes(ctx->tlsext_ticket_key_current->hmac_key, 16); - RAND_bytes(ctx->tlsext_ticket_key_current->aes_key, 16); - ctx->tlsext_ticket_key_current->next_rotation_tv_sec = - now.tv_sec + SSL_DEFAULT_TICKET_KEY_ROTATION_INTERVAL; + ctx->ticket_key_current = std::move(new_key); } // Drop an expired prev key. - if (ctx->tlsext_ticket_key_prev && - ctx->tlsext_ticket_key_prev->next_rotation_tv_sec <= now.tv_sec) { - OPENSSL_free(ctx->tlsext_ticket_key_prev); - ctx->tlsext_ticket_key_prev = nullptr; + if (ctx->ticket_key_prev && + ctx->ticket_key_prev->next_rotation_tv_sec <= now.tv_sec) { + ctx->ticket_key_prev.reset(); } return 1; } -static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, +static int ssl_encrypt_ticket_with_cipher_ctx(SSL_HANDSHAKE *hs, CBB *out, const uint8_t *session_buf, size_t session_len) { ScopedEVP_CIPHER_CTX ctx; @@ -493,12 +476,12 @@ static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, // Initialize HMAC and cipher contexts. If callback present it does all the // work otherwise use generated values from parent ctx. - SSL_CTX *tctx = ssl->session_ctx; + SSL_CTX *tctx = hs->ssl->session_ctx.get(); uint8_t iv[EVP_MAX_IV_LENGTH]; uint8_t key_name[16]; - if (tctx->tlsext_ticket_key_cb != NULL) { - if (tctx->tlsext_ticket_key_cb(ssl, key_name, iv, ctx.get(), hctx.get(), - 1 /* encrypt */) < 0) { + if (tctx->ticket_key_cb != NULL) { + if (tctx->ticket_key_cb(hs->ssl, key_name, iv, ctx.get(), hctx.get(), + 1 /* encrypt */) < 0) { return 0; } } else { @@ -509,12 +492,12 @@ static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, MutexReadLock lock(&tctx->lock); if (!RAND_bytes(iv, 16) || !EVP_EncryptInit_ex(ctx.get(), EVP_aes_128_cbc(), NULL, - tctx->tlsext_ticket_key_current->aes_key, iv) || - !HMAC_Init_ex(hctx.get(), tctx->tlsext_ticket_key_current->hmac_key, 16, + tctx->ticket_key_current->aes_key, iv) || + !HMAC_Init_ex(hctx.get(), tctx->ticket_key_current->hmac_key, 16, tlsext_tick_md(), NULL)) { return 0; } - OPENSSL_memcpy(key_name, tctx->tlsext_ticket_key_current->name, 16); + OPENSSL_memcpy(key_name, tctx->ticket_key_current->name, 16); } uint8_t *ptr; @@ -554,9 +537,10 @@ static int ssl_encrypt_ticket_with_cipher_ctx(SSL *ssl, CBB *out, return 1; } -static int ssl_encrypt_ticket_with_method(SSL *ssl, CBB *out, +static int ssl_encrypt_ticket_with_method(SSL_HANDSHAKE *hs, CBB *out, const uint8_t *session_buf, size_t session_len) { + SSL *const ssl = hs->ssl; const SSL_TICKET_AEAD_METHOD *method = ssl->session_ctx->ticket_aead_method; const size_t max_overhead = method->max_overhead(ssl); const size_t max_out = session_len + max_overhead; @@ -571,7 +555,8 @@ static int ssl_encrypt_ticket_with_method(SSL *ssl, CBB *out, } size_t out_len; - if (!method->seal(ssl, ptr, &out_len, max_out, session_buf, session_len)) { + if (!method->seal(ssl, ptr, &out_len, max_out, session_buf, + session_len)) { OPENSSL_PUT_ERROR(SSL, SSL_R_TICKET_ENCRYPTION_FAILED); return 0; } @@ -583,7 +568,8 @@ static int ssl_encrypt_ticket_with_method(SSL *ssl, CBB *out, return 1; } -int ssl_encrypt_ticket(SSL *ssl, CBB *out, const SSL_SESSION *session) { +int ssl_encrypt_ticket(SSL_HANDSHAKE *hs, CBB *out, + const SSL_SESSION *session) { // Serialize the SSL_SESSION to be encoded into the ticket. uint8_t *session_buf = NULL; size_t session_len; @@ -592,25 +578,25 @@ int ssl_encrypt_ticket(SSL *ssl, CBB *out, const SSL_SESSION *session) { } int ret = 0; - if (ssl->session_ctx->ticket_aead_method) { - ret = ssl_encrypt_ticket_with_method(ssl, out, session_buf, session_len); + if (hs->ssl->session_ctx->ticket_aead_method) { + ret = ssl_encrypt_ticket_with_method(hs, out, session_buf, session_len); } else { - ret = - ssl_encrypt_ticket_with_cipher_ctx(ssl, out, session_buf, session_len); + ret = ssl_encrypt_ticket_with_cipher_ctx(hs, out, session_buf, session_len); } OPENSSL_free(session_buf); return ret; } -int ssl_session_is_context_valid(const SSL *ssl, const SSL_SESSION *session) { +int ssl_session_is_context_valid(const SSL_HANDSHAKE *hs, + const SSL_SESSION *session) { if (session == NULL) { return 0; } - return session->sid_ctx_length == ssl->cert->sid_ctx_length && - OPENSSL_memcmp(session->sid_ctx, ssl->cert->sid_ctx, - ssl->cert->sid_ctx_length) == 0; + return session->sid_ctx_length == hs->config->cert->sid_ctx_length && + OPENSSL_memcmp(session->sid_ctx, hs->config->cert->sid_ctx, + hs->config->cert->sid_ctx_length) == 0; } int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session) { @@ -632,34 +618,35 @@ int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session) { int ssl_session_is_resumable(const SSL_HANDSHAKE *hs, const SSL_SESSION *session) { const SSL *const ssl = hs->ssl; - return ssl_session_is_context_valid(ssl, session) && + return ssl_session_is_context_valid(hs, session) && // The session must have been created by the same type of end point as // we're now using it with. ssl->server == session->is_server && // The session must not be expired. ssl_session_is_time_valid(ssl, session) && /* Only resume if the session's version matches the negotiated - * version. */ + * version. */ ssl->version == session->ssl_version && // Only resume if the session's cipher matches the negotiated one. hs->new_cipher == session->cipher && // If the session contains a client certificate (either the full // certificate or just the hash) then require that the form of the // certificate matches the current configuration. - ((sk_CRYPTO_BUFFER_num(session->certs) == 0 && + ((sk_CRYPTO_BUFFER_num(session->certs.get()) == 0 && !session->peer_sha256_valid) || session->peer_sha256_valid == - ssl->retain_only_sha256_of_client_certs); + hs->config->retain_only_sha256_of_client_certs); } // ssl_lookup_session looks up |session_id| in the session cache and sets // |*out_session| to an |SSL_SESSION| object if found. static enum ssl_hs_wait_t ssl_lookup_session( - SSL *ssl, UniquePtr *out_session, const uint8_t *session_id, - size_t session_id_len) { + SSL_HANDSHAKE *hs, UniquePtr *out_session, + Span session_id) { + SSL *const ssl = hs->ssl; out_session->reset(); - if (session_id_len == 0 || session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + if (session_id.empty() || session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { return ssl_hs_ok; } @@ -667,32 +654,26 @@ static enum ssl_hs_wait_t ssl_lookup_session( // Try the internal cache, if it exists. if (!(ssl->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_LOOKUP)) { - SSL_SESSION data; - data.ssl_version = ssl->version; - data.session_id_length = session_id_len; - OPENSSL_memcpy(data.session_id, session_id, session_id_len); - + uint32_t hash = ssl_hash_session_id(session_id); + auto cmp = [](const void *key, const SSL_SESSION *sess) -> int { + Span key_id = + *reinterpret_cast *>(key); + Span sess_id = + MakeConstSpan(sess->session_id, sess->session_id_length); + return key_id == sess_id ? 0 : 1; + }; MutexReadLock lock(&ssl->session_ctx->lock); - session.reset(lh_SSL_SESSION_retrieve(ssl->session_ctx->sessions, &data)); - if (session) { - // |lh_SSL_SESSION_retrieve| returns a non-owning pointer. - SSL_SESSION_up_ref(session.get()); - } + // |lh_SSL_SESSION_retrieve_key| returns a non-owning pointer. + session = UpRef(lh_SSL_SESSION_retrieve_key(ssl->session_ctx->sessions, + &session_id, hash, cmp)); // TODO(davidben): This should probably move it to the front of the list. } // Fall back to the external cache, if it exists. - if (!session && (ssl->session_ctx->get_session_cb != nullptr || - ssl->session_ctx->get_session_cb_legacy != nullptr)) { + if (!session && ssl->session_ctx->get_session_cb != nullptr) { int copy = 1; - if (ssl->session_ctx->get_session_cb != nullptr) { - session.reset(ssl->session_ctx->get_session_cb(ssl, session_id, - session_id_len, ©)); - } else { - session.reset(ssl->session_ctx->get_session_cb_legacy( - ssl, const_cast(session_id), session_id_len, ©)); - } - + session.reset(ssl->session_ctx->get_session_cb(ssl, session_id.data(), + session_id.size(), ©)); if (!session) { return ssl_hs_ok; } @@ -713,13 +694,13 @@ static enum ssl_hs_wait_t ssl_lookup_session( // Add the externally cached session to the internal cache if necessary. if (!(ssl->session_ctx->session_cache_mode & SSL_SESS_CACHE_NO_INTERNAL_STORE)) { - SSL_CTX_add_session(ssl->session_ctx, session.get()); + SSL_CTX_add_session(ssl->session_ctx.get(), session.get()); } } if (session && !ssl_session_is_time_valid(ssl, session.get())) { // The session was from the cache, so remove it. - SSL_CTX_remove_session(ssl->session_ctx, session.get()); + SSL_CTX_remove_session(ssl->session_ctx.get(), session.get()); session.reset(); } @@ -727,28 +708,26 @@ static enum ssl_hs_wait_t ssl_lookup_session( return ssl_hs_ok; } -enum ssl_hs_wait_t ssl_get_prev_session(SSL *ssl, +enum ssl_hs_wait_t ssl_get_prev_session(SSL_HANDSHAKE *hs, UniquePtr *out_session, bool *out_tickets_supported, bool *out_renew_ticket, const SSL_CLIENT_HELLO *client_hello) { // This is used only by servers. - assert(ssl->server); + assert(hs->ssl->server); UniquePtr session; bool renew_ticket = false; // If tickets are disabled, always behave as if no tickets are present. - const uint8_t *ticket = NULL; - size_t ticket_len = 0; + CBS ticket; const bool tickets_supported = - !(SSL_get_options(ssl) & SSL_OP_NO_TICKET) && - ssl->version > SSL3_VERSION && - SSL_early_callback_ctx_extension_get( - client_hello, TLSEXT_TYPE_session_ticket, &ticket, &ticket_len); - if (tickets_supported && ticket_len > 0) { - switch (ssl_process_ticket(ssl, &session, &renew_ticket, ticket, ticket_len, - client_hello->session_id, - client_hello->session_id_len)) { + !(SSL_get_options(hs->ssl) & SSL_OP_NO_TICKET) && + ssl_client_hello_get_extension(client_hello, &ticket, + TLSEXT_TYPE_session_ticket); + if (tickets_supported && CBS_len(&ticket) != 0) { + switch (ssl_process_ticket(hs, &session, &renew_ticket, ticket, + MakeConstSpan(client_hello->session_id, + client_hello->session_id_len))) { case ssl_ticket_aead_success: break; case ssl_ticket_aead_ignore_ticket: @@ -762,7 +741,8 @@ enum ssl_hs_wait_t ssl_get_prev_session(SSL *ssl, } else { // The client didn't send a ticket, so the session ID is a real ID. enum ssl_hs_wait_t lookup_ret = ssl_lookup_session( - ssl, &session, client_hello->session_id, client_hello->session_id_len); + hs, &session, + MakeConstSpan(client_hello->session_id, client_hello->session_id_len)); if (lookup_ret != ssl_hs_ok) { return lookup_ret; } @@ -805,15 +785,11 @@ static int remove_session_lock(SSL_CTX *ctx, SSL_SESSION *session, int lock) { } void ssl_set_session(SSL *ssl, SSL_SESSION *session) { - if (ssl->session == session) { + if (ssl->session.get() == session) { return; } - SSL_SESSION_free(ssl->session); - ssl->session = session; - if (session != NULL) { - SSL_SESSION_up_ref(session); - } + ssl->session = UpRef(session); } // locked by SSL_CTX in the calling function @@ -863,10 +839,26 @@ static void SSL_SESSION_list_add(SSL_CTX *ctx, SSL_SESSION *session) { } } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; +ssl_session_st::ssl_session_st(const SSL_X509_METHOD *method) + : x509_method(method), + extended_master_secret(false), + peer_sha256_valid(false), + not_resumable(false), + ticket_age_add_valid(false), + is_server(false) { + CRYPTO_new_ex_data(&ex_data); + time = ::time(nullptr); +} + +ssl_session_st::~ssl_session_st() { + CRYPTO_free_ex_data(&g_ex_data_class, this, &ex_data); + x509_method->session_clear(this); +} + SSL_SESSION *SSL_SESSION_new(const SSL_CTX *ctx) { return ssl_session_new(ctx->x509_method).release(); } @@ -882,17 +874,7 @@ void SSL_SESSION_free(SSL_SESSION *session) { return; } - CRYPTO_free_ex_data(&g_ex_data_class, session, &session->ex_data); - - OPENSSL_cleanse(session->master_key, sizeof(session->master_key)); - OPENSSL_cleanse(session->session_id, sizeof(session->session_id)); - sk_CRYPTO_BUFFER_pop_free(session->certs, CRYPTO_BUFFER_free); - session->x509_method->session_clear(session); - OPENSSL_free(session->tlsext_tick); - CRYPTO_BUFFER_free(session->signed_cert_timestamp_list); - CRYPTO_BUFFER_free(session->ocsp_response); - OPENSSL_free(session->psk_identity); - OPENSSL_free(session->early_alpn); + session->~ssl_session_st(); OPENSSL_free(session); } @@ -904,6 +886,19 @@ const uint8_t *SSL_SESSION_get_id(const SSL_SESSION *session, return session->session_id; } +int SSL_SESSION_set1_id(SSL_SESSION *session, const uint8_t *sid, + size_t sid_len) { + if (sid_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_TOO_LONG); + return 0; + } + + // Use memmove in case someone passes in the output of |SSL_SESSION_get_id|. + OPENSSL_memmove(session->session_id, sid, sid_len); + session->session_id_length = sid_len; + return 1; +} + uint32_t SSL_SESSION_get_timeout(const SSL_SESSION *session) { return session->timeout; } @@ -920,6 +915,34 @@ X509 *SSL_SESSION_get0_peer(const SSL_SESSION *session) { return session->x509_peer; } +const STACK_OF(CRYPTO_BUFFER) * + SSL_SESSION_get0_peer_certificates(const SSL_SESSION *session) { + return session->certs.get(); +} + +void SSL_SESSION_get0_signed_cert_timestamp_list(const SSL_SESSION *session, + const uint8_t **out, + size_t *out_len) { + if (session->signed_cert_timestamp_list) { + *out = CRYPTO_BUFFER_data(session->signed_cert_timestamp_list.get()); + *out_len = CRYPTO_BUFFER_len(session->signed_cert_timestamp_list.get()); + } else { + *out = nullptr; + *out_len = 0; + } +} + +void SSL_SESSION_get0_ocsp_response(const SSL_SESSION *session, + const uint8_t **out, size_t *out_len) { + if (session->ocsp_response) { + *out = CRYPTO_BUFFER_data(session->ocsp_response.get()); + *out_len = CRYPTO_BUFFER_len(session->ocsp_response.get()); + } else { + *out = nullptr; + *out_len = 0; + } +} + size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, uint8_t *out, size_t max_out) { // TODO(davidben): Fix master_key_length's type and remove these casts. @@ -952,6 +975,14 @@ uint32_t SSL_SESSION_set_timeout(SSL_SESSION *session, uint32_t timeout) { return 1; } +const uint8_t *SSL_SESSION_get0_id_context(const SSL_SESSION *session, + unsigned *out_len) { + if (out_len != NULL) { + *out_len = session->sid_ctx_length; + } + return session->sid_ctx; +} + int SSL_SESSION_set1_id_context(SSL_SESSION *session, const uint8_t *sid_ctx, size_t sid_ctx_len) { if (sid_ctx_len > sizeof(session->sid_ctx)) { @@ -975,19 +1006,48 @@ int SSL_SESSION_is_resumable(const SSL_SESSION *session) { } int SSL_SESSION_has_ticket(const SSL_SESSION *session) { - return session->tlsext_ticklen > 0; + return !session->ticket.empty(); } void SSL_SESSION_get0_ticket(const SSL_SESSION *session, const uint8_t **out_ticket, size_t *out_len) { if (out_ticket != nullptr) { - *out_ticket = session->tlsext_tick; + *out_ticket = session->ticket.data(); } - *out_len = session->tlsext_ticklen; + *out_len = session->ticket.size(); +} + +int SSL_SESSION_set_ticket(SSL_SESSION *session, const uint8_t *ticket, + size_t ticket_len) { + return session->ticket.CopyFrom(MakeConstSpan(ticket, ticket_len)); } uint32_t SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *session) { - return session->tlsext_tick_lifetime_hint; + return session->ticket_lifetime_hint; +} + +const SSL_CIPHER *SSL_SESSION_get0_cipher(const SSL_SESSION *session) { + return session->cipher; +} + +int SSL_SESSION_has_peer_sha256(const SSL_SESSION *session) { + return session->peer_sha256_valid; +} + +void SSL_SESSION_get0_peer_sha256(const SSL_SESSION *session, + const uint8_t **out_ptr, size_t *out_len) { + if (session->peer_sha256_valid) { + *out_ptr = session->peer_sha256; + *out_len = sizeof(session->peer_sha256); + } else { + *out_ptr = nullptr; + *out_len = 0; + } +} + +int SSL_SESSION_early_data_capable(const SSL_SESSION *session) { + return ssl_session_protocol_version(session) >= TLS1_3_VERSION && + session->ticket_max_early_data != 0; } SSL_SESSION *SSL_magic_pending_session_ptr(void) { @@ -1008,7 +1068,7 @@ SSL_SESSION *SSL_get_session(const SSL *ssl) { if (hs->new_session) { return hs->new_session.get(); } - return ssl->session; + return ssl->session.get(); } SSL_SESSION *SSL_get1_session(SSL *ssl) { @@ -1042,8 +1102,7 @@ void *SSL_SESSION_get_ex_data(const SSL_SESSION *session, int idx) { int SSL_CTX_add_session(SSL_CTX *ctx, SSL_SESSION *session) { // Although |session| is inserted into two structures (a doubly-linked list // and the hash table), |ctx| only takes one reference. - SSL_SESSION_up_ref(session); - UniquePtr owned_session(session); + UniquePtr owned_session = UpRef(session); SSL_SESSION *old_session; MutexWriteLock lock(&ctx->lock); @@ -1188,12 +1247,6 @@ void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, ctx->get_session_cb = cb; } -void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, - SSL_SESSION *(*cb)(SSL *ssl, uint8_t *id, - int id_len, int *out_copy)) { - ctx->get_session_cb_legacy = cb; -} - SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(SSL *ssl, const uint8_t *id, int id_len, diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_stat.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc similarity index 100% rename from Pods/BoringSSL-GRPC/ssl/ssl_stat.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_stat.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/ssl/ssl_stat.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_stat.cc.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc new file mode 100644 index 000000000..e5e3fff0a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc @@ -0,0 +1,277 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. */ + +#include + +#include +#include +#include + +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +SSLTranscript::SSLTranscript() {} + +SSLTranscript::~SSLTranscript() {} + +bool SSLTranscript::Init() { + buffer_.reset(BUF_MEM_new()); + if (!buffer_) { + return false; + } + + hash_.Reset(); + return true; +} + +// InitDigestWithData calls |EVP_DigestInit_ex| on |ctx| with |md| and then +// writes the data in |buf| to it. +static bool InitDigestWithData(EVP_MD_CTX *ctx, const EVP_MD *md, + const BUF_MEM *buf) { + if (!EVP_DigestInit_ex(ctx, md, NULL)) { + return false; + } + EVP_DigestUpdate(ctx, buf->data, buf->length); + return true; +} + +bool SSLTranscript::InitHash(uint16_t version, const SSL_CIPHER *cipher) { + const EVP_MD *md = ssl_get_handshake_digest(version, cipher); + return InitDigestWithData(hash_.get(), md, buffer_.get()); +} + +void SSLTranscript::FreeBuffer() { + buffer_.reset(); +} + +size_t SSLTranscript::DigestLen() const { + return EVP_MD_size(Digest()); +} + +const EVP_MD *SSLTranscript::Digest() const { + return EVP_MD_CTX_md(hash_.get()); +} + +bool SSLTranscript::UpdateForHelloRetryRequest() { + if (buffer_) { + buffer_->length = 0; + } + + uint8_t old_hash[EVP_MAX_MD_SIZE]; + size_t hash_len; + if (!GetHash(old_hash, &hash_len)) { + return false; + } + const uint8_t header[4] = {SSL3_MT_MESSAGE_HASH, 0, 0, + static_cast(hash_len)}; + if (!EVP_DigestInit_ex(hash_.get(), Digest(), nullptr) || + !Update(header) || + !Update(MakeConstSpan(old_hash, hash_len))) { + return false; + } + return true; +} + +bool SSLTranscript::CopyToHashContext(EVP_MD_CTX *ctx, const EVP_MD *digest) { + const EVP_MD *transcript_digest = Digest(); + if (transcript_digest != nullptr && + EVP_MD_type(transcript_digest) == EVP_MD_type(digest)) { + return EVP_MD_CTX_copy_ex(ctx, hash_.get()); + } + + if (buffer_) { + return EVP_DigestInit_ex(ctx, digest, nullptr) && + EVP_DigestUpdate(ctx, buffer_->data, buffer_->length); + } + + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; +} + +bool SSLTranscript::Update(Span in) { + // Depending on the state of the handshake, either the handshake buffer may be + // active, the rolling hash, or both. + if (buffer_ && + !BUF_MEM_append(buffer_.get(), in.data(), in.size())) { + return false; + } + + if (EVP_MD_CTX_md(hash_.get()) != NULL) { + EVP_DigestUpdate(hash_.get(), in.data(), in.size()); + } + + return true; +} + +bool SSLTranscript::GetHash(uint8_t *out, size_t *out_len) { + ScopedEVP_MD_CTX ctx; + unsigned len; + if (!EVP_MD_CTX_copy_ex(ctx.get(), hash_.get()) || + !EVP_DigestFinal_ex(ctx.get(), out, &len)) { + return false; + } + *out_len = len; + return true; +} + +bool SSLTranscript::GetFinishedMAC(uint8_t *out, size_t *out_len, + const SSL_SESSION *session, + bool from_server) { + static const char kClientLabel[] = "client finished"; + static const char kServerLabel[] = "server finished"; + auto label = from_server + ? MakeConstSpan(kServerLabel, sizeof(kServerLabel) - 1) + : MakeConstSpan(kClientLabel, sizeof(kClientLabel) - 1); + + uint8_t digest[EVP_MAX_MD_SIZE]; + size_t digest_len; + if (!GetHash(digest, &digest_len)) { + return false; + } + + static const size_t kFinishedLen = 12; + if (!tls1_prf(Digest(), MakeSpan(out, kFinishedLen), + MakeConstSpan(session->master_key, session->master_key_length), + label, MakeConstSpan(digest, digest_len), {})) { + return false; + } + + *out_len = kFinishedLen; + return true; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc.grpc_back new file mode 100644 index 000000000..c1cef2bb1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_transcript.cc.grpc_back @@ -0,0 +1,277 @@ +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) + * All rights reserved. + * + * This package is an SSL implementation written + * by Eric Young (eay@cryptsoft.com). + * The implementation was written so as to conform with Netscapes SSL. + * + * This library is free for commercial and non-commercial use as long as + * the following conditions are aheared to. The following conditions + * apply to all code found in this distribution, be it the RC4, RSA, + * lhash, DES, etc., code; not just the SSL code. The SSL documentation + * included with this distribution is covered by the same copyright terms + * except that the holder is Tim Hudson (tjh@cryptsoft.com). + * + * Copyright remains Eric Young's, and as such any Copyright notices in + * the code are not to be removed. + * If this package is used in a product, Eric Young should be given attribution + * as the author of the parts of the library used. + * This can be in the form of a textual message at program startup or + * in documentation (online or textual) provided with the package. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * "This product includes cryptographic software written by + * Eric Young (eay@cryptsoft.com)" + * The word 'cryptographic' can be left out if the rouines from the library + * being used are not cryptographic related :-). + * 4. If you include any Windows specific code (or a derivative thereof) from + * the apps directory (application code) you must include an acknowledgement: + * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + * + * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * The licence and distribution terms for any publically available version or + * derivative of this code cannot be changed. i.e. this code cannot simply be + * copied and put under another distribution licence + * [including the GNU Public Licence.] + */ +/* ==================================================================== + * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + * + * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * openssl-core@openssl.org. + * + * 5. Products derived from this software may not be called "OpenSSL" + * nor may "OpenSSL" appear in their names without prior written + * permission of the OpenSSL Project. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the OpenSSL Project + * for use in the OpenSSL Toolkit (http://www.openssl.org/)" + * + * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This product includes cryptographic software written by Eric Young + * (eay@cryptsoft.com). This product includes software written by Tim + * Hudson (tjh@cryptsoft.com). + * + */ +/* ==================================================================== + * Copyright 2005 Nokia. All rights reserved. + * + * The portions of the attached software ("Contribution") is developed by + * Nokia Corporation and is licensed pursuant to the OpenSSL open source + * license. + * + * The Contribution, originally written by Mika Kousa and Pasi Eronen of + * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites + * support (see RFC 4279) to OpenSSL. + * + * No patent licenses or other rights except those expressly stated in + * the OpenSSL open source license shall be deemed granted or received + * expressly, by implication, estoppel, or otherwise. + * + * No assurances are provided by Nokia that the Contribution does not + * infringe the patent or other intellectual property rights of any third + * party or that the license provides you with all the necessary rights + * to make use of the Contribution. + * + * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN + * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA + * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY + * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR + * OTHERWISE. */ + +#include + +#include +#include +#include + +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +SSLTranscript::SSLTranscript() {} + +SSLTranscript::~SSLTranscript() {} + +bool SSLTranscript::Init() { + buffer_.reset(BUF_MEM_new()); + if (!buffer_) { + return false; + } + + hash_.Reset(); + return true; +} + +// InitDigestWithData calls |EVP_DigestInit_ex| on |ctx| with |md| and then +// writes the data in |buf| to it. +static bool InitDigestWithData(EVP_MD_CTX *ctx, const EVP_MD *md, + const BUF_MEM *buf) { + if (!EVP_DigestInit_ex(ctx, md, NULL)) { + return false; + } + EVP_DigestUpdate(ctx, buf->data, buf->length); + return true; +} + +bool SSLTranscript::InitHash(uint16_t version, const SSL_CIPHER *cipher) { + const EVP_MD *md = ssl_get_handshake_digest(version, cipher); + return InitDigestWithData(hash_.get(), md, buffer_.get()); +} + +void SSLTranscript::FreeBuffer() { + buffer_.reset(); +} + +size_t SSLTranscript::DigestLen() const { + return EVP_MD_size(Digest()); +} + +const EVP_MD *SSLTranscript::Digest() const { + return EVP_MD_CTX_md(hash_.get()); +} + +bool SSLTranscript::UpdateForHelloRetryRequest() { + if (buffer_) { + buffer_->length = 0; + } + + uint8_t old_hash[EVP_MAX_MD_SIZE]; + size_t hash_len; + if (!GetHash(old_hash, &hash_len)) { + return false; + } + const uint8_t header[4] = {SSL3_MT_MESSAGE_HASH, 0, 0, + static_cast(hash_len)}; + if (!EVP_DigestInit_ex(hash_.get(), Digest(), nullptr) || + !Update(header) || + !Update(MakeConstSpan(old_hash, hash_len))) { + return false; + } + return true; +} + +bool SSLTranscript::CopyToHashContext(EVP_MD_CTX *ctx, const EVP_MD *digest) { + const EVP_MD *transcript_digest = Digest(); + if (transcript_digest != nullptr && + EVP_MD_type(transcript_digest) == EVP_MD_type(digest)) { + return EVP_MD_CTX_copy_ex(ctx, hash_.get()); + } + + if (buffer_) { + return EVP_DigestInit_ex(ctx, digest, nullptr) && + EVP_DigestUpdate(ctx, buffer_->data, buffer_->length); + } + + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; +} + +bool SSLTranscript::Update(Span in) { + // Depending on the state of the handshake, either the handshake buffer may be + // active, the rolling hash, or both. + if (buffer_ && + !BUF_MEM_append(buffer_.get(), in.data(), in.size())) { + return false; + } + + if (EVP_MD_CTX_md(hash_.get()) != NULL) { + EVP_DigestUpdate(hash_.get(), in.data(), in.size()); + } + + return true; +} + +bool SSLTranscript::GetHash(uint8_t *out, size_t *out_len) { + ScopedEVP_MD_CTX ctx; + unsigned len; + if (!EVP_MD_CTX_copy_ex(ctx.get(), hash_.get()) || + !EVP_DigestFinal_ex(ctx.get(), out, &len)) { + return false; + } + *out_len = len; + return true; +} + +bool SSLTranscript::GetFinishedMAC(uint8_t *out, size_t *out_len, + const SSL_SESSION *session, + bool from_server) { + static const char kClientLabel[] = "client finished"; + static const char kServerLabel[] = "server finished"; + auto label = from_server + ? MakeConstSpan(kServerLabel, sizeof(kServerLabel) - 1) + : MakeConstSpan(kClientLabel, sizeof(kClientLabel) - 1); + + uint8_t digest[EVP_MAX_MD_SIZE]; + size_t digest_len; + if (!GetHash(digest, &digest_len)) { + return false; + } + + static const size_t kFinishedLen = 12; + if (!tls1_prf(Digest(), MakeSpan(out, kFinishedLen), + MakeConstSpan(session->master_key, session->master_key_length), + label, MakeConstSpan(digest, digest_len), {})) { + return false; + } + + *out_len = kFinishedLen; + return true; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc new file mode 100644 index 000000000..a4b064e1e --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc @@ -0,0 +1,394 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version) { + switch (version) { + case TLS1_VERSION: + case TLS1_1_VERSION: + case TLS1_2_VERSION: + case TLS1_3_VERSION: + *out = version; + return true; + + case DTLS1_VERSION: + // DTLS 1.0 is analogous to TLS 1.1, not TLS 1.0. + *out = TLS1_1_VERSION; + return true; + + case DTLS1_2_VERSION: + *out = TLS1_2_VERSION; + return true; + + default: + return false; + } +} + +// The follow arrays are the supported versions for TLS and DTLS, in order of +// decreasing preference. + +static const uint16_t kTLSVersions[] = { + TLS1_3_VERSION, + TLS1_2_VERSION, + TLS1_1_VERSION, + TLS1_VERSION, +}; + +static const uint16_t kDTLSVersions[] = { + DTLS1_2_VERSION, + DTLS1_VERSION, +}; + +static Span get_method_versions( + const SSL_PROTOCOL_METHOD *method) { + return method->is_dtls ? Span(kDTLSVersions) + : Span(kTLSVersions); +} + +bool ssl_method_supports_version(const SSL_PROTOCOL_METHOD *method, + uint16_t version) { + for (uint16_t supported : get_method_versions(method)) { + if (supported == version) { + return true; + } + } + return false; +} + +// The following functions map between API versions and wire versions. The +// public API works on wire versions. + +static const char *ssl_version_to_string(uint16_t version) { + switch (version) { + case TLS1_3_VERSION: + return "TLSv1.3"; + + case TLS1_2_VERSION: + return "TLSv1.2"; + + case TLS1_1_VERSION: + return "TLSv1.1"; + + case TLS1_VERSION: + return "TLSv1"; + + case DTLS1_VERSION: + return "DTLSv1"; + + case DTLS1_2_VERSION: + return "DTLSv1.2"; + + default: + return "unknown"; + } +} + +static uint16_t wire_version_to_api(uint16_t version) { + return version; +} + +// api_version_to_wire maps |version| to some representative wire version. +static bool api_version_to_wire(uint16_t *out, uint16_t version) { + // Check it is a real protocol version. + uint16_t unused; + if (!ssl_protocol_version_from_wire(&unused, version)) { + return false; + } + + *out = version; + return true; +} + +static bool set_version_bound(const SSL_PROTOCOL_METHOD *method, uint16_t *out, + uint16_t version) { + if (!api_version_to_wire(&version, version) || + !ssl_method_supports_version(method, version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_SSL_VERSION); + return false; + } + + *out = version; + return true; +} + +static bool set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, + uint16_t version) { + // Zero is interpreted as the default minimum version. + if (version == 0) { + *out = method->is_dtls ? DTLS1_VERSION : TLS1_VERSION; + return true; + } + + return set_version_bound(method, out, version); +} + +static bool set_max_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, + uint16_t version) { + // Zero is interpreted as the default maximum version. + if (version == 0) { + *out = method->is_dtls ? DTLS1_2_VERSION : TLS1_3_VERSION; + return true; + } + + return set_version_bound(method, out, version); +} + +const struct { + uint16_t version; + uint32_t flag; +} kProtocolVersions[] = { + {TLS1_VERSION, SSL_OP_NO_TLSv1}, + {TLS1_1_VERSION, SSL_OP_NO_TLSv1_1}, + {TLS1_2_VERSION, SSL_OP_NO_TLSv1_2}, + {TLS1_3_VERSION, SSL_OP_NO_TLSv1_3}, +}; + +bool ssl_get_version_range(const SSL_HANDSHAKE *hs, uint16_t *out_min_version, + uint16_t *out_max_version) { + // For historical reasons, |SSL_OP_NO_DTLSv1| aliases |SSL_OP_NO_TLSv1|, but + // DTLS 1.0 should be mapped to TLS 1.1. + uint32_t options = hs->ssl->options; + if (SSL_is_dtls(hs->ssl)) { + options &= ~SSL_OP_NO_TLSv1_1; + if (options & SSL_OP_NO_DTLSv1) { + options |= SSL_OP_NO_TLSv1_1; + } + } + + uint16_t min_version, max_version; + if (!ssl_protocol_version_from_wire(&min_version, + hs->config->conf_min_version) || + !ssl_protocol_version_from_wire(&max_version, + hs->config->conf_max_version)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + // QUIC requires TLS 1.3. + if (hs->ssl->quic_method && min_version < TLS1_3_VERSION) { + min_version = TLS1_3_VERSION; + } + + // OpenSSL's API for controlling versions entails blacklisting individual + // protocols. This has two problems. First, on the client, the protocol can + // only express a contiguous range of versions. Second, a library consumer + // trying to set a maximum version cannot disable protocol versions that get + // added in a future version of the library. + // + // To account for both of these, OpenSSL interprets the client-side bitmask + // as a min/max range by picking the lowest contiguous non-empty range of + // enabled protocols. Note that this means it is impossible to set a maximum + // version of the higest supported TLS version in a future-proof way. + bool any_enabled = false; + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kProtocolVersions); i++) { + // Only look at the versions already enabled. + if (min_version > kProtocolVersions[i].version) { + continue; + } + if (max_version < kProtocolVersions[i].version) { + break; + } + + if (!(options & kProtocolVersions[i].flag)) { + // The minimum version is the first enabled version. + if (!any_enabled) { + any_enabled = true; + min_version = kProtocolVersions[i].version; + } + continue; + } + + // If there is a disabled version after the first enabled one, all versions + // after it are implicitly disabled. + if (any_enabled) { + max_version = kProtocolVersions[i-1].version; + break; + } + } + + if (!any_enabled) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SUPPORTED_VERSIONS_ENABLED); + return false; + } + + *out_min_version = min_version; + *out_max_version = max_version; + return true; +} + +static uint16_t ssl_version(const SSL *ssl) { + // In early data, we report the predicted version. + if (SSL_in_early_data(ssl) && !ssl->server) { + return ssl->s3->hs->early_session->ssl_version; + } + return ssl->version; +} + +uint16_t ssl_protocol_version(const SSL *ssl) { + assert(ssl->s3->have_version); + uint16_t version; + if (!ssl_protocol_version_from_wire(&version, ssl->version)) { + // |ssl->version| will always be set to a valid version. + assert(0); + return 0; + } + + return version; +} + +bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version) { + SSL *const ssl = hs->ssl; + uint16_t protocol_version; + if (!ssl_method_supports_version(ssl->method, version) || + !ssl_protocol_version_from_wire(&protocol_version, version) || + hs->min_version > protocol_version || + protocol_version > hs->max_version) { + return false; + } + + return true; +} + +bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb) { + for (uint16_t version : get_method_versions(hs->ssl->method)) { + if (ssl_supports_version(hs, version) && + !CBB_add_u16(cbb, version)) { + return false; + } + } + return true; +} + +bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, + uint16_t *out_version, const CBS *peer_versions) { + for (uint16_t version : get_method_versions(hs->ssl->method)) { + if (!ssl_supports_version(hs, version)) { + continue; + } + + // JDK 11, prior to 11.0.2, has a buggy TLS 1.3 implementation which fails + // to send SNI when offering 1.3 sessions. Disable TLS 1.3 for such + // clients. We apply this logic here rather than |ssl_supports_version| so + // the downgrade signal continues to query the true capabilities. (The + // workaround is a limitation of the peer's capabilities rather than our + // own.) + // + // See https://bugs.openjdk.java.net/browse/JDK-8211806. + if (version == TLS1_3_VERSION && hs->apply_jdk11_workaround) { + continue; + } + + CBS copy = *peer_versions; + while (CBS_len(©) != 0) { + uint16_t peer_version; + if (!CBS_get_u16(©, &peer_version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + if (peer_version == version) { + *out_version = version; + return true; + } + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL); + *out_alert = SSL_AD_PROTOCOL_VERSION; + return false; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) { + return set_min_version(ctx->method, &ctx->conf_min_version, version); +} + +int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) { + return set_max_version(ctx->method, &ctx->conf_max_version, version); +} + +uint16_t SSL_CTX_get_min_proto_version(const SSL_CTX *ctx) { + return ctx->conf_min_version; +} + +uint16_t SSL_CTX_get_max_proto_version(const SSL_CTX *ctx) { + return ctx->conf_max_version; +} + +int SSL_set_min_proto_version(SSL *ssl, uint16_t version) { + if (!ssl->config) { + return 0; + } + return set_min_version(ssl->method, &ssl->config->conf_min_version, version); +} + +int SSL_set_max_proto_version(SSL *ssl, uint16_t version) { + if (!ssl->config) { + return 0; + } + return set_max_version(ssl->method, &ssl->config->conf_max_version, version); +} + +uint16_t SSL_get_min_proto_version(const SSL *ssl) { + if (!ssl->config) { + return 0; + } + return ssl->config->conf_min_version; +} + +uint16_t SSL_get_max_proto_version(const SSL *ssl) { + if (!ssl->config) { + return 0; + } + return ssl->config->conf_max_version; +} + +int SSL_version(const SSL *ssl) { + return wire_version_to_api(ssl_version(ssl)); +} + +const char *SSL_get_version(const SSL *ssl) { + return ssl_version_to_string(ssl_version(ssl)); +} + +const char *SSL_SESSION_get_version(const SSL_SESSION *session) { + return ssl_version_to_string(session->ssl_version); +} + +uint16_t SSL_SESSION_get_protocol_version(const SSL_SESSION *session) { + return wire_version_to_api(session->ssl_version); +} + +int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version) { + // This picks a representative TLS 1.3 version, but this API should only be + // used on unit test sessions anyway. + return api_version_to_wire(&session->ssl_version, version); +} diff --git a/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc.grpc_back new file mode 100644 index 000000000..d95aeb306 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_versions.cc.grpc_back @@ -0,0 +1,394 @@ +/* Copyright (c) 2017, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include + +#include +#include + +#include "internal.h" +#include "../crypto/internal.h" + + +BSSL_NAMESPACE_BEGIN + +bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version) { + switch (version) { + case TLS1_VERSION: + case TLS1_1_VERSION: + case TLS1_2_VERSION: + case TLS1_3_VERSION: + *out = version; + return true; + + case DTLS1_VERSION: + // DTLS 1.0 is analogous to TLS 1.1, not TLS 1.0. + *out = TLS1_1_VERSION; + return true; + + case DTLS1_2_VERSION: + *out = TLS1_2_VERSION; + return true; + + default: + return false; + } +} + +// The follow arrays are the supported versions for TLS and DTLS, in order of +// decreasing preference. + +static const uint16_t kTLSVersions[] = { + TLS1_3_VERSION, + TLS1_2_VERSION, + TLS1_1_VERSION, + TLS1_VERSION, +}; + +static const uint16_t kDTLSVersions[] = { + DTLS1_2_VERSION, + DTLS1_VERSION, +}; + +static Span get_method_versions( + const SSL_PROTOCOL_METHOD *method) { + return method->is_dtls ? Span(kDTLSVersions) + : Span(kTLSVersions); +} + +bool ssl_method_supports_version(const SSL_PROTOCOL_METHOD *method, + uint16_t version) { + for (uint16_t supported : get_method_versions(method)) { + if (supported == version) { + return true; + } + } + return false; +} + +// The following functions map between API versions and wire versions. The +// public API works on wire versions. + +static const char *ssl_version_to_string(uint16_t version) { + switch (version) { + case TLS1_3_VERSION: + return "TLSv1.3"; + + case TLS1_2_VERSION: + return "TLSv1.2"; + + case TLS1_1_VERSION: + return "TLSv1.1"; + + case TLS1_VERSION: + return "TLSv1"; + + case DTLS1_VERSION: + return "DTLSv1"; + + case DTLS1_2_VERSION: + return "DTLSv1.2"; + + default: + return "unknown"; + } +} + +static uint16_t wire_version_to_api(uint16_t version) { + return version; +} + +// api_version_to_wire maps |version| to some representative wire version. +static bool api_version_to_wire(uint16_t *out, uint16_t version) { + // Check it is a real protocol version. + uint16_t unused; + if (!ssl_protocol_version_from_wire(&unused, version)) { + return false; + } + + *out = version; + return true; +} + +static bool set_version_bound(const SSL_PROTOCOL_METHOD *method, uint16_t *out, + uint16_t version) { + if (!api_version_to_wire(&version, version) || + !ssl_method_supports_version(method, version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_SSL_VERSION); + return false; + } + + *out = version; + return true; +} + +static bool set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, + uint16_t version) { + // Zero is interpreted as the default minimum version. + if (version == 0) { + *out = method->is_dtls ? DTLS1_VERSION : TLS1_VERSION; + return true; + } + + return set_version_bound(method, out, version); +} + +static bool set_max_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, + uint16_t version) { + // Zero is interpreted as the default maximum version. + if (version == 0) { + *out = method->is_dtls ? DTLS1_2_VERSION : TLS1_3_VERSION; + return true; + } + + return set_version_bound(method, out, version); +} + +const struct { + uint16_t version; + uint32_t flag; +} kProtocolVersions[] = { + {TLS1_VERSION, SSL_OP_NO_TLSv1}, + {TLS1_1_VERSION, SSL_OP_NO_TLSv1_1}, + {TLS1_2_VERSION, SSL_OP_NO_TLSv1_2}, + {TLS1_3_VERSION, SSL_OP_NO_TLSv1_3}, +}; + +bool ssl_get_version_range(const SSL_HANDSHAKE *hs, uint16_t *out_min_version, + uint16_t *out_max_version) { + // For historical reasons, |SSL_OP_NO_DTLSv1| aliases |SSL_OP_NO_TLSv1|, but + // DTLS 1.0 should be mapped to TLS 1.1. + uint32_t options = hs->ssl->options; + if (SSL_is_dtls(hs->ssl)) { + options &= ~SSL_OP_NO_TLSv1_1; + if (options & SSL_OP_NO_DTLSv1) { + options |= SSL_OP_NO_TLSv1_1; + } + } + + uint16_t min_version, max_version; + if (!ssl_protocol_version_from_wire(&min_version, + hs->config->conf_min_version) || + !ssl_protocol_version_from_wire(&max_version, + hs->config->conf_max_version)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + // QUIC requires TLS 1.3. + if (hs->ssl->quic_method && min_version < TLS1_3_VERSION) { + min_version = TLS1_3_VERSION; + } + + // OpenSSL's API for controlling versions entails blacklisting individual + // protocols. This has two problems. First, on the client, the protocol can + // only express a contiguous range of versions. Second, a library consumer + // trying to set a maximum version cannot disable protocol versions that get + // added in a future version of the library. + // + // To account for both of these, OpenSSL interprets the client-side bitmask + // as a min/max range by picking the lowest contiguous non-empty range of + // enabled protocols. Note that this means it is impossible to set a maximum + // version of the higest supported TLS version in a future-proof way. + bool any_enabled = false; + for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kProtocolVersions); i++) { + // Only look at the versions already enabled. + if (min_version > kProtocolVersions[i].version) { + continue; + } + if (max_version < kProtocolVersions[i].version) { + break; + } + + if (!(options & kProtocolVersions[i].flag)) { + // The minimum version is the first enabled version. + if (!any_enabled) { + any_enabled = true; + min_version = kProtocolVersions[i].version; + } + continue; + } + + // If there is a disabled version after the first enabled one, all versions + // after it are implicitly disabled. + if (any_enabled) { + max_version = kProtocolVersions[i-1].version; + break; + } + } + + if (!any_enabled) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SUPPORTED_VERSIONS_ENABLED); + return false; + } + + *out_min_version = min_version; + *out_max_version = max_version; + return true; +} + +static uint16_t ssl_version(const SSL *ssl) { + // In early data, we report the predicted version. + if (SSL_in_early_data(ssl) && !ssl->server) { + return ssl->s3->hs->early_session->ssl_version; + } + return ssl->version; +} + +uint16_t ssl_protocol_version(const SSL *ssl) { + assert(ssl->s3->have_version); + uint16_t version; + if (!ssl_protocol_version_from_wire(&version, ssl->version)) { + // |ssl->version| will always be set to a valid version. + assert(0); + return 0; + } + + return version; +} + +bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version) { + SSL *const ssl = hs->ssl; + uint16_t protocol_version; + if (!ssl_method_supports_version(ssl->method, version) || + !ssl_protocol_version_from_wire(&protocol_version, version) || + hs->min_version > protocol_version || + protocol_version > hs->max_version) { + return false; + } + + return true; +} + +bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb) { + for (uint16_t version : get_method_versions(hs->ssl->method)) { + if (ssl_supports_version(hs, version) && + !CBB_add_u16(cbb, version)) { + return false; + } + } + return true; +} + +bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, + uint16_t *out_version, const CBS *peer_versions) { + for (uint16_t version : get_method_versions(hs->ssl->method)) { + if (!ssl_supports_version(hs, version)) { + continue; + } + + // JDK 11, prior to 11.0.2, has a buggy TLS 1.3 implementation which fails + // to send SNI when offering 1.3 sessions. Disable TLS 1.3 for such + // clients. We apply this logic here rather than |ssl_supports_version| so + // the downgrade signal continues to query the true capabilities. (The + // workaround is a limitation of the peer's capabilities rather than our + // own.) + // + // See https://bugs.openjdk.java.net/browse/JDK-8211806. + if (version == TLS1_3_VERSION && hs->apply_jdk11_workaround) { + continue; + } + + CBS copy = *peer_versions; + while (CBS_len(©) != 0) { + uint16_t peer_version; + if (!CBS_get_u16(©, &peer_version)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + *out_alert = SSL_AD_DECODE_ERROR; + return false; + } + + if (peer_version == version) { + *out_version = version; + return true; + } + } + } + + OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL); + *out_alert = SSL_AD_PROTOCOL_VERSION; + return false; +} + +BSSL_NAMESPACE_END + +using namespace bssl; + +int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) { + return set_min_version(ctx->method, &ctx->conf_min_version, version); +} + +int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) { + return set_max_version(ctx->method, &ctx->conf_max_version, version); +} + +uint16_t SSL_CTX_get_min_proto_version(const SSL_CTX *ctx) { + return ctx->conf_min_version; +} + +uint16_t SSL_CTX_get_max_proto_version(const SSL_CTX *ctx) { + return ctx->conf_max_version; +} + +int SSL_set_min_proto_version(SSL *ssl, uint16_t version) { + if (!ssl->config) { + return 0; + } + return set_min_version(ssl->method, &ssl->config->conf_min_version, version); +} + +int SSL_set_max_proto_version(SSL *ssl, uint16_t version) { + if (!ssl->config) { + return 0; + } + return set_max_version(ssl->method, &ssl->config->conf_max_version, version); +} + +uint16_t SSL_get_min_proto_version(const SSL *ssl) { + if (!ssl->config) { + return 0; + } + return ssl->config->conf_min_version; +} + +uint16_t SSL_get_max_proto_version(const SSL *ssl) { + if (!ssl->config) { + return 0; + } + return ssl->config->conf_max_version; +} + +int SSL_version(const SSL *ssl) { + return wire_version_to_api(ssl_version(ssl)); +} + +const char *SSL_get_version(const SSL *ssl) { + return ssl_version_to_string(ssl_version(ssl)); +} + +const char *SSL_SESSION_get_version(const SSL_SESSION *session) { + return ssl_version_to_string(session->ssl_version); +} + +uint16_t SSL_SESSION_get_protocol_version(const SSL_SESSION *session) { + return wire_version_to_api(session->ssl_version); +} + +int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version) { + // This picks a representative TLS 1.3 version, but this API should only be + // used on unit test sessions anyway. + return api_version_to_wire(&session->ssl_version, version); +} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_x509.cc b/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc similarity index 75% rename from Pods/BoringSSL-GRPC/ssl/ssl_x509.cc rename to Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc index 2d85cd06d..c353bc6fc 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_x509.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc @@ -155,7 +155,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // check_ssl_x509_method asserts that |ssl| has the X509-based method // installed. Calling an X509-based method on an |ssl| with a different method @@ -186,15 +186,11 @@ static UniquePtr x509_to_buffer(X509 *x509) { } // new_leafless_chain returns a fresh stack of buffers set to {NULL}. -static STACK_OF(CRYPTO_BUFFER) *new_leafless_chain(void) { - STACK_OF(CRYPTO_BUFFER) *chain = sk_CRYPTO_BUFFER_new_null(); - if (chain == NULL) { - return NULL; - } - - if (!sk_CRYPTO_BUFFER_push(chain, NULL)) { - sk_CRYPTO_BUFFER_free(chain); - return NULL; +static UniquePtr new_leafless_chain(void) { + UniquePtr chain(sk_CRYPTO_BUFFER_new_null()); + if (!chain || + !sk_CRYPTO_BUFFER_push(chain.get(), nullptr)) { + return nullptr; } return chain; @@ -204,70 +200,64 @@ static STACK_OF(CRYPTO_BUFFER) *new_leafless_chain(void) { // forms of elements of |chain|. It returns one on success or zero on error, in // which case no change to |cert->chain| is made. It preverses the existing // leaf from |cert->chain|, if any. -static int ssl_cert_set_chain(CERT *cert, STACK_OF(X509) *chain) { +static bool ssl_cert_set_chain(CERT *cert, STACK_OF(X509) *chain) { UniquePtr new_chain; - if (cert->chain != NULL) { + if (cert->chain != nullptr) { new_chain.reset(sk_CRYPTO_BUFFER_new_null()); if (!new_chain) { - return 0; + return false; } - CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain, 0); - if (!sk_CRYPTO_BUFFER_push(new_chain.get(), leaf)) { - return 0; - } // |leaf| might be NULL if it's a “leafless” chain. - if (leaf != NULL) { - CRYPTO_BUFFER_up_ref(leaf); + CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); + if (!PushToStack(new_chain.get(), UpRef(leaf))) { + return false; } } for (X509 *x509 : chain) { if (!new_chain) { - new_chain.reset(new_leafless_chain()); + new_chain = new_leafless_chain(); if (!new_chain) { - return 0; + return false; } } UniquePtr buffer = x509_to_buffer(x509); if (!buffer || !PushToStack(new_chain.get(), std::move(buffer))) { - return 0; + return false; } } - sk_CRYPTO_BUFFER_pop_free(cert->chain, CRYPTO_BUFFER_free); - cert->chain = new_chain.release(); - - return 1; + cert->chain = std::move(new_chain); + return true; } static void ssl_crypto_x509_cert_flush_cached_leaf(CERT *cert) { X509_free(cert->x509_leaf); - cert->x509_leaf = NULL; + cert->x509_leaf = nullptr; } static void ssl_crypto_x509_cert_flush_cached_chain(CERT *cert) { sk_X509_pop_free(cert->x509_chain, X509_free); - cert->x509_chain = NULL; + cert->x509_chain = nullptr; } -static int ssl_crypto_x509_check_client_CA_list( +static bool ssl_crypto_x509_check_client_CA_list( STACK_OF(CRYPTO_BUFFER) *names) { for (const CRYPTO_BUFFER *buffer : names) { const uint8_t *inp = CRYPTO_BUFFER_data(buffer); - X509_NAME *name = d2i_X509_NAME(NULL, &inp, CRYPTO_BUFFER_len(buffer)); - const int ok = name != NULL && inp == CRYPTO_BUFFER_data(buffer) + - CRYPTO_BUFFER_len(buffer); - X509_NAME_free(name); - if (!ok) { - return 0; + UniquePtr name( + d2i_X509_NAME(nullptr, &inp, CRYPTO_BUFFER_len(buffer))); + if (name == nullptr || + inp != CRYPTO_BUFFER_data(buffer) + CRYPTO_BUFFER_len(buffer)) { + return false; } } - return 1; + return true; } static void ssl_crypto_x509_cert_clear(CERT *cert) { @@ -275,7 +265,7 @@ static void ssl_crypto_x509_cert_clear(CERT *cert) { ssl_crypto_x509_cert_flush_cached_chain(cert); X509_free(cert->x509_stash); - cert->x509_stash = NULL; + cert->x509_stash = nullptr; } static void ssl_crypto_x509_cert_free(CERT *cert) { @@ -284,118 +274,131 @@ static void ssl_crypto_x509_cert_free(CERT *cert) { } static void ssl_crypto_x509_cert_dup(CERT *new_cert, const CERT *cert) { - if (cert->verify_store != NULL) { + if (cert->verify_store != nullptr) { X509_STORE_up_ref(cert->verify_store); new_cert->verify_store = cert->verify_store; } } -static int ssl_crypto_x509_session_cache_objects(SSL_SESSION *sess) { - bssl::UniquePtr chain; - if (sk_CRYPTO_BUFFER_num(sess->certs) > 0) { +static bool ssl_crypto_x509_session_cache_objects(SSL_SESSION *sess) { + bssl::UniquePtr chain, chain_without_leaf; + if (sk_CRYPTO_BUFFER_num(sess->certs.get()) > 0) { chain.reset(sk_X509_new_null()); if (!chain) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; + return false; + } + if (sess->is_server) { + // chain_without_leaf is only needed for server sessions. See + // |SSL_get_peer_cert_chain|. + chain_without_leaf.reset(sk_X509_new_null()); + if (!chain_without_leaf) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } } } - X509 *leaf = nullptr; - for (CRYPTO_BUFFER *cert : sess->certs) { + bssl::UniquePtr leaf; + for (CRYPTO_BUFFER *cert : sess->certs.get()) { UniquePtr x509(X509_parse_from_buffer(cert)); if (!x509) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; + return false; } if (leaf == nullptr) { - leaf = x509.get(); + leaf = UpRef(x509); + } else if (chain_without_leaf && + !PushToStack(chain_without_leaf.get(), UpRef(x509))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; } if (!PushToStack(chain.get(), std::move(x509))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; + return false; } } sk_X509_pop_free(sess->x509_chain, X509_free); sess->x509_chain = chain.release(); + sk_X509_pop_free(sess->x509_chain_without_leaf, X509_free); - sess->x509_chain_without_leaf = NULL; + sess->x509_chain_without_leaf = chain_without_leaf.release(); X509_free(sess->x509_peer); - if (leaf != NULL) { - X509_up_ref(leaf); - } - sess->x509_peer = leaf; - return 1; + sess->x509_peer = leaf.release(); + return true; } -static int ssl_crypto_x509_session_dup(SSL_SESSION *new_session, - const SSL_SESSION *session) { - if (session->x509_peer != NULL) { - X509_up_ref(session->x509_peer); - new_session->x509_peer = session->x509_peer; - } - if (session->x509_chain != NULL) { +static bool ssl_crypto_x509_session_dup(SSL_SESSION *new_session, + const SSL_SESSION *session) { + new_session->x509_peer = UpRef(session->x509_peer).release(); + if (session->x509_chain != nullptr) { new_session->x509_chain = X509_chain_up_ref(session->x509_chain); - if (new_session->x509_chain == NULL) { - return 0; + if (new_session->x509_chain == nullptr) { + return false; + } + } + if (session->x509_chain_without_leaf != nullptr) { + new_session->x509_chain_without_leaf = + X509_chain_up_ref(session->x509_chain_without_leaf); + if (new_session->x509_chain_without_leaf == nullptr) { + return false; } } - return 1; + return true; } static void ssl_crypto_x509_session_clear(SSL_SESSION *session) { X509_free(session->x509_peer); - session->x509_peer = NULL; + session->x509_peer = nullptr; sk_X509_pop_free(session->x509_chain, X509_free); - session->x509_chain = NULL; + session->x509_chain = nullptr; sk_X509_pop_free(session->x509_chain_without_leaf, X509_free); - session->x509_chain_without_leaf = NULL; + session->x509_chain_without_leaf = nullptr; } -static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session, - SSL *ssl, - uint8_t *out_alert) { +static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session, + SSL_HANDSHAKE *hs, + uint8_t *out_alert) { *out_alert = SSL_AD_INTERNAL_ERROR; STACK_OF(X509) *const cert_chain = session->x509_chain; - if (cert_chain == NULL || sk_X509_num(cert_chain) == 0) { - return 0; + if (cert_chain == nullptr || sk_X509_num(cert_chain) == 0) { + return false; } - X509_STORE *verify_store = ssl->ctx->cert_store; - if (ssl->cert->verify_store != NULL) { - verify_store = ssl->cert->verify_store; + SSL_CTX *ssl_ctx = hs->ssl->ctx.get(); + X509_STORE *verify_store = ssl_ctx->cert_store; + if (hs->config->cert->verify_store != nullptr) { + verify_store = hs->config->cert->verify_store; } X509 *leaf = sk_X509_value(cert_chain, 0); ScopedX509_STORE_CTX ctx; - if (!X509_STORE_CTX_init(ctx.get(), verify_store, leaf, cert_chain)) { + if (!X509_STORE_CTX_init(ctx.get(), verify_store, leaf, cert_chain) || + !X509_STORE_CTX_set_ex_data( + ctx.get(), SSL_get_ex_data_X509_STORE_CTX_idx(), hs->ssl) || + // We need to inherit the verify parameters. These can be determined by + // the context: if its a server it will verify SSL client certificates or + // vice versa. + !X509_STORE_CTX_set_default( + ctx.get(), hs->ssl->server ? "ssl_client" : "ssl_server") || + // Anything non-default in "param" should overwrite anything in the ctx. + !X509_VERIFY_PARAM_set1(X509_STORE_CTX_get0_param(ctx.get()), + hs->config->param)) { OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); - return 0; + return false; } - if (!X509_STORE_CTX_set_ex_data(ctx.get(), - SSL_get_ex_data_X509_STORE_CTX_idx(), ssl)) { - return 0; - } - - // We need to inherit the verify parameters. These can be determined by the - // context: if its a server it will verify SSL client certificates or vice - // versa. - X509_STORE_CTX_set_default(ctx.get(), - ssl->server ? "ssl_client" : "ssl_server"); - // Anything non-default in "param" should overwrite anything in the ctx. - X509_VERIFY_PARAM_set1(X509_STORE_CTX_get0_param(ctx.get()), ssl->param); - - if (ssl->verify_callback) { - X509_STORE_CTX_set_verify_cb(ctx.get(), ssl->verify_callback); + if (hs->config->verify_callback) { + X509_STORE_CTX_set_verify_cb(ctx.get(), hs->config->verify_callback); } int verify_ret; - if (ssl->ctx->app_verify_callback != NULL) { + if (ssl_ctx->app_verify_callback != nullptr) { verify_ret = - ssl->ctx->app_verify_callback(ctx.get(), ssl->ctx->app_verify_arg); + ssl_ctx->app_verify_callback(ctx.get(), ssl_ctx->app_verify_arg); } else { verify_ret = X509_verify_cert(ctx.get()); } @@ -403,60 +406,61 @@ static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session, session->verify_result = ctx->error; // If |SSL_VERIFY_NONE|, the error is non-fatal, but we keep the result. - if (verify_ret <= 0 && ssl->verify_mode != SSL_VERIFY_NONE) { + if (verify_ret <= 0 && hs->config->verify_mode != SSL_VERIFY_NONE) { *out_alert = SSL_alert_from_verify_result(ctx->error); - return 0; + return false; } ERR_clear_error(); - return 1; + return true; } static void ssl_crypto_x509_hs_flush_cached_ca_names(SSL_HANDSHAKE *hs) { sk_X509_NAME_pop_free(hs->cached_x509_ca_names, X509_NAME_free); - hs->cached_x509_ca_names = NULL; + hs->cached_x509_ca_names = nullptr; } -static int ssl_crypto_x509_ssl_new(SSL *ssl) { - ssl->param = X509_VERIFY_PARAM_new(); - if (ssl->param == NULL) { - return 0; +static bool ssl_crypto_x509_ssl_new(SSL_HANDSHAKE *hs) { + hs->config->param = X509_VERIFY_PARAM_new(); + if (hs->config->param == nullptr) { + return false; } - X509_VERIFY_PARAM_inherit(ssl->param, ssl->ctx->param); - return 1; + X509_VERIFY_PARAM_inherit(hs->config->param, hs->ssl->ctx->param); + return true; } -static void ssl_crypto_x509_ssl_flush_cached_client_CA(SSL *ssl) { - sk_X509_NAME_pop_free(ssl->cached_x509_client_CA, X509_NAME_free); - ssl->cached_x509_client_CA = NULL; +static void ssl_crypto_x509_ssl_flush_cached_client_CA(SSL_CONFIG *cfg) { + sk_X509_NAME_pop_free(cfg->cached_x509_client_CA, X509_NAME_free); + cfg->cached_x509_client_CA = nullptr; } -static void ssl_crypto_x509_ssl_free(SSL *ssl) { - ssl_crypto_x509_ssl_flush_cached_client_CA(ssl); - X509_VERIFY_PARAM_free(ssl->param); +static void ssl_crypto_x509_ssl_config_free(SSL_CONFIG *cfg) { + sk_X509_NAME_pop_free(cfg->cached_x509_client_CA, X509_NAME_free); + cfg->cached_x509_client_CA = nullptr; + X509_VERIFY_PARAM_free(cfg->param); } -static int ssl_crypto_x509_ssl_auto_chain_if_needed(SSL *ssl) { +static bool ssl_crypto_x509_ssl_auto_chain_if_needed(SSL_HANDSHAKE *hs) { // Only build a chain if there are no intermediates configured and the feature // isn't disabled. - if ((ssl->mode & SSL_MODE_NO_AUTO_CHAIN) || - !ssl_has_certificate(ssl) || - ssl->cert->chain == NULL || - sk_CRYPTO_BUFFER_num(ssl->cert->chain) > 1) { - return 1; + if ((hs->ssl->mode & SSL_MODE_NO_AUTO_CHAIN) || + !ssl_has_certificate(hs) || hs->config->cert->chain == NULL || + sk_CRYPTO_BUFFER_num(hs->config->cert->chain.get()) > 1) { + return true; } - UniquePtr leaf( - X509_parse_from_buffer(sk_CRYPTO_BUFFER_value(ssl->cert->chain, 0))); + UniquePtr leaf(X509_parse_from_buffer( + sk_CRYPTO_BUFFER_value(hs->config->cert->chain.get(), 0))); if (!leaf) { OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); - return 0; + return false; } ScopedX509_STORE_CTX ctx; - if (!X509_STORE_CTX_init(ctx.get(), ssl->ctx->cert_store, leaf.get(), NULL)) { + if (!X509_STORE_CTX_init(ctx.get(), hs->ssl->ctx->cert_store, leaf.get(), + NULL)) { OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); - return 0; + return false; } // Attempt to build a chain, ignoring the result. @@ -466,24 +470,24 @@ static int ssl_crypto_x509_ssl_auto_chain_if_needed(SSL *ssl) { // Remove the leaf from the generated chain. X509_free(sk_X509_shift(ctx->chain)); - if (!ssl_cert_set_chain(ssl->cert, ctx->chain)) { - return 0; + if (!ssl_cert_set_chain(hs->config->cert.get(), ctx->chain)) { + return false; } - ssl_crypto_x509_cert_flush_cached_chain(ssl->cert); + ssl_crypto_x509_cert_flush_cached_chain(hs->config->cert.get()); - return 1; + return true; } static void ssl_crypto_x509_ssl_ctx_flush_cached_client_CA(SSL_CTX *ctx) { sk_X509_NAME_pop_free(ctx->cached_x509_client_CA, X509_NAME_free); - ctx->cached_x509_client_CA = NULL; + ctx->cached_x509_client_CA = nullptr; } -static int ssl_crypto_x509_ssl_ctx_new(SSL_CTX *ctx) { +static bool ssl_crypto_x509_ssl_ctx_new(SSL_CTX *ctx) { ctx->cert_store = X509_STORE_new(); ctx->param = X509_VERIFY_PARAM_new(); - return (ctx->cert_store != NULL && ctx->param != NULL); + return (ctx->cert_store != nullptr && ctx->param != nullptr); } static void ssl_crypto_x509_ssl_ctx_free(SSL_CTX *ctx) { @@ -505,7 +509,7 @@ const SSL_X509_METHOD ssl_crypto_x509_method = { ssl_crypto_x509_session_verify_cert_chain, ssl_crypto_x509_hs_flush_cached_ca_names, ssl_crypto_x509_ssl_new, - ssl_crypto_x509_ssl_free, + ssl_crypto_x509_ssl_config_free, ssl_crypto_x509_ssl_flush_cached_client_CA, ssl_crypto_x509_ssl_auto_chain_if_needed, ssl_crypto_x509_ssl_ctx_new, @@ -513,7 +517,7 @@ const SSL_X509_METHOD ssl_crypto_x509_method = { ssl_crypto_x509_ssl_ctx_flush_cached_client_CA, }; -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -532,39 +536,17 @@ X509 *SSL_get_peer_certificate(const SSL *ssl) { STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl) { check_ssl_x509_method(ssl); - if (ssl == NULL) { - return NULL; + if (ssl == nullptr) { + return nullptr; } SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL || - session->x509_chain == NULL) { - return NULL; - } - - if (!ssl->server) { - return session->x509_chain; + if (session == nullptr) { + return nullptr; } // OpenSSL historically didn't include the leaf certificate in the returned // certificate chain, but only for servers. - if (session->x509_chain_without_leaf == NULL) { - session->x509_chain_without_leaf = sk_X509_new_null(); - if (session->x509_chain_without_leaf == NULL) { - return NULL; - } - - for (size_t i = 1; i < sk_X509_num(session->x509_chain); i++) { - X509 *cert = sk_X509_value(session->x509_chain, i); - if (!sk_X509_push(session->x509_chain_without_leaf, cert)) { - sk_X509_pop_free(session->x509_chain_without_leaf, X509_free); - session->x509_chain_without_leaf = NULL; - return NULL; - } - X509_up_ref(cert); - } - } - - return session->x509_chain_without_leaf; + return ssl->server ? session->x509_chain_without_leaf : session->x509_chain; } STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl) { @@ -584,7 +566,10 @@ int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose) { int SSL_set_purpose(SSL *ssl, int purpose) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_set_purpose(ssl->param, purpose); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set_purpose(ssl->config->param, purpose); } int SSL_CTX_set_trust(SSL_CTX *ctx, int trust) { @@ -594,7 +579,10 @@ int SSL_CTX_set_trust(SSL_CTX *ctx, int trust) { int SSL_set_trust(SSL *ssl, int trust) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_set_trust(ssl->param, trust); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set_trust(ssl->config->param, trust); } int SSL_CTX_set1_param(SSL_CTX *ctx, const X509_VERIFY_PARAM *param) { @@ -604,7 +592,10 @@ int SSL_CTX_set1_param(SSL_CTX *ctx, const X509_VERIFY_PARAM *param) { int SSL_set1_param(SSL *ssl, const X509_VERIFY_PARAM *param) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_set1(ssl->param, param); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set1(ssl->config->param, param); } X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx) { @@ -614,17 +605,29 @@ X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx) { X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl) { check_ssl_x509_method(ssl); - return ssl->param; + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl->config->param; } int SSL_get_verify_depth(const SSL *ssl) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_get_depth(ssl->param); + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return X509_VERIFY_PARAM_get_depth(ssl->config->param); } int (*SSL_get_verify_callback(const SSL *ssl))(int, X509_STORE_CTX *) { check_ssl_x509_method(ssl); - return ssl->verify_callback; + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl->config->verify_callback; } int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) { @@ -646,15 +649,21 @@ int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( void SSL_set_verify(SSL *ssl, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)) { check_ssl_x509_method(ssl); - ssl->verify_mode = mode; + if (!ssl->config) { + return; + } + ssl->config->verify_mode = mode; if (callback != NULL) { - ssl->verify_callback = callback; + ssl->config->verify_callback = callback; } } void SSL_set_verify_depth(SSL *ssl, int depth) { check_ssl_x509_method(ssl); - X509_VERIFY_PARAM_set_depth(ssl->param, depth); + if (!ssl->config) { + return; + } + X509_VERIFY_PARAM_set_depth(ssl->config->param, depth); } void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, @@ -732,12 +741,15 @@ static int ssl_use_certificate(CERT *cert, X509 *x) { int SSL_use_certificate(SSL *ssl, X509 *x) { check_ssl_x509_method(ssl); - return ssl_use_certificate(ssl->cert, x); + if (!ssl->config) { + return 0; + } + return ssl_use_certificate(ssl->config->cert.get(), x); } int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) { check_ssl_ctx_x509_method(ctx); - return ssl_use_certificate(ctx->cert, x); + return ssl_use_certificate(ctx->cert.get(), x); } // ssl_cert_cache_leaf_cert sets |cert->x509_leaf|, if currently NULL, from the @@ -750,7 +762,7 @@ static int ssl_cert_cache_leaf_cert(CERT *cert) { return 1; } - CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain, 0); + CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); if (!leaf) { return 1; } @@ -770,13 +782,17 @@ static X509 *ssl_cert_get0_leaf(CERT *cert) { X509 *SSL_get_certificate(const SSL *ssl) { check_ssl_x509_method(ssl); - return ssl_cert_get0_leaf(ssl->cert); + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl_cert_get0_leaf(ssl->config->cert.get()); } X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx) { check_ssl_ctx_x509_method(ctx); MutexWriteLock lock(const_cast(&ctx->lock)); - return ssl_cert_get0_leaf(ctx->cert); + return ssl_cert_get0_leaf(ctx->cert.get()); } static int ssl_cert_set0_chain(CERT *cert, STACK_OF(X509) *chain) { @@ -807,14 +823,13 @@ static int ssl_cert_append_cert(CERT *cert, X509 *x509) { } if (cert->chain != NULL) { - return PushToStack(cert->chain, std::move(buffer)); + return PushToStack(cert->chain.get(), std::move(buffer)); } cert->chain = new_leafless_chain(); - if (cert->chain == NULL || - !PushToStack(cert->chain, std::move(buffer))) { - sk_CRYPTO_BUFFER_free(cert->chain); - cert->chain = NULL; + if (!cert->chain || + !PushToStack(cert->chain.get(), std::move(buffer))) { + cert->chain.reset(); return 0; } @@ -843,32 +858,38 @@ static int ssl_cert_add1_chain_cert(CERT *cert, X509 *x509) { int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_set0_chain(ctx->cert, chain); + return ssl_cert_set0_chain(ctx->cert.get(), chain); } int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_set1_chain(ctx->cert, chain); + return ssl_cert_set1_chain(ctx->cert.get(), chain); } int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain) { check_ssl_x509_method(ssl); - return ssl_cert_set0_chain(ssl->cert, chain); + if (!ssl->config) { + return 0; + } + return ssl_cert_set0_chain(ssl->config->cert.get(), chain); } int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain) { check_ssl_x509_method(ssl); - return ssl_cert_set1_chain(ssl->cert, chain); + if (!ssl->config) { + return 0; + } + return ssl_cert_set1_chain(ssl->config->cert.get(), chain); } int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_add0_chain_cert(ctx->cert, x509); + return ssl_cert_add0_chain_cert(ctx->cert.get(), x509); } int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_add1_chain_cert(ctx->cert, x509); + return ssl_cert_add1_chain_cert(ctx->cert.get(), x509); } int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509) { @@ -878,12 +899,18 @@ int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509) { int SSL_add0_chain_cert(SSL *ssl, X509 *x509) { check_ssl_x509_method(ssl); - return ssl_cert_add0_chain_cert(ssl->cert, x509); + if (!ssl->config) { + return 0; + } + return ssl_cert_add0_chain_cert(ssl->config->cert.get(), x509); } int SSL_add1_chain_cert(SSL *ssl, X509 *x509) { check_ssl_x509_method(ssl); - return ssl_cert_add1_chain_cert(ssl->cert, x509); + if (!ssl->config) { + return 0; + } + return ssl_cert_add1_chain_cert(ssl->config->cert.get(), x509); } int SSL_CTX_clear_chain_certs(SSL_CTX *ctx) { @@ -906,9 +933,9 @@ int SSL_clear_chain_certs(SSL *ssl) { static int ssl_cert_cache_chain_certs(CERT *cert) { assert(cert->x509_method); - if (cert->x509_chain != NULL || - cert->chain == NULL || - sk_CRYPTO_BUFFER_num(cert->chain) < 2) { + if (cert->x509_chain != nullptr || + cert->chain == nullptr || + sk_CRYPTO_BUFFER_num(cert->chain.get()) < 2) { return 1; } @@ -917,8 +944,8 @@ static int ssl_cert_cache_chain_certs(CERT *cert) { return 0; } - for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain); i++) { - CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(cert->chain, i); + for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain.get()); i++) { + CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(cert->chain.get(), i); UniquePtr x509(X509_parse_from_buffer(buffer)); if (!x509 || !PushToStack(chain.get(), std::move(x509))) { @@ -933,7 +960,7 @@ static int ssl_cert_cache_chain_certs(CERT *cert) { int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, STACK_OF(X509) **out_chain) { check_ssl_ctx_x509_method(ctx); MutexWriteLock lock(const_cast(&ctx->lock)); - if (!ssl_cert_cache_chain_certs(ctx->cert)) { + if (!ssl_cert_cache_chain_certs(ctx->cert.get())) { *out_chain = NULL; return 0; } @@ -949,26 +976,38 @@ int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, int SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain) { check_ssl_x509_method(ssl); - if (!ssl_cert_cache_chain_certs(ssl->cert)) { + if (!ssl->config) { + assert(ssl->config); + return 0; + } + if (!ssl_cert_cache_chain_certs(ssl->config->cert.get())) { *out_chain = NULL; return 0; } - *out_chain = ssl->cert->x509_chain; + *out_chain = ssl->config->cert->x509_chain; return 1; } -static SSL_SESSION *ssl_session_new_with_crypto_x509(void) { - return ssl_session_new(&ssl_crypto_x509_method).release(); -} - SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **out) { - return ASN1_d2i_bio_of(SSL_SESSION, ssl_session_new_with_crypto_x509, - d2i_SSL_SESSION, bio, out); + uint8_t *data; + size_t len; + if (!BIO_read_asn1(bio, &data, &len, 1024 * 1024)) { + return 0; + } + bssl::UniquePtr free_data(data); + const uint8_t *ptr = data; + return d2i_SSL_SESSION(out, &ptr, static_cast(len)); } int i2d_SSL_SESSION_bio(BIO *bio, const SSL_SESSION *session) { - return ASN1_i2d_bio_of(SSL_SESSION, i2d_SSL_SESSION, bio, session); + uint8_t *data; + size_t len; + if (!SSL_SESSION_to_bytes(session, &data, &len)) { + return 0; + } + bssl::UniquePtr free_data(data); + return BIO_write_all(bio, data, len); } IMPLEMENT_PEM_rw(SSL_SESSION, SSL_SESSION, PEM_STRING_SSL_SESSION, SSL_SESSION) @@ -1000,7 +1039,7 @@ STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *list) { return sk_X509_NAME_deep_copy(list, X509_NAME_dup, X509_NAME_free); } -static void set_client_CA_list(STACK_OF(CRYPTO_BUFFER) **ca_list, +static void set_client_CA_list(UniquePtr *ca_list, const STACK_OF(X509_NAME) *name_list, CRYPTO_BUFFER_POOL *pool) { UniquePtr buffers(sk_CRYPTO_BUFFER_new_null()); @@ -1023,14 +1062,16 @@ static void set_client_CA_list(STACK_OF(CRYPTO_BUFFER) **ca_list, } } - sk_CRYPTO_BUFFER_pop_free(*ca_list, CRYPTO_BUFFER_free); - *ca_list = buffers.release(); + *ca_list = std::move(buffers); } void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list) { check_ssl_x509_method(ssl); - ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl); - set_client_CA_list(&ssl->client_CA, name_list, ssl->ctx->pool); + if (!ssl->config) { + return; + } + ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl->config.get()); + set_client_CA_list(&ssl->config->client_CA, name_list, ssl->ctx->pool); sk_X509_NAME_pop_free(name_list, X509_NAME_free); } @@ -1075,6 +1116,10 @@ static STACK_OF(X509_NAME) * STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl) { check_ssl_x509_method(ssl); + if (!ssl->config) { + assert(ssl->config); + return NULL; + } // For historical reasons, this function is used both to query configuration // state on a server as well as handshake state on a client. However, whether // |ssl| is a client or server is not known until explicitly configured with @@ -1089,11 +1134,12 @@ STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl) { return NULL; } - if (ssl->client_CA != NULL) { + if (ssl->config->client_CA != NULL) { return buffer_names_to_x509( - ssl->client_CA, (STACK_OF(X509_NAME) **)&ssl->cached_x509_client_CA); + ssl->config->client_CA.get(), + (STACK_OF(X509_NAME) **)&ssl->config->cached_x509_client_CA); } - return SSL_CTX_get_client_CA_list(ssl->ctx); + return SSL_CTX_get_client_CA_list(ssl->ctx.get()); } STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx) { @@ -1102,11 +1148,11 @@ STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx) { // so it needs to lock around updating |cached_x509_client_CA|. MutexWriteLock lock(const_cast(&ctx->lock)); return buffer_names_to_x509( - ctx->client_CA, + ctx->client_CA.get(), const_cast(&ctx->cached_x509_client_CA)); } -static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, +static int add_client_CA(UniquePtr *names, X509 *x509, CRYPTO_BUFFER_POOL *pool) { if (x509 == NULL) { return 0; @@ -1125,8 +1171,8 @@ static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, } int alloced = 0; - if (*names == NULL) { - *names = sk_CRYPTO_BUFFER_new_null(); + if (*names == nullptr) { + names->reset(sk_CRYPTO_BUFFER_new_null()); alloced = 1; if (*names == NULL) { @@ -1134,10 +1180,9 @@ static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, } } - if (!PushToStack(*names, std::move(buffer))) { + if (!PushToStack(names->get(), std::move(buffer))) { if (alloced) { - sk_CRYPTO_BUFFER_pop_free(*names, CRYPTO_BUFFER_free); - *names = NULL; + names->reset(); } return 0; } @@ -1147,11 +1192,14 @@ static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, int SSL_add_client_CA(SSL *ssl, X509 *x509) { check_ssl_x509_method(ssl); - if (!add_client_CA(&ssl->client_CA, x509, ssl->ctx->pool)) { + if (!ssl->config) { + return 0; + } + if (!add_client_CA(&ssl->config->client_CA, x509, ssl->ctx->pool)) { return 0; } - ssl_crypto_x509_ssl_flush_cached_client_CA(ssl); + ssl_crypto_x509_ssl_flush_cached_client_CA(ssl->config.get()); return 1; } @@ -1166,7 +1214,14 @@ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509) { } static int do_client_cert_cb(SSL *ssl, void *arg) { - if (ssl_has_certificate(ssl) || ssl->ctx->client_cert_cb == NULL) { + // Should only be called during handshake, but check to be sure. + if (!ssl->config) { + assert(ssl->config); + return -1; + } + + if (ssl_has_certificate(ssl->s3->hs.get()) || + ssl->ctx->client_cert_cb == NULL) { return 1; } @@ -1230,12 +1285,18 @@ int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *store) { int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store) { check_ssl_x509_method(ssl); - return set_cert_store(&ssl->cert->verify_store, store, 0); + if (!ssl->config) { + return 0; + } + return set_cert_store(&ssl->config->cert->verify_store, store, 0); } int SSL_set1_verify_cert_store(SSL *ssl, X509_STORE *store) { check_ssl_x509_method(ssl); - return set_cert_store(&ssl->cert->verify_store, store, 1); + if (!ssl->config) { + return 0; + } + return set_cert_store(&ssl->config->cert->verify_store, store, 1); } int SSL_alert_from_verify_result(long result) { diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_x509.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc.grpc_back similarity index 75% rename from Pods/BoringSSL-GRPC/ssl/ssl_x509.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc.grpc_back index cc27a6016..cda761171 100644 --- a/Pods/BoringSSL-GRPC/ssl/ssl_x509.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/ssl_x509.cc.grpc_back @@ -155,7 +155,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // check_ssl_x509_method asserts that |ssl| has the X509-based method // installed. Calling an X509-based method on an |ssl| with a different method @@ -186,15 +186,11 @@ static UniquePtr x509_to_buffer(X509 *x509) { } // new_leafless_chain returns a fresh stack of buffers set to {NULL}. -static STACK_OF(CRYPTO_BUFFER) *new_leafless_chain(void) { - STACK_OF(CRYPTO_BUFFER) *chain = sk_CRYPTO_BUFFER_new_null(); - if (chain == NULL) { - return NULL; - } - - if (!sk_CRYPTO_BUFFER_push(chain, NULL)) { - sk_CRYPTO_BUFFER_free(chain); - return NULL; +static UniquePtr new_leafless_chain(void) { + UniquePtr chain(sk_CRYPTO_BUFFER_new_null()); + if (!chain || + !sk_CRYPTO_BUFFER_push(chain.get(), nullptr)) { + return nullptr; } return chain; @@ -204,70 +200,64 @@ static STACK_OF(CRYPTO_BUFFER) *new_leafless_chain(void) { // forms of elements of |chain|. It returns one on success or zero on error, in // which case no change to |cert->chain| is made. It preverses the existing // leaf from |cert->chain|, if any. -static int ssl_cert_set_chain(CERT *cert, STACK_OF(X509) *chain) { +static bool ssl_cert_set_chain(CERT *cert, STACK_OF(X509) *chain) { UniquePtr new_chain; - if (cert->chain != NULL) { + if (cert->chain != nullptr) { new_chain.reset(sk_CRYPTO_BUFFER_new_null()); if (!new_chain) { - return 0; + return false; } - CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain, 0); - if (!sk_CRYPTO_BUFFER_push(new_chain.get(), leaf)) { - return 0; - } // |leaf| might be NULL if it's a “leafless” chain. - if (leaf != NULL) { - CRYPTO_BUFFER_up_ref(leaf); + CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); + if (!PushToStack(new_chain.get(), UpRef(leaf))) { + return false; } } for (X509 *x509 : chain) { if (!new_chain) { - new_chain.reset(new_leafless_chain()); + new_chain = new_leafless_chain(); if (!new_chain) { - return 0; + return false; } } UniquePtr buffer = x509_to_buffer(x509); if (!buffer || !PushToStack(new_chain.get(), std::move(buffer))) { - return 0; + return false; } } - sk_CRYPTO_BUFFER_pop_free(cert->chain, CRYPTO_BUFFER_free); - cert->chain = new_chain.release(); - - return 1; + cert->chain = std::move(new_chain); + return true; } static void ssl_crypto_x509_cert_flush_cached_leaf(CERT *cert) { X509_free(cert->x509_leaf); - cert->x509_leaf = NULL; + cert->x509_leaf = nullptr; } static void ssl_crypto_x509_cert_flush_cached_chain(CERT *cert) { sk_X509_pop_free(cert->x509_chain, X509_free); - cert->x509_chain = NULL; + cert->x509_chain = nullptr; } -static int ssl_crypto_x509_check_client_CA_list( +static bool ssl_crypto_x509_check_client_CA_list( STACK_OF(CRYPTO_BUFFER) *names) { for (const CRYPTO_BUFFER *buffer : names) { const uint8_t *inp = CRYPTO_BUFFER_data(buffer); - X509_NAME *name = d2i_X509_NAME(NULL, &inp, CRYPTO_BUFFER_len(buffer)); - const int ok = name != NULL && inp == CRYPTO_BUFFER_data(buffer) + - CRYPTO_BUFFER_len(buffer); - X509_NAME_free(name); - if (!ok) { - return 0; + UniquePtr name( + d2i_X509_NAME(nullptr, &inp, CRYPTO_BUFFER_len(buffer))); + if (name == nullptr || + inp != CRYPTO_BUFFER_data(buffer) + CRYPTO_BUFFER_len(buffer)) { + return false; } } - return 1; + return true; } static void ssl_crypto_x509_cert_clear(CERT *cert) { @@ -275,7 +265,7 @@ static void ssl_crypto_x509_cert_clear(CERT *cert) { ssl_crypto_x509_cert_flush_cached_chain(cert); X509_free(cert->x509_stash); - cert->x509_stash = NULL; + cert->x509_stash = nullptr; } static void ssl_crypto_x509_cert_free(CERT *cert) { @@ -284,118 +274,131 @@ static void ssl_crypto_x509_cert_free(CERT *cert) { } static void ssl_crypto_x509_cert_dup(CERT *new_cert, const CERT *cert) { - if (cert->verify_store != NULL) { + if (cert->verify_store != nullptr) { X509_STORE_up_ref(cert->verify_store); new_cert->verify_store = cert->verify_store; } } -static int ssl_crypto_x509_session_cache_objects(SSL_SESSION *sess) { - bssl::UniquePtr chain; - if (sk_CRYPTO_BUFFER_num(sess->certs) > 0) { +static bool ssl_crypto_x509_session_cache_objects(SSL_SESSION *sess) { + bssl::UniquePtr chain, chain_without_leaf; + if (sk_CRYPTO_BUFFER_num(sess->certs.get()) > 0) { chain.reset(sk_X509_new_null()); if (!chain) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; + return false; + } + if (sess->is_server) { + // chain_without_leaf is only needed for server sessions. See + // |SSL_get_peer_cert_chain|. + chain_without_leaf.reset(sk_X509_new_null()); + if (!chain_without_leaf) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } } } - X509 *leaf = nullptr; - for (CRYPTO_BUFFER *cert : sess->certs) { + bssl::UniquePtr leaf; + for (CRYPTO_BUFFER *cert : sess->certs.get()) { UniquePtr x509(X509_parse_from_buffer(cert)); if (!x509) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; + return false; } if (leaf == nullptr) { - leaf = x509.get(); + leaf = UpRef(x509); + } else if (chain_without_leaf && + !PushToStack(chain_without_leaf.get(), UpRef(x509))) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; } if (!PushToStack(chain.get(), std::move(x509))) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; + return false; } } sk_X509_pop_free(sess->x509_chain, X509_free); sess->x509_chain = chain.release(); + sk_X509_pop_free(sess->x509_chain_without_leaf, X509_free); - sess->x509_chain_without_leaf = NULL; + sess->x509_chain_without_leaf = chain_without_leaf.release(); X509_free(sess->x509_peer); - if (leaf != NULL) { - X509_up_ref(leaf); - } - sess->x509_peer = leaf; - return 1; + sess->x509_peer = leaf.release(); + return true; } -static int ssl_crypto_x509_session_dup(SSL_SESSION *new_session, - const SSL_SESSION *session) { - if (session->x509_peer != NULL) { - X509_up_ref(session->x509_peer); - new_session->x509_peer = session->x509_peer; - } - if (session->x509_chain != NULL) { +static bool ssl_crypto_x509_session_dup(SSL_SESSION *new_session, + const SSL_SESSION *session) { + new_session->x509_peer = UpRef(session->x509_peer).release(); + if (session->x509_chain != nullptr) { new_session->x509_chain = X509_chain_up_ref(session->x509_chain); - if (new_session->x509_chain == NULL) { - return 0; + if (new_session->x509_chain == nullptr) { + return false; + } + } + if (session->x509_chain_without_leaf != nullptr) { + new_session->x509_chain_without_leaf = + X509_chain_up_ref(session->x509_chain_without_leaf); + if (new_session->x509_chain_without_leaf == nullptr) { + return false; } } - return 1; + return true; } static void ssl_crypto_x509_session_clear(SSL_SESSION *session) { X509_free(session->x509_peer); - session->x509_peer = NULL; + session->x509_peer = nullptr; sk_X509_pop_free(session->x509_chain, X509_free); - session->x509_chain = NULL; + session->x509_chain = nullptr; sk_X509_pop_free(session->x509_chain_without_leaf, X509_free); - session->x509_chain_without_leaf = NULL; + session->x509_chain_without_leaf = nullptr; } -static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session, - SSL *ssl, - uint8_t *out_alert) { +static bool ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session, + SSL_HANDSHAKE *hs, + uint8_t *out_alert) { *out_alert = SSL_AD_INTERNAL_ERROR; STACK_OF(X509) *const cert_chain = session->x509_chain; - if (cert_chain == NULL || sk_X509_num(cert_chain) == 0) { - return 0; + if (cert_chain == nullptr || sk_X509_num(cert_chain) == 0) { + return false; } - X509_STORE *verify_store = ssl->ctx->cert_store; - if (ssl->cert->verify_store != NULL) { - verify_store = ssl->cert->verify_store; + SSL_CTX *ssl_ctx = hs->ssl->ctx.get(); + X509_STORE *verify_store = ssl_ctx->cert_store; + if (hs->config->cert->verify_store != nullptr) { + verify_store = hs->config->cert->verify_store; } X509 *leaf = sk_X509_value(cert_chain, 0); ScopedX509_STORE_CTX ctx; - if (!X509_STORE_CTX_init(ctx.get(), verify_store, leaf, cert_chain)) { + if (!X509_STORE_CTX_init(ctx.get(), verify_store, leaf, cert_chain) || + !X509_STORE_CTX_set_ex_data( + ctx.get(), SSL_get_ex_data_X509_STORE_CTX_idx(), hs->ssl) || + // We need to inherit the verify parameters. These can be determined by + // the context: if its a server it will verify SSL client certificates or + // vice versa. + !X509_STORE_CTX_set_default( + ctx.get(), hs->ssl->server ? "ssl_client" : "ssl_server") || + // Anything non-default in "param" should overwrite anything in the ctx. + !X509_VERIFY_PARAM_set1(X509_STORE_CTX_get0_param(ctx.get()), + hs->config->param)) { OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); - return 0; + return false; } - if (!X509_STORE_CTX_set_ex_data(ctx.get(), - SSL_get_ex_data_X509_STORE_CTX_idx(), ssl)) { - return 0; - } - - // We need to inherit the verify parameters. These can be determined by the - // context: if its a server it will verify SSL client certificates or vice - // versa. - X509_STORE_CTX_set_default(ctx.get(), - ssl->server ? "ssl_client" : "ssl_server"); - // Anything non-default in "param" should overwrite anything in the ctx. - X509_VERIFY_PARAM_set1(X509_STORE_CTX_get0_param(ctx.get()), ssl->param); - - if (ssl->verify_callback) { - X509_STORE_CTX_set_verify_cb(ctx.get(), ssl->verify_callback); + if (hs->config->verify_callback) { + X509_STORE_CTX_set_verify_cb(ctx.get(), hs->config->verify_callback); } int verify_ret; - if (ssl->ctx->app_verify_callback != NULL) { + if (ssl_ctx->app_verify_callback != nullptr) { verify_ret = - ssl->ctx->app_verify_callback(ctx.get(), ssl->ctx->app_verify_arg); + ssl_ctx->app_verify_callback(ctx.get(), ssl_ctx->app_verify_arg); } else { verify_ret = X509_verify_cert(ctx.get()); } @@ -403,60 +406,61 @@ static int ssl_crypto_x509_session_verify_cert_chain(SSL_SESSION *session, session->verify_result = ctx->error; // If |SSL_VERIFY_NONE|, the error is non-fatal, but we keep the result. - if (verify_ret <= 0 && ssl->verify_mode != SSL_VERIFY_NONE) { + if (verify_ret <= 0 && hs->config->verify_mode != SSL_VERIFY_NONE) { *out_alert = SSL_alert_from_verify_result(ctx->error); - return 0; + return false; } ERR_clear_error(); - return 1; + return true; } static void ssl_crypto_x509_hs_flush_cached_ca_names(SSL_HANDSHAKE *hs) { sk_X509_NAME_pop_free(hs->cached_x509_ca_names, X509_NAME_free); - hs->cached_x509_ca_names = NULL; + hs->cached_x509_ca_names = nullptr; } -static int ssl_crypto_x509_ssl_new(SSL *ssl) { - ssl->param = X509_VERIFY_PARAM_new(); - if (ssl->param == NULL) { - return 0; +static bool ssl_crypto_x509_ssl_new(SSL_HANDSHAKE *hs) { + hs->config->param = X509_VERIFY_PARAM_new(); + if (hs->config->param == nullptr) { + return false; } - X509_VERIFY_PARAM_inherit(ssl->param, ssl->ctx->param); - return 1; + X509_VERIFY_PARAM_inherit(hs->config->param, hs->ssl->ctx->param); + return true; } -static void ssl_crypto_x509_ssl_flush_cached_client_CA(SSL *ssl) { - sk_X509_NAME_pop_free(ssl->cached_x509_client_CA, X509_NAME_free); - ssl->cached_x509_client_CA = NULL; +static void ssl_crypto_x509_ssl_flush_cached_client_CA(SSL_CONFIG *cfg) { + sk_X509_NAME_pop_free(cfg->cached_x509_client_CA, X509_NAME_free); + cfg->cached_x509_client_CA = nullptr; } -static void ssl_crypto_x509_ssl_free(SSL *ssl) { - ssl_crypto_x509_ssl_flush_cached_client_CA(ssl); - X509_VERIFY_PARAM_free(ssl->param); +static void ssl_crypto_x509_ssl_config_free(SSL_CONFIG *cfg) { + sk_X509_NAME_pop_free(cfg->cached_x509_client_CA, X509_NAME_free); + cfg->cached_x509_client_CA = nullptr; + X509_VERIFY_PARAM_free(cfg->param); } -static int ssl_crypto_x509_ssl_auto_chain_if_needed(SSL *ssl) { +static bool ssl_crypto_x509_ssl_auto_chain_if_needed(SSL_HANDSHAKE *hs) { // Only build a chain if there are no intermediates configured and the feature // isn't disabled. - if ((ssl->mode & SSL_MODE_NO_AUTO_CHAIN) || - !ssl_has_certificate(ssl) || - ssl->cert->chain == NULL || - sk_CRYPTO_BUFFER_num(ssl->cert->chain) > 1) { - return 1; + if ((hs->ssl->mode & SSL_MODE_NO_AUTO_CHAIN) || + !ssl_has_certificate(hs) || hs->config->cert->chain == NULL || + sk_CRYPTO_BUFFER_num(hs->config->cert->chain.get()) > 1) { + return true; } - UniquePtr leaf( - X509_parse_from_buffer(sk_CRYPTO_BUFFER_value(ssl->cert->chain, 0))); + UniquePtr leaf(X509_parse_from_buffer( + sk_CRYPTO_BUFFER_value(hs->config->cert->chain.get(), 0))); if (!leaf) { OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); - return 0; + return false; } ScopedX509_STORE_CTX ctx; - if (!X509_STORE_CTX_init(ctx.get(), ssl->ctx->cert_store, leaf.get(), NULL)) { + if (!X509_STORE_CTX_init(ctx.get(), hs->ssl->ctx->cert_store, leaf.get(), + NULL)) { OPENSSL_PUT_ERROR(SSL, ERR_R_X509_LIB); - return 0; + return false; } // Attempt to build a chain, ignoring the result. @@ -466,24 +470,24 @@ static int ssl_crypto_x509_ssl_auto_chain_if_needed(SSL *ssl) { // Remove the leaf from the generated chain. X509_free(sk_X509_shift(ctx->chain)); - if (!ssl_cert_set_chain(ssl->cert, ctx->chain)) { - return 0; + if (!ssl_cert_set_chain(hs->config->cert.get(), ctx->chain)) { + return false; } - ssl_crypto_x509_cert_flush_cached_chain(ssl->cert); + ssl_crypto_x509_cert_flush_cached_chain(hs->config->cert.get()); - return 1; + return true; } static void ssl_crypto_x509_ssl_ctx_flush_cached_client_CA(SSL_CTX *ctx) { sk_X509_NAME_pop_free(ctx->cached_x509_client_CA, X509_NAME_free); - ctx->cached_x509_client_CA = NULL; + ctx->cached_x509_client_CA = nullptr; } -static int ssl_crypto_x509_ssl_ctx_new(SSL_CTX *ctx) { +static bool ssl_crypto_x509_ssl_ctx_new(SSL_CTX *ctx) { ctx->cert_store = X509_STORE_new(); ctx->param = X509_VERIFY_PARAM_new(); - return (ctx->cert_store != NULL && ctx->param != NULL); + return (ctx->cert_store != nullptr && ctx->param != nullptr); } static void ssl_crypto_x509_ssl_ctx_free(SSL_CTX *ctx) { @@ -505,7 +509,7 @@ const SSL_X509_METHOD ssl_crypto_x509_method = { ssl_crypto_x509_session_verify_cert_chain, ssl_crypto_x509_hs_flush_cached_ca_names, ssl_crypto_x509_ssl_new, - ssl_crypto_x509_ssl_free, + ssl_crypto_x509_ssl_config_free, ssl_crypto_x509_ssl_flush_cached_client_CA, ssl_crypto_x509_ssl_auto_chain_if_needed, ssl_crypto_x509_ssl_ctx_new, @@ -513,7 +517,7 @@ const SSL_X509_METHOD ssl_crypto_x509_method = { ssl_crypto_x509_ssl_ctx_flush_cached_client_CA, }; -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -532,39 +536,17 @@ X509 *SSL_get_peer_certificate(const SSL *ssl) { STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *ssl) { check_ssl_x509_method(ssl); - if (ssl == NULL) { - return NULL; + if (ssl == nullptr) { + return nullptr; } SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL || - session->x509_chain == NULL) { - return NULL; - } - - if (!ssl->server) { - return session->x509_chain; + if (session == nullptr) { + return nullptr; } // OpenSSL historically didn't include the leaf certificate in the returned // certificate chain, but only for servers. - if (session->x509_chain_without_leaf == NULL) { - session->x509_chain_without_leaf = sk_X509_new_null(); - if (session->x509_chain_without_leaf == NULL) { - return NULL; - } - - for (size_t i = 1; i < sk_X509_num(session->x509_chain); i++) { - X509 *cert = sk_X509_value(session->x509_chain, i); - if (!sk_X509_push(session->x509_chain_without_leaf, cert)) { - sk_X509_pop_free(session->x509_chain_without_leaf, X509_free); - session->x509_chain_without_leaf = NULL; - return NULL; - } - X509_up_ref(cert); - } - } - - return session->x509_chain_without_leaf; + return ssl->server ? session->x509_chain_without_leaf : session->x509_chain; } STACK_OF(X509) *SSL_get_peer_full_cert_chain(const SSL *ssl) { @@ -584,7 +566,10 @@ int SSL_CTX_set_purpose(SSL_CTX *ctx, int purpose) { int SSL_set_purpose(SSL *ssl, int purpose) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_set_purpose(ssl->param, purpose); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set_purpose(ssl->config->param, purpose); } int SSL_CTX_set_trust(SSL_CTX *ctx, int trust) { @@ -594,7 +579,10 @@ int SSL_CTX_set_trust(SSL_CTX *ctx, int trust) { int SSL_set_trust(SSL *ssl, int trust) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_set_trust(ssl->param, trust); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set_trust(ssl->config->param, trust); } int SSL_CTX_set1_param(SSL_CTX *ctx, const X509_VERIFY_PARAM *param) { @@ -604,7 +592,10 @@ int SSL_CTX_set1_param(SSL_CTX *ctx, const X509_VERIFY_PARAM *param) { int SSL_set1_param(SSL *ssl, const X509_VERIFY_PARAM *param) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_set1(ssl->param, param); + if (!ssl->config) { + return 0; + } + return X509_VERIFY_PARAM_set1(ssl->config->param, param); } X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx) { @@ -614,17 +605,29 @@ X509_VERIFY_PARAM *SSL_CTX_get0_param(SSL_CTX *ctx) { X509_VERIFY_PARAM *SSL_get0_param(SSL *ssl) { check_ssl_x509_method(ssl); - return ssl->param; + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl->config->param; } int SSL_get_verify_depth(const SSL *ssl) { check_ssl_x509_method(ssl); - return X509_VERIFY_PARAM_get_depth(ssl->param); + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return X509_VERIFY_PARAM_get_depth(ssl->config->param); } int (*SSL_get_verify_callback(const SSL *ssl))(int, X509_STORE_CTX *) { check_ssl_x509_method(ssl); - return ssl->verify_callback; + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl->config->verify_callback; } int SSL_CTX_get_verify_mode(const SSL_CTX *ctx) { @@ -646,15 +649,21 @@ int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))( void SSL_set_verify(SSL *ssl, int mode, int (*callback)(int ok, X509_STORE_CTX *store_ctx)) { check_ssl_x509_method(ssl); - ssl->verify_mode = mode; + if (!ssl->config) { + return; + } + ssl->config->verify_mode = mode; if (callback != NULL) { - ssl->verify_callback = callback; + ssl->config->verify_callback = callback; } } void SSL_set_verify_depth(SSL *ssl, int depth) { check_ssl_x509_method(ssl); - X509_VERIFY_PARAM_set_depth(ssl->param, depth); + if (!ssl->config) { + return; + } + X509_VERIFY_PARAM_set_depth(ssl->config->param, depth); } void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, @@ -732,12 +741,15 @@ static int ssl_use_certificate(CERT *cert, X509 *x) { int SSL_use_certificate(SSL *ssl, X509 *x) { check_ssl_x509_method(ssl); - return ssl_use_certificate(ssl->cert, x); + if (!ssl->config) { + return 0; + } + return ssl_use_certificate(ssl->config->cert.get(), x); } int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x) { check_ssl_ctx_x509_method(ctx); - return ssl_use_certificate(ctx->cert, x); + return ssl_use_certificate(ctx->cert.get(), x); } // ssl_cert_cache_leaf_cert sets |cert->x509_leaf|, if currently NULL, from the @@ -750,7 +762,7 @@ static int ssl_cert_cache_leaf_cert(CERT *cert) { return 1; } - CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain, 0); + CRYPTO_BUFFER *leaf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); if (!leaf) { return 1; } @@ -770,13 +782,17 @@ static X509 *ssl_cert_get0_leaf(CERT *cert) { X509 *SSL_get_certificate(const SSL *ssl) { check_ssl_x509_method(ssl); - return ssl_cert_get0_leaf(ssl->cert); + if (!ssl->config) { + assert(ssl->config); + return 0; + } + return ssl_cert_get0_leaf(ssl->config->cert.get()); } X509 *SSL_CTX_get0_certificate(const SSL_CTX *ctx) { check_ssl_ctx_x509_method(ctx); MutexWriteLock lock(const_cast(&ctx->lock)); - return ssl_cert_get0_leaf(ctx->cert); + return ssl_cert_get0_leaf(ctx->cert.get()); } static int ssl_cert_set0_chain(CERT *cert, STACK_OF(X509) *chain) { @@ -807,14 +823,13 @@ static int ssl_cert_append_cert(CERT *cert, X509 *x509) { } if (cert->chain != NULL) { - return PushToStack(cert->chain, std::move(buffer)); + return PushToStack(cert->chain.get(), std::move(buffer)); } cert->chain = new_leafless_chain(); - if (cert->chain == NULL || - !PushToStack(cert->chain, std::move(buffer))) { - sk_CRYPTO_BUFFER_free(cert->chain); - cert->chain = NULL; + if (!cert->chain || + !PushToStack(cert->chain.get(), std::move(buffer))) { + cert->chain.reset(); return 0; } @@ -843,32 +858,38 @@ static int ssl_cert_add1_chain_cert(CERT *cert, X509 *x509) { int SSL_CTX_set0_chain(SSL_CTX *ctx, STACK_OF(X509) *chain) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_set0_chain(ctx->cert, chain); + return ssl_cert_set0_chain(ctx->cert.get(), chain); } int SSL_CTX_set1_chain(SSL_CTX *ctx, STACK_OF(X509) *chain) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_set1_chain(ctx->cert, chain); + return ssl_cert_set1_chain(ctx->cert.get(), chain); } int SSL_set0_chain(SSL *ssl, STACK_OF(X509) *chain) { check_ssl_x509_method(ssl); - return ssl_cert_set0_chain(ssl->cert, chain); + if (!ssl->config) { + return 0; + } + return ssl_cert_set0_chain(ssl->config->cert.get(), chain); } int SSL_set1_chain(SSL *ssl, STACK_OF(X509) *chain) { check_ssl_x509_method(ssl); - return ssl_cert_set1_chain(ssl->cert, chain); + if (!ssl->config) { + return 0; + } + return ssl_cert_set1_chain(ssl->config->cert.get(), chain); } int SSL_CTX_add0_chain_cert(SSL_CTX *ctx, X509 *x509) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_add0_chain_cert(ctx->cert, x509); + return ssl_cert_add0_chain_cert(ctx->cert.get(), x509); } int SSL_CTX_add1_chain_cert(SSL_CTX *ctx, X509 *x509) { check_ssl_ctx_x509_method(ctx); - return ssl_cert_add1_chain_cert(ctx->cert, x509); + return ssl_cert_add1_chain_cert(ctx->cert.get(), x509); } int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509) { @@ -878,12 +899,18 @@ int SSL_CTX_add_extra_chain_cert(SSL_CTX *ctx, X509 *x509) { int SSL_add0_chain_cert(SSL *ssl, X509 *x509) { check_ssl_x509_method(ssl); - return ssl_cert_add0_chain_cert(ssl->cert, x509); + if (!ssl->config) { + return 0; + } + return ssl_cert_add0_chain_cert(ssl->config->cert.get(), x509); } int SSL_add1_chain_cert(SSL *ssl, X509 *x509) { check_ssl_x509_method(ssl); - return ssl_cert_add1_chain_cert(ssl->cert, x509); + if (!ssl->config) { + return 0; + } + return ssl_cert_add1_chain_cert(ssl->config->cert.get(), x509); } int SSL_CTX_clear_chain_certs(SSL_CTX *ctx) { @@ -906,9 +933,9 @@ int SSL_clear_chain_certs(SSL *ssl) { static int ssl_cert_cache_chain_certs(CERT *cert) { assert(cert->x509_method); - if (cert->x509_chain != NULL || - cert->chain == NULL || - sk_CRYPTO_BUFFER_num(cert->chain) < 2) { + if (cert->x509_chain != nullptr || + cert->chain == nullptr || + sk_CRYPTO_BUFFER_num(cert->chain.get()) < 2) { return 1; } @@ -917,8 +944,8 @@ static int ssl_cert_cache_chain_certs(CERT *cert) { return 0; } - for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain); i++) { - CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(cert->chain, i); + for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain.get()); i++) { + CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(cert->chain.get(), i); UniquePtr x509(X509_parse_from_buffer(buffer)); if (!x509 || !PushToStack(chain.get(), std::move(x509))) { @@ -933,7 +960,7 @@ static int ssl_cert_cache_chain_certs(CERT *cert) { int SSL_CTX_get0_chain_certs(const SSL_CTX *ctx, STACK_OF(X509) **out_chain) { check_ssl_ctx_x509_method(ctx); MutexWriteLock lock(const_cast(&ctx->lock)); - if (!ssl_cert_cache_chain_certs(ctx->cert)) { + if (!ssl_cert_cache_chain_certs(ctx->cert.get())) { *out_chain = NULL; return 0; } @@ -949,26 +976,38 @@ int SSL_CTX_get_extra_chain_certs(const SSL_CTX *ctx, int SSL_get0_chain_certs(const SSL *ssl, STACK_OF(X509) **out_chain) { check_ssl_x509_method(ssl); - if (!ssl_cert_cache_chain_certs(ssl->cert)) { + if (!ssl->config) { + assert(ssl->config); + return 0; + } + if (!ssl_cert_cache_chain_certs(ssl->config->cert.get())) { *out_chain = NULL; return 0; } - *out_chain = ssl->cert->x509_chain; + *out_chain = ssl->config->cert->x509_chain; return 1; } -static SSL_SESSION *ssl_session_new_with_crypto_x509(void) { - return ssl_session_new(&ssl_crypto_x509_method).release(); -} - SSL_SESSION *d2i_SSL_SESSION_bio(BIO *bio, SSL_SESSION **out) { - return ASN1_d2i_bio_of(SSL_SESSION, ssl_session_new_with_crypto_x509, - d2i_SSL_SESSION, bio, out); + uint8_t *data; + size_t len; + if (!BIO_read_asn1(bio, &data, &len, 1024 * 1024)) { + return 0; + } + bssl::UniquePtr free_data(data); + const uint8_t *ptr = data; + return d2i_SSL_SESSION(out, &ptr, static_cast(len)); } int i2d_SSL_SESSION_bio(BIO *bio, const SSL_SESSION *session) { - return ASN1_i2d_bio_of(SSL_SESSION, i2d_SSL_SESSION, bio, session); + uint8_t *data; + size_t len; + if (!SSL_SESSION_to_bytes(session, &data, &len)) { + return 0; + } + bssl::UniquePtr free_data(data); + return BIO_write_all(bio, data, len); } IMPLEMENT_PEM_rw(SSL_SESSION, SSL_SESSION, PEM_STRING_SSL_SESSION, SSL_SESSION) @@ -1000,7 +1039,7 @@ STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *list) { return sk_X509_NAME_deep_copy(list, X509_NAME_dup, X509_NAME_free); } -static void set_client_CA_list(STACK_OF(CRYPTO_BUFFER) **ca_list, +static void set_client_CA_list(UniquePtr *ca_list, const STACK_OF(X509_NAME) *name_list, CRYPTO_BUFFER_POOL *pool) { UniquePtr buffers(sk_CRYPTO_BUFFER_new_null()); @@ -1023,14 +1062,16 @@ static void set_client_CA_list(STACK_OF(CRYPTO_BUFFER) **ca_list, } } - sk_CRYPTO_BUFFER_pop_free(*ca_list, CRYPTO_BUFFER_free); - *ca_list = buffers.release(); + *ca_list = std::move(buffers); } void SSL_set_client_CA_list(SSL *ssl, STACK_OF(X509_NAME) *name_list) { check_ssl_x509_method(ssl); - ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl); - set_client_CA_list(&ssl->client_CA, name_list, ssl->ctx->pool); + if (!ssl->config) { + return; + } + ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl->config.get()); + set_client_CA_list(&ssl->config->client_CA, name_list, ssl->ctx->pool); sk_X509_NAME_pop_free(name_list, X509_NAME_free); } @@ -1075,6 +1116,10 @@ static STACK_OF(X509_NAME) * STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl) { check_ssl_x509_method(ssl); + if (!ssl->config) { + assert(ssl->config); + return NULL; + } // For historical reasons, this function is used both to query configuration // state on a server as well as handshake state on a client. However, whether // |ssl| is a client or server is not known until explicitly configured with @@ -1089,11 +1134,12 @@ STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *ssl) { return NULL; } - if (ssl->client_CA != NULL) { + if (ssl->config->client_CA != NULL) { return buffer_names_to_x509( - ssl->client_CA, (STACK_OF(X509_NAME) **)&ssl->cached_x509_client_CA); + ssl->config->client_CA.get(), + (STACK_OF(X509_NAME) **)&ssl->config->cached_x509_client_CA); } - return SSL_CTX_get_client_CA_list(ssl->ctx); + return SSL_CTX_get_client_CA_list(ssl->ctx.get()); } STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx) { @@ -1102,11 +1148,11 @@ STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *ctx) { // so it needs to lock around updating |cached_x509_client_CA|. MutexWriteLock lock(const_cast(&ctx->lock)); return buffer_names_to_x509( - ctx->client_CA, + ctx->client_CA.get(), const_cast(&ctx->cached_x509_client_CA)); } -static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, +static int add_client_CA(UniquePtr *names, X509 *x509, CRYPTO_BUFFER_POOL *pool) { if (x509 == NULL) { return 0; @@ -1125,8 +1171,8 @@ static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, } int alloced = 0; - if (*names == NULL) { - *names = sk_CRYPTO_BUFFER_new_null(); + if (*names == nullptr) { + names->reset(sk_CRYPTO_BUFFER_new_null()); alloced = 1; if (*names == NULL) { @@ -1134,10 +1180,9 @@ static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, } } - if (!PushToStack(*names, std::move(buffer))) { + if (!PushToStack(names->get(), std::move(buffer))) { if (alloced) { - sk_CRYPTO_BUFFER_pop_free(*names, CRYPTO_BUFFER_free); - *names = NULL; + names->reset(); } return 0; } @@ -1147,11 +1192,14 @@ static int add_client_CA(STACK_OF(CRYPTO_BUFFER) **names, X509 *x509, int SSL_add_client_CA(SSL *ssl, X509 *x509) { check_ssl_x509_method(ssl); - if (!add_client_CA(&ssl->client_CA, x509, ssl->ctx->pool)) { + if (!ssl->config) { + return 0; + } + if (!add_client_CA(&ssl->config->client_CA, x509, ssl->ctx->pool)) { return 0; } - ssl_crypto_x509_ssl_flush_cached_client_CA(ssl); + ssl_crypto_x509_ssl_flush_cached_client_CA(ssl->config.get()); return 1; } @@ -1166,7 +1214,14 @@ int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x509) { } static int do_client_cert_cb(SSL *ssl, void *arg) { - if (ssl_has_certificate(ssl) || ssl->ctx->client_cert_cb == NULL) { + // Should only be called during handshake, but check to be sure. + if (!ssl->config) { + assert(ssl->config); + return -1; + } + + if (ssl_has_certificate(ssl->s3->hs.get()) || + ssl->ctx->client_cert_cb == NULL) { return 1; } @@ -1230,12 +1285,18 @@ int SSL_CTX_set1_verify_cert_store(SSL_CTX *ctx, X509_STORE *store) { int SSL_set0_verify_cert_store(SSL *ssl, X509_STORE *store) { check_ssl_x509_method(ssl); - return set_cert_store(&ssl->cert->verify_store, store, 0); + if (!ssl->config) { + return 0; + } + return set_cert_store(&ssl->config->cert->verify_store, store, 0); } int SSL_set1_verify_cert_store(SSL *ssl, X509_STORE *store) { check_ssl_x509_method(ssl); - return set_cert_store(&ssl->cert->verify_store, store, 1); + if (!ssl->config) { + return 0; + } + return set_cert_store(&ssl->config->cert->verify_store, store, 1); } int SSL_alert_from_verify_result(long result) { diff --git a/Pods/BoringSSL-GRPC/ssl/t1_enc.cc b/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc similarity index 82% rename from Pods/BoringSSL-GRPC/ssl/t1_enc.cc rename to Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc index ab7030910..7f8c3b732 100644 --- a/Pods/BoringSSL-GRPC/ssl/t1_enc.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc @@ -153,7 +153,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN bool tls1_prf(const EVP_MD *digest, Span out, Span secret, Span label, @@ -164,56 +164,6 @@ bool tls1_prf(const EVP_MD *digest, Span out, seed2.size()); } -static bool ssl3_prf(Span out, Span secret, - Span label, Span seed1, - Span seed2) { - ScopedEVP_MD_CTX md5; - ScopedEVP_MD_CTX sha1; - uint8_t buf[16], smd[SHA_DIGEST_LENGTH]; - uint8_t c = 'A'; - size_t k = 0; - while (!out.empty()) { - k++; - if (k > sizeof(buf)) { - // bug: 'buf' is too small for this ciphersuite - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - - for (size_t j = 0; j < k; j++) { - buf[j] = c; - } - c++; - if (!EVP_DigestInit_ex(sha1.get(), EVP_sha1(), NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - EVP_DigestUpdate(sha1.get(), buf, k); - EVP_DigestUpdate(sha1.get(), secret.data(), secret.size()); - // |label| is ignored for SSLv3. - EVP_DigestUpdate(sha1.get(), seed1.data(), seed1.size()); - EVP_DigestUpdate(sha1.get(), seed2.data(), seed2.size()); - EVP_DigestFinal_ex(sha1.get(), smd, NULL); - - if (!EVP_DigestInit_ex(md5.get(), EVP_md5(), NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - EVP_DigestUpdate(md5.get(), secret.data(), secret.size()); - EVP_DigestUpdate(md5.get(), smd, SHA_DIGEST_LENGTH); - if (out.size() < MD5_DIGEST_LENGTH) { - EVP_DigestFinal_ex(md5.get(), smd, NULL); - OPENSSL_memcpy(out.data(), smd, out.size()); - break; - } - EVP_DigestFinal_ex(md5.get(), out.data(), NULL); - out = out.subspan(MD5_DIGEST_LENGTH); - } - - OPENSSL_cleanse(smd, SHA_DIGEST_LENGTH); - return true; -} - static bool get_key_block_lengths(const SSL *ssl, size_t *out_mac_secret_len, size_t *out_key_len, size_t *out_iv_len, const SSL_CIPHER *cipher) { @@ -318,23 +268,16 @@ int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, } else { auto label = MakeConstSpan(kMasterSecretLabel, sizeof(kMasterSecretLabel) - 1); - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - if (!ssl3_prf(out_span, premaster, label, ssl->s3->client_random, - ssl->s3->server_random)) { - return 0; - } - } else { - if (!tls1_prf(hs->transcript.Digest(), out_span, premaster, label, - ssl->s3->client_random, ssl->s3->server_random)) { - return 0; - } + if (!tls1_prf(hs->transcript.Digest(), out_span, premaster, label, + ssl->s3->client_random, ssl->s3->server_random)) { + return 0; } } return SSL3_MASTER_SECRET_SIZE; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -357,11 +300,6 @@ int SSL_generate_key_block(const SSL *ssl, uint8_t *out, size_t out_len) { static const char kLabel[] = "key expansion"; auto label = MakeConstSpan(kLabel, sizeof(kLabel) - 1); - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - return ssl3_prf(out_span, master_key, label, ssl->s3->server_random, - ssl->s3->client_random); - } - const EVP_MD *digest = ssl_session_get_digest(session); return tls1_prf(digest, out_span, master_key, label, ssl->s3->server_random, ssl->s3->client_random); @@ -371,11 +309,6 @@ int SSL_export_keying_material(SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, const uint8_t *context, size_t context_len, int use_context) { - if (!ssl->s3->have_version || ssl->version == SSL3_VERSION) { - OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); - return 0; - } - // Exporters may be used in False Start and server 0-RTT, where the handshake // has progressed enough. Otherwise, they may not be used during a handshake. if (SSL_in_init(ssl) && @@ -426,27 +359,3 @@ int SSL_export_keying_material(SSL *ssl, uint8_t *out, size_t out_len, MakeConstSpan(session->master_key, session->master_key_length), MakeConstSpan(label, label_len), seed, {}); } - -int SSL_export_early_keying_material( - SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, - const uint8_t *context, size_t context_len) { - if (!SSL_in_early_data(ssl) && - (!ssl->s3->have_version || - ssl_protocol_version(ssl) < TLS1_3_VERSION)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); - return 0; - } - - // The early exporter only exists if we accepted early data or offered it as - // a client. - if (!SSL_in_early_data(ssl) && !SSL_early_data_accepted(ssl)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_EARLY_DATA_NOT_IN_USE); - return 0; - } - - return tls13_export_keying_material( - ssl, MakeSpan(out, out_len), - MakeConstSpan(ssl->s3->early_exporter_secret, - ssl->s3->early_exporter_secret_len), - MakeConstSpan(label, label_len), MakeConstSpan(context, context_len)); -} diff --git a/Pods/BoringSSL-GRPC/ssl/t1_enc.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc.grpc_back similarity index 82% rename from Pods/BoringSSL-GRPC/ssl/t1_enc.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc.grpc_back index 5947627e2..4c2fffb30 100644 --- a/Pods/BoringSSL-GRPC/ssl/t1_enc.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/t1_enc.cc.grpc_back @@ -153,7 +153,7 @@ #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN bool tls1_prf(const EVP_MD *digest, Span out, Span secret, Span label, @@ -164,56 +164,6 @@ bool tls1_prf(const EVP_MD *digest, Span out, seed2.size()); } -static bool ssl3_prf(Span out, Span secret, - Span label, Span seed1, - Span seed2) { - ScopedEVP_MD_CTX md5; - ScopedEVP_MD_CTX sha1; - uint8_t buf[16], smd[SHA_DIGEST_LENGTH]; - uint8_t c = 'A'; - size_t k = 0; - while (!out.empty()) { - k++; - if (k > sizeof(buf)) { - // bug: 'buf' is too small for this ciphersuite - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - - for (size_t j = 0; j < k; j++) { - buf[j] = c; - } - c++; - if (!EVP_DigestInit_ex(sha1.get(), EVP_sha1(), NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - EVP_DigestUpdate(sha1.get(), buf, k); - EVP_DigestUpdate(sha1.get(), secret.data(), secret.size()); - // |label| is ignored for SSLv3. - EVP_DigestUpdate(sha1.get(), seed1.data(), seed1.size()); - EVP_DigestUpdate(sha1.get(), seed2.data(), seed2.size()); - EVP_DigestFinal_ex(sha1.get(), smd, NULL); - - if (!EVP_DigestInit_ex(md5.get(), EVP_md5(), NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - EVP_DigestUpdate(md5.get(), secret.data(), secret.size()); - EVP_DigestUpdate(md5.get(), smd, SHA_DIGEST_LENGTH); - if (out.size() < MD5_DIGEST_LENGTH) { - EVP_DigestFinal_ex(md5.get(), smd, NULL); - OPENSSL_memcpy(out.data(), smd, out.size()); - break; - } - EVP_DigestFinal_ex(md5.get(), out.data(), NULL); - out = out.subspan(MD5_DIGEST_LENGTH); - } - - OPENSSL_cleanse(smd, SHA_DIGEST_LENGTH); - return true; -} - static bool get_key_block_lengths(const SSL *ssl, size_t *out_mac_secret_len, size_t *out_key_len, size_t *out_iv_len, const SSL_CIPHER *cipher) { @@ -318,23 +268,16 @@ int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, } else { auto label = MakeConstSpan(kMasterSecretLabel, sizeof(kMasterSecretLabel) - 1); - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - if (!ssl3_prf(out_span, premaster, label, ssl->s3->client_random, - ssl->s3->server_random)) { - return 0; - } - } else { - if (!tls1_prf(hs->transcript.Digest(), out_span, premaster, label, - ssl->s3->client_random, ssl->s3->server_random)) { - return 0; - } + if (!tls1_prf(hs->transcript.Digest(), out_span, premaster, label, + ssl->s3->client_random, ssl->s3->server_random)) { + return 0; } } return SSL3_MASTER_SECRET_SIZE; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -357,11 +300,6 @@ int SSL_generate_key_block(const SSL *ssl, uint8_t *out, size_t out_len) { static const char kLabel[] = "key expansion"; auto label = MakeConstSpan(kLabel, sizeof(kLabel) - 1); - if (ssl_protocol_version(ssl) == SSL3_VERSION) { - return ssl3_prf(out_span, master_key, label, ssl->s3->server_random, - ssl->s3->client_random); - } - const EVP_MD *digest = ssl_session_get_digest(session); return tls1_prf(digest, out_span, master_key, label, ssl->s3->server_random, ssl->s3->client_random); @@ -371,11 +309,6 @@ int SSL_export_keying_material(SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, const uint8_t *context, size_t context_len, int use_context) { - if (!ssl->s3->have_version || ssl->version == SSL3_VERSION) { - OPENSSL_PUT_ERROR(SSL, SSL_R_HANDSHAKE_NOT_COMPLETE); - return 0; - } - // Exporters may be used in False Start and server 0-RTT, where the handshake // has progressed enough. Otherwise, they may not be used during a handshake. if (SSL_in_init(ssl) && @@ -426,27 +359,3 @@ int SSL_export_keying_material(SSL *ssl, uint8_t *out, size_t out_len, MakeConstSpan(session->master_key, session->master_key_length), MakeConstSpan(label, label_len), seed, {}); } - -int SSL_export_early_keying_material( - SSL *ssl, uint8_t *out, size_t out_len, const char *label, size_t label_len, - const uint8_t *context, size_t context_len) { - if (!SSL_in_early_data(ssl) && - (!ssl->s3->have_version || - ssl_protocol_version(ssl) < TLS1_3_VERSION)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SSL_VERSION); - return 0; - } - - // The early exporter only exists if we accepted early data or offered it as - // a client. - if (!SSL_in_early_data(ssl) && !SSL_early_data_accepted(ssl)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_EARLY_DATA_NOT_IN_USE); - return 0; - } - - return tls13_export_keying_material( - ssl, MakeSpan(out, out_len), - MakeConstSpan(ssl->s3->early_exporter_secret, - ssl->s3->early_exporter_secret_len), - MakeConstSpan(label, label_len), MakeConstSpan(context, context_len)); -} diff --git a/Pods/BoringSSL-GRPC/ssl/t1_lib.cc b/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc similarity index 76% rename from Pods/BoringSSL-GRPC/ssl/t1_lib.cc rename to Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc index 56955d806..013acaa05 100644 --- a/Pods/BoringSSL-GRPC/ssl/t1_lib.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc @@ -129,9 +129,9 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN -static int ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs); +static bool ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs); static int compare_uint16_t(const void *p1, const void *p2) { uint16_t u1 = *((const uint16_t *)p1); @@ -149,7 +149,7 @@ static int compare_uint16_t(const void *p1, const void *p2) { // more than one extension of the same type in a ClientHello or ServerHello. // This function does an initial scan over the extensions block to filter those // out. -static int tls1_check_duplicate_extensions(const CBS *cbs) { +static bool tls1_check_duplicate_extensions(const CBS *cbs) { // First pass: count the extensions. size_t num_extensions = 0; CBS extensions = *cbs; @@ -159,19 +159,19 @@ static int tls1_check_duplicate_extensions(const CBS *cbs) { if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { - return 0; + return false; } num_extensions++; } if (num_extensions == 0) { - return 1; + return true; } Array extension_types; if (!extension_types.Init(num_extensions)) { - return 0; + return false; } // Second pass: gather the extension types. @@ -182,7 +182,7 @@ static int tls1_check_duplicate_extensions(const CBS *cbs) { if (!CBS_get_u16(&extensions, &extension_types[i]) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { // This should not happen. - return 0; + return false; } } assert(CBS_len(&extensions) == 0); @@ -192,17 +192,21 @@ static int tls1_check_duplicate_extensions(const CBS *cbs) { compare_uint16_t); for (size_t i = 1; i < num_extensions; i++) { if (extension_types[i - 1] == extension_types[i]) { - return 0; + return false; } } - return 1; + return true; +} + +static bool is_post_quantum_group(uint16_t id) { + return id == SSL_CURVE_CECPQ2; } -int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, - const SSLMessage &msg) { +bool ssl_client_hello_init(const SSL *ssl, SSL_CLIENT_HELLO *out, + const SSLMessage &msg) { OPENSSL_memset(out, 0, sizeof(*out)); - out->ssl = ssl; + out->ssl = const_cast(ssl); out->client_hello = CBS_data(&msg.body); out->client_hello_len = CBS_len(&msg.body); @@ -212,7 +216,7 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, !CBS_get_bytes(&client_hello, &random, SSL3_RANDOM_SIZE) || !CBS_get_u8_length_prefixed(&client_hello, &session_id) || CBS_len(&session_id) > SSL_MAX_SSL_SESSION_ID_LENGTH) { - return 0; + return false; } out->random = CBS_data(&random); @@ -225,7 +229,7 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, CBS cookie; if (!CBS_get_u8_length_prefixed(&client_hello, &cookie) || CBS_len(&cookie) > DTLS1_COOKIE_LENGTH) { - return 0; + return false; } } @@ -234,7 +238,7 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, CBS_len(&cipher_suites) < 2 || (CBS_len(&cipher_suites) & 1) != 0 || !CBS_get_u8_length_prefixed(&client_hello, &compression_methods) || CBS_len(&compression_methods) < 1) { - return 0; + return false; } out->cipher_suites = CBS_data(&cipher_suites); @@ -243,11 +247,11 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, out->compression_methods_len = CBS_len(&compression_methods); // If the ClientHello ends here then it's valid, but doesn't have any - // extensions. (E.g. SSLv3.) + // extensions. if (CBS_len(&client_hello) == 0) { out->extensions = NULL; out->extensions_len = 0; - return 1; + return true; } // Extract extensions and check it is valid. @@ -255,17 +259,17 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, if (!CBS_get_u16_length_prefixed(&client_hello, &extensions) || !tls1_check_duplicate_extensions(&extensions) || CBS_len(&client_hello) != 0) { - return 0; + return false; } out->extensions = CBS_data(&extensions); out->extensions_len = CBS_len(&extensions); - return 1; + return true; } -int ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, - CBS *out, uint16_t extension_type) { +bool ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, + CBS *out, uint16_t extension_type) { CBS extensions; CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); while (CBS_len(&extensions) != 0) { @@ -274,16 +278,16 @@ int ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, CBS extension; if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { - return 0; + return false; } if (type == extension_type) { *out = extension; - return 1; + return true; } } - return 0; + return false; } static const uint16_t kDefaultGroups[] = { @@ -292,15 +296,14 @@ static const uint16_t kDefaultGroups[] = { SSL_CURVE_SECP384R1, }; -Span tls1_get_grouplist(const SSL *ssl) { - if (ssl->supported_group_list != nullptr) { - return MakeConstSpan(ssl->supported_group_list, - ssl->supported_group_list_len); +Span tls1_get_grouplist(const SSL_HANDSHAKE *hs) { + if (!hs->config->supported_group_list.empty()) { + return hs->config->supported_group_list; } return Span(kDefaultGroups); } -int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { +bool tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { SSL *const ssl = hs->ssl; assert(ssl->server); @@ -313,7 +316,7 @@ int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { // support our favoured group. Thus we do not special-case an emtpy // |peer_supported_group_list|. - Span groups = tls1_get_grouplist(ssl); + Span groups = tls1_get_grouplist(hs); Span pref, supp; if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { pref = groups; @@ -325,138 +328,126 @@ int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { for (uint16_t pref_group : pref) { for (uint16_t supp_group : supp) { - if (pref_group == supp_group) { + if (pref_group == supp_group && + // CECPQ2(b) doesn't fit in the u8-length-prefixed ECPoint field in + // TLS 1.2 and below. + (ssl_protocol_version(ssl) >= TLS1_3_VERSION || + !is_post_quantum_group(pref_group))) { *out_group_id = pref_group; - return 1; + return true; } } } - return 0; + return false; } -int tls1_set_curves(uint16_t **out_group_ids, size_t *out_group_ids_len, - const int *curves, size_t ncurves) { - uint16_t *group_ids = (uint16_t *)OPENSSL_malloc(ncurves * sizeof(uint16_t)); - if (group_ids == NULL) { - return 0; +bool tls1_set_curves(Array *out_group_ids, Span curves) { + Array group_ids; + if (!group_ids.Init(curves.size())) { + return false; } - for (size_t i = 0; i < ncurves; i++) { + for (size_t i = 0; i < curves.size(); i++) { if (!ssl_nid_to_group_id(&group_ids[i], curves[i])) { - OPENSSL_free(group_ids); - return 0; + return false; } } - OPENSSL_free(*out_group_ids); - *out_group_ids = group_ids; - *out_group_ids_len = ncurves; - - return 1; + *out_group_ids = std::move(group_ids); + return true; } -int tls1_set_curves_list(uint16_t **out_group_ids, size_t *out_group_ids_len, - const char *curves) { - uint16_t *group_ids = NULL; - size_t ncurves = 0; +bool tls1_set_curves_list(Array *out_group_ids, const char *curves) { + // Count the number of curves in the list. + size_t count = 0; + const char *ptr = curves, *col; + do { + col = strchr(ptr, ':'); + count++; + if (col) { + ptr = col + 1; + } + } while (col); - const char *col; - const char *ptr = curves; + Array group_ids; + if (!group_ids.Init(count)) { + return false; + } + size_t i = 0; + ptr = curves; do { col = strchr(ptr, ':'); - - uint16_t group_id; - if (!ssl_name_to_group_id(&group_id, ptr, + if (!ssl_name_to_group_id(&group_ids[i++], ptr, col ? (size_t)(col - ptr) : strlen(ptr))) { - goto err; - } - - uint16_t *new_group_ids = (uint16_t *)OPENSSL_realloc( - group_ids, (ncurves + 1) * sizeof(uint16_t)); - if (new_group_ids == NULL) { - goto err; + return false; } - group_ids = new_group_ids; - - group_ids[ncurves] = group_id; - ncurves++; - if (col) { ptr = col + 1; } } while (col); - OPENSSL_free(*out_group_ids); - *out_group_ids = group_ids; - *out_group_ids_len = ncurves; - - return 1; - -err: - OPENSSL_free(group_ids); - return 0; + assert(i == count); + *out_group_ids = std::move(group_ids); + return true; } -int tls1_check_group_id(const SSL *ssl, uint16_t group_id) { - for (uint16_t supported : tls1_get_grouplist(ssl)) { +bool tls1_check_group_id(const SSL_HANDSHAKE *hs, uint16_t group_id) { + if (is_post_quantum_group(group_id) && + ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + // CECPQ2(b) requires TLS 1.3. + return false; + } + + for (uint16_t supported : tls1_get_grouplist(hs)) { if (supported == group_id) { - return 1; + return true; } } - return 0; + return false; } // kVerifySignatureAlgorithms is the default list of accepted signature // algorithms for verifying. -// -// For now, RSA-PSS signature algorithms are not enabled on Android's system -// BoringSSL. Once the change in Chrome has stuck and the values are finalized, -// restore them. static const uint16_t kVerifySignatureAlgorithms[] = { // List our preferred algorithms first. SSL_SIGN_ED25519, SSL_SIGN_ECDSA_SECP256R1_SHA256, - SSL_SIGN_RSA_PSS_SHA256, + SSL_SIGN_RSA_PSS_RSAE_SHA256, SSL_SIGN_RSA_PKCS1_SHA256, // Larger hashes are acceptable. SSL_SIGN_ECDSA_SECP384R1_SHA384, - SSL_SIGN_RSA_PSS_SHA384, + SSL_SIGN_RSA_PSS_RSAE_SHA384, SSL_SIGN_RSA_PKCS1_SHA384, - SSL_SIGN_RSA_PSS_SHA512, + SSL_SIGN_RSA_PSS_RSAE_SHA512, SSL_SIGN_RSA_PKCS1_SHA512, // For now, SHA-1 is still accepted but least preferable. SSL_SIGN_RSA_PKCS1_SHA1, - }; // kSignSignatureAlgorithms is the default list of supported signature // algorithms for signing. -// -// For now, RSA-PSS signature algorithms are not enabled on Android's system -// BoringSSL. Once the change in Chrome has stuck and the values are finalized, -// restore them. static const uint16_t kSignSignatureAlgorithms[] = { // List our preferred algorithms first. SSL_SIGN_ED25519, SSL_SIGN_ECDSA_SECP256R1_SHA256, - SSL_SIGN_RSA_PSS_SHA256, + SSL_SIGN_RSA_PSS_RSAE_SHA256, SSL_SIGN_RSA_PKCS1_SHA256, // If needed, sign larger hashes. // // TODO(davidben): Determine which of these may be pruned. SSL_SIGN_ECDSA_SECP384R1_SHA384, - SSL_SIGN_RSA_PSS_SHA384, + SSL_SIGN_RSA_PSS_RSAE_SHA384, SSL_SIGN_RSA_PKCS1_SHA384, SSL_SIGN_ECDSA_SECP521R1_SHA512, - SSL_SIGN_RSA_PSS_SHA512, + SSL_SIGN_RSA_PSS_RSAE_SHA512, SSL_SIGN_RSA_PKCS1_SHA512, // If the peer supports nothing else, sign with SHA-1. @@ -464,44 +455,52 @@ static const uint16_t kSignSignatureAlgorithms[] = { SSL_SIGN_RSA_PKCS1_SHA1, }; -bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out) { - bool use_default = ssl->ctx->num_verify_sigalgs == 0; - Span sigalgs = kVerifySignatureAlgorithms; - if (!use_default) { - sigalgs = MakeConstSpan(ssl->ctx->verify_sigalgs, - ssl->ctx->num_verify_sigalgs); +struct SSLSignatureAlgorithmList { + bool Next(uint16_t *out) { + while (!list.empty()) { + uint16_t sigalg = list[0]; + list = list.subspan(1); + if (skip_ed25519 && sigalg == SSL_SIGN_ED25519) { + continue; + } + *out = sigalg; + return true; + } + return false; } - for (uint16_t sigalg : sigalgs) { - if (use_default && - sigalg == SSL_SIGN_ED25519 && - !ssl->ctx->ed25519_enabled) { - continue; - } + Span list; + bool skip_ed25519 = false; +}; + +static SSLSignatureAlgorithmList tls12_get_verify_sigalgs(const SSL *ssl) { + SSLSignatureAlgorithmList ret; + if (!ssl->config->verify_sigalgs.empty()) { + ret.list = ssl->config->verify_sigalgs; + } else { + ret.list = kVerifySignatureAlgorithms; + ret.skip_ed25519 = !ssl->ctx->ed25519_enabled; + } + return ret; +} + +bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out) { + SSLSignatureAlgorithmList list = tls12_get_verify_sigalgs(ssl); + uint16_t sigalg; + while (list.Next(&sigalg)) { if (!CBB_add_u16(out, sigalg)) { return false; } } - return true; } bool tls12_check_peer_sigalg(const SSL *ssl, uint8_t *out_alert, uint16_t sigalg) { - const uint16_t *sigalgs = kVerifySignatureAlgorithms; - size_t num_sigalgs = OPENSSL_ARRAY_SIZE(kVerifySignatureAlgorithms); - if (ssl->ctx->num_verify_sigalgs != 0) { - sigalgs = ssl->ctx->verify_sigalgs; - num_sigalgs = ssl->ctx->num_verify_sigalgs; - } - - for (size_t i = 0; i < num_sigalgs; i++) { - if (sigalgs == kVerifySignatureAlgorithms && - sigalgs[i] == SSL_SIGN_ED25519 && - !ssl->ctx->ed25519_enabled) { - continue; - } - if (sigalg == sigalgs[i]) { + SSLSignatureAlgorithmList list = tls12_get_verify_sigalgs(ssl); + uint16_t verify_sigalg; + while (list.Next(&verify_sigalg)) { + if (verify_sigalg == sigalg) { return true; } } @@ -567,7 +566,7 @@ static bool dont_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_sni_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->tlsext_hostname == NULL) { + if (ssl->hostname == nullptr) { return true; } @@ -577,8 +576,8 @@ static bool ext_sni_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { !CBB_add_u16_length_prefixed(&contents, &server_name_list) || !CBB_add_u8(&server_name_list, TLSEXT_NAMETYPE_host_name) || !CBB_add_u16_length_prefixed(&server_name_list, &name) || - !CBB_add_bytes(&name, (const uint8_t *)ssl->tlsext_hostname, - strlen(ssl->tlsext_hostname)) || + !CBB_add_bytes(&name, (const uint8_t *)ssl->hostname.get(), + strlen(ssl->hostname.get())) || !CBB_flush(out)) { return false; } @@ -595,45 +594,7 @@ static bool ext_sni_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_sni_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { - SSL *const ssl = hs->ssl; - if (contents == NULL) { - return true; - } - - CBS server_name_list, host_name; - uint8_t name_type; - if (!CBS_get_u16_length_prefixed(contents, &server_name_list) || - !CBS_get_u8(&server_name_list, &name_type) || - // Although the server_name extension was intended to be extensible to - // new name types and multiple names, OpenSSL 1.0.x had a bug which meant - // different name types will cause an error. Further, RFC 4366 originally - // defined syntax inextensibly. RFC 6066 corrected this mistake, but - // adding new name types is no longer feasible. - // - // Act as if the extensibility does not exist to simplify parsing. - !CBS_get_u16_length_prefixed(&server_name_list, &host_name) || - CBS_len(&server_name_list) != 0 || - CBS_len(contents) != 0) { - return false; - } - - if (name_type != TLSEXT_NAMETYPE_host_name || - CBS_len(&host_name) == 0 || - CBS_len(&host_name) > TLSEXT_MAXLEN_host_name || - CBS_contains_zero_byte(&host_name)) { - *out_alert = SSL_AD_UNRECOGNIZED_NAME; - return false; - } - - // Copy the hostname as a string. - char *raw = nullptr; - if (!CBS_strdup(&host_name, &raw)) { - *out_alert = SSL_AD_INTERNAL_ERROR; - return false; - } - ssl->s3->hostname.reset(raw); - - hs->should_ack_sni = true; + // SNI has already been parsed earlier in the handshake. See |extract_sni|. return true; } @@ -823,7 +784,7 @@ static bool ext_ri_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_ems_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { // Extended master secret is not necessary in TLS 1.3. - if (hs->min_version >= TLS1_3_VERSION || hs->max_version <= SSL3_VERSION) { + if (hs->min_version >= TLS1_3_VERSION) { return true; } @@ -841,7 +802,6 @@ static bool ext_ems_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, if (contents != NULL) { if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || - ssl->version == SSL3_VERSION || CBS_len(contents) != 0) { return false; } @@ -863,9 +823,7 @@ static bool ext_ems_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_ems_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { - uint16_t version = ssl_protocol_version(hs->ssl); - if (version >= TLS1_3_VERSION || - version == SSL3_VERSION) { + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { return true; } @@ -907,26 +865,24 @@ static bool ext_ticket_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { return true; } - const uint8_t *ticket_data = NULL; - int ticket_len = 0; + Span ticket; // Renegotiation does not participate in session resumption. However, still // advertise the extension to avoid potentially breaking servers which carry // over the state from the previous handshake, such as OpenSSL servers // without upstream's 3c3f0259238594d77264a78944d409f2127642c4. if (!ssl->s3->initial_handshake_complete && - ssl->session != NULL && - ssl->session->tlsext_tick != NULL && + ssl->session != nullptr && + !ssl->session->ticket.empty() && // Don't send TLS 1.3 session tickets in the ticket extension. - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION) { - ticket_data = ssl->session->tlsext_tick; - ticket_len = ssl->session->tlsext_ticklen; + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { + ticket = ssl->session->ticket; } - CBB ticket; + CBB ticket_cbb; if (!CBB_add_u16(out, TLSEXT_TYPE_session_ticket) || - !CBB_add_u16_length_prefixed(out, &ticket) || - !CBB_add_bytes(&ticket, ticket_data, ticket_len) || + !CBB_add_u16_length_prefixed(out, &ticket_cbb) || + !CBB_add_bytes(&ticket_cbb, ticket.data(), ticket.size()) || !CBB_flush(out)) { return false; } @@ -1007,7 +963,6 @@ static bool ext_sigalgs_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS supported_signature_algorithms; if (!CBS_get_u16_length_prefixed(contents, &supported_signature_algorithms) || CBS_len(contents) != 0 || - CBS_len(&supported_signature_algorithms) == 0 || !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { return false; } @@ -1021,8 +976,7 @@ static bool ext_sigalgs_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // https://tools.ietf.org/html/rfc6066#section-8 static bool ext_ocsp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->ocsp_stapling_enabled) { + if (!hs->config->ocsp_stapling_enabled) { return true; } @@ -1086,8 +1040,7 @@ static bool ext_ocsp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_ocsp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || - !hs->ocsp_stapling_requested || - ssl->cert->ocsp_response == NULL || + !hs->ocsp_stapling_requested || hs->config->cert->ocsp_response == NULL || ssl->s3->session_reused || !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { return true; @@ -1228,8 +1181,7 @@ static bool ext_npn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // https://tools.ietf.org/html/rfc6962#section-3.3.1 static bool ext_sct_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->signed_cert_timestamps_enabled) { + if (!hs->config->signed_cert_timestamps_enabled) { return true; } @@ -1256,7 +1208,7 @@ static bool ext_sct_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // If this is false then we should never have sent the SCT extension in the // ClientHello and thus this function should never have been called. - assert(ssl->signed_cert_timestamps_enabled); + assert(hs->config->signed_cert_timestamps_enabled); if (!ssl_is_sct_list_valid(contents)) { *out_alert = SSL_AD_DECODE_ERROR; @@ -1269,9 +1221,8 @@ static bool ext_sct_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // // TODO(davidben): Enforce this anyway. if (!ssl->s3->session_reused) { - CRYPTO_BUFFER_free(hs->new_session->signed_cert_timestamp_list); - hs->new_session->signed_cert_timestamp_list = - CRYPTO_BUFFER_new_from_CBS(contents, ssl->ctx->pool); + hs->new_session->signed_cert_timestamp_list.reset( + CRYPTO_BUFFER_new_from_CBS(contents, ssl->ctx->pool)); if (hs->new_session->signed_cert_timestamp_list == nullptr) { *out_alert = SSL_AD_INTERNAL_ERROR; return false; @@ -1298,9 +1249,8 @@ static bool ext_sct_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; // The extension shouldn't be sent when resuming sessions. - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || - ssl->s3->session_reused || - ssl->cert->signed_cert_timestamp_list == NULL) { + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || ssl->s3->session_reused || + hs->config->cert->signed_cert_timestamp_list == NULL) { return true; } @@ -1309,8 +1259,10 @@ static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { CBB_add_u16_length_prefixed(out, &contents) && CBB_add_bytes( &contents, - CRYPTO_BUFFER_data(ssl->cert->signed_cert_timestamp_list), - CRYPTO_BUFFER_len(ssl->cert->signed_cert_timestamp_list)) && + CRYPTO_BUFFER_data( + hs->config->cert->signed_cert_timestamp_list.get()), + CRYPTO_BUFFER_len( + hs->config->cert->signed_cert_timestamp_list.get())) && CBB_flush(out); } @@ -1321,7 +1273,7 @@ static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->alpn_client_proto_list == NULL || + if (hs->config->alpn_client_proto_list.empty() || ssl->s3->initial_handshake_complete) { return true; } @@ -1330,8 +1282,8 @@ static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { if (!CBB_add_u16(out, TLSEXT_TYPE_application_layer_protocol_negotiation) || !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16_length_prefixed(&contents, &proto_list) || - !CBB_add_bytes(&proto_list, ssl->alpn_client_proto_list, - ssl->alpn_client_proto_list_len) || + !CBB_add_bytes(&proto_list, hs->config->alpn_client_proto_list.data(), + hs->config->alpn_client_proto_list.size()) || !CBB_flush(out)) { return false; } @@ -1347,7 +1299,7 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, } assert(!ssl->s3->initial_handshake_complete); - assert(ssl->alpn_client_proto_list != NULL); + assert(!hs->config->alpn_client_proto_list.empty()); if (hs->next_proto_neg_seen) { // NPN and ALPN may not be negotiated in the same connection. @@ -1368,7 +1320,7 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, return false; } - if (!ssl_is_alpn_protocol_allowed(ssl, protocol_name)) { + if (!ssl_is_alpn_protocol_allowed(hs, protocol_name)) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_ALPN_PROTOCOL); *out_alert = SSL_AD_ILLEGAL_PARAMETER; return false; @@ -1382,20 +1334,20 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, return true; } -bool ssl_is_alpn_protocol_allowed(const SSL *ssl, +bool ssl_is_alpn_protocol_allowed(const SSL_HANDSHAKE *hs, Span protocol) { - if (ssl->alpn_client_proto_list == nullptr) { + if (hs->config->alpn_client_proto_list.empty()) { return false; } - if (ssl->ctx->allow_unknown_alpn_protos) { + if (hs->ssl->ctx->allow_unknown_alpn_protos) { return true; } // Check that the protocol name is one of the ones we advertised. - CBS client_protocol_name_list, client_protocol_name; - CBS_init(&client_protocol_name_list, ssl->alpn_client_proto_list, - ssl->alpn_client_proto_list_len); + CBS client_protocol_name_list = + MakeConstSpan(hs->config->alpn_client_proto_list), + client_protocol_name; while (CBS_len(&client_protocol_name_list) > 0) { if (!CBS_get_u8_length_prefixed(&client_protocol_name_list, &client_protocol_name)) { @@ -1454,6 +1406,11 @@ bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, ssl, &selected, &selected_len, CBS_data(&protocol_name_list), CBS_len(&protocol_name_list), ssl->ctx->alpn_select_cb_arg) == SSL_TLSEXT_ERR_OK) { + if (selected_len == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_ALPN_PROTOCOL); + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } if (!ssl->s3->alpn_selected.CopyFrom( MakeConstSpan(selected, selected_len))) { *out_alert = SSL_AD_INTERNAL_ERROR; @@ -1490,13 +1447,12 @@ static bool ext_alpn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // https://tools.ietf.org/html/draft-balfanz-tls-channelid-01 static void ext_channel_id_init(SSL_HANDSHAKE *hs) { - hs->ssl->s3->tlsext_channel_id_valid = false; + hs->ssl->s3->channel_id_valid = false; } static bool ext_channel_id_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->tlsext_channel_id_enabled || - SSL_is_dtls(ssl)) { + if (!hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { return true; } @@ -1517,13 +1473,13 @@ static bool ext_channel_id_parse_serverhello(SSL_HANDSHAKE *hs, } assert(!SSL_is_dtls(ssl)); - assert(ssl->tlsext_channel_id_enabled); + assert(hs->config->channel_id_enabled); if (CBS_len(contents) != 0) { return false; } - ssl->s3->tlsext_channel_id_valid = true; + ssl->s3->channel_id_valid = true; return true; } @@ -1531,9 +1487,7 @@ static bool ext_channel_id_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { SSL *const ssl = hs->ssl; - if (contents == NULL || - !ssl->tlsext_channel_id_enabled || - SSL_is_dtls(ssl)) { + if (contents == NULL || !hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { return true; } @@ -1541,13 +1495,13 @@ static bool ext_channel_id_parse_clienthello(SSL_HANDSHAKE *hs, return false; } - ssl->s3->tlsext_channel_id_valid = true; + ssl->s3->channel_id_valid = true; return true; } static bool ext_channel_id_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->s3->tlsext_channel_id_valid) { + if (!ssl->s3->channel_id_valid) { return true; } @@ -1566,7 +1520,7 @@ static bool ext_channel_id_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static void ext_srtp_init(SSL_HANDSHAKE *hs) { - hs->ssl->srtp_profile = NULL; + hs->ssl->s3->srtp_profile = NULL; } static bool ext_srtp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { @@ -1633,7 +1587,7 @@ static bool ext_srtp_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // offered). for (const SRTP_PROTECTION_PROFILE *profile : profiles) { if (profile->id == profile_id) { - ssl->srtp_profile = profile; + ssl->s3->srtp_profile = profile; return true; } } @@ -1675,7 +1629,7 @@ static bool ext_srtp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, } if (server_profile->id == profile_id) { - ssl->srtp_profile = server_profile; + ssl->s3->srtp_profile = server_profile; return true; } } @@ -1686,7 +1640,7 @@ static bool ext_srtp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_srtp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->srtp_profile == NULL) { + if (ssl->s3->srtp_profile == NULL) { return true; } @@ -1694,7 +1648,7 @@ static bool ext_srtp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { if (!CBB_add_u16(out, TLSEXT_TYPE_srtp) || !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16_length_prefixed(&contents, &profile_ids) || - !CBB_add_u16(&profile_ids, ssl->srtp_profile->id) || + !CBB_add_u16(&profile_ids, ssl->s3->srtp_profile->id) || !CBB_add_u8(&contents, 0 /* empty MKI */) || !CBB_flush(out)) { return false; @@ -1722,7 +1676,7 @@ static bool ext_ec_point_add_extension(SSL_HANDSHAKE *hs, CBB *out) { } static bool ext_ec_point_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - // The point format extension is unneccessary in TLS 1.3. + // The point format extension is unnecessary in TLS 1.3. if (hs->min_version >= TLS1_3_VERSION) { return true; } @@ -1787,31 +1741,31 @@ static bool ext_ec_point_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Pre Shared Key // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.6 +// https://tools.ietf.org/html/rfc8446#section-4.2.11 static size_t ext_pre_shared_key_clienthello_length(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (hs->max_version < TLS1_3_VERSION || ssl->session == NULL || - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION) { + if (hs->max_version < TLS1_3_VERSION || ssl->session == nullptr || + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { return 0; } - size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session)); - return 15 + ssl->session->tlsext_ticklen + binder_len; + size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session.get())); + return 15 + ssl->session->ticket.size() + binder_len; } static bool ext_pre_shared_key_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; hs->needs_psk_binder = false; - if (hs->max_version < TLS1_3_VERSION || ssl->session == NULL || - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION) { + if (hs->max_version < TLS1_3_VERSION || ssl->session == nullptr || + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { return true; } - // Per draft-ietf-tls-tls13-21 section 4.1.4, skip offering the session if the - // selected cipher in HelloRetryRequest does not match. This avoids performing - // the transcript hash transformation for multiple hashes. - if (hs->received_hello_retry_request && + // Per RFC 8446 section 4.1.4, skip offering the session if the selected + // cipher in HelloRetryRequest does not match. This avoids performing the + // transcript hash transformation for multiple hashes. + if (ssl->s3 && ssl->s3->used_hello_retry_request && ssl->session->cipher->algorithm_prf != hs->new_cipher->algorithm_prf) { return true; } @@ -1824,15 +1778,15 @@ static bool ext_pre_shared_key_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { // Fill in a placeholder zero binder of the appropriate length. It will be // computed and filled in later after length prefixes are computed. uint8_t zero_binder[EVP_MAX_MD_SIZE] = {0}; - size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session)); + size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session.get())); CBB contents, identity, ticket, binders, binder; if (!CBB_add_u16(out, TLSEXT_TYPE_pre_shared_key) || !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16_length_prefixed(&contents, &identity) || !CBB_add_u16_length_prefixed(&identity, &ticket) || - !CBB_add_bytes(&ticket, ssl->session->tlsext_tick, - ssl->session->tlsext_ticklen) || + !CBB_add_bytes(&ticket, ssl->session->ticket.data(), + ssl->session->ticket.size()) || !CBB_add_u32(&identity, obfuscated_ticket_age) || !CBB_add_u16_length_prefixed(&contents, &binders) || !CBB_add_u8_length_prefixed(&binders, &binder) || @@ -1867,7 +1821,17 @@ bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, bool ssl_ext_pre_shared_key_parse_clienthello( SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders, - uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, CBS *contents) { + uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello, CBS *contents) { + // Verify that the pre_shared_key extension is the last extension in + // ClientHello. + if (CBS_data(contents) + CBS_len(contents) != + client_hello->extensions + client_hello->extensions_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PRE_SHARED_KEY_MUST_BE_LAST); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + // We only process the first PSK identity since we don't support pure PSK. CBS identities, binders; if (!CBS_get_u16_length_prefixed(contents, &identities) || @@ -1941,7 +1905,7 @@ bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Pre-Shared Key Exchange Modes // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.7 +// https://tools.ietf.org/html/rfc8446#section-4.2.9 static bool ext_psk_key_exchange_modes_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { @@ -1985,26 +1949,50 @@ static bool ext_psk_key_exchange_modes_parse_clienthello(SSL_HANDSHAKE *hs, // Early Data Indication // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.8 +// https://tools.ietf.org/html/rfc8446#section-4.2.10 static bool ext_early_data_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->cert->enable_early_data || - // Session must be 0-RTT capable. - ssl->session == NULL || - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION || - ssl->session->ticket_max_early_data == 0 || - // The second ClientHello never offers early data. - hs->received_hello_retry_request || - // In case ALPN preferences changed since this session was established, - // avoid reporting a confusing value in |SSL_get0_alpn_selected|. - (ssl->session->early_alpn_len != 0 && - !ssl_is_alpn_protocol_allowed( - ssl, MakeConstSpan(ssl->session->early_alpn, - ssl->session->early_alpn_len)))) { + // The second ClientHello never offers early data, and we must have already + // filled in |early_data_reason| by this point. + if (ssl->s3->used_hello_retry_request) { + assert(ssl->s3->early_data_reason != ssl_early_data_unknown); + return true; + } + + if (!ssl->enable_early_data) { + ssl->s3->early_data_reason = ssl_early_data_disabled; + return true; + } + + if (hs->max_version < TLS1_3_VERSION) { + // We discard inapplicable sessions, so this is redundant with the session + // checks below, but we check give a more useful reason. + ssl->s3->early_data_reason = ssl_early_data_protocol_version; return true; } + if (ssl->session == nullptr) { + ssl->s3->early_data_reason = ssl_early_data_no_session_offered; + return true; + } + + if (ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION || + ssl->session->ticket_max_early_data == 0) { + ssl->s3->early_data_reason = ssl_early_data_unsupported_for_session; + return true; + } + + // In case ALPN preferences changed since this session was established, avoid + // reporting a confusing value in |SSL_get0_alpn_selected| and sending early + // data we know will be rejected. + if (!ssl->session->early_alpn.empty() && + !ssl_is_alpn_protocol_allowed(hs, ssl->session->early_alpn)) { + ssl->s3->early_data_reason = ssl_early_data_alpn_mismatch; + return true; + } + + // |early_data_reason| will be filled in later when the server responds. hs->early_data_offered = true; if (!CBB_add_u16(out, TLSEXT_TYPE_early_data) || @@ -2017,12 +2005,27 @@ static bool ext_early_data_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } static bool ext_early_data_parse_serverhello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, CBS *contents) { + uint8_t *out_alert, + CBS *contents) { SSL *const ssl = hs->ssl; if (contents == NULL) { + if (hs->early_data_offered && !ssl->s3->used_hello_retry_request) { + ssl->s3->early_data_reason = ssl->s3->session_reused + ? ssl_early_data_peer_declined + : ssl_early_data_session_not_resumed; + } else { + // We already filled in |early_data_reason| when declining to offer 0-RTT + // or handling the implicit HelloRetryRequest reject. + assert(ssl->s3->early_data_reason != ssl_early_data_unknown); + } return true; } + // If we received an HRR, the second ClientHello never offers early data, so + // the extensions logic will automatically reject early data extensions as + // unsolicited. This covered by the ServerAcceptsEarlyDataOnHRR test. + assert(!ssl->s3->used_hello_retry_request); + if (CBS_len(contents) != 0) { *out_alert = SSL_AD_DECODE_ERROR; return false; @@ -2034,6 +2037,7 @@ static bool ext_early_data_parse_serverhello(SSL_HANDSHAKE *hs, return false; } + ssl->s3->early_data_reason = ssl_early_data_accepted; ssl->s3->early_data_accepted = true; return true; } @@ -2072,7 +2076,7 @@ static bool ext_early_data_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Key Share // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.5 +// https://tools.ietf.org/html/rfc8446#section-4.2.8 static bool ext_key_share_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; @@ -2088,7 +2092,8 @@ static bool ext_key_share_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } uint16_t group_id = hs->retry_group; - if (hs->received_hello_retry_request) { + uint16_t second_group_id = 0; + if (ssl->s3 && ssl->s3->used_hello_retry_request) { // We received a HelloRetryRequest without a new curve, so there is no new // share to append. Leave |hs->key_share| as-is. if (group_id == 0 && @@ -2111,27 +2116,46 @@ static bool ext_key_share_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } // Predict the most preferred group. - Span groups = tls1_get_grouplist(ssl); + Span groups = tls1_get_grouplist(hs); if (groups.empty()) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_GROUPS_SPECIFIED); return false; } group_id = groups[0]; + + if (is_post_quantum_group(group_id) && groups.size() >= 2) { + // CECPQ2(b) is not sent as the only initial key share. We'll include the + // 2nd preference group too to avoid round-trips. + second_group_id = groups[1]; + assert(second_group_id != group_id); + } } - hs->key_share = SSLKeyShare::Create(group_id); CBB key_exchange; - if (!hs->key_share || + hs->key_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || !CBB_add_u16(&kse_bytes, group_id) || !CBB_add_u16_length_prefixed(&kse_bytes, &key_exchange) || - !hs->key_share->Offer(&key_exchange) || + !hs->key_shares[0]->Offer(&key_exchange) || !CBB_flush(&kse_bytes)) { return false; } - // Save the contents of the extension to repeat it in the second ClientHello. - if (!hs->received_hello_retry_request && + if (second_group_id != 0) { + hs->key_shares[1] = SSLKeyShare::Create(second_group_id); + if (!hs->key_shares[1] || + !CBB_add_u16(&kse_bytes, second_group_id) || + !CBB_add_u16_length_prefixed(&kse_bytes, &key_exchange) || + !hs->key_shares[1]->Offer(&key_exchange) || + !CBB_flush(&kse_bytes)) { + return false; + } + } + + // Save the contents of the extension to repeat it in the second + // ClientHello. + if (ssl->s3 && !ssl->s3->used_hello_retry_request && !hs->key_share_bytes.CopyFrom( MakeConstSpan(CBB_data(&kse_bytes), CBB_len(&kse_bytes)))) { return false; @@ -2153,19 +2177,24 @@ bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, return false; } - if (hs->key_share->GroupID() != group_id) { - *out_alert = SSL_AD_ILLEGAL_PARAMETER; - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); - return false; + SSLKeyShare *key_share = hs->key_shares[0].get(); + if (key_share->GroupID() != group_id) { + if (!hs->key_shares[1] || hs->key_shares[1]->GroupID() != group_id) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); + return false; + } + key_share = hs->key_shares[1].get(); } - if (!hs->key_share->Finish(out_secret, out_alert, peer_key)) { + if (!key_share->Finish(out_secret, out_alert, peer_key)) { *out_alert = SSL_AD_INTERNAL_ERROR; return false; } hs->new_session->group_id = group_id; - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); return true; } @@ -2257,7 +2286,7 @@ bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Supported Versions // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.1 +// https://tools.ietf.org/html/rfc8446#section-4.2.1 static bool ext_supported_versions_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; @@ -2289,7 +2318,7 @@ static bool ext_supported_versions_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) // Cookie // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.2 +// https://tools.ietf.org/html/rfc8446#section-4.2.2 static bool ext_cookie_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { if (hs->cookie.empty()) { @@ -2311,83 +2340,10 @@ static bool ext_cookie_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } -// Dummy PQ Padding extension -// -// Dummy post-quantum padding invovles the client (and later server) sending -// useless, random-looking bytes in an extension in their ClientHello or -// ServerHello. These extensions are sized to simulate a post-quantum -// key-exchange and so enable measurement of the latency impact of the -// additional bandwidth. - -static bool ext_dummy_pq_padding_add(CBB *out, size_t len) { - CBB contents; - uint8_t *buffer; - if (!CBB_add_u16(out, TLSEXT_TYPE_dummy_pq_padding) || - !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_space(&contents, &buffer, len)) { - return false; - } - - // The length is used as the nonce so that different length extensions have - // different contents. There's no reason this has to be the case, it just - // makes things a little more obvious in a packet dump. - uint8_t nonce[12] = {0}; - memcpy(nonce, &len, sizeof(len)); - - memset(buffer, 0, len); - static const uint8_t kZeroKey[32] = {0}; - CRYPTO_chacha_20(buffer, buffer, len, kZeroKey, nonce, 0); - - return CBB_flush(out); -} - -static bool ext_dummy_pq_padding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - const size_t len = hs->ssl->dummy_pq_padding_len; - if (len == 0) { - return true; - } - - return ext_dummy_pq_padding_add(out, len); -} - -static bool ext_dummy_pq_padding_parse_serverhello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, - CBS *contents) { - if (contents == nullptr) { - return true; - } - - if (CBS_len(contents) != hs->ssl->dummy_pq_padding_len) { - return false; - } - - hs->ssl->did_dummy_pq_padding = true; - return true; -} - -static bool ext_dummy_pq_padding_parse_clienthello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, - CBS *contents) { - if (contents != nullptr && - 0 < CBS_len(contents) && CBS_len(contents) < (1 << 12)) { - hs->dummy_pq_padding_len = CBS_len(contents); - } - - return true; -} - -static bool ext_dummy_pq_padding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { - if (!hs->dummy_pq_padding_len) { - return true; - } - - return ext_dummy_pq_padding_add(out, hs->dummy_pq_padding_len); -} - -// Negotiated Groups +// Supported Groups // -// https://tools.ietf.org/html/rfc4492#section-5.1.2 -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.4 +// https://tools.ietf.org/html/rfc4492#section-5.1.1 +// https://tools.ietf.org/html/rfc8446#section-4.2.7 static bool ext_supported_groups_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; @@ -2405,7 +2361,11 @@ static bool ext_supported_groups_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { return false; } - for (uint16_t group : tls1_get_grouplist(ssl)) { + for (uint16_t group : tls1_get_grouplist(hs)) { + if (is_post_quantum_group(group) && + hs->max_version < TLS1_3_VERSION) { + continue; + } if (!CBB_add_u16(&groups_bytes, group)) { return false; } @@ -2476,7 +2436,7 @@ static uint16_t kTokenBindingMinVersion = 13; static bool ext_token_binding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->token_binding_params == nullptr || SSL_is_dtls(ssl)) { + if (hs->config->token_binding_params.empty() || SSL_is_dtls(ssl)) { return true; } @@ -2485,8 +2445,8 @@ static bool ext_token_binding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16(&contents, kTokenBindingMaxVersion) || !CBB_add_u8_length_prefixed(&contents, ¶ms) || - !CBB_add_bytes(¶ms, ssl->token_binding_params, - ssl->token_binding_params_len) || + !CBB_add_bytes(¶ms, hs->config->token_binding_params.data(), + hs->config->token_binding_params.size()) || !CBB_flush(out)) { return false; } @@ -2526,10 +2486,10 @@ static bool ext_token_binding_parse_serverhello(SSL_HANDSHAKE *hs, return true; } - for (size_t i = 0; i < ssl->token_binding_params_len; ++i) { - if (param == ssl->token_binding_params[i]) { - ssl->negotiated_token_binding_param = param; - ssl->token_binding_negotiated = true; + for (uint8_t config_param : hs->config->token_binding_params) { + if (param == config_param) { + ssl->s3->negotiated_token_binding_param = param; + ssl->s3->token_binding_negotiated = true; return true; } } @@ -2539,15 +2499,15 @@ static bool ext_token_binding_parse_serverhello(SSL_HANDSHAKE *hs, } // select_tb_param looks for the first token binding param in -// |ssl->token_binding_params| that is also in |params| and puts it in -// |ssl->negotiated_token_binding_param|. It returns true if a token binding +// |hs->ssl->token_binding_params| that is also in |params| and puts it in +// |hs->ssl->negotiated_token_binding_param|. It returns true if a token binding // param is found, and false otherwise. -static bool select_tb_param(SSL *ssl, Span peer_params) { - for (size_t i = 0; i < ssl->token_binding_params_len; ++i) { - uint8_t tb_param = ssl->token_binding_params[i]; +static bool select_tb_param(SSL_HANDSHAKE *hs, + Span peer_params) { + for (uint8_t tb_param : hs->config->token_binding_params) { for (uint8_t peer_param : peer_params) { if (tb_param == peer_param) { - ssl->negotiated_token_binding_param = tb_param; + hs->ssl->s3->negotiated_token_binding_param = tb_param; return true; } } @@ -2559,7 +2519,7 @@ static bool ext_token_binding_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { SSL *const ssl = hs->ssl; - if (contents == nullptr || ssl->token_binding_params == nullptr) { + if (contents == nullptr || hs->config->token_binding_params.empty()) { return true; } @@ -2583,18 +2543,18 @@ static bool ext_token_binding_parse_clienthello(SSL_HANDSHAKE *hs, // version. Otherwise, use the client's version. hs->negotiated_token_binding_version = std::min(version, kTokenBindingMaxVersion); - if (!select_tb_param(ssl, params)) { + if (!select_tb_param(hs, params)) { return true; } - ssl->token_binding_negotiated = true; + ssl->s3->token_binding_negotiated = true; return true; } static bool ext_token_binding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->token_binding_negotiated) { + if (!ssl->s3->token_binding_negotiated) { return true; } @@ -2603,7 +2563,7 @@ static bool ext_token_binding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16(&contents, hs->negotiated_token_binding_version) || !CBB_add_u8_length_prefixed(&contents, ¶ms) || - !CBB_add_u8(¶ms, ssl->negotiated_token_binding_param) || + !CBB_add_u8(¶ms, ssl->s3->negotiated_token_binding_param) || !CBB_flush(out)) { return false; } @@ -2615,16 +2575,16 @@ static bool ext_token_binding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_quic_transport_params_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->quic_transport_params || hs->max_version <= TLS1_2_VERSION) { + if (hs->config->quic_transport_params.empty() || + hs->max_version <= TLS1_2_VERSION) { return true; } CBB contents; if (!CBB_add_u16(out, TLSEXT_TYPE_quic_transport_parameters) || !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_bytes(&contents, ssl->quic_transport_params, - ssl->quic_transport_params_len) || + !CBB_add_bytes(&contents, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || !CBB_flush(out)) { return false; } @@ -2651,7 +2611,7 @@ static bool ext_quic_transport_params_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { SSL *const ssl = hs->ssl; - if (!contents || !ssl->quic_transport_params) { + if (!contents || hs->config->quic_transport_params.empty()) { return true; } // Ignore the extension before TLS 1.3. @@ -2664,16 +2624,15 @@ static bool ext_quic_transport_params_parse_clienthello(SSL_HANDSHAKE *hs, static bool ext_quic_transport_params_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->quic_transport_params) { + if (hs->config->quic_transport_params.empty()) { return true; } CBB contents; if (!CBB_add_u16(out, TLSEXT_TYPE_quic_transport_parameters) || !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_bytes(&contents, ssl->quic_transport_params, - ssl->quic_transport_params_len) || + !CBB_add_bytes(&contents, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || !CBB_flush(out)) { return false; } @@ -2681,17 +2640,143 @@ static bool ext_quic_transport_params_add_serverhello(SSL_HANDSHAKE *hs, return true; } +// Delegated credentials. +// +// https://tools.ietf.org/html/draft-ietf-tls-subcerts + +static bool ext_delegated_credential_add_clienthello(SSL_HANDSHAKE *hs, + CBB *out) { + return true; +} + +static bool ext_delegated_credential_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + assert(TLSEXT_TYPE_delegated_credential == 0xff02); + // TODO: Check that the extension is empty. + // + // As of draft-03, the client sends an empty extension in order indicate + // support for delegated credentials. This could change, however, since the + // spec is not yet finalized. This assertion is here to remind us to enforce + // this check once the extension ID is assigned. + + if (contents == nullptr || ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + // Don't use delegated credentials unless we're negotiating TLS 1.3 or + // higher. + return true; + } + + hs->delegated_credential_requested = true; + return true; +} + +// Certificate compression + +static bool cert_compression_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + bool first = true; + CBB contents, algs; + + for (const auto &alg : hs->ssl->ctx->cert_compression_algs) { + if (alg.decompress == nullptr) { + continue; + } + + if (first && (!CBB_add_u16(out, TLSEXT_TYPE_cert_compression) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &algs))) { + return false; + } + first = false; + if (!CBB_add_u16(&algs, alg.alg_id)) { + return false; + } + } + + return first || CBB_flush(out); +} + +static bool cert_compression_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == nullptr) { + return true; + } + + // The server may not echo this extension. Any server to client negotiation is + // advertised in the CertificateRequest message. + return false; +} + +static bool cert_compression_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == nullptr) { + return true; + } + + const SSL_CTX *ctx = hs->ssl->ctx.get(); + const size_t num_algs = ctx->cert_compression_algs.size(); + + CBS alg_ids; + if (!CBS_get_u8_length_prefixed(contents, &alg_ids) || + CBS_len(contents) != 0 || + CBS_len(&alg_ids) == 0 || + CBS_len(&alg_ids) % 2 == 1) { + return false; + } + + const size_t num_given_alg_ids = CBS_len(&alg_ids) / 2; + Array given_alg_ids; + if (!given_alg_ids.Init(num_given_alg_ids)) { + return false; + } + + size_t best_index = num_algs; + size_t given_alg_idx = 0; + + while (CBS_len(&alg_ids) > 0) { + uint16_t alg_id; + if (!CBS_get_u16(&alg_ids, &alg_id)) { + return false; + } + + given_alg_ids[given_alg_idx++] = alg_id; + + for (size_t i = 0; i < num_algs; i++) { + const auto &alg = ctx->cert_compression_algs[i]; + if (alg.alg_id == alg_id && alg.compress != nullptr) { + if (i < best_index) { + best_index = i; + } + break; + } + } + } + + qsort(given_alg_ids.data(), given_alg_ids.size(), sizeof(uint16_t), + compare_uint16_t); + for (size_t i = 1; i < num_given_alg_ids; i++) { + if (given_alg_ids[i - 1] == given_alg_ids[i]) { + return false; + } + } + + if (best_index < num_algs && + ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + hs->cert_compression_negotiated = true; + hs->cert_compression_alg_id = ctx->cert_compression_algs[best_index].alg_id; + } + + return true; +} + +static bool cert_compression_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + return true; +} + // kExtensions contains all the supported extensions. static const struct tls_extension kExtensions[] = { - { - TLSEXT_TYPE_renegotiate, - NULL, - ext_ri_add_clienthello, - ext_ri_parse_serverhello, - ext_ri_parse_clienthello, - ext_ri_add_serverhello, - }, { TLSEXT_TYPE_server_name, NULL, @@ -2708,6 +2793,30 @@ static const struct tls_extension kExtensions[] = { ext_ems_parse_clienthello, ext_ems_add_serverhello, }, + { + TLSEXT_TYPE_renegotiate, + NULL, + ext_ri_add_clienthello, + ext_ri_parse_serverhello, + ext_ri_parse_clienthello, + ext_ri_add_serverhello, + }, + { + TLSEXT_TYPE_supported_groups, + NULL, + ext_supported_groups_add_clienthello, + ext_supported_groups_parse_serverhello, + ext_supported_groups_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_ec_point_formats, + NULL, + ext_ec_point_add_clienthello, + ext_ec_point_parse_serverhello, + ext_ec_point_parse_clienthello, + ext_ec_point_add_serverhello, + }, { TLSEXT_TYPE_session_ticket, NULL, @@ -2718,12 +2827,13 @@ static const struct tls_extension kExtensions[] = { ext_ticket_add_serverhello, }, { - TLSEXT_TYPE_signature_algorithms, + TLSEXT_TYPE_application_layer_protocol_negotiation, NULL, - ext_sigalgs_add_clienthello, - forbid_parse_serverhello, - ext_sigalgs_parse_clienthello, - dont_add_serverhello, + ext_alpn_add_clienthello, + ext_alpn_parse_serverhello, + // ALPN is negotiated late in |ssl_negotiate_alpn|. + ignore_parse_clienthello, + ext_alpn_add_serverhello, }, { TLSEXT_TYPE_status_request, @@ -2733,6 +2843,14 @@ static const struct tls_extension kExtensions[] = { ext_ocsp_parse_clienthello, ext_ocsp_add_serverhello, }, + { + TLSEXT_TYPE_signature_algorithms, + NULL, + ext_sigalgs_add_clienthello, + forbid_parse_serverhello, + ext_sigalgs_parse_clienthello, + dont_add_serverhello, + }, { TLSEXT_TYPE_next_proto_neg, NULL, @@ -2749,15 +2867,6 @@ static const struct tls_extension kExtensions[] = { ext_sct_parse_clienthello, ext_sct_add_serverhello, }, - { - TLSEXT_TYPE_application_layer_protocol_negotiation, - NULL, - ext_alpn_add_clienthello, - ext_alpn_parse_serverhello, - // ALPN is negotiated late in |ssl_negotiate_alpn|. - ignore_parse_clienthello, - ext_alpn_add_serverhello, - }, { TLSEXT_TYPE_channel_id, ext_channel_id_init, @@ -2774,14 +2883,6 @@ static const struct tls_extension kExtensions[] = { ext_srtp_parse_clienthello, ext_srtp_add_serverhello, }, - { - TLSEXT_TYPE_ec_point_formats, - NULL, - ext_ec_point_add_clienthello, - ext_ec_point_parse_serverhello, - ext_ec_point_parse_clienthello, - ext_ec_point_add_serverhello, - }, { TLSEXT_TYPE_key_share, NULL, @@ -2822,14 +2923,6 @@ static const struct tls_extension kExtensions[] = { ignore_parse_clienthello, dont_add_serverhello, }, - { - TLSEXT_TYPE_dummy_pq_padding, - NULL, - ext_dummy_pq_padding_add_clienthello, - ext_dummy_pq_padding_parse_serverhello, - ext_dummy_pq_padding_parse_clienthello, - ext_dummy_pq_padding_add_serverhello, - }, { TLSEXT_TYPE_quic_transport_parameters, NULL, @@ -2838,17 +2931,6 @@ static const struct tls_extension kExtensions[] = { ext_quic_transport_params_parse_clienthello, ext_quic_transport_params_add_serverhello, }, - // The final extension must be non-empty. WebSphere Application Server 7.0 is - // intolerant to the last extension being zero-length. See - // https://crbug.com/363583. - { - TLSEXT_TYPE_supported_groups, - NULL, - ext_supported_groups_add_clienthello, - ext_supported_groups_parse_serverhello, - ext_supported_groups_parse_clienthello, - dont_add_serverhello, - }, { TLSEXT_TYPE_token_binding, NULL, @@ -2857,6 +2939,22 @@ static const struct tls_extension kExtensions[] = { ext_token_binding_parse_clienthello, ext_token_binding_add_serverhello, }, + { + TLSEXT_TYPE_cert_compression, + NULL, + cert_compression_add_clienthello, + cert_compression_parse_serverhello, + cert_compression_parse_clienthello, + cert_compression_add_serverhello, + }, + { + TLSEXT_TYPE_delegated_credential, + NULL, + ext_delegated_credential_add_clienthello, + forbid_parse_serverhello, + ext_delegated_credential_parse_clienthello, + dont_add_serverhello, + }, }; #define kNumExtensions (sizeof(kExtensions) / sizeof(struct tls_extension)) @@ -2881,22 +2979,19 @@ static const struct tls_extension *tls_extension_find(uint32_t *out_index, return NULL; } -int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { +bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, + size_t header_len) { SSL *const ssl = hs->ssl; - // Don't add extensions for SSLv3 unless doing secure renegotiation. - if (hs->client_version == SSL3_VERSION && - !ssl->s3->send_connection_binding) { - return 1; - } - CBB extensions; if (!CBB_add_u16_length_prefixed(out, &extensions)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } + // Note we may send multiple ClientHellos for DTLS HelloVerifyRequest and TLS + // 1.3 HelloRetryRequest. For the latter, the extensions may change, so it is + // important to reset this value. hs->extensions.sent = 0; - hs->custom_extensions.sent = 0; for (size_t i = 0; i < kNumExtensions; i++) { if (kExtensions[i].init != NULL) { @@ -2911,26 +3006,26 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { if (!CBB_add_u16(&extensions, grease_ext1) || !CBB_add_u16(&extensions, 0 /* zero length */)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } } + bool last_was_empty = false; for (size_t i = 0; i < kNumExtensions; i++) { const size_t len_before = CBB_len(&extensions); if (!kExtensions[i].add_clienthello(hs, &extensions)) { OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); - return 0; + return false; } - if (CBB_len(&extensions) != len_before) { + const size_t bytes_written = CBB_len(&extensions) - len_before; + if (bytes_written != 0) { hs->extensions.sent |= (1u << i); } - } - - if (!custom_ext_add_clienthello(hs, &extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + // If the difference in lengths is only four bytes then the extension had + // an empty body. + last_was_empty = (bytes_written == 4); } if (ssl->ctx->grease_enabled) { @@ -2948,19 +3043,37 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { !CBB_add_u16(&extensions, 1 /* one byte length */) || !CBB_add_u8(&extensions, 0 /* single zero byte as contents */)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } + + last_was_empty = false; } if (!SSL_is_dtls(ssl)) { size_t psk_extension_len = ext_pre_shared_key_clienthello_length(hs); header_len += 2 + CBB_len(&extensions) + psk_extension_len; + size_t padding_len = 0; + + // The final extension must be non-empty. WebSphere Application + // Server 7.0 is intolerant to the last extension being zero-length. See + // https://crbug.com/363583. + if (last_was_empty && psk_extension_len == 0) { + padding_len = 1; + // The addition of the padding extension may push us into the F5 bug. + header_len += 4 + padding_len; + } + + // Add padding to workaround bugs in F5 terminators. See RFC 7685. + // + // NB: because this code works out the length of all existing extensions + // it MUST always appear last (save for any PSK extension). if (header_len > 0xff && header_len < 0x200) { - // Add padding to workaround bugs in F5 terminators. See RFC 7685. - // - // NB: because this code works out the length of all existing extensions - // it MUST always appear last. - size_t padding_len = 0x200 - header_len; + // If our calculations already included a padding extension, remove that + // factor because we're about to change its length. + if (padding_len != 0) { + header_len -= 4 + padding_len; + } + padding_len = 0x200 - header_len; // Extensions take at least four bytes to encode. Always include at least // one byte of data if including the extension. WebSphere Application // Server 7.0 is intolerant to the last extension being zero-length. See @@ -2970,13 +3083,15 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { } else { padding_len = 1; } + } + if (padding_len != 0) { uint8_t *padding_bytes; if (!CBB_add_u16(&extensions, TLSEXT_TYPE_padding) || !CBB_add_u16(&extensions, padding_len) || !CBB_add_space(&extensions, &padding_bytes, padding_len)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } OPENSSL_memset(padding_bytes, 0, padding_len); @@ -2986,7 +3101,7 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { // The PSK extension must be last, including after the padding. if (!ext_pre_shared_key_add_clienthello(hs, &extensions)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } // Discard empty extensions blocks. @@ -2997,7 +3112,7 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { return CBB_flush(out); } -int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { +bool ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; CBB extensions; if (!CBB_add_u16_length_prefixed(out, &extensions)) { @@ -3017,10 +3132,6 @@ int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { } } - if (!custom_ext_add_serverhello(hs, &extensions)) { - goto err; - } - // Discard empty extensions blocks before TLS 1.3. if (ssl_protocol_version(ssl) < TLS1_3_VERSION && CBB_len(&extensions) == 0) { @@ -3031,13 +3142,12 @@ int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { err: OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } -static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, - const SSL_CLIENT_HELLO *client_hello, - int *out_alert) { - SSL *const ssl = hs->ssl; +static bool ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, + const SSL_CLIENT_HELLO *client_hello, + int *out_alert) { for (size_t i = 0; i < kNumExtensions; i++) { if (kExtensions[i].init != NULL) { kExtensions[i].init(hs); @@ -3045,7 +3155,6 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, } hs->extensions.received = 0; - hs->custom_extensions.received = 0; CBS extensions; CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); while (CBS_len(&extensions) != 0) { @@ -3056,24 +3165,13 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { *out_alert = SSL_AD_DECODE_ERROR; - return 0; - } - - // RFC 5746 made the existence of extensions in SSL 3.0 somewhat - // ambiguous. Ignore all but the renegotiation_info extension. - if (ssl->version == SSL3_VERSION && type != TLSEXT_TYPE_renegotiate) { - continue; + return false; } unsigned ext_index; const struct tls_extension *const ext = tls_extension_find(&ext_index, type); - if (ext == NULL) { - if (!custom_ext_parse_clienthello(hs, out_alert, type, &extension)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); - return 0; - } continue; } @@ -3083,7 +3181,7 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, *out_alert = alert; OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)type); - return 0; + return false; } } @@ -3112,36 +3210,36 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); *out_alert = alert; - return 0; + return false; } } - return 1; + return true; } -int ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, - const SSL_CLIENT_HELLO *client_hello) { +bool ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, + const SSL_CLIENT_HELLO *client_hello) { SSL *const ssl = hs->ssl; int alert = SSL_AD_DECODE_ERROR; - if (ssl_scan_clienthello_tlsext(hs, client_hello, &alert) <= 0) { + if (!ssl_scan_clienthello_tlsext(hs, client_hello, &alert)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; + return false; } - if (ssl_check_clienthello_tlsext(hs) <= 0) { + if (!ssl_check_clienthello_tlsext(hs)) { OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_TLSEXT); - return 0; + return false; } - return 1; + return true; } -static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, - int *out_alert) { +static bool ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, + int *out_alert) { SSL *const ssl = hs->ssl; // Before TLS 1.3, ServerHello extensions blocks may be omitted if empty. if (CBS_len(cbs) == 0 && ssl_protocol_version(ssl) < TLS1_3_VERSION) { - return 1; + return true; } // Decode the extensions block and check it is valid. @@ -3149,7 +3247,7 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, if (!CBS_get_u16_length_prefixed(cbs, &extensions) || !tls1_check_duplicate_extensions(&extensions)) { *out_alert = SSL_AD_DECODE_ERROR; - return 0; + return false; } uint32_t received = 0; @@ -3161,7 +3259,7 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { *out_alert = SSL_AD_DECODE_ERROR; - return 0; + return false; } unsigned ext_index; @@ -3169,24 +3267,21 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, tls_extension_find(&ext_index, type); if (ext == NULL) { - hs->received_custom_extension = true; - if (!custom_ext_parse_serverhello(hs, out_alert, type, &extension)) { - return 0; - } - continue; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)type); + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + return false; } static_assert(kNumExtensions <= sizeof(hs->extensions.sent) * 8, "too many bits"); - if (!(hs->extensions.sent & (1u << ext_index)) && - type != TLSEXT_TYPE_renegotiate) { - // If the extension was never sent then it is illegal, except for the - // renegotiation extension which, in SSL 3.0, is signaled via SCSV. + if (!(hs->extensions.sent & (1u << ext_index))) { + // If the extension was never sent then it is illegal. OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); ERR_add_error_dataf("extension :%u", (unsigned)type); *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; - return 0; + return false; } received |= (1u << ext_index); @@ -3196,7 +3291,7 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)type); *out_alert = alert; - return 0; + return false; } } @@ -3209,125 +3304,129 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); *out_alert = alert; - return 0; + return false; } } } - return 1; + return true; } -static int ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs) { +static bool ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (ssl->token_binding_negotiated && + if (ssl->s3->token_binding_negotiated && !(SSL_get_secure_renegotiation_support(ssl) && SSL_get_extms_support(ssl))) { OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); - return -1; + return false; } int ret = SSL_TLSEXT_ERR_NOACK; int al = SSL_AD_UNRECOGNIZED_NAME; - if (ssl->ctx->tlsext_servername_callback != 0) { - ret = ssl->ctx->tlsext_servername_callback(ssl, &al, - ssl->ctx->tlsext_servername_arg); - } else if (ssl->session_ctx->tlsext_servername_callback != 0) { - ret = ssl->session_ctx->tlsext_servername_callback( - ssl, &al, ssl->session_ctx->tlsext_servername_arg); + if (ssl->ctx->servername_callback != 0) { + ret = ssl->ctx->servername_callback(ssl, &al, ssl->ctx->servername_arg); + } else if (ssl->session_ctx->servername_callback != 0) { + ret = ssl->session_ctx->servername_callback( + ssl, &al, ssl->session_ctx->servername_arg); } switch (ret) { case SSL_TLSEXT_ERR_ALERT_FATAL: ssl_send_alert(ssl, SSL3_AL_FATAL, al); - return -1; + return false; case SSL_TLSEXT_ERR_NOACK: hs->should_ack_sni = false; - return 1; + return true; default: - return 1; + return true; } } -int ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs) { +bool ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs) { SSL *const ssl = hs->ssl; int alert = SSL_AD_DECODE_ERROR; - if (ssl_scan_serverhello_tlsext(hs, cbs, &alert) <= 0) { + if (!ssl_scan_serverhello_tlsext(hs, cbs, &alert)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; + return false; } - return 1; + return true; } static enum ssl_ticket_aead_result_t decrypt_ticket_with_cipher_ctx( - uint8_t **out, size_t *out_len, EVP_CIPHER_CTX *cipher_ctx, - HMAC_CTX *hmac_ctx, const uint8_t *ticket, size_t ticket_len) { + Array *out, EVP_CIPHER_CTX *cipher_ctx, HMAC_CTX *hmac_ctx, + Span ticket) { size_t iv_len = EVP_CIPHER_CTX_iv_length(cipher_ctx); // Check the MAC at the end of the ticket. uint8_t mac[EVP_MAX_MD_SIZE]; size_t mac_len = HMAC_size(hmac_ctx); - if (ticket_len < SSL_TICKET_KEY_NAME_LEN + iv_len + 1 + mac_len) { + if (ticket.size() < SSL_TICKET_KEY_NAME_LEN + iv_len + 1 + mac_len) { // The ticket must be large enough for key name, IV, data, and MAC. return ssl_ticket_aead_ignore_ticket; } - HMAC_Update(hmac_ctx, ticket, ticket_len - mac_len); + // Split the ticket into the ticket and the MAC. + auto ticket_mac = ticket.subspan(ticket.size() - mac_len); + ticket = ticket.subspan(0, ticket.size() - mac_len); + HMAC_Update(hmac_ctx, ticket.data(), ticket.size()); HMAC_Final(hmac_ctx, mac, NULL); - int mac_ok = - CRYPTO_memcmp(mac, ticket + (ticket_len - mac_len), mac_len) == 0; + assert(mac_len == ticket_mac.size()); + bool mac_ok = CRYPTO_memcmp(mac, ticket_mac.data(), mac_len) == 0; #if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - mac_ok = 1; + mac_ok = true; #endif if (!mac_ok) { return ssl_ticket_aead_ignore_ticket; } // Decrypt the session data. - const uint8_t *ciphertext = ticket + SSL_TICKET_KEY_NAME_LEN + iv_len; - size_t ciphertext_len = ticket_len - SSL_TICKET_KEY_NAME_LEN - iv_len - - mac_len; - UniquePtr plaintext((uint8_t *)OPENSSL_malloc(ciphertext_len)); - if (!plaintext) { + auto ciphertext = ticket.subspan(SSL_TICKET_KEY_NAME_LEN + iv_len); + Array plaintext; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + if (!plaintext.CopyFrom(ciphertext)) { return ssl_ticket_aead_error; } - size_t plaintext_len; -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - OPENSSL_memcpy(plaintext.get(), ciphertext, ciphertext_len); - plaintext_len = ciphertext_len; #else - if (ciphertext_len >= INT_MAX) { + if (ciphertext.size() >= INT_MAX) { return ssl_ticket_aead_ignore_ticket; } + if (!plaintext.Init(ciphertext.size())) { + return ssl_ticket_aead_error; + } int len1, len2; - if (!EVP_DecryptUpdate(cipher_ctx, plaintext.get(), &len1, ciphertext, - (int)ciphertext_len) || - !EVP_DecryptFinal_ex(cipher_ctx, plaintext.get() + len1, &len2)) { + if (!EVP_DecryptUpdate(cipher_ctx, plaintext.data(), &len1, ciphertext.data(), + (int)ciphertext.size()) || + !EVP_DecryptFinal_ex(cipher_ctx, plaintext.data() + len1, &len2)) { ERR_clear_error(); return ssl_ticket_aead_ignore_ticket; } - plaintext_len = (size_t)(len1) + len2; + plaintext.Shrink(static_cast(len1) + len2); #endif - *out = plaintext.release(); - *out_len = plaintext_len; + *out = std::move(plaintext); return ssl_ticket_aead_success; } static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_cb( - SSL *ssl, uint8_t **out, size_t *out_len, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len) { - assert(ticket_len >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); + SSL_HANDSHAKE *hs, Array *out, bool *out_renew_ticket, + Span ticket) { + assert(ticket.size() >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); ScopedEVP_CIPHER_CTX cipher_ctx; ScopedHMAC_CTX hmac_ctx; - const uint8_t *iv = ticket + SSL_TICKET_KEY_NAME_LEN; - int cb_ret = ssl->session_ctx->tlsext_ticket_key_cb( - ssl, (uint8_t *)ticket /* name */, (uint8_t *)iv, cipher_ctx.get(), - hmac_ctx.get(), 0 /* decrypt */); + auto name = ticket.subspan(0, SSL_TICKET_KEY_NAME_LEN); + // The actual IV is shorter, but the length is determined by the callback's + // chosen cipher. Instead we pass in |EVP_MAX_IV_LENGTH| worth of IV to ensure + // the callback has enough. + auto iv = ticket.subspan(SSL_TICKET_KEY_NAME_LEN, EVP_MAX_IV_LENGTH); + int cb_ret = hs->ssl->session_ctx->ticket_key_cb( + hs->ssl, const_cast(name.data()), + const_cast(iv.data()), cipher_ctx.get(), hmac_ctx.get(), + 0 /* decrypt */); if (cb_ret < 0) { return ssl_ticket_aead_error; } else if (cb_ret == 0) { @@ -3337,106 +3436,102 @@ static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_cb( } else { assert(cb_ret == 1); } - return decrypt_ticket_with_cipher_ctx(out, out_len, cipher_ctx.get(), - hmac_ctx.get(), ticket, ticket_len); + return decrypt_ticket_with_cipher_ctx(out, cipher_ctx.get(), hmac_ctx.get(), + ticket); } static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_ticket_keys( - SSL *ssl, uint8_t **out, size_t *out_len, const uint8_t *ticket, - size_t ticket_len) { - assert(ticket_len >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); - SSL_CTX *ctx = ssl->session_ctx; + SSL_HANDSHAKE *hs, Array *out, Span ticket) { + assert(ticket.size() >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); + SSL_CTX *ctx = hs->ssl->session_ctx.get(); // Rotate the ticket key if necessary. if (!ssl_ctx_rotate_ticket_encryption_key(ctx)) { return ssl_ticket_aead_error; } + const EVP_CIPHER *cipher = EVP_aes_128_cbc(); + auto name = ticket.subspan(0, SSL_TICKET_KEY_NAME_LEN); + auto iv = + ticket.subspan(SSL_TICKET_KEY_NAME_LEN, EVP_CIPHER_iv_length(cipher)); + // Pick the matching ticket key and decrypt. ScopedEVP_CIPHER_CTX cipher_ctx; ScopedHMAC_CTX hmac_ctx; { MutexReadLock lock(&ctx->lock); - const tlsext_ticket_key *key; - if (ctx->tlsext_ticket_key_current && - !OPENSSL_memcmp(ctx->tlsext_ticket_key_current->name, ticket, - SSL_TICKET_KEY_NAME_LEN)) { - key = ctx->tlsext_ticket_key_current; - } else if (ctx->tlsext_ticket_key_prev && - !OPENSSL_memcmp(ctx->tlsext_ticket_key_prev->name, ticket, - SSL_TICKET_KEY_NAME_LEN)) { - key = ctx->tlsext_ticket_key_prev; + const TicketKey *key; + if (ctx->ticket_key_current && name == ctx->ticket_key_current->name) { + key = ctx->ticket_key_current.get(); + } else if (ctx->ticket_key_prev && name == ctx->ticket_key_prev->name) { + key = ctx->ticket_key_prev.get(); } else { return ssl_ticket_aead_ignore_ticket; } - const uint8_t *iv = ticket + SSL_TICKET_KEY_NAME_LEN; if (!HMAC_Init_ex(hmac_ctx.get(), key->hmac_key, sizeof(key->hmac_key), tlsext_tick_md(), NULL) || - !EVP_DecryptInit_ex(cipher_ctx.get(), EVP_aes_128_cbc(), NULL, - key->aes_key, iv)) { + !EVP_DecryptInit_ex(cipher_ctx.get(), cipher, NULL, + key->aes_key, iv.data())) { return ssl_ticket_aead_error; } } - return decrypt_ticket_with_cipher_ctx(out, out_len, cipher_ctx.get(), - hmac_ctx.get(), ticket, ticket_len); + return decrypt_ticket_with_cipher_ctx(out, cipher_ctx.get(), hmac_ctx.get(), + ticket); } static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_method( - SSL *ssl, uint8_t **out, size_t *out_len, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len) { - uint8_t *plaintext = (uint8_t *)OPENSSL_malloc(ticket_len); - if (plaintext == NULL) { + SSL_HANDSHAKE *hs, Array *out, bool *out_renew_ticket, + Span ticket) { + Array plaintext; + if (!plaintext.Init(ticket.size())) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return ssl_ticket_aead_error; } size_t plaintext_len; const enum ssl_ticket_aead_result_t result = - ssl->session_ctx->ticket_aead_method->open( - ssl, plaintext, &plaintext_len, ticket_len, ticket, ticket_len); - - if (result == ssl_ticket_aead_success) { - *out = plaintext; - plaintext = NULL; - *out_len = plaintext_len; + hs->ssl->session_ctx->ticket_aead_method->open( + hs->ssl, plaintext.data(), &plaintext_len, ticket.size(), + ticket.data(), ticket.size()); + if (result != ssl_ticket_aead_success) { + return result; } - OPENSSL_free(plaintext); - return result; + plaintext.Shrink(plaintext_len); + *out = std::move(plaintext); + return ssl_ticket_aead_success; } enum ssl_ticket_aead_result_t ssl_process_ticket( - SSL *ssl, UniquePtr *out_session, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len, const uint8_t *session_id, - size_t session_id_len) { + SSL_HANDSHAKE *hs, UniquePtr *out_session, + bool *out_renew_ticket, Span ticket, + Span session_id) { *out_renew_ticket = false; out_session->reset(); - if ((SSL_get_options(ssl) & SSL_OP_NO_TICKET) || - session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + if ((SSL_get_options(hs->ssl) & SSL_OP_NO_TICKET) || + session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { return ssl_ticket_aead_ignore_ticket; } - uint8_t *plaintext = NULL; - size_t plaintext_len; + Array plaintext; enum ssl_ticket_aead_result_t result; - if (ssl->session_ctx->ticket_aead_method != NULL) { - result = ssl_decrypt_ticket_with_method( - ssl, &plaintext, &plaintext_len, out_renew_ticket, ticket, ticket_len); + if (hs->ssl->session_ctx->ticket_aead_method != NULL) { + result = ssl_decrypt_ticket_with_method(hs, &plaintext, out_renew_ticket, + ticket); } else { - // Ensure there is room for the key name and the largest IV - // |tlsext_ticket_key_cb| may try to consume. The real limit may be lower, - // but the maximum IV length should be well under the minimum size for the - // session material and HMAC. - if (ticket_len < SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH) { + // Ensure there is room for the key name and the largest IV |ticket_key_cb| + // may try to consume. The real limit may be lower, but the maximum IV + // length should be well under the minimum size for the session material and + // HMAC. + if (ticket.size() < SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH) { return ssl_ticket_aead_ignore_ticket; } - if (ssl->session_ctx->tlsext_ticket_key_cb != NULL) { - result = ssl_decrypt_ticket_with_cb(ssl, &plaintext, &plaintext_len, - out_renew_ticket, ticket, ticket_len); + if (hs->ssl->session_ctx->ticket_key_cb != NULL) { + result = + ssl_decrypt_ticket_with_cb(hs, &plaintext, out_renew_ticket, ticket); } else { - result = ssl_decrypt_ticket_with_ticket_keys( - ssl, &plaintext, &plaintext_len, ticket, ticket_len); + result = ssl_decrypt_ticket_with_ticket_keys(hs, &plaintext, ticket); } } @@ -3445,10 +3540,8 @@ enum ssl_ticket_aead_result_t ssl_process_ticket( } // Decode the session. - UniquePtr session( - SSL_SESSION_from_bytes(plaintext, plaintext_len, ssl->ctx)); - OPENSSL_free(plaintext); - + UniquePtr session(SSL_SESSION_from_bytes( + plaintext.data(), plaintext.size(), hs->ssl->ctx.get())); if (!session) { ERR_clear_error(); // Don't leave an error on the queue. return ssl_ticket_aead_ignore_ticket; @@ -3456,8 +3549,8 @@ enum ssl_ticket_aead_result_t ssl_process_ticket( // Copy the client's session ID into the new session, to denote the ticket has // been accepted. - OPENSSL_memcpy(session->session_id, session_id, session_id_len); - session->session_id_length = session_id_len; + OPENSSL_memcpy(session->session_id, session_id.data(), session_id.size()); + session->session_id_length = session_id.size(); *out_session = std::move(session); return ssl_ticket_aead_success; @@ -3469,7 +3562,10 @@ bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *in_sigalgs) { return true; } - return parse_u16_array(in_sigalgs, &hs->peer_sigalgs); + // In all contexts, the signature algorithms list may not be empty. (It may be + // omitted by clients in TLS 1.2, but then the entire extension is omitted.) + return CBS_len(in_sigalgs) != 0 && + parse_u16_array(in_sigalgs, &hs->peer_sigalgs); } bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey) { @@ -3487,7 +3583,8 @@ bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey) { bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { SSL *const ssl = hs->ssl; - CERT *cert = ssl->cert; + CERT *cert = hs->config->cert.get(); + DC *dc = cert->dc.get(); // Before TLS 1.2, the signature algorithm isn't negotiated as part of the // handshake. @@ -3500,19 +3597,13 @@ bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { } Span sigalgs = kSignSignatureAlgorithms; - if (cert->sigalgs != nullptr) { - sigalgs = MakeConstSpan(cert->sigalgs, cert->num_sigalgs); + if (ssl_signing_with_dc(hs)) { + sigalgs = MakeConstSpan(&dc->expected_cert_verify_algorithm, 1); + } else if (!cert->sigalgs.empty()) { + sigalgs = cert->sigalgs; } - Span peer_sigalgs = hs->peer_sigalgs; - if (peer_sigalgs.empty() && ssl_protocol_version(ssl) < TLS1_3_VERSION) { - // If the client didn't specify any signature_algorithms extension then - // we can assume that it supports SHA1. See - // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 - static const uint16_t kDefaultPeerAlgorithms[] = {SSL_SIGN_RSA_PKCS1_SHA1, - SSL_SIGN_ECDSA_SHA1}; - peer_sigalgs = kDefaultPeerAlgorithms; - } + Span peer_sigalgs = tls1_get_peer_verify_algorithms(hs); for (uint16_t sigalg : sigalgs) { // SSL_SIGN_RSA_PKCS1_MD5_SHA1 is an internal value and should never be @@ -3534,7 +3625,20 @@ bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { return false; } -int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { +Span tls1_get_peer_verify_algorithms(const SSL_HANDSHAKE *hs) { + Span peer_sigalgs = hs->peer_sigalgs; + if (peer_sigalgs.empty() && ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + // If the client didn't specify any signature_algorithms extension then + // we can assume that it supports SHA1. See + // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + static const uint16_t kDefaultPeerAlgorithms[] = {SSL_SIGN_RSA_PKCS1_SHA1, + SSL_SIGN_ECDSA_SHA1}; + peer_sigalgs = kDefaultPeerAlgorithms; + } + return peer_sigalgs; +} + +bool tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { SSL *const ssl = hs->ssl; // A Channel ID handshake message is structured to contain multiple // extensions, but the only one that can be present is Channel ID. @@ -3547,19 +3651,19 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { CBS_len(&extension) != TLSEXT_CHANNEL_ID_SIZE) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; + return false; } UniquePtr p256(EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1)); if (!p256) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_P256_SUPPORT); - return 0; + return false; } UniquePtr sig(ECDSA_SIG_new()); UniquePtr x(BN_new()), y(BN_new()); if (!sig || !x || !y) { - return 0; + return false; } const uint8_t *p = CBS_data(&extension); @@ -3567,7 +3671,7 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { BN_bin2bn(p + 32, 32, y.get()) == NULL || BN_bin2bn(p + 64, 32, sig->r) == NULL || BN_bin2bn(p + 96, 32, sig->s) == NULL) { - return 0; + return false; } UniquePtr key(EC_KEY_new()); @@ -3577,40 +3681,39 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { y.get(), nullptr) || !EC_KEY_set_group(key.get(), p256.get()) || !EC_KEY_set_public_key(key.get(), point.get())) { - return 0; + return false; } uint8_t digest[EVP_MAX_MD_SIZE]; size_t digest_len; if (!tls1_channel_id_hash(hs, digest, &digest_len)) { - return 0; + return false; } - int sig_ok = ECDSA_do_verify(digest, digest_len, sig.get(), key.get()); + bool sig_ok = ECDSA_do_verify(digest, digest_len, sig.get(), key.get()); #if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = 1; + sig_ok = true; ERR_clear_error(); #endif if (!sig_ok) { OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_SIGNATURE_INVALID); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); - ssl->s3->tlsext_channel_id_valid = false; - return 0; + ssl->s3->channel_id_valid = false; + return false; } - OPENSSL_memcpy(ssl->s3->tlsext_channel_id, p, 64); - return 1; + OPENSSL_memcpy(ssl->s3->channel_id, p, 64); + return true; } bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb) { - SSL *const ssl = hs->ssl; uint8_t digest[EVP_MAX_MD_SIZE]; size_t digest_len; if (!tls1_channel_id_hash(hs, digest, &digest_len)) { return false; } - EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(ssl->tlsext_channel_id_private); + EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(hs->config->channel_id_private.get()); if (ec_key == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return false; @@ -3643,17 +3746,17 @@ bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb) { return true; } -int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { +bool tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { SSL *const ssl = hs->ssl; if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { Array msg; if (!tls13_get_cert_verify_signature_input(hs, &msg, ssl_cert_verify_channel_id)) { - return 0; + return false; } SHA256(msg.data(), msg.size(), out); *out_len = SHA256_DIGEST_LENGTH; - return 1; + return true; } SHA256_CTX ctx; @@ -3667,7 +3770,7 @@ int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { SHA256_Update(&ctx, kResumptionMagic, sizeof(kResumptionMagic)); if (ssl->session->original_handshake_hash_len == 0) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } SHA256_Update(&ctx, ssl->session->original_handshake_hash, ssl->session->original_handshake_hash_len); @@ -3676,24 +3779,21 @@ int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { uint8_t hs_hash[EVP_MAX_MD_SIZE]; size_t hs_hash_len; if (!hs->transcript.GetHash(hs_hash, &hs_hash_len)) { - return 0; + return false; } SHA256_Update(&ctx, hs_hash, (size_t)hs_hash_len); SHA256_Final(out, &ctx); *out_len = SHA256_DIGEST_LENGTH; - return 1; + return true; } -// tls1_record_handshake_hashes_for_channel_id records the current handshake -// hashes in |hs->new_session| so that Channel ID resumptions can sign that -// data. -int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs) { +bool tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // This function should never be called for a resumed session because the // handshake hashes that we wish to record are for the original, full // handshake. if (ssl->session != NULL) { - return 0; + return false; } static_assert( @@ -3703,35 +3803,34 @@ int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs) { size_t digest_len; if (!hs->transcript.GetHash(hs->new_session->original_handshake_hash, &digest_len)) { - return 0; + return false; } static_assert(EVP_MAX_MD_SIZE <= 0xff, "EVP_MAX_MD_SIZE does not fit in uint8_t"); hs->new_session->original_handshake_hash_len = (uint8_t)digest_len; - return 1; + return true; } -int ssl_do_channel_id_callback(SSL *ssl) { - if (ssl->tlsext_channel_id_private != NULL || - ssl->ctx->channel_id_cb == NULL) { - return 1; +bool ssl_do_channel_id_callback(SSL_HANDSHAKE *hs) { + if (hs->config->channel_id_private != NULL || + hs->ssl->ctx->channel_id_cb == NULL) { + return true; } EVP_PKEY *key = NULL; - ssl->ctx->channel_id_cb(ssl, &key); + hs->ssl->ctx->channel_id_cb(hs->ssl, &key); if (key == NULL) { // The caller should try again later. - return 1; + return true; } - int ret = SSL_set1_tls_channel_id(ssl, key); - EVP_PKEY_free(key); - return ret; + UniquePtr free_key(key); + return SSL_set1_tls_channel_id(hs->ssl, key); } -int ssl_is_sct_list_valid(const CBS *contents) { +bool ssl_is_sct_list_valid(const CBS *contents) { // Shallow parse the SCT list for sanity. By the RFC // (https://tools.ietf.org/html/rfc6962#section-3.3) neither the list nor any // of the SCTs may be empty. @@ -3740,21 +3839,21 @@ int ssl_is_sct_list_valid(const CBS *contents) { if (!CBS_get_u16_length_prefixed(©, &sct_list) || CBS_len(©) != 0 || CBS_len(&sct_list) == 0) { - return 0; + return false; } while (CBS_len(&sct_list) > 0) { CBS sct; if (!CBS_get_u16_length_prefixed(&sct_list, &sct) || CBS_len(&sct) == 0) { - return 0; + return false; } } - return 1; + return true; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -3775,9 +3874,3 @@ int SSL_early_callback_ctx_extension_get(const SSL_CLIENT_HELLO *client_hello, void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled) { ctx->ed25519_enabled = !!enabled; } - -int SSL_extension_supported(unsigned extension_value) { - uint32_t index; - return extension_value == TLSEXT_TYPE_padding || - tls_extension_find(&index, extension_value) != NULL; -} diff --git a/Pods/BoringSSL-GRPC/ssl/t1_lib.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc.grpc_back similarity index 76% rename from Pods/BoringSSL-GRPC/ssl/t1_lib.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc.grpc_back index 97c0c4b9a..7958b5c25 100644 --- a/Pods/BoringSSL-GRPC/ssl/t1_lib.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/t1_lib.cc.grpc_back @@ -129,9 +129,9 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN -static int ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs); +static bool ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs); static int compare_uint16_t(const void *p1, const void *p2) { uint16_t u1 = *((const uint16_t *)p1); @@ -149,7 +149,7 @@ static int compare_uint16_t(const void *p1, const void *p2) { // more than one extension of the same type in a ClientHello or ServerHello. // This function does an initial scan over the extensions block to filter those // out. -static int tls1_check_duplicate_extensions(const CBS *cbs) { +static bool tls1_check_duplicate_extensions(const CBS *cbs) { // First pass: count the extensions. size_t num_extensions = 0; CBS extensions = *cbs; @@ -159,19 +159,19 @@ static int tls1_check_duplicate_extensions(const CBS *cbs) { if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { - return 0; + return false; } num_extensions++; } if (num_extensions == 0) { - return 1; + return true; } Array extension_types; if (!extension_types.Init(num_extensions)) { - return 0; + return false; } // Second pass: gather the extension types. @@ -182,7 +182,7 @@ static int tls1_check_duplicate_extensions(const CBS *cbs) { if (!CBS_get_u16(&extensions, &extension_types[i]) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { // This should not happen. - return 0; + return false; } } assert(CBS_len(&extensions) == 0); @@ -192,17 +192,21 @@ static int tls1_check_duplicate_extensions(const CBS *cbs) { compare_uint16_t); for (size_t i = 1; i < num_extensions; i++) { if (extension_types[i - 1] == extension_types[i]) { - return 0; + return false; } } - return 1; + return true; +} + +static bool is_post_quantum_group(uint16_t id) { + return id == SSL_CURVE_CECPQ2; } -int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, - const SSLMessage &msg) { +bool ssl_client_hello_init(const SSL *ssl, SSL_CLIENT_HELLO *out, + const SSLMessage &msg) { OPENSSL_memset(out, 0, sizeof(*out)); - out->ssl = ssl; + out->ssl = const_cast(ssl); out->client_hello = CBS_data(&msg.body); out->client_hello_len = CBS_len(&msg.body); @@ -212,7 +216,7 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, !CBS_get_bytes(&client_hello, &random, SSL3_RANDOM_SIZE) || !CBS_get_u8_length_prefixed(&client_hello, &session_id) || CBS_len(&session_id) > SSL_MAX_SSL_SESSION_ID_LENGTH) { - return 0; + return false; } out->random = CBS_data(&random); @@ -225,7 +229,7 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, CBS cookie; if (!CBS_get_u8_length_prefixed(&client_hello, &cookie) || CBS_len(&cookie) > DTLS1_COOKIE_LENGTH) { - return 0; + return false; } } @@ -234,7 +238,7 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, CBS_len(&cipher_suites) < 2 || (CBS_len(&cipher_suites) & 1) != 0 || !CBS_get_u8_length_prefixed(&client_hello, &compression_methods) || CBS_len(&compression_methods) < 1) { - return 0; + return false; } out->cipher_suites = CBS_data(&cipher_suites); @@ -243,11 +247,11 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, out->compression_methods_len = CBS_len(&compression_methods); // If the ClientHello ends here then it's valid, but doesn't have any - // extensions. (E.g. SSLv3.) + // extensions. if (CBS_len(&client_hello) == 0) { out->extensions = NULL; out->extensions_len = 0; - return 1; + return true; } // Extract extensions and check it is valid. @@ -255,17 +259,17 @@ int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, if (!CBS_get_u16_length_prefixed(&client_hello, &extensions) || !tls1_check_duplicate_extensions(&extensions) || CBS_len(&client_hello) != 0) { - return 0; + return false; } out->extensions = CBS_data(&extensions); out->extensions_len = CBS_len(&extensions); - return 1; + return true; } -int ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, - CBS *out, uint16_t extension_type) { +bool ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, + CBS *out, uint16_t extension_type) { CBS extensions; CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); while (CBS_len(&extensions) != 0) { @@ -274,16 +278,16 @@ int ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, CBS extension; if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { - return 0; + return false; } if (type == extension_type) { *out = extension; - return 1; + return true; } } - return 0; + return false; } static const uint16_t kDefaultGroups[] = { @@ -292,15 +296,14 @@ static const uint16_t kDefaultGroups[] = { SSL_CURVE_SECP384R1, }; -Span tls1_get_grouplist(const SSL *ssl) { - if (ssl->supported_group_list != nullptr) { - return MakeConstSpan(ssl->supported_group_list, - ssl->supported_group_list_len); +Span tls1_get_grouplist(const SSL_HANDSHAKE *hs) { + if (!hs->config->supported_group_list.empty()) { + return hs->config->supported_group_list; } return Span(kDefaultGroups); } -int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { +bool tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { SSL *const ssl = hs->ssl; assert(ssl->server); @@ -313,7 +316,7 @@ int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { // support our favoured group. Thus we do not special-case an emtpy // |peer_supported_group_list|. - Span groups = tls1_get_grouplist(ssl); + Span groups = tls1_get_grouplist(hs); Span pref, supp; if (ssl->options & SSL_OP_CIPHER_SERVER_PREFERENCE) { pref = groups; @@ -325,138 +328,126 @@ int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id) { for (uint16_t pref_group : pref) { for (uint16_t supp_group : supp) { - if (pref_group == supp_group) { + if (pref_group == supp_group && + // CECPQ2(b) doesn't fit in the u8-length-prefixed ECPoint field in + // TLS 1.2 and below. + (ssl_protocol_version(ssl) >= TLS1_3_VERSION || + !is_post_quantum_group(pref_group))) { *out_group_id = pref_group; - return 1; + return true; } } } - return 0; + return false; } -int tls1_set_curves(uint16_t **out_group_ids, size_t *out_group_ids_len, - const int *curves, size_t ncurves) { - uint16_t *group_ids = (uint16_t *)OPENSSL_malloc(ncurves * sizeof(uint16_t)); - if (group_ids == NULL) { - return 0; +bool tls1_set_curves(Array *out_group_ids, Span curves) { + Array group_ids; + if (!group_ids.Init(curves.size())) { + return false; } - for (size_t i = 0; i < ncurves; i++) { + for (size_t i = 0; i < curves.size(); i++) { if (!ssl_nid_to_group_id(&group_ids[i], curves[i])) { - OPENSSL_free(group_ids); - return 0; + return false; } } - OPENSSL_free(*out_group_ids); - *out_group_ids = group_ids; - *out_group_ids_len = ncurves; - - return 1; + *out_group_ids = std::move(group_ids); + return true; } -int tls1_set_curves_list(uint16_t **out_group_ids, size_t *out_group_ids_len, - const char *curves) { - uint16_t *group_ids = NULL; - size_t ncurves = 0; +bool tls1_set_curves_list(Array *out_group_ids, const char *curves) { + // Count the number of curves in the list. + size_t count = 0; + const char *ptr = curves, *col; + do { + col = strchr(ptr, ':'); + count++; + if (col) { + ptr = col + 1; + } + } while (col); - const char *col; - const char *ptr = curves; + Array group_ids; + if (!group_ids.Init(count)) { + return false; + } + size_t i = 0; + ptr = curves; do { col = strchr(ptr, ':'); - - uint16_t group_id; - if (!ssl_name_to_group_id(&group_id, ptr, + if (!ssl_name_to_group_id(&group_ids[i++], ptr, col ? (size_t)(col - ptr) : strlen(ptr))) { - goto err; - } - - uint16_t *new_group_ids = (uint16_t *)OPENSSL_realloc( - group_ids, (ncurves + 1) * sizeof(uint16_t)); - if (new_group_ids == NULL) { - goto err; + return false; } - group_ids = new_group_ids; - - group_ids[ncurves] = group_id; - ncurves++; - if (col) { ptr = col + 1; } } while (col); - OPENSSL_free(*out_group_ids); - *out_group_ids = group_ids; - *out_group_ids_len = ncurves; - - return 1; - -err: - OPENSSL_free(group_ids); - return 0; + assert(i == count); + *out_group_ids = std::move(group_ids); + return true; } -int tls1_check_group_id(const SSL *ssl, uint16_t group_id) { - for (uint16_t supported : tls1_get_grouplist(ssl)) { +bool tls1_check_group_id(const SSL_HANDSHAKE *hs, uint16_t group_id) { + if (is_post_quantum_group(group_id) && + ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + // CECPQ2(b) requires TLS 1.3. + return false; + } + + for (uint16_t supported : tls1_get_grouplist(hs)) { if (supported == group_id) { - return 1; + return true; } } - return 0; + return false; } // kVerifySignatureAlgorithms is the default list of accepted signature // algorithms for verifying. -// -// For now, RSA-PSS signature algorithms are not enabled on Android's system -// BoringSSL. Once the change in Chrome has stuck and the values are finalized, -// restore them. static const uint16_t kVerifySignatureAlgorithms[] = { // List our preferred algorithms first. SSL_SIGN_ED25519, SSL_SIGN_ECDSA_SECP256R1_SHA256, - SSL_SIGN_RSA_PSS_SHA256, + SSL_SIGN_RSA_PSS_RSAE_SHA256, SSL_SIGN_RSA_PKCS1_SHA256, // Larger hashes are acceptable. SSL_SIGN_ECDSA_SECP384R1_SHA384, - SSL_SIGN_RSA_PSS_SHA384, + SSL_SIGN_RSA_PSS_RSAE_SHA384, SSL_SIGN_RSA_PKCS1_SHA384, - SSL_SIGN_RSA_PSS_SHA512, + SSL_SIGN_RSA_PSS_RSAE_SHA512, SSL_SIGN_RSA_PKCS1_SHA512, // For now, SHA-1 is still accepted but least preferable. SSL_SIGN_RSA_PKCS1_SHA1, - }; // kSignSignatureAlgorithms is the default list of supported signature // algorithms for signing. -// -// For now, RSA-PSS signature algorithms are not enabled on Android's system -// BoringSSL. Once the change in Chrome has stuck and the values are finalized, -// restore them. static const uint16_t kSignSignatureAlgorithms[] = { // List our preferred algorithms first. SSL_SIGN_ED25519, SSL_SIGN_ECDSA_SECP256R1_SHA256, - SSL_SIGN_RSA_PSS_SHA256, + SSL_SIGN_RSA_PSS_RSAE_SHA256, SSL_SIGN_RSA_PKCS1_SHA256, // If needed, sign larger hashes. // // TODO(davidben): Determine which of these may be pruned. SSL_SIGN_ECDSA_SECP384R1_SHA384, - SSL_SIGN_RSA_PSS_SHA384, + SSL_SIGN_RSA_PSS_RSAE_SHA384, SSL_SIGN_RSA_PKCS1_SHA384, SSL_SIGN_ECDSA_SECP521R1_SHA512, - SSL_SIGN_RSA_PSS_SHA512, + SSL_SIGN_RSA_PSS_RSAE_SHA512, SSL_SIGN_RSA_PKCS1_SHA512, // If the peer supports nothing else, sign with SHA-1. @@ -464,44 +455,52 @@ static const uint16_t kSignSignatureAlgorithms[] = { SSL_SIGN_RSA_PKCS1_SHA1, }; -bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out) { - bool use_default = ssl->ctx->num_verify_sigalgs == 0; - Span sigalgs = kVerifySignatureAlgorithms; - if (!use_default) { - sigalgs = MakeConstSpan(ssl->ctx->verify_sigalgs, - ssl->ctx->num_verify_sigalgs); +struct SSLSignatureAlgorithmList { + bool Next(uint16_t *out) { + while (!list.empty()) { + uint16_t sigalg = list[0]; + list = list.subspan(1); + if (skip_ed25519 && sigalg == SSL_SIGN_ED25519) { + continue; + } + *out = sigalg; + return true; + } + return false; } - for (uint16_t sigalg : sigalgs) { - if (use_default && - sigalg == SSL_SIGN_ED25519 && - !ssl->ctx->ed25519_enabled) { - continue; - } + Span list; + bool skip_ed25519 = false; +}; + +static SSLSignatureAlgorithmList tls12_get_verify_sigalgs(const SSL *ssl) { + SSLSignatureAlgorithmList ret; + if (!ssl->config->verify_sigalgs.empty()) { + ret.list = ssl->config->verify_sigalgs; + } else { + ret.list = kVerifySignatureAlgorithms; + ret.skip_ed25519 = !ssl->ctx->ed25519_enabled; + } + return ret; +} + +bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out) { + SSLSignatureAlgorithmList list = tls12_get_verify_sigalgs(ssl); + uint16_t sigalg; + while (list.Next(&sigalg)) { if (!CBB_add_u16(out, sigalg)) { return false; } } - return true; } bool tls12_check_peer_sigalg(const SSL *ssl, uint8_t *out_alert, uint16_t sigalg) { - const uint16_t *sigalgs = kVerifySignatureAlgorithms; - size_t num_sigalgs = OPENSSL_ARRAY_SIZE(kVerifySignatureAlgorithms); - if (ssl->ctx->num_verify_sigalgs != 0) { - sigalgs = ssl->ctx->verify_sigalgs; - num_sigalgs = ssl->ctx->num_verify_sigalgs; - } - - for (size_t i = 0; i < num_sigalgs; i++) { - if (sigalgs == kVerifySignatureAlgorithms && - sigalgs[i] == SSL_SIGN_ED25519 && - !ssl->ctx->ed25519_enabled) { - continue; - } - if (sigalg == sigalgs[i]) { + SSLSignatureAlgorithmList list = tls12_get_verify_sigalgs(ssl); + uint16_t verify_sigalg; + while (list.Next(&verify_sigalg)) { + if (verify_sigalg == sigalg) { return true; } } @@ -567,7 +566,7 @@ static bool dont_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_sni_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->tlsext_hostname == NULL) { + if (ssl->hostname == nullptr) { return true; } @@ -577,8 +576,8 @@ static bool ext_sni_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { !CBB_add_u16_length_prefixed(&contents, &server_name_list) || !CBB_add_u8(&server_name_list, TLSEXT_NAMETYPE_host_name) || !CBB_add_u16_length_prefixed(&server_name_list, &name) || - !CBB_add_bytes(&name, (const uint8_t *)ssl->tlsext_hostname, - strlen(ssl->tlsext_hostname)) || + !CBB_add_bytes(&name, (const uint8_t *)ssl->hostname.get(), + strlen(ssl->hostname.get())) || !CBB_flush(out)) { return false; } @@ -595,45 +594,7 @@ static bool ext_sni_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_sni_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { - SSL *const ssl = hs->ssl; - if (contents == NULL) { - return true; - } - - CBS server_name_list, host_name; - uint8_t name_type; - if (!CBS_get_u16_length_prefixed(contents, &server_name_list) || - !CBS_get_u8(&server_name_list, &name_type) || - // Although the server_name extension was intended to be extensible to - // new name types and multiple names, OpenSSL 1.0.x had a bug which meant - // different name types will cause an error. Further, RFC 4366 originally - // defined syntax inextensibly. RFC 6066 corrected this mistake, but - // adding new name types is no longer feasible. - // - // Act as if the extensibility does not exist to simplify parsing. - !CBS_get_u16_length_prefixed(&server_name_list, &host_name) || - CBS_len(&server_name_list) != 0 || - CBS_len(contents) != 0) { - return false; - } - - if (name_type != TLSEXT_NAMETYPE_host_name || - CBS_len(&host_name) == 0 || - CBS_len(&host_name) > TLSEXT_MAXLEN_host_name || - CBS_contains_zero_byte(&host_name)) { - *out_alert = SSL_AD_UNRECOGNIZED_NAME; - return false; - } - - // Copy the hostname as a string. - char *raw = nullptr; - if (!CBS_strdup(&host_name, &raw)) { - *out_alert = SSL_AD_INTERNAL_ERROR; - return false; - } - ssl->s3->hostname.reset(raw); - - hs->should_ack_sni = true; + // SNI has already been parsed earlier in the handshake. See |extract_sni|. return true; } @@ -823,7 +784,7 @@ static bool ext_ri_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_ems_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { // Extended master secret is not necessary in TLS 1.3. - if (hs->min_version >= TLS1_3_VERSION || hs->max_version <= SSL3_VERSION) { + if (hs->min_version >= TLS1_3_VERSION) { return true; } @@ -841,7 +802,6 @@ static bool ext_ems_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, if (contents != NULL) { if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || - ssl->version == SSL3_VERSION || CBS_len(contents) != 0) { return false; } @@ -863,9 +823,7 @@ static bool ext_ems_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_ems_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { - uint16_t version = ssl_protocol_version(hs->ssl); - if (version >= TLS1_3_VERSION || - version == SSL3_VERSION) { + if (ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { return true; } @@ -907,26 +865,24 @@ static bool ext_ticket_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { return true; } - const uint8_t *ticket_data = NULL; - int ticket_len = 0; + Span ticket; // Renegotiation does not participate in session resumption. However, still // advertise the extension to avoid potentially breaking servers which carry // over the state from the previous handshake, such as OpenSSL servers // without upstream's 3c3f0259238594d77264a78944d409f2127642c4. if (!ssl->s3->initial_handshake_complete && - ssl->session != NULL && - ssl->session->tlsext_tick != NULL && + ssl->session != nullptr && + !ssl->session->ticket.empty() && // Don't send TLS 1.3 session tickets in the ticket extension. - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION) { - ticket_data = ssl->session->tlsext_tick; - ticket_len = ssl->session->tlsext_ticklen; + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { + ticket = ssl->session->ticket; } - CBB ticket; + CBB ticket_cbb; if (!CBB_add_u16(out, TLSEXT_TYPE_session_ticket) || - !CBB_add_u16_length_prefixed(out, &ticket) || - !CBB_add_bytes(&ticket, ticket_data, ticket_len) || + !CBB_add_u16_length_prefixed(out, &ticket_cbb) || + !CBB_add_bytes(&ticket_cbb, ticket.data(), ticket.size()) || !CBB_flush(out)) { return false; } @@ -1007,7 +963,6 @@ static bool ext_sigalgs_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS supported_signature_algorithms; if (!CBS_get_u16_length_prefixed(contents, &supported_signature_algorithms) || CBS_len(contents) != 0 || - CBS_len(&supported_signature_algorithms) == 0 || !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { return false; } @@ -1021,8 +976,7 @@ static bool ext_sigalgs_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // https://tools.ietf.org/html/rfc6066#section-8 static bool ext_ocsp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->ocsp_stapling_enabled) { + if (!hs->config->ocsp_stapling_enabled) { return true; } @@ -1086,8 +1040,7 @@ static bool ext_ocsp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_ocsp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || - !hs->ocsp_stapling_requested || - ssl->cert->ocsp_response == NULL || + !hs->ocsp_stapling_requested || hs->config->cert->ocsp_response == NULL || ssl->s3->session_reused || !ssl_cipher_uses_certificate_auth(hs->new_cipher)) { return true; @@ -1228,8 +1181,7 @@ static bool ext_npn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // https://tools.ietf.org/html/rfc6962#section-3.3.1 static bool ext_sct_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->signed_cert_timestamps_enabled) { + if (!hs->config->signed_cert_timestamps_enabled) { return true; } @@ -1256,7 +1208,7 @@ static bool ext_sct_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // If this is false then we should never have sent the SCT extension in the // ClientHello and thus this function should never have been called. - assert(ssl->signed_cert_timestamps_enabled); + assert(hs->config->signed_cert_timestamps_enabled); if (!ssl_is_sct_list_valid(contents)) { *out_alert = SSL_AD_DECODE_ERROR; @@ -1269,9 +1221,8 @@ static bool ext_sct_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // // TODO(davidben): Enforce this anyway. if (!ssl->s3->session_reused) { - CRYPTO_BUFFER_free(hs->new_session->signed_cert_timestamp_list); - hs->new_session->signed_cert_timestamp_list = - CRYPTO_BUFFER_new_from_CBS(contents, ssl->ctx->pool); + hs->new_session->signed_cert_timestamp_list.reset( + CRYPTO_BUFFER_new_from_CBS(contents, ssl->ctx->pool)); if (hs->new_session->signed_cert_timestamp_list == nullptr) { *out_alert = SSL_AD_INTERNAL_ERROR; return false; @@ -1298,9 +1249,8 @@ static bool ext_sct_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; // The extension shouldn't be sent when resuming sessions. - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || - ssl->s3->session_reused || - ssl->cert->signed_cert_timestamp_list == NULL) { + if (ssl_protocol_version(ssl) >= TLS1_3_VERSION || ssl->s3->session_reused || + hs->config->cert->signed_cert_timestamp_list == NULL) { return true; } @@ -1309,8 +1259,10 @@ static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { CBB_add_u16_length_prefixed(out, &contents) && CBB_add_bytes( &contents, - CRYPTO_BUFFER_data(ssl->cert->signed_cert_timestamp_list), - CRYPTO_BUFFER_len(ssl->cert->signed_cert_timestamp_list)) && + CRYPTO_BUFFER_data( + hs->config->cert->signed_cert_timestamp_list.get()), + CRYPTO_BUFFER_len( + hs->config->cert->signed_cert_timestamp_list.get())) && CBB_flush(out); } @@ -1321,7 +1273,7 @@ static bool ext_sct_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->alpn_client_proto_list == NULL || + if (hs->config->alpn_client_proto_list.empty() || ssl->s3->initial_handshake_complete) { return true; } @@ -1330,8 +1282,8 @@ static bool ext_alpn_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { if (!CBB_add_u16(out, TLSEXT_TYPE_application_layer_protocol_negotiation) || !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16_length_prefixed(&contents, &proto_list) || - !CBB_add_bytes(&proto_list, ssl->alpn_client_proto_list, - ssl->alpn_client_proto_list_len) || + !CBB_add_bytes(&proto_list, hs->config->alpn_client_proto_list.data(), + hs->config->alpn_client_proto_list.size()) || !CBB_flush(out)) { return false; } @@ -1347,7 +1299,7 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, } assert(!ssl->s3->initial_handshake_complete); - assert(ssl->alpn_client_proto_list != NULL); + assert(!hs->config->alpn_client_proto_list.empty()); if (hs->next_proto_neg_seen) { // NPN and ALPN may not be negotiated in the same connection. @@ -1368,7 +1320,7 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, return false; } - if (!ssl_is_alpn_protocol_allowed(ssl, protocol_name)) { + if (!ssl_is_alpn_protocol_allowed(hs, protocol_name)) { OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_ALPN_PROTOCOL); *out_alert = SSL_AD_ILLEGAL_PARAMETER; return false; @@ -1382,20 +1334,20 @@ static bool ext_alpn_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, return true; } -bool ssl_is_alpn_protocol_allowed(const SSL *ssl, +bool ssl_is_alpn_protocol_allowed(const SSL_HANDSHAKE *hs, Span protocol) { - if (ssl->alpn_client_proto_list == nullptr) { + if (hs->config->alpn_client_proto_list.empty()) { return false; } - if (ssl->ctx->allow_unknown_alpn_protos) { + if (hs->ssl->ctx->allow_unknown_alpn_protos) { return true; } // Check that the protocol name is one of the ones we advertised. - CBS client_protocol_name_list, client_protocol_name; - CBS_init(&client_protocol_name_list, ssl->alpn_client_proto_list, - ssl->alpn_client_proto_list_len); + CBS client_protocol_name_list = + MakeConstSpan(hs->config->alpn_client_proto_list), + client_protocol_name; while (CBS_len(&client_protocol_name_list) > 0) { if (!CBS_get_u8_length_prefixed(&client_protocol_name_list, &client_protocol_name)) { @@ -1454,6 +1406,11 @@ bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, ssl, &selected, &selected_len, CBS_data(&protocol_name_list), CBS_len(&protocol_name_list), ssl->ctx->alpn_select_cb_arg) == SSL_TLSEXT_ERR_OK) { + if (selected_len == 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_ALPN_PROTOCOL); + *out_alert = SSL_AD_INTERNAL_ERROR; + return false; + } if (!ssl->s3->alpn_selected.CopyFrom( MakeConstSpan(selected, selected_len))) { *out_alert = SSL_AD_INTERNAL_ERROR; @@ -1490,13 +1447,12 @@ static bool ext_alpn_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // https://tools.ietf.org/html/draft-balfanz-tls-channelid-01 static void ext_channel_id_init(SSL_HANDSHAKE *hs) { - hs->ssl->s3->tlsext_channel_id_valid = false; + hs->ssl->s3->channel_id_valid = false; } static bool ext_channel_id_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->tlsext_channel_id_enabled || - SSL_is_dtls(ssl)) { + if (!hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { return true; } @@ -1517,13 +1473,13 @@ static bool ext_channel_id_parse_serverhello(SSL_HANDSHAKE *hs, } assert(!SSL_is_dtls(ssl)); - assert(ssl->tlsext_channel_id_enabled); + assert(hs->config->channel_id_enabled); if (CBS_len(contents) != 0) { return false; } - ssl->s3->tlsext_channel_id_valid = true; + ssl->s3->channel_id_valid = true; return true; } @@ -1531,9 +1487,7 @@ static bool ext_channel_id_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { SSL *const ssl = hs->ssl; - if (contents == NULL || - !ssl->tlsext_channel_id_enabled || - SSL_is_dtls(ssl)) { + if (contents == NULL || !hs->config->channel_id_enabled || SSL_is_dtls(ssl)) { return true; } @@ -1541,13 +1495,13 @@ static bool ext_channel_id_parse_clienthello(SSL_HANDSHAKE *hs, return false; } - ssl->s3->tlsext_channel_id_valid = true; + ssl->s3->channel_id_valid = true; return true; } static bool ext_channel_id_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->s3->tlsext_channel_id_valid) { + if (!ssl->s3->channel_id_valid) { return true; } @@ -1566,7 +1520,7 @@ static bool ext_channel_id_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static void ext_srtp_init(SSL_HANDSHAKE *hs) { - hs->ssl->srtp_profile = NULL; + hs->ssl->s3->srtp_profile = NULL; } static bool ext_srtp_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { @@ -1633,7 +1587,7 @@ static bool ext_srtp_parse_serverhello(SSL_HANDSHAKE *hs, uint8_t *out_alert, // offered). for (const SRTP_PROTECTION_PROFILE *profile : profiles) { if (profile->id == profile_id) { - ssl->srtp_profile = profile; + ssl->s3->srtp_profile = profile; return true; } } @@ -1675,7 +1629,7 @@ static bool ext_srtp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, } if (server_profile->id == profile_id) { - ssl->srtp_profile = server_profile; + ssl->s3->srtp_profile = server_profile; return true; } } @@ -1686,7 +1640,7 @@ static bool ext_srtp_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, static bool ext_srtp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->srtp_profile == NULL) { + if (ssl->s3->srtp_profile == NULL) { return true; } @@ -1694,7 +1648,7 @@ static bool ext_srtp_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { if (!CBB_add_u16(out, TLSEXT_TYPE_srtp) || !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16_length_prefixed(&contents, &profile_ids) || - !CBB_add_u16(&profile_ids, ssl->srtp_profile->id) || + !CBB_add_u16(&profile_ids, ssl->s3->srtp_profile->id) || !CBB_add_u8(&contents, 0 /* empty MKI */) || !CBB_flush(out)) { return false; @@ -1722,7 +1676,7 @@ static bool ext_ec_point_add_extension(SSL_HANDSHAKE *hs, CBB *out) { } static bool ext_ec_point_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - // The point format extension is unneccessary in TLS 1.3. + // The point format extension is unnecessary in TLS 1.3. if (hs->min_version >= TLS1_3_VERSION) { return true; } @@ -1787,31 +1741,31 @@ static bool ext_ec_point_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Pre Shared Key // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.6 +// https://tools.ietf.org/html/rfc8446#section-4.2.11 static size_t ext_pre_shared_key_clienthello_length(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (hs->max_version < TLS1_3_VERSION || ssl->session == NULL || - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION) { + if (hs->max_version < TLS1_3_VERSION || ssl->session == nullptr || + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { return 0; } - size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session)); - return 15 + ssl->session->tlsext_ticklen + binder_len; + size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session.get())); + return 15 + ssl->session->ticket.size() + binder_len; } static bool ext_pre_shared_key_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; hs->needs_psk_binder = false; - if (hs->max_version < TLS1_3_VERSION || ssl->session == NULL || - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION) { + if (hs->max_version < TLS1_3_VERSION || ssl->session == nullptr || + ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION) { return true; } - // Per draft-ietf-tls-tls13-21 section 4.1.4, skip offering the session if the - // selected cipher in HelloRetryRequest does not match. This avoids performing - // the transcript hash transformation for multiple hashes. - if (hs->received_hello_retry_request && + // Per RFC 8446 section 4.1.4, skip offering the session if the selected + // cipher in HelloRetryRequest does not match. This avoids performing the + // transcript hash transformation for multiple hashes. + if (ssl->s3 && ssl->s3->used_hello_retry_request && ssl->session->cipher->algorithm_prf != hs->new_cipher->algorithm_prf) { return true; } @@ -1824,15 +1778,15 @@ static bool ext_pre_shared_key_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { // Fill in a placeholder zero binder of the appropriate length. It will be // computed and filled in later after length prefixes are computed. uint8_t zero_binder[EVP_MAX_MD_SIZE] = {0}; - size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session)); + size_t binder_len = EVP_MD_size(ssl_session_get_digest(ssl->session.get())); CBB contents, identity, ticket, binders, binder; if (!CBB_add_u16(out, TLSEXT_TYPE_pre_shared_key) || !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16_length_prefixed(&contents, &identity) || !CBB_add_u16_length_prefixed(&identity, &ticket) || - !CBB_add_bytes(&ticket, ssl->session->tlsext_tick, - ssl->session->tlsext_ticklen) || + !CBB_add_bytes(&ticket, ssl->session->ticket.data(), + ssl->session->ticket.size()) || !CBB_add_u32(&identity, obfuscated_ticket_age) || !CBB_add_u16_length_prefixed(&contents, &binders) || !CBB_add_u8_length_prefixed(&binders, &binder) || @@ -1867,7 +1821,17 @@ bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, bool ssl_ext_pre_shared_key_parse_clienthello( SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders, - uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, CBS *contents) { + uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, + const SSL_CLIENT_HELLO *client_hello, CBS *contents) { + // Verify that the pre_shared_key extension is the last extension in + // ClientHello. + if (CBS_data(contents) + CBS_len(contents) != + client_hello->extensions + client_hello->extensions_len) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PRE_SHARED_KEY_MUST_BE_LAST); + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + return false; + } + // We only process the first PSK identity since we don't support pure PSK. CBS identities, binders; if (!CBS_get_u16_length_prefixed(contents, &identities) || @@ -1941,7 +1905,7 @@ bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Pre-Shared Key Exchange Modes // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.7 +// https://tools.ietf.org/html/rfc8446#section-4.2.9 static bool ext_psk_key_exchange_modes_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { @@ -1985,26 +1949,50 @@ static bool ext_psk_key_exchange_modes_parse_clienthello(SSL_HANDSHAKE *hs, // Early Data Indication // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-18#section-4.2.8 +// https://tools.ietf.org/html/rfc8446#section-4.2.10 static bool ext_early_data_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->cert->enable_early_data || - // Session must be 0-RTT capable. - ssl->session == NULL || - ssl_session_protocol_version(ssl->session) < TLS1_3_VERSION || - ssl->session->ticket_max_early_data == 0 || - // The second ClientHello never offers early data. - hs->received_hello_retry_request || - // In case ALPN preferences changed since this session was established, - // avoid reporting a confusing value in |SSL_get0_alpn_selected|. - (ssl->session->early_alpn_len != 0 && - !ssl_is_alpn_protocol_allowed( - ssl, MakeConstSpan(ssl->session->early_alpn, - ssl->session->early_alpn_len)))) { + // The second ClientHello never offers early data, and we must have already + // filled in |early_data_reason| by this point. + if (ssl->s3->used_hello_retry_request) { + assert(ssl->s3->early_data_reason != ssl_early_data_unknown); + return true; + } + + if (!ssl->enable_early_data) { + ssl->s3->early_data_reason = ssl_early_data_disabled; + return true; + } + + if (hs->max_version < TLS1_3_VERSION) { + // We discard inapplicable sessions, so this is redundant with the session + // checks below, but we check give a more useful reason. + ssl->s3->early_data_reason = ssl_early_data_protocol_version; return true; } + if (ssl->session == nullptr) { + ssl->s3->early_data_reason = ssl_early_data_no_session_offered; + return true; + } + + if (ssl_session_protocol_version(ssl->session.get()) < TLS1_3_VERSION || + ssl->session->ticket_max_early_data == 0) { + ssl->s3->early_data_reason = ssl_early_data_unsupported_for_session; + return true; + } + + // In case ALPN preferences changed since this session was established, avoid + // reporting a confusing value in |SSL_get0_alpn_selected| and sending early + // data we know will be rejected. + if (!ssl->session->early_alpn.empty() && + !ssl_is_alpn_protocol_allowed(hs, ssl->session->early_alpn)) { + ssl->s3->early_data_reason = ssl_early_data_alpn_mismatch; + return true; + } + + // |early_data_reason| will be filled in later when the server responds. hs->early_data_offered = true; if (!CBB_add_u16(out, TLSEXT_TYPE_early_data) || @@ -2017,12 +2005,27 @@ static bool ext_early_data_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } static bool ext_early_data_parse_serverhello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, CBS *contents) { + uint8_t *out_alert, + CBS *contents) { SSL *const ssl = hs->ssl; if (contents == NULL) { + if (hs->early_data_offered && !ssl->s3->used_hello_retry_request) { + ssl->s3->early_data_reason = ssl->s3->session_reused + ? ssl_early_data_peer_declined + : ssl_early_data_session_not_resumed; + } else { + // We already filled in |early_data_reason| when declining to offer 0-RTT + // or handling the implicit HelloRetryRequest reject. + assert(ssl->s3->early_data_reason != ssl_early_data_unknown); + } return true; } + // If we received an HRR, the second ClientHello never offers early data, so + // the extensions logic will automatically reject early data extensions as + // unsolicited. This covered by the ServerAcceptsEarlyDataOnHRR test. + assert(!ssl->s3->used_hello_retry_request); + if (CBS_len(contents) != 0) { *out_alert = SSL_AD_DECODE_ERROR; return false; @@ -2034,6 +2037,7 @@ static bool ext_early_data_parse_serverhello(SSL_HANDSHAKE *hs, return false; } + ssl->s3->early_data_reason = ssl_early_data_accepted; ssl->s3->early_data_accepted = true; return true; } @@ -2072,7 +2076,7 @@ static bool ext_early_data_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Key Share // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.5 +// https://tools.ietf.org/html/rfc8446#section-4.2.8 static bool ext_key_share_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; @@ -2088,7 +2092,8 @@ static bool ext_key_share_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } uint16_t group_id = hs->retry_group; - if (hs->received_hello_retry_request) { + uint16_t second_group_id = 0; + if (ssl->s3 && ssl->s3->used_hello_retry_request) { // We received a HelloRetryRequest without a new curve, so there is no new // share to append. Leave |hs->key_share| as-is. if (group_id == 0 && @@ -2111,27 +2116,46 @@ static bool ext_key_share_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } // Predict the most preferred group. - Span groups = tls1_get_grouplist(ssl); + Span groups = tls1_get_grouplist(hs); if (groups.empty()) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_GROUPS_SPECIFIED); return false; } group_id = groups[0]; + + if (is_post_quantum_group(group_id) && groups.size() >= 2) { + // CECPQ2(b) is not sent as the only initial key share. We'll include the + // 2nd preference group too to avoid round-trips. + second_group_id = groups[1]; + assert(second_group_id != group_id); + } } - hs->key_share = SSLKeyShare::Create(group_id); CBB key_exchange; - if (!hs->key_share || + hs->key_shares[0] = SSLKeyShare::Create(group_id); + if (!hs->key_shares[0] || !CBB_add_u16(&kse_bytes, group_id) || !CBB_add_u16_length_prefixed(&kse_bytes, &key_exchange) || - !hs->key_share->Offer(&key_exchange) || + !hs->key_shares[0]->Offer(&key_exchange) || !CBB_flush(&kse_bytes)) { return false; } - // Save the contents of the extension to repeat it in the second ClientHello. - if (!hs->received_hello_retry_request && + if (second_group_id != 0) { + hs->key_shares[1] = SSLKeyShare::Create(second_group_id); + if (!hs->key_shares[1] || + !CBB_add_u16(&kse_bytes, second_group_id) || + !CBB_add_u16_length_prefixed(&kse_bytes, &key_exchange) || + !hs->key_shares[1]->Offer(&key_exchange) || + !CBB_flush(&kse_bytes)) { + return false; + } + } + + // Save the contents of the extension to repeat it in the second + // ClientHello. + if (ssl->s3 && !ssl->s3->used_hello_retry_request && !hs->key_share_bytes.CopyFrom( MakeConstSpan(CBB_data(&kse_bytes), CBB_len(&kse_bytes)))) { return false; @@ -2153,19 +2177,24 @@ bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, return false; } - if (hs->key_share->GroupID() != group_id) { - *out_alert = SSL_AD_ILLEGAL_PARAMETER; - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); - return false; + SSLKeyShare *key_share = hs->key_shares[0].get(); + if (key_share->GroupID() != group_id) { + if (!hs->key_shares[1] || hs->key_shares[1]->GroupID() != group_id) { + *out_alert = SSL_AD_ILLEGAL_PARAMETER; + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); + return false; + } + key_share = hs->key_shares[1].get(); } - if (!hs->key_share->Finish(out_secret, out_alert, peer_key)) { + if (!key_share->Finish(out_secret, out_alert, peer_key)) { *out_alert = SSL_AD_INTERNAL_ERROR; return false; } hs->new_session->group_id = group_id; - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); return true; } @@ -2257,7 +2286,7 @@ bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { // Supported Versions // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.1 +// https://tools.ietf.org/html/rfc8446#section-4.2.1 static bool ext_supported_versions_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; @@ -2289,7 +2318,7 @@ static bool ext_supported_versions_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) // Cookie // -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.2 +// https://tools.ietf.org/html/rfc8446#section-4.2.2 static bool ext_cookie_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { if (hs->cookie.empty()) { @@ -2311,83 +2340,10 @@ static bool ext_cookie_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { } -// Dummy PQ Padding extension -// -// Dummy post-quantum padding invovles the client (and later server) sending -// useless, random-looking bytes in an extension in their ClientHello or -// ServerHello. These extensions are sized to simulate a post-quantum -// key-exchange and so enable measurement of the latency impact of the -// additional bandwidth. - -static bool ext_dummy_pq_padding_add(CBB *out, size_t len) { - CBB contents; - uint8_t *buffer; - if (!CBB_add_u16(out, TLSEXT_TYPE_dummy_pq_padding) || - !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_space(&contents, &buffer, len)) { - return false; - } - - // The length is used as the nonce so that different length extensions have - // different contents. There's no reason this has to be the case, it just - // makes things a little more obvious in a packet dump. - uint8_t nonce[12] = {0}; - memcpy(nonce, &len, sizeof(len)); - - memset(buffer, 0, len); - static const uint8_t kZeroKey[32] = {0}; - CRYPTO_chacha_20(buffer, buffer, len, kZeroKey, nonce, 0); - - return CBB_flush(out); -} - -static bool ext_dummy_pq_padding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - const size_t len = hs->ssl->dummy_pq_padding_len; - if (len == 0) { - return true; - } - - return ext_dummy_pq_padding_add(out, len); -} - -static bool ext_dummy_pq_padding_parse_serverhello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, - CBS *contents) { - if (contents == nullptr) { - return true; - } - - if (CBS_len(contents) != hs->ssl->dummy_pq_padding_len) { - return false; - } - - hs->ssl->did_dummy_pq_padding = true; - return true; -} - -static bool ext_dummy_pq_padding_parse_clienthello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, - CBS *contents) { - if (contents != nullptr && - 0 < CBS_len(contents) && CBS_len(contents) < (1 << 12)) { - hs->dummy_pq_padding_len = CBS_len(contents); - } - - return true; -} - -static bool ext_dummy_pq_padding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { - if (!hs->dummy_pq_padding_len) { - return true; - } - - return ext_dummy_pq_padding_add(out, hs->dummy_pq_padding_len); -} - -// Negotiated Groups +// Supported Groups // -// https://tools.ietf.org/html/rfc4492#section-5.1.2 -// https://tools.ietf.org/html/draft-ietf-tls-tls13-16#section-4.2.4 +// https://tools.ietf.org/html/rfc4492#section-5.1.1 +// https://tools.ietf.org/html/rfc8446#section-4.2.7 static bool ext_supported_groups_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; @@ -2405,7 +2361,11 @@ static bool ext_supported_groups_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { return false; } - for (uint16_t group : tls1_get_grouplist(ssl)) { + for (uint16_t group : tls1_get_grouplist(hs)) { + if (is_post_quantum_group(group) && + hs->max_version < TLS1_3_VERSION) { + continue; + } if (!CBB_add_u16(&groups_bytes, group)) { return false; } @@ -2476,7 +2436,7 @@ static uint16_t kTokenBindingMinVersion = 13; static bool ext_token_binding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (ssl->token_binding_params == nullptr || SSL_is_dtls(ssl)) { + if (hs->config->token_binding_params.empty() || SSL_is_dtls(ssl)) { return true; } @@ -2485,8 +2445,8 @@ static bool ext_token_binding_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16(&contents, kTokenBindingMaxVersion) || !CBB_add_u8_length_prefixed(&contents, ¶ms) || - !CBB_add_bytes(¶ms, ssl->token_binding_params, - ssl->token_binding_params_len) || + !CBB_add_bytes(¶ms, hs->config->token_binding_params.data(), + hs->config->token_binding_params.size()) || !CBB_flush(out)) { return false; } @@ -2526,10 +2486,10 @@ static bool ext_token_binding_parse_serverhello(SSL_HANDSHAKE *hs, return true; } - for (size_t i = 0; i < ssl->token_binding_params_len; ++i) { - if (param == ssl->token_binding_params[i]) { - ssl->negotiated_token_binding_param = param; - ssl->token_binding_negotiated = true; + for (uint8_t config_param : hs->config->token_binding_params) { + if (param == config_param) { + ssl->s3->negotiated_token_binding_param = param; + ssl->s3->token_binding_negotiated = true; return true; } } @@ -2539,15 +2499,15 @@ static bool ext_token_binding_parse_serverhello(SSL_HANDSHAKE *hs, } // select_tb_param looks for the first token binding param in -// |ssl->token_binding_params| that is also in |params| and puts it in -// |ssl->negotiated_token_binding_param|. It returns true if a token binding +// |hs->ssl->token_binding_params| that is also in |params| and puts it in +// |hs->ssl->negotiated_token_binding_param|. It returns true if a token binding // param is found, and false otherwise. -static bool select_tb_param(SSL *ssl, Span peer_params) { - for (size_t i = 0; i < ssl->token_binding_params_len; ++i) { - uint8_t tb_param = ssl->token_binding_params[i]; +static bool select_tb_param(SSL_HANDSHAKE *hs, + Span peer_params) { + for (uint8_t tb_param : hs->config->token_binding_params) { for (uint8_t peer_param : peer_params) { if (tb_param == peer_param) { - ssl->negotiated_token_binding_param = tb_param; + hs->ssl->s3->negotiated_token_binding_param = tb_param; return true; } } @@ -2559,7 +2519,7 @@ static bool ext_token_binding_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { SSL *const ssl = hs->ssl; - if (contents == nullptr || ssl->token_binding_params == nullptr) { + if (contents == nullptr || hs->config->token_binding_params.empty()) { return true; } @@ -2583,18 +2543,18 @@ static bool ext_token_binding_parse_clienthello(SSL_HANDSHAKE *hs, // version. Otherwise, use the client's version. hs->negotiated_token_binding_version = std::min(version, kTokenBindingMaxVersion); - if (!select_tb_param(ssl, params)) { + if (!select_tb_param(hs, params)) { return true; } - ssl->token_binding_negotiated = true; + ssl->s3->token_binding_negotiated = true; return true; } static bool ext_token_binding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; - if (!ssl->token_binding_negotiated) { + if (!ssl->s3->token_binding_negotiated) { return true; } @@ -2603,7 +2563,7 @@ static bool ext_token_binding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { !CBB_add_u16_length_prefixed(out, &contents) || !CBB_add_u16(&contents, hs->negotiated_token_binding_version) || !CBB_add_u8_length_prefixed(&contents, ¶ms) || - !CBB_add_u8(¶ms, ssl->negotiated_token_binding_param) || + !CBB_add_u8(¶ms, ssl->s3->negotiated_token_binding_param) || !CBB_flush(out)) { return false; } @@ -2615,16 +2575,16 @@ static bool ext_token_binding_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { static bool ext_quic_transport_params_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->quic_transport_params || hs->max_version <= TLS1_2_VERSION) { + if (hs->config->quic_transport_params.empty() || + hs->max_version <= TLS1_2_VERSION) { return true; } CBB contents; if (!CBB_add_u16(out, TLSEXT_TYPE_quic_transport_parameters) || !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_bytes(&contents, ssl->quic_transport_params, - ssl->quic_transport_params_len) || + !CBB_add_bytes(&contents, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || !CBB_flush(out)) { return false; } @@ -2651,7 +2611,7 @@ static bool ext_quic_transport_params_parse_clienthello(SSL_HANDSHAKE *hs, uint8_t *out_alert, CBS *contents) { SSL *const ssl = hs->ssl; - if (!contents || !ssl->quic_transport_params) { + if (!contents || hs->config->quic_transport_params.empty()) { return true; } // Ignore the extension before TLS 1.3. @@ -2664,16 +2624,15 @@ static bool ext_quic_transport_params_parse_clienthello(SSL_HANDSHAKE *hs, static bool ext_quic_transport_params_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { - SSL *const ssl = hs->ssl; - if (!ssl->quic_transport_params) { + if (hs->config->quic_transport_params.empty()) { return true; } CBB contents; if (!CBB_add_u16(out, TLSEXT_TYPE_quic_transport_parameters) || !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_bytes(&contents, ssl->quic_transport_params, - ssl->quic_transport_params_len) || + !CBB_add_bytes(&contents, hs->config->quic_transport_params.data(), + hs->config->quic_transport_params.size()) || !CBB_flush(out)) { return false; } @@ -2681,17 +2640,143 @@ static bool ext_quic_transport_params_add_serverhello(SSL_HANDSHAKE *hs, return true; } +// Delegated credentials. +// +// https://tools.ietf.org/html/draft-ietf-tls-subcerts + +static bool ext_delegated_credential_add_clienthello(SSL_HANDSHAKE *hs, + CBB *out) { + return true; +} + +static bool ext_delegated_credential_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + assert(TLSEXT_TYPE_delegated_credential == 0xff02); + // TODO: Check that the extension is empty. + // + // As of draft-03, the client sends an empty extension in order indicate + // support for delegated credentials. This could change, however, since the + // spec is not yet finalized. This assertion is here to remind us to enforce + // this check once the extension ID is assigned. + + if (contents == nullptr || ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + // Don't use delegated credentials unless we're negotiating TLS 1.3 or + // higher. + return true; + } + + hs->delegated_credential_requested = true; + return true; +} + +// Certificate compression + +static bool cert_compression_add_clienthello(SSL_HANDSHAKE *hs, CBB *out) { + bool first = true; + CBB contents, algs; + + for (const auto &alg : hs->ssl->ctx->cert_compression_algs) { + if (alg.decompress == nullptr) { + continue; + } + + if (first && (!CBB_add_u16(out, TLSEXT_TYPE_cert_compression) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u8_length_prefixed(&contents, &algs))) { + return false; + } + first = false; + if (!CBB_add_u16(&algs, alg.alg_id)) { + return false; + } + } + + return first || CBB_flush(out); +} + +static bool cert_compression_parse_serverhello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == nullptr) { + return true; + } + + // The server may not echo this extension. Any server to client negotiation is + // advertised in the CertificateRequest message. + return false; +} + +static bool cert_compression_parse_clienthello(SSL_HANDSHAKE *hs, + uint8_t *out_alert, + CBS *contents) { + if (contents == nullptr) { + return true; + } + + const SSL_CTX *ctx = hs->ssl->ctx.get(); + const size_t num_algs = ctx->cert_compression_algs.size(); + + CBS alg_ids; + if (!CBS_get_u8_length_prefixed(contents, &alg_ids) || + CBS_len(contents) != 0 || + CBS_len(&alg_ids) == 0 || + CBS_len(&alg_ids) % 2 == 1) { + return false; + } + + const size_t num_given_alg_ids = CBS_len(&alg_ids) / 2; + Array given_alg_ids; + if (!given_alg_ids.Init(num_given_alg_ids)) { + return false; + } + + size_t best_index = num_algs; + size_t given_alg_idx = 0; + + while (CBS_len(&alg_ids) > 0) { + uint16_t alg_id; + if (!CBS_get_u16(&alg_ids, &alg_id)) { + return false; + } + + given_alg_ids[given_alg_idx++] = alg_id; + + for (size_t i = 0; i < num_algs; i++) { + const auto &alg = ctx->cert_compression_algs[i]; + if (alg.alg_id == alg_id && alg.compress != nullptr) { + if (i < best_index) { + best_index = i; + } + break; + } + } + } + + qsort(given_alg_ids.data(), given_alg_ids.size(), sizeof(uint16_t), + compare_uint16_t); + for (size_t i = 1; i < num_given_alg_ids; i++) { + if (given_alg_ids[i - 1] == given_alg_ids[i]) { + return false; + } + } + + if (best_index < num_algs && + ssl_protocol_version(hs->ssl) >= TLS1_3_VERSION) { + hs->cert_compression_negotiated = true; + hs->cert_compression_alg_id = ctx->cert_compression_algs[best_index].alg_id; + } + + return true; +} + +static bool cert_compression_add_serverhello(SSL_HANDSHAKE *hs, CBB *out) { + return true; +} + // kExtensions contains all the supported extensions. static const struct tls_extension kExtensions[] = { - { - TLSEXT_TYPE_renegotiate, - NULL, - ext_ri_add_clienthello, - ext_ri_parse_serverhello, - ext_ri_parse_clienthello, - ext_ri_add_serverhello, - }, { TLSEXT_TYPE_server_name, NULL, @@ -2708,6 +2793,30 @@ static const struct tls_extension kExtensions[] = { ext_ems_parse_clienthello, ext_ems_add_serverhello, }, + { + TLSEXT_TYPE_renegotiate, + NULL, + ext_ri_add_clienthello, + ext_ri_parse_serverhello, + ext_ri_parse_clienthello, + ext_ri_add_serverhello, + }, + { + TLSEXT_TYPE_supported_groups, + NULL, + ext_supported_groups_add_clienthello, + ext_supported_groups_parse_serverhello, + ext_supported_groups_parse_clienthello, + dont_add_serverhello, + }, + { + TLSEXT_TYPE_ec_point_formats, + NULL, + ext_ec_point_add_clienthello, + ext_ec_point_parse_serverhello, + ext_ec_point_parse_clienthello, + ext_ec_point_add_serverhello, + }, { TLSEXT_TYPE_session_ticket, NULL, @@ -2718,12 +2827,13 @@ static const struct tls_extension kExtensions[] = { ext_ticket_add_serverhello, }, { - TLSEXT_TYPE_signature_algorithms, + TLSEXT_TYPE_application_layer_protocol_negotiation, NULL, - ext_sigalgs_add_clienthello, - forbid_parse_serverhello, - ext_sigalgs_parse_clienthello, - dont_add_serverhello, + ext_alpn_add_clienthello, + ext_alpn_parse_serverhello, + // ALPN is negotiated late in |ssl_negotiate_alpn|. + ignore_parse_clienthello, + ext_alpn_add_serverhello, }, { TLSEXT_TYPE_status_request, @@ -2733,6 +2843,14 @@ static const struct tls_extension kExtensions[] = { ext_ocsp_parse_clienthello, ext_ocsp_add_serverhello, }, + { + TLSEXT_TYPE_signature_algorithms, + NULL, + ext_sigalgs_add_clienthello, + forbid_parse_serverhello, + ext_sigalgs_parse_clienthello, + dont_add_serverhello, + }, { TLSEXT_TYPE_next_proto_neg, NULL, @@ -2749,15 +2867,6 @@ static const struct tls_extension kExtensions[] = { ext_sct_parse_clienthello, ext_sct_add_serverhello, }, - { - TLSEXT_TYPE_application_layer_protocol_negotiation, - NULL, - ext_alpn_add_clienthello, - ext_alpn_parse_serverhello, - // ALPN is negotiated late in |ssl_negotiate_alpn|. - ignore_parse_clienthello, - ext_alpn_add_serverhello, - }, { TLSEXT_TYPE_channel_id, ext_channel_id_init, @@ -2774,14 +2883,6 @@ static const struct tls_extension kExtensions[] = { ext_srtp_parse_clienthello, ext_srtp_add_serverhello, }, - { - TLSEXT_TYPE_ec_point_formats, - NULL, - ext_ec_point_add_clienthello, - ext_ec_point_parse_serverhello, - ext_ec_point_parse_clienthello, - ext_ec_point_add_serverhello, - }, { TLSEXT_TYPE_key_share, NULL, @@ -2822,14 +2923,6 @@ static const struct tls_extension kExtensions[] = { ignore_parse_clienthello, dont_add_serverhello, }, - { - TLSEXT_TYPE_dummy_pq_padding, - NULL, - ext_dummy_pq_padding_add_clienthello, - ext_dummy_pq_padding_parse_serverhello, - ext_dummy_pq_padding_parse_clienthello, - ext_dummy_pq_padding_add_serverhello, - }, { TLSEXT_TYPE_quic_transport_parameters, NULL, @@ -2838,17 +2931,6 @@ static const struct tls_extension kExtensions[] = { ext_quic_transport_params_parse_clienthello, ext_quic_transport_params_add_serverhello, }, - // The final extension must be non-empty. WebSphere Application Server 7.0 is - // intolerant to the last extension being zero-length. See - // https://crbug.com/363583. - { - TLSEXT_TYPE_supported_groups, - NULL, - ext_supported_groups_add_clienthello, - ext_supported_groups_parse_serverhello, - ext_supported_groups_parse_clienthello, - dont_add_serverhello, - }, { TLSEXT_TYPE_token_binding, NULL, @@ -2857,6 +2939,22 @@ static const struct tls_extension kExtensions[] = { ext_token_binding_parse_clienthello, ext_token_binding_add_serverhello, }, + { + TLSEXT_TYPE_cert_compression, + NULL, + cert_compression_add_clienthello, + cert_compression_parse_serverhello, + cert_compression_parse_clienthello, + cert_compression_add_serverhello, + }, + { + TLSEXT_TYPE_delegated_credential, + NULL, + ext_delegated_credential_add_clienthello, + forbid_parse_serverhello, + ext_delegated_credential_parse_clienthello, + dont_add_serverhello, + }, }; #define kNumExtensions (sizeof(kExtensions) / sizeof(struct tls_extension)) @@ -2881,22 +2979,19 @@ static const struct tls_extension *tls_extension_find(uint32_t *out_index, return NULL; } -int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { +bool ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, + size_t header_len) { SSL *const ssl = hs->ssl; - // Don't add extensions for SSLv3 unless doing secure renegotiation. - if (hs->client_version == SSL3_VERSION && - !ssl->s3->send_connection_binding) { - return 1; - } - CBB extensions; if (!CBB_add_u16_length_prefixed(out, &extensions)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } + // Note we may send multiple ClientHellos for DTLS HelloVerifyRequest and TLS + // 1.3 HelloRetryRequest. For the latter, the extensions may change, so it is + // important to reset this value. hs->extensions.sent = 0; - hs->custom_extensions.sent = 0; for (size_t i = 0; i < kNumExtensions; i++) { if (kExtensions[i].init != NULL) { @@ -2911,26 +3006,26 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { if (!CBB_add_u16(&extensions, grease_ext1) || !CBB_add_u16(&extensions, 0 /* zero length */)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } } + bool last_was_empty = false; for (size_t i = 0; i < kNumExtensions; i++) { const size_t len_before = CBB_len(&extensions); if (!kExtensions[i].add_clienthello(hs, &extensions)) { OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_ADDING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); - return 0; + return false; } - if (CBB_len(&extensions) != len_before) { + const size_t bytes_written = CBB_len(&extensions) - len_before; + if (bytes_written != 0) { hs->extensions.sent |= (1u << i); } - } - - if (!custom_ext_add_clienthello(hs, &extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + // If the difference in lengths is only four bytes then the extension had + // an empty body. + last_was_empty = (bytes_written == 4); } if (ssl->ctx->grease_enabled) { @@ -2948,19 +3043,37 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { !CBB_add_u16(&extensions, 1 /* one byte length */) || !CBB_add_u8(&extensions, 0 /* single zero byte as contents */)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } + + last_was_empty = false; } if (!SSL_is_dtls(ssl)) { size_t psk_extension_len = ext_pre_shared_key_clienthello_length(hs); header_len += 2 + CBB_len(&extensions) + psk_extension_len; + size_t padding_len = 0; + + // The final extension must be non-empty. WebSphere Application + // Server 7.0 is intolerant to the last extension being zero-length. See + // https://crbug.com/363583. + if (last_was_empty && psk_extension_len == 0) { + padding_len = 1; + // The addition of the padding extension may push us into the F5 bug. + header_len += 4 + padding_len; + } + + // Add padding to workaround bugs in F5 terminators. See RFC 7685. + // + // NB: because this code works out the length of all existing extensions + // it MUST always appear last (save for any PSK extension). if (header_len > 0xff && header_len < 0x200) { - // Add padding to workaround bugs in F5 terminators. See RFC 7685. - // - // NB: because this code works out the length of all existing extensions - // it MUST always appear last. - size_t padding_len = 0x200 - header_len; + // If our calculations already included a padding extension, remove that + // factor because we're about to change its length. + if (padding_len != 0) { + header_len -= 4 + padding_len; + } + padding_len = 0x200 - header_len; // Extensions take at least four bytes to encode. Always include at least // one byte of data if including the extension. WebSphere Application // Server 7.0 is intolerant to the last extension being zero-length. See @@ -2970,13 +3083,15 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { } else { padding_len = 1; } + } + if (padding_len != 0) { uint8_t *padding_bytes; if (!CBB_add_u16(&extensions, TLSEXT_TYPE_padding) || !CBB_add_u16(&extensions, padding_len) || !CBB_add_space(&extensions, &padding_bytes, padding_len)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } OPENSSL_memset(padding_bytes, 0, padding_len); @@ -2986,7 +3101,7 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { // The PSK extension must be last, including after the padding. if (!ext_pre_shared_key_add_clienthello(hs, &extensions)) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } // Discard empty extensions blocks. @@ -2997,7 +3112,7 @@ int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len) { return CBB_flush(out); } -int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { +bool ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { SSL *const ssl = hs->ssl; CBB extensions; if (!CBB_add_u16_length_prefixed(out, &extensions)) { @@ -3017,10 +3132,6 @@ int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { } } - if (!custom_ext_add_serverhello(hs, &extensions)) { - goto err; - } - // Discard empty extensions blocks before TLS 1.3. if (ssl_protocol_version(ssl) < TLS1_3_VERSION && CBB_len(&extensions) == 0) { @@ -3031,13 +3142,12 @@ int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out) { err: OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } -static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, - const SSL_CLIENT_HELLO *client_hello, - int *out_alert) { - SSL *const ssl = hs->ssl; +static bool ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, + const SSL_CLIENT_HELLO *client_hello, + int *out_alert) { for (size_t i = 0; i < kNumExtensions; i++) { if (kExtensions[i].init != NULL) { kExtensions[i].init(hs); @@ -3045,7 +3155,6 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, } hs->extensions.received = 0; - hs->custom_extensions.received = 0; CBS extensions; CBS_init(&extensions, client_hello->extensions, client_hello->extensions_len); while (CBS_len(&extensions) != 0) { @@ -3056,24 +3165,13 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { *out_alert = SSL_AD_DECODE_ERROR; - return 0; - } - - // RFC 5746 made the existence of extensions in SSL 3.0 somewhat - // ambiguous. Ignore all but the renegotiation_info extension. - if (ssl->version == SSL3_VERSION && type != TLSEXT_TYPE_renegotiate) { - continue; + return false; } unsigned ext_index; const struct tls_extension *const ext = tls_extension_find(&ext_index, type); - if (ext == NULL) { - if (!custom_ext_parse_clienthello(hs, out_alert, type, &extension)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); - return 0; - } continue; } @@ -3083,7 +3181,7 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, *out_alert = alert; OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)type); - return 0; + return false; } } @@ -3112,36 +3210,36 @@ static int ssl_scan_clienthello_tlsext(SSL_HANDSHAKE *hs, OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); *out_alert = alert; - return 0; + return false; } } - return 1; + return true; } -int ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, - const SSL_CLIENT_HELLO *client_hello) { +bool ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, + const SSL_CLIENT_HELLO *client_hello) { SSL *const ssl = hs->ssl; int alert = SSL_AD_DECODE_ERROR; - if (ssl_scan_clienthello_tlsext(hs, client_hello, &alert) <= 0) { + if (!ssl_scan_clienthello_tlsext(hs, client_hello, &alert)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; + return false; } - if (ssl_check_clienthello_tlsext(hs) <= 0) { + if (!ssl_check_clienthello_tlsext(hs)) { OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_TLSEXT); - return 0; + return false; } - return 1; + return true; } -static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, - int *out_alert) { +static bool ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, + int *out_alert) { SSL *const ssl = hs->ssl; // Before TLS 1.3, ServerHello extensions blocks may be omitted if empty. if (CBS_len(cbs) == 0 && ssl_protocol_version(ssl) < TLS1_3_VERSION) { - return 1; + return true; } // Decode the extensions block and check it is valid. @@ -3149,7 +3247,7 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, if (!CBS_get_u16_length_prefixed(cbs, &extensions) || !tls1_check_duplicate_extensions(&extensions)) { *out_alert = SSL_AD_DECODE_ERROR; - return 0; + return false; } uint32_t received = 0; @@ -3161,7 +3259,7 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, if (!CBS_get_u16(&extensions, &type) || !CBS_get_u16_length_prefixed(&extensions, &extension)) { *out_alert = SSL_AD_DECODE_ERROR; - return 0; + return false; } unsigned ext_index; @@ -3169,24 +3267,21 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, tls_extension_find(&ext_index, type); if (ext == NULL) { - hs->received_custom_extension = true; - if (!custom_ext_parse_serverhello(hs, out_alert, type, &extension)) { - return 0; - } - continue; + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ERR_add_error_dataf("extension %u", (unsigned)type); + *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; + return false; } static_assert(kNumExtensions <= sizeof(hs->extensions.sent) * 8, "too many bits"); - if (!(hs->extensions.sent & (1u << ext_index)) && - type != TLSEXT_TYPE_renegotiate) { - // If the extension was never sent then it is illegal, except for the - // renegotiation extension which, in SSL 3.0, is signaled via SCSV. + if (!(hs->extensions.sent & (1u << ext_index))) { + // If the extension was never sent then it is illegal. OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); ERR_add_error_dataf("extension :%u", (unsigned)type); *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; - return 0; + return false; } received |= (1u << ext_index); @@ -3196,7 +3291,7 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)type); *out_alert = alert; - return 0; + return false; } } @@ -3209,125 +3304,129 @@ static int ssl_scan_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs, OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_EXTENSION); ERR_add_error_dataf("extension %u", (unsigned)kExtensions[i].value); *out_alert = alert; - return 0; + return false; } } } - return 1; + return true; } -static int ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs) { +static bool ssl_check_clienthello_tlsext(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; - if (ssl->token_binding_negotiated && + if (ssl->s3->token_binding_negotiated && !(SSL_get_secure_renegotiation_support(ssl) && SSL_get_extms_support(ssl))) { OPENSSL_PUT_ERROR(SSL, SSL_R_NEGOTIATED_TB_WITHOUT_EMS_OR_RI); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); - return -1; + return false; } int ret = SSL_TLSEXT_ERR_NOACK; int al = SSL_AD_UNRECOGNIZED_NAME; - if (ssl->ctx->tlsext_servername_callback != 0) { - ret = ssl->ctx->tlsext_servername_callback(ssl, &al, - ssl->ctx->tlsext_servername_arg); - } else if (ssl->session_ctx->tlsext_servername_callback != 0) { - ret = ssl->session_ctx->tlsext_servername_callback( - ssl, &al, ssl->session_ctx->tlsext_servername_arg); + if (ssl->ctx->servername_callback != 0) { + ret = ssl->ctx->servername_callback(ssl, &al, ssl->ctx->servername_arg); + } else if (ssl->session_ctx->servername_callback != 0) { + ret = ssl->session_ctx->servername_callback( + ssl, &al, ssl->session_ctx->servername_arg); } switch (ret) { case SSL_TLSEXT_ERR_ALERT_FATAL: ssl_send_alert(ssl, SSL3_AL_FATAL, al); - return -1; + return false; case SSL_TLSEXT_ERR_NOACK: hs->should_ack_sni = false; - return 1; + return true; default: - return 1; + return true; } } -int ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs) { +bool ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs) { SSL *const ssl = hs->ssl; int alert = SSL_AD_DECODE_ERROR; - if (ssl_scan_serverhello_tlsext(hs, cbs, &alert) <= 0) { + if (!ssl_scan_serverhello_tlsext(hs, cbs, &alert)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; + return false; } - return 1; + return true; } static enum ssl_ticket_aead_result_t decrypt_ticket_with_cipher_ctx( - uint8_t **out, size_t *out_len, EVP_CIPHER_CTX *cipher_ctx, - HMAC_CTX *hmac_ctx, const uint8_t *ticket, size_t ticket_len) { + Array *out, EVP_CIPHER_CTX *cipher_ctx, HMAC_CTX *hmac_ctx, + Span ticket) { size_t iv_len = EVP_CIPHER_CTX_iv_length(cipher_ctx); // Check the MAC at the end of the ticket. uint8_t mac[EVP_MAX_MD_SIZE]; size_t mac_len = HMAC_size(hmac_ctx); - if (ticket_len < SSL_TICKET_KEY_NAME_LEN + iv_len + 1 + mac_len) { + if (ticket.size() < SSL_TICKET_KEY_NAME_LEN + iv_len + 1 + mac_len) { // The ticket must be large enough for key name, IV, data, and MAC. return ssl_ticket_aead_ignore_ticket; } - HMAC_Update(hmac_ctx, ticket, ticket_len - mac_len); + // Split the ticket into the ticket and the MAC. + auto ticket_mac = ticket.subspan(ticket.size() - mac_len); + ticket = ticket.subspan(0, ticket.size() - mac_len); + HMAC_Update(hmac_ctx, ticket.data(), ticket.size()); HMAC_Final(hmac_ctx, mac, NULL); - int mac_ok = - CRYPTO_memcmp(mac, ticket + (ticket_len - mac_len), mac_len) == 0; + assert(mac_len == ticket_mac.size()); + bool mac_ok = CRYPTO_memcmp(mac, ticket_mac.data(), mac_len) == 0; #if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - mac_ok = 1; + mac_ok = true; #endif if (!mac_ok) { return ssl_ticket_aead_ignore_ticket; } // Decrypt the session data. - const uint8_t *ciphertext = ticket + SSL_TICKET_KEY_NAME_LEN + iv_len; - size_t ciphertext_len = ticket_len - SSL_TICKET_KEY_NAME_LEN - iv_len - - mac_len; - UniquePtr plaintext((uint8_t *)OPENSSL_malloc(ciphertext_len)); - if (!plaintext) { + auto ciphertext = ticket.subspan(SSL_TICKET_KEY_NAME_LEN + iv_len); + Array plaintext; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + if (!plaintext.CopyFrom(ciphertext)) { return ssl_ticket_aead_error; } - size_t plaintext_len; -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - OPENSSL_memcpy(plaintext.get(), ciphertext, ciphertext_len); - plaintext_len = ciphertext_len; #else - if (ciphertext_len >= INT_MAX) { + if (ciphertext.size() >= INT_MAX) { return ssl_ticket_aead_ignore_ticket; } + if (!plaintext.Init(ciphertext.size())) { + return ssl_ticket_aead_error; + } int len1, len2; - if (!EVP_DecryptUpdate(cipher_ctx, plaintext.get(), &len1, ciphertext, - (int)ciphertext_len) || - !EVP_DecryptFinal_ex(cipher_ctx, plaintext.get() + len1, &len2)) { + if (!EVP_DecryptUpdate(cipher_ctx, plaintext.data(), &len1, ciphertext.data(), + (int)ciphertext.size()) || + !EVP_DecryptFinal_ex(cipher_ctx, plaintext.data() + len1, &len2)) { ERR_clear_error(); return ssl_ticket_aead_ignore_ticket; } - plaintext_len = (size_t)(len1) + len2; + plaintext.Shrink(static_cast(len1) + len2); #endif - *out = plaintext.release(); - *out_len = plaintext_len; + *out = std::move(plaintext); return ssl_ticket_aead_success; } static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_cb( - SSL *ssl, uint8_t **out, size_t *out_len, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len) { - assert(ticket_len >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); + SSL_HANDSHAKE *hs, Array *out, bool *out_renew_ticket, + Span ticket) { + assert(ticket.size() >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); ScopedEVP_CIPHER_CTX cipher_ctx; ScopedHMAC_CTX hmac_ctx; - const uint8_t *iv = ticket + SSL_TICKET_KEY_NAME_LEN; - int cb_ret = ssl->session_ctx->tlsext_ticket_key_cb( - ssl, (uint8_t *)ticket /* name */, (uint8_t *)iv, cipher_ctx.get(), - hmac_ctx.get(), 0 /* decrypt */); + auto name = ticket.subspan(0, SSL_TICKET_KEY_NAME_LEN); + // The actual IV is shorter, but the length is determined by the callback's + // chosen cipher. Instead we pass in |EVP_MAX_IV_LENGTH| worth of IV to ensure + // the callback has enough. + auto iv = ticket.subspan(SSL_TICKET_KEY_NAME_LEN, EVP_MAX_IV_LENGTH); + int cb_ret = hs->ssl->session_ctx->ticket_key_cb( + hs->ssl, const_cast(name.data()), + const_cast(iv.data()), cipher_ctx.get(), hmac_ctx.get(), + 0 /* decrypt */); if (cb_ret < 0) { return ssl_ticket_aead_error; } else if (cb_ret == 0) { @@ -3337,106 +3436,102 @@ static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_cb( } else { assert(cb_ret == 1); } - return decrypt_ticket_with_cipher_ctx(out, out_len, cipher_ctx.get(), - hmac_ctx.get(), ticket, ticket_len); + return decrypt_ticket_with_cipher_ctx(out, cipher_ctx.get(), hmac_ctx.get(), + ticket); } static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_ticket_keys( - SSL *ssl, uint8_t **out, size_t *out_len, const uint8_t *ticket, - size_t ticket_len) { - assert(ticket_len >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); - SSL_CTX *ctx = ssl->session_ctx; + SSL_HANDSHAKE *hs, Array *out, Span ticket) { + assert(ticket.size() >= SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH); + SSL_CTX *ctx = hs->ssl->session_ctx.get(); // Rotate the ticket key if necessary. if (!ssl_ctx_rotate_ticket_encryption_key(ctx)) { return ssl_ticket_aead_error; } + const EVP_CIPHER *cipher = EVP_aes_128_cbc(); + auto name = ticket.subspan(0, SSL_TICKET_KEY_NAME_LEN); + auto iv = + ticket.subspan(SSL_TICKET_KEY_NAME_LEN, EVP_CIPHER_iv_length(cipher)); + // Pick the matching ticket key and decrypt. ScopedEVP_CIPHER_CTX cipher_ctx; ScopedHMAC_CTX hmac_ctx; { MutexReadLock lock(&ctx->lock); - const tlsext_ticket_key *key; - if (ctx->tlsext_ticket_key_current && - !OPENSSL_memcmp(ctx->tlsext_ticket_key_current->name, ticket, - SSL_TICKET_KEY_NAME_LEN)) { - key = ctx->tlsext_ticket_key_current; - } else if (ctx->tlsext_ticket_key_prev && - !OPENSSL_memcmp(ctx->tlsext_ticket_key_prev->name, ticket, - SSL_TICKET_KEY_NAME_LEN)) { - key = ctx->tlsext_ticket_key_prev; + const TicketKey *key; + if (ctx->ticket_key_current && name == ctx->ticket_key_current->name) { + key = ctx->ticket_key_current.get(); + } else if (ctx->ticket_key_prev && name == ctx->ticket_key_prev->name) { + key = ctx->ticket_key_prev.get(); } else { return ssl_ticket_aead_ignore_ticket; } - const uint8_t *iv = ticket + SSL_TICKET_KEY_NAME_LEN; if (!HMAC_Init_ex(hmac_ctx.get(), key->hmac_key, sizeof(key->hmac_key), tlsext_tick_md(), NULL) || - !EVP_DecryptInit_ex(cipher_ctx.get(), EVP_aes_128_cbc(), NULL, - key->aes_key, iv)) { + !EVP_DecryptInit_ex(cipher_ctx.get(), cipher, NULL, + key->aes_key, iv.data())) { return ssl_ticket_aead_error; } } - return decrypt_ticket_with_cipher_ctx(out, out_len, cipher_ctx.get(), - hmac_ctx.get(), ticket, ticket_len); + return decrypt_ticket_with_cipher_ctx(out, cipher_ctx.get(), hmac_ctx.get(), + ticket); } static enum ssl_ticket_aead_result_t ssl_decrypt_ticket_with_method( - SSL *ssl, uint8_t **out, size_t *out_len, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len) { - uint8_t *plaintext = (uint8_t *)OPENSSL_malloc(ticket_len); - if (plaintext == NULL) { + SSL_HANDSHAKE *hs, Array *out, bool *out_renew_ticket, + Span ticket) { + Array plaintext; + if (!plaintext.Init(ticket.size())) { OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); return ssl_ticket_aead_error; } size_t plaintext_len; const enum ssl_ticket_aead_result_t result = - ssl->session_ctx->ticket_aead_method->open( - ssl, plaintext, &plaintext_len, ticket_len, ticket, ticket_len); - - if (result == ssl_ticket_aead_success) { - *out = plaintext; - plaintext = NULL; - *out_len = plaintext_len; + hs->ssl->session_ctx->ticket_aead_method->open( + hs->ssl, plaintext.data(), &plaintext_len, ticket.size(), + ticket.data(), ticket.size()); + if (result != ssl_ticket_aead_success) { + return result; } - OPENSSL_free(plaintext); - return result; + plaintext.Shrink(plaintext_len); + *out = std::move(plaintext); + return ssl_ticket_aead_success; } enum ssl_ticket_aead_result_t ssl_process_ticket( - SSL *ssl, UniquePtr *out_session, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len, const uint8_t *session_id, - size_t session_id_len) { + SSL_HANDSHAKE *hs, UniquePtr *out_session, + bool *out_renew_ticket, Span ticket, + Span session_id) { *out_renew_ticket = false; out_session->reset(); - if ((SSL_get_options(ssl) & SSL_OP_NO_TICKET) || - session_id_len > SSL_MAX_SSL_SESSION_ID_LENGTH) { + if ((SSL_get_options(hs->ssl) & SSL_OP_NO_TICKET) || + session_id.size() > SSL_MAX_SSL_SESSION_ID_LENGTH) { return ssl_ticket_aead_ignore_ticket; } - uint8_t *plaintext = NULL; - size_t plaintext_len; + Array plaintext; enum ssl_ticket_aead_result_t result; - if (ssl->session_ctx->ticket_aead_method != NULL) { - result = ssl_decrypt_ticket_with_method( - ssl, &plaintext, &plaintext_len, out_renew_ticket, ticket, ticket_len); + if (hs->ssl->session_ctx->ticket_aead_method != NULL) { + result = ssl_decrypt_ticket_with_method(hs, &plaintext, out_renew_ticket, + ticket); } else { - // Ensure there is room for the key name and the largest IV - // |tlsext_ticket_key_cb| may try to consume. The real limit may be lower, - // but the maximum IV length should be well under the minimum size for the - // session material and HMAC. - if (ticket_len < SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH) { + // Ensure there is room for the key name and the largest IV |ticket_key_cb| + // may try to consume. The real limit may be lower, but the maximum IV + // length should be well under the minimum size for the session material and + // HMAC. + if (ticket.size() < SSL_TICKET_KEY_NAME_LEN + EVP_MAX_IV_LENGTH) { return ssl_ticket_aead_ignore_ticket; } - if (ssl->session_ctx->tlsext_ticket_key_cb != NULL) { - result = ssl_decrypt_ticket_with_cb(ssl, &plaintext, &plaintext_len, - out_renew_ticket, ticket, ticket_len); + if (hs->ssl->session_ctx->ticket_key_cb != NULL) { + result = + ssl_decrypt_ticket_with_cb(hs, &plaintext, out_renew_ticket, ticket); } else { - result = ssl_decrypt_ticket_with_ticket_keys( - ssl, &plaintext, &plaintext_len, ticket, ticket_len); + result = ssl_decrypt_ticket_with_ticket_keys(hs, &plaintext, ticket); } } @@ -3445,10 +3540,8 @@ enum ssl_ticket_aead_result_t ssl_process_ticket( } // Decode the session. - UniquePtr session( - SSL_SESSION_from_bytes(plaintext, plaintext_len, ssl->ctx)); - OPENSSL_free(plaintext); - + UniquePtr session(SSL_SESSION_from_bytes( + plaintext.data(), plaintext.size(), hs->ssl->ctx.get())); if (!session) { ERR_clear_error(); // Don't leave an error on the queue. return ssl_ticket_aead_ignore_ticket; @@ -3456,8 +3549,8 @@ enum ssl_ticket_aead_result_t ssl_process_ticket( // Copy the client's session ID into the new session, to denote the ticket has // been accepted. - OPENSSL_memcpy(session->session_id, session_id, session_id_len); - session->session_id_length = session_id_len; + OPENSSL_memcpy(session->session_id, session_id.data(), session_id.size()); + session->session_id_length = session_id.size(); *out_session = std::move(session); return ssl_ticket_aead_success; @@ -3469,7 +3562,10 @@ bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *in_sigalgs) { return true; } - return parse_u16_array(in_sigalgs, &hs->peer_sigalgs); + // In all contexts, the signature algorithms list may not be empty. (It may be + // omitted by clients in TLS 1.2, but then the entire extension is omitted.) + return CBS_len(in_sigalgs) != 0 && + parse_u16_array(in_sigalgs, &hs->peer_sigalgs); } bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey) { @@ -3487,7 +3583,8 @@ bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey) { bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { SSL *const ssl = hs->ssl; - CERT *cert = ssl->cert; + CERT *cert = hs->config->cert.get(); + DC *dc = cert->dc.get(); // Before TLS 1.2, the signature algorithm isn't negotiated as part of the // handshake. @@ -3500,19 +3597,13 @@ bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { } Span sigalgs = kSignSignatureAlgorithms; - if (cert->sigalgs != nullptr) { - sigalgs = MakeConstSpan(cert->sigalgs, cert->num_sigalgs); + if (ssl_signing_with_dc(hs)) { + sigalgs = MakeConstSpan(&dc->expected_cert_verify_algorithm, 1); + } else if (!cert->sigalgs.empty()) { + sigalgs = cert->sigalgs; } - Span peer_sigalgs = hs->peer_sigalgs; - if (peer_sigalgs.empty() && ssl_protocol_version(ssl) < TLS1_3_VERSION) { - // If the client didn't specify any signature_algorithms extension then - // we can assume that it supports SHA1. See - // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 - static const uint16_t kDefaultPeerAlgorithms[] = {SSL_SIGN_RSA_PKCS1_SHA1, - SSL_SIGN_ECDSA_SHA1}; - peer_sigalgs = kDefaultPeerAlgorithms; - } + Span peer_sigalgs = tls1_get_peer_verify_algorithms(hs); for (uint16_t sigalg : sigalgs) { // SSL_SIGN_RSA_PKCS1_MD5_SHA1 is an internal value and should never be @@ -3534,7 +3625,20 @@ bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out) { return false; } -int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { +Span tls1_get_peer_verify_algorithms(const SSL_HANDSHAKE *hs) { + Span peer_sigalgs = hs->peer_sigalgs; + if (peer_sigalgs.empty() && ssl_protocol_version(hs->ssl) < TLS1_3_VERSION) { + // If the client didn't specify any signature_algorithms extension then + // we can assume that it supports SHA1. See + // http://tools.ietf.org/html/rfc5246#section-7.4.1.4.1 + static const uint16_t kDefaultPeerAlgorithms[] = {SSL_SIGN_RSA_PKCS1_SHA1, + SSL_SIGN_ECDSA_SHA1}; + peer_sigalgs = kDefaultPeerAlgorithms; + } + return peer_sigalgs; +} + +bool tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { SSL *const ssl = hs->ssl; // A Channel ID handshake message is structured to contain multiple // extensions, but the only one that can be present is Channel ID. @@ -3547,19 +3651,19 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { CBS_len(&extension) != TLSEXT_CHANNEL_ID_SIZE) { OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; + return false; } UniquePtr p256(EC_GROUP_new_by_curve_name(NID_X9_62_prime256v1)); if (!p256) { OPENSSL_PUT_ERROR(SSL, SSL_R_NO_P256_SUPPORT); - return 0; + return false; } UniquePtr sig(ECDSA_SIG_new()); UniquePtr x(BN_new()), y(BN_new()); if (!sig || !x || !y) { - return 0; + return false; } const uint8_t *p = CBS_data(&extension); @@ -3567,7 +3671,7 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { BN_bin2bn(p + 32, 32, y.get()) == NULL || BN_bin2bn(p + 64, 32, sig->r) == NULL || BN_bin2bn(p + 96, 32, sig->s) == NULL) { - return 0; + return false; } UniquePtr key(EC_KEY_new()); @@ -3577,40 +3681,39 @@ int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg) { y.get(), nullptr) || !EC_KEY_set_group(key.get(), p256.get()) || !EC_KEY_set_public_key(key.get(), point.get())) { - return 0; + return false; } uint8_t digest[EVP_MAX_MD_SIZE]; size_t digest_len; if (!tls1_channel_id_hash(hs, digest, &digest_len)) { - return 0; + return false; } - int sig_ok = ECDSA_do_verify(digest, digest_len, sig.get(), key.get()); + bool sig_ok = ECDSA_do_verify(digest, digest_len, sig.get(), key.get()); #if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = 1; + sig_ok = true; ERR_clear_error(); #endif if (!sig_ok) { OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_SIGNATURE_INVALID); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); - ssl->s3->tlsext_channel_id_valid = false; - return 0; + ssl->s3->channel_id_valid = false; + return false; } - OPENSSL_memcpy(ssl->s3->tlsext_channel_id, p, 64); - return 1; + OPENSSL_memcpy(ssl->s3->channel_id, p, 64); + return true; } bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb) { - SSL *const ssl = hs->ssl; uint8_t digest[EVP_MAX_MD_SIZE]; size_t digest_len; if (!tls1_channel_id_hash(hs, digest, &digest_len)) { return false; } - EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(ssl->tlsext_channel_id_private); + EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(hs->config->channel_id_private.get()); if (ec_key == nullptr) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); return false; @@ -3643,17 +3746,17 @@ bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb) { return true; } -int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { +bool tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { SSL *const ssl = hs->ssl; if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { Array msg; if (!tls13_get_cert_verify_signature_input(hs, &msg, ssl_cert_verify_channel_id)) { - return 0; + return false; } SHA256(msg.data(), msg.size(), out); *out_len = SHA256_DIGEST_LENGTH; - return 1; + return true; } SHA256_CTX ctx; @@ -3667,7 +3770,7 @@ int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { SHA256_Update(&ctx, kResumptionMagic, sizeof(kResumptionMagic)); if (ssl->session->original_handshake_hash_len == 0) { OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; + return false; } SHA256_Update(&ctx, ssl->session->original_handshake_hash, ssl->session->original_handshake_hash_len); @@ -3676,24 +3779,21 @@ int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len) { uint8_t hs_hash[EVP_MAX_MD_SIZE]; size_t hs_hash_len; if (!hs->transcript.GetHash(hs_hash, &hs_hash_len)) { - return 0; + return false; } SHA256_Update(&ctx, hs_hash, (size_t)hs_hash_len); SHA256_Final(out, &ctx); *out_len = SHA256_DIGEST_LENGTH; - return 1; + return true; } -// tls1_record_handshake_hashes_for_channel_id records the current handshake -// hashes in |hs->new_session| so that Channel ID resumptions can sign that -// data. -int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs) { +bool tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // This function should never be called for a resumed session because the // handshake hashes that we wish to record are for the original, full // handshake. if (ssl->session != NULL) { - return 0; + return false; } static_assert( @@ -3703,35 +3803,34 @@ int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs) { size_t digest_len; if (!hs->transcript.GetHash(hs->new_session->original_handshake_hash, &digest_len)) { - return 0; + return false; } static_assert(EVP_MAX_MD_SIZE <= 0xff, "EVP_MAX_MD_SIZE does not fit in uint8_t"); hs->new_session->original_handshake_hash_len = (uint8_t)digest_len; - return 1; + return true; } -int ssl_do_channel_id_callback(SSL *ssl) { - if (ssl->tlsext_channel_id_private != NULL || - ssl->ctx->channel_id_cb == NULL) { - return 1; +bool ssl_do_channel_id_callback(SSL_HANDSHAKE *hs) { + if (hs->config->channel_id_private != NULL || + hs->ssl->ctx->channel_id_cb == NULL) { + return true; } EVP_PKEY *key = NULL; - ssl->ctx->channel_id_cb(ssl, &key); + hs->ssl->ctx->channel_id_cb(hs->ssl, &key); if (key == NULL) { // The caller should try again later. - return 1; + return true; } - int ret = SSL_set1_tls_channel_id(ssl, key); - EVP_PKEY_free(key); - return ret; + UniquePtr free_key(key); + return SSL_set1_tls_channel_id(hs->ssl, key); } -int ssl_is_sct_list_valid(const CBS *contents) { +bool ssl_is_sct_list_valid(const CBS *contents) { // Shallow parse the SCT list for sanity. By the RFC // (https://tools.ietf.org/html/rfc6962#section-3.3) neither the list nor any // of the SCTs may be empty. @@ -3740,21 +3839,21 @@ int ssl_is_sct_list_valid(const CBS *contents) { if (!CBS_get_u16_length_prefixed(©, &sct_list) || CBS_len(©) != 0 || CBS_len(&sct_list) == 0) { - return 0; + return false; } while (CBS_len(&sct_list) > 0) { CBS sct; if (!CBS_get_u16_length_prefixed(&sct_list, &sct) || CBS_len(&sct) == 0) { - return 0; + return false; } } - return 1; + return true; } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; @@ -3775,9 +3874,3 @@ int SSL_early_callback_ctx_extension_get(const SSL_CLIENT_HELLO *client_hello, void SSL_CTX_set_ed25519_enabled(SSL_CTX *ctx, int enabled) { ctx->ed25519_enabled = !!enabled; } - -int SSL_extension_supported(unsigned extension_value) { - uint32_t index; - return extension_value == TLSEXT_TYPE_padding || - tls_extension_find(&index, extension_value) != NULL; -} diff --git a/Pods/BoringSSL-GRPC/ssl/test/runner/curve25519/const_amd64.h b/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h similarity index 100% rename from Pods/BoringSSL-GRPC/ssl/test/runner/curve25519/const_amd64.h rename to Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h diff --git a/Pods/BoringSSL-GRPC/ssl/test/runner/curve25519/const_amd64.h.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/ssl/test/runner/curve25519/const_amd64.h.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/test/runner/curve25519/const_amd64.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc b/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc new file mode 100644 index 000000000..237664dd1 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc @@ -0,0 +1,689 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// kMaxKeyUpdates is the number of consecutive KeyUpdates that will be +// processed. Without this limit an attacker could force unbounded processing +// without being able to return application data. +static const uint8_t kMaxKeyUpdates = 32; + +const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE] = { + 0xcf, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11, 0xbe, 0x1d, 0x8c, + 0x02, 0x1e, 0x65, 0xb8, 0x91, 0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, + 0x8c, 0x5e, 0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c, +}; + +// See RFC 8446, section 4.1.3. +const uint8_t kTLS12DowngradeRandom[8] = {0x44, 0x4f, 0x57, 0x4e, + 0x47, 0x52, 0x44, 0x00}; +const uint8_t kTLS13DowngradeRandom[8] = {0x44, 0x4f, 0x57, 0x4e, + 0x47, 0x52, 0x44, 0x01}; + +// This is a non-standard randomly-generated value. +const uint8_t kJDK11DowngradeRandom[8] = {0xed, 0xbf, 0xb4, 0xa8, + 0xc2, 0x47, 0x10, 0xff}; + +bool tls13_get_cert_verify_signature_input( + SSL_HANDSHAKE *hs, Array *out, + enum ssl_cert_verify_context_t cert_verify_context) { + ScopedCBB cbb; + if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + for (size_t i = 0; i < 64; i++) { + if (!CBB_add_u8(cbb.get(), 0x20)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + } + + Span context; + if (cert_verify_context == ssl_cert_verify_server) { + static const char kContext[] = "TLS 1.3, server CertificateVerify"; + context = kContext; + } else if (cert_verify_context == ssl_cert_verify_client) { + static const char kContext[] = "TLS 1.3, client CertificateVerify"; + context = kContext; + } else if (cert_verify_context == ssl_cert_verify_channel_id) { + static const char kContext[] = "TLS 1.3, Channel ID"; + context = kContext; + } else { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + // Note |context| includes the NUL byte separator. + if (!CBB_add_bytes(cbb.get(), + reinterpret_cast(context.data()), + context.size())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + uint8_t context_hash[EVP_MAX_MD_SIZE]; + size_t context_hash_len; + if (!hs->transcript.GetHash(context_hash, &context_hash_len) || + !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || + !CBBFinishArray(cbb.get(), out)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + return true; +} + +bool tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool allow_anonymous) { + SSL *const ssl = hs->ssl; + CBS body = msg.body; + bssl::UniquePtr decompressed; + + if (msg.type == SSL3_MT_COMPRESSED_CERTIFICATE) { + CBS compressed; + uint16_t alg_id; + uint32_t uncompressed_len; + + if (!CBS_get_u16(&body, &alg_id) || + !CBS_get_u24(&body, &uncompressed_len) || + !CBS_get_u24_length_prefixed(&body, &compressed) || + CBS_len(&body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + if (uncompressed_len > ssl->max_cert_list) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNCOMPRESSED_CERT_TOO_LARGE); + ERR_add_error_dataf("requested=%u", + static_cast(uncompressed_len)); + return false; + } + + ssl_cert_decompression_func_t decompress = nullptr; + for (const auto &alg : ssl->ctx->cert_compression_algs) { + if (alg.alg_id == alg_id) { + decompress = alg.decompress; + break; + } + } + + if (decompress == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERT_COMPRESSION_ALG); + ERR_add_error_dataf("alg=%d", static_cast(alg_id)); + return false; + } + + CRYPTO_BUFFER *decompressed_ptr = nullptr; + if (!decompress(ssl, &decompressed_ptr, uncompressed_len, + CBS_data(&compressed), CBS_len(&compressed))) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_DECOMPRESSION_FAILED); + ERR_add_error_dataf("alg=%d", static_cast(alg_id)); + return false; + } + decompressed.reset(decompressed_ptr); + + if (CRYPTO_BUFFER_len(decompressed_ptr) != uncompressed_len) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_DECOMPRESSION_FAILED); + ERR_add_error_dataf( + "alg=%d got=%u expected=%u", static_cast(alg_id), + static_cast(CRYPTO_BUFFER_len(decompressed_ptr)), + static_cast(uncompressed_len)); + return false; + } + + CBS_init(&body, CRYPTO_BUFFER_data(decompressed_ptr), + CRYPTO_BUFFER_len(decompressed_ptr)); + } else { + assert(msg.type == SSL3_MT_CERTIFICATE); + } + + CBS context, certificate_list; + if (!CBS_get_u8_length_prefixed(&body, &context) || + CBS_len(&context) != 0 || + !CBS_get_u24_length_prefixed(&body, &certificate_list) || + CBS_len(&body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + UniquePtr certs(sk_CRYPTO_BUFFER_new_null()); + if (!certs) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + const bool retain_sha256 = + ssl->server && hs->config->retain_only_sha256_of_client_certs; + UniquePtr pkey; + while (CBS_len(&certificate_list) > 0) { + CBS certificate, extensions; + if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || + !CBS_get_u16_length_prefixed(&certificate_list, &extensions) || + CBS_len(&certificate) == 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); + return false; + } + + if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { + pkey = ssl_cert_parse_pubkey(&certificate); + if (!pkey) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + // TLS 1.3 always uses certificate keys for signing thus the correct + // keyUsage is enforced. + if (!ssl_cert_check_key_usage(&certificate, + key_usage_digital_signature)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return false; + } + + if (retain_sha256) { + // Retain the hash of the leaf certificate if requested. + SHA256(CBS_data(&certificate), CBS_len(&certificate), + hs->new_session->peer_sha256); + } + } + + UniquePtr buf( + CRYPTO_BUFFER_new_from_CBS(&certificate, ssl->ctx->pool)); + if (!buf || + !PushToStack(certs.get(), std::move(buf))) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + // Parse out the extensions. + bool have_status_request = false, have_sct = false; + CBS status_request, sct; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_status_request, &have_status_request, &status_request}, + {TLSEXT_TYPE_certificate_timestamp, &have_sct, &sct}, + }; + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 0 /* reject unknown */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + // All Certificate extensions are parsed, but only the leaf extensions are + // stored. + if (have_status_request) { + if (ssl->server || !hs->config->ocsp_stapling_enabled) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); + return false; + } + + uint8_t status_type; + CBS ocsp_response; + if (!CBS_get_u8(&status_request, &status_type) || + status_type != TLSEXT_STATUSTYPE_ocsp || + !CBS_get_u24_length_prefixed(&status_request, &ocsp_response) || + CBS_len(&ocsp_response) == 0 || + CBS_len(&status_request) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { + hs->new_session->ocsp_response.reset( + CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool)); + if (hs->new_session->ocsp_response == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return false; + } + } + } + + if (have_sct) { + if (ssl->server || !hs->config->signed_cert_timestamps_enabled) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); + return false; + } + + if (!ssl_is_sct_list_valid(&sct)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { + hs->new_session->signed_cert_timestamp_list.reset( + CRYPTO_BUFFER_new_from_CBS(&sct, ssl->ctx->pool)); + if (hs->new_session->signed_cert_timestamp_list == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return false; + } + } + } + } + + // Store a null certificate list rather than an empty one if the peer didn't + // send certificates. + if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { + certs.reset(); + } + + hs->peer_pubkey = std::move(pkey); + hs->new_session->certs = std::move(certs); + + if (!ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { + if (!allow_anonymous) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_CERTIFICATE_REQUIRED); + return false; + } + + // OpenSSL returns X509_V_OK when no certificates are requested. This is + // classed by them as a bug, but it's assumed by at least NGINX. + hs->new_session->verify_result = X509_V_OK; + + // No certificate, so nothing more to do. + return true; + } + + hs->new_session->peer_sha256_valid = retain_sha256; + return true; +} + +bool tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg) { + SSL *const ssl = hs->ssl; + if (hs->peer_pubkey == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + CBS body = msg.body, signature; + uint16_t signature_algorithm; + if (!CBS_get_u16(&body, &signature_algorithm) || + !CBS_get_u16_length_prefixed(&body, &signature) || + CBS_len(&body) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!tls12_check_peer_sigalg(ssl, &alert, signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + hs->new_session->peer_signature_algorithm = signature_algorithm; + + Array input; + if (!tls13_get_cert_verify_signature_input( + hs, &input, + ssl->server ? ssl_cert_verify_client : ssl_cert_verify_server)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return false; + } + + if (!ssl_public_key_verify(ssl, signature, signature_algorithm, + hs->peer_pubkey.get(), input)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + return false; + } + + return true; +} + +bool tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool use_saved_value) { + SSL *const ssl = hs->ssl; + uint8_t verify_data_buf[EVP_MAX_MD_SIZE]; + Span verify_data; + if (use_saved_value) { + assert(ssl->server); + verify_data = hs->expected_client_finished(); + } else { + size_t len; + if (!tls13_finished_mac(hs, verify_data_buf, &len, !ssl->server)) { + return false; + } + verify_data = MakeConstSpan(verify_data_buf, len); + } + + bool finished_ok = + CBS_mem_equal(&msg.body, verify_data.data(), verify_data.size()); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + finished_ok = true; +#endif + if (!finished_ok) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); + return false; + } + + return true; +} + +bool tls13_add_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + CERT *const cert = hs->config->cert.get(); + DC *const dc = cert->dc.get(); + + ScopedCBB cbb; + CBB *body, body_storage, certificate_list; + + if (hs->cert_compression_negotiated) { + if (!CBB_init(cbb.get(), 1024)) { + return false; + } + body = cbb.get(); + } else { + body = &body_storage; + if (!ssl->method->init_message(ssl, cbb.get(), body, SSL3_MT_CERTIFICATE)) { + return false; + } + } + + if (// The request context is always empty in the handshake. + !CBB_add_u8(body, 0) || + !CBB_add_u24_length_prefixed(body, &certificate_list)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (!ssl_has_certificate(hs)) { + return ssl_add_message_cbb(ssl, cbb.get()); + } + + CRYPTO_BUFFER *leaf_buf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); + CBB leaf, extensions; + if (!CBB_add_u24_length_prefixed(&certificate_list, &leaf) || + !CBB_add_bytes(&leaf, CRYPTO_BUFFER_data(leaf_buf), + CRYPTO_BUFFER_len(leaf_buf)) || + !CBB_add_u16_length_prefixed(&certificate_list, &extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (hs->scts_requested && cert->signed_cert_timestamp_list != nullptr) { + CBB contents; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_certificate_timestamp) || + !CBB_add_u16_length_prefixed(&extensions, &contents) || + !CBB_add_bytes( + &contents, + CRYPTO_BUFFER_data(cert->signed_cert_timestamp_list.get()), + CRYPTO_BUFFER_len(cert->signed_cert_timestamp_list.get())) || + !CBB_flush(&extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + if (hs->ocsp_stapling_requested && cert->ocsp_response != NULL) { + CBB contents, ocsp_response; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_status_request) || + !CBB_add_u16_length_prefixed(&extensions, &contents) || + !CBB_add_u8(&contents, TLSEXT_STATUSTYPE_ocsp) || + !CBB_add_u24_length_prefixed(&contents, &ocsp_response) || + !CBB_add_bytes(&ocsp_response, + CRYPTO_BUFFER_data(cert->ocsp_response.get()), + CRYPTO_BUFFER_len(cert->ocsp_response.get())) || + !CBB_flush(&extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + if (ssl_signing_with_dc(hs)) { + const CRYPTO_BUFFER *raw = dc->raw.get(); + CBB child; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_delegated_credential) || + !CBB_add_u16_length_prefixed(&extensions, &child) || + !CBB_add_bytes(&child, CRYPTO_BUFFER_data(raw), + CRYPTO_BUFFER_len(raw)) || + !CBB_flush(&extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + ssl->s3->delegated_credential_used = true; + } + + for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain.get()); i++) { + CRYPTO_BUFFER *cert_buf = sk_CRYPTO_BUFFER_value(cert->chain.get(), i); + CBB child; + if (!CBB_add_u24_length_prefixed(&certificate_list, &child) || + !CBB_add_bytes(&child, CRYPTO_BUFFER_data(cert_buf), + CRYPTO_BUFFER_len(cert_buf)) || + !CBB_add_u16(&certificate_list, 0 /* no extensions */)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + if (!hs->cert_compression_negotiated) { + return ssl_add_message_cbb(ssl, cbb.get()); + } + + Array msg; + if (!CBBFinishArray(cbb.get(), &msg)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + const CertCompressionAlg *alg = nullptr; + for (const auto &candidate : ssl->ctx->cert_compression_algs) { + if (candidate.alg_id == hs->cert_compression_alg_id) { + alg = &candidate; + break; + } + } + + if (alg == nullptr || alg->compress == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + CBB compressed; + body = &body_storage; + if (!ssl->method->init_message(ssl, cbb.get(), body, + SSL3_MT_COMPRESSED_CERTIFICATE) || + !CBB_add_u16(body, hs->cert_compression_alg_id) || + !CBB_add_u24(body, msg.size()) || + !CBB_add_u24_length_prefixed(body, &compressed) || + !alg->compress(ssl, &compressed, msg.data(), msg.size()) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + return true; +} + +enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + uint16_t signature_algorithm; + if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_private_key_failure; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_VERIFY) || + !CBB_add_u16(&body, signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + // Sign the digest. + CBB child; + const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); + uint8_t *sig; + size_t sig_len; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_reserve(&child, &sig, max_sig_len)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + Array msg; + if (!tls13_get_cert_verify_signature_input( + hs, &msg, + ssl->server ? ssl_cert_verify_server : ssl_cert_verify_client)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + enum ssl_private_key_result_t sign_result = ssl_private_key_sign( + hs, sig, &sig_len, max_sig_len, signature_algorithm, msg); + if (sign_result != ssl_private_key_success) { + return sign_result; + } + + if (!CBB_did_write(&child, sig_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_private_key_failure; + } + + return ssl_private_key_success; +} + +bool tls13_add_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + size_t verify_data_len; + uint8_t verify_data[EVP_MAX_MD_SIZE]; + + if (!tls13_finished_mac(hs, verify_data, &verify_data_len, ssl->server)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); + return false; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || + !CBB_add_bytes(&body, verify_data, verify_data_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return false; + } + + return true; +} + +bool tls13_add_key_update(SSL *ssl, int update_requested) { + ScopedCBB cbb; + CBB body_cbb; + if (!ssl->method->init_message(ssl, cbb.get(), &body_cbb, + SSL3_MT_KEY_UPDATE) || + !CBB_add_u8(&body_cbb, update_requested) || + !ssl_add_message_cbb(ssl, cbb.get()) || + !tls13_rotate_traffic_key(ssl, evp_aead_seal)) { + return false; + } + + // Suppress KeyUpdate acknowledgments until this change is written to the + // wire. This prevents us from accumulating write obligations when read and + // write progress at different rates. See RFC 8446, section 4.6.3. + ssl->s3->key_update_pending = true; + + return true; +} + +static bool tls13_receive_key_update(SSL *ssl, const SSLMessage &msg) { + CBS body = msg.body; + uint8_t key_update_request; + if (!CBS_get_u8(&body, &key_update_request) || + CBS_len(&body) != 0 || + (key_update_request != SSL_KEY_UPDATE_NOT_REQUESTED && + key_update_request != SSL_KEY_UPDATE_REQUESTED)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (!tls13_rotate_traffic_key(ssl, evp_aead_open)) { + return false; + } + + // Acknowledge the KeyUpdate + if (key_update_request == SSL_KEY_UPDATE_REQUESTED && + !ssl->s3->key_update_pending && + !tls13_add_key_update(ssl, SSL_KEY_UPDATE_NOT_REQUESTED)) { + return false; + } + + return true; +} + +bool tls13_post_handshake(SSL *ssl, const SSLMessage &msg) { + if (msg.type == SSL3_MT_KEY_UPDATE) { + ssl->s3->key_update_count++; + if (ssl->quic_method != nullptr || + ssl->s3->key_update_count > kMaxKeyUpdates) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_KEY_UPDATES); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return false; + } + + return tls13_receive_key_update(ssl, msg); + } + + ssl->s3->key_update_count = 0; + + if (msg.type == SSL3_MT_NEW_SESSION_TICKET && !ssl->server) { + return tls13_process_new_session_ticket(ssl, msg); + } + + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + return false; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc.grpc_back new file mode 100644 index 000000000..18bdef205 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_both.cc.grpc_back @@ -0,0 +1,689 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +// kMaxKeyUpdates is the number of consecutive KeyUpdates that will be +// processed. Without this limit an attacker could force unbounded processing +// without being able to return application data. +static const uint8_t kMaxKeyUpdates = 32; + +const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE] = { + 0xcf, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11, 0xbe, 0x1d, 0x8c, + 0x02, 0x1e, 0x65, 0xb8, 0x91, 0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, + 0x8c, 0x5e, 0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c, +}; + +// See RFC 8446, section 4.1.3. +const uint8_t kTLS12DowngradeRandom[8] = {0x44, 0x4f, 0x57, 0x4e, + 0x47, 0x52, 0x44, 0x00}; +const uint8_t kTLS13DowngradeRandom[8] = {0x44, 0x4f, 0x57, 0x4e, + 0x47, 0x52, 0x44, 0x01}; + +// This is a non-standard randomly-generated value. +const uint8_t kJDK11DowngradeRandom[8] = {0xed, 0xbf, 0xb4, 0xa8, + 0xc2, 0x47, 0x10, 0xff}; + +bool tls13_get_cert_verify_signature_input( + SSL_HANDSHAKE *hs, Array *out, + enum ssl_cert_verify_context_t cert_verify_context) { + ScopedCBB cbb; + if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + for (size_t i = 0; i < 64; i++) { + if (!CBB_add_u8(cbb.get(), 0x20)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + } + + Span context; + if (cert_verify_context == ssl_cert_verify_server) { + static const char kContext[] = "TLS 1.3, server CertificateVerify"; + context = kContext; + } else if (cert_verify_context == ssl_cert_verify_client) { + static const char kContext[] = "TLS 1.3, client CertificateVerify"; + context = kContext; + } else if (cert_verify_context == ssl_cert_verify_channel_id) { + static const char kContext[] = "TLS 1.3, Channel ID"; + context = kContext; + } else { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + // Note |context| includes the NUL byte separator. + if (!CBB_add_bytes(cbb.get(), + reinterpret_cast(context.data()), + context.size())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + uint8_t context_hash[EVP_MAX_MD_SIZE]; + size_t context_hash_len; + if (!hs->transcript.GetHash(context_hash, &context_hash_len) || + !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || + !CBBFinishArray(cbb.get(), out)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + return true; +} + +bool tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool allow_anonymous) { + SSL *const ssl = hs->ssl; + CBS body = msg.body; + bssl::UniquePtr decompressed; + + if (msg.type == SSL3_MT_COMPRESSED_CERTIFICATE) { + CBS compressed; + uint16_t alg_id; + uint32_t uncompressed_len; + + if (!CBS_get_u16(&body, &alg_id) || + !CBS_get_u24(&body, &uncompressed_len) || + !CBS_get_u24_length_prefixed(&body, &compressed) || + CBS_len(&body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + if (uncompressed_len > ssl->max_cert_list) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNCOMPRESSED_CERT_TOO_LARGE); + ERR_add_error_dataf("requested=%u", + static_cast(uncompressed_len)); + return false; + } + + ssl_cert_decompression_func_t decompress = nullptr; + for (const auto &alg : ssl->ctx->cert_compression_algs) { + if (alg.alg_id == alg_id) { + decompress = alg.decompress; + break; + } + } + + if (decompress == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERT_COMPRESSION_ALG); + ERR_add_error_dataf("alg=%d", static_cast(alg_id)); + return false; + } + + CRYPTO_BUFFER *decompressed_ptr = nullptr; + if (!decompress(ssl, &decompressed_ptr, uncompressed_len, + CBS_data(&compressed), CBS_len(&compressed))) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_DECOMPRESSION_FAILED); + ERR_add_error_dataf("alg=%d", static_cast(alg_id)); + return false; + } + decompressed.reset(decompressed_ptr); + + if (CRYPTO_BUFFER_len(decompressed_ptr) != uncompressed_len) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_DECOMPRESSION_FAILED); + ERR_add_error_dataf( + "alg=%d got=%u expected=%u", static_cast(alg_id), + static_cast(CRYPTO_BUFFER_len(decompressed_ptr)), + static_cast(uncompressed_len)); + return false; + } + + CBS_init(&body, CRYPTO_BUFFER_data(decompressed_ptr), + CRYPTO_BUFFER_len(decompressed_ptr)); + } else { + assert(msg.type == SSL3_MT_CERTIFICATE); + } + + CBS context, certificate_list; + if (!CBS_get_u8_length_prefixed(&body, &context) || + CBS_len(&context) != 0 || + !CBS_get_u24_length_prefixed(&body, &certificate_list) || + CBS_len(&body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + + UniquePtr certs(sk_CRYPTO_BUFFER_new_null()); + if (!certs) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + const bool retain_sha256 = + ssl->server && hs->config->retain_only_sha256_of_client_certs; + UniquePtr pkey; + while (CBS_len(&certificate_list) > 0) { + CBS certificate, extensions; + if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || + !CBS_get_u16_length_prefixed(&certificate_list, &extensions) || + CBS_len(&certificate) == 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); + return false; + } + + if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { + pkey = ssl_cert_parse_pubkey(&certificate); + if (!pkey) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; + } + // TLS 1.3 always uses certificate keys for signing thus the correct + // keyUsage is enforced. + if (!ssl_cert_check_key_usage(&certificate, + key_usage_digital_signature)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return false; + } + + if (retain_sha256) { + // Retain the hash of the leaf certificate if requested. + SHA256(CBS_data(&certificate), CBS_len(&certificate), + hs->new_session->peer_sha256); + } + } + + UniquePtr buf( + CRYPTO_BUFFER_new_from_CBS(&certificate, ssl->ctx->pool)); + if (!buf || + !PushToStack(certs.get(), std::move(buf))) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); + return false; + } + + // Parse out the extensions. + bool have_status_request = false, have_sct = false; + CBS status_request, sct; + const SSL_EXTENSION_TYPE ext_types[] = { + {TLSEXT_TYPE_status_request, &have_status_request, &status_request}, + {TLSEXT_TYPE_certificate_timestamp, &have_sct, &sct}, + }; + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_parse_extensions(&extensions, &alert, ext_types, + OPENSSL_ARRAY_SIZE(ext_types), + 0 /* reject unknown */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + + // All Certificate extensions are parsed, but only the leaf extensions are + // stored. + if (have_status_request) { + if (ssl->server || !hs->config->ocsp_stapling_enabled) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); + return false; + } + + uint8_t status_type; + CBS ocsp_response; + if (!CBS_get_u8(&status_request, &status_type) || + status_type != TLSEXT_STATUSTYPE_ocsp || + !CBS_get_u24_length_prefixed(&status_request, &ocsp_response) || + CBS_len(&ocsp_response) == 0 || + CBS_len(&status_request) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { + hs->new_session->ocsp_response.reset( + CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool)); + if (hs->new_session->ocsp_response == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return false; + } + } + } + + if (have_sct) { + if (ssl->server || !hs->config->signed_cert_timestamps_enabled) { + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); + return false; + } + + if (!ssl_is_sct_list_valid(&sct)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { + hs->new_session->signed_cert_timestamp_list.reset( + CRYPTO_BUFFER_new_from_CBS(&sct, ssl->ctx->pool)); + if (hs->new_session->signed_cert_timestamp_list == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return false; + } + } + } + } + + // Store a null certificate list rather than an empty one if the peer didn't + // send certificates. + if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { + certs.reset(); + } + + hs->peer_pubkey = std::move(pkey); + hs->new_session->certs = std::move(certs); + + if (!ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { + if (!allow_anonymous) { + OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_CERTIFICATE_REQUIRED); + return false; + } + + // OpenSSL returns X509_V_OK when no certificates are requested. This is + // classed by them as a bug, but it's assumed by at least NGINX. + hs->new_session->verify_result = X509_V_OK; + + // No certificate, so nothing more to do. + return true; + } + + hs->new_session->peer_sha256_valid = retain_sha256; + return true; +} + +bool tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg) { + SSL *const ssl = hs->ssl; + if (hs->peer_pubkey == NULL) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + CBS body = msg.body, signature; + uint16_t signature_algorithm; + if (!CBS_get_u16(&body, &signature_algorithm) || + !CBS_get_u16_length_prefixed(&body, &signature) || + CBS_len(&body) != 0) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!tls12_check_peer_sigalg(ssl, &alert, signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return false; + } + hs->new_session->peer_signature_algorithm = signature_algorithm; + + Array input; + if (!tls13_get_cert_verify_signature_input( + hs, &input, + ssl->server ? ssl_cert_verify_client : ssl_cert_verify_server)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return false; + } + + if (!ssl_public_key_verify(ssl, signature, signature_algorithm, + hs->peer_pubkey.get(), input)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + return false; + } + + return true; +} + +bool tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, + bool use_saved_value) { + SSL *const ssl = hs->ssl; + uint8_t verify_data_buf[EVP_MAX_MD_SIZE]; + Span verify_data; + if (use_saved_value) { + assert(ssl->server); + verify_data = hs->expected_client_finished(); + } else { + size_t len; + if (!tls13_finished_mac(hs, verify_data_buf, &len, !ssl->server)) { + return false; + } + verify_data = MakeConstSpan(verify_data_buf, len); + } + + bool finished_ok = + CBS_mem_equal(&msg.body, verify_data.data(), verify_data.size()); +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + finished_ok = true; +#endif + if (!finished_ok) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); + return false; + } + + return true; +} + +bool tls13_add_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + CERT *const cert = hs->config->cert.get(); + DC *const dc = cert->dc.get(); + + ScopedCBB cbb; + CBB *body, body_storage, certificate_list; + + if (hs->cert_compression_negotiated) { + if (!CBB_init(cbb.get(), 1024)) { + return false; + } + body = cbb.get(); + } else { + body = &body_storage; + if (!ssl->method->init_message(ssl, cbb.get(), body, SSL3_MT_CERTIFICATE)) { + return false; + } + } + + if (// The request context is always empty in the handshake. + !CBB_add_u8(body, 0) || + !CBB_add_u24_length_prefixed(body, &certificate_list)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (!ssl_has_certificate(hs)) { + return ssl_add_message_cbb(ssl, cbb.get()); + } + + CRYPTO_BUFFER *leaf_buf = sk_CRYPTO_BUFFER_value(cert->chain.get(), 0); + CBB leaf, extensions; + if (!CBB_add_u24_length_prefixed(&certificate_list, &leaf) || + !CBB_add_bytes(&leaf, CRYPTO_BUFFER_data(leaf_buf), + CRYPTO_BUFFER_len(leaf_buf)) || + !CBB_add_u16_length_prefixed(&certificate_list, &extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + if (hs->scts_requested && cert->signed_cert_timestamp_list != nullptr) { + CBB contents; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_certificate_timestamp) || + !CBB_add_u16_length_prefixed(&extensions, &contents) || + !CBB_add_bytes( + &contents, + CRYPTO_BUFFER_data(cert->signed_cert_timestamp_list.get()), + CRYPTO_BUFFER_len(cert->signed_cert_timestamp_list.get())) || + !CBB_flush(&extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + if (hs->ocsp_stapling_requested && cert->ocsp_response != NULL) { + CBB contents, ocsp_response; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_status_request) || + !CBB_add_u16_length_prefixed(&extensions, &contents) || + !CBB_add_u8(&contents, TLSEXT_STATUSTYPE_ocsp) || + !CBB_add_u24_length_prefixed(&contents, &ocsp_response) || + !CBB_add_bytes(&ocsp_response, + CRYPTO_BUFFER_data(cert->ocsp_response.get()), + CRYPTO_BUFFER_len(cert->ocsp_response.get())) || + !CBB_flush(&extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + if (ssl_signing_with_dc(hs)) { + const CRYPTO_BUFFER *raw = dc->raw.get(); + CBB child; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_delegated_credential) || + !CBB_add_u16_length_prefixed(&extensions, &child) || + !CBB_add_bytes(&child, CRYPTO_BUFFER_data(raw), + CRYPTO_BUFFER_len(raw)) || + !CBB_flush(&extensions)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return 0; + } + ssl->s3->delegated_credential_used = true; + } + + for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain.get()); i++) { + CRYPTO_BUFFER *cert_buf = sk_CRYPTO_BUFFER_value(cert->chain.get(), i); + CBB child; + if (!CBB_add_u24_length_prefixed(&certificate_list, &child) || + !CBB_add_bytes(&child, CRYPTO_BUFFER_data(cert_buf), + CRYPTO_BUFFER_len(cert_buf)) || + !CBB_add_u16(&certificate_list, 0 /* no extensions */)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + } + + if (!hs->cert_compression_negotiated) { + return ssl_add_message_cbb(ssl, cbb.get()); + } + + Array msg; + if (!CBBFinishArray(cbb.get(), &msg)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + const CertCompressionAlg *alg = nullptr; + for (const auto &candidate : ssl->ctx->cert_compression_algs) { + if (candidate.alg_id == hs->cert_compression_alg_id) { + alg = &candidate; + break; + } + } + + if (alg == nullptr || alg->compress == nullptr) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + CBB compressed; + body = &body_storage; + if (!ssl->method->init_message(ssl, cbb.get(), body, + SSL3_MT_COMPRESSED_CERTIFICATE) || + !CBB_add_u16(body, hs->cert_compression_alg_id) || + !CBB_add_u24(body, msg.size()) || + !CBB_add_u24_length_prefixed(body, &compressed) || + !alg->compress(ssl, &compressed, msg.data(), msg.size()) || + !ssl_add_message_cbb(ssl, cbb.get())) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + return true; +} + +enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + uint16_t signature_algorithm; + if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_private_key_failure; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_VERIFY) || + !CBB_add_u16(&body, signature_algorithm)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + // Sign the digest. + CBB child; + const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); + uint8_t *sig; + size_t sig_len; + if (!CBB_add_u16_length_prefixed(&body, &child) || + !CBB_reserve(&child, &sig, max_sig_len)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + Array msg; + if (!tls13_get_cert_verify_signature_input( + hs, &msg, + ssl->server ? ssl_cert_verify_server : ssl_cert_verify_client)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_private_key_failure; + } + + enum ssl_private_key_result_t sign_result = ssl_private_key_sign( + hs, sig, &sig_len, max_sig_len, signature_algorithm, msg); + if (sign_result != ssl_private_key_success) { + return sign_result; + } + + if (!CBB_did_write(&child, sig_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_private_key_failure; + } + + return ssl_private_key_success; +} + +bool tls13_add_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + size_t verify_data_len; + uint8_t verify_data[EVP_MAX_MD_SIZE]; + + if (!tls13_finished_mac(hs, verify_data, &verify_data_len, ssl->server)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); + return false; + } + + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || + !CBB_add_bytes(&body, verify_data, verify_data_len) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return false; + } + + return true; +} + +bool tls13_add_key_update(SSL *ssl, int update_requested) { + ScopedCBB cbb; + CBB body_cbb; + if (!ssl->method->init_message(ssl, cbb.get(), &body_cbb, + SSL3_MT_KEY_UPDATE) || + !CBB_add_u8(&body_cbb, update_requested) || + !ssl_add_message_cbb(ssl, cbb.get()) || + !tls13_rotate_traffic_key(ssl, evp_aead_seal)) { + return false; + } + + // Suppress KeyUpdate acknowledgments until this change is written to the + // wire. This prevents us from accumulating write obligations when read and + // write progress at different rates. See RFC 8446, section 4.6.3. + ssl->s3->key_update_pending = true; + + return true; +} + +static bool tls13_receive_key_update(SSL *ssl, const SSLMessage &msg) { + CBS body = msg.body; + uint8_t key_update_request; + if (!CBS_get_u8(&body, &key_update_request) || + CBS_len(&body) != 0 || + (key_update_request != SSL_KEY_UPDATE_NOT_REQUESTED && + key_update_request != SSL_KEY_UPDATE_REQUESTED)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return false; + } + + if (!tls13_rotate_traffic_key(ssl, evp_aead_open)) { + return false; + } + + // Acknowledge the KeyUpdate + if (key_update_request == SSL_KEY_UPDATE_REQUESTED && + !ssl->s3->key_update_pending && + !tls13_add_key_update(ssl, SSL_KEY_UPDATE_NOT_REQUESTED)) { + return false; + } + + return true; +} + +bool tls13_post_handshake(SSL *ssl, const SSLMessage &msg) { + if (msg.type == SSL3_MT_KEY_UPDATE) { + ssl->s3->key_update_count++; + if (ssl->quic_method != nullptr || + ssl->s3->key_update_count > kMaxKeyUpdates) { + OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_KEY_UPDATES); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + return false; + } + + return tls13_receive_key_update(ssl, msg); + } + + ssl->s3->key_update_count = 0; + + if (msg.type == SSL3_MT_NEW_SESSION_TICKET && !ssl->server) { + return tls13_process_new_session_ticket(ssl, msg); + } + + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); + OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); + return false; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_client.cc b/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc similarity index 81% rename from Pods/BoringSSL-GRPC/ssl/tls13_client.cc rename to Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc index 12bb78aca..b1e0de272 100644 --- a/Pods/BoringSSL-GRPC/ssl/tls13_client.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc @@ -24,13 +24,14 @@ #include #include #include +#include #include #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN enum client_hs_state_t { state_read_hello_retry_request = 0, @@ -40,6 +41,7 @@ enum client_hs_state_t { state_read_certificate_request, state_read_server_certificate, state_read_server_certificate_verify, + state_server_certificate_reverify, state_read_server_finished, state_send_end_of_early_data, state_send_client_certificate, @@ -157,21 +159,23 @@ static enum ssl_hs_wait_t do_read_hello_retry_request(SSL_HANDSHAKE *hs) { } // The group must be supported. - if (!tls1_check_group_id(ssl, group_id)) { + if (!tls1_check_group_id(hs, group_id)) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); return ssl_hs_error; } - // Check that the HelloRetryRequest does not request the key share that - // was provided in the initial ClientHello. - if (hs->key_share->GroupID() == group_id) { + // Check that the HelloRetryRequest does not request a key share that was + // provided in the initial ClientHello. + if (hs->key_shares[0]->GroupID() == group_id || + (hs->key_shares[1] && hs->key_shares[1]->GroupID() == group_id)) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); return ssl_hs_error; } - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); hs->retry_group = group_id; } @@ -180,10 +184,11 @@ static enum ssl_hs_wait_t do_read_hello_retry_request(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->received_hello_retry_request = true; + ssl->s3->used_hello_retry_request = true; hs->tls13_state = state_send_second_client_hello; // 0-RTT is rejected if we receive a HelloRetryRequest. if (hs->in_early_data) { + ssl->s3->early_data_reason = ssl_early_data_hello_retry_request; return ssl_hs_early_data_rejected; } return ssl_hs_ok; @@ -264,8 +269,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { } // Check that the cipher matches the one in the HelloRetryRequest. - if (hs->received_hello_retry_request && - hs->new_cipher != cipher) { + if (ssl->s3->used_hello_retry_request && hs->new_cipher != cipher) { OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CIPHER_RETURNED); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; @@ -290,6 +294,16 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + // Recheck supported_versions, in case this is the second ServerHello. + uint16_t version; + if (!have_supported_versions || + !CBS_get_u16(&supported_versions, &version) || + version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SECOND_SERVERHELLO_VERSION_MISMATCH); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + alert = SSL_AD_DECODE_ERROR; if (have_pre_shared_key) { if (ssl->session == NULL) { @@ -316,7 +330,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (!ssl_session_is_context_valid(ssl, ssl->session)) { + if (!ssl_session_is_context_valid(hs, ssl->session.get())) { // This is actually a client application bug. OPENSSL_PUT_ERROR(SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); @@ -326,7 +340,8 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { ssl->s3->session_reused = true; // Only authentication information carries over in TLS 1.3. - hs->new_session = SSL_SESSION_dup(ssl->session, SSL_SESSION_DUP_AUTH_ONLY); + hs->new_session = + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_DUP_AUTH_ONLY); if (!hs->new_session) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; @@ -349,11 +364,12 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { // Set up the key schedule and incorporate the PSK into the running secret. if (ssl->s3->session_reused) { - if (!tls13_init_key_schedule(hs, hs->new_session->master_key, - hs->new_session->master_key_length)) { + if (!tls13_init_key_schedule( + hs, MakeConstSpan(hs->new_session->master_key, + hs->new_session->master_key_length))) { return ssl_hs_error; } - } else if (!tls13_init_key_schedule(hs, kZeroes, hash_len)) { + } else if (!tls13_init_key_schedule(hs, MakeConstSpan(kZeroes, hash_len))) { return ssl_hs_error; } @@ -373,19 +389,19 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (!tls13_advance_key_schedule(hs, dhe_secret.data(), dhe_secret.size()) || + if (!tls13_advance_key_schedule(hs, dhe_secret) || !ssl_hash_message(hs, msg) || !tls13_derive_handshake_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_open, hs->server_handshake_secret, - hs->hash_len)) { + !tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->server_handshake_secret())) { return ssl_hs_error; } if (!hs->early_data_offered) { // If not sending early data, set client traffic keys now so that alerts are // encrypted. - if (!tls13_set_traffic_key(ssl, evp_aead_seal, hs->client_handshake_secret, - hs->hash_len)) { + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { return ssl_hs_error; } } @@ -417,26 +433,19 @@ static enum ssl_hs_wait_t do_read_encrypted_extensions(SSL_HANDSHAKE *hs) { } // Store the negotiated ALPN in the session. - if (!ssl->s3->alpn_selected.empty()) { - hs->new_session->early_alpn = (uint8_t *)BUF_memdup( - ssl->s3->alpn_selected.data(), ssl->s3->alpn_selected.size()); - if (hs->new_session->early_alpn == NULL) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - hs->new_session->early_alpn_len = ssl->s3->alpn_selected.size(); + if (!hs->new_session->early_alpn.CopyFrom(ssl->s3->alpn_selected)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; } if (ssl->s3->early_data_accepted) { if (hs->early_session->cipher != hs->new_session->cipher || - MakeConstSpan(hs->early_session->early_alpn, - hs->early_session->early_alpn_len) != + MakeConstSpan(hs->early_session->early_alpn) != ssl->s3->alpn_selected) { OPENSSL_PUT_ERROR(SSL, SSL_R_ALPN_MISMATCH_ON_EARLY_DATA); return ssl_hs_error; } - if (ssl->s3->tlsext_channel_id_valid || hs->received_custom_extension || - ssl->token_binding_negotiated) { + if (ssl->s3->channel_id_valid || ssl->s3->token_binding_negotiated) { OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA); return ssl_hs_error; } @@ -458,6 +467,10 @@ static enum ssl_hs_wait_t do_read_certificate_request(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // CertificateRequest may only be sent in non-resumption handshakes. if (ssl->s3->session_reused) { + if (ssl->ctx->reverify_on_resume && !ssl->s3->early_data_accepted) { + hs->tls13_state = state_server_certificate_reverify; + return ssl_hs_ok; + } hs->tls13_state = state_read_server_finished; return ssl_hs_ok; } @@ -495,7 +508,6 @@ static enum ssl_hs_wait_t do_read_certificate_request(SSL_HANDSHAKE *hs) { !have_sigalgs || !CBS_get_u16_length_prefixed(&sigalgs, &supported_signature_algorithms) || - CBS_len(&supported_signature_algorithms) == 0 || !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); @@ -535,8 +547,13 @@ static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { if (!ssl->method->get_message(ssl, &msg)) { return ssl_hs_read_message; } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE) || - !tls13_process_certificate(hs, msg, 0 /* certificate required */) || + + if (msg.type != SSL3_MT_COMPRESSED_CERTIFICATE && + !ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE)) { + return ssl_hs_error; + } + + if (!tls13_process_certificate(hs, msg, false /* certificate required */) || !ssl_hash_message(hs, msg)) { return ssl_hs_error; } @@ -574,6 +591,21 @@ static enum ssl_hs_wait_t do_read_server_certificate_verify( return ssl_hs_ok; } +static enum ssl_hs_wait_t do_server_certificate_reverify( + SSL_HANDSHAKE *hs) { + switch (ssl_reverify_peer_cert(hs, /*send_alert=*/true)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->tls13_state = state_server_certificate_reverify; + return ssl_hs_certificate_verify; + } + hs->tls13_state = state_read_server_finished; + return ssl_hs_ok; +} + static enum ssl_hs_wait_t do_read_server_finished(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; SSLMessage msg; @@ -581,10 +613,11 @@ static enum ssl_hs_wait_t do_read_server_finished(SSL_HANDSHAKE *hs) { return ssl_hs_read_message; } if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || - !tls13_process_finished(hs, msg, 0 /* don't use saved value */) || + !tls13_process_finished(hs, msg, false /* don't use saved value */) || !ssl_hash_message(hs, msg) || // Update the secret to the master secret and derive traffic keys. - !tls13_advance_key_schedule(hs, kZeroes, hs->hash_len) || + !tls13_advance_key_schedule( + hs, MakeConstSpan(kZeroes, hs->transcript.DigestLen())) || !tls13_derive_application_secrets(hs)) { return ssl_hs_error; } @@ -599,18 +632,22 @@ static enum ssl_hs_wait_t do_send_end_of_early_data(SSL_HANDSHAKE *hs) { if (ssl->s3->early_data_accepted) { hs->can_early_write = false; - ScopedCBB cbb; - CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_END_OF_EARLY_DATA) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; + // QUIC omits the EndOfEarlyData message. See draft-ietf-quic-tls-22, + // section 8.3. + if (ssl->quic_method == nullptr) { + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_END_OF_EARLY_DATA) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } } } if (hs->early_data_offered) { - if (!tls13_set_traffic_key(ssl, evp_aead_seal, hs->client_handshake_secret, - hs->hash_len)) { + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { return ssl_hs_error; } } @@ -629,8 +666,8 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } // Call cert_cb to update the certificate. - if (ssl->cert->cert_cb != NULL) { - int rv = ssl->cert->cert_cb(ssl, ssl->cert->cert_cb_arg); + if (hs->config->cert->cert_cb != NULL) { + int rv = hs->config->cert->cert_cb(ssl, hs->config->cert->cert_cb_arg); if (rv == 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_CB_ERROR); @@ -652,9 +689,8 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; // Don't send CertificateVerify if there is no certificate. - if (!ssl_has_certificate(ssl)) { + if (!ssl_has_certificate(hs)) { hs->tls13_state = state_complete_second_flight; return ssl_hs_ok; } @@ -680,13 +716,13 @@ static enum ssl_hs_wait_t do_complete_second_flight(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // Send a Channel ID assertion if necessary. - if (ssl->s3->tlsext_channel_id_valid) { - if (!ssl_do_channel_id_callback(ssl)) { + if (ssl->s3->channel_id_valid) { + if (!ssl_do_channel_id_callback(hs)) { hs->tls13_state = state_complete_second_flight; return ssl_hs_error; } - if (ssl->tlsext_channel_id_private == NULL) { + if (hs->config->channel_id_private == NULL) { return ssl_hs_channel_id_lookup; } @@ -705,10 +741,10 @@ static enum ssl_hs_wait_t do_complete_second_flight(SSL_HANDSHAKE *hs) { } // Derive the final keys and enable them. - if (!tls13_set_traffic_key(ssl, evp_aead_open, hs->server_traffic_secret_0, - hs->hash_len) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->client_traffic_secret_0, - hs->hash_len) || + if (!tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_open, + hs->server_traffic_secret_0()) || + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_seal, + hs->client_traffic_secret_0()) || !tls13_derive_resumption_secret(hs)) { return ssl_hs_error; } @@ -744,6 +780,9 @@ enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs) { case state_read_server_certificate_verify: ret = do_read_server_certificate_verify(hs); break; + case state_server_certificate_reverify: + ret = do_server_certificate_reverify(hs); + break; case state_read_server_finished: ret = do_read_server_finished(hs); break; @@ -794,6 +833,8 @@ const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS 1.3 client read_server_certificate"; case state_read_server_certificate_verify: return "TLS 1.3 client read_server_certificate_verify"; + case state_server_certificate_reverify: + return "TLS 1.3 client server_certificate_reverify"; case state_read_server_finished: return "TLS 1.3 client read_server_finished"; case state_send_end_of_early_data: @@ -811,18 +852,18 @@ const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS 1.3 client unknown"; } -int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { +bool tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { if (ssl->s3->write_shutdown != ssl_shutdown_none) { // Ignore tickets on shutdown. Callers tend to indiscriminately call // |SSL_shutdown| before destroying an |SSL|, at which point calling the new // session callback may be confusing. - return 1; + return true; } UniquePtr session = SSL_SESSION_dup( ssl->s3->established_session.get(), SSL_SESSION_INCLUDE_NONAUTH); if (!session) { - return 0; + return false; } ssl_session_rebase_time(ssl, session.get()); @@ -833,12 +874,12 @@ int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { !CBS_get_u32(&body, &session->ticket_age_add) || !CBS_get_u8_length_prefixed(&body, &ticket_nonce) || !CBS_get_u16_length_prefixed(&body, &ticket) || - !CBS_stow(&ticket, &session->tlsext_tick, &session->tlsext_ticklen) || + !session->ticket.CopyFrom(ticket) || !CBS_get_u16_length_prefixed(&body, &extensions) || CBS_len(&body) != 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; + return false; } // Cap the renewable lifetime by the server advertised value. This avoids @@ -848,14 +889,14 @@ int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { } if (!tls13_derive_session_psk(session.get(), ticket_nonce)) { - return 0; + return false; } // Parse out the extensions. - bool have_early_data_info = false; - CBS early_data_info; + bool have_early_data = false; + CBS early_data; const SSL_EXTENSION_TYPE ext_types[] = { - {TLSEXT_TYPE_early_data, &have_early_data_info, &early_data_info}, + {TLSEXT_TYPE_early_data, &have_early_data, &early_data}, }; uint8_t alert = SSL_AD_DECODE_ERROR; @@ -863,29 +904,43 @@ int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { OPENSSL_ARRAY_SIZE(ext_types), 1 /* ignore unknown */)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; + return false; } - if (have_early_data_info && ssl->cert->enable_early_data) { - if (!CBS_get_u32(&early_data_info, &session->ticket_max_early_data) || - CBS_len(&early_data_info) != 0) { + if (have_early_data) { + if (!CBS_get_u32(&early_data, &session->ticket_max_early_data) || + CBS_len(&early_data) != 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; + return false; + } + + // QUIC does not use the max_early_data_size parameter and always sets it to + // a fixed value. See draft-ietf-quic-tls-22, section 4.5. + if (ssl->quic_method != nullptr && + session->ticket_max_early_data != 0xffffffff) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; } } - session->ticket_age_add_valid = 1; - session->not_resumable = 0; + // Generate a session ID for this session. Some callers expect all sessions to + // have a session ID. + SHA256(CBS_data(&ticket), CBS_len(&ticket), session->session_id); + session->session_id_length = SHA256_DIGEST_LENGTH; + + session->ticket_age_add_valid = true; + session->not_resumable = false; - if ((ssl->ctx->session_cache_mode & SSL_SESS_CACHE_CLIENT) && - ssl->ctx->new_session_cb != NULL && - ssl->ctx->new_session_cb(ssl, session.get())) { + if ((ssl->session_ctx->session_cache_mode & SSL_SESS_CACHE_CLIENT) && + ssl->session_ctx->new_session_cb != NULL && + ssl->session_ctx->new_session_cb(ssl, session.get())) { // |new_session_cb|'s return value signals that it took ownership. session.release(); } - return 1; + return true; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_client.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc.grpc_back similarity index 81% rename from Pods/BoringSSL-GRPC/ssl/tls13_client.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc.grpc_back index aa0545634..8bb3339a2 100644 --- a/Pods/BoringSSL-GRPC/ssl/tls13_client.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_client.cc.grpc_back @@ -24,13 +24,14 @@ #include #include #include +#include #include #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN enum client_hs_state_t { state_read_hello_retry_request = 0, @@ -40,6 +41,7 @@ enum client_hs_state_t { state_read_certificate_request, state_read_server_certificate, state_read_server_certificate_verify, + state_server_certificate_reverify, state_read_server_finished, state_send_end_of_early_data, state_send_client_certificate, @@ -157,21 +159,23 @@ static enum ssl_hs_wait_t do_read_hello_retry_request(SSL_HANDSHAKE *hs) { } // The group must be supported. - if (!tls1_check_group_id(ssl, group_id)) { + if (!tls1_check_group_id(hs, group_id)) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); return ssl_hs_error; } - // Check that the HelloRetryRequest does not request the key share that - // was provided in the initial ClientHello. - if (hs->key_share->GroupID() == group_id) { + // Check that the HelloRetryRequest does not request a key share that was + // provided in the initial ClientHello. + if (hs->key_shares[0]->GroupID() == group_id || + (hs->key_shares[1] && hs->key_shares[1]->GroupID() == group_id)) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); return ssl_hs_error; } - hs->key_share.reset(); + hs->key_shares[0].reset(); + hs->key_shares[1].reset(); hs->retry_group = group_id; } @@ -180,10 +184,11 @@ static enum ssl_hs_wait_t do_read_hello_retry_request(SSL_HANDSHAKE *hs) { } ssl->method->next_message(ssl); - hs->received_hello_retry_request = true; + ssl->s3->used_hello_retry_request = true; hs->tls13_state = state_send_second_client_hello; // 0-RTT is rejected if we receive a HelloRetryRequest. if (hs->in_early_data) { + ssl->s3->early_data_reason = ssl_early_data_hello_retry_request; return ssl_hs_early_data_rejected; } return ssl_hs_ok; @@ -264,8 +269,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { } // Check that the cipher matches the one in the HelloRetryRequest. - if (hs->received_hello_retry_request && - hs->new_cipher != cipher) { + if (ssl->s3->used_hello_retry_request && hs->new_cipher != cipher) { OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CIPHER_RETURNED); ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); return ssl_hs_error; @@ -290,6 +294,16 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } + // Recheck supported_versions, in case this is the second ServerHello. + uint16_t version; + if (!have_supported_versions || + !CBS_get_u16(&supported_versions, &version) || + version != ssl->version) { + OPENSSL_PUT_ERROR(SSL, SSL_R_SECOND_SERVERHELLO_VERSION_MISMATCH); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + alert = SSL_AD_DECODE_ERROR; if (have_pre_shared_key) { if (ssl->session == NULL) { @@ -316,7 +330,7 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (!ssl_session_is_context_valid(ssl, ssl->session)) { + if (!ssl_session_is_context_valid(hs, ssl->session.get())) { // This is actually a client application bug. OPENSSL_PUT_ERROR(SSL, SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT); @@ -326,7 +340,8 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { ssl->s3->session_reused = true; // Only authentication information carries over in TLS 1.3. - hs->new_session = SSL_SESSION_dup(ssl->session, SSL_SESSION_DUP_AUTH_ONLY); + hs->new_session = + SSL_SESSION_dup(ssl->session.get(), SSL_SESSION_DUP_AUTH_ONLY); if (!hs->new_session) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); return ssl_hs_error; @@ -349,11 +364,12 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { // Set up the key schedule and incorporate the PSK into the running secret. if (ssl->s3->session_reused) { - if (!tls13_init_key_schedule(hs, hs->new_session->master_key, - hs->new_session->master_key_length)) { + if (!tls13_init_key_schedule( + hs, MakeConstSpan(hs->new_session->master_key, + hs->new_session->master_key_length))) { return ssl_hs_error; } - } else if (!tls13_init_key_schedule(hs, kZeroes, hash_len)) { + } else if (!tls13_init_key_schedule(hs, MakeConstSpan(kZeroes, hash_len))) { return ssl_hs_error; } @@ -373,19 +389,19 @@ static enum ssl_hs_wait_t do_read_server_hello(SSL_HANDSHAKE *hs) { return ssl_hs_error; } - if (!tls13_advance_key_schedule(hs, dhe_secret.data(), dhe_secret.size()) || + if (!tls13_advance_key_schedule(hs, dhe_secret) || !ssl_hash_message(hs, msg) || !tls13_derive_handshake_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_open, hs->server_handshake_secret, - hs->hash_len)) { + !tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->server_handshake_secret())) { return ssl_hs_error; } if (!hs->early_data_offered) { // If not sending early data, set client traffic keys now so that alerts are // encrypted. - if (!tls13_set_traffic_key(ssl, evp_aead_seal, hs->client_handshake_secret, - hs->hash_len)) { + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { return ssl_hs_error; } } @@ -417,26 +433,19 @@ static enum ssl_hs_wait_t do_read_encrypted_extensions(SSL_HANDSHAKE *hs) { } // Store the negotiated ALPN in the session. - if (!ssl->s3->alpn_selected.empty()) { - hs->new_session->early_alpn = (uint8_t *)BUF_memdup( - ssl->s3->alpn_selected.data(), ssl->s3->alpn_selected.size()); - if (hs->new_session->early_alpn == NULL) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - hs->new_session->early_alpn_len = ssl->s3->alpn_selected.size(); + if (!hs->new_session->early_alpn.CopyFrom(ssl->s3->alpn_selected)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; } if (ssl->s3->early_data_accepted) { if (hs->early_session->cipher != hs->new_session->cipher || - MakeConstSpan(hs->early_session->early_alpn, - hs->early_session->early_alpn_len) != + MakeConstSpan(hs->early_session->early_alpn) != ssl->s3->alpn_selected) { OPENSSL_PUT_ERROR(SSL, SSL_R_ALPN_MISMATCH_ON_EARLY_DATA); return ssl_hs_error; } - if (ssl->s3->tlsext_channel_id_valid || hs->received_custom_extension || - ssl->token_binding_negotiated) { + if (ssl->s3->channel_id_valid || ssl->s3->token_binding_negotiated) { OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION_ON_EARLY_DATA); return ssl_hs_error; } @@ -458,6 +467,10 @@ static enum ssl_hs_wait_t do_read_certificate_request(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // CertificateRequest may only be sent in non-resumption handshakes. if (ssl->s3->session_reused) { + if (ssl->ctx->reverify_on_resume && !ssl->s3->early_data_accepted) { + hs->tls13_state = state_server_certificate_reverify; + return ssl_hs_ok; + } hs->tls13_state = state_read_server_finished; return ssl_hs_ok; } @@ -495,7 +508,6 @@ static enum ssl_hs_wait_t do_read_certificate_request(SSL_HANDSHAKE *hs) { !have_sigalgs || !CBS_get_u16_length_prefixed(&sigalgs, &supported_signature_algorithms) || - CBS_len(&supported_signature_algorithms) == 0 || !tls1_parse_peer_sigalgs(hs, &supported_signature_algorithms)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); @@ -535,8 +547,13 @@ static enum ssl_hs_wait_t do_read_server_certificate(SSL_HANDSHAKE *hs) { if (!ssl->method->get_message(ssl, &msg)) { return ssl_hs_read_message; } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE) || - !tls13_process_certificate(hs, msg, 0 /* certificate required */) || + + if (msg.type != SSL3_MT_COMPRESSED_CERTIFICATE && + !ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE)) { + return ssl_hs_error; + } + + if (!tls13_process_certificate(hs, msg, false /* certificate required */) || !ssl_hash_message(hs, msg)) { return ssl_hs_error; } @@ -574,6 +591,21 @@ static enum ssl_hs_wait_t do_read_server_certificate_verify( return ssl_hs_ok; } +static enum ssl_hs_wait_t do_server_certificate_reverify( + SSL_HANDSHAKE *hs) { + switch (ssl_reverify_peer_cert(hs, /*send_alert=*/true)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->tls13_state = state_server_certificate_reverify; + return ssl_hs_certificate_verify; + } + hs->tls13_state = state_read_server_finished; + return ssl_hs_ok; +} + static enum ssl_hs_wait_t do_read_server_finished(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; SSLMessage msg; @@ -581,10 +613,11 @@ static enum ssl_hs_wait_t do_read_server_finished(SSL_HANDSHAKE *hs) { return ssl_hs_read_message; } if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || - !tls13_process_finished(hs, msg, 0 /* don't use saved value */) || + !tls13_process_finished(hs, msg, false /* don't use saved value */) || !ssl_hash_message(hs, msg) || // Update the secret to the master secret and derive traffic keys. - !tls13_advance_key_schedule(hs, kZeroes, hs->hash_len) || + !tls13_advance_key_schedule( + hs, MakeConstSpan(kZeroes, hs->transcript.DigestLen())) || !tls13_derive_application_secrets(hs)) { return ssl_hs_error; } @@ -599,18 +632,22 @@ static enum ssl_hs_wait_t do_send_end_of_early_data(SSL_HANDSHAKE *hs) { if (ssl->s3->early_data_accepted) { hs->can_early_write = false; - ScopedCBB cbb; - CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_END_OF_EARLY_DATA) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; + // QUIC omits the EndOfEarlyData message. See draft-ietf-quic-tls-22, + // section 8.3. + if (ssl->quic_method == nullptr) { + ScopedCBB cbb; + CBB body; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_END_OF_EARLY_DATA) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } } } if (hs->early_data_offered) { - if (!tls13_set_traffic_key(ssl, evp_aead_seal, hs->client_handshake_secret, - hs->hash_len)) { + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_seal, + hs->client_handshake_secret())) { return ssl_hs_error; } } @@ -629,8 +666,8 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } // Call cert_cb to update the certificate. - if (ssl->cert->cert_cb != NULL) { - int rv = ssl->cert->cert_cb(ssl, ssl->cert->cert_cb_arg); + if (hs->config->cert->cert_cb != NULL) { + int rv = hs->config->cert->cert_cb(ssl, hs->config->cert->cert_cb_arg); if (rv == 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_CB_ERROR); @@ -652,9 +689,8 @@ static enum ssl_hs_wait_t do_send_client_certificate(SSL_HANDSHAKE *hs) { } static enum ssl_hs_wait_t do_send_client_certificate_verify(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; // Don't send CertificateVerify if there is no certificate. - if (!ssl_has_certificate(ssl)) { + if (!ssl_has_certificate(hs)) { hs->tls13_state = state_complete_second_flight; return ssl_hs_ok; } @@ -680,13 +716,13 @@ static enum ssl_hs_wait_t do_complete_second_flight(SSL_HANDSHAKE *hs) { SSL *const ssl = hs->ssl; // Send a Channel ID assertion if necessary. - if (ssl->s3->tlsext_channel_id_valid) { - if (!ssl_do_channel_id_callback(ssl)) { + if (ssl->s3->channel_id_valid) { + if (!ssl_do_channel_id_callback(hs)) { hs->tls13_state = state_complete_second_flight; return ssl_hs_error; } - if (ssl->tlsext_channel_id_private == NULL) { + if (hs->config->channel_id_private == NULL) { return ssl_hs_channel_id_lookup; } @@ -705,10 +741,10 @@ static enum ssl_hs_wait_t do_complete_second_flight(SSL_HANDSHAKE *hs) { } // Derive the final keys and enable them. - if (!tls13_set_traffic_key(ssl, evp_aead_open, hs->server_traffic_secret_0, - hs->hash_len) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->client_traffic_secret_0, - hs->hash_len) || + if (!tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_open, + hs->server_traffic_secret_0()) || + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_seal, + hs->client_traffic_secret_0()) || !tls13_derive_resumption_secret(hs)) { return ssl_hs_error; } @@ -744,6 +780,9 @@ enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs) { case state_read_server_certificate_verify: ret = do_read_server_certificate_verify(hs); break; + case state_server_certificate_reverify: + ret = do_server_certificate_reverify(hs); + break; case state_read_server_finished: ret = do_read_server_finished(hs); break; @@ -794,6 +833,8 @@ const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS 1.3 client read_server_certificate"; case state_read_server_certificate_verify: return "TLS 1.3 client read_server_certificate_verify"; + case state_server_certificate_reverify: + return "TLS 1.3 client server_certificate_reverify"; case state_read_server_finished: return "TLS 1.3 client read_server_finished"; case state_send_end_of_early_data: @@ -811,18 +852,18 @@ const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs) { return "TLS 1.3 client unknown"; } -int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { +bool tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { if (ssl->s3->write_shutdown != ssl_shutdown_none) { // Ignore tickets on shutdown. Callers tend to indiscriminately call // |SSL_shutdown| before destroying an |SSL|, at which point calling the new // session callback may be confusing. - return 1; + return true; } UniquePtr session = SSL_SESSION_dup( ssl->s3->established_session.get(), SSL_SESSION_INCLUDE_NONAUTH); if (!session) { - return 0; + return false; } ssl_session_rebase_time(ssl, session.get()); @@ -833,12 +874,12 @@ int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { !CBS_get_u32(&body, &session->ticket_age_add) || !CBS_get_u8_length_prefixed(&body, &ticket_nonce) || !CBS_get_u16_length_prefixed(&body, &ticket) || - !CBS_stow(&ticket, &session->tlsext_tick, &session->tlsext_ticklen) || + !session->ticket.CopyFrom(ticket) || !CBS_get_u16_length_prefixed(&body, &extensions) || CBS_len(&body) != 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; + return false; } // Cap the renewable lifetime by the server advertised value. This avoids @@ -848,14 +889,14 @@ int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { } if (!tls13_derive_session_psk(session.get(), ticket_nonce)) { - return 0; + return false; } // Parse out the extensions. - bool have_early_data_info = false; - CBS early_data_info; + bool have_early_data = false; + CBS early_data; const SSL_EXTENSION_TYPE ext_types[] = { - {TLSEXT_TYPE_early_data, &have_early_data_info, &early_data_info}, + {TLSEXT_TYPE_early_data, &have_early_data, &early_data}, }; uint8_t alert = SSL_AD_DECODE_ERROR; @@ -863,29 +904,43 @@ int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg) { OPENSSL_ARRAY_SIZE(ext_types), 1 /* ignore unknown */)) { ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; + return false; } - if (have_early_data_info && ssl->cert->enable_early_data) { - if (!CBS_get_u32(&early_data_info, &session->ticket_max_early_data) || - CBS_len(&early_data_info) != 0) { + if (have_early_data) { + if (!CBS_get_u32(&early_data, &session->ticket_max_early_data) || + CBS_len(&early_data) != 0) { ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; + return false; + } + + // QUIC does not use the max_early_data_size parameter and always sets it to + // a fixed value. See draft-ietf-quic-tls-22, section 4.5. + if (ssl->quic_method != nullptr && + session->ticket_max_early_data != 0xffffffff) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return false; } } - session->ticket_age_add_valid = 1; - session->not_resumable = 0; + // Generate a session ID for this session. Some callers expect all sessions to + // have a session ID. + SHA256(CBS_data(&ticket), CBS_len(&ticket), session->session_id); + session->session_id_length = SHA256_DIGEST_LENGTH; + + session->ticket_age_add_valid = true; + session->not_resumable = false; - if ((ssl->ctx->session_cache_mode & SSL_SESS_CACHE_CLIENT) && - ssl->ctx->new_session_cb != NULL && - ssl->ctx->new_session_cb(ssl, session.get())) { + if ((ssl->session_ctx->session_cache_mode & SSL_SESS_CACHE_CLIENT) && + ssl->session_ctx->new_session_cb != NULL && + ssl->session_ctx->new_session_cb(ssl, session.get())) { // |new_session_cb|'s return value signals that it took ownership. session.release(); } - return 1; + return true; } -} // namespace bssl +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc b/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc new file mode 100644 index 000000000..6b161d369 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc @@ -0,0 +1,565 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static bool init_key_schedule(SSL_HANDSHAKE *hs, uint16_t version, + const SSL_CIPHER *cipher) { + if (!hs->transcript.InitHash(version, cipher)) { + return false; + } + + // Initialize the secret to the zero key. + hs->ResizeSecrets(hs->transcript.DigestLen()); + OPENSSL_memset(hs->secret().data(), 0, hs->secret().size()); + + return true; +} + +static bool hkdf_extract_to_secret(SSL_HANDSHAKE *hs, Span in) { + size_t len; + if (!HKDF_extract(hs->secret().data(), &len, hs->transcript.Digest(), + in.data(), in.size(), hs->secret().data(), + hs->secret().size())) { + return false; + } + assert(len == hs->secret().size()); + return true; +} + +bool tls13_init_key_schedule(SSL_HANDSHAKE *hs, Span psk) { + if (!init_key_schedule(hs, ssl_protocol_version(hs->ssl), hs->new_cipher)) { + return false; + } + + // Handback includes the whole handshake transcript, so we cannot free the + // transcript buffer in the handback case. + if (!hs->handback) { + hs->transcript.FreeBuffer(); + } + return hkdf_extract_to_secret(hs, psk); +} + +bool tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, Span psk) { + SSL *const ssl = hs->ssl; + return init_key_schedule(hs, ssl_session_protocol_version(ssl->session.get()), + ssl->session->cipher) && + hkdf_extract_to_secret(hs, psk); +} + +static Span label_to_span(const char *label) { + return MakeConstSpan(label, strlen(label)); +} + +static bool hkdf_expand_label(Span out, const EVP_MD *digest, + Span secret, + Span label, + Span hash) { + Span protocol_label = label_to_span("tls13 "); + ScopedCBB cbb; + CBB child; + Array hkdf_label; + if (!CBB_init(cbb.get(), 2 + 1 + protocol_label.size() + label.size() + 1 + + hash.size()) || + !CBB_add_u16(cbb.get(), out.size()) || + !CBB_add_u8_length_prefixed(cbb.get(), &child) || + !CBB_add_bytes(&child, + reinterpret_cast(protocol_label.data()), + protocol_label.size()) || + !CBB_add_bytes(&child, reinterpret_cast(label.data()), + label.size()) || + !CBB_add_u8_length_prefixed(cbb.get(), &child) || + !CBB_add_bytes(&child, hash.data(), hash.size()) || + !CBBFinishArray(cbb.get(), &hkdf_label)) { + return false; + } + + return HKDF_expand(out.data(), out.size(), digest, secret.data(), + secret.size(), hkdf_label.data(), hkdf_label.size()); +} + +static const char kTLS13LabelDerived[] = "derived"; + +bool tls13_advance_key_schedule(SSL_HANDSHAKE *hs, Span in) { + uint8_t derive_context[EVP_MAX_MD_SIZE]; + unsigned derive_context_len; + return EVP_Digest(nullptr, 0, derive_context, &derive_context_len, + hs->transcript.Digest(), nullptr) && + hkdf_expand_label(hs->secret(), hs->transcript.Digest(), hs->secret(), + label_to_span(kTLS13LabelDerived), + MakeConstSpan(derive_context, derive_context_len)) && + hkdf_extract_to_secret(hs, in); +} + +// derive_secret derives a secret of length |out.size()| and writes the result +// in |out| with the given label, the current base secret, and the most +// recently-saved handshake context. It returns true on success and false on +// error. +static bool derive_secret(SSL_HANDSHAKE *hs, Span out, + Span label) { + uint8_t context_hash[EVP_MAX_MD_SIZE]; + size_t context_hash_len; + if (!hs->transcript.GetHash(context_hash, &context_hash_len)) { + return false; + } + + return hkdf_expand_label(out, hs->transcript.Digest(), hs->secret(), label, + MakeConstSpan(context_hash, context_hash_len)); +} + +bool tls13_set_traffic_key(SSL *ssl, enum ssl_encryption_level_t level, + enum evp_aead_direction_t direction, + Span traffic_secret) { + const SSL_SESSION *session = SSL_get_session(ssl); + uint16_t version = ssl_session_protocol_version(session); + + UniquePtr traffic_aead; + if (ssl->quic_method == nullptr) { + // Look up cipher suite properties. + const EVP_AEAD *aead; + size_t discard; + if (!ssl_cipher_get_evp_aead(&aead, &discard, &discard, session->cipher, + version, SSL_is_dtls(ssl))) { + return false; + } + + const EVP_MD *digest = ssl_session_get_digest(session); + + // Derive the key. + size_t key_len = EVP_AEAD_key_length(aead); + uint8_t key_buf[EVP_AEAD_MAX_KEY_LENGTH]; + auto key = MakeSpan(key_buf, key_len); + if (!hkdf_expand_label(key, digest, traffic_secret, label_to_span("key"), + {})) { + return false; + } + + // Derive the IV. + size_t iv_len = EVP_AEAD_nonce_length(aead); + uint8_t iv_buf[EVP_AEAD_MAX_NONCE_LENGTH]; + auto iv = MakeSpan(iv_buf, iv_len); + if (!hkdf_expand_label(iv, digest, traffic_secret, label_to_span("iv"), + {})) { + return false; + } + + + traffic_aead = SSLAEADContext::Create(direction, session->ssl_version, + SSL_is_dtls(ssl), session->cipher, + key, Span(), iv); + } else { + // Install a placeholder SSLAEADContext so that SSL accessors work. The + // encryption itself will be handled by the SSL_QUIC_METHOD. + traffic_aead = + SSLAEADContext::CreatePlaceholderForQUIC(version, session->cipher); + // QUIC never installs early data keys at the TLS layer. + assert(level != ssl_encryption_early_data); + } + + if (!traffic_aead) { + return false; + } + + if (direction == evp_aead_open) { + if (!ssl->method->set_read_state(ssl, std::move(traffic_aead))) { + return false; + } + } else { + if (!ssl->method->set_write_state(ssl, std::move(traffic_aead))) { + return false; + } + } + + // Save the traffic secret. + if (traffic_secret.size() > + OPENSSL_ARRAY_SIZE(ssl->s3->read_traffic_secret) || + traffic_secret.size() > + OPENSSL_ARRAY_SIZE(ssl->s3->write_traffic_secret)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + if (direction == evp_aead_open) { + OPENSSL_memmove(ssl->s3->read_traffic_secret, traffic_secret.data(), + traffic_secret.size()); + ssl->s3->read_traffic_secret_len = traffic_secret.size(); + ssl->s3->read_level = level; + } else { + OPENSSL_memmove(ssl->s3->write_traffic_secret, traffic_secret.data(), + traffic_secret.size()); + ssl->s3->write_traffic_secret_len = traffic_secret.size(); + ssl->s3->write_level = level; + } + + return true; +} + + +static const char kTLS13LabelExporter[] = "exp master"; + +static const char kTLS13LabelClientEarlyTraffic[] = "c e traffic"; +static const char kTLS13LabelClientHandshakeTraffic[] = "c hs traffic"; +static const char kTLS13LabelServerHandshakeTraffic[] = "s hs traffic"; +static const char kTLS13LabelClientApplicationTraffic[] = "c ap traffic"; +static const char kTLS13LabelServerApplicationTraffic[] = "s ap traffic"; + +bool tls13_derive_early_secret(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!derive_secret(hs, hs->early_traffic_secret(), + label_to_span(kTLS13LabelClientEarlyTraffic)) || + !ssl_log_secret(ssl, "CLIENT_EARLY_TRAFFIC_SECRET", + hs->early_traffic_secret())) { + return false; + } + return true; +} + +bool tls13_set_early_secret_for_quic(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (ssl->quic_method == nullptr) { + return true; + } + if (ssl->server) { + if (!ssl->quic_method->set_encryption_secrets( + ssl, ssl_encryption_early_data, hs->early_traffic_secret().data(), + /*write_secret=*/nullptr, hs->early_traffic_secret().size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return false; + } + } else { + if (!ssl->quic_method->set_encryption_secrets( + ssl, ssl_encryption_early_data, /*read_secret=*/nullptr, + hs->early_traffic_secret().data(), + hs->early_traffic_secret().size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return false; + } + } + return true; +} + +static bool set_quic_secrets(SSL_HANDSHAKE *hs, ssl_encryption_level_t level, + Span client_write_secret, + Span server_write_secret) { + SSL *const ssl = hs->ssl; + assert(client_write_secret.size() == server_write_secret.size()); + if (ssl->quic_method == nullptr) { + return true; + } + if (!ssl->server) { + std::swap(client_write_secret, server_write_secret); + } + return ssl->quic_method->set_encryption_secrets( + ssl, level, + /*read_secret=*/client_write_secret.data(), + /*write_secret=*/server_write_secret.data(), client_write_secret.size()); +} + +bool tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!derive_secret(hs, hs->client_handshake_secret(), + label_to_span(kTLS13LabelClientHandshakeTraffic)) || + !ssl_log_secret(ssl, "CLIENT_HANDSHAKE_TRAFFIC_SECRET", + hs->client_handshake_secret()) || + !derive_secret(hs, hs->server_handshake_secret(), + label_to_span(kTLS13LabelServerHandshakeTraffic)) || + !ssl_log_secret(ssl, "SERVER_HANDSHAKE_TRAFFIC_SECRET", + hs->server_handshake_secret()) || + !set_quic_secrets(hs, ssl_encryption_handshake, + hs->client_handshake_secret(), + hs->server_handshake_secret())) { + return false; + } + + return true; +} + +bool tls13_derive_application_secrets(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + ssl->s3->exporter_secret_len = hs->transcript.DigestLen(); + if (!derive_secret(hs, hs->client_traffic_secret_0(), + label_to_span(kTLS13LabelClientApplicationTraffic)) || + !ssl_log_secret(ssl, "CLIENT_TRAFFIC_SECRET_0", + hs->client_traffic_secret_0()) || + !derive_secret(hs, hs->server_traffic_secret_0(), + label_to_span(kTLS13LabelServerApplicationTraffic)) || + !ssl_log_secret(ssl, "SERVER_TRAFFIC_SECRET_0", + hs->server_traffic_secret_0()) || + !derive_secret( + hs, MakeSpan(ssl->s3->exporter_secret, ssl->s3->exporter_secret_len), + label_to_span(kTLS13LabelExporter)) || + !ssl_log_secret(ssl, "EXPORTER_SECRET", + MakeConstSpan(ssl->s3->exporter_secret, + ssl->s3->exporter_secret_len)) || + !set_quic_secrets(hs, ssl_encryption_application, + hs->client_traffic_secret_0(), + hs->server_traffic_secret_0())) { + return false; + } + + return true; +} + +static const char kTLS13LabelApplicationTraffic[] = "traffic upd"; + +bool tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction) { + Span secret; + if (direction == evp_aead_open) { + secret = MakeSpan(ssl->s3->read_traffic_secret, + ssl->s3->read_traffic_secret_len); + } else { + secret = MakeSpan(ssl->s3->write_traffic_secret, + ssl->s3->write_traffic_secret_len); + } + + const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); + return hkdf_expand_label(secret, digest, secret, + label_to_span(kTLS13LabelApplicationTraffic), {}) && + tls13_set_traffic_key(ssl, ssl_encryption_application, direction, + secret); +} + +static const char kTLS13LabelResumption[] = "res master"; + +bool tls13_derive_resumption_secret(SSL_HANDSHAKE *hs) { + if (hs->transcript.DigestLen() > SSL_MAX_MASTER_KEY_LENGTH) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + hs->new_session->master_key_length = hs->transcript.DigestLen(); + return derive_secret( + hs, + MakeSpan(hs->new_session->master_key, hs->new_session->master_key_length), + label_to_span(kTLS13LabelResumption)); +} + +static const char kTLS13LabelFinished[] = "finished"; + +// tls13_verify_data sets |out| to be the HMAC of |context| using a derived +// Finished key for both Finished messages and the PSK binder. |out| must have +// space available for |EVP_MAX_MD_SIZE| bytes. +static bool tls13_verify_data(uint8_t *out, size_t *out_len, + const EVP_MD *digest, uint16_t version, + Span secret, + Span context) { + uint8_t key_buf[EVP_MAX_MD_SIZE]; + auto key = MakeSpan(key_buf, EVP_MD_size(digest)); + unsigned len; + if (!hkdf_expand_label(key, digest, secret, + label_to_span(kTLS13LabelFinished), {}) || + HMAC(digest, key.data(), key.size(), context.data(), context.size(), out, + &len) == nullptr) { + return false; + } + *out_len = len; + return true; +} + +bool tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, + bool is_server) { + Span traffic_secret = + is_server ? hs->server_handshake_secret() : hs->client_handshake_secret(); + + uint8_t context_hash[EVP_MAX_MD_SIZE]; + size_t context_hash_len; + if (!hs->transcript.GetHash(context_hash, &context_hash_len) || + !tls13_verify_data(out, out_len, hs->transcript.Digest(), + hs->ssl->version, traffic_secret, + MakeConstSpan(context_hash, context_hash_len))) { + return 0; + } + return 1; +} + +static const char kTLS13LabelResumptionPSK[] = "resumption"; + +bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce) { + const EVP_MD *digest = ssl_session_get_digest(session); + // The session initially stores the resumption_master_secret, which we + // override with the PSK. + auto session_key = MakeSpan(session->master_key, session->master_key_length); + return hkdf_expand_label(session_key, digest, session_key, + label_to_span(kTLS13LabelResumptionPSK), nonce); +} + +static const char kTLS13LabelExportKeying[] = "exporter"; + +bool tls13_export_keying_material(SSL *ssl, Span out, + Span secret, + Span label, + Span context) { + if (secret.empty()) { + assert(0); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); + + uint8_t hash_buf[EVP_MAX_MD_SIZE]; + uint8_t export_context_buf[EVP_MAX_MD_SIZE]; + unsigned hash_len; + unsigned export_context_len; + if (!EVP_Digest(context.data(), context.size(), hash_buf, &hash_len, digest, + nullptr) || + !EVP_Digest(nullptr, 0, export_context_buf, &export_context_len, digest, + nullptr)) { + return false; + } + + auto hash = MakeConstSpan(hash_buf, hash_len); + auto export_context = MakeConstSpan(export_context_buf, export_context_len); + uint8_t derived_secret_buf[EVP_MAX_MD_SIZE]; + auto derived_secret = MakeSpan(derived_secret_buf, EVP_MD_size(digest)); + return hkdf_expand_label(derived_secret, digest, secret, label, + export_context) && + hkdf_expand_label(out, digest, derived_secret, + label_to_span(kTLS13LabelExportKeying), hash); +} + +static const char kTLS13LabelPSKBinder[] = "res binder"; + +static bool tls13_psk_binder(uint8_t *out, size_t *out_len, uint16_t version, + const EVP_MD *digest, Span psk, + Span context) { + uint8_t binder_context[EVP_MAX_MD_SIZE]; + unsigned binder_context_len; + if (!EVP_Digest(NULL, 0, binder_context, &binder_context_len, digest, NULL)) { + return false; + } + + uint8_t early_secret[EVP_MAX_MD_SIZE] = {0}; + size_t early_secret_len; + if (!HKDF_extract(early_secret, &early_secret_len, digest, psk.data(), + psk.size(), NULL, 0)) { + return false; + } + + uint8_t binder_key_buf[EVP_MAX_MD_SIZE] = {0}; + auto binder_key = MakeSpan(binder_key_buf, EVP_MD_size(digest)); + if (!hkdf_expand_label(binder_key, digest, + MakeConstSpan(early_secret, early_secret_len), + label_to_span(kTLS13LabelPSKBinder), + MakeConstSpan(binder_context, binder_context_len)) || + !tls13_verify_data(out, out_len, digest, version, binder_key, context)) { + return false; + } + + assert(*out_len == EVP_MD_size(digest)); + return true; +} + +static bool hash_transcript_and_truncated_client_hello( + SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, const EVP_MD *digest, + Span client_hello, size_t binders_len) { + // Truncate the ClientHello. + if (binders_len + 2 < binders_len || client_hello.size() < binders_len + 2) { + return false; + } + client_hello = client_hello.subspan(0, client_hello.size() - binders_len - 2); + + ScopedEVP_MD_CTX ctx; + unsigned len; + if (!hs->transcript.CopyToHashContext(ctx.get(), digest) || + !EVP_DigestUpdate(ctx.get(), client_hello.data(), client_hello.size()) || + !EVP_DigestFinal_ex(ctx.get(), out, &len)) { + return false; + } + + *out_len = len; + return true; +} + +bool tls13_write_psk_binder(SSL_HANDSHAKE *hs, Span msg) { + SSL *const ssl = hs->ssl; + const EVP_MD *digest = ssl_session_get_digest(ssl->session.get()); + size_t hash_len = EVP_MD_size(digest); + + ScopedEVP_MD_CTX ctx; + uint8_t context[EVP_MAX_MD_SIZE]; + size_t context_len; + uint8_t verify_data[EVP_MAX_MD_SIZE]; + size_t verify_data_len; + if (!hash_transcript_and_truncated_client_hello( + hs, context, &context_len, digest, msg, + 1 /* length prefix */ + hash_len) || + !tls13_psk_binder(verify_data, &verify_data_len, + ssl->session->ssl_version, digest, + MakeConstSpan(ssl->session->master_key, + ssl->session->master_key_length), + MakeConstSpan(context, context_len)) || + verify_data_len != hash_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + OPENSSL_memcpy(msg.data() + msg.size() - verify_data_len, verify_data, + verify_data_len); + return true; +} + +bool tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, + const SSLMessage &msg, CBS *binders) { + uint8_t context[EVP_MAX_MD_SIZE]; + size_t context_len; + uint8_t verify_data[EVP_MAX_MD_SIZE]; + size_t verify_data_len; + CBS binder; + if (!hash_transcript_and_truncated_client_hello(hs, context, &context_len, + hs->transcript.Digest(), + msg.raw, CBS_len(binders)) || + !tls13_psk_binder( + verify_data, &verify_data_len, hs->ssl->version, + hs->transcript.Digest(), + MakeConstSpan(session->master_key, session->master_key_length), + MakeConstSpan(context, context_len)) || + // We only consider the first PSK, so compare against the first binder. + !CBS_get_u8_length_prefixed(binders, &binder)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + bool binder_ok = + CBS_len(&binder) == verify_data_len && + CRYPTO_memcmp(CBS_data(&binder), verify_data, verify_data_len) == 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + binder_ok = true; +#endif + if (!binder_ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); + return false; + } + + return true; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc.grpc_back new file mode 100644 index 000000000..1f6ff6443 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_enc.cc.grpc_back @@ -0,0 +1,565 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static bool init_key_schedule(SSL_HANDSHAKE *hs, uint16_t version, + const SSL_CIPHER *cipher) { + if (!hs->transcript.InitHash(version, cipher)) { + return false; + } + + // Initialize the secret to the zero key. + hs->ResizeSecrets(hs->transcript.DigestLen()); + OPENSSL_memset(hs->secret().data(), 0, hs->secret().size()); + + return true; +} + +static bool hkdf_extract_to_secret(SSL_HANDSHAKE *hs, Span in) { + size_t len; + if (!HKDF_extract(hs->secret().data(), &len, hs->transcript.Digest(), + in.data(), in.size(), hs->secret().data(), + hs->secret().size())) { + return false; + } + assert(len == hs->secret().size()); + return true; +} + +bool tls13_init_key_schedule(SSL_HANDSHAKE *hs, Span psk) { + if (!init_key_schedule(hs, ssl_protocol_version(hs->ssl), hs->new_cipher)) { + return false; + } + + // Handback includes the whole handshake transcript, so we cannot free the + // transcript buffer in the handback case. + if (!hs->handback) { + hs->transcript.FreeBuffer(); + } + return hkdf_extract_to_secret(hs, psk); +} + +bool tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, Span psk) { + SSL *const ssl = hs->ssl; + return init_key_schedule(hs, ssl_session_protocol_version(ssl->session.get()), + ssl->session->cipher) && + hkdf_extract_to_secret(hs, psk); +} + +static Span label_to_span(const char *label) { + return MakeConstSpan(label, strlen(label)); +} + +static bool hkdf_expand_label(Span out, const EVP_MD *digest, + Span secret, + Span label, + Span hash) { + Span protocol_label = label_to_span("tls13 "); + ScopedCBB cbb; + CBB child; + Array hkdf_label; + if (!CBB_init(cbb.get(), 2 + 1 + protocol_label.size() + label.size() + 1 + + hash.size()) || + !CBB_add_u16(cbb.get(), out.size()) || + !CBB_add_u8_length_prefixed(cbb.get(), &child) || + !CBB_add_bytes(&child, + reinterpret_cast(protocol_label.data()), + protocol_label.size()) || + !CBB_add_bytes(&child, reinterpret_cast(label.data()), + label.size()) || + !CBB_add_u8_length_prefixed(cbb.get(), &child) || + !CBB_add_bytes(&child, hash.data(), hash.size()) || + !CBBFinishArray(cbb.get(), &hkdf_label)) { + return false; + } + + return HKDF_expand(out.data(), out.size(), digest, secret.data(), + secret.size(), hkdf_label.data(), hkdf_label.size()); +} + +static const char kTLS13LabelDerived[] = "derived"; + +bool tls13_advance_key_schedule(SSL_HANDSHAKE *hs, Span in) { + uint8_t derive_context[EVP_MAX_MD_SIZE]; + unsigned derive_context_len; + return EVP_Digest(nullptr, 0, derive_context, &derive_context_len, + hs->transcript.Digest(), nullptr) && + hkdf_expand_label(hs->secret(), hs->transcript.Digest(), hs->secret(), + label_to_span(kTLS13LabelDerived), + MakeConstSpan(derive_context, derive_context_len)) && + hkdf_extract_to_secret(hs, in); +} + +// derive_secret derives a secret of length |out.size()| and writes the result +// in |out| with the given label, the current base secret, and the most +// recently-saved handshake context. It returns true on success and false on +// error. +static bool derive_secret(SSL_HANDSHAKE *hs, Span out, + Span label) { + uint8_t context_hash[EVP_MAX_MD_SIZE]; + size_t context_hash_len; + if (!hs->transcript.GetHash(context_hash, &context_hash_len)) { + return false; + } + + return hkdf_expand_label(out, hs->transcript.Digest(), hs->secret(), label, + MakeConstSpan(context_hash, context_hash_len)); +} + +bool tls13_set_traffic_key(SSL *ssl, enum ssl_encryption_level_t level, + enum evp_aead_direction_t direction, + Span traffic_secret) { + const SSL_SESSION *session = SSL_get_session(ssl); + uint16_t version = ssl_session_protocol_version(session); + + UniquePtr traffic_aead; + if (ssl->quic_method == nullptr) { + // Look up cipher suite properties. + const EVP_AEAD *aead; + size_t discard; + if (!ssl_cipher_get_evp_aead(&aead, &discard, &discard, session->cipher, + version, SSL_is_dtls(ssl))) { + return false; + } + + const EVP_MD *digest = ssl_session_get_digest(session); + + // Derive the key. + size_t key_len = EVP_AEAD_key_length(aead); + uint8_t key_buf[EVP_AEAD_MAX_KEY_LENGTH]; + auto key = MakeSpan(key_buf, key_len); + if (!hkdf_expand_label(key, digest, traffic_secret, label_to_span("key"), + {})) { + return false; + } + + // Derive the IV. + size_t iv_len = EVP_AEAD_nonce_length(aead); + uint8_t iv_buf[EVP_AEAD_MAX_NONCE_LENGTH]; + auto iv = MakeSpan(iv_buf, iv_len); + if (!hkdf_expand_label(iv, digest, traffic_secret, label_to_span("iv"), + {})) { + return false; + } + + + traffic_aead = SSLAEADContext::Create(direction, session->ssl_version, + SSL_is_dtls(ssl), session->cipher, + key, Span(), iv); + } else { + // Install a placeholder SSLAEADContext so that SSL accessors work. The + // encryption itself will be handled by the SSL_QUIC_METHOD. + traffic_aead = + SSLAEADContext::CreatePlaceholderForQUIC(version, session->cipher); + // QUIC never installs early data keys at the TLS layer. + assert(level != ssl_encryption_early_data); + } + + if (!traffic_aead) { + return false; + } + + if (direction == evp_aead_open) { + if (!ssl->method->set_read_state(ssl, std::move(traffic_aead))) { + return false; + } + } else { + if (!ssl->method->set_write_state(ssl, std::move(traffic_aead))) { + return false; + } + } + + // Save the traffic secret. + if (traffic_secret.size() > + OPENSSL_ARRAY_SIZE(ssl->s3->read_traffic_secret) || + traffic_secret.size() > + OPENSSL_ARRAY_SIZE(ssl->s3->write_traffic_secret)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + if (direction == evp_aead_open) { + OPENSSL_memmove(ssl->s3->read_traffic_secret, traffic_secret.data(), + traffic_secret.size()); + ssl->s3->read_traffic_secret_len = traffic_secret.size(); + ssl->s3->read_level = level; + } else { + OPENSSL_memmove(ssl->s3->write_traffic_secret, traffic_secret.data(), + traffic_secret.size()); + ssl->s3->write_traffic_secret_len = traffic_secret.size(); + ssl->s3->write_level = level; + } + + return true; +} + + +static const char kTLS13LabelExporter[] = "exp master"; + +static const char kTLS13LabelClientEarlyTraffic[] = "c e traffic"; +static const char kTLS13LabelClientHandshakeTraffic[] = "c hs traffic"; +static const char kTLS13LabelServerHandshakeTraffic[] = "s hs traffic"; +static const char kTLS13LabelClientApplicationTraffic[] = "c ap traffic"; +static const char kTLS13LabelServerApplicationTraffic[] = "s ap traffic"; + +bool tls13_derive_early_secret(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!derive_secret(hs, hs->early_traffic_secret(), + label_to_span(kTLS13LabelClientEarlyTraffic)) || + !ssl_log_secret(ssl, "CLIENT_EARLY_TRAFFIC_SECRET", + hs->early_traffic_secret())) { + return false; + } + return true; +} + +bool tls13_set_early_secret_for_quic(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (ssl->quic_method == nullptr) { + return true; + } + if (ssl->server) { + if (!ssl->quic_method->set_encryption_secrets( + ssl, ssl_encryption_early_data, hs->early_traffic_secret().data(), + /*write_secret=*/nullptr, hs->early_traffic_secret().size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return false; + } + } else { + if (!ssl->quic_method->set_encryption_secrets( + ssl, ssl_encryption_early_data, /*read_secret=*/nullptr, + hs->early_traffic_secret().data(), + hs->early_traffic_secret().size())) { + OPENSSL_PUT_ERROR(SSL, SSL_R_QUIC_INTERNAL_ERROR); + return false; + } + } + return true; +} + +static bool set_quic_secrets(SSL_HANDSHAKE *hs, ssl_encryption_level_t level, + Span client_write_secret, + Span server_write_secret) { + SSL *const ssl = hs->ssl; + assert(client_write_secret.size() == server_write_secret.size()); + if (ssl->quic_method == nullptr) { + return true; + } + if (!ssl->server) { + std::swap(client_write_secret, server_write_secret); + } + return ssl->quic_method->set_encryption_secrets( + ssl, level, + /*read_secret=*/client_write_secret.data(), + /*write_secret=*/server_write_secret.data(), client_write_secret.size()); +} + +bool tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!derive_secret(hs, hs->client_handshake_secret(), + label_to_span(kTLS13LabelClientHandshakeTraffic)) || + !ssl_log_secret(ssl, "CLIENT_HANDSHAKE_TRAFFIC_SECRET", + hs->client_handshake_secret()) || + !derive_secret(hs, hs->server_handshake_secret(), + label_to_span(kTLS13LabelServerHandshakeTraffic)) || + !ssl_log_secret(ssl, "SERVER_HANDSHAKE_TRAFFIC_SECRET", + hs->server_handshake_secret()) || + !set_quic_secrets(hs, ssl_encryption_handshake, + hs->client_handshake_secret(), + hs->server_handshake_secret())) { + return false; + } + + return true; +} + +bool tls13_derive_application_secrets(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + ssl->s3->exporter_secret_len = hs->transcript.DigestLen(); + if (!derive_secret(hs, hs->client_traffic_secret_0(), + label_to_span(kTLS13LabelClientApplicationTraffic)) || + !ssl_log_secret(ssl, "CLIENT_TRAFFIC_SECRET_0", + hs->client_traffic_secret_0()) || + !derive_secret(hs, hs->server_traffic_secret_0(), + label_to_span(kTLS13LabelServerApplicationTraffic)) || + !ssl_log_secret(ssl, "SERVER_TRAFFIC_SECRET_0", + hs->server_traffic_secret_0()) || + !derive_secret( + hs, MakeSpan(ssl->s3->exporter_secret, ssl->s3->exporter_secret_len), + label_to_span(kTLS13LabelExporter)) || + !ssl_log_secret(ssl, "EXPORTER_SECRET", + MakeConstSpan(ssl->s3->exporter_secret, + ssl->s3->exporter_secret_len)) || + !set_quic_secrets(hs, ssl_encryption_application, + hs->client_traffic_secret_0(), + hs->server_traffic_secret_0())) { + return false; + } + + return true; +} + +static const char kTLS13LabelApplicationTraffic[] = "traffic upd"; + +bool tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction) { + Span secret; + if (direction == evp_aead_open) { + secret = MakeSpan(ssl->s3->read_traffic_secret, + ssl->s3->read_traffic_secret_len); + } else { + secret = MakeSpan(ssl->s3->write_traffic_secret, + ssl->s3->write_traffic_secret_len); + } + + const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); + return hkdf_expand_label(secret, digest, secret, + label_to_span(kTLS13LabelApplicationTraffic), {}) && + tls13_set_traffic_key(ssl, ssl_encryption_application, direction, + secret); +} + +static const char kTLS13LabelResumption[] = "res master"; + +bool tls13_derive_resumption_secret(SSL_HANDSHAKE *hs) { + if (hs->transcript.DigestLen() > SSL_MAX_MASTER_KEY_LENGTH) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + hs->new_session->master_key_length = hs->transcript.DigestLen(); + return derive_secret( + hs, + MakeSpan(hs->new_session->master_key, hs->new_session->master_key_length), + label_to_span(kTLS13LabelResumption)); +} + +static const char kTLS13LabelFinished[] = "finished"; + +// tls13_verify_data sets |out| to be the HMAC of |context| using a derived +// Finished key for both Finished messages and the PSK binder. |out| must have +// space available for |EVP_MAX_MD_SIZE| bytes. +static bool tls13_verify_data(uint8_t *out, size_t *out_len, + const EVP_MD *digest, uint16_t version, + Span secret, + Span context) { + uint8_t key_buf[EVP_MAX_MD_SIZE]; + auto key = MakeSpan(key_buf, EVP_MD_size(digest)); + unsigned len; + if (!hkdf_expand_label(key, digest, secret, + label_to_span(kTLS13LabelFinished), {}) || + HMAC(digest, key.data(), key.size(), context.data(), context.size(), out, + &len) == nullptr) { + return false; + } + *out_len = len; + return true; +} + +bool tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, + bool is_server) { + Span traffic_secret = + is_server ? hs->server_handshake_secret() : hs->client_handshake_secret(); + + uint8_t context_hash[EVP_MAX_MD_SIZE]; + size_t context_hash_len; + if (!hs->transcript.GetHash(context_hash, &context_hash_len) || + !tls13_verify_data(out, out_len, hs->transcript.Digest(), + hs->ssl->version, traffic_secret, + MakeConstSpan(context_hash, context_hash_len))) { + return 0; + } + return 1; +} + +static const char kTLS13LabelResumptionPSK[] = "resumption"; + +bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce) { + const EVP_MD *digest = ssl_session_get_digest(session); + // The session initially stores the resumption_master_secret, which we + // override with the PSK. + auto session_key = MakeSpan(session->master_key, session->master_key_length); + return hkdf_expand_label(session_key, digest, session_key, + label_to_span(kTLS13LabelResumptionPSK), nonce); +} + +static const char kTLS13LabelExportKeying[] = "exporter"; + +bool tls13_export_keying_material(SSL *ssl, Span out, + Span secret, + Span label, + Span context) { + if (secret.empty()) { + assert(0); + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); + + uint8_t hash_buf[EVP_MAX_MD_SIZE]; + uint8_t export_context_buf[EVP_MAX_MD_SIZE]; + unsigned hash_len; + unsigned export_context_len; + if (!EVP_Digest(context.data(), context.size(), hash_buf, &hash_len, digest, + nullptr) || + !EVP_Digest(nullptr, 0, export_context_buf, &export_context_len, digest, + nullptr)) { + return false; + } + + auto hash = MakeConstSpan(hash_buf, hash_len); + auto export_context = MakeConstSpan(export_context_buf, export_context_len); + uint8_t derived_secret_buf[EVP_MAX_MD_SIZE]; + auto derived_secret = MakeSpan(derived_secret_buf, EVP_MD_size(digest)); + return hkdf_expand_label(derived_secret, digest, secret, label, + export_context) && + hkdf_expand_label(out, digest, derived_secret, + label_to_span(kTLS13LabelExportKeying), hash); +} + +static const char kTLS13LabelPSKBinder[] = "res binder"; + +static bool tls13_psk_binder(uint8_t *out, size_t *out_len, uint16_t version, + const EVP_MD *digest, Span psk, + Span context) { + uint8_t binder_context[EVP_MAX_MD_SIZE]; + unsigned binder_context_len; + if (!EVP_Digest(NULL, 0, binder_context, &binder_context_len, digest, NULL)) { + return false; + } + + uint8_t early_secret[EVP_MAX_MD_SIZE] = {0}; + size_t early_secret_len; + if (!HKDF_extract(early_secret, &early_secret_len, digest, psk.data(), + psk.size(), NULL, 0)) { + return false; + } + + uint8_t binder_key_buf[EVP_MAX_MD_SIZE] = {0}; + auto binder_key = MakeSpan(binder_key_buf, EVP_MD_size(digest)); + if (!hkdf_expand_label(binder_key, digest, + MakeConstSpan(early_secret, early_secret_len), + label_to_span(kTLS13LabelPSKBinder), + MakeConstSpan(binder_context, binder_context_len)) || + !tls13_verify_data(out, out_len, digest, version, binder_key, context)) { + return false; + } + + assert(*out_len == EVP_MD_size(digest)); + return true; +} + +static bool hash_transcript_and_truncated_client_hello( + SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, const EVP_MD *digest, + Span client_hello, size_t binders_len) { + // Truncate the ClientHello. + if (binders_len + 2 < binders_len || client_hello.size() < binders_len + 2) { + return false; + } + client_hello = client_hello.subspan(0, client_hello.size() - binders_len - 2); + + ScopedEVP_MD_CTX ctx; + unsigned len; + if (!hs->transcript.CopyToHashContext(ctx.get(), digest) || + !EVP_DigestUpdate(ctx.get(), client_hello.data(), client_hello.size()) || + !EVP_DigestFinal_ex(ctx.get(), out, &len)) { + return false; + } + + *out_len = len; + return true; +} + +bool tls13_write_psk_binder(SSL_HANDSHAKE *hs, Span msg) { + SSL *const ssl = hs->ssl; + const EVP_MD *digest = ssl_session_get_digest(ssl->session.get()); + size_t hash_len = EVP_MD_size(digest); + + ScopedEVP_MD_CTX ctx; + uint8_t context[EVP_MAX_MD_SIZE]; + size_t context_len; + uint8_t verify_data[EVP_MAX_MD_SIZE]; + size_t verify_data_len; + if (!hash_transcript_and_truncated_client_hello( + hs, context, &context_len, digest, msg, + 1 /* length prefix */ + hash_len) || + !tls13_psk_binder(verify_data, &verify_data_len, + ssl->session->ssl_version, digest, + MakeConstSpan(ssl->session->master_key, + ssl->session->master_key_length), + MakeConstSpan(context, context_len)) || + verify_data_len != hash_len) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + OPENSSL_memcpy(msg.data() + msg.size() - verify_data_len, verify_data, + verify_data_len); + return true; +} + +bool tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, + const SSLMessage &msg, CBS *binders) { + uint8_t context[EVP_MAX_MD_SIZE]; + size_t context_len; + uint8_t verify_data[EVP_MAX_MD_SIZE]; + size_t verify_data_len; + CBS binder; + if (!hash_transcript_and_truncated_client_hello(hs, context, &context_len, + hs->transcript.Digest(), + msg.raw, CBS_len(binders)) || + !tls13_psk_binder( + verify_data, &verify_data_len, hs->ssl->version, + hs->transcript.Digest(), + MakeConstSpan(session->master_key, session->master_key_length), + MakeConstSpan(context, context_len)) || + // We only consider the first PSK, so compare against the first binder. + !CBS_get_u8_length_prefixed(binders, &binder)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return false; + } + + bool binder_ok = + CBS_len(&binder) == verify_data_len && + CRYPTO_memcmp(CBS_data(&binder), verify_data, verify_data_len) == 0; +#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) + binder_ok = true; +#endif + if (!binder_ok) { + OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); + return false; + } + + return true; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc b/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc new file mode 100644 index 000000000..68c092ce8 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc @@ -0,0 +1,1066 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static const uint8_t kZeroes[EVP_MAX_MD_SIZE] = {0}; + +// Allow a minute of ticket age skew in either direction. This covers +// transmission delays in ClientHello and NewSessionTicket, as well as +// drift between client and server clock rate since the ticket was issued. +// See RFC 8446, section 8.3. +static const int32_t kMaxTicketAgeSkewSeconds = 60; + +static int resolve_ecdhe_secret(SSL_HANDSHAKE *hs, bool *out_need_retry, + SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + *out_need_retry = false; + + // We only support connections that include an ECDHE key exchange. + CBS key_share; + if (!ssl_client_hello_get_extension(client_hello, &key_share, + TLSEXT_TYPE_key_share)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION); + return 0; + } + + bool found_key_share; + Array dhe_secret; + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_ext_key_share_parse_clienthello(hs, &found_key_share, &dhe_secret, + &alert, &key_share)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return 0; + } + + if (!found_key_share) { + *out_need_retry = true; + return 0; + } + + return tls13_advance_key_schedule(hs, dhe_secret); +} + +static int ssl_ext_supported_versions_add_serverhello(SSL_HANDSHAKE *hs, + CBB *out) { + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_supported_versions) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16(&contents, hs->ssl->version) || + !CBB_flush(out)) { + return 0; + } + + return 1; +} + +static const SSL_CIPHER *choose_tls13_cipher( + const SSL *ssl, const SSL_CLIENT_HELLO *client_hello, uint16_t group_id) { + CBS cipher_suites; + CBS_init(&cipher_suites, client_hello->cipher_suites, + client_hello->cipher_suites_len); + + const uint16_t version = ssl_protocol_version(ssl); + + return ssl_choose_tls13_cipher(cipher_suites, version, group_id); +} + +static bool add_new_session_tickets(SSL_HANDSHAKE *hs, bool *out_sent_tickets) { + SSL *const ssl = hs->ssl; + if (// If the client doesn't accept resumption with PSK_DHE_KE, don't send a + // session ticket. + !hs->accept_psk_mode || + // We only implement stateless resumption in TLS 1.3, so skip sending + // tickets if disabled. + (SSL_get_options(ssl) & SSL_OP_NO_TICKET)) { + *out_sent_tickets = false; + return true; + } + + // TLS 1.3 recommends single-use tickets, so issue multiple tickets in case + // the client makes several connections before getting a renewal. + static const int kNumTickets = 2; + + // Rebase the session timestamp so that it is measured from ticket + // issuance. + ssl_session_rebase_time(ssl, hs->new_session.get()); + + for (int i = 0; i < kNumTickets; i++) { + UniquePtr session( + SSL_SESSION_dup(hs->new_session.get(), SSL_SESSION_INCLUDE_NONAUTH)); + if (!session) { + return false; + } + + if (!RAND_bytes((uint8_t *)&session->ticket_age_add, 4)) { + return false; + } + session->ticket_age_add_valid = true; + if (ssl->enable_early_data) { + // QUIC does not use the max_early_data_size parameter and always sets it + // to a fixed value. See draft-ietf-quic-tls-22, section 4.5. + session->ticket_max_early_data = + ssl->quic_method != nullptr ? 0xffffffff : kMaxEarlyDataAccepted; + } + + static_assert(kNumTickets < 256, "Too many tickets"); + uint8_t nonce[] = {static_cast(i)}; + + ScopedCBB cbb; + CBB body, nonce_cbb, ticket, extensions; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_NEW_SESSION_TICKET) || + !CBB_add_u32(&body, session->timeout) || + !CBB_add_u32(&body, session->ticket_age_add) || + !CBB_add_u8_length_prefixed(&body, &nonce_cbb) || + !CBB_add_bytes(&nonce_cbb, nonce, sizeof(nonce)) || + !CBB_add_u16_length_prefixed(&body, &ticket) || + !tls13_derive_session_psk(session.get(), nonce) || + !ssl_encrypt_ticket(hs, &ticket, session.get()) || + !CBB_add_u16_length_prefixed(&body, &extensions)) { + return false; + } + + if (ssl->enable_early_data) { + CBB early_data; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_early_data) || + !CBB_add_u16_length_prefixed(&extensions, &early_data) || + !CBB_add_u32(&early_data, session->ticket_max_early_data) || + !CBB_flush(&extensions)) { + return false; + } + } + + // Add a fake extension. See draft-davidben-tls-grease-01. + if (!CBB_add_u16(&extensions, + ssl_get_grease_value(hs, ssl_grease_ticket_extension)) || + !CBB_add_u16(&extensions, 0 /* empty */)) { + return false; + } + + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return false; + } + } + + *out_sent_tickets = true; + return true; +} + +static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { + // At this point, most ClientHello extensions have already been processed by + // the common handshake logic. Resolve the remaining non-PSK parameters. + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + SSL_CLIENT_HELLO client_hello; + if (!ssl_client_hello_init(ssl, &client_hello, msg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + OPENSSL_memcpy(hs->session_id, client_hello.session_id, + client_hello.session_id_len); + hs->session_id_len = client_hello.session_id_len; + + uint16_t group_id; + if (!tls1_get_shared_group(hs, &group_id)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_GROUP); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + // Negotiate the cipher suite. + hs->new_cipher = choose_tls13_cipher(ssl, &client_hello, group_id); + if (hs->new_cipher == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_CIPHER); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + // HTTP/2 negotiation depends on the cipher suite, so ALPN negotiation was + // deferred. Complete it now. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_negotiate_alpn(hs, &alert, &client_hello)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + // The PRF hash is now known. Set up the key schedule and hash the + // ClientHello. + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher)) { + return ssl_hs_error; + } + + hs->tls13_state = state13_select_session; + return ssl_hs_ok; +} + +static enum ssl_ticket_aead_result_t select_session( + SSL_HANDSHAKE *hs, uint8_t *out_alert, UniquePtr *out_session, + int32_t *out_ticket_age_skew, bool *out_offered_ticket, + const SSLMessage &msg, const SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + *out_session = nullptr; + + CBS pre_shared_key; + *out_offered_ticket = ssl_client_hello_get_extension( + client_hello, &pre_shared_key, TLSEXT_TYPE_pre_shared_key); + if (!*out_offered_ticket) { + return ssl_ticket_aead_ignore_ticket; + } + + CBS ticket, binders; + uint32_t client_ticket_age; + if (!ssl_ext_pre_shared_key_parse_clienthello( + hs, &ticket, &binders, &client_ticket_age, out_alert, client_hello, + &pre_shared_key)) { + return ssl_ticket_aead_error; + } + + // If the peer did not offer psk_dhe, ignore the resumption. + if (!hs->accept_psk_mode) { + return ssl_ticket_aead_ignore_ticket; + } + + // TLS 1.3 session tickets are renewed separately as part of the + // NewSessionTicket. + bool unused_renew; + UniquePtr session; + enum ssl_ticket_aead_result_t ret = + ssl_process_ticket(hs, &session, &unused_renew, ticket, {}); + switch (ret) { + case ssl_ticket_aead_success: + break; + case ssl_ticket_aead_error: + *out_alert = SSL_AD_INTERNAL_ERROR; + return ret; + default: + return ret; + } + + if (!ssl_session_is_resumable(hs, session.get()) || + // Historically, some TLS 1.3 tickets were missing ticket_age_add. + !session->ticket_age_add_valid) { + return ssl_ticket_aead_ignore_ticket; + } + + // Recover the client ticket age and convert to seconds. + client_ticket_age -= session->ticket_age_add; + client_ticket_age /= 1000; + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + + // Compute the server ticket age in seconds. + assert(now.tv_sec >= session->time); + uint64_t server_ticket_age = now.tv_sec - session->time; + + // To avoid overflowing |hs->ticket_age_skew|, we will not resume + // 68-year-old sessions. + if (server_ticket_age > INT32_MAX) { + return ssl_ticket_aead_ignore_ticket; + } + + *out_ticket_age_skew = static_cast(client_ticket_age) - + static_cast(server_ticket_age); + + // Check the PSK binder. + if (!tls13_verify_psk_binder(hs, session.get(), msg, &binders)) { + *out_alert = SSL_AD_DECRYPT_ERROR; + return ssl_ticket_aead_error; + } + + *out_session = std::move(session); + return ssl_ticket_aead_success; +} + +static enum ssl_hs_wait_t do_select_session(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + SSL_CLIENT_HELLO client_hello; + if (!ssl_client_hello_init(ssl, &client_hello, msg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + UniquePtr session; + bool offered_ticket = false; + switch (select_session(hs, &alert, &session, &ssl->s3->ticket_age_skew, + &offered_ticket, msg, &client_hello)) { + case ssl_ticket_aead_ignore_ticket: + assert(!session); + if (!ssl->enable_early_data) { + ssl->s3->early_data_reason = ssl_early_data_disabled; + } else if (!offered_ticket) { + ssl->s3->early_data_reason = ssl_early_data_no_session_offered; + } else { + ssl->s3->early_data_reason = ssl_early_data_session_not_resumed; + } + if (!ssl_get_new_session(hs, 1 /* server */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + break; + + case ssl_ticket_aead_success: + // Carry over authentication information from the previous handshake into + // a fresh session. + hs->new_session = + SSL_SESSION_dup(session.get(), SSL_SESSION_DUP_AUTH_ONLY); + if (hs->new_session == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (!ssl->enable_early_data) { + ssl->s3->early_data_reason = ssl_early_data_disabled; + } else if (session->ticket_max_early_data == 0) { + ssl->s3->early_data_reason = ssl_early_data_unsupported_for_session; + } else if (!hs->early_data_offered) { + ssl->s3->early_data_reason = ssl_early_data_peer_declined; + } else if (ssl->s3->channel_id_valid) { + // Channel ID is incompatible with 0-RTT. + ssl->s3->early_data_reason = ssl_early_data_channel_id; + } else if (ssl->s3->token_binding_negotiated) { + // Token Binding is incompatible with 0-RTT. + ssl->s3->early_data_reason = ssl_early_data_token_binding; + } else if (MakeConstSpan(ssl->s3->alpn_selected) != session->early_alpn) { + // The negotiated ALPN must match the one in the ticket. + ssl->s3->early_data_reason = ssl_early_data_alpn_mismatch; + } else if (ssl->s3->ticket_age_skew < -kMaxTicketAgeSkewSeconds || + kMaxTicketAgeSkewSeconds < ssl->s3->ticket_age_skew) { + ssl->s3->early_data_reason = ssl_early_data_ticket_age_skew; + } else { + ssl->s3->early_data_reason = ssl_early_data_accepted; + ssl->s3->early_data_accepted = true; + } + + ssl->s3->session_reused = true; + + // Resumption incorporates fresh key material, so refresh the timeout. + ssl_session_renew_timeout(ssl, hs->new_session.get(), + ssl->session_ctx->session_psk_dhe_timeout); + break; + + case ssl_ticket_aead_error: + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + + case ssl_ticket_aead_retry: + hs->tls13_state = state13_select_session; + return ssl_hs_pending_ticket; + } + + // Record connection properties in the new session. + hs->new_session->cipher = hs->new_cipher; + + // Store the initial negotiated ALPN in the session. + if (!hs->new_session->early_alpn.CopyFrom(ssl->s3->alpn_selected)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (ssl->ctx->dos_protection_cb != NULL && + ssl->ctx->dos_protection_cb(&client_hello) == 0) { + // Connection rejected for DOS reasons. + OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_REJECTED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + size_t hash_len = EVP_MD_size( + ssl_get_handshake_digest(ssl_protocol_version(ssl), hs->new_cipher)); + + // Set up the key schedule and incorporate the PSK into the running secret. + if (ssl->s3->session_reused) { + if (!tls13_init_key_schedule( + hs, MakeConstSpan(hs->new_session->master_key, + hs->new_session->master_key_length))) { + return ssl_hs_error; + } + } else if (!tls13_init_key_schedule(hs, MakeConstSpan(kZeroes, hash_len))) { + return ssl_hs_error; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + if (ssl->s3->early_data_accepted) { + if (!tls13_derive_early_secret(hs)) { + return ssl_hs_error; + } + } else if (hs->early_data_offered) { + ssl->s3->skip_early_data = true; + } + + // Resolve ECDHE and incorporate it into the secret. + bool need_retry; + if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { + if (need_retry) { + if (ssl->s3->early_data_accepted) { + ssl->s3->early_data_reason = ssl_early_data_hello_retry_request; + ssl->s3->early_data_accepted = false; + } + ssl->s3->skip_early_data = true; + ssl->method->next_message(ssl); + if (!hs->transcript.UpdateForHelloRetryRequest()) { + return ssl_hs_error; + } + hs->tls13_state = state13_send_hello_retry_request; + return ssl_hs_ok; + } + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_send_server_hello; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_hello_retry_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + + ScopedCBB cbb; + CBB body, session_id, extensions; + uint16_t group_id; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || + !CBB_add_u16(&body, TLS1_2_VERSION) || + !CBB_add_bytes(&body, kHelloRetryRequest, SSL3_RANDOM_SIZE) || + !CBB_add_u8_length_prefixed(&body, &session_id) || + !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || + !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || + !CBB_add_u8(&body, 0 /* no compression */) || + !tls1_get_shared_group(hs, &group_id) || + !CBB_add_u16_length_prefixed(&body, &extensions) || + !CBB_add_u16(&extensions, TLSEXT_TYPE_supported_versions) || + !CBB_add_u16(&extensions, 2 /* length */) || + !CBB_add_u16(&extensions, ssl->version) || + !CBB_add_u16(&extensions, TLSEXT_TYPE_key_share) || + !CBB_add_u16(&extensions, 2 /* length */) || + !CBB_add_u16(&extensions, group_id) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + if (!ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + ssl->s3->used_hello_retry_request = true; + hs->tls13_state = state13_read_second_client_hello; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_second_client_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CLIENT_HELLO)) { + return ssl_hs_error; + } + SSL_CLIENT_HELLO client_hello; + if (!ssl_client_hello_init(ssl, &client_hello, msg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // We perform all our negotiation based on the first ClientHello (for + // consistency with what |select_certificate_cb| observed), which is in the + // transcript, so we can ignore most of this second one. + // + // We do, however, check the second PSK binder. This covers the client key + // share, in case we ever send half-RTT data (we currently do not). It is also + // a tricky computation, so we enforce the peer handled it correctly. + if (ssl->s3->session_reused) { + CBS pre_shared_key; + if (!ssl_client_hello_get_extension(&client_hello, &pre_shared_key, + TLSEXT_TYPE_pre_shared_key)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INCONSISTENT_CLIENT_HELLO); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + CBS ticket, binders; + uint32_t client_ticket_age; + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_ext_pre_shared_key_parse_clienthello( + hs, &ticket, &binders, &client_ticket_age, &alert, &client_hello, + &pre_shared_key)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + // Note it is important that we do not obtain a new |SSL_SESSION| from + // |ticket|. We have already selected parameters based on the first + // ClientHello (in the transcript) and must not switch partway through. + if (!tls13_verify_psk_binder(hs, hs->new_session.get(), msg, &binders)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + return ssl_hs_error; + } + } + + bool need_retry; + if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { + if (need_retry) { + // Only send one HelloRetryRequest. + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); + } + return ssl_hs_error; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_send_server_hello; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // Send a ServerHello. + ScopedCBB cbb; + CBB body, extensions, session_id; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || + !CBB_add_u16(&body, TLS1_2_VERSION) || + !RAND_bytes(ssl->s3->server_random, sizeof(ssl->s3->server_random)) || + !CBB_add_bytes(&body, ssl->s3->server_random, SSL3_RANDOM_SIZE) || + !CBB_add_u8_length_prefixed(&body, &session_id) || + !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || + !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || + !CBB_add_u8(&body, 0) || + !CBB_add_u16_length_prefixed(&body, &extensions) || + !ssl_ext_pre_shared_key_add_serverhello(hs, &extensions) || + !ssl_ext_key_share_add_serverhello(hs, &extensions) || + !ssl_ext_supported_versions_add_serverhello(hs, &extensions) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + if (!ssl->s3->used_hello_retry_request && + !ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + // Derive and enable the handshake traffic secrets. + if (!tls13_derive_handshake_secrets(hs) || + !tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_seal, + hs->server_handshake_secret())) { + return ssl_hs_error; + } + + // Send EncryptedExtensions. + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_ENCRYPTED_EXTENSIONS) || + !ssl_add_serverhello_tlsext(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + if (!ssl->s3->session_reused) { + // Determine whether to request a client certificate. + hs->cert_request = !!(hs->config->verify_mode & SSL_VERIFY_PEER); + // Only request a certificate if Channel ID isn't negotiated. + if ((hs->config->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && + ssl->s3->channel_id_valid) { + hs->cert_request = false; + } + } + + // Send a CertificateRequest, if necessary. + if (hs->cert_request) { + CBB cert_request_extensions, sigalg_contents, sigalgs_cbb; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_REQUEST) || + !CBB_add_u8(&body, 0 /* no certificate_request_context. */) || + !CBB_add_u16_length_prefixed(&body, &cert_request_extensions) || + !CBB_add_u16(&cert_request_extensions, + TLSEXT_TYPE_signature_algorithms) || + !CBB_add_u16_length_prefixed(&cert_request_extensions, + &sigalg_contents) || + !CBB_add_u16_length_prefixed(&sigalg_contents, &sigalgs_cbb) || + !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb)) { + return ssl_hs_error; + } + + if (ssl_has_client_CAs(hs->config)) { + CBB ca_contents; + if (!CBB_add_u16(&cert_request_extensions, + TLSEXT_TYPE_certificate_authorities) || + !CBB_add_u16_length_prefixed(&cert_request_extensions, + &ca_contents) || + !ssl_add_client_CA_list(hs, &ca_contents) || + !CBB_flush(&cert_request_extensions)) { + return ssl_hs_error; + } + } + + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + } + + // Send the server Certificate message, if necessary. + if (!ssl->s3->session_reused) { + if (!ssl_has_certificate(hs)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); + return ssl_hs_error; + } + + if (!tls13_add_certificate(hs)) { + return ssl_hs_error; + } + + hs->tls13_state = state13_send_server_certificate_verify; + return ssl_hs_ok; + } + + hs->tls13_state = state13_send_server_finished; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_certificate_verify(SSL_HANDSHAKE *hs) { + switch (tls13_add_certificate_verify(hs)) { + case ssl_private_key_success: + hs->tls13_state = state13_send_server_finished; + return ssl_hs_ok; + + case ssl_private_key_retry: + hs->tls13_state = state13_send_server_certificate_verify; + return ssl_hs_private_key_operation; + + case ssl_private_key_failure: + return ssl_hs_error; + } + + assert(0); + return ssl_hs_error; +} + +static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!tls13_add_finished(hs) || + // Update the secret to the master secret and derive traffic keys. + !tls13_advance_key_schedule( + hs, MakeConstSpan(kZeroes, hs->transcript.DigestLen())) || + !tls13_derive_application_secrets(hs) || + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_seal, + hs->server_traffic_secret_0())) { + return ssl_hs_error; + } + + if (ssl->s3->early_data_accepted) { + // We defer releasing the early traffic secret to QUIC to this point. First, + // the early traffic secret is derived before ECDHE, but ECDHE may later + // reject 0-RTT. We only release the secret after 0-RTT is fully resolved. + // + // Second, 0-RTT data is acknowledged with 1-RTT keys. Both are derived as + // part of the ServerHello flight, but future TLS extensions may insert an + // asynchronous point in the middle of this flight. We defer releasing the + // 0-RTT keys to ensure the QUIC implementation never installs read keys + // without the write keys to send the corresponding ACKs. + if (!tls13_set_early_secret_for_quic(hs)) { + return ssl_hs_error; + } + + // If accepting 0-RTT, we send tickets half-RTT. This gets the tickets on + // the wire sooner and also avoids triggering a write on |SSL_read| when + // processing the client Finished. This requires computing the client + // Finished early. See RFC 8446, section 4.6.1. + static const uint8_t kEndOfEarlyData[4] = {SSL3_MT_END_OF_EARLY_DATA, 0, + 0, 0}; + if (ssl->quic_method == nullptr && + !hs->transcript.Update(kEndOfEarlyData)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + size_t finished_len; + if (!tls13_finished_mac(hs, hs->expected_client_finished().data(), + &finished_len, false /* client */)) { + return ssl_hs_error; + } + + if (finished_len != hs->expected_client_finished().size()) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + // Feed the predicted Finished into the transcript. This allows us to derive + // the resumption secret early and send half-RTT tickets. + // + // TODO(davidben): This will need to be updated for DTLS 1.3. + assert(!SSL_is_dtls(hs->ssl)); + assert(hs->expected_client_finished().size() <= 0xff); + uint8_t header[4] = { + SSL3_MT_FINISHED, 0, 0, + static_cast(hs->expected_client_finished().size())}; + bool unused_sent_tickets; + if (!hs->transcript.Update(header) || + !hs->transcript.Update(hs->expected_client_finished()) || + !tls13_derive_resumption_secret(hs) || + !add_new_session_tickets(hs, &unused_sent_tickets)) { + return ssl_hs_error; + } + } + + hs->tls13_state = state13_read_second_client_flight; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_second_client_flight(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (ssl->s3->early_data_accepted) { + // QUIC never receives handshake messages under 0-RTT keys. + if (ssl->quic_method == nullptr && + !tls13_set_traffic_key(ssl, ssl_encryption_early_data, evp_aead_open, + hs->early_traffic_secret())) { + return ssl_hs_error; + } + hs->can_early_write = true; + hs->can_early_read = true; + hs->in_early_data = true; + } + + // QUIC doesn't use an EndOfEarlyData message (draft-ietf-quic-tls-22, + // section 8.3), so we switch to client_handshake_secret before the early + // return. + if (ssl->quic_method != nullptr) { + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + hs->tls13_state = state13_read_client_certificate; + return ssl->s3->early_data_accepted ? ssl_hs_early_return : ssl_hs_ok; + } + + hs->tls13_state = state13_process_end_of_early_data; + return ssl->s3->early_data_accepted ? ssl_hs_read_end_of_early_data + : ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_process_end_of_early_data(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + // If early data was not accepted, the EndOfEarlyData will be in the discarded + // early data. + if (hs->ssl->s3->early_data_accepted) { + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_END_OF_EARLY_DATA)) { + return ssl_hs_error; + } + if (CBS_len(&msg.body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + ssl->method->next_message(ssl); + } + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + if (hs->handback) { + return ssl_hs_handback; + } + hs->tls13_state = state13_read_client_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!hs->cert_request) { + if (!ssl->s3->session_reused) { + // OpenSSL returns X509_V_OK when no certificates are requested. This is + // classed by them as a bug, but it's assumed by at least NGINX. (Only do + // this in full handshakes as resumptions should carry over the previous + // |verify_result|, though this is a no-op because servers do not + // implement the client's odd soft-fail mode.) + hs->new_session->verify_result = X509_V_OK; + } + + // Skip this state. + hs->tls13_state = state13_read_channel_id; + return ssl_hs_ok; + } + + const bool allow_anonymous = + (hs->config->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) == 0; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE) || + !tls13_process_certificate(hs, msg, allow_anonymous) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_read_client_certificate_verify; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_certificate_verify( + SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { + // Skip this state. + hs->tls13_state = state13_read_channel_id; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + switch (ssl_verify_peer_cert(hs)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->tls13_state = state13_read_client_certificate_verify; + return ssl_hs_certificate_verify; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE_VERIFY) || + !tls13_process_certificate_verify(hs, msg) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_read_channel_id; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!ssl->s3->channel_id_valid) { + hs->tls13_state = state13_read_client_finished; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CHANNEL_ID) || + !tls1_verify_channel_id(hs, msg) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_read_client_finished; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || + // If early data was accepted, we've already computed the client Finished + // and derived the resumption secret. + !tls13_process_finished(hs, msg, ssl->s3->early_data_accepted) || + // evp_aead_seal keys have already been switched. + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_open, + hs->client_traffic_secret_0())) { + return ssl_hs_error; + } + + if (!ssl->s3->early_data_accepted) { + if (!ssl_hash_message(hs, msg) || + !tls13_derive_resumption_secret(hs)) { + return ssl_hs_error; + } + + // We send post-handshake tickets as part of the handshake in 1-RTT. + hs->tls13_state = state13_send_new_session_ticket; + } else { + // We already sent half-RTT tickets. + hs->tls13_state = state13_done; + } + + ssl->method->next_message(ssl); + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_new_session_ticket(SSL_HANDSHAKE *hs) { + bool sent_tickets; + if (!add_new_session_tickets(hs, &sent_tickets)) { + return ssl_hs_error; + } + + hs->tls13_state = state13_done; + // In TLS 1.3, the NewSessionTicket isn't flushed until the server performs a + // write, to prevent a non-reading client from causing the server to hang in + // the case of a small server write buffer. Consumers which don't write data + // to the client will need to do a zero-byte write if they wish to flush the + // tickets. + if (hs->ssl->quic_method != nullptr && sent_tickets) { + return ssl_hs_flush; + } + return ssl_hs_ok; +} + +enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs) { + while (hs->tls13_state != state13_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum tls13_server_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state13_select_parameters: + ret = do_select_parameters(hs); + break; + case state13_select_session: + ret = do_select_session(hs); + break; + case state13_send_hello_retry_request: + ret = do_send_hello_retry_request(hs); + break; + case state13_read_second_client_hello: + ret = do_read_second_client_hello(hs); + break; + case state13_send_server_hello: + ret = do_send_server_hello(hs); + break; + case state13_send_server_certificate_verify: + ret = do_send_server_certificate_verify(hs); + break; + case state13_send_server_finished: + ret = do_send_server_finished(hs); + break; + case state13_read_second_client_flight: + ret = do_read_second_client_flight(hs); + break; + case state13_process_end_of_early_data: + ret = do_process_end_of_early_data(hs); + break; + case state13_read_client_certificate: + ret = do_read_client_certificate(hs); + break; + case state13_read_client_certificate_verify: + ret = do_read_client_certificate_verify(hs); + break; + case state13_read_channel_id: + ret = do_read_channel_id(hs); + break; + case state13_read_client_finished: + ret = do_read_client_finished(hs); + break; + case state13_send_new_session_ticket: + ret = do_send_new_session_ticket(hs); + break; + case state13_done: + ret = ssl_hs_ok; + break; + } + + if (hs->tls13_state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_ACCEPT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + return ssl_hs_ok; +} + +const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs) { + enum tls13_server_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state13_select_parameters: + return "TLS 1.3 server select_parameters"; + case state13_select_session: + return "TLS 1.3 server select_session"; + case state13_send_hello_retry_request: + return "TLS 1.3 server send_hello_retry_request"; + case state13_read_second_client_hello: + return "TLS 1.3 server read_second_client_hello"; + case state13_send_server_hello: + return "TLS 1.3 server send_server_hello"; + case state13_send_server_certificate_verify: + return "TLS 1.3 server send_server_certificate_verify"; + case state13_send_server_finished: + return "TLS 1.3 server send_server_finished"; + case state13_read_second_client_flight: + return "TLS 1.3 server read_second_client_flight"; + case state13_process_end_of_early_data: + return "TLS 1.3 server process_end_of_early_data"; + case state13_read_client_certificate: + return "TLS 1.3 server read_client_certificate"; + case state13_read_client_certificate_verify: + return "TLS 1.3 server read_client_certificate_verify"; + case state13_read_channel_id: + return "TLS 1.3 server read_channel_id"; + case state13_read_client_finished: + return "TLS 1.3 server read_client_finished"; + case state13_send_new_session_ticket: + return "TLS 1.3 server send_new_session_ticket"; + case state13_done: + return "TLS 1.3 server done"; + } + + return "TLS 1.3 server unknown"; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc.grpc_back new file mode 100644 index 000000000..c6c496e8b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/ssl/tls13_server.cc.grpc_back @@ -0,0 +1,1066 @@ +/* Copyright (c) 2016, Google Inc. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ + +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "../crypto/internal.h" +#include "internal.h" + + +BSSL_NAMESPACE_BEGIN + +static const uint8_t kZeroes[EVP_MAX_MD_SIZE] = {0}; + +// Allow a minute of ticket age skew in either direction. This covers +// transmission delays in ClientHello and NewSessionTicket, as well as +// drift between client and server clock rate since the ticket was issued. +// See RFC 8446, section 8.3. +static const int32_t kMaxTicketAgeSkewSeconds = 60; + +static int resolve_ecdhe_secret(SSL_HANDSHAKE *hs, bool *out_need_retry, + SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + *out_need_retry = false; + + // We only support connections that include an ECDHE key exchange. + CBS key_share; + if (!ssl_client_hello_get_extension(client_hello, &key_share, + TLSEXT_TYPE_key_share)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION); + return 0; + } + + bool found_key_share; + Array dhe_secret; + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_ext_key_share_parse_clienthello(hs, &found_key_share, &dhe_secret, + &alert, &key_share)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return 0; + } + + if (!found_key_share) { + *out_need_retry = true; + return 0; + } + + return tls13_advance_key_schedule(hs, dhe_secret); +} + +static int ssl_ext_supported_versions_add_serverhello(SSL_HANDSHAKE *hs, + CBB *out) { + CBB contents; + if (!CBB_add_u16(out, TLSEXT_TYPE_supported_versions) || + !CBB_add_u16_length_prefixed(out, &contents) || + !CBB_add_u16(&contents, hs->ssl->version) || + !CBB_flush(out)) { + return 0; + } + + return 1; +} + +static const SSL_CIPHER *choose_tls13_cipher( + const SSL *ssl, const SSL_CLIENT_HELLO *client_hello, uint16_t group_id) { + CBS cipher_suites; + CBS_init(&cipher_suites, client_hello->cipher_suites, + client_hello->cipher_suites_len); + + const uint16_t version = ssl_protocol_version(ssl); + + return ssl_choose_tls13_cipher(cipher_suites, version, group_id); +} + +static bool add_new_session_tickets(SSL_HANDSHAKE *hs, bool *out_sent_tickets) { + SSL *const ssl = hs->ssl; + if (// If the client doesn't accept resumption with PSK_DHE_KE, don't send a + // session ticket. + !hs->accept_psk_mode || + // We only implement stateless resumption in TLS 1.3, so skip sending + // tickets if disabled. + (SSL_get_options(ssl) & SSL_OP_NO_TICKET)) { + *out_sent_tickets = false; + return true; + } + + // TLS 1.3 recommends single-use tickets, so issue multiple tickets in case + // the client makes several connections before getting a renewal. + static const int kNumTickets = 2; + + // Rebase the session timestamp so that it is measured from ticket + // issuance. + ssl_session_rebase_time(ssl, hs->new_session.get()); + + for (int i = 0; i < kNumTickets; i++) { + UniquePtr session( + SSL_SESSION_dup(hs->new_session.get(), SSL_SESSION_INCLUDE_NONAUTH)); + if (!session) { + return false; + } + + if (!RAND_bytes((uint8_t *)&session->ticket_age_add, 4)) { + return false; + } + session->ticket_age_add_valid = true; + if (ssl->enable_early_data) { + // QUIC does not use the max_early_data_size parameter and always sets it + // to a fixed value. See draft-ietf-quic-tls-22, section 4.5. + session->ticket_max_early_data = + ssl->quic_method != nullptr ? 0xffffffff : kMaxEarlyDataAccepted; + } + + static_assert(kNumTickets < 256, "Too many tickets"); + uint8_t nonce[] = {static_cast(i)}; + + ScopedCBB cbb; + CBB body, nonce_cbb, ticket, extensions; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_NEW_SESSION_TICKET) || + !CBB_add_u32(&body, session->timeout) || + !CBB_add_u32(&body, session->ticket_age_add) || + !CBB_add_u8_length_prefixed(&body, &nonce_cbb) || + !CBB_add_bytes(&nonce_cbb, nonce, sizeof(nonce)) || + !CBB_add_u16_length_prefixed(&body, &ticket) || + !tls13_derive_session_psk(session.get(), nonce) || + !ssl_encrypt_ticket(hs, &ticket, session.get()) || + !CBB_add_u16_length_prefixed(&body, &extensions)) { + return false; + } + + if (ssl->enable_early_data) { + CBB early_data; + if (!CBB_add_u16(&extensions, TLSEXT_TYPE_early_data) || + !CBB_add_u16_length_prefixed(&extensions, &early_data) || + !CBB_add_u32(&early_data, session->ticket_max_early_data) || + !CBB_flush(&extensions)) { + return false; + } + } + + // Add a fake extension. See draft-davidben-tls-grease-01. + if (!CBB_add_u16(&extensions, + ssl_get_grease_value(hs, ssl_grease_ticket_extension)) || + !CBB_add_u16(&extensions, 0 /* empty */)) { + return false; + } + + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return false; + } + } + + *out_sent_tickets = true; + return true; +} + +static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { + // At this point, most ClientHello extensions have already been processed by + // the common handshake logic. Resolve the remaining non-PSK parameters. + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + SSL_CLIENT_HELLO client_hello; + if (!ssl_client_hello_init(ssl, &client_hello, msg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + OPENSSL_memcpy(hs->session_id, client_hello.session_id, + client_hello.session_id_len); + hs->session_id_len = client_hello.session_id_len; + + uint16_t group_id; + if (!tls1_get_shared_group(hs, &group_id)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_GROUP); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + // Negotiate the cipher suite. + hs->new_cipher = choose_tls13_cipher(ssl, &client_hello, group_id); + if (hs->new_cipher == NULL) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_CIPHER); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); + return ssl_hs_error; + } + + // HTTP/2 negotiation depends on the cipher suite, so ALPN negotiation was + // deferred. Complete it now. + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_negotiate_alpn(hs, &alert, &client_hello)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + // The PRF hash is now known. Set up the key schedule and hash the + // ClientHello. + if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher)) { + return ssl_hs_error; + } + + hs->tls13_state = state13_select_session; + return ssl_hs_ok; +} + +static enum ssl_ticket_aead_result_t select_session( + SSL_HANDSHAKE *hs, uint8_t *out_alert, UniquePtr *out_session, + int32_t *out_ticket_age_skew, bool *out_offered_ticket, + const SSLMessage &msg, const SSL_CLIENT_HELLO *client_hello) { + SSL *const ssl = hs->ssl; + *out_session = nullptr; + + CBS pre_shared_key; + *out_offered_ticket = ssl_client_hello_get_extension( + client_hello, &pre_shared_key, TLSEXT_TYPE_pre_shared_key); + if (!*out_offered_ticket) { + return ssl_ticket_aead_ignore_ticket; + } + + CBS ticket, binders; + uint32_t client_ticket_age; + if (!ssl_ext_pre_shared_key_parse_clienthello( + hs, &ticket, &binders, &client_ticket_age, out_alert, client_hello, + &pre_shared_key)) { + return ssl_ticket_aead_error; + } + + // If the peer did not offer psk_dhe, ignore the resumption. + if (!hs->accept_psk_mode) { + return ssl_ticket_aead_ignore_ticket; + } + + // TLS 1.3 session tickets are renewed separately as part of the + // NewSessionTicket. + bool unused_renew; + UniquePtr session; + enum ssl_ticket_aead_result_t ret = + ssl_process_ticket(hs, &session, &unused_renew, ticket, {}); + switch (ret) { + case ssl_ticket_aead_success: + break; + case ssl_ticket_aead_error: + *out_alert = SSL_AD_INTERNAL_ERROR; + return ret; + default: + return ret; + } + + if (!ssl_session_is_resumable(hs, session.get()) || + // Historically, some TLS 1.3 tickets were missing ticket_age_add. + !session->ticket_age_add_valid) { + return ssl_ticket_aead_ignore_ticket; + } + + // Recover the client ticket age and convert to seconds. + client_ticket_age -= session->ticket_age_add; + client_ticket_age /= 1000; + + struct OPENSSL_timeval now; + ssl_get_current_time(ssl, &now); + + // Compute the server ticket age in seconds. + assert(now.tv_sec >= session->time); + uint64_t server_ticket_age = now.tv_sec - session->time; + + // To avoid overflowing |hs->ticket_age_skew|, we will not resume + // 68-year-old sessions. + if (server_ticket_age > INT32_MAX) { + return ssl_ticket_aead_ignore_ticket; + } + + *out_ticket_age_skew = static_cast(client_ticket_age) - + static_cast(server_ticket_age); + + // Check the PSK binder. + if (!tls13_verify_psk_binder(hs, session.get(), msg, &binders)) { + *out_alert = SSL_AD_DECRYPT_ERROR; + return ssl_ticket_aead_error; + } + + *out_session = std::move(session); + return ssl_ticket_aead_success; +} + +static enum ssl_hs_wait_t do_select_session(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + SSL_CLIENT_HELLO client_hello; + if (!ssl_client_hello_init(ssl, &client_hello, msg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + uint8_t alert = SSL_AD_DECODE_ERROR; + UniquePtr session; + bool offered_ticket = false; + switch (select_session(hs, &alert, &session, &ssl->s3->ticket_age_skew, + &offered_ticket, msg, &client_hello)) { + case ssl_ticket_aead_ignore_ticket: + assert(!session); + if (!ssl->enable_early_data) { + ssl->s3->early_data_reason = ssl_early_data_disabled; + } else if (!offered_ticket) { + ssl->s3->early_data_reason = ssl_early_data_no_session_offered; + } else { + ssl->s3->early_data_reason = ssl_early_data_session_not_resumed; + } + if (!ssl_get_new_session(hs, 1 /* server */)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + break; + + case ssl_ticket_aead_success: + // Carry over authentication information from the previous handshake into + // a fresh session. + hs->new_session = + SSL_SESSION_dup(session.get(), SSL_SESSION_DUP_AUTH_ONLY); + if (hs->new_session == nullptr) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (!ssl->enable_early_data) { + ssl->s3->early_data_reason = ssl_early_data_disabled; + } else if (session->ticket_max_early_data == 0) { + ssl->s3->early_data_reason = ssl_early_data_unsupported_for_session; + } else if (!hs->early_data_offered) { + ssl->s3->early_data_reason = ssl_early_data_peer_declined; + } else if (ssl->s3->channel_id_valid) { + // Channel ID is incompatible with 0-RTT. + ssl->s3->early_data_reason = ssl_early_data_channel_id; + } else if (ssl->s3->token_binding_negotiated) { + // Token Binding is incompatible with 0-RTT. + ssl->s3->early_data_reason = ssl_early_data_token_binding; + } else if (MakeConstSpan(ssl->s3->alpn_selected) != session->early_alpn) { + // The negotiated ALPN must match the one in the ticket. + ssl->s3->early_data_reason = ssl_early_data_alpn_mismatch; + } else if (ssl->s3->ticket_age_skew < -kMaxTicketAgeSkewSeconds || + kMaxTicketAgeSkewSeconds < ssl->s3->ticket_age_skew) { + ssl->s3->early_data_reason = ssl_early_data_ticket_age_skew; + } else { + ssl->s3->early_data_reason = ssl_early_data_accepted; + ssl->s3->early_data_accepted = true; + } + + ssl->s3->session_reused = true; + + // Resumption incorporates fresh key material, so refresh the timeout. + ssl_session_renew_timeout(ssl, hs->new_session.get(), + ssl->session_ctx->session_psk_dhe_timeout); + break; + + case ssl_ticket_aead_error: + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + + case ssl_ticket_aead_retry: + hs->tls13_state = state13_select_session; + return ssl_hs_pending_ticket; + } + + // Record connection properties in the new session. + hs->new_session->cipher = hs->new_cipher; + + // Store the initial negotiated ALPN in the session. + if (!hs->new_session->early_alpn.CopyFrom(ssl->s3->alpn_selected)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + if (ssl->ctx->dos_protection_cb != NULL && + ssl->ctx->dos_protection_cb(&client_hello) == 0) { + // Connection rejected for DOS reasons. + OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_REJECTED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); + return ssl_hs_error; + } + + size_t hash_len = EVP_MD_size( + ssl_get_handshake_digest(ssl_protocol_version(ssl), hs->new_cipher)); + + // Set up the key schedule and incorporate the PSK into the running secret. + if (ssl->s3->session_reused) { + if (!tls13_init_key_schedule( + hs, MakeConstSpan(hs->new_session->master_key, + hs->new_session->master_key_length))) { + return ssl_hs_error; + } + } else if (!tls13_init_key_schedule(hs, MakeConstSpan(kZeroes, hash_len))) { + return ssl_hs_error; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + if (ssl->s3->early_data_accepted) { + if (!tls13_derive_early_secret(hs)) { + return ssl_hs_error; + } + } else if (hs->early_data_offered) { + ssl->s3->skip_early_data = true; + } + + // Resolve ECDHE and incorporate it into the secret. + bool need_retry; + if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { + if (need_retry) { + if (ssl->s3->early_data_accepted) { + ssl->s3->early_data_reason = ssl_early_data_hello_retry_request; + ssl->s3->early_data_accepted = false; + } + ssl->s3->skip_early_data = true; + ssl->method->next_message(ssl); + if (!hs->transcript.UpdateForHelloRetryRequest()) { + return ssl_hs_error; + } + hs->tls13_state = state13_send_hello_retry_request; + return ssl_hs_ok; + } + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_send_server_hello; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_hello_retry_request(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + + ScopedCBB cbb; + CBB body, session_id, extensions; + uint16_t group_id; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || + !CBB_add_u16(&body, TLS1_2_VERSION) || + !CBB_add_bytes(&body, kHelloRetryRequest, SSL3_RANDOM_SIZE) || + !CBB_add_u8_length_prefixed(&body, &session_id) || + !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || + !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || + !CBB_add_u8(&body, 0 /* no compression */) || + !tls1_get_shared_group(hs, &group_id) || + !CBB_add_u16_length_prefixed(&body, &extensions) || + !CBB_add_u16(&extensions, TLSEXT_TYPE_supported_versions) || + !CBB_add_u16(&extensions, 2 /* length */) || + !CBB_add_u16(&extensions, ssl->version) || + !CBB_add_u16(&extensions, TLSEXT_TYPE_key_share) || + !CBB_add_u16(&extensions, 2 /* length */) || + !CBB_add_u16(&extensions, group_id) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + if (!ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + ssl->s3->used_hello_retry_request = true; + hs->tls13_state = state13_read_second_client_hello; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_second_client_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CLIENT_HELLO)) { + return ssl_hs_error; + } + SSL_CLIENT_HELLO client_hello; + if (!ssl_client_hello_init(ssl, &client_hello, msg)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + return ssl_hs_error; + } + + // We perform all our negotiation based on the first ClientHello (for + // consistency with what |select_certificate_cb| observed), which is in the + // transcript, so we can ignore most of this second one. + // + // We do, however, check the second PSK binder. This covers the client key + // share, in case we ever send half-RTT data (we currently do not). It is also + // a tricky computation, so we enforce the peer handled it correctly. + if (ssl->s3->session_reused) { + CBS pre_shared_key; + if (!ssl_client_hello_get_extension(&client_hello, &pre_shared_key, + TLSEXT_TYPE_pre_shared_key)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_INCONSISTENT_CLIENT_HELLO); + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + return ssl_hs_error; + } + + CBS ticket, binders; + uint32_t client_ticket_age; + uint8_t alert = SSL_AD_DECODE_ERROR; + if (!ssl_ext_pre_shared_key_parse_clienthello( + hs, &ticket, &binders, &client_ticket_age, &alert, &client_hello, + &pre_shared_key)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, alert); + return ssl_hs_error; + } + + // Note it is important that we do not obtain a new |SSL_SESSION| from + // |ticket|. We have already selected parameters based on the first + // ClientHello (in the transcript) and must not switch partway through. + if (!tls13_verify_psk_binder(hs, hs->new_session.get(), msg, &binders)) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); + return ssl_hs_error; + } + } + + bool need_retry; + if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { + if (need_retry) { + // Only send one HelloRetryRequest. + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); + OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); + } + return ssl_hs_error; + } + + if (!ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_send_server_hello; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + + // Send a ServerHello. + ScopedCBB cbb; + CBB body, extensions, session_id; + if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || + !CBB_add_u16(&body, TLS1_2_VERSION) || + !RAND_bytes(ssl->s3->server_random, sizeof(ssl->s3->server_random)) || + !CBB_add_bytes(&body, ssl->s3->server_random, SSL3_RANDOM_SIZE) || + !CBB_add_u8_length_prefixed(&body, &session_id) || + !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || + !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || + !CBB_add_u8(&body, 0) || + !CBB_add_u16_length_prefixed(&body, &extensions) || + !ssl_ext_pre_shared_key_add_serverhello(hs, &extensions) || + !ssl_ext_key_share_add_serverhello(hs, &extensions) || + !ssl_ext_supported_versions_add_serverhello(hs, &extensions) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + if (!ssl->s3->used_hello_retry_request && + !ssl->method->add_change_cipher_spec(ssl)) { + return ssl_hs_error; + } + + // Derive and enable the handshake traffic secrets. + if (!tls13_derive_handshake_secrets(hs) || + !tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_seal, + hs->server_handshake_secret())) { + return ssl_hs_error; + } + + // Send EncryptedExtensions. + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_ENCRYPTED_EXTENSIONS) || + !ssl_add_serverhello_tlsext(hs, &body) || + !ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + + if (!ssl->s3->session_reused) { + // Determine whether to request a client certificate. + hs->cert_request = !!(hs->config->verify_mode & SSL_VERIFY_PEER); + // Only request a certificate if Channel ID isn't negotiated. + if ((hs->config->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && + ssl->s3->channel_id_valid) { + hs->cert_request = false; + } + } + + // Send a CertificateRequest, if necessary. + if (hs->cert_request) { + CBB cert_request_extensions, sigalg_contents, sigalgs_cbb; + if (!ssl->method->init_message(ssl, cbb.get(), &body, + SSL3_MT_CERTIFICATE_REQUEST) || + !CBB_add_u8(&body, 0 /* no certificate_request_context. */) || + !CBB_add_u16_length_prefixed(&body, &cert_request_extensions) || + !CBB_add_u16(&cert_request_extensions, + TLSEXT_TYPE_signature_algorithms) || + !CBB_add_u16_length_prefixed(&cert_request_extensions, + &sigalg_contents) || + !CBB_add_u16_length_prefixed(&sigalg_contents, &sigalgs_cbb) || + !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb)) { + return ssl_hs_error; + } + + if (ssl_has_client_CAs(hs->config)) { + CBB ca_contents; + if (!CBB_add_u16(&cert_request_extensions, + TLSEXT_TYPE_certificate_authorities) || + !CBB_add_u16_length_prefixed(&cert_request_extensions, + &ca_contents) || + !ssl_add_client_CA_list(hs, &ca_contents) || + !CBB_flush(&cert_request_extensions)) { + return ssl_hs_error; + } + } + + if (!ssl_add_message_cbb(ssl, cbb.get())) { + return ssl_hs_error; + } + } + + // Send the server Certificate message, if necessary. + if (!ssl->s3->session_reused) { + if (!ssl_has_certificate(hs)) { + OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); + return ssl_hs_error; + } + + if (!tls13_add_certificate(hs)) { + return ssl_hs_error; + } + + hs->tls13_state = state13_send_server_certificate_verify; + return ssl_hs_ok; + } + + hs->tls13_state = state13_send_server_finished; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_server_certificate_verify(SSL_HANDSHAKE *hs) { + switch (tls13_add_certificate_verify(hs)) { + case ssl_private_key_success: + hs->tls13_state = state13_send_server_finished; + return ssl_hs_ok; + + case ssl_private_key_retry: + hs->tls13_state = state13_send_server_certificate_verify; + return ssl_hs_private_key_operation; + + case ssl_private_key_failure: + return ssl_hs_error; + } + + assert(0); + return ssl_hs_error; +} + +static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!tls13_add_finished(hs) || + // Update the secret to the master secret and derive traffic keys. + !tls13_advance_key_schedule( + hs, MakeConstSpan(kZeroes, hs->transcript.DigestLen())) || + !tls13_derive_application_secrets(hs) || + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_seal, + hs->server_traffic_secret_0())) { + return ssl_hs_error; + } + + if (ssl->s3->early_data_accepted) { + // We defer releasing the early traffic secret to QUIC to this point. First, + // the early traffic secret is derived before ECDHE, but ECDHE may later + // reject 0-RTT. We only release the secret after 0-RTT is fully resolved. + // + // Second, 0-RTT data is acknowledged with 1-RTT keys. Both are derived as + // part of the ServerHello flight, but future TLS extensions may insert an + // asynchronous point in the middle of this flight. We defer releasing the + // 0-RTT keys to ensure the QUIC implementation never installs read keys + // without the write keys to send the corresponding ACKs. + if (!tls13_set_early_secret_for_quic(hs)) { + return ssl_hs_error; + } + + // If accepting 0-RTT, we send tickets half-RTT. This gets the tickets on + // the wire sooner and also avoids triggering a write on |SSL_read| when + // processing the client Finished. This requires computing the client + // Finished early. See RFC 8446, section 4.6.1. + static const uint8_t kEndOfEarlyData[4] = {SSL3_MT_END_OF_EARLY_DATA, 0, + 0, 0}; + if (ssl->quic_method == nullptr && + !hs->transcript.Update(kEndOfEarlyData)) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + size_t finished_len; + if (!tls13_finished_mac(hs, hs->expected_client_finished().data(), + &finished_len, false /* client */)) { + return ssl_hs_error; + } + + if (finished_len != hs->expected_client_finished().size()) { + OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); + return ssl_hs_error; + } + + // Feed the predicted Finished into the transcript. This allows us to derive + // the resumption secret early and send half-RTT tickets. + // + // TODO(davidben): This will need to be updated for DTLS 1.3. + assert(!SSL_is_dtls(hs->ssl)); + assert(hs->expected_client_finished().size() <= 0xff); + uint8_t header[4] = { + SSL3_MT_FINISHED, 0, 0, + static_cast(hs->expected_client_finished().size())}; + bool unused_sent_tickets; + if (!hs->transcript.Update(header) || + !hs->transcript.Update(hs->expected_client_finished()) || + !tls13_derive_resumption_secret(hs) || + !add_new_session_tickets(hs, &unused_sent_tickets)) { + return ssl_hs_error; + } + } + + hs->tls13_state = state13_read_second_client_flight; + return ssl_hs_flush; +} + +static enum ssl_hs_wait_t do_read_second_client_flight(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (ssl->s3->early_data_accepted) { + // QUIC never receives handshake messages under 0-RTT keys. + if (ssl->quic_method == nullptr && + !tls13_set_traffic_key(ssl, ssl_encryption_early_data, evp_aead_open, + hs->early_traffic_secret())) { + return ssl_hs_error; + } + hs->can_early_write = true; + hs->can_early_read = true; + hs->in_early_data = true; + } + + // QUIC doesn't use an EndOfEarlyData message (draft-ietf-quic-tls-22, + // section 8.3), so we switch to client_handshake_secret before the early + // return. + if (ssl->quic_method != nullptr) { + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + hs->tls13_state = state13_read_client_certificate; + return ssl->s3->early_data_accepted ? ssl_hs_early_return : ssl_hs_ok; + } + + hs->tls13_state = state13_process_end_of_early_data; + return ssl->s3->early_data_accepted ? ssl_hs_read_end_of_early_data + : ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_process_end_of_early_data(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + // If early data was not accepted, the EndOfEarlyData will be in the discarded + // early data. + if (hs->ssl->s3->early_data_accepted) { + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_END_OF_EARLY_DATA)) { + return ssl_hs_error; + } + if (CBS_len(&msg.body) != 0) { + ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); + return ssl_hs_error; + } + ssl->method->next_message(ssl); + } + if (!tls13_set_traffic_key(ssl, ssl_encryption_handshake, evp_aead_open, + hs->client_handshake_secret())) { + return ssl_hs_error; + } + if (hs->handback) { + return ssl_hs_handback; + } + hs->tls13_state = state13_read_client_certificate; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!hs->cert_request) { + if (!ssl->s3->session_reused) { + // OpenSSL returns X509_V_OK when no certificates are requested. This is + // classed by them as a bug, but it's assumed by at least NGINX. (Only do + // this in full handshakes as resumptions should carry over the previous + // |verify_result|, though this is a no-op because servers do not + // implement the client's odd soft-fail mode.) + hs->new_session->verify_result = X509_V_OK; + } + + // Skip this state. + hs->tls13_state = state13_read_channel_id; + return ssl_hs_ok; + } + + const bool allow_anonymous = + (hs->config->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) == 0; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE) || + !tls13_process_certificate(hs, msg, allow_anonymous) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_read_client_certificate_verify; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_certificate_verify( + SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (sk_CRYPTO_BUFFER_num(hs->new_session->certs.get()) == 0) { + // Skip this state. + hs->tls13_state = state13_read_channel_id; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + + switch (ssl_verify_peer_cert(hs)) { + case ssl_verify_ok: + break; + case ssl_verify_invalid: + return ssl_hs_error; + case ssl_verify_retry: + hs->tls13_state = state13_read_client_certificate_verify; + return ssl_hs_certificate_verify; + } + + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE_VERIFY) || + !tls13_process_certificate_verify(hs, msg) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_read_channel_id; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + if (!ssl->s3->channel_id_valid) { + hs->tls13_state = state13_read_client_finished; + return ssl_hs_ok; + } + + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_CHANNEL_ID) || + !tls1_verify_channel_id(hs, msg) || + !ssl_hash_message(hs, msg)) { + return ssl_hs_error; + } + + ssl->method->next_message(ssl); + hs->tls13_state = state13_read_client_finished; + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_read_client_finished(SSL_HANDSHAKE *hs) { + SSL *const ssl = hs->ssl; + SSLMessage msg; + if (!ssl->method->get_message(ssl, &msg)) { + return ssl_hs_read_message; + } + if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || + // If early data was accepted, we've already computed the client Finished + // and derived the resumption secret. + !tls13_process_finished(hs, msg, ssl->s3->early_data_accepted) || + // evp_aead_seal keys have already been switched. + !tls13_set_traffic_key(ssl, ssl_encryption_application, evp_aead_open, + hs->client_traffic_secret_0())) { + return ssl_hs_error; + } + + if (!ssl->s3->early_data_accepted) { + if (!ssl_hash_message(hs, msg) || + !tls13_derive_resumption_secret(hs)) { + return ssl_hs_error; + } + + // We send post-handshake tickets as part of the handshake in 1-RTT. + hs->tls13_state = state13_send_new_session_ticket; + } else { + // We already sent half-RTT tickets. + hs->tls13_state = state13_done; + } + + ssl->method->next_message(ssl); + return ssl_hs_ok; +} + +static enum ssl_hs_wait_t do_send_new_session_ticket(SSL_HANDSHAKE *hs) { + bool sent_tickets; + if (!add_new_session_tickets(hs, &sent_tickets)) { + return ssl_hs_error; + } + + hs->tls13_state = state13_done; + // In TLS 1.3, the NewSessionTicket isn't flushed until the server performs a + // write, to prevent a non-reading client from causing the server to hang in + // the case of a small server write buffer. Consumers which don't write data + // to the client will need to do a zero-byte write if they wish to flush the + // tickets. + if (hs->ssl->quic_method != nullptr && sent_tickets) { + return ssl_hs_flush; + } + return ssl_hs_ok; +} + +enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs) { + while (hs->tls13_state != state13_done) { + enum ssl_hs_wait_t ret = ssl_hs_error; + enum tls13_server_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state13_select_parameters: + ret = do_select_parameters(hs); + break; + case state13_select_session: + ret = do_select_session(hs); + break; + case state13_send_hello_retry_request: + ret = do_send_hello_retry_request(hs); + break; + case state13_read_second_client_hello: + ret = do_read_second_client_hello(hs); + break; + case state13_send_server_hello: + ret = do_send_server_hello(hs); + break; + case state13_send_server_certificate_verify: + ret = do_send_server_certificate_verify(hs); + break; + case state13_send_server_finished: + ret = do_send_server_finished(hs); + break; + case state13_read_second_client_flight: + ret = do_read_second_client_flight(hs); + break; + case state13_process_end_of_early_data: + ret = do_process_end_of_early_data(hs); + break; + case state13_read_client_certificate: + ret = do_read_client_certificate(hs); + break; + case state13_read_client_certificate_verify: + ret = do_read_client_certificate_verify(hs); + break; + case state13_read_channel_id: + ret = do_read_channel_id(hs); + break; + case state13_read_client_finished: + ret = do_read_client_finished(hs); + break; + case state13_send_new_session_ticket: + ret = do_send_new_session_ticket(hs); + break; + case state13_done: + ret = ssl_hs_ok; + break; + } + + if (hs->tls13_state != state) { + ssl_do_info_callback(hs->ssl, SSL_CB_ACCEPT_LOOP, 1); + } + + if (ret != ssl_hs_ok) { + return ret; + } + } + + return ssl_hs_ok; +} + +const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs) { + enum tls13_server_hs_state_t state = + static_cast(hs->tls13_state); + switch (state) { + case state13_select_parameters: + return "TLS 1.3 server select_parameters"; + case state13_select_session: + return "TLS 1.3 server select_session"; + case state13_send_hello_retry_request: + return "TLS 1.3 server send_hello_retry_request"; + case state13_read_second_client_hello: + return "TLS 1.3 server read_second_client_hello"; + case state13_send_server_hello: + return "TLS 1.3 server send_server_hello"; + case state13_send_server_certificate_verify: + return "TLS 1.3 server send_server_certificate_verify"; + case state13_send_server_finished: + return "TLS 1.3 server send_server_finished"; + case state13_read_second_client_flight: + return "TLS 1.3 server read_second_client_flight"; + case state13_process_end_of_early_data: + return "TLS 1.3 server process_end_of_early_data"; + case state13_read_client_certificate: + return "TLS 1.3 server read_client_certificate"; + case state13_read_client_certificate_verify: + return "TLS 1.3 server read_client_certificate_verify"; + case state13_read_channel_id: + return "TLS 1.3 server read_channel_id"; + case state13_read_client_finished: + return "TLS 1.3 server read_client_finished"; + case state13_send_new_session_ticket: + return "TLS 1.3 server send_new_session_ticket"; + case state13_done: + return "TLS 1.3 server done"; + } + + return "TLS 1.3 server unknown"; +} + +BSSL_NAMESPACE_END diff --git a/Pods/BoringSSL-GRPC/ssl/tls_method.cc b/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc similarity index 87% rename from Pods/BoringSSL-GRPC/ssl/tls_method.cc rename to Pods/BoringSSL-GRPC/src/ssl/tls_method.cc index fde8b8db2..15f1d3e16 100644 --- a/Pods/BoringSSL-GRPC/ssl/tls_method.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc @@ -59,13 +59,13 @@ #include #include -#include +#include #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN static void ssl3_on_handshake_complete(SSL *ssl) { // The handshake should have released its final message. @@ -95,6 +95,10 @@ static bool ssl3_set_read_state(SSL *ssl, UniquePtr aead_ctx) { } static bool ssl3_set_write_state(SSL *ssl, UniquePtr aead_ctx) { + if (!tls_flush_pending_hs_data(ssl)) { + return false; + } + OPENSSL_memset(ssl->s3->write_sequence, 0, sizeof(ssl->s3->write_sequence)); ssl->s3->aead_write_ctx = std::move(aead_ctx); return true; @@ -115,16 +119,15 @@ static const SSL_PROTOCOL_METHOD kTLSProtocolMethod = { ssl3_finish_message, ssl3_add_message, ssl3_add_change_cipher_spec, - ssl3_add_alert, ssl3_flush_flight, ssl3_on_handshake_complete, ssl3_set_read_state, ssl3_set_write_state, }; -static int ssl_noop_x509_check_client_CA_names( +static bool ssl_noop_x509_check_client_CA_names( STACK_OF(CRYPTO_BUFFER) *names) { - return 1; + return true; } static void ssl_noop_x509_clear(CERT *cert) {} @@ -132,27 +135,29 @@ static void ssl_noop_x509_free(CERT *cert) {} static void ssl_noop_x509_dup(CERT *new_cert, const CERT *cert) {} static void ssl_noop_x509_flush_cached_leaf(CERT *cert) {} static void ssl_noop_x509_flush_cached_chain(CERT *cert) {} -static int ssl_noop_x509_session_cache_objects(SSL_SESSION *sess) { - return 1; +static bool ssl_noop_x509_session_cache_objects(SSL_SESSION *sess) { + return true; } -static int ssl_noop_x509_session_dup(SSL_SESSION *new_session, - const SSL_SESSION *session) { - return 1; +static bool ssl_noop_x509_session_dup(SSL_SESSION *new_session, + const SSL_SESSION *session) { + return true; } static void ssl_noop_x509_session_clear(SSL_SESSION *session) {} -static int ssl_noop_x509_session_verify_cert_chain(SSL_SESSION *session, - SSL *ssl, - uint8_t *out_alert) { - return 0; +static bool ssl_noop_x509_session_verify_cert_chain(SSL_SESSION *session, + SSL_HANDSHAKE *hs, + uint8_t *out_alert) { + return false; } static void ssl_noop_x509_hs_flush_cached_ca_names(SSL_HANDSHAKE *hs) {} -static int ssl_noop_x509_ssl_new(SSL *ctx) { return 1; } -static void ssl_noop_x509_ssl_free(SSL *ctx) { } -static void ssl_noop_x509_ssl_flush_cached_client_CA(SSL *ssl) {} -static int ssl_noop_x509_ssl_auto_chain_if_needed(SSL *ssl) { return 1; } -static int ssl_noop_x509_ssl_ctx_new(SSL_CTX *ctx) { return 1; } -static void ssl_noop_x509_ssl_ctx_free(SSL_CTX *ctx) { } +static bool ssl_noop_x509_ssl_new(SSL_HANDSHAKE *hs) { return true; } +static void ssl_noop_x509_ssl_config_free(SSL_CONFIG *cfg) {} +static void ssl_noop_x509_ssl_flush_cached_client_CA(SSL_CONFIG *cfg) {} +static bool ssl_noop_x509_ssl_auto_chain_if_needed(SSL_HANDSHAKE *hs) { + return true; +} +static bool ssl_noop_x509_ssl_ctx_new(SSL_CTX *ctx) { return true; } +static void ssl_noop_x509_ssl_ctx_free(SSL_CTX *ctx) {} static void ssl_noop_x509_ssl_ctx_flush_cached_client_CA(SSL_CTX *ctx) {} const SSL_X509_METHOD ssl_noop_x509_method = { @@ -168,7 +173,7 @@ const SSL_X509_METHOD ssl_noop_x509_method = { ssl_noop_x509_session_verify_cert_chain, ssl_noop_x509_hs_flush_cached_ca_names, ssl_noop_x509_ssl_new, - ssl_noop_x509_ssl_free, + ssl_noop_x509_ssl_config_free, ssl_noop_x509_ssl_flush_cached_client_CA, ssl_noop_x509_ssl_auto_chain_if_needed, ssl_noop_x509_ssl_ctx_new, @@ -176,7 +181,7 @@ const SSL_X509_METHOD ssl_noop_x509_method = { ssl_noop_x509_ssl_ctx_flush_cached_client_CA, }; -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; diff --git a/Pods/BoringSSL-GRPC/ssl/tls_method.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc.grpc_back similarity index 87% rename from Pods/BoringSSL-GRPC/ssl/tls_method.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/tls_method.cc.grpc_back index 2ad2817c6..a642e7542 100644 --- a/Pods/BoringSSL-GRPC/ssl/tls_method.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/tls_method.cc.grpc_back @@ -59,13 +59,13 @@ #include #include -#include +#include #include "../crypto/internal.h" #include "internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN static void ssl3_on_handshake_complete(SSL *ssl) { // The handshake should have released its final message. @@ -95,6 +95,10 @@ static bool ssl3_set_read_state(SSL *ssl, UniquePtr aead_ctx) { } static bool ssl3_set_write_state(SSL *ssl, UniquePtr aead_ctx) { + if (!tls_flush_pending_hs_data(ssl)) { + return false; + } + OPENSSL_memset(ssl->s3->write_sequence, 0, sizeof(ssl->s3->write_sequence)); ssl->s3->aead_write_ctx = std::move(aead_ctx); return true; @@ -115,16 +119,15 @@ static const SSL_PROTOCOL_METHOD kTLSProtocolMethod = { ssl3_finish_message, ssl3_add_message, ssl3_add_change_cipher_spec, - ssl3_add_alert, ssl3_flush_flight, ssl3_on_handshake_complete, ssl3_set_read_state, ssl3_set_write_state, }; -static int ssl_noop_x509_check_client_CA_names( +static bool ssl_noop_x509_check_client_CA_names( STACK_OF(CRYPTO_BUFFER) *names) { - return 1; + return true; } static void ssl_noop_x509_clear(CERT *cert) {} @@ -132,27 +135,29 @@ static void ssl_noop_x509_free(CERT *cert) {} static void ssl_noop_x509_dup(CERT *new_cert, const CERT *cert) {} static void ssl_noop_x509_flush_cached_leaf(CERT *cert) {} static void ssl_noop_x509_flush_cached_chain(CERT *cert) {} -static int ssl_noop_x509_session_cache_objects(SSL_SESSION *sess) { - return 1; +static bool ssl_noop_x509_session_cache_objects(SSL_SESSION *sess) { + return true; } -static int ssl_noop_x509_session_dup(SSL_SESSION *new_session, - const SSL_SESSION *session) { - return 1; +static bool ssl_noop_x509_session_dup(SSL_SESSION *new_session, + const SSL_SESSION *session) { + return true; } static void ssl_noop_x509_session_clear(SSL_SESSION *session) {} -static int ssl_noop_x509_session_verify_cert_chain(SSL_SESSION *session, - SSL *ssl, - uint8_t *out_alert) { - return 0; +static bool ssl_noop_x509_session_verify_cert_chain(SSL_SESSION *session, + SSL_HANDSHAKE *hs, + uint8_t *out_alert) { + return false; } static void ssl_noop_x509_hs_flush_cached_ca_names(SSL_HANDSHAKE *hs) {} -static int ssl_noop_x509_ssl_new(SSL *ctx) { return 1; } -static void ssl_noop_x509_ssl_free(SSL *ctx) { } -static void ssl_noop_x509_ssl_flush_cached_client_CA(SSL *ssl) {} -static int ssl_noop_x509_ssl_auto_chain_if_needed(SSL *ssl) { return 1; } -static int ssl_noop_x509_ssl_ctx_new(SSL_CTX *ctx) { return 1; } -static void ssl_noop_x509_ssl_ctx_free(SSL_CTX *ctx) { } +static bool ssl_noop_x509_ssl_new(SSL_HANDSHAKE *hs) { return true; } +static void ssl_noop_x509_ssl_config_free(SSL_CONFIG *cfg) {} +static void ssl_noop_x509_ssl_flush_cached_client_CA(SSL_CONFIG *cfg) {} +static bool ssl_noop_x509_ssl_auto_chain_if_needed(SSL_HANDSHAKE *hs) { + return true; +} +static bool ssl_noop_x509_ssl_ctx_new(SSL_CTX *ctx) { return true; } +static void ssl_noop_x509_ssl_ctx_free(SSL_CTX *ctx) {} static void ssl_noop_x509_ssl_ctx_flush_cached_client_CA(SSL_CTX *ctx) {} const SSL_X509_METHOD ssl_noop_x509_method = { @@ -168,7 +173,7 @@ const SSL_X509_METHOD ssl_noop_x509_method = { ssl_noop_x509_session_verify_cert_chain, ssl_noop_x509_hs_flush_cached_ca_names, ssl_noop_x509_ssl_new, - ssl_noop_x509_ssl_free, + ssl_noop_x509_ssl_config_free, ssl_noop_x509_ssl_flush_cached_client_CA, ssl_noop_x509_ssl_auto_chain_if_needed, ssl_noop_x509_ssl_ctx_new, @@ -176,7 +181,7 @@ const SSL_X509_METHOD ssl_noop_x509_method = { ssl_noop_x509_ssl_ctx_flush_cached_client_CA, }; -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; diff --git a/Pods/BoringSSL-GRPC/ssl/tls_record.cc b/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc similarity index 91% rename from Pods/BoringSSL-GRPC/ssl/tls_record.cc rename to Pods/BoringSSL-GRPC/src/ssl/tls_record.cc index e6f6e3924..9c8102285 100644 --- a/Pods/BoringSSL-GRPC/ssl/tls_record.cc +++ b/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc @@ -119,7 +119,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // kMaxEmptyRecords is the number of consecutive, empty records that will be // processed. Without this limit an attacker could send empty records at a @@ -140,26 +140,26 @@ static const uint8_t kMaxWarningAlerts = 4; // ssl_needs_record_splitting returns one if |ssl|'s current outgoing cipher // state needs record-splitting and zero otherwise. -static int ssl_needs_record_splitting(const SSL *ssl) { +static bool ssl_needs_record_splitting(const SSL *ssl) { #if !defined(BORINGSSL_UNSAFE_FUZZER_MODE) return !ssl->s3->aead_write_ctx->is_null_cipher() && ssl->s3->aead_write_ctx->ProtocolVersion() < TLS1_1_VERSION && (ssl->mode & SSL_MODE_CBC_RECORD_SPLITTING) != 0 && SSL_CIPHER_is_block_cipher(ssl->s3->aead_write_ctx->cipher()); #else - return 0; + return false; #endif } -int ssl_record_sequence_update(uint8_t *seq, size_t seq_len) { +bool ssl_record_sequence_update(uint8_t *seq, size_t seq_len) { for (size_t i = seq_len - 1; i < seq_len; i--) { ++seq[i]; if (seq[i] != 0) { - return 1; + return true; } } OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; + return false; } size_t ssl_record_prefix_len(const SSL *ssl) { @@ -258,8 +258,8 @@ ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, return ssl_open_record_partial; } - ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, - in.subspan(0, SSL3_RT_HEADER_LENGTH)); + Span header = in.subspan(0, SSL3_RT_HEADER_LENGTH); + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, header); *out_consumed = in.size() - CBS_len(&cbs); @@ -288,7 +288,7 @@ ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, // Decrypt the body in-place. if (!ssl->s3->aead_read_ctx->Open( - out, type, version, ssl->s3->read_sequence, + out, type, version, ssl->s3->read_sequence, header, MakeSpan(const_cast(CBS_data(&body)), CBS_len(&body)))) { if (ssl->s3->skip_early_data && !ssl->s3->aead_read_ctx->is_null_cipher()) { ERR_clear_error(); @@ -373,30 +373,25 @@ ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, return ssl_open_record_success; } -static int do_seal_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, - uint8_t *out_suffix, uint8_t type, const uint8_t *in, - const size_t in_len) { +static bool do_seal_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, + uint8_t *out_suffix, uint8_t type, const uint8_t *in, + const size_t in_len) { + SSLAEADContext *aead = ssl->s3->aead_write_ctx.get(); uint8_t *extra_in = NULL; size_t extra_in_len = 0; - if (!ssl->s3->aead_write_ctx->is_null_cipher() && - ssl->s3->aead_write_ctx->ProtocolVersion() >= TLS1_3_VERSION) { + if (!aead->is_null_cipher() && + aead->ProtocolVersion() >= TLS1_3_VERSION) { // TLS 1.3 hides the actual record type inside the encrypted data. extra_in = &type; extra_in_len = 1; } - size_t suffix_len; - if (!ssl->s3->aead_write_ctx->SuffixLen(&suffix_len, in_len, extra_in_len)) { + size_t suffix_len, ciphertext_len; + if (!aead->SuffixLen(&suffix_len, in_len, extra_in_len) || + !aead->CiphertextLen(&ciphertext_len, in_len, extra_in_len)) { OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); - return 0; - } - size_t ciphertext_len = - ssl->s3->aead_write_ctx->ExplicitNonceLen() + suffix_len; - if (ciphertext_len + in_len < ciphertext_len) { - OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); - return 0; + return false; } - ciphertext_len += in_len; assert(in == out || !buffers_alias(in, in_len, out, in_len)); assert(!buffers_alias(in, in_len, out_prefix, ssl_record_prefix_len(ssl))); @@ -408,28 +403,27 @@ static int do_seal_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, out_prefix[0] = type; } - uint16_t record_version = ssl->s3->aead_write_ctx->RecordVersion(); + uint16_t record_version = aead->RecordVersion(); out_prefix[1] = record_version >> 8; out_prefix[2] = record_version & 0xff; out_prefix[3] = ciphertext_len >> 8; out_prefix[4] = ciphertext_len & 0xff; + Span header = MakeSpan(out_prefix, SSL3_RT_HEADER_LENGTH); - if (!ssl->s3->aead_write_ctx->SealScatter( - out_prefix + SSL3_RT_HEADER_LENGTH, out, out_suffix, type, - record_version, ssl->s3->write_sequence, in, in_len, extra_in, - extra_in_len) || + if (!aead->SealScatter(out_prefix + SSL3_RT_HEADER_LENGTH, out, out_suffix, + out_prefix[0], record_version, ssl->s3->write_sequence, + header, in, in_len, extra_in, extra_in_len) || !ssl_record_sequence_update(ssl->s3->write_sequence, 8)) { - return 0; + return false; } - ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, - MakeSpan(out_prefix, SSL3_RT_HEADER_LENGTH)); - return 1; + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, header); + return true; } static size_t tls_seal_scatter_prefix_len(const SSL *ssl, uint8_t type, - size_t in_len) { + size_t in_len) { size_t ret = SSL3_RT_HEADER_LENGTH; if (type == SSL3_RT_APPLICATION_DATA && in_len > 1 && ssl_needs_record_splitting(ssl)) { @@ -470,7 +464,7 @@ static bool tls_seal_scatter_suffix_len(const SSL *ssl, size_t *out_suffix_len, // returns one on success and zero on error. If enabled, // |tls_seal_scatter_record| implements TLS 1.0 CBC 1/n-1 record splitting and // may write two records concatenated. -static int tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, +static bool tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, uint8_t type, const uint8_t *in, size_t in_len) { if (type == SSL3_RT_APPLICATION_DATA && in_len > 1 && @@ -484,13 +478,13 @@ static int tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, if (!do_seal_record(ssl, out_prefix, split_body, split_suffix, type, in, 1)) { - return 0; + return false; } size_t split_record_suffix_len; if (!ssl->s3->aead_write_ctx->SuffixLen(&split_record_suffix_len, 1, 0)) { assert(false); - return 0; + return false; } const size_t split_record_len = prefix_len + 1 + split_record_suffix_len; assert(SSL3_RT_HEADER_LENGTH + ssl_cipher_get_record_split_len( @@ -502,24 +496,25 @@ static int tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, uint8_t tmp_prefix[SSL3_RT_HEADER_LENGTH]; if (!do_seal_record(ssl, tmp_prefix, out + 1, out_suffix, type, in + 1, in_len - 1)) { - return 0; + return false; } assert(tls_seal_scatter_prefix_len(ssl, type, in_len) == split_record_len + SSL3_RT_HEADER_LENGTH - 1); OPENSSL_memcpy(out_prefix + split_record_len, tmp_prefix, SSL3_RT_HEADER_LENGTH - 1); OPENSSL_memcpy(out, tmp_prefix + SSL3_RT_HEADER_LENGTH - 1, 1); - return 1; + return true; } return do_seal_record(ssl, out_prefix, out, out_suffix, type, in, in_len); } -int tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, - uint8_t type, const uint8_t *in, size_t in_len) { +bool tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out_len, uint8_t type, const uint8_t *in, + size_t in_len) { if (buffers_alias(in, in_len, out, max_out_len)) { OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); - return 0; + return false; } const size_t prefix_len = tls_seal_scatter_prefix_len(ssl, type, in_len); @@ -530,22 +525,22 @@ int tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, if (in_len + prefix_len < in_len || prefix_len + in_len + suffix_len < prefix_len + in_len) { OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); - return 0; + return false; } if (max_out_len < in_len + prefix_len + suffix_len) { OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); - return 0; + return false; } uint8_t *prefix = out; uint8_t *body = out + prefix_len; uint8_t *suffix = body + in_len; if (!tls_seal_scatter_record(ssl, prefix, body, suffix, type, in, in_len)) { - return 0; + return false; } *out_len = prefix_len + in_len + suffix_len; - return 1; + return true; } enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, @@ -571,9 +566,14 @@ enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, return ssl_open_record_close_notify; } - // Warning alerts do not exist in TLS 1.3. + // Warning alerts do not exist in TLS 1.3, but RFC 8446 section 6.1 + // continues to define user_canceled as a signal to cancel the handshake, + // without specifying how to handle it. JDK11 misuses it to signal + // full-duplex connection close after the handshake. As a workaround, skip + // user_canceled as in TLS 1.2. This matches NSS and OpenSSL. if (ssl->s3->have_version && - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + ssl_protocol_version(ssl) >= TLS1_3_VERSION && + alert_descr != SSL_AD_USER_CANCELLED) { *out_alert = SSL_AD_DECODE_ERROR; OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ALERT); return ssl_open_record_error; @@ -680,7 +680,7 @@ bool SealRecord(SSL *ssl, const Span out_prefix, in.data(), in.size()); } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; diff --git a/Pods/BoringSSL-GRPC/ssl/tls_record.cc.grpc_back b/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc.grpc_back similarity index 91% rename from Pods/BoringSSL-GRPC/ssl/tls_record.cc.grpc_back rename to Pods/BoringSSL-GRPC/src/ssl/tls_record.cc.grpc_back index 05a3d569d..464c5c5ac 100644 --- a/Pods/BoringSSL-GRPC/ssl/tls_record.cc.grpc_back +++ b/Pods/BoringSSL-GRPC/src/ssl/tls_record.cc.grpc_back @@ -119,7 +119,7 @@ #include "../crypto/internal.h" -namespace bssl { +BSSL_NAMESPACE_BEGIN // kMaxEmptyRecords is the number of consecutive, empty records that will be // processed. Without this limit an attacker could send empty records at a @@ -140,26 +140,26 @@ static const uint8_t kMaxWarningAlerts = 4; // ssl_needs_record_splitting returns one if |ssl|'s current outgoing cipher // state needs record-splitting and zero otherwise. -static int ssl_needs_record_splitting(const SSL *ssl) { +static bool ssl_needs_record_splitting(const SSL *ssl) { #if !defined(BORINGSSL_UNSAFE_FUZZER_MODE) return !ssl->s3->aead_write_ctx->is_null_cipher() && ssl->s3->aead_write_ctx->ProtocolVersion() < TLS1_1_VERSION && (ssl->mode & SSL_MODE_CBC_RECORD_SPLITTING) != 0 && SSL_CIPHER_is_block_cipher(ssl->s3->aead_write_ctx->cipher()); #else - return 0; + return false; #endif } -int ssl_record_sequence_update(uint8_t *seq, size_t seq_len) { +bool ssl_record_sequence_update(uint8_t *seq, size_t seq_len) { for (size_t i = seq_len - 1; i < seq_len; i--) { ++seq[i]; if (seq[i] != 0) { - return 1; + return true; } } OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; + return false; } size_t ssl_record_prefix_len(const SSL *ssl) { @@ -258,8 +258,8 @@ ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, return ssl_open_record_partial; } - ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, - in.subspan(0, SSL3_RT_HEADER_LENGTH)); + Span header = in.subspan(0, SSL3_RT_HEADER_LENGTH); + ssl_do_msg_callback(ssl, 0 /* read */, SSL3_RT_HEADER, header); *out_consumed = in.size() - CBS_len(&cbs); @@ -288,7 +288,7 @@ ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, // Decrypt the body in-place. if (!ssl->s3->aead_read_ctx->Open( - out, type, version, ssl->s3->read_sequence, + out, type, version, ssl->s3->read_sequence, header, MakeSpan(const_cast(CBS_data(&body)), CBS_len(&body)))) { if (ssl->s3->skip_early_data && !ssl->s3->aead_read_ctx->is_null_cipher()) { ERR_clear_error(); @@ -373,30 +373,25 @@ ssl_open_record_t tls_open_record(SSL *ssl, uint8_t *out_type, return ssl_open_record_success; } -static int do_seal_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, - uint8_t *out_suffix, uint8_t type, const uint8_t *in, - const size_t in_len) { +static bool do_seal_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, + uint8_t *out_suffix, uint8_t type, const uint8_t *in, + const size_t in_len) { + SSLAEADContext *aead = ssl->s3->aead_write_ctx.get(); uint8_t *extra_in = NULL; size_t extra_in_len = 0; - if (!ssl->s3->aead_write_ctx->is_null_cipher() && - ssl->s3->aead_write_ctx->ProtocolVersion() >= TLS1_3_VERSION) { + if (!aead->is_null_cipher() && + aead->ProtocolVersion() >= TLS1_3_VERSION) { // TLS 1.3 hides the actual record type inside the encrypted data. extra_in = &type; extra_in_len = 1; } - size_t suffix_len; - if (!ssl->s3->aead_write_ctx->SuffixLen(&suffix_len, in_len, extra_in_len)) { + size_t suffix_len, ciphertext_len; + if (!aead->SuffixLen(&suffix_len, in_len, extra_in_len) || + !aead->CiphertextLen(&ciphertext_len, in_len, extra_in_len)) { OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); - return 0; - } - size_t ciphertext_len = - ssl->s3->aead_write_ctx->ExplicitNonceLen() + suffix_len; - if (ciphertext_len + in_len < ciphertext_len) { - OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); - return 0; + return false; } - ciphertext_len += in_len; assert(in == out || !buffers_alias(in, in_len, out, in_len)); assert(!buffers_alias(in, in_len, out_prefix, ssl_record_prefix_len(ssl))); @@ -408,28 +403,27 @@ static int do_seal_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, out_prefix[0] = type; } - uint16_t record_version = ssl->s3->aead_write_ctx->RecordVersion(); + uint16_t record_version = aead->RecordVersion(); out_prefix[1] = record_version >> 8; out_prefix[2] = record_version & 0xff; out_prefix[3] = ciphertext_len >> 8; out_prefix[4] = ciphertext_len & 0xff; + Span header = MakeSpan(out_prefix, SSL3_RT_HEADER_LENGTH); - if (!ssl->s3->aead_write_ctx->SealScatter( - out_prefix + SSL3_RT_HEADER_LENGTH, out, out_suffix, type, - record_version, ssl->s3->write_sequence, in, in_len, extra_in, - extra_in_len) || + if (!aead->SealScatter(out_prefix + SSL3_RT_HEADER_LENGTH, out, out_suffix, + out_prefix[0], record_version, ssl->s3->write_sequence, + header, in, in_len, extra_in, extra_in_len) || !ssl_record_sequence_update(ssl->s3->write_sequence, 8)) { - return 0; + return false; } - ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, - MakeSpan(out_prefix, SSL3_RT_HEADER_LENGTH)); - return 1; + ssl_do_msg_callback(ssl, 1 /* write */, SSL3_RT_HEADER, header); + return true; } static size_t tls_seal_scatter_prefix_len(const SSL *ssl, uint8_t type, - size_t in_len) { + size_t in_len) { size_t ret = SSL3_RT_HEADER_LENGTH; if (type == SSL3_RT_APPLICATION_DATA && in_len > 1 && ssl_needs_record_splitting(ssl)) { @@ -470,7 +464,7 @@ static bool tls_seal_scatter_suffix_len(const SSL *ssl, size_t *out_suffix_len, // returns one on success and zero on error. If enabled, // |tls_seal_scatter_record| implements TLS 1.0 CBC 1/n-1 record splitting and // may write two records concatenated. -static int tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, +static bool tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, uint8_t type, const uint8_t *in, size_t in_len) { if (type == SSL3_RT_APPLICATION_DATA && in_len > 1 && @@ -484,13 +478,13 @@ static int tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, if (!do_seal_record(ssl, out_prefix, split_body, split_suffix, type, in, 1)) { - return 0; + return false; } size_t split_record_suffix_len; if (!ssl->s3->aead_write_ctx->SuffixLen(&split_record_suffix_len, 1, 0)) { assert(false); - return 0; + return false; } const size_t split_record_len = prefix_len + 1 + split_record_suffix_len; assert(SSL3_RT_HEADER_LENGTH + ssl_cipher_get_record_split_len( @@ -502,24 +496,25 @@ static int tls_seal_scatter_record(SSL *ssl, uint8_t *out_prefix, uint8_t *out, uint8_t tmp_prefix[SSL3_RT_HEADER_LENGTH]; if (!do_seal_record(ssl, tmp_prefix, out + 1, out_suffix, type, in + 1, in_len - 1)) { - return 0; + return false; } assert(tls_seal_scatter_prefix_len(ssl, type, in_len) == split_record_len + SSL3_RT_HEADER_LENGTH - 1); OPENSSL_memcpy(out_prefix + split_record_len, tmp_prefix, SSL3_RT_HEADER_LENGTH - 1); OPENSSL_memcpy(out, tmp_prefix + SSL3_RT_HEADER_LENGTH - 1, 1); - return 1; + return true; } return do_seal_record(ssl, out_prefix, out, out_suffix, type, in, in_len); } -int tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, - uint8_t type, const uint8_t *in, size_t in_len) { +bool tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, + size_t max_out_len, uint8_t type, const uint8_t *in, + size_t in_len) { if (buffers_alias(in, in_len, out, max_out_len)) { OPENSSL_PUT_ERROR(SSL, SSL_R_OUTPUT_ALIASES_INPUT); - return 0; + return false; } const size_t prefix_len = tls_seal_scatter_prefix_len(ssl, type, in_len); @@ -530,22 +525,22 @@ int tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out_len, if (in_len + prefix_len < in_len || prefix_len + in_len + suffix_len < prefix_len + in_len) { OPENSSL_PUT_ERROR(SSL, SSL_R_RECORD_TOO_LARGE); - return 0; + return false; } if (max_out_len < in_len + prefix_len + suffix_len) { OPENSSL_PUT_ERROR(SSL, SSL_R_BUFFER_TOO_SMALL); - return 0; + return false; } uint8_t *prefix = out; uint8_t *body = out + prefix_len; uint8_t *suffix = body + in_len; if (!tls_seal_scatter_record(ssl, prefix, body, suffix, type, in, in_len)) { - return 0; + return false; } *out_len = prefix_len + in_len + suffix_len; - return 1; + return true; } enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, @@ -571,9 +566,14 @@ enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, return ssl_open_record_close_notify; } - // Warning alerts do not exist in TLS 1.3. + // Warning alerts do not exist in TLS 1.3, but RFC 8446 section 6.1 + // continues to define user_canceled as a signal to cancel the handshake, + // without specifying how to handle it. JDK11 misuses it to signal + // full-duplex connection close after the handshake. As a workaround, skip + // user_canceled as in TLS 1.2. This matches NSS and OpenSSL. if (ssl->s3->have_version && - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { + ssl_protocol_version(ssl) >= TLS1_3_VERSION && + alert_descr != SSL_AD_USER_CANCELLED) { *out_alert = SSL_AD_DECODE_ERROR; OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ALERT); return ssl_open_record_error; @@ -680,7 +680,7 @@ bool SealRecord(SSL *ssl, const Span out_prefix, in.data(), in.size()); } -} // namespace bssl +BSSL_NAMESPACE_END using namespace bssl; diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c new file mode 100644 index 000000000..1fc617d8b --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c @@ -0,0 +1,2167 @@ +// The MIT License (MIT) +// +// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Some of this code is taken from the ref10 version of Ed25519 in SUPERCOP +// 20141124 (http://bench.cr.yp.to/supercop.html). That code is released as +// public domain but parts have been replaced with code generated by Fiat +// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. +// +// The field functions are shared by Ed25519 and X25519 where possible. + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../../crypto/internal.h" + + +// Various pre-computed constants. +#include "./curve25519_tables.h" + +#if defined(BORINGSSL_CURVE25519_64BIT) +#include "./curve25519_64.h" +#else +#include "./curve25519_32.h" +#endif // BORINGSSL_CURVE25519_64BIT + + +// Low-level intrinsic operations + +static uint64_t load_3(const uint8_t *in) { + uint64_t result; + result = (uint64_t)in[0]; + result |= ((uint64_t)in[1]) << 8; + result |= ((uint64_t)in[2]) << 16; + return result; +} + +static uint64_t load_4(const uint8_t *in) { + uint64_t result; + result = (uint64_t)in[0]; + result |= ((uint64_t)in[1]) << 8; + result |= ((uint64_t)in[2]) << 16; + result |= ((uint64_t)in[3]) << 24; + return result; +} + + +// Field operations. + +#if defined(BORINGSSL_CURVE25519_64BIT) + +typedef uint64_t fe_limb_t; +#define FE_NUM_LIMBS 5 + +// assert_fe asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc]] +// +// See comments in curve25519_64.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 5; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= UINT64_C(0x8cccccccccccc)); \ + } \ + } while (0) + +// assert_fe_loose asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664]] +// +// See comments in curve25519_64.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe_loose(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 5; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= UINT64_C(0x1a666666666664)); \ + } \ + } while (0) + +#else + +typedef uint32_t fe_limb_t; +#define FE_NUM_LIMBS 10 + +// assert_fe asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] +// +// See comments in curve25519_32.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= \ + ((_assert_fe_i & 1) ? 0x2333333u : 0x4666666u)); \ + } \ + } while (0) + +// assert_fe_loose asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] +// +// See comments in curve25519_32.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe_loose(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= \ + ((_assert_fe_i & 1) ? 0x6999999u : 0xd333332u)); \ + } \ + } while (0) + +#endif // BORINGSSL_CURVE25519_64BIT + +OPENSSL_STATIC_ASSERT(sizeof(fe) == sizeof(fe_limb_t) * FE_NUM_LIMBS, + "fe_limb_t[FE_NUM_LIMBS] is inconsistent with fe"); + +static void fe_frombytes_strict(fe *h, const uint8_t s[32]) { + // |fiat_25519_from_bytes| requires the top-most bit be clear. + assert((s[31] & 0x80) == 0); + fiat_25519_from_bytes(h->v, s); + assert_fe(h->v); +} + +static void fe_frombytes(fe *h, const uint8_t s[32]) { + uint8_t s_copy[32]; + OPENSSL_memcpy(s_copy, s, 32); + s_copy[31] &= 0x7f; + fe_frombytes_strict(h, s_copy); +} + +static void fe_tobytes(uint8_t s[32], const fe *f) { + assert_fe(f->v); + fiat_25519_to_bytes(s, f->v); +} + +// h = 0 +static void fe_0(fe *h) { + OPENSSL_memset(h, 0, sizeof(fe)); +} + +static void fe_loose_0(fe_loose *h) { + OPENSSL_memset(h, 0, sizeof(fe_loose)); +} + +// h = 1 +static void fe_1(fe *h) { + OPENSSL_memset(h, 0, sizeof(fe)); + h->v[0] = 1; +} + +static void fe_loose_1(fe_loose *h) { + OPENSSL_memset(h, 0, sizeof(fe_loose)); + h->v[0] = 1; +} + +// h = f + g +// Can overlap h with f or g. +static void fe_add(fe_loose *h, const fe *f, const fe *g) { + assert_fe(f->v); + assert_fe(g->v); + fiat_25519_add(h->v, f->v, g->v); + assert_fe_loose(h->v); +} + +// h = f - g +// Can overlap h with f or g. +static void fe_sub(fe_loose *h, const fe *f, const fe *g) { + assert_fe(f->v); + assert_fe(g->v); + fiat_25519_sub(h->v, f->v, g->v); + assert_fe_loose(h->v); +} + +static void fe_carry(fe *h, const fe_loose* f) { + assert_fe_loose(f->v); + fiat_25519_carry(h->v, f->v); + assert_fe(h->v); +} + +static void fe_mul_impl(fe_limb_t out[FE_NUM_LIMBS], + const fe_limb_t in1[FE_NUM_LIMBS], + const fe_limb_t in2[FE_NUM_LIMBS]) { + assert_fe_loose(in1); + assert_fe_loose(in2); + fiat_25519_carry_mul(out, in1, in2); + assert_fe(out); +} + +static void fe_mul_ltt(fe_loose *h, const fe *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_llt(fe_loose *h, const fe_loose *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_ttt(fe *h, const fe *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_tlt(fe *h, const fe_loose *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_ttl(fe *h, const fe *f, const fe_loose *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_tll(fe *h, const fe_loose *f, const fe_loose *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_sq_tl(fe *h, const fe_loose *f) { + assert_fe_loose(f->v); + fiat_25519_carry_square(h->v, f->v); + assert_fe(h->v); +} + +static void fe_sq_tt(fe *h, const fe *f) { + assert_fe_loose(f->v); + fiat_25519_carry_square(h->v, f->v); + assert_fe(h->v); +} + +// Replace (f,g) with (g,f) if b == 1; +// replace (f,g) with (f,g) if b == 0. +// +// Preconditions: b in {0,1}. +static void fe_cswap(fe *f, fe *g, fe_limb_t b) { + b = 0-b; + for (unsigned i = 0; i < FE_NUM_LIMBS; i++) { + fe_limb_t x = f->v[i] ^ g->v[i]; + x &= b; + f->v[i] ^= x; + g->v[i] ^= x; + } +} + +static void fe_mul121666(fe *h, const fe_loose *f) { + assert_fe_loose(f->v); + fiat_25519_carry_scmul_121666(h->v, f->v); + assert_fe(h->v); +} + +// h = -f +static void fe_neg(fe_loose *h, const fe *f) { + assert_fe(f->v); + fiat_25519_opp(h->v, f->v); + assert_fe_loose(h->v); +} + +// Replace (f,g) with (g,g) if b == 1; +// replace (f,g) with (f,g) if b == 0. +// +// Preconditions: b in {0,1}. +static void fe_cmov(fe_loose *f, const fe_loose *g, fe_limb_t b) { + // Silence an unused function warning. |fiat_25519_selectznz| isn't quite the + // calling convention the rest of this code wants, so implement it by hand. + // + // TODO(davidben): Switch to fiat's calling convention, or ask fiat to emit a + // different one. + (void)fiat_25519_selectznz; + + b = 0-b; + for (unsigned i = 0; i < FE_NUM_LIMBS; i++) { + fe_limb_t x = f->v[i] ^ g->v[i]; + x &= b; + f->v[i] ^= x; + } +} + +// h = f +static void fe_copy(fe *h, const fe *f) { + OPENSSL_memmove(h, f, sizeof(fe)); +} + +static void fe_copy_lt(fe_loose *h, const fe *f) { + OPENSSL_STATIC_ASSERT(sizeof(fe_loose) == sizeof(fe), + "fe and fe_loose mismatch"); + OPENSSL_memmove(h, f, sizeof(fe)); +} +#if !defined(OPENSSL_SMALL) +static void fe_copy_ll(fe_loose *h, const fe_loose *f) { + OPENSSL_memmove(h, f, sizeof(fe_loose)); +} +#endif // !defined(OPENSSL_SMALL) + +static void fe_loose_invert(fe *out, const fe_loose *z) { + fe t0; + fe t1; + fe t2; + fe t3; + int i; + + fe_sq_tl(&t0, z); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 2; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_tlt(&t1, z, &t1); + fe_mul_ttt(&t0, &t0, &t1); + fe_sq_tt(&t2, &t0); + fe_mul_ttt(&t1, &t1, &t2); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 5; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t2, &t2, &t1); + fe_sq_tt(&t3, &t2); + for (i = 1; i < 20; ++i) { + fe_sq_tt(&t3, &t3); + } + fe_mul_ttt(&t2, &t3, &t2); + fe_sq_tt(&t2, &t2); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t2, &t2, &t1); + fe_sq_tt(&t3, &t2); + for (i = 1; i < 100; ++i) { + fe_sq_tt(&t3, &t3); + } + fe_mul_ttt(&t2, &t3, &t2); + fe_sq_tt(&t2, &t2); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t1, &t1); + for (i = 1; i < 5; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(out, &t1, &t0); +} + +static void fe_invert(fe *out, const fe *z) { + fe_loose l; + fe_copy_lt(&l, z); + fe_loose_invert(out, &l); +} + +// return 0 if f == 0 +// return 1 if f != 0 +static int fe_isnonzero(const fe_loose *f) { + fe tight; + fe_carry(&tight, f); + uint8_t s[32]; + fe_tobytes(s, &tight); + + static const uint8_t zero[32] = {0}; + return CRYPTO_memcmp(s, zero, sizeof(zero)) != 0; +} + +// return 1 if f is in {1,3,5,...,q-2} +// return 0 if f is in {0,2,4,...,q-1} +static int fe_isnegative(const fe *f) { + uint8_t s[32]; + fe_tobytes(s, f); + return s[0] & 1; +} + +static void fe_sq2_tt(fe *h, const fe *f) { + // h = f^2 + fe_sq_tt(h, f); + + // h = h + h + fe_loose tmp; + fe_add(&tmp, h, h); + fe_carry(h, &tmp); +} + +static void fe_pow22523(fe *out, const fe *z) { + fe t0; + fe t1; + fe t2; + int i; + + fe_sq_tt(&t0, z); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 2; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t1, z, &t1); + fe_mul_ttt(&t0, &t0, &t1); + fe_sq_tt(&t0, &t0); + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 5; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t1, &t1, &t0); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 20; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t1, &t1); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t1, &t1, &t0); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 100; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t1, &t1); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t0, &t0); + for (i = 1; i < 2; ++i) { + fe_sq_tt(&t0, &t0); + } + fe_mul_ttt(out, &t0, z); +} + + +// Group operations. + +void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h) { + fe recip; + fe x; + fe y; + + fe_invert(&recip, &h->Z); + fe_mul_ttt(&x, &h->X, &recip); + fe_mul_ttt(&y, &h->Y, &recip); + fe_tobytes(s, &y); + s[31] ^= fe_isnegative(&x) << 7; +} + +static void ge_p3_tobytes(uint8_t s[32], const ge_p3 *h) { + fe recip; + fe x; + fe y; + + fe_invert(&recip, &h->Z); + fe_mul_ttt(&x, &h->X, &recip); + fe_mul_ttt(&y, &h->Y, &recip); + fe_tobytes(s, &y); + s[31] ^= fe_isnegative(&x) << 7; +} + +int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t s[32]) { + fe u; + fe_loose v; + fe v3; + fe vxx; + fe_loose check; + + fe_frombytes(&h->Y, s); + fe_1(&h->Z); + fe_sq_tt(&v3, &h->Y); + fe_mul_ttt(&vxx, &v3, &d); + fe_sub(&v, &v3, &h->Z); // u = y^2-1 + fe_carry(&u, &v); + fe_add(&v, &vxx, &h->Z); // v = dy^2+1 + + fe_sq_tl(&v3, &v); + fe_mul_ttl(&v3, &v3, &v); // v3 = v^3 + fe_sq_tt(&h->X, &v3); + fe_mul_ttl(&h->X, &h->X, &v); + fe_mul_ttt(&h->X, &h->X, &u); // x = uv^7 + + fe_pow22523(&h->X, &h->X); // x = (uv^7)^((q-5)/8) + fe_mul_ttt(&h->X, &h->X, &v3); + fe_mul_ttt(&h->X, &h->X, &u); // x = uv^3(uv^7)^((q-5)/8) + + fe_sq_tt(&vxx, &h->X); + fe_mul_ttl(&vxx, &vxx, &v); + fe_sub(&check, &vxx, &u); + if (fe_isnonzero(&check)) { + fe_add(&check, &vxx, &u); + if (fe_isnonzero(&check)) { + return 0; + } + fe_mul_ttt(&h->X, &h->X, &sqrtm1); + } + + if (fe_isnegative(&h->X) != (s[31] >> 7)) { + fe_loose t; + fe_neg(&t, &h->X); + fe_carry(&h->X, &t); + } + + fe_mul_ttt(&h->T, &h->X, &h->Y); + return 1; +} + +static void ge_p2_0(ge_p2 *h) { + fe_0(&h->X); + fe_1(&h->Y); + fe_1(&h->Z); +} + +static void ge_p3_0(ge_p3 *h) { + fe_0(&h->X); + fe_1(&h->Y); + fe_1(&h->Z); + fe_0(&h->T); +} + +static void ge_cached_0(ge_cached *h) { + fe_loose_1(&h->YplusX); + fe_loose_1(&h->YminusX); + fe_loose_1(&h->Z); + fe_loose_0(&h->T2d); +} + +static void ge_precomp_0(ge_precomp *h) { + fe_loose_1(&h->yplusx); + fe_loose_1(&h->yminusx); + fe_loose_0(&h->xy2d); +} + +// r = p +static void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p) { + fe_copy(&r->X, &p->X); + fe_copy(&r->Y, &p->Y); + fe_copy(&r->Z, &p->Z); +} + +// r = p +void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p) { + fe_add(&r->YplusX, &p->Y, &p->X); + fe_sub(&r->YminusX, &p->Y, &p->X); + fe_copy_lt(&r->Z, &p->Z); + fe_mul_ltt(&r->T2d, &p->T, &d2); +} + +// r = p +void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p) { + fe_mul_tll(&r->X, &p->X, &p->T); + fe_mul_tll(&r->Y, &p->Y, &p->Z); + fe_mul_tll(&r->Z, &p->Z, &p->T); +} + +// r = p +void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p) { + fe_mul_tll(&r->X, &p->X, &p->T); + fe_mul_tll(&r->Y, &p->Y, &p->Z); + fe_mul_tll(&r->Z, &p->Z, &p->T); + fe_mul_tll(&r->T, &p->X, &p->Y); +} + +// r = p +static void ge_p1p1_to_cached(ge_cached *r, const ge_p1p1 *p) { + ge_p3 t; + x25519_ge_p1p1_to_p3(&t, p); + x25519_ge_p3_to_cached(r, &t); +} + +// r = 2 * p +static void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p) { + fe trX, trZ, trT; + fe t0; + + fe_sq_tt(&trX, &p->X); + fe_sq_tt(&trZ, &p->Y); + fe_sq2_tt(&trT, &p->Z); + fe_add(&r->Y, &p->X, &p->Y); + fe_sq_tl(&t0, &r->Y); + + fe_add(&r->Y, &trZ, &trX); + fe_sub(&r->Z, &trZ, &trX); + fe_carry(&trZ, &r->Y); + fe_sub(&r->X, &t0, &trZ); + fe_carry(&trZ, &r->Z); + fe_sub(&r->T, &trT, &trZ); +} + +// r = 2 * p +static void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p) { + ge_p2 q; + ge_p3_to_p2(&q, p); + ge_p2_dbl(r, &q); +} + +// r = p + q +static void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { + fe trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->yplusx); + fe_mul_tll(&trY, &r->Y, &q->yminusx); + fe_mul_tlt(&trT, &q->xy2d, &p->T); + fe_add(&r->T, &p->Z, &p->Z); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_add(&r->Z, &trZ, &trT); + fe_sub(&r->T, &trZ, &trT); +} + +// r = p - q +static void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { + fe trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->yminusx); + fe_mul_tll(&trY, &r->Y, &q->yplusx); + fe_mul_tlt(&trT, &q->xy2d, &p->T); + fe_add(&r->T, &p->Z, &p->Z); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_sub(&r->Z, &trZ, &trT); + fe_add(&r->T, &trZ, &trT); +} + +// r = p + q +void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { + fe trX, trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->YplusX); + fe_mul_tll(&trY, &r->Y, &q->YminusX); + fe_mul_tlt(&trT, &q->T2d, &p->T); + fe_mul_ttl(&trX, &p->Z, &q->Z); + fe_add(&r->T, &trX, &trX); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_add(&r->Z, &trZ, &trT); + fe_sub(&r->T, &trZ, &trT); +} + +// r = p - q +void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { + fe trX, trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->YminusX); + fe_mul_tll(&trY, &r->Y, &q->YplusX); + fe_mul_tlt(&trT, &q->T2d, &p->T); + fe_mul_ttl(&trX, &p->Z, &q->Z); + fe_add(&r->T, &trX, &trX); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_sub(&r->Z, &trZ, &trT); + fe_add(&r->T, &trZ, &trT); +} + +static uint8_t equal(signed char b, signed char c) { + uint8_t ub = b; + uint8_t uc = c; + uint8_t x = ub ^ uc; // 0: yes; 1..255: no + uint32_t y = x; // 0: yes; 1..255: no + y -= 1; // 4294967295: yes; 0..254: no + y >>= 31; // 1: yes; 0: no + return y; +} + +static void cmov(ge_precomp *t, const ge_precomp *u, uint8_t b) { + fe_cmov(&t->yplusx, &u->yplusx, b); + fe_cmov(&t->yminusx, &u->yminusx, b); + fe_cmov(&t->xy2d, &u->xy2d, b); +} + +void x25519_ge_scalarmult_small_precomp( + ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]) { + // precomp_table is first expanded into matching |ge_precomp| + // elements. + ge_precomp multiples[15]; + + unsigned i; + for (i = 0; i < 15; i++) { + // The precomputed table is assumed to already clear the top bit, so + // |fe_frombytes_strict| may be used directly. + const uint8_t *bytes = &precomp_table[i*(2 * 32)]; + fe x, y; + fe_frombytes_strict(&x, bytes); + fe_frombytes_strict(&y, bytes + 32); + + ge_precomp *out = &multiples[i]; + fe_add(&out->yplusx, &y, &x); + fe_sub(&out->yminusx, &y, &x); + fe_mul_ltt(&out->xy2d, &x, &y); + fe_mul_llt(&out->xy2d, &out->xy2d, &d2); + } + + // See the comment above |k25519SmallPrecomp| about the structure of the + // precomputed elements. This loop does 64 additions and 64 doublings to + // calculate the result. + ge_p3_0(h); + + for (i = 63; i < 64; i--) { + unsigned j; + signed char index = 0; + + for (j = 0; j < 4; j++) { + const uint8_t bit = 1 & (a[(8 * j) + (i / 8)] >> (i & 7)); + index |= (bit << j); + } + + ge_precomp e; + ge_precomp_0(&e); + + for (j = 1; j < 16; j++) { + cmov(&e, &multiples[j-1], equal(index, j)); + } + + ge_cached cached; + ge_p1p1 r; + x25519_ge_p3_to_cached(&cached, h); + x25519_ge_add(&r, h, &cached); + x25519_ge_p1p1_to_p3(h, &r); + + ge_madd(&r, h, &e); + x25519_ge_p1p1_to_p3(h, &r); + } +} + +#if defined(OPENSSL_SMALL) + +void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]) { + x25519_ge_scalarmult_small_precomp(h, a, k25519SmallPrecomp); +} + +#else + +static uint8_t negative(signed char b) { + uint32_t x = b; + x >>= 31; // 1: yes; 0: no + return x; +} + +static void table_select(ge_precomp *t, int pos, signed char b) { + ge_precomp minust; + uint8_t bnegative = negative(b); + uint8_t babs = b - ((uint8_t)((-bnegative) & b) << 1); + + ge_precomp_0(t); + cmov(t, &k25519Precomp[pos][0], equal(babs, 1)); + cmov(t, &k25519Precomp[pos][1], equal(babs, 2)); + cmov(t, &k25519Precomp[pos][2], equal(babs, 3)); + cmov(t, &k25519Precomp[pos][3], equal(babs, 4)); + cmov(t, &k25519Precomp[pos][4], equal(babs, 5)); + cmov(t, &k25519Precomp[pos][5], equal(babs, 6)); + cmov(t, &k25519Precomp[pos][6], equal(babs, 7)); + cmov(t, &k25519Precomp[pos][7], equal(babs, 8)); + fe_copy_ll(&minust.yplusx, &t->yminusx); + fe_copy_ll(&minust.yminusx, &t->yplusx); + + // NOTE: the input table is canonical, but types don't encode it + fe tmp; + fe_carry(&tmp, &t->xy2d); + fe_neg(&minust.xy2d, &tmp); + + cmov(t, &minust, bnegative); +} + +// h = a * B +// where a = a[0]+256*a[1]+...+256^31 a[31] +// B is the Ed25519 base point (x,4/5) with x positive. +// +// Preconditions: +// a[31] <= 127 +void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) { + signed char e[64]; + signed char carry; + ge_p1p1 r; + ge_p2 s; + ge_precomp t; + int i; + + for (i = 0; i < 32; ++i) { + e[2 * i + 0] = (a[i] >> 0) & 15; + e[2 * i + 1] = (a[i] >> 4) & 15; + } + // each e[i] is between 0 and 15 + // e[63] is between 0 and 7 + + carry = 0; + for (i = 0; i < 63; ++i) { + e[i] += carry; + carry = e[i] + 8; + carry >>= 4; + e[i] -= carry << 4; + } + e[63] += carry; + // each e[i] is between -8 and 8 + + ge_p3_0(h); + for (i = 1; i < 64; i += 2) { + table_select(&t, i / 2, e[i]); + ge_madd(&r, h, &t); + x25519_ge_p1p1_to_p3(h, &r); + } + + ge_p3_dbl(&r, h); + x25519_ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + x25519_ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + x25519_ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + x25519_ge_p1p1_to_p3(h, &r); + + for (i = 0; i < 64; i += 2) { + table_select(&t, i / 2, e[i]); + ge_madd(&r, h, &t); + x25519_ge_p1p1_to_p3(h, &r); + } +} + +#endif + +static void cmov_cached(ge_cached *t, ge_cached *u, uint8_t b) { + fe_cmov(&t->YplusX, &u->YplusX, b); + fe_cmov(&t->YminusX, &u->YminusX, b); + fe_cmov(&t->Z, &u->Z, b); + fe_cmov(&t->T2d, &u->T2d, b); +} + +// r = scalar * A. +// where a = a[0]+256*a[1]+...+256^31 a[31]. +void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A) { + ge_p2 Ai_p2[8]; + ge_cached Ai[16]; + ge_p1p1 t; + + ge_cached_0(&Ai[0]); + x25519_ge_p3_to_cached(&Ai[1], A); + ge_p3_to_p2(&Ai_p2[1], A); + + unsigned i; + for (i = 2; i < 16; i += 2) { + ge_p2_dbl(&t, &Ai_p2[i / 2]); + ge_p1p1_to_cached(&Ai[i], &t); + if (i < 8) { + x25519_ge_p1p1_to_p2(&Ai_p2[i], &t); + } + x25519_ge_add(&t, A, &Ai[i]); + ge_p1p1_to_cached(&Ai[i + 1], &t); + if (i < 7) { + x25519_ge_p1p1_to_p2(&Ai_p2[i + 1], &t); + } + } + + ge_p2_0(r); + ge_p3 u; + + for (i = 0; i < 256; i += 4) { + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p2(r, &t); + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p2(r, &t); + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p2(r, &t); + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p3(&u, &t); + + uint8_t index = scalar[31 - i/8]; + index >>= 4 - (i & 4); + index &= 0xf; + + unsigned j; + ge_cached selected; + ge_cached_0(&selected); + for (j = 0; j < 16; j++) { + cmov_cached(&selected, &Ai[j], equal(j, index)); + } + + x25519_ge_add(&t, &u, &selected); + x25519_ge_p1p1_to_p2(r, &t); + } +} + +static void slide(signed char *r, const uint8_t *a) { + int i; + int b; + int k; + + for (i = 0; i < 256; ++i) { + r[i] = 1 & (a[i >> 3] >> (i & 7)); + } + + for (i = 0; i < 256; ++i) { + if (r[i]) { + for (b = 1; b <= 6 && i + b < 256; ++b) { + if (r[i + b]) { + if (r[i] + (r[i + b] << b) <= 15) { + r[i] += r[i + b] << b; + r[i + b] = 0; + } else if (r[i] - (r[i + b] << b) >= -15) { + r[i] -= r[i + b] << b; + for (k = i + b; k < 256; ++k) { + if (!r[k]) { + r[k] = 1; + break; + } + r[k] = 0; + } + } else { + break; + } + } + } + } + } +} + +// r = a * A + b * B +// where a = a[0]+256*a[1]+...+256^31 a[31]. +// and b = b[0]+256*b[1]+...+256^31 b[31]. +// B is the Ed25519 base point (x,4/5) with x positive. +static void ge_double_scalarmult_vartime(ge_p2 *r, const uint8_t *a, + const ge_p3 *A, const uint8_t *b) { + signed char aslide[256]; + signed char bslide[256]; + ge_cached Ai[8]; // A,3A,5A,7A,9A,11A,13A,15A + ge_p1p1 t; + ge_p3 u; + ge_p3 A2; + int i; + + slide(aslide, a); + slide(bslide, b); + + x25519_ge_p3_to_cached(&Ai[0], A); + ge_p3_dbl(&t, A); + x25519_ge_p1p1_to_p3(&A2, &t); + x25519_ge_add(&t, &A2, &Ai[0]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[1], &u); + x25519_ge_add(&t, &A2, &Ai[1]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[2], &u); + x25519_ge_add(&t, &A2, &Ai[2]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[3], &u); + x25519_ge_add(&t, &A2, &Ai[3]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[4], &u); + x25519_ge_add(&t, &A2, &Ai[4]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[5], &u); + x25519_ge_add(&t, &A2, &Ai[5]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[6], &u); + x25519_ge_add(&t, &A2, &Ai[6]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[7], &u); + + ge_p2_0(r); + + for (i = 255; i >= 0; --i) { + if (aslide[i] || bslide[i]) { + break; + } + } + + for (; i >= 0; --i) { + ge_p2_dbl(&t, r); + + if (aslide[i] > 0) { + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_add(&t, &u, &Ai[aslide[i] / 2]); + } else if (aslide[i] < 0) { + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); + } + + if (bslide[i] > 0) { + x25519_ge_p1p1_to_p3(&u, &t); + ge_madd(&t, &u, &Bi[bslide[i] / 2]); + } else if (bslide[i] < 0) { + x25519_ge_p1p1_to_p3(&u, &t); + ge_msub(&t, &u, &Bi[(-bslide[i]) / 2]); + } + + x25519_ge_p1p1_to_p2(r, &t); + } +} + +// int64_lshift21 returns |a << 21| but is defined when shifting bits into the +// sign bit. This works around a language flaw in C. +static inline int64_t int64_lshift21(int64_t a) { + return (int64_t)((uint64_t)a << 21); +} + +// The set of scalars is \Z/l +// where l = 2^252 + 27742317777372353535851937790883648493. + +// Input: +// s[0]+256*s[1]+...+256^63*s[63] = s +// +// Output: +// s[0]+256*s[1]+...+256^31*s[31] = s mod l +// where l = 2^252 + 27742317777372353535851937790883648493. +// Overwrites s in place. +void x25519_sc_reduce(uint8_t s[64]) { + int64_t s0 = 2097151 & load_3(s); + int64_t s1 = 2097151 & (load_4(s + 2) >> 5); + int64_t s2 = 2097151 & (load_3(s + 5) >> 2); + int64_t s3 = 2097151 & (load_4(s + 7) >> 7); + int64_t s4 = 2097151 & (load_4(s + 10) >> 4); + int64_t s5 = 2097151 & (load_3(s + 13) >> 1); + int64_t s6 = 2097151 & (load_4(s + 15) >> 6); + int64_t s7 = 2097151 & (load_3(s + 18) >> 3); + int64_t s8 = 2097151 & load_3(s + 21); + int64_t s9 = 2097151 & (load_4(s + 23) >> 5); + int64_t s10 = 2097151 & (load_3(s + 26) >> 2); + int64_t s11 = 2097151 & (load_4(s + 28) >> 7); + int64_t s12 = 2097151 & (load_4(s + 31) >> 4); + int64_t s13 = 2097151 & (load_3(s + 34) >> 1); + int64_t s14 = 2097151 & (load_4(s + 36) >> 6); + int64_t s15 = 2097151 & (load_3(s + 39) >> 3); + int64_t s16 = 2097151 & load_3(s + 42); + int64_t s17 = 2097151 & (load_4(s + 44) >> 5); + int64_t s18 = 2097151 & (load_3(s + 47) >> 2); + int64_t s19 = 2097151 & (load_4(s + 49) >> 7); + int64_t s20 = 2097151 & (load_4(s + 52) >> 4); + int64_t s21 = 2097151 & (load_3(s + 55) >> 1); + int64_t s22 = 2097151 & (load_4(s + 57) >> 6); + int64_t s23 = (load_4(s + 60) >> 3); + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + int64_t carry10; + int64_t carry11; + int64_t carry12; + int64_t carry13; + int64_t carry14; + int64_t carry15; + int64_t carry16; + + s11 += s23 * 666643; + s12 += s23 * 470296; + s13 += s23 * 654183; + s14 -= s23 * 997805; + s15 += s23 * 136657; + s16 -= s23 * 683901; + s23 = 0; + + s10 += s22 * 666643; + s11 += s22 * 470296; + s12 += s22 * 654183; + s13 -= s22 * 997805; + s14 += s22 * 136657; + s15 -= s22 * 683901; + s22 = 0; + + s9 += s21 * 666643; + s10 += s21 * 470296; + s11 += s21 * 654183; + s12 -= s21 * 997805; + s13 += s21 * 136657; + s14 -= s21 * 683901; + s21 = 0; + + s8 += s20 * 666643; + s9 += s20 * 470296; + s10 += s20 * 654183; + s11 -= s20 * 997805; + s12 += s20 * 136657; + s13 -= s20 * 683901; + s20 = 0; + + s7 += s19 * 666643; + s8 += s19 * 470296; + s9 += s19 * 654183; + s10 -= s19 * 997805; + s11 += s19 * 136657; + s12 -= s19 * 683901; + s19 = 0; + + s6 += s18 * 666643; + s7 += s18 * 470296; + s8 += s18 * 654183; + s9 -= s18 * 997805; + s10 += s18 * 136657; + s11 -= s18 * 683901; + s18 = 0; + + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= int64_lshift21(carry12); + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= int64_lshift21(carry14); + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= int64_lshift21(carry16); + + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= int64_lshift21(carry13); + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= int64_lshift21(carry15); + + s5 += s17 * 666643; + s6 += s17 * 470296; + s7 += s17 * 654183; + s8 -= s17 * 997805; + s9 += s17 * 136657; + s10 -= s17 * 683901; + s17 = 0; + + s4 += s16 * 666643; + s5 += s16 * 470296; + s6 += s16 * 654183; + s7 -= s16 * 997805; + s8 += s16 * 136657; + s9 -= s16 * 683901; + s16 = 0; + + s3 += s15 * 666643; + s4 += s15 * 470296; + s5 += s15 * 654183; + s6 -= s15 * 997805; + s7 += s15 * 136657; + s8 -= s15 * 683901; + s15 = 0; + + s2 += s14 * 666643; + s3 += s14 * 470296; + s4 += s14 * 654183; + s5 -= s14 * 997805; + s6 += s14 * 136657; + s7 -= s14 * 683901; + s14 = 0; + + s1 += s13 * 666643; + s2 += s13 * 470296; + s3 += s13 * 654183; + s4 -= s13 * 997805; + s5 += s13 * 136657; + s6 -= s13 * 683901; + s13 = 0; + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry11 = s11 >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + s[0] = s0 >> 0; + s[1] = s0 >> 8; + s[2] = (s0 >> 16) | (s1 << 5); + s[3] = s1 >> 3; + s[4] = s1 >> 11; + s[5] = (s1 >> 19) | (s2 << 2); + s[6] = s2 >> 6; + s[7] = (s2 >> 14) | (s3 << 7); + s[8] = s3 >> 1; + s[9] = s3 >> 9; + s[10] = (s3 >> 17) | (s4 << 4); + s[11] = s4 >> 4; + s[12] = s4 >> 12; + s[13] = (s4 >> 20) | (s5 << 1); + s[14] = s5 >> 7; + s[15] = (s5 >> 15) | (s6 << 6); + s[16] = s6 >> 2; + s[17] = s6 >> 10; + s[18] = (s6 >> 18) | (s7 << 3); + s[19] = s7 >> 5; + s[20] = s7 >> 13; + s[21] = s8 >> 0; + s[22] = s8 >> 8; + s[23] = (s8 >> 16) | (s9 << 5); + s[24] = s9 >> 3; + s[25] = s9 >> 11; + s[26] = (s9 >> 19) | (s10 << 2); + s[27] = s10 >> 6; + s[28] = (s10 >> 14) | (s11 << 7); + s[29] = s11 >> 1; + s[30] = s11 >> 9; + s[31] = s11 >> 17; +} + +// Input: +// a[0]+256*a[1]+...+256^31*a[31] = a +// b[0]+256*b[1]+...+256^31*b[31] = b +// c[0]+256*c[1]+...+256^31*c[31] = c +// +// Output: +// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l +// where l = 2^252 + 27742317777372353535851937790883648493. +static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b, + const uint8_t *c) { + int64_t a0 = 2097151 & load_3(a); + int64_t a1 = 2097151 & (load_4(a + 2) >> 5); + int64_t a2 = 2097151 & (load_3(a + 5) >> 2); + int64_t a3 = 2097151 & (load_4(a + 7) >> 7); + int64_t a4 = 2097151 & (load_4(a + 10) >> 4); + int64_t a5 = 2097151 & (load_3(a + 13) >> 1); + int64_t a6 = 2097151 & (load_4(a + 15) >> 6); + int64_t a7 = 2097151 & (load_3(a + 18) >> 3); + int64_t a8 = 2097151 & load_3(a + 21); + int64_t a9 = 2097151 & (load_4(a + 23) >> 5); + int64_t a10 = 2097151 & (load_3(a + 26) >> 2); + int64_t a11 = (load_4(a + 28) >> 7); + int64_t b0 = 2097151 & load_3(b); + int64_t b1 = 2097151 & (load_4(b + 2) >> 5); + int64_t b2 = 2097151 & (load_3(b + 5) >> 2); + int64_t b3 = 2097151 & (load_4(b + 7) >> 7); + int64_t b4 = 2097151 & (load_4(b + 10) >> 4); + int64_t b5 = 2097151 & (load_3(b + 13) >> 1); + int64_t b6 = 2097151 & (load_4(b + 15) >> 6); + int64_t b7 = 2097151 & (load_3(b + 18) >> 3); + int64_t b8 = 2097151 & load_3(b + 21); + int64_t b9 = 2097151 & (load_4(b + 23) >> 5); + int64_t b10 = 2097151 & (load_3(b + 26) >> 2); + int64_t b11 = (load_4(b + 28) >> 7); + int64_t c0 = 2097151 & load_3(c); + int64_t c1 = 2097151 & (load_4(c + 2) >> 5); + int64_t c2 = 2097151 & (load_3(c + 5) >> 2); + int64_t c3 = 2097151 & (load_4(c + 7) >> 7); + int64_t c4 = 2097151 & (load_4(c + 10) >> 4); + int64_t c5 = 2097151 & (load_3(c + 13) >> 1); + int64_t c6 = 2097151 & (load_4(c + 15) >> 6); + int64_t c7 = 2097151 & (load_3(c + 18) >> 3); + int64_t c8 = 2097151 & load_3(c + 21); + int64_t c9 = 2097151 & (load_4(c + 23) >> 5); + int64_t c10 = 2097151 & (load_3(c + 26) >> 2); + int64_t c11 = (load_4(c + 28) >> 7); + int64_t s0; + int64_t s1; + int64_t s2; + int64_t s3; + int64_t s4; + int64_t s5; + int64_t s6; + int64_t s7; + int64_t s8; + int64_t s9; + int64_t s10; + int64_t s11; + int64_t s12; + int64_t s13; + int64_t s14; + int64_t s15; + int64_t s16; + int64_t s17; + int64_t s18; + int64_t s19; + int64_t s20; + int64_t s21; + int64_t s22; + int64_t s23; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + int64_t carry10; + int64_t carry11; + int64_t carry12; + int64_t carry13; + int64_t carry14; + int64_t carry15; + int64_t carry16; + int64_t carry17; + int64_t carry18; + int64_t carry19; + int64_t carry20; + int64_t carry21; + int64_t carry22; + + s0 = c0 + a0 * b0; + s1 = c1 + a0 * b1 + a1 * b0; + s2 = c2 + a0 * b2 + a1 * b1 + a2 * b0; + s3 = c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; + s4 = c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; + s5 = c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; + s6 = c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; + s7 = c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + + a6 * b1 + a7 * b0; + s8 = c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + + a6 * b2 + a7 * b1 + a8 * b0; + s9 = c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + + a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; + s10 = c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + + a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; + s11 = c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + + a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; + s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + + a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; + s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + + a9 * b4 + a10 * b3 + a11 * b2; + s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 + + a10 * b4 + a11 * b3; + s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 + + a11 * b4; + s16 = a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; + s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; + s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; + s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; + s20 = a9 * b11 + a10 * b10 + a11 * b9; + s21 = a10 * b11 + a11 * b10; + s22 = a11 * b11; + s23 = 0; + + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= int64_lshift21(carry12); + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= int64_lshift21(carry14); + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= int64_lshift21(carry16); + carry18 = (s18 + (1 << 20)) >> 21; + s19 += carry18; + s18 -= int64_lshift21(carry18); + carry20 = (s20 + (1 << 20)) >> 21; + s21 += carry20; + s20 -= int64_lshift21(carry20); + carry22 = (s22 + (1 << 20)) >> 21; + s23 += carry22; + s22 -= int64_lshift21(carry22); + + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= int64_lshift21(carry13); + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= int64_lshift21(carry15); + carry17 = (s17 + (1 << 20)) >> 21; + s18 += carry17; + s17 -= int64_lshift21(carry17); + carry19 = (s19 + (1 << 20)) >> 21; + s20 += carry19; + s19 -= int64_lshift21(carry19); + carry21 = (s21 + (1 << 20)) >> 21; + s22 += carry21; + s21 -= int64_lshift21(carry21); + + s11 += s23 * 666643; + s12 += s23 * 470296; + s13 += s23 * 654183; + s14 -= s23 * 997805; + s15 += s23 * 136657; + s16 -= s23 * 683901; + s23 = 0; + + s10 += s22 * 666643; + s11 += s22 * 470296; + s12 += s22 * 654183; + s13 -= s22 * 997805; + s14 += s22 * 136657; + s15 -= s22 * 683901; + s22 = 0; + + s9 += s21 * 666643; + s10 += s21 * 470296; + s11 += s21 * 654183; + s12 -= s21 * 997805; + s13 += s21 * 136657; + s14 -= s21 * 683901; + s21 = 0; + + s8 += s20 * 666643; + s9 += s20 * 470296; + s10 += s20 * 654183; + s11 -= s20 * 997805; + s12 += s20 * 136657; + s13 -= s20 * 683901; + s20 = 0; + + s7 += s19 * 666643; + s8 += s19 * 470296; + s9 += s19 * 654183; + s10 -= s19 * 997805; + s11 += s19 * 136657; + s12 -= s19 * 683901; + s19 = 0; + + s6 += s18 * 666643; + s7 += s18 * 470296; + s8 += s18 * 654183; + s9 -= s18 * 997805; + s10 += s18 * 136657; + s11 -= s18 * 683901; + s18 = 0; + + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= int64_lshift21(carry12); + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= int64_lshift21(carry14); + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= int64_lshift21(carry16); + + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= int64_lshift21(carry13); + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= int64_lshift21(carry15); + + s5 += s17 * 666643; + s6 += s17 * 470296; + s7 += s17 * 654183; + s8 -= s17 * 997805; + s9 += s17 * 136657; + s10 -= s17 * 683901; + s17 = 0; + + s4 += s16 * 666643; + s5 += s16 * 470296; + s6 += s16 * 654183; + s7 -= s16 * 997805; + s8 += s16 * 136657; + s9 -= s16 * 683901; + s16 = 0; + + s3 += s15 * 666643; + s4 += s15 * 470296; + s5 += s15 * 654183; + s6 -= s15 * 997805; + s7 += s15 * 136657; + s8 -= s15 * 683901; + s15 = 0; + + s2 += s14 * 666643; + s3 += s14 * 470296; + s4 += s14 * 654183; + s5 -= s14 * 997805; + s6 += s14 * 136657; + s7 -= s14 * 683901; + s14 = 0; + + s1 += s13 * 666643; + s2 += s13 * 470296; + s3 += s13 * 654183; + s4 -= s13 * 997805; + s5 += s13 * 136657; + s6 -= s13 * 683901; + s13 = 0; + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry11 = s11 >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + s[0] = s0 >> 0; + s[1] = s0 >> 8; + s[2] = (s0 >> 16) | (s1 << 5); + s[3] = s1 >> 3; + s[4] = s1 >> 11; + s[5] = (s1 >> 19) | (s2 << 2); + s[6] = s2 >> 6; + s[7] = (s2 >> 14) | (s3 << 7); + s[8] = s3 >> 1; + s[9] = s3 >> 9; + s[10] = (s3 >> 17) | (s4 << 4); + s[11] = s4 >> 4; + s[12] = s4 >> 12; + s[13] = (s4 >> 20) | (s5 << 1); + s[14] = s5 >> 7; + s[15] = (s5 >> 15) | (s6 << 6); + s[16] = s6 >> 2; + s[17] = s6 >> 10; + s[18] = (s6 >> 18) | (s7 << 3); + s[19] = s7 >> 5; + s[20] = s7 >> 13; + s[21] = s8 >> 0; + s[22] = s8 >> 8; + s[23] = (s8 >> 16) | (s9 << 5); + s[24] = s9 >> 3; + s[25] = s9 >> 11; + s[26] = (s9 >> 19) | (s10 << 2); + s[27] = s10 >> 6; + s[28] = (s10 >> 14) | (s11 << 7); + s[29] = s11 >> 1; + s[30] = s11 >> 9; + s[31] = s11 >> 17; +} + +void ED25519_keypair(uint8_t out_public_key[32], uint8_t out_private_key[64]) { + uint8_t seed[32]; + RAND_bytes(seed, 32); + ED25519_keypair_from_seed(out_public_key, out_private_key, seed); +} + +int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, + size_t message_len, const uint8_t private_key[64]) { + // NOTE: The documentation on this function says that it returns zero on + // allocation failure. While that can't happen with the current + // implementation, we want to reserve the ability to allocate in this + // implementation in the future. + + uint8_t az[SHA512_DIGEST_LENGTH]; + SHA512(private_key, 32, az); + + az[0] &= 248; + az[31] &= 63; + az[31] |= 64; + + SHA512_CTX hash_ctx; + SHA512_Init(&hash_ctx); + SHA512_Update(&hash_ctx, az + 32, 32); + SHA512_Update(&hash_ctx, message, message_len); + uint8_t nonce[SHA512_DIGEST_LENGTH]; + SHA512_Final(nonce, &hash_ctx); + + x25519_sc_reduce(nonce); + ge_p3 R; + x25519_ge_scalarmult_base(&R, nonce); + ge_p3_tobytes(out_sig, &R); + + SHA512_Init(&hash_ctx); + SHA512_Update(&hash_ctx, out_sig, 32); + SHA512_Update(&hash_ctx, private_key + 32, 32); + SHA512_Update(&hash_ctx, message, message_len); + uint8_t hram[SHA512_DIGEST_LENGTH]; + SHA512_Final(hram, &hash_ctx); + + x25519_sc_reduce(hram); + sc_muladd(out_sig + 32, hram, az, nonce); + + return 1; +} + +int ED25519_verify(const uint8_t *message, size_t message_len, + const uint8_t signature[64], const uint8_t public_key[32]) { + ge_p3 A; + if ((signature[63] & 224) != 0 || + !x25519_ge_frombytes_vartime(&A, public_key)) { + return 0; + } + + fe_loose t; + fe_neg(&t, &A.X); + fe_carry(&A.X, &t); + fe_neg(&t, &A.T); + fe_carry(&A.T, &t); + + uint8_t pkcopy[32]; + OPENSSL_memcpy(pkcopy, public_key, 32); + uint8_t rcopy[32]; + OPENSSL_memcpy(rcopy, signature, 32); + union { + uint64_t u64[4]; + uint8_t u8[32]; + } scopy; + OPENSSL_memcpy(&scopy.u8[0], signature + 32, 32); + + // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in + // the range [0, order) in order to prevent signature malleability. + + // kOrder is the order of Curve25519 in little-endian form. + static const uint64_t kOrder[4] = { + UINT64_C(0x5812631a5cf5d3ed), + UINT64_C(0x14def9dea2f79cd6), + 0, + UINT64_C(0x1000000000000000), + }; + for (size_t i = 3;; i--) { + if (scopy.u64[i] > kOrder[i]) { + return 0; + } else if (scopy.u64[i] < kOrder[i]) { + break; + } else if (i == 0) { + return 0; + } + } + + SHA512_CTX hash_ctx; + SHA512_Init(&hash_ctx); + SHA512_Update(&hash_ctx, signature, 32); + SHA512_Update(&hash_ctx, public_key, 32); + SHA512_Update(&hash_ctx, message, message_len); + uint8_t h[SHA512_DIGEST_LENGTH]; + SHA512_Final(h, &hash_ctx); + + x25519_sc_reduce(h); + + ge_p2 R; + ge_double_scalarmult_vartime(&R, h, &A, scopy.u8); + + uint8_t rcheck[32]; + x25519_ge_tobytes(rcheck, &R); + + return CRYPTO_memcmp(rcheck, rcopy, sizeof(rcheck)) == 0; +} + +void ED25519_keypair_from_seed(uint8_t out_public_key[32], + uint8_t out_private_key[64], + const uint8_t seed[32]) { + uint8_t az[SHA512_DIGEST_LENGTH]; + SHA512(seed, 32, az); + + az[0] &= 248; + az[31] &= 127; + az[31] |= 64; + + ge_p3 A; + x25519_ge_scalarmult_base(&A, az); + ge_p3_tobytes(out_public_key, &A); + + OPENSSL_memcpy(out_private_key, seed, 32); + OPENSSL_memcpy(out_private_key + 32, out_public_key, 32); +} + + +static void x25519_scalar_mult_generic(uint8_t out[32], + const uint8_t scalar[32], + const uint8_t point[32]) { + fe x1, x2, z2, x3, z3, tmp0, tmp1; + fe_loose x2l, z2l, x3l, tmp0l, tmp1l; + + uint8_t e[32]; + OPENSSL_memcpy(e, scalar, 32); + e[0] &= 248; + e[31] &= 127; + e[31] |= 64; + + // The following implementation was transcribed to Coq and proven to + // correspond to unary scalar multiplication in affine coordinates given that + // x1 != 0 is the x coordinate of some point on the curve. It was also checked + // in Coq that doing a ladderstep with x1 = x3 = 0 gives z2' = z3' = 0, and z2 + // = z3 = 0 gives z2' = z3' = 0. The statement was quantified over the + // underlying field, so it applies to Curve25519 itself and the quadratic + // twist of Curve25519. It was not proven in Coq that prime-field arithmetic + // correctly simulates extension-field arithmetic on prime-field values. + // The decoding of the byte array representation of e was not considered. + // Specification of Montgomery curves in affine coordinates: + // + // Proof that these form a group that is isomorphic to a Weierstrass curve: + // + // Coq transcription and correctness proof of the loop (where scalarbits=255): + // + // + // preconditions: 0 <= e < 2^255 (not necessarily e < order), fe_invert(0) = 0 + fe_frombytes(&x1, point); + fe_1(&x2); + fe_0(&z2); + fe_copy(&x3, &x1); + fe_1(&z3); + + unsigned swap = 0; + int pos; + for (pos = 254; pos >= 0; --pos) { + // loop invariant as of right before the test, for the case where x1 != 0: + // pos >= -1; if z2 = 0 then x2 is nonzero; if z3 = 0 then x3 is nonzero + // let r := e >> (pos+1) in the following equalities of projective points: + // to_xz (r*P) === if swap then (x3, z3) else (x2, z2) + // to_xz ((r+1)*P) === if swap then (x2, z2) else (x3, z3) + // x1 is the nonzero x coordinate of the nonzero point (r*P-(r+1)*P) + unsigned b = 1 & (e[pos / 8] >> (pos & 7)); + swap ^= b; + fe_cswap(&x2, &x3, swap); + fe_cswap(&z2, &z3, swap); + swap = b; + // Coq transcription of ladderstep formula (called from transcribed loop): + // + // + // x1 != 0 + // x1 = 0 + fe_sub(&tmp0l, &x3, &z3); + fe_sub(&tmp1l, &x2, &z2); + fe_add(&x2l, &x2, &z2); + fe_add(&z2l, &x3, &z3); + fe_mul_tll(&z3, &tmp0l, &x2l); + fe_mul_tll(&z2, &z2l, &tmp1l); + fe_sq_tl(&tmp0, &tmp1l); + fe_sq_tl(&tmp1, &x2l); + fe_add(&x3l, &z3, &z2); + fe_sub(&z2l, &z3, &z2); + fe_mul_ttt(&x2, &tmp1, &tmp0); + fe_sub(&tmp1l, &tmp1, &tmp0); + fe_sq_tl(&z2, &z2l); + fe_mul121666(&z3, &tmp1l); + fe_sq_tl(&x3, &x3l); + fe_add(&tmp0l, &tmp0, &z3); + fe_mul_ttt(&z3, &x1, &z2); + fe_mul_tll(&z2, &tmp1l, &tmp0l); + } + // here pos=-1, so r=e, so to_xz (e*P) === if swap then (x3, z3) else (x2, z2) + fe_cswap(&x2, &x3, swap); + fe_cswap(&z2, &z3, swap); + + fe_invert(&z2, &z2); + fe_mul_ttt(&x2, &x2, &z2); + fe_tobytes(out, &x2); +} + +static void x25519_scalar_mult(uint8_t out[32], const uint8_t scalar[32], + const uint8_t point[32]) { +#if defined(BORINGSSL_X25519_NEON) + if (CRYPTO_is_NEON_capable()) { + x25519_NEON(out, scalar, point); + return; + } +#endif + + x25519_scalar_mult_generic(out, scalar, point); +} + +void X25519_keypair(uint8_t out_public_value[32], uint8_t out_private_key[32]) { + RAND_bytes(out_private_key, 32); + + // All X25519 implementations should decode scalars correctly (see + // https://tools.ietf.org/html/rfc7748#section-5). However, if an + // implementation doesn't then it might interoperate with random keys a + // fraction of the time because they'll, randomly, happen to be correctly + // formed. + // + // Thus we do the opposite of the masking here to make sure that our private + // keys are never correctly masked and so, hopefully, any incorrect + // implementations are deterministically broken. + // + // This does not affect security because, although we're throwing away + // entropy, a valid implementation of scalarmult should throw away the exact + // same bits anyway. + out_private_key[0] |= ~248; + out_private_key[31] &= ~64; + out_private_key[31] |= ~127; + + X25519_public_from_private(out_public_value, out_private_key); +} + +int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32], + const uint8_t peer_public_value[32]) { + static const uint8_t kZeros[32] = {0}; + x25519_scalar_mult(out_shared_key, private_key, peer_public_value); + // The all-zero output results when the input is a point of small order. + return CRYPTO_memcmp(kZeros, out_shared_key, 32) != 0; +} + +void X25519_public_from_private(uint8_t out_public_value[32], + const uint8_t private_key[32]) { +#if defined(BORINGSSL_X25519_NEON) + if (CRYPTO_is_NEON_capable()) { + static const uint8_t kMongomeryBasePoint[32] = {9}; + x25519_NEON(out_public_value, private_key, kMongomeryBasePoint); + return; + } +#endif + + uint8_t e[32]; + OPENSSL_memcpy(e, private_key, 32); + e[0] &= 248; + e[31] &= 127; + e[31] |= 64; + + ge_p3 A; + x25519_ge_scalarmult_base(&A, e); + + // We only need the u-coordinate of the curve25519 point. The map is + // u=(y+1)/(1-y). Since y=Y/Z, this gives u=(Z+Y)/(Z-Y). + fe_loose zplusy, zminusy; + fe zminusy_inv; + fe_add(&zplusy, &A.Z, &A.Y); + fe_sub(&zminusy, &A.Z, &A.Y); + fe_loose_invert(&zminusy_inv, &zminusy); + fe_mul_tlt(&zminusy_inv, &zplusy, &zminusy_inv); + fe_tobytes(out_public_value, &zminusy_inv); +} diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c.grpc_back new file mode 100644 index 000000000..564becb7a --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519.c.grpc_back @@ -0,0 +1,2167 @@ +// The MIT License (MIT) +// +// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Some of this code is taken from the ref10 version of Ed25519 in SUPERCOP +// 20141124 (http://bench.cr.yp.to/supercop.html). That code is released as +// public domain but parts have been replaced with code generated by Fiat +// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. +// +// The field functions are shared by Ed25519 and X25519 where possible. + +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "internal.h" +#include "../../crypto/internal.h" + + +// Various pre-computed constants. +#include "./curve25519_tables.h" + +#if defined(BORINGSSL_CURVE25519_64BIT) +#include "./curve25519_64.h" +#else +#include "./curve25519_32.h" +#endif // BORINGSSL_CURVE25519_64BIT + + +// Low-level intrinsic operations + +static uint64_t load_3(const uint8_t *in) { + uint64_t result; + result = (uint64_t)in[0]; + result |= ((uint64_t)in[1]) << 8; + result |= ((uint64_t)in[2]) << 16; + return result; +} + +static uint64_t load_4(const uint8_t *in) { + uint64_t result; + result = (uint64_t)in[0]; + result |= ((uint64_t)in[1]) << 8; + result |= ((uint64_t)in[2]) << 16; + result |= ((uint64_t)in[3]) << 24; + return result; +} + + +// Field operations. + +#if defined(BORINGSSL_CURVE25519_64BIT) + +typedef uint64_t fe_limb_t; +#define FE_NUM_LIMBS 5 + +// assert_fe asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc], +// [0x0 ~> 0x8cccccccccccc]] +// +// See comments in curve25519_64.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 5; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= UINT64_C(0x8cccccccccccc)); \ + } \ + } while (0) + +// assert_fe_loose asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664], +// [0x0 ~> 0x1a666666666664]] +// +// See comments in curve25519_64.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe_loose(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 5; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= UINT64_C(0x1a666666666664)); \ + } \ + } while (0) + +#else + +typedef uint32_t fe_limb_t; +#define FE_NUM_LIMBS 10 + +// assert_fe asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], +// [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] +// +// See comments in curve25519_32.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= \ + ((_assert_fe_i & 1) ? 0x2333333u : 0x4666666u)); \ + } \ + } while (0) + +// assert_fe_loose asserts that |f| satisfies bounds: +// +// [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], +// [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] +// +// See comments in curve25519_32.h for which functions use these bounds for +// inputs or outputs. +#define assert_fe_loose(f) \ + do { \ + for (unsigned _assert_fe_i = 0; _assert_fe_i < 10; _assert_fe_i++) { \ + assert(f[_assert_fe_i] <= \ + ((_assert_fe_i & 1) ? 0x6999999u : 0xd333332u)); \ + } \ + } while (0) + +#endif // BORINGSSL_CURVE25519_64BIT + +OPENSSL_STATIC_ASSERT(sizeof(fe) == sizeof(fe_limb_t) * FE_NUM_LIMBS, + "fe_limb_t[FE_NUM_LIMBS] is inconsistent with fe"); + +static void fe_frombytes_strict(fe *h, const uint8_t s[32]) { + // |fiat_25519_from_bytes| requires the top-most bit be clear. + assert((s[31] & 0x80) == 0); + fiat_25519_from_bytes(h->v, s); + assert_fe(h->v); +} + +static void fe_frombytes(fe *h, const uint8_t s[32]) { + uint8_t s_copy[32]; + OPENSSL_memcpy(s_copy, s, 32); + s_copy[31] &= 0x7f; + fe_frombytes_strict(h, s_copy); +} + +static void fe_tobytes(uint8_t s[32], const fe *f) { + assert_fe(f->v); + fiat_25519_to_bytes(s, f->v); +} + +// h = 0 +static void fe_0(fe *h) { + OPENSSL_memset(h, 0, sizeof(fe)); +} + +static void fe_loose_0(fe_loose *h) { + OPENSSL_memset(h, 0, sizeof(fe_loose)); +} + +// h = 1 +static void fe_1(fe *h) { + OPENSSL_memset(h, 0, sizeof(fe)); + h->v[0] = 1; +} + +static void fe_loose_1(fe_loose *h) { + OPENSSL_memset(h, 0, sizeof(fe_loose)); + h->v[0] = 1; +} + +// h = f + g +// Can overlap h with f or g. +static void fe_add(fe_loose *h, const fe *f, const fe *g) { + assert_fe(f->v); + assert_fe(g->v); + fiat_25519_add(h->v, f->v, g->v); + assert_fe_loose(h->v); +} + +// h = f - g +// Can overlap h with f or g. +static void fe_sub(fe_loose *h, const fe *f, const fe *g) { + assert_fe(f->v); + assert_fe(g->v); + fiat_25519_sub(h->v, f->v, g->v); + assert_fe_loose(h->v); +} + +static void fe_carry(fe *h, const fe_loose* f) { + assert_fe_loose(f->v); + fiat_25519_carry(h->v, f->v); + assert_fe(h->v); +} + +static void fe_mul_impl(fe_limb_t out[FE_NUM_LIMBS], + const fe_limb_t in1[FE_NUM_LIMBS], + const fe_limb_t in2[FE_NUM_LIMBS]) { + assert_fe_loose(in1); + assert_fe_loose(in2); + fiat_25519_carry_mul(out, in1, in2); + assert_fe(out); +} + +static void fe_mul_ltt(fe_loose *h, const fe *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_llt(fe_loose *h, const fe_loose *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_ttt(fe *h, const fe *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_tlt(fe *h, const fe_loose *f, const fe *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_ttl(fe *h, const fe *f, const fe_loose *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_mul_tll(fe *h, const fe_loose *f, const fe_loose *g) { + fe_mul_impl(h->v, f->v, g->v); +} + +static void fe_sq_tl(fe *h, const fe_loose *f) { + assert_fe_loose(f->v); + fiat_25519_carry_square(h->v, f->v); + assert_fe(h->v); +} + +static void fe_sq_tt(fe *h, const fe *f) { + assert_fe_loose(f->v); + fiat_25519_carry_square(h->v, f->v); + assert_fe(h->v); +} + +// Replace (f,g) with (g,f) if b == 1; +// replace (f,g) with (f,g) if b == 0. +// +// Preconditions: b in {0,1}. +static void fe_cswap(fe *f, fe *g, fe_limb_t b) { + b = 0-b; + for (unsigned i = 0; i < FE_NUM_LIMBS; i++) { + fe_limb_t x = f->v[i] ^ g->v[i]; + x &= b; + f->v[i] ^= x; + g->v[i] ^= x; + } +} + +static void fe_mul121666(fe *h, const fe_loose *f) { + assert_fe_loose(f->v); + fiat_25519_carry_scmul_121666(h->v, f->v); + assert_fe(h->v); +} + +// h = -f +static void fe_neg(fe_loose *h, const fe *f) { + assert_fe(f->v); + fiat_25519_opp(h->v, f->v); + assert_fe_loose(h->v); +} + +// Replace (f,g) with (g,g) if b == 1; +// replace (f,g) with (f,g) if b == 0. +// +// Preconditions: b in {0,1}. +static void fe_cmov(fe_loose *f, const fe_loose *g, fe_limb_t b) { + // Silence an unused function warning. |fiat_25519_selectznz| isn't quite the + // calling convention the rest of this code wants, so implement it by hand. + // + // TODO(davidben): Switch to fiat's calling convention, or ask fiat to emit a + // different one. + (void)fiat_25519_selectznz; + + b = 0-b; + for (unsigned i = 0; i < FE_NUM_LIMBS; i++) { + fe_limb_t x = f->v[i] ^ g->v[i]; + x &= b; + f->v[i] ^= x; + } +} + +// h = f +static void fe_copy(fe *h, const fe *f) { + OPENSSL_memmove(h, f, sizeof(fe)); +} + +static void fe_copy_lt(fe_loose *h, const fe *f) { + OPENSSL_STATIC_ASSERT(sizeof(fe_loose) == sizeof(fe), + "fe and fe_loose mismatch"); + OPENSSL_memmove(h, f, sizeof(fe)); +} +#if !defined(OPENSSL_SMALL) +static void fe_copy_ll(fe_loose *h, const fe_loose *f) { + OPENSSL_memmove(h, f, sizeof(fe_loose)); +} +#endif // !defined(OPENSSL_SMALL) + +static void fe_loose_invert(fe *out, const fe_loose *z) { + fe t0; + fe t1; + fe t2; + fe t3; + int i; + + fe_sq_tl(&t0, z); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 2; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_tlt(&t1, z, &t1); + fe_mul_ttt(&t0, &t0, &t1); + fe_sq_tt(&t2, &t0); + fe_mul_ttt(&t1, &t1, &t2); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 5; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t2, &t2, &t1); + fe_sq_tt(&t3, &t2); + for (i = 1; i < 20; ++i) { + fe_sq_tt(&t3, &t3); + } + fe_mul_ttt(&t2, &t3, &t2); + fe_sq_tt(&t2, &t2); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t2, &t2, &t1); + fe_sq_tt(&t3, &t2); + for (i = 1; i < 100; ++i) { + fe_sq_tt(&t3, &t3); + } + fe_mul_ttt(&t2, &t3, &t2); + fe_sq_tt(&t2, &t2); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t1, &t1); + for (i = 1; i < 5; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(out, &t1, &t0); +} + +static void fe_invert(fe *out, const fe *z) { + fe_loose l; + fe_copy_lt(&l, z); + fe_loose_invert(out, &l); +} + +// return 0 if f == 0 +// return 1 if f != 0 +static int fe_isnonzero(const fe_loose *f) { + fe tight; + fe_carry(&tight, f); + uint8_t s[32]; + fe_tobytes(s, &tight); + + static const uint8_t zero[32] = {0}; + return CRYPTO_memcmp(s, zero, sizeof(zero)) != 0; +} + +// return 1 if f is in {1,3,5,...,q-2} +// return 0 if f is in {0,2,4,...,q-1} +static int fe_isnegative(const fe *f) { + uint8_t s[32]; + fe_tobytes(s, f); + return s[0] & 1; +} + +static void fe_sq2_tt(fe *h, const fe *f) { + // h = f^2 + fe_sq_tt(h, f); + + // h = h + h + fe_loose tmp; + fe_add(&tmp, h, h); + fe_carry(h, &tmp); +} + +static void fe_pow22523(fe *out, const fe *z) { + fe t0; + fe t1; + fe t2; + int i; + + fe_sq_tt(&t0, z); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 2; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t1, z, &t1); + fe_mul_ttt(&t0, &t0, &t1); + fe_sq_tt(&t0, &t0); + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 5; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t1, &t1, &t0); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 20; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t1, &t1); + for (i = 1; i < 10; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t1, &t0); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t1, &t1, &t0); + fe_sq_tt(&t2, &t1); + for (i = 1; i < 100; ++i) { + fe_sq_tt(&t2, &t2); + } + fe_mul_ttt(&t1, &t2, &t1); + fe_sq_tt(&t1, &t1); + for (i = 1; i < 50; ++i) { + fe_sq_tt(&t1, &t1); + } + fe_mul_ttt(&t0, &t1, &t0); + fe_sq_tt(&t0, &t0); + for (i = 1; i < 2; ++i) { + fe_sq_tt(&t0, &t0); + } + fe_mul_ttt(out, &t0, z); +} + + +// Group operations. + +void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h) { + fe recip; + fe x; + fe y; + + fe_invert(&recip, &h->Z); + fe_mul_ttt(&x, &h->X, &recip); + fe_mul_ttt(&y, &h->Y, &recip); + fe_tobytes(s, &y); + s[31] ^= fe_isnegative(&x) << 7; +} + +static void ge_p3_tobytes(uint8_t s[32], const ge_p3 *h) { + fe recip; + fe x; + fe y; + + fe_invert(&recip, &h->Z); + fe_mul_ttt(&x, &h->X, &recip); + fe_mul_ttt(&y, &h->Y, &recip); + fe_tobytes(s, &y); + s[31] ^= fe_isnegative(&x) << 7; +} + +int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t s[32]) { + fe u; + fe_loose v; + fe v3; + fe vxx; + fe_loose check; + + fe_frombytes(&h->Y, s); + fe_1(&h->Z); + fe_sq_tt(&v3, &h->Y); + fe_mul_ttt(&vxx, &v3, &d); + fe_sub(&v, &v3, &h->Z); // u = y^2-1 + fe_carry(&u, &v); + fe_add(&v, &vxx, &h->Z); // v = dy^2+1 + + fe_sq_tl(&v3, &v); + fe_mul_ttl(&v3, &v3, &v); // v3 = v^3 + fe_sq_tt(&h->X, &v3); + fe_mul_ttl(&h->X, &h->X, &v); + fe_mul_ttt(&h->X, &h->X, &u); // x = uv^7 + + fe_pow22523(&h->X, &h->X); // x = (uv^7)^((q-5)/8) + fe_mul_ttt(&h->X, &h->X, &v3); + fe_mul_ttt(&h->X, &h->X, &u); // x = uv^3(uv^7)^((q-5)/8) + + fe_sq_tt(&vxx, &h->X); + fe_mul_ttl(&vxx, &vxx, &v); + fe_sub(&check, &vxx, &u); + if (fe_isnonzero(&check)) { + fe_add(&check, &vxx, &u); + if (fe_isnonzero(&check)) { + return 0; + } + fe_mul_ttt(&h->X, &h->X, &sqrtm1); + } + + if (fe_isnegative(&h->X) != (s[31] >> 7)) { + fe_loose t; + fe_neg(&t, &h->X); + fe_carry(&h->X, &t); + } + + fe_mul_ttt(&h->T, &h->X, &h->Y); + return 1; +} + +static void ge_p2_0(ge_p2 *h) { + fe_0(&h->X); + fe_1(&h->Y); + fe_1(&h->Z); +} + +static void ge_p3_0(ge_p3 *h) { + fe_0(&h->X); + fe_1(&h->Y); + fe_1(&h->Z); + fe_0(&h->T); +} + +static void ge_cached_0(ge_cached *h) { + fe_loose_1(&h->YplusX); + fe_loose_1(&h->YminusX); + fe_loose_1(&h->Z); + fe_loose_0(&h->T2d); +} + +static void ge_precomp_0(ge_precomp *h) { + fe_loose_1(&h->yplusx); + fe_loose_1(&h->yminusx); + fe_loose_0(&h->xy2d); +} + +// r = p +static void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p) { + fe_copy(&r->X, &p->X); + fe_copy(&r->Y, &p->Y); + fe_copy(&r->Z, &p->Z); +} + +// r = p +void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p) { + fe_add(&r->YplusX, &p->Y, &p->X); + fe_sub(&r->YminusX, &p->Y, &p->X); + fe_copy_lt(&r->Z, &p->Z); + fe_mul_ltt(&r->T2d, &p->T, &d2); +} + +// r = p +void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p) { + fe_mul_tll(&r->X, &p->X, &p->T); + fe_mul_tll(&r->Y, &p->Y, &p->Z); + fe_mul_tll(&r->Z, &p->Z, &p->T); +} + +// r = p +void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p) { + fe_mul_tll(&r->X, &p->X, &p->T); + fe_mul_tll(&r->Y, &p->Y, &p->Z); + fe_mul_tll(&r->Z, &p->Z, &p->T); + fe_mul_tll(&r->T, &p->X, &p->Y); +} + +// r = p +static void ge_p1p1_to_cached(ge_cached *r, const ge_p1p1 *p) { + ge_p3 t; + x25519_ge_p1p1_to_p3(&t, p); + x25519_ge_p3_to_cached(r, &t); +} + +// r = 2 * p +static void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p) { + fe trX, trZ, trT; + fe t0; + + fe_sq_tt(&trX, &p->X); + fe_sq_tt(&trZ, &p->Y); + fe_sq2_tt(&trT, &p->Z); + fe_add(&r->Y, &p->X, &p->Y); + fe_sq_tl(&t0, &r->Y); + + fe_add(&r->Y, &trZ, &trX); + fe_sub(&r->Z, &trZ, &trX); + fe_carry(&trZ, &r->Y); + fe_sub(&r->X, &t0, &trZ); + fe_carry(&trZ, &r->Z); + fe_sub(&r->T, &trT, &trZ); +} + +// r = 2 * p +static void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p) { + ge_p2 q; + ge_p3_to_p2(&q, p); + ge_p2_dbl(r, &q); +} + +// r = p + q +static void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { + fe trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->yplusx); + fe_mul_tll(&trY, &r->Y, &q->yminusx); + fe_mul_tlt(&trT, &q->xy2d, &p->T); + fe_add(&r->T, &p->Z, &p->Z); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_add(&r->Z, &trZ, &trT); + fe_sub(&r->T, &trZ, &trT); +} + +// r = p - q +static void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { + fe trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->yminusx); + fe_mul_tll(&trY, &r->Y, &q->yplusx); + fe_mul_tlt(&trT, &q->xy2d, &p->T); + fe_add(&r->T, &p->Z, &p->Z); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_sub(&r->Z, &trZ, &trT); + fe_add(&r->T, &trZ, &trT); +} + +// r = p + q +void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { + fe trX, trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->YplusX); + fe_mul_tll(&trY, &r->Y, &q->YminusX); + fe_mul_tlt(&trT, &q->T2d, &p->T); + fe_mul_ttl(&trX, &p->Z, &q->Z); + fe_add(&r->T, &trX, &trX); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_add(&r->Z, &trZ, &trT); + fe_sub(&r->T, &trZ, &trT); +} + +// r = p - q +void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { + fe trX, trY, trZ, trT; + + fe_add(&r->X, &p->Y, &p->X); + fe_sub(&r->Y, &p->Y, &p->X); + fe_mul_tll(&trZ, &r->X, &q->YminusX); + fe_mul_tll(&trY, &r->Y, &q->YplusX); + fe_mul_tlt(&trT, &q->T2d, &p->T); + fe_mul_ttl(&trX, &p->Z, &q->Z); + fe_add(&r->T, &trX, &trX); + fe_sub(&r->X, &trZ, &trY); + fe_add(&r->Y, &trZ, &trY); + fe_carry(&trZ, &r->T); + fe_sub(&r->Z, &trZ, &trT); + fe_add(&r->T, &trZ, &trT); +} + +static uint8_t equal(signed char b, signed char c) { + uint8_t ub = b; + uint8_t uc = c; + uint8_t x = ub ^ uc; // 0: yes; 1..255: no + uint32_t y = x; // 0: yes; 1..255: no + y -= 1; // 4294967295: yes; 0..254: no + y >>= 31; // 1: yes; 0: no + return y; +} + +static void cmov(ge_precomp *t, const ge_precomp *u, uint8_t b) { + fe_cmov(&t->yplusx, &u->yplusx, b); + fe_cmov(&t->yminusx, &u->yminusx, b); + fe_cmov(&t->xy2d, &u->xy2d, b); +} + +void x25519_ge_scalarmult_small_precomp( + ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]) { + // precomp_table is first expanded into matching |ge_precomp| + // elements. + ge_precomp multiples[15]; + + unsigned i; + for (i = 0; i < 15; i++) { + // The precomputed table is assumed to already clear the top bit, so + // |fe_frombytes_strict| may be used directly. + const uint8_t *bytes = &precomp_table[i*(2 * 32)]; + fe x, y; + fe_frombytes_strict(&x, bytes); + fe_frombytes_strict(&y, bytes + 32); + + ge_precomp *out = &multiples[i]; + fe_add(&out->yplusx, &y, &x); + fe_sub(&out->yminusx, &y, &x); + fe_mul_ltt(&out->xy2d, &x, &y); + fe_mul_llt(&out->xy2d, &out->xy2d, &d2); + } + + // See the comment above |k25519SmallPrecomp| about the structure of the + // precomputed elements. This loop does 64 additions and 64 doublings to + // calculate the result. + ge_p3_0(h); + + for (i = 63; i < 64; i--) { + unsigned j; + signed char index = 0; + + for (j = 0; j < 4; j++) { + const uint8_t bit = 1 & (a[(8 * j) + (i / 8)] >> (i & 7)); + index |= (bit << j); + } + + ge_precomp e; + ge_precomp_0(&e); + + for (j = 1; j < 16; j++) { + cmov(&e, &multiples[j-1], equal(index, j)); + } + + ge_cached cached; + ge_p1p1 r; + x25519_ge_p3_to_cached(&cached, h); + x25519_ge_add(&r, h, &cached); + x25519_ge_p1p1_to_p3(h, &r); + + ge_madd(&r, h, &e); + x25519_ge_p1p1_to_p3(h, &r); + } +} + +#if defined(OPENSSL_SMALL) + +void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]) { + x25519_ge_scalarmult_small_precomp(h, a, k25519SmallPrecomp); +} + +#else + +static uint8_t negative(signed char b) { + uint32_t x = b; + x >>= 31; // 1: yes; 0: no + return x; +} + +static void table_select(ge_precomp *t, int pos, signed char b) { + ge_precomp minust; + uint8_t bnegative = negative(b); + uint8_t babs = b - ((uint8_t)((-bnegative) & b) << 1); + + ge_precomp_0(t); + cmov(t, &k25519Precomp[pos][0], equal(babs, 1)); + cmov(t, &k25519Precomp[pos][1], equal(babs, 2)); + cmov(t, &k25519Precomp[pos][2], equal(babs, 3)); + cmov(t, &k25519Precomp[pos][3], equal(babs, 4)); + cmov(t, &k25519Precomp[pos][4], equal(babs, 5)); + cmov(t, &k25519Precomp[pos][5], equal(babs, 6)); + cmov(t, &k25519Precomp[pos][6], equal(babs, 7)); + cmov(t, &k25519Precomp[pos][7], equal(babs, 8)); + fe_copy_ll(&minust.yplusx, &t->yminusx); + fe_copy_ll(&minust.yminusx, &t->yplusx); + + // NOTE: the input table is canonical, but types don't encode it + fe tmp; + fe_carry(&tmp, &t->xy2d); + fe_neg(&minust.xy2d, &tmp); + + cmov(t, &minust, bnegative); +} + +// h = a * B +// where a = a[0]+256*a[1]+...+256^31 a[31] +// B is the Ed25519 base point (x,4/5) with x positive. +// +// Preconditions: +// a[31] <= 127 +void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) { + signed char e[64]; + signed char carry; + ge_p1p1 r; + ge_p2 s; + ge_precomp t; + int i; + + for (i = 0; i < 32; ++i) { + e[2 * i + 0] = (a[i] >> 0) & 15; + e[2 * i + 1] = (a[i] >> 4) & 15; + } + // each e[i] is between 0 and 15 + // e[63] is between 0 and 7 + + carry = 0; + for (i = 0; i < 63; ++i) { + e[i] += carry; + carry = e[i] + 8; + carry >>= 4; + e[i] -= carry << 4; + } + e[63] += carry; + // each e[i] is between -8 and 8 + + ge_p3_0(h); + for (i = 1; i < 64; i += 2) { + table_select(&t, i / 2, e[i]); + ge_madd(&r, h, &t); + x25519_ge_p1p1_to_p3(h, &r); + } + + ge_p3_dbl(&r, h); + x25519_ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + x25519_ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + x25519_ge_p1p1_to_p2(&s, &r); + ge_p2_dbl(&r, &s); + x25519_ge_p1p1_to_p3(h, &r); + + for (i = 0; i < 64; i += 2) { + table_select(&t, i / 2, e[i]); + ge_madd(&r, h, &t); + x25519_ge_p1p1_to_p3(h, &r); + } +} + +#endif + +static void cmov_cached(ge_cached *t, ge_cached *u, uint8_t b) { + fe_cmov(&t->YplusX, &u->YplusX, b); + fe_cmov(&t->YminusX, &u->YminusX, b); + fe_cmov(&t->Z, &u->Z, b); + fe_cmov(&t->T2d, &u->T2d, b); +} + +// r = scalar * A. +// where a = a[0]+256*a[1]+...+256^31 a[31]. +void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A) { + ge_p2 Ai_p2[8]; + ge_cached Ai[16]; + ge_p1p1 t; + + ge_cached_0(&Ai[0]); + x25519_ge_p3_to_cached(&Ai[1], A); + ge_p3_to_p2(&Ai_p2[1], A); + + unsigned i; + for (i = 2; i < 16; i += 2) { + ge_p2_dbl(&t, &Ai_p2[i / 2]); + ge_p1p1_to_cached(&Ai[i], &t); + if (i < 8) { + x25519_ge_p1p1_to_p2(&Ai_p2[i], &t); + } + x25519_ge_add(&t, A, &Ai[i]); + ge_p1p1_to_cached(&Ai[i + 1], &t); + if (i < 7) { + x25519_ge_p1p1_to_p2(&Ai_p2[i + 1], &t); + } + } + + ge_p2_0(r); + ge_p3 u; + + for (i = 0; i < 256; i += 4) { + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p2(r, &t); + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p2(r, &t); + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p2(r, &t); + ge_p2_dbl(&t, r); + x25519_ge_p1p1_to_p3(&u, &t); + + uint8_t index = scalar[31 - i/8]; + index >>= 4 - (i & 4); + index &= 0xf; + + unsigned j; + ge_cached selected; + ge_cached_0(&selected); + for (j = 0; j < 16; j++) { + cmov_cached(&selected, &Ai[j], equal(j, index)); + } + + x25519_ge_add(&t, &u, &selected); + x25519_ge_p1p1_to_p2(r, &t); + } +} + +static void slide(signed char *r, const uint8_t *a) { + int i; + int b; + int k; + + for (i = 0; i < 256; ++i) { + r[i] = 1 & (a[i >> 3] >> (i & 7)); + } + + for (i = 0; i < 256; ++i) { + if (r[i]) { + for (b = 1; b <= 6 && i + b < 256; ++b) { + if (r[i + b]) { + if (r[i] + (r[i + b] << b) <= 15) { + r[i] += r[i + b] << b; + r[i + b] = 0; + } else if (r[i] - (r[i + b] << b) >= -15) { + r[i] -= r[i + b] << b; + for (k = i + b; k < 256; ++k) { + if (!r[k]) { + r[k] = 1; + break; + } + r[k] = 0; + } + } else { + break; + } + } + } + } + } +} + +// r = a * A + b * B +// where a = a[0]+256*a[1]+...+256^31 a[31]. +// and b = b[0]+256*b[1]+...+256^31 b[31]. +// B is the Ed25519 base point (x,4/5) with x positive. +static void ge_double_scalarmult_vartime(ge_p2 *r, const uint8_t *a, + const ge_p3 *A, const uint8_t *b) { + signed char aslide[256]; + signed char bslide[256]; + ge_cached Ai[8]; // A,3A,5A,7A,9A,11A,13A,15A + ge_p1p1 t; + ge_p3 u; + ge_p3 A2; + int i; + + slide(aslide, a); + slide(bslide, b); + + x25519_ge_p3_to_cached(&Ai[0], A); + ge_p3_dbl(&t, A); + x25519_ge_p1p1_to_p3(&A2, &t); + x25519_ge_add(&t, &A2, &Ai[0]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[1], &u); + x25519_ge_add(&t, &A2, &Ai[1]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[2], &u); + x25519_ge_add(&t, &A2, &Ai[2]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[3], &u); + x25519_ge_add(&t, &A2, &Ai[3]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[4], &u); + x25519_ge_add(&t, &A2, &Ai[4]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[5], &u); + x25519_ge_add(&t, &A2, &Ai[5]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[6], &u); + x25519_ge_add(&t, &A2, &Ai[6]); + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_p3_to_cached(&Ai[7], &u); + + ge_p2_0(r); + + for (i = 255; i >= 0; --i) { + if (aslide[i] || bslide[i]) { + break; + } + } + + for (; i >= 0; --i) { + ge_p2_dbl(&t, r); + + if (aslide[i] > 0) { + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_add(&t, &u, &Ai[aslide[i] / 2]); + } else if (aslide[i] < 0) { + x25519_ge_p1p1_to_p3(&u, &t); + x25519_ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); + } + + if (bslide[i] > 0) { + x25519_ge_p1p1_to_p3(&u, &t); + ge_madd(&t, &u, &Bi[bslide[i] / 2]); + } else if (bslide[i] < 0) { + x25519_ge_p1p1_to_p3(&u, &t); + ge_msub(&t, &u, &Bi[(-bslide[i]) / 2]); + } + + x25519_ge_p1p1_to_p2(r, &t); + } +} + +// int64_lshift21 returns |a << 21| but is defined when shifting bits into the +// sign bit. This works around a language flaw in C. +static inline int64_t int64_lshift21(int64_t a) { + return (int64_t)((uint64_t)a << 21); +} + +// The set of scalars is \Z/l +// where l = 2^252 + 27742317777372353535851937790883648493. + +// Input: +// s[0]+256*s[1]+...+256^63*s[63] = s +// +// Output: +// s[0]+256*s[1]+...+256^31*s[31] = s mod l +// where l = 2^252 + 27742317777372353535851937790883648493. +// Overwrites s in place. +void x25519_sc_reduce(uint8_t s[64]) { + int64_t s0 = 2097151 & load_3(s); + int64_t s1 = 2097151 & (load_4(s + 2) >> 5); + int64_t s2 = 2097151 & (load_3(s + 5) >> 2); + int64_t s3 = 2097151 & (load_4(s + 7) >> 7); + int64_t s4 = 2097151 & (load_4(s + 10) >> 4); + int64_t s5 = 2097151 & (load_3(s + 13) >> 1); + int64_t s6 = 2097151 & (load_4(s + 15) >> 6); + int64_t s7 = 2097151 & (load_3(s + 18) >> 3); + int64_t s8 = 2097151 & load_3(s + 21); + int64_t s9 = 2097151 & (load_4(s + 23) >> 5); + int64_t s10 = 2097151 & (load_3(s + 26) >> 2); + int64_t s11 = 2097151 & (load_4(s + 28) >> 7); + int64_t s12 = 2097151 & (load_4(s + 31) >> 4); + int64_t s13 = 2097151 & (load_3(s + 34) >> 1); + int64_t s14 = 2097151 & (load_4(s + 36) >> 6); + int64_t s15 = 2097151 & (load_3(s + 39) >> 3); + int64_t s16 = 2097151 & load_3(s + 42); + int64_t s17 = 2097151 & (load_4(s + 44) >> 5); + int64_t s18 = 2097151 & (load_3(s + 47) >> 2); + int64_t s19 = 2097151 & (load_4(s + 49) >> 7); + int64_t s20 = 2097151 & (load_4(s + 52) >> 4); + int64_t s21 = 2097151 & (load_3(s + 55) >> 1); + int64_t s22 = 2097151 & (load_4(s + 57) >> 6); + int64_t s23 = (load_4(s + 60) >> 3); + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + int64_t carry10; + int64_t carry11; + int64_t carry12; + int64_t carry13; + int64_t carry14; + int64_t carry15; + int64_t carry16; + + s11 += s23 * 666643; + s12 += s23 * 470296; + s13 += s23 * 654183; + s14 -= s23 * 997805; + s15 += s23 * 136657; + s16 -= s23 * 683901; + s23 = 0; + + s10 += s22 * 666643; + s11 += s22 * 470296; + s12 += s22 * 654183; + s13 -= s22 * 997805; + s14 += s22 * 136657; + s15 -= s22 * 683901; + s22 = 0; + + s9 += s21 * 666643; + s10 += s21 * 470296; + s11 += s21 * 654183; + s12 -= s21 * 997805; + s13 += s21 * 136657; + s14 -= s21 * 683901; + s21 = 0; + + s8 += s20 * 666643; + s9 += s20 * 470296; + s10 += s20 * 654183; + s11 -= s20 * 997805; + s12 += s20 * 136657; + s13 -= s20 * 683901; + s20 = 0; + + s7 += s19 * 666643; + s8 += s19 * 470296; + s9 += s19 * 654183; + s10 -= s19 * 997805; + s11 += s19 * 136657; + s12 -= s19 * 683901; + s19 = 0; + + s6 += s18 * 666643; + s7 += s18 * 470296; + s8 += s18 * 654183; + s9 -= s18 * 997805; + s10 += s18 * 136657; + s11 -= s18 * 683901; + s18 = 0; + + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= int64_lshift21(carry12); + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= int64_lshift21(carry14); + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= int64_lshift21(carry16); + + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= int64_lshift21(carry13); + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= int64_lshift21(carry15); + + s5 += s17 * 666643; + s6 += s17 * 470296; + s7 += s17 * 654183; + s8 -= s17 * 997805; + s9 += s17 * 136657; + s10 -= s17 * 683901; + s17 = 0; + + s4 += s16 * 666643; + s5 += s16 * 470296; + s6 += s16 * 654183; + s7 -= s16 * 997805; + s8 += s16 * 136657; + s9 -= s16 * 683901; + s16 = 0; + + s3 += s15 * 666643; + s4 += s15 * 470296; + s5 += s15 * 654183; + s6 -= s15 * 997805; + s7 += s15 * 136657; + s8 -= s15 * 683901; + s15 = 0; + + s2 += s14 * 666643; + s3 += s14 * 470296; + s4 += s14 * 654183; + s5 -= s14 * 997805; + s6 += s14 * 136657; + s7 -= s14 * 683901; + s14 = 0; + + s1 += s13 * 666643; + s2 += s13 * 470296; + s3 += s13 * 654183; + s4 -= s13 * 997805; + s5 += s13 * 136657; + s6 -= s13 * 683901; + s13 = 0; + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry11 = s11 >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + s[0] = s0 >> 0; + s[1] = s0 >> 8; + s[2] = (s0 >> 16) | (s1 << 5); + s[3] = s1 >> 3; + s[4] = s1 >> 11; + s[5] = (s1 >> 19) | (s2 << 2); + s[6] = s2 >> 6; + s[7] = (s2 >> 14) | (s3 << 7); + s[8] = s3 >> 1; + s[9] = s3 >> 9; + s[10] = (s3 >> 17) | (s4 << 4); + s[11] = s4 >> 4; + s[12] = s4 >> 12; + s[13] = (s4 >> 20) | (s5 << 1); + s[14] = s5 >> 7; + s[15] = (s5 >> 15) | (s6 << 6); + s[16] = s6 >> 2; + s[17] = s6 >> 10; + s[18] = (s6 >> 18) | (s7 << 3); + s[19] = s7 >> 5; + s[20] = s7 >> 13; + s[21] = s8 >> 0; + s[22] = s8 >> 8; + s[23] = (s8 >> 16) | (s9 << 5); + s[24] = s9 >> 3; + s[25] = s9 >> 11; + s[26] = (s9 >> 19) | (s10 << 2); + s[27] = s10 >> 6; + s[28] = (s10 >> 14) | (s11 << 7); + s[29] = s11 >> 1; + s[30] = s11 >> 9; + s[31] = s11 >> 17; +} + +// Input: +// a[0]+256*a[1]+...+256^31*a[31] = a +// b[0]+256*b[1]+...+256^31*b[31] = b +// c[0]+256*c[1]+...+256^31*c[31] = c +// +// Output: +// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l +// where l = 2^252 + 27742317777372353535851937790883648493. +static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b, + const uint8_t *c) { + int64_t a0 = 2097151 & load_3(a); + int64_t a1 = 2097151 & (load_4(a + 2) >> 5); + int64_t a2 = 2097151 & (load_3(a + 5) >> 2); + int64_t a3 = 2097151 & (load_4(a + 7) >> 7); + int64_t a4 = 2097151 & (load_4(a + 10) >> 4); + int64_t a5 = 2097151 & (load_3(a + 13) >> 1); + int64_t a6 = 2097151 & (load_4(a + 15) >> 6); + int64_t a7 = 2097151 & (load_3(a + 18) >> 3); + int64_t a8 = 2097151 & load_3(a + 21); + int64_t a9 = 2097151 & (load_4(a + 23) >> 5); + int64_t a10 = 2097151 & (load_3(a + 26) >> 2); + int64_t a11 = (load_4(a + 28) >> 7); + int64_t b0 = 2097151 & load_3(b); + int64_t b1 = 2097151 & (load_4(b + 2) >> 5); + int64_t b2 = 2097151 & (load_3(b + 5) >> 2); + int64_t b3 = 2097151 & (load_4(b + 7) >> 7); + int64_t b4 = 2097151 & (load_4(b + 10) >> 4); + int64_t b5 = 2097151 & (load_3(b + 13) >> 1); + int64_t b6 = 2097151 & (load_4(b + 15) >> 6); + int64_t b7 = 2097151 & (load_3(b + 18) >> 3); + int64_t b8 = 2097151 & load_3(b + 21); + int64_t b9 = 2097151 & (load_4(b + 23) >> 5); + int64_t b10 = 2097151 & (load_3(b + 26) >> 2); + int64_t b11 = (load_4(b + 28) >> 7); + int64_t c0 = 2097151 & load_3(c); + int64_t c1 = 2097151 & (load_4(c + 2) >> 5); + int64_t c2 = 2097151 & (load_3(c + 5) >> 2); + int64_t c3 = 2097151 & (load_4(c + 7) >> 7); + int64_t c4 = 2097151 & (load_4(c + 10) >> 4); + int64_t c5 = 2097151 & (load_3(c + 13) >> 1); + int64_t c6 = 2097151 & (load_4(c + 15) >> 6); + int64_t c7 = 2097151 & (load_3(c + 18) >> 3); + int64_t c8 = 2097151 & load_3(c + 21); + int64_t c9 = 2097151 & (load_4(c + 23) >> 5); + int64_t c10 = 2097151 & (load_3(c + 26) >> 2); + int64_t c11 = (load_4(c + 28) >> 7); + int64_t s0; + int64_t s1; + int64_t s2; + int64_t s3; + int64_t s4; + int64_t s5; + int64_t s6; + int64_t s7; + int64_t s8; + int64_t s9; + int64_t s10; + int64_t s11; + int64_t s12; + int64_t s13; + int64_t s14; + int64_t s15; + int64_t s16; + int64_t s17; + int64_t s18; + int64_t s19; + int64_t s20; + int64_t s21; + int64_t s22; + int64_t s23; + int64_t carry0; + int64_t carry1; + int64_t carry2; + int64_t carry3; + int64_t carry4; + int64_t carry5; + int64_t carry6; + int64_t carry7; + int64_t carry8; + int64_t carry9; + int64_t carry10; + int64_t carry11; + int64_t carry12; + int64_t carry13; + int64_t carry14; + int64_t carry15; + int64_t carry16; + int64_t carry17; + int64_t carry18; + int64_t carry19; + int64_t carry20; + int64_t carry21; + int64_t carry22; + + s0 = c0 + a0 * b0; + s1 = c1 + a0 * b1 + a1 * b0; + s2 = c2 + a0 * b2 + a1 * b1 + a2 * b0; + s3 = c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; + s4 = c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; + s5 = c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; + s6 = c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; + s7 = c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + + a6 * b1 + a7 * b0; + s8 = c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + + a6 * b2 + a7 * b1 + a8 * b0; + s9 = c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + + a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; + s10 = c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + + a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; + s11 = c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + + a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; + s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + + a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; + s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + + a9 * b4 + a10 * b3 + a11 * b2; + s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 + + a10 * b4 + a11 * b3; + s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 + + a11 * b4; + s16 = a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; + s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; + s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; + s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; + s20 = a9 * b11 + a10 * b10 + a11 * b9; + s21 = a10 * b11 + a11 * b10; + s22 = a11 * b11; + s23 = 0; + + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= int64_lshift21(carry12); + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= int64_lshift21(carry14); + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= int64_lshift21(carry16); + carry18 = (s18 + (1 << 20)) >> 21; + s19 += carry18; + s18 -= int64_lshift21(carry18); + carry20 = (s20 + (1 << 20)) >> 21; + s21 += carry20; + s20 -= int64_lshift21(carry20); + carry22 = (s22 + (1 << 20)) >> 21; + s23 += carry22; + s22 -= int64_lshift21(carry22); + + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= int64_lshift21(carry13); + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= int64_lshift21(carry15); + carry17 = (s17 + (1 << 20)) >> 21; + s18 += carry17; + s17 -= int64_lshift21(carry17); + carry19 = (s19 + (1 << 20)) >> 21; + s20 += carry19; + s19 -= int64_lshift21(carry19); + carry21 = (s21 + (1 << 20)) >> 21; + s22 += carry21; + s21 -= int64_lshift21(carry21); + + s11 += s23 * 666643; + s12 += s23 * 470296; + s13 += s23 * 654183; + s14 -= s23 * 997805; + s15 += s23 * 136657; + s16 -= s23 * 683901; + s23 = 0; + + s10 += s22 * 666643; + s11 += s22 * 470296; + s12 += s22 * 654183; + s13 -= s22 * 997805; + s14 += s22 * 136657; + s15 -= s22 * 683901; + s22 = 0; + + s9 += s21 * 666643; + s10 += s21 * 470296; + s11 += s21 * 654183; + s12 -= s21 * 997805; + s13 += s21 * 136657; + s14 -= s21 * 683901; + s21 = 0; + + s8 += s20 * 666643; + s9 += s20 * 470296; + s10 += s20 * 654183; + s11 -= s20 * 997805; + s12 += s20 * 136657; + s13 -= s20 * 683901; + s20 = 0; + + s7 += s19 * 666643; + s8 += s19 * 470296; + s9 += s19 * 654183; + s10 -= s19 * 997805; + s11 += s19 * 136657; + s12 -= s19 * 683901; + s19 = 0; + + s6 += s18 * 666643; + s7 += s18 * 470296; + s8 += s18 * 654183; + s9 -= s18 * 997805; + s10 += s18 * 136657; + s11 -= s18 * 683901; + s18 = 0; + + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry12 = (s12 + (1 << 20)) >> 21; + s13 += carry12; + s12 -= int64_lshift21(carry12); + carry14 = (s14 + (1 << 20)) >> 21; + s15 += carry14; + s14 -= int64_lshift21(carry14); + carry16 = (s16 + (1 << 20)) >> 21; + s17 += carry16; + s16 -= int64_lshift21(carry16); + + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + carry13 = (s13 + (1 << 20)) >> 21; + s14 += carry13; + s13 -= int64_lshift21(carry13); + carry15 = (s15 + (1 << 20)) >> 21; + s16 += carry15; + s15 -= int64_lshift21(carry15); + + s5 += s17 * 666643; + s6 += s17 * 470296; + s7 += s17 * 654183; + s8 -= s17 * 997805; + s9 += s17 * 136657; + s10 -= s17 * 683901; + s17 = 0; + + s4 += s16 * 666643; + s5 += s16 * 470296; + s6 += s16 * 654183; + s7 -= s16 * 997805; + s8 += s16 * 136657; + s9 -= s16 * 683901; + s16 = 0; + + s3 += s15 * 666643; + s4 += s15 * 470296; + s5 += s15 * 654183; + s6 -= s15 * 997805; + s7 += s15 * 136657; + s8 -= s15 * 683901; + s15 = 0; + + s2 += s14 * 666643; + s3 += s14 * 470296; + s4 += s14 * 654183; + s5 -= s14 * 997805; + s6 += s14 * 136657; + s7 -= s14 * 683901; + s14 = 0; + + s1 += s13 * 666643; + s2 += s13 * 470296; + s3 += s13 * 654183; + s4 -= s13 * 997805; + s5 += s13 * 136657; + s6 -= s13 * 683901; + s13 = 0; + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = (s0 + (1 << 20)) >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry2 = (s2 + (1 << 20)) >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry4 = (s4 + (1 << 20)) >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry6 = (s6 + (1 << 20)) >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry8 = (s8 + (1 << 20)) >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry10 = (s10 + (1 << 20)) >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + carry1 = (s1 + (1 << 20)) >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry3 = (s3 + (1 << 20)) >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry5 = (s5 + (1 << 20)) >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry7 = (s7 + (1 << 20)) >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry9 = (s9 + (1 << 20)) >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry11 = (s11 + (1 << 20)) >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + carry11 = s11 >> 21; + s12 += carry11; + s11 -= int64_lshift21(carry11); + + s0 += s12 * 666643; + s1 += s12 * 470296; + s2 += s12 * 654183; + s3 -= s12 * 997805; + s4 += s12 * 136657; + s5 -= s12 * 683901; + s12 = 0; + + carry0 = s0 >> 21; + s1 += carry0; + s0 -= int64_lshift21(carry0); + carry1 = s1 >> 21; + s2 += carry1; + s1 -= int64_lshift21(carry1); + carry2 = s2 >> 21; + s3 += carry2; + s2 -= int64_lshift21(carry2); + carry3 = s3 >> 21; + s4 += carry3; + s3 -= int64_lshift21(carry3); + carry4 = s4 >> 21; + s5 += carry4; + s4 -= int64_lshift21(carry4); + carry5 = s5 >> 21; + s6 += carry5; + s5 -= int64_lshift21(carry5); + carry6 = s6 >> 21; + s7 += carry6; + s6 -= int64_lshift21(carry6); + carry7 = s7 >> 21; + s8 += carry7; + s7 -= int64_lshift21(carry7); + carry8 = s8 >> 21; + s9 += carry8; + s8 -= int64_lshift21(carry8); + carry9 = s9 >> 21; + s10 += carry9; + s9 -= int64_lshift21(carry9); + carry10 = s10 >> 21; + s11 += carry10; + s10 -= int64_lshift21(carry10); + + s[0] = s0 >> 0; + s[1] = s0 >> 8; + s[2] = (s0 >> 16) | (s1 << 5); + s[3] = s1 >> 3; + s[4] = s1 >> 11; + s[5] = (s1 >> 19) | (s2 << 2); + s[6] = s2 >> 6; + s[7] = (s2 >> 14) | (s3 << 7); + s[8] = s3 >> 1; + s[9] = s3 >> 9; + s[10] = (s3 >> 17) | (s4 << 4); + s[11] = s4 >> 4; + s[12] = s4 >> 12; + s[13] = (s4 >> 20) | (s5 << 1); + s[14] = s5 >> 7; + s[15] = (s5 >> 15) | (s6 << 6); + s[16] = s6 >> 2; + s[17] = s6 >> 10; + s[18] = (s6 >> 18) | (s7 << 3); + s[19] = s7 >> 5; + s[20] = s7 >> 13; + s[21] = s8 >> 0; + s[22] = s8 >> 8; + s[23] = (s8 >> 16) | (s9 << 5); + s[24] = s9 >> 3; + s[25] = s9 >> 11; + s[26] = (s9 >> 19) | (s10 << 2); + s[27] = s10 >> 6; + s[28] = (s10 >> 14) | (s11 << 7); + s[29] = s11 >> 1; + s[30] = s11 >> 9; + s[31] = s11 >> 17; +} + +void ED25519_keypair(uint8_t out_public_key[32], uint8_t out_private_key[64]) { + uint8_t seed[32]; + RAND_bytes(seed, 32); + ED25519_keypair_from_seed(out_public_key, out_private_key, seed); +} + +int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, + size_t message_len, const uint8_t private_key[64]) { + // NOTE: The documentation on this function says that it returns zero on + // allocation failure. While that can't happen with the current + // implementation, we want to reserve the ability to allocate in this + // implementation in the future. + + uint8_t az[SHA512_DIGEST_LENGTH]; + SHA512(private_key, 32, az); + + az[0] &= 248; + az[31] &= 63; + az[31] |= 64; + + SHA512_CTX hash_ctx; + SHA512_Init(&hash_ctx); + SHA512_Update(&hash_ctx, az + 32, 32); + SHA512_Update(&hash_ctx, message, message_len); + uint8_t nonce[SHA512_DIGEST_LENGTH]; + SHA512_Final(nonce, &hash_ctx); + + x25519_sc_reduce(nonce); + ge_p3 R; + x25519_ge_scalarmult_base(&R, nonce); + ge_p3_tobytes(out_sig, &R); + + SHA512_Init(&hash_ctx); + SHA512_Update(&hash_ctx, out_sig, 32); + SHA512_Update(&hash_ctx, private_key + 32, 32); + SHA512_Update(&hash_ctx, message, message_len); + uint8_t hram[SHA512_DIGEST_LENGTH]; + SHA512_Final(hram, &hash_ctx); + + x25519_sc_reduce(hram); + sc_muladd(out_sig + 32, hram, az, nonce); + + return 1; +} + +int ED25519_verify(const uint8_t *message, size_t message_len, + const uint8_t signature[64], const uint8_t public_key[32]) { + ge_p3 A; + if ((signature[63] & 224) != 0 || + !x25519_ge_frombytes_vartime(&A, public_key)) { + return 0; + } + + fe_loose t; + fe_neg(&t, &A.X); + fe_carry(&A.X, &t); + fe_neg(&t, &A.T); + fe_carry(&A.T, &t); + + uint8_t pkcopy[32]; + OPENSSL_memcpy(pkcopy, public_key, 32); + uint8_t rcopy[32]; + OPENSSL_memcpy(rcopy, signature, 32); + union { + uint64_t u64[4]; + uint8_t u8[32]; + } scopy; + OPENSSL_memcpy(&scopy.u8[0], signature + 32, 32); + + // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in + // the range [0, order) in order to prevent signature malleability. + + // kOrder is the order of Curve25519 in little-endian form. + static const uint64_t kOrder[4] = { + UINT64_C(0x5812631a5cf5d3ed), + UINT64_C(0x14def9dea2f79cd6), + 0, + UINT64_C(0x1000000000000000), + }; + for (size_t i = 3;; i--) { + if (scopy.u64[i] > kOrder[i]) { + return 0; + } else if (scopy.u64[i] < kOrder[i]) { + break; + } else if (i == 0) { + return 0; + } + } + + SHA512_CTX hash_ctx; + SHA512_Init(&hash_ctx); + SHA512_Update(&hash_ctx, signature, 32); + SHA512_Update(&hash_ctx, public_key, 32); + SHA512_Update(&hash_ctx, message, message_len); + uint8_t h[SHA512_DIGEST_LENGTH]; + SHA512_Final(h, &hash_ctx); + + x25519_sc_reduce(h); + + ge_p2 R; + ge_double_scalarmult_vartime(&R, h, &A, scopy.u8); + + uint8_t rcheck[32]; + x25519_ge_tobytes(rcheck, &R); + + return CRYPTO_memcmp(rcheck, rcopy, sizeof(rcheck)) == 0; +} + +void ED25519_keypair_from_seed(uint8_t out_public_key[32], + uint8_t out_private_key[64], + const uint8_t seed[32]) { + uint8_t az[SHA512_DIGEST_LENGTH]; + SHA512(seed, 32, az); + + az[0] &= 248; + az[31] &= 127; + az[31] |= 64; + + ge_p3 A; + x25519_ge_scalarmult_base(&A, az); + ge_p3_tobytes(out_public_key, &A); + + OPENSSL_memcpy(out_private_key, seed, 32); + OPENSSL_memcpy(out_private_key + 32, out_public_key, 32); +} + + +static void x25519_scalar_mult_generic(uint8_t out[32], + const uint8_t scalar[32], + const uint8_t point[32]) { + fe x1, x2, z2, x3, z3, tmp0, tmp1; + fe_loose x2l, z2l, x3l, tmp0l, tmp1l; + + uint8_t e[32]; + OPENSSL_memcpy(e, scalar, 32); + e[0] &= 248; + e[31] &= 127; + e[31] |= 64; + + // The following implementation was transcribed to Coq and proven to + // correspond to unary scalar multiplication in affine coordinates given that + // x1 != 0 is the x coordinate of some point on the curve. It was also checked + // in Coq that doing a ladderstep with x1 = x3 = 0 gives z2' = z3' = 0, and z2 + // = z3 = 0 gives z2' = z3' = 0. The statement was quantified over the + // underlying field, so it applies to Curve25519 itself and the quadratic + // twist of Curve25519. It was not proven in Coq that prime-field arithmetic + // correctly simulates extension-field arithmetic on prime-field values. + // The decoding of the byte array representation of e was not considered. + // Specification of Montgomery curves in affine coordinates: + // + // Proof that these form a group that is isomorphic to a Weierstrass curve: + // + // Coq transcription and correctness proof of the loop (where scalarbits=255): + // + // + // preconditions: 0 <= e < 2^255 (not necessarily e < order), fe_invert(0) = 0 + fe_frombytes(&x1, point); + fe_1(&x2); + fe_0(&z2); + fe_copy(&x3, &x1); + fe_1(&z3); + + unsigned swap = 0; + int pos; + for (pos = 254; pos >= 0; --pos) { + // loop invariant as of right before the test, for the case where x1 != 0: + // pos >= -1; if z2 = 0 then x2 is nonzero; if z3 = 0 then x3 is nonzero + // let r := e >> (pos+1) in the following equalities of projective points: + // to_xz (r*P) === if swap then (x3, z3) else (x2, z2) + // to_xz ((r+1)*P) === if swap then (x2, z2) else (x3, z3) + // x1 is the nonzero x coordinate of the nonzero point (r*P-(r+1)*P) + unsigned b = 1 & (e[pos / 8] >> (pos & 7)); + swap ^= b; + fe_cswap(&x2, &x3, swap); + fe_cswap(&z2, &z3, swap); + swap = b; + // Coq transcription of ladderstep formula (called from transcribed loop): + // + // + // x1 != 0 + // x1 = 0 + fe_sub(&tmp0l, &x3, &z3); + fe_sub(&tmp1l, &x2, &z2); + fe_add(&x2l, &x2, &z2); + fe_add(&z2l, &x3, &z3); + fe_mul_tll(&z3, &tmp0l, &x2l); + fe_mul_tll(&z2, &z2l, &tmp1l); + fe_sq_tl(&tmp0, &tmp1l); + fe_sq_tl(&tmp1, &x2l); + fe_add(&x3l, &z3, &z2); + fe_sub(&z2l, &z3, &z2); + fe_mul_ttt(&x2, &tmp1, &tmp0); + fe_sub(&tmp1l, &tmp1, &tmp0); + fe_sq_tl(&z2, &z2l); + fe_mul121666(&z3, &tmp1l); + fe_sq_tl(&x3, &x3l); + fe_add(&tmp0l, &tmp0, &z3); + fe_mul_ttt(&z3, &x1, &z2); + fe_mul_tll(&z2, &tmp1l, &tmp0l); + } + // here pos=-1, so r=e, so to_xz (e*P) === if swap then (x3, z3) else (x2, z2) + fe_cswap(&x2, &x3, swap); + fe_cswap(&z2, &z3, swap); + + fe_invert(&z2, &z2); + fe_mul_ttt(&x2, &x2, &z2); + fe_tobytes(out, &x2); +} + +static void x25519_scalar_mult(uint8_t out[32], const uint8_t scalar[32], + const uint8_t point[32]) { +#if defined(BORINGSSL_X25519_NEON) + if (CRYPTO_is_NEON_capable()) { + x25519_NEON(out, scalar, point); + return; + } +#endif + + x25519_scalar_mult_generic(out, scalar, point); +} + +void X25519_keypair(uint8_t out_public_value[32], uint8_t out_private_key[32]) { + RAND_bytes(out_private_key, 32); + + // All X25519 implementations should decode scalars correctly (see + // https://tools.ietf.org/html/rfc7748#section-5). However, if an + // implementation doesn't then it might interoperate with random keys a + // fraction of the time because they'll, randomly, happen to be correctly + // formed. + // + // Thus we do the opposite of the masking here to make sure that our private + // keys are never correctly masked and so, hopefully, any incorrect + // implementations are deterministically broken. + // + // This does not affect security because, although we're throwing away + // entropy, a valid implementation of scalarmult should throw away the exact + // same bits anyway. + out_private_key[0] |= ~248; + out_private_key[31] &= ~64; + out_private_key[31] |= ~127; + + X25519_public_from_private(out_public_value, out_private_key); +} + +int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32], + const uint8_t peer_public_value[32]) { + static const uint8_t kZeros[32] = {0}; + x25519_scalar_mult(out_shared_key, private_key, peer_public_value); + // The all-zero output results when the input is a point of small order. + return CRYPTO_memcmp(kZeros, out_shared_key, 32) != 0; +} + +void X25519_public_from_private(uint8_t out_public_value[32], + const uint8_t private_key[32]) { +#if defined(BORINGSSL_X25519_NEON) + if (CRYPTO_is_NEON_capable()) { + static const uint8_t kMongomeryBasePoint[32] = {9}; + x25519_NEON(out_public_value, private_key, kMongomeryBasePoint); + return; + } +#endif + + uint8_t e[32]; + OPENSSL_memcpy(e, private_key, 32); + e[0] &= 248; + e[31] &= 127; + e[31] |= 64; + + ge_p3 A; + x25519_ge_scalarmult_base(&A, e); + + // We only need the u-coordinate of the curve25519 point. The map is + // u=(y+1)/(1-y). Since y=Y/Z, this gives u=(Z+Y)/(Z-Y). + fe_loose zplusy, zminusy; + fe zminusy_inv; + fe_add(&zplusy, &A.Z, &A.Y); + fe_sub(&zminusy, &A.Z, &A.Y); + fe_loose_invert(&zminusy_inv, &zminusy); + fe_mul_tlt(&zminusy_inv, &zplusy, &zminusy_inv); + fe_tobytes(out_public_value, &zminusy_inv); +} diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h new file mode 100644 index 000000000..53772421d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h @@ -0,0 +1,911 @@ +/* Autogenerated */ +/* curve description: 25519 */ +/* requested operations: carry_mul, carry_square, carry_scmul121666, carry, add, sub, opp, selectznz, to_bytes, from_bytes */ +/* n = 10 (from "10") */ +/* s = 0x8000000000000000000000000000000000000000000000000000000000000000 (from "2^255") */ +/* c = [(1, 19)] (from "1,19") */ +/* machine_wordsize = 32 (from "32") */ + +#include +typedef unsigned char fiat_25519_uint1; +typedef signed char fiat_25519_int1; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x3ffffff] + * arg3: [0x0 ~> 0x3ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x3ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_addcarryx_u26(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + uint32_t x1 = ((arg1 + arg2) + arg3); + uint32_t x2 = (x1 & UINT32_C(0x3ffffff)); + fiat_25519_uint1 x3 = (fiat_25519_uint1)(x1 >> 26); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x3ffffff] + * arg3: [0x0 ~> 0x3ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x3ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_subborrowx_u26(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + int32_t x1 = ((int32_t)(arg2 - arg1) - (int32_t)arg3); + fiat_25519_int1 x2 = (fiat_25519_int1)(x1 >> 26); + uint32_t x3 = (x1 & UINT32_C(0x3ffffff)); + *out1 = x3; + *out2 = (fiat_25519_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x1ffffff] + * arg3: [0x0 ~> 0x1ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x1ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_addcarryx_u25(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + uint32_t x1 = ((arg1 + arg2) + arg3); + uint32_t x2 = (x1 & UINT32_C(0x1ffffff)); + fiat_25519_uint1 x3 = (fiat_25519_uint1)(x1 >> 25); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x1ffffff] + * arg3: [0x0 ~> 0x1ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x1ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_subborrowx_u25(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + int32_t x1 = ((int32_t)(arg2 - arg1) - (int32_t)arg3); + fiat_25519_int1 x2 = (fiat_25519_int1)(x1 >> 25); + uint32_t x3 = (x1 & UINT32_C(0x1ffffff)); + *out1 = x3; + *out2 = (fiat_25519_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + */ +static void fiat_25519_cmovznz_u32(uint32_t* out1, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + fiat_25519_uint1 x1 = (!(!arg1)); + uint32_t x2 = ((fiat_25519_int1)(0x0 - x1) & UINT32_C(0xffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint32_t x3 = ((value_barrier_u32(x2) & arg3) | (value_barrier_u32(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * arg2: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry_mul(uint32_t out1[10], const uint32_t arg1[10], const uint32_t arg2[10]) { + uint64_t x1 = ((uint64_t)(arg1[9]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x2 = ((uint64_t)(arg1[9]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x3 = ((uint64_t)(arg1[9]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x4 = ((uint64_t)(arg1[9]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x5 = ((uint64_t)(arg1[9]) * ((arg2[5]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x6 = ((uint64_t)(arg1[9]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x7 = ((uint64_t)(arg1[9]) * ((arg2[3]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x8 = ((uint64_t)(arg1[9]) * ((arg2[2]) * (uint32_t)UINT8_C(0x13))); + uint64_t x9 = ((uint64_t)(arg1[9]) * ((arg2[1]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x10 = ((uint64_t)(arg1[8]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x11 = ((uint64_t)(arg1[8]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x12 = ((uint64_t)(arg1[8]) * ((arg2[7]) * (uint32_t)UINT8_C(0x13))); + uint64_t x13 = ((uint64_t)(arg1[8]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x14 = ((uint64_t)(arg1[8]) * ((arg2[5]) * (uint32_t)UINT8_C(0x13))); + uint64_t x15 = ((uint64_t)(arg1[8]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x16 = ((uint64_t)(arg1[8]) * ((arg2[3]) * (uint32_t)UINT8_C(0x13))); + uint64_t x17 = ((uint64_t)(arg1[8]) * ((arg2[2]) * (uint32_t)UINT8_C(0x13))); + uint64_t x18 = ((uint64_t)(arg1[7]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x19 = ((uint64_t)(arg1[7]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x20 = ((uint64_t)(arg1[7]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x21 = ((uint64_t)(arg1[7]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x22 = ((uint64_t)(arg1[7]) * ((arg2[5]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x23 = ((uint64_t)(arg1[7]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x24 = ((uint64_t)(arg1[7]) * ((arg2[3]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x25 = ((uint64_t)(arg1[6]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x26 = ((uint64_t)(arg1[6]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x27 = ((uint64_t)(arg1[6]) * ((arg2[7]) * (uint32_t)UINT8_C(0x13))); + uint64_t x28 = ((uint64_t)(arg1[6]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x29 = ((uint64_t)(arg1[6]) * ((arg2[5]) * (uint32_t)UINT8_C(0x13))); + uint64_t x30 = ((uint64_t)(arg1[6]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x31 = ((uint64_t)(arg1[5]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x32 = ((uint64_t)(arg1[5]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x33 = ((uint64_t)(arg1[5]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x34 = ((uint64_t)(arg1[5]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x35 = ((uint64_t)(arg1[5]) * ((arg2[5]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x36 = ((uint64_t)(arg1[4]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x37 = ((uint64_t)(arg1[4]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x38 = ((uint64_t)(arg1[4]) * ((arg2[7]) * (uint32_t)UINT8_C(0x13))); + uint64_t x39 = ((uint64_t)(arg1[4]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x40 = ((uint64_t)(arg1[3]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x41 = ((uint64_t)(arg1[3]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x42 = ((uint64_t)(arg1[3]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x43 = ((uint64_t)(arg1[2]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x44 = ((uint64_t)(arg1[2]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x45 = ((uint64_t)(arg1[1]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x46 = ((uint64_t)(arg1[9]) * (arg2[0])); + uint64_t x47 = ((uint64_t)(arg1[8]) * (arg2[1])); + uint64_t x48 = ((uint64_t)(arg1[8]) * (arg2[0])); + uint64_t x49 = ((uint64_t)(arg1[7]) * (arg2[2])); + uint64_t x50 = ((uint64_t)(arg1[7]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x51 = ((uint64_t)(arg1[7]) * (arg2[0])); + uint64_t x52 = ((uint64_t)(arg1[6]) * (arg2[3])); + uint64_t x53 = ((uint64_t)(arg1[6]) * (arg2[2])); + uint64_t x54 = ((uint64_t)(arg1[6]) * (arg2[1])); + uint64_t x55 = ((uint64_t)(arg1[6]) * (arg2[0])); + uint64_t x56 = ((uint64_t)(arg1[5]) * (arg2[4])); + uint64_t x57 = ((uint64_t)(arg1[5]) * ((arg2[3]) * (uint32_t)0x2)); + uint64_t x58 = ((uint64_t)(arg1[5]) * (arg2[2])); + uint64_t x59 = ((uint64_t)(arg1[5]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x60 = ((uint64_t)(arg1[5]) * (arg2[0])); + uint64_t x61 = ((uint64_t)(arg1[4]) * (arg2[5])); + uint64_t x62 = ((uint64_t)(arg1[4]) * (arg2[4])); + uint64_t x63 = ((uint64_t)(arg1[4]) * (arg2[3])); + uint64_t x64 = ((uint64_t)(arg1[4]) * (arg2[2])); + uint64_t x65 = ((uint64_t)(arg1[4]) * (arg2[1])); + uint64_t x66 = ((uint64_t)(arg1[4]) * (arg2[0])); + uint64_t x67 = ((uint64_t)(arg1[3]) * (arg2[6])); + uint64_t x68 = ((uint64_t)(arg1[3]) * ((arg2[5]) * (uint32_t)0x2)); + uint64_t x69 = ((uint64_t)(arg1[3]) * (arg2[4])); + uint64_t x70 = ((uint64_t)(arg1[3]) * ((arg2[3]) * (uint32_t)0x2)); + uint64_t x71 = ((uint64_t)(arg1[3]) * (arg2[2])); + uint64_t x72 = ((uint64_t)(arg1[3]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x73 = ((uint64_t)(arg1[3]) * (arg2[0])); + uint64_t x74 = ((uint64_t)(arg1[2]) * (arg2[7])); + uint64_t x75 = ((uint64_t)(arg1[2]) * (arg2[6])); + uint64_t x76 = ((uint64_t)(arg1[2]) * (arg2[5])); + uint64_t x77 = ((uint64_t)(arg1[2]) * (arg2[4])); + uint64_t x78 = ((uint64_t)(arg1[2]) * (arg2[3])); + uint64_t x79 = ((uint64_t)(arg1[2]) * (arg2[2])); + uint64_t x80 = ((uint64_t)(arg1[2]) * (arg2[1])); + uint64_t x81 = ((uint64_t)(arg1[2]) * (arg2[0])); + uint64_t x82 = ((uint64_t)(arg1[1]) * (arg2[8])); + uint64_t x83 = ((uint64_t)(arg1[1]) * ((arg2[7]) * (uint32_t)0x2)); + uint64_t x84 = ((uint64_t)(arg1[1]) * (arg2[6])); + uint64_t x85 = ((uint64_t)(arg1[1]) * ((arg2[5]) * (uint32_t)0x2)); + uint64_t x86 = ((uint64_t)(arg1[1]) * (arg2[4])); + uint64_t x87 = ((uint64_t)(arg1[1]) * ((arg2[3]) * (uint32_t)0x2)); + uint64_t x88 = ((uint64_t)(arg1[1]) * (arg2[2])); + uint64_t x89 = ((uint64_t)(arg1[1]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x90 = ((uint64_t)(arg1[1]) * (arg2[0])); + uint64_t x91 = ((uint64_t)(arg1[0]) * (arg2[9])); + uint64_t x92 = ((uint64_t)(arg1[0]) * (arg2[8])); + uint64_t x93 = ((uint64_t)(arg1[0]) * (arg2[7])); + uint64_t x94 = ((uint64_t)(arg1[0]) * (arg2[6])); + uint64_t x95 = ((uint64_t)(arg1[0]) * (arg2[5])); + uint64_t x96 = ((uint64_t)(arg1[0]) * (arg2[4])); + uint64_t x97 = ((uint64_t)(arg1[0]) * (arg2[3])); + uint64_t x98 = ((uint64_t)(arg1[0]) * (arg2[2])); + uint64_t x99 = ((uint64_t)(arg1[0]) * (arg2[1])); + uint64_t x100 = ((uint64_t)(arg1[0]) * (arg2[0])); + uint64_t x101 = (x100 + (x45 + (x44 + (x42 + (x39 + (x35 + (x30 + (x24 + (x17 + x9))))))))); + uint64_t x102 = (x101 >> 26); + uint32_t x103 = (uint32_t)(x101 & UINT32_C(0x3ffffff)); + uint64_t x104 = (x91 + (x82 + (x74 + (x67 + (x61 + (x56 + (x52 + (x49 + (x47 + x46))))))))); + uint64_t x105 = (x92 + (x83 + (x75 + (x68 + (x62 + (x57 + (x53 + (x50 + (x48 + x1))))))))); + uint64_t x106 = (x93 + (x84 + (x76 + (x69 + (x63 + (x58 + (x54 + (x51 + (x10 + x2))))))))); + uint64_t x107 = (x94 + (x85 + (x77 + (x70 + (x64 + (x59 + (x55 + (x18 + (x11 + x3))))))))); + uint64_t x108 = (x95 + (x86 + (x78 + (x71 + (x65 + (x60 + (x25 + (x19 + (x12 + x4))))))))); + uint64_t x109 = (x96 + (x87 + (x79 + (x72 + (x66 + (x31 + (x26 + (x20 + (x13 + x5))))))))); + uint64_t x110 = (x97 + (x88 + (x80 + (x73 + (x36 + (x32 + (x27 + (x21 + (x14 + x6))))))))); + uint64_t x111 = (x98 + (x89 + (x81 + (x40 + (x37 + (x33 + (x28 + (x22 + (x15 + x7))))))))); + uint64_t x112 = (x99 + (x90 + (x43 + (x41 + (x38 + (x34 + (x29 + (x23 + (x16 + x8))))))))); + uint64_t x113 = (x102 + x112); + uint64_t x114 = (x113 >> 25); + uint32_t x115 = (uint32_t)(x113 & UINT32_C(0x1ffffff)); + uint64_t x116 = (x114 + x111); + uint64_t x117 = (x116 >> 26); + uint32_t x118 = (uint32_t)(x116 & UINT32_C(0x3ffffff)); + uint64_t x119 = (x117 + x110); + uint64_t x120 = (x119 >> 25); + uint32_t x121 = (uint32_t)(x119 & UINT32_C(0x1ffffff)); + uint64_t x122 = (x120 + x109); + uint64_t x123 = (x122 >> 26); + uint32_t x124 = (uint32_t)(x122 & UINT32_C(0x3ffffff)); + uint64_t x125 = (x123 + x108); + uint64_t x126 = (x125 >> 25); + uint32_t x127 = (uint32_t)(x125 & UINT32_C(0x1ffffff)); + uint64_t x128 = (x126 + x107); + uint64_t x129 = (x128 >> 26); + uint32_t x130 = (uint32_t)(x128 & UINT32_C(0x3ffffff)); + uint64_t x131 = (x129 + x106); + uint64_t x132 = (x131 >> 25); + uint32_t x133 = (uint32_t)(x131 & UINT32_C(0x1ffffff)); + uint64_t x134 = (x132 + x105); + uint64_t x135 = (x134 >> 26); + uint32_t x136 = (uint32_t)(x134 & UINT32_C(0x3ffffff)); + uint64_t x137 = (x135 + x104); + uint64_t x138 = (x137 >> 25); + uint32_t x139 = (uint32_t)(x137 & UINT32_C(0x1ffffff)); + uint64_t x140 = (x138 * (uint64_t)UINT8_C(0x13)); + uint64_t x141 = (x103 + x140); + uint32_t x142 = (uint32_t)(x141 >> 26); + uint32_t x143 = (uint32_t)(x141 & UINT32_C(0x3ffffff)); + uint32_t x144 = (x142 + x115); + uint32_t x145 = (x144 >> 25); + uint32_t x146 = (x144 & UINT32_C(0x1ffffff)); + uint32_t x147 = (x145 + x118); + out1[0] = x143; + out1[1] = x146; + out1[2] = x147; + out1[3] = x121; + out1[4] = x124; + out1[5] = x127; + out1[6] = x130; + out1[7] = x133; + out1[8] = x136; + out1[9] = x139; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry_square(uint32_t out1[10], const uint32_t arg1[10]) { + uint32_t x1 = ((arg1[9]) * (uint32_t)UINT8_C(0x13)); + uint32_t x2 = (x1 * (uint32_t)0x2); + uint32_t x3 = ((arg1[9]) * (uint32_t)0x2); + uint32_t x4 = ((arg1[8]) * (uint32_t)UINT8_C(0x13)); + uint64_t x5 = (x4 * (uint64_t)0x2); + uint32_t x6 = ((arg1[8]) * (uint32_t)0x2); + uint32_t x7 = ((arg1[7]) * (uint32_t)UINT8_C(0x13)); + uint32_t x8 = (x7 * (uint32_t)0x2); + uint32_t x9 = ((arg1[7]) * (uint32_t)0x2); + uint32_t x10 = ((arg1[6]) * (uint32_t)UINT8_C(0x13)); + uint64_t x11 = (x10 * (uint64_t)0x2); + uint32_t x12 = ((arg1[6]) * (uint32_t)0x2); + uint32_t x13 = ((arg1[5]) * (uint32_t)UINT8_C(0x13)); + uint32_t x14 = ((arg1[5]) * (uint32_t)0x2); + uint32_t x15 = ((arg1[4]) * (uint32_t)0x2); + uint32_t x16 = ((arg1[3]) * (uint32_t)0x2); + uint32_t x17 = ((arg1[2]) * (uint32_t)0x2); + uint32_t x18 = ((arg1[1]) * (uint32_t)0x2); + uint64_t x19 = ((uint64_t)(arg1[9]) * (x1 * (uint32_t)0x2)); + uint64_t x20 = ((uint64_t)(arg1[8]) * x2); + uint64_t x21 = ((uint64_t)(arg1[8]) * x4); + uint64_t x22 = ((arg1[7]) * (x2 * (uint64_t)0x2)); + uint64_t x23 = ((arg1[7]) * x5); + uint64_t x24 = ((uint64_t)(arg1[7]) * (x7 * (uint32_t)0x2)); + uint64_t x25 = ((uint64_t)(arg1[6]) * x2); + uint64_t x26 = ((arg1[6]) * x5); + uint64_t x27 = ((uint64_t)(arg1[6]) * x8); + uint64_t x28 = ((uint64_t)(arg1[6]) * x10); + uint64_t x29 = ((arg1[5]) * (x2 * (uint64_t)0x2)); + uint64_t x30 = ((arg1[5]) * x5); + uint64_t x31 = ((arg1[5]) * (x8 * (uint64_t)0x2)); + uint64_t x32 = ((arg1[5]) * x11); + uint64_t x33 = ((uint64_t)(arg1[5]) * (x13 * (uint32_t)0x2)); + uint64_t x34 = ((uint64_t)(arg1[4]) * x2); + uint64_t x35 = ((arg1[4]) * x5); + uint64_t x36 = ((uint64_t)(arg1[4]) * x8); + uint64_t x37 = ((arg1[4]) * x11); + uint64_t x38 = ((uint64_t)(arg1[4]) * x14); + uint64_t x39 = ((uint64_t)(arg1[4]) * (arg1[4])); + uint64_t x40 = ((arg1[3]) * (x2 * (uint64_t)0x2)); + uint64_t x41 = ((arg1[3]) * x5); + uint64_t x42 = ((arg1[3]) * (x8 * (uint64_t)0x2)); + uint64_t x43 = ((uint64_t)(arg1[3]) * x12); + uint64_t x44 = ((uint64_t)(arg1[3]) * (x14 * (uint32_t)0x2)); + uint64_t x45 = ((uint64_t)(arg1[3]) * x15); + uint64_t x46 = ((uint64_t)(arg1[3]) * ((arg1[3]) * (uint32_t)0x2)); + uint64_t x47 = ((uint64_t)(arg1[2]) * x2); + uint64_t x48 = ((arg1[2]) * x5); + uint64_t x49 = ((uint64_t)(arg1[2]) * x9); + uint64_t x50 = ((uint64_t)(arg1[2]) * x12); + uint64_t x51 = ((uint64_t)(arg1[2]) * x14); + uint64_t x52 = ((uint64_t)(arg1[2]) * x15); + uint64_t x53 = ((uint64_t)(arg1[2]) * x16); + uint64_t x54 = ((uint64_t)(arg1[2]) * (arg1[2])); + uint64_t x55 = ((arg1[1]) * (x2 * (uint64_t)0x2)); + uint64_t x56 = ((uint64_t)(arg1[1]) * x6); + uint64_t x57 = ((uint64_t)(arg1[1]) * (x9 * (uint32_t)0x2)); + uint64_t x58 = ((uint64_t)(arg1[1]) * x12); + uint64_t x59 = ((uint64_t)(arg1[1]) * (x14 * (uint32_t)0x2)); + uint64_t x60 = ((uint64_t)(arg1[1]) * x15); + uint64_t x61 = ((uint64_t)(arg1[1]) * (x16 * (uint32_t)0x2)); + uint64_t x62 = ((uint64_t)(arg1[1]) * x17); + uint64_t x63 = ((uint64_t)(arg1[1]) * ((arg1[1]) * (uint32_t)0x2)); + uint64_t x64 = ((uint64_t)(arg1[0]) * x3); + uint64_t x65 = ((uint64_t)(arg1[0]) * x6); + uint64_t x66 = ((uint64_t)(arg1[0]) * x9); + uint64_t x67 = ((uint64_t)(arg1[0]) * x12); + uint64_t x68 = ((uint64_t)(arg1[0]) * x14); + uint64_t x69 = ((uint64_t)(arg1[0]) * x15); + uint64_t x70 = ((uint64_t)(arg1[0]) * x16); + uint64_t x71 = ((uint64_t)(arg1[0]) * x17); + uint64_t x72 = ((uint64_t)(arg1[0]) * x18); + uint64_t x73 = ((uint64_t)(arg1[0]) * (arg1[0])); + uint64_t x74 = (x73 + (x55 + (x48 + (x42 + (x37 + x33))))); + uint64_t x75 = (x74 >> 26); + uint32_t x76 = (uint32_t)(x74 & UINT32_C(0x3ffffff)); + uint64_t x77 = (x64 + (x56 + (x49 + (x43 + x38)))); + uint64_t x78 = (x65 + (x57 + (x50 + (x44 + (x39 + x19))))); + uint64_t x79 = (x66 + (x58 + (x51 + (x45 + x20)))); + uint64_t x80 = (x67 + (x59 + (x52 + (x46 + (x22 + x21))))); + uint64_t x81 = (x68 + (x60 + (x53 + (x25 + x23)))); + uint64_t x82 = (x69 + (x61 + (x54 + (x29 + (x26 + x24))))); + uint64_t x83 = (x70 + (x62 + (x34 + (x30 + x27)))); + uint64_t x84 = (x71 + (x63 + (x40 + (x35 + (x31 + x28))))); + uint64_t x85 = (x72 + (x47 + (x41 + (x36 + x32)))); + uint64_t x86 = (x75 + x85); + uint64_t x87 = (x86 >> 25); + uint32_t x88 = (uint32_t)(x86 & UINT32_C(0x1ffffff)); + uint64_t x89 = (x87 + x84); + uint64_t x90 = (x89 >> 26); + uint32_t x91 = (uint32_t)(x89 & UINT32_C(0x3ffffff)); + uint64_t x92 = (x90 + x83); + uint64_t x93 = (x92 >> 25); + uint32_t x94 = (uint32_t)(x92 & UINT32_C(0x1ffffff)); + uint64_t x95 = (x93 + x82); + uint64_t x96 = (x95 >> 26); + uint32_t x97 = (uint32_t)(x95 & UINT32_C(0x3ffffff)); + uint64_t x98 = (x96 + x81); + uint64_t x99 = (x98 >> 25); + uint32_t x100 = (uint32_t)(x98 & UINT32_C(0x1ffffff)); + uint64_t x101 = (x99 + x80); + uint64_t x102 = (x101 >> 26); + uint32_t x103 = (uint32_t)(x101 & UINT32_C(0x3ffffff)); + uint64_t x104 = (x102 + x79); + uint64_t x105 = (x104 >> 25); + uint32_t x106 = (uint32_t)(x104 & UINT32_C(0x1ffffff)); + uint64_t x107 = (x105 + x78); + uint64_t x108 = (x107 >> 26); + uint32_t x109 = (uint32_t)(x107 & UINT32_C(0x3ffffff)); + uint64_t x110 = (x108 + x77); + uint64_t x111 = (x110 >> 25); + uint32_t x112 = (uint32_t)(x110 & UINT32_C(0x1ffffff)); + uint64_t x113 = (x111 * (uint64_t)UINT8_C(0x13)); + uint64_t x114 = (x76 + x113); + uint32_t x115 = (uint32_t)(x114 >> 26); + uint32_t x116 = (uint32_t)(x114 & UINT32_C(0x3ffffff)); + uint32_t x117 = (x115 + x88); + uint32_t x118 = (x117 >> 25); + uint32_t x119 = (x117 & UINT32_C(0x1ffffff)); + uint32_t x120 = (x118 + x91); + out1[0] = x116; + out1[1] = x119; + out1[2] = x120; + out1[3] = x94; + out1[4] = x97; + out1[5] = x100; + out1[6] = x103; + out1[7] = x106; + out1[8] = x109; + out1[9] = x112; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry_scmul_121666(uint32_t out1[10], const uint32_t arg1[10]) { + uint64_t x1 = ((uint64_t)UINT32_C(0x1db42) * (arg1[9])); + uint64_t x2 = ((uint64_t)UINT32_C(0x1db42) * (arg1[8])); + uint64_t x3 = ((uint64_t)UINT32_C(0x1db42) * (arg1[7])); + uint64_t x4 = ((uint64_t)UINT32_C(0x1db42) * (arg1[6])); + uint64_t x5 = ((uint64_t)UINT32_C(0x1db42) * (arg1[5])); + uint64_t x6 = ((uint64_t)UINT32_C(0x1db42) * (arg1[4])); + uint64_t x7 = ((uint64_t)UINT32_C(0x1db42) * (arg1[3])); + uint64_t x8 = ((uint64_t)UINT32_C(0x1db42) * (arg1[2])); + uint64_t x9 = ((uint64_t)UINT32_C(0x1db42) * (arg1[1])); + uint64_t x10 = ((uint64_t)UINT32_C(0x1db42) * (arg1[0])); + uint32_t x11 = (uint32_t)(x10 >> 26); + uint32_t x12 = (uint32_t)(x10 & UINT32_C(0x3ffffff)); + uint64_t x13 = (x11 + x9); + uint32_t x14 = (uint32_t)(x13 >> 25); + uint32_t x15 = (uint32_t)(x13 & UINT32_C(0x1ffffff)); + uint64_t x16 = (x14 + x8); + uint32_t x17 = (uint32_t)(x16 >> 26); + uint32_t x18 = (uint32_t)(x16 & UINT32_C(0x3ffffff)); + uint64_t x19 = (x17 + x7); + uint32_t x20 = (uint32_t)(x19 >> 25); + uint32_t x21 = (uint32_t)(x19 & UINT32_C(0x1ffffff)); + uint64_t x22 = (x20 + x6); + uint32_t x23 = (uint32_t)(x22 >> 26); + uint32_t x24 = (uint32_t)(x22 & UINT32_C(0x3ffffff)); + uint64_t x25 = (x23 + x5); + uint32_t x26 = (uint32_t)(x25 >> 25); + uint32_t x27 = (uint32_t)(x25 & UINT32_C(0x1ffffff)); + uint64_t x28 = (x26 + x4); + uint32_t x29 = (uint32_t)(x28 >> 26); + uint32_t x30 = (uint32_t)(x28 & UINT32_C(0x3ffffff)); + uint64_t x31 = (x29 + x3); + uint32_t x32 = (uint32_t)(x31 >> 25); + uint32_t x33 = (uint32_t)(x31 & UINT32_C(0x1ffffff)); + uint64_t x34 = (x32 + x2); + uint32_t x35 = (uint32_t)(x34 >> 26); + uint32_t x36 = (uint32_t)(x34 & UINT32_C(0x3ffffff)); + uint64_t x37 = (x35 + x1); + uint32_t x38 = (uint32_t)(x37 >> 25); + uint32_t x39 = (uint32_t)(x37 & UINT32_C(0x1ffffff)); + uint32_t x40 = (x38 * (uint32_t)UINT8_C(0x13)); + uint32_t x41 = (x12 + x40); + uint32_t x42 = (x41 >> 26); + uint32_t x43 = (x41 & UINT32_C(0x3ffffff)); + uint32_t x44 = (x42 + x15); + uint32_t x45 = (x44 >> 25); + uint32_t x46 = (x44 & UINT32_C(0x1ffffff)); + uint32_t x47 = (x45 + x18); + out1[0] = x43; + out1[1] = x46; + out1[2] = x47; + out1[3] = x21; + out1[4] = x24; + out1[5] = x27; + out1[6] = x30; + out1[7] = x33; + out1[8] = x36; + out1[9] = x39; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry(uint32_t out1[10], const uint32_t arg1[10]) { + uint32_t x1 = (arg1[0]); + uint32_t x2 = ((x1 >> 26) + (arg1[1])); + uint32_t x3 = ((x2 >> 25) + (arg1[2])); + uint32_t x4 = ((x3 >> 26) + (arg1[3])); + uint32_t x5 = ((x4 >> 25) + (arg1[4])); + uint32_t x6 = ((x5 >> 26) + (arg1[5])); + uint32_t x7 = ((x6 >> 25) + (arg1[6])); + uint32_t x8 = ((x7 >> 26) + (arg1[7])); + uint32_t x9 = ((x8 >> 25) + (arg1[8])); + uint32_t x10 = ((x9 >> 26) + (arg1[9])); + uint32_t x11 = ((x1 & UINT32_C(0x3ffffff)) + ((x10 >> 25) * (uint32_t)UINT8_C(0x13))); + uint32_t x12 = ((x11 >> 26) + (x2 & UINT32_C(0x1ffffff))); + uint32_t x13 = (x11 & UINT32_C(0x3ffffff)); + uint32_t x14 = (x12 & UINT32_C(0x1ffffff)); + uint32_t x15 = ((x12 >> 25) + (x3 & UINT32_C(0x3ffffff))); + uint32_t x16 = (x4 & UINT32_C(0x1ffffff)); + uint32_t x17 = (x5 & UINT32_C(0x3ffffff)); + uint32_t x18 = (x6 & UINT32_C(0x1ffffff)); + uint32_t x19 = (x7 & UINT32_C(0x3ffffff)); + uint32_t x20 = (x8 & UINT32_C(0x1ffffff)); + uint32_t x21 = (x9 & UINT32_C(0x3ffffff)); + uint32_t x22 = (x10 & UINT32_C(0x1ffffff)); + out1[0] = x13; + out1[1] = x14; + out1[2] = x15; + out1[3] = x16; + out1[4] = x17; + out1[5] = x18; + out1[6] = x19; + out1[7] = x20; + out1[8] = x21; + out1[9] = x22; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * arg2: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + */ +static void fiat_25519_add(uint32_t out1[10], const uint32_t arg1[10], const uint32_t arg2[10]) { + uint32_t x1 = ((arg1[0]) + (arg2[0])); + uint32_t x2 = ((arg1[1]) + (arg2[1])); + uint32_t x3 = ((arg1[2]) + (arg2[2])); + uint32_t x4 = ((arg1[3]) + (arg2[3])); + uint32_t x5 = ((arg1[4]) + (arg2[4])); + uint32_t x6 = ((arg1[5]) + (arg2[5])); + uint32_t x7 = ((arg1[6]) + (arg2[6])); + uint32_t x8 = ((arg1[7]) + (arg2[7])); + uint32_t x9 = ((arg1[8]) + (arg2[8])); + uint32_t x10 = ((arg1[9]) + (arg2[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * arg2: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + */ +static void fiat_25519_sub(uint32_t out1[10], const uint32_t arg1[10], const uint32_t arg2[10]) { + uint32_t x1 = ((UINT32_C(0x7ffffda) + (arg1[0])) - (arg2[0])); + uint32_t x2 = ((UINT32_C(0x3fffffe) + (arg1[1])) - (arg2[1])); + uint32_t x3 = ((UINT32_C(0x7fffffe) + (arg1[2])) - (arg2[2])); + uint32_t x4 = ((UINT32_C(0x3fffffe) + (arg1[3])) - (arg2[3])); + uint32_t x5 = ((UINT32_C(0x7fffffe) + (arg1[4])) - (arg2[4])); + uint32_t x6 = ((UINT32_C(0x3fffffe) + (arg1[5])) - (arg2[5])); + uint32_t x7 = ((UINT32_C(0x7fffffe) + (arg1[6])) - (arg2[6])); + uint32_t x8 = ((UINT32_C(0x3fffffe) + (arg1[7])) - (arg2[7])); + uint32_t x9 = ((UINT32_C(0x7fffffe) + (arg1[8])) - (arg2[8])); + uint32_t x10 = ((UINT32_C(0x3fffffe) + (arg1[9])) - (arg2[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + */ +static void fiat_25519_opp(uint32_t out1[10], const uint32_t arg1[10]) { + uint32_t x1 = (UINT32_C(0x7ffffda) - (arg1[0])); + uint32_t x2 = (UINT32_C(0x3fffffe) - (arg1[1])); + uint32_t x3 = (UINT32_C(0x7fffffe) - (arg1[2])); + uint32_t x4 = (UINT32_C(0x3fffffe) - (arg1[3])); + uint32_t x5 = (UINT32_C(0x7fffffe) - (arg1[4])); + uint32_t x6 = (UINT32_C(0x3fffffe) - (arg1[5])); + uint32_t x7 = (UINT32_C(0x7fffffe) - (arg1[6])); + uint32_t x8 = (UINT32_C(0x3fffffe) - (arg1[7])); + uint32_t x9 = (UINT32_C(0x7fffffe) - (arg1[8])); + uint32_t x10 = (UINT32_C(0x3fffffe) - (arg1[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_25519_selectznz(uint32_t out1[10], fiat_25519_uint1 arg1, const uint32_t arg2[10], const uint32_t arg3[10]) { + uint32_t x1; + fiat_25519_cmovznz_u32(&x1, arg1, (arg2[0]), (arg3[0])); + uint32_t x2; + fiat_25519_cmovznz_u32(&x2, arg1, (arg2[1]), (arg3[1])); + uint32_t x3; + fiat_25519_cmovznz_u32(&x3, arg1, (arg2[2]), (arg3[2])); + uint32_t x4; + fiat_25519_cmovznz_u32(&x4, arg1, (arg2[3]), (arg3[3])); + uint32_t x5; + fiat_25519_cmovznz_u32(&x5, arg1, (arg2[4]), (arg3[4])); + uint32_t x6; + fiat_25519_cmovznz_u32(&x6, arg1, (arg2[5]), (arg3[5])); + uint32_t x7; + fiat_25519_cmovznz_u32(&x7, arg1, (arg2[6]), (arg3[6])); + uint32_t x8; + fiat_25519_cmovznz_u32(&x8, arg1, (arg2[7]), (arg3[7])); + uint32_t x9; + fiat_25519_cmovznz_u32(&x9, arg1, (arg2[8]), (arg3[8])); + uint32_t x10; + fiat_25519_cmovznz_u32(&x10, arg1, (arg2[9]), (arg3[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + */ +static void fiat_25519_to_bytes(uint8_t out1[32], const uint32_t arg1[10]) { + uint32_t x1; + fiat_25519_uint1 x2; + fiat_25519_subborrowx_u26(&x1, &x2, 0x0, (arg1[0]), UINT32_C(0x3ffffed)); + uint32_t x3; + fiat_25519_uint1 x4; + fiat_25519_subborrowx_u25(&x3, &x4, x2, (arg1[1]), UINT32_C(0x1ffffff)); + uint32_t x5; + fiat_25519_uint1 x6; + fiat_25519_subborrowx_u26(&x5, &x6, x4, (arg1[2]), UINT32_C(0x3ffffff)); + uint32_t x7; + fiat_25519_uint1 x8; + fiat_25519_subborrowx_u25(&x7, &x8, x6, (arg1[3]), UINT32_C(0x1ffffff)); + uint32_t x9; + fiat_25519_uint1 x10; + fiat_25519_subborrowx_u26(&x9, &x10, x8, (arg1[4]), UINT32_C(0x3ffffff)); + uint32_t x11; + fiat_25519_uint1 x12; + fiat_25519_subborrowx_u25(&x11, &x12, x10, (arg1[5]), UINT32_C(0x1ffffff)); + uint32_t x13; + fiat_25519_uint1 x14; + fiat_25519_subborrowx_u26(&x13, &x14, x12, (arg1[6]), UINT32_C(0x3ffffff)); + uint32_t x15; + fiat_25519_uint1 x16; + fiat_25519_subborrowx_u25(&x15, &x16, x14, (arg1[7]), UINT32_C(0x1ffffff)); + uint32_t x17; + fiat_25519_uint1 x18; + fiat_25519_subborrowx_u26(&x17, &x18, x16, (arg1[8]), UINT32_C(0x3ffffff)); + uint32_t x19; + fiat_25519_uint1 x20; + fiat_25519_subborrowx_u25(&x19, &x20, x18, (arg1[9]), UINT32_C(0x1ffffff)); + uint32_t x21; + fiat_25519_cmovznz_u32(&x21, x20, 0x0, UINT32_C(0xffffffff)); + uint32_t x22; + fiat_25519_uint1 x23; + fiat_25519_addcarryx_u26(&x22, &x23, 0x0, (x21 & UINT32_C(0x3ffffed)), x1); + uint32_t x24; + fiat_25519_uint1 x25; + fiat_25519_addcarryx_u25(&x24, &x25, x23, (x21 & UINT32_C(0x1ffffff)), x3); + uint32_t x26; + fiat_25519_uint1 x27; + fiat_25519_addcarryx_u26(&x26, &x27, x25, (x21 & UINT32_C(0x3ffffff)), x5); + uint32_t x28; + fiat_25519_uint1 x29; + fiat_25519_addcarryx_u25(&x28, &x29, x27, (x21 & UINT32_C(0x1ffffff)), x7); + uint32_t x30; + fiat_25519_uint1 x31; + fiat_25519_addcarryx_u26(&x30, &x31, x29, (x21 & UINT32_C(0x3ffffff)), x9); + uint32_t x32; + fiat_25519_uint1 x33; + fiat_25519_addcarryx_u25(&x32, &x33, x31, (x21 & UINT32_C(0x1ffffff)), x11); + uint32_t x34; + fiat_25519_uint1 x35; + fiat_25519_addcarryx_u26(&x34, &x35, x33, (x21 & UINT32_C(0x3ffffff)), x13); + uint32_t x36; + fiat_25519_uint1 x37; + fiat_25519_addcarryx_u25(&x36, &x37, x35, (x21 & UINT32_C(0x1ffffff)), x15); + uint32_t x38; + fiat_25519_uint1 x39; + fiat_25519_addcarryx_u26(&x38, &x39, x37, (x21 & UINT32_C(0x3ffffff)), x17); + uint32_t x40; + fiat_25519_uint1 x41; + fiat_25519_addcarryx_u25(&x40, &x41, x39, (x21 & UINT32_C(0x1ffffff)), x19); + uint32_t x42 = (x40 << 6); + uint32_t x43 = (x38 << 4); + uint32_t x44 = (x36 << 3); + uint32_t x45 = (x34 * (uint32_t)0x2); + uint32_t x46 = (x30 << 6); + uint32_t x47 = (x28 << 5); + uint32_t x48 = (x26 << 3); + uint32_t x49 = (x24 << 2); + uint32_t x50 = (x22 >> 8); + uint8_t x51 = (uint8_t)(x22 & UINT8_C(0xff)); + uint32_t x52 = (x50 >> 8); + uint8_t x53 = (uint8_t)(x50 & UINT8_C(0xff)); + uint8_t x54 = (uint8_t)(x52 >> 8); + uint8_t x55 = (uint8_t)(x52 & UINT8_C(0xff)); + uint32_t x56 = (x54 + x49); + uint32_t x57 = (x56 >> 8); + uint8_t x58 = (uint8_t)(x56 & UINT8_C(0xff)); + uint32_t x59 = (x57 >> 8); + uint8_t x60 = (uint8_t)(x57 & UINT8_C(0xff)); + uint8_t x61 = (uint8_t)(x59 >> 8); + uint8_t x62 = (uint8_t)(x59 & UINT8_C(0xff)); + uint32_t x63 = (x61 + x48); + uint32_t x64 = (x63 >> 8); + uint8_t x65 = (uint8_t)(x63 & UINT8_C(0xff)); + uint32_t x66 = (x64 >> 8); + uint8_t x67 = (uint8_t)(x64 & UINT8_C(0xff)); + uint8_t x68 = (uint8_t)(x66 >> 8); + uint8_t x69 = (uint8_t)(x66 & UINT8_C(0xff)); + uint32_t x70 = (x68 + x47); + uint32_t x71 = (x70 >> 8); + uint8_t x72 = (uint8_t)(x70 & UINT8_C(0xff)); + uint32_t x73 = (x71 >> 8); + uint8_t x74 = (uint8_t)(x71 & UINT8_C(0xff)); + uint8_t x75 = (uint8_t)(x73 >> 8); + uint8_t x76 = (uint8_t)(x73 & UINT8_C(0xff)); + uint32_t x77 = (x75 + x46); + uint32_t x78 = (x77 >> 8); + uint8_t x79 = (uint8_t)(x77 & UINT8_C(0xff)); + uint32_t x80 = (x78 >> 8); + uint8_t x81 = (uint8_t)(x78 & UINT8_C(0xff)); + uint8_t x82 = (uint8_t)(x80 >> 8); + uint8_t x83 = (uint8_t)(x80 & UINT8_C(0xff)); + uint8_t x84 = (uint8_t)(x82 & UINT8_C(0xff)); + uint32_t x85 = (x32 >> 8); + uint8_t x86 = (uint8_t)(x32 & UINT8_C(0xff)); + uint32_t x87 = (x85 >> 8); + uint8_t x88 = (uint8_t)(x85 & UINT8_C(0xff)); + fiat_25519_uint1 x89 = (fiat_25519_uint1)(x87 >> 8); + uint8_t x90 = (uint8_t)(x87 & UINT8_C(0xff)); + uint32_t x91 = (x89 + x45); + uint32_t x92 = (x91 >> 8); + uint8_t x93 = (uint8_t)(x91 & UINT8_C(0xff)); + uint32_t x94 = (x92 >> 8); + uint8_t x95 = (uint8_t)(x92 & UINT8_C(0xff)); + uint8_t x96 = (uint8_t)(x94 >> 8); + uint8_t x97 = (uint8_t)(x94 & UINT8_C(0xff)); + uint32_t x98 = (x96 + x44); + uint32_t x99 = (x98 >> 8); + uint8_t x100 = (uint8_t)(x98 & UINT8_C(0xff)); + uint32_t x101 = (x99 >> 8); + uint8_t x102 = (uint8_t)(x99 & UINT8_C(0xff)); + uint8_t x103 = (uint8_t)(x101 >> 8); + uint8_t x104 = (uint8_t)(x101 & UINT8_C(0xff)); + uint32_t x105 = (x103 + x43); + uint32_t x106 = (x105 >> 8); + uint8_t x107 = (uint8_t)(x105 & UINT8_C(0xff)); + uint32_t x108 = (x106 >> 8); + uint8_t x109 = (uint8_t)(x106 & UINT8_C(0xff)); + uint8_t x110 = (uint8_t)(x108 >> 8); + uint8_t x111 = (uint8_t)(x108 & UINT8_C(0xff)); + uint32_t x112 = (x110 + x42); + uint32_t x113 = (x112 >> 8); + uint8_t x114 = (uint8_t)(x112 & UINT8_C(0xff)); + uint32_t x115 = (x113 >> 8); + uint8_t x116 = (uint8_t)(x113 & UINT8_C(0xff)); + uint8_t x117 = (uint8_t)(x115 >> 8); + uint8_t x118 = (uint8_t)(x115 & UINT8_C(0xff)); + out1[0] = x51; + out1[1] = x53; + out1[2] = x55; + out1[3] = x58; + out1[4] = x60; + out1[5] = x62; + out1[6] = x65; + out1[7] = x67; + out1[8] = x69; + out1[9] = x72; + out1[10] = x74; + out1[11] = x76; + out1[12] = x79; + out1[13] = x81; + out1[14] = x83; + out1[15] = x84; + out1[16] = x86; + out1[17] = x88; + out1[18] = x90; + out1[19] = x93; + out1[20] = x95; + out1[21] = x97; + out1[22] = x100; + out1[23] = x102; + out1[24] = x104; + out1[25] = x107; + out1[26] = x109; + out1[27] = x111; + out1[28] = x114; + out1[29] = x116; + out1[30] = x118; + out1[31] = x117; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_from_bytes(uint32_t out1[10], const uint8_t arg1[32]) { + uint32_t x1 = ((uint32_t)(arg1[31]) << 18); + uint32_t x2 = ((uint32_t)(arg1[30]) << 10); + uint32_t x3 = ((uint32_t)(arg1[29]) << 2); + uint32_t x4 = ((uint32_t)(arg1[28]) << 20); + uint32_t x5 = ((uint32_t)(arg1[27]) << 12); + uint32_t x6 = ((uint32_t)(arg1[26]) << 4); + uint32_t x7 = ((uint32_t)(arg1[25]) << 21); + uint32_t x8 = ((uint32_t)(arg1[24]) << 13); + uint32_t x9 = ((uint32_t)(arg1[23]) << 5); + uint32_t x10 = ((uint32_t)(arg1[22]) << 23); + uint32_t x11 = ((uint32_t)(arg1[21]) << 15); + uint32_t x12 = ((uint32_t)(arg1[20]) << 7); + uint32_t x13 = ((uint32_t)(arg1[19]) << 24); + uint32_t x14 = ((uint32_t)(arg1[18]) << 16); + uint32_t x15 = ((uint32_t)(arg1[17]) << 8); + uint8_t x16 = (arg1[16]); + uint32_t x17 = ((uint32_t)(arg1[15]) << 18); + uint32_t x18 = ((uint32_t)(arg1[14]) << 10); + uint32_t x19 = ((uint32_t)(arg1[13]) << 2); + uint32_t x20 = ((uint32_t)(arg1[12]) << 19); + uint32_t x21 = ((uint32_t)(arg1[11]) << 11); + uint32_t x22 = ((uint32_t)(arg1[10]) << 3); + uint32_t x23 = ((uint32_t)(arg1[9]) << 21); + uint32_t x24 = ((uint32_t)(arg1[8]) << 13); + uint32_t x25 = ((uint32_t)(arg1[7]) << 5); + uint32_t x26 = ((uint32_t)(arg1[6]) << 22); + uint32_t x27 = ((uint32_t)(arg1[5]) << 14); + uint32_t x28 = ((uint32_t)(arg1[4]) << 6); + uint32_t x29 = ((uint32_t)(arg1[3]) << 24); + uint32_t x30 = ((uint32_t)(arg1[2]) << 16); + uint32_t x31 = ((uint32_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint32_t x33 = (x32 + (x31 + (x30 + x29))); + uint8_t x34 = (uint8_t)(x33 >> 26); + uint32_t x35 = (x33 & UINT32_C(0x3ffffff)); + uint32_t x36 = (x3 + (x2 + x1)); + uint32_t x37 = (x6 + (x5 + x4)); + uint32_t x38 = (x9 + (x8 + x7)); + uint32_t x39 = (x12 + (x11 + x10)); + uint32_t x40 = (x16 + (x15 + (x14 + x13))); + uint32_t x41 = (x19 + (x18 + x17)); + uint32_t x42 = (x22 + (x21 + x20)); + uint32_t x43 = (x25 + (x24 + x23)); + uint32_t x44 = (x28 + (x27 + x26)); + uint32_t x45 = (x34 + x44); + uint8_t x46 = (uint8_t)(x45 >> 25); + uint32_t x47 = (x45 & UINT32_C(0x1ffffff)); + uint32_t x48 = (x46 + x43); + uint8_t x49 = (uint8_t)(x48 >> 26); + uint32_t x50 = (x48 & UINT32_C(0x3ffffff)); + uint32_t x51 = (x49 + x42); + uint8_t x52 = (uint8_t)(x51 >> 25); + uint32_t x53 = (x51 & UINT32_C(0x1ffffff)); + uint32_t x54 = (x52 + x41); + uint32_t x55 = (x54 & UINT32_C(0x3ffffff)); + uint8_t x56 = (uint8_t)(x40 >> 25); + uint32_t x57 = (x40 & UINT32_C(0x1ffffff)); + uint32_t x58 = (x56 + x39); + uint8_t x59 = (uint8_t)(x58 >> 26); + uint32_t x60 = (x58 & UINT32_C(0x3ffffff)); + uint32_t x61 = (x59 + x38); + uint8_t x62 = (uint8_t)(x61 >> 25); + uint32_t x63 = (x61 & UINT32_C(0x1ffffff)); + uint32_t x64 = (x62 + x37); + uint8_t x65 = (uint8_t)(x64 >> 26); + uint32_t x66 = (x64 & UINT32_C(0x3ffffff)); + uint32_t x67 = (x65 + x36); + out1[0] = x35; + out1[1] = x47; + out1[2] = x50; + out1[3] = x53; + out1[4] = x55; + out1[5] = x57; + out1[6] = x60; + out1[7] = x63; + out1[8] = x66; + out1[9] = x67; +} + diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h.grpc_back new file mode 100644 index 000000000..53772421d --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_32.h.grpc_back @@ -0,0 +1,911 @@ +/* Autogenerated */ +/* curve description: 25519 */ +/* requested operations: carry_mul, carry_square, carry_scmul121666, carry, add, sub, opp, selectznz, to_bytes, from_bytes */ +/* n = 10 (from "10") */ +/* s = 0x8000000000000000000000000000000000000000000000000000000000000000 (from "2^255") */ +/* c = [(1, 19)] (from "1,19") */ +/* machine_wordsize = 32 (from "32") */ + +#include +typedef unsigned char fiat_25519_uint1; +typedef signed char fiat_25519_int1; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x3ffffff] + * arg3: [0x0 ~> 0x3ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x3ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_addcarryx_u26(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + uint32_t x1 = ((arg1 + arg2) + arg3); + uint32_t x2 = (x1 & UINT32_C(0x3ffffff)); + fiat_25519_uint1 x3 = (fiat_25519_uint1)(x1 >> 26); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x3ffffff] + * arg3: [0x0 ~> 0x3ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x3ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_subborrowx_u26(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + int32_t x1 = ((int32_t)(arg2 - arg1) - (int32_t)arg3); + fiat_25519_int1 x2 = (fiat_25519_int1)(x1 >> 26); + uint32_t x3 = (x1 & UINT32_C(0x3ffffff)); + *out1 = x3; + *out2 = (fiat_25519_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x1ffffff] + * arg3: [0x0 ~> 0x1ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x1ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_addcarryx_u25(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + uint32_t x1 = ((arg1 + arg2) + arg3); + uint32_t x2 = (x1 & UINT32_C(0x1ffffff)); + fiat_25519_uint1 x3 = (fiat_25519_uint1)(x1 >> 25); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x1ffffff] + * arg3: [0x0 ~> 0x1ffffff] + * Output Bounds: + * out1: [0x0 ~> 0x1ffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_subborrowx_u25(uint32_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + int32_t x1 = ((int32_t)(arg2 - arg1) - (int32_t)arg3); + fiat_25519_int1 x2 = (fiat_25519_int1)(x1 >> 25); + uint32_t x3 = (x1 & UINT32_C(0x1ffffff)); + *out1 = x3; + *out2 = (fiat_25519_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + */ +static void fiat_25519_cmovznz_u32(uint32_t* out1, fiat_25519_uint1 arg1, uint32_t arg2, uint32_t arg3) { + fiat_25519_uint1 x1 = (!(!arg1)); + uint32_t x2 = ((fiat_25519_int1)(0x0 - x1) & UINT32_C(0xffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint32_t x3 = ((value_barrier_u32(x2) & arg3) | (value_barrier_u32(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * arg2: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry_mul(uint32_t out1[10], const uint32_t arg1[10], const uint32_t arg2[10]) { + uint64_t x1 = ((uint64_t)(arg1[9]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x2 = ((uint64_t)(arg1[9]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x3 = ((uint64_t)(arg1[9]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x4 = ((uint64_t)(arg1[9]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x5 = ((uint64_t)(arg1[9]) * ((arg2[5]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x6 = ((uint64_t)(arg1[9]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x7 = ((uint64_t)(arg1[9]) * ((arg2[3]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x8 = ((uint64_t)(arg1[9]) * ((arg2[2]) * (uint32_t)UINT8_C(0x13))); + uint64_t x9 = ((uint64_t)(arg1[9]) * ((arg2[1]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x10 = ((uint64_t)(arg1[8]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x11 = ((uint64_t)(arg1[8]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x12 = ((uint64_t)(arg1[8]) * ((arg2[7]) * (uint32_t)UINT8_C(0x13))); + uint64_t x13 = ((uint64_t)(arg1[8]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x14 = ((uint64_t)(arg1[8]) * ((arg2[5]) * (uint32_t)UINT8_C(0x13))); + uint64_t x15 = ((uint64_t)(arg1[8]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x16 = ((uint64_t)(arg1[8]) * ((arg2[3]) * (uint32_t)UINT8_C(0x13))); + uint64_t x17 = ((uint64_t)(arg1[8]) * ((arg2[2]) * (uint32_t)UINT8_C(0x13))); + uint64_t x18 = ((uint64_t)(arg1[7]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x19 = ((uint64_t)(arg1[7]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x20 = ((uint64_t)(arg1[7]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x21 = ((uint64_t)(arg1[7]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x22 = ((uint64_t)(arg1[7]) * ((arg2[5]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x23 = ((uint64_t)(arg1[7]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x24 = ((uint64_t)(arg1[7]) * ((arg2[3]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x25 = ((uint64_t)(arg1[6]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x26 = ((uint64_t)(arg1[6]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x27 = ((uint64_t)(arg1[6]) * ((arg2[7]) * (uint32_t)UINT8_C(0x13))); + uint64_t x28 = ((uint64_t)(arg1[6]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x29 = ((uint64_t)(arg1[6]) * ((arg2[5]) * (uint32_t)UINT8_C(0x13))); + uint64_t x30 = ((uint64_t)(arg1[6]) * ((arg2[4]) * (uint32_t)UINT8_C(0x13))); + uint64_t x31 = ((uint64_t)(arg1[5]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x32 = ((uint64_t)(arg1[5]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x33 = ((uint64_t)(arg1[5]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x34 = ((uint64_t)(arg1[5]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x35 = ((uint64_t)(arg1[5]) * ((arg2[5]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x36 = ((uint64_t)(arg1[4]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x37 = ((uint64_t)(arg1[4]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x38 = ((uint64_t)(arg1[4]) * ((arg2[7]) * (uint32_t)UINT8_C(0x13))); + uint64_t x39 = ((uint64_t)(arg1[4]) * ((arg2[6]) * (uint32_t)UINT8_C(0x13))); + uint64_t x40 = ((uint64_t)(arg1[3]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x41 = ((uint64_t)(arg1[3]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x42 = ((uint64_t)(arg1[3]) * ((arg2[7]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x43 = ((uint64_t)(arg1[2]) * ((arg2[9]) * (uint32_t)UINT8_C(0x13))); + uint64_t x44 = ((uint64_t)(arg1[2]) * ((arg2[8]) * (uint32_t)UINT8_C(0x13))); + uint64_t x45 = ((uint64_t)(arg1[1]) * ((arg2[9]) * ((uint32_t)0x2 * UINT8_C(0x13)))); + uint64_t x46 = ((uint64_t)(arg1[9]) * (arg2[0])); + uint64_t x47 = ((uint64_t)(arg1[8]) * (arg2[1])); + uint64_t x48 = ((uint64_t)(arg1[8]) * (arg2[0])); + uint64_t x49 = ((uint64_t)(arg1[7]) * (arg2[2])); + uint64_t x50 = ((uint64_t)(arg1[7]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x51 = ((uint64_t)(arg1[7]) * (arg2[0])); + uint64_t x52 = ((uint64_t)(arg1[6]) * (arg2[3])); + uint64_t x53 = ((uint64_t)(arg1[6]) * (arg2[2])); + uint64_t x54 = ((uint64_t)(arg1[6]) * (arg2[1])); + uint64_t x55 = ((uint64_t)(arg1[6]) * (arg2[0])); + uint64_t x56 = ((uint64_t)(arg1[5]) * (arg2[4])); + uint64_t x57 = ((uint64_t)(arg1[5]) * ((arg2[3]) * (uint32_t)0x2)); + uint64_t x58 = ((uint64_t)(arg1[5]) * (arg2[2])); + uint64_t x59 = ((uint64_t)(arg1[5]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x60 = ((uint64_t)(arg1[5]) * (arg2[0])); + uint64_t x61 = ((uint64_t)(arg1[4]) * (arg2[5])); + uint64_t x62 = ((uint64_t)(arg1[4]) * (arg2[4])); + uint64_t x63 = ((uint64_t)(arg1[4]) * (arg2[3])); + uint64_t x64 = ((uint64_t)(arg1[4]) * (arg2[2])); + uint64_t x65 = ((uint64_t)(arg1[4]) * (arg2[1])); + uint64_t x66 = ((uint64_t)(arg1[4]) * (arg2[0])); + uint64_t x67 = ((uint64_t)(arg1[3]) * (arg2[6])); + uint64_t x68 = ((uint64_t)(arg1[3]) * ((arg2[5]) * (uint32_t)0x2)); + uint64_t x69 = ((uint64_t)(arg1[3]) * (arg2[4])); + uint64_t x70 = ((uint64_t)(arg1[3]) * ((arg2[3]) * (uint32_t)0x2)); + uint64_t x71 = ((uint64_t)(arg1[3]) * (arg2[2])); + uint64_t x72 = ((uint64_t)(arg1[3]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x73 = ((uint64_t)(arg1[3]) * (arg2[0])); + uint64_t x74 = ((uint64_t)(arg1[2]) * (arg2[7])); + uint64_t x75 = ((uint64_t)(arg1[2]) * (arg2[6])); + uint64_t x76 = ((uint64_t)(arg1[2]) * (arg2[5])); + uint64_t x77 = ((uint64_t)(arg1[2]) * (arg2[4])); + uint64_t x78 = ((uint64_t)(arg1[2]) * (arg2[3])); + uint64_t x79 = ((uint64_t)(arg1[2]) * (arg2[2])); + uint64_t x80 = ((uint64_t)(arg1[2]) * (arg2[1])); + uint64_t x81 = ((uint64_t)(arg1[2]) * (arg2[0])); + uint64_t x82 = ((uint64_t)(arg1[1]) * (arg2[8])); + uint64_t x83 = ((uint64_t)(arg1[1]) * ((arg2[7]) * (uint32_t)0x2)); + uint64_t x84 = ((uint64_t)(arg1[1]) * (arg2[6])); + uint64_t x85 = ((uint64_t)(arg1[1]) * ((arg2[5]) * (uint32_t)0x2)); + uint64_t x86 = ((uint64_t)(arg1[1]) * (arg2[4])); + uint64_t x87 = ((uint64_t)(arg1[1]) * ((arg2[3]) * (uint32_t)0x2)); + uint64_t x88 = ((uint64_t)(arg1[1]) * (arg2[2])); + uint64_t x89 = ((uint64_t)(arg1[1]) * ((arg2[1]) * (uint32_t)0x2)); + uint64_t x90 = ((uint64_t)(arg1[1]) * (arg2[0])); + uint64_t x91 = ((uint64_t)(arg1[0]) * (arg2[9])); + uint64_t x92 = ((uint64_t)(arg1[0]) * (arg2[8])); + uint64_t x93 = ((uint64_t)(arg1[0]) * (arg2[7])); + uint64_t x94 = ((uint64_t)(arg1[0]) * (arg2[6])); + uint64_t x95 = ((uint64_t)(arg1[0]) * (arg2[5])); + uint64_t x96 = ((uint64_t)(arg1[0]) * (arg2[4])); + uint64_t x97 = ((uint64_t)(arg1[0]) * (arg2[3])); + uint64_t x98 = ((uint64_t)(arg1[0]) * (arg2[2])); + uint64_t x99 = ((uint64_t)(arg1[0]) * (arg2[1])); + uint64_t x100 = ((uint64_t)(arg1[0]) * (arg2[0])); + uint64_t x101 = (x100 + (x45 + (x44 + (x42 + (x39 + (x35 + (x30 + (x24 + (x17 + x9))))))))); + uint64_t x102 = (x101 >> 26); + uint32_t x103 = (uint32_t)(x101 & UINT32_C(0x3ffffff)); + uint64_t x104 = (x91 + (x82 + (x74 + (x67 + (x61 + (x56 + (x52 + (x49 + (x47 + x46))))))))); + uint64_t x105 = (x92 + (x83 + (x75 + (x68 + (x62 + (x57 + (x53 + (x50 + (x48 + x1))))))))); + uint64_t x106 = (x93 + (x84 + (x76 + (x69 + (x63 + (x58 + (x54 + (x51 + (x10 + x2))))))))); + uint64_t x107 = (x94 + (x85 + (x77 + (x70 + (x64 + (x59 + (x55 + (x18 + (x11 + x3))))))))); + uint64_t x108 = (x95 + (x86 + (x78 + (x71 + (x65 + (x60 + (x25 + (x19 + (x12 + x4))))))))); + uint64_t x109 = (x96 + (x87 + (x79 + (x72 + (x66 + (x31 + (x26 + (x20 + (x13 + x5))))))))); + uint64_t x110 = (x97 + (x88 + (x80 + (x73 + (x36 + (x32 + (x27 + (x21 + (x14 + x6))))))))); + uint64_t x111 = (x98 + (x89 + (x81 + (x40 + (x37 + (x33 + (x28 + (x22 + (x15 + x7))))))))); + uint64_t x112 = (x99 + (x90 + (x43 + (x41 + (x38 + (x34 + (x29 + (x23 + (x16 + x8))))))))); + uint64_t x113 = (x102 + x112); + uint64_t x114 = (x113 >> 25); + uint32_t x115 = (uint32_t)(x113 & UINT32_C(0x1ffffff)); + uint64_t x116 = (x114 + x111); + uint64_t x117 = (x116 >> 26); + uint32_t x118 = (uint32_t)(x116 & UINT32_C(0x3ffffff)); + uint64_t x119 = (x117 + x110); + uint64_t x120 = (x119 >> 25); + uint32_t x121 = (uint32_t)(x119 & UINT32_C(0x1ffffff)); + uint64_t x122 = (x120 + x109); + uint64_t x123 = (x122 >> 26); + uint32_t x124 = (uint32_t)(x122 & UINT32_C(0x3ffffff)); + uint64_t x125 = (x123 + x108); + uint64_t x126 = (x125 >> 25); + uint32_t x127 = (uint32_t)(x125 & UINT32_C(0x1ffffff)); + uint64_t x128 = (x126 + x107); + uint64_t x129 = (x128 >> 26); + uint32_t x130 = (uint32_t)(x128 & UINT32_C(0x3ffffff)); + uint64_t x131 = (x129 + x106); + uint64_t x132 = (x131 >> 25); + uint32_t x133 = (uint32_t)(x131 & UINT32_C(0x1ffffff)); + uint64_t x134 = (x132 + x105); + uint64_t x135 = (x134 >> 26); + uint32_t x136 = (uint32_t)(x134 & UINT32_C(0x3ffffff)); + uint64_t x137 = (x135 + x104); + uint64_t x138 = (x137 >> 25); + uint32_t x139 = (uint32_t)(x137 & UINT32_C(0x1ffffff)); + uint64_t x140 = (x138 * (uint64_t)UINT8_C(0x13)); + uint64_t x141 = (x103 + x140); + uint32_t x142 = (uint32_t)(x141 >> 26); + uint32_t x143 = (uint32_t)(x141 & UINT32_C(0x3ffffff)); + uint32_t x144 = (x142 + x115); + uint32_t x145 = (x144 >> 25); + uint32_t x146 = (x144 & UINT32_C(0x1ffffff)); + uint32_t x147 = (x145 + x118); + out1[0] = x143; + out1[1] = x146; + out1[2] = x147; + out1[3] = x121; + out1[4] = x124; + out1[5] = x127; + out1[6] = x130; + out1[7] = x133; + out1[8] = x136; + out1[9] = x139; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry_square(uint32_t out1[10], const uint32_t arg1[10]) { + uint32_t x1 = ((arg1[9]) * (uint32_t)UINT8_C(0x13)); + uint32_t x2 = (x1 * (uint32_t)0x2); + uint32_t x3 = ((arg1[9]) * (uint32_t)0x2); + uint32_t x4 = ((arg1[8]) * (uint32_t)UINT8_C(0x13)); + uint64_t x5 = (x4 * (uint64_t)0x2); + uint32_t x6 = ((arg1[8]) * (uint32_t)0x2); + uint32_t x7 = ((arg1[7]) * (uint32_t)UINT8_C(0x13)); + uint32_t x8 = (x7 * (uint32_t)0x2); + uint32_t x9 = ((arg1[7]) * (uint32_t)0x2); + uint32_t x10 = ((arg1[6]) * (uint32_t)UINT8_C(0x13)); + uint64_t x11 = (x10 * (uint64_t)0x2); + uint32_t x12 = ((arg1[6]) * (uint32_t)0x2); + uint32_t x13 = ((arg1[5]) * (uint32_t)UINT8_C(0x13)); + uint32_t x14 = ((arg1[5]) * (uint32_t)0x2); + uint32_t x15 = ((arg1[4]) * (uint32_t)0x2); + uint32_t x16 = ((arg1[3]) * (uint32_t)0x2); + uint32_t x17 = ((arg1[2]) * (uint32_t)0x2); + uint32_t x18 = ((arg1[1]) * (uint32_t)0x2); + uint64_t x19 = ((uint64_t)(arg1[9]) * (x1 * (uint32_t)0x2)); + uint64_t x20 = ((uint64_t)(arg1[8]) * x2); + uint64_t x21 = ((uint64_t)(arg1[8]) * x4); + uint64_t x22 = ((arg1[7]) * (x2 * (uint64_t)0x2)); + uint64_t x23 = ((arg1[7]) * x5); + uint64_t x24 = ((uint64_t)(arg1[7]) * (x7 * (uint32_t)0x2)); + uint64_t x25 = ((uint64_t)(arg1[6]) * x2); + uint64_t x26 = ((arg1[6]) * x5); + uint64_t x27 = ((uint64_t)(arg1[6]) * x8); + uint64_t x28 = ((uint64_t)(arg1[6]) * x10); + uint64_t x29 = ((arg1[5]) * (x2 * (uint64_t)0x2)); + uint64_t x30 = ((arg1[5]) * x5); + uint64_t x31 = ((arg1[5]) * (x8 * (uint64_t)0x2)); + uint64_t x32 = ((arg1[5]) * x11); + uint64_t x33 = ((uint64_t)(arg1[5]) * (x13 * (uint32_t)0x2)); + uint64_t x34 = ((uint64_t)(arg1[4]) * x2); + uint64_t x35 = ((arg1[4]) * x5); + uint64_t x36 = ((uint64_t)(arg1[4]) * x8); + uint64_t x37 = ((arg1[4]) * x11); + uint64_t x38 = ((uint64_t)(arg1[4]) * x14); + uint64_t x39 = ((uint64_t)(arg1[4]) * (arg1[4])); + uint64_t x40 = ((arg1[3]) * (x2 * (uint64_t)0x2)); + uint64_t x41 = ((arg1[3]) * x5); + uint64_t x42 = ((arg1[3]) * (x8 * (uint64_t)0x2)); + uint64_t x43 = ((uint64_t)(arg1[3]) * x12); + uint64_t x44 = ((uint64_t)(arg1[3]) * (x14 * (uint32_t)0x2)); + uint64_t x45 = ((uint64_t)(arg1[3]) * x15); + uint64_t x46 = ((uint64_t)(arg1[3]) * ((arg1[3]) * (uint32_t)0x2)); + uint64_t x47 = ((uint64_t)(arg1[2]) * x2); + uint64_t x48 = ((arg1[2]) * x5); + uint64_t x49 = ((uint64_t)(arg1[2]) * x9); + uint64_t x50 = ((uint64_t)(arg1[2]) * x12); + uint64_t x51 = ((uint64_t)(arg1[2]) * x14); + uint64_t x52 = ((uint64_t)(arg1[2]) * x15); + uint64_t x53 = ((uint64_t)(arg1[2]) * x16); + uint64_t x54 = ((uint64_t)(arg1[2]) * (arg1[2])); + uint64_t x55 = ((arg1[1]) * (x2 * (uint64_t)0x2)); + uint64_t x56 = ((uint64_t)(arg1[1]) * x6); + uint64_t x57 = ((uint64_t)(arg1[1]) * (x9 * (uint32_t)0x2)); + uint64_t x58 = ((uint64_t)(arg1[1]) * x12); + uint64_t x59 = ((uint64_t)(arg1[1]) * (x14 * (uint32_t)0x2)); + uint64_t x60 = ((uint64_t)(arg1[1]) * x15); + uint64_t x61 = ((uint64_t)(arg1[1]) * (x16 * (uint32_t)0x2)); + uint64_t x62 = ((uint64_t)(arg1[1]) * x17); + uint64_t x63 = ((uint64_t)(arg1[1]) * ((arg1[1]) * (uint32_t)0x2)); + uint64_t x64 = ((uint64_t)(arg1[0]) * x3); + uint64_t x65 = ((uint64_t)(arg1[0]) * x6); + uint64_t x66 = ((uint64_t)(arg1[0]) * x9); + uint64_t x67 = ((uint64_t)(arg1[0]) * x12); + uint64_t x68 = ((uint64_t)(arg1[0]) * x14); + uint64_t x69 = ((uint64_t)(arg1[0]) * x15); + uint64_t x70 = ((uint64_t)(arg1[0]) * x16); + uint64_t x71 = ((uint64_t)(arg1[0]) * x17); + uint64_t x72 = ((uint64_t)(arg1[0]) * x18); + uint64_t x73 = ((uint64_t)(arg1[0]) * (arg1[0])); + uint64_t x74 = (x73 + (x55 + (x48 + (x42 + (x37 + x33))))); + uint64_t x75 = (x74 >> 26); + uint32_t x76 = (uint32_t)(x74 & UINT32_C(0x3ffffff)); + uint64_t x77 = (x64 + (x56 + (x49 + (x43 + x38)))); + uint64_t x78 = (x65 + (x57 + (x50 + (x44 + (x39 + x19))))); + uint64_t x79 = (x66 + (x58 + (x51 + (x45 + x20)))); + uint64_t x80 = (x67 + (x59 + (x52 + (x46 + (x22 + x21))))); + uint64_t x81 = (x68 + (x60 + (x53 + (x25 + x23)))); + uint64_t x82 = (x69 + (x61 + (x54 + (x29 + (x26 + x24))))); + uint64_t x83 = (x70 + (x62 + (x34 + (x30 + x27)))); + uint64_t x84 = (x71 + (x63 + (x40 + (x35 + (x31 + x28))))); + uint64_t x85 = (x72 + (x47 + (x41 + (x36 + x32)))); + uint64_t x86 = (x75 + x85); + uint64_t x87 = (x86 >> 25); + uint32_t x88 = (uint32_t)(x86 & UINT32_C(0x1ffffff)); + uint64_t x89 = (x87 + x84); + uint64_t x90 = (x89 >> 26); + uint32_t x91 = (uint32_t)(x89 & UINT32_C(0x3ffffff)); + uint64_t x92 = (x90 + x83); + uint64_t x93 = (x92 >> 25); + uint32_t x94 = (uint32_t)(x92 & UINT32_C(0x1ffffff)); + uint64_t x95 = (x93 + x82); + uint64_t x96 = (x95 >> 26); + uint32_t x97 = (uint32_t)(x95 & UINT32_C(0x3ffffff)); + uint64_t x98 = (x96 + x81); + uint64_t x99 = (x98 >> 25); + uint32_t x100 = (uint32_t)(x98 & UINT32_C(0x1ffffff)); + uint64_t x101 = (x99 + x80); + uint64_t x102 = (x101 >> 26); + uint32_t x103 = (uint32_t)(x101 & UINT32_C(0x3ffffff)); + uint64_t x104 = (x102 + x79); + uint64_t x105 = (x104 >> 25); + uint32_t x106 = (uint32_t)(x104 & UINT32_C(0x1ffffff)); + uint64_t x107 = (x105 + x78); + uint64_t x108 = (x107 >> 26); + uint32_t x109 = (uint32_t)(x107 & UINT32_C(0x3ffffff)); + uint64_t x110 = (x108 + x77); + uint64_t x111 = (x110 >> 25); + uint32_t x112 = (uint32_t)(x110 & UINT32_C(0x1ffffff)); + uint64_t x113 = (x111 * (uint64_t)UINT8_C(0x13)); + uint64_t x114 = (x76 + x113); + uint32_t x115 = (uint32_t)(x114 >> 26); + uint32_t x116 = (uint32_t)(x114 & UINT32_C(0x3ffffff)); + uint32_t x117 = (x115 + x88); + uint32_t x118 = (x117 >> 25); + uint32_t x119 = (x117 & UINT32_C(0x1ffffff)); + uint32_t x120 = (x118 + x91); + out1[0] = x116; + out1[1] = x119; + out1[2] = x120; + out1[3] = x94; + out1[4] = x97; + out1[5] = x100; + out1[6] = x103; + out1[7] = x106; + out1[8] = x109; + out1[9] = x112; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry_scmul_121666(uint32_t out1[10], const uint32_t arg1[10]) { + uint64_t x1 = ((uint64_t)UINT32_C(0x1db42) * (arg1[9])); + uint64_t x2 = ((uint64_t)UINT32_C(0x1db42) * (arg1[8])); + uint64_t x3 = ((uint64_t)UINT32_C(0x1db42) * (arg1[7])); + uint64_t x4 = ((uint64_t)UINT32_C(0x1db42) * (arg1[6])); + uint64_t x5 = ((uint64_t)UINT32_C(0x1db42) * (arg1[5])); + uint64_t x6 = ((uint64_t)UINT32_C(0x1db42) * (arg1[4])); + uint64_t x7 = ((uint64_t)UINT32_C(0x1db42) * (arg1[3])); + uint64_t x8 = ((uint64_t)UINT32_C(0x1db42) * (arg1[2])); + uint64_t x9 = ((uint64_t)UINT32_C(0x1db42) * (arg1[1])); + uint64_t x10 = ((uint64_t)UINT32_C(0x1db42) * (arg1[0])); + uint32_t x11 = (uint32_t)(x10 >> 26); + uint32_t x12 = (uint32_t)(x10 & UINT32_C(0x3ffffff)); + uint64_t x13 = (x11 + x9); + uint32_t x14 = (uint32_t)(x13 >> 25); + uint32_t x15 = (uint32_t)(x13 & UINT32_C(0x1ffffff)); + uint64_t x16 = (x14 + x8); + uint32_t x17 = (uint32_t)(x16 >> 26); + uint32_t x18 = (uint32_t)(x16 & UINT32_C(0x3ffffff)); + uint64_t x19 = (x17 + x7); + uint32_t x20 = (uint32_t)(x19 >> 25); + uint32_t x21 = (uint32_t)(x19 & UINT32_C(0x1ffffff)); + uint64_t x22 = (x20 + x6); + uint32_t x23 = (uint32_t)(x22 >> 26); + uint32_t x24 = (uint32_t)(x22 & UINT32_C(0x3ffffff)); + uint64_t x25 = (x23 + x5); + uint32_t x26 = (uint32_t)(x25 >> 25); + uint32_t x27 = (uint32_t)(x25 & UINT32_C(0x1ffffff)); + uint64_t x28 = (x26 + x4); + uint32_t x29 = (uint32_t)(x28 >> 26); + uint32_t x30 = (uint32_t)(x28 & UINT32_C(0x3ffffff)); + uint64_t x31 = (x29 + x3); + uint32_t x32 = (uint32_t)(x31 >> 25); + uint32_t x33 = (uint32_t)(x31 & UINT32_C(0x1ffffff)); + uint64_t x34 = (x32 + x2); + uint32_t x35 = (uint32_t)(x34 >> 26); + uint32_t x36 = (uint32_t)(x34 & UINT32_C(0x3ffffff)); + uint64_t x37 = (x35 + x1); + uint32_t x38 = (uint32_t)(x37 >> 25); + uint32_t x39 = (uint32_t)(x37 & UINT32_C(0x1ffffff)); + uint32_t x40 = (x38 * (uint32_t)UINT8_C(0x13)); + uint32_t x41 = (x12 + x40); + uint32_t x42 = (x41 >> 26); + uint32_t x43 = (x41 & UINT32_C(0x3ffffff)); + uint32_t x44 = (x42 + x15); + uint32_t x45 = (x44 >> 25); + uint32_t x46 = (x44 & UINT32_C(0x1ffffff)); + uint32_t x47 = (x45 + x18); + out1[0] = x43; + out1[1] = x46; + out1[2] = x47; + out1[3] = x21; + out1[4] = x24; + out1[5] = x27; + out1[6] = x30; + out1[7] = x33; + out1[8] = x36; + out1[9] = x39; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_carry(uint32_t out1[10], const uint32_t arg1[10]) { + uint32_t x1 = (arg1[0]); + uint32_t x2 = ((x1 >> 26) + (arg1[1])); + uint32_t x3 = ((x2 >> 25) + (arg1[2])); + uint32_t x4 = ((x3 >> 26) + (arg1[3])); + uint32_t x5 = ((x4 >> 25) + (arg1[4])); + uint32_t x6 = ((x5 >> 26) + (arg1[5])); + uint32_t x7 = ((x6 >> 25) + (arg1[6])); + uint32_t x8 = ((x7 >> 26) + (arg1[7])); + uint32_t x9 = ((x8 >> 25) + (arg1[8])); + uint32_t x10 = ((x9 >> 26) + (arg1[9])); + uint32_t x11 = ((x1 & UINT32_C(0x3ffffff)) + ((x10 >> 25) * (uint32_t)UINT8_C(0x13))); + uint32_t x12 = ((x11 >> 26) + (x2 & UINT32_C(0x1ffffff))); + uint32_t x13 = (x11 & UINT32_C(0x3ffffff)); + uint32_t x14 = (x12 & UINT32_C(0x1ffffff)); + uint32_t x15 = ((x12 >> 25) + (x3 & UINT32_C(0x3ffffff))); + uint32_t x16 = (x4 & UINT32_C(0x1ffffff)); + uint32_t x17 = (x5 & UINT32_C(0x3ffffff)); + uint32_t x18 = (x6 & UINT32_C(0x1ffffff)); + uint32_t x19 = (x7 & UINT32_C(0x3ffffff)); + uint32_t x20 = (x8 & UINT32_C(0x1ffffff)); + uint32_t x21 = (x9 & UINT32_C(0x3ffffff)); + uint32_t x22 = (x10 & UINT32_C(0x1ffffff)); + out1[0] = x13; + out1[1] = x14; + out1[2] = x15; + out1[3] = x16; + out1[4] = x17; + out1[5] = x18; + out1[6] = x19; + out1[7] = x20; + out1[8] = x21; + out1[9] = x22; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * arg2: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + */ +static void fiat_25519_add(uint32_t out1[10], const uint32_t arg1[10], const uint32_t arg2[10]) { + uint32_t x1 = ((arg1[0]) + (arg2[0])); + uint32_t x2 = ((arg1[1]) + (arg2[1])); + uint32_t x3 = ((arg1[2]) + (arg2[2])); + uint32_t x4 = ((arg1[3]) + (arg2[3])); + uint32_t x5 = ((arg1[4]) + (arg2[4])); + uint32_t x6 = ((arg1[5]) + (arg2[5])); + uint32_t x7 = ((arg1[6]) + (arg2[6])); + uint32_t x8 = ((arg1[7]) + (arg2[7])); + uint32_t x9 = ((arg1[8]) + (arg2[8])); + uint32_t x10 = ((arg1[9]) + (arg2[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * arg2: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + */ +static void fiat_25519_sub(uint32_t out1[10], const uint32_t arg1[10], const uint32_t arg2[10]) { + uint32_t x1 = ((UINT32_C(0x7ffffda) + (arg1[0])) - (arg2[0])); + uint32_t x2 = ((UINT32_C(0x3fffffe) + (arg1[1])) - (arg2[1])); + uint32_t x3 = ((UINT32_C(0x7fffffe) + (arg1[2])) - (arg2[2])); + uint32_t x4 = ((UINT32_C(0x3fffffe) + (arg1[3])) - (arg2[3])); + uint32_t x5 = ((UINT32_C(0x7fffffe) + (arg1[4])) - (arg2[4])); + uint32_t x6 = ((UINT32_C(0x3fffffe) + (arg1[5])) - (arg2[5])); + uint32_t x7 = ((UINT32_C(0x7fffffe) + (arg1[6])) - (arg2[6])); + uint32_t x8 = ((UINT32_C(0x3fffffe) + (arg1[7])) - (arg2[7])); + uint32_t x9 = ((UINT32_C(0x7fffffe) + (arg1[8])) - (arg2[8])); + uint32_t x10 = ((UINT32_C(0x3fffffe) + (arg1[9])) - (arg2[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999], [0x0 ~> 0xd333332], [0x0 ~> 0x6999999]] + */ +static void fiat_25519_opp(uint32_t out1[10], const uint32_t arg1[10]) { + uint32_t x1 = (UINT32_C(0x7ffffda) - (arg1[0])); + uint32_t x2 = (UINT32_C(0x3fffffe) - (arg1[1])); + uint32_t x3 = (UINT32_C(0x7fffffe) - (arg1[2])); + uint32_t x4 = (UINT32_C(0x3fffffe) - (arg1[3])); + uint32_t x5 = (UINT32_C(0x7fffffe) - (arg1[4])); + uint32_t x6 = (UINT32_C(0x3fffffe) - (arg1[5])); + uint32_t x7 = (UINT32_C(0x7fffffe) - (arg1[6])); + uint32_t x8 = (UINT32_C(0x3fffffe) - (arg1[7])); + uint32_t x9 = (UINT32_C(0x7fffffe) - (arg1[8])); + uint32_t x10 = (UINT32_C(0x3fffffe) - (arg1[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_25519_selectznz(uint32_t out1[10], fiat_25519_uint1 arg1, const uint32_t arg2[10], const uint32_t arg3[10]) { + uint32_t x1; + fiat_25519_cmovznz_u32(&x1, arg1, (arg2[0]), (arg3[0])); + uint32_t x2; + fiat_25519_cmovznz_u32(&x2, arg1, (arg2[1]), (arg3[1])); + uint32_t x3; + fiat_25519_cmovznz_u32(&x3, arg1, (arg2[2]), (arg3[2])); + uint32_t x4; + fiat_25519_cmovznz_u32(&x4, arg1, (arg2[3]), (arg3[3])); + uint32_t x5; + fiat_25519_cmovznz_u32(&x5, arg1, (arg2[4]), (arg3[4])); + uint32_t x6; + fiat_25519_cmovznz_u32(&x6, arg1, (arg2[5]), (arg3[5])); + uint32_t x7; + fiat_25519_cmovznz_u32(&x7, arg1, (arg2[6]), (arg3[6])); + uint32_t x8; + fiat_25519_cmovznz_u32(&x8, arg1, (arg2[7]), (arg3[7])); + uint32_t x9; + fiat_25519_cmovznz_u32(&x9, arg1, (arg2[8]), (arg3[8])); + uint32_t x10; + fiat_25519_cmovznz_u32(&x10, arg1, (arg2[9]), (arg3[9])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; + out1[8] = x9; + out1[9] = x10; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + */ +static void fiat_25519_to_bytes(uint8_t out1[32], const uint32_t arg1[10]) { + uint32_t x1; + fiat_25519_uint1 x2; + fiat_25519_subborrowx_u26(&x1, &x2, 0x0, (arg1[0]), UINT32_C(0x3ffffed)); + uint32_t x3; + fiat_25519_uint1 x4; + fiat_25519_subborrowx_u25(&x3, &x4, x2, (arg1[1]), UINT32_C(0x1ffffff)); + uint32_t x5; + fiat_25519_uint1 x6; + fiat_25519_subborrowx_u26(&x5, &x6, x4, (arg1[2]), UINT32_C(0x3ffffff)); + uint32_t x7; + fiat_25519_uint1 x8; + fiat_25519_subborrowx_u25(&x7, &x8, x6, (arg1[3]), UINT32_C(0x1ffffff)); + uint32_t x9; + fiat_25519_uint1 x10; + fiat_25519_subborrowx_u26(&x9, &x10, x8, (arg1[4]), UINT32_C(0x3ffffff)); + uint32_t x11; + fiat_25519_uint1 x12; + fiat_25519_subborrowx_u25(&x11, &x12, x10, (arg1[5]), UINT32_C(0x1ffffff)); + uint32_t x13; + fiat_25519_uint1 x14; + fiat_25519_subborrowx_u26(&x13, &x14, x12, (arg1[6]), UINT32_C(0x3ffffff)); + uint32_t x15; + fiat_25519_uint1 x16; + fiat_25519_subborrowx_u25(&x15, &x16, x14, (arg1[7]), UINT32_C(0x1ffffff)); + uint32_t x17; + fiat_25519_uint1 x18; + fiat_25519_subborrowx_u26(&x17, &x18, x16, (arg1[8]), UINT32_C(0x3ffffff)); + uint32_t x19; + fiat_25519_uint1 x20; + fiat_25519_subborrowx_u25(&x19, &x20, x18, (arg1[9]), UINT32_C(0x1ffffff)); + uint32_t x21; + fiat_25519_cmovznz_u32(&x21, x20, 0x0, UINT32_C(0xffffffff)); + uint32_t x22; + fiat_25519_uint1 x23; + fiat_25519_addcarryx_u26(&x22, &x23, 0x0, (x21 & UINT32_C(0x3ffffed)), x1); + uint32_t x24; + fiat_25519_uint1 x25; + fiat_25519_addcarryx_u25(&x24, &x25, x23, (x21 & UINT32_C(0x1ffffff)), x3); + uint32_t x26; + fiat_25519_uint1 x27; + fiat_25519_addcarryx_u26(&x26, &x27, x25, (x21 & UINT32_C(0x3ffffff)), x5); + uint32_t x28; + fiat_25519_uint1 x29; + fiat_25519_addcarryx_u25(&x28, &x29, x27, (x21 & UINT32_C(0x1ffffff)), x7); + uint32_t x30; + fiat_25519_uint1 x31; + fiat_25519_addcarryx_u26(&x30, &x31, x29, (x21 & UINT32_C(0x3ffffff)), x9); + uint32_t x32; + fiat_25519_uint1 x33; + fiat_25519_addcarryx_u25(&x32, &x33, x31, (x21 & UINT32_C(0x1ffffff)), x11); + uint32_t x34; + fiat_25519_uint1 x35; + fiat_25519_addcarryx_u26(&x34, &x35, x33, (x21 & UINT32_C(0x3ffffff)), x13); + uint32_t x36; + fiat_25519_uint1 x37; + fiat_25519_addcarryx_u25(&x36, &x37, x35, (x21 & UINT32_C(0x1ffffff)), x15); + uint32_t x38; + fiat_25519_uint1 x39; + fiat_25519_addcarryx_u26(&x38, &x39, x37, (x21 & UINT32_C(0x3ffffff)), x17); + uint32_t x40; + fiat_25519_uint1 x41; + fiat_25519_addcarryx_u25(&x40, &x41, x39, (x21 & UINT32_C(0x1ffffff)), x19); + uint32_t x42 = (x40 << 6); + uint32_t x43 = (x38 << 4); + uint32_t x44 = (x36 << 3); + uint32_t x45 = (x34 * (uint32_t)0x2); + uint32_t x46 = (x30 << 6); + uint32_t x47 = (x28 << 5); + uint32_t x48 = (x26 << 3); + uint32_t x49 = (x24 << 2); + uint32_t x50 = (x22 >> 8); + uint8_t x51 = (uint8_t)(x22 & UINT8_C(0xff)); + uint32_t x52 = (x50 >> 8); + uint8_t x53 = (uint8_t)(x50 & UINT8_C(0xff)); + uint8_t x54 = (uint8_t)(x52 >> 8); + uint8_t x55 = (uint8_t)(x52 & UINT8_C(0xff)); + uint32_t x56 = (x54 + x49); + uint32_t x57 = (x56 >> 8); + uint8_t x58 = (uint8_t)(x56 & UINT8_C(0xff)); + uint32_t x59 = (x57 >> 8); + uint8_t x60 = (uint8_t)(x57 & UINT8_C(0xff)); + uint8_t x61 = (uint8_t)(x59 >> 8); + uint8_t x62 = (uint8_t)(x59 & UINT8_C(0xff)); + uint32_t x63 = (x61 + x48); + uint32_t x64 = (x63 >> 8); + uint8_t x65 = (uint8_t)(x63 & UINT8_C(0xff)); + uint32_t x66 = (x64 >> 8); + uint8_t x67 = (uint8_t)(x64 & UINT8_C(0xff)); + uint8_t x68 = (uint8_t)(x66 >> 8); + uint8_t x69 = (uint8_t)(x66 & UINT8_C(0xff)); + uint32_t x70 = (x68 + x47); + uint32_t x71 = (x70 >> 8); + uint8_t x72 = (uint8_t)(x70 & UINT8_C(0xff)); + uint32_t x73 = (x71 >> 8); + uint8_t x74 = (uint8_t)(x71 & UINT8_C(0xff)); + uint8_t x75 = (uint8_t)(x73 >> 8); + uint8_t x76 = (uint8_t)(x73 & UINT8_C(0xff)); + uint32_t x77 = (x75 + x46); + uint32_t x78 = (x77 >> 8); + uint8_t x79 = (uint8_t)(x77 & UINT8_C(0xff)); + uint32_t x80 = (x78 >> 8); + uint8_t x81 = (uint8_t)(x78 & UINT8_C(0xff)); + uint8_t x82 = (uint8_t)(x80 >> 8); + uint8_t x83 = (uint8_t)(x80 & UINT8_C(0xff)); + uint8_t x84 = (uint8_t)(x82 & UINT8_C(0xff)); + uint32_t x85 = (x32 >> 8); + uint8_t x86 = (uint8_t)(x32 & UINT8_C(0xff)); + uint32_t x87 = (x85 >> 8); + uint8_t x88 = (uint8_t)(x85 & UINT8_C(0xff)); + fiat_25519_uint1 x89 = (fiat_25519_uint1)(x87 >> 8); + uint8_t x90 = (uint8_t)(x87 & UINT8_C(0xff)); + uint32_t x91 = (x89 + x45); + uint32_t x92 = (x91 >> 8); + uint8_t x93 = (uint8_t)(x91 & UINT8_C(0xff)); + uint32_t x94 = (x92 >> 8); + uint8_t x95 = (uint8_t)(x92 & UINT8_C(0xff)); + uint8_t x96 = (uint8_t)(x94 >> 8); + uint8_t x97 = (uint8_t)(x94 & UINT8_C(0xff)); + uint32_t x98 = (x96 + x44); + uint32_t x99 = (x98 >> 8); + uint8_t x100 = (uint8_t)(x98 & UINT8_C(0xff)); + uint32_t x101 = (x99 >> 8); + uint8_t x102 = (uint8_t)(x99 & UINT8_C(0xff)); + uint8_t x103 = (uint8_t)(x101 >> 8); + uint8_t x104 = (uint8_t)(x101 & UINT8_C(0xff)); + uint32_t x105 = (x103 + x43); + uint32_t x106 = (x105 >> 8); + uint8_t x107 = (uint8_t)(x105 & UINT8_C(0xff)); + uint32_t x108 = (x106 >> 8); + uint8_t x109 = (uint8_t)(x106 & UINT8_C(0xff)); + uint8_t x110 = (uint8_t)(x108 >> 8); + uint8_t x111 = (uint8_t)(x108 & UINT8_C(0xff)); + uint32_t x112 = (x110 + x42); + uint32_t x113 = (x112 >> 8); + uint8_t x114 = (uint8_t)(x112 & UINT8_C(0xff)); + uint32_t x115 = (x113 >> 8); + uint8_t x116 = (uint8_t)(x113 & UINT8_C(0xff)); + uint8_t x117 = (uint8_t)(x115 >> 8); + uint8_t x118 = (uint8_t)(x115 & UINT8_C(0xff)); + out1[0] = x51; + out1[1] = x53; + out1[2] = x55; + out1[3] = x58; + out1[4] = x60; + out1[5] = x62; + out1[6] = x65; + out1[7] = x67; + out1[8] = x69; + out1[9] = x72; + out1[10] = x74; + out1[11] = x76; + out1[12] = x79; + out1[13] = x81; + out1[14] = x83; + out1[15] = x84; + out1[16] = x86; + out1[17] = x88; + out1[18] = x90; + out1[19] = x93; + out1[20] = x95; + out1[21] = x97; + out1[22] = x100; + out1[23] = x102; + out1[24] = x104; + out1[25] = x107; + out1[26] = x109; + out1[27] = x111; + out1[28] = x114; + out1[29] = x116; + out1[30] = x118; + out1[31] = x117; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + * Output Bounds: + * out1: [[0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333], [0x0 ~> 0x4666666], [0x0 ~> 0x2333333]] + */ +static void fiat_25519_from_bytes(uint32_t out1[10], const uint8_t arg1[32]) { + uint32_t x1 = ((uint32_t)(arg1[31]) << 18); + uint32_t x2 = ((uint32_t)(arg1[30]) << 10); + uint32_t x3 = ((uint32_t)(arg1[29]) << 2); + uint32_t x4 = ((uint32_t)(arg1[28]) << 20); + uint32_t x5 = ((uint32_t)(arg1[27]) << 12); + uint32_t x6 = ((uint32_t)(arg1[26]) << 4); + uint32_t x7 = ((uint32_t)(arg1[25]) << 21); + uint32_t x8 = ((uint32_t)(arg1[24]) << 13); + uint32_t x9 = ((uint32_t)(arg1[23]) << 5); + uint32_t x10 = ((uint32_t)(arg1[22]) << 23); + uint32_t x11 = ((uint32_t)(arg1[21]) << 15); + uint32_t x12 = ((uint32_t)(arg1[20]) << 7); + uint32_t x13 = ((uint32_t)(arg1[19]) << 24); + uint32_t x14 = ((uint32_t)(arg1[18]) << 16); + uint32_t x15 = ((uint32_t)(arg1[17]) << 8); + uint8_t x16 = (arg1[16]); + uint32_t x17 = ((uint32_t)(arg1[15]) << 18); + uint32_t x18 = ((uint32_t)(arg1[14]) << 10); + uint32_t x19 = ((uint32_t)(arg1[13]) << 2); + uint32_t x20 = ((uint32_t)(arg1[12]) << 19); + uint32_t x21 = ((uint32_t)(arg1[11]) << 11); + uint32_t x22 = ((uint32_t)(arg1[10]) << 3); + uint32_t x23 = ((uint32_t)(arg1[9]) << 21); + uint32_t x24 = ((uint32_t)(arg1[8]) << 13); + uint32_t x25 = ((uint32_t)(arg1[7]) << 5); + uint32_t x26 = ((uint32_t)(arg1[6]) << 22); + uint32_t x27 = ((uint32_t)(arg1[5]) << 14); + uint32_t x28 = ((uint32_t)(arg1[4]) << 6); + uint32_t x29 = ((uint32_t)(arg1[3]) << 24); + uint32_t x30 = ((uint32_t)(arg1[2]) << 16); + uint32_t x31 = ((uint32_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint32_t x33 = (x32 + (x31 + (x30 + x29))); + uint8_t x34 = (uint8_t)(x33 >> 26); + uint32_t x35 = (x33 & UINT32_C(0x3ffffff)); + uint32_t x36 = (x3 + (x2 + x1)); + uint32_t x37 = (x6 + (x5 + x4)); + uint32_t x38 = (x9 + (x8 + x7)); + uint32_t x39 = (x12 + (x11 + x10)); + uint32_t x40 = (x16 + (x15 + (x14 + x13))); + uint32_t x41 = (x19 + (x18 + x17)); + uint32_t x42 = (x22 + (x21 + x20)); + uint32_t x43 = (x25 + (x24 + x23)); + uint32_t x44 = (x28 + (x27 + x26)); + uint32_t x45 = (x34 + x44); + uint8_t x46 = (uint8_t)(x45 >> 25); + uint32_t x47 = (x45 & UINT32_C(0x1ffffff)); + uint32_t x48 = (x46 + x43); + uint8_t x49 = (uint8_t)(x48 >> 26); + uint32_t x50 = (x48 & UINT32_C(0x3ffffff)); + uint32_t x51 = (x49 + x42); + uint8_t x52 = (uint8_t)(x51 >> 25); + uint32_t x53 = (x51 & UINT32_C(0x1ffffff)); + uint32_t x54 = (x52 + x41); + uint32_t x55 = (x54 & UINT32_C(0x3ffffff)); + uint8_t x56 = (uint8_t)(x40 >> 25); + uint32_t x57 = (x40 & UINT32_C(0x1ffffff)); + uint32_t x58 = (x56 + x39); + uint8_t x59 = (uint8_t)(x58 >> 26); + uint32_t x60 = (x58 & UINT32_C(0x3ffffff)); + uint32_t x61 = (x59 + x38); + uint8_t x62 = (uint8_t)(x61 >> 25); + uint32_t x63 = (x61 & UINT32_C(0x1ffffff)); + uint32_t x64 = (x62 + x37); + uint8_t x65 = (uint8_t)(x64 >> 26); + uint32_t x66 = (x64 & UINT32_C(0x3ffffff)); + uint32_t x67 = (x65 + x36); + out1[0] = x35; + out1[1] = x47; + out1[2] = x50; + out1[3] = x53; + out1[4] = x55; + out1[5] = x57; + out1[6] = x60; + out1[7] = x63; + out1[8] = x66; + out1[9] = x67; +} + diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h new file mode 100644 index 000000000..7c31ff99c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h @@ -0,0 +1,559 @@ +/* Autogenerated */ +/* curve description: 25519 */ +/* requested operations: carry_mul, carry_square, carry_scmul121666, carry, add, sub, opp, selectznz, to_bytes, from_bytes */ +/* n = 5 (from "5") */ +/* s = 0x8000000000000000000000000000000000000000000000000000000000000000 (from "2^255") */ +/* c = [(1, 19)] (from "1,19") */ +/* machine_wordsize = 64 (from "64") */ + +#include +typedef unsigned char fiat_25519_uint1; +typedef signed char fiat_25519_int1; +typedef signed __int128 fiat_25519_int128; +typedef unsigned __int128 fiat_25519_uint128; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x7ffffffffffff] + * arg3: [0x0 ~> 0x7ffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0x7ffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_addcarryx_u51(uint64_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint64_t arg2, uint64_t arg3) { + uint64_t x1 = ((arg1 + arg2) + arg3); + uint64_t x2 = (x1 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint1 x3 = (fiat_25519_uint1)(x1 >> 51); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x7ffffffffffff] + * arg3: [0x0 ~> 0x7ffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0x7ffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_subborrowx_u51(uint64_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint64_t arg2, uint64_t arg3) { + int64_t x1 = ((int64_t)(arg2 - (int64_t)arg1) - (int64_t)arg3); + fiat_25519_int1 x2 = (fiat_25519_int1)(x1 >> 51); + uint64_t x3 = (x1 & UINT64_C(0x7ffffffffffff)); + *out1 = x3; + *out2 = (fiat_25519_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_25519_cmovznz_u64(uint64_t* out1, fiat_25519_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_25519_uint1 x1 = (!(!arg1)); + uint64_t x2 = ((fiat_25519_int1)(0x0 - x1) & UINT64_C(0xffffffffffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint64_t x3 = ((value_barrier_u64(x2) & arg3) | (value_barrier_u64(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * arg2: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry_mul(uint64_t out1[5], const uint64_t arg1[5], const uint64_t arg2[5]) { + fiat_25519_uint128 x1 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x2 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[3]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x3 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[2]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x4 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[1]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x5 = ((fiat_25519_uint128)(arg1[3]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x6 = ((fiat_25519_uint128)(arg1[3]) * ((arg2[3]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x7 = ((fiat_25519_uint128)(arg1[3]) * ((arg2[2]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x8 = ((fiat_25519_uint128)(arg1[2]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x9 = ((fiat_25519_uint128)(arg1[2]) * ((arg2[3]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x10 = ((fiat_25519_uint128)(arg1[1]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x11 = ((fiat_25519_uint128)(arg1[4]) * (arg2[0])); + fiat_25519_uint128 x12 = ((fiat_25519_uint128)(arg1[3]) * (arg2[1])); + fiat_25519_uint128 x13 = ((fiat_25519_uint128)(arg1[3]) * (arg2[0])); + fiat_25519_uint128 x14 = ((fiat_25519_uint128)(arg1[2]) * (arg2[2])); + fiat_25519_uint128 x15 = ((fiat_25519_uint128)(arg1[2]) * (arg2[1])); + fiat_25519_uint128 x16 = ((fiat_25519_uint128)(arg1[2]) * (arg2[0])); + fiat_25519_uint128 x17 = ((fiat_25519_uint128)(arg1[1]) * (arg2[3])); + fiat_25519_uint128 x18 = ((fiat_25519_uint128)(arg1[1]) * (arg2[2])); + fiat_25519_uint128 x19 = ((fiat_25519_uint128)(arg1[1]) * (arg2[1])); + fiat_25519_uint128 x20 = ((fiat_25519_uint128)(arg1[1]) * (arg2[0])); + fiat_25519_uint128 x21 = ((fiat_25519_uint128)(arg1[0]) * (arg2[4])); + fiat_25519_uint128 x22 = ((fiat_25519_uint128)(arg1[0]) * (arg2[3])); + fiat_25519_uint128 x23 = ((fiat_25519_uint128)(arg1[0]) * (arg2[2])); + fiat_25519_uint128 x24 = ((fiat_25519_uint128)(arg1[0]) * (arg2[1])); + fiat_25519_uint128 x25 = ((fiat_25519_uint128)(arg1[0]) * (arg2[0])); + fiat_25519_uint128 x26 = (x25 + (x10 + (x9 + (x7 + x4)))); + uint64_t x27 = (uint64_t)(x26 >> 51); + uint64_t x28 = (uint64_t)(x26 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x29 = (x21 + (x17 + (x14 + (x12 + x11)))); + fiat_25519_uint128 x30 = (x22 + (x18 + (x15 + (x13 + x1)))); + fiat_25519_uint128 x31 = (x23 + (x19 + (x16 + (x5 + x2)))); + fiat_25519_uint128 x32 = (x24 + (x20 + (x8 + (x6 + x3)))); + fiat_25519_uint128 x33 = (x27 + x32); + uint64_t x34 = (uint64_t)(x33 >> 51); + uint64_t x35 = (uint64_t)(x33 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x36 = (x34 + x31); + uint64_t x37 = (uint64_t)(x36 >> 51); + uint64_t x38 = (uint64_t)(x36 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x39 = (x37 + x30); + uint64_t x40 = (uint64_t)(x39 >> 51); + uint64_t x41 = (uint64_t)(x39 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x42 = (x40 + x29); + uint64_t x43 = (uint64_t)(x42 >> 51); + uint64_t x44 = (uint64_t)(x42 & UINT64_C(0x7ffffffffffff)); + uint64_t x45 = (x43 * (uint64_t)UINT8_C(0x13)); + uint64_t x46 = (x28 + x45); + uint64_t x47 = (x46 >> 51); + uint64_t x48 = (x46 & UINT64_C(0x7ffffffffffff)); + uint64_t x49 = (x47 + x35); + uint64_t x50 = (x49 >> 51); + uint64_t x51 = (x49 & UINT64_C(0x7ffffffffffff)); + uint64_t x52 = (x50 + x38); + out1[0] = x48; + out1[1] = x51; + out1[2] = x52; + out1[3] = x41; + out1[4] = x44; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry_square(uint64_t out1[5], const uint64_t arg1[5]) { + uint64_t x1 = ((arg1[4]) * (uint64_t)UINT8_C(0x13)); + uint64_t x2 = (x1 * (uint64_t)0x2); + uint64_t x3 = ((arg1[4]) * (uint64_t)0x2); + uint64_t x4 = ((arg1[3]) * (uint64_t)UINT8_C(0x13)); + uint64_t x5 = (x4 * (uint64_t)0x2); + uint64_t x6 = ((arg1[3]) * (uint64_t)0x2); + uint64_t x7 = ((arg1[2]) * (uint64_t)0x2); + uint64_t x8 = ((arg1[1]) * (uint64_t)0x2); + fiat_25519_uint128 x9 = ((fiat_25519_uint128)(arg1[4]) * x1); + fiat_25519_uint128 x10 = ((fiat_25519_uint128)(arg1[3]) * x2); + fiat_25519_uint128 x11 = ((fiat_25519_uint128)(arg1[3]) * x4); + fiat_25519_uint128 x12 = ((fiat_25519_uint128)(arg1[2]) * x2); + fiat_25519_uint128 x13 = ((fiat_25519_uint128)(arg1[2]) * x5); + fiat_25519_uint128 x14 = ((fiat_25519_uint128)(arg1[2]) * (arg1[2])); + fiat_25519_uint128 x15 = ((fiat_25519_uint128)(arg1[1]) * x2); + fiat_25519_uint128 x16 = ((fiat_25519_uint128)(arg1[1]) * x6); + fiat_25519_uint128 x17 = ((fiat_25519_uint128)(arg1[1]) * x7); + fiat_25519_uint128 x18 = ((fiat_25519_uint128)(arg1[1]) * (arg1[1])); + fiat_25519_uint128 x19 = ((fiat_25519_uint128)(arg1[0]) * x3); + fiat_25519_uint128 x20 = ((fiat_25519_uint128)(arg1[0]) * x6); + fiat_25519_uint128 x21 = ((fiat_25519_uint128)(arg1[0]) * x7); + fiat_25519_uint128 x22 = ((fiat_25519_uint128)(arg1[0]) * x8); + fiat_25519_uint128 x23 = ((fiat_25519_uint128)(arg1[0]) * (arg1[0])); + fiat_25519_uint128 x24 = (x23 + (x15 + x13)); + uint64_t x25 = (uint64_t)(x24 >> 51); + uint64_t x26 = (uint64_t)(x24 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x27 = (x19 + (x16 + x14)); + fiat_25519_uint128 x28 = (x20 + (x17 + x9)); + fiat_25519_uint128 x29 = (x21 + (x18 + x10)); + fiat_25519_uint128 x30 = (x22 + (x12 + x11)); + fiat_25519_uint128 x31 = (x25 + x30); + uint64_t x32 = (uint64_t)(x31 >> 51); + uint64_t x33 = (uint64_t)(x31 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x34 = (x32 + x29); + uint64_t x35 = (uint64_t)(x34 >> 51); + uint64_t x36 = (uint64_t)(x34 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x37 = (x35 + x28); + uint64_t x38 = (uint64_t)(x37 >> 51); + uint64_t x39 = (uint64_t)(x37 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x40 = (x38 + x27); + uint64_t x41 = (uint64_t)(x40 >> 51); + uint64_t x42 = (uint64_t)(x40 & UINT64_C(0x7ffffffffffff)); + uint64_t x43 = (x41 * (uint64_t)UINT8_C(0x13)); + uint64_t x44 = (x26 + x43); + uint64_t x45 = (x44 >> 51); + uint64_t x46 = (x44 & UINT64_C(0x7ffffffffffff)); + uint64_t x47 = (x45 + x33); + uint64_t x48 = (x47 >> 51); + uint64_t x49 = (x47 & UINT64_C(0x7ffffffffffff)); + uint64_t x50 = (x48 + x36); + out1[0] = x46; + out1[1] = x49; + out1[2] = x50; + out1[3] = x39; + out1[4] = x42; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry_scmul_121666(uint64_t out1[5], const uint64_t arg1[5]) { + fiat_25519_uint128 x1 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[4])); + fiat_25519_uint128 x2 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[3])); + fiat_25519_uint128 x3 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[2])); + fiat_25519_uint128 x4 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[1])); + fiat_25519_uint128 x5 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[0])); + uint64_t x6 = (uint64_t)(x5 >> 51); + uint64_t x7 = (uint64_t)(x5 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x8 = (x6 + x4); + uint64_t x9 = (uint64_t)(x8 >> 51); + uint64_t x10 = (uint64_t)(x8 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x11 = (x9 + x3); + uint64_t x12 = (uint64_t)(x11 >> 51); + uint64_t x13 = (uint64_t)(x11 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x14 = (x12 + x2); + uint64_t x15 = (uint64_t)(x14 >> 51); + uint64_t x16 = (uint64_t)(x14 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x17 = (x15 + x1); + uint64_t x18 = (uint64_t)(x17 >> 51); + uint64_t x19 = (uint64_t)(x17 & UINT64_C(0x7ffffffffffff)); + uint64_t x20 = (x18 * (uint64_t)UINT8_C(0x13)); + uint64_t x21 = (x7 + x20); + uint64_t x22 = (x21 >> 51); + uint64_t x23 = (x21 & UINT64_C(0x7ffffffffffff)); + uint64_t x24 = (x22 + x10); + uint64_t x25 = (x24 >> 51); + uint64_t x26 = (x24 & UINT64_C(0x7ffffffffffff)); + uint64_t x27 = (x25 + x13); + out1[0] = x23; + out1[1] = x26; + out1[2] = x27; + out1[3] = x16; + out1[4] = x19; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry(uint64_t out1[5], const uint64_t arg1[5]) { + uint64_t x1 = (arg1[0]); + uint64_t x2 = ((x1 >> 51) + (arg1[1])); + uint64_t x3 = ((x2 >> 51) + (arg1[2])); + uint64_t x4 = ((x3 >> 51) + (arg1[3])); + uint64_t x5 = ((x4 >> 51) + (arg1[4])); + uint64_t x6 = ((x1 & UINT64_C(0x7ffffffffffff)) + ((x5 >> 51) * (uint64_t)UINT8_C(0x13))); + uint64_t x7 = ((x6 >> 51) + (x2 & UINT64_C(0x7ffffffffffff))); + uint64_t x8 = (x6 & UINT64_C(0x7ffffffffffff)); + uint64_t x9 = (x7 & UINT64_C(0x7ffffffffffff)); + uint64_t x10 = ((x7 >> 51) + (x3 & UINT64_C(0x7ffffffffffff))); + uint64_t x11 = (x4 & UINT64_C(0x7ffffffffffff)); + uint64_t x12 = (x5 & UINT64_C(0x7ffffffffffff)); + out1[0] = x8; + out1[1] = x9; + out1[2] = x10; + out1[3] = x11; + out1[4] = x12; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * arg2: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + */ +static void fiat_25519_add(uint64_t out1[5], const uint64_t arg1[5], const uint64_t arg2[5]) { + uint64_t x1 = ((arg1[0]) + (arg2[0])); + uint64_t x2 = ((arg1[1]) + (arg2[1])); + uint64_t x3 = ((arg1[2]) + (arg2[2])); + uint64_t x4 = ((arg1[3]) + (arg2[3])); + uint64_t x5 = ((arg1[4]) + (arg2[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * arg2: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + */ +static void fiat_25519_sub(uint64_t out1[5], const uint64_t arg1[5], const uint64_t arg2[5]) { + uint64_t x1 = ((UINT64_C(0xfffffffffffda) + (arg1[0])) - (arg2[0])); + uint64_t x2 = ((UINT64_C(0xffffffffffffe) + (arg1[1])) - (arg2[1])); + uint64_t x3 = ((UINT64_C(0xffffffffffffe) + (arg1[2])) - (arg2[2])); + uint64_t x4 = ((UINT64_C(0xffffffffffffe) + (arg1[3])) - (arg2[3])); + uint64_t x5 = ((UINT64_C(0xffffffffffffe) + (arg1[4])) - (arg2[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + */ +static void fiat_25519_opp(uint64_t out1[5], const uint64_t arg1[5]) { + uint64_t x1 = (UINT64_C(0xfffffffffffda) - (arg1[0])); + uint64_t x2 = (UINT64_C(0xffffffffffffe) - (arg1[1])); + uint64_t x3 = (UINT64_C(0xffffffffffffe) - (arg1[2])); + uint64_t x4 = (UINT64_C(0xffffffffffffe) - (arg1[3])); + uint64_t x5 = (UINT64_C(0xffffffffffffe) - (arg1[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_25519_selectznz(uint64_t out1[5], fiat_25519_uint1 arg1, const uint64_t arg2[5], const uint64_t arg3[5]) { + uint64_t x1; + fiat_25519_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0])); + uint64_t x2; + fiat_25519_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1])); + uint64_t x3; + fiat_25519_cmovznz_u64(&x3, arg1, (arg2[2]), (arg3[2])); + uint64_t x4; + fiat_25519_cmovznz_u64(&x4, arg1, (arg2[3]), (arg3[3])); + uint64_t x5; + fiat_25519_cmovznz_u64(&x5, arg1, (arg2[4]), (arg3[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + */ +static void fiat_25519_to_bytes(uint8_t out1[32], const uint64_t arg1[5]) { + uint64_t x1; + fiat_25519_uint1 x2; + fiat_25519_subborrowx_u51(&x1, &x2, 0x0, (arg1[0]), UINT64_C(0x7ffffffffffed)); + uint64_t x3; + fiat_25519_uint1 x4; + fiat_25519_subborrowx_u51(&x3, &x4, x2, (arg1[1]), UINT64_C(0x7ffffffffffff)); + uint64_t x5; + fiat_25519_uint1 x6; + fiat_25519_subborrowx_u51(&x5, &x6, x4, (arg1[2]), UINT64_C(0x7ffffffffffff)); + uint64_t x7; + fiat_25519_uint1 x8; + fiat_25519_subborrowx_u51(&x7, &x8, x6, (arg1[3]), UINT64_C(0x7ffffffffffff)); + uint64_t x9; + fiat_25519_uint1 x10; + fiat_25519_subborrowx_u51(&x9, &x10, x8, (arg1[4]), UINT64_C(0x7ffffffffffff)); + uint64_t x11; + fiat_25519_cmovznz_u64(&x11, x10, 0x0, UINT64_C(0xffffffffffffffff)); + uint64_t x12; + fiat_25519_uint1 x13; + fiat_25519_addcarryx_u51(&x12, &x13, 0x0, (x11 & UINT64_C(0x7ffffffffffed)), x1); + uint64_t x14; + fiat_25519_uint1 x15; + fiat_25519_addcarryx_u51(&x14, &x15, x13, (x11 & UINT64_C(0x7ffffffffffff)), x3); + uint64_t x16; + fiat_25519_uint1 x17; + fiat_25519_addcarryx_u51(&x16, &x17, x15, (x11 & UINT64_C(0x7ffffffffffff)), x5); + uint64_t x18; + fiat_25519_uint1 x19; + fiat_25519_addcarryx_u51(&x18, &x19, x17, (x11 & UINT64_C(0x7ffffffffffff)), x7); + uint64_t x20; + fiat_25519_uint1 x21; + fiat_25519_addcarryx_u51(&x20, &x21, x19, (x11 & UINT64_C(0x7ffffffffffff)), x9); + uint64_t x22 = (x20 << 4); + uint64_t x23 = (x18 * (uint64_t)0x2); + uint64_t x24 = (x16 << 6); + uint64_t x25 = (x14 << 3); + uint64_t x26 = (x12 >> 8); + uint8_t x27 = (uint8_t)(x12 & UINT8_C(0xff)); + uint64_t x28 = (x26 >> 8); + uint8_t x29 = (uint8_t)(x26 & UINT8_C(0xff)); + uint64_t x30 = (x28 >> 8); + uint8_t x31 = (uint8_t)(x28 & UINT8_C(0xff)); + uint64_t x32 = (x30 >> 8); + uint8_t x33 = (uint8_t)(x30 & UINT8_C(0xff)); + uint64_t x34 = (x32 >> 8); + uint8_t x35 = (uint8_t)(x32 & UINT8_C(0xff)); + uint8_t x36 = (uint8_t)(x34 >> 8); + uint8_t x37 = (uint8_t)(x34 & UINT8_C(0xff)); + uint64_t x38 = (x36 + x25); + uint64_t x39 = (x38 >> 8); + uint8_t x40 = (uint8_t)(x38 & UINT8_C(0xff)); + uint64_t x41 = (x39 >> 8); + uint8_t x42 = (uint8_t)(x39 & UINT8_C(0xff)); + uint64_t x43 = (x41 >> 8); + uint8_t x44 = (uint8_t)(x41 & UINT8_C(0xff)); + uint64_t x45 = (x43 >> 8); + uint8_t x46 = (uint8_t)(x43 & UINT8_C(0xff)); + uint64_t x47 = (x45 >> 8); + uint8_t x48 = (uint8_t)(x45 & UINT8_C(0xff)); + uint8_t x49 = (uint8_t)(x47 >> 8); + uint8_t x50 = (uint8_t)(x47 & UINT8_C(0xff)); + uint64_t x51 = (x49 + x24); + uint64_t x52 = (x51 >> 8); + uint8_t x53 = (uint8_t)(x51 & UINT8_C(0xff)); + uint64_t x54 = (x52 >> 8); + uint8_t x55 = (uint8_t)(x52 & UINT8_C(0xff)); + uint64_t x56 = (x54 >> 8); + uint8_t x57 = (uint8_t)(x54 & UINT8_C(0xff)); + uint64_t x58 = (x56 >> 8); + uint8_t x59 = (uint8_t)(x56 & UINT8_C(0xff)); + uint64_t x60 = (x58 >> 8); + uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); + uint64_t x62 = (x60 >> 8); + uint8_t x63 = (uint8_t)(x60 & UINT8_C(0xff)); + fiat_25519_uint1 x64 = (fiat_25519_uint1)(x62 >> 8); + uint8_t x65 = (uint8_t)(x62 & UINT8_C(0xff)); + uint64_t x66 = (x64 + x23); + uint64_t x67 = (x66 >> 8); + uint8_t x68 = (uint8_t)(x66 & UINT8_C(0xff)); + uint64_t x69 = (x67 >> 8); + uint8_t x70 = (uint8_t)(x67 & UINT8_C(0xff)); + uint64_t x71 = (x69 >> 8); + uint8_t x72 = (uint8_t)(x69 & UINT8_C(0xff)); + uint64_t x73 = (x71 >> 8); + uint8_t x74 = (uint8_t)(x71 & UINT8_C(0xff)); + uint64_t x75 = (x73 >> 8); + uint8_t x76 = (uint8_t)(x73 & UINT8_C(0xff)); + uint8_t x77 = (uint8_t)(x75 >> 8); + uint8_t x78 = (uint8_t)(x75 & UINT8_C(0xff)); + uint64_t x79 = (x77 + x22); + uint64_t x80 = (x79 >> 8); + uint8_t x81 = (uint8_t)(x79 & UINT8_C(0xff)); + uint64_t x82 = (x80 >> 8); + uint8_t x83 = (uint8_t)(x80 & UINT8_C(0xff)); + uint64_t x84 = (x82 >> 8); + uint8_t x85 = (uint8_t)(x82 & UINT8_C(0xff)); + uint64_t x86 = (x84 >> 8); + uint8_t x87 = (uint8_t)(x84 & UINT8_C(0xff)); + uint64_t x88 = (x86 >> 8); + uint8_t x89 = (uint8_t)(x86 & UINT8_C(0xff)); + uint8_t x90 = (uint8_t)(x88 >> 8); + uint8_t x91 = (uint8_t)(x88 & UINT8_C(0xff)); + out1[0] = x27; + out1[1] = x29; + out1[2] = x31; + out1[3] = x33; + out1[4] = x35; + out1[5] = x37; + out1[6] = x40; + out1[7] = x42; + out1[8] = x44; + out1[9] = x46; + out1[10] = x48; + out1[11] = x50; + out1[12] = x53; + out1[13] = x55; + out1[14] = x57; + out1[15] = x59; + out1[16] = x61; + out1[17] = x63; + out1[18] = x65; + out1[19] = x68; + out1[20] = x70; + out1[21] = x72; + out1[22] = x74; + out1[23] = x76; + out1[24] = x78; + out1[25] = x81; + out1[26] = x83; + out1[27] = x85; + out1[28] = x87; + out1[29] = x89; + out1[30] = x91; + out1[31] = x90; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_from_bytes(uint64_t out1[5], const uint8_t arg1[32]) { + uint64_t x1 = ((uint64_t)(arg1[31]) << 44); + uint64_t x2 = ((uint64_t)(arg1[30]) << 36); + uint64_t x3 = ((uint64_t)(arg1[29]) << 28); + uint64_t x4 = ((uint64_t)(arg1[28]) << 20); + uint64_t x5 = ((uint64_t)(arg1[27]) << 12); + uint64_t x6 = ((uint64_t)(arg1[26]) << 4); + uint64_t x7 = ((uint64_t)(arg1[25]) << 47); + uint64_t x8 = ((uint64_t)(arg1[24]) << 39); + uint64_t x9 = ((uint64_t)(arg1[23]) << 31); + uint64_t x10 = ((uint64_t)(arg1[22]) << 23); + uint64_t x11 = ((uint64_t)(arg1[21]) << 15); + uint64_t x12 = ((uint64_t)(arg1[20]) << 7); + uint64_t x13 = ((uint64_t)(arg1[19]) << 50); + uint64_t x14 = ((uint64_t)(arg1[18]) << 42); + uint64_t x15 = ((uint64_t)(arg1[17]) << 34); + uint64_t x16 = ((uint64_t)(arg1[16]) << 26); + uint64_t x17 = ((uint64_t)(arg1[15]) << 18); + uint64_t x18 = ((uint64_t)(arg1[14]) << 10); + uint64_t x19 = ((uint64_t)(arg1[13]) << 2); + uint64_t x20 = ((uint64_t)(arg1[12]) << 45); + uint64_t x21 = ((uint64_t)(arg1[11]) << 37); + uint64_t x22 = ((uint64_t)(arg1[10]) << 29); + uint64_t x23 = ((uint64_t)(arg1[9]) << 21); + uint64_t x24 = ((uint64_t)(arg1[8]) << 13); + uint64_t x25 = ((uint64_t)(arg1[7]) << 5); + uint64_t x26 = ((uint64_t)(arg1[6]) << 48); + uint64_t x27 = ((uint64_t)(arg1[5]) << 40); + uint64_t x28 = ((uint64_t)(arg1[4]) << 32); + uint64_t x29 = ((uint64_t)(arg1[3]) << 24); + uint64_t x30 = ((uint64_t)(arg1[2]) << 16); + uint64_t x31 = ((uint64_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint64_t x33 = (x32 + (x31 + (x30 + (x29 + (x28 + (x27 + x26)))))); + uint8_t x34 = (uint8_t)(x33 >> 51); + uint64_t x35 = (x33 & UINT64_C(0x7ffffffffffff)); + uint64_t x36 = (x6 + (x5 + (x4 + (x3 + (x2 + x1))))); + uint64_t x37 = (x12 + (x11 + (x10 + (x9 + (x8 + x7))))); + uint64_t x38 = (x19 + (x18 + (x17 + (x16 + (x15 + (x14 + x13)))))); + uint64_t x39 = (x25 + (x24 + (x23 + (x22 + (x21 + x20))))); + uint64_t x40 = (x34 + x39); + uint8_t x41 = (uint8_t)(x40 >> 51); + uint64_t x42 = (x40 & UINT64_C(0x7ffffffffffff)); + uint64_t x43 = (x41 + x38); + uint8_t x44 = (uint8_t)(x43 >> 51); + uint64_t x45 = (x43 & UINT64_C(0x7ffffffffffff)); + uint64_t x46 = (x44 + x37); + uint8_t x47 = (uint8_t)(x46 >> 51); + uint64_t x48 = (x46 & UINT64_C(0x7ffffffffffff)); + uint64_t x49 = (x47 + x36); + out1[0] = x35; + out1[1] = x42; + out1[2] = x45; + out1[3] = x48; + out1[4] = x49; +} + diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h.grpc_back new file mode 100644 index 000000000..7c31ff99c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_64.h.grpc_back @@ -0,0 +1,559 @@ +/* Autogenerated */ +/* curve description: 25519 */ +/* requested operations: carry_mul, carry_square, carry_scmul121666, carry, add, sub, opp, selectznz, to_bytes, from_bytes */ +/* n = 5 (from "5") */ +/* s = 0x8000000000000000000000000000000000000000000000000000000000000000 (from "2^255") */ +/* c = [(1, 19)] (from "1,19") */ +/* machine_wordsize = 64 (from "64") */ + +#include +typedef unsigned char fiat_25519_uint1; +typedef signed char fiat_25519_int1; +typedef signed __int128 fiat_25519_int128; +typedef unsigned __int128 fiat_25519_uint128; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x7ffffffffffff] + * arg3: [0x0 ~> 0x7ffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0x7ffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_addcarryx_u51(uint64_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint64_t arg2, uint64_t arg3) { + uint64_t x1 = ((arg1 + arg2) + arg3); + uint64_t x2 = (x1 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint1 x3 = (fiat_25519_uint1)(x1 >> 51); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0x7ffffffffffff] + * arg3: [0x0 ~> 0x7ffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0x7ffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_25519_subborrowx_u51(uint64_t* out1, fiat_25519_uint1* out2, fiat_25519_uint1 arg1, uint64_t arg2, uint64_t arg3) { + int64_t x1 = ((int64_t)(arg2 - (int64_t)arg1) - (int64_t)arg3); + fiat_25519_int1 x2 = (fiat_25519_int1)(x1 >> 51); + uint64_t x3 = (x1 & UINT64_C(0x7ffffffffffff)); + *out1 = x3; + *out2 = (fiat_25519_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_25519_cmovznz_u64(uint64_t* out1, fiat_25519_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_25519_uint1 x1 = (!(!arg1)); + uint64_t x2 = ((fiat_25519_int1)(0x0 - x1) & UINT64_C(0xffffffffffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint64_t x3 = ((value_barrier_u64(x2) & arg3) | (value_barrier_u64(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * arg2: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry_mul(uint64_t out1[5], const uint64_t arg1[5], const uint64_t arg2[5]) { + fiat_25519_uint128 x1 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x2 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[3]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x3 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[2]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x4 = ((fiat_25519_uint128)(arg1[4]) * ((arg2[1]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x5 = ((fiat_25519_uint128)(arg1[3]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x6 = ((fiat_25519_uint128)(arg1[3]) * ((arg2[3]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x7 = ((fiat_25519_uint128)(arg1[3]) * ((arg2[2]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x8 = ((fiat_25519_uint128)(arg1[2]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x9 = ((fiat_25519_uint128)(arg1[2]) * ((arg2[3]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x10 = ((fiat_25519_uint128)(arg1[1]) * ((arg2[4]) * (uint64_t)UINT8_C(0x13))); + fiat_25519_uint128 x11 = ((fiat_25519_uint128)(arg1[4]) * (arg2[0])); + fiat_25519_uint128 x12 = ((fiat_25519_uint128)(arg1[3]) * (arg2[1])); + fiat_25519_uint128 x13 = ((fiat_25519_uint128)(arg1[3]) * (arg2[0])); + fiat_25519_uint128 x14 = ((fiat_25519_uint128)(arg1[2]) * (arg2[2])); + fiat_25519_uint128 x15 = ((fiat_25519_uint128)(arg1[2]) * (arg2[1])); + fiat_25519_uint128 x16 = ((fiat_25519_uint128)(arg1[2]) * (arg2[0])); + fiat_25519_uint128 x17 = ((fiat_25519_uint128)(arg1[1]) * (arg2[3])); + fiat_25519_uint128 x18 = ((fiat_25519_uint128)(arg1[1]) * (arg2[2])); + fiat_25519_uint128 x19 = ((fiat_25519_uint128)(arg1[1]) * (arg2[1])); + fiat_25519_uint128 x20 = ((fiat_25519_uint128)(arg1[1]) * (arg2[0])); + fiat_25519_uint128 x21 = ((fiat_25519_uint128)(arg1[0]) * (arg2[4])); + fiat_25519_uint128 x22 = ((fiat_25519_uint128)(arg1[0]) * (arg2[3])); + fiat_25519_uint128 x23 = ((fiat_25519_uint128)(arg1[0]) * (arg2[2])); + fiat_25519_uint128 x24 = ((fiat_25519_uint128)(arg1[0]) * (arg2[1])); + fiat_25519_uint128 x25 = ((fiat_25519_uint128)(arg1[0]) * (arg2[0])); + fiat_25519_uint128 x26 = (x25 + (x10 + (x9 + (x7 + x4)))); + uint64_t x27 = (uint64_t)(x26 >> 51); + uint64_t x28 = (uint64_t)(x26 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x29 = (x21 + (x17 + (x14 + (x12 + x11)))); + fiat_25519_uint128 x30 = (x22 + (x18 + (x15 + (x13 + x1)))); + fiat_25519_uint128 x31 = (x23 + (x19 + (x16 + (x5 + x2)))); + fiat_25519_uint128 x32 = (x24 + (x20 + (x8 + (x6 + x3)))); + fiat_25519_uint128 x33 = (x27 + x32); + uint64_t x34 = (uint64_t)(x33 >> 51); + uint64_t x35 = (uint64_t)(x33 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x36 = (x34 + x31); + uint64_t x37 = (uint64_t)(x36 >> 51); + uint64_t x38 = (uint64_t)(x36 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x39 = (x37 + x30); + uint64_t x40 = (uint64_t)(x39 >> 51); + uint64_t x41 = (uint64_t)(x39 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x42 = (x40 + x29); + uint64_t x43 = (uint64_t)(x42 >> 51); + uint64_t x44 = (uint64_t)(x42 & UINT64_C(0x7ffffffffffff)); + uint64_t x45 = (x43 * (uint64_t)UINT8_C(0x13)); + uint64_t x46 = (x28 + x45); + uint64_t x47 = (x46 >> 51); + uint64_t x48 = (x46 & UINT64_C(0x7ffffffffffff)); + uint64_t x49 = (x47 + x35); + uint64_t x50 = (x49 >> 51); + uint64_t x51 = (x49 & UINT64_C(0x7ffffffffffff)); + uint64_t x52 = (x50 + x38); + out1[0] = x48; + out1[1] = x51; + out1[2] = x52; + out1[3] = x41; + out1[4] = x44; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry_square(uint64_t out1[5], const uint64_t arg1[5]) { + uint64_t x1 = ((arg1[4]) * (uint64_t)UINT8_C(0x13)); + uint64_t x2 = (x1 * (uint64_t)0x2); + uint64_t x3 = ((arg1[4]) * (uint64_t)0x2); + uint64_t x4 = ((arg1[3]) * (uint64_t)UINT8_C(0x13)); + uint64_t x5 = (x4 * (uint64_t)0x2); + uint64_t x6 = ((arg1[3]) * (uint64_t)0x2); + uint64_t x7 = ((arg1[2]) * (uint64_t)0x2); + uint64_t x8 = ((arg1[1]) * (uint64_t)0x2); + fiat_25519_uint128 x9 = ((fiat_25519_uint128)(arg1[4]) * x1); + fiat_25519_uint128 x10 = ((fiat_25519_uint128)(arg1[3]) * x2); + fiat_25519_uint128 x11 = ((fiat_25519_uint128)(arg1[3]) * x4); + fiat_25519_uint128 x12 = ((fiat_25519_uint128)(arg1[2]) * x2); + fiat_25519_uint128 x13 = ((fiat_25519_uint128)(arg1[2]) * x5); + fiat_25519_uint128 x14 = ((fiat_25519_uint128)(arg1[2]) * (arg1[2])); + fiat_25519_uint128 x15 = ((fiat_25519_uint128)(arg1[1]) * x2); + fiat_25519_uint128 x16 = ((fiat_25519_uint128)(arg1[1]) * x6); + fiat_25519_uint128 x17 = ((fiat_25519_uint128)(arg1[1]) * x7); + fiat_25519_uint128 x18 = ((fiat_25519_uint128)(arg1[1]) * (arg1[1])); + fiat_25519_uint128 x19 = ((fiat_25519_uint128)(arg1[0]) * x3); + fiat_25519_uint128 x20 = ((fiat_25519_uint128)(arg1[0]) * x6); + fiat_25519_uint128 x21 = ((fiat_25519_uint128)(arg1[0]) * x7); + fiat_25519_uint128 x22 = ((fiat_25519_uint128)(arg1[0]) * x8); + fiat_25519_uint128 x23 = ((fiat_25519_uint128)(arg1[0]) * (arg1[0])); + fiat_25519_uint128 x24 = (x23 + (x15 + x13)); + uint64_t x25 = (uint64_t)(x24 >> 51); + uint64_t x26 = (uint64_t)(x24 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x27 = (x19 + (x16 + x14)); + fiat_25519_uint128 x28 = (x20 + (x17 + x9)); + fiat_25519_uint128 x29 = (x21 + (x18 + x10)); + fiat_25519_uint128 x30 = (x22 + (x12 + x11)); + fiat_25519_uint128 x31 = (x25 + x30); + uint64_t x32 = (uint64_t)(x31 >> 51); + uint64_t x33 = (uint64_t)(x31 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x34 = (x32 + x29); + uint64_t x35 = (uint64_t)(x34 >> 51); + uint64_t x36 = (uint64_t)(x34 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x37 = (x35 + x28); + uint64_t x38 = (uint64_t)(x37 >> 51); + uint64_t x39 = (uint64_t)(x37 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x40 = (x38 + x27); + uint64_t x41 = (uint64_t)(x40 >> 51); + uint64_t x42 = (uint64_t)(x40 & UINT64_C(0x7ffffffffffff)); + uint64_t x43 = (x41 * (uint64_t)UINT8_C(0x13)); + uint64_t x44 = (x26 + x43); + uint64_t x45 = (x44 >> 51); + uint64_t x46 = (x44 & UINT64_C(0x7ffffffffffff)); + uint64_t x47 = (x45 + x33); + uint64_t x48 = (x47 >> 51); + uint64_t x49 = (x47 & UINT64_C(0x7ffffffffffff)); + uint64_t x50 = (x48 + x36); + out1[0] = x46; + out1[1] = x49; + out1[2] = x50; + out1[3] = x39; + out1[4] = x42; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry_scmul_121666(uint64_t out1[5], const uint64_t arg1[5]) { + fiat_25519_uint128 x1 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[4])); + fiat_25519_uint128 x2 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[3])); + fiat_25519_uint128 x3 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[2])); + fiat_25519_uint128 x4 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[1])); + fiat_25519_uint128 x5 = (UINT32_C(0x1db42) * (fiat_25519_uint128)(arg1[0])); + uint64_t x6 = (uint64_t)(x5 >> 51); + uint64_t x7 = (uint64_t)(x5 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x8 = (x6 + x4); + uint64_t x9 = (uint64_t)(x8 >> 51); + uint64_t x10 = (uint64_t)(x8 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x11 = (x9 + x3); + uint64_t x12 = (uint64_t)(x11 >> 51); + uint64_t x13 = (uint64_t)(x11 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x14 = (x12 + x2); + uint64_t x15 = (uint64_t)(x14 >> 51); + uint64_t x16 = (uint64_t)(x14 & UINT64_C(0x7ffffffffffff)); + fiat_25519_uint128 x17 = (x15 + x1); + uint64_t x18 = (uint64_t)(x17 >> 51); + uint64_t x19 = (uint64_t)(x17 & UINT64_C(0x7ffffffffffff)); + uint64_t x20 = (x18 * (uint64_t)UINT8_C(0x13)); + uint64_t x21 = (x7 + x20); + uint64_t x22 = (x21 >> 51); + uint64_t x23 = (x21 & UINT64_C(0x7ffffffffffff)); + uint64_t x24 = (x22 + x10); + uint64_t x25 = (x24 >> 51); + uint64_t x26 = (x24 & UINT64_C(0x7ffffffffffff)); + uint64_t x27 = (x25 + x13); + out1[0] = x23; + out1[1] = x26; + out1[2] = x27; + out1[3] = x16; + out1[4] = x19; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_carry(uint64_t out1[5], const uint64_t arg1[5]) { + uint64_t x1 = (arg1[0]); + uint64_t x2 = ((x1 >> 51) + (arg1[1])); + uint64_t x3 = ((x2 >> 51) + (arg1[2])); + uint64_t x4 = ((x3 >> 51) + (arg1[3])); + uint64_t x5 = ((x4 >> 51) + (arg1[4])); + uint64_t x6 = ((x1 & UINT64_C(0x7ffffffffffff)) + ((x5 >> 51) * (uint64_t)UINT8_C(0x13))); + uint64_t x7 = ((x6 >> 51) + (x2 & UINT64_C(0x7ffffffffffff))); + uint64_t x8 = (x6 & UINT64_C(0x7ffffffffffff)); + uint64_t x9 = (x7 & UINT64_C(0x7ffffffffffff)); + uint64_t x10 = ((x7 >> 51) + (x3 & UINT64_C(0x7ffffffffffff))); + uint64_t x11 = (x4 & UINT64_C(0x7ffffffffffff)); + uint64_t x12 = (x5 & UINT64_C(0x7ffffffffffff)); + out1[0] = x8; + out1[1] = x9; + out1[2] = x10; + out1[3] = x11; + out1[4] = x12; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * arg2: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + */ +static void fiat_25519_add(uint64_t out1[5], const uint64_t arg1[5], const uint64_t arg2[5]) { + uint64_t x1 = ((arg1[0]) + (arg2[0])); + uint64_t x2 = ((arg1[1]) + (arg2[1])); + uint64_t x3 = ((arg1[2]) + (arg2[2])); + uint64_t x4 = ((arg1[3]) + (arg2[3])); + uint64_t x5 = ((arg1[4]) + (arg2[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * arg2: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + */ +static void fiat_25519_sub(uint64_t out1[5], const uint64_t arg1[5], const uint64_t arg2[5]) { + uint64_t x1 = ((UINT64_C(0xfffffffffffda) + (arg1[0])) - (arg2[0])); + uint64_t x2 = ((UINT64_C(0xffffffffffffe) + (arg1[1])) - (arg2[1])); + uint64_t x3 = ((UINT64_C(0xffffffffffffe) + (arg1[2])) - (arg2[2])); + uint64_t x4 = ((UINT64_C(0xffffffffffffe) + (arg1[3])) - (arg2[3])); + uint64_t x5 = ((UINT64_C(0xffffffffffffe) + (arg1[4])) - (arg2[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664], [0x0 ~> 0x1a666666666664]] + */ +static void fiat_25519_opp(uint64_t out1[5], const uint64_t arg1[5]) { + uint64_t x1 = (UINT64_C(0xfffffffffffda) - (arg1[0])); + uint64_t x2 = (UINT64_C(0xffffffffffffe) - (arg1[1])); + uint64_t x3 = (UINT64_C(0xffffffffffffe) - (arg1[2])); + uint64_t x4 = (UINT64_C(0xffffffffffffe) - (arg1[3])); + uint64_t x5 = (UINT64_C(0xffffffffffffe) - (arg1[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_25519_selectznz(uint64_t out1[5], fiat_25519_uint1 arg1, const uint64_t arg2[5], const uint64_t arg3[5]) { + uint64_t x1; + fiat_25519_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0])); + uint64_t x2; + fiat_25519_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1])); + uint64_t x3; + fiat_25519_cmovznz_u64(&x3, arg1, (arg2[2]), (arg3[2])); + uint64_t x4; + fiat_25519_cmovznz_u64(&x4, arg1, (arg2[3]), (arg3[3])); + uint64_t x5; + fiat_25519_cmovznz_u64(&x5, arg1, (arg2[4]), (arg3[4])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + */ +static void fiat_25519_to_bytes(uint8_t out1[32], const uint64_t arg1[5]) { + uint64_t x1; + fiat_25519_uint1 x2; + fiat_25519_subborrowx_u51(&x1, &x2, 0x0, (arg1[0]), UINT64_C(0x7ffffffffffed)); + uint64_t x3; + fiat_25519_uint1 x4; + fiat_25519_subborrowx_u51(&x3, &x4, x2, (arg1[1]), UINT64_C(0x7ffffffffffff)); + uint64_t x5; + fiat_25519_uint1 x6; + fiat_25519_subborrowx_u51(&x5, &x6, x4, (arg1[2]), UINT64_C(0x7ffffffffffff)); + uint64_t x7; + fiat_25519_uint1 x8; + fiat_25519_subborrowx_u51(&x7, &x8, x6, (arg1[3]), UINT64_C(0x7ffffffffffff)); + uint64_t x9; + fiat_25519_uint1 x10; + fiat_25519_subborrowx_u51(&x9, &x10, x8, (arg1[4]), UINT64_C(0x7ffffffffffff)); + uint64_t x11; + fiat_25519_cmovznz_u64(&x11, x10, 0x0, UINT64_C(0xffffffffffffffff)); + uint64_t x12; + fiat_25519_uint1 x13; + fiat_25519_addcarryx_u51(&x12, &x13, 0x0, (x11 & UINT64_C(0x7ffffffffffed)), x1); + uint64_t x14; + fiat_25519_uint1 x15; + fiat_25519_addcarryx_u51(&x14, &x15, x13, (x11 & UINT64_C(0x7ffffffffffff)), x3); + uint64_t x16; + fiat_25519_uint1 x17; + fiat_25519_addcarryx_u51(&x16, &x17, x15, (x11 & UINT64_C(0x7ffffffffffff)), x5); + uint64_t x18; + fiat_25519_uint1 x19; + fiat_25519_addcarryx_u51(&x18, &x19, x17, (x11 & UINT64_C(0x7ffffffffffff)), x7); + uint64_t x20; + fiat_25519_uint1 x21; + fiat_25519_addcarryx_u51(&x20, &x21, x19, (x11 & UINT64_C(0x7ffffffffffff)), x9); + uint64_t x22 = (x20 << 4); + uint64_t x23 = (x18 * (uint64_t)0x2); + uint64_t x24 = (x16 << 6); + uint64_t x25 = (x14 << 3); + uint64_t x26 = (x12 >> 8); + uint8_t x27 = (uint8_t)(x12 & UINT8_C(0xff)); + uint64_t x28 = (x26 >> 8); + uint8_t x29 = (uint8_t)(x26 & UINT8_C(0xff)); + uint64_t x30 = (x28 >> 8); + uint8_t x31 = (uint8_t)(x28 & UINT8_C(0xff)); + uint64_t x32 = (x30 >> 8); + uint8_t x33 = (uint8_t)(x30 & UINT8_C(0xff)); + uint64_t x34 = (x32 >> 8); + uint8_t x35 = (uint8_t)(x32 & UINT8_C(0xff)); + uint8_t x36 = (uint8_t)(x34 >> 8); + uint8_t x37 = (uint8_t)(x34 & UINT8_C(0xff)); + uint64_t x38 = (x36 + x25); + uint64_t x39 = (x38 >> 8); + uint8_t x40 = (uint8_t)(x38 & UINT8_C(0xff)); + uint64_t x41 = (x39 >> 8); + uint8_t x42 = (uint8_t)(x39 & UINT8_C(0xff)); + uint64_t x43 = (x41 >> 8); + uint8_t x44 = (uint8_t)(x41 & UINT8_C(0xff)); + uint64_t x45 = (x43 >> 8); + uint8_t x46 = (uint8_t)(x43 & UINT8_C(0xff)); + uint64_t x47 = (x45 >> 8); + uint8_t x48 = (uint8_t)(x45 & UINT8_C(0xff)); + uint8_t x49 = (uint8_t)(x47 >> 8); + uint8_t x50 = (uint8_t)(x47 & UINT8_C(0xff)); + uint64_t x51 = (x49 + x24); + uint64_t x52 = (x51 >> 8); + uint8_t x53 = (uint8_t)(x51 & UINT8_C(0xff)); + uint64_t x54 = (x52 >> 8); + uint8_t x55 = (uint8_t)(x52 & UINT8_C(0xff)); + uint64_t x56 = (x54 >> 8); + uint8_t x57 = (uint8_t)(x54 & UINT8_C(0xff)); + uint64_t x58 = (x56 >> 8); + uint8_t x59 = (uint8_t)(x56 & UINT8_C(0xff)); + uint64_t x60 = (x58 >> 8); + uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); + uint64_t x62 = (x60 >> 8); + uint8_t x63 = (uint8_t)(x60 & UINT8_C(0xff)); + fiat_25519_uint1 x64 = (fiat_25519_uint1)(x62 >> 8); + uint8_t x65 = (uint8_t)(x62 & UINT8_C(0xff)); + uint64_t x66 = (x64 + x23); + uint64_t x67 = (x66 >> 8); + uint8_t x68 = (uint8_t)(x66 & UINT8_C(0xff)); + uint64_t x69 = (x67 >> 8); + uint8_t x70 = (uint8_t)(x67 & UINT8_C(0xff)); + uint64_t x71 = (x69 >> 8); + uint8_t x72 = (uint8_t)(x69 & UINT8_C(0xff)); + uint64_t x73 = (x71 >> 8); + uint8_t x74 = (uint8_t)(x71 & UINT8_C(0xff)); + uint64_t x75 = (x73 >> 8); + uint8_t x76 = (uint8_t)(x73 & UINT8_C(0xff)); + uint8_t x77 = (uint8_t)(x75 >> 8); + uint8_t x78 = (uint8_t)(x75 & UINT8_C(0xff)); + uint64_t x79 = (x77 + x22); + uint64_t x80 = (x79 >> 8); + uint8_t x81 = (uint8_t)(x79 & UINT8_C(0xff)); + uint64_t x82 = (x80 >> 8); + uint8_t x83 = (uint8_t)(x80 & UINT8_C(0xff)); + uint64_t x84 = (x82 >> 8); + uint8_t x85 = (uint8_t)(x82 & UINT8_C(0xff)); + uint64_t x86 = (x84 >> 8); + uint8_t x87 = (uint8_t)(x84 & UINT8_C(0xff)); + uint64_t x88 = (x86 >> 8); + uint8_t x89 = (uint8_t)(x86 & UINT8_C(0xff)); + uint8_t x90 = (uint8_t)(x88 >> 8); + uint8_t x91 = (uint8_t)(x88 & UINT8_C(0xff)); + out1[0] = x27; + out1[1] = x29; + out1[2] = x31; + out1[3] = x33; + out1[4] = x35; + out1[5] = x37; + out1[6] = x40; + out1[7] = x42; + out1[8] = x44; + out1[9] = x46; + out1[10] = x48; + out1[11] = x50; + out1[12] = x53; + out1[13] = x55; + out1[14] = x57; + out1[15] = x59; + out1[16] = x61; + out1[17] = x63; + out1[18] = x65; + out1[19] = x68; + out1[20] = x70; + out1[21] = x72; + out1[22] = x74; + out1[23] = x76; + out1[24] = x78; + out1[25] = x81; + out1[26] = x83; + out1[27] = x85; + out1[28] = x87; + out1[29] = x89; + out1[30] = x91; + out1[31] = x90; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x7f]] + * Output Bounds: + * out1: [[0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc], [0x0 ~> 0x8cccccccccccc]] + */ +static void fiat_25519_from_bytes(uint64_t out1[5], const uint8_t arg1[32]) { + uint64_t x1 = ((uint64_t)(arg1[31]) << 44); + uint64_t x2 = ((uint64_t)(arg1[30]) << 36); + uint64_t x3 = ((uint64_t)(arg1[29]) << 28); + uint64_t x4 = ((uint64_t)(arg1[28]) << 20); + uint64_t x5 = ((uint64_t)(arg1[27]) << 12); + uint64_t x6 = ((uint64_t)(arg1[26]) << 4); + uint64_t x7 = ((uint64_t)(arg1[25]) << 47); + uint64_t x8 = ((uint64_t)(arg1[24]) << 39); + uint64_t x9 = ((uint64_t)(arg1[23]) << 31); + uint64_t x10 = ((uint64_t)(arg1[22]) << 23); + uint64_t x11 = ((uint64_t)(arg1[21]) << 15); + uint64_t x12 = ((uint64_t)(arg1[20]) << 7); + uint64_t x13 = ((uint64_t)(arg1[19]) << 50); + uint64_t x14 = ((uint64_t)(arg1[18]) << 42); + uint64_t x15 = ((uint64_t)(arg1[17]) << 34); + uint64_t x16 = ((uint64_t)(arg1[16]) << 26); + uint64_t x17 = ((uint64_t)(arg1[15]) << 18); + uint64_t x18 = ((uint64_t)(arg1[14]) << 10); + uint64_t x19 = ((uint64_t)(arg1[13]) << 2); + uint64_t x20 = ((uint64_t)(arg1[12]) << 45); + uint64_t x21 = ((uint64_t)(arg1[11]) << 37); + uint64_t x22 = ((uint64_t)(arg1[10]) << 29); + uint64_t x23 = ((uint64_t)(arg1[9]) << 21); + uint64_t x24 = ((uint64_t)(arg1[8]) << 13); + uint64_t x25 = ((uint64_t)(arg1[7]) << 5); + uint64_t x26 = ((uint64_t)(arg1[6]) << 48); + uint64_t x27 = ((uint64_t)(arg1[5]) << 40); + uint64_t x28 = ((uint64_t)(arg1[4]) << 32); + uint64_t x29 = ((uint64_t)(arg1[3]) << 24); + uint64_t x30 = ((uint64_t)(arg1[2]) << 16); + uint64_t x31 = ((uint64_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint64_t x33 = (x32 + (x31 + (x30 + (x29 + (x28 + (x27 + x26)))))); + uint8_t x34 = (uint8_t)(x33 >> 51); + uint64_t x35 = (x33 & UINT64_C(0x7ffffffffffff)); + uint64_t x36 = (x6 + (x5 + (x4 + (x3 + (x2 + x1))))); + uint64_t x37 = (x12 + (x11 + (x10 + (x9 + (x8 + x7))))); + uint64_t x38 = (x19 + (x18 + (x17 + (x16 + (x15 + (x14 + x13)))))); + uint64_t x39 = (x25 + (x24 + (x23 + (x22 + (x21 + x20))))); + uint64_t x40 = (x34 + x39); + uint8_t x41 = (uint8_t)(x40 >> 51); + uint64_t x42 = (x40 & UINT64_C(0x7ffffffffffff)); + uint64_t x43 = (x41 + x38); + uint8_t x44 = (uint8_t)(x43 >> 51); + uint64_t x45 = (x43 & UINT64_C(0x7ffffffffffff)); + uint64_t x46 = (x44 + x37); + uint8_t x47 = (uint8_t)(x46 >> 51); + uint64_t x48 = (x46 & UINT64_C(0x7ffffffffffff)); + uint64_t x49 = (x47 + x36); + out1[0] = x35; + out1[1] = x42; + out1[2] = x45; + out1[3] = x48; + out1[4] = x49; +} + diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/curve25519_tables.h b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h similarity index 100% rename from Pods/BoringSSL-GRPC/third_party/fiat/curve25519_tables.h rename to Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/curve25519_tables.h.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/third_party/fiat/curve25519_tables.h.grpc_back rename to Pods/BoringSSL-GRPC/src/third_party/fiat/curve25519_tables.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/internal.h b/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h similarity index 100% rename from Pods/BoringSSL-GRPC/third_party/fiat/internal.h rename to Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/internal.h.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h.grpc_back similarity index 100% rename from Pods/BoringSSL-GRPC/third_party/fiat/internal.h.grpc_back rename to Pods/BoringSSL-GRPC/src/third_party/fiat/internal.h.grpc_back diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c new file mode 100644 index 000000000..26ff9ce02 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c @@ -0,0 +1,1063 @@ +// The MIT License (MIT) +// +// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// The field arithmetic code is generated by Fiat +// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. +// +// An implementation of the NIST P-256 elliptic curve point multiplication. +// 256-bit Montgomery form, generated using fiat-crypto, for 64 and 32-bit. +// Field operations with inputs in [0,p) return outputs in [0,p). + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "../../crypto/fipsmodule/delocate.h" +#include "../../crypto/fipsmodule/ec/internal.h" +#include "../../crypto/internal.h" + + +// MSVC does not implement uint128_t, and crashes with intrinsics +#if defined(BORINGSSL_HAS_UINT128) +#define BORINGSSL_NISTP256_64BIT 1 +#include "p256_64.h" +#else +#include "p256_32.h" +#endif + + +// utility functions, handwritten + +#define NBYTES 32 + +#if defined(BORINGSSL_NISTP256_64BIT) + +#define NLIMBS 4 +typedef uint64_t limb_t; +typedef uint64_t fe[NLIMBS]; +#else // 64BIT; else 32BIT + +#define NLIMBS 8 +typedef uint32_t limb_t; +typedef uint32_t fe[NLIMBS]; + +#endif // 64BIT + +#define fe_add fiat_p256_add +#define fe_sub fiat_p256_sub +#define fe_opp fiat_p256_opp + +#define fe_mul fiat_p256_mul +#define fe_sqr fiat_p256_square + +#define fe_tobytes fiat_p256_to_bytes +#define fe_frombytes fiat_p256_from_bytes + +static limb_t fe_nz(const limb_t in1[NLIMBS]) { + limb_t ret; + fiat_p256_nonzero(&ret, in1); + return ret; +} + +static void fe_copy(limb_t out[NLIMBS], const limb_t in1[NLIMBS]) { + for (int i = 0; i < NLIMBS; i++) { + out[i] = in1[i]; + } +} + +static void fe_cmovznz(limb_t out[NLIMBS], limb_t t, const limb_t z[NLIMBS], + const limb_t nz[NLIMBS]) { + fiat_p256_selectznz(out, !!t, z, nz); +} + +static void fe_from_montgomery(fe x) { + fiat_p256_from_montgomery(x, x); +} + +static void fe_from_generic(fe out, const EC_FELEM *in) { + fe_frombytes(out, in->bytes); +} + +static void fe_to_generic(EC_FELEM *out, const fe in) { + // This works because 256 is a multiple of 64, so there are no excess bytes to + // zero when rounding up to |BN_ULONG|s. + OPENSSL_STATIC_ASSERT( + 256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2), + "fe_tobytes leaves bytes uninitialized"); + fe_tobytes(out->bytes, in); +} + +// fe_inv calculates |out| = |in|^{-1} +// +// Based on Fermat's Little Theorem: +// a^p = a (mod p) +// a^{p-1} = 1 (mod p) +// a^{p-2} = a^{-1} (mod p) +static void fe_inv(fe out, const fe in) { + fe ftmp, ftmp2; + // each e_I will hold |in|^{2^I - 1} + fe e2, e4, e8, e16, e32, e64; + + fe_sqr(ftmp, in); // 2^1 + fe_mul(ftmp, in, ftmp); // 2^2 - 2^0 + fe_copy(e2, ftmp); + fe_sqr(ftmp, ftmp); // 2^3 - 2^1 + fe_sqr(ftmp, ftmp); // 2^4 - 2^2 + fe_mul(ftmp, ftmp, e2); // 2^4 - 2^0 + fe_copy(e4, ftmp); + fe_sqr(ftmp, ftmp); // 2^5 - 2^1 + fe_sqr(ftmp, ftmp); // 2^6 - 2^2 + fe_sqr(ftmp, ftmp); // 2^7 - 2^3 + fe_sqr(ftmp, ftmp); // 2^8 - 2^4 + fe_mul(ftmp, ftmp, e4); // 2^8 - 2^0 + fe_copy(e8, ftmp); + for (size_t i = 0; i < 8; i++) { + fe_sqr(ftmp, ftmp); + } // 2^16 - 2^8 + fe_mul(ftmp, ftmp, e8); // 2^16 - 2^0 + fe_copy(e16, ftmp); + for (size_t i = 0; i < 16; i++) { + fe_sqr(ftmp, ftmp); + } // 2^32 - 2^16 + fe_mul(ftmp, ftmp, e16); // 2^32 - 2^0 + fe_copy(e32, ftmp); + for (size_t i = 0; i < 32; i++) { + fe_sqr(ftmp, ftmp); + } // 2^64 - 2^32 + fe_copy(e64, ftmp); + fe_mul(ftmp, ftmp, in); // 2^64 - 2^32 + 2^0 + for (size_t i = 0; i < 192; i++) { + fe_sqr(ftmp, ftmp); + } // 2^256 - 2^224 + 2^192 + + fe_mul(ftmp2, e64, e32); // 2^64 - 2^0 + for (size_t i = 0; i < 16; i++) { + fe_sqr(ftmp2, ftmp2); + } // 2^80 - 2^16 + fe_mul(ftmp2, ftmp2, e16); // 2^80 - 2^0 + for (size_t i = 0; i < 8; i++) { + fe_sqr(ftmp2, ftmp2); + } // 2^88 - 2^8 + fe_mul(ftmp2, ftmp2, e8); // 2^88 - 2^0 + for (size_t i = 0; i < 4; i++) { + fe_sqr(ftmp2, ftmp2); + } // 2^92 - 2^4 + fe_mul(ftmp2, ftmp2, e4); // 2^92 - 2^0 + fe_sqr(ftmp2, ftmp2); // 2^93 - 2^1 + fe_sqr(ftmp2, ftmp2); // 2^94 - 2^2 + fe_mul(ftmp2, ftmp2, e2); // 2^94 - 2^0 + fe_sqr(ftmp2, ftmp2); // 2^95 - 2^1 + fe_sqr(ftmp2, ftmp2); // 2^96 - 2^2 + fe_mul(ftmp2, ftmp2, in); // 2^96 - 3 + + fe_mul(out, ftmp2, ftmp); // 2^256 - 2^224 + 2^192 + 2^96 - 3 +} + +// Group operations +// ---------------- +// +// Building on top of the field operations we have the operations on the +// elliptic curve group itself. Points on the curve are represented in Jacobian +// coordinates. +// +// Both operations were transcribed to Coq and proven to correspond to naive +// implementations using Affine coordinates, for all suitable fields. In the +// Coq proofs, issues of constant-time execution and memory layout (aliasing) +// conventions were not considered. Specification of affine coordinates: +// +// As a sanity check, a proof that these points form a commutative group: +// + +// point_double calculates 2*(x_in, y_in, z_in) +// +// The method is taken from: +// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b +// +// Coq transcription and correctness proof: +// +// +// +// Outputs can equal corresponding inputs, i.e., x_out == x_in is allowed. +// while x_out == y_in is not (maybe this works, but it's not tested). +static void point_double(fe x_out, fe y_out, fe z_out, + const fe x_in, const fe y_in, const fe z_in) { + fe delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; + // delta = z^2 + fe_sqr(delta, z_in); + // gamma = y^2 + fe_sqr(gamma, y_in); + // beta = x*gamma + fe_mul(beta, x_in, gamma); + + // alpha = 3*(x-delta)*(x+delta) + fe_sub(ftmp, x_in, delta); + fe_add(ftmp2, x_in, delta); + + fe_add(tmptmp, ftmp2, ftmp2); + fe_add(ftmp2, ftmp2, tmptmp); + fe_mul(alpha, ftmp, ftmp2); + + // x' = alpha^2 - 8*beta + fe_sqr(x_out, alpha); + fe_add(fourbeta, beta, beta); + fe_add(fourbeta, fourbeta, fourbeta); + fe_add(tmptmp, fourbeta, fourbeta); + fe_sub(x_out, x_out, tmptmp); + + // z' = (y + z)^2 - gamma - delta + fe_add(delta, gamma, delta); + fe_add(ftmp, y_in, z_in); + fe_sqr(z_out, ftmp); + fe_sub(z_out, z_out, delta); + + // y' = alpha*(4*beta - x') - 8*gamma^2 + fe_sub(y_out, fourbeta, x_out); + fe_add(gamma, gamma, gamma); + fe_sqr(gamma, gamma); + fe_mul(y_out, alpha, y_out); + fe_add(gamma, gamma, gamma); + fe_sub(y_out, y_out, gamma); +} + +// point_add calcuates (x1, y1, z1) + (x2, y2, z2) +// +// The method is taken from: +// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, +// adapted for mixed addition (z2 = 1, or z2 = 0 for the point at infinity). +// +// Coq transcription and correctness proof: +// +// +// +// This function includes a branch for checking whether the two input points +// are equal, (while not equal to the point at infinity). This case never +// happens during single point multiplication, so there is no timing leak for +// ECDH or ECDSA signing. +static void point_add(fe x3, fe y3, fe z3, const fe x1, + const fe y1, const fe z1, const int mixed, + const fe x2, const fe y2, const fe z2) { + fe x_out, y_out, z_out; + limb_t z1nz = fe_nz(z1); + limb_t z2nz = fe_nz(z2); + + // z1z1 = z1z1 = z1**2 + fe z1z1; fe_sqr(z1z1, z1); + + fe u1, s1, two_z1z2; + if (!mixed) { + // z2z2 = z2**2 + fe z2z2; fe_sqr(z2z2, z2); + + // u1 = x1*z2z2 + fe_mul(u1, x1, z2z2); + + // two_z1z2 = (z1 + z2)**2 - (z1z1 + z2z2) = 2z1z2 + fe_add(two_z1z2, z1, z2); + fe_sqr(two_z1z2, two_z1z2); + fe_sub(two_z1z2, two_z1z2, z1z1); + fe_sub(two_z1z2, two_z1z2, z2z2); + + // s1 = y1 * z2**3 + fe_mul(s1, z2, z2z2); + fe_mul(s1, s1, y1); + } else { + // We'll assume z2 = 1 (special case z2 = 0 is handled later). + + // u1 = x1*z2z2 + fe_copy(u1, x1); + // two_z1z2 = 2z1z2 + fe_add(two_z1z2, z1, z1); + // s1 = y1 * z2**3 + fe_copy(s1, y1); + } + + // u2 = x2*z1z1 + fe u2; fe_mul(u2, x2, z1z1); + + // h = u2 - u1 + fe h; fe_sub(h, u2, u1); + + limb_t xneq = fe_nz(h); + + // z_out = two_z1z2 * h + fe_mul(z_out, h, two_z1z2); + + // z1z1z1 = z1 * z1z1 + fe z1z1z1; fe_mul(z1z1z1, z1, z1z1); + + // s2 = y2 * z1**3 + fe s2; fe_mul(s2, y2, z1z1z1); + + // r = (s2 - s1)*2 + fe r; + fe_sub(r, s2, s1); + fe_add(r, r, r); + + limb_t yneq = fe_nz(r); + + limb_t is_nontrivial_double = constant_time_is_zero_w(xneq | yneq) & + ~constant_time_is_zero_w(z1nz) & + ~constant_time_is_zero_w(z2nz); + if (is_nontrivial_double) { + point_double(x3, y3, z3, x1, y1, z1); + return; + } + + // I = (2h)**2 + fe i; + fe_add(i, h, h); + fe_sqr(i, i); + + // J = h * I + fe j; fe_mul(j, h, i); + + // V = U1 * I + fe v; fe_mul(v, u1, i); + + // x_out = r**2 - J - 2V + fe_sqr(x_out, r); + fe_sub(x_out, x_out, j); + fe_sub(x_out, x_out, v); + fe_sub(x_out, x_out, v); + + // y_out = r(V-x_out) - 2 * s1 * J + fe_sub(y_out, v, x_out); + fe_mul(y_out, y_out, r); + fe s1j; + fe_mul(s1j, s1, j); + fe_sub(y_out, y_out, s1j); + fe_sub(y_out, y_out, s1j); + + fe_cmovznz(x_out, z1nz, x2, x_out); + fe_cmovznz(x3, z2nz, x1, x_out); + fe_cmovznz(y_out, z1nz, y2, y_out); + fe_cmovznz(y3, z2nz, y1, y_out); + fe_cmovznz(z_out, z1nz, z2, z_out); + fe_cmovznz(z3, z2nz, z1, z_out); +} + +// Base point pre computation +// -------------------------- +// +// Two different sorts of precomputed tables are used in the following code. +// Each contain various points on the curve, where each point is three field +// elements (x, y, z). +// +// For the base point table, z is usually 1 (0 for the point at infinity). +// This table has 2 * 16 elements, starting with the following: +// index | bits | point +// ------+---------+------------------------------ +// 0 | 0 0 0 0 | 0G +// 1 | 0 0 0 1 | 1G +// 2 | 0 0 1 0 | 2^64G +// 3 | 0 0 1 1 | (2^64 + 1)G +// 4 | 0 1 0 0 | 2^128G +// 5 | 0 1 0 1 | (2^128 + 1)G +// 6 | 0 1 1 0 | (2^128 + 2^64)G +// 7 | 0 1 1 1 | (2^128 + 2^64 + 1)G +// 8 | 1 0 0 0 | 2^192G +// 9 | 1 0 0 1 | (2^192 + 1)G +// 10 | 1 0 1 0 | (2^192 + 2^64)G +// 11 | 1 0 1 1 | (2^192 + 2^64 + 1)G +// 12 | 1 1 0 0 | (2^192 + 2^128)G +// 13 | 1 1 0 1 | (2^192 + 2^128 + 1)G +// 14 | 1 1 1 0 | (2^192 + 2^128 + 2^64)G +// 15 | 1 1 1 1 | (2^192 + 2^128 + 2^64 + 1)G +// followed by a copy of this with each element multiplied by 2^32. +// +// The reason for this is so that we can clock bits into four different +// locations when doing simple scalar multiplies against the base point, +// and then another four locations using the second 16 elements. +// +// Tables for other points have table[i] = iG for i in 0 .. 16. + +// g_pre_comp is the table of precomputed base points +#if defined(BORINGSSL_NISTP256_64BIT) +static const fe g_pre_comp[2][16][3] = { + {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, + {{0x79e730d418a9143c, 0x75ba95fc5fedb601, 0x79fb732b77622510, + 0x18905f76a53755c6}, + {0xddf25357ce95560a, 0x8b4ab8e4ba19e45c, 0xd2e88688dd21f325, + 0x8571ff1825885d85}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x4f922fc516a0d2bb, 0xd5cc16c1a623499, 0x9241cf3a57c62c8b, + 0x2f5e6961fd1b667f}, + {0x5c15c70bf5a01797, 0x3d20b44d60956192, 0x4911b37071fdb52, + 0xf648f9168d6f0f7b}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x9e566847e137bbbc, 0xe434469e8a6a0bec, 0xb1c4276179d73463, + 0x5abe0285133d0015}, + {0x92aa837cc04c7dab, 0x573d9f4c43260c07, 0xc93156278e6cc37, + 0x94bb725b6b6f7383}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x62a8c244bfe20925, 0x91c19ac38fdce867, 0x5a96a5d5dd387063, + 0x61d587d421d324f6}, + {0xe87673a2a37173ea, 0x2384800853778b65, 0x10f8441e05bab43e, + 0xfa11fe124621efbe}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x1c891f2b2cb19ffd, 0x1ba8d5bb1923c23, 0xb6d03d678ac5ca8e, + 0x586eb04c1f13bedc}, + {0xc35c6e527e8ed09, 0x1e81a33c1819ede2, 0x278fd6c056c652fa, + 0x19d5ac0870864f11}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x62577734d2b533d5, 0x673b8af6a1bdddc0, 0x577e7c9aa79ec293, + 0xbb6de651c3b266b1}, + {0xe7e9303ab65259b3, 0xd6a0afd3d03a7480, 0xc5ac83d19b3cfc27, + 0x60b4619a5d18b99b}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xbd6a38e11ae5aa1c, 0xb8b7652b49e73658, 0xb130014ee5f87ed, + 0x9d0f27b2aeebffcd}, + {0xca9246317a730a55, 0x9c955b2fddbbc83a, 0x7c1dfe0ac019a71, + 0x244a566d356ec48d}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x56f8410ef4f8b16a, 0x97241afec47b266a, 0xa406b8e6d9c87c1, + 0x803f3e02cd42ab1b}, + {0x7f0309a804dbec69, 0xa83b85f73bbad05f, 0xc6097273ad8e197f, + 0xc097440e5067adc1}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x846a56f2c379ab34, 0xa8ee068b841df8d1, 0x20314459176c68ef, + 0xf1af32d5915f1f30}, + {0x99c375315d75bd50, 0x837cffbaf72f67bc, 0x613a41848d7723f, + 0x23d0f130e2d41c8b}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xed93e225d5be5a2b, 0x6fe799835934f3c6, 0x4314092622626ffc, + 0x50bbb4d97990216a}, + {0x378191c6e57ec63e, 0x65422c40181dcdb2, 0x41a8099b0236e0f6, + 0x2b10011801fe49c3}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xfc68b5c59b391593, 0xc385f5a2598270fc, 0x7144f3aad19adcbb, + 0xdd55899983fbae0c}, + {0x93b88b8e74b82ff4, 0xd2e03c4071e734c9, 0x9a7a9eaf43c0322a, + 0xe6e4c551149d6041}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x5fe14bfe80ec21fe, 0xf6ce116ac255be82, 0x98bc5a072f4a5d67, + 0xfad27148db7e63af}, + {0x90c0b6ac29ab05b3, 0x37a9a83c4e251ae6, 0xa7dc875c2aade7d, + 0x77387de39f0e1a84}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x1e9ecc49a56c0dd7, 0xa5cffcd846086c74, 0x8f7a1408f505aece, + 0xb37b85c0bef0c47e}, + {0x3596b6e4cc0e6a8f, 0xfd6d4bbf6b388f23, 0xaba453fac39cef4e, + 0x9c135ac8f9f628d5}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xa1c729495c8f8be, 0x2961c4803bf362bf, 0x9e418403df63d4ac, + 0xc109f9cb91ece900}, + {0xc2d095d058945705, 0xb9083d96ddeb85c0, 0x84692b8d7a40449b, + 0x9bc3344f2eee1ee1}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xd5ae35642913074, 0x55491b2748a542b1, 0x469ca665b310732a, + 0x29591d525f1a4cc1}, + {0xe76f5b6bb84f983f, 0xbe7eef419f5f84e1, 0x1200d49680baa189, + 0x6376551f18ef332c}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}, + {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, + {{0x202886024147519a, 0xd0981eac26b372f0, 0xa9d4a7caa785ebc8, + 0xd953c50ddbdf58e9}, + {0x9d6361ccfd590f8f, 0x72e9626b44e6c917, 0x7fd9611022eb64cf, + 0x863ebb7e9eb288f3}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x4fe7ee31b0e63d34, 0xf4600572a9e54fab, 0xc0493334d5e7b5a4, + 0x8589fb9206d54831}, + {0xaa70f5cc6583553a, 0x879094ae25649e5, 0xcc90450710044652, + 0xebb0696d02541c4f}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xabbaa0c03b89da99, 0xa6f2d79eb8284022, 0x27847862b81c05e8, + 0x337a4b5905e54d63}, + {0x3c67500d21f7794a, 0x207005b77d6d7f61, 0xa5a378104cfd6e8, + 0xd65e0d5f4c2fbd6}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xd433e50f6d3549cf, 0x6f33696ffacd665e, 0x695bfdacce11fcb4, + 0x810ee252af7c9860}, + {0x65450fe17159bb2c, 0xf7dfbebe758b357b, 0x2b057e74d69fea72, + 0xd485717a92731745}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xce1f69bbe83f7669, 0x9f8ae8272877d6b, 0x9548ae543244278d, + 0x207755dee3c2c19c}, + {0x87bd61d96fef1945, 0x18813cefb12d28c3, 0x9fbcd1d672df64aa, + 0x48dc5ee57154b00d}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xef0f469ef49a3154, 0x3e85a5956e2b2e9a, 0x45aaec1eaa924a9c, + 0xaa12dfc8a09e4719}, + {0x26f272274df69f1d, 0xe0e4c82ca2ff5e73, 0xb9d8ce73b7a9dd44, + 0x6c036e73e48ca901}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xe1e421e1a47153f0, 0xb86c3b79920418c9, 0x93bdce87705d7672, + 0xf25ae793cab79a77}, + {0x1f3194a36d869d0c, 0x9d55c8824986c264, 0x49fb5ea3096e945e, + 0x39b8e65313db0a3e}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xe3417bc035d0b34a, 0x440b386b8327c0a7, 0x8fb7262dac0362d1, + 0x2c41114ce0cdf943}, + {0x2ba5cef1ad95a0b1, 0xc09b37a867d54362, 0x26d6cdd201e486c9, + 0x20477abf42ff9297}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xf121b41bc0a67d2, 0x62d4760a444d248a, 0xe044f1d659b4737, + 0x8fde365250bb4a8}, + {0xaceec3da848bf287, 0xc2a62182d3369d6e, 0x3582dfdc92449482, + 0x2f7e2fd2565d6cd7}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xa0122b5178a876b, 0x51ff96ff085104b4, 0x50b31ab14f29f76, + 0x84abb28b5f87d4e6}, + {0xd5ed439f8270790a, 0x2d6cb59d85e3f46b, 0x75f55c1b6c1e2212, + 0xe5436f6717655640}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xc2965ecc9aeb596d, 0x1ea03e7023c92b4, 0x4704b4b62e013961, + 0xca8fd3f905ea367}, + {0x92523a42551b2b61, 0x1eb7a89c390fcd06, 0xe7f1d2be0392a63e, + 0x96dca2644ddb0c33}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x231c210e15339848, 0xe87a28e870778c8d, 0x9d1de6616956e170, + 0x4ac3c9382bb09c0b}, + {0x19be05516998987d, 0x8b2376c4ae09f4d6, 0x1de0b7651a3f933d, + 0x380d94c7e39705f4}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x3685954b8c31c31d, 0x68533d005bf21a0c, 0xbd7626e75c79ec9, + 0xca17754742c69d54}, + {0xcc6edafff6d2dbb2, 0xfd0d8cbd174a9d18, 0x875e8793aa4578e8, + 0xa976a7139cab2ce6}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xce37ab11b43ea1db, 0xa7ff1a95259d292, 0x851b02218f84f186, + 0xa7222beadefaad13}, + {0xa2ac78ec2b0a9144, 0x5a024051f2fa59c5, 0x91d1eca56147ce38, + 0xbe94d523bc2ac690}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x2d8daefd79ec1a0f, 0x3bbcd6fdceb39c97, 0xf5575ffc58f61a95, + 0xdbd986c4adf7b420}, + {0x81aa881415f39eb7, 0x6ee2fcf5b98d976c, 0x5465475dcf2f717d, + 0x8e24d3c46860bbd0}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}}; +#else +static const fe g_pre_comp[2][16][3] = { + {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, + {{0x18a9143c,0x79e730d4, 0x5fedb601,0x75ba95fc, 0x77622510,0x79fb732b, + 0xa53755c6,0x18905f76}, + {0xce95560a,0xddf25357, 0xba19e45c,0x8b4ab8e4, 0xdd21f325,0xd2e88688, + 0x25885d85,0x8571ff18}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x16a0d2bb,0x4f922fc5, 0x1a623499,0xd5cc16c, 0x57c62c8b,0x9241cf3a, + 0xfd1b667f,0x2f5e6961}, + {0xf5a01797,0x5c15c70b, 0x60956192,0x3d20b44d, 0x71fdb52,0x4911b37, + 0x8d6f0f7b,0xf648f916}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xe137bbbc,0x9e566847, 0x8a6a0bec,0xe434469e, 0x79d73463,0xb1c42761, + 0x133d0015,0x5abe0285}, + {0xc04c7dab,0x92aa837c, 0x43260c07,0x573d9f4c, 0x78e6cc37,0xc931562, + 0x6b6f7383,0x94bb725b}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xbfe20925,0x62a8c244, 0x8fdce867,0x91c19ac3, 0xdd387063,0x5a96a5d5, + 0x21d324f6,0x61d587d4}, + {0xa37173ea,0xe87673a2, 0x53778b65,0x23848008, 0x5bab43e,0x10f8441e, + 0x4621efbe,0xfa11fe12}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x2cb19ffd,0x1c891f2b, 0xb1923c23,0x1ba8d5b, 0x8ac5ca8e,0xb6d03d67, + 0x1f13bedc,0x586eb04c}, + {0x27e8ed09,0xc35c6e5, 0x1819ede2,0x1e81a33c, 0x56c652fa,0x278fd6c0, + 0x70864f11,0x19d5ac08}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xd2b533d5,0x62577734, 0xa1bdddc0,0x673b8af6, 0xa79ec293,0x577e7c9a, + 0xc3b266b1,0xbb6de651}, + {0xb65259b3,0xe7e9303a, 0xd03a7480,0xd6a0afd3, 0x9b3cfc27,0xc5ac83d1, + 0x5d18b99b,0x60b4619a}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x1ae5aa1c,0xbd6a38e1, 0x49e73658,0xb8b7652b, 0xee5f87ed,0xb130014, + 0xaeebffcd,0x9d0f27b2}, + {0x7a730a55,0xca924631, 0xddbbc83a,0x9c955b2f, 0xac019a71,0x7c1dfe0, + 0x356ec48d,0x244a566d}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xf4f8b16a,0x56f8410e, 0xc47b266a,0x97241afe, 0x6d9c87c1,0xa406b8e, + 0xcd42ab1b,0x803f3e02}, + {0x4dbec69,0x7f0309a8, 0x3bbad05f,0xa83b85f7, 0xad8e197f,0xc6097273, + 0x5067adc1,0xc097440e}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xc379ab34,0x846a56f2, 0x841df8d1,0xa8ee068b, 0x176c68ef,0x20314459, + 0x915f1f30,0xf1af32d5}, + {0x5d75bd50,0x99c37531, 0xf72f67bc,0x837cffba, 0x48d7723f,0x613a418, + 0xe2d41c8b,0x23d0f130}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xd5be5a2b,0xed93e225, 0x5934f3c6,0x6fe79983, 0x22626ffc,0x43140926, + 0x7990216a,0x50bbb4d9}, + {0xe57ec63e,0x378191c6, 0x181dcdb2,0x65422c40, 0x236e0f6,0x41a8099b, + 0x1fe49c3,0x2b100118}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x9b391593,0xfc68b5c5, 0x598270fc,0xc385f5a2, 0xd19adcbb,0x7144f3aa, + 0x83fbae0c,0xdd558999}, + {0x74b82ff4,0x93b88b8e, 0x71e734c9,0xd2e03c40, 0x43c0322a,0x9a7a9eaf, + 0x149d6041,0xe6e4c551}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x80ec21fe,0x5fe14bfe, 0xc255be82,0xf6ce116a, 0x2f4a5d67,0x98bc5a07, + 0xdb7e63af,0xfad27148}, + {0x29ab05b3,0x90c0b6ac, 0x4e251ae6,0x37a9a83c, 0xc2aade7d,0xa7dc875, + 0x9f0e1a84,0x77387de3}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xa56c0dd7,0x1e9ecc49, 0x46086c74,0xa5cffcd8, 0xf505aece,0x8f7a1408, + 0xbef0c47e,0xb37b85c0}, + {0xcc0e6a8f,0x3596b6e4, 0x6b388f23,0xfd6d4bbf, 0xc39cef4e,0xaba453fa, + 0xf9f628d5,0x9c135ac8}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x95c8f8be,0xa1c7294, 0x3bf362bf,0x2961c480, 0xdf63d4ac,0x9e418403, + 0x91ece900,0xc109f9cb}, + {0x58945705,0xc2d095d0, 0xddeb85c0,0xb9083d96, 0x7a40449b,0x84692b8d, + 0x2eee1ee1,0x9bc3344f}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x42913074,0xd5ae356, 0x48a542b1,0x55491b27, 0xb310732a,0x469ca665, + 0x5f1a4cc1,0x29591d52}, + {0xb84f983f,0xe76f5b6b, 0x9f5f84e1,0xbe7eef41, 0x80baa189,0x1200d496, + 0x18ef332c,0x6376551f}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}, + {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, + {{0x4147519a,0x20288602, 0x26b372f0,0xd0981eac, 0xa785ebc8,0xa9d4a7ca, + 0xdbdf58e9,0xd953c50d}, + {0xfd590f8f,0x9d6361cc, 0x44e6c917,0x72e9626b, 0x22eb64cf,0x7fd96110, + 0x9eb288f3,0x863ebb7e}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xb0e63d34,0x4fe7ee31, 0xa9e54fab,0xf4600572, 0xd5e7b5a4,0xc0493334, + 0x6d54831,0x8589fb92}, + {0x6583553a,0xaa70f5cc, 0xe25649e5,0x879094a, 0x10044652,0xcc904507, + 0x2541c4f,0xebb0696d}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x3b89da99,0xabbaa0c0, 0xb8284022,0xa6f2d79e, 0xb81c05e8,0x27847862, + 0x5e54d63,0x337a4b59}, + {0x21f7794a,0x3c67500d, 0x7d6d7f61,0x207005b7, 0x4cfd6e8,0xa5a3781, + 0xf4c2fbd6,0xd65e0d5}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x6d3549cf,0xd433e50f, 0xfacd665e,0x6f33696f, 0xce11fcb4,0x695bfdac, + 0xaf7c9860,0x810ee252}, + {0x7159bb2c,0x65450fe1, 0x758b357b,0xf7dfbebe, 0xd69fea72,0x2b057e74, + 0x92731745,0xd485717a}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xe83f7669,0xce1f69bb, 0x72877d6b,0x9f8ae82, 0x3244278d,0x9548ae54, + 0xe3c2c19c,0x207755de}, + {0x6fef1945,0x87bd61d9, 0xb12d28c3,0x18813cef, 0x72df64aa,0x9fbcd1d6, + 0x7154b00d,0x48dc5ee5}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xf49a3154,0xef0f469e, 0x6e2b2e9a,0x3e85a595, 0xaa924a9c,0x45aaec1e, + 0xa09e4719,0xaa12dfc8}, + {0x4df69f1d,0x26f27227, 0xa2ff5e73,0xe0e4c82c, 0xb7a9dd44,0xb9d8ce73, + 0xe48ca901,0x6c036e73}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xa47153f0,0xe1e421e1, 0x920418c9,0xb86c3b79, 0x705d7672,0x93bdce87, + 0xcab79a77,0xf25ae793}, + {0x6d869d0c,0x1f3194a3, 0x4986c264,0x9d55c882, 0x96e945e,0x49fb5ea3, + 0x13db0a3e,0x39b8e653}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x35d0b34a,0xe3417bc0, 0x8327c0a7,0x440b386b, 0xac0362d1,0x8fb7262d, + 0xe0cdf943,0x2c41114c}, + {0xad95a0b1,0x2ba5cef1, 0x67d54362,0xc09b37a8, 0x1e486c9,0x26d6cdd2, + 0x42ff9297,0x20477abf}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xbc0a67d2,0xf121b41, 0x444d248a,0x62d4760a, 0x659b4737,0xe044f1d, + 0x250bb4a8,0x8fde365}, + {0x848bf287,0xaceec3da, 0xd3369d6e,0xc2a62182, 0x92449482,0x3582dfdc, + 0x565d6cd7,0x2f7e2fd2}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x178a876b,0xa0122b5, 0x85104b4,0x51ff96ff, 0x14f29f76,0x50b31ab, + 0x5f87d4e6,0x84abb28b}, + {0x8270790a,0xd5ed439f, 0x85e3f46b,0x2d6cb59d, 0x6c1e2212,0x75f55c1b, + 0x17655640,0xe5436f67}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x9aeb596d,0xc2965ecc, 0x23c92b4,0x1ea03e7, 0x2e013961,0x4704b4b6, + 0x905ea367,0xca8fd3f}, + {0x551b2b61,0x92523a42, 0x390fcd06,0x1eb7a89c, 0x392a63e,0xe7f1d2be, + 0x4ddb0c33,0x96dca264}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x15339848,0x231c210e, 0x70778c8d,0xe87a28e8, 0x6956e170,0x9d1de661, + 0x2bb09c0b,0x4ac3c938}, + {0x6998987d,0x19be0551, 0xae09f4d6,0x8b2376c4, 0x1a3f933d,0x1de0b765, + 0xe39705f4,0x380d94c7}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x8c31c31d,0x3685954b, 0x5bf21a0c,0x68533d00, 0x75c79ec9,0xbd7626e, + 0x42c69d54,0xca177547}, + {0xf6d2dbb2,0xcc6edaff, 0x174a9d18,0xfd0d8cbd, 0xaa4578e8,0x875e8793, + 0x9cab2ce6,0xa976a713}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xb43ea1db,0xce37ab11, 0x5259d292,0xa7ff1a9, 0x8f84f186,0x851b0221, + 0xdefaad13,0xa7222bea}, + {0x2b0a9144,0xa2ac78ec, 0xf2fa59c5,0x5a024051, 0x6147ce38,0x91d1eca5, + 0xbc2ac690,0xbe94d523}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x79ec1a0f,0x2d8daefd, 0xceb39c97,0x3bbcd6fd, 0x58f61a95,0xf5575ffc, + 0xadf7b420,0xdbd986c4}, + {0x15f39eb7,0x81aa8814, 0xb98d976c,0x6ee2fcf5, 0xcf2f717d,0x5465475d, + 0x6860bbd0,0x8e24d3c4}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}}; +#endif + +// select_point selects the |idx|th point from a precomputation table and +// copies it to out. +static void select_point(const limb_t idx, size_t size, + const fe pre_comp[/*size*/][3], + fe out[3]) { + OPENSSL_memset(out, 0, sizeof(fe) * 3); + for (size_t i = 0; i < size; i++) { + limb_t mismatch = i ^ idx; + fe_cmovznz(out[0], mismatch, pre_comp[i][0], out[0]); + fe_cmovznz(out[1], mismatch, pre_comp[i][1], out[1]); + fe_cmovznz(out[2], mismatch, pre_comp[i][2], out[2]); + } +} + +// get_bit returns the |i|th bit in |in| +static char get_bit(const uint8_t *in, int i) { + if (i < 0 || i >= 256) { + return 0; + } + return (in[i >> 3] >> (i & 7)) & 1; +} + +// OPENSSL EC_METHOD FUNCTIONS + +// Takes the Jacobian coordinates (X, Y, Z) of a point and returns (X', Y') = +// (X/Z^2, Y/Z^3). +static int ec_GFp_nistp256_point_get_affine_coordinates( + const EC_GROUP *group, const EC_RAW_POINT *point, EC_FELEM *x_out, + EC_FELEM *y_out) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + fe z1, z2; + fe_from_generic(z1, &point->Z); + fe_inv(z2, z1); + fe_sqr(z1, z2); + + // Instead of using |fe_from_montgomery| to convert the |x| coordinate and + // then calling |fe_from_montgomery| again to convert the |y| coordinate + // below, convert the common factor |z1| once now, saving one reduction. + fe_from_montgomery(z1); + + if (x_out != NULL) { + fe x; + fe_from_generic(x, &point->X); + fe_mul(x, x, z1); + fe_to_generic(x_out, x); + } + + if (y_out != NULL) { + fe y; + fe_from_generic(y, &point->Y); + fe_mul(z1, z1, z2); + fe_mul(y, y, z1); + fe_to_generic(y_out, y); + } + + return 1; +} + +static void ec_GFp_nistp256_add(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a, const EC_RAW_POINT *b) { + fe x1, y1, z1, x2, y2, z2; + fe_from_generic(x1, &a->X); + fe_from_generic(y1, &a->Y); + fe_from_generic(z1, &a->Z); + fe_from_generic(x2, &b->X); + fe_from_generic(y2, &b->Y); + fe_from_generic(z2, &b->Z); + point_add(x1, y1, z1, x1, y1, z1, 0 /* both Jacobian */, x2, y2, z2); + fe_to_generic(&r->X, x1); + fe_to_generic(&r->Y, y1); + fe_to_generic(&r->Z, z1); +} + +static void ec_GFp_nistp256_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a) { + fe x, y, z; + fe_from_generic(x, &a->X); + fe_from_generic(y, &a->Y); + fe_from_generic(z, &a->Z); + point_double(x, y, z, x, y, z); + fe_to_generic(&r->X, x); + fe_to_generic(&r->Y, y); + fe_to_generic(&r->Z, z); +} + +static void ec_GFp_nistp256_point_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *scalar) { + fe p_pre_comp[17][3]; + OPENSSL_memset(&p_pre_comp, 0, sizeof(p_pre_comp)); + // Precompute multiples. + fe_from_generic(p_pre_comp[1][0], &p->X); + fe_from_generic(p_pre_comp[1][1], &p->Y); + fe_from_generic(p_pre_comp[1][2], &p->Z); + for (size_t j = 2; j <= 16; ++j) { + if (j & 1) { + point_add(p_pre_comp[j][0], p_pre_comp[j][1], p_pre_comp[j][2], + p_pre_comp[1][0], p_pre_comp[1][1], p_pre_comp[1][2], 0, + p_pre_comp[j - 1][0], p_pre_comp[j - 1][1], + p_pre_comp[j - 1][2]); + } else { + point_double(p_pre_comp[j][0], p_pre_comp[j][1], p_pre_comp[j][2], + p_pre_comp[j / 2][0], p_pre_comp[j / 2][1], + p_pre_comp[j / 2][2]); + } + } + + // Set nq to the point at infinity. + fe nq[3] = {{0}, {0}, {0}}, ftmp, tmp[3]; + + // Loop over |scalar| msb-to-lsb, incorporating |p_pre_comp| every 5th round. + int skip = 1; // Save two point operations in the first round. + for (size_t i = 255; i < 256; i--) { + // double + if (!skip) { + point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + } + + // do other additions every 5 doublings + if (i % 5 == 0) { + uint64_t bits = get_bit(scalar->bytes, i + 4) << 5; + bits |= get_bit(scalar->bytes, i + 3) << 4; + bits |= get_bit(scalar->bytes, i + 2) << 3; + bits |= get_bit(scalar->bytes, i + 1) << 2; + bits |= get_bit(scalar->bytes, i) << 1; + bits |= get_bit(scalar->bytes, i - 1); + uint8_t sign, digit; + ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); + + // select the point to add or subtract, in constant time. + select_point(digit, 17, (const fe(*)[3])p_pre_comp, tmp); + fe_opp(ftmp, tmp[1]); // (X, -Y, Z) is the negative point. + fe_cmovznz(tmp[1], sign, tmp[1], ftmp); + + if (!skip) { + point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, + tmp[0], tmp[1], tmp[2]); + } else { + fe_copy(nq[0], tmp[0]); + fe_copy(nq[1], tmp[1]); + fe_copy(nq[2], tmp[2]); + skip = 0; + } + } + } + + fe_to_generic(&r->X, nq[0]); + fe_to_generic(&r->Y, nq[1]); + fe_to_generic(&r->Z, nq[2]); +} + +static void ec_GFp_nistp256_point_mul_base(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + // Set nq to the point at infinity. + fe nq[3] = {{0}, {0}, {0}}, tmp[3]; + + int skip = 1; // Save two point operations in the first round. + for (size_t i = 31; i < 32; i--) { + if (!skip) { + point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + } + + // First, look 32 bits upwards. + uint64_t bits = get_bit(scalar->bytes, i + 224) << 3; + bits |= get_bit(scalar->bytes, i + 160) << 2; + bits |= get_bit(scalar->bytes, i + 96) << 1; + bits |= get_bit(scalar->bytes, i + 32); + // Select the point to add, in constant time. + select_point(bits, 16, g_pre_comp[1], tmp); + + if (!skip) { + point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, tmp[0], + tmp[1], tmp[2]); + } else { + fe_copy(nq[0], tmp[0]); + fe_copy(nq[1], tmp[1]); + fe_copy(nq[2], tmp[2]); + skip = 0; + } + + // Second, look at the current position. + bits = get_bit(scalar->bytes, i + 192) << 3; + bits |= get_bit(scalar->bytes, i + 128) << 2; + bits |= get_bit(scalar->bytes, i + 64) << 1; + bits |= get_bit(scalar->bytes, i); + // Select the point to add, in constant time. + select_point(bits, 16, g_pre_comp[0], tmp); + point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, tmp[0], + tmp[1], tmp[2]); + } + + fe_to_generic(&r->X, nq[0]); + fe_to_generic(&r->Y, nq[1]); + fe_to_generic(&r->Z, nq[2]); +} + +static void ec_GFp_nistp256_point_mul_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { +#define P256_WSIZE_PUBLIC 4 + // Precompute multiples of |p|. p_pre_comp[i] is (2*i+1) * |p|. + fe p_pre_comp[1 << (P256_WSIZE_PUBLIC-1)][3]; + fe_from_generic(p_pre_comp[0][0], &p->X); + fe_from_generic(p_pre_comp[0][1], &p->Y); + fe_from_generic(p_pre_comp[0][2], &p->Z); + fe p2[3]; + point_double(p2[0], p2[1], p2[2], p_pre_comp[0][0], p_pre_comp[0][1], + p_pre_comp[0][2]); + for (size_t i = 1; i < OPENSSL_ARRAY_SIZE(p_pre_comp); i++) { + point_add(p_pre_comp[i][0], p_pre_comp[i][1], p_pre_comp[i][2], + p_pre_comp[i - 1][0], p_pre_comp[i - 1][1], p_pre_comp[i - 1][2], + 0 /* not mixed */, p2[0], p2[1], p2[2]); + } + + // Set up the coefficients for |p_scalar|. + int8_t p_wNAF[257]; + ec_compute_wNAF(group, p_wNAF, p_scalar, 256, P256_WSIZE_PUBLIC); + + // Set |ret| to the point at infinity. + int skip = 1; // Save some point operations. + fe ret[3] = {{0},{0},{0}}; + for (int i = 256; i >= 0; i--) { + if (!skip) { + point_double(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2]); + } + + // For the |g_scalar|, we use the precomputed table without the + // constant-time lookup. + if (i <= 31) { + // First, look 32 bits upwards. + uint64_t bits = get_bit(g_scalar->bytes, i + 224) << 3; + bits |= get_bit(g_scalar->bytes, i + 160) << 2; + bits |= get_bit(g_scalar->bytes, i + 96) << 1; + bits |= get_bit(g_scalar->bytes, i + 32); + point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, + g_pre_comp[1][bits][0], g_pre_comp[1][bits][1], + g_pre_comp[1][bits][2]); + skip = 0; + + // Second, look at the current position. + bits = get_bit(g_scalar->bytes, i + 192) << 3; + bits |= get_bit(g_scalar->bytes, i + 128) << 2; + bits |= get_bit(g_scalar->bytes, i + 64) << 1; + bits |= get_bit(g_scalar->bytes, i); + point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, + g_pre_comp[0][bits][0], g_pre_comp[0][bits][1], + g_pre_comp[0][bits][2]); + } + + int digit = p_wNAF[i]; + if (digit != 0) { + assert(digit & 1); + int idx = digit < 0 ? (-digit) >> 1 : digit >> 1; + fe *y = &p_pre_comp[idx][1], tmp; + if (digit < 0) { + fe_opp(tmp, p_pre_comp[idx][1]); + y = &tmp; + } + if (!skip) { + point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], + 0 /* not mixed */, p_pre_comp[idx][0], *y, p_pre_comp[idx][2]); + } else { + fe_copy(ret[0], p_pre_comp[idx][0]); + fe_copy(ret[1], *y); + fe_copy(ret[2], p_pre_comp[idx][2]); + skip = 0; + } + } + } + + fe_to_generic(&r->X, ret[0]); + fe_to_generic(&r->Y, ret[1]); + fe_to_generic(&r->Z, ret[2]); +} + +static int ec_GFp_nistp256_cmp_x_coordinate(const EC_GROUP *group, + const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (ec_GFp_simple_is_at_infinity(group, p)) { + return 0; + } + + // We wish to compare X/Z^2 with r. This is equivalent to comparing X with + // r*Z^2. Note that X and Z are represented in Montgomery form, while r is + // not. + fe Z2_mont; + fe_from_generic(Z2_mont, &p->Z); + fe_mul(Z2_mont, Z2_mont, Z2_mont); + + fe r_Z2; + fe_frombytes(r_Z2, r->bytes); // r < order < p, so this is valid. + fe_mul(r_Z2, r_Z2, Z2_mont); + + fe X; + fe_from_generic(X, &p->X); + fe_from_montgomery(X); + + if (OPENSSL_memcmp(&r_Z2, &X, sizeof(r_Z2)) == 0) { + return 1; + } + + // During signing the x coefficient is reduced modulo the group order. + // Therefore there is a small possibility, less than 1/2^128, that group_order + // < p.x < P. in that case we need not only to compare against |r| but also to + // compare against r+group_order. + assert(group->field.width == group->order.width); + if (bn_less_than_words(r->words, group->field_minus_order.words, + group->field.width)) { + // We can ignore the carry because: r + group_order < p < 2^256. + EC_FELEM tmp; + bn_add_words(tmp.words, r->words, group->order.d, group->order.width); + fe_from_generic(r_Z2, &tmp); + fe_mul(r_Z2, r_Z2, Z2_mont); + if (OPENSSL_memcmp(&r_Z2, &X, sizeof(r_Z2)) == 0) { + return 1; + } + } + + return 0; +} + +DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp256_method) { + out->group_init = ec_GFp_mont_group_init; + out->group_finish = ec_GFp_mont_group_finish; + out->group_set_curve = ec_GFp_mont_group_set_curve; + out->point_get_affine_coordinates = + ec_GFp_nistp256_point_get_affine_coordinates; + out->add = ec_GFp_nistp256_add; + out->dbl = ec_GFp_nistp256_dbl; + out->mul = ec_GFp_nistp256_point_mul; + out->mul_base = ec_GFp_nistp256_point_mul_base; + out->mul_public = ec_GFp_nistp256_point_mul_public; + out->felem_mul = ec_GFp_mont_felem_mul; + out->felem_sqr = ec_GFp_mont_felem_sqr; + out->bignum_to_felem = ec_GFp_mont_bignum_to_felem; + out->felem_to_bignum = ec_GFp_mont_felem_to_bignum; + out->scalar_inv_montgomery = ec_simple_scalar_inv_montgomery; + out->scalar_inv_montgomery_vartime = ec_GFp_simple_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ec_GFp_nistp256_cmp_x_coordinate; +} + +#undef BORINGSSL_NISTP256_64BIT diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c.grpc_back new file mode 100644 index 000000000..23ec71f98 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256.c.grpc_back @@ -0,0 +1,1063 @@ +// The MIT License (MIT) +// +// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// The field arithmetic code is generated by Fiat +// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. +// +// An implementation of the NIST P-256 elliptic curve point multiplication. +// 256-bit Montgomery form, generated using fiat-crypto, for 64 and 32-bit. +// Field operations with inputs in [0,p) return outputs in [0,p). + +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "../../crypto/fipsmodule/delocate.h" +#include "../../crypto/fipsmodule/ec/internal.h" +#include "../../crypto/internal.h" + + +// MSVC does not implement uint128_t, and crashes with intrinsics +#if defined(BORINGSSL_HAS_UINT128) +#define BORINGSSL_NISTP256_64BIT 1 +#include "p256_64.h" +#else +#include "p256_32.h" +#endif + + +// utility functions, handwritten + +#define NBYTES 32 + +#if defined(BORINGSSL_NISTP256_64BIT) + +#define NLIMBS 4 +typedef uint64_t limb_t; +typedef uint64_t fe[NLIMBS]; +#else // 64BIT; else 32BIT + +#define NLIMBS 8 +typedef uint32_t limb_t; +typedef uint32_t fe[NLIMBS]; + +#endif // 64BIT + +#define fe_add fiat_p256_add +#define fe_sub fiat_p256_sub +#define fe_opp fiat_p256_opp + +#define fe_mul fiat_p256_mul +#define fe_sqr fiat_p256_square + +#define fe_tobytes fiat_p256_to_bytes +#define fe_frombytes fiat_p256_from_bytes + +static limb_t fe_nz(const limb_t in1[NLIMBS]) { + limb_t ret; + fiat_p256_nonzero(&ret, in1); + return ret; +} + +static void fe_copy(limb_t out[NLIMBS], const limb_t in1[NLIMBS]) { + for (int i = 0; i < NLIMBS; i++) { + out[i] = in1[i]; + } +} + +static void fe_cmovznz(limb_t out[NLIMBS], limb_t t, const limb_t z[NLIMBS], + const limb_t nz[NLIMBS]) { + fiat_p256_selectznz(out, !!t, z, nz); +} + +static void fe_from_montgomery(fe x) { + fiat_p256_from_montgomery(x, x); +} + +static void fe_from_generic(fe out, const EC_FELEM *in) { + fe_frombytes(out, in->bytes); +} + +static void fe_to_generic(EC_FELEM *out, const fe in) { + // This works because 256 is a multiple of 64, so there are no excess bytes to + // zero when rounding up to |BN_ULONG|s. + OPENSSL_STATIC_ASSERT( + 256 / 8 == sizeof(BN_ULONG) * ((256 + BN_BITS2 - 1) / BN_BITS2), + "fe_tobytes leaves bytes uninitialized"); + fe_tobytes(out->bytes, in); +} + +// fe_inv calculates |out| = |in|^{-1} +// +// Based on Fermat's Little Theorem: +// a^p = a (mod p) +// a^{p-1} = 1 (mod p) +// a^{p-2} = a^{-1} (mod p) +static void fe_inv(fe out, const fe in) { + fe ftmp, ftmp2; + // each e_I will hold |in|^{2^I - 1} + fe e2, e4, e8, e16, e32, e64; + + fe_sqr(ftmp, in); // 2^1 + fe_mul(ftmp, in, ftmp); // 2^2 - 2^0 + fe_copy(e2, ftmp); + fe_sqr(ftmp, ftmp); // 2^3 - 2^1 + fe_sqr(ftmp, ftmp); // 2^4 - 2^2 + fe_mul(ftmp, ftmp, e2); // 2^4 - 2^0 + fe_copy(e4, ftmp); + fe_sqr(ftmp, ftmp); // 2^5 - 2^1 + fe_sqr(ftmp, ftmp); // 2^6 - 2^2 + fe_sqr(ftmp, ftmp); // 2^7 - 2^3 + fe_sqr(ftmp, ftmp); // 2^8 - 2^4 + fe_mul(ftmp, ftmp, e4); // 2^8 - 2^0 + fe_copy(e8, ftmp); + for (size_t i = 0; i < 8; i++) { + fe_sqr(ftmp, ftmp); + } // 2^16 - 2^8 + fe_mul(ftmp, ftmp, e8); // 2^16 - 2^0 + fe_copy(e16, ftmp); + for (size_t i = 0; i < 16; i++) { + fe_sqr(ftmp, ftmp); + } // 2^32 - 2^16 + fe_mul(ftmp, ftmp, e16); // 2^32 - 2^0 + fe_copy(e32, ftmp); + for (size_t i = 0; i < 32; i++) { + fe_sqr(ftmp, ftmp); + } // 2^64 - 2^32 + fe_copy(e64, ftmp); + fe_mul(ftmp, ftmp, in); // 2^64 - 2^32 + 2^0 + for (size_t i = 0; i < 192; i++) { + fe_sqr(ftmp, ftmp); + } // 2^256 - 2^224 + 2^192 + + fe_mul(ftmp2, e64, e32); // 2^64 - 2^0 + for (size_t i = 0; i < 16; i++) { + fe_sqr(ftmp2, ftmp2); + } // 2^80 - 2^16 + fe_mul(ftmp2, ftmp2, e16); // 2^80 - 2^0 + for (size_t i = 0; i < 8; i++) { + fe_sqr(ftmp2, ftmp2); + } // 2^88 - 2^8 + fe_mul(ftmp2, ftmp2, e8); // 2^88 - 2^0 + for (size_t i = 0; i < 4; i++) { + fe_sqr(ftmp2, ftmp2); + } // 2^92 - 2^4 + fe_mul(ftmp2, ftmp2, e4); // 2^92 - 2^0 + fe_sqr(ftmp2, ftmp2); // 2^93 - 2^1 + fe_sqr(ftmp2, ftmp2); // 2^94 - 2^2 + fe_mul(ftmp2, ftmp2, e2); // 2^94 - 2^0 + fe_sqr(ftmp2, ftmp2); // 2^95 - 2^1 + fe_sqr(ftmp2, ftmp2); // 2^96 - 2^2 + fe_mul(ftmp2, ftmp2, in); // 2^96 - 3 + + fe_mul(out, ftmp2, ftmp); // 2^256 - 2^224 + 2^192 + 2^96 - 3 +} + +// Group operations +// ---------------- +// +// Building on top of the field operations we have the operations on the +// elliptic curve group itself. Points on the curve are represented in Jacobian +// coordinates. +// +// Both operations were transcribed to Coq and proven to correspond to naive +// implementations using Affine coordinates, for all suitable fields. In the +// Coq proofs, issues of constant-time execution and memory layout (aliasing) +// conventions were not considered. Specification of affine coordinates: +// +// As a sanity check, a proof that these points form a commutative group: +// + +// point_double calculates 2*(x_in, y_in, z_in) +// +// The method is taken from: +// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b +// +// Coq transcription and correctness proof: +// +// +// +// Outputs can equal corresponding inputs, i.e., x_out == x_in is allowed. +// while x_out == y_in is not (maybe this works, but it's not tested). +static void point_double(fe x_out, fe y_out, fe z_out, + const fe x_in, const fe y_in, const fe z_in) { + fe delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; + // delta = z^2 + fe_sqr(delta, z_in); + // gamma = y^2 + fe_sqr(gamma, y_in); + // beta = x*gamma + fe_mul(beta, x_in, gamma); + + // alpha = 3*(x-delta)*(x+delta) + fe_sub(ftmp, x_in, delta); + fe_add(ftmp2, x_in, delta); + + fe_add(tmptmp, ftmp2, ftmp2); + fe_add(ftmp2, ftmp2, tmptmp); + fe_mul(alpha, ftmp, ftmp2); + + // x' = alpha^2 - 8*beta + fe_sqr(x_out, alpha); + fe_add(fourbeta, beta, beta); + fe_add(fourbeta, fourbeta, fourbeta); + fe_add(tmptmp, fourbeta, fourbeta); + fe_sub(x_out, x_out, tmptmp); + + // z' = (y + z)^2 - gamma - delta + fe_add(delta, gamma, delta); + fe_add(ftmp, y_in, z_in); + fe_sqr(z_out, ftmp); + fe_sub(z_out, z_out, delta); + + // y' = alpha*(4*beta - x') - 8*gamma^2 + fe_sub(y_out, fourbeta, x_out); + fe_add(gamma, gamma, gamma); + fe_sqr(gamma, gamma); + fe_mul(y_out, alpha, y_out); + fe_add(gamma, gamma, gamma); + fe_sub(y_out, y_out, gamma); +} + +// point_add calcuates (x1, y1, z1) + (x2, y2, z2) +// +// The method is taken from: +// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, +// adapted for mixed addition (z2 = 1, or z2 = 0 for the point at infinity). +// +// Coq transcription and correctness proof: +// +// +// +// This function includes a branch for checking whether the two input points +// are equal, (while not equal to the point at infinity). This case never +// happens during single point multiplication, so there is no timing leak for +// ECDH or ECDSA signing. +static void point_add(fe x3, fe y3, fe z3, const fe x1, + const fe y1, const fe z1, const int mixed, + const fe x2, const fe y2, const fe z2) { + fe x_out, y_out, z_out; + limb_t z1nz = fe_nz(z1); + limb_t z2nz = fe_nz(z2); + + // z1z1 = z1z1 = z1**2 + fe z1z1; fe_sqr(z1z1, z1); + + fe u1, s1, two_z1z2; + if (!mixed) { + // z2z2 = z2**2 + fe z2z2; fe_sqr(z2z2, z2); + + // u1 = x1*z2z2 + fe_mul(u1, x1, z2z2); + + // two_z1z2 = (z1 + z2)**2 - (z1z1 + z2z2) = 2z1z2 + fe_add(two_z1z2, z1, z2); + fe_sqr(two_z1z2, two_z1z2); + fe_sub(two_z1z2, two_z1z2, z1z1); + fe_sub(two_z1z2, two_z1z2, z2z2); + + // s1 = y1 * z2**3 + fe_mul(s1, z2, z2z2); + fe_mul(s1, s1, y1); + } else { + // We'll assume z2 = 1 (special case z2 = 0 is handled later). + + // u1 = x1*z2z2 + fe_copy(u1, x1); + // two_z1z2 = 2z1z2 + fe_add(two_z1z2, z1, z1); + // s1 = y1 * z2**3 + fe_copy(s1, y1); + } + + // u2 = x2*z1z1 + fe u2; fe_mul(u2, x2, z1z1); + + // h = u2 - u1 + fe h; fe_sub(h, u2, u1); + + limb_t xneq = fe_nz(h); + + // z_out = two_z1z2 * h + fe_mul(z_out, h, two_z1z2); + + // z1z1z1 = z1 * z1z1 + fe z1z1z1; fe_mul(z1z1z1, z1, z1z1); + + // s2 = y2 * z1**3 + fe s2; fe_mul(s2, y2, z1z1z1); + + // r = (s2 - s1)*2 + fe r; + fe_sub(r, s2, s1); + fe_add(r, r, r); + + limb_t yneq = fe_nz(r); + + limb_t is_nontrivial_double = constant_time_is_zero_w(xneq | yneq) & + ~constant_time_is_zero_w(z1nz) & + ~constant_time_is_zero_w(z2nz); + if (is_nontrivial_double) { + point_double(x3, y3, z3, x1, y1, z1); + return; + } + + // I = (2h)**2 + fe i; + fe_add(i, h, h); + fe_sqr(i, i); + + // J = h * I + fe j; fe_mul(j, h, i); + + // V = U1 * I + fe v; fe_mul(v, u1, i); + + // x_out = r**2 - J - 2V + fe_sqr(x_out, r); + fe_sub(x_out, x_out, j); + fe_sub(x_out, x_out, v); + fe_sub(x_out, x_out, v); + + // y_out = r(V-x_out) - 2 * s1 * J + fe_sub(y_out, v, x_out); + fe_mul(y_out, y_out, r); + fe s1j; + fe_mul(s1j, s1, j); + fe_sub(y_out, y_out, s1j); + fe_sub(y_out, y_out, s1j); + + fe_cmovznz(x_out, z1nz, x2, x_out); + fe_cmovznz(x3, z2nz, x1, x_out); + fe_cmovznz(y_out, z1nz, y2, y_out); + fe_cmovznz(y3, z2nz, y1, y_out); + fe_cmovznz(z_out, z1nz, z2, z_out); + fe_cmovznz(z3, z2nz, z1, z_out); +} + +// Base point pre computation +// -------------------------- +// +// Two different sorts of precomputed tables are used in the following code. +// Each contain various points on the curve, where each point is three field +// elements (x, y, z). +// +// For the base point table, z is usually 1 (0 for the point at infinity). +// This table has 2 * 16 elements, starting with the following: +// index | bits | point +// ------+---------+------------------------------ +// 0 | 0 0 0 0 | 0G +// 1 | 0 0 0 1 | 1G +// 2 | 0 0 1 0 | 2^64G +// 3 | 0 0 1 1 | (2^64 + 1)G +// 4 | 0 1 0 0 | 2^128G +// 5 | 0 1 0 1 | (2^128 + 1)G +// 6 | 0 1 1 0 | (2^128 + 2^64)G +// 7 | 0 1 1 1 | (2^128 + 2^64 + 1)G +// 8 | 1 0 0 0 | 2^192G +// 9 | 1 0 0 1 | (2^192 + 1)G +// 10 | 1 0 1 0 | (2^192 + 2^64)G +// 11 | 1 0 1 1 | (2^192 + 2^64 + 1)G +// 12 | 1 1 0 0 | (2^192 + 2^128)G +// 13 | 1 1 0 1 | (2^192 + 2^128 + 1)G +// 14 | 1 1 1 0 | (2^192 + 2^128 + 2^64)G +// 15 | 1 1 1 1 | (2^192 + 2^128 + 2^64 + 1)G +// followed by a copy of this with each element multiplied by 2^32. +// +// The reason for this is so that we can clock bits into four different +// locations when doing simple scalar multiplies against the base point, +// and then another four locations using the second 16 elements. +// +// Tables for other points have table[i] = iG for i in 0 .. 16. + +// g_pre_comp is the table of precomputed base points +#if defined(BORINGSSL_NISTP256_64BIT) +static const fe g_pre_comp[2][16][3] = { + {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, + {{0x79e730d418a9143c, 0x75ba95fc5fedb601, 0x79fb732b77622510, + 0x18905f76a53755c6}, + {0xddf25357ce95560a, 0x8b4ab8e4ba19e45c, 0xd2e88688dd21f325, + 0x8571ff1825885d85}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x4f922fc516a0d2bb, 0xd5cc16c1a623499, 0x9241cf3a57c62c8b, + 0x2f5e6961fd1b667f}, + {0x5c15c70bf5a01797, 0x3d20b44d60956192, 0x4911b37071fdb52, + 0xf648f9168d6f0f7b}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x9e566847e137bbbc, 0xe434469e8a6a0bec, 0xb1c4276179d73463, + 0x5abe0285133d0015}, + {0x92aa837cc04c7dab, 0x573d9f4c43260c07, 0xc93156278e6cc37, + 0x94bb725b6b6f7383}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x62a8c244bfe20925, 0x91c19ac38fdce867, 0x5a96a5d5dd387063, + 0x61d587d421d324f6}, + {0xe87673a2a37173ea, 0x2384800853778b65, 0x10f8441e05bab43e, + 0xfa11fe124621efbe}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x1c891f2b2cb19ffd, 0x1ba8d5bb1923c23, 0xb6d03d678ac5ca8e, + 0x586eb04c1f13bedc}, + {0xc35c6e527e8ed09, 0x1e81a33c1819ede2, 0x278fd6c056c652fa, + 0x19d5ac0870864f11}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x62577734d2b533d5, 0x673b8af6a1bdddc0, 0x577e7c9aa79ec293, + 0xbb6de651c3b266b1}, + {0xe7e9303ab65259b3, 0xd6a0afd3d03a7480, 0xc5ac83d19b3cfc27, + 0x60b4619a5d18b99b}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xbd6a38e11ae5aa1c, 0xb8b7652b49e73658, 0xb130014ee5f87ed, + 0x9d0f27b2aeebffcd}, + {0xca9246317a730a55, 0x9c955b2fddbbc83a, 0x7c1dfe0ac019a71, + 0x244a566d356ec48d}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x56f8410ef4f8b16a, 0x97241afec47b266a, 0xa406b8e6d9c87c1, + 0x803f3e02cd42ab1b}, + {0x7f0309a804dbec69, 0xa83b85f73bbad05f, 0xc6097273ad8e197f, + 0xc097440e5067adc1}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x846a56f2c379ab34, 0xa8ee068b841df8d1, 0x20314459176c68ef, + 0xf1af32d5915f1f30}, + {0x99c375315d75bd50, 0x837cffbaf72f67bc, 0x613a41848d7723f, + 0x23d0f130e2d41c8b}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xed93e225d5be5a2b, 0x6fe799835934f3c6, 0x4314092622626ffc, + 0x50bbb4d97990216a}, + {0x378191c6e57ec63e, 0x65422c40181dcdb2, 0x41a8099b0236e0f6, + 0x2b10011801fe49c3}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xfc68b5c59b391593, 0xc385f5a2598270fc, 0x7144f3aad19adcbb, + 0xdd55899983fbae0c}, + {0x93b88b8e74b82ff4, 0xd2e03c4071e734c9, 0x9a7a9eaf43c0322a, + 0xe6e4c551149d6041}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x5fe14bfe80ec21fe, 0xf6ce116ac255be82, 0x98bc5a072f4a5d67, + 0xfad27148db7e63af}, + {0x90c0b6ac29ab05b3, 0x37a9a83c4e251ae6, 0xa7dc875c2aade7d, + 0x77387de39f0e1a84}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x1e9ecc49a56c0dd7, 0xa5cffcd846086c74, 0x8f7a1408f505aece, + 0xb37b85c0bef0c47e}, + {0x3596b6e4cc0e6a8f, 0xfd6d4bbf6b388f23, 0xaba453fac39cef4e, + 0x9c135ac8f9f628d5}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xa1c729495c8f8be, 0x2961c4803bf362bf, 0x9e418403df63d4ac, + 0xc109f9cb91ece900}, + {0xc2d095d058945705, 0xb9083d96ddeb85c0, 0x84692b8d7a40449b, + 0x9bc3344f2eee1ee1}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xd5ae35642913074, 0x55491b2748a542b1, 0x469ca665b310732a, + 0x29591d525f1a4cc1}, + {0xe76f5b6bb84f983f, 0xbe7eef419f5f84e1, 0x1200d49680baa189, + 0x6376551f18ef332c}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}, + {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, + {{0x202886024147519a, 0xd0981eac26b372f0, 0xa9d4a7caa785ebc8, + 0xd953c50ddbdf58e9}, + {0x9d6361ccfd590f8f, 0x72e9626b44e6c917, 0x7fd9611022eb64cf, + 0x863ebb7e9eb288f3}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x4fe7ee31b0e63d34, 0xf4600572a9e54fab, 0xc0493334d5e7b5a4, + 0x8589fb9206d54831}, + {0xaa70f5cc6583553a, 0x879094ae25649e5, 0xcc90450710044652, + 0xebb0696d02541c4f}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xabbaa0c03b89da99, 0xa6f2d79eb8284022, 0x27847862b81c05e8, + 0x337a4b5905e54d63}, + {0x3c67500d21f7794a, 0x207005b77d6d7f61, 0xa5a378104cfd6e8, + 0xd65e0d5f4c2fbd6}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xd433e50f6d3549cf, 0x6f33696ffacd665e, 0x695bfdacce11fcb4, + 0x810ee252af7c9860}, + {0x65450fe17159bb2c, 0xf7dfbebe758b357b, 0x2b057e74d69fea72, + 0xd485717a92731745}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xce1f69bbe83f7669, 0x9f8ae8272877d6b, 0x9548ae543244278d, + 0x207755dee3c2c19c}, + {0x87bd61d96fef1945, 0x18813cefb12d28c3, 0x9fbcd1d672df64aa, + 0x48dc5ee57154b00d}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xef0f469ef49a3154, 0x3e85a5956e2b2e9a, 0x45aaec1eaa924a9c, + 0xaa12dfc8a09e4719}, + {0x26f272274df69f1d, 0xe0e4c82ca2ff5e73, 0xb9d8ce73b7a9dd44, + 0x6c036e73e48ca901}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xe1e421e1a47153f0, 0xb86c3b79920418c9, 0x93bdce87705d7672, + 0xf25ae793cab79a77}, + {0x1f3194a36d869d0c, 0x9d55c8824986c264, 0x49fb5ea3096e945e, + 0x39b8e65313db0a3e}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xe3417bc035d0b34a, 0x440b386b8327c0a7, 0x8fb7262dac0362d1, + 0x2c41114ce0cdf943}, + {0x2ba5cef1ad95a0b1, 0xc09b37a867d54362, 0x26d6cdd201e486c9, + 0x20477abf42ff9297}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xf121b41bc0a67d2, 0x62d4760a444d248a, 0xe044f1d659b4737, + 0x8fde365250bb4a8}, + {0xaceec3da848bf287, 0xc2a62182d3369d6e, 0x3582dfdc92449482, + 0x2f7e2fd2565d6cd7}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xa0122b5178a876b, 0x51ff96ff085104b4, 0x50b31ab14f29f76, + 0x84abb28b5f87d4e6}, + {0xd5ed439f8270790a, 0x2d6cb59d85e3f46b, 0x75f55c1b6c1e2212, + 0xe5436f6717655640}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xc2965ecc9aeb596d, 0x1ea03e7023c92b4, 0x4704b4b62e013961, + 0xca8fd3f905ea367}, + {0x92523a42551b2b61, 0x1eb7a89c390fcd06, 0xe7f1d2be0392a63e, + 0x96dca2644ddb0c33}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x231c210e15339848, 0xe87a28e870778c8d, 0x9d1de6616956e170, + 0x4ac3c9382bb09c0b}, + {0x19be05516998987d, 0x8b2376c4ae09f4d6, 0x1de0b7651a3f933d, + 0x380d94c7e39705f4}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x3685954b8c31c31d, 0x68533d005bf21a0c, 0xbd7626e75c79ec9, + 0xca17754742c69d54}, + {0xcc6edafff6d2dbb2, 0xfd0d8cbd174a9d18, 0x875e8793aa4578e8, + 0xa976a7139cab2ce6}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0xce37ab11b43ea1db, 0xa7ff1a95259d292, 0x851b02218f84f186, + 0xa7222beadefaad13}, + {0xa2ac78ec2b0a9144, 0x5a024051f2fa59c5, 0x91d1eca56147ce38, + 0xbe94d523bc2ac690}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, + {{0x2d8daefd79ec1a0f, 0x3bbcd6fdceb39c97, 0xf5575ffc58f61a95, + 0xdbd986c4adf7b420}, + {0x81aa881415f39eb7, 0x6ee2fcf5b98d976c, 0x5465475dcf2f717d, + 0x8e24d3c46860bbd0}, + {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}}; +#else +static const fe g_pre_comp[2][16][3] = { + {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, + {{0x18a9143c,0x79e730d4, 0x5fedb601,0x75ba95fc, 0x77622510,0x79fb732b, + 0xa53755c6,0x18905f76}, + {0xce95560a,0xddf25357, 0xba19e45c,0x8b4ab8e4, 0xdd21f325,0xd2e88688, + 0x25885d85,0x8571ff18}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x16a0d2bb,0x4f922fc5, 0x1a623499,0xd5cc16c, 0x57c62c8b,0x9241cf3a, + 0xfd1b667f,0x2f5e6961}, + {0xf5a01797,0x5c15c70b, 0x60956192,0x3d20b44d, 0x71fdb52,0x4911b37, + 0x8d6f0f7b,0xf648f916}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xe137bbbc,0x9e566847, 0x8a6a0bec,0xe434469e, 0x79d73463,0xb1c42761, + 0x133d0015,0x5abe0285}, + {0xc04c7dab,0x92aa837c, 0x43260c07,0x573d9f4c, 0x78e6cc37,0xc931562, + 0x6b6f7383,0x94bb725b}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xbfe20925,0x62a8c244, 0x8fdce867,0x91c19ac3, 0xdd387063,0x5a96a5d5, + 0x21d324f6,0x61d587d4}, + {0xa37173ea,0xe87673a2, 0x53778b65,0x23848008, 0x5bab43e,0x10f8441e, + 0x4621efbe,0xfa11fe12}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x2cb19ffd,0x1c891f2b, 0xb1923c23,0x1ba8d5b, 0x8ac5ca8e,0xb6d03d67, + 0x1f13bedc,0x586eb04c}, + {0x27e8ed09,0xc35c6e5, 0x1819ede2,0x1e81a33c, 0x56c652fa,0x278fd6c0, + 0x70864f11,0x19d5ac08}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xd2b533d5,0x62577734, 0xa1bdddc0,0x673b8af6, 0xa79ec293,0x577e7c9a, + 0xc3b266b1,0xbb6de651}, + {0xb65259b3,0xe7e9303a, 0xd03a7480,0xd6a0afd3, 0x9b3cfc27,0xc5ac83d1, + 0x5d18b99b,0x60b4619a}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x1ae5aa1c,0xbd6a38e1, 0x49e73658,0xb8b7652b, 0xee5f87ed,0xb130014, + 0xaeebffcd,0x9d0f27b2}, + {0x7a730a55,0xca924631, 0xddbbc83a,0x9c955b2f, 0xac019a71,0x7c1dfe0, + 0x356ec48d,0x244a566d}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xf4f8b16a,0x56f8410e, 0xc47b266a,0x97241afe, 0x6d9c87c1,0xa406b8e, + 0xcd42ab1b,0x803f3e02}, + {0x4dbec69,0x7f0309a8, 0x3bbad05f,0xa83b85f7, 0xad8e197f,0xc6097273, + 0x5067adc1,0xc097440e}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xc379ab34,0x846a56f2, 0x841df8d1,0xa8ee068b, 0x176c68ef,0x20314459, + 0x915f1f30,0xf1af32d5}, + {0x5d75bd50,0x99c37531, 0xf72f67bc,0x837cffba, 0x48d7723f,0x613a418, + 0xe2d41c8b,0x23d0f130}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xd5be5a2b,0xed93e225, 0x5934f3c6,0x6fe79983, 0x22626ffc,0x43140926, + 0x7990216a,0x50bbb4d9}, + {0xe57ec63e,0x378191c6, 0x181dcdb2,0x65422c40, 0x236e0f6,0x41a8099b, + 0x1fe49c3,0x2b100118}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x9b391593,0xfc68b5c5, 0x598270fc,0xc385f5a2, 0xd19adcbb,0x7144f3aa, + 0x83fbae0c,0xdd558999}, + {0x74b82ff4,0x93b88b8e, 0x71e734c9,0xd2e03c40, 0x43c0322a,0x9a7a9eaf, + 0x149d6041,0xe6e4c551}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x80ec21fe,0x5fe14bfe, 0xc255be82,0xf6ce116a, 0x2f4a5d67,0x98bc5a07, + 0xdb7e63af,0xfad27148}, + {0x29ab05b3,0x90c0b6ac, 0x4e251ae6,0x37a9a83c, 0xc2aade7d,0xa7dc875, + 0x9f0e1a84,0x77387de3}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xa56c0dd7,0x1e9ecc49, 0x46086c74,0xa5cffcd8, 0xf505aece,0x8f7a1408, + 0xbef0c47e,0xb37b85c0}, + {0xcc0e6a8f,0x3596b6e4, 0x6b388f23,0xfd6d4bbf, 0xc39cef4e,0xaba453fa, + 0xf9f628d5,0x9c135ac8}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x95c8f8be,0xa1c7294, 0x3bf362bf,0x2961c480, 0xdf63d4ac,0x9e418403, + 0x91ece900,0xc109f9cb}, + {0x58945705,0xc2d095d0, 0xddeb85c0,0xb9083d96, 0x7a40449b,0x84692b8d, + 0x2eee1ee1,0x9bc3344f}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x42913074,0xd5ae356, 0x48a542b1,0x55491b27, 0xb310732a,0x469ca665, + 0x5f1a4cc1,0x29591d52}, + {0xb84f983f,0xe76f5b6b, 0x9f5f84e1,0xbe7eef41, 0x80baa189,0x1200d496, + 0x18ef332c,0x6376551f}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}, + {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, + {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, + {{0x4147519a,0x20288602, 0x26b372f0,0xd0981eac, 0xa785ebc8,0xa9d4a7ca, + 0xdbdf58e9,0xd953c50d}, + {0xfd590f8f,0x9d6361cc, 0x44e6c917,0x72e9626b, 0x22eb64cf,0x7fd96110, + 0x9eb288f3,0x863ebb7e}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xb0e63d34,0x4fe7ee31, 0xa9e54fab,0xf4600572, 0xd5e7b5a4,0xc0493334, + 0x6d54831,0x8589fb92}, + {0x6583553a,0xaa70f5cc, 0xe25649e5,0x879094a, 0x10044652,0xcc904507, + 0x2541c4f,0xebb0696d}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x3b89da99,0xabbaa0c0, 0xb8284022,0xa6f2d79e, 0xb81c05e8,0x27847862, + 0x5e54d63,0x337a4b59}, + {0x21f7794a,0x3c67500d, 0x7d6d7f61,0x207005b7, 0x4cfd6e8,0xa5a3781, + 0xf4c2fbd6,0xd65e0d5}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x6d3549cf,0xd433e50f, 0xfacd665e,0x6f33696f, 0xce11fcb4,0x695bfdac, + 0xaf7c9860,0x810ee252}, + {0x7159bb2c,0x65450fe1, 0x758b357b,0xf7dfbebe, 0xd69fea72,0x2b057e74, + 0x92731745,0xd485717a}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xe83f7669,0xce1f69bb, 0x72877d6b,0x9f8ae82, 0x3244278d,0x9548ae54, + 0xe3c2c19c,0x207755de}, + {0x6fef1945,0x87bd61d9, 0xb12d28c3,0x18813cef, 0x72df64aa,0x9fbcd1d6, + 0x7154b00d,0x48dc5ee5}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xf49a3154,0xef0f469e, 0x6e2b2e9a,0x3e85a595, 0xaa924a9c,0x45aaec1e, + 0xa09e4719,0xaa12dfc8}, + {0x4df69f1d,0x26f27227, 0xa2ff5e73,0xe0e4c82c, 0xb7a9dd44,0xb9d8ce73, + 0xe48ca901,0x6c036e73}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xa47153f0,0xe1e421e1, 0x920418c9,0xb86c3b79, 0x705d7672,0x93bdce87, + 0xcab79a77,0xf25ae793}, + {0x6d869d0c,0x1f3194a3, 0x4986c264,0x9d55c882, 0x96e945e,0x49fb5ea3, + 0x13db0a3e,0x39b8e653}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x35d0b34a,0xe3417bc0, 0x8327c0a7,0x440b386b, 0xac0362d1,0x8fb7262d, + 0xe0cdf943,0x2c41114c}, + {0xad95a0b1,0x2ba5cef1, 0x67d54362,0xc09b37a8, 0x1e486c9,0x26d6cdd2, + 0x42ff9297,0x20477abf}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xbc0a67d2,0xf121b41, 0x444d248a,0x62d4760a, 0x659b4737,0xe044f1d, + 0x250bb4a8,0x8fde365}, + {0x848bf287,0xaceec3da, 0xd3369d6e,0xc2a62182, 0x92449482,0x3582dfdc, + 0x565d6cd7,0x2f7e2fd2}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x178a876b,0xa0122b5, 0x85104b4,0x51ff96ff, 0x14f29f76,0x50b31ab, + 0x5f87d4e6,0x84abb28b}, + {0x8270790a,0xd5ed439f, 0x85e3f46b,0x2d6cb59d, 0x6c1e2212,0x75f55c1b, + 0x17655640,0xe5436f67}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x9aeb596d,0xc2965ecc, 0x23c92b4,0x1ea03e7, 0x2e013961,0x4704b4b6, + 0x905ea367,0xca8fd3f}, + {0x551b2b61,0x92523a42, 0x390fcd06,0x1eb7a89c, 0x392a63e,0xe7f1d2be, + 0x4ddb0c33,0x96dca264}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x15339848,0x231c210e, 0x70778c8d,0xe87a28e8, 0x6956e170,0x9d1de661, + 0x2bb09c0b,0x4ac3c938}, + {0x6998987d,0x19be0551, 0xae09f4d6,0x8b2376c4, 0x1a3f933d,0x1de0b765, + 0xe39705f4,0x380d94c7}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x8c31c31d,0x3685954b, 0x5bf21a0c,0x68533d00, 0x75c79ec9,0xbd7626e, + 0x42c69d54,0xca177547}, + {0xf6d2dbb2,0xcc6edaff, 0x174a9d18,0xfd0d8cbd, 0xaa4578e8,0x875e8793, + 0x9cab2ce6,0xa976a713}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0xb43ea1db,0xce37ab11, 0x5259d292,0xa7ff1a9, 0x8f84f186,0x851b0221, + 0xdefaad13,0xa7222bea}, + {0x2b0a9144,0xa2ac78ec, 0xf2fa59c5,0x5a024051, 0x6147ce38,0x91d1eca5, + 0xbc2ac690,0xbe94d523}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, + {{0x79ec1a0f,0x2d8daefd, 0xceb39c97,0x3bbcd6fd, 0x58f61a95,0xf5575ffc, + 0xadf7b420,0xdbd986c4}, + {0x15f39eb7,0x81aa8814, 0xb98d976c,0x6ee2fcf5, 0xcf2f717d,0x5465475d, + 0x6860bbd0,0x8e24d3c4}, + {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}}; +#endif + +// select_point selects the |idx|th point from a precomputation table and +// copies it to out. +static void select_point(const limb_t idx, size_t size, + const fe pre_comp[/*size*/][3], + fe out[3]) { + OPENSSL_memset(out, 0, sizeof(fe) * 3); + for (size_t i = 0; i < size; i++) { + limb_t mismatch = i ^ idx; + fe_cmovznz(out[0], mismatch, pre_comp[i][0], out[0]); + fe_cmovznz(out[1], mismatch, pre_comp[i][1], out[1]); + fe_cmovznz(out[2], mismatch, pre_comp[i][2], out[2]); + } +} + +// get_bit returns the |i|th bit in |in| +static char get_bit(const uint8_t *in, int i) { + if (i < 0 || i >= 256) { + return 0; + } + return (in[i >> 3] >> (i & 7)) & 1; +} + +// OPENSSL EC_METHOD FUNCTIONS + +// Takes the Jacobian coordinates (X, Y, Z) of a point and returns (X', Y') = +// (X/Z^2, Y/Z^3). +static int ec_GFp_nistp256_point_get_affine_coordinates( + const EC_GROUP *group, const EC_RAW_POINT *point, EC_FELEM *x_out, + EC_FELEM *y_out) { + if (ec_GFp_simple_is_at_infinity(group, point)) { + OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); + return 0; + } + + fe z1, z2; + fe_from_generic(z1, &point->Z); + fe_inv(z2, z1); + fe_sqr(z1, z2); + + // Instead of using |fe_from_montgomery| to convert the |x| coordinate and + // then calling |fe_from_montgomery| again to convert the |y| coordinate + // below, convert the common factor |z1| once now, saving one reduction. + fe_from_montgomery(z1); + + if (x_out != NULL) { + fe x; + fe_from_generic(x, &point->X); + fe_mul(x, x, z1); + fe_to_generic(x_out, x); + } + + if (y_out != NULL) { + fe y; + fe_from_generic(y, &point->Y); + fe_mul(z1, z1, z2); + fe_mul(y, y, z1); + fe_to_generic(y_out, y); + } + + return 1; +} + +static void ec_GFp_nistp256_add(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a, const EC_RAW_POINT *b) { + fe x1, y1, z1, x2, y2, z2; + fe_from_generic(x1, &a->X); + fe_from_generic(y1, &a->Y); + fe_from_generic(z1, &a->Z); + fe_from_generic(x2, &b->X); + fe_from_generic(y2, &b->Y); + fe_from_generic(z2, &b->Z); + point_add(x1, y1, z1, x1, y1, z1, 0 /* both Jacobian */, x2, y2, z2); + fe_to_generic(&r->X, x1); + fe_to_generic(&r->Y, y1); + fe_to_generic(&r->Z, z1); +} + +static void ec_GFp_nistp256_dbl(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *a) { + fe x, y, z; + fe_from_generic(x, &a->X); + fe_from_generic(y, &a->Y); + fe_from_generic(z, &a->Z); + point_double(x, y, z, x, y, z); + fe_to_generic(&r->X, x); + fe_to_generic(&r->Y, y); + fe_to_generic(&r->Z, z); +} + +static void ec_GFp_nistp256_point_mul(const EC_GROUP *group, EC_RAW_POINT *r, + const EC_RAW_POINT *p, + const EC_SCALAR *scalar) { + fe p_pre_comp[17][3]; + OPENSSL_memset(&p_pre_comp, 0, sizeof(p_pre_comp)); + // Precompute multiples. + fe_from_generic(p_pre_comp[1][0], &p->X); + fe_from_generic(p_pre_comp[1][1], &p->Y); + fe_from_generic(p_pre_comp[1][2], &p->Z); + for (size_t j = 2; j <= 16; ++j) { + if (j & 1) { + point_add(p_pre_comp[j][0], p_pre_comp[j][1], p_pre_comp[j][2], + p_pre_comp[1][0], p_pre_comp[1][1], p_pre_comp[1][2], 0, + p_pre_comp[j - 1][0], p_pre_comp[j - 1][1], + p_pre_comp[j - 1][2]); + } else { + point_double(p_pre_comp[j][0], p_pre_comp[j][1], p_pre_comp[j][2], + p_pre_comp[j / 2][0], p_pre_comp[j / 2][1], + p_pre_comp[j / 2][2]); + } + } + + // Set nq to the point at infinity. + fe nq[3] = {{0}, {0}, {0}}, ftmp, tmp[3]; + + // Loop over |scalar| msb-to-lsb, incorporating |p_pre_comp| every 5th round. + int skip = 1; // Save two point operations in the first round. + for (size_t i = 255; i < 256; i--) { + // double + if (!skip) { + point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + } + + // do other additions every 5 doublings + if (i % 5 == 0) { + uint64_t bits = get_bit(scalar->bytes, i + 4) << 5; + bits |= get_bit(scalar->bytes, i + 3) << 4; + bits |= get_bit(scalar->bytes, i + 2) << 3; + bits |= get_bit(scalar->bytes, i + 1) << 2; + bits |= get_bit(scalar->bytes, i) << 1; + bits |= get_bit(scalar->bytes, i - 1); + uint8_t sign, digit; + ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); + + // select the point to add or subtract, in constant time. + select_point(digit, 17, (const fe(*)[3])p_pre_comp, tmp); + fe_opp(ftmp, tmp[1]); // (X, -Y, Z) is the negative point. + fe_cmovznz(tmp[1], sign, tmp[1], ftmp); + + if (!skip) { + point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, + tmp[0], tmp[1], tmp[2]); + } else { + fe_copy(nq[0], tmp[0]); + fe_copy(nq[1], tmp[1]); + fe_copy(nq[2], tmp[2]); + skip = 0; + } + } + } + + fe_to_generic(&r->X, nq[0]); + fe_to_generic(&r->Y, nq[1]); + fe_to_generic(&r->Z, nq[2]); +} + +static void ec_GFp_nistp256_point_mul_base(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *scalar) { + // Set nq to the point at infinity. + fe nq[3] = {{0}, {0}, {0}}, tmp[3]; + + int skip = 1; // Save two point operations in the first round. + for (size_t i = 31; i < 32; i--) { + if (!skip) { + point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); + } + + // First, look 32 bits upwards. + uint64_t bits = get_bit(scalar->bytes, i + 224) << 3; + bits |= get_bit(scalar->bytes, i + 160) << 2; + bits |= get_bit(scalar->bytes, i + 96) << 1; + bits |= get_bit(scalar->bytes, i + 32); + // Select the point to add, in constant time. + select_point(bits, 16, g_pre_comp[1], tmp); + + if (!skip) { + point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, tmp[0], + tmp[1], tmp[2]); + } else { + fe_copy(nq[0], tmp[0]); + fe_copy(nq[1], tmp[1]); + fe_copy(nq[2], tmp[2]); + skip = 0; + } + + // Second, look at the current position. + bits = get_bit(scalar->bytes, i + 192) << 3; + bits |= get_bit(scalar->bytes, i + 128) << 2; + bits |= get_bit(scalar->bytes, i + 64) << 1; + bits |= get_bit(scalar->bytes, i); + // Select the point to add, in constant time. + select_point(bits, 16, g_pre_comp[0], tmp); + point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, tmp[0], + tmp[1], tmp[2]); + } + + fe_to_generic(&r->X, nq[0]); + fe_to_generic(&r->Y, nq[1]); + fe_to_generic(&r->Z, nq[2]); +} + +static void ec_GFp_nistp256_point_mul_public(const EC_GROUP *group, + EC_RAW_POINT *r, + const EC_SCALAR *g_scalar, + const EC_RAW_POINT *p, + const EC_SCALAR *p_scalar) { +#define P256_WSIZE_PUBLIC 4 + // Precompute multiples of |p|. p_pre_comp[i] is (2*i+1) * |p|. + fe p_pre_comp[1 << (P256_WSIZE_PUBLIC-1)][3]; + fe_from_generic(p_pre_comp[0][0], &p->X); + fe_from_generic(p_pre_comp[0][1], &p->Y); + fe_from_generic(p_pre_comp[0][2], &p->Z); + fe p2[3]; + point_double(p2[0], p2[1], p2[2], p_pre_comp[0][0], p_pre_comp[0][1], + p_pre_comp[0][2]); + for (size_t i = 1; i < OPENSSL_ARRAY_SIZE(p_pre_comp); i++) { + point_add(p_pre_comp[i][0], p_pre_comp[i][1], p_pre_comp[i][2], + p_pre_comp[i - 1][0], p_pre_comp[i - 1][1], p_pre_comp[i - 1][2], + 0 /* not mixed */, p2[0], p2[1], p2[2]); + } + + // Set up the coefficients for |p_scalar|. + int8_t p_wNAF[257]; + ec_compute_wNAF(group, p_wNAF, p_scalar, 256, P256_WSIZE_PUBLIC); + + // Set |ret| to the point at infinity. + int skip = 1; // Save some point operations. + fe ret[3] = {{0},{0},{0}}; + for (int i = 256; i >= 0; i--) { + if (!skip) { + point_double(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2]); + } + + // For the |g_scalar|, we use the precomputed table without the + // constant-time lookup. + if (i <= 31) { + // First, look 32 bits upwards. + uint64_t bits = get_bit(g_scalar->bytes, i + 224) << 3; + bits |= get_bit(g_scalar->bytes, i + 160) << 2; + bits |= get_bit(g_scalar->bytes, i + 96) << 1; + bits |= get_bit(g_scalar->bytes, i + 32); + point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, + g_pre_comp[1][bits][0], g_pre_comp[1][bits][1], + g_pre_comp[1][bits][2]); + skip = 0; + + // Second, look at the current position. + bits = get_bit(g_scalar->bytes, i + 192) << 3; + bits |= get_bit(g_scalar->bytes, i + 128) << 2; + bits |= get_bit(g_scalar->bytes, i + 64) << 1; + bits |= get_bit(g_scalar->bytes, i); + point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, + g_pre_comp[0][bits][0], g_pre_comp[0][bits][1], + g_pre_comp[0][bits][2]); + } + + int digit = p_wNAF[i]; + if (digit != 0) { + assert(digit & 1); + int idx = digit < 0 ? (-digit) >> 1 : digit >> 1; + fe *y = &p_pre_comp[idx][1], tmp; + if (digit < 0) { + fe_opp(tmp, p_pre_comp[idx][1]); + y = &tmp; + } + if (!skip) { + point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], + 0 /* not mixed */, p_pre_comp[idx][0], *y, p_pre_comp[idx][2]); + } else { + fe_copy(ret[0], p_pre_comp[idx][0]); + fe_copy(ret[1], *y); + fe_copy(ret[2], p_pre_comp[idx][2]); + skip = 0; + } + } + } + + fe_to_generic(&r->X, ret[0]); + fe_to_generic(&r->Y, ret[1]); + fe_to_generic(&r->Z, ret[2]); +} + +static int ec_GFp_nistp256_cmp_x_coordinate(const EC_GROUP *group, + const EC_RAW_POINT *p, + const EC_SCALAR *r) { + if (ec_GFp_simple_is_at_infinity(group, p)) { + return 0; + } + + // We wish to compare X/Z^2 with r. This is equivalent to comparing X with + // r*Z^2. Note that X and Z are represented in Montgomery form, while r is + // not. + fe Z2_mont; + fe_from_generic(Z2_mont, &p->Z); + fe_mul(Z2_mont, Z2_mont, Z2_mont); + + fe r_Z2; + fe_frombytes(r_Z2, r->bytes); // r < order < p, so this is valid. + fe_mul(r_Z2, r_Z2, Z2_mont); + + fe X; + fe_from_generic(X, &p->X); + fe_from_montgomery(X); + + if (OPENSSL_memcmp(&r_Z2, &X, sizeof(r_Z2)) == 0) { + return 1; + } + + // During signing the x coefficient is reduced modulo the group order. + // Therefore there is a small possibility, less than 1/2^128, that group_order + // < p.x < P. in that case we need not only to compare against |r| but also to + // compare against r+group_order. + assert(group->field.width == group->order.width); + if (bn_less_than_words(r->words, group->field_minus_order.words, + group->field.width)) { + // We can ignore the carry because: r + group_order < p < 2^256. + EC_FELEM tmp; + bn_add_words(tmp.words, r->words, group->order.d, group->order.width); + fe_from_generic(r_Z2, &tmp); + fe_mul(r_Z2, r_Z2, Z2_mont); + if (OPENSSL_memcmp(&r_Z2, &X, sizeof(r_Z2)) == 0) { + return 1; + } + } + + return 0; +} + +DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp256_method) { + out->group_init = ec_GFp_mont_group_init; + out->group_finish = ec_GFp_mont_group_finish; + out->group_set_curve = ec_GFp_mont_group_set_curve; + out->point_get_affine_coordinates = + ec_GFp_nistp256_point_get_affine_coordinates; + out->add = ec_GFp_nistp256_add; + out->dbl = ec_GFp_nistp256_dbl; + out->mul = ec_GFp_nistp256_point_mul; + out->mul_base = ec_GFp_nistp256_point_mul_base; + out->mul_public = ec_GFp_nistp256_point_mul_public; + out->felem_mul = ec_GFp_mont_felem_mul; + out->felem_sqr = ec_GFp_mont_felem_sqr; + out->bignum_to_felem = ec_GFp_mont_bignum_to_felem; + out->felem_to_bignum = ec_GFp_mont_felem_to_bignum; + out->scalar_inv_montgomery = ec_simple_scalar_inv_montgomery; + out->scalar_inv_montgomery_vartime = ec_GFp_simple_mont_inv_mod_ord_vartime; + out->cmp_x_coordinate = ec_GFp_nistp256_cmp_x_coordinate; +} + +#undef BORINGSSL_NISTP256_64BIT diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h new file mode 100644 index 000000000..638eb5d9c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h @@ -0,0 +1,3226 @@ +/* Autogenerated */ +/* curve description: p256 */ +/* requested operations: (all) */ +/* m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1") */ +/* machine_wordsize = 32 (from "32") */ +/* */ +/* NOTE: In addition to the bounds specified above each function, all */ +/* functions synthesized for this Montgomery arithmetic require the */ +/* input to be strictly less than the prime modulus (m), and also */ +/* require the input to be in the unique saturated representation. */ +/* All functions also ensure that these two properties are true of */ +/* return values. */ + +#include +typedef unsigned char fiat_p256_uint1; +typedef signed char fiat_p256_int1; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_addcarryx_u32(uint32_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { + uint64_t x1 = ((arg1 + (uint64_t)arg2) + arg3); + uint32_t x2 = (uint32_t)(x1 & UINT32_C(0xffffffff)); + fiat_p256_uint1 x3 = (fiat_p256_uint1)(x1 >> 32); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_subborrowx_u32(uint32_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { + int64_t x1 = ((arg2 - (int64_t)arg1) - arg3); + fiat_p256_int1 x2 = (fiat_p256_int1)(x1 >> 32); + uint32_t x3 = (uint32_t)(x1 & UINT32_C(0xffffffff)); + *out1 = x3; + *out2 = (fiat_p256_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0xffffffff] + * arg2: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + * out2: [0x0 ~> 0xffffffff] + */ +static void fiat_p256_mulx_u32(uint32_t* out1, uint32_t* out2, uint32_t arg1, uint32_t arg2) { + uint64_t x1 = ((uint64_t)arg1 * arg2); + uint32_t x2 = (uint32_t)(x1 & UINT32_C(0xffffffff)); + uint32_t x3 = (uint32_t)(x1 >> 32); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + */ +static void fiat_p256_cmovznz_u32(uint32_t* out1, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { + fiat_p256_uint1 x1 = (!(!arg1)); + uint32_t x2 = ((fiat_p256_int1)(0x0 - x1) & UINT32_C(0xffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint32_t x3 = ((value_barrier_u32(x2) & arg3) | (value_barrier_u32(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_mul(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { + uint32_t x1 = (arg1[1]); + uint32_t x2 = (arg1[2]); + uint32_t x3 = (arg1[3]); + uint32_t x4 = (arg1[4]); + uint32_t x5 = (arg1[5]); + uint32_t x6 = (arg1[6]); + uint32_t x7 = (arg1[7]); + uint32_t x8 = (arg1[0]); + uint32_t x9; + uint32_t x10; + fiat_p256_mulx_u32(&x9, &x10, x8, (arg2[7])); + uint32_t x11; + uint32_t x12; + fiat_p256_mulx_u32(&x11, &x12, x8, (arg2[6])); + uint32_t x13; + uint32_t x14; + fiat_p256_mulx_u32(&x13, &x14, x8, (arg2[5])); + uint32_t x15; + uint32_t x16; + fiat_p256_mulx_u32(&x15, &x16, x8, (arg2[4])); + uint32_t x17; + uint32_t x18; + fiat_p256_mulx_u32(&x17, &x18, x8, (arg2[3])); + uint32_t x19; + uint32_t x20; + fiat_p256_mulx_u32(&x19, &x20, x8, (arg2[2])); + uint32_t x21; + uint32_t x22; + fiat_p256_mulx_u32(&x21, &x22, x8, (arg2[1])); + uint32_t x23; + uint32_t x24; + fiat_p256_mulx_u32(&x23, &x24, x8, (arg2[0])); + uint32_t x25; + fiat_p256_uint1 x26; + fiat_p256_addcarryx_u32(&x25, &x26, 0x0, x21, x24); + uint32_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u32(&x27, &x28, x26, x19, x22); + uint32_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u32(&x29, &x30, x28, x17, x20); + uint32_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u32(&x31, &x32, x30, x15, x18); + uint32_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u32(&x33, &x34, x32, x13, x16); + uint32_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u32(&x35, &x36, x34, x11, x14); + uint32_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u32(&x37, &x38, x36, x9, x12); + uint32_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u32(&x39, &x40, x38, 0x0, x10); + uint32_t x41; + uint32_t x42; + fiat_p256_mulx_u32(&x41, &x42, x23, UINT32_C(0xffffffff)); + uint32_t x43; + uint32_t x44; + fiat_p256_mulx_u32(&x43, &x44, x23, UINT32_C(0xffffffff)); + uint32_t x45; + uint32_t x46; + fiat_p256_mulx_u32(&x45, &x46, x23, UINT32_C(0xffffffff)); + uint32_t x47; + uint32_t x48; + fiat_p256_mulx_u32(&x47, &x48, x23, UINT32_C(0xffffffff)); + uint32_t x49; + fiat_p256_uint1 x50; + fiat_p256_addcarryx_u32(&x49, &x50, 0x0, x45, x48); + uint32_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u32(&x51, &x52, x50, x43, x46); + uint32_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u32(&x53, &x54, x52, 0x0, x44); + uint32_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u32(&x55, &x56, 0x0, x47, x23); + uint32_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u32(&x57, &x58, x56, x49, x25); + uint32_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u32(&x59, &x60, x58, x51, x27); + uint32_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u32(&x61, &x62, x60, x53, x29); + uint32_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u32(&x63, &x64, x62, 0x0, x31); + uint32_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u32(&x65, &x66, x64, 0x0, x33); + uint32_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u32(&x67, &x68, x66, x23, x35); + uint32_t x69; + fiat_p256_uint1 x70; + fiat_p256_addcarryx_u32(&x69, &x70, x68, x41, x37); + uint32_t x71; + fiat_p256_uint1 x72; + fiat_p256_addcarryx_u32(&x71, &x72, x70, x42, x39); + uint32_t x73; + fiat_p256_uint1 x74; + fiat_p256_addcarryx_u32(&x73, &x74, x72, 0x0, 0x0); + uint32_t x75; + uint32_t x76; + fiat_p256_mulx_u32(&x75, &x76, x1, (arg2[7])); + uint32_t x77; + uint32_t x78; + fiat_p256_mulx_u32(&x77, &x78, x1, (arg2[6])); + uint32_t x79; + uint32_t x80; + fiat_p256_mulx_u32(&x79, &x80, x1, (arg2[5])); + uint32_t x81; + uint32_t x82; + fiat_p256_mulx_u32(&x81, &x82, x1, (arg2[4])); + uint32_t x83; + uint32_t x84; + fiat_p256_mulx_u32(&x83, &x84, x1, (arg2[3])); + uint32_t x85; + uint32_t x86; + fiat_p256_mulx_u32(&x85, &x86, x1, (arg2[2])); + uint32_t x87; + uint32_t x88; + fiat_p256_mulx_u32(&x87, &x88, x1, (arg2[1])); + uint32_t x89; + uint32_t x90; + fiat_p256_mulx_u32(&x89, &x90, x1, (arg2[0])); + uint32_t x91; + fiat_p256_uint1 x92; + fiat_p256_addcarryx_u32(&x91, &x92, 0x0, x87, x90); + uint32_t x93; + fiat_p256_uint1 x94; + fiat_p256_addcarryx_u32(&x93, &x94, x92, x85, x88); + uint32_t x95; + fiat_p256_uint1 x96; + fiat_p256_addcarryx_u32(&x95, &x96, x94, x83, x86); + uint32_t x97; + fiat_p256_uint1 x98; + fiat_p256_addcarryx_u32(&x97, &x98, x96, x81, x84); + uint32_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u32(&x99, &x100, x98, x79, x82); + uint32_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u32(&x101, &x102, x100, x77, x80); + uint32_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u32(&x103, &x104, x102, x75, x78); + uint32_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u32(&x105, &x106, x104, 0x0, x76); + uint32_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u32(&x107, &x108, 0x0, x89, x57); + uint32_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u32(&x109, &x110, x108, x91, x59); + uint32_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u32(&x111, &x112, x110, x93, x61); + uint32_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u32(&x113, &x114, x112, x95, x63); + uint32_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u32(&x115, &x116, x114, x97, x65); + uint32_t x117; + fiat_p256_uint1 x118; + fiat_p256_addcarryx_u32(&x117, &x118, x116, x99, x67); + uint32_t x119; + fiat_p256_uint1 x120; + fiat_p256_addcarryx_u32(&x119, &x120, x118, x101, x69); + uint32_t x121; + fiat_p256_uint1 x122; + fiat_p256_addcarryx_u32(&x121, &x122, x120, x103, x71); + uint32_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u32(&x123, &x124, x122, x105, (fiat_p256_uint1)x73); + uint32_t x125; + uint32_t x126; + fiat_p256_mulx_u32(&x125, &x126, x107, UINT32_C(0xffffffff)); + uint32_t x127; + uint32_t x128; + fiat_p256_mulx_u32(&x127, &x128, x107, UINT32_C(0xffffffff)); + uint32_t x129; + uint32_t x130; + fiat_p256_mulx_u32(&x129, &x130, x107, UINT32_C(0xffffffff)); + uint32_t x131; + uint32_t x132; + fiat_p256_mulx_u32(&x131, &x132, x107, UINT32_C(0xffffffff)); + uint32_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u32(&x133, &x134, 0x0, x129, x132); + uint32_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u32(&x135, &x136, x134, x127, x130); + uint32_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u32(&x137, &x138, x136, 0x0, x128); + uint32_t x139; + fiat_p256_uint1 x140; + fiat_p256_addcarryx_u32(&x139, &x140, 0x0, x131, x107); + uint32_t x141; + fiat_p256_uint1 x142; + fiat_p256_addcarryx_u32(&x141, &x142, x140, x133, x109); + uint32_t x143; + fiat_p256_uint1 x144; + fiat_p256_addcarryx_u32(&x143, &x144, x142, x135, x111); + uint32_t x145; + fiat_p256_uint1 x146; + fiat_p256_addcarryx_u32(&x145, &x146, x144, x137, x113); + uint32_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u32(&x147, &x148, x146, 0x0, x115); + uint32_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u32(&x149, &x150, x148, 0x0, x117); + uint32_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u32(&x151, &x152, x150, x107, x119); + uint32_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u32(&x153, &x154, x152, x125, x121); + uint32_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u32(&x155, &x156, x154, x126, x123); + uint32_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u32(&x157, &x158, x156, 0x0, x124); + uint32_t x159; + uint32_t x160; + fiat_p256_mulx_u32(&x159, &x160, x2, (arg2[7])); + uint32_t x161; + uint32_t x162; + fiat_p256_mulx_u32(&x161, &x162, x2, (arg2[6])); + uint32_t x163; + uint32_t x164; + fiat_p256_mulx_u32(&x163, &x164, x2, (arg2[5])); + uint32_t x165; + uint32_t x166; + fiat_p256_mulx_u32(&x165, &x166, x2, (arg2[4])); + uint32_t x167; + uint32_t x168; + fiat_p256_mulx_u32(&x167, &x168, x2, (arg2[3])); + uint32_t x169; + uint32_t x170; + fiat_p256_mulx_u32(&x169, &x170, x2, (arg2[2])); + uint32_t x171; + uint32_t x172; + fiat_p256_mulx_u32(&x171, &x172, x2, (arg2[1])); + uint32_t x173; + uint32_t x174; + fiat_p256_mulx_u32(&x173, &x174, x2, (arg2[0])); + uint32_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u32(&x175, &x176, 0x0, x171, x174); + uint32_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u32(&x177, &x178, x176, x169, x172); + uint32_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u32(&x179, &x180, x178, x167, x170); + uint32_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u32(&x181, &x182, x180, x165, x168); + uint32_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u32(&x183, &x184, x182, x163, x166); + uint32_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u32(&x185, &x186, x184, x161, x164); + uint32_t x187; + fiat_p256_uint1 x188; + fiat_p256_addcarryx_u32(&x187, &x188, x186, x159, x162); + uint32_t x189; + fiat_p256_uint1 x190; + fiat_p256_addcarryx_u32(&x189, &x190, x188, 0x0, x160); + uint32_t x191; + fiat_p256_uint1 x192; + fiat_p256_addcarryx_u32(&x191, &x192, 0x0, x173, x141); + uint32_t x193; + fiat_p256_uint1 x194; + fiat_p256_addcarryx_u32(&x193, &x194, x192, x175, x143); + uint32_t x195; + fiat_p256_uint1 x196; + fiat_p256_addcarryx_u32(&x195, &x196, x194, x177, x145); + uint32_t x197; + fiat_p256_uint1 x198; + fiat_p256_addcarryx_u32(&x197, &x198, x196, x179, x147); + uint32_t x199; + fiat_p256_uint1 x200; + fiat_p256_addcarryx_u32(&x199, &x200, x198, x181, x149); + uint32_t x201; + fiat_p256_uint1 x202; + fiat_p256_addcarryx_u32(&x201, &x202, x200, x183, x151); + uint32_t x203; + fiat_p256_uint1 x204; + fiat_p256_addcarryx_u32(&x203, &x204, x202, x185, x153); + uint32_t x205; + fiat_p256_uint1 x206; + fiat_p256_addcarryx_u32(&x205, &x206, x204, x187, x155); + uint32_t x207; + fiat_p256_uint1 x208; + fiat_p256_addcarryx_u32(&x207, &x208, x206, x189, x157); + uint32_t x209; + uint32_t x210; + fiat_p256_mulx_u32(&x209, &x210, x191, UINT32_C(0xffffffff)); + uint32_t x211; + uint32_t x212; + fiat_p256_mulx_u32(&x211, &x212, x191, UINT32_C(0xffffffff)); + uint32_t x213; + uint32_t x214; + fiat_p256_mulx_u32(&x213, &x214, x191, UINT32_C(0xffffffff)); + uint32_t x215; + uint32_t x216; + fiat_p256_mulx_u32(&x215, &x216, x191, UINT32_C(0xffffffff)); + uint32_t x217; + fiat_p256_uint1 x218; + fiat_p256_addcarryx_u32(&x217, &x218, 0x0, x213, x216); + uint32_t x219; + fiat_p256_uint1 x220; + fiat_p256_addcarryx_u32(&x219, &x220, x218, x211, x214); + uint32_t x221; + fiat_p256_uint1 x222; + fiat_p256_addcarryx_u32(&x221, &x222, x220, 0x0, x212); + uint32_t x223; + fiat_p256_uint1 x224; + fiat_p256_addcarryx_u32(&x223, &x224, 0x0, x215, x191); + uint32_t x225; + fiat_p256_uint1 x226; + fiat_p256_addcarryx_u32(&x225, &x226, x224, x217, x193); + uint32_t x227; + fiat_p256_uint1 x228; + fiat_p256_addcarryx_u32(&x227, &x228, x226, x219, x195); + uint32_t x229; + fiat_p256_uint1 x230; + fiat_p256_addcarryx_u32(&x229, &x230, x228, x221, x197); + uint32_t x231; + fiat_p256_uint1 x232; + fiat_p256_addcarryx_u32(&x231, &x232, x230, 0x0, x199); + uint32_t x233; + fiat_p256_uint1 x234; + fiat_p256_addcarryx_u32(&x233, &x234, x232, 0x0, x201); + uint32_t x235; + fiat_p256_uint1 x236; + fiat_p256_addcarryx_u32(&x235, &x236, x234, x191, x203); + uint32_t x237; + fiat_p256_uint1 x238; + fiat_p256_addcarryx_u32(&x237, &x238, x236, x209, x205); + uint32_t x239; + fiat_p256_uint1 x240; + fiat_p256_addcarryx_u32(&x239, &x240, x238, x210, x207); + uint32_t x241; + fiat_p256_uint1 x242; + fiat_p256_addcarryx_u32(&x241, &x242, x240, 0x0, x208); + uint32_t x243; + uint32_t x244; + fiat_p256_mulx_u32(&x243, &x244, x3, (arg2[7])); + uint32_t x245; + uint32_t x246; + fiat_p256_mulx_u32(&x245, &x246, x3, (arg2[6])); + uint32_t x247; + uint32_t x248; + fiat_p256_mulx_u32(&x247, &x248, x3, (arg2[5])); + uint32_t x249; + uint32_t x250; + fiat_p256_mulx_u32(&x249, &x250, x3, (arg2[4])); + uint32_t x251; + uint32_t x252; + fiat_p256_mulx_u32(&x251, &x252, x3, (arg2[3])); + uint32_t x253; + uint32_t x254; + fiat_p256_mulx_u32(&x253, &x254, x3, (arg2[2])); + uint32_t x255; + uint32_t x256; + fiat_p256_mulx_u32(&x255, &x256, x3, (arg2[1])); + uint32_t x257; + uint32_t x258; + fiat_p256_mulx_u32(&x257, &x258, x3, (arg2[0])); + uint32_t x259; + fiat_p256_uint1 x260; + fiat_p256_addcarryx_u32(&x259, &x260, 0x0, x255, x258); + uint32_t x261; + fiat_p256_uint1 x262; + fiat_p256_addcarryx_u32(&x261, &x262, x260, x253, x256); + uint32_t x263; + fiat_p256_uint1 x264; + fiat_p256_addcarryx_u32(&x263, &x264, x262, x251, x254); + uint32_t x265; + fiat_p256_uint1 x266; + fiat_p256_addcarryx_u32(&x265, &x266, x264, x249, x252); + uint32_t x267; + fiat_p256_uint1 x268; + fiat_p256_addcarryx_u32(&x267, &x268, x266, x247, x250); + uint32_t x269; + fiat_p256_uint1 x270; + fiat_p256_addcarryx_u32(&x269, &x270, x268, x245, x248); + uint32_t x271; + fiat_p256_uint1 x272; + fiat_p256_addcarryx_u32(&x271, &x272, x270, x243, x246); + uint32_t x273; + fiat_p256_uint1 x274; + fiat_p256_addcarryx_u32(&x273, &x274, x272, 0x0, x244); + uint32_t x275; + fiat_p256_uint1 x276; + fiat_p256_addcarryx_u32(&x275, &x276, 0x0, x257, x225); + uint32_t x277; + fiat_p256_uint1 x278; + fiat_p256_addcarryx_u32(&x277, &x278, x276, x259, x227); + uint32_t x279; + fiat_p256_uint1 x280; + fiat_p256_addcarryx_u32(&x279, &x280, x278, x261, x229); + uint32_t x281; + fiat_p256_uint1 x282; + fiat_p256_addcarryx_u32(&x281, &x282, x280, x263, x231); + uint32_t x283; + fiat_p256_uint1 x284; + fiat_p256_addcarryx_u32(&x283, &x284, x282, x265, x233); + uint32_t x285; + fiat_p256_uint1 x286; + fiat_p256_addcarryx_u32(&x285, &x286, x284, x267, x235); + uint32_t x287; + fiat_p256_uint1 x288; + fiat_p256_addcarryx_u32(&x287, &x288, x286, x269, x237); + uint32_t x289; + fiat_p256_uint1 x290; + fiat_p256_addcarryx_u32(&x289, &x290, x288, x271, x239); + uint32_t x291; + fiat_p256_uint1 x292; + fiat_p256_addcarryx_u32(&x291, &x292, x290, x273, x241); + uint32_t x293; + uint32_t x294; + fiat_p256_mulx_u32(&x293, &x294, x275, UINT32_C(0xffffffff)); + uint32_t x295; + uint32_t x296; + fiat_p256_mulx_u32(&x295, &x296, x275, UINT32_C(0xffffffff)); + uint32_t x297; + uint32_t x298; + fiat_p256_mulx_u32(&x297, &x298, x275, UINT32_C(0xffffffff)); + uint32_t x299; + uint32_t x300; + fiat_p256_mulx_u32(&x299, &x300, x275, UINT32_C(0xffffffff)); + uint32_t x301; + fiat_p256_uint1 x302; + fiat_p256_addcarryx_u32(&x301, &x302, 0x0, x297, x300); + uint32_t x303; + fiat_p256_uint1 x304; + fiat_p256_addcarryx_u32(&x303, &x304, x302, x295, x298); + uint32_t x305; + fiat_p256_uint1 x306; + fiat_p256_addcarryx_u32(&x305, &x306, x304, 0x0, x296); + uint32_t x307; + fiat_p256_uint1 x308; + fiat_p256_addcarryx_u32(&x307, &x308, 0x0, x299, x275); + uint32_t x309; + fiat_p256_uint1 x310; + fiat_p256_addcarryx_u32(&x309, &x310, x308, x301, x277); + uint32_t x311; + fiat_p256_uint1 x312; + fiat_p256_addcarryx_u32(&x311, &x312, x310, x303, x279); + uint32_t x313; + fiat_p256_uint1 x314; + fiat_p256_addcarryx_u32(&x313, &x314, x312, x305, x281); + uint32_t x315; + fiat_p256_uint1 x316; + fiat_p256_addcarryx_u32(&x315, &x316, x314, 0x0, x283); + uint32_t x317; + fiat_p256_uint1 x318; + fiat_p256_addcarryx_u32(&x317, &x318, x316, 0x0, x285); + uint32_t x319; + fiat_p256_uint1 x320; + fiat_p256_addcarryx_u32(&x319, &x320, x318, x275, x287); + uint32_t x321; + fiat_p256_uint1 x322; + fiat_p256_addcarryx_u32(&x321, &x322, x320, x293, x289); + uint32_t x323; + fiat_p256_uint1 x324; + fiat_p256_addcarryx_u32(&x323, &x324, x322, x294, x291); + uint32_t x325; + fiat_p256_uint1 x326; + fiat_p256_addcarryx_u32(&x325, &x326, x324, 0x0, x292); + uint32_t x327; + uint32_t x328; + fiat_p256_mulx_u32(&x327, &x328, x4, (arg2[7])); + uint32_t x329; + uint32_t x330; + fiat_p256_mulx_u32(&x329, &x330, x4, (arg2[6])); + uint32_t x331; + uint32_t x332; + fiat_p256_mulx_u32(&x331, &x332, x4, (arg2[5])); + uint32_t x333; + uint32_t x334; + fiat_p256_mulx_u32(&x333, &x334, x4, (arg2[4])); + uint32_t x335; + uint32_t x336; + fiat_p256_mulx_u32(&x335, &x336, x4, (arg2[3])); + uint32_t x337; + uint32_t x338; + fiat_p256_mulx_u32(&x337, &x338, x4, (arg2[2])); + uint32_t x339; + uint32_t x340; + fiat_p256_mulx_u32(&x339, &x340, x4, (arg2[1])); + uint32_t x341; + uint32_t x342; + fiat_p256_mulx_u32(&x341, &x342, x4, (arg2[0])); + uint32_t x343; + fiat_p256_uint1 x344; + fiat_p256_addcarryx_u32(&x343, &x344, 0x0, x339, x342); + uint32_t x345; + fiat_p256_uint1 x346; + fiat_p256_addcarryx_u32(&x345, &x346, x344, x337, x340); + uint32_t x347; + fiat_p256_uint1 x348; + fiat_p256_addcarryx_u32(&x347, &x348, x346, x335, x338); + uint32_t x349; + fiat_p256_uint1 x350; + fiat_p256_addcarryx_u32(&x349, &x350, x348, x333, x336); + uint32_t x351; + fiat_p256_uint1 x352; + fiat_p256_addcarryx_u32(&x351, &x352, x350, x331, x334); + uint32_t x353; + fiat_p256_uint1 x354; + fiat_p256_addcarryx_u32(&x353, &x354, x352, x329, x332); + uint32_t x355; + fiat_p256_uint1 x356; + fiat_p256_addcarryx_u32(&x355, &x356, x354, x327, x330); + uint32_t x357; + fiat_p256_uint1 x358; + fiat_p256_addcarryx_u32(&x357, &x358, x356, 0x0, x328); + uint32_t x359; + fiat_p256_uint1 x360; + fiat_p256_addcarryx_u32(&x359, &x360, 0x0, x341, x309); + uint32_t x361; + fiat_p256_uint1 x362; + fiat_p256_addcarryx_u32(&x361, &x362, x360, x343, x311); + uint32_t x363; + fiat_p256_uint1 x364; + fiat_p256_addcarryx_u32(&x363, &x364, x362, x345, x313); + uint32_t x365; + fiat_p256_uint1 x366; + fiat_p256_addcarryx_u32(&x365, &x366, x364, x347, x315); + uint32_t x367; + fiat_p256_uint1 x368; + fiat_p256_addcarryx_u32(&x367, &x368, x366, x349, x317); + uint32_t x369; + fiat_p256_uint1 x370; + fiat_p256_addcarryx_u32(&x369, &x370, x368, x351, x319); + uint32_t x371; + fiat_p256_uint1 x372; + fiat_p256_addcarryx_u32(&x371, &x372, x370, x353, x321); + uint32_t x373; + fiat_p256_uint1 x374; + fiat_p256_addcarryx_u32(&x373, &x374, x372, x355, x323); + uint32_t x375; + fiat_p256_uint1 x376; + fiat_p256_addcarryx_u32(&x375, &x376, x374, x357, x325); + uint32_t x377; + uint32_t x378; + fiat_p256_mulx_u32(&x377, &x378, x359, UINT32_C(0xffffffff)); + uint32_t x379; + uint32_t x380; + fiat_p256_mulx_u32(&x379, &x380, x359, UINT32_C(0xffffffff)); + uint32_t x381; + uint32_t x382; + fiat_p256_mulx_u32(&x381, &x382, x359, UINT32_C(0xffffffff)); + uint32_t x383; + uint32_t x384; + fiat_p256_mulx_u32(&x383, &x384, x359, UINT32_C(0xffffffff)); + uint32_t x385; + fiat_p256_uint1 x386; + fiat_p256_addcarryx_u32(&x385, &x386, 0x0, x381, x384); + uint32_t x387; + fiat_p256_uint1 x388; + fiat_p256_addcarryx_u32(&x387, &x388, x386, x379, x382); + uint32_t x389; + fiat_p256_uint1 x390; + fiat_p256_addcarryx_u32(&x389, &x390, x388, 0x0, x380); + uint32_t x391; + fiat_p256_uint1 x392; + fiat_p256_addcarryx_u32(&x391, &x392, 0x0, x383, x359); + uint32_t x393; + fiat_p256_uint1 x394; + fiat_p256_addcarryx_u32(&x393, &x394, x392, x385, x361); + uint32_t x395; + fiat_p256_uint1 x396; + fiat_p256_addcarryx_u32(&x395, &x396, x394, x387, x363); + uint32_t x397; + fiat_p256_uint1 x398; + fiat_p256_addcarryx_u32(&x397, &x398, x396, x389, x365); + uint32_t x399; + fiat_p256_uint1 x400; + fiat_p256_addcarryx_u32(&x399, &x400, x398, 0x0, x367); + uint32_t x401; + fiat_p256_uint1 x402; + fiat_p256_addcarryx_u32(&x401, &x402, x400, 0x0, x369); + uint32_t x403; + fiat_p256_uint1 x404; + fiat_p256_addcarryx_u32(&x403, &x404, x402, x359, x371); + uint32_t x405; + fiat_p256_uint1 x406; + fiat_p256_addcarryx_u32(&x405, &x406, x404, x377, x373); + uint32_t x407; + fiat_p256_uint1 x408; + fiat_p256_addcarryx_u32(&x407, &x408, x406, x378, x375); + uint32_t x409; + fiat_p256_uint1 x410; + fiat_p256_addcarryx_u32(&x409, &x410, x408, 0x0, x376); + uint32_t x411; + uint32_t x412; + fiat_p256_mulx_u32(&x411, &x412, x5, (arg2[7])); + uint32_t x413; + uint32_t x414; + fiat_p256_mulx_u32(&x413, &x414, x5, (arg2[6])); + uint32_t x415; + uint32_t x416; + fiat_p256_mulx_u32(&x415, &x416, x5, (arg2[5])); + uint32_t x417; + uint32_t x418; + fiat_p256_mulx_u32(&x417, &x418, x5, (arg2[4])); + uint32_t x419; + uint32_t x420; + fiat_p256_mulx_u32(&x419, &x420, x5, (arg2[3])); + uint32_t x421; + uint32_t x422; + fiat_p256_mulx_u32(&x421, &x422, x5, (arg2[2])); + uint32_t x423; + uint32_t x424; + fiat_p256_mulx_u32(&x423, &x424, x5, (arg2[1])); + uint32_t x425; + uint32_t x426; + fiat_p256_mulx_u32(&x425, &x426, x5, (arg2[0])); + uint32_t x427; + fiat_p256_uint1 x428; + fiat_p256_addcarryx_u32(&x427, &x428, 0x0, x423, x426); + uint32_t x429; + fiat_p256_uint1 x430; + fiat_p256_addcarryx_u32(&x429, &x430, x428, x421, x424); + uint32_t x431; + fiat_p256_uint1 x432; + fiat_p256_addcarryx_u32(&x431, &x432, x430, x419, x422); + uint32_t x433; + fiat_p256_uint1 x434; + fiat_p256_addcarryx_u32(&x433, &x434, x432, x417, x420); + uint32_t x435; + fiat_p256_uint1 x436; + fiat_p256_addcarryx_u32(&x435, &x436, x434, x415, x418); + uint32_t x437; + fiat_p256_uint1 x438; + fiat_p256_addcarryx_u32(&x437, &x438, x436, x413, x416); + uint32_t x439; + fiat_p256_uint1 x440; + fiat_p256_addcarryx_u32(&x439, &x440, x438, x411, x414); + uint32_t x441; + fiat_p256_uint1 x442; + fiat_p256_addcarryx_u32(&x441, &x442, x440, 0x0, x412); + uint32_t x443; + fiat_p256_uint1 x444; + fiat_p256_addcarryx_u32(&x443, &x444, 0x0, x425, x393); + uint32_t x445; + fiat_p256_uint1 x446; + fiat_p256_addcarryx_u32(&x445, &x446, x444, x427, x395); + uint32_t x447; + fiat_p256_uint1 x448; + fiat_p256_addcarryx_u32(&x447, &x448, x446, x429, x397); + uint32_t x449; + fiat_p256_uint1 x450; + fiat_p256_addcarryx_u32(&x449, &x450, x448, x431, x399); + uint32_t x451; + fiat_p256_uint1 x452; + fiat_p256_addcarryx_u32(&x451, &x452, x450, x433, x401); + uint32_t x453; + fiat_p256_uint1 x454; + fiat_p256_addcarryx_u32(&x453, &x454, x452, x435, x403); + uint32_t x455; + fiat_p256_uint1 x456; + fiat_p256_addcarryx_u32(&x455, &x456, x454, x437, x405); + uint32_t x457; + fiat_p256_uint1 x458; + fiat_p256_addcarryx_u32(&x457, &x458, x456, x439, x407); + uint32_t x459; + fiat_p256_uint1 x460; + fiat_p256_addcarryx_u32(&x459, &x460, x458, x441, x409); + uint32_t x461; + uint32_t x462; + fiat_p256_mulx_u32(&x461, &x462, x443, UINT32_C(0xffffffff)); + uint32_t x463; + uint32_t x464; + fiat_p256_mulx_u32(&x463, &x464, x443, UINT32_C(0xffffffff)); + uint32_t x465; + uint32_t x466; + fiat_p256_mulx_u32(&x465, &x466, x443, UINT32_C(0xffffffff)); + uint32_t x467; + uint32_t x468; + fiat_p256_mulx_u32(&x467, &x468, x443, UINT32_C(0xffffffff)); + uint32_t x469; + fiat_p256_uint1 x470; + fiat_p256_addcarryx_u32(&x469, &x470, 0x0, x465, x468); + uint32_t x471; + fiat_p256_uint1 x472; + fiat_p256_addcarryx_u32(&x471, &x472, x470, x463, x466); + uint32_t x473; + fiat_p256_uint1 x474; + fiat_p256_addcarryx_u32(&x473, &x474, x472, 0x0, x464); + uint32_t x475; + fiat_p256_uint1 x476; + fiat_p256_addcarryx_u32(&x475, &x476, 0x0, x467, x443); + uint32_t x477; + fiat_p256_uint1 x478; + fiat_p256_addcarryx_u32(&x477, &x478, x476, x469, x445); + uint32_t x479; + fiat_p256_uint1 x480; + fiat_p256_addcarryx_u32(&x479, &x480, x478, x471, x447); + uint32_t x481; + fiat_p256_uint1 x482; + fiat_p256_addcarryx_u32(&x481, &x482, x480, x473, x449); + uint32_t x483; + fiat_p256_uint1 x484; + fiat_p256_addcarryx_u32(&x483, &x484, x482, 0x0, x451); + uint32_t x485; + fiat_p256_uint1 x486; + fiat_p256_addcarryx_u32(&x485, &x486, x484, 0x0, x453); + uint32_t x487; + fiat_p256_uint1 x488; + fiat_p256_addcarryx_u32(&x487, &x488, x486, x443, x455); + uint32_t x489; + fiat_p256_uint1 x490; + fiat_p256_addcarryx_u32(&x489, &x490, x488, x461, x457); + uint32_t x491; + fiat_p256_uint1 x492; + fiat_p256_addcarryx_u32(&x491, &x492, x490, x462, x459); + uint32_t x493; + fiat_p256_uint1 x494; + fiat_p256_addcarryx_u32(&x493, &x494, x492, 0x0, x460); + uint32_t x495; + uint32_t x496; + fiat_p256_mulx_u32(&x495, &x496, x6, (arg2[7])); + uint32_t x497; + uint32_t x498; + fiat_p256_mulx_u32(&x497, &x498, x6, (arg2[6])); + uint32_t x499; + uint32_t x500; + fiat_p256_mulx_u32(&x499, &x500, x6, (arg2[5])); + uint32_t x501; + uint32_t x502; + fiat_p256_mulx_u32(&x501, &x502, x6, (arg2[4])); + uint32_t x503; + uint32_t x504; + fiat_p256_mulx_u32(&x503, &x504, x6, (arg2[3])); + uint32_t x505; + uint32_t x506; + fiat_p256_mulx_u32(&x505, &x506, x6, (arg2[2])); + uint32_t x507; + uint32_t x508; + fiat_p256_mulx_u32(&x507, &x508, x6, (arg2[1])); + uint32_t x509; + uint32_t x510; + fiat_p256_mulx_u32(&x509, &x510, x6, (arg2[0])); + uint32_t x511; + fiat_p256_uint1 x512; + fiat_p256_addcarryx_u32(&x511, &x512, 0x0, x507, x510); + uint32_t x513; + fiat_p256_uint1 x514; + fiat_p256_addcarryx_u32(&x513, &x514, x512, x505, x508); + uint32_t x515; + fiat_p256_uint1 x516; + fiat_p256_addcarryx_u32(&x515, &x516, x514, x503, x506); + uint32_t x517; + fiat_p256_uint1 x518; + fiat_p256_addcarryx_u32(&x517, &x518, x516, x501, x504); + uint32_t x519; + fiat_p256_uint1 x520; + fiat_p256_addcarryx_u32(&x519, &x520, x518, x499, x502); + uint32_t x521; + fiat_p256_uint1 x522; + fiat_p256_addcarryx_u32(&x521, &x522, x520, x497, x500); + uint32_t x523; + fiat_p256_uint1 x524; + fiat_p256_addcarryx_u32(&x523, &x524, x522, x495, x498); + uint32_t x525; + fiat_p256_uint1 x526; + fiat_p256_addcarryx_u32(&x525, &x526, x524, 0x0, x496); + uint32_t x527; + fiat_p256_uint1 x528; + fiat_p256_addcarryx_u32(&x527, &x528, 0x0, x509, x477); + uint32_t x529; + fiat_p256_uint1 x530; + fiat_p256_addcarryx_u32(&x529, &x530, x528, x511, x479); + uint32_t x531; + fiat_p256_uint1 x532; + fiat_p256_addcarryx_u32(&x531, &x532, x530, x513, x481); + uint32_t x533; + fiat_p256_uint1 x534; + fiat_p256_addcarryx_u32(&x533, &x534, x532, x515, x483); + uint32_t x535; + fiat_p256_uint1 x536; + fiat_p256_addcarryx_u32(&x535, &x536, x534, x517, x485); + uint32_t x537; + fiat_p256_uint1 x538; + fiat_p256_addcarryx_u32(&x537, &x538, x536, x519, x487); + uint32_t x539; + fiat_p256_uint1 x540; + fiat_p256_addcarryx_u32(&x539, &x540, x538, x521, x489); + uint32_t x541; + fiat_p256_uint1 x542; + fiat_p256_addcarryx_u32(&x541, &x542, x540, x523, x491); + uint32_t x543; + fiat_p256_uint1 x544; + fiat_p256_addcarryx_u32(&x543, &x544, x542, x525, x493); + uint32_t x545; + uint32_t x546; + fiat_p256_mulx_u32(&x545, &x546, x527, UINT32_C(0xffffffff)); + uint32_t x547; + uint32_t x548; + fiat_p256_mulx_u32(&x547, &x548, x527, UINT32_C(0xffffffff)); + uint32_t x549; + uint32_t x550; + fiat_p256_mulx_u32(&x549, &x550, x527, UINT32_C(0xffffffff)); + uint32_t x551; + uint32_t x552; + fiat_p256_mulx_u32(&x551, &x552, x527, UINT32_C(0xffffffff)); + uint32_t x553; + fiat_p256_uint1 x554; + fiat_p256_addcarryx_u32(&x553, &x554, 0x0, x549, x552); + uint32_t x555; + fiat_p256_uint1 x556; + fiat_p256_addcarryx_u32(&x555, &x556, x554, x547, x550); + uint32_t x557; + fiat_p256_uint1 x558; + fiat_p256_addcarryx_u32(&x557, &x558, x556, 0x0, x548); + uint32_t x559; + fiat_p256_uint1 x560; + fiat_p256_addcarryx_u32(&x559, &x560, 0x0, x551, x527); + uint32_t x561; + fiat_p256_uint1 x562; + fiat_p256_addcarryx_u32(&x561, &x562, x560, x553, x529); + uint32_t x563; + fiat_p256_uint1 x564; + fiat_p256_addcarryx_u32(&x563, &x564, x562, x555, x531); + uint32_t x565; + fiat_p256_uint1 x566; + fiat_p256_addcarryx_u32(&x565, &x566, x564, x557, x533); + uint32_t x567; + fiat_p256_uint1 x568; + fiat_p256_addcarryx_u32(&x567, &x568, x566, 0x0, x535); + uint32_t x569; + fiat_p256_uint1 x570; + fiat_p256_addcarryx_u32(&x569, &x570, x568, 0x0, x537); + uint32_t x571; + fiat_p256_uint1 x572; + fiat_p256_addcarryx_u32(&x571, &x572, x570, x527, x539); + uint32_t x573; + fiat_p256_uint1 x574; + fiat_p256_addcarryx_u32(&x573, &x574, x572, x545, x541); + uint32_t x575; + fiat_p256_uint1 x576; + fiat_p256_addcarryx_u32(&x575, &x576, x574, x546, x543); + uint32_t x577; + fiat_p256_uint1 x578; + fiat_p256_addcarryx_u32(&x577, &x578, x576, 0x0, x544); + uint32_t x579; + uint32_t x580; + fiat_p256_mulx_u32(&x579, &x580, x7, (arg2[7])); + uint32_t x581; + uint32_t x582; + fiat_p256_mulx_u32(&x581, &x582, x7, (arg2[6])); + uint32_t x583; + uint32_t x584; + fiat_p256_mulx_u32(&x583, &x584, x7, (arg2[5])); + uint32_t x585; + uint32_t x586; + fiat_p256_mulx_u32(&x585, &x586, x7, (arg2[4])); + uint32_t x587; + uint32_t x588; + fiat_p256_mulx_u32(&x587, &x588, x7, (arg2[3])); + uint32_t x589; + uint32_t x590; + fiat_p256_mulx_u32(&x589, &x590, x7, (arg2[2])); + uint32_t x591; + uint32_t x592; + fiat_p256_mulx_u32(&x591, &x592, x7, (arg2[1])); + uint32_t x593; + uint32_t x594; + fiat_p256_mulx_u32(&x593, &x594, x7, (arg2[0])); + uint32_t x595; + fiat_p256_uint1 x596; + fiat_p256_addcarryx_u32(&x595, &x596, 0x0, x591, x594); + uint32_t x597; + fiat_p256_uint1 x598; + fiat_p256_addcarryx_u32(&x597, &x598, x596, x589, x592); + uint32_t x599; + fiat_p256_uint1 x600; + fiat_p256_addcarryx_u32(&x599, &x600, x598, x587, x590); + uint32_t x601; + fiat_p256_uint1 x602; + fiat_p256_addcarryx_u32(&x601, &x602, x600, x585, x588); + uint32_t x603; + fiat_p256_uint1 x604; + fiat_p256_addcarryx_u32(&x603, &x604, x602, x583, x586); + uint32_t x605; + fiat_p256_uint1 x606; + fiat_p256_addcarryx_u32(&x605, &x606, x604, x581, x584); + uint32_t x607; + fiat_p256_uint1 x608; + fiat_p256_addcarryx_u32(&x607, &x608, x606, x579, x582); + uint32_t x609; + fiat_p256_uint1 x610; + fiat_p256_addcarryx_u32(&x609, &x610, x608, 0x0, x580); + uint32_t x611; + fiat_p256_uint1 x612; + fiat_p256_addcarryx_u32(&x611, &x612, 0x0, x593, x561); + uint32_t x613; + fiat_p256_uint1 x614; + fiat_p256_addcarryx_u32(&x613, &x614, x612, x595, x563); + uint32_t x615; + fiat_p256_uint1 x616; + fiat_p256_addcarryx_u32(&x615, &x616, x614, x597, x565); + uint32_t x617; + fiat_p256_uint1 x618; + fiat_p256_addcarryx_u32(&x617, &x618, x616, x599, x567); + uint32_t x619; + fiat_p256_uint1 x620; + fiat_p256_addcarryx_u32(&x619, &x620, x618, x601, x569); + uint32_t x621; + fiat_p256_uint1 x622; + fiat_p256_addcarryx_u32(&x621, &x622, x620, x603, x571); + uint32_t x623; + fiat_p256_uint1 x624; + fiat_p256_addcarryx_u32(&x623, &x624, x622, x605, x573); + uint32_t x625; + fiat_p256_uint1 x626; + fiat_p256_addcarryx_u32(&x625, &x626, x624, x607, x575); + uint32_t x627; + fiat_p256_uint1 x628; + fiat_p256_addcarryx_u32(&x627, &x628, x626, x609, x577); + uint32_t x629; + uint32_t x630; + fiat_p256_mulx_u32(&x629, &x630, x611, UINT32_C(0xffffffff)); + uint32_t x631; + uint32_t x632; + fiat_p256_mulx_u32(&x631, &x632, x611, UINT32_C(0xffffffff)); + uint32_t x633; + uint32_t x634; + fiat_p256_mulx_u32(&x633, &x634, x611, UINT32_C(0xffffffff)); + uint32_t x635; + uint32_t x636; + fiat_p256_mulx_u32(&x635, &x636, x611, UINT32_C(0xffffffff)); + uint32_t x637; + fiat_p256_uint1 x638; + fiat_p256_addcarryx_u32(&x637, &x638, 0x0, x633, x636); + uint32_t x639; + fiat_p256_uint1 x640; + fiat_p256_addcarryx_u32(&x639, &x640, x638, x631, x634); + uint32_t x641; + fiat_p256_uint1 x642; + fiat_p256_addcarryx_u32(&x641, &x642, x640, 0x0, x632); + uint32_t x643; + fiat_p256_uint1 x644; + fiat_p256_addcarryx_u32(&x643, &x644, 0x0, x635, x611); + uint32_t x645; + fiat_p256_uint1 x646; + fiat_p256_addcarryx_u32(&x645, &x646, x644, x637, x613); + uint32_t x647; + fiat_p256_uint1 x648; + fiat_p256_addcarryx_u32(&x647, &x648, x646, x639, x615); + uint32_t x649; + fiat_p256_uint1 x650; + fiat_p256_addcarryx_u32(&x649, &x650, x648, x641, x617); + uint32_t x651; + fiat_p256_uint1 x652; + fiat_p256_addcarryx_u32(&x651, &x652, x650, 0x0, x619); + uint32_t x653; + fiat_p256_uint1 x654; + fiat_p256_addcarryx_u32(&x653, &x654, x652, 0x0, x621); + uint32_t x655; + fiat_p256_uint1 x656; + fiat_p256_addcarryx_u32(&x655, &x656, x654, x611, x623); + uint32_t x657; + fiat_p256_uint1 x658; + fiat_p256_addcarryx_u32(&x657, &x658, x656, x629, x625); + uint32_t x659; + fiat_p256_uint1 x660; + fiat_p256_addcarryx_u32(&x659, &x660, x658, x630, x627); + uint32_t x661; + fiat_p256_uint1 x662; + fiat_p256_addcarryx_u32(&x661, &x662, x660, 0x0, x628); + uint32_t x663; + fiat_p256_uint1 x664; + fiat_p256_subborrowx_u32(&x663, &x664, 0x0, x645, UINT32_C(0xffffffff)); + uint32_t x665; + fiat_p256_uint1 x666; + fiat_p256_subborrowx_u32(&x665, &x666, x664, x647, UINT32_C(0xffffffff)); + uint32_t x667; + fiat_p256_uint1 x668; + fiat_p256_subborrowx_u32(&x667, &x668, x666, x649, UINT32_C(0xffffffff)); + uint32_t x669; + fiat_p256_uint1 x670; + fiat_p256_subborrowx_u32(&x669, &x670, x668, x651, 0x0); + uint32_t x671; + fiat_p256_uint1 x672; + fiat_p256_subborrowx_u32(&x671, &x672, x670, x653, 0x0); + uint32_t x673; + fiat_p256_uint1 x674; + fiat_p256_subborrowx_u32(&x673, &x674, x672, x655, 0x0); + uint32_t x675; + fiat_p256_uint1 x676; + fiat_p256_subborrowx_u32(&x675, &x676, x674, x657, 0x1); + uint32_t x677; + fiat_p256_uint1 x678; + fiat_p256_subborrowx_u32(&x677, &x678, x676, x659, UINT32_C(0xffffffff)); + uint32_t x679; + fiat_p256_uint1 x680; + fiat_p256_subborrowx_u32(&x679, &x680, x678, x661, 0x0); + uint32_t x681; + fiat_p256_cmovznz_u32(&x681, x680, x663, x645); + uint32_t x682; + fiat_p256_cmovznz_u32(&x682, x680, x665, x647); + uint32_t x683; + fiat_p256_cmovznz_u32(&x683, x680, x667, x649); + uint32_t x684; + fiat_p256_cmovznz_u32(&x684, x680, x669, x651); + uint32_t x685; + fiat_p256_cmovznz_u32(&x685, x680, x671, x653); + uint32_t x686; + fiat_p256_cmovznz_u32(&x686, x680, x673, x655); + uint32_t x687; + fiat_p256_cmovznz_u32(&x687, x680, x675, x657); + uint32_t x688; + fiat_p256_cmovznz_u32(&x688, x680, x677, x659); + out1[0] = x681; + out1[1] = x682; + out1[2] = x683; + out1[3] = x684; + out1[4] = x685; + out1[5] = x686; + out1[6] = x687; + out1[7] = x688; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_square(uint32_t out1[8], const uint32_t arg1[8]) { + uint32_t x1 = (arg1[1]); + uint32_t x2 = (arg1[2]); + uint32_t x3 = (arg1[3]); + uint32_t x4 = (arg1[4]); + uint32_t x5 = (arg1[5]); + uint32_t x6 = (arg1[6]); + uint32_t x7 = (arg1[7]); + uint32_t x8 = (arg1[0]); + uint32_t x9; + uint32_t x10; + fiat_p256_mulx_u32(&x9, &x10, x8, (arg1[7])); + uint32_t x11; + uint32_t x12; + fiat_p256_mulx_u32(&x11, &x12, x8, (arg1[6])); + uint32_t x13; + uint32_t x14; + fiat_p256_mulx_u32(&x13, &x14, x8, (arg1[5])); + uint32_t x15; + uint32_t x16; + fiat_p256_mulx_u32(&x15, &x16, x8, (arg1[4])); + uint32_t x17; + uint32_t x18; + fiat_p256_mulx_u32(&x17, &x18, x8, (arg1[3])); + uint32_t x19; + uint32_t x20; + fiat_p256_mulx_u32(&x19, &x20, x8, (arg1[2])); + uint32_t x21; + uint32_t x22; + fiat_p256_mulx_u32(&x21, &x22, x8, (arg1[1])); + uint32_t x23; + uint32_t x24; + fiat_p256_mulx_u32(&x23, &x24, x8, (arg1[0])); + uint32_t x25; + fiat_p256_uint1 x26; + fiat_p256_addcarryx_u32(&x25, &x26, 0x0, x21, x24); + uint32_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u32(&x27, &x28, x26, x19, x22); + uint32_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u32(&x29, &x30, x28, x17, x20); + uint32_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u32(&x31, &x32, x30, x15, x18); + uint32_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u32(&x33, &x34, x32, x13, x16); + uint32_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u32(&x35, &x36, x34, x11, x14); + uint32_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u32(&x37, &x38, x36, x9, x12); + uint32_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u32(&x39, &x40, x38, 0x0, x10); + uint32_t x41; + uint32_t x42; + fiat_p256_mulx_u32(&x41, &x42, x23, UINT32_C(0xffffffff)); + uint32_t x43; + uint32_t x44; + fiat_p256_mulx_u32(&x43, &x44, x23, UINT32_C(0xffffffff)); + uint32_t x45; + uint32_t x46; + fiat_p256_mulx_u32(&x45, &x46, x23, UINT32_C(0xffffffff)); + uint32_t x47; + uint32_t x48; + fiat_p256_mulx_u32(&x47, &x48, x23, UINT32_C(0xffffffff)); + uint32_t x49; + fiat_p256_uint1 x50; + fiat_p256_addcarryx_u32(&x49, &x50, 0x0, x45, x48); + uint32_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u32(&x51, &x52, x50, x43, x46); + uint32_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u32(&x53, &x54, x52, 0x0, x44); + uint32_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u32(&x55, &x56, 0x0, x47, x23); + uint32_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u32(&x57, &x58, x56, x49, x25); + uint32_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u32(&x59, &x60, x58, x51, x27); + uint32_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u32(&x61, &x62, x60, x53, x29); + uint32_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u32(&x63, &x64, x62, 0x0, x31); + uint32_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u32(&x65, &x66, x64, 0x0, x33); + uint32_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u32(&x67, &x68, x66, x23, x35); + uint32_t x69; + fiat_p256_uint1 x70; + fiat_p256_addcarryx_u32(&x69, &x70, x68, x41, x37); + uint32_t x71; + fiat_p256_uint1 x72; + fiat_p256_addcarryx_u32(&x71, &x72, x70, x42, x39); + uint32_t x73; + fiat_p256_uint1 x74; + fiat_p256_addcarryx_u32(&x73, &x74, x72, 0x0, 0x0); + uint32_t x75; + uint32_t x76; + fiat_p256_mulx_u32(&x75, &x76, x1, (arg1[7])); + uint32_t x77; + uint32_t x78; + fiat_p256_mulx_u32(&x77, &x78, x1, (arg1[6])); + uint32_t x79; + uint32_t x80; + fiat_p256_mulx_u32(&x79, &x80, x1, (arg1[5])); + uint32_t x81; + uint32_t x82; + fiat_p256_mulx_u32(&x81, &x82, x1, (arg1[4])); + uint32_t x83; + uint32_t x84; + fiat_p256_mulx_u32(&x83, &x84, x1, (arg1[3])); + uint32_t x85; + uint32_t x86; + fiat_p256_mulx_u32(&x85, &x86, x1, (arg1[2])); + uint32_t x87; + uint32_t x88; + fiat_p256_mulx_u32(&x87, &x88, x1, (arg1[1])); + uint32_t x89; + uint32_t x90; + fiat_p256_mulx_u32(&x89, &x90, x1, (arg1[0])); + uint32_t x91; + fiat_p256_uint1 x92; + fiat_p256_addcarryx_u32(&x91, &x92, 0x0, x87, x90); + uint32_t x93; + fiat_p256_uint1 x94; + fiat_p256_addcarryx_u32(&x93, &x94, x92, x85, x88); + uint32_t x95; + fiat_p256_uint1 x96; + fiat_p256_addcarryx_u32(&x95, &x96, x94, x83, x86); + uint32_t x97; + fiat_p256_uint1 x98; + fiat_p256_addcarryx_u32(&x97, &x98, x96, x81, x84); + uint32_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u32(&x99, &x100, x98, x79, x82); + uint32_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u32(&x101, &x102, x100, x77, x80); + uint32_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u32(&x103, &x104, x102, x75, x78); + uint32_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u32(&x105, &x106, x104, 0x0, x76); + uint32_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u32(&x107, &x108, 0x0, x89, x57); + uint32_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u32(&x109, &x110, x108, x91, x59); + uint32_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u32(&x111, &x112, x110, x93, x61); + uint32_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u32(&x113, &x114, x112, x95, x63); + uint32_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u32(&x115, &x116, x114, x97, x65); + uint32_t x117; + fiat_p256_uint1 x118; + fiat_p256_addcarryx_u32(&x117, &x118, x116, x99, x67); + uint32_t x119; + fiat_p256_uint1 x120; + fiat_p256_addcarryx_u32(&x119, &x120, x118, x101, x69); + uint32_t x121; + fiat_p256_uint1 x122; + fiat_p256_addcarryx_u32(&x121, &x122, x120, x103, x71); + uint32_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u32(&x123, &x124, x122, x105, (fiat_p256_uint1)x73); + uint32_t x125; + uint32_t x126; + fiat_p256_mulx_u32(&x125, &x126, x107, UINT32_C(0xffffffff)); + uint32_t x127; + uint32_t x128; + fiat_p256_mulx_u32(&x127, &x128, x107, UINT32_C(0xffffffff)); + uint32_t x129; + uint32_t x130; + fiat_p256_mulx_u32(&x129, &x130, x107, UINT32_C(0xffffffff)); + uint32_t x131; + uint32_t x132; + fiat_p256_mulx_u32(&x131, &x132, x107, UINT32_C(0xffffffff)); + uint32_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u32(&x133, &x134, 0x0, x129, x132); + uint32_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u32(&x135, &x136, x134, x127, x130); + uint32_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u32(&x137, &x138, x136, 0x0, x128); + uint32_t x139; + fiat_p256_uint1 x140; + fiat_p256_addcarryx_u32(&x139, &x140, 0x0, x131, x107); + uint32_t x141; + fiat_p256_uint1 x142; + fiat_p256_addcarryx_u32(&x141, &x142, x140, x133, x109); + uint32_t x143; + fiat_p256_uint1 x144; + fiat_p256_addcarryx_u32(&x143, &x144, x142, x135, x111); + uint32_t x145; + fiat_p256_uint1 x146; + fiat_p256_addcarryx_u32(&x145, &x146, x144, x137, x113); + uint32_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u32(&x147, &x148, x146, 0x0, x115); + uint32_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u32(&x149, &x150, x148, 0x0, x117); + uint32_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u32(&x151, &x152, x150, x107, x119); + uint32_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u32(&x153, &x154, x152, x125, x121); + uint32_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u32(&x155, &x156, x154, x126, x123); + uint32_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u32(&x157, &x158, x156, 0x0, x124); + uint32_t x159; + uint32_t x160; + fiat_p256_mulx_u32(&x159, &x160, x2, (arg1[7])); + uint32_t x161; + uint32_t x162; + fiat_p256_mulx_u32(&x161, &x162, x2, (arg1[6])); + uint32_t x163; + uint32_t x164; + fiat_p256_mulx_u32(&x163, &x164, x2, (arg1[5])); + uint32_t x165; + uint32_t x166; + fiat_p256_mulx_u32(&x165, &x166, x2, (arg1[4])); + uint32_t x167; + uint32_t x168; + fiat_p256_mulx_u32(&x167, &x168, x2, (arg1[3])); + uint32_t x169; + uint32_t x170; + fiat_p256_mulx_u32(&x169, &x170, x2, (arg1[2])); + uint32_t x171; + uint32_t x172; + fiat_p256_mulx_u32(&x171, &x172, x2, (arg1[1])); + uint32_t x173; + uint32_t x174; + fiat_p256_mulx_u32(&x173, &x174, x2, (arg1[0])); + uint32_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u32(&x175, &x176, 0x0, x171, x174); + uint32_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u32(&x177, &x178, x176, x169, x172); + uint32_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u32(&x179, &x180, x178, x167, x170); + uint32_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u32(&x181, &x182, x180, x165, x168); + uint32_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u32(&x183, &x184, x182, x163, x166); + uint32_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u32(&x185, &x186, x184, x161, x164); + uint32_t x187; + fiat_p256_uint1 x188; + fiat_p256_addcarryx_u32(&x187, &x188, x186, x159, x162); + uint32_t x189; + fiat_p256_uint1 x190; + fiat_p256_addcarryx_u32(&x189, &x190, x188, 0x0, x160); + uint32_t x191; + fiat_p256_uint1 x192; + fiat_p256_addcarryx_u32(&x191, &x192, 0x0, x173, x141); + uint32_t x193; + fiat_p256_uint1 x194; + fiat_p256_addcarryx_u32(&x193, &x194, x192, x175, x143); + uint32_t x195; + fiat_p256_uint1 x196; + fiat_p256_addcarryx_u32(&x195, &x196, x194, x177, x145); + uint32_t x197; + fiat_p256_uint1 x198; + fiat_p256_addcarryx_u32(&x197, &x198, x196, x179, x147); + uint32_t x199; + fiat_p256_uint1 x200; + fiat_p256_addcarryx_u32(&x199, &x200, x198, x181, x149); + uint32_t x201; + fiat_p256_uint1 x202; + fiat_p256_addcarryx_u32(&x201, &x202, x200, x183, x151); + uint32_t x203; + fiat_p256_uint1 x204; + fiat_p256_addcarryx_u32(&x203, &x204, x202, x185, x153); + uint32_t x205; + fiat_p256_uint1 x206; + fiat_p256_addcarryx_u32(&x205, &x206, x204, x187, x155); + uint32_t x207; + fiat_p256_uint1 x208; + fiat_p256_addcarryx_u32(&x207, &x208, x206, x189, x157); + uint32_t x209; + uint32_t x210; + fiat_p256_mulx_u32(&x209, &x210, x191, UINT32_C(0xffffffff)); + uint32_t x211; + uint32_t x212; + fiat_p256_mulx_u32(&x211, &x212, x191, UINT32_C(0xffffffff)); + uint32_t x213; + uint32_t x214; + fiat_p256_mulx_u32(&x213, &x214, x191, UINT32_C(0xffffffff)); + uint32_t x215; + uint32_t x216; + fiat_p256_mulx_u32(&x215, &x216, x191, UINT32_C(0xffffffff)); + uint32_t x217; + fiat_p256_uint1 x218; + fiat_p256_addcarryx_u32(&x217, &x218, 0x0, x213, x216); + uint32_t x219; + fiat_p256_uint1 x220; + fiat_p256_addcarryx_u32(&x219, &x220, x218, x211, x214); + uint32_t x221; + fiat_p256_uint1 x222; + fiat_p256_addcarryx_u32(&x221, &x222, x220, 0x0, x212); + uint32_t x223; + fiat_p256_uint1 x224; + fiat_p256_addcarryx_u32(&x223, &x224, 0x0, x215, x191); + uint32_t x225; + fiat_p256_uint1 x226; + fiat_p256_addcarryx_u32(&x225, &x226, x224, x217, x193); + uint32_t x227; + fiat_p256_uint1 x228; + fiat_p256_addcarryx_u32(&x227, &x228, x226, x219, x195); + uint32_t x229; + fiat_p256_uint1 x230; + fiat_p256_addcarryx_u32(&x229, &x230, x228, x221, x197); + uint32_t x231; + fiat_p256_uint1 x232; + fiat_p256_addcarryx_u32(&x231, &x232, x230, 0x0, x199); + uint32_t x233; + fiat_p256_uint1 x234; + fiat_p256_addcarryx_u32(&x233, &x234, x232, 0x0, x201); + uint32_t x235; + fiat_p256_uint1 x236; + fiat_p256_addcarryx_u32(&x235, &x236, x234, x191, x203); + uint32_t x237; + fiat_p256_uint1 x238; + fiat_p256_addcarryx_u32(&x237, &x238, x236, x209, x205); + uint32_t x239; + fiat_p256_uint1 x240; + fiat_p256_addcarryx_u32(&x239, &x240, x238, x210, x207); + uint32_t x241; + fiat_p256_uint1 x242; + fiat_p256_addcarryx_u32(&x241, &x242, x240, 0x0, x208); + uint32_t x243; + uint32_t x244; + fiat_p256_mulx_u32(&x243, &x244, x3, (arg1[7])); + uint32_t x245; + uint32_t x246; + fiat_p256_mulx_u32(&x245, &x246, x3, (arg1[6])); + uint32_t x247; + uint32_t x248; + fiat_p256_mulx_u32(&x247, &x248, x3, (arg1[5])); + uint32_t x249; + uint32_t x250; + fiat_p256_mulx_u32(&x249, &x250, x3, (arg1[4])); + uint32_t x251; + uint32_t x252; + fiat_p256_mulx_u32(&x251, &x252, x3, (arg1[3])); + uint32_t x253; + uint32_t x254; + fiat_p256_mulx_u32(&x253, &x254, x3, (arg1[2])); + uint32_t x255; + uint32_t x256; + fiat_p256_mulx_u32(&x255, &x256, x3, (arg1[1])); + uint32_t x257; + uint32_t x258; + fiat_p256_mulx_u32(&x257, &x258, x3, (arg1[0])); + uint32_t x259; + fiat_p256_uint1 x260; + fiat_p256_addcarryx_u32(&x259, &x260, 0x0, x255, x258); + uint32_t x261; + fiat_p256_uint1 x262; + fiat_p256_addcarryx_u32(&x261, &x262, x260, x253, x256); + uint32_t x263; + fiat_p256_uint1 x264; + fiat_p256_addcarryx_u32(&x263, &x264, x262, x251, x254); + uint32_t x265; + fiat_p256_uint1 x266; + fiat_p256_addcarryx_u32(&x265, &x266, x264, x249, x252); + uint32_t x267; + fiat_p256_uint1 x268; + fiat_p256_addcarryx_u32(&x267, &x268, x266, x247, x250); + uint32_t x269; + fiat_p256_uint1 x270; + fiat_p256_addcarryx_u32(&x269, &x270, x268, x245, x248); + uint32_t x271; + fiat_p256_uint1 x272; + fiat_p256_addcarryx_u32(&x271, &x272, x270, x243, x246); + uint32_t x273; + fiat_p256_uint1 x274; + fiat_p256_addcarryx_u32(&x273, &x274, x272, 0x0, x244); + uint32_t x275; + fiat_p256_uint1 x276; + fiat_p256_addcarryx_u32(&x275, &x276, 0x0, x257, x225); + uint32_t x277; + fiat_p256_uint1 x278; + fiat_p256_addcarryx_u32(&x277, &x278, x276, x259, x227); + uint32_t x279; + fiat_p256_uint1 x280; + fiat_p256_addcarryx_u32(&x279, &x280, x278, x261, x229); + uint32_t x281; + fiat_p256_uint1 x282; + fiat_p256_addcarryx_u32(&x281, &x282, x280, x263, x231); + uint32_t x283; + fiat_p256_uint1 x284; + fiat_p256_addcarryx_u32(&x283, &x284, x282, x265, x233); + uint32_t x285; + fiat_p256_uint1 x286; + fiat_p256_addcarryx_u32(&x285, &x286, x284, x267, x235); + uint32_t x287; + fiat_p256_uint1 x288; + fiat_p256_addcarryx_u32(&x287, &x288, x286, x269, x237); + uint32_t x289; + fiat_p256_uint1 x290; + fiat_p256_addcarryx_u32(&x289, &x290, x288, x271, x239); + uint32_t x291; + fiat_p256_uint1 x292; + fiat_p256_addcarryx_u32(&x291, &x292, x290, x273, x241); + uint32_t x293; + uint32_t x294; + fiat_p256_mulx_u32(&x293, &x294, x275, UINT32_C(0xffffffff)); + uint32_t x295; + uint32_t x296; + fiat_p256_mulx_u32(&x295, &x296, x275, UINT32_C(0xffffffff)); + uint32_t x297; + uint32_t x298; + fiat_p256_mulx_u32(&x297, &x298, x275, UINT32_C(0xffffffff)); + uint32_t x299; + uint32_t x300; + fiat_p256_mulx_u32(&x299, &x300, x275, UINT32_C(0xffffffff)); + uint32_t x301; + fiat_p256_uint1 x302; + fiat_p256_addcarryx_u32(&x301, &x302, 0x0, x297, x300); + uint32_t x303; + fiat_p256_uint1 x304; + fiat_p256_addcarryx_u32(&x303, &x304, x302, x295, x298); + uint32_t x305; + fiat_p256_uint1 x306; + fiat_p256_addcarryx_u32(&x305, &x306, x304, 0x0, x296); + uint32_t x307; + fiat_p256_uint1 x308; + fiat_p256_addcarryx_u32(&x307, &x308, 0x0, x299, x275); + uint32_t x309; + fiat_p256_uint1 x310; + fiat_p256_addcarryx_u32(&x309, &x310, x308, x301, x277); + uint32_t x311; + fiat_p256_uint1 x312; + fiat_p256_addcarryx_u32(&x311, &x312, x310, x303, x279); + uint32_t x313; + fiat_p256_uint1 x314; + fiat_p256_addcarryx_u32(&x313, &x314, x312, x305, x281); + uint32_t x315; + fiat_p256_uint1 x316; + fiat_p256_addcarryx_u32(&x315, &x316, x314, 0x0, x283); + uint32_t x317; + fiat_p256_uint1 x318; + fiat_p256_addcarryx_u32(&x317, &x318, x316, 0x0, x285); + uint32_t x319; + fiat_p256_uint1 x320; + fiat_p256_addcarryx_u32(&x319, &x320, x318, x275, x287); + uint32_t x321; + fiat_p256_uint1 x322; + fiat_p256_addcarryx_u32(&x321, &x322, x320, x293, x289); + uint32_t x323; + fiat_p256_uint1 x324; + fiat_p256_addcarryx_u32(&x323, &x324, x322, x294, x291); + uint32_t x325; + fiat_p256_uint1 x326; + fiat_p256_addcarryx_u32(&x325, &x326, x324, 0x0, x292); + uint32_t x327; + uint32_t x328; + fiat_p256_mulx_u32(&x327, &x328, x4, (arg1[7])); + uint32_t x329; + uint32_t x330; + fiat_p256_mulx_u32(&x329, &x330, x4, (arg1[6])); + uint32_t x331; + uint32_t x332; + fiat_p256_mulx_u32(&x331, &x332, x4, (arg1[5])); + uint32_t x333; + uint32_t x334; + fiat_p256_mulx_u32(&x333, &x334, x4, (arg1[4])); + uint32_t x335; + uint32_t x336; + fiat_p256_mulx_u32(&x335, &x336, x4, (arg1[3])); + uint32_t x337; + uint32_t x338; + fiat_p256_mulx_u32(&x337, &x338, x4, (arg1[2])); + uint32_t x339; + uint32_t x340; + fiat_p256_mulx_u32(&x339, &x340, x4, (arg1[1])); + uint32_t x341; + uint32_t x342; + fiat_p256_mulx_u32(&x341, &x342, x4, (arg1[0])); + uint32_t x343; + fiat_p256_uint1 x344; + fiat_p256_addcarryx_u32(&x343, &x344, 0x0, x339, x342); + uint32_t x345; + fiat_p256_uint1 x346; + fiat_p256_addcarryx_u32(&x345, &x346, x344, x337, x340); + uint32_t x347; + fiat_p256_uint1 x348; + fiat_p256_addcarryx_u32(&x347, &x348, x346, x335, x338); + uint32_t x349; + fiat_p256_uint1 x350; + fiat_p256_addcarryx_u32(&x349, &x350, x348, x333, x336); + uint32_t x351; + fiat_p256_uint1 x352; + fiat_p256_addcarryx_u32(&x351, &x352, x350, x331, x334); + uint32_t x353; + fiat_p256_uint1 x354; + fiat_p256_addcarryx_u32(&x353, &x354, x352, x329, x332); + uint32_t x355; + fiat_p256_uint1 x356; + fiat_p256_addcarryx_u32(&x355, &x356, x354, x327, x330); + uint32_t x357; + fiat_p256_uint1 x358; + fiat_p256_addcarryx_u32(&x357, &x358, x356, 0x0, x328); + uint32_t x359; + fiat_p256_uint1 x360; + fiat_p256_addcarryx_u32(&x359, &x360, 0x0, x341, x309); + uint32_t x361; + fiat_p256_uint1 x362; + fiat_p256_addcarryx_u32(&x361, &x362, x360, x343, x311); + uint32_t x363; + fiat_p256_uint1 x364; + fiat_p256_addcarryx_u32(&x363, &x364, x362, x345, x313); + uint32_t x365; + fiat_p256_uint1 x366; + fiat_p256_addcarryx_u32(&x365, &x366, x364, x347, x315); + uint32_t x367; + fiat_p256_uint1 x368; + fiat_p256_addcarryx_u32(&x367, &x368, x366, x349, x317); + uint32_t x369; + fiat_p256_uint1 x370; + fiat_p256_addcarryx_u32(&x369, &x370, x368, x351, x319); + uint32_t x371; + fiat_p256_uint1 x372; + fiat_p256_addcarryx_u32(&x371, &x372, x370, x353, x321); + uint32_t x373; + fiat_p256_uint1 x374; + fiat_p256_addcarryx_u32(&x373, &x374, x372, x355, x323); + uint32_t x375; + fiat_p256_uint1 x376; + fiat_p256_addcarryx_u32(&x375, &x376, x374, x357, x325); + uint32_t x377; + uint32_t x378; + fiat_p256_mulx_u32(&x377, &x378, x359, UINT32_C(0xffffffff)); + uint32_t x379; + uint32_t x380; + fiat_p256_mulx_u32(&x379, &x380, x359, UINT32_C(0xffffffff)); + uint32_t x381; + uint32_t x382; + fiat_p256_mulx_u32(&x381, &x382, x359, UINT32_C(0xffffffff)); + uint32_t x383; + uint32_t x384; + fiat_p256_mulx_u32(&x383, &x384, x359, UINT32_C(0xffffffff)); + uint32_t x385; + fiat_p256_uint1 x386; + fiat_p256_addcarryx_u32(&x385, &x386, 0x0, x381, x384); + uint32_t x387; + fiat_p256_uint1 x388; + fiat_p256_addcarryx_u32(&x387, &x388, x386, x379, x382); + uint32_t x389; + fiat_p256_uint1 x390; + fiat_p256_addcarryx_u32(&x389, &x390, x388, 0x0, x380); + uint32_t x391; + fiat_p256_uint1 x392; + fiat_p256_addcarryx_u32(&x391, &x392, 0x0, x383, x359); + uint32_t x393; + fiat_p256_uint1 x394; + fiat_p256_addcarryx_u32(&x393, &x394, x392, x385, x361); + uint32_t x395; + fiat_p256_uint1 x396; + fiat_p256_addcarryx_u32(&x395, &x396, x394, x387, x363); + uint32_t x397; + fiat_p256_uint1 x398; + fiat_p256_addcarryx_u32(&x397, &x398, x396, x389, x365); + uint32_t x399; + fiat_p256_uint1 x400; + fiat_p256_addcarryx_u32(&x399, &x400, x398, 0x0, x367); + uint32_t x401; + fiat_p256_uint1 x402; + fiat_p256_addcarryx_u32(&x401, &x402, x400, 0x0, x369); + uint32_t x403; + fiat_p256_uint1 x404; + fiat_p256_addcarryx_u32(&x403, &x404, x402, x359, x371); + uint32_t x405; + fiat_p256_uint1 x406; + fiat_p256_addcarryx_u32(&x405, &x406, x404, x377, x373); + uint32_t x407; + fiat_p256_uint1 x408; + fiat_p256_addcarryx_u32(&x407, &x408, x406, x378, x375); + uint32_t x409; + fiat_p256_uint1 x410; + fiat_p256_addcarryx_u32(&x409, &x410, x408, 0x0, x376); + uint32_t x411; + uint32_t x412; + fiat_p256_mulx_u32(&x411, &x412, x5, (arg1[7])); + uint32_t x413; + uint32_t x414; + fiat_p256_mulx_u32(&x413, &x414, x5, (arg1[6])); + uint32_t x415; + uint32_t x416; + fiat_p256_mulx_u32(&x415, &x416, x5, (arg1[5])); + uint32_t x417; + uint32_t x418; + fiat_p256_mulx_u32(&x417, &x418, x5, (arg1[4])); + uint32_t x419; + uint32_t x420; + fiat_p256_mulx_u32(&x419, &x420, x5, (arg1[3])); + uint32_t x421; + uint32_t x422; + fiat_p256_mulx_u32(&x421, &x422, x5, (arg1[2])); + uint32_t x423; + uint32_t x424; + fiat_p256_mulx_u32(&x423, &x424, x5, (arg1[1])); + uint32_t x425; + uint32_t x426; + fiat_p256_mulx_u32(&x425, &x426, x5, (arg1[0])); + uint32_t x427; + fiat_p256_uint1 x428; + fiat_p256_addcarryx_u32(&x427, &x428, 0x0, x423, x426); + uint32_t x429; + fiat_p256_uint1 x430; + fiat_p256_addcarryx_u32(&x429, &x430, x428, x421, x424); + uint32_t x431; + fiat_p256_uint1 x432; + fiat_p256_addcarryx_u32(&x431, &x432, x430, x419, x422); + uint32_t x433; + fiat_p256_uint1 x434; + fiat_p256_addcarryx_u32(&x433, &x434, x432, x417, x420); + uint32_t x435; + fiat_p256_uint1 x436; + fiat_p256_addcarryx_u32(&x435, &x436, x434, x415, x418); + uint32_t x437; + fiat_p256_uint1 x438; + fiat_p256_addcarryx_u32(&x437, &x438, x436, x413, x416); + uint32_t x439; + fiat_p256_uint1 x440; + fiat_p256_addcarryx_u32(&x439, &x440, x438, x411, x414); + uint32_t x441; + fiat_p256_uint1 x442; + fiat_p256_addcarryx_u32(&x441, &x442, x440, 0x0, x412); + uint32_t x443; + fiat_p256_uint1 x444; + fiat_p256_addcarryx_u32(&x443, &x444, 0x0, x425, x393); + uint32_t x445; + fiat_p256_uint1 x446; + fiat_p256_addcarryx_u32(&x445, &x446, x444, x427, x395); + uint32_t x447; + fiat_p256_uint1 x448; + fiat_p256_addcarryx_u32(&x447, &x448, x446, x429, x397); + uint32_t x449; + fiat_p256_uint1 x450; + fiat_p256_addcarryx_u32(&x449, &x450, x448, x431, x399); + uint32_t x451; + fiat_p256_uint1 x452; + fiat_p256_addcarryx_u32(&x451, &x452, x450, x433, x401); + uint32_t x453; + fiat_p256_uint1 x454; + fiat_p256_addcarryx_u32(&x453, &x454, x452, x435, x403); + uint32_t x455; + fiat_p256_uint1 x456; + fiat_p256_addcarryx_u32(&x455, &x456, x454, x437, x405); + uint32_t x457; + fiat_p256_uint1 x458; + fiat_p256_addcarryx_u32(&x457, &x458, x456, x439, x407); + uint32_t x459; + fiat_p256_uint1 x460; + fiat_p256_addcarryx_u32(&x459, &x460, x458, x441, x409); + uint32_t x461; + uint32_t x462; + fiat_p256_mulx_u32(&x461, &x462, x443, UINT32_C(0xffffffff)); + uint32_t x463; + uint32_t x464; + fiat_p256_mulx_u32(&x463, &x464, x443, UINT32_C(0xffffffff)); + uint32_t x465; + uint32_t x466; + fiat_p256_mulx_u32(&x465, &x466, x443, UINT32_C(0xffffffff)); + uint32_t x467; + uint32_t x468; + fiat_p256_mulx_u32(&x467, &x468, x443, UINT32_C(0xffffffff)); + uint32_t x469; + fiat_p256_uint1 x470; + fiat_p256_addcarryx_u32(&x469, &x470, 0x0, x465, x468); + uint32_t x471; + fiat_p256_uint1 x472; + fiat_p256_addcarryx_u32(&x471, &x472, x470, x463, x466); + uint32_t x473; + fiat_p256_uint1 x474; + fiat_p256_addcarryx_u32(&x473, &x474, x472, 0x0, x464); + uint32_t x475; + fiat_p256_uint1 x476; + fiat_p256_addcarryx_u32(&x475, &x476, 0x0, x467, x443); + uint32_t x477; + fiat_p256_uint1 x478; + fiat_p256_addcarryx_u32(&x477, &x478, x476, x469, x445); + uint32_t x479; + fiat_p256_uint1 x480; + fiat_p256_addcarryx_u32(&x479, &x480, x478, x471, x447); + uint32_t x481; + fiat_p256_uint1 x482; + fiat_p256_addcarryx_u32(&x481, &x482, x480, x473, x449); + uint32_t x483; + fiat_p256_uint1 x484; + fiat_p256_addcarryx_u32(&x483, &x484, x482, 0x0, x451); + uint32_t x485; + fiat_p256_uint1 x486; + fiat_p256_addcarryx_u32(&x485, &x486, x484, 0x0, x453); + uint32_t x487; + fiat_p256_uint1 x488; + fiat_p256_addcarryx_u32(&x487, &x488, x486, x443, x455); + uint32_t x489; + fiat_p256_uint1 x490; + fiat_p256_addcarryx_u32(&x489, &x490, x488, x461, x457); + uint32_t x491; + fiat_p256_uint1 x492; + fiat_p256_addcarryx_u32(&x491, &x492, x490, x462, x459); + uint32_t x493; + fiat_p256_uint1 x494; + fiat_p256_addcarryx_u32(&x493, &x494, x492, 0x0, x460); + uint32_t x495; + uint32_t x496; + fiat_p256_mulx_u32(&x495, &x496, x6, (arg1[7])); + uint32_t x497; + uint32_t x498; + fiat_p256_mulx_u32(&x497, &x498, x6, (arg1[6])); + uint32_t x499; + uint32_t x500; + fiat_p256_mulx_u32(&x499, &x500, x6, (arg1[5])); + uint32_t x501; + uint32_t x502; + fiat_p256_mulx_u32(&x501, &x502, x6, (arg1[4])); + uint32_t x503; + uint32_t x504; + fiat_p256_mulx_u32(&x503, &x504, x6, (arg1[3])); + uint32_t x505; + uint32_t x506; + fiat_p256_mulx_u32(&x505, &x506, x6, (arg1[2])); + uint32_t x507; + uint32_t x508; + fiat_p256_mulx_u32(&x507, &x508, x6, (arg1[1])); + uint32_t x509; + uint32_t x510; + fiat_p256_mulx_u32(&x509, &x510, x6, (arg1[0])); + uint32_t x511; + fiat_p256_uint1 x512; + fiat_p256_addcarryx_u32(&x511, &x512, 0x0, x507, x510); + uint32_t x513; + fiat_p256_uint1 x514; + fiat_p256_addcarryx_u32(&x513, &x514, x512, x505, x508); + uint32_t x515; + fiat_p256_uint1 x516; + fiat_p256_addcarryx_u32(&x515, &x516, x514, x503, x506); + uint32_t x517; + fiat_p256_uint1 x518; + fiat_p256_addcarryx_u32(&x517, &x518, x516, x501, x504); + uint32_t x519; + fiat_p256_uint1 x520; + fiat_p256_addcarryx_u32(&x519, &x520, x518, x499, x502); + uint32_t x521; + fiat_p256_uint1 x522; + fiat_p256_addcarryx_u32(&x521, &x522, x520, x497, x500); + uint32_t x523; + fiat_p256_uint1 x524; + fiat_p256_addcarryx_u32(&x523, &x524, x522, x495, x498); + uint32_t x525; + fiat_p256_uint1 x526; + fiat_p256_addcarryx_u32(&x525, &x526, x524, 0x0, x496); + uint32_t x527; + fiat_p256_uint1 x528; + fiat_p256_addcarryx_u32(&x527, &x528, 0x0, x509, x477); + uint32_t x529; + fiat_p256_uint1 x530; + fiat_p256_addcarryx_u32(&x529, &x530, x528, x511, x479); + uint32_t x531; + fiat_p256_uint1 x532; + fiat_p256_addcarryx_u32(&x531, &x532, x530, x513, x481); + uint32_t x533; + fiat_p256_uint1 x534; + fiat_p256_addcarryx_u32(&x533, &x534, x532, x515, x483); + uint32_t x535; + fiat_p256_uint1 x536; + fiat_p256_addcarryx_u32(&x535, &x536, x534, x517, x485); + uint32_t x537; + fiat_p256_uint1 x538; + fiat_p256_addcarryx_u32(&x537, &x538, x536, x519, x487); + uint32_t x539; + fiat_p256_uint1 x540; + fiat_p256_addcarryx_u32(&x539, &x540, x538, x521, x489); + uint32_t x541; + fiat_p256_uint1 x542; + fiat_p256_addcarryx_u32(&x541, &x542, x540, x523, x491); + uint32_t x543; + fiat_p256_uint1 x544; + fiat_p256_addcarryx_u32(&x543, &x544, x542, x525, x493); + uint32_t x545; + uint32_t x546; + fiat_p256_mulx_u32(&x545, &x546, x527, UINT32_C(0xffffffff)); + uint32_t x547; + uint32_t x548; + fiat_p256_mulx_u32(&x547, &x548, x527, UINT32_C(0xffffffff)); + uint32_t x549; + uint32_t x550; + fiat_p256_mulx_u32(&x549, &x550, x527, UINT32_C(0xffffffff)); + uint32_t x551; + uint32_t x552; + fiat_p256_mulx_u32(&x551, &x552, x527, UINT32_C(0xffffffff)); + uint32_t x553; + fiat_p256_uint1 x554; + fiat_p256_addcarryx_u32(&x553, &x554, 0x0, x549, x552); + uint32_t x555; + fiat_p256_uint1 x556; + fiat_p256_addcarryx_u32(&x555, &x556, x554, x547, x550); + uint32_t x557; + fiat_p256_uint1 x558; + fiat_p256_addcarryx_u32(&x557, &x558, x556, 0x0, x548); + uint32_t x559; + fiat_p256_uint1 x560; + fiat_p256_addcarryx_u32(&x559, &x560, 0x0, x551, x527); + uint32_t x561; + fiat_p256_uint1 x562; + fiat_p256_addcarryx_u32(&x561, &x562, x560, x553, x529); + uint32_t x563; + fiat_p256_uint1 x564; + fiat_p256_addcarryx_u32(&x563, &x564, x562, x555, x531); + uint32_t x565; + fiat_p256_uint1 x566; + fiat_p256_addcarryx_u32(&x565, &x566, x564, x557, x533); + uint32_t x567; + fiat_p256_uint1 x568; + fiat_p256_addcarryx_u32(&x567, &x568, x566, 0x0, x535); + uint32_t x569; + fiat_p256_uint1 x570; + fiat_p256_addcarryx_u32(&x569, &x570, x568, 0x0, x537); + uint32_t x571; + fiat_p256_uint1 x572; + fiat_p256_addcarryx_u32(&x571, &x572, x570, x527, x539); + uint32_t x573; + fiat_p256_uint1 x574; + fiat_p256_addcarryx_u32(&x573, &x574, x572, x545, x541); + uint32_t x575; + fiat_p256_uint1 x576; + fiat_p256_addcarryx_u32(&x575, &x576, x574, x546, x543); + uint32_t x577; + fiat_p256_uint1 x578; + fiat_p256_addcarryx_u32(&x577, &x578, x576, 0x0, x544); + uint32_t x579; + uint32_t x580; + fiat_p256_mulx_u32(&x579, &x580, x7, (arg1[7])); + uint32_t x581; + uint32_t x582; + fiat_p256_mulx_u32(&x581, &x582, x7, (arg1[6])); + uint32_t x583; + uint32_t x584; + fiat_p256_mulx_u32(&x583, &x584, x7, (arg1[5])); + uint32_t x585; + uint32_t x586; + fiat_p256_mulx_u32(&x585, &x586, x7, (arg1[4])); + uint32_t x587; + uint32_t x588; + fiat_p256_mulx_u32(&x587, &x588, x7, (arg1[3])); + uint32_t x589; + uint32_t x590; + fiat_p256_mulx_u32(&x589, &x590, x7, (arg1[2])); + uint32_t x591; + uint32_t x592; + fiat_p256_mulx_u32(&x591, &x592, x7, (arg1[1])); + uint32_t x593; + uint32_t x594; + fiat_p256_mulx_u32(&x593, &x594, x7, (arg1[0])); + uint32_t x595; + fiat_p256_uint1 x596; + fiat_p256_addcarryx_u32(&x595, &x596, 0x0, x591, x594); + uint32_t x597; + fiat_p256_uint1 x598; + fiat_p256_addcarryx_u32(&x597, &x598, x596, x589, x592); + uint32_t x599; + fiat_p256_uint1 x600; + fiat_p256_addcarryx_u32(&x599, &x600, x598, x587, x590); + uint32_t x601; + fiat_p256_uint1 x602; + fiat_p256_addcarryx_u32(&x601, &x602, x600, x585, x588); + uint32_t x603; + fiat_p256_uint1 x604; + fiat_p256_addcarryx_u32(&x603, &x604, x602, x583, x586); + uint32_t x605; + fiat_p256_uint1 x606; + fiat_p256_addcarryx_u32(&x605, &x606, x604, x581, x584); + uint32_t x607; + fiat_p256_uint1 x608; + fiat_p256_addcarryx_u32(&x607, &x608, x606, x579, x582); + uint32_t x609; + fiat_p256_uint1 x610; + fiat_p256_addcarryx_u32(&x609, &x610, x608, 0x0, x580); + uint32_t x611; + fiat_p256_uint1 x612; + fiat_p256_addcarryx_u32(&x611, &x612, 0x0, x593, x561); + uint32_t x613; + fiat_p256_uint1 x614; + fiat_p256_addcarryx_u32(&x613, &x614, x612, x595, x563); + uint32_t x615; + fiat_p256_uint1 x616; + fiat_p256_addcarryx_u32(&x615, &x616, x614, x597, x565); + uint32_t x617; + fiat_p256_uint1 x618; + fiat_p256_addcarryx_u32(&x617, &x618, x616, x599, x567); + uint32_t x619; + fiat_p256_uint1 x620; + fiat_p256_addcarryx_u32(&x619, &x620, x618, x601, x569); + uint32_t x621; + fiat_p256_uint1 x622; + fiat_p256_addcarryx_u32(&x621, &x622, x620, x603, x571); + uint32_t x623; + fiat_p256_uint1 x624; + fiat_p256_addcarryx_u32(&x623, &x624, x622, x605, x573); + uint32_t x625; + fiat_p256_uint1 x626; + fiat_p256_addcarryx_u32(&x625, &x626, x624, x607, x575); + uint32_t x627; + fiat_p256_uint1 x628; + fiat_p256_addcarryx_u32(&x627, &x628, x626, x609, x577); + uint32_t x629; + uint32_t x630; + fiat_p256_mulx_u32(&x629, &x630, x611, UINT32_C(0xffffffff)); + uint32_t x631; + uint32_t x632; + fiat_p256_mulx_u32(&x631, &x632, x611, UINT32_C(0xffffffff)); + uint32_t x633; + uint32_t x634; + fiat_p256_mulx_u32(&x633, &x634, x611, UINT32_C(0xffffffff)); + uint32_t x635; + uint32_t x636; + fiat_p256_mulx_u32(&x635, &x636, x611, UINT32_C(0xffffffff)); + uint32_t x637; + fiat_p256_uint1 x638; + fiat_p256_addcarryx_u32(&x637, &x638, 0x0, x633, x636); + uint32_t x639; + fiat_p256_uint1 x640; + fiat_p256_addcarryx_u32(&x639, &x640, x638, x631, x634); + uint32_t x641; + fiat_p256_uint1 x642; + fiat_p256_addcarryx_u32(&x641, &x642, x640, 0x0, x632); + uint32_t x643; + fiat_p256_uint1 x644; + fiat_p256_addcarryx_u32(&x643, &x644, 0x0, x635, x611); + uint32_t x645; + fiat_p256_uint1 x646; + fiat_p256_addcarryx_u32(&x645, &x646, x644, x637, x613); + uint32_t x647; + fiat_p256_uint1 x648; + fiat_p256_addcarryx_u32(&x647, &x648, x646, x639, x615); + uint32_t x649; + fiat_p256_uint1 x650; + fiat_p256_addcarryx_u32(&x649, &x650, x648, x641, x617); + uint32_t x651; + fiat_p256_uint1 x652; + fiat_p256_addcarryx_u32(&x651, &x652, x650, 0x0, x619); + uint32_t x653; + fiat_p256_uint1 x654; + fiat_p256_addcarryx_u32(&x653, &x654, x652, 0x0, x621); + uint32_t x655; + fiat_p256_uint1 x656; + fiat_p256_addcarryx_u32(&x655, &x656, x654, x611, x623); + uint32_t x657; + fiat_p256_uint1 x658; + fiat_p256_addcarryx_u32(&x657, &x658, x656, x629, x625); + uint32_t x659; + fiat_p256_uint1 x660; + fiat_p256_addcarryx_u32(&x659, &x660, x658, x630, x627); + uint32_t x661; + fiat_p256_uint1 x662; + fiat_p256_addcarryx_u32(&x661, &x662, x660, 0x0, x628); + uint32_t x663; + fiat_p256_uint1 x664; + fiat_p256_subborrowx_u32(&x663, &x664, 0x0, x645, UINT32_C(0xffffffff)); + uint32_t x665; + fiat_p256_uint1 x666; + fiat_p256_subborrowx_u32(&x665, &x666, x664, x647, UINT32_C(0xffffffff)); + uint32_t x667; + fiat_p256_uint1 x668; + fiat_p256_subborrowx_u32(&x667, &x668, x666, x649, UINT32_C(0xffffffff)); + uint32_t x669; + fiat_p256_uint1 x670; + fiat_p256_subborrowx_u32(&x669, &x670, x668, x651, 0x0); + uint32_t x671; + fiat_p256_uint1 x672; + fiat_p256_subborrowx_u32(&x671, &x672, x670, x653, 0x0); + uint32_t x673; + fiat_p256_uint1 x674; + fiat_p256_subborrowx_u32(&x673, &x674, x672, x655, 0x0); + uint32_t x675; + fiat_p256_uint1 x676; + fiat_p256_subborrowx_u32(&x675, &x676, x674, x657, 0x1); + uint32_t x677; + fiat_p256_uint1 x678; + fiat_p256_subborrowx_u32(&x677, &x678, x676, x659, UINT32_C(0xffffffff)); + uint32_t x679; + fiat_p256_uint1 x680; + fiat_p256_subborrowx_u32(&x679, &x680, x678, x661, 0x0); + uint32_t x681; + fiat_p256_cmovznz_u32(&x681, x680, x663, x645); + uint32_t x682; + fiat_p256_cmovznz_u32(&x682, x680, x665, x647); + uint32_t x683; + fiat_p256_cmovznz_u32(&x683, x680, x667, x649); + uint32_t x684; + fiat_p256_cmovznz_u32(&x684, x680, x669, x651); + uint32_t x685; + fiat_p256_cmovznz_u32(&x685, x680, x671, x653); + uint32_t x686; + fiat_p256_cmovznz_u32(&x686, x680, x673, x655); + uint32_t x687; + fiat_p256_cmovznz_u32(&x687, x680, x675, x657); + uint32_t x688; + fiat_p256_cmovznz_u32(&x688, x680, x677, x659); + out1[0] = x681; + out1[1] = x682; + out1[2] = x683; + out1[3] = x684; + out1[4] = x685; + out1[5] = x686; + out1[6] = x687; + out1[7] = x688; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_add(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { + uint32_t x1; + fiat_p256_uint1 x2; + fiat_p256_addcarryx_u32(&x1, &x2, 0x0, (arg2[0]), (arg1[0])); + uint32_t x3; + fiat_p256_uint1 x4; + fiat_p256_addcarryx_u32(&x3, &x4, x2, (arg2[1]), (arg1[1])); + uint32_t x5; + fiat_p256_uint1 x6; + fiat_p256_addcarryx_u32(&x5, &x6, x4, (arg2[2]), (arg1[2])); + uint32_t x7; + fiat_p256_uint1 x8; + fiat_p256_addcarryx_u32(&x7, &x8, x6, (arg2[3]), (arg1[3])); + uint32_t x9; + fiat_p256_uint1 x10; + fiat_p256_addcarryx_u32(&x9, &x10, x8, (arg2[4]), (arg1[4])); + uint32_t x11; + fiat_p256_uint1 x12; + fiat_p256_addcarryx_u32(&x11, &x12, x10, (arg2[5]), (arg1[5])); + uint32_t x13; + fiat_p256_uint1 x14; + fiat_p256_addcarryx_u32(&x13, &x14, x12, (arg2[6]), (arg1[6])); + uint32_t x15; + fiat_p256_uint1 x16; + fiat_p256_addcarryx_u32(&x15, &x16, x14, (arg2[7]), (arg1[7])); + uint32_t x17; + fiat_p256_uint1 x18; + fiat_p256_subborrowx_u32(&x17, &x18, 0x0, x1, UINT32_C(0xffffffff)); + uint32_t x19; + fiat_p256_uint1 x20; + fiat_p256_subborrowx_u32(&x19, &x20, x18, x3, UINT32_C(0xffffffff)); + uint32_t x21; + fiat_p256_uint1 x22; + fiat_p256_subborrowx_u32(&x21, &x22, x20, x5, UINT32_C(0xffffffff)); + uint32_t x23; + fiat_p256_uint1 x24; + fiat_p256_subborrowx_u32(&x23, &x24, x22, x7, 0x0); + uint32_t x25; + fiat_p256_uint1 x26; + fiat_p256_subborrowx_u32(&x25, &x26, x24, x9, 0x0); + uint32_t x27; + fiat_p256_uint1 x28; + fiat_p256_subborrowx_u32(&x27, &x28, x26, x11, 0x0); + uint32_t x29; + fiat_p256_uint1 x30; + fiat_p256_subborrowx_u32(&x29, &x30, x28, x13, 0x1); + uint32_t x31; + fiat_p256_uint1 x32; + fiat_p256_subborrowx_u32(&x31, &x32, x30, x15, UINT32_C(0xffffffff)); + uint32_t x33; + fiat_p256_uint1 x34; + fiat_p256_subborrowx_u32(&x33, &x34, x32, x16, 0x0); + uint32_t x35; + fiat_p256_cmovznz_u32(&x35, x34, x17, x1); + uint32_t x36; + fiat_p256_cmovznz_u32(&x36, x34, x19, x3); + uint32_t x37; + fiat_p256_cmovznz_u32(&x37, x34, x21, x5); + uint32_t x38; + fiat_p256_cmovznz_u32(&x38, x34, x23, x7); + uint32_t x39; + fiat_p256_cmovznz_u32(&x39, x34, x25, x9); + uint32_t x40; + fiat_p256_cmovznz_u32(&x40, x34, x27, x11); + uint32_t x41; + fiat_p256_cmovznz_u32(&x41, x34, x29, x13); + uint32_t x42; + fiat_p256_cmovznz_u32(&x42, x34, x31, x15); + out1[0] = x35; + out1[1] = x36; + out1[2] = x37; + out1[3] = x38; + out1[4] = x39; + out1[5] = x40; + out1[6] = x41; + out1[7] = x42; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_sub(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { + uint32_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u32(&x1, &x2, 0x0, (arg1[0]), (arg2[0])); + uint32_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u32(&x3, &x4, x2, (arg1[1]), (arg2[1])); + uint32_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u32(&x5, &x6, x4, (arg1[2]), (arg2[2])); + uint32_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u32(&x7, &x8, x6, (arg1[3]), (arg2[3])); + uint32_t x9; + fiat_p256_uint1 x10; + fiat_p256_subborrowx_u32(&x9, &x10, x8, (arg1[4]), (arg2[4])); + uint32_t x11; + fiat_p256_uint1 x12; + fiat_p256_subborrowx_u32(&x11, &x12, x10, (arg1[5]), (arg2[5])); + uint32_t x13; + fiat_p256_uint1 x14; + fiat_p256_subborrowx_u32(&x13, &x14, x12, (arg1[6]), (arg2[6])); + uint32_t x15; + fiat_p256_uint1 x16; + fiat_p256_subborrowx_u32(&x15, &x16, x14, (arg1[7]), (arg2[7])); + uint32_t x17; + fiat_p256_cmovznz_u32(&x17, x16, 0x0, UINT32_C(0xffffffff)); + uint32_t x18; + fiat_p256_uint1 x19; + fiat_p256_addcarryx_u32(&x18, &x19, 0x0, (x17 & UINT32_C(0xffffffff)), x1); + uint32_t x20; + fiat_p256_uint1 x21; + fiat_p256_addcarryx_u32(&x20, &x21, x19, (x17 & UINT32_C(0xffffffff)), x3); + uint32_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u32(&x22, &x23, x21, (x17 & UINT32_C(0xffffffff)), x5); + uint32_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u32(&x24, &x25, x23, 0x0, x7); + uint32_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x9); + uint32_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x11); + uint32_t x30; + fiat_p256_uint1 x31; + fiat_p256_addcarryx_u32(&x30, &x31, x29, (fiat_p256_uint1)(x17 & 0x1), x13); + uint32_t x32; + fiat_p256_uint1 x33; + fiat_p256_addcarryx_u32(&x32, &x33, x31, (x17 & UINT32_C(0xffffffff)), x15); + out1[0] = x18; + out1[1] = x20; + out1[2] = x22; + out1[3] = x24; + out1[4] = x26; + out1[5] = x28; + out1[6] = x30; + out1[7] = x32; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_opp(uint32_t out1[8], const uint32_t arg1[8]) { + uint32_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u32(&x1, &x2, 0x0, 0x0, (arg1[0])); + uint32_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u32(&x3, &x4, x2, 0x0, (arg1[1])); + uint32_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u32(&x5, &x6, x4, 0x0, (arg1[2])); + uint32_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u32(&x7, &x8, x6, 0x0, (arg1[3])); + uint32_t x9; + fiat_p256_uint1 x10; + fiat_p256_subborrowx_u32(&x9, &x10, x8, 0x0, (arg1[4])); + uint32_t x11; + fiat_p256_uint1 x12; + fiat_p256_subborrowx_u32(&x11, &x12, x10, 0x0, (arg1[5])); + uint32_t x13; + fiat_p256_uint1 x14; + fiat_p256_subborrowx_u32(&x13, &x14, x12, 0x0, (arg1[6])); + uint32_t x15; + fiat_p256_uint1 x16; + fiat_p256_subborrowx_u32(&x15, &x16, x14, 0x0, (arg1[7])); + uint32_t x17; + fiat_p256_cmovznz_u32(&x17, x16, 0x0, UINT32_C(0xffffffff)); + uint32_t x18; + fiat_p256_uint1 x19; + fiat_p256_addcarryx_u32(&x18, &x19, 0x0, (x17 & UINT32_C(0xffffffff)), x1); + uint32_t x20; + fiat_p256_uint1 x21; + fiat_p256_addcarryx_u32(&x20, &x21, x19, (x17 & UINT32_C(0xffffffff)), x3); + uint32_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u32(&x22, &x23, x21, (x17 & UINT32_C(0xffffffff)), x5); + uint32_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u32(&x24, &x25, x23, 0x0, x7); + uint32_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x9); + uint32_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x11); + uint32_t x30; + fiat_p256_uint1 x31; + fiat_p256_addcarryx_u32(&x30, &x31, x29, (fiat_p256_uint1)(x17 & 0x1), x13); + uint32_t x32; + fiat_p256_uint1 x33; + fiat_p256_addcarryx_u32(&x32, &x33, x31, (x17 & UINT32_C(0xffffffff)), x15); + out1[0] = x18; + out1[1] = x20; + out1[2] = x22; + out1[3] = x24; + out1[4] = x26; + out1[5] = x28; + out1[6] = x30; + out1[7] = x32; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_from_montgomery(uint32_t out1[8], const uint32_t arg1[8]) { + uint32_t x1 = (arg1[0]); + uint32_t x2; + uint32_t x3; + fiat_p256_mulx_u32(&x2, &x3, x1, UINT32_C(0xffffffff)); + uint32_t x4; + uint32_t x5; + fiat_p256_mulx_u32(&x4, &x5, x1, UINT32_C(0xffffffff)); + uint32_t x6; + uint32_t x7; + fiat_p256_mulx_u32(&x6, &x7, x1, UINT32_C(0xffffffff)); + uint32_t x8; + uint32_t x9; + fiat_p256_mulx_u32(&x8, &x9, x1, UINT32_C(0xffffffff)); + uint32_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u32(&x10, &x11, 0x0, x6, x9); + uint32_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u32(&x12, &x13, x11, x4, x7); + uint32_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u32(&x14, &x15, 0x0, x8, x1); + uint32_t x16; + fiat_p256_uint1 x17; + fiat_p256_addcarryx_u32(&x16, &x17, x15, x10, 0x0); + uint32_t x18; + fiat_p256_uint1 x19; + fiat_p256_addcarryx_u32(&x18, &x19, x17, x12, 0x0); + uint32_t x20; + fiat_p256_uint1 x21; + fiat_p256_addcarryx_u32(&x20, &x21, x13, 0x0, x5); + uint32_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u32(&x22, &x23, x19, x20, 0x0); + uint32_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u32(&x24, &x25, 0x0, (arg1[1]), x16); + uint32_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x18); + uint32_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x22); + uint32_t x30; + uint32_t x31; + fiat_p256_mulx_u32(&x30, &x31, x24, UINT32_C(0xffffffff)); + uint32_t x32; + uint32_t x33; + fiat_p256_mulx_u32(&x32, &x33, x24, UINT32_C(0xffffffff)); + uint32_t x34; + uint32_t x35; + fiat_p256_mulx_u32(&x34, &x35, x24, UINT32_C(0xffffffff)); + uint32_t x36; + uint32_t x37; + fiat_p256_mulx_u32(&x36, &x37, x24, UINT32_C(0xffffffff)); + uint32_t x38; + fiat_p256_uint1 x39; + fiat_p256_addcarryx_u32(&x38, &x39, 0x0, x34, x37); + uint32_t x40; + fiat_p256_uint1 x41; + fiat_p256_addcarryx_u32(&x40, &x41, x39, x32, x35); + uint32_t x42; + fiat_p256_uint1 x43; + fiat_p256_addcarryx_u32(&x42, &x43, 0x0, x36, x24); + uint32_t x44; + fiat_p256_uint1 x45; + fiat_p256_addcarryx_u32(&x44, &x45, x43, x38, x26); + uint32_t x46; + fiat_p256_uint1 x47; + fiat_p256_addcarryx_u32(&x46, &x47, x45, x40, x28); + uint32_t x48; + fiat_p256_uint1 x49; + fiat_p256_addcarryx_u32(&x48, &x49, x23, 0x0, 0x0); + uint32_t x50; + fiat_p256_uint1 x51; + fiat_p256_addcarryx_u32(&x50, &x51, x29, 0x0, (fiat_p256_uint1)x48); + uint32_t x52; + fiat_p256_uint1 x53; + fiat_p256_addcarryx_u32(&x52, &x53, x41, 0x0, x33); + uint32_t x54; + fiat_p256_uint1 x55; + fiat_p256_addcarryx_u32(&x54, &x55, x47, x52, x50); + uint32_t x56; + fiat_p256_uint1 x57; + fiat_p256_addcarryx_u32(&x56, &x57, 0x0, x24, x2); + uint32_t x58; + fiat_p256_uint1 x59; + fiat_p256_addcarryx_u32(&x58, &x59, x57, x30, x3); + uint32_t x60; + fiat_p256_uint1 x61; + fiat_p256_addcarryx_u32(&x60, &x61, 0x0, (arg1[2]), x44); + uint32_t x62; + fiat_p256_uint1 x63; + fiat_p256_addcarryx_u32(&x62, &x63, x61, 0x0, x46); + uint32_t x64; + fiat_p256_uint1 x65; + fiat_p256_addcarryx_u32(&x64, &x65, x63, 0x0, x54); + uint32_t x66; + uint32_t x67; + fiat_p256_mulx_u32(&x66, &x67, x60, UINT32_C(0xffffffff)); + uint32_t x68; + uint32_t x69; + fiat_p256_mulx_u32(&x68, &x69, x60, UINT32_C(0xffffffff)); + uint32_t x70; + uint32_t x71; + fiat_p256_mulx_u32(&x70, &x71, x60, UINT32_C(0xffffffff)); + uint32_t x72; + uint32_t x73; + fiat_p256_mulx_u32(&x72, &x73, x60, UINT32_C(0xffffffff)); + uint32_t x74; + fiat_p256_uint1 x75; + fiat_p256_addcarryx_u32(&x74, &x75, 0x0, x70, x73); + uint32_t x76; + fiat_p256_uint1 x77; + fiat_p256_addcarryx_u32(&x76, &x77, x75, x68, x71); + uint32_t x78; + fiat_p256_uint1 x79; + fiat_p256_addcarryx_u32(&x78, &x79, 0x0, x72, x60); + uint32_t x80; + fiat_p256_uint1 x81; + fiat_p256_addcarryx_u32(&x80, &x81, x79, x74, x62); + uint32_t x82; + fiat_p256_uint1 x83; + fiat_p256_addcarryx_u32(&x82, &x83, x81, x76, x64); + uint32_t x84; + fiat_p256_uint1 x85; + fiat_p256_addcarryx_u32(&x84, &x85, x55, 0x0, 0x0); + uint32_t x86; + fiat_p256_uint1 x87; + fiat_p256_addcarryx_u32(&x86, &x87, x65, 0x0, (fiat_p256_uint1)x84); + uint32_t x88; + fiat_p256_uint1 x89; + fiat_p256_addcarryx_u32(&x88, &x89, x77, 0x0, x69); + uint32_t x90; + fiat_p256_uint1 x91; + fiat_p256_addcarryx_u32(&x90, &x91, x83, x88, x86); + uint32_t x92; + fiat_p256_uint1 x93; + fiat_p256_addcarryx_u32(&x92, &x93, x91, 0x0, x1); + uint32_t x94; + fiat_p256_uint1 x95; + fiat_p256_addcarryx_u32(&x94, &x95, x93, 0x0, x56); + uint32_t x96; + fiat_p256_uint1 x97; + fiat_p256_addcarryx_u32(&x96, &x97, x95, x60, x58); + uint32_t x98; + fiat_p256_uint1 x99; + fiat_p256_addcarryx_u32(&x98, &x99, x59, x31, 0x0); + uint32_t x100; + fiat_p256_uint1 x101; + fiat_p256_addcarryx_u32(&x100, &x101, x97, x66, x98); + uint32_t x102; + fiat_p256_uint1 x103; + fiat_p256_addcarryx_u32(&x102, &x103, 0x0, (arg1[3]), x80); + uint32_t x104; + fiat_p256_uint1 x105; + fiat_p256_addcarryx_u32(&x104, &x105, x103, 0x0, x82); + uint32_t x106; + fiat_p256_uint1 x107; + fiat_p256_addcarryx_u32(&x106, &x107, x105, 0x0, x90); + uint32_t x108; + fiat_p256_uint1 x109; + fiat_p256_addcarryx_u32(&x108, &x109, x107, 0x0, x92); + uint32_t x110; + fiat_p256_uint1 x111; + fiat_p256_addcarryx_u32(&x110, &x111, x109, 0x0, x94); + uint32_t x112; + fiat_p256_uint1 x113; + fiat_p256_addcarryx_u32(&x112, &x113, x111, 0x0, x96); + uint32_t x114; + fiat_p256_uint1 x115; + fiat_p256_addcarryx_u32(&x114, &x115, x113, 0x0, x100); + uint32_t x116; + fiat_p256_uint1 x117; + fiat_p256_addcarryx_u32(&x116, &x117, x101, x67, 0x0); + uint32_t x118; + fiat_p256_uint1 x119; + fiat_p256_addcarryx_u32(&x118, &x119, x115, 0x0, x116); + uint32_t x120; + uint32_t x121; + fiat_p256_mulx_u32(&x120, &x121, x102, UINT32_C(0xffffffff)); + uint32_t x122; + uint32_t x123; + fiat_p256_mulx_u32(&x122, &x123, x102, UINT32_C(0xffffffff)); + uint32_t x124; + uint32_t x125; + fiat_p256_mulx_u32(&x124, &x125, x102, UINT32_C(0xffffffff)); + uint32_t x126; + uint32_t x127; + fiat_p256_mulx_u32(&x126, &x127, x102, UINT32_C(0xffffffff)); + uint32_t x128; + fiat_p256_uint1 x129; + fiat_p256_addcarryx_u32(&x128, &x129, 0x0, x124, x127); + uint32_t x130; + fiat_p256_uint1 x131; + fiat_p256_addcarryx_u32(&x130, &x131, x129, x122, x125); + uint32_t x132; + fiat_p256_uint1 x133; + fiat_p256_addcarryx_u32(&x132, &x133, 0x0, x126, x102); + uint32_t x134; + fiat_p256_uint1 x135; + fiat_p256_addcarryx_u32(&x134, &x135, x133, x128, x104); + uint32_t x136; + fiat_p256_uint1 x137; + fiat_p256_addcarryx_u32(&x136, &x137, x135, x130, x106); + uint32_t x138; + fiat_p256_uint1 x139; + fiat_p256_addcarryx_u32(&x138, &x139, x131, 0x0, x123); + uint32_t x140; + fiat_p256_uint1 x141; + fiat_p256_addcarryx_u32(&x140, &x141, x137, x138, x108); + uint32_t x142; + fiat_p256_uint1 x143; + fiat_p256_addcarryx_u32(&x142, &x143, x141, 0x0, x110); + uint32_t x144; + fiat_p256_uint1 x145; + fiat_p256_addcarryx_u32(&x144, &x145, x143, 0x0, x112); + uint32_t x146; + fiat_p256_uint1 x147; + fiat_p256_addcarryx_u32(&x146, &x147, x145, x102, x114); + uint32_t x148; + fiat_p256_uint1 x149; + fiat_p256_addcarryx_u32(&x148, &x149, x147, x120, x118); + uint32_t x150; + fiat_p256_uint1 x151; + fiat_p256_addcarryx_u32(&x150, &x151, x119, 0x0, 0x0); + uint32_t x152; + fiat_p256_uint1 x153; + fiat_p256_addcarryx_u32(&x152, &x153, x149, x121, (fiat_p256_uint1)x150); + uint32_t x154; + fiat_p256_uint1 x155; + fiat_p256_addcarryx_u32(&x154, &x155, 0x0, (arg1[4]), x134); + uint32_t x156; + fiat_p256_uint1 x157; + fiat_p256_addcarryx_u32(&x156, &x157, x155, 0x0, x136); + uint32_t x158; + fiat_p256_uint1 x159; + fiat_p256_addcarryx_u32(&x158, &x159, x157, 0x0, x140); + uint32_t x160; + fiat_p256_uint1 x161; + fiat_p256_addcarryx_u32(&x160, &x161, x159, 0x0, x142); + uint32_t x162; + fiat_p256_uint1 x163; + fiat_p256_addcarryx_u32(&x162, &x163, x161, 0x0, x144); + uint32_t x164; + fiat_p256_uint1 x165; + fiat_p256_addcarryx_u32(&x164, &x165, x163, 0x0, x146); + uint32_t x166; + fiat_p256_uint1 x167; + fiat_p256_addcarryx_u32(&x166, &x167, x165, 0x0, x148); + uint32_t x168; + fiat_p256_uint1 x169; + fiat_p256_addcarryx_u32(&x168, &x169, x167, 0x0, x152); + uint32_t x170; + uint32_t x171; + fiat_p256_mulx_u32(&x170, &x171, x154, UINT32_C(0xffffffff)); + uint32_t x172; + uint32_t x173; + fiat_p256_mulx_u32(&x172, &x173, x154, UINT32_C(0xffffffff)); + uint32_t x174; + uint32_t x175; + fiat_p256_mulx_u32(&x174, &x175, x154, UINT32_C(0xffffffff)); + uint32_t x176; + uint32_t x177; + fiat_p256_mulx_u32(&x176, &x177, x154, UINT32_C(0xffffffff)); + uint32_t x178; + fiat_p256_uint1 x179; + fiat_p256_addcarryx_u32(&x178, &x179, 0x0, x174, x177); + uint32_t x180; + fiat_p256_uint1 x181; + fiat_p256_addcarryx_u32(&x180, &x181, x179, x172, x175); + uint32_t x182; + fiat_p256_uint1 x183; + fiat_p256_addcarryx_u32(&x182, &x183, 0x0, x176, x154); + uint32_t x184; + fiat_p256_uint1 x185; + fiat_p256_addcarryx_u32(&x184, &x185, x183, x178, x156); + uint32_t x186; + fiat_p256_uint1 x187; + fiat_p256_addcarryx_u32(&x186, &x187, x185, x180, x158); + uint32_t x188; + fiat_p256_uint1 x189; + fiat_p256_addcarryx_u32(&x188, &x189, x181, 0x0, x173); + uint32_t x190; + fiat_p256_uint1 x191; + fiat_p256_addcarryx_u32(&x190, &x191, x187, x188, x160); + uint32_t x192; + fiat_p256_uint1 x193; + fiat_p256_addcarryx_u32(&x192, &x193, x191, 0x0, x162); + uint32_t x194; + fiat_p256_uint1 x195; + fiat_p256_addcarryx_u32(&x194, &x195, x193, 0x0, x164); + uint32_t x196; + fiat_p256_uint1 x197; + fiat_p256_addcarryx_u32(&x196, &x197, x195, x154, x166); + uint32_t x198; + fiat_p256_uint1 x199; + fiat_p256_addcarryx_u32(&x198, &x199, x197, x170, x168); + uint32_t x200; + fiat_p256_uint1 x201; + fiat_p256_addcarryx_u32(&x200, &x201, x153, 0x0, 0x0); + uint32_t x202; + fiat_p256_uint1 x203; + fiat_p256_addcarryx_u32(&x202, &x203, x169, 0x0, (fiat_p256_uint1)x200); + uint32_t x204; + fiat_p256_uint1 x205; + fiat_p256_addcarryx_u32(&x204, &x205, x199, x171, x202); + uint32_t x206; + fiat_p256_uint1 x207; + fiat_p256_addcarryx_u32(&x206, &x207, 0x0, (arg1[5]), x184); + uint32_t x208; + fiat_p256_uint1 x209; + fiat_p256_addcarryx_u32(&x208, &x209, x207, 0x0, x186); + uint32_t x210; + fiat_p256_uint1 x211; + fiat_p256_addcarryx_u32(&x210, &x211, x209, 0x0, x190); + uint32_t x212; + fiat_p256_uint1 x213; + fiat_p256_addcarryx_u32(&x212, &x213, x211, 0x0, x192); + uint32_t x214; + fiat_p256_uint1 x215; + fiat_p256_addcarryx_u32(&x214, &x215, x213, 0x0, x194); + uint32_t x216; + fiat_p256_uint1 x217; + fiat_p256_addcarryx_u32(&x216, &x217, x215, 0x0, x196); + uint32_t x218; + fiat_p256_uint1 x219; + fiat_p256_addcarryx_u32(&x218, &x219, x217, 0x0, x198); + uint32_t x220; + fiat_p256_uint1 x221; + fiat_p256_addcarryx_u32(&x220, &x221, x219, 0x0, x204); + uint32_t x222; + uint32_t x223; + fiat_p256_mulx_u32(&x222, &x223, x206, UINT32_C(0xffffffff)); + uint32_t x224; + uint32_t x225; + fiat_p256_mulx_u32(&x224, &x225, x206, UINT32_C(0xffffffff)); + uint32_t x226; + uint32_t x227; + fiat_p256_mulx_u32(&x226, &x227, x206, UINT32_C(0xffffffff)); + uint32_t x228; + uint32_t x229; + fiat_p256_mulx_u32(&x228, &x229, x206, UINT32_C(0xffffffff)); + uint32_t x230; + fiat_p256_uint1 x231; + fiat_p256_addcarryx_u32(&x230, &x231, 0x0, x226, x229); + uint32_t x232; + fiat_p256_uint1 x233; + fiat_p256_addcarryx_u32(&x232, &x233, x231, x224, x227); + uint32_t x234; + fiat_p256_uint1 x235; + fiat_p256_addcarryx_u32(&x234, &x235, 0x0, x228, x206); + uint32_t x236; + fiat_p256_uint1 x237; + fiat_p256_addcarryx_u32(&x236, &x237, x235, x230, x208); + uint32_t x238; + fiat_p256_uint1 x239; + fiat_p256_addcarryx_u32(&x238, &x239, x237, x232, x210); + uint32_t x240; + fiat_p256_uint1 x241; + fiat_p256_addcarryx_u32(&x240, &x241, x233, 0x0, x225); + uint32_t x242; + fiat_p256_uint1 x243; + fiat_p256_addcarryx_u32(&x242, &x243, x239, x240, x212); + uint32_t x244; + fiat_p256_uint1 x245; + fiat_p256_addcarryx_u32(&x244, &x245, x243, 0x0, x214); + uint32_t x246; + fiat_p256_uint1 x247; + fiat_p256_addcarryx_u32(&x246, &x247, x245, 0x0, x216); + uint32_t x248; + fiat_p256_uint1 x249; + fiat_p256_addcarryx_u32(&x248, &x249, x247, x206, x218); + uint32_t x250; + fiat_p256_uint1 x251; + fiat_p256_addcarryx_u32(&x250, &x251, x249, x222, x220); + uint32_t x252; + fiat_p256_uint1 x253; + fiat_p256_addcarryx_u32(&x252, &x253, x205, 0x0, 0x0); + uint32_t x254; + fiat_p256_uint1 x255; + fiat_p256_addcarryx_u32(&x254, &x255, x221, 0x0, (fiat_p256_uint1)x252); + uint32_t x256; + fiat_p256_uint1 x257; + fiat_p256_addcarryx_u32(&x256, &x257, x251, x223, x254); + uint32_t x258; + fiat_p256_uint1 x259; + fiat_p256_addcarryx_u32(&x258, &x259, 0x0, (arg1[6]), x236); + uint32_t x260; + fiat_p256_uint1 x261; + fiat_p256_addcarryx_u32(&x260, &x261, x259, 0x0, x238); + uint32_t x262; + fiat_p256_uint1 x263; + fiat_p256_addcarryx_u32(&x262, &x263, x261, 0x0, x242); + uint32_t x264; + fiat_p256_uint1 x265; + fiat_p256_addcarryx_u32(&x264, &x265, x263, 0x0, x244); + uint32_t x266; + fiat_p256_uint1 x267; + fiat_p256_addcarryx_u32(&x266, &x267, x265, 0x0, x246); + uint32_t x268; + fiat_p256_uint1 x269; + fiat_p256_addcarryx_u32(&x268, &x269, x267, 0x0, x248); + uint32_t x270; + fiat_p256_uint1 x271; + fiat_p256_addcarryx_u32(&x270, &x271, x269, 0x0, x250); + uint32_t x272; + fiat_p256_uint1 x273; + fiat_p256_addcarryx_u32(&x272, &x273, x271, 0x0, x256); + uint32_t x274; + uint32_t x275; + fiat_p256_mulx_u32(&x274, &x275, x258, UINT32_C(0xffffffff)); + uint32_t x276; + uint32_t x277; + fiat_p256_mulx_u32(&x276, &x277, x258, UINT32_C(0xffffffff)); + uint32_t x278; + uint32_t x279; + fiat_p256_mulx_u32(&x278, &x279, x258, UINT32_C(0xffffffff)); + uint32_t x280; + uint32_t x281; + fiat_p256_mulx_u32(&x280, &x281, x258, UINT32_C(0xffffffff)); + uint32_t x282; + fiat_p256_uint1 x283; + fiat_p256_addcarryx_u32(&x282, &x283, 0x0, x278, x281); + uint32_t x284; + fiat_p256_uint1 x285; + fiat_p256_addcarryx_u32(&x284, &x285, x283, x276, x279); + uint32_t x286; + fiat_p256_uint1 x287; + fiat_p256_addcarryx_u32(&x286, &x287, 0x0, x280, x258); + uint32_t x288; + fiat_p256_uint1 x289; + fiat_p256_addcarryx_u32(&x288, &x289, x287, x282, x260); + uint32_t x290; + fiat_p256_uint1 x291; + fiat_p256_addcarryx_u32(&x290, &x291, x289, x284, x262); + uint32_t x292; + fiat_p256_uint1 x293; + fiat_p256_addcarryx_u32(&x292, &x293, x285, 0x0, x277); + uint32_t x294; + fiat_p256_uint1 x295; + fiat_p256_addcarryx_u32(&x294, &x295, x291, x292, x264); + uint32_t x296; + fiat_p256_uint1 x297; + fiat_p256_addcarryx_u32(&x296, &x297, x295, 0x0, x266); + uint32_t x298; + fiat_p256_uint1 x299; + fiat_p256_addcarryx_u32(&x298, &x299, x297, 0x0, x268); + uint32_t x300; + fiat_p256_uint1 x301; + fiat_p256_addcarryx_u32(&x300, &x301, x299, x258, x270); + uint32_t x302; + fiat_p256_uint1 x303; + fiat_p256_addcarryx_u32(&x302, &x303, x301, x274, x272); + uint32_t x304; + fiat_p256_uint1 x305; + fiat_p256_addcarryx_u32(&x304, &x305, x257, 0x0, 0x0); + uint32_t x306; + fiat_p256_uint1 x307; + fiat_p256_addcarryx_u32(&x306, &x307, x273, 0x0, (fiat_p256_uint1)x304); + uint32_t x308; + fiat_p256_uint1 x309; + fiat_p256_addcarryx_u32(&x308, &x309, x303, x275, x306); + uint32_t x310; + fiat_p256_uint1 x311; + fiat_p256_addcarryx_u32(&x310, &x311, 0x0, (arg1[7]), x288); + uint32_t x312; + fiat_p256_uint1 x313; + fiat_p256_addcarryx_u32(&x312, &x313, x311, 0x0, x290); + uint32_t x314; + fiat_p256_uint1 x315; + fiat_p256_addcarryx_u32(&x314, &x315, x313, 0x0, x294); + uint32_t x316; + fiat_p256_uint1 x317; + fiat_p256_addcarryx_u32(&x316, &x317, x315, 0x0, x296); + uint32_t x318; + fiat_p256_uint1 x319; + fiat_p256_addcarryx_u32(&x318, &x319, x317, 0x0, x298); + uint32_t x320; + fiat_p256_uint1 x321; + fiat_p256_addcarryx_u32(&x320, &x321, x319, 0x0, x300); + uint32_t x322; + fiat_p256_uint1 x323; + fiat_p256_addcarryx_u32(&x322, &x323, x321, 0x0, x302); + uint32_t x324; + fiat_p256_uint1 x325; + fiat_p256_addcarryx_u32(&x324, &x325, x323, 0x0, x308); + uint32_t x326; + uint32_t x327; + fiat_p256_mulx_u32(&x326, &x327, x310, UINT32_C(0xffffffff)); + uint32_t x328; + uint32_t x329; + fiat_p256_mulx_u32(&x328, &x329, x310, UINT32_C(0xffffffff)); + uint32_t x330; + uint32_t x331; + fiat_p256_mulx_u32(&x330, &x331, x310, UINT32_C(0xffffffff)); + uint32_t x332; + uint32_t x333; + fiat_p256_mulx_u32(&x332, &x333, x310, UINT32_C(0xffffffff)); + uint32_t x334; + fiat_p256_uint1 x335; + fiat_p256_addcarryx_u32(&x334, &x335, 0x0, x330, x333); + uint32_t x336; + fiat_p256_uint1 x337; + fiat_p256_addcarryx_u32(&x336, &x337, x335, x328, x331); + uint32_t x338; + fiat_p256_uint1 x339; + fiat_p256_addcarryx_u32(&x338, &x339, 0x0, x332, x310); + uint32_t x340; + fiat_p256_uint1 x341; + fiat_p256_addcarryx_u32(&x340, &x341, x339, x334, x312); + uint32_t x342; + fiat_p256_uint1 x343; + fiat_p256_addcarryx_u32(&x342, &x343, x341, x336, x314); + uint32_t x344; + fiat_p256_uint1 x345; + fiat_p256_addcarryx_u32(&x344, &x345, x337, 0x0, x329); + uint32_t x346; + fiat_p256_uint1 x347; + fiat_p256_addcarryx_u32(&x346, &x347, x343, x344, x316); + uint32_t x348; + fiat_p256_uint1 x349; + fiat_p256_addcarryx_u32(&x348, &x349, x347, 0x0, x318); + uint32_t x350; + fiat_p256_uint1 x351; + fiat_p256_addcarryx_u32(&x350, &x351, x349, 0x0, x320); + uint32_t x352; + fiat_p256_uint1 x353; + fiat_p256_addcarryx_u32(&x352, &x353, x351, x310, x322); + uint32_t x354; + fiat_p256_uint1 x355; + fiat_p256_addcarryx_u32(&x354, &x355, x353, x326, x324); + uint32_t x356; + fiat_p256_uint1 x357; + fiat_p256_addcarryx_u32(&x356, &x357, x309, 0x0, 0x0); + uint32_t x358; + fiat_p256_uint1 x359; + fiat_p256_addcarryx_u32(&x358, &x359, x325, 0x0, (fiat_p256_uint1)x356); + uint32_t x360; + fiat_p256_uint1 x361; + fiat_p256_addcarryx_u32(&x360, &x361, x355, x327, x358); + uint32_t x362; + fiat_p256_uint1 x363; + fiat_p256_subborrowx_u32(&x362, &x363, 0x0, x340, UINT32_C(0xffffffff)); + uint32_t x364; + fiat_p256_uint1 x365; + fiat_p256_subborrowx_u32(&x364, &x365, x363, x342, UINT32_C(0xffffffff)); + uint32_t x366; + fiat_p256_uint1 x367; + fiat_p256_subborrowx_u32(&x366, &x367, x365, x346, UINT32_C(0xffffffff)); + uint32_t x368; + fiat_p256_uint1 x369; + fiat_p256_subborrowx_u32(&x368, &x369, x367, x348, 0x0); + uint32_t x370; + fiat_p256_uint1 x371; + fiat_p256_subborrowx_u32(&x370, &x371, x369, x350, 0x0); + uint32_t x372; + fiat_p256_uint1 x373; + fiat_p256_subborrowx_u32(&x372, &x373, x371, x352, 0x0); + uint32_t x374; + fiat_p256_uint1 x375; + fiat_p256_subborrowx_u32(&x374, &x375, x373, x354, 0x1); + uint32_t x376; + fiat_p256_uint1 x377; + fiat_p256_subborrowx_u32(&x376, &x377, x375, x360, UINT32_C(0xffffffff)); + uint32_t x378; + fiat_p256_uint1 x379; + fiat_p256_addcarryx_u32(&x378, &x379, x361, 0x0, 0x0); + uint32_t x380; + fiat_p256_uint1 x381; + fiat_p256_subborrowx_u32(&x380, &x381, x377, (fiat_p256_uint1)x378, 0x0); + uint32_t x382; + fiat_p256_cmovznz_u32(&x382, x381, x362, x340); + uint32_t x383; + fiat_p256_cmovznz_u32(&x383, x381, x364, x342); + uint32_t x384; + fiat_p256_cmovznz_u32(&x384, x381, x366, x346); + uint32_t x385; + fiat_p256_cmovznz_u32(&x385, x381, x368, x348); + uint32_t x386; + fiat_p256_cmovznz_u32(&x386, x381, x370, x350); + uint32_t x387; + fiat_p256_cmovznz_u32(&x387, x381, x372, x352); + uint32_t x388; + fiat_p256_cmovznz_u32(&x388, x381, x374, x354); + uint32_t x389; + fiat_p256_cmovznz_u32(&x389, x381, x376, x360); + out1[0] = x382; + out1[1] = x383; + out1[2] = x384; + out1[3] = x385; + out1[4] = x386; + out1[5] = x387; + out1[6] = x388; + out1[7] = x389; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + */ +static void fiat_p256_nonzero(uint32_t* out1, const uint32_t arg1[8]) { + uint32_t x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | ((arg1[4]) | ((arg1[5]) | ((arg1[6]) | ((arg1[7]) | (uint32_t)0x0)))))))); + *out1 = x1; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_selectznz(uint32_t out1[8], fiat_p256_uint1 arg1, const uint32_t arg2[8], const uint32_t arg3[8]) { + uint32_t x1; + fiat_p256_cmovznz_u32(&x1, arg1, (arg2[0]), (arg3[0])); + uint32_t x2; + fiat_p256_cmovznz_u32(&x2, arg1, (arg2[1]), (arg3[1])); + uint32_t x3; + fiat_p256_cmovznz_u32(&x3, arg1, (arg2[2]), (arg3[2])); + uint32_t x4; + fiat_p256_cmovznz_u32(&x4, arg1, (arg2[3]), (arg3[3])); + uint32_t x5; + fiat_p256_cmovznz_u32(&x5, arg1, (arg2[4]), (arg3[4])); + uint32_t x6; + fiat_p256_cmovznz_u32(&x6, arg1, (arg2[5]), (arg3[5])); + uint32_t x7; + fiat_p256_cmovznz_u32(&x7, arg1, (arg2[6]), (arg3[6])); + uint32_t x8; + fiat_p256_cmovznz_u32(&x8, arg1, (arg2[7]), (arg3[7])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + */ +static void fiat_p256_to_bytes(uint8_t out1[32], const uint32_t arg1[8]) { + uint32_t x1 = (arg1[7]); + uint32_t x2 = (arg1[6]); + uint32_t x3 = (arg1[5]); + uint32_t x4 = (arg1[4]); + uint32_t x5 = (arg1[3]); + uint32_t x6 = (arg1[2]); + uint32_t x7 = (arg1[1]); + uint32_t x8 = (arg1[0]); + uint32_t x9 = (x8 >> 8); + uint8_t x10 = (uint8_t)(x8 & UINT8_C(0xff)); + uint32_t x11 = (x9 >> 8); + uint8_t x12 = (uint8_t)(x9 & UINT8_C(0xff)); + uint8_t x13 = (uint8_t)(x11 >> 8); + uint8_t x14 = (uint8_t)(x11 & UINT8_C(0xff)); + uint8_t x15 = (uint8_t)(x13 & UINT8_C(0xff)); + uint32_t x16 = (x7 >> 8); + uint8_t x17 = (uint8_t)(x7 & UINT8_C(0xff)); + uint32_t x18 = (x16 >> 8); + uint8_t x19 = (uint8_t)(x16 & UINT8_C(0xff)); + uint8_t x20 = (uint8_t)(x18 >> 8); + uint8_t x21 = (uint8_t)(x18 & UINT8_C(0xff)); + uint8_t x22 = (uint8_t)(x20 & UINT8_C(0xff)); + uint32_t x23 = (x6 >> 8); + uint8_t x24 = (uint8_t)(x6 & UINT8_C(0xff)); + uint32_t x25 = (x23 >> 8); + uint8_t x26 = (uint8_t)(x23 & UINT8_C(0xff)); + uint8_t x27 = (uint8_t)(x25 >> 8); + uint8_t x28 = (uint8_t)(x25 & UINT8_C(0xff)); + uint8_t x29 = (uint8_t)(x27 & UINT8_C(0xff)); + uint32_t x30 = (x5 >> 8); + uint8_t x31 = (uint8_t)(x5 & UINT8_C(0xff)); + uint32_t x32 = (x30 >> 8); + uint8_t x33 = (uint8_t)(x30 & UINT8_C(0xff)); + uint8_t x34 = (uint8_t)(x32 >> 8); + uint8_t x35 = (uint8_t)(x32 & UINT8_C(0xff)); + uint8_t x36 = (uint8_t)(x34 & UINT8_C(0xff)); + uint32_t x37 = (x4 >> 8); + uint8_t x38 = (uint8_t)(x4 & UINT8_C(0xff)); + uint32_t x39 = (x37 >> 8); + uint8_t x40 = (uint8_t)(x37 & UINT8_C(0xff)); + uint8_t x41 = (uint8_t)(x39 >> 8); + uint8_t x42 = (uint8_t)(x39 & UINT8_C(0xff)); + uint8_t x43 = (uint8_t)(x41 & UINT8_C(0xff)); + uint32_t x44 = (x3 >> 8); + uint8_t x45 = (uint8_t)(x3 & UINT8_C(0xff)); + uint32_t x46 = (x44 >> 8); + uint8_t x47 = (uint8_t)(x44 & UINT8_C(0xff)); + uint8_t x48 = (uint8_t)(x46 >> 8); + uint8_t x49 = (uint8_t)(x46 & UINT8_C(0xff)); + uint8_t x50 = (uint8_t)(x48 & UINT8_C(0xff)); + uint32_t x51 = (x2 >> 8); + uint8_t x52 = (uint8_t)(x2 & UINT8_C(0xff)); + uint32_t x53 = (x51 >> 8); + uint8_t x54 = (uint8_t)(x51 & UINT8_C(0xff)); + uint8_t x55 = (uint8_t)(x53 >> 8); + uint8_t x56 = (uint8_t)(x53 & UINT8_C(0xff)); + uint8_t x57 = (uint8_t)(x55 & UINT8_C(0xff)); + uint32_t x58 = (x1 >> 8); + uint8_t x59 = (uint8_t)(x1 & UINT8_C(0xff)); + uint32_t x60 = (x58 >> 8); + uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); + uint8_t x62 = (uint8_t)(x60 >> 8); + uint8_t x63 = (uint8_t)(x60 & UINT8_C(0xff)); + out1[0] = x10; + out1[1] = x12; + out1[2] = x14; + out1[3] = x15; + out1[4] = x17; + out1[5] = x19; + out1[6] = x21; + out1[7] = x22; + out1[8] = x24; + out1[9] = x26; + out1[10] = x28; + out1[11] = x29; + out1[12] = x31; + out1[13] = x33; + out1[14] = x35; + out1[15] = x36; + out1[16] = x38; + out1[17] = x40; + out1[18] = x42; + out1[19] = x43; + out1[20] = x45; + out1[21] = x47; + out1[22] = x49; + out1[23] = x50; + out1[24] = x52; + out1[25] = x54; + out1[26] = x56; + out1[27] = x57; + out1[28] = x59; + out1[29] = x61; + out1[30] = x63; + out1[31] = x62; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_from_bytes(uint32_t out1[8], const uint8_t arg1[32]) { + uint32_t x1 = ((uint32_t)(arg1[31]) << 24); + uint32_t x2 = ((uint32_t)(arg1[30]) << 16); + uint32_t x3 = ((uint32_t)(arg1[29]) << 8); + uint8_t x4 = (arg1[28]); + uint32_t x5 = ((uint32_t)(arg1[27]) << 24); + uint32_t x6 = ((uint32_t)(arg1[26]) << 16); + uint32_t x7 = ((uint32_t)(arg1[25]) << 8); + uint8_t x8 = (arg1[24]); + uint32_t x9 = ((uint32_t)(arg1[23]) << 24); + uint32_t x10 = ((uint32_t)(arg1[22]) << 16); + uint32_t x11 = ((uint32_t)(arg1[21]) << 8); + uint8_t x12 = (arg1[20]); + uint32_t x13 = ((uint32_t)(arg1[19]) << 24); + uint32_t x14 = ((uint32_t)(arg1[18]) << 16); + uint32_t x15 = ((uint32_t)(arg1[17]) << 8); + uint8_t x16 = (arg1[16]); + uint32_t x17 = ((uint32_t)(arg1[15]) << 24); + uint32_t x18 = ((uint32_t)(arg1[14]) << 16); + uint32_t x19 = ((uint32_t)(arg1[13]) << 8); + uint8_t x20 = (arg1[12]); + uint32_t x21 = ((uint32_t)(arg1[11]) << 24); + uint32_t x22 = ((uint32_t)(arg1[10]) << 16); + uint32_t x23 = ((uint32_t)(arg1[9]) << 8); + uint8_t x24 = (arg1[8]); + uint32_t x25 = ((uint32_t)(arg1[7]) << 24); + uint32_t x26 = ((uint32_t)(arg1[6]) << 16); + uint32_t x27 = ((uint32_t)(arg1[5]) << 8); + uint8_t x28 = (arg1[4]); + uint32_t x29 = ((uint32_t)(arg1[3]) << 24); + uint32_t x30 = ((uint32_t)(arg1[2]) << 16); + uint32_t x31 = ((uint32_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint32_t x33 = (x32 + (x31 + (x30 + x29))); + uint32_t x34 = (x33 & UINT32_C(0xffffffff)); + uint32_t x35 = (x4 + (x3 + (x2 + x1))); + uint32_t x36 = (x8 + (x7 + (x6 + x5))); + uint32_t x37 = (x12 + (x11 + (x10 + x9))); + uint32_t x38 = (x16 + (x15 + (x14 + x13))); + uint32_t x39 = (x20 + (x19 + (x18 + x17))); + uint32_t x40 = (x24 + (x23 + (x22 + x21))); + uint32_t x41 = (x28 + (x27 + (x26 + x25))); + uint32_t x42 = (x41 & UINT32_C(0xffffffff)); + uint32_t x43 = (x40 & UINT32_C(0xffffffff)); + uint32_t x44 = (x39 & UINT32_C(0xffffffff)); + uint32_t x45 = (x38 & UINT32_C(0xffffffff)); + uint32_t x46 = (x37 & UINT32_C(0xffffffff)); + uint32_t x47 = (x36 & UINT32_C(0xffffffff)); + out1[0] = x34; + out1[1] = x42; + out1[2] = x43; + out1[3] = x44; + out1[4] = x45; + out1[5] = x46; + out1[6] = x47; + out1[7] = x35; +} + diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h.grpc_back new file mode 100644 index 000000000..638eb5d9c --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_32.h.grpc_back @@ -0,0 +1,3226 @@ +/* Autogenerated */ +/* curve description: p256 */ +/* requested operations: (all) */ +/* m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1") */ +/* machine_wordsize = 32 (from "32") */ +/* */ +/* NOTE: In addition to the bounds specified above each function, all */ +/* functions synthesized for this Montgomery arithmetic require the */ +/* input to be strictly less than the prime modulus (m), and also */ +/* require the input to be in the unique saturated representation. */ +/* All functions also ensure that these two properties are true of */ +/* return values. */ + +#include +typedef unsigned char fiat_p256_uint1; +typedef signed char fiat_p256_int1; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_addcarryx_u32(uint32_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { + uint64_t x1 = ((arg1 + (uint64_t)arg2) + arg3); + uint32_t x2 = (uint32_t)(x1 & UINT32_C(0xffffffff)); + fiat_p256_uint1 x3 = (fiat_p256_uint1)(x1 >> 32); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_subborrowx_u32(uint32_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { + int64_t x1 = ((arg2 - (int64_t)arg1) - arg3); + fiat_p256_int1 x2 = (fiat_p256_int1)(x1 >> 32); + uint32_t x3 = (uint32_t)(x1 & UINT32_C(0xffffffff)); + *out1 = x3; + *out2 = (fiat_p256_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0xffffffff] + * arg2: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + * out2: [0x0 ~> 0xffffffff] + */ +static void fiat_p256_mulx_u32(uint32_t* out1, uint32_t* out2, uint32_t arg1, uint32_t arg2) { + uint64_t x1 = ((uint64_t)arg1 * arg2); + uint32_t x2 = (uint32_t)(x1 & UINT32_C(0xffffffff)); + uint32_t x3 = (uint32_t)(x1 >> 32); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffff] + * arg3: [0x0 ~> 0xffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + */ +static void fiat_p256_cmovznz_u32(uint32_t* out1, fiat_p256_uint1 arg1, uint32_t arg2, uint32_t arg3) { + fiat_p256_uint1 x1 = (!(!arg1)); + uint32_t x2 = ((fiat_p256_int1)(0x0 - x1) & UINT32_C(0xffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint32_t x3 = ((value_barrier_u32(x2) & arg3) | (value_barrier_u32(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_mul(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { + uint32_t x1 = (arg1[1]); + uint32_t x2 = (arg1[2]); + uint32_t x3 = (arg1[3]); + uint32_t x4 = (arg1[4]); + uint32_t x5 = (arg1[5]); + uint32_t x6 = (arg1[6]); + uint32_t x7 = (arg1[7]); + uint32_t x8 = (arg1[0]); + uint32_t x9; + uint32_t x10; + fiat_p256_mulx_u32(&x9, &x10, x8, (arg2[7])); + uint32_t x11; + uint32_t x12; + fiat_p256_mulx_u32(&x11, &x12, x8, (arg2[6])); + uint32_t x13; + uint32_t x14; + fiat_p256_mulx_u32(&x13, &x14, x8, (arg2[5])); + uint32_t x15; + uint32_t x16; + fiat_p256_mulx_u32(&x15, &x16, x8, (arg2[4])); + uint32_t x17; + uint32_t x18; + fiat_p256_mulx_u32(&x17, &x18, x8, (arg2[3])); + uint32_t x19; + uint32_t x20; + fiat_p256_mulx_u32(&x19, &x20, x8, (arg2[2])); + uint32_t x21; + uint32_t x22; + fiat_p256_mulx_u32(&x21, &x22, x8, (arg2[1])); + uint32_t x23; + uint32_t x24; + fiat_p256_mulx_u32(&x23, &x24, x8, (arg2[0])); + uint32_t x25; + fiat_p256_uint1 x26; + fiat_p256_addcarryx_u32(&x25, &x26, 0x0, x21, x24); + uint32_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u32(&x27, &x28, x26, x19, x22); + uint32_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u32(&x29, &x30, x28, x17, x20); + uint32_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u32(&x31, &x32, x30, x15, x18); + uint32_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u32(&x33, &x34, x32, x13, x16); + uint32_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u32(&x35, &x36, x34, x11, x14); + uint32_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u32(&x37, &x38, x36, x9, x12); + uint32_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u32(&x39, &x40, x38, 0x0, x10); + uint32_t x41; + uint32_t x42; + fiat_p256_mulx_u32(&x41, &x42, x23, UINT32_C(0xffffffff)); + uint32_t x43; + uint32_t x44; + fiat_p256_mulx_u32(&x43, &x44, x23, UINT32_C(0xffffffff)); + uint32_t x45; + uint32_t x46; + fiat_p256_mulx_u32(&x45, &x46, x23, UINT32_C(0xffffffff)); + uint32_t x47; + uint32_t x48; + fiat_p256_mulx_u32(&x47, &x48, x23, UINT32_C(0xffffffff)); + uint32_t x49; + fiat_p256_uint1 x50; + fiat_p256_addcarryx_u32(&x49, &x50, 0x0, x45, x48); + uint32_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u32(&x51, &x52, x50, x43, x46); + uint32_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u32(&x53, &x54, x52, 0x0, x44); + uint32_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u32(&x55, &x56, 0x0, x47, x23); + uint32_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u32(&x57, &x58, x56, x49, x25); + uint32_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u32(&x59, &x60, x58, x51, x27); + uint32_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u32(&x61, &x62, x60, x53, x29); + uint32_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u32(&x63, &x64, x62, 0x0, x31); + uint32_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u32(&x65, &x66, x64, 0x0, x33); + uint32_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u32(&x67, &x68, x66, x23, x35); + uint32_t x69; + fiat_p256_uint1 x70; + fiat_p256_addcarryx_u32(&x69, &x70, x68, x41, x37); + uint32_t x71; + fiat_p256_uint1 x72; + fiat_p256_addcarryx_u32(&x71, &x72, x70, x42, x39); + uint32_t x73; + fiat_p256_uint1 x74; + fiat_p256_addcarryx_u32(&x73, &x74, x72, 0x0, 0x0); + uint32_t x75; + uint32_t x76; + fiat_p256_mulx_u32(&x75, &x76, x1, (arg2[7])); + uint32_t x77; + uint32_t x78; + fiat_p256_mulx_u32(&x77, &x78, x1, (arg2[6])); + uint32_t x79; + uint32_t x80; + fiat_p256_mulx_u32(&x79, &x80, x1, (arg2[5])); + uint32_t x81; + uint32_t x82; + fiat_p256_mulx_u32(&x81, &x82, x1, (arg2[4])); + uint32_t x83; + uint32_t x84; + fiat_p256_mulx_u32(&x83, &x84, x1, (arg2[3])); + uint32_t x85; + uint32_t x86; + fiat_p256_mulx_u32(&x85, &x86, x1, (arg2[2])); + uint32_t x87; + uint32_t x88; + fiat_p256_mulx_u32(&x87, &x88, x1, (arg2[1])); + uint32_t x89; + uint32_t x90; + fiat_p256_mulx_u32(&x89, &x90, x1, (arg2[0])); + uint32_t x91; + fiat_p256_uint1 x92; + fiat_p256_addcarryx_u32(&x91, &x92, 0x0, x87, x90); + uint32_t x93; + fiat_p256_uint1 x94; + fiat_p256_addcarryx_u32(&x93, &x94, x92, x85, x88); + uint32_t x95; + fiat_p256_uint1 x96; + fiat_p256_addcarryx_u32(&x95, &x96, x94, x83, x86); + uint32_t x97; + fiat_p256_uint1 x98; + fiat_p256_addcarryx_u32(&x97, &x98, x96, x81, x84); + uint32_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u32(&x99, &x100, x98, x79, x82); + uint32_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u32(&x101, &x102, x100, x77, x80); + uint32_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u32(&x103, &x104, x102, x75, x78); + uint32_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u32(&x105, &x106, x104, 0x0, x76); + uint32_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u32(&x107, &x108, 0x0, x89, x57); + uint32_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u32(&x109, &x110, x108, x91, x59); + uint32_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u32(&x111, &x112, x110, x93, x61); + uint32_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u32(&x113, &x114, x112, x95, x63); + uint32_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u32(&x115, &x116, x114, x97, x65); + uint32_t x117; + fiat_p256_uint1 x118; + fiat_p256_addcarryx_u32(&x117, &x118, x116, x99, x67); + uint32_t x119; + fiat_p256_uint1 x120; + fiat_p256_addcarryx_u32(&x119, &x120, x118, x101, x69); + uint32_t x121; + fiat_p256_uint1 x122; + fiat_p256_addcarryx_u32(&x121, &x122, x120, x103, x71); + uint32_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u32(&x123, &x124, x122, x105, (fiat_p256_uint1)x73); + uint32_t x125; + uint32_t x126; + fiat_p256_mulx_u32(&x125, &x126, x107, UINT32_C(0xffffffff)); + uint32_t x127; + uint32_t x128; + fiat_p256_mulx_u32(&x127, &x128, x107, UINT32_C(0xffffffff)); + uint32_t x129; + uint32_t x130; + fiat_p256_mulx_u32(&x129, &x130, x107, UINT32_C(0xffffffff)); + uint32_t x131; + uint32_t x132; + fiat_p256_mulx_u32(&x131, &x132, x107, UINT32_C(0xffffffff)); + uint32_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u32(&x133, &x134, 0x0, x129, x132); + uint32_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u32(&x135, &x136, x134, x127, x130); + uint32_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u32(&x137, &x138, x136, 0x0, x128); + uint32_t x139; + fiat_p256_uint1 x140; + fiat_p256_addcarryx_u32(&x139, &x140, 0x0, x131, x107); + uint32_t x141; + fiat_p256_uint1 x142; + fiat_p256_addcarryx_u32(&x141, &x142, x140, x133, x109); + uint32_t x143; + fiat_p256_uint1 x144; + fiat_p256_addcarryx_u32(&x143, &x144, x142, x135, x111); + uint32_t x145; + fiat_p256_uint1 x146; + fiat_p256_addcarryx_u32(&x145, &x146, x144, x137, x113); + uint32_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u32(&x147, &x148, x146, 0x0, x115); + uint32_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u32(&x149, &x150, x148, 0x0, x117); + uint32_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u32(&x151, &x152, x150, x107, x119); + uint32_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u32(&x153, &x154, x152, x125, x121); + uint32_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u32(&x155, &x156, x154, x126, x123); + uint32_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u32(&x157, &x158, x156, 0x0, x124); + uint32_t x159; + uint32_t x160; + fiat_p256_mulx_u32(&x159, &x160, x2, (arg2[7])); + uint32_t x161; + uint32_t x162; + fiat_p256_mulx_u32(&x161, &x162, x2, (arg2[6])); + uint32_t x163; + uint32_t x164; + fiat_p256_mulx_u32(&x163, &x164, x2, (arg2[5])); + uint32_t x165; + uint32_t x166; + fiat_p256_mulx_u32(&x165, &x166, x2, (arg2[4])); + uint32_t x167; + uint32_t x168; + fiat_p256_mulx_u32(&x167, &x168, x2, (arg2[3])); + uint32_t x169; + uint32_t x170; + fiat_p256_mulx_u32(&x169, &x170, x2, (arg2[2])); + uint32_t x171; + uint32_t x172; + fiat_p256_mulx_u32(&x171, &x172, x2, (arg2[1])); + uint32_t x173; + uint32_t x174; + fiat_p256_mulx_u32(&x173, &x174, x2, (arg2[0])); + uint32_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u32(&x175, &x176, 0x0, x171, x174); + uint32_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u32(&x177, &x178, x176, x169, x172); + uint32_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u32(&x179, &x180, x178, x167, x170); + uint32_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u32(&x181, &x182, x180, x165, x168); + uint32_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u32(&x183, &x184, x182, x163, x166); + uint32_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u32(&x185, &x186, x184, x161, x164); + uint32_t x187; + fiat_p256_uint1 x188; + fiat_p256_addcarryx_u32(&x187, &x188, x186, x159, x162); + uint32_t x189; + fiat_p256_uint1 x190; + fiat_p256_addcarryx_u32(&x189, &x190, x188, 0x0, x160); + uint32_t x191; + fiat_p256_uint1 x192; + fiat_p256_addcarryx_u32(&x191, &x192, 0x0, x173, x141); + uint32_t x193; + fiat_p256_uint1 x194; + fiat_p256_addcarryx_u32(&x193, &x194, x192, x175, x143); + uint32_t x195; + fiat_p256_uint1 x196; + fiat_p256_addcarryx_u32(&x195, &x196, x194, x177, x145); + uint32_t x197; + fiat_p256_uint1 x198; + fiat_p256_addcarryx_u32(&x197, &x198, x196, x179, x147); + uint32_t x199; + fiat_p256_uint1 x200; + fiat_p256_addcarryx_u32(&x199, &x200, x198, x181, x149); + uint32_t x201; + fiat_p256_uint1 x202; + fiat_p256_addcarryx_u32(&x201, &x202, x200, x183, x151); + uint32_t x203; + fiat_p256_uint1 x204; + fiat_p256_addcarryx_u32(&x203, &x204, x202, x185, x153); + uint32_t x205; + fiat_p256_uint1 x206; + fiat_p256_addcarryx_u32(&x205, &x206, x204, x187, x155); + uint32_t x207; + fiat_p256_uint1 x208; + fiat_p256_addcarryx_u32(&x207, &x208, x206, x189, x157); + uint32_t x209; + uint32_t x210; + fiat_p256_mulx_u32(&x209, &x210, x191, UINT32_C(0xffffffff)); + uint32_t x211; + uint32_t x212; + fiat_p256_mulx_u32(&x211, &x212, x191, UINT32_C(0xffffffff)); + uint32_t x213; + uint32_t x214; + fiat_p256_mulx_u32(&x213, &x214, x191, UINT32_C(0xffffffff)); + uint32_t x215; + uint32_t x216; + fiat_p256_mulx_u32(&x215, &x216, x191, UINT32_C(0xffffffff)); + uint32_t x217; + fiat_p256_uint1 x218; + fiat_p256_addcarryx_u32(&x217, &x218, 0x0, x213, x216); + uint32_t x219; + fiat_p256_uint1 x220; + fiat_p256_addcarryx_u32(&x219, &x220, x218, x211, x214); + uint32_t x221; + fiat_p256_uint1 x222; + fiat_p256_addcarryx_u32(&x221, &x222, x220, 0x0, x212); + uint32_t x223; + fiat_p256_uint1 x224; + fiat_p256_addcarryx_u32(&x223, &x224, 0x0, x215, x191); + uint32_t x225; + fiat_p256_uint1 x226; + fiat_p256_addcarryx_u32(&x225, &x226, x224, x217, x193); + uint32_t x227; + fiat_p256_uint1 x228; + fiat_p256_addcarryx_u32(&x227, &x228, x226, x219, x195); + uint32_t x229; + fiat_p256_uint1 x230; + fiat_p256_addcarryx_u32(&x229, &x230, x228, x221, x197); + uint32_t x231; + fiat_p256_uint1 x232; + fiat_p256_addcarryx_u32(&x231, &x232, x230, 0x0, x199); + uint32_t x233; + fiat_p256_uint1 x234; + fiat_p256_addcarryx_u32(&x233, &x234, x232, 0x0, x201); + uint32_t x235; + fiat_p256_uint1 x236; + fiat_p256_addcarryx_u32(&x235, &x236, x234, x191, x203); + uint32_t x237; + fiat_p256_uint1 x238; + fiat_p256_addcarryx_u32(&x237, &x238, x236, x209, x205); + uint32_t x239; + fiat_p256_uint1 x240; + fiat_p256_addcarryx_u32(&x239, &x240, x238, x210, x207); + uint32_t x241; + fiat_p256_uint1 x242; + fiat_p256_addcarryx_u32(&x241, &x242, x240, 0x0, x208); + uint32_t x243; + uint32_t x244; + fiat_p256_mulx_u32(&x243, &x244, x3, (arg2[7])); + uint32_t x245; + uint32_t x246; + fiat_p256_mulx_u32(&x245, &x246, x3, (arg2[6])); + uint32_t x247; + uint32_t x248; + fiat_p256_mulx_u32(&x247, &x248, x3, (arg2[5])); + uint32_t x249; + uint32_t x250; + fiat_p256_mulx_u32(&x249, &x250, x3, (arg2[4])); + uint32_t x251; + uint32_t x252; + fiat_p256_mulx_u32(&x251, &x252, x3, (arg2[3])); + uint32_t x253; + uint32_t x254; + fiat_p256_mulx_u32(&x253, &x254, x3, (arg2[2])); + uint32_t x255; + uint32_t x256; + fiat_p256_mulx_u32(&x255, &x256, x3, (arg2[1])); + uint32_t x257; + uint32_t x258; + fiat_p256_mulx_u32(&x257, &x258, x3, (arg2[0])); + uint32_t x259; + fiat_p256_uint1 x260; + fiat_p256_addcarryx_u32(&x259, &x260, 0x0, x255, x258); + uint32_t x261; + fiat_p256_uint1 x262; + fiat_p256_addcarryx_u32(&x261, &x262, x260, x253, x256); + uint32_t x263; + fiat_p256_uint1 x264; + fiat_p256_addcarryx_u32(&x263, &x264, x262, x251, x254); + uint32_t x265; + fiat_p256_uint1 x266; + fiat_p256_addcarryx_u32(&x265, &x266, x264, x249, x252); + uint32_t x267; + fiat_p256_uint1 x268; + fiat_p256_addcarryx_u32(&x267, &x268, x266, x247, x250); + uint32_t x269; + fiat_p256_uint1 x270; + fiat_p256_addcarryx_u32(&x269, &x270, x268, x245, x248); + uint32_t x271; + fiat_p256_uint1 x272; + fiat_p256_addcarryx_u32(&x271, &x272, x270, x243, x246); + uint32_t x273; + fiat_p256_uint1 x274; + fiat_p256_addcarryx_u32(&x273, &x274, x272, 0x0, x244); + uint32_t x275; + fiat_p256_uint1 x276; + fiat_p256_addcarryx_u32(&x275, &x276, 0x0, x257, x225); + uint32_t x277; + fiat_p256_uint1 x278; + fiat_p256_addcarryx_u32(&x277, &x278, x276, x259, x227); + uint32_t x279; + fiat_p256_uint1 x280; + fiat_p256_addcarryx_u32(&x279, &x280, x278, x261, x229); + uint32_t x281; + fiat_p256_uint1 x282; + fiat_p256_addcarryx_u32(&x281, &x282, x280, x263, x231); + uint32_t x283; + fiat_p256_uint1 x284; + fiat_p256_addcarryx_u32(&x283, &x284, x282, x265, x233); + uint32_t x285; + fiat_p256_uint1 x286; + fiat_p256_addcarryx_u32(&x285, &x286, x284, x267, x235); + uint32_t x287; + fiat_p256_uint1 x288; + fiat_p256_addcarryx_u32(&x287, &x288, x286, x269, x237); + uint32_t x289; + fiat_p256_uint1 x290; + fiat_p256_addcarryx_u32(&x289, &x290, x288, x271, x239); + uint32_t x291; + fiat_p256_uint1 x292; + fiat_p256_addcarryx_u32(&x291, &x292, x290, x273, x241); + uint32_t x293; + uint32_t x294; + fiat_p256_mulx_u32(&x293, &x294, x275, UINT32_C(0xffffffff)); + uint32_t x295; + uint32_t x296; + fiat_p256_mulx_u32(&x295, &x296, x275, UINT32_C(0xffffffff)); + uint32_t x297; + uint32_t x298; + fiat_p256_mulx_u32(&x297, &x298, x275, UINT32_C(0xffffffff)); + uint32_t x299; + uint32_t x300; + fiat_p256_mulx_u32(&x299, &x300, x275, UINT32_C(0xffffffff)); + uint32_t x301; + fiat_p256_uint1 x302; + fiat_p256_addcarryx_u32(&x301, &x302, 0x0, x297, x300); + uint32_t x303; + fiat_p256_uint1 x304; + fiat_p256_addcarryx_u32(&x303, &x304, x302, x295, x298); + uint32_t x305; + fiat_p256_uint1 x306; + fiat_p256_addcarryx_u32(&x305, &x306, x304, 0x0, x296); + uint32_t x307; + fiat_p256_uint1 x308; + fiat_p256_addcarryx_u32(&x307, &x308, 0x0, x299, x275); + uint32_t x309; + fiat_p256_uint1 x310; + fiat_p256_addcarryx_u32(&x309, &x310, x308, x301, x277); + uint32_t x311; + fiat_p256_uint1 x312; + fiat_p256_addcarryx_u32(&x311, &x312, x310, x303, x279); + uint32_t x313; + fiat_p256_uint1 x314; + fiat_p256_addcarryx_u32(&x313, &x314, x312, x305, x281); + uint32_t x315; + fiat_p256_uint1 x316; + fiat_p256_addcarryx_u32(&x315, &x316, x314, 0x0, x283); + uint32_t x317; + fiat_p256_uint1 x318; + fiat_p256_addcarryx_u32(&x317, &x318, x316, 0x0, x285); + uint32_t x319; + fiat_p256_uint1 x320; + fiat_p256_addcarryx_u32(&x319, &x320, x318, x275, x287); + uint32_t x321; + fiat_p256_uint1 x322; + fiat_p256_addcarryx_u32(&x321, &x322, x320, x293, x289); + uint32_t x323; + fiat_p256_uint1 x324; + fiat_p256_addcarryx_u32(&x323, &x324, x322, x294, x291); + uint32_t x325; + fiat_p256_uint1 x326; + fiat_p256_addcarryx_u32(&x325, &x326, x324, 0x0, x292); + uint32_t x327; + uint32_t x328; + fiat_p256_mulx_u32(&x327, &x328, x4, (arg2[7])); + uint32_t x329; + uint32_t x330; + fiat_p256_mulx_u32(&x329, &x330, x4, (arg2[6])); + uint32_t x331; + uint32_t x332; + fiat_p256_mulx_u32(&x331, &x332, x4, (arg2[5])); + uint32_t x333; + uint32_t x334; + fiat_p256_mulx_u32(&x333, &x334, x4, (arg2[4])); + uint32_t x335; + uint32_t x336; + fiat_p256_mulx_u32(&x335, &x336, x4, (arg2[3])); + uint32_t x337; + uint32_t x338; + fiat_p256_mulx_u32(&x337, &x338, x4, (arg2[2])); + uint32_t x339; + uint32_t x340; + fiat_p256_mulx_u32(&x339, &x340, x4, (arg2[1])); + uint32_t x341; + uint32_t x342; + fiat_p256_mulx_u32(&x341, &x342, x4, (arg2[0])); + uint32_t x343; + fiat_p256_uint1 x344; + fiat_p256_addcarryx_u32(&x343, &x344, 0x0, x339, x342); + uint32_t x345; + fiat_p256_uint1 x346; + fiat_p256_addcarryx_u32(&x345, &x346, x344, x337, x340); + uint32_t x347; + fiat_p256_uint1 x348; + fiat_p256_addcarryx_u32(&x347, &x348, x346, x335, x338); + uint32_t x349; + fiat_p256_uint1 x350; + fiat_p256_addcarryx_u32(&x349, &x350, x348, x333, x336); + uint32_t x351; + fiat_p256_uint1 x352; + fiat_p256_addcarryx_u32(&x351, &x352, x350, x331, x334); + uint32_t x353; + fiat_p256_uint1 x354; + fiat_p256_addcarryx_u32(&x353, &x354, x352, x329, x332); + uint32_t x355; + fiat_p256_uint1 x356; + fiat_p256_addcarryx_u32(&x355, &x356, x354, x327, x330); + uint32_t x357; + fiat_p256_uint1 x358; + fiat_p256_addcarryx_u32(&x357, &x358, x356, 0x0, x328); + uint32_t x359; + fiat_p256_uint1 x360; + fiat_p256_addcarryx_u32(&x359, &x360, 0x0, x341, x309); + uint32_t x361; + fiat_p256_uint1 x362; + fiat_p256_addcarryx_u32(&x361, &x362, x360, x343, x311); + uint32_t x363; + fiat_p256_uint1 x364; + fiat_p256_addcarryx_u32(&x363, &x364, x362, x345, x313); + uint32_t x365; + fiat_p256_uint1 x366; + fiat_p256_addcarryx_u32(&x365, &x366, x364, x347, x315); + uint32_t x367; + fiat_p256_uint1 x368; + fiat_p256_addcarryx_u32(&x367, &x368, x366, x349, x317); + uint32_t x369; + fiat_p256_uint1 x370; + fiat_p256_addcarryx_u32(&x369, &x370, x368, x351, x319); + uint32_t x371; + fiat_p256_uint1 x372; + fiat_p256_addcarryx_u32(&x371, &x372, x370, x353, x321); + uint32_t x373; + fiat_p256_uint1 x374; + fiat_p256_addcarryx_u32(&x373, &x374, x372, x355, x323); + uint32_t x375; + fiat_p256_uint1 x376; + fiat_p256_addcarryx_u32(&x375, &x376, x374, x357, x325); + uint32_t x377; + uint32_t x378; + fiat_p256_mulx_u32(&x377, &x378, x359, UINT32_C(0xffffffff)); + uint32_t x379; + uint32_t x380; + fiat_p256_mulx_u32(&x379, &x380, x359, UINT32_C(0xffffffff)); + uint32_t x381; + uint32_t x382; + fiat_p256_mulx_u32(&x381, &x382, x359, UINT32_C(0xffffffff)); + uint32_t x383; + uint32_t x384; + fiat_p256_mulx_u32(&x383, &x384, x359, UINT32_C(0xffffffff)); + uint32_t x385; + fiat_p256_uint1 x386; + fiat_p256_addcarryx_u32(&x385, &x386, 0x0, x381, x384); + uint32_t x387; + fiat_p256_uint1 x388; + fiat_p256_addcarryx_u32(&x387, &x388, x386, x379, x382); + uint32_t x389; + fiat_p256_uint1 x390; + fiat_p256_addcarryx_u32(&x389, &x390, x388, 0x0, x380); + uint32_t x391; + fiat_p256_uint1 x392; + fiat_p256_addcarryx_u32(&x391, &x392, 0x0, x383, x359); + uint32_t x393; + fiat_p256_uint1 x394; + fiat_p256_addcarryx_u32(&x393, &x394, x392, x385, x361); + uint32_t x395; + fiat_p256_uint1 x396; + fiat_p256_addcarryx_u32(&x395, &x396, x394, x387, x363); + uint32_t x397; + fiat_p256_uint1 x398; + fiat_p256_addcarryx_u32(&x397, &x398, x396, x389, x365); + uint32_t x399; + fiat_p256_uint1 x400; + fiat_p256_addcarryx_u32(&x399, &x400, x398, 0x0, x367); + uint32_t x401; + fiat_p256_uint1 x402; + fiat_p256_addcarryx_u32(&x401, &x402, x400, 0x0, x369); + uint32_t x403; + fiat_p256_uint1 x404; + fiat_p256_addcarryx_u32(&x403, &x404, x402, x359, x371); + uint32_t x405; + fiat_p256_uint1 x406; + fiat_p256_addcarryx_u32(&x405, &x406, x404, x377, x373); + uint32_t x407; + fiat_p256_uint1 x408; + fiat_p256_addcarryx_u32(&x407, &x408, x406, x378, x375); + uint32_t x409; + fiat_p256_uint1 x410; + fiat_p256_addcarryx_u32(&x409, &x410, x408, 0x0, x376); + uint32_t x411; + uint32_t x412; + fiat_p256_mulx_u32(&x411, &x412, x5, (arg2[7])); + uint32_t x413; + uint32_t x414; + fiat_p256_mulx_u32(&x413, &x414, x5, (arg2[6])); + uint32_t x415; + uint32_t x416; + fiat_p256_mulx_u32(&x415, &x416, x5, (arg2[5])); + uint32_t x417; + uint32_t x418; + fiat_p256_mulx_u32(&x417, &x418, x5, (arg2[4])); + uint32_t x419; + uint32_t x420; + fiat_p256_mulx_u32(&x419, &x420, x5, (arg2[3])); + uint32_t x421; + uint32_t x422; + fiat_p256_mulx_u32(&x421, &x422, x5, (arg2[2])); + uint32_t x423; + uint32_t x424; + fiat_p256_mulx_u32(&x423, &x424, x5, (arg2[1])); + uint32_t x425; + uint32_t x426; + fiat_p256_mulx_u32(&x425, &x426, x5, (arg2[0])); + uint32_t x427; + fiat_p256_uint1 x428; + fiat_p256_addcarryx_u32(&x427, &x428, 0x0, x423, x426); + uint32_t x429; + fiat_p256_uint1 x430; + fiat_p256_addcarryx_u32(&x429, &x430, x428, x421, x424); + uint32_t x431; + fiat_p256_uint1 x432; + fiat_p256_addcarryx_u32(&x431, &x432, x430, x419, x422); + uint32_t x433; + fiat_p256_uint1 x434; + fiat_p256_addcarryx_u32(&x433, &x434, x432, x417, x420); + uint32_t x435; + fiat_p256_uint1 x436; + fiat_p256_addcarryx_u32(&x435, &x436, x434, x415, x418); + uint32_t x437; + fiat_p256_uint1 x438; + fiat_p256_addcarryx_u32(&x437, &x438, x436, x413, x416); + uint32_t x439; + fiat_p256_uint1 x440; + fiat_p256_addcarryx_u32(&x439, &x440, x438, x411, x414); + uint32_t x441; + fiat_p256_uint1 x442; + fiat_p256_addcarryx_u32(&x441, &x442, x440, 0x0, x412); + uint32_t x443; + fiat_p256_uint1 x444; + fiat_p256_addcarryx_u32(&x443, &x444, 0x0, x425, x393); + uint32_t x445; + fiat_p256_uint1 x446; + fiat_p256_addcarryx_u32(&x445, &x446, x444, x427, x395); + uint32_t x447; + fiat_p256_uint1 x448; + fiat_p256_addcarryx_u32(&x447, &x448, x446, x429, x397); + uint32_t x449; + fiat_p256_uint1 x450; + fiat_p256_addcarryx_u32(&x449, &x450, x448, x431, x399); + uint32_t x451; + fiat_p256_uint1 x452; + fiat_p256_addcarryx_u32(&x451, &x452, x450, x433, x401); + uint32_t x453; + fiat_p256_uint1 x454; + fiat_p256_addcarryx_u32(&x453, &x454, x452, x435, x403); + uint32_t x455; + fiat_p256_uint1 x456; + fiat_p256_addcarryx_u32(&x455, &x456, x454, x437, x405); + uint32_t x457; + fiat_p256_uint1 x458; + fiat_p256_addcarryx_u32(&x457, &x458, x456, x439, x407); + uint32_t x459; + fiat_p256_uint1 x460; + fiat_p256_addcarryx_u32(&x459, &x460, x458, x441, x409); + uint32_t x461; + uint32_t x462; + fiat_p256_mulx_u32(&x461, &x462, x443, UINT32_C(0xffffffff)); + uint32_t x463; + uint32_t x464; + fiat_p256_mulx_u32(&x463, &x464, x443, UINT32_C(0xffffffff)); + uint32_t x465; + uint32_t x466; + fiat_p256_mulx_u32(&x465, &x466, x443, UINT32_C(0xffffffff)); + uint32_t x467; + uint32_t x468; + fiat_p256_mulx_u32(&x467, &x468, x443, UINT32_C(0xffffffff)); + uint32_t x469; + fiat_p256_uint1 x470; + fiat_p256_addcarryx_u32(&x469, &x470, 0x0, x465, x468); + uint32_t x471; + fiat_p256_uint1 x472; + fiat_p256_addcarryx_u32(&x471, &x472, x470, x463, x466); + uint32_t x473; + fiat_p256_uint1 x474; + fiat_p256_addcarryx_u32(&x473, &x474, x472, 0x0, x464); + uint32_t x475; + fiat_p256_uint1 x476; + fiat_p256_addcarryx_u32(&x475, &x476, 0x0, x467, x443); + uint32_t x477; + fiat_p256_uint1 x478; + fiat_p256_addcarryx_u32(&x477, &x478, x476, x469, x445); + uint32_t x479; + fiat_p256_uint1 x480; + fiat_p256_addcarryx_u32(&x479, &x480, x478, x471, x447); + uint32_t x481; + fiat_p256_uint1 x482; + fiat_p256_addcarryx_u32(&x481, &x482, x480, x473, x449); + uint32_t x483; + fiat_p256_uint1 x484; + fiat_p256_addcarryx_u32(&x483, &x484, x482, 0x0, x451); + uint32_t x485; + fiat_p256_uint1 x486; + fiat_p256_addcarryx_u32(&x485, &x486, x484, 0x0, x453); + uint32_t x487; + fiat_p256_uint1 x488; + fiat_p256_addcarryx_u32(&x487, &x488, x486, x443, x455); + uint32_t x489; + fiat_p256_uint1 x490; + fiat_p256_addcarryx_u32(&x489, &x490, x488, x461, x457); + uint32_t x491; + fiat_p256_uint1 x492; + fiat_p256_addcarryx_u32(&x491, &x492, x490, x462, x459); + uint32_t x493; + fiat_p256_uint1 x494; + fiat_p256_addcarryx_u32(&x493, &x494, x492, 0x0, x460); + uint32_t x495; + uint32_t x496; + fiat_p256_mulx_u32(&x495, &x496, x6, (arg2[7])); + uint32_t x497; + uint32_t x498; + fiat_p256_mulx_u32(&x497, &x498, x6, (arg2[6])); + uint32_t x499; + uint32_t x500; + fiat_p256_mulx_u32(&x499, &x500, x6, (arg2[5])); + uint32_t x501; + uint32_t x502; + fiat_p256_mulx_u32(&x501, &x502, x6, (arg2[4])); + uint32_t x503; + uint32_t x504; + fiat_p256_mulx_u32(&x503, &x504, x6, (arg2[3])); + uint32_t x505; + uint32_t x506; + fiat_p256_mulx_u32(&x505, &x506, x6, (arg2[2])); + uint32_t x507; + uint32_t x508; + fiat_p256_mulx_u32(&x507, &x508, x6, (arg2[1])); + uint32_t x509; + uint32_t x510; + fiat_p256_mulx_u32(&x509, &x510, x6, (arg2[0])); + uint32_t x511; + fiat_p256_uint1 x512; + fiat_p256_addcarryx_u32(&x511, &x512, 0x0, x507, x510); + uint32_t x513; + fiat_p256_uint1 x514; + fiat_p256_addcarryx_u32(&x513, &x514, x512, x505, x508); + uint32_t x515; + fiat_p256_uint1 x516; + fiat_p256_addcarryx_u32(&x515, &x516, x514, x503, x506); + uint32_t x517; + fiat_p256_uint1 x518; + fiat_p256_addcarryx_u32(&x517, &x518, x516, x501, x504); + uint32_t x519; + fiat_p256_uint1 x520; + fiat_p256_addcarryx_u32(&x519, &x520, x518, x499, x502); + uint32_t x521; + fiat_p256_uint1 x522; + fiat_p256_addcarryx_u32(&x521, &x522, x520, x497, x500); + uint32_t x523; + fiat_p256_uint1 x524; + fiat_p256_addcarryx_u32(&x523, &x524, x522, x495, x498); + uint32_t x525; + fiat_p256_uint1 x526; + fiat_p256_addcarryx_u32(&x525, &x526, x524, 0x0, x496); + uint32_t x527; + fiat_p256_uint1 x528; + fiat_p256_addcarryx_u32(&x527, &x528, 0x0, x509, x477); + uint32_t x529; + fiat_p256_uint1 x530; + fiat_p256_addcarryx_u32(&x529, &x530, x528, x511, x479); + uint32_t x531; + fiat_p256_uint1 x532; + fiat_p256_addcarryx_u32(&x531, &x532, x530, x513, x481); + uint32_t x533; + fiat_p256_uint1 x534; + fiat_p256_addcarryx_u32(&x533, &x534, x532, x515, x483); + uint32_t x535; + fiat_p256_uint1 x536; + fiat_p256_addcarryx_u32(&x535, &x536, x534, x517, x485); + uint32_t x537; + fiat_p256_uint1 x538; + fiat_p256_addcarryx_u32(&x537, &x538, x536, x519, x487); + uint32_t x539; + fiat_p256_uint1 x540; + fiat_p256_addcarryx_u32(&x539, &x540, x538, x521, x489); + uint32_t x541; + fiat_p256_uint1 x542; + fiat_p256_addcarryx_u32(&x541, &x542, x540, x523, x491); + uint32_t x543; + fiat_p256_uint1 x544; + fiat_p256_addcarryx_u32(&x543, &x544, x542, x525, x493); + uint32_t x545; + uint32_t x546; + fiat_p256_mulx_u32(&x545, &x546, x527, UINT32_C(0xffffffff)); + uint32_t x547; + uint32_t x548; + fiat_p256_mulx_u32(&x547, &x548, x527, UINT32_C(0xffffffff)); + uint32_t x549; + uint32_t x550; + fiat_p256_mulx_u32(&x549, &x550, x527, UINT32_C(0xffffffff)); + uint32_t x551; + uint32_t x552; + fiat_p256_mulx_u32(&x551, &x552, x527, UINT32_C(0xffffffff)); + uint32_t x553; + fiat_p256_uint1 x554; + fiat_p256_addcarryx_u32(&x553, &x554, 0x0, x549, x552); + uint32_t x555; + fiat_p256_uint1 x556; + fiat_p256_addcarryx_u32(&x555, &x556, x554, x547, x550); + uint32_t x557; + fiat_p256_uint1 x558; + fiat_p256_addcarryx_u32(&x557, &x558, x556, 0x0, x548); + uint32_t x559; + fiat_p256_uint1 x560; + fiat_p256_addcarryx_u32(&x559, &x560, 0x0, x551, x527); + uint32_t x561; + fiat_p256_uint1 x562; + fiat_p256_addcarryx_u32(&x561, &x562, x560, x553, x529); + uint32_t x563; + fiat_p256_uint1 x564; + fiat_p256_addcarryx_u32(&x563, &x564, x562, x555, x531); + uint32_t x565; + fiat_p256_uint1 x566; + fiat_p256_addcarryx_u32(&x565, &x566, x564, x557, x533); + uint32_t x567; + fiat_p256_uint1 x568; + fiat_p256_addcarryx_u32(&x567, &x568, x566, 0x0, x535); + uint32_t x569; + fiat_p256_uint1 x570; + fiat_p256_addcarryx_u32(&x569, &x570, x568, 0x0, x537); + uint32_t x571; + fiat_p256_uint1 x572; + fiat_p256_addcarryx_u32(&x571, &x572, x570, x527, x539); + uint32_t x573; + fiat_p256_uint1 x574; + fiat_p256_addcarryx_u32(&x573, &x574, x572, x545, x541); + uint32_t x575; + fiat_p256_uint1 x576; + fiat_p256_addcarryx_u32(&x575, &x576, x574, x546, x543); + uint32_t x577; + fiat_p256_uint1 x578; + fiat_p256_addcarryx_u32(&x577, &x578, x576, 0x0, x544); + uint32_t x579; + uint32_t x580; + fiat_p256_mulx_u32(&x579, &x580, x7, (arg2[7])); + uint32_t x581; + uint32_t x582; + fiat_p256_mulx_u32(&x581, &x582, x7, (arg2[6])); + uint32_t x583; + uint32_t x584; + fiat_p256_mulx_u32(&x583, &x584, x7, (arg2[5])); + uint32_t x585; + uint32_t x586; + fiat_p256_mulx_u32(&x585, &x586, x7, (arg2[4])); + uint32_t x587; + uint32_t x588; + fiat_p256_mulx_u32(&x587, &x588, x7, (arg2[3])); + uint32_t x589; + uint32_t x590; + fiat_p256_mulx_u32(&x589, &x590, x7, (arg2[2])); + uint32_t x591; + uint32_t x592; + fiat_p256_mulx_u32(&x591, &x592, x7, (arg2[1])); + uint32_t x593; + uint32_t x594; + fiat_p256_mulx_u32(&x593, &x594, x7, (arg2[0])); + uint32_t x595; + fiat_p256_uint1 x596; + fiat_p256_addcarryx_u32(&x595, &x596, 0x0, x591, x594); + uint32_t x597; + fiat_p256_uint1 x598; + fiat_p256_addcarryx_u32(&x597, &x598, x596, x589, x592); + uint32_t x599; + fiat_p256_uint1 x600; + fiat_p256_addcarryx_u32(&x599, &x600, x598, x587, x590); + uint32_t x601; + fiat_p256_uint1 x602; + fiat_p256_addcarryx_u32(&x601, &x602, x600, x585, x588); + uint32_t x603; + fiat_p256_uint1 x604; + fiat_p256_addcarryx_u32(&x603, &x604, x602, x583, x586); + uint32_t x605; + fiat_p256_uint1 x606; + fiat_p256_addcarryx_u32(&x605, &x606, x604, x581, x584); + uint32_t x607; + fiat_p256_uint1 x608; + fiat_p256_addcarryx_u32(&x607, &x608, x606, x579, x582); + uint32_t x609; + fiat_p256_uint1 x610; + fiat_p256_addcarryx_u32(&x609, &x610, x608, 0x0, x580); + uint32_t x611; + fiat_p256_uint1 x612; + fiat_p256_addcarryx_u32(&x611, &x612, 0x0, x593, x561); + uint32_t x613; + fiat_p256_uint1 x614; + fiat_p256_addcarryx_u32(&x613, &x614, x612, x595, x563); + uint32_t x615; + fiat_p256_uint1 x616; + fiat_p256_addcarryx_u32(&x615, &x616, x614, x597, x565); + uint32_t x617; + fiat_p256_uint1 x618; + fiat_p256_addcarryx_u32(&x617, &x618, x616, x599, x567); + uint32_t x619; + fiat_p256_uint1 x620; + fiat_p256_addcarryx_u32(&x619, &x620, x618, x601, x569); + uint32_t x621; + fiat_p256_uint1 x622; + fiat_p256_addcarryx_u32(&x621, &x622, x620, x603, x571); + uint32_t x623; + fiat_p256_uint1 x624; + fiat_p256_addcarryx_u32(&x623, &x624, x622, x605, x573); + uint32_t x625; + fiat_p256_uint1 x626; + fiat_p256_addcarryx_u32(&x625, &x626, x624, x607, x575); + uint32_t x627; + fiat_p256_uint1 x628; + fiat_p256_addcarryx_u32(&x627, &x628, x626, x609, x577); + uint32_t x629; + uint32_t x630; + fiat_p256_mulx_u32(&x629, &x630, x611, UINT32_C(0xffffffff)); + uint32_t x631; + uint32_t x632; + fiat_p256_mulx_u32(&x631, &x632, x611, UINT32_C(0xffffffff)); + uint32_t x633; + uint32_t x634; + fiat_p256_mulx_u32(&x633, &x634, x611, UINT32_C(0xffffffff)); + uint32_t x635; + uint32_t x636; + fiat_p256_mulx_u32(&x635, &x636, x611, UINT32_C(0xffffffff)); + uint32_t x637; + fiat_p256_uint1 x638; + fiat_p256_addcarryx_u32(&x637, &x638, 0x0, x633, x636); + uint32_t x639; + fiat_p256_uint1 x640; + fiat_p256_addcarryx_u32(&x639, &x640, x638, x631, x634); + uint32_t x641; + fiat_p256_uint1 x642; + fiat_p256_addcarryx_u32(&x641, &x642, x640, 0x0, x632); + uint32_t x643; + fiat_p256_uint1 x644; + fiat_p256_addcarryx_u32(&x643, &x644, 0x0, x635, x611); + uint32_t x645; + fiat_p256_uint1 x646; + fiat_p256_addcarryx_u32(&x645, &x646, x644, x637, x613); + uint32_t x647; + fiat_p256_uint1 x648; + fiat_p256_addcarryx_u32(&x647, &x648, x646, x639, x615); + uint32_t x649; + fiat_p256_uint1 x650; + fiat_p256_addcarryx_u32(&x649, &x650, x648, x641, x617); + uint32_t x651; + fiat_p256_uint1 x652; + fiat_p256_addcarryx_u32(&x651, &x652, x650, 0x0, x619); + uint32_t x653; + fiat_p256_uint1 x654; + fiat_p256_addcarryx_u32(&x653, &x654, x652, 0x0, x621); + uint32_t x655; + fiat_p256_uint1 x656; + fiat_p256_addcarryx_u32(&x655, &x656, x654, x611, x623); + uint32_t x657; + fiat_p256_uint1 x658; + fiat_p256_addcarryx_u32(&x657, &x658, x656, x629, x625); + uint32_t x659; + fiat_p256_uint1 x660; + fiat_p256_addcarryx_u32(&x659, &x660, x658, x630, x627); + uint32_t x661; + fiat_p256_uint1 x662; + fiat_p256_addcarryx_u32(&x661, &x662, x660, 0x0, x628); + uint32_t x663; + fiat_p256_uint1 x664; + fiat_p256_subborrowx_u32(&x663, &x664, 0x0, x645, UINT32_C(0xffffffff)); + uint32_t x665; + fiat_p256_uint1 x666; + fiat_p256_subborrowx_u32(&x665, &x666, x664, x647, UINT32_C(0xffffffff)); + uint32_t x667; + fiat_p256_uint1 x668; + fiat_p256_subborrowx_u32(&x667, &x668, x666, x649, UINT32_C(0xffffffff)); + uint32_t x669; + fiat_p256_uint1 x670; + fiat_p256_subborrowx_u32(&x669, &x670, x668, x651, 0x0); + uint32_t x671; + fiat_p256_uint1 x672; + fiat_p256_subborrowx_u32(&x671, &x672, x670, x653, 0x0); + uint32_t x673; + fiat_p256_uint1 x674; + fiat_p256_subborrowx_u32(&x673, &x674, x672, x655, 0x0); + uint32_t x675; + fiat_p256_uint1 x676; + fiat_p256_subborrowx_u32(&x675, &x676, x674, x657, 0x1); + uint32_t x677; + fiat_p256_uint1 x678; + fiat_p256_subborrowx_u32(&x677, &x678, x676, x659, UINT32_C(0xffffffff)); + uint32_t x679; + fiat_p256_uint1 x680; + fiat_p256_subborrowx_u32(&x679, &x680, x678, x661, 0x0); + uint32_t x681; + fiat_p256_cmovznz_u32(&x681, x680, x663, x645); + uint32_t x682; + fiat_p256_cmovznz_u32(&x682, x680, x665, x647); + uint32_t x683; + fiat_p256_cmovznz_u32(&x683, x680, x667, x649); + uint32_t x684; + fiat_p256_cmovznz_u32(&x684, x680, x669, x651); + uint32_t x685; + fiat_p256_cmovznz_u32(&x685, x680, x671, x653); + uint32_t x686; + fiat_p256_cmovznz_u32(&x686, x680, x673, x655); + uint32_t x687; + fiat_p256_cmovznz_u32(&x687, x680, x675, x657); + uint32_t x688; + fiat_p256_cmovznz_u32(&x688, x680, x677, x659); + out1[0] = x681; + out1[1] = x682; + out1[2] = x683; + out1[3] = x684; + out1[4] = x685; + out1[5] = x686; + out1[6] = x687; + out1[7] = x688; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_square(uint32_t out1[8], const uint32_t arg1[8]) { + uint32_t x1 = (arg1[1]); + uint32_t x2 = (arg1[2]); + uint32_t x3 = (arg1[3]); + uint32_t x4 = (arg1[4]); + uint32_t x5 = (arg1[5]); + uint32_t x6 = (arg1[6]); + uint32_t x7 = (arg1[7]); + uint32_t x8 = (arg1[0]); + uint32_t x9; + uint32_t x10; + fiat_p256_mulx_u32(&x9, &x10, x8, (arg1[7])); + uint32_t x11; + uint32_t x12; + fiat_p256_mulx_u32(&x11, &x12, x8, (arg1[6])); + uint32_t x13; + uint32_t x14; + fiat_p256_mulx_u32(&x13, &x14, x8, (arg1[5])); + uint32_t x15; + uint32_t x16; + fiat_p256_mulx_u32(&x15, &x16, x8, (arg1[4])); + uint32_t x17; + uint32_t x18; + fiat_p256_mulx_u32(&x17, &x18, x8, (arg1[3])); + uint32_t x19; + uint32_t x20; + fiat_p256_mulx_u32(&x19, &x20, x8, (arg1[2])); + uint32_t x21; + uint32_t x22; + fiat_p256_mulx_u32(&x21, &x22, x8, (arg1[1])); + uint32_t x23; + uint32_t x24; + fiat_p256_mulx_u32(&x23, &x24, x8, (arg1[0])); + uint32_t x25; + fiat_p256_uint1 x26; + fiat_p256_addcarryx_u32(&x25, &x26, 0x0, x21, x24); + uint32_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u32(&x27, &x28, x26, x19, x22); + uint32_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u32(&x29, &x30, x28, x17, x20); + uint32_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u32(&x31, &x32, x30, x15, x18); + uint32_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u32(&x33, &x34, x32, x13, x16); + uint32_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u32(&x35, &x36, x34, x11, x14); + uint32_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u32(&x37, &x38, x36, x9, x12); + uint32_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u32(&x39, &x40, x38, 0x0, x10); + uint32_t x41; + uint32_t x42; + fiat_p256_mulx_u32(&x41, &x42, x23, UINT32_C(0xffffffff)); + uint32_t x43; + uint32_t x44; + fiat_p256_mulx_u32(&x43, &x44, x23, UINT32_C(0xffffffff)); + uint32_t x45; + uint32_t x46; + fiat_p256_mulx_u32(&x45, &x46, x23, UINT32_C(0xffffffff)); + uint32_t x47; + uint32_t x48; + fiat_p256_mulx_u32(&x47, &x48, x23, UINT32_C(0xffffffff)); + uint32_t x49; + fiat_p256_uint1 x50; + fiat_p256_addcarryx_u32(&x49, &x50, 0x0, x45, x48); + uint32_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u32(&x51, &x52, x50, x43, x46); + uint32_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u32(&x53, &x54, x52, 0x0, x44); + uint32_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u32(&x55, &x56, 0x0, x47, x23); + uint32_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u32(&x57, &x58, x56, x49, x25); + uint32_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u32(&x59, &x60, x58, x51, x27); + uint32_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u32(&x61, &x62, x60, x53, x29); + uint32_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u32(&x63, &x64, x62, 0x0, x31); + uint32_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u32(&x65, &x66, x64, 0x0, x33); + uint32_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u32(&x67, &x68, x66, x23, x35); + uint32_t x69; + fiat_p256_uint1 x70; + fiat_p256_addcarryx_u32(&x69, &x70, x68, x41, x37); + uint32_t x71; + fiat_p256_uint1 x72; + fiat_p256_addcarryx_u32(&x71, &x72, x70, x42, x39); + uint32_t x73; + fiat_p256_uint1 x74; + fiat_p256_addcarryx_u32(&x73, &x74, x72, 0x0, 0x0); + uint32_t x75; + uint32_t x76; + fiat_p256_mulx_u32(&x75, &x76, x1, (arg1[7])); + uint32_t x77; + uint32_t x78; + fiat_p256_mulx_u32(&x77, &x78, x1, (arg1[6])); + uint32_t x79; + uint32_t x80; + fiat_p256_mulx_u32(&x79, &x80, x1, (arg1[5])); + uint32_t x81; + uint32_t x82; + fiat_p256_mulx_u32(&x81, &x82, x1, (arg1[4])); + uint32_t x83; + uint32_t x84; + fiat_p256_mulx_u32(&x83, &x84, x1, (arg1[3])); + uint32_t x85; + uint32_t x86; + fiat_p256_mulx_u32(&x85, &x86, x1, (arg1[2])); + uint32_t x87; + uint32_t x88; + fiat_p256_mulx_u32(&x87, &x88, x1, (arg1[1])); + uint32_t x89; + uint32_t x90; + fiat_p256_mulx_u32(&x89, &x90, x1, (arg1[0])); + uint32_t x91; + fiat_p256_uint1 x92; + fiat_p256_addcarryx_u32(&x91, &x92, 0x0, x87, x90); + uint32_t x93; + fiat_p256_uint1 x94; + fiat_p256_addcarryx_u32(&x93, &x94, x92, x85, x88); + uint32_t x95; + fiat_p256_uint1 x96; + fiat_p256_addcarryx_u32(&x95, &x96, x94, x83, x86); + uint32_t x97; + fiat_p256_uint1 x98; + fiat_p256_addcarryx_u32(&x97, &x98, x96, x81, x84); + uint32_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u32(&x99, &x100, x98, x79, x82); + uint32_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u32(&x101, &x102, x100, x77, x80); + uint32_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u32(&x103, &x104, x102, x75, x78); + uint32_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u32(&x105, &x106, x104, 0x0, x76); + uint32_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u32(&x107, &x108, 0x0, x89, x57); + uint32_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u32(&x109, &x110, x108, x91, x59); + uint32_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u32(&x111, &x112, x110, x93, x61); + uint32_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u32(&x113, &x114, x112, x95, x63); + uint32_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u32(&x115, &x116, x114, x97, x65); + uint32_t x117; + fiat_p256_uint1 x118; + fiat_p256_addcarryx_u32(&x117, &x118, x116, x99, x67); + uint32_t x119; + fiat_p256_uint1 x120; + fiat_p256_addcarryx_u32(&x119, &x120, x118, x101, x69); + uint32_t x121; + fiat_p256_uint1 x122; + fiat_p256_addcarryx_u32(&x121, &x122, x120, x103, x71); + uint32_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u32(&x123, &x124, x122, x105, (fiat_p256_uint1)x73); + uint32_t x125; + uint32_t x126; + fiat_p256_mulx_u32(&x125, &x126, x107, UINT32_C(0xffffffff)); + uint32_t x127; + uint32_t x128; + fiat_p256_mulx_u32(&x127, &x128, x107, UINT32_C(0xffffffff)); + uint32_t x129; + uint32_t x130; + fiat_p256_mulx_u32(&x129, &x130, x107, UINT32_C(0xffffffff)); + uint32_t x131; + uint32_t x132; + fiat_p256_mulx_u32(&x131, &x132, x107, UINT32_C(0xffffffff)); + uint32_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u32(&x133, &x134, 0x0, x129, x132); + uint32_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u32(&x135, &x136, x134, x127, x130); + uint32_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u32(&x137, &x138, x136, 0x0, x128); + uint32_t x139; + fiat_p256_uint1 x140; + fiat_p256_addcarryx_u32(&x139, &x140, 0x0, x131, x107); + uint32_t x141; + fiat_p256_uint1 x142; + fiat_p256_addcarryx_u32(&x141, &x142, x140, x133, x109); + uint32_t x143; + fiat_p256_uint1 x144; + fiat_p256_addcarryx_u32(&x143, &x144, x142, x135, x111); + uint32_t x145; + fiat_p256_uint1 x146; + fiat_p256_addcarryx_u32(&x145, &x146, x144, x137, x113); + uint32_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u32(&x147, &x148, x146, 0x0, x115); + uint32_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u32(&x149, &x150, x148, 0x0, x117); + uint32_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u32(&x151, &x152, x150, x107, x119); + uint32_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u32(&x153, &x154, x152, x125, x121); + uint32_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u32(&x155, &x156, x154, x126, x123); + uint32_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u32(&x157, &x158, x156, 0x0, x124); + uint32_t x159; + uint32_t x160; + fiat_p256_mulx_u32(&x159, &x160, x2, (arg1[7])); + uint32_t x161; + uint32_t x162; + fiat_p256_mulx_u32(&x161, &x162, x2, (arg1[6])); + uint32_t x163; + uint32_t x164; + fiat_p256_mulx_u32(&x163, &x164, x2, (arg1[5])); + uint32_t x165; + uint32_t x166; + fiat_p256_mulx_u32(&x165, &x166, x2, (arg1[4])); + uint32_t x167; + uint32_t x168; + fiat_p256_mulx_u32(&x167, &x168, x2, (arg1[3])); + uint32_t x169; + uint32_t x170; + fiat_p256_mulx_u32(&x169, &x170, x2, (arg1[2])); + uint32_t x171; + uint32_t x172; + fiat_p256_mulx_u32(&x171, &x172, x2, (arg1[1])); + uint32_t x173; + uint32_t x174; + fiat_p256_mulx_u32(&x173, &x174, x2, (arg1[0])); + uint32_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u32(&x175, &x176, 0x0, x171, x174); + uint32_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u32(&x177, &x178, x176, x169, x172); + uint32_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u32(&x179, &x180, x178, x167, x170); + uint32_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u32(&x181, &x182, x180, x165, x168); + uint32_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u32(&x183, &x184, x182, x163, x166); + uint32_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u32(&x185, &x186, x184, x161, x164); + uint32_t x187; + fiat_p256_uint1 x188; + fiat_p256_addcarryx_u32(&x187, &x188, x186, x159, x162); + uint32_t x189; + fiat_p256_uint1 x190; + fiat_p256_addcarryx_u32(&x189, &x190, x188, 0x0, x160); + uint32_t x191; + fiat_p256_uint1 x192; + fiat_p256_addcarryx_u32(&x191, &x192, 0x0, x173, x141); + uint32_t x193; + fiat_p256_uint1 x194; + fiat_p256_addcarryx_u32(&x193, &x194, x192, x175, x143); + uint32_t x195; + fiat_p256_uint1 x196; + fiat_p256_addcarryx_u32(&x195, &x196, x194, x177, x145); + uint32_t x197; + fiat_p256_uint1 x198; + fiat_p256_addcarryx_u32(&x197, &x198, x196, x179, x147); + uint32_t x199; + fiat_p256_uint1 x200; + fiat_p256_addcarryx_u32(&x199, &x200, x198, x181, x149); + uint32_t x201; + fiat_p256_uint1 x202; + fiat_p256_addcarryx_u32(&x201, &x202, x200, x183, x151); + uint32_t x203; + fiat_p256_uint1 x204; + fiat_p256_addcarryx_u32(&x203, &x204, x202, x185, x153); + uint32_t x205; + fiat_p256_uint1 x206; + fiat_p256_addcarryx_u32(&x205, &x206, x204, x187, x155); + uint32_t x207; + fiat_p256_uint1 x208; + fiat_p256_addcarryx_u32(&x207, &x208, x206, x189, x157); + uint32_t x209; + uint32_t x210; + fiat_p256_mulx_u32(&x209, &x210, x191, UINT32_C(0xffffffff)); + uint32_t x211; + uint32_t x212; + fiat_p256_mulx_u32(&x211, &x212, x191, UINT32_C(0xffffffff)); + uint32_t x213; + uint32_t x214; + fiat_p256_mulx_u32(&x213, &x214, x191, UINT32_C(0xffffffff)); + uint32_t x215; + uint32_t x216; + fiat_p256_mulx_u32(&x215, &x216, x191, UINT32_C(0xffffffff)); + uint32_t x217; + fiat_p256_uint1 x218; + fiat_p256_addcarryx_u32(&x217, &x218, 0x0, x213, x216); + uint32_t x219; + fiat_p256_uint1 x220; + fiat_p256_addcarryx_u32(&x219, &x220, x218, x211, x214); + uint32_t x221; + fiat_p256_uint1 x222; + fiat_p256_addcarryx_u32(&x221, &x222, x220, 0x0, x212); + uint32_t x223; + fiat_p256_uint1 x224; + fiat_p256_addcarryx_u32(&x223, &x224, 0x0, x215, x191); + uint32_t x225; + fiat_p256_uint1 x226; + fiat_p256_addcarryx_u32(&x225, &x226, x224, x217, x193); + uint32_t x227; + fiat_p256_uint1 x228; + fiat_p256_addcarryx_u32(&x227, &x228, x226, x219, x195); + uint32_t x229; + fiat_p256_uint1 x230; + fiat_p256_addcarryx_u32(&x229, &x230, x228, x221, x197); + uint32_t x231; + fiat_p256_uint1 x232; + fiat_p256_addcarryx_u32(&x231, &x232, x230, 0x0, x199); + uint32_t x233; + fiat_p256_uint1 x234; + fiat_p256_addcarryx_u32(&x233, &x234, x232, 0x0, x201); + uint32_t x235; + fiat_p256_uint1 x236; + fiat_p256_addcarryx_u32(&x235, &x236, x234, x191, x203); + uint32_t x237; + fiat_p256_uint1 x238; + fiat_p256_addcarryx_u32(&x237, &x238, x236, x209, x205); + uint32_t x239; + fiat_p256_uint1 x240; + fiat_p256_addcarryx_u32(&x239, &x240, x238, x210, x207); + uint32_t x241; + fiat_p256_uint1 x242; + fiat_p256_addcarryx_u32(&x241, &x242, x240, 0x0, x208); + uint32_t x243; + uint32_t x244; + fiat_p256_mulx_u32(&x243, &x244, x3, (arg1[7])); + uint32_t x245; + uint32_t x246; + fiat_p256_mulx_u32(&x245, &x246, x3, (arg1[6])); + uint32_t x247; + uint32_t x248; + fiat_p256_mulx_u32(&x247, &x248, x3, (arg1[5])); + uint32_t x249; + uint32_t x250; + fiat_p256_mulx_u32(&x249, &x250, x3, (arg1[4])); + uint32_t x251; + uint32_t x252; + fiat_p256_mulx_u32(&x251, &x252, x3, (arg1[3])); + uint32_t x253; + uint32_t x254; + fiat_p256_mulx_u32(&x253, &x254, x3, (arg1[2])); + uint32_t x255; + uint32_t x256; + fiat_p256_mulx_u32(&x255, &x256, x3, (arg1[1])); + uint32_t x257; + uint32_t x258; + fiat_p256_mulx_u32(&x257, &x258, x3, (arg1[0])); + uint32_t x259; + fiat_p256_uint1 x260; + fiat_p256_addcarryx_u32(&x259, &x260, 0x0, x255, x258); + uint32_t x261; + fiat_p256_uint1 x262; + fiat_p256_addcarryx_u32(&x261, &x262, x260, x253, x256); + uint32_t x263; + fiat_p256_uint1 x264; + fiat_p256_addcarryx_u32(&x263, &x264, x262, x251, x254); + uint32_t x265; + fiat_p256_uint1 x266; + fiat_p256_addcarryx_u32(&x265, &x266, x264, x249, x252); + uint32_t x267; + fiat_p256_uint1 x268; + fiat_p256_addcarryx_u32(&x267, &x268, x266, x247, x250); + uint32_t x269; + fiat_p256_uint1 x270; + fiat_p256_addcarryx_u32(&x269, &x270, x268, x245, x248); + uint32_t x271; + fiat_p256_uint1 x272; + fiat_p256_addcarryx_u32(&x271, &x272, x270, x243, x246); + uint32_t x273; + fiat_p256_uint1 x274; + fiat_p256_addcarryx_u32(&x273, &x274, x272, 0x0, x244); + uint32_t x275; + fiat_p256_uint1 x276; + fiat_p256_addcarryx_u32(&x275, &x276, 0x0, x257, x225); + uint32_t x277; + fiat_p256_uint1 x278; + fiat_p256_addcarryx_u32(&x277, &x278, x276, x259, x227); + uint32_t x279; + fiat_p256_uint1 x280; + fiat_p256_addcarryx_u32(&x279, &x280, x278, x261, x229); + uint32_t x281; + fiat_p256_uint1 x282; + fiat_p256_addcarryx_u32(&x281, &x282, x280, x263, x231); + uint32_t x283; + fiat_p256_uint1 x284; + fiat_p256_addcarryx_u32(&x283, &x284, x282, x265, x233); + uint32_t x285; + fiat_p256_uint1 x286; + fiat_p256_addcarryx_u32(&x285, &x286, x284, x267, x235); + uint32_t x287; + fiat_p256_uint1 x288; + fiat_p256_addcarryx_u32(&x287, &x288, x286, x269, x237); + uint32_t x289; + fiat_p256_uint1 x290; + fiat_p256_addcarryx_u32(&x289, &x290, x288, x271, x239); + uint32_t x291; + fiat_p256_uint1 x292; + fiat_p256_addcarryx_u32(&x291, &x292, x290, x273, x241); + uint32_t x293; + uint32_t x294; + fiat_p256_mulx_u32(&x293, &x294, x275, UINT32_C(0xffffffff)); + uint32_t x295; + uint32_t x296; + fiat_p256_mulx_u32(&x295, &x296, x275, UINT32_C(0xffffffff)); + uint32_t x297; + uint32_t x298; + fiat_p256_mulx_u32(&x297, &x298, x275, UINT32_C(0xffffffff)); + uint32_t x299; + uint32_t x300; + fiat_p256_mulx_u32(&x299, &x300, x275, UINT32_C(0xffffffff)); + uint32_t x301; + fiat_p256_uint1 x302; + fiat_p256_addcarryx_u32(&x301, &x302, 0x0, x297, x300); + uint32_t x303; + fiat_p256_uint1 x304; + fiat_p256_addcarryx_u32(&x303, &x304, x302, x295, x298); + uint32_t x305; + fiat_p256_uint1 x306; + fiat_p256_addcarryx_u32(&x305, &x306, x304, 0x0, x296); + uint32_t x307; + fiat_p256_uint1 x308; + fiat_p256_addcarryx_u32(&x307, &x308, 0x0, x299, x275); + uint32_t x309; + fiat_p256_uint1 x310; + fiat_p256_addcarryx_u32(&x309, &x310, x308, x301, x277); + uint32_t x311; + fiat_p256_uint1 x312; + fiat_p256_addcarryx_u32(&x311, &x312, x310, x303, x279); + uint32_t x313; + fiat_p256_uint1 x314; + fiat_p256_addcarryx_u32(&x313, &x314, x312, x305, x281); + uint32_t x315; + fiat_p256_uint1 x316; + fiat_p256_addcarryx_u32(&x315, &x316, x314, 0x0, x283); + uint32_t x317; + fiat_p256_uint1 x318; + fiat_p256_addcarryx_u32(&x317, &x318, x316, 0x0, x285); + uint32_t x319; + fiat_p256_uint1 x320; + fiat_p256_addcarryx_u32(&x319, &x320, x318, x275, x287); + uint32_t x321; + fiat_p256_uint1 x322; + fiat_p256_addcarryx_u32(&x321, &x322, x320, x293, x289); + uint32_t x323; + fiat_p256_uint1 x324; + fiat_p256_addcarryx_u32(&x323, &x324, x322, x294, x291); + uint32_t x325; + fiat_p256_uint1 x326; + fiat_p256_addcarryx_u32(&x325, &x326, x324, 0x0, x292); + uint32_t x327; + uint32_t x328; + fiat_p256_mulx_u32(&x327, &x328, x4, (arg1[7])); + uint32_t x329; + uint32_t x330; + fiat_p256_mulx_u32(&x329, &x330, x4, (arg1[6])); + uint32_t x331; + uint32_t x332; + fiat_p256_mulx_u32(&x331, &x332, x4, (arg1[5])); + uint32_t x333; + uint32_t x334; + fiat_p256_mulx_u32(&x333, &x334, x4, (arg1[4])); + uint32_t x335; + uint32_t x336; + fiat_p256_mulx_u32(&x335, &x336, x4, (arg1[3])); + uint32_t x337; + uint32_t x338; + fiat_p256_mulx_u32(&x337, &x338, x4, (arg1[2])); + uint32_t x339; + uint32_t x340; + fiat_p256_mulx_u32(&x339, &x340, x4, (arg1[1])); + uint32_t x341; + uint32_t x342; + fiat_p256_mulx_u32(&x341, &x342, x4, (arg1[0])); + uint32_t x343; + fiat_p256_uint1 x344; + fiat_p256_addcarryx_u32(&x343, &x344, 0x0, x339, x342); + uint32_t x345; + fiat_p256_uint1 x346; + fiat_p256_addcarryx_u32(&x345, &x346, x344, x337, x340); + uint32_t x347; + fiat_p256_uint1 x348; + fiat_p256_addcarryx_u32(&x347, &x348, x346, x335, x338); + uint32_t x349; + fiat_p256_uint1 x350; + fiat_p256_addcarryx_u32(&x349, &x350, x348, x333, x336); + uint32_t x351; + fiat_p256_uint1 x352; + fiat_p256_addcarryx_u32(&x351, &x352, x350, x331, x334); + uint32_t x353; + fiat_p256_uint1 x354; + fiat_p256_addcarryx_u32(&x353, &x354, x352, x329, x332); + uint32_t x355; + fiat_p256_uint1 x356; + fiat_p256_addcarryx_u32(&x355, &x356, x354, x327, x330); + uint32_t x357; + fiat_p256_uint1 x358; + fiat_p256_addcarryx_u32(&x357, &x358, x356, 0x0, x328); + uint32_t x359; + fiat_p256_uint1 x360; + fiat_p256_addcarryx_u32(&x359, &x360, 0x0, x341, x309); + uint32_t x361; + fiat_p256_uint1 x362; + fiat_p256_addcarryx_u32(&x361, &x362, x360, x343, x311); + uint32_t x363; + fiat_p256_uint1 x364; + fiat_p256_addcarryx_u32(&x363, &x364, x362, x345, x313); + uint32_t x365; + fiat_p256_uint1 x366; + fiat_p256_addcarryx_u32(&x365, &x366, x364, x347, x315); + uint32_t x367; + fiat_p256_uint1 x368; + fiat_p256_addcarryx_u32(&x367, &x368, x366, x349, x317); + uint32_t x369; + fiat_p256_uint1 x370; + fiat_p256_addcarryx_u32(&x369, &x370, x368, x351, x319); + uint32_t x371; + fiat_p256_uint1 x372; + fiat_p256_addcarryx_u32(&x371, &x372, x370, x353, x321); + uint32_t x373; + fiat_p256_uint1 x374; + fiat_p256_addcarryx_u32(&x373, &x374, x372, x355, x323); + uint32_t x375; + fiat_p256_uint1 x376; + fiat_p256_addcarryx_u32(&x375, &x376, x374, x357, x325); + uint32_t x377; + uint32_t x378; + fiat_p256_mulx_u32(&x377, &x378, x359, UINT32_C(0xffffffff)); + uint32_t x379; + uint32_t x380; + fiat_p256_mulx_u32(&x379, &x380, x359, UINT32_C(0xffffffff)); + uint32_t x381; + uint32_t x382; + fiat_p256_mulx_u32(&x381, &x382, x359, UINT32_C(0xffffffff)); + uint32_t x383; + uint32_t x384; + fiat_p256_mulx_u32(&x383, &x384, x359, UINT32_C(0xffffffff)); + uint32_t x385; + fiat_p256_uint1 x386; + fiat_p256_addcarryx_u32(&x385, &x386, 0x0, x381, x384); + uint32_t x387; + fiat_p256_uint1 x388; + fiat_p256_addcarryx_u32(&x387, &x388, x386, x379, x382); + uint32_t x389; + fiat_p256_uint1 x390; + fiat_p256_addcarryx_u32(&x389, &x390, x388, 0x0, x380); + uint32_t x391; + fiat_p256_uint1 x392; + fiat_p256_addcarryx_u32(&x391, &x392, 0x0, x383, x359); + uint32_t x393; + fiat_p256_uint1 x394; + fiat_p256_addcarryx_u32(&x393, &x394, x392, x385, x361); + uint32_t x395; + fiat_p256_uint1 x396; + fiat_p256_addcarryx_u32(&x395, &x396, x394, x387, x363); + uint32_t x397; + fiat_p256_uint1 x398; + fiat_p256_addcarryx_u32(&x397, &x398, x396, x389, x365); + uint32_t x399; + fiat_p256_uint1 x400; + fiat_p256_addcarryx_u32(&x399, &x400, x398, 0x0, x367); + uint32_t x401; + fiat_p256_uint1 x402; + fiat_p256_addcarryx_u32(&x401, &x402, x400, 0x0, x369); + uint32_t x403; + fiat_p256_uint1 x404; + fiat_p256_addcarryx_u32(&x403, &x404, x402, x359, x371); + uint32_t x405; + fiat_p256_uint1 x406; + fiat_p256_addcarryx_u32(&x405, &x406, x404, x377, x373); + uint32_t x407; + fiat_p256_uint1 x408; + fiat_p256_addcarryx_u32(&x407, &x408, x406, x378, x375); + uint32_t x409; + fiat_p256_uint1 x410; + fiat_p256_addcarryx_u32(&x409, &x410, x408, 0x0, x376); + uint32_t x411; + uint32_t x412; + fiat_p256_mulx_u32(&x411, &x412, x5, (arg1[7])); + uint32_t x413; + uint32_t x414; + fiat_p256_mulx_u32(&x413, &x414, x5, (arg1[6])); + uint32_t x415; + uint32_t x416; + fiat_p256_mulx_u32(&x415, &x416, x5, (arg1[5])); + uint32_t x417; + uint32_t x418; + fiat_p256_mulx_u32(&x417, &x418, x5, (arg1[4])); + uint32_t x419; + uint32_t x420; + fiat_p256_mulx_u32(&x419, &x420, x5, (arg1[3])); + uint32_t x421; + uint32_t x422; + fiat_p256_mulx_u32(&x421, &x422, x5, (arg1[2])); + uint32_t x423; + uint32_t x424; + fiat_p256_mulx_u32(&x423, &x424, x5, (arg1[1])); + uint32_t x425; + uint32_t x426; + fiat_p256_mulx_u32(&x425, &x426, x5, (arg1[0])); + uint32_t x427; + fiat_p256_uint1 x428; + fiat_p256_addcarryx_u32(&x427, &x428, 0x0, x423, x426); + uint32_t x429; + fiat_p256_uint1 x430; + fiat_p256_addcarryx_u32(&x429, &x430, x428, x421, x424); + uint32_t x431; + fiat_p256_uint1 x432; + fiat_p256_addcarryx_u32(&x431, &x432, x430, x419, x422); + uint32_t x433; + fiat_p256_uint1 x434; + fiat_p256_addcarryx_u32(&x433, &x434, x432, x417, x420); + uint32_t x435; + fiat_p256_uint1 x436; + fiat_p256_addcarryx_u32(&x435, &x436, x434, x415, x418); + uint32_t x437; + fiat_p256_uint1 x438; + fiat_p256_addcarryx_u32(&x437, &x438, x436, x413, x416); + uint32_t x439; + fiat_p256_uint1 x440; + fiat_p256_addcarryx_u32(&x439, &x440, x438, x411, x414); + uint32_t x441; + fiat_p256_uint1 x442; + fiat_p256_addcarryx_u32(&x441, &x442, x440, 0x0, x412); + uint32_t x443; + fiat_p256_uint1 x444; + fiat_p256_addcarryx_u32(&x443, &x444, 0x0, x425, x393); + uint32_t x445; + fiat_p256_uint1 x446; + fiat_p256_addcarryx_u32(&x445, &x446, x444, x427, x395); + uint32_t x447; + fiat_p256_uint1 x448; + fiat_p256_addcarryx_u32(&x447, &x448, x446, x429, x397); + uint32_t x449; + fiat_p256_uint1 x450; + fiat_p256_addcarryx_u32(&x449, &x450, x448, x431, x399); + uint32_t x451; + fiat_p256_uint1 x452; + fiat_p256_addcarryx_u32(&x451, &x452, x450, x433, x401); + uint32_t x453; + fiat_p256_uint1 x454; + fiat_p256_addcarryx_u32(&x453, &x454, x452, x435, x403); + uint32_t x455; + fiat_p256_uint1 x456; + fiat_p256_addcarryx_u32(&x455, &x456, x454, x437, x405); + uint32_t x457; + fiat_p256_uint1 x458; + fiat_p256_addcarryx_u32(&x457, &x458, x456, x439, x407); + uint32_t x459; + fiat_p256_uint1 x460; + fiat_p256_addcarryx_u32(&x459, &x460, x458, x441, x409); + uint32_t x461; + uint32_t x462; + fiat_p256_mulx_u32(&x461, &x462, x443, UINT32_C(0xffffffff)); + uint32_t x463; + uint32_t x464; + fiat_p256_mulx_u32(&x463, &x464, x443, UINT32_C(0xffffffff)); + uint32_t x465; + uint32_t x466; + fiat_p256_mulx_u32(&x465, &x466, x443, UINT32_C(0xffffffff)); + uint32_t x467; + uint32_t x468; + fiat_p256_mulx_u32(&x467, &x468, x443, UINT32_C(0xffffffff)); + uint32_t x469; + fiat_p256_uint1 x470; + fiat_p256_addcarryx_u32(&x469, &x470, 0x0, x465, x468); + uint32_t x471; + fiat_p256_uint1 x472; + fiat_p256_addcarryx_u32(&x471, &x472, x470, x463, x466); + uint32_t x473; + fiat_p256_uint1 x474; + fiat_p256_addcarryx_u32(&x473, &x474, x472, 0x0, x464); + uint32_t x475; + fiat_p256_uint1 x476; + fiat_p256_addcarryx_u32(&x475, &x476, 0x0, x467, x443); + uint32_t x477; + fiat_p256_uint1 x478; + fiat_p256_addcarryx_u32(&x477, &x478, x476, x469, x445); + uint32_t x479; + fiat_p256_uint1 x480; + fiat_p256_addcarryx_u32(&x479, &x480, x478, x471, x447); + uint32_t x481; + fiat_p256_uint1 x482; + fiat_p256_addcarryx_u32(&x481, &x482, x480, x473, x449); + uint32_t x483; + fiat_p256_uint1 x484; + fiat_p256_addcarryx_u32(&x483, &x484, x482, 0x0, x451); + uint32_t x485; + fiat_p256_uint1 x486; + fiat_p256_addcarryx_u32(&x485, &x486, x484, 0x0, x453); + uint32_t x487; + fiat_p256_uint1 x488; + fiat_p256_addcarryx_u32(&x487, &x488, x486, x443, x455); + uint32_t x489; + fiat_p256_uint1 x490; + fiat_p256_addcarryx_u32(&x489, &x490, x488, x461, x457); + uint32_t x491; + fiat_p256_uint1 x492; + fiat_p256_addcarryx_u32(&x491, &x492, x490, x462, x459); + uint32_t x493; + fiat_p256_uint1 x494; + fiat_p256_addcarryx_u32(&x493, &x494, x492, 0x0, x460); + uint32_t x495; + uint32_t x496; + fiat_p256_mulx_u32(&x495, &x496, x6, (arg1[7])); + uint32_t x497; + uint32_t x498; + fiat_p256_mulx_u32(&x497, &x498, x6, (arg1[6])); + uint32_t x499; + uint32_t x500; + fiat_p256_mulx_u32(&x499, &x500, x6, (arg1[5])); + uint32_t x501; + uint32_t x502; + fiat_p256_mulx_u32(&x501, &x502, x6, (arg1[4])); + uint32_t x503; + uint32_t x504; + fiat_p256_mulx_u32(&x503, &x504, x6, (arg1[3])); + uint32_t x505; + uint32_t x506; + fiat_p256_mulx_u32(&x505, &x506, x6, (arg1[2])); + uint32_t x507; + uint32_t x508; + fiat_p256_mulx_u32(&x507, &x508, x6, (arg1[1])); + uint32_t x509; + uint32_t x510; + fiat_p256_mulx_u32(&x509, &x510, x6, (arg1[0])); + uint32_t x511; + fiat_p256_uint1 x512; + fiat_p256_addcarryx_u32(&x511, &x512, 0x0, x507, x510); + uint32_t x513; + fiat_p256_uint1 x514; + fiat_p256_addcarryx_u32(&x513, &x514, x512, x505, x508); + uint32_t x515; + fiat_p256_uint1 x516; + fiat_p256_addcarryx_u32(&x515, &x516, x514, x503, x506); + uint32_t x517; + fiat_p256_uint1 x518; + fiat_p256_addcarryx_u32(&x517, &x518, x516, x501, x504); + uint32_t x519; + fiat_p256_uint1 x520; + fiat_p256_addcarryx_u32(&x519, &x520, x518, x499, x502); + uint32_t x521; + fiat_p256_uint1 x522; + fiat_p256_addcarryx_u32(&x521, &x522, x520, x497, x500); + uint32_t x523; + fiat_p256_uint1 x524; + fiat_p256_addcarryx_u32(&x523, &x524, x522, x495, x498); + uint32_t x525; + fiat_p256_uint1 x526; + fiat_p256_addcarryx_u32(&x525, &x526, x524, 0x0, x496); + uint32_t x527; + fiat_p256_uint1 x528; + fiat_p256_addcarryx_u32(&x527, &x528, 0x0, x509, x477); + uint32_t x529; + fiat_p256_uint1 x530; + fiat_p256_addcarryx_u32(&x529, &x530, x528, x511, x479); + uint32_t x531; + fiat_p256_uint1 x532; + fiat_p256_addcarryx_u32(&x531, &x532, x530, x513, x481); + uint32_t x533; + fiat_p256_uint1 x534; + fiat_p256_addcarryx_u32(&x533, &x534, x532, x515, x483); + uint32_t x535; + fiat_p256_uint1 x536; + fiat_p256_addcarryx_u32(&x535, &x536, x534, x517, x485); + uint32_t x537; + fiat_p256_uint1 x538; + fiat_p256_addcarryx_u32(&x537, &x538, x536, x519, x487); + uint32_t x539; + fiat_p256_uint1 x540; + fiat_p256_addcarryx_u32(&x539, &x540, x538, x521, x489); + uint32_t x541; + fiat_p256_uint1 x542; + fiat_p256_addcarryx_u32(&x541, &x542, x540, x523, x491); + uint32_t x543; + fiat_p256_uint1 x544; + fiat_p256_addcarryx_u32(&x543, &x544, x542, x525, x493); + uint32_t x545; + uint32_t x546; + fiat_p256_mulx_u32(&x545, &x546, x527, UINT32_C(0xffffffff)); + uint32_t x547; + uint32_t x548; + fiat_p256_mulx_u32(&x547, &x548, x527, UINT32_C(0xffffffff)); + uint32_t x549; + uint32_t x550; + fiat_p256_mulx_u32(&x549, &x550, x527, UINT32_C(0xffffffff)); + uint32_t x551; + uint32_t x552; + fiat_p256_mulx_u32(&x551, &x552, x527, UINT32_C(0xffffffff)); + uint32_t x553; + fiat_p256_uint1 x554; + fiat_p256_addcarryx_u32(&x553, &x554, 0x0, x549, x552); + uint32_t x555; + fiat_p256_uint1 x556; + fiat_p256_addcarryx_u32(&x555, &x556, x554, x547, x550); + uint32_t x557; + fiat_p256_uint1 x558; + fiat_p256_addcarryx_u32(&x557, &x558, x556, 0x0, x548); + uint32_t x559; + fiat_p256_uint1 x560; + fiat_p256_addcarryx_u32(&x559, &x560, 0x0, x551, x527); + uint32_t x561; + fiat_p256_uint1 x562; + fiat_p256_addcarryx_u32(&x561, &x562, x560, x553, x529); + uint32_t x563; + fiat_p256_uint1 x564; + fiat_p256_addcarryx_u32(&x563, &x564, x562, x555, x531); + uint32_t x565; + fiat_p256_uint1 x566; + fiat_p256_addcarryx_u32(&x565, &x566, x564, x557, x533); + uint32_t x567; + fiat_p256_uint1 x568; + fiat_p256_addcarryx_u32(&x567, &x568, x566, 0x0, x535); + uint32_t x569; + fiat_p256_uint1 x570; + fiat_p256_addcarryx_u32(&x569, &x570, x568, 0x0, x537); + uint32_t x571; + fiat_p256_uint1 x572; + fiat_p256_addcarryx_u32(&x571, &x572, x570, x527, x539); + uint32_t x573; + fiat_p256_uint1 x574; + fiat_p256_addcarryx_u32(&x573, &x574, x572, x545, x541); + uint32_t x575; + fiat_p256_uint1 x576; + fiat_p256_addcarryx_u32(&x575, &x576, x574, x546, x543); + uint32_t x577; + fiat_p256_uint1 x578; + fiat_p256_addcarryx_u32(&x577, &x578, x576, 0x0, x544); + uint32_t x579; + uint32_t x580; + fiat_p256_mulx_u32(&x579, &x580, x7, (arg1[7])); + uint32_t x581; + uint32_t x582; + fiat_p256_mulx_u32(&x581, &x582, x7, (arg1[6])); + uint32_t x583; + uint32_t x584; + fiat_p256_mulx_u32(&x583, &x584, x7, (arg1[5])); + uint32_t x585; + uint32_t x586; + fiat_p256_mulx_u32(&x585, &x586, x7, (arg1[4])); + uint32_t x587; + uint32_t x588; + fiat_p256_mulx_u32(&x587, &x588, x7, (arg1[3])); + uint32_t x589; + uint32_t x590; + fiat_p256_mulx_u32(&x589, &x590, x7, (arg1[2])); + uint32_t x591; + uint32_t x592; + fiat_p256_mulx_u32(&x591, &x592, x7, (arg1[1])); + uint32_t x593; + uint32_t x594; + fiat_p256_mulx_u32(&x593, &x594, x7, (arg1[0])); + uint32_t x595; + fiat_p256_uint1 x596; + fiat_p256_addcarryx_u32(&x595, &x596, 0x0, x591, x594); + uint32_t x597; + fiat_p256_uint1 x598; + fiat_p256_addcarryx_u32(&x597, &x598, x596, x589, x592); + uint32_t x599; + fiat_p256_uint1 x600; + fiat_p256_addcarryx_u32(&x599, &x600, x598, x587, x590); + uint32_t x601; + fiat_p256_uint1 x602; + fiat_p256_addcarryx_u32(&x601, &x602, x600, x585, x588); + uint32_t x603; + fiat_p256_uint1 x604; + fiat_p256_addcarryx_u32(&x603, &x604, x602, x583, x586); + uint32_t x605; + fiat_p256_uint1 x606; + fiat_p256_addcarryx_u32(&x605, &x606, x604, x581, x584); + uint32_t x607; + fiat_p256_uint1 x608; + fiat_p256_addcarryx_u32(&x607, &x608, x606, x579, x582); + uint32_t x609; + fiat_p256_uint1 x610; + fiat_p256_addcarryx_u32(&x609, &x610, x608, 0x0, x580); + uint32_t x611; + fiat_p256_uint1 x612; + fiat_p256_addcarryx_u32(&x611, &x612, 0x0, x593, x561); + uint32_t x613; + fiat_p256_uint1 x614; + fiat_p256_addcarryx_u32(&x613, &x614, x612, x595, x563); + uint32_t x615; + fiat_p256_uint1 x616; + fiat_p256_addcarryx_u32(&x615, &x616, x614, x597, x565); + uint32_t x617; + fiat_p256_uint1 x618; + fiat_p256_addcarryx_u32(&x617, &x618, x616, x599, x567); + uint32_t x619; + fiat_p256_uint1 x620; + fiat_p256_addcarryx_u32(&x619, &x620, x618, x601, x569); + uint32_t x621; + fiat_p256_uint1 x622; + fiat_p256_addcarryx_u32(&x621, &x622, x620, x603, x571); + uint32_t x623; + fiat_p256_uint1 x624; + fiat_p256_addcarryx_u32(&x623, &x624, x622, x605, x573); + uint32_t x625; + fiat_p256_uint1 x626; + fiat_p256_addcarryx_u32(&x625, &x626, x624, x607, x575); + uint32_t x627; + fiat_p256_uint1 x628; + fiat_p256_addcarryx_u32(&x627, &x628, x626, x609, x577); + uint32_t x629; + uint32_t x630; + fiat_p256_mulx_u32(&x629, &x630, x611, UINT32_C(0xffffffff)); + uint32_t x631; + uint32_t x632; + fiat_p256_mulx_u32(&x631, &x632, x611, UINT32_C(0xffffffff)); + uint32_t x633; + uint32_t x634; + fiat_p256_mulx_u32(&x633, &x634, x611, UINT32_C(0xffffffff)); + uint32_t x635; + uint32_t x636; + fiat_p256_mulx_u32(&x635, &x636, x611, UINT32_C(0xffffffff)); + uint32_t x637; + fiat_p256_uint1 x638; + fiat_p256_addcarryx_u32(&x637, &x638, 0x0, x633, x636); + uint32_t x639; + fiat_p256_uint1 x640; + fiat_p256_addcarryx_u32(&x639, &x640, x638, x631, x634); + uint32_t x641; + fiat_p256_uint1 x642; + fiat_p256_addcarryx_u32(&x641, &x642, x640, 0x0, x632); + uint32_t x643; + fiat_p256_uint1 x644; + fiat_p256_addcarryx_u32(&x643, &x644, 0x0, x635, x611); + uint32_t x645; + fiat_p256_uint1 x646; + fiat_p256_addcarryx_u32(&x645, &x646, x644, x637, x613); + uint32_t x647; + fiat_p256_uint1 x648; + fiat_p256_addcarryx_u32(&x647, &x648, x646, x639, x615); + uint32_t x649; + fiat_p256_uint1 x650; + fiat_p256_addcarryx_u32(&x649, &x650, x648, x641, x617); + uint32_t x651; + fiat_p256_uint1 x652; + fiat_p256_addcarryx_u32(&x651, &x652, x650, 0x0, x619); + uint32_t x653; + fiat_p256_uint1 x654; + fiat_p256_addcarryx_u32(&x653, &x654, x652, 0x0, x621); + uint32_t x655; + fiat_p256_uint1 x656; + fiat_p256_addcarryx_u32(&x655, &x656, x654, x611, x623); + uint32_t x657; + fiat_p256_uint1 x658; + fiat_p256_addcarryx_u32(&x657, &x658, x656, x629, x625); + uint32_t x659; + fiat_p256_uint1 x660; + fiat_p256_addcarryx_u32(&x659, &x660, x658, x630, x627); + uint32_t x661; + fiat_p256_uint1 x662; + fiat_p256_addcarryx_u32(&x661, &x662, x660, 0x0, x628); + uint32_t x663; + fiat_p256_uint1 x664; + fiat_p256_subborrowx_u32(&x663, &x664, 0x0, x645, UINT32_C(0xffffffff)); + uint32_t x665; + fiat_p256_uint1 x666; + fiat_p256_subborrowx_u32(&x665, &x666, x664, x647, UINT32_C(0xffffffff)); + uint32_t x667; + fiat_p256_uint1 x668; + fiat_p256_subborrowx_u32(&x667, &x668, x666, x649, UINT32_C(0xffffffff)); + uint32_t x669; + fiat_p256_uint1 x670; + fiat_p256_subborrowx_u32(&x669, &x670, x668, x651, 0x0); + uint32_t x671; + fiat_p256_uint1 x672; + fiat_p256_subborrowx_u32(&x671, &x672, x670, x653, 0x0); + uint32_t x673; + fiat_p256_uint1 x674; + fiat_p256_subborrowx_u32(&x673, &x674, x672, x655, 0x0); + uint32_t x675; + fiat_p256_uint1 x676; + fiat_p256_subborrowx_u32(&x675, &x676, x674, x657, 0x1); + uint32_t x677; + fiat_p256_uint1 x678; + fiat_p256_subborrowx_u32(&x677, &x678, x676, x659, UINT32_C(0xffffffff)); + uint32_t x679; + fiat_p256_uint1 x680; + fiat_p256_subborrowx_u32(&x679, &x680, x678, x661, 0x0); + uint32_t x681; + fiat_p256_cmovznz_u32(&x681, x680, x663, x645); + uint32_t x682; + fiat_p256_cmovznz_u32(&x682, x680, x665, x647); + uint32_t x683; + fiat_p256_cmovznz_u32(&x683, x680, x667, x649); + uint32_t x684; + fiat_p256_cmovznz_u32(&x684, x680, x669, x651); + uint32_t x685; + fiat_p256_cmovznz_u32(&x685, x680, x671, x653); + uint32_t x686; + fiat_p256_cmovznz_u32(&x686, x680, x673, x655); + uint32_t x687; + fiat_p256_cmovznz_u32(&x687, x680, x675, x657); + uint32_t x688; + fiat_p256_cmovznz_u32(&x688, x680, x677, x659); + out1[0] = x681; + out1[1] = x682; + out1[2] = x683; + out1[3] = x684; + out1[4] = x685; + out1[5] = x686; + out1[6] = x687; + out1[7] = x688; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_add(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { + uint32_t x1; + fiat_p256_uint1 x2; + fiat_p256_addcarryx_u32(&x1, &x2, 0x0, (arg2[0]), (arg1[0])); + uint32_t x3; + fiat_p256_uint1 x4; + fiat_p256_addcarryx_u32(&x3, &x4, x2, (arg2[1]), (arg1[1])); + uint32_t x5; + fiat_p256_uint1 x6; + fiat_p256_addcarryx_u32(&x5, &x6, x4, (arg2[2]), (arg1[2])); + uint32_t x7; + fiat_p256_uint1 x8; + fiat_p256_addcarryx_u32(&x7, &x8, x6, (arg2[3]), (arg1[3])); + uint32_t x9; + fiat_p256_uint1 x10; + fiat_p256_addcarryx_u32(&x9, &x10, x8, (arg2[4]), (arg1[4])); + uint32_t x11; + fiat_p256_uint1 x12; + fiat_p256_addcarryx_u32(&x11, &x12, x10, (arg2[5]), (arg1[5])); + uint32_t x13; + fiat_p256_uint1 x14; + fiat_p256_addcarryx_u32(&x13, &x14, x12, (arg2[6]), (arg1[6])); + uint32_t x15; + fiat_p256_uint1 x16; + fiat_p256_addcarryx_u32(&x15, &x16, x14, (arg2[7]), (arg1[7])); + uint32_t x17; + fiat_p256_uint1 x18; + fiat_p256_subborrowx_u32(&x17, &x18, 0x0, x1, UINT32_C(0xffffffff)); + uint32_t x19; + fiat_p256_uint1 x20; + fiat_p256_subborrowx_u32(&x19, &x20, x18, x3, UINT32_C(0xffffffff)); + uint32_t x21; + fiat_p256_uint1 x22; + fiat_p256_subborrowx_u32(&x21, &x22, x20, x5, UINT32_C(0xffffffff)); + uint32_t x23; + fiat_p256_uint1 x24; + fiat_p256_subborrowx_u32(&x23, &x24, x22, x7, 0x0); + uint32_t x25; + fiat_p256_uint1 x26; + fiat_p256_subborrowx_u32(&x25, &x26, x24, x9, 0x0); + uint32_t x27; + fiat_p256_uint1 x28; + fiat_p256_subborrowx_u32(&x27, &x28, x26, x11, 0x0); + uint32_t x29; + fiat_p256_uint1 x30; + fiat_p256_subborrowx_u32(&x29, &x30, x28, x13, 0x1); + uint32_t x31; + fiat_p256_uint1 x32; + fiat_p256_subborrowx_u32(&x31, &x32, x30, x15, UINT32_C(0xffffffff)); + uint32_t x33; + fiat_p256_uint1 x34; + fiat_p256_subborrowx_u32(&x33, &x34, x32, x16, 0x0); + uint32_t x35; + fiat_p256_cmovznz_u32(&x35, x34, x17, x1); + uint32_t x36; + fiat_p256_cmovznz_u32(&x36, x34, x19, x3); + uint32_t x37; + fiat_p256_cmovznz_u32(&x37, x34, x21, x5); + uint32_t x38; + fiat_p256_cmovznz_u32(&x38, x34, x23, x7); + uint32_t x39; + fiat_p256_cmovznz_u32(&x39, x34, x25, x9); + uint32_t x40; + fiat_p256_cmovznz_u32(&x40, x34, x27, x11); + uint32_t x41; + fiat_p256_cmovznz_u32(&x41, x34, x29, x13); + uint32_t x42; + fiat_p256_cmovznz_u32(&x42, x34, x31, x15); + out1[0] = x35; + out1[1] = x36; + out1[2] = x37; + out1[3] = x38; + out1[4] = x39; + out1[5] = x40; + out1[6] = x41; + out1[7] = x42; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_sub(uint32_t out1[8], const uint32_t arg1[8], const uint32_t arg2[8]) { + uint32_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u32(&x1, &x2, 0x0, (arg1[0]), (arg2[0])); + uint32_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u32(&x3, &x4, x2, (arg1[1]), (arg2[1])); + uint32_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u32(&x5, &x6, x4, (arg1[2]), (arg2[2])); + uint32_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u32(&x7, &x8, x6, (arg1[3]), (arg2[3])); + uint32_t x9; + fiat_p256_uint1 x10; + fiat_p256_subborrowx_u32(&x9, &x10, x8, (arg1[4]), (arg2[4])); + uint32_t x11; + fiat_p256_uint1 x12; + fiat_p256_subborrowx_u32(&x11, &x12, x10, (arg1[5]), (arg2[5])); + uint32_t x13; + fiat_p256_uint1 x14; + fiat_p256_subborrowx_u32(&x13, &x14, x12, (arg1[6]), (arg2[6])); + uint32_t x15; + fiat_p256_uint1 x16; + fiat_p256_subborrowx_u32(&x15, &x16, x14, (arg1[7]), (arg2[7])); + uint32_t x17; + fiat_p256_cmovznz_u32(&x17, x16, 0x0, UINT32_C(0xffffffff)); + uint32_t x18; + fiat_p256_uint1 x19; + fiat_p256_addcarryx_u32(&x18, &x19, 0x0, (x17 & UINT32_C(0xffffffff)), x1); + uint32_t x20; + fiat_p256_uint1 x21; + fiat_p256_addcarryx_u32(&x20, &x21, x19, (x17 & UINT32_C(0xffffffff)), x3); + uint32_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u32(&x22, &x23, x21, (x17 & UINT32_C(0xffffffff)), x5); + uint32_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u32(&x24, &x25, x23, 0x0, x7); + uint32_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x9); + uint32_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x11); + uint32_t x30; + fiat_p256_uint1 x31; + fiat_p256_addcarryx_u32(&x30, &x31, x29, (fiat_p256_uint1)(x17 & 0x1), x13); + uint32_t x32; + fiat_p256_uint1 x33; + fiat_p256_addcarryx_u32(&x32, &x33, x31, (x17 & UINT32_C(0xffffffff)), x15); + out1[0] = x18; + out1[1] = x20; + out1[2] = x22; + out1[3] = x24; + out1[4] = x26; + out1[5] = x28; + out1[6] = x30; + out1[7] = x32; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_opp(uint32_t out1[8], const uint32_t arg1[8]) { + uint32_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u32(&x1, &x2, 0x0, 0x0, (arg1[0])); + uint32_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u32(&x3, &x4, x2, 0x0, (arg1[1])); + uint32_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u32(&x5, &x6, x4, 0x0, (arg1[2])); + uint32_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u32(&x7, &x8, x6, 0x0, (arg1[3])); + uint32_t x9; + fiat_p256_uint1 x10; + fiat_p256_subborrowx_u32(&x9, &x10, x8, 0x0, (arg1[4])); + uint32_t x11; + fiat_p256_uint1 x12; + fiat_p256_subborrowx_u32(&x11, &x12, x10, 0x0, (arg1[5])); + uint32_t x13; + fiat_p256_uint1 x14; + fiat_p256_subborrowx_u32(&x13, &x14, x12, 0x0, (arg1[6])); + uint32_t x15; + fiat_p256_uint1 x16; + fiat_p256_subborrowx_u32(&x15, &x16, x14, 0x0, (arg1[7])); + uint32_t x17; + fiat_p256_cmovznz_u32(&x17, x16, 0x0, UINT32_C(0xffffffff)); + uint32_t x18; + fiat_p256_uint1 x19; + fiat_p256_addcarryx_u32(&x18, &x19, 0x0, (x17 & UINT32_C(0xffffffff)), x1); + uint32_t x20; + fiat_p256_uint1 x21; + fiat_p256_addcarryx_u32(&x20, &x21, x19, (x17 & UINT32_C(0xffffffff)), x3); + uint32_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u32(&x22, &x23, x21, (x17 & UINT32_C(0xffffffff)), x5); + uint32_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u32(&x24, &x25, x23, 0x0, x7); + uint32_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x9); + uint32_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x11); + uint32_t x30; + fiat_p256_uint1 x31; + fiat_p256_addcarryx_u32(&x30, &x31, x29, (fiat_p256_uint1)(x17 & 0x1), x13); + uint32_t x32; + fiat_p256_uint1 x33; + fiat_p256_addcarryx_u32(&x32, &x33, x31, (x17 & UINT32_C(0xffffffff)), x15); + out1[0] = x18; + out1[1] = x20; + out1[2] = x22; + out1[3] = x24; + out1[4] = x26; + out1[5] = x28; + out1[6] = x30; + out1[7] = x32; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_from_montgomery(uint32_t out1[8], const uint32_t arg1[8]) { + uint32_t x1 = (arg1[0]); + uint32_t x2; + uint32_t x3; + fiat_p256_mulx_u32(&x2, &x3, x1, UINT32_C(0xffffffff)); + uint32_t x4; + uint32_t x5; + fiat_p256_mulx_u32(&x4, &x5, x1, UINT32_C(0xffffffff)); + uint32_t x6; + uint32_t x7; + fiat_p256_mulx_u32(&x6, &x7, x1, UINT32_C(0xffffffff)); + uint32_t x8; + uint32_t x9; + fiat_p256_mulx_u32(&x8, &x9, x1, UINT32_C(0xffffffff)); + uint32_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u32(&x10, &x11, 0x0, x6, x9); + uint32_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u32(&x12, &x13, x11, x4, x7); + uint32_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u32(&x14, &x15, 0x0, x8, x1); + uint32_t x16; + fiat_p256_uint1 x17; + fiat_p256_addcarryx_u32(&x16, &x17, x15, x10, 0x0); + uint32_t x18; + fiat_p256_uint1 x19; + fiat_p256_addcarryx_u32(&x18, &x19, x17, x12, 0x0); + uint32_t x20; + fiat_p256_uint1 x21; + fiat_p256_addcarryx_u32(&x20, &x21, x13, 0x0, x5); + uint32_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u32(&x22, &x23, x19, x20, 0x0); + uint32_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u32(&x24, &x25, 0x0, (arg1[1]), x16); + uint32_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u32(&x26, &x27, x25, 0x0, x18); + uint32_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u32(&x28, &x29, x27, 0x0, x22); + uint32_t x30; + uint32_t x31; + fiat_p256_mulx_u32(&x30, &x31, x24, UINT32_C(0xffffffff)); + uint32_t x32; + uint32_t x33; + fiat_p256_mulx_u32(&x32, &x33, x24, UINT32_C(0xffffffff)); + uint32_t x34; + uint32_t x35; + fiat_p256_mulx_u32(&x34, &x35, x24, UINT32_C(0xffffffff)); + uint32_t x36; + uint32_t x37; + fiat_p256_mulx_u32(&x36, &x37, x24, UINT32_C(0xffffffff)); + uint32_t x38; + fiat_p256_uint1 x39; + fiat_p256_addcarryx_u32(&x38, &x39, 0x0, x34, x37); + uint32_t x40; + fiat_p256_uint1 x41; + fiat_p256_addcarryx_u32(&x40, &x41, x39, x32, x35); + uint32_t x42; + fiat_p256_uint1 x43; + fiat_p256_addcarryx_u32(&x42, &x43, 0x0, x36, x24); + uint32_t x44; + fiat_p256_uint1 x45; + fiat_p256_addcarryx_u32(&x44, &x45, x43, x38, x26); + uint32_t x46; + fiat_p256_uint1 x47; + fiat_p256_addcarryx_u32(&x46, &x47, x45, x40, x28); + uint32_t x48; + fiat_p256_uint1 x49; + fiat_p256_addcarryx_u32(&x48, &x49, x23, 0x0, 0x0); + uint32_t x50; + fiat_p256_uint1 x51; + fiat_p256_addcarryx_u32(&x50, &x51, x29, 0x0, (fiat_p256_uint1)x48); + uint32_t x52; + fiat_p256_uint1 x53; + fiat_p256_addcarryx_u32(&x52, &x53, x41, 0x0, x33); + uint32_t x54; + fiat_p256_uint1 x55; + fiat_p256_addcarryx_u32(&x54, &x55, x47, x52, x50); + uint32_t x56; + fiat_p256_uint1 x57; + fiat_p256_addcarryx_u32(&x56, &x57, 0x0, x24, x2); + uint32_t x58; + fiat_p256_uint1 x59; + fiat_p256_addcarryx_u32(&x58, &x59, x57, x30, x3); + uint32_t x60; + fiat_p256_uint1 x61; + fiat_p256_addcarryx_u32(&x60, &x61, 0x0, (arg1[2]), x44); + uint32_t x62; + fiat_p256_uint1 x63; + fiat_p256_addcarryx_u32(&x62, &x63, x61, 0x0, x46); + uint32_t x64; + fiat_p256_uint1 x65; + fiat_p256_addcarryx_u32(&x64, &x65, x63, 0x0, x54); + uint32_t x66; + uint32_t x67; + fiat_p256_mulx_u32(&x66, &x67, x60, UINT32_C(0xffffffff)); + uint32_t x68; + uint32_t x69; + fiat_p256_mulx_u32(&x68, &x69, x60, UINT32_C(0xffffffff)); + uint32_t x70; + uint32_t x71; + fiat_p256_mulx_u32(&x70, &x71, x60, UINT32_C(0xffffffff)); + uint32_t x72; + uint32_t x73; + fiat_p256_mulx_u32(&x72, &x73, x60, UINT32_C(0xffffffff)); + uint32_t x74; + fiat_p256_uint1 x75; + fiat_p256_addcarryx_u32(&x74, &x75, 0x0, x70, x73); + uint32_t x76; + fiat_p256_uint1 x77; + fiat_p256_addcarryx_u32(&x76, &x77, x75, x68, x71); + uint32_t x78; + fiat_p256_uint1 x79; + fiat_p256_addcarryx_u32(&x78, &x79, 0x0, x72, x60); + uint32_t x80; + fiat_p256_uint1 x81; + fiat_p256_addcarryx_u32(&x80, &x81, x79, x74, x62); + uint32_t x82; + fiat_p256_uint1 x83; + fiat_p256_addcarryx_u32(&x82, &x83, x81, x76, x64); + uint32_t x84; + fiat_p256_uint1 x85; + fiat_p256_addcarryx_u32(&x84, &x85, x55, 0x0, 0x0); + uint32_t x86; + fiat_p256_uint1 x87; + fiat_p256_addcarryx_u32(&x86, &x87, x65, 0x0, (fiat_p256_uint1)x84); + uint32_t x88; + fiat_p256_uint1 x89; + fiat_p256_addcarryx_u32(&x88, &x89, x77, 0x0, x69); + uint32_t x90; + fiat_p256_uint1 x91; + fiat_p256_addcarryx_u32(&x90, &x91, x83, x88, x86); + uint32_t x92; + fiat_p256_uint1 x93; + fiat_p256_addcarryx_u32(&x92, &x93, x91, 0x0, x1); + uint32_t x94; + fiat_p256_uint1 x95; + fiat_p256_addcarryx_u32(&x94, &x95, x93, 0x0, x56); + uint32_t x96; + fiat_p256_uint1 x97; + fiat_p256_addcarryx_u32(&x96, &x97, x95, x60, x58); + uint32_t x98; + fiat_p256_uint1 x99; + fiat_p256_addcarryx_u32(&x98, &x99, x59, x31, 0x0); + uint32_t x100; + fiat_p256_uint1 x101; + fiat_p256_addcarryx_u32(&x100, &x101, x97, x66, x98); + uint32_t x102; + fiat_p256_uint1 x103; + fiat_p256_addcarryx_u32(&x102, &x103, 0x0, (arg1[3]), x80); + uint32_t x104; + fiat_p256_uint1 x105; + fiat_p256_addcarryx_u32(&x104, &x105, x103, 0x0, x82); + uint32_t x106; + fiat_p256_uint1 x107; + fiat_p256_addcarryx_u32(&x106, &x107, x105, 0x0, x90); + uint32_t x108; + fiat_p256_uint1 x109; + fiat_p256_addcarryx_u32(&x108, &x109, x107, 0x0, x92); + uint32_t x110; + fiat_p256_uint1 x111; + fiat_p256_addcarryx_u32(&x110, &x111, x109, 0x0, x94); + uint32_t x112; + fiat_p256_uint1 x113; + fiat_p256_addcarryx_u32(&x112, &x113, x111, 0x0, x96); + uint32_t x114; + fiat_p256_uint1 x115; + fiat_p256_addcarryx_u32(&x114, &x115, x113, 0x0, x100); + uint32_t x116; + fiat_p256_uint1 x117; + fiat_p256_addcarryx_u32(&x116, &x117, x101, x67, 0x0); + uint32_t x118; + fiat_p256_uint1 x119; + fiat_p256_addcarryx_u32(&x118, &x119, x115, 0x0, x116); + uint32_t x120; + uint32_t x121; + fiat_p256_mulx_u32(&x120, &x121, x102, UINT32_C(0xffffffff)); + uint32_t x122; + uint32_t x123; + fiat_p256_mulx_u32(&x122, &x123, x102, UINT32_C(0xffffffff)); + uint32_t x124; + uint32_t x125; + fiat_p256_mulx_u32(&x124, &x125, x102, UINT32_C(0xffffffff)); + uint32_t x126; + uint32_t x127; + fiat_p256_mulx_u32(&x126, &x127, x102, UINT32_C(0xffffffff)); + uint32_t x128; + fiat_p256_uint1 x129; + fiat_p256_addcarryx_u32(&x128, &x129, 0x0, x124, x127); + uint32_t x130; + fiat_p256_uint1 x131; + fiat_p256_addcarryx_u32(&x130, &x131, x129, x122, x125); + uint32_t x132; + fiat_p256_uint1 x133; + fiat_p256_addcarryx_u32(&x132, &x133, 0x0, x126, x102); + uint32_t x134; + fiat_p256_uint1 x135; + fiat_p256_addcarryx_u32(&x134, &x135, x133, x128, x104); + uint32_t x136; + fiat_p256_uint1 x137; + fiat_p256_addcarryx_u32(&x136, &x137, x135, x130, x106); + uint32_t x138; + fiat_p256_uint1 x139; + fiat_p256_addcarryx_u32(&x138, &x139, x131, 0x0, x123); + uint32_t x140; + fiat_p256_uint1 x141; + fiat_p256_addcarryx_u32(&x140, &x141, x137, x138, x108); + uint32_t x142; + fiat_p256_uint1 x143; + fiat_p256_addcarryx_u32(&x142, &x143, x141, 0x0, x110); + uint32_t x144; + fiat_p256_uint1 x145; + fiat_p256_addcarryx_u32(&x144, &x145, x143, 0x0, x112); + uint32_t x146; + fiat_p256_uint1 x147; + fiat_p256_addcarryx_u32(&x146, &x147, x145, x102, x114); + uint32_t x148; + fiat_p256_uint1 x149; + fiat_p256_addcarryx_u32(&x148, &x149, x147, x120, x118); + uint32_t x150; + fiat_p256_uint1 x151; + fiat_p256_addcarryx_u32(&x150, &x151, x119, 0x0, 0x0); + uint32_t x152; + fiat_p256_uint1 x153; + fiat_p256_addcarryx_u32(&x152, &x153, x149, x121, (fiat_p256_uint1)x150); + uint32_t x154; + fiat_p256_uint1 x155; + fiat_p256_addcarryx_u32(&x154, &x155, 0x0, (arg1[4]), x134); + uint32_t x156; + fiat_p256_uint1 x157; + fiat_p256_addcarryx_u32(&x156, &x157, x155, 0x0, x136); + uint32_t x158; + fiat_p256_uint1 x159; + fiat_p256_addcarryx_u32(&x158, &x159, x157, 0x0, x140); + uint32_t x160; + fiat_p256_uint1 x161; + fiat_p256_addcarryx_u32(&x160, &x161, x159, 0x0, x142); + uint32_t x162; + fiat_p256_uint1 x163; + fiat_p256_addcarryx_u32(&x162, &x163, x161, 0x0, x144); + uint32_t x164; + fiat_p256_uint1 x165; + fiat_p256_addcarryx_u32(&x164, &x165, x163, 0x0, x146); + uint32_t x166; + fiat_p256_uint1 x167; + fiat_p256_addcarryx_u32(&x166, &x167, x165, 0x0, x148); + uint32_t x168; + fiat_p256_uint1 x169; + fiat_p256_addcarryx_u32(&x168, &x169, x167, 0x0, x152); + uint32_t x170; + uint32_t x171; + fiat_p256_mulx_u32(&x170, &x171, x154, UINT32_C(0xffffffff)); + uint32_t x172; + uint32_t x173; + fiat_p256_mulx_u32(&x172, &x173, x154, UINT32_C(0xffffffff)); + uint32_t x174; + uint32_t x175; + fiat_p256_mulx_u32(&x174, &x175, x154, UINT32_C(0xffffffff)); + uint32_t x176; + uint32_t x177; + fiat_p256_mulx_u32(&x176, &x177, x154, UINT32_C(0xffffffff)); + uint32_t x178; + fiat_p256_uint1 x179; + fiat_p256_addcarryx_u32(&x178, &x179, 0x0, x174, x177); + uint32_t x180; + fiat_p256_uint1 x181; + fiat_p256_addcarryx_u32(&x180, &x181, x179, x172, x175); + uint32_t x182; + fiat_p256_uint1 x183; + fiat_p256_addcarryx_u32(&x182, &x183, 0x0, x176, x154); + uint32_t x184; + fiat_p256_uint1 x185; + fiat_p256_addcarryx_u32(&x184, &x185, x183, x178, x156); + uint32_t x186; + fiat_p256_uint1 x187; + fiat_p256_addcarryx_u32(&x186, &x187, x185, x180, x158); + uint32_t x188; + fiat_p256_uint1 x189; + fiat_p256_addcarryx_u32(&x188, &x189, x181, 0x0, x173); + uint32_t x190; + fiat_p256_uint1 x191; + fiat_p256_addcarryx_u32(&x190, &x191, x187, x188, x160); + uint32_t x192; + fiat_p256_uint1 x193; + fiat_p256_addcarryx_u32(&x192, &x193, x191, 0x0, x162); + uint32_t x194; + fiat_p256_uint1 x195; + fiat_p256_addcarryx_u32(&x194, &x195, x193, 0x0, x164); + uint32_t x196; + fiat_p256_uint1 x197; + fiat_p256_addcarryx_u32(&x196, &x197, x195, x154, x166); + uint32_t x198; + fiat_p256_uint1 x199; + fiat_p256_addcarryx_u32(&x198, &x199, x197, x170, x168); + uint32_t x200; + fiat_p256_uint1 x201; + fiat_p256_addcarryx_u32(&x200, &x201, x153, 0x0, 0x0); + uint32_t x202; + fiat_p256_uint1 x203; + fiat_p256_addcarryx_u32(&x202, &x203, x169, 0x0, (fiat_p256_uint1)x200); + uint32_t x204; + fiat_p256_uint1 x205; + fiat_p256_addcarryx_u32(&x204, &x205, x199, x171, x202); + uint32_t x206; + fiat_p256_uint1 x207; + fiat_p256_addcarryx_u32(&x206, &x207, 0x0, (arg1[5]), x184); + uint32_t x208; + fiat_p256_uint1 x209; + fiat_p256_addcarryx_u32(&x208, &x209, x207, 0x0, x186); + uint32_t x210; + fiat_p256_uint1 x211; + fiat_p256_addcarryx_u32(&x210, &x211, x209, 0x0, x190); + uint32_t x212; + fiat_p256_uint1 x213; + fiat_p256_addcarryx_u32(&x212, &x213, x211, 0x0, x192); + uint32_t x214; + fiat_p256_uint1 x215; + fiat_p256_addcarryx_u32(&x214, &x215, x213, 0x0, x194); + uint32_t x216; + fiat_p256_uint1 x217; + fiat_p256_addcarryx_u32(&x216, &x217, x215, 0x0, x196); + uint32_t x218; + fiat_p256_uint1 x219; + fiat_p256_addcarryx_u32(&x218, &x219, x217, 0x0, x198); + uint32_t x220; + fiat_p256_uint1 x221; + fiat_p256_addcarryx_u32(&x220, &x221, x219, 0x0, x204); + uint32_t x222; + uint32_t x223; + fiat_p256_mulx_u32(&x222, &x223, x206, UINT32_C(0xffffffff)); + uint32_t x224; + uint32_t x225; + fiat_p256_mulx_u32(&x224, &x225, x206, UINT32_C(0xffffffff)); + uint32_t x226; + uint32_t x227; + fiat_p256_mulx_u32(&x226, &x227, x206, UINT32_C(0xffffffff)); + uint32_t x228; + uint32_t x229; + fiat_p256_mulx_u32(&x228, &x229, x206, UINT32_C(0xffffffff)); + uint32_t x230; + fiat_p256_uint1 x231; + fiat_p256_addcarryx_u32(&x230, &x231, 0x0, x226, x229); + uint32_t x232; + fiat_p256_uint1 x233; + fiat_p256_addcarryx_u32(&x232, &x233, x231, x224, x227); + uint32_t x234; + fiat_p256_uint1 x235; + fiat_p256_addcarryx_u32(&x234, &x235, 0x0, x228, x206); + uint32_t x236; + fiat_p256_uint1 x237; + fiat_p256_addcarryx_u32(&x236, &x237, x235, x230, x208); + uint32_t x238; + fiat_p256_uint1 x239; + fiat_p256_addcarryx_u32(&x238, &x239, x237, x232, x210); + uint32_t x240; + fiat_p256_uint1 x241; + fiat_p256_addcarryx_u32(&x240, &x241, x233, 0x0, x225); + uint32_t x242; + fiat_p256_uint1 x243; + fiat_p256_addcarryx_u32(&x242, &x243, x239, x240, x212); + uint32_t x244; + fiat_p256_uint1 x245; + fiat_p256_addcarryx_u32(&x244, &x245, x243, 0x0, x214); + uint32_t x246; + fiat_p256_uint1 x247; + fiat_p256_addcarryx_u32(&x246, &x247, x245, 0x0, x216); + uint32_t x248; + fiat_p256_uint1 x249; + fiat_p256_addcarryx_u32(&x248, &x249, x247, x206, x218); + uint32_t x250; + fiat_p256_uint1 x251; + fiat_p256_addcarryx_u32(&x250, &x251, x249, x222, x220); + uint32_t x252; + fiat_p256_uint1 x253; + fiat_p256_addcarryx_u32(&x252, &x253, x205, 0x0, 0x0); + uint32_t x254; + fiat_p256_uint1 x255; + fiat_p256_addcarryx_u32(&x254, &x255, x221, 0x0, (fiat_p256_uint1)x252); + uint32_t x256; + fiat_p256_uint1 x257; + fiat_p256_addcarryx_u32(&x256, &x257, x251, x223, x254); + uint32_t x258; + fiat_p256_uint1 x259; + fiat_p256_addcarryx_u32(&x258, &x259, 0x0, (arg1[6]), x236); + uint32_t x260; + fiat_p256_uint1 x261; + fiat_p256_addcarryx_u32(&x260, &x261, x259, 0x0, x238); + uint32_t x262; + fiat_p256_uint1 x263; + fiat_p256_addcarryx_u32(&x262, &x263, x261, 0x0, x242); + uint32_t x264; + fiat_p256_uint1 x265; + fiat_p256_addcarryx_u32(&x264, &x265, x263, 0x0, x244); + uint32_t x266; + fiat_p256_uint1 x267; + fiat_p256_addcarryx_u32(&x266, &x267, x265, 0x0, x246); + uint32_t x268; + fiat_p256_uint1 x269; + fiat_p256_addcarryx_u32(&x268, &x269, x267, 0x0, x248); + uint32_t x270; + fiat_p256_uint1 x271; + fiat_p256_addcarryx_u32(&x270, &x271, x269, 0x0, x250); + uint32_t x272; + fiat_p256_uint1 x273; + fiat_p256_addcarryx_u32(&x272, &x273, x271, 0x0, x256); + uint32_t x274; + uint32_t x275; + fiat_p256_mulx_u32(&x274, &x275, x258, UINT32_C(0xffffffff)); + uint32_t x276; + uint32_t x277; + fiat_p256_mulx_u32(&x276, &x277, x258, UINT32_C(0xffffffff)); + uint32_t x278; + uint32_t x279; + fiat_p256_mulx_u32(&x278, &x279, x258, UINT32_C(0xffffffff)); + uint32_t x280; + uint32_t x281; + fiat_p256_mulx_u32(&x280, &x281, x258, UINT32_C(0xffffffff)); + uint32_t x282; + fiat_p256_uint1 x283; + fiat_p256_addcarryx_u32(&x282, &x283, 0x0, x278, x281); + uint32_t x284; + fiat_p256_uint1 x285; + fiat_p256_addcarryx_u32(&x284, &x285, x283, x276, x279); + uint32_t x286; + fiat_p256_uint1 x287; + fiat_p256_addcarryx_u32(&x286, &x287, 0x0, x280, x258); + uint32_t x288; + fiat_p256_uint1 x289; + fiat_p256_addcarryx_u32(&x288, &x289, x287, x282, x260); + uint32_t x290; + fiat_p256_uint1 x291; + fiat_p256_addcarryx_u32(&x290, &x291, x289, x284, x262); + uint32_t x292; + fiat_p256_uint1 x293; + fiat_p256_addcarryx_u32(&x292, &x293, x285, 0x0, x277); + uint32_t x294; + fiat_p256_uint1 x295; + fiat_p256_addcarryx_u32(&x294, &x295, x291, x292, x264); + uint32_t x296; + fiat_p256_uint1 x297; + fiat_p256_addcarryx_u32(&x296, &x297, x295, 0x0, x266); + uint32_t x298; + fiat_p256_uint1 x299; + fiat_p256_addcarryx_u32(&x298, &x299, x297, 0x0, x268); + uint32_t x300; + fiat_p256_uint1 x301; + fiat_p256_addcarryx_u32(&x300, &x301, x299, x258, x270); + uint32_t x302; + fiat_p256_uint1 x303; + fiat_p256_addcarryx_u32(&x302, &x303, x301, x274, x272); + uint32_t x304; + fiat_p256_uint1 x305; + fiat_p256_addcarryx_u32(&x304, &x305, x257, 0x0, 0x0); + uint32_t x306; + fiat_p256_uint1 x307; + fiat_p256_addcarryx_u32(&x306, &x307, x273, 0x0, (fiat_p256_uint1)x304); + uint32_t x308; + fiat_p256_uint1 x309; + fiat_p256_addcarryx_u32(&x308, &x309, x303, x275, x306); + uint32_t x310; + fiat_p256_uint1 x311; + fiat_p256_addcarryx_u32(&x310, &x311, 0x0, (arg1[7]), x288); + uint32_t x312; + fiat_p256_uint1 x313; + fiat_p256_addcarryx_u32(&x312, &x313, x311, 0x0, x290); + uint32_t x314; + fiat_p256_uint1 x315; + fiat_p256_addcarryx_u32(&x314, &x315, x313, 0x0, x294); + uint32_t x316; + fiat_p256_uint1 x317; + fiat_p256_addcarryx_u32(&x316, &x317, x315, 0x0, x296); + uint32_t x318; + fiat_p256_uint1 x319; + fiat_p256_addcarryx_u32(&x318, &x319, x317, 0x0, x298); + uint32_t x320; + fiat_p256_uint1 x321; + fiat_p256_addcarryx_u32(&x320, &x321, x319, 0x0, x300); + uint32_t x322; + fiat_p256_uint1 x323; + fiat_p256_addcarryx_u32(&x322, &x323, x321, 0x0, x302); + uint32_t x324; + fiat_p256_uint1 x325; + fiat_p256_addcarryx_u32(&x324, &x325, x323, 0x0, x308); + uint32_t x326; + uint32_t x327; + fiat_p256_mulx_u32(&x326, &x327, x310, UINT32_C(0xffffffff)); + uint32_t x328; + uint32_t x329; + fiat_p256_mulx_u32(&x328, &x329, x310, UINT32_C(0xffffffff)); + uint32_t x330; + uint32_t x331; + fiat_p256_mulx_u32(&x330, &x331, x310, UINT32_C(0xffffffff)); + uint32_t x332; + uint32_t x333; + fiat_p256_mulx_u32(&x332, &x333, x310, UINT32_C(0xffffffff)); + uint32_t x334; + fiat_p256_uint1 x335; + fiat_p256_addcarryx_u32(&x334, &x335, 0x0, x330, x333); + uint32_t x336; + fiat_p256_uint1 x337; + fiat_p256_addcarryx_u32(&x336, &x337, x335, x328, x331); + uint32_t x338; + fiat_p256_uint1 x339; + fiat_p256_addcarryx_u32(&x338, &x339, 0x0, x332, x310); + uint32_t x340; + fiat_p256_uint1 x341; + fiat_p256_addcarryx_u32(&x340, &x341, x339, x334, x312); + uint32_t x342; + fiat_p256_uint1 x343; + fiat_p256_addcarryx_u32(&x342, &x343, x341, x336, x314); + uint32_t x344; + fiat_p256_uint1 x345; + fiat_p256_addcarryx_u32(&x344, &x345, x337, 0x0, x329); + uint32_t x346; + fiat_p256_uint1 x347; + fiat_p256_addcarryx_u32(&x346, &x347, x343, x344, x316); + uint32_t x348; + fiat_p256_uint1 x349; + fiat_p256_addcarryx_u32(&x348, &x349, x347, 0x0, x318); + uint32_t x350; + fiat_p256_uint1 x351; + fiat_p256_addcarryx_u32(&x350, &x351, x349, 0x0, x320); + uint32_t x352; + fiat_p256_uint1 x353; + fiat_p256_addcarryx_u32(&x352, &x353, x351, x310, x322); + uint32_t x354; + fiat_p256_uint1 x355; + fiat_p256_addcarryx_u32(&x354, &x355, x353, x326, x324); + uint32_t x356; + fiat_p256_uint1 x357; + fiat_p256_addcarryx_u32(&x356, &x357, x309, 0x0, 0x0); + uint32_t x358; + fiat_p256_uint1 x359; + fiat_p256_addcarryx_u32(&x358, &x359, x325, 0x0, (fiat_p256_uint1)x356); + uint32_t x360; + fiat_p256_uint1 x361; + fiat_p256_addcarryx_u32(&x360, &x361, x355, x327, x358); + uint32_t x362; + fiat_p256_uint1 x363; + fiat_p256_subborrowx_u32(&x362, &x363, 0x0, x340, UINT32_C(0xffffffff)); + uint32_t x364; + fiat_p256_uint1 x365; + fiat_p256_subborrowx_u32(&x364, &x365, x363, x342, UINT32_C(0xffffffff)); + uint32_t x366; + fiat_p256_uint1 x367; + fiat_p256_subborrowx_u32(&x366, &x367, x365, x346, UINT32_C(0xffffffff)); + uint32_t x368; + fiat_p256_uint1 x369; + fiat_p256_subborrowx_u32(&x368, &x369, x367, x348, 0x0); + uint32_t x370; + fiat_p256_uint1 x371; + fiat_p256_subborrowx_u32(&x370, &x371, x369, x350, 0x0); + uint32_t x372; + fiat_p256_uint1 x373; + fiat_p256_subborrowx_u32(&x372, &x373, x371, x352, 0x0); + uint32_t x374; + fiat_p256_uint1 x375; + fiat_p256_subborrowx_u32(&x374, &x375, x373, x354, 0x1); + uint32_t x376; + fiat_p256_uint1 x377; + fiat_p256_subborrowx_u32(&x376, &x377, x375, x360, UINT32_C(0xffffffff)); + uint32_t x378; + fiat_p256_uint1 x379; + fiat_p256_addcarryx_u32(&x378, &x379, x361, 0x0, 0x0); + uint32_t x380; + fiat_p256_uint1 x381; + fiat_p256_subborrowx_u32(&x380, &x381, x377, (fiat_p256_uint1)x378, 0x0); + uint32_t x382; + fiat_p256_cmovznz_u32(&x382, x381, x362, x340); + uint32_t x383; + fiat_p256_cmovznz_u32(&x383, x381, x364, x342); + uint32_t x384; + fiat_p256_cmovznz_u32(&x384, x381, x366, x346); + uint32_t x385; + fiat_p256_cmovznz_u32(&x385, x381, x368, x348); + uint32_t x386; + fiat_p256_cmovznz_u32(&x386, x381, x370, x350); + uint32_t x387; + fiat_p256_cmovznz_u32(&x387, x381, x372, x352); + uint32_t x388; + fiat_p256_cmovznz_u32(&x388, x381, x374, x354); + uint32_t x389; + fiat_p256_cmovznz_u32(&x389, x381, x376, x360); + out1[0] = x382; + out1[1] = x383; + out1[2] = x384; + out1[3] = x385; + out1[4] = x386; + out1[5] = x387; + out1[6] = x388; + out1[7] = x389; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [0x0 ~> 0xffffffff] + */ +static void fiat_p256_nonzero(uint32_t* out1, const uint32_t arg1[8]) { + uint32_t x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | ((arg1[4]) | ((arg1[5]) | ((arg1[6]) | ((arg1[7]) | (uint32_t)0x0)))))))); + *out1 = x1; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * arg3: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_selectznz(uint32_t out1[8], fiat_p256_uint1 arg1, const uint32_t arg2[8], const uint32_t arg3[8]) { + uint32_t x1; + fiat_p256_cmovznz_u32(&x1, arg1, (arg2[0]), (arg3[0])); + uint32_t x2; + fiat_p256_cmovznz_u32(&x2, arg1, (arg2[1]), (arg3[1])); + uint32_t x3; + fiat_p256_cmovznz_u32(&x3, arg1, (arg2[2]), (arg3[2])); + uint32_t x4; + fiat_p256_cmovznz_u32(&x4, arg1, (arg2[3]), (arg3[3])); + uint32_t x5; + fiat_p256_cmovznz_u32(&x5, arg1, (arg2[4]), (arg3[4])); + uint32_t x6; + fiat_p256_cmovznz_u32(&x6, arg1, (arg2[5]), (arg3[5])); + uint32_t x7; + fiat_p256_cmovznz_u32(&x7, arg1, (arg2[6]), (arg3[6])); + uint32_t x8; + fiat_p256_cmovznz_u32(&x8, arg1, (arg2[7]), (arg3[7])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; + out1[4] = x5; + out1[5] = x6; + out1[6] = x7; + out1[7] = x8; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + */ +static void fiat_p256_to_bytes(uint8_t out1[32], const uint32_t arg1[8]) { + uint32_t x1 = (arg1[7]); + uint32_t x2 = (arg1[6]); + uint32_t x3 = (arg1[5]); + uint32_t x4 = (arg1[4]); + uint32_t x5 = (arg1[3]); + uint32_t x6 = (arg1[2]); + uint32_t x7 = (arg1[1]); + uint32_t x8 = (arg1[0]); + uint32_t x9 = (x8 >> 8); + uint8_t x10 = (uint8_t)(x8 & UINT8_C(0xff)); + uint32_t x11 = (x9 >> 8); + uint8_t x12 = (uint8_t)(x9 & UINT8_C(0xff)); + uint8_t x13 = (uint8_t)(x11 >> 8); + uint8_t x14 = (uint8_t)(x11 & UINT8_C(0xff)); + uint8_t x15 = (uint8_t)(x13 & UINT8_C(0xff)); + uint32_t x16 = (x7 >> 8); + uint8_t x17 = (uint8_t)(x7 & UINT8_C(0xff)); + uint32_t x18 = (x16 >> 8); + uint8_t x19 = (uint8_t)(x16 & UINT8_C(0xff)); + uint8_t x20 = (uint8_t)(x18 >> 8); + uint8_t x21 = (uint8_t)(x18 & UINT8_C(0xff)); + uint8_t x22 = (uint8_t)(x20 & UINT8_C(0xff)); + uint32_t x23 = (x6 >> 8); + uint8_t x24 = (uint8_t)(x6 & UINT8_C(0xff)); + uint32_t x25 = (x23 >> 8); + uint8_t x26 = (uint8_t)(x23 & UINT8_C(0xff)); + uint8_t x27 = (uint8_t)(x25 >> 8); + uint8_t x28 = (uint8_t)(x25 & UINT8_C(0xff)); + uint8_t x29 = (uint8_t)(x27 & UINT8_C(0xff)); + uint32_t x30 = (x5 >> 8); + uint8_t x31 = (uint8_t)(x5 & UINT8_C(0xff)); + uint32_t x32 = (x30 >> 8); + uint8_t x33 = (uint8_t)(x30 & UINT8_C(0xff)); + uint8_t x34 = (uint8_t)(x32 >> 8); + uint8_t x35 = (uint8_t)(x32 & UINT8_C(0xff)); + uint8_t x36 = (uint8_t)(x34 & UINT8_C(0xff)); + uint32_t x37 = (x4 >> 8); + uint8_t x38 = (uint8_t)(x4 & UINT8_C(0xff)); + uint32_t x39 = (x37 >> 8); + uint8_t x40 = (uint8_t)(x37 & UINT8_C(0xff)); + uint8_t x41 = (uint8_t)(x39 >> 8); + uint8_t x42 = (uint8_t)(x39 & UINT8_C(0xff)); + uint8_t x43 = (uint8_t)(x41 & UINT8_C(0xff)); + uint32_t x44 = (x3 >> 8); + uint8_t x45 = (uint8_t)(x3 & UINT8_C(0xff)); + uint32_t x46 = (x44 >> 8); + uint8_t x47 = (uint8_t)(x44 & UINT8_C(0xff)); + uint8_t x48 = (uint8_t)(x46 >> 8); + uint8_t x49 = (uint8_t)(x46 & UINT8_C(0xff)); + uint8_t x50 = (uint8_t)(x48 & UINT8_C(0xff)); + uint32_t x51 = (x2 >> 8); + uint8_t x52 = (uint8_t)(x2 & UINT8_C(0xff)); + uint32_t x53 = (x51 >> 8); + uint8_t x54 = (uint8_t)(x51 & UINT8_C(0xff)); + uint8_t x55 = (uint8_t)(x53 >> 8); + uint8_t x56 = (uint8_t)(x53 & UINT8_C(0xff)); + uint8_t x57 = (uint8_t)(x55 & UINT8_C(0xff)); + uint32_t x58 = (x1 >> 8); + uint8_t x59 = (uint8_t)(x1 & UINT8_C(0xff)); + uint32_t x60 = (x58 >> 8); + uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); + uint8_t x62 = (uint8_t)(x60 >> 8); + uint8_t x63 = (uint8_t)(x60 & UINT8_C(0xff)); + out1[0] = x10; + out1[1] = x12; + out1[2] = x14; + out1[3] = x15; + out1[4] = x17; + out1[5] = x19; + out1[6] = x21; + out1[7] = x22; + out1[8] = x24; + out1[9] = x26; + out1[10] = x28; + out1[11] = x29; + out1[12] = x31; + out1[13] = x33; + out1[14] = x35; + out1[15] = x36; + out1[16] = x38; + out1[17] = x40; + out1[18] = x42; + out1[19] = x43; + out1[20] = x45; + out1[21] = x47; + out1[22] = x49; + out1[23] = x50; + out1[24] = x52; + out1[25] = x54; + out1[26] = x56; + out1[27] = x57; + out1[28] = x59; + out1[29] = x61; + out1[30] = x63; + out1[31] = x62; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff], [0x0 ~> 0xffffffff]] + */ +static void fiat_p256_from_bytes(uint32_t out1[8], const uint8_t arg1[32]) { + uint32_t x1 = ((uint32_t)(arg1[31]) << 24); + uint32_t x2 = ((uint32_t)(arg1[30]) << 16); + uint32_t x3 = ((uint32_t)(arg1[29]) << 8); + uint8_t x4 = (arg1[28]); + uint32_t x5 = ((uint32_t)(arg1[27]) << 24); + uint32_t x6 = ((uint32_t)(arg1[26]) << 16); + uint32_t x7 = ((uint32_t)(arg1[25]) << 8); + uint8_t x8 = (arg1[24]); + uint32_t x9 = ((uint32_t)(arg1[23]) << 24); + uint32_t x10 = ((uint32_t)(arg1[22]) << 16); + uint32_t x11 = ((uint32_t)(arg1[21]) << 8); + uint8_t x12 = (arg1[20]); + uint32_t x13 = ((uint32_t)(arg1[19]) << 24); + uint32_t x14 = ((uint32_t)(arg1[18]) << 16); + uint32_t x15 = ((uint32_t)(arg1[17]) << 8); + uint8_t x16 = (arg1[16]); + uint32_t x17 = ((uint32_t)(arg1[15]) << 24); + uint32_t x18 = ((uint32_t)(arg1[14]) << 16); + uint32_t x19 = ((uint32_t)(arg1[13]) << 8); + uint8_t x20 = (arg1[12]); + uint32_t x21 = ((uint32_t)(arg1[11]) << 24); + uint32_t x22 = ((uint32_t)(arg1[10]) << 16); + uint32_t x23 = ((uint32_t)(arg1[9]) << 8); + uint8_t x24 = (arg1[8]); + uint32_t x25 = ((uint32_t)(arg1[7]) << 24); + uint32_t x26 = ((uint32_t)(arg1[6]) << 16); + uint32_t x27 = ((uint32_t)(arg1[5]) << 8); + uint8_t x28 = (arg1[4]); + uint32_t x29 = ((uint32_t)(arg1[3]) << 24); + uint32_t x30 = ((uint32_t)(arg1[2]) << 16); + uint32_t x31 = ((uint32_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint32_t x33 = (x32 + (x31 + (x30 + x29))); + uint32_t x34 = (x33 & UINT32_C(0xffffffff)); + uint32_t x35 = (x4 + (x3 + (x2 + x1))); + uint32_t x36 = (x8 + (x7 + (x6 + x5))); + uint32_t x37 = (x12 + (x11 + (x10 + x9))); + uint32_t x38 = (x16 + (x15 + (x14 + x13))); + uint32_t x39 = (x20 + (x19 + (x18 + x17))); + uint32_t x40 = (x24 + (x23 + (x22 + x21))); + uint32_t x41 = (x28 + (x27 + (x26 + x25))); + uint32_t x42 = (x41 & UINT32_C(0xffffffff)); + uint32_t x43 = (x40 & UINT32_C(0xffffffff)); + uint32_t x44 = (x39 & UINT32_C(0xffffffff)); + uint32_t x45 = (x38 & UINT32_C(0xffffffff)); + uint32_t x46 = (x37 & UINT32_C(0xffffffff)); + uint32_t x47 = (x36 & UINT32_C(0xffffffff)); + out1[0] = x34; + out1[1] = x42; + out1[2] = x43; + out1[3] = x44; + out1[4] = x45; + out1[5] = x46; + out1[6] = x47; + out1[7] = x35; +} + diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h new file mode 100644 index 000000000..7d97e0a09 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h @@ -0,0 +1,1217 @@ +/* Autogenerated */ +/* curve description: p256 */ +/* requested operations: (all) */ +/* m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1") */ +/* machine_wordsize = 64 (from "64") */ +/* */ +/* NOTE: In addition to the bounds specified above each function, all */ +/* functions synthesized for this Montgomery arithmetic require the */ +/* input to be strictly less than the prime modulus (m), and also */ +/* require the input to be in the unique saturated representation. */ +/* All functions also ensure that these two properties are true of */ +/* return values. */ + +#include +typedef unsigned char fiat_p256_uint1; +typedef signed char fiat_p256_int1; +typedef signed __int128 fiat_p256_int128; +typedef unsigned __int128 fiat_p256_uint128; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_addcarryx_u64(uint64_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_p256_uint128 x1 = ((arg1 + (fiat_p256_uint128)arg2) + arg3); + uint64_t x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff)); + fiat_p256_uint1 x3 = (fiat_p256_uint1)(x1 >> 64); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_subborrowx_u64(uint64_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_p256_int128 x1 = ((arg2 - (fiat_p256_int128)arg1) - arg3); + fiat_p256_int1 x2 = (fiat_p256_int1)(x1 >> 64); + uint64_t x3 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff)); + *out1 = x3; + *out2 = (fiat_p256_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0xffffffffffffffff] + * arg2: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + * out2: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_p256_mulx_u64(uint64_t* out1, uint64_t* out2, uint64_t arg1, uint64_t arg2) { + fiat_p256_uint128 x1 = ((fiat_p256_uint128)arg1 * arg2); + uint64_t x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff)); + uint64_t x3 = (uint64_t)(x1 >> 64); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_p256_cmovznz_u64(uint64_t* out1, fiat_p256_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_p256_uint1 x1 = (!(!arg1)); + uint64_t x2 = ((fiat_p256_int1)(0x0 - x1) & UINT64_C(0xffffffffffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint64_t x3 = ((value_barrier_u64(x2) & arg3) | (value_barrier_u64(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_mul(uint64_t out1[4], const uint64_t arg1[4], const uint64_t arg2[4]) { + uint64_t x1 = (arg1[1]); + uint64_t x2 = (arg1[2]); + uint64_t x3 = (arg1[3]); + uint64_t x4 = (arg1[0]); + uint64_t x5; + uint64_t x6; + fiat_p256_mulx_u64(&x5, &x6, x4, (arg2[3])); + uint64_t x7; + uint64_t x8; + fiat_p256_mulx_u64(&x7, &x8, x4, (arg2[2])); + uint64_t x9; + uint64_t x10; + fiat_p256_mulx_u64(&x9, &x10, x4, (arg2[1])); + uint64_t x11; + uint64_t x12; + fiat_p256_mulx_u64(&x11, &x12, x4, (arg2[0])); + uint64_t x13; + fiat_p256_uint1 x14; + fiat_p256_addcarryx_u64(&x13, &x14, 0x0, x9, x12); + uint64_t x15; + fiat_p256_uint1 x16; + fiat_p256_addcarryx_u64(&x15, &x16, x14, x7, x10); + uint64_t x17; + fiat_p256_uint1 x18; + fiat_p256_addcarryx_u64(&x17, &x18, x16, x5, x8); + uint64_t x19; + fiat_p256_uint1 x20; + fiat_p256_addcarryx_u64(&x19, &x20, x18, 0x0, x6); + uint64_t x21; + uint64_t x22; + fiat_p256_mulx_u64(&x21, &x22, x11, UINT64_C(0xffffffff00000001)); + uint64_t x23; + uint64_t x24; + fiat_p256_mulx_u64(&x23, &x24, x11, UINT32_C(0xffffffff)); + uint64_t x25; + uint64_t x26; + fiat_p256_mulx_u64(&x25, &x26, x11, UINT64_C(0xffffffffffffffff)); + uint64_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u64(&x27, &x28, 0x0, x23, x26); + uint64_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u64(&x29, &x30, x28, 0x0, x24); + uint64_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u64(&x31, &x32, 0x0, x25, x11); + uint64_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u64(&x33, &x34, x32, x27, x13); + uint64_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u64(&x35, &x36, x34, x29, x15); + uint64_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u64(&x37, &x38, x36, x21, x17); + uint64_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u64(&x39, &x40, x38, x22, x19); + uint64_t x41; + fiat_p256_uint1 x42; + fiat_p256_addcarryx_u64(&x41, &x42, x40, 0x0, 0x0); + uint64_t x43; + uint64_t x44; + fiat_p256_mulx_u64(&x43, &x44, x1, (arg2[3])); + uint64_t x45; + uint64_t x46; + fiat_p256_mulx_u64(&x45, &x46, x1, (arg2[2])); + uint64_t x47; + uint64_t x48; + fiat_p256_mulx_u64(&x47, &x48, x1, (arg2[1])); + uint64_t x49; + uint64_t x50; + fiat_p256_mulx_u64(&x49, &x50, x1, (arg2[0])); + uint64_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u64(&x51, &x52, 0x0, x47, x50); + uint64_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u64(&x53, &x54, x52, x45, x48); + uint64_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u64(&x55, &x56, x54, x43, x46); + uint64_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u64(&x57, &x58, x56, 0x0, x44); + uint64_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u64(&x59, &x60, 0x0, x49, x33); + uint64_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u64(&x61, &x62, x60, x51, x35); + uint64_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u64(&x63, &x64, x62, x53, x37); + uint64_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u64(&x65, &x66, x64, x55, x39); + uint64_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u64(&x67, &x68, x66, x57, (fiat_p256_uint1)x41); + uint64_t x69; + uint64_t x70; + fiat_p256_mulx_u64(&x69, &x70, x59, UINT64_C(0xffffffff00000001)); + uint64_t x71; + uint64_t x72; + fiat_p256_mulx_u64(&x71, &x72, x59, UINT32_C(0xffffffff)); + uint64_t x73; + uint64_t x74; + fiat_p256_mulx_u64(&x73, &x74, x59, UINT64_C(0xffffffffffffffff)); + uint64_t x75; + fiat_p256_uint1 x76; + fiat_p256_addcarryx_u64(&x75, &x76, 0x0, x71, x74); + uint64_t x77; + fiat_p256_uint1 x78; + fiat_p256_addcarryx_u64(&x77, &x78, x76, 0x0, x72); + uint64_t x79; + fiat_p256_uint1 x80; + fiat_p256_addcarryx_u64(&x79, &x80, 0x0, x73, x59); + uint64_t x81; + fiat_p256_uint1 x82; + fiat_p256_addcarryx_u64(&x81, &x82, x80, x75, x61); + uint64_t x83; + fiat_p256_uint1 x84; + fiat_p256_addcarryx_u64(&x83, &x84, x82, x77, x63); + uint64_t x85; + fiat_p256_uint1 x86; + fiat_p256_addcarryx_u64(&x85, &x86, x84, x69, x65); + uint64_t x87; + fiat_p256_uint1 x88; + fiat_p256_addcarryx_u64(&x87, &x88, x86, x70, x67); + uint64_t x89; + fiat_p256_uint1 x90; + fiat_p256_addcarryx_u64(&x89, &x90, x88, 0x0, x68); + uint64_t x91; + uint64_t x92; + fiat_p256_mulx_u64(&x91, &x92, x2, (arg2[3])); + uint64_t x93; + uint64_t x94; + fiat_p256_mulx_u64(&x93, &x94, x2, (arg2[2])); + uint64_t x95; + uint64_t x96; + fiat_p256_mulx_u64(&x95, &x96, x2, (arg2[1])); + uint64_t x97; + uint64_t x98; + fiat_p256_mulx_u64(&x97, &x98, x2, (arg2[0])); + uint64_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u64(&x99, &x100, 0x0, x95, x98); + uint64_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u64(&x101, &x102, x100, x93, x96); + uint64_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u64(&x103, &x104, x102, x91, x94); + uint64_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u64(&x105, &x106, x104, 0x0, x92); + uint64_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u64(&x107, &x108, 0x0, x97, x81); + uint64_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u64(&x109, &x110, x108, x99, x83); + uint64_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u64(&x111, &x112, x110, x101, x85); + uint64_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u64(&x113, &x114, x112, x103, x87); + uint64_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u64(&x115, &x116, x114, x105, x89); + uint64_t x117; + uint64_t x118; + fiat_p256_mulx_u64(&x117, &x118, x107, UINT64_C(0xffffffff00000001)); + uint64_t x119; + uint64_t x120; + fiat_p256_mulx_u64(&x119, &x120, x107, UINT32_C(0xffffffff)); + uint64_t x121; + uint64_t x122; + fiat_p256_mulx_u64(&x121, &x122, x107, UINT64_C(0xffffffffffffffff)); + uint64_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u64(&x123, &x124, 0x0, x119, x122); + uint64_t x125; + fiat_p256_uint1 x126; + fiat_p256_addcarryx_u64(&x125, &x126, x124, 0x0, x120); + uint64_t x127; + fiat_p256_uint1 x128; + fiat_p256_addcarryx_u64(&x127, &x128, 0x0, x121, x107); + uint64_t x129; + fiat_p256_uint1 x130; + fiat_p256_addcarryx_u64(&x129, &x130, x128, x123, x109); + uint64_t x131; + fiat_p256_uint1 x132; + fiat_p256_addcarryx_u64(&x131, &x132, x130, x125, x111); + uint64_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u64(&x133, &x134, x132, x117, x113); + uint64_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u64(&x135, &x136, x134, x118, x115); + uint64_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u64(&x137, &x138, x136, 0x0, x116); + uint64_t x139; + uint64_t x140; + fiat_p256_mulx_u64(&x139, &x140, x3, (arg2[3])); + uint64_t x141; + uint64_t x142; + fiat_p256_mulx_u64(&x141, &x142, x3, (arg2[2])); + uint64_t x143; + uint64_t x144; + fiat_p256_mulx_u64(&x143, &x144, x3, (arg2[1])); + uint64_t x145; + uint64_t x146; + fiat_p256_mulx_u64(&x145, &x146, x3, (arg2[0])); + uint64_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u64(&x147, &x148, 0x0, x143, x146); + uint64_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u64(&x149, &x150, x148, x141, x144); + uint64_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u64(&x151, &x152, x150, x139, x142); + uint64_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u64(&x153, &x154, x152, 0x0, x140); + uint64_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u64(&x155, &x156, 0x0, x145, x129); + uint64_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u64(&x157, &x158, x156, x147, x131); + uint64_t x159; + fiat_p256_uint1 x160; + fiat_p256_addcarryx_u64(&x159, &x160, x158, x149, x133); + uint64_t x161; + fiat_p256_uint1 x162; + fiat_p256_addcarryx_u64(&x161, &x162, x160, x151, x135); + uint64_t x163; + fiat_p256_uint1 x164; + fiat_p256_addcarryx_u64(&x163, &x164, x162, x153, x137); + uint64_t x165; + uint64_t x166; + fiat_p256_mulx_u64(&x165, &x166, x155, UINT64_C(0xffffffff00000001)); + uint64_t x167; + uint64_t x168; + fiat_p256_mulx_u64(&x167, &x168, x155, UINT32_C(0xffffffff)); + uint64_t x169; + uint64_t x170; + fiat_p256_mulx_u64(&x169, &x170, x155, UINT64_C(0xffffffffffffffff)); + uint64_t x171; + fiat_p256_uint1 x172; + fiat_p256_addcarryx_u64(&x171, &x172, 0x0, x167, x170); + uint64_t x173; + fiat_p256_uint1 x174; + fiat_p256_addcarryx_u64(&x173, &x174, x172, 0x0, x168); + uint64_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u64(&x175, &x176, 0x0, x169, x155); + uint64_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u64(&x177, &x178, x176, x171, x157); + uint64_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u64(&x179, &x180, x178, x173, x159); + uint64_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u64(&x181, &x182, x180, x165, x161); + uint64_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u64(&x183, &x184, x182, x166, x163); + uint64_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u64(&x185, &x186, x184, 0x0, x164); + uint64_t x187; + fiat_p256_uint1 x188; + fiat_p256_subborrowx_u64(&x187, &x188, 0x0, x177, UINT64_C(0xffffffffffffffff)); + uint64_t x189; + fiat_p256_uint1 x190; + fiat_p256_subborrowx_u64(&x189, &x190, x188, x179, UINT32_C(0xffffffff)); + uint64_t x191; + fiat_p256_uint1 x192; + fiat_p256_subborrowx_u64(&x191, &x192, x190, x181, 0x0); + uint64_t x193; + fiat_p256_uint1 x194; + fiat_p256_subborrowx_u64(&x193, &x194, x192, x183, UINT64_C(0xffffffff00000001)); + uint64_t x195; + fiat_p256_uint1 x196; + fiat_p256_subborrowx_u64(&x195, &x196, x194, x185, 0x0); + uint64_t x197; + fiat_p256_cmovznz_u64(&x197, x196, x187, x177); + uint64_t x198; + fiat_p256_cmovznz_u64(&x198, x196, x189, x179); + uint64_t x199; + fiat_p256_cmovznz_u64(&x199, x196, x191, x181); + uint64_t x200; + fiat_p256_cmovznz_u64(&x200, x196, x193, x183); + out1[0] = x197; + out1[1] = x198; + out1[2] = x199; + out1[3] = x200; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_square(uint64_t out1[4], const uint64_t arg1[4]) { + uint64_t x1 = (arg1[1]); + uint64_t x2 = (arg1[2]); + uint64_t x3 = (arg1[3]); + uint64_t x4 = (arg1[0]); + uint64_t x5; + uint64_t x6; + fiat_p256_mulx_u64(&x5, &x6, x4, (arg1[3])); + uint64_t x7; + uint64_t x8; + fiat_p256_mulx_u64(&x7, &x8, x4, (arg1[2])); + uint64_t x9; + uint64_t x10; + fiat_p256_mulx_u64(&x9, &x10, x4, (arg1[1])); + uint64_t x11; + uint64_t x12; + fiat_p256_mulx_u64(&x11, &x12, x4, (arg1[0])); + uint64_t x13; + fiat_p256_uint1 x14; + fiat_p256_addcarryx_u64(&x13, &x14, 0x0, x9, x12); + uint64_t x15; + fiat_p256_uint1 x16; + fiat_p256_addcarryx_u64(&x15, &x16, x14, x7, x10); + uint64_t x17; + fiat_p256_uint1 x18; + fiat_p256_addcarryx_u64(&x17, &x18, x16, x5, x8); + uint64_t x19; + fiat_p256_uint1 x20; + fiat_p256_addcarryx_u64(&x19, &x20, x18, 0x0, x6); + uint64_t x21; + uint64_t x22; + fiat_p256_mulx_u64(&x21, &x22, x11, UINT64_C(0xffffffff00000001)); + uint64_t x23; + uint64_t x24; + fiat_p256_mulx_u64(&x23, &x24, x11, UINT32_C(0xffffffff)); + uint64_t x25; + uint64_t x26; + fiat_p256_mulx_u64(&x25, &x26, x11, UINT64_C(0xffffffffffffffff)); + uint64_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u64(&x27, &x28, 0x0, x23, x26); + uint64_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u64(&x29, &x30, x28, 0x0, x24); + uint64_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u64(&x31, &x32, 0x0, x25, x11); + uint64_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u64(&x33, &x34, x32, x27, x13); + uint64_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u64(&x35, &x36, x34, x29, x15); + uint64_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u64(&x37, &x38, x36, x21, x17); + uint64_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u64(&x39, &x40, x38, x22, x19); + uint64_t x41; + fiat_p256_uint1 x42; + fiat_p256_addcarryx_u64(&x41, &x42, x40, 0x0, 0x0); + uint64_t x43; + uint64_t x44; + fiat_p256_mulx_u64(&x43, &x44, x1, (arg1[3])); + uint64_t x45; + uint64_t x46; + fiat_p256_mulx_u64(&x45, &x46, x1, (arg1[2])); + uint64_t x47; + uint64_t x48; + fiat_p256_mulx_u64(&x47, &x48, x1, (arg1[1])); + uint64_t x49; + uint64_t x50; + fiat_p256_mulx_u64(&x49, &x50, x1, (arg1[0])); + uint64_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u64(&x51, &x52, 0x0, x47, x50); + uint64_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u64(&x53, &x54, x52, x45, x48); + uint64_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u64(&x55, &x56, x54, x43, x46); + uint64_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u64(&x57, &x58, x56, 0x0, x44); + uint64_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u64(&x59, &x60, 0x0, x49, x33); + uint64_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u64(&x61, &x62, x60, x51, x35); + uint64_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u64(&x63, &x64, x62, x53, x37); + uint64_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u64(&x65, &x66, x64, x55, x39); + uint64_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u64(&x67, &x68, x66, x57, (fiat_p256_uint1)x41); + uint64_t x69; + uint64_t x70; + fiat_p256_mulx_u64(&x69, &x70, x59, UINT64_C(0xffffffff00000001)); + uint64_t x71; + uint64_t x72; + fiat_p256_mulx_u64(&x71, &x72, x59, UINT32_C(0xffffffff)); + uint64_t x73; + uint64_t x74; + fiat_p256_mulx_u64(&x73, &x74, x59, UINT64_C(0xffffffffffffffff)); + uint64_t x75; + fiat_p256_uint1 x76; + fiat_p256_addcarryx_u64(&x75, &x76, 0x0, x71, x74); + uint64_t x77; + fiat_p256_uint1 x78; + fiat_p256_addcarryx_u64(&x77, &x78, x76, 0x0, x72); + uint64_t x79; + fiat_p256_uint1 x80; + fiat_p256_addcarryx_u64(&x79, &x80, 0x0, x73, x59); + uint64_t x81; + fiat_p256_uint1 x82; + fiat_p256_addcarryx_u64(&x81, &x82, x80, x75, x61); + uint64_t x83; + fiat_p256_uint1 x84; + fiat_p256_addcarryx_u64(&x83, &x84, x82, x77, x63); + uint64_t x85; + fiat_p256_uint1 x86; + fiat_p256_addcarryx_u64(&x85, &x86, x84, x69, x65); + uint64_t x87; + fiat_p256_uint1 x88; + fiat_p256_addcarryx_u64(&x87, &x88, x86, x70, x67); + uint64_t x89; + fiat_p256_uint1 x90; + fiat_p256_addcarryx_u64(&x89, &x90, x88, 0x0, x68); + uint64_t x91; + uint64_t x92; + fiat_p256_mulx_u64(&x91, &x92, x2, (arg1[3])); + uint64_t x93; + uint64_t x94; + fiat_p256_mulx_u64(&x93, &x94, x2, (arg1[2])); + uint64_t x95; + uint64_t x96; + fiat_p256_mulx_u64(&x95, &x96, x2, (arg1[1])); + uint64_t x97; + uint64_t x98; + fiat_p256_mulx_u64(&x97, &x98, x2, (arg1[0])); + uint64_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u64(&x99, &x100, 0x0, x95, x98); + uint64_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u64(&x101, &x102, x100, x93, x96); + uint64_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u64(&x103, &x104, x102, x91, x94); + uint64_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u64(&x105, &x106, x104, 0x0, x92); + uint64_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u64(&x107, &x108, 0x0, x97, x81); + uint64_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u64(&x109, &x110, x108, x99, x83); + uint64_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u64(&x111, &x112, x110, x101, x85); + uint64_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u64(&x113, &x114, x112, x103, x87); + uint64_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u64(&x115, &x116, x114, x105, x89); + uint64_t x117; + uint64_t x118; + fiat_p256_mulx_u64(&x117, &x118, x107, UINT64_C(0xffffffff00000001)); + uint64_t x119; + uint64_t x120; + fiat_p256_mulx_u64(&x119, &x120, x107, UINT32_C(0xffffffff)); + uint64_t x121; + uint64_t x122; + fiat_p256_mulx_u64(&x121, &x122, x107, UINT64_C(0xffffffffffffffff)); + uint64_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u64(&x123, &x124, 0x0, x119, x122); + uint64_t x125; + fiat_p256_uint1 x126; + fiat_p256_addcarryx_u64(&x125, &x126, x124, 0x0, x120); + uint64_t x127; + fiat_p256_uint1 x128; + fiat_p256_addcarryx_u64(&x127, &x128, 0x0, x121, x107); + uint64_t x129; + fiat_p256_uint1 x130; + fiat_p256_addcarryx_u64(&x129, &x130, x128, x123, x109); + uint64_t x131; + fiat_p256_uint1 x132; + fiat_p256_addcarryx_u64(&x131, &x132, x130, x125, x111); + uint64_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u64(&x133, &x134, x132, x117, x113); + uint64_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u64(&x135, &x136, x134, x118, x115); + uint64_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u64(&x137, &x138, x136, 0x0, x116); + uint64_t x139; + uint64_t x140; + fiat_p256_mulx_u64(&x139, &x140, x3, (arg1[3])); + uint64_t x141; + uint64_t x142; + fiat_p256_mulx_u64(&x141, &x142, x3, (arg1[2])); + uint64_t x143; + uint64_t x144; + fiat_p256_mulx_u64(&x143, &x144, x3, (arg1[1])); + uint64_t x145; + uint64_t x146; + fiat_p256_mulx_u64(&x145, &x146, x3, (arg1[0])); + uint64_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u64(&x147, &x148, 0x0, x143, x146); + uint64_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u64(&x149, &x150, x148, x141, x144); + uint64_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u64(&x151, &x152, x150, x139, x142); + uint64_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u64(&x153, &x154, x152, 0x0, x140); + uint64_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u64(&x155, &x156, 0x0, x145, x129); + uint64_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u64(&x157, &x158, x156, x147, x131); + uint64_t x159; + fiat_p256_uint1 x160; + fiat_p256_addcarryx_u64(&x159, &x160, x158, x149, x133); + uint64_t x161; + fiat_p256_uint1 x162; + fiat_p256_addcarryx_u64(&x161, &x162, x160, x151, x135); + uint64_t x163; + fiat_p256_uint1 x164; + fiat_p256_addcarryx_u64(&x163, &x164, x162, x153, x137); + uint64_t x165; + uint64_t x166; + fiat_p256_mulx_u64(&x165, &x166, x155, UINT64_C(0xffffffff00000001)); + uint64_t x167; + uint64_t x168; + fiat_p256_mulx_u64(&x167, &x168, x155, UINT32_C(0xffffffff)); + uint64_t x169; + uint64_t x170; + fiat_p256_mulx_u64(&x169, &x170, x155, UINT64_C(0xffffffffffffffff)); + uint64_t x171; + fiat_p256_uint1 x172; + fiat_p256_addcarryx_u64(&x171, &x172, 0x0, x167, x170); + uint64_t x173; + fiat_p256_uint1 x174; + fiat_p256_addcarryx_u64(&x173, &x174, x172, 0x0, x168); + uint64_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u64(&x175, &x176, 0x0, x169, x155); + uint64_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u64(&x177, &x178, x176, x171, x157); + uint64_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u64(&x179, &x180, x178, x173, x159); + uint64_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u64(&x181, &x182, x180, x165, x161); + uint64_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u64(&x183, &x184, x182, x166, x163); + uint64_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u64(&x185, &x186, x184, 0x0, x164); + uint64_t x187; + fiat_p256_uint1 x188; + fiat_p256_subborrowx_u64(&x187, &x188, 0x0, x177, UINT64_C(0xffffffffffffffff)); + uint64_t x189; + fiat_p256_uint1 x190; + fiat_p256_subborrowx_u64(&x189, &x190, x188, x179, UINT32_C(0xffffffff)); + uint64_t x191; + fiat_p256_uint1 x192; + fiat_p256_subborrowx_u64(&x191, &x192, x190, x181, 0x0); + uint64_t x193; + fiat_p256_uint1 x194; + fiat_p256_subborrowx_u64(&x193, &x194, x192, x183, UINT64_C(0xffffffff00000001)); + uint64_t x195; + fiat_p256_uint1 x196; + fiat_p256_subborrowx_u64(&x195, &x196, x194, x185, 0x0); + uint64_t x197; + fiat_p256_cmovznz_u64(&x197, x196, x187, x177); + uint64_t x198; + fiat_p256_cmovznz_u64(&x198, x196, x189, x179); + uint64_t x199; + fiat_p256_cmovznz_u64(&x199, x196, x191, x181); + uint64_t x200; + fiat_p256_cmovznz_u64(&x200, x196, x193, x183); + out1[0] = x197; + out1[1] = x198; + out1[2] = x199; + out1[3] = x200; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_add(uint64_t out1[4], const uint64_t arg1[4], const uint64_t arg2[4]) { + uint64_t x1; + fiat_p256_uint1 x2; + fiat_p256_addcarryx_u64(&x1, &x2, 0x0, (arg2[0]), (arg1[0])); + uint64_t x3; + fiat_p256_uint1 x4; + fiat_p256_addcarryx_u64(&x3, &x4, x2, (arg2[1]), (arg1[1])); + uint64_t x5; + fiat_p256_uint1 x6; + fiat_p256_addcarryx_u64(&x5, &x6, x4, (arg2[2]), (arg1[2])); + uint64_t x7; + fiat_p256_uint1 x8; + fiat_p256_addcarryx_u64(&x7, &x8, x6, (arg2[3]), (arg1[3])); + uint64_t x9; + fiat_p256_uint1 x10; + fiat_p256_subborrowx_u64(&x9, &x10, 0x0, x1, UINT64_C(0xffffffffffffffff)); + uint64_t x11; + fiat_p256_uint1 x12; + fiat_p256_subborrowx_u64(&x11, &x12, x10, x3, UINT32_C(0xffffffff)); + uint64_t x13; + fiat_p256_uint1 x14; + fiat_p256_subborrowx_u64(&x13, &x14, x12, x5, 0x0); + uint64_t x15; + fiat_p256_uint1 x16; + fiat_p256_subborrowx_u64(&x15, &x16, x14, x7, UINT64_C(0xffffffff00000001)); + uint64_t x17; + fiat_p256_uint1 x18; + fiat_p256_subborrowx_u64(&x17, &x18, x16, x8, 0x0); + uint64_t x19; + fiat_p256_cmovznz_u64(&x19, x18, x9, x1); + uint64_t x20; + fiat_p256_cmovznz_u64(&x20, x18, x11, x3); + uint64_t x21; + fiat_p256_cmovznz_u64(&x21, x18, x13, x5); + uint64_t x22; + fiat_p256_cmovznz_u64(&x22, x18, x15, x7); + out1[0] = x19; + out1[1] = x20; + out1[2] = x21; + out1[3] = x22; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_sub(uint64_t out1[4], const uint64_t arg1[4], const uint64_t arg2[4]) { + uint64_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u64(&x1, &x2, 0x0, (arg1[0]), (arg2[0])); + uint64_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u64(&x3, &x4, x2, (arg1[1]), (arg2[1])); + uint64_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u64(&x5, &x6, x4, (arg1[2]), (arg2[2])); + uint64_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u64(&x7, &x8, x6, (arg1[3]), (arg2[3])); + uint64_t x9; + fiat_p256_cmovznz_u64(&x9, x8, 0x0, UINT64_C(0xffffffffffffffff)); + uint64_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u64(&x10, &x11, 0x0, (x9 & UINT64_C(0xffffffffffffffff)), x1); + uint64_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u64(&x12, &x13, x11, (x9 & UINT32_C(0xffffffff)), x3); + uint64_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u64(&x14, &x15, x13, 0x0, x5); + uint64_t x16; + fiat_p256_uint1 x17; + fiat_p256_addcarryx_u64(&x16, &x17, x15, (x9 & UINT64_C(0xffffffff00000001)), x7); + out1[0] = x10; + out1[1] = x12; + out1[2] = x14; + out1[3] = x16; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_opp(uint64_t out1[4], const uint64_t arg1[4]) { + uint64_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u64(&x1, &x2, 0x0, 0x0, (arg1[0])); + uint64_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u64(&x3, &x4, x2, 0x0, (arg1[1])); + uint64_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u64(&x5, &x6, x4, 0x0, (arg1[2])); + uint64_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u64(&x7, &x8, x6, 0x0, (arg1[3])); + uint64_t x9; + fiat_p256_cmovznz_u64(&x9, x8, 0x0, UINT64_C(0xffffffffffffffff)); + uint64_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u64(&x10, &x11, 0x0, (x9 & UINT64_C(0xffffffffffffffff)), x1); + uint64_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u64(&x12, &x13, x11, (x9 & UINT32_C(0xffffffff)), x3); + uint64_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u64(&x14, &x15, x13, 0x0, x5); + uint64_t x16; + fiat_p256_uint1 x17; + fiat_p256_addcarryx_u64(&x16, &x17, x15, (x9 & UINT64_C(0xffffffff00000001)), x7); + out1[0] = x10; + out1[1] = x12; + out1[2] = x14; + out1[3] = x16; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_from_montgomery(uint64_t out1[4], const uint64_t arg1[4]) { + uint64_t x1 = (arg1[0]); + uint64_t x2; + uint64_t x3; + fiat_p256_mulx_u64(&x2, &x3, x1, UINT64_C(0xffffffff00000001)); + uint64_t x4; + uint64_t x5; + fiat_p256_mulx_u64(&x4, &x5, x1, UINT32_C(0xffffffff)); + uint64_t x6; + uint64_t x7; + fiat_p256_mulx_u64(&x6, &x7, x1, UINT64_C(0xffffffffffffffff)); + uint64_t x8; + fiat_p256_uint1 x9; + fiat_p256_addcarryx_u64(&x8, &x9, 0x0, x4, x7); + uint64_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u64(&x10, &x11, 0x0, x6, x1); + uint64_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u64(&x12, &x13, x11, x8, 0x0); + uint64_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u64(&x14, &x15, 0x0, (arg1[1]), x12); + uint64_t x16; + uint64_t x17; + fiat_p256_mulx_u64(&x16, &x17, x14, UINT64_C(0xffffffff00000001)); + uint64_t x18; + uint64_t x19; + fiat_p256_mulx_u64(&x18, &x19, x14, UINT32_C(0xffffffff)); + uint64_t x20; + uint64_t x21; + fiat_p256_mulx_u64(&x20, &x21, x14, UINT64_C(0xffffffffffffffff)); + uint64_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u64(&x22, &x23, 0x0, x18, x21); + uint64_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u64(&x24, &x25, x9, 0x0, x5); + uint64_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u64(&x26, &x27, x13, x24, 0x0); + uint64_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u64(&x28, &x29, x15, 0x0, x26); + uint64_t x30; + fiat_p256_uint1 x31; + fiat_p256_addcarryx_u64(&x30, &x31, 0x0, x20, x14); + uint64_t x32; + fiat_p256_uint1 x33; + fiat_p256_addcarryx_u64(&x32, &x33, x31, x22, x28); + uint64_t x34; + fiat_p256_uint1 x35; + fiat_p256_addcarryx_u64(&x34, &x35, x23, 0x0, x19); + uint64_t x36; + fiat_p256_uint1 x37; + fiat_p256_addcarryx_u64(&x36, &x37, x33, x34, x2); + uint64_t x38; + fiat_p256_uint1 x39; + fiat_p256_addcarryx_u64(&x38, &x39, x37, x16, x3); + uint64_t x40; + fiat_p256_uint1 x41; + fiat_p256_addcarryx_u64(&x40, &x41, 0x0, (arg1[2]), x32); + uint64_t x42; + fiat_p256_uint1 x43; + fiat_p256_addcarryx_u64(&x42, &x43, x41, 0x0, x36); + uint64_t x44; + fiat_p256_uint1 x45; + fiat_p256_addcarryx_u64(&x44, &x45, x43, 0x0, x38); + uint64_t x46; + uint64_t x47; + fiat_p256_mulx_u64(&x46, &x47, x40, UINT64_C(0xffffffff00000001)); + uint64_t x48; + uint64_t x49; + fiat_p256_mulx_u64(&x48, &x49, x40, UINT32_C(0xffffffff)); + uint64_t x50; + uint64_t x51; + fiat_p256_mulx_u64(&x50, &x51, x40, UINT64_C(0xffffffffffffffff)); + uint64_t x52; + fiat_p256_uint1 x53; + fiat_p256_addcarryx_u64(&x52, &x53, 0x0, x48, x51); + uint64_t x54; + fiat_p256_uint1 x55; + fiat_p256_addcarryx_u64(&x54, &x55, 0x0, x50, x40); + uint64_t x56; + fiat_p256_uint1 x57; + fiat_p256_addcarryx_u64(&x56, &x57, x55, x52, x42); + uint64_t x58; + fiat_p256_uint1 x59; + fiat_p256_addcarryx_u64(&x58, &x59, x53, 0x0, x49); + uint64_t x60; + fiat_p256_uint1 x61; + fiat_p256_addcarryx_u64(&x60, &x61, x57, x58, x44); + uint64_t x62; + fiat_p256_uint1 x63; + fiat_p256_addcarryx_u64(&x62, &x63, x39, x17, 0x0); + uint64_t x64; + fiat_p256_uint1 x65; + fiat_p256_addcarryx_u64(&x64, &x65, x45, 0x0, x62); + uint64_t x66; + fiat_p256_uint1 x67; + fiat_p256_addcarryx_u64(&x66, &x67, x61, x46, x64); + uint64_t x68; + fiat_p256_uint1 x69; + fiat_p256_addcarryx_u64(&x68, &x69, 0x0, (arg1[3]), x56); + uint64_t x70; + fiat_p256_uint1 x71; + fiat_p256_addcarryx_u64(&x70, &x71, x69, 0x0, x60); + uint64_t x72; + fiat_p256_uint1 x73; + fiat_p256_addcarryx_u64(&x72, &x73, x71, 0x0, x66); + uint64_t x74; + uint64_t x75; + fiat_p256_mulx_u64(&x74, &x75, x68, UINT64_C(0xffffffff00000001)); + uint64_t x76; + uint64_t x77; + fiat_p256_mulx_u64(&x76, &x77, x68, UINT32_C(0xffffffff)); + uint64_t x78; + uint64_t x79; + fiat_p256_mulx_u64(&x78, &x79, x68, UINT64_C(0xffffffffffffffff)); + uint64_t x80; + fiat_p256_uint1 x81; + fiat_p256_addcarryx_u64(&x80, &x81, 0x0, x76, x79); + uint64_t x82; + fiat_p256_uint1 x83; + fiat_p256_addcarryx_u64(&x82, &x83, 0x0, x78, x68); + uint64_t x84; + fiat_p256_uint1 x85; + fiat_p256_addcarryx_u64(&x84, &x85, x83, x80, x70); + uint64_t x86; + fiat_p256_uint1 x87; + fiat_p256_addcarryx_u64(&x86, &x87, x81, 0x0, x77); + uint64_t x88; + fiat_p256_uint1 x89; + fiat_p256_addcarryx_u64(&x88, &x89, x85, x86, x72); + uint64_t x90; + fiat_p256_uint1 x91; + fiat_p256_addcarryx_u64(&x90, &x91, x67, x47, 0x0); + uint64_t x92; + fiat_p256_uint1 x93; + fiat_p256_addcarryx_u64(&x92, &x93, x73, 0x0, x90); + uint64_t x94; + fiat_p256_uint1 x95; + fiat_p256_addcarryx_u64(&x94, &x95, x89, x74, x92); + uint64_t x96; + fiat_p256_uint1 x97; + fiat_p256_addcarryx_u64(&x96, &x97, x95, x75, 0x0); + uint64_t x98; + fiat_p256_uint1 x99; + fiat_p256_subborrowx_u64(&x98, &x99, 0x0, x84, UINT64_C(0xffffffffffffffff)); + uint64_t x100; + fiat_p256_uint1 x101; + fiat_p256_subborrowx_u64(&x100, &x101, x99, x88, UINT32_C(0xffffffff)); + uint64_t x102; + fiat_p256_uint1 x103; + fiat_p256_subborrowx_u64(&x102, &x103, x101, x94, 0x0); + uint64_t x104; + fiat_p256_uint1 x105; + fiat_p256_subborrowx_u64(&x104, &x105, x103, x96, UINT64_C(0xffffffff00000001)); + uint64_t x106; + fiat_p256_uint1 x107; + fiat_p256_subborrowx_u64(&x106, &x107, x105, 0x0, 0x0); + uint64_t x108; + fiat_p256_cmovznz_u64(&x108, x107, x98, x84); + uint64_t x109; + fiat_p256_cmovznz_u64(&x109, x107, x100, x88); + uint64_t x110; + fiat_p256_cmovznz_u64(&x110, x107, x102, x94); + uint64_t x111; + fiat_p256_cmovznz_u64(&x111, x107, x104, x96); + out1[0] = x108; + out1[1] = x109; + out1[2] = x110; + out1[3] = x111; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_p256_nonzero(uint64_t* out1, const uint64_t arg1[4]) { + uint64_t x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | (uint64_t)0x0)))); + *out1 = x1; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_selectznz(uint64_t out1[4], fiat_p256_uint1 arg1, const uint64_t arg2[4], const uint64_t arg3[4]) { + uint64_t x1; + fiat_p256_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0])); + uint64_t x2; + fiat_p256_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1])); + uint64_t x3; + fiat_p256_cmovznz_u64(&x3, arg1, (arg2[2]), (arg3[2])); + uint64_t x4; + fiat_p256_cmovznz_u64(&x4, arg1, (arg2[3]), (arg3[3])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + */ +static void fiat_p256_to_bytes(uint8_t out1[32], const uint64_t arg1[4]) { + uint64_t x1 = (arg1[3]); + uint64_t x2 = (arg1[2]); + uint64_t x3 = (arg1[1]); + uint64_t x4 = (arg1[0]); + uint64_t x5 = (x4 >> 8); + uint8_t x6 = (uint8_t)(x4 & UINT8_C(0xff)); + uint64_t x7 = (x5 >> 8); + uint8_t x8 = (uint8_t)(x5 & UINT8_C(0xff)); + uint64_t x9 = (x7 >> 8); + uint8_t x10 = (uint8_t)(x7 & UINT8_C(0xff)); + uint64_t x11 = (x9 >> 8); + uint8_t x12 = (uint8_t)(x9 & UINT8_C(0xff)); + uint64_t x13 = (x11 >> 8); + uint8_t x14 = (uint8_t)(x11 & UINT8_C(0xff)); + uint64_t x15 = (x13 >> 8); + uint8_t x16 = (uint8_t)(x13 & UINT8_C(0xff)); + uint8_t x17 = (uint8_t)(x15 >> 8); + uint8_t x18 = (uint8_t)(x15 & UINT8_C(0xff)); + uint8_t x19 = (uint8_t)(x17 & UINT8_C(0xff)); + uint64_t x20 = (x3 >> 8); + uint8_t x21 = (uint8_t)(x3 & UINT8_C(0xff)); + uint64_t x22 = (x20 >> 8); + uint8_t x23 = (uint8_t)(x20 & UINT8_C(0xff)); + uint64_t x24 = (x22 >> 8); + uint8_t x25 = (uint8_t)(x22 & UINT8_C(0xff)); + uint64_t x26 = (x24 >> 8); + uint8_t x27 = (uint8_t)(x24 & UINT8_C(0xff)); + uint64_t x28 = (x26 >> 8); + uint8_t x29 = (uint8_t)(x26 & UINT8_C(0xff)); + uint64_t x30 = (x28 >> 8); + uint8_t x31 = (uint8_t)(x28 & UINT8_C(0xff)); + uint8_t x32 = (uint8_t)(x30 >> 8); + uint8_t x33 = (uint8_t)(x30 & UINT8_C(0xff)); + uint8_t x34 = (uint8_t)(x32 & UINT8_C(0xff)); + uint64_t x35 = (x2 >> 8); + uint8_t x36 = (uint8_t)(x2 & UINT8_C(0xff)); + uint64_t x37 = (x35 >> 8); + uint8_t x38 = (uint8_t)(x35 & UINT8_C(0xff)); + uint64_t x39 = (x37 >> 8); + uint8_t x40 = (uint8_t)(x37 & UINT8_C(0xff)); + uint64_t x41 = (x39 >> 8); + uint8_t x42 = (uint8_t)(x39 & UINT8_C(0xff)); + uint64_t x43 = (x41 >> 8); + uint8_t x44 = (uint8_t)(x41 & UINT8_C(0xff)); + uint64_t x45 = (x43 >> 8); + uint8_t x46 = (uint8_t)(x43 & UINT8_C(0xff)); + uint8_t x47 = (uint8_t)(x45 >> 8); + uint8_t x48 = (uint8_t)(x45 & UINT8_C(0xff)); + uint8_t x49 = (uint8_t)(x47 & UINT8_C(0xff)); + uint64_t x50 = (x1 >> 8); + uint8_t x51 = (uint8_t)(x1 & UINT8_C(0xff)); + uint64_t x52 = (x50 >> 8); + uint8_t x53 = (uint8_t)(x50 & UINT8_C(0xff)); + uint64_t x54 = (x52 >> 8); + uint8_t x55 = (uint8_t)(x52 & UINT8_C(0xff)); + uint64_t x56 = (x54 >> 8); + uint8_t x57 = (uint8_t)(x54 & UINT8_C(0xff)); + uint64_t x58 = (x56 >> 8); + uint8_t x59 = (uint8_t)(x56 & UINT8_C(0xff)); + uint64_t x60 = (x58 >> 8); + uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); + uint8_t x62 = (uint8_t)(x60 >> 8); + uint8_t x63 = (uint8_t)(x60 & UINT8_C(0xff)); + out1[0] = x6; + out1[1] = x8; + out1[2] = x10; + out1[3] = x12; + out1[4] = x14; + out1[5] = x16; + out1[6] = x18; + out1[7] = x19; + out1[8] = x21; + out1[9] = x23; + out1[10] = x25; + out1[11] = x27; + out1[12] = x29; + out1[13] = x31; + out1[14] = x33; + out1[15] = x34; + out1[16] = x36; + out1[17] = x38; + out1[18] = x40; + out1[19] = x42; + out1[20] = x44; + out1[21] = x46; + out1[22] = x48; + out1[23] = x49; + out1[24] = x51; + out1[25] = x53; + out1[26] = x55; + out1[27] = x57; + out1[28] = x59; + out1[29] = x61; + out1[30] = x63; + out1[31] = x62; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_from_bytes(uint64_t out1[4], const uint8_t arg1[32]) { + uint64_t x1 = ((uint64_t)(arg1[31]) << 56); + uint64_t x2 = ((uint64_t)(arg1[30]) << 48); + uint64_t x3 = ((uint64_t)(arg1[29]) << 40); + uint64_t x4 = ((uint64_t)(arg1[28]) << 32); + uint64_t x5 = ((uint64_t)(arg1[27]) << 24); + uint64_t x6 = ((uint64_t)(arg1[26]) << 16); + uint64_t x7 = ((uint64_t)(arg1[25]) << 8); + uint8_t x8 = (arg1[24]); + uint64_t x9 = ((uint64_t)(arg1[23]) << 56); + uint64_t x10 = ((uint64_t)(arg1[22]) << 48); + uint64_t x11 = ((uint64_t)(arg1[21]) << 40); + uint64_t x12 = ((uint64_t)(arg1[20]) << 32); + uint64_t x13 = ((uint64_t)(arg1[19]) << 24); + uint64_t x14 = ((uint64_t)(arg1[18]) << 16); + uint64_t x15 = ((uint64_t)(arg1[17]) << 8); + uint8_t x16 = (arg1[16]); + uint64_t x17 = ((uint64_t)(arg1[15]) << 56); + uint64_t x18 = ((uint64_t)(arg1[14]) << 48); + uint64_t x19 = ((uint64_t)(arg1[13]) << 40); + uint64_t x20 = ((uint64_t)(arg1[12]) << 32); + uint64_t x21 = ((uint64_t)(arg1[11]) << 24); + uint64_t x22 = ((uint64_t)(arg1[10]) << 16); + uint64_t x23 = ((uint64_t)(arg1[9]) << 8); + uint8_t x24 = (arg1[8]); + uint64_t x25 = ((uint64_t)(arg1[7]) << 56); + uint64_t x26 = ((uint64_t)(arg1[6]) << 48); + uint64_t x27 = ((uint64_t)(arg1[5]) << 40); + uint64_t x28 = ((uint64_t)(arg1[4]) << 32); + uint64_t x29 = ((uint64_t)(arg1[3]) << 24); + uint64_t x30 = ((uint64_t)(arg1[2]) << 16); + uint64_t x31 = ((uint64_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint64_t x33 = (x32 + (x31 + (x30 + (x29 + (x28 + (x27 + (x26 + x25))))))); + uint64_t x34 = (x33 & UINT64_C(0xffffffffffffffff)); + uint64_t x35 = (x8 + (x7 + (x6 + (x5 + (x4 + (x3 + (x2 + x1))))))); + uint64_t x36 = (x16 + (x15 + (x14 + (x13 + (x12 + (x11 + (x10 + x9))))))); + uint64_t x37 = (x24 + (x23 + (x22 + (x21 + (x20 + (x19 + (x18 + x17))))))); + uint64_t x38 = (x37 & UINT64_C(0xffffffffffffffff)); + uint64_t x39 = (x36 & UINT64_C(0xffffffffffffffff)); + out1[0] = x34; + out1[1] = x38; + out1[2] = x39; + out1[3] = x35; +} + diff --git a/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h.grpc_back b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h.grpc_back new file mode 100644 index 000000000..7d97e0a09 --- /dev/null +++ b/Pods/BoringSSL-GRPC/src/third_party/fiat/p256_64.h.grpc_back @@ -0,0 +1,1217 @@ +/* Autogenerated */ +/* curve description: p256 */ +/* requested operations: (all) */ +/* m = 0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff (from "2^256 - 2^224 + 2^192 + 2^96 - 1") */ +/* machine_wordsize = 64 (from "64") */ +/* */ +/* NOTE: In addition to the bounds specified above each function, all */ +/* functions synthesized for this Montgomery arithmetic require the */ +/* input to be strictly less than the prime modulus (m), and also */ +/* require the input to be in the unique saturated representation. */ +/* All functions also ensure that these two properties are true of */ +/* return values. */ + +#include +typedef unsigned char fiat_p256_uint1; +typedef signed char fiat_p256_int1; +typedef signed __int128 fiat_p256_int128; +typedef unsigned __int128 fiat_p256_uint128; + + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_addcarryx_u64(uint64_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_p256_uint128 x1 = ((arg1 + (fiat_p256_uint128)arg2) + arg3); + uint64_t x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff)); + fiat_p256_uint1 x3 = (fiat_p256_uint1)(x1 >> 64); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + * out2: [0x0 ~> 0x1] + */ +static void fiat_p256_subborrowx_u64(uint64_t* out1, fiat_p256_uint1* out2, fiat_p256_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_p256_int128 x1 = ((arg2 - (fiat_p256_int128)arg1) - arg3); + fiat_p256_int1 x2 = (fiat_p256_int1)(x1 >> 64); + uint64_t x3 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff)); + *out1 = x3; + *out2 = (fiat_p256_uint1)(0x0 - x2); +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0xffffffffffffffff] + * arg2: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + * out2: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_p256_mulx_u64(uint64_t* out1, uint64_t* out2, uint64_t arg1, uint64_t arg2) { + fiat_p256_uint128 x1 = ((fiat_p256_uint128)arg1 * arg2); + uint64_t x2 = (uint64_t)(x1 & UINT64_C(0xffffffffffffffff)); + uint64_t x3 = (uint64_t)(x1 >> 64); + *out1 = x2; + *out2 = x3; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [0x0 ~> 0xffffffffffffffff] + * arg3: [0x0 ~> 0xffffffffffffffff] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_p256_cmovznz_u64(uint64_t* out1, fiat_p256_uint1 arg1, uint64_t arg2, uint64_t arg3) { + fiat_p256_uint1 x1 = (!(!arg1)); + uint64_t x2 = ((fiat_p256_int1)(0x0 - x1) & UINT64_C(0xffffffffffffffff)); + // Note this line has been patched from the synthesized code to add value + // barriers. + // + // Clang recognizes this pattern as a select. While it usually transforms it + // to a cmov, it sometimes further transforms it into a branch, which we do + // not want. + uint64_t x3 = ((value_barrier_u64(x2) & arg3) | (value_barrier_u64(~x2) & arg2)); + *out1 = x3; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_mul(uint64_t out1[4], const uint64_t arg1[4], const uint64_t arg2[4]) { + uint64_t x1 = (arg1[1]); + uint64_t x2 = (arg1[2]); + uint64_t x3 = (arg1[3]); + uint64_t x4 = (arg1[0]); + uint64_t x5; + uint64_t x6; + fiat_p256_mulx_u64(&x5, &x6, x4, (arg2[3])); + uint64_t x7; + uint64_t x8; + fiat_p256_mulx_u64(&x7, &x8, x4, (arg2[2])); + uint64_t x9; + uint64_t x10; + fiat_p256_mulx_u64(&x9, &x10, x4, (arg2[1])); + uint64_t x11; + uint64_t x12; + fiat_p256_mulx_u64(&x11, &x12, x4, (arg2[0])); + uint64_t x13; + fiat_p256_uint1 x14; + fiat_p256_addcarryx_u64(&x13, &x14, 0x0, x9, x12); + uint64_t x15; + fiat_p256_uint1 x16; + fiat_p256_addcarryx_u64(&x15, &x16, x14, x7, x10); + uint64_t x17; + fiat_p256_uint1 x18; + fiat_p256_addcarryx_u64(&x17, &x18, x16, x5, x8); + uint64_t x19; + fiat_p256_uint1 x20; + fiat_p256_addcarryx_u64(&x19, &x20, x18, 0x0, x6); + uint64_t x21; + uint64_t x22; + fiat_p256_mulx_u64(&x21, &x22, x11, UINT64_C(0xffffffff00000001)); + uint64_t x23; + uint64_t x24; + fiat_p256_mulx_u64(&x23, &x24, x11, UINT32_C(0xffffffff)); + uint64_t x25; + uint64_t x26; + fiat_p256_mulx_u64(&x25, &x26, x11, UINT64_C(0xffffffffffffffff)); + uint64_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u64(&x27, &x28, 0x0, x23, x26); + uint64_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u64(&x29, &x30, x28, 0x0, x24); + uint64_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u64(&x31, &x32, 0x0, x25, x11); + uint64_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u64(&x33, &x34, x32, x27, x13); + uint64_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u64(&x35, &x36, x34, x29, x15); + uint64_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u64(&x37, &x38, x36, x21, x17); + uint64_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u64(&x39, &x40, x38, x22, x19); + uint64_t x41; + fiat_p256_uint1 x42; + fiat_p256_addcarryx_u64(&x41, &x42, x40, 0x0, 0x0); + uint64_t x43; + uint64_t x44; + fiat_p256_mulx_u64(&x43, &x44, x1, (arg2[3])); + uint64_t x45; + uint64_t x46; + fiat_p256_mulx_u64(&x45, &x46, x1, (arg2[2])); + uint64_t x47; + uint64_t x48; + fiat_p256_mulx_u64(&x47, &x48, x1, (arg2[1])); + uint64_t x49; + uint64_t x50; + fiat_p256_mulx_u64(&x49, &x50, x1, (arg2[0])); + uint64_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u64(&x51, &x52, 0x0, x47, x50); + uint64_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u64(&x53, &x54, x52, x45, x48); + uint64_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u64(&x55, &x56, x54, x43, x46); + uint64_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u64(&x57, &x58, x56, 0x0, x44); + uint64_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u64(&x59, &x60, 0x0, x49, x33); + uint64_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u64(&x61, &x62, x60, x51, x35); + uint64_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u64(&x63, &x64, x62, x53, x37); + uint64_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u64(&x65, &x66, x64, x55, x39); + uint64_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u64(&x67, &x68, x66, x57, (fiat_p256_uint1)x41); + uint64_t x69; + uint64_t x70; + fiat_p256_mulx_u64(&x69, &x70, x59, UINT64_C(0xffffffff00000001)); + uint64_t x71; + uint64_t x72; + fiat_p256_mulx_u64(&x71, &x72, x59, UINT32_C(0xffffffff)); + uint64_t x73; + uint64_t x74; + fiat_p256_mulx_u64(&x73, &x74, x59, UINT64_C(0xffffffffffffffff)); + uint64_t x75; + fiat_p256_uint1 x76; + fiat_p256_addcarryx_u64(&x75, &x76, 0x0, x71, x74); + uint64_t x77; + fiat_p256_uint1 x78; + fiat_p256_addcarryx_u64(&x77, &x78, x76, 0x0, x72); + uint64_t x79; + fiat_p256_uint1 x80; + fiat_p256_addcarryx_u64(&x79, &x80, 0x0, x73, x59); + uint64_t x81; + fiat_p256_uint1 x82; + fiat_p256_addcarryx_u64(&x81, &x82, x80, x75, x61); + uint64_t x83; + fiat_p256_uint1 x84; + fiat_p256_addcarryx_u64(&x83, &x84, x82, x77, x63); + uint64_t x85; + fiat_p256_uint1 x86; + fiat_p256_addcarryx_u64(&x85, &x86, x84, x69, x65); + uint64_t x87; + fiat_p256_uint1 x88; + fiat_p256_addcarryx_u64(&x87, &x88, x86, x70, x67); + uint64_t x89; + fiat_p256_uint1 x90; + fiat_p256_addcarryx_u64(&x89, &x90, x88, 0x0, x68); + uint64_t x91; + uint64_t x92; + fiat_p256_mulx_u64(&x91, &x92, x2, (arg2[3])); + uint64_t x93; + uint64_t x94; + fiat_p256_mulx_u64(&x93, &x94, x2, (arg2[2])); + uint64_t x95; + uint64_t x96; + fiat_p256_mulx_u64(&x95, &x96, x2, (arg2[1])); + uint64_t x97; + uint64_t x98; + fiat_p256_mulx_u64(&x97, &x98, x2, (arg2[0])); + uint64_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u64(&x99, &x100, 0x0, x95, x98); + uint64_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u64(&x101, &x102, x100, x93, x96); + uint64_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u64(&x103, &x104, x102, x91, x94); + uint64_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u64(&x105, &x106, x104, 0x0, x92); + uint64_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u64(&x107, &x108, 0x0, x97, x81); + uint64_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u64(&x109, &x110, x108, x99, x83); + uint64_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u64(&x111, &x112, x110, x101, x85); + uint64_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u64(&x113, &x114, x112, x103, x87); + uint64_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u64(&x115, &x116, x114, x105, x89); + uint64_t x117; + uint64_t x118; + fiat_p256_mulx_u64(&x117, &x118, x107, UINT64_C(0xffffffff00000001)); + uint64_t x119; + uint64_t x120; + fiat_p256_mulx_u64(&x119, &x120, x107, UINT32_C(0xffffffff)); + uint64_t x121; + uint64_t x122; + fiat_p256_mulx_u64(&x121, &x122, x107, UINT64_C(0xffffffffffffffff)); + uint64_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u64(&x123, &x124, 0x0, x119, x122); + uint64_t x125; + fiat_p256_uint1 x126; + fiat_p256_addcarryx_u64(&x125, &x126, x124, 0x0, x120); + uint64_t x127; + fiat_p256_uint1 x128; + fiat_p256_addcarryx_u64(&x127, &x128, 0x0, x121, x107); + uint64_t x129; + fiat_p256_uint1 x130; + fiat_p256_addcarryx_u64(&x129, &x130, x128, x123, x109); + uint64_t x131; + fiat_p256_uint1 x132; + fiat_p256_addcarryx_u64(&x131, &x132, x130, x125, x111); + uint64_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u64(&x133, &x134, x132, x117, x113); + uint64_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u64(&x135, &x136, x134, x118, x115); + uint64_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u64(&x137, &x138, x136, 0x0, x116); + uint64_t x139; + uint64_t x140; + fiat_p256_mulx_u64(&x139, &x140, x3, (arg2[3])); + uint64_t x141; + uint64_t x142; + fiat_p256_mulx_u64(&x141, &x142, x3, (arg2[2])); + uint64_t x143; + uint64_t x144; + fiat_p256_mulx_u64(&x143, &x144, x3, (arg2[1])); + uint64_t x145; + uint64_t x146; + fiat_p256_mulx_u64(&x145, &x146, x3, (arg2[0])); + uint64_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u64(&x147, &x148, 0x0, x143, x146); + uint64_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u64(&x149, &x150, x148, x141, x144); + uint64_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u64(&x151, &x152, x150, x139, x142); + uint64_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u64(&x153, &x154, x152, 0x0, x140); + uint64_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u64(&x155, &x156, 0x0, x145, x129); + uint64_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u64(&x157, &x158, x156, x147, x131); + uint64_t x159; + fiat_p256_uint1 x160; + fiat_p256_addcarryx_u64(&x159, &x160, x158, x149, x133); + uint64_t x161; + fiat_p256_uint1 x162; + fiat_p256_addcarryx_u64(&x161, &x162, x160, x151, x135); + uint64_t x163; + fiat_p256_uint1 x164; + fiat_p256_addcarryx_u64(&x163, &x164, x162, x153, x137); + uint64_t x165; + uint64_t x166; + fiat_p256_mulx_u64(&x165, &x166, x155, UINT64_C(0xffffffff00000001)); + uint64_t x167; + uint64_t x168; + fiat_p256_mulx_u64(&x167, &x168, x155, UINT32_C(0xffffffff)); + uint64_t x169; + uint64_t x170; + fiat_p256_mulx_u64(&x169, &x170, x155, UINT64_C(0xffffffffffffffff)); + uint64_t x171; + fiat_p256_uint1 x172; + fiat_p256_addcarryx_u64(&x171, &x172, 0x0, x167, x170); + uint64_t x173; + fiat_p256_uint1 x174; + fiat_p256_addcarryx_u64(&x173, &x174, x172, 0x0, x168); + uint64_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u64(&x175, &x176, 0x0, x169, x155); + uint64_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u64(&x177, &x178, x176, x171, x157); + uint64_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u64(&x179, &x180, x178, x173, x159); + uint64_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u64(&x181, &x182, x180, x165, x161); + uint64_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u64(&x183, &x184, x182, x166, x163); + uint64_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u64(&x185, &x186, x184, 0x0, x164); + uint64_t x187; + fiat_p256_uint1 x188; + fiat_p256_subborrowx_u64(&x187, &x188, 0x0, x177, UINT64_C(0xffffffffffffffff)); + uint64_t x189; + fiat_p256_uint1 x190; + fiat_p256_subborrowx_u64(&x189, &x190, x188, x179, UINT32_C(0xffffffff)); + uint64_t x191; + fiat_p256_uint1 x192; + fiat_p256_subborrowx_u64(&x191, &x192, x190, x181, 0x0); + uint64_t x193; + fiat_p256_uint1 x194; + fiat_p256_subborrowx_u64(&x193, &x194, x192, x183, UINT64_C(0xffffffff00000001)); + uint64_t x195; + fiat_p256_uint1 x196; + fiat_p256_subborrowx_u64(&x195, &x196, x194, x185, 0x0); + uint64_t x197; + fiat_p256_cmovznz_u64(&x197, x196, x187, x177); + uint64_t x198; + fiat_p256_cmovznz_u64(&x198, x196, x189, x179); + uint64_t x199; + fiat_p256_cmovznz_u64(&x199, x196, x191, x181); + uint64_t x200; + fiat_p256_cmovznz_u64(&x200, x196, x193, x183); + out1[0] = x197; + out1[1] = x198; + out1[2] = x199; + out1[3] = x200; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_square(uint64_t out1[4], const uint64_t arg1[4]) { + uint64_t x1 = (arg1[1]); + uint64_t x2 = (arg1[2]); + uint64_t x3 = (arg1[3]); + uint64_t x4 = (arg1[0]); + uint64_t x5; + uint64_t x6; + fiat_p256_mulx_u64(&x5, &x6, x4, (arg1[3])); + uint64_t x7; + uint64_t x8; + fiat_p256_mulx_u64(&x7, &x8, x4, (arg1[2])); + uint64_t x9; + uint64_t x10; + fiat_p256_mulx_u64(&x9, &x10, x4, (arg1[1])); + uint64_t x11; + uint64_t x12; + fiat_p256_mulx_u64(&x11, &x12, x4, (arg1[0])); + uint64_t x13; + fiat_p256_uint1 x14; + fiat_p256_addcarryx_u64(&x13, &x14, 0x0, x9, x12); + uint64_t x15; + fiat_p256_uint1 x16; + fiat_p256_addcarryx_u64(&x15, &x16, x14, x7, x10); + uint64_t x17; + fiat_p256_uint1 x18; + fiat_p256_addcarryx_u64(&x17, &x18, x16, x5, x8); + uint64_t x19; + fiat_p256_uint1 x20; + fiat_p256_addcarryx_u64(&x19, &x20, x18, 0x0, x6); + uint64_t x21; + uint64_t x22; + fiat_p256_mulx_u64(&x21, &x22, x11, UINT64_C(0xffffffff00000001)); + uint64_t x23; + uint64_t x24; + fiat_p256_mulx_u64(&x23, &x24, x11, UINT32_C(0xffffffff)); + uint64_t x25; + uint64_t x26; + fiat_p256_mulx_u64(&x25, &x26, x11, UINT64_C(0xffffffffffffffff)); + uint64_t x27; + fiat_p256_uint1 x28; + fiat_p256_addcarryx_u64(&x27, &x28, 0x0, x23, x26); + uint64_t x29; + fiat_p256_uint1 x30; + fiat_p256_addcarryx_u64(&x29, &x30, x28, 0x0, x24); + uint64_t x31; + fiat_p256_uint1 x32; + fiat_p256_addcarryx_u64(&x31, &x32, 0x0, x25, x11); + uint64_t x33; + fiat_p256_uint1 x34; + fiat_p256_addcarryx_u64(&x33, &x34, x32, x27, x13); + uint64_t x35; + fiat_p256_uint1 x36; + fiat_p256_addcarryx_u64(&x35, &x36, x34, x29, x15); + uint64_t x37; + fiat_p256_uint1 x38; + fiat_p256_addcarryx_u64(&x37, &x38, x36, x21, x17); + uint64_t x39; + fiat_p256_uint1 x40; + fiat_p256_addcarryx_u64(&x39, &x40, x38, x22, x19); + uint64_t x41; + fiat_p256_uint1 x42; + fiat_p256_addcarryx_u64(&x41, &x42, x40, 0x0, 0x0); + uint64_t x43; + uint64_t x44; + fiat_p256_mulx_u64(&x43, &x44, x1, (arg1[3])); + uint64_t x45; + uint64_t x46; + fiat_p256_mulx_u64(&x45, &x46, x1, (arg1[2])); + uint64_t x47; + uint64_t x48; + fiat_p256_mulx_u64(&x47, &x48, x1, (arg1[1])); + uint64_t x49; + uint64_t x50; + fiat_p256_mulx_u64(&x49, &x50, x1, (arg1[0])); + uint64_t x51; + fiat_p256_uint1 x52; + fiat_p256_addcarryx_u64(&x51, &x52, 0x0, x47, x50); + uint64_t x53; + fiat_p256_uint1 x54; + fiat_p256_addcarryx_u64(&x53, &x54, x52, x45, x48); + uint64_t x55; + fiat_p256_uint1 x56; + fiat_p256_addcarryx_u64(&x55, &x56, x54, x43, x46); + uint64_t x57; + fiat_p256_uint1 x58; + fiat_p256_addcarryx_u64(&x57, &x58, x56, 0x0, x44); + uint64_t x59; + fiat_p256_uint1 x60; + fiat_p256_addcarryx_u64(&x59, &x60, 0x0, x49, x33); + uint64_t x61; + fiat_p256_uint1 x62; + fiat_p256_addcarryx_u64(&x61, &x62, x60, x51, x35); + uint64_t x63; + fiat_p256_uint1 x64; + fiat_p256_addcarryx_u64(&x63, &x64, x62, x53, x37); + uint64_t x65; + fiat_p256_uint1 x66; + fiat_p256_addcarryx_u64(&x65, &x66, x64, x55, x39); + uint64_t x67; + fiat_p256_uint1 x68; + fiat_p256_addcarryx_u64(&x67, &x68, x66, x57, (fiat_p256_uint1)x41); + uint64_t x69; + uint64_t x70; + fiat_p256_mulx_u64(&x69, &x70, x59, UINT64_C(0xffffffff00000001)); + uint64_t x71; + uint64_t x72; + fiat_p256_mulx_u64(&x71, &x72, x59, UINT32_C(0xffffffff)); + uint64_t x73; + uint64_t x74; + fiat_p256_mulx_u64(&x73, &x74, x59, UINT64_C(0xffffffffffffffff)); + uint64_t x75; + fiat_p256_uint1 x76; + fiat_p256_addcarryx_u64(&x75, &x76, 0x0, x71, x74); + uint64_t x77; + fiat_p256_uint1 x78; + fiat_p256_addcarryx_u64(&x77, &x78, x76, 0x0, x72); + uint64_t x79; + fiat_p256_uint1 x80; + fiat_p256_addcarryx_u64(&x79, &x80, 0x0, x73, x59); + uint64_t x81; + fiat_p256_uint1 x82; + fiat_p256_addcarryx_u64(&x81, &x82, x80, x75, x61); + uint64_t x83; + fiat_p256_uint1 x84; + fiat_p256_addcarryx_u64(&x83, &x84, x82, x77, x63); + uint64_t x85; + fiat_p256_uint1 x86; + fiat_p256_addcarryx_u64(&x85, &x86, x84, x69, x65); + uint64_t x87; + fiat_p256_uint1 x88; + fiat_p256_addcarryx_u64(&x87, &x88, x86, x70, x67); + uint64_t x89; + fiat_p256_uint1 x90; + fiat_p256_addcarryx_u64(&x89, &x90, x88, 0x0, x68); + uint64_t x91; + uint64_t x92; + fiat_p256_mulx_u64(&x91, &x92, x2, (arg1[3])); + uint64_t x93; + uint64_t x94; + fiat_p256_mulx_u64(&x93, &x94, x2, (arg1[2])); + uint64_t x95; + uint64_t x96; + fiat_p256_mulx_u64(&x95, &x96, x2, (arg1[1])); + uint64_t x97; + uint64_t x98; + fiat_p256_mulx_u64(&x97, &x98, x2, (arg1[0])); + uint64_t x99; + fiat_p256_uint1 x100; + fiat_p256_addcarryx_u64(&x99, &x100, 0x0, x95, x98); + uint64_t x101; + fiat_p256_uint1 x102; + fiat_p256_addcarryx_u64(&x101, &x102, x100, x93, x96); + uint64_t x103; + fiat_p256_uint1 x104; + fiat_p256_addcarryx_u64(&x103, &x104, x102, x91, x94); + uint64_t x105; + fiat_p256_uint1 x106; + fiat_p256_addcarryx_u64(&x105, &x106, x104, 0x0, x92); + uint64_t x107; + fiat_p256_uint1 x108; + fiat_p256_addcarryx_u64(&x107, &x108, 0x0, x97, x81); + uint64_t x109; + fiat_p256_uint1 x110; + fiat_p256_addcarryx_u64(&x109, &x110, x108, x99, x83); + uint64_t x111; + fiat_p256_uint1 x112; + fiat_p256_addcarryx_u64(&x111, &x112, x110, x101, x85); + uint64_t x113; + fiat_p256_uint1 x114; + fiat_p256_addcarryx_u64(&x113, &x114, x112, x103, x87); + uint64_t x115; + fiat_p256_uint1 x116; + fiat_p256_addcarryx_u64(&x115, &x116, x114, x105, x89); + uint64_t x117; + uint64_t x118; + fiat_p256_mulx_u64(&x117, &x118, x107, UINT64_C(0xffffffff00000001)); + uint64_t x119; + uint64_t x120; + fiat_p256_mulx_u64(&x119, &x120, x107, UINT32_C(0xffffffff)); + uint64_t x121; + uint64_t x122; + fiat_p256_mulx_u64(&x121, &x122, x107, UINT64_C(0xffffffffffffffff)); + uint64_t x123; + fiat_p256_uint1 x124; + fiat_p256_addcarryx_u64(&x123, &x124, 0x0, x119, x122); + uint64_t x125; + fiat_p256_uint1 x126; + fiat_p256_addcarryx_u64(&x125, &x126, x124, 0x0, x120); + uint64_t x127; + fiat_p256_uint1 x128; + fiat_p256_addcarryx_u64(&x127, &x128, 0x0, x121, x107); + uint64_t x129; + fiat_p256_uint1 x130; + fiat_p256_addcarryx_u64(&x129, &x130, x128, x123, x109); + uint64_t x131; + fiat_p256_uint1 x132; + fiat_p256_addcarryx_u64(&x131, &x132, x130, x125, x111); + uint64_t x133; + fiat_p256_uint1 x134; + fiat_p256_addcarryx_u64(&x133, &x134, x132, x117, x113); + uint64_t x135; + fiat_p256_uint1 x136; + fiat_p256_addcarryx_u64(&x135, &x136, x134, x118, x115); + uint64_t x137; + fiat_p256_uint1 x138; + fiat_p256_addcarryx_u64(&x137, &x138, x136, 0x0, x116); + uint64_t x139; + uint64_t x140; + fiat_p256_mulx_u64(&x139, &x140, x3, (arg1[3])); + uint64_t x141; + uint64_t x142; + fiat_p256_mulx_u64(&x141, &x142, x3, (arg1[2])); + uint64_t x143; + uint64_t x144; + fiat_p256_mulx_u64(&x143, &x144, x3, (arg1[1])); + uint64_t x145; + uint64_t x146; + fiat_p256_mulx_u64(&x145, &x146, x3, (arg1[0])); + uint64_t x147; + fiat_p256_uint1 x148; + fiat_p256_addcarryx_u64(&x147, &x148, 0x0, x143, x146); + uint64_t x149; + fiat_p256_uint1 x150; + fiat_p256_addcarryx_u64(&x149, &x150, x148, x141, x144); + uint64_t x151; + fiat_p256_uint1 x152; + fiat_p256_addcarryx_u64(&x151, &x152, x150, x139, x142); + uint64_t x153; + fiat_p256_uint1 x154; + fiat_p256_addcarryx_u64(&x153, &x154, x152, 0x0, x140); + uint64_t x155; + fiat_p256_uint1 x156; + fiat_p256_addcarryx_u64(&x155, &x156, 0x0, x145, x129); + uint64_t x157; + fiat_p256_uint1 x158; + fiat_p256_addcarryx_u64(&x157, &x158, x156, x147, x131); + uint64_t x159; + fiat_p256_uint1 x160; + fiat_p256_addcarryx_u64(&x159, &x160, x158, x149, x133); + uint64_t x161; + fiat_p256_uint1 x162; + fiat_p256_addcarryx_u64(&x161, &x162, x160, x151, x135); + uint64_t x163; + fiat_p256_uint1 x164; + fiat_p256_addcarryx_u64(&x163, &x164, x162, x153, x137); + uint64_t x165; + uint64_t x166; + fiat_p256_mulx_u64(&x165, &x166, x155, UINT64_C(0xffffffff00000001)); + uint64_t x167; + uint64_t x168; + fiat_p256_mulx_u64(&x167, &x168, x155, UINT32_C(0xffffffff)); + uint64_t x169; + uint64_t x170; + fiat_p256_mulx_u64(&x169, &x170, x155, UINT64_C(0xffffffffffffffff)); + uint64_t x171; + fiat_p256_uint1 x172; + fiat_p256_addcarryx_u64(&x171, &x172, 0x0, x167, x170); + uint64_t x173; + fiat_p256_uint1 x174; + fiat_p256_addcarryx_u64(&x173, &x174, x172, 0x0, x168); + uint64_t x175; + fiat_p256_uint1 x176; + fiat_p256_addcarryx_u64(&x175, &x176, 0x0, x169, x155); + uint64_t x177; + fiat_p256_uint1 x178; + fiat_p256_addcarryx_u64(&x177, &x178, x176, x171, x157); + uint64_t x179; + fiat_p256_uint1 x180; + fiat_p256_addcarryx_u64(&x179, &x180, x178, x173, x159); + uint64_t x181; + fiat_p256_uint1 x182; + fiat_p256_addcarryx_u64(&x181, &x182, x180, x165, x161); + uint64_t x183; + fiat_p256_uint1 x184; + fiat_p256_addcarryx_u64(&x183, &x184, x182, x166, x163); + uint64_t x185; + fiat_p256_uint1 x186; + fiat_p256_addcarryx_u64(&x185, &x186, x184, 0x0, x164); + uint64_t x187; + fiat_p256_uint1 x188; + fiat_p256_subborrowx_u64(&x187, &x188, 0x0, x177, UINT64_C(0xffffffffffffffff)); + uint64_t x189; + fiat_p256_uint1 x190; + fiat_p256_subborrowx_u64(&x189, &x190, x188, x179, UINT32_C(0xffffffff)); + uint64_t x191; + fiat_p256_uint1 x192; + fiat_p256_subborrowx_u64(&x191, &x192, x190, x181, 0x0); + uint64_t x193; + fiat_p256_uint1 x194; + fiat_p256_subborrowx_u64(&x193, &x194, x192, x183, UINT64_C(0xffffffff00000001)); + uint64_t x195; + fiat_p256_uint1 x196; + fiat_p256_subborrowx_u64(&x195, &x196, x194, x185, 0x0); + uint64_t x197; + fiat_p256_cmovznz_u64(&x197, x196, x187, x177); + uint64_t x198; + fiat_p256_cmovznz_u64(&x198, x196, x189, x179); + uint64_t x199; + fiat_p256_cmovznz_u64(&x199, x196, x191, x181); + uint64_t x200; + fiat_p256_cmovznz_u64(&x200, x196, x193, x183); + out1[0] = x197; + out1[1] = x198; + out1[2] = x199; + out1[3] = x200; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_add(uint64_t out1[4], const uint64_t arg1[4], const uint64_t arg2[4]) { + uint64_t x1; + fiat_p256_uint1 x2; + fiat_p256_addcarryx_u64(&x1, &x2, 0x0, (arg2[0]), (arg1[0])); + uint64_t x3; + fiat_p256_uint1 x4; + fiat_p256_addcarryx_u64(&x3, &x4, x2, (arg2[1]), (arg1[1])); + uint64_t x5; + fiat_p256_uint1 x6; + fiat_p256_addcarryx_u64(&x5, &x6, x4, (arg2[2]), (arg1[2])); + uint64_t x7; + fiat_p256_uint1 x8; + fiat_p256_addcarryx_u64(&x7, &x8, x6, (arg2[3]), (arg1[3])); + uint64_t x9; + fiat_p256_uint1 x10; + fiat_p256_subborrowx_u64(&x9, &x10, 0x0, x1, UINT64_C(0xffffffffffffffff)); + uint64_t x11; + fiat_p256_uint1 x12; + fiat_p256_subborrowx_u64(&x11, &x12, x10, x3, UINT32_C(0xffffffff)); + uint64_t x13; + fiat_p256_uint1 x14; + fiat_p256_subborrowx_u64(&x13, &x14, x12, x5, 0x0); + uint64_t x15; + fiat_p256_uint1 x16; + fiat_p256_subborrowx_u64(&x15, &x16, x14, x7, UINT64_C(0xffffffff00000001)); + uint64_t x17; + fiat_p256_uint1 x18; + fiat_p256_subborrowx_u64(&x17, &x18, x16, x8, 0x0); + uint64_t x19; + fiat_p256_cmovznz_u64(&x19, x18, x9, x1); + uint64_t x20; + fiat_p256_cmovznz_u64(&x20, x18, x11, x3); + uint64_t x21; + fiat_p256_cmovznz_u64(&x21, x18, x13, x5); + uint64_t x22; + fiat_p256_cmovznz_u64(&x22, x18, x15, x7); + out1[0] = x19; + out1[1] = x20; + out1[2] = x21; + out1[3] = x22; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_sub(uint64_t out1[4], const uint64_t arg1[4], const uint64_t arg2[4]) { + uint64_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u64(&x1, &x2, 0x0, (arg1[0]), (arg2[0])); + uint64_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u64(&x3, &x4, x2, (arg1[1]), (arg2[1])); + uint64_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u64(&x5, &x6, x4, (arg1[2]), (arg2[2])); + uint64_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u64(&x7, &x8, x6, (arg1[3]), (arg2[3])); + uint64_t x9; + fiat_p256_cmovznz_u64(&x9, x8, 0x0, UINT64_C(0xffffffffffffffff)); + uint64_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u64(&x10, &x11, 0x0, (x9 & UINT64_C(0xffffffffffffffff)), x1); + uint64_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u64(&x12, &x13, x11, (x9 & UINT32_C(0xffffffff)), x3); + uint64_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u64(&x14, &x15, x13, 0x0, x5); + uint64_t x16; + fiat_p256_uint1 x17; + fiat_p256_addcarryx_u64(&x16, &x17, x15, (x9 & UINT64_C(0xffffffff00000001)), x7); + out1[0] = x10; + out1[1] = x12; + out1[2] = x14; + out1[3] = x16; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_opp(uint64_t out1[4], const uint64_t arg1[4]) { + uint64_t x1; + fiat_p256_uint1 x2; + fiat_p256_subborrowx_u64(&x1, &x2, 0x0, 0x0, (arg1[0])); + uint64_t x3; + fiat_p256_uint1 x4; + fiat_p256_subborrowx_u64(&x3, &x4, x2, 0x0, (arg1[1])); + uint64_t x5; + fiat_p256_uint1 x6; + fiat_p256_subborrowx_u64(&x5, &x6, x4, 0x0, (arg1[2])); + uint64_t x7; + fiat_p256_uint1 x8; + fiat_p256_subborrowx_u64(&x7, &x8, x6, 0x0, (arg1[3])); + uint64_t x9; + fiat_p256_cmovznz_u64(&x9, x8, 0x0, UINT64_C(0xffffffffffffffff)); + uint64_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u64(&x10, &x11, 0x0, (x9 & UINT64_C(0xffffffffffffffff)), x1); + uint64_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u64(&x12, &x13, x11, (x9 & UINT32_C(0xffffffff)), x3); + uint64_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u64(&x14, &x15, x13, 0x0, x5); + uint64_t x16; + fiat_p256_uint1 x17; + fiat_p256_addcarryx_u64(&x16, &x17, x15, (x9 & UINT64_C(0xffffffff00000001)), x7); + out1[0] = x10; + out1[1] = x12; + out1[2] = x14; + out1[3] = x16; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_from_montgomery(uint64_t out1[4], const uint64_t arg1[4]) { + uint64_t x1 = (arg1[0]); + uint64_t x2; + uint64_t x3; + fiat_p256_mulx_u64(&x2, &x3, x1, UINT64_C(0xffffffff00000001)); + uint64_t x4; + uint64_t x5; + fiat_p256_mulx_u64(&x4, &x5, x1, UINT32_C(0xffffffff)); + uint64_t x6; + uint64_t x7; + fiat_p256_mulx_u64(&x6, &x7, x1, UINT64_C(0xffffffffffffffff)); + uint64_t x8; + fiat_p256_uint1 x9; + fiat_p256_addcarryx_u64(&x8, &x9, 0x0, x4, x7); + uint64_t x10; + fiat_p256_uint1 x11; + fiat_p256_addcarryx_u64(&x10, &x11, 0x0, x6, x1); + uint64_t x12; + fiat_p256_uint1 x13; + fiat_p256_addcarryx_u64(&x12, &x13, x11, x8, 0x0); + uint64_t x14; + fiat_p256_uint1 x15; + fiat_p256_addcarryx_u64(&x14, &x15, 0x0, (arg1[1]), x12); + uint64_t x16; + uint64_t x17; + fiat_p256_mulx_u64(&x16, &x17, x14, UINT64_C(0xffffffff00000001)); + uint64_t x18; + uint64_t x19; + fiat_p256_mulx_u64(&x18, &x19, x14, UINT32_C(0xffffffff)); + uint64_t x20; + uint64_t x21; + fiat_p256_mulx_u64(&x20, &x21, x14, UINT64_C(0xffffffffffffffff)); + uint64_t x22; + fiat_p256_uint1 x23; + fiat_p256_addcarryx_u64(&x22, &x23, 0x0, x18, x21); + uint64_t x24; + fiat_p256_uint1 x25; + fiat_p256_addcarryx_u64(&x24, &x25, x9, 0x0, x5); + uint64_t x26; + fiat_p256_uint1 x27; + fiat_p256_addcarryx_u64(&x26, &x27, x13, x24, 0x0); + uint64_t x28; + fiat_p256_uint1 x29; + fiat_p256_addcarryx_u64(&x28, &x29, x15, 0x0, x26); + uint64_t x30; + fiat_p256_uint1 x31; + fiat_p256_addcarryx_u64(&x30, &x31, 0x0, x20, x14); + uint64_t x32; + fiat_p256_uint1 x33; + fiat_p256_addcarryx_u64(&x32, &x33, x31, x22, x28); + uint64_t x34; + fiat_p256_uint1 x35; + fiat_p256_addcarryx_u64(&x34, &x35, x23, 0x0, x19); + uint64_t x36; + fiat_p256_uint1 x37; + fiat_p256_addcarryx_u64(&x36, &x37, x33, x34, x2); + uint64_t x38; + fiat_p256_uint1 x39; + fiat_p256_addcarryx_u64(&x38, &x39, x37, x16, x3); + uint64_t x40; + fiat_p256_uint1 x41; + fiat_p256_addcarryx_u64(&x40, &x41, 0x0, (arg1[2]), x32); + uint64_t x42; + fiat_p256_uint1 x43; + fiat_p256_addcarryx_u64(&x42, &x43, x41, 0x0, x36); + uint64_t x44; + fiat_p256_uint1 x45; + fiat_p256_addcarryx_u64(&x44, &x45, x43, 0x0, x38); + uint64_t x46; + uint64_t x47; + fiat_p256_mulx_u64(&x46, &x47, x40, UINT64_C(0xffffffff00000001)); + uint64_t x48; + uint64_t x49; + fiat_p256_mulx_u64(&x48, &x49, x40, UINT32_C(0xffffffff)); + uint64_t x50; + uint64_t x51; + fiat_p256_mulx_u64(&x50, &x51, x40, UINT64_C(0xffffffffffffffff)); + uint64_t x52; + fiat_p256_uint1 x53; + fiat_p256_addcarryx_u64(&x52, &x53, 0x0, x48, x51); + uint64_t x54; + fiat_p256_uint1 x55; + fiat_p256_addcarryx_u64(&x54, &x55, 0x0, x50, x40); + uint64_t x56; + fiat_p256_uint1 x57; + fiat_p256_addcarryx_u64(&x56, &x57, x55, x52, x42); + uint64_t x58; + fiat_p256_uint1 x59; + fiat_p256_addcarryx_u64(&x58, &x59, x53, 0x0, x49); + uint64_t x60; + fiat_p256_uint1 x61; + fiat_p256_addcarryx_u64(&x60, &x61, x57, x58, x44); + uint64_t x62; + fiat_p256_uint1 x63; + fiat_p256_addcarryx_u64(&x62, &x63, x39, x17, 0x0); + uint64_t x64; + fiat_p256_uint1 x65; + fiat_p256_addcarryx_u64(&x64, &x65, x45, 0x0, x62); + uint64_t x66; + fiat_p256_uint1 x67; + fiat_p256_addcarryx_u64(&x66, &x67, x61, x46, x64); + uint64_t x68; + fiat_p256_uint1 x69; + fiat_p256_addcarryx_u64(&x68, &x69, 0x0, (arg1[3]), x56); + uint64_t x70; + fiat_p256_uint1 x71; + fiat_p256_addcarryx_u64(&x70, &x71, x69, 0x0, x60); + uint64_t x72; + fiat_p256_uint1 x73; + fiat_p256_addcarryx_u64(&x72, &x73, x71, 0x0, x66); + uint64_t x74; + uint64_t x75; + fiat_p256_mulx_u64(&x74, &x75, x68, UINT64_C(0xffffffff00000001)); + uint64_t x76; + uint64_t x77; + fiat_p256_mulx_u64(&x76, &x77, x68, UINT32_C(0xffffffff)); + uint64_t x78; + uint64_t x79; + fiat_p256_mulx_u64(&x78, &x79, x68, UINT64_C(0xffffffffffffffff)); + uint64_t x80; + fiat_p256_uint1 x81; + fiat_p256_addcarryx_u64(&x80, &x81, 0x0, x76, x79); + uint64_t x82; + fiat_p256_uint1 x83; + fiat_p256_addcarryx_u64(&x82, &x83, 0x0, x78, x68); + uint64_t x84; + fiat_p256_uint1 x85; + fiat_p256_addcarryx_u64(&x84, &x85, x83, x80, x70); + uint64_t x86; + fiat_p256_uint1 x87; + fiat_p256_addcarryx_u64(&x86, &x87, x81, 0x0, x77); + uint64_t x88; + fiat_p256_uint1 x89; + fiat_p256_addcarryx_u64(&x88, &x89, x85, x86, x72); + uint64_t x90; + fiat_p256_uint1 x91; + fiat_p256_addcarryx_u64(&x90, &x91, x67, x47, 0x0); + uint64_t x92; + fiat_p256_uint1 x93; + fiat_p256_addcarryx_u64(&x92, &x93, x73, 0x0, x90); + uint64_t x94; + fiat_p256_uint1 x95; + fiat_p256_addcarryx_u64(&x94, &x95, x89, x74, x92); + uint64_t x96; + fiat_p256_uint1 x97; + fiat_p256_addcarryx_u64(&x96, &x97, x95, x75, 0x0); + uint64_t x98; + fiat_p256_uint1 x99; + fiat_p256_subborrowx_u64(&x98, &x99, 0x0, x84, UINT64_C(0xffffffffffffffff)); + uint64_t x100; + fiat_p256_uint1 x101; + fiat_p256_subborrowx_u64(&x100, &x101, x99, x88, UINT32_C(0xffffffff)); + uint64_t x102; + fiat_p256_uint1 x103; + fiat_p256_subborrowx_u64(&x102, &x103, x101, x94, 0x0); + uint64_t x104; + fiat_p256_uint1 x105; + fiat_p256_subborrowx_u64(&x104, &x105, x103, x96, UINT64_C(0xffffffff00000001)); + uint64_t x106; + fiat_p256_uint1 x107; + fiat_p256_subborrowx_u64(&x106, &x107, x105, 0x0, 0x0); + uint64_t x108; + fiat_p256_cmovznz_u64(&x108, x107, x98, x84); + uint64_t x109; + fiat_p256_cmovznz_u64(&x109, x107, x100, x88); + uint64_t x110; + fiat_p256_cmovznz_u64(&x110, x107, x102, x94); + uint64_t x111; + fiat_p256_cmovznz_u64(&x111, x107, x104, x96); + out1[0] = x108; + out1[1] = x109; + out1[2] = x110; + out1[3] = x111; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [0x0 ~> 0xffffffffffffffff] + */ +static void fiat_p256_nonzero(uint64_t* out1, const uint64_t arg1[4]) { + uint64_t x1 = ((arg1[0]) | ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | (uint64_t)0x0)))); + *out1 = x1; +} + +/* + * Input Bounds: + * arg1: [0x0 ~> 0x1] + * arg2: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * arg3: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_selectznz(uint64_t out1[4], fiat_p256_uint1 arg1, const uint64_t arg2[4], const uint64_t arg3[4]) { + uint64_t x1; + fiat_p256_cmovznz_u64(&x1, arg1, (arg2[0]), (arg3[0])); + uint64_t x2; + fiat_p256_cmovznz_u64(&x2, arg1, (arg2[1]), (arg3[1])); + uint64_t x3; + fiat_p256_cmovznz_u64(&x3, arg1, (arg2[2]), (arg3[2])); + uint64_t x4; + fiat_p256_cmovznz_u64(&x4, arg1, (arg2[3]), (arg3[3])); + out1[0] = x1; + out1[1] = x2; + out1[2] = x3; + out1[3] = x4; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + * Output Bounds: + * out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + */ +static void fiat_p256_to_bytes(uint8_t out1[32], const uint64_t arg1[4]) { + uint64_t x1 = (arg1[3]); + uint64_t x2 = (arg1[2]); + uint64_t x3 = (arg1[1]); + uint64_t x4 = (arg1[0]); + uint64_t x5 = (x4 >> 8); + uint8_t x6 = (uint8_t)(x4 & UINT8_C(0xff)); + uint64_t x7 = (x5 >> 8); + uint8_t x8 = (uint8_t)(x5 & UINT8_C(0xff)); + uint64_t x9 = (x7 >> 8); + uint8_t x10 = (uint8_t)(x7 & UINT8_C(0xff)); + uint64_t x11 = (x9 >> 8); + uint8_t x12 = (uint8_t)(x9 & UINT8_C(0xff)); + uint64_t x13 = (x11 >> 8); + uint8_t x14 = (uint8_t)(x11 & UINT8_C(0xff)); + uint64_t x15 = (x13 >> 8); + uint8_t x16 = (uint8_t)(x13 & UINT8_C(0xff)); + uint8_t x17 = (uint8_t)(x15 >> 8); + uint8_t x18 = (uint8_t)(x15 & UINT8_C(0xff)); + uint8_t x19 = (uint8_t)(x17 & UINT8_C(0xff)); + uint64_t x20 = (x3 >> 8); + uint8_t x21 = (uint8_t)(x3 & UINT8_C(0xff)); + uint64_t x22 = (x20 >> 8); + uint8_t x23 = (uint8_t)(x20 & UINT8_C(0xff)); + uint64_t x24 = (x22 >> 8); + uint8_t x25 = (uint8_t)(x22 & UINT8_C(0xff)); + uint64_t x26 = (x24 >> 8); + uint8_t x27 = (uint8_t)(x24 & UINT8_C(0xff)); + uint64_t x28 = (x26 >> 8); + uint8_t x29 = (uint8_t)(x26 & UINT8_C(0xff)); + uint64_t x30 = (x28 >> 8); + uint8_t x31 = (uint8_t)(x28 & UINT8_C(0xff)); + uint8_t x32 = (uint8_t)(x30 >> 8); + uint8_t x33 = (uint8_t)(x30 & UINT8_C(0xff)); + uint8_t x34 = (uint8_t)(x32 & UINT8_C(0xff)); + uint64_t x35 = (x2 >> 8); + uint8_t x36 = (uint8_t)(x2 & UINT8_C(0xff)); + uint64_t x37 = (x35 >> 8); + uint8_t x38 = (uint8_t)(x35 & UINT8_C(0xff)); + uint64_t x39 = (x37 >> 8); + uint8_t x40 = (uint8_t)(x37 & UINT8_C(0xff)); + uint64_t x41 = (x39 >> 8); + uint8_t x42 = (uint8_t)(x39 & UINT8_C(0xff)); + uint64_t x43 = (x41 >> 8); + uint8_t x44 = (uint8_t)(x41 & UINT8_C(0xff)); + uint64_t x45 = (x43 >> 8); + uint8_t x46 = (uint8_t)(x43 & UINT8_C(0xff)); + uint8_t x47 = (uint8_t)(x45 >> 8); + uint8_t x48 = (uint8_t)(x45 & UINT8_C(0xff)); + uint8_t x49 = (uint8_t)(x47 & UINT8_C(0xff)); + uint64_t x50 = (x1 >> 8); + uint8_t x51 = (uint8_t)(x1 & UINT8_C(0xff)); + uint64_t x52 = (x50 >> 8); + uint8_t x53 = (uint8_t)(x50 & UINT8_C(0xff)); + uint64_t x54 = (x52 >> 8); + uint8_t x55 = (uint8_t)(x52 & UINT8_C(0xff)); + uint64_t x56 = (x54 >> 8); + uint8_t x57 = (uint8_t)(x54 & UINT8_C(0xff)); + uint64_t x58 = (x56 >> 8); + uint8_t x59 = (uint8_t)(x56 & UINT8_C(0xff)); + uint64_t x60 = (x58 >> 8); + uint8_t x61 = (uint8_t)(x58 & UINT8_C(0xff)); + uint8_t x62 = (uint8_t)(x60 >> 8); + uint8_t x63 = (uint8_t)(x60 & UINT8_C(0xff)); + out1[0] = x6; + out1[1] = x8; + out1[2] = x10; + out1[3] = x12; + out1[4] = x14; + out1[5] = x16; + out1[6] = x18; + out1[7] = x19; + out1[8] = x21; + out1[9] = x23; + out1[10] = x25; + out1[11] = x27; + out1[12] = x29; + out1[13] = x31; + out1[14] = x33; + out1[15] = x34; + out1[16] = x36; + out1[17] = x38; + out1[18] = x40; + out1[19] = x42; + out1[20] = x44; + out1[21] = x46; + out1[22] = x48; + out1[23] = x49; + out1[24] = x51; + out1[25] = x53; + out1[26] = x55; + out1[27] = x57; + out1[28] = x59; + out1[29] = x61; + out1[30] = x63; + out1[31] = x62; +} + +/* + * Input Bounds: + * arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff]] + * Output Bounds: + * out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] + */ +static void fiat_p256_from_bytes(uint64_t out1[4], const uint8_t arg1[32]) { + uint64_t x1 = ((uint64_t)(arg1[31]) << 56); + uint64_t x2 = ((uint64_t)(arg1[30]) << 48); + uint64_t x3 = ((uint64_t)(arg1[29]) << 40); + uint64_t x4 = ((uint64_t)(arg1[28]) << 32); + uint64_t x5 = ((uint64_t)(arg1[27]) << 24); + uint64_t x6 = ((uint64_t)(arg1[26]) << 16); + uint64_t x7 = ((uint64_t)(arg1[25]) << 8); + uint8_t x8 = (arg1[24]); + uint64_t x9 = ((uint64_t)(arg1[23]) << 56); + uint64_t x10 = ((uint64_t)(arg1[22]) << 48); + uint64_t x11 = ((uint64_t)(arg1[21]) << 40); + uint64_t x12 = ((uint64_t)(arg1[20]) << 32); + uint64_t x13 = ((uint64_t)(arg1[19]) << 24); + uint64_t x14 = ((uint64_t)(arg1[18]) << 16); + uint64_t x15 = ((uint64_t)(arg1[17]) << 8); + uint8_t x16 = (arg1[16]); + uint64_t x17 = ((uint64_t)(arg1[15]) << 56); + uint64_t x18 = ((uint64_t)(arg1[14]) << 48); + uint64_t x19 = ((uint64_t)(arg1[13]) << 40); + uint64_t x20 = ((uint64_t)(arg1[12]) << 32); + uint64_t x21 = ((uint64_t)(arg1[11]) << 24); + uint64_t x22 = ((uint64_t)(arg1[10]) << 16); + uint64_t x23 = ((uint64_t)(arg1[9]) << 8); + uint8_t x24 = (arg1[8]); + uint64_t x25 = ((uint64_t)(arg1[7]) << 56); + uint64_t x26 = ((uint64_t)(arg1[6]) << 48); + uint64_t x27 = ((uint64_t)(arg1[5]) << 40); + uint64_t x28 = ((uint64_t)(arg1[4]) << 32); + uint64_t x29 = ((uint64_t)(arg1[3]) << 24); + uint64_t x30 = ((uint64_t)(arg1[2]) << 16); + uint64_t x31 = ((uint64_t)(arg1[1]) << 8); + uint8_t x32 = (arg1[0]); + uint64_t x33 = (x32 + (x31 + (x30 + (x29 + (x28 + (x27 + (x26 + x25))))))); + uint64_t x34 = (x33 & UINT64_C(0xffffffffffffffff)); + uint64_t x35 = (x8 + (x7 + (x6 + (x5 + (x4 + (x3 + (x2 + x1))))))); + uint64_t x36 = (x16 + (x15 + (x14 + (x13 + (x12 + (x11 + (x10 + x9))))))); + uint64_t x37 = (x24 + (x23 + (x22 + (x21 + (x20 + (x19 + (x18 + x17))))))); + uint64_t x38 = (x37 & UINT64_C(0xffffffffffffffff)); + uint64_t x39 = (x36 & UINT64_C(0xffffffffffffffff)); + out1[0] = x34; + out1[1] = x38; + out1[2] = x39; + out1[3] = x35; +} + diff --git a/Pods/BoringSSL-GRPC/ssl/custom_extensions.cc b/Pods/BoringSSL-GRPC/ssl/custom_extensions.cc deleted file mode 100644 index 4e501ce22..000000000 --- a/Pods/BoringSSL-GRPC/ssl/custom_extensions.cc +++ /dev/null @@ -1,265 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include -#include -#include -#include - -#include "internal.h" - - -namespace bssl { - -void SSL_CUSTOM_EXTENSION_free(SSL_CUSTOM_EXTENSION *custom_extension) { - OPENSSL_free(custom_extension); -} - -static const SSL_CUSTOM_EXTENSION *custom_ext_find( - STACK_OF(SSL_CUSTOM_EXTENSION) *stack, - unsigned *out_index, uint16_t value) { - for (size_t i = 0; i < sk_SSL_CUSTOM_EXTENSION_num(stack); i++) { - const SSL_CUSTOM_EXTENSION *ext = sk_SSL_CUSTOM_EXTENSION_value(stack, i); - if (ext->value == value) { - if (out_index != NULL) { - *out_index = i; - } - return ext; - } - } - - return NULL; -} - -// default_add_callback is used as the |add_callback| when the user doesn't -// provide one. For servers, it does nothing while, for clients, it causes an -// empty extension to be included. -static int default_add_callback(SSL *ssl, unsigned extension_value, - const uint8_t **out, size_t *out_len, - int *out_alert_value, void *add_arg) { - if (ssl->server) { - return 0; - } - *out_len = 0; - return 1; -} - -static int custom_ext_add_hello(SSL_HANDSHAKE *hs, CBB *extensions) { - SSL *const ssl = hs->ssl; - STACK_OF(SSL_CUSTOM_EXTENSION) *stack = ssl->ctx->client_custom_extensions; - if (ssl->server) { - stack = ssl->ctx->server_custom_extensions; - } - - if (stack == NULL) { - return 1; - } - - for (size_t i = 0; i < sk_SSL_CUSTOM_EXTENSION_num(stack); i++) { - const SSL_CUSTOM_EXTENSION *ext = sk_SSL_CUSTOM_EXTENSION_value(stack, i); - - if (ssl->server && - !(hs->custom_extensions.received & (1u << i))) { - // Servers cannot echo extensions that the client didn't send. - continue; - } - - const uint8_t *contents; - size_t contents_len; - int alert = SSL_AD_DECODE_ERROR; - CBB contents_cbb; - - switch (ext->add_callback(ssl, ext->value, &contents, &contents_len, &alert, - ext->add_arg)) { - case 1: - if (!CBB_add_u16(extensions, ext->value) || - !CBB_add_u16_length_prefixed(extensions, &contents_cbb) || - !CBB_add_bytes(&contents_cbb, contents, contents_len) || - !CBB_flush(extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - ERR_add_error_dataf("extension %u", (unsigned) ext->value); - if (ext->free_callback && 0 < contents_len) { - ext->free_callback(ssl, ext->value, contents, ext->add_arg); - } - return 0; - } - - if (ext->free_callback && 0 < contents_len) { - ext->free_callback(ssl, ext->value, contents, ext->add_arg); - } - - if (!ssl->server) { - assert((hs->custom_extensions.sent & (1u << i)) == 0); - hs->custom_extensions.sent |= (1u << i); - } - break; - - case 0: - break; - - default: - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR); - ERR_add_error_dataf("extension %u", (unsigned) ext->value); - return 0; - } - } - - return 1; -} - -int custom_ext_add_clienthello(SSL_HANDSHAKE *hs, CBB *extensions) { - return custom_ext_add_hello(hs, extensions); -} - -int custom_ext_parse_serverhello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension) { - SSL *const ssl = hs->ssl; - unsigned index; - const SSL_CUSTOM_EXTENSION *ext = - custom_ext_find(ssl->ctx->client_custom_extensions, &index, value); - - if (// Unknown extensions are not allowed in a ServerHello. - ext == NULL || - // Also, if we didn't send the extension, that's also unacceptable. - !(hs->custom_extensions.sent & (1u << index))) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); - ERR_add_error_dataf("extension %u", (unsigned)value); - *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; - return 0; - } - - if (ext->parse_callback != NULL && - !ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension), - out_alert, ext->parse_arg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR); - ERR_add_error_dataf("extension %u", (unsigned)ext->value); - return 0; - } - - return 1; -} - -int custom_ext_parse_clienthello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension) { - SSL *const ssl = hs->ssl; - unsigned index; - const SSL_CUSTOM_EXTENSION *ext = - custom_ext_find(ssl->ctx->server_custom_extensions, &index, value); - - if (ext == NULL) { - return 1; - } - - assert((hs->custom_extensions.received & (1u << index)) == 0); - hs->custom_extensions.received |= (1u << index); - - if (ext->parse_callback && - !ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension), - out_alert, ext->parse_arg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR); - ERR_add_error_dataf("extension %u", (unsigned)ext->value); - return 0; - } - - return 1; -} - -int custom_ext_add_serverhello(SSL_HANDSHAKE *hs, CBB *extensions) { - return custom_ext_add_hello(hs, extensions); -} - -// MAX_NUM_CUSTOM_EXTENSIONS is the maximum number of custom extensions that -// can be set on an |SSL_CTX|. It's determined by the size of the bitset used -// to track when an extension has been sent. -#define MAX_NUM_CUSTOM_EXTENSIONS \ - (sizeof(((SSL_HANDSHAKE *)NULL)->custom_extensions.sent) * 8) - -static int custom_ext_append(STACK_OF(SSL_CUSTOM_EXTENSION) **stack, - unsigned extension_value, - SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, - void *parse_arg) { - if (add_cb == NULL || - 0xffff < extension_value || - SSL_extension_supported(extension_value) || - // Specifying a free callback without an add callback is nonsensical - // and an error. - (*stack != NULL && - (MAX_NUM_CUSTOM_EXTENSIONS <= sk_SSL_CUSTOM_EXTENSION_num(*stack) || - custom_ext_find(*stack, NULL, extension_value) != NULL))) { - return 0; - } - - SSL_CUSTOM_EXTENSION *ext = - (SSL_CUSTOM_EXTENSION *)OPENSSL_malloc(sizeof(SSL_CUSTOM_EXTENSION)); - if (ext == NULL) { - return 0; - } - ext->add_callback = add_cb; - ext->add_arg = add_arg; - ext->free_callback = free_cb; - ext->parse_callback = parse_cb; - ext->parse_arg = parse_arg; - ext->value = extension_value; - - if (*stack == NULL) { - *stack = sk_SSL_CUSTOM_EXTENSION_new_null(); - if (*stack == NULL) { - SSL_CUSTOM_EXTENSION_free(ext); - return 0; - } - } - - if (!sk_SSL_CUSTOM_EXTENSION_push(*stack, ext)) { - SSL_CUSTOM_EXTENSION_free(ext); - if (sk_SSL_CUSTOM_EXTENSION_num(*stack) == 0) { - sk_SSL_CUSTOM_EXTENSION_free(*stack); - *stack = NULL; - } - return 0; - } - - return 1; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned extension_value, - SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, - void *parse_arg) { - return custom_ext_append(&ctx->client_custom_extensions, extension_value, - add_cb ? add_cb : default_add_callback, free_cb, - add_arg, parse_cb, parse_arg); -} - -int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned extension_value, - SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, - void *parse_arg) { - return custom_ext_append(&ctx->server_custom_extensions, extension_value, - add_cb ? add_cb : default_add_callback, free_cb, - add_arg, parse_cb, parse_arg); -} diff --git a/Pods/BoringSSL-GRPC/ssl/custom_extensions.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/custom_extensions.cc.grpc_back deleted file mode 100644 index 85b8a33d7..000000000 --- a/Pods/BoringSSL-GRPC/ssl/custom_extensions.cc.grpc_back +++ /dev/null @@ -1,265 +0,0 @@ -/* Copyright (c) 2014, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include -#include -#include -#include - -#include "internal.h" - - -namespace bssl { - -void SSL_CUSTOM_EXTENSION_free(SSL_CUSTOM_EXTENSION *custom_extension) { - OPENSSL_free(custom_extension); -} - -static const SSL_CUSTOM_EXTENSION *custom_ext_find( - STACK_OF(SSL_CUSTOM_EXTENSION) *stack, - unsigned *out_index, uint16_t value) { - for (size_t i = 0; i < sk_SSL_CUSTOM_EXTENSION_num(stack); i++) { - const SSL_CUSTOM_EXTENSION *ext = sk_SSL_CUSTOM_EXTENSION_value(stack, i); - if (ext->value == value) { - if (out_index != NULL) { - *out_index = i; - } - return ext; - } - } - - return NULL; -} - -// default_add_callback is used as the |add_callback| when the user doesn't -// provide one. For servers, it does nothing while, for clients, it causes an -// empty extension to be included. -static int default_add_callback(SSL *ssl, unsigned extension_value, - const uint8_t **out, size_t *out_len, - int *out_alert_value, void *add_arg) { - if (ssl->server) { - return 0; - } - *out_len = 0; - return 1; -} - -static int custom_ext_add_hello(SSL_HANDSHAKE *hs, CBB *extensions) { - SSL *const ssl = hs->ssl; - STACK_OF(SSL_CUSTOM_EXTENSION) *stack = ssl->ctx->client_custom_extensions; - if (ssl->server) { - stack = ssl->ctx->server_custom_extensions; - } - - if (stack == NULL) { - return 1; - } - - for (size_t i = 0; i < sk_SSL_CUSTOM_EXTENSION_num(stack); i++) { - const SSL_CUSTOM_EXTENSION *ext = sk_SSL_CUSTOM_EXTENSION_value(stack, i); - - if (ssl->server && - !(hs->custom_extensions.received & (1u << i))) { - // Servers cannot echo extensions that the client didn't send. - continue; - } - - const uint8_t *contents; - size_t contents_len; - int alert = SSL_AD_DECODE_ERROR; - CBB contents_cbb; - - switch (ext->add_callback(ssl, ext->value, &contents, &contents_len, &alert, - ext->add_arg)) { - case 1: - if (!CBB_add_u16(extensions, ext->value) || - !CBB_add_u16_length_prefixed(extensions, &contents_cbb) || - !CBB_add_bytes(&contents_cbb, contents, contents_len) || - !CBB_flush(extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - ERR_add_error_dataf("extension %u", (unsigned) ext->value); - if (ext->free_callback && 0 < contents_len) { - ext->free_callback(ssl, ext->value, contents, ext->add_arg); - } - return 0; - } - - if (ext->free_callback && 0 < contents_len) { - ext->free_callback(ssl, ext->value, contents, ext->add_arg); - } - - if (!ssl->server) { - assert((hs->custom_extensions.sent & (1u << i)) == 0); - hs->custom_extensions.sent |= (1u << i); - } - break; - - case 0: - break; - - default: - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR); - ERR_add_error_dataf("extension %u", (unsigned) ext->value); - return 0; - } - } - - return 1; -} - -int custom_ext_add_clienthello(SSL_HANDSHAKE *hs, CBB *extensions) { - return custom_ext_add_hello(hs, extensions); -} - -int custom_ext_parse_serverhello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension) { - SSL *const ssl = hs->ssl; - unsigned index; - const SSL_CUSTOM_EXTENSION *ext = - custom_ext_find(ssl->ctx->client_custom_extensions, &index, value); - - if (// Unknown extensions are not allowed in a ServerHello. - ext == NULL || - // Also, if we didn't send the extension, that's also unacceptable. - !(hs->custom_extensions.sent & (1u << index))) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); - ERR_add_error_dataf("extension %u", (unsigned)value); - *out_alert = SSL_AD_UNSUPPORTED_EXTENSION; - return 0; - } - - if (ext->parse_callback != NULL && - !ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension), - out_alert, ext->parse_arg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR); - ERR_add_error_dataf("extension %u", (unsigned)ext->value); - return 0; - } - - return 1; -} - -int custom_ext_parse_clienthello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension) { - SSL *const ssl = hs->ssl; - unsigned index; - const SSL_CUSTOM_EXTENSION *ext = - custom_ext_find(ssl->ctx->server_custom_extensions, &index, value); - - if (ext == NULL) { - return 1; - } - - assert((hs->custom_extensions.received & (1u << index)) == 0); - hs->custom_extensions.received |= (1u << index); - - if (ext->parse_callback && - !ext->parse_callback(ssl, value, CBS_data(extension), CBS_len(extension), - out_alert, ext->parse_arg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CUSTOM_EXTENSION_ERROR); - ERR_add_error_dataf("extension %u", (unsigned)ext->value); - return 0; - } - - return 1; -} - -int custom_ext_add_serverhello(SSL_HANDSHAKE *hs, CBB *extensions) { - return custom_ext_add_hello(hs, extensions); -} - -// MAX_NUM_CUSTOM_EXTENSIONS is the maximum number of custom extensions that -// can be set on an |SSL_CTX|. It's determined by the size of the bitset used -// to track when an extension has been sent. -#define MAX_NUM_CUSTOM_EXTENSIONS \ - (sizeof(((SSL_HANDSHAKE *)NULL)->custom_extensions.sent) * 8) - -static int custom_ext_append(STACK_OF(SSL_CUSTOM_EXTENSION) **stack, - unsigned extension_value, - SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, - void *parse_arg) { - if (add_cb == NULL || - 0xffff < extension_value || - SSL_extension_supported(extension_value) || - // Specifying a free callback without an add callback is nonsensical - // and an error. - (*stack != NULL && - (MAX_NUM_CUSTOM_EXTENSIONS <= sk_SSL_CUSTOM_EXTENSION_num(*stack) || - custom_ext_find(*stack, NULL, extension_value) != NULL))) { - return 0; - } - - SSL_CUSTOM_EXTENSION *ext = - (SSL_CUSTOM_EXTENSION *)OPENSSL_malloc(sizeof(SSL_CUSTOM_EXTENSION)); - if (ext == NULL) { - return 0; - } - ext->add_callback = add_cb; - ext->add_arg = add_arg; - ext->free_callback = free_cb; - ext->parse_callback = parse_cb; - ext->parse_arg = parse_arg; - ext->value = extension_value; - - if (*stack == NULL) { - *stack = sk_SSL_CUSTOM_EXTENSION_new_null(); - if (*stack == NULL) { - SSL_CUSTOM_EXTENSION_free(ext); - return 0; - } - } - - if (!sk_SSL_CUSTOM_EXTENSION_push(*stack, ext)) { - SSL_CUSTOM_EXTENSION_free(ext); - if (sk_SSL_CUSTOM_EXTENSION_num(*stack) == 0) { - sk_SSL_CUSTOM_EXTENSION_free(*stack); - *stack = NULL; - } - return 0; - } - - return 1; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_CTX_add_client_custom_ext(SSL_CTX *ctx, unsigned extension_value, - SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, - void *parse_arg) { - return custom_ext_append(&ctx->client_custom_extensions, extension_value, - add_cb ? add_cb : default_add_callback, free_cb, - add_arg, parse_cb, parse_arg); -} - -int SSL_CTX_add_server_custom_ext(SSL_CTX *ctx, unsigned extension_value, - SSL_custom_ext_add_cb add_cb, - SSL_custom_ext_free_cb free_cb, void *add_arg, - SSL_custom_ext_parse_cb parse_cb, - void *parse_arg) { - return custom_ext_append(&ctx->server_custom_extensions, extension_value, - add_cb ? add_cb : default_add_callback, free_cb, - add_arg, parse_cb, parse_arg); -} diff --git a/Pods/BoringSSL-GRPC/ssl/handoff.cc b/Pods/BoringSSL-GRPC/ssl/handoff.cc deleted file mode 100644 index 2b97f7e11..000000000 --- a/Pods/BoringSSL-GRPC/ssl/handoff.cc +++ /dev/null @@ -1,285 +0,0 @@ -/* Copyright (c) 2018, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include "internal.h" - - -namespace bssl { - -constexpr int kHandoffVersion = 0; -constexpr int kHandbackVersion = 0; - -bool SSL_serialize_handoff(const SSL *ssl, CBB *out) { - const SSL3_STATE *const s3 = ssl->s3; - if (!ssl->server || - s3->hs == nullptr || - s3->rwstate != SSL_HANDOFF) { - return false; - } - - CBB seq; - Span transcript = s3->hs->transcript.buffer(); - if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1_uint64(&seq, kHandoffVersion) || - !CBB_add_asn1_octet_string(&seq, transcript.data(), transcript.size()) || - !CBB_add_asn1_octet_string(&seq, - reinterpret_cast(s3->hs_buf->data), - s3->hs_buf->length) || - !CBB_flush(out)) { - return false; - } - - return true; -} - -bool SSL_decline_handoff(SSL *ssl) { - const SSL3_STATE *const s3 = ssl->s3; - if (!ssl->server || - s3->hs == nullptr || - s3->rwstate != SSL_HANDOFF) { - return false; - } - - ssl->handoff = false; - return true; -} - -bool SSL_apply_handoff(SSL *ssl, Span handoff) { - if (ssl->method->is_dtls) { - return false; - } - - CBS seq, handoff_cbs(handoff); - uint64_t handoff_version; - if (!CBS_get_asn1(&handoff_cbs, &seq, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1_uint64(&seq, &handoff_version) || - handoff_version != kHandoffVersion) { - return false; - } - - CBS transcript, hs_buf; - if (!CBS_get_asn1(&seq, &transcript, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &hs_buf, CBS_ASN1_OCTETSTRING)) { - return false; - } - - SSL_set_accept_state(ssl); - - SSL3_STATE *const s3 = ssl->s3; - s3->v2_hello_done = true; - s3->has_message = true; - - s3->hs_buf.reset(BUF_MEM_new()); - if (!s3->hs_buf || - !BUF_MEM_append(s3->hs_buf.get(), CBS_data(&hs_buf), CBS_len(&hs_buf))) { - return false; - } - - if (CBS_len(&transcript) != 0) { - s3->hs->transcript.Update(transcript); - s3->is_v2_hello = true; - ssl_do_msg_callback(ssl, 0 /* read */, 0 /* V2ClientHello */, transcript); - } - - return true; -} - -bool SSL_serialize_handback(const SSL *ssl, CBB *out) { - if (!ssl->server || - !ssl->s3->initial_handshake_complete || - ssl->method->is_dtls || - ssl->version < TLS1_VERSION) { - return false; - } - - const SSL3_STATE *const s3 = ssl->s3; - size_t hostname_len = 0; - if (s3->hostname) { - hostname_len = strlen(s3->hostname.get()); - } - - size_t iv_len = 0; - const uint8_t *read_iv = nullptr, *write_iv = nullptr; - if (ssl->version == TLS1_VERSION && - SSL_CIPHER_is_block_cipher(s3->aead_read_ctx->cipher()) && - (!s3->aead_read_ctx->GetIV(&read_iv, &iv_len) || - !s3->aead_write_ctx->GetIV(&write_iv, &iv_len))) { - return false; - } - - CBB seq; - if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1_uint64(&seq, kHandbackVersion) || - !CBB_add_asn1_uint64(&seq, ssl->version) || - !CBB_add_asn1_uint64(&seq, ssl->conf_max_version) || - !CBB_add_asn1_uint64(&seq, ssl->conf_min_version) || - !CBB_add_asn1_uint64(&seq, ssl->max_send_fragment) || - !CBB_add_asn1_octet_string(&seq, s3->read_sequence, - sizeof(s3->read_sequence)) || - !CBB_add_asn1_octet_string(&seq, s3->write_sequence, - sizeof(s3->write_sequence)) || - !CBB_add_asn1_octet_string(&seq, s3->server_random, - sizeof(s3->server_random)) || - !CBB_add_asn1_octet_string(&seq, s3->client_random, - sizeof(s3->client_random)) || - !CBB_add_asn1_octet_string(&seq, read_iv, iv_len) || - !CBB_add_asn1_octet_string(&seq, write_iv, iv_len) || - !CBB_add_asn1_bool(&seq, s3->session_reused) || - !CBB_add_asn1_bool(&seq, s3->send_connection_binding) || - !CBB_add_asn1_bool(&seq, s3->tlsext_channel_id_valid) || - !ssl_session_serialize(s3->established_session.get(), &seq) || - !CBB_add_asn1_octet_string(&seq, s3->next_proto_negotiated.data(), - s3->next_proto_negotiated.size()) || - !CBB_add_asn1_octet_string(&seq, s3->alpn_selected.data(), - s3->alpn_selected.size()) || - !CBB_add_asn1_octet_string( - &seq, reinterpret_cast(s3->hostname.get()), - hostname_len) || - !CBB_add_asn1_octet_string(&seq, s3->tlsext_channel_id, - sizeof(s3->tlsext_channel_id)) || - !CBB_add_asn1_uint64(&seq, ssl->options) || - !CBB_add_asn1_uint64(&seq, ssl->mode) || - !CBB_add_asn1_uint64(&seq, ssl->max_cert_list) || - !CBB_add_asn1_bool(&seq, ssl->quiet_shutdown) || - !CBB_add_asn1_bool(&seq, ssl->tlsext_channel_id_enabled) || - !CBB_add_asn1_bool(&seq, ssl->retain_only_sha256_of_client_certs) || - !CBB_flush(out)) { - return false; - } - - return true; -} - -bool SSL_apply_handback(SSL *ssl, Span handback) { - if (ssl->do_handshake != nullptr || - ssl->method->is_dtls) { - return false; - } - - SSL3_STATE *const s3 = ssl->s3; - uint64_t handback_version, version, conf_max_version, conf_min_version, - max_send_fragment, options, mode, max_cert_list; - CBS seq, read_seq, write_seq, server_rand, client_rand, read_iv, write_iv, - next_proto, alpn, hostname, channel_id; - int session_reused, send_connection_binding, channel_id_valid, - quiet_shutdown, channel_id_enabled, retain_only_sha256; - - CBS handback_cbs(handback); - if (!CBS_get_asn1(&handback_cbs, &seq, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1_uint64(&seq, &handback_version) || - handback_version != kHandbackVersion) { - return false; - } - - if (!CBS_get_asn1_uint64(&seq, &version) || - !CBS_get_asn1_uint64(&seq, &conf_max_version) || - !CBS_get_asn1_uint64(&seq, &conf_min_version) || - !CBS_get_asn1_uint64(&seq, &max_send_fragment) || - !CBS_get_asn1(&seq, &read_seq, CBS_ASN1_OCTETSTRING) || - CBS_len(&read_seq) != sizeof(s3->read_sequence) || - !CBS_get_asn1(&seq, &write_seq, CBS_ASN1_OCTETSTRING) || - CBS_len(&write_seq) != sizeof(s3->write_sequence) || - !CBS_get_asn1(&seq, &server_rand, CBS_ASN1_OCTETSTRING) || - CBS_len(&server_rand) != sizeof(s3->server_random) || - !CBS_copy_bytes(&server_rand, s3->server_random, - sizeof(s3->server_random)) || - !CBS_get_asn1(&seq, &client_rand, CBS_ASN1_OCTETSTRING) || - CBS_len(&client_rand) != sizeof(s3->client_random) || - !CBS_copy_bytes(&client_rand, s3->client_random, - sizeof(s3->client_random)) || - !CBS_get_asn1(&seq, &read_iv, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &write_iv, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1_bool(&seq, &session_reused) || - !CBS_get_asn1_bool(&seq, &send_connection_binding) || - !CBS_get_asn1_bool(&seq, &channel_id_valid)) { - return false; - } - - s3->established_session = - SSL_SESSION_parse(&seq, ssl->ctx->x509_method, ssl->ctx->pool); - - if (!s3->established_session || - !CBS_get_asn1(&seq, &next_proto, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &alpn, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &hostname, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &channel_id, CBS_ASN1_OCTETSTRING) || - CBS_len(&channel_id) != sizeof(s3->tlsext_channel_id) || - !CBS_copy_bytes(&channel_id, s3->tlsext_channel_id, - sizeof(s3->tlsext_channel_id)) || - !CBS_get_asn1_uint64(&seq, &options) || - !CBS_get_asn1_uint64(&seq, &mode) || - !CBS_get_asn1_uint64(&seq, &max_cert_list) || - !CBS_get_asn1_bool(&seq, &quiet_shutdown) || - !CBS_get_asn1_bool(&seq, &channel_id_enabled) || - !CBS_get_asn1_bool(&seq, &retain_only_sha256)) { - return false; - } - - ssl->version = version; - ssl->conf_max_version = conf_max_version; - ssl->conf_min_version = conf_min_version; - ssl->max_send_fragment = max_send_fragment; - ssl->do_handshake = ssl_server_handshake; - ssl->server = true; - ssl->options = options; - ssl->mode = mode; - ssl->max_cert_list = max_cert_list; - - s3->hs.reset(); - s3->have_version = true; - s3->initial_handshake_complete = true; - s3->session_reused = session_reused; - s3->send_connection_binding = send_connection_binding; - s3->tlsext_channel_id_valid = channel_id_valid; - s3->next_proto_negotiated.CopyFrom(next_proto); - s3->alpn_selected.CopyFrom(alpn); - - const size_t hostname_len = CBS_len(&hostname); - if (hostname_len == 0) { - s3->hostname.reset(); - } else { - char *hostname_str = nullptr; - if (!CBS_strdup(&hostname, &hostname_str)) { - return false; - } - s3->hostname.reset(hostname_str); - } - - ssl->quiet_shutdown = quiet_shutdown; - ssl->tlsext_channel_id_enabled = channel_id_enabled; - ssl->retain_only_sha256_of_client_certs = retain_only_sha256; - - Array key_block; - if (!tls1_configure_aead(ssl, evp_aead_open, &key_block, - s3->established_session->cipher, read_iv) || - !tls1_configure_aead(ssl, evp_aead_seal, &key_block, - s3->established_session->cipher, write_iv)) { - return false; - } - - if (!CBS_copy_bytes(&read_seq, s3->read_sequence, - sizeof(s3->read_sequence)) || - !CBS_copy_bytes(&write_seq, s3->write_sequence, - sizeof(s3->write_sequence))) { - return false; - } - - return true; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/handoff.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/handoff.cc.grpc_back deleted file mode 100644 index b19d44322..000000000 --- a/Pods/BoringSSL-GRPC/ssl/handoff.cc.grpc_back +++ /dev/null @@ -1,285 +0,0 @@ -/* Copyright (c) 2018, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include "internal.h" - - -namespace bssl { - -constexpr int kHandoffVersion = 0; -constexpr int kHandbackVersion = 0; - -bool SSL_serialize_handoff(const SSL *ssl, CBB *out) { - const SSL3_STATE *const s3 = ssl->s3; - if (!ssl->server || - s3->hs == nullptr || - s3->rwstate != SSL_HANDOFF) { - return false; - } - - CBB seq; - Span transcript = s3->hs->transcript.buffer(); - if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1_uint64(&seq, kHandoffVersion) || - !CBB_add_asn1_octet_string(&seq, transcript.data(), transcript.size()) || - !CBB_add_asn1_octet_string(&seq, - reinterpret_cast(s3->hs_buf->data), - s3->hs_buf->length) || - !CBB_flush(out)) { - return false; - } - - return true; -} - -bool SSL_decline_handoff(SSL *ssl) { - const SSL3_STATE *const s3 = ssl->s3; - if (!ssl->server || - s3->hs == nullptr || - s3->rwstate != SSL_HANDOFF) { - return false; - } - - ssl->handoff = false; - return true; -} - -bool SSL_apply_handoff(SSL *ssl, Span handoff) { - if (ssl->method->is_dtls) { - return false; - } - - CBS seq, handoff_cbs(handoff); - uint64_t handoff_version; - if (!CBS_get_asn1(&handoff_cbs, &seq, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1_uint64(&seq, &handoff_version) || - handoff_version != kHandoffVersion) { - return false; - } - - CBS transcript, hs_buf; - if (!CBS_get_asn1(&seq, &transcript, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &hs_buf, CBS_ASN1_OCTETSTRING)) { - return false; - } - - SSL_set_accept_state(ssl); - - SSL3_STATE *const s3 = ssl->s3; - s3->v2_hello_done = true; - s3->has_message = true; - - s3->hs_buf.reset(BUF_MEM_new()); - if (!s3->hs_buf || - !BUF_MEM_append(s3->hs_buf.get(), CBS_data(&hs_buf), CBS_len(&hs_buf))) { - return false; - } - - if (CBS_len(&transcript) != 0) { - s3->hs->transcript.Update(transcript); - s3->is_v2_hello = true; - ssl_do_msg_callback(ssl, 0 /* read */, 0 /* V2ClientHello */, transcript); - } - - return true; -} - -bool SSL_serialize_handback(const SSL *ssl, CBB *out) { - if (!ssl->server || - !ssl->s3->initial_handshake_complete || - ssl->method->is_dtls || - ssl->version < TLS1_VERSION) { - return false; - } - - const SSL3_STATE *const s3 = ssl->s3; - size_t hostname_len = 0; - if (s3->hostname) { - hostname_len = strlen(s3->hostname.get()); - } - - size_t iv_len = 0; - const uint8_t *read_iv = nullptr, *write_iv = nullptr; - if (ssl->version == TLS1_VERSION && - SSL_CIPHER_is_block_cipher(s3->aead_read_ctx->cipher()) && - (!s3->aead_read_ctx->GetIV(&read_iv, &iv_len) || - !s3->aead_write_ctx->GetIV(&write_iv, &iv_len))) { - return false; - } - - CBB seq; - if (!CBB_add_asn1(out, &seq, CBS_ASN1_SEQUENCE) || - !CBB_add_asn1_uint64(&seq, kHandbackVersion) || - !CBB_add_asn1_uint64(&seq, ssl->version) || - !CBB_add_asn1_uint64(&seq, ssl->conf_max_version) || - !CBB_add_asn1_uint64(&seq, ssl->conf_min_version) || - !CBB_add_asn1_uint64(&seq, ssl->max_send_fragment) || - !CBB_add_asn1_octet_string(&seq, s3->read_sequence, - sizeof(s3->read_sequence)) || - !CBB_add_asn1_octet_string(&seq, s3->write_sequence, - sizeof(s3->write_sequence)) || - !CBB_add_asn1_octet_string(&seq, s3->server_random, - sizeof(s3->server_random)) || - !CBB_add_asn1_octet_string(&seq, s3->client_random, - sizeof(s3->client_random)) || - !CBB_add_asn1_octet_string(&seq, read_iv, iv_len) || - !CBB_add_asn1_octet_string(&seq, write_iv, iv_len) || - !CBB_add_asn1_bool(&seq, s3->session_reused) || - !CBB_add_asn1_bool(&seq, s3->send_connection_binding) || - !CBB_add_asn1_bool(&seq, s3->tlsext_channel_id_valid) || - !ssl_session_serialize(s3->established_session.get(), &seq) || - !CBB_add_asn1_octet_string(&seq, s3->next_proto_negotiated.data(), - s3->next_proto_negotiated.size()) || - !CBB_add_asn1_octet_string(&seq, s3->alpn_selected.data(), - s3->alpn_selected.size()) || - !CBB_add_asn1_octet_string( - &seq, reinterpret_cast(s3->hostname.get()), - hostname_len) || - !CBB_add_asn1_octet_string(&seq, s3->tlsext_channel_id, - sizeof(s3->tlsext_channel_id)) || - !CBB_add_asn1_uint64(&seq, ssl->options) || - !CBB_add_asn1_uint64(&seq, ssl->mode) || - !CBB_add_asn1_uint64(&seq, ssl->max_cert_list) || - !CBB_add_asn1_bool(&seq, ssl->quiet_shutdown) || - !CBB_add_asn1_bool(&seq, ssl->tlsext_channel_id_enabled) || - !CBB_add_asn1_bool(&seq, ssl->retain_only_sha256_of_client_certs) || - !CBB_flush(out)) { - return false; - } - - return true; -} - -bool SSL_apply_handback(SSL *ssl, Span handback) { - if (ssl->do_handshake != nullptr || - ssl->method->is_dtls) { - return false; - } - - SSL3_STATE *const s3 = ssl->s3; - uint64_t handback_version, version, conf_max_version, conf_min_version, - max_send_fragment, options, mode, max_cert_list; - CBS seq, read_seq, write_seq, server_rand, client_rand, read_iv, write_iv, - next_proto, alpn, hostname, channel_id; - int session_reused, send_connection_binding, channel_id_valid, - quiet_shutdown, channel_id_enabled, retain_only_sha256; - - CBS handback_cbs(handback); - if (!CBS_get_asn1(&handback_cbs, &seq, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1_uint64(&seq, &handback_version) || - handback_version != kHandbackVersion) { - return false; - } - - if (!CBS_get_asn1_uint64(&seq, &version) || - !CBS_get_asn1_uint64(&seq, &conf_max_version) || - !CBS_get_asn1_uint64(&seq, &conf_min_version) || - !CBS_get_asn1_uint64(&seq, &max_send_fragment) || - !CBS_get_asn1(&seq, &read_seq, CBS_ASN1_OCTETSTRING) || - CBS_len(&read_seq) != sizeof(s3->read_sequence) || - !CBS_get_asn1(&seq, &write_seq, CBS_ASN1_OCTETSTRING) || - CBS_len(&write_seq) != sizeof(s3->write_sequence) || - !CBS_get_asn1(&seq, &server_rand, CBS_ASN1_OCTETSTRING) || - CBS_len(&server_rand) != sizeof(s3->server_random) || - !CBS_copy_bytes(&server_rand, s3->server_random, - sizeof(s3->server_random)) || - !CBS_get_asn1(&seq, &client_rand, CBS_ASN1_OCTETSTRING) || - CBS_len(&client_rand) != sizeof(s3->client_random) || - !CBS_copy_bytes(&client_rand, s3->client_random, - sizeof(s3->client_random)) || - !CBS_get_asn1(&seq, &read_iv, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &write_iv, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1_bool(&seq, &session_reused) || - !CBS_get_asn1_bool(&seq, &send_connection_binding) || - !CBS_get_asn1_bool(&seq, &channel_id_valid)) { - return false; - } - - s3->established_session = - SSL_SESSION_parse(&seq, ssl->ctx->x509_method, ssl->ctx->pool); - - if (!s3->established_session || - !CBS_get_asn1(&seq, &next_proto, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &alpn, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &hostname, CBS_ASN1_OCTETSTRING) || - !CBS_get_asn1(&seq, &channel_id, CBS_ASN1_OCTETSTRING) || - CBS_len(&channel_id) != sizeof(s3->tlsext_channel_id) || - !CBS_copy_bytes(&channel_id, s3->tlsext_channel_id, - sizeof(s3->tlsext_channel_id)) || - !CBS_get_asn1_uint64(&seq, &options) || - !CBS_get_asn1_uint64(&seq, &mode) || - !CBS_get_asn1_uint64(&seq, &max_cert_list) || - !CBS_get_asn1_bool(&seq, &quiet_shutdown) || - !CBS_get_asn1_bool(&seq, &channel_id_enabled) || - !CBS_get_asn1_bool(&seq, &retain_only_sha256)) { - return false; - } - - ssl->version = version; - ssl->conf_max_version = conf_max_version; - ssl->conf_min_version = conf_min_version; - ssl->max_send_fragment = max_send_fragment; - ssl->do_handshake = ssl_server_handshake; - ssl->server = true; - ssl->options = options; - ssl->mode = mode; - ssl->max_cert_list = max_cert_list; - - s3->hs.reset(); - s3->have_version = true; - s3->initial_handshake_complete = true; - s3->session_reused = session_reused; - s3->send_connection_binding = send_connection_binding; - s3->tlsext_channel_id_valid = channel_id_valid; - s3->next_proto_negotiated.CopyFrom(next_proto); - s3->alpn_selected.CopyFrom(alpn); - - const size_t hostname_len = CBS_len(&hostname); - if (hostname_len == 0) { - s3->hostname.reset(); - } else { - char *hostname_str = nullptr; - if (!CBS_strdup(&hostname, &hostname_str)) { - return false; - } - s3->hostname.reset(hostname_str); - } - - ssl->quiet_shutdown = quiet_shutdown; - ssl->tlsext_channel_id_enabled = channel_id_enabled; - ssl->retain_only_sha256_of_client_certs = retain_only_sha256; - - Array key_block; - if (!tls1_configure_aead(ssl, evp_aead_open, &key_block, - s3->established_session->cipher, read_iv) || - !tls1_configure_aead(ssl, evp_aead_seal, &key_block, - s3->established_session->cipher, write_iv)) { - return false; - } - - if (!CBS_copy_bytes(&read_seq, s3->read_sequence, - sizeof(s3->read_sequence)) || - !CBS_copy_bytes(&write_seq, s3->write_sequence, - sizeof(s3->write_sequence))) { - return false; - } - - return true; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/internal.h b/Pods/BoringSSL-GRPC/ssl/internal.h deleted file mode 100644 index 955107cc1..000000000 --- a/Pods/BoringSSL-GRPC/ssl/internal.h +++ /dev/null @@ -1,3064 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. - */ - -#ifndef OPENSSL_HEADER_SSL_INTERNAL_H -#define OPENSSL_HEADER_SSL_INTERNAL_H - -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/err/internal.h" -#include "../crypto/internal.h" - - -#if defined(OPENSSL_WINDOWS) -// Windows defines struct timeval in winsock2.h. -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#else -#include -#endif - - -namespace bssl { - -struct SSL_HANDSHAKE; -struct SSL_PROTOCOL_METHOD; - -// C++ utilities. - -// New behaves like |new| but uses |OPENSSL_malloc| for memory allocation. It -// returns nullptr on allocation error. It only implements single-object -// allocation and not new T[n]. -// -// Note: unlike |new|, this does not support non-public constructors. -template -T *New(Args &&... args) { - void *t = OPENSSL_malloc(sizeof(T)); - if (t == nullptr) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return nullptr; - } - return new (t) T(std::forward(args)...); -} - -// Delete behaves like |delete| but uses |OPENSSL_free| to release memory. -// -// Note: unlike |delete| this does not support non-public destructors. -template -void Delete(T *t) { - if (t != nullptr) { - t->~T(); - OPENSSL_free(t); - } -} - -// All types with kAllowUniquePtr set may be used with UniquePtr. Other types -// may be C structs which require a |BORINGSSL_MAKE_DELETER| registration. -namespace internal { -template -struct DeleterImpl::type> { - static void Free(T *t) { Delete(t); } -}; -} - -// MakeUnique behaves like |std::make_unique| but returns nullptr on allocation -// error. -template -UniquePtr MakeUnique(Args &&... args) { - return UniquePtr(New(std::forward(args)...)); -} - -#if defined(BORINGSSL_ALLOW_CXX_RUNTIME) -#define HAS_VIRTUAL_DESTRUCTOR -#define PURE_VIRTUAL = 0 -#else -// HAS_VIRTUAL_DESTRUCTOR should be declared in any base class which defines a -// virtual destructor. This avoids a dependency on |_ZdlPv| and prevents the -// class from being used with |delete|. -#define HAS_VIRTUAL_DESTRUCTOR \ - void operator delete(void *) { abort(); } - -// PURE_VIRTUAL should be used instead of = 0 when defining pure-virtual -// functions. This avoids a dependency on |__cxa_pure_virtual| but loses -// compile-time checking. -#define PURE_VIRTUAL { abort(); } -#endif - -// CONSTEXPR_ARRAY works around a VS 2015 bug where ranged for loops don't work -// on constexpr arrays. -#if defined(_MSC_VER) && !defined(__clang__) && _MSC_VER < 1910 -#define CONSTEXPR_ARRAY const -#else -#define CONSTEXPR_ARRAY constexpr -#endif - -// Array is an owning array of elements of |T|. -template -class Array { - public: - // Array's default constructor creates an empty array. - Array() {} - Array(const Array &) = delete; - Array(Array &&other) { *this = std::move(other); } - - ~Array() { Reset(); } - - Array &operator=(const Array &) = delete; - Array &operator=(Array &&other) { - Reset(); - other.Release(&data_, &size_); - return *this; - } - - const T *data() const { return data_; } - T *data() { return data_; } - size_t size() const { return size_; } - bool empty() const { return size_ == 0; } - - const T &operator[](size_t i) const { return data_[i]; } - T &operator[](size_t i) { return data_[i]; } - - T *begin() { return data_; } - const T *cbegin() const { return data_; } - T *end() { return data_ + size_; } - const T *cend() const { return data_ + size_; } - - void Reset() { Reset(nullptr, 0); } - - // Reset releases the current contents of the array and takes ownership of the - // raw pointer supplied by the caller. - void Reset(T *new_data, size_t new_size) { - for (size_t i = 0; i < size_; i++) { - data_[i].~T(); - } - OPENSSL_free(data_); - data_ = new_data; - size_ = new_size; - } - - // Release releases ownership of the array to a raw pointer supplied by the - // caller. - void Release(T **out, size_t *out_size) { - *out = data_; - *out_size = size_; - data_ = nullptr; - size_ = 0; - } - - // Init replaces the array with a newly-allocated array of |new_size| - // default-constructed copies of |T|. It returns true on success and false on - // error. - // - // Note that if |T| is a primitive type like |uint8_t|, it is uninitialized. - bool Init(size_t new_size) { - Reset(); - if (new_size == 0) { - return true; - } - - if (new_size > std::numeric_limits::max() / sizeof(T)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return false; - } - data_ = reinterpret_cast(OPENSSL_malloc(new_size * sizeof(T))); - if (data_ == nullptr) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - size_ = new_size; - for (size_t i = 0; i < size_; i++) { - new (&data_[i]) T; - } - return true; - } - - // CopyFrom replaces the array with a newly-allocated copy of |in|. It returns - // true on success and false on error. - bool CopyFrom(Span in) { - if (!Init(in.size())) { - return false; - } - OPENSSL_memcpy(data_, in.data(), in.size()); - return true; - } - - private: - T *data_ = nullptr; - size_t size_ = 0; -}; - -// CBBFinishArray behaves like |CBB_finish| but stores the result in an Array. -OPENSSL_EXPORT bool CBBFinishArray(CBB *cbb, Array *out); - - -// Protocol versions. -// -// Due to DTLS's historical wire version differences and to support multiple -// variants of the same protocol during development, we maintain two notions of -// version. -// -// The "version" or "wire version" is the actual 16-bit value that appears on -// the wire. It uniquely identifies a version and is also used at API -// boundaries. The set of supported versions differs between TLS and DTLS. Wire -// versions are opaque values and may not be compared numerically. -// -// The "protocol version" identifies the high-level handshake variant being -// used. DTLS versions map to the corresponding TLS versions. Draft TLS 1.3 -// variants all map to TLS 1.3. Protocol versions are sequential and may be -// compared numerically. - -// ssl_protocol_version_from_wire sets |*out| to the protocol version -// corresponding to wire version |version| and returns true. If |version| is not -// a valid TLS or DTLS version, it returns false. -// -// Note this simultaneously handles both DTLS and TLS. Use one of the -// higher-level functions below for most operations. -bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version); - -// ssl_get_version_range sets |*out_min_version| and |*out_max_version| to the -// minimum and maximum enabled protocol versions, respectively. -bool ssl_get_version_range(const SSL *ssl, uint16_t *out_min_version, - uint16_t *out_max_version); - -// ssl_supports_version returns whether |hs| supports |version|. -bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version); - -// ssl_add_supported_versions writes the supported versions of |hs| to |cbb|, in -// decreasing preference order. -bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb); - -// ssl_negotiate_version negotiates a common version based on |hs|'s preferences -// and the peer preference list in |peer_versions|. On success, it returns true -// and sets |*out_version| to the selected version. Otherwise, it returns false -// and sets |*out_alert| to an alert to send. -bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, - uint16_t *out_version, const CBS *peer_versions); - -// ssl_protocol_version returns |ssl|'s protocol version. It is an error to -// call this function before the version is determined. -uint16_t ssl_protocol_version(const SSL *ssl); - -// Cipher suites. - -} // namespace bssl - -struct ssl_cipher_st { - // name is the OpenSSL name for the cipher. - const char *name; - // standard_name is the IETF name for the cipher. - const char *standard_name; - // id is the cipher suite value bitwise OR-d with 0x03000000. - uint32_t id; - - // algorithm_* determine the cipher suite. See constants below for the values. - uint32_t algorithm_mkey; - uint32_t algorithm_auth; - uint32_t algorithm_enc; - uint32_t algorithm_mac; - uint32_t algorithm_prf; -}; - -namespace bssl { - -// Bits for |algorithm_mkey| (key exchange algorithm). -#define SSL_kRSA 0x00000001u -#define SSL_kECDHE 0x00000002u -// SSL_kPSK is only set for plain PSK, not ECDHE_PSK. -#define SSL_kPSK 0x00000004u -#define SSL_kGENERIC 0x00000008u - -// Bits for |algorithm_auth| (server authentication). -#define SSL_aRSA 0x00000001u -#define SSL_aECDSA 0x00000002u -// SSL_aPSK is set for both PSK and ECDHE_PSK. -#define SSL_aPSK 0x00000004u -#define SSL_aGENERIC 0x00000008u - -#define SSL_aCERT (SSL_aRSA | SSL_aECDSA) - -// Bits for |algorithm_enc| (symmetric encryption). -#define SSL_3DES 0x00000001u -#define SSL_AES128 0x00000002u -#define SSL_AES256 0x00000004u -#define SSL_AES128GCM 0x00000008u -#define SSL_AES256GCM 0x00000010u -#define SSL_eNULL 0x00000020u -#define SSL_CHACHA20POLY1305 0x00000040u - -#define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AES128GCM | SSL_AES256GCM) - -// Bits for |algorithm_mac| (symmetric authentication). -#define SSL_SHA1 0x00000001u -#define SSL_SHA256 0x00000002u -#define SSL_SHA384 0x00000004u -// SSL_AEAD is set for all AEADs. -#define SSL_AEAD 0x00000008u - -// Bits for |algorithm_prf| (handshake digest). -#define SSL_HANDSHAKE_MAC_DEFAULT 0x1 -#define SSL_HANDSHAKE_MAC_SHA256 0x2 -#define SSL_HANDSHAKE_MAC_SHA384 0x4 - -// SSL_MAX_DIGEST is the number of digest types which exist. When adding a new -// one, update the table in ssl_cipher.c. -#define SSL_MAX_DIGEST 4 - -// ssl_cipher_get_evp_aead sets |*out_aead| to point to the correct EVP_AEAD -// object for |cipher| protocol version |version|. It sets |*out_mac_secret_len| -// and |*out_fixed_iv_len| to the MAC key length and fixed IV length, -// respectively. The MAC key length is zero except for legacy block and stream -// ciphers. It returns true on success and false on error. -bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, - size_t *out_mac_secret_len, - size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, - uint16_t version, int is_dtls); - -// ssl_get_handshake_digest returns the |EVP_MD| corresponding to |version| and -// |cipher|. -const EVP_MD *ssl_get_handshake_digest(uint16_t version, - const SSL_CIPHER *cipher); - -// ssl_create_cipher_list evaluates |rule_str|. It sets |*out_cipher_list| to a -// newly-allocated |ssl_cipher_preference_list_st| containing the result. It -// returns true on success and false on failure. If |strict| is true, nonsense -// will be rejected. If false, nonsense will be silently ignored. An empty -// result is considered an error regardless of |strict|. -bool ssl_create_cipher_list( - struct ssl_cipher_preference_list_st **out_cipher_list, - const char *rule_str, bool strict); - -// ssl_cipher_get_value returns the cipher suite id of |cipher|. -uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher); - -// ssl_cipher_auth_mask_for_key returns the mask of cipher |algorithm_auth| -// values suitable for use with |key| in TLS 1.2 and below. -uint32_t ssl_cipher_auth_mask_for_key(const EVP_PKEY *key); - -// ssl_cipher_uses_certificate_auth returns whether |cipher| authenticates the -// server and, optionally, the client with a certificate. -bool ssl_cipher_uses_certificate_auth(const SSL_CIPHER *cipher); - -// ssl_cipher_requires_server_key_exchange returns whether |cipher| requires a -// ServerKeyExchange message. -// -// This function may return false while still allowing |cipher| an optional -// ServerKeyExchange. This is the case for plain PSK ciphers. -bool ssl_cipher_requires_server_key_exchange(const SSL_CIPHER *cipher); - -// ssl_cipher_get_record_split_len, for TLS 1.0 CBC mode ciphers, returns the -// length of an encrypted 1-byte record, for use in record-splitting. Otherwise -// it returns zero. -size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher); - - -// Transcript layer. - -// SSLTranscript maintains the handshake transcript as a combination of a -// buffer and running hash. -class SSLTranscript { - public: - SSLTranscript(); - ~SSLTranscript(); - - // Init initializes the handshake transcript. If called on an existing - // transcript, it resets the transcript and hash. It returns true on success - // and false on failure. - bool Init(); - - // InitHash initializes the handshake hash based on the PRF and contents of - // the handshake transcript. Subsequent calls to |Update| will update the - // rolling hash. It returns one on success and zero on failure. It is an error - // to call this function after the handshake buffer is released. - bool InitHash(uint16_t version, const SSL_CIPHER *cipher); - - // UpdateForHelloRetryRequest resets the rolling hash with the - // HelloRetryRequest construction. It returns true on success and false on - // failure. It is an error to call this function before the handshake buffer - // is released. - bool UpdateForHelloRetryRequest(); - - // CopyHashContext copies the hash context into |ctx| and returns true on - // success. - bool CopyHashContext(EVP_MD_CTX *ctx); - - Span buffer() { - return MakeConstSpan(reinterpret_cast(buffer_->data), - buffer_->length); - } - - // FreeBuffer releases the handshake buffer. Subsequent calls to - // |Update| will not update the handshake buffer. - void FreeBuffer(); - - // DigestLen returns the length of the PRF hash. - size_t DigestLen() const; - - // Digest returns the PRF hash. For TLS 1.1 and below, this is - // |EVP_md5_sha1|. - const EVP_MD *Digest() const; - - // Update adds |in| to the handshake buffer and handshake hash, whichever is - // enabled. It returns true on success and false on failure. - bool Update(Span in); - - // GetHash writes the handshake hash to |out| which must have room for at - // least |DigestLen| bytes. On success, it returns true and sets |*out_len| to - // the number of bytes written. Otherwise, it returns false. - bool GetHash(uint8_t *out, size_t *out_len); - - // GetSSL3CertVerifyHash writes the SSL 3.0 CertificateVerify hash into the - // bytes pointed to by |out| and writes the number of bytes to - // |*out_len|. |out| must have room for |EVP_MAX_MD_SIZE| bytes. It returns - // one on success and zero on failure. - bool GetSSL3CertVerifyHash(uint8_t *out, size_t *out_len, - const SSL_SESSION *session, - uint16_t signature_algorithm); - - // GetFinishedMAC computes the MAC for the Finished message into the bytes - // pointed by |out| and writes the number of bytes to |*out_len|. |out| must - // have room for |EVP_MAX_MD_SIZE| bytes. It returns true on success and false - // on failure. - bool GetFinishedMAC(uint8_t *out, size_t *out_len, const SSL_SESSION *session, - bool from_server); - - private: - // buffer_, if non-null, contains the handshake transcript. - UniquePtr buffer_; - // hash, if initialized with an |EVP_MD|, maintains the handshake hash. For - // TLS 1.1 and below, it is the SHA-1 half. - ScopedEVP_MD_CTX hash_; - // md5, if initialized with an |EVP_MD|, maintains the MD5 half of the - // handshake hash for TLS 1.1 and below. - ScopedEVP_MD_CTX md5_; -}; - -// tls1_prf computes the PRF function for |ssl|. It fills |out|, using |secret| -// as the secret and |label| as the label. |seed1| and |seed2| are concatenated -// to form the seed parameter. It returns true on success and false on failure. -bool tls1_prf(const EVP_MD *digest, Span out, - Span secret, Span label, - Span seed1, Span seed2); - - -// Encryption layer. - -// SSLAEADContext contains information about an AEAD that is being used to -// encrypt an SSL connection. -class SSLAEADContext { - public: - SSLAEADContext(uint16_t version, bool is_dtls, const SSL_CIPHER *cipher); - ~SSLAEADContext(); - static constexpr bool kAllowUniquePtr = true; - - SSLAEADContext(const SSLAEADContext &&) = delete; - SSLAEADContext &operator=(const SSLAEADContext &&) = delete; - - // CreateNullCipher creates an |SSLAEADContext| for the null cipher. - static UniquePtr CreateNullCipher(bool is_dtls); - - // Create creates an |SSLAEADContext| using the supplied key material. It - // returns nullptr on error. Only one of |Open| or |Seal| may be used with the - // resulting object, depending on |direction|. |version| is the normalized - // protocol version, so DTLS 1.0 is represented as 0x0301, not 0xffef. - static UniquePtr Create(enum evp_aead_direction_t direction, - uint16_t version, int is_dtls, - const SSL_CIPHER *cipher, - Span enc_key, - Span mac_key, - Span fixed_iv); - - // SetVersionIfNullCipher sets the version the SSLAEADContext for the null - // cipher, to make version-specific determinations in the record layer prior - // to a cipher being selected. - void SetVersionIfNullCipher(uint16_t version); - - // ProtocolVersion returns the protocol version associated with this - // SSLAEADContext. It can only be called once |version_| has been set to a - // valid value. - uint16_t ProtocolVersion() const; - - // RecordVersion returns the record version that should be used with this - // SSLAEADContext for record construction and crypto. - uint16_t RecordVersion() const; - - const SSL_CIPHER *cipher() const { return cipher_; } - - // is_null_cipher returns true if this is the null cipher. - bool is_null_cipher() const { return !cipher_; } - - // ExplicitNonceLen returns the length of the explicit nonce. - size_t ExplicitNonceLen() const; - - // MaxOverhead returns the maximum overhead of calling |Seal|. - size_t MaxOverhead() const; - - // SuffixLen calculates the suffix length written by |SealScatter| and writes - // it to |*out_suffix_len|. It returns true on success and false on error. - // |in_len| and |extra_in_len| should equal the argument of the same names - // passed to |SealScatter|. - bool SuffixLen(size_t *out_suffix_len, size_t in_len, - size_t extra_in_len) const; - - // Open authenticates and decrypts |in| in-place. On success, it sets |*out| - // to the plaintext in |in| and returns true. Otherwise, it returns - // false. The output will always be |ExplicitNonceLen| bytes ahead of |in|. - bool Open(Span *out, uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], Span in); - - // Seal encrypts and authenticates |in_len| bytes from |in| and writes the - // result to |out|. It returns true on success and false on error. - // - // If |in| and |out| alias then |out| + |ExplicitNonceLen| must be == |in|. - bool Seal(uint8_t *out, size_t *out_len, size_t max_out, uint8_t type, - uint16_t record_version, const uint8_t seqnum[8], const uint8_t *in, - size_t in_len); - - // SealScatter encrypts and authenticates |in_len| bytes from |in| and splits - // the result between |out_prefix|, |out| and |out_suffix|. It returns one on - // success and zero on error. - // - // On successful return, exactly |ExplicitNonceLen| bytes are written to - // |out_prefix|, |in_len| bytes to |out|, and |SuffixLen| bytes to - // |out_suffix|. - // - // |extra_in| may point to an additional plaintext buffer. If present, - // |extra_in_len| additional bytes are encrypted and authenticated, and the - // ciphertext is written to the beginning of |out_suffix|. |SuffixLen| should - // be used to size |out_suffix| accordingly. - // - // If |in| and |out| alias then |out| must be == |in|. Other arguments may not - // alias anything. - bool SealScatter(uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, - uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], const uint8_t *in, size_t in_len, - const uint8_t *extra_in, size_t extra_in_len); - - bool GetIV(const uint8_t **out_iv, size_t *out_iv_len) const; - - private: - // GetAdditionalData writes the additional data into |out| and returns the - // number of bytes written. - size_t GetAdditionalData(uint8_t out[13], uint8_t type, - uint16_t record_version, const uint8_t seqnum[8], - size_t plaintext_len); - - const SSL_CIPHER *cipher_; - ScopedEVP_AEAD_CTX ctx_; - // fixed_nonce_ contains any bytes of the nonce that are fixed for all - // records. - uint8_t fixed_nonce_[12]; - uint8_t fixed_nonce_len_ = 0, variable_nonce_len_ = 0; - // version_ is the wire version that should be used with this AEAD. - uint16_t version_; - // is_dtls_ is whether DTLS is being used with this AEAD. - bool is_dtls_; - // variable_nonce_included_in_record_ is true if the variable nonce - // for a record is included as a prefix before the ciphertext. - bool variable_nonce_included_in_record_ : 1; - // random_variable_nonce_ is true if the variable nonce is - // randomly generated, rather than derived from the sequence - // number. - bool random_variable_nonce_ : 1; - // omit_length_in_ad_ is true if the length should be omitted in the - // AEAD's ad parameter. - bool omit_length_in_ad_ : 1; - // omit_version_in_ad_ is true if the version should be omitted - // in the AEAD's ad parameter. - bool omit_version_in_ad_ : 1; - // omit_ad_ is true if the AEAD's ad parameter should be omitted. - bool omit_ad_ : 1; - // xor_fixed_nonce_ is true if the fixed nonce should be XOR'd into the - // variable nonce rather than prepended. - bool xor_fixed_nonce_ : 1; -}; - - -// DTLS replay bitmap. - -// DTLS1_BITMAP maintains a sliding window of 64 sequence numbers to detect -// replayed packets. It should be initialized by zeroing every field. -struct DTLS1_BITMAP { - // map is a bit mask of the last 64 sequence numbers. Bit - // |1< *out, size_t *out_consumed, - uint8_t *out_alert, Span in); - -// dtls_open_record implements |tls_open_record| for DTLS. It only returns -// |ssl_open_record_partial| if |in| was empty and sets |*out_consumed| to -// zero. The caller should read one packet and try again. -enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, - Span *out, - size_t *out_consumed, - uint8_t *out_alert, Span in); - -// ssl_seal_align_prefix_len returns the length of the prefix before the start -// of the bulk of the ciphertext when sealing a record with |ssl|. Callers may -// use this to align buffers. -// -// Note when TLS 1.0 CBC record-splitting is enabled, this includes the one byte -// record and is the offset into second record's ciphertext. Thus sealing a -// small record may result in a smaller output than this value. -// -// TODO(davidben): Is this alignment valuable? Record-splitting makes this a -// mess. -size_t ssl_seal_align_prefix_len(const SSL *ssl); - -// tls_seal_record seals a new record of type |type| and body |in| and writes it -// to |out|. At most |max_out| bytes will be written. It returns one on success -// and zero on error. If enabled, |tls_seal_record| implements TLS 1.0 CBC 1/n-1 -// record splitting and may write two records concatenated. -// -// For a large record, the bulk of the ciphertext will begin -// |ssl_seal_align_prefix_len| bytes into out. Aligning |out| appropriately may -// improve performance. It writes at most |in_len| + |SSL_max_seal_overhead| -// bytes to |out|. -// -// |in| and |out| may not alias. -int tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, - uint8_t type, const uint8_t *in, size_t in_len); - -enum dtls1_use_epoch_t { - dtls1_use_previous_epoch, - dtls1_use_current_epoch, -}; - -// dtls_max_seal_overhead returns the maximum overhead, in bytes, of sealing a -// record. -size_t dtls_max_seal_overhead(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); - -// dtls_seal_prefix_len returns the number of bytes of prefix to reserve in -// front of the plaintext when sealing a record in-place. -size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); - -// dtls_seal_record implements |tls_seal_record| for DTLS. |use_epoch| selects -// which epoch's cipher state to use. Unlike |tls_seal_record|, |in| and |out| -// may alias but, if they do, |in| must be exactly |dtls_seal_prefix_len| bytes -// ahead of |out|. -int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, - uint8_t type, const uint8_t *in, size_t in_len, - enum dtls1_use_epoch_t use_epoch); - -// ssl_process_alert processes |in| as an alert and updates |ssl|'s shutdown -// state. It returns one of |ssl_open_record_discard|, |ssl_open_record_error|, -// |ssl_open_record_close_notify|, or |ssl_open_record_fatal_alert| as -// appropriate. -enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, - Span in); - - -// Private key operations. - -// ssl_has_private_key returns one if |ssl| has a private key -// configured and zero otherwise. -int ssl_has_private_key(const SSL *ssl); - -// ssl_private_key_* perform the corresponding operation on -// |SSL_PRIVATE_KEY_METHOD|. If there is a custom private key configured, they -// call the corresponding function or |complete| depending on whether there is a -// pending operation. Otherwise, they implement the operation with -// |EVP_PKEY|. - -enum ssl_private_key_result_t ssl_private_key_sign( - SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, - uint16_t sigalg, Span in); - -enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, - uint8_t *out, - size_t *out_len, - size_t max_out, - Span in); - -// ssl_private_key_supports_signature_algorithm returns whether |hs|'s private -// key supports |sigalg|. -bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, - uint16_t sigalg); - -// ssl_public_key_verify verifies that the |signature| is valid for the public -// key |pkey| and input |in|, using the signature algorithm |sigalg|. -bool ssl_public_key_verify(SSL *ssl, Span signature, - uint16_t sigalg, EVP_PKEY *pkey, - Span in); - - -// Custom extensions - -} // namespace bssl - -// |SSL_CUSTOM_EXTENSION| is a structure that contains information about -// custom-extension callbacks. It is defined unnamespaced for compatibility with -// |STACK_OF(SSL_CUSTOM_EXTENSION)|. -typedef struct ssl_custom_extension { - SSL_custom_ext_add_cb add_callback; - void *add_arg; - SSL_custom_ext_free_cb free_callback; - SSL_custom_ext_parse_cb parse_callback; - void *parse_arg; - uint16_t value; -} SSL_CUSTOM_EXTENSION; - -DEFINE_STACK_OF(SSL_CUSTOM_EXTENSION) - -namespace bssl { - -void SSL_CUSTOM_EXTENSION_free(SSL_CUSTOM_EXTENSION *custom_extension); - -int custom_ext_add_clienthello(SSL_HANDSHAKE *hs, CBB *extensions); -int custom_ext_parse_serverhello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension); -int custom_ext_parse_clienthello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension); -int custom_ext_add_serverhello(SSL_HANDSHAKE *hs, CBB *extensions); - - -// Key shares. - -// SSLKeyShare abstracts over Diffie-Hellman-like key exchanges. -class SSLKeyShare { - public: - virtual ~SSLKeyShare() {} - static constexpr bool kAllowUniquePtr = true; - HAS_VIRTUAL_DESTRUCTOR - - // Create returns a SSLKeyShare instance for use with group |group_id| or - // nullptr on error. - static UniquePtr Create(uint16_t group_id); - - // GroupID returns the group ID. - virtual uint16_t GroupID() const PURE_VIRTUAL; - - // Offer generates a keypair and writes the public value to - // |out_public_key|. It returns true on success and false on error. - virtual bool Offer(CBB *out_public_key) PURE_VIRTUAL; - - // Accept performs a key exchange against the |peer_key| generated by |offer|. - // On success, it returns true, writes the public value to |out_public_key|, - // and sets |*out_secret| the shared secret. On failure, it returns false and - // sets |*out_alert| to an alert to send to the peer. - // - // The default implementation calls |Offer| and then |Finish|, assuming a key - // exchange protocol where the peers are symmetric. - virtual bool Accept(CBB *out_public_key, Array *out_secret, - uint8_t *out_alert, Span peer_key); - - // Finish performs a key exchange against the |peer_key| generated by - // |Accept|. On success, it returns true and sets |*out_secret| to the shared - // secret. On failure, it returns zero and sets |*out_alert| to an alert to - // send to the peer. - virtual bool Finish(Array *out_secret, uint8_t *out_alert, - Span peer_key) PURE_VIRTUAL; -}; - -// ssl_nid_to_group_id looks up the group corresponding to |nid|. On success, it -// sets |*out_group_id| to the group ID and returns one. Otherwise, it returns -// zero. -int ssl_nid_to_group_id(uint16_t *out_group_id, int nid); - -// ssl_name_to_group_id looks up the group corresponding to the |name| string -// of length |len|. On success, it sets |*out_group_id| to the group ID and -// returns one. Otherwise, it returns zero. -int ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len); - - -// Handshake messages. - -struct SSLMessage { - bool is_v2_hello; - uint8_t type; - CBS body; - // raw is the entire serialized handshake message, including the TLS or DTLS - // message header. - CBS raw; -}; - -// SSL_MAX_HANDSHAKE_FLIGHT is the number of messages, including -// ChangeCipherSpec, in the longest handshake flight. Currently this is the -// client's second leg in a full handshake when client certificates, NPN, and -// Channel ID, are all enabled. -#define SSL_MAX_HANDSHAKE_FLIGHT 7 - -extern const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE]; -extern const uint8_t kDraftDowngradeRandom[8]; - -// ssl_max_handshake_message_len returns the maximum number of bytes permitted -// in a handshake message for |ssl|. -size_t ssl_max_handshake_message_len(const SSL *ssl); - -// tls_can_accept_handshake_data returns whether |ssl| is able to accept more -// data into handshake buffer. -bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert); - -// tls_has_unprocessed_handshake_data returns whether there is buffered -// handshake data that has not been consumed by |get_message|. -bool tls_has_unprocessed_handshake_data(const SSL *ssl); - -// dtls_has_unprocessed_handshake_data behaves like -// |tls_has_unprocessed_handshake_data| for DTLS. -bool dtls_has_unprocessed_handshake_data(const SSL *ssl); - -struct DTLS_OUTGOING_MESSAGE { - DTLS_OUTGOING_MESSAGE() {} - DTLS_OUTGOING_MESSAGE(const DTLS_OUTGOING_MESSAGE &) = delete; - DTLS_OUTGOING_MESSAGE &operator=(const DTLS_OUTGOING_MESSAGE &) = delete; - ~DTLS_OUTGOING_MESSAGE() { Clear(); } - - void Clear(); - - uint8_t *data = nullptr; - uint32_t len = 0; - uint16_t epoch = 0; - bool is_ccs = false; -}; - -// dtls_clear_outgoing_messages releases all buffered outgoing messages. -void dtls_clear_outgoing_messages(SSL *ssl); - - -// Callbacks. - -// ssl_do_info_callback calls |ssl|'s info callback, if set. -void ssl_do_info_callback(const SSL *ssl, int type, int value); - -// ssl_do_msg_callback calls |ssl|'s message callback, if set. -void ssl_do_msg_callback(SSL *ssl, int is_write, int content_type, - Span in); - - -// Transport buffers. - -class SSLBuffer { - public: - SSLBuffer() {} - ~SSLBuffer() { Clear(); } - - SSLBuffer(const SSLBuffer &) = delete; - SSLBuffer &operator=(const SSLBuffer &) = delete; - - uint8_t *data() { return buf_ + offset_; } - size_t size() const { return size_; } - bool empty() const { return size_ == 0; } - size_t cap() const { return cap_; } - - Span span() { return MakeSpan(data(), size()); } - - Span remaining() { - return MakeSpan(data() + size(), cap() - size()); - } - - // Clear releases the buffer. - void Clear(); - - // EnsureCap ensures the buffer has capacity at least |new_cap|, aligned such - // that data written after |header_len| is aligned to a - // |SSL3_ALIGN_PAYLOAD|-byte boundary. It returns true on success and false - // on error. - bool EnsureCap(size_t header_len, size_t new_cap); - - // DidWrite extends the buffer by |len|. The caller must have filled in to - // this point. - void DidWrite(size_t len); - - // Consume consumes |len| bytes from the front of the buffer. The memory - // consumed will remain valid until the next call to |DiscardConsumed| or - // |Clear|. - void Consume(size_t len); - - // DiscardConsumed discards the consumed bytes from the buffer. If the buffer - // is now empty, it releases memory used by it. - void DiscardConsumed(); - - private: - // buf_ is the memory allocated for this buffer. - uint8_t *buf_ = nullptr; - // offset_ is the offset into |buf_| which the buffer contents start at. - uint16_t offset_ = 0; - // size_ is the size of the buffer contents from |buf_| + |offset_|. - uint16_t size_ = 0; - // cap_ is how much memory beyond |buf_| + |offset_| is available. - uint16_t cap_ = 0; -}; - -// ssl_read_buffer_extend_to extends the read buffer to the desired length. For -// TLS, it reads to the end of the buffer until the buffer is |len| bytes -// long. For DTLS, it reads a new packet and ignores |len|. It returns one on -// success, zero on EOF, and a negative number on error. -// -// It is an error to call |ssl_read_buffer_extend_to| in DTLS when the buffer is -// non-empty. -int ssl_read_buffer_extend_to(SSL *ssl, size_t len); - -// ssl_handle_open_record handles the result of passing |ssl->s3->read_buffer| -// to a record-processing function. If |ret| is a success or if the caller -// should retry, it returns one and sets |*out_retry|. Otherwise, it returns <= -// 0. -int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, - size_t consumed, uint8_t alert); - -// ssl_write_buffer_flush flushes the write buffer to the transport. It returns -// one on success and <= 0 on error. For DTLS, whether or not the write -// succeeds, the write buffer will be cleared. -int ssl_write_buffer_flush(SSL *ssl); - - -// Certificate functions. - -// ssl_has_certificate returns one if a certificate and private key are -// configured and zero otherwise. -int ssl_has_certificate(const SSL *ssl); - -// ssl_parse_cert_chain parses a certificate list from |cbs| in the format used -// by a TLS Certificate message. On success, it advances |cbs| and returns -// true. Otherwise, it returns false and sets |*out_alert| to an alert to send -// to the peer. -// -// If the list is non-empty then |*out_chain| and |*out_pubkey| will be set to -// the certificate chain and the leaf certificate's public key -// respectively. Otherwise, both will be set to nullptr. -// -// If the list is non-empty and |out_leaf_sha256| is non-NULL, it writes the -// SHA-256 hash of the leaf to |out_leaf_sha256|. -bool ssl_parse_cert_chain(uint8_t *out_alert, - UniquePtr *out_chain, - UniquePtr *out_pubkey, - uint8_t *out_leaf_sha256, CBS *cbs, - CRYPTO_BUFFER_POOL *pool); - -// ssl_add_cert_chain adds |ssl|'s certificate chain to |cbb| in the format used -// by a TLS Certificate message. If there is no certificate chain, it emits an -// empty certificate list. It returns one on success and zero on error. -int ssl_add_cert_chain(SSL *ssl, CBB *cbb); - -// ssl_cert_check_digital_signature_key_usage parses the DER-encoded, X.509 -// certificate in |in| and returns one if doesn't specify a key usage or, if it -// does, if it includes digitalSignature. Otherwise it pushes to the error -// queue and returns zero. -int ssl_cert_check_digital_signature_key_usage(const CBS *in); - -// ssl_cert_parse_pubkey extracts the public key from the DER-encoded, X.509 -// certificate in |in|. It returns an allocated |EVP_PKEY| or else returns -// nullptr and pushes to the error queue. -UniquePtr ssl_cert_parse_pubkey(const CBS *in); - -// ssl_parse_client_CA_list parses a CA list from |cbs| in the format used by a -// TLS CertificateRequest message. On success, it returns a newly-allocated -// |CRYPTO_BUFFER| list and advances |cbs|. Otherwise, it returns nullptr and -// sets |*out_alert| to an alert to send to the peer. -UniquePtr ssl_parse_client_CA_list(SSL *ssl, - uint8_t *out_alert, - CBS *cbs); - -// ssl_has_client_CAs returns there are configured CAs. -bool ssl_has_client_CAs(SSL *ssl); - -// ssl_add_client_CA_list adds the configured CA list to |cbb| in the format -// used by a TLS CertificateRequest message. It returns one on success and zero -// on error. -int ssl_add_client_CA_list(SSL *ssl, CBB *cbb); - -// ssl_check_leaf_certificate returns one if |pkey| and |leaf| are suitable as -// a server's leaf certificate for |hs|. Otherwise, it returns zero and pushes -// an error on the error queue. -int ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, - const CRYPTO_BUFFER *leaf); - -// ssl_on_certificate_selected is called once the certificate has been selected. -// It finalizes the certificate and initializes |hs->local_pubkey|. It returns -// one on success and zero on error. -int ssl_on_certificate_selected(SSL_HANDSHAKE *hs); - - -// TLS 1.3 key derivation. - -// tls13_init_key_schedule initializes the handshake hash and key derivation -// state, and incorporates the PSK. The cipher suite and PRF hash must have been -// selected at this point. It returns one on success and zero on error. -int tls13_init_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len); - -// tls13_init_early_key_schedule initializes the handshake hash and key -// derivation state from the resumption secret and incorporates the PSK to -// derive the early secrets. It returns one on success and zero on error. -int tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len); - -// tls13_advance_key_schedule incorporates |in| into the key schedule with -// HKDF-Extract. It returns one on success and zero on error. -int tls13_advance_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *in, - size_t len); - -// tls13_set_traffic_key sets the read or write traffic keys to -// |traffic_secret|. It returns one on success and zero on error. -int tls13_set_traffic_key(SSL *ssl, enum evp_aead_direction_t direction, - const uint8_t *traffic_secret, - size_t traffic_secret_len); - -// tls13_derive_early_secrets derives the early traffic secret. It returns one -// on success and zero on error. -int tls13_derive_early_secrets(SSL_HANDSHAKE *hs); - -// tls13_derive_handshake_secrets derives the handshake traffic secret. It -// returns one on success and zero on error. -int tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs); - -// tls13_rotate_traffic_key derives the next read or write traffic secret. It -// returns one on success and zero on error. -int tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction); - -// tls13_derive_application_secrets derives the initial application data traffic -// and exporter secrets based on the handshake transcripts and |master_secret|. -// It returns one on success and zero on error. -int tls13_derive_application_secrets(SSL_HANDSHAKE *hs); - -// tls13_derive_resumption_secret derives the |resumption_secret|. -int tls13_derive_resumption_secret(SSL_HANDSHAKE *hs); - -// tls13_export_keying_material provides an exporter interface to use the -// |exporter_secret|. -int tls13_export_keying_material(SSL *ssl, Span out, - Span secret, - Span label, - Span context); - -// tls13_finished_mac calculates the MAC of the handshake transcript to verify -// the integrity of the Finished message, and stores the result in |out| and -// length in |out_len|. |is_server| is 1 if this is for the Server Finished and -// 0 for the Client Finished. -int tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, - size_t *out_len, int is_server); - -// tls13_derive_session_psk calculates the PSK for this session based on the -// resumption master secret and |nonce|. It returns true on success, and false -// on failure. -bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce); - -// tls13_write_psk_binder calculates the PSK binder value and replaces the last -// bytes of |msg| with the resulting value. It returns 1 on success, and 0 on -// failure. -int tls13_write_psk_binder(SSL_HANDSHAKE *hs, uint8_t *msg, size_t len); - -// tls13_verify_psk_binder verifies that the handshake transcript, truncated -// up to the binders has a valid signature using the value of |session|'s -// resumption secret. It returns 1 on success, and 0 on failure. -int tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, - const SSLMessage &msg, CBS *binders); - - -// Handshake functions. - -enum ssl_hs_wait_t { - ssl_hs_error, - ssl_hs_ok, - ssl_hs_read_server_hello, - ssl_hs_read_message, - ssl_hs_flush, - ssl_hs_certificate_selection_pending, - ssl_hs_handoff, - ssl_hs_x509_lookup, - ssl_hs_channel_id_lookup, - ssl_hs_private_key_operation, - ssl_hs_pending_session, - ssl_hs_pending_ticket, - ssl_hs_early_return, - ssl_hs_early_data_rejected, - ssl_hs_read_end_of_early_data, - ssl_hs_read_change_cipher_spec, - ssl_hs_certificate_verify, -}; - -enum ssl_grease_index_t { - ssl_grease_cipher = 0, - ssl_grease_group, - ssl_grease_extension1, - ssl_grease_extension2, - ssl_grease_version, - ssl_grease_ticket_extension, - ssl_grease_last_index = ssl_grease_ticket_extension, -}; - -struct SSL_HANDSHAKE { - explicit SSL_HANDSHAKE(SSL *ssl); - ~SSL_HANDSHAKE(); - static constexpr bool kAllowUniquePtr = true; - - // ssl is a non-owning pointer to the parent |SSL| object. - SSL *ssl; - - // wait contains the operation the handshake is currently blocking on or - // |ssl_hs_ok| if none. - enum ssl_hs_wait_t wait = ssl_hs_ok; - - // state is the internal state for the TLS 1.2 and below handshake. Its - // values depend on |do_handshake| but the starting state is always zero. - int state = 0; - - // tls13_state is the internal state for the TLS 1.3 handshake. Its values - // depend on |do_handshake| but the starting state is always zero. - int tls13_state = 0; - - // min_version is the minimum accepted protocol version, taking account both - // |SSL_OP_NO_*| and |SSL_CTX_set_min_proto_version| APIs. - uint16_t min_version = 0; - - // max_version is the maximum accepted protocol version, taking account both - // |SSL_OP_NO_*| and |SSL_CTX_set_max_proto_version| APIs. - uint16_t max_version = 0; - - size_t hash_len = 0; - uint8_t secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t early_traffic_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t client_handshake_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t server_handshake_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t client_traffic_secret_0[EVP_MAX_MD_SIZE] = {0}; - uint8_t server_traffic_secret_0[EVP_MAX_MD_SIZE] = {0}; - uint8_t expected_client_finished[EVP_MAX_MD_SIZE] = {0}; - - union { - // sent is a bitset where the bits correspond to elements of kExtensions - // in t1_lib.c. Each bit is set if that extension was sent in a - // ClientHello. It's not used by servers. - uint32_t sent = 0; - // received is a bitset, like |sent|, but is used by servers to record - // which extensions were received from a client. - uint32_t received; - } extensions; - - union { - // sent is a bitset where the bits correspond to elements of - // |client_custom_extensions| in the |SSL_CTX|. Each bit is set if that - // extension was sent in a ClientHello. It's not used by servers. - uint16_t sent = 0; - // received is a bitset, like |sent|, but is used by servers to record - // which custom extensions were received from a client. The bits here - // correspond to |server_custom_extensions|. - uint16_t received; - } custom_extensions; - - // retry_group is the group ID selected by the server in HelloRetryRequest in - // TLS 1.3. - uint16_t retry_group = 0; - - // error, if |wait| is |ssl_hs_error|, is the error the handshake failed on. - UniquePtr error; - - // key_share is the current key exchange instance. - UniquePtr key_share; - - // transcript is the current handshake transcript. - SSLTranscript transcript; - - // cookie is the value of the cookie received from the server, if any. - Array cookie; - - // key_share_bytes is the value of the previously sent KeyShare extension by - // the client in TLS 1.3. - Array key_share_bytes; - - // ecdh_public_key, for servers, is the key share to be sent to the client in - // TLS 1.3. - Array ecdh_public_key; - - // peer_sigalgs are the signature algorithms that the peer supports. These are - // taken from the contents of the signature algorithms extension for a server - // or from the CertificateRequest for a client. - Array peer_sigalgs; - - // peer_supported_group_list contains the supported group IDs advertised by - // the peer. This is only set on the server's end. The server does not - // advertise this extension to the client. - Array peer_supported_group_list; - - // peer_key is the peer's ECDH key for a TLS 1.2 client. - Array peer_key; - - // negotiated_token_binding_version is used by a server to store the - // on-the-wire encoding of the Token Binding protocol version to advertise in - // the ServerHello/EncryptedExtensions if the Token Binding extension is to be - // sent. - uint16_t negotiated_token_binding_version; - - // server_params, in a TLS 1.2 server, stores the ServerKeyExchange - // parameters. It has client and server randoms prepended for signing - // convenience. - Array server_params; - - // peer_psk_identity_hint, on the client, is the psk_identity_hint sent by the - // server when using a TLS 1.2 PSK key exchange. - UniquePtr peer_psk_identity_hint; - - // ca_names, on the client, contains the list of CAs received in a - // CertificateRequest message. - UniquePtr ca_names; - - // cached_x509_ca_names contains a cache of parsed versions of the elements of - // |ca_names|. This pointer is left non-owning so only - // |ssl_crypto_x509_method| needs to link against crypto/x509. - STACK_OF(X509_NAME) *cached_x509_ca_names = nullptr; - - // certificate_types, on the client, contains the set of certificate types - // received in a CertificateRequest message. - Array certificate_types; - - // local_pubkey is the public key we are authenticating as. - UniquePtr local_pubkey; - - // peer_pubkey is the public key parsed from the peer's leaf certificate. - UniquePtr peer_pubkey; - - // new_session is the new mutable session being established by the current - // handshake. It should not be cached. - UniquePtr new_session; - - // early_session is the session corresponding to the current 0-RTT state on - // the client if |in_early_data| is true. - UniquePtr early_session; - - // new_cipher is the cipher being negotiated in this handshake. - const SSL_CIPHER *new_cipher = nullptr; - - // key_block is the record-layer key block for TLS 1.2 and earlier. - Array key_block; - - // scts_requested is true if the SCT extension is in the ClientHello. - bool scts_requested:1; - - // needs_psk_binder is true if the ClientHello has a placeholder PSK binder to - // be filled in. - bool needs_psk_binder:1; - - bool received_hello_retry_request:1; - bool sent_hello_retry_request:1; - - bool received_custom_extension:1; - - // handshake_finalized is true once the handshake has completed, at which - // point accessors should use the established state. - bool handshake_finalized:1; - - // accept_psk_mode stores whether the client's PSK mode is compatible with our - // preferences. - bool accept_psk_mode:1; - - // cert_request is true if a client certificate was requested. - bool cert_request:1; - - // certificate_status_expected is true if OCSP stapling was negotiated and the - // server is expected to send a CertificateStatus message. (This is used on - // both the client and server sides.) - bool certificate_status_expected:1; - - // ocsp_stapling_requested is true if a client requested OCSP stapling. - bool ocsp_stapling_requested:1; - - // should_ack_sni is used by a server and indicates that the SNI extension - // should be echoed in the ServerHello. - bool should_ack_sni:1; - - // in_false_start is true if there is a pending client handshake in False - // Start. The client may write data at this point. - bool in_false_start:1; - - // in_early_data is true if there is a pending handshake that has progressed - // enough to send and receive early data. - bool in_early_data:1; - - // early_data_offered is true if the client sent the early_data extension. - bool early_data_offered:1; - - // can_early_read is true if application data may be read at this point in the - // handshake. - bool can_early_read:1; - - // can_early_write is true if application data may be written at this point in - // the handshake. - bool can_early_write:1; - - // next_proto_neg_seen is one of NPN was negotiated. - bool next_proto_neg_seen:1; - - // ticket_expected is true if a TLS 1.2 NewSessionTicket message is to be sent - // or received. - bool ticket_expected:1; - - // extended_master_secret is true if the extended master secret extension is - // negotiated in this handshake. - bool extended_master_secret:1; - - // pending_private_key_op is true if there is a pending private key operation - // in progress. - bool pending_private_key_op:1; - - // grease_seeded is true if |grease_seed| has been initialized. - bool grease_seeded:1; - - // client_version is the value sent or received in the ClientHello version. - uint16_t client_version = 0; - - // early_data_read is the amount of early data that has been read by the - // record layer. - uint16_t early_data_read = 0; - - // early_data_written is the amount of early data that has been written by the - // record layer. - uint16_t early_data_written = 0; - - // session_id is the session ID in the ClientHello, used for the experimental - // TLS 1.3 variant. - uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH] = {0}; - uint8_t session_id_len = 0; - - // grease_seed is the entropy for GREASE values. It is valid if - // |grease_seeded| is true. - uint8_t grease_seed[ssl_grease_last_index + 1] = {0}; - - // dummy_pq_padding_len, in a server, is the length of the extension that - // should be echoed in a ServerHello, or zero if no extension should be - // echoed. - uint16_t dummy_pq_padding_len = 0; -}; - -UniquePtr ssl_handshake_new(SSL *ssl); - -// ssl_check_message_type checks if |msg| has type |type|. If so it returns -// one. Otherwise, it sends an alert and returns zero. -bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type); - -// ssl_run_handshake runs the TLS handshake. It returns one on success and <= 0 -// on error. It sets |out_early_return| to one if we've completed the handshake -// early. -int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return); - -// The following are implementations of |do_handshake| for the client and -// server. -enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs); -enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs); -enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs); -enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs); - -// The following functions return human-readable representations of the TLS -// handshake states for debugging. -const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs); -const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs); -const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs); -const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs); - -// tls13_post_handshake processes a post-handshake message. It returns one on -// success and zero on failure. -int tls13_post_handshake(SSL *ssl, const SSLMessage &msg); - -int tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int allow_anonymous); -int tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg); - -// tls13_process_finished processes |msg| as a Finished message from the -// peer. If |use_saved_value| is one, the verify_data is compared against -// |hs->expected_client_finished| rather than computed fresh. -int tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int use_saved_value); - -int tls13_add_certificate(SSL_HANDSHAKE *hs); - -// tls13_add_certificate_verify adds a TLS 1.3 CertificateVerify message to the -// handshake. If it returns |ssl_private_key_retry|, it should be called again -// to retry when the signing operation is completed. -enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs); - -int tls13_add_finished(SSL_HANDSHAKE *hs); -int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg); - -bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, - Array *out_secret, - uint8_t *out_alert, CBS *contents); -bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found, - Array *out_secret, - uint8_t *out_alert, CBS *contents); -bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); - -bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, - CBS *contents); -bool ssl_ext_pre_shared_key_parse_clienthello( - SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders, - uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, CBS *contents); -bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); - -// ssl_is_sct_list_valid does a shallow parse of the SCT list in |contents| and -// returns one iff it's valid. -int ssl_is_sct_list_valid(const CBS *contents); - -int ssl_write_client_hello(SSL_HANDSHAKE *hs); - -enum ssl_cert_verify_context_t { - ssl_cert_verify_server, - ssl_cert_verify_client, - ssl_cert_verify_channel_id, -}; - -// tls13_get_cert_verify_signature_input generates the message to be signed for -// TLS 1.3's CertificateVerify message. |cert_verify_context| determines the -// type of signature. It sets |*out| to a newly allocated buffer containing the -// result. This function returns true on success and false on failure. -bool tls13_get_cert_verify_signature_input( - SSL_HANDSHAKE *hs, Array *out, - enum ssl_cert_verify_context_t cert_verify_context); - -// ssl_is_alpn_protocol_allowed returns whether |protocol| is a valid server -// selection for |ssl|'s client preferences. -bool ssl_is_alpn_protocol_allowed(const SSL *ssl, Span protocol); - -// ssl_negotiate_alpn negotiates the ALPN extension, if applicable. It returns -// true on successful negotiation or if nothing was negotiated. It returns false -// and sets |*out_alert| to an alert on error. -bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, - const SSL_CLIENT_HELLO *client_hello); - -struct SSL_EXTENSION_TYPE { - uint16_t type; - bool *out_present; - CBS *out_data; -}; - -// ssl_parse_extensions parses a TLS extensions block out of |cbs| and advances -// it. It writes the parsed extensions to pointers denoted by |ext_types|. On -// success, it fills in the |out_present| and |out_data| fields and returns one. -// Otherwise, it sets |*out_alert| to an alert to send and returns zero. Unknown -// extensions are rejected unless |ignore_unknown| is 1. -int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert, - const SSL_EXTENSION_TYPE *ext_types, - size_t num_ext_types, int ignore_unknown); - -// ssl_verify_peer_cert verifies the peer certificate for |hs|. -enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs); - -enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs); -bool ssl_send_finished(SSL_HANDSHAKE *hs); -bool ssl_output_cert_chain(SSL *ssl); - - -// SSLKEYLOGFILE functions. - -// ssl_log_secret logs |secret| with label |label|, if logging is enabled for -// |ssl|. It returns one on success and zero on failure. -int ssl_log_secret(const SSL *ssl, const char *label, const uint8_t *secret, - size_t secret_len); - - -// ClientHello functions. - -int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, - const SSLMessage &msg); - -int ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, - CBS *out, uint16_t extension_type); - -int ssl_client_cipher_list_contains_cipher(const SSL_CLIENT_HELLO *client_hello, - uint16_t id); - - -// GREASE. - -// ssl_get_grease_value returns a GREASE value for |hs|. For a given -// connection, the values for each index will be deterministic. This allows the -// same ClientHello be sent twice for a HelloRetryRequest or the same group be -// advertised in both supported_groups and key_shares. -uint16_t ssl_get_grease_value(SSL_HANDSHAKE *hs, enum ssl_grease_index_t index); - - -// Signature algorithms. - -// tls1_parse_peer_sigalgs parses |sigalgs| as the list of peer signature -// algorithms and saves them on |hs|. It returns true on success and false on -// error. -bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *sigalgs); - -// tls1_get_legacy_signature_algorithm sets |*out| to the signature algorithm -// that should be used with |pkey| in TLS 1.1 and earlier. It returns true on -// success and false if |pkey| may not be used at those versions. -bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey); - -// tls1_choose_signature_algorithm sets |*out| to a signature algorithm for use -// with |hs|'s private key based on the peer's preferences and the algorithms -// supported. It returns true on success and false on error. -bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out); - -// tls12_add_verify_sigalgs adds the signature algorithms acceptable for the -// peer signature to |out|. It returns true on success and false on error. -bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out); - -// tls12_check_peer_sigalg checks if |sigalg| is acceptable for the peer -// signature. It returns true on success and false on error, setting -// |*out_alert| to an alert to send. -bool tls12_check_peer_sigalg(const SSL *ssl, uint8_t *out_alert, - uint16_t sigalg); - - -// Underdocumented functions. -// -// Functions below here haven't been touched up and may be underdocumented. - -#define TLSEXT_CHANNEL_ID_SIZE 128 - -// From RFC4492, used in encoding the curve type in ECParameters -#define NAMED_CURVE_TYPE 3 - -struct CERT { - EVP_PKEY *privatekey; - - // chain contains the certificate chain, with the leaf at the beginning. The - // first element of |chain| may be NULL to indicate that the leaf certificate - // has not yet been set. - // If |chain| != NULL -> len(chain) >= 1 - // If |chain[0]| == NULL -> len(chain) >= 2. - // |chain[1..]| != NULL - STACK_OF(CRYPTO_BUFFER) *chain; - - // x509_chain may contain a parsed copy of |chain[1..]|. This is only used as - // a cache in order to implement “get0” functions that return a non-owning - // pointer to the certificate chain. - STACK_OF(X509) *x509_chain; - - // x509_leaf may contain a parsed copy of the first element of |chain|. This - // is only used as a cache in order to implement “get0” functions that return - // a non-owning pointer to the certificate chain. - X509 *x509_leaf; - - // x509_stash contains the last |X509| object append to the chain. This is a - // workaround for some third-party code that continue to use an |X509| object - // even after passing ownership with an “add0” function. - X509 *x509_stash; - - // key_method, if non-NULL, is a set of callbacks to call for private key - // operations. - const SSL_PRIVATE_KEY_METHOD *key_method; - - // x509_method contains pointers to functions that might deal with |X509| - // compatibility, or might be a no-op, depending on the application. - const SSL_X509_METHOD *x509_method; - - // sigalgs, if non-NULL, is the set of signature algorithms supported by - // |privatekey| in decreasing order of preference. - uint16_t *sigalgs; - size_t num_sigalgs; - - // Certificate setup callback: if set is called whenever a - // certificate may be required (client or server). the callback - // can then examine any appropriate parameters and setup any - // certificates required. This allows advanced applications - // to select certificates on the fly: for example based on - // supported signature algorithms or curves. - int (*cert_cb)(SSL *ssl, void *arg); - void *cert_cb_arg; - - // Optional X509_STORE for certificate validation. If NULL the parent SSL_CTX - // store is used instead. - X509_STORE *verify_store; - - // Signed certificate timestamp list to be sent to the client, if requested - CRYPTO_BUFFER *signed_cert_timestamp_list; - - // OCSP response to be sent to the client, if requested. - CRYPTO_BUFFER *ocsp_response; - - // sid_ctx partitions the session space within a shared session cache or - // ticket key. Only sessions with a matching value will be accepted. - uint8_t sid_ctx_length; - uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - - // If enable_early_data is true, early data can be sent and accepted. - bool enable_early_data:1; -}; - -// |SSL_PROTOCOL_METHOD| abstracts between TLS and DTLS. -struct SSL_PROTOCOL_METHOD { - bool is_dtls; - bool (*ssl_new)(SSL *ssl); - void (*ssl_free)(SSL *ssl); - // get_message sets |*out| to the current handshake message and returns true - // if one has been received. It returns false if more input is needed. - bool (*get_message)(SSL *ssl, SSLMessage *out); - // next_message is called to release the current handshake message. - void (*next_message)(SSL *ssl); - // Use the |ssl_open_handshake| wrapper. - ssl_open_record_t (*open_handshake)(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); - // Use the |ssl_open_change_cipher_spec| wrapper. - ssl_open_record_t (*open_change_cipher_spec)(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); - // Use the |ssl_open_app_data| wrapper. - ssl_open_record_t (*open_app_data)(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); - int (*write_app_data)(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, - int len); - int (*dispatch_alert)(SSL *ssl); - // init_message begins a new handshake message of type |type|. |cbb| is the - // root CBB to be passed into |finish_message|. |*body| is set to a child CBB - // the caller should write to. It returns true on success and false on error. - bool (*init_message)(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); - // finish_message finishes a handshake message. It sets |*out_msg| to the - // serialized message. It returns true on success and false on error. - bool (*finish_message)(SSL *ssl, CBB *cbb, bssl::Array *out_msg); - // add_message adds a handshake message to the pending flight. It returns - // true on success and false on error. - bool (*add_message)(SSL *ssl, bssl::Array msg); - // add_change_cipher_spec adds a ChangeCipherSpec record to the pending - // flight. It returns true on success and false on error. - bool (*add_change_cipher_spec)(SSL *ssl); - // add_alert adds an alert to the pending flight. It returns true on success - // and false on error. - bool (*add_alert)(SSL *ssl, uint8_t level, uint8_t desc); - // flush_flight flushes the pending flight to the transport. It returns one on - // success and <= 0 on error. - int (*flush_flight)(SSL *ssl); - // on_handshake_complete is called when the handshake is complete. - void (*on_handshake_complete)(SSL *ssl); - // set_read_state sets |ssl|'s read cipher state to |aead_ctx|. It returns - // true on success and false if changing the read state is forbidden at this - // point. - bool (*set_read_state)(SSL *ssl, UniquePtr aead_ctx); - // set_write_state sets |ssl|'s write cipher state to |aead_ctx|. It returns - // true on success and false if changing the write state is forbidden at this - // point. - bool (*set_write_state)(SSL *ssl, UniquePtr aead_ctx); -}; - -// The following wrappers call |open_*| but handle |read_shutdown| correctly. - -// ssl_open_handshake processes a record from |in| for reading a handshake -// message. -ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); - -// ssl_open_change_cipher_spec processes a record from |in| for reading a -// ChangeCipherSpec. -ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); - -// ssl_open_app_data processes a record from |in| for reading application data. -// On success, it returns |ssl_open_record_success| and sets |*out| to the -// input. If it encounters a post-handshake message, it returns -// |ssl_open_record_discard|. The caller should then retry, after processing any -// messages received with |get_message|. -ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); - -// ssl_crypto_x509_method provides the |SSL_X509_METHOD| functions using -// crypto/x509. -extern const SSL_X509_METHOD ssl_crypto_x509_method; - -// ssl_noop_x509_method provides the |SSL_X509_METHOD| functions that avoid -// crypto/x509. -extern const SSL_X509_METHOD ssl_noop_x509_method; - -// ssl_cipher_preference_list_st contains a list of SSL_CIPHERs with -// equal-preference groups. For TLS clients, the groups are moot because the -// server picks the cipher and groups cannot be expressed on the wire. However, -// for servers, the equal-preference groups allow the client's preferences to -// be partially respected. (This only has an effect with -// SSL_OP_CIPHER_SERVER_PREFERENCE). -// -// The equal-preference groups are expressed by grouping SSL_CIPHERs together. -// All elements of a group have the same priority: no ordering is expressed -// within a group. -// -// The values in |ciphers| are in one-to-one correspondence with -// |in_group_flags|. (That is, sk_SSL_CIPHER_num(ciphers) is the number of -// bytes in |in_group_flags|.) The bytes in |in_group_flags| are either 1, to -// indicate that the corresponding SSL_CIPHER is not the last element of a -// group, or 0 to indicate that it is. -// -// For example, if |in_group_flags| contains all zeros then that indicates a -// traditional, fully-ordered preference. Every SSL_CIPHER is the last element -// of the group (i.e. they are all in a one-element group). -// -// For a more complex example, consider: -// ciphers: A B C D E F -// in_group_flags: 1 1 0 0 1 0 -// -// That would express the following, order: -// -// A E -// B -> D -> F -// C -struct ssl_cipher_preference_list_st { - STACK_OF(SSL_CIPHER) *ciphers; - uint8_t *in_group_flags; -}; - -struct tlsext_ticket_key { - static constexpr bool kAllowUniquePtr = true; - - uint8_t name[SSL_TICKET_KEY_NAME_LEN]; - uint8_t hmac_key[16]; - uint8_t aes_key[16]; - // next_rotation_tv_sec is the time (in seconds from the epoch) when the - // current key should be superseded by a new key, or the time when a previous - // key should be dropped. If zero, then the key should not be automatically - // rotated. - uint64_t next_rotation_tv_sec; -}; - -} // namespace bssl - -DECLARE_LHASH_OF(SSL_SESSION) - -namespace bssl { - -// SSLContext backs the public |SSL_CTX| type. Due to compatibility constraints, -// it is a base class for |ssl_ctx_st|. -struct SSLContext { - const SSL_PROTOCOL_METHOD *method; - const SSL_X509_METHOD *x509_method; - - // lock is used to protect various operations on this object. - CRYPTO_MUTEX lock; - - // conf_max_version is the maximum acceptable protocol version configured by - // |SSL_CTX_set_max_proto_version|. Note this version is normalized in DTLS - // and is further constrainted by |SSL_OP_NO_*|. - uint16_t conf_max_version; - - // conf_min_version is the minimum acceptable protocol version configured by - // |SSL_CTX_set_min_proto_version|. Note this version is normalized in DTLS - // and is further constrainted by |SSL_OP_NO_*|. - uint16_t conf_min_version; - - // tls13_variant is the variant of TLS 1.3 we are using for this - // configuration. - enum tls13_variant_t tls13_variant; - - struct ssl_cipher_preference_list_st *cipher_list; - - X509_STORE *cert_store; - LHASH_OF(SSL_SESSION) *sessions; - // Most session-ids that will be cached, default is - // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. - unsigned long session_cache_size; - SSL_SESSION *session_cache_head; - SSL_SESSION *session_cache_tail; - - // handshakes_since_cache_flush is the number of successful handshakes since - // the last cache flush. - int handshakes_since_cache_flush; - - // This can have one of 2 values, ored together, - // SSL_SESS_CACHE_CLIENT, - // SSL_SESS_CACHE_SERVER, - // Default is SSL_SESSION_CACHE_SERVER, which means only - // SSL_accept which cache SSL_SESSIONS. - int session_cache_mode; - - // session_timeout is the default lifetime for new sessions in TLS 1.2 and - // earlier, in seconds. - uint32_t session_timeout; - - // session_psk_dhe_timeout is the default lifetime for new sessions in TLS - // 1.3, in seconds. - uint32_t session_psk_dhe_timeout; - - // If this callback is not null, it will be called each time a session id is - // added to the cache. If this function returns 1, it means that the - // callback will do a SSL_SESSION_free() when it has finished using it. - // Otherwise, on 0, it means the callback has finished with it. If - // remove_session_cb is not null, it will be called when a session-id is - // removed from the cache. After the call, OpenSSL will SSL_SESSION_free() - // it. - int (*new_session_cb)(SSL *ssl, SSL_SESSION *sess); - void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess); - SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, - int *copy); - SSL_SESSION *(*get_session_cb_legacy)(SSL *ssl, uint8_t *data, int len, - int *copy); - - CRYPTO_refcount_t references; - - // if defined, these override the X509_verify_cert() calls - int (*app_verify_callback)(X509_STORE_CTX *store_ctx, void *arg); - void *app_verify_arg; - - enum ssl_verify_result_t (*custom_verify_callback)(SSL *ssl, - uint8_t *out_alert); - - // Default password callback. - pem_password_cb *default_passwd_callback; - - // Default password callback user data. - void *default_passwd_callback_userdata; - - // get client cert callback - int (*client_cert_cb)(SSL *ssl, X509 **out_x509, EVP_PKEY **out_pkey); - - // get channel id callback - void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey); - - CRYPTO_EX_DATA ex_data; - - // custom_*_extensions stores any callback sets for custom extensions. Note - // that these pointers will be NULL if the stack would otherwise be empty. - STACK_OF(SSL_CUSTOM_EXTENSION) *client_custom_extensions; - STACK_OF(SSL_CUSTOM_EXTENSION) *server_custom_extensions; - - // Default values used when no per-SSL value is defined follow - - void (*info_callback)(const SSL *ssl, int type, int value); - - // what we put in client cert requests - STACK_OF(CRYPTO_BUFFER) *client_CA; - - // cached_x509_client_CA is a cache of parsed versions of the elements of - // |client_CA|. - STACK_OF(X509_NAME) *cached_x509_client_CA; - - - // Default values to use in SSL structures follow (these are copied by - // SSL_new) - - uint32_t options; - uint32_t mode; - uint32_t max_cert_list; - - CERT *cert; - - // callback that allows applications to peek at protocol messages - void (*msg_callback)(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - int verify_mode; - int (*default_verify_callback)( - int ok, X509_STORE_CTX *ctx); // called 'verify_callback' in the SSL - - X509_VERIFY_PARAM *param; - - // select_certificate_cb is called before most ClientHello processing and - // before the decision whether to resume a session is made. See - // |ssl_select_cert_result_t| for details of the return values. - enum ssl_select_cert_result_t (*select_certificate_cb)( - const SSL_CLIENT_HELLO *); - - // dos_protection_cb is called once the resumption decision for a ClientHello - // has been made. It returns one to continue the handshake or zero to - // abort. - int (*dos_protection_cb) (const SSL_CLIENT_HELLO *); - - // Maximum amount of data to send in one fragment. actual record size can be - // more than this due to padding and MAC overheads. - uint16_t max_send_fragment; - - // TLS extensions servername callback - int (*tlsext_servername_callback)(SSL *, int *, void *); - void *tlsext_servername_arg; - - // RFC 4507 session ticket keys. |tlsext_ticket_key_current| may be NULL - // before the first handshake and |tlsext_ticket_key_prev| may be NULL at any - // time. Automatically generated ticket keys are rotated as needed at - // handshake time. Hence, all access must be synchronized through |lock|. - struct tlsext_ticket_key *tlsext_ticket_key_current; - struct tlsext_ticket_key *tlsext_ticket_key_prev; - - // Callback to support customisation of ticket key setting - int (*tlsext_ticket_key_cb)(SSL *ssl, uint8_t *name, uint8_t *iv, - EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc); - - // Server-only: psk_identity_hint is the default identity hint to send in - // PSK-based key exchanges. - char *psk_identity_hint; - - unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, - char *identity, - unsigned int max_identity_len, - uint8_t *psk, unsigned int max_psk_len); - unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, - uint8_t *psk, unsigned int max_psk_len); - - - // Next protocol negotiation information - // (for experimental NPN extension). - - // For a server, this contains a callback function by which the set of - // advertised protocols can be provided. - int (*next_protos_advertised_cb)(SSL *ssl, const uint8_t **out, - unsigned *out_len, void *arg); - void *next_protos_advertised_cb_arg; - // For a client, this contains a callback function that selects the - // next protocol from the list provided by the server. - int (*next_proto_select_cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg); - void *next_proto_select_cb_arg; - - // ALPN information - // (we are in the process of transitioning from NPN to ALPN.) - - // For a server, this contains a callback function that allows the - // server to select the protocol for the connection. - // out: on successful return, this must point to the raw protocol - // name (without the length prefix). - // outlen: on successful return, this contains the length of |*out|. - // in: points to the client's list of supported protocols in - // wire-format. - // inlen: the length of |in|. - int (*alpn_select_cb)(SSL *ssl, const uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg); - void *alpn_select_cb_arg; - - // For a client, this contains the list of supported protocols in wire - // format. - uint8_t *alpn_client_proto_list; - unsigned alpn_client_proto_list_len; - - // SRTP profiles we are willing to do from RFC 5764 - STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; - - // Supported group values inherited by SSL structure - size_t supported_group_list_len; - uint16_t *supported_group_list; - - // The client's Channel ID private key. - EVP_PKEY *tlsext_channel_id_private; - - // keylog_callback, if not NULL, is the key logging callback. See - // |SSL_CTX_set_keylog_callback|. - void (*keylog_callback)(const SSL *ssl, const char *line); - - // current_time_cb, if not NULL, is the function to use to get the current - // time. It sets |*out_clock| to the current time. The |ssl| argument is - // always NULL. See |SSL_CTX_set_current_time_cb|. - void (*current_time_cb)(const SSL *ssl, struct timeval *out_clock); - - // pool is used for all |CRYPTO_BUFFER|s in case we wish to share certificate - // memory. - CRYPTO_BUFFER_POOL *pool; - - // ticket_aead_method contains function pointers for opening and sealing - // session tickets. - const SSL_TICKET_AEAD_METHOD *ticket_aead_method; - - // verify_sigalgs, if not empty, is the set of signature algorithms - // accepted from the peer in decreasing order of preference. - uint16_t *verify_sigalgs; - size_t num_verify_sigalgs; - - // retain_only_sha256_of_client_certs is true if we should compute the SHA256 - // hash of the peer's certificate and then discard it to save memory and - // session space. Only effective on the server side. - bool retain_only_sha256_of_client_certs:1; - - // quiet_shutdown is true if the connection should not send a close_notify on - // shutdown. - bool quiet_shutdown:1; - - // ocsp_stapling_enabled is only used by client connections and indicates - // whether OCSP stapling will be requested. - bool ocsp_stapling_enabled:1; - - // If true, a client will request certificate timestamps. - bool signed_cert_timestamps_enabled:1; - - // tlsext_channel_id_enabled is whether Channel ID is enabled. For a server, - // means that we'll accept Channel IDs from clients. For a client, means that - // we'll advertise support. - bool tlsext_channel_id_enabled:1; - - // grease_enabled is whether draft-davidben-tls-grease-01 is enabled. - bool grease_enabled:1; - - // allow_unknown_alpn_protos is whether the client allows unsolicited ALPN - // protocols from the peer. - bool allow_unknown_alpn_protos:1; - - // ed25519_enabled is whether Ed25519 is advertised in the handshake. - bool ed25519_enabled:1; - - // false_start_allowed_without_alpn is whether False Start (if - // |SSL_MODE_ENABLE_FALSE_START| is enabled) is allowed without ALPN. - bool false_start_allowed_without_alpn:1; - - // handoff indicates that a server should stop after receiving the - // ClientHello and pause the handshake in such a way that |SSL_get_error| - // returns |SSL_HANDOFF|. - bool handoff:1; -}; - -// An ssl_shutdown_t describes the shutdown state of one end of the connection, -// whether it is alive or has been shutdown via close_notify or fatal alert. -enum ssl_shutdown_t { - ssl_shutdown_none = 0, - ssl_shutdown_close_notify = 1, - ssl_shutdown_error = 2, -}; - -struct SSL3_STATE { - static constexpr bool kAllowUniquePtr = true; - - SSL3_STATE(); - ~SSL3_STATE(); - - uint8_t read_sequence[8] = {0}; - uint8_t write_sequence[8] = {0}; - - uint8_t server_random[SSL3_RANDOM_SIZE] = {0}; - uint8_t client_random[SSL3_RANDOM_SIZE] = {0}; - - // read_buffer holds data from the transport to be processed. - SSLBuffer read_buffer; - // write_buffer holds data to be written to the transport. - SSLBuffer write_buffer; - - // pending_app_data is the unconsumed application data. It points into - // |read_buffer|. - Span pending_app_data; - - // partial write - check the numbers match - unsigned int wnum = 0; // number of bytes sent so far - int wpend_tot = 0; // number bytes written - int wpend_type = 0; - int wpend_ret = 0; // number of bytes submitted - const uint8_t *wpend_buf = nullptr; - - // read_shutdown is the shutdown state for the read half of the connection. - enum ssl_shutdown_t read_shutdown = ssl_shutdown_none; - - // write_shutdown is the shutdown state for the write half of the connection. - enum ssl_shutdown_t write_shutdown = ssl_shutdown_none; - - // read_error, if |read_shutdown| is |ssl_shutdown_error|, is the error for - // the receive half of the connection. - UniquePtr read_error; - - int alert_dispatch = 0; - - int total_renegotiations = 0; - - // This holds a variable that indicates what we were doing when a 0 or -1 is - // returned. This is needed for non-blocking IO so we know what request - // needs re-doing when in SSL_accept or SSL_connect - int rwstate = SSL_NOTHING; - - // early_data_skipped is the amount of early data that has been skipped by the - // record layer. - uint16_t early_data_skipped = 0; - - // empty_record_count is the number of consecutive empty records received. - uint8_t empty_record_count = 0; - - // warning_alert_count is the number of consecutive warning alerts - // received. - uint8_t warning_alert_count = 0; - - // key_update_count is the number of consecutive KeyUpdates received. - uint8_t key_update_count = 0; - - // skip_early_data instructs the record layer to skip unexpected early data - // messages when 0RTT is rejected. - bool skip_early_data:1; - - // have_version is true if the connection's final version is known. Otherwise - // the version has not been negotiated yet. - bool have_version:1; - - // v2_hello_done is true if the peer's V2ClientHello, if any, has been handled - // and future messages should use the record layer. - bool v2_hello_done:1; - - // is_v2_hello is true if the current handshake message was derived from a - // V2ClientHello rather than received from the peer directly. - bool is_v2_hello:1; - - // has_message is true if the current handshake message has been returned - // at least once by |get_message| and false otherwise. - bool has_message:1; - - // initial_handshake_complete is true if the initial handshake has - // completed. - bool initial_handshake_complete:1; - - // session_reused indicates whether a session was resumed. - bool session_reused:1; - - bool send_connection_binding:1; - - // In a client, this means that the server supported Channel ID and that a - // Channel ID was sent. In a server it means that we echoed support for - // Channel IDs and that tlsext_channel_id will be valid after the - // handshake. - bool tlsext_channel_id_valid:1; - - // key_update_pending is true if we have a KeyUpdate acknowledgment - // outstanding. - bool key_update_pending:1; - - // wpend_pending is true if we have a pending write outstanding. - bool wpend_pending:1; - - // early_data_accepted is true if early data was accepted by the server. - bool early_data_accepted:1; - - // draft_downgrade is whether the TLS 1.3 anti-downgrade logic would have - // fired, were it not a draft. - bool draft_downgrade:1; - - // hs_buf is the buffer of handshake data to process. - UniquePtr hs_buf; - - // pending_flight is the pending outgoing flight. This is used to flush each - // handshake flight in a single write. |write_buffer| must be written out - // before this data. - UniquePtr pending_flight; - - // pending_flight_offset is the number of bytes of |pending_flight| which have - // been successfully written. - uint32_t pending_flight_offset = 0; - - // ticket_age_skew is the difference, in seconds, between the client-sent - // ticket age and the server-computed value in TLS 1.3 server connections - // which resumed a session. - int32_t ticket_age_skew = 0; - - // aead_read_ctx is the current read cipher state. - UniquePtr aead_read_ctx; - - // aead_write_ctx is the current write cipher state. - UniquePtr aead_write_ctx; - - // hs is the handshake state for the current handshake or NULL if there isn't - // one. - UniquePtr hs; - - uint8_t write_traffic_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t read_traffic_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t exporter_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t early_exporter_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t write_traffic_secret_len = 0; - uint8_t read_traffic_secret_len = 0; - uint8_t exporter_secret_len = 0; - uint8_t early_exporter_secret_len = 0; - - // Connection binding to prevent renegotiation attacks - uint8_t previous_client_finished[12] = {0}; - uint8_t previous_client_finished_len = 0; - uint8_t previous_server_finished_len = 0; - uint8_t previous_server_finished[12] = {0}; - - uint8_t send_alert[2] = {0}; - - // established_session is the session established by the connection. This - // session is only filled upon the completion of the handshake and is - // immutable. - UniquePtr established_session; - - // Next protocol negotiation. For the client, this is the protocol that we - // sent in NextProtocol and is set when handling ServerHello extensions. - // - // For a server, this is the client's selected_protocol from NextProtocol and - // is set when handling the NextProtocol message, before the Finished - // message. - Array next_proto_negotiated; - - // ALPN information - // (we are in the process of transitioning from NPN to ALPN.) - - // In a server these point to the selected ALPN protocol after the - // ClientHello has been processed. In a client these contain the protocol - // that the server selected once the ServerHello has been processed. - Array alpn_selected; - - // hostname, on the server, is the value of the SNI extension. - UniquePtr hostname; - - // For a server: - // If |tlsext_channel_id_valid| is true, then this contains the - // verified Channel ID from the client: a P256 point, (x,y), where - // each are big-endian values. - uint8_t tlsext_channel_id[64] = {0}; - - // Contains the QUIC transport params received by the peer. - Array peer_quic_transport_params; -}; - -// lengths of messages -#define DTLS1_COOKIE_LENGTH 256 - -#define DTLS1_RT_HEADER_LENGTH 13 - -#define DTLS1_HM_HEADER_LENGTH 12 - -#define DTLS1_CCS_HEADER_LENGTH 1 - -#define DTLS1_AL_HEADER_LENGTH 2 - -struct hm_header_st { - uint8_t type; - uint32_t msg_len; - uint16_t seq; - uint32_t frag_off; - uint32_t frag_len; -}; - -// An hm_fragment is an incoming DTLS message, possibly not yet assembled. -struct hm_fragment { - static constexpr bool kAllowUniquePtr = true; - - hm_fragment() {} - hm_fragment(const hm_fragment &) = delete; - hm_fragment &operator=(const hm_fragment &) = delete; - - ~hm_fragment(); - - // type is the type of the message. - uint8_t type = 0; - // seq is the sequence number of this message. - uint16_t seq = 0; - // msg_len is the length of the message body. - uint32_t msg_len = 0; - // data is a pointer to the message, including message header. It has length - // |DTLS1_HM_HEADER_LENGTH| + |msg_len|. - uint8_t *data = nullptr; - // reassembly is a bitmask of |msg_len| bits corresponding to which parts of - // the message have been received. It is NULL if the message is complete. - uint8_t *reassembly = nullptr; -}; - -struct OPENSSL_timeval { - uint64_t tv_sec; - uint32_t tv_usec; -}; - -struct DTLS1_STATE { - static constexpr bool kAllowUniquePtr = true; - - DTLS1_STATE(); - ~DTLS1_STATE(); - - // has_change_cipher_spec is true if we have received a ChangeCipherSpec from - // the peer in this epoch. - bool has_change_cipher_spec:1; - - // outgoing_messages_complete is true if |outgoing_messages| has been - // completed by an attempt to flush it. Future calls to |add_message| and - // |add_change_cipher_spec| will start a new flight. - bool outgoing_messages_complete:1; - - // flight_has_reply is true if the current outgoing flight is complete and has - // processed at least one message. This is used to detect whether we or the - // peer sent the final flight. - bool flight_has_reply:1; - - uint8_t cookie[DTLS1_COOKIE_LENGTH] = {0}; - size_t cookie_len = 0; - - // The current data and handshake epoch. This is initially undefined, and - // starts at zero once the initial handshake is completed. - uint16_t r_epoch = 0; - uint16_t w_epoch = 0; - - // records being received in the current epoch - DTLS1_BITMAP bitmap; - - uint16_t handshake_write_seq = 0; - uint16_t handshake_read_seq = 0; - - // save last sequence number for retransmissions - uint8_t last_write_sequence[8] = {0}; - UniquePtr last_aead_write_ctx; - - // incoming_messages is a ring buffer of incoming handshake messages that have - // yet to be processed. The front of the ring buffer is message number - // |handshake_read_seq|, at position |handshake_read_seq| % - // |SSL_MAX_HANDSHAKE_FLIGHT|. - UniquePtr incoming_messages[SSL_MAX_HANDSHAKE_FLIGHT]; - - // outgoing_messages is the queue of outgoing messages from the last handshake - // flight. - DTLS_OUTGOING_MESSAGE outgoing_messages[SSL_MAX_HANDSHAKE_FLIGHT]; - uint8_t outgoing_messages_len = 0; - - // outgoing_written is the number of outgoing messages that have been - // written. - uint8_t outgoing_written = 0; - // outgoing_offset is the number of bytes of the next outgoing message have - // been written. - uint32_t outgoing_offset = 0; - - unsigned mtu = 0; // max DTLS packet size - - // num_timeouts is the number of times the retransmit timer has fired since - // the last time it was reset. - unsigned num_timeouts = 0; - - // Indicates when the last handshake msg or heartbeat sent will - // timeout. - struct OPENSSL_timeval next_timeout = {0, 0}; - - // timeout_duration_ms is the timeout duration in milliseconds. - unsigned timeout_duration_ms = 0; -}; - -// SSLConnection backs the public |SSL| type. Due to compatibility constraints, -// it is a base class for |ssl_st|. -struct SSLConnection { - // method is the method table corresponding to the current protocol (DTLS or - // TLS). - const SSL_PROTOCOL_METHOD *method; - - // version is the protocol version. - uint16_t version; - - // conf_max_version is the maximum acceptable protocol version configured by - // |SSL_set_max_proto_version|. Note this version is normalized in DTLS and is - // further constrainted by |SSL_OP_NO_*|. - uint16_t conf_max_version; - - // conf_min_version is the minimum acceptable protocol version configured by - // |SSL_set_min_proto_version|. Note this version is normalized in DTLS and is - // further constrainted by |SSL_OP_NO_*|. - uint16_t conf_min_version; - - uint16_t max_send_fragment; - - // There are 2 BIO's even though they are normally both the same. This is so - // data can be read and written to different handlers - - BIO *rbio; // used by SSL_read - BIO *wbio; // used by SSL_write - - // do_handshake runs the handshake. On completion, it returns |ssl_hs_ok|. - // Otherwise, it returns a value corresponding to what operation is needed to - // progress. - enum ssl_hs_wait_t (*do_handshake)(SSL_HANDSHAKE *hs); - - SSL3_STATE *s3; // SSLv3 variables - DTLS1_STATE *d1; // DTLSv1 variables - - // callback that allows applications to peek at protocol messages - void (*msg_callback)(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - X509_VERIFY_PARAM *param; - - // crypto - struct ssl_cipher_preference_list_st *cipher_list; - - // session info - - // This is used to hold the local certificate used (i.e. the server - // certificate for a server or the client certificate for a client). - CERT *cert; - - // initial_timeout_duration_ms is the default DTLS timeout duration in - // milliseconds. It's used to initialize the timer any time it's restarted. - unsigned initial_timeout_duration_ms; - - // tls13_variant is the variant of TLS 1.3 we are using for this - // configuration. - enum tls13_variant_t tls13_variant; - - // session is the configured session to be offered by the client. This session - // is immutable. - SSL_SESSION *session; - - int (*verify_callback)(int ok, - X509_STORE_CTX *ctx); // fail if callback returns 0 - - enum ssl_verify_result_t (*custom_verify_callback)(SSL *ssl, - uint8_t *out_alert); - - void (*info_callback)(const SSL *ssl, int type, int value); - - // Server-only: psk_identity_hint is the identity hint to send in - // PSK-based key exchanges. - char *psk_identity_hint; - - unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, - char *identity, - unsigned int max_identity_len, - uint8_t *psk, unsigned int max_psk_len); - unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, - uint8_t *psk, unsigned int max_psk_len); - - SSL_CTX *ctx; - - // extra application data - CRYPTO_EX_DATA ex_data; - - // for server side, keep the list of CA_dn we can use - STACK_OF(CRYPTO_BUFFER) *client_CA; - - // cached_x509_client_CA is a cache of parsed versions of the elements of - // |client_CA|. - STACK_OF(X509_NAME) *cached_x509_client_CA; - - uint32_t options; // protocol behaviour - uint32_t mode; // API behaviour - uint32_t max_cert_list; - uint16_t dummy_pq_padding_len; - char *tlsext_hostname; - size_t supported_group_list_len; - uint16_t *supported_group_list; // our list - - // session_ctx is the |SSL_CTX| used for the session cache and related - // settings. - SSL_CTX *session_ctx; - - // srtp_profiles is the list of configured SRTP protection profiles for - // DTLS-SRTP. - STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; - - // srtp_profile is the selected SRTP protection profile for - // DTLS-SRTP. - const SRTP_PROTECTION_PROFILE *srtp_profile; - - // The client's Channel ID private key. - EVP_PKEY *tlsext_channel_id_private; - - // For a client, this contains the list of supported protocols in wire - // format. - uint8_t *alpn_client_proto_list; - unsigned alpn_client_proto_list_len; - - // Contains a list of supported Token Binding key parameters. - uint8_t *token_binding_params; - size_t token_binding_params_len; - - // The negotiated Token Binding key parameter. Only valid if - // |token_binding_negotiated| is set. - uint8_t negotiated_token_binding_param; - - // Contains the QUIC transport params that this endpoint will send. - uint8_t *quic_transport_params; - size_t quic_transport_params_len; - - // renegotiate_mode controls how peer renegotiation attempts are handled. - enum ssl_renegotiate_mode_t renegotiate_mode; - - // verify_mode is a bitmask of |SSL_VERIFY_*| values. - uint8_t verify_mode; - - // server is true iff the this SSL* is the server half. Note: before the SSL* - // is initialized by either SSL_set_accept_state or SSL_set_connect_state, - // the side is not determined. In this state, server is always false. - bool server:1; - - // quiet_shutdown is true if the connection should not send a close_notify on - // shutdown. - bool quiet_shutdown:1; - - // Enable signed certificate time stamps. Currently client only. - bool signed_cert_timestamps_enabled:1; - - // ocsp_stapling_enabled is only used by client connections and indicates - // whether OCSP stapling will be requested. - bool ocsp_stapling_enabled:1; - - // tlsext_channel_id_enabled is copied from the |SSL_CTX|. For a server, - // means that we'll accept Channel IDs from clients. For a client, means that - // we'll advertise support. - bool tlsext_channel_id_enabled:1; - - // token_binding_negotiated is set if Token Binding was negotiated. - bool token_binding_negotiated:1; - - // retain_only_sha256_of_client_certs is true if we should compute the SHA256 - // hash of the peer's certificate and then discard it to save memory and - // session space. Only effective on the server side. - bool retain_only_sha256_of_client_certs:1; - - // handoff indicates that a server should stop after receiving the - // ClientHello and pause the handshake in such a way that |SSL_get_error| - // returns |SSL_HANDOFF|. This is copied in |SSL_new| from the |SSL_CTX| - // element of the same name and may be cleared if the handoff is declined. - bool handoff:1; - - // did_dummy_pq_padding is only valid for a client. In that context, it is - // true iff the client observed the server echoing a dummy PQ padding - // extension. - bool did_dummy_pq_padding:1; -}; - -// From draft-ietf-tls-tls13-18, used in determining PSK modes. -#define SSL_PSK_DHE_KE 0x1 - -// From draft-ietf-tls-tls13-16, used in determining whether to respond with a -// KeyUpdate. -#define SSL_KEY_UPDATE_NOT_REQUESTED 0 -#define SSL_KEY_UPDATE_REQUESTED 1 - -// kMaxEarlyDataAccepted is the advertised number of plaintext bytes of early -// data that will be accepted. This value should be slightly below -// kMaxEarlyDataSkipped in tls_record.c, which is measured in ciphertext. -static const size_t kMaxEarlyDataAccepted = 14336; - -CERT *ssl_cert_new(const SSL_X509_METHOD *x509_method); -CERT *ssl_cert_dup(CERT *cert); -void ssl_cert_clear_certs(CERT *cert); -void ssl_cert_free(CERT *cert); -int ssl_set_cert(CERT *cert, UniquePtr buffer); -int ssl_is_key_type_supported(int key_type); -// ssl_compare_public_and_private_key returns one if |pubkey| is the public -// counterpart to |privkey|. Otherwise it returns zero and pushes a helpful -// message on the error queue. -int ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, - const EVP_PKEY *privkey); -int ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey); -int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server); -int ssl_encrypt_ticket(SSL *ssl, CBB *out, const SSL_SESSION *session); -int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx); - -// ssl_session_new returns a newly-allocated blank |SSL_SESSION| or nullptr on -// error. -UniquePtr ssl_session_new(const SSL_X509_METHOD *x509_method); - -// SSL_SESSION_parse parses an |SSL_SESSION| from |cbs| and advances |cbs| over -// the parsed data. -UniquePtr SSL_SESSION_parse(CBS *cbs, - const SSL_X509_METHOD *x509_method, - CRYPTO_BUFFER_POOL *pool); - -// ssl_session_serialize writes |in| to |cbb| as if it were serialising a -// session for Session-ID resumption. It returns one on success and zero on -// error. -int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb); - -// ssl_session_is_context_valid returns one if |session|'s session ID context -// matches the one set on |ssl| and zero otherwise. -int ssl_session_is_context_valid(const SSL *ssl, const SSL_SESSION *session); - -// ssl_session_is_time_valid returns one if |session| is still valid and zero if -// it has expired. -int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session); - -// ssl_session_is_resumable returns one if |session| is resumable for |hs| and -// zero otherwise. -int ssl_session_is_resumable(const SSL_HANDSHAKE *hs, - const SSL_SESSION *session); - -// ssl_session_protocol_version returns the protocol version associated with -// |session|. Note that despite the name, this is not the same as -// |SSL_SESSION_get_protocol_version|. The latter is based on upstream's name. -uint16_t ssl_session_protocol_version(const SSL_SESSION *session); - -// ssl_session_get_digest returns the digest used in |session|. -const EVP_MD *ssl_session_get_digest(const SSL_SESSION *session); - -void ssl_set_session(SSL *ssl, SSL_SESSION *session); - -// ssl_get_prev_session looks up the previous session based on |client_hello|. -// On success, it sets |*out_session| to the session or nullptr if none was -// found. If the session could not be looked up synchronously, it returns -// |ssl_hs_pending_session| and should be called again. If a ticket could not be -// decrypted immediately it returns |ssl_hs_pending_ticket| and should also -// be called again. Otherwise, it returns |ssl_hs_error|. -enum ssl_hs_wait_t ssl_get_prev_session(SSL *ssl, - UniquePtr *out_session, - bool *out_tickets_supported, - bool *out_renew_ticket, - const SSL_CLIENT_HELLO *client_hello); - -// The following flags determine which parts of the session are duplicated. -#define SSL_SESSION_DUP_AUTH_ONLY 0x0 -#define SSL_SESSION_INCLUDE_TICKET 0x1 -#define SSL_SESSION_INCLUDE_NONAUTH 0x2 -#define SSL_SESSION_DUP_ALL \ - (SSL_SESSION_INCLUDE_TICKET | SSL_SESSION_INCLUDE_NONAUTH) - -// SSL_SESSION_dup returns a newly-allocated |SSL_SESSION| with a copy of the -// fields in |session| or nullptr on error. The new session is non-resumable and -// must be explicitly marked resumable once it has been filled in. -OPENSSL_EXPORT UniquePtr SSL_SESSION_dup(SSL_SESSION *session, - int dup_flags); - -// ssl_session_rebase_time updates |session|'s start time to the current time, -// adjusting the timeout so the expiration time is unchanged. -void ssl_session_rebase_time(SSL *ssl, SSL_SESSION *session); - -// ssl_session_renew_timeout calls |ssl_session_rebase_time| and renews -// |session|'s timeout to |timeout| (measured from the current time). The -// renewal is clamped to the session's auth_timeout. -void ssl_session_renew_timeout(SSL *ssl, SSL_SESSION *session, - uint32_t timeout); - -void ssl_cipher_preference_list_free( - struct ssl_cipher_preference_list_st *cipher_list); - -// ssl_get_cipher_preferences returns the cipher preference list for TLS 1.2 and -// below. -const struct ssl_cipher_preference_list_st *ssl_get_cipher_preferences( - const SSL *ssl); - -void ssl_update_cache(SSL_HANDSHAKE *hs, int mode); - -int ssl_send_alert(SSL *ssl, int level, int desc); -bool ssl3_get_message(SSL *ssl, SSLMessage *out); -ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); -void ssl3_next_message(SSL *ssl); - -int ssl3_dispatch_alert(SSL *ssl); -ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); -ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); -int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, - int len); - -bool ssl3_new(SSL *ssl); -void ssl3_free(SSL *ssl); - -bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); -bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); -bool ssl3_add_message(SSL *ssl, Array msg); -bool ssl3_add_change_cipher_spec(SSL *ssl); -bool ssl3_add_alert(SSL *ssl, uint8_t level, uint8_t desc); -int ssl3_flush_flight(SSL *ssl); - -bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); -bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); -bool dtls1_add_message(SSL *ssl, Array msg); -bool dtls1_add_change_cipher_spec(SSL *ssl); -bool dtls1_add_alert(SSL *ssl, uint8_t level, uint8_t desc); -int dtls1_flush_flight(SSL *ssl); - -// ssl_add_message_cbb finishes the handshake message in |cbb| and adds it to -// the pending flight. It returns true on success and false on error. -bool ssl_add_message_cbb(SSL *ssl, CBB *cbb); - -// ssl_hash_message incorporates |msg| into the handshake hash. It returns true -// on success and false on allocation failure. -bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg); - -ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); -ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); - -int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake, - const uint8_t *buf, int len); - -// dtls1_write_record sends a record. It returns one on success and <= 0 on -// error. -int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len, - enum dtls1_use_epoch_t use_epoch); - -int dtls1_retransmit_outgoing_messages(SSL *ssl); -bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, - CBS *out_body); -bool dtls1_check_timeout_num(SSL *ssl); - -void dtls1_start_timer(SSL *ssl); -void dtls1_stop_timer(SSL *ssl); -bool dtls1_is_timer_expired(SSL *ssl); -unsigned int dtls1_min_mtu(void); - -bool dtls1_new(SSL *ssl); -void dtls1_free(SSL *ssl); - -bool dtls1_get_message(SSL *ssl, SSLMessage *out); -ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); -void dtls1_next_message(SSL *ssl); -int dtls1_dispatch_alert(SSL *ssl); - -// tls1_configure_aead configures either the read or write direction AEAD (as -// determined by |direction|) using the keys generated by the TLS KDF. The -// |key_block_cache| argument is used to store the generated key block, if -// empty. Otherwise it's assumed that the key block is already contained within -// it. Returns one on success or zero on error. -int tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction, - Array *key_block_cache, - const SSL_CIPHER *cipher, - Span iv_override); - -int tls1_change_cipher_state(SSL_HANDSHAKE *hs, evp_aead_direction_t direction); -int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, - Span premaster); - -// tls1_get_grouplist returns the locally-configured group preference list. -Span tls1_get_grouplist(const SSL *ssl); - -// tls1_check_group_id returns one if |group_id| is consistent with -// locally-configured group preferences. -int tls1_check_group_id(const SSL *ssl, uint16_t group_id); - -// tls1_get_shared_group sets |*out_group_id| to the first preferred shared -// group between client and server preferences and returns one. If none may be -// found, it returns zero. -int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id); - -// tls1_set_curves converts the array of |ncurves| NIDs pointed to by |curves| -// into a newly allocated array of TLS group IDs. On success, the function -// returns one and writes the array to |*out_group_ids| and its size to -// |*out_group_ids_len|. Otherwise, it returns zero. -int tls1_set_curves(uint16_t **out_group_ids, size_t *out_group_ids_len, - const int *curves, size_t ncurves); - -// tls1_set_curves_list converts the string of curves pointed to by |curves| -// into a newly allocated array of TLS group IDs. On success, the function -// returns one and writes the array to |*out_group_ids| and its size to -// |*out_group_ids_len|. Otherwise, it returns zero. -int tls1_set_curves_list(uint16_t **out_group_ids, size_t *out_group_ids_len, - const char *curves); - -// ssl_add_clienthello_tlsext writes ClientHello extensions to |out|. It -// returns one on success and zero on failure. The |header_len| argument is the -// length of the ClientHello written so far and is used to compute the padding -// length. (It does not include the record header.) -int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len); - -int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out); -int ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, - const SSL_CLIENT_HELLO *client_hello); -int ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs); - -#define tlsext_tick_md EVP_sha256 - -// ssl_process_ticket processes a session ticket from the client. It returns -// one of: -// |ssl_ticket_aead_success|: |*out_session| is set to the parsed session and -// |*out_renew_ticket| is set to whether the ticket should be renewed. -// |ssl_ticket_aead_ignore_ticket|: |*out_renew_ticket| is set to whether a -// fresh ticket should be sent, but the given ticket cannot be used. -// |ssl_ticket_aead_retry|: the ticket could not be immediately decrypted. -// Retry later. -// |ssl_ticket_aead_error|: an error occured that is fatal to the connection. -enum ssl_ticket_aead_result_t ssl_process_ticket( - SSL *ssl, UniquePtr *out_session, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len, const uint8_t *session_id, - size_t session_id_len); - -// tls1_verify_channel_id processes |msg| as a Channel ID message, and verifies -// the signature. If the key is valid, it saves the Channel ID and returns -// one. Otherwise, it returns zero. -int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg); - -// tls1_write_channel_id generates a Channel ID message and puts the output in -// |cbb|. |ssl->tlsext_channel_id_private| must already be set before calling. -// This function returns true on success and false on error. -bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb); - -// tls1_channel_id_hash computes the hash to be signed by Channel ID and writes -// it to |out|, which must contain at least |EVP_MAX_MD_SIZE| bytes. It returns -// one on success and zero on failure. -int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len); - -int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs); - -// ssl_do_channel_id_callback checks runs |ssl->ctx->channel_id_cb| if -// necessary. It returns one on success and zero on fatal error. Note that, on -// success, |ssl->tlsext_channel_id_private| may be unset, in which case the -// operation should be retried later. -int ssl_do_channel_id_callback(SSL *ssl); - -// ssl_can_write returns one if |ssl| is allowed to write and zero otherwise. -int ssl_can_write(const SSL *ssl); - -// ssl_can_read returns one if |ssl| is allowed to read and zero otherwise. -int ssl_can_read(const SSL *ssl); - -void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock); -void ssl_ctx_get_current_time(const SSL_CTX *ctx, - struct OPENSSL_timeval *out_clock); - -// ssl_reset_error_state resets state for |SSL_get_error|. -void ssl_reset_error_state(SSL *ssl); - -// ssl_set_read_error sets |ssl|'s read half into an error state, saving the -// current state of the error queue. -void ssl_set_read_error(SSL* ssl); - -} // namespace bssl - - -// Opaque C types. -// -// The following types are exported to C code as public typedefs, so they must -// be defined outside of the namespace. - -// ssl_method_st backs the public |SSL_METHOD| type. It is a compatibility -// structure to support the legacy version-locked methods. -struct ssl_method_st { - // version, if non-zero, is the only protocol version acceptable to an - // SSL_CTX initialized from this method. - uint16_t version; - // method is the underlying SSL_PROTOCOL_METHOD that initializes the - // SSL_CTX. - const bssl::SSL_PROTOCOL_METHOD *method; - // x509_method contains pointers to functions that might deal with |X509| - // compatibility, or might be a no-op, depending on the application. - const SSL_X509_METHOD *x509_method; -}; - -struct ssl_x509_method_st { - // check_client_CA_list returns one if |names| is a good list of X.509 - // distinguished names and zero otherwise. This is used to ensure that we can - // reject unparsable values at handshake time when using crypto/x509. - int (*check_client_CA_list)(STACK_OF(CRYPTO_BUFFER) *names); - - // cert_clear frees and NULLs all X509 certificate-related state. - void (*cert_clear)(bssl::CERT *cert); - // cert_free frees all X509-related state. - void (*cert_free)(bssl::CERT *cert); - // cert_flush_cached_chain drops any cached |X509|-based certificate chain - // from |cert|. - // cert_dup duplicates any needed fields from |cert| to |new_cert|. - void (*cert_dup)(bssl::CERT *new_cert, const bssl::CERT *cert); - void (*cert_flush_cached_chain)(bssl::CERT *cert); - // cert_flush_cached_chain drops any cached |X509|-based leaf certificate - // from |cert|. - void (*cert_flush_cached_leaf)(bssl::CERT *cert); - - // session_cache_objects fills out |sess->x509_peer| and |sess->x509_chain| - // from |sess->certs| and erases |sess->x509_chain_without_leaf|. It returns - // one on success or zero on error. - int (*session_cache_objects)(SSL_SESSION *session); - // session_dup duplicates any needed fields from |session| to |new_session|. - // It returns one on success or zero on error. - int (*session_dup)(SSL_SESSION *new_session, const SSL_SESSION *session); - // session_clear frees any X509-related state from |session|. - void (*session_clear)(SSL_SESSION *session); - // session_verify_cert_chain verifies the certificate chain in |session|, - // sets |session->verify_result| and returns one on success or zero on - // error. - int (*session_verify_cert_chain)(SSL_SESSION *session, SSL *ssl, - uint8_t *out_alert); - - // hs_flush_cached_ca_names drops any cached |X509_NAME|s from |hs|. - void (*hs_flush_cached_ca_names)(bssl::SSL_HANDSHAKE *hs); - // ssl_new does any neccessary initialisation of |ssl|. It returns one on - // success or zero on error. - int (*ssl_new)(SSL *ssl); - // ssl_free frees anything created by |ssl_new|. - void (*ssl_free)(SSL *ssl); - // ssl_flush_cached_client_CA drops any cached |X509_NAME|s from |ssl|. - void (*ssl_flush_cached_client_CA)(SSL *ssl); - // ssl_auto_chain_if_needed runs the deprecated auto-chaining logic if - // necessary. On success, it updates |ssl|'s certificate configuration as - // needed and returns one. Otherwise, it returns zero. - int (*ssl_auto_chain_if_needed)(SSL *ssl); - // ssl_ctx_new does any neccessary initialisation of |ctx|. It returns one on - // success or zero on error. - int (*ssl_ctx_new)(SSL_CTX *ctx); - // ssl_ctx_free frees anything created by |ssl_ctx_new|. - void (*ssl_ctx_free)(SSL_CTX *ctx); - // ssl_ctx_flush_cached_client_CA drops any cached |X509_NAME|s from |ctx|. - void (*ssl_ctx_flush_cached_client_CA)(SSL_CTX *ssl); -}; - -// The following types back public C-exposed types which must live in the global -// namespace. We use subclassing so the implementations may be C++ types with -// methods and destructor without polluting the global namespace. -struct ssl_ctx_st : public bssl::SSLContext {}; -struct ssl_st : public bssl::SSLConnection {}; - - -#endif // OPENSSL_HEADER_SSL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/ssl/internal.h.grpc_back b/Pods/BoringSSL-GRPC/ssl/internal.h.grpc_back deleted file mode 100644 index d13d5f2c9..000000000 --- a/Pods/BoringSSL-GRPC/ssl/internal.h.grpc_back +++ /dev/null @@ -1,3064 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. - */ - -#ifndef OPENSSL_HEADER_SSL_INTERNAL_H -#define OPENSSL_HEADER_SSL_INTERNAL_H - -#include - -#include - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/err/internal.h" -#include "../crypto/internal.h" - - -#if defined(OPENSSL_WINDOWS) -// Windows defines struct timeval in winsock2.h. -OPENSSL_MSVC_PRAGMA(warning(push, 3)) -#include -OPENSSL_MSVC_PRAGMA(warning(pop)) -#else -#include -#endif - - -namespace bssl { - -struct SSL_HANDSHAKE; -struct SSL_PROTOCOL_METHOD; - -// C++ utilities. - -// New behaves like |new| but uses |OPENSSL_malloc| for memory allocation. It -// returns nullptr on allocation error. It only implements single-object -// allocation and not new T[n]. -// -// Note: unlike |new|, this does not support non-public constructors. -template -T *New(Args &&... args) { - void *t = OPENSSL_malloc(sizeof(T)); - if (t == nullptr) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return nullptr; - } - return new (t) T(std::forward(args)...); -} - -// Delete behaves like |delete| but uses |OPENSSL_free| to release memory. -// -// Note: unlike |delete| this does not support non-public destructors. -template -void Delete(T *t) { - if (t != nullptr) { - t->~T(); - OPENSSL_free(t); - } -} - -// All types with kAllowUniquePtr set may be used with UniquePtr. Other types -// may be C structs which require a |BORINGSSL_MAKE_DELETER| registration. -namespace internal { -template -struct DeleterImpl::type> { - static void Free(T *t) { Delete(t); } -}; -} - -// MakeUnique behaves like |std::make_unique| but returns nullptr on allocation -// error. -template -UniquePtr MakeUnique(Args &&... args) { - return UniquePtr(New(std::forward(args)...)); -} - -#if defined(BORINGSSL_ALLOW_CXX_RUNTIME) -#define HAS_VIRTUAL_DESTRUCTOR -#define PURE_VIRTUAL = 0 -#else -// HAS_VIRTUAL_DESTRUCTOR should be declared in any base class which defines a -// virtual destructor. This avoids a dependency on |_ZdlPv| and prevents the -// class from being used with |delete|. -#define HAS_VIRTUAL_DESTRUCTOR \ - void operator delete(void *) { abort(); } - -// PURE_VIRTUAL should be used instead of = 0 when defining pure-virtual -// functions. This avoids a dependency on |__cxa_pure_virtual| but loses -// compile-time checking. -#define PURE_VIRTUAL { abort(); } -#endif - -// CONSTEXPR_ARRAY works around a VS 2015 bug where ranged for loops don't work -// on constexpr arrays. -#if defined(_MSC_VER) && !defined(__clang__) && _MSC_VER < 1910 -#define CONSTEXPR_ARRAY const -#else -#define CONSTEXPR_ARRAY constexpr -#endif - -// Array is an owning array of elements of |T|. -template -class Array { - public: - // Array's default constructor creates an empty array. - Array() {} - Array(const Array &) = delete; - Array(Array &&other) { *this = std::move(other); } - - ~Array() { Reset(); } - - Array &operator=(const Array &) = delete; - Array &operator=(Array &&other) { - Reset(); - other.Release(&data_, &size_); - return *this; - } - - const T *data() const { return data_; } - T *data() { return data_; } - size_t size() const { return size_; } - bool empty() const { return size_ == 0; } - - const T &operator[](size_t i) const { return data_[i]; } - T &operator[](size_t i) { return data_[i]; } - - T *begin() { return data_; } - const T *cbegin() const { return data_; } - T *end() { return data_ + size_; } - const T *cend() const { return data_ + size_; } - - void Reset() { Reset(nullptr, 0); } - - // Reset releases the current contents of the array and takes ownership of the - // raw pointer supplied by the caller. - void Reset(T *new_data, size_t new_size) { - for (size_t i = 0; i < size_; i++) { - data_[i].~T(); - } - OPENSSL_free(data_); - data_ = new_data; - size_ = new_size; - } - - // Release releases ownership of the array to a raw pointer supplied by the - // caller. - void Release(T **out, size_t *out_size) { - *out = data_; - *out_size = size_; - data_ = nullptr; - size_ = 0; - } - - // Init replaces the array with a newly-allocated array of |new_size| - // default-constructed copies of |T|. It returns true on success and false on - // error. - // - // Note that if |T| is a primitive type like |uint8_t|, it is uninitialized. - bool Init(size_t new_size) { - Reset(); - if (new_size == 0) { - return true; - } - - if (new_size > std::numeric_limits::max() / sizeof(T)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return false; - } - data_ = reinterpret_cast(OPENSSL_malloc(new_size * sizeof(T))); - if (data_ == nullptr) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - size_ = new_size; - for (size_t i = 0; i < size_; i++) { - new (&data_[i]) T; - } - return true; - } - - // CopyFrom replaces the array with a newly-allocated copy of |in|. It returns - // true on success and false on error. - bool CopyFrom(Span in) { - if (!Init(in.size())) { - return false; - } - OPENSSL_memcpy(data_, in.data(), in.size()); - return true; - } - - private: - T *data_ = nullptr; - size_t size_ = 0; -}; - -// CBBFinishArray behaves like |CBB_finish| but stores the result in an Array. -OPENSSL_EXPORT bool CBBFinishArray(CBB *cbb, Array *out); - - -// Protocol versions. -// -// Due to DTLS's historical wire version differences and to support multiple -// variants of the same protocol during development, we maintain two notions of -// version. -// -// The "version" or "wire version" is the actual 16-bit value that appears on -// the wire. It uniquely identifies a version and is also used at API -// boundaries. The set of supported versions differs between TLS and DTLS. Wire -// versions are opaque values and may not be compared numerically. -// -// The "protocol version" identifies the high-level handshake variant being -// used. DTLS versions map to the corresponding TLS versions. Draft TLS 1.3 -// variants all map to TLS 1.3. Protocol versions are sequential and may be -// compared numerically. - -// ssl_protocol_version_from_wire sets |*out| to the protocol version -// corresponding to wire version |version| and returns true. If |version| is not -// a valid TLS or DTLS version, it returns false. -// -// Note this simultaneously handles both DTLS and TLS. Use one of the -// higher-level functions below for most operations. -bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version); - -// ssl_get_version_range sets |*out_min_version| and |*out_max_version| to the -// minimum and maximum enabled protocol versions, respectively. -bool ssl_get_version_range(const SSL *ssl, uint16_t *out_min_version, - uint16_t *out_max_version); - -// ssl_supports_version returns whether |hs| supports |version|. -bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version); - -// ssl_add_supported_versions writes the supported versions of |hs| to |cbb|, in -// decreasing preference order. -bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb); - -// ssl_negotiate_version negotiates a common version based on |hs|'s preferences -// and the peer preference list in |peer_versions|. On success, it returns true -// and sets |*out_version| to the selected version. Otherwise, it returns false -// and sets |*out_alert| to an alert to send. -bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, - uint16_t *out_version, const CBS *peer_versions); - -// ssl_protocol_version returns |ssl|'s protocol version. It is an error to -// call this function before the version is determined. -uint16_t ssl_protocol_version(const SSL *ssl); - -// Cipher suites. - -} // namespace bssl - -struct ssl_cipher_st { - // name is the OpenSSL name for the cipher. - const char *name; - // standard_name is the IETF name for the cipher. - const char *standard_name; - // id is the cipher suite value bitwise OR-d with 0x03000000. - uint32_t id; - - // algorithm_* determine the cipher suite. See constants below for the values. - uint32_t algorithm_mkey; - uint32_t algorithm_auth; - uint32_t algorithm_enc; - uint32_t algorithm_mac; - uint32_t algorithm_prf; -}; - -namespace bssl { - -// Bits for |algorithm_mkey| (key exchange algorithm). -#define SSL_kRSA 0x00000001u -#define SSL_kECDHE 0x00000002u -// SSL_kPSK is only set for plain PSK, not ECDHE_PSK. -#define SSL_kPSK 0x00000004u -#define SSL_kGENERIC 0x00000008u - -// Bits for |algorithm_auth| (server authentication). -#define SSL_aRSA 0x00000001u -#define SSL_aECDSA 0x00000002u -// SSL_aPSK is set for both PSK and ECDHE_PSK. -#define SSL_aPSK 0x00000004u -#define SSL_aGENERIC 0x00000008u - -#define SSL_aCERT (SSL_aRSA | SSL_aECDSA) - -// Bits for |algorithm_enc| (symmetric encryption). -#define SSL_3DES 0x00000001u -#define SSL_AES128 0x00000002u -#define SSL_AES256 0x00000004u -#define SSL_AES128GCM 0x00000008u -#define SSL_AES256GCM 0x00000010u -#define SSL_eNULL 0x00000020u -#define SSL_CHACHA20POLY1305 0x00000040u - -#define SSL_AES (SSL_AES128 | SSL_AES256 | SSL_AES128GCM | SSL_AES256GCM) - -// Bits for |algorithm_mac| (symmetric authentication). -#define SSL_SHA1 0x00000001u -#define SSL_SHA256 0x00000002u -#define SSL_SHA384 0x00000004u -// SSL_AEAD is set for all AEADs. -#define SSL_AEAD 0x00000008u - -// Bits for |algorithm_prf| (handshake digest). -#define SSL_HANDSHAKE_MAC_DEFAULT 0x1 -#define SSL_HANDSHAKE_MAC_SHA256 0x2 -#define SSL_HANDSHAKE_MAC_SHA384 0x4 - -// SSL_MAX_DIGEST is the number of digest types which exist. When adding a new -// one, update the table in ssl_cipher.c. -#define SSL_MAX_DIGEST 4 - -// ssl_cipher_get_evp_aead sets |*out_aead| to point to the correct EVP_AEAD -// object for |cipher| protocol version |version|. It sets |*out_mac_secret_len| -// and |*out_fixed_iv_len| to the MAC key length and fixed IV length, -// respectively. The MAC key length is zero except for legacy block and stream -// ciphers. It returns true on success and false on error. -bool ssl_cipher_get_evp_aead(const EVP_AEAD **out_aead, - size_t *out_mac_secret_len, - size_t *out_fixed_iv_len, const SSL_CIPHER *cipher, - uint16_t version, int is_dtls); - -// ssl_get_handshake_digest returns the |EVP_MD| corresponding to |version| and -// |cipher|. -const EVP_MD *ssl_get_handshake_digest(uint16_t version, - const SSL_CIPHER *cipher); - -// ssl_create_cipher_list evaluates |rule_str|. It sets |*out_cipher_list| to a -// newly-allocated |ssl_cipher_preference_list_st| containing the result. It -// returns true on success and false on failure. If |strict| is true, nonsense -// will be rejected. If false, nonsense will be silently ignored. An empty -// result is considered an error regardless of |strict|. -bool ssl_create_cipher_list( - struct ssl_cipher_preference_list_st **out_cipher_list, - const char *rule_str, bool strict); - -// ssl_cipher_get_value returns the cipher suite id of |cipher|. -uint16_t ssl_cipher_get_value(const SSL_CIPHER *cipher); - -// ssl_cipher_auth_mask_for_key returns the mask of cipher |algorithm_auth| -// values suitable for use with |key| in TLS 1.2 and below. -uint32_t ssl_cipher_auth_mask_for_key(const EVP_PKEY *key); - -// ssl_cipher_uses_certificate_auth returns whether |cipher| authenticates the -// server and, optionally, the client with a certificate. -bool ssl_cipher_uses_certificate_auth(const SSL_CIPHER *cipher); - -// ssl_cipher_requires_server_key_exchange returns whether |cipher| requires a -// ServerKeyExchange message. -// -// This function may return false while still allowing |cipher| an optional -// ServerKeyExchange. This is the case for plain PSK ciphers. -bool ssl_cipher_requires_server_key_exchange(const SSL_CIPHER *cipher); - -// ssl_cipher_get_record_split_len, for TLS 1.0 CBC mode ciphers, returns the -// length of an encrypted 1-byte record, for use in record-splitting. Otherwise -// it returns zero. -size_t ssl_cipher_get_record_split_len(const SSL_CIPHER *cipher); - - -// Transcript layer. - -// SSLTranscript maintains the handshake transcript as a combination of a -// buffer and running hash. -class SSLTranscript { - public: - SSLTranscript(); - ~SSLTranscript(); - - // Init initializes the handshake transcript. If called on an existing - // transcript, it resets the transcript and hash. It returns true on success - // and false on failure. - bool Init(); - - // InitHash initializes the handshake hash based on the PRF and contents of - // the handshake transcript. Subsequent calls to |Update| will update the - // rolling hash. It returns one on success and zero on failure. It is an error - // to call this function after the handshake buffer is released. - bool InitHash(uint16_t version, const SSL_CIPHER *cipher); - - // UpdateForHelloRetryRequest resets the rolling hash with the - // HelloRetryRequest construction. It returns true on success and false on - // failure. It is an error to call this function before the handshake buffer - // is released. - bool UpdateForHelloRetryRequest(); - - // CopyHashContext copies the hash context into |ctx| and returns true on - // success. - bool CopyHashContext(EVP_MD_CTX *ctx); - - Span buffer() { - return MakeConstSpan(reinterpret_cast(buffer_->data), - buffer_->length); - } - - // FreeBuffer releases the handshake buffer. Subsequent calls to - // |Update| will not update the handshake buffer. - void FreeBuffer(); - - // DigestLen returns the length of the PRF hash. - size_t DigestLen() const; - - // Digest returns the PRF hash. For TLS 1.1 and below, this is - // |EVP_md5_sha1|. - const EVP_MD *Digest() const; - - // Update adds |in| to the handshake buffer and handshake hash, whichever is - // enabled. It returns true on success and false on failure. - bool Update(Span in); - - // GetHash writes the handshake hash to |out| which must have room for at - // least |DigestLen| bytes. On success, it returns true and sets |*out_len| to - // the number of bytes written. Otherwise, it returns false. - bool GetHash(uint8_t *out, size_t *out_len); - - // GetSSL3CertVerifyHash writes the SSL 3.0 CertificateVerify hash into the - // bytes pointed to by |out| and writes the number of bytes to - // |*out_len|. |out| must have room for |EVP_MAX_MD_SIZE| bytes. It returns - // one on success and zero on failure. - bool GetSSL3CertVerifyHash(uint8_t *out, size_t *out_len, - const SSL_SESSION *session, - uint16_t signature_algorithm); - - // GetFinishedMAC computes the MAC for the Finished message into the bytes - // pointed by |out| and writes the number of bytes to |*out_len|. |out| must - // have room for |EVP_MAX_MD_SIZE| bytes. It returns true on success and false - // on failure. - bool GetFinishedMAC(uint8_t *out, size_t *out_len, const SSL_SESSION *session, - bool from_server); - - private: - // buffer_, if non-null, contains the handshake transcript. - UniquePtr buffer_; - // hash, if initialized with an |EVP_MD|, maintains the handshake hash. For - // TLS 1.1 and below, it is the SHA-1 half. - ScopedEVP_MD_CTX hash_; - // md5, if initialized with an |EVP_MD|, maintains the MD5 half of the - // handshake hash for TLS 1.1 and below. - ScopedEVP_MD_CTX md5_; -}; - -// tls1_prf computes the PRF function for |ssl|. It fills |out|, using |secret| -// as the secret and |label| as the label. |seed1| and |seed2| are concatenated -// to form the seed parameter. It returns true on success and false on failure. -bool tls1_prf(const EVP_MD *digest, Span out, - Span secret, Span label, - Span seed1, Span seed2); - - -// Encryption layer. - -// SSLAEADContext contains information about an AEAD that is being used to -// encrypt an SSL connection. -class SSLAEADContext { - public: - SSLAEADContext(uint16_t version, bool is_dtls, const SSL_CIPHER *cipher); - ~SSLAEADContext(); - static constexpr bool kAllowUniquePtr = true; - - SSLAEADContext(const SSLAEADContext &&) = delete; - SSLAEADContext &operator=(const SSLAEADContext &&) = delete; - - // CreateNullCipher creates an |SSLAEADContext| for the null cipher. - static UniquePtr CreateNullCipher(bool is_dtls); - - // Create creates an |SSLAEADContext| using the supplied key material. It - // returns nullptr on error. Only one of |Open| or |Seal| may be used with the - // resulting object, depending on |direction|. |version| is the normalized - // protocol version, so DTLS 1.0 is represented as 0x0301, not 0xffef. - static UniquePtr Create(enum evp_aead_direction_t direction, - uint16_t version, int is_dtls, - const SSL_CIPHER *cipher, - Span enc_key, - Span mac_key, - Span fixed_iv); - - // SetVersionIfNullCipher sets the version the SSLAEADContext for the null - // cipher, to make version-specific determinations in the record layer prior - // to a cipher being selected. - void SetVersionIfNullCipher(uint16_t version); - - // ProtocolVersion returns the protocol version associated with this - // SSLAEADContext. It can only be called once |version_| has been set to a - // valid value. - uint16_t ProtocolVersion() const; - - // RecordVersion returns the record version that should be used with this - // SSLAEADContext for record construction and crypto. - uint16_t RecordVersion() const; - - const SSL_CIPHER *cipher() const { return cipher_; } - - // is_null_cipher returns true if this is the null cipher. - bool is_null_cipher() const { return !cipher_; } - - // ExplicitNonceLen returns the length of the explicit nonce. - size_t ExplicitNonceLen() const; - - // MaxOverhead returns the maximum overhead of calling |Seal|. - size_t MaxOverhead() const; - - // SuffixLen calculates the suffix length written by |SealScatter| and writes - // it to |*out_suffix_len|. It returns true on success and false on error. - // |in_len| and |extra_in_len| should equal the argument of the same names - // passed to |SealScatter|. - bool SuffixLen(size_t *out_suffix_len, size_t in_len, - size_t extra_in_len) const; - - // Open authenticates and decrypts |in| in-place. On success, it sets |*out| - // to the plaintext in |in| and returns true. Otherwise, it returns - // false. The output will always be |ExplicitNonceLen| bytes ahead of |in|. - bool Open(Span *out, uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], Span in); - - // Seal encrypts and authenticates |in_len| bytes from |in| and writes the - // result to |out|. It returns true on success and false on error. - // - // If |in| and |out| alias then |out| + |ExplicitNonceLen| must be == |in|. - bool Seal(uint8_t *out, size_t *out_len, size_t max_out, uint8_t type, - uint16_t record_version, const uint8_t seqnum[8], const uint8_t *in, - size_t in_len); - - // SealScatter encrypts and authenticates |in_len| bytes from |in| and splits - // the result between |out_prefix|, |out| and |out_suffix|. It returns one on - // success and zero on error. - // - // On successful return, exactly |ExplicitNonceLen| bytes are written to - // |out_prefix|, |in_len| bytes to |out|, and |SuffixLen| bytes to - // |out_suffix|. - // - // |extra_in| may point to an additional plaintext buffer. If present, - // |extra_in_len| additional bytes are encrypted and authenticated, and the - // ciphertext is written to the beginning of |out_suffix|. |SuffixLen| should - // be used to size |out_suffix| accordingly. - // - // If |in| and |out| alias then |out| must be == |in|. Other arguments may not - // alias anything. - bool SealScatter(uint8_t *out_prefix, uint8_t *out, uint8_t *out_suffix, - uint8_t type, uint16_t record_version, - const uint8_t seqnum[8], const uint8_t *in, size_t in_len, - const uint8_t *extra_in, size_t extra_in_len); - - bool GetIV(const uint8_t **out_iv, size_t *out_iv_len) const; - - private: - // GetAdditionalData writes the additional data into |out| and returns the - // number of bytes written. - size_t GetAdditionalData(uint8_t out[13], uint8_t type, - uint16_t record_version, const uint8_t seqnum[8], - size_t plaintext_len); - - const SSL_CIPHER *cipher_; - ScopedEVP_AEAD_CTX ctx_; - // fixed_nonce_ contains any bytes of the nonce that are fixed for all - // records. - uint8_t fixed_nonce_[12]; - uint8_t fixed_nonce_len_ = 0, variable_nonce_len_ = 0; - // version_ is the wire version that should be used with this AEAD. - uint16_t version_; - // is_dtls_ is whether DTLS is being used with this AEAD. - bool is_dtls_; - // variable_nonce_included_in_record_ is true if the variable nonce - // for a record is included as a prefix before the ciphertext. - bool variable_nonce_included_in_record_ : 1; - // random_variable_nonce_ is true if the variable nonce is - // randomly generated, rather than derived from the sequence - // number. - bool random_variable_nonce_ : 1; - // omit_length_in_ad_ is true if the length should be omitted in the - // AEAD's ad parameter. - bool omit_length_in_ad_ : 1; - // omit_version_in_ad_ is true if the version should be omitted - // in the AEAD's ad parameter. - bool omit_version_in_ad_ : 1; - // omit_ad_ is true if the AEAD's ad parameter should be omitted. - bool omit_ad_ : 1; - // xor_fixed_nonce_ is true if the fixed nonce should be XOR'd into the - // variable nonce rather than prepended. - bool xor_fixed_nonce_ : 1; -}; - - -// DTLS replay bitmap. - -// DTLS1_BITMAP maintains a sliding window of 64 sequence numbers to detect -// replayed packets. It should be initialized by zeroing every field. -struct DTLS1_BITMAP { - // map is a bit mask of the last 64 sequence numbers. Bit - // |1< *out, size_t *out_consumed, - uint8_t *out_alert, Span in); - -// dtls_open_record implements |tls_open_record| for DTLS. It only returns -// |ssl_open_record_partial| if |in| was empty and sets |*out_consumed| to -// zero. The caller should read one packet and try again. -enum ssl_open_record_t dtls_open_record(SSL *ssl, uint8_t *out_type, - Span *out, - size_t *out_consumed, - uint8_t *out_alert, Span in); - -// ssl_seal_align_prefix_len returns the length of the prefix before the start -// of the bulk of the ciphertext when sealing a record with |ssl|. Callers may -// use this to align buffers. -// -// Note when TLS 1.0 CBC record-splitting is enabled, this includes the one byte -// record and is the offset into second record's ciphertext. Thus sealing a -// small record may result in a smaller output than this value. -// -// TODO(davidben): Is this alignment valuable? Record-splitting makes this a -// mess. -size_t ssl_seal_align_prefix_len(const SSL *ssl); - -// tls_seal_record seals a new record of type |type| and body |in| and writes it -// to |out|. At most |max_out| bytes will be written. It returns one on success -// and zero on error. If enabled, |tls_seal_record| implements TLS 1.0 CBC 1/n-1 -// record splitting and may write two records concatenated. -// -// For a large record, the bulk of the ciphertext will begin -// |ssl_seal_align_prefix_len| bytes into out. Aligning |out| appropriately may -// improve performance. It writes at most |in_len| + |SSL_max_seal_overhead| -// bytes to |out|. -// -// |in| and |out| may not alias. -int tls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, - uint8_t type, const uint8_t *in, size_t in_len); - -enum dtls1_use_epoch_t { - dtls1_use_previous_epoch, - dtls1_use_current_epoch, -}; - -// dtls_max_seal_overhead returns the maximum overhead, in bytes, of sealing a -// record. -size_t dtls_max_seal_overhead(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); - -// dtls_seal_prefix_len returns the number of bytes of prefix to reserve in -// front of the plaintext when sealing a record in-place. -size_t dtls_seal_prefix_len(const SSL *ssl, enum dtls1_use_epoch_t use_epoch); - -// dtls_seal_record implements |tls_seal_record| for DTLS. |use_epoch| selects -// which epoch's cipher state to use. Unlike |tls_seal_record|, |in| and |out| -// may alias but, if they do, |in| must be exactly |dtls_seal_prefix_len| bytes -// ahead of |out|. -int dtls_seal_record(SSL *ssl, uint8_t *out, size_t *out_len, size_t max_out, - uint8_t type, const uint8_t *in, size_t in_len, - enum dtls1_use_epoch_t use_epoch); - -// ssl_process_alert processes |in| as an alert and updates |ssl|'s shutdown -// state. It returns one of |ssl_open_record_discard|, |ssl_open_record_error|, -// |ssl_open_record_close_notify|, or |ssl_open_record_fatal_alert| as -// appropriate. -enum ssl_open_record_t ssl_process_alert(SSL *ssl, uint8_t *out_alert, - Span in); - - -// Private key operations. - -// ssl_has_private_key returns one if |ssl| has a private key -// configured and zero otherwise. -int ssl_has_private_key(const SSL *ssl); - -// ssl_private_key_* perform the corresponding operation on -// |SSL_PRIVATE_KEY_METHOD|. If there is a custom private key configured, they -// call the corresponding function or |complete| depending on whether there is a -// pending operation. Otherwise, they implement the operation with -// |EVP_PKEY|. - -enum ssl_private_key_result_t ssl_private_key_sign( - SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, - uint16_t sigalg, Span in); - -enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, - uint8_t *out, - size_t *out_len, - size_t max_out, - Span in); - -// ssl_private_key_supports_signature_algorithm returns whether |hs|'s private -// key supports |sigalg|. -bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, - uint16_t sigalg); - -// ssl_public_key_verify verifies that the |signature| is valid for the public -// key |pkey| and input |in|, using the signature algorithm |sigalg|. -bool ssl_public_key_verify(SSL *ssl, Span signature, - uint16_t sigalg, EVP_PKEY *pkey, - Span in); - - -// Custom extensions - -} // namespace bssl - -// |SSL_CUSTOM_EXTENSION| is a structure that contains information about -// custom-extension callbacks. It is defined unnamespaced for compatibility with -// |STACK_OF(SSL_CUSTOM_EXTENSION)|. -typedef struct ssl_custom_extension { - SSL_custom_ext_add_cb add_callback; - void *add_arg; - SSL_custom_ext_free_cb free_callback; - SSL_custom_ext_parse_cb parse_callback; - void *parse_arg; - uint16_t value; -} SSL_CUSTOM_EXTENSION; - -DEFINE_STACK_OF(SSL_CUSTOM_EXTENSION) - -namespace bssl { - -void SSL_CUSTOM_EXTENSION_free(SSL_CUSTOM_EXTENSION *custom_extension); - -int custom_ext_add_clienthello(SSL_HANDSHAKE *hs, CBB *extensions); -int custom_ext_parse_serverhello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension); -int custom_ext_parse_clienthello(SSL_HANDSHAKE *hs, int *out_alert, - uint16_t value, const CBS *extension); -int custom_ext_add_serverhello(SSL_HANDSHAKE *hs, CBB *extensions); - - -// Key shares. - -// SSLKeyShare abstracts over Diffie-Hellman-like key exchanges. -class SSLKeyShare { - public: - virtual ~SSLKeyShare() {} - static constexpr bool kAllowUniquePtr = true; - HAS_VIRTUAL_DESTRUCTOR - - // Create returns a SSLKeyShare instance for use with group |group_id| or - // nullptr on error. - static UniquePtr Create(uint16_t group_id); - - // GroupID returns the group ID. - virtual uint16_t GroupID() const PURE_VIRTUAL; - - // Offer generates a keypair and writes the public value to - // |out_public_key|. It returns true on success and false on error. - virtual bool Offer(CBB *out_public_key) PURE_VIRTUAL; - - // Accept performs a key exchange against the |peer_key| generated by |offer|. - // On success, it returns true, writes the public value to |out_public_key|, - // and sets |*out_secret| the shared secret. On failure, it returns false and - // sets |*out_alert| to an alert to send to the peer. - // - // The default implementation calls |Offer| and then |Finish|, assuming a key - // exchange protocol where the peers are symmetric. - virtual bool Accept(CBB *out_public_key, Array *out_secret, - uint8_t *out_alert, Span peer_key); - - // Finish performs a key exchange against the |peer_key| generated by - // |Accept|. On success, it returns true and sets |*out_secret| to the shared - // secret. On failure, it returns zero and sets |*out_alert| to an alert to - // send to the peer. - virtual bool Finish(Array *out_secret, uint8_t *out_alert, - Span peer_key) PURE_VIRTUAL; -}; - -// ssl_nid_to_group_id looks up the group corresponding to |nid|. On success, it -// sets |*out_group_id| to the group ID and returns one. Otherwise, it returns -// zero. -int ssl_nid_to_group_id(uint16_t *out_group_id, int nid); - -// ssl_name_to_group_id looks up the group corresponding to the |name| string -// of length |len|. On success, it sets |*out_group_id| to the group ID and -// returns one. Otherwise, it returns zero. -int ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len); - - -// Handshake messages. - -struct SSLMessage { - bool is_v2_hello; - uint8_t type; - CBS body; - // raw is the entire serialized handshake message, including the TLS or DTLS - // message header. - CBS raw; -}; - -// SSL_MAX_HANDSHAKE_FLIGHT is the number of messages, including -// ChangeCipherSpec, in the longest handshake flight. Currently this is the -// client's second leg in a full handshake when client certificates, NPN, and -// Channel ID, are all enabled. -#define SSL_MAX_HANDSHAKE_FLIGHT 7 - -extern const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE]; -extern const uint8_t kDraftDowngradeRandom[8]; - -// ssl_max_handshake_message_len returns the maximum number of bytes permitted -// in a handshake message for |ssl|. -size_t ssl_max_handshake_message_len(const SSL *ssl); - -// tls_can_accept_handshake_data returns whether |ssl| is able to accept more -// data into handshake buffer. -bool tls_can_accept_handshake_data(const SSL *ssl, uint8_t *out_alert); - -// tls_has_unprocessed_handshake_data returns whether there is buffered -// handshake data that has not been consumed by |get_message|. -bool tls_has_unprocessed_handshake_data(const SSL *ssl); - -// dtls_has_unprocessed_handshake_data behaves like -// |tls_has_unprocessed_handshake_data| for DTLS. -bool dtls_has_unprocessed_handshake_data(const SSL *ssl); - -struct DTLS_OUTGOING_MESSAGE { - DTLS_OUTGOING_MESSAGE() {} - DTLS_OUTGOING_MESSAGE(const DTLS_OUTGOING_MESSAGE &) = delete; - DTLS_OUTGOING_MESSAGE &operator=(const DTLS_OUTGOING_MESSAGE &) = delete; - ~DTLS_OUTGOING_MESSAGE() { Clear(); } - - void Clear(); - - uint8_t *data = nullptr; - uint32_t len = 0; - uint16_t epoch = 0; - bool is_ccs = false; -}; - -// dtls_clear_outgoing_messages releases all buffered outgoing messages. -void dtls_clear_outgoing_messages(SSL *ssl); - - -// Callbacks. - -// ssl_do_info_callback calls |ssl|'s info callback, if set. -void ssl_do_info_callback(const SSL *ssl, int type, int value); - -// ssl_do_msg_callback calls |ssl|'s message callback, if set. -void ssl_do_msg_callback(SSL *ssl, int is_write, int content_type, - Span in); - - -// Transport buffers. - -class SSLBuffer { - public: - SSLBuffer() {} - ~SSLBuffer() { Clear(); } - - SSLBuffer(const SSLBuffer &) = delete; - SSLBuffer &operator=(const SSLBuffer &) = delete; - - uint8_t *data() { return buf_ + offset_; } - size_t size() const { return size_; } - bool empty() const { return size_ == 0; } - size_t cap() const { return cap_; } - - Span span() { return MakeSpan(data(), size()); } - - Span remaining() { - return MakeSpan(data() + size(), cap() - size()); - } - - // Clear releases the buffer. - void Clear(); - - // EnsureCap ensures the buffer has capacity at least |new_cap|, aligned such - // that data written after |header_len| is aligned to a - // |SSL3_ALIGN_PAYLOAD|-byte boundary. It returns true on success and false - // on error. - bool EnsureCap(size_t header_len, size_t new_cap); - - // DidWrite extends the buffer by |len|. The caller must have filled in to - // this point. - void DidWrite(size_t len); - - // Consume consumes |len| bytes from the front of the buffer. The memory - // consumed will remain valid until the next call to |DiscardConsumed| or - // |Clear|. - void Consume(size_t len); - - // DiscardConsumed discards the consumed bytes from the buffer. If the buffer - // is now empty, it releases memory used by it. - void DiscardConsumed(); - - private: - // buf_ is the memory allocated for this buffer. - uint8_t *buf_ = nullptr; - // offset_ is the offset into |buf_| which the buffer contents start at. - uint16_t offset_ = 0; - // size_ is the size of the buffer contents from |buf_| + |offset_|. - uint16_t size_ = 0; - // cap_ is how much memory beyond |buf_| + |offset_| is available. - uint16_t cap_ = 0; -}; - -// ssl_read_buffer_extend_to extends the read buffer to the desired length. For -// TLS, it reads to the end of the buffer until the buffer is |len| bytes -// long. For DTLS, it reads a new packet and ignores |len|. It returns one on -// success, zero on EOF, and a negative number on error. -// -// It is an error to call |ssl_read_buffer_extend_to| in DTLS when the buffer is -// non-empty. -int ssl_read_buffer_extend_to(SSL *ssl, size_t len); - -// ssl_handle_open_record handles the result of passing |ssl->s3->read_buffer| -// to a record-processing function. If |ret| is a success or if the caller -// should retry, it returns one and sets |*out_retry|. Otherwise, it returns <= -// 0. -int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret, - size_t consumed, uint8_t alert); - -// ssl_write_buffer_flush flushes the write buffer to the transport. It returns -// one on success and <= 0 on error. For DTLS, whether or not the write -// succeeds, the write buffer will be cleared. -int ssl_write_buffer_flush(SSL *ssl); - - -// Certificate functions. - -// ssl_has_certificate returns one if a certificate and private key are -// configured and zero otherwise. -int ssl_has_certificate(const SSL *ssl); - -// ssl_parse_cert_chain parses a certificate list from |cbs| in the format used -// by a TLS Certificate message. On success, it advances |cbs| and returns -// true. Otherwise, it returns false and sets |*out_alert| to an alert to send -// to the peer. -// -// If the list is non-empty then |*out_chain| and |*out_pubkey| will be set to -// the certificate chain and the leaf certificate's public key -// respectively. Otherwise, both will be set to nullptr. -// -// If the list is non-empty and |out_leaf_sha256| is non-NULL, it writes the -// SHA-256 hash of the leaf to |out_leaf_sha256|. -bool ssl_parse_cert_chain(uint8_t *out_alert, - UniquePtr *out_chain, - UniquePtr *out_pubkey, - uint8_t *out_leaf_sha256, CBS *cbs, - CRYPTO_BUFFER_POOL *pool); - -// ssl_add_cert_chain adds |ssl|'s certificate chain to |cbb| in the format used -// by a TLS Certificate message. If there is no certificate chain, it emits an -// empty certificate list. It returns one on success and zero on error. -int ssl_add_cert_chain(SSL *ssl, CBB *cbb); - -// ssl_cert_check_digital_signature_key_usage parses the DER-encoded, X.509 -// certificate in |in| and returns one if doesn't specify a key usage or, if it -// does, if it includes digitalSignature. Otherwise it pushes to the error -// queue and returns zero. -int ssl_cert_check_digital_signature_key_usage(const CBS *in); - -// ssl_cert_parse_pubkey extracts the public key from the DER-encoded, X.509 -// certificate in |in|. It returns an allocated |EVP_PKEY| or else returns -// nullptr and pushes to the error queue. -UniquePtr ssl_cert_parse_pubkey(const CBS *in); - -// ssl_parse_client_CA_list parses a CA list from |cbs| in the format used by a -// TLS CertificateRequest message. On success, it returns a newly-allocated -// |CRYPTO_BUFFER| list and advances |cbs|. Otherwise, it returns nullptr and -// sets |*out_alert| to an alert to send to the peer. -UniquePtr ssl_parse_client_CA_list(SSL *ssl, - uint8_t *out_alert, - CBS *cbs); - -// ssl_has_client_CAs returns there are configured CAs. -bool ssl_has_client_CAs(SSL *ssl); - -// ssl_add_client_CA_list adds the configured CA list to |cbb| in the format -// used by a TLS CertificateRequest message. It returns one on success and zero -// on error. -int ssl_add_client_CA_list(SSL *ssl, CBB *cbb); - -// ssl_check_leaf_certificate returns one if |pkey| and |leaf| are suitable as -// a server's leaf certificate for |hs|. Otherwise, it returns zero and pushes -// an error on the error queue. -int ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, - const CRYPTO_BUFFER *leaf); - -// ssl_on_certificate_selected is called once the certificate has been selected. -// It finalizes the certificate and initializes |hs->local_pubkey|. It returns -// one on success and zero on error. -int ssl_on_certificate_selected(SSL_HANDSHAKE *hs); - - -// TLS 1.3 key derivation. - -// tls13_init_key_schedule initializes the handshake hash and key derivation -// state, and incorporates the PSK. The cipher suite and PRF hash must have been -// selected at this point. It returns one on success and zero on error. -int tls13_init_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len); - -// tls13_init_early_key_schedule initializes the handshake hash and key -// derivation state from the resumption secret and incorporates the PSK to -// derive the early secrets. It returns one on success and zero on error. -int tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len); - -// tls13_advance_key_schedule incorporates |in| into the key schedule with -// HKDF-Extract. It returns one on success and zero on error. -int tls13_advance_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *in, - size_t len); - -// tls13_set_traffic_key sets the read or write traffic keys to -// |traffic_secret|. It returns one on success and zero on error. -int tls13_set_traffic_key(SSL *ssl, enum evp_aead_direction_t direction, - const uint8_t *traffic_secret, - size_t traffic_secret_len); - -// tls13_derive_early_secrets derives the early traffic secret. It returns one -// on success and zero on error. -int tls13_derive_early_secrets(SSL_HANDSHAKE *hs); - -// tls13_derive_handshake_secrets derives the handshake traffic secret. It -// returns one on success and zero on error. -int tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs); - -// tls13_rotate_traffic_key derives the next read or write traffic secret. It -// returns one on success and zero on error. -int tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction); - -// tls13_derive_application_secrets derives the initial application data traffic -// and exporter secrets based on the handshake transcripts and |master_secret|. -// It returns one on success and zero on error. -int tls13_derive_application_secrets(SSL_HANDSHAKE *hs); - -// tls13_derive_resumption_secret derives the |resumption_secret|. -int tls13_derive_resumption_secret(SSL_HANDSHAKE *hs); - -// tls13_export_keying_material provides an exporter interface to use the -// |exporter_secret|. -int tls13_export_keying_material(SSL *ssl, Span out, - Span secret, - Span label, - Span context); - -// tls13_finished_mac calculates the MAC of the handshake transcript to verify -// the integrity of the Finished message, and stores the result in |out| and -// length in |out_len|. |is_server| is 1 if this is for the Server Finished and -// 0 for the Client Finished. -int tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, - size_t *out_len, int is_server); - -// tls13_derive_session_psk calculates the PSK for this session based on the -// resumption master secret and |nonce|. It returns true on success, and false -// on failure. -bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce); - -// tls13_write_psk_binder calculates the PSK binder value and replaces the last -// bytes of |msg| with the resulting value. It returns 1 on success, and 0 on -// failure. -int tls13_write_psk_binder(SSL_HANDSHAKE *hs, uint8_t *msg, size_t len); - -// tls13_verify_psk_binder verifies that the handshake transcript, truncated -// up to the binders has a valid signature using the value of |session|'s -// resumption secret. It returns 1 on success, and 0 on failure. -int tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, - const SSLMessage &msg, CBS *binders); - - -// Handshake functions. - -enum ssl_hs_wait_t { - ssl_hs_error, - ssl_hs_ok, - ssl_hs_read_server_hello, - ssl_hs_read_message, - ssl_hs_flush, - ssl_hs_certificate_selection_pending, - ssl_hs_handoff, - ssl_hs_x509_lookup, - ssl_hs_channel_id_lookup, - ssl_hs_private_key_operation, - ssl_hs_pending_session, - ssl_hs_pending_ticket, - ssl_hs_early_return, - ssl_hs_early_data_rejected, - ssl_hs_read_end_of_early_data, - ssl_hs_read_change_cipher_spec, - ssl_hs_certificate_verify, -}; - -enum ssl_grease_index_t { - ssl_grease_cipher = 0, - ssl_grease_group, - ssl_grease_extension1, - ssl_grease_extension2, - ssl_grease_version, - ssl_grease_ticket_extension, - ssl_grease_last_index = ssl_grease_ticket_extension, -}; - -struct SSL_HANDSHAKE { - explicit SSL_HANDSHAKE(SSL *ssl); - ~SSL_HANDSHAKE(); - static constexpr bool kAllowUniquePtr = true; - - // ssl is a non-owning pointer to the parent |SSL| object. - SSL *ssl; - - // wait contains the operation the handshake is currently blocking on or - // |ssl_hs_ok| if none. - enum ssl_hs_wait_t wait = ssl_hs_ok; - - // state is the internal state for the TLS 1.2 and below handshake. Its - // values depend on |do_handshake| but the starting state is always zero. - int state = 0; - - // tls13_state is the internal state for the TLS 1.3 handshake. Its values - // depend on |do_handshake| but the starting state is always zero. - int tls13_state = 0; - - // min_version is the minimum accepted protocol version, taking account both - // |SSL_OP_NO_*| and |SSL_CTX_set_min_proto_version| APIs. - uint16_t min_version = 0; - - // max_version is the maximum accepted protocol version, taking account both - // |SSL_OP_NO_*| and |SSL_CTX_set_max_proto_version| APIs. - uint16_t max_version = 0; - - size_t hash_len = 0; - uint8_t secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t early_traffic_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t client_handshake_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t server_handshake_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t client_traffic_secret_0[EVP_MAX_MD_SIZE] = {0}; - uint8_t server_traffic_secret_0[EVP_MAX_MD_SIZE] = {0}; - uint8_t expected_client_finished[EVP_MAX_MD_SIZE] = {0}; - - union { - // sent is a bitset where the bits correspond to elements of kExtensions - // in t1_lib.c. Each bit is set if that extension was sent in a - // ClientHello. It's not used by servers. - uint32_t sent = 0; - // received is a bitset, like |sent|, but is used by servers to record - // which extensions were received from a client. - uint32_t received; - } extensions; - - union { - // sent is a bitset where the bits correspond to elements of - // |client_custom_extensions| in the |SSL_CTX|. Each bit is set if that - // extension was sent in a ClientHello. It's not used by servers. - uint16_t sent = 0; - // received is a bitset, like |sent|, but is used by servers to record - // which custom extensions were received from a client. The bits here - // correspond to |server_custom_extensions|. - uint16_t received; - } custom_extensions; - - // retry_group is the group ID selected by the server in HelloRetryRequest in - // TLS 1.3. - uint16_t retry_group = 0; - - // error, if |wait| is |ssl_hs_error|, is the error the handshake failed on. - UniquePtr error; - - // key_share is the current key exchange instance. - UniquePtr key_share; - - // transcript is the current handshake transcript. - SSLTranscript transcript; - - // cookie is the value of the cookie received from the server, if any. - Array cookie; - - // key_share_bytes is the value of the previously sent KeyShare extension by - // the client in TLS 1.3. - Array key_share_bytes; - - // ecdh_public_key, for servers, is the key share to be sent to the client in - // TLS 1.3. - Array ecdh_public_key; - - // peer_sigalgs are the signature algorithms that the peer supports. These are - // taken from the contents of the signature algorithms extension for a server - // or from the CertificateRequest for a client. - Array peer_sigalgs; - - // peer_supported_group_list contains the supported group IDs advertised by - // the peer. This is only set on the server's end. The server does not - // advertise this extension to the client. - Array peer_supported_group_list; - - // peer_key is the peer's ECDH key for a TLS 1.2 client. - Array peer_key; - - // negotiated_token_binding_version is used by a server to store the - // on-the-wire encoding of the Token Binding protocol version to advertise in - // the ServerHello/EncryptedExtensions if the Token Binding extension is to be - // sent. - uint16_t negotiated_token_binding_version; - - // server_params, in a TLS 1.2 server, stores the ServerKeyExchange - // parameters. It has client and server randoms prepended for signing - // convenience. - Array server_params; - - // peer_psk_identity_hint, on the client, is the psk_identity_hint sent by the - // server when using a TLS 1.2 PSK key exchange. - UniquePtr peer_psk_identity_hint; - - // ca_names, on the client, contains the list of CAs received in a - // CertificateRequest message. - UniquePtr ca_names; - - // cached_x509_ca_names contains a cache of parsed versions of the elements of - // |ca_names|. This pointer is left non-owning so only - // |ssl_crypto_x509_method| needs to link against crypto/x509. - STACK_OF(X509_NAME) *cached_x509_ca_names = nullptr; - - // certificate_types, on the client, contains the set of certificate types - // received in a CertificateRequest message. - Array certificate_types; - - // local_pubkey is the public key we are authenticating as. - UniquePtr local_pubkey; - - // peer_pubkey is the public key parsed from the peer's leaf certificate. - UniquePtr peer_pubkey; - - // new_session is the new mutable session being established by the current - // handshake. It should not be cached. - UniquePtr new_session; - - // early_session is the session corresponding to the current 0-RTT state on - // the client if |in_early_data| is true. - UniquePtr early_session; - - // new_cipher is the cipher being negotiated in this handshake. - const SSL_CIPHER *new_cipher = nullptr; - - // key_block is the record-layer key block for TLS 1.2 and earlier. - Array key_block; - - // scts_requested is true if the SCT extension is in the ClientHello. - bool scts_requested:1; - - // needs_psk_binder is true if the ClientHello has a placeholder PSK binder to - // be filled in. - bool needs_psk_binder:1; - - bool received_hello_retry_request:1; - bool sent_hello_retry_request:1; - - bool received_custom_extension:1; - - // handshake_finalized is true once the handshake has completed, at which - // point accessors should use the established state. - bool handshake_finalized:1; - - // accept_psk_mode stores whether the client's PSK mode is compatible with our - // preferences. - bool accept_psk_mode:1; - - // cert_request is true if a client certificate was requested. - bool cert_request:1; - - // certificate_status_expected is true if OCSP stapling was negotiated and the - // server is expected to send a CertificateStatus message. (This is used on - // both the client and server sides.) - bool certificate_status_expected:1; - - // ocsp_stapling_requested is true if a client requested OCSP stapling. - bool ocsp_stapling_requested:1; - - // should_ack_sni is used by a server and indicates that the SNI extension - // should be echoed in the ServerHello. - bool should_ack_sni:1; - - // in_false_start is true if there is a pending client handshake in False - // Start. The client may write data at this point. - bool in_false_start:1; - - // in_early_data is true if there is a pending handshake that has progressed - // enough to send and receive early data. - bool in_early_data:1; - - // early_data_offered is true if the client sent the early_data extension. - bool early_data_offered:1; - - // can_early_read is true if application data may be read at this point in the - // handshake. - bool can_early_read:1; - - // can_early_write is true if application data may be written at this point in - // the handshake. - bool can_early_write:1; - - // next_proto_neg_seen is one of NPN was negotiated. - bool next_proto_neg_seen:1; - - // ticket_expected is true if a TLS 1.2 NewSessionTicket message is to be sent - // or received. - bool ticket_expected:1; - - // extended_master_secret is true if the extended master secret extension is - // negotiated in this handshake. - bool extended_master_secret:1; - - // pending_private_key_op is true if there is a pending private key operation - // in progress. - bool pending_private_key_op:1; - - // grease_seeded is true if |grease_seed| has been initialized. - bool grease_seeded:1; - - // client_version is the value sent or received in the ClientHello version. - uint16_t client_version = 0; - - // early_data_read is the amount of early data that has been read by the - // record layer. - uint16_t early_data_read = 0; - - // early_data_written is the amount of early data that has been written by the - // record layer. - uint16_t early_data_written = 0; - - // session_id is the session ID in the ClientHello, used for the experimental - // TLS 1.3 variant. - uint8_t session_id[SSL_MAX_SSL_SESSION_ID_LENGTH] = {0}; - uint8_t session_id_len = 0; - - // grease_seed is the entropy for GREASE values. It is valid if - // |grease_seeded| is true. - uint8_t grease_seed[ssl_grease_last_index + 1] = {0}; - - // dummy_pq_padding_len, in a server, is the length of the extension that - // should be echoed in a ServerHello, or zero if no extension should be - // echoed. - uint16_t dummy_pq_padding_len = 0; -}; - -UniquePtr ssl_handshake_new(SSL *ssl); - -// ssl_check_message_type checks if |msg| has type |type|. If so it returns -// one. Otherwise, it sends an alert and returns zero. -bool ssl_check_message_type(SSL *ssl, const SSLMessage &msg, int type); - -// ssl_run_handshake runs the TLS handshake. It returns one on success and <= 0 -// on error. It sets |out_early_return| to one if we've completed the handshake -// early. -int ssl_run_handshake(SSL_HANDSHAKE *hs, bool *out_early_return); - -// The following are implementations of |do_handshake| for the client and -// server. -enum ssl_hs_wait_t ssl_client_handshake(SSL_HANDSHAKE *hs); -enum ssl_hs_wait_t ssl_server_handshake(SSL_HANDSHAKE *hs); -enum ssl_hs_wait_t tls13_client_handshake(SSL_HANDSHAKE *hs); -enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs); - -// The following functions return human-readable representations of the TLS -// handshake states for debugging. -const char *ssl_client_handshake_state(SSL_HANDSHAKE *hs); -const char *ssl_server_handshake_state(SSL_HANDSHAKE *hs); -const char *tls13_client_handshake_state(SSL_HANDSHAKE *hs); -const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs); - -// tls13_post_handshake processes a post-handshake message. It returns one on -// success and zero on failure. -int tls13_post_handshake(SSL *ssl, const SSLMessage &msg); - -int tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int allow_anonymous); -int tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg); - -// tls13_process_finished processes |msg| as a Finished message from the -// peer. If |use_saved_value| is one, the verify_data is compared against -// |hs->expected_client_finished| rather than computed fresh. -int tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int use_saved_value); - -int tls13_add_certificate(SSL_HANDSHAKE *hs); - -// tls13_add_certificate_verify adds a TLS 1.3 CertificateVerify message to the -// handshake. If it returns |ssl_private_key_retry|, it should be called again -// to retry when the signing operation is completed. -enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs); - -int tls13_add_finished(SSL_HANDSHAKE *hs); -int tls13_process_new_session_ticket(SSL *ssl, const SSLMessage &msg); - -bool ssl_ext_key_share_parse_serverhello(SSL_HANDSHAKE *hs, - Array *out_secret, - uint8_t *out_alert, CBS *contents); -bool ssl_ext_key_share_parse_clienthello(SSL_HANDSHAKE *hs, bool *out_found, - Array *out_secret, - uint8_t *out_alert, CBS *contents); -bool ssl_ext_key_share_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); - -bool ssl_ext_pre_shared_key_parse_serverhello(SSL_HANDSHAKE *hs, - uint8_t *out_alert, - CBS *contents); -bool ssl_ext_pre_shared_key_parse_clienthello( - SSL_HANDSHAKE *hs, CBS *out_ticket, CBS *out_binders, - uint32_t *out_obfuscated_ticket_age, uint8_t *out_alert, CBS *contents); -bool ssl_ext_pre_shared_key_add_serverhello(SSL_HANDSHAKE *hs, CBB *out); - -// ssl_is_sct_list_valid does a shallow parse of the SCT list in |contents| and -// returns one iff it's valid. -int ssl_is_sct_list_valid(const CBS *contents); - -int ssl_write_client_hello(SSL_HANDSHAKE *hs); - -enum ssl_cert_verify_context_t { - ssl_cert_verify_server, - ssl_cert_verify_client, - ssl_cert_verify_channel_id, -}; - -// tls13_get_cert_verify_signature_input generates the message to be signed for -// TLS 1.3's CertificateVerify message. |cert_verify_context| determines the -// type of signature. It sets |*out| to a newly allocated buffer containing the -// result. This function returns true on success and false on failure. -bool tls13_get_cert_verify_signature_input( - SSL_HANDSHAKE *hs, Array *out, - enum ssl_cert_verify_context_t cert_verify_context); - -// ssl_is_alpn_protocol_allowed returns whether |protocol| is a valid server -// selection for |ssl|'s client preferences. -bool ssl_is_alpn_protocol_allowed(const SSL *ssl, Span protocol); - -// ssl_negotiate_alpn negotiates the ALPN extension, if applicable. It returns -// true on successful negotiation or if nothing was negotiated. It returns false -// and sets |*out_alert| to an alert on error. -bool ssl_negotiate_alpn(SSL_HANDSHAKE *hs, uint8_t *out_alert, - const SSL_CLIENT_HELLO *client_hello); - -struct SSL_EXTENSION_TYPE { - uint16_t type; - bool *out_present; - CBS *out_data; -}; - -// ssl_parse_extensions parses a TLS extensions block out of |cbs| and advances -// it. It writes the parsed extensions to pointers denoted by |ext_types|. On -// success, it fills in the |out_present| and |out_data| fields and returns one. -// Otherwise, it sets |*out_alert| to an alert to send and returns zero. Unknown -// extensions are rejected unless |ignore_unknown| is 1. -int ssl_parse_extensions(const CBS *cbs, uint8_t *out_alert, - const SSL_EXTENSION_TYPE *ext_types, - size_t num_ext_types, int ignore_unknown); - -// ssl_verify_peer_cert verifies the peer certificate for |hs|. -enum ssl_verify_result_t ssl_verify_peer_cert(SSL_HANDSHAKE *hs); - -enum ssl_hs_wait_t ssl_get_finished(SSL_HANDSHAKE *hs); -bool ssl_send_finished(SSL_HANDSHAKE *hs); -bool ssl_output_cert_chain(SSL *ssl); - - -// SSLKEYLOGFILE functions. - -// ssl_log_secret logs |secret| with label |label|, if logging is enabled for -// |ssl|. It returns one on success and zero on failure. -int ssl_log_secret(const SSL *ssl, const char *label, const uint8_t *secret, - size_t secret_len); - - -// ClientHello functions. - -int ssl_client_hello_init(SSL *ssl, SSL_CLIENT_HELLO *out, - const SSLMessage &msg); - -int ssl_client_hello_get_extension(const SSL_CLIENT_HELLO *client_hello, - CBS *out, uint16_t extension_type); - -int ssl_client_cipher_list_contains_cipher(const SSL_CLIENT_HELLO *client_hello, - uint16_t id); - - -// GREASE. - -// ssl_get_grease_value returns a GREASE value for |hs|. For a given -// connection, the values for each index will be deterministic. This allows the -// same ClientHello be sent twice for a HelloRetryRequest or the same group be -// advertised in both supported_groups and key_shares. -uint16_t ssl_get_grease_value(SSL_HANDSHAKE *hs, enum ssl_grease_index_t index); - - -// Signature algorithms. - -// tls1_parse_peer_sigalgs parses |sigalgs| as the list of peer signature -// algorithms and saves them on |hs|. It returns true on success and false on -// error. -bool tls1_parse_peer_sigalgs(SSL_HANDSHAKE *hs, const CBS *sigalgs); - -// tls1_get_legacy_signature_algorithm sets |*out| to the signature algorithm -// that should be used with |pkey| in TLS 1.1 and earlier. It returns true on -// success and false if |pkey| may not be used at those versions. -bool tls1_get_legacy_signature_algorithm(uint16_t *out, const EVP_PKEY *pkey); - -// tls1_choose_signature_algorithm sets |*out| to a signature algorithm for use -// with |hs|'s private key based on the peer's preferences and the algorithms -// supported. It returns true on success and false on error. -bool tls1_choose_signature_algorithm(SSL_HANDSHAKE *hs, uint16_t *out); - -// tls12_add_verify_sigalgs adds the signature algorithms acceptable for the -// peer signature to |out|. It returns true on success and false on error. -bool tls12_add_verify_sigalgs(const SSL *ssl, CBB *out); - -// tls12_check_peer_sigalg checks if |sigalg| is acceptable for the peer -// signature. It returns true on success and false on error, setting -// |*out_alert| to an alert to send. -bool tls12_check_peer_sigalg(const SSL *ssl, uint8_t *out_alert, - uint16_t sigalg); - - -// Underdocumented functions. -// -// Functions below here haven't been touched up and may be underdocumented. - -#define TLSEXT_CHANNEL_ID_SIZE 128 - -// From RFC4492, used in encoding the curve type in ECParameters -#define NAMED_CURVE_TYPE 3 - -struct CERT { - EVP_PKEY *privatekey; - - // chain contains the certificate chain, with the leaf at the beginning. The - // first element of |chain| may be NULL to indicate that the leaf certificate - // has not yet been set. - // If |chain| != NULL -> len(chain) >= 1 - // If |chain[0]| == NULL -> len(chain) >= 2. - // |chain[1..]| != NULL - STACK_OF(CRYPTO_BUFFER) *chain; - - // x509_chain may contain a parsed copy of |chain[1..]|. This is only used as - // a cache in order to implement “get0” functions that return a non-owning - // pointer to the certificate chain. - STACK_OF(X509) *x509_chain; - - // x509_leaf may contain a parsed copy of the first element of |chain|. This - // is only used as a cache in order to implement “get0” functions that return - // a non-owning pointer to the certificate chain. - X509 *x509_leaf; - - // x509_stash contains the last |X509| object append to the chain. This is a - // workaround for some third-party code that continue to use an |X509| object - // even after passing ownership with an “add0” function. - X509 *x509_stash; - - // key_method, if non-NULL, is a set of callbacks to call for private key - // operations. - const SSL_PRIVATE_KEY_METHOD *key_method; - - // x509_method contains pointers to functions that might deal with |X509| - // compatibility, or might be a no-op, depending on the application. - const SSL_X509_METHOD *x509_method; - - // sigalgs, if non-NULL, is the set of signature algorithms supported by - // |privatekey| in decreasing order of preference. - uint16_t *sigalgs; - size_t num_sigalgs; - - // Certificate setup callback: if set is called whenever a - // certificate may be required (client or server). the callback - // can then examine any appropriate parameters and setup any - // certificates required. This allows advanced applications - // to select certificates on the fly: for example based on - // supported signature algorithms or curves. - int (*cert_cb)(SSL *ssl, void *arg); - void *cert_cb_arg; - - // Optional X509_STORE for certificate validation. If NULL the parent SSL_CTX - // store is used instead. - X509_STORE *verify_store; - - // Signed certificate timestamp list to be sent to the client, if requested - CRYPTO_BUFFER *signed_cert_timestamp_list; - - // OCSP response to be sent to the client, if requested. - CRYPTO_BUFFER *ocsp_response; - - // sid_ctx partitions the session space within a shared session cache or - // ticket key. Only sessions with a matching value will be accepted. - uint8_t sid_ctx_length; - uint8_t sid_ctx[SSL_MAX_SID_CTX_LENGTH]; - - // If enable_early_data is true, early data can be sent and accepted. - bool enable_early_data:1; -}; - -// |SSL_PROTOCOL_METHOD| abstracts between TLS and DTLS. -struct SSL_PROTOCOL_METHOD { - bool is_dtls; - bool (*ssl_new)(SSL *ssl); - void (*ssl_free)(SSL *ssl); - // get_message sets |*out| to the current handshake message and returns true - // if one has been received. It returns false if more input is needed. - bool (*get_message)(SSL *ssl, SSLMessage *out); - // next_message is called to release the current handshake message. - void (*next_message)(SSL *ssl); - // Use the |ssl_open_handshake| wrapper. - ssl_open_record_t (*open_handshake)(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); - // Use the |ssl_open_change_cipher_spec| wrapper. - ssl_open_record_t (*open_change_cipher_spec)(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); - // Use the |ssl_open_app_data| wrapper. - ssl_open_record_t (*open_app_data)(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); - int (*write_app_data)(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, - int len); - int (*dispatch_alert)(SSL *ssl); - // init_message begins a new handshake message of type |type|. |cbb| is the - // root CBB to be passed into |finish_message|. |*body| is set to a child CBB - // the caller should write to. It returns true on success and false on error. - bool (*init_message)(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); - // finish_message finishes a handshake message. It sets |*out_msg| to the - // serialized message. It returns true on success and false on error. - bool (*finish_message)(SSL *ssl, CBB *cbb, bssl::Array *out_msg); - // add_message adds a handshake message to the pending flight. It returns - // true on success and false on error. - bool (*add_message)(SSL *ssl, bssl::Array msg); - // add_change_cipher_spec adds a ChangeCipherSpec record to the pending - // flight. It returns true on success and false on error. - bool (*add_change_cipher_spec)(SSL *ssl); - // add_alert adds an alert to the pending flight. It returns true on success - // and false on error. - bool (*add_alert)(SSL *ssl, uint8_t level, uint8_t desc); - // flush_flight flushes the pending flight to the transport. It returns one on - // success and <= 0 on error. - int (*flush_flight)(SSL *ssl); - // on_handshake_complete is called when the handshake is complete. - void (*on_handshake_complete)(SSL *ssl); - // set_read_state sets |ssl|'s read cipher state to |aead_ctx|. It returns - // true on success and false if changing the read state is forbidden at this - // point. - bool (*set_read_state)(SSL *ssl, UniquePtr aead_ctx); - // set_write_state sets |ssl|'s write cipher state to |aead_ctx|. It returns - // true on success and false if changing the write state is forbidden at this - // point. - bool (*set_write_state)(SSL *ssl, UniquePtr aead_ctx); -}; - -// The following wrappers call |open_*| but handle |read_shutdown| correctly. - -// ssl_open_handshake processes a record from |in| for reading a handshake -// message. -ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); - -// ssl_open_change_cipher_spec processes a record from |in| for reading a -// ChangeCipherSpec. -ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); - -// ssl_open_app_data processes a record from |in| for reading application data. -// On success, it returns |ssl_open_record_success| and sets |*out| to the -// input. If it encounters a post-handshake message, it returns -// |ssl_open_record_discard|. The caller should then retry, after processing any -// messages received with |get_message|. -ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); - -// ssl_crypto_x509_method provides the |SSL_X509_METHOD| functions using -// crypto/x509. -extern const SSL_X509_METHOD ssl_crypto_x509_method; - -// ssl_noop_x509_method provides the |SSL_X509_METHOD| functions that avoid -// crypto/x509. -extern const SSL_X509_METHOD ssl_noop_x509_method; - -// ssl_cipher_preference_list_st contains a list of SSL_CIPHERs with -// equal-preference groups. For TLS clients, the groups are moot because the -// server picks the cipher and groups cannot be expressed on the wire. However, -// for servers, the equal-preference groups allow the client's preferences to -// be partially respected. (This only has an effect with -// SSL_OP_CIPHER_SERVER_PREFERENCE). -// -// The equal-preference groups are expressed by grouping SSL_CIPHERs together. -// All elements of a group have the same priority: no ordering is expressed -// within a group. -// -// The values in |ciphers| are in one-to-one correspondence with -// |in_group_flags|. (That is, sk_SSL_CIPHER_num(ciphers) is the number of -// bytes in |in_group_flags|.) The bytes in |in_group_flags| are either 1, to -// indicate that the corresponding SSL_CIPHER is not the last element of a -// group, or 0 to indicate that it is. -// -// For example, if |in_group_flags| contains all zeros then that indicates a -// traditional, fully-ordered preference. Every SSL_CIPHER is the last element -// of the group (i.e. they are all in a one-element group). -// -// For a more complex example, consider: -// ciphers: A B C D E F -// in_group_flags: 1 1 0 0 1 0 -// -// That would express the following, order: -// -// A E -// B -> D -> F -// C -struct ssl_cipher_preference_list_st { - STACK_OF(SSL_CIPHER) *ciphers; - uint8_t *in_group_flags; -}; - -struct tlsext_ticket_key { - static constexpr bool kAllowUniquePtr = true; - - uint8_t name[SSL_TICKET_KEY_NAME_LEN]; - uint8_t hmac_key[16]; - uint8_t aes_key[16]; - // next_rotation_tv_sec is the time (in seconds from the epoch) when the - // current key should be superseded by a new key, or the time when a previous - // key should be dropped. If zero, then the key should not be automatically - // rotated. - uint64_t next_rotation_tv_sec; -}; - -} // namespace bssl - -DECLARE_LHASH_OF(SSL_SESSION) - -namespace bssl { - -// SSLContext backs the public |SSL_CTX| type. Due to compatibility constraints, -// it is a base class for |ssl_ctx_st|. -struct SSLContext { - const SSL_PROTOCOL_METHOD *method; - const SSL_X509_METHOD *x509_method; - - // lock is used to protect various operations on this object. - CRYPTO_MUTEX lock; - - // conf_max_version is the maximum acceptable protocol version configured by - // |SSL_CTX_set_max_proto_version|. Note this version is normalized in DTLS - // and is further constrainted by |SSL_OP_NO_*|. - uint16_t conf_max_version; - - // conf_min_version is the minimum acceptable protocol version configured by - // |SSL_CTX_set_min_proto_version|. Note this version is normalized in DTLS - // and is further constrainted by |SSL_OP_NO_*|. - uint16_t conf_min_version; - - // tls13_variant is the variant of TLS 1.3 we are using for this - // configuration. - enum tls13_variant_t tls13_variant; - - struct ssl_cipher_preference_list_st *cipher_list; - - X509_STORE *cert_store; - LHASH_OF(SSL_SESSION) *sessions; - // Most session-ids that will be cached, default is - // SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. - unsigned long session_cache_size; - SSL_SESSION *session_cache_head; - SSL_SESSION *session_cache_tail; - - // handshakes_since_cache_flush is the number of successful handshakes since - // the last cache flush. - int handshakes_since_cache_flush; - - // This can have one of 2 values, ored together, - // SSL_SESS_CACHE_CLIENT, - // SSL_SESS_CACHE_SERVER, - // Default is SSL_SESSION_CACHE_SERVER, which means only - // SSL_accept which cache SSL_SESSIONS. - int session_cache_mode; - - // session_timeout is the default lifetime for new sessions in TLS 1.2 and - // earlier, in seconds. - uint32_t session_timeout; - - // session_psk_dhe_timeout is the default lifetime for new sessions in TLS - // 1.3, in seconds. - uint32_t session_psk_dhe_timeout; - - // If this callback is not null, it will be called each time a session id is - // added to the cache. If this function returns 1, it means that the - // callback will do a SSL_SESSION_free() when it has finished using it. - // Otherwise, on 0, it means the callback has finished with it. If - // remove_session_cb is not null, it will be called when a session-id is - // removed from the cache. After the call, OpenSSL will SSL_SESSION_free() - // it. - int (*new_session_cb)(SSL *ssl, SSL_SESSION *sess); - void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *sess); - SSL_SESSION *(*get_session_cb)(SSL *ssl, const uint8_t *data, int len, - int *copy); - SSL_SESSION *(*get_session_cb_legacy)(SSL *ssl, uint8_t *data, int len, - int *copy); - - CRYPTO_refcount_t references; - - // if defined, these override the X509_verify_cert() calls - int (*app_verify_callback)(X509_STORE_CTX *store_ctx, void *arg); - void *app_verify_arg; - - enum ssl_verify_result_t (*custom_verify_callback)(SSL *ssl, - uint8_t *out_alert); - - // Default password callback. - pem_password_cb *default_passwd_callback; - - // Default password callback user data. - void *default_passwd_callback_userdata; - - // get client cert callback - int (*client_cert_cb)(SSL *ssl, X509 **out_x509, EVP_PKEY **out_pkey); - - // get channel id callback - void (*channel_id_cb)(SSL *ssl, EVP_PKEY **out_pkey); - - CRYPTO_EX_DATA ex_data; - - // custom_*_extensions stores any callback sets for custom extensions. Note - // that these pointers will be NULL if the stack would otherwise be empty. - STACK_OF(SSL_CUSTOM_EXTENSION) *client_custom_extensions; - STACK_OF(SSL_CUSTOM_EXTENSION) *server_custom_extensions; - - // Default values used when no per-SSL value is defined follow - - void (*info_callback)(const SSL *ssl, int type, int value); - - // what we put in client cert requests - STACK_OF(CRYPTO_BUFFER) *client_CA; - - // cached_x509_client_CA is a cache of parsed versions of the elements of - // |client_CA|. - STACK_OF(X509_NAME) *cached_x509_client_CA; - - - // Default values to use in SSL structures follow (these are copied by - // SSL_new) - - uint32_t options; - uint32_t mode; - uint32_t max_cert_list; - - CERT *cert; - - // callback that allows applications to peek at protocol messages - void (*msg_callback)(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - int verify_mode; - int (*default_verify_callback)( - int ok, X509_STORE_CTX *ctx); // called 'verify_callback' in the SSL - - X509_VERIFY_PARAM *param; - - // select_certificate_cb is called before most ClientHello processing and - // before the decision whether to resume a session is made. See - // |ssl_select_cert_result_t| for details of the return values. - enum ssl_select_cert_result_t (*select_certificate_cb)( - const SSL_CLIENT_HELLO *); - - // dos_protection_cb is called once the resumption decision for a ClientHello - // has been made. It returns one to continue the handshake or zero to - // abort. - int (*dos_protection_cb) (const SSL_CLIENT_HELLO *); - - // Maximum amount of data to send in one fragment. actual record size can be - // more than this due to padding and MAC overheads. - uint16_t max_send_fragment; - - // TLS extensions servername callback - int (*tlsext_servername_callback)(SSL *, int *, void *); - void *tlsext_servername_arg; - - // RFC 4507 session ticket keys. |tlsext_ticket_key_current| may be NULL - // before the first handshake and |tlsext_ticket_key_prev| may be NULL at any - // time. Automatically generated ticket keys are rotated as needed at - // handshake time. Hence, all access must be synchronized through |lock|. - struct tlsext_ticket_key *tlsext_ticket_key_current; - struct tlsext_ticket_key *tlsext_ticket_key_prev; - - // Callback to support customisation of ticket key setting - int (*tlsext_ticket_key_cb)(SSL *ssl, uint8_t *name, uint8_t *iv, - EVP_CIPHER_CTX *ectx, HMAC_CTX *hctx, int enc); - - // Server-only: psk_identity_hint is the default identity hint to send in - // PSK-based key exchanges. - char *psk_identity_hint; - - unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, - char *identity, - unsigned int max_identity_len, - uint8_t *psk, unsigned int max_psk_len); - unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, - uint8_t *psk, unsigned int max_psk_len); - - - // Next protocol negotiation information - // (for experimental NPN extension). - - // For a server, this contains a callback function by which the set of - // advertised protocols can be provided. - int (*next_protos_advertised_cb)(SSL *ssl, const uint8_t **out, - unsigned *out_len, void *arg); - void *next_protos_advertised_cb_arg; - // For a client, this contains a callback function that selects the - // next protocol from the list provided by the server. - int (*next_proto_select_cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg); - void *next_proto_select_cb_arg; - - // ALPN information - // (we are in the process of transitioning from NPN to ALPN.) - - // For a server, this contains a callback function that allows the - // server to select the protocol for the connection. - // out: on successful return, this must point to the raw protocol - // name (without the length prefix). - // outlen: on successful return, this contains the length of |*out|. - // in: points to the client's list of supported protocols in - // wire-format. - // inlen: the length of |in|. - int (*alpn_select_cb)(SSL *ssl, const uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg); - void *alpn_select_cb_arg; - - // For a client, this contains the list of supported protocols in wire - // format. - uint8_t *alpn_client_proto_list; - unsigned alpn_client_proto_list_len; - - // SRTP profiles we are willing to do from RFC 5764 - STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; - - // Supported group values inherited by SSL structure - size_t supported_group_list_len; - uint16_t *supported_group_list; - - // The client's Channel ID private key. - EVP_PKEY *tlsext_channel_id_private; - - // keylog_callback, if not NULL, is the key logging callback. See - // |SSL_CTX_set_keylog_callback|. - void (*keylog_callback)(const SSL *ssl, const char *line); - - // current_time_cb, if not NULL, is the function to use to get the current - // time. It sets |*out_clock| to the current time. The |ssl| argument is - // always NULL. See |SSL_CTX_set_current_time_cb|. - void (*current_time_cb)(const SSL *ssl, struct timeval *out_clock); - - // pool is used for all |CRYPTO_BUFFER|s in case we wish to share certificate - // memory. - CRYPTO_BUFFER_POOL *pool; - - // ticket_aead_method contains function pointers for opening and sealing - // session tickets. - const SSL_TICKET_AEAD_METHOD *ticket_aead_method; - - // verify_sigalgs, if not empty, is the set of signature algorithms - // accepted from the peer in decreasing order of preference. - uint16_t *verify_sigalgs; - size_t num_verify_sigalgs; - - // retain_only_sha256_of_client_certs is true if we should compute the SHA256 - // hash of the peer's certificate and then discard it to save memory and - // session space. Only effective on the server side. - bool retain_only_sha256_of_client_certs:1; - - // quiet_shutdown is true if the connection should not send a close_notify on - // shutdown. - bool quiet_shutdown:1; - - // ocsp_stapling_enabled is only used by client connections and indicates - // whether OCSP stapling will be requested. - bool ocsp_stapling_enabled:1; - - // If true, a client will request certificate timestamps. - bool signed_cert_timestamps_enabled:1; - - // tlsext_channel_id_enabled is whether Channel ID is enabled. For a server, - // means that we'll accept Channel IDs from clients. For a client, means that - // we'll advertise support. - bool tlsext_channel_id_enabled:1; - - // grease_enabled is whether draft-davidben-tls-grease-01 is enabled. - bool grease_enabled:1; - - // allow_unknown_alpn_protos is whether the client allows unsolicited ALPN - // protocols from the peer. - bool allow_unknown_alpn_protos:1; - - // ed25519_enabled is whether Ed25519 is advertised in the handshake. - bool ed25519_enabled:1; - - // false_start_allowed_without_alpn is whether False Start (if - // |SSL_MODE_ENABLE_FALSE_START| is enabled) is allowed without ALPN. - bool false_start_allowed_without_alpn:1; - - // handoff indicates that a server should stop after receiving the - // ClientHello and pause the handshake in such a way that |SSL_get_error| - // returns |SSL_HANDOFF|. - bool handoff:1; -}; - -// An ssl_shutdown_t describes the shutdown state of one end of the connection, -// whether it is alive or has been shutdown via close_notify or fatal alert. -enum ssl_shutdown_t { - ssl_shutdown_none = 0, - ssl_shutdown_close_notify = 1, - ssl_shutdown_error = 2, -}; - -struct SSL3_STATE { - static constexpr bool kAllowUniquePtr = true; - - SSL3_STATE(); - ~SSL3_STATE(); - - uint8_t read_sequence[8] = {0}; - uint8_t write_sequence[8] = {0}; - - uint8_t server_random[SSL3_RANDOM_SIZE] = {0}; - uint8_t client_random[SSL3_RANDOM_SIZE] = {0}; - - // read_buffer holds data from the transport to be processed. - SSLBuffer read_buffer; - // write_buffer holds data to be written to the transport. - SSLBuffer write_buffer; - - // pending_app_data is the unconsumed application data. It points into - // |read_buffer|. - Span pending_app_data; - - // partial write - check the numbers match - unsigned int wnum = 0; // number of bytes sent so far - int wpend_tot = 0; // number bytes written - int wpend_type = 0; - int wpend_ret = 0; // number of bytes submitted - const uint8_t *wpend_buf = nullptr; - - // read_shutdown is the shutdown state for the read half of the connection. - enum ssl_shutdown_t read_shutdown = ssl_shutdown_none; - - // write_shutdown is the shutdown state for the write half of the connection. - enum ssl_shutdown_t write_shutdown = ssl_shutdown_none; - - // read_error, if |read_shutdown| is |ssl_shutdown_error|, is the error for - // the receive half of the connection. - UniquePtr read_error; - - int alert_dispatch = 0; - - int total_renegotiations = 0; - - // This holds a variable that indicates what we were doing when a 0 or -1 is - // returned. This is needed for non-blocking IO so we know what request - // needs re-doing when in SSL_accept or SSL_connect - int rwstate = SSL_NOTHING; - - // early_data_skipped is the amount of early data that has been skipped by the - // record layer. - uint16_t early_data_skipped = 0; - - // empty_record_count is the number of consecutive empty records received. - uint8_t empty_record_count = 0; - - // warning_alert_count is the number of consecutive warning alerts - // received. - uint8_t warning_alert_count = 0; - - // key_update_count is the number of consecutive KeyUpdates received. - uint8_t key_update_count = 0; - - // skip_early_data instructs the record layer to skip unexpected early data - // messages when 0RTT is rejected. - bool skip_early_data:1; - - // have_version is true if the connection's final version is known. Otherwise - // the version has not been negotiated yet. - bool have_version:1; - - // v2_hello_done is true if the peer's V2ClientHello, if any, has been handled - // and future messages should use the record layer. - bool v2_hello_done:1; - - // is_v2_hello is true if the current handshake message was derived from a - // V2ClientHello rather than received from the peer directly. - bool is_v2_hello:1; - - // has_message is true if the current handshake message has been returned - // at least once by |get_message| and false otherwise. - bool has_message:1; - - // initial_handshake_complete is true if the initial handshake has - // completed. - bool initial_handshake_complete:1; - - // session_reused indicates whether a session was resumed. - bool session_reused:1; - - bool send_connection_binding:1; - - // In a client, this means that the server supported Channel ID and that a - // Channel ID was sent. In a server it means that we echoed support for - // Channel IDs and that tlsext_channel_id will be valid after the - // handshake. - bool tlsext_channel_id_valid:1; - - // key_update_pending is true if we have a KeyUpdate acknowledgment - // outstanding. - bool key_update_pending:1; - - // wpend_pending is true if we have a pending write outstanding. - bool wpend_pending:1; - - // early_data_accepted is true if early data was accepted by the server. - bool early_data_accepted:1; - - // draft_downgrade is whether the TLS 1.3 anti-downgrade logic would have - // fired, were it not a draft. - bool draft_downgrade:1; - - // hs_buf is the buffer of handshake data to process. - UniquePtr hs_buf; - - // pending_flight is the pending outgoing flight. This is used to flush each - // handshake flight in a single write. |write_buffer| must be written out - // before this data. - UniquePtr pending_flight; - - // pending_flight_offset is the number of bytes of |pending_flight| which have - // been successfully written. - uint32_t pending_flight_offset = 0; - - // ticket_age_skew is the difference, in seconds, between the client-sent - // ticket age and the server-computed value in TLS 1.3 server connections - // which resumed a session. - int32_t ticket_age_skew = 0; - - // aead_read_ctx is the current read cipher state. - UniquePtr aead_read_ctx; - - // aead_write_ctx is the current write cipher state. - UniquePtr aead_write_ctx; - - // hs is the handshake state for the current handshake or NULL if there isn't - // one. - UniquePtr hs; - - uint8_t write_traffic_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t read_traffic_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t exporter_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t early_exporter_secret[EVP_MAX_MD_SIZE] = {0}; - uint8_t write_traffic_secret_len = 0; - uint8_t read_traffic_secret_len = 0; - uint8_t exporter_secret_len = 0; - uint8_t early_exporter_secret_len = 0; - - // Connection binding to prevent renegotiation attacks - uint8_t previous_client_finished[12] = {0}; - uint8_t previous_client_finished_len = 0; - uint8_t previous_server_finished_len = 0; - uint8_t previous_server_finished[12] = {0}; - - uint8_t send_alert[2] = {0}; - - // established_session is the session established by the connection. This - // session is only filled upon the completion of the handshake and is - // immutable. - UniquePtr established_session; - - // Next protocol negotiation. For the client, this is the protocol that we - // sent in NextProtocol and is set when handling ServerHello extensions. - // - // For a server, this is the client's selected_protocol from NextProtocol and - // is set when handling the NextProtocol message, before the Finished - // message. - Array next_proto_negotiated; - - // ALPN information - // (we are in the process of transitioning from NPN to ALPN.) - - // In a server these point to the selected ALPN protocol after the - // ClientHello has been processed. In a client these contain the protocol - // that the server selected once the ServerHello has been processed. - Array alpn_selected; - - // hostname, on the server, is the value of the SNI extension. - UniquePtr hostname; - - // For a server: - // If |tlsext_channel_id_valid| is true, then this contains the - // verified Channel ID from the client: a P256 point, (x,y), where - // each are big-endian values. - uint8_t tlsext_channel_id[64] = {0}; - - // Contains the QUIC transport params received by the peer. - Array peer_quic_transport_params; -}; - -// lengths of messages -#define DTLS1_COOKIE_LENGTH 256 - -#define DTLS1_RT_HEADER_LENGTH 13 - -#define DTLS1_HM_HEADER_LENGTH 12 - -#define DTLS1_CCS_HEADER_LENGTH 1 - -#define DTLS1_AL_HEADER_LENGTH 2 - -struct hm_header_st { - uint8_t type; - uint32_t msg_len; - uint16_t seq; - uint32_t frag_off; - uint32_t frag_len; -}; - -// An hm_fragment is an incoming DTLS message, possibly not yet assembled. -struct hm_fragment { - static constexpr bool kAllowUniquePtr = true; - - hm_fragment() {} - hm_fragment(const hm_fragment &) = delete; - hm_fragment &operator=(const hm_fragment &) = delete; - - ~hm_fragment(); - - // type is the type of the message. - uint8_t type = 0; - // seq is the sequence number of this message. - uint16_t seq = 0; - // msg_len is the length of the message body. - uint32_t msg_len = 0; - // data is a pointer to the message, including message header. It has length - // |DTLS1_HM_HEADER_LENGTH| + |msg_len|. - uint8_t *data = nullptr; - // reassembly is a bitmask of |msg_len| bits corresponding to which parts of - // the message have been received. It is NULL if the message is complete. - uint8_t *reassembly = nullptr; -}; - -struct OPENSSL_timeval { - uint64_t tv_sec; - uint32_t tv_usec; -}; - -struct DTLS1_STATE { - static constexpr bool kAllowUniquePtr = true; - - DTLS1_STATE(); - ~DTLS1_STATE(); - - // has_change_cipher_spec is true if we have received a ChangeCipherSpec from - // the peer in this epoch. - bool has_change_cipher_spec:1; - - // outgoing_messages_complete is true if |outgoing_messages| has been - // completed by an attempt to flush it. Future calls to |add_message| and - // |add_change_cipher_spec| will start a new flight. - bool outgoing_messages_complete:1; - - // flight_has_reply is true if the current outgoing flight is complete and has - // processed at least one message. This is used to detect whether we or the - // peer sent the final flight. - bool flight_has_reply:1; - - uint8_t cookie[DTLS1_COOKIE_LENGTH] = {0}; - size_t cookie_len = 0; - - // The current data and handshake epoch. This is initially undefined, and - // starts at zero once the initial handshake is completed. - uint16_t r_epoch = 0; - uint16_t w_epoch = 0; - - // records being received in the current epoch - DTLS1_BITMAP bitmap; - - uint16_t handshake_write_seq = 0; - uint16_t handshake_read_seq = 0; - - // save last sequence number for retransmissions - uint8_t last_write_sequence[8] = {0}; - UniquePtr last_aead_write_ctx; - - // incoming_messages is a ring buffer of incoming handshake messages that have - // yet to be processed. The front of the ring buffer is message number - // |handshake_read_seq|, at position |handshake_read_seq| % - // |SSL_MAX_HANDSHAKE_FLIGHT|. - UniquePtr incoming_messages[SSL_MAX_HANDSHAKE_FLIGHT]; - - // outgoing_messages is the queue of outgoing messages from the last handshake - // flight. - DTLS_OUTGOING_MESSAGE outgoing_messages[SSL_MAX_HANDSHAKE_FLIGHT]; - uint8_t outgoing_messages_len = 0; - - // outgoing_written is the number of outgoing messages that have been - // written. - uint8_t outgoing_written = 0; - // outgoing_offset is the number of bytes of the next outgoing message have - // been written. - uint32_t outgoing_offset = 0; - - unsigned mtu = 0; // max DTLS packet size - - // num_timeouts is the number of times the retransmit timer has fired since - // the last time it was reset. - unsigned num_timeouts = 0; - - // Indicates when the last handshake msg or heartbeat sent will - // timeout. - struct OPENSSL_timeval next_timeout = {0, 0}; - - // timeout_duration_ms is the timeout duration in milliseconds. - unsigned timeout_duration_ms = 0; -}; - -// SSLConnection backs the public |SSL| type. Due to compatibility constraints, -// it is a base class for |ssl_st|. -struct SSLConnection { - // method is the method table corresponding to the current protocol (DTLS or - // TLS). - const SSL_PROTOCOL_METHOD *method; - - // version is the protocol version. - uint16_t version; - - // conf_max_version is the maximum acceptable protocol version configured by - // |SSL_set_max_proto_version|. Note this version is normalized in DTLS and is - // further constrainted by |SSL_OP_NO_*|. - uint16_t conf_max_version; - - // conf_min_version is the minimum acceptable protocol version configured by - // |SSL_set_min_proto_version|. Note this version is normalized in DTLS and is - // further constrainted by |SSL_OP_NO_*|. - uint16_t conf_min_version; - - uint16_t max_send_fragment; - - // There are 2 BIO's even though they are normally both the same. This is so - // data can be read and written to different handlers - - BIO *rbio; // used by SSL_read - BIO *wbio; // used by SSL_write - - // do_handshake runs the handshake. On completion, it returns |ssl_hs_ok|. - // Otherwise, it returns a value corresponding to what operation is needed to - // progress. - enum ssl_hs_wait_t (*do_handshake)(SSL_HANDSHAKE *hs); - - SSL3_STATE *s3; // SSLv3 variables - DTLS1_STATE *d1; // DTLSv1 variables - - // callback that allows applications to peek at protocol messages - void (*msg_callback)(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, void *arg); - void *msg_callback_arg; - - X509_VERIFY_PARAM *param; - - // crypto - struct ssl_cipher_preference_list_st *cipher_list; - - // session info - - // This is used to hold the local certificate used (i.e. the server - // certificate for a server or the client certificate for a client). - CERT *cert; - - // initial_timeout_duration_ms is the default DTLS timeout duration in - // milliseconds. It's used to initialize the timer any time it's restarted. - unsigned initial_timeout_duration_ms; - - // tls13_variant is the variant of TLS 1.3 we are using for this - // configuration. - enum tls13_variant_t tls13_variant; - - // session is the configured session to be offered by the client. This session - // is immutable. - SSL_SESSION *session; - - int (*verify_callback)(int ok, - X509_STORE_CTX *ctx); // fail if callback returns 0 - - enum ssl_verify_result_t (*custom_verify_callback)(SSL *ssl, - uint8_t *out_alert); - - void (*info_callback)(const SSL *ssl, int type, int value); - - // Server-only: psk_identity_hint is the identity hint to send in - // PSK-based key exchanges. - char *psk_identity_hint; - - unsigned int (*psk_client_callback)(SSL *ssl, const char *hint, - char *identity, - unsigned int max_identity_len, - uint8_t *psk, unsigned int max_psk_len); - unsigned int (*psk_server_callback)(SSL *ssl, const char *identity, - uint8_t *psk, unsigned int max_psk_len); - - SSL_CTX *ctx; - - // extra application data - CRYPTO_EX_DATA ex_data; - - // for server side, keep the list of CA_dn we can use - STACK_OF(CRYPTO_BUFFER) *client_CA; - - // cached_x509_client_CA is a cache of parsed versions of the elements of - // |client_CA|. - STACK_OF(X509_NAME) *cached_x509_client_CA; - - uint32_t options; // protocol behaviour - uint32_t mode; // API behaviour - uint32_t max_cert_list; - uint16_t dummy_pq_padding_len; - char *tlsext_hostname; - size_t supported_group_list_len; - uint16_t *supported_group_list; // our list - - // session_ctx is the |SSL_CTX| used for the session cache and related - // settings. - SSL_CTX *session_ctx; - - // srtp_profiles is the list of configured SRTP protection profiles for - // DTLS-SRTP. - STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles; - - // srtp_profile is the selected SRTP protection profile for - // DTLS-SRTP. - const SRTP_PROTECTION_PROFILE *srtp_profile; - - // The client's Channel ID private key. - EVP_PKEY *tlsext_channel_id_private; - - // For a client, this contains the list of supported protocols in wire - // format. - uint8_t *alpn_client_proto_list; - unsigned alpn_client_proto_list_len; - - // Contains a list of supported Token Binding key parameters. - uint8_t *token_binding_params; - size_t token_binding_params_len; - - // The negotiated Token Binding key parameter. Only valid if - // |token_binding_negotiated| is set. - uint8_t negotiated_token_binding_param; - - // Contains the QUIC transport params that this endpoint will send. - uint8_t *quic_transport_params; - size_t quic_transport_params_len; - - // renegotiate_mode controls how peer renegotiation attempts are handled. - enum ssl_renegotiate_mode_t renegotiate_mode; - - // verify_mode is a bitmask of |SSL_VERIFY_*| values. - uint8_t verify_mode; - - // server is true iff the this SSL* is the server half. Note: before the SSL* - // is initialized by either SSL_set_accept_state or SSL_set_connect_state, - // the side is not determined. In this state, server is always false. - bool server:1; - - // quiet_shutdown is true if the connection should not send a close_notify on - // shutdown. - bool quiet_shutdown:1; - - // Enable signed certificate time stamps. Currently client only. - bool signed_cert_timestamps_enabled:1; - - // ocsp_stapling_enabled is only used by client connections and indicates - // whether OCSP stapling will be requested. - bool ocsp_stapling_enabled:1; - - // tlsext_channel_id_enabled is copied from the |SSL_CTX|. For a server, - // means that we'll accept Channel IDs from clients. For a client, means that - // we'll advertise support. - bool tlsext_channel_id_enabled:1; - - // token_binding_negotiated is set if Token Binding was negotiated. - bool token_binding_negotiated:1; - - // retain_only_sha256_of_client_certs is true if we should compute the SHA256 - // hash of the peer's certificate and then discard it to save memory and - // session space. Only effective on the server side. - bool retain_only_sha256_of_client_certs:1; - - // handoff indicates that a server should stop after receiving the - // ClientHello and pause the handshake in such a way that |SSL_get_error| - // returns |SSL_HANDOFF|. This is copied in |SSL_new| from the |SSL_CTX| - // element of the same name and may be cleared if the handoff is declined. - bool handoff:1; - - // did_dummy_pq_padding is only valid for a client. In that context, it is - // true iff the client observed the server echoing a dummy PQ padding - // extension. - bool did_dummy_pq_padding:1; -}; - -// From draft-ietf-tls-tls13-18, used in determining PSK modes. -#define SSL_PSK_DHE_KE 0x1 - -// From draft-ietf-tls-tls13-16, used in determining whether to respond with a -// KeyUpdate. -#define SSL_KEY_UPDATE_NOT_REQUESTED 0 -#define SSL_KEY_UPDATE_REQUESTED 1 - -// kMaxEarlyDataAccepted is the advertised number of plaintext bytes of early -// data that will be accepted. This value should be slightly below -// kMaxEarlyDataSkipped in tls_record.c, which is measured in ciphertext. -static const size_t kMaxEarlyDataAccepted = 14336; - -CERT *ssl_cert_new(const SSL_X509_METHOD *x509_method); -CERT *ssl_cert_dup(CERT *cert); -void ssl_cert_clear_certs(CERT *cert); -void ssl_cert_free(CERT *cert); -int ssl_set_cert(CERT *cert, UniquePtr buffer); -int ssl_is_key_type_supported(int key_type); -// ssl_compare_public_and_private_key returns one if |pubkey| is the public -// counterpart to |privkey|. Otherwise it returns zero and pushes a helpful -// message on the error queue. -int ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, - const EVP_PKEY *privkey); -int ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey); -int ssl_get_new_session(SSL_HANDSHAKE *hs, int is_server); -int ssl_encrypt_ticket(SSL *ssl, CBB *out, const SSL_SESSION *session); -int ssl_ctx_rotate_ticket_encryption_key(SSL_CTX *ctx); - -// ssl_session_new returns a newly-allocated blank |SSL_SESSION| or nullptr on -// error. -UniquePtr ssl_session_new(const SSL_X509_METHOD *x509_method); - -// SSL_SESSION_parse parses an |SSL_SESSION| from |cbs| and advances |cbs| over -// the parsed data. -UniquePtr SSL_SESSION_parse(CBS *cbs, - const SSL_X509_METHOD *x509_method, - CRYPTO_BUFFER_POOL *pool); - -// ssl_session_serialize writes |in| to |cbb| as if it were serialising a -// session for Session-ID resumption. It returns one on success and zero on -// error. -int ssl_session_serialize(const SSL_SESSION *in, CBB *cbb); - -// ssl_session_is_context_valid returns one if |session|'s session ID context -// matches the one set on |ssl| and zero otherwise. -int ssl_session_is_context_valid(const SSL *ssl, const SSL_SESSION *session); - -// ssl_session_is_time_valid returns one if |session| is still valid and zero if -// it has expired. -int ssl_session_is_time_valid(const SSL *ssl, const SSL_SESSION *session); - -// ssl_session_is_resumable returns one if |session| is resumable for |hs| and -// zero otherwise. -int ssl_session_is_resumable(const SSL_HANDSHAKE *hs, - const SSL_SESSION *session); - -// ssl_session_protocol_version returns the protocol version associated with -// |session|. Note that despite the name, this is not the same as -// |SSL_SESSION_get_protocol_version|. The latter is based on upstream's name. -uint16_t ssl_session_protocol_version(const SSL_SESSION *session); - -// ssl_session_get_digest returns the digest used in |session|. -const EVP_MD *ssl_session_get_digest(const SSL_SESSION *session); - -void ssl_set_session(SSL *ssl, SSL_SESSION *session); - -// ssl_get_prev_session looks up the previous session based on |client_hello|. -// On success, it sets |*out_session| to the session or nullptr if none was -// found. If the session could not be looked up synchronously, it returns -// |ssl_hs_pending_session| and should be called again. If a ticket could not be -// decrypted immediately it returns |ssl_hs_pending_ticket| and should also -// be called again. Otherwise, it returns |ssl_hs_error|. -enum ssl_hs_wait_t ssl_get_prev_session(SSL *ssl, - UniquePtr *out_session, - bool *out_tickets_supported, - bool *out_renew_ticket, - const SSL_CLIENT_HELLO *client_hello); - -// The following flags determine which parts of the session are duplicated. -#define SSL_SESSION_DUP_AUTH_ONLY 0x0 -#define SSL_SESSION_INCLUDE_TICKET 0x1 -#define SSL_SESSION_INCLUDE_NONAUTH 0x2 -#define SSL_SESSION_DUP_ALL \ - (SSL_SESSION_INCLUDE_TICKET | SSL_SESSION_INCLUDE_NONAUTH) - -// SSL_SESSION_dup returns a newly-allocated |SSL_SESSION| with a copy of the -// fields in |session| or nullptr on error. The new session is non-resumable and -// must be explicitly marked resumable once it has been filled in. -OPENSSL_EXPORT UniquePtr SSL_SESSION_dup(SSL_SESSION *session, - int dup_flags); - -// ssl_session_rebase_time updates |session|'s start time to the current time, -// adjusting the timeout so the expiration time is unchanged. -void ssl_session_rebase_time(SSL *ssl, SSL_SESSION *session); - -// ssl_session_renew_timeout calls |ssl_session_rebase_time| and renews -// |session|'s timeout to |timeout| (measured from the current time). The -// renewal is clamped to the session's auth_timeout. -void ssl_session_renew_timeout(SSL *ssl, SSL_SESSION *session, - uint32_t timeout); - -void ssl_cipher_preference_list_free( - struct ssl_cipher_preference_list_st *cipher_list); - -// ssl_get_cipher_preferences returns the cipher preference list for TLS 1.2 and -// below. -const struct ssl_cipher_preference_list_st *ssl_get_cipher_preferences( - const SSL *ssl); - -void ssl_update_cache(SSL_HANDSHAKE *hs, int mode); - -int ssl_send_alert(SSL *ssl, int level, int desc); -bool ssl3_get_message(SSL *ssl, SSLMessage *out); -ssl_open_record_t ssl3_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); -void ssl3_next_message(SSL *ssl); - -int ssl3_dispatch_alert(SSL *ssl); -ssl_open_record_t ssl3_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); -ssl_open_record_t ssl3_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); -int ssl3_write_app_data(SSL *ssl, bool *out_needs_handshake, const uint8_t *buf, - int len); - -bool ssl3_new(SSL *ssl); -void ssl3_free(SSL *ssl); - -bool ssl3_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); -bool ssl3_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); -bool ssl3_add_message(SSL *ssl, Array msg); -bool ssl3_add_change_cipher_spec(SSL *ssl); -bool ssl3_add_alert(SSL *ssl, uint8_t level, uint8_t desc); -int ssl3_flush_flight(SSL *ssl); - -bool dtls1_init_message(SSL *ssl, CBB *cbb, CBB *body, uint8_t type); -bool dtls1_finish_message(SSL *ssl, CBB *cbb, Array *out_msg); -bool dtls1_add_message(SSL *ssl, Array msg); -bool dtls1_add_change_cipher_spec(SSL *ssl); -bool dtls1_add_alert(SSL *ssl, uint8_t level, uint8_t desc); -int dtls1_flush_flight(SSL *ssl); - -// ssl_add_message_cbb finishes the handshake message in |cbb| and adds it to -// the pending flight. It returns true on success and false on error. -bool ssl_add_message_cbb(SSL *ssl, CBB *cbb); - -// ssl_hash_message incorporates |msg| into the handshake hash. It returns true -// on success and false on allocation failure. -bool ssl_hash_message(SSL_HANDSHAKE *hs, const SSLMessage &msg); - -ssl_open_record_t dtls1_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in); -ssl_open_record_t dtls1_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in); - -int dtls1_write_app_data(SSL *ssl, bool *out_needs_handshake, - const uint8_t *buf, int len); - -// dtls1_write_record sends a record. It returns one on success and <= 0 on -// error. -int dtls1_write_record(SSL *ssl, int type, const uint8_t *buf, size_t len, - enum dtls1_use_epoch_t use_epoch); - -int dtls1_retransmit_outgoing_messages(SSL *ssl); -bool dtls1_parse_fragment(CBS *cbs, struct hm_header_st *out_hdr, - CBS *out_body); -bool dtls1_check_timeout_num(SSL *ssl); - -void dtls1_start_timer(SSL *ssl); -void dtls1_stop_timer(SSL *ssl); -bool dtls1_is_timer_expired(SSL *ssl); -unsigned int dtls1_min_mtu(void); - -bool dtls1_new(SSL *ssl); -void dtls1_free(SSL *ssl); - -bool dtls1_get_message(SSL *ssl, SSLMessage *out); -ssl_open_record_t dtls1_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in); -void dtls1_next_message(SSL *ssl); -int dtls1_dispatch_alert(SSL *ssl); - -// tls1_configure_aead configures either the read or write direction AEAD (as -// determined by |direction|) using the keys generated by the TLS KDF. The -// |key_block_cache| argument is used to store the generated key block, if -// empty. Otherwise it's assumed that the key block is already contained within -// it. Returns one on success or zero on error. -int tls1_configure_aead(SSL *ssl, evp_aead_direction_t direction, - Array *key_block_cache, - const SSL_CIPHER *cipher, - Span iv_override); - -int tls1_change_cipher_state(SSL_HANDSHAKE *hs, evp_aead_direction_t direction); -int tls1_generate_master_secret(SSL_HANDSHAKE *hs, uint8_t *out, - Span premaster); - -// tls1_get_grouplist returns the locally-configured group preference list. -Span tls1_get_grouplist(const SSL *ssl); - -// tls1_check_group_id returns one if |group_id| is consistent with -// locally-configured group preferences. -int tls1_check_group_id(const SSL *ssl, uint16_t group_id); - -// tls1_get_shared_group sets |*out_group_id| to the first preferred shared -// group between client and server preferences and returns one. If none may be -// found, it returns zero. -int tls1_get_shared_group(SSL_HANDSHAKE *hs, uint16_t *out_group_id); - -// tls1_set_curves converts the array of |ncurves| NIDs pointed to by |curves| -// into a newly allocated array of TLS group IDs. On success, the function -// returns one and writes the array to |*out_group_ids| and its size to -// |*out_group_ids_len|. Otherwise, it returns zero. -int tls1_set_curves(uint16_t **out_group_ids, size_t *out_group_ids_len, - const int *curves, size_t ncurves); - -// tls1_set_curves_list converts the string of curves pointed to by |curves| -// into a newly allocated array of TLS group IDs. On success, the function -// returns one and writes the array to |*out_group_ids| and its size to -// |*out_group_ids_len|. Otherwise, it returns zero. -int tls1_set_curves_list(uint16_t **out_group_ids, size_t *out_group_ids_len, - const char *curves); - -// ssl_add_clienthello_tlsext writes ClientHello extensions to |out|. It -// returns one on success and zero on failure. The |header_len| argument is the -// length of the ClientHello written so far and is used to compute the padding -// length. (It does not include the record header.) -int ssl_add_clienthello_tlsext(SSL_HANDSHAKE *hs, CBB *out, size_t header_len); - -int ssl_add_serverhello_tlsext(SSL_HANDSHAKE *hs, CBB *out); -int ssl_parse_clienthello_tlsext(SSL_HANDSHAKE *hs, - const SSL_CLIENT_HELLO *client_hello); -int ssl_parse_serverhello_tlsext(SSL_HANDSHAKE *hs, CBS *cbs); - -#define tlsext_tick_md EVP_sha256 - -// ssl_process_ticket processes a session ticket from the client. It returns -// one of: -// |ssl_ticket_aead_success|: |*out_session| is set to the parsed session and -// |*out_renew_ticket| is set to whether the ticket should be renewed. -// |ssl_ticket_aead_ignore_ticket|: |*out_renew_ticket| is set to whether a -// fresh ticket should be sent, but the given ticket cannot be used. -// |ssl_ticket_aead_retry|: the ticket could not be immediately decrypted. -// Retry later. -// |ssl_ticket_aead_error|: an error occured that is fatal to the connection. -enum ssl_ticket_aead_result_t ssl_process_ticket( - SSL *ssl, UniquePtr *out_session, bool *out_renew_ticket, - const uint8_t *ticket, size_t ticket_len, const uint8_t *session_id, - size_t session_id_len); - -// tls1_verify_channel_id processes |msg| as a Channel ID message, and verifies -// the signature. If the key is valid, it saves the Channel ID and returns -// one. Otherwise, it returns zero. -int tls1_verify_channel_id(SSL_HANDSHAKE *hs, const SSLMessage &msg); - -// tls1_write_channel_id generates a Channel ID message and puts the output in -// |cbb|. |ssl->tlsext_channel_id_private| must already be set before calling. -// This function returns true on success and false on error. -bool tls1_write_channel_id(SSL_HANDSHAKE *hs, CBB *cbb); - -// tls1_channel_id_hash computes the hash to be signed by Channel ID and writes -// it to |out|, which must contain at least |EVP_MAX_MD_SIZE| bytes. It returns -// one on success and zero on failure. -int tls1_channel_id_hash(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len); - -int tls1_record_handshake_hashes_for_channel_id(SSL_HANDSHAKE *hs); - -// ssl_do_channel_id_callback checks runs |ssl->ctx->channel_id_cb| if -// necessary. It returns one on success and zero on fatal error. Note that, on -// success, |ssl->tlsext_channel_id_private| may be unset, in which case the -// operation should be retried later. -int ssl_do_channel_id_callback(SSL *ssl); - -// ssl_can_write returns one if |ssl| is allowed to write and zero otherwise. -int ssl_can_write(const SSL *ssl); - -// ssl_can_read returns one if |ssl| is allowed to read and zero otherwise. -int ssl_can_read(const SSL *ssl); - -void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock); -void ssl_ctx_get_current_time(const SSL_CTX *ctx, - struct OPENSSL_timeval *out_clock); - -// ssl_reset_error_state resets state for |SSL_get_error|. -void ssl_reset_error_state(SSL *ssl); - -// ssl_set_read_error sets |ssl|'s read half into an error state, saving the -// current state of the error queue. -void ssl_set_read_error(SSL* ssl); - -} // namespace bssl - - -// Opaque C types. -// -// The following types are exported to C code as public typedefs, so they must -// be defined outside of the namespace. - -// ssl_method_st backs the public |SSL_METHOD| type. It is a compatibility -// structure to support the legacy version-locked methods. -struct ssl_method_st { - // version, if non-zero, is the only protocol version acceptable to an - // SSL_CTX initialized from this method. - uint16_t version; - // method is the underlying SSL_PROTOCOL_METHOD that initializes the - // SSL_CTX. - const bssl::SSL_PROTOCOL_METHOD *method; - // x509_method contains pointers to functions that might deal with |X509| - // compatibility, or might be a no-op, depending on the application. - const SSL_X509_METHOD *x509_method; -}; - -struct ssl_x509_method_st { - // check_client_CA_list returns one if |names| is a good list of X.509 - // distinguished names and zero otherwise. This is used to ensure that we can - // reject unparsable values at handshake time when using crypto/x509. - int (*check_client_CA_list)(STACK_OF(CRYPTO_BUFFER) *names); - - // cert_clear frees and NULLs all X509 certificate-related state. - void (*cert_clear)(bssl::CERT *cert); - // cert_free frees all X509-related state. - void (*cert_free)(bssl::CERT *cert); - // cert_flush_cached_chain drops any cached |X509|-based certificate chain - // from |cert|. - // cert_dup duplicates any needed fields from |cert| to |new_cert|. - void (*cert_dup)(bssl::CERT *new_cert, const bssl::CERT *cert); - void (*cert_flush_cached_chain)(bssl::CERT *cert); - // cert_flush_cached_chain drops any cached |X509|-based leaf certificate - // from |cert|. - void (*cert_flush_cached_leaf)(bssl::CERT *cert); - - // session_cache_objects fills out |sess->x509_peer| and |sess->x509_chain| - // from |sess->certs| and erases |sess->x509_chain_without_leaf|. It returns - // one on success or zero on error. - int (*session_cache_objects)(SSL_SESSION *session); - // session_dup duplicates any needed fields from |session| to |new_session|. - // It returns one on success or zero on error. - int (*session_dup)(SSL_SESSION *new_session, const SSL_SESSION *session); - // session_clear frees any X509-related state from |session|. - void (*session_clear)(SSL_SESSION *session); - // session_verify_cert_chain verifies the certificate chain in |session|, - // sets |session->verify_result| and returns one on success or zero on - // error. - int (*session_verify_cert_chain)(SSL_SESSION *session, SSL *ssl, - uint8_t *out_alert); - - // hs_flush_cached_ca_names drops any cached |X509_NAME|s from |hs|. - void (*hs_flush_cached_ca_names)(bssl::SSL_HANDSHAKE *hs); - // ssl_new does any neccessary initialisation of |ssl|. It returns one on - // success or zero on error. - int (*ssl_new)(SSL *ssl); - // ssl_free frees anything created by |ssl_new|. - void (*ssl_free)(SSL *ssl); - // ssl_flush_cached_client_CA drops any cached |X509_NAME|s from |ssl|. - void (*ssl_flush_cached_client_CA)(SSL *ssl); - // ssl_auto_chain_if_needed runs the deprecated auto-chaining logic if - // necessary. On success, it updates |ssl|'s certificate configuration as - // needed and returns one. Otherwise, it returns zero. - int (*ssl_auto_chain_if_needed)(SSL *ssl); - // ssl_ctx_new does any neccessary initialisation of |ctx|. It returns one on - // success or zero on error. - int (*ssl_ctx_new)(SSL_CTX *ctx); - // ssl_ctx_free frees anything created by |ssl_ctx_new|. - void (*ssl_ctx_free)(SSL_CTX *ctx); - // ssl_ctx_flush_cached_client_CA drops any cached |X509_NAME|s from |ctx|. - void (*ssl_ctx_flush_cached_client_CA)(SSL_CTX *ssl); -}; - -// The following types back public C-exposed types which must live in the global -// namespace. We use subclassing so the implementations may be C++ types with -// methods and destructor without polluting the global namespace. -struct ssl_ctx_st : public bssl::SSLContext {}; -struct ssl_st : public bssl::SSLConnection {}; - - -#endif // OPENSSL_HEADER_SSL_INTERNAL_H diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_cert.cc b/Pods/BoringSSL-GRPC/ssl/ssl_cert.cc deleted file mode 100644 index a0862d9f5..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_cert.cc +++ /dev/null @@ -1,913 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ - -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -CERT *ssl_cert_new(const SSL_X509_METHOD *x509_method) { - CERT *ret = (CERT *)OPENSSL_malloc(sizeof(CERT)); - if (ret == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return NULL; - } - OPENSSL_memset(ret, 0, sizeof(CERT)); - ret->x509_method = x509_method; - - return ret; -} - -static CRYPTO_BUFFER *buffer_up_ref(CRYPTO_BUFFER *buffer) { - CRYPTO_BUFFER_up_ref(buffer); - return buffer; -} - -CERT *ssl_cert_dup(CERT *cert) { - CERT *ret = (CERT *)OPENSSL_malloc(sizeof(CERT)); - if (ret == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return NULL; - } - OPENSSL_memset(ret, 0, sizeof(CERT)); - - ret->chain = sk_CRYPTO_BUFFER_deep_copy(cert->chain, buffer_up_ref, - CRYPTO_BUFFER_free); - - if (cert->privatekey != NULL) { - EVP_PKEY_up_ref(cert->privatekey); - ret->privatekey = cert->privatekey; - } - - ret->key_method = cert->key_method; - ret->x509_method = cert->x509_method; - - if (cert->sigalgs != NULL) { - ret->sigalgs = (uint16_t *)BUF_memdup( - cert->sigalgs, cert->num_sigalgs * sizeof(cert->sigalgs[0])); - if (ret->sigalgs == NULL) { - goto err; - } - } - ret->num_sigalgs = cert->num_sigalgs; - - ret->cert_cb = cert->cert_cb; - ret->cert_cb_arg = cert->cert_cb_arg; - - ret->x509_method->cert_dup(ret, cert); - - if (cert->signed_cert_timestamp_list != NULL) { - CRYPTO_BUFFER_up_ref(cert->signed_cert_timestamp_list); - ret->signed_cert_timestamp_list = cert->signed_cert_timestamp_list; - } - - if (cert->ocsp_response != NULL) { - CRYPTO_BUFFER_up_ref(cert->ocsp_response); - ret->ocsp_response = cert->ocsp_response; - } - - ret->sid_ctx_length = cert->sid_ctx_length; - OPENSSL_memcpy(ret->sid_ctx, cert->sid_ctx, sizeof(ret->sid_ctx)); - - ret->enable_early_data = cert->enable_early_data; - - return ret; - -err: - ssl_cert_free(ret); - return NULL; -} - -// Free up and clear all certificates and chains -void ssl_cert_clear_certs(CERT *cert) { - if (cert == NULL) { - return; - } - - cert->x509_method->cert_clear(cert); - - sk_CRYPTO_BUFFER_pop_free(cert->chain, CRYPTO_BUFFER_free); - cert->chain = NULL; - EVP_PKEY_free(cert->privatekey); - cert->privatekey = NULL; - cert->key_method = NULL; -} - -void ssl_cert_free(CERT *cert) { - if (cert == NULL) { - return; - } - - ssl_cert_clear_certs(cert); - cert->x509_method->cert_free(cert); - OPENSSL_free(cert->sigalgs); - CRYPTO_BUFFER_free(cert->signed_cert_timestamp_list); - CRYPTO_BUFFER_free(cert->ocsp_response); - - OPENSSL_free(cert); -} - -static void ssl_cert_set_cert_cb(CERT *cert, int (*cb)(SSL *ssl, void *arg), - void *arg) { - cert->cert_cb = cb; - cert->cert_cb_arg = arg; -} - -enum leaf_cert_and_privkey_result_t { - leaf_cert_and_privkey_error, - leaf_cert_and_privkey_ok, - leaf_cert_and_privkey_mismatch, -}; - -// check_leaf_cert_and_privkey checks whether the certificate in |leaf_buffer| -// and the private key in |privkey| are suitable and coherent. It returns -// |leaf_cert_and_privkey_error| and pushes to the error queue if a problem is -// found. If the certificate and private key are valid, but incoherent, it -// returns |leaf_cert_and_privkey_mismatch|. Otherwise it returns -// |leaf_cert_and_privkey_ok|. -static enum leaf_cert_and_privkey_result_t check_leaf_cert_and_privkey( - CRYPTO_BUFFER *leaf_buffer, EVP_PKEY *privkey) { - CBS cert_cbs; - CRYPTO_BUFFER_init_CBS(leaf_buffer, &cert_cbs); - UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); - if (!pubkey) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return leaf_cert_and_privkey_error; - } - - if (!ssl_is_key_type_supported(pubkey->type)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); - return leaf_cert_and_privkey_error; - } - - // An ECC certificate may be usable for ECDH or ECDSA. We only support ECDSA - // certificates, so sanity-check the key usage extension. - if (pubkey->type == EVP_PKEY_EC && - !ssl_cert_check_digital_signature_key_usage(&cert_cbs)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); - return leaf_cert_and_privkey_error; - } - - if (privkey != NULL && - // Sanity-check that the private key and the certificate match. - !ssl_compare_public_and_private_key(pubkey.get(), privkey)) { - ERR_clear_error(); - return leaf_cert_and_privkey_mismatch; - } - - return leaf_cert_and_privkey_ok; -} - -static int cert_set_chain_and_key( - CERT *cert, CRYPTO_BUFFER *const *certs, size_t num_certs, - EVP_PKEY *privkey, const SSL_PRIVATE_KEY_METHOD *privkey_method) { - if (num_certs == 0 || - (privkey == NULL && privkey_method == NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - if (privkey != NULL && privkey_method != NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD); - return 0; - } - - switch (check_leaf_cert_and_privkey(certs[0], privkey)) { - case leaf_cert_and_privkey_error: - return 0; - case leaf_cert_and_privkey_mismatch: - OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH); - return 0; - case leaf_cert_and_privkey_ok: - break; - } - - STACK_OF(CRYPTO_BUFFER) *certs_sk = sk_CRYPTO_BUFFER_new_null(); - if (certs_sk == NULL) { - return 0; - } - - for (size_t i = 0; i < num_certs; i++) { - if (!sk_CRYPTO_BUFFER_push(certs_sk, certs[i])) { - sk_CRYPTO_BUFFER_pop_free(certs_sk, CRYPTO_BUFFER_free); - return 0; - } - CRYPTO_BUFFER_up_ref(certs[i]); - } - - EVP_PKEY_free(cert->privatekey); - cert->privatekey = privkey; - if (privkey != NULL) { - EVP_PKEY_up_ref(privkey); - } - cert->key_method = privkey_method; - - sk_CRYPTO_BUFFER_pop_free(cert->chain, CRYPTO_BUFFER_free); - cert->chain = certs_sk; - - return 1; -} - -int ssl_set_cert(CERT *cert, UniquePtr buffer) { - switch (check_leaf_cert_and_privkey(buffer.get(), cert->privatekey)) { - case leaf_cert_and_privkey_error: - return 0; - case leaf_cert_and_privkey_mismatch: - // don't fail for a cert/key mismatch, just free current private key - // (when switching to a different cert & key, first this function should - // be used, then |ssl_set_pkey|. - EVP_PKEY_free(cert->privatekey); - cert->privatekey = NULL; - break; - case leaf_cert_and_privkey_ok: - break; - } - - cert->x509_method->cert_flush_cached_leaf(cert); - - if (cert->chain != NULL) { - CRYPTO_BUFFER_free(sk_CRYPTO_BUFFER_value(cert->chain, 0)); - sk_CRYPTO_BUFFER_set(cert->chain, 0, buffer.release()); - return 1; - } - - cert->chain = sk_CRYPTO_BUFFER_new_null(); - if (cert->chain == NULL) { - return 0; - } - - if (!PushToStack(cert->chain, std::move(buffer))) { - sk_CRYPTO_BUFFER_free(cert->chain); - cert->chain = NULL; - return 0; - } - - return 1; -} - -int ssl_has_certificate(const SSL *ssl) { - return ssl->cert->chain != NULL && - sk_CRYPTO_BUFFER_value(ssl->cert->chain, 0) != NULL && - ssl_has_private_key(ssl); -} - -bool ssl_parse_cert_chain(uint8_t *out_alert, - UniquePtr *out_chain, - UniquePtr *out_pubkey, - uint8_t *out_leaf_sha256, CBS *cbs, - CRYPTO_BUFFER_POOL *pool) { - out_chain->reset(); - out_pubkey->reset(); - - CBS certificate_list; - if (!CBS_get_u24_length_prefixed(cbs, &certificate_list)) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return false; - } - - if (CBS_len(&certificate_list) == 0) { - return true; - } - - UniquePtr chain(sk_CRYPTO_BUFFER_new_null()); - if (!chain) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - UniquePtr pubkey; - while (CBS_len(&certificate_list) > 0) { - CBS certificate; - if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || - CBS_len(&certificate) == 0) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); - return false; - } - - if (sk_CRYPTO_BUFFER_num(chain.get()) == 0) { - pubkey = ssl_cert_parse_pubkey(&certificate); - if (!pubkey) { - *out_alert = SSL_AD_DECODE_ERROR; - return false; - } - - // Retain the hash of the leaf certificate if requested. - if (out_leaf_sha256 != NULL) { - SHA256(CBS_data(&certificate), CBS_len(&certificate), out_leaf_sha256); - } - } - - UniquePtr buf( - CRYPTO_BUFFER_new_from_CBS(&certificate, pool)); - if (!buf || - !PushToStack(chain.get(), std::move(buf))) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - } - - *out_chain = std::move(chain); - *out_pubkey = std::move(pubkey); - return true; -} - -int ssl_add_cert_chain(SSL *ssl, CBB *cbb) { - if (!ssl_has_certificate(ssl)) { - return CBB_add_u24(cbb, 0); - } - - CBB certs; - if (!CBB_add_u24_length_prefixed(cbb, &certs)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - STACK_OF(CRYPTO_BUFFER) *chain = ssl->cert->chain; - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(chain); i++) { - CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(chain, i); - CBB child; - if (!CBB_add_u24_length_prefixed(&certs, &child) || - !CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), - CRYPTO_BUFFER_len(buffer)) || - !CBB_flush(&certs)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - return CBB_flush(cbb); -} - -// ssl_cert_skip_to_spki parses a DER-encoded, X.509 certificate from |in| and -// positions |*out_tbs_cert| to cover the TBSCertificate, starting at the -// subjectPublicKeyInfo. -static int ssl_cert_skip_to_spki(const CBS *in, CBS *out_tbs_cert) { - /* From RFC 5280, section 4.1 - * Certificate ::= SEQUENCE { - * tbsCertificate TBSCertificate, - * signatureAlgorithm AlgorithmIdentifier, - * signatureValue BIT STRING } - - * TBSCertificate ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * serialNumber CertificateSerialNumber, - * signature AlgorithmIdentifier, - * issuer Name, - * validity Validity, - * subject Name, - * subjectPublicKeyInfo SubjectPublicKeyInfo, - * ... } */ - CBS buf = *in; - - CBS toplevel; - if (!CBS_get_asn1(&buf, &toplevel, CBS_ASN1_SEQUENCE) || - CBS_len(&buf) != 0 || - !CBS_get_asn1(&toplevel, out_tbs_cert, CBS_ASN1_SEQUENCE) || - // version - !CBS_get_optional_asn1( - out_tbs_cert, NULL, NULL, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || - // serialNumber - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_INTEGER) || - // signature algorithm - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // issuer - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // validity - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // subject - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE)) { - return 0; - } - - return 1; -} - -UniquePtr ssl_cert_parse_pubkey(const CBS *in) { - CBS buf = *in, tbs_cert; - if (!ssl_cert_skip_to_spki(&buf, &tbs_cert)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return nullptr; - } - - return UniquePtr(EVP_parse_public_key(&tbs_cert)); -} - -int ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, - const EVP_PKEY *privkey) { - if (EVP_PKEY_is_opaque(privkey)) { - // We cannot check an opaque private key and have to trust that it - // matches. - return 1; - } - - int ret = 0; - - switch (EVP_PKEY_cmp(pubkey, privkey)) { - case 1: - ret = 1; - break; - case 0: - OPENSSL_PUT_ERROR(X509, X509_R_KEY_VALUES_MISMATCH); - break; - case -1: - OPENSSL_PUT_ERROR(X509, X509_R_KEY_TYPE_MISMATCH); - break; - case -2: - OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); - break; - default: - assert(0); - break; - } - - return ret; -} - -int ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey) { - if (privkey == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED); - return 0; - } - - if (cert->chain == NULL || - sk_CRYPTO_BUFFER_value(cert->chain, 0) == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_ASSIGNED); - return 0; - } - - CBS cert_cbs; - CRYPTO_BUFFER_init_CBS(sk_CRYPTO_BUFFER_value(cert->chain, 0), &cert_cbs); - UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); - if (!pubkey) { - OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); - return 0; - } - - return ssl_compare_public_and_private_key(pubkey.get(), privkey); -} - -int ssl_cert_check_digital_signature_key_usage(const CBS *in) { - CBS buf = *in; - - CBS tbs_cert, outer_extensions; - int has_extensions; - if (!ssl_cert_skip_to_spki(&buf, &tbs_cert) || - // subjectPublicKeyInfo - !CBS_get_asn1(&tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // issuerUniqueID - !CBS_get_optional_asn1( - &tbs_cert, NULL, NULL, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1) || - // subjectUniqueID - !CBS_get_optional_asn1( - &tbs_cert, NULL, NULL, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2) || - !CBS_get_optional_asn1( - &tbs_cert, &outer_extensions, &has_extensions, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - if (!has_extensions) { - return 1; - } - - CBS extensions; - if (!CBS_get_asn1(&outer_extensions, &extensions, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - while (CBS_len(&extensions) > 0) { - CBS extension, oid, contents; - if (!CBS_get_asn1(&extensions, &extension, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&extension, &oid, CBS_ASN1_OBJECT) || - (CBS_peek_asn1_tag(&extension, CBS_ASN1_BOOLEAN) && - !CBS_get_asn1(&extension, NULL, CBS_ASN1_BOOLEAN)) || - !CBS_get_asn1(&extension, &contents, CBS_ASN1_OCTETSTRING) || - CBS_len(&extension) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - static const uint8_t kKeyUsageOID[3] = {0x55, 0x1d, 0x0f}; - if (CBS_len(&oid) != sizeof(kKeyUsageOID) || - OPENSSL_memcmp(CBS_data(&oid), kKeyUsageOID, sizeof(kKeyUsageOID)) != - 0) { - continue; - } - - CBS bit_string; - if (!CBS_get_asn1(&contents, &bit_string, CBS_ASN1_BITSTRING) || - CBS_len(&contents) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - // This is the KeyUsage extension. See - // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - if (!CBS_is_valid_asn1_bitstring(&bit_string)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - if (!CBS_asn1_bitstring_has_bit(&bit_string, 0)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING); - return 0; - } - - return 1; - } - - // No KeyUsage extension found. - return 1; -} - -UniquePtr ssl_parse_client_CA_list(SSL *ssl, - uint8_t *out_alert, - CBS *cbs) { - CRYPTO_BUFFER_POOL *const pool = ssl->ctx->pool; - - UniquePtr ret(sk_CRYPTO_BUFFER_new_null()); - if (!ret) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return nullptr; - } - - CBS child; - if (!CBS_get_u16_length_prefixed(cbs, &child)) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_LENGTH_MISMATCH); - return nullptr; - } - - while (CBS_len(&child) > 0) { - CBS distinguished_name; - if (!CBS_get_u16_length_prefixed(&child, &distinguished_name)) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_CA_DN_TOO_LONG); - return nullptr; - } - - UniquePtr buffer( - CRYPTO_BUFFER_new_from_CBS(&distinguished_name, pool)); - if (!buffer || - !PushToStack(ret.get(), std::move(buffer))) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return nullptr; - } - } - - if (!ssl->ctx->x509_method->check_client_CA_list(ret.get())) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return nullptr; - } - - return ret; -} - -bool ssl_has_client_CAs(SSL *ssl) { - STACK_OF(CRYPTO_BUFFER) *names = ssl->client_CA; - if (names == NULL) { - names = ssl->ctx->client_CA; - } - if (names == NULL) { - return false; - } - return sk_CRYPTO_BUFFER_num(names) > 0; -} - -int ssl_add_client_CA_list(SSL *ssl, CBB *cbb) { - CBB child, name_cbb; - if (!CBB_add_u16_length_prefixed(cbb, &child)) { - return 0; - } - - STACK_OF(CRYPTO_BUFFER) *names = ssl->client_CA; - if (names == NULL) { - names = ssl->ctx->client_CA; - } - if (names == NULL) { - return CBB_flush(cbb); - } - - for (const CRYPTO_BUFFER *name : names) { - if (!CBB_add_u16_length_prefixed(&child, &name_cbb) || - !CBB_add_bytes(&name_cbb, CRYPTO_BUFFER_data(name), - CRYPTO_BUFFER_len(name))) { - return 0; - } - } - - return CBB_flush(cbb); -} - -int ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, - const CRYPTO_BUFFER *leaf) { - SSL *const ssl = hs->ssl; - assert(ssl_protocol_version(ssl) < TLS1_3_VERSION); - - // Check the certificate's type matches the cipher. - if (!(hs->new_cipher->algorithm_auth & ssl_cipher_auth_mask_for_key(pkey))) { - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CERTIFICATE_TYPE); - return 0; - } - - // Check key usages for all key types but RSA. This is needed to distinguish - // ECDH certificates, which we do not support, from ECDSA certificates. In - // principle, we should check RSA key usages based on cipher, but this breaks - // buggy antivirus deployments. Other key types are always used for signing. - // - // TODO(davidben): Get more recent data on RSA key usages. - if (EVP_PKEY_id(pkey) != EVP_PKEY_RSA) { - CBS leaf_cbs; - CBS_init(&leaf_cbs, CRYPTO_BUFFER_data(leaf), CRYPTO_BUFFER_len(leaf)); - if (!ssl_cert_check_digital_signature_key_usage(&leaf_cbs)) { - return 0; - } - } - - if (EVP_PKEY_id(pkey) == EVP_PKEY_EC) { - // Check the key's group and point format are acceptable. - EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(pkey); - uint16_t group_id; - if (!ssl_nid_to_group_id( - &group_id, EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key))) || - !tls1_check_group_id(ssl, group_id) || - EC_KEY_get_conv_form(ec_key) != POINT_CONVERSION_UNCOMPRESSED) { - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECC_CERT); - return 0; - } - } - - return 1; -} - -int ssl_on_certificate_selected(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!ssl_has_certificate(ssl)) { - // Nothing to do. - return 1; - } - - if (!ssl->ctx->x509_method->ssl_auto_chain_if_needed(ssl)) { - return 0; - } - - CBS leaf; - CRYPTO_BUFFER_init_CBS(sk_CRYPTO_BUFFER_value(ssl->cert->chain, 0), &leaf); - - hs->local_pubkey = ssl_cert_parse_pubkey(&leaf); - return hs->local_pubkey != NULL; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_set_chain_and_key(SSL *ssl, CRYPTO_BUFFER *const *certs, - size_t num_certs, EVP_PKEY *privkey, - const SSL_PRIVATE_KEY_METHOD *privkey_method) { - return cert_set_chain_and_key(ssl->cert, certs, num_certs, privkey, - privkey_method); -} - -int SSL_CTX_set_chain_and_key(SSL_CTX *ctx, CRYPTO_BUFFER *const *certs, - size_t num_certs, EVP_PKEY *privkey, - const SSL_PRIVATE_KEY_METHOD *privkey_method) { - return cert_set_chain_and_key(ctx->cert, certs, num_certs, privkey, - privkey_method); -} - -int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, - const uint8_t *der) { - UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); - if (!buffer) { - return 0; - } - - return ssl_set_cert(ctx->cert, std::move(buffer)); -} - -int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { - UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); - if (!buffer) { - return 0; - } - - return ssl_set_cert(ssl->cert, std::move(buffer)); -} - -void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), - void *arg) { - ssl_cert_set_cert_cb(ctx->cert, cb, arg); -} - -void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg) { - ssl_cert_set_cert_cb(ssl->cert, cb, arg); -} - -STACK_OF(CRYPTO_BUFFER) *SSL_get0_peer_certificates(const SSL *ssl) { - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return NULL; - } - - return session->certs; -} - -STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs(const SSL *ssl) { - if (ssl->s3->hs == NULL) { - return NULL; - } - return ssl->s3->hs->ca_names.get(); -} - -static int set_signed_cert_timestamp_list(CERT *cert, const uint8_t *list, - size_t list_len) { - CBS sct_list; - CBS_init(&sct_list, list, list_len); - if (!ssl_is_sct_list_valid(&sct_list)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SCT_LIST); - return 0; - } - - CRYPTO_BUFFER_free(cert->signed_cert_timestamp_list); - cert->signed_cert_timestamp_list = - CRYPTO_BUFFER_new(CBS_data(&sct_list), CBS_len(&sct_list), NULL); - return cert->signed_cert_timestamp_list != NULL; -} - -int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, const uint8_t *list, - size_t list_len) { - return set_signed_cert_timestamp_list(ctx->cert, list, list_len); -} - -int SSL_set_signed_cert_timestamp_list(SSL *ssl, const uint8_t *list, - size_t list_len) { - return set_signed_cert_timestamp_list(ssl->cert, list, list_len); -} - -int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, const uint8_t *response, - size_t response_len) { - CRYPTO_BUFFER_free(ctx->cert->ocsp_response); - ctx->cert->ocsp_response = CRYPTO_BUFFER_new(response, response_len, NULL); - return ctx->cert->ocsp_response != NULL; -} - -int SSL_set_ocsp_response(SSL *ssl, const uint8_t *response, - size_t response_len) { - CRYPTO_BUFFER_free(ssl->cert->ocsp_response); - ssl->cert->ocsp_response = CRYPTO_BUFFER_new(response, response_len, NULL); - return ssl->cert->ocsp_response != NULL; -} - -void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, STACK_OF(CRYPTO_BUFFER) *name_list) { - ctx->x509_method->ssl_ctx_flush_cached_client_CA(ctx); - sk_CRYPTO_BUFFER_pop_free(ctx->client_CA, CRYPTO_BUFFER_free); - ctx->client_CA = name_list; -} - -void SSL_set0_client_CAs(SSL *ssl, STACK_OF(CRYPTO_BUFFER) *name_list) { - ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl); - sk_CRYPTO_BUFFER_pop_free(ssl->client_CA, CRYPTO_BUFFER_free); - ssl->client_CA = name_list; -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_cert.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/ssl_cert.cc.grpc_back deleted file mode 100644 index 9a3eef35b..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_cert.cc.grpc_back +++ /dev/null @@ -1,913 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ - -#include - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -CERT *ssl_cert_new(const SSL_X509_METHOD *x509_method) { - CERT *ret = (CERT *)OPENSSL_malloc(sizeof(CERT)); - if (ret == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return NULL; - } - OPENSSL_memset(ret, 0, sizeof(CERT)); - ret->x509_method = x509_method; - - return ret; -} - -static CRYPTO_BUFFER *buffer_up_ref(CRYPTO_BUFFER *buffer) { - CRYPTO_BUFFER_up_ref(buffer); - return buffer; -} - -CERT *ssl_cert_dup(CERT *cert) { - CERT *ret = (CERT *)OPENSSL_malloc(sizeof(CERT)); - if (ret == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return NULL; - } - OPENSSL_memset(ret, 0, sizeof(CERT)); - - ret->chain = sk_CRYPTO_BUFFER_deep_copy(cert->chain, buffer_up_ref, - CRYPTO_BUFFER_free); - - if (cert->privatekey != NULL) { - EVP_PKEY_up_ref(cert->privatekey); - ret->privatekey = cert->privatekey; - } - - ret->key_method = cert->key_method; - ret->x509_method = cert->x509_method; - - if (cert->sigalgs != NULL) { - ret->sigalgs = (uint16_t *)BUF_memdup( - cert->sigalgs, cert->num_sigalgs * sizeof(cert->sigalgs[0])); - if (ret->sigalgs == NULL) { - goto err; - } - } - ret->num_sigalgs = cert->num_sigalgs; - - ret->cert_cb = cert->cert_cb; - ret->cert_cb_arg = cert->cert_cb_arg; - - ret->x509_method->cert_dup(ret, cert); - - if (cert->signed_cert_timestamp_list != NULL) { - CRYPTO_BUFFER_up_ref(cert->signed_cert_timestamp_list); - ret->signed_cert_timestamp_list = cert->signed_cert_timestamp_list; - } - - if (cert->ocsp_response != NULL) { - CRYPTO_BUFFER_up_ref(cert->ocsp_response); - ret->ocsp_response = cert->ocsp_response; - } - - ret->sid_ctx_length = cert->sid_ctx_length; - OPENSSL_memcpy(ret->sid_ctx, cert->sid_ctx, sizeof(ret->sid_ctx)); - - ret->enable_early_data = cert->enable_early_data; - - return ret; - -err: - ssl_cert_free(ret); - return NULL; -} - -// Free up and clear all certificates and chains -void ssl_cert_clear_certs(CERT *cert) { - if (cert == NULL) { - return; - } - - cert->x509_method->cert_clear(cert); - - sk_CRYPTO_BUFFER_pop_free(cert->chain, CRYPTO_BUFFER_free); - cert->chain = NULL; - EVP_PKEY_free(cert->privatekey); - cert->privatekey = NULL; - cert->key_method = NULL; -} - -void ssl_cert_free(CERT *cert) { - if (cert == NULL) { - return; - } - - ssl_cert_clear_certs(cert); - cert->x509_method->cert_free(cert); - OPENSSL_free(cert->sigalgs); - CRYPTO_BUFFER_free(cert->signed_cert_timestamp_list); - CRYPTO_BUFFER_free(cert->ocsp_response); - - OPENSSL_free(cert); -} - -static void ssl_cert_set_cert_cb(CERT *cert, int (*cb)(SSL *ssl, void *arg), - void *arg) { - cert->cert_cb = cb; - cert->cert_cb_arg = arg; -} - -enum leaf_cert_and_privkey_result_t { - leaf_cert_and_privkey_error, - leaf_cert_and_privkey_ok, - leaf_cert_and_privkey_mismatch, -}; - -// check_leaf_cert_and_privkey checks whether the certificate in |leaf_buffer| -// and the private key in |privkey| are suitable and coherent. It returns -// |leaf_cert_and_privkey_error| and pushes to the error queue if a problem is -// found. If the certificate and private key are valid, but incoherent, it -// returns |leaf_cert_and_privkey_mismatch|. Otherwise it returns -// |leaf_cert_and_privkey_ok|. -static enum leaf_cert_and_privkey_result_t check_leaf_cert_and_privkey( - CRYPTO_BUFFER *leaf_buffer, EVP_PKEY *privkey) { - CBS cert_cbs; - CRYPTO_BUFFER_init_CBS(leaf_buffer, &cert_cbs); - UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); - if (!pubkey) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return leaf_cert_and_privkey_error; - } - - if (!ssl_is_key_type_supported(pubkey->type)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); - return leaf_cert_and_privkey_error; - } - - // An ECC certificate may be usable for ECDH or ECDSA. We only support ECDSA - // certificates, so sanity-check the key usage extension. - if (pubkey->type == EVP_PKEY_EC && - !ssl_cert_check_digital_signature_key_usage(&cert_cbs)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); - return leaf_cert_and_privkey_error; - } - - if (privkey != NULL && - // Sanity-check that the private key and the certificate match. - !ssl_compare_public_and_private_key(pubkey.get(), privkey)) { - ERR_clear_error(); - return leaf_cert_and_privkey_mismatch; - } - - return leaf_cert_and_privkey_ok; -} - -static int cert_set_chain_and_key( - CERT *cert, CRYPTO_BUFFER *const *certs, size_t num_certs, - EVP_PKEY *privkey, const SSL_PRIVATE_KEY_METHOD *privkey_method) { - if (num_certs == 0 || - (privkey == NULL && privkey_method == NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - if (privkey != NULL && privkey_method != NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_HAVE_BOTH_PRIVKEY_AND_METHOD); - return 0; - } - - switch (check_leaf_cert_and_privkey(certs[0], privkey)) { - case leaf_cert_and_privkey_error: - return 0; - case leaf_cert_and_privkey_mismatch: - OPENSSL_PUT_ERROR(SSL, SSL_R_CERTIFICATE_AND_PRIVATE_KEY_MISMATCH); - return 0; - case leaf_cert_and_privkey_ok: - break; - } - - STACK_OF(CRYPTO_BUFFER) *certs_sk = sk_CRYPTO_BUFFER_new_null(); - if (certs_sk == NULL) { - return 0; - } - - for (size_t i = 0; i < num_certs; i++) { - if (!sk_CRYPTO_BUFFER_push(certs_sk, certs[i])) { - sk_CRYPTO_BUFFER_pop_free(certs_sk, CRYPTO_BUFFER_free); - return 0; - } - CRYPTO_BUFFER_up_ref(certs[i]); - } - - EVP_PKEY_free(cert->privatekey); - cert->privatekey = privkey; - if (privkey != NULL) { - EVP_PKEY_up_ref(privkey); - } - cert->key_method = privkey_method; - - sk_CRYPTO_BUFFER_pop_free(cert->chain, CRYPTO_BUFFER_free); - cert->chain = certs_sk; - - return 1; -} - -int ssl_set_cert(CERT *cert, UniquePtr buffer) { - switch (check_leaf_cert_and_privkey(buffer.get(), cert->privatekey)) { - case leaf_cert_and_privkey_error: - return 0; - case leaf_cert_and_privkey_mismatch: - // don't fail for a cert/key mismatch, just free current private key - // (when switching to a different cert & key, first this function should - // be used, then |ssl_set_pkey|. - EVP_PKEY_free(cert->privatekey); - cert->privatekey = NULL; - break; - case leaf_cert_and_privkey_ok: - break; - } - - cert->x509_method->cert_flush_cached_leaf(cert); - - if (cert->chain != NULL) { - CRYPTO_BUFFER_free(sk_CRYPTO_BUFFER_value(cert->chain, 0)); - sk_CRYPTO_BUFFER_set(cert->chain, 0, buffer.release()); - return 1; - } - - cert->chain = sk_CRYPTO_BUFFER_new_null(); - if (cert->chain == NULL) { - return 0; - } - - if (!PushToStack(cert->chain, std::move(buffer))) { - sk_CRYPTO_BUFFER_free(cert->chain); - cert->chain = NULL; - return 0; - } - - return 1; -} - -int ssl_has_certificate(const SSL *ssl) { - return ssl->cert->chain != NULL && - sk_CRYPTO_BUFFER_value(ssl->cert->chain, 0) != NULL && - ssl_has_private_key(ssl); -} - -bool ssl_parse_cert_chain(uint8_t *out_alert, - UniquePtr *out_chain, - UniquePtr *out_pubkey, - uint8_t *out_leaf_sha256, CBS *cbs, - CRYPTO_BUFFER_POOL *pool) { - out_chain->reset(); - out_pubkey->reset(); - - CBS certificate_list; - if (!CBS_get_u24_length_prefixed(cbs, &certificate_list)) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return false; - } - - if (CBS_len(&certificate_list) == 0) { - return true; - } - - UniquePtr chain(sk_CRYPTO_BUFFER_new_null()); - if (!chain) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - UniquePtr pubkey; - while (CBS_len(&certificate_list) > 0) { - CBS certificate; - if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || - CBS_len(&certificate) == 0) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); - return false; - } - - if (sk_CRYPTO_BUFFER_num(chain.get()) == 0) { - pubkey = ssl_cert_parse_pubkey(&certificate); - if (!pubkey) { - *out_alert = SSL_AD_DECODE_ERROR; - return false; - } - - // Retain the hash of the leaf certificate if requested. - if (out_leaf_sha256 != NULL) { - SHA256(CBS_data(&certificate), CBS_len(&certificate), out_leaf_sha256); - } - } - - UniquePtr buf( - CRYPTO_BUFFER_new_from_CBS(&certificate, pool)); - if (!buf || - !PushToStack(chain.get(), std::move(buf))) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - } - - *out_chain = std::move(chain); - *out_pubkey = std::move(pubkey); - return true; -} - -int ssl_add_cert_chain(SSL *ssl, CBB *cbb) { - if (!ssl_has_certificate(ssl)) { - return CBB_add_u24(cbb, 0); - } - - CBB certs; - if (!CBB_add_u24_length_prefixed(cbb, &certs)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - STACK_OF(CRYPTO_BUFFER) *chain = ssl->cert->chain; - for (size_t i = 0; i < sk_CRYPTO_BUFFER_num(chain); i++) { - CRYPTO_BUFFER *buffer = sk_CRYPTO_BUFFER_value(chain, i); - CBB child; - if (!CBB_add_u24_length_prefixed(&certs, &child) || - !CBB_add_bytes(&child, CRYPTO_BUFFER_data(buffer), - CRYPTO_BUFFER_len(buffer)) || - !CBB_flush(&certs)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - return CBB_flush(cbb); -} - -// ssl_cert_skip_to_spki parses a DER-encoded, X.509 certificate from |in| and -// positions |*out_tbs_cert| to cover the TBSCertificate, starting at the -// subjectPublicKeyInfo. -static int ssl_cert_skip_to_spki(const CBS *in, CBS *out_tbs_cert) { - /* From RFC 5280, section 4.1 - * Certificate ::= SEQUENCE { - * tbsCertificate TBSCertificate, - * signatureAlgorithm AlgorithmIdentifier, - * signatureValue BIT STRING } - - * TBSCertificate ::= SEQUENCE { - * version [0] EXPLICIT Version DEFAULT v1, - * serialNumber CertificateSerialNumber, - * signature AlgorithmIdentifier, - * issuer Name, - * validity Validity, - * subject Name, - * subjectPublicKeyInfo SubjectPublicKeyInfo, - * ... } */ - CBS buf = *in; - - CBS toplevel; - if (!CBS_get_asn1(&buf, &toplevel, CBS_ASN1_SEQUENCE) || - CBS_len(&buf) != 0 || - !CBS_get_asn1(&toplevel, out_tbs_cert, CBS_ASN1_SEQUENCE) || - // version - !CBS_get_optional_asn1( - out_tbs_cert, NULL, NULL, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 0) || - // serialNumber - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_INTEGER) || - // signature algorithm - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // issuer - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // validity - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // subject - !CBS_get_asn1(out_tbs_cert, NULL, CBS_ASN1_SEQUENCE)) { - return 0; - } - - return 1; -} - -UniquePtr ssl_cert_parse_pubkey(const CBS *in) { - CBS buf = *in, tbs_cert; - if (!ssl_cert_skip_to_spki(&buf, &tbs_cert)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return nullptr; - } - - return UniquePtr(EVP_parse_public_key(&tbs_cert)); -} - -int ssl_compare_public_and_private_key(const EVP_PKEY *pubkey, - const EVP_PKEY *privkey) { - if (EVP_PKEY_is_opaque(privkey)) { - // We cannot check an opaque private key and have to trust that it - // matches. - return 1; - } - - int ret = 0; - - switch (EVP_PKEY_cmp(pubkey, privkey)) { - case 1: - ret = 1; - break; - case 0: - OPENSSL_PUT_ERROR(X509, X509_R_KEY_VALUES_MISMATCH); - break; - case -1: - OPENSSL_PUT_ERROR(X509, X509_R_KEY_TYPE_MISMATCH); - break; - case -2: - OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); - break; - default: - assert(0); - break; - } - - return ret; -} - -int ssl_cert_check_private_key(const CERT *cert, const EVP_PKEY *privkey) { - if (privkey == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_PRIVATE_KEY_ASSIGNED); - return 0; - } - - if (cert->chain == NULL || - sk_CRYPTO_BUFFER_value(cert->chain, 0) == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_ASSIGNED); - return 0; - } - - CBS cert_cbs; - CRYPTO_BUFFER_init_CBS(sk_CRYPTO_BUFFER_value(cert->chain, 0), &cert_cbs); - UniquePtr pubkey = ssl_cert_parse_pubkey(&cert_cbs); - if (!pubkey) { - OPENSSL_PUT_ERROR(X509, X509_R_UNKNOWN_KEY_TYPE); - return 0; - } - - return ssl_compare_public_and_private_key(pubkey.get(), privkey); -} - -int ssl_cert_check_digital_signature_key_usage(const CBS *in) { - CBS buf = *in; - - CBS tbs_cert, outer_extensions; - int has_extensions; - if (!ssl_cert_skip_to_spki(&buf, &tbs_cert) || - // subjectPublicKeyInfo - !CBS_get_asn1(&tbs_cert, NULL, CBS_ASN1_SEQUENCE) || - // issuerUniqueID - !CBS_get_optional_asn1( - &tbs_cert, NULL, NULL, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 1) || - // subjectUniqueID - !CBS_get_optional_asn1( - &tbs_cert, NULL, NULL, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 2) || - !CBS_get_optional_asn1( - &tbs_cert, &outer_extensions, &has_extensions, - CBS_ASN1_CONSTRUCTED | CBS_ASN1_CONTEXT_SPECIFIC | 3)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - if (!has_extensions) { - return 1; - } - - CBS extensions; - if (!CBS_get_asn1(&outer_extensions, &extensions, CBS_ASN1_SEQUENCE)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - while (CBS_len(&extensions) > 0) { - CBS extension, oid, contents; - if (!CBS_get_asn1(&extensions, &extension, CBS_ASN1_SEQUENCE) || - !CBS_get_asn1(&extension, &oid, CBS_ASN1_OBJECT) || - (CBS_peek_asn1_tag(&extension, CBS_ASN1_BOOLEAN) && - !CBS_get_asn1(&extension, NULL, CBS_ASN1_BOOLEAN)) || - !CBS_get_asn1(&extension, &contents, CBS_ASN1_OCTETSTRING) || - CBS_len(&extension) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - static const uint8_t kKeyUsageOID[3] = {0x55, 0x1d, 0x0f}; - if (CBS_len(&oid) != sizeof(kKeyUsageOID) || - OPENSSL_memcmp(CBS_data(&oid), kKeyUsageOID, sizeof(kKeyUsageOID)) != - 0) { - continue; - } - - CBS bit_string; - if (!CBS_get_asn1(&contents, &bit_string, CBS_ASN1_BITSTRING) || - CBS_len(&contents) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - // This is the KeyUsage extension. See - // https://tools.ietf.org/html/rfc5280#section-4.2.1.3 - if (!CBS_is_valid_asn1_bitstring(&bit_string)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CANNOT_PARSE_LEAF_CERT); - return 0; - } - - if (!CBS_asn1_bitstring_has_bit(&bit_string, 0)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING); - return 0; - } - - return 1; - } - - // No KeyUsage extension found. - return 1; -} - -UniquePtr ssl_parse_client_CA_list(SSL *ssl, - uint8_t *out_alert, - CBS *cbs) { - CRYPTO_BUFFER_POOL *const pool = ssl->ctx->pool; - - UniquePtr ret(sk_CRYPTO_BUFFER_new_null()); - if (!ret) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return nullptr; - } - - CBS child; - if (!CBS_get_u16_length_prefixed(cbs, &child)) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_LENGTH_MISMATCH); - return nullptr; - } - - while (CBS_len(&child) > 0) { - CBS distinguished_name; - if (!CBS_get_u16_length_prefixed(&child, &distinguished_name)) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_CA_DN_TOO_LONG); - return nullptr; - } - - UniquePtr buffer( - CRYPTO_BUFFER_new_from_CBS(&distinguished_name, pool)); - if (!buffer || - !PushToStack(ret.get(), std::move(buffer))) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return nullptr; - } - } - - if (!ssl->ctx->x509_method->check_client_CA_list(ret.get())) { - *out_alert = SSL_AD_INTERNAL_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return nullptr; - } - - return ret; -} - -bool ssl_has_client_CAs(SSL *ssl) { - STACK_OF(CRYPTO_BUFFER) *names = ssl->client_CA; - if (names == NULL) { - names = ssl->ctx->client_CA; - } - if (names == NULL) { - return false; - } - return sk_CRYPTO_BUFFER_num(names) > 0; -} - -int ssl_add_client_CA_list(SSL *ssl, CBB *cbb) { - CBB child, name_cbb; - if (!CBB_add_u16_length_prefixed(cbb, &child)) { - return 0; - } - - STACK_OF(CRYPTO_BUFFER) *names = ssl->client_CA; - if (names == NULL) { - names = ssl->ctx->client_CA; - } - if (names == NULL) { - return CBB_flush(cbb); - } - - for (const CRYPTO_BUFFER *name : names) { - if (!CBB_add_u16_length_prefixed(&child, &name_cbb) || - !CBB_add_bytes(&name_cbb, CRYPTO_BUFFER_data(name), - CRYPTO_BUFFER_len(name))) { - return 0; - } - } - - return CBB_flush(cbb); -} - -int ssl_check_leaf_certificate(SSL_HANDSHAKE *hs, EVP_PKEY *pkey, - const CRYPTO_BUFFER *leaf) { - SSL *const ssl = hs->ssl; - assert(ssl_protocol_version(ssl) < TLS1_3_VERSION); - - // Check the certificate's type matches the cipher. - if (!(hs->new_cipher->algorithm_auth & ssl_cipher_auth_mask_for_key(pkey))) { - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CERTIFICATE_TYPE); - return 0; - } - - // Check key usages for all key types but RSA. This is needed to distinguish - // ECDH certificates, which we do not support, from ECDSA certificates. In - // principle, we should check RSA key usages based on cipher, but this breaks - // buggy antivirus deployments. Other key types are always used for signing. - // - // TODO(davidben): Get more recent data on RSA key usages. - if (EVP_PKEY_id(pkey) != EVP_PKEY_RSA) { - CBS leaf_cbs; - CBS_init(&leaf_cbs, CRYPTO_BUFFER_data(leaf), CRYPTO_BUFFER_len(leaf)); - if (!ssl_cert_check_digital_signature_key_usage(&leaf_cbs)) { - return 0; - } - } - - if (EVP_PKEY_id(pkey) == EVP_PKEY_EC) { - // Check the key's group and point format are acceptable. - EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(pkey); - uint16_t group_id; - if (!ssl_nid_to_group_id( - &group_id, EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key))) || - !tls1_check_group_id(ssl, group_id) || - EC_KEY_get_conv_form(ec_key) != POINT_CONVERSION_UNCOMPRESSED) { - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECC_CERT); - return 0; - } - } - - return 1; -} - -int ssl_on_certificate_selected(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!ssl_has_certificate(ssl)) { - // Nothing to do. - return 1; - } - - if (!ssl->ctx->x509_method->ssl_auto_chain_if_needed(ssl)) { - return 0; - } - - CBS leaf; - CRYPTO_BUFFER_init_CBS(sk_CRYPTO_BUFFER_value(ssl->cert->chain, 0), &leaf); - - hs->local_pubkey = ssl_cert_parse_pubkey(&leaf); - return hs->local_pubkey != NULL; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_set_chain_and_key(SSL *ssl, CRYPTO_BUFFER *const *certs, - size_t num_certs, EVP_PKEY *privkey, - const SSL_PRIVATE_KEY_METHOD *privkey_method) { - return cert_set_chain_and_key(ssl->cert, certs, num_certs, privkey, - privkey_method); -} - -int SSL_CTX_set_chain_and_key(SSL_CTX *ctx, CRYPTO_BUFFER *const *certs, - size_t num_certs, EVP_PKEY *privkey, - const SSL_PRIVATE_KEY_METHOD *privkey_method) { - return cert_set_chain_and_key(ctx->cert, certs, num_certs, privkey, - privkey_method); -} - -int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, size_t der_len, - const uint8_t *der) { - UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); - if (!buffer) { - return 0; - } - - return ssl_set_cert(ctx->cert, std::move(buffer)); -} - -int SSL_use_certificate_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { - UniquePtr buffer(CRYPTO_BUFFER_new(der, der_len, NULL)); - if (!buffer) { - return 0; - } - - return ssl_set_cert(ssl->cert, std::move(buffer)); -} - -void SSL_CTX_set_cert_cb(SSL_CTX *ctx, int (*cb)(SSL *ssl, void *arg), - void *arg) { - ssl_cert_set_cert_cb(ctx->cert, cb, arg); -} - -void SSL_set_cert_cb(SSL *ssl, int (*cb)(SSL *ssl, void *arg), void *arg) { - ssl_cert_set_cert_cb(ssl->cert, cb, arg); -} - -STACK_OF(CRYPTO_BUFFER) *SSL_get0_peer_certificates(const SSL *ssl) { - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return NULL; - } - - return session->certs; -} - -STACK_OF(CRYPTO_BUFFER) *SSL_get0_server_requested_CAs(const SSL *ssl) { - if (ssl->s3->hs == NULL) { - return NULL; - } - return ssl->s3->hs->ca_names.get(); -} - -static int set_signed_cert_timestamp_list(CERT *cert, const uint8_t *list, - size_t list_len) { - CBS sct_list; - CBS_init(&sct_list, list, list_len); - if (!ssl_is_sct_list_valid(&sct_list)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_SCT_LIST); - return 0; - } - - CRYPTO_BUFFER_free(cert->signed_cert_timestamp_list); - cert->signed_cert_timestamp_list = - CRYPTO_BUFFER_new(CBS_data(&sct_list), CBS_len(&sct_list), NULL); - return cert->signed_cert_timestamp_list != NULL; -} - -int SSL_CTX_set_signed_cert_timestamp_list(SSL_CTX *ctx, const uint8_t *list, - size_t list_len) { - return set_signed_cert_timestamp_list(ctx->cert, list, list_len); -} - -int SSL_set_signed_cert_timestamp_list(SSL *ssl, const uint8_t *list, - size_t list_len) { - return set_signed_cert_timestamp_list(ssl->cert, list, list_len); -} - -int SSL_CTX_set_ocsp_response(SSL_CTX *ctx, const uint8_t *response, - size_t response_len) { - CRYPTO_BUFFER_free(ctx->cert->ocsp_response); - ctx->cert->ocsp_response = CRYPTO_BUFFER_new(response, response_len, NULL); - return ctx->cert->ocsp_response != NULL; -} - -int SSL_set_ocsp_response(SSL *ssl, const uint8_t *response, - size_t response_len) { - CRYPTO_BUFFER_free(ssl->cert->ocsp_response); - ssl->cert->ocsp_response = CRYPTO_BUFFER_new(response, response_len, NULL); - return ssl->cert->ocsp_response != NULL; -} - -void SSL_CTX_set0_client_CAs(SSL_CTX *ctx, STACK_OF(CRYPTO_BUFFER) *name_list) { - ctx->x509_method->ssl_ctx_flush_cached_client_CA(ctx); - sk_CRYPTO_BUFFER_pop_free(ctx->client_CA, CRYPTO_BUFFER_free); - ctx->client_CA = name_list; -} - -void SSL_set0_client_CAs(SSL *ssl, STACK_OF(CRYPTO_BUFFER) *name_list) { - ssl->ctx->x509_method->ssl_flush_cached_client_CA(ssl); - sk_CRYPTO_BUFFER_pop_free(ssl->client_CA, CRYPTO_BUFFER_free); - ssl->client_CA = name_list; -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_key_share.cc b/Pods/BoringSSL-GRPC/ssl/ssl_key_share.cc deleted file mode 100644 index 8b750ae6c..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_key_share.cc +++ /dev/null @@ -1,252 +0,0 @@ -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - - -namespace bssl { - -namespace { - -class ECKeyShare : public SSLKeyShare { - public: - ECKeyShare(int nid, uint16_t group_id) : nid_(nid), group_id_(group_id) {} - ~ECKeyShare() override {} - - uint16_t GroupID() const override { return group_id_; } - - bool Offer(CBB *out) override { - assert(!private_key_); - // Set up a shared |BN_CTX| for all operations. - UniquePtr bn_ctx(BN_CTX_new()); - if (!bn_ctx) { - return false; - } - BN_CTXScope scope(bn_ctx.get()); - - // Generate a private key. - UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); - private_key_.reset(BN_new()); - if (!group || !private_key_ || - !BN_rand_range_ex(private_key_.get(), 1, - EC_GROUP_get0_order(group.get()))) { - return false; - } - - // Compute the corresponding public key and serialize it. - UniquePtr public_key(EC_POINT_new(group.get())); - if (!public_key || - !EC_POINT_mul(group.get(), public_key.get(), private_key_.get(), NULL, - NULL, bn_ctx.get()) || - !EC_POINT_point2cbb(out, group.get(), public_key.get(), - POINT_CONVERSION_UNCOMPRESSED, bn_ctx.get())) { - return false; - } - - return true; - } - - bool Finish(Array *out_secret, uint8_t *out_alert, - Span peer_key) override { - assert(private_key_); - *out_alert = SSL_AD_INTERNAL_ERROR; - - // Set up a shared |BN_CTX| for all operations. - UniquePtr bn_ctx(BN_CTX_new()); - if (!bn_ctx) { - return false; - } - BN_CTXScope scope(bn_ctx.get()); - - UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); - if (!group) { - return false; - } - - UniquePtr peer_point(EC_POINT_new(group.get())); - UniquePtr result(EC_POINT_new(group.get())); - BIGNUM *x = BN_CTX_get(bn_ctx.get()); - if (!peer_point || !result || !x) { - return false; - } - - if (peer_key.empty() || peer_key[0] != POINT_CONVERSION_UNCOMPRESSED || - !EC_POINT_oct2point(group.get(), peer_point.get(), peer_key.data(), - peer_key.size(), bn_ctx.get())) { - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); - *out_alert = SSL_AD_DECODE_ERROR; - return false; - } - - // Compute the x-coordinate of |peer_key| * |private_key_|. - if (!EC_POINT_mul(group.get(), result.get(), NULL, peer_point.get(), - private_key_.get(), bn_ctx.get()) || - !EC_POINT_get_affine_coordinates_GFp(group.get(), result.get(), x, NULL, - bn_ctx.get())) { - return false; - } - - // Encode the x-coordinate left-padded with zeros. - Array secret; - if (!secret.Init((EC_GROUP_get_degree(group.get()) + 7) / 8) || - !BN_bn2bin_padded(secret.data(), secret.size(), x)) { - return false; - } - - *out_secret = std::move(secret); - return true; - } - - private: - UniquePtr private_key_; - int nid_; - uint16_t group_id_; -}; - -class X25519KeyShare : public SSLKeyShare { - public: - X25519KeyShare() {} - ~X25519KeyShare() override { - OPENSSL_cleanse(private_key_, sizeof(private_key_)); - } - - uint16_t GroupID() const override { return SSL_CURVE_X25519; } - - bool Offer(CBB *out) override { - uint8_t public_key[32]; - X25519_keypair(public_key, private_key_); - return !!CBB_add_bytes(out, public_key, sizeof(public_key)); - } - - bool Finish(Array *out_secret, uint8_t *out_alert, - Span peer_key) override { - *out_alert = SSL_AD_INTERNAL_ERROR; - - Array secret; - if (!secret.Init(32)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - if (peer_key.size() != 32 || - !X25519(secret.data(), private_key_, peer_key.data())) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); - return false; - } - - *out_secret = std::move(secret); - return true; - } - - private: - uint8_t private_key_[32]; -}; - -CONSTEXPR_ARRAY struct { - int nid; - uint16_t group_id; - const char name[8], alias[11]; -} kNamedGroups[] = { - {NID_secp224r1, SSL_CURVE_SECP224R1, "P-224", "secp224r1"}, - {NID_X9_62_prime256v1, SSL_CURVE_SECP256R1, "P-256", "prime256v1"}, - {NID_secp384r1, SSL_CURVE_SECP384R1, "P-384", "secp384r1"}, - {NID_secp521r1, SSL_CURVE_SECP521R1, "P-521", "secp521r1"}, - {NID_X25519, SSL_CURVE_X25519, "X25519", "x25519"}, -}; - -} // namespace - -UniquePtr SSLKeyShare::Create(uint16_t group_id) { - switch (group_id) { - case SSL_CURVE_SECP224R1: - return UniquePtr( - New(NID_secp224r1, SSL_CURVE_SECP224R1)); - case SSL_CURVE_SECP256R1: - return UniquePtr( - New(NID_X9_62_prime256v1, SSL_CURVE_SECP256R1)); - case SSL_CURVE_SECP384R1: - return UniquePtr( - New(NID_secp384r1, SSL_CURVE_SECP384R1)); - case SSL_CURVE_SECP521R1: - return UniquePtr( - New(NID_secp521r1, SSL_CURVE_SECP521R1)); - case SSL_CURVE_X25519: - return UniquePtr(New()); - default: - return nullptr; - } -} - -bool SSLKeyShare::Accept(CBB *out_public_key, Array *out_secret, - uint8_t *out_alert, Span peer_key) { - *out_alert = SSL_AD_INTERNAL_ERROR; - return Offer(out_public_key) && - Finish(out_secret, out_alert, peer_key); -} - -int ssl_nid_to_group_id(uint16_t *out_group_id, int nid) { - for (const auto &group : kNamedGroups) { - if (group.nid == nid) { - *out_group_id = group.group_id; - return 1; - } - } - return 0; -} - -int ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len) { - for (const auto &group : kNamedGroups) { - if (len == strlen(group.name) && - !strncmp(group.name, name, len)) { - *out_group_id = group.group_id; - return 1; - } - if (len == strlen(group.alias) && - !strncmp(group.alias, name, len)) { - *out_group_id = group.group_id; - return 1; - } - } - return 0; -} - -} // namespace bssl - -using namespace bssl; - -const char* SSL_get_curve_name(uint16_t group_id) { - for (const auto &group : kNamedGroups) { - if (group.group_id == group_id) { - return group.name; - } - } - return nullptr; -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_key_share.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/ssl_key_share.cc.grpc_back deleted file mode 100644 index 4d76bb233..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_key_share.cc.grpc_back +++ /dev/null @@ -1,252 +0,0 @@ -/* Copyright (c) 2015, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - - -namespace bssl { - -namespace { - -class ECKeyShare : public SSLKeyShare { - public: - ECKeyShare(int nid, uint16_t group_id) : nid_(nid), group_id_(group_id) {} - ~ECKeyShare() override {} - - uint16_t GroupID() const override { return group_id_; } - - bool Offer(CBB *out) override { - assert(!private_key_); - // Set up a shared |BN_CTX| for all operations. - UniquePtr bn_ctx(BN_CTX_new()); - if (!bn_ctx) { - return false; - } - BN_CTXScope scope(bn_ctx.get()); - - // Generate a private key. - UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); - private_key_.reset(BN_new()); - if (!group || !private_key_ || - !BN_rand_range_ex(private_key_.get(), 1, - EC_GROUP_get0_order(group.get()))) { - return false; - } - - // Compute the corresponding public key and serialize it. - UniquePtr public_key(EC_POINT_new(group.get())); - if (!public_key || - !EC_POINT_mul(group.get(), public_key.get(), private_key_.get(), NULL, - NULL, bn_ctx.get()) || - !EC_POINT_point2cbb(out, group.get(), public_key.get(), - POINT_CONVERSION_UNCOMPRESSED, bn_ctx.get())) { - return false; - } - - return true; - } - - bool Finish(Array *out_secret, uint8_t *out_alert, - Span peer_key) override { - assert(private_key_); - *out_alert = SSL_AD_INTERNAL_ERROR; - - // Set up a shared |BN_CTX| for all operations. - UniquePtr bn_ctx(BN_CTX_new()); - if (!bn_ctx) { - return false; - } - BN_CTXScope scope(bn_ctx.get()); - - UniquePtr group(EC_GROUP_new_by_curve_name(nid_)); - if (!group) { - return false; - } - - UniquePtr peer_point(EC_POINT_new(group.get())); - UniquePtr result(EC_POINT_new(group.get())); - BIGNUM *x = BN_CTX_get(bn_ctx.get()); - if (!peer_point || !result || !x) { - return false; - } - - if (peer_key.empty() || peer_key[0] != POINT_CONVERSION_UNCOMPRESSED || - !EC_POINT_oct2point(group.get(), peer_point.get(), peer_key.data(), - peer_key.size(), bn_ctx.get())) { - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); - *out_alert = SSL_AD_DECODE_ERROR; - return false; - } - - // Compute the x-coordinate of |peer_key| * |private_key_|. - if (!EC_POINT_mul(group.get(), result.get(), NULL, peer_point.get(), - private_key_.get(), bn_ctx.get()) || - !EC_POINT_get_affine_coordinates_GFp(group.get(), result.get(), x, NULL, - bn_ctx.get())) { - return false; - } - - // Encode the x-coordinate left-padded with zeros. - Array secret; - if (!secret.Init((EC_GROUP_get_degree(group.get()) + 7) / 8) || - !BN_bn2bin_padded(secret.data(), secret.size(), x)) { - return false; - } - - *out_secret = std::move(secret); - return true; - } - - private: - UniquePtr private_key_; - int nid_; - uint16_t group_id_; -}; - -class X25519KeyShare : public SSLKeyShare { - public: - X25519KeyShare() {} - ~X25519KeyShare() override { - OPENSSL_cleanse(private_key_, sizeof(private_key_)); - } - - uint16_t GroupID() const override { return SSL_CURVE_X25519; } - - bool Offer(CBB *out) override { - uint8_t public_key[32]; - X25519_keypair(public_key, private_key_); - return !!CBB_add_bytes(out, public_key, sizeof(public_key)); - } - - bool Finish(Array *out_secret, uint8_t *out_alert, - Span peer_key) override { - *out_alert = SSL_AD_INTERNAL_ERROR; - - Array secret; - if (!secret.Init(32)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - if (peer_key.size() != 32 || - !X25519(secret.data(), private_key_, peer_key.data())) { - *out_alert = SSL_AD_DECODE_ERROR; - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_ECPOINT); - return false; - } - - *out_secret = std::move(secret); - return true; - } - - private: - uint8_t private_key_[32]; -}; - -CONSTEXPR_ARRAY struct { - int nid; - uint16_t group_id; - const char name[8], alias[11]; -} kNamedGroups[] = { - {NID_secp224r1, SSL_CURVE_SECP224R1, "P-224", "secp224r1"}, - {NID_X9_62_prime256v1, SSL_CURVE_SECP256R1, "P-256", "prime256v1"}, - {NID_secp384r1, SSL_CURVE_SECP384R1, "P-384", "secp384r1"}, - {NID_secp521r1, SSL_CURVE_SECP521R1, "P-521", "secp521r1"}, - {NID_X25519, SSL_CURVE_X25519, "X25519", "x25519"}, -}; - -} // namespace - -UniquePtr SSLKeyShare::Create(uint16_t group_id) { - switch (group_id) { - case SSL_CURVE_SECP224R1: - return UniquePtr( - New(NID_secp224r1, SSL_CURVE_SECP224R1)); - case SSL_CURVE_SECP256R1: - return UniquePtr( - New(NID_X9_62_prime256v1, SSL_CURVE_SECP256R1)); - case SSL_CURVE_SECP384R1: - return UniquePtr( - New(NID_secp384r1, SSL_CURVE_SECP384R1)); - case SSL_CURVE_SECP521R1: - return UniquePtr( - New(NID_secp521r1, SSL_CURVE_SECP521R1)); - case SSL_CURVE_X25519: - return UniquePtr(New()); - default: - return nullptr; - } -} - -bool SSLKeyShare::Accept(CBB *out_public_key, Array *out_secret, - uint8_t *out_alert, Span peer_key) { - *out_alert = SSL_AD_INTERNAL_ERROR; - return Offer(out_public_key) && - Finish(out_secret, out_alert, peer_key); -} - -int ssl_nid_to_group_id(uint16_t *out_group_id, int nid) { - for (const auto &group : kNamedGroups) { - if (group.nid == nid) { - *out_group_id = group.group_id; - return 1; - } - } - return 0; -} - -int ssl_name_to_group_id(uint16_t *out_group_id, const char *name, size_t len) { - for (const auto &group : kNamedGroups) { - if (len == strlen(group.name) && - !strncmp(group.name, name, len)) { - *out_group_id = group.group_id; - return 1; - } - if (len == strlen(group.alias) && - !strncmp(group.alias, name, len)) { - *out_group_id = group.group_id; - return 1; - } - } - return 0; -} - -} // namespace bssl - -using namespace bssl; - -const char* SSL_get_curve_name(uint16_t group_id) { - for (const auto &group : kNamedGroups) { - if (group.group_id == group_id) { - return group.name; - } - } - return nullptr; -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_lib.cc b/Pods/BoringSSL-GRPC/ssl/ssl_lib.cc deleted file mode 100644 index 31aa5b35c..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_lib.cc +++ /dev/null @@ -1,2719 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. */ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - -#if defined(OPENSSL_WINDOWS) -#include -#else -#include -#include -#endif - - -namespace bssl { - -// |SSL_R_UNKNOWN_PROTOCOL| is no longer emitted, but continue to define it -// to avoid downstream churn. -OPENSSL_DECLARE_ERROR_REASON(SSL, UNKNOWN_PROTOCOL) - -// The following errors are no longer emitted, but are used in nginx without -// #ifdefs. -OPENSSL_DECLARE_ERROR_REASON(SSL, BLOCK_CIPHER_PAD_IS_WRONG) -OPENSSL_DECLARE_ERROR_REASON(SSL, NO_CIPHERS_SPECIFIED) - -// Some error codes are special. Ensure the make_errors.go script never -// regresses this. -static_assert(SSL_R_TLSV1_ALERT_NO_RENEGOTIATION == - SSL_AD_NO_RENEGOTIATION + SSL_AD_REASON_OFFSET, - "alert reason code mismatch"); - -// kMaxHandshakeSize is the maximum size, in bytes, of a handshake message. -static const size_t kMaxHandshakeSize = (1u << 24) - 1; - -static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl = - CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; -static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl_ctx = - CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; - -bool CBBFinishArray(CBB *cbb, Array *out) { - uint8_t *ptr; - size_t len; - if (!CBB_finish(cbb, &ptr, &len)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - out->Reset(ptr, len); - return true; -} - -void ssl_reset_error_state(SSL *ssl) { - // Functions which use |SSL_get_error| must reset I/O and error state on - // entry. - ssl->s3->rwstate = SSL_NOTHING; - ERR_clear_error(); - ERR_clear_system_error(); -} - -void ssl_set_read_error(SSL* ssl) { - ssl->s3->read_shutdown = ssl_shutdown_error; - ssl->s3->read_error.reset(ERR_save_state()); -} - -static bool check_read_error(const SSL *ssl) { - if (ssl->s3->read_shutdown == ssl_shutdown_error) { - ERR_restore_state(ssl->s3->read_error.get()); - return false; - } - return true; -} - -int ssl_can_write(const SSL *ssl) { - return !SSL_in_init(ssl) || ssl->s3->hs->can_early_write; -} - -int ssl_can_read(const SSL *ssl) { - return !SSL_in_init(ssl) || ssl->s3->hs->can_early_read; -} - -ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in) { - *out_consumed = 0; - if (!check_read_error(ssl)) { - *out_alert = 0; - return ssl_open_record_error; - } - auto ret = ssl->method->open_handshake(ssl, out_consumed, out_alert, in); - if (ret == ssl_open_record_error) { - ssl_set_read_error(ssl); - } - return ret; -} - -ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in) { - *out_consumed = 0; - if (!check_read_error(ssl)) { - *out_alert = 0; - return ssl_open_record_error; - } - auto ret = - ssl->method->open_change_cipher_spec(ssl, out_consumed, out_alert, in); - if (ret == ssl_open_record_error) { - ssl_set_read_error(ssl); - } - return ret; -} - -ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in) { - *out_consumed = 0; - if (!check_read_error(ssl)) { - *out_alert = 0; - return ssl_open_record_error; - } - auto ret = ssl->method->open_app_data(ssl, out, out_consumed, out_alert, in); - if (ret == ssl_open_record_error) { - ssl_set_read_error(ssl); - } - return ret; -} - -void ssl_cipher_preference_list_free( - struct ssl_cipher_preference_list_st *cipher_list) { - if (cipher_list == NULL) { - return; - } - sk_SSL_CIPHER_free(cipher_list->ciphers); - OPENSSL_free(cipher_list->in_group_flags); - OPENSSL_free(cipher_list); -} - -void ssl_update_cache(SSL_HANDSHAKE *hs, int mode) { - SSL *const ssl = hs->ssl; - SSL_CTX *ctx = ssl->session_ctx; - // Never cache sessions with empty session IDs. - if (ssl->s3->established_session->session_id_length == 0 || - ssl->s3->established_session->not_resumable || - (ctx->session_cache_mode & mode) != mode) { - return; - } - - // Clients never use the internal session cache. - int use_internal_cache = ssl->server && !(ctx->session_cache_mode & - SSL_SESS_CACHE_NO_INTERNAL_STORE); - - // A client may see new sessions on abbreviated handshakes if the server - // decides to renew the ticket. Once the handshake is completed, it should be - // inserted into the cache. - if (ssl->s3->established_session.get() != ssl->session || - (!ssl->server && hs->ticket_expected)) { - if (use_internal_cache) { - SSL_CTX_add_session(ctx, ssl->s3->established_session.get()); - } - if (ctx->new_session_cb != NULL) { - SSL_SESSION_up_ref(ssl->s3->established_session.get()); - if (!ctx->new_session_cb(ssl, ssl->s3->established_session.get())) { - // |new_session_cb|'s return value signals whether it took ownership. - SSL_SESSION_free(ssl->s3->established_session.get()); - } - } - } - - if (use_internal_cache && - !(ctx->session_cache_mode & SSL_SESS_CACHE_NO_AUTO_CLEAR)) { - // Automatically flush the internal session cache every 255 connections. - int flush_cache = 0; - CRYPTO_MUTEX_lock_write(&ctx->lock); - ctx->handshakes_since_cache_flush++; - if (ctx->handshakes_since_cache_flush >= 255) { - flush_cache = 1; - ctx->handshakes_since_cache_flush = 0; - } - CRYPTO_MUTEX_unlock_write(&ctx->lock); - - if (flush_cache) { - struct OPENSSL_timeval now; - ssl_get_current_time(ssl, &now); - SSL_CTX_flush_sessions(ctx, now.tv_sec); - } - } -} - -static int cbb_add_hex(CBB *cbb, const uint8_t *in, size_t in_len) { - static const char hextable[] = "0123456789abcdef"; - uint8_t *out; - - if (!CBB_add_space(cbb, &out, in_len * 2)) { - return 0; - } - - for (size_t i = 0; i < in_len; i++) { - *(out++) = (uint8_t)hextable[in[i] >> 4]; - *(out++) = (uint8_t)hextable[in[i] & 0xf]; - } - - return 1; -} - -int ssl_log_secret(const SSL *ssl, const char *label, const uint8_t *secret, - size_t secret_len) { - if (ssl->ctx->keylog_callback == NULL) { - return 1; - } - - ScopedCBB cbb; - uint8_t *out; - size_t out_len; - if (!CBB_init(cbb.get(), strlen(label) + 1 + SSL3_RANDOM_SIZE * 2 + 1 + - secret_len * 2 + 1) || - !CBB_add_bytes(cbb.get(), (const uint8_t *)label, strlen(label)) || - !CBB_add_bytes(cbb.get(), (const uint8_t *)" ", 1) || - !cbb_add_hex(cbb.get(), ssl->s3->client_random, SSL3_RANDOM_SIZE) || - !CBB_add_bytes(cbb.get(), (const uint8_t *)" ", 1) || - !cbb_add_hex(cbb.get(), secret, secret_len) || - !CBB_add_u8(cbb.get(), 0 /* NUL */) || - !CBB_finish(cbb.get(), &out, &out_len)) { - return 0; - } - - ssl->ctx->keylog_callback(ssl, (const char *)out); - OPENSSL_free(out); - return 1; -} - -void ssl_do_info_callback(const SSL *ssl, int type, int value) { - void (*cb)(const SSL *ssl, int type, int value) = NULL; - if (ssl->info_callback != NULL) { - cb = ssl->info_callback; - } else if (ssl->ctx->info_callback != NULL) { - cb = ssl->ctx->info_callback; - } - - if (cb != NULL) { - cb(ssl, type, value); - } -} - -void ssl_do_msg_callback(SSL *ssl, int is_write, int content_type, - Span in) { - if (ssl->msg_callback == NULL) { - return; - } - - // |version| is zero when calling for |SSL3_RT_HEADER| and |SSL2_VERSION| for - // a V2ClientHello. - int version; - switch (content_type) { - case 0: - // V2ClientHello - version = SSL2_VERSION; - break; - case SSL3_RT_HEADER: - version = 0; - break; - default: - version = SSL_version(ssl); - } - - ssl->msg_callback(is_write, version, content_type, in.data(), in.size(), ssl, - ssl->msg_callback_arg); -} - -void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock) { - // TODO(martinkr): Change callers to |ssl_ctx_get_current_time| and drop the - // |ssl| arg from |current_time_cb| if possible. - ssl_ctx_get_current_time(ssl->ctx, out_clock); -} - -void ssl_ctx_get_current_time(const SSL_CTX *ctx, - struct OPENSSL_timeval *out_clock) { - if (ctx->current_time_cb != NULL) { - // TODO(davidben): Update current_time_cb to use OPENSSL_timeval. See - // https://crbug.com/boringssl/155. - struct timeval clock; - ctx->current_time_cb(nullptr /* ssl */, &clock); - if (clock.tv_sec < 0) { - assert(0); - out_clock->tv_sec = 0; - out_clock->tv_usec = 0; - } else { - out_clock->tv_sec = (uint64_t)clock.tv_sec; - out_clock->tv_usec = (uint32_t)clock.tv_usec; - } - return; - } - -#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) - out_clock->tv_sec = 1234; - out_clock->tv_usec = 1234; -#elif defined(OPENSSL_WINDOWS) - struct _timeb time; - _ftime(&time); - if (time.time < 0) { - assert(0); - out_clock->tv_sec = 0; - out_clock->tv_usec = 0; - } else { - out_clock->tv_sec = time.time; - out_clock->tv_usec = time.millitm * 1000; - } -#else - struct timeval clock; - gettimeofday(&clock, NULL); - if (clock.tv_sec < 0) { - assert(0); - out_clock->tv_sec = 0; - out_clock->tv_usec = 0; - } else { - out_clock->tv_sec = (uint64_t)clock.tv_sec; - out_clock->tv_usec = (uint32_t)clock.tv_usec; - } -#endif -} - -void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on) { - ctx->handoff = on; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_library_init(void) { - CRYPTO_library_init(); - return 1; -} - -int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { - CRYPTO_library_init(); - return 1; -} - -static uint32_t ssl_session_hash(const SSL_SESSION *sess) { - const uint8_t *session_id = sess->session_id; - - uint8_t tmp_storage[sizeof(uint32_t)]; - if (sess->session_id_length < sizeof(tmp_storage)) { - OPENSSL_memset(tmp_storage, 0, sizeof(tmp_storage)); - OPENSSL_memcpy(tmp_storage, sess->session_id, sess->session_id_length); - session_id = tmp_storage; - } - - uint32_t hash = - ((uint32_t)session_id[0]) | - ((uint32_t)session_id[1] << 8) | - ((uint32_t)session_id[2] << 16) | - ((uint32_t)session_id[3] << 24); - - return hash; -} - -// NB: If this function (or indeed the hash function which uses a sort of -// coarser function than this one) is changed, ensure -// SSL_CTX_has_matching_session_id() is checked accordingly. It relies on being -// able to construct an SSL_SESSION that will collide with any existing session -// with a matching session ID. -static int ssl_session_cmp(const SSL_SESSION *a, const SSL_SESSION *b) { - if (a->ssl_version != b->ssl_version) { - return 1; - } - - if (a->session_id_length != b->session_id_length) { - return 1; - } - - return OPENSSL_memcmp(a->session_id, b->session_id, a->session_id_length); -} - -SSL_CTX *SSL_CTX_new(const SSL_METHOD *method) { - SSL_CTX *ret = NULL; - - if (method == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_METHOD_PASSED); - return NULL; - } - - ret = (SSL_CTX *)OPENSSL_malloc(sizeof(SSL_CTX)); - if (ret == NULL) { - goto err; - } - - OPENSSL_memset(ret, 0, sizeof(SSL_CTX)); - - ret->method = method->method; - ret->x509_method = method->x509_method; - - CRYPTO_MUTEX_init(&ret->lock); - - ret->session_cache_mode = SSL_SESS_CACHE_SERVER; - ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT; - - ret->session_timeout = SSL_DEFAULT_SESSION_TIMEOUT; - ret->session_psk_dhe_timeout = SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT; - - ret->references = 1; - - ret->max_cert_list = SSL_MAX_CERT_LIST_DEFAULT; - ret->verify_mode = SSL_VERIFY_NONE; - ret->cert = ssl_cert_new(method->x509_method); - if (ret->cert == NULL) { - goto err; - } - - ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp); - if (ret->sessions == NULL) { - goto err; - } - - if (!ret->x509_method->ssl_ctx_new(ret)) { - goto err; - } - - if (!SSL_CTX_set_strict_cipher_list(ret, SSL_DEFAULT_CIPHER_LIST)) { - goto err2; - } - - ret->client_CA = sk_CRYPTO_BUFFER_new_null(); - if (ret->client_CA == NULL) { - goto err; - } - - CRYPTO_new_ex_data(&ret->ex_data); - - ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; - - // Disable the auto-chaining feature by default. Once this has stuck without - // problems, the feature will be removed entirely. - ret->mode = SSL_MODE_NO_AUTO_CHAIN; - - // Lock the SSL_CTX to the specified version, for compatibility with legacy - // uses of SSL_METHOD. - if (!SSL_CTX_set_max_proto_version(ret, method->version) || - !SSL_CTX_set_min_proto_version(ret, method->version)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - goto err2; - } - - return ret; - -err: - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); -err2: - SSL_CTX_free(ret); - return NULL; -} - -int SSL_CTX_up_ref(SSL_CTX *ctx) { - CRYPTO_refcount_inc(&ctx->references); - return 1; -} - -void SSL_CTX_free(SSL_CTX *ctx) { - if (ctx == NULL || - !CRYPTO_refcount_dec_and_test_zero(&ctx->references)) { - return; - } - - // Free internal session cache. However: the remove_cb() may reference the - // ex_data of SSL_CTX, thus the ex_data store can only be removed after the - // sessions were flushed. As the ex_data handling routines might also touch - // the session cache, the most secure solution seems to be: empty (flush) the - // cache, then free ex_data, then finally free the cache. (See ticket - // [openssl.org #212].) - SSL_CTX_flush_sessions(ctx, 0); - - CRYPTO_free_ex_data(&g_ex_data_class_ssl_ctx, ctx, &ctx->ex_data); - - CRYPTO_MUTEX_cleanup(&ctx->lock); - lh_SSL_SESSION_free(ctx->sessions); - ssl_cipher_preference_list_free(ctx->cipher_list); - ssl_cert_free(ctx->cert); - sk_SSL_CUSTOM_EXTENSION_pop_free(ctx->client_custom_extensions, - SSL_CUSTOM_EXTENSION_free); - sk_SSL_CUSTOM_EXTENSION_pop_free(ctx->server_custom_extensions, - SSL_CUSTOM_EXTENSION_free); - sk_CRYPTO_BUFFER_pop_free(ctx->client_CA, CRYPTO_BUFFER_free); - ctx->x509_method->ssl_ctx_free(ctx); - sk_SRTP_PROTECTION_PROFILE_free(ctx->srtp_profiles); - OPENSSL_free(ctx->psk_identity_hint); - OPENSSL_free(ctx->supported_group_list); - OPENSSL_free(ctx->alpn_client_proto_list); - EVP_PKEY_free(ctx->tlsext_channel_id_private); - OPENSSL_free(ctx->verify_sigalgs); - OPENSSL_free(ctx->tlsext_ticket_key_current); - OPENSSL_free(ctx->tlsext_ticket_key_prev); - - OPENSSL_free(ctx); -} - -SSL *SSL_new(SSL_CTX *ctx) { - if (ctx == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_CTX); - return NULL; - } - if (ctx->method == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION); - return NULL; - } - - SSL *ssl = (SSL *)OPENSSL_malloc(sizeof(SSL)); - if (ssl == NULL) { - goto err; - } - OPENSSL_memset(ssl, 0, sizeof(SSL)); - - ssl->conf_min_version = ctx->conf_min_version; - ssl->conf_max_version = ctx->conf_max_version; - ssl->tls13_variant = ctx->tls13_variant; - - // RFC 6347 states that implementations SHOULD use an initial timer value of - // 1 second. - ssl->initial_timeout_duration_ms = 1000; - - ssl->options = ctx->options; - ssl->mode = ctx->mode; - ssl->max_cert_list = ctx->max_cert_list; - - ssl->cert = ssl_cert_dup(ctx->cert); - if (ssl->cert == NULL) { - goto err; - } - - ssl->msg_callback = ctx->msg_callback; - ssl->msg_callback_arg = ctx->msg_callback_arg; - ssl->verify_mode = ctx->verify_mode; - ssl->verify_callback = ctx->default_verify_callback; - ssl->custom_verify_callback = ctx->custom_verify_callback; - ssl->retain_only_sha256_of_client_certs = - ctx->retain_only_sha256_of_client_certs; - - ssl->quiet_shutdown = ctx->quiet_shutdown; - ssl->max_send_fragment = ctx->max_send_fragment; - - SSL_CTX_up_ref(ctx); - ssl->ctx = ctx; - SSL_CTX_up_ref(ctx); - ssl->session_ctx = ctx; - - if (!ssl->ctx->x509_method->ssl_new(ssl)) { - goto err; - } - - if (ctx->supported_group_list) { - ssl->supported_group_list = (uint16_t *)BUF_memdup( - ctx->supported_group_list, ctx->supported_group_list_len * 2); - if (!ssl->supported_group_list) { - goto err; - } - ssl->supported_group_list_len = ctx->supported_group_list_len; - } - - if (ctx->alpn_client_proto_list) { - ssl->alpn_client_proto_list = (uint8_t *)BUF_memdup( - ctx->alpn_client_proto_list, ctx->alpn_client_proto_list_len); - if (ssl->alpn_client_proto_list == NULL) { - goto err; - } - ssl->alpn_client_proto_list_len = ctx->alpn_client_proto_list_len; - } - - ssl->method = ctx->method; - - if (!ssl->method->ssl_new(ssl)) { - goto err; - } - - CRYPTO_new_ex_data(&ssl->ex_data); - - ssl->psk_identity_hint = NULL; - if (ctx->psk_identity_hint) { - ssl->psk_identity_hint = BUF_strdup(ctx->psk_identity_hint); - if (ssl->psk_identity_hint == NULL) { - goto err; - } - } - ssl->psk_client_callback = ctx->psk_client_callback; - ssl->psk_server_callback = ctx->psk_server_callback; - - ssl->tlsext_channel_id_enabled = ctx->tlsext_channel_id_enabled; - if (ctx->tlsext_channel_id_private) { - EVP_PKEY_up_ref(ctx->tlsext_channel_id_private); - ssl->tlsext_channel_id_private = ctx->tlsext_channel_id_private; - } - - ssl->signed_cert_timestamps_enabled = ctx->signed_cert_timestamps_enabled; - ssl->ocsp_stapling_enabled = ctx->ocsp_stapling_enabled; - ssl->handoff = ctx->handoff; - - return ssl; - -err: - SSL_free(ssl); - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - - return NULL; -} - -void SSL_free(SSL *ssl) { - if (ssl == NULL) { - return; - } - - if (ssl->ctx != NULL) { - ssl->ctx->x509_method->ssl_free(ssl); - } - - CRYPTO_free_ex_data(&g_ex_data_class_ssl, ssl, &ssl->ex_data); - - BIO_free_all(ssl->rbio); - BIO_free_all(ssl->wbio); - - // add extra stuff - ssl_cipher_preference_list_free(ssl->cipher_list); - - SSL_SESSION_free(ssl->session); - - ssl_cert_free(ssl->cert); - - OPENSSL_free(ssl->tlsext_hostname); - SSL_CTX_free(ssl->session_ctx); - OPENSSL_free(ssl->supported_group_list); - OPENSSL_free(ssl->alpn_client_proto_list); - OPENSSL_free(ssl->token_binding_params); - OPENSSL_free(ssl->quic_transport_params); - EVP_PKEY_free(ssl->tlsext_channel_id_private); - OPENSSL_free(ssl->psk_identity_hint); - sk_CRYPTO_BUFFER_pop_free(ssl->client_CA, CRYPTO_BUFFER_free); - sk_SRTP_PROTECTION_PROFILE_free(ssl->srtp_profiles); - - if (ssl->method != NULL) { - ssl->method->ssl_free(ssl); - } - SSL_CTX_free(ssl->ctx); - - OPENSSL_free(ssl); -} - -void SSL_set_connect_state(SSL *ssl) { - ssl->server = false; - ssl->do_handshake = ssl_client_handshake; -} - -void SSL_set_accept_state(SSL *ssl) { - ssl->server = true; - ssl->do_handshake = ssl_server_handshake; -} - -void SSL_set0_rbio(SSL *ssl, BIO *rbio) { - BIO_free_all(ssl->rbio); - ssl->rbio = rbio; -} - -void SSL_set0_wbio(SSL *ssl, BIO *wbio) { - BIO_free_all(ssl->wbio); - ssl->wbio = wbio; -} - -void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio) { - // For historical reasons, this function has many different cases in ownership - // handling. - - // If nothing has changed, do nothing - if (rbio == SSL_get_rbio(ssl) && wbio == SSL_get_wbio(ssl)) { - return; - } - - // If the two arguments are equal, one fewer reference is granted than - // taken. - if (rbio != NULL && rbio == wbio) { - BIO_up_ref(rbio); - } - - // If only the wbio is changed, adopt only one reference. - if (rbio == SSL_get_rbio(ssl)) { - SSL_set0_wbio(ssl, wbio); - return; - } - - // There is an asymmetry here for historical reasons. If only the rbio is - // changed AND the rbio and wbio were originally different, then we only adopt - // one reference. - if (wbio == SSL_get_wbio(ssl) && SSL_get_rbio(ssl) != SSL_get_wbio(ssl)) { - SSL_set0_rbio(ssl, rbio); - return; - } - - // Otherwise, adopt both references. - SSL_set0_rbio(ssl, rbio); - SSL_set0_wbio(ssl, wbio); -} - -BIO *SSL_get_rbio(const SSL *ssl) { return ssl->rbio; } - -BIO *SSL_get_wbio(const SSL *ssl) { return ssl->wbio; } - -int SSL_do_handshake(SSL *ssl) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_TYPE_NOT_SET); - return -1; - } - - if (!SSL_in_init(ssl)) { - return 1; - } - - // Run the handshake. - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - - bool early_return = false; - int ret = ssl_run_handshake(hs, &early_return); - ssl_do_info_callback( - ssl, ssl->server ? SSL_CB_ACCEPT_EXIT : SSL_CB_CONNECT_EXIT, ret); - if (ret <= 0) { - return ret; - } - - // Destroy the handshake object if the handshake has completely finished. - if (!early_return) { - ssl->s3->hs.reset(); - } - - return 1; -} - -int SSL_connect(SSL *ssl) { - if (ssl->do_handshake == NULL) { - // Not properly initialized yet - SSL_set_connect_state(ssl); - } - - return SSL_do_handshake(ssl); -} - -int SSL_accept(SSL *ssl) { - if (ssl->do_handshake == NULL) { - // Not properly initialized yet - SSL_set_accept_state(ssl); - } - - return SSL_do_handshake(ssl); -} - -static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) { - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return tls13_post_handshake(ssl, msg); - } - - // We do not accept renegotiations as a server or SSL 3.0. SSL 3.0 will be - // removed entirely in the future and requires retaining more data for - // renegotiation_info. - if (ssl->server || ssl->version == SSL3_VERSION) { - goto no_renegotiation; - } - - if (msg.type != SSL3_MT_HELLO_REQUEST || CBS_len(&msg.body) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HELLO_REQUEST); - return 0; - } - - switch (ssl->renegotiate_mode) { - case ssl_renegotiate_ignore: - // Ignore the HelloRequest. - return 1; - - case ssl_renegotiate_once: - if (ssl->s3->total_renegotiations != 0) { - goto no_renegotiation; - } - break; - - case ssl_renegotiate_never: - goto no_renegotiation; - - case ssl_renegotiate_freely: - break; - } - - // Renegotiation is only supported at quiescent points in the application - // protocol, namely in HTTPS, just before reading the HTTP response. Require - // the record-layer be idle and avoid complexities of sending a handshake - // record while an application_data record is being written. - if (!ssl->s3->write_buffer.empty() || - ssl->s3->write_shutdown != ssl_shutdown_none) { - goto no_renegotiation; - } - - // Begin a new handshake. - if (ssl->s3->hs != nullptr) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - ssl->s3->hs = ssl_handshake_new(ssl); - if (ssl->s3->hs == nullptr) { - return 0; - } - - ssl->s3->total_renegotiations++; - return 1; - -no_renegotiation: - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION); - return 0; -} - -static int ssl_read_impl(SSL *ssl) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); - return -1; - } - - // Replay post-handshake message errors. - if (!check_read_error(ssl)) { - return -1; - } - - while (ssl->s3->pending_app_data.empty()) { - // Complete the current handshake, if any. False Start will cause - // |SSL_do_handshake| to return mid-handshake, so this may require multiple - // iterations. - while (!ssl_can_read(ssl)) { - int ret = SSL_do_handshake(ssl); - if (ret < 0) { - return ret; - } - if (ret == 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); - return -1; - } - } - - // Process any buffered post-handshake messages. - SSLMessage msg; - if (ssl->method->get_message(ssl, &msg)) { - // If we received an interrupt in early read (EndOfEarlyData), loop again - // for the handshake to process it. - if (SSL_in_init(ssl)) { - ssl->s3->hs->can_early_read = false; - continue; - } - - // Handle the post-handshake message and try again. - if (!ssl_do_post_handshake(ssl, msg)) { - ssl_set_read_error(ssl); - return -1; - } - ssl->method->next_message(ssl); - continue; // Loop again. We may have begun a new handshake. - } - - uint8_t alert = SSL_AD_DECODE_ERROR; - size_t consumed = 0; - auto ret = ssl_open_app_data(ssl, &ssl->s3->pending_app_data, &consumed, - &alert, ssl->s3->read_buffer.span()); - bool retry; - int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert); - if (bio_ret <= 0) { - return bio_ret; - } - if (!retry) { - assert(!ssl->s3->pending_app_data.empty()); - ssl->s3->key_update_count = 0; - } - } - - return 1; -} - -int SSL_read(SSL *ssl, void *buf, int num) { - int ret = SSL_peek(ssl, buf, num); - if (ret <= 0) { - return ret; - } - // TODO(davidben): In DTLS, should the rest of the record be discarded? DTLS - // is not a stream. See https://crbug.com/boringssl/65. - ssl->s3->pending_app_data = - ssl->s3->pending_app_data.subspan(static_cast(ret)); - if (ssl->s3->pending_app_data.empty()) { - ssl->s3->read_buffer.DiscardConsumed(); - } - return ret; -} - -int SSL_peek(SSL *ssl, void *buf, int num) { - int ret = ssl_read_impl(ssl); - if (ret <= 0) { - return ret; - } - if (num <= 0) { - return num; - } - size_t todo = - std::min(ssl->s3->pending_app_data.size(), static_cast(num)); - OPENSSL_memcpy(buf, ssl->s3->pending_app_data.data(), todo); - return static_cast(todo); -} - -int SSL_write(SSL *ssl, const void *buf, int num) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); - return -1; - } - - if (ssl->s3->write_shutdown != ssl_shutdown_none) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); - return -1; - } - - int ret = 0; - bool needs_handshake = false; - do { - // If necessary, complete the handshake implicitly. - if (!ssl_can_write(ssl)) { - ret = SSL_do_handshake(ssl); - if (ret < 0) { - return ret; - } - if (ret == 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); - return -1; - } - } - - ret = ssl->method->write_app_data(ssl, &needs_handshake, - (const uint8_t *)buf, num); - } while (needs_handshake); - return ret; -} - -int SSL_shutdown(SSL *ssl) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); - return -1; - } - - // If we are in the middle of a handshake, silently succeed. Consumers often - // call this function before |SSL_free|, whether the handshake succeeded or - // not. We assume the caller has already handled failed handshakes. - if (SSL_in_init(ssl)) { - return 1; - } - - if (ssl->quiet_shutdown) { - // Do nothing if configured not to send a close_notify. - ssl->s3->write_shutdown = ssl_shutdown_close_notify; - ssl->s3->read_shutdown = ssl_shutdown_close_notify; - return 1; - } - - // This function completes in two stages. It sends a close_notify and then it - // waits for a close_notify to come in. Perform exactly one action and return - // whether or not it succeeds. - - if (ssl->s3->write_shutdown != ssl_shutdown_close_notify) { - // Send a close_notify. - if (ssl_send_alert(ssl, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY) <= 0) { - return -1; - } - } else if (ssl->s3->alert_dispatch) { - // Finish sending the close_notify. - if (ssl->method->dispatch_alert(ssl) <= 0) { - return -1; - } - } else if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { - if (SSL_is_dtls(ssl)) { - // Bidirectional shutdown doesn't make sense for an unordered - // transport. DTLS alerts also aren't delivered reliably, so we may even - // time out because the peer never received our close_notify. Report to - // the caller that the channel has fully shut down. - if (ssl->s3->read_shutdown == ssl_shutdown_error) { - ERR_restore_state(ssl->s3->read_error.get()); - return -1; - } - ssl->s3->read_shutdown = ssl_shutdown_close_notify; - } else { - // Keep discarding data until we see a close_notify. - for (;;) { - ssl->s3->pending_app_data = Span(); - int ret = ssl_read_impl(ssl); - if (ret <= 0) { - break; - } - } - if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { - return -1; - } - } - } - - // Return 0 for unidirectional shutdown and 1 for bidirectional shutdown. - return ssl->s3->read_shutdown == ssl_shutdown_close_notify; -} - -int SSL_send_fatal_alert(SSL *ssl, uint8_t alert) { - if (ssl->s3->alert_dispatch) { - if (ssl->s3->send_alert[0] != SSL3_AL_FATAL || - ssl->s3->send_alert[1] != alert) { - // We are already attempting to write a different alert. - OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); - return -1; - } - return ssl->method->dispatch_alert(ssl); - } - - return ssl_send_alert(ssl, SSL3_AL_FATAL, alert); -} - -int SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params, - size_t params_len) { - ssl->quic_transport_params = (uint8_t *)BUF_memdup(params, params_len); - if (!ssl->quic_transport_params) { - return 0; - } - ssl->quic_transport_params_len = params_len; - return 1; -} - -void SSL_get_peer_quic_transport_params(const SSL *ssl, - const uint8_t **out_params, - size_t *out_params_len) { - *out_params = ssl->s3->peer_quic_transport_params.data(); - *out_params_len = ssl->s3->peer_quic_transport_params.size(); -} - -void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled) { - ctx->cert->enable_early_data = !!enabled; -} - -void SSL_CTX_set_tls13_variant(SSL_CTX *ctx, enum tls13_variant_t variant) { - ctx->tls13_variant = variant; -} - -void SSL_set_tls13_variant(SSL *ssl, enum tls13_variant_t variant) { - ssl->tls13_variant = variant; -} - -void SSL_set_early_data_enabled(SSL *ssl, int enabled) { - ssl->cert->enable_early_data = !!enabled; -} - -int SSL_in_early_data(const SSL *ssl) { - if (ssl->s3->hs == NULL) { - return 0; - } - return ssl->s3->hs->in_early_data; -} - -int SSL_early_data_accepted(const SSL *ssl) { - return ssl->s3->early_data_accepted; -} - -void SSL_reset_early_data_reject(SSL *ssl) { - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - if (hs == NULL || - hs->wait != ssl_hs_early_data_rejected) { - abort(); - } - - hs->wait = ssl_hs_ok; - hs->in_early_data = false; - hs->early_session.reset(); - - // Discard any unfinished writes from the perspective of |SSL_write|'s - // retry. The handshake will transparently flush out the pending record - // (discarded by the server) to keep the framing correct. - ssl->s3->wpend_pending = false; -} - -static int bio_retry_reason_to_error(int reason) { - switch (reason) { - case BIO_RR_CONNECT: - return SSL_ERROR_WANT_CONNECT; - case BIO_RR_ACCEPT: - return SSL_ERROR_WANT_ACCEPT; - default: - return SSL_ERROR_SYSCALL; - } -} - -int SSL_get_error(const SSL *ssl, int ret_code) { - if (ret_code > 0) { - return SSL_ERROR_NONE; - } - - // Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc, - // where we do encode the error - uint32_t err = ERR_peek_error(); - if (err != 0) { - if (ERR_GET_LIB(err) == ERR_LIB_SYS) { - return SSL_ERROR_SYSCALL; - } - return SSL_ERROR_SSL; - } - - if (ret_code == 0) { - if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { - return SSL_ERROR_ZERO_RETURN; - } - // An EOF was observed which violates the protocol, and the underlying - // transport does not participate in the error queue. Bubble up to the - // caller. - return SSL_ERROR_SYSCALL; - } - - switch (ssl->s3->rwstate) { - case SSL_PENDING_SESSION: - return SSL_ERROR_PENDING_SESSION; - - case SSL_CERTIFICATE_SELECTION_PENDING: - return SSL_ERROR_PENDING_CERTIFICATE; - - case SSL_HANDOFF: - return SSL_ERROR_HANDOFF; - - case SSL_READING: { - BIO *bio = SSL_get_rbio(ssl); - if (BIO_should_read(bio)) { - return SSL_ERROR_WANT_READ; - } - - if (BIO_should_write(bio)) { - // TODO(davidben): OpenSSL historically checked for writes on the read - // BIO. Can this be removed? - return SSL_ERROR_WANT_WRITE; - } - - if (BIO_should_io_special(bio)) { - return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); - } - - break; - } - - case SSL_WRITING: { - BIO *bio = SSL_get_wbio(ssl); - if (BIO_should_write(bio)) { - return SSL_ERROR_WANT_WRITE; - } - - if (BIO_should_read(bio)) { - // TODO(davidben): OpenSSL historically checked for reads on the write - // BIO. Can this be removed? - return SSL_ERROR_WANT_READ; - } - - if (BIO_should_io_special(bio)) { - return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); - } - - break; - } - - case SSL_X509_LOOKUP: - return SSL_ERROR_WANT_X509_LOOKUP; - - case SSL_CHANNEL_ID_LOOKUP: - return SSL_ERROR_WANT_CHANNEL_ID_LOOKUP; - - case SSL_PRIVATE_KEY_OPERATION: - return SSL_ERROR_WANT_PRIVATE_KEY_OPERATION; - - case SSL_PENDING_TICKET: - return SSL_ERROR_PENDING_TICKET; - - case SSL_EARLY_DATA_REJECTED: - return SSL_ERROR_EARLY_DATA_REJECTED; - - case SSL_CERTIFICATE_VERIFY: - return SSL_ERROR_WANT_CERTIFICATE_VERIFY; - } - - return SSL_ERROR_SYSCALL; -} - -uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options) { - ctx->options |= options; - return ctx->options; -} - -uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options) { - ctx->options &= ~options; - return ctx->options; -} - -uint32_t SSL_CTX_get_options(const SSL_CTX *ctx) { return ctx->options; } - -uint32_t SSL_set_options(SSL *ssl, uint32_t options) { - ssl->options |= options; - return ssl->options; -} - -uint32_t SSL_clear_options(SSL *ssl, uint32_t options) { - ssl->options &= ~options; - return ssl->options; -} - -uint32_t SSL_get_options(const SSL *ssl) { return ssl->options; } - -uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode) { - ctx->mode |= mode; - return ctx->mode; -} - -uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode) { - ctx->mode &= ~mode; - return ctx->mode; -} - -uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx) { return ctx->mode; } - -uint32_t SSL_set_mode(SSL *ssl, uint32_t mode) { - ssl->mode |= mode; - return ssl->mode; -} - -uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode) { - ssl->mode &= ~mode; - return ssl->mode; -} - -uint32_t SSL_get_mode(const SSL *ssl) { return ssl->mode; } - -void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, CRYPTO_BUFFER_POOL *pool) { - ctx->pool = pool; -} - -int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, size_t *out_len, - size_t max_out) { - *out_len = 0; - OPENSSL_memset(out, 0, max_out); - - // tls-unique is not defined for SSL 3.0 or TLS 1.3. - if (!ssl->s3->initial_handshake_complete || - ssl_protocol_version(ssl) < TLS1_VERSION || - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 0; - } - - // The tls-unique value is the first Finished message in the handshake, which - // is the client's in a full handshake and the server's for a resumption. See - // https://tools.ietf.org/html/rfc5929#section-3.1. - const uint8_t *finished = ssl->s3->previous_client_finished; - size_t finished_len = ssl->s3->previous_client_finished_len; - if (ssl->session != NULL) { - // tls-unique is broken for resumed sessions unless EMS is used. - if (!ssl->session->extended_master_secret) { - return 0; - } - finished = ssl->s3->previous_server_finished; - finished_len = ssl->s3->previous_server_finished_len; - } - - *out_len = finished_len; - if (finished_len > max_out) { - *out_len = max_out; - } - - OPENSSL_memcpy(out, finished, *out_len); - return 1; -} - -static int set_session_id_context(CERT *cert, const uint8_t *sid_ctx, - size_t sid_ctx_len) { - if (sid_ctx_len > sizeof(cert->sid_ctx)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); - return 0; - } - - static_assert(sizeof(cert->sid_ctx) < 256, "sid_ctx too large"); - cert->sid_ctx_length = (uint8_t)sid_ctx_len; - OPENSSL_memcpy(cert->sid_ctx, sid_ctx, sid_ctx_len); - return 1; -} - -int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const uint8_t *sid_ctx, - size_t sid_ctx_len) { - return set_session_id_context(ctx->cert, sid_ctx, sid_ctx_len); -} - -int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, - size_t sid_ctx_len) { - return set_session_id_context(ssl->cert, sid_ctx, sid_ctx_len); -} - -const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len) { - *out_len = ssl->cert->sid_ctx_length; - return ssl->cert->sid_ctx; -} - -void SSL_certs_clear(SSL *ssl) { ssl_cert_clear_certs(ssl->cert); } - -int SSL_get_fd(const SSL *ssl) { return SSL_get_rfd(ssl); } - -int SSL_get_rfd(const SSL *ssl) { - int ret = -1; - BIO *b = BIO_find_type(SSL_get_rbio(ssl), BIO_TYPE_DESCRIPTOR); - if (b != NULL) { - BIO_get_fd(b, &ret); - } - return ret; -} - -int SSL_get_wfd(const SSL *ssl) { - int ret = -1; - BIO *b = BIO_find_type(SSL_get_wbio(ssl), BIO_TYPE_DESCRIPTOR); - if (b != NULL) { - BIO_get_fd(b, &ret); - } - return ret; -} - -int SSL_set_fd(SSL *ssl, int fd) { - BIO *bio = BIO_new(BIO_s_socket()); - if (bio == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); - return 0; - } - BIO_set_fd(bio, fd, BIO_NOCLOSE); - SSL_set_bio(ssl, bio, bio); - return 1; -} - -int SSL_set_wfd(SSL *ssl, int fd) { - BIO *rbio = SSL_get_rbio(ssl); - if (rbio == NULL || BIO_method_type(rbio) != BIO_TYPE_SOCKET || - BIO_get_fd(rbio, NULL) != fd) { - BIO *bio = BIO_new(BIO_s_socket()); - if (bio == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); - return 0; - } - BIO_set_fd(bio, fd, BIO_NOCLOSE); - SSL_set0_wbio(ssl, bio); - } else { - // Copy the rbio over to the wbio. - BIO_up_ref(rbio); - SSL_set0_wbio(ssl, rbio); - } - - return 1; -} - -int SSL_set_rfd(SSL *ssl, int fd) { - BIO *wbio = SSL_get_wbio(ssl); - if (wbio == NULL || BIO_method_type(wbio) != BIO_TYPE_SOCKET || - BIO_get_fd(wbio, NULL) != fd) { - BIO *bio = BIO_new(BIO_s_socket()); - if (bio == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); - return 0; - } - BIO_set_fd(bio, fd, BIO_NOCLOSE); - SSL_set0_rbio(ssl, bio); - } else { - // Copy the wbio over to the rbio. - BIO_up_ref(wbio); - SSL_set0_rbio(ssl, wbio); - } - return 1; -} - -static size_t copy_finished(void *out, size_t out_len, const uint8_t *in, - size_t in_len) { - if (out_len > in_len) { - out_len = in_len; - } - OPENSSL_memcpy(out, in, out_len); - return in_len; -} - -size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count) { - if (!ssl->s3->initial_handshake_complete || - ssl_protocol_version(ssl) < TLS1_VERSION || - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 0; - } - - if (ssl->server) { - return copy_finished(buf, count, ssl->s3->previous_server_finished, - ssl->s3->previous_server_finished_len); - } - - return copy_finished(buf, count, ssl->s3->previous_client_finished, - ssl->s3->previous_client_finished_len); -} - -size_t SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count) { - if (!ssl->s3->initial_handshake_complete || - ssl_protocol_version(ssl) < TLS1_VERSION || - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 0; - } - - if (ssl->server) { - return copy_finished(buf, count, ssl->s3->previous_client_finished, - ssl->s3->previous_client_finished_len); - } - - return copy_finished(buf, count, ssl->s3->previous_server_finished, - ssl->s3->previous_server_finished_len); -} - -int SSL_get_verify_mode(const SSL *ssl) { return ssl->verify_mode; } - -int SSL_get_extms_support(const SSL *ssl) { - // TLS 1.3 does not require extended master secret and always reports as - // supporting it. - if (!ssl->s3->have_version) { - return 0; - } - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 1; - } - - // If the initial handshake completed, query the established session. - if (ssl->s3->established_session != NULL) { - return ssl->s3->established_session->extended_master_secret; - } - - // Otherwise, query the in-progress handshake. - if (ssl->s3->hs != NULL) { - return ssl->s3->hs->extended_master_secret; - } - assert(0); - return 0; -} - -int SSL_CTX_get_read_ahead(const SSL_CTX *ctx) { return 0; } - -int SSL_get_read_ahead(const SSL *ssl) { return 0; } - -void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) { } - -void SSL_set_read_ahead(SSL *ssl, int yes) { } - -int SSL_pending(const SSL *ssl) { - return static_cast(ssl->s3->pending_app_data.size()); -} - -// Fix this so it checks all the valid key/cert options -int SSL_CTX_check_private_key(const SSL_CTX *ctx) { - return ssl_cert_check_private_key(ctx->cert, ctx->cert->privatekey); -} - -// Fix this function so that it takes an optional type parameter -int SSL_check_private_key(const SSL *ssl) { - return ssl_cert_check_private_key(ssl->cert, ssl->cert->privatekey); -} - -long SSL_get_default_timeout(const SSL *ssl) { - return SSL_DEFAULT_SESSION_TIMEOUT; -} - -int SSL_renegotiate(SSL *ssl) { - // Caller-initiated renegotiation is not supported. - OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; -} - -int SSL_renegotiate_pending(SSL *ssl) { - return SSL_in_init(ssl) && ssl->s3->initial_handshake_complete; -} - -int SSL_total_renegotiations(const SSL *ssl) { - return ssl->s3->total_renegotiations; -} - -size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx) { - return ctx->max_cert_list; -} - -void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, size_t max_cert_list) { - if (max_cert_list > kMaxHandshakeSize) { - max_cert_list = kMaxHandshakeSize; - } - ctx->max_cert_list = (uint32_t)max_cert_list; -} - -size_t SSL_get_max_cert_list(const SSL *ssl) { - return ssl->max_cert_list; -} - -void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list) { - if (max_cert_list > kMaxHandshakeSize) { - max_cert_list = kMaxHandshakeSize; - } - ssl->max_cert_list = (uint32_t)max_cert_list; -} - -int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, size_t max_send_fragment) { - if (max_send_fragment < 512) { - max_send_fragment = 512; - } - if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { - max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; - } - ctx->max_send_fragment = (uint16_t)max_send_fragment; - - return 1; -} - -int SSL_set_max_send_fragment(SSL *ssl, size_t max_send_fragment) { - if (max_send_fragment < 512) { - max_send_fragment = 512; - } - if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { - max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; - } - ssl->max_send_fragment = (uint16_t)max_send_fragment; - - return 1; -} - -int SSL_set_mtu(SSL *ssl, unsigned mtu) { - if (!SSL_is_dtls(ssl) || mtu < dtls1_min_mtu()) { - return 0; - } - ssl->d1->mtu = mtu; - return 1; -} - -int SSL_get_secure_renegotiation_support(const SSL *ssl) { - if (!ssl->s3->have_version) { - return 0; - } - return ssl_protocol_version(ssl) >= TLS1_3_VERSION || - ssl->s3->send_connection_binding; -} - -size_t SSL_CTX_sess_number(const SSL_CTX *ctx) { - MutexReadLock lock(const_cast(&ctx->lock)); - return lh_SSL_SESSION_num_items(ctx->sessions); -} - -unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, unsigned long size) { - unsigned long ret = ctx->session_cache_size; - ctx->session_cache_size = size; - return ret; -} - -unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx) { - return ctx->session_cache_size; -} - -int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode) { - int ret = ctx->session_cache_mode; - ctx->session_cache_mode = mode; - return ret; -} - -int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx) { - return ctx->session_cache_mode; -} - - -int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, size_t len) { - if (out == NULL) { - return 48; - } - if (len != 48) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); - return 0; - } - - // The default ticket keys are initialized lazily. Trigger a key - // rotation to initialize them. - if (!ssl_ctx_rotate_ticket_encryption_key(ctx)) { - return 0; - } - - uint8_t *out_bytes = reinterpret_cast(out); - MutexReadLock lock(&ctx->lock); - OPENSSL_memcpy(out_bytes, ctx->tlsext_ticket_key_current->name, 16); - OPENSSL_memcpy(out_bytes + 16, ctx->tlsext_ticket_key_current->hmac_key, 16); - OPENSSL_memcpy(out_bytes + 32, ctx->tlsext_ticket_key_current->aes_key, 16); - return 1; -} - -int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, size_t len) { - if (in == NULL) { - return 48; - } - if (len != 48) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); - return 0; - } - if (!ctx->tlsext_ticket_key_current) { - ctx->tlsext_ticket_key_current = - (tlsext_ticket_key *)OPENSSL_malloc(sizeof(tlsext_ticket_key)); - if (!ctx->tlsext_ticket_key_current) { - return 0; - } - } - OPENSSL_memset(ctx->tlsext_ticket_key_current, 0, sizeof(tlsext_ticket_key)); - const uint8_t *in_bytes = reinterpret_cast(in); - OPENSSL_memcpy(ctx->tlsext_ticket_key_current->name, in_bytes, 16); - OPENSSL_memcpy(ctx->tlsext_ticket_key_current->hmac_key, in_bytes + 16, 16); - OPENSSL_memcpy(ctx->tlsext_ticket_key_current->aes_key, in_bytes + 32, 16); - OPENSSL_free(ctx->tlsext_ticket_key_prev); - ctx->tlsext_ticket_key_prev = nullptr; - // Disable automatic key rotation. - ctx->tlsext_ticket_key_current->next_rotation_tv_sec = 0; - return 1; -} - -int SSL_CTX_set_tlsext_ticket_key_cb( - SSL_CTX *ctx, int (*callback)(SSL *ssl, uint8_t *key_name, uint8_t *iv, - EVP_CIPHER_CTX *ctx, HMAC_CTX *hmac_ctx, - int encrypt)) { - ctx->tlsext_ticket_key_cb = callback; - return 1; -} - -int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, size_t curves_len) { - return tls1_set_curves(&ctx->supported_group_list, - &ctx->supported_group_list_len, curves, - curves_len); -} - -int SSL_set1_curves(SSL *ssl, const int *curves, size_t curves_len) { - return tls1_set_curves(&ssl->supported_group_list, - &ssl->supported_group_list_len, curves, - curves_len); -} - -int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves) { - return tls1_set_curves_list(&ctx->supported_group_list, - &ctx->supported_group_list_len, curves); -} - -int SSL_set1_curves_list(SSL *ssl, const char *curves) { - return tls1_set_curves_list(&ssl->supported_group_list, - &ssl->supported_group_list_len, curves); -} - -uint16_t SSL_get_curve_id(const SSL *ssl) { - // TODO(davidben): This checks the wrong session if there is a renegotiation - // in progress. - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return 0; - } - - return session->group_id; -} - -int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh) { - return 1; -} - -int SSL_set_tmp_dh(SSL *ssl, const DH *dh) { - return 1; -} - -STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) { - return ctx->cipher_list->ciphers; -} - -int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i) { - if (i >= sk_SSL_CIPHER_num(ctx->cipher_list->ciphers)) { - return 0; - } - return ctx->cipher_list->in_group_flags[i]; -} - -STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl) { - if (ssl == NULL) { - return NULL; - } - - const struct ssl_cipher_preference_list_st *prefs = - ssl_get_cipher_preferences(ssl); - if (prefs == NULL) { - return NULL; - } - - return prefs->ciphers; -} - -const char *SSL_get_cipher_list(const SSL *ssl, int n) { - if (ssl == NULL) { - return NULL; - } - - STACK_OF(SSL_CIPHER) *sk = SSL_get_ciphers(ssl); - if (sk == NULL || n < 0 || (size_t)n >= sk_SSL_CIPHER_num(sk)) { - return NULL; - } - - const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, n); - if (c == NULL) { - return NULL; - } - - return c->name; -} - -int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) { - return ssl_create_cipher_list(&ctx->cipher_list, str, false /* not strict */); -} - -int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, const char *str) { - return ssl_create_cipher_list(&ctx->cipher_list, str, true /* strict */); -} - -int SSL_set_cipher_list(SSL *ssl, const char *str) { - return ssl_create_cipher_list(&ssl->cipher_list, str, false /* not strict */); -} - -int SSL_set_strict_cipher_list(SSL *ssl, const char *str) { - return ssl_create_cipher_list(&ssl->cipher_list, str, true /* strict */); -} - -const char *SSL_get_servername(const SSL *ssl, const int type) { - if (type != TLSEXT_NAMETYPE_host_name) { - return NULL; - } - - // Historically, |SSL_get_servername| was also the configuration getter - // corresponding to |SSL_set_tlsext_host_name|. - if (ssl->tlsext_hostname != NULL) { - return ssl->tlsext_hostname; - } - - return ssl->s3->hostname.get(); -} - -int SSL_get_servername_type(const SSL *ssl) { - if (SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name) == NULL) { - return -1; - } - return TLSEXT_NAMETYPE_host_name; -} - -void SSL_CTX_set_custom_verify( - SSL_CTX *ctx, int mode, - enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { - ctx->verify_mode = mode; - ctx->custom_verify_callback = callback; -} - -void SSL_set_custom_verify( - SSL *ssl, int mode, - enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { - ssl->verify_mode = mode; - ssl->custom_verify_callback = callback; -} - -void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx) { - ctx->signed_cert_timestamps_enabled = true; -} - -void SSL_enable_signed_cert_timestamps(SSL *ssl) { - ssl->signed_cert_timestamps_enabled = true; -} - -void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx) { - ctx->ocsp_stapling_enabled = true; -} - -void SSL_enable_ocsp_stapling(SSL *ssl) { - ssl->ocsp_stapling_enabled = true; -} - -void SSL_get0_signed_cert_timestamp_list(const SSL *ssl, const uint8_t **out, - size_t *out_len) { - SSL_SESSION *session = SSL_get_session(ssl); - if (ssl->server || !session || !session->signed_cert_timestamp_list) { - *out_len = 0; - *out = NULL; - return; - } - - *out = CRYPTO_BUFFER_data(session->signed_cert_timestamp_list); - *out_len = CRYPTO_BUFFER_len(session->signed_cert_timestamp_list); -} - -void SSL_get0_ocsp_response(const SSL *ssl, const uint8_t **out, - size_t *out_len) { - SSL_SESSION *session = SSL_get_session(ssl); - if (ssl->server || !session || !session->ocsp_response) { - *out_len = 0; - *out = NULL; - return; - } - - *out = CRYPTO_BUFFER_data(session->ocsp_response); - *out_len = CRYPTO_BUFFER_len(session->ocsp_response); -} - -int SSL_set_tlsext_host_name(SSL *ssl, const char *name) { - OPENSSL_free(ssl->tlsext_hostname); - ssl->tlsext_hostname = NULL; - - if (name == NULL) { - return 1; - } - - size_t len = strlen(name); - if (len == 0 || len > TLSEXT_MAXLEN_host_name) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME); - return 0; - } - ssl->tlsext_hostname = BUF_strdup(name); - if (ssl->tlsext_hostname == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - return 1; -} - -int SSL_CTX_set_tlsext_servername_callback( - SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)) { - ctx->tlsext_servername_callback = callback; - return 1; -} - -int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg) { - ctx->tlsext_servername_arg = arg; - return 1; -} - -int SSL_select_next_proto(uint8_t **out, uint8_t *out_len, const uint8_t *peer, - unsigned peer_len, const uint8_t *supported, - unsigned supported_len) { - const uint8_t *result; - int status; - - // For each protocol in peer preference order, see if we support it. - for (unsigned i = 0; i < peer_len;) { - for (unsigned j = 0; j < supported_len;) { - if (peer[i] == supported[j] && - OPENSSL_memcmp(&peer[i + 1], &supported[j + 1], peer[i]) == 0) { - // We found a match - result = &peer[i]; - status = OPENSSL_NPN_NEGOTIATED; - goto found; - } - j += supported[j]; - j++; - } - i += peer[i]; - i++; - } - - // There's no overlap between our protocols and the peer's list. - result = supported; - status = OPENSSL_NPN_NO_OVERLAP; - -found: - *out = (uint8_t *)result + 1; - *out_len = result[0]; - return status; -} - -void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data, - unsigned *out_len) { - *out_data = ssl->s3->next_proto_negotiated.data(); - *out_len = ssl->s3->next_proto_negotiated.size(); -} - -void SSL_CTX_set_next_protos_advertised_cb( - SSL_CTX *ctx, - int (*cb)(SSL *ssl, const uint8_t **out, unsigned *out_len, void *arg), - void *arg) { - ctx->next_protos_advertised_cb = cb; - ctx->next_protos_advertised_cb_arg = arg; -} - -void SSL_CTX_set_next_proto_select_cb( - SSL_CTX *ctx, int (*cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg), - void *arg) { - ctx->next_proto_select_cb = cb; - ctx->next_proto_select_cb_arg = arg; -} - -int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, - unsigned protos_len) { - OPENSSL_free(ctx->alpn_client_proto_list); - ctx->alpn_client_proto_list = (uint8_t *)BUF_memdup(protos, protos_len); - if (!ctx->alpn_client_proto_list) { - return 1; - } - ctx->alpn_client_proto_list_len = protos_len; - - return 0; -} - -int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, unsigned protos_len) { - OPENSSL_free(ssl->alpn_client_proto_list); - ssl->alpn_client_proto_list = (uint8_t *)BUF_memdup(protos, protos_len); - if (!ssl->alpn_client_proto_list) { - return 1; - } - ssl->alpn_client_proto_list_len = protos_len; - - return 0; -} - -void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, - int (*cb)(SSL *ssl, const uint8_t **out, - uint8_t *out_len, const uint8_t *in, - unsigned in_len, void *arg), - void *arg) { - ctx->alpn_select_cb = cb; - ctx->alpn_select_cb_arg = arg; -} - -void SSL_get0_alpn_selected(const SSL *ssl, const uint8_t **out_data, - unsigned *out_len) { - if (SSL_in_early_data(ssl) && !ssl->server) { - *out_data = ssl->s3->hs->early_session->early_alpn; - *out_len = ssl->s3->hs->early_session->early_alpn_len; - } else { - *out_data = ssl->s3->alpn_selected.data(); - *out_len = ssl->s3->alpn_selected.size(); - } -} - -void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled) { - ctx->allow_unknown_alpn_protos = !!enabled; -} - -void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, int enabled) { - ctx->tlsext_channel_id_enabled = !!enabled; -} - -int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx) { - SSL_CTX_set_tls_channel_id_enabled(ctx, 1); - return 1; -} - -void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled) { - ssl->tlsext_channel_id_enabled = !!enabled; -} - -int SSL_enable_tls_channel_id(SSL *ssl) { - SSL_set_tls_channel_id_enabled(ssl, 1); - return 1; -} - -static int is_p256_key(EVP_PKEY *private_key) { - const EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(private_key); - return ec_key != NULL && - EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)) == - NID_X9_62_prime256v1; -} - -int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, EVP_PKEY *private_key) { - if (!is_p256_key(private_key)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); - return 0; - } - - EVP_PKEY_free(ctx->tlsext_channel_id_private); - EVP_PKEY_up_ref(private_key); - ctx->tlsext_channel_id_private = private_key; - ctx->tlsext_channel_id_enabled = true; - - return 1; -} - -int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key) { - if (!is_p256_key(private_key)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); - return 0; - } - - EVP_PKEY_free(ssl->tlsext_channel_id_private); - EVP_PKEY_up_ref(private_key); - ssl->tlsext_channel_id_private = private_key; - ssl->tlsext_channel_id_enabled = true; - - return 1; -} - -size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, size_t max_out) { - if (!ssl->s3->tlsext_channel_id_valid) { - return 0; - } - OPENSSL_memcpy(out, ssl->s3->tlsext_channel_id, - (max_out < 64) ? max_out : 64); - return 64; -} - -int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, size_t len) { - if (len > 256) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - OPENSSL_free(ssl->token_binding_params); - ssl->token_binding_params = (uint8_t *)BUF_memdup(params, len); - if (!ssl->token_binding_params) { - return 0; - } - ssl->token_binding_params_len = len; - return 1; -} - -int SSL_is_token_binding_negotiated(const SSL *ssl) { - return ssl->token_binding_negotiated; -} - -uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl) { - return ssl->negotiated_token_binding_param; -} - -size_t SSL_get0_certificate_types(SSL *ssl, const uint8_t **out_types) { - if (ssl->server || ssl->s3->hs == NULL) { - *out_types = NULL; - return 0; - } - *out_types = ssl->s3->hs->certificate_types.data(); - return ssl->s3->hs->certificate_types.size(); -} - -EVP_PKEY *SSL_get_privatekey(const SSL *ssl) { - if (ssl->cert != NULL) { - return ssl->cert->privatekey; - } - - return NULL; -} - -EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx) { - if (ctx->cert != NULL) { - return ctx->cert->privatekey; - } - - return NULL; -} - -const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl) { - return ssl->s3->aead_write_ctx->cipher(); -} - -int SSL_session_reused(const SSL *ssl) { - return ssl->s3->session_reused || SSL_in_early_data(ssl); -} - -const COMP_METHOD *SSL_get_current_compression(SSL *ssl) { return NULL; } - -const COMP_METHOD *SSL_get_current_expansion(SSL *ssl) { return NULL; } - -int *SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key) { return 0; } - -void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode) { - ctx->quiet_shutdown = (mode != 0); -} - -int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx) { - return ctx->quiet_shutdown; -} - -void SSL_set_quiet_shutdown(SSL *ssl, int mode) { - ssl->quiet_shutdown = (mode != 0); -} - -int SSL_get_quiet_shutdown(const SSL *ssl) { return ssl->quiet_shutdown; } - -void SSL_set_shutdown(SSL *ssl, int mode) { - // It is an error to clear any bits that have already been set. (We can't try - // to get a second close_notify or send two.) - assert((SSL_get_shutdown(ssl) & mode) == SSL_get_shutdown(ssl)); - - if (mode & SSL_RECEIVED_SHUTDOWN && - ssl->s3->read_shutdown == ssl_shutdown_none) { - ssl->s3->read_shutdown = ssl_shutdown_close_notify; - } - - if (mode & SSL_SENT_SHUTDOWN && - ssl->s3->write_shutdown == ssl_shutdown_none) { - ssl->s3->write_shutdown = ssl_shutdown_close_notify; - } -} - -int SSL_get_shutdown(const SSL *ssl) { - int ret = 0; - if (ssl->s3->read_shutdown != ssl_shutdown_none) { - // Historically, OpenSSL set |SSL_RECEIVED_SHUTDOWN| on both close_notify - // and fatal alert. - ret |= SSL_RECEIVED_SHUTDOWN; - } - if (ssl->s3->write_shutdown == ssl_shutdown_close_notify) { - // Historically, OpenSSL set |SSL_SENT_SHUTDOWN| on only close_notify. - ret |= SSL_SENT_SHUTDOWN; - } - return ret; -} - -SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl) { return ssl->ctx; } - -SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) { - if (ssl->ctx == ctx) { - return ssl->ctx; - } - - // One cannot change the X.509 callbacks during a connection. - if (ssl->ctx->x509_method != ctx->x509_method) { - assert(0); - return NULL; - } - - if (ctx == NULL) { - ctx = ssl->session_ctx; - } - - ssl_cert_free(ssl->cert); - ssl->cert = ssl_cert_dup(ctx->cert); - - SSL_CTX_up_ref(ctx); - SSL_CTX_free(ssl->ctx); - ssl->ctx = ctx; - - return ssl->ctx; -} - -void SSL_set_info_callback(SSL *ssl, - void (*cb)(const SSL *ssl, int type, int value)) { - ssl->info_callback = cb; -} - -void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, - int value) { - return ssl->info_callback; -} - -int SSL_state(const SSL *ssl) { - return SSL_in_init(ssl) ? SSL_ST_INIT : SSL_ST_OK; -} - -void SSL_set_state(SSL *ssl, int state) { } - -char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len) { - if (len <= 0) { - return NULL; - } - buf[0] = '\0'; - return buf; -} - -int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, - CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func) { - int index; - if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl, &index, argl, argp, - free_func)) { - return -1; - } - return index; -} - -int SSL_set_ex_data(SSL *ssl, int idx, void *data) { - return CRYPTO_set_ex_data(&ssl->ex_data, idx, data); -} - -void *SSL_get_ex_data(const SSL *ssl, int idx) { - return CRYPTO_get_ex_data(&ssl->ex_data, idx); -} - -int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, - CRYPTO_EX_dup *dup_unused, - CRYPTO_EX_free *free_func) { - int index; - if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl_ctx, &index, argl, argp, - free_func)) { - return -1; - } - return index; -} - -int SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data) { - return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); -} - -void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) { - return CRYPTO_get_ex_data(&ctx->ex_data, idx); -} - -int SSL_want(const SSL *ssl) { return ssl->s3->rwstate; } - -void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, - RSA *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -void SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, - DH *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -static int use_psk_identity_hint(char **out, const char *identity_hint) { - if (identity_hint != NULL && strlen(identity_hint) > PSK_MAX_IDENTITY_LEN) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); - return 0; - } - - // Clear currently configured hint, if any. - OPENSSL_free(*out); - *out = NULL; - - // Treat the empty hint as not supplying one. Plain PSK makes it possible to - // send either no hint (omit ServerKeyExchange) or an empty hint, while - // ECDHE_PSK can only spell empty hint. Having different capabilities is odd, - // so we interpret empty and missing as identical. - if (identity_hint != NULL && identity_hint[0] != '\0') { - *out = BUF_strdup(identity_hint); - if (*out == NULL) { - return 0; - } - } - - return 1; -} - -int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint) { - return use_psk_identity_hint(&ctx->psk_identity_hint, identity_hint); -} - -int SSL_use_psk_identity_hint(SSL *ssl, const char *identity_hint) { - return use_psk_identity_hint(&ssl->psk_identity_hint, identity_hint); -} - -const char *SSL_get_psk_identity_hint(const SSL *ssl) { - if (ssl == NULL) { - return NULL; - } - return ssl->psk_identity_hint; -} - -const char *SSL_get_psk_identity(const SSL *ssl) { - if (ssl == NULL) { - return NULL; - } - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return NULL; - } - return session->psk_identity; -} - -void SSL_set_psk_client_callback( - SSL *ssl, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, - unsigned max_identity_len, uint8_t *psk, - unsigned max_psk_len)) { - ssl->psk_client_callback = cb; -} - -void SSL_CTX_set_psk_client_callback( - SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, - unsigned max_identity_len, uint8_t *psk, - unsigned max_psk_len)) { - ctx->psk_client_callback = cb; -} - -void SSL_set_psk_server_callback( - SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, - unsigned max_psk_len)) { - ssl->psk_server_callback = cb; -} - -void SSL_CTX_set_psk_server_callback( - SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, - uint8_t *psk, unsigned max_psk_len)) { - ctx->psk_server_callback = cb; -} - -int SSL_set_dummy_pq_padding_size(SSL *ssl, size_t num_bytes) { - if (num_bytes > 0xffff) { - return 0; - } - - ssl->dummy_pq_padding_len = num_bytes; - return 1; -} - -int SSL_dummy_pq_padding_used(SSL *ssl) { - if (ssl->server) { - return 0; - } - - return ssl->did_dummy_pq_padding; -} - -void SSL_CTX_set_msg_callback(SSL_CTX *ctx, - void (*cb)(int write_p, int version, - int content_type, const void *buf, - size_t len, SSL *ssl, void *arg)) { - ctx->msg_callback = cb; -} - -void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg) { - ctx->msg_callback_arg = arg; -} - -void SSL_set_msg_callback(SSL *ssl, - void (*cb)(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, - void *arg)) { - ssl->msg_callback = cb; -} - -void SSL_set_msg_callback_arg(SSL *ssl, void *arg) { - ssl->msg_callback_arg = arg; -} - -void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, - void (*cb)(const SSL *ssl, const char *line)) { - ctx->keylog_callback = cb; -} - -void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))(const SSL *ssl, - const char *line) { - return ctx->keylog_callback; -} - -void SSL_CTX_set_current_time_cb(SSL_CTX *ctx, - void (*cb)(const SSL *ssl, - struct timeval *out_clock)) { - ctx->current_time_cb = cb; -} - -int SSL_is_init_finished(const SSL *ssl) { - return !SSL_in_init(ssl); -} - -int SSL_in_init(const SSL *ssl) { - // This returns false once all the handshake state has been finalized, to - // allow callbacks and getters based on SSL_in_init to return the correct - // values. - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - return hs != nullptr && !hs->handshake_finalized; -} - -int SSL_in_false_start(const SSL *ssl) { - if (ssl->s3->hs == NULL) { - return 0; - } - return ssl->s3->hs->in_false_start; -} - -int SSL_cutthrough_complete(const SSL *ssl) { - return SSL_in_false_start(ssl); -} - -void SSL_get_structure_sizes(size_t *ssl_size, size_t *ssl_ctx_size, - size_t *ssl_session_size) { - *ssl_size = sizeof(SSL); - *ssl_ctx_size = sizeof(SSL_CTX); - *ssl_session_size = sizeof(SSL_SESSION); -} - -int SSL_is_server(const SSL *ssl) { return ssl->server; } - -int SSL_is_dtls(const SSL *ssl) { return ssl->method->is_dtls; } - -void SSL_CTX_set_select_certificate_cb( - SSL_CTX *ctx, - enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)) { - ctx->select_certificate_cb = cb; -} - -void SSL_CTX_set_dos_protection_cb(SSL_CTX *ctx, - int (*cb)(const SSL_CLIENT_HELLO *)) { - ctx->dos_protection_cb = cb; -} - -void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode) { - ssl->renegotiate_mode = mode; -} - -int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, - const uint8_t **out_write_iv, size_t *out_iv_len) { - size_t write_iv_len; - if (!ssl->s3->aead_read_ctx->GetIV(out_read_iv, out_iv_len) || - !ssl->s3->aead_write_ctx->GetIV(out_write_iv, &write_iv_len) || - *out_iv_len != write_iv_len) { - return 0; - } - - return 1; -} - -static uint64_t be_to_u64(const uint8_t in[8]) { - return (((uint64_t)in[0]) << 56) | (((uint64_t)in[1]) << 48) | - (((uint64_t)in[2]) << 40) | (((uint64_t)in[3]) << 32) | - (((uint64_t)in[4]) << 24) | (((uint64_t)in[5]) << 16) | - (((uint64_t)in[6]) << 8) | ((uint64_t)in[7]); -} - -uint64_t SSL_get_read_sequence(const SSL *ssl) { - // TODO(davidben): Internally represent sequence numbers as uint64_t. - if (SSL_is_dtls(ssl)) { - // max_seq_num already includes the epoch. - assert(ssl->d1->r_epoch == (ssl->d1->bitmap.max_seq_num >> 48)); - return ssl->d1->bitmap.max_seq_num; - } - return be_to_u64(ssl->s3->read_sequence); -} - -uint64_t SSL_get_write_sequence(const SSL *ssl) { - uint64_t ret = be_to_u64(ssl->s3->write_sequence); - if (SSL_is_dtls(ssl)) { - assert((ret >> 48) == 0); - ret |= ((uint64_t)ssl->d1->w_epoch) << 48; - } - return ret; -} - -uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl) { - // TODO(davidben): This checks the wrong session if there is a renegotiation - // in progress. - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return 0; - } - - return session->peer_signature_algorithm; -} - -size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, size_t max_out) { - if (max_out == 0) { - return sizeof(ssl->s3->client_random); - } - if (max_out > sizeof(ssl->s3->client_random)) { - max_out = sizeof(ssl->s3->client_random); - } - OPENSSL_memcpy(out, ssl->s3->client_random, max_out); - return max_out; -} - -size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, size_t max_out) { - if (max_out == 0) { - return sizeof(ssl->s3->server_random); - } - if (max_out > sizeof(ssl->s3->server_random)) { - max_out = sizeof(ssl->s3->server_random); - } - OPENSSL_memcpy(out, ssl->s3->server_random, max_out); - return max_out; -} - -const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl) { - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - if (hs == NULL) { - return NULL; - } - return hs->new_cipher; -} - -void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enabled) { - ssl->retain_only_sha256_of_client_certs = !!enabled; -} - -void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enabled) { - ctx->retain_only_sha256_of_client_certs = !!enabled; -} - -void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled) { - ctx->grease_enabled = !!enabled; -} - -int32_t SSL_get_ticket_age_skew(const SSL *ssl) { - return ssl->s3->ticket_age_skew; -} - -void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed) { - ctx->false_start_allowed_without_alpn = !!allowed; -} - -int SSL_is_draft_downgrade(const SSL *ssl) { return ssl->s3->draft_downgrade; } - -int SSL_clear(SSL *ssl) { - // In OpenSSL, reusing a client |SSL| with |SSL_clear| causes the previously - // established session to be offered the next time around. wpa_supplicant - // depends on this behavior, so emulate it. - UniquePtr session; - if (!ssl->server && ssl->s3->established_session != NULL) { - session.reset(ssl->s3->established_session.get()); - SSL_SESSION_up_ref(session.get()); - } - - // The ssl->d1->mtu is simultaneously configuration (preserved across - // clear) and connection-specific state (gets reset). - // - // TODO(davidben): Avoid this. - unsigned mtu = 0; - if (ssl->d1 != NULL) { - mtu = ssl->d1->mtu; - } - - ssl->method->ssl_free(ssl); - if (!ssl->method->ssl_new(ssl)) { - return 0; - } - - if (SSL_is_dtls(ssl) && (SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { - ssl->d1->mtu = mtu; - } - - if (session != nullptr) { - SSL_set_session(ssl, session.get()); - } - - return 1; -} - -int SSL_CTX_sess_connect(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_connect_good(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_accept(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_accept_good(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_hits(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_misses(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_timeouts(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_cache_full(const SSL_CTX *ctx) { return 0; } - -int SSL_num_renegotiations(const SSL *ssl) { - return SSL_total_renegotiations(ssl); -} - -int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx) { return 0; } -int SSL_need_tmp_RSA(const SSL *ssl) { return 0; } -int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa) { return 1; } -int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa) { return 1; } -void ERR_load_SSL_strings(void) {} -void SSL_load_error_strings(void) {} -int SSL_cache_hit(SSL *ssl) { return SSL_session_reused(ssl); } - -int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key) { - if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); - return SSL_CTX_set1_curves(ctx, &nid, 1); -} - -int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key) { - if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); - return SSL_set1_curves(ssl, &nid, 1); -} - -void SSL_CTX_set_ticket_aead_method(SSL_CTX *ctx, - const SSL_TICKET_AEAD_METHOD *aead_method) { - ctx->ticket_aead_method = aead_method; -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_lib.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/ssl_lib.cc.grpc_back deleted file mode 100644 index ef7983119..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_lib.cc.grpc_back +++ /dev/null @@ -1,2719 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. - * ECC cipher suite support in OpenSSL originally developed by - * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. */ - -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - -#if defined(OPENSSL_WINDOWS) -#include -#else -#include -#include -#endif - - -namespace bssl { - -// |SSL_R_UNKNOWN_PROTOCOL| is no longer emitted, but continue to define it -// to avoid downstream churn. -OPENSSL_DECLARE_ERROR_REASON(SSL, UNKNOWN_PROTOCOL) - -// The following errors are no longer emitted, but are used in nginx without -// #ifdefs. -OPENSSL_DECLARE_ERROR_REASON(SSL, BLOCK_CIPHER_PAD_IS_WRONG) -OPENSSL_DECLARE_ERROR_REASON(SSL, NO_CIPHERS_SPECIFIED) - -// Some error codes are special. Ensure the make_errors.go script never -// regresses this. -static_assert(SSL_R_TLSV1_ALERT_NO_RENEGOTIATION == - SSL_AD_NO_RENEGOTIATION + SSL_AD_REASON_OFFSET, - "alert reason code mismatch"); - -// kMaxHandshakeSize is the maximum size, in bytes, of a handshake message. -static const size_t kMaxHandshakeSize = (1u << 24) - 1; - -static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl = - CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; -static CRYPTO_EX_DATA_CLASS g_ex_data_class_ssl_ctx = - CRYPTO_EX_DATA_CLASS_INIT_WITH_APP_DATA; - -bool CBBFinishArray(CBB *cbb, Array *out) { - uint8_t *ptr; - size_t len; - if (!CBB_finish(cbb, &ptr, &len)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - out->Reset(ptr, len); - return true; -} - -void ssl_reset_error_state(SSL *ssl) { - // Functions which use |SSL_get_error| must reset I/O and error state on - // entry. - ssl->s3->rwstate = SSL_NOTHING; - ERR_clear_error(); - ERR_clear_system_error(); -} - -void ssl_set_read_error(SSL* ssl) { - ssl->s3->read_shutdown = ssl_shutdown_error; - ssl->s3->read_error.reset(ERR_save_state()); -} - -static bool check_read_error(const SSL *ssl) { - if (ssl->s3->read_shutdown == ssl_shutdown_error) { - ERR_restore_state(ssl->s3->read_error.get()); - return false; - } - return true; -} - -int ssl_can_write(const SSL *ssl) { - return !SSL_in_init(ssl) || ssl->s3->hs->can_early_write; -} - -int ssl_can_read(const SSL *ssl) { - return !SSL_in_init(ssl) || ssl->s3->hs->can_early_read; -} - -ssl_open_record_t ssl_open_handshake(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, Span in) { - *out_consumed = 0; - if (!check_read_error(ssl)) { - *out_alert = 0; - return ssl_open_record_error; - } - auto ret = ssl->method->open_handshake(ssl, out_consumed, out_alert, in); - if (ret == ssl_open_record_error) { - ssl_set_read_error(ssl); - } - return ret; -} - -ssl_open_record_t ssl_open_change_cipher_spec(SSL *ssl, size_t *out_consumed, - uint8_t *out_alert, - Span in) { - *out_consumed = 0; - if (!check_read_error(ssl)) { - *out_alert = 0; - return ssl_open_record_error; - } - auto ret = - ssl->method->open_change_cipher_spec(ssl, out_consumed, out_alert, in); - if (ret == ssl_open_record_error) { - ssl_set_read_error(ssl); - } - return ret; -} - -ssl_open_record_t ssl_open_app_data(SSL *ssl, Span *out, - size_t *out_consumed, uint8_t *out_alert, - Span in) { - *out_consumed = 0; - if (!check_read_error(ssl)) { - *out_alert = 0; - return ssl_open_record_error; - } - auto ret = ssl->method->open_app_data(ssl, out, out_consumed, out_alert, in); - if (ret == ssl_open_record_error) { - ssl_set_read_error(ssl); - } - return ret; -} - -void ssl_cipher_preference_list_free( - struct ssl_cipher_preference_list_st *cipher_list) { - if (cipher_list == NULL) { - return; - } - sk_SSL_CIPHER_free(cipher_list->ciphers); - OPENSSL_free(cipher_list->in_group_flags); - OPENSSL_free(cipher_list); -} - -void ssl_update_cache(SSL_HANDSHAKE *hs, int mode) { - SSL *const ssl = hs->ssl; - SSL_CTX *ctx = ssl->session_ctx; - // Never cache sessions with empty session IDs. - if (ssl->s3->established_session->session_id_length == 0 || - ssl->s3->established_session->not_resumable || - (ctx->session_cache_mode & mode) != mode) { - return; - } - - // Clients never use the internal session cache. - int use_internal_cache = ssl->server && !(ctx->session_cache_mode & - SSL_SESS_CACHE_NO_INTERNAL_STORE); - - // A client may see new sessions on abbreviated handshakes if the server - // decides to renew the ticket. Once the handshake is completed, it should be - // inserted into the cache. - if (ssl->s3->established_session.get() != ssl->session || - (!ssl->server && hs->ticket_expected)) { - if (use_internal_cache) { - SSL_CTX_add_session(ctx, ssl->s3->established_session.get()); - } - if (ctx->new_session_cb != NULL) { - SSL_SESSION_up_ref(ssl->s3->established_session.get()); - if (!ctx->new_session_cb(ssl, ssl->s3->established_session.get())) { - // |new_session_cb|'s return value signals whether it took ownership. - SSL_SESSION_free(ssl->s3->established_session.get()); - } - } - } - - if (use_internal_cache && - !(ctx->session_cache_mode & SSL_SESS_CACHE_NO_AUTO_CLEAR)) { - // Automatically flush the internal session cache every 255 connections. - int flush_cache = 0; - CRYPTO_MUTEX_lock_write(&ctx->lock); - ctx->handshakes_since_cache_flush++; - if (ctx->handshakes_since_cache_flush >= 255) { - flush_cache = 1; - ctx->handshakes_since_cache_flush = 0; - } - CRYPTO_MUTEX_unlock_write(&ctx->lock); - - if (flush_cache) { - struct OPENSSL_timeval now; - ssl_get_current_time(ssl, &now); - SSL_CTX_flush_sessions(ctx, now.tv_sec); - } - } -} - -static int cbb_add_hex(CBB *cbb, const uint8_t *in, size_t in_len) { - static const char hextable[] = "0123456789abcdef"; - uint8_t *out; - - if (!CBB_add_space(cbb, &out, in_len * 2)) { - return 0; - } - - for (size_t i = 0; i < in_len; i++) { - *(out++) = (uint8_t)hextable[in[i] >> 4]; - *(out++) = (uint8_t)hextable[in[i] & 0xf]; - } - - return 1; -} - -int ssl_log_secret(const SSL *ssl, const char *label, const uint8_t *secret, - size_t secret_len) { - if (ssl->ctx->keylog_callback == NULL) { - return 1; - } - - ScopedCBB cbb; - uint8_t *out; - size_t out_len; - if (!CBB_init(cbb.get(), strlen(label) + 1 + SSL3_RANDOM_SIZE * 2 + 1 + - secret_len * 2 + 1) || - !CBB_add_bytes(cbb.get(), (const uint8_t *)label, strlen(label)) || - !CBB_add_bytes(cbb.get(), (const uint8_t *)" ", 1) || - !cbb_add_hex(cbb.get(), ssl->s3->client_random, SSL3_RANDOM_SIZE) || - !CBB_add_bytes(cbb.get(), (const uint8_t *)" ", 1) || - !cbb_add_hex(cbb.get(), secret, secret_len) || - !CBB_add_u8(cbb.get(), 0 /* NUL */) || - !CBB_finish(cbb.get(), &out, &out_len)) { - return 0; - } - - ssl->ctx->keylog_callback(ssl, (const char *)out); - OPENSSL_free(out); - return 1; -} - -void ssl_do_info_callback(const SSL *ssl, int type, int value) { - void (*cb)(const SSL *ssl, int type, int value) = NULL; - if (ssl->info_callback != NULL) { - cb = ssl->info_callback; - } else if (ssl->ctx->info_callback != NULL) { - cb = ssl->ctx->info_callback; - } - - if (cb != NULL) { - cb(ssl, type, value); - } -} - -void ssl_do_msg_callback(SSL *ssl, int is_write, int content_type, - Span in) { - if (ssl->msg_callback == NULL) { - return; - } - - // |version| is zero when calling for |SSL3_RT_HEADER| and |SSL2_VERSION| for - // a V2ClientHello. - int version; - switch (content_type) { - case 0: - // V2ClientHello - version = SSL2_VERSION; - break; - case SSL3_RT_HEADER: - version = 0; - break; - default: - version = SSL_version(ssl); - } - - ssl->msg_callback(is_write, version, content_type, in.data(), in.size(), ssl, - ssl->msg_callback_arg); -} - -void ssl_get_current_time(const SSL *ssl, struct OPENSSL_timeval *out_clock) { - // TODO(martinkr): Change callers to |ssl_ctx_get_current_time| and drop the - // |ssl| arg from |current_time_cb| if possible. - ssl_ctx_get_current_time(ssl->ctx, out_clock); -} - -void ssl_ctx_get_current_time(const SSL_CTX *ctx, - struct OPENSSL_timeval *out_clock) { - if (ctx->current_time_cb != NULL) { - // TODO(davidben): Update current_time_cb to use OPENSSL_timeval. See - // https://crbug.com/boringssl/155. - struct timeval clock; - ctx->current_time_cb(nullptr /* ssl */, &clock); - if (clock.tv_sec < 0) { - assert(0); - out_clock->tv_sec = 0; - out_clock->tv_usec = 0; - } else { - out_clock->tv_sec = (uint64_t)clock.tv_sec; - out_clock->tv_usec = (uint32_t)clock.tv_usec; - } - return; - } - -#if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) - out_clock->tv_sec = 1234; - out_clock->tv_usec = 1234; -#elif defined(OPENSSL_WINDOWS) - struct _timeb time; - _ftime(&time); - if (time.time < 0) { - assert(0); - out_clock->tv_sec = 0; - out_clock->tv_usec = 0; - } else { - out_clock->tv_sec = time.time; - out_clock->tv_usec = time.millitm * 1000; - } -#else - struct timeval clock; - gettimeofday(&clock, NULL); - if (clock.tv_sec < 0) { - assert(0); - out_clock->tv_sec = 0; - out_clock->tv_usec = 0; - } else { - out_clock->tv_sec = (uint64_t)clock.tv_sec; - out_clock->tv_usec = (uint32_t)clock.tv_usec; - } -#endif -} - -void SSL_CTX_set_handoff_mode(SSL_CTX *ctx, bool on) { - ctx->handoff = on; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_library_init(void) { - CRYPTO_library_init(); - return 1; -} - -int OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings) { - CRYPTO_library_init(); - return 1; -} - -static uint32_t ssl_session_hash(const SSL_SESSION *sess) { - const uint8_t *session_id = sess->session_id; - - uint8_t tmp_storage[sizeof(uint32_t)]; - if (sess->session_id_length < sizeof(tmp_storage)) { - OPENSSL_memset(tmp_storage, 0, sizeof(tmp_storage)); - OPENSSL_memcpy(tmp_storage, sess->session_id, sess->session_id_length); - session_id = tmp_storage; - } - - uint32_t hash = - ((uint32_t)session_id[0]) | - ((uint32_t)session_id[1] << 8) | - ((uint32_t)session_id[2] << 16) | - ((uint32_t)session_id[3] << 24); - - return hash; -} - -// NB: If this function (or indeed the hash function which uses a sort of -// coarser function than this one) is changed, ensure -// SSL_CTX_has_matching_session_id() is checked accordingly. It relies on being -// able to construct an SSL_SESSION that will collide with any existing session -// with a matching session ID. -static int ssl_session_cmp(const SSL_SESSION *a, const SSL_SESSION *b) { - if (a->ssl_version != b->ssl_version) { - return 1; - } - - if (a->session_id_length != b->session_id_length) { - return 1; - } - - return OPENSSL_memcmp(a->session_id, b->session_id, a->session_id_length); -} - -SSL_CTX *SSL_CTX_new(const SSL_METHOD *method) { - SSL_CTX *ret = NULL; - - if (method == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_METHOD_PASSED); - return NULL; - } - - ret = (SSL_CTX *)OPENSSL_malloc(sizeof(SSL_CTX)); - if (ret == NULL) { - goto err; - } - - OPENSSL_memset(ret, 0, sizeof(SSL_CTX)); - - ret->method = method->method; - ret->x509_method = method->x509_method; - - CRYPTO_MUTEX_init(&ret->lock); - - ret->session_cache_mode = SSL_SESS_CACHE_SERVER; - ret->session_cache_size = SSL_SESSION_CACHE_MAX_SIZE_DEFAULT; - - ret->session_timeout = SSL_DEFAULT_SESSION_TIMEOUT; - ret->session_psk_dhe_timeout = SSL_DEFAULT_SESSION_PSK_DHE_TIMEOUT; - - ret->references = 1; - - ret->max_cert_list = SSL_MAX_CERT_LIST_DEFAULT; - ret->verify_mode = SSL_VERIFY_NONE; - ret->cert = ssl_cert_new(method->x509_method); - if (ret->cert == NULL) { - goto err; - } - - ret->sessions = lh_SSL_SESSION_new(ssl_session_hash, ssl_session_cmp); - if (ret->sessions == NULL) { - goto err; - } - - if (!ret->x509_method->ssl_ctx_new(ret)) { - goto err; - } - - if (!SSL_CTX_set_strict_cipher_list(ret, SSL_DEFAULT_CIPHER_LIST)) { - goto err2; - } - - ret->client_CA = sk_CRYPTO_BUFFER_new_null(); - if (ret->client_CA == NULL) { - goto err; - } - - CRYPTO_new_ex_data(&ret->ex_data); - - ret->max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; - - // Disable the auto-chaining feature by default. Once this has stuck without - // problems, the feature will be removed entirely. - ret->mode = SSL_MODE_NO_AUTO_CHAIN; - - // Lock the SSL_CTX to the specified version, for compatibility with legacy - // uses of SSL_METHOD. - if (!SSL_CTX_set_max_proto_version(ret, method->version) || - !SSL_CTX_set_min_proto_version(ret, method->version)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - goto err2; - } - - return ret; - -err: - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); -err2: - SSL_CTX_free(ret); - return NULL; -} - -int SSL_CTX_up_ref(SSL_CTX *ctx) { - CRYPTO_refcount_inc(&ctx->references); - return 1; -} - -void SSL_CTX_free(SSL_CTX *ctx) { - if (ctx == NULL || - !CRYPTO_refcount_dec_and_test_zero(&ctx->references)) { - return; - } - - // Free internal session cache. However: the remove_cb() may reference the - // ex_data of SSL_CTX, thus the ex_data store can only be removed after the - // sessions were flushed. As the ex_data handling routines might also touch - // the session cache, the most secure solution seems to be: empty (flush) the - // cache, then free ex_data, then finally free the cache. (See ticket - // [openssl.org #212].) - SSL_CTX_flush_sessions(ctx, 0); - - CRYPTO_free_ex_data(&g_ex_data_class_ssl_ctx, ctx, &ctx->ex_data); - - CRYPTO_MUTEX_cleanup(&ctx->lock); - lh_SSL_SESSION_free(ctx->sessions); - ssl_cipher_preference_list_free(ctx->cipher_list); - ssl_cert_free(ctx->cert); - sk_SSL_CUSTOM_EXTENSION_pop_free(ctx->client_custom_extensions, - SSL_CUSTOM_EXTENSION_free); - sk_SSL_CUSTOM_EXTENSION_pop_free(ctx->server_custom_extensions, - SSL_CUSTOM_EXTENSION_free); - sk_CRYPTO_BUFFER_pop_free(ctx->client_CA, CRYPTO_BUFFER_free); - ctx->x509_method->ssl_ctx_free(ctx); - sk_SRTP_PROTECTION_PROFILE_free(ctx->srtp_profiles); - OPENSSL_free(ctx->psk_identity_hint); - OPENSSL_free(ctx->supported_group_list); - OPENSSL_free(ctx->alpn_client_proto_list); - EVP_PKEY_free(ctx->tlsext_channel_id_private); - OPENSSL_free(ctx->verify_sigalgs); - OPENSSL_free(ctx->tlsext_ticket_key_current); - OPENSSL_free(ctx->tlsext_ticket_key_prev); - - OPENSSL_free(ctx); -} - -SSL *SSL_new(SSL_CTX *ctx) { - if (ctx == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NULL_SSL_CTX); - return NULL; - } - if (ctx->method == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION); - return NULL; - } - - SSL *ssl = (SSL *)OPENSSL_malloc(sizeof(SSL)); - if (ssl == NULL) { - goto err; - } - OPENSSL_memset(ssl, 0, sizeof(SSL)); - - ssl->conf_min_version = ctx->conf_min_version; - ssl->conf_max_version = ctx->conf_max_version; - ssl->tls13_variant = ctx->tls13_variant; - - // RFC 6347 states that implementations SHOULD use an initial timer value of - // 1 second. - ssl->initial_timeout_duration_ms = 1000; - - ssl->options = ctx->options; - ssl->mode = ctx->mode; - ssl->max_cert_list = ctx->max_cert_list; - - ssl->cert = ssl_cert_dup(ctx->cert); - if (ssl->cert == NULL) { - goto err; - } - - ssl->msg_callback = ctx->msg_callback; - ssl->msg_callback_arg = ctx->msg_callback_arg; - ssl->verify_mode = ctx->verify_mode; - ssl->verify_callback = ctx->default_verify_callback; - ssl->custom_verify_callback = ctx->custom_verify_callback; - ssl->retain_only_sha256_of_client_certs = - ctx->retain_only_sha256_of_client_certs; - - ssl->quiet_shutdown = ctx->quiet_shutdown; - ssl->max_send_fragment = ctx->max_send_fragment; - - SSL_CTX_up_ref(ctx); - ssl->ctx = ctx; - SSL_CTX_up_ref(ctx); - ssl->session_ctx = ctx; - - if (!ssl->ctx->x509_method->ssl_new(ssl)) { - goto err; - } - - if (ctx->supported_group_list) { - ssl->supported_group_list = (uint16_t *)BUF_memdup( - ctx->supported_group_list, ctx->supported_group_list_len * 2); - if (!ssl->supported_group_list) { - goto err; - } - ssl->supported_group_list_len = ctx->supported_group_list_len; - } - - if (ctx->alpn_client_proto_list) { - ssl->alpn_client_proto_list = (uint8_t *)BUF_memdup( - ctx->alpn_client_proto_list, ctx->alpn_client_proto_list_len); - if (ssl->alpn_client_proto_list == NULL) { - goto err; - } - ssl->alpn_client_proto_list_len = ctx->alpn_client_proto_list_len; - } - - ssl->method = ctx->method; - - if (!ssl->method->ssl_new(ssl)) { - goto err; - } - - CRYPTO_new_ex_data(&ssl->ex_data); - - ssl->psk_identity_hint = NULL; - if (ctx->psk_identity_hint) { - ssl->psk_identity_hint = BUF_strdup(ctx->psk_identity_hint); - if (ssl->psk_identity_hint == NULL) { - goto err; - } - } - ssl->psk_client_callback = ctx->psk_client_callback; - ssl->psk_server_callback = ctx->psk_server_callback; - - ssl->tlsext_channel_id_enabled = ctx->tlsext_channel_id_enabled; - if (ctx->tlsext_channel_id_private) { - EVP_PKEY_up_ref(ctx->tlsext_channel_id_private); - ssl->tlsext_channel_id_private = ctx->tlsext_channel_id_private; - } - - ssl->signed_cert_timestamps_enabled = ctx->signed_cert_timestamps_enabled; - ssl->ocsp_stapling_enabled = ctx->ocsp_stapling_enabled; - ssl->handoff = ctx->handoff; - - return ssl; - -err: - SSL_free(ssl); - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - - return NULL; -} - -void SSL_free(SSL *ssl) { - if (ssl == NULL) { - return; - } - - if (ssl->ctx != NULL) { - ssl->ctx->x509_method->ssl_free(ssl); - } - - CRYPTO_free_ex_data(&g_ex_data_class_ssl, ssl, &ssl->ex_data); - - BIO_free_all(ssl->rbio); - BIO_free_all(ssl->wbio); - - // add extra stuff - ssl_cipher_preference_list_free(ssl->cipher_list); - - SSL_SESSION_free(ssl->session); - - ssl_cert_free(ssl->cert); - - OPENSSL_free(ssl->tlsext_hostname); - SSL_CTX_free(ssl->session_ctx); - OPENSSL_free(ssl->supported_group_list); - OPENSSL_free(ssl->alpn_client_proto_list); - OPENSSL_free(ssl->token_binding_params); - OPENSSL_free(ssl->quic_transport_params); - EVP_PKEY_free(ssl->tlsext_channel_id_private); - OPENSSL_free(ssl->psk_identity_hint); - sk_CRYPTO_BUFFER_pop_free(ssl->client_CA, CRYPTO_BUFFER_free); - sk_SRTP_PROTECTION_PROFILE_free(ssl->srtp_profiles); - - if (ssl->method != NULL) { - ssl->method->ssl_free(ssl); - } - SSL_CTX_free(ssl->ctx); - - OPENSSL_free(ssl); -} - -void SSL_set_connect_state(SSL *ssl) { - ssl->server = false; - ssl->do_handshake = ssl_client_handshake; -} - -void SSL_set_accept_state(SSL *ssl) { - ssl->server = true; - ssl->do_handshake = ssl_server_handshake; -} - -void SSL_set0_rbio(SSL *ssl, BIO *rbio) { - BIO_free_all(ssl->rbio); - ssl->rbio = rbio; -} - -void SSL_set0_wbio(SSL *ssl, BIO *wbio) { - BIO_free_all(ssl->wbio); - ssl->wbio = wbio; -} - -void SSL_set_bio(SSL *ssl, BIO *rbio, BIO *wbio) { - // For historical reasons, this function has many different cases in ownership - // handling. - - // If nothing has changed, do nothing - if (rbio == SSL_get_rbio(ssl) && wbio == SSL_get_wbio(ssl)) { - return; - } - - // If the two arguments are equal, one fewer reference is granted than - // taken. - if (rbio != NULL && rbio == wbio) { - BIO_up_ref(rbio); - } - - // If only the wbio is changed, adopt only one reference. - if (rbio == SSL_get_rbio(ssl)) { - SSL_set0_wbio(ssl, wbio); - return; - } - - // There is an asymmetry here for historical reasons. If only the rbio is - // changed AND the rbio and wbio were originally different, then we only adopt - // one reference. - if (wbio == SSL_get_wbio(ssl) && SSL_get_rbio(ssl) != SSL_get_wbio(ssl)) { - SSL_set0_rbio(ssl, rbio); - return; - } - - // Otherwise, adopt both references. - SSL_set0_rbio(ssl, rbio); - SSL_set0_wbio(ssl, wbio); -} - -BIO *SSL_get_rbio(const SSL *ssl) { return ssl->rbio; } - -BIO *SSL_get_wbio(const SSL *ssl) { return ssl->wbio; } - -int SSL_do_handshake(SSL *ssl) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_TYPE_NOT_SET); - return -1; - } - - if (!SSL_in_init(ssl)) { - return 1; - } - - // Run the handshake. - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - - bool early_return = false; - int ret = ssl_run_handshake(hs, &early_return); - ssl_do_info_callback( - ssl, ssl->server ? SSL_CB_ACCEPT_EXIT : SSL_CB_CONNECT_EXIT, ret); - if (ret <= 0) { - return ret; - } - - // Destroy the handshake object if the handshake has completely finished. - if (!early_return) { - ssl->s3->hs.reset(); - } - - return 1; -} - -int SSL_connect(SSL *ssl) { - if (ssl->do_handshake == NULL) { - // Not properly initialized yet - SSL_set_connect_state(ssl); - } - - return SSL_do_handshake(ssl); -} - -int SSL_accept(SSL *ssl) { - if (ssl->do_handshake == NULL) { - // Not properly initialized yet - SSL_set_accept_state(ssl); - } - - return SSL_do_handshake(ssl); -} - -static int ssl_do_post_handshake(SSL *ssl, const SSLMessage &msg) { - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return tls13_post_handshake(ssl, msg); - } - - // We do not accept renegotiations as a server or SSL 3.0. SSL 3.0 will be - // removed entirely in the future and requires retaining more data for - // renegotiation_info. - if (ssl->server || ssl->version == SSL3_VERSION) { - goto no_renegotiation; - } - - if (msg.type != SSL3_MT_HELLO_REQUEST || CBS_len(&msg.body) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_HELLO_REQUEST); - return 0; - } - - switch (ssl->renegotiate_mode) { - case ssl_renegotiate_ignore: - // Ignore the HelloRequest. - return 1; - - case ssl_renegotiate_once: - if (ssl->s3->total_renegotiations != 0) { - goto no_renegotiation; - } - break; - - case ssl_renegotiate_never: - goto no_renegotiation; - - case ssl_renegotiate_freely: - break; - } - - // Renegotiation is only supported at quiescent points in the application - // protocol, namely in HTTPS, just before reading the HTTP response. Require - // the record-layer be idle and avoid complexities of sending a handshake - // record while an application_data record is being written. - if (!ssl->s3->write_buffer.empty() || - ssl->s3->write_shutdown != ssl_shutdown_none) { - goto no_renegotiation; - } - - // Begin a new handshake. - if (ssl->s3->hs != nullptr) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - ssl->s3->hs = ssl_handshake_new(ssl); - if (ssl->s3->hs == nullptr) { - return 0; - } - - ssl->s3->total_renegotiations++; - return 1; - -no_renegotiation: - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_RENEGOTIATION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_NO_RENEGOTIATION); - return 0; -} - -static int ssl_read_impl(SSL *ssl) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); - return -1; - } - - // Replay post-handshake message errors. - if (!check_read_error(ssl)) { - return -1; - } - - while (ssl->s3->pending_app_data.empty()) { - // Complete the current handshake, if any. False Start will cause - // |SSL_do_handshake| to return mid-handshake, so this may require multiple - // iterations. - while (!ssl_can_read(ssl)) { - int ret = SSL_do_handshake(ssl); - if (ret < 0) { - return ret; - } - if (ret == 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); - return -1; - } - } - - // Process any buffered post-handshake messages. - SSLMessage msg; - if (ssl->method->get_message(ssl, &msg)) { - // If we received an interrupt in early read (EndOfEarlyData), loop again - // for the handshake to process it. - if (SSL_in_init(ssl)) { - ssl->s3->hs->can_early_read = false; - continue; - } - - // Handle the post-handshake message and try again. - if (!ssl_do_post_handshake(ssl, msg)) { - ssl_set_read_error(ssl); - return -1; - } - ssl->method->next_message(ssl); - continue; // Loop again. We may have begun a new handshake. - } - - uint8_t alert = SSL_AD_DECODE_ERROR; - size_t consumed = 0; - auto ret = ssl_open_app_data(ssl, &ssl->s3->pending_app_data, &consumed, - &alert, ssl->s3->read_buffer.span()); - bool retry; - int bio_ret = ssl_handle_open_record(ssl, &retry, ret, consumed, alert); - if (bio_ret <= 0) { - return bio_ret; - } - if (!retry) { - assert(!ssl->s3->pending_app_data.empty()); - ssl->s3->key_update_count = 0; - } - } - - return 1; -} - -int SSL_read(SSL *ssl, void *buf, int num) { - int ret = SSL_peek(ssl, buf, num); - if (ret <= 0) { - return ret; - } - // TODO(davidben): In DTLS, should the rest of the record be discarded? DTLS - // is not a stream. See https://crbug.com/boringssl/65. - ssl->s3->pending_app_data = - ssl->s3->pending_app_data.subspan(static_cast(ret)); - if (ssl->s3->pending_app_data.empty()) { - ssl->s3->read_buffer.DiscardConsumed(); - } - return ret; -} - -int SSL_peek(SSL *ssl, void *buf, int num) { - int ret = ssl_read_impl(ssl); - if (ret <= 0) { - return ret; - } - if (num <= 0) { - return num; - } - size_t todo = - std::min(ssl->s3->pending_app_data.size(), static_cast(num)); - OPENSSL_memcpy(buf, ssl->s3->pending_app_data.data(), todo); - return static_cast(todo); -} - -int SSL_write(SSL *ssl, const void *buf, int num) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); - return -1; - } - - if (ssl->s3->write_shutdown != ssl_shutdown_none) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); - return -1; - } - - int ret = 0; - bool needs_handshake = false; - do { - // If necessary, complete the handshake implicitly. - if (!ssl_can_write(ssl)) { - ret = SSL_do_handshake(ssl); - if (ret < 0) { - return ret; - } - if (ret == 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_HANDSHAKE_FAILURE); - return -1; - } - } - - ret = ssl->method->write_app_data(ssl, &needs_handshake, - (const uint8_t *)buf, num); - } while (needs_handshake); - return ret; -} - -int SSL_shutdown(SSL *ssl) { - ssl_reset_error_state(ssl); - - if (ssl->do_handshake == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNINITIALIZED); - return -1; - } - - // If we are in the middle of a handshake, silently succeed. Consumers often - // call this function before |SSL_free|, whether the handshake succeeded or - // not. We assume the caller has already handled failed handshakes. - if (SSL_in_init(ssl)) { - return 1; - } - - if (ssl->quiet_shutdown) { - // Do nothing if configured not to send a close_notify. - ssl->s3->write_shutdown = ssl_shutdown_close_notify; - ssl->s3->read_shutdown = ssl_shutdown_close_notify; - return 1; - } - - // This function completes in two stages. It sends a close_notify and then it - // waits for a close_notify to come in. Perform exactly one action and return - // whether or not it succeeds. - - if (ssl->s3->write_shutdown != ssl_shutdown_close_notify) { - // Send a close_notify. - if (ssl_send_alert(ssl, SSL3_AL_WARNING, SSL_AD_CLOSE_NOTIFY) <= 0) { - return -1; - } - } else if (ssl->s3->alert_dispatch) { - // Finish sending the close_notify. - if (ssl->method->dispatch_alert(ssl) <= 0) { - return -1; - } - } else if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { - if (SSL_is_dtls(ssl)) { - // Bidirectional shutdown doesn't make sense for an unordered - // transport. DTLS alerts also aren't delivered reliably, so we may even - // time out because the peer never received our close_notify. Report to - // the caller that the channel has fully shut down. - if (ssl->s3->read_shutdown == ssl_shutdown_error) { - ERR_restore_state(ssl->s3->read_error.get()); - return -1; - } - ssl->s3->read_shutdown = ssl_shutdown_close_notify; - } else { - // Keep discarding data until we see a close_notify. - for (;;) { - ssl->s3->pending_app_data = Span(); - int ret = ssl_read_impl(ssl); - if (ret <= 0) { - break; - } - } - if (ssl->s3->read_shutdown != ssl_shutdown_close_notify) { - return -1; - } - } - } - - // Return 0 for unidirectional shutdown and 1 for bidirectional shutdown. - return ssl->s3->read_shutdown == ssl_shutdown_close_notify; -} - -int SSL_send_fatal_alert(SSL *ssl, uint8_t alert) { - if (ssl->s3->alert_dispatch) { - if (ssl->s3->send_alert[0] != SSL3_AL_FATAL || - ssl->s3->send_alert[1] != alert) { - // We are already attempting to write a different alert. - OPENSSL_PUT_ERROR(SSL, SSL_R_PROTOCOL_IS_SHUTDOWN); - return -1; - } - return ssl->method->dispatch_alert(ssl); - } - - return ssl_send_alert(ssl, SSL3_AL_FATAL, alert); -} - -int SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params, - size_t params_len) { - ssl->quic_transport_params = (uint8_t *)BUF_memdup(params, params_len); - if (!ssl->quic_transport_params) { - return 0; - } - ssl->quic_transport_params_len = params_len; - return 1; -} - -void SSL_get_peer_quic_transport_params(const SSL *ssl, - const uint8_t **out_params, - size_t *out_params_len) { - *out_params = ssl->s3->peer_quic_transport_params.data(); - *out_params_len = ssl->s3->peer_quic_transport_params.size(); -} - -void SSL_CTX_set_early_data_enabled(SSL_CTX *ctx, int enabled) { - ctx->cert->enable_early_data = !!enabled; -} - -void SSL_CTX_set_tls13_variant(SSL_CTX *ctx, enum tls13_variant_t variant) { - ctx->tls13_variant = variant; -} - -void SSL_set_tls13_variant(SSL *ssl, enum tls13_variant_t variant) { - ssl->tls13_variant = variant; -} - -void SSL_set_early_data_enabled(SSL *ssl, int enabled) { - ssl->cert->enable_early_data = !!enabled; -} - -int SSL_in_early_data(const SSL *ssl) { - if (ssl->s3->hs == NULL) { - return 0; - } - return ssl->s3->hs->in_early_data; -} - -int SSL_early_data_accepted(const SSL *ssl) { - return ssl->s3->early_data_accepted; -} - -void SSL_reset_early_data_reject(SSL *ssl) { - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - if (hs == NULL || - hs->wait != ssl_hs_early_data_rejected) { - abort(); - } - - hs->wait = ssl_hs_ok; - hs->in_early_data = false; - hs->early_session.reset(); - - // Discard any unfinished writes from the perspective of |SSL_write|'s - // retry. The handshake will transparently flush out the pending record - // (discarded by the server) to keep the framing correct. - ssl->s3->wpend_pending = false; -} - -static int bio_retry_reason_to_error(int reason) { - switch (reason) { - case BIO_RR_CONNECT: - return SSL_ERROR_WANT_CONNECT; - case BIO_RR_ACCEPT: - return SSL_ERROR_WANT_ACCEPT; - default: - return SSL_ERROR_SYSCALL; - } -} - -int SSL_get_error(const SSL *ssl, int ret_code) { - if (ret_code > 0) { - return SSL_ERROR_NONE; - } - - // Make things return SSL_ERROR_SYSCALL when doing SSL_do_handshake etc, - // where we do encode the error - uint32_t err = ERR_peek_error(); - if (err != 0) { - if (ERR_GET_LIB(err) == ERR_LIB_SYS) { - return SSL_ERROR_SYSCALL; - } - return SSL_ERROR_SSL; - } - - if (ret_code == 0) { - if (ssl->s3->read_shutdown == ssl_shutdown_close_notify) { - return SSL_ERROR_ZERO_RETURN; - } - // An EOF was observed which violates the protocol, and the underlying - // transport does not participate in the error queue. Bubble up to the - // caller. - return SSL_ERROR_SYSCALL; - } - - switch (ssl->s3->rwstate) { - case SSL_PENDING_SESSION: - return SSL_ERROR_PENDING_SESSION; - - case SSL_CERTIFICATE_SELECTION_PENDING: - return SSL_ERROR_PENDING_CERTIFICATE; - - case SSL_HANDOFF: - return SSL_ERROR_HANDOFF; - - case SSL_READING: { - BIO *bio = SSL_get_rbio(ssl); - if (BIO_should_read(bio)) { - return SSL_ERROR_WANT_READ; - } - - if (BIO_should_write(bio)) { - // TODO(davidben): OpenSSL historically checked for writes on the read - // BIO. Can this be removed? - return SSL_ERROR_WANT_WRITE; - } - - if (BIO_should_io_special(bio)) { - return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); - } - - break; - } - - case SSL_WRITING: { - BIO *bio = SSL_get_wbio(ssl); - if (BIO_should_write(bio)) { - return SSL_ERROR_WANT_WRITE; - } - - if (BIO_should_read(bio)) { - // TODO(davidben): OpenSSL historically checked for reads on the write - // BIO. Can this be removed? - return SSL_ERROR_WANT_READ; - } - - if (BIO_should_io_special(bio)) { - return bio_retry_reason_to_error(BIO_get_retry_reason(bio)); - } - - break; - } - - case SSL_X509_LOOKUP: - return SSL_ERROR_WANT_X509_LOOKUP; - - case SSL_CHANNEL_ID_LOOKUP: - return SSL_ERROR_WANT_CHANNEL_ID_LOOKUP; - - case SSL_PRIVATE_KEY_OPERATION: - return SSL_ERROR_WANT_PRIVATE_KEY_OPERATION; - - case SSL_PENDING_TICKET: - return SSL_ERROR_PENDING_TICKET; - - case SSL_EARLY_DATA_REJECTED: - return SSL_ERROR_EARLY_DATA_REJECTED; - - case SSL_CERTIFICATE_VERIFY: - return SSL_ERROR_WANT_CERTIFICATE_VERIFY; - } - - return SSL_ERROR_SYSCALL; -} - -uint32_t SSL_CTX_set_options(SSL_CTX *ctx, uint32_t options) { - ctx->options |= options; - return ctx->options; -} - -uint32_t SSL_CTX_clear_options(SSL_CTX *ctx, uint32_t options) { - ctx->options &= ~options; - return ctx->options; -} - -uint32_t SSL_CTX_get_options(const SSL_CTX *ctx) { return ctx->options; } - -uint32_t SSL_set_options(SSL *ssl, uint32_t options) { - ssl->options |= options; - return ssl->options; -} - -uint32_t SSL_clear_options(SSL *ssl, uint32_t options) { - ssl->options &= ~options; - return ssl->options; -} - -uint32_t SSL_get_options(const SSL *ssl) { return ssl->options; } - -uint32_t SSL_CTX_set_mode(SSL_CTX *ctx, uint32_t mode) { - ctx->mode |= mode; - return ctx->mode; -} - -uint32_t SSL_CTX_clear_mode(SSL_CTX *ctx, uint32_t mode) { - ctx->mode &= ~mode; - return ctx->mode; -} - -uint32_t SSL_CTX_get_mode(const SSL_CTX *ctx) { return ctx->mode; } - -uint32_t SSL_set_mode(SSL *ssl, uint32_t mode) { - ssl->mode |= mode; - return ssl->mode; -} - -uint32_t SSL_clear_mode(SSL *ssl, uint32_t mode) { - ssl->mode &= ~mode; - return ssl->mode; -} - -uint32_t SSL_get_mode(const SSL *ssl) { return ssl->mode; } - -void SSL_CTX_set0_buffer_pool(SSL_CTX *ctx, CRYPTO_BUFFER_POOL *pool) { - ctx->pool = pool; -} - -int SSL_get_tls_unique(const SSL *ssl, uint8_t *out, size_t *out_len, - size_t max_out) { - *out_len = 0; - OPENSSL_memset(out, 0, max_out); - - // tls-unique is not defined for SSL 3.0 or TLS 1.3. - if (!ssl->s3->initial_handshake_complete || - ssl_protocol_version(ssl) < TLS1_VERSION || - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 0; - } - - // The tls-unique value is the first Finished message in the handshake, which - // is the client's in a full handshake and the server's for a resumption. See - // https://tools.ietf.org/html/rfc5929#section-3.1. - const uint8_t *finished = ssl->s3->previous_client_finished; - size_t finished_len = ssl->s3->previous_client_finished_len; - if (ssl->session != NULL) { - // tls-unique is broken for resumed sessions unless EMS is used. - if (!ssl->session->extended_master_secret) { - return 0; - } - finished = ssl->s3->previous_server_finished; - finished_len = ssl->s3->previous_server_finished_len; - } - - *out_len = finished_len; - if (finished_len > max_out) { - *out_len = max_out; - } - - OPENSSL_memcpy(out, finished, *out_len); - return 1; -} - -static int set_session_id_context(CERT *cert, const uint8_t *sid_ctx, - size_t sid_ctx_len) { - if (sid_ctx_len > sizeof(cert->sid_ctx)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG); - return 0; - } - - static_assert(sizeof(cert->sid_ctx) < 256, "sid_ctx too large"); - cert->sid_ctx_length = (uint8_t)sid_ctx_len; - OPENSSL_memcpy(cert->sid_ctx, sid_ctx, sid_ctx_len); - return 1; -} - -int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const uint8_t *sid_ctx, - size_t sid_ctx_len) { - return set_session_id_context(ctx->cert, sid_ctx, sid_ctx_len); -} - -int SSL_set_session_id_context(SSL *ssl, const uint8_t *sid_ctx, - size_t sid_ctx_len) { - return set_session_id_context(ssl->cert, sid_ctx, sid_ctx_len); -} - -const uint8_t *SSL_get0_session_id_context(const SSL *ssl, size_t *out_len) { - *out_len = ssl->cert->sid_ctx_length; - return ssl->cert->sid_ctx; -} - -void SSL_certs_clear(SSL *ssl) { ssl_cert_clear_certs(ssl->cert); } - -int SSL_get_fd(const SSL *ssl) { return SSL_get_rfd(ssl); } - -int SSL_get_rfd(const SSL *ssl) { - int ret = -1; - BIO *b = BIO_find_type(SSL_get_rbio(ssl), BIO_TYPE_DESCRIPTOR); - if (b != NULL) { - BIO_get_fd(b, &ret); - } - return ret; -} - -int SSL_get_wfd(const SSL *ssl) { - int ret = -1; - BIO *b = BIO_find_type(SSL_get_wbio(ssl), BIO_TYPE_DESCRIPTOR); - if (b != NULL) { - BIO_get_fd(b, &ret); - } - return ret; -} - -int SSL_set_fd(SSL *ssl, int fd) { - BIO *bio = BIO_new(BIO_s_socket()); - if (bio == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); - return 0; - } - BIO_set_fd(bio, fd, BIO_NOCLOSE); - SSL_set_bio(ssl, bio, bio); - return 1; -} - -int SSL_set_wfd(SSL *ssl, int fd) { - BIO *rbio = SSL_get_rbio(ssl); - if (rbio == NULL || BIO_method_type(rbio) != BIO_TYPE_SOCKET || - BIO_get_fd(rbio, NULL) != fd) { - BIO *bio = BIO_new(BIO_s_socket()); - if (bio == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); - return 0; - } - BIO_set_fd(bio, fd, BIO_NOCLOSE); - SSL_set0_wbio(ssl, bio); - } else { - // Copy the rbio over to the wbio. - BIO_up_ref(rbio); - SSL_set0_wbio(ssl, rbio); - } - - return 1; -} - -int SSL_set_rfd(SSL *ssl, int fd) { - BIO *wbio = SSL_get_wbio(ssl); - if (wbio == NULL || BIO_method_type(wbio) != BIO_TYPE_SOCKET || - BIO_get_fd(wbio, NULL) != fd) { - BIO *bio = BIO_new(BIO_s_socket()); - if (bio == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_BUF_LIB); - return 0; - } - BIO_set_fd(bio, fd, BIO_NOCLOSE); - SSL_set0_rbio(ssl, bio); - } else { - // Copy the wbio over to the rbio. - BIO_up_ref(wbio); - SSL_set0_rbio(ssl, wbio); - } - return 1; -} - -static size_t copy_finished(void *out, size_t out_len, const uint8_t *in, - size_t in_len) { - if (out_len > in_len) { - out_len = in_len; - } - OPENSSL_memcpy(out, in, out_len); - return in_len; -} - -size_t SSL_get_finished(const SSL *ssl, void *buf, size_t count) { - if (!ssl->s3->initial_handshake_complete || - ssl_protocol_version(ssl) < TLS1_VERSION || - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 0; - } - - if (ssl->server) { - return copy_finished(buf, count, ssl->s3->previous_server_finished, - ssl->s3->previous_server_finished_len); - } - - return copy_finished(buf, count, ssl->s3->previous_client_finished, - ssl->s3->previous_client_finished_len); -} - -size_t SSL_get_peer_finished(const SSL *ssl, void *buf, size_t count) { - if (!ssl->s3->initial_handshake_complete || - ssl_protocol_version(ssl) < TLS1_VERSION || - ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 0; - } - - if (ssl->server) { - return copy_finished(buf, count, ssl->s3->previous_client_finished, - ssl->s3->previous_client_finished_len); - } - - return copy_finished(buf, count, ssl->s3->previous_server_finished, - ssl->s3->previous_server_finished_len); -} - -int SSL_get_verify_mode(const SSL *ssl) { return ssl->verify_mode; } - -int SSL_get_extms_support(const SSL *ssl) { - // TLS 1.3 does not require extended master secret and always reports as - // supporting it. - if (!ssl->s3->have_version) { - return 0; - } - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - return 1; - } - - // If the initial handshake completed, query the established session. - if (ssl->s3->established_session != NULL) { - return ssl->s3->established_session->extended_master_secret; - } - - // Otherwise, query the in-progress handshake. - if (ssl->s3->hs != NULL) { - return ssl->s3->hs->extended_master_secret; - } - assert(0); - return 0; -} - -int SSL_CTX_get_read_ahead(const SSL_CTX *ctx) { return 0; } - -int SSL_get_read_ahead(const SSL *ssl) { return 0; } - -void SSL_CTX_set_read_ahead(SSL_CTX *ctx, int yes) { } - -void SSL_set_read_ahead(SSL *ssl, int yes) { } - -int SSL_pending(const SSL *ssl) { - return static_cast(ssl->s3->pending_app_data.size()); -} - -// Fix this so it checks all the valid key/cert options -int SSL_CTX_check_private_key(const SSL_CTX *ctx) { - return ssl_cert_check_private_key(ctx->cert, ctx->cert->privatekey); -} - -// Fix this function so that it takes an optional type parameter -int SSL_check_private_key(const SSL *ssl) { - return ssl_cert_check_private_key(ssl->cert, ssl->cert->privatekey); -} - -long SSL_get_default_timeout(const SSL *ssl) { - return SSL_DEFAULT_SESSION_TIMEOUT; -} - -int SSL_renegotiate(SSL *ssl) { - // Caller-initiated renegotiation is not supported. - OPENSSL_PUT_ERROR(SSL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); - return 0; -} - -int SSL_renegotiate_pending(SSL *ssl) { - return SSL_in_init(ssl) && ssl->s3->initial_handshake_complete; -} - -int SSL_total_renegotiations(const SSL *ssl) { - return ssl->s3->total_renegotiations; -} - -size_t SSL_CTX_get_max_cert_list(const SSL_CTX *ctx) { - return ctx->max_cert_list; -} - -void SSL_CTX_set_max_cert_list(SSL_CTX *ctx, size_t max_cert_list) { - if (max_cert_list > kMaxHandshakeSize) { - max_cert_list = kMaxHandshakeSize; - } - ctx->max_cert_list = (uint32_t)max_cert_list; -} - -size_t SSL_get_max_cert_list(const SSL *ssl) { - return ssl->max_cert_list; -} - -void SSL_set_max_cert_list(SSL *ssl, size_t max_cert_list) { - if (max_cert_list > kMaxHandshakeSize) { - max_cert_list = kMaxHandshakeSize; - } - ssl->max_cert_list = (uint32_t)max_cert_list; -} - -int SSL_CTX_set_max_send_fragment(SSL_CTX *ctx, size_t max_send_fragment) { - if (max_send_fragment < 512) { - max_send_fragment = 512; - } - if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { - max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; - } - ctx->max_send_fragment = (uint16_t)max_send_fragment; - - return 1; -} - -int SSL_set_max_send_fragment(SSL *ssl, size_t max_send_fragment) { - if (max_send_fragment < 512) { - max_send_fragment = 512; - } - if (max_send_fragment > SSL3_RT_MAX_PLAIN_LENGTH) { - max_send_fragment = SSL3_RT_MAX_PLAIN_LENGTH; - } - ssl->max_send_fragment = (uint16_t)max_send_fragment; - - return 1; -} - -int SSL_set_mtu(SSL *ssl, unsigned mtu) { - if (!SSL_is_dtls(ssl) || mtu < dtls1_min_mtu()) { - return 0; - } - ssl->d1->mtu = mtu; - return 1; -} - -int SSL_get_secure_renegotiation_support(const SSL *ssl) { - if (!ssl->s3->have_version) { - return 0; - } - return ssl_protocol_version(ssl) >= TLS1_3_VERSION || - ssl->s3->send_connection_binding; -} - -size_t SSL_CTX_sess_number(const SSL_CTX *ctx) { - MutexReadLock lock(const_cast(&ctx->lock)); - return lh_SSL_SESSION_num_items(ctx->sessions); -} - -unsigned long SSL_CTX_sess_set_cache_size(SSL_CTX *ctx, unsigned long size) { - unsigned long ret = ctx->session_cache_size; - ctx->session_cache_size = size; - return ret; -} - -unsigned long SSL_CTX_sess_get_cache_size(const SSL_CTX *ctx) { - return ctx->session_cache_size; -} - -int SSL_CTX_set_session_cache_mode(SSL_CTX *ctx, int mode) { - int ret = ctx->session_cache_mode; - ctx->session_cache_mode = mode; - return ret; -} - -int SSL_CTX_get_session_cache_mode(const SSL_CTX *ctx) { - return ctx->session_cache_mode; -} - - -int SSL_CTX_get_tlsext_ticket_keys(SSL_CTX *ctx, void *out, size_t len) { - if (out == NULL) { - return 48; - } - if (len != 48) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); - return 0; - } - - // The default ticket keys are initialized lazily. Trigger a key - // rotation to initialize them. - if (!ssl_ctx_rotate_ticket_encryption_key(ctx)) { - return 0; - } - - uint8_t *out_bytes = reinterpret_cast(out); - MutexReadLock lock(&ctx->lock); - OPENSSL_memcpy(out_bytes, ctx->tlsext_ticket_key_current->name, 16); - OPENSSL_memcpy(out_bytes + 16, ctx->tlsext_ticket_key_current->hmac_key, 16); - OPENSSL_memcpy(out_bytes + 32, ctx->tlsext_ticket_key_current->aes_key, 16); - return 1; -} - -int SSL_CTX_set_tlsext_ticket_keys(SSL_CTX *ctx, const void *in, size_t len) { - if (in == NULL) { - return 48; - } - if (len != 48) { - OPENSSL_PUT_ERROR(SSL, SSL_R_INVALID_TICKET_KEYS_LENGTH); - return 0; - } - if (!ctx->tlsext_ticket_key_current) { - ctx->tlsext_ticket_key_current = - (tlsext_ticket_key *)OPENSSL_malloc(sizeof(tlsext_ticket_key)); - if (!ctx->tlsext_ticket_key_current) { - return 0; - } - } - OPENSSL_memset(ctx->tlsext_ticket_key_current, 0, sizeof(tlsext_ticket_key)); - const uint8_t *in_bytes = reinterpret_cast(in); - OPENSSL_memcpy(ctx->tlsext_ticket_key_current->name, in_bytes, 16); - OPENSSL_memcpy(ctx->tlsext_ticket_key_current->hmac_key, in_bytes + 16, 16); - OPENSSL_memcpy(ctx->tlsext_ticket_key_current->aes_key, in_bytes + 32, 16); - OPENSSL_free(ctx->tlsext_ticket_key_prev); - ctx->tlsext_ticket_key_prev = nullptr; - // Disable automatic key rotation. - ctx->tlsext_ticket_key_current->next_rotation_tv_sec = 0; - return 1; -} - -int SSL_CTX_set_tlsext_ticket_key_cb( - SSL_CTX *ctx, int (*callback)(SSL *ssl, uint8_t *key_name, uint8_t *iv, - EVP_CIPHER_CTX *ctx, HMAC_CTX *hmac_ctx, - int encrypt)) { - ctx->tlsext_ticket_key_cb = callback; - return 1; -} - -int SSL_CTX_set1_curves(SSL_CTX *ctx, const int *curves, size_t curves_len) { - return tls1_set_curves(&ctx->supported_group_list, - &ctx->supported_group_list_len, curves, - curves_len); -} - -int SSL_set1_curves(SSL *ssl, const int *curves, size_t curves_len) { - return tls1_set_curves(&ssl->supported_group_list, - &ssl->supported_group_list_len, curves, - curves_len); -} - -int SSL_CTX_set1_curves_list(SSL_CTX *ctx, const char *curves) { - return tls1_set_curves_list(&ctx->supported_group_list, - &ctx->supported_group_list_len, curves); -} - -int SSL_set1_curves_list(SSL *ssl, const char *curves) { - return tls1_set_curves_list(&ssl->supported_group_list, - &ssl->supported_group_list_len, curves); -} - -uint16_t SSL_get_curve_id(const SSL *ssl) { - // TODO(davidben): This checks the wrong session if there is a renegotiation - // in progress. - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return 0; - } - - return session->group_id; -} - -int SSL_CTX_set_tmp_dh(SSL_CTX *ctx, const DH *dh) { - return 1; -} - -int SSL_set_tmp_dh(SSL *ssl, const DH *dh) { - return 1; -} - -STACK_OF(SSL_CIPHER) *SSL_CTX_get_ciphers(const SSL_CTX *ctx) { - return ctx->cipher_list->ciphers; -} - -int SSL_CTX_cipher_in_group(const SSL_CTX *ctx, size_t i) { - if (i >= sk_SSL_CIPHER_num(ctx->cipher_list->ciphers)) { - return 0; - } - return ctx->cipher_list->in_group_flags[i]; -} - -STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl) { - if (ssl == NULL) { - return NULL; - } - - const struct ssl_cipher_preference_list_st *prefs = - ssl_get_cipher_preferences(ssl); - if (prefs == NULL) { - return NULL; - } - - return prefs->ciphers; -} - -const char *SSL_get_cipher_list(const SSL *ssl, int n) { - if (ssl == NULL) { - return NULL; - } - - STACK_OF(SSL_CIPHER) *sk = SSL_get_ciphers(ssl); - if (sk == NULL || n < 0 || (size_t)n >= sk_SSL_CIPHER_num(sk)) { - return NULL; - } - - const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, n); - if (c == NULL) { - return NULL; - } - - return c->name; -} - -int SSL_CTX_set_cipher_list(SSL_CTX *ctx, const char *str) { - return ssl_create_cipher_list(&ctx->cipher_list, str, false /* not strict */); -} - -int SSL_CTX_set_strict_cipher_list(SSL_CTX *ctx, const char *str) { - return ssl_create_cipher_list(&ctx->cipher_list, str, true /* strict */); -} - -int SSL_set_cipher_list(SSL *ssl, const char *str) { - return ssl_create_cipher_list(&ssl->cipher_list, str, false /* not strict */); -} - -int SSL_set_strict_cipher_list(SSL *ssl, const char *str) { - return ssl_create_cipher_list(&ssl->cipher_list, str, true /* strict */); -} - -const char *SSL_get_servername(const SSL *ssl, const int type) { - if (type != TLSEXT_NAMETYPE_host_name) { - return NULL; - } - - // Historically, |SSL_get_servername| was also the configuration getter - // corresponding to |SSL_set_tlsext_host_name|. - if (ssl->tlsext_hostname != NULL) { - return ssl->tlsext_hostname; - } - - return ssl->s3->hostname.get(); -} - -int SSL_get_servername_type(const SSL *ssl) { - if (SSL_get_servername(ssl, TLSEXT_NAMETYPE_host_name) == NULL) { - return -1; - } - return TLSEXT_NAMETYPE_host_name; -} - -void SSL_CTX_set_custom_verify( - SSL_CTX *ctx, int mode, - enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { - ctx->verify_mode = mode; - ctx->custom_verify_callback = callback; -} - -void SSL_set_custom_verify( - SSL *ssl, int mode, - enum ssl_verify_result_t (*callback)(SSL *ssl, uint8_t *out_alert)) { - ssl->verify_mode = mode; - ssl->custom_verify_callback = callback; -} - -void SSL_CTX_enable_signed_cert_timestamps(SSL_CTX *ctx) { - ctx->signed_cert_timestamps_enabled = true; -} - -void SSL_enable_signed_cert_timestamps(SSL *ssl) { - ssl->signed_cert_timestamps_enabled = true; -} - -void SSL_CTX_enable_ocsp_stapling(SSL_CTX *ctx) { - ctx->ocsp_stapling_enabled = true; -} - -void SSL_enable_ocsp_stapling(SSL *ssl) { - ssl->ocsp_stapling_enabled = true; -} - -void SSL_get0_signed_cert_timestamp_list(const SSL *ssl, const uint8_t **out, - size_t *out_len) { - SSL_SESSION *session = SSL_get_session(ssl); - if (ssl->server || !session || !session->signed_cert_timestamp_list) { - *out_len = 0; - *out = NULL; - return; - } - - *out = CRYPTO_BUFFER_data(session->signed_cert_timestamp_list); - *out_len = CRYPTO_BUFFER_len(session->signed_cert_timestamp_list); -} - -void SSL_get0_ocsp_response(const SSL *ssl, const uint8_t **out, - size_t *out_len) { - SSL_SESSION *session = SSL_get_session(ssl); - if (ssl->server || !session || !session->ocsp_response) { - *out_len = 0; - *out = NULL; - return; - } - - *out = CRYPTO_BUFFER_data(session->ocsp_response); - *out_len = CRYPTO_BUFFER_len(session->ocsp_response); -} - -int SSL_set_tlsext_host_name(SSL *ssl, const char *name) { - OPENSSL_free(ssl->tlsext_hostname); - ssl->tlsext_hostname = NULL; - - if (name == NULL) { - return 1; - } - - size_t len = strlen(name); - if (len == 0 || len > TLSEXT_MAXLEN_host_name) { - OPENSSL_PUT_ERROR(SSL, SSL_R_SSL3_EXT_INVALID_SERVERNAME); - return 0; - } - ssl->tlsext_hostname = BUF_strdup(name); - if (ssl->tlsext_hostname == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - return 1; -} - -int SSL_CTX_set_tlsext_servername_callback( - SSL_CTX *ctx, int (*callback)(SSL *ssl, int *out_alert, void *arg)) { - ctx->tlsext_servername_callback = callback; - return 1; -} - -int SSL_CTX_set_tlsext_servername_arg(SSL_CTX *ctx, void *arg) { - ctx->tlsext_servername_arg = arg; - return 1; -} - -int SSL_select_next_proto(uint8_t **out, uint8_t *out_len, const uint8_t *peer, - unsigned peer_len, const uint8_t *supported, - unsigned supported_len) { - const uint8_t *result; - int status; - - // For each protocol in peer preference order, see if we support it. - for (unsigned i = 0; i < peer_len;) { - for (unsigned j = 0; j < supported_len;) { - if (peer[i] == supported[j] && - OPENSSL_memcmp(&peer[i + 1], &supported[j + 1], peer[i]) == 0) { - // We found a match - result = &peer[i]; - status = OPENSSL_NPN_NEGOTIATED; - goto found; - } - j += supported[j]; - j++; - } - i += peer[i]; - i++; - } - - // There's no overlap between our protocols and the peer's list. - result = supported; - status = OPENSSL_NPN_NO_OVERLAP; - -found: - *out = (uint8_t *)result + 1; - *out_len = result[0]; - return status; -} - -void SSL_get0_next_proto_negotiated(const SSL *ssl, const uint8_t **out_data, - unsigned *out_len) { - *out_data = ssl->s3->next_proto_negotiated.data(); - *out_len = ssl->s3->next_proto_negotiated.size(); -} - -void SSL_CTX_set_next_protos_advertised_cb( - SSL_CTX *ctx, - int (*cb)(SSL *ssl, const uint8_t **out, unsigned *out_len, void *arg), - void *arg) { - ctx->next_protos_advertised_cb = cb; - ctx->next_protos_advertised_cb_arg = arg; -} - -void SSL_CTX_set_next_proto_select_cb( - SSL_CTX *ctx, int (*cb)(SSL *ssl, uint8_t **out, uint8_t *out_len, - const uint8_t *in, unsigned in_len, void *arg), - void *arg) { - ctx->next_proto_select_cb = cb; - ctx->next_proto_select_cb_arg = arg; -} - -int SSL_CTX_set_alpn_protos(SSL_CTX *ctx, const uint8_t *protos, - unsigned protos_len) { - OPENSSL_free(ctx->alpn_client_proto_list); - ctx->alpn_client_proto_list = (uint8_t *)BUF_memdup(protos, protos_len); - if (!ctx->alpn_client_proto_list) { - return 1; - } - ctx->alpn_client_proto_list_len = protos_len; - - return 0; -} - -int SSL_set_alpn_protos(SSL *ssl, const uint8_t *protos, unsigned protos_len) { - OPENSSL_free(ssl->alpn_client_proto_list); - ssl->alpn_client_proto_list = (uint8_t *)BUF_memdup(protos, protos_len); - if (!ssl->alpn_client_proto_list) { - return 1; - } - ssl->alpn_client_proto_list_len = protos_len; - - return 0; -} - -void SSL_CTX_set_alpn_select_cb(SSL_CTX *ctx, - int (*cb)(SSL *ssl, const uint8_t **out, - uint8_t *out_len, const uint8_t *in, - unsigned in_len, void *arg), - void *arg) { - ctx->alpn_select_cb = cb; - ctx->alpn_select_cb_arg = arg; -} - -void SSL_get0_alpn_selected(const SSL *ssl, const uint8_t **out_data, - unsigned *out_len) { - if (SSL_in_early_data(ssl) && !ssl->server) { - *out_data = ssl->s3->hs->early_session->early_alpn; - *out_len = ssl->s3->hs->early_session->early_alpn_len; - } else { - *out_data = ssl->s3->alpn_selected.data(); - *out_len = ssl->s3->alpn_selected.size(); - } -} - -void SSL_CTX_set_allow_unknown_alpn_protos(SSL_CTX *ctx, int enabled) { - ctx->allow_unknown_alpn_protos = !!enabled; -} - -void SSL_CTX_set_tls_channel_id_enabled(SSL_CTX *ctx, int enabled) { - ctx->tlsext_channel_id_enabled = !!enabled; -} - -int SSL_CTX_enable_tls_channel_id(SSL_CTX *ctx) { - SSL_CTX_set_tls_channel_id_enabled(ctx, 1); - return 1; -} - -void SSL_set_tls_channel_id_enabled(SSL *ssl, int enabled) { - ssl->tlsext_channel_id_enabled = !!enabled; -} - -int SSL_enable_tls_channel_id(SSL *ssl) { - SSL_set_tls_channel_id_enabled(ssl, 1); - return 1; -} - -static int is_p256_key(EVP_PKEY *private_key) { - const EC_KEY *ec_key = EVP_PKEY_get0_EC_KEY(private_key); - return ec_key != NULL && - EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)) == - NID_X9_62_prime256v1; -} - -int SSL_CTX_set1_tls_channel_id(SSL_CTX *ctx, EVP_PKEY *private_key) { - if (!is_p256_key(private_key)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); - return 0; - } - - EVP_PKEY_free(ctx->tlsext_channel_id_private); - EVP_PKEY_up_ref(private_key); - ctx->tlsext_channel_id_private = private_key; - ctx->tlsext_channel_id_enabled = true; - - return 1; -} - -int SSL_set1_tls_channel_id(SSL *ssl, EVP_PKEY *private_key) { - if (!is_p256_key(private_key)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CHANNEL_ID_NOT_P256); - return 0; - } - - EVP_PKEY_free(ssl->tlsext_channel_id_private); - EVP_PKEY_up_ref(private_key); - ssl->tlsext_channel_id_private = private_key; - ssl->tlsext_channel_id_enabled = true; - - return 1; -} - -size_t SSL_get_tls_channel_id(SSL *ssl, uint8_t *out, size_t max_out) { - if (!ssl->s3->tlsext_channel_id_valid) { - return 0; - } - OPENSSL_memcpy(out, ssl->s3->tlsext_channel_id, - (max_out < 64) ? max_out : 64); - return 64; -} - -int SSL_set_token_binding_params(SSL *ssl, const uint8_t *params, size_t len) { - if (len > 256) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - OPENSSL_free(ssl->token_binding_params); - ssl->token_binding_params = (uint8_t *)BUF_memdup(params, len); - if (!ssl->token_binding_params) { - return 0; - } - ssl->token_binding_params_len = len; - return 1; -} - -int SSL_is_token_binding_negotiated(const SSL *ssl) { - return ssl->token_binding_negotiated; -} - -uint8_t SSL_get_negotiated_token_binding_param(const SSL *ssl) { - return ssl->negotiated_token_binding_param; -} - -size_t SSL_get0_certificate_types(SSL *ssl, const uint8_t **out_types) { - if (ssl->server || ssl->s3->hs == NULL) { - *out_types = NULL; - return 0; - } - *out_types = ssl->s3->hs->certificate_types.data(); - return ssl->s3->hs->certificate_types.size(); -} - -EVP_PKEY *SSL_get_privatekey(const SSL *ssl) { - if (ssl->cert != NULL) { - return ssl->cert->privatekey; - } - - return NULL; -} - -EVP_PKEY *SSL_CTX_get0_privatekey(const SSL_CTX *ctx) { - if (ctx->cert != NULL) { - return ctx->cert->privatekey; - } - - return NULL; -} - -const SSL_CIPHER *SSL_get_current_cipher(const SSL *ssl) { - return ssl->s3->aead_write_ctx->cipher(); -} - -int SSL_session_reused(const SSL *ssl) { - return ssl->s3->session_reused || SSL_in_early_data(ssl); -} - -const COMP_METHOD *SSL_get_current_compression(SSL *ssl) { return NULL; } - -const COMP_METHOD *SSL_get_current_expansion(SSL *ssl) { return NULL; } - -int *SSL_get_server_tmp_key(SSL *ssl, EVP_PKEY **out_key) { return 0; } - -void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode) { - ctx->quiet_shutdown = (mode != 0); -} - -int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx) { - return ctx->quiet_shutdown; -} - -void SSL_set_quiet_shutdown(SSL *ssl, int mode) { - ssl->quiet_shutdown = (mode != 0); -} - -int SSL_get_quiet_shutdown(const SSL *ssl) { return ssl->quiet_shutdown; } - -void SSL_set_shutdown(SSL *ssl, int mode) { - // It is an error to clear any bits that have already been set. (We can't try - // to get a second close_notify or send two.) - assert((SSL_get_shutdown(ssl) & mode) == SSL_get_shutdown(ssl)); - - if (mode & SSL_RECEIVED_SHUTDOWN && - ssl->s3->read_shutdown == ssl_shutdown_none) { - ssl->s3->read_shutdown = ssl_shutdown_close_notify; - } - - if (mode & SSL_SENT_SHUTDOWN && - ssl->s3->write_shutdown == ssl_shutdown_none) { - ssl->s3->write_shutdown = ssl_shutdown_close_notify; - } -} - -int SSL_get_shutdown(const SSL *ssl) { - int ret = 0; - if (ssl->s3->read_shutdown != ssl_shutdown_none) { - // Historically, OpenSSL set |SSL_RECEIVED_SHUTDOWN| on both close_notify - // and fatal alert. - ret |= SSL_RECEIVED_SHUTDOWN; - } - if (ssl->s3->write_shutdown == ssl_shutdown_close_notify) { - // Historically, OpenSSL set |SSL_SENT_SHUTDOWN| on only close_notify. - ret |= SSL_SENT_SHUTDOWN; - } - return ret; -} - -SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl) { return ssl->ctx; } - -SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx) { - if (ssl->ctx == ctx) { - return ssl->ctx; - } - - // One cannot change the X.509 callbacks during a connection. - if (ssl->ctx->x509_method != ctx->x509_method) { - assert(0); - return NULL; - } - - if (ctx == NULL) { - ctx = ssl->session_ctx; - } - - ssl_cert_free(ssl->cert); - ssl->cert = ssl_cert_dup(ctx->cert); - - SSL_CTX_up_ref(ctx); - SSL_CTX_free(ssl->ctx); - ssl->ctx = ctx; - - return ssl->ctx; -} - -void SSL_set_info_callback(SSL *ssl, - void (*cb)(const SSL *ssl, int type, int value)) { - ssl->info_callback = cb; -} - -void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl, int type, - int value) { - return ssl->info_callback; -} - -int SSL_state(const SSL *ssl) { - return SSL_in_init(ssl) ? SSL_ST_INIT : SSL_ST_OK; -} - -void SSL_set_state(SSL *ssl, int state) { } - -char *SSL_get_shared_ciphers(const SSL *ssl, char *buf, int len) { - if (len <= 0) { - return NULL; - } - buf[0] = '\0'; - return buf; -} - -int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, - CRYPTO_EX_dup *dup_unused, CRYPTO_EX_free *free_func) { - int index; - if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl, &index, argl, argp, - free_func)) { - return -1; - } - return index; -} - -int SSL_set_ex_data(SSL *ssl, int idx, void *data) { - return CRYPTO_set_ex_data(&ssl->ex_data, idx, data); -} - -void *SSL_get_ex_data(const SSL *ssl, int idx) { - return CRYPTO_get_ex_data(&ssl->ex_data, idx); -} - -int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_unused *unused, - CRYPTO_EX_dup *dup_unused, - CRYPTO_EX_free *free_func) { - int index; - if (!CRYPTO_get_ex_new_index(&g_ex_data_class_ssl_ctx, &index, argl, argp, - free_func)) { - return -1; - } - return index; -} - -int SSL_CTX_set_ex_data(SSL_CTX *ctx, int idx, void *data) { - return CRYPTO_set_ex_data(&ctx->ex_data, idx, data); -} - -void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) { - return CRYPTO_get_ex_data(&ctx->ex_data, idx); -} - -int SSL_want(const SSL *ssl) { return ssl->s3->rwstate; } - -void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, - RSA *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -void SSL_set_tmp_rsa_callback(SSL *ssl, RSA *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, - DH *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*cb)(SSL *ssl, int is_export, - int keylength)) {} - -static int use_psk_identity_hint(char **out, const char *identity_hint) { - if (identity_hint != NULL && strlen(identity_hint) > PSK_MAX_IDENTITY_LEN) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DATA_LENGTH_TOO_LONG); - return 0; - } - - // Clear currently configured hint, if any. - OPENSSL_free(*out); - *out = NULL; - - // Treat the empty hint as not supplying one. Plain PSK makes it possible to - // send either no hint (omit ServerKeyExchange) or an empty hint, while - // ECDHE_PSK can only spell empty hint. Having different capabilities is odd, - // so we interpret empty and missing as identical. - if (identity_hint != NULL && identity_hint[0] != '\0') { - *out = BUF_strdup(identity_hint); - if (*out == NULL) { - return 0; - } - } - - return 1; -} - -int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint) { - return use_psk_identity_hint(&ctx->psk_identity_hint, identity_hint); -} - -int SSL_use_psk_identity_hint(SSL *ssl, const char *identity_hint) { - return use_psk_identity_hint(&ssl->psk_identity_hint, identity_hint); -} - -const char *SSL_get_psk_identity_hint(const SSL *ssl) { - if (ssl == NULL) { - return NULL; - } - return ssl->psk_identity_hint; -} - -const char *SSL_get_psk_identity(const SSL *ssl) { - if (ssl == NULL) { - return NULL; - } - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return NULL; - } - return session->psk_identity; -} - -void SSL_set_psk_client_callback( - SSL *ssl, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, - unsigned max_identity_len, uint8_t *psk, - unsigned max_psk_len)) { - ssl->psk_client_callback = cb; -} - -void SSL_CTX_set_psk_client_callback( - SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *hint, char *identity, - unsigned max_identity_len, uint8_t *psk, - unsigned max_psk_len)) { - ctx->psk_client_callback = cb; -} - -void SSL_set_psk_server_callback( - SSL *ssl, unsigned (*cb)(SSL *ssl, const char *identity, uint8_t *psk, - unsigned max_psk_len)) { - ssl->psk_server_callback = cb; -} - -void SSL_CTX_set_psk_server_callback( - SSL_CTX *ctx, unsigned (*cb)(SSL *ssl, const char *identity, - uint8_t *psk, unsigned max_psk_len)) { - ctx->psk_server_callback = cb; -} - -int SSL_set_dummy_pq_padding_size(SSL *ssl, size_t num_bytes) { - if (num_bytes > 0xffff) { - return 0; - } - - ssl->dummy_pq_padding_len = num_bytes; - return 1; -} - -int SSL_dummy_pq_padding_used(SSL *ssl) { - if (ssl->server) { - return 0; - } - - return ssl->did_dummy_pq_padding; -} - -void SSL_CTX_set_msg_callback(SSL_CTX *ctx, - void (*cb)(int write_p, int version, - int content_type, const void *buf, - size_t len, SSL *ssl, void *arg)) { - ctx->msg_callback = cb; -} - -void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg) { - ctx->msg_callback_arg = arg; -} - -void SSL_set_msg_callback(SSL *ssl, - void (*cb)(int write_p, int version, int content_type, - const void *buf, size_t len, SSL *ssl, - void *arg)) { - ssl->msg_callback = cb; -} - -void SSL_set_msg_callback_arg(SSL *ssl, void *arg) { - ssl->msg_callback_arg = arg; -} - -void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, - void (*cb)(const SSL *ssl, const char *line)) { - ctx->keylog_callback = cb; -} - -void (*SSL_CTX_get_keylog_callback(const SSL_CTX *ctx))(const SSL *ssl, - const char *line) { - return ctx->keylog_callback; -} - -void SSL_CTX_set_current_time_cb(SSL_CTX *ctx, - void (*cb)(const SSL *ssl, - struct timeval *out_clock)) { - ctx->current_time_cb = cb; -} - -int SSL_is_init_finished(const SSL *ssl) { - return !SSL_in_init(ssl); -} - -int SSL_in_init(const SSL *ssl) { - // This returns false once all the handshake state has been finalized, to - // allow callbacks and getters based on SSL_in_init to return the correct - // values. - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - return hs != nullptr && !hs->handshake_finalized; -} - -int SSL_in_false_start(const SSL *ssl) { - if (ssl->s3->hs == NULL) { - return 0; - } - return ssl->s3->hs->in_false_start; -} - -int SSL_cutthrough_complete(const SSL *ssl) { - return SSL_in_false_start(ssl); -} - -void SSL_get_structure_sizes(size_t *ssl_size, size_t *ssl_ctx_size, - size_t *ssl_session_size) { - *ssl_size = sizeof(SSL); - *ssl_ctx_size = sizeof(SSL_CTX); - *ssl_session_size = sizeof(SSL_SESSION); -} - -int SSL_is_server(const SSL *ssl) { return ssl->server; } - -int SSL_is_dtls(const SSL *ssl) { return ssl->method->is_dtls; } - -void SSL_CTX_set_select_certificate_cb( - SSL_CTX *ctx, - enum ssl_select_cert_result_t (*cb)(const SSL_CLIENT_HELLO *)) { - ctx->select_certificate_cb = cb; -} - -void SSL_CTX_set_dos_protection_cb(SSL_CTX *ctx, - int (*cb)(const SSL_CLIENT_HELLO *)) { - ctx->dos_protection_cb = cb; -} - -void SSL_set_renegotiate_mode(SSL *ssl, enum ssl_renegotiate_mode_t mode) { - ssl->renegotiate_mode = mode; -} - -int SSL_get_ivs(const SSL *ssl, const uint8_t **out_read_iv, - const uint8_t **out_write_iv, size_t *out_iv_len) { - size_t write_iv_len; - if (!ssl->s3->aead_read_ctx->GetIV(out_read_iv, out_iv_len) || - !ssl->s3->aead_write_ctx->GetIV(out_write_iv, &write_iv_len) || - *out_iv_len != write_iv_len) { - return 0; - } - - return 1; -} - -static uint64_t be_to_u64(const uint8_t in[8]) { - return (((uint64_t)in[0]) << 56) | (((uint64_t)in[1]) << 48) | - (((uint64_t)in[2]) << 40) | (((uint64_t)in[3]) << 32) | - (((uint64_t)in[4]) << 24) | (((uint64_t)in[5]) << 16) | - (((uint64_t)in[6]) << 8) | ((uint64_t)in[7]); -} - -uint64_t SSL_get_read_sequence(const SSL *ssl) { - // TODO(davidben): Internally represent sequence numbers as uint64_t. - if (SSL_is_dtls(ssl)) { - // max_seq_num already includes the epoch. - assert(ssl->d1->r_epoch == (ssl->d1->bitmap.max_seq_num >> 48)); - return ssl->d1->bitmap.max_seq_num; - } - return be_to_u64(ssl->s3->read_sequence); -} - -uint64_t SSL_get_write_sequence(const SSL *ssl) { - uint64_t ret = be_to_u64(ssl->s3->write_sequence); - if (SSL_is_dtls(ssl)) { - assert((ret >> 48) == 0); - ret |= ((uint64_t)ssl->d1->w_epoch) << 48; - } - return ret; -} - -uint16_t SSL_get_peer_signature_algorithm(const SSL *ssl) { - // TODO(davidben): This checks the wrong session if there is a renegotiation - // in progress. - SSL_SESSION *session = SSL_get_session(ssl); - if (session == NULL) { - return 0; - } - - return session->peer_signature_algorithm; -} - -size_t SSL_get_client_random(const SSL *ssl, uint8_t *out, size_t max_out) { - if (max_out == 0) { - return sizeof(ssl->s3->client_random); - } - if (max_out > sizeof(ssl->s3->client_random)) { - max_out = sizeof(ssl->s3->client_random); - } - OPENSSL_memcpy(out, ssl->s3->client_random, max_out); - return max_out; -} - -size_t SSL_get_server_random(const SSL *ssl, uint8_t *out, size_t max_out) { - if (max_out == 0) { - return sizeof(ssl->s3->server_random); - } - if (max_out > sizeof(ssl->s3->server_random)) { - max_out = sizeof(ssl->s3->server_random); - } - OPENSSL_memcpy(out, ssl->s3->server_random, max_out); - return max_out; -} - -const SSL_CIPHER *SSL_get_pending_cipher(const SSL *ssl) { - SSL_HANDSHAKE *hs = ssl->s3->hs.get(); - if (hs == NULL) { - return NULL; - } - return hs->new_cipher; -} - -void SSL_set_retain_only_sha256_of_client_certs(SSL *ssl, int enabled) { - ssl->retain_only_sha256_of_client_certs = !!enabled; -} - -void SSL_CTX_set_retain_only_sha256_of_client_certs(SSL_CTX *ctx, int enabled) { - ctx->retain_only_sha256_of_client_certs = !!enabled; -} - -void SSL_CTX_set_grease_enabled(SSL_CTX *ctx, int enabled) { - ctx->grease_enabled = !!enabled; -} - -int32_t SSL_get_ticket_age_skew(const SSL *ssl) { - return ssl->s3->ticket_age_skew; -} - -void SSL_CTX_set_false_start_allowed_without_alpn(SSL_CTX *ctx, int allowed) { - ctx->false_start_allowed_without_alpn = !!allowed; -} - -int SSL_is_draft_downgrade(const SSL *ssl) { return ssl->s3->draft_downgrade; } - -int SSL_clear(SSL *ssl) { - // In OpenSSL, reusing a client |SSL| with |SSL_clear| causes the previously - // established session to be offered the next time around. wpa_supplicant - // depends on this behavior, so emulate it. - UniquePtr session; - if (!ssl->server && ssl->s3->established_session != NULL) { - session.reset(ssl->s3->established_session.get()); - SSL_SESSION_up_ref(session.get()); - } - - // The ssl->d1->mtu is simultaneously configuration (preserved across - // clear) and connection-specific state (gets reset). - // - // TODO(davidben): Avoid this. - unsigned mtu = 0; - if (ssl->d1 != NULL) { - mtu = ssl->d1->mtu; - } - - ssl->method->ssl_free(ssl); - if (!ssl->method->ssl_new(ssl)) { - return 0; - } - - if (SSL_is_dtls(ssl) && (SSL_get_options(ssl) & SSL_OP_NO_QUERY_MTU)) { - ssl->d1->mtu = mtu; - } - - if (session != nullptr) { - SSL_set_session(ssl, session.get()); - } - - return 1; -} - -int SSL_CTX_sess_connect(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_connect_good(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_connect_renegotiate(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_accept(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_accept_renegotiate(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_accept_good(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_hits(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_cb_hits(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_misses(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_timeouts(const SSL_CTX *ctx) { return 0; } -int SSL_CTX_sess_cache_full(const SSL_CTX *ctx) { return 0; } - -int SSL_num_renegotiations(const SSL *ssl) { - return SSL_total_renegotiations(ssl); -} - -int SSL_CTX_need_tmp_RSA(const SSL_CTX *ctx) { return 0; } -int SSL_need_tmp_RSA(const SSL *ssl) { return 0; } -int SSL_CTX_set_tmp_rsa(SSL_CTX *ctx, const RSA *rsa) { return 1; } -int SSL_set_tmp_rsa(SSL *ssl, const RSA *rsa) { return 1; } -void ERR_load_SSL_strings(void) {} -void SSL_load_error_strings(void) {} -int SSL_cache_hit(SSL *ssl) { return SSL_session_reused(ssl); } - -int SSL_CTX_set_tmp_ecdh(SSL_CTX *ctx, const EC_KEY *ec_key) { - if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); - return SSL_CTX_set1_curves(ctx, &nid, 1); -} - -int SSL_set_tmp_ecdh(SSL *ssl, const EC_KEY *ec_key) { - if (ec_key == NULL || EC_KEY_get0_group(ec_key) == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec_key)); - return SSL_set1_curves(ssl, &nid, 1); -} - -void SSL_CTX_set_ticket_aead_method(SSL_CTX *ctx, - const SSL_TICKET_AEAD_METHOD *aead_method) { - ctx->ticket_aead_method = aead_method; -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_privkey.cc b/Pods/BoringSSL-GRPC/ssl/ssl_privkey.cc deleted file mode 100644 index a5de161b5..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_privkey.cc +++ /dev/null @@ -1,494 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - - -namespace bssl { - -int ssl_is_key_type_supported(int key_type) { - return key_type == EVP_PKEY_RSA || key_type == EVP_PKEY_EC || - key_type == EVP_PKEY_ED25519; -} - -static int ssl_set_pkey(CERT *cert, EVP_PKEY *pkey) { - if (!ssl_is_key_type_supported(pkey->type)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); - return 0; - } - - if (cert->chain != NULL && - sk_CRYPTO_BUFFER_value(cert->chain, 0) != NULL && - // Sanity-check that the private key and the certificate match. - !ssl_cert_check_private_key(cert, pkey)) { - return 0; - } - - EVP_PKEY_free(cert->privatekey); - EVP_PKEY_up_ref(pkey); - cert->privatekey = pkey; - - return 1; -} - -typedef struct { - uint16_t sigalg; - int pkey_type; - int curve; - const EVP_MD *(*digest_func)(void); - char is_rsa_pss; -} SSL_SIGNATURE_ALGORITHM; - -static const SSL_SIGNATURE_ALGORITHM kSignatureAlgorithms[] = { - {SSL_SIGN_RSA_PKCS1_MD5_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_md5_sha1, 0}, - {SSL_SIGN_RSA_PKCS1_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_sha1, 0}, - {SSL_SIGN_RSA_PKCS1_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, 0}, - {SSL_SIGN_RSA_PKCS1_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, 0}, - {SSL_SIGN_RSA_PKCS1_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, 0}, - - {SSL_SIGN_RSA_PSS_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, 1}, - {SSL_SIGN_RSA_PSS_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, 1}, - {SSL_SIGN_RSA_PSS_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, 1}, - - {SSL_SIGN_ECDSA_SHA1, EVP_PKEY_EC, NID_undef, &EVP_sha1, 0}, - {SSL_SIGN_ECDSA_SECP256R1_SHA256, EVP_PKEY_EC, NID_X9_62_prime256v1, - &EVP_sha256, 0}, - {SSL_SIGN_ECDSA_SECP384R1_SHA384, EVP_PKEY_EC, NID_secp384r1, &EVP_sha384, - 0}, - {SSL_SIGN_ECDSA_SECP521R1_SHA512, EVP_PKEY_EC, NID_secp521r1, &EVP_sha512, - 0}, - - {SSL_SIGN_ED25519, EVP_PKEY_ED25519, NID_undef, NULL, 0}, -}; - -static const SSL_SIGNATURE_ALGORITHM *get_signature_algorithm(uint16_t sigalg) { - for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kSignatureAlgorithms); i++) { - if (kSignatureAlgorithms[i].sigalg == sigalg) { - return &kSignatureAlgorithms[i]; - } - } - return NULL; -} - -int ssl_has_private_key(const SSL *ssl) { - return ssl->cert->privatekey != NULL || ssl->cert->key_method != NULL; -} - -static int pkey_supports_algorithm(const SSL *ssl, EVP_PKEY *pkey, - uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - if (alg == NULL || - EVP_PKEY_id(pkey) != alg->pkey_type) { - return 0; - } - - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - // RSA keys may only be used with RSA-PSS. - if (alg->pkey_type == EVP_PKEY_RSA && !alg->is_rsa_pss) { - return 0; - } - - // EC keys have a curve requirement. - if (alg->pkey_type == EVP_PKEY_EC && - (alg->curve == NID_undef || - EC_GROUP_get_curve_name( - EC_KEY_get0_group(EVP_PKEY_get0_EC_KEY(pkey))) != alg->curve)) { - return 0; - } - } - - return 1; -} - -static int setup_ctx(SSL *ssl, EVP_MD_CTX *ctx, EVP_PKEY *pkey, uint16_t sigalg, - int is_verify) { - if (!pkey_supports_algorithm(ssl, pkey, sigalg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SIGNATURE_TYPE); - return 0; - } - - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - const EVP_MD *digest = alg->digest_func != NULL ? alg->digest_func() : NULL; - EVP_PKEY_CTX *pctx; - if (is_verify) { - if (!EVP_DigestVerifyInit(ctx, &pctx, digest, NULL, pkey)) { - return 0; - } - } else if (!EVP_DigestSignInit(ctx, &pctx, digest, NULL, pkey)) { - return 0; - } - - if (alg->is_rsa_pss) { - if (!EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || - !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1 /* salt len = hash len */)) { - return 0; - } - } - - return 1; -} - -enum ssl_private_key_result_t ssl_private_key_sign( - SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, - uint16_t sigalg, Span in) { - SSL *const ssl = hs->ssl; - if (ssl->cert->key_method != NULL) { - enum ssl_private_key_result_t ret; - if (hs->pending_private_key_op) { - ret = ssl->cert->key_method->complete(ssl, out, out_len, max_out); - } else { - ret = ssl->cert->key_method->sign(ssl, out, out_len, max_out, sigalg, - in.data(), in.size()); - } - if (ret == ssl_private_key_failure) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); - } - hs->pending_private_key_op = ret == ssl_private_key_retry; - return ret; - } - - *out_len = max_out; - ScopedEVP_MD_CTX ctx; - if (!setup_ctx(ssl, ctx.get(), ssl->cert->privatekey, sigalg, 0 /* sign */) || - !EVP_DigestSign(ctx.get(), out, out_len, in.data(), in.size())) { - return ssl_private_key_failure; - } - return ssl_private_key_success; -} - -bool ssl_public_key_verify(SSL *ssl, Span signature, - uint16_t sigalg, EVP_PKEY *pkey, - Span in) { - ScopedEVP_MD_CTX ctx; - return setup_ctx(ssl, ctx.get(), pkey, sigalg, 1 /* verify */) && - EVP_DigestVerify(ctx.get(), signature.data(), signature.size(), - in.data(), in.size()); -} - -enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, - uint8_t *out, - size_t *out_len, - size_t max_out, - Span in) { - SSL *const ssl = hs->ssl; - if (ssl->cert->key_method != NULL) { - enum ssl_private_key_result_t ret; - if (hs->pending_private_key_op) { - ret = ssl->cert->key_method->complete(ssl, out, out_len, max_out); - } else { - ret = ssl->cert->key_method->decrypt(ssl, out, out_len, max_out, - in.data(), in.size()); - } - if (ret == ssl_private_key_failure) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); - } - hs->pending_private_key_op = ret == ssl_private_key_retry; - return ret; - } - - RSA *rsa = EVP_PKEY_get0_RSA(ssl->cert->privatekey); - if (rsa == NULL) { - // Decrypt operations are only supported for RSA keys. - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - // Decrypt with no padding. PKCS#1 padding will be removed as part of the - // timing-sensitive code by the caller. - if (!RSA_decrypt(rsa, out_len, out, max_out, in.data(), in.size(), - RSA_NO_PADDING)) { - return ssl_private_key_failure; - } - return ssl_private_key_success; -} - -bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, - uint16_t sigalg) { - SSL *const ssl = hs->ssl; - if (!pkey_supports_algorithm(ssl, hs->local_pubkey.get(), sigalg)) { - return false; - } - - // Ensure the RSA key is large enough for the hash. RSASSA-PSS requires that - // emLen be at least hLen + sLen + 2. Both hLen and sLen are the size of the - // hash in TLS. Reasonable RSA key sizes are large enough for the largest - // defined RSASSA-PSS algorithm, but 1024-bit RSA is slightly too small for - // SHA-512. 1024-bit RSA is sometimes used for test credentials, so check the - // size so that we can fall back to another algorithm in that case. - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - if (alg->is_rsa_pss && (size_t)EVP_PKEY_size(hs->local_pubkey.get()) < - 2 * EVP_MD_size(alg->digest_func()) + 2) { - return false; - } - - return true; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) { - if (rsa == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - UniquePtr pkey(EVP_PKEY_new()); - if (!pkey || - !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); - return 0; - } - - return ssl_set_pkey(ssl->cert, pkey.get()); -} - -int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { - UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); - if (!rsa) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_use_RSAPrivateKey(ssl, rsa.get()); -} - -int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) { - if (pkey == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - return ssl_set_pkey(ssl->cert, pkey); -} - -int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const uint8_t *der, - size_t der_len) { - if (der_len > LONG_MAX) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - - const uint8_t *p = der; - UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); - if (!pkey || p != der + der_len) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_use_PrivateKey(ssl, pkey.get()); -} - -int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) { - if (rsa == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - UniquePtr pkey(EVP_PKEY_new()); - if (!pkey || - !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); - return 0; - } - - return ssl_set_pkey(ctx->cert, pkey.get()); -} - -int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const uint8_t *der, - size_t der_len) { - UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); - if (!rsa) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_CTX_use_RSAPrivateKey(ctx, rsa.get()); -} - -int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) { - if (pkey == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - return ssl_set_pkey(ctx->cert, pkey); -} - -int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const uint8_t *der, - size_t der_len) { - if (der_len > LONG_MAX) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - - const uint8_t *p = der; - UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); - if (!pkey || p != der + der_len) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_CTX_use_PrivateKey(ctx, pkey.get()); -} - -void SSL_set_private_key_method(SSL *ssl, - const SSL_PRIVATE_KEY_METHOD *key_method) { - ssl->cert->key_method = key_method; -} - -void SSL_CTX_set_private_key_method(SSL_CTX *ctx, - const SSL_PRIVATE_KEY_METHOD *key_method) { - ctx->cert->key_method = key_method; -} - -const char *SSL_get_signature_algorithm_name(uint16_t sigalg, - int include_curve) { - switch (sigalg) { - case SSL_SIGN_RSA_PKCS1_MD5_SHA1: - return "rsa_pkcs1_md5_sha1"; - case SSL_SIGN_RSA_PKCS1_SHA1: - return "rsa_pkcs1_sha1"; - case SSL_SIGN_RSA_PKCS1_SHA256: - return "rsa_pkcs1_sha256"; - case SSL_SIGN_RSA_PKCS1_SHA384: - return "rsa_pkcs1_sha384"; - case SSL_SIGN_RSA_PKCS1_SHA512: - return "rsa_pkcs1_sha512"; - case SSL_SIGN_ECDSA_SHA1: - return "ecdsa_sha1"; - case SSL_SIGN_ECDSA_SECP256R1_SHA256: - return include_curve ? "ecdsa_secp256r1_sha256" : "ecdsa_sha256"; - case SSL_SIGN_ECDSA_SECP384R1_SHA384: - return include_curve ? "ecdsa_secp384r1_sha384" : "ecdsa_sha384"; - case SSL_SIGN_ECDSA_SECP521R1_SHA512: - return include_curve ? "ecdsa_secp521r1_sha512" : "ecdsa_sha512"; - case SSL_SIGN_RSA_PSS_SHA256: - return "rsa_pss_sha256"; - case SSL_SIGN_RSA_PSS_SHA384: - return "rsa_pss_sha384"; - case SSL_SIGN_RSA_PSS_SHA512: - return "rsa_pss_sha512"; - case SSL_SIGN_ED25519: - return "ed25519"; - default: - return NULL; - } -} - -int SSL_get_signature_algorithm_key_type(uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - return alg != nullptr ? alg->pkey_type : EVP_PKEY_NONE; -} - -const EVP_MD *SSL_get_signature_algorithm_digest(uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - if (alg == nullptr || alg->digest_func == nullptr) { - return nullptr; - } - return alg->digest_func(); -} - -int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - return alg != nullptr && alg->is_rsa_pss; -} - -static int set_algorithm_prefs(uint16_t **out_prefs, size_t *out_num_prefs, - const uint16_t *prefs, size_t num_prefs) { - OPENSSL_free(*out_prefs); - - *out_num_prefs = 0; - *out_prefs = (uint16_t *)BUF_memdup(prefs, num_prefs * sizeof(prefs[0])); - if (*out_prefs == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - *out_num_prefs = num_prefs; - - return 1; -} - -int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, - size_t num_prefs) { - return set_algorithm_prefs(&ctx->cert->sigalgs, &ctx->cert->num_sigalgs, - prefs, num_prefs); -} - -int SSL_set_signing_algorithm_prefs(SSL *ssl, const uint16_t *prefs, - size_t num_prefs) { - return set_algorithm_prefs(&ssl->cert->sigalgs, &ssl->cert->num_sigalgs, - prefs, num_prefs); -} - -int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, - size_t num_prefs) { - return set_algorithm_prefs(&ctx->verify_sigalgs, &ctx->num_verify_sigalgs, - prefs, num_prefs); -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_privkey.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/ssl_privkey.cc.grpc_back deleted file mode 100644 index 33cc720a5..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_privkey.cc.grpc_back +++ /dev/null @@ -1,494 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] */ - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - - -namespace bssl { - -int ssl_is_key_type_supported(int key_type) { - return key_type == EVP_PKEY_RSA || key_type == EVP_PKEY_EC || - key_type == EVP_PKEY_ED25519; -} - -static int ssl_set_pkey(CERT *cert, EVP_PKEY *pkey) { - if (!ssl_is_key_type_supported(pkey->type)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE); - return 0; - } - - if (cert->chain != NULL && - sk_CRYPTO_BUFFER_value(cert->chain, 0) != NULL && - // Sanity-check that the private key and the certificate match. - !ssl_cert_check_private_key(cert, pkey)) { - return 0; - } - - EVP_PKEY_free(cert->privatekey); - EVP_PKEY_up_ref(pkey); - cert->privatekey = pkey; - - return 1; -} - -typedef struct { - uint16_t sigalg; - int pkey_type; - int curve; - const EVP_MD *(*digest_func)(void); - char is_rsa_pss; -} SSL_SIGNATURE_ALGORITHM; - -static const SSL_SIGNATURE_ALGORITHM kSignatureAlgorithms[] = { - {SSL_SIGN_RSA_PKCS1_MD5_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_md5_sha1, 0}, - {SSL_SIGN_RSA_PKCS1_SHA1, EVP_PKEY_RSA, NID_undef, &EVP_sha1, 0}, - {SSL_SIGN_RSA_PKCS1_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, 0}, - {SSL_SIGN_RSA_PKCS1_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, 0}, - {SSL_SIGN_RSA_PKCS1_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, 0}, - - {SSL_SIGN_RSA_PSS_SHA256, EVP_PKEY_RSA, NID_undef, &EVP_sha256, 1}, - {SSL_SIGN_RSA_PSS_SHA384, EVP_PKEY_RSA, NID_undef, &EVP_sha384, 1}, - {SSL_SIGN_RSA_PSS_SHA512, EVP_PKEY_RSA, NID_undef, &EVP_sha512, 1}, - - {SSL_SIGN_ECDSA_SHA1, EVP_PKEY_EC, NID_undef, &EVP_sha1, 0}, - {SSL_SIGN_ECDSA_SECP256R1_SHA256, EVP_PKEY_EC, NID_X9_62_prime256v1, - &EVP_sha256, 0}, - {SSL_SIGN_ECDSA_SECP384R1_SHA384, EVP_PKEY_EC, NID_secp384r1, &EVP_sha384, - 0}, - {SSL_SIGN_ECDSA_SECP521R1_SHA512, EVP_PKEY_EC, NID_secp521r1, &EVP_sha512, - 0}, - - {SSL_SIGN_ED25519, EVP_PKEY_ED25519, NID_undef, NULL, 0}, -}; - -static const SSL_SIGNATURE_ALGORITHM *get_signature_algorithm(uint16_t sigalg) { - for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kSignatureAlgorithms); i++) { - if (kSignatureAlgorithms[i].sigalg == sigalg) { - return &kSignatureAlgorithms[i]; - } - } - return NULL; -} - -int ssl_has_private_key(const SSL *ssl) { - return ssl->cert->privatekey != NULL || ssl->cert->key_method != NULL; -} - -static int pkey_supports_algorithm(const SSL *ssl, EVP_PKEY *pkey, - uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - if (alg == NULL || - EVP_PKEY_id(pkey) != alg->pkey_type) { - return 0; - } - - if (ssl_protocol_version(ssl) >= TLS1_3_VERSION) { - // RSA keys may only be used with RSA-PSS. - if (alg->pkey_type == EVP_PKEY_RSA && !alg->is_rsa_pss) { - return 0; - } - - // EC keys have a curve requirement. - if (alg->pkey_type == EVP_PKEY_EC && - (alg->curve == NID_undef || - EC_GROUP_get_curve_name( - EC_KEY_get0_group(EVP_PKEY_get0_EC_KEY(pkey))) != alg->curve)) { - return 0; - } - } - - return 1; -} - -static int setup_ctx(SSL *ssl, EVP_MD_CTX *ctx, EVP_PKEY *pkey, uint16_t sigalg, - int is_verify) { - if (!pkey_supports_algorithm(ssl, pkey, sigalg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_SIGNATURE_TYPE); - return 0; - } - - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - const EVP_MD *digest = alg->digest_func != NULL ? alg->digest_func() : NULL; - EVP_PKEY_CTX *pctx; - if (is_verify) { - if (!EVP_DigestVerifyInit(ctx, &pctx, digest, NULL, pkey)) { - return 0; - } - } else if (!EVP_DigestSignInit(ctx, &pctx, digest, NULL, pkey)) { - return 0; - } - - if (alg->is_rsa_pss) { - if (!EVP_PKEY_CTX_set_rsa_padding(pctx, RSA_PKCS1_PSS_PADDING) || - !EVP_PKEY_CTX_set_rsa_pss_saltlen(pctx, -1 /* salt len = hash len */)) { - return 0; - } - } - - return 1; -} - -enum ssl_private_key_result_t ssl_private_key_sign( - SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, size_t max_out, - uint16_t sigalg, Span in) { - SSL *const ssl = hs->ssl; - if (ssl->cert->key_method != NULL) { - enum ssl_private_key_result_t ret; - if (hs->pending_private_key_op) { - ret = ssl->cert->key_method->complete(ssl, out, out_len, max_out); - } else { - ret = ssl->cert->key_method->sign(ssl, out, out_len, max_out, sigalg, - in.data(), in.size()); - } - if (ret == ssl_private_key_failure) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); - } - hs->pending_private_key_op = ret == ssl_private_key_retry; - return ret; - } - - *out_len = max_out; - ScopedEVP_MD_CTX ctx; - if (!setup_ctx(ssl, ctx.get(), ssl->cert->privatekey, sigalg, 0 /* sign */) || - !EVP_DigestSign(ctx.get(), out, out_len, in.data(), in.size())) { - return ssl_private_key_failure; - } - return ssl_private_key_success; -} - -bool ssl_public_key_verify(SSL *ssl, Span signature, - uint16_t sigalg, EVP_PKEY *pkey, - Span in) { - ScopedEVP_MD_CTX ctx; - return setup_ctx(ssl, ctx.get(), pkey, sigalg, 1 /* verify */) && - EVP_DigestVerify(ctx.get(), signature.data(), signature.size(), - in.data(), in.size()); -} - -enum ssl_private_key_result_t ssl_private_key_decrypt(SSL_HANDSHAKE *hs, - uint8_t *out, - size_t *out_len, - size_t max_out, - Span in) { - SSL *const ssl = hs->ssl; - if (ssl->cert->key_method != NULL) { - enum ssl_private_key_result_t ret; - if (hs->pending_private_key_op) { - ret = ssl->cert->key_method->complete(ssl, out, out_len, max_out); - } else { - ret = ssl->cert->key_method->decrypt(ssl, out, out_len, max_out, - in.data(), in.size()); - } - if (ret == ssl_private_key_failure) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PRIVATE_KEY_OPERATION_FAILED); - } - hs->pending_private_key_op = ret == ssl_private_key_retry; - return ret; - } - - RSA *rsa = EVP_PKEY_get0_RSA(ssl->cert->privatekey); - if (rsa == NULL) { - // Decrypt operations are only supported for RSA keys. - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - // Decrypt with no padding. PKCS#1 padding will be removed as part of the - // timing-sensitive code by the caller. - if (!RSA_decrypt(rsa, out_len, out, max_out, in.data(), in.size(), - RSA_NO_PADDING)) { - return ssl_private_key_failure; - } - return ssl_private_key_success; -} - -bool ssl_private_key_supports_signature_algorithm(SSL_HANDSHAKE *hs, - uint16_t sigalg) { - SSL *const ssl = hs->ssl; - if (!pkey_supports_algorithm(ssl, hs->local_pubkey.get(), sigalg)) { - return false; - } - - // Ensure the RSA key is large enough for the hash. RSASSA-PSS requires that - // emLen be at least hLen + sLen + 2. Both hLen and sLen are the size of the - // hash in TLS. Reasonable RSA key sizes are large enough for the largest - // defined RSASSA-PSS algorithm, but 1024-bit RSA is slightly too small for - // SHA-512. 1024-bit RSA is sometimes used for test credentials, so check the - // size so that we can fall back to another algorithm in that case. - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - if (alg->is_rsa_pss && (size_t)EVP_PKEY_size(hs->local_pubkey.get()) < - 2 * EVP_MD_size(alg->digest_func()) + 2) { - return false; - } - - return true; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa) { - if (rsa == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - UniquePtr pkey(EVP_PKEY_new()); - if (!pkey || - !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); - return 0; - } - - return ssl_set_pkey(ssl->cert, pkey.get()); -} - -int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, const uint8_t *der, size_t der_len) { - UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); - if (!rsa) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_use_RSAPrivateKey(ssl, rsa.get()); -} - -int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey) { - if (pkey == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - return ssl_set_pkey(ssl->cert, pkey); -} - -int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const uint8_t *der, - size_t der_len) { - if (der_len > LONG_MAX) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - - const uint8_t *p = der; - UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); - if (!pkey || p != der + der_len) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_use_PrivateKey(ssl, pkey.get()); -} - -int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa) { - if (rsa == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - UniquePtr pkey(EVP_PKEY_new()); - if (!pkey || - !EVP_PKEY_set1_RSA(pkey.get(), rsa)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_EVP_LIB); - return 0; - } - - return ssl_set_pkey(ctx->cert, pkey.get()); -} - -int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const uint8_t *der, - size_t der_len) { - UniquePtr rsa(RSA_private_key_from_bytes(der, der_len)); - if (!rsa) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_CTX_use_RSAPrivateKey(ctx, rsa.get()); -} - -int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey) { - if (pkey == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_PASSED_NULL_PARAMETER); - return 0; - } - - return ssl_set_pkey(ctx->cert, pkey); -} - -int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const uint8_t *der, - size_t der_len) { - if (der_len > LONG_MAX) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - - const uint8_t *p = der; - UniquePtr pkey(d2i_PrivateKey(type, NULL, &p, (long)der_len)); - if (!pkey || p != der + der_len) { - OPENSSL_PUT_ERROR(SSL, ERR_R_ASN1_LIB); - return 0; - } - - return SSL_CTX_use_PrivateKey(ctx, pkey.get()); -} - -void SSL_set_private_key_method(SSL *ssl, - const SSL_PRIVATE_KEY_METHOD *key_method) { - ssl->cert->key_method = key_method; -} - -void SSL_CTX_set_private_key_method(SSL_CTX *ctx, - const SSL_PRIVATE_KEY_METHOD *key_method) { - ctx->cert->key_method = key_method; -} - -const char *SSL_get_signature_algorithm_name(uint16_t sigalg, - int include_curve) { - switch (sigalg) { - case SSL_SIGN_RSA_PKCS1_MD5_SHA1: - return "rsa_pkcs1_md5_sha1"; - case SSL_SIGN_RSA_PKCS1_SHA1: - return "rsa_pkcs1_sha1"; - case SSL_SIGN_RSA_PKCS1_SHA256: - return "rsa_pkcs1_sha256"; - case SSL_SIGN_RSA_PKCS1_SHA384: - return "rsa_pkcs1_sha384"; - case SSL_SIGN_RSA_PKCS1_SHA512: - return "rsa_pkcs1_sha512"; - case SSL_SIGN_ECDSA_SHA1: - return "ecdsa_sha1"; - case SSL_SIGN_ECDSA_SECP256R1_SHA256: - return include_curve ? "ecdsa_secp256r1_sha256" : "ecdsa_sha256"; - case SSL_SIGN_ECDSA_SECP384R1_SHA384: - return include_curve ? "ecdsa_secp384r1_sha384" : "ecdsa_sha384"; - case SSL_SIGN_ECDSA_SECP521R1_SHA512: - return include_curve ? "ecdsa_secp521r1_sha512" : "ecdsa_sha512"; - case SSL_SIGN_RSA_PSS_SHA256: - return "rsa_pss_sha256"; - case SSL_SIGN_RSA_PSS_SHA384: - return "rsa_pss_sha384"; - case SSL_SIGN_RSA_PSS_SHA512: - return "rsa_pss_sha512"; - case SSL_SIGN_ED25519: - return "ed25519"; - default: - return NULL; - } -} - -int SSL_get_signature_algorithm_key_type(uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - return alg != nullptr ? alg->pkey_type : EVP_PKEY_NONE; -} - -const EVP_MD *SSL_get_signature_algorithm_digest(uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - if (alg == nullptr || alg->digest_func == nullptr) { - return nullptr; - } - return alg->digest_func(); -} - -int SSL_is_signature_algorithm_rsa_pss(uint16_t sigalg) { - const SSL_SIGNATURE_ALGORITHM *alg = get_signature_algorithm(sigalg); - return alg != nullptr && alg->is_rsa_pss; -} - -static int set_algorithm_prefs(uint16_t **out_prefs, size_t *out_num_prefs, - const uint16_t *prefs, size_t num_prefs) { - OPENSSL_free(*out_prefs); - - *out_num_prefs = 0; - *out_prefs = (uint16_t *)BUF_memdup(prefs, num_prefs * sizeof(prefs[0])); - if (*out_prefs == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - *out_num_prefs = num_prefs; - - return 1; -} - -int SSL_CTX_set_signing_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, - size_t num_prefs) { - return set_algorithm_prefs(&ctx->cert->sigalgs, &ctx->cert->num_sigalgs, - prefs, num_prefs); -} - -int SSL_set_signing_algorithm_prefs(SSL *ssl, const uint16_t *prefs, - size_t num_prefs) { - return set_algorithm_prefs(&ssl->cert->sigalgs, &ssl->cert->num_sigalgs, - prefs, num_prefs); -} - -int SSL_CTX_set_verify_algorithm_prefs(SSL_CTX *ctx, const uint16_t *prefs, - size_t num_prefs) { - return set_algorithm_prefs(&ctx->verify_sigalgs, &ctx->num_verify_sigalgs, - prefs, num_prefs); -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_transcript.cc b/Pods/BoringSSL-GRPC/ssl/ssl_transcript.cc deleted file mode 100644 index 36ffde179..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_transcript.cc +++ /dev/null @@ -1,398 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. */ - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -SSLTranscript::SSLTranscript() {} - -SSLTranscript::~SSLTranscript() {} - -bool SSLTranscript::Init() { - buffer_.reset(BUF_MEM_new()); - if (!buffer_) { - return false; - } - - hash_.Reset(); - md5_.Reset(); - return true; -} - -// InitDigestWithData calls |EVP_DigestInit_ex| on |ctx| with |md| and then -// writes the data in |buf| to it. -static bool InitDigestWithData(EVP_MD_CTX *ctx, const EVP_MD *md, - const BUF_MEM *buf) { - if (!EVP_DigestInit_ex(ctx, md, NULL)) { - return false; - } - EVP_DigestUpdate(ctx, buf->data, buf->length); - return true; -} - -bool SSLTranscript::InitHash(uint16_t version, const SSL_CIPHER *cipher) { - const EVP_MD *md = ssl_get_handshake_digest(version, cipher); - - // To support SSL 3.0's Finished and CertificateVerify constructions, - // EVP_md5_sha1() is split into MD5 and SHA-1 halves. When SSL 3.0 is removed, - // we can simplify this. - if (md == EVP_md5_sha1()) { - if (!InitDigestWithData(md5_.get(), EVP_md5(), buffer_.get())) { - return false; - } - md = EVP_sha1(); - } - - return InitDigestWithData(hash_.get(), md, buffer_.get()); -} - -void SSLTranscript::FreeBuffer() { - buffer_.reset(); -} - -size_t SSLTranscript::DigestLen() const { - return EVP_MD_size(Digest()); -} - -const EVP_MD *SSLTranscript::Digest() const { - if (EVP_MD_CTX_md(md5_.get()) != nullptr) { - return EVP_md5_sha1(); - } - return EVP_MD_CTX_md(hash_.get()); -} - -bool SSLTranscript::UpdateForHelloRetryRequest() { - if (buffer_) { - buffer_->length = 0; - } - - uint8_t old_hash[EVP_MAX_MD_SIZE]; - size_t hash_len; - if (!GetHash(old_hash, &hash_len)) { - return false; - } - const uint8_t header[4] = {SSL3_MT_MESSAGE_HASH, 0, 0, - static_cast(hash_len)}; - if (!EVP_DigestInit_ex(hash_.get(), Digest(), nullptr) || - !Update(header) || - !Update(MakeConstSpan(old_hash, hash_len))) { - return false; - } - return true; -} - -bool SSLTranscript::CopyHashContext(EVP_MD_CTX *ctx) { - return EVP_MD_CTX_copy_ex(ctx, hash_.get()); -} - -bool SSLTranscript::Update(Span in) { - // Depending on the state of the handshake, either the handshake buffer may be - // active, the rolling hash, or both. - if (buffer_ && - !BUF_MEM_append(buffer_.get(), in.data(), in.size())) { - return false; - } - - if (EVP_MD_CTX_md(hash_.get()) != NULL) { - EVP_DigestUpdate(hash_.get(), in.data(), in.size()); - } - if (EVP_MD_CTX_md(md5_.get()) != NULL) { - EVP_DigestUpdate(md5_.get(), in.data(), in.size()); - } - - return true; -} - -bool SSLTranscript::GetHash(uint8_t *out, size_t *out_len) { - ScopedEVP_MD_CTX ctx; - unsigned md5_len = 0; - if (EVP_MD_CTX_md(md5_.get()) != NULL) { - if (!EVP_MD_CTX_copy_ex(ctx.get(), md5_.get()) || - !EVP_DigestFinal_ex(ctx.get(), out, &md5_len)) { - return false; - } - } - - unsigned len; - if (!EVP_MD_CTX_copy_ex(ctx.get(), hash_.get()) || - !EVP_DigestFinal_ex(ctx.get(), out + md5_len, &len)) { - return false; - } - - *out_len = md5_len + len; - return true; -} - -static bool SSL3HandshakeMAC(const SSL_SESSION *session, - const EVP_MD_CTX *ctx_template, const char *sender, - size_t sender_len, uint8_t *p, size_t *out_len) { - ScopedEVP_MD_CTX ctx; - if (!EVP_MD_CTX_copy_ex(ctx.get(), ctx_template)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - - static const uint8_t kPad1[48] = { - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - }; - - static const uint8_t kPad2[48] = { - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - }; - - size_t n = EVP_MD_CTX_size(ctx.get()); - - size_t npad = (48 / n) * n; - EVP_DigestUpdate(ctx.get(), sender, sender_len); - EVP_DigestUpdate(ctx.get(), session->master_key, session->master_key_length); - EVP_DigestUpdate(ctx.get(), kPad1, npad); - unsigned md_buf_len; - uint8_t md_buf[EVP_MAX_MD_SIZE]; - EVP_DigestFinal_ex(ctx.get(), md_buf, &md_buf_len); - - if (!EVP_DigestInit_ex(ctx.get(), EVP_MD_CTX_md(ctx.get()), NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - EVP_DigestUpdate(ctx.get(), session->master_key, session->master_key_length); - EVP_DigestUpdate(ctx.get(), kPad2, npad); - EVP_DigestUpdate(ctx.get(), md_buf, md_buf_len); - unsigned len; - EVP_DigestFinal_ex(ctx.get(), p, &len); - - *out_len = len; - return true; -} - -bool SSLTranscript::GetSSL3CertVerifyHash(uint8_t *out, size_t *out_len, - const SSL_SESSION *session, - uint16_t signature_algorithm) { - if (Digest() != EVP_md5_sha1()) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - - if (signature_algorithm == SSL_SIGN_RSA_PKCS1_MD5_SHA1) { - size_t md5_len, len; - if (!SSL3HandshakeMAC(session, md5_.get(), NULL, 0, out, &md5_len) || - !SSL3HandshakeMAC(session, hash_.get(), NULL, 0, out + md5_len, &len)) { - return false; - } - *out_len = md5_len + len; - return true; - } - - if (signature_algorithm == SSL_SIGN_ECDSA_SHA1) { - return SSL3HandshakeMAC(session, hash_.get(), NULL, 0, out, out_len); - } - - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; -} - -bool SSLTranscript::GetFinishedMAC(uint8_t *out, size_t *out_len, - const SSL_SESSION *session, - bool from_server) { - if (session->ssl_version == SSL3_VERSION) { - if (Digest() != EVP_md5_sha1()) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - - const char *sender = from_server ? SSL3_MD_SERVER_FINISHED_CONST - : SSL3_MD_CLIENT_FINISHED_CONST; - const size_t sender_len = 4; - size_t md5_len, len; - if (!SSL3HandshakeMAC(session, md5_.get(), sender, sender_len, out, - &md5_len) || - !SSL3HandshakeMAC(session, hash_.get(), sender, sender_len, - out + md5_len, &len)) { - return false; - } - - *out_len = md5_len + len; - return true; - } - - // At this point, the handshake should have released the handshake buffer on - // its own. - assert(!buffer_); - - static const char kClientLabel[] = "client finished"; - static const char kServerLabel[] = "server finished"; - auto label = from_server - ? MakeConstSpan(kServerLabel, sizeof(kServerLabel) - 1) - : MakeConstSpan(kClientLabel, sizeof(kClientLabel) - 1); - - uint8_t digests[EVP_MAX_MD_SIZE]; - size_t digests_len; - if (!GetHash(digests, &digests_len)) { - return false; - } - - static const size_t kFinishedLen = 12; - if (!tls1_prf(Digest(), MakeSpan(out, kFinishedLen), - MakeConstSpan(session->master_key, session->master_key_length), - label, MakeConstSpan(digests, digests_len), {})) { - return false; - } - - *out_len = kFinishedLen; - return true; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_transcript.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/ssl_transcript.cc.grpc_back deleted file mode 100644 index 2033dfd47..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_transcript.cc.grpc_back +++ /dev/null @@ -1,398 +0,0 @@ -/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) - * All rights reserved. - * - * This package is an SSL implementation written - * by Eric Young (eay@cryptsoft.com). - * The implementation was written so as to conform with Netscapes SSL. - * - * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions - * apply to all code found in this distribution, be it the RC4, RSA, - * lhash, DES, etc., code; not just the SSL code. The SSL documentation - * included with this distribution is covered by the same copyright terms - * except that the holder is Tim Hudson (tjh@cryptsoft.com). - * - * Copyright remains Eric Young's, and as such any Copyright notices in - * the code are not to be removed. - * If this package is used in a product, Eric Young should be given attribution - * as the author of the parts of the library used. - * This can be in the form of a textual message at program startup or - * in documentation (online or textual) provided with the package. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * "This product includes cryptographic software written by - * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library - * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from - * the apps directory (application code) you must include an acknowledgement: - * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" - * - * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * The licence and distribution terms for any publically available version or - * derivative of this code cannot be changed. i.e. this code cannot simply be - * copied and put under another distribution licence - * [including the GNU Public Licence.] - */ -/* ==================================================================== - * Copyright (c) 1998-2007 The OpenSSL Project. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * 3. All advertising materials mentioning features or use of this - * software must display the following acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - * - * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - * endorse or promote products derived from this software without - * prior written permission. For written permission, please contact - * openssl-core@openssl.org. - * - * 5. Products derived from this software may not be called "OpenSSL" - * nor may "OpenSSL" appear in their names without prior written - * permission of the OpenSSL Project. - * - * 6. Redistributions of any form whatsoever must retain the following - * acknowledgment: - * "This product includes software developed by the OpenSSL Project - * for use in the OpenSSL Toolkit (http://www.openssl.org/)" - * - * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * ==================================================================== - * - * This product includes cryptographic software written by Eric Young - * (eay@cryptsoft.com). This product includes software written by Tim - * Hudson (tjh@cryptsoft.com). - * - */ -/* ==================================================================== - * Copyright 2005 Nokia. All rights reserved. - * - * The portions of the attached software ("Contribution") is developed by - * Nokia Corporation and is licensed pursuant to the OpenSSL open source - * license. - * - * The Contribution, originally written by Mika Kousa and Pasi Eronen of - * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites - * support (see RFC 4279) to OpenSSL. - * - * No patent licenses or other rights except those expressly stated in - * the OpenSSL open source license shall be deemed granted or received - * expressly, by implication, estoppel, or otherwise. - * - * No assurances are provided by Nokia that the Contribution does not - * infringe the patent or other intellectual property rights of any third - * party or that the license provides you with all the necessary rights - * to make use of the Contribution. - * - * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN - * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA - * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY - * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR - * OTHERWISE. */ - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -SSLTranscript::SSLTranscript() {} - -SSLTranscript::~SSLTranscript() {} - -bool SSLTranscript::Init() { - buffer_.reset(BUF_MEM_new()); - if (!buffer_) { - return false; - } - - hash_.Reset(); - md5_.Reset(); - return true; -} - -// InitDigestWithData calls |EVP_DigestInit_ex| on |ctx| with |md| and then -// writes the data in |buf| to it. -static bool InitDigestWithData(EVP_MD_CTX *ctx, const EVP_MD *md, - const BUF_MEM *buf) { - if (!EVP_DigestInit_ex(ctx, md, NULL)) { - return false; - } - EVP_DigestUpdate(ctx, buf->data, buf->length); - return true; -} - -bool SSLTranscript::InitHash(uint16_t version, const SSL_CIPHER *cipher) { - const EVP_MD *md = ssl_get_handshake_digest(version, cipher); - - // To support SSL 3.0's Finished and CertificateVerify constructions, - // EVP_md5_sha1() is split into MD5 and SHA-1 halves. When SSL 3.0 is removed, - // we can simplify this. - if (md == EVP_md5_sha1()) { - if (!InitDigestWithData(md5_.get(), EVP_md5(), buffer_.get())) { - return false; - } - md = EVP_sha1(); - } - - return InitDigestWithData(hash_.get(), md, buffer_.get()); -} - -void SSLTranscript::FreeBuffer() { - buffer_.reset(); -} - -size_t SSLTranscript::DigestLen() const { - return EVP_MD_size(Digest()); -} - -const EVP_MD *SSLTranscript::Digest() const { - if (EVP_MD_CTX_md(md5_.get()) != nullptr) { - return EVP_md5_sha1(); - } - return EVP_MD_CTX_md(hash_.get()); -} - -bool SSLTranscript::UpdateForHelloRetryRequest() { - if (buffer_) { - buffer_->length = 0; - } - - uint8_t old_hash[EVP_MAX_MD_SIZE]; - size_t hash_len; - if (!GetHash(old_hash, &hash_len)) { - return false; - } - const uint8_t header[4] = {SSL3_MT_MESSAGE_HASH, 0, 0, - static_cast(hash_len)}; - if (!EVP_DigestInit_ex(hash_.get(), Digest(), nullptr) || - !Update(header) || - !Update(MakeConstSpan(old_hash, hash_len))) { - return false; - } - return true; -} - -bool SSLTranscript::CopyHashContext(EVP_MD_CTX *ctx) { - return EVP_MD_CTX_copy_ex(ctx, hash_.get()); -} - -bool SSLTranscript::Update(Span in) { - // Depending on the state of the handshake, either the handshake buffer may be - // active, the rolling hash, or both. - if (buffer_ && - !BUF_MEM_append(buffer_.get(), in.data(), in.size())) { - return false; - } - - if (EVP_MD_CTX_md(hash_.get()) != NULL) { - EVP_DigestUpdate(hash_.get(), in.data(), in.size()); - } - if (EVP_MD_CTX_md(md5_.get()) != NULL) { - EVP_DigestUpdate(md5_.get(), in.data(), in.size()); - } - - return true; -} - -bool SSLTranscript::GetHash(uint8_t *out, size_t *out_len) { - ScopedEVP_MD_CTX ctx; - unsigned md5_len = 0; - if (EVP_MD_CTX_md(md5_.get()) != NULL) { - if (!EVP_MD_CTX_copy_ex(ctx.get(), md5_.get()) || - !EVP_DigestFinal_ex(ctx.get(), out, &md5_len)) { - return false; - } - } - - unsigned len; - if (!EVP_MD_CTX_copy_ex(ctx.get(), hash_.get()) || - !EVP_DigestFinal_ex(ctx.get(), out + md5_len, &len)) { - return false; - } - - *out_len = md5_len + len; - return true; -} - -static bool SSL3HandshakeMAC(const SSL_SESSION *session, - const EVP_MD_CTX *ctx_template, const char *sender, - size_t sender_len, uint8_t *p, size_t *out_len) { - ScopedEVP_MD_CTX ctx; - if (!EVP_MD_CTX_copy_ex(ctx.get(), ctx_template)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - - static const uint8_t kPad1[48] = { - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - }; - - static const uint8_t kPad2[48] = { - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, 0x5c, - }; - - size_t n = EVP_MD_CTX_size(ctx.get()); - - size_t npad = (48 / n) * n; - EVP_DigestUpdate(ctx.get(), sender, sender_len); - EVP_DigestUpdate(ctx.get(), session->master_key, session->master_key_length); - EVP_DigestUpdate(ctx.get(), kPad1, npad); - unsigned md_buf_len; - uint8_t md_buf[EVP_MAX_MD_SIZE]; - EVP_DigestFinal_ex(ctx.get(), md_buf, &md_buf_len); - - if (!EVP_DigestInit_ex(ctx.get(), EVP_MD_CTX_md(ctx.get()), NULL)) { - OPENSSL_PUT_ERROR(SSL, ERR_LIB_EVP); - return false; - } - EVP_DigestUpdate(ctx.get(), session->master_key, session->master_key_length); - EVP_DigestUpdate(ctx.get(), kPad2, npad); - EVP_DigestUpdate(ctx.get(), md_buf, md_buf_len); - unsigned len; - EVP_DigestFinal_ex(ctx.get(), p, &len); - - *out_len = len; - return true; -} - -bool SSLTranscript::GetSSL3CertVerifyHash(uint8_t *out, size_t *out_len, - const SSL_SESSION *session, - uint16_t signature_algorithm) { - if (Digest() != EVP_md5_sha1()) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - - if (signature_algorithm == SSL_SIGN_RSA_PKCS1_MD5_SHA1) { - size_t md5_len, len; - if (!SSL3HandshakeMAC(session, md5_.get(), NULL, 0, out, &md5_len) || - !SSL3HandshakeMAC(session, hash_.get(), NULL, 0, out + md5_len, &len)) { - return false; - } - *out_len = md5_len + len; - return true; - } - - if (signature_algorithm == SSL_SIGN_ECDSA_SHA1) { - return SSL3HandshakeMAC(session, hash_.get(), NULL, 0, out, out_len); - } - - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; -} - -bool SSLTranscript::GetFinishedMAC(uint8_t *out, size_t *out_len, - const SSL_SESSION *session, - bool from_server) { - if (session->ssl_version == SSL3_VERSION) { - if (Digest() != EVP_md5_sha1()) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return false; - } - - const char *sender = from_server ? SSL3_MD_SERVER_FINISHED_CONST - : SSL3_MD_CLIENT_FINISHED_CONST; - const size_t sender_len = 4; - size_t md5_len, len; - if (!SSL3HandshakeMAC(session, md5_.get(), sender, sender_len, out, - &md5_len) || - !SSL3HandshakeMAC(session, hash_.get(), sender, sender_len, - out + md5_len, &len)) { - return false; - } - - *out_len = md5_len + len; - return true; - } - - // At this point, the handshake should have released the handshake buffer on - // its own. - assert(!buffer_); - - static const char kClientLabel[] = "client finished"; - static const char kServerLabel[] = "server finished"; - auto label = from_server - ? MakeConstSpan(kServerLabel, sizeof(kServerLabel) - 1) - : MakeConstSpan(kClientLabel, sizeof(kClientLabel) - 1); - - uint8_t digests[EVP_MAX_MD_SIZE]; - size_t digests_len; - if (!GetHash(digests, &digests_len)) { - return false; - } - - static const size_t kFinishedLen = 12; - if (!tls1_prf(Digest(), MakeSpan(out, kFinishedLen), - MakeConstSpan(session->master_key, session->master_key_length), - label, MakeConstSpan(digests, digests_len), {})) { - return false; - } - - *out_len = kFinishedLen; - return true; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_versions.cc b/Pods/BoringSSL-GRPC/ssl/ssl_versions.cc deleted file mode 100644 index 876432244..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_versions.cc +++ /dev/null @@ -1,399 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - - -namespace bssl { - -bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version) { - switch (version) { - case SSL3_VERSION: - case TLS1_VERSION: - case TLS1_1_VERSION: - case TLS1_2_VERSION: - *out = version; - return true; - - case TLS1_3_DRAFT23_VERSION: - *out = TLS1_3_VERSION; - return true; - - case DTLS1_VERSION: - // DTLS 1.0 is analogous to TLS 1.1, not TLS 1.0. - *out = TLS1_1_VERSION; - return true; - - case DTLS1_2_VERSION: - *out = TLS1_2_VERSION; - return true; - - default: - return false; - } -} - -// The follow arrays are the supported versions for TLS and DTLS, in order of -// decreasing preference. - -static const uint16_t kTLSVersions[] = { - TLS1_3_DRAFT23_VERSION, - TLS1_2_VERSION, - TLS1_1_VERSION, - TLS1_VERSION, - SSL3_VERSION, -}; - -static const uint16_t kDTLSVersions[] = { - DTLS1_2_VERSION, - DTLS1_VERSION, -}; - -static void get_method_versions(const SSL_PROTOCOL_METHOD *method, - const uint16_t **out, size_t *out_num) { - if (method->is_dtls) { - *out = kDTLSVersions; - *out_num = OPENSSL_ARRAY_SIZE(kDTLSVersions); - } else { - *out = kTLSVersions; - *out_num = OPENSSL_ARRAY_SIZE(kTLSVersions); - } -} - -static bool method_supports_version(const SSL_PROTOCOL_METHOD *method, - uint16_t version) { - const uint16_t *versions; - size_t num_versions; - get_method_versions(method, &versions, &num_versions); - for (size_t i = 0; i < num_versions; i++) { - if (versions[i] == version) { - return true; - } - } - return false; -} - -// The following functions map between API versions and wire versions. The -// public API works on wire versions, except that TLS 1.3 draft versions all -// appear as TLS 1.3. This will get collapsed back down when TLS 1.3 is -// finalized. - -static const char *ssl_version_to_string(uint16_t version) { - switch (version) { - case TLS1_3_DRAFT23_VERSION: - return "TLSv1.3"; - - case TLS1_2_VERSION: - return "TLSv1.2"; - - case TLS1_1_VERSION: - return "TLSv1.1"; - - case TLS1_VERSION: - return "TLSv1"; - - case SSL3_VERSION: - return "SSLv3"; - - case DTLS1_VERSION: - return "DTLSv1"; - - case DTLS1_2_VERSION: - return "DTLSv1.2"; - - default: - return "unknown"; - } -} - -static uint16_t wire_version_to_api(uint16_t version) { - switch (version) { - // Report TLS 1.3 draft versions as TLS 1.3 in the public API. - case TLS1_3_DRAFT23_VERSION: - return TLS1_3_VERSION; - default: - return version; - } -} - -// api_version_to_wire maps |version| to some representative wire version. In -// particular, it picks an arbitrary TLS 1.3 representative. This should only be -// used in context where that does not matter. -static bool api_version_to_wire(uint16_t *out, uint16_t version) { - if (version == TLS1_3_DRAFT23_VERSION) { - return false; - } - if (version == TLS1_3_VERSION) { - version = TLS1_3_DRAFT23_VERSION; - } - - // Check it is a real protocol version. - uint16_t unused; - if (!ssl_protocol_version_from_wire(&unused, version)) { - return false; - } - - *out = version; - return true; -} - -static bool set_version_bound(const SSL_PROTOCOL_METHOD *method, uint16_t *out, - uint16_t version) { - if (!api_version_to_wire(&version, version) || - !method_supports_version(method, version) || - !ssl_protocol_version_from_wire(out, version)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_SSL_VERSION); - return false; - } - - return true; -} - -static bool set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, - uint16_t version) { - // Zero is interpreted as the default minimum version. - if (version == 0) { - // SSL 3.0 is disabled by default and TLS 1.0 does not exist in DTLS. - *out = method->is_dtls ? TLS1_1_VERSION : TLS1_VERSION; - return true; - } - - return set_version_bound(method, out, version); -} - -static bool set_max_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, - uint16_t version) { - // Zero is interpreted as the default maximum version. - if (version == 0) { - *out = TLS1_2_VERSION; - return true; - } - - return set_version_bound(method, out, version); -} - -const struct { - uint16_t version; - uint32_t flag; -} kProtocolVersions[] = { - {SSL3_VERSION, SSL_OP_NO_SSLv3}, - {TLS1_VERSION, SSL_OP_NO_TLSv1}, - {TLS1_1_VERSION, SSL_OP_NO_TLSv1_1}, - {TLS1_2_VERSION, SSL_OP_NO_TLSv1_2}, - {TLS1_3_VERSION, SSL_OP_NO_TLSv1_3}, -}; - -bool ssl_get_version_range(const SSL *ssl, uint16_t *out_min_version, - uint16_t *out_max_version) { - // For historical reasons, |SSL_OP_NO_DTLSv1| aliases |SSL_OP_NO_TLSv1|, but - // DTLS 1.0 should be mapped to TLS 1.1. - uint32_t options = ssl->options; - if (SSL_is_dtls(ssl)) { - options &= ~SSL_OP_NO_TLSv1_1; - if (options & SSL_OP_NO_DTLSv1) { - options |= SSL_OP_NO_TLSv1_1; - } - } - - uint16_t min_version = ssl->conf_min_version; - uint16_t max_version = ssl->conf_max_version; - - // OpenSSL's API for controlling versions entails blacklisting individual - // protocols. This has two problems. First, on the client, the protocol can - // only express a contiguous range of versions. Second, a library consumer - // trying to set a maximum version cannot disable protocol versions that get - // added in a future version of the library. - // - // To account for both of these, OpenSSL interprets the client-side bitmask - // as a min/max range by picking the lowest contiguous non-empty range of - // enabled protocols. Note that this means it is impossible to set a maximum - // version of the higest supported TLS version in a future-proof way. - bool any_enabled = false; - for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kProtocolVersions); i++) { - // Only look at the versions already enabled. - if (min_version > kProtocolVersions[i].version) { - continue; - } - if (max_version < kProtocolVersions[i].version) { - break; - } - - if (!(options & kProtocolVersions[i].flag)) { - // The minimum version is the first enabled version. - if (!any_enabled) { - any_enabled = true; - min_version = kProtocolVersions[i].version; - } - continue; - } - - // If there is a disabled version after the first enabled one, all versions - // after it are implicitly disabled. - if (any_enabled) { - max_version = kProtocolVersions[i-1].version; - break; - } - } - - if (!any_enabled) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SUPPORTED_VERSIONS_ENABLED); - return false; - } - - *out_min_version = min_version; - *out_max_version = max_version; - return true; -} - -static uint16_t ssl_version(const SSL *ssl) { - // In early data, we report the predicted version. - if (SSL_in_early_data(ssl) && !ssl->server) { - return ssl->s3->hs->early_session->ssl_version; - } - return ssl->version; -} - -uint16_t ssl_protocol_version(const SSL *ssl) { - assert(ssl->s3->have_version); - uint16_t version; - if (!ssl_protocol_version_from_wire(&version, ssl->version)) { - // |ssl->version| will always be set to a valid version. - assert(0); - return 0; - } - - return version; -} - -bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version) { - SSL *const ssl = hs->ssl; - uint16_t protocol_version; - if (!method_supports_version(ssl->method, version) || - !ssl_protocol_version_from_wire(&protocol_version, version) || - hs->min_version > protocol_version || - protocol_version > hs->max_version) { - return false; - } - - // This logic is part of the TLS 1.3 variants mechanism used in TLS 1.3 - // experimentation. Although we currently only have one variant, TLS 1.3 does - // not a final stable deployment yet, so leave the logic in place for now. - if (protocol_version != TLS1_3_VERSION || - (ssl->tls13_variant == tls13_default && - version == TLS1_3_DRAFT23_VERSION)) { - return true; - } - - // The server, when not configured at |tls13_default|, should additionally - // enable all variants. - if (ssl->server && ssl->tls13_variant != tls13_default) { - return true; - } - - return false; -} - -bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb) { - const uint16_t *versions; - size_t num_versions; - get_method_versions(hs->ssl->method, &versions, &num_versions); - for (size_t i = 0; i < num_versions; i++) { - if (ssl_supports_version(hs, versions[i]) && - !CBB_add_u16(cbb, versions[i])) { - return false; - } - } - return true; -} - -bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, - uint16_t *out_version, const CBS *peer_versions) { - const uint16_t *versions; - size_t num_versions; - get_method_versions(hs->ssl->method, &versions, &num_versions); - for (size_t i = 0; i < num_versions; i++) { - if (!ssl_supports_version(hs, versions[i])) { - continue; - } - - CBS copy = *peer_versions; - while (CBS_len(©) != 0) { - uint16_t version; - if (!CBS_get_u16(©, &version)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - *out_alert = SSL_AD_DECODE_ERROR; - return false; - } - - if (version == versions[i]) { - *out_version = version; - return true; - } - } - } - - OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL); - *out_alert = SSL_AD_PROTOCOL_VERSION; - return false; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) { - return set_min_version(ctx->method, &ctx->conf_min_version, version); -} - -int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) { - return set_max_version(ctx->method, &ctx->conf_max_version, version); -} - -int SSL_set_min_proto_version(SSL *ssl, uint16_t version) { - return set_min_version(ssl->method, &ssl->conf_min_version, version); -} - -int SSL_set_max_proto_version(SSL *ssl, uint16_t version) { - return set_max_version(ssl->method, &ssl->conf_max_version, version); -} - -int SSL_version(const SSL *ssl) { - return wire_version_to_api(ssl_version(ssl)); -} - -const char *SSL_get_version(const SSL *ssl) { - return ssl_version_to_string(ssl_version(ssl)); -} - -const char *SSL_SESSION_get_version(const SSL_SESSION *session) { - return ssl_version_to_string(session->ssl_version); -} - -uint16_t SSL_SESSION_get_protocol_version(const SSL_SESSION *session) { - return wire_version_to_api(session->ssl_version); -} - -int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version) { - // This picks a representative TLS 1.3 version, but this API should only be - // used on unit test sessions anyway. - return api_version_to_wire(&session->ssl_version, version); -} diff --git a/Pods/BoringSSL-GRPC/ssl/ssl_versions.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/ssl_versions.cc.grpc_back deleted file mode 100644 index aeb41d3d1..000000000 --- a/Pods/BoringSSL-GRPC/ssl/ssl_versions.cc.grpc_back +++ /dev/null @@ -1,399 +0,0 @@ -/* Copyright (c) 2017, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include - -#include -#include - -#include "internal.h" -#include "../crypto/internal.h" - - -namespace bssl { - -bool ssl_protocol_version_from_wire(uint16_t *out, uint16_t version) { - switch (version) { - case SSL3_VERSION: - case TLS1_VERSION: - case TLS1_1_VERSION: - case TLS1_2_VERSION: - *out = version; - return true; - - case TLS1_3_DRAFT23_VERSION: - *out = TLS1_3_VERSION; - return true; - - case DTLS1_VERSION: - // DTLS 1.0 is analogous to TLS 1.1, not TLS 1.0. - *out = TLS1_1_VERSION; - return true; - - case DTLS1_2_VERSION: - *out = TLS1_2_VERSION; - return true; - - default: - return false; - } -} - -// The follow arrays are the supported versions for TLS and DTLS, in order of -// decreasing preference. - -static const uint16_t kTLSVersions[] = { - TLS1_3_DRAFT23_VERSION, - TLS1_2_VERSION, - TLS1_1_VERSION, - TLS1_VERSION, - SSL3_VERSION, -}; - -static const uint16_t kDTLSVersions[] = { - DTLS1_2_VERSION, - DTLS1_VERSION, -}; - -static void get_method_versions(const SSL_PROTOCOL_METHOD *method, - const uint16_t **out, size_t *out_num) { - if (method->is_dtls) { - *out = kDTLSVersions; - *out_num = OPENSSL_ARRAY_SIZE(kDTLSVersions); - } else { - *out = kTLSVersions; - *out_num = OPENSSL_ARRAY_SIZE(kTLSVersions); - } -} - -static bool method_supports_version(const SSL_PROTOCOL_METHOD *method, - uint16_t version) { - const uint16_t *versions; - size_t num_versions; - get_method_versions(method, &versions, &num_versions); - for (size_t i = 0; i < num_versions; i++) { - if (versions[i] == version) { - return true; - } - } - return false; -} - -// The following functions map between API versions and wire versions. The -// public API works on wire versions, except that TLS 1.3 draft versions all -// appear as TLS 1.3. This will get collapsed back down when TLS 1.3 is -// finalized. - -static const char *ssl_version_to_string(uint16_t version) { - switch (version) { - case TLS1_3_DRAFT23_VERSION: - return "TLSv1.3"; - - case TLS1_2_VERSION: - return "TLSv1.2"; - - case TLS1_1_VERSION: - return "TLSv1.1"; - - case TLS1_VERSION: - return "TLSv1"; - - case SSL3_VERSION: - return "SSLv3"; - - case DTLS1_VERSION: - return "DTLSv1"; - - case DTLS1_2_VERSION: - return "DTLSv1.2"; - - default: - return "unknown"; - } -} - -static uint16_t wire_version_to_api(uint16_t version) { - switch (version) { - // Report TLS 1.3 draft versions as TLS 1.3 in the public API. - case TLS1_3_DRAFT23_VERSION: - return TLS1_3_VERSION; - default: - return version; - } -} - -// api_version_to_wire maps |version| to some representative wire version. In -// particular, it picks an arbitrary TLS 1.3 representative. This should only be -// used in context where that does not matter. -static bool api_version_to_wire(uint16_t *out, uint16_t version) { - if (version == TLS1_3_DRAFT23_VERSION) { - return false; - } - if (version == TLS1_3_VERSION) { - version = TLS1_3_DRAFT23_VERSION; - } - - // Check it is a real protocol version. - uint16_t unused; - if (!ssl_protocol_version_from_wire(&unused, version)) { - return false; - } - - *out = version; - return true; -} - -static bool set_version_bound(const SSL_PROTOCOL_METHOD *method, uint16_t *out, - uint16_t version) { - if (!api_version_to_wire(&version, version) || - !method_supports_version(method, version) || - !ssl_protocol_version_from_wire(out, version)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNKNOWN_SSL_VERSION); - return false; - } - - return true; -} - -static bool set_min_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, - uint16_t version) { - // Zero is interpreted as the default minimum version. - if (version == 0) { - // SSL 3.0 is disabled by default and TLS 1.0 does not exist in DTLS. - *out = method->is_dtls ? TLS1_1_VERSION : TLS1_VERSION; - return true; - } - - return set_version_bound(method, out, version); -} - -static bool set_max_version(const SSL_PROTOCOL_METHOD *method, uint16_t *out, - uint16_t version) { - // Zero is interpreted as the default maximum version. - if (version == 0) { - *out = TLS1_2_VERSION; - return true; - } - - return set_version_bound(method, out, version); -} - -const struct { - uint16_t version; - uint32_t flag; -} kProtocolVersions[] = { - {SSL3_VERSION, SSL_OP_NO_SSLv3}, - {TLS1_VERSION, SSL_OP_NO_TLSv1}, - {TLS1_1_VERSION, SSL_OP_NO_TLSv1_1}, - {TLS1_2_VERSION, SSL_OP_NO_TLSv1_2}, - {TLS1_3_VERSION, SSL_OP_NO_TLSv1_3}, -}; - -bool ssl_get_version_range(const SSL *ssl, uint16_t *out_min_version, - uint16_t *out_max_version) { - // For historical reasons, |SSL_OP_NO_DTLSv1| aliases |SSL_OP_NO_TLSv1|, but - // DTLS 1.0 should be mapped to TLS 1.1. - uint32_t options = ssl->options; - if (SSL_is_dtls(ssl)) { - options &= ~SSL_OP_NO_TLSv1_1; - if (options & SSL_OP_NO_DTLSv1) { - options |= SSL_OP_NO_TLSv1_1; - } - } - - uint16_t min_version = ssl->conf_min_version; - uint16_t max_version = ssl->conf_max_version; - - // OpenSSL's API for controlling versions entails blacklisting individual - // protocols. This has two problems. First, on the client, the protocol can - // only express a contiguous range of versions. Second, a library consumer - // trying to set a maximum version cannot disable protocol versions that get - // added in a future version of the library. - // - // To account for both of these, OpenSSL interprets the client-side bitmask - // as a min/max range by picking the lowest contiguous non-empty range of - // enabled protocols. Note that this means it is impossible to set a maximum - // version of the higest supported TLS version in a future-proof way. - bool any_enabled = false; - for (size_t i = 0; i < OPENSSL_ARRAY_SIZE(kProtocolVersions); i++) { - // Only look at the versions already enabled. - if (min_version > kProtocolVersions[i].version) { - continue; - } - if (max_version < kProtocolVersions[i].version) { - break; - } - - if (!(options & kProtocolVersions[i].flag)) { - // The minimum version is the first enabled version. - if (!any_enabled) { - any_enabled = true; - min_version = kProtocolVersions[i].version; - } - continue; - } - - // If there is a disabled version after the first enabled one, all versions - // after it are implicitly disabled. - if (any_enabled) { - max_version = kProtocolVersions[i-1].version; - break; - } - } - - if (!any_enabled) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SUPPORTED_VERSIONS_ENABLED); - return false; - } - - *out_min_version = min_version; - *out_max_version = max_version; - return true; -} - -static uint16_t ssl_version(const SSL *ssl) { - // In early data, we report the predicted version. - if (SSL_in_early_data(ssl) && !ssl->server) { - return ssl->s3->hs->early_session->ssl_version; - } - return ssl->version; -} - -uint16_t ssl_protocol_version(const SSL *ssl) { - assert(ssl->s3->have_version); - uint16_t version; - if (!ssl_protocol_version_from_wire(&version, ssl->version)) { - // |ssl->version| will always be set to a valid version. - assert(0); - return 0; - } - - return version; -} - -bool ssl_supports_version(SSL_HANDSHAKE *hs, uint16_t version) { - SSL *const ssl = hs->ssl; - uint16_t protocol_version; - if (!method_supports_version(ssl->method, version) || - !ssl_protocol_version_from_wire(&protocol_version, version) || - hs->min_version > protocol_version || - protocol_version > hs->max_version) { - return false; - } - - // This logic is part of the TLS 1.3 variants mechanism used in TLS 1.3 - // experimentation. Although we currently only have one variant, TLS 1.3 does - // not a final stable deployment yet, so leave the logic in place for now. - if (protocol_version != TLS1_3_VERSION || - (ssl->tls13_variant == tls13_default && - version == TLS1_3_DRAFT23_VERSION)) { - return true; - } - - // The server, when not configured at |tls13_default|, should additionally - // enable all variants. - if (ssl->server && ssl->tls13_variant != tls13_default) { - return true; - } - - return false; -} - -bool ssl_add_supported_versions(SSL_HANDSHAKE *hs, CBB *cbb) { - const uint16_t *versions; - size_t num_versions; - get_method_versions(hs->ssl->method, &versions, &num_versions); - for (size_t i = 0; i < num_versions; i++) { - if (ssl_supports_version(hs, versions[i]) && - !CBB_add_u16(cbb, versions[i])) { - return false; - } - } - return true; -} - -bool ssl_negotiate_version(SSL_HANDSHAKE *hs, uint8_t *out_alert, - uint16_t *out_version, const CBS *peer_versions) { - const uint16_t *versions; - size_t num_versions; - get_method_versions(hs->ssl->method, &versions, &num_versions); - for (size_t i = 0; i < num_versions; i++) { - if (!ssl_supports_version(hs, versions[i])) { - continue; - } - - CBS copy = *peer_versions; - while (CBS_len(©) != 0) { - uint16_t version; - if (!CBS_get_u16(©, &version)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - *out_alert = SSL_AD_DECODE_ERROR; - return false; - } - - if (version == versions[i]) { - *out_version = version; - return true; - } - } - } - - OPENSSL_PUT_ERROR(SSL, SSL_R_UNSUPPORTED_PROTOCOL); - *out_alert = SSL_AD_PROTOCOL_VERSION; - return false; -} - -} // namespace bssl - -using namespace bssl; - -int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, uint16_t version) { - return set_min_version(ctx->method, &ctx->conf_min_version, version); -} - -int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, uint16_t version) { - return set_max_version(ctx->method, &ctx->conf_max_version, version); -} - -int SSL_set_min_proto_version(SSL *ssl, uint16_t version) { - return set_min_version(ssl->method, &ssl->conf_min_version, version); -} - -int SSL_set_max_proto_version(SSL *ssl, uint16_t version) { - return set_max_version(ssl->method, &ssl->conf_max_version, version); -} - -int SSL_version(const SSL *ssl) { - return wire_version_to_api(ssl_version(ssl)); -} - -const char *SSL_get_version(const SSL *ssl) { - return ssl_version_to_string(ssl_version(ssl)); -} - -const char *SSL_SESSION_get_version(const SSL_SESSION *session) { - return ssl_version_to_string(session->ssl_version); -} - -uint16_t SSL_SESSION_get_protocol_version(const SSL_SESSION *session) { - return wire_version_to_api(session->ssl_version); -} - -int SSL_SESSION_set_protocol_version(SSL_SESSION *session, uint16_t version) { - // This picks a representative TLS 1.3 version, but this API should only be - // used on unit test sessions anyway. - return api_version_to_wire(&session->ssl_version, version); -} diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_both.cc b/Pods/BoringSSL-GRPC/ssl/tls13_both.cc deleted file mode 100644 index 0a3647762..000000000 --- a/Pods/BoringSSL-GRPC/ssl/tls13_both.cc +++ /dev/null @@ -1,559 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -// kMaxKeyUpdates is the number of consecutive KeyUpdates that will be -// processed. Without this limit an attacker could force unbounded processing -// without being able to return application data. -static const uint8_t kMaxKeyUpdates = 32; - -const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE] = { - 0xcf, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11, 0xbe, 0x1d, 0x8c, - 0x02, 0x1e, 0x65, 0xb8, 0x91, 0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, - 0x8c, 0x5e, 0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c, -}; - -// This value was selected by truncating the SHA-256 hash of "Draft TLS 1.3 -// Downgrade" to 8 bytes: -// -// echo -n 'Draft TLS 1.3 Downgrade' | sha256sum | head -c 16 -const uint8_t kDraftDowngradeRandom[8] = {0x95, 0xb9, 0x9f, 0x87, - 0x22, 0xfe, 0x9b, 0x64}; - - -bool tls13_get_cert_verify_signature_input( - SSL_HANDSHAKE *hs, Array *out, - enum ssl_cert_verify_context_t cert_verify_context) { - ScopedCBB cbb; - if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - for (size_t i = 0; i < 64; i++) { - if (!CBB_add_u8(cbb.get(), 0x20)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - } - - Span context; - if (cert_verify_context == ssl_cert_verify_server) { - static const char kContext[] = "TLS 1.3, server CertificateVerify"; - context = kContext; - } else if (cert_verify_context == ssl_cert_verify_client) { - static const char kContext[] = "TLS 1.3, client CertificateVerify"; - context = kContext; - } else if (cert_verify_context == ssl_cert_verify_channel_id) { - static const char kContext[] = "TLS 1.3, Channel ID"; - context = kContext; - } else { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - // Note |context| includes the NUL byte separator. - if (!CBB_add_bytes(cbb.get(), - reinterpret_cast(context.data()), - context.size())) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - uint8_t context_hash[EVP_MAX_MD_SIZE]; - size_t context_hash_len; - if (!hs->transcript.GetHash(context_hash, &context_hash_len) || - !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || - !CBBFinishArray(cbb.get(), out)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - return true; -} - -int tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int allow_anonymous) { - SSL *const ssl = hs->ssl; - CBS body = msg.body, context, certificate_list; - if (!CBS_get_u8_length_prefixed(&body, &context) || - CBS_len(&context) != 0 || - !CBS_get_u24_length_prefixed(&body, &certificate_list) || - CBS_len(&body) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; - } - - UniquePtr certs(sk_CRYPTO_BUFFER_new_null()); - if (!certs) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - - const bool retain_sha256 = - ssl->server && ssl->retain_only_sha256_of_client_certs; - UniquePtr pkey; - while (CBS_len(&certificate_list) > 0) { - CBS certificate, extensions; - if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || - !CBS_get_u16_length_prefixed(&certificate_list, &extensions) || - CBS_len(&certificate) == 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { - pkey = ssl_cert_parse_pubkey(&certificate); - if (!pkey) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; - } - // TLS 1.3 always uses certificate keys for signing thus the correct - // keyUsage is enforced. - if (!ssl_cert_check_digital_signature_key_usage(&certificate)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); - return 0; - } - - if (retain_sha256) { - // Retain the hash of the leaf certificate if requested. - SHA256(CBS_data(&certificate), CBS_len(&certificate), - hs->new_session->peer_sha256); - } - } - - UniquePtr buf( - CRYPTO_BUFFER_new_from_CBS(&certificate, ssl->ctx->pool)); - if (!buf || - !PushToStack(certs.get(), std::move(buf))) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - - // Parse out the extensions. - bool have_status_request = false, have_sct = false; - CBS status_request, sct; - const SSL_EXTENSION_TYPE ext_types[] = { - {TLSEXT_TYPE_status_request, &have_status_request, &status_request}, - {TLSEXT_TYPE_certificate_timestamp, &have_sct, &sct}, - }; - - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!ssl_parse_extensions(&extensions, &alert, ext_types, - OPENSSL_ARRAY_SIZE(ext_types), - 0 /* reject unknown */)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; - } - - // All Certificate extensions are parsed, but only the leaf extensions are - // stored. - if (have_status_request) { - if (ssl->server || !ssl->ocsp_stapling_enabled) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); - return 0; - } - - uint8_t status_type; - CBS ocsp_response; - if (!CBS_get_u8(&status_request, &status_type) || - status_type != TLSEXT_STATUSTYPE_ocsp || - !CBS_get_u24_length_prefixed(&status_request, &ocsp_response) || - CBS_len(&ocsp_response) == 0 || - CBS_len(&status_request) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { - CRYPTO_BUFFER_free(hs->new_session->ocsp_response); - hs->new_session->ocsp_response = - CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool); - if (hs->new_session->ocsp_response == nullptr) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return 0; - } - } - } - - if (have_sct) { - if (ssl->server || !ssl->signed_cert_timestamps_enabled) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); - return 0; - } - - if (!ssl_is_sct_list_valid(&sct)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { - CRYPTO_BUFFER_free(hs->new_session->signed_cert_timestamp_list); - hs->new_session->signed_cert_timestamp_list = - CRYPTO_BUFFER_new_from_CBS(&sct, ssl->ctx->pool); - if (hs->new_session->signed_cert_timestamp_list == nullptr) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return 0; - } - } - } - } - - // Store a null certificate list rather than an empty one if the peer didn't - // send certificates. - if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { - certs.reset(); - } - - hs->peer_pubkey = std::move(pkey); - - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = certs.release(); - - if (!ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0) { - if (!allow_anonymous) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_CERTIFICATE_REQUIRED); - return 0; - } - - // OpenSSL returns X509_V_OK when no certificates are requested. This is - // classed by them as a bug, but it's assumed by at least NGINX. - hs->new_session->verify_result = X509_V_OK; - - // No certificate, so nothing more to do. - return 1; - } - - hs->new_session->peer_sha256_valid = retain_sha256; - return 1; -} - -int tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg) { - SSL *const ssl = hs->ssl; - if (hs->peer_pubkey == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - CBS body = msg.body, signature; - uint16_t signature_algorithm; - if (!CBS_get_u16(&body, &signature_algorithm) || - !CBS_get_u16_length_prefixed(&body, &signature) || - CBS_len(&body) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!tls12_check_peer_sigalg(ssl, &alert, signature_algorithm)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; - } - hs->new_session->peer_signature_algorithm = signature_algorithm; - - Array input; - if (!tls13_get_cert_verify_signature_input( - hs, &input, - ssl->server ? ssl_cert_verify_client : ssl_cert_verify_server)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return 0; - } - - bool sig_ok = ssl_public_key_verify(ssl, signature, signature_algorithm, - hs->peer_pubkey.get(), input); -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = true; - ERR_clear_error(); -#endif - if (!sig_ok) { - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); - return 0; - } - - return 1; -} - -int tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int use_saved_value) { - SSL *const ssl = hs->ssl; - uint8_t verify_data_buf[EVP_MAX_MD_SIZE]; - const uint8_t *verify_data; - size_t verify_data_len; - if (use_saved_value) { - assert(ssl->server); - verify_data = hs->expected_client_finished; - verify_data_len = hs->hash_len; - } else { - if (!tls13_finished_mac(hs, verify_data_buf, &verify_data_len, - !ssl->server)) { - return 0; - } - verify_data = verify_data_buf; - } - - int finished_ok = CBS_mem_equal(&msg.body, verify_data, verify_data_len); -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - finished_ok = 1; -#endif - if (!finished_ok) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); - return 0; - } - - return 1; -} - -int tls13_add_certificate(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - ScopedCBB cbb; - CBB body, certificate_list; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CERTIFICATE) || - // The request context is always empty in the handshake. - !CBB_add_u8(&body, 0) || - !CBB_add_u24_length_prefixed(&body, &certificate_list)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - if (!ssl_has_certificate(ssl)) { - return ssl_add_message_cbb(ssl, cbb.get()); - } - - CERT *cert = ssl->cert; - CRYPTO_BUFFER *leaf_buf = sk_CRYPTO_BUFFER_value(cert->chain, 0); - CBB leaf, extensions; - if (!CBB_add_u24_length_prefixed(&certificate_list, &leaf) || - !CBB_add_bytes(&leaf, CRYPTO_BUFFER_data(leaf_buf), - CRYPTO_BUFFER_len(leaf_buf)) || - !CBB_add_u16_length_prefixed(&certificate_list, &extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - if (hs->scts_requested && ssl->cert->signed_cert_timestamp_list != NULL) { - CBB contents; - if (!CBB_add_u16(&extensions, TLSEXT_TYPE_certificate_timestamp) || - !CBB_add_u16_length_prefixed(&extensions, &contents) || - !CBB_add_bytes( - &contents, - CRYPTO_BUFFER_data(ssl->cert->signed_cert_timestamp_list), - CRYPTO_BUFFER_len(ssl->cert->signed_cert_timestamp_list)) || - !CBB_flush(&extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - if (hs->ocsp_stapling_requested && - ssl->cert->ocsp_response != NULL) { - CBB contents, ocsp_response; - if (!CBB_add_u16(&extensions, TLSEXT_TYPE_status_request) || - !CBB_add_u16_length_prefixed(&extensions, &contents) || - !CBB_add_u8(&contents, TLSEXT_STATUSTYPE_ocsp) || - !CBB_add_u24_length_prefixed(&contents, &ocsp_response) || - !CBB_add_bytes(&ocsp_response, - CRYPTO_BUFFER_data(ssl->cert->ocsp_response), - CRYPTO_BUFFER_len(ssl->cert->ocsp_response)) || - !CBB_flush(&extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain); i++) { - CRYPTO_BUFFER *cert_buf = sk_CRYPTO_BUFFER_value(cert->chain, i); - CBB child; - if (!CBB_add_u24_length_prefixed(&certificate_list, &child) || - !CBB_add_bytes(&child, CRYPTO_BUFFER_data(cert_buf), - CRYPTO_BUFFER_len(cert_buf)) || - !CBB_add_u16(&certificate_list, 0 /* no extensions */)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - return ssl_add_message_cbb(ssl, cbb.get()); -} - -enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - uint16_t signature_algorithm; - if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { - return ssl_private_key_failure; - } - - ScopedCBB cbb; - CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_CERTIFICATE_VERIFY) || - !CBB_add_u16(&body, signature_algorithm)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - // Sign the digest. - CBB child; - const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); - uint8_t *sig; - size_t sig_len; - if (!CBB_add_u16_length_prefixed(&body, &child) || - !CBB_reserve(&child, &sig, max_sig_len)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - Array msg; - if (!tls13_get_cert_verify_signature_input( - hs, &msg, - ssl->server ? ssl_cert_verify_server : ssl_cert_verify_client)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - enum ssl_private_key_result_t sign_result = ssl_private_key_sign( - hs, sig, &sig_len, max_sig_len, signature_algorithm, msg); - if (sign_result != ssl_private_key_success) { - return sign_result; - } - - if (!CBB_did_write(&child, sig_len) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_private_key_failure; - } - - return ssl_private_key_success; -} - -int tls13_add_finished(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - size_t verify_data_len; - uint8_t verify_data[EVP_MAX_MD_SIZE]; - - if (!tls13_finished_mac(hs, verify_data, &verify_data_len, ssl->server)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); - return 0; - } - - ScopedCBB cbb; - CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || - !CBB_add_bytes(&body, verify_data, verify_data_len) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return 0; - } - - return 1; -} - -static int tls13_receive_key_update(SSL *ssl, const SSLMessage &msg) { - CBS body = msg.body; - uint8_t key_update_request; - if (!CBS_get_u8(&body, &key_update_request) || - CBS_len(&body) != 0 || - (key_update_request != SSL_KEY_UPDATE_NOT_REQUESTED && - key_update_request != SSL_KEY_UPDATE_REQUESTED)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (!tls13_rotate_traffic_key(ssl, evp_aead_open)) { - return 0; - } - - // Acknowledge the KeyUpdate - if (key_update_request == SSL_KEY_UPDATE_REQUESTED && - !ssl->s3->key_update_pending) { - ScopedCBB cbb; - CBB body_cbb; - if (!ssl->method->init_message(ssl, cbb.get(), &body_cbb, - SSL3_MT_KEY_UPDATE) || - !CBB_add_u8(&body_cbb, SSL_KEY_UPDATE_NOT_REQUESTED) || - !ssl_add_message_cbb(ssl, cbb.get()) || - !tls13_rotate_traffic_key(ssl, evp_aead_seal)) { - return 0; - } - - // Suppress KeyUpdate acknowledgments until this change is written to the - // wire. This prevents us from accumulating write obligations when read and - // write progress at different rates. See draft-ietf-tls-tls13-18, section - // 4.5.3. - ssl->s3->key_update_pending = true; - } - - return 1; -} - -int tls13_post_handshake(SSL *ssl, const SSLMessage &msg) { - if (msg.type == SSL3_MT_KEY_UPDATE) { - ssl->s3->key_update_count++; - if (ssl->s3->key_update_count > kMaxKeyUpdates) { - OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_KEY_UPDATES); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); - return 0; - } - - return tls13_receive_key_update(ssl, msg); - } - - ssl->s3->key_update_count = 0; - - if (msg.type == SSL3_MT_NEW_SESSION_TICKET && !ssl->server) { - return tls13_process_new_session_ticket(ssl, msg); - } - - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); - return 0; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_both.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/tls13_both.cc.grpc_back deleted file mode 100644 index 2a5a93574..000000000 --- a/Pods/BoringSSL-GRPC/ssl/tls13_both.cc.grpc_back +++ /dev/null @@ -1,559 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -// kMaxKeyUpdates is the number of consecutive KeyUpdates that will be -// processed. Without this limit an attacker could force unbounded processing -// without being able to return application data. -static const uint8_t kMaxKeyUpdates = 32; - -const uint8_t kHelloRetryRequest[SSL3_RANDOM_SIZE] = { - 0xcf, 0x21, 0xad, 0x74, 0xe5, 0x9a, 0x61, 0x11, 0xbe, 0x1d, 0x8c, - 0x02, 0x1e, 0x65, 0xb8, 0x91, 0xc2, 0xa2, 0x11, 0x16, 0x7a, 0xbb, - 0x8c, 0x5e, 0x07, 0x9e, 0x09, 0xe2, 0xc8, 0xa8, 0x33, 0x9c, -}; - -// This value was selected by truncating the SHA-256 hash of "Draft TLS 1.3 -// Downgrade" to 8 bytes: -// -// echo -n 'Draft TLS 1.3 Downgrade' | sha256sum | head -c 16 -const uint8_t kDraftDowngradeRandom[8] = {0x95, 0xb9, 0x9f, 0x87, - 0x22, 0xfe, 0x9b, 0x64}; - - -bool tls13_get_cert_verify_signature_input( - SSL_HANDSHAKE *hs, Array *out, - enum ssl_cert_verify_context_t cert_verify_context) { - ScopedCBB cbb; - if (!CBB_init(cbb.get(), 64 + 33 + 1 + 2 * EVP_MAX_MD_SIZE)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - for (size_t i = 0; i < 64; i++) { - if (!CBB_add_u8(cbb.get(), 0x20)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - } - - Span context; - if (cert_verify_context == ssl_cert_verify_server) { - static const char kContext[] = "TLS 1.3, server CertificateVerify"; - context = kContext; - } else if (cert_verify_context == ssl_cert_verify_client) { - static const char kContext[] = "TLS 1.3, client CertificateVerify"; - context = kContext; - } else if (cert_verify_context == ssl_cert_verify_channel_id) { - static const char kContext[] = "TLS 1.3, Channel ID"; - context = kContext; - } else { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - // Note |context| includes the NUL byte separator. - if (!CBB_add_bytes(cbb.get(), - reinterpret_cast(context.data()), - context.size())) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - uint8_t context_hash[EVP_MAX_MD_SIZE]; - size_t context_hash_len; - if (!hs->transcript.GetHash(context_hash, &context_hash_len) || - !CBB_add_bytes(cbb.get(), context_hash, context_hash_len) || - !CBBFinishArray(cbb.get(), out)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return false; - } - - return true; -} - -int tls13_process_certificate(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int allow_anonymous) { - SSL *const ssl = hs->ssl; - CBS body = msg.body, context, certificate_list; - if (!CBS_get_u8_length_prefixed(&body, &context) || - CBS_len(&context) != 0 || - !CBS_get_u24_length_prefixed(&body, &certificate_list) || - CBS_len(&body) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; - } - - UniquePtr certs(sk_CRYPTO_BUFFER_new_null()); - if (!certs) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - - const bool retain_sha256 = - ssl->server && ssl->retain_only_sha256_of_client_certs; - UniquePtr pkey; - while (CBS_len(&certificate_list) > 0) { - CBS certificate, extensions; - if (!CBS_get_u24_length_prefixed(&certificate_list, &certificate) || - !CBS_get_u16_length_prefixed(&certificate_list, &extensions) || - CBS_len(&certificate) == 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_CERT_LENGTH_MISMATCH); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { - pkey = ssl_cert_parse_pubkey(&certificate); - if (!pkey) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return 0; - } - // TLS 1.3 always uses certificate keys for signing thus the correct - // keyUsage is enforced. - if (!ssl_cert_check_digital_signature_key_usage(&certificate)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); - return 0; - } - - if (retain_sha256) { - // Retain the hash of the leaf certificate if requested. - SHA256(CBS_data(&certificate), CBS_len(&certificate), - hs->new_session->peer_sha256); - } - } - - UniquePtr buf( - CRYPTO_BUFFER_new_from_CBS(&certificate, ssl->ctx->pool)); - if (!buf || - !PushToStack(certs.get(), std::move(buf))) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - OPENSSL_PUT_ERROR(SSL, ERR_R_MALLOC_FAILURE); - return 0; - } - - // Parse out the extensions. - bool have_status_request = false, have_sct = false; - CBS status_request, sct; - const SSL_EXTENSION_TYPE ext_types[] = { - {TLSEXT_TYPE_status_request, &have_status_request, &status_request}, - {TLSEXT_TYPE_certificate_timestamp, &have_sct, &sct}, - }; - - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!ssl_parse_extensions(&extensions, &alert, ext_types, - OPENSSL_ARRAY_SIZE(ext_types), - 0 /* reject unknown */)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; - } - - // All Certificate extensions are parsed, but only the leaf extensions are - // stored. - if (have_status_request) { - if (ssl->server || !ssl->ocsp_stapling_enabled) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); - return 0; - } - - uint8_t status_type; - CBS ocsp_response; - if (!CBS_get_u8(&status_request, &status_type) || - status_type != TLSEXT_STATUSTYPE_ocsp || - !CBS_get_u24_length_prefixed(&status_request, &ocsp_response) || - CBS_len(&ocsp_response) == 0 || - CBS_len(&status_request) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { - CRYPTO_BUFFER_free(hs->new_session->ocsp_response); - hs->new_session->ocsp_response = - CRYPTO_BUFFER_new_from_CBS(&ocsp_response, ssl->ctx->pool); - if (hs->new_session->ocsp_response == nullptr) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return 0; - } - } - } - - if (have_sct) { - if (ssl->server || !ssl->signed_cert_timestamps_enabled) { - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_EXTENSION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNSUPPORTED_EXTENSION); - return 0; - } - - if (!ssl_is_sct_list_valid(&sct)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_ERROR_PARSING_EXTENSION); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(certs.get()) == 1) { - CRYPTO_BUFFER_free(hs->new_session->signed_cert_timestamp_list); - hs->new_session->signed_cert_timestamp_list = - CRYPTO_BUFFER_new_from_CBS(&sct, ssl->ctx->pool); - if (hs->new_session->signed_cert_timestamp_list == nullptr) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return 0; - } - } - } - } - - // Store a null certificate list rather than an empty one if the peer didn't - // send certificates. - if (sk_CRYPTO_BUFFER_num(certs.get()) == 0) { - certs.reset(); - } - - hs->peer_pubkey = std::move(pkey); - - sk_CRYPTO_BUFFER_pop_free(hs->new_session->certs, CRYPTO_BUFFER_free); - hs->new_session->certs = certs.release(); - - if (!ssl->ctx->x509_method->session_cache_objects(hs->new_session.get())) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0) { - if (!allow_anonymous) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_CERTIFICATE_REQUIRED); - return 0; - } - - // OpenSSL returns X509_V_OK when no certificates are requested. This is - // classed by them as a bug, but it's assumed by at least NGINX. - hs->new_session->verify_result = X509_V_OK; - - // No certificate, so nothing more to do. - return 1; - } - - hs->new_session->peer_sha256_valid = retain_sha256; - return 1; -} - -int tls13_process_certificate_verify(SSL_HANDSHAKE *hs, const SSLMessage &msg) { - SSL *const ssl = hs->ssl; - if (hs->peer_pubkey == NULL) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - CBS body = msg.body, signature; - uint16_t signature_algorithm; - if (!CBS_get_u16(&body, &signature_algorithm) || - !CBS_get_u16_length_prefixed(&body, &signature) || - CBS_len(&body) != 0) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!tls12_check_peer_sigalg(ssl, &alert, signature_algorithm)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; - } - hs->new_session->peer_signature_algorithm = signature_algorithm; - - Array input; - if (!tls13_get_cert_verify_signature_input( - hs, &input, - ssl->server ? ssl_cert_verify_client : ssl_cert_verify_server)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return 0; - } - - bool sig_ok = ssl_public_key_verify(ssl, signature, signature_algorithm, - hs->peer_pubkey.get(), input); -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - sig_ok = true; - ERR_clear_error(); -#endif - if (!sig_ok) { - OPENSSL_PUT_ERROR(SSL, SSL_R_BAD_SIGNATURE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); - return 0; - } - - return 1; -} - -int tls13_process_finished(SSL_HANDSHAKE *hs, const SSLMessage &msg, - int use_saved_value) { - SSL *const ssl = hs->ssl; - uint8_t verify_data_buf[EVP_MAX_MD_SIZE]; - const uint8_t *verify_data; - size_t verify_data_len; - if (use_saved_value) { - assert(ssl->server); - verify_data = hs->expected_client_finished; - verify_data_len = hs->hash_len; - } else { - if (!tls13_finished_mac(hs, verify_data_buf, &verify_data_len, - !ssl->server)) { - return 0; - } - verify_data = verify_data_buf; - } - - int finished_ok = CBS_mem_equal(&msg.body, verify_data, verify_data_len); -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - finished_ok = 1; -#endif - if (!finished_ok) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECRYPT_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); - return 0; - } - - return 1; -} - -int tls13_add_certificate(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - ScopedCBB cbb; - CBB body, certificate_list; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_CERTIFICATE) || - // The request context is always empty in the handshake. - !CBB_add_u8(&body, 0) || - !CBB_add_u24_length_prefixed(&body, &certificate_list)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - if (!ssl_has_certificate(ssl)) { - return ssl_add_message_cbb(ssl, cbb.get()); - } - - CERT *cert = ssl->cert; - CRYPTO_BUFFER *leaf_buf = sk_CRYPTO_BUFFER_value(cert->chain, 0); - CBB leaf, extensions; - if (!CBB_add_u24_length_prefixed(&certificate_list, &leaf) || - !CBB_add_bytes(&leaf, CRYPTO_BUFFER_data(leaf_buf), - CRYPTO_BUFFER_len(leaf_buf)) || - !CBB_add_u16_length_prefixed(&certificate_list, &extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - if (hs->scts_requested && ssl->cert->signed_cert_timestamp_list != NULL) { - CBB contents; - if (!CBB_add_u16(&extensions, TLSEXT_TYPE_certificate_timestamp) || - !CBB_add_u16_length_prefixed(&extensions, &contents) || - !CBB_add_bytes( - &contents, - CRYPTO_BUFFER_data(ssl->cert->signed_cert_timestamp_list), - CRYPTO_BUFFER_len(ssl->cert->signed_cert_timestamp_list)) || - !CBB_flush(&extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - if (hs->ocsp_stapling_requested && - ssl->cert->ocsp_response != NULL) { - CBB contents, ocsp_response; - if (!CBB_add_u16(&extensions, TLSEXT_TYPE_status_request) || - !CBB_add_u16_length_prefixed(&extensions, &contents) || - !CBB_add_u8(&contents, TLSEXT_STATUSTYPE_ocsp) || - !CBB_add_u24_length_prefixed(&contents, &ocsp_response) || - !CBB_add_bytes(&ocsp_response, - CRYPTO_BUFFER_data(ssl->cert->ocsp_response), - CRYPTO_BUFFER_len(ssl->cert->ocsp_response)) || - !CBB_flush(&extensions)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - for (size_t i = 1; i < sk_CRYPTO_BUFFER_num(cert->chain); i++) { - CRYPTO_BUFFER *cert_buf = sk_CRYPTO_BUFFER_value(cert->chain, i); - CBB child; - if (!CBB_add_u24_length_prefixed(&certificate_list, &child) || - !CBB_add_bytes(&child, CRYPTO_BUFFER_data(cert_buf), - CRYPTO_BUFFER_len(cert_buf)) || - !CBB_add_u16(&certificate_list, 0 /* no extensions */)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - } - - return ssl_add_message_cbb(ssl, cbb.get()); -} - -enum ssl_private_key_result_t tls13_add_certificate_verify(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - uint16_t signature_algorithm; - if (!tls1_choose_signature_algorithm(hs, &signature_algorithm)) { - return ssl_private_key_failure; - } - - ScopedCBB cbb; - CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_CERTIFICATE_VERIFY) || - !CBB_add_u16(&body, signature_algorithm)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - // Sign the digest. - CBB child; - const size_t max_sig_len = EVP_PKEY_size(hs->local_pubkey.get()); - uint8_t *sig; - size_t sig_len; - if (!CBB_add_u16_length_prefixed(&body, &child) || - !CBB_reserve(&child, &sig, max_sig_len)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - Array msg; - if (!tls13_get_cert_verify_signature_input( - hs, &msg, - ssl->server ? ssl_cert_verify_server : ssl_cert_verify_client)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_private_key_failure; - } - - enum ssl_private_key_result_t sign_result = ssl_private_key_sign( - hs, sig, &sig_len, max_sig_len, signature_algorithm, msg); - if (sign_result != ssl_private_key_success) { - return sign_result; - } - - if (!CBB_did_write(&child, sig_len) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_private_key_failure; - } - - return ssl_private_key_success; -} - -int tls13_add_finished(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - size_t verify_data_len; - uint8_t verify_data[EVP_MAX_MD_SIZE]; - - if (!tls13_finished_mac(hs, verify_data, &verify_data_len, ssl->server)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); - return 0; - } - - ScopedCBB cbb; - CBB body; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_FINISHED) || - !CBB_add_bytes(&body, verify_data, verify_data_len) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return 0; - } - - return 1; -} - -static int tls13_receive_key_update(SSL *ssl, const SSLMessage &msg) { - CBS body = msg.body; - uint8_t key_update_request; - if (!CBS_get_u8(&body, &key_update_request) || - CBS_len(&body) != 0 || - (key_update_request != SSL_KEY_UPDATE_NOT_REQUESTED && - key_update_request != SSL_KEY_UPDATE_REQUESTED)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return 0; - } - - if (!tls13_rotate_traffic_key(ssl, evp_aead_open)) { - return 0; - } - - // Acknowledge the KeyUpdate - if (key_update_request == SSL_KEY_UPDATE_REQUESTED && - !ssl->s3->key_update_pending) { - ScopedCBB cbb; - CBB body_cbb; - if (!ssl->method->init_message(ssl, cbb.get(), &body_cbb, - SSL3_MT_KEY_UPDATE) || - !CBB_add_u8(&body_cbb, SSL_KEY_UPDATE_NOT_REQUESTED) || - !ssl_add_message_cbb(ssl, cbb.get()) || - !tls13_rotate_traffic_key(ssl, evp_aead_seal)) { - return 0; - } - - // Suppress KeyUpdate acknowledgments until this change is written to the - // wire. This prevents us from accumulating write obligations when read and - // write progress at different rates. See draft-ietf-tls-tls13-18, section - // 4.5.3. - ssl->s3->key_update_pending = true; - } - - return 1; -} - -int tls13_post_handshake(SSL *ssl, const SSLMessage &msg) { - if (msg.type == SSL3_MT_KEY_UPDATE) { - ssl->s3->key_update_count++; - if (ssl->s3->key_update_count > kMaxKeyUpdates) { - OPENSSL_PUT_ERROR(SSL, SSL_R_TOO_MANY_KEY_UPDATES); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); - return 0; - } - - return tls13_receive_key_update(ssl, msg); - } - - ssl->s3->key_update_count = 0; - - if (msg.type == SSL3_MT_NEW_SESSION_TICKET && !ssl->server) { - return tls13_process_new_session_ticket(ssl, msg); - } - - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_UNEXPECTED_MESSAGE); - OPENSSL_PUT_ERROR(SSL, SSL_R_UNEXPECTED_MESSAGE); - return 0; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_enc.cc b/Pods/BoringSSL-GRPC/ssl/tls13_enc.cc deleted file mode 100644 index 65bc4f60a..000000000 --- a/Pods/BoringSSL-GRPC/ssl/tls13_enc.cc +++ /dev/null @@ -1,493 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -static int init_key_schedule(SSL_HANDSHAKE *hs, uint16_t version, - const SSL_CIPHER *cipher) { - if (!hs->transcript.InitHash(version, cipher)) { - return 0; - } - - hs->hash_len = hs->transcript.DigestLen(); - - // Initialize the secret to the zero key. - OPENSSL_memset(hs->secret, 0, hs->hash_len); - - return 1; -} - -int tls13_init_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len) { - if (!init_key_schedule(hs, ssl_protocol_version(hs->ssl), hs->new_cipher)) { - return 0; - } - - hs->transcript.FreeBuffer(); - return HKDF_extract(hs->secret, &hs->hash_len, hs->transcript.Digest(), psk, - psk_len, hs->secret, hs->hash_len); -} - -int tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len) { - SSL *const ssl = hs->ssl; - return init_key_schedule(hs, ssl_session_protocol_version(ssl->session), - ssl->session->cipher) && - HKDF_extract(hs->secret, &hs->hash_len, hs->transcript.Digest(), psk, - psk_len, hs->secret, hs->hash_len); -} - -static int hkdf_expand_label(uint8_t *out, const EVP_MD *digest, - const uint8_t *secret, size_t secret_len, - const char *label, size_t label_len, - const uint8_t *hash, size_t hash_len, size_t len) { - static const char kTLS13LabelVersion[] = "tls13 "; - - ScopedCBB cbb; - CBB child; - uint8_t *hkdf_label; - size_t hkdf_label_len; - if (!CBB_init(cbb.get(), 2 + 1 + strlen(kTLS13LabelVersion) + label_len + 1 + - hash_len) || - !CBB_add_u16(cbb.get(), len) || - !CBB_add_u8_length_prefixed(cbb.get(), &child) || - !CBB_add_bytes(&child, (const uint8_t *)kTLS13LabelVersion, - strlen(kTLS13LabelVersion)) || - !CBB_add_bytes(&child, (const uint8_t *)label, label_len) || - !CBB_add_u8_length_prefixed(cbb.get(), &child) || - !CBB_add_bytes(&child, hash, hash_len) || - !CBB_finish(cbb.get(), &hkdf_label, &hkdf_label_len)) { - return 0; - } - - int ret = HKDF_expand(out, len, digest, secret, secret_len, hkdf_label, - hkdf_label_len); - OPENSSL_free(hkdf_label); - return ret; -} - -static const char kTLS13LabelDerived[] = "derived"; - -int tls13_advance_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *in, - size_t len) { - uint8_t derive_context[EVP_MAX_MD_SIZE]; - unsigned derive_context_len; - if (!EVP_Digest(nullptr, 0, derive_context, &derive_context_len, - hs->transcript.Digest(), nullptr)) { - return 0; - } - - if (!hkdf_expand_label(hs->secret, hs->transcript.Digest(), hs->secret, - hs->hash_len, kTLS13LabelDerived, - strlen(kTLS13LabelDerived), derive_context, - derive_context_len, hs->hash_len)) { - return 0; - } - - return HKDF_extract(hs->secret, &hs->hash_len, hs->transcript.Digest(), in, - len, hs->secret, hs->hash_len); -} - -// derive_secret derives a secret of length |len| and writes the result in |out| -// with the given label and the current base secret and most recently-saved -// handshake context. It returns one on success and zero on error. -static int derive_secret(SSL_HANDSHAKE *hs, uint8_t *out, size_t len, - const char *label, size_t label_len) { - uint8_t context_hash[EVP_MAX_MD_SIZE]; - size_t context_hash_len; - if (!hs->transcript.GetHash(context_hash, &context_hash_len)) { - return 0; - } - - return hkdf_expand_label(out, hs->transcript.Digest(), hs->secret, - hs->hash_len, label, label_len, context_hash, - context_hash_len, len); -} - -int tls13_set_traffic_key(SSL *ssl, enum evp_aead_direction_t direction, - const uint8_t *traffic_secret, - size_t traffic_secret_len) { - const SSL_SESSION *session = SSL_get_session(ssl); - uint16_t version = ssl_session_protocol_version(session); - - if (traffic_secret_len > 0xff) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - - // Look up cipher suite properties. - const EVP_AEAD *aead; - size_t discard; - if (!ssl_cipher_get_evp_aead(&aead, &discard, &discard, session->cipher, - version, SSL_is_dtls(ssl))) { - return 0; - } - - const EVP_MD *digest = ssl_session_get_digest(session); - - // Derive the key. - size_t key_len = EVP_AEAD_key_length(aead); - uint8_t key[EVP_AEAD_MAX_KEY_LENGTH]; - if (!hkdf_expand_label(key, digest, traffic_secret, traffic_secret_len, "key", - 3, NULL, 0, key_len)) { - return 0; - } - - // Derive the IV. - size_t iv_len = EVP_AEAD_nonce_length(aead); - uint8_t iv[EVP_AEAD_MAX_NONCE_LENGTH]; - if (!hkdf_expand_label(iv, digest, traffic_secret, traffic_secret_len, "iv", - 2, NULL, 0, iv_len)) { - return 0; - } - - UniquePtr traffic_aead = - SSLAEADContext::Create(direction, session->ssl_version, SSL_is_dtls(ssl), - session->cipher, MakeConstSpan(key, key_len), - Span(), MakeConstSpan(iv, iv_len)); - if (!traffic_aead) { - return 0; - } - - if (direction == evp_aead_open) { - if (!ssl->method->set_read_state(ssl, std::move(traffic_aead))) { - return 0; - } - } else { - if (!ssl->method->set_write_state(ssl, std::move(traffic_aead))) { - return 0; - } - } - - // Save the traffic secret. - if (direction == evp_aead_open) { - OPENSSL_memmove(ssl->s3->read_traffic_secret, traffic_secret, - traffic_secret_len); - ssl->s3->read_traffic_secret_len = traffic_secret_len; - } else { - OPENSSL_memmove(ssl->s3->write_traffic_secret, traffic_secret, - traffic_secret_len); - ssl->s3->write_traffic_secret_len = traffic_secret_len; - } - - return 1; -} - - -static const char kTLS13LabelExporter[] = "exp master"; -static const char kTLS13LabelEarlyExporter[] = "e exp master"; - -static const char kTLS13LabelClientEarlyTraffic[] = "c e traffic"; -static const char kTLS13LabelClientHandshakeTraffic[] = "c hs traffic"; -static const char kTLS13LabelServerHandshakeTraffic[] = "s hs traffic"; -static const char kTLS13LabelClientApplicationTraffic[] = "c ap traffic"; -static const char kTLS13LabelServerApplicationTraffic[] = "s ap traffic"; - -int tls13_derive_early_secrets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!derive_secret(hs, hs->early_traffic_secret, hs->hash_len, - kTLS13LabelClientEarlyTraffic, - strlen(kTLS13LabelClientEarlyTraffic)) || - !ssl_log_secret(ssl, "CLIENT_EARLY_TRAFFIC_SECRET", - hs->early_traffic_secret, hs->hash_len) || - !derive_secret(hs, ssl->s3->early_exporter_secret, hs->hash_len, - kTLS13LabelEarlyExporter, - strlen(kTLS13LabelEarlyExporter))) { - return 0; - } - ssl->s3->early_exporter_secret_len = hs->hash_len; - return 1; -} - -int tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - return derive_secret(hs, hs->client_handshake_secret, hs->hash_len, - kTLS13LabelClientHandshakeTraffic, - strlen(kTLS13LabelClientHandshakeTraffic)) && - ssl_log_secret(ssl, "CLIENT_HANDSHAKE_TRAFFIC_SECRET", - hs->client_handshake_secret, hs->hash_len) && - derive_secret(hs, hs->server_handshake_secret, hs->hash_len, - kTLS13LabelServerHandshakeTraffic, - strlen(kTLS13LabelServerHandshakeTraffic)) && - ssl_log_secret(ssl, "SERVER_HANDSHAKE_TRAFFIC_SECRET", - hs->server_handshake_secret, hs->hash_len); -} - -int tls13_derive_application_secrets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - ssl->s3->exporter_secret_len = hs->hash_len; - return derive_secret(hs, hs->client_traffic_secret_0, hs->hash_len, - kTLS13LabelClientApplicationTraffic, - strlen(kTLS13LabelClientApplicationTraffic)) && - ssl_log_secret(ssl, "CLIENT_TRAFFIC_SECRET_0", - hs->client_traffic_secret_0, hs->hash_len) && - derive_secret(hs, hs->server_traffic_secret_0, hs->hash_len, - kTLS13LabelServerApplicationTraffic, - strlen(kTLS13LabelServerApplicationTraffic)) && - ssl_log_secret(ssl, "SERVER_TRAFFIC_SECRET_0", - hs->server_traffic_secret_0, hs->hash_len) && - derive_secret(hs, ssl->s3->exporter_secret, hs->hash_len, - kTLS13LabelExporter, strlen(kTLS13LabelExporter)) && - ssl_log_secret(ssl, "EXPORTER_SECRET", ssl->s3->exporter_secret, - hs->hash_len); -} - -static const char kTLS13LabelApplicationTraffic[] = "traffic upd"; - -int tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction) { - uint8_t *secret; - size_t secret_len; - if (direction == evp_aead_open) { - secret = ssl->s3->read_traffic_secret; - secret_len = ssl->s3->read_traffic_secret_len; - } else { - secret = ssl->s3->write_traffic_secret; - secret_len = ssl->s3->write_traffic_secret_len; - } - - const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); - if (!hkdf_expand_label( - secret, digest, secret, secret_len, kTLS13LabelApplicationTraffic, - strlen(kTLS13LabelApplicationTraffic), NULL, 0, secret_len)) { - return 0; - } - - return tls13_set_traffic_key(ssl, direction, secret, secret_len); -} - -static const char kTLS13LabelResumption[] = "res master"; - -int tls13_derive_resumption_secret(SSL_HANDSHAKE *hs) { - if (hs->hash_len > SSL_MAX_MASTER_KEY_LENGTH) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - hs->new_session->master_key_length = hs->hash_len; - return derive_secret(hs, hs->new_session->master_key, - hs->new_session->master_key_length, - kTLS13LabelResumption, strlen(kTLS13LabelResumption)); -} - -static const char kTLS13LabelFinished[] = "finished"; - -// tls13_verify_data sets |out| to be the HMAC of |context| using a derived -// Finished key for both Finished messages and the PSK binder. -static int tls13_verify_data(const EVP_MD *digest, uint16_t version, - uint8_t *out, size_t *out_len, - const uint8_t *secret, size_t hash_len, - uint8_t *context, size_t context_len) { - uint8_t key[EVP_MAX_MD_SIZE]; - unsigned len; - if (!hkdf_expand_label(key, digest, secret, hash_len, kTLS13LabelFinished, - strlen(kTLS13LabelFinished), NULL, 0, hash_len) || - HMAC(digest, key, hash_len, context, context_len, out, &len) == NULL) { - return 0; - } - *out_len = len; - return 1; -} - -int tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, - int is_server) { - const uint8_t *traffic_secret; - if (is_server) { - traffic_secret = hs->server_handshake_secret; - } else { - traffic_secret = hs->client_handshake_secret; - } - - uint8_t context_hash[EVP_MAX_MD_SIZE]; - size_t context_hash_len; - if (!hs->transcript.GetHash(context_hash, &context_hash_len) || - !tls13_verify_data(hs->transcript.Digest(), hs->ssl->version, out, - out_len, traffic_secret, hs->hash_len, context_hash, - context_hash_len)) { - return 0; - } - return 1; -} - -static const char kTLS13LabelResumptionPSK[] = "resumption"; - -bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce) { - const EVP_MD *digest = ssl_session_get_digest(session); - return hkdf_expand_label(session->master_key, digest, session->master_key, - session->master_key_length, kTLS13LabelResumptionPSK, - strlen(kTLS13LabelResumptionPSK), nonce.data(), - nonce.size(), session->master_key_length); -} - -static const char kTLS13LabelExportKeying[] = "exporter"; - -int tls13_export_keying_material(SSL *ssl, Span out, - Span secret, - Span label, - Span context) { - if (secret.empty()) { - assert(0); - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); - - uint8_t hash[EVP_MAX_MD_SIZE]; - uint8_t export_context[EVP_MAX_MD_SIZE]; - uint8_t derived_secret[EVP_MAX_MD_SIZE]; - unsigned hash_len; - unsigned export_context_len; - unsigned derived_secret_len = EVP_MD_size(digest); - return EVP_Digest(context.data(), context.size(), hash, &hash_len, digest, - nullptr) && - EVP_Digest(nullptr, 0, export_context, &export_context_len, digest, - nullptr) && - hkdf_expand_label(derived_secret, digest, secret.data(), secret.size(), - label.data(), label.size(), export_context, - export_context_len, derived_secret_len) && - hkdf_expand_label(out.data(), digest, derived_secret, - derived_secret_len, kTLS13LabelExportKeying, - strlen(kTLS13LabelExportKeying), hash, hash_len, - out.size()); -} - -static const char kTLS13LabelPSKBinder[] = "res binder"; - -static int tls13_psk_binder(uint8_t *out, uint16_t version, - const EVP_MD *digest, uint8_t *psk, size_t psk_len, - uint8_t *context, size_t context_len, - size_t hash_len) { - uint8_t binder_context[EVP_MAX_MD_SIZE]; - unsigned binder_context_len; - if (!EVP_Digest(NULL, 0, binder_context, &binder_context_len, digest, NULL)) { - return 0; - } - - uint8_t early_secret[EVP_MAX_MD_SIZE] = {0}; - size_t early_secret_len; - if (!HKDF_extract(early_secret, &early_secret_len, digest, psk, hash_len, - NULL, 0)) { - return 0; - } - - uint8_t binder_key[EVP_MAX_MD_SIZE] = {0}; - size_t len; - if (!hkdf_expand_label(binder_key, digest, early_secret, hash_len, - kTLS13LabelPSKBinder, strlen(kTLS13LabelPSKBinder), - binder_context, binder_context_len, hash_len) || - !tls13_verify_data(digest, version, out, &len, binder_key, hash_len, - context, context_len)) { - return 0; - } - - return 1; -} - -int tls13_write_psk_binder(SSL_HANDSHAKE *hs, uint8_t *msg, size_t len) { - SSL *const ssl = hs->ssl; - const EVP_MD *digest = ssl_session_get_digest(ssl->session); - size_t hash_len = EVP_MD_size(digest); - - if (len < hash_len + 3) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - ScopedEVP_MD_CTX ctx; - uint8_t context[EVP_MAX_MD_SIZE]; - unsigned context_len; - - if (!EVP_DigestInit_ex(ctx.get(), digest, NULL) || - !EVP_DigestUpdate(ctx.get(), hs->transcript.buffer().data(), - hs->transcript.buffer().size()) || - !EVP_DigestUpdate(ctx.get(), msg, len - hash_len - 3) || - !EVP_DigestFinal_ex(ctx.get(), context, &context_len)) { - return 0; - } - - uint8_t verify_data[EVP_MAX_MD_SIZE] = {0}; - if (!tls13_psk_binder(verify_data, ssl->session->ssl_version, digest, - ssl->session->master_key, - ssl->session->master_key_length, context, context_len, - hash_len)) { - return 0; - } - - OPENSSL_memcpy(msg + len - hash_len, verify_data, hash_len); - return 1; -} - -int tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, - const SSLMessage &msg, CBS *binders) { - size_t hash_len = hs->transcript.DigestLen(); - - // The message must be large enough to exclude the binders. - if (CBS_len(&msg.raw) < CBS_len(binders) + 2) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - // Hash a ClientHello prefix up to the binders. This includes the header. For - // now, this assumes we only ever verify PSK binders on initial - // ClientHellos. - uint8_t context[EVP_MAX_MD_SIZE]; - unsigned context_len; - if (!EVP_Digest(CBS_data(&msg.raw), CBS_len(&msg.raw) - CBS_len(binders) - 2, - context, &context_len, hs->transcript.Digest(), NULL)) { - return 0; - } - - uint8_t verify_data[EVP_MAX_MD_SIZE] = {0}; - CBS binder; - if (!tls13_psk_binder(verify_data, hs->ssl->version, hs->transcript.Digest(), - session->master_key, session->master_key_length, - context, context_len, hash_len) || - // We only consider the first PSK, so compare against the first binder. - !CBS_get_u8_length_prefixed(binders, &binder)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - int binder_ok = - CBS_len(&binder) == hash_len && - CRYPTO_memcmp(CBS_data(&binder), verify_data, hash_len) == 0; -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - binder_ok = 1; -#endif - if (!binder_ok) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); - return 0; - } - - return 1; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_enc.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/tls13_enc.cc.grpc_back deleted file mode 100644 index cc7afb8d3..000000000 --- a/Pods/BoringSSL-GRPC/ssl/tls13_enc.cc.grpc_back +++ /dev/null @@ -1,493 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#include - -#include -#include - -#include - -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -static int init_key_schedule(SSL_HANDSHAKE *hs, uint16_t version, - const SSL_CIPHER *cipher) { - if (!hs->transcript.InitHash(version, cipher)) { - return 0; - } - - hs->hash_len = hs->transcript.DigestLen(); - - // Initialize the secret to the zero key. - OPENSSL_memset(hs->secret, 0, hs->hash_len); - - return 1; -} - -int tls13_init_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len) { - if (!init_key_schedule(hs, ssl_protocol_version(hs->ssl), hs->new_cipher)) { - return 0; - } - - hs->transcript.FreeBuffer(); - return HKDF_extract(hs->secret, &hs->hash_len, hs->transcript.Digest(), psk, - psk_len, hs->secret, hs->hash_len); -} - -int tls13_init_early_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *psk, - size_t psk_len) { - SSL *const ssl = hs->ssl; - return init_key_schedule(hs, ssl_session_protocol_version(ssl->session), - ssl->session->cipher) && - HKDF_extract(hs->secret, &hs->hash_len, hs->transcript.Digest(), psk, - psk_len, hs->secret, hs->hash_len); -} - -static int hkdf_expand_label(uint8_t *out, const EVP_MD *digest, - const uint8_t *secret, size_t secret_len, - const char *label, size_t label_len, - const uint8_t *hash, size_t hash_len, size_t len) { - static const char kTLS13LabelVersion[] = "tls13 "; - - ScopedCBB cbb; - CBB child; - uint8_t *hkdf_label; - size_t hkdf_label_len; - if (!CBB_init(cbb.get(), 2 + 1 + strlen(kTLS13LabelVersion) + label_len + 1 + - hash_len) || - !CBB_add_u16(cbb.get(), len) || - !CBB_add_u8_length_prefixed(cbb.get(), &child) || - !CBB_add_bytes(&child, (const uint8_t *)kTLS13LabelVersion, - strlen(kTLS13LabelVersion)) || - !CBB_add_bytes(&child, (const uint8_t *)label, label_len) || - !CBB_add_u8_length_prefixed(cbb.get(), &child) || - !CBB_add_bytes(&child, hash, hash_len) || - !CBB_finish(cbb.get(), &hkdf_label, &hkdf_label_len)) { - return 0; - } - - int ret = HKDF_expand(out, len, digest, secret, secret_len, hkdf_label, - hkdf_label_len); - OPENSSL_free(hkdf_label); - return ret; -} - -static const char kTLS13LabelDerived[] = "derived"; - -int tls13_advance_key_schedule(SSL_HANDSHAKE *hs, const uint8_t *in, - size_t len) { - uint8_t derive_context[EVP_MAX_MD_SIZE]; - unsigned derive_context_len; - if (!EVP_Digest(nullptr, 0, derive_context, &derive_context_len, - hs->transcript.Digest(), nullptr)) { - return 0; - } - - if (!hkdf_expand_label(hs->secret, hs->transcript.Digest(), hs->secret, - hs->hash_len, kTLS13LabelDerived, - strlen(kTLS13LabelDerived), derive_context, - derive_context_len, hs->hash_len)) { - return 0; - } - - return HKDF_extract(hs->secret, &hs->hash_len, hs->transcript.Digest(), in, - len, hs->secret, hs->hash_len); -} - -// derive_secret derives a secret of length |len| and writes the result in |out| -// with the given label and the current base secret and most recently-saved -// handshake context. It returns one on success and zero on error. -static int derive_secret(SSL_HANDSHAKE *hs, uint8_t *out, size_t len, - const char *label, size_t label_len) { - uint8_t context_hash[EVP_MAX_MD_SIZE]; - size_t context_hash_len; - if (!hs->transcript.GetHash(context_hash, &context_hash_len)) { - return 0; - } - - return hkdf_expand_label(out, hs->transcript.Digest(), hs->secret, - hs->hash_len, label, label_len, context_hash, - context_hash_len, len); -} - -int tls13_set_traffic_key(SSL *ssl, enum evp_aead_direction_t direction, - const uint8_t *traffic_secret, - size_t traffic_secret_len) { - const SSL_SESSION *session = SSL_get_session(ssl); - uint16_t version = ssl_session_protocol_version(session); - - if (traffic_secret_len > 0xff) { - OPENSSL_PUT_ERROR(SSL, ERR_R_OVERFLOW); - return 0; - } - - // Look up cipher suite properties. - const EVP_AEAD *aead; - size_t discard; - if (!ssl_cipher_get_evp_aead(&aead, &discard, &discard, session->cipher, - version, SSL_is_dtls(ssl))) { - return 0; - } - - const EVP_MD *digest = ssl_session_get_digest(session); - - // Derive the key. - size_t key_len = EVP_AEAD_key_length(aead); - uint8_t key[EVP_AEAD_MAX_KEY_LENGTH]; - if (!hkdf_expand_label(key, digest, traffic_secret, traffic_secret_len, "key", - 3, NULL, 0, key_len)) { - return 0; - } - - // Derive the IV. - size_t iv_len = EVP_AEAD_nonce_length(aead); - uint8_t iv[EVP_AEAD_MAX_NONCE_LENGTH]; - if (!hkdf_expand_label(iv, digest, traffic_secret, traffic_secret_len, "iv", - 2, NULL, 0, iv_len)) { - return 0; - } - - UniquePtr traffic_aead = - SSLAEADContext::Create(direction, session->ssl_version, SSL_is_dtls(ssl), - session->cipher, MakeConstSpan(key, key_len), - Span(), MakeConstSpan(iv, iv_len)); - if (!traffic_aead) { - return 0; - } - - if (direction == evp_aead_open) { - if (!ssl->method->set_read_state(ssl, std::move(traffic_aead))) { - return 0; - } - } else { - if (!ssl->method->set_write_state(ssl, std::move(traffic_aead))) { - return 0; - } - } - - // Save the traffic secret. - if (direction == evp_aead_open) { - OPENSSL_memmove(ssl->s3->read_traffic_secret, traffic_secret, - traffic_secret_len); - ssl->s3->read_traffic_secret_len = traffic_secret_len; - } else { - OPENSSL_memmove(ssl->s3->write_traffic_secret, traffic_secret, - traffic_secret_len); - ssl->s3->write_traffic_secret_len = traffic_secret_len; - } - - return 1; -} - - -static const char kTLS13LabelExporter[] = "exp master"; -static const char kTLS13LabelEarlyExporter[] = "e exp master"; - -static const char kTLS13LabelClientEarlyTraffic[] = "c e traffic"; -static const char kTLS13LabelClientHandshakeTraffic[] = "c hs traffic"; -static const char kTLS13LabelServerHandshakeTraffic[] = "s hs traffic"; -static const char kTLS13LabelClientApplicationTraffic[] = "c ap traffic"; -static const char kTLS13LabelServerApplicationTraffic[] = "s ap traffic"; - -int tls13_derive_early_secrets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!derive_secret(hs, hs->early_traffic_secret, hs->hash_len, - kTLS13LabelClientEarlyTraffic, - strlen(kTLS13LabelClientEarlyTraffic)) || - !ssl_log_secret(ssl, "CLIENT_EARLY_TRAFFIC_SECRET", - hs->early_traffic_secret, hs->hash_len) || - !derive_secret(hs, ssl->s3->early_exporter_secret, hs->hash_len, - kTLS13LabelEarlyExporter, - strlen(kTLS13LabelEarlyExporter))) { - return 0; - } - ssl->s3->early_exporter_secret_len = hs->hash_len; - return 1; -} - -int tls13_derive_handshake_secrets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - return derive_secret(hs, hs->client_handshake_secret, hs->hash_len, - kTLS13LabelClientHandshakeTraffic, - strlen(kTLS13LabelClientHandshakeTraffic)) && - ssl_log_secret(ssl, "CLIENT_HANDSHAKE_TRAFFIC_SECRET", - hs->client_handshake_secret, hs->hash_len) && - derive_secret(hs, hs->server_handshake_secret, hs->hash_len, - kTLS13LabelServerHandshakeTraffic, - strlen(kTLS13LabelServerHandshakeTraffic)) && - ssl_log_secret(ssl, "SERVER_HANDSHAKE_TRAFFIC_SECRET", - hs->server_handshake_secret, hs->hash_len); -} - -int tls13_derive_application_secrets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - ssl->s3->exporter_secret_len = hs->hash_len; - return derive_secret(hs, hs->client_traffic_secret_0, hs->hash_len, - kTLS13LabelClientApplicationTraffic, - strlen(kTLS13LabelClientApplicationTraffic)) && - ssl_log_secret(ssl, "CLIENT_TRAFFIC_SECRET_0", - hs->client_traffic_secret_0, hs->hash_len) && - derive_secret(hs, hs->server_traffic_secret_0, hs->hash_len, - kTLS13LabelServerApplicationTraffic, - strlen(kTLS13LabelServerApplicationTraffic)) && - ssl_log_secret(ssl, "SERVER_TRAFFIC_SECRET_0", - hs->server_traffic_secret_0, hs->hash_len) && - derive_secret(hs, ssl->s3->exporter_secret, hs->hash_len, - kTLS13LabelExporter, strlen(kTLS13LabelExporter)) && - ssl_log_secret(ssl, "EXPORTER_SECRET", ssl->s3->exporter_secret, - hs->hash_len); -} - -static const char kTLS13LabelApplicationTraffic[] = "traffic upd"; - -int tls13_rotate_traffic_key(SSL *ssl, enum evp_aead_direction_t direction) { - uint8_t *secret; - size_t secret_len; - if (direction == evp_aead_open) { - secret = ssl->s3->read_traffic_secret; - secret_len = ssl->s3->read_traffic_secret_len; - } else { - secret = ssl->s3->write_traffic_secret; - secret_len = ssl->s3->write_traffic_secret_len; - } - - const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); - if (!hkdf_expand_label( - secret, digest, secret, secret_len, kTLS13LabelApplicationTraffic, - strlen(kTLS13LabelApplicationTraffic), NULL, 0, secret_len)) { - return 0; - } - - return tls13_set_traffic_key(ssl, direction, secret, secret_len); -} - -static const char kTLS13LabelResumption[] = "res master"; - -int tls13_derive_resumption_secret(SSL_HANDSHAKE *hs) { - if (hs->hash_len > SSL_MAX_MASTER_KEY_LENGTH) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - hs->new_session->master_key_length = hs->hash_len; - return derive_secret(hs, hs->new_session->master_key, - hs->new_session->master_key_length, - kTLS13LabelResumption, strlen(kTLS13LabelResumption)); -} - -static const char kTLS13LabelFinished[] = "finished"; - -// tls13_verify_data sets |out| to be the HMAC of |context| using a derived -// Finished key for both Finished messages and the PSK binder. -static int tls13_verify_data(const EVP_MD *digest, uint16_t version, - uint8_t *out, size_t *out_len, - const uint8_t *secret, size_t hash_len, - uint8_t *context, size_t context_len) { - uint8_t key[EVP_MAX_MD_SIZE]; - unsigned len; - if (!hkdf_expand_label(key, digest, secret, hash_len, kTLS13LabelFinished, - strlen(kTLS13LabelFinished), NULL, 0, hash_len) || - HMAC(digest, key, hash_len, context, context_len, out, &len) == NULL) { - return 0; - } - *out_len = len; - return 1; -} - -int tls13_finished_mac(SSL_HANDSHAKE *hs, uint8_t *out, size_t *out_len, - int is_server) { - const uint8_t *traffic_secret; - if (is_server) { - traffic_secret = hs->server_handshake_secret; - } else { - traffic_secret = hs->client_handshake_secret; - } - - uint8_t context_hash[EVP_MAX_MD_SIZE]; - size_t context_hash_len; - if (!hs->transcript.GetHash(context_hash, &context_hash_len) || - !tls13_verify_data(hs->transcript.Digest(), hs->ssl->version, out, - out_len, traffic_secret, hs->hash_len, context_hash, - context_hash_len)) { - return 0; - } - return 1; -} - -static const char kTLS13LabelResumptionPSK[] = "resumption"; - -bool tls13_derive_session_psk(SSL_SESSION *session, Span nonce) { - const EVP_MD *digest = ssl_session_get_digest(session); - return hkdf_expand_label(session->master_key, digest, session->master_key, - session->master_key_length, kTLS13LabelResumptionPSK, - strlen(kTLS13LabelResumptionPSK), nonce.data(), - nonce.size(), session->master_key_length); -} - -static const char kTLS13LabelExportKeying[] = "exporter"; - -int tls13_export_keying_material(SSL *ssl, Span out, - Span secret, - Span label, - Span context) { - if (secret.empty()) { - assert(0); - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - const EVP_MD *digest = ssl_session_get_digest(SSL_get_session(ssl)); - - uint8_t hash[EVP_MAX_MD_SIZE]; - uint8_t export_context[EVP_MAX_MD_SIZE]; - uint8_t derived_secret[EVP_MAX_MD_SIZE]; - unsigned hash_len; - unsigned export_context_len; - unsigned derived_secret_len = EVP_MD_size(digest); - return EVP_Digest(context.data(), context.size(), hash, &hash_len, digest, - nullptr) && - EVP_Digest(nullptr, 0, export_context, &export_context_len, digest, - nullptr) && - hkdf_expand_label(derived_secret, digest, secret.data(), secret.size(), - label.data(), label.size(), export_context, - export_context_len, derived_secret_len) && - hkdf_expand_label(out.data(), digest, derived_secret, - derived_secret_len, kTLS13LabelExportKeying, - strlen(kTLS13LabelExportKeying), hash, hash_len, - out.size()); -} - -static const char kTLS13LabelPSKBinder[] = "res binder"; - -static int tls13_psk_binder(uint8_t *out, uint16_t version, - const EVP_MD *digest, uint8_t *psk, size_t psk_len, - uint8_t *context, size_t context_len, - size_t hash_len) { - uint8_t binder_context[EVP_MAX_MD_SIZE]; - unsigned binder_context_len; - if (!EVP_Digest(NULL, 0, binder_context, &binder_context_len, digest, NULL)) { - return 0; - } - - uint8_t early_secret[EVP_MAX_MD_SIZE] = {0}; - size_t early_secret_len; - if (!HKDF_extract(early_secret, &early_secret_len, digest, psk, hash_len, - NULL, 0)) { - return 0; - } - - uint8_t binder_key[EVP_MAX_MD_SIZE] = {0}; - size_t len; - if (!hkdf_expand_label(binder_key, digest, early_secret, hash_len, - kTLS13LabelPSKBinder, strlen(kTLS13LabelPSKBinder), - binder_context, binder_context_len, hash_len) || - !tls13_verify_data(digest, version, out, &len, binder_key, hash_len, - context, context_len)) { - return 0; - } - - return 1; -} - -int tls13_write_psk_binder(SSL_HANDSHAKE *hs, uint8_t *msg, size_t len) { - SSL *const ssl = hs->ssl; - const EVP_MD *digest = ssl_session_get_digest(ssl->session); - size_t hash_len = EVP_MD_size(digest); - - if (len < hash_len + 3) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - ScopedEVP_MD_CTX ctx; - uint8_t context[EVP_MAX_MD_SIZE]; - unsigned context_len; - - if (!EVP_DigestInit_ex(ctx.get(), digest, NULL) || - !EVP_DigestUpdate(ctx.get(), hs->transcript.buffer().data(), - hs->transcript.buffer().size()) || - !EVP_DigestUpdate(ctx.get(), msg, len - hash_len - 3) || - !EVP_DigestFinal_ex(ctx.get(), context, &context_len)) { - return 0; - } - - uint8_t verify_data[EVP_MAX_MD_SIZE] = {0}; - if (!tls13_psk_binder(verify_data, ssl->session->ssl_version, digest, - ssl->session->master_key, - ssl->session->master_key_length, context, context_len, - hash_len)) { - return 0; - } - - OPENSSL_memcpy(msg + len - hash_len, verify_data, hash_len); - return 1; -} - -int tls13_verify_psk_binder(SSL_HANDSHAKE *hs, SSL_SESSION *session, - const SSLMessage &msg, CBS *binders) { - size_t hash_len = hs->transcript.DigestLen(); - - // The message must be large enough to exclude the binders. - if (CBS_len(&msg.raw) < CBS_len(binders) + 2) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - // Hash a ClientHello prefix up to the binders. This includes the header. For - // now, this assumes we only ever verify PSK binders on initial - // ClientHellos. - uint8_t context[EVP_MAX_MD_SIZE]; - unsigned context_len; - if (!EVP_Digest(CBS_data(&msg.raw), CBS_len(&msg.raw) - CBS_len(binders) - 2, - context, &context_len, hs->transcript.Digest(), NULL)) { - return 0; - } - - uint8_t verify_data[EVP_MAX_MD_SIZE] = {0}; - CBS binder; - if (!tls13_psk_binder(verify_data, hs->ssl->version, hs->transcript.Digest(), - session->master_key, session->master_key_length, - context, context_len, hash_len) || - // We only consider the first PSK, so compare against the first binder. - !CBS_get_u8_length_prefixed(binders, &binder)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return 0; - } - - int binder_ok = - CBS_len(&binder) == hash_len && - CRYPTO_memcmp(CBS_data(&binder), verify_data, hash_len) == 0; -#if defined(BORINGSSL_UNSAFE_FUZZER_MODE) - binder_ok = 1; -#endif - if (!binder_ok) { - OPENSSL_PUT_ERROR(SSL, SSL_R_DIGEST_CHECK_FAILED); - return 0; - } - - return 1; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_server.cc b/Pods/BoringSSL-GRPC/ssl/tls13_server.cc deleted file mode 100644 index 889ea618f..000000000 --- a/Pods/BoringSSL-GRPC/ssl/tls13_server.cc +++ /dev/null @@ -1,1022 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -// Per C99, various stdint.h macros are unavailable in C++ unless some macros -// are defined. C++11 overruled this decision, but older Android NDKs still -// require it. -#if !defined(__STDC_LIMIT_MACROS) -#define __STDC_LIMIT_MACROS -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -enum server_hs_state_t { - state_select_parameters = 0, - state_select_session, - state_send_hello_retry_request, - state_read_second_client_hello, - state_send_server_hello, - state_send_server_certificate_verify, - state_send_server_finished, - state_read_second_client_flight, - state_process_end_of_early_data, - state_read_client_certificate, - state_read_client_certificate_verify, - state_read_channel_id, - state_read_client_finished, - state_send_new_session_ticket, - state_done, -}; - -static const uint8_t kZeroes[EVP_MAX_MD_SIZE] = {0}; - -static int resolve_ecdhe_secret(SSL_HANDSHAKE *hs, bool *out_need_retry, - SSL_CLIENT_HELLO *client_hello) { - SSL *const ssl = hs->ssl; - *out_need_retry = false; - - // We only support connections that include an ECDHE key exchange. - CBS key_share; - if (!ssl_client_hello_get_extension(client_hello, &key_share, - TLSEXT_TYPE_key_share)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION); - return 0; - } - - bool found_key_share; - Array dhe_secret; - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!ssl_ext_key_share_parse_clienthello(hs, &found_key_share, &dhe_secret, - &alert, &key_share)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; - } - - if (!found_key_share) { - *out_need_retry = true; - return 0; - } - - return tls13_advance_key_schedule(hs, dhe_secret.data(), dhe_secret.size()); -} - -static int ssl_ext_supported_versions_add_serverhello(SSL_HANDSHAKE *hs, - CBB *out) { - CBB contents; - if (!CBB_add_u16(out, TLSEXT_TYPE_supported_versions) || - !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_u16(&contents, hs->ssl->version) || - !CBB_flush(out)) { - return 0; - } - - return 1; -} - -static const SSL_CIPHER *choose_tls13_cipher( - const SSL *ssl, const SSL_CLIENT_HELLO *client_hello) { - if (client_hello->cipher_suites_len % 2 != 0) { - return NULL; - } - - CBS cipher_suites; - CBS_init(&cipher_suites, client_hello->cipher_suites, - client_hello->cipher_suites_len); - - const int aes_is_fine = EVP_has_aes_hardware(); - const uint16_t version = ssl_protocol_version(ssl); - - const SSL_CIPHER *best = NULL; - while (CBS_len(&cipher_suites) > 0) { - uint16_t cipher_suite; - if (!CBS_get_u16(&cipher_suites, &cipher_suite)) { - return NULL; - } - - // Limit to TLS 1.3 ciphers we know about. - const SSL_CIPHER *candidate = SSL_get_cipher_by_value(cipher_suite); - if (candidate == NULL || - SSL_CIPHER_get_min_version(candidate) > version || - SSL_CIPHER_get_max_version(candidate) < version) { - continue; - } - - // TLS 1.3 removes legacy ciphers, so honor the client order, but prefer - // ChaCha20 if we do not have AES hardware. - if (aes_is_fine) { - return candidate; - } - - if (candidate->algorithm_enc == SSL_CHACHA20POLY1305) { - return candidate; - } - - if (best == NULL) { - best = candidate; - } - } - - return best; -} - -static int add_new_session_tickets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - // TLS 1.3 recommends single-use tickets, so issue multiple tickets in case - // the client makes several connections before getting a renewal. - static const int kNumTickets = 2; - - // Rebase the session timestamp so that it is measured from ticket - // issuance. - ssl_session_rebase_time(ssl, hs->new_session.get()); - - for (int i = 0; i < kNumTickets; i++) { - UniquePtr session( - SSL_SESSION_dup(hs->new_session.get(), SSL_SESSION_INCLUDE_NONAUTH)); - if (!session) { - return 0; - } - - if (!RAND_bytes((uint8_t *)&session->ticket_age_add, 4)) { - return 0; - } - session->ticket_age_add_valid = 1; - if (ssl->cert->enable_early_data) { - session->ticket_max_early_data = kMaxEarlyDataAccepted; - } - - static_assert(kNumTickets < 256, "Too many tickets"); - uint8_t nonce[] = {static_cast(i)}; - - ScopedCBB cbb; - CBB body, nonce_cbb, ticket, extensions; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_NEW_SESSION_TICKET) || - !CBB_add_u32(&body, session->timeout) || - !CBB_add_u32(&body, session->ticket_age_add) || - !CBB_add_u8_length_prefixed(&body, &nonce_cbb) || - !CBB_add_bytes(&nonce_cbb, nonce, sizeof(nonce)) || - !CBB_add_u16_length_prefixed(&body, &ticket) || - !tls13_derive_session_psk(session.get(), nonce) || - !ssl_encrypt_ticket(ssl, &ticket, session.get()) || - !CBB_add_u16_length_prefixed(&body, &extensions)) { - return 0; - } - - if (ssl->cert->enable_early_data) { - CBB early_data_info; - if (!CBB_add_u16(&extensions, TLSEXT_TYPE_early_data) || - !CBB_add_u16_length_prefixed(&extensions, &early_data_info) || - !CBB_add_u32(&early_data_info, session->ticket_max_early_data) || - !CBB_flush(&extensions)) { - return 0; - } - } - - // Add a fake extension. See draft-davidben-tls-grease-01. - if (!CBB_add_u16(&extensions, - ssl_get_grease_value(hs, ssl_grease_ticket_extension)) || - !CBB_add_u16(&extensions, 0 /* empty */)) { - return 0; - } - - if (!ssl_add_message_cbb(ssl, cbb.get())) { - return 0; - } - } - - return 1; -} - -static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { - // At this point, most ClientHello extensions have already been processed by - // the common handshake logic. Resolve the remaining non-PSK parameters. - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - SSL_CLIENT_HELLO client_hello; - if (!ssl_client_hello_init(ssl, &client_hello, msg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - - OPENSSL_memcpy(hs->session_id, client_hello.session_id, - client_hello.session_id_len); - hs->session_id_len = client_hello.session_id_len; - - // Negotiate the cipher suite. - hs->new_cipher = choose_tls13_cipher(ssl, &client_hello); - if (hs->new_cipher == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_CIPHER); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); - return ssl_hs_error; - } - - // HTTP/2 negotiation depends on the cipher suite, so ALPN negotiation was - // deferred. Complete it now. - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!ssl_negotiate_alpn(hs, &alert, &client_hello)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return ssl_hs_error; - } - - // The PRF hash is now known. Set up the key schedule and hash the - // ClientHello. - if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher)) { - return ssl_hs_error; - } - - if (!ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - hs->tls13_state = state_select_session; - return ssl_hs_ok; -} - -static enum ssl_ticket_aead_result_t select_session( - SSL_HANDSHAKE *hs, uint8_t *out_alert, UniquePtr *out_session, - int32_t *out_ticket_age_skew, const SSLMessage &msg, - const SSL_CLIENT_HELLO *client_hello) { - SSL *const ssl = hs->ssl; - *out_session = NULL; - - // Decode the ticket if we agreed on a PSK key exchange mode. - CBS pre_shared_key; - if (!hs->accept_psk_mode || - !ssl_client_hello_get_extension(client_hello, &pre_shared_key, - TLSEXT_TYPE_pre_shared_key)) { - return ssl_ticket_aead_ignore_ticket; - } - - // Verify that the pre_shared_key extension is the last extension in - // ClientHello. - if (CBS_data(&pre_shared_key) + CBS_len(&pre_shared_key) != - client_hello->extensions + client_hello->extensions_len) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PRE_SHARED_KEY_MUST_BE_LAST); - *out_alert = SSL_AD_ILLEGAL_PARAMETER; - return ssl_ticket_aead_error; - } - - CBS ticket, binders; - uint32_t client_ticket_age; - if (!ssl_ext_pre_shared_key_parse_clienthello(hs, &ticket, &binders, - &client_ticket_age, out_alert, - &pre_shared_key)) { - return ssl_ticket_aead_error; - } - - // TLS 1.3 session tickets are renewed separately as part of the - // NewSessionTicket. - bool unused_renew; - UniquePtr session; - enum ssl_ticket_aead_result_t ret = - ssl_process_ticket(ssl, &session, &unused_renew, CBS_data(&ticket), - CBS_len(&ticket), NULL, 0); - switch (ret) { - case ssl_ticket_aead_success: - break; - case ssl_ticket_aead_error: - *out_alert = SSL_AD_INTERNAL_ERROR; - return ret; - default: - return ret; - } - - if (!ssl_session_is_resumable(hs, session.get()) || - // Historically, some TLS 1.3 tickets were missing ticket_age_add. - !session->ticket_age_add_valid) { - return ssl_ticket_aead_ignore_ticket; - } - - // Recover the client ticket age and convert to seconds. - client_ticket_age -= session->ticket_age_add; - client_ticket_age /= 1000; - - struct OPENSSL_timeval now; - ssl_get_current_time(ssl, &now); - - // Compute the server ticket age in seconds. - assert(now.tv_sec >= session->time); - uint64_t server_ticket_age = now.tv_sec - session->time; - - // To avoid overflowing |hs->ticket_age_skew|, we will not resume - // 68-year-old sessions. - if (server_ticket_age > INT32_MAX) { - return ssl_ticket_aead_ignore_ticket; - } - - // TODO(davidben,svaldez): Measure this value to decide on tolerance. For - // now, accept all values. https://crbug.com/boringssl/113. - *out_ticket_age_skew = - (int32_t)client_ticket_age - (int32_t)server_ticket_age; - - // Check the PSK binder. - if (!tls13_verify_psk_binder(hs, session.get(), msg, &binders)) { - *out_alert = SSL_AD_DECRYPT_ERROR; - return ssl_ticket_aead_error; - } - - *out_session = std::move(session); - return ssl_ticket_aead_success; -} - -static enum ssl_hs_wait_t do_select_session(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - SSL_CLIENT_HELLO client_hello; - if (!ssl_client_hello_init(ssl, &client_hello, msg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - - uint8_t alert = SSL_AD_DECODE_ERROR; - UniquePtr session; - switch (select_session(hs, &alert, &session, &ssl->s3->ticket_age_skew, msg, - &client_hello)) { - case ssl_ticket_aead_ignore_ticket: - assert(!session); - if (!ssl_get_new_session(hs, 1 /* server */)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - break; - - case ssl_ticket_aead_success: - // Carry over authentication information from the previous handshake into - // a fresh session. - hs->new_session = - SSL_SESSION_dup(session.get(), SSL_SESSION_DUP_AUTH_ONLY); - - if (ssl->cert->enable_early_data && - // Early data must be acceptable for this ticket. - session->ticket_max_early_data != 0 && - // The client must have offered early data. - hs->early_data_offered && - // Channel ID is incompatible with 0-RTT. - !ssl->s3->tlsext_channel_id_valid && - // If Token Binding is negotiated, reject 0-RTT. - !ssl->token_binding_negotiated && - // Custom extensions is incompatible with 0-RTT. - hs->custom_extensions.received == 0 && - // The negotiated ALPN must match the one in the ticket. - ssl->s3->alpn_selected == - MakeConstSpan(session->early_alpn, session->early_alpn_len)) { - ssl->s3->early_data_accepted = true; - } - - if (hs->new_session == NULL) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - - ssl->s3->session_reused = true; - - // Resumption incorporates fresh key material, so refresh the timeout. - ssl_session_renew_timeout(ssl, hs->new_session.get(), - ssl->session_ctx->session_psk_dhe_timeout); - break; - - case ssl_ticket_aead_error: - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return ssl_hs_error; - - case ssl_ticket_aead_retry: - hs->tls13_state = state_select_session; - return ssl_hs_pending_ticket; - } - - // Record connection properties in the new session. - hs->new_session->cipher = hs->new_cipher; - - // Store the initial negotiated ALPN in the session. - if (!ssl->s3->alpn_selected.empty()) { - hs->new_session->early_alpn = (uint8_t *)BUF_memdup( - ssl->s3->alpn_selected.data(), ssl->s3->alpn_selected.size()); - if (hs->new_session->early_alpn == NULL) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - hs->new_session->early_alpn_len = ssl->s3->alpn_selected.size(); - } - - if (ssl->ctx->dos_protection_cb != NULL && - ssl->ctx->dos_protection_cb(&client_hello) == 0) { - // Connection rejected for DOS reasons. - OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_REJECTED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - - size_t hash_len = EVP_MD_size( - ssl_get_handshake_digest(ssl_protocol_version(ssl), hs->new_cipher)); - - // Set up the key schedule and incorporate the PSK into the running secret. - if (ssl->s3->session_reused) { - if (!tls13_init_key_schedule(hs, hs->new_session->master_key, - hs->new_session->master_key_length)) { - return ssl_hs_error; - } - } else if (!tls13_init_key_schedule(hs, kZeroes, hash_len)) { - return ssl_hs_error; - } - - if (ssl->s3->early_data_accepted) { - if (!tls13_derive_early_secrets(hs)) { - return ssl_hs_error; - } - } else if (hs->early_data_offered) { - ssl->s3->skip_early_data = true; - } - - // Resolve ECDHE and incorporate it into the secret. - bool need_retry; - if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { - if (need_retry) { - ssl->s3->early_data_accepted = false; - ssl->s3->skip_early_data = true; - ssl->method->next_message(ssl); - if (!hs->transcript.UpdateForHelloRetryRequest()) { - return ssl_hs_error; - } - hs->tls13_state = state_send_hello_retry_request; - return ssl_hs_ok; - } - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_send_server_hello; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_hello_retry_request(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - - - ScopedCBB cbb; - CBB body, session_id, extensions; - uint16_t group_id; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || - !CBB_add_u16(&body, TLS1_2_VERSION) || - !CBB_add_bytes(&body, kHelloRetryRequest, SSL3_RANDOM_SIZE) || - !CBB_add_u8_length_prefixed(&body, &session_id) || - !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || - !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || - !CBB_add_u8(&body, 0 /* no compression */) || - !tls1_get_shared_group(hs, &group_id) || - !CBB_add_u16_length_prefixed(&body, &extensions) || - !CBB_add_u16(&extensions, TLSEXT_TYPE_supported_versions) || - !CBB_add_u16(&extensions, 2 /* length */) || - !CBB_add_u16(&extensions, ssl->version) || - !CBB_add_u16(&extensions, TLSEXT_TYPE_key_share) || - !CBB_add_u16(&extensions, 2 /* length */) || - !CBB_add_u16(&extensions, group_id) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - - if (!ssl->method->add_change_cipher_spec(ssl)) { - return ssl_hs_error; - } - - hs->sent_hello_retry_request = true; - hs->tls13_state = state_read_second_client_hello; - return ssl_hs_flush; -} - -static enum ssl_hs_wait_t do_read_second_client_hello(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CLIENT_HELLO)) { - return ssl_hs_error; - } - SSL_CLIENT_HELLO client_hello; - if (!ssl_client_hello_init(ssl, &client_hello, msg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - - bool need_retry; - if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { - if (need_retry) { - // Only send one HelloRetryRequest. - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); - } - return ssl_hs_error; - } - - if (!ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_send_server_hello; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - - // Send a ServerHello. - ScopedCBB cbb; - CBB body, extensions, session_id; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || - !CBB_add_u16(&body, TLS1_2_VERSION) || - !RAND_bytes(ssl->s3->server_random, sizeof(ssl->s3->server_random)) || - !CBB_add_bytes(&body, ssl->s3->server_random, SSL3_RANDOM_SIZE) || - !CBB_add_u8_length_prefixed(&body, &session_id) || - !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || - !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || - !CBB_add_u8(&body, 0) || - !CBB_add_u16_length_prefixed(&body, &extensions) || - !ssl_ext_pre_shared_key_add_serverhello(hs, &extensions) || - !ssl_ext_key_share_add_serverhello(hs, &extensions) || - !ssl_ext_supported_versions_add_serverhello(hs, &extensions) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - - if (!hs->sent_hello_retry_request && - !ssl->method->add_change_cipher_spec(ssl)) { - return ssl_hs_error; - } - - // Derive and enable the handshake traffic secrets. - if (!tls13_derive_handshake_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->server_handshake_secret, - hs->hash_len)) { - return ssl_hs_error; - } - - // Send EncryptedExtensions. - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_ENCRYPTED_EXTENSIONS) || - !ssl_add_serverhello_tlsext(hs, &body) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - - if (!ssl->s3->session_reused) { - // Determine whether to request a client certificate. - hs->cert_request = !!(ssl->verify_mode & SSL_VERIFY_PEER); - // Only request a certificate if Channel ID isn't negotiated. - if ((ssl->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && - ssl->s3->tlsext_channel_id_valid) { - hs->cert_request = false; - } - } - - // Send a CertificateRequest, if necessary. - if (hs->cert_request) { - CBB cert_request_extensions, sigalg_contents, sigalgs_cbb; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_CERTIFICATE_REQUEST) || - !CBB_add_u8(&body, 0 /* no certificate_request_context. */) || - !CBB_add_u16_length_prefixed(&body, &cert_request_extensions) || - !CBB_add_u16(&cert_request_extensions, - TLSEXT_TYPE_signature_algorithms) || - !CBB_add_u16_length_prefixed(&cert_request_extensions, - &sigalg_contents) || - !CBB_add_u16_length_prefixed(&sigalg_contents, &sigalgs_cbb) || - !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb)) { - return ssl_hs_error; - } - - if (ssl_has_client_CAs(ssl)) { - CBB ca_contents; - if (!CBB_add_u16(&cert_request_extensions, - TLSEXT_TYPE_certificate_authorities) || - !CBB_add_u16_length_prefixed(&cert_request_extensions, - &ca_contents) || - !ssl_add_client_CA_list(ssl, &ca_contents) || - !CBB_flush(&cert_request_extensions)) { - return ssl_hs_error; - } - } - - if (!ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - } - - // Send the server Certificate message, if necessary. - if (!ssl->s3->session_reused) { - if (!ssl_has_certificate(ssl)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); - return ssl_hs_error; - } - - if (!tls13_add_certificate(hs)) { - return ssl_hs_error; - } - - hs->tls13_state = state_send_server_certificate_verify; - return ssl_hs_ok; - } - - hs->tls13_state = state_send_server_finished; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_server_certificate_verify(SSL_HANDSHAKE *hs) { - switch (tls13_add_certificate_verify(hs)) { - case ssl_private_key_success: - hs->tls13_state = state_send_server_finished; - return ssl_hs_ok; - - case ssl_private_key_retry: - hs->tls13_state = state_send_server_certificate_verify; - return ssl_hs_private_key_operation; - - case ssl_private_key_failure: - return ssl_hs_error; - } - - assert(0); - return ssl_hs_error; -} - -static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!tls13_add_finished(hs) || - // Update the secret to the master secret and derive traffic keys. - !tls13_advance_key_schedule(hs, kZeroes, hs->hash_len) || - !tls13_derive_application_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->server_traffic_secret_0, - hs->hash_len)) { - return ssl_hs_error; - } - - if (ssl->s3->early_data_accepted) { - // If accepting 0-RTT, we send tickets half-RTT. This gets the tickets on - // the wire sooner and also avoids triggering a write on |SSL_read| when - // processing the client Finished. This requires computing the client - // Finished early. See draft-ietf-tls-tls13-18, section 4.5.1. - static const uint8_t kEndOfEarlyData[4] = {SSL3_MT_END_OF_EARLY_DATA, 0, - 0, 0}; - if (!hs->transcript.Update(kEndOfEarlyData)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_hs_error; - } - - size_t finished_len; - if (!tls13_finished_mac(hs, hs->expected_client_finished, &finished_len, - 0 /* client */)) { - return ssl_hs_error; - } - - if (finished_len != hs->hash_len) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_hs_error; - } - - // Feed the predicted Finished into the transcript. This allows us to derive - // the resumption secret early and send half-RTT tickets. - // - // TODO(davidben): This will need to be updated for DTLS 1.3. - assert(!SSL_is_dtls(hs->ssl)); - assert(hs->hash_len <= 0xff); - uint8_t header[4] = {SSL3_MT_FINISHED, 0, 0, - static_cast(hs->hash_len)}; - if (!hs->transcript.Update(header) || - !hs->transcript.Update( - MakeConstSpan(hs->expected_client_finished, hs->hash_len)) || - !tls13_derive_resumption_secret(hs) || - !add_new_session_tickets(hs)) { - return ssl_hs_error; - } - } - - hs->tls13_state = state_read_second_client_flight; - return ssl_hs_flush; -} - -static enum ssl_hs_wait_t do_read_second_client_flight(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (ssl->s3->early_data_accepted) { - if (!tls13_set_traffic_key(ssl, evp_aead_open, hs->early_traffic_secret, - hs->hash_len)) { - return ssl_hs_error; - } - hs->can_early_write = true; - hs->can_early_read = true; - hs->in_early_data = true; - } - hs->tls13_state = state_process_end_of_early_data; - return ssl->s3->early_data_accepted ? ssl_hs_read_end_of_early_data - : ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_process_end_of_early_data(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (hs->early_data_offered) { - // If early data was not accepted, the EndOfEarlyData and ChangeCipherSpec - // message will be in the discarded early data. - if (hs->ssl->s3->early_data_accepted) { - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - - if (!ssl_check_message_type(ssl, msg, SSL3_MT_END_OF_EARLY_DATA)) { - return ssl_hs_error; - } - if (CBS_len(&msg.body) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return ssl_hs_error; - } - ssl->method->next_message(ssl); - } - } - if (!tls13_set_traffic_key(ssl, evp_aead_open, hs->client_handshake_secret, - hs->hash_len)) { - return ssl_hs_error; - } - hs->tls13_state = ssl->s3->early_data_accepted - ? state_read_client_finished - : state_read_client_certificate; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!hs->cert_request) { - // OpenSSL returns X509_V_OK when no certificates are requested. This is - // classed by them as a bug, but it's assumed by at least NGINX. - hs->new_session->verify_result = X509_V_OK; - - // Skip this state. - hs->tls13_state = state_read_channel_id; - return ssl_hs_ok; - } - - const int allow_anonymous = - (ssl->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) == 0; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE) || - !tls13_process_certificate(hs, msg, allow_anonymous) || - !ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_read_client_certificate_verify; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_client_certificate_verify( - SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0) { - // Skip this state. - hs->tls13_state = state_read_channel_id; - return ssl_hs_ok; - } - - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - - switch (ssl_verify_peer_cert(hs)) { - case ssl_verify_ok: - break; - case ssl_verify_invalid: - return ssl_hs_error; - case ssl_verify_retry: - hs->tls13_state = state_read_client_certificate_verify; - return ssl_hs_certificate_verify; - } - - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE_VERIFY) || - !tls13_process_certificate_verify(hs, msg) || - !ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_read_channel_id; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!ssl->s3->tlsext_channel_id_valid) { - hs->tls13_state = state_read_client_finished; - return ssl_hs_ok; - } - - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CHANNEL_ID) || - !tls1_verify_channel_id(hs, msg) || - !ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_read_client_finished; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_client_finished(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || - // If early data was accepted, we've already computed the client Finished - // and derived the resumption secret. - !tls13_process_finished(hs, msg, ssl->s3->early_data_accepted) || - // evp_aead_seal keys have already been switched. - !tls13_set_traffic_key(ssl, evp_aead_open, hs->client_traffic_secret_0, - hs->hash_len)) { - return ssl_hs_error; - } - - if (!ssl->s3->early_data_accepted) { - if (!ssl_hash_message(hs, msg) || - !tls13_derive_resumption_secret(hs)) { - return ssl_hs_error; - } - - // We send post-handshake tickets as part of the handshake in 1-RTT. - hs->tls13_state = state_send_new_session_ticket; - } else { - // We already sent half-RTT tickets. - hs->tls13_state = state_done; - } - - ssl->method->next_message(ssl); - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_new_session_ticket(SSL_HANDSHAKE *hs) { - // If the client doesn't accept resumption with PSK_DHE_KE, don't send a - // session ticket. - if (!hs->accept_psk_mode) { - hs->tls13_state = state_done; - return ssl_hs_ok; - } - - if (!add_new_session_tickets(hs)) { - return ssl_hs_error; - } - - hs->tls13_state = state_done; - return ssl_hs_flush; -} - -enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs) { - while (hs->tls13_state != state_done) { - enum ssl_hs_wait_t ret = ssl_hs_error; - enum server_hs_state_t state = - static_cast(hs->tls13_state); - switch (state) { - case state_select_parameters: - ret = do_select_parameters(hs); - break; - case state_select_session: - ret = do_select_session(hs); - break; - case state_send_hello_retry_request: - ret = do_send_hello_retry_request(hs); - break; - case state_read_second_client_hello: - ret = do_read_second_client_hello(hs); - break; - case state_send_server_hello: - ret = do_send_server_hello(hs); - break; - case state_send_server_certificate_verify: - ret = do_send_server_certificate_verify(hs); - break; - case state_send_server_finished: - ret = do_send_server_finished(hs); - break; - case state_read_second_client_flight: - ret = do_read_second_client_flight(hs); - break; - case state_process_end_of_early_data: - ret = do_process_end_of_early_data(hs); - break; - case state_read_client_certificate: - ret = do_read_client_certificate(hs); - break; - case state_read_client_certificate_verify: - ret = do_read_client_certificate_verify(hs); - break; - case state_read_channel_id: - ret = do_read_channel_id(hs); - break; - case state_read_client_finished: - ret = do_read_client_finished(hs); - break; - case state_send_new_session_ticket: - ret = do_send_new_session_ticket(hs); - break; - case state_done: - ret = ssl_hs_ok; - break; - } - - if (hs->tls13_state != state) { - ssl_do_info_callback(hs->ssl, SSL_CB_ACCEPT_LOOP, 1); - } - - if (ret != ssl_hs_ok) { - return ret; - } - } - - return ssl_hs_ok; -} - -const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs) { - enum server_hs_state_t state = - static_cast(hs->tls13_state); - switch (state) { - case state_select_parameters: - return "TLS 1.3 server select_parameters"; - case state_select_session: - return "TLS 1.3 server select_session"; - case state_send_hello_retry_request: - return "TLS 1.3 server send_hello_retry_request"; - case state_read_second_client_hello: - return "TLS 1.3 server read_second_client_hello"; - case state_send_server_hello: - return "TLS 1.3 server send_server_hello"; - case state_send_server_certificate_verify: - return "TLS 1.3 server send_server_certificate_verify"; - case state_send_server_finished: - return "TLS 1.3 server send_server_finished"; - case state_read_second_client_flight: - return "TLS 1.3 server read_second_client_flight"; - case state_process_end_of_early_data: - return "TLS 1.3 server process_end_of_early_data"; - case state_read_client_certificate: - return "TLS 1.3 server read_client_certificate"; - case state_read_client_certificate_verify: - return "TLS 1.3 server read_client_certificate_verify"; - case state_read_channel_id: - return "TLS 1.3 server read_channel_id"; - case state_read_client_finished: - return "TLS 1.3 server read_client_finished"; - case state_send_new_session_ticket: - return "TLS 1.3 server send_new_session_ticket"; - case state_done: - return "TLS 1.3 server done"; - } - - return "TLS 1.3 server unknown"; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/ssl/tls13_server.cc.grpc_back b/Pods/BoringSSL-GRPC/ssl/tls13_server.cc.grpc_back deleted file mode 100644 index 3bd67866f..000000000 --- a/Pods/BoringSSL-GRPC/ssl/tls13_server.cc.grpc_back +++ /dev/null @@ -1,1022 +0,0 @@ -/* Copyright (c) 2016, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -// Per C99, various stdint.h macros are unavailable in C++ unless some macros -// are defined. C++11 overruled this decision, but older Android NDKs still -// require it. -#if !defined(__STDC_LIMIT_MACROS) -#define __STDC_LIMIT_MACROS -#endif - -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "../crypto/internal.h" -#include "internal.h" - - -namespace bssl { - -enum server_hs_state_t { - state_select_parameters = 0, - state_select_session, - state_send_hello_retry_request, - state_read_second_client_hello, - state_send_server_hello, - state_send_server_certificate_verify, - state_send_server_finished, - state_read_second_client_flight, - state_process_end_of_early_data, - state_read_client_certificate, - state_read_client_certificate_verify, - state_read_channel_id, - state_read_client_finished, - state_send_new_session_ticket, - state_done, -}; - -static const uint8_t kZeroes[EVP_MAX_MD_SIZE] = {0}; - -static int resolve_ecdhe_secret(SSL_HANDSHAKE *hs, bool *out_need_retry, - SSL_CLIENT_HELLO *client_hello) { - SSL *const ssl = hs->ssl; - *out_need_retry = false; - - // We only support connections that include an ECDHE key exchange. - CBS key_share; - if (!ssl_client_hello_get_extension(client_hello, &key_share, - TLSEXT_TYPE_key_share)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_MISSING_KEY_SHARE); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_MISSING_EXTENSION); - return 0; - } - - bool found_key_share; - Array dhe_secret; - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!ssl_ext_key_share_parse_clienthello(hs, &found_key_share, &dhe_secret, - &alert, &key_share)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return 0; - } - - if (!found_key_share) { - *out_need_retry = true; - return 0; - } - - return tls13_advance_key_schedule(hs, dhe_secret.data(), dhe_secret.size()); -} - -static int ssl_ext_supported_versions_add_serverhello(SSL_HANDSHAKE *hs, - CBB *out) { - CBB contents; - if (!CBB_add_u16(out, TLSEXT_TYPE_supported_versions) || - !CBB_add_u16_length_prefixed(out, &contents) || - !CBB_add_u16(&contents, hs->ssl->version) || - !CBB_flush(out)) { - return 0; - } - - return 1; -} - -static const SSL_CIPHER *choose_tls13_cipher( - const SSL *ssl, const SSL_CLIENT_HELLO *client_hello) { - if (client_hello->cipher_suites_len % 2 != 0) { - return NULL; - } - - CBS cipher_suites; - CBS_init(&cipher_suites, client_hello->cipher_suites, - client_hello->cipher_suites_len); - - const int aes_is_fine = EVP_has_aes_hardware(); - const uint16_t version = ssl_protocol_version(ssl); - - const SSL_CIPHER *best = NULL; - while (CBS_len(&cipher_suites) > 0) { - uint16_t cipher_suite; - if (!CBS_get_u16(&cipher_suites, &cipher_suite)) { - return NULL; - } - - // Limit to TLS 1.3 ciphers we know about. - const SSL_CIPHER *candidate = SSL_get_cipher_by_value(cipher_suite); - if (candidate == NULL || - SSL_CIPHER_get_min_version(candidate) > version || - SSL_CIPHER_get_max_version(candidate) < version) { - continue; - } - - // TLS 1.3 removes legacy ciphers, so honor the client order, but prefer - // ChaCha20 if we do not have AES hardware. - if (aes_is_fine) { - return candidate; - } - - if (candidate->algorithm_enc == SSL_CHACHA20POLY1305) { - return candidate; - } - - if (best == NULL) { - best = candidate; - } - } - - return best; -} - -static int add_new_session_tickets(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - // TLS 1.3 recommends single-use tickets, so issue multiple tickets in case - // the client makes several connections before getting a renewal. - static const int kNumTickets = 2; - - // Rebase the session timestamp so that it is measured from ticket - // issuance. - ssl_session_rebase_time(ssl, hs->new_session.get()); - - for (int i = 0; i < kNumTickets; i++) { - UniquePtr session( - SSL_SESSION_dup(hs->new_session.get(), SSL_SESSION_INCLUDE_NONAUTH)); - if (!session) { - return 0; - } - - if (!RAND_bytes((uint8_t *)&session->ticket_age_add, 4)) { - return 0; - } - session->ticket_age_add_valid = 1; - if (ssl->cert->enable_early_data) { - session->ticket_max_early_data = kMaxEarlyDataAccepted; - } - - static_assert(kNumTickets < 256, "Too many tickets"); - uint8_t nonce[] = {static_cast(i)}; - - ScopedCBB cbb; - CBB body, nonce_cbb, ticket, extensions; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_NEW_SESSION_TICKET) || - !CBB_add_u32(&body, session->timeout) || - !CBB_add_u32(&body, session->ticket_age_add) || - !CBB_add_u8_length_prefixed(&body, &nonce_cbb) || - !CBB_add_bytes(&nonce_cbb, nonce, sizeof(nonce)) || - !CBB_add_u16_length_prefixed(&body, &ticket) || - !tls13_derive_session_psk(session.get(), nonce) || - !ssl_encrypt_ticket(ssl, &ticket, session.get()) || - !CBB_add_u16_length_prefixed(&body, &extensions)) { - return 0; - } - - if (ssl->cert->enable_early_data) { - CBB early_data_info; - if (!CBB_add_u16(&extensions, TLSEXT_TYPE_early_data) || - !CBB_add_u16_length_prefixed(&extensions, &early_data_info) || - !CBB_add_u32(&early_data_info, session->ticket_max_early_data) || - !CBB_flush(&extensions)) { - return 0; - } - } - - // Add a fake extension. See draft-davidben-tls-grease-01. - if (!CBB_add_u16(&extensions, - ssl_get_grease_value(hs, ssl_grease_ticket_extension)) || - !CBB_add_u16(&extensions, 0 /* empty */)) { - return 0; - } - - if (!ssl_add_message_cbb(ssl, cbb.get())) { - return 0; - } - } - - return 1; -} - -static enum ssl_hs_wait_t do_select_parameters(SSL_HANDSHAKE *hs) { - // At this point, most ClientHello extensions have already been processed by - // the common handshake logic. Resolve the remaining non-PSK parameters. - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - SSL_CLIENT_HELLO client_hello; - if (!ssl_client_hello_init(ssl, &client_hello, msg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - - OPENSSL_memcpy(hs->session_id, client_hello.session_id, - client_hello.session_id_len); - hs->session_id_len = client_hello.session_id_len; - - // Negotiate the cipher suite. - hs->new_cipher = choose_tls13_cipher(ssl, &client_hello); - if (hs->new_cipher == NULL) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_SHARED_CIPHER); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_HANDSHAKE_FAILURE); - return ssl_hs_error; - } - - // HTTP/2 negotiation depends on the cipher suite, so ALPN negotiation was - // deferred. Complete it now. - uint8_t alert = SSL_AD_DECODE_ERROR; - if (!ssl_negotiate_alpn(hs, &alert, &client_hello)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return ssl_hs_error; - } - - // The PRF hash is now known. Set up the key schedule and hash the - // ClientHello. - if (!hs->transcript.InitHash(ssl_protocol_version(ssl), hs->new_cipher)) { - return ssl_hs_error; - } - - if (!ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - hs->tls13_state = state_select_session; - return ssl_hs_ok; -} - -static enum ssl_ticket_aead_result_t select_session( - SSL_HANDSHAKE *hs, uint8_t *out_alert, UniquePtr *out_session, - int32_t *out_ticket_age_skew, const SSLMessage &msg, - const SSL_CLIENT_HELLO *client_hello) { - SSL *const ssl = hs->ssl; - *out_session = NULL; - - // Decode the ticket if we agreed on a PSK key exchange mode. - CBS pre_shared_key; - if (!hs->accept_psk_mode || - !ssl_client_hello_get_extension(client_hello, &pre_shared_key, - TLSEXT_TYPE_pre_shared_key)) { - return ssl_ticket_aead_ignore_ticket; - } - - // Verify that the pre_shared_key extension is the last extension in - // ClientHello. - if (CBS_data(&pre_shared_key) + CBS_len(&pre_shared_key) != - client_hello->extensions + client_hello->extensions_len) { - OPENSSL_PUT_ERROR(SSL, SSL_R_PRE_SHARED_KEY_MUST_BE_LAST); - *out_alert = SSL_AD_ILLEGAL_PARAMETER; - return ssl_ticket_aead_error; - } - - CBS ticket, binders; - uint32_t client_ticket_age; - if (!ssl_ext_pre_shared_key_parse_clienthello(hs, &ticket, &binders, - &client_ticket_age, out_alert, - &pre_shared_key)) { - return ssl_ticket_aead_error; - } - - // TLS 1.3 session tickets are renewed separately as part of the - // NewSessionTicket. - bool unused_renew; - UniquePtr session; - enum ssl_ticket_aead_result_t ret = - ssl_process_ticket(ssl, &session, &unused_renew, CBS_data(&ticket), - CBS_len(&ticket), NULL, 0); - switch (ret) { - case ssl_ticket_aead_success: - break; - case ssl_ticket_aead_error: - *out_alert = SSL_AD_INTERNAL_ERROR; - return ret; - default: - return ret; - } - - if (!ssl_session_is_resumable(hs, session.get()) || - // Historically, some TLS 1.3 tickets were missing ticket_age_add. - !session->ticket_age_add_valid) { - return ssl_ticket_aead_ignore_ticket; - } - - // Recover the client ticket age and convert to seconds. - client_ticket_age -= session->ticket_age_add; - client_ticket_age /= 1000; - - struct OPENSSL_timeval now; - ssl_get_current_time(ssl, &now); - - // Compute the server ticket age in seconds. - assert(now.tv_sec >= session->time); - uint64_t server_ticket_age = now.tv_sec - session->time; - - // To avoid overflowing |hs->ticket_age_skew|, we will not resume - // 68-year-old sessions. - if (server_ticket_age > INT32_MAX) { - return ssl_ticket_aead_ignore_ticket; - } - - // TODO(davidben,svaldez): Measure this value to decide on tolerance. For - // now, accept all values. https://crbug.com/boringssl/113. - *out_ticket_age_skew = - (int32_t)client_ticket_age - (int32_t)server_ticket_age; - - // Check the PSK binder. - if (!tls13_verify_psk_binder(hs, session.get(), msg, &binders)) { - *out_alert = SSL_AD_DECRYPT_ERROR; - return ssl_ticket_aead_error; - } - - *out_session = std::move(session); - return ssl_ticket_aead_success; -} - -static enum ssl_hs_wait_t do_select_session(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - SSL_CLIENT_HELLO client_hello; - if (!ssl_client_hello_init(ssl, &client_hello, msg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - - uint8_t alert = SSL_AD_DECODE_ERROR; - UniquePtr session; - switch (select_session(hs, &alert, &session, &ssl->s3->ticket_age_skew, msg, - &client_hello)) { - case ssl_ticket_aead_ignore_ticket: - assert(!session); - if (!ssl_get_new_session(hs, 1 /* server */)) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - break; - - case ssl_ticket_aead_success: - // Carry over authentication information from the previous handshake into - // a fresh session. - hs->new_session = - SSL_SESSION_dup(session.get(), SSL_SESSION_DUP_AUTH_ONLY); - - if (ssl->cert->enable_early_data && - // Early data must be acceptable for this ticket. - session->ticket_max_early_data != 0 && - // The client must have offered early data. - hs->early_data_offered && - // Channel ID is incompatible with 0-RTT. - !ssl->s3->tlsext_channel_id_valid && - // If Token Binding is negotiated, reject 0-RTT. - !ssl->token_binding_negotiated && - // Custom extensions is incompatible with 0-RTT. - hs->custom_extensions.received == 0 && - // The negotiated ALPN must match the one in the ticket. - ssl->s3->alpn_selected == - MakeConstSpan(session->early_alpn, session->early_alpn_len)) { - ssl->s3->early_data_accepted = true; - } - - if (hs->new_session == NULL) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - - ssl->s3->session_reused = true; - - // Resumption incorporates fresh key material, so refresh the timeout. - ssl_session_renew_timeout(ssl, hs->new_session.get(), - ssl->session_ctx->session_psk_dhe_timeout); - break; - - case ssl_ticket_aead_error: - ssl_send_alert(ssl, SSL3_AL_FATAL, alert); - return ssl_hs_error; - - case ssl_ticket_aead_retry: - hs->tls13_state = state_select_session; - return ssl_hs_pending_ticket; - } - - // Record connection properties in the new session. - hs->new_session->cipher = hs->new_cipher; - - // Store the initial negotiated ALPN in the session. - if (!ssl->s3->alpn_selected.empty()) { - hs->new_session->early_alpn = (uint8_t *)BUF_memdup( - ssl->s3->alpn_selected.data(), ssl->s3->alpn_selected.size()); - if (hs->new_session->early_alpn == NULL) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - hs->new_session->early_alpn_len = ssl->s3->alpn_selected.size(); - } - - if (ssl->ctx->dos_protection_cb != NULL && - ssl->ctx->dos_protection_cb(&client_hello) == 0) { - // Connection rejected for DOS reasons. - OPENSSL_PUT_ERROR(SSL, SSL_R_CONNECTION_REJECTED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_INTERNAL_ERROR); - return ssl_hs_error; - } - - size_t hash_len = EVP_MD_size( - ssl_get_handshake_digest(ssl_protocol_version(ssl), hs->new_cipher)); - - // Set up the key schedule and incorporate the PSK into the running secret. - if (ssl->s3->session_reused) { - if (!tls13_init_key_schedule(hs, hs->new_session->master_key, - hs->new_session->master_key_length)) { - return ssl_hs_error; - } - } else if (!tls13_init_key_schedule(hs, kZeroes, hash_len)) { - return ssl_hs_error; - } - - if (ssl->s3->early_data_accepted) { - if (!tls13_derive_early_secrets(hs)) { - return ssl_hs_error; - } - } else if (hs->early_data_offered) { - ssl->s3->skip_early_data = true; - } - - // Resolve ECDHE and incorporate it into the secret. - bool need_retry; - if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { - if (need_retry) { - ssl->s3->early_data_accepted = false; - ssl->s3->skip_early_data = true; - ssl->method->next_message(ssl); - if (!hs->transcript.UpdateForHelloRetryRequest()) { - return ssl_hs_error; - } - hs->tls13_state = state_send_hello_retry_request; - return ssl_hs_ok; - } - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_send_server_hello; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_hello_retry_request(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - - - ScopedCBB cbb; - CBB body, session_id, extensions; - uint16_t group_id; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || - !CBB_add_u16(&body, TLS1_2_VERSION) || - !CBB_add_bytes(&body, kHelloRetryRequest, SSL3_RANDOM_SIZE) || - !CBB_add_u8_length_prefixed(&body, &session_id) || - !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || - !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || - !CBB_add_u8(&body, 0 /* no compression */) || - !tls1_get_shared_group(hs, &group_id) || - !CBB_add_u16_length_prefixed(&body, &extensions) || - !CBB_add_u16(&extensions, TLSEXT_TYPE_supported_versions) || - !CBB_add_u16(&extensions, 2 /* length */) || - !CBB_add_u16(&extensions, ssl->version) || - !CBB_add_u16(&extensions, TLSEXT_TYPE_key_share) || - !CBB_add_u16(&extensions, 2 /* length */) || - !CBB_add_u16(&extensions, group_id) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - - if (!ssl->method->add_change_cipher_spec(ssl)) { - return ssl_hs_error; - } - - hs->sent_hello_retry_request = true; - hs->tls13_state = state_read_second_client_hello; - return ssl_hs_flush; -} - -static enum ssl_hs_wait_t do_read_second_client_hello(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CLIENT_HELLO)) { - return ssl_hs_error; - } - SSL_CLIENT_HELLO client_hello; - if (!ssl_client_hello_init(ssl, &client_hello, msg)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_CLIENTHELLO_PARSE_FAILED); - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - return ssl_hs_error; - } - - bool need_retry; - if (!resolve_ecdhe_secret(hs, &need_retry, &client_hello)) { - if (need_retry) { - // Only send one HelloRetryRequest. - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_ILLEGAL_PARAMETER); - OPENSSL_PUT_ERROR(SSL, SSL_R_WRONG_CURVE); - } - return ssl_hs_error; - } - - if (!ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_send_server_hello; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_server_hello(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - - // Send a ServerHello. - ScopedCBB cbb; - CBB body, extensions, session_id; - if (!ssl->method->init_message(ssl, cbb.get(), &body, SSL3_MT_SERVER_HELLO) || - !CBB_add_u16(&body, TLS1_2_VERSION) || - !RAND_bytes(ssl->s3->server_random, sizeof(ssl->s3->server_random)) || - !CBB_add_bytes(&body, ssl->s3->server_random, SSL3_RANDOM_SIZE) || - !CBB_add_u8_length_prefixed(&body, &session_id) || - !CBB_add_bytes(&session_id, hs->session_id, hs->session_id_len) || - !CBB_add_u16(&body, ssl_cipher_get_value(hs->new_cipher)) || - !CBB_add_u8(&body, 0) || - !CBB_add_u16_length_prefixed(&body, &extensions) || - !ssl_ext_pre_shared_key_add_serverhello(hs, &extensions) || - !ssl_ext_key_share_add_serverhello(hs, &extensions) || - !ssl_ext_supported_versions_add_serverhello(hs, &extensions) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - - if (!hs->sent_hello_retry_request && - !ssl->method->add_change_cipher_spec(ssl)) { - return ssl_hs_error; - } - - // Derive and enable the handshake traffic secrets. - if (!tls13_derive_handshake_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->server_handshake_secret, - hs->hash_len)) { - return ssl_hs_error; - } - - // Send EncryptedExtensions. - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_ENCRYPTED_EXTENSIONS) || - !ssl_add_serverhello_tlsext(hs, &body) || - !ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - - if (!ssl->s3->session_reused) { - // Determine whether to request a client certificate. - hs->cert_request = !!(ssl->verify_mode & SSL_VERIFY_PEER); - // Only request a certificate if Channel ID isn't negotiated. - if ((ssl->verify_mode & SSL_VERIFY_PEER_IF_NO_OBC) && - ssl->s3->tlsext_channel_id_valid) { - hs->cert_request = false; - } - } - - // Send a CertificateRequest, if necessary. - if (hs->cert_request) { - CBB cert_request_extensions, sigalg_contents, sigalgs_cbb; - if (!ssl->method->init_message(ssl, cbb.get(), &body, - SSL3_MT_CERTIFICATE_REQUEST) || - !CBB_add_u8(&body, 0 /* no certificate_request_context. */) || - !CBB_add_u16_length_prefixed(&body, &cert_request_extensions) || - !CBB_add_u16(&cert_request_extensions, - TLSEXT_TYPE_signature_algorithms) || - !CBB_add_u16_length_prefixed(&cert_request_extensions, - &sigalg_contents) || - !CBB_add_u16_length_prefixed(&sigalg_contents, &sigalgs_cbb) || - !tls12_add_verify_sigalgs(ssl, &sigalgs_cbb)) { - return ssl_hs_error; - } - - if (ssl_has_client_CAs(ssl)) { - CBB ca_contents; - if (!CBB_add_u16(&cert_request_extensions, - TLSEXT_TYPE_certificate_authorities) || - !CBB_add_u16_length_prefixed(&cert_request_extensions, - &ca_contents) || - !ssl_add_client_CA_list(ssl, &ca_contents) || - !CBB_flush(&cert_request_extensions)) { - return ssl_hs_error; - } - } - - if (!ssl_add_message_cbb(ssl, cbb.get())) { - return ssl_hs_error; - } - } - - // Send the server Certificate message, if necessary. - if (!ssl->s3->session_reused) { - if (!ssl_has_certificate(ssl)) { - OPENSSL_PUT_ERROR(SSL, SSL_R_NO_CERTIFICATE_SET); - return ssl_hs_error; - } - - if (!tls13_add_certificate(hs)) { - return ssl_hs_error; - } - - hs->tls13_state = state_send_server_certificate_verify; - return ssl_hs_ok; - } - - hs->tls13_state = state_send_server_finished; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_server_certificate_verify(SSL_HANDSHAKE *hs) { - switch (tls13_add_certificate_verify(hs)) { - case ssl_private_key_success: - hs->tls13_state = state_send_server_finished; - return ssl_hs_ok; - - case ssl_private_key_retry: - hs->tls13_state = state_send_server_certificate_verify; - return ssl_hs_private_key_operation; - - case ssl_private_key_failure: - return ssl_hs_error; - } - - assert(0); - return ssl_hs_error; -} - -static enum ssl_hs_wait_t do_send_server_finished(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!tls13_add_finished(hs) || - // Update the secret to the master secret and derive traffic keys. - !tls13_advance_key_schedule(hs, kZeroes, hs->hash_len) || - !tls13_derive_application_secrets(hs) || - !tls13_set_traffic_key(ssl, evp_aead_seal, hs->server_traffic_secret_0, - hs->hash_len)) { - return ssl_hs_error; - } - - if (ssl->s3->early_data_accepted) { - // If accepting 0-RTT, we send tickets half-RTT. This gets the tickets on - // the wire sooner and also avoids triggering a write on |SSL_read| when - // processing the client Finished. This requires computing the client - // Finished early. See draft-ietf-tls-tls13-18, section 4.5.1. - static const uint8_t kEndOfEarlyData[4] = {SSL3_MT_END_OF_EARLY_DATA, 0, - 0, 0}; - if (!hs->transcript.Update(kEndOfEarlyData)) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_hs_error; - } - - size_t finished_len; - if (!tls13_finished_mac(hs, hs->expected_client_finished, &finished_len, - 0 /* client */)) { - return ssl_hs_error; - } - - if (finished_len != hs->hash_len) { - OPENSSL_PUT_ERROR(SSL, ERR_R_INTERNAL_ERROR); - return ssl_hs_error; - } - - // Feed the predicted Finished into the transcript. This allows us to derive - // the resumption secret early and send half-RTT tickets. - // - // TODO(davidben): This will need to be updated for DTLS 1.3. - assert(!SSL_is_dtls(hs->ssl)); - assert(hs->hash_len <= 0xff); - uint8_t header[4] = {SSL3_MT_FINISHED, 0, 0, - static_cast(hs->hash_len)}; - if (!hs->transcript.Update(header) || - !hs->transcript.Update( - MakeConstSpan(hs->expected_client_finished, hs->hash_len)) || - !tls13_derive_resumption_secret(hs) || - !add_new_session_tickets(hs)) { - return ssl_hs_error; - } - } - - hs->tls13_state = state_read_second_client_flight; - return ssl_hs_flush; -} - -static enum ssl_hs_wait_t do_read_second_client_flight(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (ssl->s3->early_data_accepted) { - if (!tls13_set_traffic_key(ssl, evp_aead_open, hs->early_traffic_secret, - hs->hash_len)) { - return ssl_hs_error; - } - hs->can_early_write = true; - hs->can_early_read = true; - hs->in_early_data = true; - } - hs->tls13_state = state_process_end_of_early_data; - return ssl->s3->early_data_accepted ? ssl_hs_read_end_of_early_data - : ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_process_end_of_early_data(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (hs->early_data_offered) { - // If early data was not accepted, the EndOfEarlyData and ChangeCipherSpec - // message will be in the discarded early data. - if (hs->ssl->s3->early_data_accepted) { - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - - if (!ssl_check_message_type(ssl, msg, SSL3_MT_END_OF_EARLY_DATA)) { - return ssl_hs_error; - } - if (CBS_len(&msg.body) != 0) { - ssl_send_alert(ssl, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); - OPENSSL_PUT_ERROR(SSL, SSL_R_DECODE_ERROR); - return ssl_hs_error; - } - ssl->method->next_message(ssl); - } - } - if (!tls13_set_traffic_key(ssl, evp_aead_open, hs->client_handshake_secret, - hs->hash_len)) { - return ssl_hs_error; - } - hs->tls13_state = ssl->s3->early_data_accepted - ? state_read_client_finished - : state_read_client_certificate; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_client_certificate(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!hs->cert_request) { - // OpenSSL returns X509_V_OK when no certificates are requested. This is - // classed by them as a bug, but it's assumed by at least NGINX. - hs->new_session->verify_result = X509_V_OK; - - // Skip this state. - hs->tls13_state = state_read_channel_id; - return ssl_hs_ok; - } - - const int allow_anonymous = - (ssl->verify_mode & SSL_VERIFY_FAIL_IF_NO_PEER_CERT) == 0; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE) || - !tls13_process_certificate(hs, msg, allow_anonymous) || - !ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_read_client_certificate_verify; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_client_certificate_verify( - SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (sk_CRYPTO_BUFFER_num(hs->new_session->certs) == 0) { - // Skip this state. - hs->tls13_state = state_read_channel_id; - return ssl_hs_ok; - } - - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - - switch (ssl_verify_peer_cert(hs)) { - case ssl_verify_ok: - break; - case ssl_verify_invalid: - return ssl_hs_error; - case ssl_verify_retry: - hs->tls13_state = state_read_client_certificate_verify; - return ssl_hs_certificate_verify; - } - - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CERTIFICATE_VERIFY) || - !tls13_process_certificate_verify(hs, msg) || - !ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_read_channel_id; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_channel_id(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - if (!ssl->s3->tlsext_channel_id_valid) { - hs->tls13_state = state_read_client_finished; - return ssl_hs_ok; - } - - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_CHANNEL_ID) || - !tls1_verify_channel_id(hs, msg) || - !ssl_hash_message(hs, msg)) { - return ssl_hs_error; - } - - ssl->method->next_message(ssl); - hs->tls13_state = state_read_client_finished; - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_read_client_finished(SSL_HANDSHAKE *hs) { - SSL *const ssl = hs->ssl; - SSLMessage msg; - if (!ssl->method->get_message(ssl, &msg)) { - return ssl_hs_read_message; - } - if (!ssl_check_message_type(ssl, msg, SSL3_MT_FINISHED) || - // If early data was accepted, we've already computed the client Finished - // and derived the resumption secret. - !tls13_process_finished(hs, msg, ssl->s3->early_data_accepted) || - // evp_aead_seal keys have already been switched. - !tls13_set_traffic_key(ssl, evp_aead_open, hs->client_traffic_secret_0, - hs->hash_len)) { - return ssl_hs_error; - } - - if (!ssl->s3->early_data_accepted) { - if (!ssl_hash_message(hs, msg) || - !tls13_derive_resumption_secret(hs)) { - return ssl_hs_error; - } - - // We send post-handshake tickets as part of the handshake in 1-RTT. - hs->tls13_state = state_send_new_session_ticket; - } else { - // We already sent half-RTT tickets. - hs->tls13_state = state_done; - } - - ssl->method->next_message(ssl); - return ssl_hs_ok; -} - -static enum ssl_hs_wait_t do_send_new_session_ticket(SSL_HANDSHAKE *hs) { - // If the client doesn't accept resumption with PSK_DHE_KE, don't send a - // session ticket. - if (!hs->accept_psk_mode) { - hs->tls13_state = state_done; - return ssl_hs_ok; - } - - if (!add_new_session_tickets(hs)) { - return ssl_hs_error; - } - - hs->tls13_state = state_done; - return ssl_hs_flush; -} - -enum ssl_hs_wait_t tls13_server_handshake(SSL_HANDSHAKE *hs) { - while (hs->tls13_state != state_done) { - enum ssl_hs_wait_t ret = ssl_hs_error; - enum server_hs_state_t state = - static_cast(hs->tls13_state); - switch (state) { - case state_select_parameters: - ret = do_select_parameters(hs); - break; - case state_select_session: - ret = do_select_session(hs); - break; - case state_send_hello_retry_request: - ret = do_send_hello_retry_request(hs); - break; - case state_read_second_client_hello: - ret = do_read_second_client_hello(hs); - break; - case state_send_server_hello: - ret = do_send_server_hello(hs); - break; - case state_send_server_certificate_verify: - ret = do_send_server_certificate_verify(hs); - break; - case state_send_server_finished: - ret = do_send_server_finished(hs); - break; - case state_read_second_client_flight: - ret = do_read_second_client_flight(hs); - break; - case state_process_end_of_early_data: - ret = do_process_end_of_early_data(hs); - break; - case state_read_client_certificate: - ret = do_read_client_certificate(hs); - break; - case state_read_client_certificate_verify: - ret = do_read_client_certificate_verify(hs); - break; - case state_read_channel_id: - ret = do_read_channel_id(hs); - break; - case state_read_client_finished: - ret = do_read_client_finished(hs); - break; - case state_send_new_session_ticket: - ret = do_send_new_session_ticket(hs); - break; - case state_done: - ret = ssl_hs_ok; - break; - } - - if (hs->tls13_state != state) { - ssl_do_info_callback(hs->ssl, SSL_CB_ACCEPT_LOOP, 1); - } - - if (ret != ssl_hs_ok) { - return ret; - } - } - - return ssl_hs_ok; -} - -const char *tls13_server_handshake_state(SSL_HANDSHAKE *hs) { - enum server_hs_state_t state = - static_cast(hs->tls13_state); - switch (state) { - case state_select_parameters: - return "TLS 1.3 server select_parameters"; - case state_select_session: - return "TLS 1.3 server select_session"; - case state_send_hello_retry_request: - return "TLS 1.3 server send_hello_retry_request"; - case state_read_second_client_hello: - return "TLS 1.3 server read_second_client_hello"; - case state_send_server_hello: - return "TLS 1.3 server send_server_hello"; - case state_send_server_certificate_verify: - return "TLS 1.3 server send_server_certificate_verify"; - case state_send_server_finished: - return "TLS 1.3 server send_server_finished"; - case state_read_second_client_flight: - return "TLS 1.3 server read_second_client_flight"; - case state_process_end_of_early_data: - return "TLS 1.3 server process_end_of_early_data"; - case state_read_client_certificate: - return "TLS 1.3 server read_client_certificate"; - case state_read_client_certificate_verify: - return "TLS 1.3 server read_client_certificate_verify"; - case state_read_channel_id: - return "TLS 1.3 server read_channel_id"; - case state_read_client_finished: - return "TLS 1.3 server read_client_finished"; - case state_send_new_session_ticket: - return "TLS 1.3 server send_new_session_ticket"; - case state_done: - return "TLS 1.3 server done"; - } - - return "TLS 1.3 server unknown"; -} - -} // namespace bssl diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/curve25519.c b/Pods/BoringSSL-GRPC/third_party/fiat/curve25519.c deleted file mode 100644 index bf7819bb9..000000000 --- a/Pods/BoringSSL-GRPC/third_party/fiat/curve25519.c +++ /dev/null @@ -1,3230 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// Some of this code is taken from the ref10 version of Ed25519 in SUPERCOP -// 20141124 (http://bench.cr.yp.to/supercop.html). That code is released as -// public domain but parts have been replaced with code generated by Fiat -// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. -// -// The field functions are shared by Ed25519 and X25519 where possible. - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../../crypto/internal.h" - - -// Various pre-computed constants. -#include "./curve25519_tables.h" - - -// Low-level intrinsic operations (hand-written). - -static uint64_t load_3(const uint8_t *in) { - uint64_t result; - result = (uint64_t)in[0]; - result |= ((uint64_t)in[1]) << 8; - result |= ((uint64_t)in[2]) << 16; - return result; -} - -static uint64_t load_4(const uint8_t *in) { - uint64_t result; - result = (uint64_t)in[0]; - result |= ((uint64_t)in[1]) << 8; - result |= ((uint64_t)in[2]) << 16; - result |= ((uint64_t)in[3]) << 24; - return result; -} - -#if defined(BORINGSSL_CURVE25519_64BIT) -static uint64_t load_8(const uint8_t *in) { - uint64_t result; - result = (uint64_t)in[0]; - result |= ((uint64_t)in[1]) << 8; - result |= ((uint64_t)in[2]) << 16; - result |= ((uint64_t)in[3]) << 24; - result |= ((uint64_t)in[4]) << 32; - result |= ((uint64_t)in[5]) << 40; - result |= ((uint64_t)in[6]) << 48; - result |= ((uint64_t)in[7]) << 56; - return result; -} - -static uint8_t /*bool*/ addcarryx_u51(uint8_t /*bool*/ c, uint64_t a, - uint64_t b, uint64_t *low) { - // This function extracts 51 bits of result and 1 bit of carry (52 total), so - // a 64-bit intermediate is sufficient. - uint64_t x = a + b + c; - *low = x & ((UINT64_C(1) << 51) - 1); - return (x >> 51) & 1; -} - -static uint8_t /*bool*/ subborrow_u51(uint8_t /*bool*/ c, uint64_t a, - uint64_t b, uint64_t *low) { - // This function extracts 51 bits of result and 1 bit of borrow (52 total), so - // a 64-bit intermediate is sufficient. - uint64_t x = a - b - c; - *low = x & ((UINT64_C(1) << 51) - 1); - return x >> 63; -} - -static uint64_t cmovznz64(uint64_t t, uint64_t z, uint64_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#else - -static uint8_t /*bool*/ addcarryx_u25(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 25 bits of result and 1 bit of carry (26 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a + b + c; - *low = x & ((1 << 25) - 1); - return (x >> 25) & 1; -} - -static uint8_t /*bool*/ addcarryx_u26(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 26 bits of result and 1 bit of carry (27 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a + b + c; - *low = x & ((1 << 26) - 1); - return (x >> 26) & 1; -} - -static uint8_t /*bool*/ subborrow_u25(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 25 bits of result and 1 bit of borrow (26 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a - b - c; - *low = x & ((1 << 25) - 1); - return x >> 31; -} - -static uint8_t /*bool*/ subborrow_u26(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 26 bits of result and 1 bit of borrow (27 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a - b - c; - *low = x & ((1 << 26) - 1); - return x >> 31; -} - -static uint32_t cmovznz32(uint32_t t, uint32_t z, uint32_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#endif - - -// Field operations. - -#if defined(BORINGSSL_CURVE25519_64BIT) - -#define assert_fe(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 5; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 1.125*(UINT64_C(1)<<51)); \ - } \ -} while (0) - -#define assert_fe_loose(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 5; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 3.375*(UINT64_C(1)<<51)); \ - } \ -} while (0) - -#define assert_fe_frozen(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 5; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < (UINT64_C(1)<<51)); \ - } \ -} while (0) - -static void fe_frombytes_impl(uint64_t h[5], const uint8_t *s) { - // Ignores top bit of s. - uint64_t a0 = load_8(s); - uint64_t a1 = load_8(s+8); - uint64_t a2 = load_8(s+16); - uint64_t a3 = load_8(s+24); - // Use 51 bits, 64-51 = 13 left. - h[0] = a0 & ((UINT64_C(1) << 51) - 1); - // (64-51) + 38 = 13 + 38 = 51 - h[1] = (a0 >> 51) | ((a1 & ((UINT64_C(1) << 38) - 1)) << 13); - // (64-38) + 25 = 26 + 25 = 51 - h[2] = (a1 >> 38) | ((a2 & ((UINT64_C(1) << 25) - 1)) << 26); - // (64-25) + 12 = 39 + 12 = 51 - h[3] = (a2 >> 25) | ((a3 & ((UINT64_C(1) << 12) - 1)) << 39); - // (64-12) = 52, ignore top bit - h[4] = (a3 >> 12) & ((UINT64_C(1) << 51) - 1); - assert_fe(h); -} - -static void fe_frombytes(fe *h, const uint8_t *s) { - fe_frombytes_impl(h->v, s); -} - -static void fe_freeze(uint64_t out[5], const uint64_t in1[5]) { - { const uint64_t x7 = in1[4]; - { const uint64_t x8 = in1[3]; - { const uint64_t x6 = in1[2]; - { const uint64_t x4 = in1[1]; - { const uint64_t x2 = in1[0]; - { uint64_t x10; uint8_t/*bool*/ x11 = subborrow_u51(0x0, x2, 0x7ffffffffffed, &x10); - { uint64_t x13; uint8_t/*bool*/ x14 = subborrow_u51(x11, x4, 0x7ffffffffffff, &x13); - { uint64_t x16; uint8_t/*bool*/ x17 = subborrow_u51(x14, x6, 0x7ffffffffffff, &x16); - { uint64_t x19; uint8_t/*bool*/ x20 = subborrow_u51(x17, x8, 0x7ffffffffffff, &x19); - { uint64_t x22; uint8_t/*bool*/ x23 = subborrow_u51(x20, x7, 0x7ffffffffffff, &x22); - { uint64_t x24 = cmovznz64(x23, 0x0, 0xffffffffffffffffL); - { uint64_t x25 = (x24 & 0x7ffffffffffed); - { uint64_t x27; uint8_t/*bool*/ x28 = addcarryx_u51(0x0, x10, x25, &x27); - { uint64_t x29 = (x24 & 0x7ffffffffffff); - { uint64_t x31; uint8_t/*bool*/ x32 = addcarryx_u51(x28, x13, x29, &x31); - { uint64_t x33 = (x24 & 0x7ffffffffffff); - { uint64_t x35; uint8_t/*bool*/ x36 = addcarryx_u51(x32, x16, x33, &x35); - { uint64_t x37 = (x24 & 0x7ffffffffffff); - { uint64_t x39; uint8_t/*bool*/ x40 = addcarryx_u51(x36, x19, x37, &x39); - { uint64_t x41 = (x24 & 0x7ffffffffffff); - { uint64_t x43; addcarryx_u51(x40, x22, x41, &x43); - out[0] = x27; - out[1] = x31; - out[2] = x35; - out[3] = x39; - out[4] = x43; - }}}}}}}}}}}}}}}}}}}}} -} - -static void fe_tobytes(uint8_t s[32], const fe *f) { - assert_fe(f->v); - uint64_t h[5]; - fe_freeze(h, f->v); - assert_fe_frozen(h); - - s[0] = h[0] >> 0; - s[1] = h[0] >> 8; - s[2] = h[0] >> 16; - s[3] = h[0] >> 24; - s[4] = h[0] >> 32; - s[5] = h[0] >> 40; - s[6] = (h[0] >> 48) | (h[1] << 3); - s[7] = h[1] >> 5; - s[8] = h[1] >> 13; - s[9] = h[1] >> 21; - s[10] = h[1] >> 29; - s[11] = h[1] >> 37; - s[12] = (h[1] >> 45) | (h[2] << 6); - s[13] = h[2] >> 2; - s[14] = h[2] >> 10; - s[15] = h[2] >> 18; - s[16] = h[2] >> 26; - s[17] = h[2] >> 34; - s[18] = h[2] >> 42; - s[19] = (h[2] >> 50) | (h[3] << 1); - s[20] = h[3] >> 7; - s[21] = h[3] >> 15; - s[22] = h[3] >> 23; - s[23] = h[3] >> 31; - s[24] = h[3] >> 39; - s[25] = (h[3] >> 47) | (h[4] << 4); - s[26] = h[4] >> 4; - s[27] = h[4] >> 12; - s[28] = h[4] >> 20; - s[29] = h[4] >> 28; - s[30] = h[4] >> 36; - s[31] = h[4] >> 44; -} - -// h = 0 -static void fe_0(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); -} - -static void fe_loose_0(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); -} - -// h = 1 -static void fe_1(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); - h->v[0] = 1; -} - -static void fe_loose_1(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); - h->v[0] = 1; -} - -static void fe_add_impl(uint64_t out[5], const uint64_t in1[5], const uint64_t in2[5]) { - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - out[0] = (x5 + x13); - out[1] = (x7 + x15); - out[2] = (x9 + x17); - out[3] = (x11 + x19); - out[4] = (x10 + x18); - }}}}}}}}}} -} - -// h = f + g -// Can overlap h with f or g. -static void fe_add(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_add_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_sub_impl(uint64_t out[5], const uint64_t in1[5], const uint64_t in2[5]) { - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - out[0] = ((0xfffffffffffda + x5) - x13); - out[1] = ((0xffffffffffffe + x7) - x15); - out[2] = ((0xffffffffffffe + x9) - x17); - out[3] = ((0xffffffffffffe + x11) - x19); - out[4] = ((0xffffffffffffe + x10) - x18); - }}}}}}}}}} -} - -// h = f - g -// Can overlap h with f or g. -static void fe_sub(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_sub_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_carry_impl(uint64_t out[5], const uint64_t in1[5]) { - { const uint64_t x7 = in1[4]; - { const uint64_t x8 = in1[3]; - { const uint64_t x6 = in1[2]; - { const uint64_t x4 = in1[1]; - { const uint64_t x2 = in1[0]; - { uint64_t x9 = (x2 >> 0x33); - { uint64_t x10 = (x2 & 0x7ffffffffffff); - { uint64_t x11 = (x9 + x4); - { uint64_t x12 = (x11 >> 0x33); - { uint64_t x13 = (x11 & 0x7ffffffffffff); - { uint64_t x14 = (x12 + x6); - { uint64_t x15 = (x14 >> 0x33); - { uint64_t x16 = (x14 & 0x7ffffffffffff); - { uint64_t x17 = (x15 + x8); - { uint64_t x18 = (x17 >> 0x33); - { uint64_t x19 = (x17 & 0x7ffffffffffff); - { uint64_t x20 = (x18 + x7); - { uint64_t x21 = (x20 >> 0x33); - { uint64_t x22 = (x20 & 0x7ffffffffffff); - { uint64_t x23 = (x10 + (0x13 * x21)); - { uint64_t x24 = (x23 >> 0x33); - { uint64_t x25 = (x23 & 0x7ffffffffffff); - { uint64_t x26 = (x24 + x13); - { uint64_t x27 = (x26 >> 0x33); - { uint64_t x28 = (x26 & 0x7ffffffffffff); - out[0] = x25; - out[1] = x28; - out[2] = (x27 + x16); - out[3] = x19; - out[4] = x22; - }}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_carry(fe *h, const fe_loose* f) { - assert_fe_loose(f->v); - fe_carry_impl(h->v, f->v); - assert_fe(h->v); -} - -static void fe_mul_impl(uint64_t out[5], const uint64_t in1[5], const uint64_t in2[5]) { - assert_fe_loose(in1); - assert_fe_loose(in2); - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - { uint128_t x20 = ((uint128_t)x5 * x13); - { uint128_t x21 = (((uint128_t)x5 * x15) + ((uint128_t)x7 * x13)); - { uint128_t x22 = ((((uint128_t)x5 * x17) + ((uint128_t)x9 * x13)) + ((uint128_t)x7 * x15)); - { uint128_t x23 = (((((uint128_t)x5 * x19) + ((uint128_t)x11 * x13)) + ((uint128_t)x7 * x17)) + ((uint128_t)x9 * x15)); - { uint128_t x24 = ((((((uint128_t)x5 * x18) + ((uint128_t)x10 * x13)) + ((uint128_t)x11 * x15)) + ((uint128_t)x7 * x19)) + ((uint128_t)x9 * x17)); - { uint64_t x25 = (x10 * 0x13); - { uint64_t x26 = (x7 * 0x13); - { uint64_t x27 = (x9 * 0x13); - { uint64_t x28 = (x11 * 0x13); - { uint128_t x29 = ((((x20 + ((uint128_t)x25 * x15)) + ((uint128_t)x26 * x18)) + ((uint128_t)x27 * x19)) + ((uint128_t)x28 * x17)); - { uint128_t x30 = (((x21 + ((uint128_t)x25 * x17)) + ((uint128_t)x27 * x18)) + ((uint128_t)x28 * x19)); - { uint128_t x31 = ((x22 + ((uint128_t)x25 * x19)) + ((uint128_t)x28 * x18)); - { uint128_t x32 = (x23 + ((uint128_t)x25 * x18)); - { uint64_t x33 = (uint64_t) (x29 >> 0x33); - { uint64_t x34 = ((uint64_t)x29 & 0x7ffffffffffff); - { uint128_t x35 = (x33 + x30); - { uint64_t x36 = (uint64_t) (x35 >> 0x33); - { uint64_t x37 = ((uint64_t)x35 & 0x7ffffffffffff); - { uint128_t x38 = (x36 + x31); - { uint64_t x39 = (uint64_t) (x38 >> 0x33); - { uint64_t x40 = ((uint64_t)x38 & 0x7ffffffffffff); - { uint128_t x41 = (x39 + x32); - { uint64_t x42 = (uint64_t) (x41 >> 0x33); - { uint64_t x43 = ((uint64_t)x41 & 0x7ffffffffffff); - { uint128_t x44 = (x42 + x24); - { uint64_t x45 = (uint64_t) (x44 >> 0x33); - { uint64_t x46 = ((uint64_t)x44 & 0x7ffffffffffff); - { uint64_t x47 = (x34 + (0x13 * x45)); - { uint64_t x48 = (x47 >> 0x33); - { uint64_t x49 = (x47 & 0x7ffffffffffff); - { uint64_t x50 = (x48 + x37); - { uint64_t x51 = (x50 >> 0x33); - { uint64_t x52 = (x50 & 0x7ffffffffffff); - out[0] = x49; - out[1] = x52; - out[2] = (x51 + x40); - out[3] = x43; - out[4] = x46; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_mul_ltt(fe_loose *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_llt(fe_loose *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttt(fe *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tlt(fe *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttl(fe *h, const fe *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tll(fe *h, const fe_loose *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_sqr_impl(uint64_t out[5], const uint64_t in1[5]) { - assert_fe_loose(in1); - { const uint64_t x7 = in1[4]; - { const uint64_t x8 = in1[3]; - { const uint64_t x6 = in1[2]; - { const uint64_t x4 = in1[1]; - { const uint64_t x2 = in1[0]; - { uint64_t x9 = (x2 * 0x2); - { uint64_t x10 = (x4 * 0x2); - { uint64_t x11 = ((x6 * 0x2) * 0x13); - { uint64_t x12 = (x7 * 0x13); - { uint64_t x13 = (x12 * 0x2); - { uint128_t x14 = ((((uint128_t)x2 * x2) + ((uint128_t)x13 * x4)) + ((uint128_t)x11 * x8)); - { uint128_t x15 = ((((uint128_t)x9 * x4) + ((uint128_t)x13 * x6)) + ((uint128_t)x8 * (x8 * 0x13))); - { uint128_t x16 = ((((uint128_t)x9 * x6) + ((uint128_t)x4 * x4)) + ((uint128_t)x13 * x8)); - { uint128_t x17 = ((((uint128_t)x9 * x8) + ((uint128_t)x10 * x6)) + ((uint128_t)x7 * x12)); - { uint128_t x18 = ((((uint128_t)x9 * x7) + ((uint128_t)x10 * x8)) + ((uint128_t)x6 * x6)); - { uint64_t x19 = (uint64_t) (x14 >> 0x33); - { uint64_t x20 = ((uint64_t)x14 & 0x7ffffffffffff); - { uint128_t x21 = (x19 + x15); - { uint64_t x22 = (uint64_t) (x21 >> 0x33); - { uint64_t x23 = ((uint64_t)x21 & 0x7ffffffffffff); - { uint128_t x24 = (x22 + x16); - { uint64_t x25 = (uint64_t) (x24 >> 0x33); - { uint64_t x26 = ((uint64_t)x24 & 0x7ffffffffffff); - { uint128_t x27 = (x25 + x17); - { uint64_t x28 = (uint64_t) (x27 >> 0x33); - { uint64_t x29 = ((uint64_t)x27 & 0x7ffffffffffff); - { uint128_t x30 = (x28 + x18); - { uint64_t x31 = (uint64_t) (x30 >> 0x33); - { uint64_t x32 = ((uint64_t)x30 & 0x7ffffffffffff); - { uint64_t x33 = (x20 + (0x13 * x31)); - { uint64_t x34 = (x33 >> 0x33); - { uint64_t x35 = (x33 & 0x7ffffffffffff); - { uint64_t x36 = (x34 + x23); - { uint64_t x37 = (x36 >> 0x33); - { uint64_t x38 = (x36 & 0x7ffffffffffff); - out[0] = x35; - out[1] = x38; - out[2] = (x37 + x26); - out[3] = x29; - out[4] = x32; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_sq_tl(fe *h, const fe_loose *f) { - fe_sqr_impl(h->v, f->v); -} - -static void fe_sq_tt(fe *h, const fe *f) { - fe_sqr_impl(h->v, f->v); -} - -// Replace (f,g) with (g,f) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cswap(fe *f, fe *g, uint64_t b) { - b = 0-b; - for (unsigned i = 0; i < 5; i++) { - uint64_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - g->v[i] ^= x; - } -} - -// NOTE: based on fiat-crypto fe_mul, edited for in2=121666, 0, 0.. -static void fe_mul_121666_impl(uint64_t out[5], const uint64_t in1[5]) { - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = 0; - { const uint64_t x19 = 0; - { const uint64_t x17 = 0; - { const uint64_t x15 = 0; - { const uint64_t x13 = 121666; - { uint128_t x20 = ((uint128_t)x5 * x13); - { uint128_t x21 = (((uint128_t)x5 * x15) + ((uint128_t)x7 * x13)); - { uint128_t x22 = ((((uint128_t)x5 * x17) + ((uint128_t)x9 * x13)) + ((uint128_t)x7 * x15)); - { uint128_t x23 = (((((uint128_t)x5 * x19) + ((uint128_t)x11 * x13)) + ((uint128_t)x7 * x17)) + ((uint128_t)x9 * x15)); - { uint128_t x24 = ((((((uint128_t)x5 * x18) + ((uint128_t)x10 * x13)) + ((uint128_t)x11 * x15)) + ((uint128_t)x7 * x19)) + ((uint128_t)x9 * x17)); - { uint64_t x25 = (x10 * 0x13); - { uint64_t x26 = (x7 * 0x13); - { uint64_t x27 = (x9 * 0x13); - { uint64_t x28 = (x11 * 0x13); - { uint128_t x29 = ((((x20 + ((uint128_t)x25 * x15)) + ((uint128_t)x26 * x18)) + ((uint128_t)x27 * x19)) + ((uint128_t)x28 * x17)); - { uint128_t x30 = (((x21 + ((uint128_t)x25 * x17)) + ((uint128_t)x27 * x18)) + ((uint128_t)x28 * x19)); - { uint128_t x31 = ((x22 + ((uint128_t)x25 * x19)) + ((uint128_t)x28 * x18)); - { uint128_t x32 = (x23 + ((uint128_t)x25 * x18)); - { uint64_t x33 = (uint64_t) (x29 >> 0x33); - { uint64_t x34 = ((uint64_t)x29 & 0x7ffffffffffff); - { uint128_t x35 = (x33 + x30); - { uint64_t x36 = (uint64_t) (x35 >> 0x33); - { uint64_t x37 = ((uint64_t)x35 & 0x7ffffffffffff); - { uint128_t x38 = (x36 + x31); - { uint64_t x39 = (uint64_t) (x38 >> 0x33); - { uint64_t x40 = ((uint64_t)x38 & 0x7ffffffffffff); - { uint128_t x41 = (x39 + x32); - { uint64_t x42 = (uint64_t) (x41 >> 0x33); - { uint64_t x43 = ((uint64_t)x41 & 0x7ffffffffffff); - { uint128_t x44 = (x42 + x24); - { uint64_t x45 = (uint64_t) (x44 >> 0x33); - { uint64_t x46 = ((uint64_t)x44 & 0x7ffffffffffff); - { uint64_t x47 = (x34 + (0x13 * x45)); - { uint64_t x48 = (x47 >> 0x33); - { uint64_t x49 = (x47 & 0x7ffffffffffff); - { uint64_t x50 = (x48 + x37); - { uint64_t x51 = (x50 >> 0x33); - { uint64_t x52 = (x50 & 0x7ffffffffffff); - out[0] = x49; - out[1] = x52; - out[2] = (x51 + x40); - out[3] = x43; - out[4] = x46; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_mul121666(fe *h, const fe_loose *f) { - assert_fe_loose(f->v); - fe_mul_121666_impl(h->v, f->v); - assert_fe(h->v); -} - -// Adapted from Fiat-synthesized |fe_sub_impl| with |out| = 0. -static void fe_neg_impl(uint64_t out[5], const uint64_t in2[5]) { - { const uint64_t x10 = 0; - { const uint64_t x11 = 0; - { const uint64_t x9 = 0; - { const uint64_t x7 = 0; - { const uint64_t x5 = 0; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - out[0] = ((0xfffffffffffda + x5) - x13); - out[1] = ((0xffffffffffffe + x7) - x15); - out[2] = ((0xffffffffffffe + x9) - x17); - out[3] = ((0xffffffffffffe + x11) - x19); - out[4] = ((0xffffffffffffe + x10) - x18); - }}}}}}}}}} -} - -// h = -f -static void fe_neg(fe_loose *h, const fe *f) { - assert_fe(f->v); - fe_neg_impl(h->v, f->v); - assert_fe_loose(h->v); -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cmov(fe_loose *f, const fe_loose *g, uint64_t b) { - b = 0-b; - for (unsigned i = 0; i < 5; i++) { - uint64_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - } -} - -#else - -#define assert_fe(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 10; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 1.125*(1<<(26-(_assert_fe_i&1)))); \ - } \ -} while (0) - -#define assert_fe_loose(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 10; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 3.375*(1<<(26-(_assert_fe_i&1)))); \ - } \ -} while (0) - -#define assert_fe_frozen(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 10; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < (1u<<(26-(_assert_fe_i&1)))); \ - } \ -} while (0) - -static void fe_frombytes_impl(uint32_t h[10], const uint8_t *s) { - // Ignores top bit of s. - uint32_t a0 = load_4(s); - uint32_t a1 = load_4(s+4); - uint32_t a2 = load_4(s+8); - uint32_t a3 = load_4(s+12); - uint32_t a4 = load_4(s+16); - uint32_t a5 = load_4(s+20); - uint32_t a6 = load_4(s+24); - uint32_t a7 = load_4(s+28); - h[0] = a0&((1<<26)-1); // 26 used, 32-26 left. 26 - h[1] = (a0>>26) | ((a1&((1<<19)-1))<< 6); // (32-26) + 19 = 6+19 = 25 - h[2] = (a1>>19) | ((a2&((1<<13)-1))<<13); // (32-19) + 13 = 13+13 = 26 - h[3] = (a2>>13) | ((a3&((1<< 6)-1))<<19); // (32-13) + 6 = 19+ 6 = 25 - h[4] = (a3>> 6); // (32- 6) = 26 - h[5] = a4&((1<<25)-1); // 25 - h[6] = (a4>>25) | ((a5&((1<<19)-1))<< 7); // (32-25) + 19 = 7+19 = 26 - h[7] = (a5>>19) | ((a6&((1<<12)-1))<<13); // (32-19) + 12 = 13+12 = 25 - h[8] = (a6>>12) | ((a7&((1<< 6)-1))<<20); // (32-12) + 6 = 20+ 6 = 26 - h[9] = (a7>> 6)&((1<<25)-1); // 25 - assert_fe(h); -} - -static void fe_frombytes(fe *h, const uint8_t *s) { - fe_frombytes_impl(h->v, s); -} - -static void fe_freeze(uint32_t out[10], const uint32_t in1[10]) { - { const uint32_t x17 = in1[9]; - { const uint32_t x18 = in1[8]; - { const uint32_t x16 = in1[7]; - { const uint32_t x14 = in1[6]; - { const uint32_t x12 = in1[5]; - { const uint32_t x10 = in1[4]; - { const uint32_t x8 = in1[3]; - { const uint32_t x6 = in1[2]; - { const uint32_t x4 = in1[1]; - { const uint32_t x2 = in1[0]; - { uint32_t x20; uint8_t/*bool*/ x21 = subborrow_u26(0x0, x2, 0x3ffffed, &x20); - { uint32_t x23; uint8_t/*bool*/ x24 = subborrow_u25(x21, x4, 0x1ffffff, &x23); - { uint32_t x26; uint8_t/*bool*/ x27 = subborrow_u26(x24, x6, 0x3ffffff, &x26); - { uint32_t x29; uint8_t/*bool*/ x30 = subborrow_u25(x27, x8, 0x1ffffff, &x29); - { uint32_t x32; uint8_t/*bool*/ x33 = subborrow_u26(x30, x10, 0x3ffffff, &x32); - { uint32_t x35; uint8_t/*bool*/ x36 = subborrow_u25(x33, x12, 0x1ffffff, &x35); - { uint32_t x38; uint8_t/*bool*/ x39 = subborrow_u26(x36, x14, 0x3ffffff, &x38); - { uint32_t x41; uint8_t/*bool*/ x42 = subborrow_u25(x39, x16, 0x1ffffff, &x41); - { uint32_t x44; uint8_t/*bool*/ x45 = subborrow_u26(x42, x18, 0x3ffffff, &x44); - { uint32_t x47; uint8_t/*bool*/ x48 = subborrow_u25(x45, x17, 0x1ffffff, &x47); - { uint32_t x49 = cmovznz32(x48, 0x0, 0xffffffff); - { uint32_t x50 = (x49 & 0x3ffffed); - { uint32_t x52; uint8_t/*bool*/ x53 = addcarryx_u26(0x0, x20, x50, &x52); - { uint32_t x54 = (x49 & 0x1ffffff); - { uint32_t x56; uint8_t/*bool*/ x57 = addcarryx_u25(x53, x23, x54, &x56); - { uint32_t x58 = (x49 & 0x3ffffff); - { uint32_t x60; uint8_t/*bool*/ x61 = addcarryx_u26(x57, x26, x58, &x60); - { uint32_t x62 = (x49 & 0x1ffffff); - { uint32_t x64; uint8_t/*bool*/ x65 = addcarryx_u25(x61, x29, x62, &x64); - { uint32_t x66 = (x49 & 0x3ffffff); - { uint32_t x68; uint8_t/*bool*/ x69 = addcarryx_u26(x65, x32, x66, &x68); - { uint32_t x70 = (x49 & 0x1ffffff); - { uint32_t x72; uint8_t/*bool*/ x73 = addcarryx_u25(x69, x35, x70, &x72); - { uint32_t x74 = (x49 & 0x3ffffff); - { uint32_t x76; uint8_t/*bool*/ x77 = addcarryx_u26(x73, x38, x74, &x76); - { uint32_t x78 = (x49 & 0x1ffffff); - { uint32_t x80; uint8_t/*bool*/ x81 = addcarryx_u25(x77, x41, x78, &x80); - { uint32_t x82 = (x49 & 0x3ffffff); - { uint32_t x84; uint8_t/*bool*/ x85 = addcarryx_u26(x81, x44, x82, &x84); - { uint32_t x86 = (x49 & 0x1ffffff); - { uint32_t x88; addcarryx_u25(x85, x47, x86, &x88); - out[0] = x52; - out[1] = x56; - out[2] = x60; - out[3] = x64; - out[4] = x68; - out[5] = x72; - out[6] = x76; - out[7] = x80; - out[8] = x84; - out[9] = x88; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_tobytes(uint8_t s[32], const fe *f) { - assert_fe(f->v); - uint32_t h[10]; - fe_freeze(h, f->v); - assert_fe_frozen(h); - - s[0] = h[0] >> 0; - s[1] = h[0] >> 8; - s[2] = h[0] >> 16; - s[3] = (h[0] >> 24) | (h[1] << 2); - s[4] = h[1] >> 6; - s[5] = h[1] >> 14; - s[6] = (h[1] >> 22) | (h[2] << 3); - s[7] = h[2] >> 5; - s[8] = h[2] >> 13; - s[9] = (h[2] >> 21) | (h[3] << 5); - s[10] = h[3] >> 3; - s[11] = h[3] >> 11; - s[12] = (h[3] >> 19) | (h[4] << 6); - s[13] = h[4] >> 2; - s[14] = h[4] >> 10; - s[15] = h[4] >> 18; - s[16] = h[5] >> 0; - s[17] = h[5] >> 8; - s[18] = h[5] >> 16; - s[19] = (h[5] >> 24) | (h[6] << 1); - s[20] = h[6] >> 7; - s[21] = h[6] >> 15; - s[22] = (h[6] >> 23) | (h[7] << 3); - s[23] = h[7] >> 5; - s[24] = h[7] >> 13; - s[25] = (h[7] >> 21) | (h[8] << 4); - s[26] = h[8] >> 4; - s[27] = h[8] >> 12; - s[28] = (h[8] >> 20) | (h[9] << 6); - s[29] = h[9] >> 2; - s[30] = h[9] >> 10; - s[31] = h[9] >> 18; -} - -// h = 0 -static void fe_0(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); -} - -static void fe_loose_0(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); -} - -// h = 1 -static void fe_1(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); - h->v[0] = 1; -} - -static void fe_loose_1(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); - h->v[0] = 1; -} - -static void fe_add_impl(uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10]) { - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - out[0] = (x5 + x23); - out[1] = (x7 + x25); - out[2] = (x9 + x27); - out[3] = (x11 + x29); - out[4] = (x13 + x31); - out[5] = (x15 + x33); - out[6] = (x17 + x35); - out[7] = (x19 + x37); - out[8] = (x21 + x39); - out[9] = (x20 + x38); - }}}}}}}}}}}}}}}}}}}} -} - -// h = f + g -// Can overlap h with f or g. -static void fe_add(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_add_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_sub_impl(uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10]) { - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - out[0] = ((0x7ffffda + x5) - x23); - out[1] = ((0x3fffffe + x7) - x25); - out[2] = ((0x7fffffe + x9) - x27); - out[3] = ((0x3fffffe + x11) - x29); - out[4] = ((0x7fffffe + x13) - x31); - out[5] = ((0x3fffffe + x15) - x33); - out[6] = ((0x7fffffe + x17) - x35); - out[7] = ((0x3fffffe + x19) - x37); - out[8] = ((0x7fffffe + x21) - x39); - out[9] = ((0x3fffffe + x20) - x38); - }}}}}}}}}}}}}}}}}}}} -} - -// h = f - g -// Can overlap h with f or g. -static void fe_sub(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_sub_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_carry_impl(uint32_t out[10], const uint32_t in1[10]) { - { const uint32_t x17 = in1[9]; - { const uint32_t x18 = in1[8]; - { const uint32_t x16 = in1[7]; - { const uint32_t x14 = in1[6]; - { const uint32_t x12 = in1[5]; - { const uint32_t x10 = in1[4]; - { const uint32_t x8 = in1[3]; - { const uint32_t x6 = in1[2]; - { const uint32_t x4 = in1[1]; - { const uint32_t x2 = in1[0]; - { uint32_t x19 = (x2 >> 0x1a); - { uint32_t x20 = (x2 & 0x3ffffff); - { uint32_t x21 = (x19 + x4); - { uint32_t x22 = (x21 >> 0x19); - { uint32_t x23 = (x21 & 0x1ffffff); - { uint32_t x24 = (x22 + x6); - { uint32_t x25 = (x24 >> 0x1a); - { uint32_t x26 = (x24 & 0x3ffffff); - { uint32_t x27 = (x25 + x8); - { uint32_t x28 = (x27 >> 0x19); - { uint32_t x29 = (x27 & 0x1ffffff); - { uint32_t x30 = (x28 + x10); - { uint32_t x31 = (x30 >> 0x1a); - { uint32_t x32 = (x30 & 0x3ffffff); - { uint32_t x33 = (x31 + x12); - { uint32_t x34 = (x33 >> 0x19); - { uint32_t x35 = (x33 & 0x1ffffff); - { uint32_t x36 = (x34 + x14); - { uint32_t x37 = (x36 >> 0x1a); - { uint32_t x38 = (x36 & 0x3ffffff); - { uint32_t x39 = (x37 + x16); - { uint32_t x40 = (x39 >> 0x19); - { uint32_t x41 = (x39 & 0x1ffffff); - { uint32_t x42 = (x40 + x18); - { uint32_t x43 = (x42 >> 0x1a); - { uint32_t x44 = (x42 & 0x3ffffff); - { uint32_t x45 = (x43 + x17); - { uint32_t x46 = (x45 >> 0x19); - { uint32_t x47 = (x45 & 0x1ffffff); - { uint32_t x48 = (x20 + (0x13 * x46)); - { uint32_t x49 = (x48 >> 0x1a); - { uint32_t x50 = (x48 & 0x3ffffff); - { uint32_t x51 = (x49 + x23); - { uint32_t x52 = (x51 >> 0x19); - { uint32_t x53 = (x51 & 0x1ffffff); - out[0] = x50; - out[1] = x53; - out[2] = (x52 + x26); - out[3] = x29; - out[4] = x32; - out[5] = x35; - out[6] = x38; - out[7] = x41; - out[8] = x44; - out[9] = x47; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_carry(fe *h, const fe_loose* f) { - assert_fe_loose(f->v); - fe_carry_impl(h->v, f->v); - assert_fe(h->v); -} - -static void fe_mul_impl(uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10]) { - assert_fe_loose(in1); - assert_fe_loose(in2); - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - { uint64_t x40 = ((uint64_t)x23 * x5); - { uint64_t x41 = (((uint64_t)x23 * x7) + ((uint64_t)x25 * x5)); - { uint64_t x42 = ((((uint64_t)(0x2 * x25) * x7) + ((uint64_t)x23 * x9)) + ((uint64_t)x27 * x5)); - { uint64_t x43 = (((((uint64_t)x25 * x9) + ((uint64_t)x27 * x7)) + ((uint64_t)x23 * x11)) + ((uint64_t)x29 * x5)); - { uint64_t x44 = (((((uint64_t)x27 * x9) + (0x2 * (((uint64_t)x25 * x11) + ((uint64_t)x29 * x7)))) + ((uint64_t)x23 * x13)) + ((uint64_t)x31 * x5)); - { uint64_t x45 = (((((((uint64_t)x27 * x11) + ((uint64_t)x29 * x9)) + ((uint64_t)x25 * x13)) + ((uint64_t)x31 * x7)) + ((uint64_t)x23 * x15)) + ((uint64_t)x33 * x5)); - { uint64_t x46 = (((((0x2 * ((((uint64_t)x29 * x11) + ((uint64_t)x25 * x15)) + ((uint64_t)x33 * x7))) + ((uint64_t)x27 * x13)) + ((uint64_t)x31 * x9)) + ((uint64_t)x23 * x17)) + ((uint64_t)x35 * x5)); - { uint64_t x47 = (((((((((uint64_t)x29 * x13) + ((uint64_t)x31 * x11)) + ((uint64_t)x27 * x15)) + ((uint64_t)x33 * x9)) + ((uint64_t)x25 * x17)) + ((uint64_t)x35 * x7)) + ((uint64_t)x23 * x19)) + ((uint64_t)x37 * x5)); - { uint64_t x48 = (((((((uint64_t)x31 * x13) + (0x2 * (((((uint64_t)x29 * x15) + ((uint64_t)x33 * x11)) + ((uint64_t)x25 * x19)) + ((uint64_t)x37 * x7)))) + ((uint64_t)x27 * x17)) + ((uint64_t)x35 * x9)) + ((uint64_t)x23 * x21)) + ((uint64_t)x39 * x5)); - { uint64_t x49 = (((((((((((uint64_t)x31 * x15) + ((uint64_t)x33 * x13)) + ((uint64_t)x29 * x17)) + ((uint64_t)x35 * x11)) + ((uint64_t)x27 * x19)) + ((uint64_t)x37 * x9)) + ((uint64_t)x25 * x21)) + ((uint64_t)x39 * x7)) + ((uint64_t)x23 * x20)) + ((uint64_t)x38 * x5)); - { uint64_t x50 = (((((0x2 * ((((((uint64_t)x33 * x15) + ((uint64_t)x29 * x19)) + ((uint64_t)x37 * x11)) + ((uint64_t)x25 * x20)) + ((uint64_t)x38 * x7))) + ((uint64_t)x31 * x17)) + ((uint64_t)x35 * x13)) + ((uint64_t)x27 * x21)) + ((uint64_t)x39 * x9)); - { uint64_t x51 = (((((((((uint64_t)x33 * x17) + ((uint64_t)x35 * x15)) + ((uint64_t)x31 * x19)) + ((uint64_t)x37 * x13)) + ((uint64_t)x29 * x21)) + ((uint64_t)x39 * x11)) + ((uint64_t)x27 * x20)) + ((uint64_t)x38 * x9)); - { uint64_t x52 = (((((uint64_t)x35 * x17) + (0x2 * (((((uint64_t)x33 * x19) + ((uint64_t)x37 * x15)) + ((uint64_t)x29 * x20)) + ((uint64_t)x38 * x11)))) + ((uint64_t)x31 * x21)) + ((uint64_t)x39 * x13)); - { uint64_t x53 = (((((((uint64_t)x35 * x19) + ((uint64_t)x37 * x17)) + ((uint64_t)x33 * x21)) + ((uint64_t)x39 * x15)) + ((uint64_t)x31 * x20)) + ((uint64_t)x38 * x13)); - { uint64_t x54 = (((0x2 * ((((uint64_t)x37 * x19) + ((uint64_t)x33 * x20)) + ((uint64_t)x38 * x15))) + ((uint64_t)x35 * x21)) + ((uint64_t)x39 * x17)); - { uint64_t x55 = (((((uint64_t)x37 * x21) + ((uint64_t)x39 * x19)) + ((uint64_t)x35 * x20)) + ((uint64_t)x38 * x17)); - { uint64_t x56 = (((uint64_t)x39 * x21) + (0x2 * (((uint64_t)x37 * x20) + ((uint64_t)x38 * x19)))); - { uint64_t x57 = (((uint64_t)x39 * x20) + ((uint64_t)x38 * x21)); - { uint64_t x58 = ((uint64_t)(0x2 * x38) * x20); - { uint64_t x59 = (x48 + (x58 << 0x4)); - { uint64_t x60 = (x59 + (x58 << 0x1)); - { uint64_t x61 = (x60 + x58); - { uint64_t x62 = (x47 + (x57 << 0x4)); - { uint64_t x63 = (x62 + (x57 << 0x1)); - { uint64_t x64 = (x63 + x57); - { uint64_t x65 = (x46 + (x56 << 0x4)); - { uint64_t x66 = (x65 + (x56 << 0x1)); - { uint64_t x67 = (x66 + x56); - { uint64_t x68 = (x45 + (x55 << 0x4)); - { uint64_t x69 = (x68 + (x55 << 0x1)); - { uint64_t x70 = (x69 + x55); - { uint64_t x71 = (x44 + (x54 << 0x4)); - { uint64_t x72 = (x71 + (x54 << 0x1)); - { uint64_t x73 = (x72 + x54); - { uint64_t x74 = (x43 + (x53 << 0x4)); - { uint64_t x75 = (x74 + (x53 << 0x1)); - { uint64_t x76 = (x75 + x53); - { uint64_t x77 = (x42 + (x52 << 0x4)); - { uint64_t x78 = (x77 + (x52 << 0x1)); - { uint64_t x79 = (x78 + x52); - { uint64_t x80 = (x41 + (x51 << 0x4)); - { uint64_t x81 = (x80 + (x51 << 0x1)); - { uint64_t x82 = (x81 + x51); - { uint64_t x83 = (x40 + (x50 << 0x4)); - { uint64_t x84 = (x83 + (x50 << 0x1)); - { uint64_t x85 = (x84 + x50); - { uint64_t x86 = (x85 >> 0x1a); - { uint32_t x87 = ((uint32_t)x85 & 0x3ffffff); - { uint64_t x88 = (x86 + x82); - { uint64_t x89 = (x88 >> 0x19); - { uint32_t x90 = ((uint32_t)x88 & 0x1ffffff); - { uint64_t x91 = (x89 + x79); - { uint64_t x92 = (x91 >> 0x1a); - { uint32_t x93 = ((uint32_t)x91 & 0x3ffffff); - { uint64_t x94 = (x92 + x76); - { uint64_t x95 = (x94 >> 0x19); - { uint32_t x96 = ((uint32_t)x94 & 0x1ffffff); - { uint64_t x97 = (x95 + x73); - { uint64_t x98 = (x97 >> 0x1a); - { uint32_t x99 = ((uint32_t)x97 & 0x3ffffff); - { uint64_t x100 = (x98 + x70); - { uint64_t x101 = (x100 >> 0x19); - { uint32_t x102 = ((uint32_t)x100 & 0x1ffffff); - { uint64_t x103 = (x101 + x67); - { uint64_t x104 = (x103 >> 0x1a); - { uint32_t x105 = ((uint32_t)x103 & 0x3ffffff); - { uint64_t x106 = (x104 + x64); - { uint64_t x107 = (x106 >> 0x19); - { uint32_t x108 = ((uint32_t)x106 & 0x1ffffff); - { uint64_t x109 = (x107 + x61); - { uint64_t x110 = (x109 >> 0x1a); - { uint32_t x111 = ((uint32_t)x109 & 0x3ffffff); - { uint64_t x112 = (x110 + x49); - { uint64_t x113 = (x112 >> 0x19); - { uint32_t x114 = ((uint32_t)x112 & 0x1ffffff); - { uint64_t x115 = (x87 + (0x13 * x113)); - { uint32_t x116 = (uint32_t) (x115 >> 0x1a); - { uint32_t x117 = ((uint32_t)x115 & 0x3ffffff); - { uint32_t x118 = (x116 + x90); - { uint32_t x119 = (x118 >> 0x19); - { uint32_t x120 = (x118 & 0x1ffffff); - out[0] = x117; - out[1] = x120; - out[2] = (x119 + x93); - out[3] = x96; - out[4] = x99; - out[5] = x102; - out[6] = x105; - out[7] = x108; - out[8] = x111; - out[9] = x114; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_mul_ltt(fe_loose *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_llt(fe_loose *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttt(fe *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tlt(fe *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttl(fe *h, const fe *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tll(fe *h, const fe_loose *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_sqr_impl(uint32_t out[10], const uint32_t in1[10]) { - assert_fe_loose(in1); - { const uint32_t x17 = in1[9]; - { const uint32_t x18 = in1[8]; - { const uint32_t x16 = in1[7]; - { const uint32_t x14 = in1[6]; - { const uint32_t x12 = in1[5]; - { const uint32_t x10 = in1[4]; - { const uint32_t x8 = in1[3]; - { const uint32_t x6 = in1[2]; - { const uint32_t x4 = in1[1]; - { const uint32_t x2 = in1[0]; - { uint64_t x19 = ((uint64_t)x2 * x2); - { uint64_t x20 = ((uint64_t)(0x2 * x2) * x4); - { uint64_t x21 = (0x2 * (((uint64_t)x4 * x4) + ((uint64_t)x2 * x6))); - { uint64_t x22 = (0x2 * (((uint64_t)x4 * x6) + ((uint64_t)x2 * x8))); - { uint64_t x23 = ((((uint64_t)x6 * x6) + ((uint64_t)(0x4 * x4) * x8)) + ((uint64_t)(0x2 * x2) * x10)); - { uint64_t x24 = (0x2 * ((((uint64_t)x6 * x8) + ((uint64_t)x4 * x10)) + ((uint64_t)x2 * x12))); - { uint64_t x25 = (0x2 * (((((uint64_t)x8 * x8) + ((uint64_t)x6 * x10)) + ((uint64_t)x2 * x14)) + ((uint64_t)(0x2 * x4) * x12))); - { uint64_t x26 = (0x2 * (((((uint64_t)x8 * x10) + ((uint64_t)x6 * x12)) + ((uint64_t)x4 * x14)) + ((uint64_t)x2 * x16))); - { uint64_t x27 = (((uint64_t)x10 * x10) + (0x2 * ((((uint64_t)x6 * x14) + ((uint64_t)x2 * x18)) + (0x2 * (((uint64_t)x4 * x16) + ((uint64_t)x8 * x12)))))); - { uint64_t x28 = (0x2 * ((((((uint64_t)x10 * x12) + ((uint64_t)x8 * x14)) + ((uint64_t)x6 * x16)) + ((uint64_t)x4 * x18)) + ((uint64_t)x2 * x17))); - { uint64_t x29 = (0x2 * (((((uint64_t)x12 * x12) + ((uint64_t)x10 * x14)) + ((uint64_t)x6 * x18)) + (0x2 * (((uint64_t)x8 * x16) + ((uint64_t)x4 * x17))))); - { uint64_t x30 = (0x2 * (((((uint64_t)x12 * x14) + ((uint64_t)x10 * x16)) + ((uint64_t)x8 * x18)) + ((uint64_t)x6 * x17))); - { uint64_t x31 = (((uint64_t)x14 * x14) + (0x2 * (((uint64_t)x10 * x18) + (0x2 * (((uint64_t)x12 * x16) + ((uint64_t)x8 * x17)))))); - { uint64_t x32 = (0x2 * ((((uint64_t)x14 * x16) + ((uint64_t)x12 * x18)) + ((uint64_t)x10 * x17))); - { uint64_t x33 = (0x2 * ((((uint64_t)x16 * x16) + ((uint64_t)x14 * x18)) + ((uint64_t)(0x2 * x12) * x17))); - { uint64_t x34 = (0x2 * (((uint64_t)x16 * x18) + ((uint64_t)x14 * x17))); - { uint64_t x35 = (((uint64_t)x18 * x18) + ((uint64_t)(0x4 * x16) * x17)); - { uint64_t x36 = ((uint64_t)(0x2 * x18) * x17); - { uint64_t x37 = ((uint64_t)(0x2 * x17) * x17); - { uint64_t x38 = (x27 + (x37 << 0x4)); - { uint64_t x39 = (x38 + (x37 << 0x1)); - { uint64_t x40 = (x39 + x37); - { uint64_t x41 = (x26 + (x36 << 0x4)); - { uint64_t x42 = (x41 + (x36 << 0x1)); - { uint64_t x43 = (x42 + x36); - { uint64_t x44 = (x25 + (x35 << 0x4)); - { uint64_t x45 = (x44 + (x35 << 0x1)); - { uint64_t x46 = (x45 + x35); - { uint64_t x47 = (x24 + (x34 << 0x4)); - { uint64_t x48 = (x47 + (x34 << 0x1)); - { uint64_t x49 = (x48 + x34); - { uint64_t x50 = (x23 + (x33 << 0x4)); - { uint64_t x51 = (x50 + (x33 << 0x1)); - { uint64_t x52 = (x51 + x33); - { uint64_t x53 = (x22 + (x32 << 0x4)); - { uint64_t x54 = (x53 + (x32 << 0x1)); - { uint64_t x55 = (x54 + x32); - { uint64_t x56 = (x21 + (x31 << 0x4)); - { uint64_t x57 = (x56 + (x31 << 0x1)); - { uint64_t x58 = (x57 + x31); - { uint64_t x59 = (x20 + (x30 << 0x4)); - { uint64_t x60 = (x59 + (x30 << 0x1)); - { uint64_t x61 = (x60 + x30); - { uint64_t x62 = (x19 + (x29 << 0x4)); - { uint64_t x63 = (x62 + (x29 << 0x1)); - { uint64_t x64 = (x63 + x29); - { uint64_t x65 = (x64 >> 0x1a); - { uint32_t x66 = ((uint32_t)x64 & 0x3ffffff); - { uint64_t x67 = (x65 + x61); - { uint64_t x68 = (x67 >> 0x19); - { uint32_t x69 = ((uint32_t)x67 & 0x1ffffff); - { uint64_t x70 = (x68 + x58); - { uint64_t x71 = (x70 >> 0x1a); - { uint32_t x72 = ((uint32_t)x70 & 0x3ffffff); - { uint64_t x73 = (x71 + x55); - { uint64_t x74 = (x73 >> 0x19); - { uint32_t x75 = ((uint32_t)x73 & 0x1ffffff); - { uint64_t x76 = (x74 + x52); - { uint64_t x77 = (x76 >> 0x1a); - { uint32_t x78 = ((uint32_t)x76 & 0x3ffffff); - { uint64_t x79 = (x77 + x49); - { uint64_t x80 = (x79 >> 0x19); - { uint32_t x81 = ((uint32_t)x79 & 0x1ffffff); - { uint64_t x82 = (x80 + x46); - { uint64_t x83 = (x82 >> 0x1a); - { uint32_t x84 = ((uint32_t)x82 & 0x3ffffff); - { uint64_t x85 = (x83 + x43); - { uint64_t x86 = (x85 >> 0x19); - { uint32_t x87 = ((uint32_t)x85 & 0x1ffffff); - { uint64_t x88 = (x86 + x40); - { uint64_t x89 = (x88 >> 0x1a); - { uint32_t x90 = ((uint32_t)x88 & 0x3ffffff); - { uint64_t x91 = (x89 + x28); - { uint64_t x92 = (x91 >> 0x19); - { uint32_t x93 = ((uint32_t)x91 & 0x1ffffff); - { uint64_t x94 = (x66 + (0x13 * x92)); - { uint32_t x95 = (uint32_t) (x94 >> 0x1a); - { uint32_t x96 = ((uint32_t)x94 & 0x3ffffff); - { uint32_t x97 = (x95 + x69); - { uint32_t x98 = (x97 >> 0x19); - { uint32_t x99 = (x97 & 0x1ffffff); - out[0] = x96; - out[1] = x99; - out[2] = (x98 + x72); - out[3] = x75; - out[4] = x78; - out[5] = x81; - out[6] = x84; - out[7] = x87; - out[8] = x90; - out[9] = x93; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_sq_tl(fe *h, const fe_loose *f) { - fe_sqr_impl(h->v, f->v); -} - -static void fe_sq_tt(fe *h, const fe *f) { - fe_sqr_impl(h->v, f->v); -} - -// Replace (f,g) with (g,f) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cswap(fe *f, fe *g, unsigned int b) { - b = 0-b; - unsigned i; - for (i = 0; i < 10; i++) { - uint32_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - g->v[i] ^= x; - } -} - -// NOTE: based on fiat-crypto fe_mul, edited for in2=121666, 0, 0.. -static void fe_mul_121666_impl(uint32_t out[10], const uint32_t in1[10]) { - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = 0; - { const uint32_t x39 = 0; - { const uint32_t x37 = 0; - { const uint32_t x35 = 0; - { const uint32_t x33 = 0; - { const uint32_t x31 = 0; - { const uint32_t x29 = 0; - { const uint32_t x27 = 0; - { const uint32_t x25 = 0; - { const uint32_t x23 = 121666; - { uint64_t x40 = ((uint64_t)x23 * x5); - { uint64_t x41 = (((uint64_t)x23 * x7) + ((uint64_t)x25 * x5)); - { uint64_t x42 = ((((uint64_t)(0x2 * x25) * x7) + ((uint64_t)x23 * x9)) + ((uint64_t)x27 * x5)); - { uint64_t x43 = (((((uint64_t)x25 * x9) + ((uint64_t)x27 * x7)) + ((uint64_t)x23 * x11)) + ((uint64_t)x29 * x5)); - { uint64_t x44 = (((((uint64_t)x27 * x9) + (0x2 * (((uint64_t)x25 * x11) + ((uint64_t)x29 * x7)))) + ((uint64_t)x23 * x13)) + ((uint64_t)x31 * x5)); - { uint64_t x45 = (((((((uint64_t)x27 * x11) + ((uint64_t)x29 * x9)) + ((uint64_t)x25 * x13)) + ((uint64_t)x31 * x7)) + ((uint64_t)x23 * x15)) + ((uint64_t)x33 * x5)); - { uint64_t x46 = (((((0x2 * ((((uint64_t)x29 * x11) + ((uint64_t)x25 * x15)) + ((uint64_t)x33 * x7))) + ((uint64_t)x27 * x13)) + ((uint64_t)x31 * x9)) + ((uint64_t)x23 * x17)) + ((uint64_t)x35 * x5)); - { uint64_t x47 = (((((((((uint64_t)x29 * x13) + ((uint64_t)x31 * x11)) + ((uint64_t)x27 * x15)) + ((uint64_t)x33 * x9)) + ((uint64_t)x25 * x17)) + ((uint64_t)x35 * x7)) + ((uint64_t)x23 * x19)) + ((uint64_t)x37 * x5)); - { uint64_t x48 = (((((((uint64_t)x31 * x13) + (0x2 * (((((uint64_t)x29 * x15) + ((uint64_t)x33 * x11)) + ((uint64_t)x25 * x19)) + ((uint64_t)x37 * x7)))) + ((uint64_t)x27 * x17)) + ((uint64_t)x35 * x9)) + ((uint64_t)x23 * x21)) + ((uint64_t)x39 * x5)); - { uint64_t x49 = (((((((((((uint64_t)x31 * x15) + ((uint64_t)x33 * x13)) + ((uint64_t)x29 * x17)) + ((uint64_t)x35 * x11)) + ((uint64_t)x27 * x19)) + ((uint64_t)x37 * x9)) + ((uint64_t)x25 * x21)) + ((uint64_t)x39 * x7)) + ((uint64_t)x23 * x20)) + ((uint64_t)x38 * x5)); - { uint64_t x50 = (((((0x2 * ((((((uint64_t)x33 * x15) + ((uint64_t)x29 * x19)) + ((uint64_t)x37 * x11)) + ((uint64_t)x25 * x20)) + ((uint64_t)x38 * x7))) + ((uint64_t)x31 * x17)) + ((uint64_t)x35 * x13)) + ((uint64_t)x27 * x21)) + ((uint64_t)x39 * x9)); - { uint64_t x51 = (((((((((uint64_t)x33 * x17) + ((uint64_t)x35 * x15)) + ((uint64_t)x31 * x19)) + ((uint64_t)x37 * x13)) + ((uint64_t)x29 * x21)) + ((uint64_t)x39 * x11)) + ((uint64_t)x27 * x20)) + ((uint64_t)x38 * x9)); - { uint64_t x52 = (((((uint64_t)x35 * x17) + (0x2 * (((((uint64_t)x33 * x19) + ((uint64_t)x37 * x15)) + ((uint64_t)x29 * x20)) + ((uint64_t)x38 * x11)))) + ((uint64_t)x31 * x21)) + ((uint64_t)x39 * x13)); - { uint64_t x53 = (((((((uint64_t)x35 * x19) + ((uint64_t)x37 * x17)) + ((uint64_t)x33 * x21)) + ((uint64_t)x39 * x15)) + ((uint64_t)x31 * x20)) + ((uint64_t)x38 * x13)); - { uint64_t x54 = (((0x2 * ((((uint64_t)x37 * x19) + ((uint64_t)x33 * x20)) + ((uint64_t)x38 * x15))) + ((uint64_t)x35 * x21)) + ((uint64_t)x39 * x17)); - { uint64_t x55 = (((((uint64_t)x37 * x21) + ((uint64_t)x39 * x19)) + ((uint64_t)x35 * x20)) + ((uint64_t)x38 * x17)); - { uint64_t x56 = (((uint64_t)x39 * x21) + (0x2 * (((uint64_t)x37 * x20) + ((uint64_t)x38 * x19)))); - { uint64_t x57 = (((uint64_t)x39 * x20) + ((uint64_t)x38 * x21)); - { uint64_t x58 = ((uint64_t)(0x2 * x38) * x20); - { uint64_t x59 = (x48 + (x58 << 0x4)); - { uint64_t x60 = (x59 + (x58 << 0x1)); - { uint64_t x61 = (x60 + x58); - { uint64_t x62 = (x47 + (x57 << 0x4)); - { uint64_t x63 = (x62 + (x57 << 0x1)); - { uint64_t x64 = (x63 + x57); - { uint64_t x65 = (x46 + (x56 << 0x4)); - { uint64_t x66 = (x65 + (x56 << 0x1)); - { uint64_t x67 = (x66 + x56); - { uint64_t x68 = (x45 + (x55 << 0x4)); - { uint64_t x69 = (x68 + (x55 << 0x1)); - { uint64_t x70 = (x69 + x55); - { uint64_t x71 = (x44 + (x54 << 0x4)); - { uint64_t x72 = (x71 + (x54 << 0x1)); - { uint64_t x73 = (x72 + x54); - { uint64_t x74 = (x43 + (x53 << 0x4)); - { uint64_t x75 = (x74 + (x53 << 0x1)); - { uint64_t x76 = (x75 + x53); - { uint64_t x77 = (x42 + (x52 << 0x4)); - { uint64_t x78 = (x77 + (x52 << 0x1)); - { uint64_t x79 = (x78 + x52); - { uint64_t x80 = (x41 + (x51 << 0x4)); - { uint64_t x81 = (x80 + (x51 << 0x1)); - { uint64_t x82 = (x81 + x51); - { uint64_t x83 = (x40 + (x50 << 0x4)); - { uint64_t x84 = (x83 + (x50 << 0x1)); - { uint64_t x85 = (x84 + x50); - { uint64_t x86 = (x85 >> 0x1a); - { uint32_t x87 = ((uint32_t)x85 & 0x3ffffff); - { uint64_t x88 = (x86 + x82); - { uint64_t x89 = (x88 >> 0x19); - { uint32_t x90 = ((uint32_t)x88 & 0x1ffffff); - { uint64_t x91 = (x89 + x79); - { uint64_t x92 = (x91 >> 0x1a); - { uint32_t x93 = ((uint32_t)x91 & 0x3ffffff); - { uint64_t x94 = (x92 + x76); - { uint64_t x95 = (x94 >> 0x19); - { uint32_t x96 = ((uint32_t)x94 & 0x1ffffff); - { uint64_t x97 = (x95 + x73); - { uint64_t x98 = (x97 >> 0x1a); - { uint32_t x99 = ((uint32_t)x97 & 0x3ffffff); - { uint64_t x100 = (x98 + x70); - { uint64_t x101 = (x100 >> 0x19); - { uint32_t x102 = ((uint32_t)x100 & 0x1ffffff); - { uint64_t x103 = (x101 + x67); - { uint64_t x104 = (x103 >> 0x1a); - { uint32_t x105 = ((uint32_t)x103 & 0x3ffffff); - { uint64_t x106 = (x104 + x64); - { uint64_t x107 = (x106 >> 0x19); - { uint32_t x108 = ((uint32_t)x106 & 0x1ffffff); - { uint64_t x109 = (x107 + x61); - { uint64_t x110 = (x109 >> 0x1a); - { uint32_t x111 = ((uint32_t)x109 & 0x3ffffff); - { uint64_t x112 = (x110 + x49); - { uint64_t x113 = (x112 >> 0x19); - { uint32_t x114 = ((uint32_t)x112 & 0x1ffffff); - { uint64_t x115 = (x87 + (0x13 * x113)); - { uint32_t x116 = (uint32_t) (x115 >> 0x1a); - { uint32_t x117 = ((uint32_t)x115 & 0x3ffffff); - { uint32_t x118 = (x116 + x90); - { uint32_t x119 = (x118 >> 0x19); - { uint32_t x120 = (x118 & 0x1ffffff); - out[0] = x117; - out[1] = x120; - out[2] = (x119 + x93); - out[3] = x96; - out[4] = x99; - out[5] = x102; - out[6] = x105; - out[7] = x108; - out[8] = x111; - out[9] = x114; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_mul121666(fe *h, const fe_loose *f) { - assert_fe_loose(f->v); - fe_mul_121666_impl(h->v, f->v); - assert_fe(h->v); -} - -// Adapted from Fiat-synthesized |fe_sub_impl| with |out| = 0. -static void fe_neg_impl(uint32_t out[10], const uint32_t in2[10]) { - { const uint32_t x20 = 0; - { const uint32_t x21 = 0; - { const uint32_t x19 = 0; - { const uint32_t x17 = 0; - { const uint32_t x15 = 0; - { const uint32_t x13 = 0; - { const uint32_t x11 = 0; - { const uint32_t x9 = 0; - { const uint32_t x7 = 0; - { const uint32_t x5 = 0; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - out[0] = ((0x7ffffda + x5) - x23); - out[1] = ((0x3fffffe + x7) - x25); - out[2] = ((0x7fffffe + x9) - x27); - out[3] = ((0x3fffffe + x11) - x29); - out[4] = ((0x7fffffe + x13) - x31); - out[5] = ((0x3fffffe + x15) - x33); - out[6] = ((0x7fffffe + x17) - x35); - out[7] = ((0x3fffffe + x19) - x37); - out[8] = ((0x7fffffe + x21) - x39); - out[9] = ((0x3fffffe + x20) - x38); - }}}}}}}}}}}}}}}}}}}} -} - -// h = -f -static void fe_neg(fe_loose *h, const fe *f) { - assert_fe(f->v); - fe_neg_impl(h->v, f->v); - assert_fe_loose(h->v); -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cmov(fe_loose *f, const fe_loose *g, unsigned b) { - b = 0-b; - unsigned i; - for (i = 0; i < 10; i++) { - uint32_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - } -} - -#endif // BORINGSSL_CURVE25519_64BIT - -// h = f -static void fe_copy(fe *h, const fe *f) { - OPENSSL_memmove(h, f, sizeof(fe)); -} - -static void fe_copy_lt(fe_loose *h, const fe *f) { - OPENSSL_COMPILE_ASSERT(sizeof(fe_loose) == sizeof(fe), - fe_and_fe_loose_mismatch); - OPENSSL_memmove(h, f, sizeof(fe)); -} -#if !defined(OPENSSL_SMALL) -static void fe_copy_ll(fe_loose *h, const fe_loose *f) { - OPENSSL_memmove(h, f, sizeof(fe_loose)); -} -#endif // !defined(OPENSSL_SMALL) - -static void fe_loose_invert(fe *out, const fe_loose *z) { - fe t0; - fe t1; - fe t2; - fe t3; - int i; - - fe_sq_tl(&t0, z); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 2; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_tlt(&t1, z, &t1); - fe_mul_ttt(&t0, &t0, &t1); - fe_sq_tt(&t2, &t0); - fe_mul_ttt(&t1, &t1, &t2); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 5; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t2, &t2, &t1); - fe_sq_tt(&t3, &t2); - for (i = 1; i < 20; ++i) { - fe_sq_tt(&t3, &t3); - } - fe_mul_ttt(&t2, &t3, &t2); - fe_sq_tt(&t2, &t2); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t2, &t2, &t1); - fe_sq_tt(&t3, &t2); - for (i = 1; i < 100; ++i) { - fe_sq_tt(&t3, &t3); - } - fe_mul_ttt(&t2, &t3, &t2); - fe_sq_tt(&t2, &t2); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t1, &t1); - for (i = 1; i < 5; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(out, &t1, &t0); -} - -static void fe_invert(fe *out, const fe *z) { - fe_loose l; - fe_copy_lt(&l, z); - fe_loose_invert(out, &l); -} - -// return 0 if f == 0 -// return 1 if f != 0 -static int fe_isnonzero(const fe_loose *f) { - fe tight; - fe_carry(&tight, f); - uint8_t s[32]; - fe_tobytes(s, &tight); - - static const uint8_t zero[32] = {0}; - return CRYPTO_memcmp(s, zero, sizeof(zero)) != 0; -} - -// return 1 if f is in {1,3,5,...,q-2} -// return 0 if f is in {0,2,4,...,q-1} -static int fe_isnegative(const fe *f) { - uint8_t s[32]; - fe_tobytes(s, f); - return s[0] & 1; -} - -static void fe_sq2_tt(fe *h, const fe *f) { - // h = f^2 - fe_sq_tt(h, f); - - // h = h + h - fe_loose tmp; - fe_add(&tmp, h, h); - fe_carry(h, &tmp); -} - -static void fe_pow22523(fe *out, const fe *z) { - fe t0; - fe t1; - fe t2; - int i; - - fe_sq_tt(&t0, z); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 2; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t1, z, &t1); - fe_mul_ttt(&t0, &t0, &t1); - fe_sq_tt(&t0, &t0); - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 5; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t1, &t1, &t0); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 20; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t1, &t1); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t1, &t1, &t0); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 100; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t1, &t1); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t0, &t0); - for (i = 1; i < 2; ++i) { - fe_sq_tt(&t0, &t0); - } - fe_mul_ttt(out, &t0, z); -} - - -// Group operations. - -void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h) { - fe recip; - fe x; - fe y; - - fe_invert(&recip, &h->Z); - fe_mul_ttt(&x, &h->X, &recip); - fe_mul_ttt(&y, &h->Y, &recip); - fe_tobytes(s, &y); - s[31] ^= fe_isnegative(&x) << 7; -} - -static void ge_p3_tobytes(uint8_t s[32], const ge_p3 *h) { - fe recip; - fe x; - fe y; - - fe_invert(&recip, &h->Z); - fe_mul_ttt(&x, &h->X, &recip); - fe_mul_ttt(&y, &h->Y, &recip); - fe_tobytes(s, &y); - s[31] ^= fe_isnegative(&x) << 7; -} - -int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s) { - fe u; - fe_loose v; - fe v3; - fe vxx; - fe_loose check; - - fe_frombytes(&h->Y, s); - fe_1(&h->Z); - fe_sq_tt(&v3, &h->Y); - fe_mul_ttt(&vxx, &v3, &d); - fe_sub(&v, &v3, &h->Z); // u = y^2-1 - fe_carry(&u, &v); - fe_add(&v, &vxx, &h->Z); // v = dy^2+1 - - fe_sq_tl(&v3, &v); - fe_mul_ttl(&v3, &v3, &v); // v3 = v^3 - fe_sq_tt(&h->X, &v3); - fe_mul_ttl(&h->X, &h->X, &v); - fe_mul_ttt(&h->X, &h->X, &u); // x = uv^7 - - fe_pow22523(&h->X, &h->X); // x = (uv^7)^((q-5)/8) - fe_mul_ttt(&h->X, &h->X, &v3); - fe_mul_ttt(&h->X, &h->X, &u); // x = uv^3(uv^7)^((q-5)/8) - - fe_sq_tt(&vxx, &h->X); - fe_mul_ttl(&vxx, &vxx, &v); - fe_sub(&check, &vxx, &u); - if (fe_isnonzero(&check)) { - fe_add(&check, &vxx, &u); - if (fe_isnonzero(&check)) { - return -1; - } - fe_mul_ttt(&h->X, &h->X, &sqrtm1); - } - - if (fe_isnegative(&h->X) != (s[31] >> 7)) { - fe_loose t; - fe_neg(&t, &h->X); - fe_carry(&h->X, &t); - } - - fe_mul_ttt(&h->T, &h->X, &h->Y); - return 0; -} - -static void ge_p2_0(ge_p2 *h) { - fe_0(&h->X); - fe_1(&h->Y); - fe_1(&h->Z); -} - -static void ge_p3_0(ge_p3 *h) { - fe_0(&h->X); - fe_1(&h->Y); - fe_1(&h->Z); - fe_0(&h->T); -} - -static void ge_cached_0(ge_cached *h) { - fe_loose_1(&h->YplusX); - fe_loose_1(&h->YminusX); - fe_loose_1(&h->Z); - fe_loose_0(&h->T2d); -} - -static void ge_precomp_0(ge_precomp *h) { - fe_loose_1(&h->yplusx); - fe_loose_1(&h->yminusx); - fe_loose_0(&h->xy2d); -} - -// r = p -static void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p) { - fe_copy(&r->X, &p->X); - fe_copy(&r->Y, &p->Y); - fe_copy(&r->Z, &p->Z); -} - -// r = p -void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p) { - fe_add(&r->YplusX, &p->Y, &p->X); - fe_sub(&r->YminusX, &p->Y, &p->X); - fe_copy_lt(&r->Z, &p->Z); - fe_mul_ltt(&r->T2d, &p->T, &d2); -} - -// r = p -void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p) { - fe_mul_tll(&r->X, &p->X, &p->T); - fe_mul_tll(&r->Y, &p->Y, &p->Z); - fe_mul_tll(&r->Z, &p->Z, &p->T); -} - -// r = p -void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p) { - fe_mul_tll(&r->X, &p->X, &p->T); - fe_mul_tll(&r->Y, &p->Y, &p->Z); - fe_mul_tll(&r->Z, &p->Z, &p->T); - fe_mul_tll(&r->T, &p->X, &p->Y); -} - -// r = p -static void ge_p1p1_to_cached(ge_cached *r, const ge_p1p1 *p) { - ge_p3 t; - x25519_ge_p1p1_to_p3(&t, p); - x25519_ge_p3_to_cached(r, &t); -} - -// r = 2 * p -static void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p) { - fe trX, trZ, trT; - fe t0; - - fe_sq_tt(&trX, &p->X); - fe_sq_tt(&trZ, &p->Y); - fe_sq2_tt(&trT, &p->Z); - fe_add(&r->Y, &p->X, &p->Y); - fe_sq_tl(&t0, &r->Y); - - fe_add(&r->Y, &trZ, &trX); - fe_sub(&r->Z, &trZ, &trX); - fe_carry(&trZ, &r->Y); - fe_sub(&r->X, &t0, &trZ); - fe_carry(&trZ, &r->Z); - fe_sub(&r->T, &trT, &trZ); -} - -// r = 2 * p -static void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p) { - ge_p2 q; - ge_p3_to_p2(&q, p); - ge_p2_dbl(r, &q); -} - -// r = p + q -static void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { - fe trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->yplusx); - fe_mul_tll(&trY, &r->Y, &q->yminusx); - fe_mul_tlt(&trT, &q->xy2d, &p->T); - fe_add(&r->T, &p->Z, &p->Z); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_add(&r->Z, &trZ, &trT); - fe_sub(&r->T, &trZ, &trT); -} - -// r = p - q -static void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { - fe trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->yminusx); - fe_mul_tll(&trY, &r->Y, &q->yplusx); - fe_mul_tlt(&trT, &q->xy2d, &p->T); - fe_add(&r->T, &p->Z, &p->Z); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_sub(&r->Z, &trZ, &trT); - fe_add(&r->T, &trZ, &trT); -} - -// r = p + q -void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { - fe trX, trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->YplusX); - fe_mul_tll(&trY, &r->Y, &q->YminusX); - fe_mul_tlt(&trT, &q->T2d, &p->T); - fe_mul_ttl(&trX, &p->Z, &q->Z); - fe_add(&r->T, &trX, &trX); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_add(&r->Z, &trZ, &trT); - fe_sub(&r->T, &trZ, &trT); -} - -// r = p - q -void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { - fe trX, trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->YminusX); - fe_mul_tll(&trY, &r->Y, &q->YplusX); - fe_mul_tlt(&trT, &q->T2d, &p->T); - fe_mul_ttl(&trX, &p->Z, &q->Z); - fe_add(&r->T, &trX, &trX); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_sub(&r->Z, &trZ, &trT); - fe_add(&r->T, &trZ, &trT); -} - -static uint8_t equal(signed char b, signed char c) { - uint8_t ub = b; - uint8_t uc = c; - uint8_t x = ub ^ uc; // 0: yes; 1..255: no - uint32_t y = x; // 0: yes; 1..255: no - y -= 1; // 4294967295: yes; 0..254: no - y >>= 31; // 1: yes; 0: no - return y; -} - -static void cmov(ge_precomp *t, const ge_precomp *u, uint8_t b) { - fe_cmov(&t->yplusx, &u->yplusx, b); - fe_cmov(&t->yminusx, &u->yminusx, b); - fe_cmov(&t->xy2d, &u->xy2d, b); -} - -void x25519_ge_scalarmult_small_precomp( - ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]) { - // precomp_table is first expanded into matching |ge_precomp| - // elements. - ge_precomp multiples[15]; - - unsigned i; - for (i = 0; i < 15; i++) { - const uint8_t *bytes = &precomp_table[i*(2 * 32)]; - fe x, y; - fe_frombytes(&x, bytes); - fe_frombytes(&y, bytes + 32); - - ge_precomp *out = &multiples[i]; - fe_add(&out->yplusx, &y, &x); - fe_sub(&out->yminusx, &y, &x); - fe_mul_ltt(&out->xy2d, &x, &y); - fe_mul_llt(&out->xy2d, &out->xy2d, &d2); - } - - // See the comment above |k25519SmallPrecomp| about the structure of the - // precomputed elements. This loop does 64 additions and 64 doublings to - // calculate the result. - ge_p3_0(h); - - for (i = 63; i < 64; i--) { - unsigned j; - signed char index = 0; - - for (j = 0; j < 4; j++) { - const uint8_t bit = 1 & (a[(8 * j) + (i / 8)] >> (i & 7)); - index |= (bit << j); - } - - ge_precomp e; - ge_precomp_0(&e); - - for (j = 1; j < 16; j++) { - cmov(&e, &multiples[j-1], equal(index, j)); - } - - ge_cached cached; - ge_p1p1 r; - x25519_ge_p3_to_cached(&cached, h); - x25519_ge_add(&r, h, &cached); - x25519_ge_p1p1_to_p3(h, &r); - - ge_madd(&r, h, &e); - x25519_ge_p1p1_to_p3(h, &r); - } -} - -#if defined(OPENSSL_SMALL) - -void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]) { - x25519_ge_scalarmult_small_precomp(h, a, k25519SmallPrecomp); -} - -#else - -static uint8_t negative(signed char b) { - uint32_t x = b; - x >>= 31; // 1: yes; 0: no - return x; -} - -static void table_select(ge_precomp *t, int pos, signed char b) { - ge_precomp minust; - uint8_t bnegative = negative(b); - uint8_t babs = b - ((uint8_t)((-bnegative) & b) << 1); - - ge_precomp_0(t); - cmov(t, &k25519Precomp[pos][0], equal(babs, 1)); - cmov(t, &k25519Precomp[pos][1], equal(babs, 2)); - cmov(t, &k25519Precomp[pos][2], equal(babs, 3)); - cmov(t, &k25519Precomp[pos][3], equal(babs, 4)); - cmov(t, &k25519Precomp[pos][4], equal(babs, 5)); - cmov(t, &k25519Precomp[pos][5], equal(babs, 6)); - cmov(t, &k25519Precomp[pos][6], equal(babs, 7)); - cmov(t, &k25519Precomp[pos][7], equal(babs, 8)); - fe_copy_ll(&minust.yplusx, &t->yminusx); - fe_copy_ll(&minust.yminusx, &t->yplusx); - - // NOTE: the input table is canonical, but types don't encode it - fe tmp; - fe_carry(&tmp, &t->xy2d); - fe_neg(&minust.xy2d, &tmp); - - cmov(t, &minust, bnegative); -} - -// h = a * B -// where a = a[0]+256*a[1]+...+256^31 a[31] -// B is the Ed25519 base point (x,4/5) with x positive. -// -// Preconditions: -// a[31] <= 127 -void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) { - signed char e[64]; - signed char carry; - ge_p1p1 r; - ge_p2 s; - ge_precomp t; - int i; - - for (i = 0; i < 32; ++i) { - e[2 * i + 0] = (a[i] >> 0) & 15; - e[2 * i + 1] = (a[i] >> 4) & 15; - } - // each e[i] is between 0 and 15 - // e[63] is between 0 and 7 - - carry = 0; - for (i = 0; i < 63; ++i) { - e[i] += carry; - carry = e[i] + 8; - carry >>= 4; - e[i] -= carry << 4; - } - e[63] += carry; - // each e[i] is between -8 and 8 - - ge_p3_0(h); - for (i = 1; i < 64; i += 2) { - table_select(&t, i / 2, e[i]); - ge_madd(&r, h, &t); - x25519_ge_p1p1_to_p3(h, &r); - } - - ge_p3_dbl(&r, h); - x25519_ge_p1p1_to_p2(&s, &r); - ge_p2_dbl(&r, &s); - x25519_ge_p1p1_to_p2(&s, &r); - ge_p2_dbl(&r, &s); - x25519_ge_p1p1_to_p2(&s, &r); - ge_p2_dbl(&r, &s); - x25519_ge_p1p1_to_p3(h, &r); - - for (i = 0; i < 64; i += 2) { - table_select(&t, i / 2, e[i]); - ge_madd(&r, h, &t); - x25519_ge_p1p1_to_p3(h, &r); - } -} - -#endif - -static void cmov_cached(ge_cached *t, ge_cached *u, uint8_t b) { - fe_cmov(&t->YplusX, &u->YplusX, b); - fe_cmov(&t->YminusX, &u->YminusX, b); - fe_cmov(&t->Z, &u->Z, b); - fe_cmov(&t->T2d, &u->T2d, b); -} - -// r = scalar * A. -// where a = a[0]+256*a[1]+...+256^31 a[31]. -void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A) { - ge_p2 Ai_p2[8]; - ge_cached Ai[16]; - ge_p1p1 t; - - ge_cached_0(&Ai[0]); - x25519_ge_p3_to_cached(&Ai[1], A); - ge_p3_to_p2(&Ai_p2[1], A); - - unsigned i; - for (i = 2; i < 16; i += 2) { - ge_p2_dbl(&t, &Ai_p2[i / 2]); - ge_p1p1_to_cached(&Ai[i], &t); - if (i < 8) { - x25519_ge_p1p1_to_p2(&Ai_p2[i], &t); - } - x25519_ge_add(&t, A, &Ai[i]); - ge_p1p1_to_cached(&Ai[i + 1], &t); - if (i < 7) { - x25519_ge_p1p1_to_p2(&Ai_p2[i + 1], &t); - } - } - - ge_p2_0(r); - ge_p3 u; - - for (i = 0; i < 256; i += 4) { - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p2(r, &t); - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p2(r, &t); - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p2(r, &t); - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p3(&u, &t); - - uint8_t index = scalar[31 - i/8]; - index >>= 4 - (i & 4); - index &= 0xf; - - unsigned j; - ge_cached selected; - ge_cached_0(&selected); - for (j = 0; j < 16; j++) { - cmov_cached(&selected, &Ai[j], equal(j, index)); - } - - x25519_ge_add(&t, &u, &selected); - x25519_ge_p1p1_to_p2(r, &t); - } -} - -static void slide(signed char *r, const uint8_t *a) { - int i; - int b; - int k; - - for (i = 0; i < 256; ++i) { - r[i] = 1 & (a[i >> 3] >> (i & 7)); - } - - for (i = 0; i < 256; ++i) { - if (r[i]) { - for (b = 1; b <= 6 && i + b < 256; ++b) { - if (r[i + b]) { - if (r[i] + (r[i + b] << b) <= 15) { - r[i] += r[i + b] << b; - r[i + b] = 0; - } else if (r[i] - (r[i + b] << b) >= -15) { - r[i] -= r[i + b] << b; - for (k = i + b; k < 256; ++k) { - if (!r[k]) { - r[k] = 1; - break; - } - r[k] = 0; - } - } else { - break; - } - } - } - } - } -} - -// r = a * A + b * B -// where a = a[0]+256*a[1]+...+256^31 a[31]. -// and b = b[0]+256*b[1]+...+256^31 b[31]. -// B is the Ed25519 base point (x,4/5) with x positive. -static void ge_double_scalarmult_vartime(ge_p2 *r, const uint8_t *a, - const ge_p3 *A, const uint8_t *b) { - signed char aslide[256]; - signed char bslide[256]; - ge_cached Ai[8]; // A,3A,5A,7A,9A,11A,13A,15A - ge_p1p1 t; - ge_p3 u; - ge_p3 A2; - int i; - - slide(aslide, a); - slide(bslide, b); - - x25519_ge_p3_to_cached(&Ai[0], A); - ge_p3_dbl(&t, A); - x25519_ge_p1p1_to_p3(&A2, &t); - x25519_ge_add(&t, &A2, &Ai[0]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[1], &u); - x25519_ge_add(&t, &A2, &Ai[1]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[2], &u); - x25519_ge_add(&t, &A2, &Ai[2]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[3], &u); - x25519_ge_add(&t, &A2, &Ai[3]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[4], &u); - x25519_ge_add(&t, &A2, &Ai[4]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[5], &u); - x25519_ge_add(&t, &A2, &Ai[5]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[6], &u); - x25519_ge_add(&t, &A2, &Ai[6]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[7], &u); - - ge_p2_0(r); - - for (i = 255; i >= 0; --i) { - if (aslide[i] || bslide[i]) { - break; - } - } - - for (; i >= 0; --i) { - ge_p2_dbl(&t, r); - - if (aslide[i] > 0) { - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_add(&t, &u, &Ai[aslide[i] / 2]); - } else if (aslide[i] < 0) { - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); - } - - if (bslide[i] > 0) { - x25519_ge_p1p1_to_p3(&u, &t); - ge_madd(&t, &u, &Bi[bslide[i] / 2]); - } else if (bslide[i] < 0) { - x25519_ge_p1p1_to_p3(&u, &t); - ge_msub(&t, &u, &Bi[(-bslide[i]) / 2]); - } - - x25519_ge_p1p1_to_p2(r, &t); - } -} - -// The set of scalars is \Z/l -// where l = 2^252 + 27742317777372353535851937790883648493. - -// Input: -// s[0]+256*s[1]+...+256^63*s[63] = s -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = s mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -// Overwrites s in place. -void x25519_sc_reduce(uint8_t s[64]) { - int64_t s0 = 2097151 & load_3(s); - int64_t s1 = 2097151 & (load_4(s + 2) >> 5); - int64_t s2 = 2097151 & (load_3(s + 5) >> 2); - int64_t s3 = 2097151 & (load_4(s + 7) >> 7); - int64_t s4 = 2097151 & (load_4(s + 10) >> 4); - int64_t s5 = 2097151 & (load_3(s + 13) >> 1); - int64_t s6 = 2097151 & (load_4(s + 15) >> 6); - int64_t s7 = 2097151 & (load_3(s + 18) >> 3); - int64_t s8 = 2097151 & load_3(s + 21); - int64_t s9 = 2097151 & (load_4(s + 23) >> 5); - int64_t s10 = 2097151 & (load_3(s + 26) >> 2); - int64_t s11 = 2097151 & (load_4(s + 28) >> 7); - int64_t s12 = 2097151 & (load_4(s + 31) >> 4); - int64_t s13 = 2097151 & (load_3(s + 34) >> 1); - int64_t s14 = 2097151 & (load_4(s + 36) >> 6); - int64_t s15 = 2097151 & (load_3(s + 39) >> 3); - int64_t s16 = 2097151 & load_3(s + 42); - int64_t s17 = 2097151 & (load_4(s + 44) >> 5); - int64_t s18 = 2097151 & (load_3(s + 47) >> 2); - int64_t s19 = 2097151 & (load_4(s + 49) >> 7); - int64_t s20 = 2097151 & (load_4(s + 52) >> 4); - int64_t s21 = 2097151 & (load_3(s + 55) >> 1); - int64_t s22 = 2097151 & (load_4(s + 57) >> 6); - int64_t s23 = (load_4(s + 60) >> 3); - int64_t carry0; - int64_t carry1; - int64_t carry2; - int64_t carry3; - int64_t carry4; - int64_t carry5; - int64_t carry6; - int64_t carry7; - int64_t carry8; - int64_t carry9; - int64_t carry10; - int64_t carry11; - int64_t carry12; - int64_t carry13; - int64_t carry14; - int64_t carry15; - int64_t carry16; - - s11 += s23 * 666643; - s12 += s23 * 470296; - s13 += s23 * 654183; - s14 -= s23 * 997805; - s15 += s23 * 136657; - s16 -= s23 * 683901; - s23 = 0; - - s10 += s22 * 666643; - s11 += s22 * 470296; - s12 += s22 * 654183; - s13 -= s22 * 997805; - s14 += s22 * 136657; - s15 -= s22 * 683901; - s22 = 0; - - s9 += s21 * 666643; - s10 += s21 * 470296; - s11 += s21 * 654183; - s12 -= s21 * 997805; - s13 += s21 * 136657; - s14 -= s21 * 683901; - s21 = 0; - - s8 += s20 * 666643; - s9 += s20 * 470296; - s10 += s20 * 654183; - s11 -= s20 * 997805; - s12 += s20 * 136657; - s13 -= s20 * 683901; - s20 = 0; - - s7 += s19 * 666643; - s8 += s19 * 470296; - s9 += s19 * 654183; - s10 -= s19 * 997805; - s11 += s19 * 136657; - s12 -= s19 * 683901; - s19 = 0; - - s6 += s18 * 666643; - s7 += s18 * 470296; - s8 += s18 * 654183; - s9 -= s18 * 997805; - s10 += s18 * 136657; - s11 -= s18 * 683901; - s18 = 0; - - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry12 = (s12 + (1 << 20)) >> 21; - s13 += carry12; - s12 -= carry12 << 21; - carry14 = (s14 + (1 << 20)) >> 21; - s15 += carry14; - s14 -= carry14 << 21; - carry16 = (s16 + (1 << 20)) >> 21; - s17 += carry16; - s16 -= carry16 << 21; - - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - carry13 = (s13 + (1 << 20)) >> 21; - s14 += carry13; - s13 -= carry13 << 21; - carry15 = (s15 + (1 << 20)) >> 21; - s16 += carry15; - s15 -= carry15 << 21; - - s5 += s17 * 666643; - s6 += s17 * 470296; - s7 += s17 * 654183; - s8 -= s17 * 997805; - s9 += s17 * 136657; - s10 -= s17 * 683901; - s17 = 0; - - s4 += s16 * 666643; - s5 += s16 * 470296; - s6 += s16 * 654183; - s7 -= s16 * 997805; - s8 += s16 * 136657; - s9 -= s16 * 683901; - s16 = 0; - - s3 += s15 * 666643; - s4 += s15 * 470296; - s5 += s15 * 654183; - s6 -= s15 * 997805; - s7 += s15 * 136657; - s8 -= s15 * 683901; - s15 = 0; - - s2 += s14 * 666643; - s3 += s14 * 470296; - s4 += s14 * 654183; - s5 -= s14 * 997805; - s6 += s14 * 136657; - s7 -= s14 * 683901; - s14 = 0; - - s1 += s13 * 666643; - s2 += s13 * 470296; - s3 += s13 * 654183; - s4 -= s13 * 997805; - s5 += s13 * 136657; - s6 -= s13 * 683901; - s13 = 0; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = (s0 + (1 << 20)) >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry2 = (s2 + (1 << 20)) >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry4 = (s4 + (1 << 20)) >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - carry1 = (s1 + (1 << 20)) >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry3 = (s3 + (1 << 20)) >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry5 = (s5 + (1 << 20)) >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry11 = s11 >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - s[0] = s0 >> 0; - s[1] = s0 >> 8; - s[2] = (s0 >> 16) | (s1 << 5); - s[3] = s1 >> 3; - s[4] = s1 >> 11; - s[5] = (s1 >> 19) | (s2 << 2); - s[6] = s2 >> 6; - s[7] = (s2 >> 14) | (s3 << 7); - s[8] = s3 >> 1; - s[9] = s3 >> 9; - s[10] = (s3 >> 17) | (s4 << 4); - s[11] = s4 >> 4; - s[12] = s4 >> 12; - s[13] = (s4 >> 20) | (s5 << 1); - s[14] = s5 >> 7; - s[15] = (s5 >> 15) | (s6 << 6); - s[16] = s6 >> 2; - s[17] = s6 >> 10; - s[18] = (s6 >> 18) | (s7 << 3); - s[19] = s7 >> 5; - s[20] = s7 >> 13; - s[21] = s8 >> 0; - s[22] = s8 >> 8; - s[23] = (s8 >> 16) | (s9 << 5); - s[24] = s9 >> 3; - s[25] = s9 >> 11; - s[26] = (s9 >> 19) | (s10 << 2); - s[27] = s10 >> 6; - s[28] = (s10 >> 14) | (s11 << 7); - s[29] = s11 >> 1; - s[30] = s11 >> 9; - s[31] = s11 >> 17; -} - -// Input: -// a[0]+256*a[1]+...+256^31*a[31] = a -// b[0]+256*b[1]+...+256^31*b[31] = b -// c[0]+256*c[1]+...+256^31*c[31] = c -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b, - const uint8_t *c) { - int64_t a0 = 2097151 & load_3(a); - int64_t a1 = 2097151 & (load_4(a + 2) >> 5); - int64_t a2 = 2097151 & (load_3(a + 5) >> 2); - int64_t a3 = 2097151 & (load_4(a + 7) >> 7); - int64_t a4 = 2097151 & (load_4(a + 10) >> 4); - int64_t a5 = 2097151 & (load_3(a + 13) >> 1); - int64_t a6 = 2097151 & (load_4(a + 15) >> 6); - int64_t a7 = 2097151 & (load_3(a + 18) >> 3); - int64_t a8 = 2097151 & load_3(a + 21); - int64_t a9 = 2097151 & (load_4(a + 23) >> 5); - int64_t a10 = 2097151 & (load_3(a + 26) >> 2); - int64_t a11 = (load_4(a + 28) >> 7); - int64_t b0 = 2097151 & load_3(b); - int64_t b1 = 2097151 & (load_4(b + 2) >> 5); - int64_t b2 = 2097151 & (load_3(b + 5) >> 2); - int64_t b3 = 2097151 & (load_4(b + 7) >> 7); - int64_t b4 = 2097151 & (load_4(b + 10) >> 4); - int64_t b5 = 2097151 & (load_3(b + 13) >> 1); - int64_t b6 = 2097151 & (load_4(b + 15) >> 6); - int64_t b7 = 2097151 & (load_3(b + 18) >> 3); - int64_t b8 = 2097151 & load_3(b + 21); - int64_t b9 = 2097151 & (load_4(b + 23) >> 5); - int64_t b10 = 2097151 & (load_3(b + 26) >> 2); - int64_t b11 = (load_4(b + 28) >> 7); - int64_t c0 = 2097151 & load_3(c); - int64_t c1 = 2097151 & (load_4(c + 2) >> 5); - int64_t c2 = 2097151 & (load_3(c + 5) >> 2); - int64_t c3 = 2097151 & (load_4(c + 7) >> 7); - int64_t c4 = 2097151 & (load_4(c + 10) >> 4); - int64_t c5 = 2097151 & (load_3(c + 13) >> 1); - int64_t c6 = 2097151 & (load_4(c + 15) >> 6); - int64_t c7 = 2097151 & (load_3(c + 18) >> 3); - int64_t c8 = 2097151 & load_3(c + 21); - int64_t c9 = 2097151 & (load_4(c + 23) >> 5); - int64_t c10 = 2097151 & (load_3(c + 26) >> 2); - int64_t c11 = (load_4(c + 28) >> 7); - int64_t s0; - int64_t s1; - int64_t s2; - int64_t s3; - int64_t s4; - int64_t s5; - int64_t s6; - int64_t s7; - int64_t s8; - int64_t s9; - int64_t s10; - int64_t s11; - int64_t s12; - int64_t s13; - int64_t s14; - int64_t s15; - int64_t s16; - int64_t s17; - int64_t s18; - int64_t s19; - int64_t s20; - int64_t s21; - int64_t s22; - int64_t s23; - int64_t carry0; - int64_t carry1; - int64_t carry2; - int64_t carry3; - int64_t carry4; - int64_t carry5; - int64_t carry6; - int64_t carry7; - int64_t carry8; - int64_t carry9; - int64_t carry10; - int64_t carry11; - int64_t carry12; - int64_t carry13; - int64_t carry14; - int64_t carry15; - int64_t carry16; - int64_t carry17; - int64_t carry18; - int64_t carry19; - int64_t carry20; - int64_t carry21; - int64_t carry22; - - s0 = c0 + a0 * b0; - s1 = c1 + a0 * b1 + a1 * b0; - s2 = c2 + a0 * b2 + a1 * b1 + a2 * b0; - s3 = c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; - s4 = c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; - s5 = c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; - s6 = c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; - s7 = c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + - a6 * b1 + a7 * b0; - s8 = c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + - a6 * b2 + a7 * b1 + a8 * b0; - s9 = c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + - a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; - s10 = c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + - a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; - s11 = c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + - a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; - s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + - a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; - s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + - a9 * b4 + a10 * b3 + a11 * b2; - s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 + - a10 * b4 + a11 * b3; - s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 + - a11 * b4; - s16 = a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; - s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; - s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; - s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; - s20 = a9 * b11 + a10 * b10 + a11 * b9; - s21 = a10 * b11 + a11 * b10; - s22 = a11 * b11; - s23 = 0; - - carry0 = (s0 + (1 << 20)) >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry2 = (s2 + (1 << 20)) >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry4 = (s4 + (1 << 20)) >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry12 = (s12 + (1 << 20)) >> 21; - s13 += carry12; - s12 -= carry12 << 21; - carry14 = (s14 + (1 << 20)) >> 21; - s15 += carry14; - s14 -= carry14 << 21; - carry16 = (s16 + (1 << 20)) >> 21; - s17 += carry16; - s16 -= carry16 << 21; - carry18 = (s18 + (1 << 20)) >> 21; - s19 += carry18; - s18 -= carry18 << 21; - carry20 = (s20 + (1 << 20)) >> 21; - s21 += carry20; - s20 -= carry20 << 21; - carry22 = (s22 + (1 << 20)) >> 21; - s23 += carry22; - s22 -= carry22 << 21; - - carry1 = (s1 + (1 << 20)) >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry3 = (s3 + (1 << 20)) >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry5 = (s5 + (1 << 20)) >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - carry13 = (s13 + (1 << 20)) >> 21; - s14 += carry13; - s13 -= carry13 << 21; - carry15 = (s15 + (1 << 20)) >> 21; - s16 += carry15; - s15 -= carry15 << 21; - carry17 = (s17 + (1 << 20)) >> 21; - s18 += carry17; - s17 -= carry17 << 21; - carry19 = (s19 + (1 << 20)) >> 21; - s20 += carry19; - s19 -= carry19 << 21; - carry21 = (s21 + (1 << 20)) >> 21; - s22 += carry21; - s21 -= carry21 << 21; - - s11 += s23 * 666643; - s12 += s23 * 470296; - s13 += s23 * 654183; - s14 -= s23 * 997805; - s15 += s23 * 136657; - s16 -= s23 * 683901; - s23 = 0; - - s10 += s22 * 666643; - s11 += s22 * 470296; - s12 += s22 * 654183; - s13 -= s22 * 997805; - s14 += s22 * 136657; - s15 -= s22 * 683901; - s22 = 0; - - s9 += s21 * 666643; - s10 += s21 * 470296; - s11 += s21 * 654183; - s12 -= s21 * 997805; - s13 += s21 * 136657; - s14 -= s21 * 683901; - s21 = 0; - - s8 += s20 * 666643; - s9 += s20 * 470296; - s10 += s20 * 654183; - s11 -= s20 * 997805; - s12 += s20 * 136657; - s13 -= s20 * 683901; - s20 = 0; - - s7 += s19 * 666643; - s8 += s19 * 470296; - s9 += s19 * 654183; - s10 -= s19 * 997805; - s11 += s19 * 136657; - s12 -= s19 * 683901; - s19 = 0; - - s6 += s18 * 666643; - s7 += s18 * 470296; - s8 += s18 * 654183; - s9 -= s18 * 997805; - s10 += s18 * 136657; - s11 -= s18 * 683901; - s18 = 0; - - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry12 = (s12 + (1 << 20)) >> 21; - s13 += carry12; - s12 -= carry12 << 21; - carry14 = (s14 + (1 << 20)) >> 21; - s15 += carry14; - s14 -= carry14 << 21; - carry16 = (s16 + (1 << 20)) >> 21; - s17 += carry16; - s16 -= carry16 << 21; - - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - carry13 = (s13 + (1 << 20)) >> 21; - s14 += carry13; - s13 -= carry13 << 21; - carry15 = (s15 + (1 << 20)) >> 21; - s16 += carry15; - s15 -= carry15 << 21; - - s5 += s17 * 666643; - s6 += s17 * 470296; - s7 += s17 * 654183; - s8 -= s17 * 997805; - s9 += s17 * 136657; - s10 -= s17 * 683901; - s17 = 0; - - s4 += s16 * 666643; - s5 += s16 * 470296; - s6 += s16 * 654183; - s7 -= s16 * 997805; - s8 += s16 * 136657; - s9 -= s16 * 683901; - s16 = 0; - - s3 += s15 * 666643; - s4 += s15 * 470296; - s5 += s15 * 654183; - s6 -= s15 * 997805; - s7 += s15 * 136657; - s8 -= s15 * 683901; - s15 = 0; - - s2 += s14 * 666643; - s3 += s14 * 470296; - s4 += s14 * 654183; - s5 -= s14 * 997805; - s6 += s14 * 136657; - s7 -= s14 * 683901; - s14 = 0; - - s1 += s13 * 666643; - s2 += s13 * 470296; - s3 += s13 * 654183; - s4 -= s13 * 997805; - s5 += s13 * 136657; - s6 -= s13 * 683901; - s13 = 0; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = (s0 + (1 << 20)) >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry2 = (s2 + (1 << 20)) >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry4 = (s4 + (1 << 20)) >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - carry1 = (s1 + (1 << 20)) >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry3 = (s3 + (1 << 20)) >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry5 = (s5 + (1 << 20)) >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry11 = s11 >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - s[0] = s0 >> 0; - s[1] = s0 >> 8; - s[2] = (s0 >> 16) | (s1 << 5); - s[3] = s1 >> 3; - s[4] = s1 >> 11; - s[5] = (s1 >> 19) | (s2 << 2); - s[6] = s2 >> 6; - s[7] = (s2 >> 14) | (s3 << 7); - s[8] = s3 >> 1; - s[9] = s3 >> 9; - s[10] = (s3 >> 17) | (s4 << 4); - s[11] = s4 >> 4; - s[12] = s4 >> 12; - s[13] = (s4 >> 20) | (s5 << 1); - s[14] = s5 >> 7; - s[15] = (s5 >> 15) | (s6 << 6); - s[16] = s6 >> 2; - s[17] = s6 >> 10; - s[18] = (s6 >> 18) | (s7 << 3); - s[19] = s7 >> 5; - s[20] = s7 >> 13; - s[21] = s8 >> 0; - s[22] = s8 >> 8; - s[23] = (s8 >> 16) | (s9 << 5); - s[24] = s9 >> 3; - s[25] = s9 >> 11; - s[26] = (s9 >> 19) | (s10 << 2); - s[27] = s10 >> 6; - s[28] = (s10 >> 14) | (s11 << 7); - s[29] = s11 >> 1; - s[30] = s11 >> 9; - s[31] = s11 >> 17; -} - -void ED25519_keypair(uint8_t out_public_key[32], uint8_t out_private_key[64]) { - uint8_t seed[32]; - RAND_bytes(seed, 32); - ED25519_keypair_from_seed(out_public_key, out_private_key, seed); -} - -int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, - size_t message_len, const uint8_t private_key[64]) { - uint8_t az[SHA512_DIGEST_LENGTH]; - SHA512(private_key, 32, az); - - az[0] &= 248; - az[31] &= 63; - az[31] |= 64; - - SHA512_CTX hash_ctx; - SHA512_Init(&hash_ctx); - SHA512_Update(&hash_ctx, az + 32, 32); - SHA512_Update(&hash_ctx, message, message_len); - uint8_t nonce[SHA512_DIGEST_LENGTH]; - SHA512_Final(nonce, &hash_ctx); - - x25519_sc_reduce(nonce); - ge_p3 R; - x25519_ge_scalarmult_base(&R, nonce); - ge_p3_tobytes(out_sig, &R); - - SHA512_Init(&hash_ctx); - SHA512_Update(&hash_ctx, out_sig, 32); - SHA512_Update(&hash_ctx, private_key + 32, 32); - SHA512_Update(&hash_ctx, message, message_len); - uint8_t hram[SHA512_DIGEST_LENGTH]; - SHA512_Final(hram, &hash_ctx); - - x25519_sc_reduce(hram); - sc_muladd(out_sig + 32, hram, az, nonce); - - return 1; -} - -int ED25519_verify(const uint8_t *message, size_t message_len, - const uint8_t signature[64], const uint8_t public_key[32]) { - ge_p3 A; - if ((signature[63] & 224) != 0 || - x25519_ge_frombytes_vartime(&A, public_key) != 0) { - return 0; - } - - fe_loose t; - fe_neg(&t, &A.X); - fe_carry(&A.X, &t); - fe_neg(&t, &A.T); - fe_carry(&A.T, &t); - - uint8_t pkcopy[32]; - OPENSSL_memcpy(pkcopy, public_key, 32); - uint8_t rcopy[32]; - OPENSSL_memcpy(rcopy, signature, 32); - union { - uint64_t u64[4]; - uint8_t u8[32]; - } scopy; - OPENSSL_memcpy(&scopy.u8[0], signature + 32, 32); - - // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in - // the range [0, order) in order to prevent signature malleability. - - // kOrder is the order of Curve25519 in little-endian form. - static const uint64_t kOrder[4] = { - UINT64_C(0x5812631a5cf5d3ed), - UINT64_C(0x14def9dea2f79cd6), - 0, - UINT64_C(0x1000000000000000), - }; - for (size_t i = 3;; i--) { - if (scopy.u64[i] > kOrder[i]) { - return 0; - } else if (scopy.u64[i] < kOrder[i]) { - break; - } else if (i == 0) { - return 0; - } - } - - SHA512_CTX hash_ctx; - SHA512_Init(&hash_ctx); - SHA512_Update(&hash_ctx, signature, 32); - SHA512_Update(&hash_ctx, public_key, 32); - SHA512_Update(&hash_ctx, message, message_len); - uint8_t h[SHA512_DIGEST_LENGTH]; - SHA512_Final(h, &hash_ctx); - - x25519_sc_reduce(h); - - ge_p2 R; - ge_double_scalarmult_vartime(&R, h, &A, scopy.u8); - - uint8_t rcheck[32]; - x25519_ge_tobytes(rcheck, &R); - - return CRYPTO_memcmp(rcheck, rcopy, sizeof(rcheck)) == 0; -} - -void ED25519_keypair_from_seed(uint8_t out_public_key[32], - uint8_t out_private_key[64], - const uint8_t seed[32]) { - uint8_t az[SHA512_DIGEST_LENGTH]; - SHA512(seed, 32, az); - - az[0] &= 248; - az[31] &= 63; - az[31] |= 64; - - ge_p3 A; - x25519_ge_scalarmult_base(&A, az); - ge_p3_tobytes(out_public_key, &A); - - OPENSSL_memcpy(out_private_key, seed, 32); - OPENSSL_memcpy(out_private_key + 32, out_public_key, 32); -} - - -static void x25519_scalar_mult_generic(uint8_t out[32], - const uint8_t scalar[32], - const uint8_t point[32]) { - fe x1, x2, z2, x3, z3, tmp0, tmp1; - fe_loose x2l, z2l, x3l, tmp0l, tmp1l; - - uint8_t e[32]; - OPENSSL_memcpy(e, scalar, 32); - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - - // The following implementation was transcribed to Coq and proven to - // correspond to unary scalar multiplication in affine coordinates given that - // x1 != 0 is the x coordinate of some point on the curve. It was also checked - // in Coq that doing a ladderstep with x1 = x3 = 0 gives z2' = z3' = 0, and z2 - // = z3 = 0 gives z2' = z3' = 0. The statement was quantified over the - // underlying field, so it applies to Curve25519 itself and the quadratic - // twist of Curve25519. It was not proven in Coq that prime-field arithmetic - // correctly simulates extension-field arithmetic on prime-field values. - // The decoding of the byte array representation of e was not considered. - // Specification of Montgomery curves in affine coordinates: - // - // Proof that these form a group that is isomorphic to a Weierstrass curve: - // - // Coq transcription and correctness proof of the loop (where scalarbits=255): - // - // - // preconditions: 0 <= e < 2^255 (not necessarily e < order), fe_invert(0) = 0 - fe_frombytes(&x1, point); - fe_1(&x2); - fe_0(&z2); - fe_copy(&x3, &x1); - fe_1(&z3); - - unsigned swap = 0; - int pos; - for (pos = 254; pos >= 0; --pos) { - // loop invariant as of right before the test, for the case where x1 != 0: - // pos >= -1; if z2 = 0 then x2 is nonzero; if z3 = 0 then x3 is nonzero - // let r := e >> (pos+1) in the following equalities of projective points: - // to_xz (r*P) === if swap then (x3, z3) else (x2, z2) - // to_xz ((r+1)*P) === if swap then (x2, z2) else (x3, z3) - // x1 is the nonzero x coordinate of the nonzero point (r*P-(r+1)*P) - unsigned b = 1 & (e[pos / 8] >> (pos & 7)); - swap ^= b; - fe_cswap(&x2, &x3, swap); - fe_cswap(&z2, &z3, swap); - swap = b; - // Coq transcription of ladderstep formula (called from transcribed loop): - // - // - // x1 != 0 - // x1 = 0 - fe_sub(&tmp0l, &x3, &z3); - fe_sub(&tmp1l, &x2, &z2); - fe_add(&x2l, &x2, &z2); - fe_add(&z2l, &x3, &z3); - fe_mul_tll(&z3, &tmp0l, &x2l); - fe_mul_tll(&z2, &z2l, &tmp1l); - fe_sq_tl(&tmp0, &tmp1l); - fe_sq_tl(&tmp1, &x2l); - fe_add(&x3l, &z3, &z2); - fe_sub(&z2l, &z3, &z2); - fe_mul_ttt(&x2, &tmp1, &tmp0); - fe_sub(&tmp1l, &tmp1, &tmp0); - fe_sq_tl(&z2, &z2l); - fe_mul121666(&z3, &tmp1l); - fe_sq_tl(&x3, &x3l); - fe_add(&tmp0l, &tmp0, &z3); - fe_mul_ttt(&z3, &x1, &z2); - fe_mul_tll(&z2, &tmp1l, &tmp0l); - } - // here pos=-1, so r=e, so to_xz (e*P) === if swap then (x3, z3) else (x2, z2) - fe_cswap(&x2, &x3, swap); - fe_cswap(&z2, &z3, swap); - - fe_invert(&z2, &z2); - fe_mul_ttt(&x2, &x2, &z2); - fe_tobytes(out, &x2); -} - -static void x25519_scalar_mult(uint8_t out[32], const uint8_t scalar[32], - const uint8_t point[32]) { -#if defined(BORINGSSL_X25519_NEON) - if (CRYPTO_is_NEON_capable()) { - x25519_NEON(out, scalar, point); - return; - } -#endif - - x25519_scalar_mult_generic(out, scalar, point); -} - -void X25519_keypair(uint8_t out_public_value[32], uint8_t out_private_key[32]) { - RAND_bytes(out_private_key, 32); - - // All X25519 implementations should decode scalars correctly (see - // https://tools.ietf.org/html/rfc7748#section-5). However, if an - // implementation doesn't then it might interoperate with random keys a - // fraction of the time because they'll, randomly, happen to be correctly - // formed. - // - // Thus we do the opposite of the masking here to make sure that our private - // keys are never correctly masked and so, hopefully, any incorrect - // implementations are deterministically broken. - // - // This does not affect security because, although we're throwing away - // entropy, a valid implementation of scalarmult should throw away the exact - // same bits anyway. - out_private_key[0] |= 7; - out_private_key[31] &= 63; - out_private_key[31] |= 128; - - X25519_public_from_private(out_public_value, out_private_key); -} - -int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32], - const uint8_t peer_public_value[32]) { - static const uint8_t kZeros[32] = {0}; - x25519_scalar_mult(out_shared_key, private_key, peer_public_value); - // The all-zero output results when the input is a point of small order. - return CRYPTO_memcmp(kZeros, out_shared_key, 32) != 0; -} - -void X25519_public_from_private(uint8_t out_public_value[32], - const uint8_t private_key[32]) { -#if defined(BORINGSSL_X25519_NEON) - if (CRYPTO_is_NEON_capable()) { - static const uint8_t kMongomeryBasePoint[32] = {9}; - x25519_NEON(out_public_value, private_key, kMongomeryBasePoint); - return; - } -#endif - - uint8_t e[32]; - OPENSSL_memcpy(e, private_key, 32); - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - - ge_p3 A; - x25519_ge_scalarmult_base(&A, e); - - // We only need the u-coordinate of the curve25519 point. The map is - // u=(y+1)/(1-y). Since y=Y/Z, this gives u=(Z+Y)/(Z-Y). - fe_loose zplusy, zminusy; - fe zminusy_inv; - fe_add(&zplusy, &A.Z, &A.Y); - fe_sub(&zminusy, &A.Z, &A.Y); - fe_loose_invert(&zminusy_inv, &zminusy); - fe_mul_tlt(&zminusy_inv, &zplusy, &zminusy_inv); - fe_tobytes(out_public_value, &zminusy_inv); -} diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/curve25519.c.grpc_back b/Pods/BoringSSL-GRPC/third_party/fiat/curve25519.c.grpc_back deleted file mode 100644 index 0fdf1d930..000000000 --- a/Pods/BoringSSL-GRPC/third_party/fiat/curve25519.c.grpc_back +++ /dev/null @@ -1,3230 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// Some of this code is taken from the ref10 version of Ed25519 in SUPERCOP -// 20141124 (http://bench.cr.yp.to/supercop.html). That code is released as -// public domain but parts have been replaced with code generated by Fiat -// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. -// -// The field functions are shared by Ed25519 and X25519 where possible. - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include "internal.h" -#include "../../crypto/internal.h" - - -// Various pre-computed constants. -#include "./curve25519_tables.h" - - -// Low-level intrinsic operations (hand-written). - -static uint64_t load_3(const uint8_t *in) { - uint64_t result; - result = (uint64_t)in[0]; - result |= ((uint64_t)in[1]) << 8; - result |= ((uint64_t)in[2]) << 16; - return result; -} - -static uint64_t load_4(const uint8_t *in) { - uint64_t result; - result = (uint64_t)in[0]; - result |= ((uint64_t)in[1]) << 8; - result |= ((uint64_t)in[2]) << 16; - result |= ((uint64_t)in[3]) << 24; - return result; -} - -#if defined(BORINGSSL_CURVE25519_64BIT) -static uint64_t load_8(const uint8_t *in) { - uint64_t result; - result = (uint64_t)in[0]; - result |= ((uint64_t)in[1]) << 8; - result |= ((uint64_t)in[2]) << 16; - result |= ((uint64_t)in[3]) << 24; - result |= ((uint64_t)in[4]) << 32; - result |= ((uint64_t)in[5]) << 40; - result |= ((uint64_t)in[6]) << 48; - result |= ((uint64_t)in[7]) << 56; - return result; -} - -static uint8_t /*bool*/ addcarryx_u51(uint8_t /*bool*/ c, uint64_t a, - uint64_t b, uint64_t *low) { - // This function extracts 51 bits of result and 1 bit of carry (52 total), so - // a 64-bit intermediate is sufficient. - uint64_t x = a + b + c; - *low = x & ((UINT64_C(1) << 51) - 1); - return (x >> 51) & 1; -} - -static uint8_t /*bool*/ subborrow_u51(uint8_t /*bool*/ c, uint64_t a, - uint64_t b, uint64_t *low) { - // This function extracts 51 bits of result and 1 bit of borrow (52 total), so - // a 64-bit intermediate is sufficient. - uint64_t x = a - b - c; - *low = x & ((UINT64_C(1) << 51) - 1); - return x >> 63; -} - -static uint64_t cmovznz64(uint64_t t, uint64_t z, uint64_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#else - -static uint8_t /*bool*/ addcarryx_u25(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 25 bits of result and 1 bit of carry (26 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a + b + c; - *low = x & ((1 << 25) - 1); - return (x >> 25) & 1; -} - -static uint8_t /*bool*/ addcarryx_u26(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 26 bits of result and 1 bit of carry (27 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a + b + c; - *low = x & ((1 << 26) - 1); - return (x >> 26) & 1; -} - -static uint8_t /*bool*/ subborrow_u25(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 25 bits of result and 1 bit of borrow (26 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a - b - c; - *low = x & ((1 << 25) - 1); - return x >> 31; -} - -static uint8_t /*bool*/ subborrow_u26(uint8_t /*bool*/ c, uint32_t a, - uint32_t b, uint32_t *low) { - // This function extracts 26 bits of result and 1 bit of borrow (27 total), so - // a 32-bit intermediate is sufficient. - uint32_t x = a - b - c; - *low = x & ((1 << 26) - 1); - return x >> 31; -} - -static uint32_t cmovznz32(uint32_t t, uint32_t z, uint32_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#endif - - -// Field operations. - -#if defined(BORINGSSL_CURVE25519_64BIT) - -#define assert_fe(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 5; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 1.125*(UINT64_C(1)<<51)); \ - } \ -} while (0) - -#define assert_fe_loose(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 5; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 3.375*(UINT64_C(1)<<51)); \ - } \ -} while (0) - -#define assert_fe_frozen(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 5; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < (UINT64_C(1)<<51)); \ - } \ -} while (0) - -static void fe_frombytes_impl(uint64_t h[5], const uint8_t *s) { - // Ignores top bit of s. - uint64_t a0 = load_8(s); - uint64_t a1 = load_8(s+8); - uint64_t a2 = load_8(s+16); - uint64_t a3 = load_8(s+24); - // Use 51 bits, 64-51 = 13 left. - h[0] = a0 & ((UINT64_C(1) << 51) - 1); - // (64-51) + 38 = 13 + 38 = 51 - h[1] = (a0 >> 51) | ((a1 & ((UINT64_C(1) << 38) - 1)) << 13); - // (64-38) + 25 = 26 + 25 = 51 - h[2] = (a1 >> 38) | ((a2 & ((UINT64_C(1) << 25) - 1)) << 26); - // (64-25) + 12 = 39 + 12 = 51 - h[3] = (a2 >> 25) | ((a3 & ((UINT64_C(1) << 12) - 1)) << 39); - // (64-12) = 52, ignore top bit - h[4] = (a3 >> 12) & ((UINT64_C(1) << 51) - 1); - assert_fe(h); -} - -static void fe_frombytes(fe *h, const uint8_t *s) { - fe_frombytes_impl(h->v, s); -} - -static void fe_freeze(uint64_t out[5], const uint64_t in1[5]) { - { const uint64_t x7 = in1[4]; - { const uint64_t x8 = in1[3]; - { const uint64_t x6 = in1[2]; - { const uint64_t x4 = in1[1]; - { const uint64_t x2 = in1[0]; - { uint64_t x10; uint8_t/*bool*/ x11 = subborrow_u51(0x0, x2, 0x7ffffffffffed, &x10); - { uint64_t x13; uint8_t/*bool*/ x14 = subborrow_u51(x11, x4, 0x7ffffffffffff, &x13); - { uint64_t x16; uint8_t/*bool*/ x17 = subborrow_u51(x14, x6, 0x7ffffffffffff, &x16); - { uint64_t x19; uint8_t/*bool*/ x20 = subborrow_u51(x17, x8, 0x7ffffffffffff, &x19); - { uint64_t x22; uint8_t/*bool*/ x23 = subborrow_u51(x20, x7, 0x7ffffffffffff, &x22); - { uint64_t x24 = cmovznz64(x23, 0x0, 0xffffffffffffffffL); - { uint64_t x25 = (x24 & 0x7ffffffffffed); - { uint64_t x27; uint8_t/*bool*/ x28 = addcarryx_u51(0x0, x10, x25, &x27); - { uint64_t x29 = (x24 & 0x7ffffffffffff); - { uint64_t x31; uint8_t/*bool*/ x32 = addcarryx_u51(x28, x13, x29, &x31); - { uint64_t x33 = (x24 & 0x7ffffffffffff); - { uint64_t x35; uint8_t/*bool*/ x36 = addcarryx_u51(x32, x16, x33, &x35); - { uint64_t x37 = (x24 & 0x7ffffffffffff); - { uint64_t x39; uint8_t/*bool*/ x40 = addcarryx_u51(x36, x19, x37, &x39); - { uint64_t x41 = (x24 & 0x7ffffffffffff); - { uint64_t x43; addcarryx_u51(x40, x22, x41, &x43); - out[0] = x27; - out[1] = x31; - out[2] = x35; - out[3] = x39; - out[4] = x43; - }}}}}}}}}}}}}}}}}}}}} -} - -static void fe_tobytes(uint8_t s[32], const fe *f) { - assert_fe(f->v); - uint64_t h[5]; - fe_freeze(h, f->v); - assert_fe_frozen(h); - - s[0] = h[0] >> 0; - s[1] = h[0] >> 8; - s[2] = h[0] >> 16; - s[3] = h[0] >> 24; - s[4] = h[0] >> 32; - s[5] = h[0] >> 40; - s[6] = (h[0] >> 48) | (h[1] << 3); - s[7] = h[1] >> 5; - s[8] = h[1] >> 13; - s[9] = h[1] >> 21; - s[10] = h[1] >> 29; - s[11] = h[1] >> 37; - s[12] = (h[1] >> 45) | (h[2] << 6); - s[13] = h[2] >> 2; - s[14] = h[2] >> 10; - s[15] = h[2] >> 18; - s[16] = h[2] >> 26; - s[17] = h[2] >> 34; - s[18] = h[2] >> 42; - s[19] = (h[2] >> 50) | (h[3] << 1); - s[20] = h[3] >> 7; - s[21] = h[3] >> 15; - s[22] = h[3] >> 23; - s[23] = h[3] >> 31; - s[24] = h[3] >> 39; - s[25] = (h[3] >> 47) | (h[4] << 4); - s[26] = h[4] >> 4; - s[27] = h[4] >> 12; - s[28] = h[4] >> 20; - s[29] = h[4] >> 28; - s[30] = h[4] >> 36; - s[31] = h[4] >> 44; -} - -// h = 0 -static void fe_0(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); -} - -static void fe_loose_0(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); -} - -// h = 1 -static void fe_1(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); - h->v[0] = 1; -} - -static void fe_loose_1(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); - h->v[0] = 1; -} - -static void fe_add_impl(uint64_t out[5], const uint64_t in1[5], const uint64_t in2[5]) { - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - out[0] = (x5 + x13); - out[1] = (x7 + x15); - out[2] = (x9 + x17); - out[3] = (x11 + x19); - out[4] = (x10 + x18); - }}}}}}}}}} -} - -// h = f + g -// Can overlap h with f or g. -static void fe_add(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_add_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_sub_impl(uint64_t out[5], const uint64_t in1[5], const uint64_t in2[5]) { - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - out[0] = ((0xfffffffffffda + x5) - x13); - out[1] = ((0xffffffffffffe + x7) - x15); - out[2] = ((0xffffffffffffe + x9) - x17); - out[3] = ((0xffffffffffffe + x11) - x19); - out[4] = ((0xffffffffffffe + x10) - x18); - }}}}}}}}}} -} - -// h = f - g -// Can overlap h with f or g. -static void fe_sub(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_sub_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_carry_impl(uint64_t out[5], const uint64_t in1[5]) { - { const uint64_t x7 = in1[4]; - { const uint64_t x8 = in1[3]; - { const uint64_t x6 = in1[2]; - { const uint64_t x4 = in1[1]; - { const uint64_t x2 = in1[0]; - { uint64_t x9 = (x2 >> 0x33); - { uint64_t x10 = (x2 & 0x7ffffffffffff); - { uint64_t x11 = (x9 + x4); - { uint64_t x12 = (x11 >> 0x33); - { uint64_t x13 = (x11 & 0x7ffffffffffff); - { uint64_t x14 = (x12 + x6); - { uint64_t x15 = (x14 >> 0x33); - { uint64_t x16 = (x14 & 0x7ffffffffffff); - { uint64_t x17 = (x15 + x8); - { uint64_t x18 = (x17 >> 0x33); - { uint64_t x19 = (x17 & 0x7ffffffffffff); - { uint64_t x20 = (x18 + x7); - { uint64_t x21 = (x20 >> 0x33); - { uint64_t x22 = (x20 & 0x7ffffffffffff); - { uint64_t x23 = (x10 + (0x13 * x21)); - { uint64_t x24 = (x23 >> 0x33); - { uint64_t x25 = (x23 & 0x7ffffffffffff); - { uint64_t x26 = (x24 + x13); - { uint64_t x27 = (x26 >> 0x33); - { uint64_t x28 = (x26 & 0x7ffffffffffff); - out[0] = x25; - out[1] = x28; - out[2] = (x27 + x16); - out[3] = x19; - out[4] = x22; - }}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_carry(fe *h, const fe_loose* f) { - assert_fe_loose(f->v); - fe_carry_impl(h->v, f->v); - assert_fe(h->v); -} - -static void fe_mul_impl(uint64_t out[5], const uint64_t in1[5], const uint64_t in2[5]) { - assert_fe_loose(in1); - assert_fe_loose(in2); - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - { uint128_t x20 = ((uint128_t)x5 * x13); - { uint128_t x21 = (((uint128_t)x5 * x15) + ((uint128_t)x7 * x13)); - { uint128_t x22 = ((((uint128_t)x5 * x17) + ((uint128_t)x9 * x13)) + ((uint128_t)x7 * x15)); - { uint128_t x23 = (((((uint128_t)x5 * x19) + ((uint128_t)x11 * x13)) + ((uint128_t)x7 * x17)) + ((uint128_t)x9 * x15)); - { uint128_t x24 = ((((((uint128_t)x5 * x18) + ((uint128_t)x10 * x13)) + ((uint128_t)x11 * x15)) + ((uint128_t)x7 * x19)) + ((uint128_t)x9 * x17)); - { uint64_t x25 = (x10 * 0x13); - { uint64_t x26 = (x7 * 0x13); - { uint64_t x27 = (x9 * 0x13); - { uint64_t x28 = (x11 * 0x13); - { uint128_t x29 = ((((x20 + ((uint128_t)x25 * x15)) + ((uint128_t)x26 * x18)) + ((uint128_t)x27 * x19)) + ((uint128_t)x28 * x17)); - { uint128_t x30 = (((x21 + ((uint128_t)x25 * x17)) + ((uint128_t)x27 * x18)) + ((uint128_t)x28 * x19)); - { uint128_t x31 = ((x22 + ((uint128_t)x25 * x19)) + ((uint128_t)x28 * x18)); - { uint128_t x32 = (x23 + ((uint128_t)x25 * x18)); - { uint64_t x33 = (uint64_t) (x29 >> 0x33); - { uint64_t x34 = ((uint64_t)x29 & 0x7ffffffffffff); - { uint128_t x35 = (x33 + x30); - { uint64_t x36 = (uint64_t) (x35 >> 0x33); - { uint64_t x37 = ((uint64_t)x35 & 0x7ffffffffffff); - { uint128_t x38 = (x36 + x31); - { uint64_t x39 = (uint64_t) (x38 >> 0x33); - { uint64_t x40 = ((uint64_t)x38 & 0x7ffffffffffff); - { uint128_t x41 = (x39 + x32); - { uint64_t x42 = (uint64_t) (x41 >> 0x33); - { uint64_t x43 = ((uint64_t)x41 & 0x7ffffffffffff); - { uint128_t x44 = (x42 + x24); - { uint64_t x45 = (uint64_t) (x44 >> 0x33); - { uint64_t x46 = ((uint64_t)x44 & 0x7ffffffffffff); - { uint64_t x47 = (x34 + (0x13 * x45)); - { uint64_t x48 = (x47 >> 0x33); - { uint64_t x49 = (x47 & 0x7ffffffffffff); - { uint64_t x50 = (x48 + x37); - { uint64_t x51 = (x50 >> 0x33); - { uint64_t x52 = (x50 & 0x7ffffffffffff); - out[0] = x49; - out[1] = x52; - out[2] = (x51 + x40); - out[3] = x43; - out[4] = x46; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_mul_ltt(fe_loose *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_llt(fe_loose *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttt(fe *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tlt(fe *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttl(fe *h, const fe *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tll(fe *h, const fe_loose *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_sqr_impl(uint64_t out[5], const uint64_t in1[5]) { - assert_fe_loose(in1); - { const uint64_t x7 = in1[4]; - { const uint64_t x8 = in1[3]; - { const uint64_t x6 = in1[2]; - { const uint64_t x4 = in1[1]; - { const uint64_t x2 = in1[0]; - { uint64_t x9 = (x2 * 0x2); - { uint64_t x10 = (x4 * 0x2); - { uint64_t x11 = ((x6 * 0x2) * 0x13); - { uint64_t x12 = (x7 * 0x13); - { uint64_t x13 = (x12 * 0x2); - { uint128_t x14 = ((((uint128_t)x2 * x2) + ((uint128_t)x13 * x4)) + ((uint128_t)x11 * x8)); - { uint128_t x15 = ((((uint128_t)x9 * x4) + ((uint128_t)x13 * x6)) + ((uint128_t)x8 * (x8 * 0x13))); - { uint128_t x16 = ((((uint128_t)x9 * x6) + ((uint128_t)x4 * x4)) + ((uint128_t)x13 * x8)); - { uint128_t x17 = ((((uint128_t)x9 * x8) + ((uint128_t)x10 * x6)) + ((uint128_t)x7 * x12)); - { uint128_t x18 = ((((uint128_t)x9 * x7) + ((uint128_t)x10 * x8)) + ((uint128_t)x6 * x6)); - { uint64_t x19 = (uint64_t) (x14 >> 0x33); - { uint64_t x20 = ((uint64_t)x14 & 0x7ffffffffffff); - { uint128_t x21 = (x19 + x15); - { uint64_t x22 = (uint64_t) (x21 >> 0x33); - { uint64_t x23 = ((uint64_t)x21 & 0x7ffffffffffff); - { uint128_t x24 = (x22 + x16); - { uint64_t x25 = (uint64_t) (x24 >> 0x33); - { uint64_t x26 = ((uint64_t)x24 & 0x7ffffffffffff); - { uint128_t x27 = (x25 + x17); - { uint64_t x28 = (uint64_t) (x27 >> 0x33); - { uint64_t x29 = ((uint64_t)x27 & 0x7ffffffffffff); - { uint128_t x30 = (x28 + x18); - { uint64_t x31 = (uint64_t) (x30 >> 0x33); - { uint64_t x32 = ((uint64_t)x30 & 0x7ffffffffffff); - { uint64_t x33 = (x20 + (0x13 * x31)); - { uint64_t x34 = (x33 >> 0x33); - { uint64_t x35 = (x33 & 0x7ffffffffffff); - { uint64_t x36 = (x34 + x23); - { uint64_t x37 = (x36 >> 0x33); - { uint64_t x38 = (x36 & 0x7ffffffffffff); - out[0] = x35; - out[1] = x38; - out[2] = (x37 + x26); - out[3] = x29; - out[4] = x32; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_sq_tl(fe *h, const fe_loose *f) { - fe_sqr_impl(h->v, f->v); -} - -static void fe_sq_tt(fe *h, const fe *f) { - fe_sqr_impl(h->v, f->v); -} - -// Replace (f,g) with (g,f) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cswap(fe *f, fe *g, uint64_t b) { - b = 0-b; - for (unsigned i = 0; i < 5; i++) { - uint64_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - g->v[i] ^= x; - } -} - -// NOTE: based on fiat-crypto fe_mul, edited for in2=121666, 0, 0.. -static void fe_mul_121666_impl(uint64_t out[5], const uint64_t in1[5]) { - { const uint64_t x10 = in1[4]; - { const uint64_t x11 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x18 = 0; - { const uint64_t x19 = 0; - { const uint64_t x17 = 0; - { const uint64_t x15 = 0; - { const uint64_t x13 = 121666; - { uint128_t x20 = ((uint128_t)x5 * x13); - { uint128_t x21 = (((uint128_t)x5 * x15) + ((uint128_t)x7 * x13)); - { uint128_t x22 = ((((uint128_t)x5 * x17) + ((uint128_t)x9 * x13)) + ((uint128_t)x7 * x15)); - { uint128_t x23 = (((((uint128_t)x5 * x19) + ((uint128_t)x11 * x13)) + ((uint128_t)x7 * x17)) + ((uint128_t)x9 * x15)); - { uint128_t x24 = ((((((uint128_t)x5 * x18) + ((uint128_t)x10 * x13)) + ((uint128_t)x11 * x15)) + ((uint128_t)x7 * x19)) + ((uint128_t)x9 * x17)); - { uint64_t x25 = (x10 * 0x13); - { uint64_t x26 = (x7 * 0x13); - { uint64_t x27 = (x9 * 0x13); - { uint64_t x28 = (x11 * 0x13); - { uint128_t x29 = ((((x20 + ((uint128_t)x25 * x15)) + ((uint128_t)x26 * x18)) + ((uint128_t)x27 * x19)) + ((uint128_t)x28 * x17)); - { uint128_t x30 = (((x21 + ((uint128_t)x25 * x17)) + ((uint128_t)x27 * x18)) + ((uint128_t)x28 * x19)); - { uint128_t x31 = ((x22 + ((uint128_t)x25 * x19)) + ((uint128_t)x28 * x18)); - { uint128_t x32 = (x23 + ((uint128_t)x25 * x18)); - { uint64_t x33 = (uint64_t) (x29 >> 0x33); - { uint64_t x34 = ((uint64_t)x29 & 0x7ffffffffffff); - { uint128_t x35 = (x33 + x30); - { uint64_t x36 = (uint64_t) (x35 >> 0x33); - { uint64_t x37 = ((uint64_t)x35 & 0x7ffffffffffff); - { uint128_t x38 = (x36 + x31); - { uint64_t x39 = (uint64_t) (x38 >> 0x33); - { uint64_t x40 = ((uint64_t)x38 & 0x7ffffffffffff); - { uint128_t x41 = (x39 + x32); - { uint64_t x42 = (uint64_t) (x41 >> 0x33); - { uint64_t x43 = ((uint64_t)x41 & 0x7ffffffffffff); - { uint128_t x44 = (x42 + x24); - { uint64_t x45 = (uint64_t) (x44 >> 0x33); - { uint64_t x46 = ((uint64_t)x44 & 0x7ffffffffffff); - { uint64_t x47 = (x34 + (0x13 * x45)); - { uint64_t x48 = (x47 >> 0x33); - { uint64_t x49 = (x47 & 0x7ffffffffffff); - { uint64_t x50 = (x48 + x37); - { uint64_t x51 = (x50 >> 0x33); - { uint64_t x52 = (x50 & 0x7ffffffffffff); - out[0] = x49; - out[1] = x52; - out[2] = (x51 + x40); - out[3] = x43; - out[4] = x46; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_mul121666(fe *h, const fe_loose *f) { - assert_fe_loose(f->v); - fe_mul_121666_impl(h->v, f->v); - assert_fe(h->v); -} - -// Adapted from Fiat-synthesized |fe_sub_impl| with |out| = 0. -static void fe_neg_impl(uint64_t out[5], const uint64_t in2[5]) { - { const uint64_t x10 = 0; - { const uint64_t x11 = 0; - { const uint64_t x9 = 0; - { const uint64_t x7 = 0; - { const uint64_t x5 = 0; - { const uint64_t x18 = in2[4]; - { const uint64_t x19 = in2[3]; - { const uint64_t x17 = in2[2]; - { const uint64_t x15 = in2[1]; - { const uint64_t x13 = in2[0]; - out[0] = ((0xfffffffffffda + x5) - x13); - out[1] = ((0xffffffffffffe + x7) - x15); - out[2] = ((0xffffffffffffe + x9) - x17); - out[3] = ((0xffffffffffffe + x11) - x19); - out[4] = ((0xffffffffffffe + x10) - x18); - }}}}}}}}}} -} - -// h = -f -static void fe_neg(fe_loose *h, const fe *f) { - assert_fe(f->v); - fe_neg_impl(h->v, f->v); - assert_fe_loose(h->v); -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cmov(fe_loose *f, const fe_loose *g, uint64_t b) { - b = 0-b; - for (unsigned i = 0; i < 5; i++) { - uint64_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - } -} - -#else - -#define assert_fe(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 10; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 1.125*(1<<(26-(_assert_fe_i&1)))); \ - } \ -} while (0) - -#define assert_fe_loose(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 10; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < 3.375*(1<<(26-(_assert_fe_i&1)))); \ - } \ -} while (0) - -#define assert_fe_frozen(f) do { \ - for (unsigned _assert_fe_i = 0; _assert_fe_i< 10; _assert_fe_i++) { \ - assert(f[_assert_fe_i] < (1u<<(26-(_assert_fe_i&1)))); \ - } \ -} while (0) - -static void fe_frombytes_impl(uint32_t h[10], const uint8_t *s) { - // Ignores top bit of s. - uint32_t a0 = load_4(s); - uint32_t a1 = load_4(s+4); - uint32_t a2 = load_4(s+8); - uint32_t a3 = load_4(s+12); - uint32_t a4 = load_4(s+16); - uint32_t a5 = load_4(s+20); - uint32_t a6 = load_4(s+24); - uint32_t a7 = load_4(s+28); - h[0] = a0&((1<<26)-1); // 26 used, 32-26 left. 26 - h[1] = (a0>>26) | ((a1&((1<<19)-1))<< 6); // (32-26) + 19 = 6+19 = 25 - h[2] = (a1>>19) | ((a2&((1<<13)-1))<<13); // (32-19) + 13 = 13+13 = 26 - h[3] = (a2>>13) | ((a3&((1<< 6)-1))<<19); // (32-13) + 6 = 19+ 6 = 25 - h[4] = (a3>> 6); // (32- 6) = 26 - h[5] = a4&((1<<25)-1); // 25 - h[6] = (a4>>25) | ((a5&((1<<19)-1))<< 7); // (32-25) + 19 = 7+19 = 26 - h[7] = (a5>>19) | ((a6&((1<<12)-1))<<13); // (32-19) + 12 = 13+12 = 25 - h[8] = (a6>>12) | ((a7&((1<< 6)-1))<<20); // (32-12) + 6 = 20+ 6 = 26 - h[9] = (a7>> 6)&((1<<25)-1); // 25 - assert_fe(h); -} - -static void fe_frombytes(fe *h, const uint8_t *s) { - fe_frombytes_impl(h->v, s); -} - -static void fe_freeze(uint32_t out[10], const uint32_t in1[10]) { - { const uint32_t x17 = in1[9]; - { const uint32_t x18 = in1[8]; - { const uint32_t x16 = in1[7]; - { const uint32_t x14 = in1[6]; - { const uint32_t x12 = in1[5]; - { const uint32_t x10 = in1[4]; - { const uint32_t x8 = in1[3]; - { const uint32_t x6 = in1[2]; - { const uint32_t x4 = in1[1]; - { const uint32_t x2 = in1[0]; - { uint32_t x20; uint8_t/*bool*/ x21 = subborrow_u26(0x0, x2, 0x3ffffed, &x20); - { uint32_t x23; uint8_t/*bool*/ x24 = subborrow_u25(x21, x4, 0x1ffffff, &x23); - { uint32_t x26; uint8_t/*bool*/ x27 = subborrow_u26(x24, x6, 0x3ffffff, &x26); - { uint32_t x29; uint8_t/*bool*/ x30 = subborrow_u25(x27, x8, 0x1ffffff, &x29); - { uint32_t x32; uint8_t/*bool*/ x33 = subborrow_u26(x30, x10, 0x3ffffff, &x32); - { uint32_t x35; uint8_t/*bool*/ x36 = subborrow_u25(x33, x12, 0x1ffffff, &x35); - { uint32_t x38; uint8_t/*bool*/ x39 = subborrow_u26(x36, x14, 0x3ffffff, &x38); - { uint32_t x41; uint8_t/*bool*/ x42 = subborrow_u25(x39, x16, 0x1ffffff, &x41); - { uint32_t x44; uint8_t/*bool*/ x45 = subborrow_u26(x42, x18, 0x3ffffff, &x44); - { uint32_t x47; uint8_t/*bool*/ x48 = subborrow_u25(x45, x17, 0x1ffffff, &x47); - { uint32_t x49 = cmovznz32(x48, 0x0, 0xffffffff); - { uint32_t x50 = (x49 & 0x3ffffed); - { uint32_t x52; uint8_t/*bool*/ x53 = addcarryx_u26(0x0, x20, x50, &x52); - { uint32_t x54 = (x49 & 0x1ffffff); - { uint32_t x56; uint8_t/*bool*/ x57 = addcarryx_u25(x53, x23, x54, &x56); - { uint32_t x58 = (x49 & 0x3ffffff); - { uint32_t x60; uint8_t/*bool*/ x61 = addcarryx_u26(x57, x26, x58, &x60); - { uint32_t x62 = (x49 & 0x1ffffff); - { uint32_t x64; uint8_t/*bool*/ x65 = addcarryx_u25(x61, x29, x62, &x64); - { uint32_t x66 = (x49 & 0x3ffffff); - { uint32_t x68; uint8_t/*bool*/ x69 = addcarryx_u26(x65, x32, x66, &x68); - { uint32_t x70 = (x49 & 0x1ffffff); - { uint32_t x72; uint8_t/*bool*/ x73 = addcarryx_u25(x69, x35, x70, &x72); - { uint32_t x74 = (x49 & 0x3ffffff); - { uint32_t x76; uint8_t/*bool*/ x77 = addcarryx_u26(x73, x38, x74, &x76); - { uint32_t x78 = (x49 & 0x1ffffff); - { uint32_t x80; uint8_t/*bool*/ x81 = addcarryx_u25(x77, x41, x78, &x80); - { uint32_t x82 = (x49 & 0x3ffffff); - { uint32_t x84; uint8_t/*bool*/ x85 = addcarryx_u26(x81, x44, x82, &x84); - { uint32_t x86 = (x49 & 0x1ffffff); - { uint32_t x88; addcarryx_u25(x85, x47, x86, &x88); - out[0] = x52; - out[1] = x56; - out[2] = x60; - out[3] = x64; - out[4] = x68; - out[5] = x72; - out[6] = x76; - out[7] = x80; - out[8] = x84; - out[9] = x88; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_tobytes(uint8_t s[32], const fe *f) { - assert_fe(f->v); - uint32_t h[10]; - fe_freeze(h, f->v); - assert_fe_frozen(h); - - s[0] = h[0] >> 0; - s[1] = h[0] >> 8; - s[2] = h[0] >> 16; - s[3] = (h[0] >> 24) | (h[1] << 2); - s[4] = h[1] >> 6; - s[5] = h[1] >> 14; - s[6] = (h[1] >> 22) | (h[2] << 3); - s[7] = h[2] >> 5; - s[8] = h[2] >> 13; - s[9] = (h[2] >> 21) | (h[3] << 5); - s[10] = h[3] >> 3; - s[11] = h[3] >> 11; - s[12] = (h[3] >> 19) | (h[4] << 6); - s[13] = h[4] >> 2; - s[14] = h[4] >> 10; - s[15] = h[4] >> 18; - s[16] = h[5] >> 0; - s[17] = h[5] >> 8; - s[18] = h[5] >> 16; - s[19] = (h[5] >> 24) | (h[6] << 1); - s[20] = h[6] >> 7; - s[21] = h[6] >> 15; - s[22] = (h[6] >> 23) | (h[7] << 3); - s[23] = h[7] >> 5; - s[24] = h[7] >> 13; - s[25] = (h[7] >> 21) | (h[8] << 4); - s[26] = h[8] >> 4; - s[27] = h[8] >> 12; - s[28] = (h[8] >> 20) | (h[9] << 6); - s[29] = h[9] >> 2; - s[30] = h[9] >> 10; - s[31] = h[9] >> 18; -} - -// h = 0 -static void fe_0(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); -} - -static void fe_loose_0(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); -} - -// h = 1 -static void fe_1(fe *h) { - OPENSSL_memset(h, 0, sizeof(fe)); - h->v[0] = 1; -} - -static void fe_loose_1(fe_loose *h) { - OPENSSL_memset(h, 0, sizeof(fe_loose)); - h->v[0] = 1; -} - -static void fe_add_impl(uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10]) { - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - out[0] = (x5 + x23); - out[1] = (x7 + x25); - out[2] = (x9 + x27); - out[3] = (x11 + x29); - out[4] = (x13 + x31); - out[5] = (x15 + x33); - out[6] = (x17 + x35); - out[7] = (x19 + x37); - out[8] = (x21 + x39); - out[9] = (x20 + x38); - }}}}}}}}}}}}}}}}}}}} -} - -// h = f + g -// Can overlap h with f or g. -static void fe_add(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_add_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_sub_impl(uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10]) { - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - out[0] = ((0x7ffffda + x5) - x23); - out[1] = ((0x3fffffe + x7) - x25); - out[2] = ((0x7fffffe + x9) - x27); - out[3] = ((0x3fffffe + x11) - x29); - out[4] = ((0x7fffffe + x13) - x31); - out[5] = ((0x3fffffe + x15) - x33); - out[6] = ((0x7fffffe + x17) - x35); - out[7] = ((0x3fffffe + x19) - x37); - out[8] = ((0x7fffffe + x21) - x39); - out[9] = ((0x3fffffe + x20) - x38); - }}}}}}}}}}}}}}}}}}}} -} - -// h = f - g -// Can overlap h with f or g. -static void fe_sub(fe_loose *h, const fe *f, const fe *g) { - assert_fe(f->v); - assert_fe(g->v); - fe_sub_impl(h->v, f->v, g->v); - assert_fe_loose(h->v); -} - -static void fe_carry_impl(uint32_t out[10], const uint32_t in1[10]) { - { const uint32_t x17 = in1[9]; - { const uint32_t x18 = in1[8]; - { const uint32_t x16 = in1[7]; - { const uint32_t x14 = in1[6]; - { const uint32_t x12 = in1[5]; - { const uint32_t x10 = in1[4]; - { const uint32_t x8 = in1[3]; - { const uint32_t x6 = in1[2]; - { const uint32_t x4 = in1[1]; - { const uint32_t x2 = in1[0]; - { uint32_t x19 = (x2 >> 0x1a); - { uint32_t x20 = (x2 & 0x3ffffff); - { uint32_t x21 = (x19 + x4); - { uint32_t x22 = (x21 >> 0x19); - { uint32_t x23 = (x21 & 0x1ffffff); - { uint32_t x24 = (x22 + x6); - { uint32_t x25 = (x24 >> 0x1a); - { uint32_t x26 = (x24 & 0x3ffffff); - { uint32_t x27 = (x25 + x8); - { uint32_t x28 = (x27 >> 0x19); - { uint32_t x29 = (x27 & 0x1ffffff); - { uint32_t x30 = (x28 + x10); - { uint32_t x31 = (x30 >> 0x1a); - { uint32_t x32 = (x30 & 0x3ffffff); - { uint32_t x33 = (x31 + x12); - { uint32_t x34 = (x33 >> 0x19); - { uint32_t x35 = (x33 & 0x1ffffff); - { uint32_t x36 = (x34 + x14); - { uint32_t x37 = (x36 >> 0x1a); - { uint32_t x38 = (x36 & 0x3ffffff); - { uint32_t x39 = (x37 + x16); - { uint32_t x40 = (x39 >> 0x19); - { uint32_t x41 = (x39 & 0x1ffffff); - { uint32_t x42 = (x40 + x18); - { uint32_t x43 = (x42 >> 0x1a); - { uint32_t x44 = (x42 & 0x3ffffff); - { uint32_t x45 = (x43 + x17); - { uint32_t x46 = (x45 >> 0x19); - { uint32_t x47 = (x45 & 0x1ffffff); - { uint32_t x48 = (x20 + (0x13 * x46)); - { uint32_t x49 = (x48 >> 0x1a); - { uint32_t x50 = (x48 & 0x3ffffff); - { uint32_t x51 = (x49 + x23); - { uint32_t x52 = (x51 >> 0x19); - { uint32_t x53 = (x51 & 0x1ffffff); - out[0] = x50; - out[1] = x53; - out[2] = (x52 + x26); - out[3] = x29; - out[4] = x32; - out[5] = x35; - out[6] = x38; - out[7] = x41; - out[8] = x44; - out[9] = x47; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_carry(fe *h, const fe_loose* f) { - assert_fe_loose(f->v); - fe_carry_impl(h->v, f->v); - assert_fe(h->v); -} - -static void fe_mul_impl(uint32_t out[10], const uint32_t in1[10], const uint32_t in2[10]) { - assert_fe_loose(in1); - assert_fe_loose(in2); - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - { uint64_t x40 = ((uint64_t)x23 * x5); - { uint64_t x41 = (((uint64_t)x23 * x7) + ((uint64_t)x25 * x5)); - { uint64_t x42 = ((((uint64_t)(0x2 * x25) * x7) + ((uint64_t)x23 * x9)) + ((uint64_t)x27 * x5)); - { uint64_t x43 = (((((uint64_t)x25 * x9) + ((uint64_t)x27 * x7)) + ((uint64_t)x23 * x11)) + ((uint64_t)x29 * x5)); - { uint64_t x44 = (((((uint64_t)x27 * x9) + (0x2 * (((uint64_t)x25 * x11) + ((uint64_t)x29 * x7)))) + ((uint64_t)x23 * x13)) + ((uint64_t)x31 * x5)); - { uint64_t x45 = (((((((uint64_t)x27 * x11) + ((uint64_t)x29 * x9)) + ((uint64_t)x25 * x13)) + ((uint64_t)x31 * x7)) + ((uint64_t)x23 * x15)) + ((uint64_t)x33 * x5)); - { uint64_t x46 = (((((0x2 * ((((uint64_t)x29 * x11) + ((uint64_t)x25 * x15)) + ((uint64_t)x33 * x7))) + ((uint64_t)x27 * x13)) + ((uint64_t)x31 * x9)) + ((uint64_t)x23 * x17)) + ((uint64_t)x35 * x5)); - { uint64_t x47 = (((((((((uint64_t)x29 * x13) + ((uint64_t)x31 * x11)) + ((uint64_t)x27 * x15)) + ((uint64_t)x33 * x9)) + ((uint64_t)x25 * x17)) + ((uint64_t)x35 * x7)) + ((uint64_t)x23 * x19)) + ((uint64_t)x37 * x5)); - { uint64_t x48 = (((((((uint64_t)x31 * x13) + (0x2 * (((((uint64_t)x29 * x15) + ((uint64_t)x33 * x11)) + ((uint64_t)x25 * x19)) + ((uint64_t)x37 * x7)))) + ((uint64_t)x27 * x17)) + ((uint64_t)x35 * x9)) + ((uint64_t)x23 * x21)) + ((uint64_t)x39 * x5)); - { uint64_t x49 = (((((((((((uint64_t)x31 * x15) + ((uint64_t)x33 * x13)) + ((uint64_t)x29 * x17)) + ((uint64_t)x35 * x11)) + ((uint64_t)x27 * x19)) + ((uint64_t)x37 * x9)) + ((uint64_t)x25 * x21)) + ((uint64_t)x39 * x7)) + ((uint64_t)x23 * x20)) + ((uint64_t)x38 * x5)); - { uint64_t x50 = (((((0x2 * ((((((uint64_t)x33 * x15) + ((uint64_t)x29 * x19)) + ((uint64_t)x37 * x11)) + ((uint64_t)x25 * x20)) + ((uint64_t)x38 * x7))) + ((uint64_t)x31 * x17)) + ((uint64_t)x35 * x13)) + ((uint64_t)x27 * x21)) + ((uint64_t)x39 * x9)); - { uint64_t x51 = (((((((((uint64_t)x33 * x17) + ((uint64_t)x35 * x15)) + ((uint64_t)x31 * x19)) + ((uint64_t)x37 * x13)) + ((uint64_t)x29 * x21)) + ((uint64_t)x39 * x11)) + ((uint64_t)x27 * x20)) + ((uint64_t)x38 * x9)); - { uint64_t x52 = (((((uint64_t)x35 * x17) + (0x2 * (((((uint64_t)x33 * x19) + ((uint64_t)x37 * x15)) + ((uint64_t)x29 * x20)) + ((uint64_t)x38 * x11)))) + ((uint64_t)x31 * x21)) + ((uint64_t)x39 * x13)); - { uint64_t x53 = (((((((uint64_t)x35 * x19) + ((uint64_t)x37 * x17)) + ((uint64_t)x33 * x21)) + ((uint64_t)x39 * x15)) + ((uint64_t)x31 * x20)) + ((uint64_t)x38 * x13)); - { uint64_t x54 = (((0x2 * ((((uint64_t)x37 * x19) + ((uint64_t)x33 * x20)) + ((uint64_t)x38 * x15))) + ((uint64_t)x35 * x21)) + ((uint64_t)x39 * x17)); - { uint64_t x55 = (((((uint64_t)x37 * x21) + ((uint64_t)x39 * x19)) + ((uint64_t)x35 * x20)) + ((uint64_t)x38 * x17)); - { uint64_t x56 = (((uint64_t)x39 * x21) + (0x2 * (((uint64_t)x37 * x20) + ((uint64_t)x38 * x19)))); - { uint64_t x57 = (((uint64_t)x39 * x20) + ((uint64_t)x38 * x21)); - { uint64_t x58 = ((uint64_t)(0x2 * x38) * x20); - { uint64_t x59 = (x48 + (x58 << 0x4)); - { uint64_t x60 = (x59 + (x58 << 0x1)); - { uint64_t x61 = (x60 + x58); - { uint64_t x62 = (x47 + (x57 << 0x4)); - { uint64_t x63 = (x62 + (x57 << 0x1)); - { uint64_t x64 = (x63 + x57); - { uint64_t x65 = (x46 + (x56 << 0x4)); - { uint64_t x66 = (x65 + (x56 << 0x1)); - { uint64_t x67 = (x66 + x56); - { uint64_t x68 = (x45 + (x55 << 0x4)); - { uint64_t x69 = (x68 + (x55 << 0x1)); - { uint64_t x70 = (x69 + x55); - { uint64_t x71 = (x44 + (x54 << 0x4)); - { uint64_t x72 = (x71 + (x54 << 0x1)); - { uint64_t x73 = (x72 + x54); - { uint64_t x74 = (x43 + (x53 << 0x4)); - { uint64_t x75 = (x74 + (x53 << 0x1)); - { uint64_t x76 = (x75 + x53); - { uint64_t x77 = (x42 + (x52 << 0x4)); - { uint64_t x78 = (x77 + (x52 << 0x1)); - { uint64_t x79 = (x78 + x52); - { uint64_t x80 = (x41 + (x51 << 0x4)); - { uint64_t x81 = (x80 + (x51 << 0x1)); - { uint64_t x82 = (x81 + x51); - { uint64_t x83 = (x40 + (x50 << 0x4)); - { uint64_t x84 = (x83 + (x50 << 0x1)); - { uint64_t x85 = (x84 + x50); - { uint64_t x86 = (x85 >> 0x1a); - { uint32_t x87 = ((uint32_t)x85 & 0x3ffffff); - { uint64_t x88 = (x86 + x82); - { uint64_t x89 = (x88 >> 0x19); - { uint32_t x90 = ((uint32_t)x88 & 0x1ffffff); - { uint64_t x91 = (x89 + x79); - { uint64_t x92 = (x91 >> 0x1a); - { uint32_t x93 = ((uint32_t)x91 & 0x3ffffff); - { uint64_t x94 = (x92 + x76); - { uint64_t x95 = (x94 >> 0x19); - { uint32_t x96 = ((uint32_t)x94 & 0x1ffffff); - { uint64_t x97 = (x95 + x73); - { uint64_t x98 = (x97 >> 0x1a); - { uint32_t x99 = ((uint32_t)x97 & 0x3ffffff); - { uint64_t x100 = (x98 + x70); - { uint64_t x101 = (x100 >> 0x19); - { uint32_t x102 = ((uint32_t)x100 & 0x1ffffff); - { uint64_t x103 = (x101 + x67); - { uint64_t x104 = (x103 >> 0x1a); - { uint32_t x105 = ((uint32_t)x103 & 0x3ffffff); - { uint64_t x106 = (x104 + x64); - { uint64_t x107 = (x106 >> 0x19); - { uint32_t x108 = ((uint32_t)x106 & 0x1ffffff); - { uint64_t x109 = (x107 + x61); - { uint64_t x110 = (x109 >> 0x1a); - { uint32_t x111 = ((uint32_t)x109 & 0x3ffffff); - { uint64_t x112 = (x110 + x49); - { uint64_t x113 = (x112 >> 0x19); - { uint32_t x114 = ((uint32_t)x112 & 0x1ffffff); - { uint64_t x115 = (x87 + (0x13 * x113)); - { uint32_t x116 = (uint32_t) (x115 >> 0x1a); - { uint32_t x117 = ((uint32_t)x115 & 0x3ffffff); - { uint32_t x118 = (x116 + x90); - { uint32_t x119 = (x118 >> 0x19); - { uint32_t x120 = (x118 & 0x1ffffff); - out[0] = x117; - out[1] = x120; - out[2] = (x119 + x93); - out[3] = x96; - out[4] = x99; - out[5] = x102; - out[6] = x105; - out[7] = x108; - out[8] = x111; - out[9] = x114; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_mul_ltt(fe_loose *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_llt(fe_loose *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttt(fe *h, const fe *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tlt(fe *h, const fe_loose *f, const fe *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_ttl(fe *h, const fe *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_mul_tll(fe *h, const fe_loose *f, const fe_loose *g) { - fe_mul_impl(h->v, f->v, g->v); -} - -static void fe_sqr_impl(uint32_t out[10], const uint32_t in1[10]) { - assert_fe_loose(in1); - { const uint32_t x17 = in1[9]; - { const uint32_t x18 = in1[8]; - { const uint32_t x16 = in1[7]; - { const uint32_t x14 = in1[6]; - { const uint32_t x12 = in1[5]; - { const uint32_t x10 = in1[4]; - { const uint32_t x8 = in1[3]; - { const uint32_t x6 = in1[2]; - { const uint32_t x4 = in1[1]; - { const uint32_t x2 = in1[0]; - { uint64_t x19 = ((uint64_t)x2 * x2); - { uint64_t x20 = ((uint64_t)(0x2 * x2) * x4); - { uint64_t x21 = (0x2 * (((uint64_t)x4 * x4) + ((uint64_t)x2 * x6))); - { uint64_t x22 = (0x2 * (((uint64_t)x4 * x6) + ((uint64_t)x2 * x8))); - { uint64_t x23 = ((((uint64_t)x6 * x6) + ((uint64_t)(0x4 * x4) * x8)) + ((uint64_t)(0x2 * x2) * x10)); - { uint64_t x24 = (0x2 * ((((uint64_t)x6 * x8) + ((uint64_t)x4 * x10)) + ((uint64_t)x2 * x12))); - { uint64_t x25 = (0x2 * (((((uint64_t)x8 * x8) + ((uint64_t)x6 * x10)) + ((uint64_t)x2 * x14)) + ((uint64_t)(0x2 * x4) * x12))); - { uint64_t x26 = (0x2 * (((((uint64_t)x8 * x10) + ((uint64_t)x6 * x12)) + ((uint64_t)x4 * x14)) + ((uint64_t)x2 * x16))); - { uint64_t x27 = (((uint64_t)x10 * x10) + (0x2 * ((((uint64_t)x6 * x14) + ((uint64_t)x2 * x18)) + (0x2 * (((uint64_t)x4 * x16) + ((uint64_t)x8 * x12)))))); - { uint64_t x28 = (0x2 * ((((((uint64_t)x10 * x12) + ((uint64_t)x8 * x14)) + ((uint64_t)x6 * x16)) + ((uint64_t)x4 * x18)) + ((uint64_t)x2 * x17))); - { uint64_t x29 = (0x2 * (((((uint64_t)x12 * x12) + ((uint64_t)x10 * x14)) + ((uint64_t)x6 * x18)) + (0x2 * (((uint64_t)x8 * x16) + ((uint64_t)x4 * x17))))); - { uint64_t x30 = (0x2 * (((((uint64_t)x12 * x14) + ((uint64_t)x10 * x16)) + ((uint64_t)x8 * x18)) + ((uint64_t)x6 * x17))); - { uint64_t x31 = (((uint64_t)x14 * x14) + (0x2 * (((uint64_t)x10 * x18) + (0x2 * (((uint64_t)x12 * x16) + ((uint64_t)x8 * x17)))))); - { uint64_t x32 = (0x2 * ((((uint64_t)x14 * x16) + ((uint64_t)x12 * x18)) + ((uint64_t)x10 * x17))); - { uint64_t x33 = (0x2 * ((((uint64_t)x16 * x16) + ((uint64_t)x14 * x18)) + ((uint64_t)(0x2 * x12) * x17))); - { uint64_t x34 = (0x2 * (((uint64_t)x16 * x18) + ((uint64_t)x14 * x17))); - { uint64_t x35 = (((uint64_t)x18 * x18) + ((uint64_t)(0x4 * x16) * x17)); - { uint64_t x36 = ((uint64_t)(0x2 * x18) * x17); - { uint64_t x37 = ((uint64_t)(0x2 * x17) * x17); - { uint64_t x38 = (x27 + (x37 << 0x4)); - { uint64_t x39 = (x38 + (x37 << 0x1)); - { uint64_t x40 = (x39 + x37); - { uint64_t x41 = (x26 + (x36 << 0x4)); - { uint64_t x42 = (x41 + (x36 << 0x1)); - { uint64_t x43 = (x42 + x36); - { uint64_t x44 = (x25 + (x35 << 0x4)); - { uint64_t x45 = (x44 + (x35 << 0x1)); - { uint64_t x46 = (x45 + x35); - { uint64_t x47 = (x24 + (x34 << 0x4)); - { uint64_t x48 = (x47 + (x34 << 0x1)); - { uint64_t x49 = (x48 + x34); - { uint64_t x50 = (x23 + (x33 << 0x4)); - { uint64_t x51 = (x50 + (x33 << 0x1)); - { uint64_t x52 = (x51 + x33); - { uint64_t x53 = (x22 + (x32 << 0x4)); - { uint64_t x54 = (x53 + (x32 << 0x1)); - { uint64_t x55 = (x54 + x32); - { uint64_t x56 = (x21 + (x31 << 0x4)); - { uint64_t x57 = (x56 + (x31 << 0x1)); - { uint64_t x58 = (x57 + x31); - { uint64_t x59 = (x20 + (x30 << 0x4)); - { uint64_t x60 = (x59 + (x30 << 0x1)); - { uint64_t x61 = (x60 + x30); - { uint64_t x62 = (x19 + (x29 << 0x4)); - { uint64_t x63 = (x62 + (x29 << 0x1)); - { uint64_t x64 = (x63 + x29); - { uint64_t x65 = (x64 >> 0x1a); - { uint32_t x66 = ((uint32_t)x64 & 0x3ffffff); - { uint64_t x67 = (x65 + x61); - { uint64_t x68 = (x67 >> 0x19); - { uint32_t x69 = ((uint32_t)x67 & 0x1ffffff); - { uint64_t x70 = (x68 + x58); - { uint64_t x71 = (x70 >> 0x1a); - { uint32_t x72 = ((uint32_t)x70 & 0x3ffffff); - { uint64_t x73 = (x71 + x55); - { uint64_t x74 = (x73 >> 0x19); - { uint32_t x75 = ((uint32_t)x73 & 0x1ffffff); - { uint64_t x76 = (x74 + x52); - { uint64_t x77 = (x76 >> 0x1a); - { uint32_t x78 = ((uint32_t)x76 & 0x3ffffff); - { uint64_t x79 = (x77 + x49); - { uint64_t x80 = (x79 >> 0x19); - { uint32_t x81 = ((uint32_t)x79 & 0x1ffffff); - { uint64_t x82 = (x80 + x46); - { uint64_t x83 = (x82 >> 0x1a); - { uint32_t x84 = ((uint32_t)x82 & 0x3ffffff); - { uint64_t x85 = (x83 + x43); - { uint64_t x86 = (x85 >> 0x19); - { uint32_t x87 = ((uint32_t)x85 & 0x1ffffff); - { uint64_t x88 = (x86 + x40); - { uint64_t x89 = (x88 >> 0x1a); - { uint32_t x90 = ((uint32_t)x88 & 0x3ffffff); - { uint64_t x91 = (x89 + x28); - { uint64_t x92 = (x91 >> 0x19); - { uint32_t x93 = ((uint32_t)x91 & 0x1ffffff); - { uint64_t x94 = (x66 + (0x13 * x92)); - { uint32_t x95 = (uint32_t) (x94 >> 0x1a); - { uint32_t x96 = ((uint32_t)x94 & 0x3ffffff); - { uint32_t x97 = (x95 + x69); - { uint32_t x98 = (x97 >> 0x19); - { uint32_t x99 = (x97 & 0x1ffffff); - out[0] = x96; - out[1] = x99; - out[2] = (x98 + x72); - out[3] = x75; - out[4] = x78; - out[5] = x81; - out[6] = x84; - out[7] = x87; - out[8] = x90; - out[9] = x93; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} - assert_fe(out); -} - -static void fe_sq_tl(fe *h, const fe_loose *f) { - fe_sqr_impl(h->v, f->v); -} - -static void fe_sq_tt(fe *h, const fe *f) { - fe_sqr_impl(h->v, f->v); -} - -// Replace (f,g) with (g,f) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cswap(fe *f, fe *g, unsigned int b) { - b = 0-b; - unsigned i; - for (i = 0; i < 10; i++) { - uint32_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - g->v[i] ^= x; - } -} - -// NOTE: based on fiat-crypto fe_mul, edited for in2=121666, 0, 0.. -static void fe_mul_121666_impl(uint32_t out[10], const uint32_t in1[10]) { - { const uint32_t x20 = in1[9]; - { const uint32_t x21 = in1[8]; - { const uint32_t x19 = in1[7]; - { const uint32_t x17 = in1[6]; - { const uint32_t x15 = in1[5]; - { const uint32_t x13 = in1[4]; - { const uint32_t x11 = in1[3]; - { const uint32_t x9 = in1[2]; - { const uint32_t x7 = in1[1]; - { const uint32_t x5 = in1[0]; - { const uint32_t x38 = 0; - { const uint32_t x39 = 0; - { const uint32_t x37 = 0; - { const uint32_t x35 = 0; - { const uint32_t x33 = 0; - { const uint32_t x31 = 0; - { const uint32_t x29 = 0; - { const uint32_t x27 = 0; - { const uint32_t x25 = 0; - { const uint32_t x23 = 121666; - { uint64_t x40 = ((uint64_t)x23 * x5); - { uint64_t x41 = (((uint64_t)x23 * x7) + ((uint64_t)x25 * x5)); - { uint64_t x42 = ((((uint64_t)(0x2 * x25) * x7) + ((uint64_t)x23 * x9)) + ((uint64_t)x27 * x5)); - { uint64_t x43 = (((((uint64_t)x25 * x9) + ((uint64_t)x27 * x7)) + ((uint64_t)x23 * x11)) + ((uint64_t)x29 * x5)); - { uint64_t x44 = (((((uint64_t)x27 * x9) + (0x2 * (((uint64_t)x25 * x11) + ((uint64_t)x29 * x7)))) + ((uint64_t)x23 * x13)) + ((uint64_t)x31 * x5)); - { uint64_t x45 = (((((((uint64_t)x27 * x11) + ((uint64_t)x29 * x9)) + ((uint64_t)x25 * x13)) + ((uint64_t)x31 * x7)) + ((uint64_t)x23 * x15)) + ((uint64_t)x33 * x5)); - { uint64_t x46 = (((((0x2 * ((((uint64_t)x29 * x11) + ((uint64_t)x25 * x15)) + ((uint64_t)x33 * x7))) + ((uint64_t)x27 * x13)) + ((uint64_t)x31 * x9)) + ((uint64_t)x23 * x17)) + ((uint64_t)x35 * x5)); - { uint64_t x47 = (((((((((uint64_t)x29 * x13) + ((uint64_t)x31 * x11)) + ((uint64_t)x27 * x15)) + ((uint64_t)x33 * x9)) + ((uint64_t)x25 * x17)) + ((uint64_t)x35 * x7)) + ((uint64_t)x23 * x19)) + ((uint64_t)x37 * x5)); - { uint64_t x48 = (((((((uint64_t)x31 * x13) + (0x2 * (((((uint64_t)x29 * x15) + ((uint64_t)x33 * x11)) + ((uint64_t)x25 * x19)) + ((uint64_t)x37 * x7)))) + ((uint64_t)x27 * x17)) + ((uint64_t)x35 * x9)) + ((uint64_t)x23 * x21)) + ((uint64_t)x39 * x5)); - { uint64_t x49 = (((((((((((uint64_t)x31 * x15) + ((uint64_t)x33 * x13)) + ((uint64_t)x29 * x17)) + ((uint64_t)x35 * x11)) + ((uint64_t)x27 * x19)) + ((uint64_t)x37 * x9)) + ((uint64_t)x25 * x21)) + ((uint64_t)x39 * x7)) + ((uint64_t)x23 * x20)) + ((uint64_t)x38 * x5)); - { uint64_t x50 = (((((0x2 * ((((((uint64_t)x33 * x15) + ((uint64_t)x29 * x19)) + ((uint64_t)x37 * x11)) + ((uint64_t)x25 * x20)) + ((uint64_t)x38 * x7))) + ((uint64_t)x31 * x17)) + ((uint64_t)x35 * x13)) + ((uint64_t)x27 * x21)) + ((uint64_t)x39 * x9)); - { uint64_t x51 = (((((((((uint64_t)x33 * x17) + ((uint64_t)x35 * x15)) + ((uint64_t)x31 * x19)) + ((uint64_t)x37 * x13)) + ((uint64_t)x29 * x21)) + ((uint64_t)x39 * x11)) + ((uint64_t)x27 * x20)) + ((uint64_t)x38 * x9)); - { uint64_t x52 = (((((uint64_t)x35 * x17) + (0x2 * (((((uint64_t)x33 * x19) + ((uint64_t)x37 * x15)) + ((uint64_t)x29 * x20)) + ((uint64_t)x38 * x11)))) + ((uint64_t)x31 * x21)) + ((uint64_t)x39 * x13)); - { uint64_t x53 = (((((((uint64_t)x35 * x19) + ((uint64_t)x37 * x17)) + ((uint64_t)x33 * x21)) + ((uint64_t)x39 * x15)) + ((uint64_t)x31 * x20)) + ((uint64_t)x38 * x13)); - { uint64_t x54 = (((0x2 * ((((uint64_t)x37 * x19) + ((uint64_t)x33 * x20)) + ((uint64_t)x38 * x15))) + ((uint64_t)x35 * x21)) + ((uint64_t)x39 * x17)); - { uint64_t x55 = (((((uint64_t)x37 * x21) + ((uint64_t)x39 * x19)) + ((uint64_t)x35 * x20)) + ((uint64_t)x38 * x17)); - { uint64_t x56 = (((uint64_t)x39 * x21) + (0x2 * (((uint64_t)x37 * x20) + ((uint64_t)x38 * x19)))); - { uint64_t x57 = (((uint64_t)x39 * x20) + ((uint64_t)x38 * x21)); - { uint64_t x58 = ((uint64_t)(0x2 * x38) * x20); - { uint64_t x59 = (x48 + (x58 << 0x4)); - { uint64_t x60 = (x59 + (x58 << 0x1)); - { uint64_t x61 = (x60 + x58); - { uint64_t x62 = (x47 + (x57 << 0x4)); - { uint64_t x63 = (x62 + (x57 << 0x1)); - { uint64_t x64 = (x63 + x57); - { uint64_t x65 = (x46 + (x56 << 0x4)); - { uint64_t x66 = (x65 + (x56 << 0x1)); - { uint64_t x67 = (x66 + x56); - { uint64_t x68 = (x45 + (x55 << 0x4)); - { uint64_t x69 = (x68 + (x55 << 0x1)); - { uint64_t x70 = (x69 + x55); - { uint64_t x71 = (x44 + (x54 << 0x4)); - { uint64_t x72 = (x71 + (x54 << 0x1)); - { uint64_t x73 = (x72 + x54); - { uint64_t x74 = (x43 + (x53 << 0x4)); - { uint64_t x75 = (x74 + (x53 << 0x1)); - { uint64_t x76 = (x75 + x53); - { uint64_t x77 = (x42 + (x52 << 0x4)); - { uint64_t x78 = (x77 + (x52 << 0x1)); - { uint64_t x79 = (x78 + x52); - { uint64_t x80 = (x41 + (x51 << 0x4)); - { uint64_t x81 = (x80 + (x51 << 0x1)); - { uint64_t x82 = (x81 + x51); - { uint64_t x83 = (x40 + (x50 << 0x4)); - { uint64_t x84 = (x83 + (x50 << 0x1)); - { uint64_t x85 = (x84 + x50); - { uint64_t x86 = (x85 >> 0x1a); - { uint32_t x87 = ((uint32_t)x85 & 0x3ffffff); - { uint64_t x88 = (x86 + x82); - { uint64_t x89 = (x88 >> 0x19); - { uint32_t x90 = ((uint32_t)x88 & 0x1ffffff); - { uint64_t x91 = (x89 + x79); - { uint64_t x92 = (x91 >> 0x1a); - { uint32_t x93 = ((uint32_t)x91 & 0x3ffffff); - { uint64_t x94 = (x92 + x76); - { uint64_t x95 = (x94 >> 0x19); - { uint32_t x96 = ((uint32_t)x94 & 0x1ffffff); - { uint64_t x97 = (x95 + x73); - { uint64_t x98 = (x97 >> 0x1a); - { uint32_t x99 = ((uint32_t)x97 & 0x3ffffff); - { uint64_t x100 = (x98 + x70); - { uint64_t x101 = (x100 >> 0x19); - { uint32_t x102 = ((uint32_t)x100 & 0x1ffffff); - { uint64_t x103 = (x101 + x67); - { uint64_t x104 = (x103 >> 0x1a); - { uint32_t x105 = ((uint32_t)x103 & 0x3ffffff); - { uint64_t x106 = (x104 + x64); - { uint64_t x107 = (x106 >> 0x19); - { uint32_t x108 = ((uint32_t)x106 & 0x1ffffff); - { uint64_t x109 = (x107 + x61); - { uint64_t x110 = (x109 >> 0x1a); - { uint32_t x111 = ((uint32_t)x109 & 0x3ffffff); - { uint64_t x112 = (x110 + x49); - { uint64_t x113 = (x112 >> 0x19); - { uint32_t x114 = ((uint32_t)x112 & 0x1ffffff); - { uint64_t x115 = (x87 + (0x13 * x113)); - { uint32_t x116 = (uint32_t) (x115 >> 0x1a); - { uint32_t x117 = ((uint32_t)x115 & 0x3ffffff); - { uint32_t x118 = (x116 + x90); - { uint32_t x119 = (x118 >> 0x19); - { uint32_t x120 = (x118 & 0x1ffffff); - out[0] = x117; - out[1] = x120; - out[2] = (x119 + x93); - out[3] = x96; - out[4] = x99; - out[5] = x102; - out[6] = x105; - out[7] = x108; - out[8] = x111; - out[9] = x114; - }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} -} - -static void fe_mul121666(fe *h, const fe_loose *f) { - assert_fe_loose(f->v); - fe_mul_121666_impl(h->v, f->v); - assert_fe(h->v); -} - -// Adapted from Fiat-synthesized |fe_sub_impl| with |out| = 0. -static void fe_neg_impl(uint32_t out[10], const uint32_t in2[10]) { - { const uint32_t x20 = 0; - { const uint32_t x21 = 0; - { const uint32_t x19 = 0; - { const uint32_t x17 = 0; - { const uint32_t x15 = 0; - { const uint32_t x13 = 0; - { const uint32_t x11 = 0; - { const uint32_t x9 = 0; - { const uint32_t x7 = 0; - { const uint32_t x5 = 0; - { const uint32_t x38 = in2[9]; - { const uint32_t x39 = in2[8]; - { const uint32_t x37 = in2[7]; - { const uint32_t x35 = in2[6]; - { const uint32_t x33 = in2[5]; - { const uint32_t x31 = in2[4]; - { const uint32_t x29 = in2[3]; - { const uint32_t x27 = in2[2]; - { const uint32_t x25 = in2[1]; - { const uint32_t x23 = in2[0]; - out[0] = ((0x7ffffda + x5) - x23); - out[1] = ((0x3fffffe + x7) - x25); - out[2] = ((0x7fffffe + x9) - x27); - out[3] = ((0x3fffffe + x11) - x29); - out[4] = ((0x7fffffe + x13) - x31); - out[5] = ((0x3fffffe + x15) - x33); - out[6] = ((0x7fffffe + x17) - x35); - out[7] = ((0x3fffffe + x19) - x37); - out[8] = ((0x7fffffe + x21) - x39); - out[9] = ((0x3fffffe + x20) - x38); - }}}}}}}}}}}}}}}}}}}} -} - -// h = -f -static void fe_neg(fe_loose *h, const fe *f) { - assert_fe(f->v); - fe_neg_impl(h->v, f->v); - assert_fe_loose(h->v); -} - -// Replace (f,g) with (g,g) if b == 1; -// replace (f,g) with (f,g) if b == 0. -// -// Preconditions: b in {0,1}. -static void fe_cmov(fe_loose *f, const fe_loose *g, unsigned b) { - b = 0-b; - unsigned i; - for (i = 0; i < 10; i++) { - uint32_t x = f->v[i] ^ g->v[i]; - x &= b; - f->v[i] ^= x; - } -} - -#endif // BORINGSSL_CURVE25519_64BIT - -// h = f -static void fe_copy(fe *h, const fe *f) { - OPENSSL_memmove(h, f, sizeof(fe)); -} - -static void fe_copy_lt(fe_loose *h, const fe *f) { - OPENSSL_COMPILE_ASSERT(sizeof(fe_loose) == sizeof(fe), - fe_and_fe_loose_mismatch); - OPENSSL_memmove(h, f, sizeof(fe)); -} -#if !defined(OPENSSL_SMALL) -static void fe_copy_ll(fe_loose *h, const fe_loose *f) { - OPENSSL_memmove(h, f, sizeof(fe_loose)); -} -#endif // !defined(OPENSSL_SMALL) - -static void fe_loose_invert(fe *out, const fe_loose *z) { - fe t0; - fe t1; - fe t2; - fe t3; - int i; - - fe_sq_tl(&t0, z); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 2; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_tlt(&t1, z, &t1); - fe_mul_ttt(&t0, &t0, &t1); - fe_sq_tt(&t2, &t0); - fe_mul_ttt(&t1, &t1, &t2); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 5; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t2, &t2, &t1); - fe_sq_tt(&t3, &t2); - for (i = 1; i < 20; ++i) { - fe_sq_tt(&t3, &t3); - } - fe_mul_ttt(&t2, &t3, &t2); - fe_sq_tt(&t2, &t2); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t2, &t2, &t1); - fe_sq_tt(&t3, &t2); - for (i = 1; i < 100; ++i) { - fe_sq_tt(&t3, &t3); - } - fe_mul_ttt(&t2, &t3, &t2); - fe_sq_tt(&t2, &t2); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t1, &t1); - for (i = 1; i < 5; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(out, &t1, &t0); -} - -static void fe_invert(fe *out, const fe *z) { - fe_loose l; - fe_copy_lt(&l, z); - fe_loose_invert(out, &l); -} - -// return 0 if f == 0 -// return 1 if f != 0 -static int fe_isnonzero(const fe_loose *f) { - fe tight; - fe_carry(&tight, f); - uint8_t s[32]; - fe_tobytes(s, &tight); - - static const uint8_t zero[32] = {0}; - return CRYPTO_memcmp(s, zero, sizeof(zero)) != 0; -} - -// return 1 if f is in {1,3,5,...,q-2} -// return 0 if f is in {0,2,4,...,q-1} -static int fe_isnegative(const fe *f) { - uint8_t s[32]; - fe_tobytes(s, f); - return s[0] & 1; -} - -static void fe_sq2_tt(fe *h, const fe *f) { - // h = f^2 - fe_sq_tt(h, f); - - // h = h + h - fe_loose tmp; - fe_add(&tmp, h, h); - fe_carry(h, &tmp); -} - -static void fe_pow22523(fe *out, const fe *z) { - fe t0; - fe t1; - fe t2; - int i; - - fe_sq_tt(&t0, z); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 2; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t1, z, &t1); - fe_mul_ttt(&t0, &t0, &t1); - fe_sq_tt(&t0, &t0); - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 5; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t1, &t1, &t0); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 20; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t1, &t1); - for (i = 1; i < 10; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t1, &t0); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t1, &t1, &t0); - fe_sq_tt(&t2, &t1); - for (i = 1; i < 100; ++i) { - fe_sq_tt(&t2, &t2); - } - fe_mul_ttt(&t1, &t2, &t1); - fe_sq_tt(&t1, &t1); - for (i = 1; i < 50; ++i) { - fe_sq_tt(&t1, &t1); - } - fe_mul_ttt(&t0, &t1, &t0); - fe_sq_tt(&t0, &t0); - for (i = 1; i < 2; ++i) { - fe_sq_tt(&t0, &t0); - } - fe_mul_ttt(out, &t0, z); -} - - -// Group operations. - -void x25519_ge_tobytes(uint8_t s[32], const ge_p2 *h) { - fe recip; - fe x; - fe y; - - fe_invert(&recip, &h->Z); - fe_mul_ttt(&x, &h->X, &recip); - fe_mul_ttt(&y, &h->Y, &recip); - fe_tobytes(s, &y); - s[31] ^= fe_isnegative(&x) << 7; -} - -static void ge_p3_tobytes(uint8_t s[32], const ge_p3 *h) { - fe recip; - fe x; - fe y; - - fe_invert(&recip, &h->Z); - fe_mul_ttt(&x, &h->X, &recip); - fe_mul_ttt(&y, &h->Y, &recip); - fe_tobytes(s, &y); - s[31] ^= fe_isnegative(&x) << 7; -} - -int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s) { - fe u; - fe_loose v; - fe v3; - fe vxx; - fe_loose check; - - fe_frombytes(&h->Y, s); - fe_1(&h->Z); - fe_sq_tt(&v3, &h->Y); - fe_mul_ttt(&vxx, &v3, &d); - fe_sub(&v, &v3, &h->Z); // u = y^2-1 - fe_carry(&u, &v); - fe_add(&v, &vxx, &h->Z); // v = dy^2+1 - - fe_sq_tl(&v3, &v); - fe_mul_ttl(&v3, &v3, &v); // v3 = v^3 - fe_sq_tt(&h->X, &v3); - fe_mul_ttl(&h->X, &h->X, &v); - fe_mul_ttt(&h->X, &h->X, &u); // x = uv^7 - - fe_pow22523(&h->X, &h->X); // x = (uv^7)^((q-5)/8) - fe_mul_ttt(&h->X, &h->X, &v3); - fe_mul_ttt(&h->X, &h->X, &u); // x = uv^3(uv^7)^((q-5)/8) - - fe_sq_tt(&vxx, &h->X); - fe_mul_ttl(&vxx, &vxx, &v); - fe_sub(&check, &vxx, &u); - if (fe_isnonzero(&check)) { - fe_add(&check, &vxx, &u); - if (fe_isnonzero(&check)) { - return -1; - } - fe_mul_ttt(&h->X, &h->X, &sqrtm1); - } - - if (fe_isnegative(&h->X) != (s[31] >> 7)) { - fe_loose t; - fe_neg(&t, &h->X); - fe_carry(&h->X, &t); - } - - fe_mul_ttt(&h->T, &h->X, &h->Y); - return 0; -} - -static void ge_p2_0(ge_p2 *h) { - fe_0(&h->X); - fe_1(&h->Y); - fe_1(&h->Z); -} - -static void ge_p3_0(ge_p3 *h) { - fe_0(&h->X); - fe_1(&h->Y); - fe_1(&h->Z); - fe_0(&h->T); -} - -static void ge_cached_0(ge_cached *h) { - fe_loose_1(&h->YplusX); - fe_loose_1(&h->YminusX); - fe_loose_1(&h->Z); - fe_loose_0(&h->T2d); -} - -static void ge_precomp_0(ge_precomp *h) { - fe_loose_1(&h->yplusx); - fe_loose_1(&h->yminusx); - fe_loose_0(&h->xy2d); -} - -// r = p -static void ge_p3_to_p2(ge_p2 *r, const ge_p3 *p) { - fe_copy(&r->X, &p->X); - fe_copy(&r->Y, &p->Y); - fe_copy(&r->Z, &p->Z); -} - -// r = p -void x25519_ge_p3_to_cached(ge_cached *r, const ge_p3 *p) { - fe_add(&r->YplusX, &p->Y, &p->X); - fe_sub(&r->YminusX, &p->Y, &p->X); - fe_copy_lt(&r->Z, &p->Z); - fe_mul_ltt(&r->T2d, &p->T, &d2); -} - -// r = p -void x25519_ge_p1p1_to_p2(ge_p2 *r, const ge_p1p1 *p) { - fe_mul_tll(&r->X, &p->X, &p->T); - fe_mul_tll(&r->Y, &p->Y, &p->Z); - fe_mul_tll(&r->Z, &p->Z, &p->T); -} - -// r = p -void x25519_ge_p1p1_to_p3(ge_p3 *r, const ge_p1p1 *p) { - fe_mul_tll(&r->X, &p->X, &p->T); - fe_mul_tll(&r->Y, &p->Y, &p->Z); - fe_mul_tll(&r->Z, &p->Z, &p->T); - fe_mul_tll(&r->T, &p->X, &p->Y); -} - -// r = p -static void ge_p1p1_to_cached(ge_cached *r, const ge_p1p1 *p) { - ge_p3 t; - x25519_ge_p1p1_to_p3(&t, p); - x25519_ge_p3_to_cached(r, &t); -} - -// r = 2 * p -static void ge_p2_dbl(ge_p1p1 *r, const ge_p2 *p) { - fe trX, trZ, trT; - fe t0; - - fe_sq_tt(&trX, &p->X); - fe_sq_tt(&trZ, &p->Y); - fe_sq2_tt(&trT, &p->Z); - fe_add(&r->Y, &p->X, &p->Y); - fe_sq_tl(&t0, &r->Y); - - fe_add(&r->Y, &trZ, &trX); - fe_sub(&r->Z, &trZ, &trX); - fe_carry(&trZ, &r->Y); - fe_sub(&r->X, &t0, &trZ); - fe_carry(&trZ, &r->Z); - fe_sub(&r->T, &trT, &trZ); -} - -// r = 2 * p -static void ge_p3_dbl(ge_p1p1 *r, const ge_p3 *p) { - ge_p2 q; - ge_p3_to_p2(&q, p); - ge_p2_dbl(r, &q); -} - -// r = p + q -static void ge_madd(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { - fe trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->yplusx); - fe_mul_tll(&trY, &r->Y, &q->yminusx); - fe_mul_tlt(&trT, &q->xy2d, &p->T); - fe_add(&r->T, &p->Z, &p->Z); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_add(&r->Z, &trZ, &trT); - fe_sub(&r->T, &trZ, &trT); -} - -// r = p - q -static void ge_msub(ge_p1p1 *r, const ge_p3 *p, const ge_precomp *q) { - fe trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->yminusx); - fe_mul_tll(&trY, &r->Y, &q->yplusx); - fe_mul_tlt(&trT, &q->xy2d, &p->T); - fe_add(&r->T, &p->Z, &p->Z); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_sub(&r->Z, &trZ, &trT); - fe_add(&r->T, &trZ, &trT); -} - -// r = p + q -void x25519_ge_add(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { - fe trX, trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->YplusX); - fe_mul_tll(&trY, &r->Y, &q->YminusX); - fe_mul_tlt(&trT, &q->T2d, &p->T); - fe_mul_ttl(&trX, &p->Z, &q->Z); - fe_add(&r->T, &trX, &trX); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_add(&r->Z, &trZ, &trT); - fe_sub(&r->T, &trZ, &trT); -} - -// r = p - q -void x25519_ge_sub(ge_p1p1 *r, const ge_p3 *p, const ge_cached *q) { - fe trX, trY, trZ, trT; - - fe_add(&r->X, &p->Y, &p->X); - fe_sub(&r->Y, &p->Y, &p->X); - fe_mul_tll(&trZ, &r->X, &q->YminusX); - fe_mul_tll(&trY, &r->Y, &q->YplusX); - fe_mul_tlt(&trT, &q->T2d, &p->T); - fe_mul_ttl(&trX, &p->Z, &q->Z); - fe_add(&r->T, &trX, &trX); - fe_sub(&r->X, &trZ, &trY); - fe_add(&r->Y, &trZ, &trY); - fe_carry(&trZ, &r->T); - fe_sub(&r->Z, &trZ, &trT); - fe_add(&r->T, &trZ, &trT); -} - -static uint8_t equal(signed char b, signed char c) { - uint8_t ub = b; - uint8_t uc = c; - uint8_t x = ub ^ uc; // 0: yes; 1..255: no - uint32_t y = x; // 0: yes; 1..255: no - y -= 1; // 4294967295: yes; 0..254: no - y >>= 31; // 1: yes; 0: no - return y; -} - -static void cmov(ge_precomp *t, const ge_precomp *u, uint8_t b) { - fe_cmov(&t->yplusx, &u->yplusx, b); - fe_cmov(&t->yminusx, &u->yminusx, b); - fe_cmov(&t->xy2d, &u->xy2d, b); -} - -void x25519_ge_scalarmult_small_precomp( - ge_p3 *h, const uint8_t a[32], const uint8_t precomp_table[15 * 2 * 32]) { - // precomp_table is first expanded into matching |ge_precomp| - // elements. - ge_precomp multiples[15]; - - unsigned i; - for (i = 0; i < 15; i++) { - const uint8_t *bytes = &precomp_table[i*(2 * 32)]; - fe x, y; - fe_frombytes(&x, bytes); - fe_frombytes(&y, bytes + 32); - - ge_precomp *out = &multiples[i]; - fe_add(&out->yplusx, &y, &x); - fe_sub(&out->yminusx, &y, &x); - fe_mul_ltt(&out->xy2d, &x, &y); - fe_mul_llt(&out->xy2d, &out->xy2d, &d2); - } - - // See the comment above |k25519SmallPrecomp| about the structure of the - // precomputed elements. This loop does 64 additions and 64 doublings to - // calculate the result. - ge_p3_0(h); - - for (i = 63; i < 64; i--) { - unsigned j; - signed char index = 0; - - for (j = 0; j < 4; j++) { - const uint8_t bit = 1 & (a[(8 * j) + (i / 8)] >> (i & 7)); - index |= (bit << j); - } - - ge_precomp e; - ge_precomp_0(&e); - - for (j = 1; j < 16; j++) { - cmov(&e, &multiples[j-1], equal(index, j)); - } - - ge_cached cached; - ge_p1p1 r; - x25519_ge_p3_to_cached(&cached, h); - x25519_ge_add(&r, h, &cached); - x25519_ge_p1p1_to_p3(h, &r); - - ge_madd(&r, h, &e); - x25519_ge_p1p1_to_p3(h, &r); - } -} - -#if defined(OPENSSL_SMALL) - -void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]) { - x25519_ge_scalarmult_small_precomp(h, a, k25519SmallPrecomp); -} - -#else - -static uint8_t negative(signed char b) { - uint32_t x = b; - x >>= 31; // 1: yes; 0: no - return x; -} - -static void table_select(ge_precomp *t, int pos, signed char b) { - ge_precomp minust; - uint8_t bnegative = negative(b); - uint8_t babs = b - ((uint8_t)((-bnegative) & b) << 1); - - ge_precomp_0(t); - cmov(t, &k25519Precomp[pos][0], equal(babs, 1)); - cmov(t, &k25519Precomp[pos][1], equal(babs, 2)); - cmov(t, &k25519Precomp[pos][2], equal(babs, 3)); - cmov(t, &k25519Precomp[pos][3], equal(babs, 4)); - cmov(t, &k25519Precomp[pos][4], equal(babs, 5)); - cmov(t, &k25519Precomp[pos][5], equal(babs, 6)); - cmov(t, &k25519Precomp[pos][6], equal(babs, 7)); - cmov(t, &k25519Precomp[pos][7], equal(babs, 8)); - fe_copy_ll(&minust.yplusx, &t->yminusx); - fe_copy_ll(&minust.yminusx, &t->yplusx); - - // NOTE: the input table is canonical, but types don't encode it - fe tmp; - fe_carry(&tmp, &t->xy2d); - fe_neg(&minust.xy2d, &tmp); - - cmov(t, &minust, bnegative); -} - -// h = a * B -// where a = a[0]+256*a[1]+...+256^31 a[31] -// B is the Ed25519 base point (x,4/5) with x positive. -// -// Preconditions: -// a[31] <= 127 -void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) { - signed char e[64]; - signed char carry; - ge_p1p1 r; - ge_p2 s; - ge_precomp t; - int i; - - for (i = 0; i < 32; ++i) { - e[2 * i + 0] = (a[i] >> 0) & 15; - e[2 * i + 1] = (a[i] >> 4) & 15; - } - // each e[i] is between 0 and 15 - // e[63] is between 0 and 7 - - carry = 0; - for (i = 0; i < 63; ++i) { - e[i] += carry; - carry = e[i] + 8; - carry >>= 4; - e[i] -= carry << 4; - } - e[63] += carry; - // each e[i] is between -8 and 8 - - ge_p3_0(h); - for (i = 1; i < 64; i += 2) { - table_select(&t, i / 2, e[i]); - ge_madd(&r, h, &t); - x25519_ge_p1p1_to_p3(h, &r); - } - - ge_p3_dbl(&r, h); - x25519_ge_p1p1_to_p2(&s, &r); - ge_p2_dbl(&r, &s); - x25519_ge_p1p1_to_p2(&s, &r); - ge_p2_dbl(&r, &s); - x25519_ge_p1p1_to_p2(&s, &r); - ge_p2_dbl(&r, &s); - x25519_ge_p1p1_to_p3(h, &r); - - for (i = 0; i < 64; i += 2) { - table_select(&t, i / 2, e[i]); - ge_madd(&r, h, &t); - x25519_ge_p1p1_to_p3(h, &r); - } -} - -#endif - -static void cmov_cached(ge_cached *t, ge_cached *u, uint8_t b) { - fe_cmov(&t->YplusX, &u->YplusX, b); - fe_cmov(&t->YminusX, &u->YminusX, b); - fe_cmov(&t->Z, &u->Z, b); - fe_cmov(&t->T2d, &u->T2d, b); -} - -// r = scalar * A. -// where a = a[0]+256*a[1]+...+256^31 a[31]. -void x25519_ge_scalarmult(ge_p2 *r, const uint8_t *scalar, const ge_p3 *A) { - ge_p2 Ai_p2[8]; - ge_cached Ai[16]; - ge_p1p1 t; - - ge_cached_0(&Ai[0]); - x25519_ge_p3_to_cached(&Ai[1], A); - ge_p3_to_p2(&Ai_p2[1], A); - - unsigned i; - for (i = 2; i < 16; i += 2) { - ge_p2_dbl(&t, &Ai_p2[i / 2]); - ge_p1p1_to_cached(&Ai[i], &t); - if (i < 8) { - x25519_ge_p1p1_to_p2(&Ai_p2[i], &t); - } - x25519_ge_add(&t, A, &Ai[i]); - ge_p1p1_to_cached(&Ai[i + 1], &t); - if (i < 7) { - x25519_ge_p1p1_to_p2(&Ai_p2[i + 1], &t); - } - } - - ge_p2_0(r); - ge_p3 u; - - for (i = 0; i < 256; i += 4) { - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p2(r, &t); - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p2(r, &t); - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p2(r, &t); - ge_p2_dbl(&t, r); - x25519_ge_p1p1_to_p3(&u, &t); - - uint8_t index = scalar[31 - i/8]; - index >>= 4 - (i & 4); - index &= 0xf; - - unsigned j; - ge_cached selected; - ge_cached_0(&selected); - for (j = 0; j < 16; j++) { - cmov_cached(&selected, &Ai[j], equal(j, index)); - } - - x25519_ge_add(&t, &u, &selected); - x25519_ge_p1p1_to_p2(r, &t); - } -} - -static void slide(signed char *r, const uint8_t *a) { - int i; - int b; - int k; - - for (i = 0; i < 256; ++i) { - r[i] = 1 & (a[i >> 3] >> (i & 7)); - } - - for (i = 0; i < 256; ++i) { - if (r[i]) { - for (b = 1; b <= 6 && i + b < 256; ++b) { - if (r[i + b]) { - if (r[i] + (r[i + b] << b) <= 15) { - r[i] += r[i + b] << b; - r[i + b] = 0; - } else if (r[i] - (r[i + b] << b) >= -15) { - r[i] -= r[i + b] << b; - for (k = i + b; k < 256; ++k) { - if (!r[k]) { - r[k] = 1; - break; - } - r[k] = 0; - } - } else { - break; - } - } - } - } - } -} - -// r = a * A + b * B -// where a = a[0]+256*a[1]+...+256^31 a[31]. -// and b = b[0]+256*b[1]+...+256^31 b[31]. -// B is the Ed25519 base point (x,4/5) with x positive. -static void ge_double_scalarmult_vartime(ge_p2 *r, const uint8_t *a, - const ge_p3 *A, const uint8_t *b) { - signed char aslide[256]; - signed char bslide[256]; - ge_cached Ai[8]; // A,3A,5A,7A,9A,11A,13A,15A - ge_p1p1 t; - ge_p3 u; - ge_p3 A2; - int i; - - slide(aslide, a); - slide(bslide, b); - - x25519_ge_p3_to_cached(&Ai[0], A); - ge_p3_dbl(&t, A); - x25519_ge_p1p1_to_p3(&A2, &t); - x25519_ge_add(&t, &A2, &Ai[0]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[1], &u); - x25519_ge_add(&t, &A2, &Ai[1]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[2], &u); - x25519_ge_add(&t, &A2, &Ai[2]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[3], &u); - x25519_ge_add(&t, &A2, &Ai[3]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[4], &u); - x25519_ge_add(&t, &A2, &Ai[4]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[5], &u); - x25519_ge_add(&t, &A2, &Ai[5]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[6], &u); - x25519_ge_add(&t, &A2, &Ai[6]); - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_p3_to_cached(&Ai[7], &u); - - ge_p2_0(r); - - for (i = 255; i >= 0; --i) { - if (aslide[i] || bslide[i]) { - break; - } - } - - for (; i >= 0; --i) { - ge_p2_dbl(&t, r); - - if (aslide[i] > 0) { - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_add(&t, &u, &Ai[aslide[i] / 2]); - } else if (aslide[i] < 0) { - x25519_ge_p1p1_to_p3(&u, &t); - x25519_ge_sub(&t, &u, &Ai[(-aslide[i]) / 2]); - } - - if (bslide[i] > 0) { - x25519_ge_p1p1_to_p3(&u, &t); - ge_madd(&t, &u, &Bi[bslide[i] / 2]); - } else if (bslide[i] < 0) { - x25519_ge_p1p1_to_p3(&u, &t); - ge_msub(&t, &u, &Bi[(-bslide[i]) / 2]); - } - - x25519_ge_p1p1_to_p2(r, &t); - } -} - -// The set of scalars is \Z/l -// where l = 2^252 + 27742317777372353535851937790883648493. - -// Input: -// s[0]+256*s[1]+...+256^63*s[63] = s -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = s mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -// Overwrites s in place. -void x25519_sc_reduce(uint8_t s[64]) { - int64_t s0 = 2097151 & load_3(s); - int64_t s1 = 2097151 & (load_4(s + 2) >> 5); - int64_t s2 = 2097151 & (load_3(s + 5) >> 2); - int64_t s3 = 2097151 & (load_4(s + 7) >> 7); - int64_t s4 = 2097151 & (load_4(s + 10) >> 4); - int64_t s5 = 2097151 & (load_3(s + 13) >> 1); - int64_t s6 = 2097151 & (load_4(s + 15) >> 6); - int64_t s7 = 2097151 & (load_3(s + 18) >> 3); - int64_t s8 = 2097151 & load_3(s + 21); - int64_t s9 = 2097151 & (load_4(s + 23) >> 5); - int64_t s10 = 2097151 & (load_3(s + 26) >> 2); - int64_t s11 = 2097151 & (load_4(s + 28) >> 7); - int64_t s12 = 2097151 & (load_4(s + 31) >> 4); - int64_t s13 = 2097151 & (load_3(s + 34) >> 1); - int64_t s14 = 2097151 & (load_4(s + 36) >> 6); - int64_t s15 = 2097151 & (load_3(s + 39) >> 3); - int64_t s16 = 2097151 & load_3(s + 42); - int64_t s17 = 2097151 & (load_4(s + 44) >> 5); - int64_t s18 = 2097151 & (load_3(s + 47) >> 2); - int64_t s19 = 2097151 & (load_4(s + 49) >> 7); - int64_t s20 = 2097151 & (load_4(s + 52) >> 4); - int64_t s21 = 2097151 & (load_3(s + 55) >> 1); - int64_t s22 = 2097151 & (load_4(s + 57) >> 6); - int64_t s23 = (load_4(s + 60) >> 3); - int64_t carry0; - int64_t carry1; - int64_t carry2; - int64_t carry3; - int64_t carry4; - int64_t carry5; - int64_t carry6; - int64_t carry7; - int64_t carry8; - int64_t carry9; - int64_t carry10; - int64_t carry11; - int64_t carry12; - int64_t carry13; - int64_t carry14; - int64_t carry15; - int64_t carry16; - - s11 += s23 * 666643; - s12 += s23 * 470296; - s13 += s23 * 654183; - s14 -= s23 * 997805; - s15 += s23 * 136657; - s16 -= s23 * 683901; - s23 = 0; - - s10 += s22 * 666643; - s11 += s22 * 470296; - s12 += s22 * 654183; - s13 -= s22 * 997805; - s14 += s22 * 136657; - s15 -= s22 * 683901; - s22 = 0; - - s9 += s21 * 666643; - s10 += s21 * 470296; - s11 += s21 * 654183; - s12 -= s21 * 997805; - s13 += s21 * 136657; - s14 -= s21 * 683901; - s21 = 0; - - s8 += s20 * 666643; - s9 += s20 * 470296; - s10 += s20 * 654183; - s11 -= s20 * 997805; - s12 += s20 * 136657; - s13 -= s20 * 683901; - s20 = 0; - - s7 += s19 * 666643; - s8 += s19 * 470296; - s9 += s19 * 654183; - s10 -= s19 * 997805; - s11 += s19 * 136657; - s12 -= s19 * 683901; - s19 = 0; - - s6 += s18 * 666643; - s7 += s18 * 470296; - s8 += s18 * 654183; - s9 -= s18 * 997805; - s10 += s18 * 136657; - s11 -= s18 * 683901; - s18 = 0; - - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry12 = (s12 + (1 << 20)) >> 21; - s13 += carry12; - s12 -= carry12 << 21; - carry14 = (s14 + (1 << 20)) >> 21; - s15 += carry14; - s14 -= carry14 << 21; - carry16 = (s16 + (1 << 20)) >> 21; - s17 += carry16; - s16 -= carry16 << 21; - - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - carry13 = (s13 + (1 << 20)) >> 21; - s14 += carry13; - s13 -= carry13 << 21; - carry15 = (s15 + (1 << 20)) >> 21; - s16 += carry15; - s15 -= carry15 << 21; - - s5 += s17 * 666643; - s6 += s17 * 470296; - s7 += s17 * 654183; - s8 -= s17 * 997805; - s9 += s17 * 136657; - s10 -= s17 * 683901; - s17 = 0; - - s4 += s16 * 666643; - s5 += s16 * 470296; - s6 += s16 * 654183; - s7 -= s16 * 997805; - s8 += s16 * 136657; - s9 -= s16 * 683901; - s16 = 0; - - s3 += s15 * 666643; - s4 += s15 * 470296; - s5 += s15 * 654183; - s6 -= s15 * 997805; - s7 += s15 * 136657; - s8 -= s15 * 683901; - s15 = 0; - - s2 += s14 * 666643; - s3 += s14 * 470296; - s4 += s14 * 654183; - s5 -= s14 * 997805; - s6 += s14 * 136657; - s7 -= s14 * 683901; - s14 = 0; - - s1 += s13 * 666643; - s2 += s13 * 470296; - s3 += s13 * 654183; - s4 -= s13 * 997805; - s5 += s13 * 136657; - s6 -= s13 * 683901; - s13 = 0; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = (s0 + (1 << 20)) >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry2 = (s2 + (1 << 20)) >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry4 = (s4 + (1 << 20)) >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - carry1 = (s1 + (1 << 20)) >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry3 = (s3 + (1 << 20)) >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry5 = (s5 + (1 << 20)) >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry11 = s11 >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - s[0] = s0 >> 0; - s[1] = s0 >> 8; - s[2] = (s0 >> 16) | (s1 << 5); - s[3] = s1 >> 3; - s[4] = s1 >> 11; - s[5] = (s1 >> 19) | (s2 << 2); - s[6] = s2 >> 6; - s[7] = (s2 >> 14) | (s3 << 7); - s[8] = s3 >> 1; - s[9] = s3 >> 9; - s[10] = (s3 >> 17) | (s4 << 4); - s[11] = s4 >> 4; - s[12] = s4 >> 12; - s[13] = (s4 >> 20) | (s5 << 1); - s[14] = s5 >> 7; - s[15] = (s5 >> 15) | (s6 << 6); - s[16] = s6 >> 2; - s[17] = s6 >> 10; - s[18] = (s6 >> 18) | (s7 << 3); - s[19] = s7 >> 5; - s[20] = s7 >> 13; - s[21] = s8 >> 0; - s[22] = s8 >> 8; - s[23] = (s8 >> 16) | (s9 << 5); - s[24] = s9 >> 3; - s[25] = s9 >> 11; - s[26] = (s9 >> 19) | (s10 << 2); - s[27] = s10 >> 6; - s[28] = (s10 >> 14) | (s11 << 7); - s[29] = s11 >> 1; - s[30] = s11 >> 9; - s[31] = s11 >> 17; -} - -// Input: -// a[0]+256*a[1]+...+256^31*a[31] = a -// b[0]+256*b[1]+...+256^31*b[31] = b -// c[0]+256*c[1]+...+256^31*c[31] = c -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -static void sc_muladd(uint8_t *s, const uint8_t *a, const uint8_t *b, - const uint8_t *c) { - int64_t a0 = 2097151 & load_3(a); - int64_t a1 = 2097151 & (load_4(a + 2) >> 5); - int64_t a2 = 2097151 & (load_3(a + 5) >> 2); - int64_t a3 = 2097151 & (load_4(a + 7) >> 7); - int64_t a4 = 2097151 & (load_4(a + 10) >> 4); - int64_t a5 = 2097151 & (load_3(a + 13) >> 1); - int64_t a6 = 2097151 & (load_4(a + 15) >> 6); - int64_t a7 = 2097151 & (load_3(a + 18) >> 3); - int64_t a8 = 2097151 & load_3(a + 21); - int64_t a9 = 2097151 & (load_4(a + 23) >> 5); - int64_t a10 = 2097151 & (load_3(a + 26) >> 2); - int64_t a11 = (load_4(a + 28) >> 7); - int64_t b0 = 2097151 & load_3(b); - int64_t b1 = 2097151 & (load_4(b + 2) >> 5); - int64_t b2 = 2097151 & (load_3(b + 5) >> 2); - int64_t b3 = 2097151 & (load_4(b + 7) >> 7); - int64_t b4 = 2097151 & (load_4(b + 10) >> 4); - int64_t b5 = 2097151 & (load_3(b + 13) >> 1); - int64_t b6 = 2097151 & (load_4(b + 15) >> 6); - int64_t b7 = 2097151 & (load_3(b + 18) >> 3); - int64_t b8 = 2097151 & load_3(b + 21); - int64_t b9 = 2097151 & (load_4(b + 23) >> 5); - int64_t b10 = 2097151 & (load_3(b + 26) >> 2); - int64_t b11 = (load_4(b + 28) >> 7); - int64_t c0 = 2097151 & load_3(c); - int64_t c1 = 2097151 & (load_4(c + 2) >> 5); - int64_t c2 = 2097151 & (load_3(c + 5) >> 2); - int64_t c3 = 2097151 & (load_4(c + 7) >> 7); - int64_t c4 = 2097151 & (load_4(c + 10) >> 4); - int64_t c5 = 2097151 & (load_3(c + 13) >> 1); - int64_t c6 = 2097151 & (load_4(c + 15) >> 6); - int64_t c7 = 2097151 & (load_3(c + 18) >> 3); - int64_t c8 = 2097151 & load_3(c + 21); - int64_t c9 = 2097151 & (load_4(c + 23) >> 5); - int64_t c10 = 2097151 & (load_3(c + 26) >> 2); - int64_t c11 = (load_4(c + 28) >> 7); - int64_t s0; - int64_t s1; - int64_t s2; - int64_t s3; - int64_t s4; - int64_t s5; - int64_t s6; - int64_t s7; - int64_t s8; - int64_t s9; - int64_t s10; - int64_t s11; - int64_t s12; - int64_t s13; - int64_t s14; - int64_t s15; - int64_t s16; - int64_t s17; - int64_t s18; - int64_t s19; - int64_t s20; - int64_t s21; - int64_t s22; - int64_t s23; - int64_t carry0; - int64_t carry1; - int64_t carry2; - int64_t carry3; - int64_t carry4; - int64_t carry5; - int64_t carry6; - int64_t carry7; - int64_t carry8; - int64_t carry9; - int64_t carry10; - int64_t carry11; - int64_t carry12; - int64_t carry13; - int64_t carry14; - int64_t carry15; - int64_t carry16; - int64_t carry17; - int64_t carry18; - int64_t carry19; - int64_t carry20; - int64_t carry21; - int64_t carry22; - - s0 = c0 + a0 * b0; - s1 = c1 + a0 * b1 + a1 * b0; - s2 = c2 + a0 * b2 + a1 * b1 + a2 * b0; - s3 = c3 + a0 * b3 + a1 * b2 + a2 * b1 + a3 * b0; - s4 = c4 + a0 * b4 + a1 * b3 + a2 * b2 + a3 * b1 + a4 * b0; - s5 = c5 + a0 * b5 + a1 * b4 + a2 * b3 + a3 * b2 + a4 * b1 + a5 * b0; - s6 = c6 + a0 * b6 + a1 * b5 + a2 * b4 + a3 * b3 + a4 * b2 + a5 * b1 + a6 * b0; - s7 = c7 + a0 * b7 + a1 * b6 + a2 * b5 + a3 * b4 + a4 * b3 + a5 * b2 + - a6 * b1 + a7 * b0; - s8 = c8 + a0 * b8 + a1 * b7 + a2 * b6 + a3 * b5 + a4 * b4 + a5 * b3 + - a6 * b2 + a7 * b1 + a8 * b0; - s9 = c9 + a0 * b9 + a1 * b8 + a2 * b7 + a3 * b6 + a4 * b5 + a5 * b4 + - a6 * b3 + a7 * b2 + a8 * b1 + a9 * b0; - s10 = c10 + a0 * b10 + a1 * b9 + a2 * b8 + a3 * b7 + a4 * b6 + a5 * b5 + - a6 * b4 + a7 * b3 + a8 * b2 + a9 * b1 + a10 * b0; - s11 = c11 + a0 * b11 + a1 * b10 + a2 * b9 + a3 * b8 + a4 * b7 + a5 * b6 + - a6 * b5 + a7 * b4 + a8 * b3 + a9 * b2 + a10 * b1 + a11 * b0; - s12 = a1 * b11 + a2 * b10 + a3 * b9 + a4 * b8 + a5 * b7 + a6 * b6 + a7 * b5 + - a8 * b4 + a9 * b3 + a10 * b2 + a11 * b1; - s13 = a2 * b11 + a3 * b10 + a4 * b9 + a5 * b8 + a6 * b7 + a7 * b6 + a8 * b5 + - a9 * b4 + a10 * b3 + a11 * b2; - s14 = a3 * b11 + a4 * b10 + a5 * b9 + a6 * b8 + a7 * b7 + a8 * b6 + a9 * b5 + - a10 * b4 + a11 * b3; - s15 = a4 * b11 + a5 * b10 + a6 * b9 + a7 * b8 + a8 * b7 + a9 * b6 + a10 * b5 + - a11 * b4; - s16 = a5 * b11 + a6 * b10 + a7 * b9 + a8 * b8 + a9 * b7 + a10 * b6 + a11 * b5; - s17 = a6 * b11 + a7 * b10 + a8 * b9 + a9 * b8 + a10 * b7 + a11 * b6; - s18 = a7 * b11 + a8 * b10 + a9 * b9 + a10 * b8 + a11 * b7; - s19 = a8 * b11 + a9 * b10 + a10 * b9 + a11 * b8; - s20 = a9 * b11 + a10 * b10 + a11 * b9; - s21 = a10 * b11 + a11 * b10; - s22 = a11 * b11; - s23 = 0; - - carry0 = (s0 + (1 << 20)) >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry2 = (s2 + (1 << 20)) >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry4 = (s4 + (1 << 20)) >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry12 = (s12 + (1 << 20)) >> 21; - s13 += carry12; - s12 -= carry12 << 21; - carry14 = (s14 + (1 << 20)) >> 21; - s15 += carry14; - s14 -= carry14 << 21; - carry16 = (s16 + (1 << 20)) >> 21; - s17 += carry16; - s16 -= carry16 << 21; - carry18 = (s18 + (1 << 20)) >> 21; - s19 += carry18; - s18 -= carry18 << 21; - carry20 = (s20 + (1 << 20)) >> 21; - s21 += carry20; - s20 -= carry20 << 21; - carry22 = (s22 + (1 << 20)) >> 21; - s23 += carry22; - s22 -= carry22 << 21; - - carry1 = (s1 + (1 << 20)) >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry3 = (s3 + (1 << 20)) >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry5 = (s5 + (1 << 20)) >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - carry13 = (s13 + (1 << 20)) >> 21; - s14 += carry13; - s13 -= carry13 << 21; - carry15 = (s15 + (1 << 20)) >> 21; - s16 += carry15; - s15 -= carry15 << 21; - carry17 = (s17 + (1 << 20)) >> 21; - s18 += carry17; - s17 -= carry17 << 21; - carry19 = (s19 + (1 << 20)) >> 21; - s20 += carry19; - s19 -= carry19 << 21; - carry21 = (s21 + (1 << 20)) >> 21; - s22 += carry21; - s21 -= carry21 << 21; - - s11 += s23 * 666643; - s12 += s23 * 470296; - s13 += s23 * 654183; - s14 -= s23 * 997805; - s15 += s23 * 136657; - s16 -= s23 * 683901; - s23 = 0; - - s10 += s22 * 666643; - s11 += s22 * 470296; - s12 += s22 * 654183; - s13 -= s22 * 997805; - s14 += s22 * 136657; - s15 -= s22 * 683901; - s22 = 0; - - s9 += s21 * 666643; - s10 += s21 * 470296; - s11 += s21 * 654183; - s12 -= s21 * 997805; - s13 += s21 * 136657; - s14 -= s21 * 683901; - s21 = 0; - - s8 += s20 * 666643; - s9 += s20 * 470296; - s10 += s20 * 654183; - s11 -= s20 * 997805; - s12 += s20 * 136657; - s13 -= s20 * 683901; - s20 = 0; - - s7 += s19 * 666643; - s8 += s19 * 470296; - s9 += s19 * 654183; - s10 -= s19 * 997805; - s11 += s19 * 136657; - s12 -= s19 * 683901; - s19 = 0; - - s6 += s18 * 666643; - s7 += s18 * 470296; - s8 += s18 * 654183; - s9 -= s18 * 997805; - s10 += s18 * 136657; - s11 -= s18 * 683901; - s18 = 0; - - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry12 = (s12 + (1 << 20)) >> 21; - s13 += carry12; - s12 -= carry12 << 21; - carry14 = (s14 + (1 << 20)) >> 21; - s15 += carry14; - s14 -= carry14 << 21; - carry16 = (s16 + (1 << 20)) >> 21; - s17 += carry16; - s16 -= carry16 << 21; - - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - carry13 = (s13 + (1 << 20)) >> 21; - s14 += carry13; - s13 -= carry13 << 21; - carry15 = (s15 + (1 << 20)) >> 21; - s16 += carry15; - s15 -= carry15 << 21; - - s5 += s17 * 666643; - s6 += s17 * 470296; - s7 += s17 * 654183; - s8 -= s17 * 997805; - s9 += s17 * 136657; - s10 -= s17 * 683901; - s17 = 0; - - s4 += s16 * 666643; - s5 += s16 * 470296; - s6 += s16 * 654183; - s7 -= s16 * 997805; - s8 += s16 * 136657; - s9 -= s16 * 683901; - s16 = 0; - - s3 += s15 * 666643; - s4 += s15 * 470296; - s5 += s15 * 654183; - s6 -= s15 * 997805; - s7 += s15 * 136657; - s8 -= s15 * 683901; - s15 = 0; - - s2 += s14 * 666643; - s3 += s14 * 470296; - s4 += s14 * 654183; - s5 -= s14 * 997805; - s6 += s14 * 136657; - s7 -= s14 * 683901; - s14 = 0; - - s1 += s13 * 666643; - s2 += s13 * 470296; - s3 += s13 * 654183; - s4 -= s13 * 997805; - s5 += s13 * 136657; - s6 -= s13 * 683901; - s13 = 0; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = (s0 + (1 << 20)) >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry2 = (s2 + (1 << 20)) >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry4 = (s4 + (1 << 20)) >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry6 = (s6 + (1 << 20)) >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry8 = (s8 + (1 << 20)) >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry10 = (s10 + (1 << 20)) >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - carry1 = (s1 + (1 << 20)) >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry3 = (s3 + (1 << 20)) >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry5 = (s5 + (1 << 20)) >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry7 = (s7 + (1 << 20)) >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry9 = (s9 + (1 << 20)) >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry11 = (s11 + (1 << 20)) >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - carry11 = s11 >> 21; - s12 += carry11; - s11 -= carry11 << 21; - - s0 += s12 * 666643; - s1 += s12 * 470296; - s2 += s12 * 654183; - s3 -= s12 * 997805; - s4 += s12 * 136657; - s5 -= s12 * 683901; - s12 = 0; - - carry0 = s0 >> 21; - s1 += carry0; - s0 -= carry0 << 21; - carry1 = s1 >> 21; - s2 += carry1; - s1 -= carry1 << 21; - carry2 = s2 >> 21; - s3 += carry2; - s2 -= carry2 << 21; - carry3 = s3 >> 21; - s4 += carry3; - s3 -= carry3 << 21; - carry4 = s4 >> 21; - s5 += carry4; - s4 -= carry4 << 21; - carry5 = s5 >> 21; - s6 += carry5; - s5 -= carry5 << 21; - carry6 = s6 >> 21; - s7 += carry6; - s6 -= carry6 << 21; - carry7 = s7 >> 21; - s8 += carry7; - s7 -= carry7 << 21; - carry8 = s8 >> 21; - s9 += carry8; - s8 -= carry8 << 21; - carry9 = s9 >> 21; - s10 += carry9; - s9 -= carry9 << 21; - carry10 = s10 >> 21; - s11 += carry10; - s10 -= carry10 << 21; - - s[0] = s0 >> 0; - s[1] = s0 >> 8; - s[2] = (s0 >> 16) | (s1 << 5); - s[3] = s1 >> 3; - s[4] = s1 >> 11; - s[5] = (s1 >> 19) | (s2 << 2); - s[6] = s2 >> 6; - s[7] = (s2 >> 14) | (s3 << 7); - s[8] = s3 >> 1; - s[9] = s3 >> 9; - s[10] = (s3 >> 17) | (s4 << 4); - s[11] = s4 >> 4; - s[12] = s4 >> 12; - s[13] = (s4 >> 20) | (s5 << 1); - s[14] = s5 >> 7; - s[15] = (s5 >> 15) | (s6 << 6); - s[16] = s6 >> 2; - s[17] = s6 >> 10; - s[18] = (s6 >> 18) | (s7 << 3); - s[19] = s7 >> 5; - s[20] = s7 >> 13; - s[21] = s8 >> 0; - s[22] = s8 >> 8; - s[23] = (s8 >> 16) | (s9 << 5); - s[24] = s9 >> 3; - s[25] = s9 >> 11; - s[26] = (s9 >> 19) | (s10 << 2); - s[27] = s10 >> 6; - s[28] = (s10 >> 14) | (s11 << 7); - s[29] = s11 >> 1; - s[30] = s11 >> 9; - s[31] = s11 >> 17; -} - -void ED25519_keypair(uint8_t out_public_key[32], uint8_t out_private_key[64]) { - uint8_t seed[32]; - RAND_bytes(seed, 32); - ED25519_keypair_from_seed(out_public_key, out_private_key, seed); -} - -int ED25519_sign(uint8_t out_sig[64], const uint8_t *message, - size_t message_len, const uint8_t private_key[64]) { - uint8_t az[SHA512_DIGEST_LENGTH]; - SHA512(private_key, 32, az); - - az[0] &= 248; - az[31] &= 63; - az[31] |= 64; - - SHA512_CTX hash_ctx; - SHA512_Init(&hash_ctx); - SHA512_Update(&hash_ctx, az + 32, 32); - SHA512_Update(&hash_ctx, message, message_len); - uint8_t nonce[SHA512_DIGEST_LENGTH]; - SHA512_Final(nonce, &hash_ctx); - - x25519_sc_reduce(nonce); - ge_p3 R; - x25519_ge_scalarmult_base(&R, nonce); - ge_p3_tobytes(out_sig, &R); - - SHA512_Init(&hash_ctx); - SHA512_Update(&hash_ctx, out_sig, 32); - SHA512_Update(&hash_ctx, private_key + 32, 32); - SHA512_Update(&hash_ctx, message, message_len); - uint8_t hram[SHA512_DIGEST_LENGTH]; - SHA512_Final(hram, &hash_ctx); - - x25519_sc_reduce(hram); - sc_muladd(out_sig + 32, hram, az, nonce); - - return 1; -} - -int ED25519_verify(const uint8_t *message, size_t message_len, - const uint8_t signature[64], const uint8_t public_key[32]) { - ge_p3 A; - if ((signature[63] & 224) != 0 || - x25519_ge_frombytes_vartime(&A, public_key) != 0) { - return 0; - } - - fe_loose t; - fe_neg(&t, &A.X); - fe_carry(&A.X, &t); - fe_neg(&t, &A.T); - fe_carry(&A.T, &t); - - uint8_t pkcopy[32]; - OPENSSL_memcpy(pkcopy, public_key, 32); - uint8_t rcopy[32]; - OPENSSL_memcpy(rcopy, signature, 32); - union { - uint64_t u64[4]; - uint8_t u8[32]; - } scopy; - OPENSSL_memcpy(&scopy.u8[0], signature + 32, 32); - - // https://tools.ietf.org/html/rfc8032#section-5.1.7 requires that s be in - // the range [0, order) in order to prevent signature malleability. - - // kOrder is the order of Curve25519 in little-endian form. - static const uint64_t kOrder[4] = { - UINT64_C(0x5812631a5cf5d3ed), - UINT64_C(0x14def9dea2f79cd6), - 0, - UINT64_C(0x1000000000000000), - }; - for (size_t i = 3;; i--) { - if (scopy.u64[i] > kOrder[i]) { - return 0; - } else if (scopy.u64[i] < kOrder[i]) { - break; - } else if (i == 0) { - return 0; - } - } - - SHA512_CTX hash_ctx; - SHA512_Init(&hash_ctx); - SHA512_Update(&hash_ctx, signature, 32); - SHA512_Update(&hash_ctx, public_key, 32); - SHA512_Update(&hash_ctx, message, message_len); - uint8_t h[SHA512_DIGEST_LENGTH]; - SHA512_Final(h, &hash_ctx); - - x25519_sc_reduce(h); - - ge_p2 R; - ge_double_scalarmult_vartime(&R, h, &A, scopy.u8); - - uint8_t rcheck[32]; - x25519_ge_tobytes(rcheck, &R); - - return CRYPTO_memcmp(rcheck, rcopy, sizeof(rcheck)) == 0; -} - -void ED25519_keypair_from_seed(uint8_t out_public_key[32], - uint8_t out_private_key[64], - const uint8_t seed[32]) { - uint8_t az[SHA512_DIGEST_LENGTH]; - SHA512(seed, 32, az); - - az[0] &= 248; - az[31] &= 63; - az[31] |= 64; - - ge_p3 A; - x25519_ge_scalarmult_base(&A, az); - ge_p3_tobytes(out_public_key, &A); - - OPENSSL_memcpy(out_private_key, seed, 32); - OPENSSL_memcpy(out_private_key + 32, out_public_key, 32); -} - - -static void x25519_scalar_mult_generic(uint8_t out[32], - const uint8_t scalar[32], - const uint8_t point[32]) { - fe x1, x2, z2, x3, z3, tmp0, tmp1; - fe_loose x2l, z2l, x3l, tmp0l, tmp1l; - - uint8_t e[32]; - OPENSSL_memcpy(e, scalar, 32); - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - - // The following implementation was transcribed to Coq and proven to - // correspond to unary scalar multiplication in affine coordinates given that - // x1 != 0 is the x coordinate of some point on the curve. It was also checked - // in Coq that doing a ladderstep with x1 = x3 = 0 gives z2' = z3' = 0, and z2 - // = z3 = 0 gives z2' = z3' = 0. The statement was quantified over the - // underlying field, so it applies to Curve25519 itself and the quadratic - // twist of Curve25519. It was not proven in Coq that prime-field arithmetic - // correctly simulates extension-field arithmetic on prime-field values. - // The decoding of the byte array representation of e was not considered. - // Specification of Montgomery curves in affine coordinates: - // - // Proof that these form a group that is isomorphic to a Weierstrass curve: - // - // Coq transcription and correctness proof of the loop (where scalarbits=255): - // - // - // preconditions: 0 <= e < 2^255 (not necessarily e < order), fe_invert(0) = 0 - fe_frombytes(&x1, point); - fe_1(&x2); - fe_0(&z2); - fe_copy(&x3, &x1); - fe_1(&z3); - - unsigned swap = 0; - int pos; - for (pos = 254; pos >= 0; --pos) { - // loop invariant as of right before the test, for the case where x1 != 0: - // pos >= -1; if z2 = 0 then x2 is nonzero; if z3 = 0 then x3 is nonzero - // let r := e >> (pos+1) in the following equalities of projective points: - // to_xz (r*P) === if swap then (x3, z3) else (x2, z2) - // to_xz ((r+1)*P) === if swap then (x2, z2) else (x3, z3) - // x1 is the nonzero x coordinate of the nonzero point (r*P-(r+1)*P) - unsigned b = 1 & (e[pos / 8] >> (pos & 7)); - swap ^= b; - fe_cswap(&x2, &x3, swap); - fe_cswap(&z2, &z3, swap); - swap = b; - // Coq transcription of ladderstep formula (called from transcribed loop): - // - // - // x1 != 0 - // x1 = 0 - fe_sub(&tmp0l, &x3, &z3); - fe_sub(&tmp1l, &x2, &z2); - fe_add(&x2l, &x2, &z2); - fe_add(&z2l, &x3, &z3); - fe_mul_tll(&z3, &tmp0l, &x2l); - fe_mul_tll(&z2, &z2l, &tmp1l); - fe_sq_tl(&tmp0, &tmp1l); - fe_sq_tl(&tmp1, &x2l); - fe_add(&x3l, &z3, &z2); - fe_sub(&z2l, &z3, &z2); - fe_mul_ttt(&x2, &tmp1, &tmp0); - fe_sub(&tmp1l, &tmp1, &tmp0); - fe_sq_tl(&z2, &z2l); - fe_mul121666(&z3, &tmp1l); - fe_sq_tl(&x3, &x3l); - fe_add(&tmp0l, &tmp0, &z3); - fe_mul_ttt(&z3, &x1, &z2); - fe_mul_tll(&z2, &tmp1l, &tmp0l); - } - // here pos=-1, so r=e, so to_xz (e*P) === if swap then (x3, z3) else (x2, z2) - fe_cswap(&x2, &x3, swap); - fe_cswap(&z2, &z3, swap); - - fe_invert(&z2, &z2); - fe_mul_ttt(&x2, &x2, &z2); - fe_tobytes(out, &x2); -} - -static void x25519_scalar_mult(uint8_t out[32], const uint8_t scalar[32], - const uint8_t point[32]) { -#if defined(BORINGSSL_X25519_NEON) - if (CRYPTO_is_NEON_capable()) { - x25519_NEON(out, scalar, point); - return; - } -#endif - - x25519_scalar_mult_generic(out, scalar, point); -} - -void X25519_keypair(uint8_t out_public_value[32], uint8_t out_private_key[32]) { - RAND_bytes(out_private_key, 32); - - // All X25519 implementations should decode scalars correctly (see - // https://tools.ietf.org/html/rfc7748#section-5). However, if an - // implementation doesn't then it might interoperate with random keys a - // fraction of the time because they'll, randomly, happen to be correctly - // formed. - // - // Thus we do the opposite of the masking here to make sure that our private - // keys are never correctly masked and so, hopefully, any incorrect - // implementations are deterministically broken. - // - // This does not affect security because, although we're throwing away - // entropy, a valid implementation of scalarmult should throw away the exact - // same bits anyway. - out_private_key[0] |= 7; - out_private_key[31] &= 63; - out_private_key[31] |= 128; - - X25519_public_from_private(out_public_value, out_private_key); -} - -int X25519(uint8_t out_shared_key[32], const uint8_t private_key[32], - const uint8_t peer_public_value[32]) { - static const uint8_t kZeros[32] = {0}; - x25519_scalar_mult(out_shared_key, private_key, peer_public_value); - // The all-zero output results when the input is a point of small order. - return CRYPTO_memcmp(kZeros, out_shared_key, 32) != 0; -} - -void X25519_public_from_private(uint8_t out_public_value[32], - const uint8_t private_key[32]) { -#if defined(BORINGSSL_X25519_NEON) - if (CRYPTO_is_NEON_capable()) { - static const uint8_t kMongomeryBasePoint[32] = {9}; - x25519_NEON(out_public_value, private_key, kMongomeryBasePoint); - return; - } -#endif - - uint8_t e[32]; - OPENSSL_memcpy(e, private_key, 32); - e[0] &= 248; - e[31] &= 127; - e[31] |= 64; - - ge_p3 A; - x25519_ge_scalarmult_base(&A, e); - - // We only need the u-coordinate of the curve25519 point. The map is - // u=(y+1)/(1-y). Since y=Y/Z, this gives u=(Z+Y)/(Z-Y). - fe_loose zplusy, zminusy; - fe zminusy_inv; - fe_add(&zplusy, &A.Z, &A.Y); - fe_sub(&zminusy, &A.Z, &A.Y); - fe_loose_invert(&zminusy_inv, &zminusy); - fe_mul_tlt(&zminusy_inv, &zplusy, &zminusy_inv); - fe_tobytes(out_public_value, &zminusy_inv); -} diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/p256.c b/Pods/BoringSSL-GRPC/third_party/fiat/p256.c deleted file mode 100644 index c501a3342..000000000 --- a/Pods/BoringSSL-GRPC/third_party/fiat/p256.c +++ /dev/null @@ -1,1824 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// The field arithmetic code is generated by Fiat -// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. -// -// An implementation of the NIST P-256 elliptic curve point multiplication. -// 256-bit Montgomery form, generated using fiat-crypto, for 64 and 32-bit. -// Field operations with inputs in [0,p) return outputs in [0,p). - -#include - -#include -#include -#include -#include - -#include - -#include "../../crypto/fipsmodule/delocate.h" -#include "../../crypto/fipsmodule/ec/internal.h" -#include "../../crypto/internal.h" - - -// MSVC does not implement uint128_t, and crashes with intrinsics -#if defined(BORINGSSL_HAS_UINT128) -#define BORINGSSL_NISTP256_64BIT 1 -#endif - -// "intrinsics" - -#if defined(BORINGSSL_NISTP256_64BIT) - -static uint64_t mulx_u64(uint64_t a, uint64_t b, uint64_t *high) { - uint128_t x = (uint128_t)a * b; - *high = (uint64_t) (x >> 64); - return (uint64_t) x; -} - -static uint64_t addcarryx_u64(uint8_t c, uint64_t a, uint64_t b, uint64_t *low) { - uint128_t x = (uint128_t)a + b + c; - *low = (uint64_t) x; - return (uint64_t) (x>>64); -} - -static uint64_t subborrow_u64(uint8_t c, uint64_t a, uint64_t b, uint64_t *low) { - uint128_t t = ((uint128_t) b + c); - uint128_t x = a-t; - *low = (uint64_t) x; - return (uint8_t) (x>>127); -} - -static uint64_t cmovznz_u64(uint64_t t, uint64_t z, uint64_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#else - -static uint32_t mulx_u32(uint32_t a, uint32_t b, uint32_t *high) { - uint64_t x = (uint64_t)a * b; - *high = (uint32_t) (x >> 32); - return (uint32_t) x; -} - -static uint32_t addcarryx_u32(uint8_t c, uint32_t a, uint32_t b, uint32_t *low) { - uint64_t x = (uint64_t)a + b + c; - *low = (uint32_t) x; - return (uint32_t) (x>>32); -} - -static uint32_t subborrow_u32(uint8_t c, uint32_t a, uint32_t b, uint32_t *low) { - uint64_t t = ((uint64_t) b + c); - uint64_t x = a-t; - *low = (uint32_t) x; - return (uint8_t) (x>>63); -} - -static uint32_t cmovznz_u32(uint32_t t, uint32_t z, uint32_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#endif - -// fiat-crypto generated code - -#if defined(BORINGSSL_NISTP256_64BIT) - -static void fe_add(uint64_t out[4], const uint64_t in1[4], const uint64_t in2[4]) { - { const uint64_t x8 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x14 = in2[3]; - { const uint64_t x15 = in2[2]; - { const uint64_t x13 = in2[1]; - { const uint64_t x11 = in2[0]; - { uint64_t x17; uint8_t x18 = addcarryx_u64(0x0, x5, x11, &x17); - { uint64_t x20; uint8_t x21 = addcarryx_u64(x18, x7, x13, &x20); - { uint64_t x23; uint8_t x24 = addcarryx_u64(x21, x9, x15, &x23); - { uint64_t x26; uint8_t x27 = addcarryx_u64(x24, x8, x14, &x26); - { uint64_t x29; uint8_t x30 = subborrow_u64(0x0, x17, 0xffffffffffffffffL, &x29); - { uint64_t x32; uint8_t x33 = subborrow_u64(x30, x20, 0xffffffff, &x32); - { uint64_t x35; uint8_t x36 = subborrow_u64(x33, x23, 0x0, &x35); - { uint64_t x38; uint8_t x39 = subborrow_u64(x36, x26, 0xffffffff00000001L, &x38); - { uint64_t _1; uint8_t x42 = subborrow_u64(x39, x27, 0x0, &_1); - { uint64_t x43 = cmovznz_u64(x42, x38, x26); - { uint64_t x44 = cmovznz_u64(x42, x35, x23); - { uint64_t x45 = cmovznz_u64(x42, x32, x20); - { uint64_t x46 = cmovznz_u64(x42, x29, x17); - out[0] = x46; - out[1] = x45; - out[2] = x44; - out[3] = x43; - }}}}}}}}}}}}}}}}}}}}} -} - -// fe_op sets out = -in -static void fe_opp(uint64_t out[4], const uint64_t in1[4]) { - const uint64_t x5 = in1[3]; - const uint64_t x6 = in1[2]; - const uint64_t x4 = in1[1]; - const uint64_t x2 = in1[0]; - uint64_t x8; uint8_t x9 = subborrow_u64(0x0, 0x0, x2, &x8); - uint64_t x11; uint8_t x12 = subborrow_u64(x9, 0x0, x4, &x11); - uint64_t x14; uint8_t x15 = subborrow_u64(x12, 0x0, x6, &x14); - uint64_t x17; uint8_t x18 = subborrow_u64(x15, 0x0, x5, &x17); - uint64_t x19 = (uint64_t)cmovznz_u64(x18, 0x0, 0xffffffffffffffffL); - uint64_t x20 = (x19 & 0xffffffffffffffffL); - uint64_t x22; uint8_t x23 = addcarryx_u64(0x0, x8, x20, &x22); - uint64_t x24 = (x19 & 0xffffffff); - uint64_t x26; uint8_t x27 = addcarryx_u64(x23, x11, x24, &x26); - uint64_t x29; uint8_t x30 = addcarryx_u64(x27, x14, 0x0, &x29); - uint64_t x31 = (x19 & 0xffffffff00000001L); - uint64_t x33; addcarryx_u64(x30, x17, x31, &x33); - out[0] = x22; - out[1] = x26; - out[2] = x29; - out[3] = x33; -} - -static void fe_mul(uint64_t out[4], const uint64_t in1[4], const uint64_t in2[4]) { - const uint64_t x8 = in1[3]; - const uint64_t x9 = in1[2]; - const uint64_t x7 = in1[1]; - const uint64_t x5 = in1[0]; - const uint64_t x14 = in2[3]; - const uint64_t x15 = in2[2]; - const uint64_t x13 = in2[1]; - const uint64_t x11 = in2[0]; - uint64_t x18; uint64_t x17 = mulx_u64(x5, x11, &x18); - uint64_t x21; uint64_t x20 = mulx_u64(x5, x13, &x21); - uint64_t x24; uint64_t x23 = mulx_u64(x5, x15, &x24); - uint64_t x27; uint64_t x26 = mulx_u64(x5, x14, &x27); - uint64_t x29; uint8_t x30 = addcarryx_u64(0x0, x18, x20, &x29); - uint64_t x32; uint8_t x33 = addcarryx_u64(x30, x21, x23, &x32); - uint64_t x35; uint8_t x36 = addcarryx_u64(x33, x24, x26, &x35); - uint64_t x38; addcarryx_u64(0x0, x36, x27, &x38); - uint64_t x42; uint64_t x41 = mulx_u64(x17, 0xffffffffffffffffL, &x42); - uint64_t x45; uint64_t x44 = mulx_u64(x17, 0xffffffff, &x45); - uint64_t x48; uint64_t x47 = mulx_u64(x17, 0xffffffff00000001L, &x48); - uint64_t x50; uint8_t x51 = addcarryx_u64(0x0, x42, x44, &x50); - uint64_t x53; uint8_t x54 = addcarryx_u64(x51, x45, 0x0, &x53); - uint64_t x56; uint8_t x57 = addcarryx_u64(x54, 0x0, x47, &x56); - uint64_t x59; addcarryx_u64(0x0, x57, x48, &x59); - uint64_t _2; uint8_t x63 = addcarryx_u64(0x0, x17, x41, &_2); - uint64_t x65; uint8_t x66 = addcarryx_u64(x63, x29, x50, &x65); - uint64_t x68; uint8_t x69 = addcarryx_u64(x66, x32, x53, &x68); - uint64_t x71; uint8_t x72 = addcarryx_u64(x69, x35, x56, &x71); - uint64_t x74; uint8_t x75 = addcarryx_u64(x72, x38, x59, &x74); - uint64_t x78; uint64_t x77 = mulx_u64(x7, x11, &x78); - uint64_t x81; uint64_t x80 = mulx_u64(x7, x13, &x81); - uint64_t x84; uint64_t x83 = mulx_u64(x7, x15, &x84); - uint64_t x87; uint64_t x86 = mulx_u64(x7, x14, &x87); - uint64_t x89; uint8_t x90 = addcarryx_u64(0x0, x78, x80, &x89); - uint64_t x92; uint8_t x93 = addcarryx_u64(x90, x81, x83, &x92); - uint64_t x95; uint8_t x96 = addcarryx_u64(x93, x84, x86, &x95); - uint64_t x98; addcarryx_u64(0x0, x96, x87, &x98); - uint64_t x101; uint8_t x102 = addcarryx_u64(0x0, x65, x77, &x101); - uint64_t x104; uint8_t x105 = addcarryx_u64(x102, x68, x89, &x104); - uint64_t x107; uint8_t x108 = addcarryx_u64(x105, x71, x92, &x107); - uint64_t x110; uint8_t x111 = addcarryx_u64(x108, x74, x95, &x110); - uint64_t x113; uint8_t x114 = addcarryx_u64(x111, x75, x98, &x113); - uint64_t x117; uint64_t x116 = mulx_u64(x101, 0xffffffffffffffffL, &x117); - uint64_t x120; uint64_t x119 = mulx_u64(x101, 0xffffffff, &x120); - uint64_t x123; uint64_t x122 = mulx_u64(x101, 0xffffffff00000001L, &x123); - uint64_t x125; uint8_t x126 = addcarryx_u64(0x0, x117, x119, &x125); - uint64_t x128; uint8_t x129 = addcarryx_u64(x126, x120, 0x0, &x128); - uint64_t x131; uint8_t x132 = addcarryx_u64(x129, 0x0, x122, &x131); - uint64_t x134; addcarryx_u64(0x0, x132, x123, &x134); - uint64_t _3; uint8_t x138 = addcarryx_u64(0x0, x101, x116, &_3); - uint64_t x140; uint8_t x141 = addcarryx_u64(x138, x104, x125, &x140); - uint64_t x143; uint8_t x144 = addcarryx_u64(x141, x107, x128, &x143); - uint64_t x146; uint8_t x147 = addcarryx_u64(x144, x110, x131, &x146); - uint64_t x149; uint8_t x150 = addcarryx_u64(x147, x113, x134, &x149); - uint8_t x151 = (x150 + x114); - uint64_t x154; uint64_t x153 = mulx_u64(x9, x11, &x154); - uint64_t x157; uint64_t x156 = mulx_u64(x9, x13, &x157); - uint64_t x160; uint64_t x159 = mulx_u64(x9, x15, &x160); - uint64_t x163; uint64_t x162 = mulx_u64(x9, x14, &x163); - uint64_t x165; uint8_t x166 = addcarryx_u64(0x0, x154, x156, &x165); - uint64_t x168; uint8_t x169 = addcarryx_u64(x166, x157, x159, &x168); - uint64_t x171; uint8_t x172 = addcarryx_u64(x169, x160, x162, &x171); - uint64_t x174; addcarryx_u64(0x0, x172, x163, &x174); - uint64_t x177; uint8_t x178 = addcarryx_u64(0x0, x140, x153, &x177); - uint64_t x180; uint8_t x181 = addcarryx_u64(x178, x143, x165, &x180); - uint64_t x183; uint8_t x184 = addcarryx_u64(x181, x146, x168, &x183); - uint64_t x186; uint8_t x187 = addcarryx_u64(x184, x149, x171, &x186); - uint64_t x189; uint8_t x190 = addcarryx_u64(x187, x151, x174, &x189); - uint64_t x193; uint64_t x192 = mulx_u64(x177, 0xffffffffffffffffL, &x193); - uint64_t x196; uint64_t x195 = mulx_u64(x177, 0xffffffff, &x196); - uint64_t x199; uint64_t x198 = mulx_u64(x177, 0xffffffff00000001L, &x199); - uint64_t x201; uint8_t x202 = addcarryx_u64(0x0, x193, x195, &x201); - uint64_t x204; uint8_t x205 = addcarryx_u64(x202, x196, 0x0, &x204); - uint64_t x207; uint8_t x208 = addcarryx_u64(x205, 0x0, x198, &x207); - uint64_t x210; addcarryx_u64(0x0, x208, x199, &x210); - uint64_t _4; uint8_t x214 = addcarryx_u64(0x0, x177, x192, &_4); - uint64_t x216; uint8_t x217 = addcarryx_u64(x214, x180, x201, &x216); - uint64_t x219; uint8_t x220 = addcarryx_u64(x217, x183, x204, &x219); - uint64_t x222; uint8_t x223 = addcarryx_u64(x220, x186, x207, &x222); - uint64_t x225; uint8_t x226 = addcarryx_u64(x223, x189, x210, &x225); - uint8_t x227 = (x226 + x190); - uint64_t x230; uint64_t x229 = mulx_u64(x8, x11, &x230); - uint64_t x233; uint64_t x232 = mulx_u64(x8, x13, &x233); - uint64_t x236; uint64_t x235 = mulx_u64(x8, x15, &x236); - uint64_t x239; uint64_t x238 = mulx_u64(x8, x14, &x239); - uint64_t x241; uint8_t x242 = addcarryx_u64(0x0, x230, x232, &x241); - uint64_t x244; uint8_t x245 = addcarryx_u64(x242, x233, x235, &x244); - uint64_t x247; uint8_t x248 = addcarryx_u64(x245, x236, x238, &x247); - uint64_t x250; addcarryx_u64(0x0, x248, x239, &x250); - uint64_t x253; uint8_t x254 = addcarryx_u64(0x0, x216, x229, &x253); - uint64_t x256; uint8_t x257 = addcarryx_u64(x254, x219, x241, &x256); - uint64_t x259; uint8_t x260 = addcarryx_u64(x257, x222, x244, &x259); - uint64_t x262; uint8_t x263 = addcarryx_u64(x260, x225, x247, &x262); - uint64_t x265; uint8_t x266 = addcarryx_u64(x263, x227, x250, &x265); - uint64_t x269; uint64_t x268 = mulx_u64(x253, 0xffffffffffffffffL, &x269); - uint64_t x272; uint64_t x271 = mulx_u64(x253, 0xffffffff, &x272); - uint64_t x275; uint64_t x274 = mulx_u64(x253, 0xffffffff00000001L, &x275); - uint64_t x277; uint8_t x278 = addcarryx_u64(0x0, x269, x271, &x277); - uint64_t x280; uint8_t x281 = addcarryx_u64(x278, x272, 0x0, &x280); - uint64_t x283; uint8_t x284 = addcarryx_u64(x281, 0x0, x274, &x283); - uint64_t x286; addcarryx_u64(0x0, x284, x275, &x286); - uint64_t _5; uint8_t x290 = addcarryx_u64(0x0, x253, x268, &_5); - uint64_t x292; uint8_t x293 = addcarryx_u64(x290, x256, x277, &x292); - uint64_t x295; uint8_t x296 = addcarryx_u64(x293, x259, x280, &x295); - uint64_t x298; uint8_t x299 = addcarryx_u64(x296, x262, x283, &x298); - uint64_t x301; uint8_t x302 = addcarryx_u64(x299, x265, x286, &x301); - uint8_t x303 = (x302 + x266); - uint64_t x305; uint8_t x306 = subborrow_u64(0x0, x292, 0xffffffffffffffffL, &x305); - uint64_t x308; uint8_t x309 = subborrow_u64(x306, x295, 0xffffffff, &x308); - uint64_t x311; uint8_t x312 = subborrow_u64(x309, x298, 0x0, &x311); - uint64_t x314; uint8_t x315 = subborrow_u64(x312, x301, 0xffffffff00000001L, &x314); - uint64_t _6; uint8_t x318 = subborrow_u64(x315, x303, 0x0, &_6); - uint64_t x319 = cmovznz_u64(x318, x314, x301); - uint64_t x320 = cmovznz_u64(x318, x311, x298); - uint64_t x321 = cmovznz_u64(x318, x308, x295); - uint64_t x322 = cmovznz_u64(x318, x305, x292); - out[0] = x322; - out[1] = x321; - out[2] = x320; - out[3] = x319; -} - -static void fe_sub(uint64_t out[4], const uint64_t in1[4], const uint64_t in2[4]) { - const uint64_t x8 = in1[3]; - const uint64_t x9 = in1[2]; - const uint64_t x7 = in1[1]; - const uint64_t x5 = in1[0]; - const uint64_t x14 = in2[3]; - const uint64_t x15 = in2[2]; - const uint64_t x13 = in2[1]; - const uint64_t x11 = in2[0]; - uint64_t x17; uint8_t x18 = subborrow_u64(0x0, x5, x11, &x17); - uint64_t x20; uint8_t x21 = subborrow_u64(x18, x7, x13, &x20); - uint64_t x23; uint8_t x24 = subborrow_u64(x21, x9, x15, &x23); - uint64_t x26; uint8_t x27 = subborrow_u64(x24, x8, x14, &x26); - uint64_t x28 = (uint64_t)cmovznz_u64(x27, 0x0, 0xffffffffffffffffL); - uint64_t x29 = (x28 & 0xffffffffffffffffL); - uint64_t x31; uint8_t x32 = addcarryx_u64(0x0, x17, x29, &x31); - uint64_t x33 = (x28 & 0xffffffff); - uint64_t x35; uint8_t x36 = addcarryx_u64(x32, x20, x33, &x35); - uint64_t x38; uint8_t x39 = addcarryx_u64(x36, x23, 0x0, &x38); - uint64_t x40 = (x28 & 0xffffffff00000001L); - uint64_t x42; addcarryx_u64(x39, x26, x40, &x42); - out[0] = x31; - out[1] = x35; - out[2] = x38; - out[3] = x42; -} - -#else // 64BIT, else 32BIT - -static void fe_add(uint32_t out[8], const uint32_t in1[8], const uint32_t in2[8]) { - const uint32_t x16 = in1[7]; - const uint32_t x17 = in1[6]; - const uint32_t x15 = in1[5]; - const uint32_t x13 = in1[4]; - const uint32_t x11 = in1[3]; - const uint32_t x9 = in1[2]; - const uint32_t x7 = in1[1]; - const uint32_t x5 = in1[0]; - const uint32_t x30 = in2[7]; - const uint32_t x31 = in2[6]; - const uint32_t x29 = in2[5]; - const uint32_t x27 = in2[4]; - const uint32_t x25 = in2[3]; - const uint32_t x23 = in2[2]; - const uint32_t x21 = in2[1]; - const uint32_t x19 = in2[0]; - uint32_t x33; uint8_t x34 = addcarryx_u32(0x0, x5, x19, &x33); - uint32_t x36; uint8_t x37 = addcarryx_u32(x34, x7, x21, &x36); - uint32_t x39; uint8_t x40 = addcarryx_u32(x37, x9, x23, &x39); - uint32_t x42; uint8_t x43 = addcarryx_u32(x40, x11, x25, &x42); - uint32_t x45; uint8_t x46 = addcarryx_u32(x43, x13, x27, &x45); - uint32_t x48; uint8_t x49 = addcarryx_u32(x46, x15, x29, &x48); - uint32_t x51; uint8_t x52 = addcarryx_u32(x49, x17, x31, &x51); - uint32_t x54; uint8_t x55 = addcarryx_u32(x52, x16, x30, &x54); - uint32_t x57; uint8_t x58 = subborrow_u32(0x0, x33, 0xffffffff, &x57); - uint32_t x60; uint8_t x61 = subborrow_u32(x58, x36, 0xffffffff, &x60); - uint32_t x63; uint8_t x64 = subborrow_u32(x61, x39, 0xffffffff, &x63); - uint32_t x66; uint8_t x67 = subborrow_u32(x64, x42, 0x0, &x66); - uint32_t x69; uint8_t x70 = subborrow_u32(x67, x45, 0x0, &x69); - uint32_t x72; uint8_t x73 = subborrow_u32(x70, x48, 0x0, &x72); - uint32_t x75; uint8_t x76 = subborrow_u32(x73, x51, 0x1, &x75); - uint32_t x78; uint8_t x79 = subborrow_u32(x76, x54, 0xffffffff, &x78); - uint32_t _; uint8_t x82 = subborrow_u32(x79, x55, 0x0, &_); - uint32_t x83 = cmovznz_u32(x82, x78, x54); - uint32_t x84 = cmovznz_u32(x82, x75, x51); - uint32_t x85 = cmovznz_u32(x82, x72, x48); - uint32_t x86 = cmovznz_u32(x82, x69, x45); - uint32_t x87 = cmovznz_u32(x82, x66, x42); - uint32_t x88 = cmovznz_u32(x82, x63, x39); - uint32_t x89 = cmovznz_u32(x82, x60, x36); - uint32_t x90 = cmovznz_u32(x82, x57, x33); - out[0] = x90; - out[1] = x89; - out[2] = x88; - out[3] = x87; - out[4] = x86; - out[5] = x85; - out[6] = x84; - out[7] = x83; -} - -static void fe_mul(uint32_t out[8], const uint32_t in1[8], const uint32_t in2[8]) { - const uint32_t x16 = in1[7]; - const uint32_t x17 = in1[6]; - const uint32_t x15 = in1[5]; - const uint32_t x13 = in1[4]; - const uint32_t x11 = in1[3]; - const uint32_t x9 = in1[2]; - const uint32_t x7 = in1[1]; - const uint32_t x5 = in1[0]; - const uint32_t x30 = in2[7]; - const uint32_t x31 = in2[6]; - const uint32_t x29 = in2[5]; - const uint32_t x27 = in2[4]; - const uint32_t x25 = in2[3]; - const uint32_t x23 = in2[2]; - const uint32_t x21 = in2[1]; - const uint32_t x19 = in2[0]; - uint32_t x34; uint32_t x33 = mulx_u32(x5, x19, &x34); - uint32_t x37; uint32_t x36 = mulx_u32(x5, x21, &x37); - uint32_t x40; uint32_t x39 = mulx_u32(x5, x23, &x40); - uint32_t x43; uint32_t x42 = mulx_u32(x5, x25, &x43); - uint32_t x46; uint32_t x45 = mulx_u32(x5, x27, &x46); - uint32_t x49; uint32_t x48 = mulx_u32(x5, x29, &x49); - uint32_t x52; uint32_t x51 = mulx_u32(x5, x31, &x52); - uint32_t x55; uint32_t x54 = mulx_u32(x5, x30, &x55); - uint32_t x57; uint8_t x58 = addcarryx_u32(0x0, x34, x36, &x57); - uint32_t x60; uint8_t x61 = addcarryx_u32(x58, x37, x39, &x60); - uint32_t x63; uint8_t x64 = addcarryx_u32(x61, x40, x42, &x63); - uint32_t x66; uint8_t x67 = addcarryx_u32(x64, x43, x45, &x66); - uint32_t x69; uint8_t x70 = addcarryx_u32(x67, x46, x48, &x69); - uint32_t x72; uint8_t x73 = addcarryx_u32(x70, x49, x51, &x72); - uint32_t x75; uint8_t x76 = addcarryx_u32(x73, x52, x54, &x75); - uint32_t x78; addcarryx_u32(0x0, x76, x55, &x78); - uint32_t x82; uint32_t x81 = mulx_u32(x33, 0xffffffff, &x82); - uint32_t x85; uint32_t x84 = mulx_u32(x33, 0xffffffff, &x85); - uint32_t x88; uint32_t x87 = mulx_u32(x33, 0xffffffff, &x88); - uint32_t x91; uint32_t x90 = mulx_u32(x33, 0xffffffff, &x91); - uint32_t x93; uint8_t x94 = addcarryx_u32(0x0, x82, x84, &x93); - uint32_t x96; uint8_t x97 = addcarryx_u32(x94, x85, x87, &x96); - uint32_t x99; uint8_t x100 = addcarryx_u32(x97, x88, 0x0, &x99); - uint8_t x101 = (0x0 + 0x0); - uint32_t _1; uint8_t x104 = addcarryx_u32(0x0, x33, x81, &_1); - uint32_t x106; uint8_t x107 = addcarryx_u32(x104, x57, x93, &x106); - uint32_t x109; uint8_t x110 = addcarryx_u32(x107, x60, x96, &x109); - uint32_t x112; uint8_t x113 = addcarryx_u32(x110, x63, x99, &x112); - uint32_t x115; uint8_t x116 = addcarryx_u32(x113, x66, x100, &x115); - uint32_t x118; uint8_t x119 = addcarryx_u32(x116, x69, x101, &x118); - uint32_t x121; uint8_t x122 = addcarryx_u32(x119, x72, x33, &x121); - uint32_t x124; uint8_t x125 = addcarryx_u32(x122, x75, x90, &x124); - uint32_t x127; uint8_t x128 = addcarryx_u32(x125, x78, x91, &x127); - uint8_t x129 = (x128 + 0x0); - uint32_t x132; uint32_t x131 = mulx_u32(x7, x19, &x132); - uint32_t x135; uint32_t x134 = mulx_u32(x7, x21, &x135); - uint32_t x138; uint32_t x137 = mulx_u32(x7, x23, &x138); - uint32_t x141; uint32_t x140 = mulx_u32(x7, x25, &x141); - uint32_t x144; uint32_t x143 = mulx_u32(x7, x27, &x144); - uint32_t x147; uint32_t x146 = mulx_u32(x7, x29, &x147); - uint32_t x150; uint32_t x149 = mulx_u32(x7, x31, &x150); - uint32_t x153; uint32_t x152 = mulx_u32(x7, x30, &x153); - uint32_t x155; uint8_t x156 = addcarryx_u32(0x0, x132, x134, &x155); - uint32_t x158; uint8_t x159 = addcarryx_u32(x156, x135, x137, &x158); - uint32_t x161; uint8_t x162 = addcarryx_u32(x159, x138, x140, &x161); - uint32_t x164; uint8_t x165 = addcarryx_u32(x162, x141, x143, &x164); - uint32_t x167; uint8_t x168 = addcarryx_u32(x165, x144, x146, &x167); - uint32_t x170; uint8_t x171 = addcarryx_u32(x168, x147, x149, &x170); - uint32_t x173; uint8_t x174 = addcarryx_u32(x171, x150, x152, &x173); - uint32_t x176; addcarryx_u32(0x0, x174, x153, &x176); - uint32_t x179; uint8_t x180 = addcarryx_u32(0x0, x106, x131, &x179); - uint32_t x182; uint8_t x183 = addcarryx_u32(x180, x109, x155, &x182); - uint32_t x185; uint8_t x186 = addcarryx_u32(x183, x112, x158, &x185); - uint32_t x188; uint8_t x189 = addcarryx_u32(x186, x115, x161, &x188); - uint32_t x191; uint8_t x192 = addcarryx_u32(x189, x118, x164, &x191); - uint32_t x194; uint8_t x195 = addcarryx_u32(x192, x121, x167, &x194); - uint32_t x197; uint8_t x198 = addcarryx_u32(x195, x124, x170, &x197); - uint32_t x200; uint8_t x201 = addcarryx_u32(x198, x127, x173, &x200); - uint32_t x203; uint8_t x204 = addcarryx_u32(x201, x129, x176, &x203); - uint32_t x207; uint32_t x206 = mulx_u32(x179, 0xffffffff, &x207); - uint32_t x210; uint32_t x209 = mulx_u32(x179, 0xffffffff, &x210); - uint32_t x213; uint32_t x212 = mulx_u32(x179, 0xffffffff, &x213); - uint32_t x216; uint32_t x215 = mulx_u32(x179, 0xffffffff, &x216); - uint32_t x218; uint8_t x219 = addcarryx_u32(0x0, x207, x209, &x218); - uint32_t x221; uint8_t x222 = addcarryx_u32(x219, x210, x212, &x221); - uint32_t x224; uint8_t x225 = addcarryx_u32(x222, x213, 0x0, &x224); - uint8_t x226 = (0x0 + 0x0); - uint32_t _2; uint8_t x229 = addcarryx_u32(0x0, x179, x206, &_2); - uint32_t x231; uint8_t x232 = addcarryx_u32(x229, x182, x218, &x231); - uint32_t x234; uint8_t x235 = addcarryx_u32(x232, x185, x221, &x234); - uint32_t x237; uint8_t x238 = addcarryx_u32(x235, x188, x224, &x237); - uint32_t x240; uint8_t x241 = addcarryx_u32(x238, x191, x225, &x240); - uint32_t x243; uint8_t x244 = addcarryx_u32(x241, x194, x226, &x243); - uint32_t x246; uint8_t x247 = addcarryx_u32(x244, x197, x179, &x246); - uint32_t x249; uint8_t x250 = addcarryx_u32(x247, x200, x215, &x249); - uint32_t x252; uint8_t x253 = addcarryx_u32(x250, x203, x216, &x252); - uint8_t x254 = (x253 + x204); - uint32_t x257; uint32_t x256 = mulx_u32(x9, x19, &x257); - uint32_t x260; uint32_t x259 = mulx_u32(x9, x21, &x260); - uint32_t x263; uint32_t x262 = mulx_u32(x9, x23, &x263); - uint32_t x266; uint32_t x265 = mulx_u32(x9, x25, &x266); - uint32_t x269; uint32_t x268 = mulx_u32(x9, x27, &x269); - uint32_t x272; uint32_t x271 = mulx_u32(x9, x29, &x272); - uint32_t x275; uint32_t x274 = mulx_u32(x9, x31, &x275); - uint32_t x278; uint32_t x277 = mulx_u32(x9, x30, &x278); - uint32_t x280; uint8_t x281 = addcarryx_u32(0x0, x257, x259, &x280); - uint32_t x283; uint8_t x284 = addcarryx_u32(x281, x260, x262, &x283); - uint32_t x286; uint8_t x287 = addcarryx_u32(x284, x263, x265, &x286); - uint32_t x289; uint8_t x290 = addcarryx_u32(x287, x266, x268, &x289); - uint32_t x292; uint8_t x293 = addcarryx_u32(x290, x269, x271, &x292); - uint32_t x295; uint8_t x296 = addcarryx_u32(x293, x272, x274, &x295); - uint32_t x298; uint8_t x299 = addcarryx_u32(x296, x275, x277, &x298); - uint32_t x301; addcarryx_u32(0x0, x299, x278, &x301); - uint32_t x304; uint8_t x305 = addcarryx_u32(0x0, x231, x256, &x304); - uint32_t x307; uint8_t x308 = addcarryx_u32(x305, x234, x280, &x307); - uint32_t x310; uint8_t x311 = addcarryx_u32(x308, x237, x283, &x310); - uint32_t x313; uint8_t x314 = addcarryx_u32(x311, x240, x286, &x313); - uint32_t x316; uint8_t x317 = addcarryx_u32(x314, x243, x289, &x316); - uint32_t x319; uint8_t x320 = addcarryx_u32(x317, x246, x292, &x319); - uint32_t x322; uint8_t x323 = addcarryx_u32(x320, x249, x295, &x322); - uint32_t x325; uint8_t x326 = addcarryx_u32(x323, x252, x298, &x325); - uint32_t x328; uint8_t x329 = addcarryx_u32(x326, x254, x301, &x328); - uint32_t x332; uint32_t x331 = mulx_u32(x304, 0xffffffff, &x332); - uint32_t x335; uint32_t x334 = mulx_u32(x304, 0xffffffff, &x335); - uint32_t x338; uint32_t x337 = mulx_u32(x304, 0xffffffff, &x338); - uint32_t x341; uint32_t x340 = mulx_u32(x304, 0xffffffff, &x341); - uint32_t x343; uint8_t x344 = addcarryx_u32(0x0, x332, x334, &x343); - uint32_t x346; uint8_t x347 = addcarryx_u32(x344, x335, x337, &x346); - uint32_t x349; uint8_t x350 = addcarryx_u32(x347, x338, 0x0, &x349); - uint8_t x351 = (0x0 + 0x0); - uint32_t _3; uint8_t x354 = addcarryx_u32(0x0, x304, x331, &_3); - uint32_t x356; uint8_t x357 = addcarryx_u32(x354, x307, x343, &x356); - uint32_t x359; uint8_t x360 = addcarryx_u32(x357, x310, x346, &x359); - uint32_t x362; uint8_t x363 = addcarryx_u32(x360, x313, x349, &x362); - uint32_t x365; uint8_t x366 = addcarryx_u32(x363, x316, x350, &x365); - uint32_t x368; uint8_t x369 = addcarryx_u32(x366, x319, x351, &x368); - uint32_t x371; uint8_t x372 = addcarryx_u32(x369, x322, x304, &x371); - uint32_t x374; uint8_t x375 = addcarryx_u32(x372, x325, x340, &x374); - uint32_t x377; uint8_t x378 = addcarryx_u32(x375, x328, x341, &x377); - uint8_t x379 = (x378 + x329); - uint32_t x382; uint32_t x381 = mulx_u32(x11, x19, &x382); - uint32_t x385; uint32_t x384 = mulx_u32(x11, x21, &x385); - uint32_t x388; uint32_t x387 = mulx_u32(x11, x23, &x388); - uint32_t x391; uint32_t x390 = mulx_u32(x11, x25, &x391); - uint32_t x394; uint32_t x393 = mulx_u32(x11, x27, &x394); - uint32_t x397; uint32_t x396 = mulx_u32(x11, x29, &x397); - uint32_t x400; uint32_t x399 = mulx_u32(x11, x31, &x400); - uint32_t x403; uint32_t x402 = mulx_u32(x11, x30, &x403); - uint32_t x405; uint8_t x406 = addcarryx_u32(0x0, x382, x384, &x405); - uint32_t x408; uint8_t x409 = addcarryx_u32(x406, x385, x387, &x408); - uint32_t x411; uint8_t x412 = addcarryx_u32(x409, x388, x390, &x411); - uint32_t x414; uint8_t x415 = addcarryx_u32(x412, x391, x393, &x414); - uint32_t x417; uint8_t x418 = addcarryx_u32(x415, x394, x396, &x417); - uint32_t x420; uint8_t x421 = addcarryx_u32(x418, x397, x399, &x420); - uint32_t x423; uint8_t x424 = addcarryx_u32(x421, x400, x402, &x423); - uint32_t x426; addcarryx_u32(0x0, x424, x403, &x426); - uint32_t x429; uint8_t x430 = addcarryx_u32(0x0, x356, x381, &x429); - uint32_t x432; uint8_t x433 = addcarryx_u32(x430, x359, x405, &x432); - uint32_t x435; uint8_t x436 = addcarryx_u32(x433, x362, x408, &x435); - uint32_t x438; uint8_t x439 = addcarryx_u32(x436, x365, x411, &x438); - uint32_t x441; uint8_t x442 = addcarryx_u32(x439, x368, x414, &x441); - uint32_t x444; uint8_t x445 = addcarryx_u32(x442, x371, x417, &x444); - uint32_t x447; uint8_t x448 = addcarryx_u32(x445, x374, x420, &x447); - uint32_t x450; uint8_t x451 = addcarryx_u32(x448, x377, x423, &x450); - uint32_t x453; uint8_t x454 = addcarryx_u32(x451, x379, x426, &x453); - uint32_t x457; uint32_t x456 = mulx_u32(x429, 0xffffffff, &x457); - uint32_t x460; uint32_t x459 = mulx_u32(x429, 0xffffffff, &x460); - uint32_t x463; uint32_t x462 = mulx_u32(x429, 0xffffffff, &x463); - uint32_t x466; uint32_t x465 = mulx_u32(x429, 0xffffffff, &x466); - uint32_t x468; uint8_t x469 = addcarryx_u32(0x0, x457, x459, &x468); - uint32_t x471; uint8_t x472 = addcarryx_u32(x469, x460, x462, &x471); - uint32_t x474; uint8_t x475 = addcarryx_u32(x472, x463, 0x0, &x474); - uint8_t x476 = (0x0 + 0x0); - uint32_t _4; uint8_t x479 = addcarryx_u32(0x0, x429, x456, &_4); - uint32_t x481; uint8_t x482 = addcarryx_u32(x479, x432, x468, &x481); - uint32_t x484; uint8_t x485 = addcarryx_u32(x482, x435, x471, &x484); - uint32_t x487; uint8_t x488 = addcarryx_u32(x485, x438, x474, &x487); - uint32_t x490; uint8_t x491 = addcarryx_u32(x488, x441, x475, &x490); - uint32_t x493; uint8_t x494 = addcarryx_u32(x491, x444, x476, &x493); - uint32_t x496; uint8_t x497 = addcarryx_u32(x494, x447, x429, &x496); - uint32_t x499; uint8_t x500 = addcarryx_u32(x497, x450, x465, &x499); - uint32_t x502; uint8_t x503 = addcarryx_u32(x500, x453, x466, &x502); - uint8_t x504 = (x503 + x454); - uint32_t x507; uint32_t x506 = mulx_u32(x13, x19, &x507); - uint32_t x510; uint32_t x509 = mulx_u32(x13, x21, &x510); - uint32_t x513; uint32_t x512 = mulx_u32(x13, x23, &x513); - uint32_t x516; uint32_t x515 = mulx_u32(x13, x25, &x516); - uint32_t x519; uint32_t x518 = mulx_u32(x13, x27, &x519); - uint32_t x522; uint32_t x521 = mulx_u32(x13, x29, &x522); - uint32_t x525; uint32_t x524 = mulx_u32(x13, x31, &x525); - uint32_t x528; uint32_t x527 = mulx_u32(x13, x30, &x528); - uint32_t x530; uint8_t x531 = addcarryx_u32(0x0, x507, x509, &x530); - uint32_t x533; uint8_t x534 = addcarryx_u32(x531, x510, x512, &x533); - uint32_t x536; uint8_t x537 = addcarryx_u32(x534, x513, x515, &x536); - uint32_t x539; uint8_t x540 = addcarryx_u32(x537, x516, x518, &x539); - uint32_t x542; uint8_t x543 = addcarryx_u32(x540, x519, x521, &x542); - uint32_t x545; uint8_t x546 = addcarryx_u32(x543, x522, x524, &x545); - uint32_t x548; uint8_t x549 = addcarryx_u32(x546, x525, x527, &x548); - uint32_t x551; addcarryx_u32(0x0, x549, x528, &x551); - uint32_t x554; uint8_t x555 = addcarryx_u32(0x0, x481, x506, &x554); - uint32_t x557; uint8_t x558 = addcarryx_u32(x555, x484, x530, &x557); - uint32_t x560; uint8_t x561 = addcarryx_u32(x558, x487, x533, &x560); - uint32_t x563; uint8_t x564 = addcarryx_u32(x561, x490, x536, &x563); - uint32_t x566; uint8_t x567 = addcarryx_u32(x564, x493, x539, &x566); - uint32_t x569; uint8_t x570 = addcarryx_u32(x567, x496, x542, &x569); - uint32_t x572; uint8_t x573 = addcarryx_u32(x570, x499, x545, &x572); - uint32_t x575; uint8_t x576 = addcarryx_u32(x573, x502, x548, &x575); - uint32_t x578; uint8_t x579 = addcarryx_u32(x576, x504, x551, &x578); - uint32_t x582; uint32_t x581 = mulx_u32(x554, 0xffffffff, &x582); - uint32_t x585; uint32_t x584 = mulx_u32(x554, 0xffffffff, &x585); - uint32_t x588; uint32_t x587 = mulx_u32(x554, 0xffffffff, &x588); - uint32_t x591; uint32_t x590 = mulx_u32(x554, 0xffffffff, &x591); - uint32_t x593; uint8_t x594 = addcarryx_u32(0x0, x582, x584, &x593); - uint32_t x596; uint8_t x597 = addcarryx_u32(x594, x585, x587, &x596); - uint32_t x599; uint8_t x600 = addcarryx_u32(x597, x588, 0x0, &x599); - uint8_t x601 = (0x0 + 0x0); - uint32_t _5; uint8_t x604 = addcarryx_u32(0x0, x554, x581, &_5); - uint32_t x606; uint8_t x607 = addcarryx_u32(x604, x557, x593, &x606); - uint32_t x609; uint8_t x610 = addcarryx_u32(x607, x560, x596, &x609); - uint32_t x612; uint8_t x613 = addcarryx_u32(x610, x563, x599, &x612); - uint32_t x615; uint8_t x616 = addcarryx_u32(x613, x566, x600, &x615); - uint32_t x618; uint8_t x619 = addcarryx_u32(x616, x569, x601, &x618); - uint32_t x621; uint8_t x622 = addcarryx_u32(x619, x572, x554, &x621); - uint32_t x624; uint8_t x625 = addcarryx_u32(x622, x575, x590, &x624); - uint32_t x627; uint8_t x628 = addcarryx_u32(x625, x578, x591, &x627); - uint8_t x629 = (x628 + x579); - uint32_t x632; uint32_t x631 = mulx_u32(x15, x19, &x632); - uint32_t x635; uint32_t x634 = mulx_u32(x15, x21, &x635); - uint32_t x638; uint32_t x637 = mulx_u32(x15, x23, &x638); - uint32_t x641; uint32_t x640 = mulx_u32(x15, x25, &x641); - uint32_t x644; uint32_t x643 = mulx_u32(x15, x27, &x644); - uint32_t x647; uint32_t x646 = mulx_u32(x15, x29, &x647); - uint32_t x650; uint32_t x649 = mulx_u32(x15, x31, &x650); - uint32_t x653; uint32_t x652 = mulx_u32(x15, x30, &x653); - uint32_t x655; uint8_t x656 = addcarryx_u32(0x0, x632, x634, &x655); - uint32_t x658; uint8_t x659 = addcarryx_u32(x656, x635, x637, &x658); - uint32_t x661; uint8_t x662 = addcarryx_u32(x659, x638, x640, &x661); - uint32_t x664; uint8_t x665 = addcarryx_u32(x662, x641, x643, &x664); - uint32_t x667; uint8_t x668 = addcarryx_u32(x665, x644, x646, &x667); - uint32_t x670; uint8_t x671 = addcarryx_u32(x668, x647, x649, &x670); - uint32_t x673; uint8_t x674 = addcarryx_u32(x671, x650, x652, &x673); - uint32_t x676; addcarryx_u32(0x0, x674, x653, &x676); - uint32_t x679; uint8_t x680 = addcarryx_u32(0x0, x606, x631, &x679); - uint32_t x682; uint8_t x683 = addcarryx_u32(x680, x609, x655, &x682); - uint32_t x685; uint8_t x686 = addcarryx_u32(x683, x612, x658, &x685); - uint32_t x688; uint8_t x689 = addcarryx_u32(x686, x615, x661, &x688); - uint32_t x691; uint8_t x692 = addcarryx_u32(x689, x618, x664, &x691); - uint32_t x694; uint8_t x695 = addcarryx_u32(x692, x621, x667, &x694); - uint32_t x697; uint8_t x698 = addcarryx_u32(x695, x624, x670, &x697); - uint32_t x700; uint8_t x701 = addcarryx_u32(x698, x627, x673, &x700); - uint32_t x703; uint8_t x704 = addcarryx_u32(x701, x629, x676, &x703); - uint32_t x707; uint32_t x706 = mulx_u32(x679, 0xffffffff, &x707); - uint32_t x710; uint32_t x709 = mulx_u32(x679, 0xffffffff, &x710); - uint32_t x713; uint32_t x712 = mulx_u32(x679, 0xffffffff, &x713); - uint32_t x716; uint32_t x715 = mulx_u32(x679, 0xffffffff, &x716); - uint32_t x718; uint8_t x719 = addcarryx_u32(0x0, x707, x709, &x718); - uint32_t x721; uint8_t x722 = addcarryx_u32(x719, x710, x712, &x721); - uint32_t x724; uint8_t x725 = addcarryx_u32(x722, x713, 0x0, &x724); - uint8_t x726 = (0x0 + 0x0); - uint32_t _6; uint8_t x729 = addcarryx_u32(0x0, x679, x706, &_6); - uint32_t x731; uint8_t x732 = addcarryx_u32(x729, x682, x718, &x731); - uint32_t x734; uint8_t x735 = addcarryx_u32(x732, x685, x721, &x734); - uint32_t x737; uint8_t x738 = addcarryx_u32(x735, x688, x724, &x737); - uint32_t x740; uint8_t x741 = addcarryx_u32(x738, x691, x725, &x740); - uint32_t x743; uint8_t x744 = addcarryx_u32(x741, x694, x726, &x743); - uint32_t x746; uint8_t x747 = addcarryx_u32(x744, x697, x679, &x746); - uint32_t x749; uint8_t x750 = addcarryx_u32(x747, x700, x715, &x749); - uint32_t x752; uint8_t x753 = addcarryx_u32(x750, x703, x716, &x752); - uint8_t x754 = (x753 + x704); - uint32_t x757; uint32_t x756 = mulx_u32(x17, x19, &x757); - uint32_t x760; uint32_t x759 = mulx_u32(x17, x21, &x760); - uint32_t x763; uint32_t x762 = mulx_u32(x17, x23, &x763); - uint32_t x766; uint32_t x765 = mulx_u32(x17, x25, &x766); - uint32_t x769; uint32_t x768 = mulx_u32(x17, x27, &x769); - uint32_t x772; uint32_t x771 = mulx_u32(x17, x29, &x772); - uint32_t x775; uint32_t x774 = mulx_u32(x17, x31, &x775); - uint32_t x778; uint32_t x777 = mulx_u32(x17, x30, &x778); - uint32_t x780; uint8_t x781 = addcarryx_u32(0x0, x757, x759, &x780); - uint32_t x783; uint8_t x784 = addcarryx_u32(x781, x760, x762, &x783); - uint32_t x786; uint8_t x787 = addcarryx_u32(x784, x763, x765, &x786); - uint32_t x789; uint8_t x790 = addcarryx_u32(x787, x766, x768, &x789); - uint32_t x792; uint8_t x793 = addcarryx_u32(x790, x769, x771, &x792); - uint32_t x795; uint8_t x796 = addcarryx_u32(x793, x772, x774, &x795); - uint32_t x798; uint8_t x799 = addcarryx_u32(x796, x775, x777, &x798); - uint32_t x801; addcarryx_u32(0x0, x799, x778, &x801); - uint32_t x804; uint8_t x805 = addcarryx_u32(0x0, x731, x756, &x804); - uint32_t x807; uint8_t x808 = addcarryx_u32(x805, x734, x780, &x807); - uint32_t x810; uint8_t x811 = addcarryx_u32(x808, x737, x783, &x810); - uint32_t x813; uint8_t x814 = addcarryx_u32(x811, x740, x786, &x813); - uint32_t x816; uint8_t x817 = addcarryx_u32(x814, x743, x789, &x816); - uint32_t x819; uint8_t x820 = addcarryx_u32(x817, x746, x792, &x819); - uint32_t x822; uint8_t x823 = addcarryx_u32(x820, x749, x795, &x822); - uint32_t x825; uint8_t x826 = addcarryx_u32(x823, x752, x798, &x825); - uint32_t x828; uint8_t x829 = addcarryx_u32(x826, x754, x801, &x828); - uint32_t x832; uint32_t x831 = mulx_u32(x804, 0xffffffff, &x832); - uint32_t x835; uint32_t x834 = mulx_u32(x804, 0xffffffff, &x835); - uint32_t x838; uint32_t x837 = mulx_u32(x804, 0xffffffff, &x838); - uint32_t x841; uint32_t x840 = mulx_u32(x804, 0xffffffff, &x841); - uint32_t x843; uint8_t x844 = addcarryx_u32(0x0, x832, x834, &x843); - uint32_t x846; uint8_t x847 = addcarryx_u32(x844, x835, x837, &x846); - uint32_t x849; uint8_t x850 = addcarryx_u32(x847, x838, 0x0, &x849); - uint8_t x851 = (0x0 + 0x0); - uint32_t _7; uint8_t x854 = addcarryx_u32(0x0, x804, x831, &_7); - uint32_t x856; uint8_t x857 = addcarryx_u32(x854, x807, x843, &x856); - uint32_t x859; uint8_t x860 = addcarryx_u32(x857, x810, x846, &x859); - uint32_t x862; uint8_t x863 = addcarryx_u32(x860, x813, x849, &x862); - uint32_t x865; uint8_t x866 = addcarryx_u32(x863, x816, x850, &x865); - uint32_t x868; uint8_t x869 = addcarryx_u32(x866, x819, x851, &x868); - uint32_t x871; uint8_t x872 = addcarryx_u32(x869, x822, x804, &x871); - uint32_t x874; uint8_t x875 = addcarryx_u32(x872, x825, x840, &x874); - uint32_t x877; uint8_t x878 = addcarryx_u32(x875, x828, x841, &x877); - uint8_t x879 = (x878 + x829); - uint32_t x882; uint32_t x881 = mulx_u32(x16, x19, &x882); - uint32_t x885; uint32_t x884 = mulx_u32(x16, x21, &x885); - uint32_t x888; uint32_t x887 = mulx_u32(x16, x23, &x888); - uint32_t x891; uint32_t x890 = mulx_u32(x16, x25, &x891); - uint32_t x894; uint32_t x893 = mulx_u32(x16, x27, &x894); - uint32_t x897; uint32_t x896 = mulx_u32(x16, x29, &x897); - uint32_t x900; uint32_t x899 = mulx_u32(x16, x31, &x900); - uint32_t x903; uint32_t x902 = mulx_u32(x16, x30, &x903); - uint32_t x905; uint8_t x906 = addcarryx_u32(0x0, x882, x884, &x905); - uint32_t x908; uint8_t x909 = addcarryx_u32(x906, x885, x887, &x908); - uint32_t x911; uint8_t x912 = addcarryx_u32(x909, x888, x890, &x911); - uint32_t x914; uint8_t x915 = addcarryx_u32(x912, x891, x893, &x914); - uint32_t x917; uint8_t x918 = addcarryx_u32(x915, x894, x896, &x917); - uint32_t x920; uint8_t x921 = addcarryx_u32(x918, x897, x899, &x920); - uint32_t x923; uint8_t x924 = addcarryx_u32(x921, x900, x902, &x923); - uint32_t x926; addcarryx_u32(0x0, x924, x903, &x926); - uint32_t x929; uint8_t x930 = addcarryx_u32(0x0, x856, x881, &x929); - uint32_t x932; uint8_t x933 = addcarryx_u32(x930, x859, x905, &x932); - uint32_t x935; uint8_t x936 = addcarryx_u32(x933, x862, x908, &x935); - uint32_t x938; uint8_t x939 = addcarryx_u32(x936, x865, x911, &x938); - uint32_t x941; uint8_t x942 = addcarryx_u32(x939, x868, x914, &x941); - uint32_t x944; uint8_t x945 = addcarryx_u32(x942, x871, x917, &x944); - uint32_t x947; uint8_t x948 = addcarryx_u32(x945, x874, x920, &x947); - uint32_t x950; uint8_t x951 = addcarryx_u32(x948, x877, x923, &x950); - uint32_t x953; uint8_t x954 = addcarryx_u32(x951, x879, x926, &x953); - uint32_t x957; uint32_t x956 = mulx_u32(x929, 0xffffffff, &x957); - uint32_t x960; uint32_t x959 = mulx_u32(x929, 0xffffffff, &x960); - uint32_t x963; uint32_t x962 = mulx_u32(x929, 0xffffffff, &x963); - uint32_t x966; uint32_t x965 = mulx_u32(x929, 0xffffffff, &x966); - uint32_t x968; uint8_t x969 = addcarryx_u32(0x0, x957, x959, &x968); - uint32_t x971; uint8_t x972 = addcarryx_u32(x969, x960, x962, &x971); - uint32_t x974; uint8_t x975 = addcarryx_u32(x972, x963, 0x0, &x974); - uint8_t x976 = (0x0 + 0x0); - uint32_t _8; uint8_t x979 = addcarryx_u32(0x0, x929, x956, &_8); - uint32_t x981; uint8_t x982 = addcarryx_u32(x979, x932, x968, &x981); - uint32_t x984; uint8_t x985 = addcarryx_u32(x982, x935, x971, &x984); - uint32_t x987; uint8_t x988 = addcarryx_u32(x985, x938, x974, &x987); - uint32_t x990; uint8_t x991 = addcarryx_u32(x988, x941, x975, &x990); - uint32_t x993; uint8_t x994 = addcarryx_u32(x991, x944, x976, &x993); - uint32_t x996; uint8_t x997 = addcarryx_u32(x994, x947, x929, &x996); - uint32_t x999; uint8_t x1000 = addcarryx_u32(x997, x950, x965, &x999); - uint32_t x1002; uint8_t x1003 = addcarryx_u32(x1000, x953, x966, &x1002); - uint8_t x1004 = (x1003 + x954); - uint32_t x1006; uint8_t x1007 = subborrow_u32(0x0, x981, 0xffffffff, &x1006); - uint32_t x1009; uint8_t x1010 = subborrow_u32(x1007, x984, 0xffffffff, &x1009); - uint32_t x1012; uint8_t x1013 = subborrow_u32(x1010, x987, 0xffffffff, &x1012); - uint32_t x1015; uint8_t x1016 = subborrow_u32(x1013, x990, 0x0, &x1015); - uint32_t x1018; uint8_t x1019 = subborrow_u32(x1016, x993, 0x0, &x1018); - uint32_t x1021; uint8_t x1022 = subborrow_u32(x1019, x996, 0x0, &x1021); - uint32_t x1024; uint8_t x1025 = subborrow_u32(x1022, x999, 0x1, &x1024); - uint32_t x1027; uint8_t x1028 = subborrow_u32(x1025, x1002, 0xffffffff, &x1027); - uint32_t _9; uint8_t x1031 = subborrow_u32(x1028, x1004, 0x0, &_9); - uint32_t x1032 = cmovznz_u32(x1031, x1027, x1002); - uint32_t x1033 = cmovznz_u32(x1031, x1024, x999); - uint32_t x1034 = cmovznz_u32(x1031, x1021, x996); - uint32_t x1035 = cmovznz_u32(x1031, x1018, x993); - uint32_t x1036 = cmovznz_u32(x1031, x1015, x990); - uint32_t x1037 = cmovznz_u32(x1031, x1012, x987); - uint32_t x1038 = cmovznz_u32(x1031, x1009, x984); - uint32_t x1039 = cmovznz_u32(x1031, x1006, x981); - out[0] = x1039; - out[1] = x1038; - out[2] = x1037; - out[3] = x1036; - out[4] = x1035; - out[5] = x1034; - out[6] = x1033; - out[7] = x1032; -} - -// NOTE: the following functions are generated from fiat-crypto, from the same -// template as their 64-bit counterparts above, but the correctness proof of -// the template was not composed with the correctness proof of the -// specialization pipeline. This is because Coq unexplainedly loops on trying -// to synthesize opp and sub using the normal pipeline. - -static void fe_sub(uint32_t out[8], const uint32_t in1[8], const uint32_t in2[8]) { - const uint32_t x14 = in1[7]; - const uint32_t x15 = in1[6]; - const uint32_t x13 = in1[5]; - const uint32_t x11 = in1[4]; - const uint32_t x9 = in1[3]; - const uint32_t x7 = in1[2]; - const uint32_t x5 = in1[1]; - const uint32_t x3 = in1[0]; - const uint32_t x28 = in2[7]; - const uint32_t x29 = in2[6]; - const uint32_t x27 = in2[5]; - const uint32_t x25 = in2[4]; - const uint32_t x23 = in2[3]; - const uint32_t x21 = in2[2]; - const uint32_t x19 = in2[1]; - const uint32_t x17 = in2[0]; - uint32_t x31; uint8_t x32 = subborrow_u32(0x0, x3, x17, &x31); - uint32_t x34; uint8_t x35 = subborrow_u32(x32, x5, x19, &x34); - uint32_t x37; uint8_t x38 = subborrow_u32(x35, x7, x21, &x37); - uint32_t x40; uint8_t x41 = subborrow_u32(x38, x9, x23, &x40); - uint32_t x43; uint8_t x44 = subborrow_u32(x41, x11, x25, &x43); - uint32_t x46; uint8_t x47 = subborrow_u32(x44, x13, x27, &x46); - uint32_t x49; uint8_t x50 = subborrow_u32(x47, x15, x29, &x49); - uint32_t x52; uint8_t x53 = subborrow_u32(x50, x14, x28, &x52); - uint32_t x54 = cmovznz_u32(x53, 0x0, 0xffffffff); - uint32_t x56; uint8_t x57 = addcarryx_u32(0x0, x31, (x54 & 0xffffffff), &x56); - uint32_t x59; uint8_t x60 = addcarryx_u32(x57, x34, (x54 & 0xffffffff), &x59); - uint32_t x62; uint8_t x63 = addcarryx_u32(x60, x37, (x54 & 0xffffffff), &x62); - uint32_t x65; uint8_t x66 = addcarryx_u32(x63, x40, 0x0, &x65); - uint32_t x68; uint8_t x69 = addcarryx_u32(x66, x43, 0x0, &x68); - uint32_t x71; uint8_t x72 = addcarryx_u32(x69, x46, 0x0, &x71); - uint32_t x74; uint8_t x75 = addcarryx_u32(x72, x49, ((uint8_t)x54 & 0x1), &x74); - uint32_t x77; addcarryx_u32(x75, x52, (x54 & 0xffffffff), &x77); - out[0] = x56; - out[1] = x59; - out[2] = x62; - out[3] = x65; - out[4] = x68; - out[5] = x71; - out[6] = x74; - out[7] = x77; -} - -// fe_op sets out = -in -static void fe_opp(uint32_t out[8], const uint32_t in1[8]) { - const uint32_t x12 = in1[7]; - const uint32_t x13 = in1[6]; - const uint32_t x11 = in1[5]; - const uint32_t x9 = in1[4]; - const uint32_t x7 = in1[3]; - const uint32_t x5 = in1[2]; - const uint32_t x3 = in1[1]; - const uint32_t x1 = in1[0]; - uint32_t x15; uint8_t x16 = subborrow_u32(0x0, 0x0, x1, &x15); - uint32_t x18; uint8_t x19 = subborrow_u32(x16, 0x0, x3, &x18); - uint32_t x21; uint8_t x22 = subborrow_u32(x19, 0x0, x5, &x21); - uint32_t x24; uint8_t x25 = subborrow_u32(x22, 0x0, x7, &x24); - uint32_t x27; uint8_t x28 = subborrow_u32(x25, 0x0, x9, &x27); - uint32_t x30; uint8_t x31 = subborrow_u32(x28, 0x0, x11, &x30); - uint32_t x33; uint8_t x34 = subborrow_u32(x31, 0x0, x13, &x33); - uint32_t x36; uint8_t x37 = subborrow_u32(x34, 0x0, x12, &x36); - uint32_t x38 = cmovznz_u32(x37, 0x0, 0xffffffff); - uint32_t x40; uint8_t x41 = addcarryx_u32(0x0, x15, (x38 & 0xffffffff), &x40); - uint32_t x43; uint8_t x44 = addcarryx_u32(x41, x18, (x38 & 0xffffffff), &x43); - uint32_t x46; uint8_t x47 = addcarryx_u32(x44, x21, (x38 & 0xffffffff), &x46); - uint32_t x49; uint8_t x50 = addcarryx_u32(x47, x24, 0x0, &x49); - uint32_t x52; uint8_t x53 = addcarryx_u32(x50, x27, 0x0, &x52); - uint32_t x55; uint8_t x56 = addcarryx_u32(x53, x30, 0x0, &x55); - uint32_t x58; uint8_t x59 = addcarryx_u32(x56, x33, ((uint8_t)x38 & 0x1), &x58); - uint32_t x61; addcarryx_u32(x59, x36, (x38 & 0xffffffff), &x61); - out[0] = x40; - out[1] = x43; - out[2] = x46; - out[3] = x49; - out[4] = x52; - out[5] = x55; - out[6] = x58; - out[7] = x61; -} - -#endif - -// utility functions, handwritten - -#define NBYTES 32 - -#if defined(BORINGSSL_NISTP256_64BIT) - -#define NLIMBS 4 -typedef uint64_t limb_t; -#define cmovznz_limb cmovznz_u64 -typedef uint64_t fe[NLIMBS]; -#else // 64BIT; else 32BIT - -#define NLIMBS 8 -typedef uint32_t limb_t; -#define cmovznz_limb cmovznz_u32 -typedef uint32_t fe[NLIMBS]; - -#endif // 64BIT - -static limb_t fe_nz(const limb_t in1[NLIMBS]) { - limb_t ret = 0; - for (int i = 0; i < NLIMBS; i++) { - ret |= in1[i]; - } - return ret; -} - -static void fe_copy(limb_t out[NLIMBS], const limb_t in1[NLIMBS]) { - for (int i = 0; i < NLIMBS; i++) { - out[i] = in1[i]; - } -} - -static void fe_cmovznz(limb_t out[NLIMBS], limb_t t, const limb_t z[NLIMBS], - const limb_t nz[NLIMBS]) { - for (int i = 0; i < NLIMBS; i++) { - out[i] = cmovznz_limb(t, z[i], nz[i]); - } -} - -static void fe_sqr(fe out, const fe in) { - fe_mul(out, in, in); -} - -static void fe_tobytes(uint8_t out[NBYTES], const fe in) { - for (int i = 0; i> (8*(i%sizeof(in[0])))); - } -} - -static void fe_frombytes(fe out, const uint8_t in[NBYTES]) { - for (int i = 0; i -// As a sanity check, a proof that these points form a commutative group: -// - -// point_double calculates 2*(x_in, y_in, z_in) -// -// The method is taken from: -// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b -// -// Coq transcription and correctness proof: -// -// -// -// Outputs can equal corresponding inputs, i.e., x_out == x_in is allowed. -// while x_out == y_in is not (maybe this works, but it's not tested). -static void point_double(fe x_out, fe y_out, fe z_out, - const fe x_in, const fe y_in, const fe z_in) { - fe delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; - // delta = z^2 - fe_sqr(delta, z_in); - // gamma = y^2 - fe_sqr(gamma, y_in); - // beta = x*gamma - fe_mul(beta, x_in, gamma); - - // alpha = 3*(x-delta)*(x+delta) - fe_sub(ftmp, x_in, delta); - fe_add(ftmp2, x_in, delta); - - fe_add(tmptmp, ftmp2, ftmp2); - fe_add(ftmp2, ftmp2, tmptmp); - fe_mul(alpha, ftmp, ftmp2); - - // x' = alpha^2 - 8*beta - fe_sqr(x_out, alpha); - fe_add(fourbeta, beta, beta); - fe_add(fourbeta, fourbeta, fourbeta); - fe_add(tmptmp, fourbeta, fourbeta); - fe_sub(x_out, x_out, tmptmp); - - // z' = (y + z)^2 - gamma - delta - fe_add(delta, gamma, delta); - fe_add(ftmp, y_in, z_in); - fe_sqr(z_out, ftmp); - fe_sub(z_out, z_out, delta); - - // y' = alpha*(4*beta - x') - 8*gamma^2 - fe_sub(y_out, fourbeta, x_out); - fe_add(gamma, gamma, gamma); - fe_sqr(gamma, gamma); - fe_mul(y_out, alpha, y_out); - fe_add(gamma, gamma, gamma); - fe_sub(y_out, y_out, gamma); -} - -// point_add calcuates (x1, y1, z1) + (x2, y2, z2) -// -// The method is taken from: -// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, -// adapted for mixed addition (z2 = 1, or z2 = 0 for the point at infinity). -// -// Coq transcription and correctness proof: -// -// -// -// This function includes a branch for checking whether the two input points -// are equal, (while not equal to the point at infinity). This case never -// happens during single point multiplication, so there is no timing leak for -// ECDH or ECDSA signing. -static void point_add(fe x3, fe y3, fe z3, const fe x1, - const fe y1, const fe z1, const int mixed, - const fe x2, const fe y2, const fe z2) { - fe x_out, y_out, z_out; - limb_t z1nz = fe_nz(z1); - limb_t z2nz = fe_nz(z2); - - // z1z1 = z1z1 = z1**2 - fe z1z1; fe_sqr(z1z1, z1); - - fe u1, s1, two_z1z2; - if (!mixed) { - // z2z2 = z2**2 - fe z2z2; fe_sqr(z2z2, z2); - - // u1 = x1*z2z2 - fe_mul(u1, x1, z2z2); - - // two_z1z2 = (z1 + z2)**2 - (z1z1 + z2z2) = 2z1z2 - fe_add(two_z1z2, z1, z2); - fe_sqr(two_z1z2, two_z1z2); - fe_sub(two_z1z2, two_z1z2, z1z1); - fe_sub(two_z1z2, two_z1z2, z2z2); - - // s1 = y1 * z2**3 - fe_mul(s1, z2, z2z2); - fe_mul(s1, s1, y1); - } else { - // We'll assume z2 = 1 (special case z2 = 0 is handled later). - - // u1 = x1*z2z2 - fe_copy(u1, x1); - // two_z1z2 = 2z1z2 - fe_add(two_z1z2, z1, z1); - // s1 = y1 * z2**3 - fe_copy(s1, y1); - } - - // u2 = x2*z1z1 - fe u2; fe_mul(u2, x2, z1z1); - - // h = u2 - u1 - fe h; fe_sub(h, u2, u1); - - limb_t xneq = fe_nz(h); - - // z_out = two_z1z2 * h - fe_mul(z_out, h, two_z1z2); - - // z1z1z1 = z1 * z1z1 - fe z1z1z1; fe_mul(z1z1z1, z1, z1z1); - - // s2 = y2 * z1**3 - fe s2; fe_mul(s2, y2, z1z1z1); - - // r = (s2 - s1)*2 - fe r; - fe_sub(r, s2, s1); - fe_add(r, r, r); - - limb_t yneq = fe_nz(r); - - if (!xneq && !yneq && z1nz && z2nz) { - point_double(x3, y3, z3, x1, y1, z1); - return; - } - - // I = (2h)**2 - fe i; - fe_add(i, h, h); - fe_sqr(i, i); - - // J = h * I - fe j; fe_mul(j, h, i); - - // V = U1 * I - fe v; fe_mul(v, u1, i); - - // x_out = r**2 - J - 2V - fe_sqr(x_out, r); - fe_sub(x_out, x_out, j); - fe_sub(x_out, x_out, v); - fe_sub(x_out, x_out, v); - - // y_out = r(V-x_out) - 2 * s1 * J - fe_sub(y_out, v, x_out); - fe_mul(y_out, y_out, r); - fe s1j; - fe_mul(s1j, s1, j); - fe_sub(y_out, y_out, s1j); - fe_sub(y_out, y_out, s1j); - - fe_cmovznz(x_out, z1nz, x2, x_out); - fe_cmovznz(x3, z2nz, x1, x_out); - fe_cmovznz(y_out, z1nz, y2, y_out); - fe_cmovznz(y3, z2nz, y1, y_out); - fe_cmovznz(z_out, z1nz, z2, z_out); - fe_cmovznz(z3, z2nz, z1, z_out); -} - -// Base point pre computation -// -------------------------- -// -// Two different sorts of precomputed tables are used in the following code. -// Each contain various points on the curve, where each point is three field -// elements (x, y, z). -// -// For the base point table, z is usually 1 (0 for the point at infinity). -// This table has 2 * 16 elements, starting with the following: -// index | bits | point -// ------+---------+------------------------------ -// 0 | 0 0 0 0 | 0G -// 1 | 0 0 0 1 | 1G -// 2 | 0 0 1 0 | 2^64G -// 3 | 0 0 1 1 | (2^64 + 1)G -// 4 | 0 1 0 0 | 2^128G -// 5 | 0 1 0 1 | (2^128 + 1)G -// 6 | 0 1 1 0 | (2^128 + 2^64)G -// 7 | 0 1 1 1 | (2^128 + 2^64 + 1)G -// 8 | 1 0 0 0 | 2^192G -// 9 | 1 0 0 1 | (2^192 + 1)G -// 10 | 1 0 1 0 | (2^192 + 2^64)G -// 11 | 1 0 1 1 | (2^192 + 2^64 + 1)G -// 12 | 1 1 0 0 | (2^192 + 2^128)G -// 13 | 1 1 0 1 | (2^192 + 2^128 + 1)G -// 14 | 1 1 1 0 | (2^192 + 2^128 + 2^64)G -// 15 | 1 1 1 1 | (2^192 + 2^128 + 2^64 + 1)G -// followed by a copy of this with each element multiplied by 2^32. -// -// The reason for this is so that we can clock bits into four different -// locations when doing simple scalar multiplies against the base point, -// and then another four locations using the second 16 elements. -// -// Tables for other points have table[i] = iG for i in 0 .. 16. - -// g_pre_comp is the table of precomputed base points -#if defined(BORINGSSL_NISTP256_64BIT) -static const fe g_pre_comp[2][16][3] = { - {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, - {{0x79e730d418a9143c, 0x75ba95fc5fedb601, 0x79fb732b77622510, - 0x18905f76a53755c6}, - {0xddf25357ce95560a, 0x8b4ab8e4ba19e45c, 0xd2e88688dd21f325, - 0x8571ff1825885d85}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x4f922fc516a0d2bb, 0xd5cc16c1a623499, 0x9241cf3a57c62c8b, - 0x2f5e6961fd1b667f}, - {0x5c15c70bf5a01797, 0x3d20b44d60956192, 0x4911b37071fdb52, - 0xf648f9168d6f0f7b}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x9e566847e137bbbc, 0xe434469e8a6a0bec, 0xb1c4276179d73463, - 0x5abe0285133d0015}, - {0x92aa837cc04c7dab, 0x573d9f4c43260c07, 0xc93156278e6cc37, - 0x94bb725b6b6f7383}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x62a8c244bfe20925, 0x91c19ac38fdce867, 0x5a96a5d5dd387063, - 0x61d587d421d324f6}, - {0xe87673a2a37173ea, 0x2384800853778b65, 0x10f8441e05bab43e, - 0xfa11fe124621efbe}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x1c891f2b2cb19ffd, 0x1ba8d5bb1923c23, 0xb6d03d678ac5ca8e, - 0x586eb04c1f13bedc}, - {0xc35c6e527e8ed09, 0x1e81a33c1819ede2, 0x278fd6c056c652fa, - 0x19d5ac0870864f11}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x62577734d2b533d5, 0x673b8af6a1bdddc0, 0x577e7c9aa79ec293, - 0xbb6de651c3b266b1}, - {0xe7e9303ab65259b3, 0xd6a0afd3d03a7480, 0xc5ac83d19b3cfc27, - 0x60b4619a5d18b99b}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xbd6a38e11ae5aa1c, 0xb8b7652b49e73658, 0xb130014ee5f87ed, - 0x9d0f27b2aeebffcd}, - {0xca9246317a730a55, 0x9c955b2fddbbc83a, 0x7c1dfe0ac019a71, - 0x244a566d356ec48d}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x56f8410ef4f8b16a, 0x97241afec47b266a, 0xa406b8e6d9c87c1, - 0x803f3e02cd42ab1b}, - {0x7f0309a804dbec69, 0xa83b85f73bbad05f, 0xc6097273ad8e197f, - 0xc097440e5067adc1}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x846a56f2c379ab34, 0xa8ee068b841df8d1, 0x20314459176c68ef, - 0xf1af32d5915f1f30}, - {0x99c375315d75bd50, 0x837cffbaf72f67bc, 0x613a41848d7723f, - 0x23d0f130e2d41c8b}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xed93e225d5be5a2b, 0x6fe799835934f3c6, 0x4314092622626ffc, - 0x50bbb4d97990216a}, - {0x378191c6e57ec63e, 0x65422c40181dcdb2, 0x41a8099b0236e0f6, - 0x2b10011801fe49c3}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xfc68b5c59b391593, 0xc385f5a2598270fc, 0x7144f3aad19adcbb, - 0xdd55899983fbae0c}, - {0x93b88b8e74b82ff4, 0xd2e03c4071e734c9, 0x9a7a9eaf43c0322a, - 0xe6e4c551149d6041}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x5fe14bfe80ec21fe, 0xf6ce116ac255be82, 0x98bc5a072f4a5d67, - 0xfad27148db7e63af}, - {0x90c0b6ac29ab05b3, 0x37a9a83c4e251ae6, 0xa7dc875c2aade7d, - 0x77387de39f0e1a84}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x1e9ecc49a56c0dd7, 0xa5cffcd846086c74, 0x8f7a1408f505aece, - 0xb37b85c0bef0c47e}, - {0x3596b6e4cc0e6a8f, 0xfd6d4bbf6b388f23, 0xaba453fac39cef4e, - 0x9c135ac8f9f628d5}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xa1c729495c8f8be, 0x2961c4803bf362bf, 0x9e418403df63d4ac, - 0xc109f9cb91ece900}, - {0xc2d095d058945705, 0xb9083d96ddeb85c0, 0x84692b8d7a40449b, - 0x9bc3344f2eee1ee1}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xd5ae35642913074, 0x55491b2748a542b1, 0x469ca665b310732a, - 0x29591d525f1a4cc1}, - {0xe76f5b6bb84f983f, 0xbe7eef419f5f84e1, 0x1200d49680baa189, - 0x6376551f18ef332c}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}, - {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, - {{0x202886024147519a, 0xd0981eac26b372f0, 0xa9d4a7caa785ebc8, - 0xd953c50ddbdf58e9}, - {0x9d6361ccfd590f8f, 0x72e9626b44e6c917, 0x7fd9611022eb64cf, - 0x863ebb7e9eb288f3}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x4fe7ee31b0e63d34, 0xf4600572a9e54fab, 0xc0493334d5e7b5a4, - 0x8589fb9206d54831}, - {0xaa70f5cc6583553a, 0x879094ae25649e5, 0xcc90450710044652, - 0xebb0696d02541c4f}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xabbaa0c03b89da99, 0xa6f2d79eb8284022, 0x27847862b81c05e8, - 0x337a4b5905e54d63}, - {0x3c67500d21f7794a, 0x207005b77d6d7f61, 0xa5a378104cfd6e8, - 0xd65e0d5f4c2fbd6}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xd433e50f6d3549cf, 0x6f33696ffacd665e, 0x695bfdacce11fcb4, - 0x810ee252af7c9860}, - {0x65450fe17159bb2c, 0xf7dfbebe758b357b, 0x2b057e74d69fea72, - 0xd485717a92731745}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xce1f69bbe83f7669, 0x9f8ae8272877d6b, 0x9548ae543244278d, - 0x207755dee3c2c19c}, - {0x87bd61d96fef1945, 0x18813cefb12d28c3, 0x9fbcd1d672df64aa, - 0x48dc5ee57154b00d}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xef0f469ef49a3154, 0x3e85a5956e2b2e9a, 0x45aaec1eaa924a9c, - 0xaa12dfc8a09e4719}, - {0x26f272274df69f1d, 0xe0e4c82ca2ff5e73, 0xb9d8ce73b7a9dd44, - 0x6c036e73e48ca901}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xe1e421e1a47153f0, 0xb86c3b79920418c9, 0x93bdce87705d7672, - 0xf25ae793cab79a77}, - {0x1f3194a36d869d0c, 0x9d55c8824986c264, 0x49fb5ea3096e945e, - 0x39b8e65313db0a3e}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xe3417bc035d0b34a, 0x440b386b8327c0a7, 0x8fb7262dac0362d1, - 0x2c41114ce0cdf943}, - {0x2ba5cef1ad95a0b1, 0xc09b37a867d54362, 0x26d6cdd201e486c9, - 0x20477abf42ff9297}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xf121b41bc0a67d2, 0x62d4760a444d248a, 0xe044f1d659b4737, - 0x8fde365250bb4a8}, - {0xaceec3da848bf287, 0xc2a62182d3369d6e, 0x3582dfdc92449482, - 0x2f7e2fd2565d6cd7}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xa0122b5178a876b, 0x51ff96ff085104b4, 0x50b31ab14f29f76, - 0x84abb28b5f87d4e6}, - {0xd5ed439f8270790a, 0x2d6cb59d85e3f46b, 0x75f55c1b6c1e2212, - 0xe5436f6717655640}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xc2965ecc9aeb596d, 0x1ea03e7023c92b4, 0x4704b4b62e013961, - 0xca8fd3f905ea367}, - {0x92523a42551b2b61, 0x1eb7a89c390fcd06, 0xe7f1d2be0392a63e, - 0x96dca2644ddb0c33}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x231c210e15339848, 0xe87a28e870778c8d, 0x9d1de6616956e170, - 0x4ac3c9382bb09c0b}, - {0x19be05516998987d, 0x8b2376c4ae09f4d6, 0x1de0b7651a3f933d, - 0x380d94c7e39705f4}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x3685954b8c31c31d, 0x68533d005bf21a0c, 0xbd7626e75c79ec9, - 0xca17754742c69d54}, - {0xcc6edafff6d2dbb2, 0xfd0d8cbd174a9d18, 0x875e8793aa4578e8, - 0xa976a7139cab2ce6}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xce37ab11b43ea1db, 0xa7ff1a95259d292, 0x851b02218f84f186, - 0xa7222beadefaad13}, - {0xa2ac78ec2b0a9144, 0x5a024051f2fa59c5, 0x91d1eca56147ce38, - 0xbe94d523bc2ac690}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x2d8daefd79ec1a0f, 0x3bbcd6fdceb39c97, 0xf5575ffc58f61a95, - 0xdbd986c4adf7b420}, - {0x81aa881415f39eb7, 0x6ee2fcf5b98d976c, 0x5465475dcf2f717d, - 0x8e24d3c46860bbd0}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}}; -#else -static const fe g_pre_comp[2][16][3] = { - {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, - {{0x18a9143c,0x79e730d4, 0x5fedb601,0x75ba95fc, 0x77622510,0x79fb732b, - 0xa53755c6,0x18905f76}, - {0xce95560a,0xddf25357, 0xba19e45c,0x8b4ab8e4, 0xdd21f325,0xd2e88688, - 0x25885d85,0x8571ff18}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x16a0d2bb,0x4f922fc5, 0x1a623499,0xd5cc16c, 0x57c62c8b,0x9241cf3a, - 0xfd1b667f,0x2f5e6961}, - {0xf5a01797,0x5c15c70b, 0x60956192,0x3d20b44d, 0x71fdb52,0x4911b37, - 0x8d6f0f7b,0xf648f916}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xe137bbbc,0x9e566847, 0x8a6a0bec,0xe434469e, 0x79d73463,0xb1c42761, - 0x133d0015,0x5abe0285}, - {0xc04c7dab,0x92aa837c, 0x43260c07,0x573d9f4c, 0x78e6cc37,0xc931562, - 0x6b6f7383,0x94bb725b}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xbfe20925,0x62a8c244, 0x8fdce867,0x91c19ac3, 0xdd387063,0x5a96a5d5, - 0x21d324f6,0x61d587d4}, - {0xa37173ea,0xe87673a2, 0x53778b65,0x23848008, 0x5bab43e,0x10f8441e, - 0x4621efbe,0xfa11fe12}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x2cb19ffd,0x1c891f2b, 0xb1923c23,0x1ba8d5b, 0x8ac5ca8e,0xb6d03d67, - 0x1f13bedc,0x586eb04c}, - {0x27e8ed09,0xc35c6e5, 0x1819ede2,0x1e81a33c, 0x56c652fa,0x278fd6c0, - 0x70864f11,0x19d5ac08}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xd2b533d5,0x62577734, 0xa1bdddc0,0x673b8af6, 0xa79ec293,0x577e7c9a, - 0xc3b266b1,0xbb6de651}, - {0xb65259b3,0xe7e9303a, 0xd03a7480,0xd6a0afd3, 0x9b3cfc27,0xc5ac83d1, - 0x5d18b99b,0x60b4619a}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x1ae5aa1c,0xbd6a38e1, 0x49e73658,0xb8b7652b, 0xee5f87ed,0xb130014, - 0xaeebffcd,0x9d0f27b2}, - {0x7a730a55,0xca924631, 0xddbbc83a,0x9c955b2f, 0xac019a71,0x7c1dfe0, - 0x356ec48d,0x244a566d}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xf4f8b16a,0x56f8410e, 0xc47b266a,0x97241afe, 0x6d9c87c1,0xa406b8e, - 0xcd42ab1b,0x803f3e02}, - {0x4dbec69,0x7f0309a8, 0x3bbad05f,0xa83b85f7, 0xad8e197f,0xc6097273, - 0x5067adc1,0xc097440e}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xc379ab34,0x846a56f2, 0x841df8d1,0xa8ee068b, 0x176c68ef,0x20314459, - 0x915f1f30,0xf1af32d5}, - {0x5d75bd50,0x99c37531, 0xf72f67bc,0x837cffba, 0x48d7723f,0x613a418, - 0xe2d41c8b,0x23d0f130}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xd5be5a2b,0xed93e225, 0x5934f3c6,0x6fe79983, 0x22626ffc,0x43140926, - 0x7990216a,0x50bbb4d9}, - {0xe57ec63e,0x378191c6, 0x181dcdb2,0x65422c40, 0x236e0f6,0x41a8099b, - 0x1fe49c3,0x2b100118}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x9b391593,0xfc68b5c5, 0x598270fc,0xc385f5a2, 0xd19adcbb,0x7144f3aa, - 0x83fbae0c,0xdd558999}, - {0x74b82ff4,0x93b88b8e, 0x71e734c9,0xd2e03c40, 0x43c0322a,0x9a7a9eaf, - 0x149d6041,0xe6e4c551}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x80ec21fe,0x5fe14bfe, 0xc255be82,0xf6ce116a, 0x2f4a5d67,0x98bc5a07, - 0xdb7e63af,0xfad27148}, - {0x29ab05b3,0x90c0b6ac, 0x4e251ae6,0x37a9a83c, 0xc2aade7d,0xa7dc875, - 0x9f0e1a84,0x77387de3}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xa56c0dd7,0x1e9ecc49, 0x46086c74,0xa5cffcd8, 0xf505aece,0x8f7a1408, - 0xbef0c47e,0xb37b85c0}, - {0xcc0e6a8f,0x3596b6e4, 0x6b388f23,0xfd6d4bbf, 0xc39cef4e,0xaba453fa, - 0xf9f628d5,0x9c135ac8}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x95c8f8be,0xa1c7294, 0x3bf362bf,0x2961c480, 0xdf63d4ac,0x9e418403, - 0x91ece900,0xc109f9cb}, - {0x58945705,0xc2d095d0, 0xddeb85c0,0xb9083d96, 0x7a40449b,0x84692b8d, - 0x2eee1ee1,0x9bc3344f}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x42913074,0xd5ae356, 0x48a542b1,0x55491b27, 0xb310732a,0x469ca665, - 0x5f1a4cc1,0x29591d52}, - {0xb84f983f,0xe76f5b6b, 0x9f5f84e1,0xbe7eef41, 0x80baa189,0x1200d496, - 0x18ef332c,0x6376551f}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}, - {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, - {{0x4147519a,0x20288602, 0x26b372f0,0xd0981eac, 0xa785ebc8,0xa9d4a7ca, - 0xdbdf58e9,0xd953c50d}, - {0xfd590f8f,0x9d6361cc, 0x44e6c917,0x72e9626b, 0x22eb64cf,0x7fd96110, - 0x9eb288f3,0x863ebb7e}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xb0e63d34,0x4fe7ee31, 0xa9e54fab,0xf4600572, 0xd5e7b5a4,0xc0493334, - 0x6d54831,0x8589fb92}, - {0x6583553a,0xaa70f5cc, 0xe25649e5,0x879094a, 0x10044652,0xcc904507, - 0x2541c4f,0xebb0696d}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x3b89da99,0xabbaa0c0, 0xb8284022,0xa6f2d79e, 0xb81c05e8,0x27847862, - 0x5e54d63,0x337a4b59}, - {0x21f7794a,0x3c67500d, 0x7d6d7f61,0x207005b7, 0x4cfd6e8,0xa5a3781, - 0xf4c2fbd6,0xd65e0d5}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x6d3549cf,0xd433e50f, 0xfacd665e,0x6f33696f, 0xce11fcb4,0x695bfdac, - 0xaf7c9860,0x810ee252}, - {0x7159bb2c,0x65450fe1, 0x758b357b,0xf7dfbebe, 0xd69fea72,0x2b057e74, - 0x92731745,0xd485717a}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xe83f7669,0xce1f69bb, 0x72877d6b,0x9f8ae82, 0x3244278d,0x9548ae54, - 0xe3c2c19c,0x207755de}, - {0x6fef1945,0x87bd61d9, 0xb12d28c3,0x18813cef, 0x72df64aa,0x9fbcd1d6, - 0x7154b00d,0x48dc5ee5}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xf49a3154,0xef0f469e, 0x6e2b2e9a,0x3e85a595, 0xaa924a9c,0x45aaec1e, - 0xa09e4719,0xaa12dfc8}, - {0x4df69f1d,0x26f27227, 0xa2ff5e73,0xe0e4c82c, 0xb7a9dd44,0xb9d8ce73, - 0xe48ca901,0x6c036e73}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xa47153f0,0xe1e421e1, 0x920418c9,0xb86c3b79, 0x705d7672,0x93bdce87, - 0xcab79a77,0xf25ae793}, - {0x6d869d0c,0x1f3194a3, 0x4986c264,0x9d55c882, 0x96e945e,0x49fb5ea3, - 0x13db0a3e,0x39b8e653}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x35d0b34a,0xe3417bc0, 0x8327c0a7,0x440b386b, 0xac0362d1,0x8fb7262d, - 0xe0cdf943,0x2c41114c}, - {0xad95a0b1,0x2ba5cef1, 0x67d54362,0xc09b37a8, 0x1e486c9,0x26d6cdd2, - 0x42ff9297,0x20477abf}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xbc0a67d2,0xf121b41, 0x444d248a,0x62d4760a, 0x659b4737,0xe044f1d, - 0x250bb4a8,0x8fde365}, - {0x848bf287,0xaceec3da, 0xd3369d6e,0xc2a62182, 0x92449482,0x3582dfdc, - 0x565d6cd7,0x2f7e2fd2}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x178a876b,0xa0122b5, 0x85104b4,0x51ff96ff, 0x14f29f76,0x50b31ab, - 0x5f87d4e6,0x84abb28b}, - {0x8270790a,0xd5ed439f, 0x85e3f46b,0x2d6cb59d, 0x6c1e2212,0x75f55c1b, - 0x17655640,0xe5436f67}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x9aeb596d,0xc2965ecc, 0x23c92b4,0x1ea03e7, 0x2e013961,0x4704b4b6, - 0x905ea367,0xca8fd3f}, - {0x551b2b61,0x92523a42, 0x390fcd06,0x1eb7a89c, 0x392a63e,0xe7f1d2be, - 0x4ddb0c33,0x96dca264}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x15339848,0x231c210e, 0x70778c8d,0xe87a28e8, 0x6956e170,0x9d1de661, - 0x2bb09c0b,0x4ac3c938}, - {0x6998987d,0x19be0551, 0xae09f4d6,0x8b2376c4, 0x1a3f933d,0x1de0b765, - 0xe39705f4,0x380d94c7}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x8c31c31d,0x3685954b, 0x5bf21a0c,0x68533d00, 0x75c79ec9,0xbd7626e, - 0x42c69d54,0xca177547}, - {0xf6d2dbb2,0xcc6edaff, 0x174a9d18,0xfd0d8cbd, 0xaa4578e8,0x875e8793, - 0x9cab2ce6,0xa976a713}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xb43ea1db,0xce37ab11, 0x5259d292,0xa7ff1a9, 0x8f84f186,0x851b0221, - 0xdefaad13,0xa7222bea}, - {0x2b0a9144,0xa2ac78ec, 0xf2fa59c5,0x5a024051, 0x6147ce38,0x91d1eca5, - 0xbc2ac690,0xbe94d523}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x79ec1a0f,0x2d8daefd, 0xceb39c97,0x3bbcd6fd, 0x58f61a95,0xf5575ffc, - 0xadf7b420,0xdbd986c4}, - {0x15f39eb7,0x81aa8814, 0xb98d976c,0x6ee2fcf5, 0xcf2f717d,0x5465475d, - 0x6860bbd0,0x8e24d3c4}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}}; -#endif - -// select_point selects the |idx|th point from a precomputation table and -// copies it to out. -static void select_point(const limb_t idx, size_t size, - const fe pre_comp[/*size*/][3], - fe out[3]) { - OPENSSL_memset(out, 0, sizeof(fe) * 3); - for (size_t i = 0; i < size; i++) { - limb_t mismatch = i ^ idx; - fe_cmovznz(out[0], mismatch, pre_comp[i][0], out[0]); - fe_cmovznz(out[1], mismatch, pre_comp[i][1], out[1]); - fe_cmovznz(out[2], mismatch, pre_comp[i][2], out[2]); - } -} - -// get_bit returns the |i|th bit in |in| -static char get_bit(const uint8_t *in, int i) { - if (i < 0 || i >= 256) { - return 0; - } - return (in[i >> 3] >> (i & 7)) & 1; -} - -// Interleaved point multiplication using precomputed point multiples: The -// small point multiples 0*P, 1*P, ..., 17*P are in p_pre_comp, the scalar -// in p_scalar, if non-NULL. If g_scalar is non-NULL, we also add this multiple -// of the generator, using certain (large) precomputed multiples in g_pre_comp. -// Output point (X, Y, Z) is stored in x_out, y_out, z_out. -static void batch_mul(fe x_out, fe y_out, fe z_out, - const uint8_t *p_scalar, const uint8_t *g_scalar, - const fe p_pre_comp[17][3]) { - // set nq to the point at infinity - fe nq[3] = {{0},{0},{0}}, ftmp, tmp[3]; - uint64_t bits; - uint8_t sign, digit; - - // Loop over both scalars msb-to-lsb, interleaving additions of multiples - // of the generator (two in each of the last 32 rounds) and additions of p - // (every 5th round). - - int skip = 1; // save two point operations in the first round - size_t i = p_scalar != NULL ? 255 : 31; - for (;;) { - // double - if (!skip) { - point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); - } - - // add multiples of the generator - if (g_scalar != NULL && i <= 31) { - // first, look 32 bits upwards - bits = get_bit(g_scalar, i + 224) << 3; - bits |= get_bit(g_scalar, i + 160) << 2; - bits |= get_bit(g_scalar, i + 96) << 1; - bits |= get_bit(g_scalar, i + 32); - // select the point to add, in constant time - select_point(bits, 16, g_pre_comp[1], tmp); - - if (!skip) { - point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, - tmp[0], tmp[1], tmp[2]); - } else { - fe_copy(nq[0], tmp[0]); - fe_copy(nq[1], tmp[1]); - fe_copy(nq[2], tmp[2]); - skip = 0; - } - - // second, look at the current position - bits = get_bit(g_scalar, i + 192) << 3; - bits |= get_bit(g_scalar, i + 128) << 2; - bits |= get_bit(g_scalar, i + 64) << 1; - bits |= get_bit(g_scalar, i); - // select the point to add, in constant time - select_point(bits, 16, g_pre_comp[0], tmp); - point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, tmp[0], - tmp[1], tmp[2]); - } - - // do other additions every 5 doublings - if (p_scalar != NULL && i % 5 == 0) { - bits = get_bit(p_scalar, i + 4) << 5; - bits |= get_bit(p_scalar, i + 3) << 4; - bits |= get_bit(p_scalar, i + 2) << 3; - bits |= get_bit(p_scalar, i + 1) << 2; - bits |= get_bit(p_scalar, i) << 1; - bits |= get_bit(p_scalar, i - 1); - ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); - - // select the point to add or subtract, in constant time. - select_point(digit, 17, p_pre_comp, tmp); - fe_opp(ftmp, tmp[1]); // (X, -Y, Z) is the negative point. - fe_cmovznz(tmp[1], sign, tmp[1], ftmp); - - if (!skip) { - point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, - tmp[0], tmp[1], tmp[2]); - } else { - fe_copy(nq[0], tmp[0]); - fe_copy(nq[1], tmp[1]); - fe_copy(nq[2], tmp[2]); - skip = 0; - } - } - - if (i == 0) { - break; - } - --i; - } - fe_copy(x_out, nq[0]); - fe_copy(y_out, nq[1]); - fe_copy(z_out, nq[2]); -} - -// OPENSSL EC_METHOD FUNCTIONS - -// Takes the Jacobian coordinates (X, Y, Z) of a point and returns (X', Y') = -// (X/Z^2, Y/Z^3). -static int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x_out, - BIGNUM *y_out, - BN_CTX *ctx) { - fe x, y, z1, z2; - - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } - if (!BN_to_fe(x, &point->X) || - !BN_to_fe(y, &point->Y) || - !BN_to_fe(z1, &point->Z)) { - return 0; - } - - fe_inv(z2, z1); - fe_sqr(z1, z2); - - // Instead of using |fe_from_montgomery| to convert the |x| coordinate and - // then calling |fe_from_montgomery| again to convert the |y| coordinate - // below, convert the common factor |z1| once now, saving one reduction. - fe_from_montgomery(z1); - - if (x_out != NULL) { - fe_mul(x, x, z1); - if (!fe_to_BN(x_out, x)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - } - - if (y_out != NULL) { - fe_mul(z1, z1, z2); - fe_mul(y, y, z1); - if (!fe_to_BN(y_out, y)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - } - - return 1; -} - -static int ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p, - const EC_SCALAR *p_scalar, - BN_CTX *unused_ctx) { - fe p_pre_comp[17][3]; - fe x_out, y_out, z_out; - - if (p != NULL && p_scalar != NULL) { - // We treat NULL scalars as 0, and NULL points as points at infinity, i.e., - // they contribute nothing to the linear combination. - OPENSSL_memset(&p_pre_comp, 0, sizeof(p_pre_comp)); - // Precompute multiples. - if (!BN_to_fe(p_pre_comp[1][0], &p->X) || - !BN_to_fe(p_pre_comp[1][1], &p->Y) || - !BN_to_fe(p_pre_comp[1][2], &p->Z)) { - return 0; - } - for (size_t j = 2; j <= 16; ++j) { - if (j & 1) { - point_add(p_pre_comp[j][0], p_pre_comp[j][1], - p_pre_comp[j][2], p_pre_comp[1][0], - p_pre_comp[1][1], p_pre_comp[1][2], - 0, - p_pre_comp[j - 1][0], p_pre_comp[j - 1][1], - p_pre_comp[j - 1][2]); - } else { - point_double(p_pre_comp[j][0], p_pre_comp[j][1], - p_pre_comp[j][2], p_pre_comp[j / 2][0], - p_pre_comp[j / 2][1], p_pre_comp[j / 2][2]); - } - } - } - - batch_mul(x_out, y_out, z_out, - (p != NULL && p_scalar != NULL) ? p_scalar->bytes : NULL, - g_scalar != NULL ? g_scalar->bytes : NULL, - (const fe (*) [3])p_pre_comp); - - if (!fe_to_BN(&r->X, x_out) || - !fe_to_BN(&r->Y, y_out) || - !fe_to_BN(&r->Z, z_out)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - return 1; -} - -static int ec_GFp_nistp256_point_mul_public(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p, - const EC_SCALAR *p_scalar, - BN_CTX *unused_ctx) { -#define P256_WSIZE_PUBLIC 4 - // Precompute multiples of |p|. p_pre_comp[i] is (2*i+1) * |p|. - fe p_pre_comp[1 << (P256_WSIZE_PUBLIC-1)][3]; - if (!BN_to_fe(p_pre_comp[0][0], &p->X) || - !BN_to_fe(p_pre_comp[0][1], &p->Y) || - !BN_to_fe(p_pre_comp[0][2], &p->Z)) { - return 0; - } - fe p2[3]; - point_double(p2[0], p2[1], p2[2], p_pre_comp[0][0], p_pre_comp[0][1], - p_pre_comp[0][2]); - for (size_t i = 1; i < OPENSSL_ARRAY_SIZE(p_pre_comp); i++) { - point_add(p_pre_comp[i][0], p_pre_comp[i][1], p_pre_comp[i][2], - p_pre_comp[i - 1][0], p_pre_comp[i - 1][1], p_pre_comp[i - 1][2], - 0 /* not mixed */, p2[0], p2[1], p2[2]); - } - - // Set up the coefficients for |p_scalar|. - int8_t p_wNAF[257]; - if (!ec_compute_wNAF(group, p_wNAF, p_scalar, 256, P256_WSIZE_PUBLIC)) { - return 0; - } - - // Set |ret| to the point at infinity. - int skip = 1; // Save some point operations. - fe ret[3] = {{0},{0},{0}}; - for (int i = 256; i >= 0; i--) { - if (!skip) { - point_double(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2]); - } - - // For the |g_scalar|, we use the precomputed table without the - // constant-time lookup. - if (i <= 31) { - // First, look 32 bits upwards. - uint64_t bits = get_bit(g_scalar->bytes, i + 224) << 3; - bits |= get_bit(g_scalar->bytes, i + 160) << 2; - bits |= get_bit(g_scalar->bytes, i + 96) << 1; - bits |= get_bit(g_scalar->bytes, i + 32); - point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, - g_pre_comp[1][bits][0], g_pre_comp[1][bits][1], - g_pre_comp[1][bits][2]); - skip = 0; - - // Second, look at the current position. - bits = get_bit(g_scalar->bytes, i + 192) << 3; - bits |= get_bit(g_scalar->bytes, i + 128) << 2; - bits |= get_bit(g_scalar->bytes, i + 64) << 1; - bits |= get_bit(g_scalar->bytes, i); - point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, - g_pre_comp[0][bits][0], g_pre_comp[0][bits][1], - g_pre_comp[0][bits][2]); - } - - int digit = p_wNAF[i]; - if (digit != 0) { - assert(digit & 1); - int idx = digit < 0 ? (-digit) >> 1 : digit >> 1; - fe *y = &p_pre_comp[idx][1], tmp; - if (digit < 0) { - fe_opp(tmp, p_pre_comp[idx][1]); - y = &tmp; - } - if (!skip) { - point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], - 0 /* not mixed */, p_pre_comp[idx][0], *y, p_pre_comp[idx][2]); - } else { - fe_copy(ret[0], p_pre_comp[idx][0]); - fe_copy(ret[1], *y); - fe_copy(ret[2], p_pre_comp[idx][2]); - skip = 0; - } - } - } - - if (!fe_to_BN(&r->X, ret[0]) || - !fe_to_BN(&r->Y, ret[1]) || - !fe_to_BN(&r->Z, ret[2])) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - return 1; -} - -DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp256_method) { - out->group_init = ec_GFp_mont_group_init; - out->group_finish = ec_GFp_mont_group_finish; - out->group_set_curve = ec_GFp_mont_group_set_curve; - out->point_get_affine_coordinates = - ec_GFp_nistp256_point_get_affine_coordinates; - out->mul = ec_GFp_nistp256_points_mul; - out->mul_public = ec_GFp_nistp256_point_mul_public; - out->field_mul = ec_GFp_mont_field_mul; - out->field_sqr = ec_GFp_mont_field_sqr; - out->field_encode = ec_GFp_mont_field_encode; - out->field_decode = ec_GFp_mont_field_decode; -}; - -#undef BORINGSSL_NISTP256_64BIT diff --git a/Pods/BoringSSL-GRPC/third_party/fiat/p256.c.grpc_back b/Pods/BoringSSL-GRPC/third_party/fiat/p256.c.grpc_back deleted file mode 100644 index 82f36085e..000000000 --- a/Pods/BoringSSL-GRPC/third_party/fiat/p256.c.grpc_back +++ /dev/null @@ -1,1824 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) 2015-2016 the fiat-crypto authors (see the AUTHORS file). -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all -// copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -// SOFTWARE. - -// The field arithmetic code is generated by Fiat -// (https://github.com/mit-plv/fiat-crypto), which is MIT licensed. -// -// An implementation of the NIST P-256 elliptic curve point multiplication. -// 256-bit Montgomery form, generated using fiat-crypto, for 64 and 32-bit. -// Field operations with inputs in [0,p) return outputs in [0,p). - -#include - -#include -#include -#include -#include - -#include - -#include "../../crypto/fipsmodule/delocate.h" -#include "../../crypto/fipsmodule/ec/internal.h" -#include "../../crypto/internal.h" - - -// MSVC does not implement uint128_t, and crashes with intrinsics -#if defined(BORINGSSL_HAS_UINT128) -#define BORINGSSL_NISTP256_64BIT 1 -#endif - -// "intrinsics" - -#if defined(BORINGSSL_NISTP256_64BIT) - -static uint64_t mulx_u64(uint64_t a, uint64_t b, uint64_t *high) { - uint128_t x = (uint128_t)a * b; - *high = (uint64_t) (x >> 64); - return (uint64_t) x; -} - -static uint64_t addcarryx_u64(uint8_t c, uint64_t a, uint64_t b, uint64_t *low) { - uint128_t x = (uint128_t)a + b + c; - *low = (uint64_t) x; - return (uint64_t) (x>>64); -} - -static uint64_t subborrow_u64(uint8_t c, uint64_t a, uint64_t b, uint64_t *low) { - uint128_t t = ((uint128_t) b + c); - uint128_t x = a-t; - *low = (uint64_t) x; - return (uint8_t) (x>>127); -} - -static uint64_t cmovznz_u64(uint64_t t, uint64_t z, uint64_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#else - -static uint32_t mulx_u32(uint32_t a, uint32_t b, uint32_t *high) { - uint64_t x = (uint64_t)a * b; - *high = (uint32_t) (x >> 32); - return (uint32_t) x; -} - -static uint32_t addcarryx_u32(uint8_t c, uint32_t a, uint32_t b, uint32_t *low) { - uint64_t x = (uint64_t)a + b + c; - *low = (uint32_t) x; - return (uint32_t) (x>>32); -} - -static uint32_t subborrow_u32(uint8_t c, uint32_t a, uint32_t b, uint32_t *low) { - uint64_t t = ((uint64_t) b + c); - uint64_t x = a-t; - *low = (uint32_t) x; - return (uint8_t) (x>>63); -} - -static uint32_t cmovznz_u32(uint32_t t, uint32_t z, uint32_t nz) { - t = -!!t; // all set if nonzero, 0 if 0 - return (t&nz) | ((~t)&z); -} - -#endif - -// fiat-crypto generated code - -#if defined(BORINGSSL_NISTP256_64BIT) - -static void fe_add(uint64_t out[4], const uint64_t in1[4], const uint64_t in2[4]) { - { const uint64_t x8 = in1[3]; - { const uint64_t x9 = in1[2]; - { const uint64_t x7 = in1[1]; - { const uint64_t x5 = in1[0]; - { const uint64_t x14 = in2[3]; - { const uint64_t x15 = in2[2]; - { const uint64_t x13 = in2[1]; - { const uint64_t x11 = in2[0]; - { uint64_t x17; uint8_t x18 = addcarryx_u64(0x0, x5, x11, &x17); - { uint64_t x20; uint8_t x21 = addcarryx_u64(x18, x7, x13, &x20); - { uint64_t x23; uint8_t x24 = addcarryx_u64(x21, x9, x15, &x23); - { uint64_t x26; uint8_t x27 = addcarryx_u64(x24, x8, x14, &x26); - { uint64_t x29; uint8_t x30 = subborrow_u64(0x0, x17, 0xffffffffffffffffL, &x29); - { uint64_t x32; uint8_t x33 = subborrow_u64(x30, x20, 0xffffffff, &x32); - { uint64_t x35; uint8_t x36 = subborrow_u64(x33, x23, 0x0, &x35); - { uint64_t x38; uint8_t x39 = subborrow_u64(x36, x26, 0xffffffff00000001L, &x38); - { uint64_t _1; uint8_t x42 = subborrow_u64(x39, x27, 0x0, &_1); - { uint64_t x43 = cmovznz_u64(x42, x38, x26); - { uint64_t x44 = cmovznz_u64(x42, x35, x23); - { uint64_t x45 = cmovznz_u64(x42, x32, x20); - { uint64_t x46 = cmovznz_u64(x42, x29, x17); - out[0] = x46; - out[1] = x45; - out[2] = x44; - out[3] = x43; - }}}}}}}}}}}}}}}}}}}}} -} - -// fe_op sets out = -in -static void fe_opp(uint64_t out[4], const uint64_t in1[4]) { - const uint64_t x5 = in1[3]; - const uint64_t x6 = in1[2]; - const uint64_t x4 = in1[1]; - const uint64_t x2 = in1[0]; - uint64_t x8; uint8_t x9 = subborrow_u64(0x0, 0x0, x2, &x8); - uint64_t x11; uint8_t x12 = subborrow_u64(x9, 0x0, x4, &x11); - uint64_t x14; uint8_t x15 = subborrow_u64(x12, 0x0, x6, &x14); - uint64_t x17; uint8_t x18 = subborrow_u64(x15, 0x0, x5, &x17); - uint64_t x19 = (uint64_t)cmovznz_u64(x18, 0x0, 0xffffffffffffffffL); - uint64_t x20 = (x19 & 0xffffffffffffffffL); - uint64_t x22; uint8_t x23 = addcarryx_u64(0x0, x8, x20, &x22); - uint64_t x24 = (x19 & 0xffffffff); - uint64_t x26; uint8_t x27 = addcarryx_u64(x23, x11, x24, &x26); - uint64_t x29; uint8_t x30 = addcarryx_u64(x27, x14, 0x0, &x29); - uint64_t x31 = (x19 & 0xffffffff00000001L); - uint64_t x33; addcarryx_u64(x30, x17, x31, &x33); - out[0] = x22; - out[1] = x26; - out[2] = x29; - out[3] = x33; -} - -static void fe_mul(uint64_t out[4], const uint64_t in1[4], const uint64_t in2[4]) { - const uint64_t x8 = in1[3]; - const uint64_t x9 = in1[2]; - const uint64_t x7 = in1[1]; - const uint64_t x5 = in1[0]; - const uint64_t x14 = in2[3]; - const uint64_t x15 = in2[2]; - const uint64_t x13 = in2[1]; - const uint64_t x11 = in2[0]; - uint64_t x18; uint64_t x17 = mulx_u64(x5, x11, &x18); - uint64_t x21; uint64_t x20 = mulx_u64(x5, x13, &x21); - uint64_t x24; uint64_t x23 = mulx_u64(x5, x15, &x24); - uint64_t x27; uint64_t x26 = mulx_u64(x5, x14, &x27); - uint64_t x29; uint8_t x30 = addcarryx_u64(0x0, x18, x20, &x29); - uint64_t x32; uint8_t x33 = addcarryx_u64(x30, x21, x23, &x32); - uint64_t x35; uint8_t x36 = addcarryx_u64(x33, x24, x26, &x35); - uint64_t x38; addcarryx_u64(0x0, x36, x27, &x38); - uint64_t x42; uint64_t x41 = mulx_u64(x17, 0xffffffffffffffffL, &x42); - uint64_t x45; uint64_t x44 = mulx_u64(x17, 0xffffffff, &x45); - uint64_t x48; uint64_t x47 = mulx_u64(x17, 0xffffffff00000001L, &x48); - uint64_t x50; uint8_t x51 = addcarryx_u64(0x0, x42, x44, &x50); - uint64_t x53; uint8_t x54 = addcarryx_u64(x51, x45, 0x0, &x53); - uint64_t x56; uint8_t x57 = addcarryx_u64(x54, 0x0, x47, &x56); - uint64_t x59; addcarryx_u64(0x0, x57, x48, &x59); - uint64_t _2; uint8_t x63 = addcarryx_u64(0x0, x17, x41, &_2); - uint64_t x65; uint8_t x66 = addcarryx_u64(x63, x29, x50, &x65); - uint64_t x68; uint8_t x69 = addcarryx_u64(x66, x32, x53, &x68); - uint64_t x71; uint8_t x72 = addcarryx_u64(x69, x35, x56, &x71); - uint64_t x74; uint8_t x75 = addcarryx_u64(x72, x38, x59, &x74); - uint64_t x78; uint64_t x77 = mulx_u64(x7, x11, &x78); - uint64_t x81; uint64_t x80 = mulx_u64(x7, x13, &x81); - uint64_t x84; uint64_t x83 = mulx_u64(x7, x15, &x84); - uint64_t x87; uint64_t x86 = mulx_u64(x7, x14, &x87); - uint64_t x89; uint8_t x90 = addcarryx_u64(0x0, x78, x80, &x89); - uint64_t x92; uint8_t x93 = addcarryx_u64(x90, x81, x83, &x92); - uint64_t x95; uint8_t x96 = addcarryx_u64(x93, x84, x86, &x95); - uint64_t x98; addcarryx_u64(0x0, x96, x87, &x98); - uint64_t x101; uint8_t x102 = addcarryx_u64(0x0, x65, x77, &x101); - uint64_t x104; uint8_t x105 = addcarryx_u64(x102, x68, x89, &x104); - uint64_t x107; uint8_t x108 = addcarryx_u64(x105, x71, x92, &x107); - uint64_t x110; uint8_t x111 = addcarryx_u64(x108, x74, x95, &x110); - uint64_t x113; uint8_t x114 = addcarryx_u64(x111, x75, x98, &x113); - uint64_t x117; uint64_t x116 = mulx_u64(x101, 0xffffffffffffffffL, &x117); - uint64_t x120; uint64_t x119 = mulx_u64(x101, 0xffffffff, &x120); - uint64_t x123; uint64_t x122 = mulx_u64(x101, 0xffffffff00000001L, &x123); - uint64_t x125; uint8_t x126 = addcarryx_u64(0x0, x117, x119, &x125); - uint64_t x128; uint8_t x129 = addcarryx_u64(x126, x120, 0x0, &x128); - uint64_t x131; uint8_t x132 = addcarryx_u64(x129, 0x0, x122, &x131); - uint64_t x134; addcarryx_u64(0x0, x132, x123, &x134); - uint64_t _3; uint8_t x138 = addcarryx_u64(0x0, x101, x116, &_3); - uint64_t x140; uint8_t x141 = addcarryx_u64(x138, x104, x125, &x140); - uint64_t x143; uint8_t x144 = addcarryx_u64(x141, x107, x128, &x143); - uint64_t x146; uint8_t x147 = addcarryx_u64(x144, x110, x131, &x146); - uint64_t x149; uint8_t x150 = addcarryx_u64(x147, x113, x134, &x149); - uint8_t x151 = (x150 + x114); - uint64_t x154; uint64_t x153 = mulx_u64(x9, x11, &x154); - uint64_t x157; uint64_t x156 = mulx_u64(x9, x13, &x157); - uint64_t x160; uint64_t x159 = mulx_u64(x9, x15, &x160); - uint64_t x163; uint64_t x162 = mulx_u64(x9, x14, &x163); - uint64_t x165; uint8_t x166 = addcarryx_u64(0x0, x154, x156, &x165); - uint64_t x168; uint8_t x169 = addcarryx_u64(x166, x157, x159, &x168); - uint64_t x171; uint8_t x172 = addcarryx_u64(x169, x160, x162, &x171); - uint64_t x174; addcarryx_u64(0x0, x172, x163, &x174); - uint64_t x177; uint8_t x178 = addcarryx_u64(0x0, x140, x153, &x177); - uint64_t x180; uint8_t x181 = addcarryx_u64(x178, x143, x165, &x180); - uint64_t x183; uint8_t x184 = addcarryx_u64(x181, x146, x168, &x183); - uint64_t x186; uint8_t x187 = addcarryx_u64(x184, x149, x171, &x186); - uint64_t x189; uint8_t x190 = addcarryx_u64(x187, x151, x174, &x189); - uint64_t x193; uint64_t x192 = mulx_u64(x177, 0xffffffffffffffffL, &x193); - uint64_t x196; uint64_t x195 = mulx_u64(x177, 0xffffffff, &x196); - uint64_t x199; uint64_t x198 = mulx_u64(x177, 0xffffffff00000001L, &x199); - uint64_t x201; uint8_t x202 = addcarryx_u64(0x0, x193, x195, &x201); - uint64_t x204; uint8_t x205 = addcarryx_u64(x202, x196, 0x0, &x204); - uint64_t x207; uint8_t x208 = addcarryx_u64(x205, 0x0, x198, &x207); - uint64_t x210; addcarryx_u64(0x0, x208, x199, &x210); - uint64_t _4; uint8_t x214 = addcarryx_u64(0x0, x177, x192, &_4); - uint64_t x216; uint8_t x217 = addcarryx_u64(x214, x180, x201, &x216); - uint64_t x219; uint8_t x220 = addcarryx_u64(x217, x183, x204, &x219); - uint64_t x222; uint8_t x223 = addcarryx_u64(x220, x186, x207, &x222); - uint64_t x225; uint8_t x226 = addcarryx_u64(x223, x189, x210, &x225); - uint8_t x227 = (x226 + x190); - uint64_t x230; uint64_t x229 = mulx_u64(x8, x11, &x230); - uint64_t x233; uint64_t x232 = mulx_u64(x8, x13, &x233); - uint64_t x236; uint64_t x235 = mulx_u64(x8, x15, &x236); - uint64_t x239; uint64_t x238 = mulx_u64(x8, x14, &x239); - uint64_t x241; uint8_t x242 = addcarryx_u64(0x0, x230, x232, &x241); - uint64_t x244; uint8_t x245 = addcarryx_u64(x242, x233, x235, &x244); - uint64_t x247; uint8_t x248 = addcarryx_u64(x245, x236, x238, &x247); - uint64_t x250; addcarryx_u64(0x0, x248, x239, &x250); - uint64_t x253; uint8_t x254 = addcarryx_u64(0x0, x216, x229, &x253); - uint64_t x256; uint8_t x257 = addcarryx_u64(x254, x219, x241, &x256); - uint64_t x259; uint8_t x260 = addcarryx_u64(x257, x222, x244, &x259); - uint64_t x262; uint8_t x263 = addcarryx_u64(x260, x225, x247, &x262); - uint64_t x265; uint8_t x266 = addcarryx_u64(x263, x227, x250, &x265); - uint64_t x269; uint64_t x268 = mulx_u64(x253, 0xffffffffffffffffL, &x269); - uint64_t x272; uint64_t x271 = mulx_u64(x253, 0xffffffff, &x272); - uint64_t x275; uint64_t x274 = mulx_u64(x253, 0xffffffff00000001L, &x275); - uint64_t x277; uint8_t x278 = addcarryx_u64(0x0, x269, x271, &x277); - uint64_t x280; uint8_t x281 = addcarryx_u64(x278, x272, 0x0, &x280); - uint64_t x283; uint8_t x284 = addcarryx_u64(x281, 0x0, x274, &x283); - uint64_t x286; addcarryx_u64(0x0, x284, x275, &x286); - uint64_t _5; uint8_t x290 = addcarryx_u64(0x0, x253, x268, &_5); - uint64_t x292; uint8_t x293 = addcarryx_u64(x290, x256, x277, &x292); - uint64_t x295; uint8_t x296 = addcarryx_u64(x293, x259, x280, &x295); - uint64_t x298; uint8_t x299 = addcarryx_u64(x296, x262, x283, &x298); - uint64_t x301; uint8_t x302 = addcarryx_u64(x299, x265, x286, &x301); - uint8_t x303 = (x302 + x266); - uint64_t x305; uint8_t x306 = subborrow_u64(0x0, x292, 0xffffffffffffffffL, &x305); - uint64_t x308; uint8_t x309 = subborrow_u64(x306, x295, 0xffffffff, &x308); - uint64_t x311; uint8_t x312 = subborrow_u64(x309, x298, 0x0, &x311); - uint64_t x314; uint8_t x315 = subborrow_u64(x312, x301, 0xffffffff00000001L, &x314); - uint64_t _6; uint8_t x318 = subborrow_u64(x315, x303, 0x0, &_6); - uint64_t x319 = cmovznz_u64(x318, x314, x301); - uint64_t x320 = cmovznz_u64(x318, x311, x298); - uint64_t x321 = cmovznz_u64(x318, x308, x295); - uint64_t x322 = cmovznz_u64(x318, x305, x292); - out[0] = x322; - out[1] = x321; - out[2] = x320; - out[3] = x319; -} - -static void fe_sub(uint64_t out[4], const uint64_t in1[4], const uint64_t in2[4]) { - const uint64_t x8 = in1[3]; - const uint64_t x9 = in1[2]; - const uint64_t x7 = in1[1]; - const uint64_t x5 = in1[0]; - const uint64_t x14 = in2[3]; - const uint64_t x15 = in2[2]; - const uint64_t x13 = in2[1]; - const uint64_t x11 = in2[0]; - uint64_t x17; uint8_t x18 = subborrow_u64(0x0, x5, x11, &x17); - uint64_t x20; uint8_t x21 = subborrow_u64(x18, x7, x13, &x20); - uint64_t x23; uint8_t x24 = subborrow_u64(x21, x9, x15, &x23); - uint64_t x26; uint8_t x27 = subborrow_u64(x24, x8, x14, &x26); - uint64_t x28 = (uint64_t)cmovznz_u64(x27, 0x0, 0xffffffffffffffffL); - uint64_t x29 = (x28 & 0xffffffffffffffffL); - uint64_t x31; uint8_t x32 = addcarryx_u64(0x0, x17, x29, &x31); - uint64_t x33 = (x28 & 0xffffffff); - uint64_t x35; uint8_t x36 = addcarryx_u64(x32, x20, x33, &x35); - uint64_t x38; uint8_t x39 = addcarryx_u64(x36, x23, 0x0, &x38); - uint64_t x40 = (x28 & 0xffffffff00000001L); - uint64_t x42; addcarryx_u64(x39, x26, x40, &x42); - out[0] = x31; - out[1] = x35; - out[2] = x38; - out[3] = x42; -} - -#else // 64BIT, else 32BIT - -static void fe_add(uint32_t out[8], const uint32_t in1[8], const uint32_t in2[8]) { - const uint32_t x16 = in1[7]; - const uint32_t x17 = in1[6]; - const uint32_t x15 = in1[5]; - const uint32_t x13 = in1[4]; - const uint32_t x11 = in1[3]; - const uint32_t x9 = in1[2]; - const uint32_t x7 = in1[1]; - const uint32_t x5 = in1[0]; - const uint32_t x30 = in2[7]; - const uint32_t x31 = in2[6]; - const uint32_t x29 = in2[5]; - const uint32_t x27 = in2[4]; - const uint32_t x25 = in2[3]; - const uint32_t x23 = in2[2]; - const uint32_t x21 = in2[1]; - const uint32_t x19 = in2[0]; - uint32_t x33; uint8_t x34 = addcarryx_u32(0x0, x5, x19, &x33); - uint32_t x36; uint8_t x37 = addcarryx_u32(x34, x7, x21, &x36); - uint32_t x39; uint8_t x40 = addcarryx_u32(x37, x9, x23, &x39); - uint32_t x42; uint8_t x43 = addcarryx_u32(x40, x11, x25, &x42); - uint32_t x45; uint8_t x46 = addcarryx_u32(x43, x13, x27, &x45); - uint32_t x48; uint8_t x49 = addcarryx_u32(x46, x15, x29, &x48); - uint32_t x51; uint8_t x52 = addcarryx_u32(x49, x17, x31, &x51); - uint32_t x54; uint8_t x55 = addcarryx_u32(x52, x16, x30, &x54); - uint32_t x57; uint8_t x58 = subborrow_u32(0x0, x33, 0xffffffff, &x57); - uint32_t x60; uint8_t x61 = subborrow_u32(x58, x36, 0xffffffff, &x60); - uint32_t x63; uint8_t x64 = subborrow_u32(x61, x39, 0xffffffff, &x63); - uint32_t x66; uint8_t x67 = subborrow_u32(x64, x42, 0x0, &x66); - uint32_t x69; uint8_t x70 = subborrow_u32(x67, x45, 0x0, &x69); - uint32_t x72; uint8_t x73 = subborrow_u32(x70, x48, 0x0, &x72); - uint32_t x75; uint8_t x76 = subborrow_u32(x73, x51, 0x1, &x75); - uint32_t x78; uint8_t x79 = subborrow_u32(x76, x54, 0xffffffff, &x78); - uint32_t _; uint8_t x82 = subborrow_u32(x79, x55, 0x0, &_); - uint32_t x83 = cmovznz_u32(x82, x78, x54); - uint32_t x84 = cmovznz_u32(x82, x75, x51); - uint32_t x85 = cmovznz_u32(x82, x72, x48); - uint32_t x86 = cmovznz_u32(x82, x69, x45); - uint32_t x87 = cmovznz_u32(x82, x66, x42); - uint32_t x88 = cmovznz_u32(x82, x63, x39); - uint32_t x89 = cmovznz_u32(x82, x60, x36); - uint32_t x90 = cmovznz_u32(x82, x57, x33); - out[0] = x90; - out[1] = x89; - out[2] = x88; - out[3] = x87; - out[4] = x86; - out[5] = x85; - out[6] = x84; - out[7] = x83; -} - -static void fe_mul(uint32_t out[8], const uint32_t in1[8], const uint32_t in2[8]) { - const uint32_t x16 = in1[7]; - const uint32_t x17 = in1[6]; - const uint32_t x15 = in1[5]; - const uint32_t x13 = in1[4]; - const uint32_t x11 = in1[3]; - const uint32_t x9 = in1[2]; - const uint32_t x7 = in1[1]; - const uint32_t x5 = in1[0]; - const uint32_t x30 = in2[7]; - const uint32_t x31 = in2[6]; - const uint32_t x29 = in2[5]; - const uint32_t x27 = in2[4]; - const uint32_t x25 = in2[3]; - const uint32_t x23 = in2[2]; - const uint32_t x21 = in2[1]; - const uint32_t x19 = in2[0]; - uint32_t x34; uint32_t x33 = mulx_u32(x5, x19, &x34); - uint32_t x37; uint32_t x36 = mulx_u32(x5, x21, &x37); - uint32_t x40; uint32_t x39 = mulx_u32(x5, x23, &x40); - uint32_t x43; uint32_t x42 = mulx_u32(x5, x25, &x43); - uint32_t x46; uint32_t x45 = mulx_u32(x5, x27, &x46); - uint32_t x49; uint32_t x48 = mulx_u32(x5, x29, &x49); - uint32_t x52; uint32_t x51 = mulx_u32(x5, x31, &x52); - uint32_t x55; uint32_t x54 = mulx_u32(x5, x30, &x55); - uint32_t x57; uint8_t x58 = addcarryx_u32(0x0, x34, x36, &x57); - uint32_t x60; uint8_t x61 = addcarryx_u32(x58, x37, x39, &x60); - uint32_t x63; uint8_t x64 = addcarryx_u32(x61, x40, x42, &x63); - uint32_t x66; uint8_t x67 = addcarryx_u32(x64, x43, x45, &x66); - uint32_t x69; uint8_t x70 = addcarryx_u32(x67, x46, x48, &x69); - uint32_t x72; uint8_t x73 = addcarryx_u32(x70, x49, x51, &x72); - uint32_t x75; uint8_t x76 = addcarryx_u32(x73, x52, x54, &x75); - uint32_t x78; addcarryx_u32(0x0, x76, x55, &x78); - uint32_t x82; uint32_t x81 = mulx_u32(x33, 0xffffffff, &x82); - uint32_t x85; uint32_t x84 = mulx_u32(x33, 0xffffffff, &x85); - uint32_t x88; uint32_t x87 = mulx_u32(x33, 0xffffffff, &x88); - uint32_t x91; uint32_t x90 = mulx_u32(x33, 0xffffffff, &x91); - uint32_t x93; uint8_t x94 = addcarryx_u32(0x0, x82, x84, &x93); - uint32_t x96; uint8_t x97 = addcarryx_u32(x94, x85, x87, &x96); - uint32_t x99; uint8_t x100 = addcarryx_u32(x97, x88, 0x0, &x99); - uint8_t x101 = (0x0 + 0x0); - uint32_t _1; uint8_t x104 = addcarryx_u32(0x0, x33, x81, &_1); - uint32_t x106; uint8_t x107 = addcarryx_u32(x104, x57, x93, &x106); - uint32_t x109; uint8_t x110 = addcarryx_u32(x107, x60, x96, &x109); - uint32_t x112; uint8_t x113 = addcarryx_u32(x110, x63, x99, &x112); - uint32_t x115; uint8_t x116 = addcarryx_u32(x113, x66, x100, &x115); - uint32_t x118; uint8_t x119 = addcarryx_u32(x116, x69, x101, &x118); - uint32_t x121; uint8_t x122 = addcarryx_u32(x119, x72, x33, &x121); - uint32_t x124; uint8_t x125 = addcarryx_u32(x122, x75, x90, &x124); - uint32_t x127; uint8_t x128 = addcarryx_u32(x125, x78, x91, &x127); - uint8_t x129 = (x128 + 0x0); - uint32_t x132; uint32_t x131 = mulx_u32(x7, x19, &x132); - uint32_t x135; uint32_t x134 = mulx_u32(x7, x21, &x135); - uint32_t x138; uint32_t x137 = mulx_u32(x7, x23, &x138); - uint32_t x141; uint32_t x140 = mulx_u32(x7, x25, &x141); - uint32_t x144; uint32_t x143 = mulx_u32(x7, x27, &x144); - uint32_t x147; uint32_t x146 = mulx_u32(x7, x29, &x147); - uint32_t x150; uint32_t x149 = mulx_u32(x7, x31, &x150); - uint32_t x153; uint32_t x152 = mulx_u32(x7, x30, &x153); - uint32_t x155; uint8_t x156 = addcarryx_u32(0x0, x132, x134, &x155); - uint32_t x158; uint8_t x159 = addcarryx_u32(x156, x135, x137, &x158); - uint32_t x161; uint8_t x162 = addcarryx_u32(x159, x138, x140, &x161); - uint32_t x164; uint8_t x165 = addcarryx_u32(x162, x141, x143, &x164); - uint32_t x167; uint8_t x168 = addcarryx_u32(x165, x144, x146, &x167); - uint32_t x170; uint8_t x171 = addcarryx_u32(x168, x147, x149, &x170); - uint32_t x173; uint8_t x174 = addcarryx_u32(x171, x150, x152, &x173); - uint32_t x176; addcarryx_u32(0x0, x174, x153, &x176); - uint32_t x179; uint8_t x180 = addcarryx_u32(0x0, x106, x131, &x179); - uint32_t x182; uint8_t x183 = addcarryx_u32(x180, x109, x155, &x182); - uint32_t x185; uint8_t x186 = addcarryx_u32(x183, x112, x158, &x185); - uint32_t x188; uint8_t x189 = addcarryx_u32(x186, x115, x161, &x188); - uint32_t x191; uint8_t x192 = addcarryx_u32(x189, x118, x164, &x191); - uint32_t x194; uint8_t x195 = addcarryx_u32(x192, x121, x167, &x194); - uint32_t x197; uint8_t x198 = addcarryx_u32(x195, x124, x170, &x197); - uint32_t x200; uint8_t x201 = addcarryx_u32(x198, x127, x173, &x200); - uint32_t x203; uint8_t x204 = addcarryx_u32(x201, x129, x176, &x203); - uint32_t x207; uint32_t x206 = mulx_u32(x179, 0xffffffff, &x207); - uint32_t x210; uint32_t x209 = mulx_u32(x179, 0xffffffff, &x210); - uint32_t x213; uint32_t x212 = mulx_u32(x179, 0xffffffff, &x213); - uint32_t x216; uint32_t x215 = mulx_u32(x179, 0xffffffff, &x216); - uint32_t x218; uint8_t x219 = addcarryx_u32(0x0, x207, x209, &x218); - uint32_t x221; uint8_t x222 = addcarryx_u32(x219, x210, x212, &x221); - uint32_t x224; uint8_t x225 = addcarryx_u32(x222, x213, 0x0, &x224); - uint8_t x226 = (0x0 + 0x0); - uint32_t _2; uint8_t x229 = addcarryx_u32(0x0, x179, x206, &_2); - uint32_t x231; uint8_t x232 = addcarryx_u32(x229, x182, x218, &x231); - uint32_t x234; uint8_t x235 = addcarryx_u32(x232, x185, x221, &x234); - uint32_t x237; uint8_t x238 = addcarryx_u32(x235, x188, x224, &x237); - uint32_t x240; uint8_t x241 = addcarryx_u32(x238, x191, x225, &x240); - uint32_t x243; uint8_t x244 = addcarryx_u32(x241, x194, x226, &x243); - uint32_t x246; uint8_t x247 = addcarryx_u32(x244, x197, x179, &x246); - uint32_t x249; uint8_t x250 = addcarryx_u32(x247, x200, x215, &x249); - uint32_t x252; uint8_t x253 = addcarryx_u32(x250, x203, x216, &x252); - uint8_t x254 = (x253 + x204); - uint32_t x257; uint32_t x256 = mulx_u32(x9, x19, &x257); - uint32_t x260; uint32_t x259 = mulx_u32(x9, x21, &x260); - uint32_t x263; uint32_t x262 = mulx_u32(x9, x23, &x263); - uint32_t x266; uint32_t x265 = mulx_u32(x9, x25, &x266); - uint32_t x269; uint32_t x268 = mulx_u32(x9, x27, &x269); - uint32_t x272; uint32_t x271 = mulx_u32(x9, x29, &x272); - uint32_t x275; uint32_t x274 = mulx_u32(x9, x31, &x275); - uint32_t x278; uint32_t x277 = mulx_u32(x9, x30, &x278); - uint32_t x280; uint8_t x281 = addcarryx_u32(0x0, x257, x259, &x280); - uint32_t x283; uint8_t x284 = addcarryx_u32(x281, x260, x262, &x283); - uint32_t x286; uint8_t x287 = addcarryx_u32(x284, x263, x265, &x286); - uint32_t x289; uint8_t x290 = addcarryx_u32(x287, x266, x268, &x289); - uint32_t x292; uint8_t x293 = addcarryx_u32(x290, x269, x271, &x292); - uint32_t x295; uint8_t x296 = addcarryx_u32(x293, x272, x274, &x295); - uint32_t x298; uint8_t x299 = addcarryx_u32(x296, x275, x277, &x298); - uint32_t x301; addcarryx_u32(0x0, x299, x278, &x301); - uint32_t x304; uint8_t x305 = addcarryx_u32(0x0, x231, x256, &x304); - uint32_t x307; uint8_t x308 = addcarryx_u32(x305, x234, x280, &x307); - uint32_t x310; uint8_t x311 = addcarryx_u32(x308, x237, x283, &x310); - uint32_t x313; uint8_t x314 = addcarryx_u32(x311, x240, x286, &x313); - uint32_t x316; uint8_t x317 = addcarryx_u32(x314, x243, x289, &x316); - uint32_t x319; uint8_t x320 = addcarryx_u32(x317, x246, x292, &x319); - uint32_t x322; uint8_t x323 = addcarryx_u32(x320, x249, x295, &x322); - uint32_t x325; uint8_t x326 = addcarryx_u32(x323, x252, x298, &x325); - uint32_t x328; uint8_t x329 = addcarryx_u32(x326, x254, x301, &x328); - uint32_t x332; uint32_t x331 = mulx_u32(x304, 0xffffffff, &x332); - uint32_t x335; uint32_t x334 = mulx_u32(x304, 0xffffffff, &x335); - uint32_t x338; uint32_t x337 = mulx_u32(x304, 0xffffffff, &x338); - uint32_t x341; uint32_t x340 = mulx_u32(x304, 0xffffffff, &x341); - uint32_t x343; uint8_t x344 = addcarryx_u32(0x0, x332, x334, &x343); - uint32_t x346; uint8_t x347 = addcarryx_u32(x344, x335, x337, &x346); - uint32_t x349; uint8_t x350 = addcarryx_u32(x347, x338, 0x0, &x349); - uint8_t x351 = (0x0 + 0x0); - uint32_t _3; uint8_t x354 = addcarryx_u32(0x0, x304, x331, &_3); - uint32_t x356; uint8_t x357 = addcarryx_u32(x354, x307, x343, &x356); - uint32_t x359; uint8_t x360 = addcarryx_u32(x357, x310, x346, &x359); - uint32_t x362; uint8_t x363 = addcarryx_u32(x360, x313, x349, &x362); - uint32_t x365; uint8_t x366 = addcarryx_u32(x363, x316, x350, &x365); - uint32_t x368; uint8_t x369 = addcarryx_u32(x366, x319, x351, &x368); - uint32_t x371; uint8_t x372 = addcarryx_u32(x369, x322, x304, &x371); - uint32_t x374; uint8_t x375 = addcarryx_u32(x372, x325, x340, &x374); - uint32_t x377; uint8_t x378 = addcarryx_u32(x375, x328, x341, &x377); - uint8_t x379 = (x378 + x329); - uint32_t x382; uint32_t x381 = mulx_u32(x11, x19, &x382); - uint32_t x385; uint32_t x384 = mulx_u32(x11, x21, &x385); - uint32_t x388; uint32_t x387 = mulx_u32(x11, x23, &x388); - uint32_t x391; uint32_t x390 = mulx_u32(x11, x25, &x391); - uint32_t x394; uint32_t x393 = mulx_u32(x11, x27, &x394); - uint32_t x397; uint32_t x396 = mulx_u32(x11, x29, &x397); - uint32_t x400; uint32_t x399 = mulx_u32(x11, x31, &x400); - uint32_t x403; uint32_t x402 = mulx_u32(x11, x30, &x403); - uint32_t x405; uint8_t x406 = addcarryx_u32(0x0, x382, x384, &x405); - uint32_t x408; uint8_t x409 = addcarryx_u32(x406, x385, x387, &x408); - uint32_t x411; uint8_t x412 = addcarryx_u32(x409, x388, x390, &x411); - uint32_t x414; uint8_t x415 = addcarryx_u32(x412, x391, x393, &x414); - uint32_t x417; uint8_t x418 = addcarryx_u32(x415, x394, x396, &x417); - uint32_t x420; uint8_t x421 = addcarryx_u32(x418, x397, x399, &x420); - uint32_t x423; uint8_t x424 = addcarryx_u32(x421, x400, x402, &x423); - uint32_t x426; addcarryx_u32(0x0, x424, x403, &x426); - uint32_t x429; uint8_t x430 = addcarryx_u32(0x0, x356, x381, &x429); - uint32_t x432; uint8_t x433 = addcarryx_u32(x430, x359, x405, &x432); - uint32_t x435; uint8_t x436 = addcarryx_u32(x433, x362, x408, &x435); - uint32_t x438; uint8_t x439 = addcarryx_u32(x436, x365, x411, &x438); - uint32_t x441; uint8_t x442 = addcarryx_u32(x439, x368, x414, &x441); - uint32_t x444; uint8_t x445 = addcarryx_u32(x442, x371, x417, &x444); - uint32_t x447; uint8_t x448 = addcarryx_u32(x445, x374, x420, &x447); - uint32_t x450; uint8_t x451 = addcarryx_u32(x448, x377, x423, &x450); - uint32_t x453; uint8_t x454 = addcarryx_u32(x451, x379, x426, &x453); - uint32_t x457; uint32_t x456 = mulx_u32(x429, 0xffffffff, &x457); - uint32_t x460; uint32_t x459 = mulx_u32(x429, 0xffffffff, &x460); - uint32_t x463; uint32_t x462 = mulx_u32(x429, 0xffffffff, &x463); - uint32_t x466; uint32_t x465 = mulx_u32(x429, 0xffffffff, &x466); - uint32_t x468; uint8_t x469 = addcarryx_u32(0x0, x457, x459, &x468); - uint32_t x471; uint8_t x472 = addcarryx_u32(x469, x460, x462, &x471); - uint32_t x474; uint8_t x475 = addcarryx_u32(x472, x463, 0x0, &x474); - uint8_t x476 = (0x0 + 0x0); - uint32_t _4; uint8_t x479 = addcarryx_u32(0x0, x429, x456, &_4); - uint32_t x481; uint8_t x482 = addcarryx_u32(x479, x432, x468, &x481); - uint32_t x484; uint8_t x485 = addcarryx_u32(x482, x435, x471, &x484); - uint32_t x487; uint8_t x488 = addcarryx_u32(x485, x438, x474, &x487); - uint32_t x490; uint8_t x491 = addcarryx_u32(x488, x441, x475, &x490); - uint32_t x493; uint8_t x494 = addcarryx_u32(x491, x444, x476, &x493); - uint32_t x496; uint8_t x497 = addcarryx_u32(x494, x447, x429, &x496); - uint32_t x499; uint8_t x500 = addcarryx_u32(x497, x450, x465, &x499); - uint32_t x502; uint8_t x503 = addcarryx_u32(x500, x453, x466, &x502); - uint8_t x504 = (x503 + x454); - uint32_t x507; uint32_t x506 = mulx_u32(x13, x19, &x507); - uint32_t x510; uint32_t x509 = mulx_u32(x13, x21, &x510); - uint32_t x513; uint32_t x512 = mulx_u32(x13, x23, &x513); - uint32_t x516; uint32_t x515 = mulx_u32(x13, x25, &x516); - uint32_t x519; uint32_t x518 = mulx_u32(x13, x27, &x519); - uint32_t x522; uint32_t x521 = mulx_u32(x13, x29, &x522); - uint32_t x525; uint32_t x524 = mulx_u32(x13, x31, &x525); - uint32_t x528; uint32_t x527 = mulx_u32(x13, x30, &x528); - uint32_t x530; uint8_t x531 = addcarryx_u32(0x0, x507, x509, &x530); - uint32_t x533; uint8_t x534 = addcarryx_u32(x531, x510, x512, &x533); - uint32_t x536; uint8_t x537 = addcarryx_u32(x534, x513, x515, &x536); - uint32_t x539; uint8_t x540 = addcarryx_u32(x537, x516, x518, &x539); - uint32_t x542; uint8_t x543 = addcarryx_u32(x540, x519, x521, &x542); - uint32_t x545; uint8_t x546 = addcarryx_u32(x543, x522, x524, &x545); - uint32_t x548; uint8_t x549 = addcarryx_u32(x546, x525, x527, &x548); - uint32_t x551; addcarryx_u32(0x0, x549, x528, &x551); - uint32_t x554; uint8_t x555 = addcarryx_u32(0x0, x481, x506, &x554); - uint32_t x557; uint8_t x558 = addcarryx_u32(x555, x484, x530, &x557); - uint32_t x560; uint8_t x561 = addcarryx_u32(x558, x487, x533, &x560); - uint32_t x563; uint8_t x564 = addcarryx_u32(x561, x490, x536, &x563); - uint32_t x566; uint8_t x567 = addcarryx_u32(x564, x493, x539, &x566); - uint32_t x569; uint8_t x570 = addcarryx_u32(x567, x496, x542, &x569); - uint32_t x572; uint8_t x573 = addcarryx_u32(x570, x499, x545, &x572); - uint32_t x575; uint8_t x576 = addcarryx_u32(x573, x502, x548, &x575); - uint32_t x578; uint8_t x579 = addcarryx_u32(x576, x504, x551, &x578); - uint32_t x582; uint32_t x581 = mulx_u32(x554, 0xffffffff, &x582); - uint32_t x585; uint32_t x584 = mulx_u32(x554, 0xffffffff, &x585); - uint32_t x588; uint32_t x587 = mulx_u32(x554, 0xffffffff, &x588); - uint32_t x591; uint32_t x590 = mulx_u32(x554, 0xffffffff, &x591); - uint32_t x593; uint8_t x594 = addcarryx_u32(0x0, x582, x584, &x593); - uint32_t x596; uint8_t x597 = addcarryx_u32(x594, x585, x587, &x596); - uint32_t x599; uint8_t x600 = addcarryx_u32(x597, x588, 0x0, &x599); - uint8_t x601 = (0x0 + 0x0); - uint32_t _5; uint8_t x604 = addcarryx_u32(0x0, x554, x581, &_5); - uint32_t x606; uint8_t x607 = addcarryx_u32(x604, x557, x593, &x606); - uint32_t x609; uint8_t x610 = addcarryx_u32(x607, x560, x596, &x609); - uint32_t x612; uint8_t x613 = addcarryx_u32(x610, x563, x599, &x612); - uint32_t x615; uint8_t x616 = addcarryx_u32(x613, x566, x600, &x615); - uint32_t x618; uint8_t x619 = addcarryx_u32(x616, x569, x601, &x618); - uint32_t x621; uint8_t x622 = addcarryx_u32(x619, x572, x554, &x621); - uint32_t x624; uint8_t x625 = addcarryx_u32(x622, x575, x590, &x624); - uint32_t x627; uint8_t x628 = addcarryx_u32(x625, x578, x591, &x627); - uint8_t x629 = (x628 + x579); - uint32_t x632; uint32_t x631 = mulx_u32(x15, x19, &x632); - uint32_t x635; uint32_t x634 = mulx_u32(x15, x21, &x635); - uint32_t x638; uint32_t x637 = mulx_u32(x15, x23, &x638); - uint32_t x641; uint32_t x640 = mulx_u32(x15, x25, &x641); - uint32_t x644; uint32_t x643 = mulx_u32(x15, x27, &x644); - uint32_t x647; uint32_t x646 = mulx_u32(x15, x29, &x647); - uint32_t x650; uint32_t x649 = mulx_u32(x15, x31, &x650); - uint32_t x653; uint32_t x652 = mulx_u32(x15, x30, &x653); - uint32_t x655; uint8_t x656 = addcarryx_u32(0x0, x632, x634, &x655); - uint32_t x658; uint8_t x659 = addcarryx_u32(x656, x635, x637, &x658); - uint32_t x661; uint8_t x662 = addcarryx_u32(x659, x638, x640, &x661); - uint32_t x664; uint8_t x665 = addcarryx_u32(x662, x641, x643, &x664); - uint32_t x667; uint8_t x668 = addcarryx_u32(x665, x644, x646, &x667); - uint32_t x670; uint8_t x671 = addcarryx_u32(x668, x647, x649, &x670); - uint32_t x673; uint8_t x674 = addcarryx_u32(x671, x650, x652, &x673); - uint32_t x676; addcarryx_u32(0x0, x674, x653, &x676); - uint32_t x679; uint8_t x680 = addcarryx_u32(0x0, x606, x631, &x679); - uint32_t x682; uint8_t x683 = addcarryx_u32(x680, x609, x655, &x682); - uint32_t x685; uint8_t x686 = addcarryx_u32(x683, x612, x658, &x685); - uint32_t x688; uint8_t x689 = addcarryx_u32(x686, x615, x661, &x688); - uint32_t x691; uint8_t x692 = addcarryx_u32(x689, x618, x664, &x691); - uint32_t x694; uint8_t x695 = addcarryx_u32(x692, x621, x667, &x694); - uint32_t x697; uint8_t x698 = addcarryx_u32(x695, x624, x670, &x697); - uint32_t x700; uint8_t x701 = addcarryx_u32(x698, x627, x673, &x700); - uint32_t x703; uint8_t x704 = addcarryx_u32(x701, x629, x676, &x703); - uint32_t x707; uint32_t x706 = mulx_u32(x679, 0xffffffff, &x707); - uint32_t x710; uint32_t x709 = mulx_u32(x679, 0xffffffff, &x710); - uint32_t x713; uint32_t x712 = mulx_u32(x679, 0xffffffff, &x713); - uint32_t x716; uint32_t x715 = mulx_u32(x679, 0xffffffff, &x716); - uint32_t x718; uint8_t x719 = addcarryx_u32(0x0, x707, x709, &x718); - uint32_t x721; uint8_t x722 = addcarryx_u32(x719, x710, x712, &x721); - uint32_t x724; uint8_t x725 = addcarryx_u32(x722, x713, 0x0, &x724); - uint8_t x726 = (0x0 + 0x0); - uint32_t _6; uint8_t x729 = addcarryx_u32(0x0, x679, x706, &_6); - uint32_t x731; uint8_t x732 = addcarryx_u32(x729, x682, x718, &x731); - uint32_t x734; uint8_t x735 = addcarryx_u32(x732, x685, x721, &x734); - uint32_t x737; uint8_t x738 = addcarryx_u32(x735, x688, x724, &x737); - uint32_t x740; uint8_t x741 = addcarryx_u32(x738, x691, x725, &x740); - uint32_t x743; uint8_t x744 = addcarryx_u32(x741, x694, x726, &x743); - uint32_t x746; uint8_t x747 = addcarryx_u32(x744, x697, x679, &x746); - uint32_t x749; uint8_t x750 = addcarryx_u32(x747, x700, x715, &x749); - uint32_t x752; uint8_t x753 = addcarryx_u32(x750, x703, x716, &x752); - uint8_t x754 = (x753 + x704); - uint32_t x757; uint32_t x756 = mulx_u32(x17, x19, &x757); - uint32_t x760; uint32_t x759 = mulx_u32(x17, x21, &x760); - uint32_t x763; uint32_t x762 = mulx_u32(x17, x23, &x763); - uint32_t x766; uint32_t x765 = mulx_u32(x17, x25, &x766); - uint32_t x769; uint32_t x768 = mulx_u32(x17, x27, &x769); - uint32_t x772; uint32_t x771 = mulx_u32(x17, x29, &x772); - uint32_t x775; uint32_t x774 = mulx_u32(x17, x31, &x775); - uint32_t x778; uint32_t x777 = mulx_u32(x17, x30, &x778); - uint32_t x780; uint8_t x781 = addcarryx_u32(0x0, x757, x759, &x780); - uint32_t x783; uint8_t x784 = addcarryx_u32(x781, x760, x762, &x783); - uint32_t x786; uint8_t x787 = addcarryx_u32(x784, x763, x765, &x786); - uint32_t x789; uint8_t x790 = addcarryx_u32(x787, x766, x768, &x789); - uint32_t x792; uint8_t x793 = addcarryx_u32(x790, x769, x771, &x792); - uint32_t x795; uint8_t x796 = addcarryx_u32(x793, x772, x774, &x795); - uint32_t x798; uint8_t x799 = addcarryx_u32(x796, x775, x777, &x798); - uint32_t x801; addcarryx_u32(0x0, x799, x778, &x801); - uint32_t x804; uint8_t x805 = addcarryx_u32(0x0, x731, x756, &x804); - uint32_t x807; uint8_t x808 = addcarryx_u32(x805, x734, x780, &x807); - uint32_t x810; uint8_t x811 = addcarryx_u32(x808, x737, x783, &x810); - uint32_t x813; uint8_t x814 = addcarryx_u32(x811, x740, x786, &x813); - uint32_t x816; uint8_t x817 = addcarryx_u32(x814, x743, x789, &x816); - uint32_t x819; uint8_t x820 = addcarryx_u32(x817, x746, x792, &x819); - uint32_t x822; uint8_t x823 = addcarryx_u32(x820, x749, x795, &x822); - uint32_t x825; uint8_t x826 = addcarryx_u32(x823, x752, x798, &x825); - uint32_t x828; uint8_t x829 = addcarryx_u32(x826, x754, x801, &x828); - uint32_t x832; uint32_t x831 = mulx_u32(x804, 0xffffffff, &x832); - uint32_t x835; uint32_t x834 = mulx_u32(x804, 0xffffffff, &x835); - uint32_t x838; uint32_t x837 = mulx_u32(x804, 0xffffffff, &x838); - uint32_t x841; uint32_t x840 = mulx_u32(x804, 0xffffffff, &x841); - uint32_t x843; uint8_t x844 = addcarryx_u32(0x0, x832, x834, &x843); - uint32_t x846; uint8_t x847 = addcarryx_u32(x844, x835, x837, &x846); - uint32_t x849; uint8_t x850 = addcarryx_u32(x847, x838, 0x0, &x849); - uint8_t x851 = (0x0 + 0x0); - uint32_t _7; uint8_t x854 = addcarryx_u32(0x0, x804, x831, &_7); - uint32_t x856; uint8_t x857 = addcarryx_u32(x854, x807, x843, &x856); - uint32_t x859; uint8_t x860 = addcarryx_u32(x857, x810, x846, &x859); - uint32_t x862; uint8_t x863 = addcarryx_u32(x860, x813, x849, &x862); - uint32_t x865; uint8_t x866 = addcarryx_u32(x863, x816, x850, &x865); - uint32_t x868; uint8_t x869 = addcarryx_u32(x866, x819, x851, &x868); - uint32_t x871; uint8_t x872 = addcarryx_u32(x869, x822, x804, &x871); - uint32_t x874; uint8_t x875 = addcarryx_u32(x872, x825, x840, &x874); - uint32_t x877; uint8_t x878 = addcarryx_u32(x875, x828, x841, &x877); - uint8_t x879 = (x878 + x829); - uint32_t x882; uint32_t x881 = mulx_u32(x16, x19, &x882); - uint32_t x885; uint32_t x884 = mulx_u32(x16, x21, &x885); - uint32_t x888; uint32_t x887 = mulx_u32(x16, x23, &x888); - uint32_t x891; uint32_t x890 = mulx_u32(x16, x25, &x891); - uint32_t x894; uint32_t x893 = mulx_u32(x16, x27, &x894); - uint32_t x897; uint32_t x896 = mulx_u32(x16, x29, &x897); - uint32_t x900; uint32_t x899 = mulx_u32(x16, x31, &x900); - uint32_t x903; uint32_t x902 = mulx_u32(x16, x30, &x903); - uint32_t x905; uint8_t x906 = addcarryx_u32(0x0, x882, x884, &x905); - uint32_t x908; uint8_t x909 = addcarryx_u32(x906, x885, x887, &x908); - uint32_t x911; uint8_t x912 = addcarryx_u32(x909, x888, x890, &x911); - uint32_t x914; uint8_t x915 = addcarryx_u32(x912, x891, x893, &x914); - uint32_t x917; uint8_t x918 = addcarryx_u32(x915, x894, x896, &x917); - uint32_t x920; uint8_t x921 = addcarryx_u32(x918, x897, x899, &x920); - uint32_t x923; uint8_t x924 = addcarryx_u32(x921, x900, x902, &x923); - uint32_t x926; addcarryx_u32(0x0, x924, x903, &x926); - uint32_t x929; uint8_t x930 = addcarryx_u32(0x0, x856, x881, &x929); - uint32_t x932; uint8_t x933 = addcarryx_u32(x930, x859, x905, &x932); - uint32_t x935; uint8_t x936 = addcarryx_u32(x933, x862, x908, &x935); - uint32_t x938; uint8_t x939 = addcarryx_u32(x936, x865, x911, &x938); - uint32_t x941; uint8_t x942 = addcarryx_u32(x939, x868, x914, &x941); - uint32_t x944; uint8_t x945 = addcarryx_u32(x942, x871, x917, &x944); - uint32_t x947; uint8_t x948 = addcarryx_u32(x945, x874, x920, &x947); - uint32_t x950; uint8_t x951 = addcarryx_u32(x948, x877, x923, &x950); - uint32_t x953; uint8_t x954 = addcarryx_u32(x951, x879, x926, &x953); - uint32_t x957; uint32_t x956 = mulx_u32(x929, 0xffffffff, &x957); - uint32_t x960; uint32_t x959 = mulx_u32(x929, 0xffffffff, &x960); - uint32_t x963; uint32_t x962 = mulx_u32(x929, 0xffffffff, &x963); - uint32_t x966; uint32_t x965 = mulx_u32(x929, 0xffffffff, &x966); - uint32_t x968; uint8_t x969 = addcarryx_u32(0x0, x957, x959, &x968); - uint32_t x971; uint8_t x972 = addcarryx_u32(x969, x960, x962, &x971); - uint32_t x974; uint8_t x975 = addcarryx_u32(x972, x963, 0x0, &x974); - uint8_t x976 = (0x0 + 0x0); - uint32_t _8; uint8_t x979 = addcarryx_u32(0x0, x929, x956, &_8); - uint32_t x981; uint8_t x982 = addcarryx_u32(x979, x932, x968, &x981); - uint32_t x984; uint8_t x985 = addcarryx_u32(x982, x935, x971, &x984); - uint32_t x987; uint8_t x988 = addcarryx_u32(x985, x938, x974, &x987); - uint32_t x990; uint8_t x991 = addcarryx_u32(x988, x941, x975, &x990); - uint32_t x993; uint8_t x994 = addcarryx_u32(x991, x944, x976, &x993); - uint32_t x996; uint8_t x997 = addcarryx_u32(x994, x947, x929, &x996); - uint32_t x999; uint8_t x1000 = addcarryx_u32(x997, x950, x965, &x999); - uint32_t x1002; uint8_t x1003 = addcarryx_u32(x1000, x953, x966, &x1002); - uint8_t x1004 = (x1003 + x954); - uint32_t x1006; uint8_t x1007 = subborrow_u32(0x0, x981, 0xffffffff, &x1006); - uint32_t x1009; uint8_t x1010 = subborrow_u32(x1007, x984, 0xffffffff, &x1009); - uint32_t x1012; uint8_t x1013 = subborrow_u32(x1010, x987, 0xffffffff, &x1012); - uint32_t x1015; uint8_t x1016 = subborrow_u32(x1013, x990, 0x0, &x1015); - uint32_t x1018; uint8_t x1019 = subborrow_u32(x1016, x993, 0x0, &x1018); - uint32_t x1021; uint8_t x1022 = subborrow_u32(x1019, x996, 0x0, &x1021); - uint32_t x1024; uint8_t x1025 = subborrow_u32(x1022, x999, 0x1, &x1024); - uint32_t x1027; uint8_t x1028 = subborrow_u32(x1025, x1002, 0xffffffff, &x1027); - uint32_t _9; uint8_t x1031 = subborrow_u32(x1028, x1004, 0x0, &_9); - uint32_t x1032 = cmovznz_u32(x1031, x1027, x1002); - uint32_t x1033 = cmovznz_u32(x1031, x1024, x999); - uint32_t x1034 = cmovznz_u32(x1031, x1021, x996); - uint32_t x1035 = cmovznz_u32(x1031, x1018, x993); - uint32_t x1036 = cmovznz_u32(x1031, x1015, x990); - uint32_t x1037 = cmovznz_u32(x1031, x1012, x987); - uint32_t x1038 = cmovznz_u32(x1031, x1009, x984); - uint32_t x1039 = cmovznz_u32(x1031, x1006, x981); - out[0] = x1039; - out[1] = x1038; - out[2] = x1037; - out[3] = x1036; - out[4] = x1035; - out[5] = x1034; - out[6] = x1033; - out[7] = x1032; -} - -// NOTE: the following functions are generated from fiat-crypto, from the same -// template as their 64-bit counterparts above, but the correctness proof of -// the template was not composed with the correctness proof of the -// specialization pipeline. This is because Coq unexplainedly loops on trying -// to synthesize opp and sub using the normal pipeline. - -static void fe_sub(uint32_t out[8], const uint32_t in1[8], const uint32_t in2[8]) { - const uint32_t x14 = in1[7]; - const uint32_t x15 = in1[6]; - const uint32_t x13 = in1[5]; - const uint32_t x11 = in1[4]; - const uint32_t x9 = in1[3]; - const uint32_t x7 = in1[2]; - const uint32_t x5 = in1[1]; - const uint32_t x3 = in1[0]; - const uint32_t x28 = in2[7]; - const uint32_t x29 = in2[6]; - const uint32_t x27 = in2[5]; - const uint32_t x25 = in2[4]; - const uint32_t x23 = in2[3]; - const uint32_t x21 = in2[2]; - const uint32_t x19 = in2[1]; - const uint32_t x17 = in2[0]; - uint32_t x31; uint8_t x32 = subborrow_u32(0x0, x3, x17, &x31); - uint32_t x34; uint8_t x35 = subborrow_u32(x32, x5, x19, &x34); - uint32_t x37; uint8_t x38 = subborrow_u32(x35, x7, x21, &x37); - uint32_t x40; uint8_t x41 = subborrow_u32(x38, x9, x23, &x40); - uint32_t x43; uint8_t x44 = subborrow_u32(x41, x11, x25, &x43); - uint32_t x46; uint8_t x47 = subborrow_u32(x44, x13, x27, &x46); - uint32_t x49; uint8_t x50 = subborrow_u32(x47, x15, x29, &x49); - uint32_t x52; uint8_t x53 = subborrow_u32(x50, x14, x28, &x52); - uint32_t x54 = cmovznz_u32(x53, 0x0, 0xffffffff); - uint32_t x56; uint8_t x57 = addcarryx_u32(0x0, x31, (x54 & 0xffffffff), &x56); - uint32_t x59; uint8_t x60 = addcarryx_u32(x57, x34, (x54 & 0xffffffff), &x59); - uint32_t x62; uint8_t x63 = addcarryx_u32(x60, x37, (x54 & 0xffffffff), &x62); - uint32_t x65; uint8_t x66 = addcarryx_u32(x63, x40, 0x0, &x65); - uint32_t x68; uint8_t x69 = addcarryx_u32(x66, x43, 0x0, &x68); - uint32_t x71; uint8_t x72 = addcarryx_u32(x69, x46, 0x0, &x71); - uint32_t x74; uint8_t x75 = addcarryx_u32(x72, x49, ((uint8_t)x54 & 0x1), &x74); - uint32_t x77; addcarryx_u32(x75, x52, (x54 & 0xffffffff), &x77); - out[0] = x56; - out[1] = x59; - out[2] = x62; - out[3] = x65; - out[4] = x68; - out[5] = x71; - out[6] = x74; - out[7] = x77; -} - -// fe_op sets out = -in -static void fe_opp(uint32_t out[8], const uint32_t in1[8]) { - const uint32_t x12 = in1[7]; - const uint32_t x13 = in1[6]; - const uint32_t x11 = in1[5]; - const uint32_t x9 = in1[4]; - const uint32_t x7 = in1[3]; - const uint32_t x5 = in1[2]; - const uint32_t x3 = in1[1]; - const uint32_t x1 = in1[0]; - uint32_t x15; uint8_t x16 = subborrow_u32(0x0, 0x0, x1, &x15); - uint32_t x18; uint8_t x19 = subborrow_u32(x16, 0x0, x3, &x18); - uint32_t x21; uint8_t x22 = subborrow_u32(x19, 0x0, x5, &x21); - uint32_t x24; uint8_t x25 = subborrow_u32(x22, 0x0, x7, &x24); - uint32_t x27; uint8_t x28 = subborrow_u32(x25, 0x0, x9, &x27); - uint32_t x30; uint8_t x31 = subborrow_u32(x28, 0x0, x11, &x30); - uint32_t x33; uint8_t x34 = subborrow_u32(x31, 0x0, x13, &x33); - uint32_t x36; uint8_t x37 = subborrow_u32(x34, 0x0, x12, &x36); - uint32_t x38 = cmovznz_u32(x37, 0x0, 0xffffffff); - uint32_t x40; uint8_t x41 = addcarryx_u32(0x0, x15, (x38 & 0xffffffff), &x40); - uint32_t x43; uint8_t x44 = addcarryx_u32(x41, x18, (x38 & 0xffffffff), &x43); - uint32_t x46; uint8_t x47 = addcarryx_u32(x44, x21, (x38 & 0xffffffff), &x46); - uint32_t x49; uint8_t x50 = addcarryx_u32(x47, x24, 0x0, &x49); - uint32_t x52; uint8_t x53 = addcarryx_u32(x50, x27, 0x0, &x52); - uint32_t x55; uint8_t x56 = addcarryx_u32(x53, x30, 0x0, &x55); - uint32_t x58; uint8_t x59 = addcarryx_u32(x56, x33, ((uint8_t)x38 & 0x1), &x58); - uint32_t x61; addcarryx_u32(x59, x36, (x38 & 0xffffffff), &x61); - out[0] = x40; - out[1] = x43; - out[2] = x46; - out[3] = x49; - out[4] = x52; - out[5] = x55; - out[6] = x58; - out[7] = x61; -} - -#endif - -// utility functions, handwritten - -#define NBYTES 32 - -#if defined(BORINGSSL_NISTP256_64BIT) - -#define NLIMBS 4 -typedef uint64_t limb_t; -#define cmovznz_limb cmovznz_u64 -typedef uint64_t fe[NLIMBS]; -#else // 64BIT; else 32BIT - -#define NLIMBS 8 -typedef uint32_t limb_t; -#define cmovznz_limb cmovznz_u32 -typedef uint32_t fe[NLIMBS]; - -#endif // 64BIT - -static limb_t fe_nz(const limb_t in1[NLIMBS]) { - limb_t ret = 0; - for (int i = 0; i < NLIMBS; i++) { - ret |= in1[i]; - } - return ret; -} - -static void fe_copy(limb_t out[NLIMBS], const limb_t in1[NLIMBS]) { - for (int i = 0; i < NLIMBS; i++) { - out[i] = in1[i]; - } -} - -static void fe_cmovznz(limb_t out[NLIMBS], limb_t t, const limb_t z[NLIMBS], - const limb_t nz[NLIMBS]) { - for (int i = 0; i < NLIMBS; i++) { - out[i] = cmovznz_limb(t, z[i], nz[i]); - } -} - -static void fe_sqr(fe out, const fe in) { - fe_mul(out, in, in); -} - -static void fe_tobytes(uint8_t out[NBYTES], const fe in) { - for (int i = 0; i> (8*(i%sizeof(in[0])))); - } -} - -static void fe_frombytes(fe out, const uint8_t in[NBYTES]) { - for (int i = 0; i -// As a sanity check, a proof that these points form a commutative group: -// - -// point_double calculates 2*(x_in, y_in, z_in) -// -// The method is taken from: -// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#doubling-dbl-2001-b -// -// Coq transcription and correctness proof: -// -// -// -// Outputs can equal corresponding inputs, i.e., x_out == x_in is allowed. -// while x_out == y_in is not (maybe this works, but it's not tested). -static void point_double(fe x_out, fe y_out, fe z_out, - const fe x_in, const fe y_in, const fe z_in) { - fe delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; - // delta = z^2 - fe_sqr(delta, z_in); - // gamma = y^2 - fe_sqr(gamma, y_in); - // beta = x*gamma - fe_mul(beta, x_in, gamma); - - // alpha = 3*(x-delta)*(x+delta) - fe_sub(ftmp, x_in, delta); - fe_add(ftmp2, x_in, delta); - - fe_add(tmptmp, ftmp2, ftmp2); - fe_add(ftmp2, ftmp2, tmptmp); - fe_mul(alpha, ftmp, ftmp2); - - // x' = alpha^2 - 8*beta - fe_sqr(x_out, alpha); - fe_add(fourbeta, beta, beta); - fe_add(fourbeta, fourbeta, fourbeta); - fe_add(tmptmp, fourbeta, fourbeta); - fe_sub(x_out, x_out, tmptmp); - - // z' = (y + z)^2 - gamma - delta - fe_add(delta, gamma, delta); - fe_add(ftmp, y_in, z_in); - fe_sqr(z_out, ftmp); - fe_sub(z_out, z_out, delta); - - // y' = alpha*(4*beta - x') - 8*gamma^2 - fe_sub(y_out, fourbeta, x_out); - fe_add(gamma, gamma, gamma); - fe_sqr(gamma, gamma); - fe_mul(y_out, alpha, y_out); - fe_add(gamma, gamma, gamma); - fe_sub(y_out, y_out, gamma); -} - -// point_add calcuates (x1, y1, z1) + (x2, y2, z2) -// -// The method is taken from: -// http://hyperelliptic.org/EFD/g1p/auto-shortw-jacobian-3.html#addition-add-2007-bl, -// adapted for mixed addition (z2 = 1, or z2 = 0 for the point at infinity). -// -// Coq transcription and correctness proof: -// -// -// -// This function includes a branch for checking whether the two input points -// are equal, (while not equal to the point at infinity). This case never -// happens during single point multiplication, so there is no timing leak for -// ECDH or ECDSA signing. -static void point_add(fe x3, fe y3, fe z3, const fe x1, - const fe y1, const fe z1, const int mixed, - const fe x2, const fe y2, const fe z2) { - fe x_out, y_out, z_out; - limb_t z1nz = fe_nz(z1); - limb_t z2nz = fe_nz(z2); - - // z1z1 = z1z1 = z1**2 - fe z1z1; fe_sqr(z1z1, z1); - - fe u1, s1, two_z1z2; - if (!mixed) { - // z2z2 = z2**2 - fe z2z2; fe_sqr(z2z2, z2); - - // u1 = x1*z2z2 - fe_mul(u1, x1, z2z2); - - // two_z1z2 = (z1 + z2)**2 - (z1z1 + z2z2) = 2z1z2 - fe_add(two_z1z2, z1, z2); - fe_sqr(two_z1z2, two_z1z2); - fe_sub(two_z1z2, two_z1z2, z1z1); - fe_sub(two_z1z2, two_z1z2, z2z2); - - // s1 = y1 * z2**3 - fe_mul(s1, z2, z2z2); - fe_mul(s1, s1, y1); - } else { - // We'll assume z2 = 1 (special case z2 = 0 is handled later). - - // u1 = x1*z2z2 - fe_copy(u1, x1); - // two_z1z2 = 2z1z2 - fe_add(two_z1z2, z1, z1); - // s1 = y1 * z2**3 - fe_copy(s1, y1); - } - - // u2 = x2*z1z1 - fe u2; fe_mul(u2, x2, z1z1); - - // h = u2 - u1 - fe h; fe_sub(h, u2, u1); - - limb_t xneq = fe_nz(h); - - // z_out = two_z1z2 * h - fe_mul(z_out, h, two_z1z2); - - // z1z1z1 = z1 * z1z1 - fe z1z1z1; fe_mul(z1z1z1, z1, z1z1); - - // s2 = y2 * z1**3 - fe s2; fe_mul(s2, y2, z1z1z1); - - // r = (s2 - s1)*2 - fe r; - fe_sub(r, s2, s1); - fe_add(r, r, r); - - limb_t yneq = fe_nz(r); - - if (!xneq && !yneq && z1nz && z2nz) { - point_double(x3, y3, z3, x1, y1, z1); - return; - } - - // I = (2h)**2 - fe i; - fe_add(i, h, h); - fe_sqr(i, i); - - // J = h * I - fe j; fe_mul(j, h, i); - - // V = U1 * I - fe v; fe_mul(v, u1, i); - - // x_out = r**2 - J - 2V - fe_sqr(x_out, r); - fe_sub(x_out, x_out, j); - fe_sub(x_out, x_out, v); - fe_sub(x_out, x_out, v); - - // y_out = r(V-x_out) - 2 * s1 * J - fe_sub(y_out, v, x_out); - fe_mul(y_out, y_out, r); - fe s1j; - fe_mul(s1j, s1, j); - fe_sub(y_out, y_out, s1j); - fe_sub(y_out, y_out, s1j); - - fe_cmovznz(x_out, z1nz, x2, x_out); - fe_cmovznz(x3, z2nz, x1, x_out); - fe_cmovznz(y_out, z1nz, y2, y_out); - fe_cmovznz(y3, z2nz, y1, y_out); - fe_cmovznz(z_out, z1nz, z2, z_out); - fe_cmovznz(z3, z2nz, z1, z_out); -} - -// Base point pre computation -// -------------------------- -// -// Two different sorts of precomputed tables are used in the following code. -// Each contain various points on the curve, where each point is three field -// elements (x, y, z). -// -// For the base point table, z is usually 1 (0 for the point at infinity). -// This table has 2 * 16 elements, starting with the following: -// index | bits | point -// ------+---------+------------------------------ -// 0 | 0 0 0 0 | 0G -// 1 | 0 0 0 1 | 1G -// 2 | 0 0 1 0 | 2^64G -// 3 | 0 0 1 1 | (2^64 + 1)G -// 4 | 0 1 0 0 | 2^128G -// 5 | 0 1 0 1 | (2^128 + 1)G -// 6 | 0 1 1 0 | (2^128 + 2^64)G -// 7 | 0 1 1 1 | (2^128 + 2^64 + 1)G -// 8 | 1 0 0 0 | 2^192G -// 9 | 1 0 0 1 | (2^192 + 1)G -// 10 | 1 0 1 0 | (2^192 + 2^64)G -// 11 | 1 0 1 1 | (2^192 + 2^64 + 1)G -// 12 | 1 1 0 0 | (2^192 + 2^128)G -// 13 | 1 1 0 1 | (2^192 + 2^128 + 1)G -// 14 | 1 1 1 0 | (2^192 + 2^128 + 2^64)G -// 15 | 1 1 1 1 | (2^192 + 2^128 + 2^64 + 1)G -// followed by a copy of this with each element multiplied by 2^32. -// -// The reason for this is so that we can clock bits into four different -// locations when doing simple scalar multiplies against the base point, -// and then another four locations using the second 16 elements. -// -// Tables for other points have table[i] = iG for i in 0 .. 16. - -// g_pre_comp is the table of precomputed base points -#if defined(BORINGSSL_NISTP256_64BIT) -static const fe g_pre_comp[2][16][3] = { - {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, - {{0x79e730d418a9143c, 0x75ba95fc5fedb601, 0x79fb732b77622510, - 0x18905f76a53755c6}, - {0xddf25357ce95560a, 0x8b4ab8e4ba19e45c, 0xd2e88688dd21f325, - 0x8571ff1825885d85}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x4f922fc516a0d2bb, 0xd5cc16c1a623499, 0x9241cf3a57c62c8b, - 0x2f5e6961fd1b667f}, - {0x5c15c70bf5a01797, 0x3d20b44d60956192, 0x4911b37071fdb52, - 0xf648f9168d6f0f7b}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x9e566847e137bbbc, 0xe434469e8a6a0bec, 0xb1c4276179d73463, - 0x5abe0285133d0015}, - {0x92aa837cc04c7dab, 0x573d9f4c43260c07, 0xc93156278e6cc37, - 0x94bb725b6b6f7383}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x62a8c244bfe20925, 0x91c19ac38fdce867, 0x5a96a5d5dd387063, - 0x61d587d421d324f6}, - {0xe87673a2a37173ea, 0x2384800853778b65, 0x10f8441e05bab43e, - 0xfa11fe124621efbe}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x1c891f2b2cb19ffd, 0x1ba8d5bb1923c23, 0xb6d03d678ac5ca8e, - 0x586eb04c1f13bedc}, - {0xc35c6e527e8ed09, 0x1e81a33c1819ede2, 0x278fd6c056c652fa, - 0x19d5ac0870864f11}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x62577734d2b533d5, 0x673b8af6a1bdddc0, 0x577e7c9aa79ec293, - 0xbb6de651c3b266b1}, - {0xe7e9303ab65259b3, 0xd6a0afd3d03a7480, 0xc5ac83d19b3cfc27, - 0x60b4619a5d18b99b}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xbd6a38e11ae5aa1c, 0xb8b7652b49e73658, 0xb130014ee5f87ed, - 0x9d0f27b2aeebffcd}, - {0xca9246317a730a55, 0x9c955b2fddbbc83a, 0x7c1dfe0ac019a71, - 0x244a566d356ec48d}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x56f8410ef4f8b16a, 0x97241afec47b266a, 0xa406b8e6d9c87c1, - 0x803f3e02cd42ab1b}, - {0x7f0309a804dbec69, 0xa83b85f73bbad05f, 0xc6097273ad8e197f, - 0xc097440e5067adc1}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x846a56f2c379ab34, 0xa8ee068b841df8d1, 0x20314459176c68ef, - 0xf1af32d5915f1f30}, - {0x99c375315d75bd50, 0x837cffbaf72f67bc, 0x613a41848d7723f, - 0x23d0f130e2d41c8b}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xed93e225d5be5a2b, 0x6fe799835934f3c6, 0x4314092622626ffc, - 0x50bbb4d97990216a}, - {0x378191c6e57ec63e, 0x65422c40181dcdb2, 0x41a8099b0236e0f6, - 0x2b10011801fe49c3}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xfc68b5c59b391593, 0xc385f5a2598270fc, 0x7144f3aad19adcbb, - 0xdd55899983fbae0c}, - {0x93b88b8e74b82ff4, 0xd2e03c4071e734c9, 0x9a7a9eaf43c0322a, - 0xe6e4c551149d6041}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x5fe14bfe80ec21fe, 0xf6ce116ac255be82, 0x98bc5a072f4a5d67, - 0xfad27148db7e63af}, - {0x90c0b6ac29ab05b3, 0x37a9a83c4e251ae6, 0xa7dc875c2aade7d, - 0x77387de39f0e1a84}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x1e9ecc49a56c0dd7, 0xa5cffcd846086c74, 0x8f7a1408f505aece, - 0xb37b85c0bef0c47e}, - {0x3596b6e4cc0e6a8f, 0xfd6d4bbf6b388f23, 0xaba453fac39cef4e, - 0x9c135ac8f9f628d5}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xa1c729495c8f8be, 0x2961c4803bf362bf, 0x9e418403df63d4ac, - 0xc109f9cb91ece900}, - {0xc2d095d058945705, 0xb9083d96ddeb85c0, 0x84692b8d7a40449b, - 0x9bc3344f2eee1ee1}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xd5ae35642913074, 0x55491b2748a542b1, 0x469ca665b310732a, - 0x29591d525f1a4cc1}, - {0xe76f5b6bb84f983f, 0xbe7eef419f5f84e1, 0x1200d49680baa189, - 0x6376551f18ef332c}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}, - {{{0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0}}, - {{0x202886024147519a, 0xd0981eac26b372f0, 0xa9d4a7caa785ebc8, - 0xd953c50ddbdf58e9}, - {0x9d6361ccfd590f8f, 0x72e9626b44e6c917, 0x7fd9611022eb64cf, - 0x863ebb7e9eb288f3}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x4fe7ee31b0e63d34, 0xf4600572a9e54fab, 0xc0493334d5e7b5a4, - 0x8589fb9206d54831}, - {0xaa70f5cc6583553a, 0x879094ae25649e5, 0xcc90450710044652, - 0xebb0696d02541c4f}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xabbaa0c03b89da99, 0xa6f2d79eb8284022, 0x27847862b81c05e8, - 0x337a4b5905e54d63}, - {0x3c67500d21f7794a, 0x207005b77d6d7f61, 0xa5a378104cfd6e8, - 0xd65e0d5f4c2fbd6}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xd433e50f6d3549cf, 0x6f33696ffacd665e, 0x695bfdacce11fcb4, - 0x810ee252af7c9860}, - {0x65450fe17159bb2c, 0xf7dfbebe758b357b, 0x2b057e74d69fea72, - 0xd485717a92731745}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xce1f69bbe83f7669, 0x9f8ae8272877d6b, 0x9548ae543244278d, - 0x207755dee3c2c19c}, - {0x87bd61d96fef1945, 0x18813cefb12d28c3, 0x9fbcd1d672df64aa, - 0x48dc5ee57154b00d}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xef0f469ef49a3154, 0x3e85a5956e2b2e9a, 0x45aaec1eaa924a9c, - 0xaa12dfc8a09e4719}, - {0x26f272274df69f1d, 0xe0e4c82ca2ff5e73, 0xb9d8ce73b7a9dd44, - 0x6c036e73e48ca901}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xe1e421e1a47153f0, 0xb86c3b79920418c9, 0x93bdce87705d7672, - 0xf25ae793cab79a77}, - {0x1f3194a36d869d0c, 0x9d55c8824986c264, 0x49fb5ea3096e945e, - 0x39b8e65313db0a3e}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xe3417bc035d0b34a, 0x440b386b8327c0a7, 0x8fb7262dac0362d1, - 0x2c41114ce0cdf943}, - {0x2ba5cef1ad95a0b1, 0xc09b37a867d54362, 0x26d6cdd201e486c9, - 0x20477abf42ff9297}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xf121b41bc0a67d2, 0x62d4760a444d248a, 0xe044f1d659b4737, - 0x8fde365250bb4a8}, - {0xaceec3da848bf287, 0xc2a62182d3369d6e, 0x3582dfdc92449482, - 0x2f7e2fd2565d6cd7}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xa0122b5178a876b, 0x51ff96ff085104b4, 0x50b31ab14f29f76, - 0x84abb28b5f87d4e6}, - {0xd5ed439f8270790a, 0x2d6cb59d85e3f46b, 0x75f55c1b6c1e2212, - 0xe5436f6717655640}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xc2965ecc9aeb596d, 0x1ea03e7023c92b4, 0x4704b4b62e013961, - 0xca8fd3f905ea367}, - {0x92523a42551b2b61, 0x1eb7a89c390fcd06, 0xe7f1d2be0392a63e, - 0x96dca2644ddb0c33}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x231c210e15339848, 0xe87a28e870778c8d, 0x9d1de6616956e170, - 0x4ac3c9382bb09c0b}, - {0x19be05516998987d, 0x8b2376c4ae09f4d6, 0x1de0b7651a3f933d, - 0x380d94c7e39705f4}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x3685954b8c31c31d, 0x68533d005bf21a0c, 0xbd7626e75c79ec9, - 0xca17754742c69d54}, - {0xcc6edafff6d2dbb2, 0xfd0d8cbd174a9d18, 0x875e8793aa4578e8, - 0xa976a7139cab2ce6}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0xce37ab11b43ea1db, 0xa7ff1a95259d292, 0x851b02218f84f186, - 0xa7222beadefaad13}, - {0xa2ac78ec2b0a9144, 0x5a024051f2fa59c5, 0x91d1eca56147ce38, - 0xbe94d523bc2ac690}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}, - {{0x2d8daefd79ec1a0f, 0x3bbcd6fdceb39c97, 0xf5575ffc58f61a95, - 0xdbd986c4adf7b420}, - {0x81aa881415f39eb7, 0x6ee2fcf5b98d976c, 0x5465475dcf2f717d, - 0x8e24d3c46860bbd0}, - {0x1, 0xffffffff00000000, 0xffffffffffffffff, 0xfffffffe}}}}; -#else -static const fe g_pre_comp[2][16][3] = { - {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, - {{0x18a9143c,0x79e730d4, 0x5fedb601,0x75ba95fc, 0x77622510,0x79fb732b, - 0xa53755c6,0x18905f76}, - {0xce95560a,0xddf25357, 0xba19e45c,0x8b4ab8e4, 0xdd21f325,0xd2e88688, - 0x25885d85,0x8571ff18}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x16a0d2bb,0x4f922fc5, 0x1a623499,0xd5cc16c, 0x57c62c8b,0x9241cf3a, - 0xfd1b667f,0x2f5e6961}, - {0xf5a01797,0x5c15c70b, 0x60956192,0x3d20b44d, 0x71fdb52,0x4911b37, - 0x8d6f0f7b,0xf648f916}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xe137bbbc,0x9e566847, 0x8a6a0bec,0xe434469e, 0x79d73463,0xb1c42761, - 0x133d0015,0x5abe0285}, - {0xc04c7dab,0x92aa837c, 0x43260c07,0x573d9f4c, 0x78e6cc37,0xc931562, - 0x6b6f7383,0x94bb725b}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xbfe20925,0x62a8c244, 0x8fdce867,0x91c19ac3, 0xdd387063,0x5a96a5d5, - 0x21d324f6,0x61d587d4}, - {0xa37173ea,0xe87673a2, 0x53778b65,0x23848008, 0x5bab43e,0x10f8441e, - 0x4621efbe,0xfa11fe12}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x2cb19ffd,0x1c891f2b, 0xb1923c23,0x1ba8d5b, 0x8ac5ca8e,0xb6d03d67, - 0x1f13bedc,0x586eb04c}, - {0x27e8ed09,0xc35c6e5, 0x1819ede2,0x1e81a33c, 0x56c652fa,0x278fd6c0, - 0x70864f11,0x19d5ac08}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xd2b533d5,0x62577734, 0xa1bdddc0,0x673b8af6, 0xa79ec293,0x577e7c9a, - 0xc3b266b1,0xbb6de651}, - {0xb65259b3,0xe7e9303a, 0xd03a7480,0xd6a0afd3, 0x9b3cfc27,0xc5ac83d1, - 0x5d18b99b,0x60b4619a}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x1ae5aa1c,0xbd6a38e1, 0x49e73658,0xb8b7652b, 0xee5f87ed,0xb130014, - 0xaeebffcd,0x9d0f27b2}, - {0x7a730a55,0xca924631, 0xddbbc83a,0x9c955b2f, 0xac019a71,0x7c1dfe0, - 0x356ec48d,0x244a566d}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xf4f8b16a,0x56f8410e, 0xc47b266a,0x97241afe, 0x6d9c87c1,0xa406b8e, - 0xcd42ab1b,0x803f3e02}, - {0x4dbec69,0x7f0309a8, 0x3bbad05f,0xa83b85f7, 0xad8e197f,0xc6097273, - 0x5067adc1,0xc097440e}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xc379ab34,0x846a56f2, 0x841df8d1,0xa8ee068b, 0x176c68ef,0x20314459, - 0x915f1f30,0xf1af32d5}, - {0x5d75bd50,0x99c37531, 0xf72f67bc,0x837cffba, 0x48d7723f,0x613a418, - 0xe2d41c8b,0x23d0f130}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xd5be5a2b,0xed93e225, 0x5934f3c6,0x6fe79983, 0x22626ffc,0x43140926, - 0x7990216a,0x50bbb4d9}, - {0xe57ec63e,0x378191c6, 0x181dcdb2,0x65422c40, 0x236e0f6,0x41a8099b, - 0x1fe49c3,0x2b100118}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x9b391593,0xfc68b5c5, 0x598270fc,0xc385f5a2, 0xd19adcbb,0x7144f3aa, - 0x83fbae0c,0xdd558999}, - {0x74b82ff4,0x93b88b8e, 0x71e734c9,0xd2e03c40, 0x43c0322a,0x9a7a9eaf, - 0x149d6041,0xe6e4c551}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x80ec21fe,0x5fe14bfe, 0xc255be82,0xf6ce116a, 0x2f4a5d67,0x98bc5a07, - 0xdb7e63af,0xfad27148}, - {0x29ab05b3,0x90c0b6ac, 0x4e251ae6,0x37a9a83c, 0xc2aade7d,0xa7dc875, - 0x9f0e1a84,0x77387de3}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xa56c0dd7,0x1e9ecc49, 0x46086c74,0xa5cffcd8, 0xf505aece,0x8f7a1408, - 0xbef0c47e,0xb37b85c0}, - {0xcc0e6a8f,0x3596b6e4, 0x6b388f23,0xfd6d4bbf, 0xc39cef4e,0xaba453fa, - 0xf9f628d5,0x9c135ac8}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x95c8f8be,0xa1c7294, 0x3bf362bf,0x2961c480, 0xdf63d4ac,0x9e418403, - 0x91ece900,0xc109f9cb}, - {0x58945705,0xc2d095d0, 0xddeb85c0,0xb9083d96, 0x7a40449b,0x84692b8d, - 0x2eee1ee1,0x9bc3344f}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x42913074,0xd5ae356, 0x48a542b1,0x55491b27, 0xb310732a,0x469ca665, - 0x5f1a4cc1,0x29591d52}, - {0xb84f983f,0xe76f5b6b, 0x9f5f84e1,0xbe7eef41, 0x80baa189,0x1200d496, - 0x18ef332c,0x6376551f}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}, - {{{0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}, - {0x0,0x0, 0x0,0x0, 0x0,0x0, 0x0,0x0}}, - {{0x4147519a,0x20288602, 0x26b372f0,0xd0981eac, 0xa785ebc8,0xa9d4a7ca, - 0xdbdf58e9,0xd953c50d}, - {0xfd590f8f,0x9d6361cc, 0x44e6c917,0x72e9626b, 0x22eb64cf,0x7fd96110, - 0x9eb288f3,0x863ebb7e}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xb0e63d34,0x4fe7ee31, 0xa9e54fab,0xf4600572, 0xd5e7b5a4,0xc0493334, - 0x6d54831,0x8589fb92}, - {0x6583553a,0xaa70f5cc, 0xe25649e5,0x879094a, 0x10044652,0xcc904507, - 0x2541c4f,0xebb0696d}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x3b89da99,0xabbaa0c0, 0xb8284022,0xa6f2d79e, 0xb81c05e8,0x27847862, - 0x5e54d63,0x337a4b59}, - {0x21f7794a,0x3c67500d, 0x7d6d7f61,0x207005b7, 0x4cfd6e8,0xa5a3781, - 0xf4c2fbd6,0xd65e0d5}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x6d3549cf,0xd433e50f, 0xfacd665e,0x6f33696f, 0xce11fcb4,0x695bfdac, - 0xaf7c9860,0x810ee252}, - {0x7159bb2c,0x65450fe1, 0x758b357b,0xf7dfbebe, 0xd69fea72,0x2b057e74, - 0x92731745,0xd485717a}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xe83f7669,0xce1f69bb, 0x72877d6b,0x9f8ae82, 0x3244278d,0x9548ae54, - 0xe3c2c19c,0x207755de}, - {0x6fef1945,0x87bd61d9, 0xb12d28c3,0x18813cef, 0x72df64aa,0x9fbcd1d6, - 0x7154b00d,0x48dc5ee5}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xf49a3154,0xef0f469e, 0x6e2b2e9a,0x3e85a595, 0xaa924a9c,0x45aaec1e, - 0xa09e4719,0xaa12dfc8}, - {0x4df69f1d,0x26f27227, 0xa2ff5e73,0xe0e4c82c, 0xb7a9dd44,0xb9d8ce73, - 0xe48ca901,0x6c036e73}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xa47153f0,0xe1e421e1, 0x920418c9,0xb86c3b79, 0x705d7672,0x93bdce87, - 0xcab79a77,0xf25ae793}, - {0x6d869d0c,0x1f3194a3, 0x4986c264,0x9d55c882, 0x96e945e,0x49fb5ea3, - 0x13db0a3e,0x39b8e653}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x35d0b34a,0xe3417bc0, 0x8327c0a7,0x440b386b, 0xac0362d1,0x8fb7262d, - 0xe0cdf943,0x2c41114c}, - {0xad95a0b1,0x2ba5cef1, 0x67d54362,0xc09b37a8, 0x1e486c9,0x26d6cdd2, - 0x42ff9297,0x20477abf}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xbc0a67d2,0xf121b41, 0x444d248a,0x62d4760a, 0x659b4737,0xe044f1d, - 0x250bb4a8,0x8fde365}, - {0x848bf287,0xaceec3da, 0xd3369d6e,0xc2a62182, 0x92449482,0x3582dfdc, - 0x565d6cd7,0x2f7e2fd2}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x178a876b,0xa0122b5, 0x85104b4,0x51ff96ff, 0x14f29f76,0x50b31ab, - 0x5f87d4e6,0x84abb28b}, - {0x8270790a,0xd5ed439f, 0x85e3f46b,0x2d6cb59d, 0x6c1e2212,0x75f55c1b, - 0x17655640,0xe5436f67}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x9aeb596d,0xc2965ecc, 0x23c92b4,0x1ea03e7, 0x2e013961,0x4704b4b6, - 0x905ea367,0xca8fd3f}, - {0x551b2b61,0x92523a42, 0x390fcd06,0x1eb7a89c, 0x392a63e,0xe7f1d2be, - 0x4ddb0c33,0x96dca264}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x15339848,0x231c210e, 0x70778c8d,0xe87a28e8, 0x6956e170,0x9d1de661, - 0x2bb09c0b,0x4ac3c938}, - {0x6998987d,0x19be0551, 0xae09f4d6,0x8b2376c4, 0x1a3f933d,0x1de0b765, - 0xe39705f4,0x380d94c7}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x8c31c31d,0x3685954b, 0x5bf21a0c,0x68533d00, 0x75c79ec9,0xbd7626e, - 0x42c69d54,0xca177547}, - {0xf6d2dbb2,0xcc6edaff, 0x174a9d18,0xfd0d8cbd, 0xaa4578e8,0x875e8793, - 0x9cab2ce6,0xa976a713}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0xb43ea1db,0xce37ab11, 0x5259d292,0xa7ff1a9, 0x8f84f186,0x851b0221, - 0xdefaad13,0xa7222bea}, - {0x2b0a9144,0xa2ac78ec, 0xf2fa59c5,0x5a024051, 0x6147ce38,0x91d1eca5, - 0xbc2ac690,0xbe94d523}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}, - {{0x79ec1a0f,0x2d8daefd, 0xceb39c97,0x3bbcd6fd, 0x58f61a95,0xf5575ffc, - 0xadf7b420,0xdbd986c4}, - {0x15f39eb7,0x81aa8814, 0xb98d976c,0x6ee2fcf5, 0xcf2f717d,0x5465475d, - 0x6860bbd0,0x8e24d3c4}, - {0x1,0x0, 0x0,0xffffffff, 0xffffffff,0xffffffff, 0xfffffffe,0x0}}}}; -#endif - -// select_point selects the |idx|th point from a precomputation table and -// copies it to out. -static void select_point(const limb_t idx, size_t size, - const fe pre_comp[/*size*/][3], - fe out[3]) { - OPENSSL_memset(out, 0, sizeof(fe) * 3); - for (size_t i = 0; i < size; i++) { - limb_t mismatch = i ^ idx; - fe_cmovznz(out[0], mismatch, pre_comp[i][0], out[0]); - fe_cmovznz(out[1], mismatch, pre_comp[i][1], out[1]); - fe_cmovznz(out[2], mismatch, pre_comp[i][2], out[2]); - } -} - -// get_bit returns the |i|th bit in |in| -static char get_bit(const uint8_t *in, int i) { - if (i < 0 || i >= 256) { - return 0; - } - return (in[i >> 3] >> (i & 7)) & 1; -} - -// Interleaved point multiplication using precomputed point multiples: The -// small point multiples 0*P, 1*P, ..., 17*P are in p_pre_comp, the scalar -// in p_scalar, if non-NULL. If g_scalar is non-NULL, we also add this multiple -// of the generator, using certain (large) precomputed multiples in g_pre_comp. -// Output point (X, Y, Z) is stored in x_out, y_out, z_out. -static void batch_mul(fe x_out, fe y_out, fe z_out, - const uint8_t *p_scalar, const uint8_t *g_scalar, - const fe p_pre_comp[17][3]) { - // set nq to the point at infinity - fe nq[3] = {{0},{0},{0}}, ftmp, tmp[3]; - uint64_t bits; - uint8_t sign, digit; - - // Loop over both scalars msb-to-lsb, interleaving additions of multiples - // of the generator (two in each of the last 32 rounds) and additions of p - // (every 5th round). - - int skip = 1; // save two point operations in the first round - size_t i = p_scalar != NULL ? 255 : 31; - for (;;) { - // double - if (!skip) { - point_double(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2]); - } - - // add multiples of the generator - if (g_scalar != NULL && i <= 31) { - // first, look 32 bits upwards - bits = get_bit(g_scalar, i + 224) << 3; - bits |= get_bit(g_scalar, i + 160) << 2; - bits |= get_bit(g_scalar, i + 96) << 1; - bits |= get_bit(g_scalar, i + 32); - // select the point to add, in constant time - select_point(bits, 16, g_pre_comp[1], tmp); - - if (!skip) { - point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, - tmp[0], tmp[1], tmp[2]); - } else { - fe_copy(nq[0], tmp[0]); - fe_copy(nq[1], tmp[1]); - fe_copy(nq[2], tmp[2]); - skip = 0; - } - - // second, look at the current position - bits = get_bit(g_scalar, i + 192) << 3; - bits |= get_bit(g_scalar, i + 128) << 2; - bits |= get_bit(g_scalar, i + 64) << 1; - bits |= get_bit(g_scalar, i); - // select the point to add, in constant time - select_point(bits, 16, g_pre_comp[0], tmp); - point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 1 /* mixed */, tmp[0], - tmp[1], tmp[2]); - } - - // do other additions every 5 doublings - if (p_scalar != NULL && i % 5 == 0) { - bits = get_bit(p_scalar, i + 4) << 5; - bits |= get_bit(p_scalar, i + 3) << 4; - bits |= get_bit(p_scalar, i + 2) << 3; - bits |= get_bit(p_scalar, i + 1) << 2; - bits |= get_bit(p_scalar, i) << 1; - bits |= get_bit(p_scalar, i - 1); - ec_GFp_nistp_recode_scalar_bits(&sign, &digit, bits); - - // select the point to add or subtract, in constant time. - select_point(digit, 17, p_pre_comp, tmp); - fe_opp(ftmp, tmp[1]); // (X, -Y, Z) is the negative point. - fe_cmovznz(tmp[1], sign, tmp[1], ftmp); - - if (!skip) { - point_add(nq[0], nq[1], nq[2], nq[0], nq[1], nq[2], 0 /* mixed */, - tmp[0], tmp[1], tmp[2]); - } else { - fe_copy(nq[0], tmp[0]); - fe_copy(nq[1], tmp[1]); - fe_copy(nq[2], tmp[2]); - skip = 0; - } - } - - if (i == 0) { - break; - } - --i; - } - fe_copy(x_out, nq[0]); - fe_copy(y_out, nq[1]); - fe_copy(z_out, nq[2]); -} - -// OPENSSL EC_METHOD FUNCTIONS - -// Takes the Jacobian coordinates (X, Y, Z) of a point and returns (X', Y') = -// (X/Z^2, Y/Z^3). -static int ec_GFp_nistp256_point_get_affine_coordinates(const EC_GROUP *group, - const EC_POINT *point, - BIGNUM *x_out, - BIGNUM *y_out, - BN_CTX *ctx) { - fe x, y, z1, z2; - - if (EC_POINT_is_at_infinity(group, point)) { - OPENSSL_PUT_ERROR(EC, EC_R_POINT_AT_INFINITY); - return 0; - } - if (!BN_to_fe(x, &point->X) || - !BN_to_fe(y, &point->Y) || - !BN_to_fe(z1, &point->Z)) { - return 0; - } - - fe_inv(z2, z1); - fe_sqr(z1, z2); - - // Instead of using |fe_from_montgomery| to convert the |x| coordinate and - // then calling |fe_from_montgomery| again to convert the |y| coordinate - // below, convert the common factor |z1| once now, saving one reduction. - fe_from_montgomery(z1); - - if (x_out != NULL) { - fe_mul(x, x, z1); - if (!fe_to_BN(x_out, x)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - } - - if (y_out != NULL) { - fe_mul(z1, z1, z2); - fe_mul(y, y, z1); - if (!fe_to_BN(y_out, y)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - } - - return 1; -} - -static int ec_GFp_nistp256_points_mul(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p, - const EC_SCALAR *p_scalar, - BN_CTX *unused_ctx) { - fe p_pre_comp[17][3]; - fe x_out, y_out, z_out; - - if (p != NULL && p_scalar != NULL) { - // We treat NULL scalars as 0, and NULL points as points at infinity, i.e., - // they contribute nothing to the linear combination. - OPENSSL_memset(&p_pre_comp, 0, sizeof(p_pre_comp)); - // Precompute multiples. - if (!BN_to_fe(p_pre_comp[1][0], &p->X) || - !BN_to_fe(p_pre_comp[1][1], &p->Y) || - !BN_to_fe(p_pre_comp[1][2], &p->Z)) { - return 0; - } - for (size_t j = 2; j <= 16; ++j) { - if (j & 1) { - point_add(p_pre_comp[j][0], p_pre_comp[j][1], - p_pre_comp[j][2], p_pre_comp[1][0], - p_pre_comp[1][1], p_pre_comp[1][2], - 0, - p_pre_comp[j - 1][0], p_pre_comp[j - 1][1], - p_pre_comp[j - 1][2]); - } else { - point_double(p_pre_comp[j][0], p_pre_comp[j][1], - p_pre_comp[j][2], p_pre_comp[j / 2][0], - p_pre_comp[j / 2][1], p_pre_comp[j / 2][2]); - } - } - } - - batch_mul(x_out, y_out, z_out, - (p != NULL && p_scalar != NULL) ? p_scalar->bytes : NULL, - g_scalar != NULL ? g_scalar->bytes : NULL, - (const fe (*) [3])p_pre_comp); - - if (!fe_to_BN(&r->X, x_out) || - !fe_to_BN(&r->Y, y_out) || - !fe_to_BN(&r->Z, z_out)) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - return 1; -} - -static int ec_GFp_nistp256_point_mul_public(const EC_GROUP *group, EC_POINT *r, - const EC_SCALAR *g_scalar, - const EC_POINT *p, - const EC_SCALAR *p_scalar, - BN_CTX *unused_ctx) { -#define P256_WSIZE_PUBLIC 4 - // Precompute multiples of |p|. p_pre_comp[i] is (2*i+1) * |p|. - fe p_pre_comp[1 << (P256_WSIZE_PUBLIC-1)][3]; - if (!BN_to_fe(p_pre_comp[0][0], &p->X) || - !BN_to_fe(p_pre_comp[0][1], &p->Y) || - !BN_to_fe(p_pre_comp[0][2], &p->Z)) { - return 0; - } - fe p2[3]; - point_double(p2[0], p2[1], p2[2], p_pre_comp[0][0], p_pre_comp[0][1], - p_pre_comp[0][2]); - for (size_t i = 1; i < OPENSSL_ARRAY_SIZE(p_pre_comp); i++) { - point_add(p_pre_comp[i][0], p_pre_comp[i][1], p_pre_comp[i][2], - p_pre_comp[i - 1][0], p_pre_comp[i - 1][1], p_pre_comp[i - 1][2], - 0 /* not mixed */, p2[0], p2[1], p2[2]); - } - - // Set up the coefficients for |p_scalar|. - int8_t p_wNAF[257]; - if (!ec_compute_wNAF(group, p_wNAF, p_scalar, 256, P256_WSIZE_PUBLIC)) { - return 0; - } - - // Set |ret| to the point at infinity. - int skip = 1; // Save some point operations. - fe ret[3] = {{0},{0},{0}}; - for (int i = 256; i >= 0; i--) { - if (!skip) { - point_double(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2]); - } - - // For the |g_scalar|, we use the precomputed table without the - // constant-time lookup. - if (i <= 31) { - // First, look 32 bits upwards. - uint64_t bits = get_bit(g_scalar->bytes, i + 224) << 3; - bits |= get_bit(g_scalar->bytes, i + 160) << 2; - bits |= get_bit(g_scalar->bytes, i + 96) << 1; - bits |= get_bit(g_scalar->bytes, i + 32); - point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, - g_pre_comp[1][bits][0], g_pre_comp[1][bits][1], - g_pre_comp[1][bits][2]); - skip = 0; - - // Second, look at the current position. - bits = get_bit(g_scalar->bytes, i + 192) << 3; - bits |= get_bit(g_scalar->bytes, i + 128) << 2; - bits |= get_bit(g_scalar->bytes, i + 64) << 1; - bits |= get_bit(g_scalar->bytes, i); - point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], 1 /* mixed */, - g_pre_comp[0][bits][0], g_pre_comp[0][bits][1], - g_pre_comp[0][bits][2]); - } - - int digit = p_wNAF[i]; - if (digit != 0) { - assert(digit & 1); - int idx = digit < 0 ? (-digit) >> 1 : digit >> 1; - fe *y = &p_pre_comp[idx][1], tmp; - if (digit < 0) { - fe_opp(tmp, p_pre_comp[idx][1]); - y = &tmp; - } - if (!skip) { - point_add(ret[0], ret[1], ret[2], ret[0], ret[1], ret[2], - 0 /* not mixed */, p_pre_comp[idx][0], *y, p_pre_comp[idx][2]); - } else { - fe_copy(ret[0], p_pre_comp[idx][0]); - fe_copy(ret[1], *y); - fe_copy(ret[2], p_pre_comp[idx][2]); - skip = 0; - } - } - } - - if (!fe_to_BN(&r->X, ret[0]) || - !fe_to_BN(&r->Y, ret[1]) || - !fe_to_BN(&r->Z, ret[2])) { - OPENSSL_PUT_ERROR(EC, ERR_R_BN_LIB); - return 0; - } - return 1; -} - -DEFINE_METHOD_FUNCTION(EC_METHOD, EC_GFp_nistp256_method) { - out->group_init = ec_GFp_mont_group_init; - out->group_finish = ec_GFp_mont_group_finish; - out->group_set_curve = ec_GFp_mont_group_set_curve; - out->point_get_affine_coordinates = - ec_GFp_nistp256_point_get_affine_coordinates; - out->mul = ec_GFp_nistp256_points_mul; - out->mul_public = ec_GFp_nistp256_point_mul_public; - out->field_mul = ec_GFp_mont_field_mul; - out->field_sqr = ec_GFp_mont_field_sqr; - out->field_encode = ec_GFp_mont_field_encode; - out->field_decode = ec_GFp_mont_field_decode; -}; - -#undef BORINGSSL_NISTP256_64BIT diff --git a/Pods/Firebase/CoreOnly/Sources/Firebase.h b/Pods/Firebase/CoreOnly/Sources/Firebase.h index b785c8a71..b5c716d7a 100755 --- a/Pods/Firebase/CoreOnly/Sources/Firebase.h +++ b/Pods/Firebase/CoreOnly/Sources/Firebase.h @@ -22,10 +22,18 @@ #import #endif + #if __has_include() + #import + #endif + #if __has_include() #import #endif + #if __has_include() + #import + #endif + #if __has_include() #import #endif @@ -73,7 +81,7 @@ Firebase In App Messaging works as intended." Firebase Messaging works as intended." #endif // #ifndef FIREBASE_ANALYTICS_SUPPRESS_WARNING #endif -#endif + #endif #if __has_include() #import diff --git a/Pods/Firebase/LICENSE b/Pods/Firebase/LICENSE index d64569567..fcce50661 100644 --- a/Pods/Firebase/LICENSE +++ b/Pods/Firebase/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 Firebase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Pods/Firebase/README.md b/Pods/Firebase/README.md index d0f46e02d..5850a1835 100644 --- a/Pods/Firebase/README.md +++ b/Pods/Firebase/README.md @@ -1,10 +1,31 @@ -# Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) - -This repository contains a subset of the Firebase iOS SDK source. It currently -includes FirebaseCore, FirebaseABTesting, FirebaseAuth, FirebaseDatabase, -FirebaseFirestore, FirebaseFunctions, FirebaseInstanceID, FirebaseInAppMessaging, -FirebaseInAppMessagingDisplay, FirebaseMessaging, FirebaseRemoteConfig, and -FirebaseStorage. +[![Version](https://img.shields.io/cocoapods/v/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) +[![License](https://img.shields.io/cocoapods/l/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) +[![Platform](https://img.shields.io/cocoapods/p/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) + +[![Actions Status][gh-abtesting-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-crashlytics-badge]][gh-actions] +[![Actions Status][gh-database-badge]][gh-actions] +[![Actions Status][gh-datatransport-badge]][gh-actions] +[![Actions Status][gh-dynamiclinks-badge]][gh-actions] +[![Actions Status][gh-firebasepod-badge]][gh-actions] +[![Actions Status][gh-firestore-badge]][gh-actions] +[![Actions Status][gh-functions-badge]][gh-actions] +[![Actions Status][gh-inappmessaging-badge]][gh-actions] +[![Actions Status][gh-interop-badge]][gh-actions] +[![Actions Status][gh-messaging-badge]][gh-actions] +[![Actions Status][gh-remoteconfig-badge]][gh-actions] +[![Actions Status][gh-storage-badge]][gh-actions] +[![Actions Status][gh-symbolcollision-badge]][gh-actions] +[![Actions Status][gh-zip-badge]][gh-actions] +[![Travis](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics, +FirebasePerformance, and FirebaseML. The repository also includes GoogleUtilities source. The [GoogleUtilities](GoogleUtilities/README.md) pod is @@ -16,8 +37,9 @@ monetize your app. More information about Firebase can be found at ## Installation -See the three subsections for details about three different installation methods. +See the subsections below for details about the different installation methods. 1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager (Beta)](SwiftPackageManager.md) 1. [Installing from the GitHub repo](README.md#installing-from-github) 1. [Experimental Carthage](README.md#carthage-ios-only) @@ -26,6 +48,11 @@ See the three subsections for details about three different installation methods Go to [https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup). +### Swift Package Manager (Beta) + +Instructions for the Beta of [Swift Package Manager](https://swift.org/package-manager/) +support can be found at [SwiftPackageManager.md](SwiftPackageManager.md). + ### Installing from GitHub For releases starting with 5.0.0, the source for each release is also deployed @@ -69,55 +96,69 @@ Instructions for the experimental Carthage distribution are at Instructions for installing binary frameworks via [Rome](https://github.com/CocoaPods/Rome) are at [Rome](Rome.md). +### Using Firebase from a Framework or a library + +[Using Firebase from a Framework or a library](docs/firebase_in_libraries.md) + ## Development To develop Firebase software in this repository, ensure that you have at least the following software: - * Xcode 10.1 (or later) + * Xcode 10.3 (or later) * CocoaPods 1.7.2 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) For the pod that you want to develop: -`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open` +`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open --platforms=ios` Note: If the CocoaPods cache is out of date, you may need to run `pod repo update` before the `pod gen` command. +Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for +those platforms. Since 10.2, Xcode does not properly handle multi-platform +CocoaPods workspaces. + Firestore has a self contained Xcode project. See [Firestore/README.md](Firestore/README.md). +### Development for Catalyst +* `pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios` +* Check the Mac box in the App-iOS Build Settings +* Sign the App in the Settings Signing & Capabilities tab +* Click Pods in the Project Manager +* Add Signing to the iOS host app and unit test targets +* Select the Unit-unit scheme +* Run it to build and test + ### Adding a New Firebase Pod See [AddNewPod.md](AddNewPod.md). +### Managing Headers and Imports + +See [HeadersImports.md](HeadersImports.md). + ### Code Formatting To ensure that the code is formatted consistently, run the script -[./scripts/style.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/style.sh) +[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) before creating a PR. -Travis will verify that any code changes are done in a style compliant way. Install -`clang-format` and `swiftformat`. -These commands will get the right versions: +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: ``` -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb +brew install clang-format +brew install mint ``` -Note: if you already have a newer version of these installed you may need to -`brew switch` to this version. - -To update this section, find the versions of clang-format and swiftformat.rb to -match the versions in the CI failure logs -[here](https://github.com/Homebrew/homebrew-core/tree/master/Formula). - ### Running Unit Tests Select a scheme and press Command-u to build a component and run its unit tests. -#### Viewing Code Coverage +#### Viewing Code Coverage (Deprecated) First, make sure that [xcov](https://github.com/nakiostudio/xcov) is installed with `gem install xcov`. @@ -135,12 +176,7 @@ files without real values, but can be replaced with real plist files. To get you 2. Create a new Firebase project, if you don't already have one 3. For each sample app you want to test, create a new Firebase app with the sample app's bundle identifier (e.g. `com.google.Database-Example`) -4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file -(e.g. in [Example/Database/App/](Example/Database/App/)); - -Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require -special Apple capabilities, and you will have to change the sample app to use a unique bundle -identifier that you can control in your own Apple Developer account. +4. Download the resulting `GoogleService-Info.plist` and add it to the Xcode project. ## Specific Component Instructions See the sections below for any special instructions for those components. @@ -148,18 +184,26 @@ See the sections below for any special instructions for those components. ### Firebase Auth If you're doing specific Firebase Auth development, see -[the Auth Sample README](Example/Auth/README.md) for instructions about +[the Auth Sample README](FirebaseAuth/Tests/Sample/README.md) for instructions about building and running the FirebaseAuth pod along with various samples and tests. ### Firebase Database -To run the Database Integration tests, make your database authentication rules -[public](https://firebase.google.com/docs/database/security/quickstart). +The Firebase Database Integration tests can be run against a locally running Database Emulator +or against a production instance. + +To run against a local emulator instance, invoke `./scripts/run_database_emulator.sh start` before +running the integration test. + +To run against a production instance, provide a valid GoogleServices-Info.plist and copy it to +`FirebaseDatabase/Tests/Resources/GoogleService-Info.plist`. Your Security Rule must be set to +[public](https://firebase.google.com/docs/database/security/quickstart) while your tests are +running. ### Firebase Storage To run the Storage Integration tests, follow the instructions in -[FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m). +[FIRStorageIntegrationTests.m](FirebaseStorage/Tests/Integration/FIRStorageIntegrationTests.m). #### Push Notifications @@ -185,35 +229,44 @@ We've seen an amazing amount of interest and contributions to improve the Fireba very grateful! We'd like to empower as many developers as we can to be able to use Firebase and participate in the Firebase community. -### macOS and tvOS -Thanks to contributions from the community, FirebaseABTesting, FirebaseAuth, FirebaseCore, -FirebaseDatabase, FirebaseMessaging, FirebaseFirestore, -FirebaseFunctions, FirebaseRemoteConfig, and FirebaseStorage now compile, run unit tests, and work on -macOS and tvOS. +### tvOS, macOS, watchOS and Catalyst +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and work on +tvOS, macOS, watchOS and Catalyst. For tvOS, checkout the [Sample](Example/tvOSSample). +For watchOS, currently only Messaging and Storage (and their dependencies) have limited support. Checkout the +[Independent Watch App Sample](Example/watchOSSample). -Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is -actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there -may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter -this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). +Keep in mind that macOS, tvOS, watchOS and Catalyst are not officially supported by Firebase, and this +repository is actively developed primarily for iOS. While we can catch basic unit test issues with +Travis, there may be some changes where the SDK no longer works as expected on macOS, tvOS or watchOS. If you +encounter this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). -Note that the Firebase pod is not available for macOS and tvOS. +During app setup in the console, you may get to a step that mentions something like "Checking if the app +has communicated with our servers". This relies on Analytics and will not work on macOS/tvOS/watchOS/Catalyst. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. To install, add a subset of the following to the Podfile: ``` -pod 'FirebaseABTesting' -pod 'FirebaseAuth' -pod 'FirebaseCore' -pod 'FirebaseDatabase' -pod 'FirebaseFirestore' -pod 'FirebaseFunctions' -pod 'FirebaseMessaging' -pod 'FirebaseRemoteConfig' -pod 'FirebaseStorage' +pod 'Firebase/ABTesting' # No watchOS support yet +pod 'Firebase/Auth' # Limited watchOS support +pod 'Firebase/Crashlytics' +pod 'Firebase/Database' # No watchOS support yet +pod 'Firebase/Firestore' # No watchOS support yet +pod 'Firebase/Functions' # No watchOS support yet +pod 'Firebase/Messaging' +pod 'Firebase/RemoteConfig' # No watchOS support yet +pod 'Firebase/Storage' ``` +#### Additional Catalyst Notes + +* FirebaseAuth and FirebaseMessaging require adding `Keychain Sharing Capability` +to Build Settings. +* FirebaseFirestore requires signing the +[gRPC Resource target](https://github.com/firebase/firebase-ios-sdk/issues/3500#issuecomment-518741681). + ## Roadmap See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source @@ -231,3 +284,23 @@ The contents of this repository is licensed under the Your use of Firebase is governed by the [Terms of Service for Firebase Services](https://firebase.google.com/terms/). + +[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions +[gh-abtesting-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/abtesting/badge.svg +[gh-appdistribution-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/appdistribution/badge.svg +[gh-auth-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/auth/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-crashlytics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/crashlytics/badge.svg +[gh-database-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/database/badge.svg +[gh-datatransport-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/datatransport/badge.svg +[gh-dynamiclinks-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/dynamiclinks/badge.svg +[gh-firebasepod-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/firebasepod/badge.svg +[gh-firestore-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/firestore/badge.svg +[gh-functions-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/functions/badge.svg +[gh-inappmessaging-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/inappmessaging/badge.svg +[gh-interop-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/interop/badge.svg +[gh-messaging-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/messaging/badge.svg +[gh-remoteconfig-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/remoteconfig/badge.svg +[gh-storage-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/storage/badge.svg +[gh-symbolcollision-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/symbolcollision/badge.svg +[gh-zip-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/zip/badge.svg diff --git a/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector b/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector index f59083c4a..80a2d9a79 100755 Binary files a/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector and b/Pods/FirebaseAnalytics/Frameworks/FIRAnalyticsConnector.framework/FIRAnalyticsConnector differ diff --git a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics index bfd07d01d..ea9484590 100755 Binary files a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics and b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/FirebaseAnalytics differ diff --git a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h index afb9f820b..b7a2860c1 100755 --- a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h +++ b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRAnalytics.h @@ -9,6 +9,10 @@ NS_ASSUME_NONNULL_BEGIN /// The top level Firebase Analytics singleton that provides methods for logging events and setting /// user properties. See the developer guides for general /// information on using Firebase Analytics in your apps. +/// +/// @note The Analytics SDK uses SQLite to persist events and other app-specific data. Calling +/// certain thread-unsafe global SQLite methods like `sqlite3_shutdown()` can result in +/// unexpected crashes at runtime. NS_SWIFT_NAME(Analytics) @interface FIRAnalytics : NSObject @@ -35,7 +39,6 @@ NS_SWIFT_NAME(Analytics) ///
  • notification_open
  • ///
  • notification_receive
  • ///
  • os_update
  • -///
  • screen_view
  • ///
  • session_start
  • ///
  • user_engagement
  • /// @@ -45,7 +48,7 @@ NS_SWIFT_NAME(Analytics) /// reserved. See FIREventNames.h for the list of reserved event names. The "firebase_", /// "google_", and "ga_" prefixes are reserved and should not be used. Note that event names are /// case-sensitive and that logging two events whose names differ only in case will result in -/// two distinct events. +/// two distinct events. To manually log screen view events, use the `screen_view` event name. /// @param parameters The dictionary of event parameters. Passing nil indicates that the event has /// no parameters. Parameter names can be up to 40 characters long and must start with an /// alphabetic character and contain only alphanumeric characters and underscores. Only NSString @@ -81,17 +84,17 @@ NS_SWIFT_NAME(Analytics) /// non-empty and no more than 256 characters long. Setting userID to nil removes the user ID. + (void)setUserID:(nullable NSString *)userID; +/// This method was deprecated in Firebase 6.29.0. +/// /// Sets the current screen name, which specifies the current visual context in your app. This helps /// identify the areas in your app where users spend their time and how they interact with your app. /// Must be called on the main thread. /// /// Note that screen reporting is enabled automatically and records the class name of the current -/// UIViewController for you without requiring you to call this method. If you implement -/// viewDidAppear in your UIViewController but do not call [super viewDidAppear:], that screen class -/// will not be automatically tracked. The class name can optionally be overridden by calling this -/// method in the viewDidAppear callback of your UIViewController and specifying the -/// screenClassOverride parameter. setScreenName:screenClass: must be called after -/// [super viewDidAppear:]. +/// UIViewController for you without requiring you to call this method. The class name can +/// optionally be overridden by calling this method in the viewDidAppear callback of your +/// UIViewController and specifying the screenClassOverride parameter. +/// `setScreenName:screenClass:` must be called after `[super viewDidAppear:]`. /// /// If your app does not use a distinct UIViewController for each screen, you should call this /// method and specify a distinct screenName each time a new screen is presented to the user. @@ -99,13 +102,18 @@ NS_SWIFT_NAME(Analytics) /// The screen name and screen class remain in effect until the current UIViewController changes or /// a new call to setScreenName:screenClass: is made. /// +/// @warning If you override `viewDidAppear:` in your UIViewController but do not call +/// `[super viewDidAppear:]`, that screen class will not be tracked. +/// /// @param screenName The name of the current screen. Should contain 1 to 100 characters. Set to nil /// to clear the current screen name. /// @param screenClassOverride The name of the screen class. Should contain 1 to 100 characters. By /// default this is the class name of the current UIViewController. Set to nil to revert to the /// default class name. + (void)setScreenName:(nullable NSString *)screenName - screenClass:(nullable NSString *)screenClassOverride; + screenClass:(nullable NSString *)screenClassOverride + DEPRECATED_MSG_ATTRIBUTE( + "Use +[FIRAnalytics logEventWithName:kFIREventScreenView parameters:] instead."); /// Sets whether analytics collection is enabled for this app on this device. This setting is /// persisted across app sessions. By default it is enabled. @@ -127,6 +135,20 @@ NS_SWIFT_NAME(Analytics) /// FIRAnalyticsConfiguration values will be reset to the default values. + (void)resetAnalyticsData; +/// Adds parameters that will be set on every event logged from the SDK, including automatic ones. +/// The values passed in the parameters dictionary will be added to the dictionary of default event +/// parameters. These parameters persist across app runs. They are of lower precedence than event +/// parameters, so if an event parameter and a parameter set using this API have the same name, the +/// value of the event parameter will be used. The same limitations on event parameters apply to +/// default event parameters. +/// +/// @param parameters Parameters to be added to the dictionary of parameters added to every event. +/// They will be added to the dictionary of default event parameters, replacing any existing +/// parameter with the same name. Valid parameters are NSString and NSNumber (signed 64-bit +/// integer and 64-bit floating-point number). Setting a key's value to [NSNull null] will clear +/// that parameter. Passing in a nil dictionary will clear all parameters. ++ (void)setDefaultEventParameters:(nullable NSDictionary *)parameters; + @end NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h index c70c53e25..f43350f76 100755 --- a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h +++ b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIREventNames.h @@ -12,46 +12,41 @@ #import -/// Add Payment Info event. This event signifies that a user has submitted their payment information -/// to your app. +/// Add Payment Info event. This event signifies that a user has submitted their payment +/// information. Note: If you supply the @c kFIRParameterValue parameter, you must also supply the +/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. Params: +/// +///
      +///
    • @c kFIRParameterCoupon (NSString) (optional)
    • +///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterPaymentType (NSString) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • +///
    static NSString *const kFIREventAddPaymentInfo NS_SWIFT_NAME(AnalyticsEventAddPaymentInfo) = @"add_payment_info"; -/// E-Commerce Add To Cart event. This event signifies that an item was added to a cart for -/// purchase. Add this event to a funnel with kFIREventEcommercePurchase to gauge the effectiveness -/// of your checkout process. Note: If you supply the @c kFIRParameterValue parameter, you must -/// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed +/// E-Commerce Add To Cart event. This event signifies that an item(s) was added to a cart for +/// purchase. Add this event to a funnel with @c kFIREventPurchase to gauge the effectiveness of +/// your checkout process. Note: If you supply the @c kFIRParameterValue parameter, you must also +/// supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed /// accurately. Params: /// ///
      -///
    • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
    • -///
    • @c kFIRParameterItemID (NSString)
    • -///
    • @c kFIRParameterItemName (NSString)
    • -///
    • @c kFIRParameterItemCategory (NSString)
    • -///
    • @c kFIRParameterItemLocationID (NSString) (optional)
    • -///
    • @c kFIRParameterPrice (double as NSNumber) (optional)
    • ///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • ///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • -///
    • @c kFIRParameterOrigin (NSString) (optional)
    • -///
    • @c kFIRParameterDestination (NSString) (optional)
    • -///
    • @c kFIRParameterStartDate (NSString) (optional)
    • -///
    • @c kFIRParameterEndDate (NSString) (optional)
    • ///
    static NSString *const kFIREventAddToCart NS_SWIFT_NAME(AnalyticsEventAddToCart) = @"add_to_cart"; -/// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. -/// Use this event to identify popular gift items in your app. Note: If you supply the -/// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency -/// parameter so that revenue metrics can be computed accurately. Params: +/// E-Commerce Add To Wishlist event. This event signifies that an item was added to a wishlist. Use +/// this event to identify popular gift items. Note: If you supply the @c kFIRParameterValue +/// parameter, you must also supply the @c kFIRParameterCurrency parameter so that revenue metrics +/// can be computed accurately. Params: /// ///
      -///
    • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
    • -///
    • @c kFIRParameterItemID (NSString)
    • -///
    • @c kFIRParameterItemName (NSString)
    • -///
    • @c kFIRParameterItemCategory (NSString)
    • -///
    • @c kFIRParameterItemLocationID (NSString) (optional)
    • -///
    • @c kFIRParameterPrice (double as NSNumber) (optional)
    • ///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • ///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • ///
    static NSString *const kFIREventAddToWishlist NS_SWIFT_NAME(AnalyticsEventAddToWishlist) = @@ -64,26 +59,16 @@ static NSString *const kFIREventAddToWishlist NS_SWIFT_NAME(AnalyticsEventAddToW static NSString *const kFIREventAppOpen NS_SWIFT_NAME(AnalyticsEventAppOpen) = @"app_open"; /// E-Commerce Begin Checkout event. This event signifies that a user has begun the process of -/// checking out. Add this event to a funnel with your kFIREventEcommercePurchase event to gauge the -/// effectiveness of your checkout process. Note: If you supply the @c kFIRParameterValue -/// parameter, you must also supply the @c kFIRParameterCurrency parameter so that revenue -/// metrics can be computed accurately. Params: +/// checking out. Add this event to a funnel with your @c kFIREventPurchase event to gauge the +/// effectiveness of your checkout process. Note: If you supply the @c kFIRParameterValue parameter, +/// you must also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be +/// computed accurately. Params: /// ///
      -///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterCoupon (NSString) (optional)
    • ///
    • @c kFIRParameterCurrency (NSString) (optional)
    • -///
    • @c kFIRParameterTransactionID (NSString) (optional)
    • -///
    • @c kFIRParameterStartDate (NSString) (optional)
    • -///
    • @c kFIRParameterEndDate (NSString) (optional)
    • -///
    • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings
    • -///
    • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for -/// hotel bookings
    • -///
    • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) -/// for travel bookings
    • -///
    • @c kFIRParameterOrigin (NSString) (optional)
    • -///
    • @c kFIRParameterDestination (NSString) (optional)
    • -///
    • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • ///
    static NSString *const kFIREventBeginCheckout NS_SWIFT_NAME(AnalyticsEventBeginCheckout) = @"begin_checkout"; @@ -110,6 +95,7 @@ static NSString *const kFIREventCampaignDetails NS_SWIFT_NAME(AnalyticsEventCamp ///
  • @c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)
  • ///
  • @c kFIRParameterCheckoutOption (NSString) (optional)
  • /// +/// This constant has been deprecated. static NSString *const kFIREventCheckoutProgress NS_SWIFT_NAME(AnalyticsEventCheckoutProgress) = @"checkout_progress"; @@ -150,6 +136,7 @@ static NSString *const kFIREventEarnVirtualCurrency ///
  • @c kFIRParameterDestination (NSString) (optional)
  • ///
  • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
  • /// +/// This constant has been deprecated. Use @c kFIREventPurchase constant instead. static NSString *const kFIREventEcommercePurchase NS_SWIFT_NAME(AnalyticsEventEcommercePurchase) = @"ecommerce_purchase"; @@ -173,6 +160,21 @@ static NSString *const kFIREventGenerateLead NS_SWIFT_NAME(AnalyticsEventGenerat /// static NSString *const kFIREventJoinGroup NS_SWIFT_NAME(AnalyticsEventJoinGroup) = @"join_group"; +/// Level End event. Log this event when the user finishes a level. Params: +/// +///
      +///
    • @c kFIRParameterLevelName (NSString)
    • +///
    • @c kFIRParameterSuccess (NSString)
    • +///
    +static NSString *const kFIREventLevelEnd NS_SWIFT_NAME(AnalyticsEventLevelEnd) = @"level_end"; + +/// Level Start event. Log this event when the user starts a new level. Params: +/// +///
      +///
    • @c kFIRParameterLevelName (NSString)
    • +///
    +static NSString *const kFIREventLevelStart NS_SWIFT_NAME(AnalyticsEventLevelStart) = @"level_start"; + /// Level Up event. This event signifies that a player has leveled up in your gaming app. It can /// help you gauge the level distribution of your userbase and help you identify certain levels that /// are difficult to pass. Params: @@ -214,6 +216,7 @@ static NSString *const kFIREventPostScore NS_SWIFT_NAME(AnalyticsEventPostScore) ///
  • @c kFIRParameterCurrency (NSString) (optional)
  • ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • /// +/// This constant has been deprecated. Use @c kFIREventViewPromotion constant instead. static NSString *const kFIREventPresentOffer NS_SWIFT_NAME(AnalyticsEventPresentOffer) = @"present_offer"; @@ -227,28 +230,31 @@ static NSString *const kFIREventPresentOffer NS_SWIFT_NAME(AnalyticsEventPresent ///
  • @c kFIRParameterValue (double as NSNumber) (optional)
  • ///
  • @c kFIRParameterTransactionID (NSString) (optional)
  • /// +/// This constant has been deprecated. Use @c kFIREventRefund constant instead. static NSString *const kFIREventPurchaseRefund NS_SWIFT_NAME(AnalyticsEventPurchaseRefund) = @"purchase_refund"; -/// Remove from cart event. Params: +/// E-Commerce Remove from Cart event. This event signifies that an item(s) was removed from a cart. +/// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the @c +/// kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. Params: /// ///
      -///
    • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber)
    • -///
    • @c kFIRParameterItemID (NSString)
    • -///
    • @c kFIRParameterItemName (NSString)
    • -///
    • @c kFIRParameterItemCategory (NSString)
    • -///
    • @c kFIRParameterItemLocationID (NSString) (optional)
    • -///
    • @c kFIRParameterPrice (double as NSNumber) (optional)
    • ///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • ///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • -///
    • @c kFIRParameterOrigin (NSString) (optional)
    • -///
    • @c kFIRParameterDestination (NSString) (optional)
    • -///
    • @c kFIRParameterStartDate (NSString) (optional)
    • -///
    • @c kFIRParameterEndDate (NSString) (optional)
    • ///
    static NSString *const kFIREventRemoveFromCart NS_SWIFT_NAME(AnalyticsEventRemoveFromCart) = @"remove_from_cart"; +/// Screen View event. This event signifies a screen view. Use this when a screen transition occurs. +/// This event can be logged irrespective of whether automatic screen tracking is enabled. Params: +/// +///
      +///
    • @c kFIRParameterScreenClass (NSString) (optional)
    • +///
    • @c kFIRParameterScreenName (NSString) (optional)
    • +///
    +static NSString *const kFIREventScreenView NS_SWIFT_NAME(AnalyticsEventScreenView) = @"screen_view"; + /// Search event. Apps that support search features can use this event to contextualize search /// operations by supplying the appropriate, corresponding parameters. This event can help you /// identify the most popular content in your app. Params: @@ -286,6 +292,7 @@ static NSString *const kFIREventSelectContent NS_SWIFT_NAME(AnalyticsEventSelect ///
  • @c kFIRParameterCheckoutStep (unsigned 64-bit integer as NSNumber)
  • ///
  • @c kFIRParameterCheckoutOption (NSString)
  • /// +/// This constant has been deprecated. static NSString *const kFIREventSetCheckoutOption NS_SWIFT_NAME(AnalyticsEventSetCheckoutOption) = @"set_checkout_option"; @@ -340,43 +347,24 @@ static NSString *const kFIREventTutorialComplete NS_SWIFT_NAME(AnalyticsEventTut static NSString *const kFIREventUnlockAchievement NS_SWIFT_NAME(AnalyticsEventUnlockAchievement) = @"unlock_achievement"; -/// View Item event. This event signifies that some content was shown to the user. This content may -/// be a product, a webpage or just a simple image or text. Use the appropriate parameters to -/// contextualize the event. Use this event to discover the most popular items viewed in your app. -/// Note: If you supply the @c kFIRParameterValue parameter, you must also supply the -/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. -/// Params: +/// View Item event. This event signifies that a user has viewed an item. Use the appropriate +/// parameters to contextualize the event. Use this event to discover the most popular items viewed +/// in your app. Note: If you supply the @c kFIRParameterValue parameter, you must also supply the +/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. Params: /// ///
      -///
    • @c kFIRParameterItemID (NSString)
    • -///
    • @c kFIRParameterItemName (NSString)
    • -///
    • @c kFIRParameterItemCategory (NSString)
    • -///
    • @c kFIRParameterItemLocationID (NSString) (optional)
    • -///
    • @c kFIRParameterPrice (double as NSNumber) (optional)
    • -///
    • @c kFIRParameterQuantity (signed 64-bit integer as NSNumber) (optional)
    • ///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • ///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • -///
    • @c kFIRParameterStartDate (NSString) (optional)
    • -///
    • @c kFIRParameterEndDate (NSString) (optional)
    • -///
    • @c kFIRParameterFlightNumber (NSString) (optional) for travel bookings
    • -///
    • @c kFIRParameterNumberOfPassengers (signed 64-bit integer as NSNumber) (optional) -/// for travel bookings
    • -///
    • @c kFIRParameterNumberOfNights (signed 64-bit integer as NSNumber) (optional) for -/// travel bookings
    • -///
    • @c kFIRParameterNumberOfRooms (signed 64-bit integer as NSNumber) (optional) for -/// travel bookings
    • -///
    • @c kFIRParameterOrigin (NSString) (optional)
    • -///
    • @c kFIRParameterDestination (NSString) (optional)
    • -///
    • @c kFIRParameterSearchTerm (NSString) (optional) for travel bookings
    • -///
    • @c kFIRParameterTravelClass (NSString) (optional) for travel bookings
    • ///
    static NSString *const kFIREventViewItem NS_SWIFT_NAME(AnalyticsEventViewItem) = @"view_item"; -/// View Item List event. Log this event when the user has been presented with a list of items of a -/// certain category. Params: +/// View Item List event. Log this event when a user sees a list of items or offerings. Params: /// ///
      -///
    • @c kFIRParameterItemCategory (NSString)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterItemListID (NSString) (optional)
    • +///
    • @c kFIRParameterItemListName (NSString) (optional)
    • ///
    static NSString *const kFIREventViewItemList NS_SWIFT_NAME(AnalyticsEventViewItemList) = @"view_item_list"; @@ -390,18 +378,103 @@ static NSString *const kFIREventViewItemList NS_SWIFT_NAME(AnalyticsEventViewIte static NSString *const kFIREventViewSearchResults NS_SWIFT_NAME(AnalyticsEventViewSearchResults) = @"view_search_results"; -/// Level Start event. Log this event when the user starts a new level. Params: +/// Add Shipping Info event. This event signifies that a user has submitted their shipping +/// information. Note: If you supply the @c kFIRParameterValue parameter, you must also supply the +/// @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. Params: /// ///
      -///
    • @c kFIRParameterLevelName (NSString)
    • +///
    • @c kFIRParameterCoupon (NSString) (optional)
    • +///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterShippingTier (NSString) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • ///
    -static NSString *const kFIREventLevelStart NS_SWIFT_NAME(AnalyticsEventLevelStart) = - @"level_start"; +static NSString *const kFIREventAddShippingInfo NS_SWIFT_NAME(AnalyticsEventAddShippingInfo) = + @"add_shipping_info"; -/// Level End event. Log this event when the user finishes a level. Params: +/// E-Commerce Purchase event. This event signifies that an item(s) was purchased by a user. Note: +/// This is different from the in-app purchase event, which is reported automatically for App +/// Store-based apps. Note: If you supply the @c kFIRParameterValue parameter, you must also supply +/// the @c kFIRParameterCurrency parameter so that revenue metrics can be computed accurately. +/// Params: /// ///
      -///
    • @c kFIRParameterLevelName (NSString)
    • -///
    • @c kFIRParameterSuccess (NSString)
    • +///
    • @c kFIRParameterAffiliation (NSString) (optional)
    • +///
    • @c kFIRParameterCoupon (NSString) (optional)
    • +///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterShipping (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterTax (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterTransactionID (NSString) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • ///
    -static NSString *const kFIREventLevelEnd NS_SWIFT_NAME(AnalyticsEventLevelEnd) = @"level_end"; +static NSString *const kFIREventPurchase NS_SWIFT_NAME(AnalyticsEventPurchase) = @"purchase"; + +/// E-Commerce Refund event. This event signifies that a refund was issued. Note: If you supply the +/// @c kFIRParameterValue parameter, you must also supply the @c kFIRParameterCurrency parameter so +/// that revenue metrics can be computed accurately. Params: +/// +///
      +///
    • @c kFIRParameterAffiliation (NSString) (optional)
    • +///
    • @c kFIRParameterCoupon (NSString) (optional)
    • +///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterShipping (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterTax (double as NSNumber) (optional)
    • +///
    • @c kFIRParameterTransactionID (NSString) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • +///
    +static NSString *const kFIREventRefund NS_SWIFT_NAME(AnalyticsEventRefund) = @"refund"; + +/// Select Item event. This event signifies that an item was selected by a user from a list. Use the +/// appropriate parameters to contextualize the event. Use this event to discover the most popular +/// items selected. Params: +/// +///
      +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterItemListID (NSString) (optional)
    • +///
    • @c kFIRParameterItemListName (NSString) (optional)
    • +///
    +static NSString *const kFIREventSelectItem NS_SWIFT_NAME(AnalyticsEventSelectItem) = @"select_item"; + +/// Select promotion event. This event signifies that a user has selected a promotion offer. Use the +/// appropriate parameters to contextualize the event, such as the item(s) for which the promotion +/// applies. Params: +/// +///
      +///
    • @c kFIRParameterCreativeName (NSString) (optional)
    • +///
    • @c kFIRParameterCreativeSlot (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterLocationID (NSString) (optional)
    • +///
    • @c kFIRParameterPromotionID (NSString) (optional)
    • +///
    • @c kFIRParameterPromotionName (NSString) (optional)
    • +///
    +static NSString *const kFIREventSelectPromotion NS_SWIFT_NAME(AnalyticsEventSelectPromotion) = + @"select_promotion"; + +/// E-commerce View Cart event. This event signifies that a user has viewed their cart. Use this to +/// analyze your purchase funnel. Note: If you supply the @c kFIRParameterValue parameter, you must +/// also supply the @c kFIRParameterCurrency parameter so that revenue metrics can be computed +/// accurately. Params: +/// +///
      +///
    • @c kFIRParameterCurrency (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterValue (double as NSNumber) (optional)
    • +///
    +static NSString *const kFIREventViewCart NS_SWIFT_NAME(AnalyticsEventViewCart) = @"view_cart"; + +/// View Promotion event. This event signifies that a promotion was shown to a user. Add this event +/// to a funnel with the @c kFIREventAddToCart and @c kFIREventPurchase to gauge your conversion +/// process. Params: +/// +///
      +///
    • @c kFIRParameterCreativeName (NSString) (optional)
    • +///
    • @c kFIRParameterCreativeSlot (NSString) (optional)
    • +///
    • @c kFIRParameterItems (NSArray) (optional)
    • +///
    • @c kFIRParameterLocationID (NSString) (optional)
    • +///
    • @c kFIRParameterPromotionID (NSString) (optional)
    • +///
    • @c kFIRParameterPromotionName (NSString) (optional)
    • +///
    +static NSString *const kFIREventViewPromotion NS_SWIFT_NAME(AnalyticsEventViewPromotion) = + @"view_promotion"; diff --git a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h index ad9fff71f..722130579 100755 --- a/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h +++ b/Pods/FirebaseAnalytics/Frameworks/FirebaseAnalytics.framework/Headers/FIRParameterNames.h @@ -32,8 +32,8 @@ static NSString *const kFIRParameterAchievementID NS_SWIFT_NAME(AnalyticsParamet static NSString *const kFIRParameterAdNetworkClickID NS_SWIFT_NAME(AnalyticsParameterAdNetworkClickID) = @"aclid"; -/// The store or affiliation from which this transaction occurred (NSString). -///
    +/// A product affiliation to designate a supplying company or brick and mortar store location
    +/// (NSString). 
     ///     NSDictionary *params = @{
     ///       kFIRParameterAffiliation : @"Google Store",
     ///       // ...
    @@ -71,6 +71,7 @@ static NSString *const kFIRParameterCharacter NS_SWIFT_NAME(AnalyticsParameterCh
     ///       // ...
     ///     };
     /// 
    +/// This constant has been deprecated. static NSString *const kFIRParameterCheckoutStep NS_SWIFT_NAME(AnalyticsParameterCheckoutStep) = @"checkout_step"; @@ -81,6 +82,7 @@ static NSString *const kFIRParameterCheckoutStep NS_SWIFT_NAME(AnalyticsParamete /// // ... /// }; ///
    +/// This constant has been deprecated. static NSString *const kFIRParameterCheckoutOption NS_SWIFT_NAME(AnalyticsParameterCheckoutOption) = @"checkout_option"; @@ -97,10 +99,10 @@ static NSString *const kFIRParameterContent NS_SWIFT_NAME(AnalyticsParameterCont static NSString *const kFIRParameterContentType NS_SWIFT_NAME(AnalyticsParameterContentType) = @"content_type"; -/// Coupon code for a purchasable item (NSString). +/// Coupon code used for a purchase (NSString). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterCoupon : @"zz123",
    +///       kFIRParameterCoupon : @"SUMMER_FUN",
     ///       // ...
     ///     };
     /// 
    @@ -136,8 +138,8 @@ static NSString *const kFIRParameterCreativeName NS_SWIFT_NAME(AnalyticsParamete static NSString *const kFIRParameterCreativeSlot NS_SWIFT_NAME(AnalyticsParameterCreativeSlot) = @"creative_slot"; -/// Purchase currency in 3-letter -/// ISO_4217 format (NSString). +/// Currency of the purchase or items associated with the event, in 3-letter +/// ISO_4217 format (NSString). ///
     ///     NSDictionary *params = @{
     ///       kFIRParameterCurrency : @"USD",
    @@ -186,10 +188,10 @@ static NSString *const kFIRParameterFlightNumber NS_SWIFT_NAME(AnalyticsParamete
     /// 
    static NSString *const kFIRParameterGroupID NS_SWIFT_NAME(AnalyticsParameterGroupID) = @"group_id"; -/// Index of an item in a list (signed 64-bit integer as NSNumber). +/// The index of the item in a list (signed 64-bit integer as NSNumber). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterIndex : @(1),
    +///       kFIRParameterIndex : @(5),
     ///       // ...
     ///     };
     /// 
    @@ -205,20 +207,20 @@ static NSString *const kFIRParameterIndex NS_SWIFT_NAME(AnalyticsParameterIndex) static NSString *const kFIRParameterItemBrand NS_SWIFT_NAME(AnalyticsParameterItemBrand) = @"item_brand"; -/// Item category (NSString). +/// Item category (context-specific) (NSString). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterItemCategory : @"t-shirts",
    +///       kFIRParameterItemCategory : @"pants",
     ///       // ...
     ///     };
     /// 
    static NSString *const kFIRParameterItemCategory NS_SWIFT_NAME(AnalyticsParameterItemCategory) = @"item_category"; -/// Item ID (NSString). +/// Item ID (context-specific) (NSString). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterItemID : @"p7654",
    +///       kFIRParameterItemID : @"SKU_12345",
     ///       // ...
     ///     };
     /// 
    @@ -232,13 +234,14 @@ static NSString *const kFIRParameterItemID NS_SWIFT_NAME(AnalyticsParameterItemI /// // ... /// }; /// +/// This constant has been deprecated. Use @c kFIRParameterLocationID constant instead. static NSString *const kFIRParameterItemLocationID NS_SWIFT_NAME(AnalyticsParameterItemLocationID) = @"item_location_id"; -/// Item name (NSString). +/// Item Name (context-specific) (NSString). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterItemName : @"abc",
    +///       kFIRParameterItemName : @"jeggings",
     ///       // ...
     ///     };
     /// 
    @@ -252,13 +255,14 @@ static NSString *const kFIRParameterItemName NS_SWIFT_NAME(AnalyticsParameterIte /// // ... /// }; /// +/// This constant has been deprecated. Use @c kFIRParameterItemListName constant instead. static NSString *const kFIRParameterItemList NS_SWIFT_NAME(AnalyticsParameterItemList) = @"item_list"; /// Item variant (NSString). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterItemVariant : @"Red",
    +///       kFIRParameterItemVariant : @"Black",
     ///       // ...
     ///     };
     /// 
    @@ -364,6 +368,26 @@ static NSString *const kFIRParameterQuantity NS_SWIFT_NAME(AnalyticsParameterQua /// static NSString *const kFIRParameterScore NS_SWIFT_NAME(AnalyticsParameterScore) = @"score"; +/// Current screen class, such as the class name of the UIViewController, logged with screen_view +/// event and added to every event (NSString).
    +///     NSDictionary *params = @{
    +///       kFIRParameterScreenClass : @"LoginViewController",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterScreenClass NS_SWIFT_NAME(AnalyticsParameterScreenClass) = + @"screen_class"; + +/// Current screen name, such as the name of the UIViewController, logged with screen_view event and +/// added to every event (NSString).
    +///     NSDictionary *params = @{
    +///       kFIRParameterScreenName : @"LoginView",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterScreenName NS_SWIFT_NAME(AnalyticsParameterScreenName) = + @"screen_name"; + /// The search string/keywords used (NSString). ///
     ///     NSDictionary *params = @{
    @@ -374,11 +398,11 @@ static NSString *const kFIRParameterScore NS_SWIFT_NAME(AnalyticsParameterScore)
     static NSString *const kFIRParameterSearchTerm NS_SWIFT_NAME(AnalyticsParameterSearchTerm) =
         @"search_term";
     
    -/// Shipping cost (double as NSNumber).
    +/// Shipping cost associated with a transaction (double as NSNumber).
     /// 
     ///     NSDictionary *params = @{
    -///       kFIRParameterShipping : @(9.50),
    -///       kFIRParameterCurrency : @"USD",  // e.g. $9.50 USD
    +///       kFIRParameterShipping : @(5.99),
    +///       kFIRParameterCurrency : @"USD",  // e.g. $5.99 USD
     ///       // ...
     ///     };
     /// 
    @@ -429,11 +453,11 @@ static NSString *const kFIRParameterSource NS_SWIFT_NAME(AnalyticsParameterSourc static NSString *const kFIRParameterStartDate NS_SWIFT_NAME(AnalyticsParameterStartDate) = @"start_date"; -/// Tax amount (double as NSNumber). +/// Tax cost associated with a transaction (double as NSNumber). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterTax : @(1.0),
    -///       kFIRParameterCurrency : @"USD",  // e.g. $1.00 USD
    +///       kFIRParameterTax : @(2.43),
    +///       kFIRParameterCurrency : @"USD",  // e.g. $2.43 USD
     ///       // ...
     ///     };
     /// 
    @@ -449,10 +473,10 @@ static NSString *const kFIRParameterTax NS_SWIFT_NAME(AnalyticsParameterTax) = @ ///
    static NSString *const kFIRParameterTerm NS_SWIFT_NAME(AnalyticsParameterTerm) = @"term"; -/// A single ID for a ecommerce group transaction (NSString). +/// The unique identifier of a transaction (NSString). ///
     ///     NSDictionary *params = @{
    -///       kFIRParameterTransactionID : @"ab7236dd9823",
    +///       kFIRParameterTransactionID : @"T12345",
     ///       // ...
     ///     };
     /// 
    @@ -530,3 +554,137 @@ static NSString *const kFIRParameterSuccess NS_SWIFT_NAME(AnalyticsParameterSucc /// static NSString *const kFIRParameterExtendSession NS_SWIFT_NAME(AnalyticsParameterExtendSession) = @"extend_session"; + +/// Monetary value of discount associated with a purchase (double as NSNumber). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterDiscount : @(2.0),
    +///       kFIRParameterCurrency : @"USD",  // e.g. $2.00 USD
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterDiscount NS_SWIFT_NAME(AnalyticsParameterDiscount) = + @"discount"; + +/// Item Category (context-specific) (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemCategory2 : @"pants",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemCategory2 NS_SWIFT_NAME(AnalyticsParameterItemCategory2) = + @"item_category2"; + +/// Item Category (context-specific) (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemCategory3 : @"pants",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemCategory3 NS_SWIFT_NAME(AnalyticsParameterItemCategory3) = + @"item_category3"; + +/// Item Category (context-specific) (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemCategory4 : @"pants",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemCategory4 NS_SWIFT_NAME(AnalyticsParameterItemCategory4) = + @"item_category4"; + +/// Item Category (context-specific) (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemCategory5 : @"pants",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemCategory5 NS_SWIFT_NAME(AnalyticsParameterItemCategory5) = + @"item_category5"; + +/// The ID of the list in which the item was presented to the user (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemListID : @"ABC123",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemListID NS_SWIFT_NAME(AnalyticsParameterItemListID) = + @"item_list_id"; + +/// The name of the list in which the item was presented to the user (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItemListName : @"Related products",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterItemListName NS_SWIFT_NAME(AnalyticsParameterItemListName) = + @"item_list_name"; + +/// The list of items involved in the transaction. (NSArray). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterItems : @[
    +///         @{kFIRParameterItemName : @"jeggings", kFIRParameterItemCategory : @"pants"},
    +///         @{kFIRParameterItemName : @"boots", kFIRParameterItemCategory : @"shoes"},
    +///       ],
    +///     };
    +/// 
    +static NSString *const kFIRParameterItems NS_SWIFT_NAME(AnalyticsParameterItems) = @"items"; + +/// The location associated with the event. Preferred to be the Google +/// Place ID that corresponds to the +/// associated item but could be overridden to a custom location ID string.(NSString).
    +///     NSDictionary *params = @{
    +///       kFIRParameterLocationID : @"ChIJiyj437sx3YAR9kUWC8QkLzQ",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterLocationID NS_SWIFT_NAME(AnalyticsParameterLocationID) = + @"location_id"; + +/// The chosen method of payment (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterPaymentType : @"Visa",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterPaymentType NS_SWIFT_NAME(AnalyticsParameterPaymentType) = + @"payment_type"; + +/// The ID of a product promotion (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterPromotionID : @"ABC123",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterPromotionID NS_SWIFT_NAME(AnalyticsParameterPromotionID) = + @"promotion_id"; + +/// The name of a product promotion (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterPromotionName : @"Summer Sale",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterPromotionName NS_SWIFT_NAME(AnalyticsParameterPromotionName) = + @"promotion_name"; + +/// The shipping tier (e.g. Ground, Air, Next-day) selected for delivery of the purchased item +/// (NSString). +///
    +///     NSDictionary *params = @{
    +///       kFIRParameterShippingTier : @"Ground",
    +///       // ...
    +///     };
    +/// 
    +static NSString *const kFIRParameterShippingTier NS_SWIFT_NAME(AnalyticsParameterShippingTier) = + @"shipping_tier"; diff --git a/Pods/FirebaseAuthInterop/Interop/Auth/Public/FIRAuthInterop.h b/Pods/FirebaseAuthInterop/Interop/Auth/Public/FIRAuthInterop.h deleted file mode 100644 index 5c365a3cd..000000000 --- a/Pods/FirebaseAuthInterop/Interop/Auth/Public/FIRAuthInterop.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRAuthInterop_h -#define FIRAuthInterop_h - -NS_ASSUME_NONNULL_BEGIN - -/** @typedef FIRTokenCallback - @brief The type of block which gets called when a token is ready. - */ -typedef void (^FIRTokenCallback)(NSString *_Nullable token, NSError *_Nullable error) - NS_SWIFT_NAME(TokenCallback); - -/// Common methods for Auth interoperability. -NS_SWIFT_NAME(AuthInterop) -@protocol FIRAuthInterop - -/// Retrieves the Firebase authentication token, possibly refreshing it if it has expired. -- (void)getTokenForcingRefresh:(BOOL)forceRefresh withCallback:(FIRTokenCallback)callback; - -/// Get the current Auth user's UID. Returns nil if there is no user signed in. -- (nullable NSString *)getUserID; - -@end - -NS_ASSUME_NONNULL_END - -#endif /* FIRAuthInterop_h */ diff --git a/Pods/FirebaseAuthInterop/README.md b/Pods/FirebaseAuthInterop/README.md deleted file mode 100644 index 4414b3e3e..000000000 --- a/Pods/FirebaseAuthInterop/README.md +++ /dev/null @@ -1,179 +0,0 @@ -# Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) - -This repository contains a subset of the Firebase iOS SDK source. It currently -includes FirebaseCore, FirebaseAuth, FirebaseDatabase, FirebaseFirestore, -FirebaseFunctions, FirebaseMessaging and FirebaseStorage. - -The repository also includes GoogleUtilities source. The -[GoogleUtilities](GoogleUtilities/README.md) pod is -a set of utilities used by Firebase and other Google products. - -Firebase is an app development platform with tools to help you build, grow and -monetize your app. More information about Firebase can be found at -[https://firebase.google.com](https://firebase.google.com). - -## Installation - -See the three subsections for details about three different installation methods. -1. [Standard pod install](README.md#standard-pod-install) -1. [Installing from the GitHub repo](README.md#installing-from-github) -1. [Experimental Carthage](README.md#carthage-ios-only) - -### Standard pod install - -Go to -[https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup). - -### Installing from GitHub - -For releases starting with 5.0.0, the source for each release is also deployed -to CocoaPods master and available via standard -[CocoaPods Podfile syntax](https://guides.cocoapods.org/syntax/podfile.html#pod). - -These instructions can be used to access the Firebase repo at other branches, -tags, or commits. - -#### Background - -See -[the Podfile Syntax Reference](https://guides.cocoapods.org/syntax/podfile.html#pod) -for instructions and options about overriding pod source locations. - -#### Accessing Firebase Source Snapshots - -All of the official releases are tagged in this repo and available via CocoaPods. To access a local -source snapshot or unreleased branch, use Podfile directives like the following: - -To access FirebaseFirestore via a branch: -``` -pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master' -pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master' -``` - -To access FirebaseMessaging via a checked out version of the firebase-ios-sdk repo do: - -``` -pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk' -pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk' -``` - -### Carthage (iOS only) - -An experimental Carthage distribution is now available. See -[Carthage](Carthage.md). - -## Development - -Follow the subsequent instructions to develop, debug, unit test, run integration -tests, and try out reference samples: - -``` -$ git clone git@github.com:firebase/firebase-ios-sdk.git -$ cd firebase-ios-sdk/Example -$ pod update -$ open Firebase.xcworkspace -``` - -Firestore and Functions have self contained Xcode projects. See -[Firestore/README.md](Firestore/README.md) and -[Functions/README.md](Functions/README.md). - -### Running Unit Tests - -Select a scheme and press Command-u to build a component and run its unit tests. - -### Running Sample Apps -In order to run the sample apps and integration tests, you'll need valid -`GoogleService-Info.plist` files for those samples. The Firebase Xcode project contains dummy plist -files without real values, but can be replaced with real plist files. To get your own -`GoogleService-Info.plist` files: - -1. Go to the [Firebase Console](https://console.firebase.google.com/) -2. Create a new Firebase project, if you don't already have one -3. For each sample app you want to test, create a new Firebase app with the sample app's bundle -identifier (e.g. `com.google.Database-Example`) -4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file -(e.g. in [Example/Database/App/](Example/Database/App/)); - -Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require -special Apple capabilities, and you will have to change the sample app to use a unique bundle -identifier that you can control in your own Apple Developer account. - -## Specific Component Instructions -See the sections below for any special instructions for those components. - -### Firebase Auth - -If you're doing specific Firebase Auth development, see -[AuthSamples/README.md](AuthSamples/README.md) for instructions about -building and running the FirebaseAuth pod along with various samples and tests. - -### Firebase Database - -To run the Database Integration tests, make your database authentication rules -[public](https://firebase.google.com/docs/database/security/quickstart). - -### Firebase Storage - -To run the Storage Integration tests, follow the instructions in -[FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m). - -#### Push Notifications - -Push notifications can only be delivered to specially provisioned App IDs in the developer portal. -In order to actually test receiving push notifications, you will need to: - -1. Change the bundle identifier of the sample app to something you own in your Apple Developer -account, and enable that App ID for push notifications. -2. You'll also need to -[upload your APNs Provider Authentication Key or certificate to the Firebase Console](https://firebase.google.com/docs/cloud-messaging/ios/certs) -at **Project Settings > Cloud Messaging > [Your Firebase App]**. -3. Ensure your iOS device is added to your Apple Developer portal as a test device. - -#### iOS Simulator - -The iOS Simulator cannot register for remote notifications, and will not receive push notifications. -In order to receive push notifications, you'll have to follow the steps above and run the app on a -physical device. - -## Community Supported Efforts - -We've seen an amazing amount of interest and contributions to improve the Firebase SDKs, and we are -very grateful! We'd like to empower as many developers as we can to be able to use Firebase and -participate in the Firebase community. - -### macOS and tvOS -FirebaseAuth, FirebaseCore, FirebaseDatabase and FirebaseStorage now compile, run unit tests, and -work on macOS and tvOS, thanks to contributions from the community. There are a few tweaks needed, -like ensuring iOS-only, macOS-only, or tvOS-only code is correctly guarded with checks for -`TARGET_OS_IOS`, `TARGET_OS_OSX` and `TARGET_OS_TV`. - -For tvOS, checkout the [Sample](Example/tvOSSample). - -Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is -actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there -may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter -this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). - -For installation instructions, see [above](README.md#accessing-firebase-source-snapshots). - -Note that the Firebase pod is not available for macOS and tvOS. Install a selection of the -`FirebaseAuth`, `FirebaseCore`, `FirebaseDatabase` and `FirebaseStorage` CocoaPods. - -## Roadmap - -See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source -plans and directions. - -## Contributing - -See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase -iOS SDK. - -## License - -The contents of this repository is licensed under the -[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). - -Your use of Firebase is governed by the -[Terms of Service for Firebase Services](https://firebase.google.com/terms/). diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRAppInternal.h b/Pods/FirebaseCore/Firebase/Core/Private/FIRAppInternal.h deleted file mode 100644 index ad1a186b9..000000000 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRAppInternal.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import -#import - -@class FIRComponentContainer; -@protocol FIRLibrary; - -/** - * The internal interface to FIRApp. This is meant for first-party integrators, who need to receive - * FIRApp notifications, log info about the success or failure of their configuration, and access - * other internal functionality of FIRApp. - * - * TODO(b/28296561): Restructure this header. - */ -NS_ASSUME_NONNULL_BEGIN - -typedef NS_ENUM(NSInteger, FIRConfigType) { - FIRConfigTypeCore = 1, - FIRConfigTypeSDK = 2, -}; - -extern NSString *const kFIRDefaultAppName; -extern NSString *const kFIRAppReadyToConfigureSDKNotification; -extern NSString *const kFIRAppDeleteNotification; -extern NSString *const kFIRAppIsDefaultAppKey; -extern NSString *const kFIRAppNameKey; -extern NSString *const kFIRGoogleAppIDKey; - -/** - * The format string for the User Defaults key used for storing the data collection enabled flag. - * This includes formatting to append the Firebase App's name. - */ -extern NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat; - -/** - * The plist key used for storing the data collection enabled flag. - */ -extern NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey; - -/** - * A notification fired containing diagnostic information when SDK errors occur. - */ -extern NSString *const kFIRAppDiagnosticsNotification; - -/** @var FIRAuthStateDidChangeInternalNotification - @brief The name of the @c NSNotificationCenter notification which is posted when the auth state - changes (e.g. a new token has been produced, a user logs in or out). The object parameter of - the notification is a dictionary possibly containing the key: - @c FIRAuthStateDidChangeInternalNotificationTokenKey (the new access token.) If it does not - contain this key it indicates a sign-out event took place. - */ -extern NSString *const FIRAuthStateDidChangeInternalNotification; - -/** @var FIRAuthStateDidChangeInternalNotificationTokenKey - @brief A key present in the dictionary object parameter of the - @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this - key will contain the new access token. - */ -extern NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey; - -/** @var FIRAuthStateDidChangeInternalNotificationAppKey - @brief A key present in the dictionary object parameter of the - @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this - key will contain the FIRApp associated with the auth instance. - */ -extern NSString *const FIRAuthStateDidChangeInternalNotificationAppKey; - -/** @var FIRAuthStateDidChangeInternalNotificationUIDKey - @brief A key present in the dictionary object parameter of the - @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this - key will contain the new user's UID (or nil if there is no longer a user signed in). - */ -extern NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey; - -@interface FIRApp () - -/** - * A flag indicating if this is the default app (has the default app name). - */ -@property(nonatomic, readonly) BOOL isDefaultApp; - -/* - * The container of interop SDKs for this app. - */ -@property(nonatomic) FIRComponentContainer *container; - -/** - * Creates an error for failing to configure a subspec service. This method is called by each - * FIRApp notification listener. - */ -+ (NSError *)errorForSubspecConfigurationFailureWithDomain:(NSString *)domain - errorCode:(FIRErrorCode)code - service:(NSString *)service - reason:(NSString *)reason; -/** - * Checks if the default app is configured without trying to configure it. - */ -+ (BOOL)isDefaultAppConfigured; - -/** - * Registers a given third-party library with the given version number to be reported for - * analytics. - * - * @param name Name of the library. - * @param version Version of the library. - */ -+ (void)registerLibrary:(nonnull NSString *)name withVersion:(nonnull NSString *)version; - -/** - * Registers a given internal library with the given version number to be reported for - * analytics. - * - * @param library Optional parameter for component registration. - * @param name Name of the library. - * @param version Version of the library. - */ -+ (void)registerInternalLibrary:(nonnull Class)library - withName:(nonnull NSString *)name - withVersion:(nonnull NSString *)version; - -/** - * A concatenated string representing all the third-party libraries and version numbers. - */ -+ (NSString *)firebaseUserAgent; - -/** - * Used by each SDK to send logs about SDK configuration status to Clearcut. - * - * @note This API is a no-op, please remove calls to it. - */ -- (void)sendLogsWithServiceName:(NSString *)serviceName - version:(NSString *)version - error:(NSError *)error; - -/** - * Can be used by the unit tests in eack SDK to reset FIRApp. This method is thread unsafe. - */ -+ (void)resetApps; - -/** - * Can be used by the unit tests in each SDK to set customized options. - */ -- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRComponentContainer.h b/Pods/FirebaseCore/Firebase/Core/Private/FIRComponentContainer.h deleted file mode 100644 index f3dc356d6..000000000 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRComponentContainer.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#import - -#import "FIRComponentType.h" -#import "FIRLibrary.h" - -NS_ASSUME_NONNULL_BEGIN - -/// A type-safe macro to retrieve a component from a container. This should be used to retrieve -/// components instead of using the container directly. -#define FIR_COMPONENT(type, container) \ - [FIRComponentType> instanceForProtocol:@protocol(type) inContainer:container] - -@class FIRApp; - -/// A container that holds different components that are registered via the -/// `registerAsComponentRegistrant:` call. These classes should conform to `FIRComponentRegistrant` -/// in order to properly register components for Core. -NS_SWIFT_NAME(FirebaseComponentContainer) -@interface FIRComponentContainer : NSObject - -/// A weak reference to the app that an instance of the container belongs to. -@property(nonatomic, weak, readonly) FIRApp *app; - -/// Unavailable. Use the `container` property on `FIRApp`. -- (instancetype)init NS_UNAVAILABLE; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRErrorCode.h b/Pods/FirebaseCore/Firebase/Core/Private/FIRErrorCode.h deleted file mode 100644 index f77b3d002..000000000 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRErrorCode.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** Error codes in Firebase error domain. */ -typedef NS_ENUM(NSInteger, FIRErrorCode) { - /** - * Unknown error. - */ - FIRErrorCodeUnknown = 0, - /** - * Loading data from the GoogleService-Info.plist file failed. This is a fatal error and should - * not be ignored. Further calls to the API will fail and/or possibly cause crashes. - */ - FIRErrorCodeInvalidPlistFile = -100, - - /** - * Validating the Google App ID format failed. - */ - FIRErrorCodeInvalidAppID = -101, - - /** - * Error code for failing to configure a specific service. - */ - FIRErrorCodeConfigFailed = -114, -}; diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRLibrary.h b/Pods/FirebaseCore/Firebase/Core/Private/FIRLibrary.h deleted file mode 100644 index 728c06232..000000000 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRLibrary.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRLibrary_h -#define FIRLibrary_h - -#import -#import "FIRComponent.h" - -@class FIRApp; - -NS_ASSUME_NONNULL_BEGIN - -/// Provide an interface to register a library for userAgent logging and availability to others. -NS_SWIFT_NAME(Library) -@protocol FIRLibrary - -/// Returns one or more FIRComponents that will be registered in -/// FIRApp and participate in dependency resolution and injection. -+ (NSArray *)componentsToRegister; - -@optional -/// Implement this method if the library needs notifications for lifecycle events. This method is -/// called when the developer calls `FirebaseApp.configure()`. -+ (void)configureWithApp:(FIRApp *)app; - -@end - -NS_ASSUME_NONNULL_END - -#endif /* FIRLibrary_h */ diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRAnalyticsConfiguration.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRAnalyticsConfiguration.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.h diff --git a/Pods/FirebaseCore/Firebase/Core/FIRAnalyticsConfiguration.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.m similarity index 97% rename from Pods/FirebaseCore/Firebase/Core/FIRAnalyticsConfiguration.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.m index a57936b9b..07c786cb7 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRAnalyticsConfiguration.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRAnalyticsConfiguration.m @@ -14,7 +14,7 @@ #import -#import "Private/FIRAnalyticsConfiguration.h" +#import "FirebaseCore/Sources/FIRAnalyticsConfiguration.h" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" diff --git a/Pods/FirebaseCore/Firebase/Core/FIRApp.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m similarity index 86% rename from Pods/FirebaseCore/Firebase/Core/FIRApp.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m index da8917ed5..b3829c22b 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRApp.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRApp.m @@ -22,17 +22,22 @@ #import #endif -#import "FIRApp.h" - -#import "Private/FIRAnalyticsConfiguration.h" -#import "Private/FIRAppInternal.h" -#import "Private/FIRBundleUtil.h" -#import "Private/FIRComponentContainerInternal.h" -#import "Private/FIRConfigurationInternal.h" -#import "Private/FIRCoreDiagnosticsConnector.h" -#import "Private/FIRLibrary.h" -#import "Private/FIRLogger.h" -#import "Private/FIROptionsInternal.h" +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h" + +#import "FirebaseCore/Sources/FIRAnalyticsConfiguration.h" +#import "FirebaseCore/Sources/FIRBundleUtil.h" +#import "FirebaseCore/Sources/FIRComponentContainerInternal.h" +#import "FirebaseCore/Sources/FIRConfigurationInternal.h" +#import "FirebaseCore/Sources/FIRVersion.h" +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" + +#import "GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h" + +#import // The kFIRService strings are only here while transitioning CoreDiagnostics from the Analytics // pod to a Core dependency. These symbols are not used and should be deleted after the transition. @@ -73,6 +78,7 @@ NSString *const kFIRAppDiagnosticsFIRAppKey = @"FIRApp"; NSString *const kFIRAppDiagnosticsSDKNameKey = @"SDKName"; NSString *const kFIRAppDiagnosticsSDKVersionKey = @"SDKVersion"; +NSString *const kFIRAppDiagnosticsApplePlatformPrefix = @"apple-platform"; // Auth internal notification notification and key. NSString *const FIRAuthStateDidChangeInternalNotification = @@ -111,6 +117,7 @@ @implementation FIRApp static NSMutableDictionary *sAllApps; static FIRApp *sDefaultApp; static NSMutableDictionary *sLibraryVersions; +static dispatch_once_t sFirebaseUserAgentOnceToken; + (void)configure { FIROptions *options = [FIROptions defaultOptions]; @@ -159,8 +166,9 @@ + (void)configureWithName:(NSString *)name options:(FIROptions *)options { if ([name isEqualToString:kFIRDefaultAppName]) { if (sDefaultApp) { - [NSException raise:kFirebaseCoreErrorDomain - format:@"Default app has already been configured."]; + // The default app already exists. Handle duplicate `configure` calls and return. + [self appWasConfiguredTwice:sDefaultApp usingOptions:options]; + return; } FIRLogDebug(kFIRLoggerCore, @"I-COR000001", @"Configuring the default app."); @@ -176,8 +184,9 @@ + (void)configureWithName:(NSString *)name options:(FIROptions *)options { @synchronized(self) { if (sAllApps && sAllApps[name]) { - [NSException raise:kFirebaseCoreErrorDomain - format:@"App named %@ has already been configured.", name]; + // The app already exists. Handle a duplicate `configure` call and return. + [self appWasConfiguredTwice:sAllApps[name] usingOptions:options]; + return; } } @@ -199,6 +208,36 @@ + (void)configureWithName:(NSString *)name options:(FIROptions *)options { } } +/// Called when `configure` has been called multiple times for the same app. This can either throw +/// an exception (most cases) or ignore the duplicate configuration in situations where it's allowed +/// like an extension. ++ (void)appWasConfiguredTwice:(FIRApp *)app usingOptions:(FIROptions *)options { + // Only extensions should potentially be able to call `configure` more than once. + if (![GULAppEnvironmentUtil isAppExtension]) { + // Throw an exception since this is now an invalid state. + if (app.isDefaultApp) { + [NSException raise:kFirebaseCoreErrorDomain + format:@"Default app has already been configured."]; + } else { + [NSException raise:kFirebaseCoreErrorDomain + format:@"App named %@ has already been configured.", app.name]; + } + } + + // In an extension, the entry point could be called multiple times. As long as the options are + // identical we should allow multiple `configure` calls. + if ([options isEqual:app.options]) { + // Everything is identical but the extension's lifecycle triggered `configure` twice. + // Ignore duplicate calls and return since everything should still be in a valid state. + FIRLogDebug(kFIRLoggerCore, @"I-COR000035", + @"Ignoring second `configure` call in an extension."); + return; + } else { + [NSException raise:kFirebaseCoreErrorDomain + format:@"App named %@ has already been configured.", app.name]; + } +} + + (FIRApp *)defaultApp { if (sDefaultApp) { return sDefaultApp; @@ -240,6 +279,7 @@ + (void)resetApps { sAllApps = nil; [sLibraryVersions removeAllObjects]; sLibraryVersions = nil; + sFirebaseUserAgentOnceToken = 0; } } @@ -248,6 +288,8 @@ - (void)deleteApp:(FIRAppVoidBoolCallback)completion { if (sAllApps && sAllApps[self.name]) { FIRLogDebug(kFIRLoggerCore, @"I-COR000006", @"Deleting app named %@", self.name); + // Remove all registered libraries from the container to avoid creating new instances. + [self.container removeAllComponents]; // Remove all cached instances from the container before deleting the app. [self.container removeAllCachedInstances]; @@ -521,6 +563,28 @@ + (void)registerInternalLibrary:(nonnull Class)library + (NSString *)firebaseUserAgent { @synchronized(self) { + dispatch_once(&sFirebaseUserAgentOnceToken, ^{ + // Report FirebaseCore version for useragent string + [FIRApp registerLibrary:@"fire-ios" + withVersion:[NSString stringWithUTF8String:FIRCoreVersionString]]; + + NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; + NSString *xcodeVersion = info[@"DTXcodeBuild"]; + NSString *sdkVersion = info[@"DTSDKBuild"]; + if (xcodeVersion) { + [FIRApp registerLibrary:@"xcode" withVersion:xcodeVersion]; + } + if (sdkVersion) { + [FIRApp registerLibrary:@"apple-sdk" withVersion:sdkVersion]; + } + + NSString *swiftFlagValue = [self hasSwiftRuntime] ? @"true" : @"false"; + [FIRApp registerLibrary:@"swift" withVersion:swiftFlagValue]; + + [FIRApp registerLibrary:kFIRAppDiagnosticsApplePlatformPrefix + withVersion:[self applePlatform]]; + }); + NSMutableArray *libraries = [[NSMutableArray alloc] initWithCapacity:sLibraryVersions.count]; for (NSString *libraryName in sLibraryVersions) { @@ -532,6 +596,40 @@ + (NSString *)firebaseUserAgent { } } ++ (BOOL)hasSwiftRuntime { + // The class + // [Swift._SwiftObject](https://github.com/apple/swift/blob/5eac3e2818eb340b11232aff83edfbd1c307fa03/stdlib/public/runtime/SwiftObject.h#L35) + // is a part of Swift runtime, so it should be present if Swift runtime is available. + + BOOL hasSwiftRuntime = + objc_lookUpClass("Swift._SwiftObject") != nil || + // Swift object class name before + // https://github.com/apple/swift/commit/9637b4a6e11ddca72f5f6dbe528efc7c92f14d01 + objc_getClass("_TtCs12_SwiftObject") != nil; + + return hasSwiftRuntime; +} + ++ (NSString *)applePlatform { + NSString *applePlatform = @"unknown"; + + // When a Catalyst app is run on macOS then both `TARGET_OS_MACCATALYST` and `TARGET_OS_IOS` are + // `true`, which means the condition list is order-sensitive. +#if TARGET_OS_MACCATALYST + applePlatform = @"maccatalyst"; +#elif TARGET_OS_IOS + applePlatform = @"ios"; +#elif TARGET_OS_TV + applePlatform = @"tvos"; +#elif TARGET_OS_OSX + applePlatform = @"macos"; +#elif TARGET_OS_WATCH + applePlatform = @"watchos"; +#endif + + return applePlatform; +} + - (void)checkExpectedBundleID { NSArray *bundles = [FIRBundleUtil relevantBundles]; NSString *expectedBundleID = [self expectedBundleID]; @@ -815,16 +913,16 @@ - (void)sendLogsWithServiceName:(NSString *)serviceName - (void)subscribeForAppDidBecomeActiveNotifications { #if TARGET_OS_IOS || TARGET_OS_TV NSNotificationName notificationName = UIApplicationDidBecomeActiveNotification; -#endif - -#if TARGET_OS_OSX +#elif TARGET_OS_OSX NSNotificationName notificationName = NSApplicationDidBecomeActiveNotification; #endif +#if !TARGET_OS_WATCH [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(appDidBecomeActive:) name:notificationName object:nil]; +#endif } - (void)appDidBecomeActive:(NSNotification *)notification { diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRAppAssociationRegistration.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRAppAssociationRegistration.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.h diff --git a/Pods/FirebaseCore/Firebase/Core/FIRAppAssociationRegistration.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.m similarity index 96% rename from Pods/FirebaseCore/Firebase/Core/FIRAppAssociationRegistration.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.m index 2aecdabe1..f3f812c74 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRAppAssociationRegistration.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRAppAssociationRegistration.m @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "Private/FIRAppAssociationRegistration.h" +#import "FirebaseCore/Sources/FIRAppAssociationRegistration.h" #import diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRBundleUtil.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRBundleUtil.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.h diff --git a/Pods/FirebaseCore/Firebase/Core/FIRBundleUtil.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.m similarity index 76% rename from Pods/FirebaseCore/Firebase/Core/FIRBundleUtil.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.m index 65fc309f1..d4b32cf16 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRBundleUtil.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRBundleUtil.m @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "Private/FIRBundleUtil.h" +#import "FirebaseCore/Sources/FIRBundleUtil.h" -#import +#import "GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h" @implementation FIRBundleUtil @@ -49,15 +49,19 @@ + (NSArray *)relevantURLSchemes { + (BOOL)hasBundleIdentifierPrefix:(NSString *)bundleIdentifier inBundles:(NSArray *)bundles { for (NSBundle *bundle in bundles) { - // This allows app extensions that have the app's bundle as their prefix to pass this test. - NSString *applicationBundleIdentifier = - [GULAppEnvironmentUtil isAppExtension] - ? [self bundleIdentifierByRemovingLastPartFrom:bundle.bundleIdentifier] - : bundle.bundleIdentifier; - - if ([applicationBundleIdentifier isEqualToString:bundleIdentifier]) { + if ([bundle.bundleIdentifier isEqualToString:bundleIdentifier]) { return YES; } + + if ([GULAppEnvironmentUtil isAppExtension]) { + // A developer could be using the same `FIROptions` for both their app and extension. Since + // extensions have a suffix added to the bundleID, we consider a matching prefix as valid. + NSString *appBundleIDFromExtension = + [self bundleIdentifierByRemovingLastPartFrom:bundle.bundleIdentifier]; + if ([appBundleIDFromExtension isEqualToString:bundleIdentifier]) { + return YES; + } + } } return NO; } diff --git a/Pods/FirebaseCore/Firebase/Core/FIRComponent.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponent.m similarity index 93% rename from Pods/FirebaseCore/Firebase/Core/FIRComponent.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRComponent.m index 2474d1aab..9c1fbed3c 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRComponent.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponent.m @@ -14,10 +14,10 @@ * limitations under the License. */ -#import "Private/FIRComponent.h" +#import "FirebaseCore/Sources/Private/FIRComponent.h" -#import "Private/FIRComponentContainer.h" -#import "Private/FIRDependency.h" +#import "FirebaseCore/Sources/Private/FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRDependency.h" @interface FIRComponent () diff --git a/Pods/FirebaseCore/Firebase/Core/FIRComponentContainer.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainer.m similarity index 94% rename from Pods/FirebaseCore/Firebase/Core/FIRComponentContainer.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainer.m index 0aeac805b..bbe887824 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRComponentContainer.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainer.m @@ -14,18 +14,18 @@ * limitations under the License. */ -#import "Private/FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRComponentContainer.h" -#import "Private/FIRAppInternal.h" -#import "Private/FIRComponent.h" -#import "Private/FIRLibrary.h" -#import "Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRComponent.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" NS_ASSUME_NONNULL_BEGIN @interface FIRComponentContainer () -/// The dictionary of components that are registered for a particular app. The key is an NSString +/// The dictionary of components that are registered for a particular app. The key is an `NSString` /// of the protocol. @property(nonatomic, strong) NSMutableDictionary *components; @@ -203,6 +203,12 @@ - (void)removeAllCachedInstances { } } +- (void)removeAllComponents { + @synchronized(self) { + [self.components removeAllObjects]; + } +} + @end NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRComponentContainerInternal.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainerInternal.h similarity index 77% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRComponentContainerInternal.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainerInternal.h index f745f6a47..82356060d 100644 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRComponentContainerInternal.h +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentContainerInternal.h @@ -15,8 +15,8 @@ */ #import -#import "FIRComponent.h" -#import "FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRComponent.h" +#import "FirebaseCore/Sources/Private/FIRComponentContainer.h" @class FIRApp; @@ -24,11 +24,11 @@ NS_ASSUME_NONNULL_BEGIN @interface FIRComponentContainer (Private) -/// Initializes a contain for a given app. This should only be called by the app itself. +/// Initializes a container for a given app. This should only be called by the app itself. - (instancetype)initWithApp:(FIRApp *)app; /// Retrieves an instance that conforms to the specified protocol. This will return `nil` if the -/// protocol wasn't registered, or if the instance couldn't instantiate for the provided app. +/// protocol wasn't registered, or if the instance couldn't be instantiated for the provided app. - (nullable id)instanceForProtocol:(Protocol *)protocol NS_SWIFT_NAME(instance(for:)); /// Instantiates all the components that have registered as "eager" after initialization. @@ -37,6 +37,9 @@ NS_ASSUME_NONNULL_BEGIN /// Remove all of the cached instances stored and allow them to clean up after themselves. - (void)removeAllCachedInstances; +/// Removes all the components. After calling this method no new instances will be created. +- (void)removeAllComponents; + /// Register a class to provide components for the interoperability system. The class should conform /// to `FIRComponentRegistrant` and provide an array of `FIRComponent` objects. + (void)registerAsComponentRegistrant:(Class)klass; diff --git a/Pods/FirebaseCore/Firebase/Core/FIRComponentType.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentType.m similarity index 87% rename from Pods/FirebaseCore/Firebase/Core/FIRComponentType.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentType.m index bdc004fbc..9051336a6 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRComponentType.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRComponentType.m @@ -14,9 +14,9 @@ * limitations under the License. */ -#import "Private/FIRComponentType.h" +#import "FirebaseCore/Sources/Private/FIRComponentType.h" -#import "Private/FIRComponentContainerInternal.h" +#import "FirebaseCore/Sources/FIRComponentContainerInternal.h" @implementation FIRComponentType diff --git a/Pods/FirebaseCore/Firebase/Core/FIRConfiguration.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfiguration.m similarity index 91% rename from Pods/FirebaseCore/Firebase/Core/FIRConfiguration.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRConfiguration.m index 869f73d7f..83b3248c3 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRConfiguration.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfiguration.m @@ -12,9 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "Private/FIRConfigurationInternal.h" +#import "FirebaseCore/Sources/FIRConfigurationInternal.h" -#import "Private/FIRAnalyticsConfiguration.h" +#import "FirebaseCore/Sources/FIRAnalyticsConfiguration.h" extern void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel); diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRConfigurationInternal.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfigurationInternal.h similarity index 92% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRConfigurationInternal.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRConfigurationInternal.h index ee1688670..9361e73fa 100644 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRConfigurationInternal.h +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRConfigurationInternal.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "FIRConfiguration.h" +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h" @class FIRAnalyticsConfiguration; diff --git a/Pods/FirebaseCore/Firebase/Core/FIRCoreDiagnosticsConnector.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRCoreDiagnosticsConnector.m similarity index 86% rename from Pods/FirebaseCore/Firebase/Core/FIRCoreDiagnosticsConnector.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRCoreDiagnosticsConnector.m index 7d504e86b..db54936a8 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRCoreDiagnosticsConnector.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRCoreDiagnosticsConnector.m @@ -14,15 +14,15 @@ * limitations under the License. */ -#import "Private/FIRCoreDiagnosticsConnector.h" +#import "FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h" -#import +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h" -#import +#import "FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h" -#import "Private/FIRAppInternal.h" -#import "Private/FIRDiagnosticsData.h" -#import "Private/FIROptionsInternal.h" +#import "FirebaseCore/Sources/FIRDiagnosticsData.h" +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" // Define the interop class symbol declared as an extern in FIRCoreDiagnosticsInterop. Class FIRCoreDiagnosticsImplementation; diff --git a/Pods/FirebaseCore/Firebase/Core/FIRDependency.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRDependency.m similarity index 95% rename from Pods/FirebaseCore/Firebase/Core/FIRDependency.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRDependency.m index f97998414..e1e25783e 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRDependency.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRDependency.m @@ -14,7 +14,7 @@ * limitations under the License. */ -#import "Private/FIRDependency.h" +#import "FirebaseCore/Sources/Private/FIRDependency.h" @interface FIRDependency () diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRDiagnosticsData.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.h similarity index 94% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRDiagnosticsData.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.h index ac5ef2c4f..5b5ff8ad9 100644 --- a/Pods/FirebaseCore/Firebase/Core/Private/FIRDiagnosticsData.h +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.h @@ -16,7 +16,7 @@ #import -#import +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Pods/FirebaseCore/Firebase/Core/FIRDiagnosticsData.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.m similarity index 89% rename from Pods/FirebaseCore/Firebase/Core/FIRDiagnosticsData.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.m index 04769737f..0beed25bd 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRDiagnosticsData.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRDiagnosticsData.m @@ -14,12 +14,12 @@ * limitations under the License. */ -#import "Private/FIRDiagnosticsData.h" +#import "FirebaseCore/Sources/FIRDiagnosticsData.h" -#import +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h" -#import "Private/FIRAppInternal.h" -#import "Private/FIROptionsInternal.h" +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" @implementation FIRDiagnosticsData { /** Backing ivar for the diagnosticObjects property. */ diff --git a/Pods/FirebaseCore/Firebase/Core/FIRErrors.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRErrors.m similarity index 94% rename from Pods/FirebaseCore/Firebase/Core/FIRErrors.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRErrors.m index 72120c5c9..104eeb825 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRErrors.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRErrors.m @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "Private/FIRErrors.h" +#import "FirebaseCore/Sources/Private/FIRErrors.h" NSString *const kFirebaseErrorDomain = @"com.firebase"; NSString *const kFirebaseConfigErrorDomain = @"com.firebase.config"; diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m new file mode 100644 index 000000000..be8b05136 --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRHeartbeatInfo.m @@ -0,0 +1,61 @@ +// Copyright 2019 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "FirebaseCore/Sources/Private/FIRHeartbeatInfo.h" +#import "GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h" +#import "GoogleUtilities/Logger/Private/GULLogger.h" + +const static long secondsInDay = 86400; +@implementation FIRHeartbeatInfo : NSObject + +/** Updates the storage with the heartbeat information corresponding to this tag. + * @param heartbeatTag Tag which could either be sdk specific tag or the global tag. + * @return Boolean representing whether the heartbeat needs to be sent for this tag or not. + */ ++ (BOOL)updateIfNeededHeartbeatDateForTag:(NSString *)heartbeatTag { + @synchronized(self) { + NSString *const kHeartbeatStorageFile = @"HEARTBEAT_INFO_STORAGE"; + GULHeartbeatDateStorage *dataStorage = + [[GULHeartbeatDateStorage alloc] initWithFileName:kHeartbeatStorageFile]; + NSDate *heartbeatTime = [dataStorage heartbeatDateForTag:heartbeatTag]; + NSDate *currentDate = [NSDate date]; + if (heartbeatTime != nil) { + NSTimeInterval secondsBetween = [currentDate timeIntervalSinceDate:heartbeatTime]; + if (secondsBetween < secondsInDay) { + return false; + } + } + return [dataStorage setHearbeatDate:currentDate forTag:heartbeatTag]; + } +} + ++ (FIRHeartbeatInfoCode)heartbeatCodeForTag:(NSString *)heartbeatTag { + NSString *globalTag = @"GLOBAL"; + BOOL isSdkHeartbeatNeeded = [FIRHeartbeatInfo updateIfNeededHeartbeatDateForTag:heartbeatTag]; + BOOL isGlobalHeartbeatNeeded = [FIRHeartbeatInfo updateIfNeededHeartbeatDateForTag:globalTag]; + if (!isSdkHeartbeatNeeded && !isGlobalHeartbeatNeeded) { + // Both sdk and global heartbeat not needed. + return FIRHeartbeatInfoCodeNone; + } else if (isSdkHeartbeatNeeded && !isGlobalHeartbeatNeeded) { + // Only SDK heartbeat needed. + return FIRHeartbeatInfoCodeSDK; + } else if (!isSdkHeartbeatNeeded && isGlobalHeartbeatNeeded) { + // Only global heartbeat needed. + return FIRHeartbeatInfoCodeGlobal; + } else { + // Both sdk and global heartbeat are needed. + return FIRHeartbeatInfoCodeCombined; + } +} +@end diff --git a/Pods/FirebaseCore/Firebase/Core/FIRLogger.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m similarity index 95% rename from Pods/FirebaseCore/Firebase/Core/FIRLogger.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m index 532a96c29..fc07adabb 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIRLogger.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIRLogger.m @@ -12,13 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" -#import -#import -#import +#import "FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h" +#import "GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h" +#import "GoogleUtilities/Logger/Private/GULLogger.h" -#import "Private/FIRVersion.h" +#import "FirebaseCore/Sources/FIRVersion.h" FIRLoggerService kFIRLoggerCore = @"[Firebase/Core]"; diff --git a/Pods/FirebaseCore/Firebase/Core/FIROptions.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIROptions.m similarity index 81% rename from Pods/FirebaseCore/Firebase/Core/FIROptions.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIROptions.m index e259bf8b3..3f35c7638 100644 --- a/Pods/FirebaseCore/Firebase/Core/FIROptions.m +++ b/Pods/FirebaseCore/FirebaseCore/Sources/FIROptions.m @@ -12,12 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "Private/FIRAppInternal.h" -#import "Private/FIRBundleUtil.h" -#import "Private/FIRErrors.h" -#import "Private/FIRLogger.h" -#import "Private/FIROptionsInternal.h" -#import "Private/FIRVersion.h" +#import "FirebaseCore/Sources/FIRBundleUtil.h" +#import "FirebaseCore/Sources/FIRVersion.h" +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" // Keys for the strings in the plist file. NSString *const kFIRAPIKey = @"API_KEY"; @@ -91,56 +90,40 @@ @implementation FIROptions { static FIROptions *sDefaultOptions = nil; static NSDictionary *sDefaultOptionsDictionary = nil; +static dispatch_once_t sDefaultOptionsOnceToken; +static dispatch_once_t sDefaultOptionsDictionaryOnceToken; #pragma mark - Public only for internal class methods + (FIROptions *)defaultOptions { - if (sDefaultOptions != nil) { - return sDefaultOptions; - } - - NSDictionary *defaultOptionsDictionary = [self defaultOptionsDictionary]; - if (defaultOptionsDictionary == nil) { - return nil; - } + dispatch_once(&sDefaultOptionsOnceToken, ^{ + NSDictionary *defaultOptionsDictionary = [self defaultOptionsDictionary]; + if (defaultOptionsDictionary != nil) { + sDefaultOptions = + [[FIROptions alloc] initInternalWithOptionsDictionary:defaultOptionsDictionary]; + } + }); - sDefaultOptions = [[FIROptions alloc] initInternalWithOptionsDictionary:defaultOptionsDictionary]; return sDefaultOptions; } #pragma mark - Private class methods -+ (void)initialize { - // Report FirebaseCore version for useragent string - [FIRApp registerLibrary:@"fire-ios" - withVersion:[NSString stringWithUTF8String:FIRCoreVersionString]]; - - NSDictionary *info = [[NSBundle mainBundle] infoDictionary]; - NSString *xcodeVersion = info[@"DTXcodeBuild"]; - NSString *sdkVersion = info[@"DTSDKBuild"]; - if (xcodeVersion) { - [FIRApp registerLibrary:@"xcode" withVersion:xcodeVersion]; - } - if (sdkVersion) { - [FIRApp registerLibrary:@"apple-sdk" withVersion:sdkVersion]; - } -} - + (NSDictionary *)defaultOptionsDictionary { - if (sDefaultOptionsDictionary != nil) { - return sDefaultOptionsDictionary; - } - NSString *plistFilePath = [FIROptions plistFilePathWithName:kServiceInfoFileName]; - if (plistFilePath == nil) { - return nil; - } - sDefaultOptionsDictionary = [NSDictionary dictionaryWithContentsOfFile:plistFilePath]; - if (sDefaultOptionsDictionary == nil) { - FIRLogError(kFIRLoggerCore, @"I-COR000011", - @"The configuration file is not a dictionary: " - @"'%@.%@'.", - kServiceInfoFileName, kServiceInfoFileType); - } + dispatch_once(&sDefaultOptionsDictionaryOnceToken, ^{ + NSString *plistFilePath = [FIROptions plistFilePathWithName:kServiceInfoFileName]; + if (plistFilePath == nil) { + return; + } + sDefaultOptionsDictionary = [NSDictionary dictionaryWithContentsOfFile:plistFilePath]; + if (sDefaultOptionsDictionary == nil) { + FIRLogError(kFIRLoggerCore, @"I-COR000011", + @"The configuration file is not a dictionary: " + @"'%@.%@'.", + kServiceInfoFileName, kServiceInfoFileType); + } + }); + return sDefaultOptionsDictionary; } @@ -161,6 +144,8 @@ + (NSString *)plistFilePathWithName:(NSString *)fileName { + (void)resetDefaultOptions { sDefaultOptions = nil; sDefaultOptionsDictionary = nil; + sDefaultOptionsOnceToken = 0; + sDefaultOptionsDictionaryOnceToken = 0; } #pragma mark - Private instance methods @@ -346,6 +331,59 @@ - (void)setAppGroupID:(NSString *)appGroupID { _appGroupID = [appGroupID copy]; } +#pragma mark - Equality + +- (BOOL)isEqual:(id)object { + if (!object || ![object isKindOfClass:[FIROptions class]]) { + return NO; + } + + return [self isEqualToOptions:(FIROptions *)object]; +} + +- (BOOL)isEqualToOptions:(FIROptions *)options { + // Skip any non-FIROptions classes. + if (![options isKindOfClass:[FIROptions class]]) { + return NO; + } + + // Check the internal dictionary and custom properties for differences. + if (![options.optionsDictionary isEqualToDictionary:self.optionsDictionary]) { + return NO; + } + + // Validate extra properties not contained in the dictionary. Only validate it if one of the + // objects has the property set. + if ((options.deepLinkURLScheme != nil || self.deepLinkURLScheme != nil) && + ![options.deepLinkURLScheme isEqualToString:self.deepLinkURLScheme]) { + return NO; + } + + if ((options.appGroupID != nil || self.appGroupID != nil) && + ![options.appGroupID isEqualToString:self.appGroupID]) { + return NO; + } + + // Validate the Analytics options haven't changed with the Info.plist. + if (![options.analyticsOptionsDictionary isEqualToDictionary:self.analyticsOptionsDictionary]) { + return NO; + } + + // We don't care about the `editingLocked` or `usingOptionsFromDefaultPlist` properties since + // those relate to lifecycle and construction, we only care if the contents of the options + // themselves are equal. + return YES; +} + +- (NSUInteger)hash { + // This is strongly recommended for any object that implements a custom `isEqual:` method to + // ensure that dictionary and set behavior matches other `isEqual:` checks. + // Note: `self.analyticsOptionsDictionary` was left out here since it solely relies on the + // contents of the main bundle's `Info.plist`. We should avoid reading that file and the contents + // should be identical. + return self.optionsDictionary.hash ^ self.deepLinkURLScheme.hash ^ self.appGroupID.hash; +} + #pragma mark - Internal instance methods - (NSDictionary *)analyticsOptionsDictionaryWithInfoDictionary:(NSDictionary *)infoDictionary { diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRVersion.h b/Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRVersion.h rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.h diff --git a/Pods/FirebaseCore/Firebase/Core/FIRVersion.m b/Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.m similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/FIRVersion.m rename to Pods/FirebaseCore/FirebaseCore/Sources/FIRVersion.m diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRAppInternal.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRAppInternal.h new file mode 100644 index 000000000..183a25c6d --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRAppInternal.h @@ -0,0 +1,168 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +// The has_include is a workaround so the old IID needed for the FIS tests can find FIRErrors.h +#if __has_include("FirebaseCore/Sources/Private/FIRErrors.h") +#import "FirebaseCore/Sources/Private/FIRErrors.h" +#else +#import +#endif + +@class FIRComponentContainer; +@protocol FIRLibrary; + +/** + * The internal interface to FIRApp. This is meant for first-party integrators, who need to receive + * FIRApp notifications, log info about the success or failure of their configuration, and access + * other internal functionality of FIRApp. + * + * TODO(b/28296561): Restructure this header. + */ +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, FIRConfigType) { + FIRConfigTypeCore = 1, + FIRConfigTypeSDK = 2, +}; + +extern NSString *const kFIRDefaultAppName; +extern NSString *const kFIRAppReadyToConfigureSDKNotification; +extern NSString *const kFIRAppDeleteNotification; +extern NSString *const kFIRAppIsDefaultAppKey; +extern NSString *const kFIRAppNameKey; +extern NSString *const kFIRGoogleAppIDKey; + +/** + * The format string for the User Defaults key used for storing the data collection enabled flag. + * This includes formatting to append the Firebase App's name. + */ +extern NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat; + +/** + * The plist key used for storing the data collection enabled flag. + */ +extern NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey; + +/** + * A notification fired containing diagnostic information when SDK errors occur. + */ +extern NSString *const kFIRAppDiagnosticsNotification; + +/** @var FIRAuthStateDidChangeInternalNotification + @brief The name of the @c NSNotificationCenter notification which is posted when the auth state + changes (e.g. a new token has been produced, a user logs in or out). The object parameter of + the notification is a dictionary possibly containing the key: + @c FIRAuthStateDidChangeInternalNotificationTokenKey (the new access token.) If it does not + contain this key it indicates a sign-out event took place. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotification; + +/** @var FIRAuthStateDidChangeInternalNotificationTokenKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the new access token. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey; + +/** @var FIRAuthStateDidChangeInternalNotificationAppKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the FIRApp associated with the auth instance. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationAppKey; + +/** @var FIRAuthStateDidChangeInternalNotificationUIDKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the new user's UID (or nil if there is no longer a user signed in). + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey; + +@interface FIRApp () + +/** + * A flag indicating if this is the default app (has the default app name). + */ +@property(nonatomic, readonly) BOOL isDefaultApp; + +/* + * The container of interop SDKs for this app. + */ +@property(nonatomic) FIRComponentContainer *container; + +/** + * Creates an error for failing to configure a subspec service. This method is called by each + * FIRApp notification listener. + */ ++ (NSError *)errorForSubspecConfigurationFailureWithDomain:(NSString *)domain + errorCode:(FIRErrorCode)code + service:(NSString *)service + reason:(NSString *)reason; +/** + * Checks if the default app is configured without trying to configure it. + */ ++ (BOOL)isDefaultAppConfigured; + +/** + * Registers a given third-party library with the given version number to be reported for + * analytics. + * + * @param name Name of the library. + * @param version Version of the library. + */ ++ (void)registerLibrary:(nonnull NSString *)name withVersion:(nonnull NSString *)version; + +/** + * Registers a given internal library with the given version number to be reported for + * analytics. + * + * @param library Optional parameter for component registration. + * @param name Name of the library. + * @param version Version of the library. + */ ++ (void)registerInternalLibrary:(nonnull Class)library + withName:(nonnull NSString *)name + withVersion:(nonnull NSString *)version; + +/** + * A concatenated string representing all the third-party libraries and version numbers. + */ ++ (NSString *)firebaseUserAgent; + +/** + * Used by each SDK to send logs about SDK configuration status to Clearcut. + * + * @note This API is a no-op, please remove calls to it. + */ +- (void)sendLogsWithServiceName:(NSString *)serviceName + version:(NSString *)version + error:(NSError *)error; + +/** + * Can be used by the unit tests in eack SDK to reset FIRApp. This method is thread unsafe. + */ ++ (void)resetApps; + +/** + * Can be used by the unit tests in each SDK to set customized options. + */ +- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRComponent.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponent.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRComponent.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponent.h diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentContainer.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentContainer.h new file mode 100644 index 000000000..db2bafef8 --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentContainer.h @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import + +// The has_include is a workaround so the old IID needed for the FIS tests can find the headers. +#if __has_include("FirebaseCore/Sources/Private/FIRComponentType.h") +#import "FirebaseCore/Sources/Private/FIRComponentType.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" +#else +#import +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/// A type-safe macro to retrieve a component from a container. This should be used to retrieve +/// components instead of using the container directly. +#define FIR_COMPONENT(type, container) \ + [FIRComponentType> instanceForProtocol:@protocol(type) inContainer:container] + +@class FIRApp; + +/// A container that holds different components that are registered via the +/// `registerAsComponentRegistrant:` call. These classes should conform to `FIRComponentRegistrant` +/// in order to properly register components for Core. +NS_SWIFT_NAME(FirebaseComponentContainer) +@interface FIRComponentContainer : NSObject + +/// A weak reference to the app that an instance of the container belongs to. +@property(nonatomic, weak, readonly) FIRApp *app; + +/// Unavailable. Use the `container` property on `FIRApp`. +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRComponentType.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentType.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRComponentType.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRComponentType.h diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRCoreDiagnosticsConnector.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRCoreDiagnosticsConnector.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRDependency.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRDependency.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRDependency.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRDependency.h diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRErrorCode.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRErrorCode.h new file mode 100644 index 000000000..c90d9eecf --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRErrorCode.h @@ -0,0 +1,39 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Error codes in Firebase error domain. */ +typedef NS_ENUM(NSInteger, FIRErrorCode) { + /** + * Unknown error. + */ + FIRErrorCodeUnknown = 0, + /** + * Loading data from the GoogleService-Info.plist file failed. This is a fatal error and should + * not be ignored. Further calls to the API will fail and/or possibly cause crashes. + */ + FIRErrorCodeInvalidPlistFile = -100, + + /** + * Validating the Google App ID format failed. + */ + FIRErrorCodeInvalidAppID = -101, + + /** + * Error code for failing to configure a specific service. It's deprecated, but + * still used after copybara. + */ + FIRErrorCodeConfigFailed = -114, +}; diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRErrors.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRErrors.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRErrors.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRErrors.h diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h new file mode 100644 index 000000000..bfff73e5d --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h @@ -0,0 +1,39 @@ +// Copyright 2019 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRHeartbeatInfo : NSObject + +// Enum representing the different heartbeat codes. +typedef NS_ENUM(NSInteger, FIRHeartbeatInfoCode) { + FIRHeartbeatInfoCodeNone = 0, + FIRHeartbeatInfoCodeSDK = 1, + FIRHeartbeatInfoCodeGlobal = 2, + FIRHeartbeatInfoCodeCombined = 3, +}; + +/** + * Get heartbeat code requred for the sdk. + * @param heartbeatTag String representing the sdk heartbeat tag. + * @return Heartbeat code indicating whether or not an sdk/global heartbeat + * needs to be sent + */ ++ (FIRHeartbeatInfoCode)heartbeatCodeForTag:(NSString *)heartbeatTag; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLibrary.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLibrary.h new file mode 100644 index 000000000..e7a9e077c --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLibrary.h @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRLibrary_h +#define FIRLibrary_h + +#import + +// The has_include is a workaround so the old IID needed for the FIS tests can find the headers. +#if __has_include("FirebaseCore/Sources/Private/FIRComponent.h") +#import "FirebaseCore/Sources/Private/FIRComponent.h" +#else +#import +#endif + +@class FIRApp; + +NS_ASSUME_NONNULL_BEGIN + +/// Provide an interface to register a library for userAgent logging and availability to others. +NS_SWIFT_NAME(Library) +@protocol FIRLibrary + +/// Returns one or more FIRComponents that will be registered in +/// FIRApp and participate in dependency resolution and injection. ++ (NSArray *)componentsToRegister; + +@optional +/// Implement this method if the library needs notifications for lifecycle events. This method is +/// called when the developer calls `FirebaseApp.configure()`. ++ (void)configureWithApp:(FIRApp *)app; + +@end + +NS_ASSUME_NONNULL_END + +#endif /* FIRLibrary_h */ diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIRLogger.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLogger.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIRLogger.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIRLogger.h diff --git a/Pods/FirebaseCore/Firebase/Core/Private/FIROptionsInternal.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FIROptionsInternal.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Private/FIROptionsInternal.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Private/FIROptionsInternal.h diff --git a/Pods/FirebaseCore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h new file mode 100644 index 000000000..2c18a7670 --- /dev/null +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An umbrella header, for any other libraries in this repo to access Firebase Public and Private +// headers. Any package manager complexity should be handled here. + +#import + +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRComponent.h" +#import "FirebaseCore/Sources/Private/FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRDependency.h" +#import "FirebaseCore/Sources/Private/FIRHeartbeatInfo.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" diff --git a/Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h similarity index 93% rename from Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h index e0dd6d692..f5578c6a0 100644 --- a/Pods/FirebaseCore/Firebase/Core/Public/FIRApp.h +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRApp.h @@ -47,15 +47,15 @@ NS_SWIFT_NAME(FirebaseApp) /** * Configures a default Firebase app. Raises an exception if any configuration step fails. The * default app is named "__FIRAPP_DEFAULT". This method should be called after the app is launched - * and before using Firebase services. This method is thread safe and contains synchronous file I/O - * (reading GoogleService-Info.plist from disk). + * and before using Firebase services. This method should be called from the main thread and + * contains synchronous file I/O (reading GoogleService-Info.plist from disk). */ + (void)configure; /** * Configures the default Firebase app with the provided options. The default app is named - * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method is thread - * safe. + * "__FIRAPP_DEFAULT". Raises an exception if any configuration step fails. This method should be + * called from the main thread. * * @param options The Firebase application options used to configure the service. */ @@ -63,7 +63,7 @@ NS_SWIFT_NAME(FirebaseApp) /** * Configures a Firebase app with the given name and options. Raises an exception if any - * configuration step fails. This method is thread safe. + * configuration step fails. This method should be called from the main thread. * * @param name The application's name given by the developer. The name should should only contain Letters, Numbers and Underscore. diff --git a/Pods/FirebaseCore/Firebase/Core/Public/FIRConfiguration.h b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h similarity index 97% rename from Pods/FirebaseCore/Firebase/Core/Public/FIRConfiguration.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h index 8de3b076a..2b8e678ce 100644 --- a/Pods/FirebaseCore/Firebase/Core/Public/FIRConfiguration.h +++ b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRConfiguration.h @@ -16,7 +16,7 @@ #import -#import +#import "FIRLoggerLevel.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Pods/FirebaseCore/Firebase/Core/Public/FIRLoggerLevel.h b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Public/FIRLoggerLevel.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIRLoggerLevel.h diff --git a/Pods/FirebaseCore/Firebase/Core/Public/FIROptions.h b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Public/FIROptions.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FIROptions.h diff --git a/Pods/FirebaseCore/Firebase/Core/Public/FirebaseCore.h b/Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h similarity index 100% rename from Pods/FirebaseCore/Firebase/Core/Public/FirebaseCore.h rename to Pods/FirebaseCore/FirebaseCore/Sources/Public/FirebaseCore/FirebaseCore.h diff --git a/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h new file mode 100644 index 000000000..2fb162261 --- /dev/null +++ b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h @@ -0,0 +1,47 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@interface GULAppEnvironmentUtil : NSObject + +/// Indicates whether the app is from Apple Store or not. Returns NO if the app is on simulator, +/// development environment or sideloaded. ++ (BOOL)isFromAppStore; + +/// Indicates whether the app is a Testflight app. Returns YES if the app has sandbox receipt. +/// Returns NO otherwise. ++ (BOOL)isAppStoreReceiptSandbox; + +/// Indicates whether the app is on simulator or not at runtime depending on the device +/// architecture. ++ (BOOL)isSimulator; + +/// The current device model. Returns an empty string if device model cannot be retrieved. ++ (NSString *)deviceModel; + +/// The current operating system version. Returns an empty string if the system version cannot be +/// retrieved. ++ (NSString *)systemVersion; + +/// Indicates whether it is running inside an extension or an app. ++ (BOOL)isAppExtension; + +/// @return Returns @YES when is run on iOS version greater or equal to 7.0 ++ (BOOL)isIOS7OrHigher DEPRECATED_MSG_ATTRIBUTE( + "Always `YES` because only iOS 8 and higher supported. The method will be removed."); + +@end diff --git a/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h new file mode 100644 index 000000000..9432dfc04 --- /dev/null +++ b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// Stores either a date or a dictionary to a specified file. +@interface GULHeartbeatDateStorage : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +@property(nonatomic, readonly) NSURL *fileURL; + +/** + * Default initializer. + * @param fileName The name of the file to store the date information. + * exist, it will be created if needed. + */ +- (instancetype)initWithFileName:(NSString *)fileName; + +/** + * Reads the date from the specified file for the given tag. + * @return Returns date if exists, otherwise `nil`. + */ +- (nullable NSDate *)heartbeatDateForTag:(NSString *)tag; + +/** + * Saves the date for the specified tag in the specified file. + * @return YES on success, NO otherwise. + */ +- (BOOL)setHearbeatDate:(NSDate *)date forTag:(NSString *)tag; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULKeychainStorage.h b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULKeychainStorage.h new file mode 100644 index 000000000..dc01a8368 --- /dev/null +++ b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULKeychainStorage.h @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBLPromise; + +NS_ASSUME_NONNULL_BEGIN + +/// The class provides a convenient abstraction on top of the iOS Keychain API to save data. +@interface GULKeychainStorage : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +/** Initializes the keychain storage with Keychain Service name. + * @param service A Keychain Service name that will be used to store and retrieve objects. See also + * `kSecAttrService`. + */ +- (instancetype)initWithService:(NSString *)service; + +/** + * Get an object by key. + * @param key The key. + * @param objectClass The expected object class required by `NSSecureCoding`. + * @param accessGroup The Keychain Access Group. + * + * @return Returns a promise. It is resolved with an object stored by key if exists. It is resolved + * with `nil` when the object not found. It fails on a Keychain error. + */ +- (FBLPromise> *)getObjectForKey:(NSString *)key + objectClass:(Class)objectClass + accessGroup:(nullable NSString *)accessGroup; + +/** + * Saves the given object by the given key. + * @param object The object to store. + * @param key The key to store the object. If there is an existing object by the key, it will be + * overridden. + * @param accessGroup The Keychain Access Group. + * + * @return Returns which is resolved with `[NSNull null]` on success. + */ +- (FBLPromise *)setObject:(id)object + forKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup; + +/** + * Removes the object by the given key. + * @param key The key to store the object. If there is an existing object by the key, it will be + * overridden. + * @param accessGroup The Keychain Access Group. + * + * @return Returns which is resolved with `[NSNull null]` on success. + */ +- (FBLPromise *)removeObjectForKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup; + +#if TARGET_OS_OSX +/// If not `nil`, then only this keychain will be used to save and read data (see +/// `kSecMatchSearchList` and `kSecUseKeychain`. It is mostly intended to be used by unit tests. +@property(nonatomic, nullable) SecKeychainRef keychainRef; +#endif // TARGET_OSX + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULKeychainUtils.h b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULKeychainUtils.h new file mode 100644 index 000000000..de4bef2fb --- /dev/null +++ b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULKeychainUtils.h @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +FOUNDATION_EXPORT NSString *const kGULKeychainUtilsErrorDomain; + +/// Helper functions to access Keychain. +@interface GULKeychainUtils : NSObject + +/** Fetches a keychain item data matching to the provided query. + * @param query A dictionary with Keychain query parameters. See docs for `SecItemCopyMatching` for + * details. + * @param outError A pointer to `NSError` instance or `NULL`. The instance at `outError` will be + * assigned with an error if there is. + * @returns Data for the first Keychain Item matching the provided query or `nil` if there is not + * such an item (`outError` will be `nil` in this case) or an error occurred. + */ ++ (nullable NSData *)getItemWithQuery:(NSDictionary *)query + error:(NSError *_Nullable *_Nullable)outError; + +/** Stores data to a Keychain Item matching to the provided query. An existing Keychain Item + * matching the query parameters will be updated or a new will be created. + * @param item A Keychain Item data to store. + * @param query A dictionary with Keychain query parameters. See docs for `SecItemAdd` and + * `SecItemUpdate` for details. + * @param outError A pointer to `NSError` instance or `NULL`. The instance at `outError` will be + * assigned with an error if there is. + * @returns `YES` when data was successfully stored, `NO` otherwise. + */ ++ (BOOL)setItem:(NSData *)item + withQuery:(NSDictionary *)query + error:(NSError *_Nullable *_Nullable)outError; + +/** Removes a Keychain Item matching to the provided query. + * @param query A dictionary with Keychain query parameters. See docs for `SecItemDelete` for + * details. + * @param outError A pointer to `NSError` instance or `NULL`. The instance at `outError` will be + * assigned with an error if there is. + * @returns `YES` if the item was removed successfully or doesn't exist, `NO` otherwise. + */ ++ (BOOL)removeItemWithQuery:(NSDictionary *)query error:(NSError *_Nullable *_Nullable)outError; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULSecureCoding.h b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULSecureCoding.h new file mode 100644 index 000000000..8484b3953 --- /dev/null +++ b/Pods/FirebaseCore/GoogleUtilities/Environment/Private/GULSecureCoding.h @@ -0,0 +1,36 @@ +// Copyright 2019 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** The class wraps `NSKeyedArchiver` and `NSKeyedUnarchiver` API to provide a unified secure coding + * methods for iOS versions before and after 11. + */ +@interface GULSecureCoding : NSObject + ++ (nullable id)unarchivedObjectOfClasses:(NSSet *)classes + fromData:(NSData *)data + error:(NSError **)outError; + ++ (nullable id)unarchivedObjectOfClass:(Class)class + fromData:(NSData *)data + error:(NSError **)outError; + ++ (nullable NSData *)archivedDataWithRootObject:(id)object error:(NSError **)outError; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h b/Pods/FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h new file mode 100644 index 000000000..1146ee238 --- /dev/null +++ b/Pods/FirebaseCore/GoogleUtilities/Logger/Private/GULLogger.h @@ -0,0 +1,163 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#if SWIFT_PACKAGE +@import GoogleUtilities_Logger; +#else +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + * The services used in the logger. + */ +typedef NSString *const GULLoggerService; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/** + * Initialize GULLogger. + */ +extern void GULLoggerInitializeASL(void); + +/** + * Override log level to Debug. + */ +void GULLoggerForceDebug(void); + +/** + * Turn on logging to STDERR. + */ +extern void GULLoggerEnableSTDERR(void); + +/** + * Changes the default logging level of GULLoggerLevelNotice to a user-specified level. + * The default level cannot be set above GULLoggerLevelNotice if the app is running from App Store. + * (required) log level (one of the GULLoggerLevel enum values). + */ +extern void GULSetLoggerLevel(GULLoggerLevel loggerLevel); + +/** + * Checks if the specified logger level is loggable given the current settings. + * (required) log level (one of the GULLoggerLevel enum values). + */ +extern BOOL GULIsLoggableLevel(GULLoggerLevel loggerLevel); + +/** + * Register version to include in logs. + * (required) version + */ +extern void GULLoggerRegisterVersion(const char *version); + +/** + * Logs a message to the Xcode console and the device log. If running from AppStore, will + * not log any messages with a level higher than GULLoggerLevelNotice to avoid log spamming. + * (required) log level (one of the GULLoggerLevel enum values). + * (required) service name of type GULLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ +extern void GULLogBasic(GULLoggerLevel level, + GULLoggerService service, + BOOL forceLog, + NSString *messageCode, + NSString *message, +// On 64-bit simulators, va_list is not a pointer, so cannot be marked nullable +// See: http://stackoverflow.com/q/29095469 +#if __LP64__ && TARGET_OS_SIMULATOR || TARGET_OS_OSX + va_list args_ptr +#else + va_list _Nullable args_ptr +#endif +); + +/** + * The following functions accept the following parameters in order: + * (required) service name of type GULLoggerService. + * (required) message code starting from "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * See go/firebase-log-proposal for details. + * (required) message string which can be a format string. + * (optional) the list of arguments to substitute into the format string. + * Example usage: + * GULLogError(kGULLoggerCore, @"I-COR000001", @"Configuration of %@ failed.", app.name); + */ +extern void GULLogError(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogWarning(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogNotice(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogInfo(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogDebug(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +@interface GULLoggerWrapper : NSObject + +/** + * Objective-C wrapper for GULLogBasic to allow weak linking to GULLogger + * (required) log level (one of the GULLoggerLevel enum values). + * (required) service name of type GULLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ + ++ (void)logWithLevel:(GULLoggerLevel)level + withService:(GULLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h b/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h new file mode 100644 index 000000000..69c40721a --- /dev/null +++ b/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** If present, is a BOOL wrapped in an NSNumber. */ +#define kFIRCDIsDataCollectionDefaultEnabledKey @"FIRCDIsDataCollectionDefaultEnabledKey" + +/** If present, is an int32_t wrapped in an NSNumber. */ +#define kFIRCDConfigurationTypeKey @"FIRCDConfigurationTypeKey" + +/** If present, is an NSString. */ +#define kFIRCDSdkNameKey @"FIRCDSdkNameKey" + +/** If present, is an NSString. */ +#define kFIRCDSdkVersionKey @"FIRCDSdkVersionKey" + +/** If present, is an int32_t wrapped in an NSNumber. */ +#define kFIRCDllAppsCountKey @"FIRCDllAppsCountKey" + +/** If present, is an NSString. */ +#define kFIRCDGoogleAppIDKey @"FIRCDGoogleAppIDKey" + +/** If present, is an NSString. */ +#define kFIRCDBundleIDKey @"FIRCDBundleID" + +/** If present, is a BOOL wrapped in an NSNumber. */ +#define kFIRCDUsingOptionsFromDefaultPlistKey @"FIRCDUsingOptionsFromDefaultPlistKey" + +/** If present, is an NSString. */ +#define kFIRCDLibraryVersionIDKey @"FIRCDLibraryVersionIDKey" + +/** If present, is an NSString. */ +#define kFIRCDFirebaseUserAgentKey @"FIRCDFirebaseUserAgentKey" + +/** Defines the interface of a data object needed to log diagnostics data. */ +@protocol FIRCoreDiagnosticsData + +@required + +/** A dictionary containing data (non-exhaustive) to be logged in diagnostics. */ +@property(nonatomic) NSDictionary *diagnosticObjects; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnosticsInterop/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h b/Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h similarity index 100% rename from Pods/FirebaseCoreDiagnosticsInterop/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h rename to Pods/FirebaseCore/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h diff --git a/Pods/FirebaseCore/LICENSE b/Pods/FirebaseCore/LICENSE index d64569567..fcce50661 100644 --- a/Pods/FirebaseCore/LICENSE +++ b/Pods/FirebaseCore/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 Firebase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Pods/FirebaseCore/README.md b/Pods/FirebaseCore/README.md index d0f46e02d..5850a1835 100644 --- a/Pods/FirebaseCore/README.md +++ b/Pods/FirebaseCore/README.md @@ -1,10 +1,31 @@ -# Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) - -This repository contains a subset of the Firebase iOS SDK source. It currently -includes FirebaseCore, FirebaseABTesting, FirebaseAuth, FirebaseDatabase, -FirebaseFirestore, FirebaseFunctions, FirebaseInstanceID, FirebaseInAppMessaging, -FirebaseInAppMessagingDisplay, FirebaseMessaging, FirebaseRemoteConfig, and -FirebaseStorage. +[![Version](https://img.shields.io/cocoapods/v/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) +[![License](https://img.shields.io/cocoapods/l/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) +[![Platform](https://img.shields.io/cocoapods/p/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) + +[![Actions Status][gh-abtesting-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-crashlytics-badge]][gh-actions] +[![Actions Status][gh-database-badge]][gh-actions] +[![Actions Status][gh-datatransport-badge]][gh-actions] +[![Actions Status][gh-dynamiclinks-badge]][gh-actions] +[![Actions Status][gh-firebasepod-badge]][gh-actions] +[![Actions Status][gh-firestore-badge]][gh-actions] +[![Actions Status][gh-functions-badge]][gh-actions] +[![Actions Status][gh-inappmessaging-badge]][gh-actions] +[![Actions Status][gh-interop-badge]][gh-actions] +[![Actions Status][gh-messaging-badge]][gh-actions] +[![Actions Status][gh-remoteconfig-badge]][gh-actions] +[![Actions Status][gh-storage-badge]][gh-actions] +[![Actions Status][gh-symbolcollision-badge]][gh-actions] +[![Actions Status][gh-zip-badge]][gh-actions] +[![Travis](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics, +FirebasePerformance, and FirebaseML. The repository also includes GoogleUtilities source. The [GoogleUtilities](GoogleUtilities/README.md) pod is @@ -16,8 +37,9 @@ monetize your app. More information about Firebase can be found at ## Installation -See the three subsections for details about three different installation methods. +See the subsections below for details about the different installation methods. 1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager (Beta)](SwiftPackageManager.md) 1. [Installing from the GitHub repo](README.md#installing-from-github) 1. [Experimental Carthage](README.md#carthage-ios-only) @@ -26,6 +48,11 @@ See the three subsections for details about three different installation methods Go to [https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup). +### Swift Package Manager (Beta) + +Instructions for the Beta of [Swift Package Manager](https://swift.org/package-manager/) +support can be found at [SwiftPackageManager.md](SwiftPackageManager.md). + ### Installing from GitHub For releases starting with 5.0.0, the source for each release is also deployed @@ -69,55 +96,69 @@ Instructions for the experimental Carthage distribution are at Instructions for installing binary frameworks via [Rome](https://github.com/CocoaPods/Rome) are at [Rome](Rome.md). +### Using Firebase from a Framework or a library + +[Using Firebase from a Framework or a library](docs/firebase_in_libraries.md) + ## Development To develop Firebase software in this repository, ensure that you have at least the following software: - * Xcode 10.1 (or later) + * Xcode 10.3 (or later) * CocoaPods 1.7.2 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) For the pod that you want to develop: -`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open` +`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open --platforms=ios` Note: If the CocoaPods cache is out of date, you may need to run `pod repo update` before the `pod gen` command. +Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for +those platforms. Since 10.2, Xcode does not properly handle multi-platform +CocoaPods workspaces. + Firestore has a self contained Xcode project. See [Firestore/README.md](Firestore/README.md). +### Development for Catalyst +* `pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios` +* Check the Mac box in the App-iOS Build Settings +* Sign the App in the Settings Signing & Capabilities tab +* Click Pods in the Project Manager +* Add Signing to the iOS host app and unit test targets +* Select the Unit-unit scheme +* Run it to build and test + ### Adding a New Firebase Pod See [AddNewPod.md](AddNewPod.md). +### Managing Headers and Imports + +See [HeadersImports.md](HeadersImports.md). + ### Code Formatting To ensure that the code is formatted consistently, run the script -[./scripts/style.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/style.sh) +[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) before creating a PR. -Travis will verify that any code changes are done in a style compliant way. Install -`clang-format` and `swiftformat`. -These commands will get the right versions: +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: ``` -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb +brew install clang-format +brew install mint ``` -Note: if you already have a newer version of these installed you may need to -`brew switch` to this version. - -To update this section, find the versions of clang-format and swiftformat.rb to -match the versions in the CI failure logs -[here](https://github.com/Homebrew/homebrew-core/tree/master/Formula). - ### Running Unit Tests Select a scheme and press Command-u to build a component and run its unit tests. -#### Viewing Code Coverage +#### Viewing Code Coverage (Deprecated) First, make sure that [xcov](https://github.com/nakiostudio/xcov) is installed with `gem install xcov`. @@ -135,12 +176,7 @@ files without real values, but can be replaced with real plist files. To get you 2. Create a new Firebase project, if you don't already have one 3. For each sample app you want to test, create a new Firebase app with the sample app's bundle identifier (e.g. `com.google.Database-Example`) -4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file -(e.g. in [Example/Database/App/](Example/Database/App/)); - -Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require -special Apple capabilities, and you will have to change the sample app to use a unique bundle -identifier that you can control in your own Apple Developer account. +4. Download the resulting `GoogleService-Info.plist` and add it to the Xcode project. ## Specific Component Instructions See the sections below for any special instructions for those components. @@ -148,18 +184,26 @@ See the sections below for any special instructions for those components. ### Firebase Auth If you're doing specific Firebase Auth development, see -[the Auth Sample README](Example/Auth/README.md) for instructions about +[the Auth Sample README](FirebaseAuth/Tests/Sample/README.md) for instructions about building and running the FirebaseAuth pod along with various samples and tests. ### Firebase Database -To run the Database Integration tests, make your database authentication rules -[public](https://firebase.google.com/docs/database/security/quickstart). +The Firebase Database Integration tests can be run against a locally running Database Emulator +or against a production instance. + +To run against a local emulator instance, invoke `./scripts/run_database_emulator.sh start` before +running the integration test. + +To run against a production instance, provide a valid GoogleServices-Info.plist and copy it to +`FirebaseDatabase/Tests/Resources/GoogleService-Info.plist`. Your Security Rule must be set to +[public](https://firebase.google.com/docs/database/security/quickstart) while your tests are +running. ### Firebase Storage To run the Storage Integration tests, follow the instructions in -[FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m). +[FIRStorageIntegrationTests.m](FirebaseStorage/Tests/Integration/FIRStorageIntegrationTests.m). #### Push Notifications @@ -185,35 +229,44 @@ We've seen an amazing amount of interest and contributions to improve the Fireba very grateful! We'd like to empower as many developers as we can to be able to use Firebase and participate in the Firebase community. -### macOS and tvOS -Thanks to contributions from the community, FirebaseABTesting, FirebaseAuth, FirebaseCore, -FirebaseDatabase, FirebaseMessaging, FirebaseFirestore, -FirebaseFunctions, FirebaseRemoteConfig, and FirebaseStorage now compile, run unit tests, and work on -macOS and tvOS. +### tvOS, macOS, watchOS and Catalyst +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and work on +tvOS, macOS, watchOS and Catalyst. For tvOS, checkout the [Sample](Example/tvOSSample). +For watchOS, currently only Messaging and Storage (and their dependencies) have limited support. Checkout the +[Independent Watch App Sample](Example/watchOSSample). -Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is -actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there -may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter -this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). +Keep in mind that macOS, tvOS, watchOS and Catalyst are not officially supported by Firebase, and this +repository is actively developed primarily for iOS. While we can catch basic unit test issues with +Travis, there may be some changes where the SDK no longer works as expected on macOS, tvOS or watchOS. If you +encounter this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). -Note that the Firebase pod is not available for macOS and tvOS. +During app setup in the console, you may get to a step that mentions something like "Checking if the app +has communicated with our servers". This relies on Analytics and will not work on macOS/tvOS/watchOS/Catalyst. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. To install, add a subset of the following to the Podfile: ``` -pod 'FirebaseABTesting' -pod 'FirebaseAuth' -pod 'FirebaseCore' -pod 'FirebaseDatabase' -pod 'FirebaseFirestore' -pod 'FirebaseFunctions' -pod 'FirebaseMessaging' -pod 'FirebaseRemoteConfig' -pod 'FirebaseStorage' +pod 'Firebase/ABTesting' # No watchOS support yet +pod 'Firebase/Auth' # Limited watchOS support +pod 'Firebase/Crashlytics' +pod 'Firebase/Database' # No watchOS support yet +pod 'Firebase/Firestore' # No watchOS support yet +pod 'Firebase/Functions' # No watchOS support yet +pod 'Firebase/Messaging' +pod 'Firebase/RemoteConfig' # No watchOS support yet +pod 'Firebase/Storage' ``` +#### Additional Catalyst Notes + +* FirebaseAuth and FirebaseMessaging require adding `Keychain Sharing Capability` +to Build Settings. +* FirebaseFirestore requires signing the +[gRPC Resource target](https://github.com/firebase/firebase-ios-sdk/issues/3500#issuecomment-518741681). + ## Roadmap See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source @@ -231,3 +284,23 @@ The contents of this repository is licensed under the Your use of Firebase is governed by the [Terms of Service for Firebase Services](https://firebase.google.com/terms/). + +[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions +[gh-abtesting-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/abtesting/badge.svg +[gh-appdistribution-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/appdistribution/badge.svg +[gh-auth-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/auth/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-crashlytics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/crashlytics/badge.svg +[gh-database-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/database/badge.svg +[gh-datatransport-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/datatransport/badge.svg +[gh-dynamiclinks-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/dynamiclinks/badge.svg +[gh-firebasepod-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/firebasepod/badge.svg +[gh-firestore-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/firestore/badge.svg +[gh-functions-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/functions/badge.svg +[gh-inappmessaging-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/inappmessaging/badge.svg +[gh-interop-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/interop/badge.svg +[gh-messaging-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/messaging/badge.svg +[gh-remoteconfig-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/remoteconfig/badge.svg +[gh-storage-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/storage/badge.svg +[gh-symbolcollision-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/symbolcollision/badge.svg +[gh-zip-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/zip/badge.svg diff --git a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m index dd6a51b75..6b072f74f 100644 --- a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m +++ b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnostics.m @@ -17,24 +17,20 @@ #import #include -#import -#import -#import -#import +#import "GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h" -#import -#import +#import "GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h" +#import "GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h" +#import "GoogleUtilities/Logger/Private/GULLogger.h" -#import -#import +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h" +#import "Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h" #import #import #import -#import "FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h" - -#import "FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.h" +#import "Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h" /** The logger service string to use when printing to the console. */ static GULLoggerService kFIRCoreDiagnostics = @"[FirebaseCoreDiagnostics/FIRCoreDiagnostics]"; @@ -45,7 +41,9 @@ static BOOL kUsingZipFile = NO; #endif // FIREBASE_BUILD_ZIP_FILE -#ifdef FIREBASE_BUILD_CARTHAGE +#if SWIFT_PACKAGE +#define kDeploymentType logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_SPM +#elif FIREBASE_BUILD_CARTHAGE #define kDeploymentType logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_CARTHAGE #elif FIREBASE_BUILD_ZIP_FILE #define kDeploymentType logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_ZIP_FILE @@ -53,13 +51,6 @@ #define kDeploymentType logs_proto_mobilesdk_ios_ICoreConfiguration_DeploymentType_COCOAPODS #endif -static NSString *const kFIRServiceMLVisionOnDeviceAutoML = @"MLVisionOnDeviceAutoML"; -static NSString *const kFIRServiceMLVisionOnDeviceFace = @"MLVisionOnDeviceFace"; -static NSString *const kFIRServiceMLVisionOnDeviceBarcode = @"MLVisionOnDeviceBarcode"; -static NSString *const kFIRServiceMLVisionOnDeviceText = @"MLVisionOnDeviceText"; -static NSString *const kFIRServiceMLVisionOnDeviceLabel = @"MLVisionOnDeviceLabel"; -static NSString *const kFIRServiceMLVisionOnDeviceObjectDetection = - @"MLVisionOnDeviceObjectDetection"; static NSString *const kFIRServiceMLModelInterpreter = @"MLModelInterpreter"; static NSString *const kFIRServiceAdMob = @"AdMob"; @@ -85,6 +76,7 @@ static NSString *const kFIRAppDiagnosticsFIRAppKey = @"FIRAppDiagnosticsFIRAppKey"; static NSString *const kFIRAppDiagnosticsSDKNameKey = @"FIRAppDiagnosticsSDKNameKey"; static NSString *const kFIRAppDiagnosticsSDKVersionKey = @"FIRAppDiagnosticsSDKVersionKey"; +static NSString *const kFIRCoreDiagnosticsHeartbeatTag = @"FIRCoreDiagnostics"; /** * The file name to the recent heartbeat date. @@ -125,6 +117,7 @@ - (NSData *)transportBytes { // Encode a 2nd time to actually get the bytes from it. size_t bufferSize = sizestream.bytes_written; CFMutableDataRef dataRef = CFDataCreateMutable(CFAllocatorGetDefault(), bufferSize); + CFDataSetLength(dataRef, bufferSize); pb_ostream_t ostream = pb_ostream_from_buffer((void *)CFDataGetBytePtr(dataRef), bufferSize); if (!pb_encode(&ostream, logs_proto_mobilesdk_ios_ICoreConfiguration_fields, &_config)) { GDTCORLogError(GDTCORMCETransportBytesError, @"Error in nanopb encoding for bytes: %s", @@ -153,7 +146,7 @@ @interface FIRCoreDiagnostics : NSObject @property(nonatomic, readonly) GDTCORTransport *transport; /** The storage to store the date of the last sent heartbeat. */ -@property(nonatomic, readonly) FIRCoreDiagnosticsDateFileStorage *heartbeatDateStorage; +@property(nonatomic, readonly) GULHeartbeatDateStorage *heartbeatDateStorage; @end @@ -173,10 +166,10 @@ + (instancetype)sharedInstance { - (instancetype)init { GDTCORTransport *transport = [[GDTCORTransport alloc] initWithMappingID:@"137" transformers:nil - target:kGDTCORTargetCCT]; + target:kGDTCORTargetFLL]; - FIRCoreDiagnosticsDateFileStorage *dateStorage = [[FIRCoreDiagnosticsDateFileStorage alloc] - initWithFileURL:[[self class] filePathURLWithName:kFIRCoreDiagnosticsHeartbeatDateFileName]]; + GULHeartbeatDateStorage *dateStorage = + [[GULHeartbeatDateStorage alloc] initWithFileName:kFIRCoreDiagnosticsHeartbeatDateFileName]; return [self initWithTransport:transport heartbeatDateStorage:dateStorage]; } @@ -188,7 +181,7 @@ - (instancetype)init { * @return Returns the initialized `FIRCoreDiagnostics` instance. */ - (instancetype)initWithTransport:(GDTCORTransport *)transport - heartbeatDateStorage:(FIRCoreDiagnosticsDateFileStorage *)heartbeatDateStorage { + heartbeatDateStorage:(GULHeartbeatDateStorage *)heartbeatDateStorage { self = [super init]; if (self) { _diagnosticsQueue = @@ -199,37 +192,6 @@ - (instancetype)initWithTransport:(GDTCORTransport *)transport return self; } -#pragma mark - File path helpers - -/** Returns the URL path of the file with name fileName under the Application Support folder for - * local logging. Creates the Application Support folder if the folder doesn't exist. - * - * @return the URL path of the file with the name fileName in Application Support. - */ -+ (NSURL *)filePathURLWithName:(NSString *)fileName { - @synchronized(self) { - NSArray *paths = - NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); - NSArray *components = @[ paths.lastObject, @"Google/FIRApp" ]; - NSString *directoryString = [NSString pathWithComponents:components]; - NSURL *directoryURL = [NSURL fileURLWithPath:directoryString]; - - NSError *error; - if (![directoryURL checkResourceIsReachableAndReturnError:&error]) { - // If fail creating the Application Support directory, return nil. - if (![[NSFileManager defaultManager] createDirectoryAtURL:directoryURL - withIntermediateDirectories:YES - attributes:nil - error:&error]) { - GULLogWarning(kFIRCoreDiagnostics, YES, @"I-COR100001", - @"Unable to create internal state storage: %@", error); - return nil; - } - } - return [directoryURL URLByAppendingPathComponent:fileName]; - } -} - #pragma mark - Metadata helpers /** Returns the model of iOS device. Sample platform strings are @"iPhone7,1" for iPhone 6 Plus, @@ -250,7 +212,7 @@ + (NSString *)deviceModel { #pragma mark - nanopb helper functions -/** Mallocs a pb_bytes_array and copies the given NSString's bytes into the bytes array. +/** Callocs a pb_bytes_array and copies the given NSString's bytes into the bytes array. * * @note Memory needs to be free manually, through pb_free or pb_release. * @param string The string to encode as pb_bytes. @@ -260,16 +222,18 @@ + (NSString *)deviceModel { return FIREncodeData(stringBytes); } -/** Mallocs a pb_bytes_array and copies the given NSData bytes into the bytes array. +/** Callocs a pb_bytes_array and copies the given NSData bytes into the bytes array. * * @note Memory needs to be free manually, through pb_free or pb_release. * @param data The data to copy into the new bytes array. */ pb_bytes_array_t *FIREncodeData(NSData *data) { - pb_bytes_array_t *pbBytes = malloc(PB_BYTES_ARRAY_T_ALLOCSIZE(data.length)); - memcpy(pbBytes->bytes, [data bytes], data.length); - pbBytes->size = (pb_size_t)data.length; - return pbBytes; + pb_bytes_array_t *pbBytesArray = calloc(1, PB_BYTES_ARRAY_T_ALLOCSIZE(data.length)); + if (pbBytesArray != NULL) { + [data getBytes:pbBytesArray->bytes length:data.length]; + pbBytesArray->size = (pb_size_t)data.length; + } + return pbBytesArray; } /** Maps a service string to the representative nanopb enum. @@ -298,18 +262,6 @@ logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType FIRMapFromServiceStringT kFIRServicePerformance : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_PERFORMANCE), kFIRServiceStorage : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_STORAGE), - kFIRServiceMLVisionOnDeviceAutoML : - @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_AUTOML), - kFIRServiceMLVisionOnDeviceFace : - @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_FACE), - kFIRServiceMLVisionOnDeviceBarcode : - @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_BARCODE), - kFIRServiceMLVisionOnDeviceText : - @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_TEXT), - kFIRServiceMLVisionOnDeviceLabel : - @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_LABEL), - kFIRServiceMLVisionOnDeviceObjectDetection : @( - logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_VISION_ON_DEVICE_OBJECT_DETECTION), kFIRServiceMLModelInterpreter : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ML_MODEL_INTERPRETER), kGGLServiceAnalytics : @(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ANALYTICS), @@ -450,40 +402,6 @@ void FIRPopulateProtoWithInstalledServices(logs_proto_mobilesdk_ios_ICoreConfigu [sdkServiceInstalledArray addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMeasurement))]; } - // ML Vision On Device AutoML. - if (NSClassFromString(@"FIRVisionOnDeviceAutoMLImageLabelerOptions") != nil) { - [sdkServiceInstalledArray - addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLVisionOnDeviceAutoML))]; - } - // ML Vision On Device Face. - if (NSClassFromString(@"FIRVisionFaceDetector") != nil && - NSClassFromString(@"GMVFaceDetector") != nil) { - [sdkServiceInstalledArray - addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLVisionOnDeviceFace))]; - } - // ML Vision On Device Barcode. - if (NSClassFromString(@"FIRVisionBarcodeDetector") != nil && - NSClassFromString(@"GMVBarcodeDetector") != nil) { - [sdkServiceInstalledArray - addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLVisionOnDeviceBarcode))]; - } - // ML Vision On Device Text. - if (NSClassFromString(@"FIRVisionTextDetector") != nil && - NSClassFromString(@"GMVTextDetector") != nil) { - [sdkServiceInstalledArray - addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLVisionOnDeviceText))]; - } - // ML Vision On Device Image Label. - if (NSClassFromString(@"FIRVisionLabelDetector") != nil && - NSClassFromString(@"GMVLabelDetector") != nil) { - [sdkServiceInstalledArray - addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLVisionOnDeviceLabel))]; - } - // ML Vision On Device Object. - if (NSClassFromString(@"FIRVisionObjectDetector") != nil) { - [sdkServiceInstalledArray - addObject:@(FIRMapFromServiceStringToTypeEnum(kFIRServiceMLVisionOnDeviceObjectDetection))]; - } // ML Model Interpreter if (NSClassFromString(@"FIRCustomModelInterpreter") != nil) { [sdkServiceInstalledArray @@ -538,8 +456,11 @@ void FIRPopulateProtoWithInstalledServices(logs_proto_mobilesdk_ios_ICoreConfigu } logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType *servicesInstalled = - malloc(sizeof(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType) * - sdkServiceInstalledArray.count); + calloc(sdkServiceInstalledArray.count, + sizeof(logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType)); + if (servicesInstalled == NULL) { + return; + } for (NSUInteger i = 0; i < sdkServiceInstalledArray.count; i++) { NSNumber *typeEnum = sdkServiceInstalledArray[i]; logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType serviceType = @@ -648,7 +569,8 @@ - (void)sendDiagnosticsData:(nonnull id)diagnosticsData - (void)setHeartbeatFlagIfNeededToConfig:(logs_proto_mobilesdk_ios_ICoreConfiguration *)config { // Check if need to send a heartbeat. NSDate *currentDate = [NSDate date]; - NSDate *lastCheckin = [self.heartbeatDateStorage date]; + NSDate *lastCheckin = + [self.heartbeatDateStorage heartbeatDateForTag:kFIRCoreDiagnosticsHeartbeatTag]; if (lastCheckin) { // Ensure the previous checkin was on a different date in the past. if ([self isDate:currentDate inSameDayOrBeforeThan:lastCheckin]) { @@ -657,12 +579,7 @@ - (void)setHeartbeatFlagIfNeededToConfig:(logs_proto_mobilesdk_ios_ICoreConfigur } // Update heartbeat sent date. - NSError *error; - if (![self.heartbeatDateStorage setDate:currentDate error:&error]) { - GULLogError(kFIRCoreDiagnostics, NO, @"I-COR100004", @"Unable to persist internal state: %@", - error); - } - + [self.heartbeatDateStorage setHearbeatDate:currentDate forTag:kFIRCoreDiagnosticsHeartbeatTag]; // Set the flag. config->sdk_name = logs_proto_mobilesdk_ios_ICoreConfiguration_ServiceType_ICORE; config->has_sdk_name = 1; diff --git a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.h b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.h deleted file mode 100644 index 93e406a4d..000000000 --- a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/// Stores a date to a specified file. -@interface FIRCoreDiagnosticsDateFileStorage : NSObject - -- (instancetype)init NS_UNAVAILABLE; - -/** - * Default initializer. - * @param fileURL The URL of the file to store the date. The directory must exist, the file may not - * exist, it will be created if needed. - */ -- (instancetype)initWithFileURL:(NSURL *)fileURL; - -/** - * Saves the date to the specified file. - * @return YES on success, NO otherwise. - */ -- (BOOL)setDate:(nullable NSDate *)date error:(NSError **)outError; - -/** - * Reads the date to the specified file. - * @return Returns date if exists, otherwise `nil`. - */ -- (nullable NSDate *)date; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.m b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.m deleted file mode 100644 index f4dca12a7..000000000 --- a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.m +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "FIRCDLibrary/FIRCoreDiagnosticsDateFileStorage.h" - -@interface FIRCoreDiagnosticsDateFileStorage () -@property(nonatomic, readonly) NSURL *fileURL; -@end - -@implementation FIRCoreDiagnosticsDateFileStorage - -- (instancetype)initWithFileURL:(NSURL *)fileURL { - if (fileURL == nil) { - return nil; - } - - self = [super init]; - if (self) { - _fileURL = fileURL; - } - - return self; -} - -- (BOOL)setDate:(nullable NSDate *)date error:(NSError **)outError { - NSString *stringToSave = @""; - - if (date != nil) { - NSTimeInterval timestamp = [date timeIntervalSinceReferenceDate]; - stringToSave = [NSString stringWithFormat:@"%f", timestamp]; - } - - return [stringToSave writeToURL:self.fileURL - atomically:YES - encoding:NSUTF8StringEncoding - error:outError]; -} - -- (nullable NSDate *)date { - NSString *timestampString = [NSString stringWithContentsOfURL:self.fileURL - encoding:NSUTF8StringEncoding - error:nil]; - if (timestampString.length == 0) { - return nil; - } - - NSTimeInterval timestamp = timestampString.doubleValue; - return [NSDate dateWithTimeIntervalSinceReferenceDate:timestamp]; -} - -@end diff --git a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c index 3e01479cc..d989f5614 100644 --- a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c +++ b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.c @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "firebasecore.nanopb.h" diff --git a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h index 7083052eb..0c5beecd4 100644 --- a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h +++ b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Protogen/nanopb/firebasecore.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_LOGS_PROTO_MOBILESDK_IOS_FIREBASECORE_NANOPB_H_INCLUDED #define PB_LOGS_PROTO_MOBILESDK_IOS_FIREBASECORE_NANOPB_H_INCLUDED diff --git a/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnistics.h b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnistics.h new file mode 100644 index 000000000..5076d6b43 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/Firebase/CoreDiagnostics/FIRCDLibrary/Public/FIRCoreDiagnistics.h @@ -0,0 +1,18 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// There are no actual public headers in the lib. This is a dummy public header to prevent Cocoapods +// from adding all internal headers as public. diff --git a/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h b/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h new file mode 100644 index 000000000..069093dc0 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GDTCORDirectorySizeTracker.h @@ -0,0 +1,66 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "GoogleDataTransport/GDTCORLibrary/Public/GoogleDataTransport/GDTCORStorageProtocol.h" + +NS_ASSUME_NONNULL_BEGIN + +/** The class calculates and caches the specified directory content size and uses add/remove signals + * from client the client to keep the size up to date without accessing file system. + * This is an internal class designed to be used by `GDTCORFlatFileStorage`. + * NOTE: The class is not thread-safe. The client must take care of synchronization. + */ +@interface GDTCORDirectorySizeTracker : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +/** Initializes the object with a directory path. + * @param path The directory path to track content size. + */ +- (instancetype)initWithDirectoryPath:(NSString *)path; + +/** Returns a cached or calculates (if there is no cached) directory content size. + * @return The directory content size in bytes calculated based on `NSURLFileSizeKey`. + */ +- (GDTCORStorageSizeBytes)directoryContentSize; + +/** The client must call this method or `resetCachedSize` method each time a file or directory is + * added to the tracked directory. + * @param path The path to the added file. If the path is outside the tracked directory then the + * @param fileSize The size of the added file. + * method is no-op. + */ +- (void)fileWasAddedAtPath:(NSString *)path withSize:(GDTCORStorageSizeBytes)fileSize; + +/** The client must call this method or `resetCachedSize` method each time a file or directory is + * removed from the tracked directory. + * @param path The path to the removed file. If the path is outside the tracked directory then the + * @param fileSize The size of the removed file. + * method is no-op. + */ +- (void)fileWasRemovedAtPath:(NSString *)path withSize:(GDTCORStorageSizeBytes)fileSize; + +/** Invalidates cached directory size. */ +- (void)resetCachedSize; + +/** Returns URL resource value for `NSURLFileSizeKey` key for the specified URL. */ +- (GDTCORStorageSizeBytes)fileSizeAtURL:(NSURL *)fileURL; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h b/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h new file mode 100644 index 000000000..a002e5cd5 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleDataTransport/GDTCORLibrary/Internal/GoogleDataTransportInternal.h @@ -0,0 +1,18 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An umbrella header, for any other libraries in this repo to access Firebase Public and Private +// headers. Any package manager complexity should be handled here. + +#import diff --git a/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h new file mode 100644 index 000000000..2fb162261 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULAppEnvironmentUtil.h @@ -0,0 +1,47 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@interface GULAppEnvironmentUtil : NSObject + +/// Indicates whether the app is from Apple Store or not. Returns NO if the app is on simulator, +/// development environment or sideloaded. ++ (BOOL)isFromAppStore; + +/// Indicates whether the app is a Testflight app. Returns YES if the app has sandbox receipt. +/// Returns NO otherwise. ++ (BOOL)isAppStoreReceiptSandbox; + +/// Indicates whether the app is on simulator or not at runtime depending on the device +/// architecture. ++ (BOOL)isSimulator; + +/// The current device model. Returns an empty string if device model cannot be retrieved. ++ (NSString *)deviceModel; + +/// The current operating system version. Returns an empty string if the system version cannot be +/// retrieved. ++ (NSString *)systemVersion; + +/// Indicates whether it is running inside an extension or an app. ++ (BOOL)isAppExtension; + +/// @return Returns @YES when is run on iOS version greater or equal to 7.0 ++ (BOOL)isIOS7OrHigher DEPRECATED_MSG_ATTRIBUTE( + "Always `YES` because only iOS 8 and higher supported. The method will be removed."); + +@end diff --git a/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h new file mode 100644 index 000000000..9432dfc04 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULHeartbeatDateStorage.h @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// Stores either a date or a dictionary to a specified file. +@interface GULHeartbeatDateStorage : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +@property(nonatomic, readonly) NSURL *fileURL; + +/** + * Default initializer. + * @param fileName The name of the file to store the date information. + * exist, it will be created if needed. + */ +- (instancetype)initWithFileName:(NSString *)fileName; + +/** + * Reads the date from the specified file for the given tag. + * @return Returns date if exists, otherwise `nil`. + */ +- (nullable NSDate *)heartbeatDateForTag:(NSString *)tag; + +/** + * Saves the date for the specified tag in the specified file. + * @return YES on success, NO otherwise. + */ +- (BOOL)setHearbeatDate:(NSDate *)date forTag:(NSString *)tag; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULKeychainStorage.h b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULKeychainStorage.h new file mode 100644 index 000000000..dc01a8368 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULKeychainStorage.h @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FBLPromise; + +NS_ASSUME_NONNULL_BEGIN + +/// The class provides a convenient abstraction on top of the iOS Keychain API to save data. +@interface GULKeychainStorage : NSObject + +- (instancetype)init NS_UNAVAILABLE; + +/** Initializes the keychain storage with Keychain Service name. + * @param service A Keychain Service name that will be used to store and retrieve objects. See also + * `kSecAttrService`. + */ +- (instancetype)initWithService:(NSString *)service; + +/** + * Get an object by key. + * @param key The key. + * @param objectClass The expected object class required by `NSSecureCoding`. + * @param accessGroup The Keychain Access Group. + * + * @return Returns a promise. It is resolved with an object stored by key if exists. It is resolved + * with `nil` when the object not found. It fails on a Keychain error. + */ +- (FBLPromise> *)getObjectForKey:(NSString *)key + objectClass:(Class)objectClass + accessGroup:(nullable NSString *)accessGroup; + +/** + * Saves the given object by the given key. + * @param object The object to store. + * @param key The key to store the object. If there is an existing object by the key, it will be + * overridden. + * @param accessGroup The Keychain Access Group. + * + * @return Returns which is resolved with `[NSNull null]` on success. + */ +- (FBLPromise *)setObject:(id)object + forKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup; + +/** + * Removes the object by the given key. + * @param key The key to store the object. If there is an existing object by the key, it will be + * overridden. + * @param accessGroup The Keychain Access Group. + * + * @return Returns which is resolved with `[NSNull null]` on success. + */ +- (FBLPromise *)removeObjectForKey:(NSString *)key + accessGroup:(nullable NSString *)accessGroup; + +#if TARGET_OS_OSX +/// If not `nil`, then only this keychain will be used to save and read data (see +/// `kSecMatchSearchList` and `kSecUseKeychain`. It is mostly intended to be used by unit tests. +@property(nonatomic, nullable) SecKeychainRef keychainRef; +#endif // TARGET_OSX + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULKeychainUtils.h b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULKeychainUtils.h new file mode 100644 index 000000000..de4bef2fb --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULKeychainUtils.h @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +FOUNDATION_EXPORT NSString *const kGULKeychainUtilsErrorDomain; + +/// Helper functions to access Keychain. +@interface GULKeychainUtils : NSObject + +/** Fetches a keychain item data matching to the provided query. + * @param query A dictionary with Keychain query parameters. See docs for `SecItemCopyMatching` for + * details. + * @param outError A pointer to `NSError` instance or `NULL`. The instance at `outError` will be + * assigned with an error if there is. + * @returns Data for the first Keychain Item matching the provided query or `nil` if there is not + * such an item (`outError` will be `nil` in this case) or an error occurred. + */ ++ (nullable NSData *)getItemWithQuery:(NSDictionary *)query + error:(NSError *_Nullable *_Nullable)outError; + +/** Stores data to a Keychain Item matching to the provided query. An existing Keychain Item + * matching the query parameters will be updated or a new will be created. + * @param item A Keychain Item data to store. + * @param query A dictionary with Keychain query parameters. See docs for `SecItemAdd` and + * `SecItemUpdate` for details. + * @param outError A pointer to `NSError` instance or `NULL`. The instance at `outError` will be + * assigned with an error if there is. + * @returns `YES` when data was successfully stored, `NO` otherwise. + */ ++ (BOOL)setItem:(NSData *)item + withQuery:(NSDictionary *)query + error:(NSError *_Nullable *_Nullable)outError; + +/** Removes a Keychain Item matching to the provided query. + * @param query A dictionary with Keychain query parameters. See docs for `SecItemDelete` for + * details. + * @param outError A pointer to `NSError` instance or `NULL`. The instance at `outError` will be + * assigned with an error if there is. + * @returns `YES` if the item was removed successfully or doesn't exist, `NO` otherwise. + */ ++ (BOOL)removeItemWithQuery:(NSDictionary *)query error:(NSError *_Nullable *_Nullable)outError; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULSecureCoding.h b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULSecureCoding.h new file mode 100644 index 000000000..8484b3953 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Environment/Private/GULSecureCoding.h @@ -0,0 +1,36 @@ +// Copyright 2019 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** The class wraps `NSKeyedArchiver` and `NSKeyedUnarchiver` API to provide a unified secure coding + * methods for iOS versions before and after 11. + */ +@interface GULSecureCoding : NSObject + ++ (nullable id)unarchivedObjectOfClasses:(NSSet *)classes + fromData:(NSData *)data + error:(NSError **)outError; + ++ (nullable id)unarchivedObjectOfClass:(Class)class + fromData:(NSData *)data + error:(NSError **)outError; + ++ (nullable NSData *)archivedDataWithRootObject:(id)object error:(NSError **)outError; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h new file mode 100644 index 000000000..1146ee238 --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/GoogleUtilities/Logger/Private/GULLogger.h @@ -0,0 +1,163 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#if SWIFT_PACKAGE +@import GoogleUtilities_Logger; +#else +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/** + * The services used in the logger. + */ +typedef NSString *const GULLoggerService; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/** + * Initialize GULLogger. + */ +extern void GULLoggerInitializeASL(void); + +/** + * Override log level to Debug. + */ +void GULLoggerForceDebug(void); + +/** + * Turn on logging to STDERR. + */ +extern void GULLoggerEnableSTDERR(void); + +/** + * Changes the default logging level of GULLoggerLevelNotice to a user-specified level. + * The default level cannot be set above GULLoggerLevelNotice if the app is running from App Store. + * (required) log level (one of the GULLoggerLevel enum values). + */ +extern void GULSetLoggerLevel(GULLoggerLevel loggerLevel); + +/** + * Checks if the specified logger level is loggable given the current settings. + * (required) log level (one of the GULLoggerLevel enum values). + */ +extern BOOL GULIsLoggableLevel(GULLoggerLevel loggerLevel); + +/** + * Register version to include in logs. + * (required) version + */ +extern void GULLoggerRegisterVersion(const char *version); + +/** + * Logs a message to the Xcode console and the device log. If running from AppStore, will + * not log any messages with a level higher than GULLoggerLevelNotice to avoid log spamming. + * (required) log level (one of the GULLoggerLevel enum values). + * (required) service name of type GULLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ +extern void GULLogBasic(GULLoggerLevel level, + GULLoggerService service, + BOOL forceLog, + NSString *messageCode, + NSString *message, +// On 64-bit simulators, va_list is not a pointer, so cannot be marked nullable +// See: http://stackoverflow.com/q/29095469 +#if __LP64__ && TARGET_OS_SIMULATOR || TARGET_OS_OSX + va_list args_ptr +#else + va_list _Nullable args_ptr +#endif +); + +/** + * The following functions accept the following parameters in order: + * (required) service name of type GULLoggerService. + * (required) message code starting from "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * See go/firebase-log-proposal for details. + * (required) message string which can be a format string. + * (optional) the list of arguments to substitute into the format string. + * Example usage: + * GULLogError(kGULLoggerCore, @"I-COR000001", @"Configuration of %@ failed.", app.name); + */ +extern void GULLogError(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogWarning(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogNotice(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogInfo(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); +extern void GULLogDebug(GULLoggerService service, + BOOL force, + NSString *messageCode, + NSString *message, + ...) NS_FORMAT_FUNCTION(4, 5); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +@interface GULLoggerWrapper : NSObject + +/** + * Objective-C wrapper for GULLogBasic to allow weak linking to GULLogger + * (required) log level (one of the GULLoggerLevel enum values). + * (required) service name of type GULLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ + ++ (void)logWithLevel:(GULLoggerLevel)level + withService:(GULLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h b/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h new file mode 100644 index 000000000..69c40721a --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** If present, is a BOOL wrapped in an NSNumber. */ +#define kFIRCDIsDataCollectionDefaultEnabledKey @"FIRCDIsDataCollectionDefaultEnabledKey" + +/** If present, is an int32_t wrapped in an NSNumber. */ +#define kFIRCDConfigurationTypeKey @"FIRCDConfigurationTypeKey" + +/** If present, is an NSString. */ +#define kFIRCDSdkNameKey @"FIRCDSdkNameKey" + +/** If present, is an NSString. */ +#define kFIRCDSdkVersionKey @"FIRCDSdkVersionKey" + +/** If present, is an int32_t wrapped in an NSNumber. */ +#define kFIRCDllAppsCountKey @"FIRCDllAppsCountKey" + +/** If present, is an NSString. */ +#define kFIRCDGoogleAppIDKey @"FIRCDGoogleAppIDKey" + +/** If present, is an NSString. */ +#define kFIRCDBundleIDKey @"FIRCDBundleID" + +/** If present, is a BOOL wrapped in an NSNumber. */ +#define kFIRCDUsingOptionsFromDefaultPlistKey @"FIRCDUsingOptionsFromDefaultPlistKey" + +/** If present, is an NSString. */ +#define kFIRCDLibraryVersionIDKey @"FIRCDLibraryVersionIDKey" + +/** If present, is an NSString. */ +#define kFIRCDFirebaseUserAgentKey @"FIRCDFirebaseUserAgentKey" + +/** Defines the interface of a data object needed to log diagnostics data. */ +@protocol FIRCoreDiagnosticsData + +@required + +/** A dictionary containing data (non-exhaustive) to be logged in diagnostics. */ +@property(nonatomic) NSDictionary *diagnosticObjects; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h b/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h new file mode 100644 index 000000000..2b0eb710c --- /dev/null +++ b/Pods/FirebaseCoreDiagnostics/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsInterop.h @@ -0,0 +1,34 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRCoreDiagnosticsData.h" + +NS_ASSUME_NONNULL_BEGIN + +/** Allows the interoperation of FirebaseCore and FirebaseCoreDiagnostics. */ +@protocol FIRCoreDiagnosticsInterop + +/** Sends the given diagnostics data. + * + * @param diagnosticsData The diagnostics data object to send. + */ ++ (void)sendDiagnosticsData:(id)diagnosticsData; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnostics/LICENSE b/Pods/FirebaseCoreDiagnostics/LICENSE index d64569567..fcce50661 100644 --- a/Pods/FirebaseCoreDiagnostics/LICENSE +++ b/Pods/FirebaseCoreDiagnostics/LICENSE @@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 Firebase, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/Pods/FirebaseCoreDiagnostics/README.md b/Pods/FirebaseCoreDiagnostics/README.md index f55d64218..5850a1835 100644 --- a/Pods/FirebaseCoreDiagnostics/README.md +++ b/Pods/FirebaseCoreDiagnostics/README.md @@ -1,10 +1,31 @@ -# Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) - -This repository contains a subset of the Firebase iOS SDK source. It currently -includes FirebaseCore, FirebaseABTesting, FirebaseAuth, FirebaseDatabase, -FirebaseFirestore, FirebaseFunctions, FirebaseInstanceID, FirebaseInAppMessaging, -FirebaseInAppMessagingDisplay, FirebaseMessaging, FirebaseRemoteConfig, and -FirebaseStorage. +[![Version](https://img.shields.io/cocoapods/v/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) +[![License](https://img.shields.io/cocoapods/l/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) +[![Platform](https://img.shields.io/cocoapods/p/Firebase.svg?style=flat)](https://cocoapods.org/pods/Firebase) + +[![Actions Status][gh-abtesting-badge]][gh-actions] +[![Actions Status][gh-appdistribution-badge]][gh-actions] +[![Actions Status][gh-auth-badge]][gh-actions] +[![Actions Status][gh-core-badge]][gh-actions] +[![Actions Status][gh-crashlytics-badge]][gh-actions] +[![Actions Status][gh-database-badge]][gh-actions] +[![Actions Status][gh-datatransport-badge]][gh-actions] +[![Actions Status][gh-dynamiclinks-badge]][gh-actions] +[![Actions Status][gh-firebasepod-badge]][gh-actions] +[![Actions Status][gh-firestore-badge]][gh-actions] +[![Actions Status][gh-functions-badge]][gh-actions] +[![Actions Status][gh-inappmessaging-badge]][gh-actions] +[![Actions Status][gh-interop-badge]][gh-actions] +[![Actions Status][gh-messaging-badge]][gh-actions] +[![Actions Status][gh-remoteconfig-badge]][gh-actions] +[![Actions Status][gh-storage-badge]][gh-actions] +[![Actions Status][gh-symbolcollision-badge]][gh-actions] +[![Actions Status][gh-zip-badge]][gh-actions] +[![Travis](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) + +# Firebase Apple Open Source Development + +This repository contains all Apple platform Firebase SDK source except FirebaseAnalytics, +FirebasePerformance, and FirebaseML. The repository also includes GoogleUtilities source. The [GoogleUtilities](GoogleUtilities/README.md) pod is @@ -16,8 +37,9 @@ monetize your app. More information about Firebase can be found at ## Installation -See the three subsections for details about three different installation methods. +See the subsections below for details about the different installation methods. 1. [Standard pod install](README.md#standard-pod-install) +1. [Swift Package Manager (Beta)](SwiftPackageManager.md) 1. [Installing from the GitHub repo](README.md#installing-from-github) 1. [Experimental Carthage](README.md#carthage-ios-only) @@ -26,6 +48,11 @@ See the three subsections for details about three different installation methods Go to [https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup). +### Swift Package Manager (Beta) + +Instructions for the Beta of [Swift Package Manager](https://swift.org/package-manager/) +support can be found at [SwiftPackageManager.md](SwiftPackageManager.md). + ### Installing from GitHub For releases starting with 5.0.0, the source for each release is also deployed @@ -69,52 +96,69 @@ Instructions for the experimental Carthage distribution are at Instructions for installing binary frameworks via [Rome](https://github.com/CocoaPods/Rome) are at [Rome](Rome.md). +### Using Firebase from a Framework or a library + +[Using Firebase from a Framework or a library](docs/firebase_in_libraries.md) + ## Development To develop Firebase software in this repository, ensure that you have at least the following software: - * Xcode 10.1 (or later) + * Xcode 10.3 (or later) * CocoaPods 1.7.2 (or later) + * [CocoaPods generate](https://github.com/square/cocoapods-generate) For the pod that you want to develop: -`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open` +`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open --platforms=ios` + +Note: If the CocoaPods cache is out of date, you may need to run +`pod repo update` before the `pod gen` command. + +Note: Set the `--platforms` option to `macos` or `tvos` to develop/test for +those platforms. Since 10.2, Xcode does not properly handle multi-platform +CocoaPods workspaces. Firestore has a self contained Xcode project. See [Firestore/README.md](Firestore/README.md). +### Development for Catalyst +* `pod gen {name here}.podspec --local-sources=./ --auto-open --platforms=ios` +* Check the Mac box in the App-iOS Build Settings +* Sign the App in the Settings Signing & Capabilities tab +* Click Pods in the Project Manager +* Add Signing to the iOS host app and unit test targets +* Select the Unit-unit scheme +* Run it to build and test + ### Adding a New Firebase Pod See [AddNewPod.md](AddNewPod.md). +### Managing Headers and Imports + +See [HeadersImports.md](HeadersImports.md). + ### Code Formatting To ensure that the code is formatted consistently, run the script -[./scripts/style.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/style.sh) +[./scripts/check.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/check.sh) before creating a PR. -Travis will verify that any code changes are done in a style compliant way. Install -`clang-format` and `swiftformat`. -These commands will get the right versions: +GitHub Actions will verify that any code changes are done in a style compliant +way. Install `clang-format` and `mint`: ``` -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/e3496d9/Formula/clang-format.rb -brew upgrade https://raw.githubusercontent.com/Homebrew/homebrew-core/7963c3d/Formula/swiftformat.rb +brew install clang-format +brew install mint ``` -Note: if you already have a newer version of these installed you may need to -`brew switch` to this version. - -To update this section, find the versions of clang-format and swiftformat.rb to -match the versions in the CI failure logs -[here](https://github.com/Homebrew/homebrew-core/tree/master/Formula). - ### Running Unit Tests Select a scheme and press Command-u to build a component and run its unit tests. -#### Viewing Code Coverage +#### Viewing Code Coverage (Deprecated) First, make sure that [xcov](https://github.com/nakiostudio/xcov) is installed with `gem install xcov`. @@ -132,12 +176,7 @@ files without real values, but can be replaced with real plist files. To get you 2. Create a new Firebase project, if you don't already have one 3. For each sample app you want to test, create a new Firebase app with the sample app's bundle identifier (e.g. `com.google.Database-Example`) -4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file -(e.g. in [Example/Database/App/](Example/Database/App/)); - -Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require -special Apple capabilities, and you will have to change the sample app to use a unique bundle -identifier that you can control in your own Apple Developer account. +4. Download the resulting `GoogleService-Info.plist` and add it to the Xcode project. ## Specific Component Instructions See the sections below for any special instructions for those components. @@ -145,18 +184,26 @@ See the sections below for any special instructions for those components. ### Firebase Auth If you're doing specific Firebase Auth development, see -[the Auth Sample README](Example/Auth/README.md) for instructions about +[the Auth Sample README](FirebaseAuth/Tests/Sample/README.md) for instructions about building and running the FirebaseAuth pod along with various samples and tests. ### Firebase Database -To run the Database Integration tests, make your database authentication rules -[public](https://firebase.google.com/docs/database/security/quickstart). +The Firebase Database Integration tests can be run against a locally running Database Emulator +or against a production instance. + +To run against a local emulator instance, invoke `./scripts/run_database_emulator.sh start` before +running the integration test. + +To run against a production instance, provide a valid GoogleServices-Info.plist and copy it to +`FirebaseDatabase/Tests/Resources/GoogleService-Info.plist`. Your Security Rule must be set to +[public](https://firebase.google.com/docs/database/security/quickstart) while your tests are +running. ### Firebase Storage To run the Storage Integration tests, follow the instructions in -[FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m). +[FIRStorageIntegrationTests.m](FirebaseStorage/Tests/Integration/FIRStorageIntegrationTests.m). #### Push Notifications @@ -182,35 +229,44 @@ We've seen an amazing amount of interest and contributions to improve the Fireba very grateful! We'd like to empower as many developers as we can to be able to use Firebase and participate in the Firebase community. -### macOS and tvOS -Thanks to contributions from the community, FirebaseABTesting, FirebaseAuth, FirebaseCore, -FirebaseDatabase, FirebaseMessaging, FirebaseFirestore, -FirebaseFunctions, FirebaseRemoteConfig, and FirebaseStorage now compile, run unit tests, and work on -macOS and tvOS. +### tvOS, macOS, watchOS and Catalyst +Thanks to contributions from the community, many of Firebase SDKs now compile, run unit tests, and work on +tvOS, macOS, watchOS and Catalyst. For tvOS, checkout the [Sample](Example/tvOSSample). +For watchOS, currently only Messaging and Storage (and their dependencies) have limited support. Checkout the +[Independent Watch App Sample](Example/watchOSSample). -Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is -actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there -may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter -this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). +Keep in mind that macOS, tvOS, watchOS and Catalyst are not officially supported by Firebase, and this +repository is actively developed primarily for iOS. While we can catch basic unit test issues with +Travis, there may be some changes where the SDK no longer works as expected on macOS, tvOS or watchOS. If you +encounter this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). -Note that the Firebase pod is not available for macOS and tvOS. +During app setup in the console, you may get to a step that mentions something like "Checking if the app +has communicated with our servers". This relies on Analytics and will not work on macOS/tvOS/watchOS/Catalyst. +**It's safe to ignore the message and continue**, the rest of the SDKs will work as expected. To install, add a subset of the following to the Podfile: ``` -pod 'FirebaseABTesting' -pod 'FirebaseAuth' -pod 'FirebaseCore' -pod 'FirebaseDatabase' -pod 'FirebaseFirestore' -pod 'FirebaseFunctions' -pod 'FirebaseMessaging' -pod 'FirebaseRemoteConfig' -pod 'FirebaseStorage' +pod 'Firebase/ABTesting' # No watchOS support yet +pod 'Firebase/Auth' # Limited watchOS support +pod 'Firebase/Crashlytics' +pod 'Firebase/Database' # No watchOS support yet +pod 'Firebase/Firestore' # No watchOS support yet +pod 'Firebase/Functions' # No watchOS support yet +pod 'Firebase/Messaging' +pod 'Firebase/RemoteConfig' # No watchOS support yet +pod 'Firebase/Storage' ``` +#### Additional Catalyst Notes + +* FirebaseAuth and FirebaseMessaging require adding `Keychain Sharing Capability` +to Build Settings. +* FirebaseFirestore requires signing the +[gRPC Resource target](https://github.com/firebase/firebase-ios-sdk/issues/3500#issuecomment-518741681). + ## Roadmap See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source @@ -228,3 +284,23 @@ The contents of this repository is licensed under the Your use of Firebase is governed by the [Terms of Service for Firebase Services](https://firebase.google.com/terms/). + +[gh-actions]: https://github.com/firebase/firebase-ios-sdk/actions +[gh-abtesting-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/abtesting/badge.svg +[gh-appdistribution-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/appdistribution/badge.svg +[gh-auth-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/auth/badge.svg +[gh-core-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/core/badge.svg +[gh-crashlytics-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/crashlytics/badge.svg +[gh-database-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/database/badge.svg +[gh-datatransport-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/datatransport/badge.svg +[gh-dynamiclinks-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/dynamiclinks/badge.svg +[gh-firebasepod-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/firebasepod/badge.svg +[gh-firestore-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/firestore/badge.svg +[gh-functions-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/functions/badge.svg +[gh-inappmessaging-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/inappmessaging/badge.svg +[gh-interop-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/interop/badge.svg +[gh-messaging-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/messaging/badge.svg +[gh-remoteconfig-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/remoteconfig/badge.svg +[gh-storage-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/storage/badge.svg +[gh-symbolcollision-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/symbolcollision/badge.svg +[gh-zip-badge]: https://github.com/firebase/firebase-ios-sdk/workflows/zip/badge.svg diff --git a/Pods/FirebaseCoreDiagnosticsInterop/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h b/Pods/FirebaseCoreDiagnosticsInterop/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h deleted file mode 100644 index 7c7477696..000000000 --- a/Pods/FirebaseCoreDiagnosticsInterop/Interop/CoreDiagnostics/Public/FIRCoreDiagnosticsData.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** If present, is a BOOL wrapped in an NSNumber. */ -static NSString *const kFIRCDIsDataCollectionDefaultEnabledKey = - @"FIRCDIsDataCollectionDefaultEnabledKey"; - -/** If present, is an int32_t wrapped in an NSNumber. */ -static NSString *const kFIRCDConfigurationTypeKey = @"FIRCDConfigurationTypeKey"; - -/** If present, is an NSString. */ -static NSString *const kFIRCDSdkNameKey = @"FIRCDSdkNameKey"; - -/** If present, is an NSString. */ -static NSString *const kFIRCDSdkVersionKey = @"FIRCDSdkVersionKey"; - -/** If present, is an int32_t wrapped in an NSNumber. */ -static NSString *const kFIRCDllAppsCountKey = @"FIRCDllAppsCountKey"; - -/** If present, is an NSString. */ -static NSString *const kFIRCDGoogleAppIDKey = @"FIRCDGoogleAppIDKey"; - -/** If present, is an NSString. */ -static NSString *const kFIRCDBundleIDKey = @"FIRCDBundleID"; - -/** If present, is a BOOL wrapped in an NSNumber. */ -static NSString *const kFIRCDUsingOptionsFromDefaultPlistKey = - @"FIRCDUsingOptionsFromDefaultPlistKey"; - -/** If present, is an NSString. */ -static NSString *const kFIRCDLibraryVersionIDKey = @"FIRCDLibraryVersionIDKey"; - -/** If present, is an NSString. */ -static NSString *const kFIRCDFirebaseUserAgentKey = @"FIRCDFirebaseUserAgentKey"; - -/** Defines the interface of a data object needed to log diagnostics data. */ -@protocol FIRCoreDiagnosticsData - -@required - -/** A dictionary containing data (non-exhaustive) to be logged in diagnostics. */ -@property(nonatomic) NSDictionary *diagnosticObjects; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseCoreDiagnosticsInterop/LICENSE b/Pods/FirebaseCoreDiagnosticsInterop/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/Pods/FirebaseCoreDiagnosticsInterop/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/Pods/FirebaseCoreDiagnosticsInterop/README.md b/Pods/FirebaseCoreDiagnosticsInterop/README.md deleted file mode 100644 index bf397f057..000000000 --- a/Pods/FirebaseCoreDiagnosticsInterop/README.md +++ /dev/null @@ -1,223 +0,0 @@ -# Firebase iOS Open Source Development [![Build Status](https://travis-ci.org/firebase/firebase-ios-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-ios-sdk) - -This repository contains a subset of the Firebase iOS SDK source. It currently -includes FirebaseCore, FirebaseAuth, FirebaseDatabase, FirebaseFirestore, -FirebaseFunctions, FirebaseInstanceID, FirebaseInAppMessaging, -FirebaseInAppMessagingDisplay, FirebaseMessaging and FirebaseStorage. - -The repository also includes GoogleUtilities source. The -[GoogleUtilities](GoogleUtilities/README.md) pod is -a set of utilities used by Firebase and other Google products. - -Firebase is an app development platform with tools to help you build, grow and -monetize your app. More information about Firebase can be found at -[https://firebase.google.com](https://firebase.google.com). - -## Installation - -See the three subsections for details about three different installation methods. -1. [Standard pod install](README.md#standard-pod-install) -1. [Installing from the GitHub repo](README.md#installing-from-github) -1. [Experimental Carthage](README.md#carthage-ios-only) - -### Standard pod install - -Go to -[https://firebase.google.com/docs/ios/setup](https://firebase.google.com/docs/ios/setup). - -### Installing from GitHub - -For releases starting with 5.0.0, the source for each release is also deployed -to CocoaPods master and available via standard -[CocoaPods Podfile syntax](https://guides.cocoapods.org/syntax/podfile.html#pod). - -These instructions can be used to access the Firebase repo at other branches, -tags, or commits. - -#### Background - -See -[the Podfile Syntax Reference](https://guides.cocoapods.org/syntax/podfile.html#pod) -for instructions and options about overriding pod source locations. - -#### Accessing Firebase Source Snapshots - -All of the official releases are tagged in this repo and available via CocoaPods. To access a local -source snapshot or unreleased branch, use Podfile directives like the following: - -To access FirebaseFirestore via a branch: -``` -pod 'FirebaseCore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master' -pod 'FirebaseFirestore', :git => 'https://github.com/firebase/firebase-ios-sdk.git', :branch => 'master' -``` - -To access FirebaseMessaging via a checked out version of the firebase-ios-sdk repo do: - -``` -pod 'FirebaseCore', :path => '/path/to/firebase-ios-sdk' -pod 'FirebaseMessaging', :path => '/path/to/firebase-ios-sdk' -``` - -### Carthage (iOS only) - -Instructions for the experimental Carthage distribution are at -[Carthage](Carthage.md). - -### Rome - -Instructions for installing binary frameworks via -[Rome](https://github.com/CocoaPods/Rome) are at [Rome](Rome.md). - -## Development - -To develop Firebase software in this repository, ensure that you have at least -the following software: - - * Xcode 10.1 (or later) - * CocoaPods 1.7.2 (or later) - -For the pod that you want to develop: - -`pod gen Firebase{name here}.podspec --local-sources=./ --auto-open` - -Firestore and Functions have self contained Xcode projects. See -[Firestore/README.md](Firestore/README.md) and -[Functions/README.md](Functions/README.md). - -### Adding a New Firebase Pod - -See [AddNewPod.md](AddNewPod.md). - -### Code Formatting - -To ensure that the code is formatted consistently, run the script -[./scripts/style.sh](https://github.com/firebase/firebase-ios-sdk/blob/master/scripts/style.sh) -before creating a PR. - -Travis will verify that any code changes are done in a style compliant way. Install -`clang-format` and `swiftformat`. -These commands will get the right versions: - -``` -brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/773cb75d360b58f32048f5964038d09825a507c8/Formula/clang-format.rb -brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/3dfea1004e0736754bbf49673cca8aaed8a94089/Formula/swiftformat.rb -``` - -Note: if you already have a newer version of these installed you may need to -`brew switch` to this version. - -### Running Unit Tests - -Select a scheme and press Command-u to build a component and run its unit tests. - -#### Viewing Code Coverage - -First, make sure that [xcov](https://github.com/nakiostudio/xcov) is installed with `gem install xcov`. - -After running the `AllUnitTests_iOS` scheme in Xcode, execute -`xcov --workspace Firebase.xcworkspace --scheme AllUnitTests_iOS --output_directory xcov_output` -at Example/ in the terminal. This will aggregate the coverage, and you can run `open xcov_output/index.html` to see the results. - -### Running Sample Apps -In order to run the sample apps and integration tests, you'll need valid -`GoogleService-Info.plist` files for those samples. The Firebase Xcode project contains dummy plist -files without real values, but can be replaced with real plist files. To get your own -`GoogleService-Info.plist` files: - -1. Go to the [Firebase Console](https://console.firebase.google.com/) -2. Create a new Firebase project, if you don't already have one -3. For each sample app you want to test, create a new Firebase app with the sample app's bundle -identifier (e.g. `com.google.Database-Example`) -4. Download the resulting `GoogleService-Info.plist` and replace the appropriate dummy plist file -(e.g. in [Example/Database/App/](Example/Database/App/)); - -Some sample apps like Firebase Messaging ([Example/Messaging/App](Example/Messaging/App)) require -special Apple capabilities, and you will have to change the sample app to use a unique bundle -identifier that you can control in your own Apple Developer account. - -## Specific Component Instructions -See the sections below for any special instructions for those components. - -### Firebase Auth - -If you're doing specific Firebase Auth development, see -[the Auth Sample README](Example/Auth/README.md) for instructions about -building and running the FirebaseAuth pod along with various samples and tests. - -### Firebase Database - -To run the Database Integration tests, make your database authentication rules -[public](https://firebase.google.com/docs/database/security/quickstart). - -### Firebase Storage - -To run the Storage Integration tests, follow the instructions in -[FIRStorageIntegrationTests.m](Example/Storage/Tests/Integration/FIRStorageIntegrationTests.m). - -#### Push Notifications - -Push notifications can only be delivered to specially provisioned App IDs in the developer portal. -In order to actually test receiving push notifications, you will need to: - -1. Change the bundle identifier of the sample app to something you own in your Apple Developer -account, and enable that App ID for push notifications. -2. You'll also need to -[upload your APNs Provider Authentication Key or certificate to the Firebase Console](https://firebase.google.com/docs/cloud-messaging/ios/certs) -at **Project Settings > Cloud Messaging > [Your Firebase App]**. -3. Ensure your iOS device is added to your Apple Developer portal as a test device. - -#### iOS Simulator - -The iOS Simulator cannot register for remote notifications, and will not receive push notifications. -In order to receive push notifications, you'll have to follow the steps above and run the app on a -physical device. - -## Community Supported Efforts - -We've seen an amazing amount of interest and contributions to improve the Firebase SDKs, and we are -very grateful! We'd like to empower as many developers as we can to be able to use Firebase and -participate in the Firebase community. - -### macOS and tvOS -Thanks to contributions from the community, FirebaseAuth, FirebaseCore, FirebaseDatabase, FirebaseMessaging, -FirebaseFirestore, FirebaseFunctions and FirebaseStorage now compile, run unit tests, and work on -macOS and tvOS. - -For tvOS, checkout the [Sample](Example/tvOSSample). - -Keep in mind that macOS and tvOS are not officially supported by Firebase, and this repository is -actively developed primarily for iOS. While we can catch basic unit test issues with Travis, there -may be some changes where the SDK no longer works as expected on macOS or tvOS. If you encounter -this, please [file an issue](https://github.com/firebase/firebase-ios-sdk/issues). - -Note that the Firebase pod is not available for macOS and tvOS. - -To install, add a subset of the following to the Podfile: - -``` -pod 'FirebaseAuth' -pod 'FirebaseCore' -pod 'FirebaseDatabase' -pod 'FirebaseFirestore' -pod 'FirebaseFunctions' -pod 'FirebaseMessaging' -pod 'FirebaseStorage' -``` - -## Roadmap - -See [Roadmap](ROADMAP.md) for more about the Firebase iOS SDK Open Source -plans and directions. - -## Contributing - -See [Contributing](CONTRIBUTING.md) for more information on contributing to the Firebase -iOS SDK. - -## License - -The contents of this repository is licensed under the -[Apache License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0). - -Your use of Firebase is governed by the -[Terms of Service for Firebase Services](https://firebase.google.com/terms/). diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRAppInternal.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRAppInternal.h new file mode 100644 index 000000000..183a25c6d --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRAppInternal.h @@ -0,0 +1,168 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +// The has_include is a workaround so the old IID needed for the FIS tests can find FIRErrors.h +#if __has_include("FirebaseCore/Sources/Private/FIRErrors.h") +#import "FirebaseCore/Sources/Private/FIRErrors.h" +#else +#import +#endif + +@class FIRComponentContainer; +@protocol FIRLibrary; + +/** + * The internal interface to FIRApp. This is meant for first-party integrators, who need to receive + * FIRApp notifications, log info about the success or failure of their configuration, and access + * other internal functionality of FIRApp. + * + * TODO(b/28296561): Restructure this header. + */ +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, FIRConfigType) { + FIRConfigTypeCore = 1, + FIRConfigTypeSDK = 2, +}; + +extern NSString *const kFIRDefaultAppName; +extern NSString *const kFIRAppReadyToConfigureSDKNotification; +extern NSString *const kFIRAppDeleteNotification; +extern NSString *const kFIRAppIsDefaultAppKey; +extern NSString *const kFIRAppNameKey; +extern NSString *const kFIRGoogleAppIDKey; + +/** + * The format string for the User Defaults key used for storing the data collection enabled flag. + * This includes formatting to append the Firebase App's name. + */ +extern NSString *const kFIRGlobalAppDataCollectionEnabledDefaultsKeyFormat; + +/** + * The plist key used for storing the data collection enabled flag. + */ +extern NSString *const kFIRGlobalAppDataCollectionEnabledPlistKey; + +/** + * A notification fired containing diagnostic information when SDK errors occur. + */ +extern NSString *const kFIRAppDiagnosticsNotification; + +/** @var FIRAuthStateDidChangeInternalNotification + @brief The name of the @c NSNotificationCenter notification which is posted when the auth state + changes (e.g. a new token has been produced, a user logs in or out). The object parameter of + the notification is a dictionary possibly containing the key: + @c FIRAuthStateDidChangeInternalNotificationTokenKey (the new access token.) If it does not + contain this key it indicates a sign-out event took place. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotification; + +/** @var FIRAuthStateDidChangeInternalNotificationTokenKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the new access token. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationTokenKey; + +/** @var FIRAuthStateDidChangeInternalNotificationAppKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the FIRApp associated with the auth instance. + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationAppKey; + +/** @var FIRAuthStateDidChangeInternalNotificationUIDKey + @brief A key present in the dictionary object parameter of the + @c FIRAuthStateDidChangeInternalNotification notification. The value associated with this + key will contain the new user's UID (or nil if there is no longer a user signed in). + */ +extern NSString *const FIRAuthStateDidChangeInternalNotificationUIDKey; + +@interface FIRApp () + +/** + * A flag indicating if this is the default app (has the default app name). + */ +@property(nonatomic, readonly) BOOL isDefaultApp; + +/* + * The container of interop SDKs for this app. + */ +@property(nonatomic) FIRComponentContainer *container; + +/** + * Creates an error for failing to configure a subspec service. This method is called by each + * FIRApp notification listener. + */ ++ (NSError *)errorForSubspecConfigurationFailureWithDomain:(NSString *)domain + errorCode:(FIRErrorCode)code + service:(NSString *)service + reason:(NSString *)reason; +/** + * Checks if the default app is configured without trying to configure it. + */ ++ (BOOL)isDefaultAppConfigured; + +/** + * Registers a given third-party library with the given version number to be reported for + * analytics. + * + * @param name Name of the library. + * @param version Version of the library. + */ ++ (void)registerLibrary:(nonnull NSString *)name withVersion:(nonnull NSString *)version; + +/** + * Registers a given internal library with the given version number to be reported for + * analytics. + * + * @param library Optional parameter for component registration. + * @param name Name of the library. + * @param version Version of the library. + */ ++ (void)registerInternalLibrary:(nonnull Class)library + withName:(nonnull NSString *)name + withVersion:(nonnull NSString *)version; + +/** + * A concatenated string representing all the third-party libraries and version numbers. + */ ++ (NSString *)firebaseUserAgent; + +/** + * Used by each SDK to send logs about SDK configuration status to Clearcut. + * + * @note This API is a no-op, please remove calls to it. + */ +- (void)sendLogsWithServiceName:(NSString *)serviceName + version:(NSString *)version + error:(NSError *)error; + +/** + * Can be used by the unit tests in eack SDK to reset FIRApp. This method is thread unsafe. + */ ++ (void)resetApps; + +/** + * Can be used by the unit tests in each SDK to set customized options. + */ +- (instancetype)initInstanceWithName:(NSString *)name options:(FIROptions *)options; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponent.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponent.h new file mode 100644 index 000000000..cb51ee70e --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponent.h @@ -0,0 +1,91 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FIRApp; +@class FIRComponentContainer; + +NS_ASSUME_NONNULL_BEGIN + +/// Provides a system to clean up cached instances returned from the component system. +NS_SWIFT_NAME(ComponentLifecycleMaintainer) +@protocol FIRComponentLifecycleMaintainer +/// The associated app will be deleted, clean up any resources as they are about to be deallocated. +- (void)appWillBeDeleted:(FIRApp *)app; +@end + +typedef _Nullable id (^FIRComponentCreationBlock)(FIRComponentContainer *container, + BOOL *isCacheable) + NS_SWIFT_NAME(ComponentCreationBlock); + +@class FIRDependency; + +/// Describes the timing of instantiation. Note: new components should default to lazy unless there +/// is a strong reason to be eager. +typedef NS_ENUM(NSInteger, FIRInstantiationTiming) { + FIRInstantiationTimingLazy, + FIRInstantiationTimingAlwaysEager, + FIRInstantiationTimingEagerInDefaultApp +} NS_SWIFT_NAME(InstantiationTiming); + +/// A component that can be used from other Firebase SDKs. +NS_SWIFT_NAME(Component) +@interface FIRComponent : NSObject + +/// The protocol describing functionality provided from the Component. +@property(nonatomic, strong, readonly) Protocol *protocol; + +/// The timing of instantiation. +@property(nonatomic, readonly) FIRInstantiationTiming instantiationTiming; + +/// An array of dependencies for the component. +@property(nonatomic, copy, readonly) NSArray *dependencies; + +/// A block to instantiate an instance of the component with the appropriate dependencies. +@property(nonatomic, copy, readonly) FIRComponentCreationBlock creationBlock; + +// There's an issue with long NS_SWIFT_NAMES that causes compilation to fail, disable clang-format +// for the next two methods. +// clang-format off + +/// Creates a component with no dependencies that will be lazily initialized. ++ (instancetype)componentWithProtocol:(Protocol *)protocol + creationBlock:(FIRComponentCreationBlock)creationBlock +NS_SWIFT_NAME(init(_:creationBlock:)); + +/// Creates a component to be registered with the component container. +/// +/// @param protocol - The protocol describing functionality provided by the component. +/// @param instantiationTiming - When the component should be initialized. Use .lazy unless there's +/// a good reason to be instantiated earlier. +/// @param dependencies - Any dependencies the `implementingClass` has, optional or required. +/// @param creationBlock - A block to instantiate the component with a container, and if +/// @return A component that can be registered with the component container. ++ (instancetype)componentWithProtocol:(Protocol *)protocol + instantiationTiming:(FIRInstantiationTiming)instantiationTiming + dependencies:(NSArray *)dependencies + creationBlock:(FIRComponentCreationBlock)creationBlock +NS_SWIFT_NAME(init(_:instantiationTiming:dependencies:creationBlock:)); + +// clang-format on + +/// Unavailable. +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentContainer.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentContainer.h new file mode 100644 index 000000000..db2bafef8 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentContainer.h @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#import + +// The has_include is a workaround so the old IID needed for the FIS tests can find the headers. +#if __has_include("FirebaseCore/Sources/Private/FIRComponentType.h") +#import "FirebaseCore/Sources/Private/FIRComponentType.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" +#else +#import +#import +#endif + +NS_ASSUME_NONNULL_BEGIN + +/// A type-safe macro to retrieve a component from a container. This should be used to retrieve +/// components instead of using the container directly. +#define FIR_COMPONENT(type, container) \ + [FIRComponentType> instanceForProtocol:@protocol(type) inContainer:container] + +@class FIRApp; + +/// A container that holds different components that are registered via the +/// `registerAsComponentRegistrant:` call. These classes should conform to `FIRComponentRegistrant` +/// in order to properly register components for Core. +NS_SWIFT_NAME(FirebaseComponentContainer) +@interface FIRComponentContainer : NSObject + +/// A weak reference to the app that an instance of the container belongs to. +@property(nonatomic, weak, readonly) FIRApp *app; + +/// Unavailable. Use the `container` property on `FIRApp`. +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentType.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentType.h new file mode 100644 index 000000000..6f2aca7b8 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRComponentType.h @@ -0,0 +1,34 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FIRComponentContainer; + +NS_ASSUME_NONNULL_BEGIN + +/// Do not use directly. A placeholder type in order to provide a macro that will warn users of +/// mis-matched protocols. +NS_SWIFT_NAME(ComponentType) +@interface FIRComponentType<__covariant T> : NSObject + +/// Do not use directly. A factory method to retrieve an instance that provides a specific +/// functionality. ++ (T)instanceForProtocol:(Protocol *)protocol inContainer:(FIRComponentContainer *)container; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h new file mode 100644 index 000000000..76c0c05f0 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRCoreDiagnosticsConnector.h @@ -0,0 +1,35 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +@class FIRDiagnosticsData; +@class FIROptions; + +NS_ASSUME_NONNULL_BEGIN + +/** Connects FIRCore with the CoreDiagnostics library. */ +@interface FIRCoreDiagnosticsConnector : NSObject + +/** Logs FirebaseCore related data. + * + * @param options The options object containing data to log. + */ ++ (void)logCoreTelemetryWithOptions:(FIROptions *)options; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRDependency.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRDependency.h new file mode 100644 index 000000000..46e9b7ea6 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRDependency.h @@ -0,0 +1,45 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// A dependency on a specific protocol's functionality. +NS_SWIFT_NAME(Dependency) +@interface FIRDependency : NSObject + +/// The protocol describing functionality being depended on. +@property(nonatomic, strong, readonly) Protocol *protocol; + +/// A flag to specify if the dependency is required or not. +@property(nonatomic, readonly) BOOL isRequired; + +/// Initializes a dependency that is required. Calls `initWithProtocol:isRequired` with `YES` for +/// the required parameter. +/// Creates a required dependency on the specified protocol's functionality. ++ (instancetype)dependencyWithProtocol:(Protocol *)protocol; + +/// Creates a dependency on the specified protocol's functionality and specify if it's required for +/// the class's functionality. ++ (instancetype)dependencyWithProtocol:(Protocol *)protocol isRequired:(BOOL)required; + +/// Use `dependencyWithProtocol:isRequired:` instead. +- (instancetype)init NS_UNAVAILABLE; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRErrorCode.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRErrorCode.h new file mode 100644 index 000000000..c90d9eecf --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRErrorCode.h @@ -0,0 +1,39 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** Error codes in Firebase error domain. */ +typedef NS_ENUM(NSInteger, FIRErrorCode) { + /** + * Unknown error. + */ + FIRErrorCodeUnknown = 0, + /** + * Loading data from the GoogleService-Info.plist file failed. This is a fatal error and should + * not be ignored. Further calls to the API will fail and/or possibly cause crashes. + */ + FIRErrorCodeInvalidPlistFile = -100, + + /** + * Validating the Google App ID format failed. + */ + FIRErrorCodeInvalidAppID = -101, + + /** + * Error code for failing to configure a specific service. It's deprecated, but + * still used after copybara. + */ + FIRErrorCodeConfigFailed = -114, +}; diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRErrors.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRErrors.h new file mode 100644 index 000000000..19e47328a --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRErrors.h @@ -0,0 +1,24 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#include "FIRErrorCode.h" + +extern NSString *const kFirebaseErrorDomain; +extern NSString *const kFirebaseConfigErrorDomain; +extern NSString *const kFirebaseCoreErrorDomain; +extern NSString *const kFirebasePerfErrorDomain; diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h new file mode 100644 index 000000000..bfff73e5d --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRHeartbeatInfo.h @@ -0,0 +1,39 @@ +// Copyright 2019 Google +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FIRHeartbeatInfo : NSObject + +// Enum representing the different heartbeat codes. +typedef NS_ENUM(NSInteger, FIRHeartbeatInfoCode) { + FIRHeartbeatInfoCodeNone = 0, + FIRHeartbeatInfoCodeSDK = 1, + FIRHeartbeatInfoCodeGlobal = 2, + FIRHeartbeatInfoCodeCombined = 3, +}; + +/** + * Get heartbeat code requred for the sdk. + * @param heartbeatTag String representing the sdk heartbeat tag. + * @return Heartbeat code indicating whether or not an sdk/global heartbeat + * needs to be sent + */ ++ (FIRHeartbeatInfoCode)heartbeatCodeForTag:(NSString *)heartbeatTag; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLibrary.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLibrary.h new file mode 100644 index 000000000..e7a9e077c --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLibrary.h @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRLibrary_h +#define FIRLibrary_h + +#import + +// The has_include is a workaround so the old IID needed for the FIS tests can find the headers. +#if __has_include("FirebaseCore/Sources/Private/FIRComponent.h") +#import "FirebaseCore/Sources/Private/FIRComponent.h" +#else +#import +#endif + +@class FIRApp; + +NS_ASSUME_NONNULL_BEGIN + +/// Provide an interface to register a library for userAgent logging and availability to others. +NS_SWIFT_NAME(Library) +@protocol FIRLibrary + +/// Returns one or more FIRComponents that will be registered in +/// FIRApp and participate in dependency resolution and injection. ++ (NSArray *)componentsToRegister; + +@optional +/// Implement this method if the library needs notifications for lifecycle events. This method is +/// called when the developer calls `FirebaseApp.configure()`. ++ (void)configureWithApp:(FIRApp *)app; + +@end + +NS_ASSUME_NONNULL_END + +#endif /* FIRLibrary_h */ diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLogger.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLogger.h new file mode 100644 index 000000000..548e389a4 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIRLogger.h @@ -0,0 +1,151 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import + +NS_ASSUME_NONNULL_BEGIN + +/** + * The Firebase services used in Firebase logger. + */ +typedef NSString *const FIRLoggerService; + +extern FIRLoggerService kFIRLoggerABTesting; +extern FIRLoggerService kFIRLoggerAdMob; +extern FIRLoggerService kFIRLoggerAnalytics; +extern FIRLoggerService kFIRLoggerAuth; +extern FIRLoggerService kFIRLoggerCrash; +extern FIRLoggerService kFIRLoggerCore; +extern FIRLoggerService kFIRLoggerMLKit; +extern FIRLoggerService kFIRLoggerPerf; +extern FIRLoggerService kFIRLoggerRemoteConfig; + +/** + * The key used to store the logger's error count. + */ +extern NSString *const kFIRLoggerErrorCountKey; + +/** + * The key used to store the logger's warning count. + */ +extern NSString *const kFIRLoggerWarningCountKey; + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +/** + * Enables or disables Analytics debug mode. + * If set to YES, the logging level for Analytics will be set to FIRLoggerLevelDebug. + * Enabling the debug mode has no effect if the app is running from App Store. + * (required) analytics debug mode flag. + */ +void FIRSetAnalyticsDebugMode(BOOL analyticsDebugMode); + +/** + * Changes the default logging level of FIRLoggerLevelNotice to a user-specified level. + * The default level cannot be set above FIRLoggerLevelNotice if the app is running from App Store. + * (required) log level (one of the FIRLoggerLevel enum values). + */ +void FIRSetLoggerLevel(FIRLoggerLevel loggerLevel); + +/** + * Checks if the specified logger level is loggable given the current settings. + * (required) log level (one of the FIRLoggerLevel enum values). + * (required) whether or not this function is called from the Analytics component. + */ +BOOL FIRIsLoggableLevel(FIRLoggerLevel loggerLevel, BOOL analyticsComponent); + +/** + * Logs a message to the Xcode console and the device log. If running from AppStore, will + * not log any messages with a level higher than FIRLoggerLevelNotice to avoid log spamming. + * (required) log level (one of the FIRLoggerLevel enum values). + * (required) service name of type FIRLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ +extern void FIRLogBasic(FIRLoggerLevel level, + FIRLoggerService service, + NSString *messageCode, + NSString *message, +// On 64-bit simulators, va_list is not a pointer, so cannot be marked nullable +// See: http://stackoverflow.com/q/29095469 +#if __LP64__ && TARGET_OS_SIMULATOR || TARGET_OS_OSX + va_list args_ptr +#else + va_list _Nullable args_ptr +#endif +); + +/** + * The following functions accept the following parameters in order: + * (required) service name of type FIRLoggerService. + * (required) message code starting from "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * See go/firebase-log-proposal for details. + * (required) message string which can be a format string. + * (optional) the list of arguments to substitute into the format string. + * Example usage: + * FIRLogError(kFIRLoggerCore, @"I-COR000001", @"Configuration of %@ failed.", app.name); + */ +extern void FIRLogError(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogWarning(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogNotice(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogInfo(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); +extern void FIRLogDebug(FIRLoggerService service, NSString *messageCode, NSString *message, ...) + NS_FORMAT_FUNCTION(3, 4); + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +@interface FIRLoggerWrapper : NSObject + +/** + * Objective-C wrapper for FIRLogBasic to allow weak linking to FIRLogger + * (required) log level (one of the FIRLoggerLevel enum values). + * (required) service name of type FIRLoggerService. + * (required) message code starting with "I-" which means iOS, followed by a capitalized + * three-character service identifier and a six digit integer message ID that is unique + * within the service. + * An example of the message code is @"I-COR000001". + * (required) message string which can be a format string. + * (optional) variable arguments list obtained from calling va_start, used when message is a format + * string. + */ + ++ (void)logWithLevel:(FIRLoggerLevel)level + withService:(FIRLoggerService)service + withCode:(NSString *)messageCode + withMessage:(NSString *)message + withArgs:(va_list)args; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIROptionsInternal.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIROptionsInternal.h new file mode 100644 index 000000000..0660a3cd8 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FIROptionsInternal.h @@ -0,0 +1,114 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +/** + * Keys for the strings in the plist file. + */ +extern NSString *const kFIRAPIKey; +extern NSString *const kFIRTrackingID; +extern NSString *const kFIRGoogleAppID; +extern NSString *const kFIRClientID; +extern NSString *const kFIRGCMSenderID; +extern NSString *const kFIRAndroidClientID; +extern NSString *const kFIRDatabaseURL; +extern NSString *const kFIRStorageBucket; +extern NSString *const kFIRBundleID; +extern NSString *const kFIRProjectID; + +/** + * Keys for the plist file name + */ +extern NSString *const kServiceInfoFileName; + +extern NSString *const kServiceInfoFileType; + +/** + * This header file exposes the initialization of FIROptions to internal use. + */ +@interface FIROptions () + +/** + * resetDefaultOptions and initInternalWithOptionsDictionary: are exposed only for unit tests. + */ ++ (void)resetDefaultOptions; + +/** + * Initializes the options with dictionary. The above strings are the keys of the dictionary. + * This is the designated initializer. + */ +- (instancetype)initInternalWithOptionsDictionary:(NSDictionary *)serviceInfoDictionary; + +/** + * defaultOptions and defaultOptionsDictionary are exposed in order to be used in FIRApp and + * other first party services. + */ ++ (FIROptions *)defaultOptions; + ++ (NSDictionary *)defaultOptionsDictionary; + +/** + * Indicates whether or not Analytics collection was explicitly enabled via a plist flag or at + * runtime. + */ +@property(nonatomic, readonly) BOOL isAnalyticsCollectionExplicitlySet; + +/** + * Whether or not Analytics Collection was enabled. Analytics Collection is enabled unless + * explicitly disabled in GoogleService-Info.plist. + */ +@property(nonatomic, readonly) BOOL isAnalyticsCollectionEnabled; + +/** + * Whether or not Analytics Collection was completely disabled. If YES, then + * isAnalyticsCollectionEnabled will be NO. + */ +@property(nonatomic, readonly) BOOL isAnalyticsCollectionDeactivated; + +/** + * The version ID of the client library, e.g. @"1100000". + */ +@property(nonatomic, readonly, copy) NSString *libraryVersionID; + +/** + * The flag indicating whether this object was constructed with the values in the default plist + * file. + */ +@property(nonatomic) BOOL usingOptionsFromDefaultPlist; + +/** + * Whether or not Measurement was enabled. Measurement is enabled unless explicitly disabled in + * GoogleService-Info.plist. + */ +@property(nonatomic, readonly) BOOL isMeasurementEnabled; + +/** + * Whether or not Analytics was enabled in the developer console. + */ +@property(nonatomic, readonly) BOOL isAnalyticsEnabled; + +/** + * Whether or not SignIn was enabled in the developer console. + */ +@property(nonatomic, readonly) BOOL isSignInEnabled; + +/** + * Whether or not editing is locked. This should occur after FIROptions has been set on a FIRApp. + */ +@property(nonatomic, getter=isEditingLocked) BOOL editingLocked; + +@end diff --git a/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h new file mode 100644 index 000000000..2c18a7670 --- /dev/null +++ b/Pods/FirebaseFirestore/FirebaseCore/Sources/Private/FirebaseCoreInternal.h @@ -0,0 +1,27 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// An umbrella header, for any other libraries in this repo to access Firebase Public and Private +// headers. Any package manager complexity should be handled here. + +#import + +#import "FirebaseCore/Sources/Private/FIRAppInternal.h" +#import "FirebaseCore/Sources/Private/FIRComponent.h" +#import "FirebaseCore/Sources/Private/FIRComponentContainer.h" +#import "FirebaseCore/Sources/Private/FIRDependency.h" +#import "FirebaseCore/Sources/Private/FIRHeartbeatInfo.h" +#import "FirebaseCore/Sources/Private/FIRLibrary.h" +#import "FirebaseCore/Sources/Private/FIRLogger.h" +#import "FirebaseCore/Sources/Private/FIROptionsInternal.h" diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc index 235062ac6..04b01a948 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "maybe_document.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -74,6 +82,57 @@ PB_STATIC_ASSERT((pb_membersize(firestore_client_NoDocument, read_time) < 256 && #endif +std::string firestore_client_NoDocument::ToString(int indent) const { + std::string header = PrintHeader(indent, "NoDocument", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + result += PrintMessageField("read_time ", read_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string firestore_client_UnknownDocument::ToString(int indent) const { + std::string header = PrintHeader(indent, "UnknownDocument", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + result += PrintMessageField("version ", version, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string firestore_client_MaybeDocument::ToString(int indent) const { + std::string header = PrintHeader(indent, "MaybeDocument", this); + std::string result; + + switch (which_document_type) { + case firestore_client_MaybeDocument_no_document_tag: + result += PrintMessageField("no_document ", + no_document, indent + 1, true); + break; + case firestore_client_MaybeDocument_document_tag: + result += PrintMessageField("document ", document, indent + 1, true); + break; + case firestore_client_MaybeDocument_unknown_document_tag: + result += PrintMessageField("unknown_document ", + unknown_document, indent + 1, true); + break; + } + result += PrintPrimitiveField("has_committed_mutations: ", + has_committed_mutations, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h index 6523203e5..1035fb4a1 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_FIRESTORE_CLIENT_MAYBE_DOCUMENT_NANOPB_H_INCLUDED #define PB_FIRESTORE_CLIENT_MAYBE_DOCUMENT_NANOPB_H_INCLUDED @@ -25,6 +25,8 @@ #include "google/protobuf/timestamp.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -38,12 +40,16 @@ namespace firestore { typedef struct _firestore_client_NoDocument { pb_bytes_array_t *name; google_protobuf_Timestamp read_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_NoDocument) */ } firestore_client_NoDocument; typedef struct _firestore_client_UnknownDocument { pb_bytes_array_t *name; google_protobuf_Timestamp version; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_UnknownDocument) */ } firestore_client_UnknownDocument; @@ -55,6 +61,8 @@ typedef struct _firestore_client_MaybeDocument { firestore_client_UnknownDocument unknown_document; }; bool has_committed_mutations; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_MaybeDocument) */ } firestore_client_MaybeDocument; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc index 6eefdcf77..a407d3ab2 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "mutation.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -68,6 +76,43 @@ PB_STATIC_ASSERT((pb_membersize(firestore_client_WriteBatch, local_write_time) < #endif +std::string firestore_client_MutationQueue::ToString(int indent) const { + std::string header = PrintHeader(indent, "MutationQueue", this); + std::string result; + + result += PrintPrimitiveField("last_acknowledged_batch_id: ", + last_acknowledged_batch_id, indent + 1, false); + result += PrintPrimitiveField("last_stream_token: ", + last_stream_token, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string firestore_client_WriteBatch::ToString(int indent) const { + std::string header = PrintHeader(indent, "WriteBatch", this); + std::string result; + + result += PrintPrimitiveField("batch_id: ", batch_id, indent + 1, false); + for (pb_size_t i = 0; i != writes_count; ++i) { + result += PrintMessageField("writes ", writes[i], indent + 1, true); + } + result += PrintMessageField("local_write_time ", + local_write_time, indent + 1, false); + for (pb_size_t i = 0; i != base_writes_count; ++i) { + result += PrintMessageField("base_writes ", + base_writes[i], indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h index 6ebd37211..96289c3ca 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_FIRESTORE_CLIENT_MUTATION_NANOPB_H_INCLUDED #define PB_FIRESTORE_CLIENT_MUTATION_NANOPB_H_INCLUDED @@ -25,6 +25,8 @@ #include "google/protobuf/timestamp.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -38,6 +40,8 @@ namespace firestore { typedef struct _firestore_client_MutationQueue { int32_t last_acknowledged_batch_id; pb_bytes_array_t *last_stream_token; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_MutationQueue) */ } firestore_client_MutationQueue; @@ -48,6 +52,8 @@ typedef struct _firestore_client_WriteBatch { google_protobuf_Timestamp local_write_time; pb_size_t base_writes_count; struct _google_firestore_v1_Write *base_writes; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_WriteBatch) */ } firestore_client_WriteBatch; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc index 3fd5de4e3..d51237054 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "target.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -29,13 +37,14 @@ namespace firestore { -const pb_field_t firestore_client_Target_fields[7] = { +const pb_field_t firestore_client_Target_fields[8] = { PB_FIELD( 1, INT32 , SINGULAR, STATIC , FIRST, firestore_client_Target, target_id, target_id, 0), PB_FIELD( 2, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_Target, snapshot_version, target_id, &google_protobuf_Timestamp_fields), PB_FIELD( 3, BYTES , SINGULAR, POINTER , OTHER, firestore_client_Target, resume_token, snapshot_version, 0), PB_FIELD( 4, INT64 , SINGULAR, STATIC , OTHER, firestore_client_Target, last_listen_sequence_number, resume_token, 0), PB_ANONYMOUS_ONEOF_FIELD(target_type, 5, MESSAGE , ONEOF, STATIC , OTHER, firestore_client_Target, query, last_listen_sequence_number, &google_firestore_v1_Target_QueryTarget_fields), PB_ANONYMOUS_ONEOF_FIELD(target_type, 6, MESSAGE , ONEOF, STATIC , UNION, firestore_client_Target, documents, last_listen_sequence_number, &google_firestore_v1_Target_DocumentsTarget_fields), + PB_FIELD( 7, MESSAGE , SINGULAR, STATIC , OTHER, firestore_client_Target, last_limbo_free_snapshot_version, documents, &google_protobuf_Timestamp_fields), PB_LAST_FIELD }; @@ -57,7 +66,7 @@ const pb_field_t firestore_client_TargetGlobal_fields[5] = { * numbers or field sizes that are larger than what can fit in 8 or 16 bit * field descriptors. */ -PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 65536 && pb_membersize(firestore_client_Target, documents) < 65536 && pb_membersize(firestore_client_Target, snapshot_version) < 65536 && pb_membersize(firestore_client_TargetGlobal, last_remote_snapshot_version) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_client_Target_firestore_client_TargetGlobal) +PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 65536 && pb_membersize(firestore_client_Target, documents) < 65536 && pb_membersize(firestore_client_Target, snapshot_version) < 65536 && pb_membersize(firestore_client_Target, last_limbo_free_snapshot_version) < 65536 && pb_membersize(firestore_client_TargetGlobal, last_remote_snapshot_version) < 65536), YOU_MUST_DEFINE_PB_FIELD_32BIT_FOR_MESSAGES_firestore_client_Target_firestore_client_TargetGlobal) #endif #if !defined(PB_FIELD_16BIT) && !defined(PB_FIELD_32BIT) @@ -68,10 +77,53 @@ PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 65536 && pb_me * numbers or field sizes that are larger than what can fit in the default * 8 bit descriptors. */ -PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 256 && pb_membersize(firestore_client_Target, documents) < 256 && pb_membersize(firestore_client_Target, snapshot_version) < 256 && pb_membersize(firestore_client_TargetGlobal, last_remote_snapshot_version) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_client_Target_firestore_client_TargetGlobal) +PB_STATIC_ASSERT((pb_membersize(firestore_client_Target, query) < 256 && pb_membersize(firestore_client_Target, documents) < 256 && pb_membersize(firestore_client_Target, snapshot_version) < 256 && pb_membersize(firestore_client_Target, last_limbo_free_snapshot_version) < 256 && pb_membersize(firestore_client_TargetGlobal, last_remote_snapshot_version) < 256), YOU_MUST_DEFINE_PB_FIELD_16BIT_FOR_MESSAGES_firestore_client_Target_firestore_client_TargetGlobal) #endif +std::string firestore_client_Target::ToString(int indent) const { + std::string header = PrintHeader(indent, "Target", this); + std::string result; + + result += PrintPrimitiveField("target_id: ", target_id, indent + 1, false); + result += PrintMessageField("snapshot_version ", + snapshot_version, indent + 1, false); + result += PrintPrimitiveField("resume_token: ", + resume_token, indent + 1, false); + result += PrintPrimitiveField("last_listen_sequence_number: ", + last_listen_sequence_number, indent + 1, false); + switch (which_target_type) { + case firestore_client_Target_query_tag: + result += PrintMessageField("query ", query, indent + 1, true); + break; + case firestore_client_Target_documents_tag: + result += PrintMessageField("documents ", documents, indent + 1, true); + break; + } + result += PrintMessageField("last_limbo_free_snapshot_version ", + last_limbo_free_snapshot_version, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string firestore_client_TargetGlobal::ToString(int indent) const { + std::string header = PrintHeader(indent, "TargetGlobal", this); + std::string result; + + result += PrintPrimitiveField("highest_target_id: ", + highest_target_id, indent + 1, false); + result += PrintPrimitiveField("highest_listen_sequence_number: ", + highest_listen_sequence_number, indent + 1, false); + result += PrintMessageField("last_remote_snapshot_version ", + last_remote_snapshot_version, indent + 1, false); + result += PrintPrimitiveField("target_count: ", + target_count, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h index bbecf0911..0e238e7ff 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/firestore/local/target.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_FIRESTORE_CLIENT_TARGET_NANOPB_H_INCLUDED #define PB_FIRESTORE_CLIENT_TARGET_NANOPB_H_INCLUDED @@ -25,6 +25,8 @@ #include "google/protobuf/timestamp.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -45,6 +47,9 @@ typedef struct _firestore_client_Target { google_firestore_v1_Target_QueryTarget query; google_firestore_v1_Target_DocumentsTarget documents; }; + google_protobuf_Timestamp last_limbo_free_snapshot_version; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_Target) */ } firestore_client_Target; @@ -53,15 +58,17 @@ typedef struct _firestore_client_TargetGlobal { int64_t highest_listen_sequence_number; google_protobuf_Timestamp last_remote_snapshot_version; int32_t target_count; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:firestore_client_TargetGlobal) */ } firestore_client_TargetGlobal; /* Default values for struct fields */ /* Initializer values for message structs */ -#define firestore_client_Target_init_default {0, google_protobuf_Timestamp_init_default, NULL, 0, 0, {google_firestore_v1_Target_QueryTarget_init_default}} +#define firestore_client_Target_init_default {0, google_protobuf_Timestamp_init_default, NULL, 0, 0, {google_firestore_v1_Target_QueryTarget_init_default}, google_protobuf_Timestamp_init_default} #define firestore_client_TargetGlobal_init_default {0, 0, google_protobuf_Timestamp_init_default, 0} -#define firestore_client_Target_init_zero {0, google_protobuf_Timestamp_init_zero, NULL, 0, 0, {google_firestore_v1_Target_QueryTarget_init_zero}} +#define firestore_client_Target_init_zero {0, google_protobuf_Timestamp_init_zero, NULL, 0, 0, {google_firestore_v1_Target_QueryTarget_init_zero}, google_protobuf_Timestamp_init_zero} #define firestore_client_TargetGlobal_init_zero {0, 0, google_protobuf_Timestamp_init_zero, 0} /* Field tags (for use in manual encoding/decoding) */ @@ -71,13 +78,14 @@ typedef struct _firestore_client_TargetGlobal { #define firestore_client_Target_snapshot_version_tag 2 #define firestore_client_Target_resume_token_tag 3 #define firestore_client_Target_last_listen_sequence_number_tag 4 +#define firestore_client_Target_last_limbo_free_snapshot_version_tag 7 #define firestore_client_TargetGlobal_highest_target_id_tag 1 #define firestore_client_TargetGlobal_highest_listen_sequence_number_tag 2 #define firestore_client_TargetGlobal_last_remote_snapshot_version_tag 3 #define firestore_client_TargetGlobal_target_count_tag 4 /* Struct field encoding specification for nanopb */ -extern const pb_field_t firestore_client_Target_fields[7]; +extern const pb_field_t firestore_client_Target_fields[8]; extern const pb_field_t firestore_client_TargetGlobal_fields[5]; /* Maximum encoded size of messages (where known) */ diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc index d1cf3c8d8..46d14342d 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "annotations.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h index 888c5ea71..75d6a5c6d 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/annotations.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_API_ANNOTATIONS_NANOPB_H_INCLUDED #define PB_GOOGLE_API_ANNOTATIONS_NANOPB_H_INCLUDED @@ -23,6 +23,8 @@ #include "google/api/http.nanopb.h" +#include + namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc index dec5b4b2c..67b2f531a 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "http.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -79,6 +87,81 @@ PB_STATIC_ASSERT((pb_membersize(google_api_HttpRule, custom) < 256), YOU_MUST_DE #endif +std::string google_api_Http::ToString(int indent) const { + std::string header = PrintHeader(indent, "Http", this); + std::string result; + + for (pb_size_t i = 0; i != rules_count; ++i) { + result += PrintMessageField("rules ", rules[i], indent + 1, true); + } + result += PrintPrimitiveField("fully_decode_reserved_expansion: ", + fully_decode_reserved_expansion, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_api_HttpRule::ToString(int indent) const { + std::string header = PrintHeader(indent, "HttpRule", this); + std::string result; + + result += PrintPrimitiveField("selector: ", selector, indent + 1, false); + switch (which_pattern) { + case google_api_HttpRule_get_tag: + result += PrintPrimitiveField("get: ", get, indent + 1, true); + break; + case google_api_HttpRule_put_tag: + result += PrintPrimitiveField("put: ", put, indent + 1, true); + break; + case google_api_HttpRule_post_tag: + result += PrintPrimitiveField("post: ", post, indent + 1, true); + break; + case google_api_HttpRule_delete_tag: + result += PrintPrimitiveField("delete: ", delete_, indent + 1, true); + break; + case google_api_HttpRule_patch_tag: + result += PrintPrimitiveField("patch: ", patch, indent + 1, true); + break; + case google_api_HttpRule_custom_tag: + result += PrintMessageField("custom ", custom, indent + 1, true); + break; + } + result += PrintPrimitiveField("body: ", body, indent + 1, false); + for (pb_size_t i = 0; i != additional_bindings_count; ++i) { + result += PrintMessageField("additional_bindings ", + additional_bindings[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_api_CustomHttpPattern::ToString(int indent) const { + std::string header = PrintHeader(indent, "CustomHttpPattern", this); + std::string result; + + result += PrintPrimitiveField("kind: ", kind, indent + 1, false); + result += PrintPrimitiveField("path: ", path, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h index 50b5973d5..d85374bff 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/api/http.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_API_HTTP_NANOPB_H_INCLUDED #define PB_GOOGLE_API_HTTP_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -34,6 +36,8 @@ namespace firestore { typedef struct _google_api_CustomHttpPattern { pb_bytes_array_t *kind; pb_bytes_array_t *path; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_api_CustomHttpPattern) */ } google_api_CustomHttpPattern; @@ -41,6 +45,8 @@ typedef struct _google_api_Http { pb_size_t rules_count; struct _google_api_HttpRule *rules; bool fully_decode_reserved_expansion; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_api_Http) */ } google_api_Http; @@ -58,6 +64,8 @@ typedef struct _google_api_HttpRule { pb_bytes_array_t *body; pb_size_t additional_bindings_count; struct _google_api_HttpRule *additional_bindings; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_api_HttpRule) */ } google_api_HttpRule; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc index 9889684a1..15a195da7 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "common.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -81,6 +89,105 @@ PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Precondition, update_time) < #endif +std::string google_firestore_v1_DocumentMask::ToString(int indent) const { + std::string header = PrintHeader(indent, "DocumentMask", this); + std::string result; + + for (pb_size_t i = 0; i != field_paths_count; ++i) { + result += PrintPrimitiveField("field_paths: ", + field_paths[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_Precondition::ToString(int indent) const { + std::string header = PrintHeader(indent, "Precondition", this); + std::string result; + + switch (which_condition_type) { + case google_firestore_v1_Precondition_exists_tag: + result += PrintPrimitiveField("exists: ", exists, indent + 1, true); + break; + case google_firestore_v1_Precondition_update_time_tag: + result += PrintMessageField("update_time ", + update_time, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_TransactionOptions::ToString(int indent) const { + std::string header = PrintHeader(indent, "TransactionOptions", this); + std::string result; + + switch (which_mode) { + case google_firestore_v1_TransactionOptions_read_only_tag: + result += PrintMessageField("read_only ", read_only, indent + 1, true); + break; + case google_firestore_v1_TransactionOptions_read_write_tag: + result += PrintMessageField("read_write ", + read_write, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_TransactionOptions_ReadWrite::ToString(int indent) const { + std::string header = PrintHeader(indent, "ReadWrite", this); + std::string result; + + result += PrintPrimitiveField("retry_transaction: ", + retry_transaction, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_TransactionOptions_ReadOnly::ToString(int indent) const { + std::string header = PrintHeader(indent, "ReadOnly", this); + std::string result; + + switch (which_consistency_selector) { + case google_firestore_v1_TransactionOptions_ReadOnly_read_time_tag: + result += PrintMessageField("read_time ", read_time, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h index 8488c3a93..6056963d6 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/common.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_FIRESTORE_V1_COMMON_NANOPB_H_INCLUDED #define PB_GOOGLE_FIRESTORE_V1_COMMON_NANOPB_H_INCLUDED @@ -25,6 +25,8 @@ #include "google/protobuf/timestamp.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -38,11 +40,15 @@ namespace firestore { typedef struct _google_firestore_v1_DocumentMask { pb_size_t field_paths_count; pb_bytes_array_t **field_paths; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DocumentMask) */ } google_firestore_v1_DocumentMask; typedef struct _google_firestore_v1_TransactionOptions_ReadWrite { pb_bytes_array_t *retry_transaction; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_TransactionOptions_ReadWrite) */ } google_firestore_v1_TransactionOptions_ReadWrite; @@ -52,6 +58,8 @@ typedef struct _google_firestore_v1_Precondition { bool exists; google_protobuf_Timestamp update_time; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Precondition) */ } google_firestore_v1_Precondition; @@ -60,6 +68,8 @@ typedef struct _google_firestore_v1_TransactionOptions_ReadOnly { union { google_protobuf_Timestamp read_time; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_TransactionOptions_ReadOnly) */ } google_firestore_v1_TransactionOptions_ReadOnly; @@ -69,6 +79,8 @@ typedef struct _google_firestore_v1_TransactionOptions { google_firestore_v1_TransactionOptions_ReadOnly read_only; google_firestore_v1_TransactionOptions_ReadWrite read_write; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_TransactionOptions) */ } google_firestore_v1_TransactionOptions; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc index d8ee42c17..5b2e5fb8c 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "document.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -99,6 +107,139 @@ PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Document, create_time) < 256 #endif +std::string google_firestore_v1_Document::ToString(int indent) const { + std::string header = PrintHeader(indent, "Document", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + for (pb_size_t i = 0; i != fields_count; ++i) { + result += PrintMessageField("fields ", fields[i], indent + 1, true); + } + result += PrintMessageField("create_time ", + create_time, indent + 1, false); + if (has_update_time) { + result += PrintMessageField("update_time ", + update_time, indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_Document_FieldsEntry::ToString(int indent) const { + std::string header = PrintHeader(indent, "FieldsEntry", this); + std::string result; + + result += PrintPrimitiveField("key: ", key, indent + 1, false); + result += PrintMessageField("value ", value, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_Value::ToString(int indent) const { + std::string header = PrintHeader(indent, "Value", this); + std::string result; + + switch (which_value_type) { + case google_firestore_v1_Value_boolean_value_tag: + result += PrintPrimitiveField("boolean_value: ", + boolean_value, indent + 1, true); + break; + case google_firestore_v1_Value_integer_value_tag: + result += PrintPrimitiveField("integer_value: ", + integer_value, indent + 1, true); + break; + case google_firestore_v1_Value_double_value_tag: + result += PrintPrimitiveField("double_value: ", + double_value, indent + 1, true); + break; + case google_firestore_v1_Value_reference_value_tag: + result += PrintPrimitiveField("reference_value: ", + reference_value, indent + 1, true); + break; + case google_firestore_v1_Value_map_value_tag: + result += PrintMessageField("map_value ", map_value, indent + 1, true); + break; + case google_firestore_v1_Value_geo_point_value_tag: + result += PrintMessageField("geo_point_value ", + geo_point_value, indent + 1, true); + break; + case google_firestore_v1_Value_array_value_tag: + result += PrintMessageField("array_value ", + array_value, indent + 1, true); + break; + case google_firestore_v1_Value_timestamp_value_tag: + result += PrintMessageField("timestamp_value ", + timestamp_value, indent + 1, true); + break; + case google_firestore_v1_Value_null_value_tag: + result += PrintEnumField("null_value: ", null_value, indent + 1, true); + break; + case google_firestore_v1_Value_string_value_tag: + result += PrintPrimitiveField("string_value: ", + string_value, indent + 1, true); + break; + case google_firestore_v1_Value_bytes_value_tag: + result += PrintPrimitiveField("bytes_value: ", + bytes_value, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_ArrayValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "ArrayValue", this); + std::string result; + + for (pb_size_t i = 0; i != values_count; ++i) { + result += PrintMessageField("values ", values[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_MapValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "MapValue", this); + std::string result; + + for (pb_size_t i = 0; i != fields_count; ++i) { + result += PrintMessageField("fields ", fields[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_MapValue_FieldsEntry::ToString(int indent) const { + std::string header = PrintHeader(indent, "FieldsEntry", this); + std::string result; + + result += PrintPrimitiveField("key: ", key, indent + 1, false); + result += PrintMessageField("value ", value, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h index 287782eb6..a902f952d 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_FIRESTORE_V1_DOCUMENT_NANOPB_H_INCLUDED #define PB_GOOGLE_FIRESTORE_V1_DOCUMENT_NANOPB_H_INCLUDED @@ -29,6 +29,8 @@ #include "google/type/latlng.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -42,12 +44,16 @@ namespace firestore { typedef struct _google_firestore_v1_ArrayValue { pb_size_t values_count; struct _google_firestore_v1_Value *values; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ArrayValue) */ } google_firestore_v1_ArrayValue; typedef struct _google_firestore_v1_MapValue { pb_size_t fields_count; struct _google_firestore_v1_MapValue_FieldsEntry *fields; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_MapValue) */ } google_firestore_v1_MapValue; @@ -58,6 +64,8 @@ typedef struct _google_firestore_v1_Document { google_protobuf_Timestamp create_time; bool has_update_time; google_protobuf_Timestamp update_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Document) */ } google_firestore_v1_Document; @@ -76,18 +84,24 @@ typedef struct _google_firestore_v1_Value { pb_bytes_array_t *string_value; pb_bytes_array_t *bytes_value; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Value) */ } google_firestore_v1_Value; typedef struct _google_firestore_v1_Document_FieldsEntry { pb_bytes_array_t *key; google_firestore_v1_Value value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Document_FieldsEntry) */ } google_firestore_v1_Document_FieldsEntry; typedef struct _google_firestore_v1_MapValue_FieldsEntry { pb_bytes_array_t *key; google_firestore_v1_Value value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_MapValue_FieldsEntry) */ } google_firestore_v1_MapValue_FieldsEntry; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc index 9fe90646c..04533eefa 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "firestore.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -259,6 +267,582 @@ PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_GetDocumentRequest, read_tim #endif +const char* EnumToString( + google_firestore_v1_TargetChange_TargetChangeType value) { + switch (value) { + case google_firestore_v1_TargetChange_TargetChangeType_NO_CHANGE: + return "NO_CHANGE"; + case google_firestore_v1_TargetChange_TargetChangeType_ADD: + return "ADD"; + case google_firestore_v1_TargetChange_TargetChangeType_REMOVE: + return "REMOVE"; + case google_firestore_v1_TargetChange_TargetChangeType_CURRENT: + return "CURRENT"; + case google_firestore_v1_TargetChange_TargetChangeType_RESET: + return "RESET"; + } + return ""; +} + +std::string google_firestore_v1_GetDocumentRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "GetDocumentRequest", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + result += PrintMessageField("mask ", mask, indent + 1, false); + switch (which_consistency_selector) { + case google_firestore_v1_GetDocumentRequest_transaction_tag: + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, true); + break; + case google_firestore_v1_GetDocumentRequest_read_time_tag: + result += PrintMessageField("read_time ", read_time, indent + 1, true); + break; + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_ListDocumentsRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListDocumentsRequest", this); + std::string result; + + result += PrintPrimitiveField("parent: ", parent, indent + 1, false); + result += PrintPrimitiveField("collection_id: ", + collection_id, indent + 1, false); + result += PrintPrimitiveField("page_size: ", page_size, indent + 1, false); + result += PrintPrimitiveField("page_token: ", + page_token, indent + 1, false); + result += PrintPrimitiveField("order_by: ", order_by, indent + 1, false); + result += PrintMessageField("mask ", mask, indent + 1, false); + switch (which_consistency_selector) { + case google_firestore_v1_ListDocumentsRequest_transaction_tag: + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, true); + break; + case google_firestore_v1_ListDocumentsRequest_read_time_tag: + result += PrintMessageField("read_time ", read_time, indent + 1, true); + break; + } + result += PrintPrimitiveField("show_missing: ", + show_missing, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_ListDocumentsResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListDocumentsResponse", this); + std::string result; + + for (pb_size_t i = 0; i != documents_count; ++i) { + result += PrintMessageField("documents ", + documents[i], indent + 1, true); + } + result += PrintPrimitiveField("next_page_token: ", + next_page_token, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_CreateDocumentRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "CreateDocumentRequest", this); + std::string result; + + result += PrintPrimitiveField("parent: ", parent, indent + 1, false); + result += PrintPrimitiveField("collection_id: ", + collection_id, indent + 1, false); + result += PrintPrimitiveField("document_id: ", + document_id, indent + 1, false); + result += PrintMessageField("document ", document, indent + 1, false); + result += PrintMessageField("mask ", mask, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_UpdateDocumentRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "UpdateDocumentRequest", this); + std::string result; + + result += PrintMessageField("document ", document, indent + 1, false); + result += PrintMessageField("update_mask ", + update_mask, indent + 1, false); + result += PrintMessageField("mask ", mask, indent + 1, false); + result += PrintMessageField("current_document ", + current_document, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_DeleteDocumentRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "DeleteDocumentRequest", this); + std::string result; + + result += PrintPrimitiveField("name: ", name, indent + 1, false); + result += PrintMessageField("current_document ", + current_document, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_BatchGetDocumentsRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "BatchGetDocumentsRequest", this); + std::string result; + + result += PrintPrimitiveField("database: ", database, indent + 1, false); + for (pb_size_t i = 0; i != documents_count; ++i) { + result += PrintPrimitiveField("documents: ", + documents[i], indent + 1, true); + } + result += PrintMessageField("mask ", mask, indent + 1, false); + switch (which_consistency_selector) { + case google_firestore_v1_BatchGetDocumentsRequest_transaction_tag: + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, true); + break; + case google_firestore_v1_BatchGetDocumentsRequest_new_transaction_tag: + result += PrintMessageField("new_transaction ", + new_transaction, indent + 1, true); + break; + case google_firestore_v1_BatchGetDocumentsRequest_read_time_tag: + result += PrintMessageField("read_time ", read_time, indent + 1, true); + break; + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_BatchGetDocumentsResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "BatchGetDocumentsResponse", this); + std::string result; + + switch (which_result) { + case google_firestore_v1_BatchGetDocumentsResponse_found_tag: + result += PrintMessageField("found ", found, indent + 1, true); + break; + case google_firestore_v1_BatchGetDocumentsResponse_missing_tag: + result += PrintPrimitiveField("missing: ", missing, indent + 1, true); + break; + } + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, false); + result += PrintMessageField("read_time ", read_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_BeginTransactionRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "BeginTransactionRequest", this); + std::string result; + + result += PrintPrimitiveField("database: ", database, indent + 1, false); + result += PrintMessageField("options ", options, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_BeginTransactionResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "BeginTransactionResponse", this); + std::string result; + + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_CommitRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "CommitRequest", this); + std::string result; + + result += PrintPrimitiveField("database: ", database, indent + 1, false); + for (pb_size_t i = 0; i != writes_count; ++i) { + result += PrintMessageField("writes ", writes[i], indent + 1, true); + } + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_CommitResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "CommitResponse", this); + std::string result; + + for (pb_size_t i = 0; i != write_results_count; ++i) { + result += PrintMessageField("write_results ", + write_results[i], indent + 1, true); + } + result += PrintMessageField("commit_time ", + commit_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_RollbackRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "RollbackRequest", this); + std::string result; + + result += PrintPrimitiveField("database: ", database, indent + 1, false); + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_RunQueryRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "RunQueryRequest", this); + std::string result; + + result += PrintPrimitiveField("parent: ", parent, indent + 1, false); + switch (which_query_type) { + case google_firestore_v1_RunQueryRequest_structured_query_tag: + result += PrintMessageField("structured_query ", + query_type.structured_query, indent + 1, true); + break; + } + switch (which_consistency_selector) { + case google_firestore_v1_RunQueryRequest_transaction_tag: + result += PrintPrimitiveField("transaction: ", + consistency_selector.transaction, indent + 1, true); + break; + case google_firestore_v1_RunQueryRequest_new_transaction_tag: + result += PrintMessageField("new_transaction ", + consistency_selector.new_transaction, indent + 1, true); + break; + case google_firestore_v1_RunQueryRequest_read_time_tag: + result += PrintMessageField("read_time ", + consistency_selector.read_time, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_RunQueryResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "RunQueryResponse", this); + std::string result; + + result += PrintMessageField("document ", document, indent + 1, false); + result += PrintPrimitiveField("transaction: ", + transaction, indent + 1, false); + result += PrintMessageField("read_time ", read_time, indent + 1, false); + result += PrintPrimitiveField("skipped_results: ", + skipped_results, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_WriteRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "WriteRequest", this); + std::string result; + + result += PrintPrimitiveField("database: ", database, indent + 1, false); + result += PrintPrimitiveField("stream_id: ", stream_id, indent + 1, false); + for (pb_size_t i = 0; i != writes_count; ++i) { + result += PrintMessageField("writes ", writes[i], indent + 1, true); + } + result += PrintPrimitiveField("stream_token: ", + stream_token, indent + 1, false); + for (pb_size_t i = 0; i != labels_count; ++i) { + result += PrintMessageField("labels ", labels[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_WriteRequest_LabelsEntry::ToString(int indent) const { + std::string header = PrintHeader(indent, "LabelsEntry", this); + std::string result; + + result += PrintPrimitiveField("key: ", key, indent + 1, false); + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_WriteResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "WriteResponse", this); + std::string result; + + result += PrintPrimitiveField("stream_id: ", stream_id, indent + 1, false); + result += PrintPrimitiveField("stream_token: ", + stream_token, indent + 1, false); + for (pb_size_t i = 0; i != write_results_count; ++i) { + result += PrintMessageField("write_results ", + write_results[i], indent + 1, true); + } + result += PrintMessageField("commit_time ", + commit_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_ListenRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListenRequest", this); + std::string result; + + result += PrintPrimitiveField("database: ", database, indent + 1, false); + switch (which_target_change) { + case google_firestore_v1_ListenRequest_add_target_tag: + result += PrintMessageField("add_target ", + add_target, indent + 1, true); + break; + case google_firestore_v1_ListenRequest_remove_target_tag: + result += PrintPrimitiveField("remove_target: ", + remove_target, indent + 1, true); + break; + } + for (pb_size_t i = 0; i != labels_count; ++i) { + result += PrintMessageField("labels ", labels[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_ListenRequest_LabelsEntry::ToString(int indent) const { + std::string header = PrintHeader(indent, "LabelsEntry", this); + std::string result; + + result += PrintPrimitiveField("key: ", key, indent + 1, false); + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_ListenResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListenResponse", this); + std::string result; + + switch (which_response_type) { + case google_firestore_v1_ListenResponse_target_change_tag: + result += PrintMessageField("target_change ", + target_change, indent + 1, true); + break; + case google_firestore_v1_ListenResponse_document_change_tag: + result += PrintMessageField("document_change ", + document_change, indent + 1, true); + break; + case google_firestore_v1_ListenResponse_document_delete_tag: + result += PrintMessageField("document_delete ", + document_delete, indent + 1, true); + break; + case google_firestore_v1_ListenResponse_filter_tag: + result += PrintMessageField("filter ", filter, indent + 1, true); + break; + case google_firestore_v1_ListenResponse_document_remove_tag: + result += PrintMessageField("document_remove ", + document_remove, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_Target::ToString(int indent) const { + std::string header = PrintHeader(indent, "Target", this); + std::string result; + + switch (which_target_type) { + case google_firestore_v1_Target_query_tag: + result += PrintMessageField("query ", + target_type.query, indent + 1, true); + break; + case google_firestore_v1_Target_documents_tag: + result += PrintMessageField("documents ", + target_type.documents, indent + 1, true); + break; + } + switch (which_resume_type) { + case google_firestore_v1_Target_resume_token_tag: + result += PrintPrimitiveField("resume_token: ", + resume_type.resume_token, indent + 1, true); + break; + case google_firestore_v1_Target_read_time_tag: + result += PrintMessageField("read_time ", + resume_type.read_time, indent + 1, true); + break; + } + result += PrintPrimitiveField("target_id: ", target_id, indent + 1, false); + result += PrintPrimitiveField("once: ", once, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_Target_DocumentsTarget::ToString(int indent) const { + std::string header = PrintHeader(indent, "DocumentsTarget", this); + std::string result; + + for (pb_size_t i = 0; i != documents_count; ++i) { + result += PrintPrimitiveField("documents: ", + documents[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_Target_QueryTarget::ToString(int indent) const { + std::string header = PrintHeader(indent, "QueryTarget", this); + std::string result; + + result += PrintPrimitiveField("parent: ", parent, indent + 1, false); + switch (which_query_type) { + case google_firestore_v1_Target_QueryTarget_structured_query_tag: + result += PrintMessageField("structured_query ", + structured_query, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_TargetChange::ToString(int indent) const { + std::string header = PrintHeader(indent, "TargetChange", this); + std::string result; + + result += PrintEnumField("target_change_type: ", + target_change_type, indent + 1, false); + for (pb_size_t i = 0; i != target_ids_count; ++i) { + result += PrintPrimitiveField("target_ids: ", + target_ids[i], indent + 1, true); + } + if (has_cause) { + result += PrintMessageField("cause ", cause, indent + 1, true); + } + result += PrintPrimitiveField("resume_token: ", + resume_token, indent + 1, false); + result += PrintMessageField("read_time ", read_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_ListCollectionIdsRequest::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListCollectionIdsRequest", this); + std::string result; + + result += PrintPrimitiveField("parent: ", parent, indent + 1, false); + result += PrintPrimitiveField("page_size: ", page_size, indent + 1, false); + result += PrintPrimitiveField("page_token: ", + page_token, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_ListCollectionIdsResponse::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListCollectionIdsResponse", this); + std::string result; + + for (pb_size_t i = 0; i != collection_ids_count; ++i) { + result += PrintPrimitiveField("collection_ids: ", + collection_ids[i], indent + 1, true); + } + result += PrintPrimitiveField("next_page_token: ", + next_page_token, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h index 23b08fa28..cbb587299 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_FIRESTORE_V1_FIRESTORE_NANOPB_H_INCLUDED #define PB_GOOGLE_FIRESTORE_V1_FIRESTORE_NANOPB_H_INCLUDED @@ -37,6 +37,8 @@ #include "google/rpc/status.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -61,6 +63,8 @@ typedef enum _google_firestore_v1_TargetChange_TargetChangeType { /* Struct definitions */ typedef struct _google_firestore_v1_BeginTransactionResponse { pb_bytes_array_t *transaction; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_BeginTransactionResponse) */ } google_firestore_v1_BeginTransactionResponse; @@ -69,6 +73,8 @@ typedef struct _google_firestore_v1_CommitRequest { pb_size_t writes_count; struct _google_firestore_v1_Write *writes; pb_bytes_array_t *transaction; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_CommitRequest) */ } google_firestore_v1_CommitRequest; @@ -76,6 +82,8 @@ typedef struct _google_firestore_v1_ListCollectionIdsResponse { pb_size_t collection_ids_count; pb_bytes_array_t **collection_ids; pb_bytes_array_t *next_page_token; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListCollectionIdsResponse) */ } google_firestore_v1_ListCollectionIdsResponse; @@ -83,24 +91,32 @@ typedef struct _google_firestore_v1_ListDocumentsResponse { pb_size_t documents_count; struct _google_firestore_v1_Document *documents; pb_bytes_array_t *next_page_token; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListDocumentsResponse) */ } google_firestore_v1_ListDocumentsResponse; typedef struct _google_firestore_v1_ListenRequest_LabelsEntry { pb_bytes_array_t *key; pb_bytes_array_t *value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListenRequest_LabelsEntry) */ } google_firestore_v1_ListenRequest_LabelsEntry; typedef struct _google_firestore_v1_RollbackRequest { pb_bytes_array_t *database; pb_bytes_array_t *transaction; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_RollbackRequest) */ } google_firestore_v1_RollbackRequest; typedef struct _google_firestore_v1_Target_DocumentsTarget { pb_size_t documents_count; pb_bytes_array_t **documents; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Target_DocumentsTarget) */ } google_firestore_v1_Target_DocumentsTarget; @@ -112,12 +128,16 @@ typedef struct _google_firestore_v1_WriteRequest { pb_bytes_array_t *stream_token; pb_size_t labels_count; struct _google_firestore_v1_WriteRequest_LabelsEntry *labels; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_WriteRequest) */ } google_firestore_v1_WriteRequest; typedef struct _google_firestore_v1_WriteRequest_LabelsEntry { pb_bytes_array_t *key; pb_bytes_array_t *value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_WriteRequest_LabelsEntry) */ } google_firestore_v1_WriteRequest_LabelsEntry; @@ -132,6 +152,8 @@ typedef struct _google_firestore_v1_BatchGetDocumentsRequest { google_firestore_v1_TransactionOptions new_transaction; google_protobuf_Timestamp read_time; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_BatchGetDocumentsRequest) */ } google_firestore_v1_BatchGetDocumentsRequest; @@ -143,12 +165,16 @@ typedef struct _google_firestore_v1_BatchGetDocumentsResponse { }; pb_bytes_array_t *transaction; google_protobuf_Timestamp read_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_BatchGetDocumentsResponse) */ } google_firestore_v1_BatchGetDocumentsResponse; typedef struct _google_firestore_v1_BeginTransactionRequest { pb_bytes_array_t *database; google_firestore_v1_TransactionOptions options; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_BeginTransactionRequest) */ } google_firestore_v1_BeginTransactionRequest; @@ -156,6 +182,8 @@ typedef struct _google_firestore_v1_CommitResponse { pb_size_t write_results_count; struct _google_firestore_v1_WriteResult *write_results; google_protobuf_Timestamp commit_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_CommitResponse) */ } google_firestore_v1_CommitResponse; @@ -165,12 +193,16 @@ typedef struct _google_firestore_v1_CreateDocumentRequest { pb_bytes_array_t *document_id; google_firestore_v1_Document document; google_firestore_v1_DocumentMask mask; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_CreateDocumentRequest) */ } google_firestore_v1_CreateDocumentRequest; typedef struct _google_firestore_v1_DeleteDocumentRequest { pb_bytes_array_t *name; google_firestore_v1_Precondition current_document; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DeleteDocumentRequest) */ } google_firestore_v1_DeleteDocumentRequest; @@ -182,6 +214,8 @@ typedef struct _google_firestore_v1_GetDocumentRequest { pb_bytes_array_t *transaction; google_protobuf_Timestamp read_time; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_GetDocumentRequest) */ } google_firestore_v1_GetDocumentRequest; @@ -189,6 +223,8 @@ typedef struct _google_firestore_v1_ListCollectionIdsRequest { pb_bytes_array_t *parent; int32_t page_size; pb_bytes_array_t *page_token; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListCollectionIdsRequest) */ } google_firestore_v1_ListCollectionIdsRequest; @@ -205,6 +241,8 @@ typedef struct _google_firestore_v1_ListDocumentsRequest { google_protobuf_Timestamp read_time; }; bool show_missing; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListDocumentsRequest) */ } google_firestore_v1_ListDocumentsRequest; @@ -220,6 +258,8 @@ typedef struct _google_firestore_v1_RunQueryRequest { google_firestore_v1_TransactionOptions new_transaction; google_protobuf_Timestamp read_time; } consistency_selector; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_RunQueryRequest) */ } google_firestore_v1_RunQueryRequest; @@ -228,6 +268,8 @@ typedef struct _google_firestore_v1_RunQueryResponse { pb_bytes_array_t *transaction; google_protobuf_Timestamp read_time; int32_t skipped_results; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_RunQueryResponse) */ } google_firestore_v1_RunQueryResponse; @@ -239,6 +281,8 @@ typedef struct _google_firestore_v1_TargetChange { google_rpc_Status cause; pb_bytes_array_t *resume_token; google_protobuf_Timestamp read_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_TargetChange) */ } google_firestore_v1_TargetChange; @@ -248,6 +292,8 @@ typedef struct _google_firestore_v1_Target_QueryTarget { union { google_firestore_v1_StructuredQuery structured_query; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Target_QueryTarget) */ } google_firestore_v1_Target_QueryTarget; @@ -256,6 +302,8 @@ typedef struct _google_firestore_v1_UpdateDocumentRequest { google_firestore_v1_DocumentMask update_mask; google_firestore_v1_DocumentMask mask; google_firestore_v1_Precondition current_document; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_UpdateDocumentRequest) */ } google_firestore_v1_UpdateDocumentRequest; @@ -265,6 +313,8 @@ typedef struct _google_firestore_v1_WriteResponse { pb_size_t write_results_count; struct _google_firestore_v1_WriteResult *write_results; google_protobuf_Timestamp commit_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_WriteResponse) */ } google_firestore_v1_WriteResponse; @@ -277,6 +327,8 @@ typedef struct _google_firestore_v1_ListenResponse { google_firestore_v1_ExistenceFilter filter; google_firestore_v1_DocumentRemove document_remove; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListenResponse) */ } google_firestore_v1_ListenResponse; @@ -293,6 +345,8 @@ typedef struct _google_firestore_v1_Target { } resume_type; int32_t target_id; bool once; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Target) */ } google_firestore_v1_Target; @@ -305,6 +359,8 @@ typedef struct _google_firestore_v1_ListenRequest { }; pb_size_t labels_count; struct _google_firestore_v1_ListenRequest_LabelsEntry *labels; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ListenRequest) */ } google_firestore_v1_ListenRequest; @@ -530,6 +586,8 @@ extern const pb_field_t google_firestore_v1_ListCollectionIdsResponse_fields[3]; #endif +const char* EnumToString( + google_firestore_v1_TargetChange_TargetChangeType value); } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc index d335beb58..96f899e2b 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "query.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -124,6 +132,258 @@ PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_StructuredQuery, select) < 2 #endif +const char* EnumToString( + google_firestore_v1_StructuredQuery_Direction value) { + switch (value) { + case google_firestore_v1_StructuredQuery_Direction_DIRECTION_UNSPECIFIED: + return "DIRECTION_UNSPECIFIED"; + case google_firestore_v1_StructuredQuery_Direction_ASCENDING: + return "ASCENDING"; + case google_firestore_v1_StructuredQuery_Direction_DESCENDING: + return "DESCENDING"; + } + return ""; +} + +const char* EnumToString( + google_firestore_v1_StructuredQuery_CompositeFilter_Operator value) { + switch (value) { + case google_firestore_v1_StructuredQuery_CompositeFilter_Operator_OPERATOR_UNSPECIFIED: + return "OPERATOR_UNSPECIFIED"; + case google_firestore_v1_StructuredQuery_CompositeFilter_Operator_AND: + return "AND"; + } + return ""; +} + +const char* EnumToString( + google_firestore_v1_StructuredQuery_FieldFilter_Operator value) { + switch (value) { + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_OPERATOR_UNSPECIFIED: + return "OPERATOR_UNSPECIFIED"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN: + return "LESS_THAN"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_LESS_THAN_OR_EQUAL: + return "LESS_THAN_OR_EQUAL"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN: + return "GREATER_THAN"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN_OR_EQUAL: + return "GREATER_THAN_OR_EQUAL"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_EQUAL: + return "EQUAL"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_EQUAL: + return "NOT_EQUAL"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS: + return "ARRAY_CONTAINS"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_IN: + return "IN"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY: + return "ARRAY_CONTAINS_ANY"; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN: + return "NOT_IN"; + } + return ""; +} + +const char* EnumToString( + google_firestore_v1_StructuredQuery_UnaryFilter_Operator value) { + switch (value) { + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_OPERATOR_UNSPECIFIED: + return "OPERATOR_UNSPECIFIED"; + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN: + return "IS_NAN"; + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL: + return "IS_NULL"; + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN: + return "IS_NOT_NAN"; + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL: + return "IS_NOT_NULL"; + } + return ""; +} + +std::string google_firestore_v1_StructuredQuery::ToString(int indent) const { + std::string header = PrintHeader(indent, "StructuredQuery", this); + std::string result; + + result += PrintMessageField("select ", select, indent + 1, false); + for (pb_size_t i = 0; i != from_count; ++i) { + result += PrintMessageField("from ", from[i], indent + 1, true); + } + result += PrintMessageField("where ", where, indent + 1, false); + for (pb_size_t i = 0; i != order_by_count; ++i) { + result += PrintMessageField("order_by ", + order_by[i], indent + 1, true); + } + if (has_limit) { + result += PrintMessageField("limit ", limit, indent + 1, true); + } + result += PrintPrimitiveField("offset: ", offset, indent + 1, false); + result += PrintMessageField("start_at ", start_at, indent + 1, false); + result += PrintMessageField("end_at ", end_at, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_StructuredQuery_CollectionSelector::ToString(int indent) const { + std::string header = PrintHeader(indent, "CollectionSelector", this); + std::string result; + + result += PrintPrimitiveField("collection_id: ", + collection_id, indent + 1, false); + result += PrintPrimitiveField("all_descendants: ", + all_descendants, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_StructuredQuery_Filter::ToString(int indent) const { + std::string header = PrintHeader(indent, "Filter", this); + std::string result; + + switch (which_filter_type) { + case google_firestore_v1_StructuredQuery_Filter_composite_filter_tag: + result += PrintMessageField("composite_filter ", + composite_filter, indent + 1, true); + break; + case google_firestore_v1_StructuredQuery_Filter_field_filter_tag: + result += PrintMessageField("field_filter ", + field_filter, indent + 1, true); + break; + case google_firestore_v1_StructuredQuery_Filter_unary_filter_tag: + result += PrintMessageField("unary_filter ", + unary_filter, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_StructuredQuery_CompositeFilter::ToString(int indent) const { + std::string header = PrintHeader(indent, "CompositeFilter", this); + std::string result; + + result += PrintEnumField("op: ", op, indent + 1, false); + for (pb_size_t i = 0; i != filters_count; ++i) { + result += PrintMessageField("filters ", filters[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_StructuredQuery_FieldFilter::ToString(int indent) const { + std::string header = PrintHeader(indent, "FieldFilter", this); + std::string result; + + result += PrintMessageField("field ", field, indent + 1, false); + result += PrintEnumField("op: ", op, indent + 1, false); + result += PrintMessageField("value ", value, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_StructuredQuery_UnaryFilter::ToString(int indent) const { + std::string header = PrintHeader(indent, "UnaryFilter", this); + std::string result; + + result += PrintEnumField("op: ", op, indent + 1, false); + switch (which_operand_type) { + case google_firestore_v1_StructuredQuery_UnaryFilter_field_tag: + result += PrintMessageField("field ", field, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_StructuredQuery_Order::ToString(int indent) const { + std::string header = PrintHeader(indent, "Order", this); + std::string result; + + result += PrintMessageField("field ", field, indent + 1, false); + result += PrintEnumField("direction: ", direction, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_StructuredQuery_FieldReference::ToString(int indent) const { + std::string header = PrintHeader(indent, "FieldReference", this); + std::string result; + + result += PrintPrimitiveField("field_path: ", + field_path, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_StructuredQuery_Projection::ToString(int indent) const { + std::string header = PrintHeader(indent, "Projection", this); + std::string result; + + for (pb_size_t i = 0; i != fields_count; ++i) { + result += PrintMessageField("fields ", fields[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_Cursor::ToString(int indent) const { + std::string header = PrintHeader(indent, "Cursor", this); + std::string result; + + for (pb_size_t i = 0; i != values_count; ++i) { + result += PrintMessageField("values ", values[i], indent + 1, true); + } + result += PrintPrimitiveField("before: ", before, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h index 80d6aa932..bb0e91075 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/query.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_FIRESTORE_V1_QUERY_NANOPB_H_INCLUDED #define PB_GOOGLE_FIRESTORE_V1_QUERY_NANOPB_H_INCLUDED @@ -27,6 +27,8 @@ #include "google/protobuf/wrappers.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -61,32 +63,40 @@ typedef enum _google_firestore_v1_StructuredQuery_FieldFilter_Operator { google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN = 3, google_firestore_v1_StructuredQuery_FieldFilter_Operator_GREATER_THAN_OR_EQUAL = 4, google_firestore_v1_StructuredQuery_FieldFilter_Operator_EQUAL = 5, + google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_EQUAL = 6, google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS = 7, google_firestore_v1_StructuredQuery_FieldFilter_Operator_IN = 8, - google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY = 9 + google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY = 9, + google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN = 10 } google_firestore_v1_StructuredQuery_FieldFilter_Operator; #define _google_firestore_v1_StructuredQuery_FieldFilter_Operator_MIN google_firestore_v1_StructuredQuery_FieldFilter_Operator_OPERATOR_UNSPECIFIED -#define _google_firestore_v1_StructuredQuery_FieldFilter_Operator_MAX google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY -#define _google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAYSIZE ((google_firestore_v1_StructuredQuery_FieldFilter_Operator)(google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY+1)) +#define _google_firestore_v1_StructuredQuery_FieldFilter_Operator_MAX google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN +#define _google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAYSIZE ((google_firestore_v1_StructuredQuery_FieldFilter_Operator)(google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN+1)) typedef enum _google_firestore_v1_StructuredQuery_UnaryFilter_Operator { google_firestore_v1_StructuredQuery_UnaryFilter_Operator_OPERATOR_UNSPECIFIED = 0, google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN = 2, - google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL = 3 + google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL = 3, + google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN = 4, + google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL = 5 } google_firestore_v1_StructuredQuery_UnaryFilter_Operator; #define _google_firestore_v1_StructuredQuery_UnaryFilter_Operator_MIN google_firestore_v1_StructuredQuery_UnaryFilter_Operator_OPERATOR_UNSPECIFIED -#define _google_firestore_v1_StructuredQuery_UnaryFilter_Operator_MAX google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL -#define _google_firestore_v1_StructuredQuery_UnaryFilter_Operator_ARRAYSIZE ((google_firestore_v1_StructuredQuery_UnaryFilter_Operator)(google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL+1)) +#define _google_firestore_v1_StructuredQuery_UnaryFilter_Operator_MAX google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL +#define _google_firestore_v1_StructuredQuery_UnaryFilter_Operator_ARRAYSIZE ((google_firestore_v1_StructuredQuery_UnaryFilter_Operator)(google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL+1)) /* Struct definitions */ typedef struct _google_firestore_v1_StructuredQuery_FieldReference { pb_bytes_array_t *field_path; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_FieldReference) */ } google_firestore_v1_StructuredQuery_FieldReference; typedef struct _google_firestore_v1_StructuredQuery_Projection { pb_size_t fields_count; struct _google_firestore_v1_StructuredQuery_FieldReference *fields; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_Projection) */ } google_firestore_v1_StructuredQuery_Projection; @@ -94,12 +104,16 @@ typedef struct _google_firestore_v1_Cursor { pb_size_t values_count; struct _google_firestore_v1_Value *values; bool before; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Cursor) */ } google_firestore_v1_Cursor; typedef struct _google_firestore_v1_StructuredQuery_CollectionSelector { pb_bytes_array_t *collection_id; bool all_descendants; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_CollectionSelector) */ } google_firestore_v1_StructuredQuery_CollectionSelector; @@ -107,6 +121,8 @@ typedef struct _google_firestore_v1_StructuredQuery_CompositeFilter { google_firestore_v1_StructuredQuery_CompositeFilter_Operator op; pb_size_t filters_count; struct _google_firestore_v1_StructuredQuery_Filter *filters; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_CompositeFilter) */ } google_firestore_v1_StructuredQuery_CompositeFilter; @@ -114,12 +130,16 @@ typedef struct _google_firestore_v1_StructuredQuery_FieldFilter { google_firestore_v1_StructuredQuery_FieldReference field; google_firestore_v1_StructuredQuery_FieldFilter_Operator op; google_firestore_v1_Value value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_FieldFilter) */ } google_firestore_v1_StructuredQuery_FieldFilter; typedef struct _google_firestore_v1_StructuredQuery_Order { google_firestore_v1_StructuredQuery_FieldReference field; google_firestore_v1_StructuredQuery_Direction direction; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_Order) */ } google_firestore_v1_StructuredQuery_Order; @@ -129,6 +149,8 @@ typedef struct _google_firestore_v1_StructuredQuery_UnaryFilter { union { google_firestore_v1_StructuredQuery_FieldReference field; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_UnaryFilter) */ } google_firestore_v1_StructuredQuery_UnaryFilter; @@ -139,6 +161,8 @@ typedef struct _google_firestore_v1_StructuredQuery_Filter { google_firestore_v1_StructuredQuery_FieldFilter field_filter; google_firestore_v1_StructuredQuery_UnaryFilter unary_filter; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery_Filter) */ } google_firestore_v1_StructuredQuery_Filter; @@ -154,6 +178,8 @@ typedef struct _google_firestore_v1_StructuredQuery { int32_t offset; google_firestore_v1_Cursor start_at; google_firestore_v1_Cursor end_at; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_StructuredQuery) */ } google_firestore_v1_StructuredQuery; @@ -241,6 +267,13 @@ extern const pb_field_t google_firestore_v1_Cursor_fields[3]; #endif +const char* EnumToString(google_firestore_v1_StructuredQuery_Direction value); +const char* EnumToString( + google_firestore_v1_StructuredQuery_CompositeFilter_Operator value); +const char* EnumToString( + google_firestore_v1_StructuredQuery_FieldFilter_Operator value); +const char* EnumToString( + google_firestore_v1_StructuredQuery_UnaryFilter_Operator value); } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc index 1b1164512..9b76f26ef 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "write.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -29,9 +37,10 @@ namespace firestore { -const pb_field_t google_firestore_v1_Write_fields[6] = { +const pb_field_t google_firestore_v1_Write_fields[7] = { PB_ANONYMOUS_ONEOF_FIELD(operation, 1, MESSAGE , ONEOF, STATIC , FIRST, google_firestore_v1_Write, update, update, &google_firestore_v1_Document_fields), PB_ANONYMOUS_ONEOF_FIELD(operation, 2, BYTES , ONEOF, POINTER , UNION, google_firestore_v1_Write, delete_, delete_, 0), + PB_ANONYMOUS_ONEOF_FIELD(operation, 5, BYTES , ONEOF, POINTER , UNION, google_firestore_v1_Write, verify, verify, 0), PB_ANONYMOUS_ONEOF_FIELD(operation, 6, MESSAGE , ONEOF, STATIC , UNION, google_firestore_v1_Write, transform, transform, &google_firestore_v1_DocumentTransform_fields), PB_FIELD( 3, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_Write, update_mask, transform, &google_firestore_v1_DocumentMask_fields), PB_FIELD( 4, MESSAGE , OPTIONAL, STATIC , OTHER, google_firestore_v1_Write, current_document, update_mask, &google_firestore_v1_Precondition_fields), @@ -114,6 +123,189 @@ PB_STATIC_ASSERT((pb_membersize(google_firestore_v1_Write, update) < 256 && pb_m #endif +const char* EnumToString( + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue value) { + switch (value) { + case google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_SERVER_VALUE_UNSPECIFIED: + return "SERVER_VALUE_UNSPECIFIED"; + case google_firestore_v1_DocumentTransform_FieldTransform_ServerValue_REQUEST_TIME: + return "REQUEST_TIME"; + } + return ""; +} + +std::string google_firestore_v1_Write::ToString(int indent) const { + std::string header = PrintHeader(indent, "Write", this); + std::string result; + + switch (which_operation) { + case google_firestore_v1_Write_update_tag: + result += PrintMessageField("update ", update, indent + 1, true); + break; + case google_firestore_v1_Write_delete_tag: + result += PrintPrimitiveField("delete: ", delete_, indent + 1, true); + break; + case google_firestore_v1_Write_verify_tag: + result += PrintPrimitiveField("verify: ", verify, indent + 1, true); + break; + case google_firestore_v1_Write_transform_tag: + result += PrintMessageField("transform ", transform, indent + 1, true); + break; + } + if (has_update_mask) { + result += PrintMessageField("update_mask ", + update_mask, indent + 1, true); + } + if (has_current_document) { + result += PrintMessageField("current_document ", + current_document, indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_DocumentTransform::ToString(int indent) const { + std::string header = PrintHeader(indent, "DocumentTransform", this); + std::string result; + + result += PrintPrimitiveField("document: ", document, indent + 1, false); + for (pb_size_t i = 0; i != field_transforms_count; ++i) { + result += PrintMessageField("field_transforms ", + field_transforms[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_DocumentTransform_FieldTransform::ToString(int indent) const { + std::string header = PrintHeader(indent, "FieldTransform", this); + std::string result; + + result += PrintPrimitiveField("field_path: ", + field_path, indent + 1, false); + switch (which_transform_type) { + case google_firestore_v1_DocumentTransform_FieldTransform_set_to_server_value_tag: + result += PrintEnumField("set_to_server_value: ", + set_to_server_value, indent + 1, true); + break; + case google_firestore_v1_DocumentTransform_FieldTransform_increment_tag: + result += PrintMessageField("increment ", increment, indent + 1, true); + break; + case google_firestore_v1_DocumentTransform_FieldTransform_maximum_tag: + result += PrintMessageField("maximum ", maximum, indent + 1, true); + break; + case google_firestore_v1_DocumentTransform_FieldTransform_minimum_tag: + result += PrintMessageField("minimum ", minimum, indent + 1, true); + break; + case google_firestore_v1_DocumentTransform_FieldTransform_append_missing_elements_tag: + result += PrintMessageField("append_missing_elements ", + append_missing_elements, indent + 1, true); + break; + case google_firestore_v1_DocumentTransform_FieldTransform_remove_all_from_array_tag: + result += PrintMessageField("remove_all_from_array ", + remove_all_from_array, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_firestore_v1_WriteResult::ToString(int indent) const { + std::string header = PrintHeader(indent, "WriteResult", this); + std::string result; + + if (has_update_time) { + result += PrintMessageField("update_time ", + update_time, indent + 1, true); + } + for (pb_size_t i = 0; i != transform_results_count; ++i) { + result += PrintMessageField("transform_results ", + transform_results[i], indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_DocumentChange::ToString(int indent) const { + std::string header = PrintHeader(indent, "DocumentChange", this); + std::string result; + + result += PrintMessageField("document ", document, indent + 1, false); + for (pb_size_t i = 0; i != target_ids_count; ++i) { + result += PrintPrimitiveField("target_ids: ", + target_ids[i], indent + 1, true); + } + for (pb_size_t i = 0; i != removed_target_ids_count; ++i) { + result += PrintPrimitiveField("removed_target_ids: ", + removed_target_ids[i], indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_DocumentDelete::ToString(int indent) const { + std::string header = PrintHeader(indent, "DocumentDelete", this); + std::string result; + + result += PrintPrimitiveField("document: ", document, indent + 1, false); + if (has_read_time) { + result += PrintMessageField("read_time ", read_time, indent + 1, true); + } + for (pb_size_t i = 0; i != removed_target_ids_count; ++i) { + result += PrintPrimitiveField("removed_target_ids: ", + removed_target_ids[i], indent + 1, true); + } + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_DocumentRemove::ToString(int indent) const { + std::string header = PrintHeader(indent, "DocumentRemove", this); + std::string result; + + result += PrintPrimitiveField("document: ", document, indent + 1, false); + for (pb_size_t i = 0; i != removed_target_ids_count; ++i) { + result += PrintPrimitiveField("removed_target_ids: ", + removed_target_ids[i], indent + 1, true); + } + result += PrintMessageField("read_time ", read_time, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_firestore_v1_ExistenceFilter::ToString(int indent) const { + std::string header = PrintHeader(indent, "ExistenceFilter", this); + std::string result; + + result += PrintPrimitiveField("target_id: ", target_id, indent + 1, false); + result += PrintPrimitiveField("count: ", count, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h index 2c4e1319c..7dabde37b 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/firestore/v1/write.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_FIRESTORE_V1_WRITE_NANOPB_H_INCLUDED #define PB_GOOGLE_FIRESTORE_V1_WRITE_NANOPB_H_INCLUDED @@ -29,6 +29,8 @@ #include "google/protobuf/timestamp.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -52,6 +54,8 @@ typedef struct _google_firestore_v1_DocumentTransform { pb_bytes_array_t *document; pb_size_t field_transforms_count; struct _google_firestore_v1_DocumentTransform_FieldTransform *field_transforms; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DocumentTransform) */ } google_firestore_v1_DocumentTransform; @@ -61,6 +65,8 @@ typedef struct _google_firestore_v1_DocumentChange { int32_t *target_ids; pb_size_t removed_target_ids_count; int32_t *removed_target_ids; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DocumentChange) */ } google_firestore_v1_DocumentChange; @@ -70,6 +76,8 @@ typedef struct _google_firestore_v1_DocumentDelete { google_protobuf_Timestamp read_time; pb_size_t removed_target_ids_count; int32_t *removed_target_ids; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DocumentDelete) */ } google_firestore_v1_DocumentDelete; @@ -78,6 +86,8 @@ typedef struct _google_firestore_v1_DocumentRemove { pb_size_t removed_target_ids_count; int32_t *removed_target_ids; google_protobuf_Timestamp read_time; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DocumentRemove) */ } google_firestore_v1_DocumentRemove; @@ -92,12 +102,16 @@ typedef struct _google_firestore_v1_DocumentTransform_FieldTransform { google_firestore_v1_ArrayValue append_missing_elements; google_firestore_v1_ArrayValue remove_all_from_array; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_DocumentTransform_FieldTransform) */ } google_firestore_v1_DocumentTransform_FieldTransform; typedef struct _google_firestore_v1_ExistenceFilter { int32_t target_id; int32_t count; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_ExistenceFilter) */ } google_firestore_v1_ExistenceFilter; @@ -106,12 +120,15 @@ typedef struct _google_firestore_v1_Write { union { google_firestore_v1_Document update; pb_bytes_array_t *delete_; + pb_bytes_array_t *verify; google_firestore_v1_DocumentTransform transform; }; bool has_update_mask; google_firestore_v1_DocumentMask update_mask; bool has_current_document; google_firestore_v1_Precondition current_document; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_Write) */ } google_firestore_v1_Write; @@ -120,6 +137,8 @@ typedef struct _google_firestore_v1_WriteResult { google_protobuf_Timestamp update_time; pb_size_t transform_results_count; struct _google_firestore_v1_Value *transform_results; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_firestore_v1_WriteResult) */ } google_firestore_v1_WriteResult; @@ -166,6 +185,7 @@ typedef struct _google_firestore_v1_WriteResult { #define google_firestore_v1_ExistenceFilter_count_tag 2 #define google_firestore_v1_Write_update_tag 1 #define google_firestore_v1_Write_delete_tag 2 +#define google_firestore_v1_Write_verify_tag 5 #define google_firestore_v1_Write_transform_tag 6 #define google_firestore_v1_Write_update_mask_tag 3 #define google_firestore_v1_Write_current_document_tag 4 @@ -173,7 +193,7 @@ typedef struct _google_firestore_v1_WriteResult { #define google_firestore_v1_WriteResult_transform_results_tag 2 /* Struct field encoding specification for nanopb */ -extern const pb_field_t google_firestore_v1_Write_fields[6]; +extern const pb_field_t google_firestore_v1_Write_fields[7]; extern const pb_field_t google_firestore_v1_DocumentTransform_fields[3]; extern const pb_field_t google_firestore_v1_DocumentTransform_FieldTransform_fields[8]; extern const pb_field_t google_firestore_v1_WriteResult_fields[3]; @@ -200,6 +220,8 @@ extern const pb_field_t google_firestore_v1_ExistenceFilter_fields[3]; #endif +const char* EnumToString( + google_firestore_v1_DocumentTransform_FieldTransform_ServerValue value); } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc index 40ba9f4d3..104e3995d 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "any.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -36,6 +44,22 @@ const pb_field_t google_protobuf_Any_fields[3] = { }; +std::string google_protobuf_Any::ToString(int indent) const { + std::string header = PrintHeader(indent, "Any", this); + std::string result; + + result += PrintPrimitiveField("type_url: ", type_url, indent + 1, false); + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h index 9d506d2dd..9de64e82b 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/any.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_PROTOBUF_ANY_NANOPB_H_INCLUDED #define PB_GOOGLE_PROTOBUF_ANY_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -34,6 +36,8 @@ namespace firestore { typedef struct _google_protobuf_Any { pb_bytes_array_t *type_url; pb_bytes_array_t *value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Any) */ } google_protobuf_Any; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc index 364ac4a7b..99fa29182 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "empty.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -34,6 +42,20 @@ const pb_field_t google_protobuf_Empty_fields[1] = { }; +std::string google_protobuf_Empty::ToString(int indent) const { + std::string header = PrintHeader(indent, "Empty", this); + std::string result; + + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h index b0e20e881..4953f1408 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/empty.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_PROTOBUF_EMPTY_NANOPB_H_INCLUDED #define PB_GOOGLE_PROTOBUF_EMPTY_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -33,6 +35,8 @@ namespace firestore { /* Struct definitions */ typedef struct _google_protobuf_Empty { char dummy_field; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Empty) */ } google_protobuf_Empty; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc index 36f2d09a4..ed72e7586 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "struct.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -81,6 +89,99 @@ PB_STATIC_ASSERT((pb_membersize(google_protobuf_Struct_FieldsEntry, value) < 256 #endif +const char* EnumToString( + google_protobuf_NullValue value) { + switch (value) { + case google_protobuf_NullValue_NULL_VALUE: + return "NULL_VALUE"; + } + return ""; +} + +std::string google_protobuf_Struct::ToString(int indent) const { + std::string header = PrintHeader(indent, "Struct", this); + std::string result; + + for (pb_size_t i = 0; i != fields_count; ++i) { + result += PrintMessageField("fields ", fields[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_Struct_FieldsEntry::ToString(int indent) const { + std::string header = PrintHeader(indent, "FieldsEntry", this); + std::string result; + + result += PrintPrimitiveField("key: ", key, indent + 1, false); + result += PrintMessageField("value ", value, indent + 1, false); + + std::string tail = PrintTail(indent); + return header + result + tail; +} + +std::string google_protobuf_Value::ToString(int indent) const { + std::string header = PrintHeader(indent, "Value", this); + std::string result; + + switch (which_kind) { + case google_protobuf_Value_null_value_tag: + result += PrintEnumField("null_value: ", null_value, indent + 1, true); + break; + case google_protobuf_Value_number_value_tag: + result += PrintPrimitiveField("number_value: ", + number_value, indent + 1, true); + break; + case google_protobuf_Value_string_value_tag: + result += PrintPrimitiveField("string_value: ", + string_value, indent + 1, true); + break; + case google_protobuf_Value_bool_value_tag: + result += PrintPrimitiveField("bool_value: ", + bool_value, indent + 1, true); + break; + case google_protobuf_Value_struct_value_tag: + result += PrintMessageField("struct_value ", + struct_value, indent + 1, true); + break; + case google_protobuf_Value_list_value_tag: + result += PrintMessageField("list_value ", + list_value, indent + 1, true); + break; + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_ListValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "ListValue", this); + std::string result; + + for (pb_size_t i = 0; i != values_count; ++i) { + result += PrintMessageField("values ", values[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h index d57345819..71794c91e 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/struct.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_PROTOBUF_STRUCT_NANOPB_H_INCLUDED #define PB_GOOGLE_PROTOBUF_STRUCT_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -42,12 +44,16 @@ typedef enum _google_protobuf_NullValue { typedef struct _google_protobuf_ListValue { pb_size_t values_count; struct _google_protobuf_Value *values; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_ListValue) */ } google_protobuf_ListValue; typedef struct _google_protobuf_Struct { pb_size_t fields_count; struct _google_protobuf_Struct_FieldsEntry *fields; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Struct) */ } google_protobuf_Struct; @@ -61,12 +67,16 @@ typedef struct _google_protobuf_Value { google_protobuf_Struct struct_value; google_protobuf_ListValue list_value; }; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Value) */ } google_protobuf_Value; typedef struct _google_protobuf_Struct_FieldsEntry { pb_bytes_array_t *key; google_protobuf_Value value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Struct_FieldsEntry) */ } google_protobuf_Struct_FieldsEntry; @@ -114,6 +124,7 @@ extern const pb_field_t google_protobuf_ListValue_fields[2]; #endif +const char* EnumToString(google_protobuf_NullValue value); } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc index 6bdf8daa3..bc0b0e149 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "timestamp.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -36,6 +44,22 @@ const pb_field_t google_protobuf_Timestamp_fields[3] = { }; +std::string google_protobuf_Timestamp::ToString(int indent) const { + std::string header = PrintHeader(indent, "Timestamp", this); + std::string result; + + result += PrintPrimitiveField("seconds: ", seconds, indent + 1, false); + result += PrintPrimitiveField("nanos: ", nanos, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h index e826e0693..6c89b96ed 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/timestamp.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_PROTOBUF_TIMESTAMP_NANOPB_H_INCLUDED #define PB_GOOGLE_PROTOBUF_TIMESTAMP_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -34,6 +36,8 @@ namespace firestore { typedef struct _google_protobuf_Timestamp { int64_t seconds; int32_t nanos; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Timestamp) */ } google_protobuf_Timestamp; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc index ba0611d3f..fc30d3136 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "wrappers.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -81,6 +89,141 @@ const pb_field_t google_protobuf_BytesValue_fields[2] = { */ PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) +std::string google_protobuf_DoubleValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "DoubleValue", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_FloatValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "FloatValue", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_Int64Value::ToString(int indent) const { + std::string header = PrintHeader(indent, "Int64Value", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_UInt64Value::ToString(int indent) const { + std::string header = PrintHeader(indent, "UInt64Value", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_Int32Value::ToString(int indent) const { + std::string header = PrintHeader(indent, "Int32Value", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_UInt32Value::ToString(int indent) const { + std::string header = PrintHeader(indent, "UInt32Value", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_BoolValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "BoolValue", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_StringValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "StringValue", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + +std::string google_protobuf_BytesValue::ToString(int indent) const { + std::string header = PrintHeader(indent, "BytesValue", this); + std::string result; + + result += PrintPrimitiveField("value: ", value, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h index b582199de..398a0873a 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/protobuf/wrappers.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_PROTOBUF_WRAPPERS_NANOPB_H_INCLUDED #define PB_GOOGLE_PROTOBUF_WRAPPERS_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -33,46 +35,64 @@ namespace firestore { /* Struct definitions */ typedef struct _google_protobuf_BytesValue { pb_bytes_array_t *value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_BytesValue) */ } google_protobuf_BytesValue; typedef struct _google_protobuf_StringValue { pb_bytes_array_t *value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_StringValue) */ } google_protobuf_StringValue; typedef struct _google_protobuf_BoolValue { bool value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_BoolValue) */ } google_protobuf_BoolValue; typedef struct _google_protobuf_DoubleValue { double value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_DoubleValue) */ } google_protobuf_DoubleValue; typedef struct _google_protobuf_FloatValue { float value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_FloatValue) */ } google_protobuf_FloatValue; typedef struct _google_protobuf_Int32Value { int32_t value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Int32Value) */ } google_protobuf_Int32Value; typedef struct _google_protobuf_Int64Value { int64_t value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_Int64Value) */ } google_protobuf_Int64Value; typedef struct _google_protobuf_UInt32Value { uint32_t value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_UInt32Value) */ } google_protobuf_UInt32Value; typedef struct _google_protobuf_UInt64Value { uint64_t value; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_protobuf_UInt64Value) */ } google_protobuf_UInt64Value; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc index 396e106bc..cda1032e0 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "status.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -37,6 +45,25 @@ const pb_field_t google_rpc_Status_fields[4] = { }; +std::string google_rpc_Status::ToString(int indent) const { + std::string header = PrintHeader(indent, "Status", this); + std::string result; + + result += PrintPrimitiveField("code: ", code, indent + 1, false); + result += PrintPrimitiveField("message: ", message, indent + 1, false); + for (pb_size_t i = 0; i != details_count; ++i) { + result += PrintMessageField("details ", details[i], indent + 1, true); + } + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h index 72e9651e1..250f55297 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/rpc/status.nanopb.h @@ -15,7 +15,7 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_RPC_STATUS_NANOPB_H_INCLUDED #define PB_GOOGLE_RPC_STATUS_NANOPB_H_INCLUDED @@ -23,6 +23,8 @@ #include "google/protobuf/any.nanopb.h" +#include + namespace firebase { namespace firestore { @@ -38,6 +40,8 @@ typedef struct _google_rpc_Status { pb_bytes_array_t *message; pb_size_t details_count; struct _google_protobuf_Any *details; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_rpc_Status) */ } google_rpc_Status; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc index eac6aff5c..52881f0d4 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.cc @@ -15,13 +15,21 @@ */ /* Automatically generated nanopb constant definitions */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #include "latlng.nanopb.h" +#include "Firestore/core/src/nanopb/pretty_printing.h" + namespace firebase { namespace firestore { +using nanopb::PrintEnumField; +using nanopb::PrintHeader; +using nanopb::PrintMessageField; +using nanopb::PrintPrimitiveField; +using nanopb::PrintTail; + /* @@protoc_insertion_point(includes) */ #if PB_PROTO_HEADER_VERSION != 30 #error Regenerate this file with the current version of nanopb generator. @@ -42,6 +50,22 @@ const pb_field_t google_type_LatLng_fields[3] = { */ PB_STATIC_ASSERT(sizeof(double) == 8, DOUBLE_MUST_BE_8_BYTES) +std::string google_type_LatLng::ToString(int indent) const { + std::string header = PrintHeader(indent, "LatLng", this); + std::string result; + + result += PrintPrimitiveField("latitude: ", latitude, indent + 1, false); + result += PrintPrimitiveField("longitude: ", longitude, indent + 1, false); + + bool is_root = indent == 0; + if (!result.empty() || is_root) { + std::string tail = PrintTail(indent); + return header + result + tail; + } else { + return ""; + } +} + } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h index 13eb1e2dc..0b0932ba1 100644 --- a/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h +++ b/Pods/FirebaseFirestore/Firestore/Protos/nanopb/google/type/latlng.nanopb.h @@ -15,12 +15,14 @@ */ /* Automatically generated nanopb header */ -/* Generated by nanopb-0.3.9.2 */ +/* Generated by nanopb-0.3.9.6 */ #ifndef PB_GOOGLE_TYPE_LATLNG_NANOPB_H_INCLUDED #define PB_GOOGLE_TYPE_LATLNG_NANOPB_H_INCLUDED #include +#include + namespace firebase { namespace firestore { @@ -34,6 +36,8 @@ namespace firestore { typedef struct _google_type_LatLng { double latitude; double longitude; + + std::string ToString(int indent = 0) const; /* @@protoc_insertion_point(struct:google_type_LatLng) */ } google_type_LatLng; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h deleted file mode 100644 index cac820928..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: firestore/local/maybe_document.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class FSTPBNoDocument; -@class FSTPBUnknownDocument; -@class GCFSDocument; -@class GPBTimestamp; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - FSTPBMaybeDocumentRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface FSTPBMaybeDocumentRoot : GPBRootObject -@end - -#pragma mark - FSTPBNoDocument - -typedef GPB_ENUM(FSTPBNoDocument_FieldNumber) { - FSTPBNoDocument_FieldNumber_Name = 1, - FSTPBNoDocument_FieldNumber_ReadTime = 2, -}; - -/** - * A message indicating that the document is known to not exist. - **/ -@interface FSTPBNoDocument : GPBMessage - -/** - * The name of the document that does not exist, in the standard format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *name; - -/** The time at which we observed that it does not exist. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; -/** Test to see if @c readTime has been set. */ -@property(nonatomic, readwrite) BOOL hasReadTime; - -@end - -#pragma mark - FSTPBUnknownDocument - -typedef GPB_ENUM(FSTPBUnknownDocument_FieldNumber) { - FSTPBUnknownDocument_FieldNumber_Name = 1, - FSTPBUnknownDocument_FieldNumber_Version = 2, -}; - -/** - * A message indicating that the document that is known to exist but its data - * is unknown. - **/ -@interface FSTPBUnknownDocument : GPBMessage - -/** - * The name of the document that is known to exist, in the standard format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *name; - -/** The version at which we know the document exists. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *version; -/** Test to see if @c version has been set. */ -@property(nonatomic, readwrite) BOOL hasVersion; - -@end - -#pragma mark - FSTPBMaybeDocument - -typedef GPB_ENUM(FSTPBMaybeDocument_FieldNumber) { - FSTPBMaybeDocument_FieldNumber_NoDocument = 1, - FSTPBMaybeDocument_FieldNumber_Document = 2, - FSTPBMaybeDocument_FieldNumber_UnknownDocument = 3, - FSTPBMaybeDocument_FieldNumber_HasCommittedMutations = 4, -}; - -typedef GPB_ENUM(FSTPBMaybeDocument_DocumentType_OneOfCase) { - FSTPBMaybeDocument_DocumentType_OneOfCase_GPBUnsetOneOfCase = 0, - FSTPBMaybeDocument_DocumentType_OneOfCase_NoDocument = 1, - FSTPBMaybeDocument_DocumentType_OneOfCase_Document = 2, - FSTPBMaybeDocument_DocumentType_OneOfCase_UnknownDocument = 3, -}; - -/** - * Represents either an existing document, the explicitly known absence of a - * document, or a document that is known to exist (at some version) but whose - * contents are unknown. - **/ -@interface FSTPBMaybeDocument : GPBMessage - -@property(nonatomic, readonly) FSTPBMaybeDocument_DocumentType_OneOfCase documentTypeOneOfCase; - -/** Used if the document is known to not exist. */ -@property(nonatomic, readwrite, strong, null_resettable) FSTPBNoDocument *noDocument; - -/** The document (if it exists). */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; - -/** Used if the document is known to exist but its data is unknown. */ -@property(nonatomic, readwrite, strong, null_resettable) FSTPBUnknownDocument *unknownDocument; - -/** - * `has_committed_mutations` marks documents that were written to the remote - * document store based on a write acknowledgment. These documents are - * potentially inconsistent with the backend's copy and use the write's - * commit version as their document version. - **/ -@property(nonatomic, readwrite) BOOL hasCommittedMutations; - -@end - -/** - * Clears whatever value was set for the oneof 'documentType'. - **/ -void FSTPBMaybeDocument_ClearDocumentTypeOneOfCase(FSTPBMaybeDocument *message); - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m deleted file mode 100644 index 83bed77a9..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.m +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: firestore/local/maybe_document.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Timestamp.pbobjc.h" -#endif - - #import "MaybeDocument.pbobjc.h" - #import "Document.pbobjc.h" - #import "Annotations.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - FSTPBMaybeDocumentRoot - -@implementation FSTPBMaybeDocumentRoot - - -@end - -#pragma mark - FSTPBMaybeDocumentRoot_FileDescriptor - -static GPBFileDescriptor *FSTPBMaybeDocumentRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"firestore.client" - objcPrefix:@"FSTPB" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - FSTPBNoDocument - -@implementation FSTPBNoDocument - -@dynamic name; -@dynamic hasReadTime, readTime; - -typedef struct FSTPBNoDocument__storage_ { - uint32_t _has_storage_[1]; - NSString *name; - GPBTimestamp *readTime; -} FSTPBNoDocument__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "name", - .dataTypeSpecific.className = NULL, - .number = FSTPBNoDocument_FieldNumber_Name, - .hasIndex = 0, - .offset = (uint32_t)offsetof(FSTPBNoDocument__storage_, name), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = FSTPBNoDocument_FieldNumber_ReadTime, - .hasIndex = 1, - .offset = (uint32_t)offsetof(FSTPBNoDocument__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBNoDocument class] - rootClass:[FSTPBMaybeDocumentRoot class] - file:FSTPBMaybeDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBNoDocument__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - FSTPBUnknownDocument - -@implementation FSTPBUnknownDocument - -@dynamic name; -@dynamic hasVersion, version; - -typedef struct FSTPBUnknownDocument__storage_ { - uint32_t _has_storage_[1]; - NSString *name; - GPBTimestamp *version; -} FSTPBUnknownDocument__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "name", - .dataTypeSpecific.className = NULL, - .number = FSTPBUnknownDocument_FieldNumber_Name, - .hasIndex = 0, - .offset = (uint32_t)offsetof(FSTPBUnknownDocument__storage_, name), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "version", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = FSTPBUnknownDocument_FieldNumber_Version, - .hasIndex = 1, - .offset = (uint32_t)offsetof(FSTPBUnknownDocument__storage_, version), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBUnknownDocument class] - rootClass:[FSTPBMaybeDocumentRoot class] - file:FSTPBMaybeDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBUnknownDocument__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - FSTPBMaybeDocument - -@implementation FSTPBMaybeDocument - -@dynamic documentTypeOneOfCase; -@dynamic noDocument; -@dynamic document; -@dynamic unknownDocument; -@dynamic hasCommittedMutations; - -typedef struct FSTPBMaybeDocument__storage_ { - uint32_t _has_storage_[2]; - FSTPBNoDocument *noDocument; - GCFSDocument *document; - FSTPBUnknownDocument *unknownDocument; -} FSTPBMaybeDocument__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "noDocument", - .dataTypeSpecific.className = GPBStringifySymbol(FSTPBNoDocument), - .number = FSTPBMaybeDocument_FieldNumber_NoDocument, - .hasIndex = -1, - .offset = (uint32_t)offsetof(FSTPBMaybeDocument__storage_, noDocument), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "document", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = FSTPBMaybeDocument_FieldNumber_Document, - .hasIndex = -1, - .offset = (uint32_t)offsetof(FSTPBMaybeDocument__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "unknownDocument", - .dataTypeSpecific.className = GPBStringifySymbol(FSTPBUnknownDocument), - .number = FSTPBMaybeDocument_FieldNumber_UnknownDocument, - .hasIndex = -1, - .offset = (uint32_t)offsetof(FSTPBMaybeDocument__storage_, unknownDocument), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "hasCommittedMutations", - .dataTypeSpecific.className = NULL, - .number = FSTPBMaybeDocument_FieldNumber_HasCommittedMutations, - .hasIndex = 0, - .offset = 1, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBMaybeDocument class] - rootClass:[FSTPBMaybeDocumentRoot class] - file:FSTPBMaybeDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBMaybeDocument__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "documentType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void FSTPBMaybeDocument_ClearDocumentTypeOneOfCase(FSTPBMaybeDocument *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h deleted file mode 100644 index 9091ba6dd..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: firestore/local/mutation.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSWrite; -@class GPBTimestamp; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - FSTPBMutationRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface FSTPBMutationRoot : GPBRootObject -@end - -#pragma mark - FSTPBMutationQueue - -typedef GPB_ENUM(FSTPBMutationQueue_FieldNumber) { - FSTPBMutationQueue_FieldNumber_LastAcknowledgedBatchId = 1, - FSTPBMutationQueue_FieldNumber_LastStreamToken = 2, -}; - -/** - * Each user gets a single queue of WriteBatches to apply to the server. - * MutationQueue tracks the metadata about the queue. - **/ -@interface FSTPBMutationQueue : GPBMessage - -/** - * An identifier for the highest numbered batch that has been acknowledged by - * the server. All WriteBatches in this queue with batch_ids less than or - * equal to this value are considered to have been acknowledged by the - * server. - **/ -@property(nonatomic, readwrite) int32_t lastAcknowledgedBatchId; - -/** - * A stream token that was previously sent by the server. - * - * See StreamingWriteRequest in datastore.proto for more details about usage. - * - * After sending this token, earlier tokens may not be used anymore so only a - * single stream token is retained. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *lastStreamToken; - -@end - -#pragma mark - FSTPBWriteBatch - -typedef GPB_ENUM(FSTPBWriteBatch_FieldNumber) { - FSTPBWriteBatch_FieldNumber_BatchId = 1, - FSTPBWriteBatch_FieldNumber_WritesArray = 2, - FSTPBWriteBatch_FieldNumber_LocalWriteTime = 3, - FSTPBWriteBatch_FieldNumber_BaseWritesArray = 4, -}; - -/** - * Message containing a batch of user-level writes intended to be sent to - * the server in a single call. Each user-level batch gets a separate - * WriteBatch with a new batch_id. - **/ -@interface FSTPBWriteBatch : GPBMessage - -/** - * An identifier for this batch, allocated by the mutation queue in a - * monotonically increasing manner. - **/ -@property(nonatomic, readwrite) int32_t batchId; - -/** A list of writes to apply. All writes will be applied atomically. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *writesArray; -/** The number of items in @c writesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger writesArray_Count; - -/** The local time at which the write batch was initiated. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *localWriteTime; -/** Test to see if @c localWriteTime has been set. */ -@property(nonatomic, readwrite) BOOL hasLocalWriteTime; - -/** - * A list of pseudo-writes that represent a partial base state from when this - * write batch was initially created. When computing the local view batch, - * these base_writes are applied prior to the real writes in order to - * override certain document fields from the remote document cache. This is - * necessary in the case of non-idempotent writes (e.g. numericAdd - * transforms) to make sure that the local view of the modified documents - * doesn't flicker if the remote document cache receives the result of the - * non-idempotent write before the write is removed from the queue. - * - * These writes are never sent to the backend. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *baseWritesArray; -/** The number of items in @c baseWritesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger baseWritesArray_Count; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m deleted file mode 100644 index 5c88e90fa..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Mutation.pbobjc.m +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: firestore/local/mutation.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Timestamp.pbobjc.h" -#endif - - #import "Mutation.pbobjc.h" - #import "Write.pbobjc.h" - #import "Annotations.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -#pragma mark - FSTPBMutationRoot - -@implementation FSTPBMutationRoot - - -@end - -#pragma mark - FSTPBMutationRoot_FileDescriptor - -static GPBFileDescriptor *FSTPBMutationRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"firestore.client" - objcPrefix:@"FSTPB" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - FSTPBMutationQueue - -@implementation FSTPBMutationQueue - -@dynamic lastAcknowledgedBatchId; -@dynamic lastStreamToken; - -typedef struct FSTPBMutationQueue__storage_ { - uint32_t _has_storage_[1]; - int32_t lastAcknowledgedBatchId; - NSData *lastStreamToken; -} FSTPBMutationQueue__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "lastAcknowledgedBatchId", - .dataTypeSpecific.className = NULL, - .number = FSTPBMutationQueue_FieldNumber_LastAcknowledgedBatchId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(FSTPBMutationQueue__storage_, lastAcknowledgedBatchId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "lastStreamToken", - .dataTypeSpecific.className = NULL, - .number = FSTPBMutationQueue_FieldNumber_LastStreamToken, - .hasIndex = 1, - .offset = (uint32_t)offsetof(FSTPBMutationQueue__storage_, lastStreamToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBMutationQueue class] - rootClass:[FSTPBMutationRoot class] - file:FSTPBMutationRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBMutationQueue__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - FSTPBWriteBatch - -@implementation FSTPBWriteBatch - -@dynamic batchId; -@dynamic writesArray, writesArray_Count; -@dynamic hasLocalWriteTime, localWriteTime; -@dynamic baseWritesArray, baseWritesArray_Count; - -typedef struct FSTPBWriteBatch__storage_ { - uint32_t _has_storage_[1]; - int32_t batchId; - NSMutableArray *writesArray; - GPBTimestamp *localWriteTime; - NSMutableArray *baseWritesArray; -} FSTPBWriteBatch__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "batchId", - .dataTypeSpecific.className = NULL, - .number = FSTPBWriteBatch_FieldNumber_BatchId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, batchId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "writesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite), - .number = FSTPBWriteBatch_FieldNumber_WritesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, writesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "localWriteTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = FSTPBWriteBatch_FieldNumber_LocalWriteTime, - .hasIndex = 1, - .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, localWriteTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "baseWritesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite), - .number = FSTPBWriteBatch_FieldNumber_BaseWritesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(FSTPBWriteBatch__storage_, baseWritesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBWriteBatch class] - rootClass:[FSTPBMutationRoot class] - file:FSTPBMutationRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBWriteBatch__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Target.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Target.pbobjc.h deleted file mode 100644 index 88d9bffd4..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Target.pbobjc.h +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: firestore/local/target.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSTarget_DocumentsTarget; -@class GCFSTarget_QueryTarget; -@class GPBTimestamp; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - FSTPBTargetRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface FSTPBTargetRoot : GPBRootObject -@end - -#pragma mark - FSTPBTarget - -typedef GPB_ENUM(FSTPBTarget_FieldNumber) { - FSTPBTarget_FieldNumber_TargetId = 1, - FSTPBTarget_FieldNumber_SnapshotVersion = 2, - FSTPBTarget_FieldNumber_ResumeToken = 3, - FSTPBTarget_FieldNumber_LastListenSequenceNumber = 4, - FSTPBTarget_FieldNumber_Query = 5, - FSTPBTarget_FieldNumber_Documents = 6, -}; - -typedef GPB_ENUM(FSTPBTarget_TargetType_OneOfCase) { - FSTPBTarget_TargetType_OneOfCase_GPBUnsetOneOfCase = 0, - FSTPBTarget_TargetType_OneOfCase_Query = 5, - FSTPBTarget_TargetType_OneOfCase_Documents = 6, -}; - -/** - * A Target is a long-lived data structure representing a resumable listen on a - * particular user query. While the query describes what to listen to, the - * Target records data about when the results were last updated and enough - * information to be able to resume listening later. - **/ -@interface FSTPBTarget : GPBMessage - -/** - * An auto-generated sequential numeric identifier for the target. This - * serves as the identity of the target, and once assigned never changes. - **/ -@property(nonatomic, readwrite) int32_t targetId; - -/** - * The last snapshot version received from the Watch Service for this target. - * - * This is the same value as TargetChange.read_time - * https://github.com/googleapis/googleapis/blob/master/google/firestore/v1/firestore.proto#L734 - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *snapshotVersion; -/** Test to see if @c snapshotVersion has been set. */ -@property(nonatomic, readwrite) BOOL hasSnapshotVersion; - -/** - * An opaque, server-assigned token that allows watching a query to be - * resumed after disconnecting without retransmitting all the data that - * matches the query. The resume token essentially identifies a point in - * time from which the server should resume sending results. - * - * This is related to the snapshot_version in that the resume_token - * effectively also encodes that value, but the resume_token is opaque and - * sometimes encodes additional information. - * - * A consequence of this is that the resume_token should be used when asking - * the server to reason about where this client is in the watch stream, but - * the client should use the snapshot_version for its own purposes. - * - * This is the same value as TargetChange.resume_token - * https://github.com/googleapis/googleapis/blob/master/google/firestore/v1/firestore.proto#L722 - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *resumeToken; - -/** - * A sequence number representing the last time this query was listened to, - * used for garbage collection purposes. - * - * Conventionally this would be a timestamp value, but device-local clocks - * are unreliable and they must be able to create new listens even while - * disconnected. Instead this should be a monotonically increasing number - * that's incremented on each listen call. - * - * This is different from the target_id since the target_id is an immutable - * identifier assigned to the Target on first use while - * last_listen_sequence_number is updated every time the query is listened - * to. - **/ -@property(nonatomic, readwrite) int64_t lastListenSequenceNumber; - -/** The server-side type of target to listen to. */ -@property(nonatomic, readonly) FSTPBTarget_TargetType_OneOfCase targetTypeOneOfCase; - -/** A target specified by a query. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget_QueryTarget *query; - -/** A target specified by a set of document names. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget_DocumentsTarget *documents; - -@end - -/** - * Clears whatever value was set for the oneof 'targetType'. - **/ -void FSTPBTarget_ClearTargetTypeOneOfCase(FSTPBTarget *message); - -#pragma mark - FSTPBTargetGlobal - -typedef GPB_ENUM(FSTPBTargetGlobal_FieldNumber) { - FSTPBTargetGlobal_FieldNumber_HighestTargetId = 1, - FSTPBTargetGlobal_FieldNumber_HighestListenSequenceNumber = 2, - FSTPBTargetGlobal_FieldNumber_LastRemoteSnapshotVersion = 3, - FSTPBTargetGlobal_FieldNumber_TargetCount = 4, -}; - -/** - * Global state tracked across all Targets, tracked separately to avoid the - * need for extra indexes. - **/ -@interface FSTPBTargetGlobal : GPBMessage - -/** - * The highest numbered target id across all Targets. - * - * See Target.target_id. - **/ -@property(nonatomic, readwrite) int32_t highestTargetId; - -/** - * The highest numbered last_listen_sequence_number across all Targets. - * - * See Target.last_listen_sequence_number. - **/ -@property(nonatomic, readwrite) int64_t highestListenSequenceNumber; - -/** - * A global snapshot version representing the last consistent snapshot we - * received from the backend. This is monotonically increasing and any - * snapshots received from the backend prior to this version (e.g. for - * targets resumed with a resume_token) should be suppressed (buffered) until - * the backend has caught up to this snapshot_version again. This prevents - * our cache from ever going backwards in time. - * - * This is updated whenever our we get a TargetChange with a read_time and - * empty target_ids. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *lastRemoteSnapshotVersion; -/** Test to see if @c lastRemoteSnapshotVersion has been set. */ -@property(nonatomic, readwrite) BOOL hasLastRemoteSnapshotVersion; - -/** On platforms that need it, holds the number of targets persisted. */ -@property(nonatomic, readwrite) int32_t targetCount; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Target.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Target.pbobjc.m deleted file mode 100644 index 2c414725b..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/firestore/local/Target.pbobjc.m +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: firestore/local/target.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Timestamp.pbobjc.h" -#endif - - #import "Target.pbobjc.h" - #import "Firestore.pbobjc.h" - #import "Annotations.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - FSTPBTargetRoot - -@implementation FSTPBTargetRoot - - -@end - -#pragma mark - FSTPBTargetRoot_FileDescriptor - -static GPBFileDescriptor *FSTPBTargetRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"firestore.client" - objcPrefix:@"FSTPB" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - FSTPBTarget - -@implementation FSTPBTarget - -@dynamic targetTypeOneOfCase; -@dynamic targetId; -@dynamic hasSnapshotVersion, snapshotVersion; -@dynamic resumeToken; -@dynamic lastListenSequenceNumber; -@dynamic query; -@dynamic documents; - -typedef struct FSTPBTarget__storage_ { - uint32_t _has_storage_[2]; - int32_t targetId; - GPBTimestamp *snapshotVersion; - NSData *resumeToken; - GCFSTarget_QueryTarget *query; - GCFSTarget_DocumentsTarget *documents; - int64_t lastListenSequenceNumber; -} FSTPBTarget__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "targetId", - .dataTypeSpecific.className = NULL, - .number = FSTPBTarget_FieldNumber_TargetId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(FSTPBTarget__storage_, targetId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "snapshotVersion", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = FSTPBTarget_FieldNumber_SnapshotVersion, - .hasIndex = 1, - .offset = (uint32_t)offsetof(FSTPBTarget__storage_, snapshotVersion), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "resumeToken", - .dataTypeSpecific.className = NULL, - .number = FSTPBTarget_FieldNumber_ResumeToken, - .hasIndex = 2, - .offset = (uint32_t)offsetof(FSTPBTarget__storage_, resumeToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "lastListenSequenceNumber", - .dataTypeSpecific.className = NULL, - .number = FSTPBTarget_FieldNumber_LastListenSequenceNumber, - .hasIndex = 3, - .offset = (uint32_t)offsetof(FSTPBTarget__storage_, lastListenSequenceNumber), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt64, - }, - { - .name = "query", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_QueryTarget), - .number = FSTPBTarget_FieldNumber_Query, - .hasIndex = -1, - .offset = (uint32_t)offsetof(FSTPBTarget__storage_, query), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "documents", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_DocumentsTarget), - .number = FSTPBTarget_FieldNumber_Documents, - .hasIndex = -1, - .offset = (uint32_t)offsetof(FSTPBTarget__storage_, documents), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBTarget class] - rootClass:[FSTPBTargetRoot class] - file:FSTPBTargetRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBTarget__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "targetType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void FSTPBTarget_ClearTargetTypeOneOfCase(FSTPBTarget *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - FSTPBTargetGlobal - -@implementation FSTPBTargetGlobal - -@dynamic highestTargetId; -@dynamic highestListenSequenceNumber; -@dynamic hasLastRemoteSnapshotVersion, lastRemoteSnapshotVersion; -@dynamic targetCount; - -typedef struct FSTPBTargetGlobal__storage_ { - uint32_t _has_storage_[1]; - int32_t highestTargetId; - int32_t targetCount; - GPBTimestamp *lastRemoteSnapshotVersion; - int64_t highestListenSequenceNumber; -} FSTPBTargetGlobal__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "highestTargetId", - .dataTypeSpecific.className = NULL, - .number = FSTPBTargetGlobal_FieldNumber_HighestTargetId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, highestTargetId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "highestListenSequenceNumber", - .dataTypeSpecific.className = NULL, - .number = FSTPBTargetGlobal_FieldNumber_HighestListenSequenceNumber, - .hasIndex = 1, - .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, highestListenSequenceNumber), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt64, - }, - { - .name = "lastRemoteSnapshotVersion", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = FSTPBTargetGlobal_FieldNumber_LastRemoteSnapshotVersion, - .hasIndex = 2, - .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, lastRemoteSnapshotVersion), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "targetCount", - .dataTypeSpecific.className = NULL, - .number = FSTPBTargetGlobal_FieldNumber_TargetCount, - .hasIndex = 3, - .offset = (uint32_t)offsetof(FSTPBTargetGlobal__storage_, targetCount), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[FSTPBTargetGlobal class] - rootClass:[FSTPBTargetRoot class] - file:FSTPBTargetRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(FSTPBTargetGlobal__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/Annotations.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/Annotations.pbobjc.h deleted file mode 100644 index 02b99dde1..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/Annotations.pbobjc.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Empty stub file diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/Annotations.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/Annotations.pbobjc.m deleted file mode 100644 index 71f8ef297..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/Annotations.pbobjc.m +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -static int annotations_stub __attribute__((unused,used)) = 0; diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/HTTP.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/HTTP.pbobjc.h deleted file mode 100644 index 0b7da8363..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/HTTP.pbobjc.h +++ /dev/null @@ -1,433 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/api/http.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GAPICustomHttpPattern; -@class GAPIHttpRule; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - GAPIHTTPRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GAPIHTTPRoot : GPBRootObject -@end - -#pragma mark - GAPIHttp - -typedef GPB_ENUM(GAPIHttp_FieldNumber) { - GAPIHttp_FieldNumber_RulesArray = 1, - GAPIHttp_FieldNumber_FullyDecodeReservedExpansion = 2, -}; - -/** - * Defines the HTTP configuration for an API service. It contains a list of - * [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method - * to one or more HTTP REST API methods. - **/ -@interface GAPIHttp : GPBMessage - -/** - * A list of HTTP configuration rules that apply to individual API methods. - * - * **NOTE:** All service configuration rules follow "last one wins" order. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *rulesArray; -/** The number of items in @c rulesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger rulesArray_Count; - -/** - * When set to true, URL path parmeters will be fully URI-decoded except in - * cases of single segment matches in reserved expansion, where "%2F" will be - * left encoded. - * - * The default behavior is to not decode RFC 6570 reserved characters in multi - * segment matches. - **/ -@property(nonatomic, readwrite) BOOL fullyDecodeReservedExpansion; - -@end - -#pragma mark - GAPIHttpRule - -typedef GPB_ENUM(GAPIHttpRule_FieldNumber) { - GAPIHttpRule_FieldNumber_Selector = 1, - GAPIHttpRule_FieldNumber_Get = 2, - GAPIHttpRule_FieldNumber_Put = 3, - GAPIHttpRule_FieldNumber_Post = 4, - GAPIHttpRule_FieldNumber_Delete_p = 5, - GAPIHttpRule_FieldNumber_Patch = 6, - GAPIHttpRule_FieldNumber_Body = 7, - GAPIHttpRule_FieldNumber_Custom = 8, - GAPIHttpRule_FieldNumber_AdditionalBindingsArray = 11, -}; - -typedef GPB_ENUM(GAPIHttpRule_Pattern_OneOfCase) { - GAPIHttpRule_Pattern_OneOfCase_GPBUnsetOneOfCase = 0, - GAPIHttpRule_Pattern_OneOfCase_Get = 2, - GAPIHttpRule_Pattern_OneOfCase_Put = 3, - GAPIHttpRule_Pattern_OneOfCase_Post = 4, - GAPIHttpRule_Pattern_OneOfCase_Delete_p = 5, - GAPIHttpRule_Pattern_OneOfCase_Patch = 6, - GAPIHttpRule_Pattern_OneOfCase_Custom = 8, -}; - -/** - * `HttpRule` defines the mapping of an RPC method to one or more HTTP - * REST API methods. The mapping specifies how different portions of the RPC - * request message are mapped to URL path, URL query parameters, and - * HTTP request body. The mapping is typically specified as an - * `google.api.http` annotation on the RPC method, - * see "google/api/annotations.proto" for details. - * - * The mapping consists of a field specifying the path template and - * method kind. The path template can refer to fields in the request - * message, as in the example below which describes a REST GET - * operation on a resource collection of messages: - * - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}"; - * } - * } - * message GetMessageRequest { - * message SubMessage { - * string subfield = 1; - * } - * string message_id = 1; // mapped to the URL - * SubMessage sub = 2; // `sub.subfield` is url-mapped - * } - * message Message { - * string text = 1; // content of the resource - * } - * - * The same http annotation can alternatively be expressed inside the - * `GRPC API Configuration` YAML file. - * - * http: - * rules: - * - selector: .Messaging.GetMessage - * get: /v1/messages/{message_id}/{sub.subfield} - * - * This definition enables an automatic, bidrectional mapping of HTTP - * JSON to RPC. Example: - * - * HTTP | RPC - * -----|----- - * `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))` - * - * In general, not only fields but also field paths can be referenced - * from a path pattern. Fields mapped to the path pattern cannot be - * repeated and must have a primitive (non-message) type. - * - * Any fields in the request message which are not bound by the path - * pattern automatically become (optional) HTTP query - * parameters. Assume the following definition of the request message: - * - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http).get = "/v1/messages/{message_id}"; - * } - * } - * message GetMessageRequest { - * message SubMessage { - * string subfield = 1; - * } - * string message_id = 1; // mapped to the URL - * int64 revision = 2; // becomes a parameter - * SubMessage sub = 3; // `sub.subfield` becomes a parameter - * } - * - * - * This enables a HTTP JSON to RPC mapping as below: - * - * HTTP | RPC - * -----|----- - * `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))` - * - * Note that fields which are mapped to HTTP parameters must have a - * primitive type or a repeated primitive type. Message types are not - * allowed. In the case of a repeated type, the parameter can be - * repeated in the URL, as in `...?param=A¶m=B`. - * - * For HTTP method kinds which allow a request body, the `body` field - * specifies the mapping. Consider a REST update method on the - * message resource collection: - * - * - * service Messaging { - * rpc UpdateMessage(UpdateMessageRequest) returns (Message) { - * option (google.api.http) = { - * put: "/v1/messages/{message_id}" - * body: "message" - * }; - * } - * } - * message UpdateMessageRequest { - * string message_id = 1; // mapped to the URL - * Message message = 2; // mapped to the body - * } - * - * - * The following HTTP JSON to RPC mapping is enabled, where the - * representation of the JSON in the request body is determined by - * protos JSON encoding: - * - * HTTP | RPC - * -----|----- - * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })` - * - * The special name `*` can be used in the body mapping to define that - * every field not bound by the path template should be mapped to the - * request body. This enables the following alternative definition of - * the update method: - * - * service Messaging { - * rpc UpdateMessage(Message) returns (Message) { - * option (google.api.http) = { - * put: "/v1/messages/{message_id}" - * body: "*" - * }; - * } - * } - * message Message { - * string message_id = 1; - * string text = 2; - * } - * - * - * The following HTTP JSON to RPC mapping is enabled: - * - * HTTP | RPC - * -----|----- - * `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")` - * - * Note that when using `*` in the body mapping, it is not possible to - * have HTTP parameters, as all fields not bound by the path end in - * the body. This makes this option more rarely used in practice of - * defining REST APIs. The common usage of `*` is in custom methods - * which don't use the URL at all for transferring data. - * - * It is possible to define multiple HTTP methods for one RPC by using - * the `additional_bindings` option. Example: - * - * service Messaging { - * rpc GetMessage(GetMessageRequest) returns (Message) { - * option (google.api.http) = { - * get: "/v1/messages/{message_id}" - * additional_bindings { - * get: "/v1/users/{user_id}/messages/{message_id}" - * } - * }; - * } - * } - * message GetMessageRequest { - * string message_id = 1; - * string user_id = 2; - * } - * - * - * This enables the following two alternative HTTP JSON to RPC - * mappings: - * - * HTTP | RPC - * -----|----- - * `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` - * `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")` - * - * # Rules for HTTP mapping - * - * The rules for mapping HTTP path, query parameters, and body fields - * to the request message are as follows: - * - * 1. The `body` field specifies either `*` or a field path, or is - * omitted. If omitted, it indicates there is no HTTP request body. - * 2. Leaf fields (recursive expansion of nested messages in the - * request) can be classified into three types: - * (a) Matched in the URL template. - * (b) Covered by body (if body is `*`, everything except (a) fields; - * else everything under the body field) - * (c) All other fields. - * 3. URL query parameters found in the HTTP request are mapped to (c) fields. - * 4. Any body sent with an HTTP request can contain only (b) fields. - * - * The syntax of the path template is as follows: - * - * Template = "/" Segments [ Verb ] ; - * Segments = Segment { "/" Segment } ; - * Segment = "*" | "**" | LITERAL | Variable ; - * Variable = "{" FieldPath [ "=" Segments ] "}" ; - * FieldPath = IDENT { "." IDENT } ; - * Verb = ":" LITERAL ; - * - * The syntax `*` matches a single path segment. The syntax `**` matches zero - * or more path segments, which must be the last part of the path except the - * `Verb`. The syntax `LITERAL` matches literal text in the path. - * - * The syntax `Variable` matches part of the URL path as specified by its - * template. A variable template must not contain other variables. If a variable - * matches a single path segment, its template may be omitted, e.g. `{var}` - * is equivalent to `{var=*}`. - * - * If a variable contains exactly one path segment, such as `"{var}"` or - * `"{var=*}"`, when such a variable is expanded into a URL path, all characters - * except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the - * Discovery Document as `{var}`. - * - * If a variable contains one or more path segments, such as `"{var=foo/\*}"` - * or `"{var=**}"`, when such a variable is expanded into a URL path, all - * characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables - * show up in the Discovery Document as `{+var}`. - * - * NOTE: While the single segment variable matches the semantics of - * [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 - * Simple String Expansion, the multi segment variable **does not** match - * RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion - * does not expand special characters like `?` and `#`, which would lead - * to invalid URLs. - * - * NOTE: the field paths in variables and in the `body` must not refer to - * repeated fields or map fields. - **/ -@interface GAPIHttpRule : GPBMessage - -/** - * Selects methods to which this rule applies. - * - * Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *selector; - -/** - * Determines the URL pattern is matched by this rules. This pattern can be - * used with any of the {get|put|post|delete|patch} methods. A custom method - * can be defined using the 'custom' field. - **/ -@property(nonatomic, readonly) GAPIHttpRule_Pattern_OneOfCase patternOneOfCase; - -/** Used for listing and getting information about resources. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *get; - -/** Used for updating a resource. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *put; - -/** Used for creating a resource. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *post; - -/** Used for deleting a resource. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *delete_p; - -/** Used for updating a resource. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *patch; - -/** - * The custom pattern is used for specifying an HTTP method that is not - * included in the `pattern` field, such as HEAD, or "*" to leave the - * HTTP method unspecified for this rule. The wild-card rule is useful - * for services that provide content to Web (HTML) clients. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GAPICustomHttpPattern *custom; - -/** - * The name of the request field whose value is mapped to the HTTP body, or - * `*` for mapping all fields not captured by the path pattern to the HTTP - * body. NOTE: the referred field must not be a repeated field and must be - * present at the top-level of request message type. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *body; - -/** - * Additional HTTP bindings for the selector. Nested bindings must - * not contain an `additional_bindings` field themselves (that is, - * the nesting may only be one level deep). - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *additionalBindingsArray; -/** The number of items in @c additionalBindingsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger additionalBindingsArray_Count; - -@end - -/** - * Clears whatever value was set for the oneof 'pattern'. - **/ -void GAPIHttpRule_ClearPatternOneOfCase(GAPIHttpRule *message); - -#pragma mark - GAPICustomHttpPattern - -typedef GPB_ENUM(GAPICustomHttpPattern_FieldNumber) { - GAPICustomHttpPattern_FieldNumber_Kind = 1, - GAPICustomHttpPattern_FieldNumber_Path = 2, -}; - -/** - * A custom pattern is used for defining custom HTTP verb. - **/ -@interface GAPICustomHttpPattern : GPBMessage - -/** The name of this custom HTTP verb. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *kind; - -/** The path matched by this custom verb. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *path; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/HTTP.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/HTTP.pbobjc.m deleted file mode 100644 index 4ae8e1166..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/api/HTTP.pbobjc.m +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/api/http.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - - #import "HTTP.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - GAPIHTTPRoot - -@implementation GAPIHTTPRoot - -// No extensions in the file and no imports, so no need to generate -// +extensionRegistry. - -@end - -#pragma mark - GAPIHTTPRoot_FileDescriptor - -static GPBFileDescriptor *GAPIHTTPRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.api" - objcPrefix:@"GAPI" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GAPIHttp - -@implementation GAPIHttp - -@dynamic rulesArray, rulesArray_Count; -@dynamic fullyDecodeReservedExpansion; - -typedef struct GAPIHttp__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *rulesArray; -} GAPIHttp__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "rulesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GAPIHttpRule), - .number = GAPIHttp_FieldNumber_RulesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GAPIHttp__storage_, rulesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "fullyDecodeReservedExpansion", - .dataTypeSpecific.className = NULL, - .number = GAPIHttp_FieldNumber_FullyDecodeReservedExpansion, - .hasIndex = 0, - .offset = 1, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GAPIHttp class] - rootClass:[GAPIHTTPRoot class] - file:GAPIHTTPRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GAPIHttp__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GAPIHttpRule - -@implementation GAPIHttpRule - -@dynamic patternOneOfCase; -@dynamic selector; -@dynamic get; -@dynamic put; -@dynamic post; -@dynamic delete_p; -@dynamic patch; -@dynamic custom; -@dynamic body; -@dynamic additionalBindingsArray, additionalBindingsArray_Count; - -typedef struct GAPIHttpRule__storage_ { - uint32_t _has_storage_[2]; - NSString *selector; - NSString *get; - NSString *put; - NSString *post; - NSString *delete_p; - NSString *patch; - NSString *body; - GAPICustomHttpPattern *custom; - NSMutableArray *additionalBindingsArray; -} GAPIHttpRule__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "selector", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Selector, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, selector), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "get", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Get, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, get), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "put", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Put, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, put), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "post", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Post, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, post), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "delete_p", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Delete_p, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, delete_p), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "patch", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Patch, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, patch), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "body", - .dataTypeSpecific.className = NULL, - .number = GAPIHttpRule_FieldNumber_Body, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, body), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "custom", - .dataTypeSpecific.className = GPBStringifySymbol(GAPICustomHttpPattern), - .number = GAPIHttpRule_FieldNumber_Custom, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, custom), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "additionalBindingsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GAPIHttpRule), - .number = GAPIHttpRule_FieldNumber_AdditionalBindingsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GAPIHttpRule__storage_, additionalBindingsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GAPIHttpRule class] - rootClass:[GAPIHTTPRoot class] - file:GAPIHTTPRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GAPIHttpRule__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "pattern", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GAPIHttpRule_ClearPatternOneOfCase(GAPIHttpRule *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GAPICustomHttpPattern - -@implementation GAPICustomHttpPattern - -@dynamic kind; -@dynamic path; - -typedef struct GAPICustomHttpPattern__storage_ { - uint32_t _has_storage_[1]; - NSString *kind; - NSString *path; -} GAPICustomHttpPattern__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "kind", - .dataTypeSpecific.className = NULL, - .number = GAPICustomHttpPattern_FieldNumber_Kind, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GAPICustomHttpPattern__storage_, kind), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "path", - .dataTypeSpecific.className = NULL, - .number = GAPICustomHttpPattern_FieldNumber_Path, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GAPICustomHttpPattern__storage_, path), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GAPICustomHttpPattern class] - rootClass:[GAPIHTTPRoot class] - file:GAPIHTTPRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GAPICustomHttpPattern__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.h deleted file mode 100644 index 0ffe06a09..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.h +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/common.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSTransactionOptions_ReadOnly; -@class GCFSTransactionOptions_ReadWrite; -@class GPBTimestamp; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - GCFSCommonRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GCFSCommonRoot : GPBRootObject -@end - -#pragma mark - GCFSDocumentMask - -typedef GPB_ENUM(GCFSDocumentMask_FieldNumber) { - GCFSDocumentMask_FieldNumber_FieldPathsArray = 1, -}; - -/** - * A set of field paths on a document. - * Used to restrict a get or update operation on a document to a subset of its - * fields. - * This is different from standard field masks, as this is always scoped to a - * [Document][google.firestore.v1.Document], and takes in account the dynamic nature of [Value][google.firestore.v1.Value]. - **/ -@interface GCFSDocumentMask : GPBMessage - -/** - * The list of field paths in the mask. See [Document.fields][google.firestore.v1.Document.fields] for a field - * path syntax reference. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fieldPathsArray; -/** The number of items in @c fieldPathsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger fieldPathsArray_Count; - -@end - -#pragma mark - GCFSPrecondition - -typedef GPB_ENUM(GCFSPrecondition_FieldNumber) { - GCFSPrecondition_FieldNumber_Exists = 1, - GCFSPrecondition_FieldNumber_UpdateTime = 2, -}; - -typedef GPB_ENUM(GCFSPrecondition_ConditionType_OneOfCase) { - GCFSPrecondition_ConditionType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSPrecondition_ConditionType_OneOfCase_Exists = 1, - GCFSPrecondition_ConditionType_OneOfCase_UpdateTime = 2, -}; - -/** - * A precondition on a document, used for conditional operations. - **/ -@interface GCFSPrecondition : GPBMessage - -/** The type of precondition. */ -@property(nonatomic, readonly) GCFSPrecondition_ConditionType_OneOfCase conditionTypeOneOfCase; - -/** - * When set to `true`, the target document must exist. - * When set to `false`, the target document must not exist. - **/ -@property(nonatomic, readwrite) BOOL exists; - -/** - * When set, the target document must exist and have been last updated at - * that time. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *updateTime; - -@end - -/** - * Clears whatever value was set for the oneof 'conditionType'. - **/ -void GCFSPrecondition_ClearConditionTypeOneOfCase(GCFSPrecondition *message); - -#pragma mark - GCFSTransactionOptions - -typedef GPB_ENUM(GCFSTransactionOptions_FieldNumber) { - GCFSTransactionOptions_FieldNumber_ReadOnly = 2, - GCFSTransactionOptions_FieldNumber_ReadWrite = 3, -}; - -typedef GPB_ENUM(GCFSTransactionOptions_Mode_OneOfCase) { - GCFSTransactionOptions_Mode_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSTransactionOptions_Mode_OneOfCase_ReadOnly = 2, - GCFSTransactionOptions_Mode_OneOfCase_ReadWrite = 3, -}; - -/** - * Options for creating a new transaction. - **/ -@interface GCFSTransactionOptions : GPBMessage - -/** The mode of the transaction. */ -@property(nonatomic, readonly) GCFSTransactionOptions_Mode_OneOfCase modeOneOfCase; - -/** The transaction can only be used for read operations. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions_ReadOnly *readOnly; - -/** The transaction can be used for both read and write operations. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions_ReadWrite *readWrite; - -@end - -/** - * Clears whatever value was set for the oneof 'mode'. - **/ -void GCFSTransactionOptions_ClearModeOneOfCase(GCFSTransactionOptions *message); - -#pragma mark - GCFSTransactionOptions_ReadWrite - -typedef GPB_ENUM(GCFSTransactionOptions_ReadWrite_FieldNumber) { - GCFSTransactionOptions_ReadWrite_FieldNumber_RetryTransaction = 1, -}; - -/** - * Options for a transaction that can be used to read and write documents. - **/ -@interface GCFSTransactionOptions_ReadWrite : GPBMessage - -/** An optional transaction to retry. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *retryTransaction; - -@end - -#pragma mark - GCFSTransactionOptions_ReadOnly - -typedef GPB_ENUM(GCFSTransactionOptions_ReadOnly_FieldNumber) { - GCFSTransactionOptions_ReadOnly_FieldNumber_ReadTime = 2, -}; - -typedef GPB_ENUM(GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase) { - GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase_ReadTime = 2, -}; - -/** - * Options for a transaction that can only be used to read documents. - **/ -@interface GCFSTransactionOptions_ReadOnly : GPBMessage - -/** - * The consistency mode for this transaction. If not set, defaults to strong - * consistency. - **/ -@property(nonatomic, readonly) GCFSTransactionOptions_ReadOnly_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; - -/** - * Reads documents at the given time. - * This may not be older than 60 seconds. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; - -@end - -/** - * Clears whatever value was set for the oneof 'consistencySelector'. - **/ -void GCFSTransactionOptions_ReadOnly_ClearConsistencySelectorOneOfCase(GCFSTransactionOptions_ReadOnly *message); - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.m deleted file mode 100644 index cf112ba64..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.m +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/common.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Timestamp.pbobjc.h" -#endif - - #import "Common.pbobjc.h" - #import "Annotations.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - GCFSCommonRoot - -@implementation GCFSCommonRoot - - -@end - -#pragma mark - GCFSCommonRoot_FileDescriptor - -static GPBFileDescriptor *GCFSCommonRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.firestore.v1" - objcPrefix:@"GCFS" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GCFSDocumentMask - -@implementation GCFSDocumentMask - -@dynamic fieldPathsArray, fieldPathsArray_Count; - -typedef struct GCFSDocumentMask__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *fieldPathsArray; -} GCFSDocumentMask__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "fieldPathsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentMask_FieldNumber_FieldPathsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocumentMask__storage_, fieldPathsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocumentMask class] - rootClass:[GCFSCommonRoot class] - file:GCFSCommonRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocumentMask__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSPrecondition - -@implementation GCFSPrecondition - -@dynamic conditionTypeOneOfCase; -@dynamic exists; -@dynamic updateTime; - -typedef struct GCFSPrecondition__storage_ { - uint32_t _has_storage_[2]; - GPBTimestamp *updateTime; -} GCFSPrecondition__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "exists", - .dataTypeSpecific.className = NULL, - .number = GCFSPrecondition_FieldNumber_Exists, - .hasIndex = -1, - .offset = 0, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - { - .name = "updateTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSPrecondition_FieldNumber_UpdateTime, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSPrecondition__storage_, updateTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSPrecondition class] - rootClass:[GCFSCommonRoot class] - file:GCFSCommonRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSPrecondition__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "conditionType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSPrecondition_ClearConditionTypeOneOfCase(GCFSPrecondition *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSTransactionOptions - -@implementation GCFSTransactionOptions - -@dynamic modeOneOfCase; -@dynamic readOnly; -@dynamic readWrite; - -typedef struct GCFSTransactionOptions__storage_ { - uint32_t _has_storage_[2]; - GCFSTransactionOptions_ReadOnly *readOnly; - GCFSTransactionOptions_ReadWrite *readWrite; -} GCFSTransactionOptions__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "readOnly", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions_ReadOnly), - .number = GCFSTransactionOptions_FieldNumber_ReadOnly, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSTransactionOptions__storage_, readOnly), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "readWrite", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions_ReadWrite), - .number = GCFSTransactionOptions_FieldNumber_ReadWrite, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSTransactionOptions__storage_, readWrite), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTransactionOptions class] - rootClass:[GCFSCommonRoot class] - file:GCFSCommonRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTransactionOptions__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "mode", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSTransactionOptions_ClearModeOneOfCase(GCFSTransactionOptions *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSTransactionOptions_ReadWrite - -@implementation GCFSTransactionOptions_ReadWrite - -@dynamic retryTransaction; - -typedef struct GCFSTransactionOptions_ReadWrite__storage_ { - uint32_t _has_storage_[1]; - NSData *retryTransaction; -} GCFSTransactionOptions_ReadWrite__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "retryTransaction", - .dataTypeSpecific.className = NULL, - .number = GCFSTransactionOptions_ReadWrite_FieldNumber_RetryTransaction, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSTransactionOptions_ReadWrite__storage_, retryTransaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTransactionOptions_ReadWrite class] - rootClass:[GCFSCommonRoot class] - file:GCFSCommonRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTransactionOptions_ReadWrite__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTransactionOptions)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSTransactionOptions_ReadOnly - -@implementation GCFSTransactionOptions_ReadOnly - -@dynamic consistencySelectorOneOfCase; -@dynamic readTime; - -typedef struct GCFSTransactionOptions_ReadOnly__storage_ { - uint32_t _has_storage_[2]; - GPBTimestamp *readTime; -} GCFSTransactionOptions_ReadOnly__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSTransactionOptions_ReadOnly_FieldNumber_ReadTime, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSTransactionOptions_ReadOnly__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTransactionOptions_ReadOnly class] - rootClass:[GCFSCommonRoot class] - file:GCFSCommonRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTransactionOptions_ReadOnly__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "consistencySelector", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTransactionOptions)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSTransactionOptions_ReadOnly_ClearConsistencySelectorOneOfCase(GCFSTransactionOptions_ReadOnly *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.h deleted file mode 100644 index f47472462..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.h +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/document.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSArrayValue; -@class GCFSMapValue; -@class GCFSValue; -@class GPBTimestamp; -@class GTPLatLng; -GPB_ENUM_FWD_DECLARE(GPBNullValue); - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - GCFSDocumentRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GCFSDocumentRoot : GPBRootObject -@end - -#pragma mark - GCFSDocument - -typedef GPB_ENUM(GCFSDocument_FieldNumber) { - GCFSDocument_FieldNumber_Name = 1, - GCFSDocument_FieldNumber_Fields = 2, - GCFSDocument_FieldNumber_CreateTime = 3, - GCFSDocument_FieldNumber_UpdateTime = 4, -}; - -/** - * A Firestore document. - * - * Must not exceed 1 MiB - 4 bytes. - **/ -@interface GCFSDocument : GPBMessage - -/** - * The resource name of the document, for example - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *name; - -/** - * The document's fields. - * - * The map keys represent field names. - * - * A simple field name contains only characters `a` to `z`, `A` to `Z`, - * `0` to `9`, or `_`, and must not start with `0` to `9`. For example, - * `foo_bar_17`. - * - * Field names matching the regular expression `__.*__` are reserved. Reserved - * field names are forbidden except in certain documented contexts. The map - * keys, represented as UTF-8, must not exceed 1,500 bytes and cannot be - * empty. - * - * Field paths may be used in other contexts to refer to structured fields - * defined here. For `map_value`, the field path is represented by the simple - * or quoted field names of the containing fields, delimited by `.`. For - * example, the structured field - * `"foo" : { map_value: { "x&y" : { string_value: "hello" }}}` would be - * represented by the field path `foo.x&y`. - * - * Within a field path, a quoted field name starts and ends with `` ` `` and - * may contain any character. Some characters, including `` ` ``, must be - * escaped using a `\\`. For example, `` `x&y` `` represents `x&y` and - * `` `bak\\`tik` `` represents `` bak`tik ``. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *fields; -/** The number of items in @c fields without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger fields_Count; - -/** - * Output only. The time at which the document was created. - * - * This value increases monotonically when a document is deleted then - * recreated. It can also be compared to values from other documents and - * the `read_time` of a query. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *createTime; -/** Test to see if @c createTime has been set. */ -@property(nonatomic, readwrite) BOOL hasCreateTime; - -/** - * Output only. The time at which the document was last changed. - * - * This value is initially set to the `create_time` then increases - * monotonically with each change to the document. It can also be - * compared to values from other documents and the `read_time` of a query. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *updateTime; -/** Test to see if @c updateTime has been set. */ -@property(nonatomic, readwrite) BOOL hasUpdateTime; - -@end - -#pragma mark - GCFSValue - -typedef GPB_ENUM(GCFSValue_FieldNumber) { - GCFSValue_FieldNumber_BooleanValue = 1, - GCFSValue_FieldNumber_IntegerValue = 2, - GCFSValue_FieldNumber_DoubleValue = 3, - GCFSValue_FieldNumber_ReferenceValue = 5, - GCFSValue_FieldNumber_MapValue = 6, - GCFSValue_FieldNumber_GeoPointValue = 8, - GCFSValue_FieldNumber_ArrayValue = 9, - GCFSValue_FieldNumber_TimestampValue = 10, - GCFSValue_FieldNumber_NullValue = 11, - GCFSValue_FieldNumber_StringValue = 17, - GCFSValue_FieldNumber_BytesValue = 18, -}; - -typedef GPB_ENUM(GCFSValue_ValueType_OneOfCase) { - GCFSValue_ValueType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSValue_ValueType_OneOfCase_NullValue = 11, - GCFSValue_ValueType_OneOfCase_BooleanValue = 1, - GCFSValue_ValueType_OneOfCase_IntegerValue = 2, - GCFSValue_ValueType_OneOfCase_DoubleValue = 3, - GCFSValue_ValueType_OneOfCase_TimestampValue = 10, - GCFSValue_ValueType_OneOfCase_StringValue = 17, - GCFSValue_ValueType_OneOfCase_BytesValue = 18, - GCFSValue_ValueType_OneOfCase_ReferenceValue = 5, - GCFSValue_ValueType_OneOfCase_GeoPointValue = 8, - GCFSValue_ValueType_OneOfCase_ArrayValue = 9, - GCFSValue_ValueType_OneOfCase_MapValue = 6, -}; - -/** - * A message that can hold any of the supported value types. - **/ -@interface GCFSValue : GPBMessage - -/** Must have a value set. */ -@property(nonatomic, readonly) GCFSValue_ValueType_OneOfCase valueTypeOneOfCase; - -/** A null value. */ -@property(nonatomic, readwrite) enum GPBNullValue nullValue; - -/** A boolean value. */ -@property(nonatomic, readwrite) BOOL booleanValue; - -/** An integer value. */ -@property(nonatomic, readwrite) int64_t integerValue; - -/** A double value. */ -@property(nonatomic, readwrite) double doubleValue; - -/** - * A timestamp value. - * - * Precise only to microseconds. When stored, any additional precision is - * rounded down. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *timestampValue; - -/** - * A string value. - * - * The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes of the UTF-8 representation are considered by - * queries. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *stringValue; - -/** - * A bytes value. - * - * Must not exceed 1 MiB - 89 bytes. - * Only the first 1,500 bytes are considered by queries. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *bytesValue; - -/** - * A reference to a document. For example: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *referenceValue; - -/** A geo point value representing a point on the surface of Earth. */ -@property(nonatomic, readwrite, strong, null_resettable) GTPLatLng *geoPointValue; - -/** - * An array value. - * - * Cannot directly contain another array value, though can contain an - * map which contains another array. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSArrayValue *arrayValue; - -/** A map value. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSMapValue *mapValue; - -@end - -/** - * Fetches the raw value of a @c GCFSValue's @c nullValue property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSValue_NullValue_RawValue(GCFSValue *message); -/** - * Sets the raw value of an @c GCFSValue's @c nullValue property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSValue_NullValue_RawValue(GCFSValue *message, int32_t value); - -/** - * Clears whatever value was set for the oneof 'valueType'. - **/ -void GCFSValue_ClearValueTypeOneOfCase(GCFSValue *message); - -#pragma mark - GCFSArrayValue - -typedef GPB_ENUM(GCFSArrayValue_FieldNumber) { - GCFSArrayValue_FieldNumber_ValuesArray = 1, -}; - -/** - * An array value. - **/ -@interface GCFSArrayValue : GPBMessage - -/** Values in the array. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *valuesArray; -/** The number of items in @c valuesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger valuesArray_Count; - -@end - -#pragma mark - GCFSMapValue - -typedef GPB_ENUM(GCFSMapValue_FieldNumber) { - GCFSMapValue_FieldNumber_Fields = 1, -}; - -/** - * A map value. - **/ -@interface GCFSMapValue : GPBMessage - -/** - * The map's fields. - * - * The map keys represent field names. Field names matching the regular - * expression `__.*__` are reserved. Reserved field names are forbidden except - * in certain documented contexts. The map keys, represented as UTF-8, must - * not exceed 1,500 bytes and cannot be empty. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *fields; -/** The number of items in @c fields without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger fields_Count; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.m deleted file mode 100644 index 0d1c2dab4..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.m +++ /dev/null @@ -1,412 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/document.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import - #import -#else - #import "Struct.pbobjc.h" - #import "Timestamp.pbobjc.h" -#endif - - #import "Document.pbobjc.h" - #import "Annotations.pbobjc.h" - #import "Latlng.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - GCFSDocumentRoot - -@implementation GCFSDocumentRoot - - -@end - -#pragma mark - GCFSDocumentRoot_FileDescriptor - -static GPBFileDescriptor *GCFSDocumentRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.firestore.v1" - objcPrefix:@"GCFS" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GCFSDocument - -@implementation GCFSDocument - -@dynamic name; -@dynamic fields, fields_Count; -@dynamic hasCreateTime, createTime; -@dynamic hasUpdateTime, updateTime; - -typedef struct GCFSDocument__storage_ { - uint32_t _has_storage_[1]; - NSString *name; - NSMutableDictionary *fields; - GPBTimestamp *createTime; - GPBTimestamp *updateTime; -} GCFSDocument__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "name", - .dataTypeSpecific.className = NULL, - .number = GCFSDocument_FieldNumber_Name, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDocument__storage_, name), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "fields", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSDocument_FieldNumber_Fields, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocument__storage_, fields), - .flags = GPBFieldMapKeyString, - .dataType = GPBDataTypeMessage, - }, - { - .name = "createTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSDocument_FieldNumber_CreateTime, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSDocument__storage_, createTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "updateTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSDocument_FieldNumber_UpdateTime, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSDocument__storage_, updateTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocument class] - rootClass:[GCFSDocumentRoot class] - file:GCFSDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocument__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSValue - -@implementation GCFSValue - -@dynamic valueTypeOneOfCase; -@dynamic nullValue; -@dynamic booleanValue; -@dynamic integerValue; -@dynamic doubleValue; -@dynamic timestampValue; -@dynamic stringValue; -@dynamic bytesValue; -@dynamic referenceValue; -@dynamic geoPointValue; -@dynamic arrayValue; -@dynamic mapValue; - -typedef struct GCFSValue__storage_ { - uint32_t _has_storage_[2]; - GPBNullValue nullValue; - NSString *referenceValue; - GCFSMapValue *mapValue; - GTPLatLng *geoPointValue; - GCFSArrayValue *arrayValue; - GPBTimestamp *timestampValue; - NSString *stringValue; - NSData *bytesValue; - int64_t integerValue; - double doubleValue; -} GCFSValue__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "booleanValue", - .dataTypeSpecific.className = NULL, - .number = GCFSValue_FieldNumber_BooleanValue, - .hasIndex = -1, - .offset = 0, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - { - .name = "integerValue", - .dataTypeSpecific.className = NULL, - .number = GCFSValue_FieldNumber_IntegerValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, integerValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt64, - }, - { - .name = "doubleValue", - .dataTypeSpecific.className = NULL, - .number = GCFSValue_FieldNumber_DoubleValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, doubleValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeDouble, - }, - { - .name = "referenceValue", - .dataTypeSpecific.className = NULL, - .number = GCFSValue_FieldNumber_ReferenceValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, referenceValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "mapValue", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSMapValue), - .number = GCFSValue_FieldNumber_MapValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, mapValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "geoPointValue", - .dataTypeSpecific.className = GPBStringifySymbol(GTPLatLng), - .number = GCFSValue_FieldNumber_GeoPointValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, geoPointValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "arrayValue", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSArrayValue), - .number = GCFSValue_FieldNumber_ArrayValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, arrayValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "timestampValue", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSValue_FieldNumber_TimestampValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, timestampValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "nullValue", - .dataTypeSpecific.enumDescFunc = GPBNullValue_EnumDescriptor, - .number = GCFSValue_FieldNumber_NullValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, nullValue), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - { - .name = "stringValue", - .dataTypeSpecific.className = NULL, - .number = GCFSValue_FieldNumber_StringValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, stringValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "bytesValue", - .dataTypeSpecific.className = NULL, - .number = GCFSValue_FieldNumber_BytesValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSValue__storage_, bytesValue), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSValue class] - rootClass:[GCFSDocumentRoot class] - file:GCFSDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSValue__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "valueType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSValue_NullValue_RawValue(GCFSValue *message) { - GPBDescriptor *descriptor = [GCFSValue descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSValue_FieldNumber_NullValue]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSValue_NullValue_RawValue(GCFSValue *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSValue descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSValue_FieldNumber_NullValue]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -void GCFSValue_ClearValueTypeOneOfCase(GCFSValue *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSArrayValue - -@implementation GCFSArrayValue - -@dynamic valuesArray, valuesArray_Count; - -typedef struct GCFSArrayValue__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *valuesArray; -} GCFSArrayValue__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "valuesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSArrayValue_FieldNumber_ValuesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSArrayValue__storage_, valuesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSArrayValue class] - rootClass:[GCFSDocumentRoot class] - file:GCFSDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSArrayValue__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSMapValue - -@implementation GCFSMapValue - -@dynamic fields, fields_Count; - -typedef struct GCFSMapValue__storage_ { - uint32_t _has_storage_[1]; - NSMutableDictionary *fields; -} GCFSMapValue__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "fields", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSMapValue_FieldNumber_Fields, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSMapValue__storage_, fields), - .flags = GPBFieldMapKeyString, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSMapValue class] - rootClass:[GCFSDocumentRoot class] - file:GCFSDocumentRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSMapValue__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h deleted file mode 100644 index 8833c84f0..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h +++ /dev/null @@ -1,1339 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/firestore.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSDocument; -@class GCFSDocumentChange; -@class GCFSDocumentDelete; -@class GCFSDocumentMask; -@class GCFSDocumentRemove; -@class GCFSExistenceFilter; -@class GCFSPrecondition; -@class GCFSStructuredQuery; -@class GCFSTarget; -@class GCFSTargetChange; -@class GCFSTarget_DocumentsTarget; -@class GCFSTarget_QueryTarget; -@class GCFSTransactionOptions; -@class GCFSWrite; -@class GCFSWriteResult; -@class GPBTimestamp; -@class RPCStatus; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - Enum GCFSTargetChange_TargetChangeType - -/** The type of change. */ -typedef GPB_ENUM(GCFSTargetChange_TargetChangeType) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GCFSTargetChange_TargetChangeType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** No change has occurred. Used only to send an updated `resume_token`. */ - GCFSTargetChange_TargetChangeType_NoChange = 0, - - /** The targets have been added. */ - GCFSTargetChange_TargetChangeType_Add = 1, - - /** The targets have been removed. */ - GCFSTargetChange_TargetChangeType_Remove = 2, - - /** - * The targets reflect all changes committed before the targets were added - * to the stream. - * - * This will be sent after or with a `read_time` that is greater than or - * equal to the time at which the targets were added. - * - * Listeners can wait for this change if read-after-write semantics - * are desired. - **/ - GCFSTargetChange_TargetChangeType_Current = 3, - - /** - * The targets have been reset, and a new initial state for the targets - * will be returned in subsequent changes. - * - * After the initial state is complete, `CURRENT` will be returned even - * if the target was previously indicated to be `CURRENT`. - **/ - GCFSTargetChange_TargetChangeType_Reset = 4, -}; - -GPBEnumDescriptor *GCFSTargetChange_TargetChangeType_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GCFSTargetChange_TargetChangeType_IsValidValue(int32_t value); - -#pragma mark - GCFSFirestoreRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GCFSFirestoreRoot : GPBRootObject -@end - -#pragma mark - GCFSGetDocumentRequest - -typedef GPB_ENUM(GCFSGetDocumentRequest_FieldNumber) { - GCFSGetDocumentRequest_FieldNumber_Name = 1, - GCFSGetDocumentRequest_FieldNumber_Mask = 2, - GCFSGetDocumentRequest_FieldNumber_Transaction = 3, - GCFSGetDocumentRequest_FieldNumber_ReadTime = 5, -}; - -typedef GPB_ENUM(GCFSGetDocumentRequest_ConsistencySelector_OneOfCase) { - GCFSGetDocumentRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSGetDocumentRequest_ConsistencySelector_OneOfCase_Transaction = 3, - GCFSGetDocumentRequest_ConsistencySelector_OneOfCase_ReadTime = 5, -}; - -/** - * The request for [Firestore.GetDocument][google.firestore.v1.Firestore.GetDocument]. - **/ -@interface GCFSGetDocumentRequest : GPBMessage - -/** - * The resource name of the Document to get. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *name; - -/** - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; -/** Test to see if @c mask has been set. */ -@property(nonatomic, readwrite) BOOL hasMask; - -/** - * The consistency mode for this transaction. - * If not set, defaults to strong consistency. - **/ -@property(nonatomic, readonly) GCFSGetDocumentRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; - -/** Reads the document in a transaction. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -/** - * Reads the version of the document at the given time. - * This may not be older than 60 seconds. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; - -@end - -/** - * Clears whatever value was set for the oneof 'consistencySelector'. - **/ -void GCFSGetDocumentRequest_ClearConsistencySelectorOneOfCase(GCFSGetDocumentRequest *message); - -#pragma mark - GCFSListDocumentsRequest - -typedef GPB_ENUM(GCFSListDocumentsRequest_FieldNumber) { - GCFSListDocumentsRequest_FieldNumber_Parent = 1, - GCFSListDocumentsRequest_FieldNumber_CollectionId = 2, - GCFSListDocumentsRequest_FieldNumber_PageSize = 3, - GCFSListDocumentsRequest_FieldNumber_PageToken = 4, - GCFSListDocumentsRequest_FieldNumber_OrderBy = 6, - GCFSListDocumentsRequest_FieldNumber_Mask = 7, - GCFSListDocumentsRequest_FieldNumber_Transaction = 8, - GCFSListDocumentsRequest_FieldNumber_ReadTime = 10, - GCFSListDocumentsRequest_FieldNumber_ShowMissing = 12, -}; - -typedef GPB_ENUM(GCFSListDocumentsRequest_ConsistencySelector_OneOfCase) { - GCFSListDocumentsRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSListDocumentsRequest_ConsistencySelector_OneOfCase_Transaction = 8, - GCFSListDocumentsRequest_ConsistencySelector_OneOfCase_ReadTime = 10, -}; - -/** - * The request for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments]. - **/ -@interface GCFSListDocumentsRequest : GPBMessage - -/** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; - -/** - * The collection ID, relative to `parent`, to list. For example: `chatrooms` - * or `messages`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *collectionId; - -/** The maximum number of documents to return. */ -@property(nonatomic, readwrite) int32_t pageSize; - -/** The `next_page_token` value returned from a previous List request, if any. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *pageToken; - -/** The order to sort results by. For example: `priority desc, name`. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *orderBy; - -/** - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field - * will not be returned in the response. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; -/** Test to see if @c mask has been set. */ -@property(nonatomic, readwrite) BOOL hasMask; - -/** - * The consistency mode for this transaction. - * If not set, defaults to strong consistency. - **/ -@property(nonatomic, readonly) GCFSListDocumentsRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; - -/** Reads documents in a transaction. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -/** - * Reads documents as they were at the given time. - * This may not be older than 60 seconds. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; - -/** - * If the list should show missing documents. A missing document is a - * document that does not exist but has sub-documents. These documents will - * be returned with a key but will not have fields, [Document.create_time][google.firestore.v1.Document.create_time], - * or [Document.update_time][google.firestore.v1.Document.update_time] set. - * - * Requests with `show_missing` may not specify `where` or - * `order_by`. - **/ -@property(nonatomic, readwrite) BOOL showMissing; - -@end - -/** - * Clears whatever value was set for the oneof 'consistencySelector'. - **/ -void GCFSListDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSListDocumentsRequest *message); - -#pragma mark - GCFSListDocumentsResponse - -typedef GPB_ENUM(GCFSListDocumentsResponse_FieldNumber) { - GCFSListDocumentsResponse_FieldNumber_DocumentsArray = 1, - GCFSListDocumentsResponse_FieldNumber_NextPageToken = 2, -}; - -/** - * The response for [Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments]. - **/ -@interface GCFSListDocumentsResponse : GPBMessage - -/** The Documents found. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *documentsArray; -/** The number of items in @c documentsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger documentsArray_Count; - -/** The next page token. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *nextPageToken; - -@end - -#pragma mark - GCFSCreateDocumentRequest - -typedef GPB_ENUM(GCFSCreateDocumentRequest_FieldNumber) { - GCFSCreateDocumentRequest_FieldNumber_Parent = 1, - GCFSCreateDocumentRequest_FieldNumber_CollectionId = 2, - GCFSCreateDocumentRequest_FieldNumber_DocumentId = 3, - GCFSCreateDocumentRequest_FieldNumber_Document = 4, - GCFSCreateDocumentRequest_FieldNumber_Mask = 5, -}; - -/** - * The request for [Firestore.CreateDocument][google.firestore.v1.Firestore.CreateDocument]. - **/ -@interface GCFSCreateDocumentRequest : GPBMessage - -/** - * The parent resource. For example: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/chatrooms/{chatroom_id}` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; - -/** The collection ID, relative to `parent`, to list. For example: `chatrooms`. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *collectionId; - -/** - * The client-assigned document ID to use for this document. - * - * Optional. If not specified, an ID will be assigned by the service. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *documentId; - -/** The document to create. `name` must not be set. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; -/** Test to see if @c document has been set. */ -@property(nonatomic, readwrite) BOOL hasDocument; - -/** - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; -/** Test to see if @c mask has been set. */ -@property(nonatomic, readwrite) BOOL hasMask; - -@end - -#pragma mark - GCFSUpdateDocumentRequest - -typedef GPB_ENUM(GCFSUpdateDocumentRequest_FieldNumber) { - GCFSUpdateDocumentRequest_FieldNumber_Document = 1, - GCFSUpdateDocumentRequest_FieldNumber_UpdateMask = 2, - GCFSUpdateDocumentRequest_FieldNumber_Mask = 3, - GCFSUpdateDocumentRequest_FieldNumber_CurrentDocument = 4, -}; - -/** - * The request for [Firestore.UpdateDocument][google.firestore.v1.Firestore.UpdateDocument]. - **/ -@interface GCFSUpdateDocumentRequest : GPBMessage - -/** - * The updated document. - * Creates the document if it does not already exist. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; -/** Test to see if @c document has been set. */ -@property(nonatomic, readwrite) BOOL hasDocument; - -/** - * The fields to update. - * None of the field paths in the mask may contain a reserved name. - * - * If the document exists on the server and has fields not referenced in the - * mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *updateMask; -/** Test to see if @c updateMask has been set. */ -@property(nonatomic, readwrite) BOOL hasUpdateMask; - -/** - * The fields to return. If not set, returns all fields. - * - * If the document has a field that is not present in this mask, that field - * will not be returned in the response. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; -/** Test to see if @c mask has been set. */ -@property(nonatomic, readwrite) BOOL hasMask; - -/** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSPrecondition *currentDocument; -/** Test to see if @c currentDocument has been set. */ -@property(nonatomic, readwrite) BOOL hasCurrentDocument; - -@end - -#pragma mark - GCFSDeleteDocumentRequest - -typedef GPB_ENUM(GCFSDeleteDocumentRequest_FieldNumber) { - GCFSDeleteDocumentRequest_FieldNumber_Name = 1, - GCFSDeleteDocumentRequest_FieldNumber_CurrentDocument = 2, -}; - -/** - * The request for [Firestore.DeleteDocument][google.firestore.v1.Firestore.DeleteDocument]. - **/ -@interface GCFSDeleteDocumentRequest : GPBMessage - -/** - * The resource name of the Document to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *name; - -/** - * An optional precondition on the document. - * The request will fail if this is set and not met by the target document. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSPrecondition *currentDocument; -/** Test to see if @c currentDocument has been set. */ -@property(nonatomic, readwrite) BOOL hasCurrentDocument; - -@end - -#pragma mark - GCFSBatchGetDocumentsRequest - -typedef GPB_ENUM(GCFSBatchGetDocumentsRequest_FieldNumber) { - GCFSBatchGetDocumentsRequest_FieldNumber_Database = 1, - GCFSBatchGetDocumentsRequest_FieldNumber_DocumentsArray = 2, - GCFSBatchGetDocumentsRequest_FieldNumber_Mask = 3, - GCFSBatchGetDocumentsRequest_FieldNumber_Transaction = 4, - GCFSBatchGetDocumentsRequest_FieldNumber_NewTransaction = 5, - GCFSBatchGetDocumentsRequest_FieldNumber_ReadTime = 7, -}; - -typedef GPB_ENUM(GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase) { - GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_Transaction = 4, - GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_NewTransaction = 5, - GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase_ReadTime = 7, -}; - -/** - * The request for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments]. - **/ -@interface GCFSBatchGetDocumentsRequest : GPBMessage - -/** - * The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *database; - -/** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of the - * given `database`. Duplicate names will be elided. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *documentsArray; -/** The number of items in @c documentsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger documentsArray_Count; - -/** - * The fields to return. If not set, returns all fields. - * - * If a document has a field that is not present in this mask, that field will - * not be returned in the response. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *mask; -/** Test to see if @c mask has been set. */ -@property(nonatomic, readwrite) BOOL hasMask; - -/** - * The consistency mode for this transaction. - * If not set, defaults to strong consistency. - **/ -@property(nonatomic, readonly) GCFSBatchGetDocumentsRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; - -/** Reads documents in a transaction. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -/** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions *newTransaction NS_RETURNS_NOT_RETAINED; - -/** - * Reads documents as they were at the given time. - * This may not be older than 60 seconds. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; - -@end - -/** - * Clears whatever value was set for the oneof 'consistencySelector'. - **/ -void GCFSBatchGetDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSBatchGetDocumentsRequest *message); - -#pragma mark - GCFSBatchGetDocumentsResponse - -typedef GPB_ENUM(GCFSBatchGetDocumentsResponse_FieldNumber) { - GCFSBatchGetDocumentsResponse_FieldNumber_Found = 1, - GCFSBatchGetDocumentsResponse_FieldNumber_Missing = 2, - GCFSBatchGetDocumentsResponse_FieldNumber_Transaction = 3, - GCFSBatchGetDocumentsResponse_FieldNumber_ReadTime = 4, -}; - -typedef GPB_ENUM(GCFSBatchGetDocumentsResponse_Result_OneOfCase) { - GCFSBatchGetDocumentsResponse_Result_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSBatchGetDocumentsResponse_Result_OneOfCase_Found = 1, - GCFSBatchGetDocumentsResponse_Result_OneOfCase_Missing = 2, -}; - -/** - * The streamed response for [Firestore.BatchGetDocuments][google.firestore.v1.Firestore.BatchGetDocuments]. - **/ -@interface GCFSBatchGetDocumentsResponse : GPBMessage - -/** - * A single result. - * This can be empty if the server is just returning a transaction. - **/ -@property(nonatomic, readonly) GCFSBatchGetDocumentsResponse_Result_OneOfCase resultOneOfCase; - -/** A document that was requested. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *found; - -/** - * A document name that was requested but does not exist. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *missing; - -/** - * The transaction that was started as part of this request. - * Will only be set in the first response, and only if - * [BatchGetDocumentsRequest.new_transaction][google.firestore.v1.BatchGetDocumentsRequest.new_transaction] was set in the request. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -/** - * The time at which the document was read. - * This may be monotically increasing, in this case the previous documents in - * the result stream are guaranteed not to have changed between their - * read_time and this one. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; -/** Test to see if @c readTime has been set. */ -@property(nonatomic, readwrite) BOOL hasReadTime; - -@end - -/** - * Clears whatever value was set for the oneof 'result'. - **/ -void GCFSBatchGetDocumentsResponse_ClearResultOneOfCase(GCFSBatchGetDocumentsResponse *message); - -#pragma mark - GCFSBeginTransactionRequest - -typedef GPB_ENUM(GCFSBeginTransactionRequest_FieldNumber) { - GCFSBeginTransactionRequest_FieldNumber_Database = 1, - GCFSBeginTransactionRequest_FieldNumber_Options = 2, -}; - -/** - * The request for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction]. - **/ -@interface GCFSBeginTransactionRequest : GPBMessage - -/** - * The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *database; - -/** - * The options for the transaction. - * Defaults to a read-write transaction. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions *options; -/** Test to see if @c options has been set. */ -@property(nonatomic, readwrite) BOOL hasOptions; - -@end - -#pragma mark - GCFSBeginTransactionResponse - -typedef GPB_ENUM(GCFSBeginTransactionResponse_FieldNumber) { - GCFSBeginTransactionResponse_FieldNumber_Transaction = 1, -}; - -/** - * The response for [Firestore.BeginTransaction][google.firestore.v1.Firestore.BeginTransaction]. - **/ -@interface GCFSBeginTransactionResponse : GPBMessage - -/** The transaction that was started. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -@end - -#pragma mark - GCFSCommitRequest - -typedef GPB_ENUM(GCFSCommitRequest_FieldNumber) { - GCFSCommitRequest_FieldNumber_Database = 1, - GCFSCommitRequest_FieldNumber_WritesArray = 2, - GCFSCommitRequest_FieldNumber_Transaction = 3, -}; - -/** - * The request for [Firestore.Commit][google.firestore.v1.Firestore.Commit]. - **/ -@interface GCFSCommitRequest : GPBMessage - -/** - * The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *database; - -/** - * The writes to apply. - * - * Always executed atomically and in order. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *writesArray; -/** The number of items in @c writesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger writesArray_Count; - -/** If set, applies all writes in this transaction, and commits it. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -@end - -#pragma mark - GCFSCommitResponse - -typedef GPB_ENUM(GCFSCommitResponse_FieldNumber) { - GCFSCommitResponse_FieldNumber_WriteResultsArray = 1, - GCFSCommitResponse_FieldNumber_CommitTime = 2, -}; - -/** - * The response for [Firestore.Commit][google.firestore.v1.Firestore.Commit]. - **/ -@interface GCFSCommitResponse : GPBMessage - -/** - * The result of applying the writes. - * - * This i-th write result corresponds to the i-th write in the - * request. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *writeResultsArray; -/** The number of items in @c writeResultsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger writeResultsArray_Count; - -/** The time at which the commit occurred. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *commitTime; -/** Test to see if @c commitTime has been set. */ -@property(nonatomic, readwrite) BOOL hasCommitTime; - -@end - -#pragma mark - GCFSRollbackRequest - -typedef GPB_ENUM(GCFSRollbackRequest_FieldNumber) { - GCFSRollbackRequest_FieldNumber_Database = 1, - GCFSRollbackRequest_FieldNumber_Transaction = 2, -}; - -/** - * The request for [Firestore.Rollback][google.firestore.v1.Firestore.Rollback]. - **/ -@interface GCFSRollbackRequest : GPBMessage - -/** - * The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *database; - -/** The transaction to roll back. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -@end - -#pragma mark - GCFSRunQueryRequest - -typedef GPB_ENUM(GCFSRunQueryRequest_FieldNumber) { - GCFSRunQueryRequest_FieldNumber_Parent = 1, - GCFSRunQueryRequest_FieldNumber_StructuredQuery = 2, - GCFSRunQueryRequest_FieldNumber_Transaction = 5, - GCFSRunQueryRequest_FieldNumber_NewTransaction = 6, - GCFSRunQueryRequest_FieldNumber_ReadTime = 7, -}; - -typedef GPB_ENUM(GCFSRunQueryRequest_QueryType_OneOfCase) { - GCFSRunQueryRequest_QueryType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSRunQueryRequest_QueryType_OneOfCase_StructuredQuery = 2, -}; - -typedef GPB_ENUM(GCFSRunQueryRequest_ConsistencySelector_OneOfCase) { - GCFSRunQueryRequest_ConsistencySelector_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSRunQueryRequest_ConsistencySelector_OneOfCase_Transaction = 5, - GCFSRunQueryRequest_ConsistencySelector_OneOfCase_NewTransaction = 6, - GCFSRunQueryRequest_ConsistencySelector_OneOfCase_ReadTime = 7, -}; - -/** - * The request for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery]. - **/ -@interface GCFSRunQueryRequest : GPBMessage - -/** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; - -/** The query to run. */ -@property(nonatomic, readonly) GCFSRunQueryRequest_QueryType_OneOfCase queryTypeOneOfCase; - -/** A structured query. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery *structuredQuery; - -/** - * The consistency mode for this transaction. - * If not set, defaults to strong consistency. - **/ -@property(nonatomic, readonly) GCFSRunQueryRequest_ConsistencySelector_OneOfCase consistencySelectorOneOfCase; - -/** Reads documents in a transaction. */ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -/** - * Starts a new transaction and reads the documents. - * Defaults to a read-only transaction. - * The new transaction ID will be returned as the first response in the - * stream. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTransactionOptions *newTransaction NS_RETURNS_NOT_RETAINED; - -/** - * Reads documents as they were at the given time. - * This may not be older than 60 seconds. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; - -@end - -/** - * Clears whatever value was set for the oneof 'queryType'. - **/ -void GCFSRunQueryRequest_ClearQueryTypeOneOfCase(GCFSRunQueryRequest *message); -/** - * Clears whatever value was set for the oneof 'consistencySelector'. - **/ -void GCFSRunQueryRequest_ClearConsistencySelectorOneOfCase(GCFSRunQueryRequest *message); - -#pragma mark - GCFSRunQueryResponse - -typedef GPB_ENUM(GCFSRunQueryResponse_FieldNumber) { - GCFSRunQueryResponse_FieldNumber_Document = 1, - GCFSRunQueryResponse_FieldNumber_Transaction = 2, - GCFSRunQueryResponse_FieldNumber_ReadTime = 3, - GCFSRunQueryResponse_FieldNumber_SkippedResults = 4, -}; - -/** - * The response for [Firestore.RunQuery][google.firestore.v1.Firestore.RunQuery]. - **/ -@interface GCFSRunQueryResponse : GPBMessage - -/** - * The transaction that was started as part of this request. - * Can only be set in the first response, and only if - * [RunQueryRequest.new_transaction][google.firestore.v1.RunQueryRequest.new_transaction] was set in the request. - * If set, no other fields will be set in this response. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *transaction; - -/** - * A query result. - * Not set when reporting partial progress. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; -/** Test to see if @c document has been set. */ -@property(nonatomic, readwrite) BOOL hasDocument; - -/** - * The time at which the document was read. This may be monotonically - * increasing; in this case, the previous documents in the result stream are - * guaranteed not to have changed between their `read_time` and this one. - * - * If the query returns no results, a response with `read_time` and no - * `document` will be sent, and this represents the time at which the query - * was run. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; -/** Test to see if @c readTime has been set. */ -@property(nonatomic, readwrite) BOOL hasReadTime; - -/** - * The number of results that have been skipped due to an offset between - * the last response and the current response. - **/ -@property(nonatomic, readwrite) int32_t skippedResults; - -@end - -#pragma mark - GCFSWriteRequest - -typedef GPB_ENUM(GCFSWriteRequest_FieldNumber) { - GCFSWriteRequest_FieldNumber_Database = 1, - GCFSWriteRequest_FieldNumber_StreamId = 2, - GCFSWriteRequest_FieldNumber_WritesArray = 3, - GCFSWriteRequest_FieldNumber_StreamToken = 4, - GCFSWriteRequest_FieldNumber_Labels = 5, -}; - -/** - * The request for [Firestore.Write][google.firestore.v1.Firestore.Write]. - * - * The first request creates a stream, or resumes an existing one from a token. - * - * When creating a new stream, the server replies with a response containing - * only an ID and a token, to use in the next request. - * - * When resuming a stream, the server first streams any responses later than the - * given token, then a response containing only an up-to-date token, to use in - * the next request. - **/ -@interface GCFSWriteRequest : GPBMessage - -/** - * The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - * This is only required in the first message. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *database; - -/** - * The ID of the write stream to resume. - * This may only be set in the first message. When left empty, a new write - * stream will be created. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *streamId; - -/** - * The writes to apply. - * - * Always executed atomically and in order. - * This must be empty on the first request. - * This may be empty on the last request. - * This must not be empty on all other requests. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *writesArray; -/** The number of items in @c writesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger writesArray_Count; - -/** - * A stream token that was previously sent by the server. - * - * The client should set this field to the token from the most recent - * [WriteResponse][google.firestore.v1.WriteResponse] it has received. This acknowledges that the client has - * received responses up to this token. After sending this token, earlier - * tokens may not be used anymore. - * - * The server may close the stream if there are too many unacknowledged - * responses. - * - * Leave this field unset when creating a new stream. To resume a stream at - * a specific point, set this field and the `stream_id` field. - * - * Leave this field unset when creating a new stream. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *streamToken; - -/** Labels associated with this write request. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *labels; -/** The number of items in @c labels without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger labels_Count; - -@end - -#pragma mark - GCFSWriteResponse - -typedef GPB_ENUM(GCFSWriteResponse_FieldNumber) { - GCFSWriteResponse_FieldNumber_StreamId = 1, - GCFSWriteResponse_FieldNumber_StreamToken = 2, - GCFSWriteResponse_FieldNumber_WriteResultsArray = 3, - GCFSWriteResponse_FieldNumber_CommitTime = 4, -}; - -/** - * The response for [Firestore.Write][google.firestore.v1.Firestore.Write]. - **/ -@interface GCFSWriteResponse : GPBMessage - -/** - * The ID of the stream. - * Only set on the first message, when a new stream was created. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *streamId; - -/** - * A token that represents the position of this response in the stream. - * This can be used by a client to resume the stream at this point. - * - * This field is always set. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *streamToken; - -/** - * The result of applying the writes. - * - * This i-th write result corresponds to the i-th write in the - * request. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *writeResultsArray; -/** The number of items in @c writeResultsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger writeResultsArray_Count; - -/** The time at which the commit occurred. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *commitTime; -/** Test to see if @c commitTime has been set. */ -@property(nonatomic, readwrite) BOOL hasCommitTime; - -@end - -#pragma mark - GCFSListenRequest - -typedef GPB_ENUM(GCFSListenRequest_FieldNumber) { - GCFSListenRequest_FieldNumber_Database = 1, - GCFSListenRequest_FieldNumber_AddTarget = 2, - GCFSListenRequest_FieldNumber_RemoveTarget = 3, - GCFSListenRequest_FieldNumber_Labels = 4, -}; - -typedef GPB_ENUM(GCFSListenRequest_TargetChange_OneOfCase) { - GCFSListenRequest_TargetChange_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSListenRequest_TargetChange_OneOfCase_AddTarget = 2, - GCFSListenRequest_TargetChange_OneOfCase_RemoveTarget = 3, -}; - -/** - * A request for [Firestore.Listen][google.firestore.v1.Firestore.Listen] - **/ -@interface GCFSListenRequest : GPBMessage - -/** - * The database name. In the format: - * `projects/{project_id}/databases/{database_id}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *database; - -/** The supported target changes. */ -@property(nonatomic, readonly) GCFSListenRequest_TargetChange_OneOfCase targetChangeOneOfCase; - -/** A target to add to this stream. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget *addTarget; - -/** The ID of a target to remove from this stream. */ -@property(nonatomic, readwrite) int32_t removeTarget; - -/** Labels associated with this target change. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableDictionary *labels; -/** The number of items in @c labels without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger labels_Count; - -@end - -/** - * Clears whatever value was set for the oneof 'targetChange'. - **/ -void GCFSListenRequest_ClearTargetChangeOneOfCase(GCFSListenRequest *message); - -#pragma mark - GCFSListenResponse - -typedef GPB_ENUM(GCFSListenResponse_FieldNumber) { - GCFSListenResponse_FieldNumber_TargetChange = 2, - GCFSListenResponse_FieldNumber_DocumentChange = 3, - GCFSListenResponse_FieldNumber_DocumentDelete = 4, - GCFSListenResponse_FieldNumber_Filter = 5, - GCFSListenResponse_FieldNumber_DocumentRemove = 6, -}; - -typedef GPB_ENUM(GCFSListenResponse_ResponseType_OneOfCase) { - GCFSListenResponse_ResponseType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSListenResponse_ResponseType_OneOfCase_TargetChange = 2, - GCFSListenResponse_ResponseType_OneOfCase_DocumentChange = 3, - GCFSListenResponse_ResponseType_OneOfCase_DocumentDelete = 4, - GCFSListenResponse_ResponseType_OneOfCase_DocumentRemove = 6, - GCFSListenResponse_ResponseType_OneOfCase_Filter = 5, -}; - -/** - * The response for [Firestore.Listen][google.firestore.v1.Firestore.Listen]. - **/ -@interface GCFSListenResponse : GPBMessage - -/** The supported responses. */ -@property(nonatomic, readonly) GCFSListenResponse_ResponseType_OneOfCase responseTypeOneOfCase; - -/** Targets have changed. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTargetChange *targetChange; - -/** A [Document][google.firestore.v1.Document] has changed. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentChange *documentChange; - -/** A [Document][google.firestore.v1.Document] has been deleted. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentDelete *documentDelete; - -/** - * A [Document][google.firestore.v1.Document] has been removed from a target (because it is no longer - * relevant to that target). - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentRemove *documentRemove; - -/** - * A filter to apply to the set of documents previously returned for the - * given target. - * - * Returned when documents may have been removed from the given target, but - * the exact documents are unknown. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSExistenceFilter *filter; - -@end - -/** - * Clears whatever value was set for the oneof 'responseType'. - **/ -void GCFSListenResponse_ClearResponseTypeOneOfCase(GCFSListenResponse *message); - -#pragma mark - GCFSTarget - -typedef GPB_ENUM(GCFSTarget_FieldNumber) { - GCFSTarget_FieldNumber_Query = 2, - GCFSTarget_FieldNumber_Documents = 3, - GCFSTarget_FieldNumber_ResumeToken = 4, - GCFSTarget_FieldNumber_TargetId = 5, - GCFSTarget_FieldNumber_Once = 6, - GCFSTarget_FieldNumber_ReadTime = 11, -}; - -typedef GPB_ENUM(GCFSTarget_TargetType_OneOfCase) { - GCFSTarget_TargetType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSTarget_TargetType_OneOfCase_Query = 2, - GCFSTarget_TargetType_OneOfCase_Documents = 3, -}; - -typedef GPB_ENUM(GCFSTarget_ResumeType_OneOfCase) { - GCFSTarget_ResumeType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSTarget_ResumeType_OneOfCase_ResumeToken = 4, - GCFSTarget_ResumeType_OneOfCase_ReadTime = 11, -}; - -/** - * A specification of a set of documents to listen to. - **/ -@interface GCFSTarget : GPBMessage - -/** The type of target to listen to. */ -@property(nonatomic, readonly) GCFSTarget_TargetType_OneOfCase targetTypeOneOfCase; - -/** A target specified by a query. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget_QueryTarget *query; - -/** A target specified by a set of document names. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSTarget_DocumentsTarget *documents; - -/** - * When to start listening. - * - * If not specified, all matching Documents are returned before any - * subsequent changes. - **/ -@property(nonatomic, readonly) GCFSTarget_ResumeType_OneOfCase resumeTypeOneOfCase; - -/** - * A resume token from a prior [TargetChange][google.firestore.v1.TargetChange] for an identical target. - * - * Using a resume token with a different target is unsupported and may fail. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *resumeToken; - -/** - * Start listening after a specific `read_time`. - * - * The client must know the state of matching documents at this time. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; - -/** - * A client provided target ID. - * - * If not set, the server will assign an ID for the target. - * - * Used for resuming a target without changing IDs. The IDs can either be - * client-assigned or be server-assigned in a previous stream. All targets - * with client provided IDs must be added before adding a target that needs - * a server-assigned id. - **/ -@property(nonatomic, readwrite) int32_t targetId; - -/** If the target should be removed once it is current and consistent. */ -@property(nonatomic, readwrite) BOOL once; - -@end - -/** - * Clears whatever value was set for the oneof 'targetType'. - **/ -void GCFSTarget_ClearTargetTypeOneOfCase(GCFSTarget *message); -/** - * Clears whatever value was set for the oneof 'resumeType'. - **/ -void GCFSTarget_ClearResumeTypeOneOfCase(GCFSTarget *message); - -#pragma mark - GCFSTarget_DocumentsTarget - -typedef GPB_ENUM(GCFSTarget_DocumentsTarget_FieldNumber) { - GCFSTarget_DocumentsTarget_FieldNumber_DocumentsArray = 2, -}; - -/** - * A target specified by a set of documents names. - **/ -@interface GCFSTarget_DocumentsTarget : GPBMessage - -/** - * The names of the documents to retrieve. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * The request will fail if any of the document is not a child resource of - * the given `database`. Duplicate names will be elided. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *documentsArray; -/** The number of items in @c documentsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger documentsArray_Count; - -@end - -#pragma mark - GCFSTarget_QueryTarget - -typedef GPB_ENUM(GCFSTarget_QueryTarget_FieldNumber) { - GCFSTarget_QueryTarget_FieldNumber_Parent = 1, - GCFSTarget_QueryTarget_FieldNumber_StructuredQuery = 2, -}; - -typedef GPB_ENUM(GCFSTarget_QueryTarget_QueryType_OneOfCase) { - GCFSTarget_QueryTarget_QueryType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSTarget_QueryTarget_QueryType_OneOfCase_StructuredQuery = 2, -}; - -/** - * A target specified by a query. - **/ -@interface GCFSTarget_QueryTarget : GPBMessage - -/** - * The parent resource name. In the format: - * `projects/{project_id}/databases/{database_id}/documents` or - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents` or - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; - -/** The query to run. */ -@property(nonatomic, readonly) GCFSTarget_QueryTarget_QueryType_OneOfCase queryTypeOneOfCase; - -/** A structured query. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery *structuredQuery; - -@end - -/** - * Clears whatever value was set for the oneof 'queryType'. - **/ -void GCFSTarget_QueryTarget_ClearQueryTypeOneOfCase(GCFSTarget_QueryTarget *message); - -#pragma mark - GCFSTargetChange - -typedef GPB_ENUM(GCFSTargetChange_FieldNumber) { - GCFSTargetChange_FieldNumber_TargetChangeType = 1, - GCFSTargetChange_FieldNumber_TargetIdsArray = 2, - GCFSTargetChange_FieldNumber_Cause = 3, - GCFSTargetChange_FieldNumber_ResumeToken = 4, - GCFSTargetChange_FieldNumber_ReadTime = 6, -}; - -/** - * Targets being watched have changed. - **/ -@interface GCFSTargetChange : GPBMessage - -/** The type of change that occurred. */ -@property(nonatomic, readwrite) GCFSTargetChange_TargetChangeType targetChangeType; - -/** - * The target IDs of targets that have changed. - * - * If empty, the change applies to all targets. - * - * For `target_change_type=ADD`, the order of the target IDs matches the order - * of the requests to add the targets. This allows clients to unambiguously - * associate server-assigned target IDs with added targets. - * - * For other states, the order of the target IDs is not defined. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *targetIdsArray; -/** The number of items in @c targetIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger targetIdsArray_Count; - -/** The error that resulted in this change, if applicable. */ -@property(nonatomic, readwrite, strong, null_resettable) RPCStatus *cause; -/** Test to see if @c cause has been set. */ -@property(nonatomic, readwrite) BOOL hasCause; - -/** - * A token that can be used to resume the stream for the given `target_ids`, - * or all targets if `target_ids` is empty. - * - * Not set on every target change. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSData *resumeToken; - -/** - * The consistent `read_time` for the given `target_ids` (omitted when the - * target_ids are not at a consistent snapshot). - * - * The stream is guaranteed to send a `read_time` with `target_ids` empty - * whenever the entire stream reaches a new consistent snapshot. ADD, - * CURRENT, and RESET messages are guaranteed to (eventually) result in a - * new consistent snapshot (while NO_CHANGE and REMOVE messages are not). - * - * For a given stream, `read_time` is guaranteed to be monotonically - * increasing. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; -/** Test to see if @c readTime has been set. */ -@property(nonatomic, readwrite) BOOL hasReadTime; - -@end - -/** - * Fetches the raw value of a @c GCFSTargetChange's @c targetChangeType property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message); -/** - * Sets the raw value of an @c GCFSTargetChange's @c targetChangeType property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message, int32_t value); - -#pragma mark - GCFSListCollectionIdsRequest - -typedef GPB_ENUM(GCFSListCollectionIdsRequest_FieldNumber) { - GCFSListCollectionIdsRequest_FieldNumber_Parent = 1, - GCFSListCollectionIdsRequest_FieldNumber_PageSize = 2, - GCFSListCollectionIdsRequest_FieldNumber_PageToken = 3, -}; - -/** - * The request for [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds]. - **/ -@interface GCFSListCollectionIdsRequest : GPBMessage - -/** - * The parent document. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - * For example: - * `projects/my-project/databases/my-database/documents/chatrooms/my-chatroom` - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *parent; - -/** The maximum number of results to return. */ -@property(nonatomic, readwrite) int32_t pageSize; - -/** - * A page token. Must be a value from - * [ListCollectionIdsResponse][google.firestore.v1.ListCollectionIdsResponse]. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *pageToken; - -@end - -#pragma mark - GCFSListCollectionIdsResponse - -typedef GPB_ENUM(GCFSListCollectionIdsResponse_FieldNumber) { - GCFSListCollectionIdsResponse_FieldNumber_CollectionIdsArray = 1, - GCFSListCollectionIdsResponse_FieldNumber_NextPageToken = 2, -}; - -/** - * The response from [Firestore.ListCollectionIds][google.firestore.v1.Firestore.ListCollectionIds]. - **/ -@interface GCFSListCollectionIdsResponse : GPBMessage - -/** The collection ids. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *collectionIdsArray; -/** The number of items in @c collectionIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger collectionIdsArray_Count; - -/** A page token that may be used to continue the list. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *nextPageToken; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.m deleted file mode 100644 index 8ab8ca1d0..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.m +++ /dev/null @@ -1,2064 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/firestore.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import - #import -#else - #import "Empty.pbobjc.h" - #import "Timestamp.pbobjc.h" -#endif - - #import "Firestore.pbobjc.h" - #import "Annotations.pbobjc.h" - #import "Common.pbobjc.h" - #import "Document.pbobjc.h" - #import "Query.pbobjc.h" - #import "Write.pbobjc.h" - #import "Status.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - GCFSFirestoreRoot - -@implementation GCFSFirestoreRoot - - -@end - -#pragma mark - GCFSFirestoreRoot_FileDescriptor - -static GPBFileDescriptor *GCFSFirestoreRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.firestore.v1" - objcPrefix:@"GCFS" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GCFSGetDocumentRequest - -@implementation GCFSGetDocumentRequest - -@dynamic consistencySelectorOneOfCase; -@dynamic name; -@dynamic hasMask, mask; -@dynamic transaction; -@dynamic readTime; - -typedef struct GCFSGetDocumentRequest__storage_ { - uint32_t _has_storage_[2]; - NSString *name; - GCFSDocumentMask *mask; - NSData *transaction; - GPBTimestamp *readTime; -} GCFSGetDocumentRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "name", - .dataTypeSpecific.className = NULL, - .number = GCFSGetDocumentRequest_FieldNumber_Name, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, name), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "mask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSGetDocumentRequest_FieldNumber_Mask, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, mask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSGetDocumentRequest_FieldNumber_Transaction, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSGetDocumentRequest_FieldNumber_ReadTime, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSGetDocumentRequest__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSGetDocumentRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSGetDocumentRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "consistencySelector", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSGetDocumentRequest_ClearConsistencySelectorOneOfCase(GCFSGetDocumentRequest *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSListDocumentsRequest - -@implementation GCFSListDocumentsRequest - -@dynamic consistencySelectorOneOfCase; -@dynamic parent; -@dynamic collectionId; -@dynamic pageSize; -@dynamic pageToken; -@dynamic orderBy; -@dynamic hasMask, mask; -@dynamic transaction; -@dynamic readTime; -@dynamic showMissing; - -typedef struct GCFSListDocumentsRequest__storage_ { - uint32_t _has_storage_[2]; - int32_t pageSize; - NSString *parent; - NSString *collectionId; - NSString *pageToken; - NSString *orderBy; - GCFSDocumentMask *mask; - NSData *transaction; - GPBTimestamp *readTime; -} GCFSListDocumentsRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "parent", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_Parent, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, parent), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "collectionId", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_CollectionId, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, collectionId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "pageSize", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_PageSize, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, pageSize), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "pageToken", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_PageToken, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, pageToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "orderBy", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_OrderBy, - .hasIndex = 4, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, orderBy), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "mask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSListDocumentsRequest_FieldNumber_Mask, - .hasIndex = 5, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, mask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_Transaction, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSListDocumentsRequest_FieldNumber_ReadTime, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListDocumentsRequest__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "showMissing", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsRequest_FieldNumber_ShowMissing, - .hasIndex = 6, - .offset = 7, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSListDocumentsRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSListDocumentsRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "consistencySelector", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSListDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSListDocumentsRequest *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSListDocumentsResponse - -@implementation GCFSListDocumentsResponse - -@dynamic documentsArray, documentsArray_Count; -@dynamic nextPageToken; - -typedef struct GCFSListDocumentsResponse__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *documentsArray; - NSString *nextPageToken; -} GCFSListDocumentsResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "documentsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSListDocumentsResponse_FieldNumber_DocumentsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSListDocumentsResponse__storage_, documentsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "nextPageToken", - .dataTypeSpecific.className = NULL, - .number = GCFSListDocumentsResponse_FieldNumber_NextPageToken, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSListDocumentsResponse__storage_, nextPageToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSListDocumentsResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSListDocumentsResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSCreateDocumentRequest - -@implementation GCFSCreateDocumentRequest - -@dynamic parent; -@dynamic collectionId; -@dynamic documentId; -@dynamic hasDocument, document; -@dynamic hasMask, mask; - -typedef struct GCFSCreateDocumentRequest__storage_ { - uint32_t _has_storage_[1]; - NSString *parent; - NSString *collectionId; - NSString *documentId; - GCFSDocument *document; - GCFSDocumentMask *mask; -} GCFSCreateDocumentRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "parent", - .dataTypeSpecific.className = NULL, - .number = GCFSCreateDocumentRequest_FieldNumber_Parent, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, parent), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "collectionId", - .dataTypeSpecific.className = NULL, - .number = GCFSCreateDocumentRequest_FieldNumber_CollectionId, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, collectionId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "documentId", - .dataTypeSpecific.className = NULL, - .number = GCFSCreateDocumentRequest_FieldNumber_DocumentId, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, documentId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "document", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSCreateDocumentRequest_FieldNumber_Document, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "mask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSCreateDocumentRequest_FieldNumber_Mask, - .hasIndex = 4, - .offset = (uint32_t)offsetof(GCFSCreateDocumentRequest__storage_, mask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSCreateDocumentRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSCreateDocumentRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSUpdateDocumentRequest - -@implementation GCFSUpdateDocumentRequest - -@dynamic hasDocument, document; -@dynamic hasUpdateMask, updateMask; -@dynamic hasMask, mask; -@dynamic hasCurrentDocument, currentDocument; - -typedef struct GCFSUpdateDocumentRequest__storage_ { - uint32_t _has_storage_[1]; - GCFSDocument *document; - GCFSDocumentMask *updateMask; - GCFSDocumentMask *mask; - GCFSPrecondition *currentDocument; -} GCFSUpdateDocumentRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "document", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSUpdateDocumentRequest_FieldNumber_Document, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "updateMask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSUpdateDocumentRequest_FieldNumber_UpdateMask, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, updateMask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "mask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSUpdateDocumentRequest_FieldNumber_Mask, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, mask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "currentDocument", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSPrecondition), - .number = GCFSUpdateDocumentRequest_FieldNumber_CurrentDocument, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GCFSUpdateDocumentRequest__storage_, currentDocument), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSUpdateDocumentRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSUpdateDocumentRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSDeleteDocumentRequest - -@implementation GCFSDeleteDocumentRequest - -@dynamic name; -@dynamic hasCurrentDocument, currentDocument; - -typedef struct GCFSDeleteDocumentRequest__storage_ { - uint32_t _has_storage_[1]; - NSString *name; - GCFSPrecondition *currentDocument; -} GCFSDeleteDocumentRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "name", - .dataTypeSpecific.className = NULL, - .number = GCFSDeleteDocumentRequest_FieldNumber_Name, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDeleteDocumentRequest__storage_, name), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "currentDocument", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSPrecondition), - .number = GCFSDeleteDocumentRequest_FieldNumber_CurrentDocument, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSDeleteDocumentRequest__storage_, currentDocument), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDeleteDocumentRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDeleteDocumentRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSBatchGetDocumentsRequest - -@implementation GCFSBatchGetDocumentsRequest - -@dynamic consistencySelectorOneOfCase; -@dynamic database; -@dynamic documentsArray, documentsArray_Count; -@dynamic hasMask, mask; -@dynamic transaction; -@dynamic newTransaction; -@dynamic readTime; - -typedef struct GCFSBatchGetDocumentsRequest__storage_ { - uint32_t _has_storage_[2]; - NSString *database; - NSMutableArray *documentsArray; - GCFSDocumentMask *mask; - NSData *transaction; - GCFSTransactionOptions *newTransaction; - GPBTimestamp *readTime; -} GCFSBatchGetDocumentsRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "database", - .dataTypeSpecific.className = NULL, - .number = GCFSBatchGetDocumentsRequest_FieldNumber_Database, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, database), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "documentsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSBatchGetDocumentsRequest_FieldNumber_DocumentsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, documentsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeString, - }, - { - .name = "mask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSBatchGetDocumentsRequest_FieldNumber_Mask, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, mask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSBatchGetDocumentsRequest_FieldNumber_Transaction, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "newTransaction", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions), - .number = GCFSBatchGetDocumentsRequest_FieldNumber_NewTransaction, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, newTransaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSBatchGetDocumentsRequest_FieldNumber_ReadTime, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsRequest__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSBatchGetDocumentsRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSBatchGetDocumentsRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "consistencySelector", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSBatchGetDocumentsRequest_ClearConsistencySelectorOneOfCase(GCFSBatchGetDocumentsRequest *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSBatchGetDocumentsResponse - -@implementation GCFSBatchGetDocumentsResponse - -@dynamic resultOneOfCase; -@dynamic found; -@dynamic missing; -@dynamic transaction; -@dynamic hasReadTime, readTime; - -typedef struct GCFSBatchGetDocumentsResponse__storage_ { - uint32_t _has_storage_[2]; - GCFSDocument *found; - NSString *missing; - NSData *transaction; - GPBTimestamp *readTime; -} GCFSBatchGetDocumentsResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "found", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSBatchGetDocumentsResponse_FieldNumber_Found, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, found), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "missing", - .dataTypeSpecific.className = NULL, - .number = GCFSBatchGetDocumentsResponse_FieldNumber_Missing, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, missing), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSBatchGetDocumentsResponse_FieldNumber_Transaction, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSBatchGetDocumentsResponse_FieldNumber_ReadTime, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSBatchGetDocumentsResponse__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSBatchGetDocumentsResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSBatchGetDocumentsResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "result", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSBatchGetDocumentsResponse_ClearResultOneOfCase(GCFSBatchGetDocumentsResponse *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSBeginTransactionRequest - -@implementation GCFSBeginTransactionRequest - -@dynamic database; -@dynamic hasOptions, options; - -typedef struct GCFSBeginTransactionRequest__storage_ { - uint32_t _has_storage_[1]; - NSString *database; - GCFSTransactionOptions *options; -} GCFSBeginTransactionRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "database", - .dataTypeSpecific.className = NULL, - .number = GCFSBeginTransactionRequest_FieldNumber_Database, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSBeginTransactionRequest__storage_, database), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "options", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions), - .number = GCFSBeginTransactionRequest_FieldNumber_Options, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSBeginTransactionRequest__storage_, options), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSBeginTransactionRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSBeginTransactionRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSBeginTransactionResponse - -@implementation GCFSBeginTransactionResponse - -@dynamic transaction; - -typedef struct GCFSBeginTransactionResponse__storage_ { - uint32_t _has_storage_[1]; - NSData *transaction; -} GCFSBeginTransactionResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSBeginTransactionResponse_FieldNumber_Transaction, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSBeginTransactionResponse__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSBeginTransactionResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSBeginTransactionResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSCommitRequest - -@implementation GCFSCommitRequest - -@dynamic database; -@dynamic writesArray, writesArray_Count; -@dynamic transaction; - -typedef struct GCFSCommitRequest__storage_ { - uint32_t _has_storage_[1]; - NSString *database; - NSMutableArray *writesArray; - NSData *transaction; -} GCFSCommitRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "database", - .dataTypeSpecific.className = NULL, - .number = GCFSCommitRequest_FieldNumber_Database, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSCommitRequest__storage_, database), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "writesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite), - .number = GCFSCommitRequest_FieldNumber_WritesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSCommitRequest__storage_, writesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSCommitRequest_FieldNumber_Transaction, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSCommitRequest__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSCommitRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSCommitRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSCommitResponse - -@implementation GCFSCommitResponse - -@dynamic writeResultsArray, writeResultsArray_Count; -@dynamic hasCommitTime, commitTime; - -typedef struct GCFSCommitResponse__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *writeResultsArray; - GPBTimestamp *commitTime; -} GCFSCommitResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "writeResultsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSWriteResult), - .number = GCFSCommitResponse_FieldNumber_WriteResultsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSCommitResponse__storage_, writeResultsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "commitTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSCommitResponse_FieldNumber_CommitTime, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSCommitResponse__storage_, commitTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSCommitResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSCommitResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSRollbackRequest - -@implementation GCFSRollbackRequest - -@dynamic database; -@dynamic transaction; - -typedef struct GCFSRollbackRequest__storage_ { - uint32_t _has_storage_[1]; - NSString *database; - NSData *transaction; -} GCFSRollbackRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "database", - .dataTypeSpecific.className = NULL, - .number = GCFSRollbackRequest_FieldNumber_Database, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSRollbackRequest__storage_, database), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSRollbackRequest_FieldNumber_Transaction, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSRollbackRequest__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSRollbackRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSRollbackRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSRunQueryRequest - -@implementation GCFSRunQueryRequest - -@dynamic queryTypeOneOfCase; -@dynamic consistencySelectorOneOfCase; -@dynamic parent; -@dynamic structuredQuery; -@dynamic transaction; -@dynamic newTransaction; -@dynamic readTime; - -typedef struct GCFSRunQueryRequest__storage_ { - uint32_t _has_storage_[3]; - NSString *parent; - GCFSStructuredQuery *structuredQuery; - NSData *transaction; - GCFSTransactionOptions *newTransaction; - GPBTimestamp *readTime; -} GCFSRunQueryRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "parent", - .dataTypeSpecific.className = NULL, - .number = GCFSRunQueryRequest_FieldNumber_Parent, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, parent), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "structuredQuery", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery), - .number = GCFSRunQueryRequest_FieldNumber_StructuredQuery, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, structuredQuery), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSRunQueryRequest_FieldNumber_Transaction, - .hasIndex = -2, - .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "newTransaction", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTransactionOptions), - .number = GCFSRunQueryRequest_FieldNumber_NewTransaction, - .hasIndex = -2, - .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, newTransaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSRunQueryRequest_FieldNumber_ReadTime, - .hasIndex = -2, - .offset = (uint32_t)offsetof(GCFSRunQueryRequest__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSRunQueryRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSRunQueryRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "queryType", - "consistencySelector", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSRunQueryRequest_ClearQueryTypeOneOfCase(GCFSRunQueryRequest *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -void GCFSRunQueryRequest_ClearConsistencySelectorOneOfCase(GCFSRunQueryRequest *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:1]; - GPBMaybeClearOneof(message, oneof, -2, 0); -} -#pragma mark - GCFSRunQueryResponse - -@implementation GCFSRunQueryResponse - -@dynamic transaction; -@dynamic hasDocument, document; -@dynamic hasReadTime, readTime; -@dynamic skippedResults; - -typedef struct GCFSRunQueryResponse__storage_ { - uint32_t _has_storage_[1]; - int32_t skippedResults; - GCFSDocument *document; - NSData *transaction; - GPBTimestamp *readTime; -} GCFSRunQueryResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "document", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSRunQueryResponse_FieldNumber_Document, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transaction", - .dataTypeSpecific.className = NULL, - .number = GCFSRunQueryResponse_FieldNumber_Transaction, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, transaction), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSRunQueryResponse_FieldNumber_ReadTime, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "skippedResults", - .dataTypeSpecific.className = NULL, - .number = GCFSRunQueryResponse_FieldNumber_SkippedResults, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GCFSRunQueryResponse__storage_, skippedResults), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSRunQueryResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSRunQueryResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSWriteRequest - -@implementation GCFSWriteRequest - -@dynamic database; -@dynamic streamId; -@dynamic writesArray, writesArray_Count; -@dynamic streamToken; -@dynamic labels, labels_Count; - -typedef struct GCFSWriteRequest__storage_ { - uint32_t _has_storage_[1]; - NSString *database; - NSString *streamId; - NSMutableArray *writesArray; - NSData *streamToken; - NSMutableDictionary *labels; -} GCFSWriteRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "database", - .dataTypeSpecific.className = NULL, - .number = GCFSWriteRequest_FieldNumber_Database, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, database), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "streamId", - .dataTypeSpecific.className = NULL, - .number = GCFSWriteRequest_FieldNumber_StreamId, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, streamId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "writesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSWrite), - .number = GCFSWriteRequest_FieldNumber_WritesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, writesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "streamToken", - .dataTypeSpecific.className = NULL, - .number = GCFSWriteRequest_FieldNumber_StreamToken, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, streamToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "labels", - .dataTypeSpecific.className = NULL, - .number = GCFSWriteRequest_FieldNumber_Labels, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSWriteRequest__storage_, labels), - .flags = GPBFieldMapKeyString, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSWriteRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSWriteRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSWriteResponse - -@implementation GCFSWriteResponse - -@dynamic streamId; -@dynamic streamToken; -@dynamic writeResultsArray, writeResultsArray_Count; -@dynamic hasCommitTime, commitTime; - -typedef struct GCFSWriteResponse__storage_ { - uint32_t _has_storage_[1]; - NSString *streamId; - NSData *streamToken; - NSMutableArray *writeResultsArray; - GPBTimestamp *commitTime; -} GCFSWriteResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "streamId", - .dataTypeSpecific.className = NULL, - .number = GCFSWriteResponse_FieldNumber_StreamId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, streamId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "streamToken", - .dataTypeSpecific.className = NULL, - .number = GCFSWriteResponse_FieldNumber_StreamToken, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, streamToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "writeResultsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSWriteResult), - .number = GCFSWriteResponse_FieldNumber_WriteResultsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, writeResultsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "commitTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSWriteResponse_FieldNumber_CommitTime, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSWriteResponse__storage_, commitTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSWriteResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSWriteResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSListenRequest - -@implementation GCFSListenRequest - -@dynamic targetChangeOneOfCase; -@dynamic database; -@dynamic addTarget; -@dynamic removeTarget; -@dynamic labels, labels_Count; - -typedef struct GCFSListenRequest__storage_ { - uint32_t _has_storage_[2]; - int32_t removeTarget; - NSString *database; - GCFSTarget *addTarget; - NSMutableDictionary *labels; -} GCFSListenRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "database", - .dataTypeSpecific.className = NULL, - .number = GCFSListenRequest_FieldNumber_Database, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, database), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "addTarget", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget), - .number = GCFSListenRequest_FieldNumber_AddTarget, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, addTarget), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "removeTarget", - .dataTypeSpecific.className = NULL, - .number = GCFSListenRequest_FieldNumber_RemoveTarget, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, removeTarget), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "labels", - .dataTypeSpecific.className = NULL, - .number = GCFSListenRequest_FieldNumber_Labels, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSListenRequest__storage_, labels), - .flags = GPBFieldMapKeyString, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSListenRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSListenRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "targetChange", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSListenRequest_ClearTargetChangeOneOfCase(GCFSListenRequest *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSListenResponse - -@implementation GCFSListenResponse - -@dynamic responseTypeOneOfCase; -@dynamic targetChange; -@dynamic documentChange; -@dynamic documentDelete; -@dynamic documentRemove; -@dynamic filter; - -typedef struct GCFSListenResponse__storage_ { - uint32_t _has_storage_[2]; - GCFSTargetChange *targetChange; - GCFSDocumentChange *documentChange; - GCFSDocumentDelete *documentDelete; - GCFSExistenceFilter *filter; - GCFSDocumentRemove *documentRemove; -} GCFSListenResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "targetChange", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTargetChange), - .number = GCFSListenResponse_FieldNumber_TargetChange, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, targetChange), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "documentChange", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentChange), - .number = GCFSListenResponse_FieldNumber_DocumentChange, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, documentChange), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "documentDelete", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentDelete), - .number = GCFSListenResponse_FieldNumber_DocumentDelete, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, documentDelete), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "filter", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSExistenceFilter), - .number = GCFSListenResponse_FieldNumber_Filter, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, filter), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "documentRemove", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentRemove), - .number = GCFSListenResponse_FieldNumber_DocumentRemove, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSListenResponse__storage_, documentRemove), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSListenResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSListenResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "responseType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSListenResponse_ClearResponseTypeOneOfCase(GCFSListenResponse *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSTarget - -@implementation GCFSTarget - -@dynamic targetTypeOneOfCase; -@dynamic resumeTypeOneOfCase; -@dynamic query; -@dynamic documents; -@dynamic resumeToken; -@dynamic readTime; -@dynamic targetId; -@dynamic once; - -typedef struct GCFSTarget__storage_ { - uint32_t _has_storage_[3]; - int32_t targetId; - GCFSTarget_QueryTarget *query; - GCFSTarget_DocumentsTarget *documents; - NSData *resumeToken; - GPBTimestamp *readTime; -} GCFSTarget__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "query", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_QueryTarget), - .number = GCFSTarget_FieldNumber_Query, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSTarget__storage_, query), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "documents", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSTarget_DocumentsTarget), - .number = GCFSTarget_FieldNumber_Documents, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSTarget__storage_, documents), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "resumeToken", - .dataTypeSpecific.className = NULL, - .number = GCFSTarget_FieldNumber_ResumeToken, - .hasIndex = -2, - .offset = (uint32_t)offsetof(GCFSTarget__storage_, resumeToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "targetId", - .dataTypeSpecific.className = NULL, - .number = GCFSTarget_FieldNumber_TargetId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSTarget__storage_, targetId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "once", - .dataTypeSpecific.className = NULL, - .number = GCFSTarget_FieldNumber_Once, - .hasIndex = 1, - .offset = 2, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSTarget_FieldNumber_ReadTime, - .hasIndex = -2, - .offset = (uint32_t)offsetof(GCFSTarget__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTarget class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTarget__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "targetType", - "resumeType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSTarget_ClearTargetTypeOneOfCase(GCFSTarget *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -void GCFSTarget_ClearResumeTypeOneOfCase(GCFSTarget *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:1]; - GPBMaybeClearOneof(message, oneof, -2, 0); -} -#pragma mark - GCFSTarget_DocumentsTarget - -@implementation GCFSTarget_DocumentsTarget - -@dynamic documentsArray, documentsArray_Count; - -typedef struct GCFSTarget_DocumentsTarget__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *documentsArray; -} GCFSTarget_DocumentsTarget__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "documentsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSTarget_DocumentsTarget_FieldNumber_DocumentsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSTarget_DocumentsTarget__storage_, documentsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTarget_DocumentsTarget class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTarget_DocumentsTarget__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTarget)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSTarget_QueryTarget - -@implementation GCFSTarget_QueryTarget - -@dynamic queryTypeOneOfCase; -@dynamic parent; -@dynamic structuredQuery; - -typedef struct GCFSTarget_QueryTarget__storage_ { - uint32_t _has_storage_[2]; - NSString *parent; - GCFSStructuredQuery *structuredQuery; -} GCFSTarget_QueryTarget__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "parent", - .dataTypeSpecific.className = NULL, - .number = GCFSTarget_QueryTarget_FieldNumber_Parent, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSTarget_QueryTarget__storage_, parent), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "structuredQuery", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery), - .number = GCFSTarget_QueryTarget_FieldNumber_StructuredQuery, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSTarget_QueryTarget__storage_, structuredQuery), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTarget_QueryTarget class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTarget_QueryTarget__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "queryType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSTarget)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSTarget_QueryTarget_ClearQueryTypeOneOfCase(GCFSTarget_QueryTarget *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSTargetChange - -@implementation GCFSTargetChange - -@dynamic targetChangeType; -@dynamic targetIdsArray, targetIdsArray_Count; -@dynamic hasCause, cause; -@dynamic resumeToken; -@dynamic hasReadTime, readTime; - -typedef struct GCFSTargetChange__storage_ { - uint32_t _has_storage_[1]; - GCFSTargetChange_TargetChangeType targetChangeType; - GPBInt32Array *targetIdsArray; - RPCStatus *cause; - NSData *resumeToken; - GPBTimestamp *readTime; -} GCFSTargetChange__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "targetChangeType", - .dataTypeSpecific.enumDescFunc = GCFSTargetChange_TargetChangeType_EnumDescriptor, - .number = GCFSTargetChange_FieldNumber_TargetChangeType, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, targetChangeType), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - { - .name = "targetIdsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSTargetChange_FieldNumber_TargetIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, targetIdsArray), - .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), - .dataType = GPBDataTypeInt32, - }, - { - .name = "cause", - .dataTypeSpecific.className = GPBStringifySymbol(RPCStatus), - .number = GCFSTargetChange_FieldNumber_Cause, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, cause), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "resumeToken", - .dataTypeSpecific.className = NULL, - .number = GCFSTargetChange_FieldNumber_ResumeToken, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, resumeToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSTargetChange_FieldNumber_ReadTime, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GCFSTargetChange__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSTargetChange class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSTargetChange__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message) { - GPBDescriptor *descriptor = [GCFSTargetChange descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSTargetChange_FieldNumber_TargetChangeType]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSTargetChange_TargetChangeType_RawValue(GCFSTargetChange *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSTargetChange descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSTargetChange_FieldNumber_TargetChangeType]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - Enum GCFSTargetChange_TargetChangeType - -GPBEnumDescriptor *GCFSTargetChange_TargetChangeType_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static const char *valueNames = - "NoChange\000Add\000Remove\000Current\000Reset\000"; - static const int32_t values[] = { - GCFSTargetChange_TargetChangeType_NoChange, - GCFSTargetChange_TargetChangeType_Add, - GCFSTargetChange_TargetChangeType_Remove, - GCFSTargetChange_TargetChangeType_Current, - GCFSTargetChange_TargetChangeType_Reset, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSTargetChange_TargetChangeType) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GCFSTargetChange_TargetChangeType_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GCFSTargetChange_TargetChangeType_IsValidValue(int32_t value__) { - switch (value__) { - case GCFSTargetChange_TargetChangeType_NoChange: - case GCFSTargetChange_TargetChangeType_Add: - case GCFSTargetChange_TargetChangeType_Remove: - case GCFSTargetChange_TargetChangeType_Current: - case GCFSTargetChange_TargetChangeType_Reset: - return YES; - default: - return NO; - } -} - -#pragma mark - GCFSListCollectionIdsRequest - -@implementation GCFSListCollectionIdsRequest - -@dynamic parent; -@dynamic pageSize; -@dynamic pageToken; - -typedef struct GCFSListCollectionIdsRequest__storage_ { - uint32_t _has_storage_[1]; - int32_t pageSize; - NSString *parent; - NSString *pageToken; -} GCFSListCollectionIdsRequest__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "parent", - .dataTypeSpecific.className = NULL, - .number = GCFSListCollectionIdsRequest_FieldNumber_Parent, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSListCollectionIdsRequest__storage_, parent), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "pageSize", - .dataTypeSpecific.className = NULL, - .number = GCFSListCollectionIdsRequest_FieldNumber_PageSize, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSListCollectionIdsRequest__storage_, pageSize), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "pageToken", - .dataTypeSpecific.className = NULL, - .number = GCFSListCollectionIdsRequest_FieldNumber_PageToken, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSListCollectionIdsRequest__storage_, pageToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSListCollectionIdsRequest class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSListCollectionIdsRequest__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSListCollectionIdsResponse - -@implementation GCFSListCollectionIdsResponse - -@dynamic collectionIdsArray, collectionIdsArray_Count; -@dynamic nextPageToken; - -typedef struct GCFSListCollectionIdsResponse__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *collectionIdsArray; - NSString *nextPageToken; -} GCFSListCollectionIdsResponse__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "collectionIdsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSListCollectionIdsResponse_FieldNumber_CollectionIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSListCollectionIdsResponse__storage_, collectionIdsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeString, - }, - { - .name = "nextPageToken", - .dataTypeSpecific.className = NULL, - .number = GCFSListCollectionIdsResponse_FieldNumber_NextPageToken, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSListCollectionIdsResponse__storage_, nextPageToken), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSListCollectionIdsResponse class] - rootClass:[GCFSFirestoreRoot class] - file:GCFSFirestoreRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSListCollectionIdsResponse__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.h deleted file mode 100644 index 569856535..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.h +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/query.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSCursor; -@class GCFSStructuredQuery_CollectionSelector; -@class GCFSStructuredQuery_CompositeFilter; -@class GCFSStructuredQuery_FieldFilter; -@class GCFSStructuredQuery_FieldReference; -@class GCFSStructuredQuery_Filter; -@class GCFSStructuredQuery_Order; -@class GCFSStructuredQuery_Projection; -@class GCFSStructuredQuery_UnaryFilter; -@class GCFSValue; -@class GPBInt32Value; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - Enum GCFSStructuredQuery_Direction - -/** A sort direction. */ -typedef GPB_ENUM(GCFSStructuredQuery_Direction) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GCFSStructuredQuery_Direction_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** Unspecified. */ - GCFSStructuredQuery_Direction_DirectionUnspecified = 0, - - /** Ascending. */ - GCFSStructuredQuery_Direction_Ascending = 1, - - /** Descending. */ - GCFSStructuredQuery_Direction_Descending = 2, -}; - -GPBEnumDescriptor *GCFSStructuredQuery_Direction_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GCFSStructuredQuery_Direction_IsValidValue(int32_t value); - -#pragma mark - Enum GCFSStructuredQuery_CompositeFilter_Operator - -/** A composite filter operator. */ -typedef GPB_ENUM(GCFSStructuredQuery_CompositeFilter_Operator) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GCFSStructuredQuery_CompositeFilter_Operator_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** Unspecified. This value must not be used. */ - GCFSStructuredQuery_CompositeFilter_Operator_OperatorUnspecified = 0, - - /** The results are required to satisfy each of the combined filters. */ - GCFSStructuredQuery_CompositeFilter_Operator_And = 1, -}; - -GPBEnumDescriptor *GCFSStructuredQuery_CompositeFilter_Operator_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GCFSStructuredQuery_CompositeFilter_Operator_IsValidValue(int32_t value); - -#pragma mark - Enum GCFSStructuredQuery_FieldFilter_Operator - -/** A field filter operator. */ -typedef GPB_ENUM(GCFSStructuredQuery_FieldFilter_Operator) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GCFSStructuredQuery_FieldFilter_Operator_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** Unspecified. This value must not be used. */ - GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified = 0, - - /** Less than. Requires that the field come first in `order_by`. */ - GCFSStructuredQuery_FieldFilter_Operator_LessThan = 1, - - /** Less than or equal. Requires that the field come first in `order_by`. */ - GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual = 2, - - /** Greater than. Requires that the field come first in `order_by`. */ - GCFSStructuredQuery_FieldFilter_Operator_GreaterThan = 3, - - /** - * Greater than or equal. Requires that the field come first in - * `order_by`. - **/ - GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual = 4, - - /** Equal. */ - GCFSStructuredQuery_FieldFilter_Operator_Equal = 5, - - /** Contains. Requires that the field is an array. */ - GCFSStructuredQuery_FieldFilter_Operator_ArrayContains = 7, - - /** - * In. Requires that `value` is a non-empty ArrayValue with at most 10 - * values. - **/ - GCFSStructuredQuery_FieldFilter_Operator_In = 8, - - /** - * Contains any. Requires that the field is an array and - * `value` is a non-empty ArrayValue with at most 10 values. - **/ - GCFSStructuredQuery_FieldFilter_Operator_ArrayContainsAny = 9, -}; - -GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GCFSStructuredQuery_FieldFilter_Operator_IsValidValue(int32_t value); - -#pragma mark - Enum GCFSStructuredQuery_UnaryFilter_Operator - -/** A unary operator. */ -typedef GPB_ENUM(GCFSStructuredQuery_UnaryFilter_Operator) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GCFSStructuredQuery_UnaryFilter_Operator_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** Unspecified. This value must not be used. */ - GCFSStructuredQuery_UnaryFilter_Operator_OperatorUnspecified = 0, - - /** Test if a field is equal to NaN. */ - GCFSStructuredQuery_UnaryFilter_Operator_IsNan = 2, - - /** Test if an exprestion evaluates to Null. */ - GCFSStructuredQuery_UnaryFilter_Operator_IsNull = 3, -}; - -GPBEnumDescriptor *GCFSStructuredQuery_UnaryFilter_Operator_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GCFSStructuredQuery_UnaryFilter_Operator_IsValidValue(int32_t value); - -#pragma mark - GCFSQueryRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GCFSQueryRoot : GPBRootObject -@end - -#pragma mark - GCFSStructuredQuery - -typedef GPB_ENUM(GCFSStructuredQuery_FieldNumber) { - GCFSStructuredQuery_FieldNumber_Select = 1, - GCFSStructuredQuery_FieldNumber_FromArray = 2, - GCFSStructuredQuery_FieldNumber_Where = 3, - GCFSStructuredQuery_FieldNumber_OrderByArray = 4, - GCFSStructuredQuery_FieldNumber_Limit = 5, - GCFSStructuredQuery_FieldNumber_Offset = 6, - GCFSStructuredQuery_FieldNumber_StartAt = 7, - GCFSStructuredQuery_FieldNumber_EndAt = 8, -}; - -/** - * A Firestore query. - **/ -@interface GCFSStructuredQuery : GPBMessage - -/** The projection to return. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_Projection *select; -/** Test to see if @c select has been set. */ -@property(nonatomic, readwrite) BOOL hasSelect; - -/** The collections to query. */ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fromArray; -/** The number of items in @c fromArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger fromArray_Count; - -/** The filter to apply. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_Filter *where; -/** Test to see if @c where has been set. */ -@property(nonatomic, readwrite) BOOL hasWhere; - -/** - * The order to apply to the query results. - * - * Firestore guarantees a stable ordering through the following rules: - * - * * Any field required to appear in `order_by`, that is not already - * specified in `order_by`, is appended to the order in field name order - * by default. - * * If an order on `__name__` is not specified, it is appended by default. - * - * Fields are appended with the same sort direction as the last order - * specified, or 'ASCENDING' if no order was specified. For example: - * - * * `SELECT * FROM Foo ORDER BY A` becomes - * `SELECT * FROM Foo ORDER BY A, __name__` - * * `SELECT * FROM Foo ORDER BY A DESC` becomes - * `SELECT * FROM Foo ORDER BY A DESC, __name__ DESC` - * * `SELECT * FROM Foo WHERE A > 1` becomes - * `SELECT * FROM Foo WHERE A > 1 ORDER BY A, __name__` - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *orderByArray; -/** The number of items in @c orderByArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger orderByArray_Count; - -/** A starting point for the query results. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSCursor *startAt; -/** Test to see if @c startAt has been set. */ -@property(nonatomic, readwrite) BOOL hasStartAt; - -/** A end point for the query results. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSCursor *endAt; -/** Test to see if @c endAt has been set. */ -@property(nonatomic, readwrite) BOOL hasEndAt; - -/** - * The number of results to skip. - * - * Applies before limit, but after all other constraints. Must be >= 0 if - * specified. - **/ -@property(nonatomic, readwrite) int32_t offset; - -/** - * The maximum number of results to return. - * - * Applies after all other constraints. - * Must be >= 0 if specified. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Value *limit; -/** Test to see if @c limit has been set. */ -@property(nonatomic, readwrite) BOOL hasLimit; - -@end - -#pragma mark - GCFSStructuredQuery_CollectionSelector - -typedef GPB_ENUM(GCFSStructuredQuery_CollectionSelector_FieldNumber) { - GCFSStructuredQuery_CollectionSelector_FieldNumber_CollectionId = 2, - GCFSStructuredQuery_CollectionSelector_FieldNumber_AllDescendants = 3, -}; - -/** - * A selection of a collection, such as `messages as m1`. - **/ -@interface GCFSStructuredQuery_CollectionSelector : GPBMessage - -/** - * The collection ID. - * When set, selects only collections with this ID. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *collectionId; - -/** - * When false, selects only collections that are immediate children of - * the `parent` specified in the containing `RunQueryRequest`. - * When true, selects all descendant collections. - **/ -@property(nonatomic, readwrite) BOOL allDescendants; - -@end - -#pragma mark - GCFSStructuredQuery_Filter - -typedef GPB_ENUM(GCFSStructuredQuery_Filter_FieldNumber) { - GCFSStructuredQuery_Filter_FieldNumber_CompositeFilter = 1, - GCFSStructuredQuery_Filter_FieldNumber_FieldFilter = 2, - GCFSStructuredQuery_Filter_FieldNumber_UnaryFilter = 3, -}; - -typedef GPB_ENUM(GCFSStructuredQuery_Filter_FilterType_OneOfCase) { - GCFSStructuredQuery_Filter_FilterType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSStructuredQuery_Filter_FilterType_OneOfCase_CompositeFilter = 1, - GCFSStructuredQuery_Filter_FilterType_OneOfCase_FieldFilter = 2, - GCFSStructuredQuery_Filter_FilterType_OneOfCase_UnaryFilter = 3, -}; - -/** - * A filter. - **/ -@interface GCFSStructuredQuery_Filter : GPBMessage - -/** The type of filter. */ -@property(nonatomic, readonly) GCFSStructuredQuery_Filter_FilterType_OneOfCase filterTypeOneOfCase; - -/** A composite filter. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_CompositeFilter *compositeFilter; - -/** A filter on a document field. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldFilter *fieldFilter; - -/** A filter that takes exactly one argument. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_UnaryFilter *unaryFilter; - -@end - -/** - * Clears whatever value was set for the oneof 'filterType'. - **/ -void GCFSStructuredQuery_Filter_ClearFilterTypeOneOfCase(GCFSStructuredQuery_Filter *message); - -#pragma mark - GCFSStructuredQuery_CompositeFilter - -typedef GPB_ENUM(GCFSStructuredQuery_CompositeFilter_FieldNumber) { - GCFSStructuredQuery_CompositeFilter_FieldNumber_Op = 1, - GCFSStructuredQuery_CompositeFilter_FieldNumber_FiltersArray = 2, -}; - -/** - * A filter that merges multiple other filters using the given operator. - **/ -@interface GCFSStructuredQuery_CompositeFilter : GPBMessage - -/** The operator for combining multiple filters. */ -@property(nonatomic, readwrite) GCFSStructuredQuery_CompositeFilter_Operator op; - -/** - * The list of filters to combine. - * Must contain at least one filter. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *filtersArray; -/** The number of items in @c filtersArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger filtersArray_Count; - -@end - -/** - * Fetches the raw value of a @c GCFSStructuredQuery_CompositeFilter's @c op property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message); -/** - * Sets the raw value of an @c GCFSStructuredQuery_CompositeFilter's @c op property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message, int32_t value); - -#pragma mark - GCFSStructuredQuery_FieldFilter - -typedef GPB_ENUM(GCFSStructuredQuery_FieldFilter_FieldNumber) { - GCFSStructuredQuery_FieldFilter_FieldNumber_Field = 1, - GCFSStructuredQuery_FieldFilter_FieldNumber_Op = 2, - GCFSStructuredQuery_FieldFilter_FieldNumber_Value = 3, -}; - -/** - * A filter on a specific field. - **/ -@interface GCFSStructuredQuery_FieldFilter : GPBMessage - -/** The field to filter by. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldReference *field; -/** Test to see if @c field has been set. */ -@property(nonatomic, readwrite) BOOL hasField; - -/** The operator to filter by. */ -@property(nonatomic, readwrite) GCFSStructuredQuery_FieldFilter_Operator op; - -/** The value to compare to. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSValue *value; -/** Test to see if @c value has been set. */ -@property(nonatomic, readwrite) BOOL hasValue; - -@end - -/** - * Fetches the raw value of a @c GCFSStructuredQuery_FieldFilter's @c op property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message); -/** - * Sets the raw value of an @c GCFSStructuredQuery_FieldFilter's @c op property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message, int32_t value); - -#pragma mark - GCFSStructuredQuery_UnaryFilter - -typedef GPB_ENUM(GCFSStructuredQuery_UnaryFilter_FieldNumber) { - GCFSStructuredQuery_UnaryFilter_FieldNumber_Op = 1, - GCFSStructuredQuery_UnaryFilter_FieldNumber_Field = 2, -}; - -typedef GPB_ENUM(GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase) { - GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase_Field = 2, -}; - -/** - * A filter with a single operand. - **/ -@interface GCFSStructuredQuery_UnaryFilter : GPBMessage - -/** The unary operator to apply. */ -@property(nonatomic, readwrite) GCFSStructuredQuery_UnaryFilter_Operator op; - -/** The argument to the filter. */ -@property(nonatomic, readonly) GCFSStructuredQuery_UnaryFilter_OperandType_OneOfCase operandTypeOneOfCase; - -/** The field to which to apply the operator. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldReference *field; - -@end - -/** - * Fetches the raw value of a @c GCFSStructuredQuery_UnaryFilter's @c op property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message); -/** - * Sets the raw value of an @c GCFSStructuredQuery_UnaryFilter's @c op property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message, int32_t value); - -/** - * Clears whatever value was set for the oneof 'operandType'. - **/ -void GCFSStructuredQuery_UnaryFilter_ClearOperandTypeOneOfCase(GCFSStructuredQuery_UnaryFilter *message); - -#pragma mark - GCFSStructuredQuery_Order - -typedef GPB_ENUM(GCFSStructuredQuery_Order_FieldNumber) { - GCFSStructuredQuery_Order_FieldNumber_Field = 1, - GCFSStructuredQuery_Order_FieldNumber_Direction = 2, -}; - -/** - * An order on a field. - **/ -@interface GCFSStructuredQuery_Order : GPBMessage - -/** The field to order by. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSStructuredQuery_FieldReference *field; -/** Test to see if @c field has been set. */ -@property(nonatomic, readwrite) BOOL hasField; - -/** The direction to order by. Defaults to `ASCENDING`. */ -@property(nonatomic, readwrite) GCFSStructuredQuery_Direction direction; - -@end - -/** - * Fetches the raw value of a @c GCFSStructuredQuery_Order's @c direction property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message); -/** - * Sets the raw value of an @c GCFSStructuredQuery_Order's @c direction property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message, int32_t value); - -#pragma mark - GCFSStructuredQuery_FieldReference - -typedef GPB_ENUM(GCFSStructuredQuery_FieldReference_FieldNumber) { - GCFSStructuredQuery_FieldReference_FieldNumber_FieldPath = 2, -}; - -/** - * A reference to a field, such as `max(messages.time) as max_time`. - **/ -@interface GCFSStructuredQuery_FieldReference : GPBMessage - -@property(nonatomic, readwrite, copy, null_resettable) NSString *fieldPath; - -@end - -#pragma mark - GCFSStructuredQuery_Projection - -typedef GPB_ENUM(GCFSStructuredQuery_Projection_FieldNumber) { - GCFSStructuredQuery_Projection_FieldNumber_FieldsArray = 2, -}; - -/** - * The projection of document's fields to return. - **/ -@interface GCFSStructuredQuery_Projection : GPBMessage - -/** - * The fields to return. - * - * If empty, all fields are returned. To only return the name - * of the document, use `['__name__']`. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fieldsArray; -/** The number of items in @c fieldsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger fieldsArray_Count; - -@end - -#pragma mark - GCFSCursor - -typedef GPB_ENUM(GCFSCursor_FieldNumber) { - GCFSCursor_FieldNumber_ValuesArray = 1, - GCFSCursor_FieldNumber_Before = 2, -}; - -/** - * A position in a query result set. - **/ -@interface GCFSCursor : GPBMessage - -/** - * The values that represent a position, in the order they appear in - * the order by clause of a query. - * - * Can contain fewer values than specified in the order by clause. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *valuesArray; -/** The number of items in @c valuesArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger valuesArray_Count; - -/** - * If the position is just before or just after the given values, relative - * to the sort order defined by the query. - **/ -@property(nonatomic, readwrite) BOOL before; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.m deleted file mode 100644 index 799ca9ae3..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.m +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/query.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Wrappers.pbobjc.h" -#endif - - #import "Query.pbobjc.h" - #import "Annotations.pbobjc.h" - #import "Document.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - GCFSQueryRoot - -@implementation GCFSQueryRoot - - -@end - -#pragma mark - GCFSQueryRoot_FileDescriptor - -static GPBFileDescriptor *GCFSQueryRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.firestore.v1" - objcPrefix:@"GCFS" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GCFSStructuredQuery - -@implementation GCFSStructuredQuery - -@dynamic hasSelect, select; -@dynamic fromArray, fromArray_Count; -@dynamic hasWhere, where; -@dynamic orderByArray, orderByArray_Count; -@dynamic hasStartAt, startAt; -@dynamic hasEndAt, endAt; -@dynamic offset; -@dynamic hasLimit, limit; - -typedef struct GCFSStructuredQuery__storage_ { - uint32_t _has_storage_[1]; - int32_t offset; - GCFSStructuredQuery_Projection *select; - NSMutableArray *fromArray; - GCFSStructuredQuery_Filter *where; - NSMutableArray *orderByArray; - GPBInt32Value *limit; - GCFSCursor *startAt; - GCFSCursor *endAt; -} GCFSStructuredQuery__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "select", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Projection), - .number = GCFSStructuredQuery_FieldNumber_Select, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, select), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "fromArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_CollectionSelector), - .number = GCFSStructuredQuery_FieldNumber_FromArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, fromArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "where", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Filter), - .number = GCFSStructuredQuery_FieldNumber_Where, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, where), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "orderByArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Order), - .number = GCFSStructuredQuery_FieldNumber_OrderByArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, orderByArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "limit", - .dataTypeSpecific.className = GPBStringifySymbol(GPBInt32Value), - .number = GCFSStructuredQuery_FieldNumber_Limit, - .hasIndex = 5, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, limit), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "offset", - .dataTypeSpecific.className = NULL, - .number = GCFSStructuredQuery_FieldNumber_Offset, - .hasIndex = 4, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, offset), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "startAt", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSCursor), - .number = GCFSStructuredQuery_FieldNumber_StartAt, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, startAt), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "endAt", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSCursor), - .number = GCFSStructuredQuery_FieldNumber_EndAt, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GCFSStructuredQuery__storage_, endAt), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - Enum GCFSStructuredQuery_Direction - -GPBEnumDescriptor *GCFSStructuredQuery_Direction_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static const char *valueNames = - "DirectionUnspecified\000Ascending\000Descendin" - "g\000"; - static const int32_t values[] = { - GCFSStructuredQuery_Direction_DirectionUnspecified, - GCFSStructuredQuery_Direction_Ascending, - GCFSStructuredQuery_Direction_Descending, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_Direction) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GCFSStructuredQuery_Direction_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GCFSStructuredQuery_Direction_IsValidValue(int32_t value__) { - switch (value__) { - case GCFSStructuredQuery_Direction_DirectionUnspecified: - case GCFSStructuredQuery_Direction_Ascending: - case GCFSStructuredQuery_Direction_Descending: - return YES; - default: - return NO; - } -} - -#pragma mark - GCFSStructuredQuery_CollectionSelector - -@implementation GCFSStructuredQuery_CollectionSelector - -@dynamic collectionId; -@dynamic allDescendants; - -typedef struct GCFSStructuredQuery_CollectionSelector__storage_ { - uint32_t _has_storage_[1]; - NSString *collectionId; -} GCFSStructuredQuery_CollectionSelector__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "collectionId", - .dataTypeSpecific.className = NULL, - .number = GCFSStructuredQuery_CollectionSelector_FieldNumber_CollectionId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_CollectionSelector__storage_, collectionId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "allDescendants", - .dataTypeSpecific.className = NULL, - .number = GCFSStructuredQuery_CollectionSelector_FieldNumber_AllDescendants, - .hasIndex = 1, - .offset = 2, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_CollectionSelector class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_CollectionSelector__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSStructuredQuery_Filter - -@implementation GCFSStructuredQuery_Filter - -@dynamic filterTypeOneOfCase; -@dynamic compositeFilter; -@dynamic fieldFilter; -@dynamic unaryFilter; - -typedef struct GCFSStructuredQuery_Filter__storage_ { - uint32_t _has_storage_[2]; - GCFSStructuredQuery_CompositeFilter *compositeFilter; - GCFSStructuredQuery_FieldFilter *fieldFilter; - GCFSStructuredQuery_UnaryFilter *unaryFilter; -} GCFSStructuredQuery_Filter__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "compositeFilter", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_CompositeFilter), - .number = GCFSStructuredQuery_Filter_FieldNumber_CompositeFilter, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_Filter__storage_, compositeFilter), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "fieldFilter", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldFilter), - .number = GCFSStructuredQuery_Filter_FieldNumber_FieldFilter, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_Filter__storage_, fieldFilter), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "unaryFilter", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_UnaryFilter), - .number = GCFSStructuredQuery_Filter_FieldNumber_UnaryFilter, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_Filter__storage_, unaryFilter), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_Filter class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_Filter__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "filterType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSStructuredQuery_Filter_ClearFilterTypeOneOfCase(GCFSStructuredQuery_Filter *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSStructuredQuery_CompositeFilter - -@implementation GCFSStructuredQuery_CompositeFilter - -@dynamic op; -@dynamic filtersArray, filtersArray_Count; - -typedef struct GCFSStructuredQuery_CompositeFilter__storage_ { - uint32_t _has_storage_[1]; - GCFSStructuredQuery_CompositeFilter_Operator op; - NSMutableArray *filtersArray; -} GCFSStructuredQuery_CompositeFilter__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "op", - .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_CompositeFilter_Operator_EnumDescriptor, - .number = GCFSStructuredQuery_CompositeFilter_FieldNumber_Op, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_CompositeFilter__storage_, op), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - { - .name = "filtersArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_Filter), - .number = GCFSStructuredQuery_CompositeFilter_FieldNumber_FiltersArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_CompositeFilter__storage_, filtersArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_CompositeFilter class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_CompositeFilter__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_CompositeFilter descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_CompositeFilter_FieldNumber_Op]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSStructuredQuery_CompositeFilter_Op_RawValue(GCFSStructuredQuery_CompositeFilter *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_CompositeFilter descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_CompositeFilter_FieldNumber_Op]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - Enum GCFSStructuredQuery_CompositeFilter_Operator - -GPBEnumDescriptor *GCFSStructuredQuery_CompositeFilter_Operator_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static const char *valueNames = - "OperatorUnspecified\000And\000"; - static const int32_t values[] = { - GCFSStructuredQuery_CompositeFilter_Operator_OperatorUnspecified, - GCFSStructuredQuery_CompositeFilter_Operator_And, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_CompositeFilter_Operator) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GCFSStructuredQuery_CompositeFilter_Operator_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GCFSStructuredQuery_CompositeFilter_Operator_IsValidValue(int32_t value__) { - switch (value__) { - case GCFSStructuredQuery_CompositeFilter_Operator_OperatorUnspecified: - case GCFSStructuredQuery_CompositeFilter_Operator_And: - return YES; - default: - return NO; - } -} - -#pragma mark - GCFSStructuredQuery_FieldFilter - -@implementation GCFSStructuredQuery_FieldFilter - -@dynamic hasField, field; -@dynamic op; -@dynamic hasValue, value; - -typedef struct GCFSStructuredQuery_FieldFilter__storage_ { - uint32_t _has_storage_[1]; - GCFSStructuredQuery_FieldFilter_Operator op; - GCFSStructuredQuery_FieldReference *field; - GCFSValue *value; -} GCFSStructuredQuery_FieldFilter__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "field", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), - .number = GCFSStructuredQuery_FieldFilter_FieldNumber_Field, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldFilter__storage_, field), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "op", - .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor, - .number = GCFSStructuredQuery_FieldFilter_FieldNumber_Op, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldFilter__storage_, op), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - { - .name = "value", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSStructuredQuery_FieldFilter_FieldNumber_Value, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldFilter__storage_, value), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_FieldFilter class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_FieldFilter__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_FieldFilter descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_FieldFilter_FieldNumber_Op]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSStructuredQuery_FieldFilter_Op_RawValue(GCFSStructuredQuery_FieldFilter *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_FieldFilter descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_FieldFilter_FieldNumber_Op]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - Enum GCFSStructuredQuery_FieldFilter_Operator - -GPBEnumDescriptor *GCFSStructuredQuery_FieldFilter_Operator_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static const char *valueNames = - "OperatorUnspecified\000LessThan\000LessThanOrE" - "qual\000GreaterThan\000GreaterThanOrEqual\000Equa" - "l\000ArrayContains\000In\000ArrayContainsAny\000"; - static const int32_t values[] = { - GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified, - GCFSStructuredQuery_FieldFilter_Operator_LessThan, - GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual, - GCFSStructuredQuery_FieldFilter_Operator_GreaterThan, - GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual, - GCFSStructuredQuery_FieldFilter_Operator_Equal, - GCFSStructuredQuery_FieldFilter_Operator_ArrayContains, - GCFSStructuredQuery_FieldFilter_Operator_In, - GCFSStructuredQuery_FieldFilter_Operator_ArrayContainsAny, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_FieldFilter_Operator) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GCFSStructuredQuery_FieldFilter_Operator_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GCFSStructuredQuery_FieldFilter_Operator_IsValidValue(int32_t value__) { - switch (value__) { - case GCFSStructuredQuery_FieldFilter_Operator_OperatorUnspecified: - case GCFSStructuredQuery_FieldFilter_Operator_LessThan: - case GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual: - case GCFSStructuredQuery_FieldFilter_Operator_GreaterThan: - case GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual: - case GCFSStructuredQuery_FieldFilter_Operator_Equal: - case GCFSStructuredQuery_FieldFilter_Operator_ArrayContains: - case GCFSStructuredQuery_FieldFilter_Operator_In: - case GCFSStructuredQuery_FieldFilter_Operator_ArrayContainsAny: - return YES; - default: - return NO; - } -} - -#pragma mark - GCFSStructuredQuery_UnaryFilter - -@implementation GCFSStructuredQuery_UnaryFilter - -@dynamic operandTypeOneOfCase; -@dynamic op; -@dynamic field; - -typedef struct GCFSStructuredQuery_UnaryFilter__storage_ { - uint32_t _has_storage_[2]; - GCFSStructuredQuery_UnaryFilter_Operator op; - GCFSStructuredQuery_FieldReference *field; -} GCFSStructuredQuery_UnaryFilter__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "op", - .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_UnaryFilter_Operator_EnumDescriptor, - .number = GCFSStructuredQuery_UnaryFilter_FieldNumber_Op, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_UnaryFilter__storage_, op), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - { - .name = "field", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), - .number = GCFSStructuredQuery_UnaryFilter_FieldNumber_Field, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_UnaryFilter__storage_, field), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_UnaryFilter class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_UnaryFilter__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "operandType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_UnaryFilter descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_UnaryFilter_FieldNumber_Op]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSStructuredQuery_UnaryFilter_Op_RawValue(GCFSStructuredQuery_UnaryFilter *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_UnaryFilter descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_UnaryFilter_FieldNumber_Op]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -void GCFSStructuredQuery_UnaryFilter_ClearOperandTypeOneOfCase(GCFSStructuredQuery_UnaryFilter *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - Enum GCFSStructuredQuery_UnaryFilter_Operator - -GPBEnumDescriptor *GCFSStructuredQuery_UnaryFilter_Operator_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static const char *valueNames = - "OperatorUnspecified\000IsNan\000IsNull\000"; - static const int32_t values[] = { - GCFSStructuredQuery_UnaryFilter_Operator_OperatorUnspecified, - GCFSStructuredQuery_UnaryFilter_Operator_IsNan, - GCFSStructuredQuery_UnaryFilter_Operator_IsNull, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSStructuredQuery_UnaryFilter_Operator) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GCFSStructuredQuery_UnaryFilter_Operator_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GCFSStructuredQuery_UnaryFilter_Operator_IsValidValue(int32_t value__) { - switch (value__) { - case GCFSStructuredQuery_UnaryFilter_Operator_OperatorUnspecified: - case GCFSStructuredQuery_UnaryFilter_Operator_IsNan: - case GCFSStructuredQuery_UnaryFilter_Operator_IsNull: - return YES; - default: - return NO; - } -} - -#pragma mark - GCFSStructuredQuery_Order - -@implementation GCFSStructuredQuery_Order - -@dynamic hasField, field; -@dynamic direction; - -typedef struct GCFSStructuredQuery_Order__storage_ { - uint32_t _has_storage_[1]; - GCFSStructuredQuery_Direction direction; - GCFSStructuredQuery_FieldReference *field; -} GCFSStructuredQuery_Order__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "field", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), - .number = GCFSStructuredQuery_Order_FieldNumber_Field, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_Order__storage_, field), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "direction", - .dataTypeSpecific.enumDescFunc = GCFSStructuredQuery_Direction_EnumDescriptor, - .number = GCFSStructuredQuery_Order_FieldNumber_Direction, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_Order__storage_, direction), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_Order class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_Order__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_Order descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_Order_FieldNumber_Direction]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSStructuredQuery_Order_Direction_RawValue(GCFSStructuredQuery_Order *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSStructuredQuery_Order descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSStructuredQuery_Order_FieldNumber_Direction]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -#pragma mark - GCFSStructuredQuery_FieldReference - -@implementation GCFSStructuredQuery_FieldReference - -@dynamic fieldPath; - -typedef struct GCFSStructuredQuery_FieldReference__storage_ { - uint32_t _has_storage_[1]; - NSString *fieldPath; -} GCFSStructuredQuery_FieldReference__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "fieldPath", - .dataTypeSpecific.className = NULL, - .number = GCFSStructuredQuery_FieldReference_FieldNumber_FieldPath, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_FieldReference__storage_, fieldPath), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_FieldReference class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_FieldReference__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSStructuredQuery_Projection - -@implementation GCFSStructuredQuery_Projection - -@dynamic fieldsArray, fieldsArray_Count; - -typedef struct GCFSStructuredQuery_Projection__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *fieldsArray; -} GCFSStructuredQuery_Projection__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "fieldsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSStructuredQuery_FieldReference), - .number = GCFSStructuredQuery_Projection_FieldNumber_FieldsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSStructuredQuery_Projection__storage_, fieldsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSStructuredQuery_Projection class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSStructuredQuery_Projection__storage_) - flags:GPBDescriptorInitializationFlag_None]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSStructuredQuery)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSCursor - -@implementation GCFSCursor - -@dynamic valuesArray, valuesArray_Count; -@dynamic before; - -typedef struct GCFSCursor__storage_ { - uint32_t _has_storage_[1]; - NSMutableArray *valuesArray; -} GCFSCursor__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "valuesArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSCursor_FieldNumber_ValuesArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSCursor__storage_, valuesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - { - .name = "before", - .dataTypeSpecific.className = NULL, - .number = GCFSCursor_FieldNumber_Before, - .hasIndex = 0, - .offset = 1, // Stored in _has_storage_ to save space. - .flags = GPBFieldOptional, - .dataType = GPBDataTypeBool, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSCursor class] - rootClass:[GCFSQueryRoot class] - file:GCFSQueryRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSCursor__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.h deleted file mode 100644 index 8d1b54663..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.h +++ /dev/null @@ -1,515 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/write.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GCFSArrayValue; -@class GCFSDocument; -@class GCFSDocumentMask; -@class GCFSDocumentTransform; -@class GCFSDocumentTransform_FieldTransform; -@class GCFSPrecondition; -@class GCFSValue; -@class GPBTimestamp; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - Enum GCFSDocumentTransform_FieldTransform_ServerValue - -/** A value that is calculated by the server. */ -typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_ServerValue) { - /** - * Value used if any message's field encounters a value that is not defined - * by this enum. The message will also have C functions to get/set the rawValue - * of the field. - **/ - GCFSDocumentTransform_FieldTransform_ServerValue_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, - /** Unspecified. This value must not be used. */ - GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified = 0, - - /** - * The time at which the server processed the request, with millisecond - * precision. - **/ - GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime = 1, -}; - -GPBEnumDescriptor *GCFSDocumentTransform_FieldTransform_ServerValue_EnumDescriptor(void); - -/** - * Checks to see if the given value is defined by the enum or was not known at - * the time this source was generated. - **/ -BOOL GCFSDocumentTransform_FieldTransform_ServerValue_IsValidValue(int32_t value); - -#pragma mark - GCFSWriteRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GCFSWriteRoot : GPBRootObject -@end - -#pragma mark - GCFSWrite - -typedef GPB_ENUM(GCFSWrite_FieldNumber) { - GCFSWrite_FieldNumber_Update = 1, - GCFSWrite_FieldNumber_Delete_p = 2, - GCFSWrite_FieldNumber_UpdateMask = 3, - GCFSWrite_FieldNumber_CurrentDocument = 4, - GCFSWrite_FieldNumber_Transform = 6, -}; - -typedef GPB_ENUM(GCFSWrite_Operation_OneOfCase) { - GCFSWrite_Operation_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSWrite_Operation_OneOfCase_Update = 1, - GCFSWrite_Operation_OneOfCase_Delete_p = 2, - GCFSWrite_Operation_OneOfCase_Transform = 6, -}; - -/** - * A write on a document. - **/ -@interface GCFSWrite : GPBMessage - -/** The operation to execute. */ -@property(nonatomic, readonly) GCFSWrite_Operation_OneOfCase operationOneOfCase; - -/** A document to write. */ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *update; - -/** - * A document name to delete. In the format: - * `projects/{project_id}/databases/{database_id}/documents/{document_path}`. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *delete_p; - -/** - * Applies a tranformation to a document. - * At most one `transform` per document is allowed in a given request. - * An `update` cannot follow a `transform` on the same document in a given - * request. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentTransform *transform; - -/** - * The fields to update in this write. - * - * This field can be set only when the operation is `update`. - * If the mask is not set for an `update` and the document exists, any - * existing data will be overwritten. - * If the mask is set and the document on the server has fields not covered by - * the mask, they are left unchanged. - * Fields referenced in the mask, but not present in the input document, are - * deleted from the document on the server. - * The field paths in this mask must not contain a reserved field name. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocumentMask *updateMask; -/** Test to see if @c updateMask has been set. */ -@property(nonatomic, readwrite) BOOL hasUpdateMask; - -/** - * An optional precondition on the document. - * - * The write will fail if this is set and not met by the target document. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSPrecondition *currentDocument; -/** Test to see if @c currentDocument has been set. */ -@property(nonatomic, readwrite) BOOL hasCurrentDocument; - -@end - -/** - * Clears whatever value was set for the oneof 'operation'. - **/ -void GCFSWrite_ClearOperationOneOfCase(GCFSWrite *message); - -#pragma mark - GCFSDocumentTransform - -typedef GPB_ENUM(GCFSDocumentTransform_FieldNumber) { - GCFSDocumentTransform_FieldNumber_Document = 1, - GCFSDocumentTransform_FieldNumber_FieldTransformsArray = 2, -}; - -/** - * A transformation of a document. - **/ -@interface GCFSDocumentTransform : GPBMessage - -/** The name of the document to transform. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *document; - -/** - * The list of transformations to apply to the fields of the document, in - * order. - * This must not be empty. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *fieldTransformsArray; -/** The number of items in @c fieldTransformsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger fieldTransformsArray_Count; - -@end - -#pragma mark - GCFSDocumentTransform_FieldTransform - -typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_FieldNumber) { - GCFSDocumentTransform_FieldTransform_FieldNumber_FieldPath = 1, - GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue = 2, - GCFSDocumentTransform_FieldTransform_FieldNumber_Increment = 3, - GCFSDocumentTransform_FieldTransform_FieldNumber_Maximum = 4, - GCFSDocumentTransform_FieldTransform_FieldNumber_Minimum = 5, - GCFSDocumentTransform_FieldTransform_FieldNumber_AppendMissingElements = 6, - GCFSDocumentTransform_FieldTransform_FieldNumber_RemoveAllFromArray_p = 7, -}; - -typedef GPB_ENUM(GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase) { - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_GPBUnsetOneOfCase = 0, - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_SetToServerValue = 2, - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_Increment = 3, - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_Maximum = 4, - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_Minimum = 5, - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_AppendMissingElements = 6, - GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_RemoveAllFromArray_p = 7, -}; - -/** - * A transformation of a field of the document. - **/ -@interface GCFSDocumentTransform_FieldTransform : GPBMessage - -/** - * The path of the field. See [Document.fields][google.firestore.v1.Document.fields] for the field path syntax - * reference. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *fieldPath; - -/** The transformation to apply on the field. */ -@property(nonatomic, readonly) GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase transformTypeOneOfCase; - -/** Sets the field to the given server value. */ -@property(nonatomic, readwrite) GCFSDocumentTransform_FieldTransform_ServerValue setToServerValue; - -/** - * Adds the given value to the field's current value. - * - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If either of the given value or the current field value are doubles, - * both values will be interpreted as doubles. Double arithmetic and - * representation of double values follow IEEE 754 semantics. - * If there is positive/negative integer overflow, the field is resolved - * to the largest magnitude positive/negative integer. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSValue *increment; - -/** - * Sets the field to the maximum of its current value and the given value. - * - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the given value. - * If a maximum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the larger operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The maximum of a zero stored value and - * zero input value is always the stored value. - * The maximum of any numeric value x and NaN is NaN. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSValue *maximum; - -/** - * Sets the field to the minimum of its current value and the given value. - * - * This must be an integer or a double value. - * If the field is not an integer or double, or if the field does not yet - * exist, the transformation will set the field to the input value. - * If a minimum operation is applied where the field and the input value - * are of mixed types (that is - one is an integer and one is a double) - * the field takes on the type of the smaller operand. If the operands are - * equivalent (e.g. 3 and 3.0), the field does not change. - * 0, 0.0, and -0.0 are all zero. The minimum of a zero stored value and - * zero input value is always the stored value. - * The minimum of any numeric value x and NaN is NaN. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSValue *minimum; - -/** - * Append the given elements in order if they are not already present in - * the current field value. - * If the field is not an array, or if the field does not yet exist, it is - * first set to the empty array. - * - * Equivalent numbers of different types (e.g. 3L and 3.0) are - * considered equal when checking if a value is missing. - * NaN is equal to NaN, and Null is equal to Null. - * If the input contains multiple equivalent values, only the first will - * be considered. - * - * The corresponding transform_result will be the null value. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSArrayValue *appendMissingElements; - -/** - * Remove all of the given elements from the array in the field. - * If the field is not an array, or if the field does not yet exist, it is - * set to the empty array. - * - * Equivalent numbers of the different types (e.g. 3L and 3.0) are - * considered equal when deciding whether an element should be removed. - * NaN is equal to NaN, and Null is equal to Null. - * This will remove all equivalent values if there are duplicates. - * - * The corresponding transform_result will be the null value. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSArrayValue *removeAllFromArray_p; - -@end - -/** - * Fetches the raw value of a @c GCFSDocumentTransform_FieldTransform's @c setToServerValue property, even - * if the value was not defined by the enum at the time the code was generated. - **/ -int32_t GCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message); -/** - * Sets the raw value of an @c GCFSDocumentTransform_FieldTransform's @c setToServerValue property, allowing - * it to be set to a value that was not defined by the enum at the time the code - * was generated. - **/ -void SetGCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message, int32_t value); - -/** - * Clears whatever value was set for the oneof 'transformType'. - **/ -void GCFSDocumentTransform_FieldTransform_ClearTransformTypeOneOfCase(GCFSDocumentTransform_FieldTransform *message); - -#pragma mark - GCFSWriteResult - -typedef GPB_ENUM(GCFSWriteResult_FieldNumber) { - GCFSWriteResult_FieldNumber_UpdateTime = 1, - GCFSWriteResult_FieldNumber_TransformResultsArray = 2, -}; - -/** - * The result of applying a write. - **/ -@interface GCFSWriteResult : GPBMessage - -/** - * The last update time of the document after applying the write. Not set - * after a `delete`. - * - * If the write did not actually change the document, this will be the - * previous update_time. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *updateTime; -/** Test to see if @c updateTime has been set. */ -@property(nonatomic, readwrite) BOOL hasUpdateTime; - -/** - * The results of applying each [DocumentTransform.FieldTransform][google.firestore.v1.DocumentTransform.FieldTransform], in the - * same order. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *transformResultsArray; -/** The number of items in @c transformResultsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger transformResultsArray_Count; - -@end - -#pragma mark - GCFSDocumentChange - -typedef GPB_ENUM(GCFSDocumentChange_FieldNumber) { - GCFSDocumentChange_FieldNumber_Document = 1, - GCFSDocumentChange_FieldNumber_TargetIdsArray = 5, - GCFSDocumentChange_FieldNumber_RemovedTargetIdsArray = 6, -}; - -/** - * A [Document][google.firestore.v1.Document] has changed. - * - * May be the result of multiple [writes][google.firestore.v1.Write], including deletes, that - * ultimately resulted in a new value for the [Document][google.firestore.v1.Document]. - * - * Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical - * change, if multiple targets are affected. - **/ -@interface GCFSDocumentChange : GPBMessage - -/** - * The new state of the [Document][google.firestore.v1.Document]. - * - * If `mask` is set, contains only fields that were updated or added. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GCFSDocument *document; -/** Test to see if @c document has been set. */ -@property(nonatomic, readwrite) BOOL hasDocument; - -/** A set of target IDs of targets that match this document. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *targetIdsArray; -/** The number of items in @c targetIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger targetIdsArray_Count; - -/** A set of target IDs for targets that no longer match this document. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *removedTargetIdsArray; -/** The number of items in @c removedTargetIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger removedTargetIdsArray_Count; - -@end - -#pragma mark - GCFSDocumentDelete - -typedef GPB_ENUM(GCFSDocumentDelete_FieldNumber) { - GCFSDocumentDelete_FieldNumber_Document = 1, - GCFSDocumentDelete_FieldNumber_ReadTime = 4, - GCFSDocumentDelete_FieldNumber_RemovedTargetIdsArray = 6, -}; - -/** - * A [Document][google.firestore.v1.Document] has been deleted. - * - * May be the result of multiple [writes][google.firestore.v1.Write], including updates, the - * last of which deleted the [Document][google.firestore.v1.Document]. - * - * Multiple [DocumentDelete][google.firestore.v1.DocumentDelete] messages may be returned for the same logical - * delete, if multiple targets are affected. - **/ -@interface GCFSDocumentDelete : GPBMessage - -/** The resource name of the [Document][google.firestore.v1.Document] that was deleted. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *document; - -/** A set of target IDs for targets that previously matched this entity. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *removedTargetIdsArray; -/** The number of items in @c removedTargetIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger removedTargetIdsArray_Count; - -/** - * The read timestamp at which the delete was observed. - * - * Greater or equal to the `commit_time` of the delete. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; -/** Test to see if @c readTime has been set. */ -@property(nonatomic, readwrite) BOOL hasReadTime; - -@end - -#pragma mark - GCFSDocumentRemove - -typedef GPB_ENUM(GCFSDocumentRemove_FieldNumber) { - GCFSDocumentRemove_FieldNumber_Document = 1, - GCFSDocumentRemove_FieldNumber_RemovedTargetIdsArray = 2, - GCFSDocumentRemove_FieldNumber_ReadTime = 4, -}; - -/** - * A [Document][google.firestore.v1.Document] has been removed from the view of the targets. - * - * Sent if the document is no longer relevant to a target and is out of view. - * Can be sent instead of a DocumentDelete or a DocumentChange if the server - * can not send the new value of the document. - * - * Multiple [DocumentRemove][google.firestore.v1.DocumentRemove] messages may be returned for the same logical - * write or delete, if multiple targets are affected. - **/ -@interface GCFSDocumentRemove : GPBMessage - -/** The resource name of the [Document][google.firestore.v1.Document] that has gone out of view. */ -@property(nonatomic, readwrite, copy, null_resettable) NSString *document; - -/** A set of target IDs for targets that previously matched this document. */ -@property(nonatomic, readwrite, strong, null_resettable) GPBInt32Array *removedTargetIdsArray; -/** The number of items in @c removedTargetIdsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger removedTargetIdsArray_Count; - -/** - * The read timestamp at which the remove was observed. - * - * Greater or equal to the `commit_time` of the change/delete/remove. - **/ -@property(nonatomic, readwrite, strong, null_resettable) GPBTimestamp *readTime; -/** Test to see if @c readTime has been set. */ -@property(nonatomic, readwrite) BOOL hasReadTime; - -@end - -#pragma mark - GCFSExistenceFilter - -typedef GPB_ENUM(GCFSExistenceFilter_FieldNumber) { - GCFSExistenceFilter_FieldNumber_TargetId = 1, - GCFSExistenceFilter_FieldNumber_Count = 2, -}; - -/** - * A digest of all the documents that match a given target. - **/ -@interface GCFSExistenceFilter : GPBMessage - -/** The target ID to which this filter applies. */ -@property(nonatomic, readwrite) int32_t targetId; - -/** - * The total count of documents that match [target_id][google.firestore.v1.ExistenceFilter.target_id]. - * - * If different from the count of documents in the client that match, the - * client must manually determine which documents no longer match the target. - **/ -@property(nonatomic, readwrite) int32_t count; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.m deleted file mode 100644 index 1114421ab..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.m +++ /dev/null @@ -1,697 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/firestore/v1/write.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Timestamp.pbobjc.h" -#endif - - #import "Write.pbobjc.h" - #import "Annotations.pbobjc.h" - #import "Common.pbobjc.h" - #import "Document.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#pragma clang diagnostic ignored "-Wdirect-ivar-access" - -#pragma mark - GCFSWriteRoot - -@implementation GCFSWriteRoot - - -@end - -#pragma mark - GCFSWriteRoot_FileDescriptor - -static GPBFileDescriptor *GCFSWriteRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.firestore.v1" - objcPrefix:@"GCFS" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GCFSWrite - -@implementation GCFSWrite - -@dynamic operationOneOfCase; -@dynamic update; -@dynamic delete_p; -@dynamic transform; -@dynamic hasUpdateMask, updateMask; -@dynamic hasCurrentDocument, currentDocument; - -typedef struct GCFSWrite__storage_ { - uint32_t _has_storage_[2]; - GCFSDocument *update; - NSString *delete_p; - GCFSDocumentMask *updateMask; - GCFSPrecondition *currentDocument; - GCFSDocumentTransform *transform; -} GCFSWrite__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "update", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSWrite_FieldNumber_Update, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSWrite__storage_, update), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "delete_p", - .dataTypeSpecific.className = NULL, - .number = GCFSWrite_FieldNumber_Delete_p, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSWrite__storage_, delete_p), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "updateMask", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentMask), - .number = GCFSWrite_FieldNumber_UpdateMask, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSWrite__storage_, updateMask), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "currentDocument", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSPrecondition), - .number = GCFSWrite_FieldNumber_CurrentDocument, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSWrite__storage_, currentDocument), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transform", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentTransform), - .number = GCFSWrite_FieldNumber_Transform, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSWrite__storage_, transform), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSWrite class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSWrite__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "operation", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -void GCFSWrite_ClearOperationOneOfCase(GCFSWrite *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - GCFSDocumentTransform - -@implementation GCFSDocumentTransform - -@dynamic document; -@dynamic fieldTransformsArray, fieldTransformsArray_Count; - -typedef struct GCFSDocumentTransform__storage_ { - uint32_t _has_storage_[1]; - NSString *document; - NSMutableArray *fieldTransformsArray; -} GCFSDocumentTransform__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "document", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentTransform_FieldNumber_Document, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDocumentTransform__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "fieldTransformsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocumentTransform_FieldTransform), - .number = GCFSDocumentTransform_FieldNumber_FieldTransformsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocumentTransform__storage_, fieldTransformsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocumentTransform class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocumentTransform__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSDocumentTransform_FieldTransform - -@implementation GCFSDocumentTransform_FieldTransform - -@dynamic transformTypeOneOfCase; -@dynamic fieldPath; -@dynamic setToServerValue; -@dynamic increment; -@dynamic maximum; -@dynamic minimum; -@dynamic appendMissingElements; -@dynamic removeAllFromArray_p; - -typedef struct GCFSDocumentTransform_FieldTransform__storage_ { - uint32_t _has_storage_[2]; - GCFSDocumentTransform_FieldTransform_ServerValue setToServerValue; - NSString *fieldPath; - GCFSValue *increment; - GCFSValue *maximum; - GCFSValue *minimum; - GCFSArrayValue *appendMissingElements; - GCFSArrayValue *removeAllFromArray_p; -} GCFSDocumentTransform_FieldTransform__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "fieldPath", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_FieldPath, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, fieldPath), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "setToServerValue", - .dataTypeSpecific.enumDescFunc = GCFSDocumentTransform_FieldTransform_ServerValue_EnumDescriptor, - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, setToServerValue), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasEnumDescriptor), - .dataType = GPBDataTypeEnum, - }, - { - .name = "increment", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_Increment, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, increment), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "maximum", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_Maximum, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, maximum), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "minimum", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_Minimum, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, minimum), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "appendMissingElements", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSArrayValue), - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_AppendMissingElements, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, appendMissingElements), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "removeAllFromArray_p", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSArrayValue), - .number = GCFSDocumentTransform_FieldTransform_FieldNumber_RemoveAllFromArray_p, - .hasIndex = -1, - .offset = (uint32_t)offsetof(GCFSDocumentTransform_FieldTransform__storage_, removeAllFromArray_p), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocumentTransform_FieldTransform class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocumentTransform_FieldTransform__storage_) - flags:GPBDescriptorInitializationFlag_None]; - static const char *oneofs[] = { - "transformType", - }; - [localDescriptor setupOneofs:oneofs - count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) - firstHasIndex:-1]; - [localDescriptor setupContainingMessageClassName:GPBStringifySymbol(GCFSDocumentTransform)]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -int32_t GCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message) { - GPBDescriptor *descriptor = [GCFSDocumentTransform_FieldTransform descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue]; - return GPBGetMessageInt32Field(message, field); -} - -void SetGCFSDocumentTransform_FieldTransform_SetToServerValue_RawValue(GCFSDocumentTransform_FieldTransform *message, int32_t value) { - GPBDescriptor *descriptor = [GCFSDocumentTransform_FieldTransform descriptor]; - GPBFieldDescriptor *field = [descriptor fieldWithNumber:GCFSDocumentTransform_FieldTransform_FieldNumber_SetToServerValue]; - GPBSetInt32IvarWithFieldInternal(message, field, value, descriptor.file.syntax); -} - -void GCFSDocumentTransform_FieldTransform_ClearTransformTypeOneOfCase(GCFSDocumentTransform_FieldTransform *message) { - GPBDescriptor *descriptor = [message descriptor]; - GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; - GPBMaybeClearOneof(message, oneof, -1, 0); -} -#pragma mark - Enum GCFSDocumentTransform_FieldTransform_ServerValue - -GPBEnumDescriptor *GCFSDocumentTransform_FieldTransform_ServerValue_EnumDescriptor(void) { - static GPBEnumDescriptor *descriptor = NULL; - if (!descriptor) { - static const char *valueNames = - "ServerValueUnspecified\000RequestTime\000"; - static const int32_t values[] = { - GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified, - GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime, - }; - GPBEnumDescriptor *worker = - [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GCFSDocumentTransform_FieldTransform_ServerValue) - valueNames:valueNames - values:values - count:(uint32_t)(sizeof(values) / sizeof(int32_t)) - enumVerifier:GCFSDocumentTransform_FieldTransform_ServerValue_IsValidValue]; - if (!OSAtomicCompareAndSwapPtrBarrier(nil, worker, (void * volatile *)&descriptor)) { - [worker release]; - } - } - return descriptor; -} - -BOOL GCFSDocumentTransform_FieldTransform_ServerValue_IsValidValue(int32_t value__) { - switch (value__) { - case GCFSDocumentTransform_FieldTransform_ServerValue_ServerValueUnspecified: - case GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime: - return YES; - default: - return NO; - } -} - -#pragma mark - GCFSWriteResult - -@implementation GCFSWriteResult - -@dynamic hasUpdateTime, updateTime; -@dynamic transformResultsArray, transformResultsArray_Count; - -typedef struct GCFSWriteResult__storage_ { - uint32_t _has_storage_[1]; - GPBTimestamp *updateTime; - NSMutableArray *transformResultsArray; -} GCFSWriteResult__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "updateTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSWriteResult_FieldNumber_UpdateTime, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSWriteResult__storage_, updateTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "transformResultsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSValue), - .number = GCFSWriteResult_FieldNumber_TransformResultsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSWriteResult__storage_, transformResultsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSWriteResult class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSWriteResult__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSDocumentChange - -@implementation GCFSDocumentChange - -@dynamic hasDocument, document; -@dynamic targetIdsArray, targetIdsArray_Count; -@dynamic removedTargetIdsArray, removedTargetIdsArray_Count; - -typedef struct GCFSDocumentChange__storage_ { - uint32_t _has_storage_[1]; - GCFSDocument *document; - GPBInt32Array *targetIdsArray; - GPBInt32Array *removedTargetIdsArray; -} GCFSDocumentChange__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "document", - .dataTypeSpecific.className = GPBStringifySymbol(GCFSDocument), - .number = GCFSDocumentChange_FieldNumber_Document, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDocumentChange__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "targetIdsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentChange_FieldNumber_TargetIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocumentChange__storage_, targetIdsArray), - .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), - .dataType = GPBDataTypeInt32, - }, - { - .name = "removedTargetIdsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentChange_FieldNumber_RemovedTargetIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocumentChange__storage_, removedTargetIdsArray), - .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), - .dataType = GPBDataTypeInt32, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocumentChange class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocumentChange__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSDocumentDelete - -@implementation GCFSDocumentDelete - -@dynamic document; -@dynamic removedTargetIdsArray, removedTargetIdsArray_Count; -@dynamic hasReadTime, readTime; - -typedef struct GCFSDocumentDelete__storage_ { - uint32_t _has_storage_[1]; - NSString *document; - GPBTimestamp *readTime; - GPBInt32Array *removedTargetIdsArray; -} GCFSDocumentDelete__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "document", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentDelete_FieldNumber_Document, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDocumentDelete__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSDocumentDelete_FieldNumber_ReadTime, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSDocumentDelete__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "removedTargetIdsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentDelete_FieldNumber_RemovedTargetIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocumentDelete__storage_, removedTargetIdsArray), - .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), - .dataType = GPBDataTypeInt32, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocumentDelete class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocumentDelete__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSDocumentRemove - -@implementation GCFSDocumentRemove - -@dynamic document; -@dynamic removedTargetIdsArray, removedTargetIdsArray_Count; -@dynamic hasReadTime, readTime; - -typedef struct GCFSDocumentRemove__storage_ { - uint32_t _has_storage_[1]; - NSString *document; - GPBInt32Array *removedTargetIdsArray; - GPBTimestamp *readTime; -} GCFSDocumentRemove__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "document", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentRemove_FieldNumber_Document, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSDocumentRemove__storage_, document), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "removedTargetIdsArray", - .dataTypeSpecific.className = NULL, - .number = GCFSDocumentRemove_FieldNumber_RemovedTargetIdsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GCFSDocumentRemove__storage_, removedTargetIdsArray), - .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), - .dataType = GPBDataTypeInt32, - }, - { - .name = "readTime", - .dataTypeSpecific.className = GPBStringifySymbol(GPBTimestamp), - .number = GCFSDocumentRemove_FieldNumber_ReadTime, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSDocumentRemove__storage_, readTime), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSDocumentRemove class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSDocumentRemove__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - -#pragma mark - GCFSExistenceFilter - -@implementation GCFSExistenceFilter - -@dynamic targetId; -@dynamic count; - -typedef struct GCFSExistenceFilter__storage_ { - uint32_t _has_storage_[1]; - int32_t targetId; - int32_t count; -} GCFSExistenceFilter__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "targetId", - .dataTypeSpecific.className = NULL, - .number = GCFSExistenceFilter_FieldNumber_TargetId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GCFSExistenceFilter__storage_, targetId), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "count", - .dataTypeSpecific.className = NULL, - .number = GCFSExistenceFilter_FieldNumber_Count, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GCFSExistenceFilter__storage_, count), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GCFSExistenceFilter class] - rootClass:[GCFSWriteRoot class] - file:GCFSWriteRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GCFSExistenceFilter__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/rpc/Status.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/rpc/Status.pbobjc.h deleted file mode 100644 index ad81346fd..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/rpc/Status.pbobjc.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/rpc/status.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -@class GPBAny; - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - RPCStatusRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface RPCStatusRoot : GPBRootObject -@end - -#pragma mark - RPCStatus - -typedef GPB_ENUM(RPCStatus_FieldNumber) { - RPCStatus_FieldNumber_Code = 1, - RPCStatus_FieldNumber_Message = 2, - RPCStatus_FieldNumber_DetailsArray = 3, -}; - -/** - * The `Status` type defines a logical error model that is suitable for different - * programming environments, including REST APIs and RPC APIs. It is used by - * [gRPC](https://github.com/grpc). The error model is designed to be: - * - * - Simple to use and understand for most users - * - Flexible enough to meet unexpected needs - * - * # Overview - * - * The `Status` message contains three pieces of data: error code, error message, - * and error details. The error code should be an enum value of - * [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The - * error message should be a developer-facing English message that helps - * developers *understand* and *resolve* the error. If a localized user-facing - * error message is needed, put the localized message in the error details or - * localize it in the client. The optional error details may contain arbitrary - * information about the error. There is a predefined set of error detail types - * in the package `google.rpc` that can be used for common error conditions. - * - * # Language mapping - * - * The `Status` message is the logical representation of the error model, but it - * is not necessarily the actual wire format. When the `Status` message is - * exposed in different client libraries and different wire protocols, it can be - * mapped differently. For example, it will likely be mapped to some exceptions - * in Java, but more likely mapped to some error codes in C. - * - * # Other uses - * - * The error model and the `Status` message can be used in a variety of - * environments, either with or without APIs, to provide a - * consistent developer experience across different environments. - * - * Example uses of this error model include: - * - * - Partial errors. If a service needs to return partial errors to the client, - * it may embed the `Status` in the normal response to indicate the partial - * errors. - * - * - Workflow errors. A typical workflow has multiple steps. Each step may - * have a `Status` message for error reporting. - * - * - Batch operations. If a client uses batch request and batch response, the - * `Status` message should be used directly inside batch response, one for - * each error sub-response. - * - * - Asynchronous operations. If an API call embeds asynchronous operation - * results in its response, the status of those operations should be - * represented directly using the `Status` message. - * - * - Logging. If some API errors are stored in logs, the message `Status` could - * be used directly after any stripping needed for security/privacy reasons. - **/ -@interface RPCStatus : GPBMessage - -/** The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. */ -@property(nonatomic, readwrite) int32_t code; - -/** - * A developer-facing error message, which should be in English. Any - * user-facing error message should be localized and sent in the - * [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - **/ -@property(nonatomic, readwrite, copy, null_resettable) NSString *message; - -/** - * A list of messages that carry the error details. There is a common set of - * message types for APIs to use. - **/ -@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *detailsArray; -/** The number of items in @c detailsArray without causing the array to be created. */ -@property(nonatomic, readonly) NSUInteger detailsArray_Count; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/rpc/Status.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/rpc/Status.pbobjc.m deleted file mode 100644 index 1183027eb..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/rpc/Status.pbobjc.m +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/rpc/status.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "Any.pbobjc.h" -#endif - - #import "Status.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -#pragma mark - RPCStatusRoot - -@implementation RPCStatusRoot - -// No extensions in the file and none of the imports (direct or indirect) -// defined extensions, so no need to generate +extensionRegistry. - -@end - -#pragma mark - RPCStatusRoot_FileDescriptor - -static GPBFileDescriptor *RPCStatusRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.rpc" - objcPrefix:@"RPC" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - RPCStatus - -@implementation RPCStatus - -@dynamic code; -@dynamic message; -@dynamic detailsArray, detailsArray_Count; - -typedef struct RPCStatus__storage_ { - uint32_t _has_storage_[1]; - int32_t code; - NSString *message; - NSMutableArray *detailsArray; -} RPCStatus__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "code", - .dataTypeSpecific.className = NULL, - .number = RPCStatus_FieldNumber_Code, - .hasIndex = 0, - .offset = (uint32_t)offsetof(RPCStatus__storage_, code), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeInt32, - }, - { - .name = "message", - .dataTypeSpecific.className = NULL, - .number = RPCStatus_FieldNumber_Message, - .hasIndex = 1, - .offset = (uint32_t)offsetof(RPCStatus__storage_, message), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeString, - }, - { - .name = "detailsArray", - .dataTypeSpecific.className = GPBStringifySymbol(GPBAny), - .number = RPCStatus_FieldNumber_DetailsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(RPCStatus__storage_, detailsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeMessage, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[RPCStatus class] - rootClass:[RPCStatusRoot class] - file:RPCStatusRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(RPCStatus__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/type/Latlng.pbobjc.h b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/type/Latlng.pbobjc.h deleted file mode 100644 index 90dec0dfe..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/type/Latlng.pbobjc.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/type/latlng.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers.h" -#endif - -#if GOOGLE_PROTOBUF_OBJC_VERSION < 30002 -#error This file was generated by a newer version of protoc which is incompatible with your Protocol Buffer library sources. -#endif -#if 30002 < GOOGLE_PROTOBUF_OBJC_MIN_SUPPORTED_VERSION -#error This file was generated by an older version of protoc which is incompatible with your Protocol Buffer library sources. -#endif - -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -CF_EXTERN_C_BEGIN - -NS_ASSUME_NONNULL_BEGIN - -#pragma mark - GTPLatlngRoot - -/** - * Exposes the extension registry for this file. - * - * The base class provides: - * @code - * + (GPBExtensionRegistry *)extensionRegistry; - * @endcode - * which is a @c GPBExtensionRegistry that includes all the extensions defined by - * this file and all files that it depends on. - **/ -@interface GTPLatlngRoot : GPBRootObject -@end - -#pragma mark - GTPLatLng - -typedef GPB_ENUM(GTPLatLng_FieldNumber) { - GTPLatLng_FieldNumber_Latitude = 1, - GTPLatLng_FieldNumber_Longitude = 2, -}; - -/** - * An object representing a latitude/longitude pair. This is expressed as a pair - * of doubles representing degrees latitude and degrees longitude. Unless - * specified otherwise, this must conform to the - * WGS84 - * standard. Values must be within normalized ranges. - * - * Example of normalization code in Python: - * - * def NormalizeLongitude(longitude): - * """Wraps decimal degrees longitude to [-180.0, 180.0].""" - * q, r = divmod(longitude, 360.0) - * if r > 180.0 or (r == 180.0 and q <= -1.0): - * return r - 360.0 - * return r - * - * def NormalizeLatLng(latitude, longitude): - * """Wraps decimal degrees latitude and longitude to - * [-90.0, 90.0] and [-180.0, 180.0], respectively.""" - * r = latitude % 360.0 - * if r <= 90.0: - * return r, NormalizeLongitude(longitude) - * elif r >= 270.0: - * return r - 360, NormalizeLongitude(longitude) - * else: - * return 180 - r, NormalizeLongitude(longitude + 180.0) - * - * assert 180.0 == NormalizeLongitude(180.0) - * assert -180.0 == NormalizeLongitude(-180.0) - * assert -179.0 == NormalizeLongitude(181.0) - * assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) - * assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) - * assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) - * assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) - * assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) - * assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) - * assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) - * assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) - * assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) - * assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) - **/ -@interface GTPLatLng : GPBMessage - -/** The latitude in degrees. It must be in the range [-90.0, +90.0]. */ -@property(nonatomic, readwrite) double latitude; - -/** The longitude in degrees. It must be in the range [-180.0, +180.0]. */ -@property(nonatomic, readwrite) double longitude; - -@end - -NS_ASSUME_NONNULL_END - -CF_EXTERN_C_END - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/type/Latlng.pbobjc.m b/Pods/FirebaseFirestore/Firestore/Protos/objc/google/type/Latlng.pbobjc.m deleted file mode 100644 index 337d16ff3..000000000 --- a/Pods/FirebaseFirestore/Firestore/Protos/objc/google/type/Latlng.pbobjc.m +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Generated by the protocol buffer compiler. DO NOT EDIT! -// source: google/type/latlng.proto - -// This CPP symbol can be defined to use imports that match up to the framework -// imports needed when using CocoaPods. -#if !defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) - #define GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS 0 -#endif - -#if GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS - #import -#else - #import "GPBProtocolBuffers_RuntimeSupport.h" -#endif - - #import "Latlng.pbobjc.h" -// @@protoc_insertion_point(imports) - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - -#pragma mark - GTPLatlngRoot - -@implementation GTPLatlngRoot - -// No extensions in the file and no imports, so no need to generate -// +extensionRegistry. - -@end - -#pragma mark - GTPLatlngRoot_FileDescriptor - -static GPBFileDescriptor *GTPLatlngRoot_FileDescriptor(void) { - // This is called by +initialize so there is no need to worry - // about thread safety of the singleton. - static GPBFileDescriptor *descriptor = NULL; - if (!descriptor) { - GPB_DEBUG_CHECK_RUNTIME_VERSIONS(); - descriptor = [[GPBFileDescriptor alloc] initWithPackage:@"google.type" - objcPrefix:@"GTP" - syntax:GPBFileSyntaxProto3]; - } - return descriptor; -} - -#pragma mark - GTPLatLng - -@implementation GTPLatLng - -@dynamic latitude; -@dynamic longitude; - -typedef struct GTPLatLng__storage_ { - uint32_t _has_storage_[1]; - double latitude; - double longitude; -} GTPLatLng__storage_; - -// This method is threadsafe because it is initially called -// in +initialize for each subclass. -+ (GPBDescriptor *)descriptor { - static GPBDescriptor *descriptor = nil; - if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "latitude", - .dataTypeSpecific.className = NULL, - .number = GTPLatLng_FieldNumber_Latitude, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GTPLatLng__storage_, latitude), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeDouble, - }, - { - .name = "longitude", - .dataTypeSpecific.className = NULL, - .number = GTPLatLng_FieldNumber_Longitude, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GTPLatLng__storage_, longitude), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeDouble, - }, - }; - GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GTPLatLng class] - rootClass:[GTPLatlngRoot class] - file:GTPLatlngRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GTPLatLng__storage_) - flags:GPBDescriptorInitializationFlag_None]; - NSAssert(descriptor == nil, @"Startup recursed!"); - descriptor = localDescriptor; - } - return descriptor; -} - -@end - - -#pragma clang diagnostic pop - -// @@protoc_insertion_point(global_scope) diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h index db274e4ef..71ac98d9a 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference+Internal.h @@ -18,8 +18,15 @@ #include -#include "Firestore/core/src/firebase/firestore/api/collection_reference.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" +#include "Firestore/core/src/api/api_fwd.h" + +namespace firebase { +namespace firestore { +namespace model { +class ResourcePath; +} // namespace model +} // namespace firestore +} // namespace firebase namespace api = firebase::firestore::api; namespace model = firebase::firestore::model; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm index 3891d8183..5de4af5e1 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRCollectionReference.mm @@ -23,18 +23,20 @@ #import "Firestore/Source/API/FIRQuery+Internal.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#include "Firestore/core/src/firebase/firestore/api/collection_reference.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/api/collection_reference.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/string_apple.h" namespace util = firebase::firestore::util; using firebase::firestore::api::CollectionReference; using firebase::firestore::api::DocumentReference; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::core::ParsedSetData; using firebase::firestore::model::ResourcePath; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -51,7 +53,7 @@ - (instancetype)initWithPath:(ResourcePath)path } // Override the designated initializer from the super class. -- (instancetype)initWithQuery:(api::Query &&)query { +- (instancetype)initWithQuery:(__unused api::Query &&)query { HARD_FAIL("Use FIRCollectionReference initWithPath: initializer."); } diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h index 58f13d261..4314629ef 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange+Internal.h @@ -18,7 +18,7 @@ #import -#include "Firestore/core/src/firebase/firestore/api/document_change.h" +#include "Firestore/core/src/api/document_change.h" namespace api = firebase::firestore::api; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm index eec863a5c..72c42896a 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentChange.mm @@ -18,8 +18,8 @@ #import "Firestore/Source/API/FIRDocumentSnapshot+Internal.h" -#include "Firestore/core/src/firebase/firestore/api/document_change.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/api/document_change.h" +#include "Firestore/core/src/util/hard_assert.h" using firebase::firestore::api::DocumentChange; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h index 9e357c50d..b417a3a71 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference+Internal.h @@ -18,9 +18,15 @@ #include -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" +#include "Firestore/core/src/api/api_fwd.h" +namespace firebase { +namespace firestore { +namespace model { +class DocumentKey; +class ResourcePath; +} // namespace model +} // namespace firestore +} // namespace firebase namespace api = firebase::firestore::api; namespace model = firebase::firestore::model; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm index 4f90fa98c..24dfe73a3 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentReference.mm @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,28 +28,31 @@ #import "Firestore/Source/API/FIRListenerRegistration+Internal.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/api/source.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/api/collection_reference.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/api/document_snapshot.h" +#include "Firestore/core/src/api/source.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/listen_options.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_apple.h" namespace util = firebase::firestore::util; using firebase::firestore::api::CollectionReference; using firebase::firestore::api::DocumentReference; using firebase::firestore::api::DocumentSnapshot; +using firebase::firestore::api::DocumentSnapshotListener; using firebase::firestore::api::Firestore; using firebase::firestore::api::ListenerRegistration; using firebase::firestore::api::Source; using firebase::firestore::api::MakeSource; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::core::EventListener; using firebase::firestore::core::ListenOptions; using firebase::firestore::core::ParsedSetData; @@ -59,6 +62,7 @@ using firebase::firestore::util::Status; using firebase::firestore::util::StatusOr; using firebase::firestore::util::StatusOrCallback; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -213,7 +217,7 @@ - (void)getDocumentWithSource:(FIRFirestoreSource)source return [[FSTListenerRegistration alloc] initWithRegistration:std::move(result)]; } -- (DocumentSnapshot::Listener)wrapDocumentSnapshotBlock:(FIRDocumentSnapshotBlock)block { +- (DocumentSnapshotListener)wrapDocumentSnapshotBlock:(FIRDocumentSnapshotBlock)block { class Converter : public EventListener { public: explicit Converter(FIRDocumentSnapshotBlock block) : block_(block) { diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h index 499df4ec6..8b24fce6a 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot+Internal.h @@ -18,10 +18,8 @@ #include -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/model/model_fwd.h" namespace api = firebase::firestore::api; namespace model = firebase::firestore::model; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm index a742df6d0..3b97bca8a 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRDocumentSnapshot.mm @@ -19,7 +19,7 @@ #include #include -#include "Firestore/core/src/firebase/firestore/util/warnings.h" +#include "Firestore/core/src/util/warnings.h" #import "Firestore/Source/API/FIRDocumentReference+Internal.h" #import "Firestore/Source/API/FIRFieldPath+Internal.h" @@ -29,18 +29,20 @@ #import "Firestore/Source/API/FIRTimestamp+Internal.h" #import "Firestore/Source/API/converters.h" -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/field_value_options.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/api/document_snapshot.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/field_value_options.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/string_apple.h" namespace util = firebase::firestore::util; using firebase::Timestamp; @@ -50,15 +52,17 @@ using firebase::firestore::api::MakeFIRGeoPoint; using firebase::firestore::api::MakeFIRTimestamp; using firebase::firestore::api::SnapshotMetadata; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::model::DatabaseId; using firebase::firestore::model::Document; using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::FieldPath; using firebase::firestore::model::FieldValue; using firebase::firestore::model::FieldValueOptions; using firebase::firestore::model::ObjectValue; using firebase::firestore::model::ServerTimestampBehavior; using firebase::firestore::nanopb::MakeNSData; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -99,7 +103,14 @@ - (instancetype)initWithFirestore:(std::shared_ptr)firestore documentKey:(DocumentKey)documentKey document:(const absl::optional &)document metadata:(SnapshotMetadata)metadata { - DocumentSnapshot wrapped{firestore, std::move(documentKey), document, std::move(metadata)}; + DocumentSnapshot wrapped; + if (document.has_value()) { + wrapped = + DocumentSnapshot::FromDocument(std::move(firestore), document.value(), std::move(metadata)); + } else { + wrapped = DocumentSnapshot::FromNoDocument(std::move(firestore), std::move(documentKey), + std::move(metadata)); + } return [self initWithSnapshot:std::move(wrapped)]; } @@ -173,16 +184,16 @@ - (nullable id)valueForField:(id)field { - (nullable id)valueForField:(id)field serverTimestampBehavior:(FIRServerTimestampBehavior)serverTimestampBehavior { - FIRFieldPath *fieldPath; + FieldPath fieldPath; if ([field isKindOfClass:[NSString class]]) { - fieldPath = [FIRFieldPath pathWithDotSeparatedString:field]; + fieldPath = FieldPath::FromDotSeparatedString(MakeString(field)); } else if ([field isKindOfClass:[FIRFieldPath class]]) { - fieldPath = field; + fieldPath = ((FIRFieldPath *)field).internalValue; } else { ThrowInvalidArgument("Subscript key must be an NSString or FIRFieldPath."); } - absl::optional fieldValue = _snapshot.GetValue(fieldPath.internalValue); + absl::optional fieldValue = _snapshot.GetValue(fieldPath); FieldValueOptions options = [self optionsForServerTimestampBehavior:serverTimestampBehavior]; return !fieldValue ? nil : [self convertedValue:*fieldValue options:options]; } diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h index be8079a98..019ac9a62 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath+Internal.h @@ -16,7 +16,7 @@ #import "FIRFieldPath.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" +#include "Firestore/core/src/model/model_fwd.h" namespace model = firebase::firestore::model; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm index 77f5f5b7f..f93e21c23 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFieldPath.mm @@ -23,14 +23,14 @@ #import "Firestore/Source/API/FIRFieldPath+Internal.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/string_apple.h" namespace util = firebase::firestore::util; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::model::FieldPath; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -73,17 +73,7 @@ + (instancetype)pathWithDotSeparatedString:(NSString *)path { [[FIRFieldPath alloc] initPrivate:FieldPath::FromDotSeparatedString(util::MakeString(path))]; } -/** Matches any characters in a field path string that are reserved. */ -+ (NSRegularExpression *)reservedCharactersRegex { - static NSRegularExpression *regex = nil; - static dispatch_once_t onceToken; - dispatch_once(&onceToken, ^{ - regex = [NSRegularExpression regularExpressionWithPattern:@"[~*/\\[\\]]" options:0 error:nil]; - }); - return regex; -} - -- (id)copyWithZone:(NSZone *__nullable)zone { +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { return [[[self class] alloc] initPrivate:_internalValue]; } diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h index 189565600..076e225a3 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore+Internal.h @@ -19,9 +19,9 @@ #include #include -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/util/async_queue.h" @class FIRApp; @class FSTFirestoreClient; @@ -59,9 +59,6 @@ NS_ASSUME_NONNULL_BEGIN /** Internal FIRFirestore API we don't want exposed in our public header files. */ @interface FIRFirestore (Internal) -/** Checks to see if logging is is globally enabled for the Firestore client. */ -+ (BOOL)isLoggingEnabled; - + (FIRFirestore *)recoverFromFirestore:(std::shared_ptr)firestore; - (void)terminateInternalWithCompletion:(nullable void (^)(NSError *_Nullable error))completion; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm index a46d94b87..5a18cac05 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestore.mm @@ -16,20 +16,15 @@ #import "FIRFirestore+Internal.h" -#import -#import -#import -#import - #include #include #include #import "FIRFirestoreSettings+Internal.h" +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" #import "Firestore/Source/API/FIRCollectionReference+Internal.h" #import "Firestore/Source/API/FIRDocumentReference+Internal.h" -#import "Firestore/Source/API/FIRFirestore+Internal.h" #import "Firestore/Source/API/FIRListenerRegistration+Internal.h" #import "Firestore/Source/API/FIRQuery+Internal.h" #import "Firestore/Source/API/FIRTransaction+Internal.h" @@ -37,39 +32,50 @@ #import "Firestore/Source/API/FSTFirestoreComponent.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#include "Firestore/core/src/firebase/firestore/api/collection_reference.h" -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/api/write_batch.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/empty.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/executor_libdispatch.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert_apple.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/api/collection_reference.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/api/write_batch.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/config.h" +#include "Firestore/core/src/util/empty.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/exception_apple.h" +#include "Firestore/core/src/util/executor_libdispatch.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_apple.h" namespace util = firebase::firestore::util; using firebase::firestore::api::DocumentReference; using firebase::firestore::api::Firestore; using firebase::firestore::api::ListenerRegistration; -using firebase::firestore::api::ThrowIllegalState; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::auth::CredentialsProvider; using firebase::firestore::core::EventListener; using firebase::firestore::model::DatabaseId; -using firebase::firestore::util::ObjcFailureHandler; using firebase::firestore::util::AsyncQueue; -using firebase::firestore::util::SetFailureHandler; -using firebase::firestore::util::StatusOr; using firebase::firestore::util::Empty; +using firebase::firestore::util::MakeCallback; +using firebase::firestore::util::MakeNSError; +using firebase::firestore::util::MakeNSString; +using firebase::firestore::util::MakeString; +using firebase::firestore::util::ObjcThrowHandler; +using firebase::firestore::util::SetThrowHandler; +using firebase::firestore::util::Status; +using firebase::firestore::util::StatusOr; +using firebase::firestore::util::ThrowIllegalState; +using firebase::firestore::util::ThrowInvalidArgument; + +using UserUpdateBlock = id _Nullable (^)(FIRTransaction *, NSError **); +using UserTransactionCompletion = void (^)(id _Nullable, NSError *_Nullable); NS_ASSUME_NONNULL_BEGIN @@ -89,7 +95,8 @@ @implementation FIRFirestore { + (void)initialize { if (self == [FIRFirestore class]) { - SetFailureHandler(ObjcFailureHandler); + SetThrowHandler(ObjcThrowHandler); + Firestore::SetClientLanguage("gl-objc/"); } } @@ -99,11 +106,11 @@ + (instancetype)firestore { ThrowIllegalState("Failed to get FirebaseApp instance. Please call FirebaseApp.configure() " "before using Firestore"); } - return [self firestoreForApp:app database:util::MakeNSString(DatabaseId::kDefault)]; + return [self firestoreForApp:app database:MakeNSString(DatabaseId::kDefault)]; } + (instancetype)firestoreForApp:(FIRApp *)app { - return [self firestoreForApp:app database:util::MakeNSString(DatabaseId::kDefault)]; + return [self firestoreForApp:app database:MakeNSString(DatabaseId::kDefault)]; } // TODO(b/62410906): make this public @@ -139,7 +146,7 @@ - (instancetype)initWithDatabaseID:(model::DatabaseId)databaseID FSTPreConverterBlock block = ^id _Nullable(id _Nullable input) { if ([input isKindOfClass:[FIRDocumentReference class]]) { - FIRDocumentReference *documentReference = (FIRDocumentReference *)input; + auto documentReference = (FIRDocumentReference *)input; return [[FSTDocumentKeyReference alloc] initWithKey:documentReference.key databaseID:documentReference.firestore.databaseID]; } else { @@ -165,8 +172,16 @@ - (void)setSettings:(FIRFirestoreSettings *)settings { _settings = settings; _firestore->set_settings([settings internalSettings]); +#if HAVE_LIBDISPATCH std::unique_ptr user_executor = absl::make_unique(settings.dispatchQueue); +#else + // It's possible to build without libdispatch on macOS for testing purposes. + // In this case, avoid breaking the build. + std::unique_ptr user_executor = + util::Executor::CreateSerial("com.google.firebase.firestore.user"); +#endif // HAVE_LIBDISPATCH + _firestore->set_user_executor(std::move(user_executor)); } } @@ -180,7 +195,7 @@ - (FIRCollectionReference *)collectionWithPath:(NSString *)collectionPath { } return [[FIRCollectionReference alloc] - initWithReference:_firestore->GetCollection(util::MakeString(collectionPath))]; + initWithReference:_firestore->GetCollection(MakeString(collectionPath))]; } - (FIRDocumentReference *)documentWithPath:(NSString *)documentPath { @@ -191,7 +206,7 @@ - (FIRDocumentReference *)documentWithPath:(NSString *)documentPath { ThrowInvalidArgument("Invalid path (%s). Paths must not contain // in them.", documentPath); } - DocumentReference documentReference = _firestore->GetDocument(util::MakeString(documentPath)); + DocumentReference documentReference = _firestore->GetDocument(MakeString(documentPath)); return [[FIRDocumentReference alloc] initWithReference:std::move(documentReference)]; } @@ -204,7 +219,7 @@ - (FIRQuery *)collectionGroupWithID:(NSString *)collectionID { collectionID); } - auto query = _firestore->GetCollectionGroup(util::MakeString(collectionID)); + auto query = _firestore->GetCollectionGroup(MakeString(collectionID)); return [[FIRQuery alloc] initWithQuery:std::move(query) firestore:_firestore]; } @@ -213,10 +228,9 @@ - (FIRWriteBatch *)batch { writeBatch:_firestore->GetBatch()]; } -- (void)runTransactionWithBlock:(id _Nullable (^)(FIRTransaction *, NSError **))updateBlock +- (void)runTransactionWithBlock:(UserUpdateBlock)updateBlock dispatchQueue:(dispatch_queue_t)queue - completion: - (void (^)(id _Nullable result, NSError *_Nullable error))completion { + completion:(UserTransactionCompletion)completion { if (!updateBlock) { ThrowInvalidArgument("Transaction block cannot be nil."); } @@ -224,43 +238,75 @@ - (void)runTransactionWithBlock:(id _Nullable (^)(FIRTransaction *, NSError **)) ThrowInvalidArgument("Transaction completion block cannot be nil."); } + class TransactionResult { + public: + TransactionResult(FIRFirestore *firestore, + UserUpdateBlock update_block, + dispatch_queue_t queue, + UserTransactionCompletion completion) + : firestore_(firestore), + user_update_block_(update_block), + queue_(queue), + user_completion_(completion) { + } + + void RunUpdateBlock(std::shared_ptr internalTransaction, + core::TransactionResultCallback internalCallback) { + dispatch_async(queue_, ^{ + auto transaction = [FIRTransaction transactionWithInternalTransaction:internalTransaction + firestore:firestore_]; + + NSError *_Nullable error = nil; + user_result_ = user_update_block_(transaction, &error); + + // If the user set an error, disregard the result. + if (error) { + // If the error is a user error, set flag to not retry the transaction. + if (error.domain != FIRFirestoreErrorDomain) { + internalTransaction->MarkPermanentlyFailed(); + } + internalCallback(Status::FromNSError(error)); + } else { + internalCallback(Status::OK()); + } + }); + } + + void HandleFinalStatus(const Status &status) { + if (!status.ok()) { + user_completion_(nil, MakeNSError(status)); + return; + } + + user_completion_(user_result_, nil); + } + + private: + FIRFirestore *firestore_; + UserUpdateBlock user_update_block_; + dispatch_queue_t queue_; + UserTransactionCompletion user_completion_; + + id _Nullable user_result_; + }; + + auto result_capture = std::make_shared(self, updateBlock, queue, completion); + // Wrap the user-supplied updateBlock in a core C++ compatible callback. Wrap the result of the - // updateBlock invocation up in an absl::any for tunneling through the internals of the system. - auto internalUpdateBlock = [self, updateBlock, queue]( + // updateBlock invocation up in a TransactionResult for tunneling through the internals of the + // system. + auto internalUpdateBlock = [result_capture]( std::shared_ptr internalTransaction, core::TransactionResultCallback internalCallback) { - FIRTransaction *transaction = - [FIRTransaction transactionWithInternalTransaction:internalTransaction firestore:self]; - - dispatch_async(queue, ^{ - NSError *_Nullable error = nil; - id _Nullable result = updateBlock(transaction, &error); - - // If the user set an error, disregard the result. - if (error) { - // If the error is a user error, set flag to not retry the transaction. - if (error.domain != FIRFirestoreErrorDomain) { - internalTransaction->MarkPermanentlyFailed(); - } - internalCallback(util::Status::FromNSError(error)); - } else { - internalCallback(absl::make_any(result)); - } - }); + result_capture->RunUpdateBlock(internalTransaction, internalCallback); }; - // Unpacks the absl::any value and calls the user completion handler. + // Unpacks the TransactionResult value and calls the user completion handler. // // PORTING NOTE: Other platforms where the user return value is internally representable don't // need this wrapper. - auto objcTranslator = [completion](util::StatusOr maybeValue) { - if (!maybeValue.ok()) { - completion(nil, util::MakeNSError(maybeValue.status())); - return; - } - - absl::any value = std::move(maybeValue).ValueOrDie(); - completion(absl::any_cast(value), nil); + auto objcTranslator = [result_capture](const Status &status) { + result_capture->HandleFinalStatus(status); }; _firestore->RunTransaction(std::move(internalUpdateBlock), std::move(objcTranslator)); @@ -285,33 +331,33 @@ + (void)enableLogging:(BOOL)logging { } - (void)enableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { - _firestore->EnableNetwork(util::MakeCallback(completion)); + _firestore->EnableNetwork(MakeCallback(completion)); } - (void)disableNetworkWithCompletion:(nullable void (^)(NSError *_Nullable))completion { - _firestore->DisableNetwork(util::MakeCallback(completion)); + _firestore->DisableNetwork(MakeCallback(completion)); } - (void)clearPersistenceWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { - _firestore->ClearPersistence(util::MakeCallback(completion)); + _firestore->ClearPersistence(MakeCallback(completion)); } - (void)waitForPendingWritesWithCompletion:(void (^)(NSError *_Nullable error))completion { - _firestore->WaitForPendingWrites(util::MakeCallback(completion)); + _firestore->WaitForPendingWrites(MakeCallback(completion)); } - (void)terminateWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { id strongRegistry = _registry; if (strongRegistry) { [strongRegistry - removeInstanceWithDatabase:util::MakeNSString(_firestore->database_id().database_id())]; + removeInstanceWithDatabase:MakeNSString(_firestore->database_id().database_id())]; } [self terminateInternalWithCompletion:completion]; } - (id)addSnapshotsInSyncListener:(void (^)(void))listener { std::unique_ptr> eventListener = - core::EventListener::Create([listener](const StatusOr &v) { listener(); }); + core::EventListener::Create([listener](const StatusOr &) { listener(); }); std::unique_ptr result = _firestore->AddSnapshotsInSyncListener(std::move(eventListener)); return [[FSTListenerRegistration alloc] initWithRegistration:std::move(result)]; @@ -333,16 +379,12 @@ @implementation FIRFirestore (Internal) return _firestore->database_id(); } -+ (BOOL)isLoggingEnabled { - return util::LogIsLoggable(util::kLogLevelDebug); -} - + (FIRFirestore *)recoverFromFirestore:(std::shared_ptr)firestore { return (__bridge FIRFirestore *)firestore->extension(); } - (void)terminateInternalWithCompletion:(nullable void (^)(NSError *_Nullable error))completion { - _firestore->Terminate(util::MakeCallback(completion)); + _firestore->Terminate(MakeCallback(completion)); } @end diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.h index 44d4226e0..228e45319 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings+Internal.h @@ -18,7 +18,7 @@ #import -#include "Firestore/core/src/firebase/firestore/api/settings.h" +#include "Firestore/core/src/api/settings.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm index 569ff2b7b..6b4795664 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSettings.mm @@ -16,10 +16,10 @@ #import "FIRFirestoreSettings.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "Firestore/core/src/firebase/firestore/util/warnings.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/string_apple.h" +#include "Firestore/core/src/util/warnings.h" #include "absl/base/attributes.h" #include "absl/memory/memory.h" @@ -28,7 +28,7 @@ namespace api = firebase::firestore::api; namespace util = firebase::firestore::util; using api::Settings; -using api::ThrowInvalidArgument; +using util::ThrowInvalidArgument; // Public constant ABSL_CONST_INIT extern "C" const int64_t kFIRFirestoreCacheSizeUnlimited = @@ -78,7 +78,7 @@ - (NSUInteger)hash { return result; } -- (id)copyWithZone:(nullable NSZone *)zone { +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { FIRFirestoreSettings *copy = [[FIRFirestoreSettings alloc] init]; copy.host = _host; copy.sslEnabled = _sslEnabled; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h index 694a7de0b..3cf08c024 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource+Internal.h @@ -16,12 +16,12 @@ #import "FIRFirestoreSource.h" -#include "Firestore/core/src/firebase/firestore/api/source.h" - namespace firebase { namespace firestore { namespace api { +enum class Source; + Source MakeSource(FIRFirestoreSource source); } // namespace api diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm index 9d3444a7a..c43b32dd9 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRFirestoreSource.mm @@ -16,8 +16,8 @@ #import "Firestore/Source/API/FIRFirestoreSource+Internal.h" -#include "Firestore/core/src/firebase/firestore/api/source.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/api/source.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm index e9ab684df..8a64d9623 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRGeoPoint.mm @@ -17,10 +17,10 @@ #import "Firestore/Source/API/FIRGeoPoint+Internal.h" #include "Firestore/core/include/firebase/firestore/geo_point.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/exception.h" -using firebase::firestore::api::ThrowInvalidArgument; +using firebase::firestore::util::ThrowInvalidArgument; using firebase::firestore::util::DoubleBitwiseEquals; using firebase::firestore::util::DoubleBitwiseHash; using firebase::firestore::util::WrapCompare; @@ -71,7 +71,7 @@ - (NSUInteger)hash { } /** Implements NSCopying without actually copying because geopoints are immutable. */ -- (id)copyWithZone:(NSZone *_Nullable)zone { +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { return self; } diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h index 9630da896..cd6436d4e 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRListenerRegistration+Internal.h @@ -18,7 +18,7 @@ #import "FIRListenerRegistration.h" -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" +#include "Firestore/core/src/api/listener_registration.h" namespace api = firebase::firestore::api; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.h index 24c24d212..05fe19cd1 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery+Internal.h @@ -18,8 +18,8 @@ #include -#include "Firestore/core/src/firebase/firestore/api/query_core.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" namespace api = firebase::firestore::api; namespace core = firebase::firestore::core; @@ -42,66 +42,6 @@ NS_ASSUME_NONNULL_BEGIN - (const api::Query &)apiQuery; -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must contain - * the specified field, the value must be an array, and that array must contain at least one value - * from the provided array. - * - * A query can have only one arrayContains filter and it cannot be combined with arrayContains or - * in. - * - * @param field The name of the field containing an array to search. - * @param value The value that contains the values to match. - * - * @return The created `FIRQuery`. - */ -// TODO(b/138855186): Expose to public once backend is ready. -- (FIRQuery *)queryWhereField:(NSString *)field arrayContainsAny:(id)value; - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must contain - * the specified field, the value must be an array, and that array must contain at least one value - * from the provided array. - * - * A query can have only one arrayContains filter and it cannot be combined with arrayContains or - * in. - * - * @param path The path of the field containing an array to search. - * @param value The value that contains the values to match. - * - * @return The created `FIRQuery`. - */ -// TODO(b/138855186): Expose to public once backend is ready. -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path arrayContainsAny:(id)value; - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must contain - * the specified field and the value must equal one of the values from the provided array. - * - * A query can have only one in filter, and it cannot be combined with arrayContainsAny. - * - * @param field The name of the field to search. - * @param value The value that contains the values to match. - * - * @return The created `FIRQuery`. - */ -// TODO(b/138855186): Expose to public once backend is ready. -- (FIRQuery *)queryWhereField:(NSString *)field in:(id)value; - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must contain - * the specified field and the value must equal one of the values from the provided array. - * - * A query can have only one in filter, and it cannot be combined with arrayContainsAny. - * - * @param path The path of the field to search. - * @param value The value that contains the values to match. - * - * @return The created `FIRQuery`. - */ -// TODO(b/138855186): Expose to public once backend is ready. -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path in:(id)value; - @end NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm index 24fcba61f..25f8cc3ee 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuery.mm @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,23 +34,26 @@ #import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/api/query_core.h" -#include "Firestore/core/src/firebase/firestore/api/query_listener_registration.h" -#include "Firestore/core/src/firebase/firestore/core/bound.h" -#include "Firestore/core/src/firebase/firestore/core/direction.h" -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" -#include "Firestore/core/src/firebase/firestore/core/order_by.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/api/query_core.h" +#include "Firestore/core/src/api/query_listener_registration.h" +#include "Firestore/core/src/api/query_snapshot.h" +#include "Firestore/core/src/api/source.h" +#include "Firestore/core/src/core/bound.h" +#include "Firestore/core/src/core/direction.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/core/firestore_client.h" +#include "Firestore/core/src/core/listen_options.h" +#include "Firestore/core/src/core/order_by.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_apple.h" #include "absl/memory/memory.h" namespace util = firebase::firestore::util; @@ -59,9 +62,9 @@ using firebase::firestore::api::Query; using firebase::firestore::api::QueryListenerRegistration; using firebase::firestore::api::QuerySnapshot; +using firebase::firestore::api::QuerySnapshotListener; using firebase::firestore::api::SnapshotMetadata; using firebase::firestore::api::Source; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::core::AsyncEventListener; using firebase::firestore::core::Bound; using firebase::firestore::core::Direction; @@ -79,20 +82,32 @@ using firebase::firestore::model::FieldValue; using firebase::firestore::model::ResourcePath; using firebase::firestore::util::MakeNSError; +using firebase::firestore::util::MakeString; using firebase::firestore::util::StatusOr; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN namespace { FieldPath MakeFieldPath(NSString *field) { - return FieldPath::FromDotSeparatedString(util::MakeString(field)); + return FieldPath::FromDotSeparatedString(MakeString(field)); } FIRQuery *Wrap(Query &&query) { return [[FIRQuery alloc] initWithQuery:std::move(query)]; } +int32_t SaturatedLimitValue(NSInteger limit) { + int32_t internal_limit; + if (limit == NSNotFound || limit >= core::Target::kNoLimit) { + internal_limit = core::Target::kNoLimit; + } else { + internal_limit = static_cast(limit); + } + return internal_limit; +} + } // namespace @implementation FIRQuery { @@ -200,6 +215,16 @@ - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isEqualTo:(id)value { return [self queryWithFilterOperator:Filter::Operator::Equal path:path.internalValue value:value]; } +- (FIRQuery *)queryWhereField:(NSString *)field isNotEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::NotEqual field:field value:value]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isNotEqualTo:(id)value { + return [self queryWithFilterOperator:Filter::Operator::NotEqual + path:path.internalValue + value:value]; +} + - (FIRQuery *)queryWhereField:(NSString *)field isLessThan:(id)value { return [self queryWithFilterOperator:Filter::Operator::LessThan field:field value:value]; } @@ -252,6 +277,34 @@ - (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path isGreaterThanOrEqualTo:(i value:value]; } +- (FIRQuery *)queryWhereField:(NSString *)field arrayContainsAny:(NSArray *)values { + return [self queryWithFilterOperator:Filter::Operator::ArrayContainsAny field:field value:values]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path arrayContainsAny:(NSArray *)values { + return [self queryWithFilterOperator:Filter::Operator::ArrayContainsAny + path:path.internalValue + value:values]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field in:(NSArray *)values { + return [self queryWithFilterOperator:Filter::Operator::In field:field value:values]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path in:(NSArray *)values { + return [self queryWithFilterOperator:Filter::Operator::In path:path.internalValue value:values]; +} + +- (FIRQuery *)queryWhereField:(NSString *)field notIn:(NSArray *)values { + return [self queryWithFilterOperator:Filter::Operator::NotIn field:field value:values]; +} + +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path notIn:(NSArray *)values { + return [self queryWithFilterOperator:Filter::Operator::NotIn + path:path.internalValue + value:values]; +} + - (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate { NSComparisonPredicate *comparison = (NSComparisonPredicate *)predicate; if (comparison.comparisonPredicateModifier != NSDirectPredicateModifier) { @@ -274,6 +327,8 @@ - (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate { return [self queryWhereField:path isGreaterThan:value]; case NSGreaterThanOrEqualToPredicateOperatorType: return [self queryWhereField:path isGreaterThanOrEqualTo:value]; + case NSNotEqualToPredicateOperatorType: + return [self queryWhereField:path isNotEqualTo:value]; default:; // Fallback below to throw assertion. } } else if ([comparison.leftExpression expressionType] == NSConstantValueExpressionType && @@ -291,6 +346,8 @@ - (FIRQuery *)queryFilteredUsingComparisonPredicate:(NSPredicate *)predicate { return [self queryWhereField:path isLessThan:value]; case NSGreaterThanOrEqualToPredicateOperatorType: return [self queryWhereField:path isLessThanOrEqualTo:value]; + case NSNotEqualToPredicateOperatorType: + return [self queryWhereField:path isNotEqualTo:value]; default:; // Fallback below to throw assertion. } } else { @@ -325,10 +382,9 @@ - (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate { return [self queryFilteredUsingComparisonPredicate:predicate]; } else if ([predicate isKindOfClass:[NSCompoundPredicate class]]) { return [self queryFilteredUsingCompoundPredicate:predicate]; - } else if ([predicate isKindOfClass:[[NSPredicate - predicateWithBlock:^BOOL(id obj, NSDictionary *bindings) { - return true; - }] class]]) { + } else if ([predicate isKindOfClass:[[NSPredicate predicateWithBlock:^BOOL(id, NSDictionary *) { + return true; + }] class]]) { ThrowInvalidArgument("Invalid query. Block-based predicates are not supported. Please use " "predicateWithFormat to create predicates instead."); } else { @@ -338,8 +394,7 @@ - (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate { } - (FIRQuery *)queryOrderedByField:(NSString *)field { - return [self queryOrderedByFieldPath:[FIRFieldPath pathWithDotSeparatedString:field] - descending:NO]; + return [self queryOrderedByField:field descending:NO]; } - (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)fieldPath { @@ -347,22 +402,25 @@ - (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)fieldPath { } - (FIRQuery *)queryOrderedByField:(NSString *)field descending:(BOOL)descending { - return [self queryOrderedByFieldPath:[FIRFieldPath pathWithDotSeparatedString:field] - descending:descending]; + return [self queryOrderedByFieldPath:MakeFieldPath(field) + direction:Direction::FromDescending(descending)]; } - (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)fieldPath descending:(BOOL)descending { - return Wrap(_query.OrderBy(fieldPath.internalValue, Direction::FromDescending(descending))); + return [self queryOrderedByFieldPath:fieldPath.internalValue + direction:Direction::FromDescending(descending)]; +} + +- (FIRQuery *)queryOrderedByFieldPath:(model::FieldPath)fieldPath direction:(Direction)direction { + return Wrap(_query.OrderBy(std::move(fieldPath), direction)); } - (FIRQuery *)queryLimitedTo:(NSInteger)limit { - int32_t internalLimit; - if (limit == NSNotFound || limit >= core::Query::kNoLimit) { - internalLimit = core::Query::kNoLimit; - } else { - internalLimit = static_cast(limit); - } - return Wrap(_query.Limit(internalLimit)); + return Wrap(_query.LimitToFirst(SaturatedLimitValue(limit))); +} + +- (FIRQuery *)queryLimitedToLast:(NSInteger)limit { + return Wrap(_query.LimitToLast(SaturatedLimitValue(limit))); } - (FIRQuery *)queryStartingAtDocument:(FIRDocumentSnapshot *)snapshot { @@ -411,7 +469,11 @@ - (FieldValue)parsedQueryValue:(id)value { return [self.firestore.dataConverter parsedQueryValue:value]; } -- (QuerySnapshot::Listener)wrapQuerySnapshotBlock:(FIRQuerySnapshotBlock)block { +- (FieldValue)parsedQueryValue:(id)value allowArrays:(bool)allowArrays { + return [self.firestore.dataConverter parsedQueryValue:value allowArrays:allowArrays]; +} + +- (QuerySnapshotListener)wrapQuerySnapshotBlock:(FIRQuerySnapshotBlock)block { class Converter : public EventListener { public: explicit Converter(FIRQuerySnapshotBlock block) : block_(block) { @@ -444,8 +506,10 @@ - (FIRQuery *)queryWithFilterOperator:(Filter::Operator)filterOperator - (FIRQuery *)queryWithFilterOperator:(Filter::Operator)filterOperator path:(const FieldPath &)fieldPath value:(id)value { - FieldValue fieldValue = [self parsedQueryValue:value]; - auto describer = [value] { return util::MakeString(NSStringFromClass([value class])); }; + FieldValue fieldValue = [self parsedQueryValue:value + allowArrays:filterOperator == Filter::Operator::In || + filterOperator == Filter::Operator::NotIn]; + auto describer = [value] { return MakeString(NSStringFromClass([value class])); }; return Wrap(_query.Filter(fieldPath, filterOperator, std::move(fieldValue), describer)); } @@ -546,24 +610,6 @@ - (Bound)boundFromFieldValues:(NSArray *)fieldValues isBefore:(BOOL)isBefore @implementation FIRQuery (Internal) -- (FIRQuery *)queryWhereField:(NSString *)field arrayContainsAny:(id)value { - return [self queryWithFilterOperator:Filter::Operator::ArrayContainsAny field:field value:value]; -} - -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path arrayContainsAny:(id)value { - return [self queryWithFilterOperator:Filter::Operator::ArrayContainsAny - path:path.internalValue - value:value]; -} - -- (FIRQuery *)queryWhereField:(NSString *)field in:(id)value { - return [self queryWithFilterOperator:Filter::Operator::In field:field value:value]; -} - -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path in:(id)value { - return [self queryWithFilterOperator:Filter::Operator::In path:path.internalValue value:value]; -} - - (const core::Query &)query { return _query.query(); } diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h index 622bf6833..104a679dc 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot+Internal.h @@ -18,10 +18,8 @@ #include -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/query_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" @class FIRFirestore; @class FIRSnapshotMetadata; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm index 0cdb45e91..f43c7b06d 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRQuerySnapshot.mm @@ -25,19 +25,21 @@ #import "Firestore/Source/API/FIRQuery+Internal.h" #import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/util/delayed_constructor.h" +#include "Firestore/core/src/api/query_core.h" +#include "Firestore/core/src/api/query_snapshot.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/util/delayed_constructor.h" +#include "Firestore/core/src/util/exception.h" using firebase::firestore::api::DocumentChange; using firebase::firestore::api::DocumentSnapshot; using firebase::firestore::api::Firestore; using firebase::firestore::api::QuerySnapshot; using firebase::firestore::api::SnapshotMetadata; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::core::ViewSnapshot; using firebase::firestore::util::DelayedConstructor; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h index 6c533bbbc..e38971d4c 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata+Internal.h @@ -18,7 +18,7 @@ #import -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" +#include "Firestore/core/src/api/snapshot_metadata.h" namespace api = firebase::firestore::api; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm index 92b7db141..5bfd3849e 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRSnapshotMetadata.mm @@ -20,7 +20,7 @@ #import "Firestore/Source/API/FIRSnapshotMetadata+Internal.h" -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" +#include "Firestore/core/src/api/snapshot_metadata.h" NS_ASSUME_NONNULL_BEGIN diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m b/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m index ca130b39b..195a5cf14 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRTimestamp.m @@ -115,7 +115,7 @@ - (NSString *)description { } /** Implements NSCopying without actually copying because timestamps are immutable. */ -- (id)copyWithZone:(NSZone *_Nullable)zone { +- (id)copyWithZone:(__unused NSZone *_Nullable)zone { return self; } diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h index 25d64edf9..93c794409 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction+Internal.h @@ -18,7 +18,7 @@ #include -#include "Firestore/core/src/firebase/firestore/core/transaction.h" +#include "Firestore/core/src/core/transaction.h" @class FIRFirestore; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm index 08917094e..a14518098 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRTransaction.mm @@ -26,13 +26,15 @@ #import "Firestore/Source/API/FIRTransaction+Internal.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::core::ParsedSetData; using firebase::firestore::core::ParsedUpdateData; using firebase::firestore::core::Transaction; @@ -40,6 +42,8 @@ using firebase::firestore::model::MaybeDocument; using firebase::firestore::util::MakeNSError; using firebase::firestore::util::Status; +using firebase::firestore::util::StatusOr; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -119,13 +123,14 @@ - (void)getDocument:(FIRDocumentReference *)document NSError *_Nullable error))completion { [self validateReference:document]; _internalTransaction->Lookup( - {document.key}, [self, document, completion](const std::vector &documents, - const Status &status) { - if (!status.ok()) { - completion(nil, MakeNSError(status)); + {document.key}, + [self, document, completion](const StatusOr> &maybe_documents) { + if (!maybe_documents.ok()) { + completion(nil, MakeNSError(maybe_documents.status())); return; } + const auto &documents = maybe_documents.ValueOrDie(); HARD_ASSERT(documents.size() == 1, "Mismatch in docs returned from document lookup."); const MaybeDocument &internalDoc = documents.front(); if (internalDoc.is_no_document()) { diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h b/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h index 3d708487d..ffd297e77 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch+Internal.h @@ -18,7 +18,7 @@ #import -#include "Firestore/core/src/firebase/firestore/api/write_batch.h" +#include "Firestore/core/src/api/write_batch.h" @class FSTUserDataConverter; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm index c92cbb891..5499bba9e 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FIRWriteBatch.mm @@ -19,9 +19,10 @@ #import "Firestore/Source/API/FIRDocumentReference+Internal.h" #import "Firestore/Source/API/FSTUserDataConverter.h" -#include "Firestore/core/src/firebase/firestore/api/write_batch.h" -#include "Firestore/core/src/firebase/firestore/util/delayed_constructor.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" +#include "Firestore/core/src/api/write_batch.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/util/delayed_constructor.h" +#include "Firestore/core/src/util/error_apple.h" namespace util = firebase::firestore::util; using firebase::firestore::core::ParsedSetData; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm index 8ce2b1285..6f7ff8c54 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FSTFirestoreComponent.mm @@ -16,36 +16,32 @@ #import "Firestore/Source/API/FSTFirestoreComponent.h" -#import -#import -#import -#import -#import -#import -#import - #include #include #include +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" #import "Firestore/Source/API/FIRFirestore+Internal.h" +#import "Interop/Auth/Public/FIRAuthInterop.h" + #include "Firestore/core/include/firebase/firestore/firestore_version.h" -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/executor_libdispatch.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/auth/firebase_credentials_provider_apple.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/memory/memory.h" namespace util = firebase::firestore::util; using firebase::firestore::api::Firestore; -using firebase::firestore::api::ThrowInvalidArgument; using firebase::firestore::auth::CredentialsProvider; using firebase::firestore::auth::FirebaseCredentialsProvider; -using util::AsyncQueue; -using util::ExecutorLibdispatch; +using firebase::firestore::util::AsyncQueue; +using firebase::firestore::util::Executor; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -97,9 +93,8 @@ - (FIRFirestore *)firestoreForDatabase:(NSString *)database { absl::StrAppend(&queue_name, ".", util::MakeString(self.app.name)); } - auto executor = absl::make_unique( - dispatch_queue_create(queue_name.c_str(), DISPATCH_QUEUE_SERIAL)); - auto workerQueue = absl::make_unique(std::move(executor)); + auto executor = Executor::CreateSerial(queue_name.c_str()); + auto workerQueue = AsyncQueue::Create(std::move(executor)); id auth = FIR_COMPONENT(FIRAuthInterop, self.app.container); auto credentialsProvider = std::make_shared(self.app, auth); @@ -127,7 +122,7 @@ - (void)removeInstanceWithDatabase:(NSString *)database { #pragma mark - FIRComponentLifecycleMaintainer -- (void)appWillBeDeleted:(FIRApp *)app { +- (void)appWillBeDeleted:(__unused FIRApp *)app { NSDictionary *instances; @synchronized(_instances) { instances = [_instances copy]; diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.h b/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.h index c95aba810..7c4ed0119 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.h +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.h @@ -18,14 +18,9 @@ #include -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/core/user_data.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/model_fwd.h" @class FIRTimestamp; @@ -82,6 +77,14 @@ typedef id _Nullable (^FSTPreConverterBlock)(id _Nullable); /** Parse a "query value" (e.g. value in a where filter or a value in a cursor bound). */ - (model::FieldValue)parsedQueryValue:(id)input; +/** + * Parse a "query value" (e.g. value in a where filter or a value in a cursor bound). + * + * @param allowArrays Whether the query value is an array that may directly contain additional + * arrays (e.g.) the operand of an `in` query). + */ +- (model::FieldValue)parsedQueryValue:(id)input allowArrays:(bool)allowArrays; + @end NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.mm b/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.mm index 6fd18be17..7aef3a04f 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.mm +++ b/Pods/FirebaseFirestore/Firestore/Source/API/FSTUserDataConverter.mm @@ -32,20 +32,20 @@ #import "Firestore/Source/API/FIRGeoPoint+Internal.h" #import "Firestore/Source/API/converters.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/core/user_data.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/timestamp_internal.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_transform.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/model/transform_operation.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/timestamp_internal.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_apple.h" #include "absl/memory/memory.h" #include "absl/strings/match.h" #include "absl/types/optional.h" @@ -54,11 +54,10 @@ using firebase::Timestamp; using firebase::TimestampInternal; using firebase::firestore::GeoPoint; -using firebase::firestore::api::ThrowInvalidArgument; -using firebase::firestore::core::ParsedSetData; -using firebase::firestore::core::ParsedUpdateData; using firebase::firestore::core::ParseAccumulator; using firebase::firestore::core::ParseContext; +using firebase::firestore::core::ParsedSetData; +using firebase::firestore::core::ParsedUpdateData; using firebase::firestore::core::UserDataSource; using firebase::firestore::model::ArrayTransform; using firebase::firestore::model::DatabaseId; @@ -73,6 +72,7 @@ using firebase::firestore::model::ServerTimestampTransform; using firebase::firestore::model::TransformOperation; using firebase::firestore::nanopb::MakeByteString; +using firebase::firestore::util::ThrowInvalidArgument; NS_ASSUME_NONNULL_BEGIN @@ -196,11 +196,11 @@ - (ParsedUpdateData)parsedUpdateData:(id)input { __block ParseContext context = accumulator.RootContext(); __block ObjectValue updateData = ObjectValue::Empty(); - [dict enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL *stop) { + [dict enumerateKeysAndObjectsUsingBlock:^(id key, id value, BOOL *) { FieldPath path; if ([key isKindOfClass:[NSString class]]) { - path = [FIRFieldPath pathWithDotSeparatedString:key].internalValue; + path = FieldPath::FromDotSeparatedString(util::MakeString(key)); } else if ([key isKindOfClass:[FIRFieldPath class]]) { path = ((FIRFieldPath *)key).internalValue; } else { @@ -225,7 +225,12 @@ - (ParsedUpdateData)parsedUpdateData:(id)input { } - (FieldValue)parsedQueryValue:(id)input { - ParseAccumulator accumulator{UserDataSource::Argument}; + return [self parsedQueryValue:input allowArrays:false]; +} + +- (FieldValue)parsedQueryValue:(id)input allowArrays:(bool)allowArrays { + ParseAccumulator accumulator{allowArrays ? UserDataSource::ArrayArgument + : UserDataSource::Argument}; absl::optional parsed = [self parseData:input context:accumulator.RootContext()]; HARD_ASSERT(parsed, "Parsed data should not be nil."); @@ -266,7 +271,10 @@ - (FieldValue)parsedQueryValue:(id)input { if ([input isKindOfClass:[NSArray class]]) { // TODO(b/34871131): Include the path containing the array in the error message. - if (context.array_element()) { + // In the case of IN queries, the parsed data is an array (representing the set of values to + // be included for the IN query) that may directly contain additional arrays (each + // representing an individual field value), so we disable this validation. + if (context.array_element() && context.data_source() != UserDataSource::ArrayArgument) { ThrowInvalidArgument("Nested arrays are not supported"); } return [self parseArray:(NSArray *)input context:std::move(context)]; @@ -287,7 +295,7 @@ - (FieldValue)parseDictionary:(NSDictionary *)dict } else { __block ObjectValue result = ObjectValue::Empty(); - [dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *stop) { + [dict enumerateKeysAndObjectsUsingBlock:^(NSString *key, id value, BOOL *) { absl::optional parsedValue = [self parseData:value context:context.ChildContext(util::MakeString(key))]; if (parsedValue) { @@ -304,7 +312,7 @@ - (FieldValue)parseArray:(NSArray *)array context:(ParseContext &&)context { __block FieldValue::Array result; result.reserve(array.count); - [array enumerateObjectsUsingBlock:^(id entry, NSUInteger idx, BOOL *stop) { + [array enumerateObjectsUsingBlock:^(id entry, NSUInteger idx, BOOL *) { absl::optional parsedEntry = [self parseData:entry context:context.ChildContext(idx)]; if (!parsedEntry) { diff --git a/Pods/FirebaseFirestore/Firestore/Source/Core/FSTTypes.h b/Pods/FirebaseFirestore/Firestore/Source/Core/FSTTypes.h deleted file mode 100644 index e68a509e2..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Core/FSTTypes.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -/** - * FSTVoidErrorBlock is a block that gets an error, if one occurred. - * - * @param error The error if it occurred, or nil. - */ -typedef void (^FSTVoidErrorBlock)(NSError *_Nullable error); - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/Local/FSTLocalSerializer.h b/Pods/FirebaseFirestore/Firestore/Source/Local/FSTLocalSerializer.h deleted file mode 100644 index 4cb997f1e..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Local/FSTLocalSerializer.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" - -@class FSTSerializerBeta; - -@class FSTPBMaybeDocument; -@class FSTPBTarget; -@class FSTPBWriteBatch; - -@class GPBTimestamp; - -namespace local = firebase::firestore::local; -namespace model = firebase::firestore::model; - -NS_ASSUME_NONNULL_BEGIN - -/** - * Serializer for values stored in the LocalStore. - * - * Note that FSTLocalSerializer currently delegates to the serializer for the Firestore v1 RPC - * protocol to save implementation time and code duplication. We'll need to revisit this when the - * RPC protocol we use diverges from local storage. - */ -@interface FSTLocalSerializer : NSObject - -- (instancetype)initWithRemoteSerializer:(FSTSerializerBeta *)remoteSerializer; - -- (instancetype)init NS_UNAVAILABLE; - -/** Encodes a MaybeDocument model to the equivalent protocol buffer for local storage. */ -- (FSTPBMaybeDocument *)encodedMaybeDocument:(const model::MaybeDocument &)document; - -/** Decodes an FSTPBMaybeDocument proto to the equivalent model. */ -- (model::MaybeDocument)decodedMaybeDocument:(FSTPBMaybeDocument *)proto; - -/** Encodes an MutationBatch model for local storage in the mutation queue. */ -- (FSTPBWriteBatch *)encodedMutationBatch:(const model::MutationBatch &)batch; - -/** Decodes an FSTPBWriteBatch proto into a MutationBatch model. */ -- (model::MutationBatch)decodedMutationBatch:(FSTPBWriteBatch *)batch; - -/** Encodes a QueryData model for local storage in the query cache. */ -- (FSTPBTarget *)encodedQueryData:(const local::QueryData &)queryData; - -/** Decodes an FSTPBTarget proto from local storage into a QueryData model. */ -- (local::QueryData)decodedQueryData:(FSTPBTarget *)target; - -/** Encodes a SnapshotVersion model into a GPBTimestamp proto. */ -- (GPBTimestamp *)encodedVersion:(const model::SnapshotVersion &)version; - -/** Decodes a GPBTimestamp proto into a SnapshotVersion model. */ -- (model::SnapshotVersion)decodedVersion:(GPBTimestamp *)version; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/Local/FSTLocalSerializer.mm b/Pods/FirebaseFirestore/Firestore/Source/Local/FSTLocalSerializer.mm deleted file mode 100644 index 53b3a8223..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Local/FSTLocalSerializer.mm +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "Firestore/Source/Local/FSTLocalSerializer.h" - -#include -#include -#include - -#import "FIRTimestamp.h" -#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" -#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" -#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" -#import "Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.h" -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -using firebase::Timestamp; -using firebase::firestore::core::Query; -using firebase::firestore::local::QueryData; -using firebase::firestore::local::QueryPurpose; -using firebase::firestore::model::Document; -using firebase::firestore::model::DocumentKey; -using firebase::firestore::model::DocumentState; -using firebase::firestore::model::ListenSequenceNumber; -using firebase::firestore::model::MaybeDocument; -using firebase::firestore::model::Mutation; -using firebase::firestore::model::MutationBatch; -using firebase::firestore::model::NoDocument; -using firebase::firestore::model::ObjectValue; -using firebase::firestore::model::SnapshotVersion; -using firebase::firestore::model::TargetId; -using firebase::firestore::model::UnknownDocument; -using firebase::firestore::nanopb::ByteString; -using firebase::firestore::nanopb::MakeByteString; -using firebase::firestore::nanopb::MakeNSData; - -@interface FSTLocalSerializer () - -@property(nonatomic, strong, readonly) FSTSerializerBeta *remoteSerializer; - -@end - -/** Serializer for values stored in the LocalStore. */ -@implementation FSTLocalSerializer - -- (instancetype)initWithRemoteSerializer:(FSTSerializerBeta *)remoteSerializer { - self = [super init]; - if (self) { - _remoteSerializer = remoteSerializer; - } - return self; -} - -- (FSTPBMaybeDocument *)encodedMaybeDocument:(const MaybeDocument &)document { - FSTPBMaybeDocument *proto = [FSTPBMaybeDocument message]; - - if (document.is_no_document()) { - NoDocument deletedDocument(document); - proto.noDocument = [self encodedDeletedDocument:deletedDocument]; - proto.hasCommittedMutations = deletedDocument.has_committed_mutations(); - } else if (document.is_document()) { - Document existingDocument(document); - const absl::any &docProto = existingDocument.proto(); - if (docProto.has_value()) { - proto.document = absl::any_cast(docProto); - } else { - proto.document = [self encodedDocument:existingDocument]; - } - proto.hasCommittedMutations = existingDocument.has_committed_mutations(); - } else if (document.is_unknown_document()) { - UnknownDocument unknownDocument(document); - proto.unknownDocument = [self encodedUnknownDocument:unknownDocument]; - proto.hasCommittedMutations = YES; - } else { - HARD_FAIL("Unknown document type %s", document.type()); - } - - return proto; -} - -- (MaybeDocument)decodedMaybeDocument:(FSTPBMaybeDocument *)proto { - switch (proto.documentTypeOneOfCase) { - case FSTPBMaybeDocument_DocumentType_OneOfCase_Document: - return [self decodedDocument:proto.document - withCommittedMutations:proto.hasCommittedMutations]; - - case FSTPBMaybeDocument_DocumentType_OneOfCase_NoDocument: - return [self decodedDeletedDocument:proto.noDocument - withCommittedMutations:proto.hasCommittedMutations]; - - case FSTPBMaybeDocument_DocumentType_OneOfCase_UnknownDocument: - return [self decodedUnknownDocument:proto.unknownDocument]; - - default: - HARD_FAIL("Unknown MaybeDocument %s", proto); - } -} - -/** - * Encodes a Document for local storage. This differs from the v1 RPC serializer for Documents in - * that it preserves the updateTime, which is considered an output only value by the server. - */ -- (GCFSDocument *)encodedDocument:(const Document &)document { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - GCFSDocument *proto = [GCFSDocument message]; - proto.name = [remoteSerializer encodedDocumentKey:document.key()]; - proto.fields = [remoteSerializer encodedFields:document.data()]; - proto.updateTime = [remoteSerializer encodedVersion:document.version()]; - - return proto; -} - -/** Decodes a Document proto to the equivalent model. */ -- (Document)decodedDocument:(GCFSDocument *)document - withCommittedMutations:(BOOL)committedMutations { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - ObjectValue data = [remoteSerializer decodedFields:document.fields]; - DocumentKey key = [remoteSerializer decodedDocumentKey:document.name]; - SnapshotVersion version = [remoteSerializer decodedVersion:document.updateTime]; - DocumentState state = - committedMutations ? DocumentState::kCommittedMutations : DocumentState::kSynced; - return Document(std::move(data), std::move(key), version, state); -} - -/** Encodes a NoDocument value to the equivalent proto. */ -- (FSTPBNoDocument *)encodedDeletedDocument:(const NoDocument &)document { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - FSTPBNoDocument *proto = [FSTPBNoDocument message]; - proto.name = [remoteSerializer encodedDocumentKey:document.key()]; - proto.readTime = [remoteSerializer encodedVersion:document.version()]; - return proto; -} - -/** Decodes a NoDocument proto to the equivalent model. */ -- (NoDocument)decodedDeletedDocument:(FSTPBNoDocument *)proto - withCommittedMutations:(BOOL)committedMutations { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - DocumentKey key = [remoteSerializer decodedDocumentKey:proto.name]; - SnapshotVersion version = [remoteSerializer decodedVersion:proto.readTime]; - return NoDocument(std::move(key), version, committedMutations); -} - -/** Encodes an UnknownDocument value to the equivalent proto. */ -- (FSTPBUnknownDocument *)encodedUnknownDocument:(const UnknownDocument &)document { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - FSTPBUnknownDocument *proto = [FSTPBUnknownDocument message]; - proto.name = [remoteSerializer encodedDocumentKey:document.key()]; - proto.version = [remoteSerializer encodedVersion:document.version()]; - return proto; -} - -/** Decodes an UnknownDocument proto to the equivalent model. */ -- (UnknownDocument)decodedUnknownDocument:(FSTPBUnknownDocument *)proto { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - DocumentKey key = [remoteSerializer decodedDocumentKey:proto.name]; - SnapshotVersion version = [remoteSerializer decodedVersion:proto.version]; - return UnknownDocument(std::move(key), version); -} - -- (FSTPBWriteBatch *)encodedMutationBatch:(const MutationBatch &)batch { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - FSTPBWriteBatch *proto = [FSTPBWriteBatch message]; - proto.batchId = batch.batch_id(); - proto.localWriteTime = [remoteSerializer encodedTimestamp:batch.local_write_time()]; - - NSMutableArray *baseWrites = proto.baseWritesArray; - for (const Mutation &baseMutation : batch.base_mutations()) { - [baseWrites addObject:[remoteSerializer encodedMutation:baseMutation]]; - } - NSMutableArray *writes = proto.writesArray; - for (const Mutation &mutation : batch.mutations()) { - [writes addObject:[remoteSerializer encodedMutation:mutation]]; - } - return proto; -} - -- (MutationBatch)decodedMutationBatch:(FSTPBWriteBatch *)batch { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - int batchID = batch.batchId; - - std::vector baseMutations; - for (GCFSWrite *write in batch.baseWritesArray) { - baseMutations.push_back([remoteSerializer decodedMutation:write]); - } - std::vector mutations; - for (GCFSWrite *write in batch.writesArray) { - mutations.push_back([remoteSerializer decodedMutation:write]); - } - - Timestamp localWriteTime = [remoteSerializer decodedTimestamp:batch.localWriteTime]; - - return MutationBatch(batchID, localWriteTime, std::move(baseMutations), std::move(mutations)); -} - -- (FSTPBTarget *)encodedQueryData:(const QueryData &)queryData { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - HARD_ASSERT(queryData.purpose() == QueryPurpose::Listen, - "only queries with purpose %s may be stored, got %s", QueryPurpose::Listen, - queryData.purpose()); - - FSTPBTarget *proto = [FSTPBTarget message]; - proto.targetId = queryData.target_id(); - proto.lastListenSequenceNumber = queryData.sequence_number(); - proto.snapshotVersion = [remoteSerializer encodedVersion:queryData.snapshot_version()]; - proto.resumeToken = MakeNullableNSData(queryData.resume_token()); - - const Query &query = queryData.query(); - if (query.IsDocumentQuery()) { - proto.documents = [remoteSerializer encodedDocumentsTarget:query]; - } else { - proto.query = [remoteSerializer encodedQueryTarget:query]; - } - - return proto; -} - -- (QueryData)decodedQueryData:(FSTPBTarget *)target { - FSTSerializerBeta *remoteSerializer = self.remoteSerializer; - - TargetId targetID = target.targetId; - ListenSequenceNumber sequenceNumber = target.lastListenSequenceNumber; - SnapshotVersion version = [remoteSerializer decodedVersion:target.snapshotVersion]; - ByteString resumeToken = MakeByteString(target.resumeToken); - - Query query; - switch (target.targetTypeOneOfCase) { - case FSTPBTarget_TargetType_OneOfCase_Documents: - query = [remoteSerializer decodedQueryFromDocumentsTarget:target.documents]; - break; - - case FSTPBTarget_TargetType_OneOfCase_Query: - query = [remoteSerializer decodedQueryFromQueryTarget:target.query]; - break; - - default: - HARD_FAIL("Unknown Target.targetType %s", target.targetTypeOneOfCase); - } - - return QueryData(std::move(query), targetID, sequenceNumber, QueryPurpose::Listen, version, - std::move(resumeToken)); -} - -- (GPBTimestamp *)encodedVersion:(const SnapshotVersion &)version { - return [self.remoteSerializer encodedVersion:version]; -} - -- (SnapshotVersion)decodedVersion:(GPBTimestamp *)version { - return [self.remoteSerializer decodedVersion:version]; -} - -@end diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRQuery.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FIRQuery.h deleted file mode 100644 index 4233f1032..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRQuery.h +++ /dev/null @@ -1,442 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#import "FIRFirestoreSource.h" -#import "FIRListenerRegistration.h" - -@class FIRFieldPath; -@class FIRFirestore; -@class FIRQuerySnapshot; -@class FIRDocumentSnapshot; - -NS_ASSUME_NONNULL_BEGIN - -/** - * A block type used to handle failable snapshot method callbacks. - */ -typedef void (^FIRQuerySnapshotBlock)(FIRQuerySnapshot *_Nullable snapshot, - NSError *_Nullable error); - -/** - * A `FIRQuery` refers to a Query which you can read or listen to. You can also construct - * refined `FIRQuery` objects by adding filters and ordering. - */ -NS_SWIFT_NAME(Query) -@interface FIRQuery : NSObject -/** :nodoc: */ -- (id)init __attribute__((unavailable("FIRQuery cannot be created directly."))); - -/** The `FIRFirestore` for the Firestore database (useful for performing transactions, etc.). */ -@property(nonatomic, strong, readonly) FIRFirestore *firestore; - -#pragma mark - Retrieving Data -/** - * Reads the documents matching this query. - * - * This method attempts to provide up-to-date data when possible by waiting for - * data from the server, but it may return cached data or fail if you are - * offline and the server cannot be reached. See the - * `getDocuments(source:completion:)` method to change this behavior. - * - * @param completion a block to execute once the documents have been successfully read. - * documentSet will be `nil` only if error is `non-nil`. - */ -- (void)getDocumentsWithCompletion:(FIRQuerySnapshotBlock)completion - NS_SWIFT_NAME(getDocuments(completion:)); - -/** - * Reads the documents matching this query. - * - * @param source indicates whether the results should be fetched from the cache - * only (`Source.cache`), the server only (`Source.server`), or to attempt - * the server and fall back to the cache (`Source.default`). - * @param completion a block to execute once the documents have been successfully read. - * documentSet will be `nil` only if error is `non-nil`. - */ -// clang-format off -- (void)getDocumentsWithSource:(FIRFirestoreSource)source - completion:(FIRQuerySnapshotBlock)completion - NS_SWIFT_NAME(getDocuments(source:completion:)); -// clang-format on - -/** - * Attaches a listener for QuerySnapshot events. - * - * @param listener The listener to attach. - * - * @return A FIRListenerRegistration that can be used to remove this listener. - */ -- (id)addSnapshotListener:(FIRQuerySnapshotBlock)listener - NS_SWIFT_NAME(addSnapshotListener(_:)); - -/** - * Attaches a listener for QuerySnapshot events. - * - * @param includeMetadataChanges Whether metadata-only changes (i.e. only - * `FIRDocumentSnapshot.metadata` changed) should trigger snapshot events. - * @param listener The listener to attach. - * - * @return A FIRListenerRegistration that can be used to remove this listener. - */ -// clang-format off -- (id) -addSnapshotListenerWithIncludeMetadataChanges:(BOOL)includeMetadataChanges - listener:(FIRQuerySnapshotBlock)listener - NS_SWIFT_NAME(addSnapshotListener(includeMetadataChanges:listener:)); -// clang-format on - -#pragma mark - Filtering Data -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be equal to the specified value. - * - * @param field The name of the field to compare. - * @param value The value the field must be equal to. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereField:(NSString *)field - isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be equal to the specified value. - * - * @param path The path of the field to compare. - * @param value The value the field must be equal to. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be less than the specified value. - * - * @param field The name of the field to compare. - * @param value The value the field must be less than. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereField:(NSString *)field - isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be less than the specified value. - * - * @param path The path of the field to compare. - * @param value The value the field must be less than. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be less than or equal to the specified value. - * - * @param field The name of the field to compare - * @param value The value the field must be less than or equal to. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereField:(NSString *)field - isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be less than or equal to the specified value. - * - * @param path The path of the field to compare - * @param value The value the field must be less than or equal to. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must greater than the specified value. - * - * @param field The name of the field to compare - * @param value The value the field must be greater than. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereField:(NSString *)field - isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must greater than the specified value. - * - * @param path The path of the field to compare - * @param value The value the field must be greater than. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be greater than or equal to the specified value. - * - * @param field The name of the field to compare - * @param value The value the field must be greater than. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereField:(NSString *)field - isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * contain the specified field and the value must be greater than or equal to the specified value. - * - * @param path The path of the field to compare - * @param value The value the field must be greater than. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must contain - * the specified field, it must be an array, and the array must contain the provided value. - * - * A query can have only one arrayContains filter. - * - * @param field The name of the field containing an array to search - * @param value The value that must be contained in the array - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereField:(NSString *)field - arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must contain - * the specified field, it must be an array, and the array must contain the provided value. - * - * A query can have only one arrayContains filter. - * - * @param path The path of the field containing an array to search - * @param value The value that must be contained in the array - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path - arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` with the additional filter that documents must - * satisfy the specified predicate. - * - * @param predicate The predicate the document must satisfy. Can be either comparison - * or compound of comparison. In particular, block-based predicate is not supported. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate NS_SWIFT_NAME(filter(using:)); -// clang-format on - -#pragma mark - Sorting Data -/** - * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. - * - * @param field The field to sort by. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryOrderedByField:(NSString *)field NS_SWIFT_NAME(order(by:)); - -/** - * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. - * - * @param path The field to sort by. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path NS_SWIFT_NAME(order(by:)); - -/** - * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field, - * optionally in descending order instead of ascending. - * - * @param field The field to sort by. - * @param descending Whether to sort descending. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryOrderedByField:(NSString *)field - descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); -// clang-format on - -/** - * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field, - * optionally in descending order instead of ascending. - * - * @param path The field to sort by. - * @param descending Whether to sort descending. - * - * @return The created `FIRQuery`. - */ -// clang-format off -- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path - descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); -// clang-format on - -#pragma mark - Limiting Data -/** - * Creates and returns a new `FIRQuery` that's additionally limited to only return up to - * the specified number of documents. - * - * @param limit The maximum number of items to return. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryLimitedTo:(NSInteger)limit NS_SWIFT_NAME(limit(to:)); - -#pragma mark - Choosing Endpoints -/** - * Creates and returns a new `FIRQuery` that starts at the provided document (inclusive). The - * starting position is relative to the order of the query. The document must contain all of the - * fields provided in the orderBy of this query. - * - * @param document The snapshot of the document to start at. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryStartingAtDocument:(FIRDocumentSnapshot *)document - NS_SWIFT_NAME(start(atDocument:)); - -/** - * Creates and returns a new `FIRQuery` that starts at the provided fields relative to the order of - * the query. The order of the field values must match the order of the order by clauses of the - * query. - * - * @param fieldValues The field values to start this query at, in order of the query's order by. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(at:)); - -/** - * Creates and returns a new `FIRQuery` that starts after the provided document (exclusive). The - * starting position is relative to the order of the query. The document must contain all of the - * fields provided in the orderBy of this query. - * - * @param document The snapshot of the document to start after. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryStartingAfterDocument:(FIRDocumentSnapshot *)document - NS_SWIFT_NAME(start(afterDocument:)); - -/** - * Creates and returns a new `FIRQuery` that starts after the provided fields relative to the order - * of the query. The order of the field values must match the order of the order by clauses of the - * query. - * - * @param fieldValues The field values to start this query after, in order of the query's order - * by. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(after:)); - -/** - * Creates and returns a new `FIRQuery` that ends before the provided document (exclusive). The end - * position is relative to the order of the query. The document must contain all of the fields - * provided in the orderBy of this query. - * - * @param document The snapshot of the document to end before. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryEndingBeforeDocument:(FIRDocumentSnapshot *)document - NS_SWIFT_NAME(end(beforeDocument:)); - -/** - * Creates and returns a new `FIRQuery` that ends before the provided fields relative to the order - * of the query. The order of the field values must match the order of the order by clauses of the - * query. - * - * @param fieldValues The field values to end this query before, in order of the query's order by. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(before:)); - -/** - * Creates and returns a new `FIRQuery` that ends at the provided document (exclusive). The end - * position is relative to the order of the query. The document must contain all of the fields - * provided in the orderBy of this query. - * - * @param document The snapshot of the document to end at. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document NS_SWIFT_NAME(end(atDocument:)); - -/** - * Creates and returns a new `FIRQuery` that ends at the provided fields relative to the order of - * the query. The order of the field values must match the order of the order by clauses of the - * query. - * - * @param fieldValues The field values to end this query at, in order of the query's order by. - * - * @return The created `FIRQuery`. - */ -- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(at:)); - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRCollectionReference.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRCollectionReference.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRCollectionReference.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRCollectionReference.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentChange.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h similarity index 98% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentChange.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h index 8898c6257..1acff350f 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentChange.h +++ b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentChange.h @@ -20,10 +20,11 @@ NS_ASSUME_NONNULL_BEGIN @class FIRQueryDocumentSnapshot; -/** An enumeration of document change types. */ #if defined(NS_CLOSED_ENUM) +/** An enumeration of document change types. */ typedef NS_CLOSED_ENUM(NSInteger, FIRDocumentChangeType) #else +/** An enumeration of document change types. */ typedef NS_ENUM(NSInteger, FIRDocumentChangeType) #endif { diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentReference.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentReference.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentReference.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentReference.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentSnapshot.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentSnapshot.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRDocumentSnapshot.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRDocumentSnapshot.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFieldPath.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldPath.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRFieldPath.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldPath.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFieldValue.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldValue.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRFieldValue.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFieldValue.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestore.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestore.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h index e232d4eea..512aaa4fa 100644 --- a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestore.h +++ b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestore.h @@ -211,21 +211,17 @@ NS_SWIFT_NAME(Firestore) - (void)waitForPendingWritesWithCompletion:(void (^)(NSError *_Nullable error))completion; /** - * Attaches a listener for a snapshots-in-sync event. Server-generated - * updates and local changes can affect multiple snapshot listeners. - * The snapshots-in-sync event indicates that all listeners affected by - * a given change have fired. + * Attaches a listener for a snapshots-in-sync event. The snapshots-in-sync event indicates that all + * listeners affected by a given change have fired, even if a single server-generated change affects + * multiple listeners. * - * NOTE: The snapshots-in-sync event only indicates that listeners are - * in sync with each other, but does not relate to whether those - * snapshots are in sync with the server. Use SnapshotMetadata in the - * individual listeners to determine if a snapshot is from the cache or - * the server. + * NOTE: The snapshots-in-sync event only indicates that listeners are in sync with each other, but + * does not relate to whether those snapshots are in sync with the server. Use SnapshotMetadata in + * the individual listeners to determine if a snapshot is from the cache or the server. * - * @param listener A callback to be called every time all snapshot - * listeners are in sync with each other. - * @return A FIRListenerRegistration object that can be used to remove the - * listener. + * @param listener A callback to be called every time all snapshot listeners are in sync with each + * other. + * @return A FIRListenerRegistration object that can be used to remove the listener. */ - (id)addSnapshotsInSyncListener:(void (^)(void))listener NS_SWIFT_NAME(addSnapshotsInSyncListener(_:)); @@ -235,20 +231,19 @@ NS_SWIFT_NAME(Firestore) /** * Terminates this `FIRFirestore` instance. * - * After calling `terminate` only the `clearPersistence` method may be used. Any other method - * will throw an error. + * After calling `terminate` only the `clearPersistence` method may be used. Any other method will + * throw an error. * - * To restart after termination, simply create a new instance of FIRFirestore with - * `firestore` or `firestoreForApp` methods. + * To restart after termination, simply create a new instance of FIRFirestore with `firestore` or + * `firestoreForApp` methods. * * Termination does not cancel any pending writes and any tasks that are awaiting a response from - * the server will not be resolved. The next time you start this instance, it will resume - * attempting to send these writes to the server. + * the server will not be resolved. The next time you start this instance, it will resume attempting + * to send these writes to the server. * - * Note: Under normal circumstances, calling this method is not required. This - * method is useful only when you want to force this instance to release all of its resources or - * in combination with `clearPersistence` to ensure that all local state is destroyed - * between test runs. + * Note: Under normal circumstances, calling this method is not required. This method is useful only + * when you want to force this instance to release all of its resources or in combination with + * `clearPersistence` to ensure that all local state is destroyed between test runs. * * @param completion A block to execute once everything has been terminated. */ diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreErrors.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreErrors.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreErrors.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreErrors.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSettings.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSettings.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSettings.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSettings.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSource.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSource.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRFirestoreSource.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRFirestoreSource.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRGeoPoint.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRGeoPoint.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRGeoPoint.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRGeoPoint.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRListenerRegistration.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRListenerRegistration.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRListenerRegistration.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRListenerRegistration.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuery.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuery.h new file mode 100644 index 000000000..866b30714 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuery.h @@ -0,0 +1,543 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#import + +#import "FIRFirestoreSource.h" +#import "FIRListenerRegistration.h" + +@class FIRFieldPath; +@class FIRFirestore; +@class FIRQuerySnapshot; +@class FIRDocumentSnapshot; + +NS_ASSUME_NONNULL_BEGIN + +/** + * A block type used to handle failable snapshot method callbacks. + */ +typedef void (^FIRQuerySnapshotBlock)(FIRQuerySnapshot *_Nullable snapshot, + NSError *_Nullable error); + +/** + * A `FIRQuery` refers to a Query which you can read or listen to. You can also construct + * refined `FIRQuery` objects by adding filters and ordering. + */ +NS_SWIFT_NAME(Query) +@interface FIRQuery : NSObject +/** :nodoc: */ +- (id)init __attribute__((unavailable("FIRQuery cannot be created directly."))); + +/** The `FIRFirestore` for the Firestore database (useful for performing transactions, etc.). */ +@property(nonatomic, strong, readonly) FIRFirestore *firestore; + +#pragma mark - Retrieving Data +/** + * Reads the documents matching this query. + * + * This method attempts to provide up-to-date data when possible by waiting for + * data from the server, but it may return cached data or fail if you are + * offline and the server cannot be reached. See the + * `getDocuments(source:completion:)` method to change this behavior. + * + * @param completion a block to execute once the documents have been successfully read. + * documentSet will be `nil` only if error is `non-nil`. + */ +- (void)getDocumentsWithCompletion:(FIRQuerySnapshotBlock)completion + NS_SWIFT_NAME(getDocuments(completion:)); + +/** + * Reads the documents matching this query. + * + * @param source indicates whether the results should be fetched from the cache + * only (`Source.cache`), the server only (`Source.server`), or to attempt + * the server and fall back to the cache (`Source.default`). + * @param completion a block to execute once the documents have been successfully read. + * documentSet will be `nil` only if error is `non-nil`. + */ +- (void)getDocumentsWithSource:(FIRFirestoreSource)source + completion:(FIRQuerySnapshotBlock)completion + NS_SWIFT_NAME(getDocuments(source:completion:)); + +/** + * Attaches a listener for QuerySnapshot events. + * + * @param listener The listener to attach. + * + * @return A FIRListenerRegistration that can be used to remove this listener. + */ +- (id)addSnapshotListener:(FIRQuerySnapshotBlock)listener + NS_SWIFT_NAME(addSnapshotListener(_:)); + +/** + * Attaches a listener for QuerySnapshot events. + * + * @param includeMetadataChanges Whether metadata-only changes (i.e. only + * `FIRDocumentSnapshot.metadata` changed) should trigger snapshot events. + * @param listener The listener to attach. + * + * @return A FIRListenerRegistration that can be used to remove this listener. + */ +- (id) + addSnapshotListenerWithIncludeMetadataChanges:(BOOL)includeMetadataChanges + listener:(FIRQuerySnapshotBlock)listener + NS_SWIFT_NAME(addSnapshotListener(includeMetadataChanges:listener:)); + +#pragma mark - Filtering Data +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be equal to the specified value. + * + * @param field The name of the field to compare. + * @param value The value the field must be equal to. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value does not equal the specified value. + * + * @param path The path of the field to compare. + * @param value The value the field must be equal to. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + isNotEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isNotEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value does not equal the specified value. + * + * @param field The name of the field to compare. + * @param value The value the field must be equal to. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + isNotEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isNotEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be equal to the specified value. + * + * @param path The path of the field to compare. + * @param value The value the field must be equal to. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + isEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be less than the specified value. + * + * @param field The name of the field to compare. + * @param value The value the field must be less than. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be less than the specified value. + * + * @param path The path of the field to compare. + * @param value The value the field must be less than. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + isLessThan:(id)value NS_SWIFT_NAME(whereField(_:isLessThan:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be less than or equal to the specified value. + * + * @param field The name of the field to compare + * @param value The value the field must be less than or equal to. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be less than or equal to the specified value. + * + * @param path The path of the field to compare + * @param value The value the field must be less than or equal to. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + isLessThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isLessThanOrEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must greater than the specified value. + * + * @param field The name of the field to compare + * @param value The value the field must be greater than. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must greater than the specified value. + * + * @param path The path of the field to compare + * @param value The value the field must be greater than. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + isGreaterThan:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThan:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be greater than or equal to the specified value. + * + * @param field The name of the field to compare + * @param value The value the field must be greater than. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * contain the specified field and the value must be greater than or equal to the specified value. + * + * @param path The path of the field to compare + * @param value The value the field must be greater than. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + isGreaterThanOrEqualTo:(id)value NS_SWIFT_NAME(whereField(_:isGreaterThanOrEqualTo:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field, it must be an array, and the array must contain the provided value. + * + * A query can have only one arrayContains filter. + * + * @param field The name of the field containing an array to search + * @param value The value that must be contained in the array + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field, it must be an array, and the array must contain the provided value. + * + * A query can have only one arrayContains filter. + * + * @param path The path of the field containing an array to search + * @param value The value that must be contained in the array + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + arrayContains:(id)value NS_SWIFT_NAME(whereField(_:arrayContains:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field, the value must be an array, and that array must contain at least one value + * from the provided array. + * + * A query can have only one `arrayContainsAny` filter and it cannot be combined with + * `arrayContains` or `in` filters. + * + * @param field The name of the field containing an array to search. + * @param values The array that contains the values to match. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + arrayContainsAny:(NSArray *)values NS_SWIFT_NAME(whereField(_:arrayContainsAny:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field, the value must be an array, and that array must contain at least one value + * from the provided array. + * + * A query can have only one `arrayContainsAny` filter and it cannot be combined with + * `arrayContains` or `in` filters. + * + * @param path The path of the field containing an array to search. + * @param values The array that contains the values to match. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + arrayContainsAny:(NSArray *)values + NS_SWIFT_NAME(whereField(_:arrayContainsAny:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field and the value must equal one of the values from the provided array. + * + * A query can have only one `in` filter, and it cannot be combined with an `arrayContainsAny` + * filter. + * + * @param field The name of the field to search. + * @param values The array that contains the values to match. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + in:(NSArray *)values NS_SWIFT_NAME(whereField(_:in:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field and the value must equal one of the values from the provided array. + * + * A query can have only one `in` filter, and it cannot be combined with an `arrayContainsAny` + * filter. + * + * @param path The path of the field to search. + * @param values The array that contains the values to match. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + in:(NSArray *)values NS_SWIFT_NAME(whereField(_:in:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field and the value does not equal any of the values from the provided array. + * + * One special case is that `notIn` filters cannot match `nil` values. To query for documents + * where a field exists and is `nil`, use a `notEqual` filter, which can handle this special case. + * + * A query can have only one `notIn` filter, and it cannot be combined with an `arrayContains`, + * `arrayContainsAny`, `in`, or `notEqual` filter. + * + * @param field The name of the field to search. + * @param values The array that contains the values to match. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereField:(NSString *)field + notIn:(NSArray *)values NS_SWIFT_NAME(whereField(_:notIn:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must contain + * the specified field and the value does not equal any of the values from the provided array. + * + * One special case is that `notIn` filters cannot match `nil` values. To query for documents + * where a field exists and is `nil`, use a `notEqual` filter, which can handle this special case. + * + * Passing in a `null` value into the `values` array results in no document matches. To query + * for documents where a field is not `null`, use a `notEqual` filter. + * + * @param path The path of the field to search. + * @param values The array that contains the values to match. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryWhereFieldPath:(FIRFieldPath *)path + notIn:(NSArray *)values NS_SWIFT_NAME(whereField(_:notIn:)); + +/** + * Creates and returns a new `FIRQuery` with the additional filter that documents must + * satisfy the specified predicate. + * + * @param predicate The predicate the document must satisfy. Can be either comparison + * or compound of comparison. In particular, block-based predicate is not supported. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryFilteredUsingPredicate:(NSPredicate *)predicate NS_SWIFT_NAME(filter(using:)); + +#pragma mark - Sorting Data +/** + * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. + * + * @param field The field to sort by. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryOrderedByField:(NSString *)field NS_SWIFT_NAME(order(by:)); + +/** + * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field. + * + * @param path The field to sort by. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path NS_SWIFT_NAME(order(by:)); + +/** + * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field, + * optionally in descending order instead of ascending. + * + * @param field The field to sort by. + * @param descending Whether to sort descending. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryOrderedByField:(NSString *)field + descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); + +/** + * Creates and returns a new `FIRQuery` that's additionally sorted by the specified field, + * optionally in descending order instead of ascending. + * + * @param path The field to sort by. + * @param descending Whether to sort descending. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryOrderedByFieldPath:(FIRFieldPath *)path + descending:(BOOL)descending NS_SWIFT_NAME(order(by:descending:)); + +#pragma mark - Limiting Data +/** + * Creates and returns a new `FIRQuery` that only returns the first matching documents up to + * the specified number. + * + * @param limit The maximum number of items to return. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryLimitedTo:(NSInteger)limit NS_SWIFT_NAME(limit(to:)); + +/** + * Creates and returns a new `FIRQuery` that only returns the last matching documents up to + * the specified number. + * + * A query with a `limit(ToLast:)` clause must have at least one `orderBy` clause. + * + * @param limit The maximum number of items to return. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryLimitedToLast:(NSInteger)limit NS_SWIFT_NAME(limit(toLast:)); + +#pragma mark - Choosing Endpoints +/** + * Creates and returns a new `FIRQuery` that starts at the provided document (inclusive). The + * starting position is relative to the order of the query. The document must contain all of the + * fields provided in the orderBy of this query. + * + * @param document The snapshot of the document to start at. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryStartingAtDocument:(FIRDocumentSnapshot *)document + NS_SWIFT_NAME(start(atDocument:)); + +/** + * Creates and returns a new `FIRQuery` that starts at the provided fields relative to the order of + * the query. The order of the field values must match the order of the order by clauses of the + * query. + * + * @param fieldValues The field values to start this query at, in order of the query's order by. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryStartingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(at:)); + +/** + * Creates and returns a new `FIRQuery` that starts after the provided document (exclusive). The + * starting position is relative to the order of the query. The document must contain all of the + * fields provided in the orderBy of this query. + * + * @param document The snapshot of the document to start after. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryStartingAfterDocument:(FIRDocumentSnapshot *)document + NS_SWIFT_NAME(start(afterDocument:)); + +/** + * Creates and returns a new `FIRQuery` that starts after the provided fields relative to the order + * of the query. The order of the field values must match the order of the order by clauses of the + * query. + * + * @param fieldValues The field values to start this query after, in order of the query's order + * by. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryStartingAfterValues:(NSArray *)fieldValues NS_SWIFT_NAME(start(after:)); + +/** + * Creates and returns a new `FIRQuery` that ends before the provided document (exclusive). The end + * position is relative to the order of the query. The document must contain all of the fields + * provided in the orderBy of this query. + * + * @param document The snapshot of the document to end before. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryEndingBeforeDocument:(FIRDocumentSnapshot *)document + NS_SWIFT_NAME(end(beforeDocument:)); + +/** + * Creates and returns a new `FIRQuery` that ends before the provided fields relative to the order + * of the query. The order of the field values must match the order of the order by clauses of the + * query. + * + * @param fieldValues The field values to end this query before, in order of the query's order by. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryEndingBeforeValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(before:)); + +/** + * Creates and returns a new `FIRQuery` that ends at the provided document (exclusive). The end + * position is relative to the order of the query. The document must contain all of the fields + * provided in the orderBy of this query. + * + * @param document The snapshot of the document to end at. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryEndingAtDocument:(FIRDocumentSnapshot *)document NS_SWIFT_NAME(end(atDocument:)); + +/** + * Creates and returns a new `FIRQuery` that ends at the provided fields relative to the order of + * the query. The order of the field values must match the order of the order by clauses of the + * query. + * + * @param fieldValues The field values to end this query at, in order of the query's order by. + * + * @return The created `FIRQuery`. + */ +- (FIRQuery *)queryEndingAtValues:(NSArray *)fieldValues NS_SWIFT_NAME(end(at:)); + +@end + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRQuerySnapshot.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuerySnapshot.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRQuerySnapshot.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRQuerySnapshot.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRSnapshotMetadata.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRSnapshotMetadata.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRSnapshotMetadata.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRSnapshotMetadata.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRTimestamp.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTimestamp.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRTimestamp.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTimestamp.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRTransaction.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTransaction.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRTransaction.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRTransaction.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FIRWriteBatch.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRWriteBatch.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FIRWriteBatch.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FIRWriteBatch.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore.h b/Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h similarity index 100% rename from Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore.h rename to Pods/FirebaseFirestore/Firestore/Source/Public/FirebaseFirestore/FirebaseFirestore.h diff --git a/Pods/FirebaseFirestore/Firestore/Source/Remote/FSTSerializerBeta.h b/Pods/FirebaseFirestore/Firestore/Source/Remote/FSTSerializerBeta.h deleted file mode 100644 index 89604f904..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Remote/FSTSerializerBeta.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#include -#include - -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" - -@class GCFSBatchGetDocumentsResponse; -@class GCFSDocument; -@class GCFSDocumentMask; -@class GCFSDocumentTransform_FieldTransform; -@class GCFSListenResponse; -@class GCFSStructuredQuery_Filter; -@class GCFSStructuredQuery_FieldFilter; -@class GCFSStructuredQuery_UnaryFilter; -@class GCFSTarget; -@class GCFSTarget_DocumentsTarget; -@class GCFSTarget_QueryTarget; -@class GCFSValue; -@class GCFSWrite; -@class GCFSWriteResult; - -@class GPBTimestamp; - -namespace core = firebase::firestore::core; -namespace local = firebase::firestore::local; -namespace model = firebase::firestore::model; -namespace remote = firebase::firestore::remote; - -NS_ASSUME_NONNULL_BEGIN - -/** - * Converts internal model objects to their equivalent protocol buffer form. Methods starting with - * "encoded" convert to a protocol buffer and methods starting with "decoded" convert from a - * protocol buffer. - * - * Throws an exception if a protocol buffer is missing a critical field or has a value we can't - * interpret. - */ -@interface FSTSerializerBeta : NSObject - -- (instancetype)init NS_UNAVAILABLE; - -- (instancetype)initWithDatabaseID:(model::DatabaseId)databaseID NS_DESIGNATED_INITIALIZER; - -- (GCFSValue *)encodedNull; -- (GCFSValue *)encodedBool:(bool)value; -- (GCFSValue *)encodedDouble:(double)value; -- (GCFSValue *)encodedInteger:(int64_t)value; -- (GCFSValue *)encodedString:(absl::string_view)value; - -- (GPBTimestamp *)encodedTimestamp:(const firebase::Timestamp &)timestamp; -- (firebase::Timestamp)decodedTimestamp:(GPBTimestamp *)timestamp; - -- (GPBTimestamp *)encodedVersion:(const model::SnapshotVersion &)version; -- (model::SnapshotVersion)decodedVersion:(GPBTimestamp *)version; - -/** Returns the database ID, such as `projects/{project id}/databases/{database_id}`. */ -- (NSString *)encodedDatabaseID; - -/** - * Encodes the given document key as a fully qualified name. This includes the - * databaseId associated with this FSTSerializerBeta and the key path. - */ -- (NSString *)encodedDocumentKey:(const model::DocumentKey &)key; -- (model::DocumentKey)decodedDocumentKey:(NSString *)key; - -- (GCFSValue *)encodedFieldValue:(const model::FieldValue &)fieldValue; -- (model::FieldValue)decodedFieldValue:(GCFSValue *)valueProto; - -- (GCFSWrite *)encodedMutation:(const model::Mutation &)mutation; -- (model::Mutation)decodedMutation:(GCFSWrite *)mutation; - -- (GCFSDocumentMask *)encodedFieldMask:(const model::FieldMask &)fieldMask; - -- (NSMutableArray *)encodedFieldTransforms: - (const std::vector &)fieldTransforms; - -- (model::MutationResult)decodedMutationResult:(GCFSWriteResult *)mutation - commitVersion:(const model::SnapshotVersion &)commitVersion; - -- (nullable NSMutableDictionary *)encodedListenRequestLabelsForQueryData: - (const local::QueryData &)queryData; - -- (GCFSTarget *)encodedTarget:(const local::QueryData &)queryData; - -- (GCFSTarget_DocumentsTarget *)encodedDocumentsTarget:(const core::Query &)query; -- (core::Query)decodedQueryFromDocumentsTarget:(GCFSTarget_DocumentsTarget *)target; - -- (GCFSTarget_QueryTarget *)encodedQueryTarget:(const core::Query &)query; -- (core::Query)decodedQueryFromQueryTarget:(GCFSTarget_QueryTarget *)target; - -- (GCFSStructuredQuery_Filter *)encodedUnaryOrFieldFilter:(const core::FieldFilter &)filter; -- (core::FieldFilter)decodedFieldFilter:(GCFSStructuredQuery_FieldFilter *)proto; -- (core::FieldFilter)decodedUnaryFilter:(GCFSStructuredQuery_UnaryFilter *)proto; - -- (std::unique_ptr)decodedWatchChange:(GCFSListenResponse *)watchChange; -- (model::SnapshotVersion)versionFromListenResponse:(GCFSListenResponse *)watchChange; - -- (GCFSDocument *)encodedDocumentWithFields:(const model::ObjectValue &)objectValue - key:(const model::DocumentKey &)key; - -/** - * Encodes an ObjectValue into a dictionary. - * @return a new dictionary that can be assigned to a field in another proto. - */ -- (NSMutableDictionary *)encodedFields:(const model::ObjectValue &)value; - -- (model::ObjectValue)decodedFields:(NSDictionary *)fields; - -- (model::MaybeDocument)decodedMaybeDocumentFromBatch:(GCFSBatchGetDocumentsResponse *)response; - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/Remote/FSTSerializerBeta.mm b/Pods/FirebaseFirestore/Firestore/Source/Remote/FSTSerializerBeta.mm deleted file mode 100644 index 146bc42b9..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Remote/FSTSerializerBeta.mm +++ /dev/null @@ -1,1257 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - -#include -#include -#include -#include -#include -#include - -#import "Firestore/Protos/objc/google/firestore/v1/Common.pbobjc.h" -#import "Firestore/Protos/objc/google/firestore/v1/Document.pbobjc.h" -#import "Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h" -#import "Firestore/Protos/objc/google/firestore/v1/Query.pbobjc.h" -#import "Firestore/Protos/objc/google/firestore/v1/Write.pbobjc.h" -#import "Firestore/Protos/objc/google/rpc/Status.pbobjc.h" -#import "Firestore/Protos/objc/google/type/Latlng.pbobjc.h" - -#import "FIRFirestoreErrors.h" -#import "FIRGeoPoint.h" -#import "FIRTimestamp.h" - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/include/firebase/firestore/geo_point.h" -#include "Firestore/core/src/firebase/firestore/core/bound.h" -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/delete_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/patch_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/model/set_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/transform_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/remote/existence_filter.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "absl/memory/memory.h" -#include "absl/types/optional.h" - -namespace util = firebase::firestore::util; -using firebase::Timestamp; -using firebase::firestore::Error; -using firebase::firestore::GeoPoint; -using firebase::firestore::core::Bound; -using firebase::firestore::core::CollectionGroupId; -using firebase::firestore::core::Direction; -using firebase::firestore::core::FieldFilter; -using firebase::firestore::core::Filter; -using firebase::firestore::core::FilterList; -using firebase::firestore::core::OrderBy; -using firebase::firestore::core::OrderByList; -using firebase::firestore::core::Query; -using firebase::firestore::local::QueryData; -using firebase::firestore::local::QueryPurpose; -using firebase::firestore::model::ArrayTransform; -using firebase::firestore::model::DatabaseId; -using firebase::firestore::model::DeleteMutation; -using firebase::firestore::model::Document; -using firebase::firestore::model::DocumentKey; -using firebase::firestore::model::DocumentState; -using firebase::firestore::model::FieldMask; -using firebase::firestore::model::FieldPath; -using firebase::firestore::model::FieldTransform; -using firebase::firestore::model::FieldValue; -using firebase::firestore::model::MaybeDocument; -using firebase::firestore::model::Mutation; -using firebase::firestore::model::MutationResult; -using firebase::firestore::model::NoDocument; -using firebase::firestore::model::NumericIncrementTransform; -using firebase::firestore::model::ObjectValue; -using firebase::firestore::model::PatchMutation; -using firebase::firestore::model::Precondition; -using firebase::firestore::model::ResourcePath; -using firebase::firestore::model::ServerTimestampTransform; -using firebase::firestore::model::SetMutation; -using firebase::firestore::model::SnapshotVersion; -using firebase::firestore::model::TargetId; -using firebase::firestore::model::TransformMutation; -using firebase::firestore::model::TransformOperation; -using firebase::firestore::model::UnknownDocument; -using firebase::firestore::nanopb::ByteString; -using firebase::firestore::nanopb::MakeByteString; -using firebase::firestore::nanopb::MakeNSData; -using firebase::firestore::remote::DocumentWatchChange; -using firebase::firestore::remote::ExistenceFilter; -using firebase::firestore::remote::ExistenceFilterWatchChange; -using firebase::firestore::remote::WatchChange; -using firebase::firestore::remote::WatchTargetChange; -using firebase::firestore::remote::WatchTargetChangeState; - -using Operator = Filter::Operator; - -NS_ASSUME_NONNULL_BEGIN - -namespace { - -absl::any Wrap(GCFSDocument *doc) { - return absl::make_any(doc); -} - -} // namespace - -@implementation FSTSerializerBeta { - DatabaseId _databaseID; -} - -- (instancetype)initWithDatabaseID:(DatabaseId)databaseID { - self = [super init]; - if (self) { - _databaseID = std::move(databaseID); - } - return self; -} - -#pragma mark - SnapshotVersion <=> GPBTimestamp - -- (GPBTimestamp *)encodedTimestamp:(const Timestamp &)timestamp { - GPBTimestamp *result = [GPBTimestamp message]; - result.seconds = timestamp.seconds(); - result.nanos = timestamp.nanoseconds(); - return result; -} - -- (Timestamp)decodedTimestamp:(GPBTimestamp *)timestamp { - return Timestamp{timestamp.seconds, timestamp.nanos}; -} - -- (GPBTimestamp *)encodedVersion:(const SnapshotVersion &)version { - return [self encodedTimestamp:version.timestamp()]; -} - -- (SnapshotVersion)decodedVersion:(GPBTimestamp *)version { - return SnapshotVersion{[self decodedTimestamp:version]}; -} - -#pragma mark - FIRGeoPoint <=> GTPLatLng - -- (GTPLatLng *)encodedGeoPoint:(const GeoPoint &)geoPoint { - GTPLatLng *latLng = [GTPLatLng message]; - latLng.latitude = geoPoint.latitude(); - latLng.longitude = geoPoint.longitude(); - return latLng; -} - -- (GeoPoint)decodedGeoPoint:(GTPLatLng *)latLng { - return GeoPoint(latLng.latitude, latLng.longitude); -} - -#pragma mark - DocumentKey <=> Key proto - -- (NSString *)encodedDocumentKey:(const DocumentKey &)key { - return [self encodedResourcePathForDatabaseID:_databaseID path:key.path()]; -} - -- (DocumentKey)decodedDocumentKey:(NSString *)name { - const ResourcePath path = [self decodedResourcePathWithDatabaseID:name]; - HARD_ASSERT(path[1] == _databaseID.project_id(), - "Tried to deserialize key from different project."); - HARD_ASSERT(path[3] == _databaseID.database_id(), - "Tried to deserialize key from different datbase."); - return DocumentKey{[self localResourcePathForQualifiedResourcePath:path]}; -} - -- (NSString *)encodedResourcePathForDatabaseID:(const DatabaseId &)databaseID - path:(const ResourcePath &)path { - return util::MakeNSString([self encodedResourcePathForDatabaseID:databaseID] - .Append("documents") - .Append(path) - .CanonicalString()); -} - -- (ResourcePath)decodedResourcePathWithDatabaseID:(NSString *)name { - const ResourcePath path = ResourcePath::FromString(util::MakeString(name)); - HARD_ASSERT([self validQualifiedResourcePath:path], "Tried to deserialize invalid key %s", - path.CanonicalString()); - return path; -} - -- (NSString *)encodedQueryPath:(const ResourcePath &)path { - return [self encodedResourcePathForDatabaseID:_databaseID path:path]; -} - -- (ResourcePath)decodedQueryPath:(NSString *)name { - const ResourcePath resource = [self decodedResourcePathWithDatabaseID:name]; - if (resource.size() == 4) { - // In v1beta1 queries for collections at the root did not have a trailing "/documents". In v1 - // all resource paths contain "/documents". Preserve the ability to read the v1beta1 form for - // compatibility with queries persisted in the local query cache. - return ResourcePath{}; - } else { - return [self localResourcePathForQualifiedResourcePath:resource]; - } -} - -- (ResourcePath)encodedResourcePathForDatabaseID:(const DatabaseId &)databaseID { - return ResourcePath{"projects", databaseID.project_id(), "databases", databaseID.database_id()}; -} - -- (ResourcePath)localResourcePathForQualifiedResourcePath:(const ResourcePath &)resourceName { - HARD_ASSERT(resourceName.size() > 4 && resourceName[4] == "documents", - "Tried to deserialize invalid key %s", resourceName.CanonicalString()); - return resourceName.PopFirst(5); -} - -- (BOOL)validQualifiedResourcePath:(const ResourcePath &)path { - return path.size() >= 4 && path[0] == "projects" && path[2] == "databases"; -} - -- (NSString *)encodedDatabaseID { - return util::MakeNSString([self encodedResourcePathForDatabaseID:_databaseID].CanonicalString()); -} - -#pragma mark - FieldValue <=> Value proto - -- (GCFSValue *)encodedFieldValue:(const FieldValue &)fieldValue { - switch (fieldValue.type()) { - case FieldValue::Type::Null: - return [self encodedNull]; - case FieldValue::Type::Boolean: - return [self encodedBool:fieldValue.boolean_value()]; - case FieldValue::Type::Integer: - return [self encodedInteger:fieldValue.integer_value()]; - case FieldValue::Type::Double: - return [self encodedDouble:fieldValue.double_value()]; - case FieldValue::Type::Timestamp: - return [self encodedTimestampValue:fieldValue.timestamp_value()]; - case FieldValue::Type::String: - return [self encodedString:fieldValue.string_value()]; - case FieldValue::Type::Blob: - return [self encodedBlobValue:fieldValue.blob_value()]; - case FieldValue::Type::Reference: { - const auto &ref = fieldValue.reference_value(); - return [self encodedReferenceValueForDatabaseID:ref.database_id() key:ref.key()]; - } - case FieldValue::Type::GeoPoint: - return [self encodedGeoPointValue:fieldValue.geo_point_value()]; - case FieldValue::Type::Array: { - GCFSValue *result = [GCFSValue message]; - result.arrayValue = [self encodedArrayValue:fieldValue.array_value()]; - return result; - } - case FieldValue::Type::Object: { - GCFSValue *result = [GCFSValue message]; - result.mapValue = [self encodedMapValue:fieldValue.object_value()]; - return result; - } - - case FieldValue::Type::ServerTimestamp: - HARD_FAIL("Unhandled type %s on %s", fieldValue.type(), fieldValue.ToString()); - } - UNREACHABLE(); -} - -- (FieldValue)decodedFieldValue:(GCFSValue *)valueProto { - switch (valueProto.valueTypeOneOfCase) { - case GCFSValue_ValueType_OneOfCase_NullValue: - return FieldValue::Null(); - - case GCFSValue_ValueType_OneOfCase_BooleanValue: - return FieldValue::FromBoolean(valueProto.booleanValue); - - case GCFSValue_ValueType_OneOfCase_IntegerValue: - return FieldValue::FromInteger(valueProto.integerValue); - - case GCFSValue_ValueType_OneOfCase_DoubleValue: - return FieldValue::FromDouble(valueProto.doubleValue); - - case GCFSValue_ValueType_OneOfCase_StringValue: - return FieldValue::FromString(util::MakeString(valueProto.stringValue)); - - case GCFSValue_ValueType_OneOfCase_TimestampValue: { - Timestamp value = [self decodedTimestamp:valueProto.timestampValue]; - return FieldValue::FromTimestamp(value); - } - - case GCFSValue_ValueType_OneOfCase_GeoPointValue: - return FieldValue::FromGeoPoint([self decodedGeoPoint:valueProto.geoPointValue]); - - case GCFSValue_ValueType_OneOfCase_BytesValue: - return FieldValue::FromBlob(MakeByteString(valueProto.bytesValue)); - - case GCFSValue_ValueType_OneOfCase_ReferenceValue: - return [self decodedReferenceValue:valueProto.referenceValue]; - - case GCFSValue_ValueType_OneOfCase_ArrayValue: - return [self decodedArrayValue:valueProto.arrayValue]; - - case GCFSValue_ValueType_OneOfCase_MapValue: - return [self decodedMapValue:valueProto.mapValue]; - - default: - HARD_FAIL("Unhandled type %s on %s", valueProto.valueTypeOneOfCase, valueProto); - } -} - -- (GCFSValue *)encodedNull { - GCFSValue *result = [GCFSValue message]; - result.nullValue = GPBNullValue_NullValue; - return result; -} - -- (GCFSValue *)encodedBool:(bool)value { - GCFSValue *result = [GCFSValue message]; - result.booleanValue = value; - return result; -} - -- (GCFSValue *)encodedDouble:(double)value { - GCFSValue *result = [GCFSValue message]; - result.doubleValue = value; - return result; -} - -- (GCFSValue *)encodedInteger:(int64_t)value { - GCFSValue *result = [GCFSValue message]; - result.integerValue = value; - return result; -} - -- (GCFSValue *)encodedString:(absl::string_view)value { - GCFSValue *result = [GCFSValue message]; - result.stringValue = util::MakeNSString(value); - return result; -} - -- (GCFSValue *)encodedTimestampValue:(const Timestamp &)value { - GCFSValue *result = [GCFSValue message]; - result.timestampValue = [self encodedTimestamp:value]; - return result; -} - -- (GCFSValue *)encodedGeoPointValue:(const GeoPoint &)value { - GCFSValue *result = [GCFSValue message]; - result.geoPointValue = [self encodedGeoPoint:value]; - return result; -} - -- (GCFSValue *)encodedBlobValue:(const ByteString &)value { - GCFSValue *result = [GCFSValue message]; - result.bytesValue = MakeNSData(value); - return result; -} - -- (GCFSValue *)encodedReferenceValueForDatabaseID:(const DatabaseId &)databaseID - key:(const DocumentKey &)key { - HARD_ASSERT(databaseID == _databaseID, "Database %s:%s cannot encode reference from %s:%s", - _databaseID.project_id(), _databaseID.database_id(), databaseID.project_id(), - databaseID.database_id()); - GCFSValue *result = [GCFSValue message]; - result.referenceValue = [self encodedResourcePathForDatabaseID:databaseID path:key.path()]; - return result; -} - -- (FieldValue)decodedReferenceValue:(NSString *)resourceName { - const ResourcePath path = [self decodedResourcePathWithDatabaseID:resourceName]; - const std::string &project = path[1]; - const std::string &database = path[3]; - const DocumentKey key{[self localResourcePathForQualifiedResourcePath:path]}; - - const DatabaseId database_id(project, database); - HARD_ASSERT(database_id == _databaseID, "Database %s:%s cannot decode reference from %s:%s", - _databaseID.project_id(), _databaseID.database_id(), database_id.project_id(), - database_id.database_id()); - return FieldValue::FromReference(_databaseID, key); -} - -- (GCFSArrayValue *)encodedArrayValue:(const FieldValue::Array &)arrayValue { - GCFSArrayValue *proto = [GCFSArrayValue message]; - NSMutableArray *protoContents = [proto valuesArray]; - - for (const FieldValue &value : arrayValue) { - GCFSValue *converted = [self encodedFieldValue:value]; - [protoContents addObject:converted]; - } - return proto; -} - -- (FieldValue)decodedArrayValue:(GCFSArrayValue *)arrayValue { - FieldValue::Array contents; - contents.reserve(arrayValue.valuesArray_Count); - - for (GCFSValue *value in arrayValue.valuesArray) { - contents.push_back([self decodedFieldValue:value]); - } - - return FieldValue::FromArray(std::move(contents)); -} - -- (GCFSMapValue *)encodedMapValue:(const FieldValue::Map &)value { - GCFSMapValue *result = [GCFSMapValue message]; - result.fields = [self encodedMapFields:value]; - return result; -} - -- (ObjectValue)decodedMapValue:(GCFSMapValue *)map { - return [self decodedFields:map.fields]; -} - -/** - * Encodes an ObjectValue into a dictionary. - * @return a new dictionary that can be assigned to a field in another proto. - */ -- (NSMutableDictionary *)encodedFields:(const ObjectValue &)value { - return [self encodedMapFields:value.GetInternalValue()]; -} - -- (NSMutableDictionary *)encodedMapFields:(const FieldValue::Map &)value { - NSMutableDictionary *result = [NSMutableDictionary dictionary]; - - for (const auto &kv : value) { - NSString *key = util::MakeNSString(kv.first); - GCFSValue *converted = [self encodedFieldValue:kv.second]; - result[key] = converted; - } - return result; -} - -- (ObjectValue)decodedFields:(NSDictionary *)fields { - __block ObjectValue result = ObjectValue::Empty(); - [fields enumerateKeysAndObjectsUsingBlock:^(NSString *_Nonnull key, GCFSValue *_Nonnull obj, - BOOL *_Nonnull) { - FieldPath path{util::MakeString(key)}; - FieldValue value = [self decodedFieldValue:obj]; - result = result.Set(path, std::move(value)); - }]; - return result; -} - -#pragma mark - ObjectValue <=> Document proto - -- (GCFSDocument *)encodedDocumentWithFields:(const ObjectValue &)objectValue - key:(const DocumentKey &)key { - GCFSDocument *proto = [GCFSDocument message]; - proto.name = [self encodedDocumentKey:key]; - proto.fields = [self encodedFields:objectValue]; - return proto; -} - -#pragma mark - MaybeDocument <= BatchGetDocumentsResponse proto - -- (MaybeDocument)decodedMaybeDocumentFromBatch:(GCFSBatchGetDocumentsResponse *)response { - switch (response.resultOneOfCase) { - case GCFSBatchGetDocumentsResponse_Result_OneOfCase_Found: - return [self decodedFoundDocument:response]; - case GCFSBatchGetDocumentsResponse_Result_OneOfCase_Missing: - return [self decodedDeletedDocument:response]; - default: - HARD_FAIL("Unknown document type: %s", response); - } -} - -- (Document)decodedFoundDocument:(GCFSBatchGetDocumentsResponse *)response { - HARD_ASSERT(!!response.found, "Tried to deserialize a found document from a deleted document."); - DocumentKey key = [self decodedDocumentKey:response.found.name]; - ObjectValue value = [self decodedFields:response.found.fields]; - SnapshotVersion version = [self decodedVersion:response.found.updateTime]; - HARD_ASSERT(version != SnapshotVersion::None(), - "Got a document response with no snapshot version"); - - return Document(std::move(value), std::move(key), version, DocumentState::kSynced, - Wrap(response.found)); -} - -- (NoDocument)decodedDeletedDocument:(GCFSBatchGetDocumentsResponse *)response { - HARD_ASSERT(!!response.missing, "Tried to deserialize a deleted document from a found document."); - DocumentKey key = [self decodedDocumentKey:response.missing]; - SnapshotVersion version = [self decodedVersion:response.readTime]; - HARD_ASSERT(version != SnapshotVersion::None(), - "Got a no document response with no snapshot version"); - return NoDocument(std::move(key), version, /* has_commited_mutations= */ false); -} - -#pragma mark - Mutation => GCFSWrite proto - -- (GCFSWrite *)encodedMutation:(const Mutation &)mutation { - using Type = Mutation::Type; - GCFSWrite *proto = [GCFSWrite message]; - - if (!mutation.precondition().is_none()) { - proto.currentDocument = [self encodedPrecondition:mutation.precondition()]; - } - - switch (mutation.type()) { - case Type::Set: { - SetMutation set(mutation); - proto.update = [self encodedDocumentWithFields:set.value() key:set.key()]; - return proto; - } - - case Type::Patch: { - PatchMutation patch(mutation); - proto.update = [self encodedDocumentWithFields:patch.value() key:patch.key()]; - proto.updateMask = [self encodedFieldMask:patch.mask()]; - return proto; - } - - case Type::Transform: { - TransformMutation transform(mutation); - - proto.transform = [GCFSDocumentTransform message]; - proto.transform.document = [self encodedDocumentKey:transform.key()]; - proto.transform.fieldTransformsArray = - [self encodedFieldTransforms:transform.field_transforms()]; - // NOTE: We set a precondition of exists: true as a safety-check, since we always combine - // TransformMutations with a SetMutation or PatchMutation which (if successful) should - // end up with an existing document. - proto.currentDocument.exists = YES; - return proto; - } - - case Type::Delete: { - DeleteMutation deleteMutation(mutation); - proto.delete_p = [self encodedDocumentKey:deleteMutation.key()]; - return proto; - } - } - - UNREACHABLE(); -} - -- (Mutation)decodedMutation:(GCFSWrite *)mutation { - Precondition precondition = [mutation hasCurrentDocument] - ? [self decodedPrecondition:mutation.currentDocument] - : Precondition::None(); - - switch (mutation.operationOneOfCase) { - case GCFSWrite_Operation_OneOfCase_Update: - if (mutation.hasUpdateMask) { - return PatchMutation([self decodedDocumentKey:mutation.update.name], - [self decodedFields:mutation.update.fields], - [self decodedFieldMask:mutation.updateMask], precondition); - } else { - return SetMutation([self decodedDocumentKey:mutation.update.name], - [self decodedFields:mutation.update.fields], precondition); - } - - case GCFSWrite_Operation_OneOfCase_Delete_p: - return DeleteMutation([self decodedDocumentKey:mutation.delete_p], precondition); - - case GCFSWrite_Operation_OneOfCase_Transform: { - HARD_ASSERT(precondition == Precondition::Exists(true), - "Transforms must have precondition \"exists == true\""); - - return TransformMutation( - [self decodedDocumentKey:mutation.transform.document], - [self decodedFieldTransforms:mutation.transform.fieldTransformsArray]); - } - - default: - // Note that insert is intentionally unhandled, since we don't ever deal in them. - HARD_FAIL("Unknown mutation operation: %s", mutation.operationOneOfCase); - } -} - -- (GCFSPrecondition *)encodedPrecondition:(const Precondition &)precondition { - HARD_ASSERT(!precondition.is_none(), "Can't serialize an empty precondition"); - GCFSPrecondition *message = [GCFSPrecondition message]; - if (precondition.type() == Precondition::Type::UpdateTime) { - message.updateTime = [self encodedVersion:precondition.update_time()]; - } else if (precondition.type() == Precondition::Type::Exists) { - message.exists = precondition == Precondition::Exists(true); - } else { - HARD_FAIL("Unknown precondition: %s", precondition.ToString()); - } - return message; -} - -- (Precondition)decodedPrecondition:(GCFSPrecondition *)precondition { - switch (precondition.conditionTypeOneOfCase) { - case GCFSPrecondition_ConditionType_OneOfCase_GPBUnsetOneOfCase: - return Precondition::None(); - - case GCFSPrecondition_ConditionType_OneOfCase_Exists: - return Precondition::Exists(precondition.exists); - - case GCFSPrecondition_ConditionType_OneOfCase_UpdateTime: - return Precondition::UpdateTime([self decodedVersion:precondition.updateTime]); - - default: - HARD_FAIL("Unrecognized Precondition one-of case %s", precondition); - } -} - -- (GCFSDocumentMask *)encodedFieldMask:(const FieldMask &)fieldMask { - GCFSDocumentMask *mask = [GCFSDocumentMask message]; - for (const FieldPath &field : fieldMask) { - [mask.fieldPathsArray addObject:util::MakeNSString(field.CanonicalString())]; - } - return mask; -} - -- (FieldMask)decodedFieldMask:(GCFSDocumentMask *)fieldMask { - std::set fields; - for (NSString *path in fieldMask.fieldPathsArray) { - fields.insert(FieldPath::FromServerFormat(util::MakeString(path))); - } - return FieldMask(std::move(fields)); -} - -- (NSMutableArray *)encodedFieldTransforms: - (const std::vector &)fieldTransforms { - NSMutableArray *protos = [NSMutableArray array]; - for (const FieldTransform &fieldTransform : fieldTransforms) { - GCFSDocumentTransform_FieldTransform *proto = [self encodedFieldTransform:fieldTransform]; - [protos addObject:proto]; - } - return protos; -} - -- (GCFSDocumentTransform_FieldTransform *)encodedFieldTransform: - (const FieldTransform &)fieldTransform { - GCFSDocumentTransform_FieldTransform *proto = [GCFSDocumentTransform_FieldTransform message]; - proto.fieldPath = util::MakeNSString(fieldTransform.path().CanonicalString()); - if (fieldTransform.transformation().type() == TransformOperation::Type::ServerTimestamp) { - proto.setToServerValue = GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime; - - } else if (fieldTransform.transformation().type() == TransformOperation::Type::ArrayUnion) { - proto.appendMissingElements = [self - encodedArrayTransformElements:ArrayTransform(fieldTransform.transformation()).elements()]; - - } else if (fieldTransform.transformation().type() == TransformOperation::Type::ArrayRemove) { - proto.removeAllFromArray_p = [self - encodedArrayTransformElements:ArrayTransform(fieldTransform.transformation()).elements()]; - } else if (fieldTransform.transformation().type() == TransformOperation::Type::Increment) { - const NumericIncrementTransform &incrementTransform = - static_cast(fieldTransform.transformation()); - proto.increment = [self encodedFieldValue:incrementTransform.operand()]; - } else { - HARD_FAIL("Unknown transform: %s type", fieldTransform.transformation().type()); - } - return proto; -} - -- (GCFSArrayValue *)encodedArrayTransformElements:(const std::vector &)elements { - GCFSArrayValue *proto = [GCFSArrayValue message]; - NSMutableArray *protoContents = [proto valuesArray]; - - for (const FieldValue &element : elements) { - GCFSValue *converted = [self encodedFieldValue:element]; - [protoContents addObject:converted]; - } - return proto; -} - -- (std::vector)decodedFieldTransforms: - (NSArray *)protos { - std::vector fieldTransforms; - fieldTransforms.reserve(protos.count); - - for (GCFSDocumentTransform_FieldTransform *proto in protos) { - switch (proto.transformTypeOneOfCase) { - case GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_SetToServerValue: { - HARD_ASSERT( - proto.setToServerValue == GCFSDocumentTransform_FieldTransform_ServerValue_RequestTime, - "Unknown transform setToServerValue: %s", proto.setToServerValue); - fieldTransforms.emplace_back(FieldPath::FromServerFormat(util::MakeString(proto.fieldPath)), - ServerTimestampTransform()); - break; - } - - case GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_AppendMissingElements: { - std::vector elements = - [self decodedArrayTransformElements:proto.appendMissingElements]; - fieldTransforms.emplace_back( - FieldPath::FromServerFormat(util::MakeString(proto.fieldPath)), - ArrayTransform(TransformOperation::Type::ArrayUnion, std::move(elements))); - break; - } - - case GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_RemoveAllFromArray_p: { - std::vector elements = - [self decodedArrayTransformElements:proto.removeAllFromArray_p]; - fieldTransforms.emplace_back( - FieldPath::FromServerFormat(util::MakeString(proto.fieldPath)), - ArrayTransform(TransformOperation::Type::ArrayRemove, std::move(elements))); - break; - } - - case GCFSDocumentTransform_FieldTransform_TransformType_OneOfCase_Increment: { - FieldValue operand = [self decodedFieldValue:proto.increment]; - fieldTransforms.emplace_back(FieldPath::FromServerFormat(util::MakeString(proto.fieldPath)), - NumericIncrementTransform(std::move(operand))); - break; - } - - default: - HARD_FAIL("Unknown transform: %s", proto); - } - } - - return fieldTransforms; -} - -- (std::vector)decodedArrayTransformElements:(GCFSArrayValue *)proto { - __block std::vector elements; - [proto.valuesArray enumerateObjectsUsingBlock:^(GCFSValue *value, NSUInteger, BOOL *) { - elements.push_back([self decodedFieldValue:value]); - }]; - return elements; -} - -#pragma mark - MutationResult <= GCFSWriteResult proto - -- (MutationResult)decodedMutationResult:(GCFSWriteResult *)mutation - commitVersion:(const SnapshotVersion &)commitVersion { - // NOTE: Deletes don't have an updateTime. Use commitVersion instead. - SnapshotVersion version = - mutation.hasUpdateTime ? [self decodedVersion:mutation.updateTime] : commitVersion; - absl::optional> transformResults; - if (mutation.transformResultsArray.count > 0) { - transformResults = std::vector{}; - for (GCFSValue *result in mutation.transformResultsArray) { - transformResults->push_back([self decodedFieldValue:result]); - } - } - return MutationResult(std::move(version), std::move(transformResults)); -} - -#pragma mark - QueryData => GCFSTarget proto - -- (nullable NSMutableDictionary *)encodedListenRequestLabelsForQueryData: - (const QueryData &)queryData { - NSString *value = [self encodedLabelForPurpose:queryData.purpose()]; - if (!value) { - return nil; - } - - NSMutableDictionary *result = - [NSMutableDictionary dictionaryWithCapacity:1]; - [result setObject:value forKey:@"goog-listen-tags"]; - return result; -} - -- (nullable NSString *)encodedLabelForPurpose:(QueryPurpose)purpose { - switch (purpose) { - case QueryPurpose::Listen: - return nil; - case QueryPurpose::ExistenceFilterMismatch: - return @"existence-filter-mismatch"; - case QueryPurpose::LimboResolution: - return @"limbo-document"; - default: - HARD_FAIL("Unrecognized query purpose: %s", purpose); - } -} - -- (GCFSTarget *)encodedTarget:(const QueryData &)queryData { - GCFSTarget *result = [GCFSTarget message]; - const Query &query = queryData.query(); - - if (query.IsDocumentQuery()) { - result.documents = [self encodedDocumentsTarget:query]; - } else { - result.query = [self encodedQueryTarget:query]; - } - - result.targetId = queryData.target_id(); - result.resumeToken = MakeNullableNSData(queryData.resume_token()); - - return result; -} - -- (GCFSTarget_DocumentsTarget *)encodedDocumentsTarget:(const Query &)query { - GCFSTarget_DocumentsTarget *result = [GCFSTarget_DocumentsTarget message]; - NSMutableArray *docs = result.documentsArray; - [docs addObject:[self encodedQueryPath:query.path()]]; - return result; -} - -- (Query)decodedQueryFromDocumentsTarget:(GCFSTarget_DocumentsTarget *)target { - NSArray *documents = target.documentsArray; - HARD_ASSERT(documents.count == 1, "DocumentsTarget contained other than 1 document %s", - (unsigned long)documents.count); - - NSString *name = documents[0]; - return Query([self decodedQueryPath:name]); -} - -- (GCFSTarget_QueryTarget *)encodedQueryTarget:(const Query &)query { - // Dissect the path into parent, collectionId, and optional key filter. - GCFSTarget_QueryTarget *queryTarget = [GCFSTarget_QueryTarget message]; - const ResourcePath &path = query.path(); - if (query.collection_group()) { - HARD_ASSERT(path.size() % 2 == 0, - "Collection group queries should be within a document path or root."); - queryTarget.parent = [self encodedQueryPath:path]; - GCFSStructuredQuery_CollectionSelector *from = [GCFSStructuredQuery_CollectionSelector message]; - from.collectionId = util::MakeNSString(query.collection_group()); - from.allDescendants = YES; - [queryTarget.structuredQuery.fromArray addObject:from]; - } else { - HARD_ASSERT(path.size() % 2 != 0, "Document queries with filters are not supported."); - queryTarget.parent = [self encodedQueryPath:path.PopLast()]; - GCFSStructuredQuery_CollectionSelector *from = [GCFSStructuredQuery_CollectionSelector message]; - from.collectionId = util::MakeNSString(path.last_segment()); - [queryTarget.structuredQuery.fromArray addObject:from]; - } - - // Encode the filters. - GCFSStructuredQuery_Filter *_Nullable where = [self encodedFilters:query.filters()]; - if (where) { - queryTarget.structuredQuery.where = where; - } - - NSArray *orders = [self encodedSortOrders:query.order_bys()]; - if (orders.count) { - [queryTarget.structuredQuery.orderByArray addObjectsFromArray:orders]; - } - - if (query.limit() != Query::kNoLimit) { - queryTarget.structuredQuery.limit.value = query.limit(); - } - - if (query.start_at()) { - queryTarget.structuredQuery.startAt = [self encodedBound:*query.start_at()]; - } - - if (query.end_at()) { - queryTarget.structuredQuery.endAt = [self encodedBound:*query.end_at()]; - } - - return queryTarget; -} - -- (Query)decodedQueryFromQueryTarget:(GCFSTarget_QueryTarget *)target { - ResourcePath path = [self decodedQueryPath:target.parent]; - - GCFSStructuredQuery *query = target.structuredQuery; - CollectionGroupId collectionGroup; - NSUInteger fromCount = query.fromArray_Count; - if (fromCount > 0) { - HARD_ASSERT(fromCount == 1, - "StructuredQuery.from with more than one collection is not supported."); - - GCFSStructuredQuery_CollectionSelector *from = query.fromArray[0]; - if (from.allDescendants) { - collectionGroup = util::MakeStringPtr(from.collectionId); - } else { - path = path.Append(util::MakeString(from.collectionId)); - } - } - - FilterList filterBy; - if (query.hasWhere) { - filterBy = [self decodedFilters:query.where]; - } - - OrderByList orderBy; - if (query.orderByArray_Count > 0) { - orderBy = [self decodedSortOrders:query.orderByArray]; - } - - int32_t limit = Query::kNoLimit; - if (query.hasLimit) { - limit = query.limit.value; - } - - std::shared_ptr startAt; - if (query.hasStartAt) { - startAt = [self decodedBound:query.startAt]; - } - - std::shared_ptr endAt; - if (query.hasEndAt) { - endAt = [self decodedBound:query.endAt]; - } - - return Query(std::move(path), std::move(collectionGroup), std::move(filterBy), std::move(orderBy), - limit, std::move(startAt), std::move(endAt)); -} - -#pragma mark Filters - -- (GCFSStructuredQuery_Filter *_Nullable)encodedFilters:(const FilterList &)filters { - if (filters.empty()) { - return nil; - } - NSMutableArray *protos = [NSMutableArray array]; - for (const auto &filter : filters) { - if (filter.IsAFieldFilter()) { - [protos addObject:[self encodedUnaryOrFieldFilter:FieldFilter(filter)]]; - } - } - if (protos.count == 1) { - // Special case: no existing filters and we only need to add one filter. This can be made the - // single root filter without a composite filter. - return protos[0]; - } - GCFSStructuredQuery_Filter *composite = [GCFSStructuredQuery_Filter message]; - composite.compositeFilter.op = GCFSStructuredQuery_CompositeFilter_Operator_And; - composite.compositeFilter.filtersArray = protos; - return composite; -} - -- (FilterList)decodedFilters:(GCFSStructuredQuery_Filter *)proto { - FilterList result; - - NSArray *filters; - if (proto.filterTypeOneOfCase == - GCFSStructuredQuery_Filter_FilterType_OneOfCase_CompositeFilter) { - HARD_ASSERT(proto.compositeFilter.op == GCFSStructuredQuery_CompositeFilter_Operator_And, - "Only AND-type composite filters are supported, got %s", proto.compositeFilter.op); - filters = proto.compositeFilter.filtersArray; - } else { - filters = @[ proto ]; - } - - result = result.reserve(filters.count); - for (GCFSStructuredQuery_Filter *filter in filters) { - switch (filter.filterTypeOneOfCase) { - case GCFSStructuredQuery_Filter_FilterType_OneOfCase_CompositeFilter: - HARD_FAIL("Nested composite filters are not supported"); - - case GCFSStructuredQuery_Filter_FilterType_OneOfCase_FieldFilter: - result = result.push_back([self decodedFieldFilter:filter.fieldFilter]); - break; - - case GCFSStructuredQuery_Filter_FilterType_OneOfCase_UnaryFilter: - result = result.push_back([self decodedUnaryFilter:filter.unaryFilter]); - break; - - default: - HARD_FAIL("Unrecognized Filter.filterType %s", filter.filterTypeOneOfCase); - } - } - return result; -} - -- (GCFSStructuredQuery_Filter *)encodedUnaryOrFieldFilter:(const FieldFilter &)filter { - GCFSStructuredQuery_Filter *proto = [GCFSStructuredQuery_Filter message]; - - if (filter.op() == Operator::Equal) { - if (filter.value().is_null()) { - proto.unaryFilter.field = [self encodedFieldPath:filter.field()]; - proto.unaryFilter.op = GCFSStructuredQuery_UnaryFilter_Operator_IsNull; - return proto; - } - - if (filter.value().is_nan()) { - proto.unaryFilter.field = [self encodedFieldPath:filter.field()]; - proto.unaryFilter.op = GCFSStructuredQuery_UnaryFilter_Operator_IsNan; - return proto; - } - } - - GCFSStructuredQuery_FieldFilter *fieldFilter = proto.fieldFilter; - fieldFilter.field = [self encodedFieldPath:filter.field()]; - fieldFilter.op = [self encodedFieldFilterOperator:filter.op()]; - fieldFilter.value = [self encodedFieldValue:filter.value()]; - return proto; -} - -- (const FieldFilter)decodedFieldFilter:(GCFSStructuredQuery_FieldFilter *)proto { - FieldPath fieldPath = FieldPath::FromServerFormat(util::MakeString(proto.field.fieldPath)); - Filter::Operator op = [self decodedFieldFilterOperator:proto.op]; - FieldValue value = [self decodedFieldValue:proto.value]; - return FieldFilter::Create(std::move(fieldPath), op, std::move(value)); -} - -- (FieldFilter)decodedUnaryFilter:(GCFSStructuredQuery_UnaryFilter *)proto { - FieldPath field = FieldPath::FromServerFormat(util::MakeString(proto.field.fieldPath)); - switch (proto.op) { - case GCFSStructuredQuery_UnaryFilter_Operator_IsNull: - return FieldFilter::Create(std::move(field), Operator::Equal, FieldValue::Null()); - - case GCFSStructuredQuery_UnaryFilter_Operator_IsNan: - return FieldFilter::Create(std::move(field), Operator::Equal, FieldValue::Nan()); - - default: - HARD_FAIL("Unrecognized UnaryFilter.operator %s", proto.op); - } -} - -- (GCFSStructuredQuery_FieldReference *)encodedFieldPath:(const FieldPath &)fieldPath { - GCFSStructuredQuery_FieldReference *ref = [GCFSStructuredQuery_FieldReference message]; - ref.fieldPath = util::MakeNSString(fieldPath.CanonicalString()); - return ref; -} - -- (GCFSStructuredQuery_FieldFilter_Operator)encodedFieldFilterOperator: - (Filter::Operator)filterOperator { - switch (filterOperator) { - case Filter::Operator::LessThan: - return GCFSStructuredQuery_FieldFilter_Operator_LessThan; - case Filter::Operator::LessThanOrEqual: - return GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual; - case Filter::Operator::Equal: - return GCFSStructuredQuery_FieldFilter_Operator_Equal; - case Filter::Operator::GreaterThanOrEqual: - return GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual; - case Filter::Operator::GreaterThan: - return GCFSStructuredQuery_FieldFilter_Operator_GreaterThan; - case Filter::Operator::ArrayContains: - return GCFSStructuredQuery_FieldFilter_Operator_ArrayContains; - case Filter::Operator::In: - return GCFSStructuredQuery_FieldFilter_Operator_In; - case Filter::Operator::ArrayContainsAny: - return GCFSStructuredQuery_FieldFilter_Operator_ArrayContainsAny; - default: - HARD_FAIL("Unhandled Filter::Operator: %s", filterOperator); - } -} - -- (Filter::Operator)decodedFieldFilterOperator: - (GCFSStructuredQuery_FieldFilter_Operator)filterOperator { - switch (filterOperator) { - case GCFSStructuredQuery_FieldFilter_Operator_LessThan: - return Filter::Operator::LessThan; - case GCFSStructuredQuery_FieldFilter_Operator_LessThanOrEqual: - return Filter::Operator::LessThanOrEqual; - case GCFSStructuredQuery_FieldFilter_Operator_Equal: - return Filter::Operator::Equal; - case GCFSStructuredQuery_FieldFilter_Operator_GreaterThanOrEqual: - return Filter::Operator::GreaterThanOrEqual; - case GCFSStructuredQuery_FieldFilter_Operator_GreaterThan: - return Filter::Operator::GreaterThan; - case GCFSStructuredQuery_FieldFilter_Operator_ArrayContains: - return Filter::Operator::ArrayContains; - case GCFSStructuredQuery_FieldFilter_Operator_In: - return Filter::Operator::In; - case GCFSStructuredQuery_FieldFilter_Operator_ArrayContainsAny: - return Filter::Operator::ArrayContainsAny; - default: - HARD_FAIL("Unhandled FieldFilter.operator: %s", filterOperator); - } -} - -#pragma mark Property Orders - -- (NSArray *)encodedSortOrders:(const OrderByList &)orders { - NSMutableArray *protos = [NSMutableArray array]; - for (const OrderBy &order : orders) { - [protos addObject:[self encodedSortOrder:order]]; - } - return protos; -} - -- (OrderByList)decodedSortOrders:(NSArray *)protos { - OrderByList result; - result = result.reserve(protos.count); - for (GCFSStructuredQuery_Order *orderProto in protos) { - result = result.push_back([self decodedSortOrder:orderProto]); - } - return result; -} - -- (GCFSStructuredQuery_Order *)encodedSortOrder:(const OrderBy &)sortOrder { - GCFSStructuredQuery_Order *proto = [GCFSStructuredQuery_Order message]; - proto.field = [self encodedFieldPath:sortOrder.field()]; - if (sortOrder.ascending()) { - proto.direction = GCFSStructuredQuery_Direction_Ascending; - } else { - proto.direction = GCFSStructuredQuery_Direction_Descending; - } - return proto; -} - -- (OrderBy)decodedSortOrder:(GCFSStructuredQuery_Order *)proto { - FieldPath fieldPath = FieldPath::FromServerFormat(util::MakeString(proto.field.fieldPath)); - Direction direction; - switch (proto.direction) { - case GCFSStructuredQuery_Direction_Ascending: - direction = Direction::Ascending; - break; - case GCFSStructuredQuery_Direction_Descending: - direction = Direction::Descending; - break; - default: - HARD_FAIL("Unrecognized GCFSStructuredQuery_Direction %s", proto.direction); - } - return OrderBy(std::move(fieldPath), direction); -} - -#pragma mark - Bounds/Cursors - -- (GCFSCursor *)encodedBound:(const Bound &)bound { - GCFSCursor *proto = [GCFSCursor message]; - proto.before = bound.before(); - for (const FieldValue &fieldValue : bound.position()) { - GCFSValue *value = [self encodedFieldValue:fieldValue]; - [proto.valuesArray addObject:value]; - } - return proto; -} - -- (std::shared_ptr)decodedBound:(GCFSCursor *)proto { - std::vector indexComponents; - - for (GCFSValue *valueProto in proto.valuesArray) { - FieldValue value = [self decodedFieldValue:valueProto]; - indexComponents.push_back(std::move(value)); - } - - return std::make_shared(std::move(indexComponents), proto.before); -} - -#pragma mark - WatchChange <= GCFSListenResponse proto - -- (std::unique_ptr)decodedWatchChange:(GCFSListenResponse *)watchChange { - switch (watchChange.responseTypeOneOfCase) { - case GCFSListenResponse_ResponseType_OneOfCase_TargetChange: - return [self decodedTargetChangeFromWatchChange:watchChange.targetChange]; - - case GCFSListenResponse_ResponseType_OneOfCase_DocumentChange: - return [self decodedDocumentChange:watchChange.documentChange]; - - case GCFSListenResponse_ResponseType_OneOfCase_DocumentDelete: - return [self decodedDocumentDelete:watchChange.documentDelete]; - - case GCFSListenResponse_ResponseType_OneOfCase_DocumentRemove: - return [self decodedDocumentRemove:watchChange.documentRemove]; - - case GCFSListenResponse_ResponseType_OneOfCase_Filter: - return [self decodedExistenceFilterWatchChange:watchChange.filter]; - - default: - HARD_FAIL("Unknown WatchChange.changeType %s", watchChange.responseTypeOneOfCase); - } -} - -- (SnapshotVersion)versionFromListenResponse:(GCFSListenResponse *)watchChange { - // We have only reached a consistent snapshot for the entire stream if there is a read_time set - // and it applies to all targets (i.e. the list of targets is empty). The backend is guaranteed to - // send such responses. - if (watchChange.responseTypeOneOfCase != GCFSListenResponse_ResponseType_OneOfCase_TargetChange) { - return SnapshotVersion::None(); - } - if (watchChange.targetChange.targetIdsArray.count != 0) { - return SnapshotVersion::None(); - } - return [self decodedVersion:watchChange.targetChange.readTime]; -} - -- (std::unique_ptr)decodedTargetChangeFromWatchChange:(GCFSTargetChange *)change { - WatchTargetChangeState state = [self decodedWatchTargetChangeState:change.targetChangeType]; - __block std::vector targetIDs; - - [change.targetIdsArray enumerateValuesWithBlock:^(int32_t value, NSUInteger, BOOL *) { - targetIDs.push_back(value); - }]; - - ByteString resumeToken = MakeByteString(change.resumeToken); - - util::Status cause; - if (change.hasCause) { - cause = - util::Status{static_cast(change.cause.code), util::MakeString(change.cause.message)}; - } - - return absl::make_unique(state, std::move(targetIDs), std::move(resumeToken), - std::move(cause)); -} - -- (WatchTargetChangeState)decodedWatchTargetChangeState:(GCFSTargetChange_TargetChangeType)state { - switch (state) { - case GCFSTargetChange_TargetChangeType_NoChange: - return WatchTargetChangeState::NoChange; - case GCFSTargetChange_TargetChangeType_Add: - return WatchTargetChangeState::Added; - case GCFSTargetChange_TargetChangeType_Remove: - return WatchTargetChangeState::Removed; - case GCFSTargetChange_TargetChangeType_Current: - return WatchTargetChangeState::Current; - case GCFSTargetChange_TargetChangeType_Reset: - return WatchTargetChangeState::Reset; - default: - HARD_FAIL("Unexpected TargetChange.state: %s", state); - } -} - -- (std::vector)decodedIntegerArray:(GPBInt32Array *)values { - __block std::vector result; - result.reserve(values.count); - [values enumerateValuesWithBlock:^(int32_t value, NSUInteger, BOOL *) { - result.push_back(value); - }]; - return result; -} - -- (std::unique_ptr)decodedDocumentChange:(GCFSDocumentChange *)change { - ObjectValue value = [self decodedFields:change.document.fields]; - DocumentKey key = [self decodedDocumentKey:change.document.name]; - SnapshotVersion version = [self decodedVersion:change.document.updateTime]; - HARD_ASSERT(version != SnapshotVersion::None(), "Got a document change with no snapshot version"); - // The document may soon be re-serialized back to protos in order to store it in local - // persistence. Memoize the encoded form to avoid encoding it again. - Document document(std::move(value), key, version, DocumentState::kSynced, Wrap(change.document)); - - std::vector updatedTargetIDs = [self decodedIntegerArray:change.targetIdsArray]; - std::vector removedTargetIDs = [self decodedIntegerArray:change.removedTargetIdsArray]; - - return absl::make_unique(std::move(updatedTargetIDs), - std::move(removedTargetIDs), std::move(key), - std::move(document)); -} - -- (std::unique_ptr)decodedDocumentDelete:(GCFSDocumentDelete *)change { - DocumentKey key = [self decodedDocumentKey:change.document]; - // Note that version might be unset in which case we use SnapshotVersion::None() - SnapshotVersion version = [self decodedVersion:change.readTime]; - NoDocument document(key, version, /* has_committed_mutations= */ false); - - std::vector removedTargetIDs = [self decodedIntegerArray:change.removedTargetIdsArray]; - - return absl::make_unique( - std::vector{}, std::move(removedTargetIDs), std::move(key), std::move(document)); -} - -- (std::unique_ptr)decodedDocumentRemove:(GCFSDocumentRemove *)change { - DocumentKey key = [self decodedDocumentKey:change.document]; - std::vector removedTargetIDs = [self decodedIntegerArray:change.removedTargetIdsArray]; - - return absl::make_unique( - std::vector{}, std::move(removedTargetIDs), std::move(key), absl::nullopt); -} - -- (std::unique_ptr)decodedExistenceFilterWatchChange:(GCFSExistenceFilter *)filter { - ExistenceFilter existenceFilter{filter.count}; - TargetId targetID = filter.targetId; - return absl::make_unique(existenceFilter, targetID); -} - -@end - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/Source/Util/FSTClasses.h b/Pods/FirebaseFirestore/Firestore/Source/Util/FSTClasses.h deleted file mode 100644 index 79d67c49d..000000000 --- a/Pods/FirebaseFirestore/Firestore/Source/Util/FSTClasses.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -NS_ASSUME_NONNULL_BEGIN - -// A convenience macro for unimplemented methods. Use as follows: -// -// @throw FSTAbstractMethodException(); // NOLINT -#define FSTAbstractMethodException() \ - [NSException exceptionWithName:NSInternalInconsistencyException \ - reason:[NSString stringWithFormat:@"You must override %s in a subclass", \ - __func__] \ - userInfo:nil]; - -// Declare a weak pointer to the given variable -#define FSTWeakify(var) __weak __typeof__(var) fstWeakPointerTo##var = var; - -// Declare a strong pointer to a variable that's been FSTWeakified. This creates a shadow of the -// original. -#define FSTStrongify(var) \ - _Pragma("clang diagnostic push") _Pragma("clang diagnostic ignored \"-Wshadow\"") \ - __strong __typeof__(var) var = fstWeakPointerTo##var; \ - _Pragma("clang diagnostic pop") - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h b/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h index 339a88f91..6af214a08 100644 --- a/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h +++ b/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_errors.h @@ -28,13 +28,15 @@ namespace firestore { enum Error { /** The operation completed successfully. */ // Note: NSError objects will never have a code with this value. - Ok = 0, + kErrorOk = 0, + + kErrorNone = 0, /** The operation was cancelled (typically by the caller). */ - Cancelled = 1, + kErrorCancelled = 1, /** Unknown error or an error from a different error domain. */ - Unknown = 2, + kErrorUnknown = 2, /** * Client specified an invalid argument. Note that this differs from @@ -42,7 +44,7 @@ enum Error { * problematic regardless of the state of the system (e.g., an invalid field * name). */ - InvalidArgument = 3, + kErrorInvalidArgument = 3, /** * Deadline expired before operation could complete. For operations that @@ -51,59 +53,61 @@ enum Error { * from a server could have been delayed long enough for the deadline to * expire. */ - DeadlineExceeded = 4, + kErrorDeadlineExceeded = 4, /** Some requested document was not found. */ - NotFound = 5, + kErrorNotFound = 5, /** Some document that we attempted to create already exists. */ - AlreadyExists = 6, + kErrorAlreadyExists = 6, /** The caller does not have permission to execute the specified operation. */ - PermissionDenied = 7, + kErrorPermissionDenied = 7, /** * Some resource has been exhausted, perhaps a per-user quota, or perhaps the * entire file system is out of space. */ - ResourceExhausted = 8, + kErrorResourceExhausted = 8, /** * Operation was rejected because the system is not in a state required for * the operation's execution. */ - FailedPrecondition = 9, + kErrorFailedPrecondition = 9, /** * The operation was aborted, typically due to a concurrency issue like * transaction aborts, etc. */ - Aborted = 10, + kErrorAborted = 10, /** Operation was attempted past the valid range. */ - OutOfRange = 11, + kErrorOutOfRange = 11, /** Operation is not implemented or not supported/enabled. */ - Unimplemented = 12, + kErrorUnimplemented = 12, /** * Internal errors. Means some invariants expected by underlying system has * been broken. If you see one of these errors, something is very broken. */ - Internal = 13, + kErrorInternal = 13, /** * The service is currently unavailable. This is a most likely a transient * condition and may be corrected by retrying with a backoff. */ - Unavailable = 14, + kErrorUnavailable = 14, /** Unrecoverable data loss or corruption. */ - DataLoss = 15, + kErrorDataLoss = 15, - /** The request does not have valid authentication credentials for the - operation. */ - Unauthenticated = 16 + /** + * The request does not have valid authentication credentials for the + * operation. + */ + kErrorUnauthenticated = 16 }; } // namespace firestore diff --git a/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h b/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h index 718304045..627ead9e3 100644 --- a/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h +++ b/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/firestore_version.h @@ -17,8 +17,6 @@ #ifndef FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_VERSION_H_ #define FIRESTORE_CORE_INCLUDE_FIREBASE_FIRESTORE_FIRESTORE_VERSION_H_ -/** Version for Firestore. */ - namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h b/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h index 49c60d336..e806bb87c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h +++ b/Pods/FirebaseFirestore/Firestore/core/include/firebase/firestore/timestamp.h @@ -212,6 +212,15 @@ inline bool operator==(const Timestamp& lhs, const Timestamp& rhs) { } #if !defined(_STLPORT_VERSION) + +// Make sure the header compiles even when included after `` without +// `NOMINMAX` defined. `push/pop_macro` pragmas are supported by Visual Studio +// as well as Clang and GCC. +#pragma push_macro("min") +#pragma push_macro("max") +#undef min +#undef max + template std::chrono::time_point Timestamp::ToTimePoint() const { namespace chr = std::chrono; @@ -232,6 +241,10 @@ std::chrono::time_point Timestamp::ToTimePoint() const { chr::duration_cast(chr::nanoseconds(nanoseconds_)); return TimePoint{seconds + nanoseconds}; } + +#pragma pop_macro("max") +#pragma pop_macro("min") + #endif // !defined(_STLPORT_VERSION) } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/api_fwd.h b/Pods/FirebaseFirestore/Firestore/core/src/api/api_fwd.h new file mode 100644 index 000000000..5456c53d7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/api_fwd.h @@ -0,0 +1,56 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_API_FWD_H_ +#define FIRESTORE_CORE_SRC_API_API_FWD_H_ + +#include + +namespace firebase { +namespace firestore { + +namespace core { +template +class EventListener; +} // namespace core + +namespace api { + +class CollectionReference; +class DocumentChange; +class DocumentReference; +class DocumentSnapshot; +class Firestore; +class ListenerRegistration; +class Query; +class QuerySnapshot; +class Settings; +class SnapshotMetadata; +class WriteBatch; + +enum class Source; + +using DocumentSnapshotListener = + std::unique_ptr>; + +using QuerySnapshotListener = + std::unique_ptr>; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_API_FWD_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/collection_reference.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.cc similarity index 80% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/collection_reference.cc rename to Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.cc index 63f6bec41..a6d8f7319 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/collection_reference.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.cc @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/api/collection_reference.h" +#include "Firestore/core/src/api/collection_reference.h" #include -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/autoid.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/autoid.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/string_apple.h" namespace firebase { namespace firestore { @@ -34,6 +34,7 @@ namespace { using core::Query; using model::DocumentKey; using model::ResourcePath; +using util::ThrowInvalidArgument; Query MakeQuery(model::ResourcePath path) { if (path.size() % 2 != 1) { @@ -62,7 +63,7 @@ size_t CollectionReference::Hash() const { return util::Hash(firestore().get(), query()); } -std::string CollectionReference::collection_id() const { +const std::string& CollectionReference::collection_id() const { return query().path().last_segment(); } @@ -80,7 +81,7 @@ std::string CollectionReference::path() const { } DocumentReference CollectionReference::Document( - absl::string_view document_path) const { + const std::string& document_path) const { ResourcePath sub_path = ResourcePath::FromString(document_path); ResourcePath path = query().path().Append(sub_path); return DocumentReference(std::move(path), firestore()); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/collection_reference.h b/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/collection_reference.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.h index f8f11ac4e..911681741 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/collection_reference.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/collection_reference.h @@ -14,28 +14,26 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_COLLECTION_REFERENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_COLLECTION_REFERENCE_H_ +#ifndef FIRESTORE_CORE_SRC_API_COLLECTION_REFERENCE_H_ +#define FIRESTORE_CORE_SRC_API_COLLECTION_REFERENCE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/api/query_core.h" -#include "absl/strings/string_view.h" +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/api/query_core.h" +#include "Firestore/core/src/core/core_fwd.h" #include "absl/types/optional.h" namespace firebase { namespace firestore { -namespace core { -class ParsedSetData; - -} // namespace core +namespace model { +class ResourcePath; +} // namespace model namespace api { -class DocumentReference; - /** * A `CollectionReference` object can be used for adding documents, getting * document references, and querying for documents (using the methods inherited @@ -48,7 +46,7 @@ class CollectionReference : public Query { std::shared_ptr firestore); /** ID of the referenced collection. */ - std::string collection_id() const; + const std::string& collection_id() const; /** * For subcollections, `parent` returns the containing `DocumentReference`. @@ -77,7 +75,7 @@ class CollectionReference : public Query { * * @return The `DocumentReference` for the specified document path. */ - DocumentReference Document(absl::string_view document_path) const; + DocumentReference Document(const std::string& document_path) const; /** * Add a new document to this collection with the specified data, assigning it @@ -103,4 +101,4 @@ bool operator==(const CollectionReference& lhs, const CollectionReference& rhs); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_COLLECTION_REFERENCE_H_ +#endif // FIRESTORE_CORE_SRC_API_COLLECTION_REFERENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_change.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_change.cc rename to Pods/FirebaseFirestore/Firestore/core/src/api/document_change.cc index 55c076d58..fa749d396 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_change.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/api/document_change.h" +#include "Firestore/core/src/api/document_change.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_change.h b/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.h similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_change.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/document_change.h index 36fdf569f..2c7981e3d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_change.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/document_change.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_CHANGE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_CHANGE_H_ +#ifndef FIRESTORE_CORE_SRC_API_DOCUMENT_CHANGE_H_ +#define FIRESTORE_CORE_SRC_API_DOCUMENT_CHANGE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" +#include "Firestore/core/src/api/document_snapshot.h" namespace firebase { namespace firestore { @@ -83,4 +83,4 @@ bool operator==(const DocumentChange& lhs, const DocumentChange& rhs); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_CHANGE_H_ +#endif // FIRESTORE_CORE_SRC_API_DOCUMENT_CHANGE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.cc new file mode 100644 index 000000000..74a113fa3 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.cc @@ -0,0 +1,254 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/api/document_reference.h" + +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/api/collection_reference.h" +#include "Firestore/core/src/api/document_snapshot.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/api/query_listener_registration.h" +#include "Firestore/core/src/api/source.h" +#include "Firestore/core/src/core/firestore_client.h" +#include "Firestore/core/src/core/listen_options.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/delete_mutation.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" + +namespace firebase { +namespace firestore { +namespace api { + +using core::AsyncEventListener; +using core::EventListener; +using core::ListenOptions; +using core::QueryListener; +using core::ViewSnapshot; +using model::DeleteMutation; +using model::Document; +using model::DocumentKey; +using model::Precondition; +using model::ResourcePath; +using util::Status; +using util::StatusOr; +using util::StatusOrCallback; + +DocumentReference::DocumentReference(model::ResourcePath path, + std::shared_ptr firestore) + : firestore_{std::move(firestore)} { + if (path.size() % 2 != 0) { + HARD_FAIL( + "Invalid document reference. Document references must have an even " + "number of segments, but %s has %s", + path.CanonicalString(), path.size()); + } + key_ = DocumentKey{std::move(path)}; +} + +size_t DocumentReference::Hash() const { + return util::Hash(firestore_.get(), key_); +} + +const std::string& DocumentReference::document_id() const { + return key_.path().last_segment(); +} + +CollectionReference DocumentReference::Parent() const { + return CollectionReference{key_.path().PopLast(), firestore_}; +} + +std::string DocumentReference::Path() const { + return key_.path().CanonicalString(); +} + +CollectionReference DocumentReference::GetCollectionReference( + const std::string& collection_path) const { + ResourcePath sub_path = ResourcePath::FromString(collection_path); + ResourcePath path = key_.path().Append(sub_path); + return CollectionReference{path, firestore_}; +} + +void DocumentReference::SetData(core::ParsedSetData&& set_data, + util::StatusCallback callback) { + firestore_->client()->WriteMutations( + std::move(set_data).ToMutations(key(), Precondition::None()), + std::move(callback)); +} + +void DocumentReference::UpdateData(core::ParsedUpdateData&& update_data, + util::StatusCallback callback) { + firestore_->client()->WriteMutations( + std::move(update_data).ToMutations(key(), Precondition::Exists(true)), + std::move(callback)); +} + +void DocumentReference::DeleteDocument(util::StatusCallback callback) { + DeleteMutation mutation(key_, Precondition::None()); + firestore_->client()->WriteMutations({mutation}, std::move(callback)); +} + +void DocumentReference::GetDocument(Source source, + DocumentSnapshotListener&& callback) { + if (source == Source::Cache) { + firestore_->client()->GetDocumentFromLocalCache(*this, std::move(callback)); + return; + } + + ListenOptions options( + /*include_query_metadata_changes=*/true, + /*include_document_metadata_changes=*/true, + /*wait_for_sync_when_online=*/true); + + class ListenOnce : public EventListener { + public: + ListenOnce(Source source, DocumentSnapshotListener&& listener) + : source_(source), listener_(std::move(listener)) { + } + + void OnEvent(StatusOr maybe_snapshot) override { + if (!maybe_snapshot.ok()) { + listener_->OnEvent(std::move(maybe_snapshot)); + return; + } + + DocumentSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); + + // Remove query first before passing event to user to avoid user actions + // affecting the now stale query. + std::unique_ptr registration = + registration_promise_.get_future().get(); + registration->Remove(); + + if (!snapshot.exists() && snapshot.metadata().from_cache()) { + // TODO(dimond): Reconsider how to raise missing documents when + // offline. If we're online and the document doesn't exist then we + // call the callback with a document with document.exists set to + // false. If we're offline however, we call the callback + // with an error. Two options: 1) Cache the negative response from the + // server so we can deliver that even when you're offline. + // 2) Actually call the callback with an error if the + // document doesn't exist when you are offline. + listener_->OnEvent( + Status{Error::kErrorUnavailable, + "Failed to get document because the client is offline."}); + } else if (snapshot.exists() && snapshot.metadata().from_cache() && + source_ == Source::Server) { + listener_->OnEvent( + Status{Error::kErrorUnavailable, + "Failed to get document from server. (However, " + "this document does exist in the local cache. Run " + "again without setting source to " + "FirestoreSourceServer to retrieve the cached " + "document.)"}); + } else { + listener_->OnEvent(std::move(snapshot)); + } + } + + void Resolve(std::unique_ptr registration) { + registration_promise_.set_value(std::move(registration)); + } + + private: + Source source_; + DocumentSnapshotListener listener_; + + std::promise> registration_promise_; + }; + auto listener = absl::make_unique(source, std::move(callback)); + auto listener_unowned = listener.get(); + + std::unique_ptr registration = + AddSnapshotListener(std::move(options), std::move(listener)); + + listener_unowned->Resolve(std::move(registration)); +} + +std::unique_ptr DocumentReference::AddSnapshotListener( + ListenOptions options, DocumentSnapshotListener&& user_listener) { + // Convert from ViewSnapshots to DocumentSnapshots. + class Converter : public EventListener { + public: + Converter(DocumentReference* parent, + DocumentSnapshotListener&& user_listener) + : firestore_(parent->firestore_), + key_(parent->key_), + user_listener_(std::move(user_listener)) { + } + + void OnEvent(StatusOr maybe_snapshot) override { + if (!maybe_snapshot.ok()) { + user_listener_->OnEvent(maybe_snapshot.status()); + return; + } + + ViewSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); + HARD_ASSERT(snapshot.documents().size() <= 1, + "Too many documents returned on a document query"); + absl::optional document = + snapshot.documents().GetDocument(key_); + + bool has_pending_writes = + document ? snapshot.mutated_keys().contains(key_) + // We don't raise `has_pending_writes` for deleted documents. + : false; + + DocumentSnapshot result{ + firestore_, key_, document, + SnapshotMetadata{has_pending_writes, snapshot.from_cache()}}; + user_listener_->OnEvent(std::move(result)); + } + + private: + std::shared_ptr firestore_; + DocumentKey key_; + DocumentSnapshotListener user_listener_; + }; + auto view_listener = + absl::make_unique(this, std::move(user_listener)); + + // Call the view_listener on the user Executor. + auto async_listener = AsyncEventListener::Create( + firestore_->client()->user_executor(), std::move(view_listener)); + + core::Query query(key_.path()); + std::shared_ptr query_listener = + firestore_->client()->ListenToQuery(std::move(query), options, + async_listener); + + return absl::make_unique( + firestore_->client(), std::move(async_listener), + std::move(query_listener)); +} + +bool operator==(const DocumentReference& lhs, const DocumentReference& rhs) { + return lhs.firestore() == rhs.firestore() && lhs.key() == rhs.key(); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.h b/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.h new file mode 100644 index 000000000..41a6edcf5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/document_reference.h @@ -0,0 +1,89 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_DOCUMENT_REFERENCE_H_ +#define FIRESTORE_CORE_SRC_API_DOCUMENT_REFERENCE_H_ + +#include +#include +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { + +namespace model { +class ResourcePath; +} // namespace model + +namespace api { + +class DocumentReference { + public: + DocumentReference() = default; + DocumentReference(model::ResourcePath path, + std::shared_ptr firestore); + DocumentReference(model::DocumentKey document_key, + std::shared_ptr firestore) + : firestore_{std::move(firestore)}, key_{std::move(document_key)} { + } + + size_t Hash() const; + + const std::shared_ptr& firestore() const { + return firestore_; + } + const model::DocumentKey& key() const { + return key_; + } + + const std::string& document_id() const; + + CollectionReference Parent() const; + + std::string Path() const; + + CollectionReference GetCollectionReference( + const std::string& collection_path) const; + + void SetData(core::ParsedSetData&& set_data, util::StatusCallback callback); + + void UpdateData(core::ParsedUpdateData&& update_data, + util::StatusCallback callback); + + void DeleteDocument(util::StatusCallback callback); + + void GetDocument(Source source, DocumentSnapshotListener&& callback); + + std::unique_ptr AddSnapshotListener( + core::ListenOptions options, DocumentSnapshotListener&& listener); + + private: + std::shared_ptr firestore_; + model::DocumentKey key_; +}; + +bool operator==(const DocumentReference& lhs, const DocumentReference& rhs); + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_DOCUMENT_REFERENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_snapshot.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.cc similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_snapshot.cc rename to Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.cc index ee2f9380c..0f4e4825c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_snapshot.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" +#include "Firestore/core/src/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/objc/objc_compatibility.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hashing.h" #include "absl/types/optional.h" namespace firebase { @@ -32,25 +32,30 @@ using model::FieldPath; using model::FieldValue; using model::ObjectValue; -DocumentSnapshot::DocumentSnapshot(std::shared_ptr firestore, - model::DocumentKey document_key, - absl::optional document, - SnapshotMetadata metadata) - : firestore_{std::move(firestore)}, - internal_key_{std::move(document_key)}, - internal_document_{std::move(document)}, - metadata_{std::move(metadata)} { +DocumentSnapshot DocumentSnapshot::FromDocument( + std::shared_ptr firestore, + model::Document document, + SnapshotMetadata metadata) { + return DocumentSnapshot{std::move(firestore), document.key(), document, + std::move(metadata)}; +} + +DocumentSnapshot DocumentSnapshot::FromNoDocument( + std::shared_ptr firestore, + model::DocumentKey key, + SnapshotMetadata metadata) { + return DocumentSnapshot{std::move(firestore), key, absl::nullopt, + std::move(metadata)}; } DocumentSnapshot::DocumentSnapshot(std::shared_ptr firestore, model::DocumentKey document_key, absl::optional document, - bool from_cache, - bool has_pending_writes) + SnapshotMetadata metadata) : firestore_{std::move(firestore)}, internal_key_{std::move(document_key)}, internal_document_{std::move(document)}, - metadata_{has_pending_writes, from_cache} { + metadata_{std::move(metadata)} { } size_t DocumentSnapshot::Hash() const { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.h b/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.h new file mode 100644 index 000000000..a7da6794e --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/document_snapshot.h @@ -0,0 +1,102 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_DOCUMENT_SNAPSHOT_H_ +#define FIRESTORE_CORE_SRC_API_DOCUMENT_SNAPSHOT_H_ + +#include +#include +#include + +#include "Firestore/core/src/api/snapshot_metadata.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace api { + +class DocumentReference; +class Firestore; + +class DocumentSnapshot { + public: + DocumentSnapshot() = default; + + static DocumentSnapshot FromDocument(std::shared_ptr firestore, + model::Document document, + SnapshotMetadata metadata); + + static DocumentSnapshot FromNoDocument(std::shared_ptr firestore, + model::DocumentKey key, + SnapshotMetadata metadata); + + size_t Hash() const; + + bool exists() const; + const absl::optional& internal_document() const; + const std::string& document_id() const; + + const SnapshotMetadata& metadata() const { + return metadata_; + } + + DocumentReference CreateReference() const; + + absl::optional GetData() const; + absl::optional GetValue( + const model::FieldPath& field_path) const; + + const std::shared_ptr& firestore() const { + return firestore_; + } + + friend bool operator==(const DocumentSnapshot& lhs, + const DocumentSnapshot& rhs); + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class DocumentReference; + + DocumentSnapshot(std::shared_ptr firestore, + model::DocumentKey document_key, + absl::optional document, + SnapshotMetadata metadata); + + private: + std::shared_ptr firestore_; + model::DocumentKey internal_key_; + absl::optional internal_document_; + SnapshotMetadata metadata_; +}; + +using DocumentSnapshotListener = + std::unique_ptr>; + +inline bool operator!=(const DocumentSnapshot& lhs, + const DocumentSnapshot& rhs) { + return !(lhs == rhs); +} + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_DOCUMENT_SNAPSHOT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc new file mode 100644 index 000000000..15145a794 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.cc @@ -0,0 +1,228 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/api/firestore.h" + +#include + +#include "Firestore/core/src/api/collection_reference.h" +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/api/listener_registration.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/api/snapshots_in_sync_listener_registration.h" +#include "Firestore/core/src/api/write_batch.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/firestore_client.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace api { + +using auth::CredentialsProvider; +using core::AsyncEventListener; +using core::DatabaseInfo; +using core::FirestoreClient; +using core::Transaction; +using local::LevelDbPersistence; +using model::DocumentKey; +using model::ResourcePath; +using remote::GrpcConnection; +using util::AsyncQueue; +using util::Empty; +using util::Executor; +using util::Status; + +Firestore::Firestore(model::DatabaseId database_id, + std::string persistence_key, + std::shared_ptr credentials_provider, + std::shared_ptr worker_queue, + void* extension) + : database_id_{std::move(database_id)}, + credentials_provider_{std::move(credentials_provider)}, + persistence_key_{std::move(persistence_key)}, + worker_queue_{std::move(worker_queue)}, + extension_{extension} { +} + +Firestore::~Firestore() { + Dispose(); +} + +void Firestore::Dispose() { + std::lock_guard lock(mutex_); + + // If the client hasn't been configured yet we don't need to create it just + // to tear it down. + if (!client_) return; + + client_->Dispose(); +} + +const std::shared_ptr& Firestore::client() { + HARD_ASSERT(client_, "Client is not yet configured."); + return client_; +} + +const std::shared_ptr& Firestore::worker_queue() { + return worker_queue_; +} + +const Settings& Firestore::settings() const { + std::lock_guard lock{mutex_}; + return settings_; +} + +void Firestore::set_settings(const Settings& settings) { + std::lock_guard lock{mutex_}; + if (client_) { + HARD_FAIL( + "Firestore instance has already been started and its settings can " + "no longer be changed. You can only set settings before calling any " + "other methods on a Firestore instance."); + } + settings_ = settings; +} + +void Firestore::set_user_executor(std::unique_ptr user_executor) { + std::lock_guard lock{mutex_}; + HARD_ASSERT(!client_ && user_executor, + "set_user_executor() must be called with a valid executor, " + "before the client is initialized."); + user_executor_ = std::move(user_executor); +} + +CollectionReference Firestore::GetCollection( + const std::string& collection_path) { + EnsureClientConfigured(); + ResourcePath path = ResourcePath::FromString(collection_path); + return CollectionReference{std::move(path), shared_from_this()}; +} + +DocumentReference Firestore::GetDocument(const std::string& document_path) { + EnsureClientConfigured(); + return DocumentReference{ResourcePath::FromString(document_path), + shared_from_this()}; +} + +WriteBatch Firestore::GetBatch() { + EnsureClientConfigured(); + return WriteBatch(shared_from_this()); +} + +core::Query Firestore::GetCollectionGroup(std::string collection_id) { + EnsureClientConfigured(); + + return core::Query(ResourcePath::Empty(), std::make_shared( + std::move(collection_id))); +} + +void Firestore::RunTransaction( + core::TransactionUpdateCallback update_callback, + core::TransactionResultCallback result_callback) { + EnsureClientConfigured(); + + client_->Transaction(5, std::move(update_callback), + std::move(result_callback)); +} + +void Firestore::Terminate(util::StatusCallback callback) { + // The client must be initialized to ensure that all subsequent API usage + // throws an exception. + EnsureClientConfigured(); + client_->TerminateAsync(std::move(callback)); +} + +void Firestore::WaitForPendingWrites(util::StatusCallback callback) { + EnsureClientConfigured(); + client_->WaitForPendingWrites(std::move(callback)); +} + +void Firestore::ClearPersistence(util::StatusCallback callback) { + worker_queue()->EnqueueEvenWhileRestricted([this, callback] { + auto MaybeCallback = [=](Status status) { + if (callback) { + user_executor_->Execute([=] { callback(status); }); + } + }; + + { + std::lock_guard lock{mutex_}; + if (client_ && !client_->is_terminated()) { + MaybeCallback(util::Status( + Error::kErrorFailedPrecondition, + "Persistence cannot be cleared while the client is running.")); + return; + } + } + + MaybeCallback(LevelDbPersistence::ClearPersistence(MakeDatabaseInfo())); + }); +} + +void Firestore::EnableNetwork(util::StatusCallback callback) { + EnsureClientConfigured(); + client_->EnableNetwork(std::move(callback)); +} + +void Firestore::DisableNetwork(util::StatusCallback callback) { + EnsureClientConfigured(); + client_->DisableNetwork(std::move(callback)); +} + +void Firestore::SetClientLanguage(std::string language_token) { + GrpcConnection::SetClientLanguage(std::move(language_token)); +} + +std::unique_ptr Firestore::AddSnapshotsInSyncListener( + std::unique_ptr> listener) { + EnsureClientConfigured(); + auto async_listener = AsyncEventListener::Create( + client_->user_executor(), std::move(listener)); + client_->AddSnapshotsInSyncListener(async_listener); + return absl::make_unique( + client_, std::move(async_listener)); +} + +void Firestore::EnsureClientConfigured() { + std::lock_guard lock{mutex_}; + + if (!client_) { + HARD_ASSERT(worker_queue_, "Expected non-null worker queue"); + client_ = FirestoreClient::Create(MakeDatabaseInfo(), settings_, + std::move(credentials_provider_), + user_executor_, worker_queue_); + } +} + +DatabaseInfo Firestore::MakeDatabaseInfo() const { + return DatabaseInfo(database_id_, persistence_key_, settings_.host(), + settings_.ssl_enabled()); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.h b/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.h new file mode 100644 index 000000000..811ef16d1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/firestore.h @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_FIRESTORE_H_ +#define FIRESTORE_CORE_SRC_API_FIRESTORE_H_ + +#include +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { + +namespace auth { +class CredentialsProvider; +} // namespace auth + +namespace util { +class AsyncQueue; +class Executor; + +struct Empty; +} // namespace util + +namespace api { + +class Firestore : public std::enable_shared_from_this { + public: + Firestore() = default; + + Firestore(model::DatabaseId database_id, + std::string persistence_key, + std::shared_ptr credentials_provider, + std::shared_ptr worker_queue, + void* extension); + + ~Firestore(); + + void Dispose(); + + const model::DatabaseId& database_id() const { + return database_id_; + } + + const std::string& persistence_key() const { + return persistence_key_; + } + + const std::shared_ptr& client(); + + const std::shared_ptr& worker_queue(); + + void* extension() { + return extension_; + } + + const Settings& settings() const; + void set_settings(const Settings& settings); + + void set_user_executor(std::unique_ptr user_executor); + + CollectionReference GetCollection(const std::string& collection_path); + DocumentReference GetDocument(const std::string& document_path); + WriteBatch GetBatch(); + core::Query GetCollectionGroup(std::string collection_id); + + void RunTransaction(core::TransactionUpdateCallback update_callback, + core::TransactionResultCallback result_callback); + + void Terminate(util::StatusCallback callback); + void ClearPersistence(util::StatusCallback callback); + void WaitForPendingWrites(util::StatusCallback callback); + std::unique_ptr AddSnapshotsInSyncListener( + std::unique_ptr> listener); + + void EnableNetwork(util::StatusCallback callback); + void DisableNetwork(util::StatusCallback callback); + + /** + * Sets the language of the public API in the format of + * "gl-/" where version might be blank, e.g. `gl-objc/`. + */ + static void SetClientLanguage(std::string language_token); + + private: + void EnsureClientConfigured(); + core::DatabaseInfo MakeDatabaseInfo() const; + + model::DatabaseId database_id_; + std::shared_ptr credentials_provider_; + std::string persistence_key_; + std::shared_ptr client_; + + std::shared_ptr user_executor_; + std::shared_ptr worker_queue_; + + void* extension_ = nullptr; + + Settings settings_; + + mutable std::mutex mutex_; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_FIRESTORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/listener_registration.h b/Pods/FirebaseFirestore/Firestore/core/src/api/listener_registration.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/listener_registration.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/listener_registration.h index 0daef0428..c30d0d5fb 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/listener_registration.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/listener_registration.h @@ -14,14 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_LISTENER_REGISTRATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_LISTENER_REGISTRATION_H_ +#ifndef FIRESTORE_CORE_SRC_API_LISTENER_REGISTRATION_H_ +#define FIRESTORE_CORE_SRC_API_LISTENER_REGISTRATION_H_ namespace firebase { namespace firestore { + namespace core { class FirestoreClient; -} +} // namespace core namespace api { @@ -58,4 +59,4 @@ class ListenerRegistration { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_LISTENER_REGISTRATION_H_ +#endif // FIRESTORE_CORE_SRC_API_LISTENER_REGISTRATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.cc new file mode 100644 index 000000000..3d6f2df5e --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.cc @@ -0,0 +1,484 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/api/query_core.h" + +#include // NOLINT(build/c++11) +#include +#include +#include + +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/api/query_listener_registration.h" +#include "Firestore/core/src/api/query_snapshot.h" +#include "Firestore/core/src/api/source.h" +#include "Firestore/core/src/core/bound.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/core/firestore_client.h" +#include "Firestore/core/src/core/listen_options.h" +#include "Firestore/core/src/core/operator.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/exception.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace api { + +namespace util = firebase::firestore::util; +using core::AsyncEventListener; +using core::Bound; +using core::Direction; +using core::EventListener; +using core::FieldFilter; +using core::Filter; +using core::IsArrayOperator; +using core::IsDisjunctiveOperator; +using core::ListenOptions; +using core::QueryListener; +using core::ViewSnapshot; +using model::DocumentKey; +using model::FieldPath; +using model::FieldValue; +using model::ResourcePath; +using util::Status; +using util::StatusOr; +using util::ThrowInvalidArgument; + +using Operator = Filter::Operator; + +namespace { +/** + * Given an operator, returns the set of operators that cannot be used with + * it. + * + * Operators in a query must adhere to the following set of rules: + * 1. Only one array operator is allowed. + * 2. Only one disjunctive operator is allowed. + * 3. NOT_EQUAL cannot be used with another NOT_EQUAL operator. + * 4. NOT_IN cannot be used with array, disjunctive, or NOT_EQUAL operators. + * + * Array operators: ARRAY_CONTAINS, ARRAY_CONTAINS_ANY + * Disjunctive operators: IN, ARRAY_CONTAINS_ANY, NOT_IN + */ +static std::vector ConflictingOps(Operator op) { + switch (op) { + case Operator::NotEqual: + return {Operator::NotEqual, Operator::NotIn}; + case Operator::ArrayContains: + return {Operator::ArrayContains, Operator::ArrayContainsAny, + Operator::NotIn}; + case Operator::In: + return {Operator::ArrayContainsAny, Operator::In, Operator::NotIn}; + case Operator::ArrayContainsAny: + return {Operator::ArrayContains, Operator::ArrayContainsAny, Operator::In, + Operator::NotIn}; + case Operator::NotIn: + return {Operator::ArrayContains, Operator::ArrayContainsAny, Operator::In, + Operator::NotIn, Operator::NotEqual}; + default: + return std::vector(); + } +} +} // unnamed namespace + +Query::Query(core::Query query, std::shared_ptr firestore) + : firestore_{std::move(firestore)}, query_{std::move(query)} { +} + +bool operator==(const Query& lhs, const Query& rhs) { + return lhs.firestore() == rhs.firestore() && lhs.query() == rhs.query(); +} + +size_t Query::Hash() const { + return util::Hash(firestore_.get(), query()); +} + +void Query::GetDocuments(Source source, QuerySnapshotListener&& callback) { + ValidateHasExplicitOrderByForLimitToLast(); + if (source == Source::Cache) { + firestore_->client()->GetDocumentsFromLocalCache(*this, + std::move(callback)); + return; + } + + ListenOptions options( + /*include_query_metadata_changes=*/true, + /*include_document_metadata_changes=*/true, + /*wait_for_sync_when_online=*/true); + + class ListenOnce : public EventListener { + public: + ListenOnce(Source source, QuerySnapshotListener&& listener) + : source_(source), listener_(std::move(listener)) { + } + + void OnEvent(StatusOr maybe_snapshot) override { + if (!maybe_snapshot.ok()) { + listener_->OnEvent(std::move(maybe_snapshot)); + return; + } + + QuerySnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); + + // Remove query first before passing event to user to avoid user actions + // affecting the now stale query. + std::unique_ptr registration = + registration_promise_.get_future().get(); + registration->Remove(); + + if (snapshot.metadata().from_cache() && source_ == Source::Server) { + listener_->OnEvent(Status{ + Error::kErrorUnavailable, + "Failed to get documents from server. (However, these documents " + "may exist in the local cache. Run again without setting source to " + "FirestoreSourceServer to retrieve the cached documents.)"}); + } else { + listener_->OnEvent(std::move(snapshot)); + } + }; + + void Resolve(std::unique_ptr registration) { + registration_promise_.set_value(std::move(registration)); + } + + private: + Source source_; + QuerySnapshotListener listener_; + + std::promise> registration_promise_; + }; + + auto listener = absl::make_unique(source, std::move(callback)); + auto listener_unowned = listener.get(); + + std::unique_ptr registration = + AddSnapshotListener(std::move(options), std::move(listener)); + + listener_unowned->Resolve(std::move(registration)); +} + +std::unique_ptr Query::AddSnapshotListener( + ListenOptions options, QuerySnapshotListener&& user_listener) { + ValidateHasExplicitOrderByForLimitToLast(); + // Convert from ViewSnapshots to QuerySnapshots. + class Converter : public EventListener { + public: + Converter(Query* parent, QuerySnapshotListener&& user_listener) + : firestore_(parent->firestore()), + query_(parent->query()), + user_listener_(std::move(user_listener)) { + } + + void OnEvent(StatusOr maybe_snapshot) override { + if (!maybe_snapshot.status().ok()) { + user_listener_->OnEvent(maybe_snapshot.status()); + return; + } + + ViewSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); + SnapshotMetadata metadata(snapshot.has_pending_writes(), + snapshot.from_cache()); + + QuerySnapshot result(firestore_, query_, std::move(snapshot), + std::move(metadata)); + + user_listener_->OnEvent(std::move(result)); + } + + private: + std::shared_ptr firestore_; + core::Query query_; + QuerySnapshotListener user_listener_; + }; + auto view_listener = + absl::make_unique(this, std::move(user_listener)); + + // Call the view_listener on the user Executor. + auto async_listener = AsyncEventListener::Create( + firestore_->client()->user_executor(), std::move(view_listener)); + + std::shared_ptr query_listener = + firestore_->client()->ListenToQuery(this->query(), options, + async_listener); + + return absl::make_unique( + firestore_->client(), std::move(async_listener), + std::move(query_listener)); +} + +Query Query::Filter(FieldPath field_path, + Operator op, + FieldValue field_value, + const std::function& type_describer) const { + if (field_path.IsKeyFieldPath()) { + if (IsArrayOperator(op)) { + ThrowInvalidArgument( + "Invalid query. You can't perform %s queries on document " + "ID since document IDs are not arrays.", + Describe(op)); + } else if (op == Operator::In || op == Operator::NotIn) { + ValidateDisjunctiveFilterElements(field_value, op); + std::vector references; + for (const auto& array_value : field_value.array_value()) { + references.push_back( + ParseExpectedReferenceValue(array_value, type_describer)); + } + field_value = FieldValue::FromArray(references); + } else { + field_value = ParseExpectedReferenceValue(field_value, type_describer); + } + } else { + if (IsDisjunctiveOperator(op)) { + ValidateDisjunctiveFilterElements(field_value, op); + } + } + + FieldFilter filter = FieldFilter::Create(field_path, op, field_value); + ValidateNewFilter(filter); + + return Wrap(query_.AddingFilter(std::move(filter))); +} + +Query Query::OrderBy(FieldPath field_path, bool descending) const { + return OrderBy(field_path, Direction::FromDescending(descending)); +} + +Query Query::OrderBy(FieldPath field_path, Direction direction) const { + ValidateNewOrderByPath(field_path); + if (query_.start_at()) { + ThrowInvalidArgument( + "Invalid query. You must not specify a starting point " + "before specifying the order by."); + } + if (query_.end_at()) { + ThrowInvalidArgument( + "Invalid query. You must not specify an ending point " + "before specifying the order by."); + } + return Wrap( + query_.AddingOrderBy(core::OrderBy(std::move(field_path), direction))); +} + +Query Query::LimitToFirst(int32_t limit) const { + if (limit <= 0) { + ThrowInvalidArgument( + "Invalid Query. Query limit (%s) is invalid. Limit must be positive.", + limit); + } + return Wrap(query_.WithLimitToFirst(limit)); +} + +Query Query::LimitToLast(int32_t limit) const { + if (limit <= 0) { + ThrowInvalidArgument( + "Invalid Query. Query limit (%s) is invalid. Limit must be positive.", + limit); + } + return Wrap(query_.WithLimitToLast(limit)); +} + +Query Query::StartAt(Bound bound) const { + return Wrap(query_.StartingAt(std::move(bound))); +} + +Query Query::EndAt(Bound bound) const { + return Wrap(query_.EndingAt(std::move(bound))); +} + +void Query::ValidateNewFilter(const class Filter& filter) const { + if (filter.IsAFieldFilter()) { + FieldFilter field_filter(filter); + + if (field_filter.IsInequality()) { + const FieldPath* existing_inequality = query_.InequalityFilterField(); + const FieldPath* new_inequality = &filter.field(); + + if (existing_inequality && *existing_inequality != *new_inequality) { + ThrowInvalidArgument( + "Invalid Query. All where filters with an inequality (notEqual, " + "lessThan, lessThanOrEqual, greaterThan, or greaterThanOrEqual) " + "must be on the same field. But you have inequality filters on " + "'%s' and '%s'", + existing_inequality->CanonicalString(), + new_inequality->CanonicalString()); + } + + const FieldPath* first_order_by_field = query_.FirstOrderByField(); + if (first_order_by_field) { + ValidateOrderByField(*first_order_by_field, filter.field()); + } + } + Operator filter_op = field_filter.op(); + absl::optional conflicting_op = + query_.FindOperator(ConflictingOps(filter_op)); + + if (conflicting_op) { + // We special case when it's a duplicate op to give a slightly clearer + // error message. + if (*conflicting_op == filter_op) { + ThrowInvalidArgument( + "Invalid Query. You cannot use more than one '%s' filter.", + Describe(filter_op)); + } else { + ThrowInvalidArgument( + "Invalid Query. You cannot use '%s' filters with" + " '%s' filters.", + Describe(filter_op), Describe(conflicting_op.value())); + } + } + } +} + +void Query::ValidateNewOrderByPath(const FieldPath& field_path) const { + if (!query_.FirstOrderByField()) { + // This is the first order by. It must match any inequality. + const FieldPath* inequality_field = query_.InequalityFilterField(); + if (inequality_field) { + ValidateOrderByField(field_path, *inequality_field); + } + } +} + +void Query::ValidateOrderByField(const FieldPath& order_by_field, + const FieldPath& inequality_field) const { + if (order_by_field != inequality_field) { + ThrowInvalidArgument( + "Invalid query. You have a where filter with an inequality " + "(notEqual, lessThan, lessThanOrEqual, greaterThan, or " + "greaterThanOrEqual) on field '%s' and so you must also use '%s' as " + "your first queryOrderedBy field, but your first queryOrderedBy is " + "currently on field '%s' instead.", + inequality_field.CanonicalString(), inequality_field.CanonicalString(), + order_by_field.CanonicalString()); + } +} + +void Query::ValidateHasExplicitOrderByForLimitToLast() const { + if (query_.has_limit_to_last() && query_.explicit_order_bys().empty()) { + ThrowInvalidArgument( + "limit(toLast:) queries require specifying at least one OrderBy() " + "clause."); + } +} + +void Query::ValidateDisjunctiveFilterElements( + const model::FieldValue& field_value, Operator op) const { + HARD_ASSERT( + field_value.type() == FieldValue::Type::Array, + "A FieldValue of Array type is required for disjunctive filters."); + if (field_value.array_value().size() == 0) { + ThrowInvalidArgument( + "Invalid Query. A non-empty array is required for '%s'" + " filters.", + Describe(op)); + } + if (field_value.array_value().size() > 10) { + ThrowInvalidArgument( + "Invalid Query. '%s' filters support a maximum of 10" + " elements in the value array.", + Describe(op)); + } + + std::vector array = field_value.array_value(); + for (const auto& val : array) { + if (op == Operator::In || op == Operator::ArrayContainsAny) { + if (val.is_null()) { + ThrowInvalidArgument( + "Invalid Query. '%s' filters cannot contain 'null' in" + " the value array.", + Describe(op)); + } + if (val.is_nan()) { + ThrowInvalidArgument( + "Invalid Query. '%s' filters cannot contain 'NaN' in" + " the value array.", + Describe(op)); + } + } + } +} + +FieldValue Query::ParseExpectedReferenceValue( + const model::FieldValue& field_value, + const std::function& type_describer) const { + if (field_value.type() == FieldValue::Type::String) { + const std::string& document_key = field_value.string_value(); + if (document_key.empty()) { + ThrowInvalidArgument( + "Invalid query. When querying by document ID you must provide a " + "valid document ID, but it was an empty string."); + } + if (!query().IsCollectionGroupQuery() && + document_key.find('/') != std::string::npos) { + ThrowInvalidArgument( + "Invalid query. When querying a collection by document ID you must " + "provide a plain document ID, but '%s' contains a '/' character.", + document_key); + } + ResourcePath path = + query().path().Append(ResourcePath::FromString(document_key)); + if (!DocumentKey::IsDocumentKey(path)) { + ThrowInvalidArgument( + "Invalid query. When querying a collection group by document ID, " + "the value provided must result in a valid document path, but '%s' " + "is not because it has an odd number of segments.", + path.CanonicalString()); + } + return FieldValue::FromReference(firestore_->database_id(), + DocumentKey{path}); + } else if (field_value.type() == FieldValue::Type::Reference) { + return field_value; + } else { + ThrowInvalidArgument( + "Invalid query. When querying by document ID you must provide a " + "valid string or DocumentReference, but it was of type: %s", + type_describer()); + } +} + +std::string Query::Describe(Operator op) const { + switch (op) { + case Operator::LessThan: + return "lessThan"; + case Operator::LessThanOrEqual: + return "lessThanOrEqual"; + case Operator::Equal: + return "equal"; + case Operator::NotEqual: + return "notEqual"; + case Operator::GreaterThanOrEqual: + return "greaterThanOrEqual"; + case Operator::GreaterThan: + return "greaterThan"; + case Operator::ArrayContains: + return "arrayContains"; + case Operator::In: + return "in"; + case Operator::ArrayContainsAny: + return "arrayContainsAny"; + case Operator::NotIn: + return "notIn"; + } + + UNREACHABLE(); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_core.h b/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.h similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_core.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/query_core.h index 7e1c1c37c..1678aca32 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_core.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/query_core.h @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,28 +14,26 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_CORE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_CORE_H_ +#ifndef FIRESTORE_CORE_SRC_API_QUERY_CORE_H_ +#define FIRESTORE_CORE_SRC_API_QUERY_CORE_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" -#include "Firestore/core/src/firebase/firestore/api/query_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/source.h" -#include "Firestore/core/src/firebase/firestore/core/bound.h" -#include "Firestore/core/src/firebase/firestore/core/direction.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/core/listen_options.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/core/query.h" namespace firebase { namespace firestore { -namespace api { -class Firestore; +namespace model { +class FieldValue; +} // namespace model + +namespace api { /** * A `Query` refers to a Firestore Query which you can read or listen to. You @@ -66,7 +64,7 @@ class Query { * @param callback a callback to execute once the documents have been * successfully read. */ - void GetDocuments(Source source, QuerySnapshot::Listener&& callback); + void GetDocuments(Source source, QuerySnapshotListener&& callback); /** * Attaches a listener for QuerySnapshot events. @@ -78,7 +76,7 @@ class Query { * @return A ListenerRegistration that can be used to remove this listener. */ std::unique_ptr AddSnapshotListener( - core::ListenOptions options, QuerySnapshot::Listener&& listener); + core::ListenOptions options, QuerySnapshotListener&& listener); /** * Creates and returns a new `Query` with the additional filter that documents @@ -121,14 +119,27 @@ class Query { Query OrderBy(model::FieldPath field_path, core::Direction direction) const; /** - * Creates and returns a new `Query` that's additionally limited to only - * return up to the specified number of documents. + * Creates and returns a new `Query` that only returns the first matching + * documents up to the specified number. + * + * @param limit The maximum number of items to return. + * + * @return The created `Query`. + */ + Query LimitToFirst(int32_t limit) const; + + /** + * Creates and returns a new `Query` that only returns the last matching + * documents up to the specified number. + * + * You must specify at least one `OrderBy` clause for `LimitToLast` queries, + * it is an error otherwise when the query is executed. * * @param limit The maximum number of items to return. * * @return The created `Query`. */ - Query Limit(int32_t limit) const; + Query LimitToLast(int32_t limit) const; /** * Creates and returns a new `Query` that starts at the given bound. The @@ -161,9 +172,10 @@ class Query { private: void ValidateNewFilter(const core::Filter& filter) const; - void ValidateNewOrderByPath(const model::FieldPath& fieldPath) const; - void ValidateOrderByField(const model::FieldPath& orderByField, - const model::FieldPath& inequalityField) const; + void ValidateNewOrderByPath(const model::FieldPath& field_path) const; + void ValidateOrderByField(const model::FieldPath& order_by_field, + const model::FieldPath& inequality_field) const; + void ValidateHasExplicitOrderByForLimitToLast() const; /** * Validates that the value passed into a disjunctive filter satisfies all * array requirements. @@ -196,4 +208,4 @@ inline bool operator!=(const Query& lhs, const Query& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_CORE_H_ +#endif // FIRESTORE_CORE_SRC_API_QUERY_CORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.cc new file mode 100644 index 000000000..1be5b819c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.cc @@ -0,0 +1,58 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/api/query_listener_registration.h" + +#include + +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/firestore_client.h" +#include "Firestore/core/src/core/query_listener.h" +#include "Firestore/core/src/core/view_snapshot.h" + +namespace firebase { +namespace firestore { +namespace api { + +QueryListenerRegistration::QueryListenerRegistration( + std::shared_ptr client, + std::shared_ptr> + async_listener, + std::shared_ptr query_listener) + : client_(std::move(client)), + async_listener_(std::move(async_listener)), + query_listener_(std::move(query_listener)) { +} + +void QueryListenerRegistration::Remove() { + auto async_listener = async_listener_.lock(); + if (async_listener) { + async_listener->Mute(); + async_listener_.reset(); + } + + auto query_listener = query_listener_.lock(); + if (query_listener) { + client_->RemoveListener(query_listener); + query_listener_.reset(); + } + + client_.reset(); +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.h b/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.h new file mode 100644 index 000000000..0e69fac33 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/query_listener_registration.h @@ -0,0 +1,61 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_QUERY_LISTENER_REGISTRATION_H_ +#define FIRESTORE_CORE_SRC_API_QUERY_LISTENER_REGISTRATION_H_ + +#include + +#include "Firestore/core/src/api/listener_registration.h" +#include "Firestore/core/src/core/core_fwd.h" + +namespace firebase { +namespace firestore { +namespace api { + +/** + * An internal handle that encapsulates a user's ability to request that we + * stop listening to a query. + */ +class QueryListenerRegistration : public ListenerRegistration { + public: + QueryListenerRegistration( + std::shared_ptr client, + std::shared_ptr> + async_listener, + std::shared_ptr query_listener); + + /** + * Removes the listener being tracked by this QueryListenerRegistration. + */ + void Remove() override; + + private: + /** The client that was used to register this listen. */ + std::shared_ptr client_; + + /** The async listener that is used to mute events synchronously. */ + std::weak_ptr> async_listener_; + + /** The internal QueryListener that can be used to unlisten the query. */ + std::weak_ptr query_listener_; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_QUERY_LISTENER_REGISTRATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_snapshot.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_snapshot.cc rename to Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.cc index 398865ac6..5ee410335 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_snapshot.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.cc @@ -14,16 +14,17 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/api/query_snapshot.h" +#include "Firestore/core/src/api/query_snapshot.h" #include -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/api/query_core.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/objc/objc_compatibility.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/api/document_change.h" +#include "Firestore/core/src/api/document_snapshot.h" +#include "Firestore/core/src/api/query_core.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/types/optional.h" namespace firebase { @@ -36,6 +37,7 @@ using core::ViewSnapshot; using model::Document; using model::DocumentComparator; using model::DocumentSet; +using util::ThrowInvalidArgument; QuerySnapshot::QuerySnapshot(std::shared_ptr firestore, core::Query query, @@ -67,13 +69,13 @@ size_t QuerySnapshot::Hash() const { void QuerySnapshot::ForEachDocument( const std::function& callback) const { - DocumentSet documentSet = snapshot_.documents(); + DocumentSet document_set = snapshot_.documents(); bool from_cache = metadata_.from_cache(); - for (const Document& document : documentSet) { + for (const Document& document : document_set) { bool has_pending_writes = snapshot_.mutated_keys().contains(document.key()); - DocumentSnapshot snap(firestore_, document.key(), document, from_cache, - has_pending_writes); + auto snap = DocumentSnapshot::FromDocument( + firestore_, document, SnapshotMetadata(has_pending_writes, from_cache)); callback(std::move(snap)); } } @@ -115,7 +117,8 @@ void QuerySnapshot::ForEachChange( SnapshotMetadata metadata( /*pending_writes=*/snapshot_.mutated_keys().contains(doc.key()), /*from_cache=*/snapshot_.from_cache()); - DocumentSnapshot document(firestore_, doc.key(), doc, metadata); + auto document = + DocumentSnapshot::FromDocument(firestore_, doc, std::move(metadata)); HARD_ASSERT(change.type() == DocumentViewChange::Type::Added, "Invalid event type for first snapshot"); @@ -142,7 +145,7 @@ void QuerySnapshot::ForEachChange( SnapshotMetadata metadata( /*pending_writes=*/snapshot_.mutated_keys().contains(doc.key()), /*from_cache=*/snapshot_.from_cache()); - DocumentSnapshot document(firestore_, doc.key(), doc, metadata); + auto document = DocumentSnapshot::FromDocument(firestore_, doc, metadata); size_t old_index = DocumentChange::npos; size_t new_index = DocumentChange::npos; diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.h b/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.h new file mode 100644 index 000000000..af38f125b --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/query_snapshot.h @@ -0,0 +1,101 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_QUERY_SNAPSHOT_H_ +#define FIRESTORE_CORE_SRC_API_QUERY_SNAPSHOT_H_ + +#include +#include +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/api/snapshot_metadata.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/view_snapshot.h" + +namespace firebase { +namespace firestore { +namespace api { + +/** + * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects. + */ +class QuerySnapshot { + public: + QuerySnapshot(std::shared_ptr firestore, + core::Query query, + core::ViewSnapshot&& snapshot, + SnapshotMetadata metadata); + + size_t Hash() const; + + /** + * Indicates whether this `QuerySnapshot` is empty (contains no documents). + */ + bool empty() const { + return snapshot_.documents().empty(); + } + + /** The count of documents in this `QuerySnapshot`. */ + size_t size() const { + return snapshot_.documents().size(); + } + + const std::shared_ptr& firestore() const { + return firestore_; + } + + Query query() const; + + const core::Query& internal_query() const; + + /** + * Metadata about this snapshot, concerning its source and if it has local + * modifications. + */ + const SnapshotMetadata& metadata() const { + return metadata_; + } + + /** Iterates over the `DocumentSnapshots` that make up this query snapshot. */ + void ForEachDocument( + const std::function& callback) const; + + /** + * Iterates over the `DocumentChanges` representing the changes between + * the prior snapshot and this one. + */ + void ForEachChange(bool include_metadata_changes, + const std::function& callback) const; + + friend bool operator==(const QuerySnapshot& lhs, const QuerySnapshot& rhs); + + private: + std::shared_ptr firestore_; + core::Query internal_query_; + core::ViewSnapshot snapshot_; + SnapshotMetadata metadata_; +}; + +using QuerySnapshotListener = + std::unique_ptr>; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_QUERY_SNAPSHOT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/settings.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/settings.cc similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/settings.cc rename to Pods/FirebaseFirestore/Firestore/core/src/api/settings.cc index 073584f27..b422efc31 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/settings.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/settings.cc @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/api/settings.h" +#include "Firestore/core/src/api/settings.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { namespace api { -constexpr char Settings::DefaultHost[]; +constexpr const char* Settings::DefaultHost; constexpr bool Settings::DefaultSslEnabled; constexpr bool Settings::DefaultPersistenceEnabled; constexpr int64_t Settings::DefaultCacheSizeBytes; diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/settings.h b/Pods/FirebaseFirestore/Firestore/core/src/api/settings.h similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/settings.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/settings.h index c5075d13d..19cc88754 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/settings.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/settings.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SETTINGS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SETTINGS_H_ +#ifndef FIRESTORE_CORE_SRC_API_SETTINGS_H_ +#define FIRESTORE_CORE_SRC_API_SETTINGS_H_ #include @@ -32,7 +32,9 @@ namespace api { */ class Settings { public: - static constexpr char DefaultHost[] = "firestore.googleapis.com"; + // Note: a constexpr array of char (`char[]`) doesn't work with Visual Studio + // 2015. + static constexpr const char* DefaultHost = "firestore.googleapis.com"; static constexpr bool DefaultSslEnabled = true; static constexpr bool DefaultPersistenceEnabled = true; static constexpr int64_t DefaultCacheSizeBytes = 100 * 1024 * 1024; @@ -96,4 +98,4 @@ class Settings { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SETTINGS_H_ +#endif // FIRESTORE_CORE_SRC_API_SETTINGS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshot_metadata.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.cc similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshot_metadata.cc rename to Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.cc index 1790bfc6b..a380a3318 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshot_metadata.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" +#include "Firestore/core/src/api/snapshot_metadata.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshot_metadata.h b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshot_metadata.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.h index 9fe2b808b..9965436cb 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshot_metadata.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshot_metadata.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SNAPSHOT_METADATA_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SNAPSHOT_METADATA_H_ +#ifndef FIRESTORE_CORE_SRC_API_SNAPSHOT_METADATA_H_ +#define FIRESTORE_CORE_SRC_API_SNAPSHOT_METADATA_H_ #include @@ -61,4 +61,4 @@ class SnapshotMetadata { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SNAPSHOT_METADATA_H_ +#endif // FIRESTORE_CORE_SRC_API_SNAPSHOT_METADATA_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.cc new file mode 100644 index 000000000..debe56b7c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.cc @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/api/snapshots_in_sync_listener_registration.h" + +#include + +#include "Firestore/core/src/api/query_snapshot.h" +#include "Firestore/core/src/core/firestore_client.h" + +namespace firebase { +namespace firestore { +namespace api { + +SnapshotsInSyncListenerRegistration::SnapshotsInSyncListenerRegistration( + std::shared_ptr client, + std::shared_ptr> async_listener) + : client_(std::move(client)), async_listener_(std::move(async_listener)) { +} + +void SnapshotsInSyncListenerRegistration::Remove() { + auto async_listener = async_listener_.lock(); + if (async_listener) { + async_listener->Mute(); + async_listener_.reset(); + + if (client_) { + client_->RemoveSnapshotsInSyncListener(async_listener); + client_.reset(); + } + } +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.h b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.h similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.h index 1d94fbf04..7c9131b16 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/snapshots_in_sync_listener_registration.h @@ -14,23 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ +#ifndef FIRESTORE_CORE_SRC_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ +#define FIRESTORE_CORE_SRC_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ #include -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/util/empty.h" +#include "Firestore/core/src/api/listener_registration.h" +#include "Firestore/core/src/core/core_fwd.h" namespace firebase { namespace firestore { -namespace core { - -class FirestoreClient; - -} // namespace core - namespace api { /** @@ -63,4 +56,4 @@ class SnapshotsInSyncListenerRegistration : public ListenerRegistration { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ +#endif // FIRESTORE_CORE_SRC_API_SNAPSHOTS_IN_SYNC_LISTENER_REGISTRATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/source.h b/Pods/FirebaseFirestore/Firestore/core/src/api/source.h similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/source.h rename to Pods/FirebaseFirestore/Firestore/core/src/api/source.h index be1ec0de9..3c3c0c259 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/source.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/source.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SOURCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SOURCE_H_ +#ifndef FIRESTORE_CORE_SRC_API_SOURCE_H_ +#define FIRESTORE_CORE_SRC_API_SOURCE_H_ namespace firebase { namespace firestore { @@ -36,4 +36,4 @@ enum class Source { Default, Server, Cache }; } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_SOURCE_H_ +#endif // FIRESTORE_CORE_SRC_API_SOURCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.cc b/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.cc new file mode 100644 index 000000000..d50c59465 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.cc @@ -0,0 +1,94 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/api/write_batch.h" + +#include + +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/api/firestore.h" +#include "Firestore/core/src/api/query_snapshot.h" +#include "Firestore/core/src/core/firestore_client.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/model/delete_mutation.h" +#include "Firestore/core/src/util/exception.h" + +namespace firebase { +namespace firestore { +namespace api { + +using model::DeleteMutation; +using model::Mutation; +using model::Precondition; +using util::ThrowIllegalState; +using util::ThrowInvalidArgument; + +void WriteBatch::SetData(const DocumentReference& reference, + core::ParsedSetData&& set_data) { + VerifyNotCommitted(); + ValidateReference(reference); + + std::vector append_mutations = std::move(set_data).ToMutations( + reference.key(), model::Precondition::None()); + std::move(append_mutations.begin(), append_mutations.end(), + std::back_inserter(mutations_)); +} + +void WriteBatch::UpdateData(const DocumentReference& reference, + core::ParsedUpdateData&& update_data) { + VerifyNotCommitted(); + ValidateReference(reference); + + std::vector append_mutations = + std::move(update_data) + .ToMutations(reference.key(), model::Precondition::Exists(true)); + std::move(append_mutations.begin(), append_mutations.end(), + std::back_inserter(mutations_)); +} + +void WriteBatch::DeleteData(const DocumentReference& reference) { + VerifyNotCommitted(); + ValidateReference(reference); + + mutations_.push_back(DeleteMutation(reference.key(), Precondition::None())); +} + +void WriteBatch::Commit(util::StatusCallback callback) { + VerifyNotCommitted(); + + committed_ = true; + firestore_->client()->WriteMutations(std::move(mutations_), + std::move(callback)); +} + +void WriteBatch::VerifyNotCommitted() const { + if (committed_) { + ThrowIllegalState( + "A write batch can no longer be used after commit has been called."); + } +} + +void WriteBatch::ValidateReference(const DocumentReference& reference) const { + if (reference.firestore() != firestore_) { + ThrowInvalidArgument( + "Provided document reference is from a different " + "Firestore instance."); + } +} + +} // namespace api +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.h b/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.h new file mode 100644 index 000000000..8f7397e2f --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/api/write_batch.h @@ -0,0 +1,64 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_API_WRITE_BATCH_H_ +#define FIRESTORE_CORE_SRC_API_WRITE_BATCH_H_ + +#include +#include +#include + +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { +namespace api { + +class WriteBatch { + public: + explicit WriteBatch(std::shared_ptr firestore) + : firestore_{std::move(firestore)} { + } + + void SetData(const DocumentReference& reference, + core::ParsedSetData&& set_data); + void UpdateData(const DocumentReference& reference, + core::ParsedUpdateData&& update_data); + void DeleteData(const DocumentReference& reference); + + void Commit(util::StatusCallback callback); + + const std::shared_ptr& firestore() const { + return firestore_; + } + + private: + std::shared_ptr firestore_; + std::vector mutations_; + bool committed_ = false; + + void VerifyNotCommitted() const; + void ValidateReference(const DocumentReference& reference) const; +}; + +} // namespace api +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_API_WRITE_BATCH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/credentials_provider.cc b/Pods/FirebaseFirestore/Firestore/core/src/auth/credentials_provider.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/credentials_provider.cc rename to Pods/FirebaseFirestore/Firestore/core/src/auth/credentials_provider.cc index d98fafb97..0a6c9c9b6 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/credentials_provider.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/credentials_provider.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" +#include "Firestore/core/src/auth/credentials_provider.h" namespace firebase { namespace firestore { @@ -23,8 +23,7 @@ namespace auth { CredentialsProvider::CredentialsProvider() : change_listener_(nullptr) { } -CredentialsProvider::~CredentialsProvider() { -} +CredentialsProvider::~CredentialsProvider() = default; } // namespace auth } // namespace firestore diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/credentials_provider.h b/Pods/FirebaseFirestore/Firestore/core/src/auth/credentials_provider.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/credentials_provider.h rename to Pods/FirebaseFirestore/Firestore/core/src/auth/credentials_provider.h index cf952e052..a84c452aa 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/credentials_provider.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/credentials_provider.h @@ -14,16 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_CREDENTIALS_PROVIDER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_CREDENTIALS_PROVIDER_H_ +#ifndef FIRESTORE_CORE_SRC_AUTH_CREDENTIALS_PROVIDER_H_ +#define FIRESTORE_CORE_SRC_AUTH_CREDENTIALS_PROVIDER_H_ #include #include #include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/auth/token.h" -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" +#include "Firestore/core/src/auth/token.h" +#include "Firestore/core/src/auth/user.h" +#include "Firestore/core/src/util/statusor.h" #include "absl/strings/string_view.h" namespace firebase { @@ -63,7 +63,7 @@ class CredentialsProvider { * Call with nullptr to remove previous listener. */ virtual void SetCredentialChangeListener( - CredentialChangeListener changeListener) = 0; + CredentialChangeListener change_listener) = 0; protected: /** @@ -80,4 +80,4 @@ class CredentialsProvider { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_CREDENTIALS_PROVIDER_H_ +#endif // FIRESTORE_CORE_SRC_AUTH_CREDENTIALS_PROVIDER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.cc b/Pods/FirebaseFirestore/Firestore/core/src/auth/empty_credentials_provider.cc similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.cc rename to Pods/FirebaseFirestore/Firestore/core/src/auth/empty_credentials_provider.cc index ebea45940..6277d8619 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/empty_credentials_provider.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h" +#include "Firestore/core/src/auth/empty_credentials_provider.h" namespace firebase { namespace firestore { @@ -29,9 +29,9 @@ void EmptyCredentialsProvider::GetToken(TokenListener completion) { } void EmptyCredentialsProvider::SetCredentialChangeListener( - CredentialChangeListener changeListener) { - if (changeListener) { - changeListener(User::Unauthenticated()); + CredentialChangeListener change_listener) { + if (change_listener) { + change_listener(User::Unauthenticated()); } } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/auth/empty_credentials_provider.h b/Pods/FirebaseFirestore/Firestore/core/src/auth/empty_credentials_provider.h new file mode 100644 index 000000000..83e1464e5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/empty_credentials_provider.h @@ -0,0 +1,39 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_AUTH_EMPTY_CREDENTIALS_PROVIDER_H_ +#define FIRESTORE_CORE_SRC_AUTH_EMPTY_CREDENTIALS_PROVIDER_H_ + +#include "Firestore/core/src/auth/credentials_provider.h" + +namespace firebase { +namespace firestore { +namespace auth { + +/** `EmptyCredentialsProvider` always yields an empty token. */ +class EmptyCredentialsProvider : public CredentialsProvider { + public: + void GetToken(TokenListener completion) override; + void InvalidateToken() override; + void SetCredentialChangeListener( + CredentialChangeListener change_listener) override; +}; + +} // namespace auth +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_AUTH_EMPTY_CREDENTIALS_PROVIDER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h b/Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h rename to Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.h index 5a36ac5f2..ad2f41560 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.h @@ -14,22 +14,21 @@ * limitations under the License. */ -// Right now, FirebaseCredentialsProvider only support APPLE build. +#ifndef FIRESTORE_CORE_SRC_AUTH_FIREBASE_CREDENTIALS_PROVIDER_APPLE_H_ +#define FIRESTORE_CORE_SRC_AUTH_FIREBASE_CREDENTIALS_PROVIDER_APPLE_H_ + #if !defined(__OBJC__) #error "This header only supports Objective-C++." #endif // !defined(__OBJC__) -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_FIREBASE_CREDENTIALS_PROVIDER_APPLE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_FIREBASE_CREDENTIALS_PROVIDER_APPLE_H_ - #import #include #include // NOLINT(build/c++11) #include -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/auth/user.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/auth/user.h" #include "absl/strings/string_view.h" @class FIRApp; @@ -71,7 +70,7 @@ class FirebaseCredentialsProvider : public CredentialsProvider { void GetToken(TokenListener completion) override; void SetCredentialChangeListener( - CredentialChangeListener changeListener) override; + CredentialChangeListener change_listener) override; void InvalidateToken() override; @@ -108,7 +107,7 @@ class FirebaseCredentialsProvider : public CredentialsProvider { }; /** - * Handle used to stop receiving auth changes once userChangeListener is + * Handle used to stop receiving auth changes once CredentialChangeListener is * removed. */ id auth_listener_handle_; @@ -120,4 +119,4 @@ class FirebaseCredentialsProvider : public CredentialsProvider { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_FIREBASE_CREDENTIALS_PROVIDER_APPLE_H_ +#endif // FIRESTORE_CORE_SRC_AUTH_FIREBASE_CREDENTIALS_PROVIDER_APPLE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.mm similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.mm rename to Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.mm index 709cd7666..ebba7105c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.mm +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/firebase_credentials_provider_apple.mm @@ -14,17 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h" +#include "Firestore/core/src/auth/firebase_credentials_provider_apple.h" -#import -#import -#import -#import -#import +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" +#import "Interop/Auth/Public/FIRAuthInterop.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/string_apple.h" namespace firebase { namespace firestore { @@ -80,7 +78,7 @@ HARD_ASSERT(auth_listener_handle_, "GetToken cannot be called after listener removed."); - // Take note of the current value of the tokenCounter so that this method can + // Take note of the current value of the token_counter so that this method can // fail if there is a token change while the request is outstanding. int initial_token_counter = contents_->token_counter; @@ -97,8 +95,8 @@ // Cancel the request since the user changed while the request was // outstanding so the response is likely for a previous user (which // user, we can't be sure). - completion(util::Status(Error::Aborted, - "getToken aborted due to token change.")); + LOG_DEBUG("GetToken aborted due to token change."); + return GetToken(completion); } else { if (error == nil) { if (token != nil) { @@ -107,7 +105,7 @@ completion(Token::Unauthenticated()); } } else { - Error error_code = Error::Unknown; + Error error_code = Error::kErrorUnknown; if (error.domain == FIRFirestoreErrorDomain) { error_code = static_cast(error.code); } @@ -134,19 +132,19 @@ } void FirebaseCredentialsProvider::SetCredentialChangeListener( - CredentialChangeListener changeListener) { + CredentialChangeListener change_listener) { std::unique_lock lock(contents_->mutex); - if (changeListener) { + if (change_listener) { HARD_ASSERT(!change_listener_, "set change_listener twice!"); // Fire initial event. - changeListener(contents_->current_user); + change_listener(contents_->current_user); } else { HARD_ASSERT(auth_listener_handle_, "removed change_listener twice!"); HARD_ASSERT(change_listener_, "change_listener removed without being set!"); [[NSNotificationCenter defaultCenter] removeObserver:auth_listener_handle_]; auth_listener_handle_ = nil; } - change_listener_ = changeListener; + change_listener_ = change_listener; } } // namespace auth diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/token.cc b/Pods/FirebaseFirestore/Firestore/core/src/auth/token.cc similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/token.cc rename to Pods/FirebaseFirestore/Firestore/core/src/auth/token.cc index a3176925b..d131db370 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/token.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/token.cc @@ -14,10 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/auth/token.h" +#include "Firestore/core/src/auth/token.h" #include +#include "Firestore/core/src/util/hard_assert.h" + namespace firebase { namespace firestore { namespace auth { @@ -26,6 +28,11 @@ Token::Token(std::string token, User user) : token_{std::move(token)}, user_{std::move(user)} { } +const std::string& Token::token() const { + HARD_ASSERT(user_.is_authenticated()); + return token_; +} + const Token& Token::Unauthenticated() { static const Token kUnauthenticatedToken(std::string{}, User::Unauthenticated()); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/token.h b/Pods/FirebaseFirestore/Firestore/core/src/auth/token.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/token.h rename to Pods/FirebaseFirestore/Firestore/core/src/auth/token.h index cce20eecb..87778a16a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/token.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/token.h @@ -14,14 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_TOKEN_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_TOKEN_H_ +#ifndef FIRESTORE_CORE_SRC_AUTH_TOKEN_H_ +#define FIRESTORE_CORE_SRC_AUTH_TOKEN_H_ #include -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "absl/strings/string_view.h" +#include "Firestore/core/src/auth/user.h" namespace firebase { namespace firestore { @@ -45,10 +43,7 @@ class Token { Token(std::string token, User user); /** The actual raw token. */ - const std::string& token() const { - HARD_ASSERT(user_.is_authenticated()); - return token_; - } + const std::string& token() const; /** * The user with which the token is associated (used for persisting user @@ -76,4 +71,4 @@ class Token { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_TOKEN_H_ +#endif // FIRESTORE_CORE_SRC_AUTH_TOKEN_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/user.cc b/Pods/FirebaseFirestore/Firestore/core/src/auth/user.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/user.cc rename to Pods/FirebaseFirestore/Firestore/core/src/auth/user.cc index 501e52243..0d3aa2a7e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/user.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/user.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/auth/user.h" +#include "Firestore/core/src/auth/user.h" #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/user.h b/Pods/FirebaseFirestore/Firestore/core/src/auth/user.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/user.h rename to Pods/FirebaseFirestore/Firestore/core/src/auth/user.h index f782b6e1c..04c68cac1 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/user.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/auth/user.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_USER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_USER_H_ +#ifndef FIRESTORE_CORE_SRC_AUTH_USER_H_ +#define FIRESTORE_CORE_SRC_AUTH_USER_H_ #if defined(__OBJC__) #import -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/util/string_apple.h" #endif // defined(__OBJC__) #include @@ -100,4 +100,4 @@ struct HashUser { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_USER_H_ +#endif // FIRESTORE_CORE_SRC_AUTH_USER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_any_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_any_filter.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.cc index 47d43f38e..9e45a1581 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_any_filter.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.cc @@ -14,11 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/array_contains_any_filter.h" +#include "Firestore/core/src/core/array_contains_any_filter.h" #include #include +#include "Firestore/core/src/model/document.h" #include "absl/algorithm/container.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.h new file mode 100644 index 000000000..537ca99d9 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_any_filter.h @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ + +#include + +#include "Firestore/core/src/core/field_filter.h" + +namespace firebase { +namespace firestore { + +namespace model { +class FieldPath; +class FieldValue; +} // namespace model + +namespace core { + +/** + * A Filter that implements the array-contains-any operator. + */ +class ArrayContainsAnyFilter : public FieldFilter { + public: + ArrayContainsAnyFilter(model::FieldPath field, model::FieldValue value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_filter.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.cc index 1d15d3071..d2a4a6b6b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_filter.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.cc @@ -14,11 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/array_contains_filter.h" +#include "Firestore/core/src/core/array_contains_filter.h" #include #include +#include "Firestore/core/src/model/document.h" #include "absl/algorithm/container.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.h new file mode 100644 index 000000000..49b3d7574 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/array_contains_filter.h @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_FILTER_H_ + +#include + +#include "Firestore/core/src/core/field_filter.h" + +namespace firebase { +namespace firestore { + +namespace model { +class FieldPath; +class FieldValue; +} // namespace model + +namespace core { + +/** + * A Filter that implements the array-contains operator. + */ +class ArrayContainsFilter : public FieldFilter { + public: + ArrayContainsFilter(model::FieldPath field, model::FieldValue value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_ARRAY_CONTAINS_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/bound.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/bound.cc similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/bound.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/bound.cc index 92bc63f20..07829b8c7 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/bound.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/bound.cc @@ -14,12 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/bound.h" +#include "Firestore/core/src/core/bound.h" #include -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/core/order_by.h" +#include "Firestore/core/src/immutable/append_only_list.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/to_string.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/bound.h b/Pods/FirebaseFirestore/Firestore/core/src/core/bound.h similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/bound.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/bound.h index 69579cd62..bd9645b12 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/bound.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/bound.h @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_BOUND_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_BOUND_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_BOUND_H_ +#define FIRESTORE_CORE_SRC_CORE_BOUND_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/core/order_by.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/model_fwd.h" namespace firebase { namespace firestore { @@ -99,4 +99,4 @@ inline bool operator!=(const Bound& lhs, const Bound& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_BOUND_H_ +#endif // FIRESTORE_CORE_SRC_CORE_BOUND_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/core_fwd.h b/Pods/FirebaseFirestore/Firestore/core/src/core/core_fwd.h new file mode 100644 index 000000000..99919c5d7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/core_fwd.h @@ -0,0 +1,92 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_CORE_FWD_H_ +#define FIRESTORE_CORE_SRC_CORE_CORE_FWD_H_ + +#include +#include +#include + +namespace firebase { +namespace firestore { + +namespace immutable { +template +class AppendOnlyList; +} // namespace immutable + +namespace util { +class Status; + +struct Empty; + +using StatusCallback = std::function; +} // namespace util + +namespace core { + +class Bound; +class DatabaseInfo; +class Direction; +class EventManager; +class FieldFilter; +class Filter; +class FirestoreClient; +class ListenOptions; +class OrderBy; +class ParsedSetData; +class ParsedUpdateData; +class Query; +class QueryListener; +class SyncEngine; +class SyncEngineCallback; +class Target; +class TargetIdGenerator; +class Transaction; +class ViewDocumentChanges; +class ViewChange; +class View; +class DocumentViewChange; +class DocumentViewChangeSet; +class ViewSnapshot; + +template +class AsyncEventListener; + +template +class EventListener; + +using CollectionGroupId = std::shared_ptr; + +using FilterList = immutable::AppendOnlyList; + +using OrderByList = immutable::AppendOnlyList; + +using TransactionResultCallback = util::StatusCallback; + +using TransactionUpdateCallback = std::function, TransactionResultCallback)>; + +using ViewSnapshotListener = std::unique_ptr>; + +using ViewSnapshotSharedListener = std::shared_ptr>; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_CORE_FWD_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/database_info.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/database_info.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/database_info.cc index 77c850337..744e798f2 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/database_info.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/database_info.h" +#include "Firestore/core/src/core/database_info.h" #include diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/database_info.h b/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.h similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/database_info.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/database_info.h index 828be9ec5..d80a5f2dc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/database_info.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/database_info.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_DATABASE_INFO_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_DATABASE_INFO_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_DATABASE_INFO_H_ +#define FIRESTORE_CORE_SRC_CORE_DATABASE_INFO_H_ #include -#include "Firestore/core/src/firebase/firestore/model/database_id.h" +#include "Firestore/core/src/model/database_id.h" namespace firebase { namespace firestore { @@ -28,12 +28,6 @@ namespace core { /** DatabaseInfo contains data about the database. */ class DatabaseInfo { public: -#if defined(__OBJC__) - // For objective-c++ initialization; to be removed after migration. - // Do NOT use in C++ code. - DatabaseInfo() = default; -#endif // defined(__OBJC__) - /** * Creates a new DatabaseInfo. * @@ -48,6 +42,8 @@ class DatabaseInfo { std::string host, bool ssl_enabled); + DatabaseInfo() = default; + const model::DatabaseId& database_id() const { return database_id_; } @@ -68,11 +64,11 @@ class DatabaseInfo { model::DatabaseId database_id_; std::string persistence_key_; std::string host_; - bool ssl_enabled_; + bool ssl_enabled_ = false; }; } // namespace core } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_DATABASE_INFO_H_ +#endif // FIRESTORE_CORE_SRC_CORE_DATABASE_INFO_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/direction.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/direction.cc similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/direction.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/direction.cc index 801b989ff..cf1e41cd2 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/direction.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/direction.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/direction.h" +#include "Firestore/core/src/core/direction.h" #include diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/direction.h b/Pods/FirebaseFirestore/Firestore/core/src/core/direction.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/direction.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/direction.h index df7042158..de47fad73 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/direction.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/direction.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_DIRECTION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_DIRECTION_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_DIRECTION_H_ +#define FIRESTORE_CORE_SRC_CORE_DIRECTION_H_ #include #include -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/util/comparison.h" #include "absl/base/attributes.h" namespace firebase { @@ -81,4 +81,4 @@ inline bool operator!=(const Direction& lhs, const Direction& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_DIRECTION_H_ +#endif // FIRESTORE_CORE_SRC_CORE_DIRECTION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_listener.h b/Pods/FirebaseFirestore/Firestore/core/src/core/event_listener.h similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_listener.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/event_listener.h index 24651a19b..a8edd48ee 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_listener.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/event_listener.h @@ -14,16 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_EVENT_LISTENER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_EVENT_LISTENER_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_ +#define FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_ -#include #include +#include // NOLINT(build/c++11) #include -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "Firestore/core/src/util/statusor.h" #include "absl/memory/memory.h" namespace firebase { @@ -39,8 +39,7 @@ class EventListener { static std::unique_ptr> Create( util::StatusOrCallback callback); - virtual ~EventListener() { - } + virtual ~EventListener() = default; /** * OnEvent will be called with the new value or the error if an error @@ -64,9 +63,6 @@ class AsyncEventListener AsyncEventListener(const std::shared_ptr& executor, DelegateListener&& delegate) : executor_(executor), delegate_(std::move(delegate)) { - // std::atomic's constructor is not atomic, so assign after contruction - // (since assignment is atomic). - muted_ = false; } static std::shared_ptr> Create( @@ -87,7 +83,19 @@ class AsyncEventListener void Mute(); private: - std::atomic muted_; + // PORTING NOTE: Android uses a volatile here but that's not enough in C++. + // + // In C++, the user can call `ListenerRegistration::Remove` (which calls + // `Mute`) and then immediately delete the state backing the listener. Using + // a mutex here instead of an atomic ensures that `Mute` won't return until + // it's safe to delete the state backing a listener. In Java this is safe + // because the state backing the listener is garbage collected so it doesn't + // matter if the mute is concurrent with a callback. + // + // Use a recursive mutex instead of `std::mutex` to avoid deadlock in the case + // where a user calls `Remove` from within a callback on that listener. + std::recursive_mutex mutex_; + bool muted_ = false; std::shared_ptr executor_; DelegateListener delegate_; }; @@ -120,6 +128,7 @@ std::shared_ptr> AsyncEventListener::Create( template void AsyncEventListener::Mute() { + std::lock_guard lock(mutex_); muted_ = true; } @@ -132,6 +141,7 @@ void AsyncEventListener::OnEvent(util::StatusOr maybe_value) { std::shared_ptr> shared_this = this->shared_from_this(); executor_->Execute([shared_this, maybe_value]() { + std::lock_guard lock(shared_this->mutex_); if (!shared_this->muted_) { shared_this->delegate_->OnEvent(std::move(maybe_value)); } @@ -142,4 +152,4 @@ void AsyncEventListener::OnEvent(util::StatusOr maybe_value) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_EVENT_LISTENER_H_ +#endif // FIRESTORE_CORE_SRC_CORE_EVENT_LISTENER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.cc new file mode 100644 index 000000000..283a83410 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.cc @@ -0,0 +1,168 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/event_manager.h" + +#include + +#include "Firestore/core/src/core/query_listener.h" +#include "Firestore/core/src/core/sync_engine.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using util::Empty; + +EventManager::EventManager(QueryEventSource* query_event_source) + : query_event_source_(query_event_source) { + query_event_source->SetCallback(this); +} + +model::TargetId EventManager::AddQueryListener( + std::shared_ptr listener) { + const Query& query = listener->query(); + + auto inserted = queries_.emplace(query, QueryListenersInfo{}); + bool first_listen = inserted.second; + QueryListenersInfo& query_info = inserted.first->second; + + query_info.listeners.push_back(listener); + + bool raised_event = listener->OnOnlineStateChanged(online_state_); + HARD_ASSERT(!raised_event, + "OnOnlineStateChanged() shouldn't raise an event " + "for brand-new listeners."); + + if (query_info.view_snapshot().has_value()) { + raised_event = listener->OnViewSnapshot(query_info.view_snapshot().value()); + if (raised_event) { + RaiseSnapshotsInSyncEvent(); + } + } + + if (first_listen) { + query_info.target_id = query_event_source_->Listen(query); + } + return query_info.target_id; +} + +void EventManager::RemoveQueryListener( + std::shared_ptr listener) { + const Query& query = listener->query(); + bool last_listen = false; + + auto found_iter = queries_.find(query); + if (found_iter != queries_.end()) { + QueryListenersInfo& query_info = found_iter->second; + query_info.Erase(listener); + last_listen = query_info.listeners.empty(); + } + + if (last_listen) { + queries_.erase(found_iter); + query_event_source_->StopListening(query); + } +} + +void EventManager::AddSnapshotsInSyncListener( + const std::shared_ptr>& listener) { + snapshots_in_sync_listeners_.insert(listener); + listener->OnEvent(Empty()); +} + +void EventManager::RemoveSnapshotsInSyncListener( + const std::shared_ptr>& listener) { + snapshots_in_sync_listeners_.erase(listener); +} + +void EventManager::HandleOnlineStateChange(model::OnlineState online_state) { + bool raised_event = false; + online_state_ = online_state; + + for (auto&& kv : queries_) { + QueryListenersInfo& info = kv.second; + for (auto&& listener : info.listeners) { + if (listener->OnOnlineStateChanged(online_state_)) { + raised_event = true; + } + } + } + if (raised_event) { + RaiseSnapshotsInSyncEvent(); + } +} + +void EventManager::RaiseSnapshotsInSyncEvent() { + Empty empty{}; + for (const auto& listener : snapshots_in_sync_listeners_) { + listener->OnEvent(empty); + } +} + +void EventManager::OnViewSnapshots( + std::vector&& snapshots) { + bool raised_event = false; + for (ViewSnapshot& snapshot : snapshots) { + const Query& query = snapshot.query(); + auto found_iter = queries_.find(query); + if (found_iter != queries_.end()) { + QueryListenersInfo& query_info = found_iter->second; + for (const auto& listener : query_info.listeners) { + if (listener->OnViewSnapshot(snapshot)) { + raised_event = true; + } + } + query_info.set_view_snapshot(std::move(snapshot)); + } + } + if (raised_event) { + RaiseSnapshotsInSyncEvent(); + } +} + +void EventManager::OnError(const core::Query& query, + const util::Status& error) { + auto found_iter = queries_.find(query); + if (found_iter == queries_.end()) { + return; + } + + QueryListenersInfo& query_info = found_iter->second; + for (const auto& listener : query_info.listeners) { + listener->OnError(error); + } + + // Remove all listeners. NOTE: We don't need to call + // `SyncEngine::StopListening()` after an error. + queries_.erase(found_iter); +} + +bool EventManager::QueryListenersInfo::Erase( + const std::shared_ptr& listener) { + auto found_iter = absl::c_find(listeners, listener); + auto found = found_iter != listeners.end(); + if (found) { + listeners.erase(found_iter); + } + return found; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.h b/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.h new file mode 100644 index 000000000..ba4f2ee56 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/event_manager.h @@ -0,0 +1,117 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_EVENT_MANAGER_H_ +#define FIRESTORE_CORE_SRC_CORE_EVENT_MANAGER_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/sync_engine_callback.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/util/empty.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace core { + +class QueryEventSource; +class QueryListener; + +/** + * EventManager is responsible for mapping queries to query event listeners. + * It handles "fan-out". (Identical queries will re-use the same watch on the + * backend.) + */ +class EventManager : public SyncEngineCallback { + public: + explicit EventManager(QueryEventSource* query_event_source_); + + /** + * Adds a query listener that will be called with new snapshots for the query. + * The EventManager is responsible for multiplexing many listeners to a single + * listen in the SyncEngine and will perform a listen if it's the first + * QueryListener added for a query. + * + * Returns the TargetId of the listen call in the SyncEngine. + */ + model::TargetId AddQueryListener( + std::shared_ptr listener); + + /** + * Removes a previously added listener. It's a no-op if the listener is not + * found. + */ + void RemoveQueryListener(std::shared_ptr listener); + + void AddSnapshotsInSyncListener( + const std::shared_ptr>& listener); + void RemoveSnapshotsInSyncListener( + const std::shared_ptr>& listener); + + // Implements `QueryEventCallback`. + void HandleOnlineStateChange(model::OnlineState online_state) override; + void OnViewSnapshots(std::vector&& snapshots) override; + void OnError(const core::Query& query, const util::Status& error) override; + + private: + /** + * Call all global snapshot listeners that have been set. + */ + void RaiseSnapshotsInSyncEvent(); + + /** + * Holds the listeners and the last received ViewSnapshot for a query being + * tracked by EventManager. + */ + struct QueryListenersInfo { + model::TargetId target_id; + std::vector> listeners; + + bool Erase(const std::shared_ptr& listener); + + const absl::optional& view_snapshot() const { + return snapshot_; + } + + void set_view_snapshot(const absl::optional& snapshot) { + snapshot_ = snapshot; + } + + private: + // Other members are public in this struct, ensure that any reads are + // copies by requiring reads to go through a const getter. + absl::optional snapshot_; + }; + + QueryEventSource* query_event_source_ = nullptr; + model::OnlineState online_state_ = model::OnlineState::Unknown; + std::unordered_map queries_; + std::unordered_set>> + snapshots_in_sync_listeners_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_EVENT_MANAGER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/field_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.cc similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/field_filter.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.cc index 79d920800..89b5a499d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/field_filter.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.cc @@ -14,19 +14,22 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" +#include "Firestore/core/src/core/field_filter.h" #include #include -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/core/array_contains_any_filter.h" -#include "Firestore/core/src/firebase/firestore/core/array_contains_filter.h" -#include "Firestore/core/src/firebase/firestore/core/in_filter.h" -#include "Firestore/core/src/firebase/firestore/core/key_field_filter.h" -#include "Firestore/core/src/firebase/firestore/core/key_field_in_filter.h" -#include "Firestore/core/src/firebase/firestore/core/operator.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/core/array_contains_any_filter.h" +#include "Firestore/core/src/core/array_contains_filter.h" +#include "Firestore/core/src/core/in_filter.h" +#include "Firestore/core/src/core/key_field_filter.h" +#include "Firestore/core/src/core/key_field_in_filter.h" +#include "Firestore/core/src/core/key_field_not_in_filter.h" +#include "Firestore/core/src/core/not_in_filter.h" +#include "Firestore/core/src/core/operator.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hashing.h" #include "absl/algorithm/container.h" #include "absl/strings/str_cat.h" #include "absl/types/optional.h" @@ -35,10 +38,10 @@ namespace firebase { namespace firestore { namespace core { -using api::ThrowInvalidArgument; using model::FieldPath; using model::FieldValue; using util::ComparisonResult; +using util::ThrowInvalidArgument; namespace { @@ -50,6 +53,8 @@ const char* CanonicalName(Filter::Operator op) { return "<="; case Filter::Operator::Equal: return "=="; + case Filter::Operator::NotEqual: + return "!="; case Filter::Operator::GreaterThanOrEqual: return ">="; case Filter::Operator::GreaterThan: @@ -64,6 +69,8 @@ const char* CanonicalName(Filter::Operator op) { return "in"; case Filter::Operator::ArrayContainsAny: return "array-contains-any"; + case Filter::Operator::NotIn: + return "not-in"; } UNREACHABLE(); @@ -76,9 +83,9 @@ FieldFilter FieldFilter::Create(FieldPath path, FieldValue value_rhs) { if (path.IsKeyFieldPath()) { if (op == Filter::Operator::In) { - HARD_ASSERT(value_rhs.type() == FieldValue::Type::Array, - "Comparing on key with IN, but the value was not an Array"); return KeyFieldInFilter(std::move(path), std::move(value_rhs)); + } else if (op == Filter::Operator::NotIn) { + return KeyFieldNotInFilter(std::move(path), std::move(value_rhs)); } else { HARD_ASSERT(value_rhs.type() == FieldValue::Type::Reference, "Comparing on key, but filter value not a Reference."); @@ -89,17 +96,19 @@ FieldFilter FieldFilter::Create(FieldPath path, } } else if (value_rhs.type() == FieldValue::Type::Null) { - if (op != Filter::Operator::Equal) { + if (op != Filter::Operator::Equal && op != Filter::Operator::NotEqual) { ThrowInvalidArgument( - "Invalid Query. Null supports only equality comparisons."); + "Invalid Query. Null supports only 'equalTo' and 'notEqualTo' " + "comparisons."); } Rep filter(std::move(path), op, std::move(value_rhs)); return FieldFilter(std::make_shared(std::move(filter))); } else if (value_rhs.is_nan()) { - if (op != Filter::Operator::Equal) { + if (op != Filter::Operator::Equal && op != Filter::Operator::NotEqual) { ThrowInvalidArgument( - "Invalid Query. NaN supports only equality comparisons."); + "Invalid Query. NaN supports only 'equalTo' and 'notEqualTo' " + "comparisons."); } Rep filter(std::move(path), op, std::move(value_rhs)); return FieldFilter(std::make_shared(std::move(filter))); @@ -111,12 +120,15 @@ FieldFilter FieldFilter::Create(FieldPath path, HARD_ASSERT(value_rhs.type() == FieldValue::Type::Array, "IN filter has invalid value: %s", value_rhs.type()); return InFilter(std::move(path), std::move(value_rhs)); - } else if (op == Operator::ArrayContainsAny) { HARD_ASSERT(value_rhs.type() == FieldValue::Type::Array, "arrayContainsAny filter has invalid value: %s", value_rhs.type()); return ArrayContainsAnyFilter(std::move(path), std::move(value_rhs)); + } else if (op == Operator::NotIn) { + HARD_ASSERT(value_rhs.type() == FieldValue::Type::Array, + "notIn filter has invalid value: %s", value_rhs.type()); + return NotInFilter(std::move(path), std::move(value_rhs)); } else { Rep filter(std::move(path), op, std::move(value_rhs)); return FieldFilter(std::make_shared(std::move(filter))); @@ -137,7 +149,8 @@ FieldFilter::Rep::Rep(FieldPath field, Operator op, FieldValue value_rhs) bool FieldFilter::Rep::IsInequality() const { return op_ == Operator::LessThan || op_ == Operator::LessThanOrEqual || - op_ == Operator::GreaterThan || op_ == Operator::GreaterThanOrEqual; + op_ == Operator::GreaterThan || op_ == Operator::GreaterThanOrEqual || + op_ == Operator::NotEqual || op_ == Operator::NotIn; } bool FieldFilter::Rep::Matches(const model::Document& doc) const { @@ -146,6 +159,11 @@ bool FieldFilter::Rep::Matches(const model::Document& doc) const { const FieldValue& lhs = *maybe_lhs; + // Types do not have to match in NotEqual filters. + if (op_ == Operator::NotEqual) { + return MatchesComparison(lhs.CompareTo(value_rhs_)); + } + // Only compare types with matching backend order (such as double and int). return FieldValue::Comparable(lhs.type(), value_rhs_.type()) && MatchesComparison(lhs.CompareTo(value_rhs_)); @@ -165,6 +183,8 @@ bool FieldFilter::Rep::MatchesComparison(ComparisonResult comparison) const { comparison == ComparisonResult::Same; case Operator::GreaterThan: return comparison == ComparisonResult::Descending; + case Operator::NotEqual: + return comparison != ComparisonResult::Same; default: HARD_FAIL("Operator %s unsuitable for comparison", op_); } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/field_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.h similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/field_filter.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.h index 32f1ccf97..b865c7fdc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/field_filter.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/field_filter.h @@ -14,19 +14,23 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FIELD_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FIELD_FILTER_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_FIELD_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_FIELD_FILTER_H_ #include #include -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" namespace firebase { namespace firestore { + +namespace model { +class Document; +} // namespace model + namespace core { /** @@ -133,4 +137,4 @@ class FieldFilter : public Filter { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FIELD_FILTER_H_ +#endif // FIRESTORE_CORE_SRC_CORE_FIELD_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/filter.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/filter.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/filter.cc index f2b64b3ca..e180a8ce5 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/filter.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/filter.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/filter.h" +#include "Firestore/core/src/core/filter.h" #include diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/filter.h similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/filter.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/filter.h index e85709df0..00614644f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/filter.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/filter.h @@ -14,20 +14,23 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FILTER_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_FILTER_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/immutable/append_only_list.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" +#include "Firestore/core/src/model/model_fwd.h" namespace firebase { namespace firestore { + +namespace immutable { +template +class AppendOnlyList; +} // namespace immutable + namespace core { /** Interface used for all query filters. All filters are immutable. */ @@ -42,11 +45,13 @@ class Filter { LessThan, LessThanOrEqual, Equal, + NotEqual, GreaterThanOrEqual, GreaterThan, ArrayContains, In, ArrayContainsAny, + NotIn, }; // For lack of RTTI, all subclasses must identify themselves so that @@ -56,8 +61,10 @@ class Filter { kArrayContainsFilter, kFieldFilter, kInFilter, + kNotInFilter, kKeyFieldFilter, kKeyFieldInFilter, + kKeyFieldNotInFilter, }; Type type() const { @@ -161,4 +168,4 @@ std::ostream& operator<<(std::ostream& os, const Filter& filter); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FILTER_H_ +#endif // FIRESTORE_CORE_SRC_CORE_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc new file mode 100644 index 000000000..b6453199c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.cc @@ -0,0 +1,512 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/firestore_client.h" + +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/src/api/document_reference.h" +#include "Firestore/core/src/api/document_snapshot.h" +#include "Firestore/core/src/api/query_core.h" +#include "Firestore/core/src/api/query_snapshot.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/core/event_manager.h" +#include "Firestore/core/src/core/query_listener.h" +#include "Firestore/core/src/core/sync_engine.h" +#include "Firestore/core/src/core/view.h" +#include "Firestore/core/src/local/index_free_query_engine.h" +#include "Firestore/core/src/local/leveldb_opener.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/local_documents_view.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/local/local_store.h" +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/src/local/query_result.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/remote/connectivity_monitor.h" +#include "Firestore/core/src/remote/datastore.h" +#include "Firestore/core/src/remote/remote_store.h" +#include "Firestore/core/src/remote/serializer.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/delayed_constructor.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_apple.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace core { + +using api::DocumentReference; +using api::DocumentSnapshot; +using api::DocumentSnapshotListener; +using api::ListenerRegistration; +using api::QuerySnapshot; +using api::QuerySnapshotListener; +using api::Settings; +using api::SnapshotMetadata; +using auth::CredentialsProvider; +using auth::User; +using firestore::Error; +using local::IndexFreeQueryEngine; +using local::LevelDbOpener; +using local::LocalSerializer; +using local::LocalStore; +using local::LruParams; +using local::MemoryPersistence; +using local::QueryResult; +using model::DatabaseId; +using model::Document; +using model::DocumentKeySet; +using model::DocumentMap; +using model::MaybeDocument; +using model::Mutation; +using model::OnlineState; +using remote::ConnectivityMonitor; +using remote::Datastore; +using remote::RemoteStore; +using remote::Serializer; +using util::AsyncQueue; +using util::DelayedConstructor; +using util::DelayedOperation; +using util::Empty; +using util::Executor; +using util::Path; +using util::Status; +using util::StatusCallback; +using util::StatusOr; +using util::StatusOrCallback; +using util::ThrowIllegalState; +using util::TimerId; + +static const size_t kMaxConcurrentLimboResolutions = 100; + +std::shared_ptr FirestoreClient::Create( + const DatabaseInfo& database_info, + const api::Settings& settings, + std::shared_ptr credentials_provider, + std::shared_ptr user_executor, + std::shared_ptr worker_queue) { + // Have to use `new` because `make_shared` cannot access private constructor. + std::shared_ptr shared_client( + new FirestoreClient(database_info, std::move(credentials_provider), + std::move(user_executor), std::move(worker_queue))); + + std::weak_ptr weak_client(shared_client); + auto credential_change_listener = [weak_client, settings](User user) mutable { + auto shared_client = weak_client.lock(); + if (!shared_client) return; + + if (!shared_client->credentials_initialized_) { + shared_client->credentials_initialized_ = true; + + // When we register the credentials listener for the first time, + // it is invoked synchronously on the calling thread. This ensures that + // the first item enqueued on the worker queue is + // `FirestoreClient::Initialize()`. + shared_client->worker_queue_->Enqueue([shared_client, user, settings] { + shared_client->Initialize(user, settings); + }); + } else { + shared_client->worker_queue_->Enqueue([shared_client, user] { + shared_client->worker_queue_->VerifyIsCurrentQueue(); + + LOG_DEBUG("Credential Changed. Current user: %s", user.uid()); + shared_client->sync_engine_->HandleCredentialChange(user); + }); + } + }; + + shared_client->credentials_provider_->SetCredentialChangeListener( + credential_change_listener); + + HARD_ASSERT( + shared_client->credentials_initialized_, + "CredentialChangeListener not invoked during client initialization"); + + return shared_client; +} + +FirestoreClient::FirestoreClient( + const DatabaseInfo& database_info, + std::shared_ptr credentials_provider, + std::shared_ptr user_executor, + std::shared_ptr worker_queue) + : database_info_(database_info), + credentials_provider_(std::move(credentials_provider)), + worker_queue_(std::move(worker_queue)), + user_executor_(std::move(user_executor)) { +} + +void FirestoreClient::Initialize(const User& user, const Settings& settings) { + // Do all of our initialization on our own dispatch queue. + worker_queue_->VerifyIsCurrentQueue(); + LOG_DEBUG("Initializing. Current user: %s", user.uid()); + + // Note: The initialization work must all be synchronous (we can't dispatch + // more work) since external write/listen operations could get queued to run + // before that subsequent work completes. + if (settings.persistence_enabled()) { + LevelDbOpener opener(database_info_); + + auto created = + opener.Create(LruParams::WithCacheSize(settings.cache_size_bytes())); + // If leveldb fails to start then just throw up our hands: the error is + // unrecoverable. There's nothing an end-user can do and nearly all + // failures indicate the developer is doing something grossly wrong so we + // should stop them cold in their tracks with a failure they can't ignore. + HARD_ASSERT(created.ok(), "Failed to open DB: %s", + created.status().ToString()); + + auto ldb = std::move(created).ValueOrDie(); + lru_delegate_ = ldb->reference_delegate(); + + persistence_ = std::move(ldb); + if (settings.gc_enabled()) { + ScheduleLruGarbageCollection(); + } + } else { + persistence_ = MemoryPersistence::WithEagerGarbageCollector(); + } + + query_engine_ = absl::make_unique(); + local_store_ = absl::make_unique(persistence_.get(), + query_engine_.get(), user); + connectivity_monitor_ = ConnectivityMonitor::Create(worker_queue_); + auto datastore = std::make_shared(database_info_, worker_queue_, + credentials_provider_, + connectivity_monitor_.get()); + + remote_store_ = absl::make_unique( + local_store_.get(), std::move(datastore), worker_queue_, + connectivity_monitor_.get(), [this](OnlineState online_state) { + sync_engine_->HandleOnlineStateChange(online_state); + }); + + sync_engine_ = + absl::make_unique(local_store_.get(), remote_store_.get(), + user, kMaxConcurrentLimboResolutions); + + event_manager_ = absl::make_unique(sync_engine_.get()); + + // Setup wiring for remote store. + remote_store_->set_sync_engine(sync_engine_.get()); + + // NOTE: RemoteStore depends on LocalStore (for persisting stream tokens, + // refilling mutation queue, etc.) so must be started after LocalStore. + local_store_->Start(); + remote_store_->Start(); +} + +FirestoreClient::~FirestoreClient() { + Dispose(); +} + +void FirestoreClient::Dispose() { + // Prevent new API invocations from enqueueing further work. + worker_queue_->EnterRestrictedMode(); + + // Clean up internal resources. It's possible that this can race with a call + // to `Firestore::ClearPersistence` or `Firestore::Terminate`, but that's OK + // because that operation does not rely on any state in this FirestoreClient. + std::promise signal_disposing; + bool enqueued = worker_queue_->EnqueueEvenWhileRestricted([&, this] { + // Once this task has started running, AsyncQueue::Dispose will block on its + // completion. Signal as early as possible to lock out even restricted tasks + // as early as possible. + signal_disposing.set_value(); + + TerminateInternal(); + }); + + // If we successfully enqueued the TerminateInternal task then wait for it to + // start. + // + // If the task was not enqueued, we lost the race with some other concurrent + // invocation of Dispose. In that case, `signal_disposing` will never be + // completed. + if (enqueued) { + signal_disposing.get_future().wait(); + } + + worker_queue_->Dispose(); + user_executor_->Dispose(); +} + +void FirestoreClient::TerminateAsync(StatusCallback callback) { + worker_queue_->EnterRestrictedMode(); + worker_queue_->EnqueueEvenWhileRestricted([this, callback] { + TerminateInternal(); + + if (callback) { + user_executor_->Execute([=] { callback(Status::OK()); }); + } + }); +} + +void FirestoreClient::TerminateInternal() { + if (!remote_store_) return; + + credentials_provider_->SetCredentialChangeListener(nullptr); + credentials_provider_.reset(); + + // If we've scheduled LRU garbage collection, cancel it. + lru_callback_.Cancel(); + + remote_store_->Shutdown(); + persistence_->Shutdown(); + + local_store_.reset(); + query_engine_.reset(); + event_manager_.reset(); + + // Clear the remote store to indicate terminate is complete. + remote_store_.reset(); +} + +/** + * Schedules a callback to try running LRU garbage collection. Reschedules + * itself after the GC has run. + */ +void FirestoreClient::ScheduleLruGarbageCollection() { + std::chrono::milliseconds delay = + gc_has_run_ ? regular_gc_delay_ : initial_gc_delay_; + + lru_callback_ = worker_queue_->EnqueueAfterDelay( + delay, TimerId::GarbageCollectionDelay, [this] { + local_store_->CollectGarbage(lru_delegate_->garbage_collector()); + gc_has_run_ = true; + ScheduleLruGarbageCollection(); + }); +} + +void FirestoreClient::DisableNetwork(StatusCallback callback) { + VerifyNotTerminated(); + + worker_queue_->Enqueue([this, callback] { + remote_store_->DisableNetwork(); + if (callback) { + user_executor_->Execute([=] { callback(Status::OK()); }); + } + }); +} + +void FirestoreClient::EnableNetwork(StatusCallback callback) { + VerifyNotTerminated(); + + worker_queue_->Enqueue([this, callback] { + remote_store_->EnableNetwork(); + if (callback) { + user_executor_->Execute([=] { callback(Status::OK()); }); + } + }); +} + +void FirestoreClient::WaitForPendingWrites(StatusCallback callback) { + VerifyNotTerminated(); + + // Dispatch the result back onto the user dispatch queue. + auto async_callback = [this, callback](util::Status status) { + if (callback) { + user_executor_->Execute([=] { callback(std::move(status)); }); + } + }; + + worker_queue_->Enqueue([this, async_callback] { + sync_engine_->RegisterPendingWritesCallback(std::move(async_callback)); + }); +} + +void FirestoreClient::VerifyNotTerminated() { + if (is_terminated()) { + ThrowIllegalState("The client has already been terminated."); + } +} + +bool FirestoreClient::is_terminated() const { + // When the user calls `Terminate`, it puts the `AsyncQueue` into restricted + // mode. + // + // Note that `remote_store_ == nullptr` is not a good test for this because + // `remote_store_` is reset asynchronously. + return !worker_queue_->is_running(); +} + +std::shared_ptr FirestoreClient::ListenToQuery( + Query query, ListenOptions options, ViewSnapshotSharedListener&& listener) { + VerifyNotTerminated(); + + auto query_listener = QueryListener::Create( + std::move(query), std::move(options), std::move(listener)); + + worker_queue_->Enqueue([this, query_listener] { + event_manager_->AddQueryListener(std::move(query_listener)); + }); + + return query_listener; +} + +void FirestoreClient::RemoveListener( + const std::shared_ptr& listener) { + // Checks for termination but does not throw error, allowing it to be an no-op + // if client is already terminated. + if (is_terminated()) { + return; + } + worker_queue_->Enqueue( + [this, listener] { event_manager_->RemoveQueryListener(listener); }); +} + +void FirestoreClient::GetDocumentFromLocalCache( + const DocumentReference& doc, DocumentSnapshotListener&& callback) { + VerifyNotTerminated(); + + // TODO(c++14): move `callback` into lambda. + auto shared_callback = absl::ShareUniquePtr(std::move(callback)); + worker_queue_->Enqueue([this, doc, shared_callback] { + absl::optional maybe_document = + local_store_->ReadDocument(doc.key()); + StatusOr maybe_snapshot; + + if (maybe_document && maybe_document->is_document()) { + Document document(*maybe_document); + maybe_snapshot = DocumentSnapshot::FromDocument( + doc.firestore(), document, + SnapshotMetadata{ + /*has_pending_writes=*/document.has_local_mutations(), + /*from_cache=*/true}); + } else if (maybe_document && maybe_document->is_no_document()) { + maybe_snapshot = DocumentSnapshot::FromNoDocument( + doc.firestore(), doc.key(), + SnapshotMetadata{/*has_pending_writes=*/false, + /*from_cache=*/true}); + } else { + maybe_snapshot = + Status{Error::kErrorUnavailable, + "Failed to get document from cache. (However, this document " + "may exist on the server. Run again without setting source to " + "FirestoreSourceCache to attempt to retrieve the document "}; + } + + if (shared_callback) { + user_executor_->Execute( + [=] { shared_callback->OnEvent(std::move(maybe_snapshot)); }); + } + }); +} + +void FirestoreClient::GetDocumentsFromLocalCache( + const api::Query& query, QuerySnapshotListener&& callback) { + VerifyNotTerminated(); + + // TODO(c++14): move `callback` into lambda. + auto shared_callback = absl::ShareUniquePtr(std::move(callback)); + worker_queue_->Enqueue([this, query, shared_callback] { + QueryResult query_result = local_store_->ExecuteQuery( + query.query(), /* use_previous_results= */ true); + + View view(query.query(), query_result.remote_keys()); + ViewDocumentChanges view_doc_changes = + view.ComputeDocumentChanges(query_result.documents().underlying_map()); + ViewChange view_change = view.ApplyChanges(view_doc_changes); + HARD_ASSERT( + view_change.limbo_changes().empty(), + "View returned limbo documents during local-only query execution."); + + HARD_ASSERT(view_change.snapshot().has_value(), "Expected a snapshot"); + + ViewSnapshot snapshot = std::move(view_change.snapshot()).value(); + SnapshotMetadata metadata(snapshot.has_pending_writes(), + snapshot.from_cache()); + + QuerySnapshot result(query.firestore(), query.query(), std::move(snapshot), + std::move(metadata)); + + if (shared_callback) { + user_executor_->Execute( + [=] { shared_callback->OnEvent(std::move(result)); }); + } + }); +} + +void FirestoreClient::WriteMutations(std::vector&& mutations, + StatusCallback callback) { + VerifyNotTerminated(); + + // TODO(c++14): move `mutations` into lambda (C++14). + worker_queue_->Enqueue([this, mutations, callback]() mutable { + if (mutations.empty()) { + if (callback) { + user_executor_->Execute([=] { callback(Status::OK()); }); + } + } else { + sync_engine_->WriteMutations( + std::move(mutations), [this, callback](Status error) { + // Dispatch the result back onto the user dispatch queue. + if (callback) { + user_executor_->Execute([=] { callback(std::move(error)); }); + } + }); + } + }); +} + +void FirestoreClient::Transaction(int retries, + TransactionUpdateCallback update_callback, + TransactionResultCallback result_callback) { + VerifyNotTerminated(); + + // Dispatch the result back onto the user dispatch queue. + auto async_callback = [this, result_callback](Status status) { + if (result_callback) { + user_executor_->Execute([=] { result_callback(std::move(status)); }); + } + }; + + worker_queue_->Enqueue([this, retries, update_callback, async_callback] { + sync_engine_->Transaction(retries, worker_queue_, + std::move(update_callback), + std::move(async_callback)); + }); +} + +void FirestoreClient::AddSnapshotsInSyncListener( + const std::shared_ptr>& user_listener) { + worker_queue_->Enqueue([this, user_listener] { + event_manager_->AddSnapshotsInSyncListener(std::move(user_listener)); + }); +} + +void FirestoreClient::RemoveSnapshotsInSyncListener( + const std::shared_ptr>& user_listener) { + worker_queue_->Enqueue([this, user_listener] { + event_manager_->RemoveSnapshotsInSyncListener(user_listener); + }); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/firestore_client.h b/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.h similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/firestore_client.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.h index 18dbee7ec..8ee7267cc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/firestore_client.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/firestore_client.h @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,55 +14,49 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FIRESTORE_CLIENT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FIRESTORE_CLIENT_H_ - -#import +#ifndef FIRESTORE_CORE_SRC_CORE_FIRESTORE_CLIENT_H_ +#define FIRESTORE_CORE_SRC_CORE_FIRESTORE_CLIENT_H_ #include #include -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" -#include "Firestore/core/src/firebase/firestore/api/query_core.h" -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/core/listen_options.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/query_listener.h" -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/local/local_store.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/delayed_constructor.h" -#include "Firestore/core/src/firebase/firestore/util/empty.h" -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/api/api_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/delayed_constructor.h" +#include "Firestore/core/src/util/empty.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/nullability.h" +#include "Firestore/core/src/util/status_fwd.h" namespace firebase { namespace firestore { -namespace local { -class Persistence; -class LruDelegate; +namespace auth { +class CredentialsProvider; +class User; +} // namespace auth +namespace local { +class LocalStore; +class LruDelegate; +class Persistence; +class QueryEngine; } // namespace local -namespace remote { +namespace model { +class Mutation; +} // namespace model +namespace remote { +class ConnectivityMonitor; class RemoteStore; - } // namespace remote namespace core { -class EventManager; -class SyncEngine; - /** * FirestoreClient is a top-level class that constructs and owns all of the * pieces of the client SDK architecture. @@ -85,11 +79,19 @@ class FirestoreClient : public std::enable_shared_from_this { std::shared_ptr user_executor, std::shared_ptr worker_queue); + ~FirestoreClient(); + + /** + * Synchronously destroys this client, cancels all writes / listeners, and + * releases all resources. + */ + void Dispose(); + /** * Terminates this client, cancels all writes / listeners, and releases all * resources. */ - void Terminate(util::StatusCallback callback); + void TerminateAsync(util::StatusCallback callback); /** * Passes a callback that is triggered when all the pending writes at the @@ -108,7 +110,7 @@ class FirestoreClient : public std::enable_shared_from_this { std::shared_ptr ListenToQuery( Query query, ListenOptions options, - ViewSnapshot::SharedListener&& listener); + ViewSnapshotSharedListener&& listener); /** Stops listening to a query previously listened to. */ void RemoveListener(const std::shared_ptr& listener); @@ -118,14 +120,14 @@ class FirestoreClient : public std::enable_shared_from_this { * doesn't exist, an error will be sent to the callback. */ void GetDocumentFromLocalCache(const api::DocumentReference& doc, - api::DocumentSnapshot::Listener&& callback); + api::DocumentSnapshotListener&& callback); /** * Retrieves a (possibly empty) set of documents from the cache via the * indicated callback. */ void GetDocumentsFromLocalCache(const api::Query& query, - api::QuerySnapshot::Listener&& callback); + api::QuerySnapshotListener&& callback); /** * Write mutations. callback will be notified when it's written to the @@ -184,6 +186,8 @@ class FirestoreClient : public std::enable_shared_from_this { void VerifyNotTerminated(); + void TerminateInternal(); + void ScheduleLruGarbageCollection(); DatabaseInfo database_info_; @@ -200,6 +204,8 @@ class FirestoreClient : public std::enable_shared_from_this { std::unique_ptr persistence_; std::unique_ptr local_store_; + std::unique_ptr query_engine_; + std::unique_ptr connectivity_monitor_; std::unique_ptr remote_store_; std::unique_ptr sync_engine_; std::unique_ptr event_manager_; @@ -216,4 +222,4 @@ class FirestoreClient : public std::enable_shared_from_this { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_FIRESTORE_CLIENT_H_ +#endif // FIRESTORE_CORE_SRC_CORE_FIRESTORE_CLIENT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/in_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/in_filter.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.cc index 03aaf8305..04677d48c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/in_filter.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.cc @@ -14,11 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/in_filter.h" +#include "Firestore/core/src/core/in_filter.h" #include #include +#include "Firestore/core/src/model/document.h" #include "absl/algorithm/container.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.h new file mode 100644 index 000000000..407a33ff1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/in_filter.h @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_IN_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_IN_FILTER_H_ + +#include + +#include "Firestore/core/src/core/field_filter.h" + +namespace firebase { +namespace firestore { + +namespace model { +class FieldPath; +class FieldValue; +} // namespace model + +namespace core { + +/** + * A Filter that implements the IN operator. + */ +class InFilter : public FieldFilter { + public: + InFilter(model::FieldPath field, model::FieldValue value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_IN_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.cc similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_filter.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.cc index 832d2bdcf..1cf21af8c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_filter.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.cc @@ -14,12 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/key_field_filter.h" +#include "Firestore/core/src/core/key_field_filter.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" #include "absl/algorithm/container.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.h similarity index 78% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_filter.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.h index 6ff0ee4fa..6bb9904e9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_filter.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_filter.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_KEY_FIELD_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_KEY_FIELD_FILTER_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_KEY_FIELD_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_KEY_FIELD_FILTER_H_ #include -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" +#include "Firestore/core/src/core/field_filter.h" namespace firebase { namespace firestore { @@ -42,4 +42,4 @@ class KeyFieldFilter : public FieldFilter { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_KEY_FIELD_FILTER_H_ +#endif // FIRESTORE_CORE_SRC_CORE_KEY_FIELD_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.cc new file mode 100644 index 000000000..6c0ae23e5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.cc @@ -0,0 +1,84 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/key_field_in_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::DocumentKey; +using model::FieldPath; +using model::FieldValue; + +using Operator = Filter::Operator; + +class KeyFieldInFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, FieldValue value) + : FieldFilter::Rep(std::move(field), Operator::In, std::move(value)) { + ValidateArrayValue(this->value()); + } + + Type type() const override { + return Type::kKeyFieldInFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +KeyFieldInFilter::KeyFieldInFilter(FieldPath field, FieldValue value) + : FieldFilter( + std::make_shared(std::move(field), std::move(value))) { +} + +bool KeyFieldInFilter::Rep::Matches(const Document& doc) const { + const FieldValue::Array& array_value = value().array_value(); + return Contains(array_value, doc); +} + +bool KeyFieldInFilter::Contains(const FieldValue::Array& array_value, + const Document& doc) { + for (const auto& rhs : array_value) { + if (doc.key() == rhs.reference_value().key()) { + return true; + } + } + return false; +} + +void KeyFieldInFilter::ValidateArrayValue(const FieldValue& value) { + HARD_ASSERT(value.type() == FieldValue::Type::Array, + "Comparing on key with In/NotIn, but the value was not an Array"); + const FieldValue::Array& array_value = value.array_value(); + for (const auto& ref_value : array_value) { + HARD_ASSERT(ref_value.type() == FieldValue::Type::Reference, + "Comparing on key with In/NotIn, but an array value was not" + " a Reference"); + } +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.h new file mode 100644 index 000000000..f12183bab --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_in_filter.h @@ -0,0 +1,52 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_KEY_FIELD_IN_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_KEY_FIELD_IN_FILTER_H_ + +#include + +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/model_fwd.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that matches on an array of key fields. + */ +class KeyFieldInFilter : public FieldFilter { + public: + KeyFieldInFilter(model::FieldPath field, model::FieldValue value); + + private: + class Rep; + + static bool Contains(const model::FieldValue::Array& array_value, + const model::Document& doc); + + static void ValidateArrayValue(const model::FieldValue& value); + + friend class KeyFieldNotInFilter; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_KEY_FIELD_IN_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.cc new file mode 100644 index 000000000..82f474d35 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.cc @@ -0,0 +1,64 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/key_field_not_in_filter.h" +#include "Firestore/core/src/core/key_field_in_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::DocumentKey; +using model::FieldPath; +using model::FieldValue; + +using Operator = Filter::Operator; + +class KeyFieldNotInFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, FieldValue value) + : FieldFilter::Rep(std::move(field), Operator::NotIn, std::move(value)) { + KeyFieldInFilter::ValidateArrayValue(this->value()); + } + + Type type() const override { + return Type::kKeyFieldInFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +KeyFieldNotInFilter::KeyFieldNotInFilter(FieldPath field, FieldValue value) + : FieldFilter( + std::make_shared(std::move(field), std::move(value))) { +} + +bool KeyFieldNotInFilter::Rep::Matches(const Document& doc) const { + const FieldValue::Array& array_value = value().array_value(); + return !KeyFieldInFilter::Contains(array_value, doc); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.h new file mode 100644 index 000000000..f494209bf --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/key_field_not_in_filter.h @@ -0,0 +1,44 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_KEY_FIELD_NOT_IN_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_KEY_FIELD_NOT_IN_FILTER_H_ + +#include + +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/model/model_fwd.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that matches on key fields not present within an array. + */ +class KeyFieldNotInFilter : public FieldFilter { + public: + KeyFieldNotInFilter(model::FieldPath field, model::FieldValue value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_KEY_FIELD_NOT_IN_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/listen_options.h b/Pods/FirebaseFirestore/Firestore/core/src/core/listen_options.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/listen_options.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/listen_options.h index 913fe8693..cf76d8728 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/listen_options.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/listen_options.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_LISTEN_OPTIONS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_LISTEN_OPTIONS_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_LISTEN_OPTIONS_H_ +#define FIRESTORE_CORE_SRC_CORE_LISTEN_OPTIONS_H_ namespace firebase { namespace firestore { @@ -88,4 +88,4 @@ class ListenOptions { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_LISTEN_OPTIONS_H_ +#endif // FIRESTORE_CORE_SRC_CORE_LISTEN_OPTIONS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.cc new file mode 100644 index 000000000..ee3c6cc17 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.cc @@ -0,0 +1,64 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/not_in_filter.h" + +#include +#include + +#include "Firestore/core/src/model/document.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::Document; +using model::FieldPath; +using model::FieldValue; + +using Operator = Filter::Operator; + +class NotInFilter::Rep : public FieldFilter::Rep { + public: + Rep(FieldPath field, FieldValue value) + : FieldFilter::Rep(std::move(field), Operator::NotIn, std::move(value)) { + } + + Type type() const override { + return Type::kNotInFilter; + } + + bool Matches(const model::Document& doc) const override; +}; + +NotInFilter::NotInFilter(FieldPath field, FieldValue value) + : FieldFilter( + std::make_shared(std::move(field), std::move(value))) { +} + +bool NotInFilter::Rep::Matches(const Document& doc) const { + const FieldValue::Array& array_value = value().array_value(); + if (absl::c_linear_search(array_value, FieldValue::Null())) { + return false; + } + absl::optional maybe_lhs = doc.field(field()); + return maybe_lhs && !absl::c_linear_search(array_value, *maybe_lhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.h new file mode 100644 index 000000000..04376bbfb --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/not_in_filter.h @@ -0,0 +1,44 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_NOT_IN_FILTER_H_ +#define FIRESTORE_CORE_SRC_CORE_NOT_IN_FILTER_H_ + +#include + +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/model/model_fwd.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * A Filter that implements the not-in operator. + */ +class NotInFilter : public FieldFilter { + public: + NotInFilter(model::FieldPath field, model::FieldValue value); + + private: + class Rep; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_NOT_IN_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/operator.h b/Pods/FirebaseFirestore/Firestore/core/src/core/operator.h new file mode 100644 index 000000000..eac8239e8 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/operator.h @@ -0,0 +1,41 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_OPERATOR_H_ +#define FIRESTORE_CORE_SRC_CORE_OPERATOR_H_ + +#include "Firestore/core/src/core/filter.h" + +namespace firebase { +namespace firestore { +namespace core { + +inline bool IsArrayOperator(Filter::Operator op) { + return op == Filter::Operator::ArrayContains || + op == Filter::Operator::ArrayContainsAny; +} + +inline bool IsDisjunctiveOperator(Filter::Operator op) { + return op == Filter::Operator::In || + op == Filter::Operator::ArrayContainsAny || + op == Filter::Operator::NotIn; +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_OPERATOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/order_by.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.cc similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/order_by.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/order_by.cc index 741fb4788..fccfae6ac 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/order_by.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.cc @@ -14,12 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/order_by.h" +#include "Firestore/core/src/core/order_by.h" #include -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/util/string_format.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/order_by.h b/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/order_by.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/order_by.h index b0a44f69e..9a7af4932 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/order_by.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/order_by.h @@ -14,22 +14,33 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ORDER_BY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ORDER_BY_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_ORDER_BY_H_ +#define FIRESTORE_CORE_SRC_CORE_ORDER_BY_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/core/direction.h" -#include "Firestore/core/src/firebase/firestore/immutable/append_only_list.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/core/direction.h" +#include "Firestore/core/src/model/field_path.h" namespace firebase { namespace firestore { + +namespace immutable { +template +class AppendOnlyList; +} // namespace immutable + +namespace model { +class Document; +} // namespace model + +namespace util { +enum class ComparisonResult; +} // namespace util + namespace core { /** OrderBy is a field and direction by which to order query results. */ @@ -93,4 +104,4 @@ inline bool operator!=(const OrderBy& lhs, const OrderBy& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ORDER_BY_H_ +#endif // FIRESTORE_CORE_SRC_CORE_ORDER_BY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/query.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/query.cc new file mode 100644 index 000000000..38e7a0072 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/query.cc @@ -0,0 +1,359 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/query.h" + +#include +#include + +#include "Firestore/core/src/core/bound.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/core/operator.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/equality.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/algorithm/container.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace core { + +using Operator = Filter::Operator; +using Type = Filter::Type; + +using model::Document; +using model::DocumentComparator; +using model::DocumentKey; +using model::FieldPath; +using model::ResourcePath; +using util::ComparisonResult; + +Query::Query(ResourcePath path, std::string collection_group) + : path_(std::move(path)), + collection_group_( + std::make_shared(std::move(collection_group))) { +} + +// MARK: - Accessors + +bool Query::IsDocumentQuery() const { + return DocumentKey::IsDocumentKey(path_) && !collection_group_ && + filters_.empty(); +} + +bool Query::MatchesAllDocuments() const { + return filters_.empty() && limit_ == Target::kNoLimit && !start_at_ && + !end_at_ && + (explicit_order_bys_.empty() || + (explicit_order_bys_.size() == 1 && + explicit_order_bys_.front().field().IsKeyFieldPath())); +} + +const FieldPath* Query::InequalityFilterField() const { + for (const auto& filter : filters_) { + if (filter.IsInequality()) { + return &filter.field(); + } + } + return nullptr; +} + +absl::optional Query::FindOperator( + const std::vector& ops) const { + for (const auto& filter : filters_) { + if (filter.IsAFieldFilter()) { + FieldFilter relation_filter(filter); + if (absl::c_linear_search(ops, relation_filter.op())) { + return relation_filter.op(); + } + } + } + return absl::nullopt; +} + +const OrderByList& Query::order_bys() const { + if (memoized_order_bys_.empty()) { + const FieldPath* inequality_field = InequalityFilterField(); + const FieldPath* first_order_by_field = FirstOrderByField(); + if (inequality_field && !first_order_by_field) { + // In order to implicitly add key ordering, we must also add the + // inequality filter field for it to be a valid query. Note that the + // default inequality field and key ordering is ascending. + if (inequality_field->IsKeyFieldPath()) { + memoized_order_bys_ = { + OrderBy(FieldPath::KeyFieldPath(), Direction::Ascending), + }; + } else { + memoized_order_bys_ = { + OrderBy(*inequality_field, Direction::Ascending), + OrderBy(FieldPath::KeyFieldPath(), Direction::Ascending), + }; + } + } else { + HARD_ASSERT( + !inequality_field || *inequality_field == *first_order_by_field, + "First orderBy %s should match inequality field %s.", + first_order_by_field->CanonicalString(), + inequality_field->CanonicalString()); + + OrderByList result = explicit_order_bys_; + + bool found_explicit_key_order = false; + for (const OrderBy& order_by : explicit_order_bys_) { + if (order_by.field().IsKeyFieldPath()) { + found_explicit_key_order = true; + break; + } + } + + if (!found_explicit_key_order) { + // The direction of the implicit key ordering always matches the + // direction of the last explicit sort order + Direction last_direction = explicit_order_bys_.empty() + ? Direction::Ascending + : explicit_order_bys_.back().direction(); + result = result.emplace_back(FieldPath::KeyFieldPath(), last_direction); + } + + memoized_order_bys_ = std::move(result); + } + } + return memoized_order_bys_; +} + +const FieldPath* Query::FirstOrderByField() const { + if (explicit_order_bys_.empty()) { + return nullptr; + } + + return &explicit_order_bys_.front().field(); +} + +LimitType Query::limit_type() const { + return limit_type_; +} + +int32_t Query::limit() const { + HARD_ASSERT(limit_type_ != LimitType::None, + "Called limit() when no limit was set"); + return limit_; +} + +// MARK: - Builder methods + +Query Query::AddingFilter(Filter filter) const { + HARD_ASSERT(!IsDocumentQuery(), "No filter is allowed for document query"); + + const FieldPath* new_inequality_field = nullptr; + if (filter.IsInequality()) { + new_inequality_field = &filter.field(); + } + const FieldPath* query_inequality_field = InequalityFilterField(); + HARD_ASSERT(!query_inequality_field || !new_inequality_field || + *query_inequality_field == *new_inequality_field, + "Query must only have one inequality field."); + + // TODO(rsgowman): ensure first orderby must match inequality field + + return Query(path_, collection_group_, filters_.push_back(std::move(filter)), + explicit_order_bys_, limit_, limit_type_, start_at_, end_at_); +} + +Query Query::AddingOrderBy(OrderBy order_by) const { + HARD_ASSERT(!IsDocumentQuery(), "No ordering is allowed for document query"); + + if (explicit_order_bys_.empty()) { + const FieldPath* inequality = InequalityFilterField(); + HARD_ASSERT(inequality == nullptr || *inequality == order_by.field(), + "First OrderBy must match inequality field."); + } + + return Query(path_, collection_group_, filters_, + explicit_order_bys_.push_back(std::move(order_by)), limit_, + limit_type_, start_at_, end_at_); +} + +Query Query::WithLimitToFirst(int32_t limit) const { + return Query(path_, collection_group_, filters_, explicit_order_bys_, limit, + LimitType::First, start_at_, end_at_); +} + +Query Query::WithLimitToLast(int32_t limit) const { + return Query(path_, collection_group_, filters_, explicit_order_bys_, limit, + LimitType::Last, start_at_, end_at_); +} + +Query Query::StartingAt(Bound bound) const { + return Query(path_, collection_group_, filters_, explicit_order_bys_, limit_, + limit_type_, std::make_shared(std::move(bound)), end_at_); +} + +Query Query::EndingAt(Bound bound) const { + return Query(path_, collection_group_, filters_, explicit_order_bys_, limit_, + limit_type_, start_at_, + std::make_shared(std::move(bound))); +} + +Query Query::AsCollectionQueryAtPath(ResourcePath path) const { + return Query(path, /*collection_group=*/nullptr, filters_, + explicit_order_bys_, limit_, limit_type_, start_at_, end_at_); +} + +// MARK: - Matching + +bool Query::Matches(const Document& doc) const { + return MatchesPathAndCollectionGroup(doc) && MatchesOrderBy(doc) && + MatchesFilters(doc) && MatchesBounds(doc); +} + +bool Query::MatchesPathAndCollectionGroup(const Document& doc) const { + const ResourcePath& doc_path = doc.key().path(); + if (collection_group_) { + // NOTE: path_ is currently always empty since we don't expose Collection + // Group queries rooted at a document path yet. + return doc.key().HasCollectionId(*collection_group_) && + path_.IsPrefixOf(doc_path); + } else if (DocumentKey::IsDocumentKey(path_)) { + // Exact match for document queries. + return path_ == doc_path; + } else { + // Shallow ancestor queries by default. + return path_.IsImmediateParentOf(doc_path); + } +} + +bool Query::MatchesFilters(const Document& doc) const { + for (const auto& filter : filters_) { + if (!filter.Matches(doc)) return false; + } + return true; +} + +bool Query::MatchesOrderBy(const Document& doc) const { + for (const OrderBy& order_by : explicit_order_bys_) { + const FieldPath& field_path = order_by.field(); + // order by key always matches + if (field_path != FieldPath::KeyFieldPath() && + doc.field(field_path) == absl::nullopt) { + return false; + } + } + return true; +} + +bool Query::MatchesBounds(const Document& doc) const { + const OrderByList& ordering = order_bys(); + if (start_at_ && !start_at_->SortsBeforeDocument(ordering, doc)) { + return false; + } + if (end_at_ && end_at_->SortsBeforeDocument(ordering, doc)) { + return false; + } + return true; +} + +model::DocumentComparator Query::Comparator() const { + OrderByList ordering = order_bys(); + + bool has_key_ordering = false; + for (const OrderBy& order_by : ordering) { + if (order_by.field() == FieldPath::KeyFieldPath()) { + has_key_ordering = true; + break; + } + } + HARD_ASSERT(has_key_ordering, + "QueryComparator needs to have a key ordering."); + + return DocumentComparator( + [ordering](const Document& doc1, const Document& doc2) { + for (const OrderBy& order_by : ordering) { + ComparisonResult comp = order_by.Compare(doc1, doc2); + if (!util::Same(comp)) return comp; + } + return ComparisonResult::Same; + }); +} + +const std::string Query::CanonicalId() const { + if (limit_type_ != LimitType::None) { + return absl::StrCat(ToTarget().CanonicalId(), + "|lt:", (limit_type_ == LimitType::Last) ? "l" : "f"); + } + return ToTarget().CanonicalId(); +} + +size_t Query::Hash() const { + return util::Hash(CanonicalId()); +} + +std::string Query::ToString() const { + return absl::StrCat("Query(canonical_id=", CanonicalId(), ")"); +} + +const Target& Query::ToTarget() const& { + if (memoized_target == nullptr) { + if (limit_type_ == LimitType::Last) { + // Flip the orderBy directions since we want the last results + OrderByList new_order_bys; + for (const auto& order_by : order_bys()) { + Direction dir = order_by.direction() == Direction::Descending + ? Direction::Ascending + : Direction::Descending; + new_order_bys = new_order_bys.push_back(OrderBy(order_by.field(), dir)); + } + + // We need to swap the cursors to match the now-flipped query ordering. + auto new_start_at = + (end_at_ != nullptr) + ? std::make_shared(end_at_->position(), !end_at_->before()) + : nullptr; + auto new_end_at = (start_at_ != nullptr) + ? std::make_shared(start_at_->position(), + !start_at_->before()) + : nullptr; + + Target target(path(), collection_group(), filters(), new_order_bys, + limit_, new_start_at, new_end_at); + memoized_target = std::make_shared(std::move(target)); + } else { + Target target(path(), collection_group(), filters(), order_bys(), limit_, + start_at(), end_at()); + memoized_target = std::make_shared(std::move(target)); + } + } + + return *memoized_target; +} + +std::ostream& operator<<(std::ostream& os, const Query& query) { + return os << query.ToString(); +} + +bool operator==(const Query& lhs, const Query& rhs) { + return (lhs.limit_type_ == rhs.limit_type_) && + (lhs.ToTarget() == rhs.ToTarget()); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/query.h b/Pods/FirebaseFirestore/Firestore/core/src/core/query.h new file mode 100644 index 000000000..ee801b571 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/query.h @@ -0,0 +1,300 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_QUERY_H_ +#define FIRESTORE_CORE_SRC_CORE_QUERY_H_ + +#include +#include +#include +#include +#include +#include + +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/core/order_by.h" +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/immutable/append_only_list.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/resource_path.h" + +namespace firebase { +namespace firestore { +namespace core { + +class Bound; + +using CollectionGroupId = std::shared_ptr; + +enum class LimitType { None, First, Last }; + +/** + * Encapsulates all the query attributes we support in the SDK. It represents + * query features visible to user, and can be run against the LocalStore. + * `Query` is first convert to `Target` to run against RemoteStore to query + * backend results, because `Target` encapsulates features backend knows about. + */ +class Query { + public: + Query() = default; + + explicit Query(model::ResourcePath path, + CollectionGroupId collection_group = nullptr) + : path_(std::move(path)), collection_group_(std::move(collection_group)) { + } + + /** + * Initializes a Query with a path and optional additional query constraints. + * Path must currently be empty if this is a collection group query. + */ + Query(model::ResourcePath path, + CollectionGroupId collection_group, + FilterList filters, + OrderByList explicit_order_bys, + int32_t limit, + LimitType limit_type, + std::shared_ptr start_at, + std::shared_ptr end_at) + : path_(std::move(path)), + collection_group_(std::move(collection_group)), + filters_(std::move(filters)), + explicit_order_bys_(std::move(explicit_order_bys)), + limit_(limit), + limit_type_(limit_type), + start_at_(std::move(start_at)), + end_at_(std::move(end_at)) { + } + + Query(model::ResourcePath path, std::string collection_group); + + // MARK: - Accessors + + /** The base path of the query. */ + const model::ResourcePath& path() const { + return path_; + } + + /** The collection group of the query, if any. */ + const std::shared_ptr& collection_group() const { + return collection_group_; + } + + /** Returns true if this Query is for a specific document. */ + bool IsDocumentQuery() const; + + /** Returns true if this Query is a collection group query. */ + bool IsCollectionGroupQuery() const { + return collection_group_ != nullptr; + } + + /** + * Returns true if this query does not specify any query constraints that + * could remove results. + */ + bool MatchesAllDocuments() const; + + /** The filters on the documents returned by the query. */ + const FilterList& filters() const { + return filters_; + } + + /** + * Returns the field of the first filter on this Query that's an inequality, + * or nullptr if there are no inequalities. + */ + const model::FieldPath* InequalityFilterField() const; + + /** + * Checks if any of the provided filter operators are included in the query + * and returns the first one that is, or null if none are. + */ + absl::optional FindOperator( + const std::vector& ops) const; + + /** + * Returns the list of ordering constraints that were explicitly requested on + * the query by the user. + * + * Note that the actual query performed might add additional sort orders to + * match the behavior of the backend. + */ + const OrderByList& explicit_order_bys() const { + return explicit_order_bys_; + } + + /** + * Returns the full list of ordering constraints on the query. + * + * This might include additional sort orders added implicitly to match the + * backend behavior. + */ + const OrderByList& order_bys() const; + + /** Returns the first field in an order-by constraint, or nullptr if none. */ + const model::FieldPath* FirstOrderByField() const; + + bool has_limit_to_first() const { + return limit_type_ == LimitType::First && limit_ != Target::kNoLimit; + } + + bool has_limit_to_last() const { + return limit_type_ == LimitType::Last && limit_ != Target::kNoLimit; + } + + LimitType limit_type() const; + + int32_t limit() const; + + const std::shared_ptr& start_at() const { + return start_at_; + } + + const std::shared_ptr& end_at() const { + return end_at_; + } + + // MARK: - Builder methods + + /** + * Returns a copy of this Query object with the additional specified filter. + */ + Query AddingFilter(Filter filter) const; + + /** + * Returns a copy of this Query object with the additional specified order by. + */ + Query AddingOrderBy(OrderBy order_by) const; + + /** + * Returns a new `Query` that returns the first matching documents up to + * the specified number. + * + * @param limit The maximum number of results to return. If + * `limit == kNoLimit`, then no limit is applied. Otherwise, if + * `limit <= 0`, behavior is unspecified. + */ + Query WithLimitToFirst(int32_t limit) const; + + /** + * Returns a new `Query` that returns the last matching documents up to + * the specified number. + * + * You must specify at least one `OrderBy` clause for `LimitToLast` queries, + * it is an error otherwise. + * + * @param limit The maximum number of results to return. If + * `limit == kNoLimit`, then no limit is applied. Otherwise, if + * `limit <= 0`, behavior is unspecified. + */ + Query WithLimitToLast(int32_t limit) const; + + /** + * Returns a copy of this Query starting at the provided bound. + */ + Query StartingAt(Bound bound) const; + + /** + * Returns a copy of this Query ending at the provided bound. + */ + Query EndingAt(Bound bound) const; + + // MARK: - Matching + + /** + * Converts this collection group query into a collection query at a specific + * path. This is used when executing collection group queries, since we have + * to split the query into a set of collection queries, one for each + * collection in the group. + */ + Query AsCollectionQueryAtPath(model::ResourcePath path) const; + + /** Returns true if the document matches the constraints of this query. */ + bool Matches(const model::Document& doc) const; + + /** + * Returns a comparator that will sort documents according to the order by + * clauses in this query. + */ + model::DocumentComparator Comparator() const; + + const std::string CanonicalId() const; + + std::string ToString() const; + + /** + * Returns a `Target` instance this query will be mapped to in backend + * and local store. + */ + const Target& ToTarget() const&; + + friend std::ostream& operator<<(std::ostream& os, const Query& query); + + friend bool operator==(const Query& lhs, const Query& rhs); + size_t Hash() const; + + private: + bool MatchesPathAndCollectionGroup(const model::Document& doc) const; + bool MatchesFilters(const model::Document& doc) const; + bool MatchesOrderBy(const model::Document& doc) const; + bool MatchesBounds(const model::Document& doc) const; + + model::ResourcePath path_; + std::shared_ptr collection_group_; + + // Filters are shared across related Query instance. i.e. when you call + // Query::Filter(f), a new Query instance is created that contains all of the + // existing filters, plus the new one. (Both Query and Filter objects are + // immutable.) Filters are not shared across unrelated Query instances. + FilterList filters_; + + // A list of fields given to sort by. This does not include the implicit key + // sort at the end. + OrderByList explicit_order_bys_; + + // The memoized list of sort orders. + mutable OrderByList memoized_order_bys_; + + int32_t limit_ = Target::kNoLimit; + LimitType limit_type_ = LimitType::None; + + std::shared_ptr start_at_; + std::shared_ptr end_at_; + + // The corresponding Target of this Query instance. + mutable std::shared_ptr memoized_target; +}; + +bool operator==(const Query& lhs, const Query& rhs); +inline bool operator!=(const Query& lhs, const Query& rhs) { + return !(lhs == rhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +namespace std { + +template <> +struct hash { + size_t operator()(const firebase::firestore::core::Query& query) const { + return query.Hash(); + } +}; + +} // namespace std + +#endif // FIRESTORE_CORE_SRC_CORE_QUERY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query_listener.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.cc similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query_listener.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.cc index fe4e9a44a..7f10ae3a0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query_listener.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.cc @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/query_listener.h" +#include "Firestore/core/src/core/query_listener.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" #include "absl/types/optional.h" namespace firebase { @@ -32,9 +32,37 @@ using model::OnlineState; using model::TargetId; using util::Status; +std::shared_ptr QueryListener::Create( + Query query, ListenOptions options, ViewSnapshotSharedListener&& listener) { + return std::make_shared(std::move(query), std::move(options), + std::move(listener)); +} + +std::shared_ptr QueryListener::Create( + Query query, ViewSnapshotSharedListener&& listener) { + return Create(std::move(query), ListenOptions::DefaultOptions(), + std::move(listener)); +} + +std::shared_ptr QueryListener::Create( + Query query, + ListenOptions options, + util::StatusOrCallback&& listener) { + auto event_listener = + EventListener::Create(std::move(listener)); + return Create(std::move(query), std::move(options), + std::move(event_listener)); +} + +std::shared_ptr QueryListener::Create( + Query query, util::StatusOrCallback&& listener) { + return Create(std::move(query), ListenOptions::DefaultOptions(), + std::move(listener)); +} + QueryListener::QueryListener(Query query, ListenOptions options, - ViewSnapshot::SharedListener&& listener) + ViewSnapshotSharedListener&& listener) : query_(std::move(query)), options_(std::move(options)), listener_(std::move(listener)) { @@ -139,7 +167,8 @@ bool QueryListener::ShouldRaiseEvent(const ViewSnapshot& snapshot) const { } // Generally we should have hit one of the cases above, but it's possible to - // get here if there were only metadata docChanges and they got stripped out. + // get here if there were only metadata document changes and they got stripped + // out. return false; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.h b/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.h new file mode 100644 index 000000000..eec5ada73 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/query_listener.h @@ -0,0 +1,116 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_QUERY_LISTENER_H_ +#define FIRESTORE_CORE_SRC_CORE_QUERY_LISTENER_H_ + +#include +#include + +#include "Firestore/core/src/core/listen_options.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * QueryListener takes a series of internal view snapshots and determines when + * to raise user-facing events. + */ +class QueryListener { + public: + static std::shared_ptr Create( + Query query, + ListenOptions options, + ViewSnapshotSharedListener&& listener); + + static std::shared_ptr Create( + Query query, ViewSnapshotSharedListener&& listener); + + static std::shared_ptr Create( + Query query, + ListenOptions options, + util::StatusOrCallback&& listener); + + static std::shared_ptr Create( + Query query, util::StatusOrCallback&& listener); + + QueryListener(Query query, + ListenOptions options, + ViewSnapshotSharedListener&& listener); + + virtual ~QueryListener() = default; + + const Query& query() const { + return query_; + } + + /** The last received view snapshot. */ + const absl::optional& snapshot() const { + return snapshot_; + } + + /** + * Applies the new ViewSnapshot to this listener, raising a user-facing event + * if applicable (depending on what changed, whether the user has opted into + * metadata-only changes, etc.). Returns true if a user-facing event was + * indeed raised. + */ + virtual bool OnViewSnapshot(ViewSnapshot snapshot); + + virtual void OnError(util::Status error); + + /** Returns whether a snapshot was raised. */ + virtual bool OnOnlineStateChanged(model::OnlineState online_state); + + private: + bool ShouldRaiseInitialEvent(const ViewSnapshot& snapshot, + model::OnlineState online_state) const; + bool ShouldRaiseEvent(const ViewSnapshot& snapshot) const; + void RaiseInitialEvent(const ViewSnapshot& snapshot); + + Query query_; + ListenOptions options_; + + /** + * The EventListener that will process ViewSnapshots associated with this + * query listener. + */ + ViewSnapshotSharedListener listener_; + + /** + * Initial snapshots (e.g. from cache) may not be propagated to the + * ViewSnapshotHandler. This flag is set to true once we've actually raised an + * event. + */ + bool raised_initial_event_ = false; + + /** The last online state this query listener got. */ + model::OnlineState online_state_ = model::OnlineState::Unknown; + + absl::optional snapshot_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_QUERY_LISTENER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.cc new file mode 100644 index 000000000..afe7b4444 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.cc @@ -0,0 +1,571 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/sync_engine.h" + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/core/sync_engine_callback.h" +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/core/transaction_runner.h" +#include "Firestore/core/src/local/local_documents_view.h" +#include "Firestore/core/src/local/local_store.h" +#include "Firestore/core/src/local/local_view_changes.h" +#include "Firestore/core/src/local/local_write_result.h" +#include "Firestore/core/src/local/query_result.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/mutation_batch_result.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" + +namespace firebase { +namespace firestore { +namespace core { + +namespace { + +using auth::User; +using firestore::Error; +using local::LocalStore; +using local::LocalViewChanges; +using local::LocalWriteResult; +using local::QueryPurpose; +using local::QueryResult; +using local::TargetData; +using model::BatchId; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::kBatchIdUnknown; +using model::ListenSequenceNumber; +using model::MaybeDocumentMap; +using model::NoDocument; +using model::SnapshotVersion; +using model::TargetId; +using remote::RemoteEvent; +using remote::TargetChange; +using util::AsyncQueue; +using util::Status; +using util::StatusCallback; + +// Limbo documents don't use persistence, and are eagerly GC'd. So, listens for +// them don't need real sequence numbers. +const ListenSequenceNumber kIrrelevantSequenceNumber = -1; + +bool ErrorIsInteresting(const Status& error) { + bool missing_index = + (error.code() == Error::kErrorFailedPrecondition && + error.error_message().find("requires an index") != std::string::npos); + bool no_permission = (error.code() == Error::kErrorPermissionDenied); + return missing_index || no_permission; +} + +} // namespace + +SyncEngine::SyncEngine(LocalStore* local_store, + remote::RemoteStore* remote_store, + const auth::User& initial_user, + size_t max_concurrent_limbo_resolutions) + : local_store_(local_store), + remote_store_(remote_store), + current_user_(initial_user), + target_id_generator_(TargetIdGenerator::SyncEngineTargetIdGenerator()), + max_concurrent_limbo_resolutions_(max_concurrent_limbo_resolutions) { +} + +void SyncEngine::AssertCallbackExists(absl::string_view source) { + HARD_ASSERT(sync_engine_callback_, + "Tried to call '%s' before callback was registered.", source); +} + +TargetId SyncEngine::Listen(Query query) { + AssertCallbackExists("Listen"); + + HARD_ASSERT(query_views_by_query_.find(query) == query_views_by_query_.end(), + "We already listen to query: %s", query.ToString()); + + TargetData target_data = local_store_->AllocateTarget(query.ToTarget()); + ViewSnapshot view_snapshot = + InitializeViewAndComputeSnapshot(query, target_data.target_id()); + std::vector snapshots; + // Not using the `std::initializer_list` constructor to avoid extra copies. + snapshots.push_back(std::move(view_snapshot)); + sync_engine_callback_->OnViewSnapshots(std::move(snapshots)); + + // TODO(wuandy): move `target_data` into `Listen`. + remote_store_->Listen(target_data); + return target_data.target_id(); +} + +ViewSnapshot SyncEngine::InitializeViewAndComputeSnapshot(const Query& query, + TargetId target_id) { + QueryResult query_result = + local_store_->ExecuteQuery(query, /* use_previous_results= */ true); + + // If there are already queries mapped to the target id, create a synthesized + // target change to apply the sync state from those queries to the new query. + auto current_sync_state = SyncState::None; + absl::optional synthesized_current_change; + if (queries_by_target_.find(target_id) != queries_by_target_.end()) { + const Query& mirror_query = queries_by_target_[target_id][0]; + current_sync_state = + query_views_by_query_[mirror_query]->view().sync_state(); + synthesized_current_change = TargetChange::CreateSynthesizedTargetChange( + current_sync_state == SyncState::Synced); + } + + View view(query, query_result.remote_keys()); + ViewDocumentChanges view_doc_changes = + view.ComputeDocumentChanges(query_result.documents().underlying_map()); + ViewChange view_change = + view.ApplyChanges(view_doc_changes, synthesized_current_change); + UpdateTrackedLimboDocuments(view_change.limbo_changes(), target_id); + + auto query_view = + std::make_shared(query, target_id, std::move(view)); + query_views_by_query_[query] = query_view; + + queries_by_target_[target_id].push_back(query); + + HARD_ASSERT( + view_change.snapshot().has_value(), + "ApplyChanges to documents for new view should always return a snapshot"); + return view_change.snapshot().value(); +} + +void SyncEngine::StopListening(const Query& query) { + AssertCallbackExists("StopListening"); + + auto query_view = query_views_by_query_[query]; + HARD_ASSERT(query_view, "Trying to stop listening to a query not found"); + + query_views_by_query_.erase(query); + + TargetId target_id = query_view->target_id(); + auto& queries = queries_by_target_[target_id]; + queries.erase(std::remove(queries.begin(), queries.end(), query)); + + if (queries.empty()) { + local_store_->ReleaseTarget(target_id); + remote_store_->StopListening(target_id); + RemoveAndCleanupTarget(target_id, Status::OK()); + } +} + +void SyncEngine::RemoveAndCleanupTarget(TargetId target_id, Status status) { + for (const Query& query : queries_by_target_.at(target_id)) { + query_views_by_query_.erase(query); + if (!status.ok()) { + sync_engine_callback_->OnError(query, status); + if (ErrorIsInteresting(status)) { + LOG_WARN("Listen for query at %s failed: %s", + query.path().CanonicalString(), status.error_message()); + } + } + } + queries_by_target_.erase(target_id); + + DocumentKeySet limbo_keys = limbo_document_refs_.ReferencedKeys(target_id); + limbo_document_refs_.RemoveReferences(target_id); + for (const DocumentKey& key : limbo_keys) { + if (!limbo_document_refs_.ContainsKey(key)) { + // We removed the last reference for this key. + RemoveLimboTarget(key); + } + } +} + +void SyncEngine::WriteMutations(std::vector&& mutations, + StatusCallback callback) { + AssertCallbackExists("WriteMutations"); + + LocalWriteResult result = local_store_->WriteLocally(std::move(mutations)); + mutation_callbacks_[current_user_].insert( + std::make_pair(result.batch_id(), std::move(callback))); + + EmitNewSnapshotsAndNotifyLocalStore(result.changes(), absl::nullopt); + remote_store_->FillWritePipeline(); +} + +void SyncEngine::RegisterPendingWritesCallback(StatusCallback callback) { + if (!remote_store_->CanUseNetwork()) { + LOG_DEBUG( + "The network is disabled. The task returned by " + "'waitForPendingWrites()' will not " + "complete until the network is enabled."); + } + + int largest_pending_batch_id = + local_store_->GetHighestUnacknowledgedBatchId(); + + if (largest_pending_batch_id == kBatchIdUnknown) { + // Trigger the callback right away if there is no pending writes at the + // moment. + callback(Status::OK()); + return; + } + + pending_writes_callbacks_[largest_pending_batch_id].push_back( + std::move(callback)); +} + +void SyncEngine::Transaction(int retries, + const std::shared_ptr& worker_queue, + TransactionUpdateCallback update_callback, + TransactionResultCallback result_callback) { + worker_queue->VerifyIsCurrentQueue(); + HARD_ASSERT(retries >= 0, "Got negative number of retries for transaction"); + + // Allocate a shared_ptr so that the TransactionRunner can outlive this frame. + auto runner = std::make_shared(worker_queue, remote_store_, + std::move(update_callback), + std::move(result_callback)); + runner->Run(); +} + +void SyncEngine::HandleCredentialChange(const auth::User& user) { + bool user_changed = (current_user_ != user); + current_user_ = user; + + if (user_changed) { + // Fails callbacks waiting for pending writes requested by previous user. + FailOutstandingPendingWriteCallbacks( + "'waitForPendingWrites' callback is cancelled due to a user change."); + // Notify local store and emit any resulting events from swapping out the + // mutation queue. + MaybeDocumentMap changes = local_store_->HandleUserChange(user); + EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); + } + + // Notify remote store so it can restart its streams. + remote_store_->HandleCredentialChange(); +} + +void SyncEngine::ApplyRemoteEvent(const RemoteEvent& remote_event) { + AssertCallbackExists("HandleRemoteEvent"); + + // Update received document as appropriate for any limbo targets. + for (const auto& entry : remote_event.target_changes()) { + TargetId target_id = entry.first; + const TargetChange& change = entry.second; + auto it = active_limbo_resolutions_by_target_.find(target_id); + if (it == active_limbo_resolutions_by_target_.end()) { + continue; + } + + LimboResolution& limbo_resolution = it->second; + // Since this is a limbo resolution lookup, it's for a single document and + // it could be added, modified, or removed, but not a combination. + auto changed_documents_count = change.added_documents().size() + + change.modified_documents().size() + + change.removed_documents().size(); + HARD_ASSERT( + changed_documents_count <= 1, + "Limbo resolution for single document contains multiple changes."); + + if (!change.added_documents().empty()) { + limbo_resolution.document_received = true; + } else if (!change.modified_documents().empty()) { + HARD_ASSERT(limbo_resolution.document_received, + "Received change for limbo target document without add."); + } else if (!change.removed_documents().empty()) { + HARD_ASSERT(limbo_resolution.document_received, + "Received remove for limbo target document without add."); + limbo_resolution.document_received = false; + } else { + // This was probably just a CURRENT target change or similar. + } + } + + MaybeDocumentMap changes = local_store_->ApplyRemoteEvent(remote_event); + EmitNewSnapshotsAndNotifyLocalStore(changes, remote_event); +} + +void SyncEngine::HandleRejectedListen(TargetId target_id, Status error) { + AssertCallbackExists("HandleRejectedListen"); + + auto it = active_limbo_resolutions_by_target_.find(target_id); + if (it != active_limbo_resolutions_by_target_.end()) { + DocumentKey limbo_key = it->second.key; + // Since this query failed, we won't want to manually unlisten to it. + // So go ahead and remove it from bookkeeping. + active_limbo_targets_by_key_.erase(limbo_key); + active_limbo_resolutions_by_target_.erase(target_id); + PumpEnqueuedLimboResolutions(); + + // TODO(dimond): Retry on transient errors? + + // It's a limbo doc. Create a synthetic event saying it was deleted. This is + // kind of a hack. Ideally, we would have a method in the local store to + // purge a document. However, it would be tricky to keep all of the local + // store's invariants with another method. + NoDocument doc(limbo_key, SnapshotVersion::None(), + /* has_committed_mutations= */ false); + + // Explicitly instantiate these to work around a bug in the default + // constructor of the std::unordered_map that comes with GCC 4.8. Without + // this GCC emits a spurious "chosen constructor is explicit in + // copy-initialization" error. + DocumentKeySet limbo_documents{limbo_key}; + RemoteEvent::TargetChangeMap target_changes; + RemoteEvent::TargetSet target_mismatches; + RemoteEvent::DocumentUpdateMap document_updates{{limbo_key, doc}}; + + RemoteEvent event{SnapshotVersion::None(), std::move(target_changes), + std::move(target_mismatches), std::move(document_updates), + std::move(limbo_documents)}; + ApplyRemoteEvent(event); + } else { + local_store_->ReleaseTarget(target_id); + RemoveAndCleanupTarget(target_id, error); + } +} + +void SyncEngine::HandleSuccessfulWrite( + const model::MutationBatchResult& batch_result) { + AssertCallbackExists("HandleSuccessfulWrite"); + + // The local store may or may not be able to apply the write result and + // raise events immediately (depending on whether the watcher is caught up), + // so we raise user callbacks first so that they consistently happen before + // listen events. + NotifyUser(batch_result.batch().batch_id(), Status::OK()); + + TriggerPendingWriteCallbacks(batch_result.batch().batch_id()); + + MaybeDocumentMap changes = local_store_->AcknowledgeBatch(batch_result); + EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); +} + +void SyncEngine::HandleRejectedWrite( + firebase::firestore::model::BatchId batch_id, Status error) { + AssertCallbackExists("HandleRejectedWrite"); + + MaybeDocumentMap changes = local_store_->RejectBatch(batch_id); + + if (!changes.empty() && ErrorIsInteresting(error)) { + const DocumentKey& min_key = changes.min()->first; + LOG_WARN("Write at %s failed: %s", min_key.ToString(), + error.error_message()); + } + + // The local store may or may not be able to apply the write result and + // raise events immediately (depending on whether the watcher is caught up), + // so we raise user callbacks first so that they consistently happen before + // listen events. + NotifyUser(batch_id, std::move(error)); + + TriggerPendingWriteCallbacks(batch_id); + + EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); +} + +void SyncEngine::HandleOnlineStateChange(model::OnlineState online_state) { + AssertCallbackExists("HandleOnlineStateChange"); + + std::vector new_view_snapshot; + for (const auto& entry : query_views_by_query_) { + const auto& query_view = entry.second; + ViewChange view_change = + query_view->view().ApplyOnlineStateChange(online_state); + HARD_ASSERT(view_change.limbo_changes().empty(), + "OnlineState should not affect limbo documents."); + if (view_change.snapshot().has_value()) { + new_view_snapshot.push_back(*std::move(view_change).snapshot()); + } + } + + sync_engine_callback_->OnViewSnapshots(std::move(new_view_snapshot)); + sync_engine_callback_->HandleOnlineStateChange(online_state); +} + +DocumentKeySet SyncEngine::GetRemoteKeys(TargetId target_id) const { + auto it = active_limbo_resolutions_by_target_.find(target_id); + if (it != active_limbo_resolutions_by_target_.end() && + it->second.document_received) { + return DocumentKeySet{it->second.key}; + } else { + DocumentKeySet keys; + if (queries_by_target_.count(target_id) == 0) { + return keys; + } + + for (const auto& query : queries_by_target_.at(target_id)) { + keys = keys.union_with( + query_views_by_query_.at(query)->view().synced_documents()); + } + return keys; + } +} + +void SyncEngine::NotifyUser(BatchId batch_id, Status status) { + auto it = mutation_callbacks_.find(current_user_); + + // NOTE: Mutations restored from persistence won't have callbacks, so + // it's okay for this (or the callback below) to not exist. + if (it == mutation_callbacks_.end()) { + return; + } + + std::unordered_map& callbacks = it->second; + auto callback_it = callbacks.find(batch_id); + if (callback_it != callbacks.end()) { + callback_it->second(std::move(status)); + callbacks.erase(callback_it); + } +} + +void SyncEngine::TriggerPendingWriteCallbacks(BatchId batch_id) { + auto it = pending_writes_callbacks_.find(batch_id); + if (it != pending_writes_callbacks_.end()) { + for (const auto& callback : it->second) { + callback(Status::OK()); + } + + pending_writes_callbacks_.erase(it); + } +} + +void SyncEngine::FailOutstandingPendingWriteCallbacks( + const std::string& message) { + for (const auto& entry : pending_writes_callbacks_) { + for (const auto& callback : entry.second) { + callback(Status(Error::kErrorCancelled, message)); + } + } + + pending_writes_callbacks_.clear(); +} + +void SyncEngine::EmitNewSnapshotsAndNotifyLocalStore( + const MaybeDocumentMap& changes, + const absl::optional& maybe_remote_event) { + std::vector new_snapshots; + std::vector document_changes_in_all_views; + + for (const auto& entry : query_views_by_query_) { + const auto& query_view = entry.second; + View& view = query_view->view(); + ViewDocumentChanges view_doc_changes = view.ComputeDocumentChanges(changes); + if (view_doc_changes.needs_refill()) { + // The query has a limit and some docs were removed/updated, so we need to + // re-run the query against the local store to make sure we didn't lose + // any good docs that had been past the limit. + QueryResult query_result = local_store_->ExecuteQuery( + query_view->query(), /* use_previous_results= */ false); + view_doc_changes = view.ComputeDocumentChanges( + query_result.documents().underlying_map(), view_doc_changes); + } + + absl::optional target_changes; + if (maybe_remote_event.has_value()) { + const RemoteEvent& remote_event = maybe_remote_event.value(); + auto it = remote_event.target_changes().find(query_view->target_id()); + if (it != remote_event.target_changes().end()) { + target_changes = it->second; + } + } + ViewChange view_change = + view.ApplyChanges(view_doc_changes, target_changes); + + UpdateTrackedLimboDocuments(view_change.limbo_changes(), + query_view->target_id()); + + if (view_change.snapshot().has_value()) { + new_snapshots.push_back(*view_change.snapshot()); + LocalViewChanges doc_changes = LocalViewChanges::FromViewSnapshot( + *view_change.snapshot(), query_view->target_id()); + document_changes_in_all_views.push_back(std::move(doc_changes)); + } + } + + sync_engine_callback_->OnViewSnapshots(std::move(new_snapshots)); + local_store_->NotifyLocalViewChanges(document_changes_in_all_views); +} + +void SyncEngine::UpdateTrackedLimboDocuments( + const std::vector& limbo_changes, TargetId target_id) { + for (const LimboDocumentChange& limbo_change : limbo_changes) { + switch (limbo_change.type()) { + case LimboDocumentChange::Type::Added: + limbo_document_refs_.AddReference(limbo_change.key(), target_id); + TrackLimboChange(limbo_change); + break; + + case LimboDocumentChange::Type::Removed: + LOG_DEBUG("Document no longer in limbo: %s", + limbo_change.key().ToString()); + limbo_document_refs_.RemoveReference(limbo_change.key(), target_id); + if (!limbo_document_refs_.ContainsKey(limbo_change.key())) { + // We removed the last reference for this key + RemoveLimboTarget(limbo_change.key()); + } + break; + + default: + HARD_FAIL("Unknown limbo change type: %s", limbo_change.type()); + } + } +} + +void SyncEngine::TrackLimboChange(const LimboDocumentChange& limbo_change) { + const DocumentKey& key = limbo_change.key(); + if (active_limbo_targets_by_key_.find(key) == + active_limbo_targets_by_key_.end()) { + LOG_DEBUG("New document in limbo: %s", key.ToString()); + enqueued_limbo_resolutions_.push_back(key); + PumpEnqueuedLimboResolutions(); + } +} + +void SyncEngine::PumpEnqueuedLimboResolutions() { + while (!enqueued_limbo_resolutions_.empty() && + active_limbo_targets_by_key_.size() < + max_concurrent_limbo_resolutions_) { + DocumentKey key = enqueued_limbo_resolutions_.front(); + enqueued_limbo_resolutions_.pop_front(); + TargetId limbo_target_id = target_id_generator_.NextId(); + active_limbo_resolutions_by_target_.emplace(limbo_target_id, + LimboResolution{key}); + active_limbo_targets_by_key_.emplace(key, limbo_target_id); + remote_store_->Listen(TargetData(Query(key.path()).ToTarget(), + limbo_target_id, kIrrelevantSequenceNumber, + QueryPurpose::LimboResolution)); + } +} + +void SyncEngine::RemoveLimboTarget(const DocumentKey& key) { + auto it = active_limbo_targets_by_key_.find(key); + if (it == active_limbo_targets_by_key_.end()) { + // This target already got removed, because the query failed. + return; + } + + TargetId limbo_target_id = it->second; + remote_store_->StopListening(limbo_target_id); + active_limbo_targets_by_key_.erase(key); + active_limbo_resolutions_by_target_.erase(limbo_target_id); + PumpEnqueuedLimboResolutions(); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.h b/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.h new file mode 100644 index 000000000..c632378d7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine.h @@ -0,0 +1,327 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_SYNC_ENGINE_H_ +#define FIRESTORE_CORE_SRC_CORE_SYNC_ENGINE_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/target_id_generator.h" +#include "Firestore/core/src/core/view.h" +#include "Firestore/core/src/local/reference_set.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/remote/remote_store.h" +#include "Firestore/core/src/util/status.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { + +namespace local { +class LocalStore; +class TargetData; +} // namespace local + +namespace core { + +class SyncEngineCallback; +class ViewSnapshot; + +/** + * Interface implemented by `SyncEngine` to receive requests from + * `EventManager`. + // PORTING NOTE: This is extracted as an interface to allow gmock to mock + // sync engine. + */ +class QueryEventSource { + public: + virtual ~QueryEventSource() = default; + + virtual void SetCallback(SyncEngineCallback* callback) = 0; + + /** + * Initiates a new listen. The LocalStore will be queried for initial data + * and the listen will be sent to the `RemoteStore` to get remote data. The + * registered SyncEngineCallback will be notified of resulting view + * snapshots and/or listen errors. + * + * @return the target ID assigned to the query. + */ + virtual model::TargetId Listen(Query query) = 0; + + /** Stops listening to a query previously listened to via `Listen`. */ + virtual void StopListening(const Query& query) = 0; +}; + +/** + * SyncEngine is the central controller in the client SDK architecture. It is + * the glue code between the EventManager, LocalStore, and RemoteStore. Some of + * SyncEngine's responsibilities include: + * 1. Coordinating client requests and remote events between the EventManager + * and the local and remote data stores. + * 2. Managing a View object for each query, providing the unified view between + * the local and remote data stores. + * 3. Notifying the RemoteStore when the LocalStore has new mutations in its + * queue that need sending to the backend. + * + * The SyncEngine’s methods should only ever be called by methods running on our + * own worker queue. + */ +class SyncEngine : public remote::RemoteStoreCallback, public QueryEventSource { + public: + SyncEngine(local::LocalStore* local_store, + remote::RemoteStore* remote_store, + const auth::User& initial_user, + size_t max_concurrent_limbo_resolutions); + + // Implements `QueryEventSource`. + void SetCallback(SyncEngineCallback* callback) override { + sync_engine_callback_ = callback; + } + model::TargetId Listen(Query query) override; + void StopListening(const Query& query) override; + + /** + * Initiates the write of local mutation batch which involves adding the + * writes to the mutation queue, notifying the remote store about new + * mutations, and raising events for any changes this write caused. The + * provided callback will be called once the write has been acked or + * rejected by the backend (or failed locally for any other reason). + */ + void WriteMutations(std::vector&& mutations, + util::StatusCallback callback); + + /** + * Registers a user callback that is called when all pending mutations at the + * moment of calling are acknowledged . + */ + void RegisterPendingWritesCallback(util::StatusCallback callback); + + /** + * Runs the given transaction block up to retries times and then calls + * completion. + * + * @param retries The number of times to try before giving up. + * @param worker_queue The queue to dispatch sync engine calls to. + * @param update_callback The callback to call to execute the user's + * transaction. + * @param result_callback The callback to call when the transaction is + * finished or failed. + */ + void Transaction(int retries, + const std::shared_ptr& worker_queue, + core::TransactionUpdateCallback update_callback, + core::TransactionResultCallback result_callback); + + void HandleCredentialChange(const auth::User& user); + + // Implements `RemoteStoreCallback` + void ApplyRemoteEvent(const remote::RemoteEvent& remote_event) override; + void HandleRejectedListen(model::TargetId target_id, + util::Status error) override; + void HandleSuccessfulWrite( + const model::MutationBatchResult& batch_result) override; + void HandleRejectedWrite(model::BatchId batch_id, + util::Status error) override; + void HandleOnlineStateChange(model::OnlineState online_state) override; + model::DocumentKeySet GetRemoteKeys(model::TargetId target_id) const override; + + // For tests only + std::map + GetActiveLimboDocumentResolutions() const { + // Return defensive copy + return active_limbo_targets_by_key_; + } + + // For tests only + std::deque GetEnqueuedLimboDocumentResolutions() const { + // Return defensive copy + return enqueued_limbo_resolutions_; + } + + private: + /** + * QueryView contains all of the info that SyncEngine needs to track for a + * particular query and view. + */ + class QueryView { + public: + QueryView(Query query, model::TargetId target_id, View view) + : query_(std::move(query)), + target_id_(target_id), + view_(std::move(view)) { + } + + const Query& query() const { + return query_; + } + + /** + * The target ID created by the client that is used in the watch stream to + * identify this query. + */ + model::TargetId target_id() const { + return target_id_; + } + + /** + * The view is responsible for computing the final merged truth of what docs + * are in the query. It gets notified of local and remote changes, and + * applies the query filters and limits to determine the most correct + * possible results. + */ + View& view() { + return view_; + } + + private: + Query query_; + model::TargetId target_id_; + View view_; + }; + + /** Tracks a limbo resolution. */ + class LimboResolution { + public: + LimboResolution() = default; + + explicit LimboResolution(const model::DocumentKey& key) : key{key} { + } + + model::DocumentKey key; + + /** + * Set to true once we've received a document. This is used in + * RemoteKeysForTarget and ultimately used by `WatchChangeAggregator` to + * decide whether it needs to manufacture a delete event for the target once + * the target is CURRENT. + */ + bool document_received = false; + }; + + void AssertCallbackExists(absl::string_view source); + + ViewSnapshot InitializeViewAndComputeSnapshot(const Query& query, + model::TargetId target_id); + + void RemoveAndCleanupTarget(model::TargetId target_id, util::Status status); + + void RemoveLimboTarget(const model::DocumentKey& key); + + void EmitNewSnapshotsAndNotifyLocalStore( + const model::MaybeDocumentMap& changes, + const absl::optional& maybe_remote_event); + + /** Updates the limbo document state for the given target_id. */ + void UpdateTrackedLimboDocuments( + const std::vector& limbo_changes, + model::TargetId target_id); + + void TrackLimboChange(const LimboDocumentChange& limbo_change); + + /** + * Starts listens for documents in limbo that are enqueued for resolution, + * subject to a maximum number of concurrent resolutions. + * + * The maximum number of concurrent limbo resolutions is defined in + * max_concurrent_limbo_resolutions_. + * + * Without bounding the number of concurrent resolutions, the server can fail + * with "resource exhausted" errors which can lead to pathological client + * behavior as seen in https://github.com/firebase/firebase-js-sdk/issues/2683 + */ + void PumpEnqueuedLimboResolutions(); + + void NotifyUser(model::BatchId batch_id, util::Status status); + + /** + * Triggers callbacks waiting for this batch id to get acknowledged by + * server, if there are any. + */ + void TriggerPendingWriteCallbacks(model::BatchId batch_id); + void FailOutstandingPendingWriteCallbacks(const std::string& message); + + /** The local store, used to persist mutations and cached documents. */ + local::LocalStore* local_store_ = nullptr; + + /** The remote store for sending writes, watches, etc. to the backend. */ + remote::RemoteStore* remote_store_ = nullptr; + + auth::User current_user_; + SyncEngineCallback* sync_engine_callback_ = nullptr; + + /** + * Used for creating the TargetId for the listens used to resolve limbo + * documents. + */ + TargetIdGenerator target_id_generator_; + + /** Stores user completion blocks, indexed by User and BatchId. */ + std::unordered_map, + auth::HashUser> + mutation_callbacks_; + + /** Stores user callbacks waiting for pending writes to be acknowledged. */ + std::unordered_map> + pending_writes_callbacks_; + + // Shared pointers are used to avoid creating and storing two copies of the + // same `QueryView` and for consistency with other platforms. + /** QueryViews for all active queries, indexed by query. */ + std::unordered_map> query_views_by_query_; + + /** Queries mapped to Targets, indexed by target ID. */ + std::unordered_map> queries_by_target_; + + const size_t max_concurrent_limbo_resolutions_; + + /** + * The keys of documents that are in limbo for which we haven't yet started a + * limbo resolution query. + */ + std::deque enqueued_limbo_resolutions_; + + /** + * Keeps track of the target ID for each document that is in limbo with an + * active target. + */ + std::map active_limbo_targets_by_key_; + + /** + * Keeps track of the information about an active limbo resolution for each + * active target ID that was started for the purpose of limbo resolution. + */ + std::map + active_limbo_resolutions_by_target_; + + /** Used to track any documents that are currently in limbo. */ + local::ReferenceSet limbo_document_refs_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_SYNC_ENGINE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine_callback.h b/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine_callback.h new file mode 100644 index 000000000..64b2ba70b --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/sync_engine_callback.h @@ -0,0 +1,50 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_SYNC_ENGINE_CALLBACK_H_ +#define FIRESTORE_CORE_SRC_CORE_SYNC_ENGINE_CALLBACK_H_ + +#include + +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * Interface implemented by `EventManager` to handle notifications from + * `SyncEngine`. + */ +class SyncEngineCallback { + public: + virtual ~SyncEngineCallback() = default; + + /** Handles a change in online state. */ + virtual void HandleOnlineStateChange(model::OnlineState online_state) = 0; + /** Handles new view snapshots. */ + virtual void OnViewSnapshots(std::vector&& snapshots) = 0; + /** Handles the failure of a query. */ + virtual void OnError(const core::Query& query, const util::Status& error) = 0; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_SYNC_ENGINE_CALLBACK_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/target.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/target.cc new file mode 100644 index 000000000..15d0c90f2 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/target.cc @@ -0,0 +1,107 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/target.h" + +#include + +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/core/operator.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/equality.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace core { + +using model::DocumentKey; +using model::FieldPath; + +// MARK: - Accessors + +bool Target::IsDocumentQuery() const { + return DocumentKey::IsDocumentKey(path_) && !collection_group_ && + filters_.empty(); +} + +const std::string& Target::CanonicalId() const { + if (!canonical_id_.empty()) return canonical_id_; + + std::string result; + absl::StrAppend(&result, path_.CanonicalString()); + + if (collection_group_) { + absl::StrAppend(&result, "|cg:", *collection_group_); + } + + // Add filters. + absl::StrAppend(&result, "|f:"); + for (const auto& filter : filters_) { + absl::StrAppend(&result, filter.CanonicalId()); + } + + // Add order by. + absl::StrAppend(&result, "|ob:"); + for (const OrderBy& order_by : order_bys()) { + absl::StrAppend(&result, order_by.CanonicalId()); + } + + // Add limit. + if (limit_ != kNoLimit) { + absl::StrAppend(&result, "|l:", limit_); + } + + if (start_at_) { + absl::StrAppend(&result, "|lb:", start_at_->CanonicalId()); + } + + if (end_at_) { + absl::StrAppend(&result, "|ub:", end_at_->CanonicalId()); + } + + canonical_id_ = std::move(result); + return canonical_id_; +} + +size_t Target::Hash() const { + return util::Hash(CanonicalId()); +} + +std::string Target::ToString() const { + return absl::StrCat("Target(canonical_id=", CanonicalId(), ")"); +} + +std::ostream& operator<<(std::ostream& os, const Target& target) { + return os << target.ToString(); +} + +bool operator==(const Target& lhs, const Target& rhs) { + return lhs.path() == rhs.path() && + util::Equals(lhs.collection_group(), rhs.collection_group()) && + lhs.filters() == rhs.filters() && lhs.order_bys() == rhs.order_bys() && + lhs.limit() == rhs.limit() && + util::Equals(lhs.start_at(), rhs.start_at()) && + util::Equals(lhs.end_at(), rhs.end_at()); +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/target.h b/Pods/FirebaseFirestore/Firestore/core/src/core/target.h new file mode 100644 index 000000000..c4b649f28 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/target.h @@ -0,0 +1,154 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_TARGET_H_ +#define FIRESTORE_CORE_SRC_CORE_TARGET_H_ + +#include +#include +#include +#include +#include + +#include "Firestore/core/src/core/bound.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/core/order_by.h" +#include "Firestore/core/src/immutable/append_only_list.h" +#include "Firestore/core/src/model/resource_path.h" + +namespace firebase { +namespace firestore { +namespace core { + +using CollectionGroupId = std::shared_ptr; + +/** + * A Target represents the WatchTarget representation of a Query, which is + * used by the LocalStore and the RemoteStore to keep track of and to execute + * backend queries. While multiple Queries can map to the same Target, each + * Target maps to a single WatchTarget in RemoteStore and a single TargetData + * entry in persistence. + */ +class Target { + public: + static constexpr int32_t kNoLimit = std::numeric_limits::max(); + + Target() = default; + + // MARK: - Accessors + + /** The base path of the target. */ + const model::ResourcePath& path() const { + return path_; + } + + /** The collection group of the target, if any. */ + const std::shared_ptr& collection_group() const { + return collection_group_; + } + + /** Returns true if this Target is for a specific document. */ + bool IsDocumentQuery() const; + + /** The filters on the documents returned by the target. */ + const FilterList& filters() const { + return filters_; + } + + /** Returns the list of ordering constraints by the target. */ + const OrderByList& order_bys() const { + return order_bys_; + } + + int32_t limit() const { + return limit_; + } + + const std::shared_ptr& start_at() const { + return start_at_; + } + + const std::shared_ptr& end_at() const { + return end_at_; + } + + const std::string& CanonicalId() const; + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, const Target& target); + + size_t Hash() const; + + private: + /** + * Initializes a Target with a path and additional query constraints. + * Path must currently be empty if this is a collection group query. + * + * NOTE: This is made private and onlyy accessible by `Query`. You should + * always construct Target from `Query.toTarget` because Query provides + * an implicit `orderBy` property. + */ + Target(model::ResourcePath path, + CollectionGroupId collection_group, + FilterList filters, + OrderByList order_bys, + int32_t limit, + std::shared_ptr start_at, + std::shared_ptr end_at) + : path_(std::move(path)), + collection_group_(std::move(collection_group)), + filters_(std::move(filters)), + order_bys_(std::move(order_bys)), + limit_(limit), + start_at_(std::move(start_at)), + end_at_(std::move(end_at)) { + } + friend class Query; + + model::ResourcePath path_; + std::shared_ptr collection_group_; + FilterList filters_; + OrderByList order_bys_; + int32_t limit_ = kNoLimit; + std::shared_ptr start_at_; + std::shared_ptr end_at_; + + mutable std::string canonical_id_; +}; + +bool operator==(const Target& lhs, const Target& rhs); + +inline bool operator!=(const Target& lhs, const Target& rhs) { + return !(lhs == rhs); +} + +} // namespace core +} // namespace firestore +} // namespace firebase + +namespace std { + +template <> +struct hash { + size_t operator()(const firebase::firestore::core::Target& target) const { + return target.Hash(); + } +}; + +} // namespace std + +#endif // FIRESTORE_CORE_SRC_CORE_TARGET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/target_id_generator.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.cc similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/target_id_generator.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.cc index 260cd3216..08ee7f587 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/target_id_generator.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.cc @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/target_id_generator.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/core/target_id_generator.h" + +#include "Firestore/core/src/util/hard_assert.h" using firebase::firestore::model::TargetId; @@ -23,14 +24,9 @@ namespace firebase { namespace firestore { namespace core { -TargetIdGenerator::TargetIdGenerator(const TargetIdGenerator& value) - : generator_id_(value.generator_id_), next_id_(value.next_id_) { -} - TargetIdGenerator::TargetIdGenerator(TargetIdGeneratorId generator_id, TargetId seed) : generator_id_(generator_id) { - generator_id_ = generator_id; seek(seed); } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/target_id_generator.h b/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.h similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/target_id_generator.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.h index 54c492abe..7dbef89ec 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/target_id_generator.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/target_id_generator.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TARGET_ID_GENERATOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TARGET_ID_GENERATOR_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_TARGET_ID_GENERATOR_H_ +#define FIRESTORE_CORE_SRC_CORE_TARGET_ID_GENERATOR_H_ -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/types.h" namespace firebase { namespace firestore { namespace core { /** The set of all valid generators. */ -enum class TargetIdGeneratorId { QueryCache = 0, SyncEngine = 1 }; +enum class TargetIdGeneratorId { TargetCache = 0, SyncEngine = 1 }; /** * Generates monotonically increasing target IDs for sending targets to the @@ -46,20 +46,17 @@ enum class TargetIdGeneratorId { QueryCache = 0, SyncEngine = 1 }; // directly in SyncEngine and LocalStore. class TargetIdGenerator { public: - // Makes Objective-C++ code happy to provide a default ctor. TargetIdGenerator() = default; - TargetIdGenerator(const TargetIdGenerator& value); - /** * Creates and returns the TargetIdGenerator for the local store. * * @param after An ID to start at. Every call to NextId returns a larger id. * @return An instance of TargetIdGenerator. */ - static TargetIdGenerator QueryCacheTargetIdGenerator(model::TargetId after) { - TargetIdGenerator generator(TargetIdGeneratorId::QueryCache, after); - // Make sure that the next call to `nextId()` returns the first value after + static TargetIdGenerator TargetCacheTargetIdGenerator(model::TargetId after) { + TargetIdGenerator generator(TargetIdGeneratorId::TargetCache, after); + // Make sure that the next call to `NextId()` returns the first value after // 'after'. generator.NextId(); return generator; @@ -84,8 +81,9 @@ class TargetIdGenerator { private: TargetIdGenerator(TargetIdGeneratorId generator_id, model::TargetId seed); void seek(model::TargetId target_id); - TargetIdGeneratorId generator_id_; - model::TargetId next_id_; + + TargetIdGeneratorId generator_id_ = TargetIdGeneratorId::TargetCache; + model::TargetId next_id_ = 0; static const int kReservedBits = 1; }; @@ -94,4 +92,4 @@ class TargetIdGenerator { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TARGET_ID_GENERATOR_H_ +#endif // FIRESTORE_CORE_SRC_CORE_TARGET_ID_GENERATOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.cc new file mode 100644 index 000000000..9d5b54d53 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.cc @@ -0,0 +1,236 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/core/transaction.h" + +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/core/user_data.h" +#include "Firestore/core/src/model/delete_mutation.h" +#include "Firestore/core/src/model/verify_mutation.h" +#include "Firestore/core/src/remote/datastore.h" +#include "Firestore/core/src/util/hard_assert.h" + +using firebase::firestore::Error; +using firebase::firestore::core::ParsedSetData; +using firebase::firestore::core::ParsedUpdateData; +using firebase::firestore::model::DeleteMutation; +using firebase::firestore::model::DocumentKey; +using firebase::firestore::model::DocumentKeyHash; +using firebase::firestore::model::MaybeDocument; +using firebase::firestore::model::Mutation; +using firebase::firestore::model::Precondition; +using firebase::firestore::model::SnapshotVersion; +using firebase::firestore::model::VerifyMutation; +using firebase::firestore::remote::Datastore; +using firebase::firestore::util::Status; +using firebase::firestore::util::StatusOr; + +namespace firebase { +namespace firestore { +namespace core { + +Transaction::Transaction(Datastore* datastore) + : datastore_{NOT_NULL(datastore)} { +} + +Status Transaction::RecordVersion(const MaybeDocument& doc) { + SnapshotVersion doc_version; + + if (doc.is_document()) { + doc_version = doc.version(); + } else if (doc.is_no_document()) { + // For deleted docs, we must record an explicit no version to build the + // right precondition when writing. + doc_version = SnapshotVersion::None(); + } else { + HARD_FAIL("Unexpected document type in transaction: %s", doc.type()); + } + + absl::optional existing_version = GetVersion(doc.key()); + if (existing_version.has_value()) { + if (doc_version != existing_version.value()) { + // This transaction will fail no matter what. + return Status{Error::kErrorAborted, + "Document version changed between two reads."}; + } + return Status::OK(); + } else { + read_versions_[doc.key()] = doc_version; + return Status::OK(); + } +} + +void Transaction::Lookup(const std::vector& keys, + LookupCallback&& callback) { + EnsureCommitNotCalled(); + + if (!mutations_.empty()) { + Status lookup_error = Status{Error::kErrorInvalidArgument, + "Firestore transactions require all reads to " + "be executed before all writes"}; + callback(lookup_error); + return; + } + + datastore_->LookupDocuments( + keys, [this, callback]( + const StatusOr>& maybe_documents) { + if (!maybe_documents.ok()) { + callback(maybe_documents.status()); + return; + } + + const auto& documents = maybe_documents.ValueOrDie(); + for (const MaybeDocument& doc : documents) { + Status record_error = RecordVersion(doc); + if (!record_error.ok()) { + callback(record_error); + return; + } + } + + // TODO(varconst): see if `maybe_documents` can be moved into the + // callback. + callback(maybe_documents); + }); +} + +void Transaction::WriteMutations(std::vector&& mutations) { + EnsureCommitNotCalled(); + // `move` will become appropriate once `Mutation` is replaced by the C++ + // equivalent. + std::move(mutations.begin(), mutations.end(), std::back_inserter(mutations_)); +} + +Precondition Transaction::CreatePrecondition(const DocumentKey& key) { + absl::optional version = GetVersion(key); + if (written_docs_.count(key) == 0 && version.has_value()) { + return Precondition::UpdateTime(version.value()); + } else { + return Precondition::None(); + } +} + +StatusOr Transaction::CreateUpdatePrecondition( + const DocumentKey& key) { + absl::optional version = GetVersion(key); + // The first time a document is written, we want to take into account the + // read time and existence. + if (written_docs_.count(key) == 0 && version.has_value()) { + if (version.value() == SnapshotVersion::None()) { + // The document doesn't exist, so fail the transaction. + // + // This has to be validated locally because you can't send a + // precondition that a document does not exist without changing the + // semantics of the backend write to be an insert. This is the reverse + // of what we want, since we want to assert that the document doesn't + // exist but then send the update and have it fail. Since we can't + // express that to the backend, we have to validate locally. + // + // Note: this can change once we can send separate verify writes in the + // transaction. + return Status{Error::kErrorInvalidArgument, + "Can't update a document that doesn't exist."}; + } + // Document exists, just base precondition on document update time. + return Precondition::UpdateTime(version.value()); + } else { + // Document was not read, so we just use the preconditions for a blind + // update. + return Precondition::Exists(true); + } +} + +void Transaction::Set(const DocumentKey& key, ParsedSetData&& data) { + WriteMutations(std::move(data).ToMutations(key, CreatePrecondition(key))); + written_docs_.insert(key); +} + +void Transaction::Update(const DocumentKey& key, ParsedUpdateData&& data) { + StatusOr maybe_precondition = CreateUpdatePrecondition(key); + if (!maybe_precondition.ok()) { + last_write_error_ = maybe_precondition.status(); + } else { + WriteMutations( + std::move(data).ToMutations(key, maybe_precondition.ValueOrDie())); + } + written_docs_.insert(key); +} + +void Transaction::Delete(const DocumentKey& key) { + Mutation mutation = DeleteMutation(key, CreatePrecondition(key)); + WriteMutations({mutation}); + written_docs_.insert(key); +} + +void Transaction::Commit(util::StatusCallback&& callback) { + EnsureCommitNotCalled(); + + // If there was an error writing, raise that error now + if (!last_write_error_.ok()) { + callback(last_write_error_); + return; + } + + // Make a list of read documents that haven't been written. + std::unordered_set unwritten; + for (const auto& kv : read_versions_) { + unwritten.insert(kv.first); + } + // For each mutation, note that the doc was written. + for (const Mutation& mutation : mutations_) { + unwritten.erase(mutation.key()); + } + + // For each document that was read but not written to, we want to perform a + // `verify` operation. + for (const DocumentKey& key : unwritten) { + mutations_.push_back(VerifyMutation(key, CreatePrecondition(key))); + } + committed_ = true; + datastore_->CommitMutations(mutations_, std::move(callback)); +} + +void Transaction::MarkPermanentlyFailed() { + permanent_error_ = true; +} + +bool Transaction::IsPermanentlyFailed() const { + return permanent_error_; +} + +void Transaction::EnsureCommitNotCalled() { + HARD_ASSERT(!committed_, + "A transaction object cannot be used after its " + "update callback has been invoked."); +} + +absl::optional Transaction::GetVersion( + const DocumentKey& key) const { + auto found = read_versions_.find(key); + if (found != read_versions_.end()) { + return found->second; + } + return absl::nullopt; +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction.h b/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/transaction.h index 5537c52e0..ec4e4e8ba 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/transaction.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TRANSACTION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TRANSACTION_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_TRANSACTION_H_ +#define FIRESTORE_CORE_SRC_CORE_TRANSACTION_H_ #include #include @@ -23,20 +23,23 @@ #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" #include "absl/types/any.h" #include "absl/types/optional.h" namespace firebase { namespace firestore { -namespace remote { -class Datastore; +namespace model { +class Precondition; +} // namespace model +namespace remote { +class Datastore; } // namespace remote namespace core { @@ -46,9 +49,8 @@ class ParsedUpdateData; class Transaction { public: - // TODO(varconst): change this to take a single `StatusOr` parameter. using LookupCallback = std::function&, const util::Status&)>; + const util::StatusOr>&)>; Transaction() = default; explicit Transaction(remote::Datastore* transaction); @@ -130,7 +132,7 @@ class Transaction { std::vector mutations_; bool committed_ = false; - bool permanentError_ = false; + bool permanent_error_ = false; /** * A deferred usage error that occurred previously in this transaction that @@ -152,7 +154,7 @@ class Transaction { read_versions_; }; -using TransactionResultCallback = util::StatusOrCallback; +using TransactionResultCallback = util::StatusCallback; /** * TransactionUpdateCallback is a block that wraps a user's transaction update @@ -170,4 +172,4 @@ using TransactionUpdateCallback = std::function + +#include "Firestore/core/src/remote/exponential_backoff.h" +#include "absl/algorithm/container.h" + +namespace firebase { +namespace firestore { +namespace core { +namespace { + +using remote::RemoteStore; +using util::AsyncQueue; +using util::Status; +using util::TimerId; + +/** Maximum number of times a transaction can be retried before failing. */ +constexpr int kRetryCount = 5; + +bool IsRetryableTransactionError(const util::Status& error) { + // In transactions, the backend will fail outdated reads with + // FAILED_PRECONDITION and non-matching document versions with ABORTED. These + // errors should be retried. + Error code = error.code(); + return code == Error::kErrorAborted || + code == Error::kErrorFailedPrecondition || + !remote::Datastore::IsPermanentError(error); +} +} // namespace + +TransactionRunner::TransactionRunner(const std::shared_ptr& queue, + RemoteStore* remote_store, + TransactionUpdateCallback update_callback, + TransactionResultCallback result_callback) + : queue_{queue}, + remote_store_{remote_store}, + update_callback_{std::move(update_callback)}, + result_callback_{std::move(result_callback)}, + backoff_{queue_, TimerId::RetryTransaction}, + retries_left_{kRetryCount} { +} + +void TransactionRunner::Run() { + queue_->VerifyIsCurrentQueue(); + + auto shared_this = this->shared_from_this(); + backoff_.BackoffAndRun([shared_this] { + std::shared_ptr transaction = + shared_this->remote_store_->CreateTransaction(); + shared_this->update_callback_( + transaction, [transaction, shared_this](const util::Status& status) { + shared_this->queue_->Enqueue([transaction, shared_this, status] { + shared_this->ContinueCommit(transaction, status); + }); + }); + }); +} + +void TransactionRunner::ContinueCommit( + const std::shared_ptr& transaction, util::Status status) { + if (!status.ok()) { + HandleTransactionError(transaction, std::move(status)); + } else { + auto shared_this = this->shared_from_this(); + transaction->Commit([shared_this, transaction](Status commit_status) { + shared_this->DispatchResult(transaction, std::move(commit_status)); + }); + } +} + +void TransactionRunner::DispatchResult( + const std::shared_ptr& transaction, Status status) { + if (status.ok()) { + result_callback_(std::move(status)); + } else { + HandleTransactionError(transaction, std::move(status)); + } +} + +void TransactionRunner::HandleTransactionError( + const std::shared_ptr& transaction, Status status) { + if (retries_left_ > 0 && IsRetryableTransactionError(status) && + !transaction->IsPermanentlyFailed()) { + retries_left_ -= 1; + Run(); + } else { + result_callback_(std::move(status)); + } +} + +} // namespace core +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.h b/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.h new file mode 100644 index 000000000..2919103ef --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/transaction_runner.h @@ -0,0 +1,77 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_CORE_TRANSACTION_RUNNER_H_ +#define FIRESTORE_CORE_SRC_CORE_TRANSACTION_RUNNER_H_ + +#include + +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/remote/exponential_backoff.h" +#include "Firestore/core/src/remote/remote_store.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { +namespace core { + +/** + * TransactionRunner encapsulates the logic needed to run and retry transactions + * with backoff. + * + * TransactionRunner manages its own lifetime by keeping itself alive until all + * retries are completed. It must be allocated via + * std::make_shared because the implementation expects to be + * able to call std::shared_from_this to create additional references that will + * keep it alive. + */ +class TransactionRunner + : public std::enable_shared_from_this { + public: + TransactionRunner(const std::shared_ptr& queue, + remote::RemoteStore* remote_store, + core::TransactionUpdateCallback update_callback, + core::TransactionResultCallback result_callback); + + /** + * Runs the transaction and calls the result_callback_ with the result. + */ + void Run(); + + private: + void ContinueCommit(const std::shared_ptr& transaction, + util::Status maybe_result); + + void DispatchResult(const std::shared_ptr& transaction, + util::Status status); + + void HandleTransactionError(const std::shared_ptr& transaction, + util::Status status); + + std::shared_ptr queue_; + remote::RemoteStore* remote_store_; + core::TransactionUpdateCallback update_callback_; + core::TransactionResultCallback result_callback_; + remote::ExponentialBackoff backoff_; + int retries_left_; +}; + +} // namespace core +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_CORE_TRANSACTION_RUNNER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/user_data.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/user_data.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/user_data.cc index 6e8a993ae..b40bdc534 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/user_data.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.cc @@ -14,23 +14,24 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/user_data.h" +#include "Firestore/core/src/core/user_data.h" #include -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/patch_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/set_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/transform_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/patch_mutation.h" +#include "Firestore/core/src/model/set_mutation.h" +#include "Firestore/core/src/model/transform_mutation.h" +#include "Firestore/core/src/model/transform_operation.h" +#include "Firestore/core/src/util/exception.h" +#include "absl/memory/memory.h" #include "absl/strings/match.h" namespace firebase { namespace firestore { namespace core { -using api::ThrowInvalidArgument; using model::DocumentKey; using model::FieldMask; using model::FieldPath; @@ -42,6 +43,7 @@ using model::Precondition; using model::SetMutation; using model::TransformMutation; using model::TransformOperation; +using util::ThrowInvalidArgument; // MARK: - ParseAccumulator @@ -123,10 +125,10 @@ ParseContext ParseContext::ChildContext(const std::string& field_name) { return context; } -ParseContext ParseContext::ChildContext(const FieldPath& fieldPath) { +ParseContext ParseContext::ChildContext(const FieldPath& field_path) { std::unique_ptr path; if (path_) { - path = absl::make_unique(path_->Append(fieldPath)); + path = absl::make_unique(path_->Append(field_path)); } ParseContext context{accumulator_, std::move(path), false}; @@ -161,6 +163,7 @@ bool ParseContext::write() const { case UserDataSource::Update: return true; case UserDataSource::Argument: + case UserDataSource::ArrayArgument: return false; default: ThrowInvalidArgument("Unexpected case for UserDataSource: %s", @@ -181,10 +184,15 @@ void ParseContext::ValidatePath() const { void ParseContext::ValidatePathSegment(absl::string_view segment) const { absl::string_view designator{RESERVED_FIELD_DESIGNATOR}; + if (segment.empty()) { + ThrowInvalidArgument("Invalid data. Document fields must not be empty%s", + FieldDescription()); + } if (write() && absl::StartsWith(segment, designator) && absl::EndsWith(segment, designator)) { - ThrowInvalidArgument("Document fields cannot begin and end with %s%s", - RESERVED_FIELD_DESIGNATOR, FieldDescription()); + ThrowInvalidArgument( + "Invalid data. Document fields cannot begin and end with \"%s\"%s", + RESERVED_FIELD_DESIGNATOR, FieldDescription()); } } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/user_data.h b/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.h similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/user_data.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/user_data.h index e7c6fe268..f7a8184e6 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/user_data.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/user_data.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_USER_DATA_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_USER_DATA_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_USER_DATA_H_ +#define FIRESTORE_CORE_SRC_CORE_USER_DATA_H_ #include #include @@ -23,10 +23,10 @@ #include #include -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_transform.h" +#include "Firestore/core/src/model/field_value.h" namespace firebase { namespace firestore { @@ -61,6 +61,11 @@ enum class UserDataSource { * false. */ Argument, + /** + * Indicates that the source is an Argument that may directly contain nested + * arrays (e.g. the operand of a `in` query). + */ + ArrayArgument }; /** @@ -283,7 +288,7 @@ class ParsedUpdateData { public: ParsedUpdateData(model::ObjectValue data, model::FieldMask field_mask, - std::vector fieldTransforms); + std::vector field_transforms); const model::ObjectValue& data() const { return data_; @@ -314,4 +319,4 @@ class ParsedUpdateData { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_USER_DATA_H_ +#endif // FIRESTORE_CORE_SRC_CORE_USER_DATA_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/view.cc similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/view.cc index 6ec2fa5e1..33a82919d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/view.cc @@ -14,11 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/view.h" +#include "Firestore/core/src/core/view.h" #include -#include "Firestore/core/src/firebase/firestore/model/document_set.h" +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/field_value.h" namespace firebase { namespace firestore { @@ -118,10 +120,15 @@ ViewDocumentChanges View::ComputeDocumentChanges( // Note that this should never get used in a refill (when previous_changes is // set), because there will only be adds -- no deletes or updates. absl::optional last_doc_in_limit; - if (query_.limit() != Query::kNoLimit && + if (query_.has_limit_to_first() && old_document_set.size() == static_cast(query_.limit())) { last_doc_in_limit = old_document_set.GetLastDocument(); } + absl::optional first_doc_in_limit; + if (query_.has_limit_to_last() && + old_document_set.size() == static_cast(query_.limit())) { + first_doc_in_limit = old_document_set.GetFirstDocument(); + } for (const auto& kv : doc_changes) { const DocumentKey& key = kv.first; @@ -161,8 +168,13 @@ ViewDocumentChanges View::ComputeDocumentChanges( DocumentViewChange{*new_doc, DocumentViewChange::Type::Modified}); change_applied = true; - if (last_doc_in_limit && - util::Descending(Compare(*new_doc, *last_doc_in_limit))) { + bool outside_limit = + last_doc_in_limit && + util::Descending(Compare(*new_doc, *last_doc_in_limit)); + bool outside_limit_to_last = + first_doc_in_limit && + util::Ascending(Compare(*new_doc, *first_doc_in_limit)); + if (outside_limit || outside_limit_to_last) { // This doc moved from inside the limit to after the limit. That // means there may be some doc in the local cache that's actually // less than this one. @@ -185,7 +197,7 @@ ViewDocumentChanges View::ComputeDocumentChanges( DocumentViewChange{*old_doc, DocumentViewChange::Type::Removed}); change_applied = true; - if (last_doc_in_limit) { + if (last_doc_in_limit || first_doc_in_limit) { // A doc was removed from a full limit query. We'll need to re-query // from the local cache to see if we know about some other doc that // should be in the results. @@ -208,16 +220,20 @@ ViewDocumentChanges View::ComputeDocumentChanges( } } - int32_t limit = query_.limit(); - if (limit != Query::kNoLimit && - new_document_set.size() > static_cast(limit)) { - for (size_t i = new_document_set.size() - limit; i > 0; --i) { - absl::optional found = new_document_set.GetLastDocument(); - const Document& old_doc = *found; - new_document_set = new_document_set.erase(old_doc.key()); - new_mutated_keys = new_mutated_keys.erase(old_doc.key()); - change_set.AddChange( - DocumentViewChange{old_doc, DocumentViewChange::Type::Removed}); + // Drop documents out to meet limitToFirst/limitToLast requirement. + if (query_.limit_type() != LimitType::None) { + auto limit = static_cast(query_.limit()); + if (limit < new_document_set.size()) { + for (size_t i = new_document_set.size() - limit; i > 0; --i) { + absl::optional found = + query_.has_limit_to_first() ? new_document_set.GetLastDocument() + : new_document_set.GetFirstDocument(); + const Document& old_doc = *found; + new_document_set = new_document_set.erase(old_doc.key()); + new_mutated_keys = new_mutated_keys.erase(old_doc.key()); + change_set.AddChange( + DocumentViewChange{old_doc, DocumentViewChange::Type::Removed}); + } } } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view.h b/Pods/FirebaseFirestore/Firestore/core/src/core/view.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/view.h index 2979fefd7..f73f0dec0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/view.h @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_VIEW_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_VIEW_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_VIEW_H_ +#define FIRESTORE_CORE_SRC_CORE_VIEW_H_ #include #include -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_event.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/remote/remote_event.h" namespace firebase { namespace firestore { @@ -188,6 +188,10 @@ class View { */ core::ViewChange ApplyOnlineStateChange(model::OnlineState online_state); + core::SyncState sync_state() const { + return sync_state_; + } + private: util::ComparisonResult Compare(const model::Document& lhs, const model::Document& rhs) const; @@ -230,4 +234,4 @@ class View { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_VIEW_H_ +#endif // FIRESTORE_CORE_SRC_CORE_VIEW_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view_snapshot.cc b/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.cc similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view_snapshot.cc rename to Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.cc index d148cbb8b..9245a6ed5 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view_snapshot.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.cc @@ -14,14 +14,14 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" +#include "Firestore/core/src/core/view_snapshot.h" #include -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/string_format.h" +#include "Firestore/core/src/util/to_string.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view_snapshot.h b/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view_snapshot.h rename to Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.h index bd088c4b8..2d6fe05cc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/view_snapshot.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/core/view_snapshot.h @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_VIEW_SNAPSHOT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_VIEW_SNAPSHOT_H_ +#ifndef FIRESTORE_CORE_SRC_CORE_VIEW_SNAPSHOT_H_ +#define FIRESTORE_CORE_SRC_CORE_VIEW_SNAPSHOT_H_ #include #include @@ -24,14 +24,14 @@ #include #include -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_map.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" +#include "Firestore/core/src/core/event_listener.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/util/statusor.h" namespace firebase { namespace firestore { @@ -97,9 +97,6 @@ class DocumentViewChangeSet { */ class ViewSnapshot { public: - using Listener = std::unique_ptr>; - using SharedListener = std::shared_ptr>; - ViewSnapshot(Query query, model::DocumentSet documents, model::DocumentSet old_documents, @@ -179,10 +176,13 @@ class ViewSnapshot { bool excludes_metadata_changes_ = false; }; +using ViewSnapshotListener = std::unique_ptr>; +using ViewSnapshotSharedListener = std::shared_ptr>; + bool operator==(const ViewSnapshot& lhs, const ViewSnapshot& rhs); } // namespace core } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_VIEW_SNAPSHOT_H_ +#endif // FIRESTORE_CORE_SRC_CORE_VIEW_SNAPSHOT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.h deleted file mode 100644 index d932c8c12..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_REFERENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_REFERENCE_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" -#include "Firestore/core/src/firebase/firestore/core/listen_options.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/nullability.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" - -namespace firebase { -namespace firestore { -namespace core { - -class ParsedSetData; -class ParsedUpdateData; - -} // namespace core - -namespace api { - -class CollectionReference; -class Firestore; -enum class Source; - -class DocumentReference { - public: - DocumentReference() = default; - DocumentReference(model::ResourcePath path, - std::shared_ptr firestore); - DocumentReference(model::DocumentKey document_key, - std::shared_ptr firestore) - : firestore_{std::move(firestore)}, key_{std::move(document_key)} { - } - - size_t Hash() const; - - const std::shared_ptr& firestore() const { - return firestore_; - } - const model::DocumentKey& key() const { - return key_; - } - - const std::string& document_id() const; - - CollectionReference Parent() const; - - std::string Path() const; - - CollectionReference GetCollectionReference( - const std::string& collection_path) const; - - void SetData(core::ParsedSetData&& setData, util::StatusCallback callback); - - void UpdateData(core::ParsedUpdateData&& updateData, - util::StatusCallback callback); - - void DeleteDocument(util::StatusCallback callback); - - void GetDocument(Source source, DocumentSnapshot::Listener&& callback); - - std::unique_ptr AddSnapshotListener( - core::ListenOptions options, DocumentSnapshot::Listener&& listener); - - private: - std::shared_ptr firestore_; - model::DocumentKey key_; -}; - -bool operator==(const DocumentReference& lhs, const DocumentReference& rhs); - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_REFERENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.mm deleted file mode 100644 index f149a1cbb..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_reference.mm +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" - -#include // NOLINT(build/c++11) -#include - -#include "Firestore/core/src/firebase/firestore/api/collection_reference.h" -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/query_listener_registration.h" -#include "Firestore/core/src/firebase/firestore/api/source.h" -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" -#include "Firestore/core/src/firebase/firestore/core/user_data.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/delete_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/objc/objc_compatibility.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" - -namespace firebase { -namespace firestore { -namespace api { - -using core::AsyncEventListener; -using core::EventListener; -using core::ListenOptions; -using core::QueryListener; -using core::ViewSnapshot; -using model::DeleteMutation; -using model::Document; -using model::DocumentKey; -using model::Precondition; -using model::ResourcePath; -using util::Status; -using util::StatusOr; -using util::StatusOrCallback; - -DocumentReference::DocumentReference(model::ResourcePath path, - std::shared_ptr firestore) - : firestore_{std::move(firestore)} { - if (path.size() % 2 != 0) { - HARD_FAIL( - "Invalid document reference. Document references must have an even " - "number of segments, but %s has %s", - path.CanonicalString(), path.size()); - } - key_ = DocumentKey{std::move(path)}; -} - -size_t DocumentReference::Hash() const { - return util::Hash(firestore_.get(), key_); -} - -const std::string& DocumentReference::document_id() const { - return key_.path().last_segment(); -} - -CollectionReference DocumentReference::Parent() const { - return CollectionReference{key_.path().PopLast(), firestore_}; -} - -std::string DocumentReference::Path() const { - return key_.path().CanonicalString(); -} - -CollectionReference DocumentReference::GetCollectionReference( - const std::string& collection_path) const { - ResourcePath sub_path = ResourcePath::FromString(collection_path); - ResourcePath path = key_.path().Append(sub_path); - return CollectionReference{path, firestore_}; -} - -void DocumentReference::SetData(core::ParsedSetData&& set_data, - util::StatusCallback callback) { - firestore_->client()->WriteMutations( - std::move(set_data).ToMutations(key(), Precondition::None()), - std::move(callback)); -} - -void DocumentReference::UpdateData(core::ParsedUpdateData&& update_data, - util::StatusCallback callback) { - firestore_->client()->WriteMutations( - std::move(update_data).ToMutations(key(), Precondition::Exists(true)), - std::move(callback)); -} - -void DocumentReference::DeleteDocument(util::StatusCallback callback) { - DeleteMutation mutation(key_, Precondition::None()); - firestore_->client()->WriteMutations({mutation}, std::move(callback)); -} - -void DocumentReference::GetDocument(Source source, - DocumentSnapshot::Listener&& callback) { - if (source == Source::Cache) { - firestore_->client()->GetDocumentFromLocalCache(*this, std::move(callback)); - return; - } - - ListenOptions options( - /*include_query_metadata_changes=*/true, - /*include_document_metadata_changes=*/true, - /*wait_for_sync_when_online=*/true); - - class ListenOnce : public EventListener { - public: - ListenOnce(Source source, DocumentSnapshot::Listener&& listener) - : source_(source), listener_(std::move(listener)) { - } - - void OnEvent(StatusOr maybe_snapshot) override { - if (!maybe_snapshot.ok()) { - listener_->OnEvent(std::move(maybe_snapshot)); - return; - } - - DocumentSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); - - // Remove query first before passing event to user to avoid user actions - // affecting the now stale query. - std::unique_ptr registration = - registration_promise_.get_future().get(); - registration->Remove(); - - if (!snapshot.exists() && snapshot.metadata().from_cache()) { - // TODO(dimond): Reconsider how to raise missing documents when - // offline. If we're online and the document doesn't exist then we - // call the callback with a document with document.exists set to - // false. If we're offline however, we call the callback - // with an error. Two options: 1) Cache the negative response from the - // server so we can deliver that even when you're offline. - // 2) Actually call the callback with an error if the - // document doesn't exist when you are offline. - listener_->OnEvent( - Status{Error::Unavailable, - "Failed to get document because the client is offline."}); - } else if (snapshot.exists() && snapshot.metadata().from_cache() && - source_ == Source::Server) { - listener_->OnEvent( - Status{Error::Unavailable, - "Failed to get document from server. (However, " - "this document does exist in the local cache. Run " - "again without setting source to " - "FirestoreSourceServer to retrieve the cached " - "document.)"}); - } else { - listener_->OnEvent(std::move(snapshot)); - } - } - - void Resolve(std::unique_ptr registration) { - registration_promise_.set_value(std::move(registration)); - } - - private: - Source source_; - DocumentSnapshot::Listener listener_; - - std::promise> registration_promise_; - }; - auto listener = absl::make_unique(source, std::move(callback)); - auto listener_unowned = listener.get(); - - std::unique_ptr registration = - AddSnapshotListener(std::move(options), std::move(listener)); - - listener_unowned->Resolve(std::move(registration)); -} - -std::unique_ptr DocumentReference::AddSnapshotListener( - ListenOptions options, DocumentSnapshot::Listener&& user_listener) { - // Convert from ViewSnapshots to DocumentSnapshots. - class Converter : public EventListener { - public: - Converter(DocumentReference* parent, - DocumentSnapshot::Listener&& user_listener) - : firestore_(parent->firestore_), - key_(parent->key_), - user_listener_(std::move(user_listener)) { - } - - void OnEvent(StatusOr maybe_snapshot) override { - if (!maybe_snapshot.ok()) { - user_listener_->OnEvent(maybe_snapshot.status()); - return; - } - - ViewSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); - HARD_ASSERT(snapshot.documents().size() <= 1, - "Too many documents returned on a document query"); - absl::optional document = - snapshot.documents().GetDocument(key_); - - bool has_pending_writes = - document ? snapshot.mutated_keys().contains(key_) - // We don't raise `has_pending_writes` for deleted documents. - : false; - - DocumentSnapshot result{firestore_, key_, document, snapshot.from_cache(), - has_pending_writes}; - user_listener_->OnEvent(std::move(result)); - } - - private: - std::shared_ptr firestore_; - DocumentKey key_; - DocumentSnapshot::Listener user_listener_; - }; - auto view_listener = - absl::make_unique(this, std::move(user_listener)); - - // Call the view_listener on the user Executor. - auto async_listener = AsyncEventListener::Create( - firestore_->client()->user_executor(), std::move(view_listener)); - - core::Query query(key_.path()); - std::shared_ptr query_listener = - firestore_->client()->ListenToQuery(std::move(query), options, - async_listener); - - return absl::make_unique( - firestore_->client(), std::move(async_listener), - std::move(query_listener)); -} - -bool operator==(const DocumentReference& lhs, const DocumentReference& rhs) { - return lhs.firestore() == rhs.firestore() && lhs.key() == rhs.key(); -} - -} // namespace api -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_snapshot.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_snapshot.h deleted file mode 100644 index 8bd889e70..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/document_snapshot.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_SNAPSHOT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_SNAPSHOT_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace api { - -class DocumentReference; -class Firestore; - -class DocumentSnapshot { - public: - using Listener = std::unique_ptr>; - - DocumentSnapshot() = default; - - DocumentSnapshot(std::shared_ptr firestore, - model::DocumentKey document_key, - absl::optional document, - SnapshotMetadata metadata); - - DocumentSnapshot(std::shared_ptr firestore, - model::DocumentKey document_key, - absl::optional document, - bool from_cache, - bool has_pending_writes); - - size_t Hash() const; - - bool exists() const; - const absl::optional& internal_document() const; - const std::string& document_id() const; - - const SnapshotMetadata& metadata() const { - return metadata_; - } - - DocumentReference CreateReference() const; - - absl::optional GetData() const; - absl::optional GetValue( - const model::FieldPath& field_path) const; - - const std::shared_ptr& firestore() const { - return firestore_; - } - - friend bool operator==(const DocumentSnapshot& lhs, - const DocumentSnapshot& rhs); - - private: - std::shared_ptr firestore_; - model::DocumentKey internal_key_; - absl::optional internal_document_; - SnapshotMetadata metadata_; -}; - -inline bool operator!=(const DocumentSnapshot& lhs, - const DocumentSnapshot& rhs) { - return !(lhs == rhs); -} - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_DOCUMENT_SNAPSHOT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/firestore.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/firestore.h deleted file mode 100644 index 1f35cada7..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/firestore.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_FIRESTORE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_FIRESTORE_H_ - -#include -#include // NOLINT(build/c++11) -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/objc/objc_class.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/empty.h" -#include "Firestore/core/src/firebase/firestore/util/nullability.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "absl/types/any.h" - -namespace firebase { -namespace firestore { -namespace core { - -class FirestoreClient; -class Query; - -} // namespace core - -namespace api { - -class CollectionReference; -class DocumentReference; -class WriteBatch; - -class Firestore : public std::enable_shared_from_this { - public: - Firestore() = default; - - Firestore(model::DatabaseId database_id, - std::string persistence_key, - std::shared_ptr credentials_provider, - std::shared_ptr worker_queue, - void* extension); - - const model::DatabaseId& database_id() const { - return database_id_; - } - - const std::string& persistence_key() const { - return persistence_key_; - } - - const std::shared_ptr& client(); - - const std::shared_ptr& worker_queue(); - - void* extension() { - return extension_; - } - - const Settings& settings() const; - void set_settings(const Settings& settings); - - void set_user_executor(std::unique_ptr user_executor); - - CollectionReference GetCollection(absl::string_view collection_path); - DocumentReference GetDocument(absl::string_view document_path); - WriteBatch GetBatch(); - core::Query GetCollectionGroup(std::string collection_id); - - void RunTransaction(core::TransactionUpdateCallback update_callback, - core::TransactionResultCallback result_callback); - - void Terminate(util::StatusCallback callback); - void ClearPersistence(util::StatusCallback callback); - void WaitForPendingWrites(util::StatusCallback callback); - std::unique_ptr AddSnapshotsInSyncListener( - std::unique_ptr> listener); - - void EnableNetwork(util::StatusCallback callback); - void DisableNetwork(util::StatusCallback callback); - - private: - void EnsureClientConfigured(); - core::DatabaseInfo MakeDatabaseInfo() const; - - model::DatabaseId database_id_; - std::shared_ptr credentials_provider_; - std::string persistence_key_; - std::shared_ptr client_; - - std::shared_ptr user_executor_; - std::shared_ptr worker_queue_; - - void* extension_ = nullptr; - - Settings settings_; - - mutable std::mutex mutex_; -}; - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_FIRESTORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/firestore.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/firestore.mm deleted file mode 100644 index b261017dd..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/firestore.mm +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/api/firestore.h" - -#include "Firestore/core/src/firebase/firestore/api/collection_reference.h" -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.h" -#include "Firestore/core/src/firebase/firestore/api/write_batch.h" -#include "Firestore/core/src/firebase/firestore/auth/firebase_credentials_provider_apple.h" -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace api { - -using auth::CredentialsProvider; -using core::AsyncEventListener; -using core::DatabaseInfo; -using core::FirestoreClient; -using core::Transaction; -using local::LevelDbPersistence; -using model::DocumentKey; -using model::ResourcePath; -using util::AsyncQueue; -using util::Empty; -using util::Executor; -using util::Status; - -Firestore::Firestore(model::DatabaseId database_id, - std::string persistence_key, - std::shared_ptr credentials_provider, - std::shared_ptr worker_queue, - void* extension) - : database_id_{std::move(database_id)}, - credentials_provider_{std::move(credentials_provider)}, - persistence_key_{std::move(persistence_key)}, - worker_queue_{std::move(worker_queue)}, - extension_{extension} { -} - -const std::shared_ptr& Firestore::client() { - HARD_ASSERT(client_, "Client is not yet configured."); - return client_; -} - -const std::shared_ptr& Firestore::worker_queue() { - return worker_queue_; -} - -const Settings& Firestore::settings() const { - std::lock_guard lock{mutex_}; - return settings_; -} - -void Firestore::set_settings(const Settings& settings) { - std::lock_guard lock{mutex_}; - if (client_) { - HARD_FAIL( - "Firestore instance has already been started and its settings can " - "no longer be changed. You can only set settings before calling any " - "other methods on a Firestore instance."); - } - settings_ = settings; -} - -void Firestore::set_user_executor(std::unique_ptr user_executor) { - std::lock_guard lock{mutex_}; - HARD_ASSERT(!client_ && user_executor, - "set_user_executor() must be called with a valid executor, " - "before the client is initialized."); - user_executor_ = std::move(user_executor); -} - -CollectionReference Firestore::GetCollection( - absl::string_view collection_path) { - EnsureClientConfigured(); - ResourcePath path = ResourcePath::FromString(collection_path); - return CollectionReference{std::move(path), shared_from_this()}; -} - -DocumentReference Firestore::GetDocument(absl::string_view document_path) { - EnsureClientConfigured(); - return DocumentReference{ResourcePath::FromString(document_path), - shared_from_this()}; -} - -WriteBatch Firestore::GetBatch() { - EnsureClientConfigured(); - return WriteBatch(shared_from_this()); -} - -core::Query Firestore::GetCollectionGroup(std::string collection_id) { - EnsureClientConfigured(); - - return core::Query(ResourcePath::Empty(), std::make_shared( - std::move(collection_id))); -} - -void Firestore::RunTransaction( - core::TransactionUpdateCallback update_callback, - core::TransactionResultCallback result_callback) { - EnsureClientConfigured(); - - client_->Transaction(5, std::move(update_callback), - std::move(result_callback)); -} - -void Firestore::Terminate(util::StatusCallback callback) { - // The client must be initialized to ensure that all subsequent API usage - // throws an exception. - EnsureClientConfigured(); - client_->Terminate(std::move(callback)); -} - -void Firestore::WaitForPendingWrites(util::StatusCallback callback) { - EnsureClientConfigured(); - client_->WaitForPendingWrites(std::move(callback)); -} - -void Firestore::ClearPersistence(util::StatusCallback callback) { - worker_queue()->EnqueueEvenAfterShutdown([this, callback] { - auto Yield = [=](Status status) { - if (callback) { - this->user_executor_->Execute([=] { callback(status); }); - } - }; - - { - std::lock_guard lock{mutex_}; - if (client_ && !client()->is_terminated()) { - Yield(util::Status( - Error::FailedPrecondition, - "Persistence cannot be cleared while the client is running.")); - return; - } - } - - Yield(LevelDbPersistence::ClearPersistence(MakeDatabaseInfo())); - }); -} - -void Firestore::EnableNetwork(util::StatusCallback callback) { - EnsureClientConfigured(); - client_->EnableNetwork(std::move(callback)); -} - -void Firestore::DisableNetwork(util::StatusCallback callback) { - EnsureClientConfigured(); - client_->DisableNetwork(std::move(callback)); -} - -std::unique_ptr Firestore::AddSnapshotsInSyncListener( - std::unique_ptr> listener) { - EnsureClientConfigured(); - auto async_listener = AsyncEventListener::Create( - client_->user_executor(), std::move(listener)); - client_->AddSnapshotsInSyncListener(std::move(async_listener)); - return absl::make_unique( - client_, std::move(async_listener)); -} - -void Firestore::EnsureClientConfigured() { - std::lock_guard lock{mutex_}; - - if (!client_) { - HARD_ASSERT(worker_queue_, "Expected non-null worker queue"); - client_ = FirestoreClient::Create(MakeDatabaseInfo(), settings_, - std::move(credentials_provider_), - user_executor_, worker_queue_); - } -} - -DatabaseInfo Firestore::MakeDatabaseInfo() const { - return DatabaseInfo(database_id_, persistence_key_, settings_.host(), - settings_.ssl_enabled()); -} - -} // namespace api -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/input_validation.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/input_validation.h deleted file mode 100644 index 50cf71110..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/input_validation.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_INPUT_VALIDATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_INPUT_VALIDATION_H_ - -// Routines in this file are used to throw an exception (or crash, depending on -// platform) in response to API usage errors. Exceptions should only be used -// for programmer errors made by consumers of the SDK, e.g. invalid method -// arguments. -// -// These routines avoid conditional compilation in the caller and avoids lint -// warnings around actually throwing exceptions in source. The implementation -// chooses the best way to surface a logic error to the developer. -// -// For recoverable runtime errors, use util::Status, or in pure Objective-C -// code use an NSError** out-parameter. -// -// For internal programming errors, including internal argument checking, use -// HARD_ASSERT or HARD_FAIL(). - -#include - -#include "Firestore/core/src/firebase/firestore/util/string_format.h" - -namespace firebase { -namespace firestore { -namespace api { - -namespace impl { - -[[noreturn]] void ThrowIllegalState(const std::string& message); -[[noreturn]] void ThrowInvalidArgument(const std::string& message); - -} // namespace impl - -/** - * Throws an exception indicating that the user passed an invalid argument. - * - * Invalid argument is interpreted pretty broadly and can mean that the user - * made an incompatible chained method call while building up a larger - * structure, like a query. - */ -template -[[noreturn]] void ThrowInvalidArgument(const char* format, const FA&... args) { - impl::ThrowInvalidArgument(util::StringFormat(format, args...)); -} - -/** - * Throws an exception that indicates the user has attempted to use an API - * that's in an illegal state, usually by violating a precondition of the API - * call. - * - * Good uses of these are things like using a write batch after committing or - * trying to use Firestore without initializing FIRApp. Builder-style APIs that - * haven't done anything yet should likely just stick to ThrowInvalidArgument. - */ -template -[[noreturn]] void ThrowIllegalState(const char* format, const FA&... args) { - impl::ThrowIllegalState(util::StringFormat(format, args...)); -} - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_INPUT_VALIDATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/input_validation_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/input_validation_apple.mm deleted file mode 100644 index 021808d2a..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/input_validation_apple.mm +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" - -#import - -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" - -NS_ASSUME_NONNULL_BEGIN - -namespace firebase { -namespace firestore { -namespace api { -namespace impl { - -static NSException* MakeException(NSString* name, const std::string& message) { - return [[NSException alloc] initWithName:name - reason:util::MakeNSString(message) - userInfo:nil]; -} - -[[noreturn]] void ThrowIllegalState(const std::string& message) { - @throw MakeException(@"FIRIllegalStateException", message); // NOLINT -} - -[[noreturn]] void ThrowInvalidArgument(const std::string& message) { - @throw MakeException(@"FIRInvalidArgumentException", message); // NOLINT -} - -} // namespace impl -} // namespace api -} // namespace firestore -} // namespace firebase - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_core.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_core.mm deleted file mode 100644 index 3cb95c5cf..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_core.mm +++ /dev/null @@ -1,416 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/api/query_core.h" - -#include // NOLINT(build/c++11) -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/query_listener_registration.h" -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" -#include "Firestore/core/src/firebase/firestore/core/operator.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "absl/algorithm/container.h" - -namespace firebase { -namespace firestore { -namespace api { - -namespace util = firebase::firestore::util; -using core::AsyncEventListener; -using core::Bound; -using core::Direction; -using core::EventListener; -using core::FieldFilter; -using core::Filter; -using core::ListenOptions; -using core::QueryListener; -using core::ViewSnapshot; -using model::DocumentKey; -using model::FieldPath; -using model::FieldValue; -using model::ResourcePath; -using util::Status; -using util::StatusOr; - -using Operator = Filter::Operator; - -Query::Query(core::Query query, std::shared_ptr firestore) - : firestore_{std::move(firestore)}, query_{std::move(query)} { -} - -bool operator==(const Query& lhs, const Query& rhs) { - return lhs.firestore() == rhs.firestore() && lhs.query() == rhs.query(); -} - -size_t Query::Hash() const { - return util::Hash(firestore_.get(), query()); -} - -void Query::GetDocuments(Source source, QuerySnapshot::Listener&& callback) { - if (source == Source::Cache) { - firestore_->client()->GetDocumentsFromLocalCache(*this, - std::move(callback)); - return; - } - - ListenOptions options( - /*include_query_metadata_changes=*/true, - /*include_document_metadata_changes=*/true, - /*wait_for_sync_when_online=*/true); - - class ListenOnce : public EventListener { - public: - ListenOnce(Source source, QuerySnapshot::Listener&& listener) - : source_(source), listener_(std::move(listener)) { - } - - void OnEvent(StatusOr maybe_snapshot) override { - if (!maybe_snapshot.ok()) { - listener_->OnEvent(std::move(maybe_snapshot)); - return; - } - - QuerySnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); - - // Remove query first before passing event to user to avoid user actions - // affecting the now stale query. - std::unique_ptr registration = - registration_promise_.get_future().get(); - registration->Remove(); - - if (snapshot.metadata().from_cache() && source_ == Source::Server) { - listener_->OnEvent(Status{ - Error::Unavailable, - "Failed to get documents from server. (However, these documents " - "may exist in the local cache. Run again without setting source to " - "FirestoreSourceServer to retrieve the cached documents.)"}); - } else { - listener_->OnEvent(std::move(snapshot)); - } - }; - - void Resolve(std::unique_ptr registration) { - registration_promise_.set_value(std::move(registration)); - } - - private: - Source source_; - QuerySnapshot::Listener listener_; - - std::promise> registration_promise_; - }; - - auto listener = absl::make_unique(source, std::move(callback)); - auto listener_unowned = listener.get(); - - std::unique_ptr registration = - AddSnapshotListener(std::move(options), std::move(listener)); - - listener_unowned->Resolve(std::move(registration)); -} - -std::unique_ptr Query::AddSnapshotListener( - ListenOptions options, QuerySnapshot::Listener&& user_listener) { - // Convert from ViewSnapshots to QuerySnapshots. - class Converter : public EventListener { - public: - Converter(Query* parent, QuerySnapshot::Listener&& user_listener) - : firestore_(parent->firestore()), - query_(parent->query()), - user_listener_(std::move(user_listener)) { - } - - void OnEvent(StatusOr maybe_snapshot) override { - if (!maybe_snapshot.status().ok()) { - user_listener_->OnEvent(maybe_snapshot.status()); - return; - } - - ViewSnapshot snapshot = std::move(maybe_snapshot).ValueOrDie(); - SnapshotMetadata metadata(snapshot.has_pending_writes(), - snapshot.from_cache()); - - QuerySnapshot result(firestore_, query_, std::move(snapshot), - std::move(metadata)); - - user_listener_->OnEvent(result); - } - - private: - std::shared_ptr firestore_; - core::Query query_; - QuerySnapshot::Listener user_listener_; - }; - auto view_listener = - absl::make_unique(this, std::move(user_listener)); - - // Call the view_listener on the user Executor. - auto async_listener = AsyncEventListener::Create( - firestore_->client()->user_executor(), std::move(view_listener)); - - std::shared_ptr query_listener = - firestore_->client()->ListenToQuery(this->query(), options, - async_listener); - - return absl::make_unique( - firestore_->client(), std::move(async_listener), - std::move(query_listener)); -} - -Query Query::Filter(FieldPath field_path, - Filter::Operator op, - FieldValue field_value, - const std::function& type_describer) const { - if (field_path.IsKeyFieldPath()) { - if (IsArrayOperator(op)) { - ThrowInvalidArgument( - "Invalid query. You can't perform %s queries on document " - "ID since document IDs are not arrays.", - Describe(op)); - } else if (op == Filter::Operator::In) { - ValidateDisjunctiveFilterElements(field_value, op); - std::vector references; - for (const auto& array_value : field_value.array_value()) { - references.push_back( - ParseExpectedReferenceValue(array_value, type_describer)); - } - field_value = FieldValue::FromArray(references); - } else { - field_value = ParseExpectedReferenceValue(field_value, type_describer); - } - } else { - if (IsDisjunctiveOperator(op)) { - ValidateDisjunctiveFilterElements(field_value, op); - } - } - - FieldFilter filter = FieldFilter::Create(field_path, op, field_value); - ValidateNewFilter(filter); - - return Wrap(query_.AddingFilter(std::move(filter))); -} - -Query Query::OrderBy(FieldPath fieldPath, bool descending) const { - return OrderBy(fieldPath, Direction::FromDescending(descending)); -} - -Query Query::OrderBy(FieldPath fieldPath, Direction direction) const { - ValidateNewOrderByPath(fieldPath); - if (query_.start_at()) { - ThrowInvalidArgument("Invalid query. You must not specify a starting point " - "before specifying the order by."); - } - if (query_.end_at()) { - ThrowInvalidArgument("Invalid query. You must not specify an ending point " - "before specifying the order by."); - } - return Wrap( - query_.AddingOrderBy(core::OrderBy(std::move(fieldPath), direction))); -} - -Query Query::Limit(int32_t limit) const { - if (limit <= 0) { - ThrowInvalidArgument( - "Invalid Query. Query limit (%s) is invalid. Limit must be positive.", - limit); - } - return Wrap(query_.WithLimit(limit)); -} - -Query Query::StartAt(Bound bound) const { - return Wrap(query_.StartingAt(std::move(bound))); -} - -Query Query::EndAt(Bound bound) const { - return Wrap(query_.EndingAt(std::move(bound))); -} - -void Query::ValidateNewFilter(const class Filter& filter) const { - if (filter.IsAFieldFilter()) { - FieldFilter field_filter(filter); - - if (field_filter.IsInequality()) { - const FieldPath* existing_inequality = query_.InequalityFilterField(); - const FieldPath* new_inequality = &filter.field(); - - if (existing_inequality && *existing_inequality != *new_inequality) { - ThrowInvalidArgument( - "Invalid Query. All where filters with an inequality (lessThan, " - "lessThanOrEqual, greaterThan, or greaterThanOrEqual) must be on " - "the same field. But you have inequality filters on '%s' and '%s'", - existing_inequality->CanonicalString(), - new_inequality->CanonicalString()); - } - - const FieldPath* first_order_by_field = query_.FirstOrderByField(); - if (first_order_by_field) { - ValidateOrderByField(*first_order_by_field, filter.field()); - } - - } else { - // You can have at most 1 disjunctive filter and 1 array filter. Check if - // the new filter conflicts with an existing one. - absl::optional conflicting_op; - Operator filter_op = field_filter.op(); - - if (IsDisjunctiveOperator(filter_op)) { - conflicting_op = query_.FirstDisjunctiveOperator(); - } - if (!conflicting_op.has_value() && IsArrayOperator(filter_op)) { - conflicting_op = query_.FirstArrayOperator(); - } - if (conflicting_op) { - // We special case when it's a duplicate op to give a slightly clearer - // error message. - if (*conflicting_op == filter_op) { - ThrowInvalidArgument( - "Invalid Query. You cannot use more than one '%s' filter.", - Describe(filter_op)); - } else { - ThrowInvalidArgument("Invalid Query. You cannot use '%s' filters with" - " '%s' filters.", - Describe(filter_op), - Describe(conflicting_op.value())); - } - } - } - } -} - -void Query::ValidateNewOrderByPath(const FieldPath& fieldPath) const { - if (!query_.FirstOrderByField()) { - // This is the first order by. It must match any inequality. - const FieldPath* inequalityField = query_.InequalityFilterField(); - if (inequalityField) { - ValidateOrderByField(fieldPath, *inequalityField); - } - } -} - -void Query::ValidateOrderByField(const FieldPath& orderByField, - const FieldPath& inequalityField) const { - if (orderByField != inequalityField) { - ThrowInvalidArgument( - "Invalid query. You have a where filter with an inequality " - "(lessThan, lessThanOrEqual, greaterThan, or greaterThanOrEqual) on " - "field '%s' and so you must also use '%s' as your first queryOrderedBy " - "field, but your first queryOrderedBy is currently on field '%s' " - "instead.", - inequalityField.CanonicalString(), inequalityField.CanonicalString(), - orderByField.CanonicalString()); - } -} - -void Query::ValidateDisjunctiveFilterElements( - const model::FieldValue& field_value, core::Filter::Operator op) const { - if (field_value.type() != FieldValue::Type::Array || - field_value.array_value().size() == 0) { - ThrowInvalidArgument("Invalid Query. A non-empty array is required for '%s'" - " filters.", - Describe(op)); - } - if (field_value.array_value().size() > 10) { - ThrowInvalidArgument("Invalid Query. '%s' filters support a maximum of 10" - " elements in the value array.", - Describe(op)); - } - - std::vector array = field_value.array_value(); - for (const auto& val : array) { - if (val.is_null()) { - ThrowInvalidArgument( - "Invalid Query. '%s' filters cannot contain 'null' in" - " the value array.", - Describe(op)); - } - if (val.is_nan()) { - ThrowInvalidArgument("Invalid Query. '%s' filters cannot contain 'NaN' in" - " the value array.", - Describe(op)); - } - } -} - -FieldValue Query::ParseExpectedReferenceValue( - const model::FieldValue& field_value, - const std::function& type_describer) const { - if (field_value.type() == FieldValue::Type::String) { - const std::string& document_key = field_value.string_value(); - if (document_key.empty()) { - ThrowInvalidArgument( - "Invalid query. When querying by document ID you must provide a " - "valid document ID, but it was an empty string."); - } - if (!query().IsCollectionGroupQuery() && - document_key.find('/') != std::string::npos) { - ThrowInvalidArgument( - "Invalid query. When querying a collection by document ID you must " - "provide a plain document ID, but '%s' contains a '/' character.", - document_key); - } - ResourcePath path = - query().path().Append(ResourcePath::FromString(document_key)); - if (!DocumentKey::IsDocumentKey(path)) { - ThrowInvalidArgument( - "Invalid query. When querying a collection group by document ID, " - "the value provided must result in a valid document path, but '%s' " - "is not because it has an odd number of segments.", - path.CanonicalString()); - } - return FieldValue::FromReference(firestore_->database_id(), - DocumentKey{path}); - } else if (field_value.type() == FieldValue::Type::Reference) { - return field_value; - } else { - ThrowInvalidArgument( - "Invalid query. When querying by document ID you must provide a " - "valid string or DocumentReference, but it was of type: %s", - type_describer()); - } -} - -std::string Query::Describe(Filter::Operator op) const { - switch (op) { - case Filter::Operator::LessThan: - return "lessThan"; - case Filter::Operator::LessThanOrEqual: - return "lessThanOrEqual"; - case Filter::Operator::Equal: - return "equal"; - case Filter::Operator::GreaterThanOrEqual: - return "greaterThanOrEqual"; - case Filter::Operator::GreaterThan: - return "greaterThan"; - case Filter::Operator::ArrayContains: - return "arrayContains"; - case Filter::Operator::In: - return "in"; - case Filter::Operator::ArrayContainsAny: - return "arrayContainsAny"; - } - - UNREACHABLE(); -} - -} // namespace api -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_listener_registration.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_listener_registration.h deleted file mode 100644 index ca60c7616..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_listener_registration.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_LISTENER_REGISTRATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_LISTENER_REGISTRATION_H_ - -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/listener_registration.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/core/query_listener.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" - -namespace firebase { -namespace firestore { -namespace core { -class FirestoreClient; -} - -namespace api { - -/** - * An internal handle that encapsulates a user's ability to request that we - * stop listening to a query. - */ -class QueryListenerRegistration : public ListenerRegistration { - public: - QueryListenerRegistration( - std::shared_ptr client, - std::shared_ptr> - async_listener, - std::shared_ptr query_listener); - - /** - * Removes the listener being tracked by this QueryListenerRegistration. - */ - void Remove() override; - - private: - /** The client that was used to register this listen. */ - std::shared_ptr client_; - - /** The async listener that is used to mute events synchronously. */ - std::weak_ptr> async_listener_; - - /** The internal QueryListener that can be used to unlisten the query. */ - std::weak_ptr query_listener_; -}; - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_LISTENER_REGISTRATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_listener_registration.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_listener_registration.mm deleted file mode 100644 index a7af87910..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_listener_registration.mm +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/api/query_listener_registration.h" -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" - -namespace firebase { -namespace firestore { -namespace api { - -QueryListenerRegistration::QueryListenerRegistration( - std::shared_ptr client, - std::shared_ptr> - async_listener, - std::shared_ptr query_listener) - : client_(std::move(client)), - async_listener_(std::move(async_listener)), - query_listener_(std::move(query_listener)) { -} - -void QueryListenerRegistration::Remove() { - auto async_listener = async_listener_.lock(); - if (async_listener) { - async_listener->Mute(); - async_listener_.reset(); - } - - auto query_listener = query_listener_.lock(); - if (query_listener) { - client_->RemoveListener(query_listener); - query_listener_.reset(); - } - - client_.reset(); -} - -} // namespace api -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_snapshot.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_snapshot.h deleted file mode 100644 index 91569bfcd..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/query_snapshot.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_SNAPSHOT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_SNAPSHOT_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/document_change.h" -#include "Firestore/core/src/firebase/firestore/api/document_snapshot.h" -#include "Firestore/core/src/firebase/firestore/api/snapshot_metadata.h" -#include "Firestore/core/src/firebase/firestore/core/event_listener.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" - -namespace firebase { -namespace firestore { -namespace api { - -class Query; - -/** - * A `QuerySnapshot` contains zero or more `DocumentSnapshot` objects. - */ -class QuerySnapshot { - public: - using Listener = std::unique_ptr>; - - QuerySnapshot(std::shared_ptr firestore, - core::Query query, - core::ViewSnapshot&& snapshot, - SnapshotMetadata metadata); - - size_t Hash() const; - - /** - * Indicates whether this `QuerySnapshot` is empty (contains no documents). - */ - bool empty() const { - return snapshot_.documents().empty(); - } - - /** The count of documents in this `QuerySnapshot`. */ - size_t size() const { - return snapshot_.documents().size(); - } - - const std::shared_ptr& firestore() const { - return firestore_; - } - - Query query() const; - - const core::Query& internal_query() const; - - /** - * Metadata about this snapshot, concerning its source and if it has local - * modifications. - */ - const SnapshotMetadata& metadata() const { - return metadata_; - } - - /** Iterates over the `DocumentSnapshots` that make up this query snapshot. */ - void ForEachDocument( - const std::function& callback) const; - - /** - * Iterates over the `DocumentChanges` representing the changes between - * the prior snapshot and this one. - */ - void ForEachChange(bool include_metadata_changes, - const std::function& callback) const; - - friend bool operator==(const QuerySnapshot& lhs, const QuerySnapshot& rhs); - - private: - std::shared_ptr firestore_; - core::Query internal_query_; - core::ViewSnapshot snapshot_; - SnapshotMetadata metadata_; -}; - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_QUERY_SNAPSHOT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.mm deleted file mode 100644 index 6a688c3b4..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.mm +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "Firestore/core/src/firebase/firestore/api/snapshots_in_sync_listener_registration.h" - -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" - -namespace firebase { -namespace firestore { -namespace api { - -SnapshotsInSyncListenerRegistration::SnapshotsInSyncListenerRegistration( - std::shared_ptr client, - std::shared_ptr> async_listener) - : client_(std::move(client)), async_listener_(std::move(async_listener)) { -} - -void SnapshotsInSyncListenerRegistration::Remove() { - auto async_listener = async_listener_.lock(); - if (async_listener) { - async_listener->Mute(); - async_listener_.reset(); - } - - client_->RemoveSnapshotsInSyncListener(async_listener); - client_.reset(); -} - -} // namespace api -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/write_batch.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/write_batch.h deleted file mode 100644 index 711d122c8..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/write_batch.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_WRITE_BATCH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_WRITE_BATCH_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" - -namespace firebase { -namespace firestore { -namespace core { - -class ParsedSetData; -class ParsedUpdateData; - -} // namespace core - -namespace api { - -class Firestore; - -class WriteBatch { - public: - explicit WriteBatch(std::shared_ptr firestore) - : firestore_{std::move(firestore)} { - } - - void SetData(const DocumentReference& reference, - core::ParsedSetData&& setData); - void UpdateData(const DocumentReference& reference, - core::ParsedUpdateData&& updateData); - void DeleteData(const DocumentReference& reference); - - void Commit(util::StatusCallback callback); - - const std::shared_ptr& firestore() const { - return firestore_; - } - - private: - std::shared_ptr firestore_; - std::vector mutations_; - bool committed_ = false; - - void VerifyNotCommitted() const; - void ValidateReference(const DocumentReference& reference) const; -}; - -} // namespace api -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_API_WRITE_BATCH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/write_batch.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/write_batch.mm deleted file mode 100644 index ed9536739..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/api/write_batch.mm +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/api/write_batch.h" - -#include - -#include "Firestore/core/src/firebase/firestore/api/document_reference.h" -#include "Firestore/core/src/firebase/firestore/api/firestore.h" -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" -#include "Firestore/core/src/firebase/firestore/core/user_data.h" -#include "Firestore/core/src/firebase/firestore/model/delete_mutation.h" - -namespace firebase { -namespace firestore { -namespace api { - -using model::DeleteMutation; -using model::Mutation; -using model::Precondition; - -void WriteBatch::SetData(const DocumentReference& reference, - core::ParsedSetData&& setData) { - VerifyNotCommitted(); - ValidateReference(reference); - - std::vector append_mutations = std::move(setData).ToMutations( - reference.key(), model::Precondition::None()); - std::move(append_mutations.begin(), append_mutations.end(), - std::back_inserter(mutations_)); -} - -void WriteBatch::UpdateData(const DocumentReference& reference, - core::ParsedUpdateData&& updateData) { - VerifyNotCommitted(); - ValidateReference(reference); - - std::vector append_mutations = - std::move(updateData) - .ToMutations(reference.key(), model::Precondition::Exists(true)); - std::move(append_mutations.begin(), append_mutations.end(), - std::back_inserter(mutations_)); -} - -void WriteBatch::DeleteData(const DocumentReference& reference) { - VerifyNotCommitted(); - ValidateReference(reference); - - mutations_.push_back(DeleteMutation(reference.key(), Precondition::None())); -} - -void WriteBatch::Commit(util::StatusCallback callback) { - VerifyNotCommitted(); - - committed_ = true; - firestore_->client()->WriteMutations(std::move(mutations_), - std::move(callback)); -} - -void WriteBatch::VerifyNotCommitted() const { - if (committed_) { - ThrowIllegalState( - "A write batch can no longer be used after commit has been called."); - } -} - -void WriteBatch::ValidateReference(const DocumentReference& reference) const { - if (reference.firestore() != firestore_) { - ThrowInvalidArgument("Provided document reference is from a different " - "Firestore instance."); - } -} - -} // namespace api -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h deleted file mode 100644 index 67b018e9f..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/auth/empty_credentials_provider.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_EMPTY_CREDENTIALS_PROVIDER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_EMPTY_CREDENTIALS_PROVIDER_H_ - -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" - -namespace firebase { -namespace firestore { -namespace auth { - -/** `EmptyCredentialsProvider` always yields an empty token. */ -class EmptyCredentialsProvider : public CredentialsProvider { - public: - void GetToken(TokenListener completion) override; - void InvalidateToken() override; - void SetCredentialChangeListener( - CredentialChangeListener changeListener) override; -}; - -} // namespace auth -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_AUTH_EMPTY_CREDENTIALS_PROVIDER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_any_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_any_filter.h deleted file mode 100644 index a0ff8fe5b..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_any_filter.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * A Filter that implements the array-contains-any operator. - */ -class ArrayContainsAnyFilter : public FieldFilter { - public: - ArrayContainsAnyFilter(model::FieldPath field, model::FieldValue value); - - private: - class Rep; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ARRAY_CONTAINS_ANY_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_filter.h deleted file mode 100644 index 2c4a230fd..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/array_contains_filter.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ARRAY_CONTAINS_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ARRAY_CONTAINS_FILTER_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * A Filter that implements the array-contains operator. - */ -class ArrayContainsFilter : public FieldFilter { - public: - ArrayContainsFilter(model::FieldPath field, model::FieldValue value); - - private: - class Rep; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_ARRAY_CONTAINS_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_manager.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_manager.h deleted file mode 100644 index bdc943529..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_manager.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_EVENT_MANAGER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_EVENT_MANAGER_H_ - -#include -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/query_listener.h" -#include "Firestore/core/src/firebase/firestore/core/sync_engine.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/objc/objc_class.h" -#include "Firestore/core/src/firebase/firestore/util/empty.h" -#include "Firestore/core/src/firebase/firestore/util/nullability.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "absl/algorithm/container.h" -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * EventManager is responsible for mapping queries to query event listeners. - * It handles "fan-out". (Identical queries will re-use the same watch on the - * backend.) - */ -class EventManager : public SyncEngineCallback { - public: - explicit EventManager(QueryEventSource* query_event_source_); - - /** - * Adds a query listener that will be called with new snapshots for the query. - * The EventManager is responsible for multiplexing many listeners to a single - * listen in the SyncEngine and will perform a listen if it's the first - * QueryListener added for a query. - * - * Returns the targetId of the listen call in the SyncEngine. - */ - model::TargetId AddQueryListener( - std::shared_ptr listener); - - /** - * Removes a previously added listener. It's a no-op if the listener is not - * found. - */ - void RemoveQueryListener(std::shared_ptr listener); - - void AddSnapshotsInSyncListener( - const std::shared_ptr>& listener); - void RemoveSnapshotsInSyncListener( - const std::shared_ptr>& listener); - - // Implements `QueryEventCallback`. - void HandleOnlineStateChange(model::OnlineState online_state) override; - void OnViewSnapshots(std::vector&& snapshots) override; - void OnError(const core::Query& query, const util::Status& error) override; - - private: - /** - * Call all global snapshot listeners that have been set. - */ - void RaiseSnapshotsInSyncEvent(); - - /** - * Holds the listeners and the last received ViewSnapshot for a query being - * tracked by EventManager. - */ - struct QueryListenersInfo { - model::TargetId target_id; - std::vector> listeners; - - bool Erase(const std::shared_ptr& listener) { - auto found_iter = absl::c_find(listeners, listener); - auto found = found_iter != listeners.end(); - if (found) { - listeners.erase(found_iter); - } - return found; - } - - const absl::optional& view_snapshot() const { - return snapshot_; - } - - void set_view_snapshot(const absl::optional& snapshot) { - snapshot_ = snapshot; - } - - private: - // Other members are public in this struct, ensure that any reads are - // copies by requiring reads to go through a const getter. - absl::optional snapshot_; - }; - - QueryEventSource* query_event_source_ = nullptr; - model::OnlineState online_state_ = model::OnlineState::Unknown; - std::unordered_map queries_; - std::unordered_set>> - snapshots_in_sync_listeners_; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_EVENT_MANAGER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_manager.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_manager.mm deleted file mode 100644 index ee8a374cd..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/event_manager.mm +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "Firestore/core/src/firebase/firestore/core/event_manager.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -namespace firebase { -namespace firestore { -namespace core { - -using util::Empty; - -EventManager::EventManager(QueryEventSource* query_event_source) - : query_event_source_(query_event_source) { - query_event_source->SetCallback(this); -} - -model::TargetId EventManager::AddQueryListener( - std::shared_ptr listener) { - const Query& query = listener->query(); - - auto inserted = queries_.emplace(query, QueryListenersInfo{}); - bool first_listen = inserted.second; - QueryListenersInfo& query_info = inserted.first->second; - - query_info.listeners.push_back(listener); - - bool raised_event = listener->OnOnlineStateChanged(online_state_); - HARD_ASSERT(!raised_event, "onOnlineStateChanged() shouldn't raise an event " - "for brand-new listeners."); - - if (query_info.view_snapshot().has_value()) { - raised_event = listener->OnViewSnapshot(query_info.view_snapshot().value()); - if (raised_event) { - RaiseSnapshotsInSyncEvent(); - } - } - - if (first_listen) { - query_info.target_id = query_event_source_->Listen(query); - } - return query_info.target_id; -} - -void EventManager::RemoveQueryListener( - std::shared_ptr listener) { - const Query& query = listener->query(); - bool last_listen = false; - - auto found_iter = queries_.find(query); - if (found_iter != queries_.end()) { - QueryListenersInfo& query_info = found_iter->second; - query_info.Erase(listener); - last_listen = query_info.listeners.empty(); - } - - if (last_listen) { - queries_.erase(found_iter); - query_event_source_->StopListening(query); - } -} - -void EventManager::AddSnapshotsInSyncListener( - const std::shared_ptr>& listener) { - snapshots_in_sync_listeners_.insert(listener); - listener->OnEvent(Empty()); -} - -void EventManager::RemoveSnapshotsInSyncListener( - const std::shared_ptr>& listener) { - snapshots_in_sync_listeners_.erase(listener); -} - -void EventManager::HandleOnlineStateChange(model::OnlineState online_state) { - bool raised_event = false; - online_state_ = online_state; - - for (auto&& kv : queries_) { - QueryListenersInfo& info = kv.second; - for (auto&& listener : info.listeners) { - if (listener->OnOnlineStateChanged(online_state_)) { - raised_event = true; - } - } - } - if (raised_event) { - RaiseSnapshotsInSyncEvent(); - } -} - -void EventManager::RaiseSnapshotsInSyncEvent() { - Empty empty{}; - for (const auto& listener : snapshots_in_sync_listeners_) { - listener->OnEvent(empty); - } -} - -void EventManager::OnViewSnapshots( - std::vector&& snapshots) { - bool raised_event = false; - for (ViewSnapshot& snapshot : snapshots) { - const Query& query = snapshot.query(); - auto found_iter = queries_.find(query); - if (found_iter != queries_.end()) { - QueryListenersInfo& query_info = found_iter->second; - for (const auto& listener : query_info.listeners) { - if (listener->OnViewSnapshot(snapshot)) { - raised_event = true; - } - } - query_info.set_view_snapshot(std::move(snapshot)); - } - } - if (raised_event) { - RaiseSnapshotsInSyncEvent(); - } -} - -void EventManager::OnError(const core::Query& query, - const util::Status& error) { - auto found_iter = queries_.find(query); - if (found_iter == queries_.end()) { - return; - } - - QueryListenersInfo& query_info = found_iter->second; - for (const auto& listener : query_info.listeners) { - listener->OnError(error); - } - - // Remove all listeners. NOTE: We don't need to call - // `SyncEngine::StopListening()` after an error. - queries_.erase(found_iter); -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/firestore_client.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/firestore_client.mm deleted file mode 100644 index 92f5d72e2..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/firestore_client.mm +++ /dev/null @@ -1,469 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/core/firestore_client.h" - -#include // NOLINT(build/c++11) -#include -#include - -#import "Firestore/Source/Local/FSTLocalSerializer.h" -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/core/event_manager.h" -#include "Firestore/core/src/firebase/firestore/core/view.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/remote/datastore.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_store.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/delayed_constructor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace core { - -using firestore::Error; -using api::DocumentReference; -using api::DocumentSnapshot; -using api::ListenerRegistration; -using api::QuerySnapshot; -using api::Settings; -using api::SnapshotMetadata; -using api::ThrowIllegalState; -using auth::CredentialsProvider; -using auth::User; -using local::LevelDbPersistence; -using local::LocalStore; -using local::LruParams; -using local::MemoryPersistence; -using model::DatabaseId; -using model::Document; -using model::DocumentKeySet; -using model::DocumentMap; -using model::MaybeDocument; -using model::Mutation; -using model::OnlineState; -using remote::Datastore; -using remote::RemoteStore; -using util::AsyncQueue; -using util::DelayedConstructor; -using util::DelayedOperation; -using util::Empty; -using util::Executor; -using util::Path; -using util::Status; -using util::StatusCallback; -using util::StatusOr; -using util::StatusOrCallback; -using util::TimerId; - -std::shared_ptr FirestoreClient::Create( - const DatabaseInfo& database_info, - const api::Settings& settings, - std::shared_ptr credentials_provider, - std::shared_ptr user_executor, - std::shared_ptr worker_queue) { - // Have to use `new` because `make_shared` cannot access private constructor. - std::shared_ptr shared_client( - new FirestoreClient(database_info, std::move(credentials_provider), - std::move(user_executor), std::move(worker_queue))); - - std::weak_ptr weak_client(shared_client); - auto credential_change_listener = [weak_client, settings](User user) mutable { - auto shared_client = weak_client.lock(); - if (!shared_client) return; - - if (!shared_client->credentials_initialized_) { - shared_client->credentials_initialized_ = true; - - // When we register the credentials listener for the first time, - // it is invoked synchronously on the calling thread. This ensures that - // the first item enqueued on the worker queue is - // `FirestoreClient::Initialize()`. - shared_client->worker_queue()->Enqueue([shared_client, user, settings] { - shared_client->Initialize(user, settings); - }); - } else { - shared_client->worker_queue()->Enqueue([shared_client, user] { - shared_client->worker_queue()->VerifyIsCurrentQueue(); - - LOG_DEBUG("Credential Changed. Current user: %s", user.uid()); - shared_client->sync_engine_->HandleCredentialChange(user); - }); - } - }; - - shared_client->credentials_provider_->SetCredentialChangeListener( - credential_change_listener); - - HARD_ASSERT( - shared_client->credentials_initialized_, - "CredentialChangeListener not invoked during client initialization"); - - return shared_client; -} - -FirestoreClient::FirestoreClient( - const DatabaseInfo& database_info, - std::shared_ptr credentials_provider, - std::shared_ptr user_executor, - std::shared_ptr worker_queue) - : database_info_(database_info), - credentials_provider_(std::move(credentials_provider)), - worker_queue_(std::move(worker_queue)), - user_executor_(std::move(user_executor)) { -} - -void FirestoreClient::Initialize(const User& user, const Settings& settings) { - // Do all of our initialization on our own dispatch queue. - worker_queue()->VerifyIsCurrentQueue(); - LOG_DEBUG("Initializing. Current user: %s", user.uid()); - - // Note: The initialization work must all be synchronous (we can't dispatch - // more work) since external write/listen operations could get queued to run - // before that subsequent work completes. - if (settings.persistence_enabled()) { - Path dir = LevelDbPersistence::StorageDirectory( - database_info_, LevelDbPersistence::AppDataDirectory()); - - FSTSerializerBeta* remote_serializer = [[FSTSerializerBeta alloc] - initWithDatabaseID:database_info_.database_id()]; - FSTLocalSerializer* serializer = - [[FSTLocalSerializer alloc] initWithRemoteSerializer:remote_serializer]; - - auto created = LevelDbPersistence::Create( - std::move(dir), serializer, - LruParams::WithCacheSize(settings.cache_size_bytes())); - if (!created.ok()) { - // If leveldb fails to start then just throw up our hands: the error is - // unrecoverable. There's nothing an end-user can do and nearly all - // failures indicate the developer is doing something grossly wrong so we - // should stop them cold in their tracks with a failure they can't ignore. - [NSException - raise:NSInternalInconsistencyException - format:@"Failed to open DB: %s", created.status().ToString().c_str()]; - } - - auto ldb = std::move(created).ValueOrDie(); - lru_delegate_ = ldb->reference_delegate(); - - persistence_ = std::move(ldb); - if (settings.gc_enabled()) { - ScheduleLruGarbageCollection(); - } - } else { - persistence_ = MemoryPersistence::WithEagerGarbageCollector(); - } - - local_store_ = absl::make_unique(persistence_.get(), user); - - auto datastore = std::make_shared(database_info_, worker_queue(), - credentials_provider_); - - std::weak_ptr weak_this(shared_from_this()); - remote_store_ = absl::make_unique( - local_store_.get(), std::move(datastore), worker_queue(), - [weak_this](OnlineState online_state) { - weak_this.lock()->sync_engine_->HandleOnlineStateChange(online_state); - }); - - sync_engine_ = absl::make_unique(local_store_.get(), - remote_store_.get(), user); - - event_manager_ = absl::make_unique(sync_engine_.get()); - - // Setup wiring for remote store. - remote_store_->set_sync_engine(sync_engine_.get()); - - // NOTE: RemoteStore depends on LocalStore (for persisting stream tokens, - // refilling mutation queue, etc.) so must be started after LocalStore. - local_store_->Start(); - remote_store_->Start(); -} - -/** - * Schedules a callback to try running LRU garbage collection. Reschedules - * itself after the GC has run. - */ -void FirestoreClient::ScheduleLruGarbageCollection() { - std::chrono::milliseconds delay = - gc_has_run_ ? regular_gc_delay_ : initial_gc_delay_; - auto shared_this = shared_from_this(); - lru_callback_ = worker_queue()->EnqueueAfterDelay( - delay, TimerId::GarbageCollectionDelay, [shared_this] { - shared_this->local_store_->CollectGarbage( - shared_this->lru_delegate_->garbage_collector()); - shared_this->gc_has_run_ = true; - shared_this->ScheduleLruGarbageCollection(); - }); -} - -void FirestoreClient::DisableNetwork(StatusCallback callback) { - VerifyNotTerminated(); - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, callback] { - shared_this->remote_store_->DisableNetwork(); - if (callback) { - shared_this->user_executor()->Execute([=] { callback(Status::OK()); }); - } - }); -} - -void FirestoreClient::EnableNetwork(StatusCallback callback) { - VerifyNotTerminated(); - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, callback] { - shared_this->remote_store_->EnableNetwork(); - if (callback) { - shared_this->user_executor()->Execute([=] { callback(Status::OK()); }); - } - }); -} - -void FirestoreClient::Terminate(StatusCallback callback) { - auto shared_this = shared_from_this(); - worker_queue()->EnqueueAndInitiateShutdown([shared_this, callback] { - shared_this->credentials_provider_->SetCredentialChangeListener(nullptr); - - // If we've scheduled LRU garbage collection, cancel it. - if (shared_this->lru_callback_) { - shared_this->lru_callback_.Cancel(); - } - shared_this->remote_store_->Shutdown(); - shared_this->persistence_->Shutdown(); - }); - - // This separate enqueue ensures if `terminate` is called multiple times - // every time the callback is triggered. If it is in the above - // enqueue, it might not get executed because after first `terminate` - // all operations are not executed. - worker_queue()->EnqueueEvenAfterShutdown([shared_this, callback] { - if (callback) { - shared_this->user_executor()->Execute([=] { callback(Status::OK()); }); - } - }); -} - -void FirestoreClient::WaitForPendingWrites(StatusCallback callback) { - VerifyNotTerminated(); - - // Dispatch the result back onto the user dispatch queue. - auto shared_this = shared_from_this(); - auto async_callback = [shared_this, callback](util::Status status) { - if (callback) { - shared_this->user_executor()->Execute( - [=] { callback(std::move(status)); }); - } - }; - - worker_queue()->Enqueue([shared_this, async_callback] { - shared_this->sync_engine_->RegisterPendingWritesCallback( - std::move(async_callback)); - }); -} - -void FirestoreClient::VerifyNotTerminated() { - if (is_terminated()) { - ThrowIllegalState("The client has already been terminated."); - } -} - -bool FirestoreClient::is_terminated() const { - // Technically, the worker queue is still running, but only accepting tasks - // related to termination or supposed to be run after termination. It is - // effectively terminated to the eyes of users. - return worker_queue()->is_shutting_down(); -} - -std::shared_ptr FirestoreClient::ListenToQuery( - Query query, - ListenOptions options, - ViewSnapshot::SharedListener&& listener) { - VerifyNotTerminated(); - - auto query_listener = QueryListener::Create( - std::move(query), std::move(options), std::move(listener)); - - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, query_listener] { - shared_this->event_manager_->AddQueryListener(std::move(query_listener)); - }); - - return query_listener; -} - -void FirestoreClient::RemoveListener( - const std::shared_ptr& listener) { - // Checks for termination but does not throw error, allowing it to be an no-op - // if client is already terminated. - if (is_terminated()) { - return; - } - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, listener] { - shared_this->event_manager_->RemoveQueryListener(listener); - }); -} - -void FirestoreClient::GetDocumentFromLocalCache( - const DocumentReference& doc, DocumentSnapshot::Listener&& callback) { - VerifyNotTerminated(); - - // TODO(c++14): move `callback` into lambda. - auto shared_callback = absl::ShareUniquePtr(std::move(callback)); - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, doc, shared_callback] { - absl::optional maybe_document = - shared_this->local_store_->ReadDocument(doc.key()); - StatusOr maybe_snapshot; - - if (maybe_document && maybe_document->is_document()) { - Document document(*maybe_document); - maybe_snapshot = DocumentSnapshot{ - doc.firestore(), doc.key(), document, - /*from_cache=*/true, - /*has_pending_writes=*/document.has_local_mutations()}; - } else if (maybe_document && maybe_document->is_no_document()) { - maybe_snapshot = - DocumentSnapshot{doc.firestore(), doc.key(), absl::nullopt, - /*from_cache=*/true, - /*has_pending_writes=*/false}; - } else { - maybe_snapshot = - Status{Error::Unavailable, - "Failed to get document from cache. (However, this document " - "may exist on the server. Run again without setting source to " - "FirestoreSourceCache to attempt to retrieve the document "}; - } - - if (shared_callback) { - shared_this->user_executor()->Execute( - [=] { shared_callback->OnEvent(std::move(maybe_snapshot)); }); - } - }); -} - -void FirestoreClient::GetDocumentsFromLocalCache( - const api::Query& query, QuerySnapshot::Listener&& callback) { - VerifyNotTerminated(); - - // TODO(c++14): move `callback` into lambda. - auto shared_callback = absl::ShareUniquePtr(std::move(callback)); - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, query, shared_callback] { - DocumentMap docs = shared_this->local_store_->ExecuteQuery(query.query()); - - View view(query.query(), DocumentKeySet{}); - ViewDocumentChanges view_doc_changes = - view.ComputeDocumentChanges(docs.underlying_map()); - ViewChange view_change = view.ApplyChanges(view_doc_changes); - HARD_ASSERT( - view_change.limbo_changes().empty(), - "View returned limbo documents during local-only query execution."); - - HARD_ASSERT(view_change.snapshot().has_value(), "Expected a snapshot"); - - ViewSnapshot snapshot = std::move(view_change.snapshot()).value(); - SnapshotMetadata metadata(snapshot.has_pending_writes(), - snapshot.from_cache()); - - QuerySnapshot result(query.firestore(), query.query(), std::move(snapshot), - std::move(metadata)); - - if (shared_callback) { - shared_this->user_executor()->Execute( - [=] { shared_callback->OnEvent(std::move(result)); }); - } - }); -} - -void FirestoreClient::WriteMutations(std::vector&& mutations, - StatusCallback callback) { - VerifyNotTerminated(); - - // TODO(c++14): move `mutations` into lambda (C++14). - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, mutations, callback]() mutable { - if (mutations.empty()) { - if (callback) { - shared_this->user_executor()->Execute([=] { callback(Status::OK()); }); - } - } else { - shared_this->sync_engine_->WriteMutations( - std::move(mutations), [callback, shared_this](Status error) { - // Dispatch the result back onto the user dispatch queue. - if (callback) { - shared_this->user_executor()->Execute( - [=] { callback(std::move(error)); }); - } - }); - } - }); -} - -void FirestoreClient::Transaction(int retries, - TransactionUpdateCallback update_callback, - TransactionResultCallback result_callback) { - VerifyNotTerminated(); - - // Dispatch the result back onto the user dispatch queue. - auto shared_this = shared_from_this(); - auto async_callback = [shared_this, - result_callback](StatusOr maybe_value) { - if (result_callback) { - shared_this->user_executor()->Execute( - [=] { result_callback(std::move(maybe_value)); }); - } - }; - - worker_queue()->Enqueue([shared_this, retries, update_callback, - async_callback] { - shared_this->sync_engine_->Transaction(retries, shared_this->worker_queue(), - std::move(update_callback), - std::move(async_callback)); - }); -} - -void FirestoreClient::AddSnapshotsInSyncListener( - const std::shared_ptr>& user_listener) { - auto shared_this = shared_from_this(); - worker_queue()->Enqueue([shared_this, user_listener] { - shared_this->event_manager_->AddSnapshotsInSyncListener( - std::move(user_listener)); - }); -} - -void FirestoreClient::RemoveSnapshotsInSyncListener( - const std::shared_ptr>& user_listener) { - event_manager_->RemoveSnapshotsInSyncListener(user_listener); -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/in_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/in_filter.h deleted file mode 100644 index 44c62cd3c..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/in_filter.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_IN_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_IN_FILTER_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * A Filter that implements the IN operator. - */ -class InFilter : public FieldFilter { - public: - InFilter(model::FieldPath field, model::FieldValue value); - - private: - class Rep; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_IN_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_in_filter.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_in_filter.cc deleted file mode 100644 index c88b93041..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_in_filter.cc +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/core/key_field_in_filter.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "absl/algorithm/container.h" - -namespace firebase { -namespace firestore { -namespace core { - -using model::Document; -using model::DocumentKey; -using model::FieldPath; -using model::FieldValue; - -using Operator = Filter::Operator; - -class KeyFieldInFilter::Rep : public FieldFilter::Rep { - public: - Rep(FieldPath field, FieldValue value) - : FieldFilter::Rep(std::move(field), Operator::In, std::move(value)) { - const FieldValue::Array& array_value = this->value().array_value(); - for (const auto& ref_value : array_value) { - HARD_ASSERT(ref_value.type() == FieldValue::Type::Reference, - "Comparing on key with IN, but an array value was not" - " a Reference"); - } - } - - Type type() const override { - return Type::kKeyFieldInFilter; - } - - bool Matches(const model::Document& doc) const override; -}; - -KeyFieldInFilter::KeyFieldInFilter(FieldPath field, FieldValue value) - : FieldFilter( - std::make_shared(std::move(field), std::move(value))) { -} - -bool KeyFieldInFilter::Rep::Matches(const Document& doc) const { - const FieldValue::Array& array_value = value().array_value(); - for (const auto& rhs : array_value) { - if (doc.key() == rhs.reference_value().key()) { - return true; - } - } - return false; -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_in_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_in_filter.h deleted file mode 100644 index 641d053c7..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/key_field_in_filter.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_KEY_FIELD_IN_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_KEY_FIELD_IN_FILTER_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * A Filter that matches on an array of key fields. - */ -class KeyFieldInFilter : public FieldFilter { - public: - KeyFieldInFilter(model::FieldPath field, model::FieldValue value); - - private: - class Rep; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_KEY_FIELD_IN_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/operator.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/operator.h deleted file mode 100644 index ee8654981..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/operator.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_OPERATOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_OPERATOR_H_ - -#include "Firestore/core/src/firebase/firestore/core/filter.h" - -namespace firebase { -namespace firestore { -namespace core { - -inline bool IsArrayOperator(Filter::Operator op) { - return op == Filter::Operator::ArrayContains || - op == Filter::Operator::ArrayContainsAny; -} - -inline bool IsDisjunctiveOperator(Filter::Operator op) { - return op == Filter::Operator::In || op == Filter::Operator::ArrayContainsAny; -} - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_OPERATOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query.cc deleted file mode 100644 index 030951f37..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query.cc +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/core/query.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/core/operator.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/equality.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "absl/algorithm/container.h" -#include "absl/strings/str_cat.h" - -namespace firebase { -namespace firestore { -namespace core { - -using Operator = Filter::Operator; -using Type = Filter::Type; - -using model::Document; -using model::DocumentComparator; -using model::DocumentKey; -using model::FieldPath; -using model::ResourcePath; -using util::ComparisonResult; - -Query::Query(ResourcePath path, std::string collection_group) - : path_(std::move(path)), - collection_group_( - std::make_shared(std::move(collection_group))) { -} - -// MARK: - Accessors - -bool Query::IsDocumentQuery() const { - return DocumentKey::IsDocumentKey(path_) && !collection_group_ && - filters_.empty(); -} - -bool Query::MatchesAllDocuments() const { - return filters_.empty() && limit_ == kNoLimit && !start_at_ && !end_at_ && - (explicit_order_bys_.empty() || - (explicit_order_bys_.size() == 1 && - explicit_order_bys_.front().field().IsKeyFieldPath())); -} - -const FieldPath* Query::InequalityFilterField() const { - for (const auto& filter : filters_) { - if (filter.IsInequality()) { - return &filter.field(); - } - } - return nullptr; -} - -absl::optional Query::FirstArrayOperator() const { - for (const auto& filter : filters_) { - if (filter.IsAFieldFilter()) { - FieldFilter relation_filter(filter); - if (IsArrayOperator(relation_filter.op())) { - return relation_filter.op(); - } - } - } - return absl::nullopt; -} - -absl::optional Query::FirstDisjunctiveOperator() const { - for (const auto& filter : filters_) { - if (filter.IsAFieldFilter()) { - FieldFilter relation_filter(filter); - if (IsDisjunctiveOperator(relation_filter.op())) { - return relation_filter.op(); - } - } - } - return absl::nullopt; -} - -const OrderByList& Query::order_bys() const { - if (memoized_order_bys_.empty()) { - const FieldPath* inequality_field = InequalityFilterField(); - const FieldPath* first_order_by_field = FirstOrderByField(); - if (inequality_field && !first_order_by_field) { - // In order to implicitly add key ordering, we must also add the - // inequality filter field for it to be a valid query. Note that the - // default inequality field and key ordering is ascending. - if (inequality_field->IsKeyFieldPath()) { - memoized_order_bys_ = { - OrderBy(FieldPath::KeyFieldPath(), Direction::Ascending), - }; - } else { - memoized_order_bys_ = { - OrderBy(*inequality_field, Direction::Ascending), - OrderBy(FieldPath::KeyFieldPath(), Direction::Ascending), - }; - } - } else { - HARD_ASSERT( - !inequality_field || *inequality_field == *first_order_by_field, - "First orderBy %s should match inequality field %s.", - first_order_by_field->CanonicalString(), - inequality_field->CanonicalString()); - - OrderByList result = explicit_order_bys_; - - bool found_explicit_key_order = false; - for (const OrderBy& order_by : explicit_order_bys_) { - if (order_by.field().IsKeyFieldPath()) { - found_explicit_key_order = true; - break; - } - } - - if (!found_explicit_key_order) { - // The direction of the implicit key ordering always matches the - // direction of the last explicit sort order - Direction last_direction = explicit_order_bys_.empty() - ? Direction::Ascending - : explicit_order_bys_.back().direction(); - result = result.emplace_back(FieldPath::KeyFieldPath(), last_direction); - } - - memoized_order_bys_ = std::move(result); - } - } - return memoized_order_bys_; -} - -const FieldPath* Query::FirstOrderByField() const { - if (explicit_order_bys_.empty()) { - return nullptr; - } - - return &explicit_order_bys_.front().field(); -} - -// MARK: - Builder methods - -Query Query::AddingFilter(Filter filter) const { - HARD_ASSERT(!IsDocumentQuery(), "No filter is allowed for document query"); - - const FieldPath* new_inequality_field = nullptr; - if (filter.IsInequality()) { - new_inequality_field = &filter.field(); - } - const FieldPath* query_inequality_field = InequalityFilterField(); - HARD_ASSERT(!query_inequality_field || !new_inequality_field || - *query_inequality_field == *new_inequality_field, - "Query must only have one inequality field."); - - // TODO(rsgowman): ensure first orderby must match inequality field - - return Query(path_, collection_group_, filters_.push_back(std::move(filter)), - explicit_order_bys_, limit_, start_at_, end_at_); -} - -Query Query::AddingOrderBy(OrderBy order_by) const { - HARD_ASSERT(!IsDocumentQuery(), "No ordering is allowed for document query"); - - if (explicit_order_bys_.empty()) { - const FieldPath* inequality = InequalityFilterField(); - HARD_ASSERT(inequality == nullptr || *inequality == order_by.field(), - "First OrderBy must match inequality field."); - } - - return Query(path_, collection_group_, filters_, - explicit_order_bys_.push_back(std::move(order_by)), limit_, - start_at_, end_at_); -} - -Query Query::WithLimit(int32_t limit) const { - return Query(path_, collection_group_, filters_, explicit_order_bys_, limit, - start_at_, end_at_); -} - -Query Query::StartingAt(Bound bound) const { - return Query(path_, collection_group_, filters_, explicit_order_bys_, limit_, - std::make_shared(std::move(bound)), end_at_); -} - -Query Query::EndingAt(Bound bound) const { - return Query(path_, collection_group_, filters_, explicit_order_bys_, limit_, - start_at_, std::make_shared(std::move(bound))); -} - -Query Query::AsCollectionQueryAtPath(ResourcePath path) const { - return Query(path, /*collection_group=*/nullptr, filters_, - explicit_order_bys_, limit_, start_at_, end_at_); -} - -// MARK: - Matching - -bool Query::Matches(const Document& doc) const { - return MatchesPathAndCollectionGroup(doc) && MatchesOrderBy(doc) && - MatchesFilters(doc) && MatchesBounds(doc); -} - -bool Query::MatchesPathAndCollectionGroup(const Document& doc) const { - const ResourcePath& doc_path = doc.key().path(); - if (collection_group_) { - // NOTE: path_ is currently always empty since we don't expose Collection - // Group queries rooted at a document path yet. - return doc.key().HasCollectionId(*collection_group_) && - path_.IsPrefixOf(doc_path); - } else if (DocumentKey::IsDocumentKey(path_)) { - // Exact match for document queries. - return path_ == doc_path; - } else { - // Shallow ancestor queries by default. - return path_.IsImmediateParentOf(doc_path); - } -} - -bool Query::MatchesFilters(const Document& doc) const { - for (const auto& filter : filters_) { - if (!filter.Matches(doc)) return false; - } - return true; -} - -bool Query::MatchesOrderBy(const Document& doc) const { - for (const OrderBy& order_by : explicit_order_bys_) { - const FieldPath& field_path = order_by.field(); - // order by key always matches - if (field_path != FieldPath::KeyFieldPath() && - doc.field(field_path) == absl::nullopt) { - return false; - } - } - return true; -} - -bool Query::MatchesBounds(const Document& doc) const { - const OrderByList& ordering = order_bys(); - if (start_at_ && !start_at_->SortsBeforeDocument(ordering, doc)) { - return false; - } - if (end_at_ && end_at_->SortsBeforeDocument(ordering, doc)) { - return false; - } - return true; -} - -model::DocumentComparator Query::Comparator() const { - OrderByList ordering = order_bys(); - - bool has_key_ordering = false; - for (const OrderBy& order_by : ordering) { - if (order_by.field() == FieldPath::KeyFieldPath()) { - has_key_ordering = true; - break; - } - } - HARD_ASSERT(has_key_ordering, - "QueryComparator needs to have a key ordering."); - - return DocumentComparator( - [ordering](const Document& doc1, const Document& doc2) { - for (const OrderBy& order_by : ordering) { - ComparisonResult comp = order_by.Compare(doc1, doc2); - if (!util::Same(comp)) return comp; - } - return ComparisonResult::Same; - }); -} - -const std::string& Query::CanonicalId() const { - if (!canonical_id_.empty()) return canonical_id_; - - std::string result; - absl::StrAppend(&result, path_.CanonicalString()); - - if (collection_group_) { - absl::StrAppend(&result, "|cg:", *collection_group_); - } - - // Add filters. - absl::StrAppend(&result, "|f:"); - for (const auto& filter : filters_) { - absl::StrAppend(&result, filter.CanonicalId()); - } - - // Add order by. - absl::StrAppend(&result, "|ob:"); - for (const OrderBy& order_by : order_bys()) { - absl::StrAppend(&result, order_by.CanonicalId()); - } - - // Add limit. - if (limit_ != kNoLimit) { - absl::StrAppend(&result, "|l:", limit_); - } - - if (start_at_) { - absl::StrAppend(&result, "|lb:", start_at_->CanonicalId()); - } - - if (end_at_) { - absl::StrAppend(&result, "|ub:", end_at_->CanonicalId()); - } - - canonical_id_ = std::move(result); - return canonical_id_; -} - -size_t Query::Hash() const { - return util::Hash(CanonicalId()); -} - -std::string Query::ToString() const { - return absl::StrCat("Query(canonical_id=", CanonicalId(), ")"); -} - -std::ostream& operator<<(std::ostream& os, const Query& query) { - return os << query.ToString(); -} - -bool operator==(const Query& lhs, const Query& rhs) { - return lhs.path() == rhs.path() && - util::Equals(lhs.collection_group(), rhs.collection_group()) && - lhs.filters() == rhs.filters() && lhs.order_bys() == rhs.order_bys() && - lhs.limit() == rhs.limit() && - util::Equals(lhs.start_at(), rhs.start_at()) && - util::Equals(lhs.end_at(), rhs.end_at()); -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query.h deleted file mode 100644 index b3138acfa..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query.h +++ /dev/null @@ -1,270 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_QUERY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_QUERY_H_ - -#include -#include -#include -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/bound.h" -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/core/order_by.h" -#include "Firestore/core/src/firebase/firestore/immutable/append_only_list.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" - -namespace firebase { -namespace firestore { -namespace core { - -using CollectionGroupId = std::shared_ptr; - -/** - * Represents the internal structure of a Firestore Query. Query instances are - * immutable. - */ -class Query { - public: - static constexpr int32_t kNoLimit = std::numeric_limits::max(); - - Query() = default; - - explicit Query(model::ResourcePath path, - CollectionGroupId collection_group = nullptr) - : path_(std::move(path)), collection_group_(std::move(collection_group)) { - } - - /** - * Initializes a Query with a path and optional additional query constraints. - * Path must currently be empty if this is a collection group query. - */ - Query(model::ResourcePath path, - CollectionGroupId collection_group, - FilterList filters, - OrderByList explicit_order_bys, - int32_t limit, - std::shared_ptr start_at, - std::shared_ptr end_at) - : path_(std::move(path)), - collection_group_(std::move(collection_group)), - filters_(std::move(filters)), - explicit_order_bys_(std::move(explicit_order_bys)), - limit_(limit), - start_at_(std::move(start_at)), - end_at_(std::move(end_at)) { - } - - Query(model::ResourcePath path, std::string collection_group); - - // MARK: - Accessors - - /** The base path of the query. */ - const model::ResourcePath& path() const { - return path_; - } - - /** The collection group of the query, if any. */ - const std::shared_ptr& collection_group() const { - return collection_group_; - } - - /** Returns true if this Query is for a specific document. */ - bool IsDocumentQuery() const; - - /** Returns true if this Query is a collection group query. */ - bool IsCollectionGroupQuery() const { - return collection_group_ != nullptr; - } - - /** - * Returns true if this query does not specify any query constraints that - * could remove results. - */ - bool MatchesAllDocuments() const; - - /** The filters on the documents returned by the query. */ - const FilterList& filters() const { - return filters_; - } - - /** - * Returns the field of the first filter on this Query that's an inequality, - * or nullptr if there are no inequalities. - */ - const model::FieldPath* InequalityFilterField() const; - - /** - * Returns the first array operator (array-contains or array-contains-any) - * found on a filter, or absl::nullopt if there are no array operators. - */ - absl::optional FirstArrayOperator() const; - - /** - * Returns the first disjunctive operator (IN or array-contains-any) found - * on a filter, or absl::nullopt if there are no disjunctive operators. - */ - absl::optional FirstDisjunctiveOperator() const; - - /** - * Returns the list of ordering constraints that were explicitly requested on - * the query by the user. - * - * Note that the actual query performed might add additional sort orders to - * match the behavior of the backend. - */ - const OrderByList& explicit_order_bys() const { - return explicit_order_bys_; - } - - /** - * Returns the full list of ordering constraints on the query. - * - * This might include additional sort orders added implicitly to match the - * backend behavior. - */ - const OrderByList& order_bys() const; - - /** Returns the first field in an order-by constraint, or nullptr if none. */ - const model::FieldPath* FirstOrderByField() const; - - int32_t limit() const { - return limit_; - } - - const std::shared_ptr& start_at() const { - return start_at_; - } - - const std::shared_ptr& end_at() const { - return end_at_; - } - - // MARK: - Builder methods - - /** - * Returns a copy of this Query object with the additional specified filter. - */ - Query AddingFilter(Filter filter) const; - - /** - * Returns a copy of this Query object with the additional specified order by. - */ - Query AddingOrderBy(OrderBy order_by) const; - - /** - * Returns a copy of this Query with the given limit on how many results can - * be returned. - * - * @param limit The maximum number of results to return. If - * `limit == kNoLimit`, then no limit is applied. Otherwise, if - * `limit <= 0`, behavior is unspecified. - */ - Query WithLimit(int32_t limit) const; - - /** - * Returns a copy of this Query starting at the provided bound. - */ - Query StartingAt(Bound bound) const; - - /** - * Returns a copy of this Query ending at the provided bound. - */ - Query EndingAt(Bound bound) const; - - // MARK: - Matching - - /** - * Converts this collection group query into a collection query at a specific - * path. This is used when executing collection group queries, since we have - * to split the query into a set of collection queries, one for each - * collection in the group. - */ - Query AsCollectionQueryAtPath(model::ResourcePath path) const; - - /** Returns true if the document matches the constraints of this query. */ - bool Matches(const model::Document& doc) const; - - /** - * Returns a comparator that will sort documents according to the order by - * clauses in this query. - */ - model::DocumentComparator Comparator() const; - - const std::string& CanonicalId() const; - - std::string ToString() const; - - friend std::ostream& operator<<(std::ostream& os, const Query& query); - - size_t Hash() const; - - private: - bool MatchesPathAndCollectionGroup(const model::Document& doc) const; - bool MatchesFilters(const model::Document& doc) const; - bool MatchesOrderBy(const model::Document& doc) const; - bool MatchesBounds(const model::Document& doc) const; - - model::ResourcePath path_; - std::shared_ptr collection_group_; - - // Filters are shared across related Query instance. i.e. when you call - // Query::Filter(f), a new Query instance is created that contains all of the - // existing filters, plus the new one. (Both Query and Filter objects are - // immutable.) Filters are not shared across unrelated Query instances. - FilterList filters_; - - // A list of fields given to sort by. This does not include the implicit key - // sort at the end. - OrderByList explicit_order_bys_; - - // The memoized list of sort orders. - mutable OrderByList memoized_order_bys_; - - int32_t limit_ = kNoLimit; - std::shared_ptr start_at_; - std::shared_ptr end_at_; - - mutable std::string canonical_id_; -}; - -bool operator==(const Query& lhs, const Query& rhs); - -inline bool operator!=(const Query& lhs, const Query& rhs) { - return !(lhs == rhs); -} - -} // namespace core -} // namespace firestore -} // namespace firebase - -namespace std { - -template <> -struct hash { - size_t operator()(const firebase::firestore::core::Query& query) const { - return query.Hash(); - } -}; - -} // namespace std - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_QUERY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query_listener.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query_listener.h deleted file mode 100644 index 4fd3a6388..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/query_listener.h +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_QUERY_LISTENER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_QUERY_LISTENER_H_ - -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/listen_options.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * QueryListener takes a series of internal view snapshots and determines when - * to raise user-facing events. - */ -class QueryListener { - public: - static std::shared_ptr Create( - Query query, - ListenOptions options, - ViewSnapshot::SharedListener&& listener) { - return std::make_shared(std::move(query), std::move(options), - std::move(listener)); - } - - static std::shared_ptr Create( - Query query, ViewSnapshot::SharedListener&& listener) { - return Create(std::move(query), ListenOptions::DefaultOptions(), - std::move(listener)); - } - - static std::shared_ptr Create( - Query query, - ListenOptions options, - util::StatusOrCallback&& listener) { - auto event_listener = - EventListener::Create(std::move(listener)); - return Create(std::move(query), std::move(options), - std::move(event_listener)); - } - - static std::shared_ptr Create( - Query query, util::StatusOrCallback&& listener) { - return Create(std::move(query), ListenOptions::DefaultOptions(), - std::move(listener)); - } - - QueryListener(Query query, - ListenOptions options, - ViewSnapshot::SharedListener&& listener); - - virtual ~QueryListener() { - } - - const Query& query() const { - return query_; - } - - /** The last received view snapshot. */ - const absl::optional& snapshot() const { - return snapshot_; - } - - /** - * Applies the new ViewSnapshot to this listener, raising a user-facing event - * if applicable (depending on what changed, whether the user has opted into - * metadata-only changes, etc.). Returns true if a user-facing event was - * indeed raised. - */ - virtual bool OnViewSnapshot(ViewSnapshot snapshot); - - virtual void OnError(util::Status error); - - /** Returns whether a snapshot was raised. */ - virtual bool OnOnlineStateChanged(model::OnlineState online_state); - - private: - bool ShouldRaiseInitialEvent(const ViewSnapshot& snapshot, - model::OnlineState online_state) const; - bool ShouldRaiseEvent(const ViewSnapshot& snapshot) const; - void RaiseInitialEvent(const ViewSnapshot& snapshot); - - Query query_; - ListenOptions options_; - - /** - * The EventListener that will process ViewSnapshots associated with this - * query listener. - */ - ViewSnapshot::SharedListener listener_; - - /** - * Initial snapshots (e.g. from cache) may not be propagated to the - * ViewSnapshotHandler. This flag is set to true once we've actually raised an - * event. - */ - bool raised_initial_event_ = false; - - /** The last online state this query listener got. */ - model::OnlineState online_state_ = model::OnlineState::Unknown; - - absl::optional snapshot_; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_QUERY_LISTENER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine.h deleted file mode 100644 index 7c24b2e22..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine.h +++ /dev/null @@ -1,324 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SYNC_ENGINE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SYNC_ENGINE_H_ - -#include -#include -#include -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/target_id_generator.h" -#include "Firestore/core/src/firebase/firestore/core/view.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/local/local_store.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_store.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "absl/strings/string_view.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * Interface implemented by `EventManager` to handle notifications from - * `SyncEngine`. - */ -class SyncEngineCallback { - public: - virtual ~SyncEngineCallback() = default; - - /** Handles a change in online state. */ - virtual void HandleOnlineStateChange(model::OnlineState online_state) = 0; - /** Handles new view snapshots. */ - virtual void OnViewSnapshots(std::vector&& snapshots) = 0; - /** Handles the failure of a query. */ - virtual void OnError(const core::Query& query, const util::Status& error) = 0; -}; - -/** - * Interface implemented by `SyncEngine` to receive requests from - * `EventManager`. - // PORTING NOTE: This is extracted as an interface to allow gmock to mock - // sync engine. - */ -class QueryEventSource { - public: - virtual ~QueryEventSource() = default; - - virtual void SetCallback(SyncEngineCallback* callback) = 0; - - /** - * Initiates a new listen. The LocalStore will be queried for initial data - * and the listen will be sent to the `RemoteStore` to get remote data. The - * registered SyncEngineCallback will be notified of resulting view - * snapshots and/or listen errors. - * - * @return the target ID assigned to the query. - */ - virtual model::TargetId Listen(Query query) = 0; - - /** Stops listening to a query previously listened to via `Listen`. */ - virtual void StopListening(const Query& query) = 0; -}; - -/** - * SyncEngine is the central controller in the client SDK architecture. It is - * the glue code between the EventManager, LocalStore, and RemoteStore. Some of - * SyncEngine's responsibilities include: - * 1. Coordinating client requests and remote events between the EventManager - * and the local and remote data stores. - * 2. Managing a View object for each query, providing the unified view between - * the local and remote data stores. - * 3. Notifying the RemoteStore when the LocalStore has new mutations in its - * queue that need sending to the backend. - * - * The SyncEngine’s methods should only ever be called by methods running on our - * own worker queue. - */ -class SyncEngine : public remote::RemoteStoreCallback, public QueryEventSource { - public: - SyncEngine(local::LocalStore* local_store, - remote::RemoteStore* remote_store, - const auth::User& initial_user); - - // Implements `QueryEventSource`. - void SetCallback(SyncEngineCallback* callback) override { - sync_engine_callback_ = callback; - } - model::TargetId Listen(Query query) override; - void StopListening(const Query& query) override; - - /** - * Initiates the write of local mutation batch which involves adding the - * writes to the mutation queue, notifying the remote store about new - * mutations, and raising events for any changes this write caused. The - * provided callback will be called once the write has been acked or - * rejected by the backend (or failed locally for any other reason). - */ - void WriteMutations(std::vector&& mutations, - util::StatusCallback callback); - - /** - * Registers a user callback that is called when all pending mutations at the - * moment of calling are acknowledged . - */ - void RegisterPendingWritesCallback(util::StatusCallback callback); - - /** - * Runs the given transaction block up to retries times and then calls - * completion. - * - * @param retries The number of times to try before giving up. - * @param worker_queue The queue to dispatch sync engine calls to. - * @param update_callback The callback to call to execute the user's - * transaction. - * @param result_callback The callback to call when the transaction is - * finished or failed. - */ - void Transaction(int retries, - const std::shared_ptr& worker_queue, - core::TransactionUpdateCallback update_callback, - core::TransactionResultCallback result_callback); - - void HandleCredentialChange(const auth::User& user); - - // Implements `RemoteStoreCallback` - void ApplyRemoteEvent(const remote::RemoteEvent& remote_event) override; - void HandleRejectedListen(model::TargetId target_id, - util::Status error) override; - void HandleSuccessfulWrite( - const model::MutationBatchResult& batch_result) override; - void HandleRejectedWrite(model::BatchId batch_id, - util::Status error) override; - void HandleOnlineStateChange(model::OnlineState online_state) override; - model::DocumentKeySet GetRemoteKeys(model::TargetId target_id) const override; - - // For tests only - std::map GetCurrentLimboDocuments() - const { - // Return defensive copy - return limbo_targets_by_key_; - } - - private: - /** - * QueryView contains all of the info that SyncEngine needs to track for a - * particular query and view. - */ - class QueryView { - public: - QueryView(Query query, - model::TargetId target_id, - nanopb::ByteString resume_token, - View view) - : query_(std::move(query)), - target_id_(target_id), - resume_token_(std::move(resume_token)), - view_(std::move(view)) { - } - - const Query& query() const { - return query_; - } - - /** - * The target ID created by the client that is used in the watch stream to - * identify this query. - */ - model::TargetId target_id() const { - return target_id_; - } - - /** - * An identifier from the datastore backend that indicates the last state of - * the results that was received. This can be used to indicate where to - * continue receiving new doc changes for the query. - */ - const nanopb::ByteString& resume_token() const { - return resume_token_; - } - - /** - * The view is responsible for computing the final merged truth of what docs - * are in the query. It gets notified of local and remote changes, and - * applies the query filters and limits to determine the most correct - * possible results. - */ - View& view() { - return view_; - } - - private: - Query query_; - model::TargetId target_id_; - nanopb::ByteString resume_token_; - View view_; - }; - - /** Tracks a limbo resolution. */ - class LimboResolution { - public: - LimboResolution() = default; - - explicit LimboResolution(const model::DocumentKey& key) : key{key} { - } - - model::DocumentKey key; - - /** - * Set to true once we've received a document. This is used in - * remoteKeysForTarget and ultimately used by `WatchChangeAggregator` to - * decide whether it needs to manufacture a delete event for the target once - * the target is CURRENT. - */ - bool document_received = false; - }; - - void AssertCallbackExists(absl::string_view source); - - ViewSnapshot InitializeViewAndComputeSnapshot( - const local::QueryData& query_data); - - void RemoveAndCleanupQuery(const std::shared_ptr& query_view); - - void RemoveLimboTarget(const model::DocumentKey& key); - - void EmitNewSnapshotsAndNotifyLocalStore( - const model::MaybeDocumentMap& changes, - const absl::optional& maybe_remote_event); - - /** Updates the limbo document state for the given target_id. */ - void UpdateTrackedLimboDocuments( - const std::vector& limbo_changes, - model::TargetId target_id); - - void TrackLimboChange(const LimboDocumentChange& limbo_change); - - void NotifyUser(model::BatchId batch_id, util::Status status); - - /** - * Triggers callbacks waiting for this batch id to get acknowledged by - * server, if there are any. - */ - void TriggerPendingWriteCallbacks(model::BatchId batch_id); - void FailOutstandingPendingWriteCallbacks(absl::string_view message); - - /** The local store, used to persist mutations and cached documents. */ - local::LocalStore* local_store_ = nullptr; - - /** The remote store for sending writes, watches, etc. to the backend. */ - remote::RemoteStore* remote_store_ = nullptr; - - auth::User current_user_; - SyncEngineCallback* sync_engine_callback_ = nullptr; - - /** - * Used for creating the TargetId for the listens used to resolve limbo - * documents. - */ - TargetIdGenerator target_id_generator_; - - /** Stores user completion blocks, indexed by User and BatchId. */ - std::unordered_map, - auth::HashUser> - mutation_callbacks_; - - /** Stores user callbacks waiting for pending writes to be acknowledged. */ - std::unordered_map> - pending_writes_callbacks_; - - // Shared pointers are used to avoid creating and storing two copies of the - // same `QueryView` and for consistency with other platforms. - /** QueryViews for all active queries, indexed by query. */ - std::unordered_map> query_views_by_query_; - - /** QueryViews for all active queries, indexed by target ID. */ - std::unordered_map> - query_views_by_target_; - - /** - * When a document is in limbo, we create a special listen to resolve it. This - * maps the DocumentKey of each limbo document to the TargetId of the listen - * resolving it. - */ - std::map limbo_targets_by_key_; - - /** - * Basically the inverse of limbo_targets_by_key_, a map of target ID to a - * LimboResolution (which includes the DocumentKey as well as whether we've - * received a document for the target). - */ - std::map limbo_resolutions_by_target_; - - /** Used to track any documents that are currently in limbo. */ - local::ReferenceSet limbo_document_refs_; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SYNC_ENGINE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine.mm deleted file mode 100644 index 321fcab45..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine.mm +++ /dev/null @@ -1,520 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/core/sync_engine.h" - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/core/transaction_runner.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/document_set.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" - -namespace firebase { -namespace firestore { -namespace core { - -namespace { - -using firestore::Error; -using auth::User; -using local::LocalStore; -using local::LocalViewChanges; -using local::LocalWriteResult; -using local::QueryData; -using local::QueryPurpose; -using model::BatchId; -using model::DocumentKey; -using model::DocumentKeySet; -using model::DocumentMap; -using model::kBatchIdUnknown; -using model::ListenSequenceNumber; -using model::MaybeDocumentMap; -using model::NoDocument; -using model::SnapshotVersion; -using model::TargetId; -using remote::RemoteEvent; -using remote::TargetChange; -using util::AsyncQueue; -using util::Status; -using util::StatusCallback; - -// Limbo documents don't use persistence, and are eagerly GC'd. So, listens for -// them don't need real sequence numbers. -const ListenSequenceNumber kIrrelevantSequenceNumber = -1; - -bool ErrorIsInteresting(const Status& error) { - bool missing_index = - (error.code() == Error::FailedPrecondition && - error.error_message().find("requires an index") != std::string::npos); - bool no_permission = (error.code() == Error::PermissionDenied); - return missing_index || no_permission; -} - -} // namespace - -SyncEngine::SyncEngine(LocalStore* local_store, - remote::RemoteStore* remote_store, - const auth::User& initial_user) - : local_store_(local_store), - remote_store_(remote_store), - current_user_(initial_user), - target_id_generator_(TargetIdGenerator::SyncEngineTargetIdGenerator()) { -} - -void SyncEngine::AssertCallbackExists(absl::string_view source) { - HARD_ASSERT(sync_engine_callback_, - "Tried to call '%s' before callback was registered.", source); -} - -TargetId SyncEngine::Listen(Query query) { - AssertCallbackExists("Listen"); - - HARD_ASSERT(query_views_by_query_.find(query) == query_views_by_query_.end(), - "We already listen to query: %s", query.ToString()); - - QueryData query_data = local_store_->AllocateQuery(query); - ViewSnapshot view_snapshot = InitializeViewAndComputeSnapshot(query_data); - std::vector snapshots; - // Not using the `std::initializer_list` constructor to avoid extra copies. - snapshots.push_back(std::move(view_snapshot)); - sync_engine_callback_->OnViewSnapshots(std::move(snapshots)); - - // TODO(wuandy): move `query_data` into `Listen`. - remote_store_->Listen(query_data); - return query_data.target_id(); -} - -ViewSnapshot SyncEngine::InitializeViewAndComputeSnapshot( - const local::QueryData& query_data) { - DocumentMap docs = local_store_->ExecuteQuery(query_data.query()); - DocumentKeySet remote_keys = - local_store_->GetRemoteDocumentKeys(query_data.target_id()); - - View view(query_data.query(), std::move(remote_keys)); - ViewDocumentChanges view_doc_changes = - view.ComputeDocumentChanges(docs.underlying_map()); - ViewChange view_change = view.ApplyChanges(view_doc_changes); - HARD_ASSERT(view_change.limbo_changes().empty(), - "View returned limbo docs before target ack from the server."); - - auto query_view = - std::make_shared(query_data.query(), query_data.target_id(), - query_data.resume_token(), std::move(view)); - query_views_by_query_[query_data.query()] = query_view; - query_views_by_target_[query_data.target_id()] = query_view; - - HARD_ASSERT( - view_change.snapshot().has_value(), - "ApplyChanges to documents for new view should always return a snapshot"); - return view_change.snapshot().value(); -} - -void SyncEngine::StopListening(const Query& query) { - AssertCallbackExists("StopListening"); - - auto query_view = query_views_by_query_[query]; - HARD_ASSERT(query_view, "Trying to stop listening to a query not found"); - - local_store_->ReleaseQuery(query); - remote_store_->StopListening(query_view->target_id()); - RemoveAndCleanupQuery(query_view); -} - -void SyncEngine::RemoveAndCleanupQuery( - const std::shared_ptr& query_view) { - query_views_by_query_.erase(query_view->query()); - query_views_by_target_.erase(query_view->target_id()); - - DocumentKeySet limbo_keys = - limbo_document_refs_.ReferencedKeys(query_view->target_id()); - limbo_document_refs_.RemoveReferences(query_view->target_id()); - for (const DocumentKey& key : limbo_keys) { - if (!limbo_document_refs_.ContainsKey(key)) { - // We removed the last reference for this key. - RemoveLimboTarget(key); - } - } -} - -void SyncEngine::WriteMutations(std::vector&& mutations, - StatusCallback callback) { - AssertCallbackExists("WriteMutations"); - - LocalWriteResult result = local_store_->WriteLocally(std::move(mutations)); - mutation_callbacks_[current_user_].insert( - std::make_pair(result.batch_id(), std::move(callback))); - - EmitNewSnapshotsAndNotifyLocalStore(result.changes(), absl::nullopt); - remote_store_->FillWritePipeline(); -} - -void SyncEngine::RegisterPendingWritesCallback(StatusCallback callback) { - if (!remote_store_->CanUseNetwork()) { - LOG_DEBUG("The network is disabled. The task returned by " - "'waitForPendingWrites()' will not " - "complete until the network is enabled."); - } - - int largest_pending_batch_id = - local_store_->GetHighestUnacknowledgedBatchId(); - - if (largest_pending_batch_id == kBatchIdUnknown) { - // Trigger the callback right away if there is no pending writes at the - // moment. - callback(Status::OK()); - return; - } - - pending_writes_callbacks_[largest_pending_batch_id].push_back( - std::move(callback)); -} - -void SyncEngine::Transaction(int retries, - const std::shared_ptr& worker_queue, - TransactionUpdateCallback update_callback, - TransactionResultCallback result_callback) { - worker_queue->VerifyIsCurrentQueue(); - HARD_ASSERT(retries >= 0, "Got negative number of retries for transaction"); - - // Allocate a shared_ptr so that the TransactionRunner can outlive this frame. - auto runner = std::make_shared(worker_queue, remote_store_, - std::move(update_callback), - std::move(result_callback)); - runner->Run(); -} - -void SyncEngine::HandleCredentialChange(const auth::User& user) { - bool user_changed = (current_user_ != user); - current_user_ = user; - - if (user_changed) { - // Fails callbacks waiting for pending writes requested by previous user. - FailOutstandingPendingWriteCallbacks( - "'waitForPendingWrites' callback is cancelled due to a user change."); - // Notify local store and emit any resulting events from swapping out the - // mutation queue. - MaybeDocumentMap changes = local_store_->HandleUserChange(user); - EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); - } - - // Notify remote store so it can restart its streams. - remote_store_->HandleCredentialChange(); -} - -void SyncEngine::ApplyRemoteEvent(const RemoteEvent& remote_event) { - AssertCallbackExists("HandleRemoteEvent"); - - // Update received document as appropriate for any limbo targets. - for (const auto& entry : remote_event.target_changes()) { - TargetId target_id = entry.first; - const TargetChange& change = entry.second; - auto it = limbo_resolutions_by_target_.find(target_id); - if (it == limbo_resolutions_by_target_.end()) { - continue; - } - - LimboResolution& limbo_resolution = it->second; - // Since this is a limbo resolution lookup, it's for a single document and - // it could be added, modified, or removed, but not a combination. - auto changed_documents_count = change.added_documents().size() + - change.modified_documents().size() + - change.removed_documents().size(); - HARD_ASSERT( - changed_documents_count <= 1, - "Limbo resolution for single document contains multiple changes."); - - if (!change.added_documents().empty()) { - limbo_resolution.document_received = true; - } else if (!change.modified_documents().empty()) { - HARD_ASSERT(limbo_resolution.document_received, - "Received change for limbo target document without add."); - } else if (!change.removed_documents().empty()) { - HARD_ASSERT(limbo_resolution.document_received, - "Received remove for limbo target document without add."); - limbo_resolution.document_received = false; - } else { - // This was probably just a CURRENT target change or similar. - } - } - - MaybeDocumentMap changes = local_store_->ApplyRemoteEvent(remote_event); - EmitNewSnapshotsAndNotifyLocalStore(changes, remote_event); -} - -void SyncEngine::HandleRejectedListen(TargetId target_id, Status error) { - AssertCallbackExists("HandleRejectedListen"); - - auto it = limbo_resolutions_by_target_.find(target_id); - if (it != limbo_resolutions_by_target_.end()) { - DocumentKey limbo_key = it->second.key; - // Since this query failed, we won't want to manually unlisten to it. - // So go ahead and remove it from bookkeeping. - limbo_targets_by_key_.erase(limbo_key); - limbo_resolutions_by_target_.erase(target_id); - - // TODO(dimond): Retry on transient errors? - - // It's a limbo doc. Create a synthetic event saying it was deleted. This is - // kind of a hack. Ideally, we would have a method in the local store to - // purge a document. However, it would be tricky to keep all of the local - // store's invariants with another method. - NoDocument doc(limbo_key, SnapshotVersion::None(), - /* has_committed_mutations= */ false); - DocumentKeySet limbo_documents = DocumentKeySet{limbo_key}; - RemoteEvent event{SnapshotVersion::None(), /*target_changes=*/{}, - /*target_mismatches=*/{}, - /*document_updates=*/{{limbo_key, doc}}, - std::move(limbo_documents)}; - ApplyRemoteEvent(event); - - } else { - auto found = query_views_by_target_.find(target_id); - HARD_ASSERT(found != query_views_by_target_.end(), "Unknown target id: %s", - target_id); - auto query_view = found->second; - const Query& query = query_view->query(); - local_store_->ReleaseQuery(query); - RemoveAndCleanupQuery(query_view); - if (ErrorIsInteresting(error)) { - LOG_WARN("Listen for query at %s failed: %s", - query.path().CanonicalString(), error.error_message()); - } - sync_engine_callback_->OnError(query, std::move(error)); - } -} - -void SyncEngine::HandleSuccessfulWrite( - const model::MutationBatchResult& batch_result) { - AssertCallbackExists("HandleSuccessfulWrite"); - - // The local store may or may not be able to apply the write result and raise - // events immediately (depending on whether the watcher is caught up), so we - // raise user callbacks first so that they consistently happen before listen - // events. - NotifyUser(batch_result.batch().batch_id(), Status::OK()); - - TriggerPendingWriteCallbacks(batch_result.batch().batch_id()); - - MaybeDocumentMap changes = local_store_->AcknowledgeBatch(batch_result); - EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); -} - -void SyncEngine::HandleRejectedWrite( - firebase::firestore::model::BatchId batch_id, Status error) { - AssertCallbackExists("HandleRejectedWrite"); - - MaybeDocumentMap changes = local_store_->RejectBatch(batch_id); - - if (!changes.empty() && ErrorIsInteresting(error)) { - const DocumentKey& min_key = changes.min()->first; - LOG_WARN("Write at %s failed: %s", min_key.ToString(), - error.error_message()); - } - - // The local store may or may not be able to apply the write result and raise - // events immediately (depending on whether the watcher is caught up), so we - // raise user callbacks first so that they consistently happen before listen - // events. - NotifyUser(batch_id, std::move(error)); - - TriggerPendingWriteCallbacks(batch_id); - - EmitNewSnapshotsAndNotifyLocalStore(changes, absl::nullopt); -} - -void SyncEngine::HandleOnlineStateChange(model::OnlineState online_state) { - AssertCallbackExists("HandleOnlineStateChange"); - - std::vector new_view_snapshot; - for (const auto& entry : query_views_by_query_) { - const auto& query_view = entry.second; - ViewChange view_change = - query_view->view().ApplyOnlineStateChange(online_state); - HARD_ASSERT(view_change.limbo_changes().empty(), - "OnlineState should not affect limbo documents."); - if (view_change.snapshot().has_value()) { - new_view_snapshot.push_back(*std::move(view_change).snapshot()); - } - } - - sync_engine_callback_->OnViewSnapshots(std::move(new_view_snapshot)); - sync_engine_callback_->HandleOnlineStateChange(online_state); -} - -DocumentKeySet SyncEngine::GetRemoteKeys(TargetId target_id) const { - auto it = limbo_resolutions_by_target_.find(target_id); - if (it != limbo_resolutions_by_target_.end() && - it->second.document_received) { - return DocumentKeySet{it->second.key}; - } else { - auto found = query_views_by_target_.find(target_id); - if (found != query_views_by_target_.end()) { - return found->second->view().synced_documents(); - } - return DocumentKeySet{}; - } -} - -void SyncEngine::NotifyUser(BatchId batch_id, Status status) { - auto it = mutation_callbacks_.find(current_user_); - - // NOTE: Mutations restored from persistence won't have callbacks, so - // it's okay for this (or the callback below) to not exist. - if (it == mutation_callbacks_.end()) { - return; - } - - std::unordered_map& callbacks = it->second; - auto callback_it = callbacks.find(batch_id); - if (callback_it != callbacks.end()) { - callback_it->second(std::move(status)); - callbacks.erase(callback_it); - } -} - -void SyncEngine::TriggerPendingWriteCallbacks(BatchId batch_id) { - auto it = pending_writes_callbacks_.find(batch_id); - if (it != pending_writes_callbacks_.end()) { - for (const auto& callback : it->second) { - callback(Status::OK()); - } - - pending_writes_callbacks_.erase(it); - } -} - -void SyncEngine::FailOutstandingPendingWriteCallbacks( - absl::string_view message) { - for (const auto& entry : pending_writes_callbacks_) { - for (const auto& callback : entry.second) { - callback(Status(Error::Cancelled, message)); - } - } - - pending_writes_callbacks_.clear(); -} - -void SyncEngine::EmitNewSnapshotsAndNotifyLocalStore( - const MaybeDocumentMap& changes, - const absl::optional& maybe_remote_event) { - std::vector new_snapshots; - std::vector document_changes_in_all_views; - - for (const auto& entry : query_views_by_query_) { - const auto& query_view = entry.second; - View& view = query_view->view(); - ViewDocumentChanges view_doc_changes = view.ComputeDocumentChanges(changes); - if (view_doc_changes.needs_refill()) { - // The query has a limit and some docs were removed/updated, so we need to - // re-run the query against the local store to make sure we didn't lose - // any good docs that had been past the limit. - DocumentMap docs = local_store_->ExecuteQuery(query_view->query()); - view_doc_changes = - view.ComputeDocumentChanges(docs.underlying_map(), view_doc_changes); - } - - absl::optional target_changes; - if (maybe_remote_event.has_value()) { - const RemoteEvent& remote_event = maybe_remote_event.value(); - auto it = remote_event.target_changes().find(query_view->target_id()); - if (it != remote_event.target_changes().end()) { - target_changes = it->second; - } - } - ViewChange view_change = - view.ApplyChanges(view_doc_changes, target_changes); - - UpdateTrackedLimboDocuments(view_change.limbo_changes(), - query_view->target_id()); - - if (view_change.snapshot().has_value()) { - new_snapshots.push_back(*view_change.snapshot()); - LocalViewChanges doc_changes = LocalViewChanges::FromViewSnapshot( - *view_change.snapshot(), query_view->target_id()); - document_changes_in_all_views.push_back(std::move(doc_changes)); - } - } - - sync_engine_callback_->OnViewSnapshots(std::move(new_snapshots)); - local_store_->NotifyLocalViewChanges(document_changes_in_all_views); -} - -void SyncEngine::UpdateTrackedLimboDocuments( - const std::vector& limbo_changes, TargetId target_id) { - for (const LimboDocumentChange& limbo_change : limbo_changes) { - switch (limbo_change.type()) { - case LimboDocumentChange::Type::Added: - limbo_document_refs_.AddReference(limbo_change.key(), target_id); - TrackLimboChange(limbo_change); - break; - - case LimboDocumentChange::Type::Removed: - LOG_DEBUG("Document no longer in limbo: %s", - limbo_change.key().ToString()); - limbo_document_refs_.RemoveReference(limbo_change.key(), target_id); - if (!limbo_document_refs_.ContainsKey(limbo_change.key())) { - // We removed the last reference for this key - RemoveLimboTarget(limbo_change.key()); - } - break; - - default: - HARD_FAIL("Unknown limbo change type: %s", limbo_change.type()); - } - } -} - -void SyncEngine::TrackLimboChange(const LimboDocumentChange& limbo_change) { - const DocumentKey& key = limbo_change.key(); - - if (limbo_targets_by_key_.find(key) == limbo_targets_by_key_.end()) { - LOG_DEBUG("New document in limbo: %s", key.ToString()); - - TargetId limbo_target_id = target_id_generator_.NextId(); - Query query(key.path()); - QueryData query_data(std::move(query), limbo_target_id, - kIrrelevantSequenceNumber, - QueryPurpose::LimboResolution); - limbo_resolutions_by_target_.emplace(limbo_target_id, LimboResolution{key}); - // TODO(wuandy): move `query_data` into `Listen`. - remote_store_->Listen(query_data); - limbo_targets_by_key_[key] = limbo_target_id; - } -} - -void SyncEngine::RemoveLimboTarget(const DocumentKey& key) { - auto it = limbo_targets_by_key_.find(key); - if (it == limbo_targets_by_key_.end()) { - // This target already got removed, because the query failed. - return; - } - - TargetId limbo_target_id = it->second; - remote_store_->StopListening(limbo_target_id); - limbo_targets_by_key_.erase(key); - limbo_resolutions_by_target_.erase(limbo_target_id); -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine_callback.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine_callback.h deleted file mode 100644 index d30815221..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/sync_engine_callback.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SYNC_ENGINE_CALLBACK_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SYNC_ENGINE_CALLBACK_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * Interface implemented by `EventManager` to handle notifications from - * `SyncEngine`. - */ -class SyncEngineCallback { - public: - /** Handles a change in online state. */ - virtual void HandleOnlineStateChange(model::OnlineState online_state) = 0; - /** Handles new view snapshots. */ - virtual void OnViewSnapshots(std::vector&& snapshots) = 0; - /** Handles the failure of a query. */ - virtual void OnError(const core::Query& query, const util::Status& error) = 0; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_SYNC_ENGINE_CALLBACK_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction.mm deleted file mode 100644 index 312d6d4fc..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction.mm +++ /dev/null @@ -1,234 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/core/transaction.h" - -#include -#include -#include - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/core/user_data.h" -#include "Firestore/core/src/firebase/firestore/model/delete_mutation.h" -#include "Firestore/core/src/firebase/firestore/remote/datastore.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -using firebase::firestore::Error; -using firebase::firestore::core::ParsedSetData; -using firebase::firestore::core::ParsedUpdateData; -using firebase::firestore::model::DeleteMutation; -using firebase::firestore::model::DocumentKey; -using firebase::firestore::model::DocumentKeyHash; -using firebase::firestore::model::MaybeDocument; -using firebase::firestore::model::Mutation; -using firebase::firestore::model::Precondition; -using firebase::firestore::model::SnapshotVersion; -using firebase::firestore::remote::Datastore; -using firebase::firestore::util::Status; -using firebase::firestore::util::StatusOr; - -namespace firebase { -namespace firestore { -namespace core { - -Transaction::Transaction(Datastore* datastore) - : datastore_{NOT_NULL(datastore)} { -} - -Status Transaction::RecordVersion(const MaybeDocument& doc) { - SnapshotVersion doc_version; - - if (doc.is_document()) { - doc_version = doc.version(); - } else if (doc.is_no_document()) { - // For deleted docs, we must record an explicit no version to build the - // right precondition when writing. - doc_version = SnapshotVersion::None(); - } else { - HARD_FAIL("Unexpected document type in transaction: %s", doc.type()); - } - - absl::optional existing_version = GetVersion(doc.key()); - if (existing_version.has_value()) { - if (doc_version != existing_version.value()) { - // This transaction will fail no matter what. - return Status{Error::Aborted, - "Document version changed between two reads."}; - } - return Status::OK(); - } else { - read_versions_[doc.key()] = doc_version; - return Status::OK(); - } -} - -void Transaction::Lookup(const std::vector& keys, - LookupCallback&& callback) { - EnsureCommitNotCalled(); - - if (!mutations_.empty()) { - Status lookup_error = Status{Error::InvalidArgument, - "Firestore transactions require all reads to " - "be executed before all writes"}; - callback({}, lookup_error); - return; - } - - datastore_->LookupDocuments( - keys, [this, callback](const std::vector& documents, - const Status& status) { - if (!status.ok()) { - callback({}, status); - return; - } - - for (const MaybeDocument& doc : documents) { - Status record_error = RecordVersion(doc); - if (!record_error.ok()) { - callback({}, record_error); - return; - } - } - - callback(documents, Status::OK()); - }); -} - -void Transaction::WriteMutations(std::vector&& mutations) { - EnsureCommitNotCalled(); - // `move` will become appropriate once `Mutation` is replaced by the C++ - // equivalent. - std::move(mutations.begin(), mutations.end(), std::back_inserter(mutations_)); -} - -Precondition Transaction::CreatePrecondition(const DocumentKey& key) { - absl::optional version = GetVersion(key); - if (written_docs_.count(key) == 0 && version.has_value()) { - return Precondition::UpdateTime(version.value()); - } else { - return Precondition::None(); - } -} - -StatusOr Transaction::CreateUpdatePrecondition( - const DocumentKey& key) { - absl::optional version = GetVersion(key); - // The first time a document is written, we want to take into account the - // read time and existence. - if (written_docs_.count(key) == 0 && version.has_value()) { - if (version.value() == SnapshotVersion::None()) { - // The document doesn't exist, so fail the transaction. - // - // This has to be validated locally because you can't send a - // precondition that a document does not exist without changing the - // semantics of the backend write to be an insert. This is the reverse - // of what we want, since we want to assert that the document doesn't - // exist but then send the update and have it fail. Since we can't - // express that to the backend, we have to validate locally. - // - // Note: this can change once we can send separate verify writes in the - // transaction. - return Status{Error::InvalidArgument, - "Can't update a document that doesn't exist."}; - } - // Document exists, just base precondition on document update time. - return Precondition::UpdateTime(version.value()); - } else { - // Document was not read, so we just use the preconditions for a blind - // update. - return Precondition::Exists(true); - } -} - -void Transaction::Set(const DocumentKey& key, ParsedSetData&& data) { - WriteMutations(std::move(data).ToMutations(key, CreatePrecondition(key))); - written_docs_.insert(key); -} - -void Transaction::Update(const DocumentKey& key, ParsedUpdateData&& data) { - StatusOr maybe_precondition = CreateUpdatePrecondition(key); - if (!maybe_precondition.ok()) { - last_write_error_ = maybe_precondition.status(); - } else { - WriteMutations( - std::move(data).ToMutations(key, maybe_precondition.ValueOrDie())); - } - written_docs_.insert(key); -} - -void Transaction::Delete(const DocumentKey& key) { - Mutation mutation = DeleteMutation(key, CreatePrecondition(key)); - WriteMutations({mutation}); - written_docs_.insert(key); -} - -void Transaction::Commit(util::StatusCallback&& callback) { - EnsureCommitNotCalled(); - - // If there was an error writing, raise that error now - if (!last_write_error_.ok()) { - callback(last_write_error_); - return; - } - - // Make a list of read documents that haven't been written. - std::unordered_set unwritten; - for (const auto& kv : read_versions_) { - unwritten.insert(kv.first); - }; - // For each mutation, note that the doc was written. - for (const Mutation& mutation : mutations_) { - unwritten.erase(mutation.key()); - } - - if (!unwritten.empty()) { - // TODO(klimt): This is a temporary restriction, until "verify" is supported - // on the backend. - callback( - Status{Error::InvalidArgument, - "Every document read in a transaction must also be written in " - "that transaction."}); - } else { - committed_ = true; - datastore_->CommitMutations(mutations_, std::move(callback)); - } -} - -void Transaction::MarkPermanentlyFailed() { - permanentError_ = true; -} - -bool Transaction::IsPermanentlyFailed() const { - return permanentError_; -} - -void Transaction::EnsureCommitNotCalled() { - HARD_ASSERT(!committed_, "A transaction object cannot be used after its " - "update callback has been invoked."); -} - -absl::optional Transaction::GetVersion( - const DocumentKey& key) const { - auto found = read_versions_.find(key); - if (found != read_versions_.end()) { - return found->second; - } - return absl::nullopt; -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction_runner.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction_runner.h deleted file mode 100644 index eb5fca6b7..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction_runner.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TRANSACTION_RUNNER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TRANSACTION_RUNNER_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/remote/exponential_backoff.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_store.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" - -namespace firebase { -namespace firestore { -namespace core { - -/** - * TransactionRunner encapsulates the logic needed to run and retry transactions - * with backoff. - * - * TransactionRunner manages its own lifetime by keeping itself alive until all - * retries are completed. It must be allocated via - * std::make_shared because the implementation expects to be - * able to call std::shared_from_this to create additional references that will - * keep it alive. - */ -class TransactionRunner - : public std::enable_shared_from_this { - public: - TransactionRunner(const std::shared_ptr& queue, - remote::RemoteStore* remote_store, - core::TransactionUpdateCallback update_callback, - core::TransactionResultCallback result_callback); - - /** - * Runs the transaction and calls the result_callback_ with the result. - */ - void Run(); - - private: - void ContinueCommit(const std::shared_ptr transaction, - const util::StatusOr maybe_result); - - void DispatchResult(const std::shared_ptr transaction, - util::Status status, - const util::StatusOr maybe_result); - - void HandleTransactionError(const std::shared_ptr transaction, - util::Status status); - - std::shared_ptr queue_; - remote::RemoteStore* remote_store_; - core::TransactionUpdateCallback update_callback_; - core::TransactionResultCallback result_callback_; - remote::ExponentialBackoff backoff_; - int retries_left_; -}; - -} // namespace core -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_CORE_TRANSACTION_RUNNER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction_runner.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction_runner.mm deleted file mode 100644 index 79fbbd8f7..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/core/transaction_runner.mm +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "Firestore/core/src/firebase/firestore/core/transaction_runner.h" -#include "Firestore/core/src/firebase/firestore/remote/exponential_backoff.h" -#include "absl/algorithm/container.h" - -namespace firebase { -namespace firestore { -namespace core { -namespace { - -using remote::RemoteStore; -using util::AsyncQueue; -using util::TimerId; -using util::Status; - -/** Maximum number of times a transaction can be retried before failing. */ -constexpr int kRetryCount = 5; - -bool IsRetryableTransactionError(const util::Status& error) { - // In transactions, the backend will fail outdated reads with - // FAILED_PRECONDITION and non-matching document versions with ABORTED. These - // errors should be retried. - Error code = error.code(); - return code == Error::Aborted || code == Error::FailedPrecondition || - !remote::Datastore::IsPermanentError(error); -} -} // namespace - -TransactionRunner::TransactionRunner(const std::shared_ptr& queue, - RemoteStore* remote_store, - TransactionUpdateCallback update_callback, - TransactionResultCallback result_callback) - : queue_{queue}, - remote_store_{remote_store}, - update_callback_{update_callback}, - result_callback_{result_callback}, - backoff_{queue_, TimerId::RetryTransaction}, - retries_left_{kRetryCount} { -} - -void TransactionRunner::Run() { - queue_->VerifyIsCurrentQueue(); - - auto shared_this = this->shared_from_this(); - backoff_.BackoffAndRun([shared_this] { - std::shared_ptr transaction = - shared_this->remote_store_->CreateTransaction(); - shared_this->update_callback_( - transaction, - [transaction, shared_this](util::StatusOr maybe_result) { - shared_this->queue_->Enqueue( - [transaction, shared_this, maybe_result] { - shared_this->ContinueCommit(transaction, maybe_result); - }); - }); - }); -} - -void TransactionRunner::ContinueCommit( - const std::shared_ptr transaction, - const util::StatusOr maybe_result) { - if (!maybe_result.ok()) { - HandleTransactionError(transaction, maybe_result.status()); - } else { - auto shared_this = this->shared_from_this(); - transaction->Commit( - [shared_this, transaction, maybe_result](Status status) { - shared_this->DispatchResult(transaction, status, maybe_result); - }); - } -} - -void TransactionRunner::DispatchResult( - const std::shared_ptr transaction, - Status status, - const util::StatusOr maybe_result) { - if (status.ok()) { - result_callback_(std::move(maybe_result)); - } else { - HandleTransactionError(transaction, status); - } -} - -void TransactionRunner::HandleTransactionError( - const std::shared_ptr transaction, Status status) { - if (retries_left_ > 0 && IsRetryableTransactionError(status) && - !transaction->IsPermanentlyFailed()) { - retries_left_ -= 1; - Run(); - } else { - result_callback_(std::move(status)); - } -} - -} // namespace core -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_set.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_set.h deleted file mode 100644 index 7907a3bff..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_set.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_SET_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_SET_H_ - -#include -#include - -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_map.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/empty.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "absl/base/attributes.h" - -namespace firebase { -namespace firestore { -namespace immutable { - -template , - typename V = util::Empty, - typename M = SortedMap> -class SortedSet : public SortedContainer { - public: - using size_type = typename M::size_type; - using value_type = K; - - using const_iterator = typename M::const_key_iterator; - - explicit SortedSet(const C& comparator = C()) : map_{comparator} { - } - - explicit SortedSet(const M& map) : map_{map} { - } - - explicit SortedSet(M&& map) : map_{std::move(map)} { - } - - SortedSet(std::initializer_list entries, const C& comparator = {}) - : map_{comparator} { - for (auto&& value : entries) { - map_ = map_.insert(value, {}); - } - } - - bool empty() const { - return map_.empty(); - } - - size_type size() const { - return map_.size(); - } - - const C& comparator() const { - return map_.comparator(); - } - - ABSL_MUST_USE_RESULT SortedSet insert(const K& key) const { - return SortedSet{map_.insert(key, {})}; - } - - ABSL_MUST_USE_RESULT SortedSet erase(const K& key) const { - return SortedSet{map_.erase(key)}; - } - - bool contains(const K& key) const { - return map_.contains(key); - } - - const_iterator find(const K& key) const { - return const_iterator{map_.find(key)}; - } - - size_type find_index(const K& key) const { - return map_.find_index(key); - } - - const_iterator min() const { - return const_iterator{map_.min()}; - } - - const_iterator max() const { - return const_iterator{map_.max()}; - } - - const_iterator begin() const { - return const_iterator{map_.begin()}; - } - - const_iterator end() const { - return const_iterator{map_.end()}; - } - - /** - * Returns a view of this SortedSet containing just the keys that have been - * inserted that are greater than or equal to the given key. - */ - const util::range values_from(const K& key) const { - return map_.keys_from(key); - } - - /** - * Returns a view of this SortedSet containing just the keys that have been - * inserted that are greater than or equal to the given start_key and less - * than the given end_key. - */ - const util::range values_in(const K& start_key, - const K& end_key) const { - return map_.keys_in(start_key, end_key); - } - - friend bool operator==(const SortedSet& lhs, const SortedSet& rhs) { - if (lhs.size() != rhs.size()) { - return false; - } - return std::equal(lhs.begin(), lhs.end(), rhs.begin()); - } - - friend bool operator!=(const SortedSet& lhs, const SortedSet& rhs) { - return !(lhs == rhs); - } - - private: - M map_; -}; - -template -SortedSet MakeSortedSet(const SortedMap& map) { - return SortedSet{map}; -} - -} // namespace immutable -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_index_manager.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_index_manager.mm deleted file mode 100644 index 0e3fe7dd8..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_index_manager.mm +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_index_manager.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/memory_index_manager.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "absl/strings/match.h" - -namespace firebase { -namespace firestore { -namespace local { - -using model::ResourcePath; - -LevelDbIndexManager::LevelDbIndexManager(LevelDbPersistence* db) : db_(db) { -} - -void LevelDbIndexManager::AddToCollectionParentIndex( - const ResourcePath& collection_path) { - HARD_ASSERT(collection_path.size() % 2 == 1, "Expected a collection path."); - - if (collection_parents_cache_.Add(collection_path)) { - std::string collection_id = collection_path.last_segment(); - ResourcePath parent_path = collection_path.PopLast(); - - std::string key = - LevelDbCollectionParentKey::Key(collection_id, parent_path); - std::string empty_buffer; - db_->current_transaction()->Put(key, empty_buffer); - } -} - -std::vector LevelDbIndexManager::GetCollectionParents( - const std::string& collection_id) { - std::vector results; - - auto index_iterator = db_->current_transaction()->NewIterator(); - std::string index_prefix = - LevelDbCollectionParentKey::KeyPrefix(collection_id); - LevelDbCollectionParentKey row_key; - for (index_iterator->Seek(index_prefix); index_iterator->Valid(); - index_iterator->Next()) { - if (!absl::StartsWith(index_iterator->key(), index_prefix) || - !row_key.Decode(index_iterator->key()) || - row_key.collection_id() != collection_id) { - break; - } - - results.push_back(row_key.parent()); - } - return results; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.mm deleted file mode 100644 index 8c2f88266..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.mm +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.h" - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/listen_sequence.h" -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "absl/strings/match.h" - -namespace firebase { -namespace firestore { -namespace local { - -using model::DocumentKey; -using model::ListenSequenceNumber; -using model::ResourcePath; - -LevelDbLruReferenceDelegate::LevelDbLruReferenceDelegate( - LevelDbPersistence* persistence, LruParams lru_params) - : db_(persistence) { - gc_ = absl::make_unique(this, lru_params); -} - -// Explicit default the destructor after all forward declared types have been -// fully declared. -LevelDbLruReferenceDelegate::~LevelDbLruReferenceDelegate() = default; - -void LevelDbLruReferenceDelegate::Start() { - ListenSequenceNumber highest_sequence_number = - db_->query_cache()->highest_listen_sequence_number(); - listen_sequence_ = absl::make_unique(highest_sequence_number); -} - -void LevelDbLruReferenceDelegate::AddInMemoryPins(ReferenceSet* set) { - // We should be able to assert that additional_references_ is nullptr, but - // due to restarts in spec tests it would fail. - additional_references_ = set; -} - -void LevelDbLruReferenceDelegate::AddReference(const DocumentKey& key) { - WriteSentinel(key); -} - -void LevelDbLruReferenceDelegate::RemoveReference(const DocumentKey& key) { - WriteSentinel(key); -} - -void LevelDbLruReferenceDelegate::RemoveMutationReference( - const DocumentKey& key) { - WriteSentinel(key); -} - -void LevelDbLruReferenceDelegate::RemoveTarget(const QueryData& query_data) { - QueryData updated = query_data.WithSequenceNumber(current_sequence_number()); - db_->query_cache()->UpdateTarget(std::move(updated)); -} - -void LevelDbLruReferenceDelegate::UpdateLimboDocument(const DocumentKey& key) { - WriteSentinel(key); -} - -ListenSequenceNumber LevelDbLruReferenceDelegate::current_sequence_number() - const { - HARD_ASSERT(current_sequence_number_ != kListenSequenceNumberInvalid, - "Asking for a sequence number outside of a transaction"); - return current_sequence_number_; -} - -void LevelDbLruReferenceDelegate::OnTransactionStarted(absl::string_view) { - HARD_ASSERT(current_sequence_number_ == kListenSequenceNumberInvalid, - "Previous sequence number is still in effect"); - current_sequence_number_ = listen_sequence_->Next(); -} - -void LevelDbLruReferenceDelegate::OnTransactionCommitted() { - current_sequence_number_ = kListenSequenceNumberInvalid; -} - -LruGarbageCollector* LevelDbLruReferenceDelegate::garbage_collector() { - return gc_.get(); -} - -int64_t LevelDbLruReferenceDelegate::CalculateByteSize() { - return db_->CalculateByteSize(); -} - -size_t LevelDbLruReferenceDelegate::GetSequenceNumberCount() { - size_t total_count = db_->query_cache()->size(); - EnumerateOrphanedDocuments( - [&total_count](const DocumentKey&, ListenSequenceNumber) { - total_count++; - }); - return total_count; -} - -void LevelDbLruReferenceDelegate::EnumerateTargets( - const TargetCallback& callback) { - db_->query_cache()->EnumerateTargets(callback); -} - -void LevelDbLruReferenceDelegate::EnumerateOrphanedDocuments( - const OrphanedDocumentCallback& callback) { - db_->query_cache()->EnumerateOrphanedDocuments(callback); -} - -int LevelDbLruReferenceDelegate::RemoveOrphanedDocuments( - ListenSequenceNumber upper_bound) { - int count = 0; - db_->query_cache()->EnumerateOrphanedDocuments( - [&](const DocumentKey& key, ListenSequenceNumber sequence_number) { - if (sequence_number <= upper_bound) { - if (!IsPinned(key)) { - count++; - db_->remote_document_cache()->Remove(key); - RemoveSentinel(key); - } - } - }); - return count; -} - -int LevelDbLruReferenceDelegate::RemoveTargets( - ListenSequenceNumber sequence_number, const LiveQueryMap& live_queries) { - return db_->query_cache()->RemoveTargets(sequence_number, live_queries); -} - -bool LevelDbLruReferenceDelegate::IsPinned(const DocumentKey& key) { - if (additional_references_->ContainsKey(key)) { - return true; - } - return MutationQueuesContainKey(key); -} - -bool LevelDbLruReferenceDelegate::MutationQueuesContainKey( - const DocumentKey& key) { - const std::set& users = db_->users(); - const ResourcePath& path = key.path(); - std::string buffer; - auto it = db_->current_transaction()->NewIterator(); - // For each user, if there is any batch that contains this document in any - // batch, we know it's pinned. - for (const std::string& user : users) { - std::string mutation_key = - LevelDbDocumentMutationKey::KeyPrefix(user, path); - it->Seek(mutation_key); - if (it->Valid() && absl::StartsWith(it->key(), mutation_key)) { - return true; - } - } - return false; -} - -void LevelDbLruReferenceDelegate::RemoveSentinel(const DocumentKey& key) { - db_->current_transaction()->Delete( - LevelDbDocumentTargetKey::SentinelKey(key)); -} - -void LevelDbLruReferenceDelegate::WriteSentinel(const DocumentKey& key) { - std::string sentinel_key = LevelDbDocumentTargetKey::SentinelKey(key); - std::string encoded_sequence_number = - LevelDbDocumentTargetKey::EncodeSentinelValue(current_sequence_number()); - db_->current_transaction()->Put(sentinel_key, encoded_sequence_number); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.h deleted file mode 100644 index 9985cea76..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_MUTATION_QUEUE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_MUTATION_QUEUE_H_ - -#if !defined(__OBJC__) -#error "For now, this file must only be included by ObjC source files." -#endif // !defined(__OBJC__) - -#import - -#include -#include -#include - -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" -#include "Firestore/core/src/firebase/firestore/local/mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "absl/strings/string_view.h" -#include "leveldb/db.h" - -@class FSTLocalSerializer; -@class FSTPBMutationQueue; - -NS_ASSUME_NONNULL_BEGIN - -namespace firebase { -namespace firestore { -namespace local { - -class LevelDbPersistence; - -/** - * Returns one larger than the largest batch ID that has been stored. If there - * are no mutations returns 0. Note that batch IDs are global. - */ -model::BatchId LoadNextBatchIdFromDb(leveldb::DB* db); - -class LevelDbMutationQueue : public MutationQueue { - public: - LevelDbMutationQueue(const auth::User& user, - LevelDbPersistence* db, - FSTLocalSerializer* serializer); - - void Start() override; - - bool IsEmpty() override; - - void AcknowledgeBatch(const model::MutationBatch& batch, - const nanopb::ByteString& stream_token) override; - - model::MutationBatch AddMutationBatch( - const Timestamp& local_write_time, - std::vector&& base_mutations, - std::vector&& mutations) override; - - void RemoveMutationBatch(const model::MutationBatch& batch) override; - - std::vector AllMutationBatches() override; - - std::vector AllMutationBatchesAffectingDocumentKeys( - const model::DocumentKeySet& document_keys) override; - - std::vector AllMutationBatchesAffectingDocumentKey( - const model::DocumentKey& key) override; - - std::vector AllMutationBatchesAffectingQuery( - const core::Query& query) override; - - absl::optional LookupMutationBatch( - model::BatchId batch_id) override; - - absl::optional NextMutationBatchAfterBatchId( - model::BatchId batch_id) override; - - model::BatchId GetHighestUnacknowledgedBatchId() override; - - void PerformConsistencyCheck() override; - - nanopb::ByteString GetLastStreamToken() override; - - void SetLastStreamToken(const nanopb::ByteString& stream_token) override; - - private: - /** - * Constructs a vector of matching batches, sorted by batch_id to ensure that - * multiple mutations affecting the same document key are applied in order. - */ - std::vector AllMutationBatchesWithIds( - const std::set& batch_ids); - - std::string mutation_queue_key() { - return LevelDbMutationQueueKey::Key(user_id_); - } - - std::string mutation_batch_key(model::BatchId batch_id) { - return LevelDbMutationKey::Key(user_id_, batch_id); - } - - /** Parses the MutationQueue metadata from the given LevelDB row contents. */ - FSTPBMutationQueue* _Nullable MetadataForKey(const std::string& key); - - model::MutationBatch ParseMutationBatch(absl::string_view encoded); - - // The LevelDbMutationQueue instance is owned by LevelDbPersistence. - LevelDbPersistence* db_; - - FSTLocalSerializer* serializer_; - - /** - * The normalized user_id (i.e. after converting null to empty) as used in our - * LevelDB keys. - */ - std::string user_id_; - - /** - * Next value to use when assigning sequential IDs to each mutation batch. - * - * NOTE: There can only be one LevelDbMutationQueue for a given db at a time, - * hence it is safe to track next_batch_id_ as an instance-level property. - * Should we ever relax this constraint we'll need to revisit this. - */ - model::BatchId next_batch_id_; - - /** - * A write-through cache copy of the metadata describing the current queue. - */ - FSTPBMutationQueue* _Nullable metadata_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -NS_ASSUME_NONNULL_END - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_MUTATION_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.mm deleted file mode 100644 index a46f1258b..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.mm +++ /dev/null @@ -1,505 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.h" - -#include -#include - -#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" -#import "Firestore/Source/Local/FSTLocalSerializer.h" - -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_transaction.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_util.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/string_util.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" -#include "absl/strings/match.h" - -NS_ASSUME_NONNULL_BEGIN - -namespace firebase { -namespace firestore { -namespace local { - -using auth::User; -using core::Query; -using leveldb::DB; -using leveldb::Iterator; -using leveldb::Status; -using model::BatchId; -using model::DocumentKey; -using model::DocumentKeySet; -using model::kBatchIdUnknown; -using model::Mutation; -using model::MutationBatch; -using model::ResourcePath; -using nanopb::ByteString; -using nanopb::MakeByteString; -using nanopb::MakeNSData; - -BatchId LoadNextBatchIdFromDb(DB* db) { - // TODO(gsoltis): implement Prev() and SeekToLast() on - // LevelDbTransaction::Iterator, then port this to a transaction. - std::unique_ptr it( - db->NewIterator(LevelDbTransaction::DefaultReadOptions())); - - std::string table_key = LevelDbMutationKey::KeyPrefix(); - - LevelDbMutationKey row_key; - BatchId max_batch_id = 0; - - bool more_user_ids = false; - std::string next_user_id; - - it->Seek(table_key); - if (it->Valid() && row_key.Decode(MakeStringView(it->key()))) { - more_user_ids = true; - next_user_id = row_key.user_id(); - } - - // This loop assumes that next_user_id contains the next username at the start - // of the iteration. - while (more_user_ids) { - // Compute the first key after the last mutation for next_user_id. - std::string user_end = LevelDbMutationKey::KeyPrefix(next_user_id); - user_end = util::PrefixSuccessor(user_end); - - // Seek to that key with the intent of finding the boundary between - // next_user_id's mutations and the one after that (if any). - it->Seek(user_end); - - // At this point there are three possible cases to handle differently. Each - // case must prepare the next iteration (by assigning to next_user_id or - // setting more_user_ids = false) and seek the iterator to the last row in - // the current user's mutation sequence. - if (!it->Valid()) { - // The iterator is past the last row altogether (there are no additional - // user_ids and now rows in any table after mutations). The last row will - // have the highest batch_id. - more_user_ids = false; - it->SeekToLast(); - - } else if (row_key.Decode(MakeStringView(it->key()))) { - // The iterator is valid and the key decoded successfully so the next user - // was just decoded. - next_user_id = row_key.user_id(); - it->Prev(); - - } else { - // The iterator is past the end of the mutations table but there are other - // rows. - more_user_ids = false; - it->Prev(); - } - - // In all the cases above there was at least one row for the current user - // and each case has set things up such that iterator points to it. - if (!row_key.Decode(MakeStringView(it->key()))) { - HARD_FAIL("There should have been a key previous to %s", user_end); - } - - if (row_key.batch_id() > max_batch_id) { - max_batch_id = row_key.batch_id(); - } - } - - return max_batch_id + 1; -} - -LevelDbMutationQueue::LevelDbMutationQueue(const User& user, - LevelDbPersistence* db, - FSTLocalSerializer* serializer) - : db_(db), - serializer_(serializer), - user_id_(user.is_authenticated() ? user.uid() : "") { -} - -void LevelDbMutationQueue::Start() { - next_batch_id_ = LoadNextBatchIdFromDb(db_->ptr()); - - std::string key = mutation_queue_key(); - FSTPBMutationQueue* metadata = MetadataForKey(key); - if (!metadata) { - metadata = [FSTPBMutationQueue message]; - } - metadata_ = metadata; -} - -bool LevelDbMutationQueue::IsEmpty() { - std::string user_key = LevelDbMutationKey::KeyPrefix(user_id_); - - auto it = db_->current_transaction()->NewIterator(); - it->Seek(user_key); - - bool empty = true; - if (it->Valid() && absl::StartsWith(it->key(), user_key)) { - empty = false; - } - return empty; -} - -void LevelDbMutationQueue::AcknowledgeBatch(const MutationBatch&, - const ByteString& stream_token) { - SetLastStreamToken(stream_token); -} - -MutationBatch LevelDbMutationQueue::AddMutationBatch( - const Timestamp& local_write_time, - std::vector&& base_mutations, - std::vector&& mutations) { - BatchId batch_id = next_batch_id_; - next_batch_id_++; - - MutationBatch batch(batch_id, local_write_time, std::move(base_mutations), - std::move(mutations)); - std::string key = mutation_batch_key(batch_id); - db_->current_transaction()->Put(key, - [serializer_ encodedMutationBatch:batch]); - - // Store an empty value in the index which is equivalent to serializing a - // GPBEmpty message. In the future if we wanted to store some other kind of - // value here, we can parse these empty values as with some other protocol - // buffer (and the parser will see all default values). - std::string empty_buffer; - - for (const Mutation& mutation : batch.mutations()) { - key = LevelDbDocumentMutationKey::Key(user_id_, mutation.key(), batch_id); - db_->current_transaction()->Put(key, empty_buffer); - - db_->index_manager()->AddToCollectionParentIndex( - mutation.key().path().PopLast()); - } - - return batch; -} - -void LevelDbMutationQueue::RemoveMutationBatch(const MutationBatch& batch) { - auto check_iterator = db_->current_transaction()->NewIterator(); - - BatchId batch_id = batch.batch_id(); - std::string key = mutation_batch_key(batch_id); - - // As a sanity check, verify that the mutation batch exists before deleting - // it. - check_iterator->Seek(key); - HARD_ASSERT(check_iterator->Valid(), "Mutation batch %s did not exist", - DescribeKey(key)); - - HARD_ASSERT(key == check_iterator->key(), - "Mutation batch %s not found; found %s", DescribeKey(key), - DescribeKey(check_iterator->key())); - - db_->current_transaction()->Delete(key); - - for (const Mutation& mutation : batch.mutations()) { - key = LevelDbDocumentMutationKey::Key(user_id_, mutation.key(), batch_id); - db_->current_transaction()->Delete(key); - db_->reference_delegate()->RemoveMutationReference(mutation.key()); - } -} - -std::vector LevelDbMutationQueue::AllMutationBatches() { - std::string user_key = LevelDbMutationKey::KeyPrefix(user_id_); - - auto it = db_->current_transaction()->NewIterator(); - it->Seek(user_key); - std::vector result; - for (; it->Valid() && absl::StartsWith(it->key(), user_key); it->Next()) { - result.push_back(ParseMutationBatch(it->value())); - } - return result; -} - -std::vector -LevelDbMutationQueue::AllMutationBatchesAffectingDocumentKeys( - const DocumentKeySet& document_keys) { - // Take a pass through the document keys and collect the set of unique - // mutation batch_ids that affect them all. Some batches can affect more than - // one key. - std::set batch_ids; - - auto index_iterator = db_->current_transaction()->NewIterator(); - LevelDbDocumentMutationKey row_key; - for (const DocumentKey& document_key : document_keys) { - std::string index_prefix = - LevelDbDocumentMutationKey::KeyPrefix(user_id_, document_key.path()); - for (index_iterator->Seek(index_prefix); index_iterator->Valid(); - index_iterator->Next()) { - // Only consider rows matching exactly the specific key of interest. Index - // rows have this form (with markers in brackets): - // - // user collection doc 2 - // user collection doc 3 - // user collection doc sub doc 3 - // - // - // Note that Path markers sort after BatchId markers so this means that - // when searching for collection/doc, all the entries for it will be - // contiguous in the table, allowing a break after any mismatch. - if (!absl::StartsWith(index_iterator->key(), index_prefix) || - !row_key.Decode(index_iterator->key()) || - row_key.document_key() != document_key) { - break; - } - - batch_ids.insert(row_key.batch_id()); - } - } - - return AllMutationBatchesWithIds(batch_ids); -} - -std::vector -LevelDbMutationQueue::AllMutationBatchesAffectingDocumentKey( - const DocumentKey& key) { - return AllMutationBatchesAffectingDocumentKeys(DocumentKeySet{key}); -} - -std::vector -LevelDbMutationQueue::AllMutationBatchesAffectingQuery(const Query& query) { - HARD_ASSERT(!query.IsDocumentQuery(), - "Document queries shouldn't go down this path"); - HARD_ASSERT( - !query.IsCollectionGroupQuery(), - "CollectionGroup queries should be handled in LocalDocumentsView"); - - const ResourcePath& query_path = query.path(); - size_t immediate_children_path_length = query_path.size() + 1; - - // TODO(mcg): Actually implement a single-collection query - // - // This is actually executing an ancestor query, traversing the whole subtree - // below the collection which can be horrifically inefficient for some - // structures. The right way to solve this is to implement the full value - // index, but that's not in the cards in the near future so this is the best - // we can do for the moment. - // - // Since we don't yet index the actual properties in the mutations, our - // current approach is to just return all mutation batches that affect - // documents in the collection being queried. - // - // Unlike AllMutationBatchesAffectingDocumentKey, this iteration will scan the - // document-mutation index for more than a single document so the associated - // batch_ids will be neither necessarily unique nor in order. This means an - // efficient simultaneous scan isn't possible. - std::string index_prefix = - LevelDbDocumentMutationKey::KeyPrefix(user_id_, query_path); - auto index_iterator = db_->current_transaction()->NewIterator(); - index_iterator->Seek(index_prefix); - - LevelDbDocumentMutationKey row_key; - - // Collect up unique batch_ids encountered during a scan of the index. Use a - // set to accumulate the IDs so they can be traversed in order in a - // scan of the main table. - // - // This method is faster than performing lookups of the keys with _db->Get and - // keeping a hash of batch_ids that have already been looked up. The - // performance difference is minor for small numbers of keys but > 30% faster - // for larger numbers of keys. - std::set unique_batch_ids; - for (; index_iterator->Valid(); index_iterator->Next()) { - if (!absl::StartsWith(index_iterator->key(), index_prefix) || - !row_key.Decode(index_iterator->key())) { - break; - } - - // Rows with document keys more than one segment longer than the query path - // can't be matches. For example, a query on 'rooms' can't match the - // document /rooms/abc/messages/xyx. - // TODO(mcg): we'll need a different scanner when we implement ancestor - // queries. - if (row_key.document_key().path().size() != - immediate_children_path_length) { - continue; - } - - unique_batch_ids.insert(row_key.batch_id()); - } - - return AllMutationBatchesWithIds(unique_batch_ids); -} - -absl::optional LevelDbMutationQueue::LookupMutationBatch( - model::BatchId batch_id) { - std::string key = mutation_batch_key(batch_id); - - std::string value; - Status status = db_->current_transaction()->Get(key, &value); - if (!status.ok()) { - if (status.IsNotFound()) { - return absl::nullopt; - } - HARD_FAIL("Lookup mutation batch (%s, %s) failed with status: %s", user_id_, - batch_id, status.ToString()); - } - - return ParseMutationBatch(value); -} - -absl::optional -LevelDbMutationQueue::NextMutationBatchAfterBatchId(model::BatchId batch_id) { - BatchId next_batch_id = batch_id + 1; - - std::string key = mutation_batch_key(next_batch_id); - auto it = db_->current_transaction()->NewIterator(); - it->Seek(key); - - LevelDbMutationKey row_key; - if (!it->Valid() || !row_key.Decode(it->key())) { - // Past the last row in the DB or out of the mutations table - return absl::nullopt; - } - - if (row_key.user_id() != user_id_) { - // Jumped past the last mutation for this user - return absl::nullopt; - } - - HARD_ASSERT(row_key.batch_id() >= next_batch_id, - "Should have found mutation after %s", next_batch_id); - return ParseMutationBatch(it->value()); -} - -BatchId LevelDbMutationQueue::GetHighestUnacknowledgedBatchId() { - std::unique_ptr it( - db_->ptr()->NewIterator(LevelDbTransaction::DefaultReadOptions())); - - std::string next_user_key = - util::PrefixSuccessor(LevelDbMutationKey::KeyPrefix(user_id_)); - - LevelDbMutationKey row_key; - - it->Seek(next_user_key); - it->Prev(); - if (it->Valid() && row_key.Decode(MakeStringView(it->key())) && - row_key.user_id() == user_id_) { - return row_key.batch_id(); - } - - return kBatchIdUnknown; -} - -void LevelDbMutationQueue::PerformConsistencyCheck() { - if (!IsEmpty()) { - return; - } - - // Verify that there are no entries in the document-mutation index if the - // queue is empty. - std::string index_prefix = LevelDbDocumentMutationKey::KeyPrefix(user_id_); - auto index_iterator = db_->current_transaction()->NewIterator(); - index_iterator->Seek(index_prefix); - - std::vector dangling_mutation_references; - - for (; index_iterator->Valid(); index_iterator->Next()) { - // Only consider rows matching this index prefix for the current user. - if (!absl::StartsWith(index_iterator->key(), index_prefix)) { - break; - } - - dangling_mutation_references.push_back(DescribeKey(index_iterator)); - } - - HARD_ASSERT( - dangling_mutation_references.empty(), - "Document leak -- detected dangling mutation references when queue " - "is empty. Dangling keys: %s", - util::ToString(dangling_mutation_references)); -} - -ByteString LevelDbMutationQueue::GetLastStreamToken() { - return MakeByteString(metadata_.lastStreamToken); -} - -void LevelDbMutationQueue::SetLastStreamToken(const ByteString& stream_token) { - metadata_.lastStreamToken = MakeNullableNSData(stream_token); - - db_->current_transaction()->Put(mutation_queue_key(), metadata_); -} - -std::vector LevelDbMutationQueue::AllMutationBatchesWithIds( - const std::set& batch_ids) { - std::vector result; - - // Given an ordered set of unique batch_ids perform a skipping scan over the - // main table to find the mutation batches. - auto mutation_iterator = db_->current_transaction()->NewIterator(); - for (BatchId batch_id : batch_ids) { - std::string mutation_key = mutation_batch_key(batch_id); - mutation_iterator->Seek(mutation_key); - if (!mutation_iterator->Valid() || - mutation_iterator->key() != mutation_key) { - HARD_FAIL("Dangling document-mutation reference found: " - "Missing batch %s; seeking there found %s", - DescribeKey(mutation_key), DescribeKey(mutation_iterator)); - } - - result.push_back(ParseMutationBatch(mutation_iterator->value())); - } - return result; -} - -FSTPBMutationQueue* _Nullable LevelDbMutationQueue::MetadataForKey( - const std::string& key) { - std::string value; - Status status = db_->current_transaction()->Get(key, &value); - if (status.ok()) { - NSData* data = [[NSData alloc] initWithBytesNoCopy:(void*)value.data() - length:value.size() - freeWhenDone:NO]; - - NSError* error; - FSTPBMutationQueue* proto = [FSTPBMutationQueue parseFromData:data - error:&error]; - if (!proto) { - HARD_FAIL("FSTPBMutationQueue failed to parse: %s", error); - } - return proto; - } else if (status.IsNotFound()) { - return nil; - } else { - HARD_FAIL("MetadataForKey: failed loading key %s with status: %s", key, - status.ToString()); - } -} - -MutationBatch LevelDbMutationQueue::ParseMutationBatch( - absl::string_view encoded) { - NSData* data = [[NSData alloc] initWithBytesNoCopy:(void*)encoded.data() - length:encoded.size() - freeWhenDone:NO]; - - NSError* error; - FSTPBWriteBatch* proto = [FSTPBWriteBatch parseFromData:data error:&error]; - if (!proto) { - HARD_FAIL("FSTPBMutationBatch failed to parse: %s", error); - } - - return [serializer_ decodedMutationBatch:proto]; -} - -} // namespace local -} // namespace firestore -} // namespace firebase - -NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence.h deleted file mode 100644 index 7da026b2c..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence.h +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_PERSISTENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_PERSISTENCE_H_ - -#if !defined(__OBJC__) -#error "This header only supports Objective-C++" -#endif // !defined(__OBJC__) - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_index_manager.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_query_cache.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_transaction.h" -#include "Firestore/core/src/firebase/firestore/local/persistence.h" -#include "Firestore/core/src/firebase/firestore/util/path.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" - -@class FSTLocalSerializer; - -namespace firebase { -namespace firestore { -namespace core { - -class DatabaseInfo; - -} // namespace core - -namespace local { - -class LevelDbLruReferenceDelegate; -struct LruParams; - -/** A LevelDB-backed implementation of the Persistence interface. */ -class LevelDbPersistence : public Persistence { - public: - /** - * Creates a LevelDB in the given directory and returns it or a Status object - * containing details of the failure. - */ - static util::StatusOr> Create( - util::Path dir, - FSTLocalSerializer* serializer, - const LruParams& lru_params); - - /** - * Finds a suitable directory to serve as the root of all Firestore local - * storage. - */ - static util::Path AppDataDirectory(); - - /** - * Computes a unique storage directory for the given identifying components of - * local storage. - * - * @param database_info The identifying information for the local storage - * instance. - * @param documents_dir The root document directory relative to which - * the storage directory will be created. Usually just - * `LevelDbPersistence::AppDataDirectory()`. - * @return A storage directory unique to the instance identified by - * `database_info`. - */ - static util::Path StorageDirectory(const core::DatabaseInfo& database_info, - const util::Path& documents_dir); - - LevelDbTransaction* current_transaction(); - - leveldb::DB* ptr() { - return db_.get(); - } - - const std::set users() const { - return users_; - } - - static util::Status ClearPersistence(const core::DatabaseInfo& database_info); - - int64_t CalculateByteSize(); - - // MARK: Persistence overrides - - model::ListenSequenceNumber current_sequence_number() const override; - - void Shutdown() override; - - LevelDbMutationQueue* GetMutationQueueForUser( - const auth::User& user) override; - - LevelDbQueryCache* query_cache() override; - - LevelDbRemoteDocumentCache* remote_document_cache() override; - - LevelDbIndexManager* index_manager() override; - - LevelDbLruReferenceDelegate* reference_delegate() override; - - protected: - void RunInternal(absl::string_view label, - std::function block) override; - - private: - LevelDbPersistence(std::unique_ptr db, - util::Path directory, - std::set users, - FSTLocalSerializer* serializer, - const LruParams& lru_params); - - /** - * Ensures that the given directory exists. - */ - static util::Status EnsureDirectory(const util::Path& dir); - - /** - * Marks the given directory as excluded from platform-specific backup schemes - * like iCloud backup. - */ - static util::Status ExcludeFromBackups(const util::Path& dir); - - /** Opens the database within the given directory. */ - static util::StatusOr> OpenDb( - const util::Path& dir); - - static constexpr const char* kReservedPathComponent = "firestore"; - - std::unique_ptr db_; - - util::Path directory_; - std::set users_; - FSTLocalSerializer* serializer_; - bool started_ = false; - - std::unique_ptr current_mutation_queue_; - std::unique_ptr query_cache_; - std::unique_ptr document_cache_; - std::unique_ptr index_manager_; - std::unique_ptr reference_delegate_; - - std::unique_ptr transaction_; -}; - -/** Returns a standard set of read options. */ -leveldb::ReadOptions StandardReadOptions(); - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_PERSISTENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence.mm deleted file mode 100644 index 5b6b5a48e..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence.mm +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_migrations.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_util.h" -#include "Firestore/core/src/firebase/firestore/local/listen_sequence.h" -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/sizer.h" -#include "Firestore/core/src/firebase/firestore/util/filesystem.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/string_util.h" -#include "absl/memory/memory.h" -#include "absl/strings/match.h" - -namespace firebase { -namespace firestore { -namespace local { -namespace { - -using auth::User; -using leveldb::DB; -using model::ListenSequenceNumber; -using util::Path; -using util::Status; -using util::StatusOr; -using util::StringFormat; - -/** - * Finds all user ids in the database based on the existence of a mutation - * queue. - */ -std::set CollectUserSet(LevelDbTransaction* transaction) { - std::set result; - - std::string table_prefix = LevelDbMutationKey::KeyPrefix(); - auto it = transaction->NewIterator(); - it->Seek(table_prefix); - - LevelDbMutationKey row_key; - while (it->Valid() && absl::StartsWith(it->key(), table_prefix) && - row_key.Decode(it->key())) { - result.insert(row_key.user_id()); - - auto user_end = LevelDbMutationKey::KeyPrefix(row_key.user_id()); - user_end = util::PrefixSuccessor(user_end); - it->Seek(user_end); - } - return result; -} - -} // namespace - -util::StatusOr> LevelDbPersistence::Create( - util::Path dir, - FSTLocalSerializer* serializer, - const LruParams& lru_params) { - Status status = EnsureDirectory(dir); - if (!status.ok()) return status; - - status = ExcludeFromBackups(dir); - if (!status.ok()) return status; - - StatusOr> created = OpenDb(dir); - if (!created.ok()) return created.status(); - - std::unique_ptr db = std::move(created).ValueOrDie(); - LevelDbMigrations::RunMigrations(db.get()); - - LevelDbTransaction transaction(db.get(), "Start LevelDB"); - std::set users = CollectUserSet(&transaction); - transaction.Commit(); - - // Explicit conversion is required to allow the StatusOr to be created. - std::unique_ptr result(new LevelDbPersistence( - std::move(db), std::move(dir), std::move(users), serializer, lru_params)); - return std::move(result); -} - -LevelDbPersistence::LevelDbPersistence(std::unique_ptr db, - util::Path directory, - std::set users, - FSTLocalSerializer* serializer, - const LruParams& lru_params) - : db_(std::move(db)), - directory_(std::move(directory)), - users_(std::move(users)), - serializer_(serializer) { - query_cache_ = absl::make_unique(this, serializer_); - document_cache_ = - absl::make_unique(this, serializer_); - index_manager_ = absl::make_unique(this); - reference_delegate_ = - absl::make_unique(this, lru_params); - - // TODO(gsoltis): set up a leveldb transaction for these operations. - query_cache_->Start(); - reference_delegate_->Start(); - started_ = true; -} - -// MARK: - Storage location - -#if !defined(__APPLE__) - -Path LevelDbPersistence::AppDataDirectory() { -#error "This does not yet support non-Apple platforms." -} - -#endif // !defined(__APPLE__) - -util::Path LevelDbPersistence::StorageDirectory( - const core::DatabaseInfo& database_info, const util::Path& documents_dir) { - // Use two different path formats: - // - // * persistence_key / project_id . database_id / name - // * persistence_key / project_id / name - // - // project_ids are DNS-compatible names and cannot contain dots so there's - // no danger of collisions. - std::string project_key = database_info.database_id().project_id(); - if (!database_info.database_id().IsDefaultDatabase()) { - absl::StrAppend(&project_key, ".", - database_info.database_id().database_id()); - } - - // Reserve one additional path component to allow multiple physical databases - return Path::JoinUtf8(documents_dir, database_info.persistence_key(), - project_key, "main"); -} - -// MARK: - Startup - -Status LevelDbPersistence::EnsureDirectory(const Path& dir) { - Status status = util::RecursivelyCreateDir(dir); - if (!status.ok()) { - return Status{Error::Internal, "Failed to create persistence directory"} - .CausedBy(status); - } - - return Status::OK(); -} - -#if !defined(__APPLE__) - -Status LevelDbPersistence::ExcludeFromBackups(const Path& directory) { - // Non-Apple platforms don't yet implement exclusion from backups. - return Status::OK(); -} - -#endif - -StatusOr> LevelDbPersistence::OpenDb(const Path& dir) { - leveldb::Options options; - options.create_if_missing = true; - - DB* database = nullptr; - leveldb::Status status = DB::Open(options, dir.ToUtf8String(), &database); - if (!status.ok()) { - return Status{Error::Internal, - StringFormat("Failed to open LevelDB database at %s", - dir.ToUtf8String())} - .CausedBy(ConvertStatus(status)); - } - - return std::unique_ptr(database); -} - -// MARK: - LevelDB utilities - -LevelDbTransaction* LevelDbPersistence::current_transaction() { - HARD_ASSERT(transaction_ != nullptr, - "Attempting to access transaction before one has started"); - return transaction_.get(); -} - -util::Status LevelDbPersistence::ClearPersistence( - const core::DatabaseInfo& database_info) { - Path leveldb_dir = StorageDirectory(database_info, AppDataDirectory()); - LOG_DEBUG("Clearing persistence for path: %s", leveldb_dir.ToUtf8String()); - return util::RecursivelyDelete(leveldb_dir); -} - -int64_t LevelDbPersistence::CalculateByteSize() { - int64_t count = 0; - auto iter = util::DirectoryIterator::Create(directory_); - for (; iter->Valid(); iter->Next()) { - int64_t file_size = util::FileSize(iter->file()).ValueOrDie(); - count += file_size; - } - - HARD_ASSERT(iter->status().ok(), "Failed to iterate leveldb directory: %s", - iter->status().error_message().c_str()); - HARD_ASSERT(count >= 0 && count <= std::numeric_limits::max(), - "Overflowed counting bytes cached"); - return count; -} - -// MARK: - Persistence - -model::ListenSequenceNumber LevelDbPersistence::current_sequence_number() - const { - return reference_delegate_->current_sequence_number(); -} - -void LevelDbPersistence::Shutdown() { - HARD_ASSERT(started_, "LevelDbPersistence shutdown without start!"); - started_ = false; - db_.reset(); -} - -LevelDbMutationQueue* LevelDbPersistence::GetMutationQueueForUser( - const auth::User& user) { - users_.insert(user.uid()); - current_mutation_queue_ = - absl::make_unique(user, this, serializer_); - return current_mutation_queue_.get(); -} - -LevelDbQueryCache* LevelDbPersistence::query_cache() { - return query_cache_.get(); -} - -LevelDbRemoteDocumentCache* LevelDbPersistence::remote_document_cache() { - return document_cache_.get(); -} - -LevelDbIndexManager* LevelDbPersistence::index_manager() { - return index_manager_.get(); -} - -LevelDbLruReferenceDelegate* LevelDbPersistence::reference_delegate() { - return reference_delegate_.get(); -} - -void LevelDbPersistence::RunInternal(absl::string_view label, - std::function block) { - HARD_ASSERT(transaction_ == nullptr, - "Starting a transaction while one is already in progress"); - - transaction_ = absl::make_unique(db_.get(), label); - reference_delegate_->OnTransactionStarted(label); - - block(); - - reference_delegate_->OnTransactionCommitted(); - transaction_->Commit(); - transaction_.reset(); -} - -constexpr const char* LevelDbPersistence::kReservedPathComponent; - -leveldb::ReadOptions StandardReadOptions() { - // For now this is paranoid, but perhaps disable that in production builds. - leveldb::ReadOptions options; - options.verify_checksums = true; - return options; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence_apple.mm deleted file mode 100644 index 125171da1..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_persistence_apple.mm +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" - -#import - -#include "Firestore/core/src/firebase/firestore/util/path.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" - -#if defined(__APPLE__) - -namespace firebase { -namespace firestore { -namespace local { - -using util::Path; -using util::Status; - -Path LevelDbPersistence::AppDataDirectory() { -#if TARGET_OS_IOS - NSArray* directories = NSSearchPathForDirectoriesInDomains( - NSDocumentDirectory, NSUserDomainMask, YES); - return Path::FromNSString(directories[0]).AppendUtf8(kReservedPathComponent); - -#elif TARGET_OS_TV - NSArray* directories = NSSearchPathForDirectoriesInDomains( - NSCachesDirectory, NSUserDomainMask, YES); - return Path::FromNSString(directories[0]).AppendUtf8(kReservedPathComponent); - -#elif TARGET_OS_OSX - std::string dot_prefixed = absl::StrCat(".", kReservedPathComponent); - return Path::FromNSString(NSHomeDirectory()).AppendUtf8(dot_prefixed); - -#else -#error "Don't know where to store documents on this platform." - -#endif -} - -Status LevelDbPersistence::ExcludeFromBackups(const Path& dir) { - NSURL* dir_url = [NSURL fileURLWithPath:dir.ToNSString()]; - NSError* error = nil; - if (![dir_url setResourceValue:@YES - forKey:NSURLIsExcludedFromBackupKey - error:&error]) { - return Status{ - Error::Internal, - "Failed to mark persistence directory as excluded from backups"} - .CausedBy(Status::FromNSError(error)); - } - - return Status::OK(); -} - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // __APPLE__ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_query_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_query_cache.h deleted file mode 100644 index b060f0146..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_query_cache.h +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_QUERY_CACHE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_QUERY_CACHE_H_ - -#if !defined(__OBJC__) -#error "For now, this file must only be included by ObjC source files." -#endif // !defined(__OBJC__) - -#import - -#include - -#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" -#include "Firestore/core/src/firebase/firestore/local/query_cache.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "absl/strings/string_view.h" -#include "leveldb/db.h" - -@class FSTLocalSerializer; - -NS_ASSUME_NONNULL_BEGIN - -namespace firebase { -namespace firestore { -namespace local { - -class LevelDbPersistence; - -/** Cached Queries backed by LevelDB. */ -class LevelDbQueryCache : public QueryCache { - public: - /** - * Retrieves the global singleton metadata row from the given database, if it - * exists. - * TODO(gsoltis): remove this method once fully ported to transactions. - */ - static FSTPBTargetGlobal* ReadMetadata(leveldb::DB* db); - - /** - * Creates a new query cache in the given LevelDB. - * - * @param db The LevelDB in which to create the cache. - */ - LevelDbQueryCache(LevelDbPersistence* db, FSTLocalSerializer* serializer); - - // Target-related methods - void AddTarget(const QueryData& query_data) override; - - void UpdateTarget(const QueryData& query_data) override; - - void RemoveTarget(const QueryData& query_data) override; - - absl::optional GetTarget(const core::Query& query) override; - - void EnumerateTargets(const TargetCallback& callback) override; - - int RemoveTargets(model::ListenSequenceNumber upper_bound, - const std::unordered_map& - live_targets) override; - - // Key-related methods - - /** Adds the given document keys to cached query results of the given target - * ID. */ - void AddMatchingKeys(const model::DocumentKeySet& keys, - model::TargetId target_id) override; - - /** Removes the given document keys from the cached query results of the given - * target ID. */ - void RemoveMatchingKeys(const model::DocumentKeySet& keys, - model::TargetId target_id) override; - - /** Removes all the keys in the query results of the given target ID. */ - void RemoveAllKeysForTarget(model::TargetId target_id); - - model::DocumentKeySet GetMatchingKeys(model::TargetId target_id) override; - - /** - * Checks to see if there are any references to a document with the given key. - */ - bool Contains(const model::DocumentKey& key) override; - - // Other methods and accessors - size_t size() const override { - return metadata_.targetCount; - } - - model::TargetId highest_target_id() const override { - return metadata_.highestTargetId; - } - - model::ListenSequenceNumber highest_listen_sequence_number() const override { - return metadata_.highestListenSequenceNumber; - } - - const model::SnapshotVersion& GetLastRemoteSnapshotVersion() const override; - - void SetLastRemoteSnapshotVersion(model::SnapshotVersion version) override; - - // Non-interface methods - void Start(); - - void EnumerateOrphanedDocuments(const OrphanedDocumentCallback& callback); - - private: - void Save(const QueryData& query_data); - bool UpdateMetadata(const QueryData& query_data); - void SaveMetadata(); - /** - * Parses the given bytes as an FSTPBTarget protocol buffer and then converts - * to the equivalent query data. - */ - QueryData DecodeTarget(absl::string_view encoded); - - // The LevelDbQueryCache is owned by LevelDbPersistence. - LevelDbPersistence* db_; - FSTLocalSerializer* serializer_; - /** A write-through cached copy of the metadata for the query cache. */ - FSTPBTargetGlobal* metadata_; - model::SnapshotVersion last_remote_snapshot_version_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -NS_ASSUME_NONNULL_END - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_QUERY_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_query_cache.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_query_cache.mm deleted file mode 100644 index 08a1c47c3..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_query_cache.mm +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_query_cache.h" - -#include -#include - -#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" -#import "Firestore/Source/Local/FSTLocalSerializer.h" - -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "absl/strings/match.h" - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::DocumentKey; -using model::DocumentKeySet; -using model::ListenSequenceNumber; -using model::SnapshotVersion; -using model::TargetId; -using util::MakeString; -using leveldb::Status; - -FSTPBTargetGlobal* LevelDbQueryCache::ReadMetadata(leveldb::DB* db) { - std::string key = LevelDbTargetGlobalKey::Key(); - std::string value; - Status status = db->Get(StandardReadOptions(), key, &value); - if (status.IsNotFound()) { - return nil; - } else if (!status.ok()) { - HARD_FAIL("metadataForKey: failed loading key %s with status: %s", key, - status.ToString()); - } - - NSData* data = [[NSData alloc] initWithBytesNoCopy:(void*)value.data() - length:value.size() - freeWhenDone:NO]; - - NSError* error; - FSTPBTargetGlobal* proto = [FSTPBTargetGlobal parseFromData:data - error:&error]; - if (!proto) { - HARD_FAIL("FSTPBTargetGlobal failed to parse: %s", error); - } - - return proto; -} - -LevelDbQueryCache::LevelDbQueryCache(LevelDbPersistence* db, - FSTLocalSerializer* serializer) - : db_(db), serializer_(serializer) { -} - -void LevelDbQueryCache::Start() { - // TODO(gsoltis): switch this usage of ptr to current_transaction() - metadata_ = ReadMetadata(db_->ptr()); - HARD_ASSERT(metadata_ != nil, - "Found nil metadata, expected schema to be at version 0 which " - "ensures metadata existence"); - last_remote_snapshot_version_ = - [serializer_ decodedVersion:metadata_.lastRemoteSnapshotVersion]; -} - -void LevelDbQueryCache::AddTarget(const QueryData& query_data) { - Save(query_data); - - const std::string& canonical_id = query_data.query().CanonicalId(); - std::string index_key = - LevelDbQueryTargetKey::Key(canonical_id, query_data.target_id()); - std::string empty_buffer; - db_->current_transaction()->Put(index_key, empty_buffer); - - metadata_.targetCount++; - UpdateMetadata(query_data); - SaveMetadata(); -} - -void LevelDbQueryCache::UpdateTarget(const QueryData& query_data) { - Save(query_data); - - if (UpdateMetadata(query_data)) { - SaveMetadata(); - } -} - -void LevelDbQueryCache::RemoveTarget(const QueryData& query_data) { - TargetId target_id = query_data.target_id(); - - RemoveAllKeysForTarget(target_id); - - std::string key = LevelDbTargetKey::Key(target_id); - db_->current_transaction()->Delete(key); - - std::string index_key = - LevelDbQueryTargetKey::Key(query_data.query().CanonicalId(), target_id); - db_->current_transaction()->Delete(index_key); - - metadata_.targetCount--; - SaveMetadata(); -} - -absl::optional LevelDbQueryCache::GetTarget(const Query& query) { - // Scan the query-target index starting with a prefix starting with the given - // query's canonical_id. Note that this is a scan rather than a get because - // canonical_ids are not required to be unique per target. - const std::string& canonical_id = query.CanonicalId(); - auto index_iterator = db_->current_transaction()->NewIterator(); - std::string index_prefix = LevelDbQueryTargetKey::KeyPrefix(canonical_id); - index_iterator->Seek(index_prefix); - - // Simultaneously scan the targets table. This works because each - // (canonical_id, target_id) pair is unique and ordered, so when scanning a - // table prefixed by exactly one canonical_id, all the target_ids will be - // unique and in order. - std::string target_prefix = LevelDbTargetKey::KeyPrefix(); - auto target_iterator = db_->current_transaction()->NewIterator(); - - LevelDbQueryTargetKey row_key; - for (; index_iterator->Valid(); index_iterator->Next()) { - // Only consider rows matching exactly the specific canonical_id of - // interest. - if (!absl::StartsWith(index_iterator->key(), index_prefix) || - !row_key.Decode(index_iterator->key()) || - canonical_id != row_key.canonical_id()) { - // End of this canonical_id's possible targets. - break; - } - - // Each row is a unique combination of canonical_id and target_id, so this - // foreign key reference can only occur once. - std::string target_key = LevelDbTargetKey::Key(row_key.target_id()); - target_iterator->Seek(target_key); - if (!target_iterator->Valid() || target_iterator->key() != target_key) { - HARD_FAIL("Dangling query-target reference found: " - "%s points to %s; seeking there found %s", - DescribeKey(index_iterator), DescribeKey(target_key), - DescribeKey(target_iterator)); - } - - // Finally after finding a potential match, check that the query is actually - // equal to the requested query. - QueryData target = DecodeTarget(target_iterator->value()); - if (target.query() == query) { - return target; - } - } - - return absl::nullopt; -} - -void LevelDbQueryCache::EnumerateTargets(const TargetCallback& callback) { - // Enumerate all targets, give their sequence numbers. - std::string target_prefix = LevelDbTargetKey::KeyPrefix(); - auto it = db_->current_transaction()->NewIterator(); - it->Seek(target_prefix); - for (; it->Valid() && absl::StartsWith(it->key(), target_prefix); - it->Next()) { - QueryData target = DecodeTarget(it->value()); - callback(target); - } -} - -int LevelDbQueryCache::RemoveTargets( - ListenSequenceNumber upper_bound, - const std::unordered_map& live_targets) { - int count = 0; - std::string target_prefix = LevelDbTargetKey::KeyPrefix(); - auto it = db_->current_transaction()->NewIterator(); - it->Seek(target_prefix); - for (; it->Valid() && absl::StartsWith(it->key(), target_prefix); - it->Next()) { - QueryData query_data = DecodeTarget(it->value()); - if (query_data.sequence_number() <= upper_bound && - live_targets.find(query_data.target_id()) == live_targets.end()) { - RemoveTarget(query_data); - count++; - } - } - return count; -} - -void LevelDbQueryCache::AddMatchingKeys(const DocumentKeySet& keys, - TargetId target_id) { - // Store an empty value in the index which is equivalent to serializing a - // GPBEmpty message. In the future if we wanted to store some other kind of - // value here, we can parse these empty values as with some other protocol - // buffer (and the parser will see all default values). - std::string empty_buffer; - - for (const DocumentKey& key : keys) { - db_->current_transaction()->Put( - LevelDbTargetDocumentKey::Key(target_id, key), empty_buffer); - db_->current_transaction()->Put( - LevelDbDocumentTargetKey::Key(key, target_id), empty_buffer); - db_->reference_delegate()->AddReference(key); - }; -} - -void LevelDbQueryCache::RemoveMatchingKeys(const DocumentKeySet& keys, - TargetId target_id) { - for (const DocumentKey& key : keys) { - db_->current_transaction()->Delete( - LevelDbTargetDocumentKey::Key(target_id, key)); - db_->current_transaction()->Delete( - LevelDbDocumentTargetKey::Key(key, target_id)); - db_->reference_delegate()->RemoveReference(key); - } -} - -void LevelDbQueryCache::RemoveAllKeysForTarget(TargetId target_id) { - std::string index_prefix = LevelDbTargetDocumentKey::KeyPrefix(target_id); - auto index_iterator = db_->current_transaction()->NewIterator(); - index_iterator->Seek(index_prefix); - - LevelDbTargetDocumentKey row_key; - for (; index_iterator->Valid(); index_iterator->Next()) { - absl::string_view index_key = index_iterator->key(); - - // Only consider rows matching this specific target_id. - if (!row_key.Decode(index_key) || row_key.target_id() != target_id) { - break; - } - const DocumentKey& document_key = row_key.document_key(); - - // Delete both index rows - db_->current_transaction()->Delete(index_key); - db_->current_transaction()->Delete( - LevelDbDocumentTargetKey::Key(document_key, target_id)); - } -} - -DocumentKeySet LevelDbQueryCache::GetMatchingKeys(TargetId target_id) { - std::string index_prefix = LevelDbTargetDocumentKey::KeyPrefix(target_id); - auto index_iterator = db_->current_transaction()->NewIterator(); - index_iterator->Seek(index_prefix); - - DocumentKeySet result; - LevelDbTargetDocumentKey row_key; - for (; index_iterator->Valid(); index_iterator->Next()) { - // TODO(gsoltis): could we use a StartsWith instead? - // Only consider rows matching this specific target_id. - if (!row_key.Decode(index_iterator->key()) || - row_key.target_id() != target_id) { - break; - } - - result = result.insert(row_key.document_key()); - } - - return result; -} - -bool LevelDbQueryCache::Contains(const DocumentKey& key) { - // ignore sentinel rows when determining if a key belongs to a target. - // Sentinel row just says the document exists, not that it's a member of any - // particular target. - std::string index_prefix = LevelDbDocumentTargetKey::KeyPrefix(key.path()); - auto index_iterator = db_->current_transaction()->NewIterator(); - index_iterator->Seek(index_prefix); - - for (; index_iterator->Valid() && - absl::StartsWith(index_iterator->key(), index_prefix); - index_iterator->Next()) { - LevelDbDocumentTargetKey row_key; - if (row_key.Decode(index_iterator->key()) && !row_key.IsSentinel() && - row_key.document_key() == key) { - return true; - } - } - - return false; -} - -const SnapshotVersion& LevelDbQueryCache::GetLastRemoteSnapshotVersion() const { - return last_remote_snapshot_version_; -} - -void LevelDbQueryCache::SetLastRemoteSnapshotVersion(SnapshotVersion version) { - last_remote_snapshot_version_ = std::move(version); - metadata_.lastRemoteSnapshotVersion = - [serializer_ encodedVersion:last_remote_snapshot_version_]; - SaveMetadata(); -} - -void LevelDbQueryCache::EnumerateOrphanedDocuments( - const OrphanedDocumentCallback& callback) { - std::string document_target_prefix = LevelDbDocumentTargetKey::KeyPrefix(); - auto it = db_->current_transaction()->NewIterator(); - it->Seek(document_target_prefix); - ListenSequenceNumber next_to_report = 0; - DocumentKey key_to_report; - LevelDbDocumentTargetKey key; - - for (; it->Valid() && absl::StartsWith(it->key(), document_target_prefix); - it->Next()) { - HARD_ASSERT(key.Decode(it->key()), "Failed to decode DocumentTarget key"); - if (key.IsSentinel()) { - // if next_to_report is non-zero, report it, this is a new key so the last - // one must be not be a member of any targets. - if (next_to_report != 0) { - callback(key_to_report, next_to_report); - } - // set next_to_report to be this sequence number. It's the next one we - // might report, if we don't find any targets for this document. - next_to_report = - LevelDbDocumentTargetKey::DecodeSentinelValue(it->value()); - key_to_report = key.document_key(); - } else { - // set next_to_report to be 0, we know we don't need to report this one - // since we found a target for it. - next_to_report = 0; - } - } - // if next_to_report is non-zero, report it. We didn't find any targets for - // that document, and we weren't asked to stop. - if (next_to_report != 0) { - callback(key_to_report, next_to_report); - } -} - -void LevelDbQueryCache::Save(const QueryData& query_data) { - TargetId target_id = query_data.target_id(); - std::string key = LevelDbTargetKey::Key(target_id); - db_->current_transaction()->Put(key, - [serializer_ encodedQueryData:query_data]); -} - -bool LevelDbQueryCache::UpdateMetadata(const QueryData& query_data) { - bool updated = false; - if (query_data.target_id() > metadata_.highestTargetId) { - metadata_.highestTargetId = query_data.target_id(); - updated = true; - } - - if (query_data.sequence_number() > metadata_.highestListenSequenceNumber) { - metadata_.highestListenSequenceNumber = query_data.sequence_number(); - updated = true; - } - - return updated; -} - -void LevelDbQueryCache::SaveMetadata() { - db_->current_transaction()->Put(LevelDbTargetGlobalKey::Key(), metadata_); -} - -QueryData LevelDbQueryCache::DecodeTarget(absl::string_view encoded) { - NSData* data = [[NSData alloc] initWithBytesNoCopy:(void*)encoded.data() - length:encoded.size() - freeWhenDone:NO]; - - NSError* error; - FSTPBTarget* proto = [FSTPBTarget parseFromData:data error:&error]; - if (!proto) { - HARD_FAIL("FSTPBTarget failed to parse: %s", error); - } - - return [serializer_ decodedQueryData:proto]; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.h deleted file mode 100644 index 1a703e761..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_REMOTE_DOCUMENT_CACHE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_REMOTE_DOCUMENT_CACHE_H_ - -#if !defined(__OBJC__) -#error "For now, this file must only be included by ObjC source files." -#endif // !defined(__OBJC__) - -#include - -#include "Firestore/core/src/firebase/firestore/local/remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "absl/strings/string_view.h" - -@class FSTLocalSerializer; - -NS_ASSUME_NONNULL_BEGIN - -namespace firebase { -namespace firestore { -namespace local { - -class LevelDbPersistence; - -/** Cached Remote Documents backed by leveldb. */ -class LevelDbRemoteDocumentCache : public RemoteDocumentCache { - public: - LevelDbRemoteDocumentCache(LevelDbPersistence* db, - FSTLocalSerializer* serializer); - - void Add(const model::MaybeDocument& document) override; - void Remove(const model::DocumentKey& key) override; - - absl::optional Get( - const model::DocumentKey& key) override; - model::OptionalMaybeDocumentMap GetAll( - const model::DocumentKeySet& keys) override; - model::DocumentMap GetMatching(const core::Query& query) override; - - private: - model::MaybeDocument DecodeMaybeDocument(absl::string_view encoded, - const model::DocumentKey& key); - - // The LevelDbRemoteDocumentCache instance is owned by LevelDbPersistence. - LevelDbPersistence* db_; - FSTLocalSerializer* serializer_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -NS_ASSUME_NONNULL_END - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_REMOTE_DOCUMENT_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.mm deleted file mode 100644 index 5d1b63a73..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.mm +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_remote_document_cache.h" - -#import - -#include - -#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" -#import "Firestore/Source/Local/FSTLocalSerializer.h" - -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_persistence.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "leveldb/db.h" - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::Document; -using model::DocumentKey; -using model::DocumentKeySet; -using model::DocumentMap; -using model::MaybeDocument; -using model::MaybeDocumentMap; -using model::OptionalMaybeDocumentMap; -using leveldb::Status; - -LevelDbRemoteDocumentCache::LevelDbRemoteDocumentCache( - LevelDbPersistence* db, FSTLocalSerializer* serializer) - : db_(db), serializer_(serializer) { -} - -void LevelDbRemoteDocumentCache::Add(const MaybeDocument& document) { - std::string ldb_key = LevelDbRemoteDocumentKey::Key(document.key()); - db_->current_transaction()->Put(ldb_key, - [serializer_ encodedMaybeDocument:document]); - - db_->index_manager()->AddToCollectionParentIndex( - document.key().path().PopLast()); -} - -void LevelDbRemoteDocumentCache::Remove(const DocumentKey& key) { - std::string ldb_key = LevelDbRemoteDocumentKey::Key(key); - db_->current_transaction()->Delete(ldb_key); -} - -absl::optional LevelDbRemoteDocumentCache::Get( - const DocumentKey& key) { - std::string ldb_key = LevelDbRemoteDocumentKey::Key(key); - std::string value; - Status status = db_->current_transaction()->Get(ldb_key, &value); - if (status.IsNotFound()) { - return absl::nullopt; - } else if (status.ok()) { - return DecodeMaybeDocument(value, key); - } else { - HARD_FAIL("Fetch document for key (%s) failed with status: %s", - key.ToString(), status.ToString()); - } -} - -OptionalMaybeDocumentMap LevelDbRemoteDocumentCache::GetAll( - const DocumentKeySet& keys) { - OptionalMaybeDocumentMap results; - - LevelDbRemoteDocumentKey current_key; - auto it = db_->current_transaction()->NewIterator(); - - for (const DocumentKey& key : keys) { - it->Seek(LevelDbRemoteDocumentKey::Key(key)); - if (!it->Valid() || !current_key.Decode(it->key()) || - current_key.document_key() != key) { - results = results.insert(key, absl::nullopt); - } else { - results = results.insert(key, DecodeMaybeDocument(it->value(), key)); - } - } - - return results; -} - -DocumentMap LevelDbRemoteDocumentCache::GetMatching(const Query& query) { - HARD_ASSERT( - !query.IsCollectionGroupQuery(), - "CollectionGroup queries should be handled in LocalDocumentsView"); - - DocumentMap results; - - // Use the query path as a prefix for testing if a document matches the query. - const model::ResourcePath& query_path = query.path(); - size_t immediate_children_path_length = query_path.size() + 1; - - // Documents are ordered by key, so we can use a prefix scan to narrow down - // the documents we need to match the query against. - std::string start_key = LevelDbRemoteDocumentKey::KeyPrefix(query_path); - auto it = db_->current_transaction()->NewIterator(); - it->Seek(start_key); - - LevelDbRemoteDocumentKey current_key; - for (; it->Valid() && current_key.Decode(it->key()); it->Next()) { - // The query is actually returning any path that starts with the query path - // prefix which may include documents in subcollections. For example, a - // query on 'rooms' will return rooms/abc/messages/xyx but we shouldn't - // match it. Fix this by discarding rows with document keys more than one - // segment longer than the query path. - const DocumentKey& document_key = current_key.document_key(); - if (document_key.path().size() != immediate_children_path_length) { - continue; - } - - MaybeDocument maybe_doc = DecodeMaybeDocument(it->value(), document_key); - if (!query_path.IsPrefixOf(maybe_doc.key().path())) { - break; - } else if (maybe_doc.is_document()) { - results = results.insert(maybe_doc.key(), Document(maybe_doc)); - } - } - - return results; -} - -MaybeDocument LevelDbRemoteDocumentCache::DecodeMaybeDocument( - absl::string_view encoded, const DocumentKey& key) { - NSData* data = [[NSData alloc] initWithBytesNoCopy:(void*)encoded.data() - length:encoded.size() - freeWhenDone:false]; - - NSError* error; - FSTPBMaybeDocument* proto = [FSTPBMaybeDocument parseFromData:data - error:&error]; - if (!proto) { - HARD_FAIL("FSTPBMaybeDocument failed to parse: %s", error); - } - - MaybeDocument maybe_document = [serializer_ decodedMaybeDocument:proto]; - HARD_ASSERT(maybe_document.key() == key, - "Read document has key (%s) instead of expected key (%s).", - maybe_document.key().ToString(), key.ToString()); - return maybe_document; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_util.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_util.cc deleted file mode 100644 index cad14b2c4..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_util.cc +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/leveldb_util.h" - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "absl/strings/str_cat.h" - -namespace firebase { -namespace firestore { -namespace local { - -namespace { - -Error ConvertStatusCode(const leveldb::Status& status) { - if (status.ok()) return Error::Ok; - if (status.IsNotFound()) return Error::NotFound; - if (status.IsCorruption()) return Error::DataLoss; - if (status.IsIOError()) return Error::Unavailable; - if (status.IsNotSupportedError()) return Error::Unimplemented; - if (status.IsInvalidArgument()) return Error::InvalidArgument; - return Error::Unknown; -} - -} // namespace - -util::Status ConvertStatus(const leveldb::Status& status) { - if (status.ok()) return util::Status::OK(); - - Error code = ConvertStatusCode(status); - return util::Status{code, absl::StrCat("LevelDB error: ", status.ToString())}; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_documents_view.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_documents_view.h deleted file mode 100644 index d4013dae3..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_documents_view.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/index_manager.h" -#include "Firestore/core/src/firebase/firestore/local/mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" - -namespace firebase { -namespace firestore { -namespace local { - -/** - * A readonly view of the local state of all documents we're tracking (i.e. we - * have a cached version in remoteDocumentCache or local mutations for the - * document). The view is computed by applying the mutations in the - * MutationQueue to the RemoteDocumentCache. - */ -class LocalDocumentsView { - public: - LocalDocumentsView(RemoteDocumentCache* remote_document_cache, - MutationQueue* mutation_queue, - IndexManager* index_manager) - : remote_document_cache_{remote_document_cache}, - mutation_queue_{mutation_queue}, - index_manager_{index_manager} { - } - - /** - * Gets the local view of the document identified by `key`. - * - * @return Local view of the document or nil if we don't have any cached state - * for it. - */ - absl::optional GetDocument( - const model::DocumentKey& key); - - /** - * Gets the local view of the documents identified by `keys`. - * - * If we don't have cached state for a document in `keys`, a DeletedDocument - * will be stored for that key in the resulting set. - */ - model::MaybeDocumentMap GetDocuments(const model::DocumentKeySet& keys); - - /** - * Similar to `documentsForKeys`, but creates the local view from the given - * `baseDocs` without retrieving documents from the local store. - */ - model::MaybeDocumentMap GetLocalViewOfDocuments( - const model::OptionalMaybeDocumentMap& base_docs); - - /** Performs a query against the local view of all documents. */ - model::DocumentMap GetDocumentsMatchingQuery(const core::Query& query); - - private: - /** Internal version of GetDocument that allows re-using batches. */ - absl::optional GetDocument( - const model::DocumentKey& key, - const std::vector& batches); - - /** - * Returns the view of the given `docs` as they would appear after applying - * all mutations in the given `batches`. - */ - model::OptionalMaybeDocumentMap ApplyLocalMutationsToDocuments( - const model::OptionalMaybeDocumentMap& docs, - const std::vector& batches); - - /** Performs a simple document lookup for the given path. */ - model::DocumentMap GetDocumentsMatchingDocumentQuery( - const model::ResourcePath& doc_path); - - model::DocumentMap GetDocumentsMatchingCollectionGroupQuery( - const core::Query& query); - - /** Queries the remote documents and overlays mutations. */ - model::DocumentMap GetDocumentsMatchingCollectionQuery( - const core::Query& query); - - /** - * It is possible that a `PatchMutation` can make a document match a query, - * even if the version in the `RemoteDocumentCache` is not a match yet - * (waiting for server to ack). To handle this, we find all document keys - * affected by the `PatchMutation`s that are not in `existingDocs` yet, and - * back fill them via `remote_document_cache_->GetAll`, otherwise those - * `PatchMutation`s will be ignored because no base document can be found, and - * lead to missing results for the query. - */ - model::DocumentMap AddMissingBaseDocuments( - const std::vector& matching_batches, - model::DocumentMap existing_docs); - - RemoteDocumentCache* remote_document_cache_; - MutationQueue* mutation_queue_; - IndexManager* index_manager_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_documents_view.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_documents_view.mm deleted file mode 100644 index 40645309e..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_documents_view.mm +++ /dev/null @@ -1,245 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "Firestore/core/src/firebase/firestore/local/local_documents_view.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/local/mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::Document; -using model::DocumentKey; -using model::DocumentKeySet; -using model::DocumentMap; -using model::MaybeDocument; -using model::MaybeDocumentMap; -using model::Mutation; -using model::MutationBatch; -using model::NoDocument; -using model::OptionalMaybeDocumentMap; -using model::ResourcePath; -using model::SnapshotVersion; -using util::MakeString; - -absl::optional LocalDocumentsView::GetDocument( - const DocumentKey& key) { - std::vector batches = - mutation_queue_->AllMutationBatchesAffectingDocumentKey(key); - return GetDocument(key, batches); -} - -absl::optional LocalDocumentsView::GetDocument( - const DocumentKey& key, const std::vector& batches) { - absl::optional document = remote_document_cache_->Get(key); - for (const MutationBatch& batch : batches) { - document = batch.ApplyToLocalDocument(document, key); - } - - return document; -} - -OptionalMaybeDocumentMap LocalDocumentsView::ApplyLocalMutationsToDocuments( - const OptionalMaybeDocumentMap& docs, - const std::vector& batches) { - OptionalMaybeDocumentMap results; - - for (const auto& kv : docs) { - const DocumentKey& key = kv.first; - absl::optional local_view = kv.second; - for (const MutationBatch& batch : batches) { - local_view = batch.ApplyToLocalDocument(local_view, key); - } - results = results.insert(key, local_view); - } - return results; -} - -MaybeDocumentMap LocalDocumentsView::GetDocuments(const DocumentKeySet& keys) { - OptionalMaybeDocumentMap docs = remote_document_cache_->GetAll(keys); - return GetLocalViewOfDocuments(docs); -} - -/** - * Similar to `documentsForKeys`, but creates the local view from the given - * `baseDocs` without retrieving documents from the local store. - */ -MaybeDocumentMap LocalDocumentsView::GetLocalViewOfDocuments( - const OptionalMaybeDocumentMap& base_docs) { - DocumentKeySet all_keys; - for (const auto& kv : base_docs) { - all_keys = all_keys.insert(kv.first); - } - std::vector batches = - mutation_queue_->AllMutationBatchesAffectingDocumentKeys(all_keys); - - OptionalMaybeDocumentMap docs = - ApplyLocalMutationsToDocuments(base_docs, batches); - - MaybeDocumentMap results; - for (const auto& kv : docs) { - const DocumentKey& key = kv.first; - absl::optional maybe_doc = kv.second; - - // TODO(http://b/32275378): Don't conflate missing / deleted. - if (!maybe_doc) { - maybe_doc = NoDocument(key, SnapshotVersion::None(), - /* has_committed_mutations= */ false); - } - results = results.insert(key, *maybe_doc); - } - - return results; -} - -DocumentMap LocalDocumentsView::GetDocumentsMatchingQuery(const Query& query) { - if (query.IsDocumentQuery()) { - return GetDocumentsMatchingDocumentQuery(query.path()); - } else if (query.IsCollectionGroupQuery()) { - return GetDocumentsMatchingCollectionGroupQuery(query); - } else { - return GetDocumentsMatchingCollectionQuery(query); - } -} - -DocumentMap LocalDocumentsView::GetDocumentsMatchingDocumentQuery( - const ResourcePath& doc_path) { - DocumentMap result; - // Just do a simple document lookup. - absl::optional doc = GetDocument(DocumentKey{doc_path}); - if (doc && doc->is_document()) { - result = result.insert(doc->key(), Document(*doc)); - } - return result; -} - -model::DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionGroupQuery( - const Query& query) { - HARD_ASSERT( - query.path().empty(), - "Currently we only support collection group queries at the root."); - - const std::string& collection_id = *query.collection_group(); - std::vector parents = - index_manager_->GetCollectionParents(collection_id); - DocumentMap results; - - // Perform a collection query against each parent that contains the - // collection_id and aggregate the results. - for (const ResourcePath& parent : parents) { - Query collection_query = - query.AsCollectionQueryAtPath(parent.Append(collection_id)); - DocumentMap collection_results = - GetDocumentsMatchingCollectionQuery(collection_query); - for (const auto& kv : collection_results.underlying_map()) { - const DocumentKey& key = kv.first; - results = results.insert(key, Document(kv.second)); - } - } - return results; -} - -DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionQuery( - const Query& query) { - DocumentMap results = remote_document_cache_->GetMatching(query); - // Get locally persisted mutation batches. - std::vector matching_batches = - mutation_queue_->AllMutationBatchesAffectingQuery(query); - - results = AddMissingBaseDocuments(matching_batches, std::move(results)); - - for (const MutationBatch& batch : matching_batches) { - for (const Mutation& mutation : batch.mutations()) { - // Only process documents belonging to the collection. - if (!query.path().IsImmediateParentOf(mutation.key().path())) { - continue; - } - - const DocumentKey& key = mutation.key(); - // base_doc may be unset for the documents that weren't yet written to - // the backend. - absl::optional base_doc = - results.underlying_map().get(key); - - absl::optional mutated_doc = mutation.ApplyToLocalView( - base_doc, base_doc, batch.local_write_time()); - - if (mutated_doc && mutated_doc->is_document()) { - results = results.insert(key, Document(*mutated_doc)); - } else { - results = results.erase(key); - } - } - } - - // Finally, filter out any documents that don't actually match the query. Note - // that the extra reference here prevents DocumentMap's destructor from - // deallocating the initial unfiltered results while we're iterating over - // them. - DocumentMap unfiltered = results; - for (const auto& kv : unfiltered.underlying_map()) { - const DocumentKey& key = kv.first; - Document doc(kv.second); - if (!query.Matches(doc)) { - results = results.erase(key); - } - } - - return results; -} - -DocumentMap LocalDocumentsView::AddMissingBaseDocuments( - const std::vector& matching_batches, - DocumentMap existing_docs) { - DocumentKeySet missing_doc_keys; - for (const MutationBatch& batch : matching_batches) { - for (const Mutation& mutation : batch.mutations()) { - const DocumentKey& key = mutation.key(); - if (mutation.type() == Mutation::Type::Patch && - !existing_docs.underlying_map().contains(key)) { - missing_doc_keys = missing_doc_keys.insert(key); - } - } - } - - OptionalMaybeDocumentMap missing_docs = - remote_document_cache_->GetAll(missing_doc_keys); - for (const auto& kv : missing_docs) { - const absl::optional& maybe_doc = kv.second; - if (maybe_doc && maybe_doc->is_document()) { - existing_docs = existing_docs.insert(kv.first, Document(*maybe_doc)); - } - } - - return existing_docs; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_serializer.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_serializer.cc deleted file mode 100644 index af370ea03..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_serializer.cc +++ /dev/null @@ -1,308 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/local_serializer.h" - -#include -#include -#include -#include - -#include "Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h" -#include "Firestore/Protos/nanopb/firestore/local/target.nanopb.h" -#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" - -namespace firebase { -namespace firestore { -namespace local { - -namespace { - -using core::Query; -using model::Document; -using model::MaybeDocument; -using model::Mutation; -using model::MutationBatch; -using model::NoDocument; -using model::SnapshotVersion; -using model::UnknownDocument; -using nanopb::ByteString; -using nanopb::CheckedSize; -using nanopb::Reader; -using nanopb::Writer; -using remote::InvalidQuery; -using remote::MakeArray; -using util::Status; -using util::StringFormat; - -} // namespace - -firestore_client_MaybeDocument LocalSerializer::EncodeMaybeDocument( - const MaybeDocument& maybe_doc) const { - firestore_client_MaybeDocument result{}; - - switch (maybe_doc.type()) { - case MaybeDocument::Type::Document: - result.which_document_type = firestore_client_MaybeDocument_document_tag; - result.document = EncodeDocument(static_cast(maybe_doc)); - // TODO(rsgowman): heldwriteacks: - // result.has_committed_mutations = existing_doc.HasCommittedMutations(); - return result; - - case MaybeDocument::Type::NoDocument: - result.which_document_type = - firestore_client_MaybeDocument_no_document_tag; - result.no_document = - EncodeNoDocument(static_cast(maybe_doc)); - // TODO(rsgowman): heldwriteacks: - // result.has_committed_mutations = no_doc.HasCommittedMutations(); - return result; - - case MaybeDocument::Type::UnknownDocument: - result.which_document_type = - firestore_client_MaybeDocument_unknown_document_tag; - result.unknown_document = - EncodeUnknownDocument(static_cast(maybe_doc)); - // TODO(rsgowman): heldwriteacks: - // result.has_committed_mutations = true; - return result; - - case MaybeDocument::Type::Invalid: - // TODO(rsgowman): Error handling - abort(); - } - - UNREACHABLE(); -} - -MaybeDocument LocalSerializer::DecodeMaybeDocument( - Reader* reader, const firestore_client_MaybeDocument& proto) const { - if (!reader->status().ok()) return {}; - - switch (proto.which_document_type) { - case firestore_client_MaybeDocument_document_tag: - return rpc_serializer_.DecodeDocument(reader, proto.document); - - case firestore_client_MaybeDocument_no_document_tag: - return DecodeNoDocument(reader, proto.no_document); - - case firestore_client_MaybeDocument_unknown_document_tag: - return DecodeUnknownDocument(reader, proto.unknown_document); - - default: - reader->Fail( - StringFormat("Invalid MaybeDocument document type: %s. Expected " - "'no_document' (%s) or 'document' (%s)", - proto.which_document_type, - firestore_client_MaybeDocument_no_document_tag, - firestore_client_MaybeDocument_document_tag)); - return {}; - } - - UNREACHABLE(); -} - -google_firestore_v1_Document LocalSerializer::EncodeDocument( - const Document& doc) const { - google_firestore_v1_Document result{}; - - result.name = rpc_serializer_.EncodeKey(doc.key()); - - // Encode Document.fields (unless it's empty) - pb_size_t count = CheckedSize(doc.data().GetInternalValue().size()); - result.fields_count = count; - result.fields = MakeArray(count); - int i = 0; - for (const auto& kv : doc.data().GetInternalValue()) { - result.fields[i].key = rpc_serializer_.EncodeString(kv.first); - result.fields[i].value = rpc_serializer_.EncodeFieldValue(kv.second); - i++; - } - - result.has_update_time = true; - result.update_time = rpc_serializer_.EncodeVersion(doc.version()); - // Ignore Document.create_time. (We don't use this in our on-disk protos.) - - return result; -} - -firestore_client_NoDocument LocalSerializer::EncodeNoDocument( - const NoDocument& no_doc) const { - firestore_client_NoDocument result{}; - - result.name = rpc_serializer_.EncodeKey(no_doc.key()); - result.read_time = rpc_serializer_.EncodeVersion(no_doc.version()); - - return result; -} - -NoDocument LocalSerializer::DecodeNoDocument( - Reader* reader, const firestore_client_NoDocument& proto) const { - SnapshotVersion version = - rpc_serializer_.DecodeVersion(reader, proto.read_time); - - // TODO(rsgowman): Fix hardcoding of has_committed_mutations. - // Instead, we should grab this from the proto (see other ports). However, - // we'll defer until the nanopb-master gets merged to master. - return NoDocument(rpc_serializer_.DecodeKey(reader, proto.name), version, - /*has_committed_mutations=*/false); -} - -firestore_client_UnknownDocument LocalSerializer::EncodeUnknownDocument( - const UnknownDocument& unknown_doc) const { - firestore_client_UnknownDocument result{}; - - result.name = rpc_serializer_.EncodeKey(unknown_doc.key()); - result.version = rpc_serializer_.EncodeVersion(unknown_doc.version()); - - return result; -} - -UnknownDocument LocalSerializer::DecodeUnknownDocument( - Reader* reader, const firestore_client_UnknownDocument& proto) const { - SnapshotVersion version = - rpc_serializer_.DecodeVersion(reader, proto.version); - - return UnknownDocument(rpc_serializer_.DecodeKey(reader, proto.name), - version); -} - -firestore_client_Target LocalSerializer::EncodeQueryData( - const QueryData& query_data) const { - firestore_client_Target result{}; - - result.target_id = query_data.target_id(); - result.last_listen_sequence_number = query_data.sequence_number(); - result.snapshot_version = rpc_serializer_.EncodeTimestamp( - query_data.snapshot_version().timestamp()); - - // Force a copy because pb_release would otherwise double-free. - result.resume_token = nanopb::CopyBytesArray(query_data.resume_token().get()); - - const Query& query = query_data.query(); - if (query.IsDocumentQuery()) { - // TODO(rsgowman): Implement. Probably like this (once EncodeDocumentsTarget - // exists): - /* - result.which_target_type = firestore_client_Target_document_tag; - result.documents = rpc_serializer_.EncodeDocumentsTarget(query); - */ - abort(); - } else { - result.which_target_type = firestore_client_Target_query_tag; - result.query = rpc_serializer_.EncodeQueryTarget(query); - } - - return result; -} - -QueryData LocalSerializer::DecodeQueryData( - Reader* reader, const firestore_client_Target& proto) const { - if (!reader->status().ok()) return QueryData::Invalid(); - - model::TargetId target_id = proto.target_id; - // TODO(rgowman): How to handle truncation of integer types? - model::ListenSequenceNumber sequence_number = - static_cast( - proto.last_listen_sequence_number); - SnapshotVersion version = - rpc_serializer_.DecodeVersion(reader, proto.snapshot_version); - ByteString resume_token(proto.resume_token); - Query query = InvalidQuery(); - - switch (proto.which_target_type) { - case firestore_client_Target_query_tag: - query = rpc_serializer_.DecodeQueryTarget(reader, proto.query); - break; - - case firestore_client_Target_documents_tag: - // TODO(rsgowman): Implement. - abort(); - - default: - reader->Fail( - StringFormat("Unknown target_type: %s", proto.which_target_type)); - } - - if (!reader->status().ok()) return QueryData::Invalid(); - return QueryData(std::move(query), target_id, sequence_number, - QueryPurpose::Listen, version, std::move(resume_token)); -} - -firestore_client_WriteBatch LocalSerializer::EncodeMutationBatch( - const MutationBatch& mutation_batch) const { - firestore_client_WriteBatch result{}; - - result.batch_id = mutation_batch.batch_id(); - - pb_size_t count = CheckedSize(mutation_batch.base_mutations().size()); - result.base_writes_count = count; - result.base_writes = MakeArray(count); - int i = 0; - for (const auto& mutation : mutation_batch.base_mutations()) { - result.base_writes[i] = rpc_serializer_.EncodeMutation(mutation); - i++; - } - - count = CheckedSize(mutation_batch.mutations().size()); - result.writes_count = count; - result.writes = MakeArray(count); - i = 0; - for (const auto& mutation : mutation_batch.mutations()) { - result.writes[i] = rpc_serializer_.EncodeMutation(mutation); - i++; - } - - result.local_write_time = - rpc_serializer_.EncodeTimestamp(mutation_batch.local_write_time()); - - return result; -} - -MutationBatch LocalSerializer::DecodeMutationBatch( - nanopb::Reader* reader, const firestore_client_WriteBatch& proto) const { - int batch_id = proto.batch_id; - Timestamp local_write_time = - rpc_serializer_.DecodeTimestamp(reader, proto.local_write_time); - - std::vector base_mutations; - for (size_t i = 0; i < proto.base_writes_count; i++) { - base_mutations.push_back( - rpc_serializer_.DecodeMutation(reader, proto.base_writes[i])); - } - - std::vector mutations; - for (size_t i = 0; i < proto.writes_count; i++) { - mutations.push_back( - rpc_serializer_.DecodeMutation(reader, proto.writes[i])); - } - - return MutationBatch(batch_id, local_write_time, std::move(base_mutations), - std::move(mutations)); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_serializer.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_serializer.h deleted file mode 100644 index e32d1e39d..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_serializer.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_SERIALIZER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_SERIALIZER_H_ - -#include -#include - -#include "Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h" -#include "Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h" -#include "Firestore/Protos/nanopb/firestore/local/target.nanopb.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" -#include "Firestore/core/src/firebase/firestore/nanopb/reader.h" -#include "Firestore/core/src/firebase/firestore/nanopb/writer.h" -#include "Firestore/core/src/firebase/firestore/remote/serializer.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" - -namespace firebase { -namespace firestore { -namespace local { - -/** - * @brief Serializer for values stored in the LocalStore. - * - * All errors that occur during serialization are fatal. - * - * All deserialization methods (that can fail) take a nanopb::Reader parameter - * whose status will be set to failed upon an error. Callers must check this - * before using the returned value via `reader->status()`. A deserialization - * method might fail if a protocol buffer is missing a critical field or has a - * value we can't interpret. On error, the return value from a deserialization - * method is unspecified. - * - * Note that local::LocalSerializer currently delegates to the - * remote::Serializer (for the Firestore v1 RPC protocol) to save implementation - * time and code duplication. We'll need to revisit this when the RPC protocol - * we use diverges from local storage. - */ -class LocalSerializer { - public: - explicit LocalSerializer(const remote::Serializer& rpc_serializer) - : rpc_serializer_(rpc_serializer) { - } - - /** - * Release memory allocated by the Encode* methods that return protos. - * - * This essentially wraps calls to nanopb's pb_release() method. - */ - static void FreeNanopbMessage(const pb_field_t fields[], void* dest_struct) { - remote::Serializer::FreeNanopbMessage(fields, dest_struct); - } - - /** - * @brief Encodes a MaybeDocument model to the equivalent nanopb proto for - * local storage. - */ - firestore_client_MaybeDocument EncodeMaybeDocument( - const model::MaybeDocument& maybe_doc) const; - - /** - * @brief Decodes nanopb proto representing a MaybeDocument proto to the - * equivalent model. - */ - model::MaybeDocument DecodeMaybeDocument( - nanopb::Reader* reader, - const firestore_client_MaybeDocument& proto) const; - - /** - * @brief Encodes a QueryData to the equivalent nanopb proto, representing a - * ::firestore::proto::Target, for local storage. - */ - firestore_client_Target EncodeQueryData(const QueryData& query_data) const; - - /** - * @brief Decodes nanopb proto representing a ::firestore::proto::Target proto - * to the equivalent QueryData. - */ - QueryData DecodeQueryData(nanopb::Reader* reader, - const firestore_client_Target& proto) const; - - /** - * @brief Encodes a MutationBatch to the equivalent nanopb proto, representing - * a ::firestore::client::WriteBatch, for local storage in the mutation queue. - */ - firestore_client_WriteBatch EncodeMutationBatch( - const model::MutationBatch& mutation_batch) const; - - /** - * @brief Decodes a nanopb proto representing a - * ::firestore::client::WriteBatch proto to the equivalent MutationBatch. - */ - model::MutationBatch DecodeMutationBatch( - nanopb::Reader* reader, const firestore_client_WriteBatch& proto) const; - - private: - /** - * Encodes a Document for local storage. This differs from the v1 RPC - * serializer for Documents in that it preserves the updateTime, which is - * considered an output only value by the server. - */ - google_firestore_v1_Document EncodeDocument(const model::Document& doc) const; - - firestore_client_NoDocument EncodeNoDocument( - const model::NoDocument& no_doc) const; - - model::NoDocument DecodeNoDocument( - nanopb::Reader* reader, const firestore_client_NoDocument& proto) const; - - firestore_client_UnknownDocument EncodeUnknownDocument( - const model::UnknownDocument& unknown_doc) const; - model::UnknownDocument DecodeUnknownDocument( - nanopb::Reader* reader, - const firestore_client_UnknownDocument& proto) const; - - const remote::Serializer& rpc_serializer_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_SERIALIZER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_store.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_store.h deleted file mode 100644 index 49faadb07..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_store.h +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_STORE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_STORE_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/core/target_id_generator.h" -#include "Firestore/core/src/firebase/firestore/local/local_documents_view.h" -#include "Firestore/core/src/firebase/firestore/local/local_view_changes.h" -#include "Firestore/core/src/firebase/firestore/local/local_write_result.h" -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" -#include "Firestore/core/src/firebase/firestore/local/persistence.h" -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch_result.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_event.h" -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace local { - -/** - * Local storage in the Firestore client. Coordinates persistence components - * like the mutation queue and remote document cache to present a latency - * compensated view of stored data. - * - * The LocalStore is responsible for accepting mutations from the SyncEngine. - * Writes from the client are put into a queue as provisional Mutations until - * they are processed by the RemoteStore and confirmed as having been written to - * the server. - * - * The local store provides the local version of documents that have been - * modified locally. It maintains the constraint: - * - * LocalDocument = RemoteDocument + Active(LocalMutations) - * - * (Active mutations are those that are enqueued and have not been previously - * acknowledged or rejected). - * - * The RemoteDocument ("ground truth") state is provided via the - * ApplyChangeBatch method. It will be some version of a server-provided - * document OR will be a server-provided document PLUS acknowledged mutations: - * - * RemoteDocument' = RemoteDocument + Acknowledged(LocalMutations) - * - * Note that this "dirty" version of a RemoteDocument will not be identical to a - * server base version, since it has LocalMutations added to it pending getting - * an authoritative copy from the server. - * - * Since LocalMutations can be rejected by the server, we have to be able to - * revert a LocalMutation that has already been applied to the LocalDocument - * (typically done by replaying all remaining LocalMutations to the - * RemoteDocument to re-apply). - * - * It also maintains the persistence of mapping queries to resume tokens and - * target ids. - * - * The LocalStore must be able to efficiently execute queries against its local - * cache of the documents, to provide the initial set of results before any - * remote changes have been received. - */ -class LocalStore { - public: - LocalStore(Persistence* persistence, const auth::User& initial_user); - - /** Performs any initial startup actions required by the local store. */ - void Start(); - - /** - * Tells the LocalStore that the currently authenticated user has changed. - * - * In response the local store switches the mutation queue to the new user and - * returns any resulting document changes. - */ - model::MaybeDocumentMap HandleUserChange(const auth::User& user); - - /** Accepts locally generated Mutations and commits them to storage. */ - local::LocalWriteResult WriteLocally( - std::vector&& mutations); - - /** - * Returns the current value of a document with a given key, or `nullopt` if - * not found. - */ - absl::optional ReadDocument( - const model::DocumentKey& key); - - /** - * Acknowledges the given batch. - * - * On the happy path when a batch is acknowledged, the local store will: - * - * + remove the batch from the mutation queue; - * + apply the changes to the remote document cache; - * + recalculate the latency compensated view implied by those changes (there - * may be mutations in the queue that affect the documents but haven't been - * acknowledged yet); and - * + give the changed documents back the sync engine - * - * @return The resulting (modified) documents. - */ - model::MaybeDocumentMap AcknowledgeBatch( - const model::MutationBatchResult& batch_result); - - /** - * Removes mutations from the MutationQueue for the specified batch. - * LocalDocuments will be recalculated. - * - * @return The resulting (modified) documents. - */ - model::MaybeDocumentMap RejectBatch(model::BatchId batch_id); - - /** Returns the last recorded stream token for the current user. */ - nanopb::ByteString GetLastStreamToken(); - - /** - * Sets the stream token for the current user without acknowledging any - * mutation batch. This is usually only useful after a stream handshake or in - * response to an error that requires clearing the stream token. - */ - void SetLastStreamToken(const nanopb::ByteString& stream_token); - - /** - * Returns the last consistent snapshot processed (used by the RemoteStore to - * determine whether to buffer incoming snapshots from the backend). - */ - const model::SnapshotVersion& GetLastRemoteSnapshotVersion() const; - - /** - * Updates the "ground-state" (remote) documents. We assume that the remote - * event reflects any write batches that have been acknowledged or rejected - * (i.e. we do not re-apply local mutations to updates from this event). - * - * LocalDocuments are re-calculated if there are remaining mutations in the - * queue. - */ - model::MaybeDocumentMap ApplyRemoteEvent( - const remote::RemoteEvent& remote_event); - - /** - * Returns the keys of the documents that are associated with the given - * targetID in the remote table. - */ - model::DocumentKeySet GetRemoteDocumentKeys(model::TargetId target_id); - - /** - * Assigns a query an internal ID so that its results can be pinned so they - * don't get GC'd. A query must be allocated in the local store before the - * store can be used to manage its view. - */ - local::QueryData AllocateQuery(core::Query query); - - /** Unpin all the documents associated with a query. */ - void ReleaseQuery(const core::Query& query); - - /** - * Runs a query against all the documents in the local store and returns the - * results. - */ - model::DocumentMap ExecuteQuery(const core::Query& query); - - /** - * Notify the local store of the changed views to locally pin / unpin - * documents. - */ - void NotifyLocalViewChanges( - const std::vector& view_changes); - - /** - * Gets the mutation batch after the passed in batchId in the mutation queue - * or `nullopt` if empty. - * - * @param batch_id The batch to search after, or `kBatchIdUnknown` for the - * first mutation in the queue. - * @return the next mutation or `nullopt` if there wasn't one. - */ - absl::optional GetNextMutationBatch( - model::BatchId batch_id); - - /** - * Returns the largest (latest) batch id in mutation queue that is pending - * server response. Returns `kBatchIdUnknown` if the queue is empty. - */ - model::BatchId GetHighestUnacknowledgedBatchId(); - - local::LruResults CollectGarbage( - local::LruGarbageCollector* garbage_collector); - - private: - void StartMutationQueue(); - void ApplyBatchResult(const model::MutationBatchResult& batch_result); - - /** - * Returns true if the new_query_data should be persisted during an update of - * an active target. QueryData should always be persisted when a target is - * being released and should not call this function. - * - * While the target is active, QueryData updates can be omitted when nothing - * about the target has changed except metadata like the resume token or - * snapshot version. Occasionally it's worth the extra write to prevent these - * values from getting too stale after a crash, but this doesn't have to be - * too frequent. - */ - bool ShouldPersistQueryData(const QueryData& new_query_data, - const local::QueryData& old_query_data, - const remote::TargetChange& change) const; - - /** Manages our in-memory or durable persistence. Owned by FirestoreClient. */ - Persistence* persistence_ = nullptr; - - /** Used to generate targetIDs for queries tracked locally. */ - core::TargetIdGenerator target_id_generator_; - - /** - * The set of all mutations that have been sent but not yet been applied to - * the backend. - */ - MutationQueue* mutation_queue_ = nullptr; - - /** The set of all cached remote documents. */ - RemoteDocumentCache* remote_document_cache_ = nullptr; - - /** Maps a query to the data about that query. */ - QueryCache* query_cache_ = nullptr; - - /** - * The "local" view of all documents (layering mutation queue on top of - * remote_document_cache_). - */ - std::unique_ptr local_documents_; - - /** The set of document references maintained by any local views. */ - ReferenceSet local_view_references_; - - /** Maps target ids to data about their queries. */ - std::unordered_map target_ids; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_STORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_store.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_store.mm deleted file mode 100644 index 29328b875..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_store.mm +++ /dev/null @@ -1,493 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/local_store.h" - -#include - -#include "Firestore/core/src/firebase/firestore/model/patch_mutation.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" - -namespace firebase { -namespace firestore { -namespace local { - -namespace { - -using auth::User; -using core::Query; -using core::TargetIdGenerator; -using model::BatchId; -using model::DocumentKey; -using model::DocumentKeySet; -using model::DocumentMap; -using model::DocumentVersionMap; -using model::ListenSequenceNumber; -using model::MaybeDocumentMap; -using model::MaybeDocument; -using model::Mutation; -using model::MutationBatch; -using model::MutationBatchResult; -using model::ObjectValue; -using model::OptionalMaybeDocumentMap; -using model::PatchMutation; -using model::Precondition; -using model::SnapshotVersion; -using model::TargetId; -using nanopb::ByteString; -using remote::TargetChange; - -/** - * The maximum time to leave a resume token buffered without writing it out. - * This value is arbitrary: it's long enough to avoid several writes (possibly - * indefinitely if updates come more frequently than this) but short enough that - * restarting after crashing will still have a pretty recent resume token. - */ -const int64_t kResumeTokenMaxAgeSeconds = 5 * 60; // 5 minutes - -} // namespace - -LocalStore::LocalStore(Persistence* persistence, const User& initial_user) - : persistence_(persistence), - mutation_queue_(persistence->GetMutationQueueForUser(initial_user)), - remote_document_cache_(persistence->remote_document_cache()), - query_cache_(persistence->query_cache()), - local_documents_( - absl::make_unique(remote_document_cache_, - mutation_queue_, - persistence->index_manager())) { - persistence->reference_delegate()->AddInMemoryPins(&local_view_references_); - target_id_generator_ = TargetIdGenerator::QueryCacheTargetIdGenerator(0); -} - -void LocalStore::Start() { - StartMutationQueue(); - TargetId target_id = query_cache_->highest_target_id(); - target_id_generator_ = - TargetIdGenerator::QueryCacheTargetIdGenerator(target_id); -} - -void LocalStore::StartMutationQueue() { - persistence_->Run("Start MutationQueue", [&] { mutation_queue_->Start(); }); -} - -MaybeDocumentMap LocalStore::HandleUserChange(const User& user) { - // Swap out the mutation queue, grabbing the pending mutation batches before - // and after. - std::vector old_batches = persistence_->Run( - "OldBatches", [&] { return mutation_queue_->AllMutationBatches(); }); - - // The old one has a reference to the mutation queue, so null it out first. - local_documents_.reset(); - mutation_queue_ = persistence_->GetMutationQueueForUser(user); - - StartMutationQueue(); - - return persistence_->Run("NewBatches", [&] { - std::vector new_batches = - mutation_queue_->AllMutationBatches(); - - // Recreate our LocalDocumentsView using the new MutationQueue. - local_documents_ = absl::make_unique( - remote_document_cache_, mutation_queue_, persistence_->index_manager()); - - // Union the old/new changed keys. - DocumentKeySet changed_keys; - for (const std::vector* batches : - {&old_batches, &new_batches}) { - for (const MutationBatch& batch : *batches) { - for (const Mutation& mutation : batch.mutations()) { - changed_keys = changed_keys.insert(mutation.key()); - } - } - } - - // Return the set of all (potentially) changed documents as the result of - // the user change. - return local_documents_->GetDocuments(changed_keys); - }); -} - -LocalWriteResult LocalStore::WriteLocally(std::vector&& mutations) { - Timestamp local_write_time = Timestamp::Now(); - DocumentKeySet keys; - for (const Mutation& mutation : mutations) { - keys = keys.insert(mutation.key()); - } - - return persistence_->Run("Locally write mutations", [&] { - // Load and apply all existing mutations. This lets us compute the current - // base state for all non-idempotent transforms before applying any - // additional user-provided writes. - MaybeDocumentMap existing_documents = local_documents_->GetDocuments(keys); - - // For non-idempotent mutations (such as `FieldValue.increment()`), we - // record the base state in a separate patch mutation. This is later used to - // guarantee consistent values and prevents flicker even if the backend - // sends us an update that already includes our transform. - std::vector base_mutations; - for (const Mutation& mutation : mutations) { - absl::optional base_document = - existing_documents.get(mutation.key()); - - absl::optional base_value = - mutation.ExtractBaseValue(base_document); - if (base_value) { - // NOTE: The base state should only be applied if there's some existing - // document to override, so use a Precondition of exists=true - base_mutations.push_back(PatchMutation(mutation.key(), *base_value, - base_value->ToFieldMask(), - Precondition::Exists(true))); - } - } - - MutationBatch batch = mutation_queue_->AddMutationBatch( - local_write_time, std::move(base_mutations), std::move(mutations)); - MaybeDocumentMap changed_documents = - batch.ApplyToLocalDocumentSet(existing_documents); - return LocalWriteResult{batch.batch_id(), std::move(changed_documents)}; - }); -} - -MaybeDocumentMap LocalStore::AcknowledgeBatch( - const MutationBatchResult& batch_result) { - return persistence_->Run("Acknowledge batch", [&] { - const MutationBatch& batch = batch_result.batch(); - mutation_queue_->AcknowledgeBatch(batch, batch_result.stream_token()); - ApplyBatchResult(batch_result); - mutation_queue_->PerformConsistencyCheck(); - - return local_documents_->GetDocuments(batch.keys()); - }); -} - -void LocalStore::ApplyBatchResult(const MutationBatchResult& batch_result) { - const MutationBatch& batch = batch_result.batch(); - DocumentKeySet doc_keys = batch.keys(); - const DocumentVersionMap& versions = batch_result.doc_versions(); - - for (const DocumentKey& doc_key : doc_keys) { - absl::optional remote_doc = - remote_document_cache_->Get(doc_key); - absl::optional doc = remote_doc; - - auto ack_version_iter = versions.find(doc_key); - HARD_ASSERT(ack_version_iter != versions.end(), - "doc_versions should contain every doc in the write."); - const SnapshotVersion& ack_version = ack_version_iter->second; - - if (!doc || doc->version() < ack_version) { - doc = batch.ApplyToRemoteDocument(doc, doc_key, batch_result); - if (!doc) { - HARD_ASSERT( - !remote_doc, - "Mutation batch %s applied to document %s resulted in nullopt.", - batch.ToString(), util::ToString(remote_doc)); - } else { - remote_document_cache_->Add(*doc); - } - } - } - - mutation_queue_->RemoveMutationBatch(batch); -} - -MaybeDocumentMap LocalStore::RejectBatch(BatchId batch_id) { - return persistence_->Run("Reject batch", [&] { - absl::optional to_reject = - mutation_queue_->LookupMutationBatch(batch_id); - HARD_ASSERT(to_reject.has_value(), "Attempt to reject nonexistent batch!"); - - mutation_queue_->RemoveMutationBatch(*to_reject); - mutation_queue_->PerformConsistencyCheck(); - - return local_documents_->GetDocuments(to_reject->keys()); - }); -} - -ByteString LocalStore::GetLastStreamToken() { - return mutation_queue_->GetLastStreamToken(); -} - -void LocalStore::SetLastStreamToken(const ByteString& stream_token) { - persistence_->Run("Set stream token", - [&] { mutation_queue_->SetLastStreamToken(stream_token); }); -} - -const SnapshotVersion& LocalStore::GetLastRemoteSnapshotVersion() const { - return query_cache_->GetLastRemoteSnapshotVersion(); -} - -model::MaybeDocumentMap LocalStore::ApplyRemoteEvent( - const remote::RemoteEvent& remote_event) { - const SnapshotVersion& last_remote_version = - query_cache_->GetLastRemoteSnapshotVersion(); - - return persistence_->Run("Apply remote event", [&] { - // TODO(gsoltis): move the sequence number into the reference delegate. - ListenSequenceNumber sequence_number = - persistence_->current_sequence_number(); - - for (const auto& entry : remote_event.target_changes()) { - TargetId target_id = entry.first; - const TargetChange& change = entry.second; - - auto found = target_ids.find(target_id); - if (found == target_ids.end()) { - // We don't update the remote keys if the query is not active. This - // ensures that we persist the updated query data along with the updated - // assignment. - continue; - } - - QueryData old_query_data = found->second; - - query_cache_->RemoveMatchingKeys(change.removed_documents(), target_id); - query_cache_->AddMatchingKeys(change.added_documents(), target_id); - - // Update the resume token if the change includes one. Don't clear any - // preexisting value. Bump the sequence number as well, so that documents - // being removed now are ordered later than documents that were reviously - // _removed from this target. - const ByteString& resume_token = change.resume_token(); - // Update the resume token if the change includes one. - if (!resume_token.empty()) { - QueryData new_query_data = - old_query_data - .WithResumeToken(resume_token, remote_event.snapshot_version()) - .WithSequenceNumber(sequence_number); - target_ids[target_id] = new_query_data; - - // Update the query data if there are target changes (or if sufficient - // time has passed since the last update). - if (ShouldPersistQueryData(new_query_data, old_query_data, change)) { - query_cache_->UpdateTarget(new_query_data); - } - } - } - - OptionalMaybeDocumentMap changed_docs; - const DocumentKeySet& limbo_documents = - remote_event.limbo_document_changes(); - DocumentKeySet updated_keys; - for (const auto& kv : remote_event.document_updates()) { - updated_keys = updated_keys.insert(kv.first); - } - // Each loop iteration only affects its "own" doc, so it's safe to get all - // the remote documents in advance in a single call. - OptionalMaybeDocumentMap existing_docs = - remote_document_cache_->GetAll(updated_keys); - - for (const auto& kv : remote_event.document_updates()) { - const DocumentKey& key = kv.first; - const MaybeDocument& doc = kv.second; - absl::optional existing_doc; - auto found_existing = existing_docs.get(key); - if (found_existing) { - existing_doc = *found_existing; - } - - // Note: The order of the steps below is important, since we want to - // ensure that rejected limbo resolutions (which fabricate NoDocuments - // with SnapshotVersion::None) never add documents to cache. - if (doc.type() == MaybeDocument::Type::NoDocument && - doc.version() == SnapshotVersion::None()) { - // NoDocuments with SnapshotVersion::None are used in manufactured - // events. We remove these documents from cache since we lost access. - remote_document_cache_->Remove(key); - changed_docs = changed_docs.insert(key, doc); - } else if (!existing_doc || doc.version() > existing_doc->version() || - (doc.version() == existing_doc->version() && - existing_doc->has_pending_writes())) { - // TODO(index-free): Comment in this assert when we enable Index-Free - // queries HARD_ASSERT(remoteEvent.snapshot_version() != - // SnapshotVersion::None(), - // "Cannot add a document when the remote version is zero"); - remote_document_cache_->Add(doc); - changed_docs = changed_docs.insert(key, doc); - } else { - LOG_DEBUG("LocalStore Ignoring outdated watch update for %s. " - "Current version: %s Watch version: %s", - key.ToString(), existing_doc->version().ToString(), - doc.version().ToString()); - } - - // If this was a limbo resolution, make sure we mark when it was accessed. - if (limbo_documents.contains(key)) { - persistence_->reference_delegate()->UpdateLimboDocument(key); - } - } - - // HACK: The only reason we allow omitting snapshot version is so we can - // synthesize remote events when we get permission denied errors while - // trying to resolve the state of a locally cached document that is in - // limbo. - const SnapshotVersion& remote_version = remote_event.snapshot_version(); - if (remote_version != SnapshotVersion::None()) { - HARD_ASSERT(remote_version >= last_remote_version, - "Watch stream reverted to previous snapshot?? (%s < %s)", - remote_version.ToString(), last_remote_version.ToString()); - query_cache_->SetLastRemoteSnapshotVersion(remote_version); - } - - return local_documents_->GetLocalViewOfDocuments(changed_docs); - }); -} - -bool LocalStore::ShouldPersistQueryData(const QueryData& new_query_data, - const QueryData& old_query_data, - const TargetChange& change) const { - // Avoid clearing any existing value - HARD_ASSERT(!new_query_data.resume_token().empty(), - "Attempted to persist query data with empty resume token"); - - // Always persist query data if we don't already have a resume token. - if (old_query_data.resume_token().empty()) return true; - - // Don't allow resume token changes to be buffered indefinitely. This allows - // us to be reasonably up-to-date after a crash and avoids needing to loop - // over all active queries on shutdown. Especially in the browser we may not - // get time to do anything interesting while the current tab is closing. - int64_t new_seconds = new_query_data.snapshot_version().timestamp().seconds(); - int64_t old_seconds = old_query_data.snapshot_version().timestamp().seconds(); - int64_t time_delta = new_seconds - old_seconds; - if (time_delta >= kResumeTokenMaxAgeSeconds) return true; - - // Otherwise if the only thing that has changed about a target is its resume - // token then it's not worth persisting. Note that the RemoteStore keeps an - // in-memory view of the currently active targets which includes the current - // resume token, so stream failure or user changes will still use an - // up-to-date resume token regardless of what we do here. - size_t changes = change.added_documents().size() + - change.modified_documents().size() + - change.removed_documents().size(); - return changes > 0; -} - -void LocalStore::NotifyLocalViewChanges( - const std::vector& view_changes) { - persistence_->Run("NotifyLocalViewChanges", [&] { - for (const LocalViewChanges& view_change : view_changes) { - for (const DocumentKey& key : view_change.removed_keys()) { - persistence_->reference_delegate()->RemoveReference(key); - } - local_view_references_.AddReferences(view_change.added_keys(), - view_change.target_id()); - local_view_references_.RemoveReferences(view_change.removed_keys(), - view_change.target_id()); - } - }); -} - -absl::optional LocalStore::GetNextMutationBatch( - BatchId batch_id) { - return persistence_->Run("NextMutationBatchAfterBatchID", [&] { - return mutation_queue_->NextMutationBatchAfterBatchId(batch_id); - }); -} - -absl::optional LocalStore::ReadDocument(const DocumentKey& key) { - return persistence_->Run("ReadDocument", - [&] { return local_documents_->GetDocument(key); }); -} - -BatchId LocalStore::GetHighestUnacknowledgedBatchId() { - return persistence_->Run("getHighestUnacknowledgedBatchId", [&] { - return mutation_queue_->GetHighestUnacknowledgedBatchId(); - }); -} - -QueryData LocalStore::AllocateQuery(Query query) { - QueryData query_data = persistence_->Run("Allocate query", [&] { - absl::optional cached = query_cache_->GetTarget(query); - // TODO(mcg): freshen last accessed date if cached exists? - if (!cached) { - cached = QueryData(query, target_id_generator_.NextId(), - persistence_->current_sequence_number(), - QueryPurpose::Listen); - query_cache_->AddTarget(*cached); - } - return *cached; - }); - - // Sanity check to ensure that even when resuming a query it's not currently - // active. - TargetId target_id = query_data.target_id(); - HARD_ASSERT(target_ids.find(target_id) == target_ids.end(), - "Tried to allocate an already allocated query: %s", - query.ToString()); - target_ids[target_id] = query_data; - return query_data; -} - -void LocalStore::ReleaseQuery(const Query& query) { - persistence_->Run("Release query", [&] { - absl::optional query_data = query_cache_->GetTarget(query); - HARD_ASSERT(query_data, "Tried to release nonexistent query: %s", - query.ToString()); - - TargetId target_id = query_data->target_id(); - - auto found = target_ids.find(target_id); - if (found != target_ids.end()) { - const QueryData& cached_query_data = found->second; - - if (cached_query_data.snapshot_version() > - query_data->snapshot_version()) { - // If we've been avoiding persisting the resumeToken (see - // ShouldPersistQueryData for conditions and rationale) we need to - // persist the token now because there will no longer be an in-memory - // version to fall back on. - query_data = cached_query_data; - query_cache_->UpdateTarget(*query_data); - } - } - - // References for documents sent via Watch are automatically removed when we - // delete a query's target data from the reference delegate. Since this does - // not remove references for locally mutated documents, we have to remove - // the target associations for these documents manually. - DocumentKeySet removed = local_view_references_.RemoveReferences(target_id); - for (const DocumentKey& key : removed) { - persistence_->reference_delegate()->RemoveReference(key); - } - target_ids.erase(target_id); - persistence_->reference_delegate()->RemoveTarget(*query_data); - }); -} - -DocumentMap LocalStore::ExecuteQuery(const Query& query) { - return persistence_->Run("ExecuteQuery", [&] { - return local_documents_->GetDocumentsMatchingQuery(query); - }); -} - -DocumentKeySet LocalStore::GetRemoteDocumentKeys(TargetId target_id) { - return persistence_->Run("RemoteDocumentKeysForTarget", [&] { - return query_cache_->GetMatchingKeys(target_id); - }); -} - -LruResults LocalStore::CollectGarbage(LruGarbageCollector* garbage_collector) { - return persistence_->Run("Collect garbage", [&] { - return garbage_collector->Collect(target_ids); - }); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_mutation_queue.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_mutation_queue.mm deleted file mode 100644 index 5bef31627..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_mutation_queue.mm +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h" - -#include - -#include "Firestore/core/src/firebase/firestore/local/document_key_reference.h" -#include "Firestore/core/src/firebase/firestore/local/index_manager.h" -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/sizer.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::BatchId; -using model::DocumentKey; -using model::DocumentKeySet; -using model::kBatchIdUnknown; -using model::Mutation; -using model::MutationBatch; -using model::ResourcePath; -using nanopb::ByteString; - -MemoryMutationQueue::MemoryMutationQueue(MemoryPersistence* persistence) - : persistence_(persistence) { -} - -bool MemoryMutationQueue::IsEmpty() { - // If the queue has any entries at all, the first entry must not be a - // tombstone (otherwise it would have been removed already). - return queue_.empty(); -} - -void MemoryMutationQueue::AcknowledgeBatch(const MutationBatch& batch, - const ByteString& stream_token) { - HARD_ASSERT(!queue_.empty(), "Cannot acknowledge batch on an empty queue"); - - // Guaranteed to exist, due to above assert - const MutationBatch& check = queue_.front(); - // Verify that the batch in the queue is the one to be acknowledged. - HARD_ASSERT(batch.batch_id() == check.batch_id(), - "Queue ordering failure: expected batch %s, got batch %s", - batch.batch_id(), check.batch_id()); - last_stream_token_ = stream_token; -} - -void MemoryMutationQueue::Start() { - // Note: The queue may be shutdown / started multiple times, since we maintain - // the queue for the duration of the app session in case a user logs out / - // back in. To behave like the LevelDB-backed MutationQueue (and accommodate - // tests that expect as much), we reset next_batch_id_ if the queue is empty. - if (IsEmpty()) { - next_batch_id_ = 1; - } -} - -MutationBatch MemoryMutationQueue::AddMutationBatch( - const Timestamp& local_write_time, - std::vector&& base_mutations, - std::vector&& mutations) { - HARD_ASSERT(!mutations.empty(), "Mutation batches should not be empty"); - - BatchId batch_id = next_batch_id_; - next_batch_id_++; - - if (!queue_.empty()) { - const MutationBatch& prior = queue_.back(); - HARD_ASSERT(prior.batch_id() < batch_id, - "Mutation batch_ids must be in monotonically increasing order"); - } - - MutationBatch batch(batch_id, local_write_time, std::move(base_mutations), - std::move(mutations)); - queue_.push_back(batch); - - // Track references by document key and index collection parents. - for (const Mutation& mutation : batch.mutations()) { - batches_by_document_key_ = batches_by_document_key_.insert( - DocumentKeyReference{mutation.key(), batch_id}); - - persistence_->index_manager()->AddToCollectionParentIndex( - mutation.key().path().PopLast()); - } - - return batch; -} - -void MemoryMutationQueue::RemoveMutationBatch(const MutationBatch& batch) { - // Can only remove the first batch - HARD_ASSERT(!queue_.empty(), "Trying to remove batch from empty queue"); - const MutationBatch& head = queue_.front(); - HARD_ASSERT(head.batch_id() == batch.batch_id(), - "Can only remove the first entry of the mutation queue"); - - queue_.erase(queue_.begin()); - - // Remove entries from the index too. - for (const Mutation& mutation : batch.mutations()) { - const DocumentKey& key = mutation.key(); - persistence_->reference_delegate()->RemoveMutationReference(key); - - DocumentKeyReference reference{key, batch.batch_id()}; - batches_by_document_key_ = batches_by_document_key_.erase(reference); - } -} - -std::vector -MemoryMutationQueue::AllMutationBatchesAffectingDocumentKeys( - const DocumentKeySet& document_keys) { - // First find the set of affected batch IDs. - std::set batch_ids; - for (const DocumentKey& key : document_keys) { - DocumentKeyReference start{key, 0}; - - for (const auto& reference : batches_by_document_key_.values_from(start)) { - if (key != reference.key()) break; - - batch_ids.insert(reference.ref_id()); - } - } - - return AllMutationBatchesWithIds(batch_ids); -} - -std::vector -MemoryMutationQueue::AllMutationBatchesAffectingDocumentKey( - const DocumentKey& key) { - std::vector result; - - DocumentKeyReference start{key, 0}; - for (const auto& reference : batches_by_document_key_.values_from(start)) { - if (key != reference.key()) break; - - auto batch = LookupMutationBatch(reference.ref_id()); - HARD_ASSERT(batch.has_value(), - "Batches in the index must exist in the main table"); - result.push_back(*batch); - } - return result; -} - -std::vector -MemoryMutationQueue::AllMutationBatchesAffectingQuery(const Query& query) { - HARD_ASSERT( - !query.IsCollectionGroupQuery(), - "CollectionGroup queries should be handled in LocalDocumentsView"); - - // Use the query path as a prefix for testing if a document matches the query. - const ResourcePath& prefix = query.path(); - size_t immediate_children_path_length = prefix.size() + 1; - - // Construct a document reference for actually scanning the index. Unlike the - // prefix, the document key in this reference must have an even number of - // segments. The empty segment can be used as a suffix of the query path - // because it precedes all other segments in an ordered traversal. - ResourcePath start_path = query.path(); - if (!DocumentKey::IsDocumentKey(start_path)) { - start_path = start_path.Append(""); - } - DocumentKeyReference start{DocumentKey{start_path}, 0}; - - // Find unique batch_ids referenced by all documents potentially matching the - // query. - std::set unique_batch_ids; - for (const auto& reference : batches_by_document_key_.values_from(start)) { - const ResourcePath& row_key_path = reference.key().path(); - if (!prefix.IsPrefixOf(row_key_path)) { - break; - } - - // Rows with document keys more than one segment longer than the query path - // can't be matches. For example, a query on 'rooms' can't match the - // document /rooms/abc/messages/xyx. - // TODO(mcg): we'll need a different scanner when we implement ancestor - // queries. - if (row_key_path.size() != immediate_children_path_length) { - continue; - } - - unique_batch_ids.insert(reference.ref_id()); - }; - - return AllMutationBatchesWithIds(unique_batch_ids); -} - -absl::optional -MemoryMutationQueue::NextMutationBatchAfterBatchId(BatchId batch_id) { - BatchId next_batch_id = batch_id + 1; - - // The requested batch_id may still be out of range so normalize it to the - // start of the queue. - int raw_index = IndexOfBatchId(next_batch_id); - size_t index = raw_index < 0 ? 0 : static_cast(raw_index); - if (queue_.size() <= index) { - return absl::nullopt; - } - - return queue_[index]; -} - -BatchId MemoryMutationQueue::GetHighestUnacknowledgedBatchId() { - return IsEmpty() ? kBatchIdUnknown : next_batch_id_ - 1; -} - -absl::optional MemoryMutationQueue::LookupMutationBatch( - BatchId batch_id) { - if (queue_.empty()) { - return absl::nullopt; - } - - int index = IndexOfBatchId(batch_id); - if (index < 0 || static_cast(index) >= queue_.size()) { - return absl::nullopt; - } - - const MutationBatch& batch = queue_[index]; - HARD_ASSERT(batch.batch_id() == batch_id, "If found, batch must match"); - return batch; -} - -void MemoryMutationQueue::PerformConsistencyCheck() { - if (queue_.empty()) { - HARD_ASSERT(batches_by_document_key_.empty(), - "Document leak -- detected dangling mutation references when " - "queue is empty."); - } -} - -bool MemoryMutationQueue::ContainsKey(const model::DocumentKey& key) { - // Create a reference with a zero ID as the start position to find any - // document reference with this key. - DocumentKeyReference reference{key, 0}; - auto range = batches_by_document_key_.values_from(reference); - auto begin = range.begin(); - return begin != range.end() && begin->key() == key; -} - -int64_t MemoryMutationQueue::CalculateByteSize(const Sizer& sizer) { - int64_t count = 0; - for (const auto& batch : queue_) { - count += sizer.CalculateByteSize(batch); - }; - return count; -} - -ByteString MemoryMutationQueue::GetLastStreamToken() { - return last_stream_token_; -} - -void MemoryMutationQueue::SetLastStreamToken(const ByteString& token) { - last_stream_token_ = token; -} - -std::vector MemoryMutationQueue::AllMutationBatchesWithIds( - const std::set& batch_ids) { - std::vector result; - for (BatchId batch_id : batch_ids) { - auto batch = LookupMutationBatch(batch_id); - if (batch.has_value()) { - result.push_back(*batch); - } - } - - return result; -} - -int MemoryMutationQueue::IndexOfBatchId(BatchId batch_id) { - if (queue_.empty()) { - // As an index this is past the end of the queue - return 0; - } - - // Examine the front of the queue to figure out the difference between the - // batch_id and indexes in the array. Note that since the queue is ordered by - // batch_id, if the first batch has a larger batch_id then the requested - // batch_id doesn't exist in the queue. - const MutationBatch& first_batch = queue_.front(); - return batch_id - first_batch.batch_id(); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_persistence.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_persistence.cc deleted file mode 100644 index 88b380f9f..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_persistence.cc +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" - -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/local/listen_sequence.h" -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" -#include "Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/memory_index_manager.h" -#include "Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/memory_query_cache.h" -#include "Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/sizer.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace local { - -using auth::User; -using model::ListenSequenceNumber; - -std::unique_ptr -MemoryPersistence::WithEagerGarbageCollector() { - std::unique_ptr persistence(new MemoryPersistence()); - auto delegate = - absl::make_unique(persistence.get()); - persistence->set_reference_delegate(std::move(delegate)); - return persistence; -} - -std::unique_ptr MemoryPersistence::WithLruGarbageCollector( - LruParams lru_params, std::unique_ptr sizer) { - std::unique_ptr persistence(new MemoryPersistence()); - auto delegate = absl::make_unique( - persistence.get(), lru_params, std::move(sizer)); - persistence->set_reference_delegate(std::move(delegate)); - return persistence; -} - -MemoryPersistence::MemoryPersistence() - : query_cache_(this), remote_document_cache_(this), started_(true) { -} - -ListenSequenceNumber MemoryPersistence::current_sequence_number() const { - return reference_delegate_->current_sequence_number(); -} - -void MemoryPersistence::Shutdown() { - // No durable state to ensure is closed on shutdown. - HARD_ASSERT(started_, "MemoryPersistence shutdown without start!"); - started_ = false; -} - -MemoryMutationQueue* MemoryPersistence::GetMutationQueueForUser( - const User& user) { - auto iter = mutation_queues_.find(user); - if (iter == mutation_queues_.end()) { - auto queue = absl::make_unique(this); - MemoryMutationQueue* result = queue.get(); - - mutation_queues_.emplace(user, std::move(queue)); - return result; - } else { - return iter->second.get(); - } -} - -MemoryQueryCache* MemoryPersistence::query_cache() { - return &query_cache_; -} - -MemoryRemoteDocumentCache* MemoryPersistence::remote_document_cache() { - return &remote_document_cache_; -} - -MemoryIndexManager* MemoryPersistence::index_manager() { - return &index_manager_; -} - -ReferenceDelegate* MemoryPersistence::reference_delegate() { - return reference_delegate_.get(); -} - -void MemoryPersistence::RunInternal(absl::string_view label, - std::function block) { - TransactionGuard guard(reference_delegate_.get(), label); - - block(); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_query_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_query_cache.h deleted file mode 100644 index 7636b2e16..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_query_cache.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_QUERY_CACHE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_QUERY_CACHE_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/local/query_cache.h" -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" - -namespace firebase { -namespace firestore { -namespace local { - -class MemoryPersistence; -class Sizer; - -class MemoryQueryCache : public QueryCache { - public: - explicit MemoryQueryCache(MemoryPersistence* persistence); - - // Target-related methods - void AddTarget(const QueryData& query_data) override; - - void UpdateTarget(const QueryData& query_data) override; - - void RemoveTarget(const QueryData& query_data) override; - - absl::optional GetTarget(const core::Query& query) override; - - void EnumerateTargets(const TargetCallback& callback) override; - - int RemoveTargets(model::ListenSequenceNumber upper_bound, - const std::unordered_map& - live_targets) override; - - // Key-related methods - void AddMatchingKeys(const model::DocumentKeySet& keys, - model::TargetId target_id) override; - - void RemoveMatchingKeys(const model::DocumentKeySet& keys, - model::TargetId target_id) override; - - model::DocumentKeySet GetMatchingKeys(model::TargetId target_id) override; - - bool Contains(const model::DocumentKey& key) override; - - // Other methods and accessors - int64_t CalculateByteSize(const Sizer& sizer); - - size_t size() const override { - return queries_.size(); - } - - model::ListenSequenceNumber highest_listen_sequence_number() const override { - return highest_listen_sequence_number_; - } - - model::TargetId highest_target_id() const override { - return highest_target_id_; - } - - const model::SnapshotVersion& GetLastRemoteSnapshotVersion() const override; - - void SetLastRemoteSnapshotVersion(model::SnapshotVersion version) override; - - private: - // This instance is owned by MemoryPersistence. - MemoryPersistence* persistence_; - - /** The highest sequence number encountered */ - model::ListenSequenceNumber highest_listen_sequence_number_; - /** The highest numbered target ID encountered. */ - model::TargetId highest_target_id_; - /** The last received snapshot version. */ - model::SnapshotVersion last_remote_snapshot_version_; - - /** Maps a query to the data about that query. */ - std::unordered_map queries_; - - /** - * A ordered bidirectional mapping between documents and the remote target - * IDs. - */ - ReferenceSet references_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_QUERY_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_query_cache.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_query_cache.mm deleted file mode 100644 index 28662a2f0..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_query_cache.mm +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/memory_query_cache.h" - -#include - -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/sizer.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::DocumentKey; -using model::DocumentKeySet; -using model::ListenSequenceNumber; -using model::SnapshotVersion; -using model::TargetId; - -MemoryQueryCache::MemoryQueryCache(MemoryPersistence* persistence) - : persistence_(persistence), - highest_listen_sequence_number_(ListenSequenceNumber(0)), - highest_target_id_(TargetId(0)), - last_remote_snapshot_version_(SnapshotVersion::None()), - queries_() { -} - -void MemoryQueryCache::AddTarget(const QueryData& query_data) { - queries_[query_data.query()] = query_data; - if (query_data.target_id() > highest_target_id_) { - highest_target_id_ = query_data.target_id(); - } - if (query_data.sequence_number() > highest_listen_sequence_number_) { - highest_listen_sequence_number_ = query_data.sequence_number(); - } -} - -void MemoryQueryCache::UpdateTarget(const QueryData& query_data) { - // For the memory query cache, adds and updates are treated the same. - AddTarget(query_data); -} - -void MemoryQueryCache::RemoveTarget(const QueryData& query_data) { - queries_.erase(query_data.query()); - references_.RemoveReferences(query_data.target_id()); -} - -absl::optional MemoryQueryCache::GetTarget(const Query& query) { - auto iter = queries_.find(query); - return iter == queries_.end() ? absl::optional{} : iter->second; -} - -void MemoryQueryCache::EnumerateTargets(const TargetCallback& callback) { - for (const auto& kv : queries_) { - callback(kv.second); - } -} - -int MemoryQueryCache::RemoveTargets( - model::ListenSequenceNumber upper_bound, - const std::unordered_map& live_targets) { - std::vector to_remove; - for (const auto& kv : queries_) { - const Query& query = kv.first; - const QueryData& query_data = kv.second; - - if (query_data.sequence_number() <= upper_bound) { - if (live_targets.find(query_data.target_id()) == live_targets.end()) { - to_remove.push_back(&query); - references_.RemoveReferences(query_data.target_id()); - } - } - } - - for (const Query* element : to_remove) { - queries_.erase(*element); - } - return static_cast(to_remove.size()); -} - -void MemoryQueryCache::AddMatchingKeys(const DocumentKeySet& keys, - TargetId target_id) { - references_.AddReferences(keys, target_id); - for (const DocumentKey& key : keys) { - persistence_->reference_delegate()->AddReference(key); - } -} - -void MemoryQueryCache::RemoveMatchingKeys(const DocumentKeySet& keys, - TargetId target_id) { - references_.RemoveReferences(keys, target_id); - for (const DocumentKey& key : keys) { - persistence_->reference_delegate()->RemoveReference(key); - } -} - -DocumentKeySet MemoryQueryCache::GetMatchingKeys(TargetId target_id) { - return references_.ReferencedKeys(target_id); -} - -bool MemoryQueryCache::Contains(const DocumentKey& key) { - return references_.ContainsKey(key); -} - -int64_t MemoryQueryCache::CalculateByteSize(const Sizer& sizer) { - int64_t count = 0; - for (const auto& kv : queries_) { - count += sizer.CalculateByteSize(kv.second); - } - return count; -} - -const SnapshotVersion& MemoryQueryCache::GetLastRemoteSnapshotVersion() const { - return last_remote_snapshot_version_; -} - -void MemoryQueryCache::SetLastRemoteSnapshotVersion(SnapshotVersion version) { - last_remote_snapshot_version_ = std::move(version); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h deleted file mode 100644 index e5abca65a..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_REMOTE_DOCUMENT_CACHE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_REMOTE_DOCUMENT_CACHE_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/local/remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" - -namespace firebase { -namespace firestore { -namespace local { - -class MemoryLruReferenceDelegate; -class MemoryPersistence; -class Sizer; - -class MemoryRemoteDocumentCache : public RemoteDocumentCache { - public: - explicit MemoryRemoteDocumentCache(MemoryPersistence* persistence); - - void Add(const model::MaybeDocument& document) override; - void Remove(const model::DocumentKey& key) override; - - absl::optional Get( - const model::DocumentKey& key) override; - model::OptionalMaybeDocumentMap GetAll( - const model::DocumentKeySet& keys) override; - model::DocumentMap GetMatching(const core::Query& query) override; - - std::vector RemoveOrphanedDocuments( - MemoryLruReferenceDelegate* reference_delegate, - model::ListenSequenceNumber upper_bound); - - int64_t CalculateByteSize(const Sizer& sizer); - - private: - /** Underlying cache of documents. */ - model::MaybeDocumentMap docs_; - - // This instance is owned by MemoryPersistence; avoid a retain cycle. - MemoryPersistence* persistence_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_REMOTE_DOCUMENT_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.mm deleted file mode 100644 index a2e14dd3e..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.mm +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h" - -#include - -#include "Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/sizer.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::Document; -using model::DocumentKey; -using model::DocumentKeySet; -using model::DocumentMap; -using model::ListenSequenceNumber; -using model::MaybeDocument; -using model::MaybeDocumentMap; -using model::OptionalMaybeDocumentMap; - -MemoryRemoteDocumentCache::MemoryRemoteDocumentCache( - MemoryPersistence* persistence) { - persistence_ = persistence; -} - -void MemoryRemoteDocumentCache::Add(const MaybeDocument& document) { - docs_ = docs_.insert(document.key(), document); - - persistence_->index_manager()->AddToCollectionParentIndex( - document.key().path().PopLast()); -} - -void MemoryRemoteDocumentCache::Remove(const DocumentKey& key) { - docs_ = docs_.erase(key); -} - -absl::optional MemoryRemoteDocumentCache::Get( - const DocumentKey& key) { - return docs_.get(key); -} - -OptionalMaybeDocumentMap MemoryRemoteDocumentCache::GetAll( - const DocumentKeySet& keys) { - OptionalMaybeDocumentMap results; - for (const DocumentKey& key : keys) { - // Make sure each key has a corresponding entry, which is nullopt in case - // the document is not found. - // TODO(http://b/32275378): Don't conflate missing / deleted. - results = results.insert(key, Get(key)); - } - return results; -} - -DocumentMap MemoryRemoteDocumentCache::GetMatching(const Query& query) { - HARD_ASSERT( - !query.IsCollectionGroupQuery(), - "CollectionGroup queries should be handled in LocalDocumentsView"); - - DocumentMap results; - - // Documents are ordered by key, so we can use a prefix scan to narrow down - // the documents we need to match the query against. - DocumentKey prefix{query.path().Append("")}; - for (auto it = docs_.lower_bound(prefix); it != docs_.end(); ++it) { - const DocumentKey& key = it->first; - if (!query.path().IsPrefixOf(key.path())) { - break; - } - const MaybeDocument& maybe_doc = it->second; - if (!maybe_doc.is_document()) { - continue; - } - - Document doc(maybe_doc); - if (query.Matches(doc)) { - results = results.insert(key, std::move(doc)); - } - } - return results; -} - -std::vector MemoryRemoteDocumentCache::RemoveOrphanedDocuments( - MemoryLruReferenceDelegate* reference_delegate, - ListenSequenceNumber upper_bound) { - std::vector removed; - MaybeDocumentMap updated_docs = docs_; - for (const auto& kv : docs_) { - const DocumentKey& key = kv.first; - if (!reference_delegate->IsPinnedAtSequenceNumber(upper_bound, key)) { - updated_docs = updated_docs.erase(key); - removed.push_back(key); - } - } - docs_ = updated_docs; - return removed; -} - -int64_t MemoryRemoteDocumentCache::CalculateByteSize(const Sizer& sizer) { - int64_t count = 0; - for (const auto& kv : docs_) { - count += sizer.CalculateByteSize(kv.second); - } - return count; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/proto_sizer.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/proto_sizer.h deleted file mode 100644 index 04577cf22..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/proto_sizer.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_PROTO_SIZER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_PROTO_SIZER_H_ - -#if !defined(__OBJC__) -#error "This header only supports Objective-C++" -#endif // !defined(__OBJC__) - -#include "Firestore/core/src/firebase/firestore/local/sizer.h" - -@class FSTLocalSerializer; - -namespace firebase { -namespace firestore { -namespace local { - -/** - * Estimates the stored size of documents and queries by translating to protos - * and using the serialized sizes to estimate. - */ -class ProtoSizer : public Sizer { - public: - explicit ProtoSizer(FSTLocalSerializer* serializer); - - int64_t CalculateByteSize( - const model::MaybeDocument& maybe_doc) const override; - - int64_t CalculateByteSize( - const model::MutationBatch& mutation_batch) const override; - - int64_t CalculateByteSize(const QueryData& query_data) const override; - - private: - FSTLocalSerializer* serializer_; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_PROTO_SIZER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/proto_sizer.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/proto_sizer.mm deleted file mode 100644 index e54be5d15..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/proto_sizer.mm +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/proto_sizer.h" - -#import "Firestore/Protos/objc/firestore/local/MaybeDocument.pbobjc.h" -#import "Firestore/Protos/objc/firestore/local/Mutation.pbobjc.h" -#import "Firestore/Protos/objc/firestore/local/Target.pbobjc.h" -#import "Firestore/Source/Local/FSTLocalSerializer.h" - -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" - -namespace firebase { -namespace firestore { -namespace local { - -using model::DocumentKey; -using model::MaybeDocument; - -ProtoSizer::ProtoSizer(FSTLocalSerializer* serializer) - : serializer_(serializer) { -} - -int64_t ProtoSizer::CalculateByteSize(const MaybeDocument& maybe_doc) const { - return [[serializer_ encodedMaybeDocument:maybe_doc] serializedSize]; -} - -int64_t ProtoSizer::CalculateByteSize(const model::MutationBatch& batch) const { - return [[serializer_ encodedMutationBatch:batch] serializedSize]; -} - -int64_t ProtoSizer::CalculateByteSize(const QueryData& query_data) const { - return [[serializer_ encodedQueryData:query_data] serializedSize]; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_cache.h deleted file mode 100644 index 3e1bee38c..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_cache.h +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_CACHE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_CACHE_H_ - -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" - -namespace firebase { -namespace firestore { -namespace local { - -using OrphanedDocumentCallback = - std::function; - -using TargetCallback = std::function; - -/** - * Represents cached targets received from the remote backend. This contains - * both a mapping between targets and the documents that matched them according - * to the server, but also metadata about the targets. - * - * The cache is keyed by Query and entries in the cache are QueryData instances. - */ -class QueryCache { - public: - virtual ~QueryCache() { - } - - // Target-related methods - - /** - * Adds an entry in the cache. - * - * The cache key is extracted from `queryData.query`. The key must not already - * exist in the cache. - * - * @param query_data A new QueryData instance to put in the cache. - */ - virtual void AddTarget(const QueryData& query_data) = 0; - - /** - * Updates an entry in the cache. - * - * The cache key is extracted from `queryData.query`. The entry must already - * exist in the cache, and it will be replaced. - * - * @param query_data A QueryData instance to replace an existing entry in - * the cache - */ - virtual void UpdateTarget(const QueryData& query_data) = 0; - - /** Removes the cached entry for the given query data. The entry must already - * exist in the cache. */ - virtual void RemoveTarget(const QueryData& query_data) = 0; - - /** - * Looks up a QueryData entry in the cache. - * - * @param query The query corresponding to the entry to look up. - * @return The cached QueryData entry, or nullopt if the cache has no entry - * for the query. - */ - virtual absl::optional GetTarget(const core::Query& query) = 0; - - virtual void EnumerateTargets(const TargetCallback& callback) = 0; - - virtual int RemoveTargets( - model::ListenSequenceNumber upper_bound, - const std::unordered_map& live_targets) = 0; - - // Key-related methods - virtual void AddMatchingKeys(const model::DocumentKeySet& keys, - model::TargetId target_id) = 0; - - virtual void RemoveMatchingKeys(const model::DocumentKeySet& keys, - model::TargetId target_id) = 0; - - virtual model::DocumentKeySet GetMatchingKeys(model::TargetId target_id) = 0; - - virtual bool Contains(const model::DocumentKey& key) = 0; - - // Accessors - - /** Returns the number of targets cached. */ - virtual size_t size() const = 0; - - /** - * Returns the highest listen sequence number of any query seen by the cache. - */ - virtual model::ListenSequenceNumber highest_listen_sequence_number() - const = 0; - - /** - * Returns the highest target ID of any query in the cache. Typically called - * during startup to seed a target ID generator and avoid collisions with - * existing queries. If there are no queries in the cache, returns zero. - */ - virtual model::TargetId highest_target_id() const = 0; - - /** - * A global snapshot version representing the last consistent snapshot we - * received from the backend. This is monotonically increasing and any - * snapshots received from the backend prior to this version (e.g. for targets - * resumed with a resume_token) should be suppressed (buffered) until the - * backend has caught up to this snapshot version again. This prevents our - * cache from ever going backwards in time. - * - * This is updated whenever our we get a TargetChange with a read_time and - * empty target_ids. - */ - virtual const model::SnapshotVersion& GetLastRemoteSnapshotVersion() - const = 0; - - /** - * Set the snapshot version representing the last consistent snapshot received - * from the backend. (see `GetLastRemoteSnapshotVersion()` for more details). - * - * @param version The new snapshot version. - */ - virtual void SetLastRemoteSnapshotVersion(model::SnapshotVersion version) = 0; -}; - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_data.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_data.cc deleted file mode 100644 index 0bad29f6c..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_data.cc +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/query_data.h" - -#include -#include -#include - -namespace firebase { -namespace firestore { -namespace local { - -using core::Query; -using model::ListenSequenceNumber; -using model::SnapshotVersion; -using model::TargetId; -using nanopb::ByteString; - -// MARK: - QueryPurpose - -namespace { - -const char* ToString(QueryPurpose purpose) { - switch (purpose) { - case QueryPurpose::Listen: - return "Listen"; - case QueryPurpose::ExistenceFilterMismatch: - return "ExistenceFilterMismatch"; - case QueryPurpose::LimboResolution: - return "LimboResolution"; - } - - UNREACHABLE(); -} - -} // namespace - -std::ostream& operator<<(std::ostream& os, QueryPurpose purpose) { - return os << ToString(purpose); -} - -// MARK: - QueryData - -QueryData::QueryData(Query query, - TargetId target_id, - ListenSequenceNumber sequence_number, - QueryPurpose purpose, - SnapshotVersion snapshot_version, - ByteString resume_token) - : query_(std::move(query)), - target_id_(target_id), - sequence_number_(sequence_number), - purpose_(purpose), - snapshot_version_(std::move(snapshot_version)), - resume_token_(std::move(resume_token)) { -} - -QueryData::QueryData(Query query, - int target_id, - ListenSequenceNumber sequence_number, - QueryPurpose purpose) - : QueryData(std::move(query), - target_id, - sequence_number, - purpose, - SnapshotVersion::None(), - ByteString()) { -} - -QueryData QueryData::Invalid() { - return QueryData(Query(), /*target_id=*/-1, /*sequence_number=*/-1, - QueryPurpose::Listen, - SnapshotVersion(SnapshotVersion::None()), {}); -} - -QueryData QueryData::WithSequenceNumber( - ListenSequenceNumber sequence_number) const { - return QueryData(Query(query_), target_id_, sequence_number, purpose_, - snapshot_version_, resume_token_); -} - -QueryData QueryData::WithResumeToken(ByteString resume_token, - SnapshotVersion snapshot_version) const { - return QueryData(Query(query_), target_id_, sequence_number_, purpose_, - std::move(snapshot_version), std::move(resume_token)); -} - -bool operator==(const QueryData& lhs, const QueryData& rhs) { - return lhs.query() == rhs.query() && lhs.target_id() == rhs.target_id() && - lhs.sequence_number() == rhs.sequence_number() && - lhs.purpose() == rhs.purpose() && - lhs.snapshot_version() == rhs.snapshot_version() && - lhs.resume_token() == rhs.resume_token(); -} - -size_t QueryData::Hash() const { - return util::Hash(query_, target_id_, sequence_number_, purpose_, - snapshot_version_, resume_token_); -} - -std::string QueryData::ToString() const { - std::ostringstream ss; - ss << *this; - return ss.str(); -} - -std::ostream& operator<<(std::ostream& os, const QueryData& value) { - return os << "QueryData(query=," << value.query_ - << ", target=" << value.target_id_ << ", purpose=" << value.purpose_ - << ", version=" << value.snapshot_version_ - << ", resume_token=" << value.resume_token_ << ")"; -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_data.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_data.h deleted file mode 100644 index 3084a8a44..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_data.h +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_DATA_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_DATA_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" - -namespace firebase { -namespace firestore { -namespace local { - -/** An enumeration for the different purposes we have for queries. */ -enum class QueryPurpose { - /** A regular, normal query. */ - Listen, - - /** - * The query was used to refill a query after an existence filter mismatch. - */ - ExistenceFilterMismatch, - - /** The query was used to resolve a limbo document. */ - LimboResolution, -}; - -std::ostream& operator<<(std::ostream& os, QueryPurpose purpose); - -/** - * An immutable set of metadata that the store will need to keep track of for - * each query. - */ -class QueryData { - public: - /** - * Creates a new QueryData with the given values. - * - * @param query The query being listened to. - * @param target_id The target to which the query corresponds, assigned by the - * LocalStore for user queries or the SyncEngine for limbo queries. - * @param purpose The purpose of the query. - * @param snapshot_version The latest snapshot version seen for this target. - * @param resume_token An opaque, server-assigned token that allows watching a - * query to be resumed after disconnecting without retransmitting all the - * data that matches the query. The resume token essentially identifies a - * point in time from which the server should resume sending results. - */ - QueryData(core::Query query, - model::TargetId target_id, - model::ListenSequenceNumber sequence_number, - QueryPurpose purpose, - model::SnapshotVersion snapshot_version, - nanopb::ByteString resume_token); - - /** - * Convenience constructor for use when creating a QueryData for the first - * time. - */ - QueryData(core::Query query, - int target_id, - model::ListenSequenceNumber sequence_number, - QueryPurpose purpose); - - /** - * Creates an invalid QueryData. Prefer QueryData::Invalid() for readability. - */ - QueryData() = default; - - /** - * Constructs an invalid QueryData. Reading any properties of the returned - * value is undefined. - */ - static QueryData Invalid(); - - /** The query being listened to. */ - const core::Query& query() const { - return query_; - } - - /** - * The TargetId to which the query corresponds, assigned by the LocalStore for - * user queries or the SyncEngine for limbo queries. - */ - model::TargetId target_id() const { - return target_id_; - } - - model::ListenSequenceNumber sequence_number() const { - return sequence_number_; - } - - /** The purpose of the query. */ - QueryPurpose purpose() const { - return purpose_; - } - - /** The latest snapshot version seen for this target. */ - const model::SnapshotVersion& snapshot_version() const { - return snapshot_version_; - } - - /** - * An opaque, server-assigned token that allows watching a query to be resumed - * after disconnecting without retransmitting all the data that matches the - * query. The resume token essentially identifies a point in time from which - * the server should resume sending results. - */ - const nanopb::ByteString& resume_token() const { - return resume_token_; - } - - /** Creates a new query data instance with an updated sequence number. */ - QueryData WithSequenceNumber( - model::ListenSequenceNumber sequence_number) const; - - /** - * Creates a new query data instance with an updated resume token and - * snapshot version. - */ - QueryData WithResumeToken(nanopb::ByteString resume_token, - model::SnapshotVersion snapshot_version) const; - - friend bool operator==(const QueryData& lhs, const QueryData& rhs); - - size_t Hash() const; - - std::string ToString() const; - - friend std::ostream& operator<<(std::ostream& os, const QueryData& value); - - private: - core::Query query_; - model::TargetId target_id_; - model::ListenSequenceNumber sequence_number_; - QueryPurpose purpose_; - model::SnapshotVersion snapshot_version_; - nanopb::ByteString resume_token_; -}; - -inline bool operator!=(const QueryData& lhs, const QueryData& rhs) { - return !(lhs == rhs); -} - -} // namespace local -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_DATA_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/simple_query_engine.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/simple_query_engine.cc deleted file mode 100644 index 4d365b357..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/simple_query_engine.cc +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/local/simple_query_engine.h" - -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/local_documents_view.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" - -namespace firebase { -namespace firestore { -namespace local { - -model::DocumentMap SimpleQueryEngine::GetDocumentsMatchingQuery( - const core::Query& query, - const model::SnapshotVersion& last_limbo_free_snapshot_version, - const model::DocumentKeySet& remote_keys) const { - HARD_ASSERT(local_documents_view_, "SetLocalDocumentsView() not called"); - - return local_documents_view_->GetDocumentsMatchingQuery(query); -} - -} // namespace local -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/delete_mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/delete_mutation.h deleted file mode 100644 index a3b5c8e55..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/delete_mutation.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DELETE_MUTATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DELETE_MUTATION_H_ - -#include -#include -#include -#include - -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace model { - -/** Represents a Delete operation. */ -class DeleteMutation : public Mutation { - public: - DeleteMutation(DocumentKey key, Precondition precondition); - - /** - * Casts a Mutation to a DeleteMutation. This is a checked operation that will - * assert if the type of the Mutation isn't actually Type::Delete. - */ - explicit DeleteMutation(const Mutation& mutation); - - /** Creates an invalid DeleteMutation instance. */ - DeleteMutation() = default; - - private: - class Rep : public Mutation::Rep { - public: - using Mutation::Rep::Rep; - - Type type() const override { - return Type::Delete; - } - - MaybeDocument ApplyToRemoteDocument( - const absl::optional& maybe_doc, - const MutationResult& mutation_result) const override; - - absl::optional ApplyToLocalView( - const absl::optional& maybe_doc, - const absl::optional&, - const Timestamp&) const override; - - // Does not override Equals or Hash; Mutation's versions are sufficient. - - std::string ToString() const override; - }; -}; - -} // namespace model -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DELETE_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key.cc deleted file mode 100644 index a400502a2..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key.cc +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/model/document_key.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -namespace firebase { -namespace firestore { -namespace model { - -namespace { - -void AssertValidPath(const ResourcePath& path) { - HARD_ASSERT(DocumentKey::IsDocumentKey(path), "invalid document key path: %s", - path.CanonicalString()); -} - -} // namespace - -DocumentKey::DocumentKey(const ResourcePath& path) - : path_{std::make_shared(path)} { - AssertValidPath(*path_); -} - -DocumentKey::DocumentKey(ResourcePath&& path) - : path_{std::make_shared(std::move(path))} { - AssertValidPath(*path_); -} - -const DocumentKey& DocumentKey::Empty() { - static const DocumentKey empty; - return empty; -} - -util::ComparisonResult DocumentKey::CompareTo(const DocumentKey& other) const { - return path().CompareTo(other.path()); -} - -std::string DocumentKey::ToString() const { - return path().CanonicalString(); -} - -std::ostream& operator<<(std::ostream& os, const DocumentKey& key) { - return os << key.ToString(); -} - -} // namespace model -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key.h deleted file mode 100644 index cf7526e20..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_H_ - -#include -#include -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "absl/strings/string_view.h" - -namespace firebase { -namespace firestore { -namespace model { - -/** - * DocumentKey represents the location of a document in the Firestore database. - */ -class DocumentKey : public util::Comparable { - public: - /** Creates a "blank" document key not associated with any document. */ - DocumentKey() : path_{std::make_shared()} { - } - - /** Creates a new document key containing a copy of the given path. */ - explicit DocumentKey(const ResourcePath& path); - - /** Creates a new document key, taking ownership of the given path. */ - explicit DocumentKey(ResourcePath&& path); - - /** - * Creates and returns a new document key using '/' to split the string into - * segments. - */ - static DocumentKey FromPathString(absl::string_view path) { - return DocumentKey{ResourcePath::FromString(path)}; - } - - /** Creates and returns a new document key with the given segments. */ - static DocumentKey FromSegments(std::initializer_list list) { - return DocumentKey{ResourcePath{list}}; - } - - /** Returns a shared instance of an empty document key. */ - static const DocumentKey& Empty(); - - /** Returns true iff the given path is a path to a document. */ - static bool IsDocumentKey(const ResourcePath& path) { - return path.size() % 2 == 0; - } - - util::ComparisonResult CompareTo(const DocumentKey& other) const; - - size_t Hash() const { - return util::Hash(ToString()); - } - - std::string ToString() const; - - friend std::ostream& operator<<(std::ostream& os, const DocumentKey& key); - - /** The path to the document. */ - const ResourcePath& path() const { - return path_ ? *path_ : Empty().path(); - } - - /** Returns true if the document is in the specified collectionId. */ - bool HasCollectionId(absl::string_view collection_id) const { - size_t size = path().size(); - return size >= 2 && path()[size - 2] == collection_id; - } - - private: - // This is an optimization to make passing DocumentKey around cheaper (it's - // copied often). - std::shared_ptr path_; -}; - -struct DocumentKeyHash { - size_t operator()(const DocumentKey& key) const { - return util::Hash(key.path()); - } -}; - -} // namespace model -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key_set.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key_set.h deleted file mode 100644 index 1301bf587..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_key_set.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_SET_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_SET_H_ - -#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" - -namespace firebase { -namespace firestore { -namespace model { - -/** Convenience type for a set of keys, since they are so common. */ -using DocumentKeySet = immutable::SortedSet; - -} // namespace model -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_KEY_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/resource_path.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/resource_path.h deleted file mode 100644 index efaacd8ab..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/resource_path.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_RESOURCE_PATH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_RESOURCE_PATH_H_ - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/model/base_path.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "absl/strings/string_view.h" - -namespace firebase { -namespace firestore { -namespace model { - -/** - * A slash-separated path for navigating resources (documents and collections) - * within Firestore. Immutable; all instances are fully independent. - */ -class ResourcePath : public impl::BasePath, - public util::Comparable { - public: - ResourcePath() = default; - /** Constructs the path from segments. */ - template - ResourcePath(const IterT begin, const IterT end) : BasePath{begin, end} { - } - ResourcePath(std::initializer_list list) : BasePath{list} { - } - explicit ResourcePath(SegmentsT&& segments) : BasePath{std::move(segments)} { - } - /** - * Creates and returns a new path from the given resource-path string, where - * the path segments are separated by a slash "/". - */ - static ResourcePath FromString(absl::string_view path); - - static ResourcePath Empty() { - return ResourcePath{}; - } - - /** Returns a standardized string representation of this path. */ - std::string CanonicalString() const; -}; - -} // namespace model -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_RESOURCE_PATH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h deleted file mode 100644 index c8bbbe838..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_NANOPB_UTIL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_NANOPB_UTIL_H_ - -#include - -#include -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/nullability.h" - -namespace firebase { -namespace firestore { -namespace nanopb { - -/** - * Static casts the given size_t value down to a nanopb compatible size, after - * asserting that the value isn't out of range. - */ -inline pb_size_t CheckedSize(size_t size) { - HARD_ASSERT(size <= PB_SIZE_MAX, - "Size exceeds nanopb limits. Too many entries."); - return static_cast(size); -} - -/** - * Creates a new, null-terminated byte array that's a copy of the bytes in the - * given buffer. Returns a null instance if the given buffer is null or empty. - */ -pb_bytes_array_t* _Nullable CopyBytesArray( - const pb_bytes_array_t* _Nullable buffer); - -/** - * Creates a new, null-terminated byte array that's a copy of the given bytes. - * Returns a null instance if the given size is zero. - */ -pb_bytes_array_t* _Nullable MakeBytesArray(const void* _Nullable data, - size_t size); - -/** - * Creates a new, null-terminated byte array that's a copy of the given bytes. - * Returns a null instance if the size of the given vector is zero. - */ -inline pb_bytes_array_t* _Nullable MakeBytesArray( - const std::vector& bytes) { - return MakeBytesArray(bytes.data(), bytes.size()); -} - -/** - * Creates a string_view of the given nanopb bytes. - */ -absl::string_view MakeStringView(const pb_bytes_array_t* _Nullable str); - -/** - * Creates a string_view of the given nanopb bytes. - */ -absl::string_view MakeStringView(const ByteString& bytes); - -inline pb_bytes_array_t* _Nullable MakeBytesArray(const std::string& str) { - return MakeBytesArray(str.data(), str.size()); -} - -std::string MakeString(const pb_bytes_array_t* _Nullable str); - -/** - * Copies the backing byte array into a new vector of bytes. - */ -inline std::vector MakeVector(const ByteString& str) { - return {str.begin(), str.end()}; -} - -#if __OBJC__ -inline ByteString MakeByteString(NSData* _Nullable value) { - if (value == nil) return ByteString(); - - auto size = static_cast(value.length); - return ByteString::Take(MakeBytesArray(value.bytes, size)); -} - -inline NSData* _Nonnull MakeNSData(const ByteString& str) { - return [[NSData alloc] initWithBytes:str.data() length:str.size()]; -} - -inline NSData* _Nullable MakeNullableNSData(const ByteString& str) { - if (str.empty()) return nil; - return MakeNSData(str); -} -#endif - -} // namespace nanopb -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_NANOPB_UTIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/reader.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/reader.cc deleted file mode 100644 index 634842050..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/reader.cc +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/nanopb/reader.h" - -namespace firebase { -namespace firestore { -namespace nanopb { - -using nanopb::ByteString; - -using firebase::firestore::util::Status; - -Reader::Reader(const ByteString& bytes) : Reader(bytes.data(), bytes.size()) { -} - -Reader::Reader(const std::vector& bytes) - : Reader(bytes.data(), bytes.size()) { -} - -Reader::Reader(const uint8_t* bytes, size_t size) - : stream_(pb_istream_from_buffer(bytes, size)) { -} - -Reader::Reader(absl::string_view str) - : Reader(reinterpret_cast(str.data()), str.size()) { -} - -void Reader::ReadNanopbMessage(const pb_field_t fields[], void* dest_struct) { - if (!status_.ok()) return; - - if (!pb_decode(&stream_, fields, dest_struct)) { - Fail(PB_GET_ERROR(&stream_)); - } -} - -void Reader::FreeNanopbMessage(const pb_field_t fields[], void* dest_struct) { - pb_release(fields, dest_struct); -} - -} // namespace nanopb -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/reader.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/reader.h deleted file mode 100644 index 3c1cfc8a6..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/reader.h +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_READER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_READER_H_ - -#include -#include - -#include -#include - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "absl/strings/string_view.h" - -namespace firebase { -namespace firestore { -namespace nanopb { - -/** - * Docs TODO(rsgowman). But currently, this just wraps the underlying nanopb - * pb_istream_t. - * - * All 'ReadX' methods verify the wiretype (by examining the last_tag_ field, as - * set by ReadTag()) to ensure the correct type. If that fails, the status of - * the Reader instance is set to non-ok. - */ -class Reader { - public: - Reader(const Reader&) = delete; - Reader(Reader&&) = delete; - - /** - * Creates an input stream that reads from the specified bytes. Note that - * this reference must remain valid for the lifetime of this Reader. - * - * (This is roughly equivalent to the nanopb function - * pb_istream_from_buffer()) - * - * @param bytes where the input should be deserialized from. - */ - explicit Reader(const nanopb::ByteString& bytes); - explicit Reader(const std::vector& bytes); - Reader(const uint8_t* bytes, size_t length); - - /** - * Creates an input stream from bytes backing the string_view. Note that - * the backing buffer must remain valid for the lifetime of this Reader. - * - * (This is roughly equivalent to the nanopb function - * pb_istream_from_buffer()) - */ - explicit Reader(absl::string_view); - - /** - * Reads a nanopb message from the input stream. - * - * This essentially wraps calls to nanopb's pb_decode() method. This is the - * primary way of decoding messages. - * - * Note that this allocates memory. You must call FreeNanopbMessage() (which - * essentially wraps pb_release()) on the dest_struct in order to avoid memory - * leaks. (This also implies code that uses this is not exception safe.) - */ - // TODO(rsgowman): At the moment we rely on the caller to manually free - // dest_struct via FreeNanopbMessage(). We might instead see if we can - // register allocated messages, track them, and free them ourselves. This may - // be especially relevant if we start to use nanopb messages as the underlying - // data within the model objects. - void ReadNanopbMessage(const pb_field_t fields[], void* dest_struct); - - /** - * Release memory allocated by ReadNanopbMessage(). - * - * This essentially wraps calls to nanopb's pb_release() method. - */ - void FreeNanopbMessage(const pb_field_t fields[], void* dest_struct); - - util::Status status() const { - return status_; - } - - void set_status(util::Status status) { - status_ = status; - } - - /** - * Ensures this Reader's status is `!ok(). - * - * If this Reader's status is already !ok(), then this may augment the - * description, but will otherwise leave it alone. Otherwise, this Reader's - * status will be set to Error::DataLoss with the specified - * description. - */ - void Fail(absl::string_view description) { - status_.Update(util::Status(Error::DataLoss, description)); - } - - private: - /** - * Creates a new Reader, based on the given nanopb pb_istream_t. Note that - * a shallow copy will be taken. (Non-null pointers within this struct must - * remain valid for the lifetime of this Reader.) - */ - explicit Reader(pb_istream_t stream) : stream_(stream) { - } - - util::Status status_ = util::Status::OK(); - - pb_istream_t stream_; -}; - -} // namespace nanopb -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_READER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/writer.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/writer.h deleted file mode 100644 index 03346b9fa..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/writer.h +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_WRITER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_WRITER_H_ - -#include -#include - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" - -namespace firebase { -namespace firestore { -namespace nanopb { - -/** - * Docs TODO(rsgowman). But currently, this just wraps the underlying nanopb - * pb_ostream_t. All errors are considered fatal. - */ -class Writer { - public: - /** - * Writes a nanopb message to the output stream. - * - * This essentially wraps calls to nanopb's `pb_encode()` method. If we didn't - * use `oneof`s in our protos, this would be the primary way of encoding - * messages. - */ - void WriteNanopbMessage(const pb_field_t fields[], const void* src_struct); - - protected: - /** - * Creates a new Writer, with a default-initialized pb_ostream_t. - */ - Writer() = default; - - pb_ostream_t stream_{}; -}; - -/** - * Creates a Writer that writes into a vector of bytes. - * - * This is roughly equivalent to the nanopb function pb_ostream_from_buffer(), - * except that ByteStringWriter manages the buffer. - */ -class ByteStringWriter : public Writer { - public: - ByteStringWriter(); - ~ByteStringWriter(); - - ByteStringWriter(const ByteStringWriter&) = delete; - ByteStringWriter(ByteStringWriter&&) = delete; - - ByteStringWriter& operator=(const ByteStringWriter&) = delete; - ByteStringWriter& operator=(ByteStringWriter&&) = delete; - - /** - * Appends the given data to the internal buffer, growing the capacity of the - * buffer to fit. - */ - void Append(const void* data, size_t size); - - /** - * Reserves the given number of bytes of total capacity. To reserve `n` more - * bytes in a writer `w`, call `w.Reserve(w.size() + n)`. - */ - void Reserve(size_t capacity); - - /** - * Sets the size of the buffer to some value less than the current capacity, - * presumably after writing into the buffer with `pos()`. - */ - void SetSize(size_t size); - - /** - * Returns a ByteString that takes ownership of the bytes backing this - * writer. - */ - ByteString Release(); - - size_t size() const { - return buffer_ ? buffer_->size : 0; - } - - size_t capacity() const { - return capacity_; - } - - /** - * Returns the number of remaining bytes: the difference between capacity and - * size. - */ - size_t remaining() const { - return capacity_ - size(); - } - - /** - * Returns the current writing position within this writer's internal buffer. - * This can only be used after calling `Reserve()`. - */ - uint8_t* pos() { - return buffer_->bytes + buffer_->size; - } - - private: - pb_bytes_array_t* buffer_ = nullptr; - size_t capacity_ = 0; -}; - -/** - * Creates an Writer that writes into a std::string. - * - * This is roughly equivalent to the nanopb function pb_ostream_from_buffer(), - * except that StringWriter manages the string. - */ -class StringWriter : public Writer { - public: - StringWriter(); - - /** - * Returns the string backing this StringWriter, taking ownership of its - * contents. - */ - std::string Release(); - - private: - std::string buffer_; -}; - -} // namespace nanopb -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_WRITER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_class.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_class.h deleted file mode 100644 index bc3a76190..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_class.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_CLASS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_CLASS_H_ - -#if __OBJC__ -#include -#else -struct objc_object; -using id = struct objc_object*; -#endif - -#include "Firestore/core/src/firebase/firestore/objc/objc_compatibility.h" - -namespace firebase { -namespace firestore { -namespace objc { - -// The OBJC_CLASS macro defines a forward declaration for an Objective-C class -// that's compatible both with Objective-C++ and regular C++. It's useful in -// headers that reference Objective-C types as members of C++ classes that must -// be usable from straight C++. -// -// Care must be taken to not use the forward declaration (even implicitly) in -// any inline definitions in the header. Even though Objective-C object -// pointers look like raw pointers, under ARC they're more like -// std::shared_ptr, where assignments and copies all potentially change the -// refcount of the pointee. When methods that affect the reference count are -// compiled inline in regular C++ this additional behavior won't get compiled -// in and the Objective-C reference counts will be off. -// -// Note that this may even appear to work, though it does so through undefined -// behavior: inline definitions are deduplicated at link time, and if the -// linker happens to choose a definition that was generated in an ARC-enabled -// translation unit then that specific build will work. -// -// Concretely this means that any method manipulating an Objective-C object -// pointer (constructors, destructors, getters, and setters) all must be -// defined out of line to avoid problems where ARC does not see changes to the -// reference. -// -// To make this safe, any members of a type declared with OBJC_CLASS should be -// held in a Handle object, defined below. -#if __OBJC__ -#define OBJC_CLASS(name) @class name - -#else -// Objective-C classes correspond to a C struct of the same name. Use a forward -// declaration of that struct as the pointer type to help C++ generate the -// correct mangled names. -// -// An alternative implementation would be to make this an alias for objc_object. -// While that's appealing because it makes interaction with functions taking id -// easier, any parameters of that type will be mangled differently in C++ vs -// Objective-C++ leading to undefined symbol errors at link time. -#define OBJC_CLASS(name) struct name -#endif // __OBJC__ - -/** - * A base class for implementing Handle, below, in such a way that allows all - * the major operations to be defined out-of-line in an ARC-managed translation - * unit. - */ -class HandleBase { - public: - HandleBase(); - HandleBase(const HandleBase& other); - HandleBase(HandleBase&& other) noexcept; - - explicit HandleBase(id object); - - ~HandleBase(); - - HandleBase& operator=(const HandleBase& other); - HandleBase& operator=(HandleBase&& other) noexcept; - - void Assign(id object); - - void Release(); - - protected: - id object_; -}; - -/** - * A holder for a pointer to an Objective-C class, that can be declared in - * headers meant to be shared with plain C++. All useful operations on the - * handle are only available in Objective-C++. - */ -template -class Handle : public HandleBase { - public: - Handle() = default; - -#if __OBJC__ - explicit Handle(ObjcType* object) : HandleBase(object) { - } - - // In most cases, just using the handle as an Objective-C pointer works. - operator ObjcType*() const { - return get(); - } - - // Explicit conversion to the Objective-C pointer type is required when - // accessing Objective-C properties. C++ doesn't have an operator overload - // that makes that work, and the compiler doesn't attempt to coerce to the - // Objective-C type to find it. - ObjcType* get() const { - return static_cast(object_); - } - - Handle& operator=(const Handle&) = default; - Handle& operator=(ObjcType* value) { - HandleBase::Assign(value); - return *this; - } - - friend bool operator==(const Handle& lhs, const Handle& rhs) { - return Equals(lhs.object_, rhs.object_); - } - - friend bool operator!=(const Handle& lhs, const Handle& rhs) { - return !(lhs == rhs); - } - - friend bool operator==(const Handle& lhs, ObjcType* rhs) { - return Equals(static_cast(lhs.object_), rhs); - } - - friend bool operator!=(const Handle& lhs, ObjcType* rhs) { - return !(lhs == rhs); - } -#endif -}; - -#if __OBJC__ -template -bool Equals(const Handle& lhs, const Handle& rhs) { - return lhs == rhs; -} -#endif - -} // namespace objc -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_CLASS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_class.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_class.mm deleted file mode 100644 index f69235d57..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_class.mm +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/objc/objc_class.h" - -#include - -namespace firebase { -namespace firestore { -namespace objc { - -HandleBase::HandleBase() : object_(nil) { -} - -HandleBase::HandleBase(id object) : object_(object) { -} - -HandleBase::HandleBase(const HandleBase& other) : object_(other.object_) { -} - -HandleBase::HandleBase(HandleBase&& other) noexcept : object_(other.object_) { - other.Release(); -} - -HandleBase::~HandleBase() { - Release(); -} - -HandleBase& HandleBase::operator=(const HandleBase& other) { - object_ = other.object_; - return *this; -} - -HandleBase& HandleBase::operator=(HandleBase&& other) noexcept { - object_ = other.object_; - other.Release(); - return *this; -} - -void HandleBase::Assign(id object) { - object_ = object; -} - -void HandleBase::Release() { - object_ = nil; -} - -} // namespace objc -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_compatibility.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_compatibility.h deleted file mode 100644 index cd31fdae6..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_compatibility.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_COMPATIBILITY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_COMPATIBILITY_H_ - -#if __OBJC__ - -#import - -#include -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/objc/objc_type_traits.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" -#include "Firestore/core/src/firebase/firestore/util/type_traits.h" -#include "absl/meta/type_traits.h" - -/** - * Utility functions that help C++ code interoperate with Objective-C while - * migration is in progress - */ - -namespace firebase { -namespace firestore { -namespace objc { - -namespace internal { - -template -using is_container_of_objc = - absl::conjunction, - is_objc_pointer>; - -} - -/** - * Checks two Objective-C objects for equality using `isEqual`. Two nil objects - * are considered equal, unlike the behavior of `isEqual`. - */ -template ::value>> -bool Equals(T* lhs, T* rhs) { - return (lhs == nil && rhs == nil) || [lhs isEqual:rhs]; -} - -/** Checks two C++ containers of Objective-C objects for "deep" equality. */ -template < - typename T, - typename = absl::enable_if_t::value>> -bool Equals(const T& lhs, const T& rhs) { - using Ptr = typename T::value_type; - - return lhs.size() == rhs.size() && - std::equal(lhs.begin(), lhs.end(), rhs.begin(), - [](Ptr o1, Ptr o2) { return Equals(o1, o2); }); -} - -/** - * A function object that implements equality for an Objective-C pointer by - * delegating to -isEqual:. This is useful for using Objective-C objects as - * keys in STL associative containers. - */ -template ::value>> -class EqualTo { - public: - bool operator()(T lhs, T rhs) const { - return [lhs isEqual:rhs]; - } -}; - -/** - * A function object that implements STL-compatible hash code for an Objective-C - * pointer by delegating to -hash. This is useful for using Objective-C objects - * as keys in std::unordered_map. - */ -template ::value>> -class Hash { - public: - size_t operator()(T value) const { - return static_cast([value hash]); - } -}; - -/** - * The equivalent of std::unordered_map, where the Key type is an Objective-C - * class. - */ -template ::value>> -using unordered_map = std::unordered_map, EqualTo>; - -/** - * Creates a debug description of the given `value` by calling `ToString` on it, - * converting the result to an `NSString`. Exists mainly to simplify writing - * `description:` methods for Objective-C classes. - */ -template -NSString* Description(const T& value) { - return util::MakeNSString(util::ToString(value)); -} - -} // namespace objc -} // namespace firestore -} // namespace firebase - -#endif // __OBJC__ - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_COMPATIBILITY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor_apple.mm deleted file mode 100644 index 3f6c0dfe2..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor_apple.mm +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h" - -#if defined(__APPLE__) - -#include -#include -#include - -#include - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace remote { - -namespace { - -using NetworkStatus = ConnectivityMonitor::NetworkStatus; -using util::AsyncQueue; - -NetworkStatus ToNetworkStatus(SCNetworkReachabilityFlags flags) { - if (!(flags & kSCNetworkReachabilityFlagsReachable)) { - return NetworkStatus::Unavailable; - } - if (flags & kSCNetworkReachabilityFlagsConnectionRequired) { - return NetworkStatus::Unavailable; - } - -#if TARGET_OS_IPHONE - if (flags & kSCNetworkReachabilityFlagsIsWWAN) { - return NetworkStatus::AvailableViaCellular; - } -#endif - return NetworkStatus::Available; -} - -SCNetworkReachabilityRef CreateReachability() { - // Pseudoaddress that monitors internet reachability in general. - sockaddr_in any_connection_addr{}; - any_connection_addr.sin_len = sizeof(any_connection_addr); - any_connection_addr.sin_family = AF_INET; - return SCNetworkReachabilityCreateWithAddress( - nullptr, reinterpret_cast(&any_connection_addr)); -} - -void OnReachabilityChangedCallback(SCNetworkReachabilityRef /*unused*/, - SCNetworkReachabilityFlags flags, - void* raw_this); - -} // namespace - -/** - * Implementation of `ConnectivityMonitor` based on `SCNetworkReachability` - * (iOS/MacOS). - */ -class ConnectivityMonitorApple : public ConnectivityMonitor { - public: - explicit ConnectivityMonitorApple( - const std::shared_ptr& worker_queue) - : ConnectivityMonitor{worker_queue} { - reachability_ = CreateReachability(); - if (!reachability_) { - LOG_DEBUG("Failed to create reachability monitor."); - return; - } - - SCNetworkReachabilityFlags flags; - if (SCNetworkReachabilityGetFlags(reachability_, &flags)) { - SetInitialStatus(ToNetworkStatus(flags)); - } - - SCNetworkReachabilityContext context{}; - context.info = this; - bool success = SCNetworkReachabilitySetCallback( - reachability_, OnReachabilityChangedCallback, &context); - if (!success) { - LOG_DEBUG("Couldn't set reachability callback"); - return; - } - - // It's okay to use the main queue for reachability events because they are - // fairly infrequent, and there's no good way to get the underlying dispatch - // queue out of the worker queue. The callback itself is still executed on - // the worker queue. - success = SCNetworkReachabilitySetDispatchQueue(reachability_, - dispatch_get_main_queue()); - if (!success) { - LOG_DEBUG("Couldn't set reachability queue"); - return; - } - } - - ~ConnectivityMonitorApple() { - if (reachability_) { - bool success = - SCNetworkReachabilitySetDispatchQueue(reachability_, nullptr); - if (!success) { - LOG_DEBUG("Couldn't unset reachability queue"); - } - - CFRelease(reachability_); - } - } - - void OnReachabilityChanged(SCNetworkReachabilityFlags flags) { - queue()->Enqueue( - [this, flags] { MaybeInvokeCallbacks(ToNetworkStatus(flags)); }); - } - - private: - SCNetworkReachabilityRef reachability_ = nil; -}; - -namespace { - -void OnReachabilityChangedCallback(SCNetworkReachabilityRef /*unused*/, - SCNetworkReachabilityFlags flags, - void* raw_this) { - HARD_ASSERT(raw_this, "Received a null pointer as context"); - static_cast(raw_this)->OnReachabilityChanged( - flags); -} - -} // namespace - -std::unique_ptr ConnectivityMonitor::Create( - const std::shared_ptr& worker_queue) { - return absl::make_unique(worker_queue); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase - -#endif // defined(__APPLE__) diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/datastore.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/datastore.mm deleted file mode 100644 index fe17ee42c..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/datastore.mm +++ /dev/null @@ -1,360 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/datastore.h" - -#include -#include - -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/auth/token.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_completion.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_unary_call.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "absl/memory/memory.h" -#include "absl/strings/str_cat.h" - -namespace firebase { -namespace firestore { -namespace remote { -namespace { - -using auth::CredentialsProvider; -using auth::Token; -using core::DatabaseInfo; -using model::DocumentKey; -using model::MaybeDocument; -using model::Mutation; -using util::AsyncQueue; -using util::Status; -using util::StatusOr; -using util::Executor; - -const auto kRpcNameCommit = "/google.firestore.v1.Firestore/Commit"; -const auto kRpcNameLookup = "/google.firestore.v1.Firestore/BatchGetDocuments"; - -std::unique_ptr CreateExecutor() { - return Executor::CreateSerial("com.google.firebase.firestore.rpc"); -} - -std::string MakeString(grpc::string_ref grpc_str) { - return {grpc_str.begin(), grpc_str.size()}; -} - -absl::string_view MakeStringView(grpc::string_ref grpc_str) { - return {grpc_str.begin(), grpc_str.size()}; -} - -void LogGrpcCallFinished(absl::string_view rpc_name, - GrpcCall* call, - const Status& status) { - LOG_DEBUG("RPC %s completed. Error: %s: %s", rpc_name, status.code(), - status.error_message()); - if (bridge::IsLoggingEnabled()) { - auto headers = - Datastore::GetWhitelistedHeadersAsString(call->GetResponseHeaders()); - LOG_DEBUG("RPC %s returned headers (whitelisted): %s", rpc_name, headers); - } -} - -} // namespace - -Datastore::Datastore(const DatabaseInfo& database_info, - const std::shared_ptr& worker_queue, - std::shared_ptr credentials) - : Datastore{database_info, worker_queue, credentials, - ConnectivityMonitor::Create(worker_queue)} { -} - -Datastore::Datastore(const DatabaseInfo& database_info, - const std::shared_ptr& worker_queue, - std::shared_ptr credentials, - std::unique_ptr connectivity_monitor) - : worker_queue_{NOT_NULL(worker_queue)}, - credentials_{std::move(credentials)}, - rpc_executor_{CreateExecutor()}, - connectivity_monitor_{std::move(connectivity_monitor)}, - grpc_connection_{database_info, worker_queue, &grpc_queue_, - connectivity_monitor_.get()}, - serializer_bridge_{database_info} { - if (!database_info.ssl_enabled()) { - GrpcConnection::UseInsecureChannel(database_info.host()); - } -} - -void Datastore::Start() { - rpc_executor_->Execute([this] { PollGrpcQueue(); }); -} - -void Datastore::Shutdown() { - is_shut_down_ = true; - - // Order matters here: shutting down `grpc_connection_`, which will quickly - // finish any pending gRPC calls, must happen before shutting down the gRPC - // queue. - grpc_connection_.Shutdown(); - - // `grpc::CompletionQueue::Next` will only return `false` once `Shutdown` has - // been called and all submitted tags have been extracted. Without this call, - // `rpc_executor_` will never finish. - grpc_queue_.Shutdown(); - // Drain the executor to make sure it extracted all the operations from gRPC - // completion queue. - rpc_executor_->ExecuteBlocking([] {}); -} - -void Datastore::PollGrpcQueue() { - HARD_ASSERT(rpc_executor_->IsCurrentExecutor(), - "PollGrpcQueue should only be called on the " - "dedicated Datastore executor"); - - void* tag = nullptr; - bool ok = false; - while (grpc_queue_.Next(&tag, &ok)) { - auto completion = static_cast(tag); - // While it's valid in principle, we never deliberately pass a null pointer - // to gRPC completion queue and expect it back. This assertion might be - // relaxed if necessary. - HARD_ASSERT(tag, "gRPC queue returned a null tag"); - completion->Complete(ok); - } -} - -std::shared_ptr Datastore::CreateWatchStream( - WatchStreamCallback* callback) { - return std::make_shared(worker_queue_, credentials_, - serializer_bridge_.GetSerializer(), - &grpc_connection_, callback); -} - -std::shared_ptr Datastore::CreateWriteStream( - WriteStreamCallback* callback) { - return std::make_shared(worker_queue_, credentials_, - serializer_bridge_.GetSerializer(), - &grpc_connection_, callback); -} - -void Datastore::CommitMutations(const std::vector& mutations, - CommitCallback&& callback) { - ResumeRpcWithCredentials( - // TODO(c++14): move into lambda. - [this, mutations, - callback](const StatusOr& maybe_credentials) mutable { - if (!maybe_credentials.ok()) { - callback(maybe_credentials.status()); - return; - } - CommitMutationsWithCredentials(maybe_credentials.ValueOrDie(), - mutations, std::move(callback)); - }); -} - -void Datastore::CommitMutationsWithCredentials( - const Token& token, - const std::vector& mutations, - CommitCallback&& callback) { - grpc::ByteBuffer message = serializer_bridge_.ToByteBuffer( - serializer_bridge_.CreateCommitRequest(mutations)); - - std::unique_ptr call_owning = grpc_connection_.CreateUnaryCall( - kRpcNameCommit, token, std::move(message)); - GrpcUnaryCall* call = call_owning.get(); - active_calls_.push_back(std::move(call_owning)); - - call->Start( - // TODO(c++14): move into lambda. - [this, call, callback](const StatusOr& result) { - LogGrpcCallFinished("CommitRequest", call, result.status()); - HandleCallStatus(result.status()); - - // Response is deliberately ignored - callback(result.status()); - - RemoveGrpcCall(call); - }); -} - -void Datastore::LookupDocuments(const std::vector& keys, - LookupCallback&& callback) { - ResumeRpcWithCredentials( - // TODO(c++14): move into lambda. - [this, keys, callback](const StatusOr& maybe_credentials) mutable { - if (!maybe_credentials.ok()) { - callback({}, maybe_credentials.status()); - return; - } - LookupDocumentsWithCredentials(maybe_credentials.ValueOrDie(), keys, - std::move(callback)); - }); -} - -void Datastore::LookupDocumentsWithCredentials( - const Token& token, - const std::vector& keys, - LookupCallback&& callback) { - grpc::ByteBuffer message = serializer_bridge_.ToByteBuffer( - serializer_bridge_.CreateLookupRequest(keys)); - - std::unique_ptr call_owning = - grpc_connection_.CreateStreamingReader(kRpcNameLookup, token, - std::move(message)); - GrpcStreamingReader* call = call_owning.get(); - active_calls_.push_back(std::move(call_owning)); - - // TODO(c++14): move into lambda. - call->Start([this, call, callback]( - const StatusOr>& result) { - LogGrpcCallFinished("BatchGetDocuments", call, result.status()); - HandleCallStatus(result.status()); - - OnLookupDocumentsResponse(result, callback); - - RemoveGrpcCall(call); - }); -} - -void Datastore::OnLookupDocumentsResponse( - const StatusOr>& result, - const LookupCallback& callback) { - if (!result.ok()) { - callback({}, result.status()); - return; - } - - Status parse_status; - std::vector responses = std::move(result).ValueOrDie(); - std::vector docs = - serializer_bridge_.MergeLookupResponses(responses, &parse_status); - callback(docs, parse_status); -} - -void Datastore::ResumeRpcWithCredentials(const OnCredentials& on_credentials) { - // Auth may outlive Firestore - std::weak_ptr weak_this{shared_from_this()}; - - credentials_->GetToken( - [weak_this, on_credentials](const StatusOr& result) { - auto strong_this = weak_this.lock(); - if (!strong_this) { - return; - } - - strong_this->worker_queue_->EnqueueRelaxed( - [weak_this, result, on_credentials] { - auto strong_this = weak_this.lock(); - if (!strong_this) { - return; - } - // In case Auth callback is invoked after Datastore has been shut - // down. - if (strong_this->is_shut_down_) { - return; - } - - on_credentials(result); - }); - }); -} - -void Datastore::HandleCallStatus(const Status& status) { - if (status.code() == Error::Unauthenticated) { - credentials_->InvalidateToken(); - } -} - -void Datastore::RemoveGrpcCall(GrpcCall* to_remove) { - auto found = std::find_if(active_calls_.begin(), active_calls_.end(), - [to_remove](const std::unique_ptr& call) { - return call.get() == to_remove; - }); - HARD_ASSERT(found != active_calls_.end(), "Missing gRPC call"); - active_calls_.erase(found); -} - -bool Datastore::IsAbortedError(const Status& error) { - return error.code() == Error::Aborted; -} - -bool Datastore::IsPermanentError(const Status& error) { - switch (error.code()) { - case Error::Ok: - HARD_FAIL("Treated status OK as error"); - case Error::Cancelled: - case Error::Unknown: - case Error::DeadlineExceeded: - case Error::ResourceExhausted: - case Error::Internal: - case Error::Unavailable: - // Unauthenticated means something went wrong with our token and we need - // to retry with new credentials which will happen automatically. - case Error::Unauthenticated: - return false; - case Error::InvalidArgument: - case Error::NotFound: - case Error::AlreadyExists: - case Error::PermissionDenied: - case Error::FailedPrecondition: - case Error::Aborted: - // Aborted might be retried in some scenarios, but that is dependant on - // the context and should handled individually by the calling code. - // See https://cloud.google.com/apis/design/errors - case Error::OutOfRange: - case Error::Unimplemented: - case Error::DataLoss: - return true; - } - - HARD_FAIL("Unknown status code: %s", error.code()); -} - -bool Datastore::IsPermanentWriteError(const Status& error) { - return IsPermanentError(error) && !IsAbortedError(error); -} - -std::string Datastore::GetWhitelistedHeadersAsString( - const GrpcCall::Metadata& headers) { - static std::unordered_set whitelist = { - "date", "x-google-backends", "x-google-netmon-label", "x-google-service", - "x-google-gfe-request-trace"}; - - std::string result; - for (const auto& kv : headers) { - if (whitelist.find(MakeString(kv.first)) != whitelist.end()) { - absl::StrAppend(&result, MakeStringView(kv.first), ": ", - MakeStringView(kv.second), "\n"); - } - } - return result; -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_completion.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_completion.cc deleted file mode 100644 index 9416b373f..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_completion.cc +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/grpc_completion.h" - -#include -#include - -namespace firebase { -namespace firestore { -namespace remote { - -using util::AsyncQueue; - -GrpcCompletion::GrpcCompletion( - Type type, - const std::shared_ptr& worker_queue, - Callback&& callback) - : worker_queue_{worker_queue}, callback_{std::move(callback)}, type_{type} { -} - -void GrpcCompletion::Cancel() { - worker_queue_->VerifyIsCurrentQueue(); - callback_ = {}; -} - -void GrpcCompletion::WaitUntilOffQueue() { - worker_queue_->VerifyIsCurrentQueue(); - - EnsureValidFuture(); - return off_queue_future_.wait(); -} - -std::future_status GrpcCompletion::WaitUntilOffQueue( - std::chrono::milliseconds timeout) { - worker_queue_->VerifyIsCurrentQueue(); - - EnsureValidFuture(); - return off_queue_future_.wait_for(timeout); -} - -void GrpcCompletion::EnsureValidFuture() { - if (!off_queue_future_.valid()) { - off_queue_future_ = off_queue_.get_future(); - } -} - -void GrpcCompletion::Complete(bool ok) { - // This mechanism allows `GrpcStream` to know when the completion is off the - // gRPC completion queue (and thus no longer requires the underlying gRPC - // objects to be valid). - off_queue_.set_value(); - - worker_queue_->Enqueue([this, ok] { - if (callback_) { - callback_(ok, this); - } - delete this; - }); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_completion.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_completion.h deleted file mode 100644 index 72c9b8b3d..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_completion.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_COMPLETION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_COMPLETION_H_ - -#include // NOLINT(build/c++11) -#include -#include // NOLINT(build/c++11) -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "grpcpp/support/byte_buffer.h" - -namespace firebase { -namespace firestore { -namespace remote { - -/** - * A completion for a gRPC asynchronous operation that runs an arbitrary - * callback. - * - * All created `GrpcCompletion`s are expected to be put on the gRPC completion - * queue (as "tags"). `GrpcCompletion` expects that once it's received back from - * the gRPC completion queue, `Complete` will be called on it. `Complete` - * doesn't run the given callback immediately when taken off the queue; rather, - * it schedules running the callback on the worker queue. If the callback is no - * longer relevant, calling `Cancel` on the `GrpcCompletion` will turn the - * callback into a no-op. - * - * `GrpcCompletion` owns the objects that are used by gRPC operations for output - * (a `ByteBuffer` for reading a new message and a `Status` for finish - * operation). The buffer and/or the status may be unused by the corresponding - * gRPC operation. - * - * `GrpcCompletion` is "self-owned"; `GrpcCompletion` deletes itself in its - * `Complete` method. - * - * `GrpcCompletion` expects all gRPC objects pertaining to the current stream to - * remain valid until the `GrpcCompletion` comes back from the gRPC completion - * queue. - */ -class GrpcCompletion { - public: - /** - * This is only to aid debugging and testing; type allows easily - * distinguishing between pending completions of a gRPC call. - */ - enum class Type { Start, Read, Write, Finish }; - - /** - * The boolean parameter is used to indicate whether the corresponding gRPC - * operation finished successfully or not. - * - * The `GrpcCompletion` pointer will always point to `this`. - */ - using Callback = std::function; - - GrpcCompletion(Type type, - const std::shared_ptr& worker_queue, - Callback&& callback); - - /** - * Marks the `GrpcCompletion` as having come back from the gRPC completion - * queue and puts notifying the observing stream on the Firestore async queue. - * The given `ok` value indicates whether the corresponding gRPC operation - * completed successfully. - * - * This function deletes the `GrpcCompletion`. - * - * Must be called outside of Firestore async queue. - */ - void Complete(bool ok); - - void Cancel(); - - /** - * Blocks until the `GrpcCompletion` comes back from the gRPC completion - * queue. It is important to only call this function when the `GrpcCompletion` - * is sure to come back from the queue quickly. - */ - void WaitUntilOffQueue(); - std::future_status WaitUntilOffQueue(std::chrono::milliseconds timeout); - - grpc::ByteBuffer* message() { - return &message_; - } - const grpc::ByteBuffer* message() const { - return &message_; - } - grpc::Status* status() { - return &status_; - } - const grpc::Status* status() const { - return &status_; - } - - Type type() const { - return type_; - } - - private: - std::shared_ptr worker_queue_; - Callback callback_; - - void EnsureValidFuture(); - - // Note that even though `grpc::GenericClientAsyncReaderWriter::Write` takes - // the byte buffer by const reference, it expects the buffer's lifetime to - // extend beyond `Write` (the buffer must be valid until the completion queue - // returns the tag associated with the write, see - // https://github.com/grpc/grpc/issues/13019#issuecomment-336932929, #5). - grpc::ByteBuffer message_; - grpc::Status status_; - - std::promise off_queue_; - std::future off_queue_future_; - - Type type_{}; -}; - -} // namespace remote -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_COMPLETION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.cc deleted file mode 100644 index 090287132..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.cc +++ /dev/null @@ -1,302 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" - -#include -#include // NOLINT(build/c++11) -#include -#include - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/include/firebase/firestore/firestore_version.h" -#include "Firestore/core/src/firebase/firestore/auth/token.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder.h" -#include "Firestore/core/src/firebase/firestore/util/filesystem.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "absl/memory/memory.h" -#include "grpcpp/create_channel.h" - -namespace firebase { -namespace firestore { -namespace remote { - -using auth::Token; -using core::DatabaseInfo; -using model::DatabaseId; -using util::Path; -using util::Status; -using util::StatusOr; -using util::StringFormat; - -namespace { - -const char* const kXGoogAPIClientHeader = "x-goog-api-client"; -const char* const kGoogleCloudResourcePrefix = "google-cloud-resource-prefix"; - -std::string MakeString(absl::string_view view) { - return view.data() ? std::string{view.data(), view.size()} : std::string{}; -} - -std::shared_ptr CreateSslCredentials( - const std::string& certificate) { - grpc::SslCredentialsOptions options; - options.pem_root_certs = certificate; - return grpc::SslCredentials(options); -} - -struct HostConfig { - util::Path certificate_path; - std::string target_name; - bool use_insecure_channel = false; -}; - -class HostConfigMap { - using ConfigByHost = std::unordered_map; - using Guard = std::lock_guard; - - public: - /** - * Returns a pointer to the HostConfig entry for the given host or `nullptr` - * if there's no entry. - */ - const HostConfig* find(const std::string& host) const { - Guard guard{mutex_}; - auto iter = map_.find(host); - if (iter == map_.end()) { - return nullptr; - } else { - return &(iter->second); - } - } - - void UseTestCertificate(const std::string& host, - const Path& certificate_path, - const std::string& target_name) { - HARD_ASSERT(!host.empty(), "Empty host name"); - HARD_ASSERT(!certificate_path.native_value().empty(), - "Empty path to test certificate"); - HARD_ASSERT(!target_name.empty(), "Empty SSL target name"); - - Guard guard(mutex_); - HostConfig& host_config = map_[host]; - host_config.certificate_path = certificate_path; - host_config.target_name = target_name; - } - - void UseInsecureChannel(const std::string& host) { - HARD_ASSERT(!host.empty(), "Empty host name"); - - Guard guard(mutex_); - HostConfig& host_config = map_[host]; - host_config.use_insecure_channel = true; - } - - private: - ConfigByHost map_; - mutable std::mutex mutex_; -}; - -HostConfigMap& Config() { - static HostConfigMap config_by_host_; - return config_by_host_; -} - -} // namespace - -GrpcConnection::GrpcConnection( - const DatabaseInfo& database_info, - const std::shared_ptr& worker_queue, - grpc::CompletionQueue* grpc_queue, - ConnectivityMonitor* connectivity_monitor) - : database_info_{&database_info}, - worker_queue_{NOT_NULL(worker_queue)}, - grpc_queue_{NOT_NULL(grpc_queue)}, - connectivity_monitor_{NOT_NULL(connectivity_monitor)} { - RegisterConnectivityMonitor(); -} - -void GrpcConnection::Shutdown() { - // Fast finish any pending calls. This will not trigger the observers. - // Calls may unregister themselves on finish, so make a protective copy. - auto active_calls = active_calls_; - for (GrpcCall* call : active_calls) { - call->FinishImmediately(); - } -} - -std::unique_ptr GrpcConnection::CreateContext( - const Token& credential) const { - absl::string_view token = credential.user().is_authenticated() - ? credential.token() - : absl::string_view{}; - - auto context = absl::make_unique(); - if (token.data()) { - context->set_credentials(grpc::AccessTokenCredentials(MakeString(token))); - } - - // TODO(dimond): This should ideally also include the gRPC version, however, - // gRPC defines the version as a macro, so it would be hardcoded based on - // version we have at compile time of the Firestore library, rather than the - // version available at runtime/at compile time by the user of the library. - // - // TODO(varconst): this should be configurable (e.g., "gl-cpp" or similar for - // C++ SDK, etc.). - context->AddMetadata( - kXGoogAPIClientHeader, - StringFormat("gl-objc/ fire/%s grpc/", kFirestoreVersionString)); - - // This header is used to improve routing and project isolation by the - // backend. - const DatabaseId& db_id = database_info_->database_id(); - context->AddMetadata(kGoogleCloudResourcePrefix, - StringFormat("projects/%s/databases/%s", - db_id.project_id(), db_id.database_id())); - return context; -} - -void GrpcConnection::EnsureActiveStub() { - // TODO(varconst): find out in which cases a gRPC channel might shut down. - // This might be overkill. - if (!grpc_channel_ || grpc_channel_->GetState(/*try_to_connect=*/false) == - GRPC_CHANNEL_SHUTDOWN) { - LOG_DEBUG("Creating Firestore stub."); - grpc_channel_ = CreateChannel(); - grpc_stub_ = absl::make_unique(grpc_channel_); - } -} - -std::shared_ptr GrpcConnection::CreateChannel() const { - const std::string& host = database_info_->host(); - - grpc::ChannelArguments args; - // Ensure gRPC recovers from a dead connection. (Not typically necessary, as - // the OS will usually notify gRPC when a connection dies. But not always. - // This acts as a failsafe.) - args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, 30 * 1000); - - const HostConfig* host_config = Config().find(host); - if (!host_config) { - std::string root_certificate = LoadGrpcRootCertificate(); - return grpc::CreateCustomChannel( - host, CreateSslCredentials(root_certificate), args); - } - - // For the case when `Settings.sslEnabled == false`. - if (host_config->use_insecure_channel) { - return grpc::CreateCustomChannel(host, grpc::InsecureChannelCredentials(), - args); - } - - // For tests only - args.SetSslTargetNameOverride(host_config->target_name); - Path path = host_config->certificate_path; - StatusOr test_certificate = ReadFile(path); - HARD_ASSERT(test_certificate.ok(), - StringFormat("Unable to open root certificates at file path %s", - path.ToUtf8String()) - .c_str()); - - return grpc::CreateCustomChannel( - host, CreateSslCredentials(test_certificate.ValueOrDie()), args); -} - -std::unique_ptr GrpcConnection::CreateStream( - absl::string_view rpc_name, - const Token& token, - GrpcStreamObserver* observer) { - EnsureActiveStub(); - - auto context = CreateContext(token); - auto call = - grpc_stub_->PrepareCall(context.get(), MakeString(rpc_name), grpc_queue_); - return absl::make_unique(std::move(context), std::move(call), - worker_queue_, this, observer); -} - -std::unique_ptr GrpcConnection::CreateUnaryCall( - absl::string_view rpc_name, - const Token& token, - const grpc::ByteBuffer& message) { - EnsureActiveStub(); - - auto context = CreateContext(token); - auto call = grpc_stub_->PrepareUnaryCall(context.get(), MakeString(rpc_name), - message, grpc_queue_); - return absl::make_unique(std::move(context), std::move(call), - worker_queue_, this, message); -} - -std::unique_ptr GrpcConnection::CreateStreamingReader( - absl::string_view rpc_name, - const Token& token, - const grpc::ByteBuffer& message) { - EnsureActiveStub(); - - auto context = CreateContext(token); - auto call = - grpc_stub_->PrepareCall(context.get(), MakeString(rpc_name), grpc_queue_); - return absl::make_unique( - std::move(context), std::move(call), worker_queue_, this, message); -} - -void GrpcConnection::RegisterConnectivityMonitor() { - connectivity_monitor_->AddCallback( - [this](ConnectivityMonitor::NetworkStatus /*ignored*/) { - // Calls may unregister themselves on finish, so make a protective copy. - auto calls = active_calls_; - for (GrpcCall* call : calls) { - // This will trigger the observers. - call->FinishAndNotify( - Status{Error::Unavailable, "Network connectivity changed"}); - } - // The old channel may hang for a long time trying to reestablish - // connection before eventually failing. Note that gRPC Objective-C - // client does the same thing: - // https://github.com/grpc/grpc/blob/fe11db09575f2dfbe1f88cd44bd417acc168e354/src/objective-c/GRPCClient/private/GRPCHost.m#L309-L314 - grpc_channel_.reset(); - }); -} - -void GrpcConnection::Register(GrpcCall* call) { - active_calls_.push_back(call); -} - -void GrpcConnection::Unregister(GrpcCall* call) { - auto found = std::find(active_calls_.begin(), active_calls_.end(), call); - HARD_ASSERT(found != active_calls_.end(), "Missing a gRPC call"); - active_calls_.erase(found); -} - -/*static*/ void GrpcConnection::UseTestCertificate( - const std::string& host, - const Path& certificate_path, - const std::string& target_name) { - Config().UseTestCertificate(host, certificate_path, target_name); -} - -/*static*/ void GrpcConnection::UseInsecureChannel(const std::string& host) { - Config().UseInsecureChannel(host); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder_apple.mm deleted file mode 100644 index a85eaac8a..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder_apple.mm +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder.h" - -#import - -#include - -#include "Firestore/core/src/firebase/firestore/util/filesystem.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "absl/strings/str_cat.h" - -namespace firebase { -namespace firestore { -namespace remote { - -using util::Path; -using util::ReadFile; -using util::StatusOr; -using util::StringFormat; - -namespace { - -std::string DebugBundleIdentifier(NSBundle* _Nullable bundle) { - if (!bundle) return "(nil bundle)"; - - NSString* identifier = [bundle bundleIdentifier]; - if (!identifier) { - identifier = [bundle bundlePath]; - } - - return identifier ? util::MakeString(identifier) - : "(bundle with no identifier)"; -} - -/** - * Finds the roots.pem certificate file in the given resource bundle and logs - * the outcome. - * - * @param bundle The bundle to check. Can be a nested bundle in Resources or - * an app or framework bundle to look in directly. - * @param parent The parent bundle of the bundle to search. Used for logging. - */ -NSString* _Nullable FindCertFileInResourceBundle(NSBundle* _Nullable bundle, - NSBundle* _Nullable parent) { - if (!bundle) return nil; - - NSString* path = [bundle pathForResource:@"roots" ofType:@"pem"]; - if (util::LogIsDebugEnabled()) { - std::string message = - absl::StrCat("roots.pem ", path ? "found " : "not found ", "in bundle ", - DebugBundleIdentifier(bundle)); - if (parent) { - absl::StrAppend(&message, " (in parent ", DebugBundleIdentifier(parent), - ")"); - } - LOG_DEBUG("%s", message); - } - - return path; -} - -/** - * Finds gRPCCertificates.bundle inside the given parent, if it exists. - * - * This function exists mostly to handle differences in platforms. On iOS, - * resources are nested directly within the top-level of the parent bundle, but - * on macOS this will actually be in Contents/Resources. - * - * @param parent A framework or app bundle to check. - * @return The nested gRPCCertificates.bundle if found, otherwise nil. - */ -NSBundle* _Nullable FindCertBundleInParent(NSBundle* _Nullable parent) { - if (!parent) return nil; - - static NSString* const bundle_names[] = { - // gRPC-C++ 0.0.9 changed the name of the resource bundle to allow it to - // coexist with Objective-C gRPC. - @"gRPCCertificates-Cpp", - - // Older gRPC-C++ or Objective-C gRPC use this name. - @"gRPCCertificates", - }; - - for (NSString* bundle_name : bundle_names) { - NSString* path = [parent pathForResource:bundle_name ofType:@"bundle"]; - if (path) { - return [[NSBundle alloc] initWithPath:path]; - } - } - - return nil; -} - -using BundleLoader = NSBundle* _Nullable (*)(void); - -// CocoaPods: try to load from the gRPC-C++ Framework. -NSBundle* _Nullable FindGrpcCppFrameworkBundle() { - return [NSBundle bundleWithIdentifier:@"org.cocoapods.grpcpp"]; -} - -// CocoaPods: also allow loading from the Objective-C gRPC Framework. -NSBundle* _Nullable FindGrpcObjcFrameworkBundle() { - return [NSBundle bundleWithIdentifier:@"org.cocoapods.GRPCClient"]; -} - -// Carthage: try to load from the FirebaseFirestore.framework -NSBundle* _Nullable FindFirestoreFrameworkBundle() { - // Load FIRFirestore reflectively to avoid a circular reference at build time. - Class firestore_class = objc_getClass("FIRFirestore"); - if (!firestore_class) return nil; - - return [NSBundle bundleForClass:firestore_class]; -} - -// Carthage and manual projects: users manually adding resources to the project -// may add the certificate to the main application bundle. Note that -// `mainBundle` is nil for unit tests of library projects. -NSBundle* _Nullable FindMainBundle() { - return [NSBundle mainBundle]; -} - -/** - * Finds the path to the roots.pem certificates file, wherever it may be. - * - * Carthage users will find roots.pem inside gRPCCertificates.bundle in the - * main bundle. - * - * There have been enough variations and workarounds posted on this that this - * also accepts the roots.pem file outside gRPCCertificates.bundle. - */ -NSString* FindPathToCertificatesFile() { - // Certificates file might be present in gRPC frameworks, Firestore, or the - // main bundle. - static BundleLoader loaders[] = { - FindGrpcCppFrameworkBundle, - FindGrpcObjcFrameworkBundle, - FindFirestoreFrameworkBundle, - FindMainBundle, - }; - - NSString* path = nil; - - for (BundleLoader loader : loaders) { - NSBundle* parent = loader(); - if (!parent) continue; - - NSBundle* certs_bundle = FindCertBundleInParent(parent); - path = FindCertFileInResourceBundle(certs_bundle, parent); - if (path) break; - - path = FindCertFileInResourceBundle(parent, nil); - if (path) break; - } - - return path; -} - -} // namespace - -std::string LoadGrpcRootCertificate() { - NSString* path = FindPathToCertificatesFile(); - HARD_ASSERT( - path, - "Could not load root certificates from the bundle. SSL cannot work."); - - StatusOr certificate = ReadFile(Path::FromNSString(path)); - HARD_ASSERT( - certificate.ok(), - StringFormat("Unable to open root certificates at file path %s", path) - .c_str()); - return certificate.ValueOrDie(); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h deleted file mode 100644 index 1c3184126..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_OBJC_BRIDGE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_OBJC_BRIDGE_H_ - -#if !defined(__OBJC__) -#error "This header only supports Objective-C++" -#endif // !defined(__OBJC__) - -#import - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "absl/types/optional.h" -#include "grpcpp/support/byte_buffer.h" - -#import "Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h" -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - -namespace firebase { -namespace firestore { -namespace remote { -namespace bridge { - -bool IsLoggingEnabled(); - -/** - * This file contains operations in remote/ folder that are still delegated to - * Objective-C: proto parsing and delegates. - * - * The principle is that the C++ implementation can only take Objective-C - * objects as parameters or return them, but never instantiate them or call any - * methods on them -- if that is necessary, it's delegated to one of the bridge - * classes. This allows easily identifying which parts of remote/ still rely on - * not-yet-ported code. - */ - -/** - * A C++ bridge to `FSTSerializerBeta` that allows creating - * `GCFSListenRequest`s and parsing `GCFSListenResponse`s. - */ -class WatchStreamSerializer { - public: - explicit WatchStreamSerializer(FSTSerializerBeta* serializer) - : serializer_{serializer} { - } - - GCFSListenRequest* CreateWatchRequest(const local::QueryData& query) const; - GCFSListenRequest* CreateUnwatchRequest(model::TargetId target_id) const; - static grpc::ByteBuffer ToByteBuffer(GCFSListenRequest* request); - - /** - * If parsing fails, will return nil and write information on the error to - * `out_status`. Otherwise, returns the parsed proto and sets `out_status` to - * ok. - */ - GCFSListenResponse* ParseResponse(const grpc::ByteBuffer& message, - util::Status* out_status) const; - std::unique_ptr ToWatchChange(GCFSListenResponse* proto) const; - model::SnapshotVersion ToSnapshotVersion(GCFSListenResponse* proto) const; - - /** Creates a pretty-printed description of the proto for debugging. */ - static NSString* Describe(GCFSListenRequest* request); - static NSString* Describe(GCFSListenResponse* request); - - private: - FSTSerializerBeta* serializer_; -}; - -/** - * A C++ bridge to `FSTSerializerBeta` that allows creating - * `GCFSWriteRequest`s and parsing `GCFSWriteResponse`s. - */ -class WriteStreamSerializer { - public: - explicit WriteStreamSerializer(FSTSerializerBeta* serializer) - : serializer_{serializer} { - } - - void UpdateLastStreamToken(GCFSWriteResponse* proto); - void SetLastStreamToken(const nanopb::ByteString& token) { - last_stream_token_ = token; - } - nanopb::ByteString GetLastStreamToken() const { - return last_stream_token_; - } - - GCFSWriteRequest* CreateHandshake() const; - GCFSWriteRequest* CreateWriteMutationsRequest( - const std::vector& mutations) const; - GCFSWriteRequest* CreateEmptyMutationsList() { - return CreateWriteMutationsRequest({}); - } - static grpc::ByteBuffer ToByteBuffer(GCFSWriteRequest* request); - - /** - * If parsing fails, will return nil and write information on the error to - * `out_status`. Otherwise, returns the parsed proto and sets `out_status` to - * ok. - */ - GCFSWriteResponse* ParseResponse(const grpc::ByteBuffer& message, - util::Status* out_status) const; - model::SnapshotVersion ToCommitVersion(GCFSWriteResponse* proto) const; - std::vector ToMutationResults( - GCFSWriteResponse* proto) const; - - /** Creates a pretty-printed description of the proto for debugging. */ - static NSString* Describe(GCFSWriteRequest* request); - static NSString* Describe(GCFSWriteResponse* request); - - private: - FSTSerializerBeta* serializer_; - nanopb::ByteString last_stream_token_; -}; - -/** - * A C++ bridge to `FSTSerializerBeta` that allows creating - * `GCFSCommitRequest`s and `GCFSBatchGetDocumentsRequest`s and handling - * `GCFSBatchGetDocumentsResponse`s. - */ -class DatastoreSerializer { - public: - explicit DatastoreSerializer(const core::DatabaseInfo& database_info); - - GCFSCommitRequest* CreateCommitRequest( - const std::vector& mutations) const; - static grpc::ByteBuffer ToByteBuffer(GCFSCommitRequest* request); - - GCFSBatchGetDocumentsRequest* CreateLookupRequest( - const std::vector& keys) const; - static grpc::ByteBuffer ToByteBuffer(GCFSBatchGetDocumentsRequest* request); - - /** - * Merges results of the streaming read together. The array is sorted by the - * document key. - */ - std::vector MergeLookupResponses( - const std::vector& responses, - util::Status* out_status) const; - model::MaybeDocument ToMaybeDocument( - GCFSBatchGetDocumentsResponse* response) const; - - FSTSerializerBeta* GetSerializer() { - return serializer_; - } - - private: - FSTSerializerBeta* serializer_; -}; - -} // namespace bridge -} // namespace remote -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_OBJC_BRIDGE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.mm deleted file mode 100644 index f205e6277..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.mm +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h" - -#include -#include -#include -#include -#include - -#import "Firestore/Source/API/FIRFirestore+Internal.h" - -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "grpcpp/support/status.h" - -namespace firebase { -namespace firestore { -namespace remote { -namespace bridge { - -using core::DatabaseInfo; -using local::QueryData; -using model::DocumentKey; -using model::MaybeDocument; -using model::Mutation; -using model::MutationResult; -using model::TargetId; -using model::SnapshotVersion; -using nanopb::MakeByteString; -using nanopb::MakeNSData; -using util::MakeString; -using util::MakeNSError; -using util::Status; -using util::StringFormat; - -namespace { - -std::string ToHexString(const grpc::ByteBuffer& buffer) { - std::vector slices; - grpc::Status status = buffer.Dump(&slices); - - std::stringstream output; - // The output will look like "0x00 0x0a" - output << std::hex << std::setfill('0') << std::setw(2); - for (const auto& slice : slices) { - for (uint8_t c : slice) { - output << "0x" << static_cast(c) << " "; - } - } - - return output.str(); -} - -NSData* ConvertToNsData(const grpc::ByteBuffer& buffer, NSError** out_error) { - std::vector slices; - grpc::Status status = buffer.Dump(&slices); - if (!status.ok()) { - *out_error = MakeNSError(Status{ - Error::Internal, "Trying to convert an invalid grpc::ByteBuffer"}); - return nil; - } - - if (slices.size() == 1) { - return [NSData dataWithBytes:slices.front().begin() - length:slices.front().size()]; - } else { - NSMutableData* data = [NSMutableData dataWithCapacity:buffer.Length()]; - for (const auto& slice : slices) { - [data appendBytes:slice.begin() length:slice.size()]; - } - return data; - } -} - -grpc::ByteBuffer ConvertToByteBuffer(NSData* data) { - grpc::Slice slice{[data bytes], [data length]}; - return grpc::ByteBuffer{&slice, 1}; -} - -// Note: `StatusOr` cannot be used with ARC-managed objects. -template -Proto* ToProto(const grpc::ByteBuffer& message, Status* out_status) { - NSError* error = nil; - NSData* data = ConvertToNsData(message, &error); - if (!error) { - Proto* proto = [Proto parseFromData:data error:&error]; - if (!error) { - *out_status = Status::OK(); - return proto; - } - } - - std::string error_description = - StringFormat("Unable to parse response from the server.\n" - "Underlying error: %s\n" - "Expected class: %s\n" - "Received value: %s\n", - error, [Proto class], ToHexString(message)); - - *out_status = {Error::Internal, error_description}; - return nil; -} - -} // namespace - -bool IsLoggingEnabled() { - return [FIRFirestore isLoggingEnabled]; -} - -// WatchStreamSerializer - -GCFSListenRequest* WatchStreamSerializer::CreateWatchRequest( - const QueryData& query) const { - GCFSListenRequest* request = [GCFSListenRequest message]; - request.database = [serializer_ encodedDatabaseID]; - request.addTarget = [serializer_ encodedTarget:query]; - request.labels = [serializer_ encodedListenRequestLabelsForQueryData:query]; - return request; -} - -GCFSListenRequest* WatchStreamSerializer::CreateUnwatchRequest( - TargetId target_id) const { - GCFSListenRequest* request = [GCFSListenRequest message]; - request.database = [serializer_ encodedDatabaseID]; - request.removeTarget = target_id; - return request; -} - -grpc::ByteBuffer WatchStreamSerializer::ToByteBuffer( - GCFSListenRequest* request) { - return ConvertToByteBuffer([request data]); -} - -GCFSListenResponse* WatchStreamSerializer::ParseResponse( - const grpc::ByteBuffer& message, Status* out_status) const { - return ToProto(message, out_status); -} - -std::unique_ptr WatchStreamSerializer::ToWatchChange( - GCFSListenResponse* proto) const { - return [serializer_ decodedWatchChange:proto]; -} - -SnapshotVersion WatchStreamSerializer::ToSnapshotVersion( - GCFSListenResponse* proto) const { - return [serializer_ versionFromListenResponse:proto]; -} - -NSString* WatchStreamSerializer::Describe(GCFSListenRequest* request) { - return [request description]; -} - -NSString* WatchStreamSerializer::Describe(GCFSListenResponse* response) { - return [response description]; -} - -// WriteStreamSerializer - -void WriteStreamSerializer::UpdateLastStreamToken(GCFSWriteResponse* proto) { - last_stream_token_ = MakeByteString(proto.streamToken); -} - -GCFSWriteRequest* WriteStreamSerializer::CreateHandshake() const { - // The initial request cannot contain mutations, but must contain a projectID. - GCFSWriteRequest* request = [GCFSWriteRequest message]; - request.database = [serializer_ encodedDatabaseID]; - return request; -} - -GCFSWriteRequest* WriteStreamSerializer::CreateWriteMutationsRequest( - const std::vector& mutations) const { - NSMutableArray* protos = - [NSMutableArray arrayWithCapacity:mutations.size()]; - for (const Mutation& mutation : mutations) { - [protos addObject:[serializer_ encodedMutation:mutation]]; - }; - - GCFSWriteRequest* request = [GCFSWriteRequest message]; - request.writesArray = protos; - request.streamToken = MakeNullableNSData(last_stream_token_); - - return request; -} - -grpc::ByteBuffer WriteStreamSerializer::ToByteBuffer( - GCFSWriteRequest* request) { - return ConvertToByteBuffer([request data]); -} - -GCFSWriteResponse* WriteStreamSerializer::ParseResponse( - const grpc::ByteBuffer& message, Status* out_status) const { - return ToProto(message, out_status); -} - -model::SnapshotVersion WriteStreamSerializer::ToCommitVersion( - GCFSWriteResponse* proto) const { - return [serializer_ decodedVersion:proto.commitTime]; -} - -std::vector WriteStreamSerializer::ToMutationResults( - GCFSWriteResponse* response) const { - NSMutableArray* responses = response.writeResultsArray; - std::vector results; - results.reserve(responses.count); - - const model::SnapshotVersion commitVersion = ToCommitVersion(response); - for (GCFSWriteResult* proto in responses) { - results.push_back([serializer_ decodedMutationResult:proto - commitVersion:commitVersion]); - }; - return results; -} - -NSString* WriteStreamSerializer::Describe(GCFSWriteRequest* request) { - return [request description]; -} - -NSString* WriteStreamSerializer::Describe(GCFSWriteResponse* response) { - return [response description]; -} - -// DatastoreSerializer - -DatastoreSerializer::DatastoreSerializer(const DatabaseInfo& database_info) - : serializer_{[[FSTSerializerBeta alloc] - initWithDatabaseID:database_info.database_id()]} { -} - -GCFSCommitRequest* DatastoreSerializer::CreateCommitRequest( - const std::vector& mutations) const { - GCFSCommitRequest* request = [GCFSCommitRequest message]; - request.database = [serializer_ encodedDatabaseID]; - - NSMutableArray* mutationProtos = [NSMutableArray array]; - for (const Mutation& mutation : mutations) { - [mutationProtos addObject:[serializer_ encodedMutation:mutation]]; - } - request.writesArray = mutationProtos; - - return request; -} - -grpc::ByteBuffer DatastoreSerializer::ToByteBuffer(GCFSCommitRequest* request) { - return ConvertToByteBuffer([request data]); -} - -GCFSBatchGetDocumentsRequest* DatastoreSerializer::CreateLookupRequest( - const std::vector& keys) const { - GCFSBatchGetDocumentsRequest* request = - [GCFSBatchGetDocumentsRequest message]; - - request.database = [serializer_ encodedDatabaseID]; - for (const DocumentKey& key : keys) { - [request.documentsArray addObject:[serializer_ encodedDocumentKey:key]]; - } - - return request; -} - -grpc::ByteBuffer DatastoreSerializer::ToByteBuffer( - GCFSBatchGetDocumentsRequest* request) { - return ConvertToByteBuffer([request data]); -} - -std::vector DatastoreSerializer::MergeLookupResponses( - const std::vector& responses, Status* out_status) const { - // Sort by key. - std::map results; - - for (const auto& response : responses) { - auto* proto = ToProto(response, out_status); - if (!out_status->ok()) { - return {}; - } - MaybeDocument doc = [serializer_ decodedMaybeDocumentFromBatch:proto]; - results[doc.key()] = std::move(doc); - } - - std::vector docs; - docs.reserve(results.size()); - for (const auto& kv : results) { - docs.push_back(kv.second); - } - return docs; -} - -MaybeDocument DatastoreSerializer::ToMaybeDocument( - GCFSBatchGetDocumentsResponse* response) const { - return [serializer_ decodedMaybeDocumentFromBatch:response]; -} - -} // namespace bridge -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_store.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_store.mm deleted file mode 100644 index f494d4b12..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_store.mm +++ /dev/null @@ -1,541 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/remote_store.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace remote { - -using core::Transaction; -using local::LocalStore; -using local::QueryData; -using local::QueryPurpose; -using model::BatchId; -using model::DocumentKeySet; -using model::MutationBatch; -using model::MutationBatchResult; -using model::MutationResult; -using model::OnlineState; -using model::SnapshotVersion; -using model::TargetId; -using model::kBatchIdUnknown; -using nanopb::ByteString; -using util::AsyncQueue; -using util::Status; - -/** - * The maximum number of pending writes to allow. - * TODO(b/35853402): Negotiate this value with the backend. - */ -constexpr int kMaxPendingWrites = 10; - -RemoteStore::RemoteStore( - LocalStore* local_store, - std::shared_ptr datastore, - const std::shared_ptr& worker_queue, - std::function online_state_handler) - : local_store_{local_store}, - datastore_{std::move(datastore)}, - online_state_tracker_{worker_queue, std::move(online_state_handler)} { - datastore_->Start(); - - // Create streams (but note they're not started yet) - watch_stream_ = datastore_->CreateWatchStream(this); - write_stream_ = datastore_->CreateWriteStream(this); -} - -void RemoteStore::Start() { - // For now, all setup is handled by `EnableNetwork`. We might expand on this - // in the future. - EnableNetwork(); -} - -void RemoteStore::EnableNetwork() { - is_network_enabled_ = true; - - if (CanUseNetwork()) { - // Load any saved stream token from persistent storage - write_stream_->SetLastStreamToken(local_store_->GetLastStreamToken()); - - if (ShouldStartWatchStream()) { - StartWatchStream(); - } else { - online_state_tracker_.UpdateState(OnlineState::Unknown); - } - - // This will start the write stream if necessary. - FillWritePipeline(); - } -} - -void RemoteStore::DisableNetwork() { - is_network_enabled_ = false; - DisableNetworkInternal(); - - // Set the OnlineState to Offline so get()s return from cache, etc. - online_state_tracker_.UpdateState(OnlineState::Offline); -} - -void RemoteStore::DisableNetworkInternal() { - watch_stream_->Stop(); - write_stream_->Stop(); - - if (!write_pipeline_.empty()) { - LOG_DEBUG("Stopping write stream with %s pending writes", - write_pipeline_.size()); - write_pipeline_.clear(); - } - - CleanUpWatchStreamState(); -} - -void RemoteStore::Shutdown() { - LOG_DEBUG("RemoteStore %s shutting down", this); - is_network_enabled_ = false; - DisableNetworkInternal(); - - // Set the `OnlineState` to `Unknown` (rather than `Offline`) to avoid - // potentially triggering spurious listener events with cached data, etc. - online_state_tracker_.UpdateState(OnlineState::Unknown); - - datastore_->Shutdown(); -} - -// Watch Stream - -void RemoteStore::Listen(const QueryData& query_data) { - TargetId targetKey = query_data.target_id(); - HARD_ASSERT(listen_targets_.find(targetKey) == listen_targets_.end(), - "Listen called with duplicate target id: %s", targetKey); - - // Mark this as something the client is currently listening for. - listen_targets_[targetKey] = query_data; - - if (ShouldStartWatchStream()) { - // The listen will be sent in `OnWatchStreamOpen` - StartWatchStream(); - } else if (watch_stream_->IsOpen()) { - SendWatchRequest(query_data); - } -} - -void RemoteStore::StopListening(TargetId target_id) { - size_t num_erased = listen_targets_.erase(target_id); - HARD_ASSERT(num_erased == 1, - "StopListening: target not currently watched: %s", target_id); - - // The watch stream might not be started if we're in a disconnected state - if (watch_stream_->IsOpen()) { - SendUnwatchRequest(target_id); - } - if (listen_targets_.empty()) { - if (watch_stream_->IsOpen()) { - watch_stream_->MarkIdle(); - } else if (CanUseNetwork()) { - // Revert to `OnlineState::Unknown` if the watch stream is not open and we - // have no listeners, since without any listens to send we cannot confirm - // if the stream is healthy and upgrade to `OnlineState::Online`. - online_state_tracker_.UpdateState(OnlineState::Unknown); - } - } -} - -void RemoteStore::SendWatchRequest(const QueryData& query_data) { - // We need to increment the the expected number of pending responses we're due - // from watch so we wait for the ack to process any messages from this target. - watch_change_aggregator_->RecordPendingTargetRequest(query_data.target_id()); - watch_stream_->WatchQuery(query_data); -} - -void RemoteStore::SendUnwatchRequest(TargetId target_id) { - // We need to increment the expected number of pending responses we're due - // from watch so we wait for the removal on the server before we process any - // messages from this target. - watch_change_aggregator_->RecordPendingTargetRequest(target_id); - watch_stream_->UnwatchTargetId(target_id); -} - -bool RemoteStore::ShouldStartWatchStream() const { - return CanUseNetwork() && !watch_stream_->IsStarted() && - !listen_targets_.empty(); -} - -void RemoteStore::StartWatchStream() { - HARD_ASSERT(ShouldStartWatchStream(), - "StartWatchStream called when ShouldStartWatchStream is false."); - watch_change_aggregator_ = absl::make_unique(this); - watch_stream_->Start(); - - online_state_tracker_.HandleWatchStreamStart(); -} - -void RemoteStore::CleanUpWatchStreamState() { - watch_change_aggregator_.reset(); -} - -void RemoteStore::OnWatchStreamOpen() { - // Restore any existing watches. - for (const auto& kv : listen_targets_) { - SendWatchRequest(kv.second); - } -} - -void RemoteStore::OnWatchStreamClose(const Status& status) { - if (status.ok()) { - // Graceful stop (due to Stop() or idle timeout). Make sure that's - // desirable. - HARD_ASSERT(!ShouldStartWatchStream(), - "Watch stream was stopped gracefully while still needed."); - } - - CleanUpWatchStreamState(); - - // If we still need the watch stream, retry the connection. - if (ShouldStartWatchStream()) { - online_state_tracker_.HandleWatchStreamFailure(status); - - StartWatchStream(); - } else { - // We don't need to restart the watch stream because there are no active - // targets. The online state is set to unknown because there is no active - // attempt at establishing a connection. - online_state_tracker_.UpdateState(OnlineState::Unknown); - } -} - -void RemoteStore::OnWatchStreamChange(const WatchChange& change, - const SnapshotVersion& snapshot_version) { - // Mark the connection as Online because we got a message from the server. - online_state_tracker_.UpdateState(OnlineState::Online); - - if (change.type() == WatchChange::Type::TargetChange) { - const WatchTargetChange& watch_target_change = - static_cast(change); - if (watch_target_change.state() == WatchTargetChangeState::Removed && - !watch_target_change.cause().ok()) { - // There was an error on a target, don't wait for a consistent snapshot to - // raise events - return ProcessTargetError(watch_target_change); - } else { - watch_change_aggregator_->HandleTargetChange(watch_target_change); - } - } else if (change.type() == WatchChange::Type::Document) { - watch_change_aggregator_->HandleDocumentChange( - static_cast(change)); - } else { - HARD_ASSERT( - change.type() == WatchChange::Type::ExistenceFilter, - "Expected watchChange to be an instance of ExistenceFilterWatchChange"); - watch_change_aggregator_->HandleExistenceFilter( - static_cast(change)); - } - - if (snapshot_version != SnapshotVersion::None() && - snapshot_version >= local_store_->GetLastRemoteSnapshotVersion()) { - // We have received a target change with a global snapshot if the snapshot - // version is not equal to `SnapshotVersion::None()`. - RaiseWatchSnapshot(snapshot_version); - } -} - -void RemoteStore::RaiseWatchSnapshot(const SnapshotVersion& snapshot_version) { - HARD_ASSERT(snapshot_version != SnapshotVersion::None(), - "Can't raise event for unknown SnapshotVersion"); - - RemoteEvent remote_event = - watch_change_aggregator_->CreateRemoteEvent(snapshot_version); - - // Update in-memory resume tokens. `LocalStore` will update the persistent - // view of these when applying the completed `RemoteEvent`. - for (const auto& entry : remote_event.target_changes()) { - const TargetChange& target_change = entry.second; - const ByteString& resumeToken = target_change.resume_token(); - - if (!resumeToken.empty()) { - TargetId target_id = entry.first; - auto found = listen_targets_.find(target_id); - absl::optional query_data; - if (found != listen_targets_.end()) { - query_data = found->second; - } - - // A watched target might have been removed already. - if (query_data) { - listen_targets_[target_id] = - query_data->WithResumeToken(resumeToken, snapshot_version); - } - } - } - - // Re-establish listens for the targets that have been invalidated by - // existence filter mismatches. - for (TargetId target_id : remote_event.target_mismatches()) { - auto found = listen_targets_.find(target_id); - if (found == listen_targets_.end()) { - // A watched target might have been removed already. - continue; - } - QueryData query_data = found->second; - - // Clear the resume token for the query, since we're in a known mismatch - // state. - query_data = QueryData(query_data.query(), target_id, - query_data.sequence_number(), query_data.purpose()); - listen_targets_[target_id] = query_data; - - // Cause a hard reset by unwatching and rewatching immediately, but - // deliberately don't send a resume token so that we get a full update. - SendUnwatchRequest(target_id); - - // Mark the query we send as being on behalf of an existence filter - // mismatch, but don't actually retain that in listen_targets_. This ensures - // that we flag the first re-listen this way without impacting future - // listens of this target (that might happen e.g. on reconnect). - QueryData request_query_data(query_data.query(), target_id, - query_data.sequence_number(), - QueryPurpose::ExistenceFilterMismatch); - SendWatchRequest(request_query_data); - } - - // Finally handle remote event - sync_engine_->ApplyRemoteEvent(remote_event); -} - -void RemoteStore::ProcessTargetError(const WatchTargetChange& change) { - HARD_ASSERT(!change.cause().ok(), "Handling target error without a cause"); - - // Ignore targets that have been removed already. - for (TargetId target_id : change.target_ids()) { - auto found = listen_targets_.find(target_id); - if (found != listen_targets_.end()) { - listen_targets_.erase(found); - watch_change_aggregator_->RemoveTarget(target_id); - sync_engine_->HandleRejectedListen(target_id, change.cause()); - } - } -} - -// Write Stream - -void RemoteStore::FillWritePipeline() { - BatchId last_batch_id_retrieved = write_pipeline_.empty() - ? kBatchIdUnknown - : write_pipeline_.back().batch_id(); - while (CanAddToWritePipeline()) { - absl::optional batch = - local_store_->GetNextMutationBatch(last_batch_id_retrieved); - if (!batch) { - if (write_pipeline_.empty()) { - write_stream_->MarkIdle(); - } - break; - } - AddToWritePipeline(*batch); - last_batch_id_retrieved = batch->batch_id(); - } - - if (ShouldStartWriteStream()) { - StartWriteStream(); - } -} - -bool RemoteStore::CanAddToWritePipeline() const { - return CanUseNetwork() && write_pipeline_.size() < kMaxPendingWrites; -} - -void RemoteStore::AddToWritePipeline(const MutationBatch& batch) { - HARD_ASSERT(CanAddToWritePipeline(), - "AddToWritePipeline called when pipeline is full"); - - write_pipeline_.push_back(batch); - - if (write_stream_->IsOpen() && write_stream_->handshake_complete()) { - write_stream_->WriteMutations(batch.mutations()); - } -} - -bool RemoteStore::ShouldStartWriteStream() const { - return CanUseNetwork() && !write_stream_->IsStarted() && - !write_pipeline_.empty(); -} - -void RemoteStore::StartWriteStream() { - HARD_ASSERT(ShouldStartWriteStream(), "StartWriteStream called when " - "ShouldStartWriteStream is false."); - write_stream_->Start(); -} - -void RemoteStore::OnWriteStreamOpen() { - write_stream_->WriteHandshake(); -} - -void RemoteStore::OnWriteStreamHandshakeComplete() { - // Record the stream token. - local_store_->SetLastStreamToken(write_stream_->GetLastStreamToken()); - - // Send the write pipeline now that the stream is established. - for (const MutationBatch& write : write_pipeline_) { - write_stream_->WriteMutations(write.mutations()); - } -} - -void RemoteStore::OnWriteStreamMutationResult( - SnapshotVersion commit_version, - std::vector mutation_results) { - // This is a response to a write containing mutations and should be correlated - // to the first write in our write pipeline. - HARD_ASSERT(!write_pipeline_.empty(), "Got result for empty write pipeline"); - - MutationBatch batch = write_pipeline_.front(); - write_pipeline_.erase(write_pipeline_.begin()); - - MutationBatchResult batch_result(std::move(batch), commit_version, - std::move(mutation_results), - write_stream_->GetLastStreamToken()); - sync_engine_->HandleSuccessfulWrite(batch_result); - - // It's possible that with the completion of this mutation another slot has - // freed up. - FillWritePipeline(); -} - -void RemoteStore::OnWriteStreamClose(const Status& status) { - if (status.ok()) { - // Graceful stop (due to Stop() or idle timeout). Make sure that's - // desirable. - HARD_ASSERT(!ShouldStartWriteStream(), - "Write stream was stopped gracefully while still needed."); - } - - // If the write stream closed due to an error, invoke the error callbacks if - // there are pending writes. - if (!status.ok() && !write_pipeline_.empty()) { - // TODO(varconst): handle UNAUTHENTICATED status, see - // go/firestore-client-errors - if (write_stream_->handshake_complete()) { - // This error affects the actual writes. - HandleWriteError(status); - } else { - // If there was an error before the handshake finished, it's possible that - // the server is unable to process the stream token we're sending. - // (Perhaps it's too old?) - HandleHandshakeError(status); - } - } - - // The write stream might have been started by refilling the write pipeline - // for failed writes - if (ShouldStartWriteStream()) { - StartWriteStream(); - } -} - -void RemoteStore::HandleHandshakeError(const Status& status) { - HARD_ASSERT(!status.ok(), "Handling write error with status OK."); - - // Reset the token if it's a permanent error, signaling the write stream is - // no longer valid. Note that the handshake does not count as a write: see - // comments on `Datastore::IsPermanentWriteError` for details. - if (Datastore::IsPermanentError(status)) { - std::string token = util::ToString(write_stream_->GetLastStreamToken()); - LOG_DEBUG("RemoteStore %s error before completed handshake; resetting " - "stream token %s: " - "error code: '%s', details: '%s'", - this, token, status.code(), status.error_message()); - write_stream_->SetLastStreamToken({}); - local_store_->SetLastStreamToken({}); - } else { - // Some other error, don't reset stream token. Our stream logic will just - // retry with exponential backoff. - } -} - -void RemoteStore::HandleWriteError(const Status& status) { - HARD_ASSERT(!status.ok(), "Handling write error with status OK."); - - // Only handle permanent errors here. If it's transient, just let the retry - // logic kick in. - if (!Datastore::IsPermanentWriteError(status)) { - return; - } - - // If this was a permanent error, the request itself was the problem so it's - // not going to succeed if we resend it. - MutationBatch batch = write_pipeline_.front(); - write_pipeline_.erase(write_pipeline_.begin()); - - // In this case it's also unlikely that the server itself is melting - // down--this was just a bad request so inhibit backoff on the next restart. - write_stream_->InhibitBackoff(); - - sync_engine_->HandleRejectedWrite(batch.batch_id(), status); - - // It's possible that with the completion of this mutation another slot has - // freed up. - FillWritePipeline(); -} - -bool RemoteStore::CanUseNetwork() const { - // PORTING NOTE: This method exists mostly because web also has to take into - // account primary vs. secondary state. - return is_network_enabled_; -} - -std::shared_ptr RemoteStore::CreateTransaction() { - return std::make_shared(datastore_.get()); -} - -DocumentKeySet RemoteStore::GetRemoteKeysForTarget(TargetId target_id) const { - return sync_engine_->GetRemoteKeys(target_id); -} - -absl::optional RemoteStore::GetQueryDataForTarget( - TargetId target_id) const { - auto found = listen_targets_.find(target_id); - return found != listen_targets_.end() ? found->second - : absl::optional{}; -} - -void RemoteStore::HandleCredentialChange() { - if (CanUseNetwork()) { - // Tear down and re-create our network streams. This will ensure we get a - // fresh auth token for the new user and re-fill the write pipeline with new - // mutations from the `LocalStore` (since mutations are per-user). - LOG_DEBUG("RemoteStore %s restarting streams for new credential", this); - is_network_enabled_ = false; - DisableNetworkInternal(); - online_state_tracker_.UpdateState(OnlineState::Unknown); - EnableNetwork(); - } -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.mm deleted file mode 100644 index f9d9c2053..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.mm +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/stream.h" - -#include // NOLINT(build/c++11) -#include - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/remote/datastore.h" -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" - -namespace firebase { -namespace firestore { -namespace remote { - -using auth::CredentialsProvider; -using auth::Token; -using util::AsyncQueue; -using util::TimerId; -using util::Status; -using util::StatusOr; -using util::StringFormat; - -namespace { - -/** - * Initial backoff time after an error. - * Set to 1s according to https://cloud.google.com/apis/design/errors. - */ -const double kBackoffFactor = 1.5; -const AsyncQueue::Milliseconds kBackoffInitialDelay{std::chrono::seconds(1)}; -const AsyncQueue::Milliseconds kBackoffMaxDelay{std::chrono::seconds(60)}; -/** The time a stream stays open after it is marked idle. */ -const AsyncQueue::Milliseconds kIdleTimeout{std::chrono::seconds(60)}; - -} // namespace - -Stream::Stream(const std::shared_ptr& worker_queue, - std::shared_ptr credentials_provider, - GrpcConnection* grpc_connection, - TimerId backoff_timer_id, - TimerId idle_timer_id) - : backoff_{worker_queue, backoff_timer_id, kBackoffFactor, - kBackoffInitialDelay, kBackoffMaxDelay}, - credentials_provider_{std::move(credentials_provider)}, - worker_queue_{worker_queue}, - grpc_connection_{grpc_connection}, - idle_timer_id_{idle_timer_id} { -} - -// Check state - -bool Stream::IsOpen() const { - EnsureOnQueue(); - return state_ == State::Open; -} - -bool Stream::IsStarted() const { - EnsureOnQueue(); - return state_ == State::Starting || state_ == State::Backoff || IsOpen(); -} - -// Starting - -void Stream::Start() { - EnsureOnQueue(); - - if (state_ == State::Error) { - BackoffAndTryRestarting(); - return; - } - - LOG_DEBUG("%s start", GetDebugDescription()); - - HARD_ASSERT(state_ == State::Initial, "Already started"); - state_ = State::Starting; - - RequestCredentials(); -} - -void Stream::RequestCredentials() { - EnsureOnQueue(); - - // Auth may outlive the stream, so make sure it doesn't try to access a - // deleted object. - std::weak_ptr weak_this{shared_from_this()}; - int initial_close_count = close_count_; - credentials_provider_->GetToken([weak_this, initial_close_count]( - const StatusOr& maybe_token) { - auto strong_this = weak_this.lock(); - if (!strong_this) { - return; - } - - strong_this->worker_queue_->EnqueueRelaxed([maybe_token, weak_this, - initial_close_count] { - auto strong_this = weak_this.lock(); - // Streams can be stopped while waiting for authorization, so need - // to check the close count. - if (!strong_this || strong_this->close_count_ != initial_close_count) { - return; - } - strong_this->ResumeStartWithCredentials(maybe_token); - }); - }); -} - -void Stream::ResumeStartWithCredentials(const StatusOr& maybe_token) { - EnsureOnQueue(); - - HARD_ASSERT(state_ == State::Starting, - "State should still be 'Starting' (was %s)", state_); - - if (!maybe_token.ok()) { - OnStreamFinish(maybe_token.status()); - return; - } - - grpc_stream_ = CreateGrpcStream(grpc_connection_, maybe_token.ValueOrDie()); - grpc_stream_->Start(); -} - -void Stream::OnStreamStart() { - EnsureOnQueue(); - - state_ = State::Open; - NotifyStreamOpen(); -} - -// Backoff - -void Stream::BackoffAndTryRestarting() { - EnsureOnQueue(); - - LOG_DEBUG("%s backoff", GetDebugDescription()); - - HARD_ASSERT(state_ == State::Error, - "Should only perform backoff in an error case"); - - state_ = State::Backoff; - backoff_.BackoffAndRun([this] { - HARD_ASSERT(state_ == State::Backoff, - "Backoff elapsed but state is now: %s", state_); - - state_ = State::Initial; - Start(); - HARD_ASSERT(IsStarted(), "Stream should have started."); - }); -} - -void Stream::InhibitBackoff() { - EnsureOnQueue(); - - HARD_ASSERT(!IsStarted(), - "Can only cancel backoff in a stopped state (was %s)", state_); - - // Clear the error condition. - state_ = State::Initial; - backoff_.Reset(); -} - -// Idleness - -void Stream::MarkIdle() { - EnsureOnQueue(); - - if (IsOpen() && !idleness_timer_) { - idleness_timer_ = worker_queue_->EnqueueAfterDelay( - kIdleTimeout, idle_timer_id_, [this] { Stop(); }); - } -} - -void Stream::CancelIdleCheck() { - EnsureOnQueue(); - idleness_timer_.Cancel(); -} - -// Read/write - -void Stream::OnStreamRead(const grpc::ByteBuffer& message) { - EnsureOnQueue(); - - HARD_ASSERT(IsStarted(), "OnStreamRead called for a stopped stream."); - - if (bridge::IsLoggingEnabled()) { - LOG_DEBUG("%s headers (whitelisted): %s", GetDebugDescription(), - Datastore::GetWhitelistedHeadersAsString( - grpc_stream_->GetResponseHeaders())); - } - - Status read_status = NotifyStreamResponse(message); - if (!read_status.ok()) { - grpc_stream_->FinishImmediately(); - // Don't expect gRPC to produce status -- since the error happened on the - // client, we have all the information we need. - OnStreamFinish(read_status); - return; - } -} - -// Stopping - -void Stream::Stop() { - EnsureOnQueue(); - LOG_DEBUG("%s stop", GetDebugDescription()); - - Close(Status::OK()); -} - -void Stream::Close(const Status& status) { - // This function ensures that both graceful stop and stop due to error go - // through the same sequence of steps. While it leads to more conditional - // logic, the benefit is reducing the chance of divergence across the two - // cases. - - EnsureOnQueue(); - bool graceful_stop = status.ok(); - - // Step 1 (both): check current state. - if (graceful_stop && !IsStarted()) { - // Graceful stop is idempotent. - return; - } - HARD_ASSERT(IsStarted(), "Trying to close a non-started stream"); - - // Step 2 (both): cancel any outstanding timers (they're guaranteed not to - // execute). - CancelIdleCheck(); - backoff_.Cancel(); - - // Step 3 (both): increment close count, which invalidates long-lived - // callbacks, guaranteeing they won't execute against a new instance of the - // stream or when the stream has been destroyed. - ++close_count_; - - // Step 4 (both): make small adjustments (to backoff/etc.) based on the - // status. - if (graceful_stop) { - // If this is an intentional close, ensure we don't delay our next - // connection attempt. - backoff_.Reset(); - } else { - HandleErrorStatus(status); - } - - // Step 5 (graceful stop only): give subclasses a chance to send final - // messages. - if (graceful_stop && grpc_stream_) { - // If the stream is in the auth stage, gRPC stream might not have been - // created yet. - LOG_DEBUG("%s Finishing gRPC stream", GetDebugDescription()); - TearDown(grpc_stream_.get()); - } - // Step 6 (both): destroy the underlying stream. - grpc_stream_.reset(); - - // Step 7 (both): update the state machine and notify the listener. - // State must be updated before calling the delegate. - state_ = graceful_stop ? State::Initial : State::Error; - NotifyStreamClose(status); -} - -void Stream::HandleErrorStatus(const Status& status) { - if (status.code() == Error::ResourceExhausted) { - LOG_DEBUG( - "%s Using maximum backoff delay to prevent overloading the backend.", - GetDebugDescription()); - backoff_.ResetToMax(); - } else if (status.code() == Error::Unauthenticated) { - // "unauthenticated" error means the token was rejected. Try force - // refreshing it in case it just expired. - credentials_provider_->InvalidateToken(); - } -} - -void Stream::OnStreamFinish(const Status& status) { - EnsureOnQueue(); - - LOG_DEBUG("%s Stream error: '%s'", GetDebugDescription(), status.ToString()); - Close(status); -} - -// Protected helpers - -void Stream::EnsureOnQueue() const { - worker_queue_->VerifyIsCurrentQueue(); -} - -void Stream::Write(grpc::ByteBuffer&& message) { - EnsureOnQueue(); - - HARD_ASSERT(IsOpen(), "Cannot write when the stream is not open."); - - CancelIdleCheck(); - grpc_stream_->Write(std::move(message)); -} - -std::string Stream::GetDebugDescription() const { - EnsureOnQueue(); - return StringFormat("%s (%s)", GetDebugName(), this); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_change.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_change.mm deleted file mode 100644 index ad08c6717..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_change.mm +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" - -namespace firebase { -namespace firestore { -namespace remote { - -namespace { - -template -bool Equals(const WatchChange& lhs, const WatchChange& rhs) { - return static_cast(lhs) == static_cast(rhs); -} - -} // namespace - -// Compares two `WatchChange`s taking into account their actual derived type. -bool operator==(const WatchChange& lhs, const WatchChange& rhs) { - if (lhs.type() != rhs.type()) { - return false; - } - - switch (lhs.type()) { - case WatchChange::Type::Document: - return Equals(lhs, rhs); - case WatchChange::Type::ExistenceFilter: - return Equals(lhs, rhs); - case WatchChange::Type::TargetChange: - return Equals(lhs, rhs); - } - UNREACHABLE(); -} - -bool operator==(const DocumentWatchChange& lhs, - const DocumentWatchChange& rhs) { - return lhs.updated_target_ids() == rhs.updated_target_ids() && - lhs.removed_target_ids() == rhs.removed_target_ids() && - lhs.document_key() == rhs.document_key() && - lhs.new_document() == rhs.new_document(); -} - -bool operator==(const ExistenceFilterWatchChange& lhs, - const ExistenceFilterWatchChange& rhs) { - return lhs.filter() == rhs.filter() && lhs.target_id() == rhs.target_id(); -} - -bool operator==(const WatchTargetChange& lhs, const WatchTargetChange& rhs) { - return lhs.state() == rhs.state() && lhs.target_ids() == rhs.target_ids() && - lhs.resume_token() == rhs.resume_token() && lhs.cause() == rhs.cause(); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_stream.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_stream.h deleted file mode 100644 index 85cbc637e..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_stream.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WATCH_STREAM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WATCH_STREAM_H_ - -#if !defined(__OBJC__) -#error "This header only supports Objective-C++" -#endif // !defined(__OBJC__) - -#include -#include - -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h" -#include "Firestore/core/src/firebase/firestore/remote/stream.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "absl/strings/string_view.h" -#include "grpcpp/support/byte_buffer.h" - -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - -namespace firebase { -namespace firestore { -namespace remote { - -/** - * An interface defining the events that can be emitted by the `WatchStream`. - */ -class WatchStreamCallback { - public: - /** Called by the `WatchStream` when it is ready to accept outbound request - * messages. */ - virtual void OnWatchStreamOpen() = 0; - - /** - * Called by the `WatchStream` with changes and the snapshot versions - * included in in the `WatchChange` responses sent back by the server. - */ - virtual void OnWatchStreamChange( - const WatchChange& change, - const model::SnapshotVersion& snapshot_version) = 0; - - /** - * Called by the `WatchStream` when the underlying streaming RPC is - * interrupted for whatever reason, usually because of an error, but possibly - * due to an idle timeout. The status passed to this method may be ok, in - * which case the stream was closed without attributable fault. - * - * NOTE: This will not be called after `Stop` is called on the stream. See - * "Starting and Stopping" on `Stream` for details. - */ - virtual void OnWatchStreamClose(const util::Status& status) = 0; -}; - -/** - * A `Stream` that implements the StreamingWatch RPC. - * - * Once the `WatchStream` has called the `OnWatchStreamOpen` method on the - * callback, any number of `WatchQuery` and `UnwatchTargetId` calls can be sent - * to control what changes will be sent from the server for WatchChanges. - */ -class WatchStream : public Stream { - public: - WatchStream(const std::shared_ptr& async_queue, - std::shared_ptr credentials_provider, - FSTSerializerBeta* serializer, - GrpcConnection* grpc_connection, - WatchStreamCallback* callback); - - /** - * Registers interest in the results of the given query. If the query includes - * a resume token, it will be included in the request. Results that affect the - * query will be streamed back as WatchChange messages that reference the - * target ID included in `query`. - */ - virtual /*virtual for tests only*/ void WatchQuery( - const local::QueryData& query); - - /** - * Unregisters interest in the results of the query associated with the given - * `target_id`. - */ - virtual /*virtual for tests only*/ void UnwatchTargetId( - model::TargetId target_id); - - private: - std::unique_ptr CreateGrpcStream( - GrpcConnection* grpc_connection, const auth::Token& token) override; - void TearDown(GrpcStream* grpc_stream) override; - - void NotifyStreamOpen() override; - util::Status NotifyStreamResponse(const grpc::ByteBuffer& message) override; - void NotifyStreamClose(const util::Status& status) override; - - std::string GetDebugName() const override { - return "WatchStream"; - } - - bridge::WatchStreamSerializer serializer_bridge_; - WatchStreamCallback* callback_; -}; - -} // namespace remote -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WATCH_STREAM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_stream.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_stream.mm deleted file mode 100644 index 2d468b6eb..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_stream.mm +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "Firestore/core/src/firebase/firestore/remote/watch_stream.h" - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" - -#import "Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h" - -namespace firebase { -namespace firestore { -namespace remote { - -using auth::CredentialsProvider; -using auth::Token; -using local::QueryData; -using model::TargetId; -using util::AsyncQueue; -using util::TimerId; -using util::Status; - -WatchStream::WatchStream( - const std::shared_ptr& async_queue, - std::shared_ptr credentials_provider, - FSTSerializerBeta* serializer, - GrpcConnection* grpc_connection, - WatchStreamCallback* callback) - : Stream{async_queue, std::move(credentials_provider), grpc_connection, - TimerId::ListenStreamConnectionBackoff, TimerId::ListenStreamIdle}, - serializer_bridge_{serializer}, - callback_{NOT_NULL(callback)} { -} - -void WatchStream::WatchQuery(const QueryData& query) { - EnsureOnQueue(); - - GCFSListenRequest* request = serializer_bridge_.CreateWatchRequest(query); - LOG_DEBUG("%s watch: %s", GetDebugDescription(), - serializer_bridge_.Describe(request)); - Write(serializer_bridge_.ToByteBuffer(request)); -} - -void WatchStream::UnwatchTargetId(TargetId target_id) { - EnsureOnQueue(); - - GCFSListenRequest* request = - serializer_bridge_.CreateUnwatchRequest(target_id); - LOG_DEBUG("%s unwatch: %s", GetDebugDescription(), - serializer_bridge_.Describe(request)); - Write(serializer_bridge_.ToByteBuffer(request)); -} - -std::unique_ptr WatchStream::CreateGrpcStream( - GrpcConnection* grpc_connection, const Token& token) { - return grpc_connection->CreateStream("/google.firestore.v1.Firestore/Listen", - token, this); -} - -void WatchStream::TearDown(GrpcStream* grpc_stream) { - grpc_stream->FinishImmediately(); -} - -void WatchStream::NotifyStreamOpen() { - callback_->OnWatchStreamOpen(); -} - -Status WatchStream::NotifyStreamResponse(const grpc::ByteBuffer& message) { - Status status; - GCFSListenResponse* response = - serializer_bridge_.ParseResponse(message, &status); - if (!status.ok()) { - return status; - } - - if (bridge::IsLoggingEnabled()) { - LOG_DEBUG("%s response: %s", GetDebugDescription(), - serializer_bridge_.Describe(response)); - } - - // A successful response means the stream is healthy. - backoff_.Reset(); - - callback_->OnWatchStreamChange( - *serializer_bridge_.ToWatchChange(response), - serializer_bridge_.ToSnapshotVersion(response)); - return Status::OK(); -} - -void WatchStream::NotifyStreamClose(const Status& status) { - callback_->OnWatchStreamClose(status); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/write_stream.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/write_stream.mm deleted file mode 100644 index 52ecb8897..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/write_stream.mm +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include - -#include "Firestore/core/src/firebase/firestore/remote/write_stream.h" - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" - -#import "Firestore/Protos/objc/google/firestore/v1/Firestore.pbobjc.h" - -namespace firebase { -namespace firestore { -namespace remote { - -using auth::CredentialsProvider; -using auth::Token; -using model::Mutation; -using nanopb::ByteString; -using util::AsyncQueue; -using util::TimerId; -using util::Status; - -WriteStream::WriteStream( - const std::shared_ptr& async_queue, - std::shared_ptr credentials_provider, - FSTSerializerBeta* serializer, - GrpcConnection* grpc_connection, - WriteStreamCallback* callback) - : Stream{async_queue, std::move(credentials_provider), grpc_connection, - TimerId::WriteStreamConnectionBackoff, TimerId::WriteStreamIdle}, - serializer_bridge_{serializer}, - callback_{NOT_NULL(callback)} { -} - -void WriteStream::SetLastStreamToken(const ByteString& token) { - serializer_bridge_.SetLastStreamToken(token); -} - -ByteString WriteStream::GetLastStreamToken() const { - return serializer_bridge_.GetLastStreamToken(); -} - -void WriteStream::WriteHandshake() { - EnsureOnQueue(); - HARD_ASSERT(IsOpen(), "Writing handshake requires an opened stream"); - HARD_ASSERT(!handshake_complete(), "Handshake already completed"); - - GCFSWriteRequest* request = serializer_bridge_.CreateHandshake(); - LOG_DEBUG("%s initial request: %s", GetDebugDescription(), - serializer_bridge_.Describe(request)); - Write(serializer_bridge_.ToByteBuffer(request)); - - // TODO(dimond): Support stream resumption. We intentionally do not set the - // stream token on the handshake, ignoring any stream token we might have. -} - -void WriteStream::WriteMutations(const std::vector& mutations) { - EnsureOnQueue(); - HARD_ASSERT(IsOpen(), "Writing mutations requires an opened stream"); - HARD_ASSERT(handshake_complete(), - "Handshake must be complete before writing mutations"); - - GCFSWriteRequest* request = - serializer_bridge_.CreateWriteMutationsRequest(mutations); - LOG_DEBUG("%s write request: %s", GetDebugDescription(), - serializer_bridge_.Describe(request)); - Write(serializer_bridge_.ToByteBuffer(request)); -} - -std::unique_ptr WriteStream::CreateGrpcStream( - GrpcConnection* grpc_connection, const Token& token) { - return grpc_connection->CreateStream("/google.firestore.v1.Firestore/Write", - token, this); -} - -void WriteStream::TearDown(GrpcStream* grpc_stream) { - if (handshake_complete()) { - // Send an empty write request to the backend to indicate imminent stream - // closure. This isn't mandatory, but it allows the backend to clean up - // resources. - GCFSWriteRequest* request = serializer_bridge_.CreateEmptyMutationsList(); - grpc_stream->WriteAndFinish(serializer_bridge_.ToByteBuffer(request)); - } else { - grpc_stream->FinishImmediately(); - } -} - -void WriteStream::NotifyStreamOpen() { - callback_->OnWriteStreamOpen(); -} - -void WriteStream::NotifyStreamClose(const Status& status) { - callback_->OnWriteStreamClose(status); - // Delegate's logic might depend on whether handshake was completed, so only - // reset it after notifying. - handshake_complete_ = false; -} - -Status WriteStream::NotifyStreamResponse(const grpc::ByteBuffer& message) { - Status status; - GCFSWriteResponse* response = - serializer_bridge_.ParseResponse(message, &status); - if (!status.ok()) { - return status; - } - - LOG_DEBUG("%s response: %s", GetDebugDescription(), - serializer_bridge_.Describe(response)); - - // Always capture the last stream token. - serializer_bridge_.UpdateLastStreamToken(response); - - if (!handshake_complete()) { - // The first response is the handshake response - handshake_complete_ = true; - callback_->OnWriteStreamHandshakeComplete(); - } else { - // A successful first write response means the stream is healthy. - // Note that we could consider a successful handshake healthy, however, the - // write itself might be causing an error we want to back off from. - backoff_.Reset(); - - callback_->OnWriteStreamMutationResult( - serializer_bridge_.ToCommitVersion(response), - serializer_bridge_.ToMutationResults(response)); - } - - return Status::OK(); -} - -} // namespace remote -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/async_queue.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/async_queue.cc deleted file mode 100644 index 23415f4c9..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/async_queue.cc +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" - -#include - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "absl/algorithm/container.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace util { - -AsyncQueue::AsyncQueue(std::unique_ptr executor) - : executor_{std::move(executor)} { - is_operation_in_progress_ = false; -} - -// TODO(varconst): assert in destructor that the queue is empty. - -void AsyncQueue::VerifyIsCurrentExecutor() const { - HARD_ASSERT( - executor_->IsCurrentExecutor(), - "Expected to be called by the executor associated with this queue " - "(expected executor: '%s', actual executor: '%s')", - executor_->Name(), executor_->CurrentExecutorName()); -} - -void AsyncQueue::VerifyIsCurrentQueue() const { - VerifyIsCurrentExecutor(); - HARD_ASSERT(is_operation_in_progress_, - "VerifyIsCurrentQueue called when no operation is executing " - "(expected executor: '%s', actual executor: '%s')", - executor_->Name(), executor_->CurrentExecutorName()); -} - -void AsyncQueue::ExecuteBlocking(const Operation& operation) { - // This is not guarded by `is_shutting_down_` because it is the execution - // of the operation, not scheduling. Checking `is_shutting_down_` here - // would mean *all* operations will not run after shutdown, which is not - // intended. - VerifyIsCurrentExecutor(); - HARD_ASSERT(!is_operation_in_progress_, - "ExecuteBlocking may not be called " - "before the previous operation finishes executing"); - - is_operation_in_progress_ = true; - operation(); - is_operation_in_progress_ = false; -} - -void AsyncQueue::Enqueue(const Operation& operation) { - VerifySequentialOrder(); - EnqueueRelaxed(operation); -} - -void AsyncQueue::EnqueueAndInitiateShutdown(const Operation& operation) { - std::lock_guard lock{shut_down_mutex_}; - VerifySequentialOrder(); - if (is_shutting_down_) { - return; - } - executor_->Execute(Wrap(operation)); - is_shutting_down_ = true; -} - -void AsyncQueue::EnqueueEvenAfterShutdown(const Operation& operation) { - // Still guarding the lock to ensure sequential scheduling. - std::lock_guard lock{shut_down_mutex_}; - VerifySequentialOrder(); - executor_->Execute(Wrap(operation)); -} - -bool AsyncQueue::is_shutting_down() const { - std::lock_guard lock{shut_down_mutex_}; - return is_shutting_down_; -} - -void AsyncQueue::EnqueueRelaxed(const Operation& operation) { - std::lock_guard lock{shut_down_mutex_}; - if (is_shutting_down_) { - return; - } - executor_->Execute(Wrap(operation)); -} - -DelayedOperation AsyncQueue::EnqueueAfterDelay(Milliseconds delay, - const TimerId timer_id, - const Operation& operation) { - std::lock_guard lock{shut_down_mutex_}; - VerifyIsCurrentExecutor(); - - if (is_shutting_down_) { - return DelayedOperation(); - } - - // Skip delays for timer_ids that have been overriden - if (absl::c_linear_search(timer_ids_to_skip_, timer_id)) { - delay = Milliseconds(0); - } - - Executor::TaggedOperation tagged{static_cast(timer_id), Wrap(operation)}; - return executor_->Schedule(delay, std::move(tagged)); -} - -AsyncQueue::Operation AsyncQueue::Wrap(const Operation& operation) { - // Decorator pattern: wrap `operation` into a call to `ExecuteBlocking` to - // ensure that it doesn't spawn any nested operations. - - // Note: can't move `operation` into lambda until C++14. - return [this, operation] { ExecuteBlocking(operation); }; -} - -void AsyncQueue::VerifySequentialOrder() const { - // This is the inverse of `VerifyIsCurrentQueue`. - HARD_ASSERT(!is_operation_in_progress_ || !executor_->IsCurrentExecutor(), - "Enqueue methods cannot be called when we are already running on " - "target executor " - "(this queue's executor: '%s', current executor: '%s')", - executor_->Name(), executor_->CurrentExecutorName()); -} - -// Test-only functions - -void AsyncQueue::EnqueueBlocking(const Operation& operation) { - VerifySequentialOrder(); - executor_->ExecuteBlocking(Wrap(operation)); -} - -bool AsyncQueue::IsScheduled(const TimerId timer_id) const { - return executor_->IsScheduled(static_cast(timer_id)); -} - -void AsyncQueue::RunScheduledOperationsUntil(const TimerId last_timer_id) { - HARD_ASSERT(!executor_->IsCurrentExecutor(), - "RunScheduledOperationsUntil must not be called on the queue"); - - executor_->ExecuteBlocking([this, last_timer_id] { - HARD_ASSERT( - last_timer_id == TimerId::All || IsScheduled(last_timer_id), - "Attempted to run scheduled operations until missing timer id: %s", - last_timer_id); - - for (auto next = executor_->PopFromSchedule(); next.has_value(); - next = executor_->PopFromSchedule()) { - next->operation(); - if (next->tag == static_cast(last_timer_id)) { - break; - } - } - }); -} - -void AsyncQueue::SkipDelaysForTimerId(TimerId timer_id) { - timer_ids_to_skip_.push_back(timer_id); -} - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/async_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/async_queue.h deleted file mode 100644 index aaa87c5aa..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/async_queue.h +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ASYNC_QUEUE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ASYNC_QUEUE_H_ - -#include -#include // NOLINT(build/c++11) -#include -#include -#include // NOLINT(build/c++11) -#include - -#include "Firestore/core/src/firebase/firestore/util/executor.h" - -namespace firebase { -namespace firestore { -namespace util { - -/** - * Well-known "timer" ids used when scheduling delayed operations on the - * AsyncQueue. These ids can then be used from tests to check for the - * presence of delayed operations or to run them early. - */ -enum class TimerId { - /** All can be used with `RunScheduledOperationsUntil` to run all timers. */ - All, - - /** - * The following 4 timers are used in `Stream` for the listen and write - * streams. The "Idle" timer is used to close the stream due to inactivity. - * The "ConnectionBackoff" timer is used to restart a stream once the - * appropriate backoff delay has elapsed. - */ - ListenStreamIdle, - ListenStreamConnectionBackoff, - WriteStreamIdle, - WriteStreamConnectionBackoff, - - /** - * A timer used in `OnlineStateTracker` to transition from - * `OnlineStateUnknown` to `Offline` after a set timeout, rather than waiting - * indefinitely for success or failure. - */ - OnlineStateTimeout, - - /** - * A timer used to periodically attempt LRU Garbage collection - */ - GarbageCollectionDelay, - - /** - * A timer used to retry transactions. Since there can be multiple concurrent - * transactions, multiple of these may be in the queue at a given time. - */ - RetryTransaction -}; - -// A serial queue that executes given operations asynchronously, one at a time. -// Operations may be scheduled to be executed as soon as possible or in the -// future. Operations scheduled for the same time are FIFO-ordered. -// -// `AsyncQueue` wraps a platform-specific executor, adding checks that enforce -// sequential ordering of operations: an enqueued operation, while being run, -// normally cannot enqueue other operations for immediate execution (but see -// `EnqueueRelaxed`). -// -// `AsyncQueue` methods have particular expectations about whether they must be -// invoked on the queue or not; check "preconditions" section in comments on -// each method. -// -// A significant portion of `AsyncQueue` interface only exists for test purposes -// and must *not* be used in regular code. -class AsyncQueue { - public: - using Operation = Executor::Operation; - using Milliseconds = Executor::Milliseconds; - - explicit AsyncQueue(std::unique_ptr executor); - - // Asserts for the caller that it is being invoked as part of an operation on - // the `AsyncQueue`. - void VerifyIsCurrentQueue() const; - - // Enqueue methods - - // Puts the `operation` on the queue to be executed as soon as possible, while - // maintaining FIFO order. - // - // Precondition: `Enqueue` calls cannot be nested; that is, `Enqueue` may not - // be called by a previously enqueued operation when it is run (as a special - // case, destructors invoked when an enqueued operation has run and is being - // destroyed may invoke `Enqueue`). - // - // After the shutdown process has initiated (`is_shutting_down()` is true), - // calling `Enqueue` is a no-op. - void Enqueue(const Operation& operation); - - // Like `Enqueue`, but also starts the shutdown process. Once the shutdown - // process has started, calling any Enqueue* methods becomes a no-op - // - // The exception is `EnqueueEvenAfterShutdown`, operations requsted via - // this will still be scheduled. - void EnqueueAndInitiateShutdown(const Operation& operation); - - // Like `Enqueue`, but it will proceed scheduling the requested operation - // regardless of whether the queue is shut down or not. - void EnqueueEvenAfterShutdown(const Operation& operation); - - // Like `Enqueue`, but without applying any prerequisite checks. - void EnqueueRelaxed(const Operation& operation); - - // Whether the queue has initiated its shutdown process. - bool is_shutting_down() const; - - // Puts the `operation` on the queue to be executed `delay` milliseconds from - // now, and returns a handle that allows to cancel the operation (provided it - // hasn't run already). - // - // `operation` is tagged by a `timer_id` which allows to identify the caller. - // Only one operation tagged with any given `timer_id` may be on the queue at - // any time; an attempt to put another such operation will result in an - // assertion failure. In tests, these tags also allow to check for presence of - // certain operations and to run certain operations in advance. - // - // Precondition: `EnqueueAfterDelay` is being invoked asynchronously on the - // queue. - DelayedOperation EnqueueAfterDelay(Milliseconds delay, - TimerId timer_id, - const Operation& operation); - - // Direct execution - - // Immediately executes the `operation` on the queue. - // - // This is largely a workaround to allow other classes (GRPC) to directly - // access the underlying dispatch queue without getting `AsyncQueue` into an - // inconsistent state. - // - // Precondition: no other operation is being executed on the queue at the - // moment of the call (i.e., `ExecuteBlocking` cannot call `ExecuteBlocking`). - // - // Precondition: `ExecuteBlocking` is being invoked asynchronously on the - // queue. - void ExecuteBlocking(const Operation& operation); - - // Returns the underlying platform-dependent executor. - Executor* executor() { - return executor_.get(); - } - - // Test-only interface follows - // TODO(varconst): move the test-only interface into a helper object that is - // a friend of AsyncQueue and delegates its public methods to private methods - // on AsyncQueue. - - // Like `Enqueue`, but blocks until the `operation` is complete. - void EnqueueBlocking(const Operation& operation); - - // Checks whether an operation tagged with `timer_id` is currently scheduled - // for execution in the future. - bool IsScheduled(TimerId timer_id) const; - - // Force runs operations scheduled for future execution, in scheduled order, - // up to *and including* the operation tagged with `last_timer_id`. - // - // Precondition: `RunScheduledOperationsUntil` is *not* being invoked on the - // queue. - void RunScheduledOperationsUntil(TimerId last_timer_id); - - // For tests: Skip all subsequent delays for a specific TimerId. - // NOTE: This does not work with TimerId::All. - void SkipDelaysForTimerId(TimerId timer_id); - - private: - Operation Wrap(const Operation& operation); - - // Asserts that the current invocation happens asynchronously on the queue. - void VerifyIsCurrentExecutor() const; - void VerifySequentialOrder() const; - - std::atomic is_operation_in_progress_; - std::unique_ptr executor_; - - bool is_shutting_down_ = false; - mutable std::mutex shut_down_mutex_; - - std::vector timer_ids_to_skip_; -}; - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ASYNC_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/bits.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/bits.h deleted file mode 100644 index 591c30626..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/bits.h +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_BITS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_BITS_H_ - -// Various bit-twiddling functions, all of which are static members of the Bits -// class (making it effectively a namespace). Operands are unsigned integers. -// Munging bits in _signed_ integers is fraught with peril! For example, -// -5 << n has undefined behavior (for some values of n). - -#include - -namespace firebase { -namespace firestore { -namespace util { - -class Bits_Port32_Test; -class Bits_Port64_Test; - -class Bits { - public: - /** Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. */ - static int Log2Floor(uint32_t n); - static int Log2Floor64(uint64_t n); - - /** - * Potentially faster version of Log2Floor() that returns an - * undefined value if n == 0. - */ - static int Log2FloorNonZero(uint32_t n); - static int Log2FloorNonZero64(uint64_t n); - - private: - // Portable implementations. - static int Log2Floor_Portable(uint32_t n); - static int Log2Floor64_Portable(uint64_t n); - static int Log2FloorNonZero_Portable(uint32_t n); - static int Log2FloorNonZero64_Portable(uint64_t n); - - Bits(Bits const&) = delete; - void operator=(Bits const&) = delete; - - // Allow tests to call _Portable variants directly. - friend class Bits_Port32_Test; - friend class Bits_Port64_Test; -}; - -// ------------------------------------------------------------------------ -// Implementation details follow -// ------------------------------------------------------------------------ - -#if defined(__GNUC__) - -inline int Bits::Log2Floor(uint32_t n) { - return n == 0 ? -1 : 31 ^ __builtin_clz(n); -} - -inline int Bits::Log2FloorNonZero(uint32_t n) { - return 31 ^ __builtin_clz(n); -} - -inline int Bits::Log2Floor64(uint64_t n) { - return n == 0 ? -1 : 63 ^ __builtin_clzll(n); -} - -inline int Bits::Log2FloorNonZero64(uint64_t n) { - return 63 ^ __builtin_clzll(n); -} - -#elif defined(_MSC_VER) - -inline int Bits::Log2FloorNonZero(uint32_t n) { -#ifdef _M_IX86 - _asm { - bsr ebx, n - mov n, ebx - } - return n; -#else - return Bits::Log2FloorNonZero_Portable(n); -#endif -} - -inline int Bits::Log2Floor(uint32_t n) { -#ifdef _M_IX86 - _asm { - xor ebx, ebx - mov eax, n - and eax, eax - jz return_ebx - bsr ebx, eax - return_ebx: - mov n, ebx - } - return n; -#else - return Bits::Log2Floor_Portable(n); -#endif -} - -inline int Bits::Log2Floor64(uint64_t n) { - return Bits::Log2Floor64_Portable(n); -} - -inline int Bits::Log2FloorNonZero64(uint64_t n) { - return Bits::Log2FloorNonZero64_Portable(n); -} - -#else // !__GNUC__ && !_MSC_VER - -inline int Bits::Log2Floor64(uint64_t n) { - return Bits::Log2Floor64_Portable(n); -} - -inline int Bits::Log2FloorNonZero64(uint64_t n) { - return Bits::Log2FloorNonZero64_Portable(n); -} - -#endif - -inline int Bits::Log2FloorNonZero_Portable(uint32_t n) { - // Just use the common routine - return Log2Floor(n); -} - -// Log2Floor64() is defined in terms of Log2Floor32(), Log2FloorNonZero32() -inline int Bits::Log2Floor64_Portable(uint64_t n) { - const auto top_bits = static_cast(n >> 32); - if (top_bits == 0) { - // Top bits are zero, so scan in bottom bits - return Log2Floor(static_cast(n)); - } else { - return 32 + Log2FloorNonZero(top_bits); - } -} - -// Log2FloorNonZero64() is defined in terms of Log2FloorNonZero32() -inline int Bits::Log2FloorNonZero64_Portable(uint64_t n) { - const auto top_bits = static_cast(n >> 32); - if (top_bits == 0) { - // Top bits are zero, so scan in bottom bits - return Log2FloorNonZero(static_cast(n)); - } else { - return 32 + Log2FloorNonZero(top_bits); - } -} - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_BITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/config.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/config.h deleted file mode 100644 index 17f04b007..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/config.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_CONFIG_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_CONFIG_H_ - -// This header defines macros for all available platform configuration values. -// When building with CMake, it will substitute the lines marked with -// cmakedefine with values corresponding to the local configuration. -// -// On Apple platforms we support building via CocoaPods without CMake. When -// building this way we can't test the presence of features before building so -// predefine all the platform-support feature macros to their expected values. - -#if COCOAPODS -# define HAVE_ARC4RANDOM 1 -#endif - - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_CONFIG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/config.h.in b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/config.h.in deleted file mode 100644 index e7a0c039c..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/config.h.in +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_CONFIG_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_CONFIG_H_ - -// This header defines macros for all available platform configuration values. -// When building with CMake, it will substitute the lines marked with -// cmakedefine with values corresponding to the local configuration. -// -// On Apple platforms we support building via CocoaPods without CMake. When -// building this way we can't test the presence of features before building so -// predefine all the platform-support feature macros to their expected values. - -#cmakedefine HAVE_ARC4RANDOM 1 -#if COCOAPODS -# define HAVE_ARC4RANDOM 1 -#endif - -#cmakedefine HAVE_OPENSSL_RAND_H 1 - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_CONFIG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor.h deleted file mode 100644 index c260a28a4..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor.h +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_H_ - -#include // NOLINT(build/c++11) -#include -#include -#include -#include - -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace util { - -// A handle to an operation scheduled for future execution. The handle may -// outlive the operation, but it *cannot* outlive the executor that created it. -class DelayedOperation { - public: - // Creates an empty `DelayedOperation` not associated with any actual - // operation. Calling `Cancel` on it is a no-op. - DelayedOperation() { - } - - // Returns whether this `DelayedOperation` is associated with an actual - // operation. - explicit operator bool() const { - return static_cast(cancel_func_); - } - - // If the operation has not been run yet, cancels the operation. Otherwise, - // this function is a no-op. - void Cancel() { - if (cancel_func_) { - cancel_func_(); - cancel_func_ = {}; - } - } - - // Internal use only. - explicit DelayedOperation(std::function&& cancel_func) - : cancel_func_{std::move(cancel_func)} { - } - - private: - std::function cancel_func_; -}; - -// An interface to a platform-specific executor of asynchronous operations -// (called tasks on other platforms). -// -// Operations may be scheduled for immediate or delayed execution. Operations -// delayed until the exact same time are scheduled in FIFO order. -// -// The operations are executed sequentially; only a single operation is executed -// at any given time. -// -// Delayed operations may be canceled if they have not already been run. -class Executor { - public: - using Tag = int; - using Operation = std::function; - using Milliseconds = std::chrono::milliseconds; - - // Operations scheduled for future execution have an opaque tag. The value of - // the tag is ignored by the executor but can be used to find operations with - // a given tag after they are scheduled. - struct TaggedOperation { - TaggedOperation() { - } - TaggedOperation(const Tag tag, Operation&& operation) - : tag{tag}, operation{std::move(operation)} { - } - Tag tag = 0; - Operation operation; - }; - - // Creates a new serial Executor of the platform-appropriate type, and gives - // it the given label, if the implementation supports it. - // - // Note that this method has multiple definitions, depending on the platform. - static std::unique_ptr CreateSerial(const char* label); - - virtual ~Executor() { - } - - // Schedules the `operation` to be asynchronously executed as soon as - // possible, in FIFO order. - virtual void Execute(Operation&& operation) = 0; - // Like `Execute`, but blocks until the `operation` finishes, consequently - // draining immediate operations from the executor. - virtual void ExecuteBlocking(Operation&& operation) = 0; - // Scheduled the given `operation` to be executed after `delay` milliseconds - // from now, and returns a handle that allows to cancel the operation - // (provided it hasn't been run already). The operation is tagged to allow - // retrieving it later. - // - // `delay` must be non-negative; use `Execute` to schedule operations for - // immediate execution. - virtual DelayedOperation Schedule(Milliseconds delay, - TaggedOperation&& operation) = 0; - - // Checks for the caller whether it is being invoked by this executor. - virtual bool IsCurrentExecutor() const = 0; - // Returns some sort of an identifier for the current execution context. The - // only guarantee is that it will return different values depending on whether - // this function is invoked by this executor or not. - virtual std::string CurrentExecutorName() const = 0; - // Like `CurrentExecutorName`, but returns an identifier for this executor, - // whether the caller code currently runs on this executor or not. - virtual std::string Name() const = 0; - - // Checks whether an operation tagged with the given `tag` is currently - // scheduled for future execution. - virtual bool IsScheduled(Tag tag) const = 0; - // Removes the nearest due scheduled operation from the schedule and returns - // it to the caller. This function may be used to reschedule operations. - // Immediate operations don't count; only operations scheduled for delayed - // execution may be removed. If no such operations are currently scheduled, an - // empty `optional` is returned. - virtual absl::optional PopFromSchedule() = 0; -}; - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_libdispatch.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_libdispatch.h deleted file mode 100644 index 459fa4e6d..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_libdispatch.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_LIBDISPATCH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_LIBDISPATCH_H_ - -#include // NOLINT(build/c++11) -#include -#include -#include -#include -#include -#include "dispatch/dispatch.h" - -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "absl/strings/string_view.h" - -#if !defined(__OBJC__) -// `dispatch_queue_t` gets defined to different types when compiled in C++ or -// Objective-C mode. Source files including this header should all be compiled -// in the same mode to avoid linker errors. -#error "This header only supports Objective-C++ (see comment for more info)." -#endif // !defined(__OBJC__) - -namespace firebase { -namespace firestore { -namespace util { - -namespace internal { - -// Generic wrapper over `dispatch_async_f`, providing `dispatch_async`-like -// interface: accepts an arbitrary invocable object in place of an Objective-C -// block. -void DispatchAsync(dispatch_queue_t queue, std::function&& work); - -// Similar to `DispatchAsync` but wraps `dispatch_sync_f`. -void DispatchSync(dispatch_queue_t queue, std::function work); - -} // namespace internal - -class TimeSlot; - -// A serial queue built on top of libdispatch. The operations are run on -// a dedicated serial dispatch queue. -class ExecutorLibdispatch : public Executor { - public: - explicit ExecutorLibdispatch(dispatch_queue_t dispatch_queue); - ~ExecutorLibdispatch(); - - bool IsCurrentExecutor() const override; - std::string CurrentExecutorName() const override; - std::string Name() const override; - - void Execute(Operation&& operation) override; - void ExecuteBlocking(Operation&& operation) override; - DelayedOperation Schedule(Milliseconds delay, - TaggedOperation&& operation) override; - - void RemoveFromSchedule(const TimeSlot* to_remove); - - bool IsScheduled(Tag tag) const override; - absl::optional PopFromSchedule() override; - - dispatch_queue_t dispatch_queue() const { - return dispatch_queue_; - } - - private: - dispatch_queue_t dispatch_queue_; - // Stores non-owned pointers to `TimeSlot`s. - // Invariant: if a `TimeSlot` is in `schedule_`, it's a valid pointer. - std::vector schedule_; -}; - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_LIBDISPATCH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_libdispatch.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_libdispatch.mm deleted file mode 100644 index e37f73e99..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_libdispatch.mm +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/executor_libdispatch.h" - -#include - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -namespace firebase { -namespace firestore { -namespace util { - -namespace { - -absl::string_view StringViewFromDispatchLabel(const char* const label) { - // Make sure string_view's data is not null, because it's used for logging. - return label ? absl::string_view{label} : absl::string_view{""}; -} - -// GetLabel functions are guaranteed to never return a "null" string_view -// (i.e. data() != nullptr). -absl::string_view GetQueueLabel(const dispatch_queue_t queue) { - return StringViewFromDispatchLabel(dispatch_queue_get_label(queue)); -} -absl::string_view GetCurrentQueueLabel() { - // Note: dispatch_queue_get_label may return nullptr if the queue wasn't - // initialized with a label. - return StringViewFromDispatchLabel( - dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)); -} - -} // namespace - -namespace internal { - -void DispatchAsync(const dispatch_queue_t queue, std::function&& work) { - // Dynamically allocate the function to make sure the object is valid by the - // time libdispatch gets to it. - const auto wrap = new std::function{std::move(work)}; - - dispatch_async_f(queue, wrap, [](void* const raw_work) { - const auto unwrap = static_cast*>(raw_work); - (*unwrap)(); - delete unwrap; - }); -} - -void DispatchSync(const dispatch_queue_t queue, std::function work) { - HARD_ASSERT( - GetCurrentQueueLabel() != GetQueueLabel(queue), - "Calling DispatchSync on the current queue will lead to a deadlock."); - - // Unlike dispatch_async_f, dispatch_sync_f blocks until the work passed to it - // is done, so passing a reference to a local variable is okay. - dispatch_sync_f(queue, &work, [](void* const raw_work) { - const auto unwrap = static_cast*>(raw_work); - (*unwrap)(); - }); -} - -} // namespace internal - -namespace { - -using internal::DispatchAsync; -using internal::DispatchSync; - -template -void RunSynchronized(const ExecutorLibdispatch* const executor, Work&& work) { - if (executor->IsCurrentExecutor()) { - work(); - } else { - DispatchSync(executor->dispatch_queue(), std::forward(work)); - } -} - -} // namespace - -// MARK: - TimeSlot - -// Represents a "busy" time slot on the schedule. -// -// Since libdispatch doesn't provide a way to cancel a scheduled operation, once -// a slot is created, it will always stay in the schedule until the time is -// past. Consequently, it is more useful to think of a time slot than -// a particular scheduled operation -- by the time the slot comes, operation may -// or may not be there (imagine getting to a meeting and finding out it's been -// canceled). -// -// Precondition: all member functions, including the constructor, are *only* -// invoked on the Firestore queue. -// -// Ownership: -// -// - `TimeSlot` is exclusively owned by libdispatch; -// - `ExecutorLibdispatch` contains non-owning pointers to `TimeSlot`s; -// - invariant: if the executor contains a pointer to a `TimeSlot`, it is -// a valid object. It is achieved because when libdispatch invokes -// a `TimeSlot`, it always removes it from the executor before deleting it. -// The reverse is not true: a canceled time slot is removed from the executor, -// but won't be destroyed until its original due time is past. - -class TimeSlot { - public: - TimeSlot(ExecutorLibdispatch* executor, - Executor::Milliseconds delay, - Executor::TaggedOperation&& operation); - - // Returns the operation that was scheduled for this time slot and turns the - // slot into a no-op. - Executor::TaggedOperation Unschedule(); - - bool operator<(const TimeSlot& rhs) const { - return target_time_ < rhs.target_time_; - } - bool operator==(const Executor::Tag tag) const { - return tagged_.tag == tag; - } - - void MarkDone() { - done_ = true; - } - - static void InvokedByLibdispatch(void* const raw_self); - - private: - void Execute(); - void RemoveFromSchedule(); - - using TimePoint = std::chrono::time_point; - - ExecutorLibdispatch* const executor_; - const TimePoint target_time_; // Used for sorting - Executor::TaggedOperation tagged_; - - // True if the operation has either been run or canceled. - // - // Note on thread-safety: this variable is accessed both from the dispatch - // queue and in the destructor, which may run on any queue. - std::atomic done_; -}; - -TimeSlot::TimeSlot(ExecutorLibdispatch* const executor, - const Executor::Milliseconds delay, - Executor::TaggedOperation&& operation) - : executor_{executor}, - target_time_{std::chrono::time_point_cast( - std::chrono::steady_clock::now()) + - delay}, - tagged_{std::move(operation)} { - // Only assignment of std::atomic is atomic; initialization in its constructor - // isn't - done_ = false; -} - -Executor::TaggedOperation TimeSlot::Unschedule() { - if (!done_) { - RemoveFromSchedule(); - } - return std::move(tagged_); -} - -void TimeSlot::InvokedByLibdispatch(void* const raw_self) { - auto const self = static_cast(raw_self); - self->Execute(); - delete self; -} - -void TimeSlot::Execute() { - if (done_) { - // `done_` might mean that the executor is already destroyed, so don't call - // `RemoveFromSchedule`. - return; - } - - RemoveFromSchedule(); - - HARD_ASSERT(tagged_.operation, - "TimeSlot contains an invalid function object"); - tagged_.operation(); -} - -void TimeSlot::RemoveFromSchedule() { - executor_->RemoveFromSchedule(this); -} - -// MARK: - ExecutorLibdispatch - -ExecutorLibdispatch::ExecutorLibdispatch(const dispatch_queue_t dispatch_queue) - : dispatch_queue_{dispatch_queue} { -} - -ExecutorLibdispatch::~ExecutorLibdispatch() { - // Turn any operations that might still be in the queue into no-ops, lest - // they try to access `ExecutorLibdispatch` after it gets destroyed. Because - // the queue is serial, by the time libdispatch gets to the newly-enqueued - // work, the pending operations that might have been in progress would have - // already finished. - // Note: this is thread-safe, because the underlying variable `done_` is - // atomic. `RunSynchronized` may result in a deadlock. - for (auto slot : schedule_) { - slot->MarkDone(); - } -} - -bool ExecutorLibdispatch::IsCurrentExecutor() const { - return GetCurrentQueueLabel() == GetQueueLabel(dispatch_queue()); -} -std::string ExecutorLibdispatch::CurrentExecutorName() const { - return GetCurrentQueueLabel().data(); -} -std::string ExecutorLibdispatch::Name() const { - return GetQueueLabel(dispatch_queue()).data(); -} - -void ExecutorLibdispatch::Execute(Operation&& operation) { - DispatchAsync(dispatch_queue(), std::move(operation)); -} -void ExecutorLibdispatch::ExecuteBlocking(Operation&& operation) { - DispatchSync(dispatch_queue(), std::move(operation)); -} - -DelayedOperation ExecutorLibdispatch::Schedule(const Milliseconds delay, - TaggedOperation&& operation) { - namespace chr = std::chrono; - const dispatch_time_t delay_ns = dispatch_time( - DISPATCH_TIME_NOW, chr::duration_cast(delay).count()); - - // Ownership is fully transferred to libdispatch -- because it's impossible - // to truly cancel work after it's been dispatched, libdispatch is - // guaranteed to outlive the executor, and it's possible for work to be - // invoked by libdispatch after the executor is destroyed. Executor only - // stores an observer pointer to the operation. - - auto const time_slot = new TimeSlot{this, delay, std::move(operation)}; - dispatch_after_f(delay_ns, dispatch_queue(), time_slot, - TimeSlot::InvokedByLibdispatch); - RunSynchronized(this, [this, time_slot] { schedule_.push_back(time_slot); }); - return DelayedOperation{[this, time_slot] { - // `time_slot` might be destroyed by the time cancellation function runs. - // Therefore, don't access any methods on `time_slot`, only use it as - // a handle to remove from `schedule_`. - RemoveFromSchedule(time_slot); - }}; -} - -void ExecutorLibdispatch::RemoveFromSchedule(const TimeSlot* const to_remove) { - RunSynchronized(this, [this, to_remove] { - const auto found = std::find_if( - schedule_.begin(), schedule_.end(), - [to_remove](const TimeSlot* op) { return op == to_remove; }); - // It's possible for the operation to be missing if libdispatch gets to run - // it after it was force-run, for example. - if (found != schedule_.end()) { - (*found)->MarkDone(); - schedule_.erase(found); - } - }); -} - -// Test-only methods - -bool ExecutorLibdispatch::IsScheduled(const Tag tag) const { - bool result = false; - RunSynchronized(this, [this, tag, &result] { - result = std::any_of( - schedule_.begin(), schedule_.end(), - [&tag](const TimeSlot* const operation) { return *operation == tag; }); - }); - return result; -} - -absl::optional -ExecutorLibdispatch::PopFromSchedule() { - absl::optional result; - - RunSynchronized(this, [this, &result] { - if (schedule_.empty()) { - return; - } - // Sorting upon each call to `PopFromSchedule` is inefficient, which is - // consciously ignored because this function is only ever called from tests. - std::sort( - schedule_.begin(), schedule_.end(), - [](const TimeSlot* lhs, const TimeSlot* rhs) { return *lhs < *rhs; }); - const auto nearest = schedule_.begin(); - result = (*nearest)->Unschedule(); - }); - - return result; -} - -// MARK: - Executor - -std::unique_ptr Executor::CreateSerial(const char* label) { - dispatch_queue_t queue = dispatch_queue_create(label, DISPATCH_QUEUE_SERIAL); - return absl::make_unique(queue); -} - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_std.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_std.cc deleted file mode 100644 index 0d03d4d94..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_std.cc +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/executor_std.h" - -#include // NOLINT(build/c++11) -#include -#include - -namespace firebase { -namespace firestore { -namespace util { - -namespace { - -// The only guarantee is that different `thread_id`s will produce different -// values. -std::string ThreadIdToString(const std::thread::id thread_id) { - std::ostringstream stream; - stream << thread_id; - return stream.str(); -} - -} // namespace - -// MARK: - ExecutorStd - -ExecutorStd::ExecutorStd() { - // Somewhat counter-intuitively, constructor of `std::atomic` assigns the - // value non-atomically, so the atomic initialization must be provided here, - // before the worker thread is started. - // See [this thread](https://stackoverflow.com/questions/25609858) for context - // on the constructor. - current_id_ = 0; - shutting_down_ = false; - worker_thread_ = std::thread{&ExecutorStd::PollingThread, this}; -} - -ExecutorStd::~ExecutorStd() { - shutting_down_ = true; - // Make sure the worker thread is not blocked, so that the call to `join` - // doesn't hang. - UnblockQueue(); - worker_thread_.join(); -} - -void ExecutorStd::Execute(Operation&& operation) { - PushOnSchedule(std::move(operation), Immediate()); -} - -DelayedOperation ExecutorStd::Schedule(const Milliseconds delay, - TaggedOperation&& tagged) { - // While negative delay can be interpreted as a request for immediate - // execution, supporting it would provide a hacky way to modify FIFO ordering - // of immediate operations. - HARD_ASSERT(delay.count() >= 0, "Schedule: delay cannot be negative"); - - namespace chr = std::chrono; - const auto now = chr::time_point_cast(chr::steady_clock::now()); - const auto id = - PushOnSchedule(std::move(tagged.operation), now + delay, tagged.tag); - - return DelayedOperation{[this, id] { TryCancel(id); }}; -} - -void ExecutorStd::TryCancel(const Id operation_id) { - schedule_.RemoveIf( - [operation_id](const Entry& e) { return e.id == operation_id; }); -} - -ExecutorStd::Id ExecutorStd::PushOnSchedule(Operation&& operation, - const TimePoint when, - const Tag tag) { - // Note: operations scheduled for immediate execution don't actually need an - // id. This could be tweaked to reuse the same id for all such operations. - const auto id = NextId(); - schedule_.Push(Entry{std::move(operation), id, tag}, when); - return id; -} - -void ExecutorStd::PollingThread() { - while (!shutting_down_) { - Entry entry = schedule_.PopBlocking(); - if (entry.tagged.operation) { - entry.tagged.operation(); - } - } -} - -void ExecutorStd::UnblockQueue() { - // Put a no-op for immediate execution on the queue to ensure that - // `schedule_.PopBlocking` returns, and worker thread can notice that shutdown - // is in progress. - schedule_.Push(Entry{[] {}, /*id=*/0}, Immediate()); -} - -ExecutorStd::Id ExecutorStd::NextId() { - // The wrap around after ~4 billion operations is explicitly ignored. Even if - // an instance of `ExecutorStd` runs long enough to get `current_id_` to - // overflow, it's extremely unlikely that any object still holds a reference - // that is old enough to cause a conflict. - return current_id_++; -} - -bool ExecutorStd::IsCurrentExecutor() const { - return std::this_thread::get_id() == worker_thread_.get_id(); -} - -std::string ExecutorStd::CurrentExecutorName() const { - return ThreadIdToString(std::this_thread::get_id()); -} - -std::string ExecutorStd::Name() const { - return ThreadIdToString(worker_thread_.get_id()); -} - -void ExecutorStd::ExecuteBlocking(Operation&& operation) { - std::promise signal_finished; - Execute([&] { - operation(); - signal_finished.set_value(); - }); - signal_finished.get_future().wait(); -} - -bool ExecutorStd::IsScheduled(const Tag tag) const { - return schedule_.Contains( - [&tag](const Entry& e) { return e.tagged.tag == tag; }); -} - -absl::optional ExecutorStd::PopFromSchedule() { - auto removed = - schedule_.RemoveIf([](const Entry& e) { return !e.IsImmediate(); }); - if (!removed.has_value()) { - return {}; - } - return {std::move(removed.value().tagged)}; -} - -// MARK: - Executor - -// Only defined on non-Apple platforms. On Apple platforms, see the alternative -// definition in executor_libdispatch.mm. -#if !__APPLE__ - -std::unique_ptr Executor::CreateSerial(const char*) { - return absl::make_unique(); -} - -#endif // !__APPLE__ - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_std.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_std.h deleted file mode 100644 index 25500367a..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/executor_std.h +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_STD_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_STD_H_ - -#include -#include -#include // NOLINT(build/c++11) -#include -#include // NOLINT(build/c++11) -#include -#include // NOLINT(build/c++11) -#include - -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "absl/types/optional.h" - -namespace firebase { -namespace firestore { -namespace util { - -namespace async { - -// A thread-safe class similar to a priority queue where the entries are -// prioritized by the time for which they're scheduled. Entries scheduled for -// the exact same time are prioritized in FIFO order. -// -// The main function of `Schedule` is `PopBlocking`, which sleeps until an entry -// becomes available. It correctly handles entries being asynchronously added or -// removed from the schedule. -// -// The details of time management are completely concealed within the class. -// Once an entry is scheduled, there is no way to reschedule or even retrieve -// the time. -template -class Schedule { - // Internal invariants: - // - entries are always in sorted order, leftmost entry is always the most - // due; - // - each operation modifying the queue notifies the condition variable `cv_`. - public: - using Duration = std::chrono::milliseconds; - using Clock = std::chrono::steady_clock; - // Entries are scheduled using absolute time. - using TimePoint = std::chrono::time_point; - - // Schedules an entry for the specified time due. `due` may be in the past. - void Push(const T& value, const TimePoint due) { - InsertPreservingOrder(Entry{value, due}); - } - void Push(T&& value, const TimePoint due) { - InsertPreservingOrder(Entry{std::move(value), due}); - } - - // If the queue contains at least one entry for which the scheduled time is - // due now (according to the system clock), removes the entry which is the - // most overdue from the queue and returns it. If no entry is due, returns an - // empty `optional`. - absl::optional PopIfDue() { - std::lock_guard lock{mutex_}; - - if (HasDueLocked()) { - return ExtractLocked(scheduled_.begin()); - } - return {}; - } - - // Blocks until at least one entry is available for which the scheduled time - // is due now (according to the system clock), removes the entry which is the - // most overdue from the queue and returns it. The function will - // attempt to minimize both the waiting time and busy waiting. - T PopBlocking() { - std::unique_lock lock{mutex_}; - - while (true) { - cv_.wait(lock, [this] { return !scheduled_.empty(); }); - - // To minimize busy waiting, sleep until either the nearest entry in the - // future either changes, or else becomes due. - const auto until = scheduled_.front().due; - cv_.wait_until(lock, until, [this, until] { - return scheduled_.empty() || scheduled_.front().due != until; - }); - // There are 3 possibilities why `wait_until` has returned: - // - `wait_until` has timed out, in which case the current time is at - // least `until`, so there must be an overdue entry; - // - a new entry has been added which comes before `until`. It must be - // either overdue (in which case `HasDueLocked` will break the cycle), - // or else `until` must be reevaluated (on the next iteration of the - // loop); - // - `until` entry has been removed (including the case where the queue - // has become empty). This means `until` has to be reevaluated, similar - // to #2. - - if (HasDueLocked()) { - return ExtractLocked(scheduled_.begin()); - } - } - } - - bool empty() const { - std::lock_guard lock{mutex_}; - return scheduled_.empty(); - } - - size_t size() const { - std::lock_guard lock{mutex_}; - return scheduled_.size(); - } - - // Removes the first entry satisfying predicate from the queue and returns it. - // If no such entry exists, returns an empty `optional`. Predicate is applied - // to entries in order according to their scheduled time. - // - // Note that this function doesn't take into account whether the removed entry - // is past its due time. - template - absl::optional RemoveIf(const Pred pred) { - std::lock_guard lock{mutex_}; - - for (auto iter = scheduled_.begin(), end = scheduled_.end(); iter != end; - ++iter) { - if (pred(iter->value)) { - return ExtractLocked(iter); - } - } - return {}; - } - - // Checks whether the queue contains an entry satisfying the given predicate. - template - bool Contains(const Pred pred) const { - std::lock_guard lock{mutex_}; - return std::any_of(scheduled_.begin(), scheduled_.end(), - [&pred](const Entry& s) { return pred(s.value); }); - } - - private: - struct Entry { - bool operator<(const Entry& rhs) const { - return due < rhs.due; - } - - T value; - TimePoint due; - }; - // All removals are on the front, but most insertions are expected to be on - // the back. - using Container = std::deque; - using Iterator = typename Container::iterator; - - void InsertPreservingOrder(Entry&& new_entry) { - std::lock_guard lock{mutex_}; - - const auto insertion_point = - std::upper_bound(scheduled_.begin(), scheduled_.end(), new_entry); - scheduled_.insert(insertion_point, std::move(new_entry)); - - cv_.notify_one(); - } - - // This function expects the mutex to be already locked. - bool HasDueLocked() const { - namespace chr = std::chrono; - const auto now = chr::time_point_cast(Clock::now()); - return !scheduled_.empty() && now >= scheduled_.front().due; - } - - // This function expects the mutex to be already locked. - T ExtractLocked(const Iterator where) { - HARD_ASSERT(!scheduled_.empty(), - "Trying to pop an entry from an empty queue."); - - T result = std::move(where->value); - scheduled_.erase(where); - cv_.notify_one(); - - return result; - } - - mutable std::mutex mutex_; - std::condition_variable cv_; - Container scheduled_; -}; - -} // namespace async - -// A serial queue that executes provided operations on a dedicated background -// thread, using C++11 standard library functionality. -class ExecutorStd : public Executor { - public: - ExecutorStd(); - ~ExecutorStd(); - - void Execute(Operation&& operation) override; - void ExecuteBlocking(Operation&& operation) override; - - DelayedOperation Schedule(Milliseconds delay, - TaggedOperation&& tagged) override; - - bool IsCurrentExecutor() const override; - std::string CurrentExecutorName() const override; - std::string Name() const override; - - bool IsScheduled(Tag tag) const override; - absl::optional PopFromSchedule() override; - - using TimePoint = async::Schedule::TimePoint; - // To allow canceling operations, each scheduled operation is assigned - // a monotonically increasing identifier. - using Id = unsigned int; - - // If the operation hasn't yet been run, it will be removed from the queue. - // Otherwise, this function is a no-op. - void TryCancel(Id operation_id); - - Id PushOnSchedule(Operation&& operation, TimePoint when, Tag tag = -1); - - void PollingThread(); - void UnblockQueue(); - Id NextId(); - - // As a convention, assign the epoch time to all operations scheduled for - // immediate execution. Note that it means that an immediate operation is - // always scheduled before any delayed operation, even in the corner case when - // the immediate operation was scheduled after a delayed operation was due - // (but hasn't yet run). - static TimePoint Immediate() { - return TimePoint{}; - } - - struct Entry { - Entry() { - } - Entry(Operation&& operation, - const ExecutorStd::Id id, - const ExecutorStd::Tag tag = kNoTag) - : tagged{tag, std::move(operation)}, id{id} { - } - - bool IsImmediate() const { - return tagged.tag == kNoTag; - } - - static constexpr Tag kNoTag = -1; - TaggedOperation tagged; - Id id = 0; - }; - // Operations scheduled for immediate execution are also put on the schedule - // (with due time set to `Immediate`). - async::Schedule schedule_; - - std::thread worker_thread_; - // Used to stop the worker thread. - std::atomic shutting_down_{false}; - - std::atomic current_id_{0}; -}; - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EXECUTOR_STD_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem.h deleted file mode 100644 index 98e3e47e0..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_FILESYSTEM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_FILESYSTEM_H_ - -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/path.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" - -namespace firebase { -namespace firestore { -namespace util { - -// High-level routines for the manipulating the filesystem. All filesystems -// are required to implement these routines. - -/** - * Answers the question "is this path a directory? The path is not required to - * have a trailing slash. - * - * Typical return codes include: - * * Ok - The path exists and is a directory. - * * FailedPrecondition - Some component of the path is not a directory. This - * does not necessarily imply that the path exists and is a file. - * * NotFound - The path does not exist - * * PermissionDenied - Insufficient permissions to access the path. - */ -Status IsDirectory(const Path& path); - -/** - * Recursively creates all the directories in the path name if they don't - * exist. - * - * @return Ok if the directory was created or already existed. - */ -Status RecursivelyCreateDir(const Path& path); - -/** - * Recursively deletes the contents of the given pathname. If the pathname is - * a file, deletes just that file. The the pathname is a directory, deletes - * everything within the directory. - * - * @return Ok if the directory was deleted or did not exist. - */ -Status RecursivelyDelete(const Path& path); - -/** - * Returns system-defined best directory in which to create temporary files. - * Typical return values are like `/tmp` on UNIX systems. Clients should create - * randomly named directories or files within this location to avoid collisions. - * Absent any changes that might affect the underlying calls, the value returned - * from TempDir will be stable over time. - * - * Note: the returned path is just where the system thinks temporary files - * should be stored, but TempDir does not actually guarantee that this path - * exists. - */ -Path TempDir(); - -/** - * On success, returns the size in bytes of the file specified by - * `path`. - */ -StatusOr FileSize(const Path& path); - -/** - * On success, opens the file at the given `path` and returns its contents as - * a string. - */ -StatusOr ReadFile(const Path& path); - -/** - * Implements an iterator over the contents of a directory. Initializes to the - * first entry in the directory. - */ -class DirectoryIterator { - public: - /** - * Creates a new platform-specific directory iterator. - * - * @param path The path over which to iterate (must outlive the - * DirectoryIterator). - */ - static std::unique_ptr Create(const Path& path); - - virtual ~DirectoryIterator() { - } - - /** - * Advances the iterator. - */ - virtual void Next() = 0; - - /** - * Returns true if `Next()` and `file()` can be called on the iterator. - * If `Valid() == false && status().ok()`, then iteration has finished. - */ - virtual bool Valid() const = 0; - - /** - * Return the full path of the current entry pointed to by the iterator. - */ - virtual Path file() const = 0; - - /** - * Returns the last error encountered by the iterator, or OK. - */ - Status status() const { - return status_; - } - - protected: - /** - * `path` should outlive the iterator. - */ - explicit DirectoryIterator(const Path& path) : parent_{path} { - } - - DirectoryIterator(const DirectoryIterator& other) = delete; - DirectoryIterator& operator=(const DirectoryIterator& other) = delete; - - Status status_; - const Path& parent_; -}; - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_FILESYSTEM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_apple.mm deleted file mode 100644 index 07c755eb0..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_apple.mm +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/filesystem.h" - -#if defined(__APPLE__) - -#import - -namespace firebase { -namespace firestore { -namespace util { - -Path TempDir() { - const char* env_tmpdir = getenv("TMPDIR"); - if (env_tmpdir) { - return Path::FromUtf8(env_tmpdir); - } - - NSString* ns_tmpdir = NSTemporaryDirectory(); - if (ns_tmpdir) { - return Path::FromNSString(ns_tmpdir); - } - - return Path::FromUtf8("/tmp"); -} - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // defined(__APPLE__) diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_common.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_common.cc deleted file mode 100644 index 905447e02..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_common.cc +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/filesystem_detail.h" - -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/filesystem.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" - -using firebase::firestore::util::Path; - -namespace firebase { -namespace firestore { -namespace util { -namespace detail { - -Status RecursivelyDeleteDir(const Path& parent) { - std::unique_ptr iter = DirectoryIterator::Create(parent); - for (; iter->Valid(); iter->Next()) { - Status status = RecursivelyDelete(iter->file()); - if (!status.ok()) { - return status; - } - } - if (!iter->status().ok()) { - if (iter->status().code() == Error::NotFound) { - return Status::OK(); - } - return iter->status(); - } - return detail::DeleteDir(parent); -} - -} // namespace detail - -Status RecursivelyCreateDir(const Path& path) { - Status result = detail::CreateDir(path); - if (result.ok() || result.code() != Error::NotFound) { - // Successfully created the directory, it already existed, or some other - // unrecoverable error. - return result; - } - - // Missing parent - Path parent = path.Dirname(); - result = RecursivelyCreateDir(parent); - if (!result.ok()) { - return result; - } - - // Successfully created the parent so try again. - return detail::CreateDir(path); -} - -Status RecursivelyDelete(const Path& path) { - Status status = IsDirectory(path); - switch (status.code()) { - case Error::Ok: - return detail::RecursivelyDeleteDir(path); - - case Error::FailedPrecondition: - // Could be a file or something else. Attempt to delete it as a file - // but otherwise allow that to fail if it's not a file. - return detail::DeleteFile(path); - - case Error::NotFound: - return Status::OK(); - - default: - return status; - } -} - -StatusOr ReadFile(const Path& path) { - std::ifstream file{path.native_value()}; - if (!file) { - // TODO(varconst): more error details. This will require platform-specific - // code, because `` may not update `errno`. - return Status{Error::Unknown, - StringFormat("File at path '%s' cannot be opened", - path.ToUtf8String())}; - } - - std::stringstream buffer; - buffer << file.rdbuf(); - return buffer.str(); -} - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_detail.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_detail.h deleted file mode 100644 index 9242a457f..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_detail.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_FILESYSTEM_DETAIL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_FILESYSTEM_DETAIL_H_ - -#include "Firestore/core/src/firebase/firestore/util/path.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" - -namespace firebase { -namespace firestore { -namespace util { -namespace detail { - -// Additional routines for filesystem implementations that are not based on -// high-level mechanisms like NSFileManager. - -/** - * Creates the given directory. The immediate parent directory must already - * exist and not already be a file. - * - * @return Ok if the directory was created or already existed. On some systems - * this may also return Ok if a regular file exists at the given path. - */ -Status CreateDir(const Path& path); - -/** - * Deletes the given directory if it exists. - * - * @return Ok if the directory was deleted or did not exist. Returns a - * system-defined error if the path is not a directory or the directory is - * non-empty. - */ -Status DeleteDir(const Path& path); - -/** - * Deletes the given file if it exists. - * - * @return Ok if the file was deleted or did not exist. Returns a system-defined - * error if the path exists but is not a regular file. - */ -Status DeleteFile(const Path& path); - -/** - * Recursively deletes the contents of the given pathname that is known to be - * a directory. - * - * @return Ok if the directory was deleted or did not exist. Returns a - * system-defined error if the path exists but is not a directory. - * - */ -Status RecursivelyDeleteDir(const Path& path); - -} // namespace detail -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_FILESYSTEM_DETAIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_posix.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_posix.cc deleted file mode 100644 index 96ebf02ce..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/filesystem_posix.cc +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/filesystem.h" - -#include -#include -#include -#include - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/filesystem_detail.h" -#include "Firestore/core/src/firebase/firestore/util/path.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "absl/memory/memory.h" - -namespace firebase { -namespace firestore { -namespace util { - -Status IsDirectory(const Path& path) { - struct stat buffer {}; - if (::stat(path.c_str(), &buffer)) { - if (errno == ENOENT) { - // Expected common error case. - return Status{Error::NotFound, path.ToUtf8String()}; - - } else if (errno == ENOTDIR) { - // This is a case where POSIX and Windows differ in behavior in a way - // that's hard to reconcile from Windows. Under POSIX, ENOTDIR indicates - // that not only does the path not exist, but that some parent of the - // path also isn't a directory. - // - // Windows, OTOH, returns ERROR_FILE_NOT_FOUND if the file doesn't exist, - // its immediate parent exists, and the parent is a directory. Otherwise - // Windows returns ERROR_PATH_NOT_FOUND. To emulate POSIX behavior you - // have to find the leaf-most existing parent and figure out if it's not a - // directory. - // - // Since we really don't care about this distinction it's easier to - // resolve this by returning NotFound here. - return Status{Error::NotFound, path.ToUtf8String()}; - } else { - return Status::FromErrno(errno, path.ToUtf8String()); - } - } - - if (!S_ISDIR(buffer.st_mode)) { - return Status{Error::FailedPrecondition, - StringFormat("Path %s exists but is not a directory", - path.ToUtf8String())}; - } - - return Status::OK(); -} - -#if !defined(__APPLE__) -// See filesystem_apple.mm for an alternative implementation. -Path TempDir() { - const char* env_tmpdir = getenv("TMPDIR"); - if (env_tmpdir) { - return Path::FromUtf8(env_tmpdir); - } - -#if defined(__ANDROID__) - // The /tmp directory doesn't exist as a fallback; each application is - // supposed to keep its own temporary files. Previously /data/local/tmp may - // have been reasonable, but current lore points to this being unreliable for - // writing at higher API levels or certain phone models because default - // permissions on this directory no longer permit writing. - // - // TODO(wilhuff): Validate on recent Android. -#error "Not yet sure about temporary file locations on Android." - return Path::FromUtf8("/data/local/tmp"); - -#else - return Path::FromUtf8("/tmp"); -#endif // defined(__ANDROID__) -} -#endif // !defined(__APPLE__) - -StatusOr FileSize(const Path& path) { - struct stat st {}; - if (stat(path.c_str(), &st) == 0) { - return st.st_size; - } else { - return Status::FromErrno( - errno, StringFormat("Failed to stat file: %s", path.ToUtf8String())); - } -} - -namespace detail { - -Status CreateDir(const Path& path) { - if (::mkdir(path.c_str(), 0777)) { - if (errno != EEXIST) { - return Status::FromErrno( - errno, - StringFormat("Could not create directory %s", path.ToUtf8String())); - } - } - - return Status::OK(); -} - -Status DeleteDir(const Path& path) { - if (::rmdir(path.c_str())) { - if (errno != ENOENT) { - return Status::FromErrno( - errno, - StringFormat("Could not delete directory %s", path.ToUtf8String())); - } - } - return Status::OK(); -} - -Status DeleteFile(const Path& path) { - if (::unlink(path.c_str())) { - if (errno != ENOENT) { - return Status::FromErrno( - errno, StringFormat("Could not delete file %s", path.ToUtf8String())); - } - } - return Status::OK(); -} - -} // namespace detail - -namespace { - -class DirectoryIteratorPosix : public DirectoryIterator { - public: - explicit DirectoryIteratorPosix(const util::Path& path); - virtual ~DirectoryIteratorPosix(); - - void Next() override; - bool Valid() const override; - Path file() const override; - - private: - void Advance(); - - DIR* dir_ = nullptr; - struct dirent* entry_ = nullptr; -}; - -DirectoryIteratorPosix::DirectoryIteratorPosix(const util::Path& path) - : DirectoryIterator{path} { - dir_ = ::opendir(parent_.c_str()); - if (!dir_) { - status_ = Status::FromErrno( - errno, - StringFormat("Could not open directory %s", parent_.ToUtf8String())); - return; - } - Advance(); -} - -DirectoryIteratorPosix::~DirectoryIteratorPosix() { - if (dir_) { - if (::closedir(dir_) != 0) { - HARD_FAIL("Could not close directory %s", parent_.ToUtf8String()); - } - } -} - -void DirectoryIteratorPosix::Advance() { - HARD_ASSERT(status_.ok(), "Advancing an errored iterator"); - errno = 0; - entry_ = ::readdir(dir_); - if (!entry_) { - if (errno != 0) { - status_ = Status::FromErrno( - errno, StringFormat("Could not read %s", parent_.ToUtf8String())); - } - } else if (status_.ok()) { - // Skip self- and parent-pointer - if (::strcmp(".", entry_->d_name) == 0 || - ::strcmp("..", entry_->d_name) == 0) { - Advance(); - } - } -} - -void DirectoryIteratorPosix::Next() { - HARD_ASSERT(Valid(), "Next() called on invalid iterator"); - Advance(); -} - -bool DirectoryIteratorPosix::Valid() const { - return status_.ok() && entry_ != nullptr; -} - -Path DirectoryIteratorPosix::file() const { - HARD_ASSERT(Valid(), "file() called on invalid iterator"); - return parent_.AppendUtf8(entry_->d_name, strlen(entry_->d_name)); -} - -} // namespace - -std::unique_ptr DirectoryIterator::Create( - const util::Path& path) { - return absl::make_unique(path); -} - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert.cc deleted file mode 100644 index 0b27f7e52..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert.cc +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" - -#include -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "absl/base/config.h" - -namespace firebase { -namespace firestore { -namespace util { - -ABSL_ATTRIBUTE_NORETURN void DefaultFailureHandler(const char* file, - const char* func, - const int line, - const std::string& message) { - std::string failure = - StringFormat("ASSERT: %s(%s) %s: %s", file, line, func, message); - -#if ABSL_HAVE_EXCEPTIONS - throw std::logic_error(failure); - -#else - fprintf(stderr, "%s\n", failure.c_str()); - std::terminate(); -#endif -} - -namespace { -FailureHandler failure_handler = DefaultFailureHandler; -} // namespace - -FailureHandler SetFailureHandler(FailureHandler callback) { - FailureHandler previous = failure_handler; - failure_handler = callback; - return previous; -} - -namespace internal { - -void Fail(const char* file, - const char* func, - const int line, - const std::string& message) { - failure_handler(file, func, line, message); - - // It's expected that the failure handler above does not return. But if it - // does, just terminate. - std::terminate(); -} - -void Fail(const char* file, - const char* func, - const int line, - const std::string& message, - const char* condition) { - std::string failure; - if (message.empty()) { - failure = condition; - } else { - failure = StringFormat("%s (expected %s)", message, condition); - } - Fail(file, func, line, failure); -} - -} // namespace internal -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert.h deleted file mode 100644 index eb1045258..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HARD_ASSERT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HARD_ASSERT_H_ - -#include -#include - -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "absl/base/optimization.h" - -#if defined(_MSC_VER) -#define FIRESTORE_FUNCTION_NAME __FUNCSIG__ -#else -#define FIRESTORE_FUNCTION_NAME __PRETTY_FUNCTION__ -#endif - -/** - * Invokes the internal Fail function below with all the required contextual - * information and passes additional arguments. - * - * @param message The failure message. - * @param condition The string form of the expression that failed (optional) - */ -#define INVOKE_INTERNAL_FAIL(...) \ - firebase::firestore::util::internal::Fail(__FILE__, FIRESTORE_FUNCTION_NAME, \ - __LINE__, __VA_ARGS__) - -/** - * Fails the current function if the given condition is false. - * - * Unlike assert(3) or NSAssert, this macro is never compiled out. - * - * @param condition The condition to test. - * @param format (optional) A format string suitable for util::StringFormat. - * @param ... format arguments to pass to util::StringFormat. - */ -#define HARD_ASSERT(condition, ...) \ - do { \ - if (!ABSL_PREDICT_TRUE(condition)) { \ - std::string _message = \ - firebase::firestore::util::StringFormat(__VA_ARGS__); \ - INVOKE_INTERNAL_FAIL(_message, #condition); \ - } \ - } while (0) - -/** - * Unconditionally fails the current function. - * - * Unlike assert(3) or NSAssert, this macro is never compiled out. - * - * @param format A format string suitable for util::StringFormat. - * @param ... format arguments to pass to util::StringFormat. - */ -#define HARD_FAIL(...) \ - do { \ - std::string _failure = \ - firebase::firestore::util::StringFormat(__VA_ARGS__); \ - INVOKE_INTERNAL_FAIL(_failure); \ - } while (0) - -/** - * Indicates an area of the code that cannot be reached (except possibly due to - * undefined behaviour or other similar badness). The only reasonable thing to - * do in these cases is to immediately abort. - */ -#define UNREACHABLE() abort() - -/** - * Returns the given `ptr` if it is non-null; otherwise, results in a failed - * assertion, similar to `HARD_ASSERT`. This macro deliberately expands to an - * expression, so that it can be used in initialization and assignment: - * - * my_ptr_ = NOT_NULL(suspicious_ptr); - * my_smart_ptr_ = std::move(NOT_NULL(suspicious_smart_ptr)); - * - * MyClass() : my_ptr_{NOT_NULL(suspicious_ptr)} {} - * - * @param ptr The pointer to check and return. Can be a smart pointer. - */ -#define NOT_NULL(ptr) \ - (static_cast(ABSL_PREDICT_FALSE((ptr) == nullptr) \ - ? INVOKE_INTERNAL_FAIL("Expected non-null " #ptr) \ - : static_cast(0)), \ - (ptr)) // NOLINT(whitespace/indent) - -namespace firebase { -namespace firestore { -namespace util { - -using FailureHandler = void (*)(const char* file, - const char* func, - const int line, - const std::string& failure_message); - -/** - * Overrides the default failure handler. - * - * The default essentially just calls std::terminate. While reasonable for C++, - * this isn't optimal for platforms that merely use the C++ core as their - * implementation and would otherwise be expected to throw a platform specific - * exception. - * - * @param callback A function that will handle the failure. This function is - * not expected to return. (If it does, std::terminate() will be called - * immediately after it does so.) - * @return A pointer to the previous failure handler. - */ -FailureHandler SetFailureHandler(FailureHandler callback); - -/** - * Default failure handler. This should typically not be called directly. - */ -ABSL_ATTRIBUTE_NORETURN void DefaultFailureHandler(const char* file, - const char* func, - const int line, - const std::string& message); - -namespace internal { - -// A no-return helper function. To raise an assertion, use Macro instead. -ABSL_ATTRIBUTE_NORETURN void Fail(const char* file, - const char* func, - int line, - const std::string& message); - -ABSL_ATTRIBUTE_NORETURN void Fail(const char* file, - const char* func, - int line, - const std::string& message, - const char* condition); - -} // namespace internal -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HARD_ASSERT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert_apple.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert_apple.h deleted file mode 100644 index 1a16b3cfb..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert_apple.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2019 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HARD_ASSERT_APPLE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HARD_ASSERT_APPLE_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "absl/base/attributes.h" - -namespace firebase { -namespace firestore { -namespace util { - -/** - * Default failure handler for ObjC/Swift. Typically shouldn't be used - * directly. - */ -ABSL_ATTRIBUTE_NORETURN void ObjcFailureHandler(const char* file, - const char* func, - const int line, - const std::string& message); - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HARD_ASSERT_APPLE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert_apple.mm deleted file mode 100644 index 6ed554630..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hard_assert_apple.mm +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/hard_assert_apple.h" - -#import - -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" - -namespace firebase { -namespace firestore { -namespace util { - -ABSL_ATTRIBUTE_NORETURN void ObjcFailureHandler(const char* file, - const char* func, - const int line, - const std::string& message) { - [[NSAssertionHandler currentHandler] - handleFailureInFunction:MakeNSString(func) - file:MakeNSString(file) - lineNumber:line - description:@"FIRESTORE INTERNAL ASSERTION FAILED: %s", - message.c_str()]; - abort(); -} - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/log.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/log.h deleted file mode 100644 index 7034ec6ea..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/log.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_LOG_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_LOG_H_ - -#include - -#include "Firestore/core/src/firebase/firestore/util/string_format.h" - -namespace firebase { -namespace firestore { -namespace util { - -// Levels used when logging messages. -enum LogLevel { - // Debug Log Level - kLogLevelDebug, - // Notice Log Level - kLogLevelNotice, - // Warning Log Level - kLogLevelWarning, - // Error Log Level - kLogLevelError, -}; - -// Log a message if kLogLevelDebug is enabled. Arguments are not evaluated if -// logging is disabled. -// -// @param format A format string suitable for use with `util::StringFormat` -// @param ... C++ variadic arguments that match the format string. Not C -// varargs. -#define LOG_DEBUG(...) \ - do { \ - namespace _util = firebase::firestore::util; \ - if (_util::LogIsLoggable(_util::kLogLevelDebug)) { \ - std::string _message = _util::StringFormat(__VA_ARGS__); \ - _util::LogMessage(_util::kLogLevelDebug, _message); \ - } \ - } while (0) - -// Log a message if kLogLevelWarn is enabled (it is by default). Arguments are -// not evaluated if logging is disabled. -// -// @param format A format string suitable for use with `util::StringFormat` -// @param ... C++ variadic arguments that match the format string. Not C -// varargs. -#define LOG_WARN(...) \ - do { \ - namespace _util = firebase::firestore::util; \ - if (_util::LogIsLoggable(_util::kLogLevelWarning)) { \ - std::string _message = _util::StringFormat(__VA_ARGS__); \ - _util::LogMessage(_util::kLogLevelWarning, _message); \ - } \ - } while (0) - -// Log a message if kLogLevelError is enabled (it is by default). Arguments are -// not evaluated if logging is disabled. -// -// @param format A format string suitable for use with `util::StringFormat` -// @param ... C++ variadic arguments that match the format string. Not C -// varargs. -#define LOG_ERROR(...) \ - do { \ - namespace _util = firebase::firestore::util; \ - if (_util::LogIsLoggable(_util::kLogLevelError)) { \ - std::string _message = _util::StringFormat(__VA_ARGS__); \ - _util::LogMessage(_util::kLogLevelError, _message); \ - } \ - } while (0) - -// Tests to see if the given log level is loggable. -bool LogIsLoggable(LogLevel level); - -// Is debug logging enabled? -inline bool LogIsDebugEnabled() { - return LogIsLoggable(kLogLevelDebug); -} - -// All messages at or above the specified log level value are displayed. -void LogSetLevel(LogLevel level); - -// Log a message at the given level. -void LogMessage(LogLevel log_level, const std::string& message); - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_LOG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status.h deleted file mode 100644 index aae1804eb..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status.h +++ /dev/null @@ -1,247 +0,0 @@ -/* - * Copyright 2015, 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUS_H_ - -#if defined(_WIN32) -#include -#endif - -#include -#include -#include -#include -#include - -#include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" -#include "absl/base/attributes.h" -#include "absl/strings/string_view.h" - -namespace firebase { -namespace firestore { -namespace util { - -class PlatformError; - -/// Denotes success or failure of a call. -class ABSL_MUST_USE_RESULT Status { - public: - /// Create a success status. - Status() { - } - - /// \brief Create a status with the specified error code and msg as a - /// human-readable string containing more detailed information. - Status(Error code, absl::string_view msg); - - /// Copy the specified status. - Status(const Status& s); - void operator=(const Status& s); - - /// Move the specified status. - Status(Status&& s) noexcept; - void operator=(Status&& s) noexcept; - - static Status OK() { - return Status(); - } - - /// Creates a status object from the given errno error code and message. - static Status FromErrno(int errno_code, absl::string_view message); - -#if defined(_WIN32) - static Status FromLastError(DWORD error, absl::string_view message); -#endif // defined(_WIN32) - -#if defined(__OBJC__) - static Status FromNSError(NSError* error); - - NSError* ToNSError() const; -#endif // defined(__OBJC__) - - /// Returns true iff the status indicates success. - bool ok() const { - return state_ == nullptr; - } - - Error code() const { - return ok() ? Error::Ok : (IsMovedFrom() ? Error::Internal : state_->code); - } - - const std::string& error_message() const { - return ok() ? empty_string() - : (IsMovedFrom() ? moved_from_message() : state_->msg); - } - - bool operator==(const Status& x) const; - bool operator!=(const Status& x) const; - - /// \brief If `ok()`, stores `new_status` into `*this`. If `!ok()`, - /// preserves the current status, but may augment with additional - /// information about `new_status`. - /// - /// Convenient way of keeping track of the first error encountered. - /// Instead of: - /// `if (overall_status.ok()) overall_status = new_status` - /// Use: - /// `overall_status.Update(new_status);` - void Update(const Status& new_status); - - /// \brief Adds the message in the given cause to this Status. - /// - /// \return *this - Status& CausedBy(const Status& cause); - - Status& WithPlatformError(std::unique_ptr error); - - /// \brief Return a string representation of this status suitable for - /// printing. Returns the string `"OK"` for success. - std::string ToString() const; - friend std::ostream& operator<<(std::ostream& out, const Status& status); - - // Ignores any errors. This method does nothing except potentially suppress - // complaints from any tools that are checking that errors are not dropped on - // the floor. - void IgnoreError() const; - - private: - static const std::string& empty_string(); - static const std::string& moved_from_message(); - - struct State { - State() = default; - State(const State& other); - State(Error code, std::string&& msg); - - struct Deleter { - void operator()(const State* ptr) const; - }; - // A `unique_ptr` with a custom deleter. If the pointer's value has been set - // to a special value (0x01) to indicate it is moved, invoking the custom - // deleter will be a no-op. - using StatePtr = std::unique_ptr; - - static State* MovedFromIndicator() { - return reinterpret_cast(0x01); - } - - template - static StatePtr MakePtr(Args&&... args) { - return StatePtr(new State(std::forward(args)...)); - } - - Error code; - std::string msg; - - // An additional platform-specific error representation that was used to - // generate this Status. The PlatformError does not meaningfully contribute - // to the identity of this Status: it exists to allow tunneling e.g. - // NSError* to Status and back to NSError* losslessly. - std::unique_ptr platform_error; - }; - - // Asserts if `state_` is a valid pointer, should be used at all places where - // it is used as a pointer, instead of using `state_`. - bool IsMovedFrom() const { - return state_.get() == State::MovedFromIndicator(); - } - - // OK status has a `nullptr` `state_`. If this instance is moved, state_ has - // the value of `State::MovedFromIndicator()`. Otherwise `state_` points to - // a `State` structure containing the error code and message(s). - State::StatePtr state_; - - // Tags this instance as `moved-from`. - void SetMovedFrom(); - - void SlowCopyFrom(const State* src); -}; - -class PlatformError { - public: - virtual ~PlatformError() { - } - - virtual std::unique_ptr Copy() = 0; - - /** - * Creates a new PlatformError with the given code and message, whose cause is - * this PlatformError. - */ - virtual std::unique_ptr WrapWith(Error code, - std::string message) = 0; -}; - -inline Status::Status(const Status& s) - : state_{s.state_ == nullptr ? State::StatePtr{} - : State::MakePtr(*s.state_)} { -} - -inline Status::State::State(const State& s) - : code(s.code), - msg(s.msg), - platform_error((s.platform_error == nullptr) ? nullptr - : s.platform_error->Copy()) { -} - -inline Status::State::State(Error code, std::string&& msg) - : code(code), msg(std::move(msg)) { -} - -inline void Status::operator=(const Status& s) { - // The following condition catches both aliasing (when this == &s), - // and the common case where both s and *this are ok. - if (state_ != s.state_) { - SlowCopyFrom(s.state_.get()); - } -} - -inline Status::Status(Status&& s) noexcept : state_(std::move(s.state_)) { - s.SetMovedFrom(); -} - -inline void Status::operator=(Status&& s) noexcept { - // Moving into self is a no-op. - if (this != &s) { - state_ = std::move(s.state_); - s.SetMovedFrom(); - } -} - -inline bool Status::operator==(const Status& x) const { - return (this->state_ == x.state_) || (ToString() == x.ToString()); -} - -inline bool Status::operator!=(const Status& x) const { - return !(*this == x); -} - -typedef std::function StatusCallback; - -extern std::string StatusCheckOpHelperOutOfLine(const Status& v, - const char* msg); - -#define STATUS_CHECK_OK(val) \ - HARD_ASSERT(val.ok(), "%s", StatusCheckOpHelperOutOfLine(val, #val)) - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_posix.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_posix.cc deleted file mode 100644 index 90bf79b38..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_posix.cc +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/status.h" - -#include - -#include "Firestore/core/src/firebase/firestore/util/strerror.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" - -namespace firebase { -namespace firestore { -namespace util { - -/// Returns the Canonical error code for the given errno value. -static Error CodeForErrno(int errno_code) { - switch (errno_code) { - case 0: - return Error::Ok; - - // Internal canonical mappings call these failed preconditions, but for - // our purposes these must indicate an internal error in file handling. - case EBADF: // Invalid file descriptor -#if defined(EBADFD) - case EBADFD: // File descriptor in bad state -#endif - return Error::Internal; - - case EINVAL: // Invalid argument - case ENAMETOOLONG: // Filename too long - case E2BIG: // Argument list too long - case EDESTADDRREQ: // Destination address required - case EDOM: // Mathematics argument out of domain of function - case EFAULT: // Bad address - case EILSEQ: // Illegal byte sequence - case ENOPROTOOPT: // Protocol not available - case ENOSTR: // Not a STREAM - case ENOTSOCK: // Not a socket - case ENOTTY: // Inappropriate I/O control operation - case EPROTOTYPE: // Protocol wrong type for socket - case ESPIPE: // Invalid seek - return Error::InvalidArgument; - - case ETIMEDOUT: // Connection timed out - case ETIME: // Timer expired - return Error::DeadlineExceeded; - - case ENODEV: // No such device - case ENOENT: // No such file or directory -#if defined(ENOMEDIUM) - case ENOMEDIUM: // No medium found -#endif - case ENXIO: // No such device or address - case ESRCH: // No such process - return Error::NotFound; - - case EEXIST: // File exists - case EADDRNOTAVAIL: // Address not available - case EALREADY: // Connection already in progress -#if defined(ENOTUNIQ) - case ENOTUNIQ: // Name not unique on network -#endif - return Error::AlreadyExists; - - case EPERM: // Operation not permitted - case EACCES: // Permission denied -#if defined(ENOKEY) - case ENOKEY: // Required key not available -#endif - case EROFS: // Read only file system - return Error::PermissionDenied; - - case ENOTEMPTY: // Directory not empty - case EISDIR: // Is a directory - case ENOTDIR: // Not a directory - case EADDRINUSE: // Address already in use - case EBUSY: // Device or resource busy - case ECHILD: // No child processes - case EISCONN: // Socket is connected -#if defined(EISNAM) - case EISNAM: // Is a named type file -#endif -#if defined(ENOTBLK) - case ENOTBLK: // Block device required -#endif - case ENOTCONN: // The socket is not connected - case EPIPE: // Broken pipe -#if defined(ESHUTDOWN) - case ESHUTDOWN: // Cannot send after transport endpoint shutdown -#endif - case ETXTBSY: // Text file busy -#if defined(EUNATCH) - case EUNATCH: // Protocol driver not attached -#endif - return Error::FailedPrecondition; - - case ENOSPC: // No space left on device -#if defined(EDQUOT) - case EDQUOT: // Disk quota exceeded -#endif - case EMFILE: // Too many open files - case EMLINK: // Too many links - case ENFILE: // Too many open files in system - case ENOBUFS: // No buffer space available - case ENODATA: // No message is available on the STREAM read queue - case ENOMEM: // Not enough space - case ENOSR: // No STREAM resources -#if defined(EUSERS) - case EUSERS: // Too many users -#endif - return Error::ResourceExhausted; - -#if defined(ECHRNG) - case ECHRNG: // Channel number out of range -#endif - case EFBIG: // File too large - case EOVERFLOW: // Value too large to be stored in data type - case ERANGE: // Result too large - return Error::OutOfRange; - -#if defined(ENOPKG) - case ENOPKG: // Package not installed -#endif - case ENOSYS: // Function not implemented - case ENOTSUP: // Operation not supported - case EAFNOSUPPORT: // Address family not supported -#if defined(EPFNOSUPPORT) - case EPFNOSUPPORT: // Protocol family not supported -#endif - case EPROTONOSUPPORT: // Protocol not supported -#if defined(ESOCKTNOSUPPORT) - case ESOCKTNOSUPPORT: // Socket type not supported -#endif - case EXDEV: // Improper link - return Error::Unimplemented; - - case EAGAIN: // Resource temporarily unavailable -#if defined(ECOMM) - case ECOMM: // Communication error on send -#endif - case ECONNREFUSED: // Connection refused - case ECONNABORTED: // Connection aborted - case ECONNRESET: // Connection reset - case EINTR: // Interrupted function call -#if defined(EHOSTDOWN) - case EHOSTDOWN: // Host is down -#endif - case EHOSTUNREACH: // Host is unreachable - case ENETDOWN: // Network is down - case ENETRESET: // Connection aborted by network - case ENETUNREACH: // Network unreachable - case ENOLCK: // No locks available - case ENOLINK: // Link has been severed -#if defined(ENONET) - case ENONET: // Machine is not on the network -#endif - return Error::Unavailable; - - case EDEADLK: // Resource deadlock avoided -#if defined(ESTALE) - case ESTALE: // Stale file handle -#endif - return Error::Aborted; - - case ECANCELED: // Operation cancelled - return Error::Cancelled; - - default: - return Error::Unknown; - } -} - -Status Status::FromErrno(int errno_code, absl::string_view msg) { - if (errno_code == 0) { - return Status::OK(); - } - - Error canonical_code = CodeForErrno(errno_code); - return Status{canonical_code, - util::StringFormat("%s (errno %s: %s)", msg, errno_code, - StrError(errno_code))}; -} - -} // namespace util -} // namespace firestore -} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_win.cc b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_win.cc deleted file mode 100644 index 3b9543637..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_win.cc +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "Firestore/core/src/firebase/firestore/util/status.h" - -#if defined(_WIN32) - -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "Firestore/core/src/firebase/firestore/util/string_win.h" - -namespace firebase { -namespace firestore { -namespace util { - -/** - * Returns the Canonical error code for the given Windows API error code as - * obtained from GetLastError(). - */ -static Error CodeForLastError(DWORD error) { - switch (error) { - case ERROR_SUCCESS: - return Error::Ok; - - // return Error::Internal; - - case ERROR_INVALID_FUNCTION: - case ERROR_INVALID_HANDLE: - case ERROR_INVALID_NAME: - return Error::InvalidArgument; - - // return Error::DeadlineExceeded; - - case ERROR_FILE_NOT_FOUND: - case ERROR_PATH_NOT_FOUND: - case ERROR_INVALID_DRIVE: - case ERROR_BAD_NETPATH: - case ERROR_DEV_NOT_EXIST: - return Error::NotFound; - - case ERROR_FILE_EXISTS: - case ERROR_ALREADY_EXISTS: - return Error::AlreadyExists; - - case ERROR_ACCESS_DENIED: - case ERROR_INVALID_ACCESS: - case ERROR_SHARING_VIOLATION: - case ERROR_WRITE_PROTECT: - case ERROR_LOCK_VIOLATION: - return Error::PermissionDenied; - - // return Error::FailedPrecondition; - - case ERROR_TOO_MANY_OPEN_FILES: - case ERROR_NOT_ENOUGH_MEMORY: - case ERROR_OUTOFMEMORY: - case ERROR_NO_MORE_FILES: - case ERROR_DISK_FULL: - case ERROR_HANDLE_DISK_FULL: - return Error::ResourceExhausted; - - // return Error::OutOfRange; - - case ERROR_CALL_NOT_IMPLEMENTED: - return Error::Unimplemented; - - case ERROR_NOT_READY: - return Error::Unavailable; - - // return Error::Aborted; - - // return Error::Cancelled; - - default: - return Error::Unknown; - } -} - -Status Status::FromLastError(DWORD error, absl::string_view msg) { - if (error == ERROR_SUCCESS) { - return Status::OK(); - } - - Error canonical_code = CodeForLastError(error); - std::string error_text = LastErrorMessage(error); - return Status{canonical_code, util::StringFormat("%s (error %s: %s)", msg, - error, error_text)}; -} - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // defined(_WIN32) diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_util.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_util.h deleted file mode 100644 index 86acc56b2..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_util.h +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright 2017 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// Useful string functions and so forth. This is a grab-bag file. -// -// These functions work fine for UTF-8 strings as long as you can -// consider them to be just byte strings. For example, due to the -// design of UTF-8 you do not need to worry about accidental matches, -// as long as all your inputs are valid UTF-8 (use \uHHHH, not \xHH or \oOOO). - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_UTIL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_UTIL_H_ - -#include - -#include "absl/strings/string_view.h" - -namespace firebase { -namespace firestore { -namespace util { - -/** - * Returns the smallest lexicographically larger string of equal or smaller - * length. Returns an empty string if there is no such successor (if the input - * is empty or consists entirely of 0xff bytes). - * Useful for calculating the smallest lexicographically larger string - * that will not be prefixed by the input string. - * - * Examples: - * "a" -> "b", "aaa" -> "aab", "aa\xff" -> "ab", "\xff" -> "", "" -> "" - */ -std::string PrefixSuccessor(absl::string_view prefix); - -/** - * Returns the immediate lexicographically-following string. This is useful to - * turn an inclusive range into something that can be used with Bigtable's - * SetLimitRow(): - * - * // Inclusive range [min_element, max_element]. - * string min_element = ...; - * string max_element = ...; - * - * // Equivalent range [range_start, range_end). - * string range_start = min_element; - * string range_end = ImmediateSuccessor(max_element); - * - * WARNING: Returns the input string with a '\0' appended; if you call c_str() - * on the result, it will compare equal to s. - * - * WARNING: Transforms "" -> "\0"; this doesn't account for Bigtable's special - * treatment of "" as infinity. - */ -std::string ImmediateSuccessor(absl::string_view s); - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_UTIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/type_traits.h b/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/type_traits.h deleted file mode 100644 index d7ae2a1d6..000000000 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/type_traits.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2018 Google - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_TYPE_TRAITS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_TYPE_TRAITS_H_ - -#include -#include - -#include "absl/meta/type_traits.h" - -namespace firebase { -namespace firestore { -namespace util { - -// is_iterable - -template > -struct is_iterable : std::false_type {}; - -template -struct is_iterable< - T, - absl::void_t().begin(), std::declval().end())>> - : std::true_type {}; - -// is_associative_container - -template > -struct is_associative_container : std::false_type {}; - -template -struct is_associative_container< - T, - absl::void_t())>> - : std::true_type {}; - -} // namespace util -} // namespace firestore -} // namespace firebase - -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_TYPE_TRAITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/firestore_version.cc b/Pods/FirebaseFirestore/Firestore/core/src/firestore_version.cc similarity index 100% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/firestore_version.cc rename to Pods/FirebaseFirestore/Firestore/core/src/firestore_version.cc diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/geo_point.cc b/Pods/FirebaseFirestore/Firestore/core/src/geo_point.cc similarity index 96% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/geo_point.cc rename to Pods/FirebaseFirestore/Firestore/core/src/geo_point.cc index 08825daf7..1d379d39f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/geo_point.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/geo_point.cc @@ -19,7 +19,7 @@ #include #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/append_only_list.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/append_only_list.h similarity index 97% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/append_only_list.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/append_only_list.h index ad59fbd93..912042695 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/append_only_list.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/append_only_list.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_APPEND_ONLY_LIST_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_APPEND_ONLY_LIST_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_APPEND_ONLY_LIST_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_APPEND_ONLY_LIST_H_ #include #include @@ -250,4 +250,4 @@ class AppendOnlyList { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_APPEND_ONLY_LIST_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_APPEND_ONLY_LIST_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/array_sorted_map.h similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/array_sorted_map.h index 0e9bafc80..36a88f79b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/array_sorted_map.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_ARRAY_SORTED_MAP_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_ARRAY_SORTED_MAP_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_ARRAY_SORTED_MAP_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_ARRAY_SORTED_MAP_H_ #include #include @@ -25,11 +25,11 @@ #include #include -#include "Firestore/core/src/firebase/firestore/immutable/keys_view.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/range.h" +#include "Firestore/core/src/immutable/keys_view.h" +#include "Firestore/core/src/immutable/sorted_container.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/range.h" namespace firebase { namespace firestore { @@ -359,4 +359,4 @@ class ArraySortedMap : public SortedMapBase { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_ARRAY_SORTED_MAP_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_ARRAY_SORTED_MAP_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/keys_view.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/keys_view.h similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/keys_view.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/keys_view.h index ecce948eb..fad8510cd 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/keys_view.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/keys_view.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_KEYS_VIEW_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_KEYS_VIEW_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_KEYS_VIEW_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_KEYS_VIEW_H_ #include -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/iterator_adaptors.h" -#include "Firestore/core/src/firebase/firestore/util/range.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/iterator_adaptors.h" +#include "Firestore/core/src/util/range.h" namespace firebase { namespace firestore { @@ -84,4 +84,4 @@ auto KeysViewIn(const Range& range, } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_KEYS_VIEW_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_KEYS_VIEW_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/llrb_node.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node.h similarity index 96% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/llrb_node.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node.h index 4b8efaa0e..f6fb041e0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/llrb_node.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node.h @@ -14,14 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_LLRB_NODE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_LLRB_NODE_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/immutable/llrb_node_iterator.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" +#include "Firestore/core/src/immutable/llrb_node_iterator.h" +#include "Firestore/core/src/immutable/sorted_container.h" +#include "Firestore/core/src/util/comparison.h" namespace firebase { namespace firestore { @@ -463,4 +464,4 @@ void LlrbNode::FlipColor() { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_LLRB_NODE_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/llrb_node_iterator.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node_iterator.h similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/llrb_node_iterator.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node_iterator.h index 5915e5867..170ff9c0a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/llrb_node_iterator.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/llrb_node_iterator.h @@ -14,16 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_LLRB_NODE_ITERATOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_LLRB_NODE_ITERATOR_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_ITERATOR_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_ITERATOR_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/immutable/llrb_node.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { @@ -213,4 +212,4 @@ class LlrbNodeIterator { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_LLRB_NODE_ITERATOR_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_LLRB_NODE_ITERATOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_container.cc b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_container.cc rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.cc index 637270d3f..035017237 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_container.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" +#include "Firestore/core/src/immutable/sorted_container.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_container.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_container.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.h index 1cf5eb79c..f2cf1d755 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_container.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_container.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_CONTAINER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_CONTAINER_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_CONTAINER_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_CONTAINER_H_ #include @@ -76,4 +76,4 @@ class SortedMapBase : public SortedContainer { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_CONTAINER_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_CONTAINER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_map.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map.h similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_map.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map.h index 50580c4ee..7cf0a5be3 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_map.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map.h @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_MAP_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_MAP_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_H_ #include -#include "Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h" -#include "Firestore/core/src/firebase/firestore/immutable/keys_view.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_map_iterator.h" -#include "Firestore/core/src/firebase/firestore/immutable/tree_sorted_map.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/immutable/array_sorted_map.h" +#include "Firestore/core/src/immutable/keys_view.h" +#include "Firestore/core/src/immutable/sorted_container.h" +#include "Firestore/core/src/immutable/sorted_map_iterator.h" +#include "Firestore/core/src/immutable/tree_sorted_map.h" +#include "Firestore/core/src/util/comparison.h" #include "absl/base/attributes.h" #include "absl/types/optional.h" @@ -391,4 +391,4 @@ class SortedMap : public SortedMapBase { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_MAP_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_map_iterator.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map_iterator.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_map_iterator.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map_iterator.h index 264172c5d..e5651500a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/sorted_map_iterator.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_map_iterator.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_MAP_ITERATOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_MAP_ITERATOR_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_ITERATOR_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_ITERATOR_H_ #include -#include "Firestore/core/src/firebase/firestore/immutable/array_sorted_map.h" -#include "Firestore/core/src/firebase/firestore/immutable/tree_sorted_map.h" +#include "Firestore/core/src/immutable/array_sorted_map.h" +#include "Firestore/core/src/immutable/tree_sorted_map.h" namespace firebase { namespace firestore { @@ -191,4 +191,4 @@ class SortedMapIterator { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_SORTED_MAP_ITERATOR_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_MAP_ITERATOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_set.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_set.h new file mode 100644 index 000000000..31950be63 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/sorted_set.h @@ -0,0 +1,163 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_SET_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_SET_H_ + +#include +#include + +#include "Firestore/core/src/immutable/sorted_container.h" +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/empty.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" +#include "absl/base/attributes.h" + +namespace firebase { +namespace firestore { +namespace immutable { + +template > +class SortedSet : public SortedContainer { + public: + using map_type = SortedMap; + + using size_type = typename map_type::size_type; + using value_type = K; + + using const_iterator = typename map_type::const_key_iterator; + + explicit SortedSet(const C& comparator = C()) : map_{comparator} { + } + + explicit SortedSet(const map_type& map) : map_{map} { + } + + explicit SortedSet(map_type&& map) : map_{std::move(map)} { + } + + SortedSet(std::initializer_list entries, const C& comparator = {}) + : map_{comparator} { + for (auto&& value : entries) { + map_ = map_.insert(value, {}); + } + } + + bool empty() const { + return map_.empty(); + } + + size_type size() const { + return map_.size(); + } + + const C& comparator() const { + return map_.comparator(); + } + + ABSL_MUST_USE_RESULT SortedSet insert(const K& key) const { + return SortedSet{map_.insert(key, {})}; + } + + ABSL_MUST_USE_RESULT SortedSet union_with(const SortedSet& other) const { + const SortedSet* result_ptr = this; + const SortedSet* other_ptr = &other; + + // Make sure `result_ptr` always points to the larger one of the two sets. + if (result_ptr->size() < other_ptr->size()) { + result_ptr = other_ptr; + other_ptr = this; + } + + auto result = *result_ptr; + for (const auto& k : *other_ptr) { + result = result.insert(k); + } + return result; + } + + ABSL_MUST_USE_RESULT SortedSet erase(const K& key) const { + return SortedSet{map_.erase(key)}; + } + + bool contains(const K& key) const { + return map_.contains(key); + } + + const_iterator find(const K& key) const { + return const_iterator{map_.find(key)}; + } + + size_type find_index(const K& key) const { + return map_.find_index(key); + } + + const_iterator min() const { + return const_iterator{map_.min()}; + } + + const_iterator max() const { + return const_iterator{map_.max()}; + } + + const_iterator begin() const { + return const_iterator{map_.begin()}; + } + + const_iterator end() const { + return const_iterator{map_.end()}; + } + + /** + * Returns a view of this SortedSet containing just the keys that have been + * inserted that are greater than or equal to the given key. + */ + const util::range values_from(const K& key) const { + return map_.keys_from(key); + } + + /** + * Returns a view of this SortedSet containing just the keys that have been + * inserted that are greater than or equal to the given start_key and less + * than the given end_key. + */ + const util::range values_in(const K& start_key, + const K& end_key) const { + return map_.keys_in(start_key, end_key); + } + + friend bool operator==(const SortedSet& lhs, const SortedSet& rhs) { + if (lhs.size() != rhs.size()) { + return false; + } + return std::equal(lhs.begin(), lhs.end(), rhs.begin()); + } + + friend bool operator!=(const SortedSet& lhs, const SortedSet& rhs) { + return !(lhs == rhs); + } + + private: + map_type map_; +}; + +} // namespace immutable +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_SORTED_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/tree_sorted_map.h b/Pods/FirebaseFirestore/Firestore/core/src/immutable/tree_sorted_map.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/tree_sorted_map.h rename to Pods/FirebaseFirestore/Firestore/core/src/immutable/tree_sorted_map.h index 43a4cc0b4..0cabc1fc0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/immutable/tree_sorted_map.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/immutable/tree_sorted_map.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_TREE_SORTED_MAP_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_TREE_SORTED_MAP_H_ +#ifndef FIRESTORE_CORE_SRC_IMMUTABLE_TREE_SORTED_MAP_H_ +#define FIRESTORE_CORE_SRC_IMMUTABLE_TREE_SORTED_MAP_H_ #include #include @@ -23,11 +23,11 @@ #include #include -#include "Firestore/core/src/firebase/firestore/immutable/keys_view.h" -#include "Firestore/core/src/firebase/firestore/immutable/llrb_node.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/compressed_member.h" +#include "Firestore/core/src/immutable/keys_view.h" +#include "Firestore/core/src/immutable/llrb_node.h" +#include "Firestore/core/src/immutable/sorted_container.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/compressed_member.h" namespace firebase { namespace firestore { @@ -266,4 +266,4 @@ class TreeSortedMap : public SortedMapBase, private util::CompressedMember { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_IMMUTABLE_TREE_SORTED_MAP_H_ +#endif // FIRESTORE_CORE_SRC_IMMUTABLE_TREE_SORTED_MAP_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/document_key_reference.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.cc similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/document_key_reference.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.cc index 82bdeb28d..e5430c21e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/document_key_reference.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.cc @@ -14,14 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/document_key_reference.h" +#include "Firestore/core/src/local/document_key_reference.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/string_format.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/document_key_reference.h b/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.h similarity index 83% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/document_key_reference.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.h index 06d258802..71bba7a56 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/document_key_reference.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/document_key_reference.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_DOCUMENT_KEY_REFERENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_DOCUMENT_KEY_REFERENCE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_DOCUMENT_KEY_REFERENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_DOCUMENT_KEY_REFERENCE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/util/comparison.h" namespace firebase { namespace firestore { @@ -55,7 +55,7 @@ class DocumentKeyReference { } /** - * The targetId of a referring target or the batchId of a referring mutation + * The TargetId of a referring target or the BatchId of a referring mutation * batch. (Which this is depends upon which ReferenceSet this reference is * a part of.) */ @@ -94,4 +94,4 @@ class DocumentKeyReference { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_DOCUMENT_KEY_REFERENCE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_DOCUMENT_KEY_REFERENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/index_free_query_engine.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/index_free_query_engine.cc new file mode 100644 index 000000000..d6efaa4b2 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/index_free_query_engine.cc @@ -0,0 +1,151 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/index_free_query_engine.h" + +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/local/local_documents_view.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_set.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/util/log.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::LimitType; +using core::Query; +using core::Target; +using model::Document; +using model::DocumentKeySet; +using model::DocumentMap; +using model::DocumentSet; +using model::MaybeDocument; +using model::MaybeDocumentMap; +using model::SnapshotVersion; + +DocumentMap IndexFreeQueryEngine::GetDocumentsMatchingQuery( + const Query& query, + const SnapshotVersion& last_limbo_free_snapshot_version, + const DocumentKeySet& remote_keys) { + HARD_ASSERT(local_documents_view_, "SetLocalDocumentsView() not called"); + + // Queries that match all documents don't benefit from using IndexFreeQueries. + // It is more efficient to scan all documents in a collection, rather than to + // perform individual lookups. + if (query.MatchesAllDocuments()) { + return ExecuteFullCollectionScan(query); + } + + // Queries that have never seen a snapshot without limbo free documents should + // also be run as a full collection scan. + if (last_limbo_free_snapshot_version == SnapshotVersion::None()) { + return ExecuteFullCollectionScan(query); + } + + MaybeDocumentMap documents = local_documents_view_->GetDocuments(remote_keys); + DocumentSet previous_results = ApplyQuery(query, documents); + + if (query.limit_type() != LimitType::None && + NeedsRefill(query.limit_type(), previous_results, remote_keys, + last_limbo_free_snapshot_version)) { + return ExecuteFullCollectionScan(query); + } + + LOG_DEBUG("Re-using previous result from %s to execute query: %s", + last_limbo_free_snapshot_version.ToString(), query.ToString()); + + // Retrieve all results for documents that were updated since the last + // remote snapshot that did not contain any Limbo documents. + DocumentMap updated_results = + local_documents_view_->GetDocumentsMatchingQuery( + query, last_limbo_free_snapshot_version); + + // We merge `previous_results` into `update_results`, since `update_results` + // is already a DocumentMap. If a document is contained in both lists, then + // its contents are the same. + for (const Document& result : previous_results) { + updated_results = updated_results.insert(result.key(), result); + } + + return updated_results; +} + +DocumentSet IndexFreeQueryEngine::ApplyQuery( + const Query& query, const MaybeDocumentMap& documents) const { + // Sort the documents and re-apply the query filter since previously matching + // documents do not necessarily still match the query. + DocumentSet query_results(query.Comparator()); + + for (const auto& document_entry : documents) { + const MaybeDocument& maybe_doc = document_entry.second; + if (maybe_doc.is_document()) { + Document doc(maybe_doc); + if (query.Matches(doc)) { + query_results = query_results.insert(std::move(doc)); + } + } + } + return query_results; +} + +bool IndexFreeQueryEngine::NeedsRefill( + LimitType limit_type, + const DocumentSet& sorted_previous_results, + const DocumentKeySet& remote_keys, + const SnapshotVersion& limbo_free_snapshot_version) const { + // The query needs to be refilled if a previously matching document no longer + // matches. + if (remote_keys.size() != sorted_previous_results.size()) { + return true; + } + + // Limit queries are not eligible for index-free query execution if there is a + // potential that an older document from cache now sorts before a document + // that was previously part of the limit. + // This, however, can only happen if the document at the edge of the limit + // goes out of limit. If a document that is not the limit boundary sorts + // differently, the boundary of the limit itself did not change and documents + // from cache will continue to be "rejected" by this boundary. Therefore, we + // can ignore any modifications that don't affect the last document. + absl::optional document_at_limit_edge = + (limit_type == LimitType::First) + ? sorted_previous_results.GetLastDocument() + : sorted_previous_results.GetFirstDocument(); + if (!document_at_limit_edge) { + // We don't need to refill the query if there were already no documents. + return false; + } + return document_at_limit_edge->has_pending_writes() || + document_at_limit_edge->version() > limbo_free_snapshot_version; +} + +DocumentMap IndexFreeQueryEngine::ExecuteFullCollectionScan( + const Query& query) { + LOG_DEBUG("Using full collection scan to execute query: %s", + query.ToString()); + return local_documents_view_->GetDocumentsMatchingQuery( + query, SnapshotVersion::None()); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/index_free_query_engine.h b/Pods/FirebaseFirestore/Firestore/core/src/local/index_free_query_engine.h new file mode 100644 index 000000000..74055dd3b --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/index_free_query_engine.h @@ -0,0 +1,95 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_INDEX_FREE_QUERY_ENGINE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_INDEX_FREE_QUERY_ENGINE_H_ + +#include "Firestore/core/src/local/query_engine.h" +#include "Firestore/core/src/model/model_fwd.h" + +namespace firebase { +namespace firestore { + +namespace core { +enum class LimitType; +} // namespace core + +namespace local { + +/** + * A query engine that takes advantage of the target document mapping in the + * TargetCache. The IndexFreeQueryEngine optimizes query execution by only + * reading the documents that previously matched a query plus any documents that + * were edited after the query was last listened to. + * + * There are some cases where Index-Free queries are not guaranteed to + * produce the same results as full collection scans. In these cases, the + * IndexFreeQueryEngine falls back to full query processing. These cases are: + * + * - Limit queries where a document that matched the query previously no + * longer matches the query. + * - Limit queries where a document edit may cause the document to sort below + * another document that is in the local cache. + * - Queries that have never been CURRENT or free of Limbo documents. + */ +class IndexFreeQueryEngine : public QueryEngine { + public: + void SetLocalDocumentsView(LocalDocumentsView* local_documents) override { + local_documents_view_ = local_documents; + } + + model::DocumentMap GetDocumentsMatchingQuery( + const core::Query& query, + const model::SnapshotVersion& last_limbo_free_snapshot_version, + const model::DocumentKeySet& remote_keys) override; + + Type type() const override { + return Type::IndexFree; + } + + private: + /** Applies the query filter and sorting to the provided documents. */ + model::DocumentSet ApplyQuery(const core::Query& query, + const model::MaybeDocumentMap& documents) const; + + /** + * Determines if a limit query needs to be refilled from cache, making it + * ineligible for index-free execution. + * + * @param limit_type The type of limit query for refill calculation. + * @param sorted_previous_results The documents that matched the query when it + * was last synchronized, sorted by the query's comparator. + * @param remote_keys The document keys that matched the query at the last + * snapshot. + * @param limbo_free_snapshot_version The version of the snapshot when the + * query was last synchronized. + */ + bool NeedsRefill( + core::LimitType limit_type, + const model::DocumentSet& sorted_previous_results, + const model::DocumentKeySet& remote_keys, + const model::SnapshotVersion& limbo_free_snapshot_version) const; + + model::DocumentMap ExecuteFullCollectionScan(const core::Query& query); + + LocalDocumentsView* local_documents_view_ = nullptr; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_INDEX_FREE_QUERY_ENGINE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/index_manager.h b/Pods/FirebaseFirestore/Firestore/core/src/local/index_manager.h similarity index 80% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/index_manager.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/index_manager.h index c4bad32eb..c0fe9401b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/index_manager.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/index_manager.h @@ -14,16 +14,19 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_INDEX_MANAGER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_INDEX_MANAGER_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_INDEX_MANAGER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_INDEX_MANAGER_H_ #include #include -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" - namespace firebase { namespace firestore { + +namespace model { +class ResourcePath; +} // namespace model + namespace local { /** @@ -34,11 +37,10 @@ namespace local { */ class IndexManager { public: - virtual ~IndexManager() { - } + virtual ~IndexManager() = default; /** - * Creates an index entry mapping the collectionId (last segment of the path) + * Creates an index entry mapping the collection_id (last segment of the path) * to the parent path (either the containing document location or the empty * path for root-level collections). Index entries can be retrieved via * GetCollectionParents(). @@ -50,7 +52,7 @@ class IndexManager { const model::ResourcePath& collection_path) = 0; /** - * Retrieves all parent locations containing the given collectionId, as a set + * Retrieves all parent locations containing the given collection_id, as a set * of paths (each path being either a document location or the empty path for * a root-level collection). */ @@ -62,4 +64,4 @@ class IndexManager { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_INDEX_MANAGER_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_INDEX_MANAGER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc new file mode 100644 index 000000000..9cbf11eb1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.cc @@ -0,0 +1,76 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_index_manager.h" + +#include +#include + +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/memory_index_manager.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { + +using model::ResourcePath; + +LevelDbIndexManager::LevelDbIndexManager(LevelDbPersistence* db) : db_(db) { +} + +void LevelDbIndexManager::AddToCollectionParentIndex( + const ResourcePath& collection_path) { + HARD_ASSERT(collection_path.size() % 2 == 1, "Expected a collection path."); + + if (collection_parents_cache_.Add(collection_path)) { + std::string collection_id = collection_path.last_segment(); + ResourcePath parent_path = collection_path.PopLast(); + + std::string key = + LevelDbCollectionParentKey::Key(collection_id, parent_path); + std::string empty_buffer; + db_->current_transaction()->Put(key, empty_buffer); + } +} + +std::vector LevelDbIndexManager::GetCollectionParents( + const std::string& collection_id) { + std::vector results; + + auto index_iterator = db_->current_transaction()->NewIterator(); + std::string index_prefix = + LevelDbCollectionParentKey::KeyPrefix(collection_id); + LevelDbCollectionParentKey row_key; + for (index_iterator->Seek(index_prefix); index_iterator->Valid(); + index_iterator->Next()) { + if (!absl::StartsWith(index_iterator->key(), index_prefix) || + !row_key.Decode(index_iterator->key()) || + row_key.collection_id() != collection_id) { + break; + } + + results.push_back(row_key.parent()); + } + return results; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_index_manager.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_index_manager.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.h index 7e6ff3789..233b8dd58 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_index_manager.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_index_manager.h @@ -14,15 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_INDEX_MANAGER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_INDEX_MANAGER_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_INDEX_MANAGER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_INDEX_MANAGER_H_ #include #include -#include "Firestore/core/src/firebase/firestore/local/index_manager.h" -#include "Firestore/core/src/firebase/firestore/local/memory_index_manager.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" +#include "Firestore/core/src/local/index_manager.h" +#include "Firestore/core/src/local/memory_index_manager.h" namespace firebase { namespace firestore { @@ -59,4 +58,4 @@ class LevelDbIndexManager : public IndexManager { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_INDEX_MANAGER_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_INDEX_MANAGER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_key.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_key.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.cc index e0f632896..db581ccb7 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_key.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.cc @@ -14,13 +14,14 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_key.h" #include #include -#include "Firestore/core/src/firebase/firestore/local/leveldb_util.h" -#include "Firestore/core/src/firebase/firestore/util/ordered_code.h" +#include "Firestore/core/src/local/leveldb_util.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/util/ordered_code.h" #include "absl/base/attributes.h" #include "absl/strings/escaping.h" #include "absl/strings/str_cat.h" @@ -46,6 +47,7 @@ const char* kTargetDocumentsTable = "target_document"; const char* kDocumentTargetsTable = "document_target"; const char* kRemoteDocumentsTable = "remote_document"; const char* kCollectionParentsTable = "collection_parent"; +const char* kRemoteDocumentReadTimeTable = "remote_document_read_time"; /** * Labels for the components of keys. These serve to make keys self-describing. @@ -96,6 +98,15 @@ enum ComponentLabel { */ CollectionId = 14, + /** + * A component containing a standalone document ID (as used by the + * remote_document_read_time table). + */ + DocumentId = 15, + + /** A component containing a snapshot version. */ + SnapshotVersion = 16, + /** * A path segment describes just a single segment in a resource path. Path * segments that occur sequentially in a key represent successive segments in @@ -170,6 +181,16 @@ class Reader { return ReadLabeledString(ComponentLabel::CollectionId); } + std::string ReadDocumentId() { + return ReadLabeledString(ComponentLabel::DocumentId); + } + + /** + * Reads a snapshot version, encoded as a component label and a pair of + * seconds (int64) and nanoseconds (int32). + */ + model::SnapshotVersion ReadSnapshotVersion(); + /** * Reads component labels and strings from the key until it finds a component * label other than ComponentLabel::PathSegment (or the key is exhausted). @@ -322,6 +343,18 @@ class Reader { return ReadInt32(); } + /** + * Reads a signed number from the key. + * + * If the read is unsuccessful, returns 0 and fails the Reader. + * + * Otherwise, returns the number and advances the Reader to the next unread + * byte. + */ + int64_t ReadInt64() { + return ReadSignedNumIncreasing(); + } + /** * Reads a component label and a string from the key verifies that the label * matches the expected_label. @@ -408,6 +441,17 @@ DocumentKey Reader::ReadDocumentKey() { return DocumentKey{}; } +model::SnapshotVersion Reader::ReadSnapshotVersion() { + if (!ReadComponentLabelMatching(ComponentLabel::SnapshotVersion)) { + Fail(); + } + + int64_t seconds = ReadInt64(); + int32_t nanos = ReadInt32(); + + return model::SnapshotVersion({seconds, nanos}); +} + /** * Returns a base64-encoded string for an invalid key, used for debug-friendly * description text. @@ -485,6 +529,18 @@ std::string Reader::Describe() { absl::StrAppend(&description, " collection_id=", collection_id); } + } else if (label == ComponentLabel::DocumentId) { + std::string document_id = ReadDocumentId(); + if (ok_) { + absl::StrAppend(&description, " document_id=", document_id); + } + + } else if (label == ComponentLabel::SnapshotVersion) { + model::SnapshotVersion snapshot_version = ReadSnapshotVersion(); + if (ok_) { + absl::StrAppend(&description, + " snapshot_version=", snapshot_version.ToString()); + } } else { absl::StrAppend(&description, " unknown label=", static_cast(label)); Fail(); @@ -536,6 +592,18 @@ class Writer { WriteLabeledString(ComponentLabel::CollectionId, collection_id); } + void WriteDocumentId(absl::string_view document_id) { + WriteLabeledString(ComponentLabel::DocumentId, document_id); + } + + void WriteSnapshotVersion(model::SnapshotVersion snapshot_version) { + WriteComponentLabel(ComponentLabel::SnapshotVersion); + OrderedCode::WriteSignedNumIncreasing( + &dest_, snapshot_version.timestamp().seconds()); + OrderedCode::WriteSignedNumIncreasing( + &dest_, snapshot_version.timestamp().nanoseconds()); + } + /** * For each segment in the given resource path writes a * ComponentLabel::PathSegment component label and a string containing the @@ -915,6 +983,39 @@ bool LevelDbCollectionParentKey::Decode(absl::string_view key) { return reader.ok(); } +std::string LevelDbRemoteDocumentReadTimeKey::KeyPrefix( + const model::ResourcePath& collection_path, + model::SnapshotVersion read_time) { + Writer writer; + writer.WriteTableName(kRemoteDocumentReadTimeTable); + writer.WriteResourcePath(collection_path); + writer.WriteSnapshotVersion(read_time); + return writer.result(); +} + +std::string LevelDbRemoteDocumentReadTimeKey::Key( + const model::ResourcePath& collection_path, + model::SnapshotVersion read_time, + absl::string_view document_id) { + Writer writer; + writer.WriteTableName(kRemoteDocumentReadTimeTable); + writer.WriteResourcePath(collection_path); + writer.WriteSnapshotVersion(read_time); + writer.WriteDocumentId(document_id); + writer.WriteTerminator(); + return writer.result(); +} + +bool LevelDbRemoteDocumentReadTimeKey::Decode(absl::string_view key) { + Reader reader{key}; + reader.ReadTableNameMatching(kRemoteDocumentReadTimeTable); + collection_path_ = reader.ReadResourcePath(); + read_time_ = reader.ReadSnapshotVersion(); + document_id_ = reader.ReadDocumentId(); + reader.ReadTerminator(); + return reader.ok(); +} + } // namespace local } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_key.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_key.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.h index 574907b67..7614e2b77 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_key.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_key.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_KEY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_KEY_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_KEY_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_KEY_H_ #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/types.h" #include "absl/strings/string_view.h" #include "leveldb/slice.h" @@ -83,6 +83,12 @@ namespace local { // - table_name: string = "collection_parent" // - collectionId: string // - parent: ResourcePath +// +// remote_document_read_time: +// - table_name: string = "remote_document_read_time" +// - collection: ResourcePath +// - read_time: SnapshotVersion +// - document_id: string /** * Parses the given key and returns a human readable description of its @@ -577,8 +583,60 @@ class LevelDbCollectionParentKey { model::ResourcePath parent_; }; +/** + * A key in the remote documents read time table, storing the collection path, + * read time and document ID for each entry. + */ +class LevelDbRemoteDocumentReadTimeKey { + public: + /** + * Creates a key prefix that points just before the first key for the given + * collection_path and read_time. + */ + static std::string KeyPrefix(const model::ResourcePath& collection_path, + model::SnapshotVersion read_time); + + /** + * Creates a key that points to the key for the given collection_path, + * read_time and document_id. + */ + static std::string Key(const model::ResourcePath& collection_path, + model::SnapshotVersion read_time, + absl::string_view document_id); + /** + * Decodes the given complete key, storing the decoded values in this + * instance. + * + * @return true if the key successfully decoded, false otherwise. If false is + * returned, this instance is in an undefined state until the next call to + * `Decode()`. + */ + ABSL_MUST_USE_RESULT + bool Decode(absl::string_view key); + + /** The collection path for this entry. */ + const model::ResourcePath& collection_path() const { + return collection_path_; + } + + /** The read time for for this entry. */ + model::SnapshotVersion read_time() const { + return read_time_; + } + + /** The document ID for this entry. */ + const std::string& document_id() const { + return document_id_; + } + + private: + std::string document_id_; + model::ResourcePath collection_path_; + model::SnapshotVersion read_time_; +}; + } // namespace local } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_KEY_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_KEY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.cc new file mode 100644 index 000000000..0e2b3dae7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.cc @@ -0,0 +1,193 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_lru_reference_delegate.h" + +#include +#include +#include + +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/listen_sequence.h" +#include "Firestore/core/src/local/reference_set.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/memory/memory.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { + +using model::DocumentKey; +using model::ListenSequenceNumber; +using model::ResourcePath; +using util::StatusOr; + +LevelDbLruReferenceDelegate::LevelDbLruReferenceDelegate( + LevelDbPersistence* persistence, LruParams lru_params) + : db_(persistence) { + gc_ = absl::make_unique(this, lru_params); +} + +// Explicit default the destructor after all forward declared types have been +// fully declared. +LevelDbLruReferenceDelegate::~LevelDbLruReferenceDelegate() = default; + +void LevelDbLruReferenceDelegate::Start() { + ListenSequenceNumber highest_sequence_number = + db_->target_cache()->highest_listen_sequence_number(); + listen_sequence_ = absl::make_unique(highest_sequence_number); +} + +void LevelDbLruReferenceDelegate::AddInMemoryPins(ReferenceSet* set) { + // We should be able to assert that additional_references_ is nullptr, but + // due to restarts in spec tests it would fail. + additional_references_ = set; +} + +void LevelDbLruReferenceDelegate::AddReference(const DocumentKey& key) { + WriteSentinel(key); +} + +void LevelDbLruReferenceDelegate::RemoveReference(const DocumentKey& key) { + WriteSentinel(key); +} + +void LevelDbLruReferenceDelegate::RemoveMutationReference( + const DocumentKey& key) { + WriteSentinel(key); +} + +void LevelDbLruReferenceDelegate::RemoveTarget(const TargetData& target_data) { + TargetData updated = + target_data.WithSequenceNumber(current_sequence_number()); + db_->target_cache()->UpdateTarget(std::move(updated)); +} + +void LevelDbLruReferenceDelegate::UpdateLimboDocument(const DocumentKey& key) { + WriteSentinel(key); +} + +ListenSequenceNumber LevelDbLruReferenceDelegate::current_sequence_number() + const { + HARD_ASSERT(current_sequence_number_ != kListenSequenceNumberInvalid, + "Asking for a sequence number outside of a transaction"); + return current_sequence_number_; +} + +void LevelDbLruReferenceDelegate::OnTransactionStarted(absl::string_view) { + HARD_ASSERT(current_sequence_number_ == kListenSequenceNumberInvalid, + "Previous sequence number is still in effect"); + current_sequence_number_ = listen_sequence_->Next(); +} + +void LevelDbLruReferenceDelegate::OnTransactionCommitted() { + current_sequence_number_ = kListenSequenceNumberInvalid; +} + +LruGarbageCollector* LevelDbLruReferenceDelegate::garbage_collector() { + return gc_.get(); +} + +StatusOr LevelDbLruReferenceDelegate::CalculateByteSize() { + return db_->CalculateByteSize(); +} + +size_t LevelDbLruReferenceDelegate::GetSequenceNumberCount() { + size_t total_count = db_->target_cache()->size(); + EnumerateOrphanedDocuments( + [&total_count](const DocumentKey&, ListenSequenceNumber) { + total_count++; + }); + return total_count; +} + +void LevelDbLruReferenceDelegate::EnumerateTargets( + const TargetCallback& callback) { + db_->target_cache()->EnumerateTargets(callback); +} + +void LevelDbLruReferenceDelegate::EnumerateOrphanedDocuments( + const OrphanedDocumentCallback& callback) { + db_->target_cache()->EnumerateOrphanedDocuments(callback); +} + +int LevelDbLruReferenceDelegate::RemoveOrphanedDocuments( + ListenSequenceNumber upper_bound) { + int count = 0; + db_->target_cache()->EnumerateOrphanedDocuments( + [&](const DocumentKey& key, ListenSequenceNumber sequence_number) { + if (sequence_number <= upper_bound) { + if (!IsPinned(key)) { + count++; + db_->remote_document_cache()->Remove(key); + RemoveSentinel(key); + } + } + }); + return count; +} + +int LevelDbLruReferenceDelegate::RemoveTargets( + ListenSequenceNumber sequence_number, const LiveQueryMap& live_queries) { + return db_->target_cache()->RemoveTargets(sequence_number, live_queries); +} + +bool LevelDbLruReferenceDelegate::IsPinned(const DocumentKey& key) { + if (additional_references_->ContainsKey(key)) { + return true; + } + return MutationQueuesContainKey(key); +} + +bool LevelDbLruReferenceDelegate::MutationQueuesContainKey( + const DocumentKey& key) { + const std::set& users = db_->users(); + const ResourcePath& path = key.path(); + std::string buffer; + auto it = db_->current_transaction()->NewIterator(); + // For each user, if there is any batch that contains this document in any + // batch, we know it's pinned. + for (const std::string& user : users) { + std::string mutation_key = + LevelDbDocumentMutationKey::KeyPrefix(user, path); + it->Seek(mutation_key); + if (it->Valid() && absl::StartsWith(it->key(), mutation_key)) { + return true; + } + } + return false; +} + +void LevelDbLruReferenceDelegate::RemoveSentinel(const DocumentKey& key) { + db_->current_transaction()->Delete( + LevelDbDocumentTargetKey::SentinelKey(key)); +} + +void LevelDbLruReferenceDelegate::WriteSentinel(const DocumentKey& key) { + std::string sentinel_key = LevelDbDocumentTargetKey::SentinelKey(key); + std::string encoded_sequence_number = + LevelDbDocumentTargetKey::EncodeSentinelValue(current_sequence_number()); + db_->current_transaction()->Put(sentinel_key, encoded_sequence_number); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.h index 5d14f861c..7c0fe5fcb 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_lru_reference_delegate.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_lru_reference_delegate.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ #include -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" namespace firebase { namespace firestore { @@ -46,7 +46,7 @@ class LevelDbLruReferenceDelegate : public LruDelegate { void AddReference(const model::DocumentKey& key) override; void RemoveReference(const model::DocumentKey& key) override; void RemoveMutationReference(const model::DocumentKey& key) override; - void RemoveTarget(const local::QueryData& query_data) override; + void RemoveTarget(const local::TargetData& target_data) override; void UpdateLimboDocument(const model::DocumentKey& key) override; @@ -57,7 +57,7 @@ class LevelDbLruReferenceDelegate : public LruDelegate { LruGarbageCollector* garbage_collector() override; - int64_t CalculateByteSize() override; + util::StatusOr CalculateByteSize() override; size_t GetSequenceNumberCount() override; void EnumerateTargets(const TargetCallback& callback) override; @@ -85,7 +85,7 @@ class LevelDbLruReferenceDelegate : public LruDelegate { ReferenceSet* additional_references_; // This needs to be a pointer because initialization is delayed until after - // we read from the query cache. + // we read from the target cache. std::unique_ptr listen_sequence_; // The current sequence number for the currently active transaction. If no @@ -98,4 +98,4 @@ class LevelDbLruReferenceDelegate : public LruDelegate { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_LRU_REFERENCE_DELEGATE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_migrations.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.cc similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_migrations.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.cc index f05ff7e59..11633bfb1 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_migrations.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.cc @@ -14,19 +14,20 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/leveldb_migrations.h" +#include "Firestore/core/src/local/leveldb_migrations.h" #include #include #include "Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h" #include "Firestore/Protos/nanopb/firestore/local/target.nanopb.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" -#include "Firestore/core/src/firebase/firestore/local/memory_index_manager.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/nanopb/reader.h" -#include "Firestore/core/src/firebase/firestore/nanopb/writer.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/memory_index_manager.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/nanopb/writer.h" #include "absl/strings/match.h" namespace firebase { @@ -39,7 +40,8 @@ using leveldb::Status; using leveldb::WriteOptions; using model::DocumentKey; using model::ResourcePath; -using nanopb::Reader; +using nanopb::Message; +using nanopb::StringReader; using nanopb::Writer; namespace { @@ -113,8 +115,7 @@ void ClearQueryCache(leveldb::DB* db) { firestore_client_TargetGlobal target_global{}; nanopb::StringWriter writer; - writer.WriteNanopbMessage(firestore_client_TargetGlobal_fields, - &target_global); + writer.Write(firestore_client_TargetGlobal_fields, &target_global); transaction.Put(LevelDbTargetGlobalKey::Key(), writer.Release()); SaveVersion(3, &transaction); @@ -172,15 +173,14 @@ void RemoveAcknowledgedMutations(leveldb::DB* db) { for (; it->Valid() && absl::StartsWith(it->key(), mutation_queue_start); it->Next()) { HARD_ASSERT(key.Decode(it->key()), "Failed to decode mutation queue key"); - firestore_client_MutationQueue mutation_queue{}; - Reader reader(it->value()); - reader.ReadNanopbMessage(firestore_client_MutationQueue_fields, - &mutation_queue); + StringReader reader(it->value()); + auto mutation_queue = + Message::TryParse(&reader); HARD_ASSERT(reader.status().ok(), "Failed to deserialize MutationQueue"); RemoveMutationBatches(&transaction, key.user_id(), - mutation_queue.last_acknowledged_batch_id); + mutation_queue->last_acknowledged_batch_id); RemoveMutationDocuments(&transaction, key.user_id(), - mutation_queue.last_acknowledged_batch_id); + mutation_queue->last_acknowledged_batch_id); } SaveVersion(5, &transaction); @@ -195,11 +195,10 @@ model::ListenSequenceNumber GetHighestSequenceNumber( std::string bytes; transaction->Get(LevelDbTargetGlobalKey::Key(), &bytes); - firestore_client_TargetGlobal target_global{}; - Reader reader(bytes); - reader.ReadNanopbMessage(firestore_client_TargetGlobal_fields, - &target_global); - return target_global.highest_listen_sequence_number; + StringReader reader(bytes); + auto target_global = + Message::TryParse(&reader); + return target_global->highest_listen_sequence_number; } /** diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_migrations.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_migrations.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.h index d073ce329..2f3417848 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_migrations.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_migrations.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_MIGRATIONS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_MIGRATIONS_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MIGRATIONS_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MIGRATIONS_H_ #include -#include "Firestore/core/src/firebase/firestore/local/leveldb_transaction.h" -#include "Firestore/core/src/firebase/firestore/local/local_serializer.h" +#include "Firestore/core/src/local/leveldb_transaction.h" +#include "Firestore/core/src/local/local_serializer.h" #include "leveldb/db.h" namespace firebase { @@ -53,4 +53,4 @@ class LevelDbMigrations { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_MIGRATIONS_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MIGRATIONS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.cc new file mode 100644 index 000000000..194f98c7c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.cc @@ -0,0 +1,502 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_mutation_queue.h" + +#include +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/leveldb_transaction.h" +#include "Firestore/core/src/local/leveldb_util.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/util/string_util.h" +#include "Firestore/core/src/util/to_string.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { + +using auth::User; +using core::Query; +using leveldb::DB; +using leveldb::Iterator; +using leveldb::Status; +using model::BatchId; +using model::DocumentKey; +using model::DocumentKeySet; +using model::kBatchIdUnknown; +using model::Mutation; +using model::MutationBatch; +using model::ResourcePath; +using nanopb::ByteString; +using nanopb::Message; +using nanopb::StringReader; + +BatchId LoadNextBatchIdFromDb(DB* db) { + // TODO(gsoltis): implement Prev() and SeekToLast() on + // LevelDbTransaction::Iterator, then port this to a transaction. + std::unique_ptr it( + db->NewIterator(LevelDbTransaction::DefaultReadOptions())); + + std::string table_key = LevelDbMutationKey::KeyPrefix(); + + LevelDbMutationKey row_key; + BatchId max_batch_id = 0; + + bool more_user_ids = false; + std::string next_user_id; + + it->Seek(table_key); + if (it->Valid() && row_key.Decode(MakeStringView(it->key()))) { + more_user_ids = true; + next_user_id = row_key.user_id(); + } + + // This loop assumes that next_user_id contains the next username at the start + // of the iteration. + while (more_user_ids) { + // Compute the first key after the last mutation for next_user_id. + std::string user_end = LevelDbMutationKey::KeyPrefix(next_user_id); + user_end = util::PrefixSuccessor(user_end); + + // Seek to that key with the intent of finding the boundary between + // next_user_id's mutations and the one after that (if any). + it->Seek(user_end); + + // At this point there are three possible cases to handle differently. Each + // case must prepare the next iteration (by assigning to next_user_id or + // setting more_user_ids = false) and seek the iterator to the last row in + // the current user's mutation sequence. + if (!it->Valid()) { + // The iterator is past the last row altogether (there are no additional + // user_ids and now rows in any table after mutations). The last row will + // have the highest batch_id. + more_user_ids = false; + it->SeekToLast(); + + } else if (row_key.Decode(MakeStringView(it->key()))) { + // The iterator is valid and the key decoded successfully so the next user + // was just decoded. + next_user_id = row_key.user_id(); + it->Prev(); + + } else { + // The iterator is past the end of the mutations table but there are other + // rows. + more_user_ids = false; + it->Prev(); + } + + // In all the cases above there was at least one row for the current user + // and each case has set things up such that iterator points to it. + if (!row_key.Decode(MakeStringView(it->key()))) { + HARD_FAIL("There should have been a key previous to %s", user_end); + } + + if (row_key.batch_id() > max_batch_id) { + max_batch_id = row_key.batch_id(); + } + } + + return max_batch_id + 1; +} + +LevelDbMutationQueue::LevelDbMutationQueue(const User& user, + LevelDbPersistence* db, + LocalSerializer* serializer) + : db_(NOT_NULL(db)), + serializer_(NOT_NULL(serializer)), + user_id_(user.is_authenticated() ? user.uid() : "") { +} + +void LevelDbMutationQueue::Start() { + next_batch_id_ = LoadNextBatchIdFromDb(db_->ptr()); + metadata_ = MetadataForKey(mutation_queue_key()); +} + +bool LevelDbMutationQueue::IsEmpty() { + std::string user_key = LevelDbMutationKey::KeyPrefix(user_id_); + + auto it = db_->current_transaction()->NewIterator(); + it->Seek(user_key); + + bool empty = true; + if (it->Valid() && absl::StartsWith(it->key(), user_key)) { + empty = false; + } + return empty; +} + +void LevelDbMutationQueue::AcknowledgeBatch(const MutationBatch&, + const ByteString& stream_token) { + SetLastStreamToken(stream_token); +} + +MutationBatch LevelDbMutationQueue::AddMutationBatch( + const Timestamp& local_write_time, + std::vector&& base_mutations, + std::vector&& mutations) { + BatchId batch_id = next_batch_id_; + next_batch_id_++; + + MutationBatch batch(batch_id, local_write_time, std::move(base_mutations), + std::move(mutations)); + std::string key = mutation_batch_key(batch_id); + db_->current_transaction()->Put(key, serializer_->EncodeMutationBatch(batch)); + + // Store an empty value in the index which is equivalent to serializing a + // GPBEmpty message. In the future if we wanted to store some other kind of + // value here, we can parse these empty values as with some other protocol + // buffer (and the parser will see all default values). + std::string empty_buffer; + + for (const Mutation& mutation : batch.mutations()) { + key = LevelDbDocumentMutationKey::Key(user_id_, mutation.key(), batch_id); + db_->current_transaction()->Put(key, empty_buffer); + + db_->index_manager()->AddToCollectionParentIndex( + mutation.key().path().PopLast()); + } + + return batch; +} + +void LevelDbMutationQueue::RemoveMutationBatch(const MutationBatch& batch) { + auto check_iterator = db_->current_transaction()->NewIterator(); + + BatchId batch_id = batch.batch_id(); + std::string key = mutation_batch_key(batch_id); + + // As a sanity check, verify that the mutation batch exists before deleting + // it. + check_iterator->Seek(key); + HARD_ASSERT(check_iterator->Valid(), "Mutation batch %s did not exist", + DescribeKey(key)); + + HARD_ASSERT(key == check_iterator->key(), + "Mutation batch %s not found; found %s", DescribeKey(key), + DescribeKey(check_iterator->key())); + + db_->current_transaction()->Delete(key); + + for (const Mutation& mutation : batch.mutations()) { + key = LevelDbDocumentMutationKey::Key(user_id_, mutation.key(), batch_id); + db_->current_transaction()->Delete(key); + db_->reference_delegate()->RemoveMutationReference(mutation.key()); + } +} + +std::vector LevelDbMutationQueue::AllMutationBatches() { + std::string user_key = LevelDbMutationKey::KeyPrefix(user_id_); + + auto it = db_->current_transaction()->NewIterator(); + it->Seek(user_key); + std::vector result; + for (; it->Valid() && absl::StartsWith(it->key(), user_key); it->Next()) { + result.push_back(ParseMutationBatch(it->value())); + } + return result; +} + +std::vector +LevelDbMutationQueue::AllMutationBatchesAffectingDocumentKeys( + const DocumentKeySet& document_keys) { + // Take a pass through the document keys and collect the set of unique + // mutation batch_ids that affect them all. Some batches can affect more than + // one key. + std::set batch_ids; + + auto index_iterator = db_->current_transaction()->NewIterator(); + LevelDbDocumentMutationKey row_key; + for (const DocumentKey& document_key : document_keys) { + std::string index_prefix = + LevelDbDocumentMutationKey::KeyPrefix(user_id_, document_key.path()); + for (index_iterator->Seek(index_prefix); index_iterator->Valid(); + index_iterator->Next()) { + // Only consider rows matching exactly the specific key of interest. Index + // rows have this form (with markers in brackets): + // + // user collection doc 2 + // user collection doc 3 + // user collection doc sub doc 3 + // + // + // Note that Path markers sort after BatchId markers so this means that + // when searching for collection/doc, all the entries for it will be + // contiguous in the table, allowing a break after any mismatch. + if (!absl::StartsWith(index_iterator->key(), index_prefix) || + !row_key.Decode(index_iterator->key()) || + row_key.document_key() != document_key) { + break; + } + + batch_ids.insert(row_key.batch_id()); + } + } + + return AllMutationBatchesWithIds(batch_ids); +} + +std::vector +LevelDbMutationQueue::AllMutationBatchesAffectingDocumentKey( + const DocumentKey& key) { + return AllMutationBatchesAffectingDocumentKeys(DocumentKeySet{key}); +} + +std::vector +LevelDbMutationQueue::AllMutationBatchesAffectingQuery(const Query& query) { + HARD_ASSERT(!query.IsDocumentQuery(), + "Document queries shouldn't go down this path"); + HARD_ASSERT( + !query.IsCollectionGroupQuery(), + "CollectionGroup queries should be handled in LocalDocumentsView"); + + const ResourcePath& query_path = query.path(); + size_t immediate_children_path_length = query_path.size() + 1; + + // TODO(mcg): Actually implement a single-collection query + // + // This is actually executing an ancestor query, traversing the whole subtree + // below the collection which can be horrifically inefficient for some + // structures. The right way to solve this is to implement the full value + // index, but that's not in the cards in the near future so this is the best + // we can do for the moment. + // + // Since we don't yet index the actual properties in the mutations, our + // current approach is to just return all mutation batches that affect + // documents in the collection being queried. + // + // Unlike AllMutationBatchesAffectingDocumentKey, this iteration will scan the + // document-mutation index for more than a single document so the associated + // batch_ids will be neither necessarily unique nor in order. This means an + // efficient simultaneous scan isn't possible. + std::string index_prefix = + LevelDbDocumentMutationKey::KeyPrefix(user_id_, query_path); + auto index_iterator = db_->current_transaction()->NewIterator(); + index_iterator->Seek(index_prefix); + + LevelDbDocumentMutationKey row_key; + + // Collect up unique batch_ids encountered during a scan of the index. Use a + // set to accumulate the IDs so they can be traversed in order in a + // scan of the main table. + // + // This method is faster than performing lookups of the keys with _db->Get and + // keeping a hash of batch_ids that have already been looked up. The + // performance difference is minor for small numbers of keys but > 30% faster + // for larger numbers of keys. + std::set unique_batch_ids; + for (; index_iterator->Valid(); index_iterator->Next()) { + if (!absl::StartsWith(index_iterator->key(), index_prefix) || + !row_key.Decode(index_iterator->key())) { + break; + } + + // Rows with document keys more than one segment longer than the query path + // can't be matches. For example, a query on 'rooms' can't match the + // document /rooms/abc/messages/xyx. + // TODO(mcg): we'll need a different scanner when we implement ancestor + // queries. + if (row_key.document_key().path().size() != + immediate_children_path_length) { + continue; + } + + unique_batch_ids.insert(row_key.batch_id()); + } + + return AllMutationBatchesWithIds(unique_batch_ids); +} + +absl::optional LevelDbMutationQueue::LookupMutationBatch( + model::BatchId batch_id) { + std::string key = mutation_batch_key(batch_id); + + std::string value; + Status status = db_->current_transaction()->Get(key, &value); + if (!status.ok()) { + if (status.IsNotFound()) { + return absl::nullopt; + } + HARD_FAIL("Lookup mutation batch (%s, %s) failed with status: %s", user_id_, + batch_id, status.ToString()); + } + + return ParseMutationBatch(value); +} + +absl::optional +LevelDbMutationQueue::NextMutationBatchAfterBatchId(model::BatchId batch_id) { + BatchId next_batch_id = batch_id + 1; + + std::string key = mutation_batch_key(next_batch_id); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(key); + + LevelDbMutationKey row_key; + if (!it->Valid() || !row_key.Decode(it->key())) { + // Past the last row in the DB or out of the mutations table + return absl::nullopt; + } + + if (row_key.user_id() != user_id_) { + // Jumped past the last mutation for this user + return absl::nullopt; + } + + HARD_ASSERT(row_key.batch_id() >= next_batch_id, + "Should have found mutation after %s", next_batch_id); + return ParseMutationBatch(it->value()); +} + +BatchId LevelDbMutationQueue::GetHighestUnacknowledgedBatchId() { + std::unique_ptr it( + db_->ptr()->NewIterator(LevelDbTransaction::DefaultReadOptions())); + + std::string next_user_key = + util::PrefixSuccessor(LevelDbMutationKey::KeyPrefix(user_id_)); + + LevelDbMutationKey row_key; + + it->Seek(next_user_key); + it->Prev(); + if (it->Valid() && row_key.Decode(MakeStringView(it->key())) && + row_key.user_id() == user_id_) { + return row_key.batch_id(); + } + + return kBatchIdUnknown; +} + +void LevelDbMutationQueue::PerformConsistencyCheck() { + if (!IsEmpty()) { + return; + } + + // Verify that there are no entries in the document-mutation index if the + // queue is empty. + std::string index_prefix = LevelDbDocumentMutationKey::KeyPrefix(user_id_); + auto index_iterator = db_->current_transaction()->NewIterator(); + index_iterator->Seek(index_prefix); + + std::vector dangling_mutation_references; + + for (; index_iterator->Valid(); index_iterator->Next()) { + // Only consider rows matching this index prefix for the current user. + if (!absl::StartsWith(index_iterator->key(), index_prefix)) { + break; + } + + dangling_mutation_references.push_back(DescribeKey(index_iterator)); + } + + HARD_ASSERT(dangling_mutation_references.empty(), + "Document leak -- detected dangling mutation references when " + "queue is empty. Dangling keys: %s", + util::ToString(dangling_mutation_references)); +} + +ByteString LevelDbMutationQueue::GetLastStreamToken() { + return ByteString{metadata_->last_stream_token}; +} + +void LevelDbMutationQueue::SetLastStreamToken(ByteString stream_token) { + std::free(metadata_->last_stream_token); + + metadata_->last_stream_token = stream_token.release(); + db_->current_transaction()->Put(mutation_queue_key(), metadata_); +} + +std::vector LevelDbMutationQueue::AllMutationBatchesWithIds( + const std::set& batch_ids) { + std::vector result; + + // Given an ordered set of unique batch_ids perform a skipping scan over the + // main table to find the mutation batches. + auto mutation_iterator = db_->current_transaction()->NewIterator(); + for (BatchId batch_id : batch_ids) { + std::string mutation_key = mutation_batch_key(batch_id); + mutation_iterator->Seek(mutation_key); + if (!mutation_iterator->Valid() || + mutation_iterator->key() != mutation_key) { + HARD_FAIL( + "Dangling document-mutation reference found: Missing batch %s; " + "seeking there found %s", + DescribeKey(mutation_key), DescribeKey(mutation_iterator)); + } + + result.push_back(ParseMutationBatch(mutation_iterator->value())); + } + + return result; +} + +std::string LevelDbMutationQueue::mutation_queue_key() const { + return LevelDbMutationQueueKey::Key(user_id_); +} + +std::string LevelDbMutationQueue::mutation_batch_key( + model::BatchId batch_id) const { + return LevelDbMutationKey::Key(user_id_, batch_id); +} + +Message LevelDbMutationQueue::MetadataForKey( + const std::string& key) { + std::string value; + Status status = db_->current_transaction()->Get(key, &value); + + StringReader reader{value}; + reader.set_status(ConvertStatus(status)); + auto result = Message::TryParse(&reader); + + if (reader.ok()) { + return result; + } else if (reader.status().code() == Error::kErrorNotFound) { + // Return a default-constructed message (`TryParse` is guaranteed to return + // a default-constructed message on failure). + return result; + } else { + HARD_FAIL("MetadataForKey: failed loading key %s with status: %s", key, + reader.status().ToString()); + } +} + +MutationBatch LevelDbMutationQueue::ParseMutationBatch( + absl::string_view encoded) { + StringReader reader{encoded}; + auto maybe_message = Message::TryParse(&reader); + auto result = serializer_->DecodeMutationBatch(&reader, *maybe_message); + if (!reader.ok()) { + HARD_FAIL("MutationBatch proto failed to parse: %s", + reader.status().ToString()); + } + + return result; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.h new file mode 100644 index 000000000..2a14dad7f --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_mutation_queue.h @@ -0,0 +1,146 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MUTATION_QUEUE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MUTATION_QUEUE_H_ + +#include +#include +#include + +#include "Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h" +#include "Firestore/core/src/local/mutation_queue.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/message.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "leveldb/db.h" + +namespace firebase { +class Timestamp; + +namespace firestore { + +namespace auth { +class User; +} // namespace auth + +namespace local { +class LevelDbPersistence; +class LocalSerializer; + +/** + * Returns one larger than the largest batch ID that has been stored. If there + * are no mutations returns 0. Note that batch IDs are global. + */ +model::BatchId LoadNextBatchIdFromDb(leveldb::DB* db); + +class LevelDbMutationQueue : public MutationQueue { + public: + LevelDbMutationQueue(const auth::User& user, + LevelDbPersistence* db, + LocalSerializer* serializer); + + void Start() override; + + bool IsEmpty() override; + + void AcknowledgeBatch(const model::MutationBatch& batch, + const nanopb::ByteString& stream_token) override; + + model::MutationBatch AddMutationBatch( + const Timestamp& local_write_time, + std::vector&& base_mutations, + std::vector&& mutations) override; + + void RemoveMutationBatch(const model::MutationBatch& batch) override; + + std::vector AllMutationBatches() override; + + std::vector AllMutationBatchesAffectingDocumentKeys( + const model::DocumentKeySet& document_keys) override; + + std::vector AllMutationBatchesAffectingDocumentKey( + const model::DocumentKey& key) override; + + std::vector AllMutationBatchesAffectingQuery( + const core::Query& query) override; + + absl::optional LookupMutationBatch( + model::BatchId batch_id) override; + + absl::optional NextMutationBatchAfterBatchId( + model::BatchId batch_id) override; + + model::BatchId GetHighestUnacknowledgedBatchId() override; + + void PerformConsistencyCheck() override; + + nanopb::ByteString GetLastStreamToken() override; + + void SetLastStreamToken(nanopb::ByteString stream_token) override; + + private: + /** + * Constructs a vector of matching batches, sorted by batch_id to ensure that + * multiple mutations affecting the same document key are applied in order. + */ + std::vector AllMutationBatchesWithIds( + const std::set& batch_ids); + + std::string mutation_queue_key() const; + + std::string mutation_batch_key(model::BatchId batch_id) const; + + /** Parses the MutationQueue metadata from the given LevelDB row contents. */ + nanopb::Message MetadataForKey( + const std::string& key); + + model::MutationBatch ParseMutationBatch(absl::string_view encoded); + + // The LevelDbMutationQueue instance is owned by LevelDbPersistence. + LevelDbPersistence* db_; + + // Owned by LevelDbPersistence. + LocalSerializer* serializer_ = nullptr; + + /** + * The normalized user_id (i.e. after converting null to empty) as used in our + * LevelDB keys. + */ + std::string user_id_; + + /** + * Next value to use when assigning sequential IDs to each mutation batch. + * + * NOTE: There can only be one LevelDbMutationQueue for a given db at a time, + * hence it is safe to track next_batch_id_ as an instance-level property. + * Should we ever relax this constraint we'll need to revisit this. + */ + model::BatchId next_batch_id_; + + /** + * A write-through cache copy of the metadata describing the current queue. + */ + nanopb::Message metadata_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_MUTATION_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.cc new file mode 100644 index 000000000..d7d679b10 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.cc @@ -0,0 +1,246 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_opener.h" + +#include +#include + +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/remote/serializer.h" +#include "Firestore/core/src/util/filesystem.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/path.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +using core::DatabaseInfo; +using remote::Serializer; +using util::Filesystem; +using util::Path; +using util::Status; +using util::StatusOr; +using util::StringFormat; + +constexpr const char* kReservedPathComponent = "firestore"; + +Status FromCause(const std::string& message, const Status& cause) { + if (cause.ok()) return cause; + + return Status(cause.code(), message).CausedBy(cause); +} + +} // namespace + +LevelDbOpener::LevelDbOpener(DatabaseInfo database_info, Filesystem* fs) + : database_info_(std::move(database_info)), + fs_(fs ? fs : Filesystem::Default()) { +} + +LevelDbOpener::LevelDbOpener(DatabaseInfo database_info, + Path firestore_app_data_dir) + : database_info_(std::move(database_info)), + app_data_dir_(std::move(firestore_app_data_dir)), + fs_(Filesystem::Default()) { +} + +util::StatusOr> LevelDbOpener::Create( + const LruParams& lru_params) { + auto maybe_dir = PrepareDataDir(); + if (!maybe_dir.ok()) return maybe_dir.status(); + Path db_data_dir = maybe_dir.ValueOrDie(); + + LOG_DEBUG("Using %s for LevelDB storage", db_data_dir.ToUtf8String()); + + Serializer remote_serializer(database_info_.database_id()); + LocalSerializer local_serializer(std::move(remote_serializer)); + + return LevelDbPersistence::Create(db_data_dir, std::move(local_serializer), + lru_params); +} + +StatusOr LevelDbOpener::LevelDbDataDir() { + StatusOr maybe_dir = FirestoreAppDataDir(); + if (!maybe_dir.ok()) return maybe_dir; + return StorageDir(maybe_dir.ValueOrDie()); +} + +StatusOr LevelDbOpener::PrepareDataDir() { + StatusOr maybe_dir = LevelDbDataDir(); + if (!maybe_dir.ok()) return maybe_dir; + Path db_data_dir = std::move(maybe_dir).ValueOrDie(); + + // Check for the preferred location. If it exists, we're done. + Status dir_status = fs_->IsDirectory(db_data_dir); + if (dir_status.ok()) { + return db_data_dir; + } else if (dir_status.code() != Error::kErrorNotFound) { + return dir_status; + } + + // The preferred dir doesn't exist so check for the legacy location. If it + // exists, migrate. + maybe_dir = FirestoreLegacyAppDataDir(); + Path legacy_db_data_dir; + if (maybe_dir.ok()) { + legacy_db_data_dir = StorageDir(std::move(maybe_dir).ValueOrDie()); + dir_status = fs_->IsDirectory(legacy_db_data_dir); + } else { + dir_status = maybe_dir.status(); + } + + if (dir_status.ok()) { + // The legacy directory does exist, so migrate + return MigrateDataDir(legacy_db_data_dir, db_data_dir); + + } else if (dir_status.code() != Error::kErrorNotFound && + dir_status.code() != Error::kErrorUnimplemented) { + return dir_status; + } + + // Either we couldn't find the legacy directory or this platform has no legacy + // directory so create the new directory. + Status created = fs_->RecursivelyCreateDir(db_data_dir); + if (!created.ok()) { + std::string message = + StringFormat("Could not create LevelDB data directory %s", + db_data_dir.ToUtf8String()); + + return FromCause(message, created); + } + + return db_data_dir; +} + +StatusOr LevelDbOpener::FirestoreAppDataDir() { + if (app_data_dir_.empty()) { + auto maybe_dir = fs_->AppDataDir(kReservedPathComponent); + if (!maybe_dir.ok()) { + return FromCause( + "Failed to find the App data directory for the current user", + maybe_dir.status()); + } + app_data_dir_ = std::move(maybe_dir).ValueOrDie(); + } + return app_data_dir_; +} + +StatusOr LevelDbOpener::FirestoreLegacyAppDataDir() { + if (legacy_app_data_dir_.empty()) { + auto maybe_dir = fs_->LegacyDocumentsDir(kReservedPathComponent); + if (!maybe_dir.ok()) { + return FromCause( + "Failed to find the Documents directory for the current user", + maybe_dir.status()); + } + legacy_app_data_dir_ = std::move(maybe_dir).ValueOrDie(); + } + return legacy_app_data_dir_; +} + +Path LevelDbOpener::StorageDir(const Path& base_path) { + // Use two different path formats: + // + // * persistence_key / project_id . database_id / name + // * persistence_key / project_id / name + // + // project_ids are DNS-compatible names and cannot contain dots so there's + // no danger of collisions. + std::string project_key = database_info_.database_id().project_id(); + if (!database_info_.database_id().IsDefaultDatabase()) { + absl::StrAppend(&project_key, ".", + database_info_.database_id().database_id()); + } + + // Reserve one additional path component to allow multiple physical databases + return Path::JoinUtf8(base_path, database_info_.persistence_key(), + project_key, "main"); +} + +StatusOr LevelDbOpener::MigrateDataDir( + const firebase::firestore::util::Path& legacy_db_data_dir, + const firebase::firestore::util::Path& db_data_dir) { + // At this point the legacy location exists and the preferred location doesn't + // so just move into place. + LOG_DEBUG( + "Migrating LevelDB storage from legacy location: %s\nMigrating to: %s", + legacy_db_data_dir.ToUtf8String(), db_data_dir.ToUtf8String()); + + Path db_data_parent = db_data_dir.Dirname(); + Status created = fs_->RecursivelyCreateDir(db_data_parent); + if (!created.ok()) { + std::string message = + StringFormat("Could not create LevelDB data directory %s", + db_data_parent.ToUtf8String()); + LOG_ERROR("Migration failed: %s. Existing data unchanged.", message); + return FromCause(message, created); + } + + Status renamed = fs_->Rename(legacy_db_data_dir, db_data_dir); + if (!renamed.ok()) { + std::string message = StringFormat( + "Failed to migrate LevelDB data from %s to %s", + legacy_db_data_dir.ToUtf8String(), db_data_dir.ToUtf8String()); + LOG_ERROR("Migration failed: %s. Existing data unchanged.", message); + return FromCause(message, renamed); + } + + RecursivelyCleanupLegacyDirs(legacy_db_data_dir); + return db_data_dir; +} + +void LevelDbOpener::RecursivelyCleanupLegacyDirs(Path legacy_dir) { + // The legacy_dir must be within the container_dir. + HARD_ASSERT(!legacy_app_data_dir_.empty()); + HARD_ASSERT(absl::StartsWith(legacy_dir.ToUtf8String(), + legacy_app_data_dir_.ToUtf8String())); + + // The container directory contains a trailing "firestore" component + HARD_ASSERT(absl::EndsWith(legacy_app_data_dir_.ToUtf8String(), + kReservedPathComponent)); + + Path parent_most = legacy_app_data_dir_.Dirname(); + for (; legacy_dir != parent_most; legacy_dir = legacy_dir.Dirname()) { + Status is_dir = fs_->IsDirectory(legacy_dir); + if (is_dir.ok()) { + if (util::IsEmptyDir(legacy_dir)) { + Status removed = fs_->RemoveDir(legacy_dir); + if (!removed.ok()) { + LOG_WARN("Could not remove directory %s: %s", + legacy_dir.ToUtf8String(), removed.ToString()); + break; + } + } + + } else if (is_dir.code() != Error::kErrorNotFound) { + LOG_WARN("Could not remove directory %s: %s", legacy_dir.ToUtf8String(), + is_dir.ToString()); + break; + } + } +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.h new file mode 100644 index 000000000..0516523fb --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_opener.h @@ -0,0 +1,132 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_OPENER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_OPENER_H_ + +#include + +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/util/path.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace util { +class Filesystem; +class Status; + +template +class StatusOr; +} // namespace util + +namespace local { + +class LevelDbPersistence; +struct LruParams; + +class LevelDbOpener { + public: + /** + * Creates an opener that uses the given filesystem, or + * `Filesystem::Default()` if `fs` is `nullptr`. A non-default Filesystem + * should only be used in tests. + */ + explicit LevelDbOpener(core::DatabaseInfo database_info, + util::Filesystem* fs = nullptr); + + /** + * Creates an opener that uses a pre-specified storage location. This should + * only be used in tests. + * + * @param database_info The instance configuration + * @param firestore_app_data_dir The Firestore-specific application data + * directory. + */ + LevelDbOpener(core::DatabaseInfo database_info, + util::Path firestore_app_data_dir); + + /** + * Creates the LevelDbPersistence instance. + * + * This process includes: + * + * * Migrating existing data from a legacy location into the new location + * (i.e. from ~/Documents to ~/Library/Application Support on iOS); + * * Cleaning up the directory structure in the legacy location; + * * Creating the directory structure to uniquely hold the data for this + * instance. + * * Actually opening the LevelDB database. + * + * @param lru_params The LRU GC configuration to use for the instance. + * @return A pointer to the created instance or Status indicating what failed. + */ + util::StatusOr> Create( + const LruParams& lru_params); + + /** + * Finds a suitable directory to serve as the root of all Firestore local + * storage for all Firestore instances. + */ + util::StatusOr FirestoreAppDataDir(); + + /** + * Finds the location where Firestore used to keep local storage for all + * Firestore instances. + */ + util::StatusOr FirestoreLegacyAppDataDir(); + + /** + * Returns the location of the data for the single Firestore instance named + * by the DatabaseInfo passed to the `LevelDbOpener` constructor. + */ + util::StatusOr LevelDbDataDir(); + + private: + /** + * Prepares the directory that contains the instance's data. + */ + util::StatusOr PrepareDataDir(); + + /** + * Computes a unique storage directory for the given identifying components of + * local storage. + * + * @param base_path The root application data directory relative to which + * the instance-specific storage directory will be created. Usually just + * `FirestoreAppDataDir()`. + * @return A storage directory unique to the instance identified by + * `database_info`. + */ + util::Path StorageDir(const util::Path& base_path); + + util::StatusOr MigrateDataDir( + const util::Path& legacy_db_data_dir, const util::Path& db_data_dir); + + void RecursivelyCleanupLegacyDirs(util::Path legacy_dir); + + core::DatabaseInfo database_info_; + util::Path app_data_dir_; + util::Path legacy_app_data_dir_; + util::Filesystem* fs_ = nullptr; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_OPENER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.cc new file mode 100644 index 000000000..c9aaae89d --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.cc @@ -0,0 +1,273 @@ +/* + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_persistence.h" + +#include +#include + +#include "Firestore/core/src/auth/user.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_lru_reference_delegate.h" +#include "Firestore/core/src/local/leveldb_migrations.h" +#include "Firestore/core/src/local/leveldb_opener.h" +#include "Firestore/core/src/local/leveldb_util.h" +#include "Firestore/core/src/local/listen_sequence.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/sizer.h" +#include "Firestore/core/src/util/filesystem.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/string_util.h" +#include "absl/memory/memory.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +using auth::User; +using leveldb::DB; +using model::ListenSequenceNumber; +using util::Filesystem; +using util::Path; +using util::Status; +using util::StatusOr; +using util::StringFormat; + +/** + * Finds all user ids in the database based on the existence of a mutation + * queue. + */ +std::set CollectUserSet(LevelDbTransaction* transaction) { + std::set result; + + std::string table_prefix = LevelDbMutationKey::KeyPrefix(); + auto it = transaction->NewIterator(); + it->Seek(table_prefix); + + LevelDbMutationKey row_key; + while (it->Valid() && absl::StartsWith(it->key(), table_prefix) && + row_key.Decode(it->key())) { + result.insert(row_key.user_id()); + + auto user_end = LevelDbMutationKey::KeyPrefix(row_key.user_id()); + user_end = util::PrefixSuccessor(user_end); + it->Seek(user_end); + } + return result; +} + +} // namespace + +StatusOr> LevelDbPersistence::Create( + util::Path dir, LocalSerializer serializer, const LruParams& lru_params) { + auto* fs = Filesystem::Default(); + Status status = EnsureDirectory(dir); + if (!status.ok()) return status; + + status = fs->ExcludeFromBackups(dir); + if (!status.ok()) return status; + + StatusOr> created = OpenDb(dir); + if (!created.ok()) return created.status(); + + std::unique_ptr db = std::move(created).ValueOrDie(); + LevelDbMigrations::RunMigrations(db.get()); + + LevelDbTransaction transaction(db.get(), "Start LevelDB"); + std::set users = CollectUserSet(&transaction); + transaction.Commit(); + + // Explicit conversion is required to allow the StatusOr to be created. + std::unique_ptr result( + new LevelDbPersistence(std::move(db), std::move(dir), std::move(users), + std::move(serializer), lru_params)); + return {std::move(result)}; +} + +LevelDbPersistence::LevelDbPersistence(std::unique_ptr db, + util::Path directory, + std::set users, + LocalSerializer serializer, + const LruParams& lru_params) + : db_(std::move(db)), + directory_(std::move(directory)), + users_(std::move(users)), + serializer_(std::move(serializer)) { + target_cache_ = absl::make_unique(this, &serializer_); + document_cache_ = + absl::make_unique(this, &serializer_); + index_manager_ = absl::make_unique(this); + reference_delegate_ = + absl::make_unique(this, lru_params); + + // TODO(gsoltis): set up a leveldb transaction for these operations. + target_cache_->Start(); + reference_delegate_->Start(); + started_ = true; +} + +// Handle unique_ptrs to forward declarations +LevelDbPersistence::~LevelDbPersistence() = default; + +// MARK: - Startup + +Status LevelDbPersistence::EnsureDirectory(const Path& dir) { + auto* fs = Filesystem::Default(); + Status status = fs->RecursivelyCreateDir(dir); + if (!status.ok()) { + return Status{Error::kErrorInternal, + "Failed to create persistence directory"} + .CausedBy(status); + } + + return Status::OK(); +} + +StatusOr> LevelDbPersistence::OpenDb(const Path& dir) { + leveldb::Options options; + options.create_if_missing = true; + + DB* database = nullptr; + leveldb::Status status = DB::Open(options, dir.ToUtf8String(), &database); + if (!status.ok()) { + return Status{Error::kErrorInternal, + StringFormat("Failed to open LevelDB database at %s", + dir.ToUtf8String())} + .CausedBy(ConvertStatus(status)); + } + + return std::unique_ptr(database); +} + +// MARK: - LevelDB utilities + +LevelDbTransaction* LevelDbPersistence::current_transaction() { + HARD_ASSERT(transaction_ != nullptr, + "Attempting to access transaction before one has started"); + return transaction_.get(); +} + +util::Status LevelDbPersistence::ClearPersistence( + const core::DatabaseInfo& database_info) { + LevelDbOpener opener(database_info); + StatusOr maybe_data_dir = opener.LevelDbDataDir(); + HARD_ASSERT(maybe_data_dir.ok(), "Failed to find local LevelDB files: %s", + maybe_data_dir.status().ToString()); + Path leveldb_dir = std::move(maybe_data_dir).ValueOrDie(); + + LOG_DEBUG("Clearing persistence for path: %s", leveldb_dir.ToUtf8String()); + auto* fs = Filesystem::Default(); + return fs->RecursivelyRemove(leveldb_dir); +} + +StatusOr LevelDbPersistence::CalculateByteSize() { + auto* fs = Filesystem::Default(); + + // Accumulate the total size in an unsigned integer to avoid undefined + // behavior on overflow. + uint64_t count = 0; + auto iter = util::DirectoryIterator::Create(directory_); + for (; iter->Valid(); iter->Next()) { + StatusOr maybe_size = fs->FileSize(iter->file()); + if (!maybe_size.ok()) { + return Status::FromCause("Failed to size LevelDB directory", + maybe_size.status()); + } + + uint64_t old_count = count; + int64_t file_size = maybe_size.ValueOrDie(); + count += file_size; + + if (count < old_count || count > std::numeric_limits::max()) { + return Status(Error::kErrorOutOfRange, + "Failed to size LevelDB: count overflowed"); + } + } + + if (!iter->status().ok()) { + return Status::FromCause("Failed to iterate over LevelDB files", + iter->status()); + } + return static_cast(count); +} + +// MARK: - Persistence + +model::ListenSequenceNumber LevelDbPersistence::current_sequence_number() + const { + return reference_delegate_->current_sequence_number(); +} + +void LevelDbPersistence::Shutdown() { + HARD_ASSERT(started_, "LevelDbPersistence shutdown without start!"); + started_ = false; + db_.reset(); +} + +LevelDbMutationQueue* LevelDbPersistence::GetMutationQueueForUser( + const auth::User& user) { + users_.insert(user.uid()); + current_mutation_queue_ = + absl::make_unique(user, this, &serializer_); + return current_mutation_queue_.get(); +} + +LevelDbTargetCache* LevelDbPersistence::target_cache() { + return target_cache_.get(); +} + +LevelDbRemoteDocumentCache* LevelDbPersistence::remote_document_cache() { + return document_cache_.get(); +} + +LevelDbIndexManager* LevelDbPersistence::index_manager() { + return index_manager_.get(); +} + +LevelDbLruReferenceDelegate* LevelDbPersistence::reference_delegate() { + return reference_delegate_.get(); +} + +void LevelDbPersistence::RunInternal(absl::string_view label, + std::function block) { + HARD_ASSERT(transaction_ == nullptr, + "Starting a transaction while one is already in progress"); + + transaction_ = absl::make_unique(db_.get(), label); + reference_delegate_->OnTransactionStarted(label); + + block(); + + reference_delegate_->OnTransactionCommitted(); + transaction_->Commit(); + transaction_.reset(); +} + +leveldb::ReadOptions StandardReadOptions() { + // For now this is paranoid, but perhaps disable that in production builds. + leveldb::ReadOptions options; + options.verify_checksums = true; + return options; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.h new file mode 100644 index 000000000..1752ed8b7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_persistence.h @@ -0,0 +1,134 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_PERSISTENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_PERSISTENCE_H_ + +#include +#include +#include + +#include "Firestore/core/src/auth/user.h" +#include "Firestore/core/src/local/leveldb_index_manager.h" +#include "Firestore/core/src/local/leveldb_lru_reference_delegate.h" +#include "Firestore/core/src/local/leveldb_mutation_queue.h" +#include "Firestore/core/src/local/leveldb_remote_document_cache.h" +#include "Firestore/core/src/local/leveldb_target_cache.h" +#include "Firestore/core/src/local/leveldb_transaction.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/local/persistence.h" +#include "Firestore/core/src/util/path.h" +#include "Firestore/core/src/util/statusor.h" + +namespace firebase { +namespace firestore { + +namespace core { +class DatabaseInfo; +} // namespace core + +namespace local { + +class LevelDbLruReferenceDelegate; +struct LruParams; + +/** A LevelDB-backed implementation of the Persistence interface. */ +class LevelDbPersistence : public Persistence { + public: + /** + * Creates a LevelDB in the given directory and returns it or a Status object + * containing details of the failure. + */ + static util::StatusOr> Create( + util::Path dir, LocalSerializer serializer, const LruParams& lru_params); + + ~LevelDbPersistence(); + + LevelDbTransaction* current_transaction(); + + leveldb::DB* ptr() { + return db_.get(); + } + + const std::set users() const { + return users_; + } + + static util::Status ClearPersistence(const core::DatabaseInfo& database_info); + + util::StatusOr CalculateByteSize(); + + // MARK: Persistence overrides + + model::ListenSequenceNumber current_sequence_number() const override; + + void Shutdown() override; + + LevelDbMutationQueue* GetMutationQueueForUser( + const auth::User& user) override; + + LevelDbTargetCache* target_cache() override; + + LevelDbRemoteDocumentCache* remote_document_cache() override; + + LevelDbIndexManager* index_manager() override; + + LevelDbLruReferenceDelegate* reference_delegate() override; + + protected: + void RunInternal(absl::string_view label, + std::function block) override; + + private: + LevelDbPersistence(std::unique_ptr db, + util::Path directory, + std::set users, + LocalSerializer serializer, + const LruParams& lru_params); + + /** + * Ensures that the given directory exists. + */ + static util::Status EnsureDirectory(const util::Path& dir); + + /** Opens the database within the given directory. */ + static util::StatusOr> OpenDb( + const util::Path& dir); + + std::unique_ptr db_; + + util::Path directory_; + std::set users_; + LocalSerializer serializer_; + bool started_ = false; + + std::unique_ptr current_mutation_queue_; + std::unique_ptr target_cache_; + std::unique_ptr document_cache_; + std::unique_ptr index_manager_; + std::unique_ptr reference_delegate_; + + std::unique_ptr transaction_; +}; + +/** Returns a standard set of read options. */ +leveldb::ReadOptions StandardReadOptions(); + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_PERSISTENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.cc new file mode 100644 index 000000000..dfc83c756 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.cc @@ -0,0 +1,295 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_remote_document_cache.h" + +#include +#include // NOLINT(build/c++11) +#include + +#include "Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/util/background_queue.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/string_util.h" +#include "leveldb/db.h" + +namespace firebase { +namespace firestore { +namespace local { +namespace { + +using core::Query; +using leveldb::Status; +using model::Document; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::MaybeDocument; +using model::MaybeDocumentMap; +using model::OptionalMaybeDocumentMap; +using model::ResourcePath; +using model::SnapshotVersion; +using nanopb::ByteString; +using nanopb::Message; +using nanopb::StringReader; +using util::BackgroundQueue; +using util::Executor; + +/** + * An accumulator for results produced asynchronously. This accumulates + * values in a vector to avoid contention caused by accumulating into more + * complex structures like immutable::SortedMap. + */ +template +class AsyncResults { + public: + void Insert(T&& value) { + std::lock_guard lock(mutex_); + values_.push_back(std::move(value)); + } + + void Insert(const T& value) { + std::lock_guard lock(mutex_); + values_.push_back(value); + } + + /** + * Returns the accumulated result, moving it out of AsyncResults. The + * AsyncResults object should not be reused. + */ + std::vector Result() { + std::lock_guard lock(mutex_); + return std::move(values_); + } + + private: + std::vector values_; + std::mutex mutex_; +}; + +} // namespace + +LevelDbRemoteDocumentCache::LevelDbRemoteDocumentCache( + LevelDbPersistence* db, LocalSerializer* serializer) + : db_(db), serializer_(NOT_NULL(serializer)) { + auto hw_concurrency = std::thread::hardware_concurrency(); + if (hw_concurrency == 0) { + // If the standard library doesn't know, guess something reasonable. + hw_concurrency = 4; + } + executor_ = Executor::CreateConcurrent("com.google.firebase.firestore.query", + static_cast(hw_concurrency)); +} + +// Out of line because of unique_ptrs to incomplete types. +LevelDbRemoteDocumentCache::~LevelDbRemoteDocumentCache() = default; + +void LevelDbRemoteDocumentCache::Add(const MaybeDocument& document, + const SnapshotVersion& read_time) { + const DocumentKey& key = document.key(); + const ResourcePath& path = key.path(); + + std::string ldb_document_key = LevelDbRemoteDocumentKey::Key(key); + db_->current_transaction()->Put(ldb_document_key, + serializer_->EncodeMaybeDocument(document)); + + std::string ldb_read_time_key = LevelDbRemoteDocumentReadTimeKey::Key( + path.PopLast(), read_time, path.last_segment()); + db_->current_transaction()->Put(ldb_read_time_key, ""); + + db_->index_manager()->AddToCollectionParentIndex( + document.key().path().PopLast()); +} + +void LevelDbRemoteDocumentCache::Remove(const DocumentKey& key) { + std::string ldb_key = LevelDbRemoteDocumentKey::Key(key); + db_->current_transaction()->Delete(ldb_key); +} + +absl::optional LevelDbRemoteDocumentCache::Get( + const DocumentKey& key) { + std::string ldb_key = LevelDbRemoteDocumentKey::Key(key); + std::string value; + Status status = db_->current_transaction()->Get(ldb_key, &value); + if (status.IsNotFound()) { + return absl::nullopt; + } else if (status.ok()) { + return DecodeMaybeDocument(value, key); + } else { + HARD_FAIL("Fetch document for key (%s) failed with status: %s", + key.ToString(), status.ToString()); + } +} + +OptionalMaybeDocumentMap LevelDbRemoteDocumentCache::GetAll( + const DocumentKeySet& keys) { + BackgroundQueue tasks(executor_.get()); + AsyncResults>> results; + + LevelDbRemoteDocumentKey current_key; + auto it = db_->current_transaction()->NewIterator(); + + for (const DocumentKey& key : keys) { + it->Seek(LevelDbRemoteDocumentKey::Key(key)); + if (!it->Valid() || !current_key.Decode(it->key()) || + current_key.document_key() != key) { + results.Insert(std::make_pair(key, absl::nullopt)); + } else { + const std::string& contents = it->value(); + tasks.Execute([this, &results, &key, contents] { + results.Insert(std::make_pair(key, DecodeMaybeDocument(contents, key))); + }); + } + } + + tasks.AwaitAll(); + + OptionalMaybeDocumentMap map; + for (const auto& entry : results.Result()) { + map = map.insert(entry.first, entry.second); + } + return map; +} + +DocumentMap LevelDbRemoteDocumentCache::GetAllExisting( + const DocumentKeySet& keys) { + DocumentMap results; + + OptionalMaybeDocumentMap docs = LevelDbRemoteDocumentCache::GetAll(keys); + for (const auto& kv : docs) { + const DocumentKey& key = kv.first; + const auto& maybe_doc = kv.second; + if (maybe_doc && maybe_doc->is_document()) { + results = results.insert(key, Document(*maybe_doc)); + } + } + + return results; +} + +DocumentMap LevelDbRemoteDocumentCache::GetMatching( + const Query& query, const SnapshotVersion& since_read_time) { + HARD_ASSERT( + !query.IsCollectionGroupQuery(), + "CollectionGroup queries should be handled in LocalDocumentsView"); + + // Use the query path as a prefix for testing if a document matches the query. + const ResourcePath& query_path = query.path(); + size_t immediate_children_path_length = query_path.size() + 1; + + if (since_read_time != SnapshotVersion::None()) { + // Execute an index-free query and filter by read time. This is safe since + // all document changes to queries that have a + // last_limbo_free_snapshot_version (`since_read_time`) have a read time + // set. + std::string start_key = LevelDbRemoteDocumentReadTimeKey::KeyPrefix( + query_path, since_read_time); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(util::ImmediateSuccessor(start_key)); + + DocumentKeySet remote_keys; + + LevelDbRemoteDocumentReadTimeKey current_key; + for (; it->Valid() && current_key.Decode(it->key()); it->Next()) { + const ResourcePath& collection_path = current_key.collection_path(); + if (collection_path != query_path) { + break; + } + + const SnapshotVersion& read_time = current_key.read_time(); + if (read_time > since_read_time) { + DocumentKey document_key(query_path.Append(current_key.document_id())); + remote_keys = remote_keys.insert(document_key); + } + } + + return LevelDbRemoteDocumentCache::GetAllExisting(remote_keys); + } else { + BackgroundQueue tasks(executor_.get()); + AsyncResults results; + + // Documents are ordered by key, so we can use a prefix scan to narrow down + // the documents we need to match the query against. + std::string start_key = LevelDbRemoteDocumentKey::KeyPrefix(query_path); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(start_key); + + LevelDbRemoteDocumentKey current_key; + for (; it->Valid() && current_key.Decode(it->key()); it->Next()) { + // The query is actually returning any path that starts with the query + // path prefix which may include documents in subcollections. For example, + // a query on 'rooms' will return rooms/abc/messages/xyx but we shouldn't + // match it. Fix this by discarding rows with document keys more than one + // segment longer than the query path. + const DocumentKey& document_key = current_key.document_key(); + if (document_key.path().size() != immediate_children_path_length) { + continue; + } + + if (!query_path.IsPrefixOf(document_key.path())) { + break; + } + + const std::string& contents = it->value(); + tasks.Execute([this, &results, document_key, contents] { + MaybeDocument maybe_doc = DecodeMaybeDocument(contents, document_key); + if (maybe_doc.is_document()) { + results.Insert(Document(maybe_doc)); + } + }); + } + + tasks.AwaitAll(); + + DocumentMap map; + for (const Document& doc : results.Result()) { + map = map.insert(doc.key(), doc); + } + return map; + } +} + +MaybeDocument LevelDbRemoteDocumentCache::DecodeMaybeDocument( + absl::string_view encoded, const DocumentKey& key) { + StringReader reader{encoded}; + + auto message = Message::TryParse(&reader); + MaybeDocument maybe_document = + serializer_->DecodeMaybeDocument(&reader, *message); + + if (!reader.ok()) { + HARD_FAIL("MaybeDocument proto failed to parse: %s", + reader.status().ToString()); + } + HARD_ASSERT(maybe_document.key() == key, + "Read document has key (%s) instead of expected key (%s).", + maybe_document.key().ToString(), key.ToString()); + + return maybe_document; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.h new file mode 100644 index 000000000..e3e0bedb7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_remote_document_cache.h @@ -0,0 +1,82 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_REMOTE_DOCUMENT_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_REMOTE_DOCUMENT_CACHE_H_ + +#include +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/local/remote_document_cache.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { + +namespace util { +class Executor; +} // namespace util + +namespace local { + +class LevelDbPersistence; +class LocalSerializer; + +/** Cached Remote Documents backed by leveldb. */ +class LevelDbRemoteDocumentCache : public RemoteDocumentCache { + public: + LevelDbRemoteDocumentCache(LevelDbPersistence* db, + LocalSerializer* serializer); + ~LevelDbRemoteDocumentCache(); + + void Add(const model::MaybeDocument& document, + const model::SnapshotVersion& read_time) override; + void Remove(const model::DocumentKey& key) override; + + absl::optional Get( + const model::DocumentKey& key) override; + model::OptionalMaybeDocumentMap GetAll( + const model::DocumentKeySet& keys) override; + model::DocumentMap GetMatching( + const core::Query& query, + const model::SnapshotVersion& since_read_time) override; + + private: + /** + * Looks up a set of entries in the cache, returning only existing entries of + * Type::Document. + */ + model::DocumentMap GetAllExisting(const model::DocumentKeySet& keys); + + model::MaybeDocument DecodeMaybeDocument(absl::string_view encoded, + const model::DocumentKey& key); + + // The LevelDbRemoteDocumentCache instance is owned by LevelDbPersistence. + LevelDbPersistence* db_; + // Owned by LevelDbPersistence. + LocalSerializer* serializer_ = nullptr; + + std::unique_ptr executor_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_REMOTE_DOCUMENT_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.cc new file mode 100644 index 000000000..f232be9ae --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.cc @@ -0,0 +1,400 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_target_cache.h" + +#include +#include + +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/local/leveldb_persistence.h" +#include "Firestore/core/src/local/leveldb_util.h" +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/util/string_apple.h" +#include "absl/strings/match.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::Target; +using leveldb::Status; +using model::DocumentKey; +using model::DocumentKeySet; +using model::ListenSequenceNumber; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; +using nanopb::Message; +using nanopb::StringReader; + +absl::optional> +LevelDbTargetCache::TryReadMetadata(leveldb::DB* db) { + std::string key = LevelDbTargetGlobalKey::Key(); + std::string value; + Status status = db->Get(StandardReadOptions(), key, &value); + + StringReader reader{value}; + reader.set_status(ConvertStatus(status)); + + auto result = Message::TryParse(&reader); + if (!reader.ok()) { + if (reader.status().code() == Error::kErrorNotFound) { + return absl::nullopt; + } else { + HARD_FAIL("ReadMetadata: failed loading key %s with status: %s", key, + reader.status().ToString()); + } + } + + return {std::move(result)}; +} + +Message LevelDbTargetCache::ReadMetadata( + leveldb::DB* db) { + auto maybe_metadata = TryReadMetadata(db); + if (!maybe_metadata) { + HARD_FAIL( + "Found no metadata, expected schema to be at version 0 which " + "ensures metadata existence"); + } + return std::move(maybe_metadata).value(); +} + +LevelDbTargetCache::LevelDbTargetCache(LevelDbPersistence* db, + LocalSerializer* serializer) + : db_(NOT_NULL(db)), serializer_(NOT_NULL(serializer)) { +} + +void LevelDbTargetCache::Start() { + // TODO(gsoltis): switch this usage of ptr to current_transaction() + metadata_ = ReadMetadata(db_->ptr()); + + StringReader reader; + last_remote_snapshot_version_ = serializer_->DecodeVersion( + &reader, metadata_->last_remote_snapshot_version); + if (!reader.ok()) { + HARD_FAIL("Failed to decode last remote snapshot version, reason: '%s'", + reader.status().ToString()); + } +} + +void LevelDbTargetCache::AddTarget(const TargetData& target_data) { + Save(target_data); + + const std::string& canonical_id = target_data.target().CanonicalId(); + std::string index_key = + LevelDbQueryTargetKey::Key(canonical_id, target_data.target_id()); + std::string empty_buffer; + db_->current_transaction()->Put(index_key, empty_buffer); + + metadata_->target_count++; + UpdateMetadata(target_data); + SaveMetadata(); +} + +void LevelDbTargetCache::UpdateTarget(const TargetData& target_data) { + Save(target_data); + + if (UpdateMetadata(target_data)) { + SaveMetadata(); + } +} + +void LevelDbTargetCache::RemoveTarget(const TargetData& target_data) { + TargetId target_id = target_data.target_id(); + + RemoveAllKeysForTarget(target_id); + + std::string key = LevelDbTargetKey::Key(target_id); + db_->current_transaction()->Delete(key); + + std::string index_key = + LevelDbQueryTargetKey::Key(target_data.target().CanonicalId(), target_id); + db_->current_transaction()->Delete(index_key); + + metadata_->target_count--; + SaveMetadata(); +} + +absl::optional LevelDbTargetCache::GetTarget(const Target& target) { + // Scan the query-target index starting with a prefix starting with the given + // target's canonical_id. Note that this is a scan rather than a get because + // canonical_ids are not required to be unique per target. + const std::string& canonical_id = target.CanonicalId(); + auto index_iterator = db_->current_transaction()->NewIterator(); + std::string index_prefix = LevelDbQueryTargetKey::KeyPrefix(canonical_id); + index_iterator->Seek(index_prefix); + + // Simultaneously scan the targets table. This works because each + // (canonical_id, target_id) pair is unique and ordered, so when scanning a + // table prefixed by exactly one canonical_id, all the target_ids will be + // unique and in order. + std::string target_prefix = LevelDbTargetKey::KeyPrefix(); + auto target_iterator = db_->current_transaction()->NewIterator(); + + LevelDbQueryTargetKey row_key; + for (; index_iterator->Valid(); index_iterator->Next()) { + // Only consider rows matching exactly the specific canonical_id of + // interest. + if (!absl::StartsWith(index_iterator->key(), index_prefix) || + !row_key.Decode(index_iterator->key()) || + canonical_id != row_key.canonical_id()) { + // End of this canonical_id's possible targets. + break; + } + + // Each row is a unique combination of canonical_id and target_id, so this + // foreign key reference can only occur once. + std::string target_key = LevelDbTargetKey::Key(row_key.target_id()); + target_iterator->Seek(target_key); + if (!target_iterator->Valid() || target_iterator->key() != target_key) { + HARD_FAIL( + "Dangling query-target reference found: " + "%s points to %s; seeking there found %s", + DescribeKey(index_iterator), DescribeKey(target_key), + DescribeKey(target_iterator)); + } + + // Finally after finding a potential match, check that the target is + // actually equal to the requested target. + TargetData target_data = DecodeTarget(target_iterator->value()); + if (target_data.target() == target) { + return target_data; + } + } + + return absl::nullopt; +} + +void LevelDbTargetCache::EnumerateTargets(const TargetCallback& callback) { + // Enumerate all targets, give their sequence numbers. + std::string target_prefix = LevelDbTargetKey::KeyPrefix(); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(target_prefix); + for (; it->Valid() && absl::StartsWith(it->key(), target_prefix); + it->Next()) { + TargetData target = DecodeTarget(it->value()); + callback(target); + } +} + +int LevelDbTargetCache::RemoveTargets( + ListenSequenceNumber upper_bound, + const std::unordered_map& live_targets) { + int count = 0; + std::string target_prefix = LevelDbTargetKey::KeyPrefix(); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(target_prefix); + for (; it->Valid() && absl::StartsWith(it->key(), target_prefix); + it->Next()) { + TargetData target_data = DecodeTarget(it->value()); + if (target_data.sequence_number() <= upper_bound && + live_targets.find(target_data.target_id()) == live_targets.end()) { + RemoveTarget(target_data); + count++; + } + } + return count; +} + +void LevelDbTargetCache::AddMatchingKeys(const DocumentKeySet& keys, + TargetId target_id) { + // Store an empty value in the index which is equivalent to serializing a + // GPBEmpty message. In the future if we wanted to store some other kind of + // value here, we can parse these empty values as with some other protocol + // buffer (and the parser will see all default values). + std::string empty_buffer; + + for (const DocumentKey& key : keys) { + db_->current_transaction()->Put( + LevelDbTargetDocumentKey::Key(target_id, key), empty_buffer); + db_->current_transaction()->Put( + LevelDbDocumentTargetKey::Key(key, target_id), empty_buffer); + db_->reference_delegate()->AddReference(key); + } +} + +void LevelDbTargetCache::RemoveMatchingKeys(const DocumentKeySet& keys, + TargetId target_id) { + for (const DocumentKey& key : keys) { + db_->current_transaction()->Delete( + LevelDbTargetDocumentKey::Key(target_id, key)); + db_->current_transaction()->Delete( + LevelDbDocumentTargetKey::Key(key, target_id)); + db_->reference_delegate()->RemoveReference(key); + } +} + +void LevelDbTargetCache::RemoveAllKeysForTarget(TargetId target_id) { + std::string index_prefix = LevelDbTargetDocumentKey::KeyPrefix(target_id); + auto index_iterator = db_->current_transaction()->NewIterator(); + index_iterator->Seek(index_prefix); + + LevelDbTargetDocumentKey row_key; + for (; index_iterator->Valid(); index_iterator->Next()) { + absl::string_view index_key = index_iterator->key(); + + // Only consider rows matching this specific target_id. + if (!row_key.Decode(index_key) || row_key.target_id() != target_id) { + break; + } + const DocumentKey& document_key = row_key.document_key(); + + // Delete both index rows + db_->current_transaction()->Delete(index_key); + db_->current_transaction()->Delete( + LevelDbDocumentTargetKey::Key(document_key, target_id)); + } +} + +DocumentKeySet LevelDbTargetCache::GetMatchingKeys(TargetId target_id) { + std::string index_prefix = LevelDbTargetDocumentKey::KeyPrefix(target_id); + auto index_iterator = db_->current_transaction()->NewIterator(); + index_iterator->Seek(index_prefix); + + DocumentKeySet result; + LevelDbTargetDocumentKey row_key; + for (; index_iterator->Valid(); index_iterator->Next()) { + // TODO(gsoltis): could we use a StartsWith instead? + // Only consider rows matching this specific target_id. + if (!row_key.Decode(index_iterator->key()) || + row_key.target_id() != target_id) { + break; + } + + result = result.insert(row_key.document_key()); + } + + return result; +} + +bool LevelDbTargetCache::Contains(const DocumentKey& key) { + // ignore sentinel rows when determining if a key belongs to a target. + // Sentinel row just says the document exists, not that it's a member of any + // particular target. + std::string index_prefix = LevelDbDocumentTargetKey::KeyPrefix(key.path()); + auto index_iterator = db_->current_transaction()->NewIterator(); + index_iterator->Seek(index_prefix); + + for (; index_iterator->Valid() && + absl::StartsWith(index_iterator->key(), index_prefix); + index_iterator->Next()) { + LevelDbDocumentTargetKey row_key; + if (row_key.Decode(index_iterator->key()) && !row_key.IsSentinel() && + row_key.document_key() == key) { + return true; + } + } + + return false; +} + +const SnapshotVersion& LevelDbTargetCache::GetLastRemoteSnapshotVersion() + const { + return last_remote_snapshot_version_; +} + +void LevelDbTargetCache::SetLastRemoteSnapshotVersion(SnapshotVersion version) { + last_remote_snapshot_version_ = std::move(version); + metadata_->last_remote_snapshot_version = + serializer_->EncodeVersion(last_remote_snapshot_version_); + SaveMetadata(); +} + +void LevelDbTargetCache::EnumerateOrphanedDocuments( + const OrphanedDocumentCallback& callback) { + std::string document_target_prefix = LevelDbDocumentTargetKey::KeyPrefix(); + auto it = db_->current_transaction()->NewIterator(); + it->Seek(document_target_prefix); + ListenSequenceNumber next_to_report = 0; + DocumentKey key_to_report; + LevelDbDocumentTargetKey key; + + for (; it->Valid() && absl::StartsWith(it->key(), document_target_prefix); + it->Next()) { + HARD_ASSERT(key.Decode(it->key()), "Failed to decode DocumentTarget key"); + if (key.IsSentinel()) { + // if next_to_report is non-zero, report it, this is a new key so the last + // one must be not be a member of any targets. + if (next_to_report != 0) { + callback(key_to_report, next_to_report); + } + // set next_to_report to be this sequence number. It's the next one we + // might report, if we don't find any targets for this document. + next_to_report = + LevelDbDocumentTargetKey::DecodeSentinelValue(it->value()); + key_to_report = key.document_key(); + } else { + // set next_to_report to be 0, we know we don't need to report this one + // since we found a target for it. + next_to_report = 0; + } + } + // if next_to_report is non-zero, report it. We didn't find any targets for + // that document, and we weren't asked to stop. + if (next_to_report != 0) { + callback(key_to_report, next_to_report); + } +} + +void LevelDbTargetCache::Save(const TargetData& target_data) { + TargetId target_id = target_data.target_id(); + std::string key = LevelDbTargetKey::Key(target_id); + db_->current_transaction()->Put(key, + serializer_->EncodeTargetData(target_data)); +} + +bool LevelDbTargetCache::UpdateMetadata(const TargetData& target_data) { + bool updated = false; + if (target_data.target_id() > metadata_->highest_target_id) { + metadata_->highest_target_id = target_data.target_id(); + updated = true; + } + + if (target_data.sequence_number() > + metadata_->highest_listen_sequence_number) { + metadata_->highest_listen_sequence_number = target_data.sequence_number(); + updated = true; + } + + return updated; +} + +void LevelDbTargetCache::SaveMetadata() { + db_->current_transaction()->Put(LevelDbTargetGlobalKey::Key(), metadata_); +} + +TargetData LevelDbTargetCache::DecodeTarget(absl::string_view encoded) { + StringReader reader{encoded}; + auto message = Message::TryParse(&reader); + auto result = serializer_->DecodeTargetData(&reader, *message); + if (!reader.ok()) { + HARD_FAIL("Target proto failed to parse: %s", reader.status().ToString()); + } + + return result; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.h new file mode 100644 index 000000000..ddf01baef --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_target_cache.h @@ -0,0 +1,152 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TARGET_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TARGET_CACHE_H_ + +#include + +#include "Firestore/Protos/nanopb/firestore/local/target.nanopb.h" +#include "Firestore/core/src/local/target_cache.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/nanopb/message.h" +#include "absl/strings/string_view.h" +#include "absl/types/optional.h" +#include "leveldb/db.h" + +namespace firebase { +namespace firestore { +namespace local { + +class LevelDbPersistence; +class LocalSerializer; +class TargetData; + +/** Cached Queries backed by LevelDB. */ +class LevelDbTargetCache : public TargetCache { + public: + /** + * Retrieves the global singleton metadata row from the given database. If the + * metadata row doesn't exist, this will result in an assertion failure. + * + * TODO(gsoltis): remove this method once fully ported to transactions. + */ + static nanopb::Message ReadMetadata( + leveldb::DB* db); + + /** + * Test-only -- same as `ReadMetadata`, but returns an empty optional if the + * metadata row doesn't exist. + */ + static absl::optional> + TryReadMetadata(leveldb::DB* db); + + /** + * Creates a new target cache in the given LevelDB. + * + * @param db The LevelDB in which to create the cache. + */ + LevelDbTargetCache(LevelDbPersistence* db, LocalSerializer* serializer); + + // Target-related methods + void AddTarget(const TargetData& target_data) override; + + void UpdateTarget(const TargetData& target_data) override; + + void RemoveTarget(const TargetData& target_data) override; + + absl::optional GetTarget(const core::Target& target) override; + + void EnumerateTargets(const TargetCallback& callback) override; + + int RemoveTargets(model::ListenSequenceNumber upper_bound, + const std::unordered_map& + live_targets) override; + + // Key-related methods + + /** + * Adds the given document keys to cached query results of the given target + * ID. + */ + void AddMatchingKeys(const model::DocumentKeySet& keys, + model::TargetId target_id) override; + + /** Removes the given document keys from the cached query results of the given + * target ID. */ + void RemoveMatchingKeys(const model::DocumentKeySet& keys, + model::TargetId target_id) override; + + /** Removes all the keys in the query results of the given target ID. */ + void RemoveAllKeysForTarget(model::TargetId target_id); + + model::DocumentKeySet GetMatchingKeys(model::TargetId target_id) override; + + /** + * Checks to see if there are any references to a document with the given key. + */ + bool Contains(const model::DocumentKey& key) override; + + // Other methods and accessors + size_t size() const override { + return metadata_->target_count; + } + + model::TargetId highest_target_id() const override { + return metadata_->highest_target_id; + } + + model::ListenSequenceNumber highest_listen_sequence_number() const override { + return metadata_->highest_listen_sequence_number; + } + + const model::SnapshotVersion& GetLastRemoteSnapshotVersion() const override; + + void SetLastRemoteSnapshotVersion(model::SnapshotVersion version) override; + + // Non-interface methods + void Start(); + + void EnumerateOrphanedDocuments(const OrphanedDocumentCallback& callback); + + private: + void Save(const TargetData& target_data); + bool UpdateMetadata(const TargetData& target_data); + void SaveMetadata(); + + /** + * Parses the given bytes as a `firestore_client_Target` protocol buffer and + * then converts to the equivalent target data. + */ + TargetData DecodeTarget(absl::string_view encoded); + + // The LevelDbTargetCache is owned by LevelDbPersistence. + LevelDbPersistence* db_; + // Owned by LevelDbPersistence. + LocalSerializer* serializer_ = nullptr; + + /** A write-through cached copy of the metadata for the target cache. */ + nanopb::Message metadata_; + + model::SnapshotVersion last_remote_snapshot_version_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TARGET_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_transaction.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_transaction.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.cc index b1d9f5c1c..d4e7d0f49 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_transaction.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/leveldb_transaction.h" +#include "Firestore/core/src/local/leveldb_transaction.h" -#include "Firestore/core/src/firebase/firestore/local/leveldb_key.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" +#include "Firestore/core/src/local/leveldb_key.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" #include "absl/memory/memory.h" #include "absl/strings/str_cat.h" #include "leveldb/write_batch.h" @@ -83,12 +83,12 @@ void LevelDbTransaction::Iterator::Seek(const std::string& key) { last_version_ = txn_->version_; } -absl::string_view LevelDbTransaction::Iterator::key() { +const std::string& LevelDbTransaction::Iterator::key() const { HARD_ASSERT(Valid(), "key() called on invalid iterator"); return current_.first; } -absl::string_view LevelDbTransaction::Iterator::value() { +const std::string& LevelDbTransaction::Iterator::value() const { HARD_ASSERT(Valid(), "value() called on invalid iterator"); return current_.second; } @@ -139,21 +139,18 @@ LevelDbTransaction::LevelDbTransaction(DB* db, absl::string_view label, const ReadOptions& read_options, const WriteOptions& write_options) - : db_(db), - mutations_(), - deletions_(), + : db_(NOT_NULL(db)), read_options_(read_options), write_options_(write_options), - version_(0), - label_(std::string{label}) { + label_(label) { } const ReadOptions& LevelDbTransaction::DefaultReadOptions() { - static ReadOptions options = ([]() { + static ReadOptions options = [] { ReadOptions read_options; read_options.verify_checksums = true; return read_options; - })(); + }(); return options; } @@ -164,7 +161,7 @@ const WriteOptions& LevelDbTransaction::DefaultWriteOptions() { void LevelDbTransaction::Put(std::string key, std::string value) { deletions_.erase(key); - mutations_.emplace(std::make_pair(std::move(key), std::move(value))); + mutations_[std::move(key)] = std::move(value); version_++; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_transaction.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.h similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_transaction.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.h index 3dc06fea8..4cf0ecd81 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_transaction.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_transaction.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_TRANSACTION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_TRANSACTION_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TRANSACTION_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TRANSACTION_H_ #include #include @@ -24,13 +24,12 @@ #include #include +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/writer.h" #include "absl/strings/string_view.h" #include "leveldb/db.h" -#if __OBJC__ -#import -#endif - namespace firebase { namespace firestore { namespace local { @@ -56,7 +55,7 @@ class LevelDbTransaction { /** * Returns true if this iterator points to an entry */ - bool Valid() { + bool Valid() const { return is_valid_; } @@ -74,12 +73,12 @@ class LevelDbTransaction { /** * Returns the key of the current entry */ - absl::string_view key(); + const std::string& key() const; /** * Returns the value of the current entry */ - absl::string_view value(); + const std::string& value() const; private: /** @@ -156,25 +155,21 @@ class LevelDbTransaction { */ void Delete(absl::string_view key); -#if __OBJC__ - /** - * Schedules the row identified by `key` to be set to the given protocol - * buffer message when this transaction commits. - */ - void Put(absl::string_view key, GPBMessage* message) { - NSData* data = [message data]; - std::string key_string(key); - mutations_[key_string] = std::string((const char*)data.bytes, data.length); - version_++; - } -#endif - /** * Schedules the row identified by `key` to be set to `value` when this * transaction commits. */ void Put(std::string key, std::string value); + /** + * Schedules the row identified by `key` to be set to the given protocol + * buffer message when this transaction commits. + */ + template + void Put(std::string key, const nanopb::Message& message) { + Put(std::move(key), MakeStdString(message)); + } + /** * Sets the contents of `value` to the latest known value for the given key, * including any pending mutations and `Status::OK` is returned. If the key @@ -198,12 +193,12 @@ class LevelDbTransaction { std::string ToString(); private: - leveldb::DB* db_; + leveldb::DB* db_ = nullptr; Mutations mutations_; Deletions deletions_; leveldb::ReadOptions read_options_; leveldb::WriteOptions write_options_; - int32_t version_; + int32_t version_ = 0; std::string label_; }; @@ -218,4 +213,4 @@ std::string DescribeKey( } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_TRANSACTION_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_TRANSACTION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.cc new file mode 100644 index 000000000..db0c155bc --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.cc @@ -0,0 +1,50 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/leveldb_util.h" + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/util/status.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace local { + +namespace { + +Error ConvertStatusCode(const leveldb::Status& status) { + if (status.ok()) return Error::kErrorOk; + if (status.IsNotFound()) return Error::kErrorNotFound; + if (status.IsCorruption()) return Error::kErrorDataLoss; + if (status.IsIOError()) return Error::kErrorUnavailable; + if (status.IsNotSupportedError()) return Error::kErrorUnimplemented; + if (status.IsInvalidArgument()) return Error::kErrorInvalidArgument; + return Error::kErrorUnknown; +} + +} // namespace + +util::Status ConvertStatus(const leveldb::Status& status) { + if (status.ok()) return util::Status::OK(); + + Error code = ConvertStatusCode(status); + return util::Status{code, absl::StrCat("LevelDB error: ", status.ToString())}; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_util.h b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_util.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.h index f2e79f6fb..7bddd54bd 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/leveldb_util.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/leveldb_util.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_UTIL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_UTIL_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LEVELDB_UTIL_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LEVELDB_UTIL_H_ #include -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/util/status_fwd.h" #include "absl/strings/string_view.h" #include "leveldb/slice.h" #include "leveldb/status.h" @@ -45,4 +45,4 @@ util::Status ConvertStatus(const leveldb::Status& status); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LEVELDB_UTIL_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LEVELDB_UTIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/listen_sequence.h b/Pods/FirebaseFirestore/Firestore/core/src/local/listen_sequence.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/listen_sequence.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/listen_sequence.h index 6172e977f..71cd55055 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/listen_sequence.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/listen_sequence.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LISTEN_SEQUENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LISTEN_SEQUENCE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LISTEN_SEQUENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LISTEN_SEQUENCE_H_ -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/types.h" namespace firebase { namespace firestore { @@ -46,4 +46,4 @@ class ListenSequence { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LISTEN_SEQUENCE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LISTEN_SEQUENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.cc new file mode 100644 index 000000000..54d7039d4 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.cc @@ -0,0 +1,245 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/local_documents_view.h" + +#include +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/mutation_queue.h" +#include "Firestore/core/src/local/remote_document_cache.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::Query; +using model::Document; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::MaybeDocument; +using model::MaybeDocumentMap; +using model::Mutation; +using model::MutationBatch; +using model::NoDocument; +using model::OptionalMaybeDocumentMap; +using model::ResourcePath; +using model::SnapshotVersion; + +absl::optional LocalDocumentsView::GetDocument( + const DocumentKey& key) { + std::vector batches = + mutation_queue_->AllMutationBatchesAffectingDocumentKey(key); + return GetDocument(key, batches); +} + +absl::optional LocalDocumentsView::GetDocument( + const DocumentKey& key, const std::vector& batches) { + absl::optional document = remote_document_cache_->Get(key); + for (const MutationBatch& batch : batches) { + document = batch.ApplyToLocalDocument(document, key); + } + + return document; +} + +OptionalMaybeDocumentMap LocalDocumentsView::ApplyLocalMutationsToDocuments( + const OptionalMaybeDocumentMap& docs, + const std::vector& batches) { + OptionalMaybeDocumentMap results; + + for (const auto& kv : docs) { + const DocumentKey& key = kv.first; + absl::optional local_view = kv.second; + for (const MutationBatch& batch : batches) { + local_view = batch.ApplyToLocalDocument(local_view, key); + } + results = results.insert(key, local_view); + } + return results; +} + +MaybeDocumentMap LocalDocumentsView::GetDocuments(const DocumentKeySet& keys) { + OptionalMaybeDocumentMap docs = remote_document_cache_->GetAll(keys); + return GetLocalViewOfDocuments(docs); +} + +MaybeDocumentMap LocalDocumentsView::GetLocalViewOfDocuments( + const OptionalMaybeDocumentMap& base_docs) { + DocumentKeySet all_keys; + for (const auto& kv : base_docs) { + all_keys = all_keys.insert(kv.first); + } + std::vector batches = + mutation_queue_->AllMutationBatchesAffectingDocumentKeys(all_keys); + + OptionalMaybeDocumentMap docs = + ApplyLocalMutationsToDocuments(base_docs, batches); + + MaybeDocumentMap results; + for (const auto& kv : docs) { + const DocumentKey& key = kv.first; + absl::optional maybe_doc = kv.second; + + // TODO(http://b/32275378): Don't conflate missing / deleted. + if (!maybe_doc) { + maybe_doc = NoDocument(key, SnapshotVersion::None(), + /* has_committed_mutations= */ false); + } + results = results.insert(key, *maybe_doc); + } + + return results; +} + +DocumentMap LocalDocumentsView::GetDocumentsMatchingQuery( + const Query& query, const model::SnapshotVersion& since_read_time) { + if (query.IsDocumentQuery()) { + return GetDocumentsMatchingDocumentQuery(query.path()); + } else if (query.IsCollectionGroupQuery()) { + return GetDocumentsMatchingCollectionGroupQuery(query, since_read_time); + } else { + return GetDocumentsMatchingCollectionQuery(query, since_read_time); + } +} + +DocumentMap LocalDocumentsView::GetDocumentsMatchingDocumentQuery( + const ResourcePath& doc_path) { + DocumentMap result; + // Just do a simple document lookup. + absl::optional doc = GetDocument(DocumentKey{doc_path}); + if (doc && doc->is_document()) { + result = result.insert(doc->key(), Document(*doc)); + } + return result; +} + +model::DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionGroupQuery( + const Query& query, const SnapshotVersion& since_read_time) { + HARD_ASSERT( + query.path().empty(), + "Currently we only support collection group queries at the root."); + + const std::string& collection_id = *query.collection_group(); + std::vector parents = + index_manager_->GetCollectionParents(collection_id); + DocumentMap results; + + // Perform a collection query against each parent that contains the + // collection_id and aggregate the results. + for (const ResourcePath& parent : parents) { + Query collection_query = + query.AsCollectionQueryAtPath(parent.Append(collection_id)); + DocumentMap collection_results = + GetDocumentsMatchingCollectionQuery(collection_query, since_read_time); + for (const auto& kv : collection_results.underlying_map()) { + const DocumentKey& key = kv.first; + results = results.insert(key, Document(kv.second)); + } + } + return results; +} + +DocumentMap LocalDocumentsView::GetDocumentsMatchingCollectionQuery( + const Query& query, const SnapshotVersion& since_read_time) { + DocumentMap results = + remote_document_cache_->GetMatching(query, since_read_time); + // Get locally persisted mutation batches. + std::vector matching_batches = + mutation_queue_->AllMutationBatchesAffectingQuery(query); + + results = AddMissingBaseDocuments(matching_batches, std::move(results)); + + for (const MutationBatch& batch : matching_batches) { + for (const Mutation& mutation : batch.mutations()) { + // Only process documents belonging to the collection. + if (!query.path().IsImmediateParentOf(mutation.key().path())) { + continue; + } + + const DocumentKey& key = mutation.key(); + // base_doc may be unset for the documents that weren't yet written to + // the backend. + absl::optional base_doc = + results.underlying_map().get(key); + + absl::optional mutated_doc = mutation.ApplyToLocalView( + base_doc, base_doc, batch.local_write_time()); + + if (mutated_doc && mutated_doc->is_document()) { + results = results.insert(key, Document(*mutated_doc)); + } else { + results = results.erase(key); + } + } + } + + // Finally, filter out any documents that don't actually match the query. Note + // that the extra reference here prevents DocumentMap's destructor from + // deallocating the initial unfiltered results while we're iterating over + // them. + DocumentMap unfiltered = results; + for (const auto& kv : unfiltered.underlying_map()) { + const DocumentKey& key = kv.first; + Document doc(kv.second); + if (!query.Matches(doc)) { + results = results.erase(key); + } + } + + return results; +} + +DocumentMap LocalDocumentsView::AddMissingBaseDocuments( + const std::vector& matching_batches, + DocumentMap existing_docs) { + DocumentKeySet missing_doc_keys; + for (const MutationBatch& batch : matching_batches) { + for (const Mutation& mutation : batch.mutations()) { + const DocumentKey& key = mutation.key(); + if (mutation.type() == Mutation::Type::Patch && + !existing_docs.underlying_map().contains(key)) { + missing_doc_keys = missing_doc_keys.insert(key); + } + } + } + + OptionalMaybeDocumentMap missing_docs = + remote_document_cache_->GetAll(missing_doc_keys); + for (const auto& kv : missing_docs) { + const absl::optional& maybe_doc = kv.second; + if (maybe_doc && maybe_doc->is_document()) { + existing_docs = existing_docs.insert(kv.first, Document(*maybe_doc)); + } + } + + return existing_docs; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.h b/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.h new file mode 100644 index 000000000..9b08a1ca0 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_documents_view.h @@ -0,0 +1,151 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ + +#include + +#include "Firestore/core/src/local/index_manager.h" +#include "Firestore/core/src/local/mutation_queue.h" +#include "Firestore/core/src/local/remote_document_cache.h" +#include "Firestore/core/src/model/model_fwd.h" + +namespace firebase { +namespace firestore { + +namespace core { +class Query; +} // namespace core + +namespace local { + +/** + * A readonly view of the local state of all documents we're tracking (i.e. we + * have a cached version in the RemoteDocumentCache or local mutations for the + * document). The view is computed by applying the mutations in the + * MutationQueue to the RemoteDocumentCache. + */ +class LocalDocumentsView { + public: + LocalDocumentsView(RemoteDocumentCache* remote_document_cache, + MutationQueue* mutation_queue, + IndexManager* index_manager) + : remote_document_cache_{remote_document_cache}, + mutation_queue_{mutation_queue}, + index_manager_{index_manager} { + } + + virtual ~LocalDocumentsView() = default; + + /** + * Gets the local view of the document identified by `key`. + * + * @return Local view of the document or nil if we don't have any cached state + * for it. + */ + absl::optional GetDocument( + const model::DocumentKey& key); + + /** + * Gets the local view of the documents identified by `keys`. + * + * If we don't have cached state for a document in `keys`, a DeletedDocument + * will be stored for that key in the resulting set. + */ + model::MaybeDocumentMap GetDocuments(const model::DocumentKeySet& keys); + + /** + * Similar to `GetDocuments`, but creates the local view from the given + * `base_docs` without retrieving documents from the local store. + */ + model::MaybeDocumentMap GetLocalViewOfDocuments( + const model::OptionalMaybeDocumentMap& base_docs); + + /** + * Performs a query against the local view of all documents. + * + * @param query The query to match documents against. + * @param since_read_time If not set to SnapshotVersion::None(), return only + * documents that have been read since this snapshot version (exclusive). + */ + // Virtual for testing. + virtual model::DocumentMap GetDocumentsMatchingQuery( + const core::Query& query, const model::SnapshotVersion& since_read_time); + + private: + friend class CountingQueryEngine; // For testing + + /** Internal version of GetDocument that allows re-using batches. */ + absl::optional GetDocument( + const model::DocumentKey& key, + const std::vector& batches); + + /** + * Returns the view of the given `docs` as they would appear after applying + * all mutations in the given `batches`. + */ + model::OptionalMaybeDocumentMap ApplyLocalMutationsToDocuments( + const model::OptionalMaybeDocumentMap& docs, + const std::vector& batches); + + /** Performs a simple document lookup for the given path. */ + model::DocumentMap GetDocumentsMatchingDocumentQuery( + const model::ResourcePath& doc_path); + + model::DocumentMap GetDocumentsMatchingCollectionGroupQuery( + const core::Query& query, const model::SnapshotVersion& since_read_time); + + /** Queries the remote documents and overlays mutations. */ + model::DocumentMap GetDocumentsMatchingCollectionQuery( + const core::Query& query, const model::SnapshotVersion& since_read_time); + + /** + * It is possible that a `PatchMutation` can make a document match a query, + * even if the version in the `RemoteDocumentCache` is not a match yet + * (waiting for server to ack). To handle this, we find all document keys + * affected by the `PatchMutation`s that are not in `existing_docs` yet, and + * back fill them via `remote_document_cache_->GetAll`, otherwise those + * `PatchMutation`s will be ignored because no base document can be found, and + * lead to missing results for the query. + */ + model::DocumentMap AddMissingBaseDocuments( + const std::vector& matching_batches, + model::DocumentMap existing_docs); + + RemoteDocumentCache* remote_document_cache() { + return remote_document_cache_; + } + + MutationQueue* mutation_queue() { + return mutation_queue_; + } + + IndexManager* index_manager() { + return index_manager_; + } + + private: + RemoteDocumentCache* remote_document_cache_; + MutationQueue* mutation_queue_; + IndexManager* index_manager_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_DOCUMENTS_VIEW_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.cc new file mode 100644 index 000000000..f321744e5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.cc @@ -0,0 +1,353 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/local_serializer.h" + +#include +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h" +#include "Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h" +#include "Firestore/Protos/nanopb/firestore/local/target.nanopb.h" +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/model/unknown_document.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_format.h" + +namespace firebase { +namespace firestore { +namespace local { + +namespace { + +using core::Target; +using model::Document; +using model::DocumentState; +using model::FieldValue; +using model::MaybeDocument; +using model::Mutation; +using model::MutationBatch; +using model::NoDocument; +using model::ObjectValue; +using model::SnapshotVersion; +using model::UnknownDocument; +using nanopb::ByteString; +using nanopb::CheckedSize; +using nanopb::MakeArray; +using nanopb::Message; +using nanopb::Reader; +using nanopb::SafeReadBoolean; +using nanopb::Writer; +using util::Status; +using util::StringFormat; + +} // namespace + +Message LocalSerializer::EncodeMaybeDocument( + const MaybeDocument& maybe_doc) const { + Message result; + + switch (maybe_doc.type()) { + case MaybeDocument::Type::Document: { + result->which_document_type = firestore_client_MaybeDocument_document_tag; + Document doc(maybe_doc); + // TODO(b/142956770): other platforms check for whether the `Document` + // contains a memoized proto and use it if available instead of + // re-encoding. + result->document = EncodeDocument(doc); + result->has_committed_mutations = doc.has_committed_mutations(); + return result; + } + + case MaybeDocument::Type::NoDocument: { + result->which_document_type = + firestore_client_MaybeDocument_no_document_tag; + NoDocument no_doc(maybe_doc); + result->no_document = EncodeNoDocument(no_doc); + result->has_committed_mutations = no_doc.has_committed_mutations(); + return result; + } + + case MaybeDocument::Type::UnknownDocument: + result->which_document_type = + firestore_client_MaybeDocument_unknown_document_tag; + result->unknown_document = + EncodeUnknownDocument(UnknownDocument(maybe_doc)); + result->has_committed_mutations = true; + return result; + + case MaybeDocument::Type::Invalid: + HARD_FAIL("Unknown document type %s", maybe_doc.type()); + } + + UNREACHABLE(); +} + +MaybeDocument LocalSerializer::DecodeMaybeDocument( + Reader* reader, const firestore_client_MaybeDocument& proto) const { + if (!reader->status().ok()) return {}; + + switch (proto.which_document_type) { + case firestore_client_MaybeDocument_document_tag: + return DecodeDocument(reader, proto.document, + SafeReadBoolean(proto.has_committed_mutations)); + + case firestore_client_MaybeDocument_no_document_tag: + return DecodeNoDocument(reader, proto.no_document, + SafeReadBoolean(proto.has_committed_mutations)); + + case firestore_client_MaybeDocument_unknown_document_tag: + return DecodeUnknownDocument(reader, proto.unknown_document); + + default: + reader->Fail( + StringFormat("Invalid MaybeDocument document type: %s. Expected " + "'no_document' (%s) or 'document' (%s)", + proto.which_document_type, + firestore_client_MaybeDocument_no_document_tag, + firestore_client_MaybeDocument_document_tag)); + return {}; + } + + UNREACHABLE(); +} + +google_firestore_v1_Document LocalSerializer::EncodeDocument( + const Document& doc) const { + google_firestore_v1_Document result{}; + + result.name = rpc_serializer_.EncodeKey(doc.key()); + + // Encode Document.fields (unless it's empty) + pb_size_t count = CheckedSize(doc.data().GetInternalValue().size()); + result.fields_count = count; + result.fields = MakeArray(count); + int i = 0; + for (const auto& kv : doc.data().GetInternalValue()) { + result.fields[i].key = rpc_serializer_.EncodeString(kv.first); + result.fields[i].value = rpc_serializer_.EncodeFieldValue(kv.second); + i++; + } + + result.has_update_time = true; + result.update_time = rpc_serializer_.EncodeVersion(doc.version()); + // Ignore Document.create_time. (We don't use this in our on-disk protos.) + + return result; +} + +Document LocalSerializer::DecodeDocument( + Reader* reader, + const google_firestore_v1_Document& proto, + bool has_committed_mutations) const { + ObjectValue fields = + rpc_serializer_.DecodeFields(reader, proto.fields_count, proto.fields); + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader, proto.update_time); + + DocumentState state = has_committed_mutations + ? DocumentState::kCommittedMutations + : DocumentState::kSynced; + return Document(std::move(fields), + rpc_serializer_.DecodeKey(reader, proto.name), version, + state); +} + +firestore_client_NoDocument LocalSerializer::EncodeNoDocument( + const NoDocument& no_doc) const { + firestore_client_NoDocument result{}; + + result.name = rpc_serializer_.EncodeKey(no_doc.key()); + result.read_time = rpc_serializer_.EncodeVersion(no_doc.version()); + + return result; +} + +NoDocument LocalSerializer::DecodeNoDocument( + Reader* reader, + const firestore_client_NoDocument& proto, + bool has_committed_mutations) const { + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader, proto.read_time); + + return NoDocument(rpc_serializer_.DecodeKey(reader, proto.name), version, + has_committed_mutations); +} + +firestore_client_UnknownDocument LocalSerializer::EncodeUnknownDocument( + const UnknownDocument& unknown_doc) const { + firestore_client_UnknownDocument result{}; + + result.name = rpc_serializer_.EncodeKey(unknown_doc.key()); + result.version = rpc_serializer_.EncodeVersion(unknown_doc.version()); + + return result; +} + +UnknownDocument LocalSerializer::DecodeUnknownDocument( + Reader* reader, const firestore_client_UnknownDocument& proto) const { + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader, proto.version); + + return UnknownDocument(rpc_serializer_.DecodeKey(reader, proto.name), + version); +} + +Message LocalSerializer::EncodeTargetData( + const TargetData& target_data) const { + HARD_ASSERT(target_data.purpose() == QueryPurpose::Listen, + "Only queries with purpose %s may be stored, got %s", + QueryPurpose::Listen, target_data.purpose()); + + Message result; + + result->target_id = target_data.target_id(); + result->last_listen_sequence_number = target_data.sequence_number(); + result->snapshot_version = rpc_serializer_.EncodeTimestamp( + target_data.snapshot_version().timestamp()); + result->last_limbo_free_snapshot_version = rpc_serializer_.EncodeTimestamp( + target_data.last_limbo_free_snapshot_version().timestamp()); + + // Force a copy because pb_release would otherwise double-free. + result->resume_token = + nanopb::CopyBytesArray(target_data.resume_token().get()); + + const Target& target = target_data.target(); + if (target.IsDocumentQuery()) { + result->which_target_type = firestore_client_Target_documents_tag; + result->documents = rpc_serializer_.EncodeDocumentsTarget(target); + } else { + result->which_target_type = firestore_client_Target_query_tag; + result->query = rpc_serializer_.EncodeQueryTarget(target); + } + + return result; +} + +TargetData LocalSerializer::DecodeTargetData( + Reader* reader, const firestore_client_Target& proto) const { + if (!reader->status().ok()) return TargetData(); + + model::TargetId target_id = proto.target_id; + model::ListenSequenceNumber sequence_number = + static_cast( + proto.last_listen_sequence_number); + SnapshotVersion version = + rpc_serializer_.DecodeVersion(reader, proto.snapshot_version); + SnapshotVersion last_limbo_free_snapshot_version = + rpc_serializer_.DecodeVersion(reader, + proto.last_limbo_free_snapshot_version); + ByteString resume_token(proto.resume_token); + Target target; + + switch (proto.which_target_type) { + case firestore_client_Target_query_tag: + target = rpc_serializer_.DecodeQueryTarget(reader, proto.query); + break; + + case firestore_client_Target_documents_tag: + target = rpc_serializer_.DecodeDocumentsTarget(reader, proto.documents); + break; + + default: + reader->Fail( + StringFormat("Unknown target_type: %s", proto.which_target_type)); + } + + if (!reader->status().ok()) return TargetData(); + return TargetData(std::move(target), target_id, sequence_number, + QueryPurpose::Listen, version, + last_limbo_free_snapshot_version, std::move(resume_token)); +} + +Message LocalSerializer::EncodeMutationBatch( + const MutationBatch& mutation_batch) const { + Message result; + + result->batch_id = mutation_batch.batch_id(); + + pb_size_t count = CheckedSize(mutation_batch.base_mutations().size()); + result->base_writes_count = count; + result->base_writes = MakeArray(count); + int i = 0; + for (const auto& mutation : mutation_batch.base_mutations()) { + result->base_writes[i] = rpc_serializer_.EncodeMutation(mutation); + i++; + } + + count = CheckedSize(mutation_batch.mutations().size()); + result->writes_count = count; + result->writes = MakeArray(count); + i = 0; + for (const auto& mutation : mutation_batch.mutations()) { + result->writes[i] = rpc_serializer_.EncodeMutation(mutation); + i++; + } + + result->local_write_time = + rpc_serializer_.EncodeTimestamp(mutation_batch.local_write_time()); + + return result; +} + +MutationBatch LocalSerializer::DecodeMutationBatch( + nanopb::Reader* reader, const firestore_client_WriteBatch& proto) const { + int batch_id = proto.batch_id; + Timestamp local_write_time = + rpc_serializer_.DecodeTimestamp(reader, proto.local_write_time); + + std::vector base_mutations; + for (size_t i = 0; i < proto.base_writes_count; i++) { + base_mutations.push_back( + rpc_serializer_.DecodeMutation(reader, proto.base_writes[i])); + } + + std::vector mutations; + for (size_t i = 0; i < proto.writes_count; i++) { + mutations.push_back( + rpc_serializer_.DecodeMutation(reader, proto.writes[i])); + } + + return MutationBatch(batch_id, local_write_time, std::move(base_mutations), + std::move(mutations)); +} + +google_protobuf_Timestamp LocalSerializer::EncodeVersion( + const model::SnapshotVersion& version) const { + return rpc_serializer_.EncodeVersion(version); +} + +model::SnapshotVersion LocalSerializer::DecodeVersion( + nanopb::Reader* reader, const google_protobuf_Timestamp& proto) const { + return rpc_serializer_.DecodeVersion(reader, proto); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.h b/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.h new file mode 100644 index 000000000..3ed502906 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_serializer.h @@ -0,0 +1,155 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LOCAL_SERIALIZER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_SERIALIZER_H_ + +#include +#include +#include + +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/remote/serializer.h" +#include "Firestore/core/src/util/status_fwd.h" + +namespace firebase { +namespace firestore { + +typedef struct _firestore_client_MaybeDocument firestore_client_MaybeDocument; +typedef struct _firestore_client_NoDocument firestore_client_NoDocument; +typedef struct _firestore_client_Target firestore_client_Target; +typedef struct _firestore_client_UnknownDocument + firestore_client_UnknownDocument; +typedef struct _firestore_client_WriteBatch firestore_client_WriteBatch; + +namespace nanopb { +template +class Message; + +class Reader; +class Writer; +} // namespace nanopb + +namespace local { + +class TargetData; + +/** + * @brief Serializer for values stored in the LocalStore. + * + * All errors that occur during serialization are fatal. + * + * All deserialization methods (that can fail) take a nanopb::Reader parameter + * whose status will be set to failed upon an error. Callers must check this + * before using the returned value via `reader->status()`. A deserialization + * method might fail if a protocol buffer is missing a critical field or has a + * value we can't interpret. On error, the return value from a deserialization + * method is unspecified. + * + * Note that local::LocalSerializer currently delegates to the + * remote::Serializer (for the Firestore v1 RPC protocol) to save implementation + * time and code duplication. We'll need to revisit this when the RPC protocol + * we use diverges from local storage. + */ +class LocalSerializer { + public: + explicit LocalSerializer(remote::Serializer rpc_serializer) + : rpc_serializer_(std::move(rpc_serializer)) { + } + + /** + * @brief Encodes a MaybeDocument model to the equivalent nanopb proto for + * local storage. + */ + nanopb::Message EncodeMaybeDocument( + const model::MaybeDocument& maybe_doc) const; + + /** + * @brief Decodes nanopb proto representing a MaybeDocument proto to the + * equivalent model. + */ + model::MaybeDocument DecodeMaybeDocument( + nanopb::Reader* reader, + const firestore_client_MaybeDocument& proto) const; + + /** + * @brief Encodes a TargetData to the equivalent nanopb proto, representing a + * ::firestore::proto::Target, for local storage. + */ + nanopb::Message EncodeTargetData( + const TargetData& target_data) const; + + /** + * @brief Decodes nanopb proto representing a ::firestore::proto::Target proto + * to the equivalent TargetData. + */ + TargetData DecodeTargetData(nanopb::Reader* reader, + const firestore_client_Target& proto) const; + + /** + * @brief Encodes a MutationBatch to the equivalent nanopb proto, representing + * a ::firestore::client::WriteBatch, for local storage in the mutation queue. + */ + nanopb::Message EncodeMutationBatch( + const model::MutationBatch& mutation_batch) const; + + /** + * @brief Decodes a nanopb proto representing a + * ::firestore::client::WriteBatch proto to the equivalent MutationBatch. + */ + model::MutationBatch DecodeMutationBatch( + nanopb::Reader* reader, const firestore_client_WriteBatch& proto) const; + + google_protobuf_Timestamp EncodeVersion( + const model::SnapshotVersion& version) const; + + model::SnapshotVersion DecodeVersion( + nanopb::Reader* reader, const google_protobuf_Timestamp& proto) const; + + private: + /** + * Encodes a Document for local storage. This differs from the v1 RPC + * serializer for Documents in that it preserves the update_time, which is + * considered an output only value by the server. + */ + google_firestore_v1_Document EncodeDocument(const model::Document& doc) const; + + model::Document DecodeDocument(nanopb::Reader* reader, + const google_firestore_v1_Document& proto, + bool has_committed_mutations) const; + + firestore_client_NoDocument EncodeNoDocument( + const model::NoDocument& no_doc) const; + + model::NoDocument DecodeNoDocument(nanopb::Reader* reader, + const firestore_client_NoDocument& proto, + bool has_committed_mutations) const; + + firestore_client_UnknownDocument EncodeUnknownDocument( + const model::UnknownDocument& unknown_doc) const; + model::UnknownDocument DecodeUnknownDocument( + nanopb::Reader* reader, + const firestore_client_UnknownDocument& proto) const; + + remote::Serializer rpc_serializer_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_SERIALIZER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.cc new file mode 100644 index 000000000..9f42c3072 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.cc @@ -0,0 +1,547 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/local_store.h" + +#include + +#include "Firestore/core/src/local/local_documents_view.h" +#include "Firestore/core/src/local/local_view_changes.h" +#include "Firestore/core/src/local/local_write_result.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/persistence.h" +#include "Firestore/core/src/local/query_engine.h" +#include "Firestore/core/src/local/query_result.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/target_cache.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/mutation_batch_result.h" +#include "Firestore/core/src/model/patch_mutation.h" +#include "Firestore/core/src/remote/remote_event.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/to_string.h" + +namespace firebase { +namespace firestore { +namespace local { + +namespace { + +using auth::User; +using core::Query; +using core::Target; +using core::TargetIdGenerator; +using model::BatchId; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::DocumentVersionMap; +using model::ListenSequenceNumber; +using model::MaybeDocument; +using model::MaybeDocumentMap; +using model::Mutation; +using model::MutationBatch; +using model::MutationBatchResult; +using model::ObjectValue; +using model::OptionalMaybeDocumentMap; +using model::PatchMutation; +using model::Precondition; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; +using remote::TargetChange; + +/** + * The maximum time to leave a resume token buffered without writing it out. + * This value is arbitrary: it's long enough to avoid several writes (possibly + * indefinitely if updates come more frequently than this) but short enough that + * restarting after crashing will still have a pretty recent resume token. + */ +const int64_t kResumeTokenMaxAgeSeconds = 5 * 60; // 5 minutes + +} // namespace + +LocalStore::LocalStore(Persistence* persistence, + QueryEngine* query_engine, + const User& initial_user) + : persistence_(persistence), + mutation_queue_(persistence->GetMutationQueueForUser(initial_user)), + remote_document_cache_(persistence->remote_document_cache()), + target_cache_(persistence->target_cache()), + query_engine_(query_engine), + local_documents_( + absl::make_unique(remote_document_cache_, + mutation_queue_, + persistence->index_manager())) { + persistence->reference_delegate()->AddInMemoryPins(&local_view_references_); + target_id_generator_ = TargetIdGenerator::TargetCacheTargetIdGenerator(0); + query_engine_->SetLocalDocumentsView(local_documents_.get()); +} + +LocalStore::~LocalStore() = default; + +void LocalStore::Start() { + StartMutationQueue(); + TargetId target_id = target_cache_->highest_target_id(); + target_id_generator_ = + TargetIdGenerator::TargetCacheTargetIdGenerator(target_id); +} + +void LocalStore::StartMutationQueue() { + persistence_->Run("Start MutationQueue", [&] { mutation_queue_->Start(); }); +} + +MaybeDocumentMap LocalStore::HandleUserChange(const User& user) { + // Swap out the mutation queue, grabbing the pending mutation batches before + // and after. + std::vector old_batches = persistence_->Run( + "OldBatches", [&] { return mutation_queue_->AllMutationBatches(); }); + + // The old one has a reference to the mutation queue, so null it out first. + local_documents_.reset(); + mutation_queue_ = persistence_->GetMutationQueueForUser(user); + + StartMutationQueue(); + + return persistence_->Run("NewBatches", [&] { + std::vector new_batches = + mutation_queue_->AllMutationBatches(); + + // Recreate our LocalDocumentsView using the new MutationQueue. + local_documents_ = absl::make_unique( + remote_document_cache_, mutation_queue_, persistence_->index_manager()); + query_engine_->SetLocalDocumentsView(local_documents_.get()); + + // Union the old/new changed keys. + DocumentKeySet changed_keys; + for (const std::vector* batches : + {&old_batches, &new_batches}) { + for (const MutationBatch& batch : *batches) { + for (const Mutation& mutation : batch.mutations()) { + changed_keys = changed_keys.insert(mutation.key()); + } + } + } + + // Return the set of all (potentially) changed documents as the result of + // the user change. + return local_documents_->GetDocuments(changed_keys); + }); +} + +LocalWriteResult LocalStore::WriteLocally(std::vector&& mutations) { + Timestamp local_write_time = Timestamp::Now(); + DocumentKeySet keys; + for (const Mutation& mutation : mutations) { + keys = keys.insert(mutation.key()); + } + + return persistence_->Run("Locally write mutations", [&] { + // Load and apply all existing mutations. This lets us compute the current + // base state for all non-idempotent transforms before applying any + // additional user-provided writes. + MaybeDocumentMap existing_documents = local_documents_->GetDocuments(keys); + + // For non-idempotent mutations (such as `FieldValue.increment()`), we + // record the base state in a separate patch mutation. This is later used to + // guarantee consistent values and prevents flicker even if the backend + // sends us an update that already includes our transform. + std::vector base_mutations; + for (const Mutation& mutation : mutations) { + absl::optional base_document = + existing_documents.get(mutation.key()); + + absl::optional base_value = + mutation.ExtractBaseValue(base_document); + if (base_value) { + // NOTE: The base state should only be applied if there's some existing + // document to override, so use a Precondition of exists=true + base_mutations.push_back(PatchMutation(mutation.key(), *base_value, + base_value->ToFieldMask(), + Precondition::Exists(true))); + } + } + + MutationBatch batch = mutation_queue_->AddMutationBatch( + local_write_time, std::move(base_mutations), std::move(mutations)); + MaybeDocumentMap changed_documents = + batch.ApplyToLocalDocumentSet(existing_documents); + return LocalWriteResult{batch.batch_id(), std::move(changed_documents)}; + }); +} + +MaybeDocumentMap LocalStore::AcknowledgeBatch( + const MutationBatchResult& batch_result) { + return persistence_->Run("Acknowledge batch", [&] { + const MutationBatch& batch = batch_result.batch(); + mutation_queue_->AcknowledgeBatch(batch, batch_result.stream_token()); + ApplyBatchResult(batch_result); + mutation_queue_->PerformConsistencyCheck(); + + return local_documents_->GetDocuments(batch.keys()); + }); +} + +void LocalStore::ApplyBatchResult(const MutationBatchResult& batch_result) { + const MutationBatch& batch = batch_result.batch(); + DocumentKeySet doc_keys = batch.keys(); + const DocumentVersionMap& versions = batch_result.doc_versions(); + + for (const DocumentKey& doc_key : doc_keys) { + absl::optional remote_doc = + remote_document_cache_->Get(doc_key); + absl::optional doc = remote_doc; + + auto ack_version_iter = versions.find(doc_key); + HARD_ASSERT(ack_version_iter != versions.end(), + "doc_versions should contain every doc in the write."); + const SnapshotVersion& ack_version = ack_version_iter->second; + + if (!doc || doc->version() < ack_version) { + doc = batch.ApplyToRemoteDocument(doc, doc_key, batch_result); + if (!doc) { + HARD_ASSERT( + !remote_doc, + "Mutation batch %s applied to document %s resulted in nullopt.", + batch.ToString(), util::ToString(remote_doc)); + } else { + remote_document_cache_->Add(*doc, batch_result.commit_version()); + } + } + } + + mutation_queue_->RemoveMutationBatch(batch); +} + +MaybeDocumentMap LocalStore::RejectBatch(BatchId batch_id) { + return persistence_->Run("Reject batch", [&] { + absl::optional to_reject = + mutation_queue_->LookupMutationBatch(batch_id); + HARD_ASSERT(to_reject.has_value(), "Attempt to reject nonexistent batch!"); + + mutation_queue_->RemoveMutationBatch(*to_reject); + mutation_queue_->PerformConsistencyCheck(); + + return local_documents_->GetDocuments(to_reject->keys()); + }); +} + +ByteString LocalStore::GetLastStreamToken() { + return mutation_queue_->GetLastStreamToken(); +} + +void LocalStore::SetLastStreamToken(const ByteString& stream_token) { + persistence_->Run("Set stream token", + [&] { mutation_queue_->SetLastStreamToken(stream_token); }); +} + +const SnapshotVersion& LocalStore::GetLastRemoteSnapshotVersion() const { + return target_cache_->GetLastRemoteSnapshotVersion(); +} + +model::MaybeDocumentMap LocalStore::ApplyRemoteEvent( + const remote::RemoteEvent& remote_event) { + const SnapshotVersion& last_remote_version = + target_cache_->GetLastRemoteSnapshotVersion(); + + return persistence_->Run("Apply remote event", [&] { + // TODO(gsoltis): move the sequence number into the reference delegate. + ListenSequenceNumber sequence_number = + persistence_->current_sequence_number(); + + for (const auto& entry : remote_event.target_changes()) { + TargetId target_id = entry.first; + const TargetChange& change = entry.second; + + auto found = target_data_by_target_.find(target_id); + if (found == target_data_by_target_.end()) { + // We don't update the remote keys if the query is not active. This + // ensures that we persist the updated target data along with the + // updated assignment. + continue; + } + + TargetData old_target_data = found->second; + + target_cache_->RemoveMatchingKeys(change.removed_documents(), target_id); + target_cache_->AddMatchingKeys(change.added_documents(), target_id); + + // Update the resume token if the change includes one. Don't clear any + // preexisting value. Bump the sequence number as well, so that documents + // being removed now are ordered later than documents that were reviously + // _removed from this target. + const ByteString& resume_token = change.resume_token(); + // Update the resume token if the change includes one. + if (!resume_token.empty()) { + TargetData new_target_data = + old_target_data + .WithResumeToken(resume_token, remote_event.snapshot_version()) + .WithSequenceNumber(sequence_number); + target_data_by_target_[target_id] = new_target_data; + + // Update the target data if there are target changes (or if sufficient + // time has passed since the last update). + if (ShouldPersistTargetData(new_target_data, old_target_data, change)) { + target_cache_->UpdateTarget(new_target_data); + } + } + } + + OptionalMaybeDocumentMap changed_docs; + const DocumentKeySet& limbo_documents = + remote_event.limbo_document_changes(); + DocumentKeySet updated_keys; + for (const auto& kv : remote_event.document_updates()) { + updated_keys = updated_keys.insert(kv.first); + } + // Each loop iteration only affects its "own" doc, so it's safe to get all + // the remote documents in advance in a single call. + OptionalMaybeDocumentMap existing_docs = + remote_document_cache_->GetAll(updated_keys); + + for (const auto& kv : remote_event.document_updates()) { + const DocumentKey& key = kv.first; + const MaybeDocument& doc = kv.second; + absl::optional existing_doc; + auto found_existing = existing_docs.get(key); + if (found_existing) { + existing_doc = *found_existing; + } + + // Note: The order of the steps below is important, since we want to + // ensure that rejected limbo resolutions (which fabricate NoDocuments + // with SnapshotVersion::None) never add documents to cache. + if (doc.type() == MaybeDocument::Type::NoDocument && + doc.version() == SnapshotVersion::None()) { + // NoDocuments with SnapshotVersion::None are used in manufactured + // events. We remove these documents from cache since we lost access. + remote_document_cache_->Remove(key); + changed_docs = changed_docs.insert(key, doc); + } else if (!existing_doc || doc.version() > existing_doc->version() || + (doc.version() == existing_doc->version() && + existing_doc->has_pending_writes())) { + HARD_ASSERT(remote_event.snapshot_version() != SnapshotVersion::None(), + "Cannot add a document when the remote version is zero"); + remote_document_cache_->Add(doc, remote_event.snapshot_version()); + changed_docs = changed_docs.insert(key, doc); + } else { + LOG_DEBUG( + "LocalStore Ignoring outdated watch update for %s. " + "Current version: %s Watch version: %s", + key.ToString(), existing_doc->version().ToString(), + doc.version().ToString()); + } + + // If this was a limbo resolution, make sure we mark when it was accessed. + if (limbo_documents.contains(key)) { + persistence_->reference_delegate()->UpdateLimboDocument(key); + } + } + + // HACK: The only reason we allow omitting snapshot version is so we can + // synthesize remote events when we get permission denied errors while + // trying to resolve the state of a locally cached document that is in + // limbo. + const SnapshotVersion& remote_version = remote_event.snapshot_version(); + if (remote_version != SnapshotVersion::None()) { + HARD_ASSERT(remote_version >= last_remote_version, + "Watch stream reverted to previous snapshot?? (%s < %s)", + remote_version.ToString(), last_remote_version.ToString()); + target_cache_->SetLastRemoteSnapshotVersion(remote_version); + } + + return local_documents_->GetLocalViewOfDocuments(changed_docs); + }); +} + +bool LocalStore::ShouldPersistTargetData(const TargetData& new_target_data, + const TargetData& old_target_data, + const TargetChange& change) const { + // Avoid clearing any existing value + HARD_ASSERT(!new_target_data.resume_token().empty(), + "Attempted to persist target data with empty resume token"); + + // Always persist target data if we don't already have a resume token. + if (old_target_data.resume_token().empty()) return true; + + // Don't allow resume token changes to be buffered indefinitely. This allows + // us to be reasonably up-to-date after a crash and avoids needing to loop + // over all active queries on shutdown. Especially in the browser we may not + // get time to do anything interesting while the current tab is closing. + int64_t new_seconds = + new_target_data.snapshot_version().timestamp().seconds(); + int64_t old_seconds = + old_target_data.snapshot_version().timestamp().seconds(); + int64_t time_delta = new_seconds - old_seconds; + if (time_delta >= kResumeTokenMaxAgeSeconds) return true; + + // Otherwise if the only thing that has changed about a target is its resume + // token then it's not worth persisting. Note that the RemoteStore keeps an + // in-memory view of the currently active targets which includes the current + // resume token, so stream failure or user changes will still use an + // up-to-date resume token regardless of what we do here. + size_t changes = change.added_documents().size() + + change.modified_documents().size() + + change.removed_documents().size(); + return changes > 0; +} + +absl::optional LocalStore::GetTargetData( + const core::Target& target) { + auto target_id = target_id_by_target_.find(target); + if (target_id != target_id_by_target_.end()) { + return target_data_by_target_[target_id->second]; + } + return target_cache_->GetTarget(target); +} + +void LocalStore::NotifyLocalViewChanges( + const std::vector& view_changes) { + persistence_->Run("NotifyLocalViewChanges", [&] { + for (const LocalViewChanges& view_change : view_changes) { + int target_id = view_change.target_id(); + + for (const DocumentKey& key : view_change.removed_keys()) { + persistence_->reference_delegate()->RemoveReference(key); + } + local_view_references_.AddReferences(view_change.added_keys(), target_id); + local_view_references_.RemoveReferences(view_change.removed_keys(), + target_id); + + if (!view_change.is_from_cache()) { + const auto& entry = target_data_by_target_.find(target_id); + HARD_ASSERT( + entry != target_data_by_target_.end(), + "Can't set limbo-free snapshot version for unknown target: %s", + target_id); + const TargetData& target_data = entry->second; + + // Advance the last limbo free snapshot version + SnapshotVersion last_limbo_free_snapshot_version = + target_data.snapshot_version(); + TargetData updated_target_data = + target_data.WithLastLimboFreeSnapshotVersion( + last_limbo_free_snapshot_version); + target_data_by_target_[target_id] = updated_target_data; + } + } + }); +} + +absl::optional LocalStore::GetNextMutationBatch( + BatchId batch_id) { + return persistence_->Run("NextMutationBatchAfterBatchID", [&] { + return mutation_queue_->NextMutationBatchAfterBatchId(batch_id); + }); +} + +absl::optional LocalStore::ReadDocument(const DocumentKey& key) { + return persistence_->Run("ReadDocument", + [&] { return local_documents_->GetDocument(key); }); +} + +BatchId LocalStore::GetHighestUnacknowledgedBatchId() { + return persistence_->Run("GetHighestUnacknowledgedBatchId", [&] { + return mutation_queue_->GetHighestUnacknowledgedBatchId(); + }); +} + +TargetData LocalStore::AllocateTarget(Target target) { + TargetData target_data = persistence_->Run("Allocate target", [&] { + absl::optional cached = target_cache_->GetTarget(target); + // TODO(mcg): freshen last accessed date if cached exists? + if (!cached) { + cached = TargetData(std::move(target), target_id_generator_.NextId(), + persistence_->current_sequence_number(), + QueryPurpose::Listen); + target_cache_->AddTarget(*cached); + } + return *cached; + }); + + // Sanity check to ensure that even when resuming a query it's not currently + // active. + TargetId target_id = target_data.target_id(); + if (target_data_by_target_.find(target_id) == target_data_by_target_.end()) { + target_data_by_target_[target_id] = target_data; + target_id_by_target_[target_data.target()] = target_id; + } + + return target_data; +} + +void LocalStore::ReleaseTarget(TargetId target_id) { + persistence_->Run("Release target", [&] { + auto found = target_data_by_target_.find(target_id); + HARD_ASSERT(found != target_data_by_target_.end(), + "Tried to release a non-existent target: %s", target_id); + + TargetData target_data = found->second; + + // References for documents sent via Watch are automatically removed when we + // delete a query's target data from the reference delegate. Since this does + // not remove references for locally mutated documents, we have to remove + // the target associations for these documents manually. + DocumentKeySet removed = + local_view_references_.RemoveReferences(target_data.target_id()); + for (const DocumentKey& key : removed) { + persistence_->reference_delegate()->RemoveReference(key); + } + + // Note: This also updates the target cache. + persistence_->reference_delegate()->RemoveTarget(target_data); + target_data_by_target_.erase(target_id); + target_id_by_target_.erase(target_data.target()); + }); +} + +QueryResult LocalStore::ExecuteQuery(const Query& query, + bool use_previous_results) { + return persistence_->Run("ExecuteQuery", [&] { + absl::optional target_data = GetTargetData(query.ToTarget()); + SnapshotVersion last_limbo_free_snapshot_version; + DocumentKeySet remote_keys; + + if (target_data) { + last_limbo_free_snapshot_version = + target_data->last_limbo_free_snapshot_version(); + remote_keys = target_cache_->GetMatchingKeys(target_data->target_id()); + } + + model::DocumentMap documents = query_engine_->GetDocumentsMatchingQuery( + query, + use_previous_results ? last_limbo_free_snapshot_version + : SnapshotVersion::None(), + use_previous_results ? remote_keys : DocumentKeySet{}); + return QueryResult(std::move(documents), std::move(remote_keys)); + }); +} + +DocumentKeySet LocalStore::GetRemoteDocumentKeys(TargetId target_id) { + return persistence_->Run("RemoteDocumentKeysForTarget", [&] { + return target_cache_->GetMatchingKeys(target_id); + }); +} + +LruResults LocalStore::CollectGarbage(LruGarbageCollector* garbage_collector) { + return persistence_->Run("Collect garbage", [&] { + return garbage_collector->Collect(target_data_by_target_); + }); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.h b/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.h new file mode 100644 index 000000000..5b8e3ac66 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_store.h @@ -0,0 +1,312 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_LOCAL_STORE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_STORE_H_ + +#include +#include +#include + +#include "Firestore/core/src/core/target_id_generator.h" +#include "Firestore/core/src/local/reference_set.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { + +namespace auth { +class User; +} // namespace auth + +namespace core { +class Query; +} // namespace core + +namespace remote { +class RemoteEvent; +class TargetChange; +} // namespace remote + +namespace local { + +class LocalDocumentsView; +class LocalViewChanges; +class LocalWriteResult; +class LruGarbageCollector; +class MutationQueue; +class Persistence; +class QueryEngine; +class QueryResult; +class RemoteDocumentCache; +class TargetCache; + +struct LruResults; + +/** + * Local storage in the Firestore client. Coordinates persistence components + * like the mutation queue and remote document cache to present a latency + * compensated view of stored data. + * + * The LocalStore is responsible for accepting mutations from the SyncEngine. + * Writes from the client are put into a queue as provisional Mutations until + * they are processed by the RemoteStore and confirmed as having been written to + * the server. + * + * The local store provides the local version of documents that have been + * modified locally. It maintains the constraint: + * + * LocalDocument = RemoteDocument + Active(LocalMutations) + * + * (Active mutations are those that are enqueued and have not been previously + * acknowledged or rejected). + * + * The RemoteDocument ("ground truth") state is provided via the + * ApplyChangeBatch method. It will be some version of a server-provided + * document OR will be a server-provided document PLUS acknowledged mutations: + * + * RemoteDocument' = RemoteDocument + Acknowledged(LocalMutations) + * + * Note that this "dirty" version of a RemoteDocument will not be identical to a + * server base version, since it has LocalMutations added to it pending getting + * an authoritative copy from the server. + * + * Since LocalMutations can be rejected by the server, we have to be able to + * revert a LocalMutation that has already been applied to the LocalDocument + * (typically done by replaying all remaining LocalMutations to the + * RemoteDocument to re-apply). + * + * It also maintains the persistence of mapping queries to resume tokens and + * target ids. + * + * The LocalStore must be able to efficiently execute queries against its local + * cache of the documents, to provide the initial set of results before any + * remote changes have been received. + */ +class LocalStore { + public: + LocalStore(Persistence* persistence, + QueryEngine* query_engine, + const auth::User& initial_user); + + ~LocalStore(); + + /** Performs any initial startup actions required by the local store. */ + void Start(); + + /** + * Tells the LocalStore that the currently authenticated user has changed. + * + * In response the local store switches the mutation queue to the new user and + * returns any resulting document changes. + */ + model::MaybeDocumentMap HandleUserChange(const auth::User& user); + + /** Accepts locally generated Mutations and commits them to storage. */ + LocalWriteResult WriteLocally(std::vector&& mutations); + + /** + * Returns the current value of a document with a given key, or `nullopt` if + * not found. + */ + absl::optional ReadDocument( + const model::DocumentKey& key); + + /** + * Acknowledges the given batch. + * + * On the happy path when a batch is acknowledged, the local store will: + * + * + remove the batch from the mutation queue; + * + apply the changes to the remote document cache; + * + recalculate the latency compensated view implied by those changes (there + * may be mutations in the queue that affect the documents but haven't been + * acknowledged yet); and + * + give the changed documents back the sync engine + * + * @return The resulting (modified) documents. + */ + model::MaybeDocumentMap AcknowledgeBatch( + const model::MutationBatchResult& batch_result); + + /** + * Removes mutations from the MutationQueue for the specified batch. + * LocalDocuments will be recalculated. + * + * @return The resulting (modified) documents. + */ + model::MaybeDocumentMap RejectBatch(model::BatchId batch_id); + + /** Returns the last recorded stream token for the current user. */ + nanopb::ByteString GetLastStreamToken(); + + /** + * Sets the stream token for the current user without acknowledging any + * mutation batch. This is usually only useful after a stream handshake or in + * response to an error that requires clearing the stream token. + */ + void SetLastStreamToken(const nanopb::ByteString& stream_token); + + /** + * Returns the last consistent snapshot processed (used by the RemoteStore to + * determine whether to buffer incoming snapshots from the backend). + */ + const model::SnapshotVersion& GetLastRemoteSnapshotVersion() const; + + /** + * Updates the "ground-state" (remote) documents. We assume that the remote + * event reflects any write batches that have been acknowledged or rejected + * (i.e. we do not re-apply local mutations to updates from this event). + * + * LocalDocuments are re-calculated if there are remaining mutations in the + * queue. + */ + model::MaybeDocumentMap ApplyRemoteEvent( + const remote::RemoteEvent& remote_event); + + /** + * Returns the keys of the documents that are associated with the given + * target_id in the remote table. + */ + model::DocumentKeySet GetRemoteDocumentKeys(model::TargetId target_id); + + /** + * Assigns a target an internal ID so that its results can be pinned so they + * don't get GC'd. A target must be allocated in the local store before the + * store can be used to manage its view. + * + * Allocating an already allocated target will return the existing + * `TargetData` for that target. + */ + TargetData AllocateTarget(core::Target target); + + /** + * Unpin all the documents associated with a target. + * + * Releasing a non-existing target is an error. + */ + void ReleaseTarget(model::TargetId target_id); + + /** + * Runs the specified query against the local store and returns the results, + * potentially taking advantage of target data from previous executions (such + * as the set of remote keys). + * + * @param use_previous_results Whether results from previous executions can be + * used to optimize this query execution. + */ + QueryResult ExecuteQuery(const core::Query& query, bool use_previous_results); + + /** + * Notify the local store of the changed views to locally pin / unpin + * documents. + */ + void NotifyLocalViewChanges( + const std::vector& view_changes); + + /** + * Gets the mutation batch after the passed in batch_id in the mutation queue + * or `nullopt` if empty. + * + * @param batch_id The batch to search after, or `kBatchIdUnknown` for the + * first mutation in the queue. + * @return the next mutation or `nullopt` if there wasn't one. + */ + absl::optional GetNextMutationBatch( + model::BatchId batch_id); + + /** + * Returns the largest (latest) batch id in mutation queue that is pending + * server response. Returns `kBatchIdUnknown` if the queue is empty. + */ + model::BatchId GetHighestUnacknowledgedBatchId(); + + LruResults CollectGarbage(LruGarbageCollector* garbage_collector); + + private: + friend class LocalStoreTest; // for `GetTargetData()` + + void StartMutationQueue(); + void ApplyBatchResult(const model::MutationBatchResult& batch_result); + + /** + * Returns true if the new_target_data should be persisted during an update of + * an active target. TargetData should always be persisted when a target is + * being released and should not call this function. + * + * While the target is active, TargetData updates can be omitted when nothing + * about the target has changed except metadata like the resume token or + * snapshot version. Occasionally it's worth the extra write to prevent these + * values from getting too stale after a crash, but this doesn't have to be + * too frequent. + */ + bool ShouldPersistTargetData(const TargetData& new_target_data, + const TargetData& old_target_data, + const remote::TargetChange& change) const; + + /** + * Returns the TargetData as seen by the LocalStore, including updates that + * may have not yet been persisted to the TargetCache. + */ + absl::optional GetTargetData(const core::Target& query); + + /** Manages our in-memory or durable persistence. Owned by FirestoreClient. */ + Persistence* persistence_ = nullptr; + + /** Used to generate target IDs for queries tracked locally. */ + core::TargetIdGenerator target_id_generator_; + + /** + * The set of all mutations that have been sent but not yet been applied to + * the backend. + */ + MutationQueue* mutation_queue_ = nullptr; + + /** The set of all cached remote documents. */ + RemoteDocumentCache* remote_document_cache_ = nullptr; + + /** Maps a query to the data about that query. */ + TargetCache* target_cache_ = nullptr; + + /** + * Performs queries over the localDocuments (and potentially maintains + * indexes). + */ + QueryEngine* query_engine_ = nullptr; + + /** + * The "local" view of all documents (layering mutation queue on top of + * remote_document_cache_). + */ + std::unique_ptr local_documents_; + + /** The set of document references maintained by any local views. */ + ReferenceSet local_view_references_; + + /** Maps target ids to data about their queries. */ + std::unordered_map target_data_by_target_; + + /** Maps a target to its targetID. */ + std::unordered_map target_id_by_target_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_STORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_view_changes.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.cc similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_view_changes.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.cc index 1048b7c96..4b56760f6 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_view_changes.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/local_view_changes.h" +#include "Firestore/core/src/local/local_view_changes.h" -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" +#include "Firestore/core/src/core/view_snapshot.h" namespace firebase { namespace firestore { @@ -48,8 +48,8 @@ LocalViewChanges LocalViewChanges::FromViewSnapshot( } } - return LocalViewChanges(target_id, std::move(added_keys), - std::move(removed_keys)); + return LocalViewChanges(target_id, snapshot.from_cache(), + std::move(added_keys), std::move(removed_keys)); } } // namespace local diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_view_changes.h b/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.h similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_view_changes.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.h index 7dd38ba7e..73d1b89ce 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_view_changes.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_view_changes.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_VIEW_CHANGES_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_VIEW_CHANGES_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LOCAL_VIEW_CHANGES_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_VIEW_CHANGES_H_ #include -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/types.h" namespace firebase { namespace firestore { @@ -40,9 +40,11 @@ class LocalViewChanges { model::TargetId target_id); LocalViewChanges(model::TargetId target_id, + bool from_cache, model::DocumentKeySet added_keys, model::DocumentKeySet removed_keys) : target_id_(target_id), + from_cache_(from_cache), added_keys_(std::move(added_keys)), removed_keys_(std::move(removed_keys)) { } @@ -52,6 +54,10 @@ class LocalViewChanges { return target_id_; } + bool is_from_cache() const { + return from_cache_; + } + /** The document changes resulting from the local write. */ const model::DocumentKeySet& added_keys() const { return added_keys_; @@ -62,7 +68,8 @@ class LocalViewChanges { } private: - model::TargetId target_id_; + model::TargetId target_id_ = 0; + bool from_cache_ = false; model::DocumentKeySet added_keys_; model::DocumentKeySet removed_keys_; }; @@ -71,4 +78,4 @@ class LocalViewChanges { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_VIEW_CHANGES_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_VIEW_CHANGES_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_write_result.h b/Pods/FirebaseFirestore/Firestore/core/src/local/local_write_result.h similarity index 78% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_write_result.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/local_write_result.h index 4e303a279..7977c69c3 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/local_write_result.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/local_write_result.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_WRITE_RESULT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_WRITE_RESULT_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LOCAL_WRITE_RESULT_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LOCAL_WRITE_RESULT_H_ #include -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/model/types.h" namespace firebase { namespace firestore { @@ -54,4 +54,4 @@ class LocalWriteResult { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LOCAL_WRITE_RESULT_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LOCAL_WRITE_RESULT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/lru_garbage_collector.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.cc similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/lru_garbage_collector.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.cc index 2d27a7aa1..b21881a4d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/lru_garbage_collector.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" #include // NOLINT(build/c++11) #include @@ -22,19 +22,22 @@ #include #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/api/settings.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" +#include "Firestore/core/src/api/settings.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/statusor.h" namespace firebase { namespace firestore { namespace local { namespace { -using firebase::firestore::api::Settings; -using firebase::firestore::model::DocumentKey; -using firebase::firestore::model::ListenSequenceNumber; -using firebase::firestore::model::TargetId; +using api::Settings; +using model::DocumentKey; +using model::ListenSequenceNumber; +using model::TargetId; +using util::StatusOr; using Millis = std::chrono::milliseconds; @@ -107,13 +110,26 @@ LruGarbageCollector::LruGarbageCollector(LruDelegate* delegate, : delegate_(delegate), params_(std::move(params)) { } +StatusOr LruGarbageCollector::CalculateByteSize() const { + return delegate_->CalculateByteSize(); +} + LruResults LruGarbageCollector::Collect(const LiveQueryMap& live_targets) { if (params_.min_bytes_threshold == Settings::CacheSizeUnlimited) { LOG_DEBUG("Garbage collection skipped; disabled"); return LruResults::DidNotRun(); } - int64_t current_size = CalculateByteSize(); + StatusOr maybe_current_size = CalculateByteSize(); + if (!maybe_current_size.ok()) { + LOG_ERROR( + "Garbage collection skipped; failed to estimate the size of the " + "cache: %s", + maybe_current_size.status().ToString()); + return LruResults::DidNotRun(); + } + + int64_t current_size = maybe_current_size.ValueOrDie(); if (current_size < params_.min_bytes_threshold) { // Not enough on disk to warrant collection. Wait another timeout cycle. LOG_DEBUG( @@ -181,13 +197,12 @@ ListenSequenceNumber LruGarbageCollector::SequenceNumberForQueryCount( RollingSequenceNumberBuffer buffer(query_count); - delegate_->EnumerateTargets([&buffer](const QueryData& query_data) { - buffer.AddElement(query_data.sequence_number()); + delegate_->EnumerateTargets([&buffer](const TargetData& target_data) { + buffer.AddElement(target_data.sequence_number()); }); delegate_->EnumerateOrphanedDocuments( - [&buffer](const DocumentKey& doc_key, - ListenSequenceNumber sequence_number) { + [&buffer](const DocumentKey&, ListenSequenceNumber sequence_number) { buffer.AddElement(sequence_number); }); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h b/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.h index 1c3836661..08ef1cdab 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/lru_garbage_collector.h @@ -14,21 +14,23 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LRU_GARBAGE_COLLECTOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LRU_GARBAGE_COLLECTOR_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_LRU_GARBAGE_COLLECTOR_H_ +#define FIRESTORE_CORE_SRC_LOCAL_LRU_GARBAGE_COLLECTOR_H_ #include -#include "Firestore/core/src/firebase/firestore/local/query_cache.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/target_cache.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/util/status_fwd.h" namespace firebase { namespace firestore { namespace local { class LruGarbageCollector; +class TargetData; ABSL_CONST_INIT extern const model::ListenSequenceNumber kListenSequenceNumberInvalid; @@ -56,7 +58,7 @@ struct LruResults { int documents_removed; }; -using LiveQueryMap = std::unordered_map; +using LiveQueryMap = std::unordered_map; /** * Persistence layers intending to use LRU Garbage collection should implement @@ -70,14 +72,14 @@ class LruDelegate : public ReferenceDelegate { /** Access to the underlying LRU Garbage collector instance. */ virtual LruGarbageCollector* garbage_collector() = 0; - virtual int64_t CalculateByteSize() = 0; + virtual util::StatusOr CalculateByteSize() = 0; /** Returns the number of targets and orphaned documents cached. */ virtual size_t GetSequenceNumberCount() = 0; /** * Enumerates all the targets that the delegate is aware of. This is typically - * all of the targets in an QueryCache. + * all of the targets in an TargetCache. */ virtual void EnumerateTargets(const TargetCallback& callback) = 0; @@ -113,9 +115,7 @@ class LruGarbageCollector { public: LruGarbageCollector(LruDelegate* delegate, LruParams params); - int64_t CalculateByteSize() const { - return delegate_->CalculateByteSize(); - } + util::StatusOr CalculateByteSize() const; /** * Given a target percentile, return the number of queries that make up that @@ -159,4 +159,4 @@ class LruGarbageCollector { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_LRU_GARBAGE_COLLECTOR_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_LRU_GARBAGE_COLLECTOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.cc similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.cc index ebceed3b3..fdb6134aa 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.cc @@ -14,13 +14,14 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.h" +#include "Firestore/core/src/local/memory_eager_reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" -#include "Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/local/remote_document_cache.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/memory_mutation_queue.h" +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/src/local/reference_set.h" +#include "Firestore/core/src/local/remote_document_cache.h" +#include "Firestore/core/src/local/target_data.h" namespace firebase { namespace firestore { @@ -46,12 +47,12 @@ void MemoryEagerReferenceDelegate::AddInMemoryPins(ReferenceSet* set) { additional_references_ = set; } -void MemoryEagerReferenceDelegate::RemoveTarget(const QueryData& query_data) { +void MemoryEagerReferenceDelegate::RemoveTarget(const TargetData& target_data) { for (const DocumentKey& doc_key : - persistence_->query_cache()->GetMatchingKeys(query_data.target_id())) { + persistence_->target_cache()->GetMatchingKeys(target_data.target_id())) { orphaned_->insert(doc_key); } - persistence_->query_cache()->RemoveTarget(query_data); + persistence_->target_cache()->RemoveTarget(target_data); } void MemoryEagerReferenceDelegate::AddReference(const DocumentKey& key) { @@ -68,7 +69,7 @@ void MemoryEagerReferenceDelegate::RemoveMutationReference( } bool MemoryEagerReferenceDelegate::IsReferenced(const DocumentKey& key) const { - if (persistence_->query_cache()->Contains(key)) { + if (persistence_->target_cache()->Contains(key)) { return true; } if (MutationQueuesContainKey(key)) { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.h index 96824f96b..105ada30f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_eager_reference_delegate.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_eager_reference_delegate.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/model/document_key.h" #include "absl/types/optional.h" namespace firebase { @@ -44,7 +44,7 @@ class MemoryEagerReferenceDelegate : public ReferenceDelegate { void AddReference(const model::DocumentKey& key) override; void RemoveReference(const model::DocumentKey& key) override; void RemoveMutationReference(const model::DocumentKey& key) override; - void RemoveTarget(const QueryData& query_data) override; + void RemoveTarget(const TargetData& target_data) override; void UpdateLimboDocument(const model::DocumentKey& key) override; @@ -60,14 +60,14 @@ class MemoryEagerReferenceDelegate : public ReferenceDelegate { orphaned_; // This instance is owned by MemoryPersistence. - MemoryPersistence* persistence_; + MemoryPersistence* persistence_ = nullptr; // The ReferenceSet is owned by LocalStore. - ReferenceSet* additional_references_; + ReferenceSet* additional_references_ = nullptr; }; } // namespace local } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_EAGER_REFERENCE_DELEGATE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_index_manager.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.cc similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_index_manager.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.cc index 08274167c..d8ec92324 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_index_manager.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.cc @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/memory_index_manager.h" +#include "Firestore/core/src/local/memory_index_manager.h" #include #include #include #include -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { @@ -35,8 +35,8 @@ bool MemoryCollectionParentIndex::Add(const ResourcePath& collection_path) { std::string collection_id = collection_path.last_segment(); ResourcePath parent_path = collection_path.PopLast(); - std::set& existingParents = index_[collection_id]; - bool inserted = existingParents.insert(parent_path).second; + std::set& existing_parents = index_[collection_id]; + bool inserted = existing_parents.insert(parent_path).second; return inserted; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_index_manager.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_index_manager.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.h index 06a0eb83b..f3f7bef0b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_index_manager.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_index_manager.h @@ -14,16 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_INDEX_MANAGER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_INDEX_MANAGER_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_INDEX_MANAGER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_INDEX_MANAGER_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/local/index_manager.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" +#include "Firestore/core/src/local/index_manager.h" namespace firebase { namespace firestore { @@ -63,4 +62,4 @@ class MemoryIndexManager : public IndexManager { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_INDEX_MANAGER_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_INDEX_MANAGER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.cc similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.cc index 312d1dfd3..25377be49 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.cc @@ -14,18 +14,21 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.h" +#include "Firestore/core/src/local/memory_lru_reference_delegate.h" #include -#include "Firestore/core/src/firebase/firestore/local/listen_sequence.h" -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" -#include "Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/memory_persistence.h" -#include "Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/local/remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/local/sizer.h" +#include "Firestore/core/src/local/listen_sequence.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/memory_mutation_queue.h" +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/src/local/memory_remote_document_cache.h" +#include "Firestore/core/src/local/reference_set.h" +#include "Firestore/core/src/local/remote_document_cache.h" +#include "Firestore/core/src/local/sizer.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/memory/memory.h" namespace firebase { namespace firestore { @@ -33,6 +36,7 @@ namespace local { using model::DocumentKey; using model::ListenSequenceNumber; +using util::StatusOr; MemoryLruReferenceDelegate::MemoryLruReferenceDelegate( MemoryPersistence* persistence, @@ -43,7 +47,7 @@ MemoryLruReferenceDelegate::MemoryLruReferenceDelegate( gc_(this, lru_params) { // Theoretically this is always 0, since this is all in-memory... ListenSequenceNumber highest_sequence_number = - persistence_->query_cache()->highest_listen_sequence_number(); + persistence_->target_cache()->highest_listen_sequence_number(); listen_sequence_ = absl::make_unique(highest_sequence_number); } @@ -64,9 +68,9 @@ void MemoryLruReferenceDelegate::AddInMemoryPins(ReferenceSet* set) { additional_references_ = set; } -void MemoryLruReferenceDelegate::RemoveTarget(const QueryData& query_data) { - QueryData updated = query_data.WithSequenceNumber(current_sequence_number_); - persistence_->query_cache()->UpdateTarget(updated); +void MemoryLruReferenceDelegate::RemoveTarget(const TargetData& target_data) { + TargetData updated = target_data.WithSequenceNumber(current_sequence_number_); + persistence_->target_cache()->UpdateTarget(updated); } void MemoryLruReferenceDelegate::UpdateLimboDocument( @@ -74,7 +78,7 @@ void MemoryLruReferenceDelegate::UpdateLimboDocument( sequence_numbers_[key] = current_sequence_number_; } -void MemoryLruReferenceDelegate::OnTransactionStarted(absl::string_view label) { +void MemoryLruReferenceDelegate::OnTransactionStarted(absl::string_view) { current_sequence_number_ = listen_sequence_->Next(); } @@ -84,7 +88,7 @@ void MemoryLruReferenceDelegate::OnTransactionCommitted() { void MemoryLruReferenceDelegate::EnumerateTargets( const TargetCallback& callback) { - return persistence_->query_cache()->EnumerateTargets(callback); + return persistence_->target_cache()->EnumerateTargets(callback); } void MemoryLruReferenceDelegate::EnumerateOrphanedDocuments( @@ -101,18 +105,19 @@ void MemoryLruReferenceDelegate::EnumerateOrphanedDocuments( } size_t MemoryLruReferenceDelegate::GetSequenceNumberCount() { - size_t total_count = persistence_->query_cache()->size(); + size_t total_count = persistence_->target_cache()->size(); EnumerateOrphanedDocuments( - [&total_count](const DocumentKey& key, - ListenSequenceNumber sequence_number) { total_count++; }); + [&total_count](const DocumentKey&, ListenSequenceNumber) { + total_count++; + }); return total_count; } int MemoryLruReferenceDelegate::RemoveTargets( model::ListenSequenceNumber sequence_number, const LiveQueryMap& live_queries) { - return persistence_->query_cache()->RemoveTargets(sequence_number, - live_queries); + return persistence_->target_cache()->RemoveTargets(sequence_number, + live_queries); } int MemoryLruReferenceDelegate::RemoveOrphanedDocuments( @@ -158,7 +163,7 @@ bool MemoryLruReferenceDelegate::IsPinnedAtSequenceNumber( if (additional_references_ && additional_references_->ContainsKey(key)) { return true; } - if (persistence_->query_cache()->Contains(key)) { + if (persistence_->target_cache()->Contains(key)) { return true; } @@ -169,13 +174,13 @@ bool MemoryLruReferenceDelegate::IsPinnedAtSequenceNumber( return false; } -int64_t MemoryLruReferenceDelegate::CalculateByteSize() { +StatusOr MemoryLruReferenceDelegate::CalculateByteSize() { // Note that this method is only used for testing because this delegate is // only used for testing. The algorithm here (loop through everything, // serialize it and count bytes) is inefficient and inexact, but won't run in // production. int64_t count = 0; - count += persistence_->query_cache()->CalculateByteSize(*sizer_); + count += persistence_->target_cache()->CalculateByteSize(*sizer_); count += persistence_->remote_document_cache()->CalculateByteSize(*sizer_); const auto& queues = persistence_->mutation_queues(); for (const auto& entry : queues) { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.h index 4400b21d8..fe39835ff 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_lru_reference_delegate.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_lru_reference_delegate.h @@ -14,15 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/local/lru_garbage_collector.h" -#include "Firestore/core/src/firebase/firestore/local/reference_delegate.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/model/document_key.h" namespace firebase { namespace firestore { @@ -53,7 +54,7 @@ class MemoryLruReferenceDelegate : public LruDelegate { void AddReference(const model::DocumentKey& key) override; void RemoveReference(const model::DocumentKey& key) override; void RemoveMutationReference(const model::DocumentKey& key) override; - void RemoveTarget(const QueryData& query_data) override; + void RemoveTarget(const TargetData& target_data) override; void UpdateLimboDocument(const model::DocumentKey& key) override; @@ -64,7 +65,7 @@ class MemoryLruReferenceDelegate : public LruDelegate { LruGarbageCollector* garbage_collector() override; - int64_t CalculateByteSize() override; + util::StatusOr CalculateByteSize() override; size_t GetSequenceNumberCount() override; void EnumerateTargets(const TargetCallback& callback) override; @@ -96,7 +97,7 @@ class MemoryLruReferenceDelegate : public LruDelegate { ReferenceSet* additional_references_ = nullptr; // This needs to be a pointer because initialization is delayed until after - // we read from the query cache. + // we read from the target cache. std::unique_ptr listen_sequence_; // The current sequence number for the currently active transaction. If no @@ -109,4 +110,4 @@ class MemoryLruReferenceDelegate : public LruDelegate { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_LRU_REFERENCE_DELEGATE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.cc new file mode 100644 index 000000000..165a43569 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.cc @@ -0,0 +1,304 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/memory_mutation_queue.h" + +#include + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/document_key_reference.h" +#include "Firestore/core/src/local/index_manager.h" +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/sizer.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::Query; +using model::BatchId; +using model::DocumentKey; +using model::DocumentKeySet; +using model::kBatchIdUnknown; +using model::Mutation; +using model::MutationBatch; +using model::ResourcePath; +using nanopb::ByteString; + +MemoryMutationQueue::MemoryMutationQueue(MemoryPersistence* persistence) + : persistence_(persistence) { +} + +bool MemoryMutationQueue::IsEmpty() { + // If the queue has any entries at all, the first entry must not be a + // tombstone (otherwise it would have been removed already). + return queue_.empty(); +} + +void MemoryMutationQueue::AcknowledgeBatch(const MutationBatch& batch, + const ByteString& stream_token) { + HARD_ASSERT(!queue_.empty(), "Cannot acknowledge batch on an empty queue"); + + // Guaranteed to exist, due to above assert + const MutationBatch& check = queue_.front(); + // Verify that the batch in the queue is the one to be acknowledged. + HARD_ASSERT(batch.batch_id() == check.batch_id(), + "Queue ordering failure: expected batch %s, got batch %s", + batch.batch_id(), check.batch_id()); + last_stream_token_ = stream_token; +} + +void MemoryMutationQueue::Start() { + // Note: The queue may be shutdown / started multiple times, since we maintain + // the queue for the duration of the app session in case a user logs out / + // back in. To behave like the LevelDB-backed MutationQueue (and accommodate + // tests that expect as much), we reset next_batch_id_ if the queue is empty. + if (IsEmpty()) { + next_batch_id_ = 1; + } +} + +MutationBatch MemoryMutationQueue::AddMutationBatch( + const Timestamp& local_write_time, + std::vector&& base_mutations, + std::vector&& mutations) { + HARD_ASSERT(!mutations.empty(), "Mutation batches should not be empty"); + + BatchId batch_id = next_batch_id_; + next_batch_id_++; + + if (!queue_.empty()) { + const MutationBatch& prior = queue_.back(); + HARD_ASSERT(prior.batch_id() < batch_id, + "Mutation batch_ids must be in monotonically increasing order"); + } + + MutationBatch batch(batch_id, local_write_time, std::move(base_mutations), + std::move(mutations)); + queue_.push_back(batch); + + // Track references by document key and index collection parents. + for (const Mutation& mutation : batch.mutations()) { + batches_by_document_key_ = batches_by_document_key_.insert( + DocumentKeyReference{mutation.key(), batch_id}); + + persistence_->index_manager()->AddToCollectionParentIndex( + mutation.key().path().PopLast()); + } + + return batch; +} + +void MemoryMutationQueue::RemoveMutationBatch(const MutationBatch& batch) { + // Can only remove the first batch + HARD_ASSERT(!queue_.empty(), "Trying to remove batch from empty queue"); + const MutationBatch& head = queue_.front(); + HARD_ASSERT(head.batch_id() == batch.batch_id(), + "Can only remove the first entry of the mutation queue"); + + queue_.erase(queue_.begin()); + + // Remove entries from the index too. + for (const Mutation& mutation : batch.mutations()) { + const DocumentKey& key = mutation.key(); + persistence_->reference_delegate()->RemoveMutationReference(key); + + DocumentKeyReference reference{key, batch.batch_id()}; + batches_by_document_key_ = batches_by_document_key_.erase(reference); + } +} + +std::vector +MemoryMutationQueue::AllMutationBatchesAffectingDocumentKeys( + const DocumentKeySet& document_keys) { + // First find the set of affected batch IDs. + std::set batch_ids; + for (const DocumentKey& key : document_keys) { + DocumentKeyReference start{key, 0}; + + for (const auto& reference : batches_by_document_key_.values_from(start)) { + if (key != reference.key()) break; + + batch_ids.insert(reference.ref_id()); + } + } + + return AllMutationBatchesWithIds(batch_ids); +} + +std::vector +MemoryMutationQueue::AllMutationBatchesAffectingDocumentKey( + const DocumentKey& key) { + std::vector result; + + DocumentKeyReference start{key, 0}; + for (const auto& reference : batches_by_document_key_.values_from(start)) { + if (key != reference.key()) break; + + auto batch = LookupMutationBatch(reference.ref_id()); + HARD_ASSERT(batch.has_value(), + "Batches in the index must exist in the main table"); + result.push_back(*batch); + } + return result; +} + +std::vector +MemoryMutationQueue::AllMutationBatchesAffectingQuery(const Query& query) { + HARD_ASSERT( + !query.IsCollectionGroupQuery(), + "CollectionGroup queries should be handled in LocalDocumentsView"); + + // Use the query path as a prefix for testing if a document matches the query. + const ResourcePath& prefix = query.path(); + size_t immediate_children_path_length = prefix.size() + 1; + + // Construct a document reference for actually scanning the index. Unlike the + // prefix, the document key in this reference must have an even number of + // segments. The empty segment can be used as a suffix of the query path + // because it precedes all other segments in an ordered traversal. + ResourcePath start_path = query.path(); + if (!DocumentKey::IsDocumentKey(start_path)) { + start_path = start_path.Append(""); + } + DocumentKeyReference start{DocumentKey{start_path}, 0}; + + // Find unique batch_ids referenced by all documents potentially matching the + // query. + std::set unique_batch_ids; + for (const auto& reference : batches_by_document_key_.values_from(start)) { + const ResourcePath& row_key_path = reference.key().path(); + if (!prefix.IsPrefixOf(row_key_path)) { + break; + } + + // Rows with document keys more than one segment longer than the query path + // can't be matches. For example, a query on 'rooms' can't match the + // document /rooms/abc/messages/xyx. + // TODO(mcg): we'll need a different scanner when we implement ancestor + // queries. + if (row_key_path.size() != immediate_children_path_length) { + continue; + } + + unique_batch_ids.insert(reference.ref_id()); + } + + return AllMutationBatchesWithIds(unique_batch_ids); +} + +absl::optional +MemoryMutationQueue::NextMutationBatchAfterBatchId(BatchId batch_id) { + BatchId next_batch_id = batch_id + 1; + + // The requested batch_id may still be out of range so normalize it to the + // start of the queue. + int raw_index = IndexOfBatchId(next_batch_id); + size_t index = raw_index < 0 ? 0 : static_cast(raw_index); + if (queue_.size() <= index) { + return absl::nullopt; + } + + return queue_[index]; +} + +BatchId MemoryMutationQueue::GetHighestUnacknowledgedBatchId() { + return IsEmpty() ? kBatchIdUnknown : next_batch_id_ - 1; +} + +absl::optional MemoryMutationQueue::LookupMutationBatch( + BatchId batch_id) { + if (queue_.empty()) { + return absl::nullopt; + } + + int index = IndexOfBatchId(batch_id); + if (index < 0 || static_cast(index) >= queue_.size()) { + return absl::nullopt; + } + + const MutationBatch& batch = queue_[index]; + HARD_ASSERT(batch.batch_id() == batch_id, "If found, batch must match"); + return batch; +} + +void MemoryMutationQueue::PerformConsistencyCheck() { + if (queue_.empty()) { + HARD_ASSERT(batches_by_document_key_.empty(), + "Document leak -- detected dangling mutation references when " + "queue is empty."); + } +} + +bool MemoryMutationQueue::ContainsKey(const model::DocumentKey& key) { + // Create a reference with a zero ID as the start position to find any + // document reference with this key. + DocumentKeyReference reference{key, 0}; + auto range = batches_by_document_key_.values_from(reference); + auto begin = range.begin(); + return begin != range.end() && begin->key() == key; +} + +int64_t MemoryMutationQueue::CalculateByteSize(const Sizer& sizer) { + int64_t count = 0; + for (const auto& batch : queue_) { + count += sizer.CalculateByteSize(batch); + } + return count; +} + +ByteString MemoryMutationQueue::GetLastStreamToken() { + return last_stream_token_; +} + +void MemoryMutationQueue::SetLastStreamToken(ByteString token) { + last_stream_token_ = std::move(token); +} + +std::vector MemoryMutationQueue::AllMutationBatchesWithIds( + const std::set& batch_ids) { + std::vector result; + for (BatchId batch_id : batch_ids) { + auto batch = LookupMutationBatch(batch_id); + if (batch.has_value()) { + result.push_back(*batch); + } + } + + return result; +} + +int MemoryMutationQueue::IndexOfBatchId(BatchId batch_id) { + if (queue_.empty()) { + // As an index this is past the end of the queue + return 0; + } + + // Examine the front of the queue to figure out the difference between the + // batch_id and indexes in the array. Note that since the queue is ordered by + // batch_id, if the first batch has a larger batch_id then the requested + // batch_id doesn't exist in the queue. + const MutationBatch& first_batch = queue_.front(); + return batch_id - first_batch.batch_id(); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.h similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.h index 56d2353ee..1b3f84b11 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_mutation_queue.h @@ -14,19 +14,20 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_MUTATION_QUEUE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_MUTATION_QUEUE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_MUTATION_QUEUE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_MUTATION_QUEUE_H_ #include #include #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h" -#include "Firestore/core/src/firebase/firestore/local/document_key_reference.h" -#include "Firestore/core/src/firebase/firestore/local/mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/immutable/sorted_set.h" +#include "Firestore/core/src/local/document_key_reference.h" +#include "Firestore/core/src/local/mutation_queue.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" namespace firebase { namespace firestore { @@ -81,7 +82,7 @@ class MemoryMutationQueue : public MutationQueue { int64_t CalculateByteSize(const Sizer& sizer); nanopb::ByteString GetLastStreamToken() override; - void SetLastStreamToken(const nanopb::ByteString& token) override; + void SetLastStreamToken(nanopb::ByteString token) override; private: using DocumentKeyReferenceSet = @@ -145,4 +146,4 @@ class MemoryMutationQueue : public MutationQueue { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_MUTATION_QUEUE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_MUTATION_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.cc new file mode 100644 index 000000000..68db7bbac --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.cc @@ -0,0 +1,118 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/memory_persistence.h" + +#include "Firestore/core/src/auth/user.h" +#include "Firestore/core/src/local/listen_sequence.h" +#include "Firestore/core/src/local/lru_garbage_collector.h" +#include "Firestore/core/src/local/memory_eager_reference_delegate.h" +#include "Firestore/core/src/local/memory_index_manager.h" +#include "Firestore/core/src/local/memory_lru_reference_delegate.h" +#include "Firestore/core/src/local/memory_mutation_queue.h" +#include "Firestore/core/src/local/memory_remote_document_cache.h" +#include "Firestore/core/src/local/memory_target_cache.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/sizer.h" +#include "Firestore/core/src/local/target_data.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace local { + +using auth::User; +using model::ListenSequenceNumber; + +std::unique_ptr +MemoryPersistence::WithEagerGarbageCollector() { + std::unique_ptr persistence(new MemoryPersistence()); + auto delegate = + absl::make_unique(persistence.get()); + persistence->set_reference_delegate(std::move(delegate)); + return persistence; +} + +std::unique_ptr MemoryPersistence::WithLruGarbageCollector( + LruParams lru_params, std::unique_ptr sizer) { + std::unique_ptr persistence(new MemoryPersistence()); + auto delegate = absl::make_unique( + persistence.get(), lru_params, std::move(sizer)); + persistence->set_reference_delegate(std::move(delegate)); + return persistence; +} + +MemoryPersistence::MemoryPersistence() + : target_cache_(this), remote_document_cache_(this), started_(true) { +} + +MemoryPersistence::~MemoryPersistence() = default; + +ListenSequenceNumber MemoryPersistence::current_sequence_number() const { + return reference_delegate_->current_sequence_number(); +} + +void MemoryPersistence::set_reference_delegate( + std::unique_ptr delegate) { + reference_delegate_ = std::move(delegate); +} + +void MemoryPersistence::Shutdown() { + // No durable state to ensure is closed on shutdown. + HARD_ASSERT(started_, "MemoryPersistence shutdown without start!"); + started_ = false; +} + +MemoryMutationQueue* MemoryPersistence::GetMutationQueueForUser( + const User& user) { + auto iter = mutation_queues_.find(user); + if (iter == mutation_queues_.end()) { + auto queue = absl::make_unique(this); + MemoryMutationQueue* result = queue.get(); + + mutation_queues_.emplace(user, std::move(queue)); + return result; + } else { + return iter->second.get(); + } +} + +MemoryTargetCache* MemoryPersistence::target_cache() { + return &target_cache_; +} + +MemoryRemoteDocumentCache* MemoryPersistence::remote_document_cache() { + return &remote_document_cache_; +} + +MemoryIndexManager* MemoryPersistence::index_manager() { + return &index_manager_; +} + +ReferenceDelegate* MemoryPersistence::reference_delegate() { + return reference_delegate_.get(); +} + +void MemoryPersistence::RunInternal(absl::string_view label, + std::function block) { + TransactionGuard guard(reference_delegate_.get(), label); + + block(); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_persistence.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.h similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_persistence.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.h index 3a4dbc16f..20808385c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/memory_persistence.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_persistence.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_PERSISTENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_PERSISTENCE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_PERSISTENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_PERSISTENCE_H_ #include #include @@ -23,12 +23,12 @@ #include #include -#include "Firestore/core/src/firebase/firestore/auth/user.h" -#include "Firestore/core/src/firebase/firestore/local/memory_index_manager.h" -#include "Firestore/core/src/firebase/firestore/local/memory_mutation_queue.h" -#include "Firestore/core/src/firebase/firestore/local/memory_query_cache.h" -#include "Firestore/core/src/firebase/firestore/local/memory_remote_document_cache.h" -#include "Firestore/core/src/firebase/firestore/local/persistence.h" +#include "Firestore/core/src/auth/user.h" +#include "Firestore/core/src/local/memory_index_manager.h" +#include "Firestore/core/src/local/memory_mutation_queue.h" +#include "Firestore/core/src/local/memory_remote_document_cache.h" +#include "Firestore/core/src/local/memory_target_cache.h" +#include "Firestore/core/src/local/persistence.h" namespace firebase { namespace firestore { @@ -37,10 +37,10 @@ namespace local { struct LruParams; class MemoryIndexManager; class MemoryMutationQueue; -class MemoryQueryCache; class MemoryRemoteDocumentCache; +class MemoryTargetCache; class MutationQueue; -class QueryCache; +class TargetCache; class ReferenceDelegate; class RemoteDocumentCache; class Sizer; @@ -61,6 +61,8 @@ class MemoryPersistence : public Persistence { static std::unique_ptr WithLruGarbageCollector( LruParams params, std::unique_ptr sizer); + ~MemoryPersistence() override; + const MutationQueues& mutation_queues() const { return mutation_queues_; } @@ -73,7 +75,7 @@ class MemoryPersistence : public Persistence { MemoryMutationQueue* GetMutationQueueForUser(const auth::User& user) override; - MemoryQueryCache* query_cache() override; + MemoryTargetCache* target_cache() override; MemoryRemoteDocumentCache* remote_document_cache() override; @@ -88,14 +90,12 @@ class MemoryPersistence : public Persistence { private: MemoryPersistence(); - void set_reference_delegate(std::unique_ptr delegate) { - reference_delegate_ = std::move(delegate); - } + void set_reference_delegate(std::unique_ptr delegate); MutationQueues mutation_queues_; /** - * The QueryCache representing the persisted cache of queries. + * The TargetCache representing the persisted cache of queries. * * Note that this is retained here to make it easier to write tests affecting * both the in-memory and LevelDB-backed persistence layers. Tests can create @@ -103,7 +103,7 @@ class MemoryPersistence : public Persistence { * the in-memory persistence layer behave as if it were actually persisting * values. */ - MemoryQueryCache query_cache_; + MemoryTargetCache target_cache_; /** * The RemoteDocumentCache representing the persisted cache of remote @@ -122,4 +122,4 @@ class MemoryPersistence : public Persistence { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MEMORY_PERSISTENCE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_PERSISTENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.cc new file mode 100644 index 000000000..544dd8947 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.cc @@ -0,0 +1,137 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/memory_remote_document_cache.h" + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/memory_lru_reference_delegate.h" +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/src/local/sizer.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::Query; +using model::Document; +using model::DocumentKey; +using model::DocumentKeySet; +using model::DocumentMap; +using model::ListenSequenceNumber; +using model::MaybeDocument; +using model::MaybeDocumentMap; +using model::OptionalMaybeDocumentMap; +using model::SnapshotVersion; + +MemoryRemoteDocumentCache::MemoryRemoteDocumentCache( + MemoryPersistence* persistence) { + persistence_ = persistence; +} + +void MemoryRemoteDocumentCache::Add(const MaybeDocument& document, + const model::SnapshotVersion& read_time) { + docs_ = docs_.insert(document.key(), std::make_pair(document, read_time)); + + persistence_->index_manager()->AddToCollectionParentIndex( + document.key().path().PopLast()); +} + +void MemoryRemoteDocumentCache::Remove(const DocumentKey& key) { + docs_ = docs_.erase(key); +} + +absl::optional MemoryRemoteDocumentCache::Get( + const DocumentKey& key) { + const auto& entry = docs_.get(key); + return entry ? entry->first : absl::optional(); +} + +OptionalMaybeDocumentMap MemoryRemoteDocumentCache::GetAll( + const DocumentKeySet& keys) { + OptionalMaybeDocumentMap results; + for (const DocumentKey& key : keys) { + // Make sure each key has a corresponding entry, which is nullopt in case + // the document is not found. + // TODO(http://b/32275378): Don't conflate missing / deleted. + results = results.insert(key, Get(key)); + } + return results; +} + +DocumentMap MemoryRemoteDocumentCache::GetMatching( + const Query& query, const SnapshotVersion& since_read_time) { + HARD_ASSERT( + !query.IsCollectionGroupQuery(), + "CollectionGroup queries should be handled in LocalDocumentsView"); + + DocumentMap results; + + // Documents are ordered by key, so we can use a prefix scan to narrow down + // the documents we need to match the query against. + DocumentKey prefix{query.path().Append("")}; + for (auto it = docs_.lower_bound(prefix); it != docs_.end(); ++it) { + const DocumentKey& key = it->first; + if (!query.path().IsPrefixOf(key.path())) { + break; + } + const MaybeDocument& maybe_doc = it->second.first; + if (!maybe_doc.is_document()) { + continue; + } + + const SnapshotVersion& read_time = it->second.second; + if (read_time <= since_read_time) { + continue; + } + + Document doc(maybe_doc); + if (query.Matches(doc)) { + results = results.insert(key, std::move(doc)); + } + } + return results; +} + +std::vector MemoryRemoteDocumentCache::RemoveOrphanedDocuments( + MemoryLruReferenceDelegate* reference_delegate, + ListenSequenceNumber upper_bound) { + std::vector removed; + auto updated_docs = docs_; + for (const auto& kv : docs_) { + const DocumentKey& key = kv.first; + if (!reference_delegate->IsPinnedAtSequenceNumber(upper_bound, key)) { + updated_docs = updated_docs.erase(key); + removed.push_back(key); + } + } + docs_ = updated_docs; + return removed; +} + +int64_t MemoryRemoteDocumentCache::CalculateByteSize(const Sizer& sizer) { + int64_t count = 0; + for (const auto& kv : docs_) { + const MaybeDocument& maybe_doc = kv.second.first; + count += sizer.CalculateByteSize(maybe_doc); + } + return count; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.h new file mode 100644 index 000000000..a6d0e67f1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_remote_document_cache.h @@ -0,0 +1,74 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_REMOTE_DOCUMENT_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_REMOTE_DOCUMENT_CACHE_H_ + +#include +#include + +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/local/remote_document_cache.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" + +namespace firebase { +namespace firestore { +namespace local { + +class MemoryLruReferenceDelegate; +class MemoryPersistence; +class Sizer; + +class MemoryRemoteDocumentCache : public RemoteDocumentCache { + public: + explicit MemoryRemoteDocumentCache(MemoryPersistence* persistence); + + void Add(const model::MaybeDocument& document, + const model::SnapshotVersion& read_time) override; + void Remove(const model::DocumentKey& key) override; + + absl::optional Get( + const model::DocumentKey& key) override; + model::OptionalMaybeDocumentMap GetAll( + const model::DocumentKeySet& keys) override; + model::DocumentMap GetMatching( + const core::Query& query, + const model::SnapshotVersion& since_read_time) override; + + std::vector RemoveOrphanedDocuments( + MemoryLruReferenceDelegate* reference_delegate, + model::ListenSequenceNumber upper_bound); + + int64_t CalculateByteSize(const Sizer& sizer); + + private: + /** Underlying cache of documents and their read times. */ + immutable::SortedMap> + docs_; + + // This instance is owned by MemoryPersistence; avoid a retain cycle. + MemoryPersistence* persistence_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_REMOTE_DOCUMENT_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.cc new file mode 100644 index 000000000..472cd641f --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.cc @@ -0,0 +1,141 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/memory_target_cache.h" + +#include + +#include "Firestore/core/src/local/memory_persistence.h" +#include "Firestore/core/src/local/reference_delegate.h" +#include "Firestore/core/src/local/sizer.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/document_key.h" + +namespace firebase { +namespace firestore { +namespace local { + +using core::Target; +using model::DocumentKey; +using model::DocumentKeySet; +using model::ListenSequenceNumber; +using model::SnapshotVersion; +using model::TargetId; + +MemoryTargetCache::MemoryTargetCache(MemoryPersistence* persistence) + : persistence_(persistence), + highest_listen_sequence_number_(ListenSequenceNumber(0)), + highest_target_id_(TargetId(0)), + last_remote_snapshot_version_(SnapshotVersion::None()), + targets_() { +} + +void MemoryTargetCache::AddTarget(const TargetData& target_data) { + targets_[target_data.target()] = target_data; + if (target_data.target_id() > highest_target_id_) { + highest_target_id_ = target_data.target_id(); + } + if (target_data.sequence_number() > highest_listen_sequence_number_) { + highest_listen_sequence_number_ = target_data.sequence_number(); + } +} + +void MemoryTargetCache::UpdateTarget(const TargetData& target_data) { + // For the memory target cache, adds and updates are treated the same. + AddTarget(target_data); +} + +void MemoryTargetCache::RemoveTarget(const TargetData& target_data) { + targets_.erase(target_data.target()); + references_.RemoveReferences(target_data.target_id()); +} + +absl::optional MemoryTargetCache::GetTarget(const Target& target) { + auto iter = targets_.find(target); + return iter == targets_.end() ? absl::optional{} : iter->second; +} + +void MemoryTargetCache::EnumerateTargets(const TargetCallback& callback) { + for (const auto& kv : targets_) { + callback(kv.second); + } +} + +int MemoryTargetCache::RemoveTargets( + model::ListenSequenceNumber upper_bound, + const std::unordered_map& live_targets) { + std::vector to_remove; + for (const auto& kv : targets_) { + const Target& target = kv.first; + const TargetData& target_data = kv.second; + + if (target_data.sequence_number() <= upper_bound) { + if (live_targets.find(target_data.target_id()) == live_targets.end()) { + to_remove.push_back(&target); + references_.RemoveReferences(target_data.target_id()); + } + } + } + + for (const Target* element : to_remove) { + targets_.erase(*element); + } + return static_cast(to_remove.size()); +} + +void MemoryTargetCache::AddMatchingKeys(const DocumentKeySet& keys, + TargetId target_id) { + references_.AddReferences(keys, target_id); + for (const DocumentKey& key : keys) { + persistence_->reference_delegate()->AddReference(key); + } +} + +void MemoryTargetCache::RemoveMatchingKeys(const DocumentKeySet& keys, + TargetId target_id) { + references_.RemoveReferences(keys, target_id); + for (const DocumentKey& key : keys) { + persistence_->reference_delegate()->RemoveReference(key); + } +} + +DocumentKeySet MemoryTargetCache::GetMatchingKeys(TargetId target_id) { + return references_.ReferencedKeys(target_id); +} + +bool MemoryTargetCache::Contains(const DocumentKey& key) { + return references_.ContainsKey(key); +} + +int64_t MemoryTargetCache::CalculateByteSize(const Sizer& sizer) { + int64_t count = 0; + for (const auto& kv : targets_) { + count += sizer.CalculateByteSize(kv.second); + } + return count; +} + +const SnapshotVersion& MemoryTargetCache::GetLastRemoteSnapshotVersion() const { + return last_remote_snapshot_version_; +} + +void MemoryTargetCache::SetLastRemoteSnapshotVersion(SnapshotVersion version) { + last_remote_snapshot_version_ = std::move(version); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.h new file mode 100644 index 000000000..c698659ee --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/memory_target_cache.h @@ -0,0 +1,113 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_MEMORY_TARGET_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MEMORY_TARGET_CACHE_H_ + +#include +#include +#include + +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/local/reference_set.h" +#include "Firestore/core/src/local/target_cache.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/model/types.h" + +namespace firebase { +namespace firestore { +namespace local { + +class MemoryPersistence; +class Sizer; + +class MemoryTargetCache : public TargetCache { + public: + explicit MemoryTargetCache(MemoryPersistence* persistence); + + // Target-related methods + void AddTarget(const TargetData& target_data) override; + + void UpdateTarget(const TargetData& target_data) override; + + void RemoveTarget(const TargetData& target_data) override; + + absl::optional GetTarget(const core::Target& target) override; + + void EnumerateTargets(const TargetCallback& callback) override; + + int RemoveTargets(model::ListenSequenceNumber upper_bound, + const std::unordered_map& + live_targets) override; + + // Key-related methods + void AddMatchingKeys(const model::DocumentKeySet& keys, + model::TargetId target_id) override; + + void RemoveMatchingKeys(const model::DocumentKeySet& keys, + model::TargetId target_id) override; + + model::DocumentKeySet GetMatchingKeys(model::TargetId target_id) override; + + bool Contains(const model::DocumentKey& key) override; + + // Other methods and accessors + int64_t CalculateByteSize(const Sizer& sizer); + + size_t size() const override { + return targets_.size(); + } + + model::ListenSequenceNumber highest_listen_sequence_number() const override { + return highest_listen_sequence_number_; + } + + model::TargetId highest_target_id() const override { + return highest_target_id_; + } + + const model::SnapshotVersion& GetLastRemoteSnapshotVersion() const override; + + void SetLastRemoteSnapshotVersion(model::SnapshotVersion version) override; + + private: + // This instance is owned by MemoryPersistence. + MemoryPersistence* persistence_; + + /** The highest sequence number encountered */ + model::ListenSequenceNumber highest_listen_sequence_number_; + /** The highest numbered target ID encountered. */ + model::TargetId highest_target_id_; + /** The last received snapshot version. */ + model::SnapshotVersion last_remote_snapshot_version_; + + /** Maps a target to the data about that query. */ + std::unordered_map targets_; + + /** + * A ordered bidirectional mapping between documents and the remote target + * IDs. + */ + ReferenceSet references_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_MEMORY_TARGET_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/mutation_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/local/mutation_queue.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/mutation_queue.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/mutation_queue.h index 97e3a6e61..00bcd1bd9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/mutation_queue.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/mutation_queue.h @@ -14,29 +14,34 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MUTATION_QUEUE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MUTATION_QUEUE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_MUTATION_QUEUE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_MUTATION_QUEUE_H_ #include -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" #include "absl/types/optional.h" namespace firebase { +class Timestamp; + namespace firestore { + +namespace core { +class Query; +} // namespace core + +namespace nanopb { +class ByteString; +} // namespace nanopb + namespace local { /** A queue of mutations to apply to the remote store. */ class MutationQueue { public: - virtual ~MutationQueue() { - } + virtual ~MutationQueue() = default; /** * Starts the mutation queue, performing any initial reads that might be @@ -162,11 +167,11 @@ class MutationQueue { virtual nanopb::ByteString GetLastStreamToken() = 0; /** Sets the stream token for this mutation queue. */ - virtual void SetLastStreamToken(const nanopb::ByteString& stream_token) = 0; + virtual void SetLastStreamToken(nanopb::ByteString stream_token) = 0; }; } // namespace local } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_MUTATION_QUEUE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_MUTATION_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/persistence.h b/Pods/FirebaseFirestore/Firestore/core/src/local/persistence.h similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/persistence.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/persistence.h index b05dc7fcf..434e2c841 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/persistence.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/persistence.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_PERSISTENCE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_PERSISTENCE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_PERSISTENCE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_PERSISTENCE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/types.h" #include "absl/strings/string_view.h" namespace firebase { @@ -35,9 +35,9 @@ namespace local { class IndexManager; class MutationQueue; -class QueryCache; class ReferenceDelegate; class RemoteDocumentCache; +class TargetCache; /** * Persistence is the lowest-level shared interface to data storage in @@ -94,8 +94,8 @@ class Persistence { */ virtual MutationQueue* GetMutationQueueForUser(const auth::User& user) = 0; - /** Returns a QueryCache representing the persisted cache of queries. */ - virtual QueryCache* query_cache() = 0; + /** Returns a TargetCache representing the persisted cache of queries. */ + virtual TargetCache* target_cache() = 0; /** * Returns a RemoteDocumentCache representing the persisted cache of remote @@ -159,4 +159,4 @@ class Persistence { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_PERSISTENCE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_PERSISTENCE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.cc new file mode 100644 index 000000000..a3d004132 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.cc @@ -0,0 +1,58 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/proto_sizer.h" + +#include + +#include "Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace local { + +using model::DocumentKey; +using model::MaybeDocument; +using nanopb::ByteString; +using nanopb::Message; + +ProtoSizer::ProtoSizer(LocalSerializer serializer) + : serializer_(std::move(serializer)) { +} + +int64_t ProtoSizer::CalculateByteSize(const MaybeDocument& maybe_doc) const { + // TODO(varconst): implement a version of `nanopb::Writer` that only + // calculates sizes without actually doing the encoding (to the extent + // possible). This isn't high priority as long as `ProtoSizer` is only used in + // tests. + return MakeByteString(serializer_.EncodeMaybeDocument(maybe_doc)).size(); +} + +int64_t ProtoSizer::CalculateByteSize(const model::MutationBatch& batch) const { + return MakeByteString(serializer_.EncodeMutationBatch(batch)).size(); +} + +int64_t ProtoSizer::CalculateByteSize(const TargetData& target_data) const { + return MakeByteString(serializer_.EncodeTargetData(target_data)).size(); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.h b/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.h new file mode 100644 index 000000000..a5daed169 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/proto_sizer.h @@ -0,0 +1,51 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_PROTO_SIZER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_PROTO_SIZER_H_ + +#include "Firestore/core/src/local/local_serializer.h" +#include "Firestore/core/src/local/sizer.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** + * Estimates the stored size of documents and queries by translating to protos + * and using the serialized sizes to estimate. + */ +class ProtoSizer : public Sizer { + public: + explicit ProtoSizer(LocalSerializer serializer); + + int64_t CalculateByteSize( + const model::MaybeDocument& maybe_doc) const override; + + int64_t CalculateByteSize( + const model::MutationBatch& mutation_batch) const override; + + int64_t CalculateByteSize(const TargetData& target_data) const override; + + private: + LocalSerializer serializer_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_PROTO_SIZER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_engine.h b/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_engine.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.h index 4e18bd718..ac6205744 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/query_engine.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/query_engine.h @@ -14,25 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_ENGINE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_ENGINE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_QUERY_ENGINE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_QUERY_ENGINE_H_ -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" +#include "Firestore/core/src/model/model_fwd.h" namespace firebase { namespace firestore { -namespace model { - -class DocumentMap; -class SnapshotVersion; - -} // namespace model - namespace core { - class Query; - } // namespace core namespace local { @@ -45,6 +36,8 @@ class LocalDocumentsView; */ class QueryEngine { public: + enum Type { Simple, IndexFree }; + virtual ~QueryEngine() = default; /** @@ -59,11 +52,14 @@ class QueryEngine { virtual model::DocumentMap GetDocumentsMatchingQuery( const core::Query& query, const model::SnapshotVersion& last_limbo_free_snapshot_version, - const model::DocumentKeySet& remote_keys) const = 0; + const model::DocumentKeySet& remote_keys) = 0; + + /** Returns the underlying algorithm used by the query engine. */ + virtual Type type() const = 0; }; } // namespace local } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_QUERY_ENGINE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_QUERY_ENGINE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/query_result.h b/Pods/FirebaseFirestore/Firestore/core/src/local/query_result.h new file mode 100644 index 000000000..acfb50175 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/query_result.h @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_QUERY_RESULT_H_ +#define FIRESTORE_CORE_SRC_LOCAL_QUERY_RESULT_H_ + +#include +#include + +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/document_map.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** The result of executing a query against the local store. */ +class QueryResult { + public: + QueryResult() = default; + + /** Creates a new QueryResult with the given values. */ + QueryResult(model::DocumentMap documents, model::DocumentKeySet remote_keys) + : documents_{std::move(documents)}, remote_keys_{std::move(remote_keys)} { + } + + const model::DocumentMap& documents() const { + return documents_; + } + + const model::DocumentKeySet& remote_keys() const { + return remote_keys_; + } + + private: + model::DocumentMap documents_; + model::DocumentKeySet remote_keys_; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_QUERY_RESULT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_delegate.h b/Pods/FirebaseFirestore/Firestore/core/src/local/reference_delegate.h similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_delegate.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/reference_delegate.h index 0e4e27041..3716bf4ed 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_delegate.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/reference_delegate.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REFERENCE_DELEGATE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REFERENCE_DELEGATE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_REFERENCE_DELEGATE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_REFERENCE_DELEGATE_H_ -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/types.h" #include "absl/strings/string_view.h" namespace firebase { @@ -30,8 +30,8 @@ class DocumentKey; namespace local { -class QueryData; class ReferenceSet; +class TargetData; /** * A ReferenceDelegate instance handles all of the hooks into the @@ -76,7 +76,7 @@ class ReferenceDelegate { /** * Notifies the delegate that a target was removed. */ - virtual void RemoveTarget(const local::QueryData& query_data) = 0; + virtual void RemoveTarget(const local::TargetData& target_data) = 0; /** * Notifies the delegate that a limbo document was updated. @@ -121,4 +121,4 @@ struct TransactionGuard { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REFERENCE_DELEGATE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_REFERENCE_DELEGATE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_set.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.cc similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_set.cc rename to Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.cc index 57431d75c..166c1b649 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_set.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/local/reference_set.h" +#include "Firestore/core/src/local/reference_set.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h" -#include "Firestore/core/src/firebase/firestore/local/document_key_reference.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" +#include "Firestore/core/src/immutable/sorted_set.h" +#include "Firestore/core/src/local/document_key_reference.h" +#include "Firestore/core/src/model/document_key.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_set.h b/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_set.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.h index 0e14c998b..8c130dbdb 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/reference_set.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/reference_set.h @@ -14,13 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REFERENCE_SET_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REFERENCE_SET_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_REFERENCE_SET_H_ +#define FIRESTORE_CORE_SRC_LOCAL_REFERENCE_SET_H_ -#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h" -#include "Firestore/core/src/firebase/firestore/local/document_key_reference.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" +#include "Firestore/core/src/immutable/sorted_set.h" +#include "Firestore/core/src/local/document_key_reference.h" +#include "Firestore/core/src/model/model_fwd.h" namespace firebase { namespace firestore { @@ -92,4 +91,4 @@ class ReferenceSet { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REFERENCE_SET_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_REFERENCE_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/remote_document_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/local/remote_document_cache.h similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/remote_document_cache.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/remote_document_cache.h index 741e1e46c..62d324af2 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/remote_document_cache.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/remote_document_cache.h @@ -14,17 +14,18 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REMOTE_DOCUMENT_CACHE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REMOTE_DOCUMENT_CACHE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_REMOTE_DOCUMENT_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_REMOTE_DOCUMENT_CACHE_H_ -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/model_fwd.h" namespace firebase { namespace firestore { + +namespace core { +class Query; +} // namespace core + namespace local { /** @@ -37,8 +38,7 @@ namespace local { */ class RemoteDocumentCache { public: - virtual ~RemoteDocumentCache() { - } + virtual ~RemoteDocumentCache() = default; /** * Adds or replaces an entry in the cache. @@ -47,8 +47,10 @@ class RemoteDocumentCache { * entry for the key, it will be replaced. * * @param document A Document or DeletedDocument to put in the cache. + * @param read_time The time at which the document was read or committed. */ - virtual void Add(const model::MaybeDocument& document) = 0; + virtual void Add(const model::MaybeDocument& document, + const model::SnapshotVersion& read_time) = 0; /** Removes the cached entry for the given key (no-op if no entry exists). */ virtual void Remove(const model::DocumentKey& key) = 0; @@ -82,13 +84,17 @@ class RemoteDocumentCache { * Cached DeletedDocument entries have no bearing on query results. * * @param query The query to match documents against. + * @param since_read_time If not set to SnapshotVersion::None(), return only + * documents that have been read since this snapshot version (exclusive). * @return The set of matching documents. */ - virtual model::DocumentMap GetMatching(const core::Query& query) = 0; + virtual model::DocumentMap GetMatching( + const core::Query& query, + const model::SnapshotVersion& since_read_time) = 0; }; } // namespace local } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_REMOTE_DOCUMENT_CACHE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_REMOTE_DOCUMENT_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/simple_query_engine.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/simple_query_engine.cc new file mode 100644 index 000000000..3c45c3425 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/simple_query_engine.cc @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/simple_query_engine.h" + +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/local_documents_view.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/model/snapshot_version.h" + +namespace firebase { +namespace firestore { +namespace local { + +using model::SnapshotVersion; + +model::DocumentMap SimpleQueryEngine::GetDocumentsMatchingQuery( + const core::Query& query, + const SnapshotVersion&, + const model::DocumentKeySet&) { + HARD_ASSERT(local_documents_view_, "SetLocalDocumentsView() not called"); + + return local_documents_view_->GetDocumentsMatchingQuery( + query, SnapshotVersion::None()); +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/simple_query_engine.h b/Pods/FirebaseFirestore/Firestore/core/src/local/simple_query_engine.h similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/simple_query_engine.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/simple_query_engine.h index a780929e9..e4fa33729 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/simple_query_engine.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/simple_query_engine.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_SIMPLE_QUERY_ENGINE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_SIMPLE_QUERY_ENGINE_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_SIMPLE_QUERY_ENGINE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_SIMPLE_QUERY_ENGINE_H_ -#include "Firestore/core/src/firebase/firestore/local/query_engine.h" +#include "Firestore/core/src/local/query_engine.h" namespace firebase { namespace firestore { @@ -32,7 +32,11 @@ class SimpleQueryEngine : public QueryEngine { model::DocumentMap GetDocumentsMatchingQuery( const core::Query& query, const model::SnapshotVersion& last_limbo_free_snapshot_version, - const model::DocumentKeySet& remote_keys) const override; + const model::DocumentKeySet& remote_keys) override; + + Type type() const override { + return Type::Simple; + } private: LocalDocumentsView* local_documents_view_; @@ -42,4 +46,4 @@ class SimpleQueryEngine : public QueryEngine { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_SIMPLE_QUERY_ENGINE_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_SIMPLE_QUERY_ENGINE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/sizer.h b/Pods/FirebaseFirestore/Firestore/core/src/local/sizer.h similarity index 80% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/sizer.h rename to Pods/FirebaseFirestore/Firestore/core/src/local/sizer.h index 3a990245a..51a9a36a4 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/local/sizer.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/sizer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_SIZER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_SIZER_H_ +#ifndef FIRESTORE_CORE_SRC_LOCAL_SIZER_H_ +#define FIRESTORE_CORE_SRC_LOCAL_SIZER_H_ #include @@ -30,7 +30,7 @@ class MutationBatch; namespace local { -class QueryData; +class TargetData; /** * Estimates the stored size of documents and queries. @@ -53,13 +53,13 @@ class Sizer { const model::MutationBatch& batch) const = 0; /** - * Calculates the size of the given query_data in bytes. + * Calculates the size of the given target_data in bytes. */ - virtual int64_t CalculateByteSize(const QueryData& query_data) const = 0; + virtual int64_t CalculateByteSize(const TargetData& target_data) const = 0; }; } // namespace local } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_LOCAL_SIZER_H_ +#endif // FIRESTORE_CORE_SRC_LOCAL_SIZER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/target_cache.h b/Pods/FirebaseFirestore/Firestore/core/src/local/target_cache.h new file mode 100644 index 000000000..51276cd20 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/target_cache.h @@ -0,0 +1,152 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_TARGET_CACHE_H_ +#define FIRESTORE_CORE_SRC_LOCAL_TARGET_CACHE_H_ + +#include +#include + +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/types.h" + +namespace firebase { +namespace firestore { + +namespace core { +class Query; +class Target; +} // namespace core + +namespace local { +class TargetData; + +using OrphanedDocumentCallback = + std::function; + +using TargetCallback = std::function; + +/** + * Represents cached targets received from the remote backend. This contains + * both a mapping between targets and the documents that matched them according + * to the server, but also metadata about the targets. + * + * The cache is keyed by Target and entries in the cache are TargetData + * instances. + */ +class TargetCache { + public: + virtual ~TargetCache() = default; + + // Target-related methods + + /** + * Adds an entry in the cache. + * + * The cache key is extracted from `TargetData.target()`. The key must not + * already exist in the cache. + * + * @param target_data A new TargetData instance to put in the cache. + */ + virtual void AddTarget(const TargetData& target_data) = 0; + + /** + * Updates an entry in the cache. + * + * The cache key is extracted from `TargetData.target()`. The entry must + * already exist in the cache, and it will be replaced. + * + * @param target_data A TargetData instance to replace an existing entry in + * the cache + */ + virtual void UpdateTarget(const TargetData& target_data) = 0; + + /** Removes the cached entry for the given target data. The entry must already + * exist in the cache. */ + virtual void RemoveTarget(const TargetData& target_data) = 0; + + /** + * Looks up a TargetData entry in the cache. + * + * @param target The target corresponding to the entry to look up. + * @return The cached TargetData entry, or nullopt if the cache has no entry + * for the target. + */ + virtual absl::optional GetTarget(const core::Target& target) = 0; + + virtual void EnumerateTargets(const TargetCallback& callback) = 0; + + virtual int RemoveTargets( + model::ListenSequenceNumber upper_bound, + const std::unordered_map& live_targets) = 0; + + // Key-related methods + virtual void AddMatchingKeys(const model::DocumentKeySet& keys, + model::TargetId target_id) = 0; + + virtual void RemoveMatchingKeys(const model::DocumentKeySet& keys, + model::TargetId target_id) = 0; + + virtual model::DocumentKeySet GetMatchingKeys(model::TargetId target_id) = 0; + + virtual bool Contains(const model::DocumentKey& key) = 0; + + // Accessors + + /** Returns the number of targets cached. */ + virtual size_t size() const = 0; + + /** + * Returns the highest listen sequence number of any target seen by the cache. + */ + virtual model::ListenSequenceNumber highest_listen_sequence_number() + const = 0; + + /** + * Returns the highest target ID of any target in the cache. Typically called + * during startup to seed a target ID generator and avoid collisions with + * existing queries. If there are no targets in the cache, returns zero. + */ + virtual model::TargetId highest_target_id() const = 0; + + /** + * A global snapshot version representing the last consistent snapshot we + * received from the backend. This is monotonically increasing and any + * snapshots received from the backend prior to this version (e.g. for targets + * resumed with a resume_token) should be suppressed (buffered) until the + * backend has caught up to this snapshot version again. This prevents our + * cache from ever going backwards in time. + * + * This is updated whenever our we get a TargetChange with a read_time and + * empty target_ids. + */ + virtual const model::SnapshotVersion& GetLastRemoteSnapshotVersion() + const = 0; + + /** + * Set the snapshot version representing the last consistent snapshot received + * from the backend. (see `GetLastRemoteSnapshotVersion()` for more details). + * + * @param version The new snapshot version. + */ + virtual void SetLastRemoteSnapshotVersion(model::SnapshotVersion version) = 0; +}; + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_TARGET_CACHE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.cc b/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.cc new file mode 100644 index 000000000..6604b86c1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.cc @@ -0,0 +1,147 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/local/target_data.h" + +#include +#include +#include + +namespace firebase { +namespace firestore { +namespace local { + +using core::Target; +using model::ListenSequenceNumber; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; + +// MARK: - QueryPurpose + +namespace { + +const char* ToString(QueryPurpose purpose) { + switch (purpose) { + case QueryPurpose::Listen: + return "Listen"; + case QueryPurpose::ExistenceFilterMismatch: + return "ExistenceFilterMismatch"; + case QueryPurpose::LimboResolution: + return "LimboResolution"; + } + + UNREACHABLE(); +} + +} // namespace + +std::ostream& operator<<(std::ostream& os, QueryPurpose purpose) { + return os << ToString(purpose); +} + +// MARK: - TargetData + +TargetData::TargetData(Target target, + TargetId target_id, + ListenSequenceNumber sequence_number, + QueryPurpose purpose, + SnapshotVersion snapshot_version, + SnapshotVersion last_limbo_free_snapshot_version, + ByteString resume_token) + : target_(std::move(target)), + target_id_(target_id), + sequence_number_(sequence_number), + purpose_(purpose), + snapshot_version_(std::move(snapshot_version)), + last_limbo_free_snapshot_version_( + std::move(last_limbo_free_snapshot_version)), + resume_token_(std::move(resume_token)) { +} + +TargetData::TargetData(Target target, + int target_id, + ListenSequenceNumber sequence_number, + QueryPurpose purpose) + : TargetData(std::move(target), + target_id, + sequence_number, + purpose, + SnapshotVersion::None(), + SnapshotVersion::None(), + ByteString()) { +} + +TargetData TargetData::Invalid() { + return TargetData({}, /*target_id=*/-1, /*sequence_number=*/-1, + QueryPurpose::Listen, + SnapshotVersion(SnapshotVersion::None()), + SnapshotVersion(SnapshotVersion::None()), {}); +} + +TargetData TargetData::WithSequenceNumber( + ListenSequenceNumber sequence_number) const { + return TargetData(target_, target_id_, sequence_number, purpose_, + snapshot_version_, last_limbo_free_snapshot_version_, + resume_token_); +} + +TargetData TargetData::WithResumeToken(ByteString resume_token, + SnapshotVersion snapshot_version) const { + return TargetData(target_, target_id_, sequence_number_, purpose_, + std::move(snapshot_version), + last_limbo_free_snapshot_version_, std::move(resume_token)); +} + +TargetData TargetData::WithLastLimboFreeSnapshotVersion( + SnapshotVersion last_limbo_free_snapshot_version) const { + return TargetData(target_, target_id_, sequence_number_, purpose_, + snapshot_version_, + std::move(last_limbo_free_snapshot_version), resume_token_); +} + +bool operator==(const TargetData& lhs, const TargetData& rhs) { + return lhs.target() == rhs.target() && lhs.target_id() == rhs.target_id() && + lhs.sequence_number() == rhs.sequence_number() && + lhs.purpose() == rhs.purpose() && + lhs.snapshot_version() == rhs.snapshot_version() && + lhs.resume_token() == rhs.resume_token(); +} + +size_t TargetData::Hash() const { + return util::Hash(target_, target_id_, sequence_number_, purpose_, + snapshot_version_, resume_token_); +} + +std::string TargetData::ToString() const { + std::ostringstream ss; + ss << *this; + return ss.str(); +} + +std::ostream& operator<<(std::ostream& os, const TargetData& value) { + return os << "TargetData(target=" << value.target_ + << ", target_id=" << value.target_id_ + << ", purpose=" << value.purpose_ + << ", version=" << value.snapshot_version_ + << ", last_limbo_free_snapshot_version=" + << value.last_limbo_free_snapshot_version_ + << ", resume_token=" << value.resume_token_ << ")"; +} + +} // namespace local +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.h b/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.h new file mode 100644 index 000000000..5206145b0 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/local/target_data.h @@ -0,0 +1,189 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_LOCAL_TARGET_DATA_H_ +#define FIRESTORE_CORE_SRC_LOCAL_TARGET_DATA_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/core/target.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" + +namespace firebase { +namespace firestore { +namespace local { + +/** An enumeration for the different purposes we have for queries. */ +enum class QueryPurpose { + /** A regular, normal query. */ + Listen, + + /** + * The query was used to refill a query after an existence filter mismatch. + */ + ExistenceFilterMismatch, + + /** The query was used to resolve a limbo document. */ + LimboResolution, +}; + +std::ostream& operator<<(std::ostream& os, QueryPurpose purpose); + +/** + * An immutable set of metadata that the store will need to keep track of for + * each target. + */ +class TargetData { + public: + /** + * Creates a new TargetData with the given values. + * + * @param target The target being listened to. + * @param target_id The target to which the query corresponds, assigned by the + * LocalStore for user queries or the SyncEngine for limbo queries. + * @param purpose The purpose of the query. + * @param snapshot_version The latest snapshot version seen for this target. + * @param last_limbo_free_snapshot_version The maximum snapshot version at + * which the associated target view contained no limbo documents. + * @param resume_token An opaque, server-assigned token that allows watching a + * target to be resumed after disconnecting without retransmitting all the + * data that matches the query. The resume token essentially identifies a + * point in time from which the server should resume sending results. + */ + TargetData(core::Target target, + model::TargetId target_id, + model::ListenSequenceNumber sequence_number, + QueryPurpose purpose, + model::SnapshotVersion snapshot_version, + model::SnapshotVersion last_limbo_free_snapshot_version, + nanopb::ByteString resume_token); + + /** + * Convenience constructor for use when creating a TargetData for the first + * time. + */ + TargetData(const core::Target target, + int target_id, + model::ListenSequenceNumber sequence_number, + QueryPurpose purpose); + + /** + * Creates an invalid TargetData. Prefer TargetData::Invalid() for + * readability. + */ + TargetData() = default; + + /** + * Constructs an invalid TargetData. Reading any properties of the returned + * value is undefined. + */ + static TargetData Invalid(); + + /** The target being listened to. */ + const core::Target& target() const { + return target_; + } + + /** + * The TargetId to which the target corresponds, assigned by the LocalStore + * for user queries or the SyncEngine for limbo queries. + */ + model::TargetId target_id() const { + return target_id_; + } + + model::ListenSequenceNumber sequence_number() const { + return sequence_number_; + } + + /** The purpose of the target. */ + QueryPurpose purpose() const { + return purpose_; + } + + /** The latest snapshot version seen for this target. */ + const model::SnapshotVersion& snapshot_version() const { + return snapshot_version_; + } + + /** + * Returns the last snapshot version for which the associated view contained + * no limbo documents. + */ + const model::SnapshotVersion& last_limbo_free_snapshot_version() const { + return last_limbo_free_snapshot_version_; + } + + /** + * An opaque, server-assigned token that allows watching a query to be resumed + * after disconnecting without retransmitting all the data that matches the + * query. The resume token essentially identifies a point in time from which + * the server should resume sending results. + */ + const nanopb::ByteString& resume_token() const { + return resume_token_; + } + + /** Creates a new target data instance with an updated sequence number. */ + TargetData WithSequenceNumber( + model::ListenSequenceNumber sequence_number) const; + + /** + * Creates a new target data instance with an updated resume token and + * snapshot version. + */ + TargetData WithResumeToken(nanopb::ByteString resume_token, + model::SnapshotVersion snapshot_version) const; + + /** + * Creates a new target data instance with an updated last limbo free snapshot + * version. + */ + TargetData WithLastLimboFreeSnapshotVersion( + model::SnapshotVersion last_limbo_free_snapshot_version) const; + + friend bool operator==(const TargetData& lhs, const TargetData& rhs); + + size_t Hash() const; + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, const TargetData& value); + + private: + core::Target target_; + model::TargetId target_id_ = 0; + model::ListenSequenceNumber sequence_number_ = 0; + QueryPurpose purpose_ = QueryPurpose::Listen; + model::SnapshotVersion snapshot_version_; + model::SnapshotVersion last_limbo_free_snapshot_version_; + nanopb::ByteString resume_token_; +}; + +inline bool operator!=(const TargetData& lhs, const TargetData& rhs) { + return !(lhs == rhs); +} + +} // namespace local +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_LOCAL_TARGET_DATA_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/base_path.h b/Pods/FirebaseFirestore/Firestore/core/src/model/base_path.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/base_path.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/base_path.h index d28e40090..3d604f6bf 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/base_path.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/base_path.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_BASE_PATH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_BASE_PATH_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_BASE_PATH_H_ +#define FIRESTORE_CORE_SRC_MODEL_BASE_PATH_H_ #include #include @@ -24,9 +24,9 @@ #include #include -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { @@ -151,7 +151,11 @@ class BasePath { } util::ComparisonResult CompareTo(const T& rhs) const { - return util::Compare(segments_, rhs.segments_); + return util::CompareContainer(segments_, rhs.segments_); + } + + friend bool operator==(const BasePath& lhs, const BasePath& rhs) { + return lhs.segments_ == rhs.segments_; } size_t Hash() const { @@ -177,4 +181,4 @@ class BasePath { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_BASE_PATH_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_BASE_PATH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/database_id.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.cc similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/database_id.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/database_id.cc index efec02eb4..afee7c148 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/database_id.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/database_id.h" +#include "Firestore/core/src/model/database_id.h" #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/database_id.h b/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.h similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/database_id.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/database_id.h index 6787f912d..5cb2fc72b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/database_id.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/database_id.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DATABASE_ID_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DATABASE_ID_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_DATABASE_ID_H_ +#define FIRESTORE_CORE_SRC_MODEL_DATABASE_ID_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/util/comparison.h" namespace firebase { namespace firestore { @@ -86,4 +86,4 @@ class DatabaseId : public util::Comparable { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DATABASE_ID_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_DATABASE_ID_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/delete_mutation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/delete_mutation.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.cc index 2a167bb6f..871c9960c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/delete_mutation.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.cc @@ -14,16 +14,16 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/delete_mutation.h" +#include "Firestore/core/src/model/delete_mutation.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.h new file mode 100644 index 000000000..533e4ec28 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/delete_mutation.h @@ -0,0 +1,74 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_DELETE_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_DELETE_MUTATION_H_ + +#include +#include +#include +#include + +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/mutation.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** Represents a Delete operation. */ +class DeleteMutation : public Mutation { + public: + DeleteMutation(DocumentKey key, Precondition precondition); + + /** + * Casts a Mutation to a DeleteMutation. This is a checked operation that will + * assert if the type of the Mutation isn't actually Type::Delete. + */ + explicit DeleteMutation(const Mutation& mutation); + + /** Creates an invalid DeleteMutation instance. */ + DeleteMutation() = default; + + private: + class Rep : public Mutation::Rep { + public: + using Mutation::Rep::Rep; + + Type type() const override { + return Type::Delete; + } + + MaybeDocument ApplyToRemoteDocument( + const absl::optional& maybe_doc, + const MutationResult& mutation_result) const override; + + absl::optional ApplyToLocalView( + const absl::optional& maybe_doc, + const absl::optional&, + const Timestamp&) const override; + + // Does not override Equals or Hash; Mutation's versions are sufficient. + + std::string ToString() const override; + }; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_DELETE_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/document.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/document.cc index cafc4f0ef..040fb8854 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document.cc @@ -14,13 +14,19 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/document.h" +#include "Firestore/core/src/model/document.h" #include #include #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document.h b/Pods/FirebaseFirestore/Firestore/core/src/model/document.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/document.h index ae2830e8f..a6fa5d2be 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document.h @@ -14,23 +14,44 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_DOCUMENT_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" +#include "Firestore/core/src/model/maybe_document.h" #include "absl/types/any.h" #include "absl/types/optional.h" namespace firebase { namespace firestore { + +typedef struct _google_firestore_v1_Document google_firestore_v1_Document; +typedef struct _google_firestore_v1_Value google_firestore_v1_Value; + +namespace local { +class LocalSerializer; +} // namespace local + +namespace nanopb { +class Reader; + +template +class Message; +} // namespace nanopb + +namespace remote { +class Serializer; +} // namespace remote + namespace model { +class FieldPath; +class FieldValue; +class ObjectValue; + /** Describes the `has_pending_writes` state of a document. */ enum class DocumentState { /** @@ -62,12 +83,18 @@ class Document : public MaybeDocument { SnapshotVersion version, DocumentState document_state); + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class remote::Serializer; + Document(ObjectValue data, DocumentKey key, SnapshotVersion version, DocumentState document_state, absl::any proto); + public: /** * Casts a MaybeDocument to a Document. This is a checked operation that will * assert if the type of the MaybeDocument isn't actually Type::Document. @@ -108,4 +135,4 @@ inline bool operator!=(const Document& lhs, const Document& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.cc new file mode 100644 index 000000000..01266f814 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.cc @@ -0,0 +1,113 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/model/document_key.h" + +#include +#include + +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" + +namespace firebase { +namespace firestore { +namespace model { + +namespace { + +void AssertValidPath(const ResourcePath& path) { + HARD_ASSERT(DocumentKey::IsDocumentKey(path), "invalid document key path: %s", + path.CanonicalString()); +} + +} // namespace + +DocumentKey::DocumentKey() : path_{std::make_shared()} { +} + +DocumentKey::DocumentKey(const ResourcePath& path) + : path_{std::make_shared(path)} { + AssertValidPath(*path_); +} + +DocumentKey::DocumentKey(ResourcePath&& path) + : path_{std::make_shared(std::move(path))} { + AssertValidPath(*path_); +} + +DocumentKey DocumentKey::FromPathString(const std::string& path) { + return DocumentKey{ResourcePath::FromStringView(path)}; +} + +DocumentKey DocumentKey::FromSegments(std::initializer_list list) { + return DocumentKey{ResourcePath{list}}; +} + +const DocumentKey& DocumentKey::Empty() { + static const DocumentKey empty; + return empty; +} + +bool DocumentKey::IsDocumentKey(const ResourcePath& path) { + return path.size() % 2 == 0; +} + +util::ComparisonResult DocumentKey::CompareTo(const DocumentKey& other) const { + return path().CompareTo(other.path()); +} + +bool operator==(const DocumentKey& lhs, const DocumentKey& rhs) { + return lhs.path() == rhs.path(); +} + +bool operator<(const DocumentKey& lhs, const DocumentKey& rhs) { + return util::Ascending(lhs.CompareTo(rhs)); +} +bool operator>(const DocumentKey& lhs, const DocumentKey& rhs) { + return util::Descending(lhs.CompareTo(rhs)); +} + +size_t DocumentKey::Hash() const { + return util::Hash(ToString()); +} + +std::string DocumentKey::ToString() const { + return path().CanonicalString(); +} + +std::ostream& operator<<(std::ostream& os, const DocumentKey& key) { + return os << key.ToString(); +} + +const ResourcePath& DocumentKey::path() const { + return path_ ? *path_ : Empty().path(); +} + +/** Returns true if the document is in the specified collection_id. */ +bool DocumentKey::HasCollectionId(const std::string& collection_id) const { + size_t size = path().size(); + return size >= 2 && path()[size - 2] == collection_id; +} + +size_t DocumentKeyHash::operator()(const DocumentKey& key) const { + return util::Hash(key.path()); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.h b/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.h new file mode 100644 index 000000000..9becf3841 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_key.h @@ -0,0 +1,111 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_DOCUMENT_KEY_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_KEY_H_ + +#include +#include +#include +#include +#include + +namespace firebase { +namespace firestore { + +namespace util { +enum class ComparisonResult; +} // namespace util + +namespace model { + +class ResourcePath; + +/** + * DocumentKey represents the location of a document in the Firestore database. + */ +class DocumentKey { + public: + /** Creates a "blank" document key not associated with any document. */ + DocumentKey(); + + /** Creates a new document key containing a copy of the given path. */ + explicit DocumentKey(const ResourcePath& path); + + /** Creates a new document key, taking ownership of the given path. */ + explicit DocumentKey(ResourcePath&& path); + + /** + * Creates and returns a new document key using '/' to split the string into + * segments. + */ + static DocumentKey FromPathString(const std::string& path); + + /** Creates and returns a new document key with the given segments. */ + static DocumentKey FromSegments(std::initializer_list list); + + /** Returns a shared instance of an empty document key. */ + static const DocumentKey& Empty(); + + /** Returns true iff the given path is a path to a document. */ + static bool IsDocumentKey(const ResourcePath& path); + + util::ComparisonResult CompareTo(const DocumentKey& other) const; + + friend bool operator==(const DocumentKey& lhs, const DocumentKey& rhs); + + size_t Hash() const; + + std::string ToString() const; + + friend std::ostream& operator<<(std::ostream& os, const DocumentKey& key); + + /** The path to the document. */ + const ResourcePath& path() const; + + /** Returns true if the document is in the specified collection_id. */ + bool HasCollectionId(const std::string& collection_id) const; + + private: + // This is an optimization to make passing DocumentKey around cheaper (it's + // copied often). + std::shared_ptr path_; +}; + +inline bool operator!=(const DocumentKey& lhs, const DocumentKey& rhs) { + return !(lhs == rhs); +} + +bool operator<(const DocumentKey& lhs, const DocumentKey& rhs); +bool operator>(const DocumentKey& lhs, const DocumentKey& rhs); + +inline bool operator<=(const DocumentKey& lhs, const DocumentKey& rhs) { + return !(rhs < lhs); +} + +inline bool operator>=(const DocumentKey& lhs, const DocumentKey& rhs) { + return !(lhs < rhs); +} + +struct DocumentKeyHash { + size_t operator()(const DocumentKey& key) const; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_KEY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/document_key_set.h b/Pods/FirebaseFirestore/Firestore/core/src/model/document_key_set.h new file mode 100644 index 000000000..ab07bb928 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_key_set.h @@ -0,0 +1,34 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_DOCUMENT_KEY_SET_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_KEY_SET_H_ + +#include "Firestore/core/src/immutable/sorted_set.h" +#include "Firestore/core/src/model/document_key.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** Convenience type for a set of keys, since they are so common. */ +using DocumentKeySet = immutable::SortedSet; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_KEY_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_map.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/document_map.cc similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_map.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/document_map.cc index 0cc233467..b82aa2cc2 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_map.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_map.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/document_map.h" +#include "Firestore/core/src/model/document_map.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_map.h b/Pods/FirebaseFirestore/Firestore/core/src/model/document_map.h similarity index 83% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_map.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/document_map.h index 3c4edfdcb..51885ad0f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_map.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_map.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_MAP_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_MAP_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_DOCUMENT_MAP_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_MAP_H_ #include -#include "Firestore/core/src/firebase/firestore/immutable/sorted_map.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/maybe_document.h" #include "absl/base/attributes.h" #include "absl/types/optional.h" @@ -57,6 +57,9 @@ using OptionalMaybeDocumentMap = */ class DocumentMap { public: + using key_type = DocumentKey; + using mapped_type = Document; + DocumentMap() = default; ABSL_MUST_USE_RESULT DocumentMap insert(const DocumentKey& key, @@ -87,4 +90,4 @@ class DocumentMap { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_MAP_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_MAP_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_set.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.cc similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_set.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/document_set.cc index e77b60b31..b0514e669 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_set.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.cc @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/document_set.h" +#include "Firestore/core/src/model/document_set.h" #include #include -#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/immutable/sorted_set.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/to_string.h" #include "absl/algorithm/container.h" namespace firebase { @@ -98,7 +98,7 @@ DocumentSet DocumentSet::insert( } // Remove any prior mapping of the document's key before adding, preventing - // sortedSet from accumulating values that aren't in the index. + // the sorted_set_ from accumulating values that aren't in the index. const DocumentKey& key = document->key(); DocumentSet removed = erase(key); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_set.h b/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.h similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_set.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/document_set.h index fd9b22484..5d66f249d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/document_set.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/document_set.h @@ -14,20 +14,19 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_SET_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_SET_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_DOCUMENT_SET_H_ +#define FIRESTORE_CORE_SRC_MODEL_DOCUMENT_SET_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/immutable/sorted_container.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_set.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/immutable/sorted_container.h" +#include "Firestore/core/src/immutable/sorted_set.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/document_map.h" +#include "Firestore/core/src/util/comparison.h" namespace firebase { namespace firestore { @@ -161,4 +160,4 @@ inline bool operator!=(const DocumentSet& lhs, const DocumentSet& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_DOCUMENT_SET_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_DOCUMENT_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_mask.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.cc similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_mask.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.cc index 4c062b084..20d63d914 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_mask.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.cc @@ -14,18 +14,18 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" +#include "Firestore/core/src/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { namespace model { -bool FieldMask::covers(const FieldPath& fieldPath) const { - for (const FieldPath& fieldMaskPath : fields_) { - if (fieldMaskPath.IsPrefixOf(fieldPath)) { +bool FieldMask::covers(const FieldPath& field_path) const { + for (const FieldPath& field_mask_path : fields_) { + if (field_mask_path.IsPrefixOf(field_path)) { return true; } } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_mask.h b/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_mask.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.h index ae8bf6077..f46db2bb9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_mask.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_mask.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_MASK_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_MASK_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_FIELD_MASK_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_MASK_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/model/field_path.h" +#include "Firestore/core/src/model/field_path.h" namespace firebase { namespace firestore { @@ -48,13 +48,12 @@ class FieldMask { FieldMask(std::initializer_list list) : fields_{list} { } + template FieldMask(InputIt first, InputIt last) : fields_{first, last} { } - explicit FieldMask(std::set fields) : fields_{std::move(fields)} { - } - FieldMask(const FieldMask& f) : fields_{f.begin(), f.end()} { + explicit FieldMask(std::set fields) : fields_{std::move(fields)} { } const_iterator begin() const { @@ -69,12 +68,12 @@ class FieldMask { } /** - * Verifies that `fieldPath` is included by at least one field in this field + * Verifies that `field_path` is included by at least one field in this field * mask. * * This is an O(n) operation, where `n` is the size of the field mask. */ - bool covers(const FieldPath& fieldPath) const; + bool covers(const FieldPath& field_path) const; std::string ToString() const; @@ -94,4 +93,4 @@ inline bool operator==(const FieldMask& lhs, const FieldMask& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_MASK_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_MASK_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_path.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.cc similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_path.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_path.cc index f3a6c6519..3e22a363d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_path.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/field_path.h" +#include "Firestore/core/src/model/field_path.h" #include #include -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/strings/str_join.h" #include "absl/strings/str_replace.h" #include "absl/strings/str_split.h" @@ -29,7 +29,7 @@ namespace firebase { namespace firestore { namespace model { -using api::ThrowInvalidArgument; +using util::ThrowInvalidArgument; namespace { @@ -83,7 +83,11 @@ struct JoinEscaped { constexpr const char* FieldPath::kDocumentKeyPath; -FieldPath FieldPath::FromDotSeparatedString(absl::string_view path) { +FieldPath FieldPath::FromDotSeparatedString(const std::string& path) { + return FromDotSeparatedStringView(path); +} + +FieldPath FieldPath::FromDotSeparatedStringView(absl::string_view path) { if (path.find_first_of("~*/[]") != absl::string_view::npos) { ThrowInvalidArgument( "Invalid field path (%s). Paths must not contain '~', '*', '/', '[', " @@ -105,7 +109,11 @@ FieldPath FieldPath::FromDotSeparatedString(absl::string_view path) { return FieldPath(std::move(segments)); } -FieldPath FieldPath::FromServerFormat(absl::string_view path) { +FieldPath FieldPath::FromServerFormat(const std::string& path) { + return FromServerFormatView(path); +} + +FieldPath FieldPath::FromServerFormatView(absl::string_view path) { SegmentsT segments; std::string segment; segment.reserve(path.size()); @@ -183,6 +191,20 @@ std::string FieldPath::CanonicalString() const { return absl::StrJoin(begin(), end(), ".", JoinEscaped()); } +void FieldPath::ValidateSegments(const SegmentsT& segments) { + if (segments.empty()) { + ThrowInvalidArgument( + "Invalid field path. Provided names must not be empty."); + } + + for (size_t i = 0; i < segments.size(); i++) { + if (segments[i].empty()) { + ThrowInvalidArgument( + "Invalid field name at index %s. Field names must not be empty.", i); + } + } +} + } // namespace model } // namespace firestore } // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_path.h b/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.h similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_path.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_path.h index 3f1981043..5a63a5e8a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_path.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_path.h @@ -14,19 +14,23 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_PATH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_PATH_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_FIELD_PATH_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_PATH_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/api/input_validation.h" -#include "Firestore/core/src/firebase/firestore/model/base_path.h" +#include "Firestore/core/src/model/base_path.h" #include "absl/strings/string_view.h" namespace firebase { namespace firestore { + +namespace remote { +class Serializer; +} // namespace remote + namespace model { /** @@ -60,8 +64,16 @@ class FieldPath : public impl::BasePath, * PORTING NOTE: We define this on the model class to avoid having a tiny * api::FieldPath wrapper class. */ - static FieldPath FromDotSeparatedString(absl::string_view path); + static FieldPath FromDotSeparatedString(const std::string& path); + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class remote::Serializer; + static FieldPath FromDotSeparatedStringView(absl::string_view path); + + public: /** * Creates and returns a new path from a set of segments received from the * public API. @@ -77,36 +89,31 @@ class FieldPath : public impl::BasePath, * where path segments are separated by a dot "." and optionally encoded using * backticks. */ - static FieldPath FromServerFormat(absl::string_view path); + static FieldPath FromServerFormat(const std::string& path); + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + static FieldPath FromServerFormatView(absl::string_view path); + + public: /** Returns a field path that represents an empty path. */ static const FieldPath& EmptyPath(); /** Returns a field path that represents a document key. */ static const FieldPath& KeyFieldPath(); - /** Returns a standardized string representation of this path. */ - std::string CanonicalString() const; /** True if this FieldPath represents a document key. */ bool IsKeyFieldPath() const; + /** Returns a standardized string representation of this path. */ + std::string CanonicalString() const; + private: - static void ValidateSegments(const SegmentsT& segments) { - if (segments.empty()) { - api::ThrowInvalidArgument( - "Invalid field path. Provided names must not be empty."); - } - - for (size_t i = 0; i < segments.size(); i++) { - if (segments[i].empty()) { - api::ThrowInvalidArgument( - "Invalid field name at index %s. Field names must not be empty.", - i); - } - } - } + static void ValidateSegments(const SegmentsT& segments); }; } // namespace model } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_PATH_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_PATH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_transform.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_transform.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.cc index b05566bff..a71a29da0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_transform.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" +#include "Firestore/core/src/model/field_transform.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/model/transform_operation.h" +#include "Firestore/core/src/util/hashing.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_transform.h b/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_transform.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.h index 8f19e111c..a58f16a5f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_transform.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_transform.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_TRANSFORM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_TRANSFORM_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_FIELD_TRANSFORM_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_TRANSFORM_H_ #include -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/transform_operation.h" namespace firebase { namespace firestore { @@ -54,4 +54,4 @@ class FieldTransform { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_TRANSFORM_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_TRANSFORM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/field_value.cc similarity index 96% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_value.cc index 53ca872c0..1d8371750 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_value.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/field_value.h" +#include "Firestore/core/src/model/field_value.h" #include #include @@ -25,13 +25,14 @@ #include #include -#include "Firestore/core/src/firebase/firestore/immutable/sorted_map.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/timestamp_internal.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/timestamp_internal.h" +#include "Firestore/core/src/util/comparison.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/to_string.h" #include "absl/algorithm/container.h" #include "absl/base/casts.h" #include "absl/memory/memory.h" @@ -274,7 +275,7 @@ class TimestampValue : public BaseValue { class ServerTimestampValue : public FieldValue::BaseValue { public: explicit ServerTimestampValue(ServerTimestamp server_timestamp) - : server_timestamp_(server_timestamp) { + : server_timestamp_(std::move(server_timestamp)) { } Type type() const override { @@ -735,6 +736,10 @@ FieldValue FieldValue::FromTimestamp(const Timestamp& value) { return FieldValue(std::make_shared(value)); } +FieldValue FieldValue::FromServerTimestamp(const Timestamp& local_write_time) { + return FromServerTimestamp(local_write_time, absl::nullopt); +} + FieldValue FieldValue::FromServerTimestamp( const Timestamp& local_write_time, absl::optional previous_value) { @@ -812,6 +817,10 @@ ComparisonResult FieldValue::BaseValue::CompareTypes( ObjectValue::ObjectValue() : fv_(FieldValue::EmptyObject()) { } +ObjectValue::ObjectValue(FieldValue fv) : fv_(std::move(fv)) { + HARD_ASSERT(fv_.type() == FieldValue::Type::Object); +} + ObjectValue ObjectValue::FromMap(const FieldValue::Map& value) { return ObjectValue(FieldValue::FromMap(value)); } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value.h b/Pods/FirebaseFirestore/Firestore/core/src/model/field_value.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_value.h index 641241bdf..7764af179 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_value.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_FIELD_VALUE_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_VALUE_H_ #include #include @@ -27,21 +27,23 @@ #include "Firestore/core/include/firebase/firestore/geo_point.h" #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/immutable/sorted_map.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/immutable/sorted_map.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_key.h" #include "absl/base/attributes.h" #include "absl/types/optional.h" namespace firebase { namespace firestore { + +namespace nanopb { +class ByteString; +} // namespace nanopb + namespace model { +class FieldMask; +class FieldPath; class ObjectValue; /** @@ -82,7 +84,7 @@ class FieldValue { FieldValue(); - FieldValue(ObjectValue object); // NOLINT(runtime/explicit) + FieldValue(const ObjectValue& object); // NOLINT(runtime/explicit) /** Returns the true type for this value. */ Type type() const { @@ -192,9 +194,20 @@ class FieldValue { static FieldValue FromInteger(int64_t value); static FieldValue FromDouble(double value); static FieldValue FromTimestamp(const Timestamp& value); + + static FieldValue FromServerTimestamp(const Timestamp& local_write_time); + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class FieldValueTest; + friend class ServerTimestampTransform; + static FieldValue FromServerTimestamp( const Timestamp& local_write_time, - absl::optional previous_value = absl::nullopt); + absl::optional previous_value); + + public: static FieldValue FromString(const char* value); static FieldValue FromString(const std::string& value); static FieldValue FromString(std::string&& value); @@ -274,9 +287,7 @@ class ObjectValue : public util::Comparable { // ObjectValue::Empty() to make intentions clear to readers. ObjectValue(); - explicit ObjectValue(FieldValue fv) : fv_(std::move(fv)) { - HARD_ASSERT(fv_.type() == FieldValue::Type::Object); - } + explicit ObjectValue(FieldValue fv); static ObjectValue Empty() { return ObjectValue(FieldValue::EmptyObject()); @@ -372,13 +383,18 @@ class FieldValue::Reference { }; class FieldValue::ServerTimestamp { - public: + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class FieldValue; + ServerTimestamp(Timestamp local_write_time, absl::optional previous_value) : local_write_time_(local_write_time), previous_value_(std::move(previous_value)) { } + public: const Timestamp& local_write_time() const { return local_write_time_; } @@ -393,7 +409,7 @@ class FieldValue::ServerTimestamp { }; // Pretend you can automatically upcast from ObjectValue to FieldValue. -inline FieldValue::FieldValue(ObjectValue object) +inline FieldValue::FieldValue(const ObjectValue& object) : FieldValue(object.AsFieldValue()) { } @@ -422,4 +438,4 @@ ABSL_CONST_INIT extern const uint64_t kCanonicalNanBits; } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_VALUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value_options.h b/Pods/FirebaseFirestore/Firestore/core/src/model/field_value_options.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value_options.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/field_value_options.h index b3cd57c1d..ed67c9e68 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/field_value_options.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/field_value_options.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_OPTIONS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_OPTIONS_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_FIELD_VALUE_OPTIONS_H_ +#define FIRESTORE_CORE_SRC_MODEL_FIELD_VALUE_OPTIONS_H_ namespace firebase { namespace firestore { @@ -54,4 +54,4 @@ class FieldValueOptions { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_FIELD_VALUE_OPTIONS_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_FIELD_VALUE_OPTIONS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/maybe_document.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/maybe_document.cc similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/maybe_document.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/maybe_document.cc index c5cd3b1f0..8fe4344a9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/maybe_document.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/maybe_document.cc @@ -14,11 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" +#include "Firestore/core/src/model/maybe_document.h" #include #include +#include "Firestore/core/src/util/hashing.h" + namespace firebase { namespace firestore { namespace model { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/maybe_document.h b/Pods/FirebaseFirestore/Firestore/core/src/model/maybe_document.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/maybe_document.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/maybe_document.h index 0fd3c99ad..4f4cc386a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/maybe_document.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/maybe_document.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MAYBE_DOCUMENT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MAYBE_DOCUMENT_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_MAYBE_DOCUMENT_H_ +#define FIRESTORE_CORE_SRC_MODEL_MAYBE_DOCUMENT_H_ #include #include @@ -23,8 +23,8 @@ #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/snapshot_version.h" namespace firebase { namespace firestore { @@ -184,4 +184,4 @@ struct DocumentKeyComparator { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MAYBE_DOCUMENT_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_MAYBE_DOCUMENT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/model_fwd.h b/Pods/FirebaseFirestore/Firestore/core/src/model/model_fwd.h new file mode 100644 index 000000000..7f8275482 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/model_fwd.h @@ -0,0 +1,106 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_MODEL_FWD_H_ +#define FIRESTORE_CORE_SRC_MODEL_MODEL_FWD_H_ + +#include +#include + +#include "absl/types/optional.h" + +namespace firebase { + +class Timestamp; + +namespace firestore { + +class GeoPoint; + +namespace util { + +template +struct Comparator; + +} // namespace util + +namespace immutable { + +template +class SortedMap; + +template +class SortedSet; + +} // namespace immutable + +namespace model { + +class DatabaseId; +class DeleteMutation; +class Document; +class DocumentComparator; +class DocumentKey; +class DocumentMap; +class DocumentSet; +class FieldMask; +class FieldPath; +class FieldTransform; +class FieldValue; +class MaybeDocument; +class Mutation; +class MutationBatch; +class MutationBatchResult; +class MutationResult; +class NoDocument; +class ObjectValue; +class PatchMutation; +class Precondition; +class SetMutation; +class SnapshotVersion; +class TransformMutation; +class TransformOperation; +class UnknownDocument; +class VerifyMutation; + +enum class DocumentState; +enum class OnlineState; + +struct DocumentKeyHash; + +using BatchId = int32_t; +using ListenSequenceNumber = int64_t; +using TargetId = int32_t; + +using DocumentKeySet = + immutable::SortedSet>; + +using MaybeDocumentMap = immutable:: + SortedMap>; + +using OptionalMaybeDocumentMap = + immutable::SortedMap, + util::Comparator>; + +using DocumentVersionMap = + std::unordered_map; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_MODEL_FWD_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.cc similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/mutation.cc index 526caa526..967d0eaa1 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.cc @@ -14,19 +14,19 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/mutation.h" +#include "Firestore/core/src/model/mutation.h" #include #include #include #include -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/to_string.h" #include "absl/strings/str_cat.h" namespace firebase { @@ -48,6 +48,19 @@ bool operator==(const MutationResult& lhs, const MutationResult& rhs) { lhs.transform_results() == rhs.transform_results(); } +MaybeDocument Mutation::ApplyToRemoteDocument( + const absl::optional& maybe_doc, + const MutationResult& mutation_result) const { + return rep().ApplyToRemoteDocument(maybe_doc, mutation_result); +} + +absl::optional Mutation::ApplyToLocalView( + const absl::optional& maybe_doc, + const absl::optional& base_doc, + const Timestamp& local_write_time) const { + return rep().ApplyToLocalView(maybe_doc, base_doc, local_write_time); +} + Mutation::Rep::Rep(DocumentKey&& key, Precondition&& precondition) : key_(std::move(key)), precondition_(std::move(precondition)) { } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/mutation.h index f6c067916..e19a1918e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTATION_H_ #include #include @@ -23,19 +23,18 @@ #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/model/snapshot_version.h" #include "absl/types/optional.h" namespace firebase { namespace firestore { namespace model { +class MaybeDocument; + /** * The result of applying a mutation to the server. This is a model of the * WriteResult proto message. @@ -151,7 +150,7 @@ class Mutation { /** * Represents the mutation type. This is used in place of dynamic_cast. */ - enum class Type { Set, Patch, Transform, Delete }; + enum class Type { Set, Patch, Transform, Delete, Verify }; /** Creates an invalid mutation. */ Mutation() = default; @@ -196,9 +195,7 @@ class Mutation { */ MaybeDocument ApplyToRemoteDocument( const absl::optional& maybe_doc, - const MutationResult& mutation_result) const { - return rep().ApplyToRemoteDocument(maybe_doc, mutation_result); - } + const MutationResult& mutation_result) const; /** * Estimates the latency compensated view of this mutation applied to the @@ -238,9 +235,7 @@ class Mutation { absl::optional ApplyToLocalView( const absl::optional& maybe_doc, const absl::optional& base_doc, - const Timestamp& local_write_time) const { - return rep().ApplyToLocalView(maybe_doc, base_doc, local_write_time); - } + const Timestamp& local_write_time) const; /** * If this mutation is not idempotent, returns the base value to persist with @@ -342,4 +337,4 @@ inline bool operator!=(const Mutation& lhs, const Mutation& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.cc similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.cc index 1ceede2eb..2875b539d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.cc @@ -14,14 +14,16 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" +#include "Firestore/core/src/model/mutation_batch.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/mutation_batch_result.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/mutation_batch_result.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/to_string.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch.h b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.h index 3d3d85158..e6ff40eec 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_BATCH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_BATCH_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_H_ #include #include @@ -23,17 +23,14 @@ #include #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/types.h" namespace firebase { namespace firestore { namespace model { -class MutationBatchResult; - /** * A BatchID that was searched for and not found or a batch ID value known to * be before all known batches. @@ -43,8 +40,6 @@ class MutationBatchResult; */ constexpr BatchId kBatchIdUnknown = -1; -// TODO(rsgowman): Port MutationBatchResult - /** * A batch of mutations that will be sent as one unit to the backend. Batches * can be marked as a tombstone if the mutation queue does not remove them @@ -52,15 +47,6 @@ constexpr BatchId kBatchIdUnknown = -1; */ class MutationBatch { public: - /** - * A batch ID that was searched for and not found or a batch ID value known - * to be before all known batches. - * - * Batch ID values from the local store are non-negative so this value is - * before all batches. - */ - constexpr static int kUnknown = -1; - MutationBatch(int batch_id, Timestamp local_write_time, std::vector base_mutations, @@ -161,4 +147,4 @@ inline bool operator!=(const MutationBatch& lhs, const MutationBatch& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_BATCH_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch_result.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch_result.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.cc index d79b041ee..ef34dacff 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch_result.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.cc @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/mutation_batch_result.h" +#include "Firestore/core/src/model/mutation_batch_result.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/to_string.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch_result.h b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.h similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch_result.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.h index 447dfab50..2598e4f5e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/mutation_batch_result.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/mutation_batch_result.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_BATCH_RESULT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_BATCH_RESULT_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_RESULT_H_ +#define FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_RESULT_H_ #include #include @@ -24,12 +24,10 @@ #include #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/document_map.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" namespace firebase { namespace firestore { @@ -93,4 +91,4 @@ class MutationBatchResult { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_MUTATION_BATCH_RESULT_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_MUTATION_BATCH_RESULT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/no_document.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/no_document.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/no_document.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/no_document.cc index 397477452..b331ec5fb 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/no_document.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/no_document.cc @@ -14,12 +14,14 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/no_document.h" +#include "Firestore/core/src/model/no_document.h" +#include #include #include -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/no_document.h b/Pods/FirebaseFirestore/Firestore/core/src/model/no_document.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/no_document.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/no_document.h index 15b431959..49d767f5b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/no_document.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/no_document.h @@ -14,12 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_NO_DOCUMENT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_NO_DOCUMENT_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_NO_DOCUMENT_H_ +#define FIRESTORE_CORE_SRC_MODEL_NO_DOCUMENT_H_ -#include - -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" +#include "Firestore/core/src/model/maybe_document.h" namespace firebase { namespace firestore { @@ -54,4 +52,4 @@ class NoDocument : public MaybeDocument { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_NO_DOCUMENT_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_NO_DOCUMENT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/patch_mutation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.cc similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/patch_mutation.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.cc index 1b758e870..426f1917d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/patch_mutation.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.cc @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/patch_mutation.h" +#include "Firestore/core/src/model/patch_mutation.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/model/unknown_document.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/patch_mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/patch_mutation.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.h index 64101fc02..d1cbf01c7 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/patch_mutation.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/patch_mutation.h @@ -14,22 +14,18 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_PATCH_MUTATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_PATCH_MUTATION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_PATCH_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_PATCH_MUTATION_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "absl/types/optional.h" +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/mutation.h" namespace firebase { namespace firestore { @@ -133,4 +129,4 @@ class PatchMutation : public Mutation { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_PATCH_MUTATION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_PATCH_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/precondition.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.cc similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/precondition.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/precondition.cc index ab5b1a6d7..4822cb0cb 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/precondition.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.cc @@ -14,11 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/precondition.h" +#include "Firestore/core/src/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/precondition.h b/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/precondition.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/precondition.h index b3a35139d..5f42ca67f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/precondition.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/precondition.h @@ -14,25 +14,21 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_PRECONDITION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_PRECONDITION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_PRECONDITION_H_ +#define FIRESTORE_CORE_SRC_MODEL_PRECONDITION_H_ #include #include -#if defined(__OBJC__) -#include "Firestore/core/include/firebase/firestore/timestamp.h" -#endif // defined(__OBJC__) - -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/snapshot_version.h" #include "absl/types/optional.h" namespace firebase { namespace firestore { namespace model { +class MaybeDocument; + /** * Encodes a precondition for a mutation. This follows the model that the * backend accepts with the special case of an explicit "empty" precondition @@ -99,7 +95,8 @@ class Precondition { // The actual time of this precondition. Type type_ = Type::None; - // For UpdateTime type, preconditions a mutation based on the last updateTime. + // For UpdateTime type, preconditions a mutation based on the last + // update_time_. SnapshotVersion update_time_; // For Exists type, preconditions a mutation based on whether the document @@ -111,4 +108,4 @@ class Precondition { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_PRECONDITION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_PRECONDITION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/resource_path.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.cc similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/resource_path.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.cc index d60b1fb7e..cdad08006 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/resource_path.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" +#include "Firestore/core/src/model/resource_path.h" #include #include #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/strings/str_join.h" #include "absl/strings/str_split.h" @@ -28,7 +28,11 @@ namespace firebase { namespace firestore { namespace model { -ResourcePath ResourcePath::FromString(absl::string_view path) { +ResourcePath ResourcePath::FromString(const std::string& path) { + return FromStringView(path); +} + +ResourcePath ResourcePath::FromStringView(absl::string_view path) { // NOTE: The client is ignorant of any path segments containing escape // sequences (e.g. __id123__) and just passes them through raw (they exist // for legacy reasons and should not be used frequently). diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.h b/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.h new file mode 100644 index 000000000..ff098e874 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/resource_path.h @@ -0,0 +1,79 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_RESOURCE_PATH_H_ +#define FIRESTORE_CORE_SRC_MODEL_RESOURCE_PATH_H_ + +#include +#include +#include + +#include "Firestore/core/src/model/base_path.h" +#include "Firestore/core/src/util/comparison.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace remote { +class Serializer; +} // namespace remote + +namespace model { + +/** + * A slash-separated path for navigating resources (documents and collections) + * within Firestore. Immutable; all instances are fully independent. + */ +class ResourcePath : public impl::BasePath, + public util::InequalityComparable { + public: + ResourcePath() = default; + /** Constructs the path from segments. */ + template + ResourcePath(const IterT begin, const IterT end) : BasePath{begin, end} { + } + ResourcePath(std::initializer_list list) : BasePath{list} { + } + explicit ResourcePath(SegmentsT&& segments) : BasePath{std::move(segments)} { + } + /** + * Creates and returns a new path from the given resource-path string, where + * the path segments are separated by a slash "/". + */ + static ResourcePath FromString(const std::string& path); + + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class DocumentKey; + friend class remote::Serializer; + + static ResourcePath FromStringView(absl::string_view path); + + public: + static ResourcePath Empty() { + return ResourcePath{}; + } + + /** Returns a standardized string representation of this path. */ + std::string CanonicalString() const; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_RESOURCE_PATH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/set_mutation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.cc similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/set_mutation.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.cc index e411c4bd2..ec11ff5db 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/set_mutation.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.cc @@ -14,17 +14,17 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/set_mutation.h" +#include "Firestore/core/src/model/set_mutation.h" #include #include -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/hashing.h" #include "absl/strings/str_cat.h" namespace firebase { @@ -61,7 +61,7 @@ MaybeDocument SetMutation::Rep::ApplyToRemoteDocument( HARD_ASSERT(mutation_result.transform_results() == absl::nullopt, "Transform results received by SetMutation."); - // Unlike applyToLocalView, if we're applying a mutation to a remote document + // Unlike ApplyToLocalView, if we're applying a mutation to a remote document // the server has accepted the mutation so the precondition must have held. const SnapshotVersion& version = mutation_result.version(); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/set_mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/set_mutation.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.h index 6d7c9f2a9..7aef509a7 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/set_mutation.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/set_mutation.h @@ -14,21 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SET_MUTATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SET_MUTATION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_SET_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_SET_MUTATION_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/precondition.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/mutation.h" #include "absl/types/optional.h" namespace firebase { @@ -98,4 +93,4 @@ class SetMutation : public Mutation { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SET_MUTATION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_SET_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/snapshot_version.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.cc similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/snapshot_version.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.cc index eed605faf..d7535f6d6 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/snapshot_version.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.cc @@ -14,11 +14,11 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" +#include "Firestore/core/src/model/snapshot_version.h" #include -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hashing.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/snapshot_version.h b/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/snapshot_version.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.h index f1ae0cec7..0bf889214 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/snapshot_version.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/snapshot_version.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SNAPSHOT_VERSION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SNAPSHOT_VERSION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_SNAPSHOT_VERSION_H_ +#define FIRESTORE_CORE_SRC_MODEL_SNAPSHOT_VERSION_H_ #include #include #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/util/comparison.h" namespace firebase { namespace firestore { @@ -65,4 +65,4 @@ class SnapshotVersion : public util::Comparable { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_SNAPSHOT_VERSION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_SNAPSHOT_VERSION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_mutation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_mutation.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_mutation.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/transform_mutation.cc index 796bb017e..a0a827af9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_mutation.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_mutation.cc @@ -14,20 +14,20 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/transform_mutation.h" +#include "Firestore/core/src/model/transform_mutation.h" #include #include #include -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/model/transform_operation.h" +#include "Firestore/core/src/model/unknown_document.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/to_string.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_mutation.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_mutation.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/transform_mutation.h index 955a03282..673d48b91 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_mutation.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_mutation.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_MUTATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_MUTATION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_TRANSFORM_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_TRANSFORM_MUTATION_H_ #include #include -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" +#include "Firestore/core/src/model/field_mask.h" +#include "Firestore/core/src/model/field_transform.h" +#include "Firestore/core/src/model/mutation.h" #include "absl/types/optional.h" namespace firebase { @@ -135,4 +135,4 @@ class TransformMutation : public Mutation { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_MUTATION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_TRANSFORM_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_operation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.cc similarity index 97% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_operation.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.cc index 877564ffd..f8763853a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_operation.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" +#include "Firestore/core/src/model/transform_operation.h" #include #include @@ -22,9 +22,9 @@ #include #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/to_string.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/to_string.h" #include "absl/algorithm/container.h" #include "absl/strings/str_cat.h" diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_operation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.h similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_operation.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.h index ba8d34e8e..fb8f86dfd 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/transform_operation.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/transform_operation.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_OPERATION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_OPERATION_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_TRANSFORM_OPERATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_TRANSFORM_OPERATION_H_ #include #include @@ -23,8 +23,7 @@ #include #include -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/model/field_value.h" #include "absl/types/optional.h" namespace firebase { @@ -67,6 +66,11 @@ class TransformOperation { return rep().type(); } + private: + // TODO(b/146372592): Make this public once we can use Abseil across + // iOS/public C++ library boundaries. + friend class TransformMutation; + /** * Computes the local transform result against the provided `previous_value`, * optionally using the provided local_write_time. @@ -106,6 +110,7 @@ class TransformOperation { return rep().ComputeBaseValue(previous_value); } + public: /** Returns whether the two are equal. */ friend bool operator==(const TransformOperation& lhs, const TransformOperation& rhs); @@ -222,4 +227,4 @@ inline bool operator!=(const TransformOperation& lhs, } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TRANSFORM_OPERATION_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_TRANSFORM_OPERATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/types.h b/Pods/FirebaseFirestore/Firestore/core/src/model/types.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/types.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/types.h index d1f2bb7a5..5f70c9be0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/types.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/types.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TYPES_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TYPES_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_TYPES_H_ +#define FIRESTORE_CORE_SRC_MODEL_TYPES_H_ #include @@ -47,7 +47,7 @@ using TargetId = int32_t; * indicate whether or not the remote store is trying to connect or not. This is * primarily used by the View / EventManager code to change their behavior while * offline (e.g. get() calls shouldn't wait for data from the server and - * snapshot events should set metadata.isFromCache=true). + * snapshot events should set metadata.from_cache() to true). */ enum class OnlineState { /** @@ -67,7 +67,7 @@ enum class OnlineState { /** * The client is either trying to establish a connection but failing, or it - * has been explicitly marked offline via a call to `disableNetwork`. + * has been explicitly marked offline via a call to `DisableNetwork`. * Higher-level components should operate in offline mode. */ Offline @@ -77,4 +77,4 @@ enum class OnlineState { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_TYPES_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_TYPES_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/unknown_document.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/unknown_document.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/unknown_document.cc rename to Pods/FirebaseFirestore/Firestore/core/src/model/unknown_document.cc index 612409839..4fb362fc5 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/unknown_document.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/unknown_document.cc @@ -14,11 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/model/unknown_document.h" +#include "Firestore/core/src/model/unknown_document.h" +#include #include #include +#include "Firestore/core/src/util/hard_assert.h" +#include "absl/strings/str_cat.h" + namespace firebase { namespace firestore { namespace model { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/unknown_document.h b/Pods/FirebaseFirestore/Firestore/core/src/model/unknown_document.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/unknown_document.h rename to Pods/FirebaseFirestore/Firestore/core/src/model/unknown_document.h index 8f7c8b075..25d22dc67 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/model/unknown_document.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/unknown_document.h @@ -14,12 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_UNKNOWN_DOCUMENT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_UNKNOWN_DOCUMENT_H_ +#ifndef FIRESTORE_CORE_SRC_MODEL_UNKNOWN_DOCUMENT_H_ +#define FIRESTORE_CORE_SRC_MODEL_UNKNOWN_DOCUMENT_H_ -#include - -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" +#include "Firestore/core/src/model/maybe_document.h" namespace firebase { namespace firestore { @@ -51,4 +49,4 @@ class UnknownDocument : public MaybeDocument { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_MODEL_UNKNOWN_DOCUMENT_H_ +#endif // FIRESTORE_CORE_SRC_MODEL_UNKNOWN_DOCUMENT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.cc b/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.cc new file mode 100644 index 000000000..fff5a0eb1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.cc @@ -0,0 +1,60 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/model/verify_mutation.h" + +#include + +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace model { + +static_assert( + sizeof(Mutation) == sizeof(VerifyMutation), + "VerifyMutation may not have additional members (everything goes in Rep)"); + +VerifyMutation::VerifyMutation(DocumentKey key, Precondition precondition) + : Mutation(std::make_shared(std::move(key), std::move(precondition))) { +} + +VerifyMutation::VerifyMutation(const Mutation& mutation) : Mutation(mutation) { + HARD_ASSERT(type() == Type::Verify); +} + +MaybeDocument VerifyMutation::Rep::ApplyToRemoteDocument( + const absl::optional&, const MutationResult&) const { + HARD_FAIL("VerifyMutation should only be used in Transactions."); +} + +absl::optional VerifyMutation::Rep::ApplyToLocalView( + const absl::optional&, + const absl::optional&, + const Timestamp&) const { + HARD_FAIL("VerifyMutation should only be used in Transactions."); +} + +std::string VerifyMutation::Rep::ToString() const { + return absl::StrCat("VerifyMutation(key=", key().ToString(), + ", precondition=", precondition().ToString(), ")"); +} + +} // namespace model +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.h b/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.h new file mode 100644 index 000000000..349d8fedd --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/model/verify_mutation.h @@ -0,0 +1,85 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_MODEL_VERIFY_MUTATION_H_ +#define FIRESTORE_CORE_SRC_MODEL_VERIFY_MUTATION_H_ + +#include +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/timestamp.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/precondition.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "absl/types/optional.h" + +namespace firebase { +namespace firestore { +namespace model { + +/** + * A mutation that verifies the existence of the document at the given key + * with the provided precondition. + * + * The `verify` operation is only used in Transactions, and this class serves + * primarily to facilitate serialization into protos. + */ +class VerifyMutation : public Mutation { + public: + VerifyMutation(DocumentKey key, Precondition precondition); + + /** + * Casts a Mutation to a VerifyMutation. This is a checked operation that will + * assert if the type of the Mutation isn't actually Type::Verify. + */ + explicit VerifyMutation(const Mutation& mutation); + + /** Creates an invalid VerifyMutation instance. */ + VerifyMutation() = default; + + private: + class Rep : public Mutation::Rep { + public: + using Mutation::Rep::Rep; + + Type type() const override { + return Type::Verify; + } + + MaybeDocument ApplyToRemoteDocument( + const absl::optional& maybe_doc, + const MutationResult& mutation_result) const override; + + absl::optional ApplyToLocalView( + const absl::optional& maybe_doc, + const absl::optional&, + const Timestamp&) const override; + + // Does not override Equals or Hash; Mutation's versions are sufficient. + + std::string ToString() const override; + }; +}; + +} // namespace model +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_MODEL_VERIFY_MUTATION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/byte_string.cc b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.cc similarity index 80% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/byte_string.cc rename to Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.cc index 6123c0020..2d4d96709 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/byte_string.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/byte_string.h" #include #include @@ -23,9 +23,9 @@ #include #include -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" -#include "Firestore/core/src/firebase/firestore/util/range.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hashing.h" +#include "Firestore/core/src/util/range.h" #include "absl/strings/escaping.h" namespace firebase { @@ -55,13 +55,31 @@ ByteString::ByteString(const ByteString& other) } ByteString::ByteString(ByteString&& other) noexcept { - swap(*this, other); + bytes_ = other.bytes_; + other.bytes_ = nullptr; } ByteString::~ByteString() { std::free(bytes_); } +ByteString& ByteString::operator=(const ByteString& other) { + if (bytes_ != other.bytes_) { + std::free(bytes_); + bytes_ = MakeBytesArray(other.data(), other.size()); + } + return *this; +} + +ByteString& ByteString::operator=(ByteString&& other) noexcept { + if (bytes_ != other.bytes_) { + std::free(bytes_); + bytes_ = other.bytes_; + other.bytes_ = nullptr; + } + return *this; +} + /* static */ ByteString ByteString::Take(pb_bytes_array_t* bytes) { return ByteString{bytes, 0}; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/byte_string.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.h similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/byte_string.h rename to Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.h index d22a6fdbf..a1f164d3b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/byte_string.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/byte_string.h @@ -14,12 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_BYTE_STRING_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_BYTE_STRING_H_ - -#if __OBJC__ -#import -#endif +#ifndef FIRESTORE_CORE_SRC_NANOPB_BYTE_STRING_H_ +#define FIRESTORE_CORE_SRC_NANOPB_BYTE_STRING_H_ #include @@ -30,7 +26,7 @@ #include #include -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/util/comparison.h" #include "absl/strings/string_view.h" namespace firebase { @@ -80,10 +76,8 @@ class ByteString : public util::Comparable { ~ByteString(); - ByteString& operator=(ByteString other) { - swap(*this, other); - return *this; - } + ByteString& operator=(const ByteString& other); + ByteString& operator=(ByteString&& other) noexcept; friend void swap(ByteString& lhs, ByteString& rhs) noexcept; @@ -152,7 +146,7 @@ class ByteString : public util::Comparable { std::string ToString() const; friend std::ostream& operator<<(std::ostream& out, const ByteString& str); - // Represents the value as hexademical values. + // Represents the value as hexadecimal values. std::string ToHexString() const; private: @@ -171,4 +165,4 @@ class ByteString : public util::Comparable { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_NANOPB_BYTE_STRING_H_ +#endif // FIRESTORE_CORE_SRC_NANOPB_BYTE_STRING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/fields_array.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/fields_array.h new file mode 100644 index 000000000..4e3cc42f1 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/fields_array.h @@ -0,0 +1,164 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_NANOPB_FIELDS_ARRAY_H_ +#define FIRESTORE_CORE_SRC_NANOPB_FIELDS_ARRAY_H_ + +#include "Firestore/Protos/nanopb/firestore/local/maybe_document.nanopb.h" +#include "Firestore/Protos/nanopb/firestore/local/mutation.nanopb.h" +#include "Firestore/Protos/nanopb/firestore/local/target.nanopb.h" +#include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" +#include "Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h" +#include "Firestore/Protos/nanopb/google/type/latlng.nanopb.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * Returns a pointer to the Nanopb-generated array that describes the fields + * of the Nanopb proto; the array is required to call most Nanopb functions. + * + * There is always a one-to-one correspondence between a Nanopb-generated + * message type and its fields descriptor; essentially, the fields descriptor is + * a property of the type. + */ +// The non-specialized version of this function is deleted to make sure that +// forgetting to specialize it results in a compile-time-, not link-time error. +// If you run into an error where compiler complains about the deleted function, +// simply add the missing specialization. +template +const pb_field_t* FieldsArray() = delete; + +template <> +inline const pb_field_t* FieldsArray() { + return firestore_client_MaybeDocument_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return firestore_client_MutationQueue_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return firestore_client_Target_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return firestore_client_TargetGlobal_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return firestore_client_WriteBatch_fields; +} + +template <> +inline const pb_field_t* +FieldsArray() { + return google_firestore_v1_BatchGetDocumentsRequest_fields; +} + +template <> +inline const pb_field_t* +FieldsArray() { + return google_firestore_v1_BatchGetDocumentsResponse_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_CommitRequest_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_CommitResponse_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_ListenRequest_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_ListenResponse_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_RunQueryRequest_fields; +} + +template <> +inline const pb_field_t* +FieldsArray() { + return google_firestore_v1_StructuredQuery_Filter_fields; +} + +template <> +inline const pb_field_t* +FieldsArray() { + return google_firestore_v1_Target_DocumentsTarget_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_TargetChange_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_Target_QueryTarget_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_Value_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_Write_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_WriteRequest_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_WriteResponse_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_firestore_v1_WriteResult_fields; +} + +template <> +inline const pb_field_t* FieldsArray() { + return google_protobuf_Empty_fields; +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_FIELDS_ARRAY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.cc b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.cc new file mode 100644 index 000000000..aa9bd08f3 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.cc @@ -0,0 +1,29 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/nanopb/message.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +void FreeNanopbMessage(const pb_field_t* fields, void* dest_struct) { + pb_release(fields, dest_struct); +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.h new file mode 100644 index 000000000..305b34a93 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/message.h @@ -0,0 +1,228 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_NANOPB_MESSAGE_H_ +#define FIRESTORE_CORE_SRC_NANOPB_MESSAGE_H_ + +#include +#include + +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/fields_array.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * Free the dynamically-allocated memory within a Nanopb-generated message. + * + * This essentially wraps calls to Nanopb's `pb_release()` function. + */ +void FreeNanopbMessage(const pb_field_t* fields, void* dest_struct); + +template +class Message; + +/** + * A unique-ownership RAII wrapper for Nanopb-generated message types. + * + * Nanopb-generated message types (from now on, "Nanopb protos") are plain + * C structs that contain some dynamically-allocated memory and should be + * deallocated by calling `pb_release`; `Message` implements a simple RAII + * wrapper that does just that. For simplicity, `Message` implements unique + * ownership model. It provides a pointer-like access to the underlying Nanopb + * proto. + * + * Note that moving *isn't* a particularly cheap operation in the general case. + * Even without doing deep copies, Nanopb protos contain *a lot* of member + * variables (at the time of writing, the largest `sizeof` of a Nanopb proto was + * 248). + */ +template +class Message { + public: + /** + * Creates a valid `Message` that wraps a value-constructed ("zeroed out") + * Nanopb proto. The created object can then be filled by using the + * pointer-like access. + */ + Message() = default; + + /** + * Attempts to parse a Nanopb message from the given `reader`. If the reader + * contains ill-formed bytes, returns a default-constructed `Message`; check + * the status on `reader` to see whether parsing was successful. + */ + static Message TryParse(Reader* reader); + + ~Message() { + Free(); + } + + /** `Message` models unique ownership. */ + Message(const Message&) = delete; + Message& operator=(const Message&) = delete; + + /** + * A moved-from `Message` is in an invalid state that is *not* equivalent to + * its default-constructed state. Calling `get()` on a moved-from `Message` + * returns a null pointer; attempting to "dereference" a moved-from `Message` + * results in undefined behavior. + */ + Message(Message&& other) noexcept + : owns_proto_{other.owns_proto_}, proto_{other.proto_} { + other.owns_proto_ = false; + } + + Message& operator=(Message&& other) noexcept { + Free(); + + owns_proto_ = other.owns_proto_; + proto_ = other.proto_; + other.owns_proto_ = false; + + return *this; + } + + T* release() { + auto result = get(); + owns_proto_ = false; + return result; + } + + /** + * Returns a pointer to the underlying Nanopb proto or null if the `Message` + * is moved-from. + */ + T* get() { + return owns_proto_ ? &proto_ : nullptr; + } + + /** + * Returns a pointer to the underlying Nanopb proto or null if the `Message` + * is moved-from. + */ + const T* get() const { + return owns_proto_ ? &proto_ : nullptr; + } + + /** + * Returns a reference to the underlying Nanopb proto; if the `Message` is + * moved-from, the behavior is undefined. + * + * For performance reasons, prefer assigning to individual fields to + * reassigning the whole Nanopb proto. + */ + T& operator*() { + return *get(); + } + + /** + * Returns a reference to the underlying Nanopb proto; if the `Message` is + * moved-from, the behavior is undefined. + */ + const T& operator*() const { + return *get(); + } + + T* operator->() { + return get(); + } + + const T* operator->() const { + return get(); + } + + /** + * Returns a pointer to the Nanopb-generated array that describes the fields + * of the Nanopb proto; the array is required to call most Nanopb functions. + * + * Note that this is essentially a property of the type, but cannot be made + * a template parameter for various technical reasons. + */ + static const pb_field_t* fields() { + return FieldsArray(); + } + + /** Creates a pretty-printed description of the proto for debugging. */ + std::string ToString() const { + return proto_.ToString(); + } + + private: + // Important: this function does *not* modify `owns_proto_`. + void Free() { + if (owns_proto_) { + FreeNanopbMessage(fields(), &proto_); + } + } + + bool owns_proto_ = true; + // The Nanopb-proto is value-initialized (zeroed out) to make sure that any + // member variables that aren't written to are in a valid state. + T proto_{}; +}; + +template +Message Message::TryParse(Reader* reader) { + Message result; + reader->Read(result.fields(), result.get()); + + if (!reader->ok()) { + // In the event reading a Nanopb proto fails, Nanopb calls `pb_release` on + // the partially-filled message; let go of ownership to make sure double + // deletion doesn't occur. + result.release(); + // Guarantee that a partially-filled message is never returned. + return Message{}; + } + + return result; +} + +/** + * Serializes the given `message` into a `ByteString`. + * + * The lifetime of the return value is entirely independent of the `message`. + */ +template +ByteString MakeByteString(const Message& message) { + ByteStringWriter writer; + writer.Write(message.fields(), message.get()); + return writer.Release(); +} + +/** + * Serializes the given `message` into a `std::string`. + * + * The lifetime of the return value is entirely independent of the `message`. + */ +template +std::string MakeStdString(const Message& message) { + StringWriter writer; + writer.Write(message.fields(), message.get()); + return writer.Release(); +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_MESSAGE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/nanopb_util.cc b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.cc similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/nanopb_util.cc rename to Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.cc index f23b100b7..ec7c48bd0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/nanopb_util.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.cc @@ -14,14 +14,22 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" #include +#include "Firestore/core/src/util/hard_assert.h" + namespace firebase { namespace firestore { namespace nanopb { +pb_size_t CheckedSize(size_t size) { + HARD_ASSERT(size <= PB_SIZE_MAX, + "Size exceeds nanopb limits. Too many entries."); + return static_cast(size); +} + pb_bytes_array_t* _Nullable CopyBytesArray( const pb_bytes_array_t* _Nullable buffer) { if (buffer == nullptr) return nullptr; diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.h new file mode 100644 index 000000000..580b17576 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/nanopb_util.h @@ -0,0 +1,129 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_NANOPB_NANOPB_UTIL_H_ +#define FIRESTORE_CORE_SRC_NANOPB_NANOPB_UTIL_H_ + +#include + +#include +#include +#include +#include + +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/util/nullability.h" +#include "absl/base/casts.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * Static casts the given size_t value down to a nanopb compatible size, after + * asserting that the value isn't out of range. + */ +pb_size_t CheckedSize(size_t size); + +/** + * Creates a new, null-terminated byte array that's a copy of the bytes in the + * given buffer. Returns a null instance if the given buffer is null or empty. + */ +pb_bytes_array_t* _Nullable CopyBytesArray( + const pb_bytes_array_t* _Nullable buffer); + +/** + * Creates a new, null-terminated byte array that's a copy of the given bytes. + * Returns a null instance if the given size is zero. + */ +pb_bytes_array_t* _Nullable MakeBytesArray(const void* _Nullable data, + size_t size); + +/** + * Creates a new, null-terminated byte array that's a copy of the given bytes. + * Returns a null instance if the size of the given vector is zero. + */ +inline pb_bytes_array_t* _Nullable MakeBytesArray( + const std::vector& bytes) { + return MakeBytesArray(bytes.data(), bytes.size()); +} + +/** + * Creates a string_view of the given nanopb bytes. + */ +absl::string_view MakeStringView(const pb_bytes_array_t* _Nullable str); + +/** + * Creates a string_view of the given nanopb bytes. + */ +absl::string_view MakeStringView(const ByteString& bytes); + +inline pb_bytes_array_t* _Nullable MakeBytesArray(const std::string& str) { + return MakeBytesArray(str.data(), str.size()); +} + +std::string MakeString(const pb_bytes_array_t* _Nullable str); + +/** + * Copies the backing byte array into a new vector of bytes. + */ +inline std::vector MakeVector(const ByteString& str) { + return {str.begin(), str.end()}; +} + +/** + * Due to the nanopb implementation, nanopb_boolean could be an integer + * other than 0 or 1, (such as 2). This leads to undefined behaviour when + * it's read as a boolean. eg. on at least gcc, the value is treated as + * both true *and* false. So we'll instead memcpy to an integer (via + * absl::bit_cast) and compare with 0. + * + * Note that it is necessary to pass-by-reference here to get the original + * value of `nanopb_boolean`. + */ +inline bool SafeReadBoolean(const bool& nanopb_boolean) { + return absl::bit_cast(nanopb_boolean) != 0; +} + +template +T* _Nonnull MakeArray(pb_size_t count) { + return static_cast(calloc(count, sizeof(T))); +} + +#if __OBJC__ +inline ByteString MakeByteString(NSData* _Nullable value) { + if (value == nil) return ByteString(); + + auto size = static_cast(value.length); + return ByteString::Take(MakeBytesArray(value.bytes, size)); +} + +inline NSData* _Nonnull MakeNSData(const ByteString& str) { + return [[NSData alloc] initWithBytes:str.data() length:str.size()]; +} + +inline NSData* _Nullable MakeNullableNSData(const ByteString& str) { + if (str.empty()) return nil; + return MakeNSData(str); +} +#endif + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_NANOPB_UTIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.cc b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.cc new file mode 100644 index 000000000..95ddfecca --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.cc @@ -0,0 +1,82 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/nanopb/pretty_printing.h" + +#include + +#include "Firestore/core/src/nanopb/byte_string.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +namespace internal { + +std::string Indent(int level, int indent_width) { + return std::string(level * indent_width, ' '); +} + +std::string ToString(pb_bytes_array_t* value) { + return absl::StrCat("\"", nanopb::ByteString(value).ToString(), "\""); +} + +std::string ToString(bool value) { + return value ? std::string{"true"} : std::string{"false"}; +} + +// Overloads for float and double exist to minimize the use of `stringstream`, +// which isn't necessary for other scalars. +std::string ToString(float value) { + // `std::to_string` doesn't allow changing width and precision for floating + // point values, leading to output inconsistent with "official" proto + // libraries. + // TODO(varconst): raise the precision. + // The Objective-C protobuf library would use higher precision. E.g., it would + // output 1.79769313486232e+308 in case where this implementation would only + // output 1.79769e+308 (tested in XCode 11, iOS simulator). + std::ostringstream stream; + stream << value; + return stream.str(); +} + +std::string ToString(double value) { + // See comment on the `float` overload. + std::ostringstream stream; + stream << value; + return stream.str(); +} + +} // namespace internal + +std::string PrintHeader(int indent_level, + absl::string_view message_name, + const void* message_ptr) { + if (indent_level == 0) { + auto p = absl::Hex{reinterpret_cast(message_ptr)}; + return absl::StrCat("<", message_name, " 0x", p, ">: {\n"); + } else { + return "{\n"; + } +} + +std::string PrintTail(int indent_level) { + return internal::Indent(indent_level) + '}'; +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.h new file mode 100644 index 000000000..43758d8d2 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/pretty_printing.h @@ -0,0 +1,127 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_NANOPB_PRETTY_PRINTING_H_ +#define FIRESTORE_CORE_SRC_NANOPB_PRETTY_PRINTING_H_ + +#include + +#include + +#include "absl/strings/str_cat.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +namespace internal { + +// Creates a string of spaces corresponding to the given indentation level. +std::string Indent(int level, int indent_width = 2); + +std::string ToString(pb_bytes_array_t* value); +std::string ToString(bool value); +std::string ToString(float value); +std::string ToString(double value); + +template +std::string ToString(const T& value) { + return std::to_string(value); +} + +} // namespace internal + +// Prints a nested message by delegating to its `ToString` member function. +// +// If the nested message is empty, then: +// - if `always_print` is false, an empty string is returned. +// - if `always_print` is true, a string containing field name and empty braces +// is returned. +template +std::string PrintMessageField(absl::string_view name, + const T& value, + int indent_level, + bool always_print) { + auto contents = value.ToString(indent_level); + if (contents.empty()) { + if (!always_print) { + return ""; + } else { + return absl::StrCat(internal::Indent(indent_level), name, "{\n", + internal::Indent(indent_level), "}\n"); + } + } + + return absl::StrCat(internal::Indent(indent_level), name, contents, "\n"); +} + +// Prints a primitive type field. +// +// If the field has its default value (e.g., zero), then: +// - if `always_print` is false, an empty string is returned. +// - if `always_print` is true, a string representing the default value is +// returned. +template +std::string PrintPrimitiveField(absl::string_view name, + T value, + int indent_level, + bool always_print) { + if (value == T{} && !always_print) { + return ""; + } + return absl::StrCat(internal::Indent(indent_level), name, + internal::ToString(value), "\n"); +} + +// Prints an enum type field by delegating to a `EnumToString` free function. +// +// If the enum has its default value, zero), then: +// - if `always_print` is false, an empty string is returned. +// - if `always_print` is true, a string representing the default value is +// returned. +template +std::string PrintEnumField(absl::string_view name, + T value, + int indent_level, + bool always_print) { + if (value == T{} && !always_print) { + return ""; + } + + return absl::StrCat(internal::Indent(indent_level), name, EnumToString(value), + "\n"); +} + +// Begins output for a message. +// +// For a non-root message (determined by `indent_level`), this is just an +// opening brace. For the root message, `message_name` and the address of the +// object are additionally printed (e.g., ": {"). +std::string PrintHeader(int indent_level, + absl::string_view message_name, + const void* message_ptr); + +// Ends output for a message. +// +// This just outputs a closing brace. +std::string PrintTail(int indent_level); + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_PRETTY_PRINTING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.cc b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.cc new file mode 100644 index 000000000..51469a291 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.cc @@ -0,0 +1,51 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/nanopb/reader.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +using util::Status; + +StringReader::StringReader(const ByteString& bytes) + : StringReader(bytes.data(), bytes.size()) { +} + +StringReader::StringReader(const std::vector& bytes) + : StringReader(bytes.data(), bytes.size()) { +} + +StringReader::StringReader(const uint8_t* bytes, size_t size) + : stream_(pb_istream_from_buffer(bytes, size)) { +} + +StringReader::StringReader(absl::string_view str) + : StringReader(reinterpret_cast(str.data()), str.size()) { +} + +void StringReader::Read(const pb_field_t fields[], void* dest_struct) { + if (!ok()) return; + + if (!pb_decode(&stream_, fields, dest_struct)) { + Fail(PB_GET_ERROR(&stream_)); + } +} + +} // namespace nanopb +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.h new file mode 100644 index 000000000..a77db9db7 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/reader.h @@ -0,0 +1,184 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_NANOPB_READER_H_ +#define FIRESTORE_CORE_SRC_NANOPB_READER_H_ + +#include +#include + +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/util/status.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * Maintains whether any errors occurred between single reads within a larger + * read chain. The pattern is to pass the `ReadContext` as the first argument to + * any `Read` function that might fail, and for the function to exit early if + * the given context is failed already. + */ +class ReadContext { + public: + bool ok() const { + return status_.ok(); + } + + const util::Status& status() const { + return status_; + } + + void set_status(util::Status status) { + status_ = std::move(status); + } + + /** + * Ensures this `ReadContext`'s status is `!ok()`. + * + * If this `ReadContext`'s status is already `!ok()`, then this may augment + * the description, but will otherwise leave it alone. Otherwise, this + * `ReadContext`'s status will be set to `Error::kErrorDataLoss` with the + * specified description. + */ + void Fail(std::string description) { + status_.Update(util::Status(Error::kErrorDataLoss, std::move(description))); + } + + private: + util::Status status_ = util::Status::OK(); +}; + +/** + * An interface that: + * - maintains a `ReadContext` across the reads; + * - can read byte representations from the associated stream into a given + * Nanopb proto. + * + * Derived classes define what kinds of streams can be associated with the + * `Reader`. + */ +class Reader { + public: + virtual ~Reader() = default; + + /** + * Reads a Nanopb proto from the stream associated with this `Reader`. + * + * This essentially wraps calls to Nanopb's `pb_decode()` method. This is the + * primary way of decoding messages. + * + * Note that this allocates memory. You must call + * `nanopb::FreeNanopbMessage()` (which essentially wraps `pb_release()`) on + * the `dest_struct` in order to avoid memory leaks. (This also implies code + * that uses this is not exception safe.) + */ + // TODO(rsgowman): At the moment we rely on the caller to manually free + // dest_struct via nanopb::FreeNanopbMessage(). We might instead see if we can + // register allocated messages, track them, and free them ourselves. This may + // be especially relevant if we start to use nanopb messages as the underlying + // data within the model objects. + virtual void Read(const pb_field_t fields[], void* dest_struct) = 0; + + bool ok() const { + return context_.ok(); + } + + const util::Status& status() const { + return context_.status(); + } + + void set_status(util::Status status) { + context_.set_status(std::move(status)); + } + + ReadContext* context() { + return &context_; + } + + const ReadContext* context() const { + return &context_; + } + + void Fail(std::string description) { + context_.Fail(std::move(description)); + } + + private: + ReadContext context_; +}; + +/** + * Docs TODO(rsgowman). But currently, this just wraps the underlying nanopb + * pb_istream_t. + */ +class StringReader : public Reader { + public: + /** + * Creates an instance that isn't associated with any bytes. It can be used + * for error propagation. + * TODO(varconst): only use `ReadContext` for error propagation. + */ + StringReader() = default; + + /** + * Creates an input stream that reads from the specified bytes. Note that + * this reference must remain valid for the lifetime of this `StringReader`. + * + * (This is roughly equivalent to the Nanopb function + * `pb_istream_from_buffer()`) + * + * @param bytes where the input should be deserialized from. + */ + explicit StringReader(const nanopb::ByteString& bytes); + explicit StringReader(const std::vector& bytes); + StringReader(const uint8_t* bytes, size_t length); + + /** + * Creates an input stream from bytes backing the string_view. Note that + * the backing buffer must remain valid for the lifetime of this + * `StringReader`. + * + * (This is roughly equivalent to the Nanopb function + * `pb_istream_from_buffer()`) + */ + explicit StringReader(absl::string_view); + + void Read(const pb_field_t fields[], void* dest_struct) override; + + private: + /** + * Takes that a shallow copy of the given `stream`. (Non-null pointers within + * this struct must remain valid for the lifetime of this `StringReader`.) + */ + explicit StringReader(pb_istream_t stream) : stream_(stream) { + } + + pb_istream_t stream_{}; +}; + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_READER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/writer.cc b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/writer.cc rename to Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc index 665f4c337..5dcb718ba 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/nanopb/writer.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.cc @@ -14,22 +14,19 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/nanopb/writer.h" +#include "Firestore/core/src/nanopb/writer.h" #include #include -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { namespace nanopb { -using nanopb::ByteString; - -void Writer::WriteNanopbMessage(const pb_field_t fields[], - const void* src_struct) { +void Writer::Write(const pb_field_t fields[], const void* src_struct) { if (!pb_encode(&stream_, fields, src_struct)) { HARD_FAIL(PB_GET_ERROR(&stream_)); } @@ -82,13 +79,15 @@ void ByteStringWriter::Reserve(size_t min_capacity) { // If capacity * 2 overflows, min_capacity will be larger. size_t desired = std::max(capacity_ * 2, min_capacity); - buffer_ = static_cast( - std::realloc(buffer_, PB_BYTES_ARRAY_T_ALLOCSIZE(desired))); - - if (capacity_ == 0) { + if (buffer_) { + buffer_ = static_cast( + std::realloc(buffer_, PB_BYTES_ARRAY_T_ALLOCSIZE(desired))); + } else { // initialize on the first allocation. - buffer_->size = 0; + buffer_ = static_cast( + std::calloc(1, PB_BYTES_ARRAY_T_ALLOCSIZE(desired))); } + capacity_ = desired; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.h b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.h new file mode 100644 index 000000000..bfa29ce77 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/nanopb/writer.h @@ -0,0 +1,147 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_NANOPB_WRITER_H_ +#define FIRESTORE_CORE_SRC_NANOPB_WRITER_H_ + +#include +#include + +#include +#include +#include + +#include "Firestore/core/src/nanopb/byte_string.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { +namespace nanopb { + +/** + * Docs TODO(rsgowman). But currently, this just wraps the underlying Nanopb + * `pb_ostream_t`. All errors are considered fatal. + */ +class Writer { + public: + /** + * Writes a Nanopb proto to the output stream. + * + * This essentially wraps calls to Nanopb's `pb_encode()` method. + */ + void Write(const pb_field_t* fields, const void* src_struct); + + protected: + /** + * Creates a `Writer` with a value-initialized `pb_ostream_t`. + */ + Writer() = default; + + pb_ostream_t stream_{}; +}; + +/** + * A `Writer` that writes into a vector of bytes. + * + * This is roughly equivalent to the Nanopb function `pb_ostream_from_buffer()`, + * except that `ByteStringWriter` manages the buffer. + */ +class ByteStringWriter : public Writer { + public: + ByteStringWriter(); + ~ByteStringWriter(); + + ByteStringWriter(const ByteStringWriter&) = delete; + ByteStringWriter& operator=(const ByteStringWriter&) = delete; + + /** + * Appends the given data to the internal buffer, growing the capacity of the + * buffer to fit. + */ + void Append(const void* data, size_t size); + + /** + * Reserves the given number of bytes of total capacity. To reserve `n` more + * bytes in a writer `w`, call `w.Reserve(w.size() + n)`. + */ + void Reserve(size_t capacity); + + /** + * Sets the size of the buffer to some value less than the current capacity, + * presumably after writing into the buffer with `pos()`. + */ + void SetSize(size_t size); + + /** + * Returns a `ByteString` that takes ownership of the bytes backing this + * writer. + */ + ByteString Release(); + + size_t size() const { + return buffer_ ? buffer_->size : 0; + } + + size_t capacity() const { + return capacity_; + } + + /** + * Returns the number of remaining bytes: the difference between capacity and + * size. + */ + size_t remaining() const { + return capacity_ - size(); + } + + /** + * Returns the current writing position within this writer's internal buffer. + * This can only be used after calling `Reserve()`. + */ + uint8_t* pos() { + return buffer_->bytes + buffer_->size; + } + + private: + pb_bytes_array_t* buffer_ = nullptr; + size_t capacity_ = 0; +}; + +/** + * A `Writer` that writes into a `std::string`. + * + * This is roughly equivalent to the Nanopb function `pb_ostream_from_buffer()`, + * except that `StringWriter` manages the string. + */ +class StringWriter : public Writer { + public: + StringWriter(); + + /** + * Returns the string backing this `StringWriter`, taking ownership of its + * contents. + */ + std::string Release(); + + private: + std::string buffer_; +}; + +} // namespace nanopb +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_NANOPB_WRITER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_type_traits.h b/Pods/FirebaseFirestore/Firestore/core/src/objc/objc_type_traits.h similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_type_traits.h rename to Pods/FirebaseFirestore/Firestore/core/src/objc/objc_type_traits.h index 0a8acadde..268f96033 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/objc/objc_type_traits.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/objc/objc_type_traits.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_TYPE_TRAITS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_TYPE_TRAITS_H_ +#ifndef FIRESTORE_CORE_SRC_OBJC_OBJC_TYPE_TRAITS_H_ +#define FIRESTORE_CORE_SRC_OBJC_OBJC_TYPE_TRAITS_H_ #if __OBJC__ @@ -51,4 +51,4 @@ using is_objc_pointer = std::is_convertible; #endif // __OBJC__ -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_OBJC_OBJC_TYPE_TRAITS_H_ +#endif // FIRESTORE_CORE_SRC_OBJC_OBJC_TYPE_TRAITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.cc similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.cc index 924c4d826..2f35f0808 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h" +#include "Firestore/core/src/remote/connectivity_monitor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/memory/memory.h" namespace firebase { @@ -33,8 +33,12 @@ void ConnectivityMonitor::MaybeInvokeCallbacks(NetworkStatus new_status) { if (new_status == status_) { return; } - status_ = new_status; + InvokeCallbacks(new_status); +} + +void ConnectivityMonitor::InvokeCallbacks(NetworkStatus new_status) { + status_ = new_status; for (auto& callback : callbacks_) { callback(status_.value()); } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.h index 86de93e72..a77f1055f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor.h @@ -14,15 +14,15 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_CONNECTIVITY_MONITOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_CONNECTIVITY_MONITOR_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_CONNECTIVITY_MONITOR_H_ +#define FIRESTORE_CORE_SRC_REMOTE_CONNECTIVITY_MONITOR_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" +#include "Firestore/core/src/util/async_queue.h" #include "absl/types/optional.h" namespace firebase { @@ -57,8 +57,7 @@ class ConnectivityMonitor { : worker_queue_{worker_queue} { } - virtual ~ConnectivityMonitor() { - } + virtual ~ConnectivityMonitor() = default; void AddCallback(Callback&& callback) { callbacks_.push_back(std::move(callback)); @@ -72,6 +71,9 @@ class ConnectivityMonitor { // Invokes callbacks only if the status changed. void MaybeInvokeCallbacks(NetworkStatus new_status); + // Invokes callbacks and sets net status to `new_status`. + void InvokeCallbacks(NetworkStatus new_status); + const std::shared_ptr& queue() { return worker_queue_; } @@ -86,4 +88,4 @@ class ConnectivityMonitor { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_CONNECTIVITY_MONITOR_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_CONNECTIVITY_MONITOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor_apple.mm new file mode 100644 index 000000000..33d6b7e95 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/connectivity_monitor_apple.mm @@ -0,0 +1,196 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/connectivity_monitor.h" + +#if defined(__APPLE__) + +#if TARGET_OS_IOS || TARGET_OS_TV +#import +#endif + +#include +#include +#include + +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace remote { + +namespace { + +using NetworkStatus = ConnectivityMonitor::NetworkStatus; +using util::AsyncQueue; + +NetworkStatus ToNetworkStatus(SCNetworkReachabilityFlags flags) { + if (!(flags & kSCNetworkReachabilityFlagsReachable)) { + return NetworkStatus::Unavailable; + } + if (flags & kSCNetworkReachabilityFlagsConnectionRequired) { + return NetworkStatus::Unavailable; + } + +#if TARGET_OS_IPHONE + if (flags & kSCNetworkReachabilityFlagsIsWWAN) { + return NetworkStatus::AvailableViaCellular; + } +#endif + return NetworkStatus::Available; +} + +SCNetworkReachabilityRef CreateReachability() { + // Pseudoaddress that monitors internet reachability in general. + sockaddr_in any_connection_addr{}; + any_connection_addr.sin_len = sizeof(any_connection_addr); + any_connection_addr.sin_family = AF_INET; + return SCNetworkReachabilityCreateWithAddress( + nullptr, reinterpret_cast(&any_connection_addr)); +} + +void OnReachabilityChangedCallback(SCNetworkReachabilityRef /*unused*/, + SCNetworkReachabilityFlags flags, + void* raw_this); + +} // namespace + +/** + * Implementation of `ConnectivityMonitor` based on `SCNetworkReachability` + * (iOS/MacOS). + */ +class ConnectivityMonitorApple : public ConnectivityMonitor { + public: + explicit ConnectivityMonitorApple( + const std::shared_ptr& worker_queue) + : ConnectivityMonitor{worker_queue} { + reachability_ = CreateReachability(); + if (!reachability_) { + LOG_DEBUG("Failed to create reachability monitor."); + return; + } + + SCNetworkReachabilityFlags flags{}; + if (SCNetworkReachabilityGetFlags(reachability_, &flags)) { + SetInitialStatus(ToNetworkStatus(flags)); + } + + SCNetworkReachabilityContext context{}; + context.info = this; + bool success = SCNetworkReachabilitySetCallback( + reachability_, OnReachabilityChangedCallback, &context); + if (!success) { + LOG_DEBUG("Couldn't set reachability callback"); + return; + } + + // It's okay to use the main queue for reachability events because they are + // fairly infrequent, and there's no good way to get the underlying dispatch + // queue out of the worker queue. The callback itself is still executed on + // the worker queue. + success = SCNetworkReachabilitySetDispatchQueue(reachability_, + dispatch_get_main_queue()); + if (!success) { + LOG_DEBUG("Couldn't set reachability queue"); + return; + } + +#if TARGET_OS_IOS || TARGET_OS_TV + this->observer_ = [[NSNotificationCenter defaultCenter] + addObserverForName:UIApplicationWillEnterForegroundNotification + object:nil + queue:[NSOperationQueue mainQueue] + usingBlock:^(NSNotification* note) { + this->OnEnteredForeground(); + }]; +#endif + } + + ~ConnectivityMonitorApple() { +#if TARGET_OS_IOS || TARGET_OS_TV + [[NSNotificationCenter defaultCenter] removeObserver:this->observer_]; +#endif + + if (reachability_) { + bool success = + SCNetworkReachabilitySetDispatchQueue(reachability_, nullptr); + if (!success) { + LOG_DEBUG("Couldn't unset reachability queue"); + } + + CFRelease(reachability_); + } + } + +#if TARGET_OS_IOS || TARGET_OS_TV + void OnEnteredForeground() { + SCNetworkReachabilityFlags flags{}; + if (!SCNetworkReachabilityGetFlags(reachability_, &flags)) return; + + queue()->Enqueue([this, flags] { + auto status = ToNetworkStatus(flags); + if (status != NetworkStatus::Unavailable) { + // There may have been network changes while Firestore was in the + // background for which we did not get OnReachabilityChangedCallback + // notifications. If entering the foreground and we have a connection, + // reset the connection to ensure that RPCs don't have to wait for TCP + // timeouts. + this->InvokeCallbacks(status); + } else { + this->MaybeInvokeCallbacks(status); + } + }); + } +#endif + + void OnReachabilityChanged(SCNetworkReachabilityFlags flags) { + queue()->Enqueue( + [this, flags] { MaybeInvokeCallbacks(ToNetworkStatus(flags)); }); + } + + private: + SCNetworkReachabilityRef reachability_ = nil; +#if TARGET_OS_IOS || TARGET_OS_TV + id observer_ = nil; +#endif +}; + +namespace { + +void OnReachabilityChangedCallback(SCNetworkReachabilityRef /*unused*/, + SCNetworkReachabilityFlags flags, + void* raw_this) { + HARD_ASSERT(raw_this, "Received a null pointer as context"); + static_cast(raw_this)->OnReachabilityChanged( + flags); +} + +} // namespace + +std::unique_ptr ConnectivityMonitor::Create( + const std::shared_ptr& worker_queue) { + return absl::make_unique(worker_queue); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // defined(__APPLE__) diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.cc new file mode 100644 index 000000000..7892a3a5d --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.cc @@ -0,0 +1,351 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/datastore.h" + +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/auth/token.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/remote/connectivity_monitor.h" +#include "Firestore/core/src/remote/grpc_completion.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/grpc_nanopb.h" +#include "Firestore/core/src/remote/grpc_stream.h" +#include "Firestore/core/src/remote/grpc_streaming_reader.h" +#include "Firestore/core/src/remote/grpc_unary_call.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/memory/memory.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace remote { +namespace { + +using auth::CredentialsProvider; +using auth::Token; +using core::DatabaseInfo; +using model::DocumentKey; +using model::MaybeDocument; +using model::Mutation; +using util::AsyncQueue; +using util::Executor; +using util::LogIsDebugEnabled; +using util::Status; +using util::StatusOr; + +const auto kRpcNameCommit = "/google.firestore.v1.Firestore/Commit"; +const auto kRpcNameLookup = "/google.firestore.v1.Firestore/BatchGetDocuments"; + +std::unique_ptr CreateExecutor() { + return Executor::CreateSerial("com.google.firebase.firestore.rpc"); +} + +std::string MakeString(grpc::string_ref grpc_str) { + return {grpc_str.begin(), grpc_str.size()}; +} + +absl::string_view MakeStringView(grpc::string_ref grpc_str) { + return {grpc_str.begin(), grpc_str.size()}; +} + +void LogGrpcCallFinished(absl::string_view rpc_name, + GrpcCall* call, + const Status& status) { + LOG_DEBUG("RPC %s completed. Error: %s: %s", rpc_name, status.code(), + status.error_message()); + if (LogIsDebugEnabled()) { + auto headers = + Datastore::GetWhitelistedHeadersAsString(call->GetResponseHeaders()); + LOG_DEBUG("RPC %s returned headers (whitelisted): %s", rpc_name, headers); + } +} + +} // namespace + +Datastore::Datastore(const DatabaseInfo& database_info, + const std::shared_ptr& worker_queue, + std::shared_ptr credentials, + ConnectivityMonitor* connectivity_monitor) + : worker_queue_{NOT_NULL(worker_queue)}, + credentials_{std::move(credentials)}, + rpc_executor_{CreateExecutor()}, + connectivity_monitor_{connectivity_monitor}, + grpc_connection_{database_info, worker_queue, &grpc_queue_, + connectivity_monitor_}, + datastore_serializer_{database_info} { + if (!database_info.ssl_enabled()) { + GrpcConnection::UseInsecureChannel(database_info.host()); + } +} + +void Datastore::Start() { + rpc_executor_->Execute([this] { PollGrpcQueue(); }); +} + +void Datastore::Shutdown() { + is_shut_down_ = true; + + // Order matters here: shutting down `grpc_connection_`, which will quickly + // finish any pending gRPC calls, must happen before shutting down the gRPC + // queue. + grpc_connection_.Shutdown(); + + // `grpc::CompletionQueue::Next` will only return `false` once `Shutdown` has + // been called and all submitted tags have been extracted. Without this call, + // `rpc_executor_` will never finish. + grpc_queue_.Shutdown(); + // Drain the executor to make sure it extracted all the operations from gRPC + // completion queue. + rpc_executor_->ExecuteBlocking([] {}); +} + +void Datastore::PollGrpcQueue() { + HARD_ASSERT(rpc_executor_->IsCurrentExecutor(), + "PollGrpcQueue should only be called on the " + "dedicated Datastore executor"); + + void* tag = nullptr; + bool ok = false; + while (grpc_queue_.Next(&tag, &ok)) { + auto completion = static_cast(tag); + // While it's valid in principle, we never deliberately pass a null pointer + // to gRPC completion queue and expect it back. This assertion might be + // relaxed if necessary. + HARD_ASSERT(tag, "gRPC queue returned a null tag"); + completion->Complete(ok); + } +} + +std::shared_ptr Datastore::CreateWatchStream( + WatchStreamCallback* callback) { + return std::make_shared(worker_queue_, credentials_, + datastore_serializer_.serializer(), + &grpc_connection_, callback); +} + +std::shared_ptr Datastore::CreateWriteStream( + WriteStreamCallback* callback) { + return std::make_shared(worker_queue_, credentials_, + datastore_serializer_.serializer(), + &grpc_connection_, callback); +} + +void Datastore::CommitMutations(const std::vector& mutations, + CommitCallback&& callback) { + ResumeRpcWithCredentials( + // TODO(c++14): move into lambda. + [this, mutations, + callback](const StatusOr& maybe_credentials) mutable { + if (!maybe_credentials.ok()) { + callback(maybe_credentials.status()); + return; + } + CommitMutationsWithCredentials(maybe_credentials.ValueOrDie(), + mutations, std::move(callback)); + }); +} + +void Datastore::CommitMutationsWithCredentials( + const Token& token, + const std::vector& mutations, + CommitCallback&& callback) { + grpc::ByteBuffer message = + MakeByteBuffer(datastore_serializer_.EncodeCommitRequest(mutations)); + + std::unique_ptr call_owning = grpc_connection_.CreateUnaryCall( + kRpcNameCommit, token, std::move(message)); + GrpcUnaryCall* call = call_owning.get(); + active_calls_.push_back(std::move(call_owning)); + + call->Start( + // TODO(c++14): move into lambda. + [this, call, callback](const StatusOr& result) { + LogGrpcCallFinished("CommitRequest", call, result.status()); + HandleCallStatus(result.status()); + + // Response is deliberately ignored + callback(result.status()); + + RemoveGrpcCall(call); + }); +} + +void Datastore::LookupDocuments(const std::vector& keys, + LookupCallback&& callback) { + ResumeRpcWithCredentials( + // TODO(c++14): move into lambda. + [this, keys, callback](const StatusOr& maybe_credentials) mutable { + if (!maybe_credentials.ok()) { + callback(maybe_credentials.status()); + return; + } + LookupDocumentsWithCredentials(maybe_credentials.ValueOrDie(), keys, + std::move(callback)); + }); +} + +void Datastore::LookupDocumentsWithCredentials( + const Token& token, + const std::vector& keys, + LookupCallback&& callback) { + grpc::ByteBuffer message = + MakeByteBuffer(datastore_serializer_.EncodeLookupRequest(keys)); + + std::unique_ptr call_owning = + grpc_connection_.CreateStreamingReader(kRpcNameLookup, token, + std::move(message)); + GrpcStreamingReader* call = call_owning.get(); + active_calls_.push_back(std::move(call_owning)); + + // TODO(c++14): move into lambda. + call->Start([this, call, callback]( + const StatusOr>& result) { + LogGrpcCallFinished("BatchGetDocuments", call, result.status()); + HandleCallStatus(result.status()); + + OnLookupDocumentsResponse(result, callback); + + RemoveGrpcCall(call); + }); +} + +void Datastore::OnLookupDocumentsResponse( + const StatusOr>& result, + const LookupCallback& callback) { + if (!result.ok()) { + callback(result.status()); + return; + } + + std::vector responses = std::move(result).ValueOrDie(); + callback(datastore_serializer_.MergeLookupResponses(responses)); +} + +void Datastore::ResumeRpcWithCredentials(const OnCredentials& on_credentials) { + // Auth may outlive Firestore + std::weak_ptr weak_this{shared_from_this()}; + + credentials_->GetToken( + [weak_this, on_credentials](const StatusOr& result) { + auto strong_this = weak_this.lock(); + if (!strong_this) { + return; + } + + strong_this->worker_queue_->EnqueueRelaxed( + [weak_this, result, on_credentials] { + auto strong_this = weak_this.lock(); + if (!strong_this) { + return; + } + // In case Auth callback is invoked after Datastore has been shut + // down. + if (strong_this->is_shut_down_) { + return; + } + + on_credentials(result); + }); + }); +} + +void Datastore::HandleCallStatus(const Status& status) { + if (status.code() == Error::kErrorUnauthenticated) { + credentials_->InvalidateToken(); + } +} + +void Datastore::RemoveGrpcCall(GrpcCall* to_remove) { + auto found = std::find_if(active_calls_.begin(), active_calls_.end(), + [to_remove](const std::unique_ptr& call) { + return call.get() == to_remove; + }); + HARD_ASSERT(found != active_calls_.end(), "Missing gRPC call"); + active_calls_.erase(found); +} + +bool Datastore::IsAbortedError(const Status& error) { + return error.code() == Error::kErrorAborted; +} + +bool Datastore::IsPermanentError(const Status& error) { + switch (error.code()) { + case Error::kErrorOk: + HARD_FAIL("Treated status OK as error"); + case Error::kErrorCancelled: + case Error::kErrorUnknown: + case Error::kErrorDeadlineExceeded: + case Error::kErrorResourceExhausted: + case Error::kErrorInternal: + case Error::kErrorUnavailable: + // Unauthenticated means something went wrong with our token and we need + // to retry with new credentials which will happen automatically. + case Error::kErrorUnauthenticated: + return false; + case Error::kErrorInvalidArgument: + case Error::kErrorNotFound: + case Error::kErrorAlreadyExists: + case Error::kErrorPermissionDenied: + case Error::kErrorFailedPrecondition: + case Error::kErrorAborted: + // Aborted might be retried in some scenarios, but that is dependant on + // the context and should handled individually by the calling code. + // See https://cloud.google.com/apis/design/errors + case Error::kErrorOutOfRange: + case Error::kErrorUnimplemented: + case Error::kErrorDataLoss: + return true; + } + + HARD_FAIL("Unknown status code: %s", error.code()); +} + +bool Datastore::IsPermanentWriteError(const Status& error) { + return IsPermanentError(error) && !IsAbortedError(error); +} + +std::string Datastore::GetWhitelistedHeadersAsString( + const GrpcCall::Metadata& headers) { + static std::unordered_set whitelist = { + "date", "x-google-backends", "x-google-netmon-label", "x-google-service", + "x-google-gfe-request-trace"}; + + std::string result; + for (const auto& kv : headers) { + if (whitelist.find(MakeString(kv.first)) != whitelist.end()) { + absl::StrAppend(&result, MakeStringView(kv.first), ": ", + MakeStringView(kv.second), "\n"); + } + } + return result; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/datastore.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.h similarity index 76% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/datastore.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.h index e5ff3d6ca..08d76cbb6 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/datastore.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/datastore.h @@ -14,30 +14,26 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_DATASTORE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_DATASTORE_H_ - -#if !defined(__OBJC__) -#error "This header only supports Objective-C++" -#endif // !defined(__OBJC__) +#ifndef FIRESTORE_CORE_SRC_REMOTE_DATASTORE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_DATASTORE_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/auth/token.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_call.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_stream.h" -#include "Firestore/core/src/firebase/firestore/remote/write_stream.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/auth/token.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/remote/grpc_call.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/remote_objc_bridge.h" +#include "Firestore/core/src/remote/watch_stream.h" +#include "Firestore/core/src/remote/write_stream.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/status_fwd.h" #include "absl/strings/string_view.h" #include "grpcpp/completion_queue.h" #include "grpcpp/support/status.h" @@ -46,6 +42,8 @@ namespace firebase { namespace firestore { namespace remote { +class ConnectivityMonitor; + /** * `Datastore` represents a proxy for the remote server, hiding details of the * RPC layer. It: @@ -63,17 +61,16 @@ namespace remote { */ class Datastore : public std::enable_shared_from_this { public: - // TODO(varconst): change this to take a single `StatusOr` parameter. using LookupCallback = std::function&, const util::Status&)>; + const util::StatusOr>&)>; using CommitCallback = std::function; Datastore(const core::DatabaseInfo& database_info, const std::shared_ptr& worker_queue, - std::shared_ptr credentials); + std::shared_ptr credentials, + ConnectivityMonitor* connectivity_monitor); - virtual ~Datastore() { - } + virtual ~Datastore() = default; /** Starts polling the gRPC completion queue. */ void Start(); @@ -133,12 +130,6 @@ class Datastore : public std::enable_shared_from_this { Datastore& operator=(Datastore&& other) = delete; protected: - /** Test-only constructor */ - Datastore(const core::DatabaseInfo& database_info, - const std::shared_ptr& worker_queue, - std::shared_ptr credentials, - std::unique_ptr connectivity_monitor); - /** Test-only method */ grpc::CompletionQueue* grpc_queue() { return &grpc_queue_; @@ -190,16 +181,15 @@ class Datastore : public std::enable_shared_from_this { // shared for all spawned gRPC streams and calls). std::unique_ptr rpc_executor_; grpc::CompletionQueue grpc_queue_; - // TODO(varconst): move `ConnectivityMonitor` to `FirestoreClient`. - std::unique_ptr connectivity_monitor_; + ConnectivityMonitor* connectivity_monitor_ = nullptr; GrpcConnection grpc_connection_; std::vector> active_calls_; - bridge::DatastoreSerializer serializer_bridge_; + DatastoreSerializer datastore_serializer_; }; } // namespace remote } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_DATASTORE_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_DATASTORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/existence_filter.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/existence_filter.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/existence_filter.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/existence_filter.h index 2f3de41b1..3f4019c89 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/existence_filter.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/existence_filter.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_EXISTENCE_FILTER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_EXISTENCE_FILTER_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_EXISTENCE_FILTER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_EXISTENCE_FILTER_H_ namespace firebase { namespace firestore { @@ -43,4 +43,4 @@ inline bool operator==(const ExistenceFilter& lhs, const ExistenceFilter& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_EXISTENCE_FILTER_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_EXISTENCE_FILTER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/exponential_backoff.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.cc similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/exponential_backoff.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.cc index 7239df9e6..bb78c9de1 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/exponential_backoff.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.cc @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/exponential_backoff.h" +#include "Firestore/core/src/remote/exponential_backoff.h" #include #include #include #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/exponential_backoff.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.h similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/exponential_backoff.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.h index bc27a83c4..5f628f43b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/exponential_backoff.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/exponential_backoff.h @@ -14,14 +14,14 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_EXPONENTIAL_BACKOFF_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_EXPONENTIAL_BACKOFF_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_EXPONENTIAL_BACKOFF_H_ +#define FIRESTORE_CORE_SRC_REMOTE_EXPONENTIAL_BACKOFF_H_ #include // NOLINT(build/c++11) #include -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/secure_random.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/secure_random.h" namespace firebase { namespace firestore { @@ -70,7 +70,7 @@ class ExponentialBackoff { /** * Resets the backoff delay. * - * The very next `backoffAndRun` will have no delay. If it is called again + * The very next `BackoffAndRun` will have no delay. If it is called again * (i.e. due to an error), `initial_delay` (plus jitter) will be used, and * subsequent ones will increase according to the `backoff_factor`. */ @@ -120,4 +120,4 @@ class ExponentialBackoff { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_EXPONENTIAL_BACKOFF_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_EXPONENTIAL_BACKOFF_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_call.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_call.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_call.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_call.h index 8c2b38e26..b80207634 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_call.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_call.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_CALL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_CALL_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_CALL_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_CALL_H_ #include -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/util/status_fwd.h" #include "grpcpp/client_context.h" #include "grpcpp/support/string_ref.h" @@ -37,8 +37,7 @@ class GrpcCall { public: using Metadata = std::multimap; - virtual ~GrpcCall() { - } + virtual ~GrpcCall() = default; /** * Returns the metadata received from the server. @@ -65,4 +64,4 @@ class GrpcCall { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_CALL_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_CALL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.cc new file mode 100644 index 000000000..a945b9e3d --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.cc @@ -0,0 +1,107 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/grpc_completion.h" + +#include +#include + +namespace firebase { +namespace firestore { +namespace remote { + +using util::AsyncQueue; + +std::shared_ptr GrpcCompletion::Create( + Type type, + const std::shared_ptr& worker_queue, + Callback&& callback) { + // Construct in two steps to use the private constructor. + GrpcCompletion partial(type, worker_queue, std::move(callback)); + auto completion = std::make_shared(std::move(partial)); + + // Prepare the `GrpcCompletion` for submission to gRPC. + // + // Note: this is done in a separate step because `shared_from_this` cannot be + // called in a constructor. + completion->grpc_ownership_ = completion; + + return completion; +} + +GrpcCompletion::GrpcCompletion( + Type type, + const std::shared_ptr& worker_queue, + Callback&& callback) + : worker_queue_{worker_queue}, callback_{std::move(callback)}, type_{type} { +} + +void GrpcCompletion::Cancel() { + worker_queue_->VerifyIsCurrentQueue(); + callback_ = {}; + + // Does not release grpc_ownership_. If gRPC still holds this completion it + // must remain valid to avoid a use-after-free once Complete is actually + // called. +} + +void GrpcCompletion::WaitUntilOffQueue() { + worker_queue_->VerifyIsCurrentQueue(); + + EnsureValidFuture(); + off_queue_future_.wait(); +} + +std::future_status GrpcCompletion::WaitUntilOffQueue( + std::chrono::milliseconds timeout) { + worker_queue_->VerifyIsCurrentQueue(); + + EnsureValidFuture(); + return off_queue_future_.wait_for(timeout); +} + +void GrpcCompletion::EnsureValidFuture() { + if (!off_queue_future_.valid()) { + off_queue_future_ = off_queue_.get_future(); + } +} + +void GrpcCompletion::Complete(bool ok) { + // This mechanism allows `GrpcStream` to know when the completion is off the + // gRPC completion queue (and thus no longer requires the underlying gRPC + // objects to be valid). + off_queue_.set_value(); + + // The queued operation needs to also retain this completion. It's possible + // for Complete to fire, shutdown to start, and then have this queued + // operation run. If this weren't a retain that ordering would have the + // callback use after free. + auto shared_this = grpc_ownership_; + worker_queue_->Enqueue([shared_this, ok] { + if (shared_this->callback_) { + shared_this->callback_(ok, shared_this); + } + }); + + // Having called Complete, gRPC has released its ownership interest in this + // object. Once the queued operation completes the `GrpcCompletion` will be + // deleted. + grpc_ownership_.reset(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.h new file mode 100644 index 000000000..e69d4ffd3 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_completion.h @@ -0,0 +1,165 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_COMPLETION_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_COMPLETION_H_ + +#include // NOLINT(build/c++11) +#include +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** + * A completion for a gRPC asynchronous operation that runs an arbitrary + * callback. + * + * All created `GrpcCompletion`s are expected to be put on the gRPC completion + * queue (as "tags"). `GrpcCompletion` expects that once it's received back from + * the gRPC completion queue, `Complete` will be called on it. `Complete` + * doesn't run the given callback immediately when taken off the queue; rather, + * it schedules running the callback on the worker queue. If the callback is no + * longer relevant, calling `Cancel` on the `GrpcCompletion` will turn the + * callback into a no-op. + * + * `GrpcCompletion` owns the objects that are used by gRPC operations for output + * (a `ByteBuffer` for reading a new message and a `Status` for finish + * operation). The buffer and/or the status may be unused by the corresponding + * gRPC operation. + * + * `GrpcCompletion` has shared ownership. While it has been submitted as a tag + * to a gRPC operation, gRPC owns it. Callers also potentially own the + * `GrpcCompletion` if they retain it. Once all interested parties have released + * their shared_ptrs, the `GrpcCompletion` is deleted. + * + * `GrpcCompletion` expects all gRPC objects pertaining to the current stream to + * remain valid until the `GrpcCompletion` comes back from the gRPC completion + * queue. + */ +class GrpcCompletion : public std::enable_shared_from_this { + public: + /** + * This is only to aid debugging and testing; type allows easily + * distinguishing between pending completions of a gRPC call. + */ + enum class Type { Start, Read, Write, Finish }; + + /** + * The boolean parameter is used to indicate whether the corresponding gRPC + * operation finished successfully or not. + * + * The `GrpcCompletion` pointer will always point to `this`. + */ + using Callback = + std::function&)>; + + static std::shared_ptr Create( + Type type, + const std::shared_ptr& worker_queue, + Callback&& callback); + + /** + * Marks the `GrpcCompletion` as having come back from the gRPC completion + * queue and puts notifying the observing stream on the Firestore async queue. + * The given `ok` value indicates whether the corresponding gRPC operation + * completed successfully. + * + * This function deletes the `GrpcCompletion`. + * + * Must be called outside of Firestore async queue. + */ + void Complete(bool ok); + + void Cancel(); + + /** + * Blocks until the `GrpcCompletion` comes back from the gRPC completion + * queue. It is important to only call this function when the `GrpcCompletion` + * is sure to come back from the queue quickly. + */ + void WaitUntilOffQueue(); + std::future_status WaitUntilOffQueue(std::chrono::milliseconds timeout); + + grpc::ByteBuffer* message() { + return &message_; + } + const grpc::ByteBuffer* message() const { + return &message_; + } + grpc::Status* status() { + return &status_; + } + const grpc::Status* status() const { + return &status_; + } + + Type type() const { + return type_; + } + + private: + GrpcCompletion(Type type, + const std::shared_ptr& worker_queue, + Callback&& callback); + + void EnsureValidFuture(); + + std::shared_ptr worker_queue_; + Callback callback_; + + // Ownership of the GrpcCompletion is shared between the Firestore gRPC + // wrapper object that initiated the operation (e.g., a `GrpcStream`) and gRPC + // itself, for as long as the completion is on the gRPC completion queue. + // While most of the time a completion gets removed from the gRPC completion + // queue first and then destroyed by the wrapper, during shutdown the gRPC + // wrapper can be destroyed first so in that case the completion needs to + // delete itself. + // + // To handle these two cases, `GrpcCompletion` is held by shared_ptr, and one + // shared_ptr is held here, within the `GrpcCompletion` itself to model gRPC's + // ownership. This works around a limitation in the gRPC API where it only + // accepts raw pointers for tag objects. Once this completion is completed, + // the grpc_ownership_ shared_ptr is reset, which models gRPC releasing its + // interest in the completion. + std::shared_ptr grpc_ownership_; + + // Note that even though `grpc::GenericClientAsyncReaderWriter::Write` takes + // the byte buffer by const reference, it expects the buffer's lifetime to + // extend beyond `Write` (the buffer must be valid until the completion queue + // returns the tag associated with the write, see + // https://github.com/grpc/grpc/issues/13019#issuecomment-336932929, #5). + grpc::ByteBuffer message_; + grpc::Status status_; + + std::promise off_queue_; + std::future off_queue_future_; + + Type type_{}; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_COMPLETION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.cc new file mode 100644 index 000000000..ca65fd637 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.cc @@ -0,0 +1,373 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/grpc_connection.h" + +#include +#include +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/include/firebase/firestore/firestore_version.h" +#include "Firestore/core/src/auth/token.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/remote/grpc_root_certificate_finder.h" +#include "Firestore/core/src/util/filesystem.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" +#include "Firestore/core/src/util/warnings.h" +#include "absl/memory/memory.h" +#include "absl/strings/str_cat.h" + +SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() +#include "grpcpp/create_channel.h" +#include "grpcpp/grpcpp.h" +SUPPRESS_END() + +namespace firebase { +namespace firestore { +namespace remote { + +using auth::Token; +using core::DatabaseInfo; +using model::DatabaseId; +using util::Filesystem; +using util::Path; +using util::Status; +using util::StatusOr; +using util::StringFormat; + +namespace { + +const char* const kAuthorizationHeader = "authorization"; +const char* const kXGoogAPIClientHeader = "x-goog-api-client"; +const char* const kGoogleCloudResourcePrefix = "google-cloud-resource-prefix"; + +std::string MakeString(absl::string_view view) { + return view.data() ? std::string{view.data(), view.size()} : std::string{}; +} + +std::shared_ptr CreateSslCredentials( + const std::string& certificate) { + grpc::SslCredentialsOptions options; + options.pem_root_certs = certificate; + return grpc::SslCredentials(options); +} + +struct HostConfig { + util::Path certificate_path; + std::string target_name; + bool use_insecure_channel = false; +}; + +class HostConfigMap { + using ConfigByHost = std::unordered_map; + using Guard = std::lock_guard; + + public: + /** + * Returns a pointer to the HostConfig entry for the given host or `nullptr` + * if there's no entry. + */ + const HostConfig* find(const std::string& host) const { + Guard guard{mutex_}; + auto iter = map_.find(host); + if (iter == map_.end()) { + return nullptr; + } else { + return &(iter->second); + } + } + + void UseTestCertificate(const std::string& host, + const Path& certificate_path, + const std::string& target_name) { + HARD_ASSERT(!host.empty(), "Empty host name"); + HARD_ASSERT(!certificate_path.native_value().empty(), + "Empty path to test certificate"); + HARD_ASSERT(!target_name.empty(), "Empty SSL target name"); + + Guard guard(mutex_); + HostConfig& host_config = map_[host]; + host_config.certificate_path = certificate_path; + host_config.target_name = target_name; + } + + void UseInsecureChannel(const std::string& host) { + HARD_ASSERT(!host.empty(), "Empty host name"); + + Guard guard(mutex_); + HostConfig& host_config = map_[host]; + host_config.use_insecure_channel = true; + } + + private: + ConfigByHost map_; + mutable std::mutex mutex_; +}; + +HostConfigMap& Config() { + static HostConfigMap config_by_host; + return config_by_host; +} + +std::string GetCppLanguageToken() { + const char* cpp_version = [] { + switch (__cplusplus) { + case 199711L: + return "1998"; + case 201103L: + return "2011"; + case 201402L: + return "2014"; + case 201703L: + return "2017"; + case 202002L: + return "2020"; + default: + return ""; + } + }(); + + return StringFormat("gl-cpp/%s", cpp_version); +} + +class ClientLanguageToken { + using Guard = std::lock_guard; + + public: + void Set(std::string value) { + Guard guard(mutex_); + value_ = std::move(value); + } + + const std::string& Get() const { + Guard guard(mutex_); + return value_; + } + + private: + std::string value_ = GetCppLanguageToken(); + mutable std::mutex mutex_; +}; + +ClientLanguageToken& LanguageToken() { + static ClientLanguageToken token; + return token; +} + +void AddCloudApiHeader(grpc::ClientContext& context) { + auto api_tokens = StringFormat("%s fire/%s grpc/%s", LanguageToken().Get(), + kFirestoreVersionString, grpc::Version()); + context.AddMetadata(kXGoogAPIClientHeader, api_tokens); +} + +#if __APPLE__ +// Disable CFStream-based transport on Apple platforms due to b/133182964, where +// CFStream will occasionally fail to raise a has-bytes-available events, +// causing Firestore to appear to hang. +// +// Use a constructor of a globally scoped object to set the `grpc_cfstream` +// environment variable before `main` is invoked. This should be early enough +// that it precedes any call of gRPC APIs. +class DisableGrpcCFStream { + public: + DisableGrpcCFStream() { + setenv("grpc_cfstream", "0", 1); + } +} disable; +#endif // __APPLE__ + +} // namespace + +GrpcConnection::GrpcConnection( + const DatabaseInfo& database_info, + const std::shared_ptr& worker_queue, + grpc::CompletionQueue* grpc_queue, + ConnectivityMonitor* connectivity_monitor) + : database_info_{&database_info}, + worker_queue_{NOT_NULL(worker_queue)}, + grpc_queue_{NOT_NULL(grpc_queue)}, + connectivity_monitor_{NOT_NULL(connectivity_monitor)} { + RegisterConnectivityMonitor(); +} + +void GrpcConnection::Shutdown() { + // Fast finish any pending calls. This will not trigger the observers. + // Calls may unregister themselves on finish, so make a protective copy. + auto active_calls = active_calls_; + for (GrpcCall* call : active_calls) { + call->FinishImmediately(); + } +} + +std::unique_ptr GrpcConnection::CreateContext( + const Token& credential) const { + absl::string_view token = credential.user().is_authenticated() + ? credential.token() + : absl::string_view{}; + + auto context = absl::make_unique(); + if (token.data()) { + context->AddMetadata(kAuthorizationHeader, absl::StrCat("Bearer ", token)); + } + + AddCloudApiHeader(*context); + + // This header is used to improve routing and project isolation by the + // backend. + const DatabaseId& db_id = database_info_->database_id(); + context->AddMetadata(kGoogleCloudResourcePrefix, + StringFormat("projects/%s/databases/%s", + db_id.project_id(), db_id.database_id())); + return context; +} + +void GrpcConnection::EnsureActiveStub() { + // TODO(varconst): find out in which cases a gRPC channel might shut down. + // This might be overkill. + if (!grpc_channel_ || grpc_channel_->GetState(/*try_to_connect=*/false) == + GRPC_CHANNEL_SHUTDOWN) { + LOG_DEBUG("Creating Firestore stub."); + grpc_channel_ = CreateChannel(); + grpc_stub_ = absl::make_unique(grpc_channel_); + } +} + +std::shared_ptr GrpcConnection::CreateChannel() const { + const std::string& host = database_info_->host(); + + grpc::ChannelArguments args; + // Ensure gRPC recovers from a dead connection. (Not typically necessary, as + // the OS will usually notify gRPC when a connection dies. But not always. + // This acts as a failsafe.) + args.SetInt(GRPC_ARG_KEEPALIVE_TIME_MS, 30 * 1000); + + const HostConfig* host_config = Config().find(host); + if (!host_config) { + std::string root_certificate = LoadGrpcRootCertificate(); + return grpc::CreateCustomChannel( + host, CreateSslCredentials(root_certificate), args); + } + + // For the case when `Settings.set_ssl_enabled(false)`. + if (host_config->use_insecure_channel) { + return grpc::CreateCustomChannel(host, grpc::InsecureChannelCredentials(), + args); + } + + // For tests only + auto* fs = Filesystem::Default(); + args.SetSslTargetNameOverride(host_config->target_name); + Path path = host_config->certificate_path; + StatusOr test_certificate = fs->ReadFile(path); + HARD_ASSERT(test_certificate.ok(), + StringFormat("Unable to open root certificates at file path %s", + path.ToUtf8String()) + .c_str()); + + return grpc::CreateCustomChannel( + host, CreateSslCredentials(test_certificate.ValueOrDie()), args); +} + +std::unique_ptr GrpcConnection::CreateStream( + absl::string_view rpc_name, + const Token& token, + GrpcStreamObserver* observer) { + EnsureActiveStub(); + + auto context = CreateContext(token); + auto call = + grpc_stub_->PrepareCall(context.get(), MakeString(rpc_name), grpc_queue_); + return absl::make_unique(std::move(context), std::move(call), + worker_queue_, this, observer); +} + +std::unique_ptr GrpcConnection::CreateUnaryCall( + absl::string_view rpc_name, + const Token& token, + const grpc::ByteBuffer& message) { + EnsureActiveStub(); + + auto context = CreateContext(token); + auto call = grpc_stub_->PrepareUnaryCall(context.get(), MakeString(rpc_name), + message, grpc_queue_); + return absl::make_unique(std::move(context), std::move(call), + worker_queue_, this, message); +} + +std::unique_ptr GrpcConnection::CreateStreamingReader( + absl::string_view rpc_name, + const Token& token, + const grpc::ByteBuffer& message) { + EnsureActiveStub(); + + auto context = CreateContext(token); + auto call = + grpc_stub_->PrepareCall(context.get(), MakeString(rpc_name), grpc_queue_); + return absl::make_unique( + std::move(context), std::move(call), worker_queue_, this, message); +} + +void GrpcConnection::RegisterConnectivityMonitor() { + connectivity_monitor_->AddCallback( + [this](ConnectivityMonitor::NetworkStatus /*ignored*/) { + // Calls may unregister themselves on finish, so make a protective copy. + auto calls = active_calls_; + for (GrpcCall* call : calls) { + // This will trigger the observers. + call->FinishAndNotify( + Status{Error::kErrorUnavailable, "Network connectivity changed"}); + } + // The old channel may hang for a long time trying to reestablish + // connection before eventually failing. Note that gRPC Objective-C + // client does the same thing: + // https://github.com/grpc/grpc/blob/fe11db09575f2dfbe1f88cd44bd417acc168e354/src/objective-c/GRPCClient/private/GRPCHost.m#L309-L314 + grpc_channel_.reset(); + }); +} + +void GrpcConnection::Register(GrpcCall* call) { + active_calls_.push_back(call); +} + +void GrpcConnection::Unregister(GrpcCall* call) { + auto found = std::find(active_calls_.begin(), active_calls_.end(), call); + HARD_ASSERT(found != active_calls_.end(), "Missing a gRPC call"); + active_calls_.erase(found); +} + +void GrpcConnection::SetClientLanguage(std::string language_token) { + LanguageToken().Set(std::move(language_token)); +} + +void GrpcConnection::UseInsecureChannel(const std::string& host) { + Config().UseInsecureChannel(host); +} + +void GrpcConnection::UseTestCertificate(const std::string& host, + const Path& certificate_path, + const std::string& target_name) { + Config().UseTestCertificate(host, certificate_path, target_name); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.h similarity index 79% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.h index 694e06a01..d2c649b39 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_connection.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_connection.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,29 +14,29 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_CONNECTION_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_CONNECTION_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_CONNECTION_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_CONNECTION_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/util/warnings.h" - -#include "Firestore/core/src/firebase/firestore/auth/token.h" -#include "Firestore/core/src/firebase/firestore/core/database_info.h" -#include "Firestore/core/src/firebase/firestore/remote/connectivity_monitor.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_call.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream_observer.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_unary_call.h" -#include "Firestore/core/src/firebase/firestore/util/path.h" +#include "Firestore/core/src/auth/token.h" +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/remote/connectivity_monitor.h" +#include "Firestore/core/src/remote/grpc_call.h" +#include "Firestore/core/src/remote/grpc_stream.h" +#include "Firestore/core/src/remote/grpc_stream_observer.h" +#include "Firestore/core/src/remote/grpc_streaming_reader.h" +#include "Firestore/core/src/remote/grpc_unary_call.h" +#include "Firestore/core/src/util/path.h" +#include "Firestore/core/src/util/warnings.h" #include "absl/strings/string_view.h" #include "grpcpp/channel.h" #include "grpcpp/client_context.h" #include "grpcpp/completion_queue.h" + SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() #include "grpcpp/generic/generic_stub.h" SUPPRESS_END() @@ -85,6 +85,8 @@ class GrpcConnection { void Register(GrpcCall* call); void Unregister(GrpcCall* call); + static void SetClientLanguage(std::string language_token); + /** * Don't use SSL, send all traffic unencrypted. Call before creating any * streams or calls. @@ -122,4 +124,4 @@ class GrpcConnection { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_CONNECTION_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_CONNECTION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.cc new file mode 100644 index 000000000..1b3004e95 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.cc @@ -0,0 +1,92 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/grpc_nanopb.h" + +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "Firestore/core/src/remote/grpc_util.h" +#include "Firestore/core/src/util/status.h" +#include "grpcpp/support/status.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using nanopb::ByteString; +using nanopb::ByteStringWriter; +using util::Status; + +ByteBufferReader::ByteBufferReader(const grpc::ByteBuffer& buffer) { + std::vector slices; + grpc::Status status = buffer.Dump(&slices); + // Conversion may fail if compression is used and gRPC tries to decompress an + // ill-formed buffer. + if (!status.ok()) { + Status error{Error::kErrorInternal, + "Trying to convert an invalid grpc::ByteBuffer"}; + error.CausedBy(ConvertStatus(status)); + set_status(error); + return; + } + + ByteStringWriter writer; + writer.Reserve(buffer.Length()); + for (const auto& slice : slices) { + writer.Append(slice.begin(), slice.size()); + } + + bytes_ = writer.Release(); + stream_ = pb_istream_from_buffer(bytes_.data(), bytes_.size()); +} + +void ByteBufferReader::Read(const pb_field_t* fields, void* dest_struct) { + if (!ok()) return; + + if (!pb_decode(&stream_, fields, dest_struct)) { + Fail(PB_GET_ERROR(&stream_)); + } +} + +namespace { + +bool AppendToGrpcBuffer(pb_ostream_t* stream, + const pb_byte_t* buf, + size_t count) { + auto buffer = static_cast*>(stream->state); + buffer->emplace_back(buf, count); + return true; +} + +} // namespace + +ByteBufferWriter::ByteBufferWriter() { + stream_.callback = AppendToGrpcBuffer; + stream_.state = &buffer_; + stream_.max_size = SIZE_MAX; +} + +grpc::ByteBuffer ByteBufferWriter::Release() { + grpc::ByteBuffer result{buffer_.data(), buffer_.size()}; + buffer_.clear(); + return result; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.h new file mode 100644 index 000000000..df9fae0f4 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_nanopb.h @@ -0,0 +1,79 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_NANOPB_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_NANOPB_H_ + +#include +#include + +#include + +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { +namespace remote { + +/** A `Reader` that reads from the given `grpc::ByteBuffer`. */ +class ByteBufferReader : public nanopb::Reader { + public: + /** + * Copies the given `buffer` and associates the resulting stream with this + * `ByteBufferReader`. + */ + // TODO(varconst): avoid copying the buffer. + explicit ByteBufferReader(const grpc::ByteBuffer& buffer); + + void Read(const pb_field_t* fields, void* dest_struct) override; + + private: + nanopb::ByteString bytes_; + pb_istream_t stream_{}; +}; + +/** A `Writer` that writes into a `grpc::ByteBuffer`. */ +class ByteBufferWriter : public nanopb::Writer { + public: + ByteBufferWriter(); + + grpc::ByteBuffer Release(); + + private: + std::vector buffer_; +}; + +/** + * Serializes the given `message` into a `grpc::ByteBuffer`. + * + * The lifetime of the return value is entirely independent of the `message`. + */ +template +grpc::ByteBuffer MakeByteBuffer(const nanopb::Message& message) { + ByteBufferWriter writer; + writer.Write(message.fields(), message.get()); + return writer.Release(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_NANOPB_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder.h similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder.h index 2d1104eae..3cc7db1de 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_root_certificate_finder.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ #include -#include "Firestore/core/src/firebase/firestore/util/path.h" +#include "Firestore/core/src/util/path.h" namespace firebase { namespace firestore { @@ -36,4 +36,4 @@ std::string LoadGrpcRootCertificate(); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATE_FINDER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder_generated.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder_generated.cc new file mode 100644 index 000000000..1c10eea56 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificate_finder_generated.cc @@ -0,0 +1,38 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * This implementation presumes that `roots.pem` has been embedded into the + * binary during the build and is accessible as a char array named + * `grpc_root_certificates`. + */ + +#include "Firestore/core/src/remote/grpc_root_certificate_finder.h" + +#include "Firestore/core/src/remote/grpc_root_certificates_generated.h" + +namespace firebase { +namespace firestore { +namespace remote { + +std::string LoadGrpcRootCertificate() { + return {reinterpret_cast(grpc_root_certificates_generated_data), + grpc_root_certificates_generated_size}; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.cc new file mode 100644 index 000000000..cc73bd74f --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.cc @@ -0,0 +1,23712 @@ +// Copyright 2019 Google Inc. All Rights Reserved. + +#include "Firestore/core/src/remote/grpc_root_certificates_generated.h" + +#include + +namespace firebase { +namespace firestore { +namespace remote { + +extern const size_t grpc_root_certificates_generated_size; +extern const char roots_filename[]; +extern const unsigned char grpc_root_certificates_generated_data[]; + +const unsigned char grpc_root_certificates_generated_data[] = { + 0x23, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x20, 0x43, 0x6f, 0x64, 0x65, 0x20, 0x46, 0x6f, 0x72, 0x6d, 0x20, + 0x69, 0x73, 0x20, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x74, + 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x20, + 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4d, 0x6f, 0x7a, 0x69, 0x6c, + 0x6c, 0x61, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x0a, 0x23, 0x20, + 0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x2c, 0x20, 0x76, 0x2e, 0x20, + 0x32, 0x2e, 0x30, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x61, 0x20, 0x63, 0x6f, + 0x70, 0x79, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4d, 0x50, + 0x4c, 0x20, 0x77, 0x61, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x64, 0x69, + 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, + 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x0a, 0x23, 0x20, 0x66, 0x69, + 0x6c, 0x65, 0x2c, 0x20, 0x59, 0x6f, 0x75, 0x20, 0x63, 0x61, 0x6e, 0x20, + 0x6f, 0x62, 0x74, 0x61, 0x69, 0x6e, 0x20, 0x6f, 0x6e, 0x65, 0x20, 0x61, + 0x74, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x6d, 0x6f, 0x7a, + 0x69, 0x6c, 0x6c, 0x61, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x4d, 0x50, 0x4c, + 0x2f, 0x32, 0x2e, 0x30, 0x2f, 0x2e, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x6e, 0x76, 0x2d, 0x73, 0x61, 0x20, 0x4f, + 0x55, 0x3d, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x6e, 0x76, 0x2d, 0x73, + 0x61, 0x20, 0x4f, 0x55, 0x3d, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x38, 0x33, 0x35, 0x37, 0x30, 0x33, + 0x32, 0x37, 0x38, 0x34, 0x35, 0x39, 0x37, 0x30, 0x37, 0x36, 0x36, 0x39, + 0x30, 0x30, 0x35, 0x32, 0x30, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x33, 0x65, 0x3a, 0x34, 0x35, 0x3a, 0x35, 0x32, 0x3a, 0x31, + 0x35, 0x3a, 0x30, 0x39, 0x3a, 0x35, 0x31, 0x3a, 0x39, 0x32, 0x3a, 0x65, + 0x31, 0x3a, 0x62, 0x37, 0x3a, 0x35, 0x64, 0x3a, 0x33, 0x37, 0x3a, 0x39, + 0x66, 0x3a, 0x62, 0x31, 0x3a, 0x38, 0x37, 0x3a, 0x32, 0x39, 0x3a, 0x38, + 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x31, + 0x3a, 0x62, 0x63, 0x3a, 0x39, 0x36, 0x3a, 0x38, 0x62, 0x3a, 0x64, 0x34, + 0x3a, 0x66, 0x34, 0x3a, 0x39, 0x64, 0x3a, 0x36, 0x32, 0x3a, 0x32, 0x61, + 0x3a, 0x61, 0x38, 0x3a, 0x39, 0x61, 0x3a, 0x38, 0x31, 0x3a, 0x66, 0x32, + 0x3a, 0x31, 0x35, 0x3a, 0x30, 0x31, 0x3a, 0x35, 0x32, 0x3a, 0x61, 0x34, + 0x3a, 0x31, 0x64, 0x3a, 0x38, 0x32, 0x3a, 0x39, 0x63, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x62, 0x3a, 0x64, + 0x34, 0x3a, 0x31, 0x30, 0x3a, 0x34, 0x30, 0x3a, 0x65, 0x34, 0x3a, 0x62, + 0x62, 0x3a, 0x33, 0x65, 0x3a, 0x63, 0x37, 0x3a, 0x34, 0x32, 0x3a, 0x63, + 0x39, 0x3a, 0x65, 0x33, 0x3a, 0x38, 0x31, 0x3a, 0x64, 0x33, 0x3a, 0x31, + 0x65, 0x3a, 0x66, 0x32, 0x3a, 0x61, 0x34, 0x3a, 0x31, 0x61, 0x3a, 0x34, + 0x38, 0x3a, 0x62, 0x36, 0x3a, 0x36, 0x38, 0x3a, 0x35, 0x63, 0x3a, 0x39, + 0x36, 0x3a, 0x65, 0x37, 0x3a, 0x63, 0x65, 0x3a, 0x66, 0x33, 0x3a, 0x63, + 0x31, 0x3a, 0x64, 0x66, 0x3a, 0x36, 0x63, 0x3a, 0x64, 0x34, 0x3a, 0x33, + 0x33, 0x3a, 0x31, 0x63, 0x3a, 0x39, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x44, 0x64, 0x54, 0x43, 0x43, 0x41, 0x6c, 0x32, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4c, 0x42, 0x41, 0x41, 0x41, + 0x41, 0x41, 0x41, 0x42, 0x46, 0x55, 0x74, 0x61, 0x77, 0x35, 0x51, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x56, 0x7a, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x51, 0x6b, 0x55, 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x54, 0x45, 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, + 0x68, 0x62, 0x46, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x62, 0x6e, 0x59, + 0x74, 0x63, 0x32, 0x45, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x73, 0x54, 0x42, 0x31, 0x4a, 0x76, 0x0a, 0x62, 0x33, + 0x51, 0x67, 0x51, 0x30, 0x45, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x45, 0x6b, 0x64, 0x73, 0x62, 0x32, + 0x4a, 0x68, 0x62, 0x46, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x55, 0x6d, + 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, 0x41, 0x65, 0x46, 0x77, + 0x30, 0x35, 0x4f, 0x44, 0x41, 0x35, 0x4d, 0x44, 0x45, 0x78, 0x4d, 0x6a, + 0x41, 0x77, 0x0a, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, 0x79, 0x4f, + 0x44, 0x41, 0x78, 0x4d, 0x6a, 0x67, 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x4d, + 0x44, 0x42, 0x61, 0x4d, 0x46, 0x63, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x4a, 0x46, 0x4d, + 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, + 0x78, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x0a, 0x59, 0x57, 0x78, 0x54, + 0x61, 0x57, 0x64, 0x75, 0x49, 0x47, 0x35, 0x32, 0x4c, 0x58, 0x4e, 0x68, + 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, + 0x45, 0x77, 0x64, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, + 0x4d, 0x52, 0x73, 0x77, 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x45, 0x78, 0x4a, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x54, + 0x0a, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, + 0x67, 0x51, 0x30, 0x45, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, + 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x44, + 0x61, 0x44, 0x75, 0x61, 0x5a, 0x0a, 0x6a, 0x63, 0x36, 0x6a, 0x34, 0x30, + 0x2b, 0x4b, 0x66, 0x76, 0x76, 0x78, 0x69, 0x34, 0x4d, 0x6c, 0x61, 0x2b, + 0x70, 0x49, 0x48, 0x2f, 0x45, 0x71, 0x73, 0x4c, 0x6d, 0x56, 0x45, 0x51, + 0x53, 0x39, 0x38, 0x47, 0x50, 0x52, 0x34, 0x6d, 0x64, 0x6d, 0x7a, 0x78, + 0x7a, 0x64, 0x7a, 0x78, 0x74, 0x49, 0x4b, 0x2b, 0x36, 0x4e, 0x69, 0x59, + 0x36, 0x61, 0x72, 0x79, 0x6d, 0x41, 0x5a, 0x61, 0x76, 0x70, 0x0a, 0x78, + 0x79, 0x30, 0x53, 0x79, 0x36, 0x73, 0x63, 0x54, 0x48, 0x41, 0x48, 0x6f, + 0x54, 0x30, 0x4b, 0x4d, 0x4d, 0x30, 0x56, 0x6a, 0x55, 0x2f, 0x34, 0x33, + 0x64, 0x53, 0x4d, 0x55, 0x42, 0x55, 0x63, 0x37, 0x31, 0x44, 0x75, 0x78, + 0x43, 0x37, 0x33, 0x2f, 0x4f, 0x6c, 0x53, 0x38, 0x70, 0x46, 0x39, 0x34, + 0x47, 0x33, 0x56, 0x4e, 0x54, 0x43, 0x4f, 0x58, 0x6b, 0x4e, 0x7a, 0x38, + 0x6b, 0x48, 0x70, 0x0a, 0x31, 0x57, 0x72, 0x6a, 0x73, 0x6f, 0x6b, 0x36, + 0x56, 0x6a, 0x6b, 0x34, 0x62, 0x77, 0x59, 0x38, 0x69, 0x47, 0x6c, 0x62, + 0x4b, 0x6b, 0x33, 0x46, 0x70, 0x31, 0x53, 0x34, 0x62, 0x49, 0x6e, 0x4d, + 0x6d, 0x2f, 0x6b, 0x38, 0x79, 0x75, 0x58, 0x39, 0x69, 0x66, 0x55, 0x53, + 0x50, 0x4a, 0x4a, 0x34, 0x6c, 0x74, 0x62, 0x63, 0x64, 0x47, 0x36, 0x54, + 0x52, 0x47, 0x48, 0x52, 0x6a, 0x63, 0x64, 0x47, 0x0a, 0x73, 0x6e, 0x55, + 0x4f, 0x68, 0x75, 0x67, 0x5a, 0x69, 0x74, 0x56, 0x74, 0x62, 0x4e, 0x56, + 0x34, 0x46, 0x70, 0x57, 0x69, 0x36, 0x63, 0x67, 0x4b, 0x4f, 0x4f, 0x76, + 0x79, 0x4a, 0x42, 0x4e, 0x50, 0x63, 0x31, 0x53, 0x54, 0x45, 0x34, 0x55, + 0x36, 0x47, 0x37, 0x77, 0x65, 0x4e, 0x4c, 0x57, 0x4c, 0x42, 0x59, 0x79, + 0x35, 0x64, 0x34, 0x75, 0x78, 0x32, 0x78, 0x38, 0x67, 0x6b, 0x61, 0x73, + 0x4a, 0x0a, 0x55, 0x32, 0x36, 0x51, 0x7a, 0x6e, 0x73, 0x33, 0x64, 0x4c, + 0x6c, 0x77, 0x52, 0x35, 0x45, 0x69, 0x55, 0x57, 0x4d, 0x57, 0x65, 0x61, + 0x36, 0x78, 0x72, 0x6b, 0x45, 0x6d, 0x43, 0x4d, 0x67, 0x5a, 0x4b, 0x39, + 0x46, 0x47, 0x71, 0x6b, 0x6a, 0x57, 0x5a, 0x43, 0x72, 0x58, 0x67, 0x7a, + 0x54, 0x2f, 0x4c, 0x43, 0x72, 0x42, 0x62, 0x42, 0x6c, 0x44, 0x53, 0x67, + 0x65, 0x46, 0x35, 0x39, 0x4e, 0x38, 0x0a, 0x39, 0x69, 0x46, 0x6f, 0x37, + 0x2b, 0x72, 0x79, 0x55, 0x70, 0x39, 0x2f, 0x6b, 0x35, 0x44, 0x50, 0x41, + 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, + 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x50, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x0a, + 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, 0x30, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x67, + 0x65, 0x32, 0x59, 0x61, 0x52, 0x51, 0x32, 0x58, 0x79, 0x6f, 0x6c, 0x51, + 0x4c, 0x33, 0x30, 0x45, 0x7a, 0x54, 0x53, 0x6f, 0x2f, 0x2f, 0x7a, 0x39, + 0x53, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x0a, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, + 0x43, 0x41, 0x51, 0x45, 0x41, 0x31, 0x6e, 0x50, 0x6e, 0x66, 0x45, 0x39, + 0x32, 0x30, 0x49, 0x32, 0x2f, 0x37, 0x4c, 0x71, 0x69, 0x76, 0x6a, 0x54, + 0x46, 0x4b, 0x44, 0x4b, 0x31, 0x66, 0x50, 0x78, 0x73, 0x6e, 0x43, 0x77, + 0x72, 0x76, 0x51, 0x6d, 0x65, 0x55, 0x37, 0x39, 0x72, 0x58, 0x71, 0x6f, + 0x52, 0x53, 0x4c, 0x62, 0x6c, 0x43, 0x4b, 0x4f, 0x7a, 0x0a, 0x79, 0x6a, + 0x31, 0x68, 0x54, 0x64, 0x4e, 0x47, 0x43, 0x62, 0x4d, 0x2b, 0x77, 0x36, + 0x44, 0x6a, 0x59, 0x31, 0x55, 0x62, 0x38, 0x72, 0x72, 0x76, 0x72, 0x54, + 0x6e, 0x68, 0x51, 0x37, 0x6b, 0x34, 0x6f, 0x2b, 0x59, 0x76, 0x69, 0x69, + 0x59, 0x37, 0x37, 0x36, 0x42, 0x51, 0x56, 0x76, 0x6e, 0x47, 0x43, 0x76, + 0x30, 0x34, 0x7a, 0x63, 0x51, 0x4c, 0x63, 0x46, 0x47, 0x55, 0x6c, 0x35, + 0x67, 0x45, 0x0a, 0x33, 0x38, 0x4e, 0x66, 0x6c, 0x4e, 0x55, 0x56, 0x79, + 0x52, 0x52, 0x42, 0x6e, 0x4d, 0x52, 0x64, 0x64, 0x57, 0x51, 0x56, 0x44, + 0x66, 0x39, 0x56, 0x4d, 0x4f, 0x79, 0x47, 0x6a, 0x2f, 0x38, 0x4e, 0x37, + 0x79, 0x79, 0x35, 0x59, 0x30, 0x62, 0x32, 0x71, 0x76, 0x7a, 0x66, 0x76, + 0x47, 0x6e, 0x39, 0x4c, 0x68, 0x4a, 0x49, 0x5a, 0x4a, 0x72, 0x67, 0x6c, + 0x66, 0x43, 0x6d, 0x37, 0x79, 0x6d, 0x50, 0x0a, 0x41, 0x62, 0x45, 0x56, + 0x74, 0x51, 0x77, 0x64, 0x70, 0x66, 0x35, 0x70, 0x4c, 0x47, 0x6b, 0x6b, + 0x65, 0x42, 0x36, 0x7a, 0x70, 0x78, 0x78, 0x78, 0x59, 0x75, 0x37, 0x4b, + 0x79, 0x4a, 0x65, 0x73, 0x46, 0x31, 0x32, 0x4b, 0x77, 0x76, 0x68, 0x48, + 0x68, 0x6d, 0x34, 0x71, 0x78, 0x46, 0x59, 0x78, 0x6c, 0x64, 0x42, 0x6e, + 0x69, 0x59, 0x55, 0x72, 0x2b, 0x57, 0x79, 0x6d, 0x58, 0x55, 0x61, 0x64, + 0x0a, 0x44, 0x4b, 0x71, 0x43, 0x35, 0x4a, 0x6c, 0x52, 0x33, 0x58, 0x43, + 0x33, 0x32, 0x31, 0x59, 0x39, 0x59, 0x65, 0x52, 0x71, 0x34, 0x56, 0x7a, + 0x57, 0x39, 0x76, 0x34, 0x39, 0x33, 0x6b, 0x48, 0x4d, 0x42, 0x36, 0x35, + 0x6a, 0x55, 0x72, 0x39, 0x54, 0x55, 0x2f, 0x51, 0x72, 0x36, 0x63, 0x66, + 0x39, 0x74, 0x76, 0x65, 0x43, 0x58, 0x34, 0x58, 0x53, 0x51, 0x52, 0x6a, + 0x62, 0x67, 0x62, 0x4d, 0x45, 0x0a, 0x48, 0x4d, 0x55, 0x66, 0x70, 0x49, + 0x42, 0x76, 0x46, 0x53, 0x44, 0x4a, 0x33, 0x67, 0x79, 0x49, 0x43, 0x68, + 0x33, 0x57, 0x5a, 0x6c, 0x58, 0x69, 0x2f, 0x45, 0x6a, 0x4a, 0x4b, 0x53, + 0x5a, 0x70, 0x34, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x3d, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, + 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, + 0x32, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x2d, 0x20, 0x52, 0x32, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x2d, 0x20, 0x52, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x38, 0x33, 0x35, 0x37, 0x30, 0x33, 0x32, + 0x37, 0x38, 0x34, 0x35, 0x39, 0x36, 0x38, 0x32, 0x38, 0x38, 0x35, 0x36, + 0x35, 0x38, 0x31, 0x32, 0x35, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x39, 0x34, 0x3a, 0x31, 0x34, 0x3a, 0x37, 0x37, 0x3a, 0x37, 0x65, + 0x3a, 0x33, 0x65, 0x3a, 0x35, 0x65, 0x3a, 0x66, 0x64, 0x3a, 0x38, 0x66, + 0x3a, 0x33, 0x30, 0x3a, 0x62, 0x64, 0x3a, 0x34, 0x31, 0x3a, 0x62, 0x30, + 0x3a, 0x63, 0x66, 0x3a, 0x65, 0x37, 0x3a, 0x64, 0x30, 0x3a, 0x33, 0x30, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x35, 0x3a, + 0x65, 0x30, 0x3a, 0x61, 0x62, 0x3a, 0x62, 0x36, 0x3a, 0x31, 0x33, 0x3a, + 0x38, 0x35, 0x3a, 0x31, 0x32, 0x3a, 0x32, 0x37, 0x3a, 0x31, 0x63, 0x3a, + 0x30, 0x34, 0x3a, 0x66, 0x38, 0x3a, 0x35, 0x66, 0x3a, 0x64, 0x64, 0x3a, + 0x64, 0x65, 0x3a, 0x33, 0x38, 0x3a, 0x65, 0x34, 0x3a, 0x62, 0x37, 0x3a, + 0x32, 0x34, 0x3a, 0x32, 0x65, 0x3a, 0x66, 0x65, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x61, 0x3a, 0x34, 0x32, + 0x3a, 0x64, 0x64, 0x3a, 0x34, 0x31, 0x3a, 0x37, 0x34, 0x3a, 0x35, 0x66, + 0x3a, 0x64, 0x30, 0x3a, 0x62, 0x38, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x39, + 0x3a, 0x30, 0x32, 0x3a, 0x33, 0x36, 0x3a, 0x32, 0x63, 0x3a, 0x66, 0x39, + 0x3a, 0x64, 0x38, 0x3a, 0x62, 0x66, 0x3a, 0x37, 0x31, 0x3a, 0x39, 0x64, + 0x3a, 0x61, 0x31, 0x3a, 0x62, 0x64, 0x3a, 0x31, 0x62, 0x3a, 0x31, 0x65, + 0x3a, 0x66, 0x63, 0x3a, 0x39, 0x34, 0x3a, 0x36, 0x66, 0x3a, 0x35, 0x62, + 0x3a, 0x34, 0x63, 0x3a, 0x39, 0x39, 0x3a, 0x66, 0x34, 0x3a, 0x32, 0x63, + 0x3a, 0x31, 0x62, 0x3a, 0x39, 0x65, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x44, 0x75, 0x6a, 0x43, 0x43, 0x41, 0x71, 0x4b, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4c, 0x42, 0x41, 0x41, 0x41, 0x41, + 0x41, 0x41, 0x42, 0x44, 0x34, 0x59, 0x6d, 0x35, 0x67, 0x30, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x54, 0x44, 0x45, 0x67, 0x4d, + 0x42, 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x58, + 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, + 0x62, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, + 0x49, 0x43, 0x30, 0x67, 0x55, 0x6a, 0x49, 0x78, 0x45, 0x7a, 0x41, 0x52, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, 0x6b, 0x64, 0x73, + 0x62, 0x32, 0x4a, 0x68, 0x62, 0x46, 0x4e, 0x70, 0x0a, 0x5a, 0x32, 0x34, + 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x54, 0x43, 0x6b, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x46, 0x4e, + 0x70, 0x5a, 0x32, 0x34, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x59, + 0x78, 0x4d, 0x6a, 0x45, 0x31, 0x4d, 0x44, 0x67, 0x77, 0x4d, 0x44, 0x41, + 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x45, 0x78, 0x4d, 0x6a, 0x45, + 0x31, 0x0a, 0x4d, 0x44, 0x67, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, + 0x42, 0x4d, 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x78, 0x64, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, + 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, 0x53, 0x42, 0x53, 0x4d, 0x6a, + 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x4b, 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, + 0x32, 0x6c, 0x6e, 0x62, 0x6a, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4b, 0x52, 0x32, 0x78, 0x76, 0x59, + 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x6a, 0x43, 0x43, 0x41, + 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x0a, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x4b, 0x62, 0x50, 0x4a, 0x41, 0x36, 0x2b, + 0x4c, 0x6d, 0x38, 0x6f, 0x6d, 0x55, 0x56, 0x43, 0x78, 0x4b, 0x73, 0x2b, + 0x49, 0x56, 0x53, 0x62, 0x43, 0x39, 0x4e, 0x2f, 0x68, 0x48, 0x44, 0x36, + 0x45, 0x72, 0x50, 0x4c, 0x0a, 0x76, 0x34, 0x64, 0x66, 0x78, 0x6e, 0x2b, + 0x47, 0x30, 0x37, 0x49, 0x77, 0x58, 0x4e, 0x62, 0x39, 0x72, 0x66, 0x46, + 0x37, 0x33, 0x4f, 0x58, 0x34, 0x59, 0x4a, 0x59, 0x4a, 0x6b, 0x68, 0x44, + 0x31, 0x30, 0x46, 0x50, 0x65, 0x2b, 0x33, 0x74, 0x2b, 0x63, 0x34, 0x69, + 0x73, 0x55, 0x6f, 0x68, 0x37, 0x53, 0x71, 0x62, 0x4b, 0x53, 0x61, 0x5a, + 0x65, 0x71, 0x4b, 0x65, 0x4d, 0x57, 0x68, 0x47, 0x38, 0x0a, 0x65, 0x6f, + 0x4c, 0x72, 0x76, 0x6f, 0x7a, 0x70, 0x73, 0x36, 0x79, 0x57, 0x4a, 0x51, + 0x65, 0x58, 0x53, 0x70, 0x6b, 0x71, 0x42, 0x79, 0x2b, 0x30, 0x48, 0x6e, + 0x65, 0x2f, 0x69, 0x67, 0x2b, 0x31, 0x41, 0x6e, 0x77, 0x62, 0x6c, 0x72, + 0x6a, 0x46, 0x75, 0x54, 0x6f, 0x73, 0x76, 0x4e, 0x59, 0x53, 0x75, 0x65, + 0x74, 0x5a, 0x66, 0x65, 0x4c, 0x51, 0x42, 0x6f, 0x5a, 0x66, 0x58, 0x6b, + 0x6c, 0x71, 0x0a, 0x74, 0x54, 0x6c, 0x65, 0x69, 0x44, 0x54, 0x73, 0x76, + 0x48, 0x67, 0x4d, 0x43, 0x4a, 0x69, 0x45, 0x62, 0x4b, 0x6a, 0x4e, 0x53, + 0x37, 0x53, 0x67, 0x66, 0x51, 0x78, 0x35, 0x54, 0x66, 0x43, 0x34, 0x4c, + 0x63, 0x73, 0x68, 0x79, 0x74, 0x56, 0x73, 0x57, 0x33, 0x33, 0x68, 0x6f, + 0x43, 0x6d, 0x45, 0x6f, 0x66, 0x6e, 0x54, 0x6c, 0x45, 0x6e, 0x4c, 0x4a, + 0x47, 0x4b, 0x52, 0x49, 0x4c, 0x7a, 0x64, 0x0a, 0x43, 0x39, 0x58, 0x5a, + 0x7a, 0x50, 0x6e, 0x71, 0x4a, 0x77, 0x6f, 0x72, 0x63, 0x35, 0x48, 0x47, + 0x6e, 0x52, 0x75, 0x73, 0x79, 0x4d, 0x76, 0x6f, 0x34, 0x4b, 0x44, 0x30, + 0x4c, 0x35, 0x43, 0x4c, 0x54, 0x66, 0x75, 0x77, 0x4e, 0x68, 0x76, 0x32, + 0x47, 0x58, 0x71, 0x46, 0x34, 0x47, 0x33, 0x79, 0x59, 0x52, 0x4f, 0x49, + 0x58, 0x4a, 0x2f, 0x67, 0x6b, 0x77, 0x70, 0x52, 0x6c, 0x34, 0x70, 0x61, + 0x0a, 0x7a, 0x71, 0x2b, 0x72, 0x31, 0x66, 0x65, 0x71, 0x43, 0x61, 0x70, + 0x67, 0x76, 0x64, 0x7a, 0x5a, 0x58, 0x39, 0x39, 0x79, 0x71, 0x57, 0x41, + 0x54, 0x58, 0x67, 0x41, 0x42, 0x79, 0x55, 0x72, 0x36, 0x50, 0x36, 0x54, + 0x71, 0x42, 0x77, 0x4d, 0x68, 0x41, 0x6f, 0x36, 0x43, 0x79, 0x67, 0x50, + 0x43, 0x6d, 0x34, 0x38, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, + 0x42, 0x6e, 0x44, 0x43, 0x42, 0x0a, 0x6d, 0x54, 0x41, 0x4f, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, + 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, + 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x6d, 0x2b, 0x49, 0x48, 0x0a, 0x56, + 0x32, 0x63, 0x63, 0x48, 0x73, 0x42, 0x71, 0x42, 0x74, 0x35, 0x5a, 0x74, + 0x4a, 0x6f, 0x74, 0x33, 0x39, 0x77, 0x5a, 0x68, 0x69, 0x34, 0x77, 0x4e, + 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x66, 0x42, 0x43, 0x38, 0x77, 0x4c, + 0x54, 0x41, 0x72, 0x6f, 0x43, 0x6d, 0x67, 0x4a, 0x34, 0x59, 0x6c, 0x61, + 0x48, 0x52, 0x30, 0x63, 0x44, 0x6f, 0x76, 0x4c, 0x32, 0x4e, 0x79, 0x62, + 0x43, 0x35, 0x6e, 0x0a, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x7a, + 0x61, 0x57, 0x64, 0x75, 0x4c, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x39, 0x79, + 0x62, 0x32, 0x39, 0x30, 0x4c, 0x58, 0x49, 0x79, 0x4c, 0x6d, 0x4e, 0x79, + 0x62, 0x44, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, + 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, 0x53, 0x62, 0x34, 0x67, 0x64, 0x58, + 0x5a, 0x78, 0x77, 0x65, 0x77, 0x47, 0x6f, 0x47, 0x0a, 0x33, 0x6c, 0x6d, + 0x30, 0x6d, 0x69, 0x33, 0x66, 0x33, 0x42, 0x6d, 0x47, 0x4c, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, + 0x41, 0x6d, 0x59, 0x46, 0x54, 0x68, 0x78, 0x78, 0x6f, 0x6c, 0x34, 0x61, + 0x52, 0x37, 0x4f, 0x42, 0x4b, 0x75, 0x45, 0x51, 0x4c, 0x71, 0x34, 0x47, + 0x73, 0x0a, 0x4a, 0x30, 0x2f, 0x57, 0x77, 0x62, 0x67, 0x63, 0x51, 0x33, + 0x69, 0x7a, 0x44, 0x4a, 0x72, 0x38, 0x36, 0x69, 0x77, 0x38, 0x62, 0x6d, + 0x45, 0x62, 0x54, 0x55, 0x73, 0x70, 0x39, 0x5a, 0x38, 0x46, 0x48, 0x53, + 0x62, 0x42, 0x75, 0x4f, 0x6d, 0x44, 0x41, 0x47, 0x4a, 0x46, 0x74, 0x71, + 0x6b, 0x49, 0x6b, 0x37, 0x6d, 0x70, 0x4d, 0x30, 0x73, 0x59, 0x6d, 0x73, + 0x4c, 0x34, 0x68, 0x34, 0x68, 0x4f, 0x0a, 0x32, 0x39, 0x31, 0x78, 0x4e, + 0x42, 0x72, 0x42, 0x56, 0x4e, 0x70, 0x47, 0x50, 0x2b, 0x44, 0x54, 0x4b, + 0x71, 0x74, 0x74, 0x56, 0x43, 0x4c, 0x31, 0x4f, 0x6d, 0x4c, 0x4e, 0x49, + 0x47, 0x2b, 0x36, 0x4b, 0x59, 0x6e, 0x58, 0x33, 0x5a, 0x48, 0x75, 0x30, + 0x31, 0x79, 0x69, 0x50, 0x71, 0x46, 0x62, 0x51, 0x66, 0x58, 0x66, 0x35, + 0x57, 0x52, 0x44, 0x4c, 0x65, 0x6e, 0x56, 0x4f, 0x61, 0x76, 0x53, 0x0a, + 0x6f, 0x74, 0x2b, 0x33, 0x69, 0x39, 0x44, 0x41, 0x67, 0x42, 0x6b, 0x63, + 0x52, 0x63, 0x41, 0x74, 0x6a, 0x4f, 0x6a, 0x34, 0x4c, 0x61, 0x52, 0x30, + 0x56, 0x6b, 0x6e, 0x46, 0x42, 0x62, 0x56, 0x50, 0x46, 0x64, 0x35, 0x75, + 0x52, 0x48, 0x67, 0x35, 0x68, 0x36, 0x68, 0x2b, 0x75, 0x2f, 0x4e, 0x35, + 0x47, 0x4a, 0x47, 0x37, 0x39, 0x47, 0x2b, 0x64, 0x77, 0x66, 0x43, 0x4d, + 0x4e, 0x59, 0x78, 0x64, 0x0a, 0x41, 0x66, 0x76, 0x44, 0x62, 0x62, 0x6e, + 0x76, 0x52, 0x47, 0x31, 0x35, 0x52, 0x6a, 0x46, 0x2b, 0x43, 0x76, 0x36, + 0x70, 0x67, 0x73, 0x48, 0x2f, 0x37, 0x36, 0x74, 0x75, 0x49, 0x4d, 0x52, + 0x51, 0x79, 0x56, 0x2b, 0x64, 0x54, 0x5a, 0x73, 0x58, 0x6a, 0x41, 0x7a, + 0x6c, 0x41, 0x63, 0x6d, 0x67, 0x51, 0x57, 0x70, 0x7a, 0x55, 0x2f, 0x71, + 0x6c, 0x55, 0x4c, 0x52, 0x75, 0x4a, 0x51, 0x2f, 0x37, 0x0a, 0x54, 0x42, + 0x6a, 0x30, 0x2f, 0x56, 0x4c, 0x5a, 0x6a, 0x6d, 0x6d, 0x78, 0x36, 0x42, + 0x45, 0x50, 0x33, 0x6f, 0x6a, 0x59, 0x2b, 0x78, 0x31, 0x4a, 0x39, 0x36, + 0x72, 0x65, 0x6c, 0x63, 0x38, 0x67, 0x65, 0x4d, 0x4a, 0x67, 0x45, 0x74, + 0x73, 0x6c, 0x51, 0x49, 0x78, 0x71, 0x2f, 0x48, 0x35, 0x43, 0x4f, 0x45, + 0x42, 0x6b, 0x45, 0x76, 0x65, 0x65, 0x67, 0x65, 0x47, 0x54, 0x4c, 0x67, + 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x56, 0x65, + 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, 0x39, 0x20, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, + 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x56, 0x65, + 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, 0x39, 0x20, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, + 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x56, 0x65, 0x72, 0x69, 0x73, 0x69, 0x67, 0x6e, 0x20, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, + 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x32, 0x30, 0x36, 0x36, 0x38, 0x34, 0x36, 0x39, 0x36, + 0x32, 0x37, 0x39, 0x34, 0x37, 0x32, 0x33, 0x31, 0x30, 0x32, 0x35, 0x34, + 0x32, 0x37, 0x37, 0x38, 0x37, 0x30, 0x31, 0x38, 0x30, 0x39, 0x36, 0x36, + 0x37, 0x32, 0x33, 0x34, 0x31, 0x35, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x63, 0x64, 0x3a, 0x36, 0x38, 0x3a, 0x62, 0x36, 0x3a, 0x61, + 0x37, 0x3a, 0x63, 0x37, 0x3a, 0x63, 0x34, 0x3a, 0x63, 0x65, 0x3a, 0x37, + 0x35, 0x3a, 0x65, 0x30, 0x3a, 0x31, 0x64, 0x3a, 0x34, 0x66, 0x3a, 0x35, + 0x37, 0x3a, 0x34, 0x34, 0x3a, 0x36, 0x31, 0x3a, 0x39, 0x32, 0x3a, 0x30, + 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x33, + 0x3a, 0x32, 0x64, 0x3a, 0x30, 0x64, 0x3a, 0x34, 0x35, 0x3a, 0x35, 0x33, + 0x3a, 0x34, 0x62, 0x3a, 0x36, 0x39, 0x3a, 0x39, 0x37, 0x3a, 0x63, 0x64, + 0x3a, 0x62, 0x32, 0x3a, 0x64, 0x35, 0x3a, 0x63, 0x33, 0x3a, 0x33, 0x39, + 0x3a, 0x65, 0x32, 0x3a, 0x35, 0x35, 0x3a, 0x37, 0x36, 0x3a, 0x36, 0x30, + 0x3a, 0x39, 0x62, 0x3a, 0x35, 0x63, 0x3a, 0x63, 0x36, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x62, 0x3a, 0x30, + 0x34, 0x3a, 0x63, 0x66, 0x3a, 0x35, 0x65, 0x3a, 0x62, 0x31, 0x3a, 0x66, + 0x33, 0x3a, 0x39, 0x61, 0x3a, 0x66, 0x61, 0x3a, 0x37, 0x36, 0x3a, 0x32, + 0x66, 0x3a, 0x32, 0x62, 0x3a, 0x62, 0x31, 0x3a, 0x32, 0x30, 0x3a, 0x66, + 0x32, 0x3a, 0x39, 0x36, 0x3a, 0x63, 0x62, 0x3a, 0x61, 0x35, 0x3a, 0x32, + 0x30, 0x3a, 0x63, 0x31, 0x3a, 0x62, 0x39, 0x3a, 0x37, 0x64, 0x3a, 0x62, + 0x31, 0x3a, 0x35, 0x38, 0x3a, 0x39, 0x35, 0x3a, 0x36, 0x35, 0x3a, 0x62, + 0x38, 0x3a, 0x31, 0x63, 0x3a, 0x62, 0x39, 0x3a, 0x61, 0x31, 0x3a, 0x37, + 0x62, 0x3a, 0x37, 0x32, 0x3a, 0x34, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x45, 0x47, 0x6a, 0x43, 0x43, 0x41, 0x77, 0x49, 0x43, + 0x45, 0x51, 0x43, 0x62, 0x66, 0x67, 0x5a, 0x4a, 0x6f, 0x7a, 0x35, 0x69, + 0x75, 0x64, 0x58, 0x75, 0x6b, 0x45, 0x68, 0x78, 0x4b, 0x65, 0x39, 0x58, + 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, + 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x49, 0x48, 0x4b, + 0x4d, 0x51, 0x73, 0x77, 0x0a, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x58, 0x4d, 0x42, 0x55, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4f, 0x56, 0x6d, 0x56, + 0x79, 0x61, 0x56, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x73, 0x49, 0x45, 0x6c, + 0x75, 0x59, 0x79, 0x34, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x73, 0x54, 0x46, 0x6c, 0x5a, 0x6c, 0x0a, 0x63, 0x6d, + 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, + 0x4e, 0x30, 0x49, 0x45, 0x35, 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, + 0x73, 0x78, 0x4f, 0x6a, 0x41, 0x34, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x73, 0x54, 0x4d, 0x53, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x78, 0x4f, 0x54, + 0x6b, 0x35, 0x49, 0x46, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, + 0x64, 0x75, 0x0a, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, + 0x43, 0x30, 0x67, 0x52, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, + 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, + 0x58, 0x4e, 0x6c, 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x52, + 0x54, 0x42, 0x44, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x50, + 0x46, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x0a, 0x61, 0x57, 0x64, 0x75, + 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x4d, 0x67, + 0x55, 0x48, 0x56, 0x69, 0x62, 0x47, 0x6c, 0x6a, 0x49, 0x46, 0x42, 0x79, + 0x61, 0x57, 0x31, 0x68, 0x63, 0x6e, 0x6b, 0x67, 0x51, 0x32, 0x56, 0x79, + 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, + 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x0a, 0x64, 0x48, 0x6b, 0x67, 0x4c, 0x53, 0x42, 0x48, 0x4d, 0x7a, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x35, 0x4f, 0x54, 0x45, 0x77, 0x4d, 0x44, 0x45, + 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, + 0x7a, 0x4e, 0x6a, 0x41, 0x33, 0x4d, 0x54, 0x59, 0x79, 0x4d, 0x7a, 0x55, + 0x35, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x49, 0x48, 0x4b, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x58, 0x4d, 0x42, 0x55, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4f, 0x56, 0x6d, 0x56, 0x79, 0x61, 0x56, + 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, + 0x34, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x73, 0x54, 0x46, 0x6c, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x0a, 0x61, + 0x57, 0x64, 0x75, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, + 0x45, 0x35, 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, 0x78, 0x4f, + 0x6a, 0x41, 0x34, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x4d, + 0x53, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x78, 0x4f, 0x54, 0x6b, 0x35, 0x49, + 0x46, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, 0x4c, + 0x43, 0x42, 0x4a, 0x0a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, + 0x52, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, + 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, + 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x52, 0x54, 0x42, 0x44, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x50, 0x46, 0x5a, 0x6c, + 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, 0x0a, 0x49, 0x45, 0x4e, + 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x4d, 0x67, 0x55, 0x48, 0x56, + 0x69, 0x62, 0x47, 0x6c, 0x6a, 0x49, 0x46, 0x42, 0x79, 0x61, 0x57, 0x31, + 0x68, 0x63, 0x6e, 0x6b, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, + 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, + 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, + 0x67, 0x0a, 0x4c, 0x53, 0x42, 0x48, 0x4d, 0x7a, 0x43, 0x43, 0x41, 0x53, + 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, + 0x45, 0x42, 0x41, 0x4d, 0x75, 0x36, 0x6e, 0x46, 0x4c, 0x38, 0x65, 0x42, + 0x38, 0x61, 0x48, 0x6d, 0x38, 0x62, 0x0a, 0x4e, 0x33, 0x4f, 0x39, 0x2b, + 0x4d, 0x6c, 0x72, 0x6c, 0x42, 0x49, 0x77, 0x54, 0x2f, 0x41, 0x32, 0x52, + 0x2f, 0x58, 0x51, 0x6b, 0x51, 0x72, 0x31, 0x46, 0x38, 0x69, 0x6c, 0x59, + 0x63, 0x45, 0x57, 0x51, 0x45, 0x33, 0x37, 0x69, 0x6d, 0x47, 0x51, 0x35, + 0x58, 0x59, 0x67, 0x77, 0x52, 0x45, 0x47, 0x66, 0x61, 0x73, 0x73, 0x62, + 0x71, 0x62, 0x31, 0x45, 0x55, 0x47, 0x4f, 0x2b, 0x69, 0x32, 0x74, 0x0a, + 0x4b, 0x6d, 0x46, 0x5a, 0x70, 0x47, 0x63, 0x6d, 0x54, 0x4e, 0x44, 0x6f, + 0x76, 0x46, 0x4a, 0x62, 0x63, 0x43, 0x41, 0x45, 0x57, 0x4e, 0x46, 0x36, + 0x79, 0x61, 0x52, 0x70, 0x76, 0x49, 0x4d, 0x58, 0x5a, 0x4b, 0x30, 0x46, + 0x69, 0x37, 0x7a, 0x51, 0x57, 0x4d, 0x36, 0x4e, 0x6a, 0x50, 0x58, 0x72, + 0x38, 0x45, 0x4a, 0x4a, 0x43, 0x35, 0x32, 0x58, 0x4a, 0x32, 0x63, 0x79, + 0x62, 0x75, 0x47, 0x75, 0x0a, 0x6b, 0x78, 0x55, 0x63, 0x63, 0x4c, 0x77, + 0x67, 0x54, 0x53, 0x38, 0x59, 0x33, 0x70, 0x4b, 0x49, 0x36, 0x47, 0x79, + 0x46, 0x56, 0x78, 0x45, 0x61, 0x36, 0x58, 0x37, 0x6a, 0x4a, 0x68, 0x46, + 0x55, 0x6f, 0x6b, 0x57, 0x57, 0x56, 0x59, 0x50, 0x4b, 0x4d, 0x49, 0x6e, + 0x6f, 0x33, 0x4e, 0x69, 0x6a, 0x37, 0x53, 0x71, 0x41, 0x50, 0x33, 0x39, + 0x35, 0x5a, 0x56, 0x63, 0x2b, 0x46, 0x53, 0x42, 0x6d, 0x0a, 0x43, 0x43, + 0x2b, 0x56, 0x6b, 0x37, 0x2b, 0x71, 0x52, 0x79, 0x2b, 0x6f, 0x52, 0x70, + 0x66, 0x77, 0x45, 0x75, 0x4c, 0x2b, 0x77, 0x67, 0x6f, 0x72, 0x55, 0x65, + 0x5a, 0x32, 0x35, 0x72, 0x64, 0x47, 0x74, 0x2b, 0x49, 0x4e, 0x70, 0x73, + 0x79, 0x6f, 0x77, 0x30, 0x78, 0x5a, 0x56, 0x59, 0x6e, 0x6d, 0x36, 0x46, + 0x4e, 0x63, 0x48, 0x4f, 0x71, 0x64, 0x38, 0x47, 0x49, 0x57, 0x43, 0x36, + 0x66, 0x4a, 0x0a, 0x58, 0x77, 0x7a, 0x77, 0x33, 0x73, 0x4a, 0x32, 0x7a, + 0x71, 0x2f, 0x33, 0x61, 0x76, 0x4c, 0x36, 0x51, 0x61, 0x61, 0x69, 0x4d, + 0x78, 0x54, 0x4a, 0x35, 0x58, 0x70, 0x6a, 0x30, 0x35, 0x35, 0x69, 0x4e, + 0x39, 0x57, 0x46, 0x5a, 0x5a, 0x34, 0x4f, 0x35, 0x6c, 0x4d, 0x6b, 0x64, + 0x42, 0x74, 0x65, 0x48, 0x52, 0x4a, 0x54, 0x57, 0x38, 0x63, 0x73, 0x35, + 0x34, 0x4e, 0x4a, 0x4f, 0x78, 0x57, 0x75, 0x0a, 0x69, 0x6d, 0x69, 0x35, + 0x56, 0x35, 0x63, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x54, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, + 0x45, 0x52, 0x53, 0x57, 0x77, 0x61, 0x75, 0x53, 0x43, 0x50, 0x63, 0x2f, + 0x4c, 0x38, 0x6d, 0x79, 0x2f, 0x75, 0x52, 0x61, 0x6e, 0x32, 0x54, 0x65, + 0x0a, 0x32, 0x79, 0x46, 0x50, 0x68, 0x70, 0x6b, 0x30, 0x64, 0x6a, 0x5a, + 0x58, 0x33, 0x64, 0x41, 0x56, 0x4c, 0x38, 0x57, 0x74, 0x66, 0x78, 0x55, + 0x66, 0x4e, 0x32, 0x4a, 0x7a, 0x50, 0x74, 0x54, 0x6e, 0x58, 0x38, 0x34, + 0x58, 0x41, 0x39, 0x73, 0x31, 0x2b, 0x69, 0x76, 0x62, 0x72, 0x6d, 0x41, + 0x4a, 0x58, 0x78, 0x35, 0x66, 0x6a, 0x32, 0x36, 0x37, 0x43, 0x7a, 0x33, + 0x71, 0x57, 0x68, 0x4d, 0x65, 0x0a, 0x44, 0x47, 0x42, 0x76, 0x74, 0x63, + 0x43, 0x31, 0x49, 0x79, 0x49, 0x75, 0x42, 0x77, 0x76, 0x4c, 0x71, 0x58, + 0x54, 0x4c, 0x52, 0x37, 0x73, 0x64, 0x77, 0x64, 0x65, 0x6c, 0x61, 0x38, + 0x77, 0x76, 0x30, 0x6b, 0x4c, 0x39, 0x53, 0x64, 0x32, 0x6e, 0x69, 0x63, + 0x39, 0x54, 0x75, 0x74, 0x6f, 0x41, 0x57, 0x69, 0x69, 0x2f, 0x67, 0x74, + 0x2f, 0x34, 0x75, 0x68, 0x4d, 0x64, 0x55, 0x49, 0x61, 0x43, 0x0a, 0x2f, + 0x59, 0x34, 0x77, 0x6a, 0x79, 0x6c, 0x47, 0x73, 0x42, 0x34, 0x39, 0x4e, + 0x64, 0x6f, 0x34, 0x59, 0x68, 0x59, 0x59, 0x53, 0x71, 0x33, 0x6d, 0x74, + 0x6c, 0x46, 0x73, 0x33, 0x71, 0x39, 0x69, 0x36, 0x77, 0x48, 0x51, 0x48, + 0x69, 0x54, 0x2b, 0x65, 0x6f, 0x38, 0x53, 0x47, 0x68, 0x4a, 0x6f, 0x75, + 0x50, 0x74, 0x6d, 0x6d, 0x52, 0x51, 0x55, 0x52, 0x56, 0x79, 0x75, 0x35, + 0x36, 0x35, 0x70, 0x0a, 0x46, 0x34, 0x45, 0x72, 0x57, 0x6a, 0x66, 0x4a, + 0x58, 0x69, 0x72, 0x30, 0x78, 0x75, 0x4b, 0x68, 0x58, 0x46, 0x53, 0x62, + 0x70, 0x6c, 0x51, 0x41, 0x7a, 0x2f, 0x44, 0x78, 0x77, 0x63, 0x65, 0x59, + 0x4d, 0x42, 0x6f, 0x37, 0x4e, 0x68, 0x62, 0x62, 0x6f, 0x32, 0x37, 0x71, + 0x2f, 0x61, 0x32, 0x79, 0x77, 0x74, 0x72, 0x76, 0x41, 0x6b, 0x63, 0x54, + 0x69, 0x73, 0x44, 0x78, 0x73, 0x7a, 0x47, 0x74, 0x0a, 0x54, 0x78, 0x7a, + 0x68, 0x54, 0x35, 0x79, 0x76, 0x44, 0x77, 0x79, 0x64, 0x39, 0x33, 0x67, + 0x4e, 0x32, 0x50, 0x51, 0x31, 0x56, 0x6f, 0x44, 0x61, 0x74, 0x32, 0x30, + 0x58, 0x6a, 0x35, 0x30, 0x65, 0x67, 0x57, 0x54, 0x68, 0x2f, 0x73, 0x56, + 0x46, 0x75, 0x71, 0x31, 0x72, 0x75, 0x51, 0x70, 0x36, 0x54, 0x6b, 0x39, + 0x4c, 0x68, 0x4f, 0x35, 0x4c, 0x38, 0x58, 0x33, 0x64, 0x45, 0x51, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, + 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30, 0x34, 0x38, 0x29, + 0x20, 0x4f, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, + 0x65, 0x74, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, + 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, + 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, 0x2e, 0x20, 0x28, + 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x6c, 0x69, 0x61, 0x62, 0x2e, + 0x29, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, 0x39, 0x20, 0x45, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, + 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x28, 0x32, 0x30, + 0x34, 0x38, 0x29, 0x20, 0x4f, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, + 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, + 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, + 0x2f, 0x43, 0x50, 0x53, 0x5f, 0x32, 0x30, 0x34, 0x38, 0x20, 0x69, 0x6e, + 0x63, 0x6f, 0x72, 0x70, 0x2e, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, + 0x2e, 0x20, 0x28, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x73, 0x20, 0x6c, 0x69, + 0x61, 0x62, 0x2e, 0x29, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x31, 0x39, 0x39, + 0x39, 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, + 0x74, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x45, 0x6e, 0x74, 0x72, + 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x20, 0x50, 0x72, 0x65, 0x6d, + 0x69, 0x75, 0x6d, 0x20, 0x32, 0x30, 0x34, 0x38, 0x20, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x20, 0x43, + 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x39, 0x34, 0x36, 0x30, 0x36, 0x39, 0x32, 0x34, 0x30, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x65, 0x3a, 0x32, 0x39, 0x3a, + 0x33, 0x31, 0x3a, 0x62, 0x63, 0x3a, 0x33, 0x32, 0x3a, 0x37, 0x65, 0x3a, + 0x39, 0x61, 0x3a, 0x65, 0x36, 0x3a, 0x65, 0x38, 0x3a, 0x62, 0x35, 0x3a, + 0x66, 0x37, 0x3a, 0x35, 0x31, 0x3a, 0x62, 0x34, 0x3a, 0x33, 0x34, 0x3a, + 0x37, 0x31, 0x3a, 0x39, 0x30, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x35, 0x30, 0x3a, 0x33, 0x30, 0x3a, 0x30, 0x36, 0x3a, 0x30, + 0x39, 0x3a, 0x31, 0x64, 0x3a, 0x39, 0x37, 0x3a, 0x64, 0x34, 0x3a, 0x66, + 0x35, 0x3a, 0x61, 0x65, 0x3a, 0x33, 0x39, 0x3a, 0x66, 0x37, 0x3a, 0x63, + 0x62, 0x3a, 0x65, 0x37, 0x3a, 0x39, 0x32, 0x3a, 0x37, 0x64, 0x3a, 0x37, + 0x64, 0x3a, 0x36, 0x35, 0x3a, 0x32, 0x64, 0x3a, 0x33, 0x34, 0x3a, 0x33, + 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x36, 0x64, 0x3a, 0x63, 0x34, 0x3a, 0x37, 0x31, 0x3a, 0x37, 0x32, 0x3a, + 0x65, 0x30, 0x3a, 0x31, 0x63, 0x3a, 0x62, 0x63, 0x3a, 0x62, 0x30, 0x3a, + 0x62, 0x66, 0x3a, 0x36, 0x32, 0x3a, 0x35, 0x38, 0x3a, 0x30, 0x64, 0x3a, + 0x38, 0x39, 0x3a, 0x35, 0x66, 0x3a, 0x65, 0x32, 0x3a, 0x62, 0x38, 0x3a, + 0x61, 0x63, 0x3a, 0x39, 0x61, 0x3a, 0x64, 0x34, 0x3a, 0x66, 0x38, 0x3a, + 0x37, 0x33, 0x3a, 0x38, 0x30, 0x3a, 0x31, 0x65, 0x3a, 0x30, 0x63, 0x3a, + 0x31, 0x30, 0x3a, 0x62, 0x39, 0x3a, 0x63, 0x38, 0x3a, 0x33, 0x37, 0x3a, + 0x64, 0x32, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x31, 0x3a, 0x37, 0x37, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x4b, 0x6a, 0x43, 0x43, + 0x41, 0x78, 0x4b, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, + 0x4f, 0x47, 0x50, 0x65, 0x2b, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, + 0x41, 0x44, 0x43, 0x42, 0x74, 0x44, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4c, 0x0a, 0x52, 0x57, 0x35, + 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x35, 0x75, 0x5a, 0x58, 0x51, + 0x78, 0x51, 0x44, 0x41, 0x2b, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, + 0x55, 0x4e, 0x33, 0x64, 0x33, 0x64, 0x79, 0x35, 0x6c, 0x62, 0x6e, 0x52, + 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x39, + 0x44, 0x55, 0x46, 0x4e, 0x66, 0x4d, 0x6a, 0x41, 0x30, 0x4f, 0x43, 0x42, + 0x70, 0x0a, 0x62, 0x6d, 0x4e, 0x76, 0x63, 0x6e, 0x41, 0x75, 0x49, 0x47, + 0x4a, 0x35, 0x49, 0x48, 0x4a, 0x6c, 0x5a, 0x69, 0x34, 0x67, 0x4b, 0x47, + 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x63, 0x79, 0x42, 0x73, 0x61, 0x57, + 0x46, 0x69, 0x4c, 0x69, 0x6b, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x48, 0x43, 0x68, 0x6a, 0x4b, 0x53, + 0x41, 0x78, 0x4f, 0x54, 0x6b, 0x35, 0x0a, 0x49, 0x45, 0x56, 0x75, 0x64, + 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, 0x6d, 0x56, 0x30, 0x49, + 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, 0x78, 0x4d, + 0x7a, 0x41, 0x78, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4b, + 0x6b, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, + 0x6d, 0x56, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x0a, + 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, + 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, + 0x49, 0x43, 0x67, 0x79, 0x4d, 0x44, 0x51, 0x34, 0x4b, 0x54, 0x41, 0x65, + 0x46, 0x77, 0x30, 0x35, 0x4f, 0x54, 0x45, 0x79, 0x4d, 0x6a, 0x51, 0x78, + 0x4e, 0x7a, 0x55, 0x77, 0x4e, 0x54, 0x46, 0x61, 0x46, 0x77, 0x30, 0x79, + 0x4f, 0x54, 0x41, 0x33, 0x0a, 0x4d, 0x6a, 0x51, 0x78, 0x4e, 0x44, 0x45, + 0x31, 0x4d, 0x54, 0x4a, 0x61, 0x4d, 0x49, 0x47, 0x30, 0x4d, 0x52, 0x51, + 0x77, 0x45, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x74, + 0x46, 0x62, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, 0x6d, 0x35, + 0x6c, 0x64, 0x44, 0x46, 0x41, 0x4d, 0x44, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x78, 0x51, 0x33, 0x64, 0x33, 0x64, 0x33, 0x0a, 0x4c, 0x6d, + 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, 0x6d, + 0x56, 0x30, 0x4c, 0x30, 0x4e, 0x51, 0x55, 0x31, 0x38, 0x79, 0x4d, 0x44, + 0x51, 0x34, 0x49, 0x47, 0x6c, 0x75, 0x59, 0x32, 0x39, 0x79, 0x63, 0x43, + 0x34, 0x67, 0x59, 0x6e, 0x6b, 0x67, 0x63, 0x6d, 0x56, 0x6d, 0x4c, 0x69, + 0x41, 0x6f, 0x62, 0x47, 0x6c, 0x74, 0x61, 0x58, 0x52, 0x7a, 0x49, 0x47, + 0x78, 0x70, 0x0a, 0x59, 0x57, 0x49, 0x75, 0x4b, 0x54, 0x45, 0x6c, 0x4d, + 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x63, 0x4b, + 0x47, 0x4d, 0x70, 0x49, 0x44, 0x45, 0x35, 0x4f, 0x54, 0x6b, 0x67, 0x52, + 0x57, 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x35, 0x75, 0x5a, + 0x58, 0x51, 0x67, 0x54, 0x47, 0x6c, 0x74, 0x61, 0x58, 0x52, 0x6c, 0x5a, + 0x44, 0x45, 0x7a, 0x4d, 0x44, 0x45, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, + 0x41, 0x78, 0x4d, 0x71, 0x52, 0x57, 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x35, 0x75, 0x5a, 0x58, 0x51, 0x67, 0x51, 0x32, 0x56, 0x79, + 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, + 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x64, 0x48, 0x6b, 0x67, 0x4b, 0x44, 0x49, 0x77, 0x4e, 0x44, 0x67, 0x70, + 0x0a, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, + 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, + 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x72, 0x55, 0x31, + 0x4c, 0x71, 0x52, 0x4b, 0x47, 0x73, 0x75, 0x71, 0x6a, 0x49, 0x41, 0x63, + 0x56, 0x46, 0x6d, 0x51, 0x71, 0x0a, 0x4b, 0x30, 0x76, 0x52, 0x76, 0x77, + 0x74, 0x4b, 0x54, 0x59, 0x37, 0x74, 0x67, 0x48, 0x61, 0x6c, 0x5a, 0x37, + 0x64, 0x34, 0x51, 0x4d, 0x42, 0x7a, 0x51, 0x73, 0x68, 0x6f, 0x77, 0x4e, + 0x74, 0x54, 0x4b, 0x39, 0x31, 0x65, 0x75, 0x48, 0x61, 0x59, 0x4e, 0x5a, + 0x4f, 0x4c, 0x47, 0x70, 0x31, 0x38, 0x45, 0x7a, 0x6f, 0x4f, 0x48, 0x31, + 0x75, 0x33, 0x48, 0x73, 0x2f, 0x6c, 0x4a, 0x42, 0x51, 0x65, 0x0a, 0x73, + 0x59, 0x47, 0x70, 0x6a, 0x58, 0x32, 0x34, 0x7a, 0x47, 0x74, 0x4c, 0x41, + 0x2f, 0x45, 0x43, 0x44, 0x4e, 0x79, 0x72, 0x70, 0x55, 0x41, 0x6b, 0x41, + 0x48, 0x39, 0x30, 0x6c, 0x4b, 0x47, 0x64, 0x43, 0x43, 0x6d, 0x7a, 0x69, + 0x41, 0x76, 0x31, 0x68, 0x33, 0x65, 0x64, 0x56, 0x63, 0x33, 0x6b, 0x77, + 0x33, 0x37, 0x58, 0x61, 0x6d, 0x53, 0x72, 0x68, 0x52, 0x53, 0x47, 0x6c, + 0x56, 0x75, 0x58, 0x0a, 0x4d, 0x6c, 0x42, 0x76, 0x50, 0x63, 0x69, 0x36, + 0x5a, 0x67, 0x7a, 0x6a, 0x2f, 0x4c, 0x32, 0x34, 0x53, 0x63, 0x46, 0x32, + 0x69, 0x55, 0x6b, 0x5a, 0x2f, 0x63, 0x43, 0x6f, 0x76, 0x59, 0x6d, 0x6a, + 0x5a, 0x79, 0x2f, 0x47, 0x6e, 0x37, 0x78, 0x78, 0x47, 0x57, 0x43, 0x34, + 0x4c, 0x65, 0x6b, 0x73, 0x79, 0x5a, 0x42, 0x32, 0x5a, 0x6e, 0x75, 0x55, + 0x34, 0x71, 0x39, 0x34, 0x31, 0x6d, 0x56, 0x54, 0x0a, 0x58, 0x54, 0x7a, + 0x57, 0x6e, 0x4c, 0x4c, 0x50, 0x4b, 0x51, 0x50, 0x35, 0x4c, 0x36, 0x52, + 0x51, 0x73, 0x74, 0x52, 0x49, 0x7a, 0x67, 0x55, 0x79, 0x56, 0x59, 0x72, + 0x39, 0x73, 0x6d, 0x52, 0x4d, 0x44, 0x75, 0x53, 0x59, 0x42, 0x33, 0x58, + 0x62, 0x66, 0x39, 0x2b, 0x35, 0x43, 0x46, 0x56, 0x67, 0x68, 0x54, 0x41, + 0x70, 0x2b, 0x58, 0x74, 0x49, 0x70, 0x47, 0x6d, 0x47, 0x34, 0x7a, 0x55, + 0x2f, 0x0a, 0x48, 0x6f, 0x5a, 0x64, 0x65, 0x6e, 0x6f, 0x56, 0x76, 0x65, + 0x38, 0x41, 0x6a, 0x68, 0x55, 0x69, 0x56, 0x42, 0x63, 0x41, 0x6b, 0x43, + 0x61, 0x54, 0x76, 0x41, 0x35, 0x4a, 0x61, 0x4a, 0x47, 0x2f, 0x2b, 0x45, + 0x66, 0x54, 0x6e, 0x5a, 0x56, 0x43, 0x77, 0x51, 0x35, 0x4e, 0x33, 0x32, + 0x38, 0x6d, 0x7a, 0x38, 0x4d, 0x59, 0x49, 0x57, 0x4a, 0x6d, 0x51, 0x33, + 0x44, 0x57, 0x31, 0x63, 0x41, 0x48, 0x0a, 0x34, 0x51, 0x49, 0x44, 0x41, + 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x4f, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, + 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, + 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x0a, + 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x56, 0x65, 0x53, 0x42, + 0x30, 0x52, 0x47, 0x41, 0x76, 0x74, 0x69, 0x4a, 0x75, 0x51, 0x69, 0x6a, + 0x4d, 0x66, 0x6d, 0x68, 0x4a, 0x41, 0x6b, 0x57, 0x75, 0x58, 0x41, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x44, 0x75, 0x62, 0x0a, 0x6a, 0x31, 0x61, 0x62, 0x4d, 0x4f, 0x64, + 0x54, 0x6d, 0x58, 0x78, 0x36, 0x65, 0x61, 0x64, 0x4e, 0x6c, 0x39, 0x63, + 0x5a, 0x6c, 0x5a, 0x44, 0x37, 0x42, 0x68, 0x2f, 0x4b, 0x4d, 0x33, 0x78, + 0x47, 0x59, 0x34, 0x2b, 0x57, 0x5a, 0x69, 0x54, 0x36, 0x51, 0x42, 0x73, + 0x68, 0x4a, 0x38, 0x72, 0x6d, 0x63, 0x6e, 0x50, 0x79, 0x54, 0x2f, 0x34, + 0x78, 0x6d, 0x66, 0x33, 0x49, 0x44, 0x45, 0x78, 0x6f, 0x0a, 0x55, 0x38, + 0x61, 0x41, 0x67, 0x68, 0x4f, 0x59, 0x2b, 0x72, 0x61, 0x74, 0x32, 0x6c, + 0x30, 0x39, 0x38, 0x63, 0x35, 0x75, 0x39, 0x68, 0x55, 0x52, 0x6c, 0x49, + 0x49, 0x4d, 0x37, 0x6a, 0x2b, 0x56, 0x72, 0x78, 0x47, 0x72, 0x44, 0x39, + 0x63, 0x76, 0x33, 0x68, 0x38, 0x44, 0x6a, 0x31, 0x63, 0x73, 0x48, 0x73, + 0x6d, 0x37, 0x6d, 0x68, 0x70, 0x45, 0x6c, 0x65, 0x73, 0x59, 0x54, 0x36, + 0x59, 0x66, 0x0a, 0x7a, 0x58, 0x31, 0x58, 0x45, 0x43, 0x2b, 0x62, 0x42, + 0x41, 0x6c, 0x61, 0x68, 0x4c, 0x56, 0x75, 0x32, 0x42, 0x30, 0x36, 0x34, + 0x64, 0x61, 0x65, 0x30, 0x57, 0x78, 0x35, 0x58, 0x6e, 0x6b, 0x63, 0x46, + 0x4d, 0x58, 0x6a, 0x30, 0x45, 0x79, 0x54, 0x4f, 0x32, 0x55, 0x38, 0x37, + 0x64, 0x38, 0x39, 0x76, 0x71, 0x62, 0x6c, 0x6c, 0x52, 0x72, 0x44, 0x74, + 0x52, 0x6e, 0x44, 0x76, 0x56, 0x35, 0x62, 0x0a, 0x75, 0x2f, 0x38, 0x6a, + 0x37, 0x32, 0x67, 0x5a, 0x79, 0x78, 0x4b, 0x54, 0x4a, 0x31, 0x77, 0x44, + 0x4c, 0x57, 0x38, 0x77, 0x30, 0x42, 0x36, 0x32, 0x47, 0x71, 0x7a, 0x65, + 0x57, 0x76, 0x66, 0x52, 0x71, 0x71, 0x67, 0x6e, 0x70, 0x76, 0x35, 0x35, + 0x67, 0x63, 0x52, 0x35, 0x6d, 0x54, 0x4e, 0x58, 0x75, 0x68, 0x4b, 0x77, + 0x71, 0x65, 0x42, 0x43, 0x62, 0x4a, 0x50, 0x4b, 0x56, 0x74, 0x37, 0x2b, + 0x0a, 0x62, 0x59, 0x51, 0x4c, 0x43, 0x49, 0x74, 0x2b, 0x6a, 0x65, 0x72, + 0x58, 0x6d, 0x43, 0x48, 0x47, 0x38, 0x2b, 0x63, 0x38, 0x65, 0x53, 0x39, + 0x65, 0x6e, 0x4e, 0x46, 0x4d, 0x46, 0x59, 0x33, 0x68, 0x37, 0x43, 0x49, + 0x33, 0x7a, 0x4a, 0x70, 0x44, 0x43, 0x35, 0x66, 0x63, 0x67, 0x4a, 0x43, + 0x4e, 0x73, 0x32, 0x65, 0x62, 0x62, 0x30, 0x67, 0x49, 0x46, 0x56, 0x62, + 0x50, 0x76, 0x2f, 0x45, 0x72, 0x0a, 0x66, 0x46, 0x36, 0x61, 0x64, 0x75, + 0x6c, 0x5a, 0x6b, 0x4d, 0x56, 0x38, 0x67, 0x7a, 0x55, 0x52, 0x5a, 0x56, + 0x45, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x42, 0x61, 0x6c, 0x74, 0x69, + 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x4f, 0x3d, 0x42, + 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x4f, 0x55, 0x3d, + 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, 0x20, 0x43, + 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x4f, 0x3d, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, + 0x72, 0x65, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x42, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x6f, 0x72, 0x65, + 0x20, 0x43, 0x79, 0x62, 0x65, 0x72, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x33, 0x35, 0x35, 0x34, 0x36, 0x31, 0x37, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x63, 0x3a, 0x62, + 0x36, 0x3a, 0x39, 0x34, 0x3a, 0x61, 0x35, 0x3a, 0x39, 0x63, 0x3a, 0x31, + 0x37, 0x3a, 0x65, 0x30, 0x3a, 0x64, 0x37, 0x3a, 0x39, 0x31, 0x3a, 0x35, + 0x32, 0x3a, 0x39, 0x62, 0x3a, 0x62, 0x31, 0x3a, 0x39, 0x37, 0x3a, 0x30, + 0x36, 0x3a, 0x61, 0x36, 0x3a, 0x65, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x34, 0x3a, 0x64, 0x65, 0x3a, 0x32, 0x30, + 0x3a, 0x64, 0x30, 0x3a, 0x35, 0x65, 0x3a, 0x36, 0x36, 0x3a, 0x66, 0x63, + 0x3a, 0x35, 0x33, 0x3a, 0x66, 0x65, 0x3a, 0x31, 0x61, 0x3a, 0x35, 0x30, + 0x3a, 0x38, 0x38, 0x3a, 0x32, 0x63, 0x3a, 0x37, 0x38, 0x3a, 0x64, 0x62, + 0x3a, 0x32, 0x38, 0x3a, 0x35, 0x32, 0x3a, 0x63, 0x61, 0x3a, 0x65, 0x34, + 0x3a, 0x37, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x31, 0x36, 0x3a, 0x61, 0x66, 0x3a, 0x35, 0x37, 0x3a, 0x61, + 0x39, 0x3a, 0x66, 0x36, 0x3a, 0x37, 0x36, 0x3a, 0x62, 0x30, 0x3a, 0x61, + 0x62, 0x3a, 0x31, 0x32, 0x3a, 0x36, 0x30, 0x3a, 0x39, 0x35, 0x3a, 0x61, + 0x61, 0x3a, 0x35, 0x65, 0x3a, 0x62, 0x61, 0x3a, 0x64, 0x65, 0x3a, 0x66, + 0x32, 0x3a, 0x32, 0x61, 0x3a, 0x62, 0x33, 0x3a, 0x31, 0x31, 0x3a, 0x31, + 0x39, 0x3a, 0x64, 0x36, 0x3a, 0x34, 0x34, 0x3a, 0x61, 0x63, 0x3a, 0x39, + 0x35, 0x3a, 0x63, 0x64, 0x3a, 0x34, 0x62, 0x3a, 0x39, 0x33, 0x3a, 0x64, + 0x62, 0x3a, 0x66, 0x33, 0x3a, 0x66, 0x32, 0x3a, 0x36, 0x61, 0x3a, 0x65, + 0x62, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x64, 0x7a, + 0x43, 0x43, 0x41, 0x6c, 0x2b, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x45, 0x41, 0x67, 0x41, 0x41, 0x75, 0x54, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x55, 0x46, 0x41, 0x44, 0x42, 0x61, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4a, 0x0a, 0x52, + 0x54, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x4a, 0x51, 0x6d, 0x46, 0x73, 0x64, 0x47, 0x6c, 0x74, 0x62, + 0x33, 0x4a, 0x6c, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4c, 0x45, 0x77, 0x70, 0x44, 0x65, 0x57, 0x4a, 0x6c, 0x63, + 0x6c, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x53, 0x49, 0x77, 0x49, + 0x41, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x6c, 0x43, + 0x59, 0x57, 0x78, 0x30, 0x61, 0x57, 0x31, 0x76, 0x63, 0x6d, 0x55, 0x67, + 0x51, 0x33, 0x6c, 0x69, 0x5a, 0x58, 0x4a, 0x55, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x4d, 0x42, 0x34, 0x58, + 0x44, 0x54, 0x41, 0x77, 0x4d, 0x44, 0x55, 0x78, 0x4d, 0x6a, 0x45, 0x34, + 0x4e, 0x44, 0x59, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x0a, 0x44, 0x54, 0x49, + 0x31, 0x4d, 0x44, 0x55, 0x78, 0x4d, 0x6a, 0x49, 0x7a, 0x4e, 0x54, 0x6b, + 0x77, 0x4d, 0x46, 0x6f, 0x77, 0x57, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x55, 0x55, + 0x78, 0x45, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x54, 0x43, 0x55, 0x4a, 0x68, 0x62, 0x48, 0x52, 0x70, 0x62, 0x57, 0x39, + 0x79, 0x0a, 0x5a, 0x54, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x78, 0x4d, 0x4b, 0x51, 0x33, 0x6c, 0x69, 0x5a, 0x58, + 0x4a, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x44, 0x45, 0x69, 0x4d, 0x43, + 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x5a, 0x51, 0x6d, + 0x46, 0x73, 0x64, 0x47, 0x6c, 0x74, 0x62, 0x33, 0x4a, 0x6c, 0x49, 0x45, + 0x4e, 0x35, 0x59, 0x6d, 0x56, 0x79, 0x0a, 0x56, 0x48, 0x4a, 0x31, 0x63, + 0x33, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x44, 0x43, 0x43, 0x41, + 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, + 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, + 0x67, 0x45, 0x42, 0x41, 0x4b, 0x4d, 0x45, 0x75, 0x79, 0x4b, 0x72, 0x0a, + 0x6d, 0x44, 0x31, 0x58, 0x36, 0x43, 0x5a, 0x79, 0x6d, 0x72, 0x56, 0x35, + 0x31, 0x43, 0x6e, 0x69, 0x34, 0x65, 0x69, 0x56, 0x67, 0x4c, 0x47, 0x77, + 0x34, 0x31, 0x75, 0x4f, 0x4b, 0x79, 0x6d, 0x61, 0x5a, 0x4e, 0x2b, 0x68, + 0x58, 0x65, 0x32, 0x77, 0x43, 0x51, 0x56, 0x74, 0x32, 0x79, 0x67, 0x75, + 0x7a, 0x6d, 0x4b, 0x69, 0x59, 0x76, 0x36, 0x30, 0x69, 0x4e, 0x6f, 0x53, + 0x36, 0x7a, 0x6a, 0x72, 0x0a, 0x49, 0x5a, 0x33, 0x41, 0x51, 0x53, 0x73, + 0x42, 0x55, 0x6e, 0x75, 0x49, 0x64, 0x39, 0x4d, 0x63, 0x6a, 0x38, 0x65, + 0x36, 0x75, 0x59, 0x69, 0x31, 0x61, 0x67, 0x6e, 0x6e, 0x63, 0x2b, 0x67, + 0x52, 0x51, 0x4b, 0x66, 0x52, 0x7a, 0x4d, 0x70, 0x69, 0x6a, 0x53, 0x33, + 0x6c, 0x6a, 0x77, 0x75, 0x6d, 0x55, 0x4e, 0x4b, 0x6f, 0x55, 0x4d, 0x4d, + 0x6f, 0x36, 0x76, 0x57, 0x72, 0x4a, 0x59, 0x65, 0x4b, 0x0a, 0x6d, 0x70, + 0x59, 0x63, 0x71, 0x57, 0x65, 0x34, 0x50, 0x77, 0x7a, 0x56, 0x39, 0x2f, + 0x6c, 0x53, 0x45, 0x79, 0x2f, 0x43, 0x47, 0x39, 0x56, 0x77, 0x63, 0x50, + 0x43, 0x50, 0x77, 0x42, 0x4c, 0x4b, 0x42, 0x73, 0x75, 0x61, 0x34, 0x64, + 0x6e, 0x4b, 0x4d, 0x33, 0x70, 0x33, 0x31, 0x76, 0x6a, 0x73, 0x75, 0x66, + 0x46, 0x6f, 0x52, 0x45, 0x4a, 0x49, 0x45, 0x39, 0x4c, 0x41, 0x77, 0x71, + 0x53, 0x75, 0x0a, 0x58, 0x6d, 0x44, 0x2b, 0x74, 0x71, 0x59, 0x46, 0x2f, + 0x4c, 0x54, 0x64, 0x42, 0x31, 0x6b, 0x43, 0x31, 0x46, 0x6b, 0x59, 0x6d, + 0x47, 0x50, 0x31, 0x70, 0x57, 0x50, 0x67, 0x6b, 0x41, 0x78, 0x39, 0x58, + 0x62, 0x49, 0x47, 0x65, 0x76, 0x4f, 0x46, 0x36, 0x75, 0x76, 0x55, 0x41, + 0x36, 0x35, 0x65, 0x68, 0x44, 0x35, 0x66, 0x2f, 0x78, 0x58, 0x74, 0x61, + 0x62, 0x7a, 0x35, 0x4f, 0x54, 0x5a, 0x79, 0x0a, 0x64, 0x63, 0x39, 0x33, + 0x55, 0x6b, 0x33, 0x7a, 0x79, 0x5a, 0x41, 0x73, 0x75, 0x54, 0x33, 0x6c, + 0x79, 0x53, 0x4e, 0x54, 0x50, 0x78, 0x38, 0x6b, 0x6d, 0x43, 0x46, 0x63, + 0x42, 0x35, 0x6b, 0x70, 0x76, 0x63, 0x59, 0x36, 0x37, 0x4f, 0x64, 0x75, + 0x68, 0x6a, 0x70, 0x72, 0x6c, 0x33, 0x52, 0x6a, 0x4d, 0x37, 0x31, 0x6f, + 0x47, 0x44, 0x48, 0x77, 0x65, 0x49, 0x31, 0x32, 0x76, 0x2f, 0x79, 0x65, + 0x0a, 0x6a, 0x6c, 0x30, 0x71, 0x68, 0x71, 0x64, 0x4e, 0x6b, 0x4e, 0x77, + 0x6e, 0x47, 0x6a, 0x6b, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, + 0x46, 0x4d, 0x45, 0x4d, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4f, 0x57, 0x64, 0x57, 0x54, 0x43, + 0x43, 0x52, 0x31, 0x6a, 0x4d, 0x72, 0x50, 0x6f, 0x49, 0x56, 0x44, 0x61, + 0x47, 0x65, 0x7a, 0x71, 0x31, 0x0a, 0x42, 0x45, 0x33, 0x77, 0x4d, 0x42, + 0x49, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, + 0x51, 0x49, 0x4d, 0x41, 0x59, 0x42, 0x41, 0x66, 0x38, 0x43, 0x41, 0x51, + 0x4d, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, + 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x0a, 0x44, + 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, + 0x51, 0x43, 0x46, 0x44, 0x46, 0x32, 0x4f, 0x35, 0x47, 0x39, 0x52, 0x61, + 0x45, 0x49, 0x46, 0x6f, 0x4e, 0x32, 0x37, 0x54, 0x79, 0x63, 0x6c, 0x68, + 0x41, 0x4f, 0x39, 0x39, 0x32, 0x54, 0x39, 0x4c, 0x64, 0x63, 0x77, 0x34, + 0x36, 0x51, 0x51, 0x46, 0x2b, 0x76, 0x61, 0x4b, 0x53, 0x6d, 0x32, 0x65, + 0x54, 0x39, 0x32, 0x0a, 0x39, 0x68, 0x6b, 0x54, 0x49, 0x37, 0x67, 0x51, + 0x43, 0x76, 0x6c, 0x59, 0x70, 0x4e, 0x52, 0x68, 0x63, 0x4c, 0x30, 0x45, + 0x59, 0x57, 0x6f, 0x53, 0x69, 0x68, 0x66, 0x56, 0x43, 0x72, 0x33, 0x46, + 0x76, 0x44, 0x42, 0x38, 0x31, 0x75, 0x6b, 0x4d, 0x4a, 0x59, 0x32, 0x47, + 0x51, 0x45, 0x2f, 0x73, 0x7a, 0x4b, 0x4e, 0x2b, 0x4f, 0x4d, 0x59, 0x33, + 0x45, 0x55, 0x2f, 0x74, 0x33, 0x57, 0x67, 0x78, 0x0a, 0x6a, 0x6b, 0x7a, + 0x53, 0x73, 0x77, 0x46, 0x30, 0x37, 0x72, 0x35, 0x31, 0x58, 0x67, 0x64, + 0x49, 0x47, 0x6e, 0x39, 0x77, 0x2f, 0x78, 0x5a, 0x63, 0x68, 0x4d, 0x42, + 0x35, 0x68, 0x62, 0x67, 0x46, 0x2f, 0x58, 0x2b, 0x2b, 0x5a, 0x52, 0x47, + 0x6a, 0x44, 0x38, 0x41, 0x43, 0x74, 0x50, 0x68, 0x53, 0x4e, 0x7a, 0x6b, + 0x45, 0x31, 0x61, 0x6b, 0x78, 0x65, 0x68, 0x69, 0x2f, 0x6f, 0x43, 0x72, + 0x30, 0x0a, 0x45, 0x70, 0x6e, 0x33, 0x6f, 0x30, 0x57, 0x43, 0x34, 0x7a, + 0x78, 0x65, 0x39, 0x5a, 0x32, 0x65, 0x74, 0x63, 0x69, 0x65, 0x66, 0x43, + 0x37, 0x49, 0x70, 0x4a, 0x35, 0x4f, 0x43, 0x42, 0x52, 0x4c, 0x62, 0x66, + 0x31, 0x77, 0x62, 0x57, 0x73, 0x61, 0x59, 0x37, 0x31, 0x6b, 0x35, 0x68, + 0x2b, 0x33, 0x7a, 0x76, 0x44, 0x79, 0x6e, 0x79, 0x36, 0x37, 0x47, 0x37, + 0x66, 0x79, 0x55, 0x49, 0x68, 0x7a, 0x0a, 0x6b, 0x73, 0x4c, 0x69, 0x34, + 0x78, 0x61, 0x4e, 0x6d, 0x6a, 0x49, 0x43, 0x71, 0x34, 0x34, 0x59, 0x33, + 0x65, 0x6b, 0x51, 0x45, 0x65, 0x35, 0x2b, 0x4e, 0x61, 0x75, 0x51, 0x72, + 0x7a, 0x34, 0x77, 0x6c, 0x48, 0x72, 0x51, 0x4d, 0x7a, 0x32, 0x6e, 0x5a, + 0x51, 0x2f, 0x31, 0x2f, 0x49, 0x36, 0x65, 0x59, 0x73, 0x39, 0x48, 0x52, + 0x43, 0x77, 0x42, 0x58, 0x62, 0x73, 0x64, 0x74, 0x54, 0x4c, 0x53, 0x0a, + 0x52, 0x39, 0x49, 0x34, 0x4c, 0x74, 0x44, 0x2b, 0x67, 0x64, 0x77, 0x79, + 0x61, 0x68, 0x36, 0x31, 0x37, 0x6a, 0x7a, 0x56, 0x2f, 0x4f, 0x65, 0x42, + 0x48, 0x52, 0x6e, 0x44, 0x4a, 0x45, 0x4c, 0x71, 0x59, 0x7a, 0x6d, 0x70, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x64, 0x64, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x43, + 0x41, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x4f, 0x3d, 0x41, 0x64, 0x64, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x42, 0x20, 0x4f, 0x55, 0x3d, + 0x41, 0x64, 0x64, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x45, 0x78, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x54, 0x54, 0x50, 0x20, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x64, 0x64, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, + 0x6c, 0x20, 0x43, 0x41, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x4f, 0x3d, + 0x41, 0x64, 0x64, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x42, 0x20, + 0x4f, 0x55, 0x3d, 0x41, 0x64, 0x64, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x54, 0x54, 0x50, + 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x64, 0x64, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x20, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x31, 0x64, 0x3a, 0x33, 0x35, 0x3a, 0x35, 0x34, 0x3a, 0x30, + 0x34, 0x3a, 0x38, 0x35, 0x3a, 0x37, 0x38, 0x3a, 0x62, 0x30, 0x3a, 0x33, + 0x66, 0x3a, 0x34, 0x32, 0x3a, 0x34, 0x32, 0x3a, 0x34, 0x64, 0x3a, 0x62, + 0x66, 0x3a, 0x32, 0x30, 0x3a, 0x37, 0x33, 0x3a, 0x30, 0x61, 0x3a, 0x33, + 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x32, + 0x3a, 0x66, 0x61, 0x3a, 0x66, 0x33, 0x3a, 0x65, 0x32, 0x3a, 0x39, 0x31, + 0x3a, 0x34, 0x33, 0x3a, 0x35, 0x34, 0x3a, 0x36, 0x38, 0x3a, 0x36, 0x30, + 0x3a, 0x37, 0x38, 0x3a, 0x35, 0x37, 0x3a, 0x36, 0x39, 0x3a, 0x34, 0x64, + 0x3a, 0x66, 0x35, 0x3a, 0x65, 0x34, 0x3a, 0x35, 0x62, 0x3a, 0x36, 0x38, + 0x3a, 0x38, 0x35, 0x3a, 0x31, 0x38, 0x3a, 0x36, 0x38, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x38, 0x3a, 0x37, + 0x66, 0x3a, 0x61, 0x34, 0x3a, 0x35, 0x31, 0x3a, 0x33, 0x38, 0x3a, 0x32, + 0x32, 0x3a, 0x37, 0x38, 0x3a, 0x66, 0x66, 0x3a, 0x66, 0x30, 0x3a, 0x63, + 0x38, 0x3a, 0x62, 0x31, 0x3a, 0x31, 0x66, 0x3a, 0x38, 0x64, 0x3a, 0x34, + 0x33, 0x3a, 0x64, 0x35, 0x3a, 0x37, 0x36, 0x3a, 0x36, 0x37, 0x3a, 0x31, + 0x63, 0x3a, 0x36, 0x65, 0x3a, 0x62, 0x32, 0x3a, 0x62, 0x63, 0x3a, 0x65, + 0x61, 0x3a, 0x62, 0x34, 0x3a, 0x31, 0x33, 0x3a, 0x66, 0x62, 0x3a, 0x38, + 0x33, 0x3a, 0x64, 0x39, 0x3a, 0x36, 0x35, 0x3a, 0x64, 0x30, 0x3a, 0x36, + 0x64, 0x3a, 0x32, 0x66, 0x3a, 0x66, 0x32, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x45, 0x4e, 0x6a, 0x43, 0x43, 0x41, 0x78, 0x36, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x54, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x76, 0x4d, 0x51, 0x73, 0x77, + 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x54, + 0x52, 0x54, 0x45, 0x55, 0x0a, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x4c, 0x51, 0x57, 0x52, 0x6b, 0x56, 0x48, 0x4a, + 0x31, 0x63, 0x33, 0x51, 0x67, 0x51, 0x55, 0x49, 0x78, 0x4a, 0x6a, 0x41, + 0x6b, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x48, 0x55, 0x46, + 0x6b, 0x5a, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, 0x56, + 0x34, 0x64, 0x47, 0x56, 0x79, 0x62, 0x6d, 0x46, 0x73, 0x0a, 0x49, 0x46, + 0x52, 0x55, 0x55, 0x43, 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, + 0x4a, 0x72, 0x4d, 0x53, 0x49, 0x77, 0x49, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x6c, 0x42, 0x5a, 0x47, 0x52, 0x55, 0x63, 0x6e, + 0x56, 0x7a, 0x64, 0x43, 0x42, 0x46, 0x65, 0x48, 0x52, 0x6c, 0x63, 0x6d, + 0x35, 0x68, 0x62, 0x43, 0x42, 0x44, 0x51, 0x53, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x0a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x77, 0x4d, + 0x44, 0x55, 0x7a, 0x4d, 0x44, 0x45, 0x77, 0x4e, 0x44, 0x67, 0x7a, 0x4f, + 0x46, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x55, 0x7a, 0x4d, + 0x44, 0x45, 0x77, 0x4e, 0x44, 0x67, 0x7a, 0x4f, 0x46, 0x6f, 0x77, 0x62, + 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x55, 0x30, 0x55, 0x78, 0x0a, 0x46, 0x44, 0x41, 0x53, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, 0x30, 0x46, 0x6b, + 0x5a, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, 0x46, 0x43, + 0x4d, 0x53, 0x59, 0x77, 0x4a, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, + 0x45, 0x78, 0x31, 0x42, 0x5a, 0x47, 0x52, 0x55, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x42, 0x46, 0x65, 0x48, 0x52, 0x6c, 0x63, 0x6d, 0x35, 0x68, + 0x0a, 0x62, 0x43, 0x42, 0x55, 0x56, 0x46, 0x41, 0x67, 0x54, 0x6d, 0x56, + 0x30, 0x64, 0x32, 0x39, 0x79, 0x61, 0x7a, 0x45, 0x69, 0x4d, 0x43, 0x41, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x5a, 0x51, 0x57, 0x52, + 0x6b, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x52, 0x58, 0x68, + 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x59, 0x57, 0x77, 0x67, 0x51, 0x30, 0x45, + 0x67, 0x55, 0x6d, 0x39, 0x76, 0x0a, 0x64, 0x44, 0x43, 0x43, 0x41, 0x53, + 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, + 0x45, 0x42, 0x41, 0x4c, 0x66, 0x33, 0x47, 0x6a, 0x50, 0x6d, 0x38, 0x67, + 0x41, 0x45, 0x4c, 0x54, 0x6e, 0x67, 0x54, 0x6c, 0x76, 0x74, 0x0a, 0x48, + 0x37, 0x78, 0x73, 0x44, 0x38, 0x32, 0x31, 0x2b, 0x69, 0x4f, 0x32, 0x7a, + 0x74, 0x36, 0x62, 0x45, 0x54, 0x4f, 0x58, 0x70, 0x43, 0x6c, 0x4d, 0x66, + 0x5a, 0x4f, 0x66, 0x76, 0x55, 0x71, 0x38, 0x6b, 0x2b, 0x30, 0x44, 0x47, + 0x75, 0x4f, 0x50, 0x7a, 0x2b, 0x56, 0x74, 0x55, 0x46, 0x72, 0x57, 0x6c, + 0x79, 0x6d, 0x55, 0x57, 0x6f, 0x43, 0x77, 0x53, 0x58, 0x72, 0x62, 0x4c, + 0x70, 0x58, 0x39, 0x0a, 0x75, 0x4d, 0x71, 0x2f, 0x4e, 0x7a, 0x67, 0x74, + 0x48, 0x6a, 0x36, 0x52, 0x51, 0x61, 0x31, 0x77, 0x56, 0x73, 0x66, 0x77, + 0x54, 0x7a, 0x2f, 0x6f, 0x4d, 0x70, 0x35, 0x30, 0x79, 0x73, 0x69, 0x51, + 0x56, 0x4f, 0x6e, 0x47, 0x58, 0x77, 0x39, 0x34, 0x6e, 0x5a, 0x70, 0x41, + 0x50, 0x41, 0x36, 0x73, 0x59, 0x61, 0x70, 0x65, 0x46, 0x49, 0x2b, 0x65, + 0x68, 0x36, 0x46, 0x71, 0x55, 0x4e, 0x7a, 0x58, 0x0a, 0x6d, 0x6b, 0x36, + 0x76, 0x42, 0x62, 0x4f, 0x6d, 0x63, 0x5a, 0x53, 0x63, 0x63, 0x62, 0x4e, + 0x51, 0x59, 0x41, 0x72, 0x48, 0x45, 0x35, 0x30, 0x34, 0x42, 0x34, 0x59, + 0x43, 0x71, 0x4f, 0x6d, 0x6f, 0x61, 0x53, 0x59, 0x59, 0x6b, 0x4b, 0x74, + 0x4d, 0x73, 0x45, 0x38, 0x6a, 0x71, 0x7a, 0x70, 0x50, 0x68, 0x4e, 0x6a, + 0x66, 0x7a, 0x70, 0x2f, 0x68, 0x61, 0x57, 0x2b, 0x37, 0x31, 0x30, 0x4c, + 0x58, 0x0a, 0x61, 0x30, 0x54, 0x6b, 0x78, 0x36, 0x33, 0x75, 0x62, 0x55, + 0x46, 0x66, 0x63, 0x6c, 0x70, 0x78, 0x43, 0x44, 0x65, 0x7a, 0x65, 0x57, + 0x57, 0x6b, 0x57, 0x61, 0x43, 0x55, 0x4e, 0x2f, 0x63, 0x41, 0x4c, 0x77, + 0x33, 0x43, 0x6b, 0x6e, 0x4c, 0x61, 0x30, 0x44, 0x68, 0x79, 0x32, 0x78, + 0x53, 0x6f, 0x52, 0x63, 0x52, 0x64, 0x4b, 0x6e, 0x32, 0x33, 0x74, 0x4e, + 0x62, 0x45, 0x37, 0x71, 0x7a, 0x4e, 0x0a, 0x45, 0x30, 0x53, 0x33, 0x79, + 0x53, 0x76, 0x64, 0x51, 0x77, 0x41, 0x6c, 0x2b, 0x6d, 0x47, 0x35, 0x61, + 0x57, 0x70, 0x59, 0x49, 0x78, 0x47, 0x33, 0x70, 0x7a, 0x4f, 0x50, 0x56, + 0x6e, 0x56, 0x5a, 0x39, 0x63, 0x30, 0x70, 0x31, 0x30, 0x61, 0x33, 0x43, + 0x69, 0x74, 0x6c, 0x74, 0x74, 0x4e, 0x43, 0x62, 0x78, 0x57, 0x79, 0x75, + 0x48, 0x76, 0x37, 0x37, 0x2b, 0x6c, 0x64, 0x55, 0x39, 0x55, 0x30, 0x0a, + 0x57, 0x69, 0x63, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, 0x42, + 0x33, 0x44, 0x43, 0x42, 0x32, 0x54, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x72, 0x62, 0x32, 0x59, + 0x65, 0x6a, 0x53, 0x30, 0x4a, 0x76, 0x66, 0x36, 0x78, 0x43, 0x5a, 0x55, + 0x37, 0x77, 0x4f, 0x39, 0x34, 0x43, 0x54, 0x4c, 0x56, 0x42, 0x6f, 0x77, + 0x43, 0x77, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, 0x50, 0x42, 0x41, 0x51, + 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x77, 0x67, 0x5a, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x49, 0x77, 0x53, 0x42, 0x6b, 0x54, 0x43, 0x42, 0x6a, 0x6f, 0x41, + 0x55, 0x72, 0x62, 0x32, 0x59, 0x65, 0x6a, 0x53, 0x30, 0x0a, 0x4a, 0x76, + 0x66, 0x36, 0x78, 0x43, 0x5a, 0x55, 0x37, 0x77, 0x4f, 0x39, 0x34, 0x43, + 0x54, 0x4c, 0x56, 0x42, 0x71, 0x68, 0x63, 0x36, 0x52, 0x78, 0x4d, 0x47, + 0x38, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x59, 0x54, 0x41, 0x6c, 0x4e, 0x46, 0x4d, 0x52, 0x51, 0x77, 0x45, 0x67, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x74, 0x42, 0x5a, 0x47, + 0x52, 0x55, 0x0a, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x42, 0x51, + 0x6a, 0x45, 0x6d, 0x4d, 0x43, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x78, 0x4d, 0x64, 0x51, 0x57, 0x52, 0x6b, 0x56, 0x48, 0x4a, 0x31, 0x63, + 0x33, 0x51, 0x67, 0x52, 0x58, 0x68, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x59, + 0x57, 0x77, 0x67, 0x56, 0x46, 0x52, 0x51, 0x49, 0x45, 0x35, 0x6c, 0x64, + 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, 0x78, 0x0a, 0x49, 0x6a, 0x41, 0x67, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x47, 0x55, 0x46, 0x6b, + 0x5a, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, 0x56, 0x34, + 0x64, 0x47, 0x56, 0x79, 0x62, 0x6d, 0x46, 0x73, 0x49, 0x45, 0x4e, 0x42, + 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x53, 0x43, 0x41, 0x51, 0x45, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x0a, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, + 0x42, 0x41, 0x4c, 0x43, 0x62, 0x34, 0x49, 0x55, 0x6c, 0x77, 0x74, 0x59, + 0x6a, 0x34, 0x67, 0x2b, 0x57, 0x42, 0x70, 0x4b, 0x64, 0x51, 0x5a, 0x69, + 0x63, 0x32, 0x59, 0x52, 0x35, 0x67, 0x64, 0x6b, 0x65, 0x57, 0x78, 0x51, + 0x48, 0x49, 0x7a, 0x5a, 0x6c, 0x6a, 0x37, 0x44, 0x59, 0x64, 0x37, 0x75, + 0x73, 0x51, 0x57, 0x78, 0x48, 0x0a, 0x59, 0x49, 0x4e, 0x52, 0x73, 0x50, + 0x6b, 0x79, 0x50, 0x65, 0x66, 0x38, 0x39, 0x69, 0x59, 0x54, 0x78, 0x34, + 0x41, 0x57, 0x70, 0x62, 0x39, 0x61, 0x2f, 0x49, 0x66, 0x50, 0x65, 0x48, + 0x6d, 0x4a, 0x49, 0x5a, 0x72, 0x69, 0x54, 0x41, 0x63, 0x4b, 0x68, 0x6a, + 0x57, 0x38, 0x38, 0x74, 0x35, 0x52, 0x78, 0x4e, 0x4b, 0x57, 0x74, 0x39, + 0x78, 0x2b, 0x54, 0x75, 0x35, 0x77, 0x2f, 0x52, 0x77, 0x35, 0x0a, 0x36, + 0x77, 0x77, 0x43, 0x55, 0x52, 0x51, 0x74, 0x6a, 0x72, 0x30, 0x57, 0x34, + 0x4d, 0x48, 0x66, 0x52, 0x6e, 0x58, 0x6e, 0x4a, 0x4b, 0x33, 0x73, 0x39, + 0x45, 0x4b, 0x30, 0x68, 0x5a, 0x4e, 0x77, 0x45, 0x47, 0x65, 0x36, 0x6e, + 0x51, 0x59, 0x31, 0x53, 0x68, 0x6a, 0x54, 0x4b, 0x33, 0x72, 0x4d, 0x55, + 0x55, 0x4b, 0x68, 0x65, 0x6d, 0x50, 0x52, 0x35, 0x72, 0x75, 0x68, 0x78, + 0x53, 0x76, 0x43, 0x0a, 0x4e, 0x72, 0x34, 0x54, 0x44, 0x65, 0x61, 0x39, + 0x59, 0x33, 0x35, 0x35, 0x65, 0x36, 0x63, 0x4a, 0x44, 0x55, 0x43, 0x72, + 0x61, 0x74, 0x32, 0x50, 0x69, 0x73, 0x50, 0x32, 0x39, 0x6f, 0x77, 0x61, + 0x51, 0x67, 0x56, 0x52, 0x31, 0x45, 0x58, 0x31, 0x6e, 0x36, 0x64, 0x69, + 0x49, 0x57, 0x67, 0x56, 0x49, 0x45, 0x4d, 0x38, 0x6d, 0x65, 0x64, 0x38, + 0x76, 0x53, 0x54, 0x59, 0x71, 0x5a, 0x45, 0x58, 0x0a, 0x63, 0x34, 0x67, + 0x2f, 0x56, 0x68, 0x73, 0x78, 0x4f, 0x42, 0x69, 0x30, 0x63, 0x51, 0x2b, + 0x61, 0x7a, 0x63, 0x67, 0x4f, 0x6e, 0x6f, 0x34, 0x75, 0x47, 0x2b, 0x47, + 0x4d, 0x6d, 0x49, 0x50, 0x4c, 0x48, 0x7a, 0x48, 0x78, 0x52, 0x45, 0x7a, + 0x47, 0x42, 0x48, 0x4e, 0x4a, 0x64, 0x6d, 0x41, 0x50, 0x78, 0x2f, 0x69, + 0x39, 0x46, 0x34, 0x42, 0x72, 0x4c, 0x75, 0x6e, 0x4d, 0x54, 0x41, 0x35, + 0x61, 0x0a, 0x6d, 0x6e, 0x6b, 0x50, 0x49, 0x41, 0x6f, 0x75, 0x31, 0x5a, + 0x35, 0x6a, 0x4a, 0x68, 0x35, 0x56, 0x6b, 0x70, 0x54, 0x59, 0x67, 0x68, + 0x64, 0x61, 0x65, 0x39, 0x43, 0x38, 0x78, 0x34, 0x39, 0x4f, 0x68, 0x67, + 0x51, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x45, 0x6e, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, + 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x20, 0x69, + 0x73, 0x20, 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, + 0x65, 0x64, 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, + 0x6e, 0x63, 0x65, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x36, + 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x45, 0x6e, 0x74, 0x72, + 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, + 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x43, 0x50, 0x53, 0x20, 0x69, 0x73, 0x20, + 0x69, 0x6e, 0x63, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x65, 0x64, + 0x20, 0x62, 0x79, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, + 0x65, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x36, 0x20, 0x45, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x45, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, + 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, + 0x31, 0x36, 0x34, 0x36, 0x36, 0x30, 0x38, 0x32, 0x30, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x36, 0x3a, 0x61, 0x35, 0x3a, 0x63, + 0x33, 0x3a, 0x65, 0x64, 0x3a, 0x35, 0x64, 0x3a, 0x64, 0x64, 0x3a, 0x33, + 0x65, 0x3a, 0x30, 0x30, 0x3a, 0x63, 0x31, 0x3a, 0x33, 0x64, 0x3a, 0x38, + 0x37, 0x3a, 0x39, 0x32, 0x3a, 0x31, 0x66, 0x3a, 0x31, 0x64, 0x3a, 0x33, + 0x66, 0x3a, 0x65, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x62, 0x33, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x31, 0x3a, 0x62, 0x37, + 0x3a, 0x34, 0x30, 0x3a, 0x65, 0x33, 0x3a, 0x36, 0x63, 0x3a, 0x38, 0x34, + 0x3a, 0x30, 0x32, 0x3a, 0x64, 0x61, 0x3a, 0x64, 0x63, 0x3a, 0x33, 0x37, + 0x3a, 0x64, 0x34, 0x3a, 0x34, 0x64, 0x3a, 0x66, 0x35, 0x3a, 0x64, 0x34, + 0x3a, 0x36, 0x37, 0x3a, 0x34, 0x39, 0x3a, 0x35, 0x32, 0x3a, 0x66, 0x39, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, + 0x33, 0x3a, 0x63, 0x31, 0x3a, 0x37, 0x36, 0x3a, 0x34, 0x33, 0x3a, 0x34, + 0x66, 0x3a, 0x31, 0x62, 0x3a, 0x63, 0x36, 0x3a, 0x64, 0x35, 0x3a, 0x61, + 0x64, 0x3a, 0x66, 0x34, 0x3a, 0x35, 0x62, 0x3a, 0x30, 0x65, 0x3a, 0x37, + 0x36, 0x3a, 0x65, 0x37, 0x3a, 0x32, 0x37, 0x3a, 0x32, 0x38, 0x3a, 0x37, + 0x63, 0x3a, 0x38, 0x64, 0x3a, 0x65, 0x35, 0x3a, 0x37, 0x36, 0x3a, 0x31, + 0x36, 0x3a, 0x63, 0x31, 0x3a, 0x65, 0x36, 0x3a, 0x65, 0x36, 0x3a, 0x31, + 0x34, 0x3a, 0x31, 0x61, 0x3a, 0x32, 0x62, 0x3a, 0x32, 0x63, 0x3a, 0x62, + 0x63, 0x3a, 0x37, 0x64, 0x3a, 0x38, 0x65, 0x3a, 0x34, 0x63, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x6b, 0x54, 0x43, 0x43, 0x41, + 0x33, 0x6d, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, 0x52, + 0x57, 0x74, 0x51, 0x56, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, + 0x44, 0x43, 0x42, 0x73, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x0a, 0x56, 0x56, 0x4d, 0x78, + 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, + 0x44, 0x55, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x73, + 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x4f, 0x54, 0x41, 0x33, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x4d, 0x48, 0x64, 0x33, + 0x64, 0x79, 0x35, 0x6c, 0x62, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x0a, 0x4c, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x39, 0x44, 0x55, 0x46, 0x4d, + 0x67, 0x61, 0x58, 0x4d, 0x67, 0x61, 0x57, 0x35, 0x6a, 0x62, 0x33, 0x4a, + 0x77, 0x62, 0x33, 0x4a, 0x68, 0x64, 0x47, 0x56, 0x6b, 0x49, 0x47, 0x4a, + 0x35, 0x49, 0x48, 0x4a, 0x6c, 0x5a, 0x6d, 0x56, 0x79, 0x5a, 0x57, 0x35, + 0x6a, 0x5a, 0x54, 0x45, 0x66, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x78, 0x4d, 0x57, 0x0a, 0x4b, 0x47, 0x4d, 0x70, 0x49, 0x44, + 0x49, 0x77, 0x4d, 0x44, 0x59, 0x67, 0x52, 0x57, 0x35, 0x30, 0x63, 0x6e, + 0x56, 0x7a, 0x64, 0x43, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, + 0x45, 0x74, 0x4d, 0x43, 0x73, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, + 0x4d, 0x6b, 0x52, 0x57, 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, + 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x0a, 0x63, + 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, + 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, + 0x58, 0x52, 0x35, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x32, 0x4d, + 0x54, 0x45, 0x79, 0x4e, 0x7a, 0x49, 0x77, 0x4d, 0x6a, 0x4d, 0x30, 0x4d, + 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x32, 0x4d, 0x54, 0x45, 0x79, 0x4e, + 0x7a, 0x49, 0x77, 0x0a, 0x4e, 0x54, 0x4d, 0x30, 0x4d, 0x6c, 0x6f, 0x77, + 0x67, 0x62, 0x41, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, 0x54, 0x4d, 0x52, 0x59, 0x77, + 0x46, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, 0x46, + 0x62, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, 0x43, 0x42, 0x4a, + 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x54, 0x6b, 0x77, 0x0a, 0x4e, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x7a, 0x42, 0x33, 0x64, 0x33, 0x63, + 0x75, 0x5a, 0x57, 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x35, + 0x75, 0x5a, 0x58, 0x51, 0x76, 0x51, 0x31, 0x42, 0x54, 0x49, 0x47, 0x6c, + 0x7a, 0x49, 0x47, 0x6c, 0x75, 0x59, 0x32, 0x39, 0x79, 0x63, 0x47, 0x39, + 0x79, 0x59, 0x58, 0x52, 0x6c, 0x5a, 0x43, 0x42, 0x69, 0x65, 0x53, 0x42, + 0x79, 0x0a, 0x5a, 0x57, 0x5a, 0x6c, 0x63, 0x6d, 0x56, 0x75, 0x59, 0x32, + 0x55, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x73, 0x54, 0x46, 0x69, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x79, 0x4d, 0x44, + 0x41, 0x32, 0x49, 0x45, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, + 0x51, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x4c, 0x54, + 0x41, 0x72, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x54, 0x4a, + 0x45, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x55, + 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, + 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, + 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, + 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x0a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, + 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, + 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4c, 0x61, 0x56, + 0x74, 0x6b, 0x4e, 0x43, 0x2b, 0x73, 0x5a, 0x74, 0x4b, 0x6d, 0x39, 0x49, + 0x33, 0x35, 0x52, 0x4d, 0x4f, 0x56, 0x63, 0x46, 0x37, 0x73, 0x4e, 0x35, + 0x45, 0x55, 0x46, 0x6f, 0x0a, 0x4e, 0x75, 0x33, 0x73, 0x2f, 0x70, 0x6f, + 0x42, 0x6a, 0x36, 0x45, 0x34, 0x4b, 0x50, 0x7a, 0x33, 0x45, 0x45, 0x5a, + 0x6d, 0x4c, 0x6b, 0x30, 0x65, 0x47, 0x72, 0x45, 0x61, 0x54, 0x73, 0x62, + 0x52, 0x77, 0x4a, 0x57, 0x49, 0x73, 0x4d, 0x6e, 0x2f, 0x4d, 0x59, 0x73, + 0x7a, 0x41, 0x39, 0x75, 0x33, 0x67, 0x33, 0x73, 0x2b, 0x49, 0x49, 0x52, + 0x65, 0x37, 0x62, 0x4a, 0x57, 0x4b, 0x4b, 0x66, 0x34, 0x0a, 0x34, 0x4c, + 0x6c, 0x41, 0x63, 0x54, 0x66, 0x46, 0x79, 0x30, 0x63, 0x4f, 0x6c, 0x79, + 0x70, 0x6f, 0x77, 0x43, 0x4b, 0x56, 0x59, 0x68, 0x58, 0x62, 0x52, 0x39, + 0x6e, 0x31, 0x30, 0x43, 0x76, 0x2f, 0x67, 0x6b, 0x76, 0x4a, 0x72, 0x54, + 0x37, 0x65, 0x54, 0x4e, 0x75, 0x51, 0x67, 0x46, 0x41, 0x2f, 0x43, 0x59, + 0x71, 0x45, 0x41, 0x4f, 0x77, 0x77, 0x43, 0x6a, 0x30, 0x59, 0x7a, 0x66, + 0x76, 0x39, 0x0a, 0x4b, 0x6c, 0x6d, 0x61, 0x49, 0x35, 0x55, 0x58, 0x4c, + 0x45, 0x57, 0x65, 0x48, 0x32, 0x35, 0x44, 0x65, 0x57, 0x30, 0x4d, 0x58, + 0x4a, 0x6a, 0x2b, 0x53, 0x4b, 0x66, 0x46, 0x49, 0x30, 0x64, 0x63, 0x58, + 0x76, 0x31, 0x75, 0x35, 0x78, 0x36, 0x30, 0x39, 0x6d, 0x68, 0x46, 0x30, + 0x59, 0x61, 0x44, 0x57, 0x36, 0x4b, 0x4b, 0x6a, 0x62, 0x48, 0x6a, 0x4b, + 0x59, 0x44, 0x2b, 0x4a, 0x58, 0x47, 0x49, 0x0a, 0x72, 0x62, 0x36, 0x38, + 0x6a, 0x36, 0x78, 0x53, 0x6c, 0x6b, 0x75, 0x71, 0x55, 0x59, 0x33, 0x6b, + 0x45, 0x7a, 0x45, 0x5a, 0x36, 0x45, 0x35, 0x4e, 0x6e, 0x39, 0x75, 0x73, + 0x73, 0x32, 0x72, 0x56, 0x76, 0x44, 0x6c, 0x55, 0x63, 0x63, 0x70, 0x36, + 0x65, 0x6e, 0x2b, 0x51, 0x33, 0x58, 0x30, 0x64, 0x67, 0x4e, 0x6d, 0x42, + 0x75, 0x31, 0x6b, 0x6d, 0x77, 0x68, 0x48, 0x2b, 0x35, 0x70, 0x50, 0x69, + 0x0a, 0x39, 0x34, 0x44, 0x6b, 0x5a, 0x66, 0x73, 0x30, 0x4e, 0x77, 0x34, + 0x70, 0x67, 0x48, 0x42, 0x4e, 0x72, 0x7a, 0x69, 0x47, 0x4c, 0x70, 0x35, + 0x2f, 0x56, 0x36, 0x2b, 0x65, 0x46, 0x36, 0x37, 0x72, 0x48, 0x4d, 0x73, + 0x6f, 0x49, 0x56, 0x2b, 0x32, 0x48, 0x4e, 0x6a, 0x6e, 0x6f, 0x67, 0x51, + 0x69, 0x2b, 0x64, 0x50, 0x61, 0x32, 0x4d, 0x73, 0x43, 0x41, 0x77, 0x45, + 0x41, 0x41, 0x61, 0x4f, 0x42, 0x0a, 0x73, 0x44, 0x43, 0x42, 0x72, 0x54, + 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x72, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x41, 0x45, 0x4a, 0x44, 0x41, 0x69, 0x0a, 0x67, + 0x41, 0x38, 0x79, 0x4d, 0x44, 0x41, 0x32, 0x4d, 0x54, 0x45, 0x79, 0x4e, + 0x7a, 0x49, 0x77, 0x4d, 0x6a, 0x4d, 0x30, 0x4d, 0x6c, 0x71, 0x42, 0x44, + 0x7a, 0x49, 0x77, 0x4d, 0x6a, 0x59, 0x78, 0x4d, 0x54, 0x49, 0x33, 0x4d, + 0x6a, 0x41, 0x31, 0x4d, 0x7a, 0x51, 0x79, 0x57, 0x6a, 0x41, 0x66, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, + 0x42, 0x52, 0x6f, 0x0a, 0x6b, 0x4f, 0x52, 0x6e, 0x70, 0x4b, 0x5a, 0x54, + 0x67, 0x4d, 0x65, 0x47, 0x5a, 0x71, 0x54, 0x78, 0x39, 0x30, 0x74, 0x44, + 0x2b, 0x34, 0x53, 0x39, 0x62, 0x54, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x61, 0x4a, 0x44, 0x6b, + 0x5a, 0x36, 0x53, 0x6d, 0x55, 0x34, 0x44, 0x48, 0x68, 0x6d, 0x61, 0x6b, + 0x38, 0x66, 0x64, 0x4c, 0x51, 0x2f, 0x75, 0x45, 0x0a, 0x76, 0x57, 0x30, + 0x77, 0x48, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x5a, + 0x39, 0x42, 0x30, 0x45, 0x41, 0x42, 0x42, 0x41, 0x77, 0x44, 0x68, 0x73, + 0x49, 0x56, 0x6a, 0x63, 0x75, 0x4d, 0x54, 0x6f, 0x30, 0x4c, 0x6a, 0x41, + 0x44, 0x41, 0x67, 0x53, 0x51, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, + 0x41, 0x0a, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, 0x54, 0x31, 0x44, + 0x43, 0x77, 0x31, 0x77, 0x4d, 0x67, 0x4b, 0x74, 0x44, 0x35, 0x59, 0x2b, + 0x69, 0x52, 0x44, 0x41, 0x55, 0x67, 0x71, 0x56, 0x38, 0x5a, 0x79, 0x6e, + 0x74, 0x79, 0x54, 0x74, 0x53, 0x78, 0x32, 0x39, 0x43, 0x57, 0x2b, 0x31, + 0x52, 0x61, 0x47, 0x53, 0x77, 0x4d, 0x43, 0x50, 0x65, 0x79, 0x76, 0x49, + 0x57, 0x6f, 0x6e, 0x58, 0x39, 0x74, 0x0a, 0x4f, 0x31, 0x4b, 0x7a, 0x4b, + 0x74, 0x76, 0x6e, 0x31, 0x49, 0x53, 0x4d, 0x59, 0x2f, 0x59, 0x50, 0x79, + 0x79, 0x59, 0x42, 0x6b, 0x56, 0x42, 0x73, 0x39, 0x46, 0x38, 0x55, 0x34, + 0x70, 0x4e, 0x30, 0x77, 0x42, 0x4f, 0x65, 0x4d, 0x44, 0x70, 0x51, 0x34, + 0x37, 0x52, 0x67, 0x78, 0x52, 0x7a, 0x77, 0x49, 0x6b, 0x53, 0x4e, 0x63, + 0x55, 0x65, 0x73, 0x79, 0x42, 0x72, 0x4a, 0x36, 0x5a, 0x75, 0x61, 0x0a, + 0x41, 0x47, 0x41, 0x54, 0x2f, 0x33, 0x42, 0x2b, 0x58, 0x78, 0x46, 0x4e, + 0x53, 0x52, 0x75, 0x7a, 0x46, 0x56, 0x4a, 0x37, 0x79, 0x56, 0x54, 0x61, + 0x76, 0x35, 0x32, 0x56, 0x72, 0x32, 0x75, 0x61, 0x32, 0x4a, 0x37, 0x70, + 0x38, 0x65, 0x52, 0x44, 0x6a, 0x65, 0x49, 0x52, 0x52, 0x44, 0x71, 0x2f, + 0x72, 0x37, 0x32, 0x44, 0x51, 0x6e, 0x4e, 0x53, 0x69, 0x36, 0x71, 0x37, + 0x70, 0x79, 0x6e, 0x50, 0x0a, 0x39, 0x57, 0x51, 0x63, 0x43, 0x6b, 0x33, + 0x52, 0x76, 0x4b, 0x71, 0x73, 0x6e, 0x79, 0x72, 0x51, 0x2f, 0x33, 0x39, + 0x2f, 0x32, 0x6e, 0x33, 0x71, 0x73, 0x65, 0x30, 0x77, 0x4a, 0x63, 0x47, + 0x45, 0x32, 0x6a, 0x54, 0x53, 0x57, 0x33, 0x69, 0x44, 0x56, 0x75, 0x79, + 0x63, 0x4e, 0x73, 0x4d, 0x6d, 0x34, 0x68, 0x48, 0x32, 0x5a, 0x30, 0x6b, + 0x64, 0x6b, 0x71, 0x75, 0x4d, 0x2b, 0x2b, 0x76, 0x2f, 0x0a, 0x65, 0x75, + 0x36, 0x46, 0x53, 0x71, 0x64, 0x51, 0x67, 0x50, 0x43, 0x6e, 0x58, 0x45, + 0x71, 0x55, 0x4c, 0x6c, 0x38, 0x46, 0x6d, 0x54, 0x78, 0x53, 0x51, 0x65, + 0x44, 0x4e, 0x74, 0x47, 0x50, 0x50, 0x41, 0x55, 0x4f, 0x36, 0x6e, 0x49, + 0x50, 0x63, 0x6a, 0x32, 0x41, 0x37, 0x38, 0x31, 0x71, 0x30, 0x74, 0x48, + 0x75, 0x75, 0x32, 0x67, 0x75, 0x51, 0x4f, 0x48, 0x58, 0x76, 0x67, 0x52, + 0x31, 0x6d, 0x0a, 0x30, 0x76, 0x64, 0x58, 0x63, 0x44, 0x61, 0x7a, 0x76, + 0x2f, 0x77, 0x6f, 0x72, 0x33, 0x45, 0x6c, 0x68, 0x56, 0x73, 0x54, 0x2f, + 0x68, 0x35, 0x2f, 0x57, 0x72, 0x51, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x47, 0x65, + 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x65, + 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x34, 0x34, 0x37, 0x30, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x37, 0x3a, 0x37, 0x35, 0x3a, + 0x61, 0x62, 0x3a, 0x32, 0x39, 0x3a, 0x66, 0x62, 0x3a, 0x35, 0x31, 0x3a, + 0x34, 0x65, 0x3a, 0x62, 0x37, 0x3a, 0x37, 0x37, 0x3a, 0x35, 0x65, 0x3a, + 0x66, 0x66, 0x3a, 0x30, 0x35, 0x3a, 0x33, 0x63, 0x3a, 0x39, 0x39, 0x3a, + 0x38, 0x65, 0x3a, 0x66, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x64, 0x65, 0x3a, 0x32, 0x38, 0x3a, 0x66, 0x34, 0x3a, 0x61, + 0x34, 0x3a, 0x66, 0x66, 0x3a, 0x65, 0x35, 0x3a, 0x62, 0x39, 0x3a, 0x32, + 0x66, 0x3a, 0x61, 0x33, 0x3a, 0x63, 0x35, 0x3a, 0x30, 0x33, 0x3a, 0x64, + 0x31, 0x3a, 0x61, 0x33, 0x3a, 0x34, 0x39, 0x3a, 0x61, 0x37, 0x3a, 0x66, + 0x39, 0x3a, 0x39, 0x36, 0x3a, 0x32, 0x61, 0x3a, 0x38, 0x32, 0x3a, 0x31, + 0x32, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x66, 0x66, 0x3a, 0x38, 0x35, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x64, 0x3a, + 0x32, 0x35, 0x3a, 0x31, 0x64, 0x3a, 0x63, 0x64, 0x3a, 0x38, 0x38, 0x3a, + 0x64, 0x33, 0x3a, 0x36, 0x36, 0x3a, 0x35, 0x36, 0x3a, 0x66, 0x34, 0x3a, + 0x35, 0x30, 0x3a, 0x31, 0x32, 0x3a, 0x36, 0x37, 0x3a, 0x39, 0x38, 0x3a, + 0x63, 0x66, 0x3a, 0x61, 0x62, 0x3a, 0x61, 0x61, 0x3a, 0x64, 0x65, 0x3a, + 0x34, 0x30, 0x3a, 0x37, 0x39, 0x3a, 0x39, 0x63, 0x3a, 0x37, 0x32, 0x3a, + 0x32, 0x64, 0x3a, 0x65, 0x34, 0x3a, 0x64, 0x32, 0x3a, 0x62, 0x35, 0x3a, + 0x64, 0x62, 0x3a, 0x33, 0x36, 0x3a, 0x61, 0x37, 0x3a, 0x33, 0x61, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x56, 0x44, 0x43, 0x43, + 0x41, 0x6a, 0x79, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x44, + 0x41, 0x6a, 0x52, 0x57, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, + 0x4d, 0x45, 0x49, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, 0x54, 0x0a, 0x4d, 0x52, 0x59, + 0x77, 0x46, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, + 0x48, 0x5a, 0x57, 0x39, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, + 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x52, 0x73, 0x77, 0x47, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x4a, 0x48, 0x5a, 0x57, 0x39, + 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x48, 0x62, 0x47, 0x39, + 0x69, 0x0a, 0x59, 0x57, 0x77, 0x67, 0x51, 0x30, 0x45, 0x77, 0x48, 0x68, + 0x63, 0x4e, 0x4d, 0x44, 0x49, 0x77, 0x4e, 0x54, 0x49, 0x78, 0x4d, 0x44, + 0x51, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, + 0x49, 0x77, 0x4e, 0x54, 0x49, 0x78, 0x4d, 0x44, 0x51, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x57, 0x6a, 0x42, 0x43, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x56, 0x55, + 0x7a, 0x45, 0x57, 0x4d, 0x42, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x4e, 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, + 0x33, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x62, 0x4d, + 0x42, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x53, 0x52, + 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x0a, + 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x49, 0x45, 0x4e, 0x42, + 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, + 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, + 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x32, 0x73, 0x77, 0x59, + 0x59, 0x7a, 0x44, 0x39, 0x0a, 0x39, 0x42, 0x63, 0x6a, 0x47, 0x6c, 0x5a, + 0x2b, 0x57, 0x39, 0x38, 0x38, 0x62, 0x44, 0x6a, 0x6b, 0x63, 0x62, 0x64, + 0x34, 0x6b, 0x64, 0x53, 0x38, 0x6f, 0x64, 0x68, 0x4d, 0x2b, 0x4b, 0x68, + 0x44, 0x74, 0x67, 0x50, 0x70, 0x54, 0x53, 0x45, 0x48, 0x43, 0x49, 0x6a, + 0x61, 0x57, 0x43, 0x39, 0x6d, 0x4f, 0x53, 0x6d, 0x39, 0x42, 0x58, 0x69, + 0x4c, 0x6e, 0x54, 0x6a, 0x6f, 0x42, 0x62, 0x64, 0x71, 0x0a, 0x66, 0x6e, + 0x47, 0x6b, 0x35, 0x73, 0x52, 0x67, 0x70, 0x72, 0x44, 0x76, 0x67, 0x4f, + 0x53, 0x4a, 0x4b, 0x41, 0x2b, 0x65, 0x4a, 0x64, 0x62, 0x74, 0x67, 0x2f, + 0x4f, 0x74, 0x70, 0x70, 0x48, 0x48, 0x6d, 0x4d, 0x6c, 0x43, 0x47, 0x44, + 0x55, 0x55, 0x6e, 0x61, 0x32, 0x59, 0x52, 0x70, 0x49, 0x75, 0x54, 0x38, + 0x72, 0x78, 0x68, 0x30, 0x50, 0x42, 0x46, 0x70, 0x56, 0x58, 0x4c, 0x56, + 0x44, 0x76, 0x0a, 0x69, 0x53, 0x32, 0x41, 0x65, 0x6c, 0x65, 0x74, 0x38, + 0x75, 0x35, 0x66, 0x61, 0x39, 0x49, 0x41, 0x6a, 0x62, 0x6b, 0x55, 0x2b, + 0x42, 0x51, 0x56, 0x4e, 0x64, 0x6e, 0x41, 0x52, 0x71, 0x4e, 0x37, 0x63, + 0x73, 0x69, 0x52, 0x76, 0x38, 0x6c, 0x56, 0x4b, 0x38, 0x33, 0x51, 0x6c, + 0x7a, 0x36, 0x63, 0x4a, 0x6d, 0x54, 0x4d, 0x33, 0x38, 0x36, 0x44, 0x47, + 0x58, 0x48, 0x4b, 0x54, 0x75, 0x62, 0x55, 0x0a, 0x31, 0x58, 0x75, 0x70, + 0x47, 0x63, 0x31, 0x56, 0x33, 0x73, 0x6a, 0x73, 0x30, 0x6c, 0x34, 0x34, + 0x55, 0x2b, 0x56, 0x63, 0x54, 0x34, 0x77, 0x74, 0x2f, 0x6c, 0x41, 0x6a, + 0x4e, 0x76, 0x78, 0x6d, 0x35, 0x73, 0x75, 0x4f, 0x70, 0x44, 0x6b, 0x5a, + 0x41, 0x4c, 0x65, 0x56, 0x41, 0x6a, 0x6d, 0x52, 0x43, 0x77, 0x37, 0x2b, + 0x4f, 0x43, 0x37, 0x52, 0x48, 0x51, 0x57, 0x61, 0x39, 0x6b, 0x30, 0x2b, + 0x0a, 0x62, 0x77, 0x38, 0x48, 0x48, 0x61, 0x38, 0x73, 0x48, 0x6f, 0x39, + 0x67, 0x4f, 0x65, 0x4c, 0x36, 0x4e, 0x6c, 0x4d, 0x54, 0x4f, 0x64, 0x52, + 0x65, 0x4a, 0x69, 0x76, 0x62, 0x50, 0x61, 0x67, 0x55, 0x76, 0x54, 0x4c, + 0x72, 0x47, 0x41, 0x4d, 0x6f, 0x55, 0x67, 0x52, 0x78, 0x35, 0x61, 0x73, + 0x7a, 0x50, 0x65, 0x45, 0x34, 0x75, 0x77, 0x63, 0x32, 0x68, 0x47, 0x4b, + 0x63, 0x65, 0x65, 0x6f, 0x57, 0x0a, 0x4d, 0x50, 0x52, 0x66, 0x77, 0x43, + 0x76, 0x6f, 0x63, 0x57, 0x76, 0x6b, 0x2b, 0x51, 0x49, 0x44, 0x41, 0x51, + 0x41, 0x42, 0x6f, 0x31, 0x4d, 0x77, 0x55, 0x54, 0x41, 0x50, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, + 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x54, 0x41, 0x0a, 0x65, + 0x70, 0x68, 0x6f, 0x6a, 0x59, 0x6e, 0x37, 0x71, 0x77, 0x56, 0x6b, 0x44, + 0x42, 0x46, 0x39, 0x71, 0x6e, 0x31, 0x6c, 0x75, 0x4d, 0x72, 0x4d, 0x54, + 0x6a, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, + 0x44, 0x41, 0x57, 0x67, 0x42, 0x54, 0x41, 0x65, 0x70, 0x68, 0x6f, 0x6a, + 0x59, 0x6e, 0x37, 0x71, 0x77, 0x56, 0x6b, 0x44, 0x42, 0x46, 0x39, 0x71, + 0x6e, 0x31, 0x6c, 0x0a, 0x75, 0x4d, 0x72, 0x4d, 0x54, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, + 0x4e, 0x65, 0x4d, 0x70, 0x61, 0x75, 0x55, 0x76, 0x58, 0x56, 0x53, 0x4f, + 0x4b, 0x56, 0x43, 0x55, 0x6e, 0x35, 0x6b, 0x61, 0x46, 0x4f, 0x53, 0x50, + 0x65, 0x43, 0x70, 0x69, 0x6c, 0x4b, 0x49, 0x6e, 0x0a, 0x5a, 0x35, 0x37, + 0x51, 0x7a, 0x78, 0x70, 0x65, 0x52, 0x2b, 0x6e, 0x42, 0x73, 0x71, 0x54, + 0x50, 0x33, 0x55, 0x45, 0x61, 0x42, 0x55, 0x36, 0x62, 0x53, 0x2b, 0x35, + 0x4b, 0x62, 0x31, 0x56, 0x53, 0x73, 0x79, 0x53, 0x68, 0x4e, 0x77, 0x72, + 0x72, 0x5a, 0x48, 0x59, 0x71, 0x4c, 0x69, 0x7a, 0x7a, 0x2f, 0x54, 0x74, + 0x31, 0x6b, 0x4c, 0x2f, 0x36, 0x63, 0x64, 0x6a, 0x48, 0x50, 0x54, 0x66, + 0x53, 0x0a, 0x74, 0x51, 0x57, 0x56, 0x59, 0x72, 0x6d, 0x6d, 0x33, 0x6f, + 0x6b, 0x39, 0x4e, 0x6e, 0x73, 0x34, 0x64, 0x30, 0x69, 0x58, 0x72, 0x4b, + 0x59, 0x67, 0x6a, 0x79, 0x36, 0x6d, 0x79, 0x51, 0x7a, 0x43, 0x73, 0x70, + 0x6c, 0x46, 0x41, 0x4d, 0x66, 0x4f, 0x45, 0x56, 0x45, 0x69, 0x49, 0x75, + 0x43, 0x6c, 0x36, 0x72, 0x59, 0x56, 0x53, 0x41, 0x6c, 0x6b, 0x36, 0x6c, + 0x35, 0x50, 0x64, 0x50, 0x63, 0x46, 0x0a, 0x50, 0x73, 0x65, 0x4b, 0x55, + 0x67, 0x7a, 0x62, 0x46, 0x62, 0x53, 0x39, 0x62, 0x5a, 0x76, 0x6c, 0x78, + 0x72, 0x46, 0x55, 0x61, 0x4b, 0x6e, 0x6a, 0x61, 0x5a, 0x43, 0x32, 0x6d, + 0x71, 0x55, 0x50, 0x75, 0x4c, 0x6b, 0x2f, 0x49, 0x48, 0x32, 0x75, 0x53, + 0x72, 0x57, 0x34, 0x6e, 0x4f, 0x51, 0x64, 0x74, 0x71, 0x76, 0x6d, 0x6c, + 0x4b, 0x58, 0x42, 0x78, 0x34, 0x4f, 0x74, 0x32, 0x2f, 0x55, 0x6e, 0x0a, + 0x68, 0x77, 0x34, 0x45, 0x62, 0x4e, 0x58, 0x2f, 0x33, 0x61, 0x42, 0x64, + 0x37, 0x59, 0x64, 0x53, 0x74, 0x79, 0x73, 0x56, 0x41, 0x71, 0x34, 0x35, + 0x70, 0x6d, 0x70, 0x30, 0x36, 0x64, 0x72, 0x45, 0x35, 0x37, 0x78, 0x4e, + 0x4e, 0x42, 0x36, 0x70, 0x58, 0x45, 0x30, 0x7a, 0x58, 0x35, 0x49, 0x4a, + 0x4c, 0x34, 0x68, 0x6d, 0x58, 0x58, 0x65, 0x58, 0x78, 0x78, 0x31, 0x32, + 0x45, 0x36, 0x6e, 0x56, 0x0a, 0x35, 0x66, 0x45, 0x57, 0x43, 0x52, 0x45, + 0x31, 0x31, 0x61, 0x7a, 0x62, 0x4a, 0x48, 0x46, 0x77, 0x4c, 0x4a, 0x68, + 0x57, 0x43, 0x39, 0x6b, 0x58, 0x74, 0x4e, 0x48, 0x6a, 0x55, 0x53, 0x74, + 0x65, 0x64, 0x65, 0x6a, 0x56, 0x30, 0x4e, 0x78, 0x50, 0x4e, 0x4f, 0x33, + 0x43, 0x42, 0x57, 0x61, 0x41, 0x6f, 0x63, 0x76, 0x6d, 0x4d, 0x77, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, + 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, + 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x76, 0x65, + 0x72, 0x73, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x47, 0x65, + 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x65, + 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x76, 0x65, + 0x72, 0x73, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x32, 0x3a, 0x36, 0x35, 0x3a, 0x35, 0x38, + 0x3a, 0x38, 0x62, 0x3a, 0x61, 0x32, 0x3a, 0x31, 0x61, 0x3a, 0x33, 0x31, + 0x3a, 0x37, 0x32, 0x3a, 0x37, 0x33, 0x3a, 0x36, 0x38, 0x3a, 0x35, 0x63, + 0x3a, 0x62, 0x34, 0x3a, 0x61, 0x35, 0x3a, 0x37, 0x61, 0x3a, 0x30, 0x37, + 0x3a, 0x34, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x65, 0x36, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x33, 0x3a, 0x33, 0x35, 0x3a, + 0x34, 0x33, 0x3a, 0x37, 0x39, 0x3a, 0x30, 0x35, 0x3a, 0x39, 0x61, 0x3a, + 0x34, 0x62, 0x3a, 0x36, 0x38, 0x3a, 0x33, 0x30, 0x3a, 0x39, 0x64, 0x3a, + 0x38, 0x61, 0x3a, 0x32, 0x66, 0x3a, 0x37, 0x34, 0x3a, 0x32, 0x32, 0x3a, + 0x31, 0x35, 0x3a, 0x38, 0x37, 0x3a, 0x65, 0x63, 0x3a, 0x37, 0x39, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x30, + 0x3a, 0x34, 0x35, 0x3a, 0x39, 0x62, 0x3a, 0x39, 0x66, 0x3a, 0x36, 0x33, + 0x3a, 0x62, 0x32, 0x3a, 0x32, 0x35, 0x3a, 0x35, 0x39, 0x3a, 0x66, 0x35, + 0x3a, 0x66, 0x61, 0x3a, 0x35, 0x64, 0x3a, 0x34, 0x63, 0x3a, 0x36, 0x64, + 0x3a, 0x62, 0x33, 0x3a, 0x66, 0x39, 0x3a, 0x66, 0x37, 0x3a, 0x32, 0x66, + 0x3a, 0x66, 0x31, 0x3a, 0x39, 0x33, 0x3a, 0x34, 0x32, 0x3a, 0x30, 0x33, + 0x3a, 0x33, 0x35, 0x3a, 0x37, 0x38, 0x3a, 0x66, 0x30, 0x3a, 0x37, 0x33, + 0x3a, 0x62, 0x66, 0x3a, 0x31, 0x64, 0x3a, 0x31, 0x62, 0x3a, 0x34, 0x36, + 0x3a, 0x63, 0x62, 0x3a, 0x62, 0x39, 0x3a, 0x31, 0x32, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x61, 0x44, 0x43, 0x43, 0x41, 0x31, + 0x43, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x54, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x46, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x57, 0x0a, 0x4d, 0x42, 0x51, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4e, 0x52, 0x32, 0x56, 0x76, 0x56, + 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, + 0x6a, 0x45, 0x65, 0x4d, 0x42, 0x77, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, + 0x78, 0x4d, 0x56, 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, + 0x33, 0x51, 0x67, 0x56, 0x57, 0x35, 0x70, 0x64, 0x6d, 0x56, 0x79, 0x0a, + 0x63, 0x32, 0x46, 0x73, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, 0x34, 0x58, + 0x44, 0x54, 0x41, 0x30, 0x4d, 0x44, 0x4d, 0x77, 0x4e, 0x44, 0x41, 0x31, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x35, + 0x4d, 0x44, 0x4d, 0x77, 0x4e, 0x44, 0x41, 0x31, 0x4d, 0x44, 0x41, 0x77, + 0x4d, 0x46, 0x6f, 0x77, 0x52, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, + 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x54, 0x44, 0x55, 0x64, 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, + 0x30, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x48, 0x6a, 0x41, + 0x63, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x55, 0x64, + 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x0a, 0x49, 0x46, + 0x56, 0x75, 0x61, 0x58, 0x5a, 0x6c, 0x63, 0x6e, 0x4e, 0x68, 0x62, 0x43, + 0x42, 0x44, 0x51, 0x54, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4b, + 0x59, 0x56, 0x0a, 0x56, 0x61, 0x43, 0x6a, 0x78, 0x75, 0x41, 0x66, 0x6a, + 0x4a, 0x30, 0x68, 0x55, 0x4e, 0x66, 0x42, 0x76, 0x69, 0x74, 0x62, 0x74, + 0x61, 0x53, 0x65, 0x6f, 0x64, 0x6c, 0x79, 0x57, 0x4c, 0x30, 0x41, 0x47, + 0x30, 0x79, 0x2f, 0x59, 0x63, 0x6b, 0x55, 0x48, 0x55, 0x57, 0x43, 0x71, + 0x38, 0x59, 0x64, 0x67, 0x4e, 0x59, 0x39, 0x36, 0x78, 0x43, 0x63, 0x4f, + 0x71, 0x39, 0x74, 0x4a, 0x50, 0x69, 0x38, 0x0a, 0x63, 0x51, 0x47, 0x65, + 0x42, 0x76, 0x56, 0x38, 0x58, 0x78, 0x37, 0x42, 0x44, 0x6c, 0x58, 0x4b, + 0x67, 0x35, 0x70, 0x5a, 0x4d, 0x4b, 0x34, 0x5a, 0x79, 0x7a, 0x42, 0x49, + 0x6c, 0x65, 0x30, 0x69, 0x4e, 0x34, 0x33, 0x30, 0x53, 0x70, 0x70, 0x79, + 0x5a, 0x6a, 0x36, 0x74, 0x6c, 0x63, 0x44, 0x67, 0x46, 0x67, 0x44, 0x67, + 0x45, 0x42, 0x38, 0x72, 0x4d, 0x51, 0x37, 0x58, 0x6c, 0x46, 0x54, 0x54, + 0x0a, 0x51, 0x6a, 0x4f, 0x67, 0x4e, 0x42, 0x30, 0x65, 0x52, 0x58, 0x62, + 0x64, 0x54, 0x38, 0x6f, 0x59, 0x4e, 0x2b, 0x79, 0x46, 0x46, 0x58, 0x6f, + 0x5a, 0x43, 0x50, 0x7a, 0x56, 0x78, 0x35, 0x7a, 0x77, 0x38, 0x71, 0x6b, + 0x75, 0x45, 0x4b, 0x6d, 0x53, 0x35, 0x6a, 0x31, 0x59, 0x50, 0x61, 0x6b, + 0x57, 0x61, 0x44, 0x77, 0x76, 0x64, 0x53, 0x45, 0x59, 0x66, 0x79, 0x68, + 0x33, 0x70, 0x65, 0x46, 0x68, 0x0a, 0x46, 0x37, 0x65, 0x6d, 0x36, 0x66, + 0x67, 0x65, 0x6d, 0x64, 0x74, 0x7a, 0x62, 0x76, 0x51, 0x4b, 0x6f, 0x69, + 0x46, 0x73, 0x37, 0x74, 0x71, 0x71, 0x68, 0x5a, 0x4a, 0x6d, 0x72, 0x2f, + 0x5a, 0x36, 0x61, 0x34, 0x4c, 0x61, 0x75, 0x69, 0x49, 0x49, 0x4e, 0x51, + 0x2f, 0x50, 0x51, 0x76, 0x45, 0x31, 0x2b, 0x6d, 0x72, 0x75, 0x66, 0x69, + 0x73, 0x6c, 0x7a, 0x44, 0x6f, 0x52, 0x35, 0x47, 0x32, 0x76, 0x0a, 0x63, + 0x37, 0x4a, 0x32, 0x48, 0x61, 0x33, 0x51, 0x73, 0x6e, 0x68, 0x6e, 0x47, + 0x71, 0x51, 0x35, 0x48, 0x46, 0x45, 0x4c, 0x5a, 0x31, 0x61, 0x44, 0x2f, + 0x54, 0x68, 0x64, 0x44, 0x63, 0x37, 0x64, 0x38, 0x4c, 0x73, 0x72, 0x6c, + 0x68, 0x2f, 0x65, 0x65, 0x7a, 0x4a, 0x53, 0x2f, 0x52, 0x32, 0x37, 0x74, + 0x51, 0x61, 0x68, 0x73, 0x69, 0x46, 0x65, 0x70, 0x64, 0x61, 0x56, 0x61, + 0x48, 0x2f, 0x77, 0x0a, 0x6d, 0x5a, 0x37, 0x63, 0x52, 0x51, 0x67, 0x2b, + 0x35, 0x39, 0x49, 0x4a, 0x44, 0x54, 0x57, 0x55, 0x33, 0x59, 0x42, 0x4f, + 0x55, 0x35, 0x66, 0x58, 0x74, 0x51, 0x6c, 0x45, 0x49, 0x47, 0x51, 0x57, + 0x46, 0x77, 0x4d, 0x43, 0x54, 0x46, 0x4d, 0x4e, 0x61, 0x4e, 0x37, 0x56, + 0x71, 0x6e, 0x4a, 0x4e, 0x6b, 0x32, 0x32, 0x43, 0x44, 0x74, 0x75, 0x63, + 0x76, 0x63, 0x2b, 0x30, 0x38, 0x31, 0x78, 0x64, 0x0a, 0x56, 0x48, 0x70, + 0x70, 0x43, 0x5a, 0x62, 0x57, 0x32, 0x78, 0x48, 0x42, 0x6a, 0x58, 0x57, + 0x6f, 0x74, 0x4d, 0x38, 0x35, 0x79, 0x4d, 0x34, 0x38, 0x76, 0x43, 0x52, + 0x38, 0x35, 0x6d, 0x4c, 0x4b, 0x34, 0x62, 0x31, 0x39, 0x70, 0x37, 0x31, + 0x58, 0x5a, 0x51, 0x76, 0x6b, 0x2f, 0x69, 0x58, 0x74, 0x74, 0x6d, 0x6b, + 0x51, 0x33, 0x43, 0x67, 0x61, 0x52, 0x72, 0x30, 0x42, 0x48, 0x64, 0x43, + 0x58, 0x0a, 0x74, 0x65, 0x47, 0x59, 0x4f, 0x38, 0x41, 0x33, 0x5a, 0x4e, + 0x59, 0x39, 0x6c, 0x4f, 0x34, 0x4c, 0x34, 0x66, 0x55, 0x6f, 0x72, 0x67, + 0x74, 0x57, 0x76, 0x33, 0x47, 0x4c, 0x49, 0x79, 0x6c, 0x42, 0x6a, 0x6f, + 0x62, 0x46, 0x53, 0x31, 0x4a, 0x37, 0x32, 0x48, 0x47, 0x72, 0x48, 0x34, + 0x6f, 0x56, 0x70, 0x6a, 0x75, 0x44, 0x57, 0x74, 0x64, 0x59, 0x41, 0x56, + 0x48, 0x47, 0x54, 0x45, 0x48, 0x5a, 0x0a, 0x66, 0x39, 0x68, 0x42, 0x5a, + 0x33, 0x4b, 0x69, 0x4b, 0x4e, 0x39, 0x67, 0x67, 0x36, 0x6d, 0x65, 0x79, + 0x48, 0x76, 0x38, 0x55, 0x33, 0x4e, 0x79, 0x57, 0x66, 0x57, 0x54, 0x65, + 0x68, 0x64, 0x32, 0x44, 0x73, 0x37, 0x33, 0x35, 0x56, 0x7a, 0x5a, 0x43, + 0x31, 0x55, 0x30, 0x6f, 0x71, 0x70, 0x62, 0x74, 0x57, 0x70, 0x55, 0x35, + 0x78, 0x50, 0x4b, 0x56, 0x2b, 0x79, 0x58, 0x62, 0x66, 0x52, 0x65, 0x0a, + 0x42, 0x69, 0x39, 0x46, 0x69, 0x31, 0x6a, 0x55, 0x49, 0x78, 0x61, 0x53, + 0x35, 0x42, 0x5a, 0x75, 0x4b, 0x47, 0x4e, 0x5a, 0x4d, 0x4e, 0x39, 0x51, + 0x41, 0x5a, 0x78, 0x6a, 0x69, 0x52, 0x71, 0x66, 0x32, 0x78, 0x65, 0x55, + 0x67, 0x6e, 0x41, 0x33, 0x77, 0x79, 0x53, 0x65, 0x6d, 0x6b, 0x66, 0x57, + 0x57, 0x73, 0x70, 0x4f, 0x71, 0x47, 0x6d, 0x4a, 0x63, 0x68, 0x2b, 0x52, + 0x62, 0x4e, 0x74, 0x2b, 0x0a, 0x6e, 0x68, 0x75, 0x74, 0x78, 0x78, 0x39, + 0x7a, 0x33, 0x53, 0x78, 0x50, 0x47, 0x57, 0x58, 0x39, 0x66, 0x35, 0x4e, + 0x41, 0x45, 0x43, 0x37, 0x53, 0x38, 0x4f, 0x30, 0x38, 0x6e, 0x69, 0x34, + 0x6f, 0x50, 0x6d, 0x6b, 0x6d, 0x4d, 0x38, 0x56, 0x37, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x59, 0x7a, 0x42, 0x68, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x0a, 0x2f, 0x77, + 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4e, + 0x71, 0x37, 0x4c, 0x71, 0x71, 0x77, 0x44, 0x4c, 0x69, 0x49, 0x4a, 0x6c, + 0x46, 0x30, 0x58, 0x47, 0x30, 0x44, 0x30, 0x38, 0x44, 0x59, 0x6a, 0x33, + 0x72, 0x57, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, + 0x51, 0x59, 0x0a, 0x4d, 0x42, 0x61, 0x41, 0x46, 0x4e, 0x71, 0x37, 0x4c, + 0x71, 0x71, 0x77, 0x44, 0x4c, 0x69, 0x49, 0x4a, 0x6c, 0x46, 0x30, 0x58, + 0x47, 0x30, 0x44, 0x30, 0x38, 0x44, 0x59, 0x6a, 0x33, 0x72, 0x57, 0x4d, + 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x68, 0x6a, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x0a, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, + 0x4d, 0x58, 0x6a, 0x6d, 0x78, 0x37, 0x58, 0x66, 0x75, 0x4a, 0x52, 0x41, + 0x79, 0x58, 0x48, 0x45, 0x71, 0x44, 0x58, 0x73, 0x52, 0x68, 0x33, 0x43, + 0x68, 0x66, 0x4d, 0x6f, 0x57, 0x49, 0x61, 0x77, 0x43, 0x2f, 0x79, 0x4f, + 0x73, 0x6a, 0x6d, 0x50, 0x52, 0x46, 0x57, 0x72, 0x5a, 0x49, 0x52, 0x63, + 0x0a, 0x61, 0x61, 0x6e, 0x51, 0x6d, 0x6a, 0x67, 0x38, 0x2b, 0x75, 0x55, + 0x66, 0x4e, 0x65, 0x56, 0x45, 0x34, 0x34, 0x42, 0x35, 0x6c, 0x47, 0x69, + 0x6b, 0x75, 0x38, 0x53, 0x66, 0x50, 0x65, 0x45, 0x30, 0x7a, 0x54, 0x42, + 0x47, 0x69, 0x31, 0x51, 0x72, 0x6c, 0x61, 0x58, 0x76, 0x39, 0x7a, 0x2b, + 0x5a, 0x68, 0x50, 0x30, 0x31, 0x35, 0x73, 0x38, 0x78, 0x78, 0x74, 0x78, + 0x71, 0x76, 0x36, 0x66, 0x58, 0x0a, 0x49, 0x77, 0x6a, 0x68, 0x6d, 0x46, + 0x37, 0x44, 0x57, 0x67, 0x68, 0x32, 0x71, 0x61, 0x61, 0x76, 0x64, 0x79, + 0x2b, 0x33, 0x59, 0x4c, 0x31, 0x45, 0x52, 0x6d, 0x72, 0x76, 0x6c, 0x2f, + 0x39, 0x7a, 0x6c, 0x63, 0x47, 0x4f, 0x36, 0x4a, 0x50, 0x37, 0x2f, 0x54, + 0x47, 0x33, 0x37, 0x46, 0x63, 0x52, 0x45, 0x55, 0x57, 0x62, 0x4d, 0x50, + 0x45, 0x61, 0x69, 0x44, 0x6e, 0x42, 0x54, 0x7a, 0x79, 0x6e, 0x0a, 0x41, + 0x4e, 0x58, 0x48, 0x2f, 0x4b, 0x74, 0x74, 0x67, 0x43, 0x4a, 0x77, 0x70, + 0x51, 0x7a, 0x67, 0x58, 0x51, 0x51, 0x70, 0x41, 0x76, 0x76, 0x4c, 0x6f, + 0x4a, 0x48, 0x52, 0x66, 0x4e, 0x62, 0x44, 0x66, 0x6c, 0x44, 0x56, 0x6e, + 0x56, 0x69, 0x2b, 0x51, 0x54, 0x6a, 0x72, 0x75, 0x58, 0x55, 0x38, 0x46, + 0x64, 0x6d, 0x62, 0x79, 0x55, 0x71, 0x44, 0x57, 0x63, 0x44, 0x61, 0x55, + 0x2f, 0x30, 0x7a, 0x0a, 0x75, 0x7a, 0x59, 0x59, 0x6d, 0x34, 0x55, 0x50, + 0x46, 0x64, 0x33, 0x75, 0x4c, 0x61, 0x78, 0x32, 0x6b, 0x37, 0x6e, 0x5a, + 0x41, 0x59, 0x31, 0x49, 0x45, 0x4b, 0x6a, 0x37, 0x39, 0x54, 0x69, 0x47, + 0x38, 0x64, 0x73, 0x4b, 0x78, 0x72, 0x32, 0x45, 0x6f, 0x79, 0x4e, 0x42, + 0x33, 0x74, 0x5a, 0x33, 0x62, 0x34, 0x58, 0x55, 0x68, 0x52, 0x78, 0x51, + 0x34, 0x4b, 0x35, 0x52, 0x69, 0x72, 0x71, 0x4e, 0x0a, 0x50, 0x6e, 0x62, + 0x69, 0x75, 0x63, 0x6f, 0x6e, 0x38, 0x6c, 0x2b, 0x66, 0x37, 0x32, 0x35, + 0x5a, 0x44, 0x51, 0x62, 0x59, 0x4b, 0x78, 0x65, 0x6b, 0x30, 0x6e, 0x78, + 0x72, 0x75, 0x31, 0x38, 0x55, 0x47, 0x6b, 0x69, 0x50, 0x47, 0x6b, 0x7a, + 0x6e, 0x73, 0x30, 0x63, 0x63, 0x6a, 0x6b, 0x78, 0x46, 0x4b, 0x79, 0x44, + 0x75, 0x53, 0x4e, 0x2f, 0x6e, 0x33, 0x51, 0x6d, 0x4f, 0x47, 0x4b, 0x6a, + 0x61, 0x0a, 0x51, 0x49, 0x32, 0x53, 0x4a, 0x68, 0x46, 0x54, 0x59, 0x58, + 0x4e, 0x64, 0x36, 0x37, 0x33, 0x6e, 0x78, 0x45, 0x30, 0x70, 0x4e, 0x32, + 0x48, 0x72, 0x72, 0x44, 0x6b, 0x74, 0x5a, 0x79, 0x34, 0x57, 0x31, 0x76, + 0x55, 0x41, 0x67, 0x34, 0x57, 0x68, 0x7a, 0x48, 0x39, 0x32, 0x78, 0x48, + 0x33, 0x6b, 0x74, 0x30, 0x74, 0x6d, 0x37, 0x77, 0x4e, 0x46, 0x59, 0x47, + 0x6d, 0x32, 0x44, 0x46, 0x4b, 0x57, 0x0a, 0x6b, 0x6f, 0x52, 0x65, 0x70, + 0x71, 0x4f, 0x31, 0x70, 0x44, 0x34, 0x72, 0x32, 0x63, 0x7a, 0x59, 0x47, + 0x30, 0x65, 0x71, 0x38, 0x6b, 0x54, 0x61, 0x54, 0x2f, 0x6b, 0x44, 0x36, + 0x50, 0x41, 0x55, 0x79, 0x7a, 0x2f, 0x7a, 0x67, 0x39, 0x37, 0x51, 0x77, + 0x56, 0x54, 0x6a, 0x74, 0x2b, 0x67, 0x4b, 0x4e, 0x30, 0x32, 0x4c, 0x49, + 0x46, 0x6b, 0x44, 0x4d, 0x42, 0x6d, 0x68, 0x4c, 0x4d, 0x69, 0x39, 0x0a, + 0x45, 0x52, 0x2f, 0x66, 0x72, 0x73, 0x6c, 0x4b, 0x78, 0x66, 0x4d, 0x6e, + 0x5a, 0x6d, 0x61, 0x47, 0x72, 0x47, 0x69, 0x52, 0x2f, 0x39, 0x6e, 0x6d, + 0x55, 0x78, 0x77, 0x50, 0x69, 0x31, 0x78, 0x70, 0x5a, 0x51, 0x6f, 0x6d, + 0x79, 0x42, 0x34, 0x30, 0x77, 0x31, 0x31, 0x52, 0x65, 0x39, 0x65, 0x70, + 0x6e, 0x41, 0x61, 0x68, 0x4e, 0x74, 0x33, 0x56, 0x69, 0x5a, 0x53, 0x38, + 0x32, 0x65, 0x51, 0x74, 0x0a, 0x44, 0x46, 0x34, 0x4a, 0x62, 0x41, 0x69, + 0x58, 0x66, 0x4b, 0x4d, 0x39, 0x66, 0x4a, 0x50, 0x2f, 0x50, 0x36, 0x45, + 0x55, 0x70, 0x38, 0x2b, 0x31, 0x58, 0x65, 0x76, 0x62, 0x32, 0x78, 0x7a, + 0x45, 0x64, 0x74, 0x2b, 0x49, 0x75, 0x62, 0x31, 0x46, 0x42, 0x5a, 0x55, + 0x62, 0x72, 0x76, 0x78, 0x47, 0x61, 0x6b, 0x79, 0x76, 0x53, 0x4f, 0x50, + 0x4f, 0x72, 0x67, 0x2f, 0x53, 0x66, 0x75, 0x76, 0x6d, 0x0a, 0x62, 0x4a, + 0x78, 0x50, 0x67, 0x57, 0x70, 0x36, 0x5a, 0x4b, 0x79, 0x37, 0x50, 0x74, + 0x58, 0x6e, 0x79, 0x33, 0x59, 0x75, 0x78, 0x61, 0x64, 0x49, 0x77, 0x56, + 0x79, 0x51, 0x44, 0x38, 0x76, 0x49, 0x50, 0x2f, 0x72, 0x6d, 0x4d, 0x75, + 0x47, 0x4e, 0x47, 0x32, 0x2b, 0x6b, 0x35, 0x6f, 0x37, 0x59, 0x2b, 0x53, + 0x6c, 0x49, 0x69, 0x73, 0x35, 0x7a, 0x2f, 0x69, 0x77, 0x3d, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x43, 0x41, + 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, + 0x73, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x47, + 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, + 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x55, 0x6e, 0x69, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x32, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x34, 0x3a, 0x66, 0x63, + 0x3a, 0x62, 0x38, 0x3a, 0x64, 0x30, 0x3a, 0x33, 0x36, 0x3a, 0x64, 0x62, + 0x3a, 0x39, 0x65, 0x3a, 0x31, 0x34, 0x3a, 0x62, 0x33, 0x3a, 0x63, 0x32, + 0x3a, 0x66, 0x32, 0x3a, 0x64, 0x62, 0x3a, 0x38, 0x66, 0x3a, 0x65, 0x34, + 0x3a, 0x39, 0x34, 0x3a, 0x63, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x33, 0x37, 0x3a, 0x39, 0x61, 0x3a, 0x31, 0x39, 0x3a, + 0x37, 0x62, 0x3a, 0x34, 0x31, 0x3a, 0x38, 0x35, 0x3a, 0x34, 0x35, 0x3a, + 0x33, 0x35, 0x3a, 0x30, 0x63, 0x3a, 0x61, 0x36, 0x3a, 0x30, 0x33, 0x3a, + 0x36, 0x39, 0x3a, 0x66, 0x33, 0x3a, 0x33, 0x63, 0x3a, 0x32, 0x65, 0x3a, + 0x61, 0x66, 0x3a, 0x34, 0x37, 0x3a, 0x34, 0x66, 0x3a, 0x32, 0x30, 0x3a, + 0x37, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x61, 0x30, 0x3a, 0x32, 0x33, 0x3a, 0x34, 0x66, 0x3a, 0x33, 0x62, + 0x3a, 0x63, 0x38, 0x3a, 0x35, 0x32, 0x3a, 0x37, 0x63, 0x3a, 0x61, 0x35, + 0x3a, 0x36, 0x32, 0x3a, 0x38, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x38, 0x31, + 0x3a, 0x61, 0x64, 0x3a, 0x35, 0x64, 0x3a, 0x36, 0x39, 0x3a, 0x38, 0x39, + 0x3a, 0x35, 0x64, 0x3a, 0x61, 0x35, 0x3a, 0x36, 0x38, 0x3a, 0x30, 0x64, + 0x3a, 0x63, 0x39, 0x3a, 0x31, 0x64, 0x3a, 0x31, 0x63, 0x3a, 0x62, 0x38, + 0x3a, 0x34, 0x37, 0x3a, 0x37, 0x66, 0x3a, 0x33, 0x33, 0x3a, 0x66, 0x38, + 0x3a, 0x37, 0x38, 0x3a, 0x62, 0x39, 0x3a, 0x35, 0x62, 0x3a, 0x30, 0x62, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x62, 0x44, 0x43, + 0x43, 0x41, 0x31, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x42, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, + 0x48, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x57, 0x0a, 0x4d, 0x42, + 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4e, 0x52, 0x32, + 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x53, 0x57, + 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x41, 0x78, 0x4d, 0x58, 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, + 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x56, 0x57, 0x35, 0x70, 0x64, 0x6d, + 0x56, 0x79, 0x0a, 0x63, 0x32, 0x46, 0x73, 0x49, 0x45, 0x4e, 0x42, 0x49, + 0x44, 0x49, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x51, 0x77, 0x4d, + 0x7a, 0x41, 0x30, 0x4d, 0x44, 0x55, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, + 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x6b, 0x77, 0x4d, 0x7a, 0x41, 0x30, 0x4d, + 0x44, 0x55, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, 0x42, 0x48, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x57, 0x4d, 0x42, 0x51, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4e, 0x52, 0x32, 0x56, 0x76, + 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, + 0x4c, 0x6a, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x41, 0x78, 0x4d, 0x58, 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, + 0x0a, 0x63, 0x33, 0x51, 0x67, 0x56, 0x57, 0x35, 0x70, 0x64, 0x6d, 0x56, + 0x79, 0x63, 0x32, 0x46, 0x73, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, + 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, + 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, + 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x0a, 0x41, 0x51, 0x43, 0x7a, 0x56, 0x46, + 0x4c, 0x42, 0x79, 0x54, 0x37, 0x79, 0x32, 0x64, 0x79, 0x78, 0x55, 0x78, + 0x70, 0x5a, 0x4b, 0x65, 0x65, 0x78, 0x77, 0x30, 0x55, 0x6f, 0x35, 0x64, + 0x66, 0x52, 0x37, 0x63, 0x58, 0x46, 0x53, 0x36, 0x47, 0x71, 0x64, 0x48, + 0x74, 0x58, 0x72, 0x30, 0x6f, 0x6d, 0x2f, 0x4e, 0x6a, 0x31, 0x58, 0x71, + 0x64, 0x75, 0x47, 0x64, 0x74, 0x30, 0x44, 0x45, 0x38, 0x31, 0x0a, 0x57, + 0x7a, 0x49, 0x4c, 0x41, 0x65, 0x50, 0x62, 0x36, 0x33, 0x70, 0x33, 0x4e, + 0x65, 0x71, 0x71, 0x57, 0x75, 0x44, 0x57, 0x36, 0x4b, 0x46, 0x58, 0x6c, + 0x50, 0x43, 0x51, 0x6f, 0x33, 0x52, 0x57, 0x6c, 0x45, 0x51, 0x77, 0x41, + 0x78, 0x35, 0x63, 0x54, 0x69, 0x75, 0x46, 0x4a, 0x6e, 0x53, 0x43, 0x65, + 0x67, 0x78, 0x32, 0x6f, 0x47, 0x39, 0x4e, 0x7a, 0x6b, 0x45, 0x74, 0x6f, + 0x42, 0x55, 0x47, 0x0a, 0x46, 0x46, 0x2b, 0x33, 0x51, 0x73, 0x31, 0x37, + 0x6a, 0x31, 0x68, 0x68, 0x4e, 0x4e, 0x77, 0x71, 0x43, 0x50, 0x6b, 0x75, + 0x77, 0x77, 0x47, 0x6d, 0x49, 0x6b, 0x51, 0x63, 0x54, 0x41, 0x65, 0x43, + 0x35, 0x6c, 0x76, 0x4f, 0x30, 0x45, 0x70, 0x38, 0x42, 0x4e, 0x4d, 0x5a, + 0x63, 0x79, 0x66, 0x77, 0x71, 0x70, 0x68, 0x2f, 0x4c, 0x71, 0x39, 0x4f, + 0x36, 0x34, 0x63, 0x65, 0x4a, 0x48, 0x64, 0x71, 0x0a, 0x58, 0x62, 0x62, + 0x6f, 0x57, 0x30, 0x57, 0x36, 0x33, 0x4d, 0x4f, 0x68, 0x42, 0x57, 0x39, + 0x57, 0x6a, 0x6f, 0x38, 0x51, 0x4a, 0x71, 0x56, 0x4a, 0x77, 0x79, 0x37, + 0x58, 0x51, 0x59, 0x63, 0x69, 0x34, 0x45, 0x2b, 0x47, 0x79, 0x6d, 0x43, + 0x31, 0x36, 0x71, 0x46, 0x6a, 0x77, 0x41, 0x47, 0x58, 0x45, 0x48, 0x6d, + 0x39, 0x41, 0x44, 0x77, 0x53, 0x62, 0x53, 0x73, 0x56, 0x73, 0x61, 0x78, + 0x4c, 0x0a, 0x73, 0x65, 0x34, 0x59, 0x75, 0x55, 0x36, 0x57, 0x33, 0x4e, + 0x78, 0x32, 0x2f, 0x7a, 0x75, 0x2b, 0x7a, 0x31, 0x38, 0x44, 0x77, 0x50, + 0x77, 0x37, 0x36, 0x4c, 0x35, 0x47, 0x47, 0x2f, 0x2f, 0x61, 0x51, 0x4d, + 0x4a, 0x53, 0x39, 0x2f, 0x37, 0x6a, 0x4f, 0x76, 0x64, 0x71, 0x64, 0x7a, + 0x58, 0x51, 0x32, 0x6f, 0x33, 0x72, 0x58, 0x68, 0x68, 0x71, 0x4d, 0x63, + 0x63, 0x65, 0x75, 0x6a, 0x77, 0x62, 0x0a, 0x4b, 0x4e, 0x5a, 0x72, 0x56, + 0x4d, 0x61, 0x71, 0x57, 0x39, 0x65, 0x69, 0x4c, 0x42, 0x73, 0x5a, 0x7a, + 0x4b, 0x49, 0x43, 0x39, 0x70, 0x74, 0x5a, 0x76, 0x54, 0x64, 0x72, 0x68, + 0x72, 0x56, 0x74, 0x67, 0x72, 0x72, 0x59, 0x36, 0x73, 0x6c, 0x57, 0x76, + 0x4b, 0x6b, 0x32, 0x57, 0x50, 0x30, 0x2b, 0x47, 0x66, 0x50, 0x74, 0x44, + 0x43, 0x61, 0x70, 0x6b, 0x7a, 0x6a, 0x34, 0x54, 0x38, 0x46, 0x64, 0x0a, + 0x49, 0x67, 0x62, 0x51, 0x6c, 0x2b, 0x72, 0x68, 0x72, 0x63, 0x5a, 0x56, + 0x34, 0x49, 0x45, 0x72, 0x4b, 0x49, 0x4d, 0x36, 0x2b, 0x76, 0x52, 0x37, + 0x49, 0x56, 0x45, 0x41, 0x76, 0x6c, 0x49, 0x34, 0x7a, 0x73, 0x31, 0x6d, + 0x65, 0x61, 0x6a, 0x30, 0x67, 0x56, 0x62, 0x69, 0x30, 0x49, 0x4d, 0x4a, + 0x52, 0x31, 0x46, 0x62, 0x55, 0x47, 0x72, 0x50, 0x32, 0x30, 0x67, 0x61, + 0x58, 0x54, 0x37, 0x33, 0x0a, 0x79, 0x2f, 0x5a, 0x6c, 0x39, 0x32, 0x7a, + 0x78, 0x6c, 0x66, 0x67, 0x43, 0x4f, 0x7a, 0x4a, 0x57, 0x67, 0x6a, 0x6c, + 0x36, 0x57, 0x37, 0x30, 0x76, 0x69, 0x52, 0x75, 0x2f, 0x6f, 0x62, 0x54, + 0x6f, 0x2f, 0x33, 0x2b, 0x4e, 0x6a, 0x4e, 0x38, 0x44, 0x38, 0x57, 0x42, + 0x4f, 0x57, 0x42, 0x46, 0x4d, 0x36, 0x36, 0x4d, 0x2f, 0x45, 0x43, 0x75, + 0x44, 0x6d, 0x67, 0x46, 0x7a, 0x32, 0x5a, 0x52, 0x74, 0x0a, 0x68, 0x41, + 0x41, 0x6e, 0x5a, 0x71, 0x7a, 0x77, 0x63, 0x45, 0x41, 0x4a, 0x51, 0x70, + 0x4b, 0x74, 0x54, 0x35, 0x4d, 0x4e, 0x59, 0x51, 0x6c, 0x52, 0x4a, 0x4e, + 0x69, 0x53, 0x31, 0x51, 0x75, 0x55, 0x59, 0x62, 0x4b, 0x48, 0x73, 0x75, + 0x33, 0x2f, 0x6d, 0x6a, 0x58, 0x2f, 0x68, 0x56, 0x54, 0x4b, 0x37, 0x55, + 0x52, 0x44, 0x72, 0x42, 0x73, 0x38, 0x46, 0x6d, 0x74, 0x49, 0x53, 0x67, + 0x6f, 0x63, 0x0a, 0x51, 0x49, 0x67, 0x66, 0x6b, 0x73, 0x49, 0x4c, 0x41, + 0x41, 0x58, 0x2f, 0x38, 0x73, 0x67, 0x43, 0x53, 0x71, 0x53, 0x71, 0x71, + 0x63, 0x79, 0x5a, 0x6c, 0x70, 0x77, 0x76, 0x57, 0x4f, 0x42, 0x39, 0x34, + 0x62, 0x36, 0x37, 0x42, 0x39, 0x78, 0x66, 0x42, 0x48, 0x4a, 0x63, 0x4d, + 0x54, 0x54, 0x44, 0x37, 0x46, 0x38, 0x74, 0x34, 0x44, 0x31, 0x6b, 0x6b, + 0x43, 0x4c, 0x6d, 0x30, 0x65, 0x79, 0x34, 0x0a, 0x4c, 0x74, 0x31, 0x5a, + 0x72, 0x74, 0x6d, 0x68, 0x4e, 0x37, 0x39, 0x55, 0x4e, 0x64, 0x78, 0x7a, + 0x4d, 0x6b, 0x2b, 0x4d, 0x42, 0x42, 0x34, 0x7a, 0x73, 0x73, 0x6c, 0x47, + 0x38, 0x64, 0x68, 0x63, 0x79, 0x46, 0x56, 0x51, 0x79, 0x57, 0x69, 0x39, + 0x71, 0x4c, 0x6f, 0x32, 0x43, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, + 0x6f, 0x32, 0x4d, 0x77, 0x59, 0x54, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, + 0x0a, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, + 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x32, 0x38, 0x31, 0x58, + 0x68, 0x2b, 0x71, 0x51, 0x32, 0x2b, 0x2f, 0x43, 0x66, 0x58, 0x47, 0x4a, + 0x78, 0x37, 0x54, 0x7a, 0x30, 0x52, 0x7a, 0x67, 0x51, 0x4b, 0x7a, 0x41, + 0x66, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, + 0x41, 0x57, 0x67, 0x42, 0x52, 0x32, 0x38, 0x31, 0x58, 0x68, 0x2b, 0x71, + 0x51, 0x32, 0x2b, 0x2f, 0x43, 0x66, 0x58, 0x47, 0x4a, 0x78, 0x37, 0x54, + 0x7a, 0x30, 0x52, 0x7a, 0x67, 0x51, 0x4b, 0x7a, 0x41, 0x4f, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, + 0x4d, 0x43, 0x41, 0x59, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x0a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x47, 0x62, 0x42, 0x78, + 0x69, 0x50, 0x7a, 0x32, 0x65, 0x41, 0x75, 0x62, 0x6c, 0x2f, 0x6f, 0x7a, + 0x36, 0x36, 0x77, 0x73, 0x43, 0x56, 0x4e, 0x4b, 0x2f, 0x67, 0x37, 0x57, + 0x4a, 0x74, 0x41, 0x4a, 0x44, 0x64, 0x61, 0x79, 0x36, 0x73, 0x57, 0x53, + 0x66, 0x2b, 0x7a, 0x0a, 0x64, 0x58, 0x6b, 0x7a, 0x6f, 0x53, 0x39, 0x74, + 0x63, 0x42, 0x63, 0x30, 0x6b, 0x66, 0x35, 0x6e, 0x66, 0x6f, 0x2f, 0x73, + 0x6d, 0x2b, 0x56, 0x65, 0x67, 0x71, 0x6c, 0x56, 0x48, 0x79, 0x2f, 0x63, + 0x31, 0x46, 0x45, 0x48, 0x45, 0x76, 0x36, 0x73, 0x46, 0x6a, 0x34, 0x73, + 0x4e, 0x63, 0x5a, 0x6a, 0x2f, 0x4e, 0x77, 0x51, 0x36, 0x77, 0x32, 0x6a, + 0x71, 0x74, 0x42, 0x38, 0x7a, 0x4e, 0x48, 0x51, 0x0a, 0x4c, 0x31, 0x45, + 0x75, 0x78, 0x42, 0x52, 0x61, 0x33, 0x75, 0x67, 0x5a, 0x34, 0x54, 0x37, + 0x47, 0x7a, 0x4b, 0x51, 0x70, 0x35, 0x79, 0x36, 0x45, 0x71, 0x67, 0x59, + 0x77, 0x65, 0x48, 0x5a, 0x55, 0x63, 0x79, 0x69, 0x59, 0x57, 0x54, 0x6a, + 0x67, 0x41, 0x41, 0x31, 0x69, 0x30, 0x30, 0x4a, 0x39, 0x49, 0x5a, 0x2b, + 0x75, 0x50, 0x54, 0x71, 0x4d, 0x31, 0x66, 0x70, 0x33, 0x44, 0x52, 0x67, + 0x72, 0x0a, 0x46, 0x67, 0x35, 0x66, 0x4e, 0x75, 0x48, 0x38, 0x4b, 0x72, + 0x55, 0x77, 0x4a, 0x4d, 0x2f, 0x67, 0x59, 0x77, 0x78, 0x37, 0x57, 0x42, + 0x72, 0x2b, 0x6d, 0x62, 0x70, 0x43, 0x45, 0x72, 0x47, 0x52, 0x39, 0x48, + 0x78, 0x6f, 0x34, 0x73, 0x6a, 0x6f, 0x72, 0x79, 0x7a, 0x71, 0x79, 0x58, + 0x36, 0x75, 0x75, 0x79, 0x6f, 0x39, 0x44, 0x52, 0x58, 0x63, 0x4e, 0x4a, + 0x57, 0x32, 0x47, 0x48, 0x53, 0x6f, 0x0a, 0x61, 0x67, 0x2f, 0x48, 0x74, + 0x50, 0x51, 0x54, 0x78, 0x4f, 0x52, 0x62, 0x37, 0x51, 0x72, 0x53, 0x70, + 0x4a, 0x64, 0x4d, 0x4b, 0x75, 0x30, 0x76, 0x62, 0x42, 0x4b, 0x4a, 0x50, + 0x66, 0x45, 0x6e, 0x63, 0x4b, 0x70, 0x71, 0x41, 0x31, 0x49, 0x68, 0x6e, + 0x30, 0x43, 0x6f, 0x5a, 0x31, 0x44, 0x79, 0x38, 0x31, 0x6f, 0x66, 0x33, + 0x39, 0x38, 0x6a, 0x39, 0x74, 0x78, 0x34, 0x54, 0x75, 0x61, 0x59, 0x0a, + 0x54, 0x31, 0x55, 0x36, 0x55, 0x2b, 0x50, 0x76, 0x38, 0x76, 0x53, 0x66, + 0x78, 0x33, 0x7a, 0x59, 0x57, 0x4b, 0x38, 0x70, 0x49, 0x70, 0x65, 0x34, + 0x34, 0x4c, 0x32, 0x52, 0x4c, 0x72, 0x42, 0x32, 0x37, 0x46, 0x63, 0x52, + 0x7a, 0x2b, 0x38, 0x70, 0x52, 0x50, 0x50, 0x70, 0x68, 0x58, 0x70, 0x67, + 0x59, 0x2b, 0x52, 0x64, 0x4d, 0x34, 0x6b, 0x58, 0x32, 0x54, 0x47, 0x71, + 0x32, 0x74, 0x62, 0x7a, 0x0a, 0x47, 0x44, 0x56, 0x79, 0x7a, 0x34, 0x63, + 0x72, 0x4c, 0x32, 0x4d, 0x6a, 0x68, 0x46, 0x32, 0x45, 0x6a, 0x44, 0x39, + 0x58, 0x6f, 0x49, 0x6a, 0x38, 0x6d, 0x5a, 0x45, 0x6f, 0x4a, 0x6d, 0x6d, + 0x5a, 0x31, 0x49, 0x2b, 0x58, 0x52, 0x4c, 0x36, 0x4f, 0x31, 0x55, 0x69, + 0x78, 0x70, 0x43, 0x67, 0x70, 0x38, 0x52, 0x57, 0x30, 0x34, 0x65, 0x57, + 0x65, 0x33, 0x66, 0x69, 0x50, 0x70, 0x6d, 0x38, 0x6d, 0x0a, 0x31, 0x77, + 0x6b, 0x38, 0x4f, 0x68, 0x77, 0x52, 0x44, 0x71, 0x5a, 0x73, 0x4e, 0x2f, + 0x65, 0x74, 0x52, 0x49, 0x63, 0x73, 0x4b, 0x4d, 0x66, 0x59, 0x64, 0x49, + 0x4b, 0x7a, 0x30, 0x47, 0x39, 0x4b, 0x56, 0x37, 0x73, 0x31, 0x4b, 0x53, + 0x65, 0x67, 0x69, 0x2b, 0x67, 0x68, 0x70, 0x34, 0x64, 0x6b, 0x4e, 0x6c, + 0x33, 0x4d, 0x32, 0x42, 0x61, 0x73, 0x78, 0x37, 0x49, 0x6e, 0x51, 0x4a, + 0x4a, 0x56, 0x0a, 0x4f, 0x43, 0x69, 0x4e, 0x55, 0x57, 0x37, 0x64, 0x46, + 0x47, 0x64, 0x54, 0x62, 0x48, 0x46, 0x63, 0x4a, 0x6f, 0x52, 0x4e, 0x64, + 0x56, 0x71, 0x32, 0x66, 0x6d, 0x42, 0x57, 0x71, 0x55, 0x32, 0x74, 0x2b, + 0x35, 0x73, 0x65, 0x6c, 0x2f, 0x4d, 0x4e, 0x32, 0x64, 0x4b, 0x58, 0x56, + 0x48, 0x66, 0x61, 0x50, 0x52, 0x4b, 0x33, 0x34, 0x42, 0x37, 0x76, 0x43, + 0x41, 0x61, 0x73, 0x2b, 0x59, 0x57, 0x48, 0x0a, 0x36, 0x61, 0x4c, 0x63, + 0x72, 0x33, 0x34, 0x59, 0x45, 0x6f, 0x50, 0x39, 0x56, 0x68, 0x64, 0x42, + 0x4c, 0x74, 0x55, 0x70, 0x67, 0x6e, 0x32, 0x5a, 0x39, 0x44, 0x48, 0x32, + 0x63, 0x61, 0x6e, 0x50, 0x4c, 0x41, 0x45, 0x6e, 0x70, 0x51, 0x57, 0x35, + 0x71, 0x72, 0x4a, 0x49, 0x54, 0x69, 0x72, 0x76, 0x6e, 0x35, 0x4e, 0x53, + 0x55, 0x5a, 0x55, 0x38, 0x55, 0x6e, 0x4f, 0x4f, 0x56, 0x6b, 0x77, 0x58, + 0x0a, 0x51, 0x4d, 0x41, 0x4a, 0x4b, 0x4f, 0x53, 0x4c, 0x61, 0x6b, 0x68, + 0x54, 0x32, 0x2b, 0x7a, 0x4e, 0x56, 0x56, 0x58, 0x78, 0x78, 0x76, 0x6a, + 0x70, 0x6f, 0x69, 0x78, 0x4d, 0x70, 0x74, 0x45, 0x6d, 0x58, 0x33, 0x36, + 0x76, 0x57, 0x6b, 0x7a, 0x61, 0x48, 0x36, 0x62, 0x79, 0x48, 0x43, 0x78, + 0x2b, 0x72, 0x67, 0x49, 0x57, 0x30, 0x6c, 0x62, 0x51, 0x4c, 0x31, 0x64, + 0x54, 0x52, 0x2b, 0x69, 0x53, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x41, + 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x4f, + 0x3d, 0x43, 0x6f, 0x6d, 0x6f, 0x64, 0x6f, 0x20, 0x43, 0x41, 0x20, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x41, 0x41, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x4f, 0x3d, + 0x43, 0x6f, 0x6d, 0x6f, 0x64, 0x6f, 0x20, 0x43, 0x41, 0x20, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x6f, 0x6d, 0x6f, 0x64, 0x6f, 0x20, 0x41, + 0x41, 0x41, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, + 0x72, 0x6f, 0x6f, 0x74, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x34, 0x39, 0x3a, 0x37, 0x39, 0x3a, 0x30, 0x34, 0x3a, 0x62, 0x30, + 0x3a, 0x65, 0x62, 0x3a, 0x38, 0x37, 0x3a, 0x31, 0x39, 0x3a, 0x61, 0x63, + 0x3a, 0x34, 0x37, 0x3a, 0x62, 0x30, 0x3a, 0x62, 0x63, 0x3a, 0x31, 0x31, + 0x3a, 0x35, 0x31, 0x3a, 0x39, 0x62, 0x3a, 0x37, 0x34, 0x3a, 0x64, 0x30, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x31, 0x3a, + 0x65, 0x62, 0x3a, 0x32, 0x33, 0x3a, 0x61, 0x34, 0x3a, 0x36, 0x64, 0x3a, + 0x31, 0x37, 0x3a, 0x64, 0x36, 0x3a, 0x38, 0x66, 0x3a, 0x64, 0x39, 0x3a, + 0x32, 0x35, 0x3a, 0x36, 0x34, 0x3a, 0x63, 0x32, 0x3a, 0x66, 0x31, 0x3a, + 0x66, 0x31, 0x3a, 0x36, 0x30, 0x3a, 0x31, 0x37, 0x3a, 0x36, 0x34, 0x3a, + 0x64, 0x38, 0x3a, 0x65, 0x33, 0x3a, 0x34, 0x39, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x37, 0x3a, 0x61, 0x37, + 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x62, 0x3a, 0x35, 0x64, 0x3a, 0x37, 0x65, + 0x3a, 0x32, 0x37, 0x3a, 0x33, 0x31, 0x3a, 0x64, 0x37, 0x3a, 0x37, 0x31, + 0x3a, 0x65, 0x39, 0x3a, 0x34, 0x38, 0x3a, 0x34, 0x65, 0x3a, 0x62, 0x63, + 0x3a, 0x64, 0x65, 0x3a, 0x66, 0x37, 0x3a, 0x31, 0x64, 0x3a, 0x35, 0x66, + 0x3a, 0x30, 0x63, 0x3a, 0x33, 0x65, 0x3a, 0x30, 0x61, 0x3a, 0x32, 0x39, + 0x3a, 0x34, 0x38, 0x3a, 0x37, 0x38, 0x3a, 0x32, 0x62, 0x3a, 0x63, 0x38, + 0x3a, 0x33, 0x65, 0x3a, 0x65, 0x30, 0x3a, 0x65, 0x61, 0x3a, 0x36, 0x39, + 0x3a, 0x39, 0x65, 0x3a, 0x66, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x45, 0x4d, 0x6a, 0x43, 0x43, 0x41, 0x78, 0x71, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x54, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x37, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x48, 0x51, + 0x6a, 0x45, 0x62, 0x0a, 0x4d, 0x42, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x41, 0x77, 0x53, 0x52, 0x33, 0x4a, 0x6c, 0x59, 0x58, 0x52, 0x6c, + 0x63, 0x69, 0x42, 0x4e, 0x59, 0x57, 0x35, 0x6a, 0x61, 0x47, 0x56, 0x7a, + 0x64, 0x47, 0x56, 0x79, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x48, 0x44, 0x41, 0x64, 0x54, 0x59, 0x57, 0x78, 0x6d, + 0x62, 0x33, 0x4a, 0x6b, 0x4d, 0x52, 0x6f, 0x77, 0x0a, 0x47, 0x41, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x46, 0x44, 0x62, 0x32, 0x31, + 0x76, 0x5a, 0x47, 0x38, 0x67, 0x51, 0x30, 0x45, 0x67, 0x54, 0x47, 0x6c, + 0x74, 0x61, 0x58, 0x52, 0x6c, 0x5a, 0x44, 0x45, 0x68, 0x4d, 0x42, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x59, 0x51, 0x55, 0x46, + 0x42, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, + 0x6a, 0x0a, 0x59, 0x58, 0x52, 0x6c, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, + 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, + 0x41, 0x30, 0x4d, 0x44, 0x45, 0x77, 0x4d, 0x54, 0x41, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x34, 0x4d, 0x54, + 0x49, 0x7a, 0x4d, 0x54, 0x49, 0x7a, 0x4e, 0x54, 0x6b, 0x31, 0x4f, 0x56, + 0x6f, 0x77, 0x65, 0x7a, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, + 0x7a, 0x41, 0x5a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x45, + 0x6b, 0x64, 0x79, 0x5a, 0x57, 0x46, 0x30, 0x5a, 0x58, 0x49, 0x67, 0x54, + 0x57, 0x46, 0x75, 0x59, 0x32, 0x68, 0x6c, 0x63, 0x33, 0x52, 0x6c, 0x63, + 0x6a, 0x45, 0x51, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, + 0x42, 0x77, 0x77, 0x48, 0x55, 0x32, 0x46, 0x73, 0x5a, 0x6d, 0x39, 0x79, + 0x5a, 0x44, 0x45, 0x61, 0x4d, 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x67, 0x77, 0x52, 0x51, 0x32, 0x39, 0x74, 0x62, 0x32, 0x52, 0x76, + 0x49, 0x45, 0x4e, 0x42, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, + 0x5a, 0x57, 0x51, 0x78, 0x49, 0x54, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x4d, 0x0a, 0x47, 0x45, 0x46, 0x42, 0x51, 0x53, 0x42, + 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, + 0x30, 0x5a, 0x53, 0x42, 0x54, 0x5a, 0x58, 0x4a, 0x32, 0x61, 0x57, 0x4e, + 0x6c, 0x63, 0x7a, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x0a, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4c, + 0x35, 0x41, 0x6e, 0x66, 0x52, 0x75, 0x34, 0x65, 0x70, 0x32, 0x68, 0x78, + 0x78, 0x4e, 0x52, 0x55, 0x53, 0x4f, 0x76, 0x6b, 0x62, 0x49, 0x67, 0x77, + 0x61, 0x64, 0x77, 0x53, 0x72, 0x2b, 0x47, 0x42, 0x2b, 0x4f, 0x35, 0x41, + 0x4c, 0x36, 0x38, 0x36, 0x74, 0x64, 0x55, 0x49, 0x6f, 0x57, 0x4d, 0x51, + 0x75, 0x61, 0x0a, 0x42, 0x74, 0x44, 0x46, 0x63, 0x43, 0x4c, 0x4e, 0x53, + 0x53, 0x31, 0x55, 0x59, 0x38, 0x79, 0x32, 0x62, 0x6d, 0x68, 0x47, 0x43, + 0x31, 0x50, 0x71, 0x79, 0x30, 0x77, 0x6b, 0x77, 0x4c, 0x78, 0x79, 0x54, + 0x75, 0x72, 0x78, 0x46, 0x61, 0x37, 0x30, 0x56, 0x4a, 0x6f, 0x53, 0x43, + 0x73, 0x4e, 0x36, 0x73, 0x6a, 0x4e, 0x67, 0x34, 0x74, 0x71, 0x4a, 0x56, + 0x66, 0x4d, 0x69, 0x57, 0x50, 0x50, 0x65, 0x0a, 0x33, 0x4d, 0x2f, 0x76, + 0x67, 0x34, 0x61, 0x69, 0x6a, 0x4a, 0x52, 0x50, 0x6e, 0x32, 0x6a, 0x79, + 0x6d, 0x4a, 0x42, 0x47, 0x68, 0x43, 0x66, 0x48, 0x64, 0x72, 0x2f, 0x6a, + 0x7a, 0x44, 0x55, 0x73, 0x69, 0x31, 0x34, 0x48, 0x5a, 0x47, 0x57, 0x43, + 0x77, 0x45, 0x69, 0x77, 0x71, 0x4a, 0x48, 0x35, 0x59, 0x5a, 0x39, 0x32, + 0x49, 0x46, 0x43, 0x6f, 0x6b, 0x63, 0x64, 0x6d, 0x74, 0x65, 0x74, 0x34, + 0x0a, 0x59, 0x67, 0x4e, 0x57, 0x38, 0x49, 0x6f, 0x61, 0x45, 0x2b, 0x6f, + 0x78, 0x6f, 0x78, 0x36, 0x67, 0x6d, 0x66, 0x30, 0x34, 0x39, 0x76, 0x59, + 0x6e, 0x4d, 0x6c, 0x68, 0x76, 0x42, 0x2f, 0x56, 0x72, 0x75, 0x50, 0x73, + 0x55, 0x4b, 0x36, 0x2b, 0x33, 0x71, 0x73, 0x7a, 0x57, 0x59, 0x31, 0x39, + 0x7a, 0x6a, 0x4e, 0x6f, 0x46, 0x6d, 0x61, 0x67, 0x34, 0x71, 0x4d, 0x73, + 0x58, 0x65, 0x44, 0x5a, 0x52, 0x0a, 0x72, 0x4f, 0x6d, 0x65, 0x39, 0x48, + 0x67, 0x36, 0x6a, 0x63, 0x38, 0x50, 0x32, 0x55, 0x4c, 0x69, 0x6d, 0x41, + 0x79, 0x72, 0x4c, 0x35, 0x38, 0x4f, 0x41, 0x64, 0x37, 0x76, 0x6e, 0x35, + 0x6c, 0x4a, 0x38, 0x53, 0x33, 0x66, 0x72, 0x48, 0x52, 0x4e, 0x47, 0x35, + 0x69, 0x31, 0x52, 0x38, 0x58, 0x6c, 0x4b, 0x64, 0x48, 0x35, 0x6b, 0x42, + 0x6a, 0x48, 0x59, 0x70, 0x79, 0x2b, 0x67, 0x38, 0x63, 0x6d, 0x0a, 0x65, + 0x7a, 0x36, 0x4b, 0x4a, 0x63, 0x66, 0x41, 0x33, 0x5a, 0x33, 0x6d, 0x4e, + 0x57, 0x67, 0x51, 0x49, 0x4a, 0x32, 0x50, 0x32, 0x4e, 0x37, 0x53, 0x77, + 0x34, 0x53, 0x63, 0x44, 0x56, 0x37, 0x6f, 0x4c, 0x38, 0x6b, 0x43, 0x41, + 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, 0x42, 0x77, 0x44, 0x43, 0x42, 0x76, + 0x54, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, + 0x67, 0x51, 0x55, 0x0a, 0x6f, 0x42, 0x45, 0x4b, 0x49, 0x7a, 0x36, 0x57, + 0x38, 0x51, 0x66, 0x73, 0x34, 0x71, 0x38, 0x70, 0x37, 0x34, 0x4b, 0x6c, + 0x66, 0x39, 0x41, 0x77, 0x70, 0x4c, 0x51, 0x77, 0x44, 0x67, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, + 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x0a, 0x4d, 0x41, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x77, 0x65, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x66, 0x42, 0x48, 0x51, 0x77, 0x63, 0x6a, 0x41, 0x34, 0x6f, 0x44, 0x61, + 0x67, 0x4e, 0x49, 0x59, 0x79, 0x61, 0x48, 0x52, 0x30, 0x63, 0x44, 0x6f, + 0x76, 0x4c, 0x32, 0x4e, 0x79, 0x62, 0x43, 0x35, 0x6a, 0x62, 0x32, 0x31, + 0x76, 0x5a, 0x47, 0x39, 0x6a, 0x59, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30, + 0x76, 0x0a, 0x51, 0x55, 0x46, 0x42, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, + 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x56, 0x54, 0x5a, 0x58, + 0x4a, 0x32, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x79, 0x35, 0x6a, 0x63, 0x6d, + 0x77, 0x77, 0x4e, 0x71, 0x41, 0x30, 0x6f, 0x44, 0x4b, 0x47, 0x4d, 0x47, + 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, 0x4c, 0x79, 0x39, 0x6a, 0x63, 0x6d, + 0x77, 0x75, 0x59, 0x32, 0x39, 0x74, 0x0a, 0x62, 0x32, 0x52, 0x76, 0x4c, + 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x39, 0x42, 0x51, 0x55, 0x46, 0x44, 0x5a, + 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x5a, + 0x56, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x4c, + 0x6d, 0x4e, 0x79, 0x62, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x0a, + 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x43, 0x46, 0x62, 0x38, + 0x41, 0x76, 0x43, 0x62, 0x36, 0x50, 0x2b, 0x6b, 0x2b, 0x74, 0x5a, 0x37, + 0x78, 0x6b, 0x53, 0x41, 0x7a, 0x6b, 0x2f, 0x45, 0x78, 0x66, 0x59, 0x41, + 0x57, 0x4d, 0x79, 0x6d, 0x74, 0x72, 0x77, 0x55, 0x53, 0x57, 0x67, 0x45, + 0x64, 0x75, 0x6a, 0x6d, 0x37, 0x6c, 0x33, 0x73, 0x41, 0x67, 0x39, 0x67, + 0x31, 0x6f, 0x31, 0x51, 0x0a, 0x47, 0x45, 0x38, 0x6d, 0x54, 0x67, 0x48, + 0x6a, 0x35, 0x72, 0x43, 0x6c, 0x37, 0x72, 0x2b, 0x38, 0x64, 0x46, 0x52, + 0x42, 0x76, 0x2f, 0x33, 0x38, 0x45, 0x72, 0x6a, 0x48, 0x54, 0x31, 0x72, + 0x30, 0x69, 0x57, 0x41, 0x46, 0x66, 0x32, 0x43, 0x33, 0x42, 0x55, 0x72, + 0x7a, 0x39, 0x76, 0x48, 0x43, 0x76, 0x38, 0x53, 0x35, 0x64, 0x49, 0x61, + 0x32, 0x4c, 0x58, 0x31, 0x72, 0x7a, 0x4e, 0x4c, 0x7a, 0x0a, 0x52, 0x74, + 0x30, 0x76, 0x78, 0x75, 0x42, 0x71, 0x77, 0x38, 0x4d, 0x30, 0x41, 0x79, + 0x78, 0x39, 0x6c, 0x74, 0x31, 0x61, 0x77, 0x67, 0x36, 0x6e, 0x43, 0x70, + 0x6e, 0x42, 0x42, 0x59, 0x75, 0x72, 0x44, 0x43, 0x2f, 0x7a, 0x58, 0x44, + 0x72, 0x50, 0x62, 0x44, 0x64, 0x56, 0x43, 0x59, 0x66, 0x65, 0x55, 0x30, + 0x42, 0x73, 0x57, 0x4f, 0x2f, 0x38, 0x74, 0x71, 0x74, 0x6c, 0x62, 0x67, + 0x54, 0x32, 0x0a, 0x47, 0x39, 0x77, 0x38, 0x34, 0x46, 0x6f, 0x56, 0x78, + 0x70, 0x37, 0x5a, 0x38, 0x56, 0x6c, 0x49, 0x4d, 0x43, 0x46, 0x6c, 0x41, + 0x32, 0x7a, 0x73, 0x36, 0x53, 0x46, 0x7a, 0x37, 0x4a, 0x73, 0x44, 0x6f, + 0x65, 0x41, 0x33, 0x72, 0x61, 0x41, 0x56, 0x47, 0x49, 0x2f, 0x36, 0x75, + 0x67, 0x4c, 0x4f, 0x70, 0x79, 0x79, 0x70, 0x45, 0x42, 0x4d, 0x73, 0x31, + 0x4f, 0x55, 0x49, 0x4a, 0x71, 0x73, 0x69, 0x0a, 0x6c, 0x32, 0x44, 0x34, + 0x6b, 0x46, 0x35, 0x30, 0x31, 0x4b, 0x4b, 0x61, 0x55, 0x37, 0x33, 0x79, + 0x71, 0x57, 0x6a, 0x67, 0x6f, 0x6d, 0x37, 0x43, 0x31, 0x32, 0x79, 0x78, + 0x6f, 0x77, 0x2b, 0x65, 0x76, 0x2b, 0x74, 0x6f, 0x35, 0x31, 0x62, 0x79, + 0x72, 0x76, 0x4c, 0x6a, 0x4b, 0x7a, 0x67, 0x36, 0x43, 0x59, 0x47, 0x31, + 0x61, 0x34, 0x58, 0x58, 0x76, 0x69, 0x33, 0x74, 0x50, 0x78, 0x71, 0x33, + 0x0a, 0x73, 0x6d, 0x50, 0x69, 0x39, 0x57, 0x49, 0x73, 0x67, 0x74, 0x52, + 0x71, 0x41, 0x45, 0x46, 0x51, 0x38, 0x54, 0x6d, 0x44, 0x6e, 0x35, 0x58, + 0x70, 0x4e, 0x70, 0x61, 0x59, 0x62, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, + 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x4f, + 0x55, 0x3d, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, + 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, + 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x55, 0x3d, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x39, 0x38, 0x35, 0x30, 0x32, 0x36, 0x36, 0x39, + 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x37, 0x3a, + 0x64, 0x65, 0x3a, 0x33, 0x36, 0x3a, 0x66, 0x65, 0x3a, 0x37, 0x32, 0x3a, + 0x62, 0x37, 0x3a, 0x30, 0x30, 0x3a, 0x30, 0x33, 0x3a, 0x30, 0x30, 0x3a, + 0x39, 0x64, 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x30, 0x3a, 0x31, 0x65, 0x3a, + 0x36, 0x63, 0x3a, 0x30, 0x34, 0x3a, 0x32, 0x34, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x65, 0x3a, 0x33, 0x66, 0x3a, 0x34, + 0x30, 0x3a, 0x62, 0x64, 0x3a, 0x35, 0x30, 0x3a, 0x39, 0x33, 0x3a, 0x64, + 0x33, 0x3a, 0x39, 0x62, 0x3a, 0x36, 0x63, 0x3a, 0x36, 0x30, 0x3a, 0x66, + 0x36, 0x3a, 0x64, 0x61, 0x3a, 0x62, 0x63, 0x3a, 0x30, 0x37, 0x3a, 0x36, + 0x32, 0x3a, 0x30, 0x31, 0x3a, 0x30, 0x30, 0x3a, 0x38, 0x39, 0x3a, 0x37, + 0x36, 0x3a, 0x63, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x61, 0x34, 0x3a, 0x35, 0x65, 0x3a, 0x64, 0x65, 0x3a, + 0x33, 0x62, 0x3a, 0x62, 0x62, 0x3a, 0x66, 0x30, 0x3a, 0x39, 0x63, 0x3a, + 0x38, 0x61, 0x3a, 0x65, 0x31, 0x3a, 0x35, 0x63, 0x3a, 0x37, 0x32, 0x3a, + 0x65, 0x66, 0x3a, 0x63, 0x30, 0x3a, 0x37, 0x32, 0x3a, 0x36, 0x38, 0x3a, + 0x64, 0x36, 0x3a, 0x39, 0x33, 0x3a, 0x61, 0x32, 0x3a, 0x31, 0x63, 0x3a, + 0x39, 0x39, 0x3a, 0x36, 0x66, 0x3a, 0x64, 0x35, 0x3a, 0x31, 0x65, 0x3a, + 0x36, 0x37, 0x3a, 0x63, 0x61, 0x3a, 0x30, 0x37, 0x3a, 0x39, 0x34, 0x3a, + 0x36, 0x30, 0x3a, 0x66, 0x64, 0x3a, 0x36, 0x64, 0x3a, 0x38, 0x38, 0x3a, + 0x37, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, + 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x30, + 0x44, 0x43, 0x43, 0x42, 0x4c, 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, + 0x67, 0x49, 0x45, 0x4f, 0x72, 0x5a, 0x51, 0x69, 0x7a, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x2f, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x43, 0x0a, + 0x54, 0x54, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x68, 0x4d, 0x51, 0x55, 0x58, 0x56, 0x76, 0x56, 0x6d, 0x46, 0x6b, + 0x61, 0x58, 0x4d, 0x67, 0x54, 0x47, 0x6c, 0x74, 0x61, 0x58, 0x52, 0x6c, + 0x5a, 0x44, 0x45, 0x6c, 0x4d, 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x78, 0x4d, 0x63, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x0a, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, + 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, + 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x45, 0x75, 0x4d, 0x43, 0x77, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x6c, 0x55, 0x58, 0x56, + 0x76, 0x56, 0x6d, 0x46, 0x6b, 0x61, 0x58, 0x4d, 0x67, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x0a, 0x61, 0x57, + 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, + 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4d, 0x54, 0x41, 0x7a, 0x4d, 0x54, + 0x6b, 0x78, 0x4f, 0x44, 0x4d, 0x7a, 0x4d, 0x7a, 0x4e, 0x61, 0x46, 0x77, + 0x30, 0x79, 0x4d, 0x54, 0x41, 0x7a, 0x4d, 0x54, 0x63, 0x78, 0x4f, 0x44, + 0x4d, 0x7a, 0x0a, 0x4d, 0x7a, 0x4e, 0x61, 0x4d, 0x48, 0x38, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x4a, 0x4e, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x45, 0x78, 0x42, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, + 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x4d, 0x61, 0x57, 0x31, 0x70, 0x64, + 0x47, 0x56, 0x6b, 0x4d, 0x53, 0x55, 0x77, 0x0a, 0x49, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x78, 0x53, 0x62, 0x32, 0x39, 0x30, + 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, + 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, + 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x53, 0x34, 0x77, + 0x4c, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x56, 0x52, + 0x0a, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, + 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, + 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, + 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, + 0x35, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x0a, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, + 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x76, 0x32, + 0x47, 0x31, 0x6c, 0x56, 0x4f, 0x36, 0x56, 0x2f, 0x7a, 0x36, 0x38, 0x6d, + 0x63, 0x4c, 0x4f, 0x68, 0x72, 0x66, 0x45, 0x59, 0x42, 0x6b, 0x6c, 0x62, + 0x54, 0x52, 0x76, 0x4d, 0x31, 0x36, 0x7a, 0x2f, 0x59, 0x70, 0x0a, 0x6c, + 0x69, 0x34, 0x6b, 0x56, 0x45, 0x41, 0x6b, 0x4f, 0x50, 0x63, 0x61, 0x68, + 0x64, 0x78, 0x59, 0x54, 0x4d, 0x75, 0x6b, 0x4a, 0x30, 0x4b, 0x58, 0x30, + 0x4a, 0x2b, 0x44, 0x69, 0x73, 0x50, 0x6b, 0x42, 0x67, 0x4e, 0x62, 0x41, + 0x4b, 0x56, 0x52, 0x48, 0x6e, 0x41, 0x45, 0x64, 0x4f, 0x4c, 0x42, 0x31, + 0x44, 0x71, 0x72, 0x31, 0x36, 0x30, 0x37, 0x42, 0x78, 0x67, 0x46, 0x6a, + 0x76, 0x32, 0x44, 0x0a, 0x72, 0x4f, 0x70, 0x6d, 0x32, 0x52, 0x67, 0x62, + 0x61, 0x49, 0x72, 0x31, 0x56, 0x78, 0x71, 0x59, 0x75, 0x76, 0x58, 0x74, + 0x64, 0x6a, 0x31, 0x38, 0x32, 0x64, 0x36, 0x55, 0x61, 0x6a, 0x74, 0x4c, + 0x46, 0x38, 0x48, 0x56, 0x6a, 0x37, 0x31, 0x6c, 0x4f, 0x44, 0x71, 0x56, + 0x30, 0x44, 0x31, 0x56, 0x4e, 0x6b, 0x37, 0x66, 0x65, 0x56, 0x63, 0x78, + 0x4b, 0x68, 0x37, 0x59, 0x57, 0x57, 0x56, 0x4a, 0x0a, 0x57, 0x43, 0x43, + 0x59, 0x66, 0x71, 0x74, 0x66, 0x66, 0x70, 0x2f, 0x70, 0x31, 0x6b, 0x33, + 0x73, 0x67, 0x33, 0x53, 0x70, 0x78, 0x32, 0x7a, 0x59, 0x37, 0x69, 0x6c, + 0x4b, 0x68, 0x53, 0x6f, 0x47, 0x46, 0x50, 0x6c, 0x55, 0x35, 0x74, 0x50, + 0x61, 0x5a, 0x51, 0x65, 0x4c, 0x59, 0x7a, 0x63, 0x53, 0x31, 0x39, 0x44, + 0x73, 0x77, 0x33, 0x73, 0x67, 0x51, 0x55, 0x53, 0x6a, 0x37, 0x63, 0x75, + 0x67, 0x0a, 0x46, 0x2b, 0x46, 0x78, 0x5a, 0x63, 0x34, 0x64, 0x5a, 0x6a, + 0x48, 0x33, 0x64, 0x67, 0x45, 0x5a, 0x79, 0x48, 0x30, 0x44, 0x57, 0x4c, + 0x61, 0x56, 0x53, 0x52, 0x32, 0x6d, 0x45, 0x69, 0x62, 0x6f, 0x78, 0x67, + 0x78, 0x32, 0x34, 0x4f, 0x4e, 0x6d, 0x79, 0x2b, 0x70, 0x64, 0x70, 0x69, + 0x62, 0x75, 0x35, 0x63, 0x78, 0x66, 0x76, 0x57, 0x65, 0x6e, 0x41, 0x53, + 0x63, 0x4f, 0x6f, 0x73, 0x70, 0x55, 0x0a, 0x78, 0x62, 0x46, 0x36, 0x6c, + 0x52, 0x31, 0x78, 0x48, 0x6b, 0x6f, 0x70, 0x69, 0x67, 0x50, 0x63, 0x61, + 0x6b, 0x58, 0x42, 0x70, 0x42, 0x6c, 0x65, 0x62, 0x7a, 0x62, 0x4e, 0x77, + 0x36, 0x4b, 0x77, 0x74, 0x2f, 0x35, 0x63, 0x4f, 0x4f, 0x4a, 0x53, 0x76, + 0x50, 0x68, 0x45, 0x51, 0x2b, 0x61, 0x51, 0x75, 0x77, 0x49, 0x44, 0x41, + 0x51, 0x41, 0x42, 0x6f, 0x34, 0x49, 0x43, 0x55, 0x6a, 0x43, 0x43, 0x0a, + 0x41, 0x6b, 0x34, 0x77, 0x50, 0x51, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, + 0x42, 0x51, 0x55, 0x48, 0x41, 0x51, 0x45, 0x45, 0x4d, 0x54, 0x41, 0x76, + 0x4d, 0x43, 0x30, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, + 0x42, 0x7a, 0x41, 0x42, 0x68, 0x69, 0x46, 0x6f, 0x64, 0x48, 0x52, 0x77, + 0x63, 0x7a, 0x6f, 0x76, 0x4c, 0x32, 0x39, 0x6a, 0x63, 0x33, 0x41, 0x75, + 0x63, 0x58, 0x56, 0x76, 0x0a, 0x64, 0x6d, 0x46, 0x6b, 0x61, 0x58, 0x4e, + 0x76, 0x5a, 0x6d, 0x5a, 0x7a, 0x61, 0x47, 0x39, 0x79, 0x5a, 0x53, 0x35, + 0x6a, 0x62, 0x32, 0x30, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, + 0x42, 0x2f, 0x7a, 0x43, 0x43, 0x41, 0x52, 0x6f, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x49, 0x41, 0x53, 0x43, 0x41, 0x52, 0x45, 0x77, 0x0a, 0x67, 0x67, + 0x45, 0x4e, 0x4d, 0x49, 0x49, 0x42, 0x43, 0x51, 0x59, 0x4a, 0x4b, 0x77, + 0x59, 0x42, 0x42, 0x41, 0x47, 0x2b, 0x57, 0x41, 0x41, 0x42, 0x4d, 0x49, + 0x48, 0x37, 0x4d, 0x49, 0x48, 0x55, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, + 0x45, 0x46, 0x42, 0x51, 0x63, 0x43, 0x41, 0x6a, 0x43, 0x42, 0x78, 0x78, + 0x71, 0x42, 0x78, 0x46, 0x4a, 0x6c, 0x62, 0x47, 0x6c, 0x68, 0x62, 0x6d, + 0x4e, 0x6c, 0x0a, 0x49, 0x47, 0x39, 0x75, 0x49, 0x48, 0x52, 0x6f, 0x5a, + 0x53, 0x42, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, + 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, + 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, 0x49, + 0x47, 0x4a, 0x35, 0x49, 0x47, 0x46, 0x75, 0x65, 0x53, 0x42, 0x77, 0x59, + 0x58, 0x4a, 0x30, 0x65, 0x53, 0x42, 0x68, 0x0a, 0x63, 0x33, 0x4e, 0x31, + 0x62, 0x57, 0x56, 0x7a, 0x49, 0x47, 0x46, 0x6a, 0x59, 0x32, 0x56, 0x77, + 0x64, 0x47, 0x46, 0x75, 0x59, 0x32, 0x55, 0x67, 0x62, 0x32, 0x59, 0x67, + 0x64, 0x47, 0x68, 0x6c, 0x49, 0x48, 0x52, 0x6f, 0x5a, 0x57, 0x34, 0x67, + 0x59, 0x58, 0x42, 0x77, 0x62, 0x47, 0x6c, 0x6a, 0x59, 0x57, 0x4a, 0x73, + 0x5a, 0x53, 0x42, 0x7a, 0x64, 0x47, 0x46, 0x75, 0x5a, 0x47, 0x46, 0x79, + 0x0a, 0x5a, 0x43, 0x42, 0x30, 0x5a, 0x58, 0x4a, 0x74, 0x63, 0x79, 0x42, + 0x68, 0x62, 0x6d, 0x51, 0x67, 0x59, 0x32, 0x39, 0x75, 0x5a, 0x47, 0x6c, + 0x30, 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x76, 0x5a, 0x69, 0x42, + 0x31, 0x63, 0x32, 0x55, 0x73, 0x49, 0x47, 0x4e, 0x6c, 0x63, 0x6e, 0x52, + 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, + 0x67, 0x63, 0x48, 0x4a, 0x68, 0x0a, 0x59, 0x33, 0x52, 0x70, 0x59, 0x32, + 0x56, 0x7a, 0x4c, 0x43, 0x42, 0x68, 0x62, 0x6d, 0x51, 0x67, 0x64, 0x47, + 0x68, 0x6c, 0x49, 0x46, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, + 0x6c, 0x7a, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, 0x49, 0x46, 0x42, 0x76, 0x62, 0x47, + 0x6c, 0x6a, 0x65, 0x53, 0x34, 0x77, 0x49, 0x67, 0x59, 0x49, 0x0a, 0x4b, + 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x67, 0x45, 0x57, 0x46, + 0x6d, 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, 0x4c, 0x79, 0x39, 0x33, 0x64, + 0x33, 0x63, 0x75, 0x63, 0x58, 0x56, 0x76, 0x64, 0x6d, 0x46, 0x6b, 0x61, + 0x58, 0x4d, 0x75, 0x59, 0x6d, 0x30, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x49, 0x74, 0x4c, 0x62, + 0x65, 0x33, 0x54, 0x0a, 0x4b, 0x62, 0x6b, 0x47, 0x47, 0x65, 0x77, 0x35, + 0x4f, 0x61, 0x6e, 0x77, 0x6c, 0x34, 0x52, 0x71, 0x79, 0x2b, 0x2f, 0x66, + 0x4d, 0x49, 0x47, 0x75, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, + 0x67, 0x61, 0x59, 0x77, 0x67, 0x61, 0x4f, 0x41, 0x46, 0x49, 0x74, 0x4c, + 0x62, 0x65, 0x33, 0x54, 0x4b, 0x62, 0x6b, 0x47, 0x47, 0x65, 0x77, 0x35, + 0x4f, 0x61, 0x6e, 0x77, 0x6c, 0x34, 0x52, 0x71, 0x0a, 0x79, 0x2b, 0x2f, + 0x66, 0x6f, 0x59, 0x47, 0x45, 0x70, 0x49, 0x47, 0x42, 0x4d, 0x48, 0x38, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6b, 0x4a, 0x4e, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x42, 0x52, 0x64, 0x57, 0x39, + 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x4d, 0x61, 0x57, 0x31, + 0x70, 0x0a, 0x64, 0x47, 0x56, 0x6b, 0x4d, 0x53, 0x55, 0x77, 0x49, 0x77, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x78, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, + 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x53, + 0x34, 0x77, 0x4c, 0x41, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x44, 0x45, + 0x79, 0x56, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, + 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, + 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, + 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, + 0x58, 0x52, 0x35, 0x67, 0x67, 0x51, 0x36, 0x74, 0x6c, 0x43, 0x4c, 0x0a, + 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, + 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, + 0x69, 0x74, 0x51, 0x55, 0x74, 0x66, 0x37, 0x30, 0x6d, 0x70, 0x4b, 0x6e, + 0x47, 0x64, 0x53, 0x6b, 0x0a, 0x66, 0x6e, 0x49, 0x59, 0x6a, 0x39, 0x6c, + 0x6f, 0x66, 0x46, 0x49, 0x6b, 0x33, 0x57, 0x64, 0x76, 0x4f, 0x58, 0x72, + 0x45, 0x71, 0x6c, 0x34, 0x39, 0x34, 0x6c, 0x69, 0x77, 0x54, 0x58, 0x43, + 0x59, 0x68, 0x47, 0x48, 0x6f, 0x47, 0x2b, 0x4e, 0x70, 0x47, 0x41, 0x37, + 0x4f, 0x2b, 0x30, 0x64, 0x51, 0x6f, 0x45, 0x37, 0x2f, 0x38, 0x43, 0x51, + 0x66, 0x76, 0x62, 0x4c, 0x4f, 0x39, 0x53, 0x66, 0x38, 0x0a, 0x37, 0x43, + 0x39, 0x54, 0x71, 0x6e, 0x4e, 0x37, 0x41, 0x7a, 0x31, 0x30, 0x62, 0x75, + 0x59, 0x57, 0x6e, 0x75, 0x75, 0x6c, 0x4c, 0x73, 0x53, 0x2f, 0x56, 0x69, + 0x64, 0x51, 0x4b, 0x32, 0x4b, 0x36, 0x76, 0x6b, 0x73, 0x63, 0x50, 0x46, + 0x56, 0x63, 0x51, 0x52, 0x30, 0x6b, 0x76, 0x6f, 0x49, 0x67, 0x52, 0x31, + 0x33, 0x56, 0x52, 0x48, 0x35, 0x36, 0x46, 0x6d, 0x6a, 0x66, 0x66, 0x55, + 0x31, 0x52, 0x0a, 0x63, 0x48, 0x68, 0x58, 0x48, 0x54, 0x4d, 0x65, 0x2f, + 0x51, 0x4b, 0x5a, 0x6e, 0x41, 0x7a, 0x4e, 0x43, 0x67, 0x56, 0x50, 0x78, + 0x37, 0x75, 0x4f, 0x70, 0x48, 0x58, 0x36, 0x53, 0x6d, 0x32, 0x78, 0x67, + 0x49, 0x34, 0x4a, 0x56, 0x72, 0x6d, 0x63, 0x47, 0x6d, 0x44, 0x2b, 0x58, + 0x63, 0x48, 0x58, 0x65, 0x74, 0x77, 0x52, 0x65, 0x4e, 0x44, 0x57, 0x58, + 0x63, 0x47, 0x33, 0x31, 0x61, 0x30, 0x79, 0x0a, 0x6d, 0x51, 0x4d, 0x36, + 0x69, 0x73, 0x78, 0x55, 0x4a, 0x54, 0x6b, 0x78, 0x67, 0x58, 0x73, 0x54, + 0x49, 0x6c, 0x47, 0x36, 0x52, 0x6d, 0x79, 0x68, 0x75, 0x35, 0x37, 0x36, + 0x42, 0x47, 0x78, 0x4a, 0x4a, 0x6e, 0x53, 0x50, 0x30, 0x6e, 0x50, 0x72, + 0x7a, 0x44, 0x43, 0x69, 0x35, 0x75, 0x70, 0x5a, 0x49, 0x6f, 0x66, 0x34, + 0x6c, 0x2f, 0x55, 0x4f, 0x2f, 0x65, 0x72, 0x4d, 0x6b, 0x71, 0x51, 0x57, + 0x0a, 0x78, 0x46, 0x49, 0x59, 0x36, 0x69, 0x48, 0x4f, 0x73, 0x66, 0x48, + 0x6d, 0x68, 0x49, 0x48, 0x6c, 0x75, 0x71, 0x6d, 0x47, 0x4b, 0x50, 0x4a, + 0x44, 0x57, 0x6c, 0x30, 0x53, 0x6e, 0x61, 0x77, 0x65, 0x32, 0x61, 0x6a, + 0x6c, 0x43, 0x6d, 0x71, 0x6e, 0x66, 0x36, 0x43, 0x48, 0x4b, 0x63, 0x2f, + 0x79, 0x69, 0x55, 0x33, 0x55, 0x37, 0x4d, 0x58, 0x69, 0x35, 0x6e, 0x72, + 0x51, 0x4e, 0x69, 0x4f, 0x4b, 0x0a, 0x53, 0x6e, 0x51, 0x32, 0x2b, 0x51, + 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, + 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x32, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, + 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, + 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, + 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x51, + 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x32, 0x38, 0x39, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x65, 0x3a, 0x33, 0x39, 0x3a, 0x37, + 0x62, 0x3a, 0x64, 0x64, 0x3a, 0x66, 0x38, 0x3a, 0x62, 0x61, 0x3a, 0x65, + 0x63, 0x3a, 0x38, 0x32, 0x3a, 0x65, 0x39, 0x3a, 0x61, 0x63, 0x3a, 0x36, + 0x32, 0x3a, 0x62, 0x61, 0x3a, 0x30, 0x63, 0x3a, 0x35, 0x34, 0x3a, 0x30, + 0x30, 0x3a, 0x32, 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x63, 0x61, 0x3a, 0x33, 0x61, 0x3a, 0x66, 0x62, 0x3a, 0x63, 0x66, + 0x3a, 0x31, 0x32, 0x3a, 0x34, 0x30, 0x3a, 0x33, 0x36, 0x3a, 0x34, 0x62, + 0x3a, 0x34, 0x34, 0x3a, 0x62, 0x32, 0x3a, 0x31, 0x36, 0x3a, 0x32, 0x30, + 0x3a, 0x38, 0x38, 0x3a, 0x38, 0x30, 0x3a, 0x34, 0x38, 0x3a, 0x33, 0x39, + 0x3a, 0x31, 0x39, 0x3a, 0x39, 0x33, 0x3a, 0x37, 0x63, 0x3a, 0x66, 0x37, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, + 0x35, 0x3a, 0x61, 0x30, 0x3a, 0x64, 0x64, 0x3a, 0x37, 0x64, 0x3a, 0x64, + 0x37, 0x3a, 0x32, 0x30, 0x3a, 0x61, 0x64, 0x3a, 0x62, 0x37, 0x3a, 0x66, + 0x66, 0x3a, 0x30, 0x35, 0x3a, 0x66, 0x38, 0x3a, 0x33, 0x64, 0x3a, 0x35, + 0x34, 0x3a, 0x32, 0x62, 0x3a, 0x32, 0x30, 0x3a, 0x39, 0x64, 0x3a, 0x63, + 0x37, 0x3a, 0x66, 0x66, 0x3a, 0x34, 0x35, 0x3a, 0x32, 0x38, 0x3a, 0x66, + 0x37, 0x3a, 0x64, 0x36, 0x3a, 0x37, 0x37, 0x3a, 0x62, 0x31, 0x3a, 0x38, + 0x33, 0x3a, 0x38, 0x39, 0x3a, 0x66, 0x65, 0x3a, 0x61, 0x35, 0x3a, 0x65, + 0x35, 0x3a, 0x63, 0x34, 0x3a, 0x39, 0x65, 0x3a, 0x38, 0x36, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x74, 0x7a, 0x43, 0x43, 0x41, + 0x35, 0x2b, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x43, 0x42, + 0x51, 0x6b, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x52, + 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x51, 0x6b, 0x30, 0x78, 0x0a, 0x47, 0x54, 0x41, 0x58, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x45, 0x46, 0x46, 0x31, + 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x45, 0x78, 0x70, + 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, 0x78, 0x47, 0x7a, 0x41, 0x5a, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x45, 0x6c, 0x46, 0x31, + 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x46, 0x4a, 0x76, + 0x0a, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x6a, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x77, 0x4e, 0x6a, 0x45, 0x78, 0x4d, 0x6a, 0x51, + 0x78, 0x4f, 0x44, 0x49, 0x33, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, + 0x7a, 0x4d, 0x54, 0x45, 0x78, 0x4d, 0x6a, 0x51, 0x78, 0x4f, 0x44, 0x49, + 0x7a, 0x4d, 0x7a, 0x4e, 0x61, 0x4d, 0x45, 0x55, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, + 0x4a, 0x4e, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x45, 0x78, 0x42, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, + 0x52, 0x70, 0x63, 0x79, 0x42, 0x4d, 0x61, 0x57, 0x31, 0x70, 0x64, 0x47, + 0x56, 0x6b, 0x4d, 0x52, 0x73, 0x77, 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x4a, 0x52, 0x64, 0x57, 0x39, 0x57, 0x0a, 0x59, + 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, + 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, + 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, + 0x51, 0x43, 0x61, 0x0a, 0x47, 0x4d, 0x70, 0x4c, 0x6c, 0x41, 0x30, 0x41, + 0x4c, 0x61, 0x38, 0x44, 0x4b, 0x59, 0x72, 0x77, 0x44, 0x34, 0x48, 0x49, + 0x72, 0x6b, 0x77, 0x5a, 0x68, 0x52, 0x30, 0x49, 0x6e, 0x36, 0x73, 0x70, + 0x52, 0x49, 0x58, 0x7a, 0x4c, 0x34, 0x47, 0x74, 0x4d, 0x68, 0x36, 0x51, + 0x52, 0x72, 0x2b, 0x6a, 0x68, 0x69, 0x59, 0x61, 0x48, 0x76, 0x35, 0x2b, + 0x48, 0x42, 0x67, 0x36, 0x58, 0x4a, 0x78, 0x67, 0x0a, 0x46, 0x79, 0x6f, + 0x36, 0x64, 0x49, 0x4d, 0x7a, 0x4d, 0x48, 0x31, 0x68, 0x56, 0x42, 0x48, + 0x4c, 0x37, 0x61, 0x76, 0x67, 0x35, 0x74, 0x4b, 0x69, 0x66, 0x76, 0x56, + 0x72, 0x62, 0x78, 0x69, 0x33, 0x43, 0x67, 0x73, 0x74, 0x2f, 0x65, 0x6b, + 0x2b, 0x37, 0x77, 0x72, 0x47, 0x73, 0x78, 0x44, 0x70, 0x33, 0x4d, 0x4a, + 0x47, 0x46, 0x2f, 0x68, 0x64, 0x2f, 0x61, 0x54, 0x61, 0x2f, 0x35, 0x35, + 0x4a, 0x0a, 0x57, 0x70, 0x7a, 0x6d, 0x4d, 0x2b, 0x59, 0x6b, 0x6c, 0x76, + 0x63, 0x2f, 0x75, 0x6c, 0x73, 0x72, 0x48, 0x48, 0x6f, 0x31, 0x77, 0x74, + 0x5a, 0x6e, 0x2f, 0x71, 0x74, 0x6d, 0x55, 0x49, 0x74, 0x74, 0x4b, 0x47, + 0x41, 0x72, 0x37, 0x39, 0x64, 0x67, 0x77, 0x38, 0x65, 0x54, 0x76, 0x49, + 0x30, 0x32, 0x6b, 0x66, 0x4e, 0x2f, 0x2b, 0x4e, 0x73, 0x52, 0x45, 0x38, + 0x53, 0x63, 0x64, 0x33, 0x62, 0x42, 0x0a, 0x72, 0x72, 0x63, 0x43, 0x61, + 0x6f, 0x46, 0x36, 0x71, 0x55, 0x57, 0x44, 0x34, 0x67, 0x58, 0x6d, 0x75, + 0x56, 0x62, 0x42, 0x6c, 0x44, 0x65, 0x50, 0x53, 0x48, 0x46, 0x6a, 0x49, + 0x75, 0x77, 0x58, 0x5a, 0x51, 0x65, 0x56, 0x69, 0x6b, 0x76, 0x66, 0x6a, + 0x38, 0x5a, 0x61, 0x43, 0x75, 0x57, 0x77, 0x34, 0x31, 0x39, 0x65, 0x61, + 0x78, 0x47, 0x72, 0x44, 0x50, 0x6d, 0x46, 0x36, 0x30, 0x54, 0x70, 0x0a, + 0x2b, 0x41, 0x52, 0x7a, 0x38, 0x75, 0x6e, 0x2b, 0x58, 0x4a, 0x69, 0x4d, + 0x39, 0x58, 0x4f, 0x76, 0x61, 0x37, 0x52, 0x2b, 0x7a, 0x64, 0x52, 0x63, + 0x41, 0x69, 0x74, 0x4d, 0x4f, 0x65, 0x47, 0x79, 0x6c, 0x5a, 0x55, 0x74, + 0x51, 0x6f, 0x66, 0x58, 0x31, 0x62, 0x4f, 0x51, 0x51, 0x37, 0x64, 0x73, + 0x45, 0x2f, 0x48, 0x65, 0x33, 0x66, 0x62, 0x45, 0x2b, 0x49, 0x6b, 0x2f, + 0x30, 0x58, 0x58, 0x31, 0x0a, 0x6b, 0x73, 0x4f, 0x52, 0x31, 0x59, 0x71, + 0x49, 0x30, 0x4a, 0x44, 0x73, 0x33, 0x47, 0x33, 0x65, 0x69, 0x63, 0x4a, + 0x6c, 0x63, 0x5a, 0x61, 0x4c, 0x44, 0x51, 0x50, 0x39, 0x6e, 0x4c, 0x39, + 0x62, 0x46, 0x71, 0x79, 0x53, 0x32, 0x2b, 0x72, 0x2b, 0x65, 0x58, 0x79, + 0x74, 0x36, 0x36, 0x2f, 0x33, 0x46, 0x73, 0x76, 0x62, 0x7a, 0x53, 0x55, + 0x72, 0x35, 0x52, 0x2f, 0x37, 0x6d, 0x70, 0x2f, 0x69, 0x0a, 0x55, 0x63, + 0x77, 0x36, 0x55, 0x77, 0x78, 0x49, 0x35, 0x67, 0x36, 0x39, 0x79, 0x62, + 0x52, 0x32, 0x42, 0x6c, 0x4c, 0x6d, 0x45, 0x52, 0x4f, 0x46, 0x63, 0x6d, + 0x4d, 0x44, 0x42, 0x4f, 0x41, 0x45, 0x4e, 0x69, 0x73, 0x67, 0x47, 0x51, + 0x4c, 0x6f, 0x64, 0x4b, 0x63, 0x66, 0x74, 0x73, 0x6c, 0x57, 0x5a, 0x76, + 0x42, 0x31, 0x4a, 0x64, 0x78, 0x6e, 0x77, 0x51, 0x35, 0x68, 0x59, 0x49, + 0x69, 0x7a, 0x0a, 0x50, 0x74, 0x47, 0x6f, 0x2f, 0x4b, 0x50, 0x61, 0x48, + 0x62, 0x44, 0x52, 0x73, 0x53, 0x4e, 0x55, 0x33, 0x30, 0x52, 0x32, 0x62, + 0x65, 0x31, 0x42, 0x32, 0x4d, 0x47, 0x79, 0x49, 0x72, 0x5a, 0x54, 0x48, + 0x4e, 0x38, 0x31, 0x48, 0x64, 0x79, 0x68, 0x64, 0x79, 0x6f, 0x78, 0x35, + 0x43, 0x33, 0x31, 0x35, 0x65, 0x58, 0x62, 0x79, 0x4f, 0x44, 0x2f, 0x35, + 0x59, 0x44, 0x58, 0x43, 0x32, 0x4f, 0x67, 0x0a, 0x2f, 0x7a, 0x4f, 0x68, + 0x44, 0x37, 0x6f, 0x73, 0x46, 0x52, 0x58, 0x71, 0x6c, 0x37, 0x50, 0x53, + 0x6f, 0x72, 0x57, 0x2b, 0x38, 0x6f, 0x79, 0x57, 0x48, 0x68, 0x71, 0x50, + 0x48, 0x57, 0x79, 0x6b, 0x59, 0x54, 0x65, 0x35, 0x68, 0x6e, 0x4d, 0x7a, + 0x31, 0x35, 0x65, 0x57, 0x6e, 0x69, 0x4e, 0x39, 0x67, 0x71, 0x52, 0x4d, + 0x67, 0x65, 0x4b, 0x68, 0x30, 0x62, 0x70, 0x6e, 0x58, 0x35, 0x55, 0x48, + 0x0a, 0x6f, 0x79, 0x63, 0x52, 0x37, 0x68, 0x59, 0x51, 0x65, 0x37, 0x78, + 0x46, 0x53, 0x6b, 0x79, 0x79, 0x42, 0x4e, 0x4b, 0x72, 0x37, 0x39, 0x58, + 0x39, 0x44, 0x46, 0x48, 0x4f, 0x55, 0x47, 0x6f, 0x49, 0x4d, 0x66, 0x6d, + 0x52, 0x32, 0x67, 0x79, 0x50, 0x5a, 0x46, 0x77, 0x44, 0x77, 0x7a, 0x71, + 0x4c, 0x49, 0x44, 0x39, 0x75, 0x6a, 0x57, 0x63, 0x39, 0x4f, 0x74, 0x62, + 0x2b, 0x66, 0x56, 0x75, 0x49, 0x0a, 0x79, 0x56, 0x37, 0x37, 0x7a, 0x47, + 0x48, 0x63, 0x69, 0x7a, 0x4e, 0x33, 0x30, 0x30, 0x51, 0x79, 0x4e, 0x51, + 0x6c, 0x69, 0x42, 0x4a, 0x49, 0x57, 0x45, 0x4e, 0x69, 0x65, 0x4a, 0x30, + 0x66, 0x37, 0x4f, 0x79, 0x48, 0x6a, 0x2b, 0x4f, 0x73, 0x64, 0x57, 0x77, + 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x47, 0x77, 0x4d, 0x49, + 0x47, 0x74, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x0a, 0x45, + 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, + 0x66, 0x38, 0x77, 0x43, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x42, + 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, + 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x51, 0x61, 0x68, + 0x47, 0x4b, 0x38, 0x53, 0x45, 0x77, 0x7a, 0x4a, 0x51, 0x54, 0x55, 0x37, + 0x74, 0x44, 0x32, 0x0a, 0x41, 0x38, 0x51, 0x5a, 0x52, 0x74, 0x47, 0x55, + 0x61, 0x7a, 0x42, 0x75, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, + 0x5a, 0x7a, 0x42, 0x6c, 0x67, 0x42, 0x51, 0x61, 0x68, 0x47, 0x4b, 0x38, + 0x53, 0x45, 0x77, 0x7a, 0x4a, 0x51, 0x54, 0x55, 0x37, 0x74, 0x44, 0x32, + 0x41, 0x38, 0x51, 0x5a, 0x52, 0x74, 0x47, 0x55, 0x61, 0x36, 0x46, 0x4a, + 0x70, 0x45, 0x63, 0x77, 0x52, 0x54, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x51, 0x6b, 0x30, + 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x54, 0x45, 0x46, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, 0x6c, + 0x7a, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, + 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x54, 0x0a, 0x45, 0x6c, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, + 0x6c, 0x7a, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, + 0x45, 0x67, 0x4d, 0x6f, 0x49, 0x43, 0x42, 0x51, 0x6b, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x44, + 0x34, 0x4b, 0x46, 0x6b, 0x32, 0x66, 0x0a, 0x42, 0x6c, 0x75, 0x6f, 0x72, + 0x6e, 0x46, 0x64, 0x4c, 0x77, 0x55, 0x76, 0x5a, 0x2b, 0x59, 0x54, 0x52, + 0x59, 0x50, 0x45, 0x4e, 0x76, 0x62, 0x7a, 0x77, 0x43, 0x59, 0x4d, 0x44, + 0x62, 0x56, 0x48, 0x5a, 0x46, 0x33, 0x34, 0x74, 0x48, 0x4c, 0x4a, 0x52, + 0x71, 0x55, 0x44, 0x47, 0x43, 0x64, 0x56, 0x69, 0x58, 0x68, 0x39, 0x64, + 0x75, 0x71, 0x57, 0x4e, 0x49, 0x41, 0x58, 0x49, 0x4e, 0x7a, 0x6e, 0x0a, + 0x67, 0x2f, 0x69, 0x4e, 0x2f, 0x41, 0x65, 0x34, 0x32, 0x6c, 0x39, 0x4e, + 0x4c, 0x6d, 0x65, 0x79, 0x68, 0x50, 0x33, 0x5a, 0x52, 0x50, 0x78, 0x33, + 0x55, 0x49, 0x48, 0x6d, 0x66, 0x4c, 0x54, 0x4a, 0x44, 0x51, 0x74, 0x79, + 0x55, 0x2f, 0x68, 0x32, 0x42, 0x77, 0x64, 0x42, 0x52, 0x35, 0x59, 0x4d, + 0x2b, 0x2b, 0x43, 0x43, 0x4a, 0x70, 0x4e, 0x56, 0x6a, 0x50, 0x34, 0x69, + 0x48, 0x32, 0x42, 0x6c, 0x0a, 0x66, 0x46, 0x2f, 0x6e, 0x4a, 0x72, 0x50, + 0x33, 0x4d, 0x70, 0x43, 0x59, 0x55, 0x4e, 0x51, 0x33, 0x63, 0x56, 0x58, + 0x32, 0x6b, 0x69, 0x46, 0x34, 0x39, 0x35, 0x56, 0x35, 0x2b, 0x76, 0x67, + 0x74, 0x4a, 0x6f, 0x64, 0x6d, 0x56, 0x6a, 0x42, 0x33, 0x70, 0x6a, 0x64, + 0x34, 0x4d, 0x31, 0x49, 0x51, 0x57, 0x4b, 0x34, 0x2f, 0x59, 0x59, 0x37, + 0x79, 0x61, 0x72, 0x48, 0x76, 0x47, 0x48, 0x35, 0x4b, 0x0a, 0x57, 0x57, + 0x50, 0x4b, 0x6a, 0x61, 0x4a, 0x57, 0x31, 0x61, 0x63, 0x76, 0x76, 0x46, + 0x59, 0x66, 0x7a, 0x7a, 0x6e, 0x42, 0x34, 0x76, 0x73, 0x4b, 0x71, 0x42, + 0x55, 0x73, 0x66, 0x55, 0x31, 0x36, 0x59, 0x38, 0x5a, 0x73, 0x6c, 0x30, + 0x51, 0x38, 0x30, 0x6d, 0x2f, 0x44, 0x53, 0x68, 0x63, 0x4b, 0x2b, 0x4a, + 0x44, 0x53, 0x56, 0x36, 0x49, 0x5a, 0x55, 0x61, 0x55, 0x74, 0x6c, 0x30, + 0x48, 0x61, 0x0a, 0x42, 0x30, 0x2b, 0x70, 0x55, 0x4e, 0x71, 0x51, 0x6a, + 0x5a, 0x52, 0x47, 0x34, 0x54, 0x37, 0x77, 0x6c, 0x50, 0x30, 0x51, 0x41, + 0x44, 0x6a, 0x31, 0x4f, 0x2b, 0x68, 0x41, 0x34, 0x62, 0x52, 0x75, 0x56, + 0x68, 0x6f, 0x67, 0x7a, 0x47, 0x39, 0x59, 0x6a, 0x65, 0x30, 0x75, 0x52, + 0x59, 0x2f, 0x57, 0x36, 0x5a, 0x4d, 0x2f, 0x35, 0x37, 0x45, 0x73, 0x33, + 0x7a, 0x72, 0x57, 0x49, 0x6f, 0x7a, 0x63, 0x0a, 0x68, 0x4c, 0x73, 0x69, + 0x62, 0x39, 0x44, 0x34, 0x35, 0x4d, 0x59, 0x35, 0x36, 0x51, 0x53, 0x49, + 0x50, 0x4d, 0x4f, 0x36, 0x36, 0x31, 0x56, 0x36, 0x62, 0x59, 0x43, 0x5a, + 0x4a, 0x50, 0x56, 0x73, 0x41, 0x66, 0x76, 0x34, 0x6c, 0x37, 0x43, 0x55, + 0x57, 0x2b, 0x76, 0x39, 0x30, 0x6d, 0x2f, 0x78, 0x64, 0x32, 0x67, 0x4e, + 0x4e, 0x57, 0x51, 0x6a, 0x72, 0x4c, 0x68, 0x56, 0x6f, 0x51, 0x50, 0x52, + 0x0a, 0x54, 0x55, 0x49, 0x5a, 0x33, 0x50, 0x68, 0x31, 0x57, 0x56, 0x61, + 0x6a, 0x2b, 0x61, 0x68, 0x4a, 0x65, 0x66, 0x69, 0x76, 0x44, 0x72, 0x6b, + 0x52, 0x6f, 0x48, 0x79, 0x33, 0x61, 0x75, 0x30, 0x30, 0x30, 0x4c, 0x59, + 0x6d, 0x59, 0x6a, 0x67, 0x61, 0x68, 0x77, 0x7a, 0x34, 0x36, 0x50, 0x30, + 0x75, 0x30, 0x35, 0x42, 0x2f, 0x42, 0x35, 0x45, 0x71, 0x48, 0x64, 0x5a, + 0x2b, 0x58, 0x49, 0x57, 0x44, 0x0a, 0x6d, 0x62, 0x41, 0x34, 0x43, 0x44, + 0x2f, 0x70, 0x58, 0x76, 0x6b, 0x31, 0x42, 0x2b, 0x54, 0x4a, 0x59, 0x6d, + 0x35, 0x58, 0x66, 0x36, 0x64, 0x51, 0x6c, 0x66, 0x65, 0x36, 0x79, 0x4a, + 0x76, 0x6d, 0x6a, 0x71, 0x49, 0x42, 0x78, 0x64, 0x5a, 0x6d, 0x76, 0x33, + 0x6c, 0x68, 0x38, 0x7a, 0x77, 0x63, 0x34, 0x62, 0x6d, 0x43, 0x58, 0x46, + 0x32, 0x67, 0x77, 0x2b, 0x6e, 0x59, 0x53, 0x4c, 0x30, 0x5a, 0x0a, 0x6f, + 0x68, 0x45, 0x55, 0x47, 0x57, 0x36, 0x79, 0x68, 0x68, 0x74, 0x6f, 0x50, + 0x6b, 0x67, 0x33, 0x47, 0x6f, 0x69, 0x33, 0x58, 0x5a, 0x5a, 0x65, 0x6e, + 0x4d, 0x66, 0x76, 0x4a, 0x32, 0x49, 0x49, 0x34, 0x70, 0x45, 0x5a, 0x58, + 0x4e, 0x4c, 0x78, 0x49, 0x64, 0x32, 0x36, 0x46, 0x30, 0x4b, 0x43, 0x6c, + 0x33, 0x47, 0x42, 0x55, 0x7a, 0x47, 0x70, 0x6e, 0x2f, 0x5a, 0x39, 0x59, + 0x72, 0x39, 0x79, 0x0a, 0x34, 0x61, 0x4f, 0x54, 0x48, 0x63, 0x79, 0x4b, + 0x4a, 0x6c, 0x6f, 0x4a, 0x4f, 0x4e, 0x44, 0x4f, 0x31, 0x77, 0x32, 0x41, + 0x46, 0x72, 0x52, 0x34, 0x70, 0x54, 0x71, 0x48, 0x54, 0x49, 0x32, 0x4b, + 0x70, 0x64, 0x56, 0x47, 0x6c, 0x2f, 0x49, 0x73, 0x45, 0x4c, 0x6d, 0x38, + 0x56, 0x43, 0x4c, 0x41, 0x41, 0x56, 0x42, 0x70, 0x51, 0x35, 0x37, 0x30, + 0x73, 0x75, 0x39, 0x74, 0x2b, 0x4f, 0x7a, 0x61, 0x0a, 0x38, 0x65, 0x4f, + 0x78, 0x37, 0x39, 0x2b, 0x52, 0x6a, 0x31, 0x51, 0x71, 0x43, 0x79, 0x58, + 0x42, 0x4a, 0x68, 0x6e, 0x45, 0x55, 0x68, 0x41, 0x46, 0x5a, 0x64, 0x57, + 0x43, 0x45, 0x4f, 0x72, 0x43, 0x4d, 0x63, 0x30, 0x75, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33, 0x20, 0x4f, 0x3d, 0x51, + 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, + 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33, + 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, + 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x34, 0x37, 0x38, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x33, 0x31, 0x3a, 0x38, 0x35, 0x3a, 0x33, 0x63, 0x3a, 0x36, 0x32, 0x3a, + 0x39, 0x34, 0x3a, 0x39, 0x37, 0x3a, 0x36, 0x33, 0x3a, 0x62, 0x39, 0x3a, + 0x61, 0x61, 0x3a, 0x66, 0x64, 0x3a, 0x38, 0x39, 0x3a, 0x34, 0x65, 0x3a, + 0x61, 0x66, 0x3a, 0x36, 0x66, 0x3a, 0x65, 0x30, 0x3a, 0x63, 0x66, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x66, 0x3a, 0x34, + 0x39, 0x3a, 0x31, 0x34, 0x3a, 0x66, 0x37, 0x3a, 0x64, 0x38, 0x3a, 0x37, + 0x34, 0x3a, 0x39, 0x35, 0x3a, 0x31, 0x64, 0x3a, 0x64, 0x64, 0x3a, 0x61, + 0x65, 0x3a, 0x30, 0x32, 0x3a, 0x63, 0x30, 0x3a, 0x62, 0x65, 0x3a, 0x66, + 0x64, 0x3a, 0x33, 0x61, 0x3a, 0x32, 0x64, 0x3a, 0x38, 0x32, 0x3a, 0x37, + 0x35, 0x3a, 0x35, 0x31, 0x3a, 0x38, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x38, 0x3a, 0x66, 0x31, 0x3a, + 0x66, 0x63, 0x3a, 0x37, 0x66, 0x3a, 0x32, 0x30, 0x3a, 0x35, 0x64, 0x3a, + 0x66, 0x38, 0x3a, 0x61, 0x64, 0x3a, 0x64, 0x64, 0x3a, 0x65, 0x62, 0x3a, + 0x37, 0x66, 0x3a, 0x65, 0x30, 0x3a, 0x30, 0x37, 0x3a, 0x64, 0x64, 0x3a, + 0x35, 0x37, 0x3a, 0x65, 0x33, 0x3a, 0x61, 0x66, 0x3a, 0x33, 0x37, 0x3a, + 0x35, 0x61, 0x3a, 0x39, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x38, 0x64, 0x3a, + 0x37, 0x33, 0x3a, 0x35, 0x34, 0x3a, 0x36, 0x62, 0x3a, 0x66, 0x34, 0x3a, + 0x66, 0x31, 0x3a, 0x66, 0x65, 0x3a, 0x64, 0x31, 0x3a, 0x65, 0x31, 0x3a, + 0x38, 0x64, 0x3a, 0x33, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x47, 0x6e, 0x54, 0x43, 0x43, 0x42, 0x49, 0x57, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x43, 0x42, 0x63, 0x59, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x52, 0x54, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x51, 0x6b, + 0x30, 0x78, 0x0a, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x54, 0x45, 0x46, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, + 0x47, 0x6c, 0x7a, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, + 0x57, 0x51, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x4d, 0x54, 0x45, 0x6c, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, + 0x47, 0x6c, 0x7a, 0x49, 0x46, 0x4a, 0x76, 0x0a, 0x62, 0x33, 0x51, 0x67, + 0x51, 0x30, 0x45, 0x67, 0x4d, 0x7a, 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, + 0x4e, 0x6a, 0x45, 0x78, 0x4d, 0x6a, 0x51, 0x78, 0x4f, 0x54, 0x45, 0x78, + 0x4d, 0x6a, 0x4e, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4d, 0x54, 0x45, 0x78, + 0x4d, 0x6a, 0x51, 0x78, 0x4f, 0x54, 0x41, 0x32, 0x4e, 0x44, 0x52, 0x61, + 0x4d, 0x45, 0x55, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, + 0x0a, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x4a, 0x4e, 0x4d, 0x52, 0x6b, + 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x42, + 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, + 0x4d, 0x61, 0x57, 0x31, 0x70, 0x64, 0x47, 0x56, 0x6b, 0x4d, 0x52, 0x73, + 0x77, 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x4a, + 0x52, 0x64, 0x57, 0x39, 0x57, 0x0a, 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, + 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, + 0x4d, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, + 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x44, 0x4d, 0x0a, 0x56, + 0x30, 0x49, 0x57, 0x56, 0x4a, 0x7a, 0x6d, 0x6d, 0x4e, 0x50, 0x54, 0x54, + 0x65, 0x37, 0x2b, 0x37, 0x63, 0x65, 0x66, 0x51, 0x7a, 0x6c, 0x4b, 0x5a, + 0x62, 0x50, 0x6f, 0x46, 0x6f, 0x67, 0x30, 0x32, 0x77, 0x31, 0x5a, 0x6b, + 0x58, 0x54, 0x50, 0x6b, 0x72, 0x67, 0x45, 0x51, 0x4b, 0x30, 0x43, 0x53, + 0x7a, 0x47, 0x72, 0x76, 0x49, 0x32, 0x52, 0x61, 0x4e, 0x67, 0x67, 0x44, + 0x68, 0x6f, 0x42, 0x0a, 0x34, 0x68, 0x70, 0x37, 0x54, 0x68, 0x64, 0x64, + 0x34, 0x6f, 0x71, 0x33, 0x50, 0x35, 0x6b, 0x61, 0x7a, 0x65, 0x74, 0x68, + 0x71, 0x38, 0x4a, 0x6c, 0x70, 0x68, 0x2b, 0x33, 0x74, 0x37, 0x32, 0x33, + 0x6a, 0x2f, 0x7a, 0x39, 0x63, 0x49, 0x38, 0x4c, 0x6f, 0x47, 0x65, 0x2b, + 0x41, 0x61, 0x4a, 0x5a, 0x7a, 0x33, 0x48, 0x6d, 0x44, 0x79, 0x6c, 0x32, + 0x2f, 0x37, 0x46, 0x57, 0x65, 0x55, 0x55, 0x72, 0x0a, 0x48, 0x35, 0x35, + 0x36, 0x56, 0x4f, 0x69, 0x6a, 0x4b, 0x54, 0x56, 0x6f, 0x70, 0x41, 0x46, + 0x50, 0x44, 0x36, 0x51, 0x75, 0x4e, 0x2b, 0x38, 0x62, 0x76, 0x2b, 0x4f, + 0x50, 0x45, 0x4b, 0x68, 0x79, 0x71, 0x31, 0x68, 0x58, 0x35, 0x31, 0x53, + 0x47, 0x79, 0x4d, 0x6e, 0x7a, 0x57, 0x39, 0x6f, 0x73, 0x32, 0x6c, 0x32, + 0x4f, 0x62, 0x6a, 0x79, 0x6a, 0x50, 0x74, 0x72, 0x37, 0x67, 0x75, 0x58, + 0x64, 0x0a, 0x38, 0x6c, 0x79, 0x79, 0x42, 0x54, 0x4e, 0x76, 0x69, 0x6a, + 0x62, 0x4f, 0x30, 0x42, 0x4e, 0x4f, 0x2f, 0x37, 0x39, 0x4b, 0x44, 0x44, + 0x52, 0x4d, 0x70, 0x73, 0x4d, 0x68, 0x76, 0x56, 0x41, 0x45, 0x56, 0x65, + 0x75, 0x78, 0x75, 0x35, 0x33, 0x37, 0x52, 0x52, 0x35, 0x6b, 0x46, 0x64, + 0x35, 0x56, 0x41, 0x59, 0x77, 0x43, 0x64, 0x72, 0x58, 0x4c, 0x6f, 0x54, + 0x39, 0x43, 0x61, 0x62, 0x77, 0x76, 0x0a, 0x76, 0x57, 0x68, 0x44, 0x46, + 0x6c, 0x61, 0x4a, 0x4b, 0x6a, 0x64, 0x68, 0x6b, 0x66, 0x32, 0x6d, 0x72, + 0x6b, 0x37, 0x41, 0x79, 0x78, 0x52, 0x6c, 0x6c, 0x44, 0x64, 0x4c, 0x6b, + 0x67, 0x62, 0x76, 0x42, 0x4e, 0x44, 0x49, 0x6e, 0x49, 0x6a, 0x62, 0x43, + 0x33, 0x75, 0x42, 0x72, 0x37, 0x45, 0x39, 0x4b, 0x73, 0x52, 0x6c, 0x4f, + 0x6e, 0x69, 0x32, 0x37, 0x74, 0x79, 0x41, 0x73, 0x64, 0x4c, 0x54, 0x0a, + 0x6d, 0x5a, 0x77, 0x36, 0x37, 0x6d, 0x74, 0x61, 0x61, 0x37, 0x4f, 0x4e, + 0x74, 0x39, 0x58, 0x4f, 0x6e, 0x4d, 0x4b, 0x2b, 0x70, 0x55, 0x73, 0x76, + 0x46, 0x72, 0x47, 0x65, 0x61, 0x44, 0x73, 0x47, 0x62, 0x36, 0x35, 0x39, + 0x6e, 0x2f, 0x6a, 0x65, 0x37, 0x4d, 0x77, 0x70, 0x70, 0x35, 0x69, 0x6a, + 0x4a, 0x55, 0x4d, 0x76, 0x37, 0x2f, 0x46, 0x66, 0x4a, 0x75, 0x47, 0x49, + 0x54, 0x66, 0x68, 0x65, 0x0a, 0x62, 0x74, 0x66, 0x5a, 0x46, 0x47, 0x34, + 0x5a, 0x4d, 0x32, 0x6d, 0x6e, 0x4f, 0x34, 0x53, 0x4a, 0x6b, 0x38, 0x52, + 0x54, 0x56, 0x52, 0x4f, 0x68, 0x55, 0x58, 0x68, 0x41, 0x2b, 0x4c, 0x6a, + 0x4a, 0x6f, 0x75, 0x35, 0x37, 0x75, 0x6c, 0x4a, 0x43, 0x67, 0x35, 0x34, + 0x55, 0x37, 0x51, 0x56, 0x53, 0x57, 0x6c, 0x6c, 0x57, 0x70, 0x35, 0x66, + 0x38, 0x6e, 0x54, 0x38, 0x4b, 0x4b, 0x64, 0x6a, 0x63, 0x0a, 0x54, 0x35, + 0x45, 0x4f, 0x45, 0x37, 0x7a, 0x65, 0x6c, 0x61, 0x54, 0x66, 0x69, 0x35, + 0x6d, 0x2b, 0x72, 0x4a, 0x73, 0x7a, 0x69, 0x4f, 0x2b, 0x31, 0x67, 0x61, + 0x38, 0x62, 0x78, 0x69, 0x4a, 0x54, 0x79, 0x50, 0x62, 0x48, 0x37, 0x70, + 0x63, 0x55, 0x73, 0x4d, 0x56, 0x38, 0x65, 0x46, 0x4c, 0x49, 0x38, 0x4d, + 0x35, 0x75, 0x64, 0x32, 0x43, 0x45, 0x70, 0x75, 0x6b, 0x71, 0x64, 0x69, + 0x44, 0x74, 0x0a, 0x57, 0x41, 0x45, 0x58, 0x4d, 0x4a, 0x50, 0x70, 0x47, + 0x6f, 0x76, 0x67, 0x63, 0x32, 0x50, 0x5a, 0x61, 0x70, 0x4b, 0x55, 0x53, + 0x55, 0x36, 0x30, 0x72, 0x55, 0x71, 0x46, 0x78, 0x4b, 0x4d, 0x69, 0x4d, + 0x50, 0x77, 0x4a, 0x37, 0x57, 0x67, 0x69, 0x63, 0x36, 0x61, 0x49, 0x44, + 0x46, 0x55, 0x68, 0x57, 0x4d, 0x58, 0x68, 0x4f, 0x70, 0x38, 0x71, 0x33, + 0x63, 0x72, 0x68, 0x6b, 0x4f, 0x44, 0x5a, 0x0a, 0x63, 0x36, 0x74, 0x73, + 0x67, 0x4c, 0x6a, 0x6f, 0x43, 0x32, 0x53, 0x54, 0x6f, 0x4a, 0x79, 0x4d, + 0x47, 0x66, 0x2b, 0x7a, 0x30, 0x67, 0x7a, 0x73, 0x6b, 0x53, 0x61, 0x48, + 0x69, 0x72, 0x4f, 0x69, 0x34, 0x58, 0x43, 0x50, 0x4c, 0x41, 0x72, 0x6c, + 0x7a, 0x57, 0x31, 0x6f, 0x55, 0x65, 0x76, 0x61, 0x50, 0x77, 0x56, 0x2f, + 0x69, 0x7a, 0x4c, 0x6d, 0x45, 0x31, 0x78, 0x72, 0x2f, 0x6c, 0x39, 0x41, + 0x0a, 0x34, 0x69, 0x4c, 0x49, 0x74, 0x4c, 0x52, 0x6b, 0x54, 0x39, 0x61, + 0x36, 0x66, 0x55, 0x67, 0x2b, 0x71, 0x47, 0x6b, 0x4d, 0x31, 0x37, 0x75, + 0x47, 0x63, 0x63, 0x6c, 0x7a, 0x75, 0x44, 0x38, 0x37, 0x6e, 0x53, 0x56, + 0x4c, 0x32, 0x76, 0x39, 0x41, 0x36, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, + 0x42, 0x6f, 0x34, 0x49, 0x42, 0x6c, 0x54, 0x43, 0x43, 0x41, 0x5a, 0x45, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x43, 0x42, 0x34, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x67, 0x42, 0x49, + 0x48, 0x5a, 0x4d, 0x49, 0x48, 0x57, 0x4d, 0x49, 0x48, 0x54, 0x42, 0x67, + 0x6b, 0x72, 0x42, 0x67, 0x45, 0x45, 0x41, 0x62, 0x35, 0x59, 0x41, 0x41, + 0x4d, 0x77, 0x67, 0x63, 0x55, 0x77, 0x67, 0x5a, 0x4d, 0x47, 0x0a, 0x43, + 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x49, 0x43, 0x4d, + 0x49, 0x47, 0x47, 0x47, 0x6f, 0x47, 0x44, 0x51, 0x57, 0x35, 0x35, 0x49, + 0x48, 0x56, 0x7a, 0x5a, 0x53, 0x42, 0x76, 0x5a, 0x69, 0x42, 0x30, 0x61, + 0x47, 0x6c, 0x7a, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, + 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, 0x49, 0x47, 0x4e, 0x76, 0x62, + 0x6e, 0x4e, 0x30, 0x0a, 0x61, 0x58, 0x52, 0x31, 0x64, 0x47, 0x56, 0x7a, + 0x49, 0x47, 0x46, 0x6a, 0x59, 0x32, 0x56, 0x77, 0x64, 0x47, 0x46, 0x75, + 0x59, 0x32, 0x55, 0x67, 0x62, 0x32, 0x59, 0x67, 0x64, 0x47, 0x68, 0x6c, + 0x49, 0x46, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, 0x6c, 0x7a, + 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, + 0x4d, 0x79, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x0a, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x5a, 0x53, 0x42, 0x51, 0x62, 0x32, 0x78, + 0x70, 0x59, 0x33, 0x6b, 0x67, 0x4c, 0x79, 0x42, 0x44, 0x5a, 0x58, 0x4a, + 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, + 0x75, 0x49, 0x46, 0x42, 0x79, 0x59, 0x57, 0x4e, 0x30, 0x61, 0x57, 0x4e, + 0x6c, 0x49, 0x46, 0x4e, 0x30, 0x59, 0x58, 0x52, 0x6c, 0x62, 0x57, 0x56, + 0x75, 0x0a, 0x64, 0x43, 0x34, 0x77, 0x4c, 0x51, 0x59, 0x49, 0x4b, 0x77, + 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x67, 0x45, 0x57, 0x49, 0x57, + 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, 0x4c, 0x79, 0x39, 0x33, 0x64, 0x33, + 0x63, 0x75, 0x63, 0x58, 0x56, 0x76, 0x64, 0x6d, 0x46, 0x6b, 0x61, 0x58, + 0x4e, 0x6e, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x75, 0x59, 0x32, + 0x39, 0x74, 0x4c, 0x32, 0x4e, 0x77, 0x0a, 0x63, 0x7a, 0x41, 0x4c, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, + 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, + 0x42, 0x59, 0x45, 0x46, 0x50, 0x4c, 0x41, 0x45, 0x2b, 0x43, 0x43, 0x51, + 0x7a, 0x37, 0x37, 0x37, 0x69, 0x39, 0x6e, 0x4d, 0x70, 0x59, 0x31, 0x58, + 0x4e, 0x75, 0x34, 0x79, 0x77, 0x4c, 0x51, 0x4d, 0x47, 0x34, 0x47, 0x0a, + 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, 0x52, 0x6e, 0x4d, 0x47, 0x57, 0x41, + 0x46, 0x50, 0x4c, 0x41, 0x45, 0x2b, 0x43, 0x43, 0x51, 0x7a, 0x37, 0x37, + 0x37, 0x69, 0x39, 0x6e, 0x4d, 0x70, 0x59, 0x31, 0x58, 0x4e, 0x75, 0x34, + 0x79, 0x77, 0x4c, 0x51, 0x6f, 0x55, 0x6d, 0x6b, 0x52, 0x7a, 0x42, 0x46, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x43, 0x0a, 0x54, 0x54, 0x45, 0x5a, 0x4d, 0x42, 0x63, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x51, 0x55, 0x58, 0x56, + 0x76, 0x56, 0x6d, 0x46, 0x6b, 0x61, 0x58, 0x4d, 0x67, 0x54, 0x47, 0x6c, + 0x74, 0x61, 0x58, 0x52, 0x6c, 0x5a, 0x44, 0x45, 0x62, 0x4d, 0x42, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x53, 0x55, 0x58, 0x56, + 0x76, 0x56, 0x6d, 0x46, 0x6b, 0x61, 0x58, 0x4d, 0x67, 0x0a, 0x55, 0x6d, + 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x7a, 0x67, 0x67, + 0x49, 0x46, 0x78, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, + 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x54, 0x36, 0x32, 0x67, 0x4c, 0x45, + 0x7a, 0x36, 0x77, 0x50, 0x4a, 0x76, 0x39, 0x32, 0x5a, 0x56, 0x71, 0x79, + 0x4d, 0x30, 0x0a, 0x37, 0x75, 0x63, 0x70, 0x32, 0x73, 0x4e, 0x62, 0x74, + 0x72, 0x43, 0x44, 0x32, 0x64, 0x44, 0x51, 0x34, 0x69, 0x48, 0x37, 0x38, + 0x32, 0x43, 0x6e, 0x4f, 0x31, 0x31, 0x67, 0x55, 0x79, 0x65, 0x69, 0x6d, + 0x2f, 0x59, 0x49, 0x49, 0x69, 0x72, 0x6e, 0x76, 0x36, 0x42, 0x79, 0x35, + 0x5a, 0x77, 0x6b, 0x61, 0x6a, 0x47, 0x78, 0x6b, 0x48, 0x6f, 0x6e, 0x32, + 0x34, 0x51, 0x52, 0x69, 0x53, 0x65, 0x6d, 0x0a, 0x64, 0x31, 0x6f, 0x34, + 0x31, 0x37, 0x2b, 0x73, 0x68, 0x76, 0x7a, 0x75, 0x58, 0x59, 0x4f, 0x38, + 0x42, 0x73, 0x62, 0x52, 0x64, 0x32, 0x73, 0x50, 0x62, 0x53, 0x51, 0x76, + 0x53, 0x33, 0x70, 0x73, 0x70, 0x77, 0x65, 0x57, 0x79, 0x75, 0x4f, 0x45, + 0x6e, 0x36, 0x32, 0x49, 0x69, 0x78, 0x32, 0x72, 0x46, 0x6f, 0x31, 0x62, + 0x5a, 0x68, 0x66, 0x5a, 0x46, 0x76, 0x53, 0x4c, 0x67, 0x4e, 0x4c, 0x64, + 0x0a, 0x2b, 0x4c, 0x4a, 0x32, 0x77, 0x2f, 0x77, 0x34, 0x45, 0x36, 0x6f, + 0x4d, 0x33, 0x6b, 0x4a, 0x70, 0x4b, 0x32, 0x37, 0x7a, 0x50, 0x4f, 0x75, + 0x41, 0x4a, 0x39, 0x76, 0x31, 0x70, 0x6b, 0x51, 0x4e, 0x6e, 0x31, 0x70, + 0x56, 0x57, 0x51, 0x76, 0x56, 0x44, 0x56, 0x4a, 0x49, 0x78, 0x61, 0x36, + 0x66, 0x38, 0x69, 0x2b, 0x41, 0x78, 0x65, 0x6f, 0x79, 0x55, 0x44, 0x55, + 0x53, 0x6c, 0x79, 0x37, 0x42, 0x0a, 0x34, 0x66, 0x2f, 0x78, 0x49, 0x34, + 0x68, 0x52, 0x4f, 0x4a, 0x2f, 0x79, 0x5a, 0x6c, 0x5a, 0x32, 0x35, 0x77, + 0x39, 0x52, 0x6c, 0x36, 0x56, 0x53, 0x44, 0x45, 0x31, 0x4a, 0x55, 0x5a, + 0x55, 0x32, 0x50, 0x62, 0x2b, 0x69, 0x53, 0x77, 0x77, 0x51, 0x48, 0x59, + 0x61, 0x5a, 0x54, 0x4b, 0x72, 0x7a, 0x63, 0x68, 0x47, 0x54, 0x35, 0x4f, + 0x72, 0x32, 0x6d, 0x39, 0x71, 0x6f, 0x58, 0x61, 0x64, 0x4e, 0x0a, 0x74, + 0x35, 0x34, 0x43, 0x72, 0x6e, 0x4d, 0x41, 0x79, 0x4e, 0x6f, 0x6a, 0x41, + 0x2b, 0x6a, 0x35, 0x36, 0x68, 0x6c, 0x30, 0x59, 0x67, 0x43, 0x55, 0x79, + 0x79, 0x49, 0x67, 0x76, 0x70, 0x53, 0x6e, 0x57, 0x62, 0x57, 0x43, 0x61, + 0x72, 0x36, 0x5a, 0x65, 0x58, 0x71, 0x70, 0x38, 0x6b, 0x6f, 0x6b, 0x55, + 0x76, 0x64, 0x30, 0x2f, 0x62, 0x70, 0x4f, 0x35, 0x71, 0x67, 0x64, 0x41, + 0x6d, 0x36, 0x78, 0x0a, 0x44, 0x59, 0x42, 0x45, 0x77, 0x61, 0x37, 0x54, + 0x49, 0x7a, 0x64, 0x66, 0x75, 0x34, 0x56, 0x38, 0x4b, 0x35, 0x49, 0x75, + 0x36, 0x48, 0x36, 0x6c, 0x69, 0x39, 0x32, 0x5a, 0x34, 0x62, 0x38, 0x6e, + 0x62, 0x79, 0x31, 0x64, 0x71, 0x6e, 0x75, 0x48, 0x2f, 0x67, 0x72, 0x64, + 0x53, 0x2f, 0x79, 0x4f, 0x39, 0x53, 0x62, 0x6b, 0x62, 0x6e, 0x42, 0x43, + 0x62, 0x6a, 0x50, 0x73, 0x4d, 0x5a, 0x35, 0x37, 0x0a, 0x6b, 0x38, 0x48, + 0x6b, 0x79, 0x57, 0x6b, 0x61, 0x50, 0x63, 0x42, 0x72, 0x54, 0x69, 0x4a, + 0x74, 0x37, 0x71, 0x74, 0x59, 0x54, 0x63, 0x62, 0x51, 0x51, 0x63, 0x45, + 0x72, 0x36, 0x6b, 0x38, 0x53, 0x68, 0x31, 0x37, 0x72, 0x52, 0x64, 0x68, + 0x73, 0x39, 0x5a, 0x67, 0x43, 0x30, 0x36, 0x44, 0x59, 0x56, 0x59, 0x6f, + 0x47, 0x6d, 0x52, 0x6d, 0x69, 0x6f, 0x48, 0x66, 0x52, 0x4d, 0x4a, 0x36, + 0x73, 0x0a, 0x7a, 0x48, 0x58, 0x75, 0x67, 0x2f, 0x57, 0x77, 0x59, 0x6a, + 0x6e, 0x50, 0x62, 0x46, 0x66, 0x69, 0x54, 0x4e, 0x4b, 0x52, 0x43, 0x77, + 0x35, 0x31, 0x4b, 0x42, 0x75, 0x61, 0x76, 0x2f, 0x30, 0x61, 0x51, 0x2f, + 0x48, 0x4b, 0x64, 0x2f, 0x73, 0x37, 0x6a, 0x32, 0x47, 0x34, 0x61, 0x53, + 0x67, 0x57, 0x51, 0x67, 0x52, 0x65, 0x63, 0x43, 0x6f, 0x63, 0x49, 0x64, + 0x69, 0x50, 0x34, 0x62, 0x30, 0x6a, 0x0a, 0x57, 0x79, 0x31, 0x30, 0x51, + 0x4a, 0x4c, 0x5a, 0x59, 0x78, 0x6b, 0x4e, 0x63, 0x39, 0x31, 0x70, 0x76, + 0x47, 0x4a, 0x48, 0x76, 0x4f, 0x42, 0x30, 0x4b, 0x37, 0x4c, 0x72, 0x66, + 0x62, 0x35, 0x42, 0x47, 0x37, 0x58, 0x41, 0x52, 0x73, 0x57, 0x68, 0x49, + 0x73, 0x74, 0x66, 0x54, 0x73, 0x45, 0x6f, 0x6b, 0x74, 0x34, 0x59, 0x75, + 0x74, 0x55, 0x71, 0x4b, 0x4c, 0x73, 0x52, 0x69, 0x78, 0x65, 0x54, 0x0a, + 0x6d, 0x4a, 0x6c, 0x67, 0x6c, 0x46, 0x77, 0x6a, 0x7a, 0x31, 0x6f, 0x6e, + 0x6c, 0x31, 0x34, 0x4c, 0x42, 0x51, 0x61, 0x54, 0x4e, 0x78, 0x34, 0x37, + 0x61, 0x54, 0x62, 0x72, 0x71, 0x5a, 0x35, 0x68, 0x48, 0x59, 0x38, 0x79, + 0x32, 0x6f, 0x34, 0x4d, 0x31, 0x6e, 0x51, 0x2b, 0x65, 0x77, 0x6b, 0x6b, + 0x32, 0x67, 0x46, 0x33, 0x52, 0x38, 0x51, 0x37, 0x7a, 0x54, 0x53, 0x4d, + 0x6d, 0x66, 0x58, 0x4b, 0x0a, 0x34, 0x53, 0x56, 0x68, 0x4d, 0x37, 0x4a, + 0x5a, 0x47, 0x2b, 0x4a, 0x75, 0x31, 0x7a, 0x64, 0x58, 0x74, 0x67, 0x32, + 0x70, 0x45, 0x74, 0x6f, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x4f, 0x3d, 0x53, 0x45, 0x43, + 0x4f, 0x4d, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, + 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x31, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x4f, 0x3d, + 0x53, 0x45, 0x43, 0x4f, 0x4d, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x2e, + 0x6e, 0x65, 0x74, 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, + 0x31, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x6f, 0x6d, + 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x66, 0x31, 0x3a, 0x62, 0x63, 0x3a, 0x36, 0x33, 0x3a, + 0x36, 0x61, 0x3a, 0x35, 0x34, 0x3a, 0x65, 0x30, 0x3a, 0x62, 0x35, 0x3a, + 0x32, 0x37, 0x3a, 0x66, 0x35, 0x3a, 0x63, 0x64, 0x3a, 0x65, 0x37, 0x3a, + 0x31, 0x61, 0x3a, 0x65, 0x33, 0x3a, 0x34, 0x64, 0x3a, 0x36, 0x65, 0x3a, + 0x34, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, + 0x36, 0x3a, 0x62, 0x31, 0x3a, 0x32, 0x62, 0x3a, 0x34, 0x39, 0x3a, 0x66, + 0x39, 0x3a, 0x38, 0x31, 0x3a, 0x39, 0x65, 0x3a, 0x64, 0x37, 0x3a, 0x34, + 0x63, 0x3a, 0x39, 0x65, 0x3a, 0x62, 0x63, 0x3a, 0x33, 0x38, 0x3a, 0x30, + 0x66, 0x3a, 0x63, 0x36, 0x3a, 0x35, 0x36, 0x3a, 0x38, 0x66, 0x3a, 0x35, + 0x64, 0x3a, 0x61, 0x63, 0x3a, 0x62, 0x32, 0x3a, 0x66, 0x37, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x37, 0x3a, + 0x35, 0x65, 0x3a, 0x37, 0x32, 0x3a, 0x65, 0x64, 0x3a, 0x39, 0x66, 0x3a, + 0x35, 0x36, 0x3a, 0x30, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x36, 0x65, 0x3a, + 0x62, 0x34, 0x3a, 0x38, 0x30, 0x3a, 0x30, 0x30, 0x3a, 0x37, 0x33, 0x3a, + 0x61, 0x34, 0x3a, 0x33, 0x66, 0x3a, 0x63, 0x33, 0x3a, 0x61, 0x64, 0x3a, + 0x31, 0x39, 0x3a, 0x31, 0x39, 0x3a, 0x35, 0x61, 0x3a, 0x33, 0x39, 0x3a, + 0x32, 0x32, 0x3a, 0x38, 0x32, 0x3a, 0x30, 0x31, 0x3a, 0x37, 0x38, 0x3a, + 0x39, 0x35, 0x3a, 0x39, 0x37, 0x3a, 0x34, 0x61, 0x3a, 0x39, 0x39, 0x3a, + 0x30, 0x32, 0x3a, 0x36, 0x62, 0x3a, 0x36, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x57, 0x6a, 0x43, 0x43, 0x41, 0x6b, 0x4b, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x51, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x4b, 0x55, 0x44, 0x45, 0x59, 0x0a, 0x4d, 0x42, 0x59, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x68, 0x4d, 0x50, 0x55, 0x30, 0x56, 0x44, 0x54, 0x30, + 0x30, 0x67, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, 0x6d, + 0x56, 0x30, 0x4d, 0x53, 0x63, 0x77, 0x4a, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x78, 0x35, 0x54, 0x5a, 0x57, 0x4e, 0x31, 0x63, 0x6d, + 0x6c, 0x30, 0x65, 0x53, 0x42, 0x44, 0x62, 0x32, 0x31, 0x74, 0x0a, 0x64, + 0x57, 0x35, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, + 0x46, 0x4a, 0x76, 0x62, 0x33, 0x52, 0x44, 0x51, 0x54, 0x45, 0x77, 0x48, + 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x4d, 0x77, 0x4f, 0x54, 0x4d, 0x77, 0x4d, + 0x44, 0x51, 0x79, 0x4d, 0x44, 0x51, 0x35, 0x57, 0x68, 0x63, 0x4e, 0x4d, + 0x6a, 0x4d, 0x77, 0x4f, 0x54, 0x4d, 0x77, 0x4d, 0x44, 0x51, 0x79, 0x4d, + 0x44, 0x51, 0x35, 0x0a, 0x57, 0x6a, 0x42, 0x51, 0x4d, 0x51, 0x73, 0x77, + 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4b, + 0x55, 0x44, 0x45, 0x59, 0x4d, 0x42, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x68, 0x4d, 0x50, 0x55, 0x30, 0x56, 0x44, 0x54, 0x30, 0x30, 0x67, + 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, 0x6d, 0x56, 0x30, + 0x4d, 0x53, 0x63, 0x77, 0x4a, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x78, 0x35, 0x54, 0x5a, 0x57, 0x4e, 0x31, 0x63, 0x6d, 0x6c, + 0x30, 0x65, 0x53, 0x42, 0x44, 0x62, 0x32, 0x31, 0x74, 0x64, 0x57, 0x35, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x46, 0x4a, + 0x76, 0x62, 0x33, 0x52, 0x44, 0x51, 0x54, 0x45, 0x77, 0x67, 0x67, 0x45, + 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x0a, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, + 0x49, 0x42, 0x41, 0x51, 0x43, 0x7a, 0x73, 0x2f, 0x35, 0x2f, 0x30, 0x32, + 0x32, 0x78, 0x37, 0x78, 0x5a, 0x38, 0x56, 0x36, 0x55, 0x4d, 0x62, 0x58, + 0x61, 0x4b, 0x4c, 0x30, 0x75, 0x2f, 0x5a, 0x50, 0x74, 0x4d, 0x37, 0x6f, + 0x72, 0x77, 0x38, 0x79, 0x6c, 0x38, 0x0a, 0x39, 0x66, 0x2f, 0x75, 0x4b, + 0x75, 0x44, 0x70, 0x36, 0x62, 0x70, 0x62, 0x5a, 0x43, 0x4b, 0x61, 0x6d, + 0x6d, 0x38, 0x73, 0x4f, 0x69, 0x5a, 0x70, 0x55, 0x51, 0x57, 0x5a, 0x4a, + 0x74, 0x7a, 0x56, 0x48, 0x47, 0x70, 0x78, 0x78, 0x70, 0x70, 0x39, 0x48, + 0x70, 0x33, 0x64, 0x66, 0x47, 0x7a, 0x47, 0x6a, 0x47, 0x64, 0x6e, 0x53, + 0x6a, 0x37, 0x34, 0x63, 0x62, 0x41, 0x5a, 0x4a, 0x36, 0x6b, 0x4a, 0x0a, + 0x44, 0x4b, 0x61, 0x56, 0x76, 0x30, 0x75, 0x4d, 0x44, 0x50, 0x70, 0x56, + 0x6d, 0x44, 0x76, 0x59, 0x36, 0x43, 0x4b, 0x68, 0x53, 0x33, 0x45, 0x34, + 0x65, 0x61, 0x79, 0x58, 0x6b, 0x6d, 0x6d, 0x7a, 0x69, 0x58, 0x37, 0x71, + 0x49, 0x57, 0x67, 0x47, 0x6d, 0x42, 0x53, 0x57, 0x68, 0x39, 0x4a, 0x68, + 0x4e, 0x72, 0x78, 0x74, 0x4a, 0x31, 0x61, 0x65, 0x56, 0x2b, 0x37, 0x41, + 0x77, 0x46, 0x62, 0x39, 0x0a, 0x4d, 0x73, 0x2b, 0x6b, 0x32, 0x59, 0x37, + 0x43, 0x49, 0x39, 0x65, 0x4e, 0x71, 0x50, 0x50, 0x59, 0x4a, 0x61, 0x79, + 0x58, 0x35, 0x48, 0x41, 0x34, 0x39, 0x4c, 0x59, 0x36, 0x74, 0x4a, 0x30, + 0x37, 0x6c, 0x79, 0x5a, 0x44, 0x6f, 0x36, 0x47, 0x38, 0x53, 0x56, 0x6c, + 0x79, 0x54, 0x43, 0x4d, 0x77, 0x68, 0x77, 0x46, 0x59, 0x39, 0x6b, 0x36, + 0x2b, 0x48, 0x47, 0x68, 0x57, 0x5a, 0x71, 0x2f, 0x4e, 0x0a, 0x51, 0x56, + 0x33, 0x49, 0x73, 0x30, 0x30, 0x71, 0x56, 0x55, 0x61, 0x72, 0x48, 0x39, + 0x6f, 0x65, 0x34, 0x6b, 0x41, 0x39, 0x32, 0x38, 0x31, 0x39, 0x75, 0x5a, + 0x4b, 0x41, 0x6e, 0x44, 0x66, 0x64, 0x44, 0x4a, 0x5a, 0x6b, 0x6e, 0x64, + 0x77, 0x69, 0x39, 0x32, 0x53, 0x4c, 0x33, 0x32, 0x48, 0x65, 0x46, 0x5a, + 0x52, 0x53, 0x46, 0x61, 0x42, 0x39, 0x55, 0x73, 0x6c, 0x4c, 0x71, 0x43, + 0x48, 0x4a, 0x0a, 0x78, 0x72, 0x48, 0x74, 0x79, 0x38, 0x4f, 0x56, 0x59, + 0x4e, 0x45, 0x50, 0x38, 0x4b, 0x74, 0x77, 0x2b, 0x4e, 0x2f, 0x4c, 0x54, + 0x58, 0x37, 0x73, 0x31, 0x76, 0x71, 0x72, 0x32, 0x62, 0x31, 0x2f, 0x56, + 0x50, 0x4b, 0x6c, 0x36, 0x58, 0x6e, 0x36, 0x32, 0x64, 0x5a, 0x32, 0x4a, + 0x43, 0x68, 0x7a, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x50, + 0x7a, 0x41, 0x39, 0x4d, 0x42, 0x30, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x64, + 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, 0x67, 0x63, 0x30, 0x6d, 0x5a, + 0x61, 0x4e, 0x79, 0x46, 0x57, 0x32, 0x58, 0x6a, 0x6d, 0x79, 0x67, 0x76, + 0x56, 0x35, 0x2b, 0x39, 0x4d, 0x37, 0x77, 0x48, 0x53, 0x44, 0x41, 0x4c, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, + 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, + 0x0a, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, + 0x42, 0x2f, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, + 0x43, 0x41, 0x51, 0x45, 0x41, 0x61, 0x45, 0x43, 0x70, 0x71, 0x4c, 0x76, + 0x6b, 0x54, 0x31, 0x31, 0x35, 0x73, 0x77, 0x57, 0x31, 0x46, 0x37, 0x4e, + 0x67, 0x45, 0x2b, 0x76, 0x47, 0x0a, 0x6b, 0x6c, 0x33, 0x67, 0x30, 0x64, + 0x4e, 0x71, 0x2f, 0x76, 0x75, 0x2b, 0x6d, 0x32, 0x32, 0x2f, 0x78, 0x77, + 0x56, 0x74, 0x57, 0x53, 0x44, 0x45, 0x48, 0x50, 0x43, 0x33, 0x32, 0x6f, + 0x52, 0x59, 0x41, 0x6d, 0x50, 0x36, 0x53, 0x42, 0x62, 0x76, 0x54, 0x36, + 0x55, 0x4c, 0x39, 0x30, 0x71, 0x59, 0x38, 0x6a, 0x2b, 0x65, 0x47, 0x36, + 0x31, 0x48, 0x61, 0x32, 0x50, 0x4f, 0x43, 0x45, 0x66, 0x72, 0x0a, 0x55, + 0x6a, 0x39, 0x34, 0x6e, 0x4b, 0x39, 0x4e, 0x72, 0x76, 0x6a, 0x56, 0x54, + 0x38, 0x2b, 0x61, 0x6d, 0x43, 0x6f, 0x51, 0x51, 0x54, 0x6c, 0x53, 0x78, + 0x4e, 0x33, 0x5a, 0x6d, 0x77, 0x37, 0x76, 0x6b, 0x77, 0x47, 0x75, 0x73, + 0x69, 0x37, 0x4b, 0x61, 0x45, 0x49, 0x6b, 0x51, 0x6d, 0x79, 0x77, 0x73, + 0x7a, 0x6f, 0x2b, 0x7a, 0x65, 0x6e, 0x61, 0x53, 0x4d, 0x51, 0x56, 0x79, + 0x2b, 0x6e, 0x35, 0x0a, 0x42, 0x77, 0x2b, 0x53, 0x55, 0x45, 0x6d, 0x4b, + 0x33, 0x54, 0x47, 0x58, 0x58, 0x38, 0x6e, 0x70, 0x4e, 0x36, 0x6f, 0x37, + 0x57, 0x57, 0x57, 0x58, 0x6c, 0x44, 0x4c, 0x4a, 0x73, 0x35, 0x38, 0x2b, + 0x4f, 0x6d, 0x4a, 0x59, 0x78, 0x55, 0x6d, 0x74, 0x59, 0x67, 0x35, 0x78, + 0x70, 0x54, 0x4b, 0x71, 0x4c, 0x38, 0x61, 0x4a, 0x64, 0x6b, 0x4e, 0x41, + 0x45, 0x78, 0x4e, 0x6e, 0x50, 0x61, 0x4a, 0x55, 0x0a, 0x4a, 0x52, 0x44, + 0x4c, 0x38, 0x54, 0x72, 0x79, 0x32, 0x66, 0x72, 0x62, 0x53, 0x56, 0x61, + 0x37, 0x70, 0x76, 0x36, 0x6e, 0x51, 0x54, 0x58, 0x44, 0x34, 0x49, 0x68, + 0x68, 0x79, 0x59, 0x6a, 0x48, 0x33, 0x7a, 0x59, 0x51, 0x49, 0x70, 0x68, + 0x5a, 0x36, 0x72, 0x42, 0x4b, 0x2b, 0x31, 0x59, 0x57, 0x63, 0x32, 0x36, + 0x73, 0x54, 0x66, 0x63, 0x69, 0x6f, 0x55, 0x2b, 0x74, 0x48, 0x58, 0x6f, + 0x74, 0x0a, 0x52, 0x53, 0x66, 0x6c, 0x4d, 0x4d, 0x46, 0x65, 0x38, 0x74, + 0x6f, 0x54, 0x79, 0x79, 0x56, 0x43, 0x55, 0x5a, 0x56, 0x48, 0x41, 0x34, + 0x78, 0x73, 0x49, 0x63, 0x78, 0x30, 0x51, 0x75, 0x31, 0x54, 0x2f, 0x7a, + 0x4f, 0x4c, 0x6a, 0x77, 0x39, 0x58, 0x41, 0x52, 0x59, 0x76, 0x7a, 0x36, + 0x62, 0x75, 0x79, 0x58, 0x41, 0x69, 0x46, 0x4c, 0x33, 0x39, 0x76, 0x6d, + 0x77, 0x4c, 0x41, 0x77, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, + 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x32, + 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x32, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x6f, + 0x6e, 0x65, 0x72, 0x61, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x32, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, + 0x33, 0x3a, 0x65, 0x63, 0x3a, 0x37, 0x35, 0x3a, 0x30, 0x66, 0x3a, 0x32, + 0x65, 0x3a, 0x38, 0x38, 0x3a, 0x64, 0x66, 0x3a, 0x66, 0x61, 0x3a, 0x34, + 0x38, 0x3a, 0x30, 0x31, 0x3a, 0x34, 0x65, 0x3a, 0x30, 0x62, 0x3a, 0x35, + 0x63, 0x3a, 0x34, 0x38, 0x3a, 0x36, 0x66, 0x3a, 0x66, 0x62, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x37, 0x3a, 0x66, 0x37, + 0x3a, 0x36, 0x64, 0x3a, 0x65, 0x36, 0x3a, 0x30, 0x37, 0x3a, 0x37, 0x63, + 0x3a, 0x39, 0x30, 0x3a, 0x63, 0x35, 0x3a, 0x62, 0x31, 0x3a, 0x33, 0x65, + 0x3a, 0x39, 0x33, 0x3a, 0x31, 0x61, 0x3a, 0x62, 0x37, 0x3a, 0x34, 0x31, + 0x3a, 0x31, 0x30, 0x3a, 0x62, 0x34, 0x3a, 0x66, 0x32, 0x3a, 0x65, 0x34, + 0x3a, 0x39, 0x61, 0x3a, 0x32, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x39, 0x3a, 0x30, 0x38, 0x3a, 0x62, + 0x34, 0x3a, 0x30, 0x33, 0x3a, 0x31, 0x34, 0x3a, 0x63, 0x31, 0x3a, 0x33, + 0x38, 0x3a, 0x31, 0x30, 0x3a, 0x30, 0x62, 0x3a, 0x35, 0x31, 0x3a, 0x38, + 0x64, 0x3a, 0x30, 0x37, 0x3a, 0x33, 0x35, 0x3a, 0x38, 0x30, 0x3a, 0x37, + 0x66, 0x3a, 0x66, 0x62, 0x3a, 0x66, 0x63, 0x3a, 0x66, 0x38, 0x3a, 0x35, + 0x31, 0x3a, 0x38, 0x61, 0x3a, 0x30, 0x30, 0x3a, 0x39, 0x35, 0x3a, 0x33, + 0x33, 0x3a, 0x37, 0x31, 0x3a, 0x30, 0x35, 0x3a, 0x62, 0x61, 0x3a, 0x33, + 0x38, 0x3a, 0x36, 0x62, 0x3a, 0x31, 0x35, 0x3a, 0x33, 0x64, 0x3a, 0x64, + 0x39, 0x3a, 0x32, 0x37, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x44, 0x49, 0x44, 0x43, 0x43, 0x41, 0x67, 0x69, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x42, 0x48, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, + 0x46, 0x41, 0x44, 0x41, 0x35, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x47, 0x53, 0x54, 0x45, + 0x50, 0x0a, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, + 0x4d, 0x47, 0x55, 0x32, 0x39, 0x75, 0x5a, 0x58, 0x4a, 0x68, 0x4d, 0x52, + 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, + 0x42, 0x54, 0x62, 0x32, 0x35, 0x6c, 0x63, 0x6d, 0x45, 0x67, 0x51, 0x32, + 0x78, 0x68, 0x63, 0x33, 0x4d, 0x79, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, + 0x34, 0x58, 0x44, 0x54, 0x41, 0x78, 0x0a, 0x4d, 0x44, 0x51, 0x77, 0x4e, + 0x6a, 0x41, 0x33, 0x4d, 0x6a, 0x6b, 0x30, 0x4d, 0x46, 0x6f, 0x58, 0x44, + 0x54, 0x49, 0x78, 0x4d, 0x44, 0x51, 0x77, 0x4e, 0x6a, 0x41, 0x33, 0x4d, + 0x6a, 0x6b, 0x30, 0x4d, 0x46, 0x6f, 0x77, 0x4f, 0x54, 0x45, 0x4c, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, + 0x6b, 0x6b, 0x78, 0x44, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x4e, 0x56, 0x0a, + 0x42, 0x41, 0x6f, 0x54, 0x42, 0x6c, 0x4e, 0x76, 0x62, 0x6d, 0x56, 0x79, + 0x59, 0x54, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x41, 0x78, 0x4d, 0x51, 0x55, 0x32, 0x39, 0x75, 0x5a, 0x58, 0x4a, 0x68, + 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x4d, 0x69, 0x42, 0x44, + 0x51, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, + 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4a, 0x41, + 0x58, 0x53, 0x6a, 0x57, 0x64, 0x79, 0x76, 0x41, 0x4e, 0x6c, 0x73, 0x64, + 0x45, 0x2b, 0x68, 0x59, 0x33, 0x2f, 0x45, 0x69, 0x39, 0x76, 0x58, 0x2b, + 0x41, 0x4c, 0x54, 0x55, 0x37, 0x34, 0x57, 0x2b, 0x6f, 0x0a, 0x5a, 0x36, + 0x6d, 0x2f, 0x41, 0x78, 0x78, 0x4e, 0x6a, 0x47, 0x38, 0x79, 0x52, 0x39, + 0x56, 0x42, 0x61, 0x4b, 0x51, 0x54, 0x42, 0x4d, 0x45, 0x31, 0x44, 0x4a, + 0x71, 0x45, 0x51, 0x2f, 0x78, 0x63, 0x48, 0x66, 0x2b, 0x4a, 0x73, 0x2b, + 0x67, 0x58, 0x47, 0x4d, 0x32, 0x52, 0x58, 0x2f, 0x75, 0x4a, 0x34, 0x2b, + 0x71, 0x2f, 0x54, 0x6c, 0x31, 0x38, 0x47, 0x79, 0x62, 0x54, 0x64, 0x58, + 0x6e, 0x74, 0x0a, 0x35, 0x6f, 0x54, 0x6a, 0x56, 0x2b, 0x57, 0x74, 0x4b, + 0x63, 0x54, 0x30, 0x4f, 0x69, 0x6a, 0x6e, 0x70, 0x58, 0x75, 0x45, 0x4e, + 0x6d, 0x6d, 0x7a, 0x2f, 0x56, 0x35, 0x32, 0x76, 0x61, 0x4d, 0x74, 0x6d, + 0x64, 0x4f, 0x51, 0x54, 0x69, 0x4d, 0x6f, 0x66, 0x52, 0x68, 0x6a, 0x38, + 0x56, 0x51, 0x37, 0x4a, 0x70, 0x31, 0x32, 0x57, 0x35, 0x64, 0x43, 0x73, + 0x76, 0x2b, 0x75, 0x38, 0x45, 0x37, 0x73, 0x0a, 0x33, 0x54, 0x6d, 0x56, + 0x54, 0x6f, 0x4d, 0x47, 0x66, 0x2b, 0x64, 0x4a, 0x51, 0x4d, 0x6a, 0x46, + 0x41, 0x62, 0x4a, 0x55, 0x57, 0x6d, 0x59, 0x64, 0x50, 0x66, 0x7a, 0x35, + 0x36, 0x54, 0x77, 0x4b, 0x6e, 0x6f, 0x47, 0x34, 0x63, 0x50, 0x41, 0x42, + 0x69, 0x2b, 0x51, 0x6a, 0x56, 0x48, 0x7a, 0x49, 0x72, 0x76, 0x69, 0x51, + 0x48, 0x67, 0x43, 0x57, 0x63, 0x74, 0x52, 0x55, 0x7a, 0x32, 0x45, 0x6a, + 0x0a, 0x76, 0x4f, 0x72, 0x37, 0x6e, 0x51, 0x4b, 0x56, 0x30, 0x62, 0x61, + 0x35, 0x63, 0x54, 0x70, 0x70, 0x43, 0x44, 0x38, 0x50, 0x74, 0x4f, 0x46, + 0x43, 0x78, 0x34, 0x6a, 0x31, 0x50, 0x35, 0x69, 0x6f, 0x70, 0x37, 0x6f, + 0x63, 0x34, 0x48, 0x46, 0x78, 0x37, 0x31, 0x68, 0x58, 0x67, 0x56, 0x42, + 0x36, 0x58, 0x47, 0x74, 0x30, 0x52, 0x67, 0x36, 0x44, 0x41, 0x35, 0x6a, + 0x44, 0x6a, 0x71, 0x68, 0x75, 0x0a, 0x38, 0x6e, 0x59, 0x79, 0x62, 0x69, + 0x65, 0x44, 0x77, 0x6e, 0x50, 0x7a, 0x33, 0x42, 0x6a, 0x6f, 0x74, 0x4a, + 0x50, 0x71, 0x64, 0x55, 0x52, 0x72, 0x42, 0x47, 0x41, 0x67, 0x63, 0x56, + 0x65, 0x48, 0x6e, 0x66, 0x4f, 0x2b, 0x6f, 0x4a, 0x41, 0x6a, 0x50, 0x59, + 0x6f, 0x6b, 0x34, 0x64, 0x6f, 0x68, 0x32, 0x38, 0x4d, 0x43, 0x41, 0x77, + 0x45, 0x41, 0x41, 0x61, 0x4d, 0x7a, 0x4d, 0x44, 0x45, 0x77, 0x0a, 0x44, + 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, + 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x52, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x43, 0x67, 0x51, 0x49, 0x53, + 0x71, 0x43, 0x71, 0x57, 0x49, 0x54, 0x54, 0x58, 0x6a, 0x77, 0x77, 0x43, + 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x42, 0x41, 0x51, 0x44, 0x41, + 0x67, 0x45, 0x47, 0x0a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, + 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x42, 0x61, 0x7a, 0x6f, 0x66, 0x35, + 0x46, 0x6e, 0x49, 0x56, 0x56, 0x30, 0x73, 0x64, 0x32, 0x5a, 0x76, 0x6e, + 0x6f, 0x69, 0x59, 0x77, 0x37, 0x4a, 0x4e, 0x6e, 0x33, 0x39, 0x59, 0x74, + 0x30, 0x6a, 0x53, 0x76, 0x39, 0x7a, 0x69, 0x6c, 0x0a, 0x7a, 0x71, 0x73, + 0x57, 0x75, 0x61, 0x73, 0x76, 0x66, 0x44, 0x58, 0x4c, 0x72, 0x4e, 0x41, + 0x50, 0x74, 0x45, 0x77, 0x72, 0x2f, 0x49, 0x44, 0x76, 0x61, 0x34, 0x79, + 0x52, 0x58, 0x7a, 0x5a, 0x32, 0x39, 0x39, 0x75, 0x7a, 0x47, 0x78, 0x6e, + 0x71, 0x39, 0x4c, 0x49, 0x52, 0x2f, 0x57, 0x46, 0x78, 0x52, 0x4c, 0x38, + 0x6f, 0x73, 0x7a, 0x6f, 0x64, 0x76, 0x37, 0x4e, 0x44, 0x36, 0x4a, 0x2b, + 0x2f, 0x0a, 0x33, 0x44, 0x45, 0x49, 0x63, 0x62, 0x43, 0x64, 0x6a, 0x64, + 0x59, 0x30, 0x52, 0x7a, 0x4b, 0x51, 0x78, 0x6d, 0x55, 0x6b, 0x39, 0x36, + 0x42, 0x4b, 0x66, 0x41, 0x52, 0x7a, 0x6a, 0x7a, 0x6c, 0x76, 0x46, 0x34, + 0x78, 0x79, 0x74, 0x62, 0x31, 0x4c, 0x79, 0x48, 0x72, 0x34, 0x65, 0x34, + 0x50, 0x44, 0x4b, 0x45, 0x36, 0x63, 0x43, 0x65, 0x70, 0x6e, 0x50, 0x37, + 0x4a, 0x6e, 0x42, 0x42, 0x76, 0x44, 0x0a, 0x46, 0x4e, 0x72, 0x34, 0x35, + 0x30, 0x6b, 0x6b, 0x6b, 0x64, 0x41, 0x64, 0x61, 0x76, 0x70, 0x68, 0x4f, + 0x65, 0x39, 0x72, 0x35, 0x79, 0x46, 0x31, 0x42, 0x67, 0x66, 0x59, 0x45, + 0x72, 0x51, 0x68, 0x49, 0x48, 0x42, 0x43, 0x63, 0x59, 0x48, 0x61, 0x50, + 0x4a, 0x6f, 0x32, 0x76, 0x71, 0x5a, 0x62, 0x44, 0x57, 0x70, 0x73, 0x6d, + 0x68, 0x2b, 0x52, 0x65, 0x2f, 0x6e, 0x35, 0x37, 0x30, 0x4b, 0x36, 0x0a, + 0x54, 0x6b, 0x36, 0x65, 0x7a, 0x41, 0x79, 0x4e, 0x6c, 0x4e, 0x7a, 0x5a, + 0x52, 0x5a, 0x78, 0x65, 0x37, 0x45, 0x4a, 0x51, 0x59, 0x36, 0x37, 0x30, + 0x58, 0x63, 0x53, 0x78, 0x45, 0x74, 0x7a, 0x4b, 0x4f, 0x36, 0x67, 0x75, + 0x6e, 0x52, 0x52, 0x61, 0x42, 0x58, 0x57, 0x33, 0x37, 0x4e, 0x64, 0x6a, + 0x34, 0x72, 0x6f, 0x31, 0x74, 0x67, 0x51, 0x49, 0x6b, 0x65, 0x6a, 0x61, + 0x6e, 0x5a, 0x7a, 0x32, 0x0a, 0x5a, 0x72, 0x55, 0x59, 0x72, 0x41, 0x71, + 0x6d, 0x56, 0x43, 0x59, 0x30, 0x4d, 0x39, 0x49, 0x62, 0x77, 0x64, 0x52, + 0x2f, 0x47, 0x6a, 0x71, 0x4f, 0x43, 0x36, 0x6f, 0x79, 0x62, 0x74, 0x76, + 0x38, 0x54, 0x79, 0x57, 0x66, 0x32, 0x54, 0x4c, 0x48, 0x6c, 0x6c, 0x70, + 0x77, 0x72, 0x4e, 0x39, 0x4d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x58, 0x52, + 0x61, 0x6d, 0x70, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, + 0x3d, 0x58, 0x52, 0x61, 0x6d, 0x70, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x69, 0x74, 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, + 0x78, 0x72, 0x61, 0x6d, 0x70, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x58, 0x52, 0x61, 0x6d, + 0x70, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x58, + 0x52, 0x61, 0x6d, 0x70, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x49, + 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x78, 0x72, + 0x61, 0x6d, 0x70, 0x73, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x2e, + 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x58, 0x52, 0x61, 0x6d, 0x70, 0x20, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, + 0x37, 0x31, 0x30, 0x38, 0x39, 0x30, 0x38, 0x38, 0x30, 0x33, 0x36, 0x35, + 0x31, 0x35, 0x30, 0x39, 0x36, 0x39, 0x32, 0x39, 0x38, 0x30, 0x31, 0x32, + 0x34, 0x32, 0x33, 0x33, 0x37, 0x34, 0x35, 0x30, 0x31, 0x34, 0x39, 0x35, + 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x31, 0x3a, + 0x30, 0x62, 0x3a, 0x34, 0x34, 0x3a, 0x62, 0x33, 0x3a, 0x63, 0x61, 0x3a, + 0x31, 0x30, 0x3a, 0x64, 0x38, 0x3a, 0x30, 0x30, 0x3a, 0x36, 0x65, 0x3a, + 0x39, 0x64, 0x3a, 0x30, 0x66, 0x3a, 0x64, 0x38, 0x3a, 0x30, 0x66, 0x3a, + 0x39, 0x32, 0x3a, 0x30, 0x61, 0x3a, 0x64, 0x31, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x38, 0x3a, 0x30, 0x31, 0x3a, 0x38, + 0x36, 0x3a, 0x64, 0x31, 0x3a, 0x65, 0x62, 0x3a, 0x39, 0x63, 0x3a, 0x38, + 0x36, 0x3a, 0x61, 0x35, 0x3a, 0x34, 0x31, 0x3a, 0x30, 0x34, 0x3a, 0x63, + 0x66, 0x3a, 0x33, 0x30, 0x3a, 0x35, 0x34, 0x3a, 0x66, 0x33, 0x3a, 0x34, + 0x63, 0x3a, 0x35, 0x32, 0x3a, 0x62, 0x37, 0x3a, 0x65, 0x35, 0x3a, 0x35, + 0x38, 0x3a, 0x63, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x63, 0x65, 0x3a, 0x63, 0x64, 0x3a, 0x64, 0x63, 0x3a, + 0x39, 0x30, 0x3a, 0x35, 0x30, 0x3a, 0x39, 0x39, 0x3a, 0x64, 0x38, 0x3a, + 0x64, 0x61, 0x3a, 0x64, 0x66, 0x3a, 0x63, 0x35, 0x3a, 0x62, 0x31, 0x3a, + 0x64, 0x32, 0x3a, 0x30, 0x39, 0x3a, 0x62, 0x37, 0x3a, 0x33, 0x37, 0x3a, + 0x63, 0x62, 0x3a, 0x65, 0x32, 0x3a, 0x63, 0x31, 0x3a, 0x38, 0x63, 0x3a, + 0x66, 0x62, 0x3a, 0x32, 0x63, 0x3a, 0x31, 0x30, 0x3a, 0x63, 0x30, 0x3a, + 0x66, 0x66, 0x3a, 0x30, 0x62, 0x3a, 0x63, 0x66, 0x3a, 0x30, 0x64, 0x3a, + 0x33, 0x32, 0x3a, 0x38, 0x36, 0x3a, 0x66, 0x63, 0x3a, 0x31, 0x61, 0x3a, + 0x61, 0x32, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, + 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x4d, + 0x44, 0x43, 0x43, 0x41, 0x78, 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, + 0x67, 0x49, 0x51, 0x55, 0x4a, 0x52, 0x73, 0x37, 0x42, 0x6a, 0x71, 0x31, + 0x5a, 0x78, 0x4e, 0x31, 0x5a, 0x66, 0x76, 0x64, 0x59, 0x2b, 0x67, 0x72, + 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, + 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, + 0x67, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x48, 0x6a, 0x41, 0x63, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x46, 0x58, 0x64, 0x33, + 0x64, 0x79, 0x35, 0x34, 0x63, 0x6d, 0x46, 0x74, 0x63, 0x48, 0x4e, 0x6c, + 0x59, 0x33, 0x56, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4c, 0x6d, 0x4e, 0x76, + 0x62, 0x54, 0x45, 0x6b, 0x0a, 0x4d, 0x43, 0x49, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x62, 0x57, 0x46, 0x4a, 0x68, 0x62, 0x58, 0x41, + 0x67, 0x55, 0x32, 0x56, 0x6a, 0x64, 0x58, 0x4a, 0x70, 0x64, 0x48, 0x6b, + 0x67, 0x55, 0x32, 0x56, 0x79, 0x64, 0x6d, 0x6c, 0x6a, 0x5a, 0x58, 0x4d, + 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x53, 0x30, 0x77, 0x4b, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x52, 0x59, 0x0a, 0x55, 0x6d, + 0x46, 0x74, 0x63, 0x43, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x77, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, + 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, + 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, 0x48, 0x68, + 0x63, 0x4e, 0x4d, 0x44, 0x51, 0x78, 0x4d, 0x54, 0x41, 0x78, 0x4d, 0x54, + 0x63, 0x78, 0x0a, 0x4e, 0x44, 0x41, 0x30, 0x57, 0x68, 0x63, 0x4e, 0x4d, + 0x7a, 0x55, 0x77, 0x4d, 0x54, 0x41, 0x78, 0x4d, 0x44, 0x55, 0x7a, 0x4e, + 0x7a, 0x45, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x67, 0x6a, 0x45, 0x4c, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, + 0x56, 0x4d, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x73, 0x54, 0x46, 0x58, 0x64, 0x33, 0x0a, 0x64, 0x79, 0x35, 0x34, + 0x63, 0x6d, 0x46, 0x74, 0x63, 0x48, 0x4e, 0x6c, 0x59, 0x33, 0x56, 0x79, + 0x61, 0x58, 0x52, 0x35, 0x4c, 0x6d, 0x4e, 0x76, 0x62, 0x54, 0x45, 0x6b, + 0x4d, 0x43, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x62, + 0x57, 0x46, 0x4a, 0x68, 0x62, 0x58, 0x41, 0x67, 0x55, 0x32, 0x56, 0x6a, + 0x64, 0x58, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x67, 0x55, 0x32, 0x56, 0x79, + 0x0a, 0x64, 0x6d, 0x6c, 0x6a, 0x5a, 0x58, 0x4d, 0x67, 0x53, 0x57, 0x35, + 0x6a, 0x4d, 0x53, 0x30, 0x77, 0x4b, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x44, 0x45, 0x79, 0x52, 0x59, 0x55, 0x6d, 0x46, 0x74, 0x63, 0x43, 0x42, + 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x67, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, + 0x76, 0x62, 0x69, 0x42, 0x42, 0x0a, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, + 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, + 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, + 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, + 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, + 0x43, 0x59, 0x4a, 0x42, 0x36, 0x39, 0x46, 0x62, 0x53, 0x36, 0x0a, 0x33, + 0x38, 0x65, 0x4d, 0x70, 0x53, 0x65, 0x32, 0x4f, 0x41, 0x74, 0x70, 0x38, + 0x37, 0x5a, 0x4f, 0x71, 0x43, 0x77, 0x75, 0x49, 0x52, 0x31, 0x63, 0x52, + 0x4e, 0x38, 0x68, 0x58, 0x58, 0x34, 0x6a, 0x64, 0x50, 0x35, 0x65, 0x66, + 0x72, 0x52, 0x4b, 0x74, 0x36, 0x61, 0x74, 0x48, 0x36, 0x37, 0x67, 0x42, + 0x68, 0x62, 0x69, 0x6d, 0x31, 0x76, 0x5a, 0x5a, 0x33, 0x52, 0x72, 0x58, + 0x59, 0x43, 0x50, 0x0a, 0x4b, 0x5a, 0x32, 0x47, 0x47, 0x39, 0x6d, 0x63, + 0x44, 0x5a, 0x68, 0x74, 0x64, 0x68, 0x41, 0x6f, 0x57, 0x4f, 0x52, 0x6c, + 0x73, 0x48, 0x39, 0x4b, 0x6d, 0x48, 0x6d, 0x66, 0x34, 0x4d, 0x4d, 0x78, + 0x66, 0x6f, 0x41, 0x72, 0x74, 0x59, 0x7a, 0x41, 0x51, 0x44, 0x73, 0x52, + 0x68, 0x74, 0x44, 0x4c, 0x6f, 0x6f, 0x59, 0x32, 0x59, 0x4b, 0x54, 0x56, + 0x4d, 0x49, 0x4a, 0x74, 0x32, 0x57, 0x37, 0x51, 0x0a, 0x44, 0x78, 0x49, + 0x45, 0x4d, 0x35, 0x64, 0x66, 0x54, 0x32, 0x46, 0x61, 0x38, 0x4f, 0x54, + 0x35, 0x6b, 0x61, 0x76, 0x6e, 0x48, 0x54, 0x75, 0x38, 0x36, 0x4d, 0x2f, + 0x30, 0x61, 0x79, 0x30, 0x30, 0x66, 0x4f, 0x4a, 0x49, 0x59, 0x52, 0x79, + 0x4f, 0x38, 0x32, 0x46, 0x45, 0x7a, 0x47, 0x2b, 0x67, 0x53, 0x71, 0x6d, + 0x55, 0x73, 0x45, 0x33, 0x61, 0x35, 0x36, 0x6b, 0x30, 0x65, 0x6e, 0x49, + 0x34, 0x0a, 0x71, 0x45, 0x48, 0x4d, 0x50, 0x4a, 0x51, 0x52, 0x66, 0x65, + 0x76, 0x49, 0x70, 0x6f, 0x79, 0x33, 0x68, 0x73, 0x76, 0x4b, 0x4d, 0x7a, + 0x76, 0x5a, 0x50, 0x54, 0x65, 0x4c, 0x2b, 0x33, 0x6f, 0x2b, 0x68, 0x69, + 0x7a, 0x6e, 0x63, 0x39, 0x63, 0x4b, 0x56, 0x36, 0x78, 0x6b, 0x6d, 0x78, + 0x6e, 0x72, 0x39, 0x41, 0x38, 0x45, 0x43, 0x49, 0x71, 0x73, 0x41, 0x78, + 0x63, 0x5a, 0x5a, 0x50, 0x52, 0x61, 0x0a, 0x4a, 0x53, 0x4b, 0x4e, 0x4e, + 0x43, 0x79, 0x79, 0x39, 0x6d, 0x67, 0x64, 0x45, 0x6d, 0x33, 0x54, 0x69, + 0x68, 0x34, 0x55, 0x32, 0x73, 0x53, 0x50, 0x70, 0x75, 0x49, 0x6a, 0x68, + 0x64, 0x56, 0x36, 0x44, 0x62, 0x31, 0x71, 0x34, 0x4f, 0x6e, 0x73, 0x37, + 0x42, 0x65, 0x37, 0x51, 0x68, 0x74, 0x6e, 0x71, 0x69, 0x58, 0x74, 0x52, + 0x59, 0x4d, 0x68, 0x2f, 0x4d, 0x48, 0x4a, 0x66, 0x4e, 0x56, 0x69, 0x0a, + 0x50, 0x76, 0x72, 0x79, 0x78, 0x53, 0x33, 0x54, 0x2f, 0x64, 0x52, 0x6c, + 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x5a, 0x38, 0x77, + 0x67, 0x5a, 0x77, 0x77, 0x45, 0x77, 0x59, 0x4a, 0x4b, 0x77, 0x59, 0x42, + 0x42, 0x41, 0x47, 0x43, 0x4e, 0x78, 0x51, 0x43, 0x42, 0x41, 0x59, 0x65, + 0x42, 0x41, 0x42, 0x44, 0x41, 0x45, 0x45, 0x77, 0x43, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x50, 0x0a, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, + 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, + 0x45, 0x46, 0x4d, 0x5a, 0x50, 0x6f, 0x6a, 0x30, 0x47, 0x59, 0x34, 0x51, + 0x4a, 0x6e, 0x4d, 0x35, 0x69, 0x35, 0x41, 0x53, 0x73, 0x0a, 0x6a, 0x56, + 0x79, 0x31, 0x36, 0x62, 0x59, 0x62, 0x4d, 0x44, 0x59, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x48, 0x77, 0x51, 0x76, 0x4d, 0x43, 0x30, 0x77, 0x4b, 0x36, + 0x41, 0x70, 0x6f, 0x43, 0x65, 0x47, 0x4a, 0x57, 0x68, 0x30, 0x64, 0x48, + 0x41, 0x36, 0x4c, 0x79, 0x39, 0x6a, 0x63, 0x6d, 0x77, 0x75, 0x65, 0x48, + 0x4a, 0x68, 0x62, 0x58, 0x42, 0x7a, 0x5a, 0x57, 0x4e, 0x31, 0x63, 0x6d, + 0x6c, 0x30, 0x0a, 0x65, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x76, 0x57, + 0x45, 0x64, 0x44, 0x51, 0x53, 0x35, 0x6a, 0x63, 0x6d, 0x77, 0x77, 0x45, + 0x41, 0x59, 0x4a, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x41, 0x47, 0x43, 0x4e, + 0x78, 0x55, 0x42, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x45, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x0a, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x4a, 0x45, 0x56, 0x4f, 0x51, 0x4d, 0x42, 0x47, 0x32, 0x66, 0x37, + 0x53, 0x68, 0x7a, 0x35, 0x43, 0x6d, 0x42, 0x62, 0x6f, 0x64, 0x70, 0x4e, + 0x6c, 0x32, 0x4c, 0x35, 0x4a, 0x46, 0x4d, 0x6e, 0x31, 0x34, 0x4a, 0x6b, + 0x54, 0x70, 0x41, 0x75, 0x77, 0x30, 0x6b, 0x62, 0x4b, 0x35, 0x72, 0x63, + 0x2f, 0x4b, 0x68, 0x34, 0x5a, 0x7a, 0x58, 0x78, 0x48, 0x66, 0x41, 0x52, + 0x0a, 0x76, 0x62, 0x64, 0x49, 0x34, 0x78, 0x44, 0x32, 0x44, 0x64, 0x38, + 0x2f, 0x30, 0x73, 0x6d, 0x32, 0x71, 0x6c, 0x57, 0x6b, 0x53, 0x4c, 0x6f, + 0x43, 0x32, 0x39, 0x35, 0x5a, 0x4c, 0x68, 0x56, 0x62, 0x4f, 0x35, 0x30, + 0x57, 0x66, 0x55, 0x66, 0x58, 0x4e, 0x2b, 0x70, 0x66, 0x54, 0x58, 0x59, + 0x53, 0x4e, 0x72, 0x73, 0x66, 0x31, 0x36, 0x47, 0x42, 0x42, 0x45, 0x59, + 0x67, 0x6f, 0x79, 0x78, 0x74, 0x0a, 0x71, 0x5a, 0x34, 0x42, 0x66, 0x6a, + 0x38, 0x70, 0x7a, 0x67, 0x43, 0x54, 0x33, 0x2f, 0x33, 0x4a, 0x6b, 0x6e, + 0x4f, 0x4a, 0x69, 0x57, 0x53, 0x65, 0x35, 0x79, 0x76, 0x6b, 0x48, 0x4a, + 0x45, 0x73, 0x30, 0x72, 0x6e, 0x4f, 0x66, 0x63, 0x35, 0x76, 0x4d, 0x5a, + 0x6e, 0x54, 0x35, 0x72, 0x37, 0x53, 0x48, 0x70, 0x44, 0x77, 0x43, 0x52, + 0x52, 0x35, 0x58, 0x43, 0x4f, 0x72, 0x54, 0x64, 0x4c, 0x61, 0x0a, 0x49, + 0x52, 0x39, 0x4e, 0x6d, 0x58, 0x6d, 0x64, 0x34, 0x63, 0x38, 0x6e, 0x6e, + 0x78, 0x43, 0x62, 0x48, 0x49, 0x67, 0x4e, 0x73, 0x49, 0x70, 0x6b, 0x51, + 0x54, 0x47, 0x34, 0x44, 0x6d, 0x79, 0x51, 0x4a, 0x4b, 0x53, 0x62, 0x58, + 0x48, 0x47, 0x50, 0x75, 0x72, 0x74, 0x2b, 0x48, 0x42, 0x76, 0x62, 0x61, + 0x6f, 0x41, 0x50, 0x49, 0x62, 0x7a, 0x70, 0x32, 0x36, 0x61, 0x33, 0x51, + 0x50, 0x53, 0x79, 0x0a, 0x69, 0x36, 0x6d, 0x78, 0x35, 0x4f, 0x2b, 0x61, + 0x47, 0x74, 0x41, 0x39, 0x61, 0x5a, 0x6e, 0x75, 0x71, 0x43, 0x69, 0x6a, + 0x34, 0x54, 0x79, 0x7a, 0x38, 0x4c, 0x49, 0x52, 0x6e, 0x4d, 0x39, 0x38, + 0x51, 0x4f, 0x62, 0x64, 0x35, 0x30, 0x4e, 0x39, 0x6f, 0x74, 0x67, 0x36, + 0x74, 0x61, 0x6d, 0x4e, 0x38, 0x6a, 0x53, 0x5a, 0x78, 0x4e, 0x51, 0x51, + 0x34, 0x51, 0x62, 0x39, 0x43, 0x59, 0x51, 0x51, 0x0a, 0x4f, 0x2b, 0x37, + 0x45, 0x54, 0x50, 0x54, 0x73, 0x4a, 0x33, 0x78, 0x43, 0x77, 0x6e, 0x52, + 0x38, 0x67, 0x6f, 0x6f, 0x4a, 0x79, 0x62, 0x51, 0x44, 0x4a, 0x62, 0x77, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x4f, 0x3d, 0x54, 0x68, 0x65, 0x20, 0x47, 0x6f, 0x20, + 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2c, + 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6f, 0x20, + 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, + 0x32, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x4f, 0x3d, 0x54, 0x68, 0x65, 0x20, 0x47, 0x6f, 0x20, 0x44, 0x61, + 0x64, 0x64, 0x79, 0x20, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x2c, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6f, 0x20, 0x44, 0x61, + 0x64, 0x64, 0x79, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x6f, + 0x20, 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, + 0x20, 0x32, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x39, 0x31, 0x3a, 0x64, 0x65, 0x3a, 0x30, 0x36, 0x3a, 0x32, + 0x35, 0x3a, 0x61, 0x62, 0x3a, 0x64, 0x61, 0x3a, 0x66, 0x64, 0x3a, 0x33, + 0x32, 0x3a, 0x31, 0x37, 0x3a, 0x30, 0x63, 0x3a, 0x62, 0x62, 0x3a, 0x32, + 0x35, 0x3a, 0x31, 0x37, 0x3a, 0x32, 0x61, 0x3a, 0x38, 0x34, 0x3a, 0x36, + 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x37, + 0x3a, 0x39, 0x36, 0x3a, 0x62, 0x61, 0x3a, 0x65, 0x36, 0x3a, 0x33, 0x66, + 0x3a, 0x31, 0x38, 0x3a, 0x30, 0x31, 0x3a, 0x65, 0x32, 0x3a, 0x37, 0x37, + 0x3a, 0x32, 0x36, 0x3a, 0x31, 0x62, 0x3a, 0x61, 0x30, 0x3a, 0x64, 0x37, + 0x3a, 0x37, 0x37, 0x3a, 0x37, 0x30, 0x3a, 0x30, 0x32, 0x3a, 0x38, 0x66, + 0x3a, 0x32, 0x30, 0x3a, 0x65, 0x65, 0x3a, 0x65, 0x34, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x33, 0x3a, 0x38, + 0x34, 0x3a, 0x36, 0x62, 0x3a, 0x66, 0x32, 0x3a, 0x34, 0x62, 0x3a, 0x39, + 0x65, 0x3a, 0x39, 0x33, 0x3a, 0x63, 0x61, 0x3a, 0x36, 0x34, 0x3a, 0x32, + 0x37, 0x3a, 0x34, 0x63, 0x3a, 0x30, 0x65, 0x3a, 0x63, 0x36, 0x3a, 0x37, + 0x63, 0x3a, 0x31, 0x65, 0x3a, 0x63, 0x63, 0x3a, 0x35, 0x65, 0x3a, 0x30, + 0x32, 0x3a, 0x34, 0x66, 0x3a, 0x66, 0x63, 0x3a, 0x61, 0x63, 0x3a, 0x64, + 0x32, 0x3a, 0x64, 0x37, 0x3a, 0x34, 0x30, 0x3a, 0x31, 0x39, 0x3a, 0x33, + 0x35, 0x3a, 0x30, 0x65, 0x3a, 0x38, 0x31, 0x3a, 0x66, 0x65, 0x3a, 0x35, + 0x34, 0x3a, 0x36, 0x61, 0x3a, 0x65, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x45, 0x41, 0x44, 0x43, 0x43, 0x41, 0x75, 0x69, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x6a, 0x4d, 0x51, 0x73, 0x77, + 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, + 0x55, 0x7a, 0x45, 0x68, 0x0a, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x59, 0x56, 0x47, 0x68, 0x6c, 0x49, 0x45, 0x64, + 0x76, 0x49, 0x45, 0x52, 0x68, 0x5a, 0x47, 0x52, 0x35, 0x49, 0x45, 0x64, + 0x79, 0x62, 0x33, 0x56, 0x77, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, + 0x75, 0x4d, 0x54, 0x45, 0x77, 0x4c, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x79, 0x68, 0x48, 0x62, 0x79, 0x42, 0x45, 0x0a, 0x59, 0x57, + 0x52, 0x6b, 0x65, 0x53, 0x42, 0x44, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, + 0x41, 0x79, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, + 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x42, + 0x34, 0x58, 0x44, 0x54, 0x41, 0x30, 0x4d, 0x44, 0x59, 0x79, 0x4f, 0x54, + 0x45, 0x33, 0x0a, 0x4d, 0x44, 0x59, 0x79, 0x4d, 0x46, 0x6f, 0x58, 0x44, + 0x54, 0x4d, 0x30, 0x4d, 0x44, 0x59, 0x79, 0x4f, 0x54, 0x45, 0x33, 0x4d, + 0x44, 0x59, 0x79, 0x4d, 0x46, 0x6f, 0x77, 0x59, 0x7a, 0x45, 0x4c, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, + 0x56, 0x4d, 0x78, 0x49, 0x54, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x54, 0x47, 0x46, 0x52, 0x6f, 0x0a, 0x5a, 0x53, 0x42, 0x48, + 0x62, 0x79, 0x42, 0x45, 0x59, 0x57, 0x52, 0x6b, 0x65, 0x53, 0x42, 0x48, + 0x63, 0x6d, 0x39, 0x31, 0x63, 0x43, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, + 0x4c, 0x6a, 0x45, 0x78, 0x4d, 0x43, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x78, 0x4d, 0x6f, 0x52, 0x32, 0x38, 0x67, 0x52, 0x47, 0x46, 0x6b, + 0x5a, 0x48, 0x6b, 0x67, 0x51, 0x32, 0x78, 0x68, 0x63, 0x33, 0x4d, 0x67, + 0x0a, 0x4d, 0x69, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, + 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x43, + 0x43, 0x41, 0x53, 0x41, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, + 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, + 0x44, 0x67, 0x67, 0x45, 0x4e, 0x0a, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, + 0x67, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4e, 0x36, 0x64, 0x31, 0x2b, + 0x70, 0x58, 0x47, 0x45, 0x6d, 0x68, 0x57, 0x2b, 0x76, 0x58, 0x58, 0x30, + 0x69, 0x47, 0x36, 0x72, 0x37, 0x64, 0x2f, 0x2b, 0x54, 0x76, 0x5a, 0x78, + 0x7a, 0x30, 0x5a, 0x57, 0x69, 0x7a, 0x56, 0x33, 0x47, 0x67, 0x58, 0x6e, + 0x65, 0x37, 0x37, 0x5a, 0x74, 0x4a, 0x36, 0x58, 0x43, 0x41, 0x0a, 0x50, + 0x56, 0x59, 0x59, 0x59, 0x77, 0x68, 0x76, 0x32, 0x76, 0x4c, 0x4d, 0x30, + 0x44, 0x39, 0x2f, 0x41, 0x6c, 0x51, 0x69, 0x56, 0x42, 0x44, 0x59, 0x73, + 0x6f, 0x48, 0x55, 0x77, 0x48, 0x55, 0x39, 0x53, 0x33, 0x2f, 0x48, 0x64, + 0x38, 0x4d, 0x2b, 0x65, 0x4b, 0x73, 0x61, 0x41, 0x37, 0x55, 0x67, 0x61, + 0x79, 0x39, 0x71, 0x4b, 0x37, 0x48, 0x46, 0x69, 0x48, 0x37, 0x45, 0x75, + 0x78, 0x36, 0x77, 0x0a, 0x77, 0x64, 0x68, 0x46, 0x4a, 0x32, 0x2b, 0x71, + 0x4e, 0x31, 0x6a, 0x33, 0x68, 0x79, 0x62, 0x58, 0x32, 0x43, 0x33, 0x32, + 0x71, 0x52, 0x65, 0x33, 0x48, 0x33, 0x49, 0x32, 0x54, 0x71, 0x59, 0x58, + 0x50, 0x32, 0x57, 0x59, 0x6b, 0x74, 0x73, 0x71, 0x62, 0x6c, 0x32, 0x69, + 0x2f, 0x6f, 0x6a, 0x67, 0x43, 0x39, 0x35, 0x2f, 0x35, 0x59, 0x30, 0x56, + 0x34, 0x65, 0x76, 0x4c, 0x4f, 0x74, 0x58, 0x69, 0x0a, 0x45, 0x71, 0x49, + 0x54, 0x4c, 0x64, 0x69, 0x4f, 0x72, 0x31, 0x38, 0x53, 0x50, 0x61, 0x41, + 0x49, 0x42, 0x51, 0x69, 0x32, 0x58, 0x4b, 0x56, 0x6c, 0x4f, 0x41, 0x52, + 0x46, 0x6d, 0x52, 0x36, 0x6a, 0x59, 0x47, 0x42, 0x30, 0x78, 0x55, 0x47, + 0x6c, 0x63, 0x6d, 0x49, 0x62, 0x59, 0x73, 0x55, 0x66, 0x62, 0x31, 0x38, + 0x61, 0x51, 0x72, 0x34, 0x43, 0x55, 0x57, 0x57, 0x6f, 0x72, 0x69, 0x4d, + 0x59, 0x0a, 0x61, 0x76, 0x78, 0x34, 0x41, 0x36, 0x6c, 0x4e, 0x66, 0x34, + 0x44, 0x44, 0x2b, 0x71, 0x74, 0x61, 0x2f, 0x4b, 0x46, 0x41, 0x70, 0x4d, + 0x6f, 0x5a, 0x46, 0x76, 0x36, 0x79, 0x79, 0x4f, 0x39, 0x65, 0x63, 0x77, + 0x33, 0x75, 0x64, 0x37, 0x32, 0x61, 0x39, 0x6e, 0x6d, 0x59, 0x76, 0x4c, + 0x45, 0x48, 0x5a, 0x36, 0x49, 0x56, 0x44, 0x64, 0x32, 0x67, 0x57, 0x4d, + 0x5a, 0x45, 0x65, 0x77, 0x6f, 0x2b, 0x0a, 0x59, 0x69, 0x68, 0x66, 0x75, + 0x6b, 0x45, 0x48, 0x55, 0x31, 0x6a, 0x50, 0x45, 0x58, 0x34, 0x34, 0x64, + 0x4d, 0x58, 0x34, 0x2f, 0x37, 0x56, 0x70, 0x6b, 0x49, 0x2b, 0x45, 0x64, + 0x4f, 0x71, 0x58, 0x47, 0x36, 0x38, 0x43, 0x41, 0x51, 0x4f, 0x6a, 0x67, + 0x63, 0x41, 0x77, 0x67, 0x62, 0x30, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4e, 0x4c, 0x45, 0x0a, + 0x73, 0x4e, 0x4b, 0x52, 0x31, 0x45, 0x77, 0x52, 0x63, 0x62, 0x4e, 0x68, + 0x79, 0x7a, 0x32, 0x68, 0x2f, 0x74, 0x32, 0x6f, 0x61, 0x74, 0x54, 0x6a, + 0x4d, 0x49, 0x47, 0x4e, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, + 0x67, 0x59, 0x55, 0x77, 0x67, 0x59, 0x4b, 0x41, 0x46, 0x4e, 0x4c, 0x45, + 0x73, 0x4e, 0x4b, 0x52, 0x31, 0x45, 0x77, 0x52, 0x63, 0x62, 0x4e, 0x68, + 0x79, 0x7a, 0x32, 0x68, 0x0a, 0x2f, 0x74, 0x32, 0x6f, 0x61, 0x74, 0x54, + 0x6a, 0x6f, 0x57, 0x65, 0x6b, 0x5a, 0x54, 0x42, 0x6a, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x56, 0x55, 0x7a, 0x45, 0x68, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x59, 0x56, 0x47, 0x68, 0x6c, 0x49, 0x45, 0x64, + 0x76, 0x49, 0x45, 0x52, 0x68, 0x5a, 0x47, 0x52, 0x35, 0x0a, 0x49, 0x45, + 0x64, 0x79, 0x62, 0x33, 0x56, 0x77, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, + 0x4d, 0x75, 0x4d, 0x54, 0x45, 0x77, 0x4c, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x79, 0x68, 0x48, 0x62, 0x79, 0x42, 0x45, 0x59, 0x57, + 0x52, 0x6b, 0x65, 0x53, 0x42, 0x44, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, + 0x41, 0x79, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x0a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, + 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x67, + 0x67, 0x45, 0x41, 0x4d, 0x41, 0x77, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, + 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x0a, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x44, 0x4a, 0x4c, 0x38, 0x37, 0x4c, 0x4b, 0x50, 0x70, 0x48, 0x38, + 0x45, 0x73, 0x61, 0x68, 0x42, 0x34, 0x79, 0x4f, 0x64, 0x36, 0x41, 0x7a, + 0x42, 0x68, 0x52, 0x63, 0x6b, 0x42, 0x34, 0x59, 0x39, 0x77, 0x69, 0x6d, + 0x50, 0x51, 0x6f, 0x5a, 0x2b, 0x59, 0x65, 0x41, 0x45, 0x57, 0x35, 0x70, + 0x35, 0x4a, 0x59, 0x58, 0x4d, 0x50, 0x38, 0x30, 0x6b, 0x57, 0x4e, 0x79, + 0x0a, 0x4f, 0x4f, 0x37, 0x4d, 0x48, 0x41, 0x47, 0x6a, 0x48, 0x5a, 0x51, + 0x6f, 0x70, 0x44, 0x48, 0x32, 0x65, 0x73, 0x52, 0x55, 0x31, 0x2f, 0x62, + 0x6c, 0x4d, 0x56, 0x67, 0x44, 0x6f, 0x73, 0x7a, 0x4f, 0x59, 0x74, 0x75, + 0x55, 0x52, 0x58, 0x4f, 0x31, 0x76, 0x30, 0x58, 0x4a, 0x4a, 0x4c, 0x58, + 0x56, 0x67, 0x67, 0x4b, 0x74, 0x49, 0x33, 0x6c, 0x70, 0x6a, 0x62, 0x69, + 0x32, 0x54, 0x63, 0x37, 0x50, 0x0a, 0x54, 0x4d, 0x6f, 0x7a, 0x49, 0x2b, + 0x67, 0x63, 0x69, 0x4b, 0x71, 0x64, 0x69, 0x30, 0x46, 0x75, 0x46, 0x73, + 0x6b, 0x67, 0x35, 0x59, 0x6d, 0x65, 0x7a, 0x54, 0x76, 0x61, 0x63, 0x50, + 0x64, 0x2b, 0x6d, 0x53, 0x59, 0x67, 0x46, 0x46, 0x51, 0x6c, 0x71, 0x32, + 0x35, 0x7a, 0x68, 0x65, 0x61, 0x62, 0x49, 0x5a, 0x30, 0x4b, 0x62, 0x49, + 0x49, 0x4f, 0x71, 0x50, 0x6a, 0x43, 0x44, 0x50, 0x6f, 0x51, 0x0a, 0x48, + 0x6d, 0x79, 0x57, 0x37, 0x34, 0x63, 0x4e, 0x78, 0x41, 0x39, 0x68, 0x69, + 0x36, 0x33, 0x75, 0x67, 0x79, 0x75, 0x56, 0x2b, 0x49, 0x36, 0x53, 0x68, + 0x48, 0x49, 0x35, 0x36, 0x79, 0x44, 0x71, 0x67, 0x2b, 0x32, 0x44, 0x7a, + 0x5a, 0x64, 0x75, 0x43, 0x4c, 0x7a, 0x72, 0x54, 0x69, 0x61, 0x32, 0x63, + 0x79, 0x76, 0x6b, 0x30, 0x2f, 0x5a, 0x4d, 0x2f, 0x69, 0x5a, 0x78, 0x34, + 0x6d, 0x45, 0x52, 0x0a, 0x64, 0x45, 0x72, 0x2f, 0x56, 0x78, 0x71, 0x48, + 0x44, 0x33, 0x56, 0x49, 0x4c, 0x73, 0x39, 0x52, 0x61, 0x52, 0x65, 0x67, + 0x41, 0x68, 0x4a, 0x68, 0x6c, 0x64, 0x58, 0x52, 0x51, 0x4c, 0x49, 0x51, + 0x54, 0x4f, 0x37, 0x45, 0x72, 0x42, 0x42, 0x44, 0x70, 0x71, 0x57, 0x65, + 0x43, 0x74, 0x57, 0x56, 0x59, 0x70, 0x6f, 0x4e, 0x7a, 0x34, 0x69, 0x43, + 0x78, 0x54, 0x49, 0x4d, 0x35, 0x43, 0x75, 0x66, 0x0a, 0x52, 0x65, 0x59, + 0x4e, 0x6e, 0x79, 0x69, 0x63, 0x73, 0x62, 0x6b, 0x71, 0x57, 0x6c, 0x65, + 0x74, 0x4e, 0x77, 0x2b, 0x76, 0x48, 0x58, 0x2f, 0x62, 0x76, 0x5a, 0x38, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, + 0x69, 0x65, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, + 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x72, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, + 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, + 0x64, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x74, 0x61, 0x72, + 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, + 0x32, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x33, 0x32, 0x3a, 0x34, 0x61, 0x3a, 0x34, 0x62, 0x3a, 0x62, 0x62, + 0x3a, 0x63, 0x38, 0x3a, 0x36, 0x33, 0x3a, 0x36, 0x39, 0x3a, 0x39, 0x62, + 0x3a, 0x62, 0x65, 0x3a, 0x37, 0x34, 0x3a, 0x39, 0x61, 0x3a, 0x63, 0x36, + 0x3a, 0x64, 0x64, 0x3a, 0x31, 0x64, 0x3a, 0x34, 0x36, 0x3a, 0x32, 0x34, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x64, 0x3a, + 0x37, 0x65, 0x3a, 0x31, 0x63, 0x3a, 0x32, 0x38, 0x3a, 0x62, 0x30, 0x3a, + 0x36, 0x34, 0x3a, 0x65, 0x66, 0x3a, 0x38, 0x66, 0x3a, 0x36, 0x30, 0x3a, + 0x30, 0x33, 0x3a, 0x34, 0x30, 0x3a, 0x32, 0x30, 0x3a, 0x31, 0x34, 0x3a, + 0x63, 0x33, 0x3a, 0x64, 0x30, 0x3a, 0x65, 0x33, 0x3a, 0x33, 0x37, 0x3a, + 0x30, 0x65, 0x3a, 0x62, 0x35, 0x3a, 0x38, 0x61, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x34, 0x3a, 0x36, 0x35, + 0x3a, 0x66, 0x61, 0x3a, 0x32, 0x30, 0x3a, 0x35, 0x33, 0x3a, 0x39, 0x37, + 0x3a, 0x62, 0x38, 0x3a, 0x37, 0x36, 0x3a, 0x66, 0x61, 0x3a, 0x61, 0x36, + 0x3a, 0x66, 0x30, 0x3a, 0x61, 0x39, 0x3a, 0x39, 0x35, 0x3a, 0x38, 0x65, + 0x3a, 0x35, 0x35, 0x3a, 0x39, 0x30, 0x3a, 0x65, 0x34, 0x3a, 0x30, 0x66, + 0x3a, 0x63, 0x63, 0x3a, 0x37, 0x66, 0x3a, 0x61, 0x61, 0x3a, 0x34, 0x66, + 0x3a, 0x62, 0x37, 0x3a, 0x63, 0x32, 0x3a, 0x63, 0x38, 0x3a, 0x36, 0x37, + 0x3a, 0x37, 0x35, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x62, 0x3a, 0x35, 0x66, + 0x3a, 0x62, 0x36, 0x3a, 0x35, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x45, 0x44, 0x7a, 0x43, 0x43, 0x41, 0x76, 0x65, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x6f, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, + 0x7a, 0x45, 0x6c, 0x0a, 0x4d, 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x68, 0x4d, 0x63, 0x55, 0x33, 0x52, 0x68, 0x63, 0x6d, 0x5a, 0x70, + 0x5a, 0x57, 0x78, 0x6b, 0x49, 0x46, 0x52, 0x6c, 0x59, 0x32, 0x68, 0x75, + 0x62, 0x32, 0x78, 0x76, 0x5a, 0x32, 0x6c, 0x6c, 0x63, 0x79, 0x77, 0x67, + 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x79, 0x4d, 0x44, 0x41, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x70, 0x0a, 0x55, 0x33, 0x52, + 0x68, 0x63, 0x6d, 0x5a, 0x70, 0x5a, 0x57, 0x78, 0x6b, 0x49, 0x45, 0x4e, + 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x49, 0x67, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, + 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, + 0x70, 0x64, 0x48, 0x6b, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x51, + 0x77, 0x0a, 0x4e, 0x6a, 0x49, 0x35, 0x4d, 0x54, 0x63, 0x7a, 0x4f, 0x54, + 0x45, 0x32, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x51, 0x77, 0x4e, 0x6a, + 0x49, 0x35, 0x4d, 0x54, 0x63, 0x7a, 0x4f, 0x54, 0x45, 0x32, 0x57, 0x6a, + 0x42, 0x6f, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x6c, 0x4d, 0x43, + 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x43, 0x68, 0x4d, 0x63, 0x55, + 0x33, 0x52, 0x68, 0x63, 0x6d, 0x5a, 0x70, 0x5a, 0x57, 0x78, 0x6b, 0x49, + 0x46, 0x52, 0x6c, 0x59, 0x32, 0x68, 0x75, 0x62, 0x32, 0x78, 0x76, 0x5a, + 0x32, 0x6c, 0x6c, 0x63, 0x79, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, + 0x6a, 0x45, 0x79, 0x4d, 0x44, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x78, 0x4d, 0x70, 0x55, 0x33, 0x52, 0x68, 0x63, 0x6d, 0x5a, 0x70, 0x0a, + 0x5a, 0x57, 0x78, 0x6b, 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, + 0x49, 0x44, 0x49, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, + 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, + 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, + 0x67, 0x67, 0x45, 0x67, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x0a, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, + 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x51, 0x41, 0x77, 0x67, 0x67, 0x45, + 0x49, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, 0x33, 0x4d, 0x73, 0x6a, + 0x2b, 0x36, 0x58, 0x47, 0x6d, 0x42, 0x49, 0x57, 0x74, 0x44, 0x42, 0x46, + 0x6b, 0x33, 0x38, 0x35, 0x4e, 0x37, 0x38, 0x67, 0x44, 0x47, 0x49, 0x63, + 0x2f, 0x6f, 0x61, 0x76, 0x37, 0x50, 0x4b, 0x61, 0x66, 0x0a, 0x38, 0x4d, + 0x4f, 0x68, 0x32, 0x74, 0x54, 0x59, 0x62, 0x69, 0x74, 0x54, 0x6b, 0x50, + 0x73, 0x6b, 0x70, 0x44, 0x36, 0x45, 0x38, 0x4a, 0x37, 0x6f, 0x58, 0x2b, + 0x7a, 0x6c, 0x4a, 0x30, 0x54, 0x31, 0x4b, 0x4b, 0x59, 0x2f, 0x65, 0x39, + 0x37, 0x67, 0x4b, 0x76, 0x44, 0x49, 0x72, 0x31, 0x4d, 0x76, 0x6e, 0x73, + 0x6f, 0x46, 0x41, 0x5a, 0x4d, 0x65, 0x6a, 0x32, 0x59, 0x63, 0x4f, 0x61, + 0x64, 0x4e, 0x0a, 0x2b, 0x6c, 0x71, 0x32, 0x63, 0x77, 0x51, 0x6c, 0x5a, + 0x75, 0x74, 0x33, 0x66, 0x2b, 0x64, 0x5a, 0x78, 0x6b, 0x71, 0x5a, 0x4a, + 0x52, 0x52, 0x55, 0x36, 0x79, 0x62, 0x48, 0x38, 0x33, 0x38, 0x5a, 0x31, + 0x54, 0x42, 0x77, 0x6a, 0x36, 0x2b, 0x77, 0x52, 0x69, 0x72, 0x2f, 0x72, + 0x65, 0x73, 0x70, 0x37, 0x64, 0x65, 0x66, 0x71, 0x67, 0x53, 0x48, 0x6f, + 0x39, 0x54, 0x35, 0x69, 0x61, 0x55, 0x30, 0x0a, 0x58, 0x39, 0x74, 0x44, + 0x6b, 0x59, 0x49, 0x32, 0x32, 0x57, 0x59, 0x38, 0x73, 0x62, 0x69, 0x35, + 0x67, 0x76, 0x32, 0x63, 0x4f, 0x6a, 0x34, 0x51, 0x79, 0x44, 0x76, 0x76, + 0x42, 0x6d, 0x56, 0x6d, 0x65, 0x70, 0x73, 0x5a, 0x47, 0x44, 0x33, 0x2f, + 0x63, 0x56, 0x45, 0x38, 0x4d, 0x43, 0x35, 0x66, 0x76, 0x6a, 0x31, 0x33, + 0x63, 0x37, 0x4a, 0x64, 0x42, 0x6d, 0x7a, 0x44, 0x49, 0x31, 0x61, 0x61, + 0x0a, 0x4b, 0x34, 0x55, 0x6d, 0x6b, 0x68, 0x79, 0x6e, 0x41, 0x72, 0x50, + 0x6b, 0x50, 0x77, 0x32, 0x76, 0x43, 0x48, 0x6d, 0x43, 0x75, 0x44, 0x59, + 0x39, 0x36, 0x70, 0x7a, 0x54, 0x4e, 0x62, 0x4f, 0x38, 0x61, 0x63, 0x72, + 0x31, 0x7a, 0x4a, 0x33, 0x6f, 0x2f, 0x57, 0x53, 0x4e, 0x46, 0x34, 0x41, + 0x7a, 0x62, 0x6c, 0x35, 0x4b, 0x58, 0x5a, 0x6e, 0x4a, 0x48, 0x6f, 0x65, + 0x30, 0x6e, 0x52, 0x72, 0x41, 0x0a, 0x31, 0x57, 0x34, 0x54, 0x4e, 0x53, + 0x4e, 0x65, 0x33, 0x35, 0x74, 0x66, 0x50, 0x65, 0x2f, 0x57, 0x39, 0x33, + 0x62, 0x43, 0x36, 0x6a, 0x36, 0x37, 0x65, 0x41, 0x30, 0x63, 0x51, 0x6d, + 0x64, 0x72, 0x42, 0x4e, 0x6a, 0x34, 0x31, 0x74, 0x70, 0x76, 0x69, 0x2f, + 0x4a, 0x45, 0x6f, 0x41, 0x47, 0x72, 0x41, 0x67, 0x45, 0x44, 0x6f, 0x34, + 0x48, 0x46, 0x4d, 0x49, 0x48, 0x43, 0x4d, 0x42, 0x30, 0x47, 0x0a, 0x41, + 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, 0x2f, 0x58, + 0x37, 0x66, 0x52, 0x7a, 0x74, 0x30, 0x66, 0x68, 0x76, 0x52, 0x62, 0x56, + 0x61, 0x7a, 0x63, 0x31, 0x78, 0x44, 0x43, 0x44, 0x71, 0x6d, 0x49, 0x35, + 0x7a, 0x43, 0x42, 0x6b, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, + 0x49, 0x47, 0x4b, 0x4d, 0x49, 0x47, 0x48, 0x67, 0x42, 0x53, 0x2f, 0x58, + 0x37, 0x66, 0x52, 0x0a, 0x7a, 0x74, 0x30, 0x66, 0x68, 0x76, 0x52, 0x62, + 0x56, 0x61, 0x7a, 0x63, 0x31, 0x78, 0x44, 0x43, 0x44, 0x71, 0x6d, 0x49, + 0x35, 0x36, 0x46, 0x73, 0x70, 0x47, 0x6f, 0x77, 0x61, 0x44, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x56, 0x56, 0x4d, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x6f, 0x54, 0x48, 0x46, 0x4e, 0x30, 0x0a, 0x59, 0x58, 0x4a, + 0x6d, 0x61, 0x57, 0x56, 0x73, 0x5a, 0x43, 0x42, 0x55, 0x5a, 0x57, 0x4e, + 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x62, 0x32, 0x64, 0x70, 0x5a, 0x58, 0x4d, + 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x4d, 0x6a, 0x41, + 0x77, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x4b, 0x56, 0x4e, + 0x30, 0x59, 0x58, 0x4a, 0x6d, 0x61, 0x57, 0x56, 0x73, 0x5a, 0x43, 0x42, + 0x44, 0x0a, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x41, 0x79, 0x49, 0x45, + 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, + 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, + 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x67, 0x67, 0x45, 0x41, 0x4d, 0x41, + 0x77, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x51, 0x46, 0x4d, 0x41, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x0a, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x41, 0x57, 0x64, 0x50, + 0x34, 0x69, 0x64, 0x30, 0x63, 0x6b, 0x61, 0x56, 0x61, 0x47, 0x73, 0x61, + 0x66, 0x50, 0x7a, 0x57, 0x64, 0x71, 0x62, 0x41, 0x59, 0x63, 0x61, 0x54, + 0x31, 0x65, 0x70, 0x6f, 0x58, 0x6b, 0x4a, 0x4b, 0x74, 0x76, 0x33, 0x0a, + 0x4c, 0x37, 0x49, 0x65, 0x7a, 0x4d, 0x64, 0x65, 0x61, 0x74, 0x69, 0x44, + 0x68, 0x36, 0x47, 0x58, 0x37, 0x30, 0x6b, 0x31, 0x50, 0x6e, 0x63, 0x47, + 0x51, 0x56, 0x68, 0x69, 0x76, 0x34, 0x35, 0x59, 0x75, 0x41, 0x70, 0x6e, + 0x50, 0x2b, 0x79, 0x7a, 0x33, 0x53, 0x46, 0x6d, 0x48, 0x38, 0x6c, 0x55, + 0x2b, 0x6e, 0x4c, 0x4d, 0x50, 0x55, 0x78, 0x41, 0x32, 0x49, 0x47, 0x76, + 0x64, 0x35, 0x36, 0x44, 0x0a, 0x65, 0x72, 0x75, 0x69, 0x78, 0x2f, 0x55, + 0x30, 0x46, 0x34, 0x37, 0x5a, 0x45, 0x55, 0x44, 0x30, 0x2f, 0x43, 0x77, + 0x71, 0x54, 0x52, 0x56, 0x2f, 0x70, 0x32, 0x4a, 0x64, 0x4c, 0x69, 0x58, + 0x54, 0x41, 0x41, 0x73, 0x67, 0x47, 0x68, 0x31, 0x6f, 0x2b, 0x52, 0x65, + 0x34, 0x39, 0x4c, 0x32, 0x4c, 0x37, 0x53, 0x68, 0x5a, 0x33, 0x55, 0x30, + 0x57, 0x69, 0x78, 0x65, 0x44, 0x79, 0x4c, 0x4a, 0x6c, 0x0a, 0x78, 0x79, + 0x31, 0x36, 0x70, 0x61, 0x71, 0x38, 0x55, 0x34, 0x5a, 0x74, 0x33, 0x56, + 0x65, 0x6b, 0x79, 0x76, 0x67, 0x67, 0x51, 0x51, 0x74, 0x6f, 0x38, 0x50, + 0x54, 0x37, 0x64, 0x4c, 0x35, 0x57, 0x58, 0x58, 0x70, 0x35, 0x39, 0x66, + 0x6b, 0x64, 0x68, 0x65, 0x4d, 0x74, 0x6c, 0x62, 0x37, 0x31, 0x63, 0x5a, + 0x42, 0x44, 0x7a, 0x49, 0x30, 0x66, 0x6d, 0x67, 0x41, 0x4b, 0x68, 0x79, + 0x6e, 0x70, 0x0a, 0x56, 0x53, 0x4a, 0x59, 0x41, 0x43, 0x50, 0x71, 0x34, + 0x78, 0x4a, 0x44, 0x4b, 0x56, 0x74, 0x48, 0x43, 0x4e, 0x32, 0x4d, 0x51, + 0x57, 0x70, 0x6c, 0x42, 0x71, 0x6a, 0x6c, 0x49, 0x61, 0x70, 0x42, 0x74, + 0x4a, 0x55, 0x68, 0x6c, 0x62, 0x6c, 0x39, 0x30, 0x54, 0x53, 0x72, 0x45, + 0x39, 0x61, 0x74, 0x76, 0x4e, 0x7a, 0x69, 0x50, 0x54, 0x6e, 0x4e, 0x76, + 0x54, 0x35, 0x31, 0x63, 0x4b, 0x45, 0x59, 0x0a, 0x57, 0x51, 0x50, 0x4a, + 0x49, 0x72, 0x53, 0x50, 0x6e, 0x4e, 0x56, 0x65, 0x4b, 0x74, 0x65, 0x6c, + 0x74, 0x74, 0x51, 0x4b, 0x62, 0x66, 0x69, 0x33, 0x51, 0x42, 0x46, 0x47, + 0x6d, 0x68, 0x39, 0x35, 0x44, 0x6d, 0x4b, 0x2f, 0x44, 0x35, 0x66, 0x73, + 0x34, 0x43, 0x38, 0x66, 0x46, 0x35, 0x51, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x4f, 0x3d, + 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x4f, 0x3d, 0x47, 0x6f, 0x76, 0x65, 0x72, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x61, 0x69, 0x77, 0x61, + 0x6e, 0x20, 0x47, 0x52, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x32, 0x30, 0x32, 0x33, 0x30, + 0x37, 0x30, 0x38, 0x30, 0x37, 0x37, 0x30, 0x38, 0x37, 0x32, 0x34, 0x31, + 0x35, 0x39, 0x39, 0x39, 0x31, 0x31, 0x34, 0x30, 0x35, 0x35, 0x36, 0x35, + 0x32, 0x37, 0x30, 0x36, 0x36, 0x38, 0x37, 0x30, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x37, 0x3a, 0x38, 0x35, 0x3a, 0x34, 0x34, + 0x3a, 0x35, 0x33, 0x3a, 0x33, 0x32, 0x3a, 0x34, 0x35, 0x3a, 0x31, 0x66, + 0x3a, 0x32, 0x30, 0x3a, 0x66, 0x30, 0x3a, 0x66, 0x33, 0x3a, 0x39, 0x35, + 0x3a, 0x65, 0x31, 0x3a, 0x32, 0x35, 0x3a, 0x63, 0x34, 0x3a, 0x34, 0x33, + 0x3a, 0x34, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x66, 0x34, 0x3a, 0x38, 0x62, 0x3a, 0x31, 0x31, 0x3a, 0x62, 0x66, 0x3a, + 0x64, 0x65, 0x3a, 0x61, 0x62, 0x3a, 0x62, 0x65, 0x3a, 0x39, 0x34, 0x3a, + 0x35, 0x34, 0x3a, 0x32, 0x30, 0x3a, 0x37, 0x31, 0x3a, 0x65, 0x36, 0x3a, + 0x34, 0x31, 0x3a, 0x64, 0x65, 0x3a, 0x36, 0x62, 0x3a, 0x62, 0x65, 0x3a, + 0x38, 0x38, 0x3a, 0x32, 0x62, 0x3a, 0x34, 0x30, 0x3a, 0x62, 0x39, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x36, + 0x3a, 0x30, 0x30, 0x3a, 0x32, 0x39, 0x3a, 0x35, 0x65, 0x3a, 0x65, 0x66, + 0x3a, 0x65, 0x38, 0x3a, 0x35, 0x62, 0x3a, 0x39, 0x65, 0x3a, 0x31, 0x66, + 0x3a, 0x64, 0x36, 0x3a, 0x32, 0x34, 0x3a, 0x64, 0x62, 0x3a, 0x37, 0x36, + 0x3a, 0x30, 0x36, 0x3a, 0x32, 0x61, 0x3a, 0x61, 0x61, 0x3a, 0x61, 0x65, + 0x3a, 0x35, 0x39, 0x3a, 0x38, 0x31, 0x3a, 0x38, 0x61, 0x3a, 0x35, 0x34, + 0x3a, 0x64, 0x32, 0x3a, 0x37, 0x37, 0x3a, 0x34, 0x63, 0x3a, 0x64, 0x34, + 0x3a, 0x63, 0x30, 0x3a, 0x62, 0x32, 0x3a, 0x63, 0x30, 0x3a, 0x31, 0x31, + 0x3a, 0x33, 0x31, 0x3a, 0x65, 0x31, 0x3a, 0x62, 0x33, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x63, 0x6a, 0x43, 0x43, 0x41, 0x31, + 0x71, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x48, 0x35, + 0x31, 0x5a, 0x57, 0x74, 0x63, 0x76, 0x77, 0x67, 0x5a, 0x45, 0x70, 0x59, + 0x41, 0x49, 0x61, 0x65, 0x4e, 0x65, 0x39, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x55, 0x46, 0x41, 0x44, 0x41, 0x2f, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x55, 0x56, + 0x7a, 0x45, 0x77, 0x4d, 0x43, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x67, 0x77, 0x6e, 0x52, 0x32, 0x39, 0x32, 0x5a, 0x58, 0x4a, 0x75, 0x62, + 0x57, 0x56, 0x75, 0x64, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, + 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x0a, + 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, + 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x42, 0x34, 0x58, + 0x44, 0x54, 0x41, 0x79, 0x4d, 0x54, 0x49, 0x77, 0x4e, 0x54, 0x45, 0x7a, + 0x4d, 0x6a, 0x4d, 0x7a, 0x4d, 0x31, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x79, + 0x4d, 0x54, 0x49, 0x77, 0x4e, 0x54, 0x45, 0x7a, 0x4d, 0x6a, 0x4d, 0x7a, + 0x4d, 0x31, 0x6f, 0x77, 0x0a, 0x50, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x46, 0x63, + 0x78, 0x4d, 0x44, 0x41, 0x75, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x4d, 0x4a, 0x30, 0x64, 0x76, 0x64, 0x6d, 0x56, 0x79, 0x62, 0x6d, 0x31, + 0x6c, 0x62, 0x6e, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, + 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x0a, 0x59, 0x32, + 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, + 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x43, 0x43, 0x41, 0x69, + 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x49, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, + 0x49, 0x42, 0x0a, 0x41, 0x4a, 0x6f, 0x6c, 0x75, 0x4f, 0x7a, 0x4d, 0x6f, + 0x6e, 0x57, 0x6f, 0x65, 0x2f, 0x66, 0x4f, 0x57, 0x31, 0x6d, 0x4b, 0x79, + 0x64, 0x47, 0x47, 0x45, 0x67, 0x68, 0x55, 0x37, 0x4a, 0x7a, 0x79, 0x35, + 0x30, 0x62, 0x32, 0x69, 0x50, 0x4e, 0x38, 0x36, 0x61, 0x58, 0x66, 0x54, + 0x45, 0x63, 0x32, 0x70, 0x42, 0x73, 0x42, 0x48, 0x48, 0x38, 0x65, 0x56, + 0x34, 0x71, 0x4e, 0x77, 0x38, 0x58, 0x52, 0x0a, 0x49, 0x65, 0x50, 0x61, + 0x4a, 0x44, 0x39, 0x49, 0x4b, 0x2f, 0x75, 0x66, 0x4c, 0x71, 0x47, 0x55, + 0x35, 0x79, 0x77, 0x63, 0x6b, 0x39, 0x47, 0x2f, 0x47, 0x77, 0x47, 0x48, + 0x55, 0x35, 0x6e, 0x4f, 0x70, 0x2f, 0x55, 0x4b, 0x49, 0x58, 0x5a, 0x33, + 0x2f, 0x36, 0x6d, 0x33, 0x78, 0x6e, 0x4f, 0x55, 0x54, 0x30, 0x62, 0x33, + 0x45, 0x45, 0x6b, 0x33, 0x2b, 0x71, 0x68, 0x5a, 0x53, 0x56, 0x31, 0x71, + 0x0a, 0x67, 0x51, 0x64, 0x57, 0x38, 0x6f, 0x72, 0x35, 0x42, 0x74, 0x44, + 0x33, 0x63, 0x43, 0x4a, 0x4e, 0x74, 0x4c, 0x64, 0x42, 0x75, 0x54, 0x4b, + 0x34, 0x73, 0x66, 0x43, 0x78, 0x77, 0x35, 0x77, 0x2f, 0x63, 0x50, 0x31, + 0x54, 0x33, 0x59, 0x47, 0x71, 0x32, 0x47, 0x4e, 0x34, 0x39, 0x74, 0x68, + 0x54, 0x62, 0x71, 0x47, 0x73, 0x61, 0x6f, 0x51, 0x6b, 0x63, 0x6c, 0x53, + 0x47, 0x78, 0x74, 0x4b, 0x79, 0x0a, 0x79, 0x68, 0x77, 0x4f, 0x65, 0x59, + 0x48, 0x57, 0x74, 0x58, 0x42, 0x69, 0x43, 0x41, 0x45, 0x75, 0x54, 0x6b, + 0x38, 0x4f, 0x31, 0x52, 0x47, 0x76, 0x71, 0x61, 0x2f, 0x6c, 0x6d, 0x72, + 0x2f, 0x63, 0x7a, 0x49, 0x64, 0x74, 0x4a, 0x75, 0x54, 0x4a, 0x56, 0x36, + 0x4c, 0x37, 0x6c, 0x76, 0x6e, 0x4d, 0x34, 0x54, 0x39, 0x54, 0x6a, 0x47, + 0x78, 0x4d, 0x66, 0x70, 0x74, 0x54, 0x43, 0x41, 0x74, 0x73, 0x0a, 0x46, + 0x2f, 0x74, 0x6e, 0x79, 0x4d, 0x4b, 0x74, 0x73, 0x63, 0x32, 0x41, 0x74, + 0x4a, 0x66, 0x63, 0x64, 0x67, 0x45, 0x57, 0x46, 0x65, 0x6c, 0x71, 0x31, + 0x36, 0x54, 0x68, 0x65, 0x45, 0x66, 0x4f, 0x68, 0x74, 0x58, 0x37, 0x4d, + 0x66, 0x50, 0x36, 0x4d, 0x62, 0x34, 0x30, 0x71, 0x69, 0x6a, 0x37, 0x63, + 0x45, 0x77, 0x64, 0x53, 0x63, 0x65, 0x76, 0x4c, 0x4a, 0x31, 0x74, 0x5a, + 0x71, 0x61, 0x32, 0x0a, 0x6a, 0x57, 0x52, 0x2b, 0x74, 0x53, 0x42, 0x71, + 0x6e, 0x54, 0x75, 0x42, 0x74, 0x6f, 0x39, 0x41, 0x41, 0x47, 0x64, 0x4c, + 0x69, 0x59, 0x61, 0x34, 0x7a, 0x47, 0x58, 0x2b, 0x46, 0x56, 0x50, 0x70, + 0x42, 0x4d, 0x48, 0x57, 0x58, 0x78, 0x31, 0x45, 0x31, 0x77, 0x6f, 0x76, + 0x4a, 0x35, 0x70, 0x47, 0x66, 0x61, 0x45, 0x4e, 0x64, 0x61, 0x31, 0x55, + 0x68, 0x68, 0x58, 0x63, 0x53, 0x54, 0x76, 0x78, 0x0a, 0x6c, 0x73, 0x34, + 0x50, 0x6d, 0x36, 0x44, 0x73, 0x6f, 0x33, 0x70, 0x64, 0x76, 0x74, 0x55, + 0x71, 0x64, 0x55, 0x4c, 0x6c, 0x65, 0x39, 0x36, 0x6c, 0x74, 0x71, 0x71, + 0x76, 0x4b, 0x4b, 0x79, 0x73, 0x6b, 0x4b, 0x77, 0x34, 0x74, 0x39, 0x56, + 0x6f, 0x4e, 0x53, 0x5a, 0x36, 0x33, 0x50, 0x63, 0x37, 0x38, 0x2f, 0x31, + 0x46, 0x6d, 0x39, 0x47, 0x37, 0x51, 0x33, 0x68, 0x75, 0x62, 0x2f, 0x46, + 0x43, 0x0a, 0x56, 0x47, 0x71, 0x59, 0x38, 0x41, 0x32, 0x74, 0x6c, 0x2b, + 0x6c, 0x53, 0x58, 0x75, 0x6e, 0x56, 0x61, 0x6e, 0x4c, 0x65, 0x61, 0x76, + 0x63, 0x62, 0x59, 0x42, 0x54, 0x30, 0x70, 0x65, 0x53, 0x32, 0x63, 0x57, + 0x65, 0x71, 0x48, 0x2b, 0x72, 0x69, 0x54, 0x63, 0x46, 0x43, 0x51, 0x50, + 0x35, 0x6e, 0x52, 0x68, 0x63, 0x34, 0x4c, 0x30, 0x63, 0x2f, 0x63, 0x5a, + 0x79, 0x75, 0x35, 0x53, 0x48, 0x4b, 0x0a, 0x59, 0x53, 0x31, 0x74, 0x42, + 0x36, 0x69, 0x45, 0x66, 0x43, 0x33, 0x75, 0x55, 0x53, 0x58, 0x78, 0x59, + 0x35, 0x43, 0x65, 0x2f, 0x65, 0x46, 0x58, 0x69, 0x47, 0x76, 0x76, 0x69, + 0x69, 0x4e, 0x74, 0x73, 0x65, 0x61, 0x39, 0x50, 0x36, 0x33, 0x52, 0x50, + 0x5a, 0x59, 0x4c, 0x68, 0x59, 0x33, 0x4e, 0x61, 0x79, 0x65, 0x37, 0x74, + 0x77, 0x57, 0x62, 0x37, 0x4c, 0x75, 0x52, 0x71, 0x51, 0x6f, 0x48, 0x0a, + 0x45, 0x67, 0x4b, 0x58, 0x54, 0x69, 0x43, 0x51, 0x38, 0x50, 0x38, 0x4e, + 0x48, 0x75, 0x4a, 0x42, 0x4f, 0x39, 0x4e, 0x41, 0x4f, 0x75, 0x65, 0x4e, + 0x58, 0x64, 0x70, 0x6d, 0x35, 0x41, 0x4b, 0x77, 0x42, 0x31, 0x4b, 0x59, + 0x58, 0x41, 0x36, 0x4f, 0x4d, 0x35, 0x7a, 0x43, 0x70, 0x70, 0x58, 0x37, + 0x56, 0x52, 0x6c, 0x75, 0x54, 0x49, 0x36, 0x75, 0x53, 0x77, 0x2b, 0x39, + 0x77, 0x54, 0x68, 0x4e, 0x0a, 0x58, 0x6f, 0x2b, 0x45, 0x48, 0x57, 0x62, + 0x4e, 0x78, 0x57, 0x43, 0x57, 0x74, 0x46, 0x4a, 0x61, 0x42, 0x59, 0x6d, + 0x4f, 0x6c, 0x58, 0x71, 0x59, 0x77, 0x5a, 0x45, 0x38, 0x6c, 0x53, 0x4f, + 0x79, 0x44, 0x76, 0x52, 0x35, 0x74, 0x4d, 0x6c, 0x38, 0x77, 0x55, 0x6f, + 0x68, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x61, 0x6a, 0x42, + 0x6f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x0a, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x54, 0x4d, 0x7a, 0x4f, 0x2f, 0x4d, 0x4b, 0x57, + 0x43, 0x6b, 0x4f, 0x37, 0x47, 0x53, 0x74, 0x6a, 0x7a, 0x36, 0x4d, 0x6d, + 0x4b, 0x50, 0x72, 0x43, 0x55, 0x56, 0x4f, 0x7a, 0x41, 0x4d, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, + 0x48, 0x2f, 0x4d, 0x44, 0x6b, 0x47, 0x42, 0x47, 0x63, 0x71, 0x42, 0x77, + 0x41, 0x45, 0x0a, 0x4d, 0x54, 0x41, 0x76, 0x4d, 0x43, 0x30, 0x43, 0x41, + 0x51, 0x41, 0x77, 0x43, 0x51, 0x59, 0x46, 0x4b, 0x77, 0x34, 0x44, 0x41, + 0x68, 0x6f, 0x46, 0x41, 0x44, 0x41, 0x48, 0x42, 0x67, 0x56, 0x6e, 0x4b, + 0x67, 0x4d, 0x41, 0x41, 0x41, 0x51, 0x55, 0x41, 0x35, 0x76, 0x77, 0x49, + 0x68, 0x50, 0x2f, 0x6c, 0x53, 0x67, 0x32, 0x30, 0x39, 0x79, 0x65, 0x77, + 0x44, 0x4c, 0x37, 0x4d, 0x54, 0x71, 0x4b, 0x0a, 0x55, 0x57, 0x55, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, + 0x41, 0x45, 0x43, 0x41, 0x53, 0x76, 0x6f, 0x6d, 0x79, 0x63, 0x35, 0x65, + 0x4d, 0x4e, 0x31, 0x50, 0x68, 0x6e, 0x52, 0x32, 0x57, 0x50, 0x57, 0x75, + 0x73, 0x34, 0x4d, 0x7a, 0x65, 0x4b, 0x52, 0x36, 0x64, 0x42, 0x63, 0x5a, + 0x0a, 0x54, 0x75, 0x6c, 0x53, 0x74, 0x62, 0x6e, 0x67, 0x43, 0x6e, 0x52, + 0x69, 0x71, 0x6d, 0x6a, 0x4b, 0x65, 0x4b, 0x42, 0x4d, 0x6d, 0x6f, 0x34, + 0x73, 0x49, 0x79, 0x37, 0x56, 0x61, 0x68, 0x49, 0x6b, 0x76, 0x39, 0x52, + 0x6f, 0x30, 0x34, 0x72, 0x51, 0x32, 0x4a, 0x79, 0x66, 0x74, 0x42, 0x38, + 0x4d, 0x33, 0x6a, 0x68, 0x2b, 0x56, 0x7a, 0x6a, 0x38, 0x6a, 0x65, 0x4a, + 0x50, 0x58, 0x67, 0x79, 0x66, 0x0a, 0x71, 0x7a, 0x76, 0x53, 0x2f, 0x33, + 0x57, 0x58, 0x79, 0x36, 0x54, 0x6a, 0x5a, 0x77, 0x6a, 0x2f, 0x35, 0x63, + 0x41, 0x57, 0x74, 0x55, 0x67, 0x42, 0x66, 0x65, 0x6e, 0x35, 0x43, 0x76, + 0x38, 0x62, 0x35, 0x57, 0x70, 0x70, 0x76, 0x33, 0x67, 0x68, 0x71, 0x4d, + 0x4b, 0x6e, 0x49, 0x36, 0x6d, 0x47, 0x71, 0x33, 0x5a, 0x57, 0x36, 0x41, + 0x34, 0x4d, 0x39, 0x68, 0x50, 0x64, 0x4b, 0x6d, 0x61, 0x4b, 0x0a, 0x5a, + 0x45, 0x6b, 0x39, 0x47, 0x68, 0x69, 0x48, 0x6b, 0x41, 0x53, 0x66, 0x51, + 0x6c, 0x4b, 0x33, 0x54, 0x38, 0x76, 0x2b, 0x52, 0x30, 0x46, 0x32, 0x4e, + 0x65, 0x2f, 0x2f, 0x41, 0x48, 0x59, 0x32, 0x52, 0x54, 0x4b, 0x62, 0x78, + 0x6b, 0x61, 0x46, 0x58, 0x65, 0x49, 0x6b, 0x73, 0x42, 0x37, 0x6a, 0x53, + 0x4a, 0x61, 0x59, 0x56, 0x30, 0x65, 0x55, 0x56, 0x58, 0x6f, 0x50, 0x51, + 0x62, 0x46, 0x45, 0x0a, 0x4a, 0x50, 0x50, 0x42, 0x2f, 0x68, 0x70, 0x72, + 0x76, 0x34, 0x6a, 0x39, 0x77, 0x61, 0x62, 0x61, 0x6b, 0x32, 0x42, 0x65, + 0x67, 0x55, 0x71, 0x5a, 0x49, 0x4a, 0x78, 0x49, 0x5a, 0x68, 0x6d, 0x31, + 0x41, 0x48, 0x6c, 0x55, 0x44, 0x37, 0x67, 0x73, 0x4c, 0x30, 0x75, 0x38, + 0x71, 0x56, 0x31, 0x62, 0x59, 0x48, 0x2b, 0x4d, 0x68, 0x36, 0x58, 0x67, + 0x55, 0x6d, 0x4d, 0x71, 0x76, 0x74, 0x67, 0x37, 0x0a, 0x68, 0x55, 0x41, + 0x56, 0x2f, 0x68, 0x36, 0x32, 0x5a, 0x54, 0x2f, 0x46, 0x53, 0x39, 0x70, + 0x2b, 0x74, 0x58, 0x6f, 0x31, 0x4b, 0x61, 0x4d, 0x75, 0x65, 0x70, 0x68, + 0x67, 0x49, 0x71, 0x50, 0x30, 0x66, 0x53, 0x64, 0x4f, 0x4c, 0x65, 0x71, + 0x30, 0x64, 0x44, 0x7a, 0x70, 0x44, 0x36, 0x51, 0x7a, 0x44, 0x78, 0x41, + 0x52, 0x76, 0x42, 0x4d, 0x42, 0x31, 0x75, 0x55, 0x4f, 0x30, 0x37, 0x2b, + 0x31, 0x0a, 0x45, 0x71, 0x4c, 0x68, 0x52, 0x53, 0x50, 0x41, 0x7a, 0x41, + 0x68, 0x75, 0x59, 0x62, 0x65, 0x4a, 0x71, 0x34, 0x50, 0x6a, 0x4a, 0x42, + 0x37, 0x6d, 0x58, 0x51, 0x66, 0x6e, 0x48, 0x79, 0x41, 0x2b, 0x7a, 0x32, + 0x66, 0x49, 0x35, 0x36, 0x77, 0x77, 0x62, 0x53, 0x64, 0x4c, 0x61, 0x47, + 0x35, 0x4c, 0x4b, 0x6c, 0x77, 0x43, 0x43, 0x44, 0x54, 0x62, 0x2b, 0x48, + 0x62, 0x6b, 0x5a, 0x36, 0x4d, 0x6d, 0x0a, 0x6e, 0x44, 0x2b, 0x69, 0x4d, + 0x73, 0x4a, 0x4b, 0x78, 0x59, 0x45, 0x59, 0x4d, 0x52, 0x42, 0x57, 0x71, + 0x6f, 0x54, 0x76, 0x4c, 0x51, 0x72, 0x2f, 0x75, 0x42, 0x39, 0x33, 0x30, + 0x72, 0x2b, 0x6c, 0x57, 0x4b, 0x42, 0x69, 0x35, 0x4e, 0x64, 0x4c, 0x6b, + 0x58, 0x57, 0x4e, 0x69, 0x59, 0x43, 0x59, 0x66, 0x6d, 0x33, 0x4c, 0x55, + 0x30, 0x35, 0x65, 0x72, 0x2f, 0x61, 0x79, 0x6c, 0x34, 0x57, 0x58, 0x0a, + 0x75, 0x64, 0x70, 0x56, 0x42, 0x72, 0x6b, 0x6b, 0x37, 0x74, 0x66, 0x47, + 0x4f, 0x42, 0x35, 0x6a, 0x47, 0x78, 0x49, 0x37, 0x6c, 0x65, 0x46, 0x59, + 0x72, 0x50, 0x4c, 0x66, 0x68, 0x4e, 0x56, 0x66, 0x6d, 0x53, 0x38, 0x4e, + 0x56, 0x56, 0x76, 0x6d, 0x4f, 0x4e, 0x73, 0x75, 0x50, 0x33, 0x4c, 0x70, + 0x53, 0x49, 0x58, 0x4c, 0x75, 0x79, 0x6b, 0x54, 0x6a, 0x78, 0x34, 0x34, + 0x56, 0x62, 0x6e, 0x7a, 0x0a, 0x73, 0x73, 0x51, 0x77, 0x6d, 0x53, 0x4e, + 0x4f, 0x58, 0x66, 0x4a, 0x49, 0x6f, 0x52, 0x49, 0x4d, 0x33, 0x42, 0x4b, + 0x51, 0x43, 0x5a, 0x42, 0x55, 0x6b, 0x51, 0x4d, 0x38, 0x52, 0x2b, 0x58, + 0x56, 0x79, 0x57, 0x58, 0x67, 0x74, 0x30, 0x74, 0x39, 0x37, 0x45, 0x66, + 0x54, 0x73, 0x77, 0x73, 0x2b, 0x72, 0x5a, 0x37, 0x51, 0x64, 0x41, 0x41, + 0x4f, 0x36, 0x37, 0x31, 0x52, 0x72, 0x63, 0x44, 0x65, 0x0a, 0x4c, 0x4d, + 0x44, 0x44, 0x61, 0x76, 0x37, 0x76, 0x33, 0x41, 0x75, 0x6e, 0x2b, 0x6b, + 0x62, 0x66, 0x59, 0x4e, 0x75, 0x63, 0x70, 0x6c, 0x6c, 0x51, 0x64, 0x53, + 0x4e, 0x70, 0x63, 0x35, 0x4f, 0x79, 0x2b, 0x66, 0x77, 0x43, 0x30, 0x30, + 0x66, 0x6d, 0x63, 0x63, 0x34, 0x51, 0x41, 0x75, 0x34, 0x6e, 0x6a, 0x49, + 0x54, 0x2f, 0x72, 0x45, 0x55, 0x4e, 0x45, 0x31, 0x79, 0x44, 0x4d, 0x75, + 0x41, 0x6c, 0x0a, 0x70, 0x59, 0x59, 0x73, 0x66, 0x50, 0x51, 0x53, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, + 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, 0x64, 0x20, 0x49, 0x44, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, + 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, + 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, + 0x64, 0x20, 0x49, 0x44, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, + 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, + 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, + 0x65, 0x64, 0x20, 0x49, 0x44, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x31, 0x37, 0x31, 0x35, 0x34, 0x37, 0x31, 0x37, 0x39, 0x33, 0x34, + 0x31, 0x32, 0x30, 0x35, 0x38, 0x37, 0x38, 0x36, 0x32, 0x31, 0x36, 0x37, + 0x37, 0x39, 0x34, 0x39, 0x31, 0x34, 0x30, 0x37, 0x31, 0x34, 0x32, 0x35, + 0x30, 0x38, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, + 0x37, 0x3a, 0x63, 0x65, 0x3a, 0x30, 0x62, 0x3a, 0x37, 0x62, 0x3a, 0x32, + 0x61, 0x3a, 0x30, 0x65, 0x3a, 0x34, 0x39, 0x3a, 0x30, 0x30, 0x3a, 0x65, + 0x31, 0x3a, 0x35, 0x38, 0x3a, 0x37, 0x31, 0x3a, 0x39, 0x62, 0x3a, 0x33, + 0x37, 0x3a, 0x61, 0x38, 0x3a, 0x39, 0x33, 0x3a, 0x37, 0x32, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x35, 0x3a, 0x36, 0x33, + 0x3a, 0x62, 0x38, 0x3a, 0x36, 0x33, 0x3a, 0x30, 0x64, 0x3a, 0x36, 0x32, + 0x3a, 0x64, 0x37, 0x3a, 0x35, 0x61, 0x3a, 0x62, 0x62, 0x3a, 0x63, 0x38, + 0x3a, 0x61, 0x62, 0x3a, 0x31, 0x65, 0x3a, 0x34, 0x62, 0x3a, 0x64, 0x66, + 0x3a, 0x62, 0x35, 0x3a, 0x61, 0x38, 0x3a, 0x39, 0x39, 0x3a, 0x62, 0x32, + 0x3a, 0x34, 0x64, 0x3a, 0x34, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x65, 0x3a, 0x39, 0x30, 0x3a, 0x39, + 0x39, 0x3a, 0x62, 0x35, 0x3a, 0x30, 0x31, 0x3a, 0x35, 0x65, 0x3a, 0x38, + 0x66, 0x3a, 0x34, 0x38, 0x3a, 0x36, 0x63, 0x3a, 0x30, 0x30, 0x3a, 0x62, + 0x63, 0x3a, 0x65, 0x61, 0x3a, 0x39, 0x64, 0x3a, 0x31, 0x31, 0x3a, 0x31, + 0x65, 0x3a, 0x65, 0x37, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x61, 0x3a, 0x62, + 0x61, 0x3a, 0x33, 0x35, 0x3a, 0x35, 0x61, 0x3a, 0x38, 0x39, 0x3a, 0x62, + 0x63, 0x3a, 0x66, 0x31, 0x3a, 0x64, 0x66, 0x3a, 0x36, 0x39, 0x3a, 0x35, + 0x36, 0x3a, 0x31, 0x65, 0x3a, 0x33, 0x64, 0x3a, 0x63, 0x36, 0x3a, 0x33, + 0x32, 0x3a, 0x35, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x44, 0x74, 0x7a, 0x43, 0x43, 0x41, 0x70, 0x2b, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x51, 0x44, 0x4f, 0x66, 0x67, 0x35, 0x52, 0x66, + 0x59, 0x52, 0x76, 0x36, 0x50, 0x35, 0x57, 0x44, 0x38, 0x47, 0x2f, 0x41, + 0x77, 0x4f, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, + 0x6c, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, + 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, 0x47, + 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x57, + 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x0a, 0x64, 0x33, 0x63, 0x75, 0x5a, + 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x59, + 0x32, 0x39, 0x74, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x44, 0x45, 0x78, 0x74, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, + 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x42, 0x63, 0x33, 0x4e, 0x31, 0x63, + 0x6d, 0x56, 0x6b, 0x49, 0x45, 0x6c, 0x45, 0x49, 0x46, 0x4a, 0x76, 0x0a, + 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, + 0x4d, 0x44, 0x59, 0x78, 0x4d, 0x54, 0x45, 0x77, 0x4d, 0x44, 0x41, 0x77, + 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x45, 0x78, + 0x4d, 0x54, 0x45, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, + 0x57, 0x6a, 0x42, 0x6c, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, + 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, + 0x4d, 0x52, 0x47, 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, + 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x64, 0x33, 0x63, + 0x75, 0x5a, 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x0a, 0x63, 0x6e, + 0x51, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x74, 0x45, 0x61, 0x57, + 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x42, 0x63, 0x33, + 0x4e, 0x31, 0x63, 0x6d, 0x56, 0x6b, 0x49, 0x45, 0x6c, 0x45, 0x49, 0x46, + 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x77, 0x67, 0x67, + 0x45, 0x69, 0x0a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, + 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, 0x74, 0x44, 0x68, 0x58, 0x4f, 0x35, + 0x45, 0x4f, 0x41, 0x58, 0x4c, 0x47, 0x48, 0x38, 0x37, 0x64, 0x67, 0x2b, + 0x58, 0x45, 0x53, 0x70, 0x61, 0x37, 0x63, 0x0a, 0x4a, 0x70, 0x53, 0x49, + 0x71, 0x76, 0x54, 0x4f, 0x39, 0x53, 0x41, 0x35, 0x4b, 0x46, 0x68, 0x67, + 0x44, 0x50, 0x69, 0x41, 0x32, 0x71, 0x6b, 0x56, 0x6c, 0x54, 0x4a, 0x68, + 0x50, 0x4c, 0x57, 0x78, 0x4b, 0x49, 0x53, 0x4b, 0x69, 0x74, 0x79, 0x66, + 0x43, 0x67, 0x79, 0x44, 0x46, 0x33, 0x71, 0x50, 0x6b, 0x4b, 0x79, 0x4b, + 0x35, 0x33, 0x6c, 0x54, 0x58, 0x44, 0x47, 0x45, 0x4b, 0x76, 0x59, 0x50, + 0x0a, 0x6d, 0x44, 0x49, 0x32, 0x64, 0x73, 0x7a, 0x65, 0x33, 0x54, 0x79, + 0x6f, 0x6f, 0x75, 0x39, 0x71, 0x2b, 0x79, 0x48, 0x79, 0x55, 0x6d, 0x48, + 0x66, 0x6e, 0x79, 0x44, 0x58, 0x48, 0x2b, 0x4b, 0x78, 0x32, 0x66, 0x34, + 0x59, 0x5a, 0x4e, 0x49, 0x53, 0x57, 0x31, 0x2f, 0x35, 0x57, 0x42, 0x67, + 0x31, 0x76, 0x45, 0x66, 0x4e, 0x6f, 0x54, 0x62, 0x35, 0x61, 0x33, 0x2f, + 0x55, 0x73, 0x44, 0x67, 0x2b, 0x0a, 0x77, 0x52, 0x76, 0x44, 0x6a, 0x44, + 0x50, 0x5a, 0x32, 0x43, 0x38, 0x59, 0x2f, 0x69, 0x67, 0x50, 0x73, 0x36, + 0x65, 0x44, 0x31, 0x73, 0x4e, 0x75, 0x52, 0x4d, 0x42, 0x68, 0x4e, 0x5a, + 0x59, 0x57, 0x2f, 0x6c, 0x6d, 0x63, 0x69, 0x33, 0x5a, 0x74, 0x31, 0x2f, + 0x47, 0x69, 0x53, 0x77, 0x30, 0x72, 0x2f, 0x77, 0x74, 0x79, 0x32, 0x70, + 0x35, 0x67, 0x30, 0x49, 0x36, 0x51, 0x4e, 0x63, 0x5a, 0x34, 0x0a, 0x56, + 0x59, 0x63, 0x67, 0x6f, 0x63, 0x2f, 0x6c, 0x62, 0x51, 0x72, 0x49, 0x53, + 0x58, 0x77, 0x78, 0x6d, 0x44, 0x4e, 0x73, 0x49, 0x75, 0x6d, 0x48, 0x30, + 0x44, 0x4a, 0x61, 0x6f, 0x72, 0x6f, 0x54, 0x67, 0x68, 0x48, 0x74, 0x4f, + 0x52, 0x65, 0x64, 0x6d, 0x54, 0x70, 0x79, 0x6f, 0x65, 0x62, 0x36, 0x70, + 0x4e, 0x6e, 0x56, 0x46, 0x7a, 0x46, 0x31, 0x72, 0x6f, 0x56, 0x39, 0x49, + 0x71, 0x34, 0x2f, 0x0a, 0x41, 0x55, 0x61, 0x47, 0x39, 0x69, 0x68, 0x35, + 0x79, 0x4c, 0x48, 0x61, 0x35, 0x46, 0x63, 0x58, 0x78, 0x48, 0x34, 0x63, + 0x44, 0x72, 0x43, 0x30, 0x6b, 0x71, 0x5a, 0x57, 0x73, 0x37, 0x32, 0x79, + 0x6c, 0x2b, 0x32, 0x71, 0x70, 0x2f, 0x43, 0x33, 0x78, 0x61, 0x67, 0x2f, + 0x6c, 0x52, 0x62, 0x51, 0x2f, 0x36, 0x47, 0x57, 0x36, 0x77, 0x68, 0x66, + 0x47, 0x48, 0x64, 0x50, 0x41, 0x67, 0x4d, 0x42, 0x0a, 0x41, 0x41, 0x47, + 0x6a, 0x59, 0x7a, 0x42, 0x68, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x68, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, + 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, + 0x57, 0x0a, 0x42, 0x42, 0x52, 0x46, 0x36, 0x36, 0x4b, 0x76, 0x39, 0x4a, + 0x4c, 0x4c, 0x67, 0x6a, 0x45, 0x74, 0x55, 0x59, 0x75, 0x6e, 0x70, 0x79, + 0x47, 0x64, 0x38, 0x32, 0x33, 0x49, 0x44, 0x7a, 0x41, 0x66, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, + 0x52, 0x46, 0x36, 0x36, 0x4b, 0x76, 0x39, 0x4a, 0x4c, 0x4c, 0x67, 0x6a, + 0x45, 0x74, 0x55, 0x59, 0x75, 0x6e, 0x0a, 0x70, 0x79, 0x47, 0x64, 0x38, + 0x32, 0x33, 0x49, 0x44, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, + 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x6f, 0x67, 0x36, 0x38, 0x33, + 0x2b, 0x4c, 0x74, 0x38, 0x4f, 0x4e, 0x79, 0x63, 0x33, 0x70, 0x6b, 0x6c, + 0x4c, 0x2f, 0x33, 0x63, 0x6d, 0x62, 0x59, 0x4d, 0x75, 0x52, 0x43, 0x0a, + 0x64, 0x57, 0x4b, 0x75, 0x68, 0x2b, 0x76, 0x79, 0x31, 0x64, 0x6e, 0x65, + 0x56, 0x72, 0x4f, 0x66, 0x7a, 0x4d, 0x34, 0x55, 0x4b, 0x4c, 0x6b, 0x4e, + 0x6c, 0x32, 0x42, 0x63, 0x45, 0x6b, 0x78, 0x59, 0x35, 0x4e, 0x4d, 0x39, + 0x67, 0x30, 0x6c, 0x46, 0x57, 0x4a, 0x63, 0x31, 0x61, 0x52, 0x71, 0x6f, + 0x52, 0x2b, 0x70, 0x57, 0x78, 0x6e, 0x6d, 0x72, 0x45, 0x74, 0x68, 0x6e, + 0x67, 0x59, 0x54, 0x66, 0x0a, 0x66, 0x77, 0x6b, 0x38, 0x6c, 0x4f, 0x61, + 0x34, 0x4a, 0x69, 0x77, 0x67, 0x76, 0x54, 0x32, 0x7a, 0x4b, 0x49, 0x6e, + 0x33, 0x58, 0x2f, 0x38, 0x69, 0x34, 0x70, 0x65, 0x45, 0x48, 0x2b, 0x6c, + 0x6c, 0x37, 0x34, 0x66, 0x67, 0x33, 0x38, 0x46, 0x6e, 0x53, 0x62, 0x4e, + 0x64, 0x36, 0x37, 0x49, 0x4a, 0x4b, 0x75, 0x73, 0x6d, 0x37, 0x58, 0x69, + 0x2b, 0x66, 0x54, 0x38, 0x72, 0x38, 0x37, 0x63, 0x6d, 0x0a, 0x4e, 0x57, + 0x31, 0x66, 0x69, 0x51, 0x47, 0x32, 0x53, 0x56, 0x75, 0x66, 0x41, 0x51, + 0x57, 0x62, 0x71, 0x7a, 0x30, 0x6c, 0x77, 0x63, 0x79, 0x32, 0x66, 0x38, + 0x4c, 0x78, 0x62, 0x34, 0x62, 0x47, 0x2b, 0x6d, 0x52, 0x6f, 0x36, 0x34, + 0x45, 0x74, 0x6c, 0x4f, 0x74, 0x43, 0x74, 0x2f, 0x71, 0x4d, 0x48, 0x74, + 0x31, 0x69, 0x38, 0x62, 0x35, 0x51, 0x5a, 0x37, 0x64, 0x73, 0x76, 0x66, + 0x50, 0x78, 0x0a, 0x48, 0x32, 0x73, 0x4d, 0x4e, 0x67, 0x63, 0x57, 0x66, + 0x7a, 0x64, 0x38, 0x71, 0x56, 0x74, 0x74, 0x65, 0x76, 0x45, 0x53, 0x52, + 0x6d, 0x43, 0x44, 0x31, 0x79, 0x63, 0x45, 0x76, 0x6b, 0x76, 0x4f, 0x6c, + 0x37, 0x37, 0x44, 0x5a, 0x79, 0x70, 0x6f, 0x45, 0x64, 0x2b, 0x41, 0x35, + 0x77, 0x77, 0x7a, 0x5a, 0x72, 0x38, 0x54, 0x44, 0x52, 0x52, 0x75, 0x38, + 0x33, 0x38, 0x66, 0x59, 0x78, 0x41, 0x65, 0x0a, 0x2b, 0x6f, 0x30, 0x62, + 0x4a, 0x57, 0x31, 0x73, 0x6a, 0x36, 0x57, 0x33, 0x59, 0x51, 0x47, 0x78, + 0x30, 0x71, 0x4d, 0x6d, 0x6f, 0x52, 0x42, 0x78, 0x6e, 0x61, 0x33, 0x69, + 0x77, 0x2f, 0x6e, 0x44, 0x6d, 0x56, 0x47, 0x33, 0x4b, 0x77, 0x63, 0x49, + 0x7a, 0x69, 0x37, 0x6d, 0x55, 0x4c, 0x4b, 0x6e, 0x2b, 0x67, 0x70, 0x46, + 0x4c, 0x36, 0x4c, 0x77, 0x38, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, + 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, + 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, + 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, + 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, + 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, + 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, + 0x39, 0x34, 0x34, 0x37, 0x31, 0x39, 0x35, 0x39, 0x38, 0x39, 0x35, 0x32, + 0x30, 0x34, 0x30, 0x33, 0x37, 0x34, 0x39, 0x35, 0x31, 0x38, 0x33, 0x32, + 0x39, 0x36, 0x33, 0x37, 0x39, 0x34, 0x34, 0x35, 0x34, 0x33, 0x34, 0x36, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x39, 0x3a, 0x65, + 0x34, 0x3a, 0x61, 0x39, 0x3a, 0x38, 0x34, 0x3a, 0x30, 0x64, 0x3a, 0x37, + 0x64, 0x3a, 0x33, 0x61, 0x3a, 0x39, 0x36, 0x3a, 0x64, 0x37, 0x3a, 0x63, + 0x30, 0x3a, 0x34, 0x66, 0x3a, 0x65, 0x32, 0x3a, 0x34, 0x33, 0x3a, 0x34, + 0x63, 0x3a, 0x38, 0x39, 0x3a, 0x32, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x38, 0x3a, 0x39, 0x38, 0x3a, 0x35, 0x64, + 0x3a, 0x33, 0x61, 0x3a, 0x36, 0x35, 0x3a, 0x65, 0x35, 0x3a, 0x65, 0x35, + 0x3a, 0x63, 0x34, 0x3a, 0x62, 0x32, 0x3a, 0x64, 0x37, 0x3a, 0x64, 0x36, + 0x3a, 0x36, 0x64, 0x3a, 0x34, 0x30, 0x3a, 0x63, 0x36, 0x3a, 0x64, 0x64, + 0x3a, 0x32, 0x66, 0x3a, 0x62, 0x31, 0x3a, 0x39, 0x63, 0x3a, 0x35, 0x34, + 0x3a, 0x33, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x34, 0x33, 0x3a, 0x34, 0x38, 0x3a, 0x61, 0x30, 0x3a, 0x65, + 0x39, 0x3a, 0x34, 0x34, 0x3a, 0x34, 0x63, 0x3a, 0x37, 0x38, 0x3a, 0x63, + 0x62, 0x3a, 0x32, 0x36, 0x3a, 0x35, 0x65, 0x3a, 0x30, 0x35, 0x3a, 0x38, + 0x64, 0x3a, 0x35, 0x65, 0x3a, 0x38, 0x39, 0x3a, 0x34, 0x34, 0x3a, 0x62, + 0x34, 0x3a, 0x64, 0x38, 0x3a, 0x34, 0x66, 0x3a, 0x39, 0x36, 0x3a, 0x36, + 0x32, 0x3a, 0x62, 0x64, 0x3a, 0x32, 0x36, 0x3a, 0x64, 0x62, 0x3a, 0x32, + 0x35, 0x3a, 0x37, 0x66, 0x3a, 0x38, 0x39, 0x3a, 0x33, 0x34, 0x3a, 0x61, + 0x34, 0x3a, 0x34, 0x33, 0x3a, 0x63, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x36, + 0x31, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x72, 0x7a, + 0x43, 0x43, 0x41, 0x70, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x51, 0x43, 0x44, 0x76, 0x67, 0x56, 0x70, 0x42, 0x43, 0x52, 0x72, + 0x47, 0x68, 0x64, 0x57, 0x72, 0x4a, 0x57, 0x5a, 0x48, 0x48, 0x53, 0x6a, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x68, 0x0a, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, 0x47, 0x6c, 0x6e, 0x61, + 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, + 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, + 0x78, 0x42, 0x33, 0x0a, 0x64, 0x33, 0x63, 0x75, 0x5a, 0x47, 0x6c, 0x6e, + 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x59, 0x32, 0x39, 0x74, + 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x45, 0x78, 0x64, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, + 0x64, 0x43, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x67, + 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x0a, 0x51, 0x54, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x77, 0x4e, 0x6a, 0x45, 0x78, 0x4d, 0x54, 0x41, + 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, + 0x7a, 0x4d, 0x54, 0x45, 0x78, 0x4d, 0x54, 0x41, 0x77, 0x4d, 0x44, 0x41, + 0x77, 0x4d, 0x44, 0x42, 0x61, 0x4d, 0x47, 0x45, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, + 0x54, 0x0a, 0x4d, 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x45, 0x77, 0x78, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, + 0x56, 0x79, 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x78, 0x47, 0x54, + 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x45, 0x48, + 0x64, 0x33, 0x64, 0x79, 0x35, 0x6b, 0x61, 0x57, 0x64, 0x70, 0x59, 0x32, + 0x56, 0x79, 0x64, 0x43, 0x35, 0x6a, 0x0a, 0x62, 0x32, 0x30, 0x78, 0x49, + 0x44, 0x41, 0x65, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, + 0x30, 0x52, 0x70, 0x5a, 0x32, 0x6c, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x49, + 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, 0x53, 0x62, + 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x49, 0x49, 0x42, 0x49, + 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x0a, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, + 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, + 0x41, 0x51, 0x45, 0x41, 0x34, 0x6a, 0x76, 0x68, 0x45, 0x58, 0x4c, 0x65, + 0x71, 0x4b, 0x54, 0x54, 0x6f, 0x31, 0x65, 0x71, 0x55, 0x4b, 0x4b, 0x50, + 0x43, 0x33, 0x65, 0x51, 0x79, 0x61, 0x4b, 0x6c, 0x37, 0x68, 0x4c, 0x4f, + 0x6c, 0x6c, 0x73, 0x42, 0x0a, 0x43, 0x53, 0x44, 0x4d, 0x41, 0x5a, 0x4f, + 0x6e, 0x54, 0x6a, 0x43, 0x33, 0x55, 0x2f, 0x64, 0x44, 0x78, 0x47, 0x6b, + 0x41, 0x56, 0x35, 0x33, 0x69, 0x6a, 0x53, 0x4c, 0x64, 0x68, 0x77, 0x5a, + 0x41, 0x41, 0x49, 0x45, 0x4a, 0x7a, 0x73, 0x34, 0x62, 0x67, 0x37, 0x2f, + 0x66, 0x7a, 0x54, 0x74, 0x78, 0x52, 0x75, 0x4c, 0x57, 0x5a, 0x73, 0x63, + 0x46, 0x73, 0x33, 0x59, 0x6e, 0x46, 0x6f, 0x39, 0x37, 0x0a, 0x6e, 0x68, + 0x36, 0x56, 0x66, 0x65, 0x36, 0x33, 0x53, 0x4b, 0x4d, 0x49, 0x32, 0x74, + 0x61, 0x76, 0x65, 0x67, 0x77, 0x35, 0x42, 0x6d, 0x56, 0x2f, 0x53, 0x6c, + 0x30, 0x66, 0x76, 0x42, 0x66, 0x34, 0x71, 0x37, 0x37, 0x75, 0x4b, 0x4e, + 0x64, 0x30, 0x66, 0x33, 0x70, 0x34, 0x6d, 0x56, 0x6d, 0x46, 0x61, 0x47, + 0x35, 0x63, 0x49, 0x7a, 0x4a, 0x4c, 0x76, 0x30, 0x37, 0x41, 0x36, 0x46, + 0x70, 0x74, 0x0a, 0x34, 0x33, 0x43, 0x2f, 0x64, 0x78, 0x43, 0x2f, 0x2f, + 0x41, 0x48, 0x32, 0x68, 0x64, 0x6d, 0x6f, 0x52, 0x42, 0x42, 0x59, 0x4d, + 0x71, 0x6c, 0x31, 0x47, 0x4e, 0x58, 0x52, 0x6f, 0x72, 0x35, 0x48, 0x34, + 0x69, 0x64, 0x71, 0x39, 0x4a, 0x6f, 0x7a, 0x2b, 0x45, 0x6b, 0x49, 0x59, + 0x49, 0x76, 0x55, 0x58, 0x37, 0x51, 0x36, 0x68, 0x4c, 0x2b, 0x68, 0x71, + 0x6b, 0x70, 0x4d, 0x66, 0x54, 0x37, 0x50, 0x0a, 0x54, 0x31, 0x39, 0x73, + 0x64, 0x6c, 0x36, 0x67, 0x53, 0x7a, 0x65, 0x52, 0x6e, 0x74, 0x77, 0x69, + 0x35, 0x6d, 0x33, 0x4f, 0x46, 0x42, 0x71, 0x4f, 0x61, 0x73, 0x76, 0x2b, + 0x7a, 0x62, 0x4d, 0x55, 0x5a, 0x42, 0x66, 0x48, 0x57, 0x79, 0x6d, 0x65, + 0x4d, 0x72, 0x2f, 0x79, 0x37, 0x76, 0x72, 0x54, 0x43, 0x30, 0x4c, 0x55, + 0x71, 0x37, 0x64, 0x42, 0x4d, 0x74, 0x6f, 0x4d, 0x31, 0x4f, 0x2f, 0x34, + 0x0a, 0x67, 0x64, 0x57, 0x37, 0x6a, 0x56, 0x67, 0x2f, 0x74, 0x52, 0x76, + 0x6f, 0x53, 0x53, 0x69, 0x69, 0x63, 0x4e, 0x6f, 0x78, 0x42, 0x4e, 0x33, + 0x33, 0x73, 0x68, 0x62, 0x79, 0x54, 0x41, 0x70, 0x4f, 0x42, 0x36, 0x6a, + 0x74, 0x53, 0x6a, 0x31, 0x65, 0x74, 0x58, 0x2b, 0x6a, 0x6b, 0x4d, 0x4f, + 0x76, 0x4a, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x32, 0x4d, + 0x77, 0x59, 0x54, 0x41, 0x4f, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x59, + 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, + 0x51, 0x55, 0x41, 0x39, 0x35, 0x51, 0x4e, 0x56, 0x62, 0x52, 0x0a, 0x54, + 0x4c, 0x74, 0x6d, 0x38, 0x4b, 0x50, 0x69, 0x47, 0x78, 0x76, 0x44, 0x6c, + 0x37, 0x49, 0x39, 0x30, 0x56, 0x55, 0x77, 0x48, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f, 0x41, 0x55, 0x41, + 0x39, 0x35, 0x51, 0x4e, 0x56, 0x62, 0x52, 0x54, 0x4c, 0x74, 0x6d, 0x38, + 0x4b, 0x50, 0x69, 0x47, 0x78, 0x76, 0x44, 0x6c, 0x37, 0x49, 0x39, 0x30, + 0x56, 0x55, 0x77, 0x0a, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x4d, 0x75, 0x63, 0x4e, 0x36, 0x70, 0x49, + 0x45, 0x78, 0x49, 0x4b, 0x2b, 0x74, 0x31, 0x45, 0x6e, 0x45, 0x39, 0x53, + 0x73, 0x50, 0x54, 0x66, 0x72, 0x67, 0x54, 0x31, 0x65, 0x58, 0x6b, 0x49, + 0x6f, 0x79, 0x51, 0x59, 0x2f, 0x45, 0x73, 0x72, 0x0a, 0x68, 0x4d, 0x41, + 0x74, 0x75, 0x64, 0x58, 0x48, 0x2f, 0x76, 0x54, 0x42, 0x48, 0x31, 0x6a, + 0x4c, 0x75, 0x47, 0x32, 0x63, 0x65, 0x6e, 0x54, 0x6e, 0x6d, 0x43, 0x6d, + 0x72, 0x45, 0x62, 0x58, 0x6a, 0x63, 0x4b, 0x43, 0x68, 0x7a, 0x55, 0x79, + 0x49, 0x6d, 0x5a, 0x4f, 0x4d, 0x6b, 0x58, 0x44, 0x69, 0x71, 0x77, 0x38, + 0x63, 0x76, 0x70, 0x4f, 0x70, 0x2f, 0x32, 0x50, 0x56, 0x35, 0x41, 0x64, + 0x67, 0x0a, 0x30, 0x36, 0x4f, 0x2f, 0x6e, 0x56, 0x73, 0x4a, 0x38, 0x64, + 0x57, 0x4f, 0x34, 0x31, 0x50, 0x30, 0x6a, 0x6d, 0x50, 0x36, 0x50, 0x36, + 0x66, 0x62, 0x74, 0x47, 0x62, 0x66, 0x59, 0x6d, 0x62, 0x57, 0x30, 0x57, + 0x35, 0x42, 0x6a, 0x66, 0x49, 0x74, 0x74, 0x65, 0x70, 0x33, 0x53, 0x70, + 0x2b, 0x64, 0x57, 0x4f, 0x49, 0x72, 0x57, 0x63, 0x42, 0x41, 0x49, 0x2b, + 0x30, 0x74, 0x4b, 0x49, 0x4a, 0x46, 0x0a, 0x50, 0x6e, 0x6c, 0x55, 0x6b, + 0x69, 0x61, 0x59, 0x34, 0x49, 0x42, 0x49, 0x71, 0x44, 0x66, 0x76, 0x38, + 0x4e, 0x5a, 0x35, 0x59, 0x42, 0x62, 0x65, 0x72, 0x4f, 0x67, 0x4f, 0x7a, + 0x57, 0x36, 0x73, 0x52, 0x42, 0x63, 0x34, 0x4c, 0x30, 0x6e, 0x61, 0x34, + 0x55, 0x55, 0x2b, 0x4b, 0x72, 0x6b, 0x32, 0x55, 0x38, 0x38, 0x36, 0x55, + 0x41, 0x62, 0x33, 0x4c, 0x75, 0x6a, 0x45, 0x56, 0x30, 0x6c, 0x73, 0x0a, + 0x59, 0x53, 0x45, 0x59, 0x31, 0x51, 0x53, 0x74, 0x65, 0x44, 0x77, 0x73, + 0x4f, 0x6f, 0x42, 0x72, 0x70, 0x2b, 0x75, 0x76, 0x46, 0x52, 0x54, 0x70, + 0x32, 0x49, 0x6e, 0x42, 0x75, 0x54, 0x68, 0x73, 0x34, 0x70, 0x46, 0x73, + 0x69, 0x76, 0x39, 0x6b, 0x75, 0x58, 0x63, 0x6c, 0x56, 0x7a, 0x44, 0x41, + 0x47, 0x79, 0x53, 0x6a, 0x34, 0x64, 0x7a, 0x70, 0x33, 0x30, 0x64, 0x38, + 0x74, 0x62, 0x51, 0x6b, 0x0a, 0x43, 0x41, 0x55, 0x77, 0x37, 0x43, 0x32, + 0x39, 0x43, 0x37, 0x39, 0x46, 0x76, 0x31, 0x43, 0x35, 0x71, 0x66, 0x50, + 0x72, 0x6d, 0x41, 0x45, 0x53, 0x72, 0x63, 0x69, 0x49, 0x78, 0x70, 0x67, + 0x30, 0x58, 0x34, 0x30, 0x4b, 0x50, 0x4d, 0x62, 0x70, 0x31, 0x5a, 0x57, + 0x56, 0x62, 0x64, 0x34, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x48, 0x69, 0x67, 0x68, 0x20, + 0x41, 0x73, 0x73, 0x75, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x45, 0x56, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x44, + 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, + 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, + 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x48, 0x69, 0x67, 0x68, 0x20, + 0x41, 0x73, 0x73, 0x75, 0x72, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x45, 0x56, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x44, + 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, + 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, + 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, + 0x72, 0x74, 0x20, 0x48, 0x69, 0x67, 0x68, 0x20, 0x41, 0x73, 0x73, 0x75, + 0x72, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x35, 0x35, 0x33, 0x34, 0x30, 0x30, 0x30, + 0x37, 0x36, 0x34, 0x31, 0x30, 0x35, 0x34, 0x37, 0x39, 0x31, 0x39, 0x37, + 0x32, 0x34, 0x37, 0x33, 0x30, 0x37, 0x33, 0x34, 0x33, 0x37, 0x38, 0x31, + 0x30, 0x30, 0x30, 0x38, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x64, 0x34, 0x3a, 0x37, 0x34, 0x3a, 0x64, 0x65, 0x3a, 0x35, 0x37, + 0x3a, 0x35, 0x63, 0x3a, 0x33, 0x39, 0x3a, 0x62, 0x32, 0x3a, 0x64, 0x33, + 0x3a, 0x39, 0x63, 0x3a, 0x38, 0x35, 0x3a, 0x38, 0x33, 0x3a, 0x63, 0x35, + 0x3a, 0x63, 0x30, 0x3a, 0x36, 0x35, 0x3a, 0x34, 0x39, 0x3a, 0x38, 0x61, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x66, 0x3a, + 0x62, 0x37, 0x3a, 0x65, 0x65, 0x3a, 0x30, 0x36, 0x3a, 0x33, 0x33, 0x3a, + 0x65, 0x32, 0x3a, 0x35, 0x39, 0x3a, 0x64, 0x62, 0x3a, 0x61, 0x64, 0x3a, + 0x30, 0x63, 0x3a, 0x34, 0x63, 0x3a, 0x39, 0x61, 0x3a, 0x65, 0x36, 0x3a, + 0x64, 0x33, 0x3a, 0x38, 0x66, 0x3a, 0x31, 0x61, 0x3a, 0x36, 0x31, 0x3a, + 0x63, 0x37, 0x3a, 0x64, 0x63, 0x3a, 0x32, 0x35, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x34, 0x3a, 0x33, 0x31, + 0x3a, 0x65, 0x35, 0x3a, 0x66, 0x34, 0x3a, 0x63, 0x33, 0x3a, 0x63, 0x31, + 0x3a, 0x63, 0x65, 0x3a, 0x34, 0x36, 0x3a, 0x39, 0x30, 0x3a, 0x37, 0x37, + 0x3a, 0x34, 0x66, 0x3a, 0x30, 0x62, 0x3a, 0x36, 0x31, 0x3a, 0x65, 0x30, + 0x3a, 0x35, 0x34, 0x3a, 0x34, 0x30, 0x3a, 0x38, 0x38, 0x3a, 0x33, 0x62, + 0x3a, 0x61, 0x39, 0x3a, 0x61, 0x30, 0x3a, 0x31, 0x65, 0x3a, 0x64, 0x30, + 0x3a, 0x30, 0x62, 0x3a, 0x61, 0x36, 0x3a, 0x61, 0x62, 0x3a, 0x64, 0x37, + 0x3a, 0x38, 0x30, 0x3a, 0x36, 0x65, 0x3a, 0x64, 0x33, 0x3a, 0x62, 0x31, + 0x3a, 0x31, 0x38, 0x3a, 0x63, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x44, 0x78, 0x54, 0x43, 0x43, 0x41, 0x71, 0x32, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x41, 0x71, 0x78, 0x63, 0x4a, + 0x6d, 0x6f, 0x4c, 0x51, 0x4a, 0x75, 0x50, 0x43, 0x33, 0x6e, 0x79, 0x72, + 0x6b, 0x59, 0x6c, 0x64, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, + 0x44, 0x42, 0x73, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, + 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, + 0x52, 0x47, 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, + 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x0a, 0x64, 0x33, 0x63, + 0x75, 0x5a, 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, + 0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x53, 0x73, 0x77, 0x4b, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x4a, 0x45, 0x61, 0x57, 0x64, + 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x49, 0x61, 0x57, 0x64, + 0x6f, 0x49, 0x45, 0x46, 0x7a, 0x63, 0x33, 0x56, 0x79, 0x59, 0x57, 0x35, + 0x6a, 0x0a, 0x5a, 0x53, 0x42, 0x46, 0x56, 0x69, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, + 0x41, 0x32, 0x4d, 0x54, 0x45, 0x78, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x78, 0x4d, 0x54, + 0x45, 0x78, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, + 0x6f, 0x77, 0x62, 0x44, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, + 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, + 0x45, 0x52, 0x70, 0x5a, 0x32, 0x6c, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x49, + 0x45, 0x6c, 0x75, 0x59, 0x7a, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x51, 0x64, 0x33, 0x64, 0x33, 0x0a, + 0x4c, 0x6d, 0x52, 0x70, 0x5a, 0x32, 0x6c, 0x6a, 0x5a, 0x58, 0x4a, 0x30, + 0x4c, 0x6d, 0x4e, 0x76, 0x62, 0x54, 0x45, 0x72, 0x4d, 0x43, 0x6b, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x69, 0x52, 0x47, 0x6c, 0x6e, + 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x47, 0x6c, 0x6e, + 0x61, 0x43, 0x42, 0x42, 0x63, 0x33, 0x4e, 0x31, 0x63, 0x6d, 0x46, 0x75, + 0x59, 0x32, 0x55, 0x67, 0x0a, 0x52, 0x56, 0x59, 0x67, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, + 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, + 0x42, 0x41, 0x4d, 0x62, 0x4d, 0x35, 0x58, 0x50, 0x6d, 0x0a, 0x2b, 0x39, + 0x53, 0x37, 0x35, 0x53, 0x30, 0x74, 0x4d, 0x71, 0x62, 0x66, 0x35, 0x59, + 0x45, 0x2f, 0x79, 0x63, 0x30, 0x6c, 0x53, 0x62, 0x5a, 0x78, 0x4b, 0x73, + 0x50, 0x56, 0x6c, 0x44, 0x52, 0x6e, 0x6f, 0x67, 0x6f, 0x63, 0x73, 0x46, + 0x39, 0x70, 0x70, 0x6b, 0x43, 0x78, 0x78, 0x4c, 0x65, 0x79, 0x6a, 0x39, + 0x43, 0x59, 0x70, 0x4b, 0x6c, 0x42, 0x57, 0x54, 0x72, 0x54, 0x33, 0x4a, + 0x54, 0x57, 0x0a, 0x50, 0x4e, 0x74, 0x30, 0x4f, 0x4b, 0x52, 0x4b, 0x7a, + 0x45, 0x30, 0x6c, 0x67, 0x76, 0x64, 0x4b, 0x70, 0x56, 0x4d, 0x53, 0x4f, + 0x4f, 0x37, 0x7a, 0x53, 0x57, 0x31, 0x78, 0x6b, 0x58, 0x35, 0x6a, 0x74, + 0x71, 0x75, 0x6d, 0x58, 0x38, 0x4f, 0x6b, 0x68, 0x50, 0x68, 0x50, 0x59, + 0x6c, 0x47, 0x2b, 0x2b, 0x4d, 0x58, 0x73, 0x32, 0x7a, 0x69, 0x53, 0x34, + 0x77, 0x62, 0x6c, 0x43, 0x4a, 0x45, 0x4d, 0x0a, 0x78, 0x43, 0x68, 0x42, + 0x56, 0x66, 0x76, 0x4c, 0x57, 0x6f, 0x6b, 0x56, 0x66, 0x6e, 0x48, 0x6f, + 0x4e, 0x62, 0x39, 0x4e, 0x63, 0x67, 0x6b, 0x39, 0x76, 0x6a, 0x6f, 0x34, + 0x55, 0x46, 0x74, 0x33, 0x4d, 0x52, 0x75, 0x4e, 0x73, 0x38, 0x63, 0x6b, + 0x52, 0x5a, 0x71, 0x6e, 0x72, 0x47, 0x30, 0x41, 0x46, 0x46, 0x6f, 0x45, + 0x74, 0x37, 0x6f, 0x54, 0x36, 0x31, 0x45, 0x4b, 0x6d, 0x45, 0x46, 0x42, + 0x0a, 0x49, 0x6b, 0x35, 0x6c, 0x59, 0x59, 0x65, 0x42, 0x51, 0x56, 0x43, + 0x6d, 0x65, 0x56, 0x79, 0x4a, 0x33, 0x68, 0x6c, 0x4b, 0x56, 0x39, 0x55, + 0x75, 0x35, 0x6c, 0x30, 0x63, 0x55, 0x79, 0x78, 0x2b, 0x6d, 0x4d, 0x30, + 0x61, 0x42, 0x68, 0x61, 0x6b, 0x61, 0x48, 0x50, 0x51, 0x4e, 0x41, 0x51, + 0x54, 0x58, 0x4b, 0x46, 0x78, 0x30, 0x31, 0x70, 0x38, 0x56, 0x64, 0x74, + 0x65, 0x5a, 0x4f, 0x45, 0x33, 0x0a, 0x68, 0x7a, 0x42, 0x57, 0x42, 0x4f, + 0x55, 0x52, 0x74, 0x43, 0x6d, 0x41, 0x45, 0x76, 0x46, 0x35, 0x4f, 0x59, + 0x69, 0x69, 0x41, 0x68, 0x46, 0x38, 0x4a, 0x32, 0x61, 0x33, 0x69, 0x4c, + 0x64, 0x34, 0x38, 0x73, 0x6f, 0x4b, 0x71, 0x44, 0x69, 0x72, 0x43, 0x6d, + 0x54, 0x43, 0x76, 0x32, 0x5a, 0x64, 0x6c, 0x59, 0x54, 0x42, 0x6f, 0x53, + 0x55, 0x65, 0x68, 0x31, 0x30, 0x61, 0x55, 0x41, 0x73, 0x67, 0x0a, 0x45, + 0x73, 0x78, 0x42, 0x75, 0x32, 0x34, 0x4c, 0x55, 0x54, 0x69, 0x34, 0x53, + 0x38, 0x73, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x6a, 0x4d, + 0x47, 0x45, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, 0x4d, + 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x46, 0x0a, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x4c, 0x45, 0x2b, 0x77, 0x32, 0x6b, 0x44, 0x2b, 0x4c, 0x39, 0x48, + 0x41, 0x64, 0x53, 0x59, 0x4a, 0x68, 0x6f, 0x49, 0x41, 0x75, 0x39, 0x6a, + 0x5a, 0x43, 0x76, 0x44, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x49, 0x77, 0x51, 0x59, 0x4d, 0x42, 0x61, 0x41, 0x0a, 0x46, 0x4c, 0x45, + 0x2b, 0x77, 0x32, 0x6b, 0x44, 0x2b, 0x4c, 0x39, 0x48, 0x41, 0x64, 0x53, + 0x59, 0x4a, 0x68, 0x6f, 0x49, 0x41, 0x75, 0x39, 0x6a, 0x5a, 0x43, 0x76, + 0x44, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, + 0x42, 0x41, 0x51, 0x41, 0x63, 0x47, 0x67, 0x61, 0x58, 0x33, 0x4e, 0x65, + 0x63, 0x0a, 0x6e, 0x7a, 0x79, 0x49, 0x5a, 0x67, 0x59, 0x49, 0x56, 0x79, + 0x48, 0x62, 0x49, 0x55, 0x66, 0x34, 0x4b, 0x6d, 0x65, 0x71, 0x76, 0x78, + 0x67, 0x79, 0x64, 0x6b, 0x41, 0x51, 0x56, 0x38, 0x47, 0x4b, 0x38, 0x33, + 0x72, 0x5a, 0x45, 0x57, 0x57, 0x4f, 0x4e, 0x66, 0x71, 0x65, 0x2f, 0x45, + 0x57, 0x31, 0x6e, 0x74, 0x6c, 0x4d, 0x4d, 0x55, 0x75, 0x34, 0x6b, 0x65, + 0x68, 0x44, 0x4c, 0x49, 0x36, 0x7a, 0x0a, 0x65, 0x4d, 0x37, 0x62, 0x34, + 0x31, 0x4e, 0x35, 0x63, 0x64, 0x62, 0x6c, 0x49, 0x5a, 0x51, 0x42, 0x32, + 0x6c, 0x57, 0x48, 0x6d, 0x69, 0x52, 0x6b, 0x39, 0x6f, 0x70, 0x6d, 0x7a, + 0x4e, 0x36, 0x63, 0x4e, 0x38, 0x32, 0x6f, 0x4e, 0x4c, 0x46, 0x70, 0x6d, + 0x79, 0x50, 0x49, 0x6e, 0x6e, 0x67, 0x69, 0x4b, 0x33, 0x42, 0x44, 0x34, + 0x31, 0x56, 0x48, 0x4d, 0x57, 0x45, 0x5a, 0x37, 0x31, 0x6a, 0x46, 0x0a, + 0x68, 0x53, 0x39, 0x4f, 0x4d, 0x50, 0x61, 0x67, 0x4d, 0x52, 0x59, 0x6a, + 0x79, 0x4f, 0x66, 0x69, 0x5a, 0x52, 0x59, 0x7a, 0x79, 0x37, 0x38, 0x61, + 0x47, 0x36, 0x41, 0x39, 0x2b, 0x4d, 0x70, 0x65, 0x69, 0x7a, 0x47, 0x4c, + 0x59, 0x41, 0x69, 0x4a, 0x4c, 0x51, 0x77, 0x47, 0x58, 0x46, 0x4b, 0x33, + 0x78, 0x50, 0x6b, 0x4b, 0x6d, 0x4e, 0x45, 0x56, 0x58, 0x35, 0x38, 0x53, + 0x76, 0x6e, 0x77, 0x32, 0x0a, 0x59, 0x7a, 0x69, 0x39, 0x52, 0x4b, 0x52, + 0x2f, 0x35, 0x43, 0x59, 0x72, 0x43, 0x73, 0x53, 0x58, 0x61, 0x51, 0x33, + 0x70, 0x6a, 0x4f, 0x4c, 0x41, 0x45, 0x46, 0x65, 0x34, 0x79, 0x48, 0x59, + 0x53, 0x6b, 0x56, 0x58, 0x79, 0x53, 0x47, 0x6e, 0x59, 0x76, 0x43, 0x6f, + 0x43, 0x57, 0x77, 0x39, 0x45, 0x31, 0x43, 0x41, 0x78, 0x32, 0x2f, 0x53, + 0x36, 0x63, 0x43, 0x5a, 0x64, 0x6b, 0x47, 0x43, 0x65, 0x0a, 0x76, 0x45, + 0x73, 0x58, 0x43, 0x53, 0x2b, 0x30, 0x79, 0x78, 0x35, 0x44, 0x61, 0x4d, + 0x6b, 0x48, 0x4a, 0x38, 0x48, 0x53, 0x58, 0x50, 0x66, 0x71, 0x49, 0x62, + 0x6c, 0x6f, 0x45, 0x70, 0x77, 0x38, 0x6e, 0x4c, 0x2b, 0x65, 0x2f, 0x49, + 0x42, 0x63, 0x6d, 0x32, 0x50, 0x4e, 0x37, 0x45, 0x65, 0x71, 0x4a, 0x53, + 0x64, 0x6e, 0x6f, 0x44, 0x66, 0x7a, 0x41, 0x49, 0x4a, 0x39, 0x56, 0x4e, + 0x65, 0x70, 0x0a, 0x2b, 0x4f, 0x6b, 0x75, 0x45, 0x36, 0x4e, 0x33, 0x36, + 0x42, 0x39, 0x4b, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x53, 0x54, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x58, 0x33, 0x20, 0x4f, + 0x3d, 0x44, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x20, 0x53, 0x69, 0x67, + 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x43, 0x6f, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x53, 0x54, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x58, 0x33, 0x20, 0x4f, 0x3d, + 0x44, 0x69, 0x67, 0x69, 0x74, 0x61, 0x6c, 0x20, 0x53, 0x69, 0x67, 0x6e, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x43, 0x6f, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x44, 0x53, 0x54, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x58, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x39, 0x31, 0x32, 0x39, 0x39, 0x37, 0x33, 0x35, + 0x35, 0x37, 0x35, 0x33, 0x33, 0x39, 0x39, 0x35, 0x33, 0x33, 0x33, 0x35, + 0x39, 0x31, 0x39, 0x32, 0x36, 0x36, 0x39, 0x36, 0x35, 0x38, 0x30, 0x33, + 0x37, 0x37, 0x38, 0x31, 0x35, 0x35, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x34, 0x31, 0x3a, 0x30, 0x33, 0x3a, 0x35, 0x32, 0x3a, 0x64, + 0x63, 0x3a, 0x30, 0x66, 0x3a, 0x66, 0x37, 0x3a, 0x35, 0x30, 0x3a, 0x31, + 0x62, 0x3a, 0x31, 0x36, 0x3a, 0x66, 0x30, 0x3a, 0x30, 0x32, 0x3a, 0x38, + 0x65, 0x3a, 0x62, 0x61, 0x3a, 0x36, 0x66, 0x3a, 0x34, 0x35, 0x3a, 0x63, + 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x61, + 0x3a, 0x63, 0x39, 0x3a, 0x30, 0x32, 0x3a, 0x34, 0x66, 0x3a, 0x35, 0x34, + 0x3a, 0x64, 0x38, 0x3a, 0x66, 0x36, 0x3a, 0x64, 0x66, 0x3a, 0x39, 0x34, + 0x3a, 0x39, 0x33, 0x3a, 0x35, 0x66, 0x3a, 0x62, 0x31, 0x3a, 0x37, 0x33, + 0x3a, 0x32, 0x36, 0x3a, 0x33, 0x38, 0x3a, 0x63, 0x61, 0x3a, 0x36, 0x61, + 0x3a, 0x64, 0x37, 0x3a, 0x37, 0x63, 0x3a, 0x31, 0x33, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x36, 0x3a, 0x38, + 0x37, 0x3a, 0x32, 0x36, 0x3a, 0x30, 0x33, 0x3a, 0x33, 0x31, 0x3a, 0x61, + 0x37, 0x3a, 0x32, 0x34, 0x3a, 0x30, 0x33, 0x3a, 0x64, 0x39, 0x3a, 0x30, + 0x39, 0x3a, 0x66, 0x31, 0x3a, 0x30, 0x35, 0x3a, 0x65, 0x36, 0x3a, 0x39, + 0x62, 0x3a, 0x63, 0x66, 0x3a, 0x30, 0x64, 0x3a, 0x33, 0x32, 0x3a, 0x65, + 0x31, 0x3a, 0x62, 0x64, 0x3a, 0x32, 0x34, 0x3a, 0x39, 0x33, 0x3a, 0x66, + 0x66, 0x3a, 0x63, 0x36, 0x3a, 0x64, 0x39, 0x3a, 0x32, 0x30, 0x3a, 0x36, + 0x64, 0x3a, 0x31, 0x31, 0x3a, 0x62, 0x63, 0x3a, 0x64, 0x36, 0x3a, 0x37, + 0x37, 0x3a, 0x30, 0x37, 0x3a, 0x33, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x44, 0x53, 0x6a, 0x43, 0x43, 0x41, 0x6a, 0x4b, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x52, 0x4b, 0x2b, 0x77, + 0x67, 0x4e, 0x61, 0x6a, 0x4a, 0x37, 0x71, 0x4a, 0x4d, 0x44, 0x6d, 0x47, + 0x4c, 0x76, 0x68, 0x41, 0x61, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, + 0x41, 0x44, 0x41, 0x2f, 0x0a, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x74, 0x45, 0x61, 0x57, 0x64, + 0x70, 0x64, 0x47, 0x46, 0x73, 0x49, 0x46, 0x4e, 0x70, 0x5a, 0x32, 0x35, + 0x68, 0x64, 0x48, 0x56, 0x79, 0x5a, 0x53, 0x42, 0x55, 0x63, 0x6e, 0x56, + 0x7a, 0x64, 0x43, 0x42, 0x44, 0x62, 0x79, 0x34, 0x78, 0x46, 0x7a, 0x41, + 0x56, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x0a, 0x44, 0x6b, + 0x52, 0x54, 0x56, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x42, 0x49, 0x46, 0x67, 0x7a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, + 0x41, 0x77, 0x4d, 0x44, 0x6b, 0x7a, 0x4d, 0x44, 0x49, 0x78, 0x4d, 0x54, + 0x49, 0x78, 0x4f, 0x56, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x78, 0x4d, 0x44, + 0x6b, 0x7a, 0x4d, 0x44, 0x45, 0x30, 0x4d, 0x44, 0x45, 0x78, 0x4e, 0x56, + 0x6f, 0x77, 0x0a, 0x50, 0x7a, 0x45, 0x6b, 0x4d, 0x43, 0x49, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x62, 0x52, 0x47, 0x6c, 0x6e, 0x61, + 0x58, 0x52, 0x68, 0x62, 0x43, 0x42, 0x54, 0x61, 0x57, 0x64, 0x75, 0x59, + 0x58, 0x52, 0x31, 0x63, 0x6d, 0x55, 0x67, 0x56, 0x48, 0x4a, 0x31, 0x63, + 0x33, 0x51, 0x67, 0x51, 0x32, 0x38, 0x75, 0x4d, 0x52, 0x63, 0x77, 0x46, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x0a, 0x45, 0x77, 0x35, 0x45, + 0x55, 0x31, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x51, 0x53, 0x42, 0x59, 0x4d, 0x7a, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, + 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, + 0x0a, 0x41, 0x4e, 0x2b, 0x76, 0x36, 0x5a, 0x64, 0x51, 0x43, 0x49, 0x4e, + 0x58, 0x74, 0x4d, 0x78, 0x69, 0x5a, 0x66, 0x61, 0x51, 0x67, 0x75, 0x7a, + 0x48, 0x30, 0x79, 0x78, 0x72, 0x4d, 0x4d, 0x70, 0x62, 0x37, 0x4e, 0x6e, + 0x44, 0x66, 0x63, 0x64, 0x41, 0x77, 0x52, 0x67, 0x55, 0x69, 0x2b, 0x44, + 0x6f, 0x4d, 0x33, 0x5a, 0x4a, 0x4b, 0x75, 0x4d, 0x2f, 0x49, 0x55, 0x6d, + 0x54, 0x72, 0x45, 0x34, 0x4f, 0x0a, 0x72, 0x7a, 0x35, 0x49, 0x79, 0x32, + 0x58, 0x75, 0x2f, 0x4e, 0x4d, 0x68, 0x44, 0x32, 0x58, 0x53, 0x4b, 0x74, + 0x6b, 0x79, 0x6a, 0x34, 0x7a, 0x6c, 0x39, 0x33, 0x65, 0x77, 0x45, 0x6e, + 0x75, 0x31, 0x6c, 0x63, 0x43, 0x4a, 0x6f, 0x36, 0x6d, 0x36, 0x37, 0x58, + 0x4d, 0x75, 0x65, 0x67, 0x77, 0x47, 0x4d, 0x6f, 0x4f, 0x69, 0x66, 0x6f, + 0x6f, 0x55, 0x4d, 0x4d, 0x30, 0x52, 0x6f, 0x4f, 0x45, 0x71, 0x0a, 0x4f, + 0x4c, 0x6c, 0x35, 0x43, 0x6a, 0x48, 0x39, 0x55, 0x4c, 0x32, 0x41, 0x5a, + 0x64, 0x2b, 0x33, 0x55, 0x57, 0x4f, 0x44, 0x79, 0x4f, 0x4b, 0x49, 0x59, + 0x65, 0x70, 0x4c, 0x59, 0x59, 0x48, 0x73, 0x55, 0x6d, 0x75, 0x35, 0x6f, + 0x75, 0x4a, 0x4c, 0x47, 0x69, 0x69, 0x66, 0x53, 0x4b, 0x4f, 0x65, 0x44, + 0x4e, 0x6f, 0x4a, 0x6a, 0x6a, 0x34, 0x58, 0x4c, 0x68, 0x37, 0x64, 0x49, + 0x4e, 0x39, 0x62, 0x0a, 0x78, 0x69, 0x71, 0x4b, 0x71, 0x79, 0x36, 0x39, + 0x63, 0x4b, 0x33, 0x46, 0x43, 0x78, 0x6f, 0x6c, 0x6b, 0x48, 0x52, 0x79, + 0x78, 0x58, 0x74, 0x71, 0x71, 0x7a, 0x54, 0x57, 0x4d, 0x49, 0x6e, 0x2f, + 0x35, 0x57, 0x67, 0x54, 0x65, 0x31, 0x51, 0x4c, 0x79, 0x4e, 0x61, 0x75, + 0x37, 0x46, 0x71, 0x63, 0x6b, 0x68, 0x34, 0x39, 0x5a, 0x4c, 0x4f, 0x4d, + 0x78, 0x74, 0x2b, 0x2f, 0x79, 0x55, 0x46, 0x77, 0x0a, 0x37, 0x42, 0x5a, + 0x79, 0x31, 0x53, 0x62, 0x73, 0x4f, 0x46, 0x55, 0x35, 0x51, 0x39, 0x44, + 0x38, 0x2f, 0x52, 0x68, 0x63, 0x51, 0x50, 0x47, 0x58, 0x36, 0x39, 0x57, + 0x61, 0x6d, 0x34, 0x30, 0x64, 0x75, 0x74, 0x6f, 0x6c, 0x75, 0x63, 0x62, + 0x59, 0x33, 0x38, 0x45, 0x56, 0x41, 0x6a, 0x71, 0x72, 0x32, 0x6d, 0x37, + 0x78, 0x50, 0x69, 0x37, 0x31, 0x58, 0x41, 0x69, 0x63, 0x50, 0x4e, 0x61, + 0x44, 0x0a, 0x61, 0x65, 0x51, 0x51, 0x6d, 0x78, 0x6b, 0x71, 0x74, 0x69, + 0x6c, 0x58, 0x34, 0x2b, 0x55, 0x39, 0x6d, 0x35, 0x2f, 0x77, 0x41, 0x6c, + 0x30, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, + 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x51, 0x38, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x48, + 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, + 0x4d, 0x53, 0x6e, 0x73, 0x61, 0x52, 0x37, 0x4c, 0x48, 0x48, 0x36, 0x32, + 0x2b, 0x46, 0x4c, 0x6b, 0x48, 0x58, 0x2f, 0x78, 0x42, 0x56, 0x67, 0x68, + 0x59, 0x6b, 0x51, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x0a, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, + 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, 0x6a, 0x47, 0x69, 0x79, 0x62, + 0x46, 0x77, 0x42, 0x63, 0x71, 0x52, 0x37, 0x75, 0x4b, 0x47, 0x59, 0x33, + 0x4f, 0x72, 0x2b, 0x44, 0x78, 0x7a, 0x39, 0x4c, 0x77, 0x77, 0x6d, 0x67, + 0x6c, 0x53, 0x42, 0x64, 0x34, 0x39, 0x6c, 0x5a, 0x52, 0x4e, 0x49, 0x2b, + 0x44, 0x54, 0x36, 0x39, 0x0a, 0x69, 0x6b, 0x75, 0x67, 0x64, 0x42, 0x2f, + 0x4f, 0x45, 0x49, 0x4b, 0x63, 0x64, 0x42, 0x6f, 0x64, 0x66, 0x70, 0x67, + 0x61, 0x33, 0x63, 0x73, 0x54, 0x53, 0x37, 0x4d, 0x67, 0x52, 0x4f, 0x53, + 0x52, 0x36, 0x63, 0x7a, 0x38, 0x66, 0x61, 0x58, 0x62, 0x61, 0x75, 0x58, + 0x2b, 0x35, 0x76, 0x33, 0x67, 0x54, 0x74, 0x32, 0x33, 0x41, 0x44, 0x71, + 0x31, 0x63, 0x45, 0x6d, 0x76, 0x38, 0x75, 0x58, 0x72, 0x0a, 0x41, 0x76, + 0x48, 0x52, 0x41, 0x6f, 0x73, 0x5a, 0x79, 0x35, 0x51, 0x36, 0x58, 0x6b, + 0x6a, 0x45, 0x47, 0x42, 0x35, 0x59, 0x47, 0x56, 0x38, 0x65, 0x41, 0x6c, + 0x72, 0x77, 0x44, 0x50, 0x47, 0x78, 0x72, 0x61, 0x6e, 0x63, 0x57, 0x59, + 0x61, 0x4c, 0x62, 0x75, 0x6d, 0x52, 0x39, 0x59, 0x62, 0x4b, 0x2b, 0x72, + 0x6c, 0x6d, 0x4d, 0x36, 0x70, 0x5a, 0x57, 0x38, 0x37, 0x69, 0x70, 0x78, + 0x5a, 0x7a, 0x0a, 0x52, 0x38, 0x73, 0x72, 0x7a, 0x4a, 0x6d, 0x77, 0x4e, + 0x30, 0x6a, 0x50, 0x34, 0x31, 0x5a, 0x4c, 0x39, 0x63, 0x38, 0x50, 0x44, + 0x48, 0x49, 0x79, 0x68, 0x38, 0x62, 0x77, 0x52, 0x4c, 0x74, 0x54, 0x63, + 0x6d, 0x31, 0x44, 0x39, 0x53, 0x5a, 0x49, 0x6d, 0x6c, 0x4a, 0x6e, 0x74, + 0x31, 0x69, 0x72, 0x2f, 0x6d, 0x64, 0x32, 0x63, 0x58, 0x6a, 0x62, 0x44, + 0x61, 0x4a, 0x57, 0x46, 0x42, 0x4d, 0x35, 0x0a, 0x4a, 0x44, 0x47, 0x46, + 0x6f, 0x71, 0x67, 0x43, 0x57, 0x6a, 0x42, 0x48, 0x34, 0x64, 0x31, 0x51, + 0x42, 0x37, 0x77, 0x43, 0x43, 0x5a, 0x41, 0x41, 0x36, 0x32, 0x52, 0x6a, + 0x59, 0x4a, 0x73, 0x57, 0x76, 0x49, 0x6a, 0x4a, 0x45, 0x75, 0x62, 0x53, + 0x66, 0x5a, 0x47, 0x4c, 0x2b, 0x54, 0x30, 0x79, 0x6a, 0x57, 0x57, 0x30, + 0x36, 0x58, 0x79, 0x78, 0x56, 0x33, 0x62, 0x71, 0x78, 0x62, 0x59, 0x6f, + 0x0a, 0x4f, 0x62, 0x38, 0x56, 0x5a, 0x52, 0x7a, 0x49, 0x39, 0x6e, 0x65, + 0x57, 0x61, 0x67, 0x71, 0x4e, 0x64, 0x77, 0x76, 0x59, 0x6b, 0x51, 0x73, + 0x45, 0x6a, 0x67, 0x66, 0x62, 0x4b, 0x62, 0x59, 0x4b, 0x37, 0x70, 0x32, + 0x43, 0x4e, 0x54, 0x55, 0x51, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x77, + 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x47, 0x6f, 0x6c, 0x64, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x53, + 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x41, 0x47, 0x0a, + 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x53, 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x47, 0x6f, 0x6c, 0x64, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, + 0x20, 0x4f, 0x3d, 0x53, 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x41, 0x47, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x53, 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x47, 0x6f, 0x6c, 0x64, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x33, 0x34, 0x39, 0x32, 0x38, 0x31, 0x35, 0x35, 0x36, 0x31, 0x38, + 0x30, 0x36, 0x39, 0x39, 0x31, 0x32, 0x38, 0x30, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x34, 0x3a, 0x37, 0x37, 0x3a, 0x64, 0x39, + 0x3a, 0x61, 0x38, 0x3a, 0x39, 0x31, 0x3a, 0x64, 0x31, 0x3a, 0x33, 0x62, + 0x3a, 0x66, 0x61, 0x3a, 0x38, 0x38, 0x3a, 0x32, 0x64, 0x3a, 0x63, 0x32, + 0x3a, 0x66, 0x66, 0x3a, 0x66, 0x38, 0x3a, 0x63, 0x64, 0x3a, 0x33, 0x33, + 0x3a, 0x39, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x64, 0x38, 0x3a, 0x63, 0x35, 0x3a, 0x33, 0x38, 0x3a, 0x38, 0x61, 0x3a, + 0x62, 0x37, 0x3a, 0x33, 0x30, 0x3a, 0x31, 0x62, 0x3a, 0x31, 0x62, 0x3a, + 0x36, 0x65, 0x3a, 0x64, 0x34, 0x3a, 0x37, 0x61, 0x3a, 0x65, 0x36, 0x3a, + 0x34, 0x35, 0x3a, 0x32, 0x35, 0x3a, 0x33, 0x61, 0x3a, 0x36, 0x66, 0x3a, + 0x39, 0x66, 0x3a, 0x31, 0x61, 0x3a, 0x32, 0x37, 0x3a, 0x36, 0x31, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x32, + 0x3a, 0x64, 0x64, 0x3a, 0x30, 0x62, 0x3a, 0x65, 0x39, 0x3a, 0x62, 0x39, + 0x3a, 0x66, 0x35, 0x3a, 0x30, 0x61, 0x3a, 0x31, 0x36, 0x3a, 0x33, 0x65, + 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x38, 0x3a, 0x65, 0x37, 0x3a, 0x35, 0x63, + 0x3a, 0x30, 0x35, 0x3a, 0x33, 0x62, 0x3a, 0x31, 0x65, 0x3a, 0x63, 0x61, + 0x3a, 0x35, 0x37, 0x3a, 0x65, 0x61, 0x3a, 0x35, 0x35, 0x3a, 0x63, 0x38, + 0x3a, 0x36, 0x38, 0x3a, 0x38, 0x66, 0x3a, 0x36, 0x34, 0x3a, 0x37, 0x63, + 0x3a, 0x36, 0x38, 0x3a, 0x38, 0x31, 0x3a, 0x66, 0x32, 0x3a, 0x63, 0x38, + 0x3a, 0x33, 0x35, 0x3a, 0x37, 0x62, 0x3a, 0x39, 0x35, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x75, 0x6a, 0x43, 0x43, 0x41, 0x36, + 0x4b, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a, 0x41, 0x4c, + 0x74, 0x41, 0x48, 0x45, 0x50, 0x31, 0x58, 0x6b, 0x2b, 0x77, 0x4d, 0x41, + 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x45, 0x55, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x4e, 0x49, 0x4d, 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x45, 0x77, 0x78, 0x54, 0x64, 0x32, 0x6c, 0x7a, 0x63, + 0x31, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x51, 0x55, 0x63, 0x78, 0x48, + 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, + 0x6c, 0x4e, 0x33, 0x61, 0x58, 0x4e, 0x7a, 0x55, 0x32, 0x6c, 0x6e, 0x0a, + 0x62, 0x69, 0x42, 0x48, 0x62, 0x32, 0x78, 0x6b, 0x49, 0x45, 0x4e, 0x42, + 0x49, 0x43, 0x30, 0x67, 0x52, 0x7a, 0x49, 0x77, 0x48, 0x68, 0x63, 0x4e, + 0x4d, 0x44, 0x59, 0x78, 0x4d, 0x44, 0x49, 0x31, 0x4d, 0x44, 0x67, 0x7a, + 0x4d, 0x44, 0x4d, 0x31, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x59, 0x78, + 0x4d, 0x44, 0x49, 0x31, 0x4d, 0x44, 0x67, 0x7a, 0x4d, 0x44, 0x4d, 0x31, + 0x57, 0x6a, 0x42, 0x46, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x44, 0x53, 0x44, 0x45, + 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, + 0x4d, 0x55, 0x33, 0x64, 0x70, 0x63, 0x33, 0x4e, 0x54, 0x61, 0x57, 0x64, + 0x75, 0x49, 0x45, 0x46, 0x48, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x5a, 0x54, 0x0a, 0x64, 0x32, + 0x6c, 0x7a, 0x63, 0x31, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x52, 0x32, + 0x39, 0x73, 0x5a, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, + 0x63, 0x79, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, + 0x49, 0x43, 0x0a, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, 0x45, 0x41, 0x72, + 0x2b, 0x54, 0x75, 0x66, 0x6f, 0x73, 0x6b, 0x44, 0x68, 0x4a, 0x75, 0x71, + 0x56, 0x41, 0x74, 0x46, 0x6b, 0x51, 0x37, 0x6b, 0x70, 0x4a, 0x63, 0x79, + 0x72, 0x68, 0x64, 0x68, 0x4a, 0x4a, 0x43, 0x45, 0x79, 0x71, 0x38, 0x5a, + 0x56, 0x65, 0x43, 0x51, 0x44, 0x35, 0x58, 0x4a, 0x4d, 0x31, 0x51, 0x69, + 0x79, 0x55, 0x71, 0x74, 0x32, 0x2f, 0x38, 0x0a, 0x37, 0x36, 0x4c, 0x51, + 0x77, 0x42, 0x38, 0x43, 0x4a, 0x45, 0x6f, 0x54, 0x6c, 0x6f, 0x38, 0x6a, + 0x45, 0x2b, 0x59, 0x6f, 0x57, 0x41, 0x43, 0x6a, 0x52, 0x38, 0x63, 0x47, + 0x70, 0x34, 0x51, 0x6a, 0x4b, 0x37, 0x75, 0x39, 0x6c, 0x69, 0x74, 0x2f, + 0x56, 0x63, 0x79, 0x4c, 0x77, 0x56, 0x63, 0x66, 0x44, 0x6d, 0x4a, 0x6c, + 0x44, 0x39, 0x30, 0x39, 0x56, 0x6f, 0x70, 0x7a, 0x32, 0x71, 0x35, 0x2b, + 0x0a, 0x62, 0x62, 0x71, 0x42, 0x48, 0x48, 0x35, 0x43, 0x6a, 0x43, 0x41, + 0x31, 0x32, 0x55, 0x4e, 0x4e, 0x68, 0x50, 0x71, 0x45, 0x32, 0x31, 0x49, + 0x73, 0x38, 0x77, 0x34, 0x6e, 0x64, 0x77, 0x74, 0x72, 0x76, 0x78, 0x45, + 0x76, 0x63, 0x6e, 0x69, 0x66, 0x4c, 0x74, 0x67, 0x2b, 0x35, 0x68, 0x67, + 0x33, 0x57, 0x69, 0x70, 0x79, 0x2b, 0x64, 0x70, 0x69, 0x6b, 0x4a, 0x4b, + 0x56, 0x79, 0x68, 0x2b, 0x63, 0x0a, 0x36, 0x62, 0x4d, 0x38, 0x4b, 0x38, + 0x76, 0x7a, 0x41, 0x52, 0x4f, 0x2f, 0x57, 0x73, 0x2f, 0x42, 0x74, 0x51, + 0x70, 0x67, 0x76, 0x64, 0x32, 0x31, 0x6d, 0x57, 0x52, 0x54, 0x75, 0x4b, + 0x43, 0x57, 0x73, 0x32, 0x2f, 0x69, 0x4a, 0x6e, 0x65, 0x52, 0x6a, 0x4f, + 0x42, 0x69, 0x45, 0x41, 0x4b, 0x66, 0x4e, 0x41, 0x2b, 0x6b, 0x31, 0x5a, + 0x49, 0x7a, 0x55, 0x64, 0x36, 0x2b, 0x6a, 0x62, 0x71, 0x45, 0x0a, 0x65, + 0x6d, 0x41, 0x38, 0x61, 0x74, 0x75, 0x66, 0x4b, 0x2b, 0x7a, 0x65, 0x33, + 0x67, 0x45, 0x2f, 0x62, 0x6b, 0x33, 0x6c, 0x55, 0x49, 0x62, 0x4c, 0x74, + 0x4b, 0x2f, 0x74, 0x52, 0x45, 0x44, 0x46, 0x79, 0x6c, 0x71, 0x4d, 0x32, + 0x74, 0x49, 0x72, 0x66, 0x4b, 0x6a, 0x75, 0x76, 0x71, 0x62, 0x6c, 0x43, + 0x71, 0x6f, 0x4f, 0x70, 0x64, 0x38, 0x46, 0x55, 0x72, 0x64, 0x56, 0x78, + 0x79, 0x4a, 0x64, 0x0a, 0x4d, 0x6d, 0x71, 0x58, 0x6c, 0x32, 0x4d, 0x54, + 0x32, 0x38, 0x6e, 0x62, 0x65, 0x54, 0x5a, 0x37, 0x68, 0x54, 0x70, 0x4b, + 0x78, 0x56, 0x4b, 0x4a, 0x2b, 0x53, 0x54, 0x6e, 0x6e, 0x58, 0x65, 0x70, + 0x67, 0x76, 0x39, 0x56, 0x48, 0x4b, 0x56, 0x78, 0x61, 0x53, 0x76, 0x52, + 0x41, 0x69, 0x54, 0x79, 0x73, 0x79, 0x62, 0x55, 0x61, 0x39, 0x6f, 0x45, + 0x56, 0x65, 0x58, 0x42, 0x43, 0x73, 0x64, 0x74, 0x0a, 0x4d, 0x44, 0x65, + 0x51, 0x4b, 0x75, 0x53, 0x65, 0x46, 0x44, 0x4e, 0x65, 0x46, 0x68, 0x64, + 0x56, 0x78, 0x56, 0x75, 0x31, 0x79, 0x7a, 0x53, 0x4a, 0x6b, 0x76, 0x47, + 0x64, 0x4a, 0x6f, 0x2b, 0x68, 0x42, 0x39, 0x54, 0x47, 0x73, 0x6e, 0x68, + 0x51, 0x32, 0x77, 0x77, 0x4d, 0x43, 0x33, 0x77, 0x4c, 0x6a, 0x45, 0x48, + 0x58, 0x75, 0x65, 0x6e, 0x64, 0x6a, 0x49, 0x6a, 0x33, 0x6f, 0x30, 0x32, + 0x79, 0x0a, 0x4d, 0x73, 0x7a, 0x59, 0x46, 0x39, 0x72, 0x4e, 0x74, 0x38, + 0x35, 0x6d, 0x6e, 0x64, 0x54, 0x39, 0x58, 0x76, 0x2b, 0x39, 0x6c, 0x7a, + 0x34, 0x70, 0x64, 0x65, 0x64, 0x2b, 0x70, 0x32, 0x4a, 0x59, 0x72, 0x79, + 0x55, 0x30, 0x70, 0x55, 0x48, 0x48, 0x50, 0x62, 0x77, 0x4e, 0x55, 0x4d, + 0x6f, 0x44, 0x41, 0x77, 0x38, 0x49, 0x57, 0x68, 0x2b, 0x56, 0x63, 0x33, + 0x68, 0x69, 0x76, 0x36, 0x39, 0x79, 0x0a, 0x46, 0x47, 0x6b, 0x4f, 0x70, + 0x65, 0x55, 0x44, 0x44, 0x6e, 0x69, 0x4f, 0x4a, 0x69, 0x68, 0x43, 0x38, + 0x41, 0x63, 0x4c, 0x59, 0x69, 0x41, 0x51, 0x5a, 0x7a, 0x6c, 0x47, 0x2b, + 0x71, 0x6b, 0x44, 0x7a, 0x41, 0x51, 0x34, 0x65, 0x6d, 0x62, 0x76, 0x49, + 0x49, 0x4f, 0x31, 0x6a, 0x45, 0x70, 0x57, 0x6a, 0x70, 0x45, 0x41, 0x2f, + 0x49, 0x35, 0x63, 0x67, 0x74, 0x36, 0x49, 0x6f, 0x4d, 0x50, 0x69, 0x0a, + 0x61, 0x47, 0x35, 0x39, 0x6a, 0x65, 0x38, 0x38, 0x33, 0x57, 0x58, 0x30, + 0x58, 0x61, 0x78, 0x52, 0x37, 0x79, 0x53, 0x41, 0x72, 0x71, 0x70, 0x57, + 0x6c, 0x32, 0x2f, 0x35, 0x72, 0x58, 0x33, 0x61, 0x59, 0x54, 0x2b, 0x59, + 0x64, 0x7a, 0x79, 0x6c, 0x6b, 0x62, 0x59, 0x63, 0x6a, 0x43, 0x62, 0x61, + 0x5a, 0x61, 0x49, 0x4a, 0x62, 0x63, 0x48, 0x69, 0x56, 0x4f, 0x4f, 0x35, + 0x79, 0x6b, 0x78, 0x4d, 0x0a, 0x67, 0x49, 0x39, 0x33, 0x65, 0x32, 0x43, + 0x61, 0x48, 0x74, 0x2b, 0x32, 0x38, 0x6b, 0x67, 0x65, 0x44, 0x72, 0x70, + 0x4f, 0x56, 0x47, 0x32, 0x59, 0x34, 0x4f, 0x47, 0x69, 0x47, 0x71, 0x4a, + 0x33, 0x55, 0x4d, 0x2f, 0x45, 0x59, 0x35, 0x4c, 0x73, 0x52, 0x78, 0x6d, + 0x64, 0x36, 0x2b, 0x5a, 0x72, 0x7a, 0x73, 0x45, 0x43, 0x41, 0x77, 0x45, + 0x41, 0x41, 0x61, 0x4f, 0x42, 0x72, 0x44, 0x43, 0x42, 0x0a, 0x71, 0x54, + 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x57, 0x79, + 0x56, 0x37, 0x0a, 0x6c, 0x71, 0x52, 0x6c, 0x55, 0x58, 0x36, 0x34, 0x4f, + 0x66, 0x50, 0x41, 0x65, 0x47, 0x5a, 0x65, 0x36, 0x44, 0x72, 0x6e, 0x38, + 0x4f, 0x34, 0x77, 0x48, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, + 0x42, 0x67, 0x77, 0x46, 0x6f, 0x41, 0x55, 0x57, 0x79, 0x56, 0x37, 0x6c, + 0x71, 0x52, 0x6c, 0x55, 0x58, 0x36, 0x34, 0x4f, 0x66, 0x50, 0x41, 0x65, + 0x47, 0x5a, 0x65, 0x36, 0x44, 0x72, 0x6e, 0x0a, 0x38, 0x4f, 0x34, 0x77, + 0x52, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x67, 0x42, 0x44, 0x38, 0x77, + 0x50, 0x54, 0x41, 0x37, 0x42, 0x67, 0x6c, 0x67, 0x68, 0x58, 0x51, 0x42, + 0x57, 0x51, 0x45, 0x43, 0x41, 0x51, 0x45, 0x77, 0x4c, 0x6a, 0x41, 0x73, + 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x43, + 0x41, 0x52, 0x59, 0x67, 0x61, 0x48, 0x52, 0x30, 0x63, 0x44, 0x6f, 0x76, + 0x0a, 0x4c, 0x33, 0x4a, 0x6c, 0x63, 0x47, 0x39, 0x7a, 0x61, 0x58, 0x52, + 0x76, 0x63, 0x6e, 0x6b, 0x75, 0x63, 0x33, 0x64, 0x70, 0x63, 0x33, 0x4e, + 0x7a, 0x61, 0x57, 0x64, 0x75, 0x4c, 0x6d, 0x4e, 0x76, 0x62, 0x53, 0x38, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, + 0x42, 0x41, 0x43, 0x65, 0x36, 0x0a, 0x34, 0x35, 0x52, 0x38, 0x38, 0x61, + 0x37, 0x41, 0x33, 0x68, 0x66, 0x6d, 0x35, 0x64, 0x6a, 0x56, 0x39, 0x56, + 0x53, 0x77, 0x67, 0x2f, 0x53, 0x37, 0x7a, 0x56, 0x34, 0x46, 0x65, 0x30, + 0x2b, 0x66, 0x64, 0x57, 0x61, 0x76, 0x50, 0x4f, 0x68, 0x57, 0x66, 0x76, + 0x78, 0x79, 0x65, 0x44, 0x67, 0x44, 0x32, 0x53, 0x74, 0x69, 0x47, 0x77, + 0x43, 0x35, 0x2b, 0x4f, 0x6c, 0x67, 0x7a, 0x63, 0x7a, 0x4f, 0x0a, 0x55, + 0x59, 0x72, 0x48, 0x55, 0x44, 0x46, 0x75, 0x34, 0x55, 0x70, 0x2b, 0x47, + 0x43, 0x39, 0x70, 0x57, 0x62, 0x59, 0x39, 0x5a, 0x49, 0x45, 0x72, 0x34, + 0x34, 0x4f, 0x45, 0x35, 0x69, 0x4b, 0x48, 0x6a, 0x6e, 0x33, 0x67, 0x37, + 0x67, 0x4b, 0x5a, 0x59, 0x62, 0x67, 0x65, 0x39, 0x4c, 0x67, 0x72, 0x69, + 0x42, 0x49, 0x57, 0x68, 0x4d, 0x49, 0x78, 0x6b, 0x7a, 0x69, 0x57, 0x4d, + 0x61, 0x61, 0x35, 0x0a, 0x4f, 0x31, 0x4d, 0x2f, 0x77, 0x79, 0x53, 0x54, + 0x56, 0x6c, 0x74, 0x70, 0x6b, 0x75, 0x7a, 0x46, 0x77, 0x62, 0x73, 0x34, + 0x41, 0x4f, 0x50, 0x73, 0x46, 0x36, 0x6d, 0x34, 0x33, 0x4d, 0x64, 0x38, + 0x41, 0x59, 0x4f, 0x66, 0x4d, 0x6b, 0x65, 0x36, 0x55, 0x69, 0x49, 0x30, + 0x48, 0x54, 0x4a, 0x36, 0x43, 0x56, 0x61, 0x6e, 0x66, 0x43, 0x55, 0x32, + 0x71, 0x54, 0x31, 0x4c, 0x32, 0x73, 0x43, 0x43, 0x0a, 0x62, 0x77, 0x71, + 0x37, 0x45, 0x73, 0x69, 0x48, 0x53, 0x79, 0x63, 0x52, 0x2b, 0x52, 0x34, + 0x74, 0x78, 0x35, 0x4d, 0x2f, 0x6e, 0x74, 0x74, 0x66, 0x4a, 0x6d, 0x74, + 0x53, 0x32, 0x53, 0x36, 0x4b, 0x38, 0x52, 0x54, 0x47, 0x52, 0x49, 0x30, + 0x56, 0x71, 0x62, 0x65, 0x2f, 0x76, 0x64, 0x36, 0x6d, 0x47, 0x75, 0x36, + 0x75, 0x4c, 0x66, 0x74, 0x49, 0x64, 0x78, 0x66, 0x2b, 0x75, 0x2b, 0x79, + 0x76, 0x0a, 0x47, 0x50, 0x55, 0x71, 0x55, 0x66, 0x41, 0x35, 0x68, 0x4a, + 0x65, 0x56, 0x62, 0x47, 0x34, 0x62, 0x77, 0x79, 0x76, 0x45, 0x64, 0x47, + 0x42, 0x35, 0x4a, 0x62, 0x41, 0x4b, 0x4a, 0x39, 0x2f, 0x66, 0x58, 0x74, + 0x49, 0x35, 0x7a, 0x30, 0x56, 0x39, 0x51, 0x6b, 0x76, 0x66, 0x73, 0x79, + 0x77, 0x65, 0x78, 0x63, 0x5a, 0x64, 0x79, 0x6c, 0x55, 0x36, 0x6f, 0x4a, + 0x78, 0x70, 0x6d, 0x6f, 0x2f, 0x61, 0x0a, 0x37, 0x37, 0x4b, 0x77, 0x50, + 0x4a, 0x2b, 0x48, 0x62, 0x42, 0x49, 0x72, 0x5a, 0x58, 0x41, 0x56, 0x55, + 0x6a, 0x45, 0x61, 0x4a, 0x4d, 0x39, 0x76, 0x4d, 0x53, 0x4e, 0x51, 0x48, + 0x34, 0x78, 0x50, 0x6a, 0x79, 0x50, 0x44, 0x64, 0x45, 0x46, 0x6a, 0x48, + 0x46, 0x57, 0x6f, 0x46, 0x4e, 0x30, 0x2b, 0x34, 0x46, 0x46, 0x51, 0x7a, + 0x2f, 0x45, 0x62, 0x4d, 0x46, 0x59, 0x4f, 0x6b, 0x72, 0x43, 0x43, 0x0a, + 0x68, 0x64, 0x69, 0x44, 0x79, 0x79, 0x4a, 0x6b, 0x76, 0x43, 0x32, 0x34, + 0x4a, 0x64, 0x56, 0x55, 0x6f, 0x72, 0x67, 0x47, 0x36, 0x71, 0x32, 0x53, + 0x70, 0x43, 0x53, 0x67, 0x77, 0x59, 0x61, 0x31, 0x53, 0x68, 0x4e, 0x71, + 0x52, 0x38, 0x38, 0x75, 0x43, 0x31, 0x61, 0x56, 0x56, 0x4d, 0x76, 0x4f, + 0x6d, 0x74, 0x74, 0x71, 0x74, 0x4b, 0x61, 0x79, 0x32, 0x30, 0x45, 0x49, + 0x68, 0x69, 0x64, 0x33, 0x0a, 0x39, 0x32, 0x71, 0x67, 0x51, 0x6d, 0x77, + 0x4c, 0x4f, 0x4d, 0x37, 0x58, 0x64, 0x56, 0x41, 0x79, 0x6b, 0x73, 0x4c, + 0x66, 0x4b, 0x7a, 0x41, 0x69, 0x53, 0x4e, 0x44, 0x56, 0x51, 0x54, 0x67, + 0x6c, 0x58, 0x61, 0x54, 0x70, 0x58, 0x5a, 0x2f, 0x47, 0x6c, 0x48, 0x58, + 0x51, 0x52, 0x66, 0x30, 0x77, 0x6c, 0x30, 0x4f, 0x50, 0x6b, 0x4b, 0x73, + 0x4b, 0x78, 0x34, 0x5a, 0x7a, 0x59, 0x45, 0x70, 0x70, 0x0a, 0x4c, 0x64, + 0x36, 0x6c, 0x65, 0x4e, 0x63, 0x47, 0x32, 0x6d, 0x71, 0x65, 0x53, 0x7a, + 0x35, 0x33, 0x4f, 0x69, 0x41, 0x54, 0x49, 0x67, 0x48, 0x51, 0x76, 0x32, + 0x69, 0x65, 0x59, 0x32, 0x42, 0x72, 0x4e, 0x55, 0x30, 0x4c, 0x62, 0x62, + 0x71, 0x68, 0x50, 0x63, 0x43, 0x54, 0x34, 0x48, 0x38, 0x6a, 0x73, 0x31, + 0x57, 0x74, 0x63, 0x69, 0x56, 0x4f, 0x52, 0x76, 0x6e, 0x53, 0x46, 0x75, + 0x2b, 0x77, 0x0a, 0x5a, 0x4d, 0x45, 0x42, 0x6e, 0x75, 0x6e, 0x4b, 0x6f, + 0x47, 0x71, 0x59, 0x44, 0x73, 0x2f, 0x59, 0x59, 0x50, 0x49, 0x76, 0x53, + 0x62, 0x6a, 0x6b, 0x51, 0x75, 0x45, 0x34, 0x4e, 0x52, 0x62, 0x30, 0x79, + 0x47, 0x35, 0x50, 0x39, 0x34, 0x46, 0x57, 0x36, 0x4c, 0x71, 0x6a, 0x76, + 0x69, 0x4f, 0x76, 0x72, 0x76, 0x31, 0x76, 0x41, 0x2b, 0x41, 0x43, 0x4f, + 0x7a, 0x42, 0x32, 0x2b, 0x68, 0x74, 0x74, 0x0a, 0x51, 0x63, 0x38, 0x42, + 0x73, 0x65, 0x6d, 0x34, 0x79, 0x57, 0x62, 0x30, 0x32, 0x79, 0x62, 0x7a, + 0x4f, 0x71, 0x52, 0x30, 0x38, 0x6b, 0x6b, 0x6b, 0x57, 0x38, 0x6d, 0x77, + 0x30, 0x46, 0x66, 0x42, 0x2b, 0x6a, 0x35, 0x36, 0x34, 0x5a, 0x66, 0x4a, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x53, 0x69, 0x6c, 0x76, 0x65, 0x72, 0x20, 0x43, 0x41, + 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x77, 0x69, 0x73, + 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x41, 0x47, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, + 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x53, 0x69, 0x6c, + 0x76, 0x65, 0x72, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, + 0x4f, 0x3d, 0x53, 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x41, 0x47, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x53, 0x77, 0x69, 0x73, 0x73, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x53, + 0x69, 0x6c, 0x76, 0x65, 0x72, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, + 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x35, 0x37, 0x30, 0x30, 0x33, 0x38, 0x33, 0x30, 0x35, 0x33, 0x31, + 0x31, 0x37, 0x35, 0x39, 0x39, 0x35, 0x36, 0x33, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x30, 0x3a, 0x30, 0x36, 0x3a, 0x61, 0x31, + 0x3a, 0x63, 0x39, 0x3a, 0x37, 0x64, 0x3a, 0x63, 0x66, 0x3a, 0x63, 0x39, + 0x3a, 0x66, 0x63, 0x3a, 0x30, 0x64, 0x3a, 0x63, 0x30, 0x3a, 0x35, 0x36, + 0x3a, 0x37, 0x35, 0x3a, 0x39, 0x36, 0x3a, 0x64, 0x38, 0x3a, 0x36, 0x32, + 0x3a, 0x31, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x39, 0x62, 0x3a, 0x61, 0x61, 0x3a, 0x65, 0x35, 0x3a, 0x39, 0x66, 0x3a, + 0x35, 0x36, 0x3a, 0x65, 0x65, 0x3a, 0x32, 0x31, 0x3a, 0x63, 0x62, 0x3a, + 0x34, 0x33, 0x3a, 0x35, 0x61, 0x3a, 0x62, 0x65, 0x3a, 0x32, 0x35, 0x3a, + 0x39, 0x33, 0x3a, 0x64, 0x66, 0x3a, 0x61, 0x37, 0x3a, 0x66, 0x30, 0x3a, + 0x34, 0x30, 0x3a, 0x64, 0x31, 0x3a, 0x31, 0x64, 0x3a, 0x63, 0x62, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x65, + 0x3a, 0x36, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x61, 0x32, 0x3a, 0x62, 0x62, + 0x3a, 0x62, 0x39, 0x3a, 0x62, 0x61, 0x3a, 0x35, 0x39, 0x3a, 0x62, 0x36, + 0x3a, 0x66, 0x33, 0x3a, 0x39, 0x33, 0x3a, 0x39, 0x37, 0x3a, 0x36, 0x38, + 0x3a, 0x33, 0x37, 0x3a, 0x34, 0x32, 0x3a, 0x34, 0x36, 0x3a, 0x63, 0x33, + 0x3a, 0x63, 0x30, 0x3a, 0x30, 0x35, 0x3a, 0x39, 0x39, 0x3a, 0x33, 0x66, + 0x3a, 0x61, 0x39, 0x3a, 0x38, 0x66, 0x3a, 0x30, 0x32, 0x3a, 0x30, 0x64, + 0x3a, 0x31, 0x64, 0x3a, 0x65, 0x64, 0x3a, 0x62, 0x65, 0x3a, 0x64, 0x34, + 0x3a, 0x38, 0x61, 0x3a, 0x38, 0x31, 0x3a, 0x64, 0x35, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x76, 0x54, 0x43, 0x43, 0x41, 0x36, + 0x57, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x54, 0x78, + 0x76, 0x55, 0x4c, 0x31, 0x53, 0x37, 0x4c, 0x30, 0x73, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x52, 0x7a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x51, + 0x30, 0x67, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x54, 0x44, 0x46, 0x4e, 0x33, 0x61, 0x58, 0x4e, 0x7a, 0x55, + 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x42, 0x52, 0x7a, 0x45, 0x68, 0x4d, + 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x59, 0x55, + 0x33, 0x64, 0x70, 0x63, 0x33, 0x4e, 0x54, 0x61, 0x57, 0x64, 0x75, 0x0a, + 0x49, 0x46, 0x4e, 0x70, 0x62, 0x48, 0x5a, 0x6c, 0x63, 0x69, 0x42, 0x44, + 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, 0x4d, 0x42, 0x34, 0x58, + 0x44, 0x54, 0x41, 0x32, 0x4d, 0x54, 0x41, 0x79, 0x4e, 0x54, 0x41, 0x34, + 0x4d, 0x7a, 0x49, 0x30, 0x4e, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x32, + 0x4d, 0x54, 0x41, 0x79, 0x4e, 0x54, 0x41, 0x34, 0x4d, 0x7a, 0x49, 0x30, + 0x4e, 0x6c, 0x6f, 0x77, 0x0a, 0x52, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x51, 0x30, 0x67, + 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x54, 0x44, 0x46, 0x4e, 0x33, 0x61, 0x58, 0x4e, 0x7a, 0x55, 0x32, 0x6c, + 0x6e, 0x62, 0x69, 0x42, 0x42, 0x52, 0x7a, 0x45, 0x68, 0x4d, 0x42, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x59, 0x0a, 0x55, 0x33, + 0x64, 0x70, 0x63, 0x33, 0x4e, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, + 0x4e, 0x70, 0x62, 0x48, 0x5a, 0x6c, 0x63, 0x69, 0x42, 0x44, 0x51, 0x53, + 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, + 0x38, 0x41, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, + 0x67, 0x45, 0x41, 0x78, 0x50, 0x47, 0x48, 0x66, 0x39, 0x4e, 0x34, 0x4d, + 0x66, 0x63, 0x34, 0x79, 0x66, 0x6a, 0x44, 0x6d, 0x55, 0x4f, 0x38, 0x78, + 0x2f, 0x65, 0x38, 0x4e, 0x2b, 0x64, 0x4f, 0x63, 0x62, 0x70, 0x4c, 0x6a, + 0x36, 0x56, 0x7a, 0x48, 0x56, 0x78, 0x75, 0x6d, 0x4b, 0x34, 0x44, 0x56, + 0x36, 0x34, 0x34, 0x4e, 0x30, 0x4d, 0x76, 0x0a, 0x46, 0x7a, 0x30, 0x66, + 0x79, 0x4d, 0x35, 0x6f, 0x45, 0x4d, 0x46, 0x34, 0x72, 0x68, 0x6b, 0x44, + 0x4b, 0x78, 0x44, 0x36, 0x4c, 0x48, 0x6d, 0x44, 0x39, 0x75, 0x69, 0x35, + 0x61, 0x4c, 0x6c, 0x56, 0x38, 0x67, 0x52, 0x45, 0x70, 0x7a, 0x6e, 0x35, + 0x2f, 0x41, 0x53, 0x4c, 0x48, 0x76, 0x47, 0x69, 0x54, 0x53, 0x66, 0x35, + 0x59, 0x58, 0x75, 0x36, 0x74, 0x2b, 0x57, 0x69, 0x45, 0x37, 0x62, 0x72, + 0x0a, 0x59, 0x54, 0x37, 0x51, 0x62, 0x4e, 0x48, 0x6d, 0x2b, 0x2f, 0x70, + 0x65, 0x37, 0x52, 0x32, 0x30, 0x6e, 0x71, 0x41, 0x31, 0x57, 0x36, 0x47, + 0x53, 0x79, 0x2f, 0x42, 0x4a, 0x6b, 0x76, 0x36, 0x46, 0x43, 0x67, 0x55, + 0x2b, 0x35, 0x74, 0x6b, 0x4c, 0x34, 0x6b, 0x2b, 0x37, 0x33, 0x4a, 0x55, + 0x33, 0x2f, 0x4a, 0x48, 0x70, 0x4d, 0x6a, 0x55, 0x69, 0x30, 0x52, 0x38, + 0x36, 0x54, 0x69, 0x65, 0x46, 0x0a, 0x6e, 0x62, 0x41, 0x56, 0x6c, 0x44, + 0x4c, 0x61, 0x59, 0x51, 0x31, 0x48, 0x54, 0x57, 0x42, 0x43, 0x72, 0x70, + 0x4a, 0x48, 0x36, 0x49, 0x4e, 0x61, 0x55, 0x46, 0x6a, 0x70, 0x69, 0x6f, + 0x75, 0x35, 0x58, 0x61, 0x48, 0x63, 0x33, 0x5a, 0x6c, 0x4b, 0x48, 0x7a, + 0x5a, 0x6e, 0x75, 0x30, 0x6a, 0x6b, 0x67, 0x37, 0x59, 0x33, 0x36, 0x30, + 0x67, 0x36, 0x72, 0x77, 0x39, 0x6e, 0x6a, 0x78, 0x63, 0x48, 0x0a, 0x36, + 0x41, 0x54, 0x4b, 0x37, 0x32, 0x6f, 0x78, 0x68, 0x39, 0x54, 0x41, 0x74, + 0x76, 0x6d, 0x55, 0x63, 0x58, 0x74, 0x6e, 0x5a, 0x4c, 0x69, 0x32, 0x6b, + 0x55, 0x70, 0x43, 0x65, 0x32, 0x55, 0x75, 0x4d, 0x47, 0x6f, 0x4d, 0x39, + 0x5a, 0x44, 0x75, 0x6c, 0x65, 0x62, 0x79, 0x7a, 0x59, 0x4c, 0x73, 0x32, + 0x61, 0x46, 0x4b, 0x37, 0x50, 0x61, 0x79, 0x53, 0x2b, 0x56, 0x46, 0x68, + 0x65, 0x5a, 0x74, 0x0a, 0x65, 0x4a, 0x4d, 0x45, 0x4c, 0x70, 0x79, 0x43, + 0x62, 0x54, 0x61, 0x70, 0x78, 0x44, 0x46, 0x6b, 0x48, 0x34, 0x61, 0x44, + 0x43, 0x79, 0x72, 0x30, 0x4e, 0x51, 0x70, 0x34, 0x79, 0x56, 0x58, 0x50, + 0x51, 0x62, 0x42, 0x48, 0x36, 0x54, 0x43, 0x66, 0x6d, 0x62, 0x35, 0x68, + 0x71, 0x41, 0x61, 0x45, 0x75, 0x53, 0x68, 0x36, 0x58, 0x7a, 0x6a, 0x5a, + 0x47, 0x36, 0x6b, 0x34, 0x73, 0x49, 0x4e, 0x2f, 0x0a, 0x63, 0x38, 0x48, + 0x44, 0x4f, 0x30, 0x67, 0x71, 0x67, 0x67, 0x38, 0x68, 0x6d, 0x37, 0x6a, + 0x4d, 0x71, 0x44, 0x58, 0x44, 0x68, 0x42, 0x75, 0x44, 0x73, 0x7a, 0x36, + 0x2b, 0x70, 0x4a, 0x56, 0x70, 0x41, 0x54, 0x71, 0x4a, 0x41, 0x48, 0x67, + 0x45, 0x32, 0x63, 0x6e, 0x30, 0x6d, 0x52, 0x6d, 0x72, 0x56, 0x6e, 0x35, + 0x62, 0x69, 0x34, 0x59, 0x35, 0x46, 0x5a, 0x47, 0x6b, 0x45, 0x43, 0x77, + 0x4a, 0x0a, 0x4d, 0x6f, 0x42, 0x67, 0x73, 0x35, 0x50, 0x41, 0x4b, 0x72, + 0x59, 0x59, 0x43, 0x35, 0x31, 0x2b, 0x6a, 0x55, 0x6e, 0x79, 0x45, 0x45, + 0x70, 0x2f, 0x2b, 0x64, 0x56, 0x47, 0x4c, 0x78, 0x6d, 0x53, 0x6f, 0x35, + 0x6d, 0x6e, 0x4a, 0x71, 0x79, 0x37, 0x6a, 0x44, 0x7a, 0x6d, 0x44, 0x72, + 0x78, 0x48, 0x42, 0x39, 0x78, 0x7a, 0x55, 0x66, 0x46, 0x77, 0x5a, 0x43, + 0x38, 0x49, 0x2b, 0x62, 0x52, 0x48, 0x0a, 0x48, 0x54, 0x42, 0x73, 0x52, + 0x4f, 0x6f, 0x70, 0x4e, 0x34, 0x57, 0x53, 0x61, 0x47, 0x61, 0x38, 0x67, + 0x7a, 0x6a, 0x2b, 0x65, 0x7a, 0x6b, 0x75, 0x30, 0x31, 0x44, 0x77, 0x48, + 0x2f, 0x74, 0x65, 0x59, 0x4c, 0x61, 0x70, 0x70, 0x76, 0x6f, 0x6e, 0x51, + 0x66, 0x47, 0x62, 0x47, 0x48, 0x4c, 0x79, 0x39, 0x59, 0x52, 0x30, 0x53, + 0x73, 0x6c, 0x6e, 0x78, 0x46, 0x53, 0x75, 0x53, 0x47, 0x54, 0x66, 0x0a, + 0x6a, 0x4e, 0x46, 0x75, 0x73, 0x42, 0x33, 0x68, 0x42, 0x34, 0x38, 0x49, + 0x48, 0x70, 0x6d, 0x63, 0x63, 0x65, 0x6c, 0x4d, 0x32, 0x4b, 0x58, 0x33, + 0x52, 0x78, 0x49, 0x66, 0x64, 0x4e, 0x46, 0x52, 0x6e, 0x6f, 0x62, 0x7a, + 0x77, 0x71, 0x49, 0x6a, 0x51, 0x41, 0x74, 0x7a, 0x32, 0x30, 0x75, 0x6d, + 0x35, 0x33, 0x4d, 0x47, 0x6a, 0x4d, 0x47, 0x67, 0x36, 0x63, 0x46, 0x5a, + 0x72, 0x45, 0x62, 0x36, 0x0a, 0x35, 0x69, 0x2f, 0x34, 0x7a, 0x33, 0x47, + 0x63, 0x52, 0x6d, 0x32, 0x35, 0x78, 0x42, 0x57, 0x4e, 0x4f, 0x48, 0x6b, + 0x44, 0x52, 0x55, 0x6a, 0x76, 0x78, 0x46, 0x33, 0x58, 0x43, 0x4f, 0x36, + 0x48, 0x4f, 0x53, 0x4b, 0x47, 0x73, 0x67, 0x30, 0x50, 0x57, 0x45, 0x50, + 0x33, 0x63, 0x61, 0x6c, 0x49, 0x4c, 0x76, 0x33, 0x71, 0x31, 0x68, 0x38, + 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, 0x42, 0x0a, 0x72, 0x44, + 0x43, 0x42, 0x71, 0x54, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, + 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, + 0x51, 0x55, 0x0a, 0x46, 0x36, 0x44, 0x4e, 0x77, 0x65, 0x52, 0x42, 0x74, + 0x6a, 0x70, 0x62, 0x4f, 0x38, 0x74, 0x46, 0x6e, 0x62, 0x30, 0x63, 0x77, + 0x70, 0x6a, 0x36, 0x68, 0x6c, 0x67, 0x77, 0x48, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f, 0x41, 0x55, 0x46, + 0x36, 0x44, 0x4e, 0x77, 0x65, 0x52, 0x42, 0x74, 0x6a, 0x70, 0x62, 0x4f, + 0x38, 0x74, 0x46, 0x6e, 0x62, 0x30, 0x63, 0x0a, 0x77, 0x70, 0x6a, 0x36, + 0x68, 0x6c, 0x67, 0x77, 0x52, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x67, + 0x42, 0x44, 0x38, 0x77, 0x50, 0x54, 0x41, 0x37, 0x42, 0x67, 0x6c, 0x67, + 0x68, 0x58, 0x51, 0x42, 0x57, 0x51, 0x45, 0x44, 0x41, 0x51, 0x45, 0x77, + 0x4c, 0x6a, 0x41, 0x73, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, + 0x42, 0x51, 0x63, 0x43, 0x41, 0x52, 0x59, 0x67, 0x61, 0x48, 0x52, 0x30, + 0x0a, 0x63, 0x44, 0x6f, 0x76, 0x4c, 0x33, 0x4a, 0x6c, 0x63, 0x47, 0x39, + 0x7a, 0x61, 0x58, 0x52, 0x76, 0x63, 0x6e, 0x6b, 0x75, 0x63, 0x33, 0x64, + 0x70, 0x63, 0x33, 0x4e, 0x7a, 0x61, 0x57, 0x64, 0x75, 0x4c, 0x6d, 0x4e, + 0x76, 0x62, 0x53, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, + 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, + 0x44, 0x67, 0x67, 0x49, 0x42, 0x0a, 0x41, 0x48, 0x50, 0x47, 0x67, 0x65, + 0x41, 0x6e, 0x30, 0x69, 0x30, 0x50, 0x34, 0x4a, 0x55, 0x77, 0x34, 0x70, + 0x70, 0x42, 0x66, 0x31, 0x41, 0x73, 0x58, 0x31, 0x39, 0x69, 0x59, 0x61, + 0x6d, 0x47, 0x61, 0x6d, 0x6b, 0x59, 0x44, 0x48, 0x52, 0x4a, 0x31, 0x6c, + 0x32, 0x45, 0x36, 0x6b, 0x46, 0x53, 0x47, 0x47, 0x39, 0x59, 0x72, 0x56, + 0x42, 0x57, 0x49, 0x47, 0x72, 0x47, 0x76, 0x53, 0x68, 0x70, 0x0a, 0x57, + 0x4a, 0x48, 0x63, 0x6b, 0x52, 0x45, 0x31, 0x71, 0x54, 0x6f, 0x64, 0x76, + 0x42, 0x71, 0x6c, 0x59, 0x4a, 0x37, 0x59, 0x48, 0x33, 0x39, 0x46, 0x6b, + 0x57, 0x6e, 0x5a, 0x66, 0x72, 0x74, 0x34, 0x63, 0x73, 0x45, 0x47, 0x44, + 0x79, 0x72, 0x4f, 0x6a, 0x34, 0x56, 0x77, 0x59, 0x61, 0x79, 0x67, 0x7a, + 0x51, 0x75, 0x34, 0x4f, 0x53, 0x6c, 0x57, 0x68, 0x44, 0x4a, 0x4f, 0x68, + 0x72, 0x73, 0x39, 0x0a, 0x78, 0x43, 0x72, 0x5a, 0x31, 0x78, 0x39, 0x79, + 0x37, 0x76, 0x35, 0x52, 0x6f, 0x53, 0x4a, 0x42, 0x73, 0x58, 0x45, 0x43, + 0x59, 0x78, 0x71, 0x43, 0x73, 0x47, 0x4b, 0x72, 0x58, 0x6c, 0x63, 0x53, + 0x48, 0x39, 0x2f, 0x4c, 0x33, 0x58, 0x57, 0x67, 0x77, 0x46, 0x31, 0x35, + 0x6b, 0x49, 0x77, 0x62, 0x34, 0x46, 0x44, 0x6d, 0x33, 0x6a, 0x48, 0x2b, + 0x6d, 0x48, 0x74, 0x77, 0x58, 0x36, 0x57, 0x51, 0x0a, 0x32, 0x4b, 0x33, + 0x34, 0x41, 0x72, 0x5a, 0x76, 0x30, 0x32, 0x44, 0x64, 0x51, 0x45, 0x73, + 0x69, 0x78, 0x54, 0x32, 0x74, 0x4f, 0x6e, 0x71, 0x66, 0x47, 0x68, 0x70, + 0x48, 0x6b, 0x58, 0x6b, 0x7a, 0x75, 0x6f, 0x4c, 0x63, 0x4d, 0x6d, 0x6b, + 0x44, 0x6c, 0x6d, 0x34, 0x66, 0x53, 0x2f, 0x42, 0x78, 0x2f, 0x75, 0x4e, + 0x6e, 0x63, 0x71, 0x43, 0x78, 0x76, 0x31, 0x79, 0x4c, 0x35, 0x50, 0x71, + 0x5a, 0x0a, 0x49, 0x73, 0x65, 0x45, 0x75, 0x52, 0x75, 0x4e, 0x49, 0x35, + 0x63, 0x2f, 0x37, 0x53, 0x58, 0x67, 0x7a, 0x32, 0x57, 0x37, 0x39, 0x57, + 0x45, 0x45, 0x37, 0x39, 0x30, 0x65, 0x73, 0x6c, 0x70, 0x42, 0x49, 0x6c, + 0x71, 0x68, 0x6e, 0x31, 0x30, 0x73, 0x36, 0x46, 0x76, 0x4a, 0x62, 0x61, + 0x6b, 0x4d, 0x44, 0x48, 0x69, 0x71, 0x59, 0x4d, 0x5a, 0x57, 0x6a, 0x77, + 0x46, 0x61, 0x44, 0x47, 0x69, 0x38, 0x0a, 0x61, 0x52, 0x6c, 0x35, 0x78, + 0x42, 0x39, 0x2b, 0x6c, 0x77, 0x57, 0x2f, 0x78, 0x65, 0x6b, 0x6b, 0x55, + 0x56, 0x37, 0x55, 0x31, 0x55, 0x74, 0x54, 0x37, 0x64, 0x6b, 0x6a, 0x57, + 0x6a, 0x59, 0x44, 0x5a, 0x61, 0x50, 0x42, 0x41, 0x36, 0x31, 0x42, 0x4d, + 0x50, 0x4e, 0x47, 0x47, 0x34, 0x57, 0x51, 0x72, 0x32, 0x57, 0x31, 0x31, + 0x62, 0x48, 0x6b, 0x46, 0x6c, 0x74, 0x34, 0x64, 0x52, 0x32, 0x58, 0x0a, + 0x65, 0x6d, 0x31, 0x5a, 0x71, 0x53, 0x71, 0x50, 0x65, 0x39, 0x37, 0x44, + 0x68, 0x34, 0x6b, 0x51, 0x6d, 0x55, 0x6c, 0x7a, 0x65, 0x4d, 0x67, 0x39, + 0x76, 0x56, 0x45, 0x31, 0x64, 0x43, 0x72, 0x56, 0x38, 0x58, 0x35, 0x70, + 0x47, 0x79, 0x71, 0x37, 0x4f, 0x37, 0x30, 0x6c, 0x75, 0x4a, 0x70, 0x61, + 0x50, 0x58, 0x4a, 0x68, 0x6b, 0x47, 0x61, 0x48, 0x37, 0x67, 0x7a, 0x57, + 0x54, 0x64, 0x51, 0x52, 0x0a, 0x64, 0x41, 0x74, 0x71, 0x2f, 0x67, 0x73, + 0x44, 0x2f, 0x4b, 0x4e, 0x56, 0x56, 0x34, 0x6e, 0x2b, 0x53, 0x73, 0x75, + 0x75, 0x57, 0x78, 0x63, 0x46, 0x79, 0x50, 0x4b, 0x4e, 0x49, 0x7a, 0x46, + 0x54, 0x4f, 0x4e, 0x49, 0x74, 0x61, 0x6a, 0x2b, 0x43, 0x75, 0x59, 0x30, + 0x49, 0x61, 0x76, 0x64, 0x65, 0x51, 0x58, 0x52, 0x75, 0x77, 0x78, 0x46, + 0x2b, 0x42, 0x36, 0x77, 0x70, 0x59, 0x4a, 0x45, 0x2f, 0x0a, 0x4f, 0x4d, + 0x70, 0x58, 0x45, 0x41, 0x32, 0x39, 0x4d, 0x43, 0x2f, 0x48, 0x70, 0x65, + 0x5a, 0x42, 0x6f, 0x4e, 0x71, 0x75, 0x42, 0x59, 0x65, 0x61, 0x6f, 0x4b, + 0x52, 0x6c, 0x62, 0x45, 0x77, 0x4a, 0x44, 0x49, 0x6d, 0x36, 0x75, 0x4e, + 0x4f, 0x35, 0x77, 0x4a, 0x4f, 0x4b, 0x4d, 0x50, 0x71, 0x4e, 0x35, 0x5a, + 0x70, 0x72, 0x46, 0x51, 0x46, 0x4f, 0x5a, 0x36, 0x72, 0x61, 0x59, 0x6c, + 0x59, 0x2b, 0x0a, 0x68, 0x41, 0x68, 0x6d, 0x30, 0x73, 0x51, 0x32, 0x66, + 0x61, 0x63, 0x2b, 0x45, 0x50, 0x79, 0x49, 0x34, 0x4e, 0x53, 0x41, 0x35, + 0x51, 0x43, 0x39, 0x71, 0x76, 0x4e, 0x4f, 0x42, 0x71, 0x4e, 0x36, 0x61, + 0x76, 0x6c, 0x69, 0x63, 0x75, 0x4d, 0x4a, 0x54, 0x2b, 0x75, 0x62, 0x44, + 0x67, 0x45, 0x6a, 0x38, 0x5a, 0x2b, 0x37, 0x66, 0x4e, 0x7a, 0x63, 0x62, + 0x42, 0x47, 0x58, 0x4a, 0x62, 0x4c, 0x79, 0x0a, 0x74, 0x47, 0x4d, 0x55, + 0x30, 0x67, 0x59, 0x71, 0x5a, 0x34, 0x79, 0x44, 0x39, 0x63, 0x37, 0x71, + 0x42, 0x39, 0x69, 0x61, 0x61, 0x68, 0x37, 0x73, 0x35, 0x41, 0x71, 0x37, + 0x4b, 0x6b, 0x7a, 0x72, 0x43, 0x57, 0x41, 0x35, 0x7a, 0x73, 0x70, 0x69, + 0x32, 0x43, 0x35, 0x75, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x32, 0x37, 0x39, 0x38, + 0x32, 0x32, 0x36, 0x35, 0x35, 0x31, 0x32, 0x35, 0x36, 0x39, 0x36, 0x33, + 0x33, 0x32, 0x34, 0x33, 0x31, 0x33, 0x38, 0x30, 0x36, 0x34, 0x33, 0x36, + 0x39, 0x38, 0x31, 0x39, 0x38, 0x32, 0x33, 0x36, 0x39, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x32, 0x3a, 0x32, 0x36, 0x3a, 0x63, + 0x33, 0x3a, 0x30, 0x31, 0x3a, 0x35, 0x65, 0x3a, 0x30, 0x38, 0x3a, 0x33, + 0x30, 0x3a, 0x33, 0x37, 0x3a, 0x34, 0x33, 0x3a, 0x61, 0x39, 0x3a, 0x64, + 0x30, 0x3a, 0x37, 0x64, 0x3a, 0x63, 0x66, 0x3a, 0x33, 0x37, 0x3a, 0x65, + 0x36, 0x3a, 0x62, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x33, 0x32, 0x3a, 0x33, 0x63, 0x3a, 0x31, 0x31, 0x3a, 0x38, 0x65, + 0x3a, 0x31, 0x62, 0x3a, 0x66, 0x37, 0x3a, 0x62, 0x38, 0x3a, 0x62, 0x36, + 0x3a, 0x35, 0x32, 0x3a, 0x35, 0x34, 0x3a, 0x65, 0x32, 0x3a, 0x65, 0x32, + 0x3a, 0x31, 0x30, 0x3a, 0x30, 0x64, 0x3a, 0x64, 0x36, 0x3a, 0x30, 0x32, + 0x3a, 0x39, 0x30, 0x3a, 0x33, 0x37, 0x3a, 0x66, 0x30, 0x3a, 0x39, 0x36, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, + 0x37, 0x3a, 0x64, 0x35, 0x3a, 0x31, 0x30, 0x3a, 0x30, 0x36, 0x3a, 0x63, + 0x35, 0x3a, 0x31, 0x32, 0x3a, 0x65, 0x61, 0x3a, 0x61, 0x62, 0x3a, 0x36, + 0x32, 0x3a, 0x36, 0x34, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x31, 0x3a, 0x65, + 0x63, 0x3a, 0x38, 0x63, 0x3a, 0x39, 0x32, 0x3a, 0x30, 0x31, 0x3a, 0x33, + 0x66, 0x3a, 0x63, 0x35, 0x3a, 0x66, 0x38, 0x3a, 0x32, 0x61, 0x3a, 0x65, + 0x39, 0x3a, 0x38, 0x65, 0x3a, 0x65, 0x35, 0x3a, 0x33, 0x33, 0x3a, 0x65, + 0x62, 0x3a, 0x34, 0x36, 0x3a, 0x31, 0x39, 0x3a, 0x62, 0x38, 0x3a, 0x64, + 0x65, 0x3a, 0x62, 0x34, 0x3a, 0x64, 0x30, 0x3a, 0x36, 0x63, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x66, 0x44, 0x43, 0x43, 0x41, + 0x6d, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x47, + 0x4b, 0x79, 0x31, 0x61, 0x76, 0x31, 0x70, 0x74, 0x68, 0x55, 0x36, 0x59, + 0x32, 0x79, 0x76, 0x32, 0x76, 0x72, 0x45, 0x6f, 0x54, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x59, 0x0a, 0x4d, 0x51, 0x73, 0x77, + 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, + 0x55, 0x7a, 0x45, 0x57, 0x4d, 0x42, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x68, 0x4d, 0x4e, 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, + 0x63, 0x33, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x78, + 0x4d, 0x43, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x6f, + 0x0a, 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, + 0x67, 0x55, 0x48, 0x4a, 0x70, 0x62, 0x57, 0x46, 0x79, 0x65, 0x53, 0x42, + 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, + 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, + 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, + 0x77, 0x4e, 0x6a, 0x45, 0x78, 0x0a, 0x4d, 0x6a, 0x63, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4e, 0x6a, + 0x41, 0x33, 0x4d, 0x54, 0x59, 0x79, 0x4d, 0x7a, 0x55, 0x35, 0x4e, 0x54, + 0x6c, 0x61, 0x4d, 0x46, 0x67, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, 0x54, 0x4d, 0x52, + 0x59, 0x77, 0x46, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x0a, 0x45, + 0x77, 0x31, 0x48, 0x5a, 0x57, 0x39, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, + 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x54, 0x45, 0x77, 0x4c, + 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x68, 0x48, 0x5a, + 0x57, 0x39, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x51, 0x63, + 0x6d, 0x6c, 0x74, 0x59, 0x58, 0x4a, 0x35, 0x49, 0x45, 0x4e, 0x6c, 0x63, + 0x6e, 0x52, 0x70, 0x0a, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, + 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, + 0x61, 0x58, 0x52, 0x35, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, + 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x0a, 0x41, 0x51, 0x45, + 0x41, 0x76, 0x72, 0x67, 0x56, 0x65, 0x2f, 0x2f, 0x55, 0x66, 0x48, 0x31, + 0x6e, 0x72, 0x59, 0x4e, 0x6b, 0x65, 0x38, 0x68, 0x43, 0x55, 0x79, 0x33, + 0x66, 0x39, 0x6f, 0x51, 0x49, 0x49, 0x47, 0x48, 0x57, 0x41, 0x56, 0x6c, + 0x71, 0x6e, 0x45, 0x51, 0x52, 0x72, 0x2b, 0x39, 0x32, 0x2f, 0x5a, 0x56, + 0x2b, 0x7a, 0x6d, 0x45, 0x77, 0x75, 0x33, 0x71, 0x44, 0x58, 0x77, 0x4b, + 0x39, 0x0a, 0x41, 0x57, 0x62, 0x4b, 0x37, 0x68, 0x57, 0x4e, 0x62, 0x36, + 0x45, 0x77, 0x6e, 0x4c, 0x32, 0x68, 0x68, 0x5a, 0x36, 0x55, 0x4f, 0x76, + 0x4e, 0x57, 0x69, 0x41, 0x41, 0x78, 0x7a, 0x39, 0x6a, 0x75, 0x61, 0x70, + 0x59, 0x43, 0x32, 0x65, 0x30, 0x44, 0x6a, 0x50, 0x74, 0x31, 0x62, 0x65, + 0x66, 0x71, 0x75, 0x46, 0x55, 0x57, 0x42, 0x52, 0x61, 0x61, 0x39, 0x4f, + 0x42, 0x65, 0x73, 0x59, 0x6a, 0x41, 0x0a, 0x5a, 0x49, 0x56, 0x63, 0x46, + 0x55, 0x32, 0x49, 0x78, 0x37, 0x65, 0x36, 0x34, 0x48, 0x58, 0x70, 0x72, + 0x51, 0x55, 0x39, 0x6e, 0x63, 0x65, 0x4a, 0x53, 0x4f, 0x43, 0x37, 0x4b, + 0x4d, 0x67, 0x44, 0x34, 0x54, 0x43, 0x54, 0x5a, 0x46, 0x35, 0x53, 0x77, + 0x46, 0x6c, 0x77, 0x49, 0x6a, 0x56, 0x58, 0x69, 0x49, 0x72, 0x78, 0x6c, + 0x51, 0x71, 0x44, 0x31, 0x37, 0x77, 0x78, 0x63, 0x77, 0x45, 0x30, 0x0a, + 0x37, 0x65, 0x39, 0x47, 0x63, 0x65, 0x42, 0x72, 0x41, 0x71, 0x67, 0x31, + 0x63, 0x6d, 0x75, 0x58, 0x6d, 0x32, 0x62, 0x67, 0x79, 0x78, 0x78, 0x35, + 0x58, 0x39, 0x67, 0x61, 0x42, 0x47, 0x67, 0x65, 0x52, 0x77, 0x4c, 0x6d, + 0x6e, 0x57, 0x44, 0x69, 0x4e, 0x70, 0x63, 0x42, 0x33, 0x38, 0x34, 0x31, + 0x6b, 0x74, 0x2b, 0x2b, 0x5a, 0x38, 0x64, 0x74, 0x64, 0x31, 0x6b, 0x37, + 0x6a, 0x35, 0x33, 0x57, 0x0a, 0x6b, 0x42, 0x57, 0x55, 0x76, 0x45, 0x49, + 0x30, 0x45, 0x4d, 0x45, 0x35, 0x2b, 0x62, 0x45, 0x6e, 0x50, 0x6e, 0x37, + 0x57, 0x69, 0x6e, 0x58, 0x46, 0x73, 0x71, 0x2b, 0x57, 0x30, 0x36, 0x4c, + 0x65, 0x6d, 0x2b, 0x53, 0x59, 0x76, 0x6e, 0x33, 0x68, 0x36, 0x59, 0x47, + 0x74, 0x74, 0x6d, 0x2f, 0x38, 0x31, 0x77, 0x37, 0x61, 0x34, 0x44, 0x53, + 0x77, 0x44, 0x52, 0x70, 0x33, 0x35, 0x2b, 0x4d, 0x49, 0x0a, 0x6d, 0x4f, + 0x39, 0x59, 0x2b, 0x70, 0x79, 0x45, 0x74, 0x7a, 0x61, 0x76, 0x77, 0x74, + 0x2b, 0x73, 0x30, 0x76, 0x51, 0x51, 0x42, 0x6e, 0x42, 0x78, 0x4e, 0x51, + 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, + 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, + 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x64, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x4c, + 0x4e, 0x56, 0x51, 0x51, 0x5a, 0x63, 0x56, 0x69, 0x2f, 0x43, 0x50, 0x4e, + 0x6d, 0x46, 0x62, 0x53, 0x76, 0x74, 0x72, 0x32, 0x5a, 0x6e, 0x4a, 0x4d, + 0x35, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x0a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x46, 0x70, 0x77, 0x66, 0x79, 0x7a, 0x64, + 0x74, 0x7a, 0x52, 0x50, 0x39, 0x59, 0x5a, 0x52, 0x71, 0x53, 0x61, 0x2b, + 0x53, 0x37, 0x69, 0x71, 0x38, 0x58, 0x45, 0x4e, 0x33, 0x47, 0x48, 0x48, + 0x6f, 0x4f, 0x6f, 0x30, 0x48, 0x6e, 0x70, 0x33, 0x44, 0x77, 0x51, 0x31, + 0x0a, 0x36, 0x43, 0x65, 0x50, 0x62, 0x4a, 0x43, 0x2f, 0x6b, 0x52, 0x59, + 0x6b, 0x52, 0x6a, 0x35, 0x4b, 0x54, 0x73, 0x34, 0x72, 0x46, 0x74, 0x55, + 0x4c, 0x55, 0x68, 0x33, 0x38, 0x48, 0x32, 0x65, 0x69, 0x41, 0x6b, 0x55, + 0x78, 0x54, 0x38, 0x37, 0x7a, 0x2b, 0x67, 0x4f, 0x6e, 0x65, 0x5a, 0x31, + 0x54, 0x61, 0x74, 0x6e, 0x61, 0x59, 0x7a, 0x72, 0x34, 0x67, 0x4e, 0x66, + 0x54, 0x6d, 0x65, 0x47, 0x6c, 0x0a, 0x34, 0x62, 0x37, 0x55, 0x56, 0x58, + 0x47, 0x59, 0x4e, 0x54, 0x71, 0x2b, 0x6b, 0x2b, 0x71, 0x75, 0x72, 0x55, + 0x4b, 0x79, 0x6b, 0x47, 0x2f, 0x67, 0x2f, 0x43, 0x46, 0x4e, 0x4e, 0x57, + 0x4d, 0x7a, 0x69, 0x55, 0x6e, 0x57, 0x6d, 0x30, 0x37, 0x4b, 0x78, 0x2b, + 0x64, 0x4f, 0x43, 0x51, 0x44, 0x33, 0x32, 0x73, 0x66, 0x76, 0x6d, 0x57, + 0x4b, 0x5a, 0x64, 0x37, 0x61, 0x56, 0x49, 0x6c, 0x36, 0x4b, 0x0a, 0x6f, + 0x4b, 0x76, 0x30, 0x75, 0x48, 0x69, 0x59, 0x79, 0x6a, 0x67, 0x5a, 0x6d, + 0x63, 0x6c, 0x79, 0x6e, 0x6e, 0x6a, 0x4e, 0x53, 0x36, 0x79, 0x76, 0x47, + 0x61, 0x42, 0x7a, 0x45, 0x69, 0x33, 0x38, 0x77, 0x6b, 0x47, 0x36, 0x67, + 0x5a, 0x48, 0x61, 0x46, 0x6c, 0x6f, 0x78, 0x74, 0x2f, 0x6d, 0x30, 0x63, + 0x59, 0x41, 0x53, 0x53, 0x4a, 0x6c, 0x79, 0x63, 0x31, 0x70, 0x5a, 0x55, + 0x38, 0x46, 0x6a, 0x0a, 0x55, 0x6a, 0x50, 0x74, 0x70, 0x38, 0x6e, 0x53, + 0x4f, 0x51, 0x4a, 0x77, 0x2b, 0x75, 0x43, 0x78, 0x51, 0x6d, 0x59, 0x70, + 0x71, 0x70, 0x74, 0x52, 0x37, 0x54, 0x42, 0x55, 0x49, 0x68, 0x52, 0x66, + 0x32, 0x61, 0x73, 0x64, 0x77, 0x65, 0x53, 0x55, 0x38, 0x50, 0x6a, 0x31, + 0x4b, 0x2f, 0x66, 0x71, 0x79, 0x6e, 0x68, 0x47, 0x31, 0x72, 0x69, 0x52, + 0x2f, 0x61, 0x59, 0x4e, 0x4b, 0x78, 0x6f, 0x55, 0x0a, 0x41, 0x54, 0x36, + 0x41, 0x38, 0x45, 0x4b, 0x67, 0x6c, 0x51, 0x64, 0x65, 0x62, 0x63, 0x33, + 0x4d, 0x53, 0x36, 0x52, 0x46, 0x6a, 0x61, 0x73, 0x53, 0x36, 0x4c, 0x50, + 0x65, 0x57, 0x75, 0x57, 0x67, 0x66, 0x4f, 0x67, 0x50, 0x49, 0x68, 0x31, + 0x61, 0x36, 0x56, 0x6b, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x74, 0x68, + 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x74, + 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x20, 0x44, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x28, + 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x36, 0x20, 0x74, 0x68, 0x61, 0x77, + 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, + 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, + 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, + 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x4f, 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x20, 0x44, 0x69, 0x76, 0x69, 0x73, 0x69, 0x6f, + 0x6e, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x36, 0x20, 0x74, + 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, + 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x39, + 0x35, 0x32, 0x39, 0x31, 0x38, 0x31, 0x39, 0x39, 0x32, 0x30, 0x33, 0x39, + 0x32, 0x30, 0x33, 0x35, 0x36, 0x36, 0x32, 0x39, 0x38, 0x39, 0x35, 0x33, + 0x37, 0x38, 0x37, 0x37, 0x31, 0x32, 0x39, 0x34, 0x30, 0x39, 0x30, 0x39, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x63, 0x3a, 0x63, + 0x61, 0x3a, 0x64, 0x63, 0x3a, 0x30, 0x62, 0x3a, 0x32, 0x32, 0x3a, 0x63, + 0x65, 0x3a, 0x66, 0x35, 0x3a, 0x62, 0x65, 0x3a, 0x37, 0x32, 0x3a, 0x61, + 0x63, 0x3a, 0x34, 0x31, 0x3a, 0x31, 0x61, 0x3a, 0x31, 0x31, 0x3a, 0x61, + 0x38, 0x3a, 0x64, 0x38, 0x3a, 0x31, 0x32, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x31, 0x3a, 0x63, 0x36, 0x3a, 0x64, 0x36, + 0x3a, 0x65, 0x65, 0x3a, 0x33, 0x65, 0x3a, 0x38, 0x61, 0x3a, 0x63, 0x38, + 0x3a, 0x36, 0x33, 0x3a, 0x38, 0x34, 0x3a, 0x65, 0x35, 0x3a, 0x34, 0x38, + 0x3a, 0x63, 0x32, 0x3a, 0x39, 0x39, 0x3a, 0x32, 0x39, 0x3a, 0x35, 0x63, + 0x3a, 0x37, 0x35, 0x3a, 0x36, 0x63, 0x3a, 0x38, 0x31, 0x3a, 0x37, 0x62, + 0x3a, 0x38, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x38, 0x64, 0x3a, 0x37, 0x32, 0x3a, 0x32, 0x66, 0x3a, 0x38, + 0x31, 0x3a, 0x61, 0x39, 0x3a, 0x63, 0x31, 0x3a, 0x31, 0x33, 0x3a, 0x63, + 0x30, 0x3a, 0x37, 0x39, 0x3a, 0x31, 0x64, 0x3a, 0x66, 0x31, 0x3a, 0x33, + 0x36, 0x3a, 0x61, 0x32, 0x3a, 0x39, 0x36, 0x3a, 0x36, 0x64, 0x3a, 0x62, + 0x32, 0x3a, 0x36, 0x63, 0x3a, 0x39, 0x35, 0x3a, 0x30, 0x61, 0x3a, 0x39, + 0x37, 0x3a, 0x31, 0x64, 0x3a, 0x62, 0x34, 0x3a, 0x36, 0x62, 0x3a, 0x34, + 0x31, 0x3a, 0x39, 0x39, 0x3a, 0x66, 0x34, 0x3a, 0x65, 0x61, 0x3a, 0x35, + 0x34, 0x3a, 0x62, 0x37, 0x3a, 0x38, 0x62, 0x3a, 0x66, 0x62, 0x3a, 0x39, + 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x49, 0x44, + 0x43, 0x43, 0x41, 0x77, 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x51, 0x4e, 0x45, 0x37, 0x56, 0x56, 0x79, 0x44, 0x56, 0x37, 0x65, + 0x78, 0x4a, 0x39, 0x43, 0x2f, 0x4f, 0x4e, 0x39, 0x73, 0x72, 0x62, 0x54, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x71, + 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x48, 0x52, 0x6f, 0x59, + 0x58, 0x64, 0x30, 0x5a, 0x53, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, + 0x6a, 0x45, 0x6f, 0x4d, 0x43, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x78, 0x4d, 0x66, 0x0a, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, + 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x54, + 0x5a, 0x58, 0x4a, 0x32, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x79, 0x42, 0x45, + 0x61, 0x58, 0x5a, 0x70, 0x63, 0x32, 0x6c, 0x76, 0x62, 0x6a, 0x45, 0x34, + 0x4d, 0x44, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x76, + 0x4b, 0x47, 0x4d, 0x70, 0x49, 0x44, 0x49, 0x77, 0x0a, 0x4d, 0x44, 0x59, + 0x67, 0x64, 0x47, 0x68, 0x68, 0x64, 0x33, 0x52, 0x6c, 0x4c, 0x43, 0x42, + 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, 0x52, 0x6d, 0x39, + 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, + 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, 0x49, 0x47, 0x39, + 0x75, 0x62, 0x48, 0x6b, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x6e, 0x52, 0x6f, 0x59, 0x58, + 0x64, 0x30, 0x5a, 0x53, 0x42, 0x51, 0x63, 0x6d, 0x6c, 0x74, 0x59, 0x58, + 0x4a, 0x35, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, + 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x59, 0x78, 0x4d, 0x54, + 0x45, 0x33, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, + 0x63, 0x4e, 0x4d, 0x7a, 0x59, 0x77, 0x0a, 0x4e, 0x7a, 0x45, 0x32, 0x4d, + 0x6a, 0x4d, 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x71, + 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x48, 0x52, 0x6f, 0x59, + 0x58, 0x64, 0x30, 0x5a, 0x53, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x0a, + 0x4c, 0x6a, 0x45, 0x6f, 0x4d, 0x43, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x78, 0x4d, 0x66, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, + 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x54, + 0x5a, 0x58, 0x4a, 0x32, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x79, 0x42, 0x45, + 0x61, 0x58, 0x5a, 0x70, 0x63, 0x32, 0x6c, 0x76, 0x62, 0x6a, 0x45, 0x34, + 0x4d, 0x44, 0x59, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, + 0x76, 0x4b, 0x47, 0x4d, 0x70, 0x49, 0x44, 0x49, 0x77, 0x4d, 0x44, 0x59, + 0x67, 0x64, 0x47, 0x68, 0x68, 0x64, 0x33, 0x52, 0x6c, 0x4c, 0x43, 0x42, + 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, 0x52, 0x6d, 0x39, + 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, + 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, 0x0a, 0x49, 0x47, + 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x6e, 0x52, 0x6f, 0x59, 0x58, + 0x64, 0x30, 0x5a, 0x53, 0x42, 0x51, 0x63, 0x6d, 0x6c, 0x74, 0x59, 0x58, + 0x4a, 0x35, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, + 0x45, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, + 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, + 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, 0x73, 0x6f, + 0x50, 0x44, 0x37, 0x67, 0x46, 0x6e, 0x55, 0x6e, 0x4d, 0x65, 0x6b, 0x7a, + 0x35, 0x32, 0x68, 0x57, 0x58, 0x4d, 0x4a, 0x45, 0x45, 0x55, 0x4d, 0x44, + 0x53, 0x78, 0x75, 0x61, 0x50, 0x46, 0x73, 0x0a, 0x57, 0x30, 0x68, 0x6f, + 0x53, 0x56, 0x6b, 0x33, 0x2f, 0x41, 0x73, 0x7a, 0x47, 0x63, 0x4a, 0x33, + 0x66, 0x38, 0x77, 0x51, 0x4c, 0x5a, 0x55, 0x30, 0x48, 0x4f, 0x62, 0x72, + 0x54, 0x51, 0x6d, 0x6e, 0x48, 0x4e, 0x4b, 0x34, 0x79, 0x5a, 0x63, 0x32, + 0x41, 0x72, 0x65, 0x4a, 0x31, 0x43, 0x52, 0x66, 0x42, 0x73, 0x44, 0x4d, + 0x52, 0x4a, 0x53, 0x55, 0x6a, 0x51, 0x4a, 0x69, 0x62, 0x2b, 0x74, 0x61, + 0x0a, 0x33, 0x52, 0x47, 0x4e, 0x4b, 0x4a, 0x70, 0x63, 0x68, 0x4a, 0x41, + 0x51, 0x65, 0x67, 0x32, 0x39, 0x64, 0x47, 0x59, 0x76, 0x61, 0x6a, 0x69, + 0x67, 0x34, 0x74, 0x56, 0x55, 0x52, 0x4f, 0x73, 0x64, 0x42, 0x35, 0x38, + 0x48, 0x75, 0x6d, 0x2f, 0x75, 0x36, 0x66, 0x31, 0x4f, 0x43, 0x79, 0x6e, + 0x31, 0x50, 0x6f, 0x53, 0x67, 0x41, 0x66, 0x47, 0x63, 0x71, 0x2f, 0x67, + 0x63, 0x66, 0x6f, 0x6d, 0x6b, 0x0a, 0x36, 0x4b, 0x48, 0x59, 0x63, 0x57, + 0x55, 0x4e, 0x6f, 0x31, 0x46, 0x37, 0x37, 0x72, 0x7a, 0x53, 0x49, 0x6d, + 0x41, 0x4e, 0x75, 0x56, 0x75, 0x64, 0x33, 0x37, 0x72, 0x38, 0x55, 0x56, + 0x73, 0x4c, 0x72, 0x35, 0x69, 0x79, 0x36, 0x53, 0x37, 0x70, 0x42, 0x4f, + 0x68, 0x69, 0x68, 0x39, 0x34, 0x72, 0x79, 0x4e, 0x64, 0x4f, 0x77, 0x55, + 0x78, 0x6b, 0x48, 0x74, 0x33, 0x50, 0x68, 0x31, 0x69, 0x36, 0x0a, 0x53, + 0x6b, 0x2f, 0x4b, 0x61, 0x41, 0x63, 0x64, 0x48, 0x4a, 0x31, 0x4b, 0x78, + 0x74, 0x55, 0x76, 0x6b, 0x63, 0x78, 0x38, 0x63, 0x58, 0x49, 0x63, 0x78, + 0x63, 0x42, 0x6e, 0x36, 0x7a, 0x4c, 0x39, 0x79, 0x5a, 0x4a, 0x63, 0x6c, + 0x4e, 0x71, 0x46, 0x77, 0x4a, 0x75, 0x2f, 0x55, 0x33, 0x30, 0x72, 0x43, + 0x66, 0x53, 0x4d, 0x6e, 0x5a, 0x45, 0x66, 0x6c, 0x32, 0x70, 0x53, 0x79, + 0x39, 0x34, 0x4a, 0x0a, 0x4e, 0x71, 0x52, 0x33, 0x32, 0x48, 0x75, 0x48, + 0x55, 0x45, 0x54, 0x56, 0x50, 0x6d, 0x34, 0x70, 0x61, 0x66, 0x73, 0x35, + 0x53, 0x53, 0x59, 0x65, 0x43, 0x61, 0x57, 0x41, 0x65, 0x30, 0x41, 0x74, + 0x36, 0x2b, 0x67, 0x6e, 0x68, 0x63, 0x6e, 0x2b, 0x59, 0x66, 0x31, 0x2b, + 0x35, 0x6e, 0x79, 0x58, 0x48, 0x64, 0x57, 0x64, 0x41, 0x67, 0x4d, 0x42, + 0x41, 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x0a, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, + 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x37, 0x57, 0x30, 0x58, + 0x50, 0x0a, 0x72, 0x38, 0x37, 0x4c, 0x65, 0x76, 0x30, 0x78, 0x6b, 0x68, + 0x70, 0x71, 0x74, 0x76, 0x4e, 0x47, 0x36, 0x31, 0x64, 0x49, 0x55, 0x44, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, + 0x45, 0x41, 0x65, 0x52, 0x48, 0x41, 0x53, 0x37, 0x4f, 0x52, 0x74, 0x76, + 0x7a, 0x77, 0x36, 0x57, 0x66, 0x55, 0x0a, 0x44, 0x57, 0x35, 0x46, 0x76, + 0x6c, 0x58, 0x6f, 0x6b, 0x39, 0x4c, 0x4f, 0x41, 0x7a, 0x2f, 0x74, 0x32, + 0x69, 0x57, 0x77, 0x48, 0x56, 0x66, 0x4c, 0x48, 0x6a, 0x70, 0x32, 0x6f, + 0x45, 0x7a, 0x73, 0x55, 0x48, 0x62, 0x6f, 0x5a, 0x48, 0x49, 0x4d, 0x70, + 0x4b, 0x6e, 0x78, 0x75, 0x49, 0x76, 0x57, 0x31, 0x6f, 0x65, 0x45, 0x75, + 0x7a, 0x4c, 0x6c, 0x51, 0x52, 0x48, 0x41, 0x64, 0x39, 0x6d, 0x7a, 0x0a, + 0x59, 0x4a, 0x33, 0x72, 0x47, 0x39, 0x58, 0x52, 0x62, 0x6b, 0x52, 0x45, + 0x71, 0x61, 0x59, 0x42, 0x37, 0x46, 0x56, 0x69, 0x48, 0x58, 0x65, 0x34, + 0x58, 0x49, 0x35, 0x49, 0x53, 0x58, 0x79, 0x63, 0x4f, 0x31, 0x63, 0x52, + 0x72, 0x4b, 0x31, 0x7a, 0x4e, 0x34, 0x34, 0x76, 0x65, 0x46, 0x79, 0x51, + 0x61, 0x45, 0x66, 0x5a, 0x59, 0x47, 0x44, 0x6d, 0x2f, 0x41, 0x63, 0x39, + 0x49, 0x69, 0x41, 0x58, 0x0a, 0x78, 0x50, 0x63, 0x57, 0x36, 0x63, 0x54, + 0x59, 0x63, 0x76, 0x6e, 0x49, 0x63, 0x33, 0x7a, 0x66, 0x46, 0x69, 0x38, + 0x56, 0x71, 0x54, 0x37, 0x39, 0x61, 0x69, 0x65, 0x32, 0x6f, 0x65, 0x74, + 0x61, 0x75, 0x70, 0x67, 0x66, 0x31, 0x65, 0x4e, 0x4e, 0x5a, 0x41, 0x71, + 0x64, 0x45, 0x38, 0x68, 0x68, 0x75, 0x76, 0x55, 0x35, 0x48, 0x49, 0x65, + 0x36, 0x75, 0x4c, 0x31, 0x37, 0x49, 0x6e, 0x2f, 0x32, 0x0a, 0x2f, 0x71, + 0x78, 0x41, 0x65, 0x65, 0x57, 0x73, 0x45, 0x47, 0x38, 0x39, 0x6a, 0x78, + 0x74, 0x35, 0x64, 0x6f, 0x76, 0x45, 0x4e, 0x37, 0x4d, 0x68, 0x47, 0x49, + 0x54, 0x6c, 0x4e, 0x67, 0x44, 0x72, 0x59, 0x79, 0x43, 0x5a, 0x75, 0x65, + 0x6e, 0x2b, 0x4d, 0x77, 0x53, 0x37, 0x51, 0x63, 0x6a, 0x42, 0x41, 0x76, + 0x6c, 0x45, 0x59, 0x79, 0x43, 0x65, 0x67, 0x63, 0x35, 0x43, 0x30, 0x39, + 0x59, 0x2f, 0x0a, 0x4c, 0x48, 0x62, 0x54, 0x59, 0x35, 0x78, 0x5a, 0x33, + 0x59, 0x2b, 0x6d, 0x34, 0x51, 0x36, 0x67, 0x4c, 0x6b, 0x48, 0x33, 0x4c, + 0x70, 0x56, 0x48, 0x7a, 0x37, 0x7a, 0x39, 0x4d, 0x2f, 0x50, 0x32, 0x43, + 0x32, 0x46, 0x2b, 0x66, 0x70, 0x45, 0x72, 0x67, 0x55, 0x66, 0x43, 0x4a, + 0x7a, 0x44, 0x75, 0x70, 0x78, 0x42, 0x64, 0x4e, 0x34, 0x39, 0x63, 0x4f, + 0x53, 0x76, 0x6b, 0x42, 0x50, 0x42, 0x37, 0x0a, 0x6a, 0x56, 0x61, 0x4d, + 0x61, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, 0x65, 0x72, + 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, + 0x33, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x35, 0x20, 0x4f, 0x3d, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, + 0x36, 0x20, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, + 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, 0x65, 0x72, + 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, + 0x33, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x35, 0x20, 0x4f, 0x3d, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, + 0x36, 0x20, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, + 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x50, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x2d, 0x20, 0x47, 0x35, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x33, 0x30, 0x33, 0x37, 0x36, 0x34, + 0x34, 0x31, 0x36, 0x37, 0x35, 0x36, 0x38, 0x30, 0x35, 0x38, 0x39, 0x37, + 0x30, 0x31, 0x36, 0x34, 0x37, 0x31, 0x39, 0x34, 0x37, 0x35, 0x36, 0x37, + 0x36, 0x31, 0x30, 0x31, 0x34, 0x35, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x63, 0x62, 0x3a, 0x31, 0x37, 0x3a, 0x65, 0x34, 0x3a, + 0x33, 0x31, 0x3a, 0x36, 0x37, 0x3a, 0x33, 0x65, 0x3a, 0x65, 0x32, 0x3a, + 0x30, 0x39, 0x3a, 0x66, 0x65, 0x3a, 0x34, 0x35, 0x3a, 0x35, 0x37, 0x3a, + 0x39, 0x33, 0x3a, 0x66, 0x33, 0x3a, 0x30, 0x61, 0x3a, 0x66, 0x61, 0x3a, + 0x31, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, + 0x65, 0x3a, 0x62, 0x36, 0x3a, 0x64, 0x35, 0x3a, 0x37, 0x38, 0x3a, 0x34, + 0x39, 0x3a, 0x39, 0x62, 0x3a, 0x31, 0x63, 0x3a, 0x63, 0x66, 0x3a, 0x35, + 0x66, 0x3a, 0x35, 0x38, 0x3a, 0x31, 0x65, 0x3a, 0x61, 0x64, 0x3a, 0x35, + 0x36, 0x3a, 0x62, 0x65, 0x3a, 0x33, 0x64, 0x3a, 0x39, 0x62, 0x3a, 0x36, + 0x37, 0x3a, 0x34, 0x34, 0x3a, 0x61, 0x35, 0x3a, 0x65, 0x35, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x61, 0x3a, + 0x63, 0x66, 0x3a, 0x61, 0x62, 0x3a, 0x37, 0x65, 0x3a, 0x34, 0x33, 0x3a, + 0x63, 0x38, 0x3a, 0x64, 0x38, 0x3a, 0x38, 0x30, 0x3a, 0x64, 0x30, 0x3a, + 0x36, 0x62, 0x3a, 0x32, 0x36, 0x3a, 0x32, 0x61, 0x3a, 0x39, 0x34, 0x3a, + 0x64, 0x65, 0x3a, 0x65, 0x65, 0x3a, 0x65, 0x34, 0x3a, 0x62, 0x34, 0x3a, + 0x36, 0x35, 0x3a, 0x39, 0x39, 0x3a, 0x38, 0x39, 0x3a, 0x63, 0x33, 0x3a, + 0x64, 0x30, 0x3a, 0x63, 0x61, 0x3a, 0x66, 0x31, 0x3a, 0x39, 0x62, 0x3a, + 0x61, 0x66, 0x3a, 0x36, 0x34, 0x3a, 0x30, 0x35, 0x3a, 0x65, 0x34, 0x3a, + 0x31, 0x61, 0x3a, 0x62, 0x37, 0x3a, 0x64, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x30, 0x7a, 0x43, 0x43, 0x41, 0x37, 0x75, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x47, 0x4e, 0x72, + 0x52, 0x6e, 0x69, 0x5a, 0x39, 0x36, 0x4c, 0x74, 0x4b, 0x49, 0x56, 0x6a, + 0x4e, 0x7a, 0x47, 0x73, 0x37, 0x53, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, + 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x79, 0x6a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x46, 0x7a, 0x41, 0x56, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x54, 0x44, 0x6c, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, + 0x64, 0x75, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x52, + 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x0a, 0x45, + 0x78, 0x5a, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, + 0x69, 0x42, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x4f, 0x5a, + 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, 0x4d, 0x54, 0x6f, 0x77, 0x4f, + 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x7a, 0x45, 0x6f, 0x59, + 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4e, 0x69, 0x42, 0x57, 0x5a, + 0x58, 0x4a, 0x70, 0x0a, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x77, 0x67, + 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x69, 0x41, 0x74, 0x49, 0x45, 0x5a, 0x76, + 0x63, 0x69, 0x42, 0x68, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x65, 0x6d, 0x56, 0x6b, 0x49, 0x48, 0x56, 0x7a, 0x5a, 0x53, 0x42, 0x76, + 0x62, 0x6d, 0x78, 0x35, 0x4d, 0x55, 0x55, 0x77, 0x51, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x7a, 0x78, 0x57, 0x0a, 0x5a, 0x58, 0x4a, + 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x44, 0x62, 0x47, 0x46, + 0x7a, 0x63, 0x79, 0x41, 0x7a, 0x49, 0x46, 0x42, 0x31, 0x59, 0x6d, 0x78, + 0x70, 0x59, 0x79, 0x42, 0x51, 0x63, 0x6d, 0x6c, 0x74, 0x59, 0x58, 0x4a, + 0x35, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, + 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, + 0x30, 0x0a, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x49, 0x43, + 0x30, 0x67, 0x52, 0x7a, 0x55, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, + 0x59, 0x78, 0x4d, 0x54, 0x41, 0x34, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x59, 0x77, 0x4e, 0x7a, + 0x45, 0x32, 0x4d, 0x6a, 0x4d, 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, + 0x43, 0x42, 0x79, 0x6a, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, + 0x7a, 0x41, 0x56, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, + 0x6c, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, 0x4c, + 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x52, 0x38, 0x77, 0x48, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x5a, 0x57, 0x0a, + 0x5a, 0x58, 0x4a, 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x55, + 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, + 0x62, 0x33, 0x4a, 0x72, 0x4d, 0x54, 0x6f, 0x77, 0x4f, 0x41, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x7a, 0x45, 0x6f, 0x59, 0x79, 0x6b, 0x67, + 0x4d, 0x6a, 0x41, 0x77, 0x4e, 0x69, 0x42, 0x57, 0x5a, 0x58, 0x4a, 0x70, + 0x55, 0x32, 0x6c, 0x6e, 0x0a, 0x62, 0x69, 0x77, 0x67, 0x53, 0x57, 0x35, + 0x6a, 0x4c, 0x69, 0x41, 0x74, 0x49, 0x45, 0x5a, 0x76, 0x63, 0x69, 0x42, + 0x68, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x65, 0x6d, 0x56, + 0x6b, 0x49, 0x48, 0x56, 0x7a, 0x5a, 0x53, 0x42, 0x76, 0x62, 0x6d, 0x78, + 0x35, 0x4d, 0x55, 0x55, 0x77, 0x51, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x44, 0x45, 0x7a, 0x78, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x0a, 0x55, 0x32, + 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x44, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, + 0x41, 0x7a, 0x49, 0x46, 0x42, 0x31, 0x59, 0x6d, 0x78, 0x70, 0x59, 0x79, + 0x42, 0x51, 0x63, 0x6d, 0x6c, 0x74, 0x59, 0x58, 0x4a, 0x35, 0x49, 0x45, + 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, + 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, + 0x39, 0x79, 0x0a, 0x61, 0x58, 0x52, 0x35, 0x49, 0x43, 0x30, 0x67, 0x52, + 0x7a, 0x55, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, + 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, + 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, + 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, 0x76, 0x4a, + 0x41, 0x67, 0x49, 0x4b, 0x58, 0x6f, 0x31, 0x0a, 0x6e, 0x6d, 0x41, 0x4d, + 0x71, 0x75, 0x64, 0x4c, 0x4f, 0x30, 0x37, 0x63, 0x66, 0x4c, 0x77, 0x38, + 0x52, 0x52, 0x79, 0x37, 0x4b, 0x2b, 0x44, 0x2b, 0x4b, 0x51, 0x4c, 0x35, + 0x56, 0x77, 0x69, 0x6a, 0x5a, 0x49, 0x55, 0x56, 0x4a, 0x2f, 0x58, 0x78, + 0x72, 0x63, 0x67, 0x78, 0x69, 0x56, 0x30, 0x69, 0x36, 0x43, 0x71, 0x71, + 0x70, 0x6b, 0x4b, 0x7a, 0x6a, 0x2f, 0x69, 0x35, 0x56, 0x62, 0x65, 0x78, + 0x0a, 0x74, 0x30, 0x75, 0x7a, 0x2f, 0x6f, 0x39, 0x2b, 0x42, 0x31, 0x66, + 0x73, 0x37, 0x30, 0x50, 0x62, 0x5a, 0x6d, 0x49, 0x56, 0x59, 0x63, 0x39, + 0x67, 0x44, 0x61, 0x54, 0x59, 0x33, 0x76, 0x6a, 0x67, 0x77, 0x32, 0x49, + 0x49, 0x50, 0x56, 0x51, 0x54, 0x36, 0x30, 0x6e, 0x4b, 0x57, 0x56, 0x53, + 0x46, 0x4a, 0x75, 0x55, 0x72, 0x6a, 0x78, 0x75, 0x66, 0x36, 0x2f, 0x57, + 0x68, 0x6b, 0x63, 0x49, 0x7a, 0x0a, 0x53, 0x64, 0x68, 0x44, 0x59, 0x32, + 0x70, 0x53, 0x53, 0x39, 0x4b, 0x50, 0x36, 0x48, 0x42, 0x52, 0x54, 0x64, + 0x47, 0x4a, 0x61, 0x58, 0x76, 0x48, 0x63, 0x50, 0x61, 0x7a, 0x33, 0x42, + 0x4a, 0x30, 0x32, 0x33, 0x74, 0x64, 0x53, 0x31, 0x62, 0x54, 0x6c, 0x72, + 0x38, 0x56, 0x64, 0x36, 0x47, 0x77, 0x39, 0x4b, 0x49, 0x6c, 0x38, 0x71, + 0x38, 0x63, 0x6b, 0x6d, 0x63, 0x59, 0x35, 0x66, 0x51, 0x47, 0x0a, 0x42, + 0x4f, 0x2b, 0x51, 0x75, 0x65, 0x51, 0x41, 0x35, 0x4e, 0x30, 0x36, 0x74, + 0x52, 0x6e, 0x2f, 0x41, 0x72, 0x72, 0x30, 0x50, 0x4f, 0x37, 0x67, 0x69, + 0x2b, 0x73, 0x33, 0x69, 0x2b, 0x7a, 0x30, 0x31, 0x36, 0x7a, 0x79, 0x39, + 0x76, 0x41, 0x39, 0x72, 0x39, 0x31, 0x31, 0x6b, 0x54, 0x4d, 0x5a, 0x48, + 0x52, 0x78, 0x41, 0x79, 0x33, 0x51, 0x6b, 0x47, 0x53, 0x47, 0x54, 0x32, + 0x52, 0x54, 0x2b, 0x0a, 0x72, 0x43, 0x70, 0x53, 0x78, 0x34, 0x2f, 0x56, + 0x42, 0x45, 0x6e, 0x6b, 0x6a, 0x57, 0x4e, 0x48, 0x69, 0x44, 0x78, 0x70, + 0x67, 0x38, 0x76, 0x2b, 0x52, 0x37, 0x30, 0x72, 0x66, 0x6b, 0x2f, 0x46, + 0x6c, 0x61, 0x34, 0x4f, 0x6e, 0x64, 0x54, 0x52, 0x51, 0x38, 0x42, 0x6e, + 0x63, 0x2b, 0x4d, 0x55, 0x43, 0x48, 0x37, 0x6c, 0x50, 0x35, 0x39, 0x7a, + 0x75, 0x44, 0x4d, 0x4b, 0x7a, 0x31, 0x30, 0x2f, 0x0a, 0x4e, 0x49, 0x65, + 0x57, 0x69, 0x75, 0x35, 0x54, 0x36, 0x43, 0x55, 0x56, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x62, 0x49, 0x77, 0x67, 0x61, 0x38, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, + 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, + 0x45, 0x0a, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x62, 0x51, + 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x51, + 0x77, 0x45, 0x59, 0x54, 0x42, 0x66, 0x6f, 0x56, 0x32, 0x67, 0x57, 0x7a, + 0x42, 0x5a, 0x4d, 0x46, 0x63, 0x77, 0x56, 0x52, 0x59, 0x4a, 0x61, 0x57, + 0x31, 0x68, 0x5a, 0x32, 0x55, 0x76, 0x5a, 0x32, 0x6c, 0x6d, 0x4d, 0x43, + 0x45, 0x77, 0x48, 0x7a, 0x41, 0x48, 0x0a, 0x42, 0x67, 0x55, 0x72, 0x44, + 0x67, 0x4d, 0x43, 0x47, 0x67, 0x51, 0x55, 0x6a, 0x2b, 0x58, 0x54, 0x47, + 0x6f, 0x61, 0x73, 0x6a, 0x59, 0x35, 0x72, 0x77, 0x38, 0x2b, 0x41, 0x61, + 0x74, 0x52, 0x49, 0x47, 0x43, 0x78, 0x37, 0x47, 0x53, 0x34, 0x77, 0x4a, + 0x52, 0x59, 0x6a, 0x61, 0x48, 0x52, 0x30, 0x63, 0x44, 0x6f, 0x76, 0x4c, + 0x32, 0x78, 0x76, 0x5a, 0x32, 0x38, 0x75, 0x64, 0x6d, 0x56, 0x79, 0x0a, + 0x61, 0x58, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x75, 0x59, 0x32, 0x39, 0x74, + 0x4c, 0x33, 0x5a, 0x7a, 0x62, 0x47, 0x39, 0x6e, 0x62, 0x79, 0x35, 0x6e, + 0x61, 0x57, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x42, 0x42, 0x59, 0x45, 0x46, 0x48, 0x2f, 0x54, 0x5a, 0x61, 0x66, 0x43, + 0x33, 0x65, 0x79, 0x37, 0x38, 0x44, 0x41, 0x4a, 0x38, 0x30, 0x4d, 0x35, + 0x2b, 0x67, 0x4b, 0x76, 0x0a, 0x4d, 0x7a, 0x45, 0x7a, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x42, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, + 0x54, 0x4a, 0x45, 0x6f, 0x77, 0x58, 0x32, 0x4c, 0x50, 0x32, 0x42, 0x71, + 0x59, 0x4c, 0x7a, 0x33, 0x71, 0x33, 0x4a, 0x6b, 0x74, 0x76, 0x58, 0x66, + 0x32, 0x70, 0x58, 0x6b, 0x69, 0x4f, 0x4f, 0x7a, 0x45, 0x0a, 0x70, 0x36, + 0x42, 0x34, 0x45, 0x71, 0x31, 0x69, 0x44, 0x6b, 0x56, 0x77, 0x5a, 0x4d, + 0x58, 0x6e, 0x6c, 0x32, 0x59, 0x74, 0x6d, 0x41, 0x6c, 0x2b, 0x58, 0x36, + 0x2f, 0x57, 0x7a, 0x43, 0x68, 0x6c, 0x38, 0x67, 0x47, 0x71, 0x43, 0x42, + 0x70, 0x48, 0x33, 0x76, 0x6e, 0x35, 0x66, 0x4a, 0x4a, 0x61, 0x43, 0x47, + 0x6b, 0x67, 0x44, 0x64, 0x6b, 0x2b, 0x62, 0x57, 0x34, 0x38, 0x44, 0x57, + 0x37, 0x59, 0x0a, 0x35, 0x67, 0x61, 0x52, 0x51, 0x42, 0x69, 0x35, 0x2b, + 0x4d, 0x48, 0x74, 0x33, 0x39, 0x74, 0x42, 0x71, 0x75, 0x43, 0x57, 0x49, + 0x4d, 0x6e, 0x4e, 0x5a, 0x42, 0x55, 0x34, 0x67, 0x63, 0x6d, 0x55, 0x37, + 0x71, 0x4b, 0x45, 0x4b, 0x51, 0x73, 0x54, 0x62, 0x34, 0x37, 0x62, 0x44, + 0x4e, 0x30, 0x6c, 0x41, 0x74, 0x75, 0x6b, 0x69, 0x78, 0x6c, 0x45, 0x30, + 0x6b, 0x46, 0x36, 0x42, 0x57, 0x6c, 0x4b, 0x0a, 0x57, 0x45, 0x39, 0x67, + 0x79, 0x6e, 0x36, 0x43, 0x61, 0x67, 0x73, 0x43, 0x71, 0x69, 0x55, 0x58, + 0x4f, 0x62, 0x58, 0x62, 0x66, 0x2b, 0x65, 0x45, 0x5a, 0x53, 0x71, 0x56, + 0x69, 0x72, 0x32, 0x47, 0x33, 0x6c, 0x36, 0x42, 0x46, 0x6f, 0x4d, 0x74, + 0x45, 0x4d, 0x7a, 0x65, 0x2f, 0x61, 0x69, 0x43, 0x4b, 0x6d, 0x30, 0x6f, + 0x48, 0x77, 0x30, 0x4c, 0x78, 0x4f, 0x58, 0x6e, 0x47, 0x69, 0x59, 0x5a, + 0x0a, 0x34, 0x66, 0x51, 0x52, 0x62, 0x78, 0x43, 0x31, 0x6c, 0x66, 0x7a, + 0x6e, 0x51, 0x67, 0x55, 0x79, 0x32, 0x38, 0x36, 0x64, 0x55, 0x56, 0x34, + 0x6f, 0x74, 0x70, 0x36, 0x46, 0x30, 0x31, 0x76, 0x76, 0x70, 0x58, 0x31, + 0x46, 0x51, 0x48, 0x4b, 0x4f, 0x74, 0x77, 0x35, 0x72, 0x44, 0x67, 0x62, + 0x37, 0x4d, 0x7a, 0x56, 0x49, 0x63, 0x62, 0x69, 0x64, 0x4a, 0x34, 0x76, + 0x45, 0x5a, 0x56, 0x38, 0x4e, 0x0a, 0x68, 0x6e, 0x61, 0x63, 0x52, 0x48, + 0x72, 0x32, 0x6c, 0x56, 0x7a, 0x32, 0x58, 0x54, 0x49, 0x49, 0x4d, 0x36, + 0x52, 0x55, 0x74, 0x68, 0x67, 0x2f, 0x61, 0x46, 0x7a, 0x79, 0x51, 0x6b, + 0x71, 0x46, 0x4f, 0x46, 0x53, 0x44, 0x58, 0x39, 0x48, 0x6f, 0x4c, 0x50, + 0x4b, 0x73, 0x45, 0x64, 0x61, 0x6f, 0x37, 0x57, 0x4e, 0x71, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x65, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, + 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x65, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x4f, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x31, 0x37, 0x31, 0x39, 0x39, 0x37, 0x37, 0x34, 0x35, + 0x38, 0x39, 0x31, 0x32, 0x35, 0x32, 0x37, 0x37, 0x37, 0x38, 0x38, 0x33, + 0x36, 0x32, 0x37, 0x35, 0x37, 0x30, 0x31, 0x34, 0x32, 0x36, 0x36, 0x38, + 0x36, 0x32, 0x30, 0x33, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x64, 0x63, 0x3a, 0x33, 0x32, 0x3a, 0x63, 0x33, 0x3a, 0x61, 0x37, + 0x3a, 0x36, 0x64, 0x3a, 0x32, 0x35, 0x3a, 0x35, 0x37, 0x3a, 0x63, 0x37, + 0x3a, 0x36, 0x38, 0x3a, 0x30, 0x39, 0x3a, 0x39, 0x64, 0x3a, 0x65, 0x61, + 0x3a, 0x32, 0x64, 0x3a, 0x61, 0x39, 0x3a, 0x61, 0x32, 0x3a, 0x64, 0x31, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x37, 0x3a, + 0x38, 0x32, 0x3a, 0x63, 0x36, 0x3a, 0x63, 0x33, 0x3a, 0x30, 0x34, 0x3a, + 0x33, 0x35, 0x3a, 0x33, 0x62, 0x3a, 0x63, 0x66, 0x3a, 0x64, 0x32, 0x3a, + 0x39, 0x36, 0x3a, 0x39, 0x32, 0x3a, 0x64, 0x32, 0x3a, 0x35, 0x39, 0x3a, + 0x33, 0x65, 0x3a, 0x37, 0x64, 0x3a, 0x34, 0x34, 0x3a, 0x64, 0x39, 0x3a, + 0x33, 0x34, 0x3a, 0x66, 0x66, 0x3a, 0x31, 0x31, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x31, 0x3a, 0x63, 0x31, + 0x3a, 0x62, 0x35, 0x3a, 0x30, 0x61, 0x3a, 0x65, 0x35, 0x3a, 0x61, 0x32, + 0x3a, 0x30, 0x64, 0x3a, 0x64, 0x38, 0x3a, 0x30, 0x33, 0x3a, 0x30, 0x65, + 0x3a, 0x63, 0x39, 0x3a, 0x66, 0x36, 0x3a, 0x62, 0x63, 0x3a, 0x32, 0x34, + 0x3a, 0x38, 0x32, 0x3a, 0x33, 0x64, 0x3a, 0x64, 0x33, 0x3a, 0x36, 0x37, + 0x3a, 0x62, 0x35, 0x3a, 0x32, 0x35, 0x3a, 0x35, 0x37, 0x3a, 0x35, 0x39, + 0x3a, 0x62, 0x34, 0x3a, 0x65, 0x37, 0x3a, 0x31, 0x62, 0x3a, 0x36, 0x31, + 0x3a, 0x66, 0x63, 0x3a, 0x65, 0x39, 0x3a, 0x66, 0x37, 0x3a, 0x33, 0x37, + 0x3a, 0x35, 0x64, 0x3a, 0x37, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x44, 0x75, 0x44, 0x43, 0x43, 0x41, 0x71, 0x43, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x44, 0x50, 0x43, 0x4f, 0x58, + 0x41, 0x67, 0x57, 0x70, 0x61, 0x31, 0x43, 0x66, 0x2f, 0x44, 0x72, 0x4a, + 0x78, 0x68, 0x5a, 0x30, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, + 0x44, 0x42, 0x49, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x67, + 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x58, + 0x55, 0x32, 0x56, 0x6a, 0x64, 0x58, 0x4a, 0x6c, 0x56, 0x48, 0x4a, 0x31, + 0x63, 0x33, 0x51, 0x67, 0x51, 0x32, 0x39, 0x79, 0x63, 0x47, 0x39, 0x79, + 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x78, 0x0a, 0x46, 0x7a, 0x41, + 0x56, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x44, 0x6c, 0x4e, + 0x6c, 0x59, 0x33, 0x56, 0x79, 0x5a, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, + 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, + 0x32, 0x4d, 0x54, 0x45, 0x77, 0x4e, 0x7a, 0x45, 0x35, 0x4d, 0x7a, 0x45, + 0x78, 0x4f, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x35, 0x4d, 0x54, 0x49, + 0x7a, 0x0a, 0x4d, 0x54, 0x45, 0x35, 0x4e, 0x44, 0x41, 0x31, 0x4e, 0x56, + 0x6f, 0x77, 0x53, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x49, 0x44, + 0x41, 0x65, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x46, 0x31, + 0x4e, 0x6c, 0x59, 0x33, 0x56, 0x79, 0x5a, 0x56, 0x52, 0x79, 0x64, 0x58, + 0x4e, 0x30, 0x49, 0x45, 0x4e, 0x76, 0x0a, 0x63, 0x6e, 0x42, 0x76, 0x63, + 0x6d, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x4d, 0x52, 0x63, 0x77, 0x46, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x77, 0x35, 0x54, 0x5a, + 0x57, 0x4e, 0x31, 0x63, 0x6d, 0x56, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, + 0x43, 0x42, 0x44, 0x51, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x0a, + 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, + 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x4b, 0x75, 0x6b, 0x67, 0x65, 0x57, 0x56, 0x7a, 0x66, 0x58, 0x32, + 0x46, 0x49, 0x37, 0x43, 0x54, 0x38, 0x72, 0x55, 0x34, 0x6e, 0x69, 0x56, + 0x57, 0x4a, 0x78, 0x42, 0x34, 0x51, 0x32, 0x5a, 0x51, 0x43, 0x51, 0x58, + 0x4f, 0x5a, 0x45, 0x7a, 0x0a, 0x5a, 0x75, 0x6d, 0x2b, 0x34, 0x59, 0x4f, + 0x76, 0x59, 0x6c, 0x79, 0x4a, 0x30, 0x66, 0x77, 0x6b, 0x57, 0x32, 0x47, + 0x7a, 0x34, 0x42, 0x45, 0x52, 0x51, 0x52, 0x77, 0x64, 0x62, 0x76, 0x43, + 0x34, 0x75, 0x2f, 0x6a, 0x65, 0x70, 0x34, 0x47, 0x36, 0x70, 0x6b, 0x6a, + 0x47, 0x6e, 0x78, 0x32, 0x39, 0x76, 0x6f, 0x36, 0x70, 0x51, 0x54, 0x36, + 0x34, 0x6c, 0x4f, 0x30, 0x70, 0x47, 0x74, 0x53, 0x4f, 0x0a, 0x30, 0x67, + 0x4d, 0x64, 0x41, 0x2b, 0x39, 0x74, 0x44, 0x57, 0x63, 0x63, 0x56, 0x39, + 0x63, 0x47, 0x72, 0x63, 0x72, 0x49, 0x39, 0x66, 0x34, 0x4f, 0x72, 0x32, + 0x59, 0x6c, 0x53, 0x41, 0x53, 0x57, 0x43, 0x31, 0x32, 0x6a, 0x75, 0x68, + 0x62, 0x44, 0x43, 0x45, 0x2f, 0x52, 0x52, 0x76, 0x67, 0x55, 0x58, 0x50, + 0x4c, 0x49, 0x58, 0x67, 0x47, 0x5a, 0x62, 0x66, 0x32, 0x49, 0x7a, 0x49, + 0x61, 0x6f, 0x0a, 0x77, 0x57, 0x38, 0x78, 0x51, 0x6d, 0x78, 0x53, 0x50, + 0x6d, 0x6a, 0x4c, 0x38, 0x78, 0x6b, 0x30, 0x33, 0x37, 0x75, 0x48, 0x47, + 0x46, 0x61, 0x41, 0x4a, 0x73, 0x54, 0x51, 0x33, 0x4d, 0x42, 0x76, 0x33, + 0x39, 0x36, 0x67, 0x77, 0x70, 0x45, 0x57, 0x6f, 0x47, 0x51, 0x52, 0x53, + 0x30, 0x53, 0x38, 0x48, 0x76, 0x62, 0x6e, 0x2b, 0x6d, 0x50, 0x65, 0x5a, + 0x71, 0x78, 0x32, 0x70, 0x48, 0x47, 0x6a, 0x0a, 0x37, 0x44, 0x61, 0x55, + 0x61, 0x48, 0x70, 0x33, 0x70, 0x4c, 0x48, 0x6e, 0x44, 0x69, 0x2b, 0x42, + 0x65, 0x75, 0x4b, 0x31, 0x63, 0x6f, 0x62, 0x76, 0x6f, 0x6d, 0x75, 0x4c, + 0x38, 0x41, 0x2f, 0x62, 0x30, 0x31, 0x6b, 0x2f, 0x75, 0x6e, 0x4b, 0x38, + 0x52, 0x43, 0x53, 0x63, 0x34, 0x33, 0x4f, 0x7a, 0x39, 0x36, 0x39, 0x58, + 0x4c, 0x30, 0x49, 0x6d, 0x6e, 0x61, 0x6c, 0x30, 0x75, 0x67, 0x42, 0x53, + 0x0a, 0x38, 0x6b, 0x76, 0x4e, 0x55, 0x33, 0x78, 0x48, 0x43, 0x7a, 0x61, + 0x46, 0x44, 0x6d, 0x61, 0x70, 0x43, 0x4a, 0x63, 0x57, 0x4e, 0x46, 0x66, + 0x42, 0x5a, 0x76, 0x65, 0x41, 0x34, 0x2b, 0x31, 0x77, 0x56, 0x4d, 0x65, + 0x54, 0x34, 0x43, 0x34, 0x6f, 0x46, 0x56, 0x6d, 0x48, 0x75, 0x72, 0x73, + 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, 0x42, 0x6e, 0x54, 0x43, + 0x42, 0x6d, 0x6a, 0x41, 0x54, 0x0a, 0x42, 0x67, 0x6b, 0x72, 0x42, 0x67, + 0x45, 0x45, 0x41, 0x59, 0x49, 0x33, 0x46, 0x41, 0x49, 0x45, 0x42, 0x68, + 0x34, 0x45, 0x41, 0x45, 0x4d, 0x41, 0x51, 0x54, 0x41, 0x4c, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x59, + 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x0a, 0x2f, + 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, + 0x67, 0x51, 0x55, 0x51, 0x6a, 0x4b, 0x32, 0x46, 0x76, 0x6f, 0x45, 0x2f, + 0x66, 0x35, 0x64, 0x53, 0x33, 0x72, 0x44, 0x2f, 0x66, 0x64, 0x4d, 0x51, + 0x42, 0x31, 0x61, 0x51, 0x36, 0x38, 0x77, 0x4e, 0x41, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x66, 0x42, 0x43, 0x30, 0x77, 0x4b, 0x7a, 0x41, 0x70, 0x6f, + 0x43, 0x65, 0x67, 0x0a, 0x4a, 0x59, 0x59, 0x6a, 0x61, 0x48, 0x52, 0x30, + 0x63, 0x44, 0x6f, 0x76, 0x4c, 0x32, 0x4e, 0x79, 0x62, 0x43, 0x35, 0x7a, + 0x5a, 0x57, 0x4e, 0x31, 0x63, 0x6d, 0x56, 0x30, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x76, 0x55, 0x31, 0x52, 0x44, + 0x51, 0x53, 0x35, 0x6a, 0x63, 0x6d, 0x77, 0x77, 0x45, 0x41, 0x59, 0x4a, + 0x4b, 0x77, 0x59, 0x42, 0x42, 0x41, 0x47, 0x43, 0x0a, 0x4e, 0x78, 0x55, + 0x42, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x41, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x44, 0x44, + 0x74, 0x54, 0x30, 0x72, 0x68, 0x57, 0x44, 0x70, 0x53, 0x63, 0x6c, 0x75, + 0x31, 0x70, 0x71, 0x4e, 0x6c, 0x47, 0x4b, 0x61, 0x37, 0x55, 0x54, 0x74, + 0x33, 0x0a, 0x36, 0x5a, 0x33, 0x71, 0x30, 0x35, 0x39, 0x63, 0x34, 0x45, + 0x56, 0x6c, 0x65, 0x77, 0x33, 0x4b, 0x57, 0x2b, 0x4a, 0x77, 0x55, 0x4c, + 0x4b, 0x55, 0x42, 0x52, 0x53, 0x75, 0x53, 0x63, 0x65, 0x4e, 0x51, 0x51, + 0x63, 0x53, 0x63, 0x35, 0x52, 0x2b, 0x44, 0x43, 0x4d, 0x68, 0x2f, 0x62, + 0x77, 0x51, 0x66, 0x32, 0x41, 0x51, 0x57, 0x6e, 0x4c, 0x31, 0x6d, 0x41, + 0x36, 0x73, 0x37, 0x4c, 0x6c, 0x2f, 0x0a, 0x33, 0x58, 0x70, 0x76, 0x58, + 0x64, 0x4d, 0x63, 0x39, 0x50, 0x2b, 0x49, 0x42, 0x57, 0x6c, 0x43, 0x71, + 0x51, 0x56, 0x78, 0x79, 0x4c, 0x65, 0x73, 0x4a, 0x75, 0x67, 0x75, 0x74, + 0x49, 0x78, 0x71, 0x2f, 0x33, 0x48, 0x63, 0x75, 0x4c, 0x48, 0x66, 0x6d, + 0x62, 0x78, 0x38, 0x49, 0x56, 0x51, 0x72, 0x35, 0x46, 0x69, 0x69, 0x75, + 0x31, 0x63, 0x70, 0x72, 0x70, 0x36, 0x70, 0x6f, 0x78, 0x6b, 0x6d, 0x0a, + 0x44, 0x35, 0x6b, 0x75, 0x43, 0x4c, 0x44, 0x76, 0x2f, 0x57, 0x6e, 0x50, + 0x6d, 0x52, 0x6f, 0x4a, 0x6a, 0x65, 0x4f, 0x6e, 0x6e, 0x79, 0x76, 0x4a, + 0x4e, 0x6a, 0x52, 0x37, 0x4a, 0x4c, 0x4e, 0x34, 0x54, 0x4a, 0x55, 0x58, + 0x70, 0x41, 0x59, 0x6d, 0x48, 0x72, 0x5a, 0x6b, 0x55, 0x6a, 0x5a, 0x66, + 0x59, 0x47, 0x66, 0x5a, 0x6e, 0x4d, 0x55, 0x46, 0x64, 0x41, 0x76, 0x6e, + 0x5a, 0x79, 0x50, 0x53, 0x0a, 0x43, 0x50, 0x79, 0x49, 0x36, 0x61, 0x36, + 0x4c, 0x66, 0x2b, 0x45, 0x77, 0x39, 0x44, 0x64, 0x2b, 0x2f, 0x63, 0x59, + 0x79, 0x32, 0x69, 0x32, 0x65, 0x52, 0x44, 0x41, 0x77, 0x62, 0x4f, 0x34, + 0x48, 0x33, 0x74, 0x49, 0x30, 0x2f, 0x4e, 0x4c, 0x2f, 0x51, 0x50, 0x5a, + 0x4c, 0x39, 0x47, 0x5a, 0x47, 0x42, 0x6c, 0x53, 0x6d, 0x38, 0x6a, 0x49, + 0x4b, 0x59, 0x79, 0x59, 0x77, 0x61, 0x35, 0x76, 0x52, 0x0a, 0x33, 0x49, + 0x74, 0x48, 0x75, 0x75, 0x47, 0x35, 0x31, 0x57, 0x4c, 0x51, 0x6f, 0x71, + 0x44, 0x30, 0x5a, 0x77, 0x56, 0x34, 0x4b, 0x57, 0x4d, 0x61, 0x62, 0x77, + 0x54, 0x57, 0x2b, 0x4d, 0x5a, 0x4d, 0x6f, 0x35, 0x71, 0x78, 0x4e, 0x37, + 0x53, 0x4e, 0x35, 0x53, 0x68, 0x4c, 0x48, 0x5a, 0x34, 0x73, 0x77, 0x72, + 0x68, 0x6f, 0x76, 0x4f, 0x30, 0x43, 0x37, 0x6a, 0x45, 0x3d, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x65, + 0x63, 0x75, 0x72, 0x65, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, + 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x20, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x39, 0x37, 0x35, + 0x31, 0x38, 0x33, 0x36, 0x31, 0x36, 0x37, 0x37, 0x33, 0x31, 0x30, 0x35, + 0x31, 0x35, 0x35, 0x34, 0x32, 0x33, 0x32, 0x31, 0x31, 0x39, 0x34, 0x38, + 0x31, 0x34, 0x35, 0x36, 0x39, 0x37, 0x38, 0x35, 0x39, 0x37, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x66, 0x3a, 0x66, 0x34, 0x3a, + 0x32, 0x37, 0x3a, 0x30, 0x64, 0x3a, 0x64, 0x34, 0x3a, 0x65, 0x64, 0x3a, + 0x64, 0x63, 0x3a, 0x36, 0x35, 0x3a, 0x31, 0x36, 0x3a, 0x34, 0x39, 0x3a, + 0x36, 0x64, 0x3a, 0x33, 0x64, 0x3a, 0x64, 0x61, 0x3a, 0x62, 0x66, 0x3a, + 0x36, 0x65, 0x3a, 0x64, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x33, 0x61, 0x3a, 0x34, 0x34, 0x3a, 0x37, 0x33, 0x3a, 0x35, + 0x61, 0x3a, 0x65, 0x35, 0x3a, 0x38, 0x31, 0x3a, 0x39, 0x30, 0x3a, 0x31, + 0x66, 0x3a, 0x32, 0x34, 0x3a, 0x38, 0x36, 0x3a, 0x36, 0x31, 0x3a, 0x34, + 0x36, 0x3a, 0x31, 0x65, 0x3a, 0x33, 0x62, 0x3a, 0x39, 0x63, 0x3a, 0x63, + 0x34, 0x3a, 0x35, 0x66, 0x3a, 0x66, 0x35, 0x3a, 0x33, 0x61, 0x3a, 0x31, + 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x34, 0x32, 0x3a, 0x30, 0x30, 0x3a, 0x66, 0x35, 0x3a, 0x30, 0x34, 0x3a, + 0x33, 0x61, 0x3a, 0x63, 0x38, 0x3a, 0x35, 0x39, 0x3a, 0x30, 0x65, 0x3a, + 0x62, 0x62, 0x3a, 0x35, 0x32, 0x3a, 0x37, 0x64, 0x3a, 0x32, 0x30, 0x3a, + 0x39, 0x65, 0x3a, 0x64, 0x31, 0x3a, 0x35, 0x30, 0x3a, 0x33, 0x30, 0x3a, + 0x32, 0x39, 0x3a, 0x66, 0x62, 0x3a, 0x63, 0x62, 0x3a, 0x64, 0x34, 0x3a, + 0x31, 0x63, 0x3a, 0x61, 0x31, 0x3a, 0x62, 0x35, 0x3a, 0x30, 0x36, 0x3a, + 0x65, 0x63, 0x3a, 0x32, 0x37, 0x3a, 0x66, 0x31, 0x3a, 0x35, 0x61, 0x3a, + 0x64, 0x65, 0x3a, 0x37, 0x64, 0x3a, 0x61, 0x63, 0x3a, 0x36, 0x39, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x76, 0x44, 0x43, 0x43, + 0x41, 0x71, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, + 0x42, 0x31, 0x59, 0x69, 0x70, 0x4f, 0x6a, 0x55, 0x69, 0x6f, 0x6c, 0x4e, + 0x39, 0x42, 0x50, 0x49, 0x38, 0x50, 0x6a, 0x71, 0x70, 0x54, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x4b, 0x0a, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x56, 0x55, 0x7a, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x58, 0x55, 0x32, 0x56, 0x6a, 0x64, 0x58, 0x4a, + 0x6c, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x51, 0x32, 0x39, + 0x79, 0x63, 0x47, 0x39, 0x79, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, + 0x78, 0x0a, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x4d, 0x54, 0x45, 0x46, 0x4e, 0x6c, 0x59, 0x33, 0x56, 0x79, 0x5a, 0x53, + 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x67, 0x51, 0x30, + 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x59, 0x78, 0x4d, 0x54, + 0x41, 0x33, 0x4d, 0x54, 0x6b, 0x30, 0x4d, 0x6a, 0x49, 0x34, 0x57, 0x68, + 0x63, 0x4e, 0x4d, 0x6a, 0x6b, 0x78, 0x0a, 0x4d, 0x6a, 0x4d, 0x78, 0x4d, + 0x54, 0x6b, 0x31, 0x4d, 0x6a, 0x41, 0x32, 0x57, 0x6a, 0x42, 0x4b, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x58, 0x55, 0x32, 0x56, 0x6a, 0x64, + 0x58, 0x4a, 0x6c, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x0a, + 0x51, 0x32, 0x39, 0x79, 0x63, 0x47, 0x39, 0x79, 0x59, 0x58, 0x52, 0x70, + 0x62, 0x32, 0x34, 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x54, 0x45, 0x46, 0x4e, 0x6c, 0x59, 0x33, 0x56, 0x79, + 0x5a, 0x53, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x67, + 0x51, 0x30, 0x45, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, + 0x43, 0x53, 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, + 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, + 0x76, 0x4e, 0x53, 0x37, 0x59, 0x72, 0x47, 0x78, 0x56, 0x61, 0x51, 0x5a, + 0x78, 0x35, 0x52, 0x4e, 0x6f, 0x4a, 0x4c, 0x4e, 0x50, 0x32, 0x4d, 0x77, + 0x68, 0x52, 0x2f, 0x6a, 0x78, 0x59, 0x44, 0x69, 0x4a, 0x0a, 0x69, 0x51, + 0x50, 0x70, 0x76, 0x65, 0x70, 0x65, 0x52, 0x6c, 0x4d, 0x4a, 0x33, 0x46, + 0x7a, 0x31, 0x57, 0x75, 0x6a, 0x33, 0x52, 0x53, 0x6f, 0x43, 0x36, 0x7a, + 0x46, 0x68, 0x31, 0x79, 0x6b, 0x7a, 0x54, 0x4d, 0x37, 0x48, 0x66, 0x41, + 0x6f, 0x33, 0x66, 0x67, 0x2b, 0x36, 0x4d, 0x70, 0x6a, 0x68, 0x48, 0x5a, + 0x65, 0x76, 0x6a, 0x38, 0x66, 0x63, 0x79, 0x54, 0x69, 0x57, 0x38, 0x39, + 0x73, 0x61, 0x0a, 0x2f, 0x46, 0x48, 0x74, 0x61, 0x4d, 0x62, 0x51, 0x62, + 0x71, 0x52, 0x38, 0x4a, 0x4e, 0x47, 0x75, 0x51, 0x73, 0x69, 0x57, 0x55, + 0x47, 0x4d, 0x75, 0x34, 0x50, 0x35, 0x31, 0x2f, 0x70, 0x69, 0x6e, 0x58, + 0x30, 0x6b, 0x75, 0x6c, 0x65, 0x4d, 0x35, 0x4d, 0x32, 0x53, 0x4f, 0x48, + 0x71, 0x52, 0x66, 0x6b, 0x4e, 0x4a, 0x6e, 0x50, 0x4c, 0x4c, 0x5a, 0x2f, + 0x6b, 0x47, 0x35, 0x56, 0x61, 0x63, 0x4a, 0x0a, 0x6a, 0x6e, 0x49, 0x46, + 0x48, 0x6f, 0x76, 0x64, 0x52, 0x49, 0x57, 0x43, 0x51, 0x74, 0x42, 0x4a, + 0x77, 0x42, 0x31, 0x67, 0x38, 0x4e, 0x45, 0x58, 0x4c, 0x4a, 0x58, 0x72, + 0x39, 0x71, 0x58, 0x42, 0x6b, 0x71, 0x50, 0x46, 0x77, 0x71, 0x63, 0x49, + 0x59, 0x41, 0x31, 0x67, 0x42, 0x42, 0x43, 0x57, 0x65, 0x5a, 0x34, 0x57, + 0x4e, 0x4f, 0x61, 0x70, 0x74, 0x76, 0x6f, 0x6c, 0x52, 0x54, 0x6e, 0x49, + 0x0a, 0x48, 0x6d, 0x58, 0x35, 0x6b, 0x2f, 0x57, 0x71, 0x38, 0x56, 0x4c, + 0x63, 0x6d, 0x5a, 0x67, 0x39, 0x70, 0x59, 0x59, 0x61, 0x44, 0x44, 0x55, + 0x7a, 0x2b, 0x6b, 0x75, 0x6c, 0x42, 0x41, 0x59, 0x56, 0x48, 0x44, 0x47, + 0x41, 0x37, 0x36, 0x6f, 0x59, 0x61, 0x38, 0x4a, 0x37, 0x31, 0x39, 0x72, + 0x4f, 0x2b, 0x54, 0x4d, 0x67, 0x31, 0x66, 0x57, 0x39, 0x61, 0x6a, 0x4d, + 0x74, 0x67, 0x51, 0x54, 0x37, 0x0a, 0x73, 0x46, 0x7a, 0x55, 0x6e, 0x4b, + 0x50, 0x69, 0x58, 0x42, 0x33, 0x6a, 0x71, 0x55, 0x4a, 0x31, 0x58, 0x6e, + 0x76, 0x55, 0x64, 0x2b, 0x38, 0x35, 0x56, 0x4c, 0x72, 0x4a, 0x43, 0x68, + 0x67, 0x62, 0x45, 0x70, 0x6c, 0x4a, 0x4c, 0x34, 0x68, 0x4c, 0x2f, 0x56, + 0x42, 0x69, 0x30, 0x58, 0x50, 0x6e, 0x6a, 0x33, 0x70, 0x44, 0x41, 0x67, + 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x5a, 0x30, 0x77, 0x0a, 0x67, + 0x5a, 0x6f, 0x77, 0x45, 0x77, 0x59, 0x4a, 0x4b, 0x77, 0x59, 0x42, 0x42, + 0x41, 0x47, 0x43, 0x4e, 0x78, 0x51, 0x43, 0x42, 0x41, 0x59, 0x65, 0x42, + 0x41, 0x42, 0x44, 0x41, 0x45, 0x45, 0x77, 0x43, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x50, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, 0x4d, + 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x46, 0x0a, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x4b, 0x39, 0x45, 0x42, 0x4d, 0x4a, 0x42, 0x66, 0x6b, 0x69, 0x44, + 0x32, 0x30, 0x34, 0x35, 0x41, 0x75, 0x7a, 0x73, 0x68, 0x48, 0x72, 0x6d, + 0x7a, 0x73, 0x6d, 0x6b, 0x4d, 0x44, 0x51, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x48, 0x77, 0x51, 0x74, 0x4d, 0x43, 0x73, 0x77, 0x0a, 0x4b, 0x61, 0x41, + 0x6e, 0x6f, 0x43, 0x57, 0x47, 0x49, 0x32, 0x68, 0x30, 0x64, 0x48, 0x41, + 0x36, 0x4c, 0x79, 0x39, 0x6a, 0x63, 0x6d, 0x77, 0x75, 0x63, 0x32, 0x56, + 0x6a, 0x64, 0x58, 0x4a, 0x6c, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, + 0x75, 0x59, 0x32, 0x39, 0x74, 0x4c, 0x31, 0x4e, 0x48, 0x51, 0x30, 0x45, + 0x75, 0x59, 0x33, 0x4a, 0x73, 0x4d, 0x42, 0x41, 0x47, 0x43, 0x53, 0x73, + 0x47, 0x0a, 0x41, 0x51, 0x51, 0x42, 0x67, 0x6a, 0x63, 0x56, 0x41, 0x51, + 0x51, 0x44, 0x41, 0x67, 0x45, 0x41, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x42, 0x6a, 0x47, 0x67, + 0x68, 0x41, 0x66, 0x61, 0x52, 0x65, 0x55, 0x77, 0x31, 0x33, 0x32, 0x48, + 0x71, 0x75, 0x48, 0x77, 0x30, 0x4c, 0x0a, 0x55, 0x52, 0x59, 0x44, 0x37, + 0x78, 0x68, 0x38, 0x79, 0x4f, 0x4f, 0x76, 0x61, 0x6c, 0x69, 0x54, 0x46, + 0x47, 0x43, 0x52, 0x73, 0x6f, 0x54, 0x63, 0x69, 0x45, 0x36, 0x2b, 0x4f, + 0x59, 0x6f, 0x36, 0x38, 0x2b, 0x61, 0x43, 0x69, 0x56, 0x30, 0x42, 0x4e, + 0x37, 0x4f, 0x72, 0x4a, 0x4b, 0x51, 0x56, 0x44, 0x70, 0x49, 0x31, 0x57, + 0x6b, 0x70, 0x45, 0x58, 0x6b, 0x35, 0x58, 0x2b, 0x6e, 0x58, 0x4f, 0x0a, + 0x48, 0x30, 0x6a, 0x4f, 0x5a, 0x76, 0x51, 0x38, 0x51, 0x43, 0x61, 0x53, + 0x6d, 0x47, 0x77, 0x62, 0x37, 0x69, 0x52, 0x47, 0x44, 0x42, 0x65, 0x7a, + 0x55, 0x71, 0x58, 0x62, 0x70, 0x5a, 0x47, 0x52, 0x7a, 0x7a, 0x66, 0x54, + 0x62, 0x2b, 0x63, 0x6e, 0x43, 0x44, 0x70, 0x4f, 0x47, 0x52, 0x38, 0x36, + 0x70, 0x31, 0x68, 0x63, 0x46, 0x38, 0x39, 0x35, 0x50, 0x34, 0x76, 0x6b, + 0x70, 0x39, 0x4d, 0x6d, 0x0a, 0x49, 0x35, 0x30, 0x6d, 0x44, 0x31, 0x68, + 0x70, 0x2f, 0x45, 0x64, 0x2b, 0x73, 0x74, 0x43, 0x4e, 0x69, 0x35, 0x4f, + 0x2f, 0x4b, 0x55, 0x39, 0x44, 0x61, 0x58, 0x52, 0x32, 0x5a, 0x30, 0x76, + 0x50, 0x42, 0x34, 0x7a, 0x6d, 0x41, 0x76, 0x65, 0x31, 0x34, 0x62, 0x52, + 0x44, 0x74, 0x55, 0x73, 0x74, 0x46, 0x4a, 0x2f, 0x35, 0x33, 0x43, 0x59, + 0x4e, 0x76, 0x36, 0x5a, 0x48, 0x64, 0x41, 0x62, 0x59, 0x0a, 0x69, 0x4e, + 0x45, 0x36, 0x4b, 0x54, 0x43, 0x45, 0x7a, 0x74, 0x49, 0x35, 0x67, 0x47, + 0x49, 0x62, 0x71, 0x4d, 0x64, 0x58, 0x53, 0x62, 0x78, 0x71, 0x56, 0x56, + 0x46, 0x6e, 0x46, 0x55, 0x71, 0x2b, 0x4e, 0x51, 0x66, 0x6b, 0x31, 0x58, + 0x57, 0x59, 0x4e, 0x33, 0x6b, 0x77, 0x46, 0x4e, 0x73, 0x70, 0x6e, 0x57, + 0x7a, 0x46, 0x61, 0x63, 0x78, 0x48, 0x56, 0x61, 0x49, 0x77, 0x39, 0x38, + 0x78, 0x63, 0x0a, 0x66, 0x38, 0x4c, 0x44, 0x6d, 0x42, 0x78, 0x72, 0x54, + 0x68, 0x61, 0x41, 0x36, 0x33, 0x70, 0x34, 0x5a, 0x55, 0x57, 0x69, 0x41, + 0x42, 0x71, 0x76, 0x44, 0x41, 0x31, 0x56, 0x5a, 0x44, 0x52, 0x49, 0x75, + 0x4a, 0x4b, 0x35, 0x38, 0x62, 0x52, 0x51, 0x4b, 0x66, 0x4a, 0x50, 0x49, + 0x78, 0x2f, 0x61, 0x62, 0x4b, 0x77, 0x66, 0x52, 0x4f, 0x48, 0x64, 0x49, + 0x33, 0x68, 0x52, 0x57, 0x38, 0x63, 0x57, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x43, 0x4f, 0x4d, + 0x4f, 0x44, 0x4f, 0x20, 0x43, 0x41, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x4f, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x43, 0x41, 0x20, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x30, 0x34, 0x33, 0x35, 0x30, 0x35, 0x31, 0x33, 0x36, 0x34, 0x38, + 0x32, 0x34, 0x39, 0x32, 0x33, 0x32, 0x39, 0x34, 0x31, 0x39, 0x39, 0x38, + 0x35, 0x30, 0x38, 0x39, 0x38, 0x35, 0x38, 0x33, 0x34, 0x34, 0x36, 0x34, + 0x35, 0x37, 0x33, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, + 0x63, 0x3a, 0x34, 0x38, 0x3a, 0x64, 0x63, 0x3a, 0x66, 0x37, 0x3a, 0x34, + 0x32, 0x3a, 0x37, 0x32, 0x3a, 0x65, 0x63, 0x3a, 0x35, 0x36, 0x3a, 0x39, + 0x34, 0x3a, 0x36, 0x64, 0x3a, 0x31, 0x63, 0x3a, 0x63, 0x63, 0x3a, 0x37, + 0x31, 0x3a, 0x33, 0x35, 0x3a, 0x38, 0x30, 0x3a, 0x37, 0x35, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x36, 0x3a, 0x33, 0x31, + 0x3a, 0x62, 0x66, 0x3a, 0x39, 0x65, 0x3a, 0x66, 0x37, 0x3a, 0x34, 0x66, + 0x3a, 0x39, 0x65, 0x3a, 0x62, 0x36, 0x3a, 0x63, 0x39, 0x3a, 0x64, 0x35, + 0x3a, 0x61, 0x36, 0x3a, 0x30, 0x63, 0x3a, 0x62, 0x61, 0x3a, 0x36, 0x61, + 0x3a, 0x62, 0x65, 0x3a, 0x64, 0x31, 0x3a, 0x66, 0x37, 0x3a, 0x62, 0x64, + 0x3a, 0x65, 0x66, 0x3a, 0x37, 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x63, 0x3a, 0x32, 0x63, 0x3a, 0x64, + 0x36, 0x3a, 0x33, 0x64, 0x3a, 0x66, 0x37, 0x3a, 0x38, 0x30, 0x3a, 0x36, + 0x66, 0x3a, 0x61, 0x33, 0x3a, 0x39, 0x39, 0x3a, 0x65, 0x64, 0x3a, 0x65, + 0x38, 0x3a, 0x30, 0x39, 0x3a, 0x31, 0x31, 0x3a, 0x36, 0x62, 0x3a, 0x35, + 0x37, 0x3a, 0x35, 0x62, 0x3a, 0x66, 0x38, 0x3a, 0x37, 0x39, 0x3a, 0x38, + 0x39, 0x3a, 0x66, 0x30, 0x3a, 0x36, 0x35, 0x3a, 0x31, 0x38, 0x3a, 0x66, + 0x39, 0x3a, 0x38, 0x30, 0x3a, 0x38, 0x63, 0x3a, 0x38, 0x36, 0x3a, 0x30, + 0x35, 0x3a, 0x30, 0x33, 0x3a, 0x31, 0x37, 0x3a, 0x38, 0x62, 0x3a, 0x61, + 0x66, 0x3a, 0x36, 0x36, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x45, 0x48, 0x54, 0x43, 0x43, 0x41, 0x77, 0x57, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x51, 0x54, 0x6f, 0x45, 0x74, 0x69, 0x6f, 0x4a, + 0x6c, 0x34, 0x41, 0x73, 0x43, 0x37, 0x6a, 0x34, 0x31, 0x41, 0x6b, 0x62, + 0x6c, 0x50, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x43, + 0x42, 0x0a, 0x67, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, 0x7a, + 0x41, 0x5a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x45, 0x6b, + 0x64, 0x79, 0x5a, 0x57, 0x46, 0x30, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x57, + 0x46, 0x75, 0x59, 0x32, 0x68, 0x6c, 0x63, 0x33, 0x52, 0x6c, 0x63, 0x6a, + 0x45, 0x51, 0x4d, 0x41, 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x78, 0x4d, 0x48, 0x55, 0x32, 0x46, 0x73, 0x5a, 0x6d, 0x39, 0x79, 0x5a, + 0x44, 0x45, 0x61, 0x4d, 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x52, 0x51, 0x30, 0x39, 0x4e, 0x54, 0x30, 0x52, 0x50, 0x49, + 0x45, 0x4e, 0x42, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, + 0x57, 0x51, 0x78, 0x4a, 0x7a, 0x41, 0x6c, 0x42, 0x67, 0x4e, 0x56, 0x0a, + 0x42, 0x41, 0x4d, 0x54, 0x48, 0x6b, 0x4e, 0x50, 0x54, 0x55, 0x39, 0x45, + 0x54, 0x79, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, + 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, + 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x41, 0x65, + 0x46, 0x77, 0x30, 0x77, 0x4e, 0x6a, 0x45, 0x79, 0x4d, 0x44, 0x45, 0x77, + 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, + 0x79, 0x4f, 0x54, 0x45, 0x79, 0x4d, 0x7a, 0x45, 0x79, 0x4d, 0x7a, 0x55, + 0x35, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x49, 0x47, 0x42, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x48, 0x51, 0x6a, 0x45, 0x62, 0x4d, 0x42, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x42, 0x4d, 0x53, 0x52, 0x33, 0x4a, 0x6c, 0x0a, 0x59, 0x58, + 0x52, 0x6c, 0x63, 0x69, 0x42, 0x4e, 0x59, 0x57, 0x35, 0x6a, 0x61, 0x47, + 0x56, 0x7a, 0x64, 0x47, 0x56, 0x79, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, 0x45, 0x77, 0x64, 0x54, 0x59, 0x57, + 0x78, 0x6d, 0x62, 0x33, 0x4a, 0x6b, 0x4d, 0x52, 0x6f, 0x77, 0x47, 0x41, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x46, 0x44, 0x54, 0x30, + 0x31, 0x50, 0x0a, 0x52, 0x45, 0x38, 0x67, 0x51, 0x30, 0x45, 0x67, 0x54, + 0x47, 0x6c, 0x74, 0x61, 0x58, 0x52, 0x6c, 0x5a, 0x44, 0x45, 0x6e, 0x4d, + 0x43, 0x55, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x65, 0x51, + 0x30, 0x39, 0x4e, 0x54, 0x30, 0x52, 0x50, 0x49, 0x45, 0x4e, 0x6c, 0x63, + 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, + 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x0a, 0x61, 0x47, 0x39, 0x79, + 0x61, 0x58, 0x52, 0x35, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, + 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, + 0x30, 0x45, 0x43, 0x4c, 0x69, 0x33, 0x4c, 0x6a, 0x6b, 0x52, 0x76, 0x33, + 0x0a, 0x55, 0x63, 0x45, 0x62, 0x56, 0x41, 0x53, 0x59, 0x30, 0x36, 0x6d, + 0x2f, 0x77, 0x65, 0x61, 0x4b, 0x58, 0x54, 0x75, 0x48, 0x2b, 0x37, 0x75, + 0x49, 0x7a, 0x67, 0x33, 0x6a, 0x4c, 0x7a, 0x38, 0x47, 0x6c, 0x76, 0x43, + 0x69, 0x4b, 0x56, 0x43, 0x5a, 0x72, 0x74, 0x73, 0x37, 0x6f, 0x56, 0x65, + 0x77, 0x64, 0x46, 0x46, 0x78, 0x7a, 0x65, 0x31, 0x43, 0x6b, 0x55, 0x31, + 0x42, 0x2f, 0x71, 0x6e, 0x49, 0x0a, 0x32, 0x47, 0x71, 0x47, 0x64, 0x30, + 0x53, 0x37, 0x57, 0x57, 0x61, 0x58, 0x55, 0x46, 0x36, 0x30, 0x31, 0x43, + 0x78, 0x77, 0x52, 0x4d, 0x2f, 0x61, 0x4e, 0x35, 0x56, 0x43, 0x61, 0x54, + 0x77, 0x77, 0x78, 0x48, 0x47, 0x7a, 0x55, 0x76, 0x41, 0x68, 0x54, 0x61, + 0x48, 0x59, 0x75, 0x6a, 0x6c, 0x38, 0x48, 0x4a, 0x36, 0x6a, 0x4a, 0x4a, + 0x33, 0x79, 0x67, 0x78, 0x61, 0x59, 0x71, 0x68, 0x5a, 0x38, 0x0a, 0x51, + 0x35, 0x73, 0x56, 0x57, 0x37, 0x65, 0x75, 0x4e, 0x4a, 0x48, 0x2b, 0x31, + 0x47, 0x49, 0x6d, 0x47, 0x45, 0x61, 0x61, 0x50, 0x2b, 0x76, 0x42, 0x2b, + 0x66, 0x47, 0x51, 0x56, 0x2b, 0x75, 0x73, 0x65, 0x67, 0x32, 0x4c, 0x32, + 0x33, 0x49, 0x77, 0x61, 0x6d, 0x62, 0x56, 0x34, 0x45, 0x61, 0x6a, 0x63, + 0x4e, 0x78, 0x6f, 0x32, 0x66, 0x38, 0x45, 0x53, 0x49, 0x6c, 0x33, 0x33, + 0x72, 0x58, 0x70, 0x0a, 0x2b, 0x32, 0x64, 0x74, 0x51, 0x65, 0x6d, 0x38, + 0x4f, 0x62, 0x30, 0x79, 0x32, 0x57, 0x49, 0x43, 0x38, 0x62, 0x47, 0x6f, + 0x50, 0x57, 0x34, 0x33, 0x6e, 0x4f, 0x49, 0x76, 0x34, 0x74, 0x4f, 0x69, + 0x4a, 0x6f, 0x76, 0x47, 0x75, 0x46, 0x56, 0x44, 0x69, 0x4f, 0x45, 0x6a, + 0x50, 0x71, 0x58, 0x53, 0x4a, 0x44, 0x6c, 0x71, 0x52, 0x36, 0x73, 0x41, + 0x31, 0x4b, 0x47, 0x7a, 0x71, 0x53, 0x58, 0x2b, 0x0a, 0x44, 0x54, 0x2b, + 0x6e, 0x48, 0x62, 0x72, 0x54, 0x55, 0x63, 0x45, 0x4c, 0x70, 0x4e, 0x71, + 0x73, 0x4f, 0x4f, 0x39, 0x56, 0x55, 0x43, 0x51, 0x46, 0x5a, 0x55, 0x61, + 0x54, 0x4e, 0x45, 0x38, 0x74, 0x6a, 0x61, 0x33, 0x47, 0x31, 0x43, 0x45, + 0x5a, 0x30, 0x6f, 0x37, 0x4b, 0x42, 0x57, 0x46, 0x78, 0x42, 0x33, 0x4e, + 0x48, 0x35, 0x59, 0x6f, 0x5a, 0x45, 0x72, 0x30, 0x45, 0x54, 0x63, 0x35, + 0x4f, 0x0a, 0x6e, 0x4b, 0x56, 0x49, 0x72, 0x4c, 0x73, 0x6d, 0x39, 0x77, + 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x47, 0x4f, 0x4d, 0x49, + 0x47, 0x4c, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x51, 0x4c, 0x57, 0x4f, 0x57, 0x4c, 0x78, 0x6b, + 0x77, 0x56, 0x4e, 0x36, 0x52, 0x41, 0x71, 0x54, 0x43, 0x70, 0x49, 0x62, + 0x35, 0x48, 0x4e, 0x6c, 0x70, 0x57, 0x0a, 0x2f, 0x7a, 0x41, 0x4f, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, + 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, + 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x42, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x52, 0x38, 0x45, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x44, 0x36, 0x67, 0x0a, + 0x50, 0x4b, 0x41, 0x36, 0x68, 0x6a, 0x68, 0x6f, 0x64, 0x48, 0x52, 0x77, + 0x4f, 0x69, 0x38, 0x76, 0x59, 0x33, 0x4a, 0x73, 0x4c, 0x6d, 0x4e, 0x76, + 0x62, 0x57, 0x39, 0x6b, 0x62, 0x32, 0x4e, 0x68, 0x4c, 0x6d, 0x4e, 0x76, + 0x62, 0x53, 0x39, 0x44, 0x54, 0x30, 0x31, 0x50, 0x52, 0x45, 0x39, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, + 0x61, 0x57, 0x39, 0x75, 0x0a, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, + 0x79, 0x61, 0x58, 0x52, 0x35, 0x4c, 0x6d, 0x4e, 0x79, 0x62, 0x44, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, + 0x41, 0x50, 0x70, 0x69, 0x65, 0x6d, 0x2f, 0x59, 0x62, 0x36, 0x64, 0x63, + 0x35, 0x74, 0x33, 0x69, 0x75, 0x48, 0x58, 0x49, 0x59, 0x0a, 0x53, 0x64, + 0x4f, 0x48, 0x35, 0x45, 0x4f, 0x43, 0x36, 0x7a, 0x2f, 0x4a, 0x71, 0x76, + 0x57, 0x6f, 0x74, 0x65, 0x39, 0x56, 0x66, 0x43, 0x46, 0x53, 0x5a, 0x66, + 0x6e, 0x56, 0x44, 0x65, 0x46, 0x73, 0x39, 0x44, 0x36, 0x4d, 0x6b, 0x33, + 0x4f, 0x52, 0x4c, 0x67, 0x4c, 0x45, 0x54, 0x67, 0x64, 0x78, 0x62, 0x38, + 0x43, 0x50, 0x4f, 0x47, 0x45, 0x49, 0x71, 0x42, 0x36, 0x42, 0x43, 0x73, + 0x41, 0x76, 0x0a, 0x49, 0x43, 0x39, 0x42, 0x69, 0x35, 0x48, 0x63, 0x53, + 0x45, 0x57, 0x38, 0x38, 0x63, 0x62, 0x65, 0x75, 0x6e, 0x5a, 0x72, 0x4d, + 0x38, 0x67, 0x41, 0x4c, 0x54, 0x46, 0x47, 0x54, 0x4f, 0x33, 0x6e, 0x6e, + 0x63, 0x2b, 0x49, 0x6c, 0x50, 0x38, 0x7a, 0x77, 0x46, 0x62, 0x6f, 0x4a, + 0x49, 0x59, 0x6d, 0x75, 0x4e, 0x67, 0x34, 0x4f, 0x4e, 0x38, 0x71, 0x61, + 0x39, 0x30, 0x53, 0x7a, 0x4d, 0x63, 0x2f, 0x0a, 0x52, 0x78, 0x64, 0x4d, + 0x6f, 0x73, 0x49, 0x47, 0x6c, 0x67, 0x6e, 0x57, 0x32, 0x2f, 0x34, 0x2f, + 0x50, 0x45, 0x5a, 0x42, 0x33, 0x31, 0x6a, 0x69, 0x56, 0x67, 0x38, 0x38, + 0x4f, 0x38, 0x45, 0x63, 0x6b, 0x7a, 0x58, 0x5a, 0x4f, 0x46, 0x4b, 0x73, + 0x37, 0x73, 0x6a, 0x73, 0x4c, 0x6a, 0x42, 0x4f, 0x6c, 0x44, 0x57, 0x30, + 0x4a, 0x42, 0x39, 0x4c, 0x65, 0x47, 0x6e, 0x61, 0x38, 0x67, 0x49, 0x34, + 0x0a, 0x7a, 0x4a, 0x56, 0x53, 0x6b, 0x2f, 0x42, 0x77, 0x4a, 0x56, 0x6d, + 0x63, 0x49, 0x47, 0x66, 0x45, 0x37, 0x76, 0x6d, 0x4c, 0x56, 0x32, 0x48, + 0x30, 0x6b, 0x6e, 0x5a, 0x39, 0x50, 0x34, 0x53, 0x4e, 0x56, 0x62, 0x66, + 0x6f, 0x35, 0x61, 0x7a, 0x56, 0x38, 0x66, 0x55, 0x5a, 0x56, 0x71, 0x5a, + 0x61, 0x2b, 0x35, 0x41, 0x63, 0x72, 0x35, 0x50, 0x72, 0x35, 0x52, 0x7a, + 0x55, 0x5a, 0x35, 0x64, 0x64, 0x0a, 0x42, 0x41, 0x36, 0x2b, 0x43, 0x34, + 0x4f, 0x6d, 0x46, 0x34, 0x4f, 0x35, 0x4d, 0x42, 0x4b, 0x67, 0x78, 0x54, + 0x4d, 0x56, 0x42, 0x62, 0x6b, 0x4e, 0x2b, 0x38, 0x63, 0x46, 0x64, 0x75, + 0x50, 0x59, 0x53, 0x6f, 0x33, 0x38, 0x4e, 0x42, 0x65, 0x6a, 0x78, 0x69, + 0x45, 0x6f, 0x76, 0x6a, 0x42, 0x46, 0x4d, 0x52, 0x37, 0x48, 0x65, 0x4c, + 0x35, 0x59, 0x59, 0x54, 0x69, 0x73, 0x4f, 0x2b, 0x49, 0x42, 0x0a, 0x5a, + 0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x20, 0x53, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x4f, 0x3d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x53, 0x6f, + 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x4c, 0x2e, 0x4c, 0x2e, + 0x43, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x20, 0x53, 0x6f, 0x6c, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x53, 0x6f, 0x6c, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x4c, 0x2e, 0x4c, 0x2e, 0x43, 0x2e, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x53, 0x6f, 0x6c, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x31, 0x31, 0x36, 0x36, 0x39, 0x37, 0x39, 0x31, 0x35, 0x31, 0x35, + 0x32, 0x39, 0x33, 0x37, 0x34, 0x39, 0x37, 0x34, 0x39, 0x30, 0x34, 0x33, + 0x37, 0x35, 0x35, 0x36, 0x33, 0x38, 0x36, 0x38, 0x31, 0x32, 0x34, 0x38, + 0x37, 0x39, 0x30, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x64, 0x33, 0x3a, 0x66, 0x33, 0x3a, 0x61, 0x36, 0x3a, 0x31, 0x36, 0x3a, + 0x63, 0x30, 0x3a, 0x66, 0x61, 0x3a, 0x36, 0x62, 0x3a, 0x31, 0x64, 0x3a, + 0x35, 0x39, 0x3a, 0x62, 0x31, 0x3a, 0x32, 0x64, 0x3a, 0x39, 0x36, 0x3a, + 0x34, 0x64, 0x3a, 0x30, 0x65, 0x3a, 0x31, 0x31, 0x3a, 0x32, 0x65, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x34, 0x3a, 0x66, + 0x38, 0x3a, 0x61, 0x33, 0x3a, 0x63, 0x33, 0x3a, 0x65, 0x66, 0x3a, 0x65, + 0x37, 0x3a, 0x62, 0x33, 0x3a, 0x39, 0x30, 0x3a, 0x30, 0x36, 0x3a, 0x34, + 0x62, 0x3a, 0x38, 0x33, 0x3a, 0x39, 0x30, 0x3a, 0x33, 0x63, 0x3a, 0x32, + 0x31, 0x3a, 0x36, 0x34, 0x3a, 0x36, 0x30, 0x3a, 0x32, 0x30, 0x3a, 0x65, + 0x35, 0x3a, 0x64, 0x66, 0x3a, 0x63, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x35, 0x3a, 0x66, 0x30, 0x3a, + 0x62, 0x61, 0x3a, 0x30, 0x30, 0x3a, 0x61, 0x33, 0x3a, 0x61, 0x63, 0x3a, + 0x37, 0x61, 0x3a, 0x66, 0x33, 0x3a, 0x61, 0x63, 0x3a, 0x38, 0x38, 0x3a, + 0x34, 0x63, 0x3a, 0x30, 0x37, 0x3a, 0x32, 0x62, 0x3a, 0x31, 0x30, 0x3a, + 0x31, 0x31, 0x3a, 0x61, 0x30, 0x3a, 0x37, 0x37, 0x3a, 0x62, 0x64, 0x3a, + 0x37, 0x37, 0x3a, 0x63, 0x30, 0x3a, 0x39, 0x37, 0x3a, 0x66, 0x34, 0x3a, + 0x30, 0x31, 0x3a, 0x36, 0x34, 0x3a, 0x62, 0x32, 0x3a, 0x66, 0x38, 0x3a, + 0x35, 0x39, 0x3a, 0x38, 0x61, 0x3a, 0x62, 0x64, 0x3a, 0x38, 0x33, 0x3a, + 0x38, 0x36, 0x3a, 0x30, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x44, 0x35, 0x6a, 0x43, 0x43, 0x41, 0x73, 0x36, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x56, 0x38, 0x73, 0x7a, 0x62, 0x38, + 0x4a, 0x63, 0x46, 0x75, 0x5a, 0x48, 0x46, 0x68, 0x66, 0x6a, 0x6b, 0x44, + 0x46, 0x6f, 0x34, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, + 0x42, 0x69, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x68, 0x4d, + 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x59, 0x54, + 0x6d, 0x56, 0x30, 0x64, 0x32, 0x39, 0x79, 0x61, 0x79, 0x42, 0x54, 0x62, + 0x32, 0x78, 0x31, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6e, 0x4d, 0x67, 0x54, + 0x43, 0x35, 0x4d, 0x4c, 0x6b, 0x4d, 0x75, 0x0a, 0x4d, 0x54, 0x41, 0x77, + 0x4c, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x64, 0x4f, + 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, 0x49, 0x46, 0x4e, 0x76, + 0x62, 0x48, 0x56, 0x30, 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, + 0x5a, 0x53, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x0a, 0x64, 0x48, 0x6b, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x59, + 0x78, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, + 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x6b, 0x78, 0x4d, 0x6a, 0x4d, + 0x78, 0x4d, 0x6a, 0x4d, 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x42, + 0x69, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x56, 0x0a, 0x55, 0x7a, 0x45, 0x68, 0x4d, 0x42, + 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x59, 0x54, 0x6d, + 0x56, 0x30, 0x64, 0x32, 0x39, 0x79, 0x61, 0x79, 0x42, 0x54, 0x62, 0x32, + 0x78, 0x31, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6e, 0x4d, 0x67, 0x54, 0x43, + 0x35, 0x4d, 0x4c, 0x6b, 0x4d, 0x75, 0x4d, 0x54, 0x41, 0x77, 0x4c, 0x67, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x64, 0x4f, 0x0a, 0x5a, + 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, 0x49, 0x46, 0x4e, 0x76, 0x62, + 0x48, 0x56, 0x30, 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x44, 0x5a, + 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x5a, + 0x53, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, + 0x48, 0x6b, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, + 0x53, 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, + 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, + 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x44, 0x6b, + 0x76, 0x48, 0x36, 0x53, 0x4d, 0x47, 0x33, 0x47, 0x32, 0x49, 0x34, 0x72, + 0x43, 0x37, 0x78, 0x47, 0x7a, 0x75, 0x41, 0x6e, 0x6c, 0x74, 0x37, 0x65, + 0x2b, 0x66, 0x6f, 0x53, 0x30, 0x7a, 0x77, 0x7a, 0x0a, 0x63, 0x37, 0x4d, + 0x45, 0x4c, 0x37, 0x78, 0x78, 0x6a, 0x4f, 0x57, 0x66, 0x74, 0x69, 0x4a, + 0x67, 0x50, 0x6c, 0x39, 0x64, 0x7a, 0x67, 0x6e, 0x2f, 0x67, 0x67, 0x77, + 0x62, 0x6d, 0x6c, 0x46, 0x51, 0x47, 0x69, 0x61, 0x4a, 0x33, 0x64, 0x56, + 0x68, 0x58, 0x52, 0x6e, 0x63, 0x45, 0x67, 0x38, 0x74, 0x43, 0x71, 0x4a, + 0x44, 0x58, 0x52, 0x66, 0x51, 0x4e, 0x4a, 0x49, 0x67, 0x36, 0x6e, 0x50, + 0x50, 0x0a, 0x4f, 0x43, 0x77, 0x47, 0x4a, 0x67, 0x6c, 0x36, 0x63, 0x76, + 0x66, 0x36, 0x55, 0x44, 0x4c, 0x34, 0x77, 0x70, 0x50, 0x54, 0x61, 0x61, + 0x49, 0x6a, 0x7a, 0x6b, 0x47, 0x78, 0x7a, 0x4f, 0x54, 0x56, 0x48, 0x7a, + 0x62, 0x52, 0x69, 0x6a, 0x72, 0x34, 0x6a, 0x47, 0x50, 0x69, 0x46, 0x46, + 0x6c, 0x70, 0x37, 0x51, 0x33, 0x54, 0x66, 0x32, 0x76, 0x6f, 0x75, 0x41, + 0x50, 0x6c, 0x54, 0x32, 0x72, 0x6c, 0x0a, 0x6d, 0x47, 0x4e, 0x70, 0x53, + 0x41, 0x57, 0x2b, 0x4c, 0x76, 0x38, 0x7a, 0x74, 0x75, 0x6d, 0x58, 0x57, + 0x57, 0x6e, 0x34, 0x5a, 0x78, 0x6d, 0x75, 0x6b, 0x32, 0x47, 0x57, 0x52, + 0x42, 0x58, 0x54, 0x63, 0x72, 0x41, 0x2f, 0x76, 0x47, 0x70, 0x39, 0x37, + 0x45, 0x68, 0x2f, 0x6a, 0x63, 0x4f, 0x72, 0x71, 0x6e, 0x45, 0x72, 0x55, + 0x32, 0x6c, 0x42, 0x55, 0x7a, 0x53, 0x31, 0x73, 0x4c, 0x6e, 0x46, 0x0a, + 0x42, 0x67, 0x72, 0x45, 0x73, 0x45, 0x58, 0x31, 0x51, 0x56, 0x31, 0x75, + 0x69, 0x55, 0x56, 0x37, 0x50, 0x54, 0x73, 0x6d, 0x6a, 0x48, 0x54, 0x43, + 0x35, 0x64, 0x4c, 0x52, 0x66, 0x62, 0x49, 0x52, 0x31, 0x50, 0x74, 0x59, + 0x4d, 0x69, 0x4b, 0x61, 0x67, 0x4d, 0x6e, 0x63, 0x2f, 0x51, 0x7a, 0x70, + 0x66, 0x31, 0x34, 0x44, 0x6c, 0x38, 0x34, 0x37, 0x41, 0x42, 0x53, 0x48, + 0x4a, 0x33, 0x41, 0x34, 0x0a, 0x71, 0x59, 0x35, 0x75, 0x73, 0x79, 0x64, + 0x32, 0x6d, 0x46, 0x48, 0x67, 0x42, 0x65, 0x4d, 0x68, 0x71, 0x78, 0x72, + 0x56, 0x68, 0x53, 0x49, 0x38, 0x4b, 0x62, 0x57, 0x61, 0x46, 0x73, 0x57, + 0x41, 0x71, 0x50, 0x53, 0x37, 0x61, 0x7a, 0x43, 0x50, 0x4c, 0x30, 0x59, + 0x43, 0x6f, 0x72, 0x45, 0x4d, 0x49, 0x75, 0x44, 0x54, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x5a, 0x63, 0x77, 0x0a, 0x67, 0x5a, + 0x51, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, + 0x59, 0x45, 0x46, 0x43, 0x45, 0x77, 0x79, 0x66, 0x73, 0x41, 0x31, 0x30, + 0x36, 0x59, 0x32, 0x6f, 0x65, 0x71, 0x4b, 0x74, 0x43, 0x6e, 0x4c, 0x72, + 0x46, 0x41, 0x4d, 0x61, 0x64, 0x4d, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, + 0x49, 0x42, 0x0a, 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, + 0x51, 0x48, 0x2f, 0x4d, 0x46, 0x49, 0x47, 0x41, 0x31, 0x55, 0x64, 0x48, + 0x77, 0x52, 0x4c, 0x4d, 0x45, 0x6b, 0x77, 0x52, 0x36, 0x42, 0x46, 0x6f, + 0x45, 0x4f, 0x47, 0x51, 0x57, 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, 0x4c, + 0x79, 0x39, 0x6a, 0x63, 0x6d, 0x77, 0x75, 0x0a, 0x62, 0x6d, 0x56, 0x30, + 0x63, 0x32, 0x39, 0x73, 0x63, 0x33, 0x4e, 0x73, 0x4c, 0x6d, 0x4e, 0x76, + 0x62, 0x53, 0x39, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, + 0x55, 0x32, 0x39, 0x73, 0x64, 0x58, 0x52, 0x70, 0x62, 0x32, 0x35, 0x7a, + 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, + 0x64, 0x47, 0x56, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x0a, 0x64, 0x48, 0x6b, 0x75, 0x59, 0x33, 0x4a, 0x73, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x42, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, + 0x37, 0x72, 0x6b, 0x76, 0x6e, 0x74, 0x31, 0x66, 0x72, 0x66, 0x36, 0x6f, + 0x74, 0x74, 0x33, 0x4e, 0x48, 0x68, 0x57, 0x72, 0x42, 0x35, 0x4b, 0x55, + 0x64, 0x35, 0x4f, 0x63, 0x38, 0x0a, 0x36, 0x66, 0x52, 0x5a, 0x5a, 0x58, + 0x65, 0x31, 0x65, 0x6c, 0x74, 0x61, 0x6a, 0x53, 0x55, 0x32, 0x34, 0x48, + 0x71, 0x58, 0x4c, 0x6a, 0x6a, 0x41, 0x56, 0x32, 0x43, 0x44, 0x6d, 0x41, + 0x61, 0x44, 0x6e, 0x37, 0x6c, 0x32, 0x65, 0x6d, 0x35, 0x51, 0x34, 0x4c, + 0x71, 0x49, 0x4c, 0x50, 0x78, 0x46, 0x7a, 0x42, 0x69, 0x77, 0x6d, 0x5a, + 0x56, 0x52, 0x44, 0x75, 0x77, 0x64, 0x75, 0x49, 0x6a, 0x2f, 0x0a, 0x68, + 0x31, 0x41, 0x63, 0x67, 0x73, 0x4c, 0x6a, 0x34, 0x44, 0x4b, 0x41, 0x76, + 0x36, 0x41, 0x4c, 0x52, 0x38, 0x6a, 0x44, 0x4d, 0x65, 0x2b, 0x5a, 0x5a, + 0x7a, 0x4b, 0x41, 0x54, 0x78, 0x63, 0x68, 0x65, 0x51, 0x78, 0x70, 0x58, + 0x4e, 0x35, 0x65, 0x4e, 0x4b, 0x34, 0x43, 0x74, 0x53, 0x62, 0x71, 0x55, + 0x4e, 0x39, 0x2f, 0x47, 0x47, 0x55, 0x73, 0x79, 0x66, 0x4a, 0x6a, 0x34, + 0x61, 0x6b, 0x48, 0x0a, 0x2f, 0x6e, 0x78, 0x78, 0x48, 0x32, 0x73, 0x7a, + 0x4a, 0x47, 0x6f, 0x65, 0x42, 0x66, 0x63, 0x46, 0x61, 0x4d, 0x42, 0x71, + 0x45, 0x73, 0x73, 0x75, 0x58, 0x6d, 0x48, 0x4c, 0x72, 0x69, 0x6a, 0x54, + 0x66, 0x73, 0x4b, 0x30, 0x5a, 0x70, 0x45, 0x6d, 0x58, 0x7a, 0x77, 0x75, + 0x4a, 0x46, 0x2f, 0x4c, 0x57, 0x41, 0x2f, 0x72, 0x4b, 0x4f, 0x79, 0x76, + 0x45, 0x5a, 0x62, 0x7a, 0x33, 0x48, 0x74, 0x76, 0x0a, 0x77, 0x4b, 0x65, + 0x49, 0x38, 0x6c, 0x4e, 0x33, 0x73, 0x32, 0x42, 0x65, 0x72, 0x71, 0x34, + 0x6f, 0x32, 0x6a, 0x55, 0x73, 0x62, 0x7a, 0x52, 0x46, 0x30, 0x79, 0x62, + 0x68, 0x33, 0x75, 0x78, 0x62, 0x54, 0x79, 0x64, 0x72, 0x46, 0x6e, 0x79, + 0x39, 0x52, 0x41, 0x51, 0x59, 0x67, 0x72, 0x4f, 0x4a, 0x65, 0x52, 0x63, + 0x51, 0x63, 0x54, 0x31, 0x36, 0x6f, 0x68, 0x5a, 0x4f, 0x39, 0x51, 0x48, + 0x4e, 0x0a, 0x70, 0x47, 0x78, 0x6c, 0x61, 0x4b, 0x46, 0x4a, 0x64, 0x6c, + 0x78, 0x44, 0x79, 0x64, 0x69, 0x38, 0x4e, 0x6d, 0x64, 0x73, 0x70, 0x5a, + 0x53, 0x31, 0x31, 0x4d, 0x79, 0x35, 0x76, 0x57, 0x6f, 0x31, 0x56, 0x69, + 0x48, 0x65, 0x32, 0x4d, 0x50, 0x72, 0x2b, 0x38, 0x75, 0x6b, 0x59, 0x45, + 0x79, 0x77, 0x56, 0x61, 0x43, 0x67, 0x65, 0x31, 0x65, 0x79, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x45, 0x43, + 0x43, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x4f, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x43, + 0x41, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x45, 0x43, 0x43, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, + 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x43, 0x41, 0x20, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, + 0x45, 0x43, 0x43, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x34, 0x31, 0x35, 0x37, 0x38, 0x32, 0x38, 0x33, 0x38, + 0x36, 0x37, 0x30, 0x38, 0x36, 0x36, 0x39, 0x32, 0x36, 0x33, 0x38, 0x32, + 0x35, 0x36, 0x39, 0x32, 0x31, 0x35, 0x38, 0x39, 0x37, 0x30, 0x37, 0x39, + 0x33, 0x38, 0x30, 0x39, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x37, 0x63, 0x3a, 0x36, 0x32, 0x3a, 0x66, 0x66, 0x3a, 0x37, 0x34, + 0x3a, 0x39, 0x64, 0x3a, 0x33, 0x31, 0x3a, 0x35, 0x33, 0x3a, 0x35, 0x65, + 0x3a, 0x36, 0x38, 0x3a, 0x34, 0x61, 0x3a, 0x64, 0x35, 0x3a, 0x37, 0x38, + 0x3a, 0x61, 0x61, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x66, 0x3a, 0x32, 0x33, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x66, 0x3a, + 0x37, 0x34, 0x3a, 0x34, 0x65, 0x3a, 0x39, 0x66, 0x3a, 0x32, 0x62, 0x3a, + 0x34, 0x64, 0x3a, 0x62, 0x61, 0x3a, 0x65, 0x63, 0x3a, 0x30, 0x66, 0x3a, + 0x33, 0x31, 0x3a, 0x32, 0x63, 0x3a, 0x35, 0x30, 0x3a, 0x62, 0x36, 0x3a, + 0x35, 0x36, 0x3a, 0x33, 0x62, 0x3a, 0x38, 0x65, 0x3a, 0x32, 0x64, 0x3a, + 0x39, 0x33, 0x3a, 0x63, 0x33, 0x3a, 0x31, 0x31, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x37, 0x3a, 0x39, 0x33, + 0x3a, 0x39, 0x32, 0x3a, 0x37, 0x61, 0x3a, 0x30, 0x36, 0x3a, 0x31, 0x34, + 0x3a, 0x35, 0x34, 0x3a, 0x39, 0x37, 0x3a, 0x38, 0x39, 0x3a, 0x61, 0x64, + 0x3a, 0x63, 0x65, 0x3a, 0x32, 0x66, 0x3a, 0x38, 0x66, 0x3a, 0x33, 0x34, + 0x3a, 0x66, 0x37, 0x3a, 0x66, 0x30, 0x3a, 0x62, 0x36, 0x3a, 0x36, 0x64, + 0x3a, 0x30, 0x66, 0x3a, 0x33, 0x61, 0x3a, 0x65, 0x33, 0x3a, 0x61, 0x33, + 0x3a, 0x62, 0x38, 0x3a, 0x34, 0x64, 0x3a, 0x32, 0x31, 0x3a, 0x65, 0x63, + 0x3a, 0x31, 0x35, 0x3a, 0x64, 0x62, 0x3a, 0x62, 0x61, 0x3a, 0x34, 0x66, + 0x3a, 0x61, 0x64, 0x3a, 0x63, 0x37, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x43, 0x69, 0x54, 0x43, 0x43, 0x41, 0x67, 0x2b, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x48, 0x30, 0x65, 0x76, 0x71, + 0x6d, 0x49, 0x41, 0x63, 0x46, 0x42, 0x55, 0x54, 0x41, 0x47, 0x65, 0x6d, + 0x32, 0x4f, 0x5a, 0x4b, 0x6a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, + 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x43, 0x42, 0x68, + 0x54, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, 0x7a, 0x41, 0x5a, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x45, 0x6b, 0x64, 0x79, + 0x5a, 0x57, 0x46, 0x30, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x57, 0x46, 0x75, + 0x59, 0x32, 0x68, 0x6c, 0x63, 0x33, 0x52, 0x6c, 0x63, 0x6a, 0x45, 0x51, + 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x78, 0x4d, + 0x48, 0x55, 0x32, 0x46, 0x73, 0x5a, 0x6d, 0x39, 0x79, 0x5a, 0x44, 0x45, + 0x61, 0x4d, 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, + 0x52, 0x51, 0x30, 0x39, 0x4e, 0x54, 0x30, 0x52, 0x50, 0x49, 0x45, 0x4e, + 0x42, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, + 0x78, 0x4b, 0x7a, 0x41, 0x70, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x54, 0x0a, 0x49, 0x6b, 0x4e, 0x50, 0x54, 0x55, 0x39, 0x45, 0x54, 0x79, + 0x42, 0x46, 0x51, 0x30, 0x4d, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, + 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, + 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, + 0x6b, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x67, 0x77, 0x4d, 0x7a, + 0x41, 0x32, 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x44, 0x41, 0x77, 0x57, + 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x54, 0x45, 0x34, 0x4d, + 0x6a, 0x4d, 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x68, + 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x45, 0x6b, 0x64, 0x79, 0x0a, + 0x5a, 0x57, 0x46, 0x30, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x57, 0x46, 0x75, + 0x59, 0x32, 0x68, 0x6c, 0x63, 0x33, 0x52, 0x6c, 0x63, 0x6a, 0x45, 0x51, + 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x48, + 0x55, 0x32, 0x46, 0x73, 0x5a, 0x6d, 0x39, 0x79, 0x5a, 0x44, 0x45, 0x61, + 0x4d, 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x52, + 0x51, 0x30, 0x39, 0x4e, 0x0a, 0x54, 0x30, 0x52, 0x50, 0x49, 0x45, 0x4e, + 0x42, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, + 0x78, 0x4b, 0x7a, 0x41, 0x70, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x54, 0x49, 0x6b, 0x4e, 0x50, 0x54, 0x55, 0x39, 0x45, 0x54, 0x79, 0x42, + 0x46, 0x51, 0x30, 0x4d, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, + 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x0a, 0x62, 0x69, + 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, + 0x6b, 0x77, 0x64, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x63, 0x71, 0x68, 0x6b, + 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, 0x67, 0x55, 0x72, 0x67, 0x51, + 0x51, 0x41, 0x49, 0x67, 0x4e, 0x69, 0x41, 0x41, 0x51, 0x44, 0x52, 0x33, + 0x73, 0x76, 0x64, 0x63, 0x6d, 0x43, 0x46, 0x59, 0x58, 0x37, 0x64, 0x65, + 0x53, 0x52, 0x0a, 0x46, 0x74, 0x53, 0x72, 0x59, 0x70, 0x6e, 0x31, 0x50, + 0x6c, 0x49, 0x4c, 0x42, 0x73, 0x35, 0x42, 0x41, 0x48, 0x2b, 0x58, 0x34, + 0x51, 0x6f, 0x6b, 0x50, 0x42, 0x30, 0x42, 0x42, 0x4f, 0x34, 0x39, 0x30, + 0x6f, 0x30, 0x4a, 0x6c, 0x77, 0x7a, 0x67, 0x64, 0x65, 0x54, 0x36, 0x2b, + 0x33, 0x65, 0x4b, 0x4b, 0x76, 0x55, 0x44, 0x59, 0x45, 0x73, 0x32, 0x69, + 0x78, 0x59, 0x6a, 0x46, 0x71, 0x30, 0x4a, 0x0a, 0x63, 0x66, 0x52, 0x4b, + 0x39, 0x43, 0x68, 0x51, 0x74, 0x50, 0x36, 0x49, 0x48, 0x47, 0x34, 0x2f, + 0x62, 0x43, 0x38, 0x76, 0x43, 0x56, 0x6c, 0x62, 0x70, 0x56, 0x73, 0x4c, + 0x4d, 0x35, 0x6e, 0x69, 0x77, 0x7a, 0x32, 0x4a, 0x2b, 0x57, 0x6f, 0x73, + 0x37, 0x37, 0x4c, 0x54, 0x42, 0x75, 0x6d, 0x6a, 0x51, 0x6a, 0x42, 0x41, + 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, + 0x0a, 0x42, 0x42, 0x52, 0x31, 0x63, 0x61, 0x63, 0x5a, 0x53, 0x42, 0x6d, + 0x38, 0x6e, 0x5a, 0x33, 0x71, 0x51, 0x55, 0x66, 0x66, 0x6c, 0x4d, 0x52, + 0x49, 0x64, 0x35, 0x6e, 0x54, 0x65, 0x54, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x54, 0x41, 0x51, 0x48, 0x2f, 0x0a, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, + 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, + 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x77, 0x4e, 0x6f, 0x41, 0x44, + 0x42, 0x6c, 0x41, 0x6a, 0x45, 0x41, 0x37, 0x77, 0x4e, 0x62, 0x65, 0x71, + 0x79, 0x33, 0x65, 0x41, 0x70, 0x79, 0x74, 0x34, 0x6a, 0x66, 0x2f, 0x37, + 0x56, 0x47, 0x46, 0x41, 0x6b, 0x4b, 0x2b, 0x71, 0x44, 0x6d, 0x0a, 0x66, + 0x51, 0x6a, 0x47, 0x47, 0x6f, 0x65, 0x39, 0x47, 0x4b, 0x68, 0x7a, 0x76, + 0x53, 0x62, 0x4b, 0x59, 0x41, 0x79, 0x64, 0x7a, 0x70, 0x6d, 0x66, 0x7a, + 0x31, 0x77, 0x50, 0x4d, 0x4f, 0x47, 0x2b, 0x46, 0x44, 0x48, 0x71, 0x41, + 0x6a, 0x41, 0x55, 0x39, 0x4a, 0x4d, 0x38, 0x53, 0x61, 0x63, 0x7a, 0x65, + 0x70, 0x42, 0x47, 0x52, 0x37, 0x4e, 0x6a, 0x66, 0x52, 0x4f, 0x62, 0x54, + 0x72, 0x64, 0x76, 0x0a, 0x47, 0x44, 0x65, 0x41, 0x55, 0x2f, 0x37, 0x64, + 0x49, 0x4f, 0x41, 0x31, 0x6d, 0x6a, 0x62, 0x52, 0x78, 0x77, 0x47, 0x35, + 0x35, 0x74, 0x7a, 0x64, 0x38, 0x2f, 0x38, 0x64, 0x4c, 0x44, 0x6f, 0x57, + 0x56, 0x39, 0x6d, 0x53, 0x4f, 0x64, 0x59, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x4f, 0x49, 0x53, 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, + 0x65, 0x79, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x47, 0x41, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x57, + 0x49, 0x53, 0x65, 0x4b, 0x65, 0x79, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x6f, + 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, + 0x32, 0x30, 0x30, 0x35, 0x2f, 0x4f, 0x49, 0x53, 0x54, 0x45, 0x20, 0x46, + 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x6e, + 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4f, 0x49, 0x53, + 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, 0x79, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, + 0x41, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x57, 0x49, 0x53, 0x65, 0x4b, + 0x65, 0x79, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, + 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x35, + 0x2f, 0x4f, 0x49, 0x53, 0x54, 0x45, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, + 0x65, 0x64, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x4f, 0x49, 0x53, 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, + 0x65, 0x79, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x47, 0x41, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x36, 0x37, 0x31, + 0x38, 0x38, 0x37, 0x37, 0x38, 0x37, 0x31, 0x31, 0x33, 0x33, 0x31, 0x35, + 0x39, 0x30, 0x39, 0x30, 0x30, 0x38, 0x30, 0x35, 0x35, 0x35, 0x39, 0x31, + 0x31, 0x38, 0x32, 0x33, 0x35, 0x34, 0x38, 0x33, 0x31, 0x34, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x63, 0x3a, 0x36, 0x63, 0x3a, + 0x35, 0x31, 0x3a, 0x33, 0x33, 0x3a, 0x61, 0x37, 0x3a, 0x65, 0x39, 0x3a, + 0x64, 0x33, 0x3a, 0x36, 0x36, 0x3a, 0x36, 0x33, 0x3a, 0x35, 0x34, 0x3a, + 0x31, 0x35, 0x3a, 0x37, 0x32, 0x3a, 0x31, 0x62, 0x3a, 0x32, 0x31, 0x3a, + 0x39, 0x32, 0x3a, 0x39, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x35, 0x39, 0x3a, 0x32, 0x32, 0x3a, 0x61, 0x31, 0x3a, 0x65, + 0x31, 0x3a, 0x35, 0x61, 0x3a, 0x65, 0x61, 0x3a, 0x31, 0x36, 0x3a, 0x33, + 0x35, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x38, 0x3a, 0x39, 0x38, 0x3a, 0x33, + 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x34, 0x36, 0x3a, 0x34, 0x36, 0x3a, 0x62, + 0x30, 0x3a, 0x34, 0x34, 0x3a, 0x31, 0x62, 0x3a, 0x30, 0x66, 0x3a, 0x61, + 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x34, 0x31, 0x3a, 0x63, 0x39, 0x3a, 0x32, 0x33, 0x3a, 0x38, 0x36, 0x3a, + 0x36, 0x61, 0x3a, 0x62, 0x34, 0x3a, 0x63, 0x61, 0x3a, 0x64, 0x36, 0x3a, + 0x62, 0x37, 0x3a, 0x61, 0x64, 0x3a, 0x35, 0x37, 0x3a, 0x38, 0x30, 0x3a, + 0x38, 0x31, 0x3a, 0x35, 0x38, 0x3a, 0x32, 0x65, 0x3a, 0x30, 0x32, 0x3a, + 0x30, 0x37, 0x3a, 0x39, 0x37, 0x3a, 0x61, 0x36, 0x3a, 0x63, 0x62, 0x3a, + 0x64, 0x66, 0x3a, 0x34, 0x66, 0x3a, 0x66, 0x66, 0x3a, 0x37, 0x38, 0x3a, + 0x63, 0x65, 0x3a, 0x38, 0x33, 0x3a, 0x39, 0x36, 0x3a, 0x62, 0x33, 0x3a, + 0x38, 0x39, 0x3a, 0x33, 0x37, 0x3a, 0x64, 0x37, 0x3a, 0x66, 0x35, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x38, 0x54, 0x43, 0x43, + 0x41, 0x74, 0x6d, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, + 0x51, 0x54, 0x31, 0x79, 0x78, 0x2f, 0x52, 0x72, 0x48, 0x34, 0x46, 0x44, + 0x66, 0x66, 0x48, 0x53, 0x4b, 0x46, 0x54, 0x66, 0x6d, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x69, 0x6a, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x51, 0x30, 0x67, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x54, 0x42, 0x31, 0x64, 0x4a, 0x55, 0x32, 0x56, + 0x4c, 0x5a, 0x58, 0x6b, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x73, 0x54, 0x45, 0x6b, 0x4e, 0x76, 0x63, 0x48, 0x6c, + 0x79, 0x0a, 0x61, 0x57, 0x64, 0x6f, 0x64, 0x43, 0x41, 0x6f, 0x59, 0x79, + 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4e, 0x54, 0x45, 0x69, 0x4d, 0x43, + 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x5a, 0x54, 0x30, + 0x6c, 0x54, 0x56, 0x45, 0x55, 0x67, 0x52, 0x6d, 0x39, 0x31, 0x62, 0x6d, + 0x52, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x46, 0x62, 0x6d, + 0x52, 0x76, 0x63, 0x6e, 0x4e, 0x6c, 0x0a, 0x5a, 0x44, 0x45, 0x6f, 0x4d, + 0x43, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x66, 0x54, + 0x30, 0x6c, 0x54, 0x56, 0x45, 0x55, 0x67, 0x56, 0x30, 0x6c, 0x54, 0x5a, + 0x55, 0x74, 0x6c, 0x65, 0x53, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, + 0x57, 0x77, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x48, 0x51, + 0x53, 0x42, 0x44, 0x51, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x0a, + 0x4e, 0x54, 0x45, 0x79, 0x4d, 0x54, 0x45, 0x78, 0x4e, 0x6a, 0x41, 0x7a, + 0x4e, 0x44, 0x52, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4e, 0x7a, 0x45, 0x79, + 0x4d, 0x54, 0x45, 0x78, 0x4e, 0x6a, 0x41, 0x35, 0x4e, 0x54, 0x46, 0x61, + 0x4d, 0x49, 0x47, 0x4b, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x44, 0x53, 0x44, 0x45, 0x51, + 0x4d, 0x41, 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, + 0x48, 0x56, 0x30, 0x6c, 0x54, 0x5a, 0x55, 0x74, 0x6c, 0x65, 0x54, 0x45, + 0x62, 0x4d, 0x42, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, + 0x53, 0x51, 0x32, 0x39, 0x77, 0x65, 0x58, 0x4a, 0x70, 0x5a, 0x32, 0x68, + 0x30, 0x49, 0x43, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x79, 0x4d, 0x44, 0x41, + 0x31, 0x4d, 0x53, 0x49, 0x77, 0x49, 0x41, 0x59, 0x44, 0x0a, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x78, 0x6c, 0x50, 0x53, 0x56, 0x4e, 0x55, 0x52, 0x53, + 0x42, 0x47, 0x62, 0x33, 0x56, 0x75, 0x5a, 0x47, 0x46, 0x30, 0x61, 0x57, + 0x39, 0x75, 0x49, 0x45, 0x56, 0x75, 0x5a, 0x47, 0x39, 0x79, 0x63, 0x32, + 0x56, 0x6b, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x39, 0x50, 0x53, 0x56, 0x4e, 0x55, 0x52, 0x53, + 0x42, 0x58, 0x0a, 0x53, 0x56, 0x4e, 0x6c, 0x53, 0x32, 0x56, 0x35, 0x49, + 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, 0x53, 0x62, + 0x32, 0x39, 0x30, 0x49, 0x45, 0x64, 0x42, 0x49, 0x45, 0x4e, 0x42, 0x4d, + 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, + 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x0a, 0x4d, 0x49, 0x49, 0x42, + 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x79, 0x30, 0x2b, 0x7a, + 0x41, 0x4a, 0x73, 0x39, 0x4e, 0x74, 0x33, 0x35, 0x30, 0x55, 0x6c, 0x71, + 0x61, 0x78, 0x42, 0x4a, 0x48, 0x2b, 0x7a, 0x59, 0x4b, 0x37, 0x4c, 0x47, + 0x2b, 0x44, 0x4b, 0x42, 0x4b, 0x55, 0x4f, 0x56, 0x54, 0x4a, 0x6f, 0x5a, + 0x49, 0x79, 0x45, 0x56, 0x52, 0x64, 0x37, 0x6a, 0x79, 0x42, 0x78, 0x52, + 0x0a, 0x56, 0x56, 0x75, 0x75, 0x6b, 0x2b, 0x67, 0x33, 0x2f, 0x79, 0x74, + 0x72, 0x36, 0x64, 0x54, 0x71, 0x76, 0x69, 0x72, 0x64, 0x71, 0x46, 0x45, + 0x72, 0x31, 0x32, 0x62, 0x44, 0x59, 0x56, 0x78, 0x67, 0x41, 0x73, 0x6a, + 0x31, 0x7a, 0x6e, 0x4a, 0x37, 0x4f, 0x37, 0x6a, 0x79, 0x54, 0x6d, 0x55, + 0x49, 0x6d, 0x73, 0x32, 0x6b, 0x61, 0x68, 0x6e, 0x42, 0x41, 0x62, 0x74, + 0x7a, 0x70, 0x74, 0x66, 0x32, 0x0a, 0x77, 0x39, 0x33, 0x4e, 0x76, 0x4b, + 0x53, 0x4c, 0x74, 0x5a, 0x6c, 0x68, 0x75, 0x41, 0x47, 0x69, 0x6f, 0x39, + 0x52, 0x4e, 0x31, 0x41, 0x55, 0x39, 0x6b, 0x61, 0x33, 0x34, 0x74, 0x41, + 0x68, 0x78, 0x5a, 0x4b, 0x39, 0x77, 0x38, 0x52, 0x78, 0x72, 0x66, 0x76, + 0x62, 0x44, 0x64, 0x35, 0x30, 0x6b, 0x63, 0x33, 0x76, 0x6b, 0x44, 0x49, + 0x7a, 0x68, 0x32, 0x54, 0x62, 0x68, 0x6d, 0x59, 0x73, 0x46, 0x0a, 0x6d, + 0x51, 0x76, 0x74, 0x52, 0x54, 0x45, 0x4a, 0x79, 0x73, 0x49, 0x41, 0x32, + 0x2f, 0x64, 0x79, 0x6f, 0x4a, 0x61, 0x71, 0x6c, 0x59, 0x66, 0x51, 0x6a, + 0x73, 0x65, 0x32, 0x59, 0x58, 0x4d, 0x4e, 0x64, 0x6d, 0x61, 0x4d, 0x33, + 0x42, 0x75, 0x30, 0x59, 0x36, 0x4b, 0x66, 0x66, 0x35, 0x4d, 0x54, 0x4d, + 0x50, 0x47, 0x68, 0x4a, 0x39, 0x76, 0x5a, 0x2f, 0x79, 0x78, 0x56, 0x69, + 0x4a, 0x47, 0x67, 0x0a, 0x34, 0x45, 0x38, 0x48, 0x73, 0x43, 0x68, 0x57, + 0x6a, 0x42, 0x67, 0x62, 0x6c, 0x30, 0x53, 0x4f, 0x69, 0x64, 0x33, 0x67, + 0x46, 0x32, 0x37, 0x6e, 0x4b, 0x75, 0x2b, 0x50, 0x4f, 0x51, 0x6f, 0x78, + 0x68, 0x49, 0x4c, 0x59, 0x51, 0x42, 0x52, 0x4a, 0x4c, 0x6e, 0x70, 0x42, + 0x35, 0x4b, 0x66, 0x2b, 0x34, 0x32, 0x54, 0x4d, 0x77, 0x56, 0x6c, 0x78, + 0x53, 0x79, 0x77, 0x68, 0x70, 0x31, 0x74, 0x39, 0x0a, 0x34, 0x42, 0x33, + 0x52, 0x4c, 0x6f, 0x47, 0x62, 0x77, 0x39, 0x68, 0x6f, 0x39, 0x37, 0x32, + 0x57, 0x47, 0x36, 0x78, 0x77, 0x73, 0x52, 0x59, 0x55, 0x43, 0x39, 0x74, + 0x67, 0x75, 0x53, 0x59, 0x42, 0x42, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, + 0x42, 0x6f, 0x31, 0x45, 0x77, 0x54, 0x7a, 0x41, 0x4c, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x59, 0x59, + 0x77, 0x0a, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, + 0x51, 0x55, 0x73, 0x77, 0x4e, 0x2b, 0x72, 0x6a, 0x61, 0x38, 0x73, 0x48, + 0x6e, 0x52, 0x33, 0x4a, 0x51, 0x6d, 0x74, 0x68, 0x47, 0x2b, 0x49, 0x62, + 0x4a, 0x70, 0x68, 0x70, 0x51, 0x77, 0x0a, 0x45, 0x41, 0x59, 0x4a, 0x4b, + 0x77, 0x59, 0x42, 0x42, 0x41, 0x47, 0x43, 0x4e, 0x78, 0x55, 0x42, 0x42, + 0x41, 0x4d, 0x43, 0x41, 0x51, 0x41, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x45, 0x75, 0x68, 0x2f, + 0x77, 0x75, 0x48, 0x62, 0x72, 0x50, 0x35, 0x77, 0x55, 0x4f, 0x78, 0x0a, + 0x53, 0x50, 0x4d, 0x6f, 0x77, 0x42, 0x30, 0x75, 0x79, 0x51, 0x6c, 0x42, + 0x2b, 0x70, 0x51, 0x41, 0x48, 0x4b, 0x53, 0x6b, 0x71, 0x30, 0x6c, 0x50, + 0x6a, 0x7a, 0x30, 0x65, 0x37, 0x30, 0x31, 0x76, 0x76, 0x62, 0x79, 0x6b, + 0x39, 0x76, 0x49, 0x6d, 0x4d, 0x4d, 0x6b, 0x51, 0x79, 0x68, 0x32, 0x49, + 0x2b, 0x33, 0x51, 0x5a, 0x48, 0x34, 0x56, 0x46, 0x76, 0x62, 0x42, 0x73, + 0x55, 0x66, 0x6b, 0x32, 0x0a, 0x66, 0x74, 0x76, 0x31, 0x54, 0x44, 0x49, + 0x36, 0x51, 0x55, 0x39, 0x62, 0x52, 0x38, 0x2f, 0x6f, 0x43, 0x79, 0x32, + 0x32, 0x78, 0x42, 0x6d, 0x64, 0x64, 0x4d, 0x56, 0x48, 0x78, 0x6a, 0x74, + 0x71, 0x44, 0x36, 0x77, 0x55, 0x32, 0x7a, 0x7a, 0x30, 0x63, 0x35, 0x79, + 0x70, 0x42, 0x64, 0x38, 0x41, 0x33, 0x48, 0x52, 0x34, 0x2b, 0x76, 0x67, + 0x31, 0x59, 0x46, 0x6b, 0x43, 0x45, 0x78, 0x68, 0x38, 0x0a, 0x76, 0x50, + 0x74, 0x4e, 0x73, 0x43, 0x42, 0x74, 0x51, 0x37, 0x74, 0x67, 0x4d, 0x48, + 0x70, 0x6e, 0x4d, 0x31, 0x7a, 0x46, 0x6d, 0x64, 0x48, 0x34, 0x4c, 0x54, + 0x6c, 0x53, 0x63, 0x2f, 0x75, 0x4d, 0x71, 0x70, 0x63, 0x6c, 0x58, 0x48, + 0x4c, 0x5a, 0x43, 0x42, 0x36, 0x72, 0x54, 0x6a, 0x7a, 0x6a, 0x67, 0x54, + 0x47, 0x66, 0x41, 0x36, 0x62, 0x37, 0x77, 0x50, 0x34, 0x70, 0x69, 0x46, + 0x58, 0x61, 0x0a, 0x68, 0x4e, 0x56, 0x51, 0x41, 0x37, 0x62, 0x69, 0x68, + 0x4b, 0x4f, 0x6d, 0x4e, 0x71, 0x6f, 0x52, 0x4f, 0x67, 0x48, 0x68, 0x47, + 0x45, 0x76, 0x57, 0x52, 0x47, 0x69, 0x7a, 0x50, 0x66, 0x6c, 0x54, 0x64, + 0x49, 0x53, 0x7a, 0x52, 0x70, 0x46, 0x47, 0x6c, 0x67, 0x43, 0x33, 0x67, + 0x43, 0x79, 0x32, 0x34, 0x65, 0x4d, 0x51, 0x34, 0x74, 0x75, 0x69, 0x35, + 0x79, 0x69, 0x50, 0x41, 0x5a, 0x5a, 0x69, 0x0a, 0x46, 0x6a, 0x34, 0x41, + 0x34, 0x78, 0x79, 0x6c, 0x4e, 0x6f, 0x45, 0x59, 0x6f, 0x6b, 0x78, 0x53, + 0x64, 0x73, 0x41, 0x52, 0x6f, 0x32, 0x37, 0x6d, 0x48, 0x62, 0x72, 0x6a, + 0x57, 0x72, 0x34, 0x32, 0x55, 0x38, 0x55, 0x2b, 0x64, 0x59, 0x2b, 0x47, + 0x61, 0x53, 0x6c, 0x59, 0x55, 0x37, 0x57, 0x63, 0x75, 0x32, 0x2b, 0x66, + 0x58, 0x4d, 0x55, 0x59, 0x37, 0x4e, 0x30, 0x76, 0x34, 0x5a, 0x6a, 0x4a, + 0x0a, 0x2f, 0x4c, 0x37, 0x66, 0x43, 0x67, 0x30, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x67, 0x6e, 0x61, 0x20, 0x4f, + 0x3d, 0x44, 0x68, 0x69, 0x6d, 0x79, 0x6f, 0x74, 0x69, 0x73, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x67, 0x6e, 0x61, 0x20, 0x4f, 0x3d, + 0x44, 0x68, 0x69, 0x6d, 0x79, 0x6f, 0x74, 0x69, 0x73, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x67, 0x6e, 0x61, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x38, 0x33, 0x36, 0x34, 0x38, 0x30, 0x32, + 0x39, 0x37, 0x34, 0x32, 0x30, 0x39, 0x33, 0x36, 0x32, 0x31, 0x37, 0x35, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x62, 0x3a, 0x35, + 0x37, 0x3a, 0x61, 0x36, 0x3a, 0x35, 0x62, 0x3a, 0x37, 0x64, 0x3a, 0x34, + 0x32, 0x3a, 0x38, 0x32, 0x3a, 0x31, 0x39, 0x3a, 0x62, 0x35, 0x3a, 0x64, + 0x38, 0x3a, 0x35, 0x38, 0x3a, 0x32, 0x36, 0x3a, 0x32, 0x38, 0x3a, 0x35, + 0x65, 0x3a, 0x66, 0x64, 0x3a, 0x66, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x31, 0x3a, 0x32, 0x65, 0x3a, 0x31, 0x33, + 0x3a, 0x36, 0x33, 0x3a, 0x34, 0x35, 0x3a, 0x38, 0x36, 0x3a, 0x61, 0x34, + 0x3a, 0x36, 0x66, 0x3a, 0x31, 0x61, 0x3a, 0x62, 0x32, 0x3a, 0x36, 0x30, + 0x3a, 0x36, 0x38, 0x3a, 0x33, 0x37, 0x3a, 0x35, 0x38, 0x3a, 0x32, 0x64, + 0x3a, 0x63, 0x34, 0x3a, 0x61, 0x63, 0x3a, 0x66, 0x64, 0x3a, 0x39, 0x34, + 0x3a, 0x39, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x65, 0x33, 0x3a, 0x62, 0x36, 0x3a, 0x61, 0x32, 0x3a, 0x64, + 0x62, 0x3a, 0x32, 0x65, 0x3a, 0x64, 0x37, 0x3a, 0x63, 0x65, 0x3a, 0x34, + 0x38, 0x3a, 0x38, 0x34, 0x3a, 0x32, 0x66, 0x3a, 0x37, 0x61, 0x3a, 0x63, + 0x35, 0x3a, 0x33, 0x32, 0x3a, 0x34, 0x31, 0x3a, 0x63, 0x37, 0x3a, 0x62, + 0x37, 0x3a, 0x31, 0x64, 0x3a, 0x35, 0x34, 0x3a, 0x31, 0x34, 0x3a, 0x34, + 0x62, 0x3a, 0x66, 0x62, 0x3a, 0x34, 0x30, 0x3a, 0x63, 0x31, 0x3a, 0x31, + 0x66, 0x3a, 0x33, 0x66, 0x3a, 0x31, 0x64, 0x3a, 0x30, 0x62, 0x3a, 0x34, + 0x32, 0x3a, 0x66, 0x35, 0x3a, 0x65, 0x65, 0x3a, 0x61, 0x31, 0x3a, 0x32, + 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x71, 0x44, + 0x43, 0x43, 0x41, 0x70, 0x43, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x4a, 0x41, 0x50, 0x37, 0x63, 0x34, 0x77, 0x45, 0x50, 0x79, 0x55, + 0x6a, 0x2f, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x44, + 0x51, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, + 0x41, 0x59, 0x54, 0x41, 0x6b, 0x5a, 0x53, 0x4d, 0x52, 0x49, 0x77, 0x45, + 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, 0x6c, 0x45, 0x61, + 0x47, 0x6c, 0x74, 0x65, 0x57, 0x39, 0x30, 0x61, 0x58, 0x4d, 0x78, 0x45, + 0x54, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x43, + 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x32, 0x35, 0x68, 0x4d, + 0x42, 0x34, 0x58, 0x0a, 0x44, 0x54, 0x41, 0x33, 0x4d, 0x44, 0x59, 0x79, + 0x4f, 0x54, 0x45, 0x31, 0x4d, 0x54, 0x4d, 0x77, 0x4e, 0x56, 0x6f, 0x58, + 0x44, 0x54, 0x49, 0x33, 0x4d, 0x44, 0x59, 0x79, 0x4f, 0x54, 0x45, 0x31, + 0x4d, 0x54, 0x4d, 0x77, 0x4e, 0x56, 0x6f, 0x77, 0x4e, 0x44, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x52, 0x6c, 0x49, 0x78, 0x45, 0x6a, 0x41, 0x51, 0x0a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x43, 0x55, 0x52, 0x6f, 0x61, 0x57, 0x31, + 0x35, 0x62, 0x33, 0x52, 0x70, 0x63, 0x7a, 0x45, 0x52, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x49, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x47, 0x6c, 0x6e, 0x62, 0x6d, 0x45, 0x77, 0x67, 0x67, 0x45, + 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x0a, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, + 0x49, 0x42, 0x41, 0x51, 0x44, 0x49, 0x61, 0x50, 0x48, 0x4a, 0x31, 0x74, + 0x61, 0x7a, 0x4e, 0x48, 0x55, 0x6d, 0x67, 0x68, 0x37, 0x73, 0x74, 0x4c, + 0x37, 0x71, 0x58, 0x4f, 0x45, 0x6d, 0x37, 0x52, 0x46, 0x48, 0x59, 0x65, + 0x47, 0x69, 0x66, 0x42, 0x5a, 0x34, 0x0a, 0x51, 0x43, 0x48, 0x6b, 0x59, + 0x4a, 0x35, 0x61, 0x79, 0x47, 0x50, 0x68, 0x78, 0x4c, 0x47, 0x57, 0x6b, + 0x76, 0x38, 0x59, 0x62, 0x57, 0x6b, 0x6a, 0x34, 0x53, 0x74, 0x69, 0x39, + 0x39, 0x33, 0x69, 0x4e, 0x69, 0x2b, 0x52, 0x42, 0x37, 0x6c, 0x49, 0x7a, + 0x77, 0x37, 0x73, 0x65, 0x62, 0x59, 0x73, 0x35, 0x7a, 0x52, 0x4c, 0x63, + 0x41, 0x67, 0x6c, 0x6f, 0x7a, 0x79, 0x48, 0x47, 0x78, 0x6e, 0x79, 0x0a, + 0x67, 0x51, 0x63, 0x50, 0x4f, 0x4a, 0x41, 0x5a, 0x30, 0x78, 0x48, 0x2b, + 0x68, 0x72, 0x54, 0x79, 0x30, 0x56, 0x34, 0x65, 0x48, 0x70, 0x62, 0x4e, + 0x67, 0x47, 0x7a, 0x4f, 0x4f, 0x7a, 0x47, 0x54, 0x74, 0x76, 0x4b, 0x67, + 0x30, 0x4b, 0x6d, 0x56, 0x45, 0x6e, 0x32, 0x6c, 0x6d, 0x73, 0x78, 0x72, + 0x79, 0x49, 0x52, 0x57, 0x69, 0x6a, 0x4f, 0x70, 0x35, 0x79, 0x49, 0x56, + 0x55, 0x78, 0x62, 0x77, 0x0a, 0x7a, 0x42, 0x66, 0x73, 0x56, 0x31, 0x2f, + 0x70, 0x6f, 0x67, 0x71, 0x59, 0x43, 0x64, 0x37, 0x6a, 0x58, 0x35, 0x78, + 0x76, 0x33, 0x45, 0x6a, 0x6a, 0x68, 0x51, 0x73, 0x56, 0x57, 0x71, 0x61, + 0x36, 0x6e, 0x36, 0x78, 0x49, 0x34, 0x77, 0x6d, 0x79, 0x39, 0x2f, 0x51, + 0x79, 0x33, 0x6c, 0x34, 0x30, 0x76, 0x68, 0x78, 0x34, 0x58, 0x55, 0x4a, + 0x62, 0x7a, 0x67, 0x34, 0x69, 0x6a, 0x30, 0x32, 0x51, 0x0a, 0x31, 0x33, + 0x30, 0x79, 0x47, 0x4c, 0x4d, 0x4c, 0x4c, 0x47, 0x71, 0x2f, 0x6a, 0x6a, + 0x38, 0x55, 0x45, 0x59, 0x6b, 0x67, 0x44, 0x6e, 0x63, 0x55, 0x74, 0x54, + 0x32, 0x55, 0x43, 0x49, 0x66, 0x33, 0x4a, 0x52, 0x37, 0x56, 0x73, 0x6d, + 0x41, 0x41, 0x37, 0x47, 0x38, 0x71, 0x4b, 0x43, 0x56, 0x75, 0x4b, 0x6a, + 0x34, 0x59, 0x59, 0x78, 0x63, 0x6c, 0x50, 0x7a, 0x35, 0x45, 0x49, 0x42, + 0x62, 0x32, 0x0a, 0x4a, 0x73, 0x67, 0x6c, 0x72, 0x67, 0x56, 0x4b, 0x74, + 0x4f, 0x64, 0x6a, 0x4c, 0x50, 0x4f, 0x4d, 0x46, 0x6c, 0x4e, 0x2b, 0x58, + 0x50, 0x73, 0x52, 0x47, 0x67, 0x6a, 0x42, 0x52, 0x6d, 0x4b, 0x66, 0x49, + 0x72, 0x6a, 0x78, 0x77, 0x6f, 0x31, 0x70, 0x33, 0x50, 0x6f, 0x36, 0x57, + 0x41, 0x62, 0x66, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, + 0x62, 0x77, 0x77, 0x67, 0x62, 0x6b, 0x77, 0x0a, 0x44, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, + 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x47, 0x75, 0x33, 0x2b, + 0x51, 0x54, 0x6d, 0x51, 0x74, 0x43, 0x52, 0x5a, 0x76, 0x67, 0x48, 0x79, + 0x55, 0x74, 0x56, 0x46, 0x39, 0x6c, 0x6f, 0x35, 0x33, 0x42, 0x45, 0x77, + 0x0a, 0x5a, 0x41, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x46, 0x30, + 0x77, 0x57, 0x34, 0x41, 0x55, 0x47, 0x75, 0x33, 0x2b, 0x51, 0x54, 0x6d, + 0x51, 0x74, 0x43, 0x52, 0x5a, 0x76, 0x67, 0x48, 0x79, 0x55, 0x74, 0x56, + 0x46, 0x39, 0x6c, 0x6f, 0x35, 0x33, 0x42, 0x47, 0x68, 0x4f, 0x4b, 0x51, + 0x32, 0x4d, 0x44, 0x51, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x59, 0x54, 0x0a, 0x41, 0x6b, 0x5a, 0x53, 0x4d, 0x52, + 0x49, 0x77, 0x45, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, + 0x6c, 0x45, 0x61, 0x47, 0x6c, 0x74, 0x65, 0x57, 0x39, 0x30, 0x61, 0x58, + 0x4d, 0x78, 0x45, 0x54, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x4d, 0x4d, 0x43, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x32, + 0x35, 0x68, 0x67, 0x67, 0x6b, 0x41, 0x2f, 0x74, 0x7a, 0x6a, 0x0a, 0x41, + 0x51, 0x2f, 0x4a, 0x53, 0x50, 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, + 0x67, 0x45, 0x47, 0x4d, 0x42, 0x45, 0x47, 0x43, 0x57, 0x43, 0x47, 0x53, + 0x41, 0x47, 0x47, 0x2b, 0x45, 0x49, 0x42, 0x41, 0x51, 0x51, 0x45, 0x41, + 0x77, 0x49, 0x41, 0x42, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x0a, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, + 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x68, 0x51, 0x4d, 0x65, + 0x6b, 0x6e, 0x48, 0x32, 0x51, 0x71, 0x2f, 0x68, 0x6f, 0x32, 0x47, 0x65, + 0x36, 0x2f, 0x50, 0x41, 0x44, 0x2f, 0x4b, 0x6c, 0x31, 0x4e, 0x71, 0x56, + 0x35, 0x74, 0x61, 0x2b, 0x61, 0x44, 0x59, 0x39, 0x66, 0x6d, 0x34, 0x66, + 0x54, 0x49, 0x72, 0x76, 0x30, 0x51, 0x38, 0x68, 0x0a, 0x62, 0x56, 0x36, + 0x6c, 0x55, 0x6d, 0x50, 0x4f, 0x45, 0x76, 0x6a, 0x76, 0x4b, 0x74, 0x70, + 0x76, 0x36, 0x7a, 0x66, 0x2b, 0x45, 0x77, 0x4c, 0x48, 0x79, 0x7a, 0x73, + 0x2b, 0x49, 0x6d, 0x76, 0x61, 0x59, 0x53, 0x35, 0x2f, 0x31, 0x48, 0x49, + 0x39, 0x33, 0x54, 0x44, 0x68, 0x48, 0x6b, 0x78, 0x41, 0x47, 0x59, 0x77, + 0x50, 0x31, 0x35, 0x7a, 0x52, 0x67, 0x7a, 0x42, 0x37, 0x6d, 0x46, 0x6e, + 0x63, 0x0a, 0x66, 0x63, 0x61, 0x35, 0x44, 0x43, 0x6c, 0x4d, 0x6f, 0x54, + 0x4f, 0x69, 0x36, 0x32, 0x63, 0x36, 0x5a, 0x59, 0x54, 0x54, 0x6c, 0x75, + 0x4c, 0x74, 0x64, 0x6b, 0x56, 0x77, 0x6a, 0x37, 0x55, 0x72, 0x33, 0x76, + 0x6b, 0x6a, 0x31, 0x6b, 0x6c, 0x75, 0x50, 0x42, 0x53, 0x31, 0x78, 0x70, + 0x38, 0x31, 0x48, 0x6c, 0x44, 0x51, 0x77, 0x59, 0x39, 0x71, 0x63, 0x45, + 0x51, 0x43, 0x59, 0x73, 0x75, 0x75, 0x0a, 0x48, 0x57, 0x68, 0x42, 0x70, + 0x36, 0x70, 0x58, 0x36, 0x46, 0x4f, 0x71, 0x42, 0x39, 0x49, 0x47, 0x39, + 0x74, 0x55, 0x55, 0x42, 0x67, 0x75, 0x52, 0x41, 0x33, 0x55, 0x73, 0x62, + 0x48, 0x4b, 0x31, 0x59, 0x5a, 0x57, 0x61, 0x44, 0x59, 0x75, 0x35, 0x44, + 0x65, 0x66, 0x31, 0x33, 0x31, 0x54, 0x4e, 0x33, 0x75, 0x62, 0x59, 0x31, + 0x67, 0x6b, 0x49, 0x6c, 0x32, 0x50, 0x6c, 0x77, 0x53, 0x36, 0x77, 0x0a, + 0x74, 0x30, 0x51, 0x6d, 0x77, 0x43, 0x62, 0x41, 0x72, 0x31, 0x55, 0x77, + 0x6e, 0x6a, 0x76, 0x56, 0x4e, 0x69, 0x6f, 0x5a, 0x42, 0x50, 0x52, 0x63, + 0x48, 0x76, 0x2f, 0x50, 0x4c, 0x4c, 0x66, 0x2f, 0x30, 0x50, 0x32, 0x48, + 0x51, 0x42, 0x48, 0x56, 0x45, 0x53, 0x4f, 0x37, 0x53, 0x4d, 0x41, 0x68, + 0x71, 0x61, 0x51, 0x6f, 0x4c, 0x66, 0x30, 0x56, 0x2b, 0x4c, 0x42, 0x4f, + 0x4b, 0x2f, 0x51, 0x77, 0x0a, 0x57, 0x79, 0x48, 0x38, 0x45, 0x5a, 0x45, + 0x30, 0x76, 0x6b, 0x48, 0x76, 0x65, 0x35, 0x32, 0x58, 0x64, 0x66, 0x2b, + 0x58, 0x6c, 0x63, 0x43, 0x57, 0x57, 0x43, 0x2f, 0x71, 0x75, 0x30, 0x62, + 0x58, 0x75, 0x2b, 0x54, 0x5a, 0x4c, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x43, 0x79, 0x62, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x4f, 0x3d, 0x43, 0x79, 0x62, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, + 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x79, 0x62, + 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x4f, 0x3d, 0x43, 0x79, + 0x62, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x43, 0x79, 0x62, 0x65, 0x72, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x38, + 0x33, 0x35, 0x37, 0x30, 0x33, 0x32, 0x37, 0x38, 0x34, 0x35, 0x39, 0x36, + 0x38, 0x32, 0x38, 0x37, 0x37, 0x34, 0x38, 0x34, 0x33, 0x36, 0x30, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x32, 0x3a, 0x65, 0x34, + 0x3a, 0x34, 0x61, 0x3a, 0x38, 0x37, 0x3a, 0x65, 0x33, 0x3a, 0x36, 0x39, + 0x3a, 0x34, 0x30, 0x3a, 0x38, 0x30, 0x3a, 0x37, 0x37, 0x3a, 0x65, 0x61, + 0x3a, 0x62, 0x63, 0x3a, 0x65, 0x33, 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x66, + 0x3a, 0x66, 0x30, 0x3a, 0x65, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x35, 0x66, 0x3a, 0x34, 0x33, 0x3a, 0x65, 0x35, 0x3a, + 0x62, 0x31, 0x3a, 0x62, 0x66, 0x3a, 0x66, 0x38, 0x3a, 0x37, 0x38, 0x3a, + 0x38, 0x63, 0x3a, 0x61, 0x63, 0x3a, 0x31, 0x63, 0x3a, 0x63, 0x37, 0x3a, + 0x63, 0x61, 0x3a, 0x34, 0x61, 0x3a, 0x39, 0x61, 0x3a, 0x63, 0x36, 0x3a, + 0x32, 0x32, 0x3a, 0x32, 0x62, 0x3a, 0x63, 0x63, 0x3a, 0x33, 0x34, 0x3a, + 0x63, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x39, 0x36, 0x3a, 0x30, 0x61, 0x3a, 0x64, 0x66, 0x3a, 0x30, 0x30, + 0x3a, 0x36, 0x33, 0x3a, 0x65, 0x39, 0x3a, 0x36, 0x33, 0x3a, 0x35, 0x36, + 0x3a, 0x37, 0x35, 0x3a, 0x30, 0x63, 0x3a, 0x32, 0x39, 0x3a, 0x36, 0x35, + 0x3a, 0x64, 0x64, 0x3a, 0x30, 0x61, 0x3a, 0x30, 0x38, 0x3a, 0x36, 0x37, + 0x3a, 0x64, 0x61, 0x3a, 0x30, 0x62, 0x3a, 0x39, 0x63, 0x3a, 0x62, 0x64, + 0x3a, 0x36, 0x65, 0x3a, 0x37, 0x37, 0x3a, 0x37, 0x31, 0x3a, 0x34, 0x61, + 0x3a, 0x65, 0x61, 0x3a, 0x66, 0x62, 0x3a, 0x32, 0x33, 0x3a, 0x34, 0x39, + 0x3a, 0x61, 0x62, 0x3a, 0x33, 0x39, 0x3a, 0x33, 0x64, 0x3a, 0x61, 0x33, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x6f, 0x54, 0x43, + 0x43, 0x41, 0x6f, 0x6d, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x4c, 0x42, 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x44, 0x34, 0x57, + 0x71, 0x4c, 0x55, 0x67, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, + 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, + 0x77, 0x4f, 0x7a, 0x45, 0x59, 0x4d, 0x42, 0x59, 0x47, 0x0a, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x68, 0x4d, 0x50, 0x51, 0x33, 0x6c, 0x69, 0x5a, 0x58, + 0x4a, 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x77, 0x67, 0x53, 0x57, + 0x35, 0x6a, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x5a, 0x44, 0x65, 0x57, 0x4a, 0x6c, 0x63, 0x6e, + 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, 0x64, 0x73, 0x62, 0x32, + 0x4a, 0x68, 0x0a, 0x62, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x4d, + 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x32, 0x4d, 0x54, 0x49, 0x78, 0x4e, + 0x54, 0x41, 0x34, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, + 0x54, 0x49, 0x78, 0x4d, 0x54, 0x49, 0x78, 0x4e, 0x54, 0x41, 0x34, 0x4d, + 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x77, 0x4f, 0x7a, 0x45, 0x59, 0x4d, + 0x42, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x43, 0x68, 0x4d, 0x50, + 0x51, 0x33, 0x6c, 0x69, 0x5a, 0x58, 0x4a, 0x30, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x38, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x5a, 0x44, + 0x65, 0x57, 0x4a, 0x6c, 0x63, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x49, 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, 0x53, + 0x0a, 0x62, 0x32, 0x39, 0x30, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, + 0x41, 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, + 0x41, 0x2b, 0x4d, 0x69, 0x38, 0x76, 0x52, 0x52, 0x51, 0x5a, 0x68, 0x50, + 0x2f, 0x38, 0x4e, 0x4e, 0x35, 0x0a, 0x37, 0x43, 0x50, 0x79, 0x74, 0x78, + 0x72, 0x48, 0x6a, 0x6f, 0x58, 0x78, 0x45, 0x6e, 0x4f, 0x6d, 0x47, 0x61, + 0x6f, 0x51, 0x32, 0x35, 0x79, 0x69, 0x5a, 0x58, 0x52, 0x61, 0x64, 0x7a, + 0x35, 0x52, 0x66, 0x56, 0x62, 0x32, 0x33, 0x43, 0x4f, 0x32, 0x31, 0x4f, + 0x31, 0x66, 0x57, 0x4c, 0x45, 0x33, 0x54, 0x64, 0x56, 0x4a, 0x44, 0x6d, + 0x37, 0x31, 0x61, 0x6f, 0x66, 0x57, 0x30, 0x6f, 0x7a, 0x53, 0x0a, 0x4a, + 0x38, 0x62, 0x69, 0x2f, 0x7a, 0x61, 0x66, 0x6d, 0x47, 0x57, 0x67, 0x45, + 0x30, 0x37, 0x47, 0x4b, 0x6d, 0x53, 0x62, 0x31, 0x5a, 0x41, 0x53, 0x7a, + 0x78, 0x51, 0x47, 0x39, 0x44, 0x76, 0x6a, 0x31, 0x43, 0x69, 0x2b, 0x36, + 0x41, 0x37, 0x34, 0x71, 0x30, 0x35, 0x49, 0x6c, 0x47, 0x32, 0x4f, 0x6c, + 0x54, 0x45, 0x51, 0x58, 0x4f, 0x32, 0x69, 0x4c, 0x62, 0x33, 0x56, 0x4f, + 0x6d, 0x32, 0x79, 0x0a, 0x48, 0x4c, 0x74, 0x67, 0x77, 0x45, 0x5a, 0x4c, + 0x41, 0x66, 0x56, 0x4a, 0x72, 0x6e, 0x35, 0x47, 0x69, 0x74, 0x42, 0x30, + 0x6a, 0x61, 0x45, 0x4d, 0x41, 0x73, 0x37, 0x75, 0x2f, 0x4f, 0x65, 0x50, + 0x75, 0x47, 0x74, 0x6d, 0x38, 0x33, 0x39, 0x45, 0x41, 0x4c, 0x39, 0x6d, + 0x4a, 0x52, 0x51, 0x72, 0x33, 0x52, 0x41, 0x77, 0x48, 0x51, 0x65, 0x57, + 0x50, 0x30, 0x33, 0x32, 0x61, 0x37, 0x69, 0x50, 0x0a, 0x74, 0x33, 0x73, + 0x4d, 0x70, 0x54, 0x6a, 0x72, 0x33, 0x6b, 0x66, 0x62, 0x31, 0x56, 0x30, + 0x35, 0x2f, 0x49, 0x69, 0x6e, 0x38, 0x39, 0x63, 0x71, 0x64, 0x50, 0x48, + 0x6f, 0x57, 0x71, 0x49, 0x37, 0x6e, 0x31, 0x43, 0x36, 0x70, 0x6f, 0x78, + 0x46, 0x4e, 0x63, 0x4a, 0x51, 0x5a, 0x5a, 0x58, 0x63, 0x59, 0x34, 0x4c, + 0x76, 0x33, 0x62, 0x39, 0x33, 0x54, 0x5a, 0x78, 0x69, 0x79, 0x57, 0x4e, + 0x7a, 0x0a, 0x46, 0x74, 0x41, 0x70, 0x44, 0x30, 0x6d, 0x70, 0x53, 0x50, + 0x43, 0x7a, 0x71, 0x72, 0x64, 0x73, 0x78, 0x61, 0x63, 0x77, 0x4f, 0x55, + 0x42, 0x64, 0x72, 0x73, 0x54, 0x69, 0x58, 0x53, 0x5a, 0x54, 0x38, 0x4d, + 0x34, 0x63, 0x49, 0x77, 0x68, 0x68, 0x71, 0x4a, 0x51, 0x5a, 0x75, 0x67, + 0x52, 0x69, 0x51, 0x4f, 0x77, 0x66, 0x4f, 0x48, 0x42, 0x33, 0x45, 0x67, + 0x5a, 0x78, 0x70, 0x7a, 0x41, 0x59, 0x0a, 0x58, 0x53, 0x55, 0x6e, 0x70, + 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x47, 0x6c, 0x4d, + 0x49, 0x47, 0x69, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, + 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, + 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x0a, + 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, + 0x42, 0x42, 0x53, 0x32, 0x43, 0x48, 0x73, 0x4e, 0x65, 0x73, 0x79, 0x73, + 0x49, 0x45, 0x79, 0x47, 0x56, 0x6a, 0x4a, 0x65, 0x7a, 0x36, 0x74, 0x75, + 0x68, 0x53, 0x31, 0x77, 0x56, 0x7a, 0x41, 0x2f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x52, 0x38, 0x45, 0x4f, 0x44, 0x41, 0x32, 0x4d, 0x44, 0x53, 0x67, + 0x4d, 0x71, 0x41, 0x77, 0x0a, 0x68, 0x69, 0x35, 0x6f, 0x64, 0x48, 0x52, + 0x77, 0x4f, 0x69, 0x38, 0x76, 0x64, 0x33, 0x64, 0x33, 0x4d, 0x69, 0x35, + 0x77, 0x64, 0x57, 0x4a, 0x73, 0x61, 0x57, 0x4d, 0x74, 0x64, 0x48, 0x4a, + 0x31, 0x63, 0x33, 0x51, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4c, 0x32, 0x4e, + 0x79, 0x62, 0x43, 0x39, 0x6a, 0x64, 0x43, 0x39, 0x6a, 0x64, 0x48, 0x4a, + 0x76, 0x62, 0x33, 0x51, 0x75, 0x59, 0x33, 0x4a, 0x73, 0x0a, 0x4d, 0x42, + 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, 0x51, 0x59, 0x4d, 0x42, + 0x61, 0x41, 0x46, 0x4c, 0x59, 0x49, 0x65, 0x77, 0x31, 0x36, 0x7a, 0x4b, + 0x77, 0x67, 0x54, 0x49, 0x5a, 0x57, 0x4d, 0x6c, 0x37, 0x50, 0x71, 0x32, + 0x36, 0x46, 0x4c, 0x58, 0x42, 0x58, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, + 0x55, 0x41, 0x0a, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x42, 0x57, 0x37, + 0x77, 0x6f, 0x6a, 0x6f, 0x46, 0x52, 0x4f, 0x6c, 0x5a, 0x66, 0x4a, 0x2b, + 0x49, 0x6e, 0x61, 0x52, 0x63, 0x48, 0x55, 0x6f, 0x77, 0x41, 0x6c, 0x39, + 0x42, 0x38, 0x54, 0x71, 0x37, 0x65, 0x6a, 0x68, 0x56, 0x68, 0x70, 0x77, + 0x6a, 0x43, 0x74, 0x32, 0x42, 0x57, 0x4b, 0x4c, 0x65, 0x50, 0x4a, 0x7a, + 0x59, 0x46, 0x61, 0x2b, 0x48, 0x4d, 0x6a, 0x0a, 0x57, 0x71, 0x64, 0x38, + 0x42, 0x66, 0x50, 0x39, 0x49, 0x6a, 0x73, 0x4f, 0x30, 0x51, 0x62, 0x45, + 0x32, 0x7a, 0x5a, 0x4d, 0x63, 0x77, 0x53, 0x4f, 0x35, 0x62, 0x41, 0x69, + 0x35, 0x4d, 0x58, 0x7a, 0x4c, 0x71, 0x58, 0x5a, 0x49, 0x2b, 0x4f, 0x34, + 0x54, 0x6b, 0x6f, 0x67, 0x70, 0x32, 0x34, 0x43, 0x4a, 0x4a, 0x38, 0x69, + 0x59, 0x47, 0x64, 0x37, 0x69, 0x78, 0x31, 0x79, 0x43, 0x63, 0x55, 0x78, + 0x0a, 0x58, 0x4f, 0x6c, 0x35, 0x6e, 0x34, 0x42, 0x48, 0x50, 0x61, 0x32, + 0x68, 0x43, 0x77, 0x63, 0x55, 0x50, 0x55, 0x66, 0x2f, 0x41, 0x32, 0x6b, + 0x61, 0x44, 0x41, 0x74, 0x45, 0x35, 0x32, 0x4d, 0x6c, 0x70, 0x33, 0x2b, + 0x79, 0x79, 0x62, 0x68, 0x32, 0x68, 0x4f, 0x30, 0x6a, 0x39, 0x6e, 0x30, + 0x48, 0x71, 0x30, 0x56, 0x2b, 0x30, 0x39, 0x2b, 0x7a, 0x76, 0x2b, 0x6d, + 0x4b, 0x74, 0x73, 0x32, 0x6f, 0x0a, 0x6f, 0x6d, 0x63, 0x72, 0x55, 0x74, + 0x57, 0x33, 0x5a, 0x66, 0x41, 0x35, 0x54, 0x47, 0x4f, 0x67, 0x6b, 0x58, + 0x6d, 0x54, 0x55, 0x67, 0x39, 0x55, 0x33, 0x59, 0x4f, 0x37, 0x6e, 0x39, + 0x47, 0x50, 0x70, 0x31, 0x4e, 0x7a, 0x77, 0x38, 0x76, 0x2f, 0x4d, 0x4f, + 0x78, 0x38, 0x42, 0x4c, 0x6a, 0x59, 0x52, 0x42, 0x2b, 0x54, 0x58, 0x33, + 0x45, 0x4a, 0x49, 0x72, 0x64, 0x75, 0x50, 0x75, 0x6f, 0x63, 0x0a, 0x41, + 0x30, 0x36, 0x64, 0x47, 0x69, 0x42, 0x68, 0x2b, 0x34, 0x45, 0x33, 0x37, + 0x46, 0x37, 0x38, 0x43, 0x6b, 0x57, 0x72, 0x31, 0x2b, 0x63, 0x58, 0x56, + 0x64, 0x43, 0x67, 0x36, 0x6d, 0x43, 0x62, 0x70, 0x76, 0x62, 0x6a, 0x6a, + 0x46, 0x73, 0x70, 0x77, 0x67, 0x5a, 0x67, 0x46, 0x4a, 0x30, 0x74, 0x6c, + 0x30, 0x79, 0x70, 0x6b, 0x78, 0x57, 0x64, 0x59, 0x63, 0x51, 0x42, 0x58, + 0x30, 0x6a, 0x57, 0x0a, 0x57, 0x4c, 0x31, 0x57, 0x4d, 0x52, 0x4a, 0x4f, + 0x45, 0x63, 0x67, 0x68, 0x34, 0x4c, 0x4d, 0x52, 0x6b, 0x57, 0x58, 0x62, + 0x74, 0x4b, 0x61, 0x49, 0x4f, 0x4d, 0x35, 0x56, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x4f, 0x3d, + 0x43, 0x68, 0x75, 0x6e, 0x67, 0x68, 0x77, 0x61, 0x20, 0x54, 0x65, 0x6c, + 0x65, 0x63, 0x6f, 0x6d, 0x20, 0x43, 0x6f, 0x2e, 0x2c, 0x20, 0x4c, 0x74, + 0x64, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x65, 0x50, 0x4b, 0x49, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x4f, 0x3d, 0x43, 0x68, 0x75, 0x6e, 0x67, 0x68, 0x77, + 0x61, 0x20, 0x54, 0x65, 0x6c, 0x65, 0x63, 0x6f, 0x6d, 0x20, 0x43, 0x6f, + 0x2e, 0x2c, 0x20, 0x4c, 0x74, 0x64, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x65, + 0x50, 0x4b, 0x49, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x65, 0x50, 0x4b, 0x49, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x32, 0x38, 0x39, 0x35, 0x36, 0x30, 0x38, 0x38, + 0x36, 0x38, 0x32, 0x37, 0x33, 0x35, 0x31, 0x38, 0x39, 0x36, 0x35, 0x35, + 0x30, 0x33, 0x30, 0x35, 0x32, 0x39, 0x30, 0x35, 0x37, 0x33, 0x35, 0x32, + 0x37, 0x36, 0x30, 0x34, 0x37, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x31, 0x62, 0x3a, 0x32, 0x65, 0x3a, 0x30, 0x30, 0x3a, 0x63, + 0x61, 0x3a, 0x32, 0x36, 0x3a, 0x30, 0x36, 0x3a, 0x39, 0x30, 0x3a, 0x33, + 0x64, 0x3a, 0x61, 0x64, 0x3a, 0x66, 0x65, 0x3a, 0x36, 0x66, 0x3a, 0x31, + 0x35, 0x3a, 0x36, 0x38, 0x3a, 0x64, 0x33, 0x3a, 0x36, 0x62, 0x3a, 0x62, + 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x37, + 0x3a, 0x36, 0x35, 0x3a, 0x30, 0x64, 0x3a, 0x66, 0x31, 0x3a, 0x37, 0x65, + 0x3a, 0x38, 0x65, 0x3a, 0x37, 0x65, 0x3a, 0x35, 0x62, 0x3a, 0x38, 0x32, + 0x3a, 0x34, 0x30, 0x3a, 0x61, 0x34, 0x3a, 0x66, 0x34, 0x3a, 0x35, 0x36, + 0x3a, 0x34, 0x62, 0x3a, 0x63, 0x66, 0x3a, 0x65, 0x32, 0x3a, 0x33, 0x64, + 0x3a, 0x36, 0x39, 0x3a, 0x63, 0x36, 0x3a, 0x66, 0x30, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x30, 0x3a, 0x61, + 0x36, 0x3a, 0x66, 0x34, 0x3a, 0x64, 0x63, 0x3a, 0x36, 0x33, 0x3a, 0x61, + 0x32, 0x3a, 0x34, 0x62, 0x3a, 0x66, 0x64, 0x3a, 0x63, 0x66, 0x3a, 0x35, + 0x34, 0x3a, 0x65, 0x66, 0x3a, 0x32, 0x61, 0x3a, 0x36, 0x61, 0x3a, 0x30, + 0x38, 0x3a, 0x32, 0x61, 0x3a, 0x30, 0x61, 0x3a, 0x37, 0x32, 0x3a, 0x64, + 0x65, 0x3a, 0x33, 0x35, 0x3a, 0x38, 0x30, 0x3a, 0x33, 0x65, 0x3a, 0x32, + 0x66, 0x3a, 0x66, 0x35, 0x3a, 0x66, 0x66, 0x3a, 0x35, 0x32, 0x3a, 0x37, + 0x61, 0x3a, 0x65, 0x35, 0x3a, 0x64, 0x38, 0x3a, 0x37, 0x32, 0x3a, 0x30, + 0x36, 0x3a, 0x64, 0x66, 0x3a, 0x64, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x46, 0x73, 0x44, 0x43, 0x43, 0x41, 0x35, 0x69, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x46, 0x63, 0x69, 0x39, + 0x5a, 0x55, 0x64, 0x63, 0x72, 0x37, 0x69, 0x58, 0x41, 0x46, 0x37, 0x6b, + 0x42, 0x74, 0x4b, 0x38, 0x6e, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, + 0x41, 0x44, 0x42, 0x65, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x55, 0x56, 0x7a, 0x45, + 0x6a, 0x4d, 0x43, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, + 0x61, 0x51, 0x32, 0x68, 0x31, 0x62, 0x6d, 0x64, 0x6f, 0x64, 0x32, 0x45, + 0x67, 0x56, 0x47, 0x56, 0x73, 0x5a, 0x57, 0x4e, 0x76, 0x62, 0x53, 0x42, + 0x44, 0x62, 0x79, 0x34, 0x73, 0x49, 0x45, 0x78, 0x30, 0x0a, 0x5a, 0x43, + 0x34, 0x78, 0x4b, 0x6a, 0x41, 0x6f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x73, 0x4d, 0x49, 0x57, 0x56, 0x51, 0x53, 0x30, 0x6b, 0x67, 0x55, 0x6d, + 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, + 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, + 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, + 0x41, 0x65, 0x0a, 0x46, 0x77, 0x30, 0x77, 0x4e, 0x44, 0x45, 0x79, 0x4d, + 0x6a, 0x41, 0x77, 0x4d, 0x6a, 0x4d, 0x78, 0x4d, 0x6a, 0x64, 0x61, 0x46, + 0x77, 0x30, 0x7a, 0x4e, 0x44, 0x45, 0x79, 0x4d, 0x6a, 0x41, 0x77, 0x4d, + 0x6a, 0x4d, 0x78, 0x4d, 0x6a, 0x64, 0x61, 0x4d, 0x46, 0x34, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6c, 0x52, 0x58, 0x4d, 0x53, 0x4d, 0x77, 0x0a, 0x49, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x70, 0x44, 0x61, 0x48, 0x56, 0x75, + 0x5a, 0x32, 0x68, 0x33, 0x59, 0x53, 0x42, 0x55, 0x5a, 0x57, 0x78, 0x6c, + 0x59, 0x32, 0x39, 0x74, 0x49, 0x45, 0x4e, 0x76, 0x4c, 0x69, 0x77, 0x67, + 0x54, 0x48, 0x52, 0x6b, 0x4c, 0x6a, 0x45, 0x71, 0x4d, 0x43, 0x67, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x77, 0x77, 0x68, 0x5a, 0x56, 0x42, 0x4c, + 0x0a, 0x53, 0x53, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, + 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, + 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, + 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x45, 0x46, 0x0a, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, + 0x38, 0x41, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, + 0x45, 0x41, 0x34, 0x53, 0x55, 0x50, 0x37, 0x6f, 0x33, 0x62, 0x69, 0x44, + 0x4e, 0x31, 0x5a, 0x38, 0x32, 0x74, 0x48, 0x33, 0x30, 0x36, 0x54, 0x6d, + 0x32, 0x64, 0x30, 0x79, 0x38, 0x55, 0x38, 0x32, 0x4e, 0x30, 0x79, 0x77, + 0x45, 0x68, 0x61, 0x6a, 0x66, 0x71, 0x68, 0x46, 0x41, 0x48, 0x0a, 0x53, + 0x79, 0x5a, 0x62, 0x43, 0x55, 0x4e, 0x73, 0x49, 0x5a, 0x35, 0x71, 0x79, + 0x4e, 0x55, 0x44, 0x39, 0x57, 0x42, 0x70, 0x6a, 0x38, 0x7a, 0x77, 0x49, + 0x75, 0x51, 0x66, 0x35, 0x2f, 0x64, 0x71, 0x49, 0x6a, 0x47, 0x33, 0x4c, + 0x42, 0x58, 0x79, 0x34, 0x50, 0x34, 0x41, 0x61, 0x6b, 0x50, 0x2f, 0x68, + 0x32, 0x58, 0x47, 0x74, 0x52, 0x72, 0x42, 0x70, 0x30, 0x78, 0x74, 0x49, + 0x6e, 0x41, 0x68, 0x0a, 0x69, 0x6a, 0x48, 0x79, 0x6c, 0x33, 0x53, 0x4a, + 0x43, 0x52, 0x49, 0x6d, 0x48, 0x4a, 0x37, 0x4b, 0x32, 0x52, 0x4b, 0x69, + 0x6c, 0x54, 0x7a, 0x61, 0x36, 0x57, 0x65, 0x2f, 0x43, 0x4b, 0x42, 0x6b, + 0x34, 0x39, 0x5a, 0x43, 0x74, 0x30, 0x58, 0x76, 0x6c, 0x2f, 0x54, 0x32, + 0x39, 0x64, 0x65, 0x31, 0x53, 0x68, 0x55, 0x43, 0x57, 0x48, 0x32, 0x59, + 0x57, 0x45, 0x74, 0x67, 0x76, 0x4d, 0x33, 0x58, 0x0a, 0x44, 0x5a, 0x6f, + 0x54, 0x4d, 0x31, 0x50, 0x52, 0x59, 0x66, 0x6c, 0x36, 0x31, 0x64, 0x64, + 0x34, 0x73, 0x35, 0x6f, 0x7a, 0x39, 0x77, 0x43, 0x47, 0x7a, 0x68, 0x31, + 0x4e, 0x6c, 0x44, 0x69, 0x76, 0x71, 0x4f, 0x78, 0x34, 0x55, 0x58, 0x43, + 0x4b, 0x58, 0x42, 0x43, 0x44, 0x55, 0x53, 0x48, 0x33, 0x45, 0x54, 0x30, + 0x30, 0x68, 0x6c, 0x37, 0x6c, 0x53, 0x4d, 0x32, 0x58, 0x67, 0x59, 0x49, + 0x31, 0x0a, 0x54, 0x42, 0x6e, 0x73, 0x5a, 0x66, 0x5a, 0x72, 0x78, 0x51, + 0x57, 0x68, 0x37, 0x6b, 0x63, 0x54, 0x31, 0x72, 0x4d, 0x68, 0x4a, 0x35, + 0x51, 0x51, 0x43, 0x74, 0x6b, 0x6b, 0x4f, 0x37, 0x71, 0x2b, 0x52, 0x42, + 0x4e, 0x47, 0x4d, 0x44, 0x2b, 0x58, 0x50, 0x4e, 0x6a, 0x58, 0x31, 0x32, + 0x72, 0x75, 0x4f, 0x7a, 0x6a, 0x6a, 0x4b, 0x39, 0x53, 0x58, 0x44, 0x72, + 0x6b, 0x62, 0x35, 0x77, 0x64, 0x4a, 0x0a, 0x66, 0x7a, 0x63, 0x71, 0x2b, + 0x58, 0x64, 0x34, 0x7a, 0x31, 0x54, 0x74, 0x57, 0x30, 0x61, 0x64, 0x6f, + 0x34, 0x41, 0x4f, 0x6b, 0x55, 0x50, 0x42, 0x31, 0x6c, 0x74, 0x66, 0x46, + 0x4c, 0x71, 0x66, 0x70, 0x6f, 0x30, 0x6b, 0x52, 0x30, 0x42, 0x5a, 0x76, + 0x33, 0x49, 0x34, 0x73, 0x6a, 0x5a, 0x73, 0x4e, 0x2f, 0x2b, 0x5a, 0x30, + 0x56, 0x30, 0x4f, 0x57, 0x51, 0x71, 0x72, 0x61, 0x66, 0x66, 0x41, 0x0a, + 0x73, 0x67, 0x52, 0x46, 0x65, 0x6c, 0x51, 0x41, 0x72, 0x72, 0x35, 0x54, + 0x39, 0x72, 0x58, 0x6e, 0x34, 0x66, 0x67, 0x38, 0x6f, 0x7a, 0x48, 0x53, + 0x71, 0x66, 0x34, 0x68, 0x55, 0x6d, 0x54, 0x46, 0x70, 0x6d, 0x66, 0x77, + 0x64, 0x51, 0x63, 0x47, 0x6c, 0x42, 0x53, 0x42, 0x56, 0x63, 0x59, 0x6e, + 0x35, 0x41, 0x47, 0x50, 0x46, 0x38, 0x46, 0x71, 0x63, 0x64, 0x65, 0x2b, + 0x53, 0x2f, 0x75, 0x55, 0x0a, 0x57, 0x48, 0x31, 0x2b, 0x45, 0x54, 0x4f, + 0x78, 0x51, 0x76, 0x64, 0x69, 0x62, 0x42, 0x6a, 0x57, 0x7a, 0x77, 0x6c, + 0x6f, 0x50, 0x6e, 0x39, 0x73, 0x39, 0x68, 0x36, 0x50, 0x59, 0x71, 0x32, + 0x6c, 0x59, 0x39, 0x73, 0x4a, 0x70, 0x78, 0x38, 0x69, 0x51, 0x6b, 0x45, + 0x65, 0x62, 0x35, 0x6d, 0x4b, 0x50, 0x74, 0x66, 0x35, 0x50, 0x30, 0x42, + 0x36, 0x65, 0x62, 0x43, 0x6c, 0x41, 0x5a, 0x4c, 0x53, 0x0a, 0x6e, 0x54, + 0x30, 0x49, 0x46, 0x61, 0x55, 0x51, 0x41, 0x53, 0x32, 0x7a, 0x4d, 0x6e, + 0x61, 0x6f, 0x6c, 0x51, 0x32, 0x7a, 0x65, 0x70, 0x72, 0x37, 0x42, 0x78, + 0x42, 0x34, 0x45, 0x57, 0x2f, 0x68, 0x6a, 0x38, 0x65, 0x36, 0x44, 0x79, + 0x55, 0x61, 0x64, 0x43, 0x72, 0x6c, 0x48, 0x4a, 0x68, 0x42, 0x6d, 0x64, + 0x38, 0x68, 0x68, 0x2b, 0x69, 0x56, 0x42, 0x6d, 0x6f, 0x4b, 0x73, 0x32, + 0x70, 0x48, 0x0a, 0x64, 0x6d, 0x58, 0x32, 0x4f, 0x73, 0x2b, 0x50, 0x59, + 0x68, 0x63, 0x5a, 0x65, 0x77, 0x6f, 0x6f, 0x7a, 0x52, 0x72, 0x53, 0x67, + 0x78, 0x34, 0x68, 0x78, 0x79, 0x79, 0x2f, 0x76, 0x76, 0x39, 0x68, 0x61, + 0x4c, 0x64, 0x6e, 0x47, 0x37, 0x74, 0x34, 0x54, 0x59, 0x33, 0x4f, 0x5a, + 0x2b, 0x58, 0x6b, 0x77, 0x59, 0x36, 0x33, 0x49, 0x32, 0x62, 0x69, 0x6e, + 0x5a, 0x42, 0x31, 0x4e, 0x4a, 0x69, 0x70, 0x0a, 0x4e, 0x69, 0x75, 0x4b, + 0x6d, 0x70, 0x53, 0x35, 0x6e, 0x65, 0x7a, 0x4d, 0x69, 0x72, 0x48, 0x34, + 0x4a, 0x59, 0x6c, 0x63, 0x57, 0x72, 0x59, 0x76, 0x6a, 0x42, 0x39, 0x74, + 0x65, 0x53, 0x53, 0x6e, 0x55, 0x6d, 0x6a, 0x44, 0x68, 0x44, 0x58, 0x69, + 0x5a, 0x6f, 0x31, 0x6a, 0x44, 0x69, 0x56, 0x4e, 0x31, 0x52, 0x6d, 0x79, + 0x35, 0x6e, 0x6b, 0x33, 0x70, 0x79, 0x4b, 0x64, 0x56, 0x44, 0x45, 0x43, + 0x0a, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x71, 0x4d, 0x47, 0x67, + 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, + 0x45, 0x46, 0x42, 0x34, 0x4d, 0x39, 0x37, 0x5a, 0x6e, 0x38, 0x75, 0x47, + 0x53, 0x4a, 0x67, 0x6c, 0x46, 0x77, 0x46, 0x55, 0x35, 0x4c, 0x6e, 0x63, + 0x2f, 0x51, 0x6b, 0x71, 0x69, 0x4d, 0x41, 0x77, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x45, 0x77, 0x51, 0x46, 0x0a, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x77, 0x4f, 0x51, 0x59, 0x45, 0x5a, 0x79, 0x6f, 0x48, 0x41, 0x41, + 0x51, 0x78, 0x4d, 0x43, 0x38, 0x77, 0x4c, 0x51, 0x49, 0x42, 0x41, 0x44, + 0x41, 0x4a, 0x42, 0x67, 0x55, 0x72, 0x44, 0x67, 0x4d, 0x43, 0x47, 0x67, + 0x55, 0x41, 0x4d, 0x41, 0x63, 0x47, 0x42, 0x57, 0x63, 0x71, 0x41, 0x77, + 0x41, 0x41, 0x42, 0x42, 0x52, 0x46, 0x73, 0x4d, 0x4c, 0x48, 0x0a, 0x43, + 0x6c, 0x5a, 0x38, 0x37, 0x6c, 0x74, 0x34, 0x44, 0x4a, 0x58, 0x35, 0x47, + 0x46, 0x50, 0x42, 0x70, 0x68, 0x7a, 0x59, 0x45, 0x44, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x43, + 0x62, 0x4f, 0x44, 0x55, 0x31, 0x6b, 0x42, 0x50, 0x70, 0x56, 0x4a, 0x75, + 0x66, 0x47, 0x42, 0x0a, 0x75, 0x76, 0x6c, 0x32, 0x49, 0x43, 0x4f, 0x31, + 0x4a, 0x32, 0x42, 0x30, 0x31, 0x47, 0x71, 0x5a, 0x4e, 0x46, 0x35, 0x73, + 0x41, 0x46, 0x50, 0x5a, 0x6e, 0x2f, 0x4b, 0x6d, 0x73, 0x53, 0x51, 0x48, + 0x52, 0x47, 0x6f, 0x71, 0x78, 0x71, 0x57, 0x4f, 0x65, 0x42, 0x4c, 0x6f, + 0x52, 0x39, 0x6c, 0x59, 0x47, 0x78, 0x4d, 0x71, 0x58, 0x6e, 0x6d, 0x62, + 0x6e, 0x77, 0x6f, 0x71, 0x5a, 0x36, 0x59, 0x6c, 0x0a, 0x50, 0x77, 0x5a, + 0x70, 0x56, 0x6e, 0x50, 0x44, 0x69, 0x6d, 0x5a, 0x49, 0x2b, 0x79, 0x6d, + 0x42, 0x56, 0x33, 0x51, 0x47, 0x79, 0x70, 0x7a, 0x71, 0x4b, 0x4f, 0x67, + 0x34, 0x5a, 0x79, 0x59, 0x72, 0x38, 0x64, 0x57, 0x31, 0x50, 0x32, 0x57, + 0x54, 0x2b, 0x44, 0x5a, 0x64, 0x6a, 0x6f, 0x32, 0x4e, 0x51, 0x43, 0x43, + 0x48, 0x47, 0x65, 0x72, 0x76, 0x4a, 0x38, 0x41, 0x39, 0x74, 0x44, 0x6b, + 0x50, 0x0a, 0x4a, 0x58, 0x74, 0x6f, 0x55, 0x48, 0x52, 0x56, 0x6e, 0x41, + 0x78, 0x5a, 0x66, 0x56, 0x6f, 0x39, 0x51, 0x5a, 0x51, 0x6c, 0x55, 0x67, + 0x6a, 0x67, 0x52, 0x79, 0x77, 0x56, 0x4d, 0x52, 0x6e, 0x56, 0x76, 0x77, + 0x64, 0x56, 0x78, 0x72, 0x73, 0x53, 0x74, 0x5a, 0x66, 0x30, 0x58, 0x34, + 0x4f, 0x46, 0x75, 0x6e, 0x48, 0x42, 0x32, 0x57, 0x79, 0x42, 0x45, 0x58, + 0x59, 0x4b, 0x43, 0x72, 0x43, 0x2f, 0x0a, 0x67, 0x70, 0x66, 0x33, 0x36, + 0x6a, 0x33, 0x36, 0x2b, 0x75, 0x77, 0x74, 0x71, 0x53, 0x69, 0x55, 0x4f, + 0x31, 0x62, 0x64, 0x30, 0x6c, 0x45, 0x75, 0x72, 0x73, 0x43, 0x39, 0x43, + 0x42, 0x57, 0x4d, 0x64, 0x31, 0x49, 0x30, 0x6c, 0x74, 0x61, 0x62, 0x72, + 0x4e, 0x4d, 0x64, 0x6a, 0x6d, 0x45, 0x50, 0x4e, 0x58, 0x75, 0x62, 0x72, + 0x6a, 0x6c, 0x70, 0x43, 0x32, 0x4a, 0x67, 0x51, 0x43, 0x41, 0x32, 0x0a, + 0x6a, 0x36, 0x2f, 0x37, 0x4e, 0x75, 0x34, 0x74, 0x43, 0x45, 0x6f, 0x64, + 0x75, 0x4c, 0x2b, 0x62, 0x58, 0x50, 0x6a, 0x71, 0x70, 0x52, 0x75, 0x67, + 0x63, 0x36, 0x62, 0x59, 0x2b, 0x47, 0x37, 0x67, 0x4d, 0x77, 0x52, 0x66, + 0x61, 0x4b, 0x6f, 0x6e, 0x68, 0x2b, 0x33, 0x5a, 0x77, 0x5a, 0x43, 0x63, + 0x37, 0x62, 0x33, 0x6a, 0x61, 0x6a, 0x57, 0x76, 0x59, 0x39, 0x2b, 0x72, + 0x47, 0x4e, 0x6d, 0x36, 0x0a, 0x35, 0x75, 0x6c, 0x4b, 0x36, 0x6c, 0x43, + 0x4b, 0x44, 0x32, 0x47, 0x54, 0x48, 0x75, 0x49, 0x74, 0x47, 0x65, 0x49, + 0x77, 0x6c, 0x44, 0x57, 0x53, 0x58, 0x51, 0x36, 0x32, 0x42, 0x36, 0x38, + 0x5a, 0x67, 0x49, 0x39, 0x48, 0x6b, 0x46, 0x46, 0x4c, 0x4c, 0x6b, 0x33, + 0x64, 0x68, 0x65, 0x4c, 0x53, 0x43, 0x6c, 0x49, 0x4b, 0x46, 0x35, 0x72, + 0x38, 0x47, 0x72, 0x42, 0x51, 0x41, 0x75, 0x55, 0x42, 0x0a, 0x6f, 0x32, + 0x4d, 0x33, 0x49, 0x55, 0x78, 0x45, 0x78, 0x4a, 0x74, 0x52, 0x6d, 0x52, + 0x45, 0x4f, 0x63, 0x35, 0x77, 0x47, 0x6a, 0x31, 0x51, 0x75, 0x70, 0x79, + 0x68, 0x65, 0x52, 0x44, 0x6d, 0x48, 0x56, 0x69, 0x30, 0x33, 0x76, 0x59, + 0x56, 0x45, 0x6c, 0x4f, 0x45, 0x4d, 0x53, 0x79, 0x79, 0x63, 0x77, 0x35, + 0x4b, 0x46, 0x4e, 0x47, 0x48, 0x4c, 0x44, 0x37, 0x69, 0x62, 0x53, 0x6b, + 0x4e, 0x53, 0x0a, 0x2f, 0x6a, 0x51, 0x36, 0x66, 0x62, 0x6a, 0x70, 0x4b, + 0x64, 0x78, 0x32, 0x71, 0x63, 0x67, 0x77, 0x2b, 0x42, 0x52, 0x78, 0x67, + 0x4d, 0x59, 0x65, 0x4e, 0x6b, 0x68, 0x30, 0x49, 0x6b, 0x46, 0x63, 0x68, + 0x34, 0x4c, 0x6f, 0x47, 0x48, 0x47, 0x4c, 0x51, 0x59, 0x6c, 0x45, 0x35, + 0x33, 0x35, 0x59, 0x57, 0x36, 0x69, 0x34, 0x6a, 0x52, 0x50, 0x70, 0x70, + 0x32, 0x7a, 0x44, 0x52, 0x2b, 0x32, 0x7a, 0x0a, 0x47, 0x70, 0x31, 0x69, + 0x72, 0x6f, 0x32, 0x43, 0x36, 0x70, 0x53, 0x65, 0x33, 0x56, 0x6b, 0x51, + 0x77, 0x36, 0x33, 0x64, 0x34, 0x6b, 0x33, 0x6a, 0x4d, 0x64, 0x58, 0x48, + 0x37, 0x4f, 0x6a, 0x79, 0x73, 0x50, 0x36, 0x53, 0x48, 0x68, 0x59, 0x4b, + 0x47, 0x76, 0x7a, 0x5a, 0x38, 0x2f, 0x67, 0x6e, 0x74, 0x73, 0x6d, 0x2b, + 0x48, 0x62, 0x52, 0x73, 0x5a, 0x4a, 0x42, 0x2f, 0x39, 0x4f, 0x54, 0x45, + 0x0a, 0x57, 0x39, 0x63, 0x33, 0x72, 0x6b, 0x49, 0x4f, 0x33, 0x61, 0x51, + 0x61, 0x62, 0x33, 0x79, 0x49, 0x56, 0x4d, 0x55, 0x57, 0x62, 0x75, 0x46, + 0x36, 0x61, 0x43, 0x37, 0x34, 0x4f, 0x72, 0x38, 0x4e, 0x70, 0x44, 0x79, + 0x4a, 0x4f, 0x33, 0x69, 0x6e, 0x54, 0x6d, 0x4f, 0x44, 0x42, 0x43, 0x45, + 0x49, 0x5a, 0x34, 0x33, 0x79, 0x67, 0x6b, 0x6e, 0x51, 0x57, 0x2f, 0x32, + 0x78, 0x7a, 0x51, 0x2b, 0x44, 0x0a, 0x68, 0x4e, 0x51, 0x2b, 0x49, 0x49, + 0x58, 0x33, 0x53, 0x6a, 0x30, 0x72, 0x6e, 0x50, 0x30, 0x71, 0x43, 0x67, + 0x6c, 0x4e, 0x36, 0x6f, 0x48, 0x34, 0x45, 0x5a, 0x77, 0x3d, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x4f, 0x3d, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x4f, + 0x55, 0x3d, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x52, + 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x4f, 0x3d, 0x63, 0x65, 0x72, 0x74, + 0x53, 0x49, 0x47, 0x4e, 0x20, 0x4f, 0x55, 0x3d, 0x63, 0x65, 0x72, 0x74, + 0x53, 0x49, 0x47, 0x4e, 0x20, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x63, + 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x52, 0x4f, 0x4f, 0x54, + 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x33, 0x35, 0x32, 0x31, 0x30, 0x32, 0x32, 0x37, 0x32, + 0x34, 0x39, 0x31, 0x35, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x31, 0x38, 0x3a, 0x39, 0x38, 0x3a, 0x63, 0x30, 0x3a, 0x64, 0x36, + 0x3a, 0x65, 0x39, 0x3a, 0x33, 0x61, 0x3a, 0x66, 0x63, 0x3a, 0x66, 0x39, + 0x3a, 0x62, 0x30, 0x3a, 0x66, 0x35, 0x3a, 0x30, 0x63, 0x3a, 0x66, 0x37, + 0x3a, 0x34, 0x62, 0x3a, 0x30, 0x31, 0x3a, 0x34, 0x34, 0x3a, 0x31, 0x37, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x61, 0x3a, + 0x62, 0x37, 0x3a, 0x65, 0x65, 0x3a, 0x33, 0x36, 0x3a, 0x39, 0x37, 0x3a, + 0x32, 0x36, 0x3a, 0x36, 0x32, 0x3a, 0x66, 0x62, 0x3a, 0x32, 0x64, 0x3a, + 0x62, 0x30, 0x3a, 0x32, 0x61, 0x3a, 0x66, 0x36, 0x3a, 0x62, 0x66, 0x3a, + 0x30, 0x33, 0x3a, 0x66, 0x64, 0x3a, 0x65, 0x38, 0x3a, 0x37, 0x63, 0x3a, + 0x34, 0x62, 0x3a, 0x32, 0x66, 0x3a, 0x39, 0x62, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x61, 0x3a, 0x61, 0x39, + 0x3a, 0x36, 0x32, 0x3a, 0x63, 0x34, 0x3a, 0x66, 0x61, 0x3a, 0x34, 0x61, + 0x3a, 0x36, 0x62, 0x3a, 0x61, 0x66, 0x3a, 0x65, 0x62, 0x3a, 0x65, 0x34, + 0x3a, 0x31, 0x35, 0x3a, 0x31, 0x39, 0x3a, 0x36, 0x64, 0x3a, 0x33, 0x35, + 0x3a, 0x31, 0x63, 0x3a, 0x63, 0x64, 0x3a, 0x38, 0x38, 0x3a, 0x38, 0x64, + 0x3a, 0x34, 0x66, 0x3a, 0x35, 0x33, 0x3a, 0x66, 0x33, 0x3a, 0x66, 0x61, + 0x3a, 0x38, 0x61, 0x3a, 0x65, 0x36, 0x3a, 0x64, 0x37, 0x3a, 0x63, 0x34, + 0x3a, 0x36, 0x36, 0x3a, 0x61, 0x39, 0x3a, 0x34, 0x65, 0x3a, 0x36, 0x30, + 0x3a, 0x34, 0x32, 0x3a, 0x62, 0x62, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x44, 0x4f, 0x44, 0x43, 0x43, 0x41, 0x69, 0x43, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x47, 0x49, 0x41, 0x59, 0x46, 0x46, + 0x6e, 0x41, 0x43, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, + 0x44, 0x73, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x59, 0x54, 0x0a, 0x41, 0x6c, 0x4a, 0x50, 0x4d, 0x52, 0x45, 0x77, + 0x44, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x68, 0x6a, + 0x5a, 0x58, 0x4a, 0x30, 0x55, 0x30, 0x6c, 0x48, 0x54, 0x6a, 0x45, 0x5a, + 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x51, + 0x59, 0x32, 0x56, 0x79, 0x64, 0x46, 0x4e, 0x4a, 0x52, 0x30, 0x34, 0x67, + 0x55, 0x6b, 0x39, 0x50, 0x56, 0x43, 0x42, 0x44, 0x0a, 0x51, 0x54, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x77, 0x4e, 0x6a, 0x41, 0x33, 0x4d, 0x44, 0x51, + 0x78, 0x4e, 0x7a, 0x49, 0x77, 0x4d, 0x44, 0x52, 0x61, 0x46, 0x77, 0x30, + 0x7a, 0x4d, 0x54, 0x41, 0x33, 0x4d, 0x44, 0x51, 0x78, 0x4e, 0x7a, 0x49, + 0x77, 0x4d, 0x44, 0x52, 0x61, 0x4d, 0x44, 0x73, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x4a, + 0x50, 0x0a, 0x4d, 0x52, 0x45, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x45, 0x77, 0x68, 0x6a, 0x5a, 0x58, 0x4a, 0x30, 0x55, 0x30, + 0x6c, 0x48, 0x54, 0x6a, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x78, 0x4d, 0x51, 0x59, 0x32, 0x56, 0x79, 0x64, 0x46, + 0x4e, 0x4a, 0x52, 0x30, 0x34, 0x67, 0x55, 0x6b, 0x39, 0x50, 0x56, 0x43, + 0x42, 0x44, 0x51, 0x54, 0x43, 0x43, 0x0a, 0x41, 0x53, 0x49, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, + 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, + 0x4c, 0x63, 0x7a, 0x75, 0x58, 0x37, 0x49, 0x4a, 0x55, 0x71, 0x4f, 0x74, + 0x64, 0x75, 0x30, 0x4b, 0x42, 0x75, 0x71, 0x56, 0x35, 0x44, 0x6f, 0x0a, + 0x30, 0x53, 0x4c, 0x54, 0x5a, 0x4c, 0x72, 0x54, 0x6b, 0x2b, 0x6a, 0x55, + 0x72, 0x49, 0x5a, 0x68, 0x51, 0x47, 0x70, 0x67, 0x56, 0x32, 0x68, 0x55, + 0x68, 0x45, 0x32, 0x38, 0x61, 0x6c, 0x51, 0x43, 0x42, 0x66, 0x2f, 0x66, + 0x6d, 0x35, 0x6f, 0x71, 0x72, 0x6c, 0x30, 0x48, 0x6a, 0x30, 0x72, 0x44, + 0x4b, 0x48, 0x2f, 0x76, 0x2b, 0x79, 0x76, 0x36, 0x65, 0x66, 0x48, 0x48, + 0x72, 0x66, 0x41, 0x51, 0x0a, 0x55, 0x79, 0x53, 0x51, 0x69, 0x32, 0x62, + 0x4a, 0x71, 0x49, 0x69, 0x72, 0x72, 0x31, 0x71, 0x6a, 0x41, 0x4f, 0x6d, + 0x2b, 0x75, 0x6b, 0x62, 0x75, 0x57, 0x33, 0x4e, 0x37, 0x4c, 0x42, 0x65, + 0x43, 0x67, 0x56, 0x35, 0x69, 0x4c, 0x4b, 0x45, 0x43, 0x5a, 0x62, 0x4f, + 0x39, 0x78, 0x53, 0x73, 0x41, 0x66, 0x73, 0x54, 0x38, 0x41, 0x7a, 0x4e, + 0x58, 0x44, 0x65, 0x33, 0x69, 0x2b, 0x73, 0x35, 0x64, 0x0a, 0x52, 0x64, + 0x59, 0x34, 0x7a, 0x54, 0x57, 0x32, 0x73, 0x73, 0x48, 0x51, 0x6e, 0x49, + 0x46, 0x4b, 0x71, 0x75, 0x53, 0x79, 0x41, 0x56, 0x77, 0x64, 0x6a, 0x31, + 0x2b, 0x5a, 0x78, 0x4c, 0x47, 0x74, 0x32, 0x34, 0x67, 0x68, 0x36, 0x35, + 0x41, 0x49, 0x67, 0x6f, 0x44, 0x7a, 0x4d, 0x4b, 0x4e, 0x44, 0x35, 0x70, + 0x43, 0x43, 0x72, 0x6c, 0x55, 0x6f, 0x53, 0x65, 0x31, 0x62, 0x31, 0x36, + 0x6b, 0x51, 0x0a, 0x4f, 0x41, 0x37, 0x2b, 0x6a, 0x30, 0x78, 0x62, 0x6d, + 0x30, 0x62, 0x71, 0x51, 0x66, 0x57, 0x77, 0x43, 0x48, 0x54, 0x44, 0x30, + 0x49, 0x67, 0x7a, 0x74, 0x6e, 0x7a, 0x58, 0x64, 0x4e, 0x2f, 0x63, 0x68, + 0x4e, 0x46, 0x44, 0x44, 0x6e, 0x55, 0x35, 0x6f, 0x53, 0x56, 0x41, 0x4b, + 0x4f, 0x70, 0x34, 0x79, 0x77, 0x34, 0x73, 0x4c, 0x6a, 0x6d, 0x64, 0x6a, + 0x49, 0x74, 0x75, 0x46, 0x68, 0x77, 0x76, 0x0a, 0x4a, 0x6f, 0x49, 0x51, + 0x34, 0x75, 0x4e, 0x6c, 0x6c, 0x41, 0x6f, 0x45, 0x77, 0x46, 0x37, 0x33, + 0x58, 0x56, 0x76, 0x34, 0x45, 0x4f, 0x4c, 0x51, 0x75, 0x6e, 0x70, 0x4c, + 0x2b, 0x39, 0x34, 0x33, 0x41, 0x41, 0x41, 0x61, 0x57, 0x79, 0x6a, 0x6a, + 0x30, 0x70, 0x78, 0x7a, 0x50, 0x6a, 0x4b, 0x48, 0x6d, 0x4b, 0x48, 0x4a, + 0x55, 0x53, 0x2f, 0x58, 0x33, 0x71, 0x77, 0x7a, 0x73, 0x30, 0x38, 0x43, + 0x0a, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, + 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, + 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x63, 0x59, 0x77, 0x48, 0x51, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x4f, 0x0a, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4f, + 0x43, 0x4d, 0x6d, 0x39, 0x73, 0x6c, 0x53, 0x62, 0x50, 0x78, 0x66, 0x49, + 0x62, 0x57, 0x73, 0x6b, 0x4b, 0x48, 0x43, 0x39, 0x42, 0x72, 0x6f, 0x4e, + 0x6e, 0x6b, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x41, 0x51, 0x41, 0x2b, 0x30, 0x68, 0x79, 0x4a, 0x0a, 0x4c, + 0x6a, 0x58, 0x38, 0x2b, 0x48, 0x58, 0x64, 0x35, 0x6e, 0x39, 0x6c, 0x69, + 0x50, 0x52, 0x79, 0x54, 0x4d, 0x6b, 0x73, 0x31, 0x7a, 0x4a, 0x4f, 0x38, + 0x39, 0x30, 0x5a, 0x65, 0x55, 0x65, 0x39, 0x6a, 0x6a, 0x74, 0x62, 0x6b, + 0x77, 0x39, 0x51, 0x53, 0x53, 0x51, 0x54, 0x61, 0x78, 0x51, 0x47, 0x63, + 0x75, 0x38, 0x4a, 0x30, 0x36, 0x47, 0x68, 0x34, 0x30, 0x43, 0x45, 0x79, + 0x65, 0x63, 0x59, 0x0a, 0x4d, 0x6e, 0x51, 0x38, 0x53, 0x47, 0x34, 0x50, + 0x6e, 0x30, 0x76, 0x55, 0x39, 0x78, 0x37, 0x54, 0x6b, 0x34, 0x5a, 0x6b, + 0x56, 0x4a, 0x64, 0x6a, 0x63, 0x6c, 0x44, 0x56, 0x56, 0x63, 0x2f, 0x36, + 0x49, 0x4a, 0x4d, 0x43, 0x6f, 0x70, 0x76, 0x44, 0x49, 0x35, 0x4e, 0x4f, + 0x46, 0x6c, 0x56, 0x32, 0x6f, 0x48, 0x42, 0x35, 0x62, 0x63, 0x30, 0x68, + 0x48, 0x38, 0x38, 0x76, 0x4c, 0x62, 0x77, 0x5a, 0x0a, 0x34, 0x34, 0x67, + 0x78, 0x2b, 0x46, 0x6b, 0x61, 0x67, 0x51, 0x6e, 0x49, 0x6c, 0x36, 0x5a, + 0x30, 0x78, 0x32, 0x44, 0x45, 0x57, 0x38, 0x78, 0x58, 0x6a, 0x72, 0x4a, + 0x31, 0x2f, 0x52, 0x73, 0x43, 0x43, 0x64, 0x74, 0x5a, 0x62, 0x33, 0x4b, + 0x54, 0x61, 0x66, 0x63, 0x78, 0x51, 0x64, 0x61, 0x49, 0x4f, 0x4c, 0x2b, + 0x48, 0x73, 0x72, 0x30, 0x57, 0x65, 0x66, 0x6d, 0x71, 0x35, 0x4c, 0x36, + 0x49, 0x0a, 0x4a, 0x64, 0x31, 0x68, 0x4a, 0x79, 0x4d, 0x63, 0x74, 0x54, + 0x45, 0x48, 0x42, 0x44, 0x61, 0x30, 0x47, 0x70, 0x43, 0x39, 0x6f, 0x48, + 0x52, 0x78, 0x55, 0x49, 0x6c, 0x74, 0x76, 0x42, 0x54, 0x6a, 0x44, 0x34, + 0x61, 0x75, 0x38, 0x61, 0x73, 0x2b, 0x78, 0x36, 0x41, 0x4a, 0x7a, 0x4b, + 0x4e, 0x49, 0x30, 0x65, 0x44, 0x62, 0x5a, 0x4f, 0x65, 0x53, 0x74, 0x63, + 0x2b, 0x76, 0x63, 0x6b, 0x4e, 0x77, 0x0a, 0x69, 0x2f, 0x6e, 0x44, 0x68, + 0x44, 0x77, 0x54, 0x71, 0x6e, 0x36, 0x53, 0x6d, 0x31, 0x64, 0x54, 0x6b, + 0x2f, 0x70, 0x77, 0x77, 0x70, 0x45, 0x4f, 0x4d, 0x66, 0x6d, 0x62, 0x5a, + 0x31, 0x33, 0x70, 0x6c, 0x6a, 0x68, 0x65, 0x58, 0x37, 0x4e, 0x7a, 0x54, + 0x6f, 0x67, 0x56, 0x5a, 0x39, 0x36, 0x65, 0x64, 0x68, 0x42, 0x69, 0x49, + 0x4c, 0x35, 0x56, 0x61, 0x5a, 0x56, 0x44, 0x41, 0x44, 0x6c, 0x4e, 0x0a, + 0x39, 0x75, 0x36, 0x77, 0x57, 0x6b, 0x35, 0x4a, 0x52, 0x46, 0x52, 0x59, + 0x58, 0x30, 0x4b, 0x44, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, + 0x55, 0x3d, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, + 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, + 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, + 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x28, 0x63, + 0x29, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x47, 0x65, 0x6f, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, + 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, + 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x65, 0x6f, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x32, 0x38, 0x38, 0x30, 0x39, 0x31, + 0x30, 0x35, 0x37, 0x36, 0x39, 0x39, 0x32, 0x38, 0x35, 0x36, 0x34, 0x33, + 0x31, 0x33, 0x39, 0x38, 0x34, 0x30, 0x38, 0x35, 0x32, 0x30, 0x39, 0x39, + 0x37, 0x35, 0x38, 0x38, 0x35, 0x35, 0x39, 0x39, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x35, 0x3a, 0x65, 0x38, 0x3a, 0x33, 0x34, + 0x3a, 0x33, 0x36, 0x3a, 0x63, 0x39, 0x3a, 0x31, 0x30, 0x3a, 0x34, 0x34, + 0x3a, 0x35, 0x38, 0x3a, 0x34, 0x38, 0x3a, 0x37, 0x30, 0x3a, 0x36, 0x64, + 0x3a, 0x32, 0x65, 0x3a, 0x38, 0x33, 0x3a, 0x64, 0x34, 0x3a, 0x62, 0x38, + 0x3a, 0x30, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x30, 0x33, 0x3a, 0x39, 0x65, 0x3a, 0x65, 0x64, 0x3a, 0x62, 0x38, 0x3a, + 0x30, 0x62, 0x3a, 0x65, 0x37, 0x3a, 0x61, 0x30, 0x3a, 0x33, 0x63, 0x3a, + 0x36, 0x39, 0x3a, 0x35, 0x33, 0x3a, 0x38, 0x39, 0x3a, 0x33, 0x62, 0x3a, + 0x32, 0x30, 0x3a, 0x64, 0x32, 0x3a, 0x64, 0x39, 0x3a, 0x33, 0x32, 0x3a, + 0x33, 0x61, 0x3a, 0x34, 0x63, 0x3a, 0x32, 0x61, 0x3a, 0x66, 0x64, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x34, + 0x3a, 0x37, 0x38, 0x3a, 0x62, 0x38, 0x3a, 0x31, 0x32, 0x3a, 0x32, 0x35, + 0x3a, 0x30, 0x64, 0x3a, 0x66, 0x38, 0x3a, 0x37, 0x38, 0x3a, 0x36, 0x33, + 0x3a, 0x35, 0x63, 0x3a, 0x32, 0x61, 0x3a, 0x61, 0x37, 0x3a, 0x65, 0x63, + 0x3a, 0x37, 0x64, 0x3a, 0x31, 0x35, 0x3a, 0x35, 0x65, 0x3a, 0x61, 0x61, + 0x3a, 0x36, 0x32, 0x3a, 0x35, 0x65, 0x3a, 0x65, 0x38, 0x3a, 0x32, 0x39, + 0x3a, 0x31, 0x36, 0x3a, 0x65, 0x32, 0x3a, 0x63, 0x64, 0x3a, 0x32, 0x39, + 0x3a, 0x34, 0x33, 0x3a, 0x36, 0x31, 0x3a, 0x38, 0x38, 0x3a, 0x36, 0x63, + 0x3a, 0x64, 0x31, 0x3a, 0x66, 0x62, 0x3a, 0x64, 0x34, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x2f, 0x6a, 0x43, 0x43, 0x41, 0x75, + 0x61, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x46, 0x61, + 0x78, 0x75, 0x6c, 0x42, 0x6d, 0x79, 0x65, 0x55, 0x74, 0x42, 0x39, 0x69, + 0x65, 0x70, 0x77, 0x78, 0x67, 0x50, 0x48, 0x7a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x6d, 0x44, 0x45, 0x4c, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, + 0x56, 0x4d, 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x54, 0x44, 0x55, 0x64, 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, + 0x58, 0x4e, 0x30, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x4f, + 0x54, 0x41, 0x33, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x0a, + 0x4d, 0x43, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x79, 0x4d, 0x44, 0x41, 0x34, + 0x49, 0x45, 0x64, 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x67, 0x4c, 0x53, 0x42, 0x47, + 0x62, 0x33, 0x49, 0x67, 0x59, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, + 0x61, 0x58, 0x70, 0x6c, 0x5a, 0x43, 0x42, 0x31, 0x63, 0x32, 0x55, 0x67, + 0x62, 0x32, 0x35, 0x73, 0x0a, 0x65, 0x54, 0x45, 0x32, 0x4d, 0x44, 0x51, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x74, 0x52, 0x32, 0x56, + 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x55, 0x48, 0x4a, + 0x70, 0x62, 0x57, 0x46, 0x79, 0x65, 0x53, 0x42, 0x44, 0x5a, 0x58, 0x4a, + 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, + 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x0a, 0x63, 0x6d, + 0x6c, 0x30, 0x65, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x7a, 0x4d, 0x42, + 0x34, 0x58, 0x44, 0x54, 0x41, 0x34, 0x4d, 0x44, 0x51, 0x77, 0x4d, 0x6a, + 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, + 0x4d, 0x33, 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x54, 0x49, 0x7a, 0x4e, 0x54, + 0x6b, 0x31, 0x4f, 0x56, 0x6f, 0x77, 0x67, 0x5a, 0x67, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6c, 0x56, 0x54, 0x4d, 0x52, 0x59, 0x77, 0x46, 0x41, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, 0x48, 0x5a, 0x57, 0x39, 0x55, 0x63, + 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, + 0x54, 0x6b, 0x77, 0x4e, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, + 0x7a, 0x41, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x0a, 0x4d, 0x6a, 0x41, 0x77, + 0x4f, 0x43, 0x42, 0x48, 0x5a, 0x57, 0x39, 0x55, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, + 0x52, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, + 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, + 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x4e, 0x6a, 0x41, 0x30, + 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4c, 0x55, 0x64, + 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x42, + 0x79, 0x61, 0x57, 0x31, 0x68, 0x63, 0x6e, 0x6b, 0x67, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, + 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, + 0x70, 0x64, 0x48, 0x6b, 0x67, 0x0a, 0x4c, 0x53, 0x42, 0x48, 0x4d, 0x7a, + 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, + 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, + 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4e, 0x7a, 0x69, 0x58, 0x6d, + 0x4a, 0x59, 0x48, 0x54, 0x4e, 0x58, 0x4f, 0x54, 0x49, 0x7a, 0x0a, 0x2b, + 0x75, 0x76, 0x4c, 0x68, 0x34, 0x79, 0x6e, 0x31, 0x45, 0x72, 0x64, 0x42, + 0x6f, 0x6a, 0x71, 0x5a, 0x49, 0x34, 0x78, 0x6d, 0x4b, 0x55, 0x34, 0x6b, + 0x42, 0x36, 0x59, 0x7a, 0x79, 0x35, 0x6a, 0x4b, 0x2f, 0x42, 0x47, 0x76, + 0x45, 0x53, 0x79, 0x69, 0x61, 0x48, 0x41, 0x4b, 0x41, 0x78, 0x4a, 0x63, + 0x43, 0x47, 0x56, 0x6e, 0x32, 0x54, 0x41, 0x70, 0x70, 0x4d, 0x53, 0x41, + 0x6d, 0x55, 0x6d, 0x0a, 0x68, 0x73, 0x61, 0x6c, 0x69, 0x66, 0x44, 0x36, + 0x31, 0x34, 0x53, 0x67, 0x63, 0x4b, 0x39, 0x50, 0x47, 0x70, 0x63, 0x2f, + 0x42, 0x6b, 0x54, 0x56, 0x79, 0x65, 0x74, 0x79, 0x45, 0x48, 0x33, 0x6b, + 0x4d, 0x53, 0x6a, 0x37, 0x48, 0x47, 0x48, 0x6d, 0x4b, 0x41, 0x64, 0x45, + 0x63, 0x35, 0x49, 0x69, 0x61, 0x61, 0x63, 0x44, 0x69, 0x47, 0x79, 0x64, + 0x59, 0x38, 0x68, 0x53, 0x32, 0x70, 0x67, 0x6e, 0x0a, 0x35, 0x77, 0x68, + 0x4d, 0x63, 0x44, 0x36, 0x30, 0x79, 0x52, 0x4c, 0x42, 0x78, 0x57, 0x65, + 0x44, 0x58, 0x54, 0x50, 0x7a, 0x41, 0x78, 0x48, 0x73, 0x61, 0x74, 0x42, + 0x54, 0x34, 0x74, 0x47, 0x36, 0x4e, 0x6d, 0x43, 0x55, 0x67, 0x4c, 0x74, + 0x68, 0x59, 0x32, 0x78, 0x62, 0x46, 0x33, 0x37, 0x66, 0x51, 0x4a, 0x51, + 0x65, 0x71, 0x77, 0x33, 0x43, 0x49, 0x53, 0x68, 0x77, 0x69, 0x50, 0x2f, + 0x57, 0x0a, 0x4a, 0x6d, 0x78, 0x73, 0x59, 0x41, 0x51, 0x6c, 0x54, 0x6c, + 0x56, 0x2b, 0x66, 0x65, 0x2b, 0x2f, 0x6c, 0x45, 0x6a, 0x65, 0x74, 0x78, + 0x33, 0x64, 0x63, 0x49, 0x30, 0x46, 0x58, 0x34, 0x69, 0x6c, 0x6d, 0x2f, + 0x4c, 0x43, 0x37, 0x75, 0x72, 0x52, 0x51, 0x45, 0x46, 0x74, 0x59, 0x6a, + 0x67, 0x64, 0x56, 0x67, 0x62, 0x46, 0x41, 0x30, 0x64, 0x52, 0x49, 0x42, + 0x6e, 0x38, 0x65, 0x78, 0x41, 0x4c, 0x0a, 0x44, 0x6d, 0x4b, 0x75, 0x64, + 0x6c, 0x57, 0x2f, 0x58, 0x33, 0x65, 0x2b, 0x50, 0x6b, 0x6b, 0x42, 0x55, + 0x7a, 0x32, 0x59, 0x4a, 0x51, 0x4e, 0x32, 0x4a, 0x46, 0x6f, 0x64, 0x74, + 0x4e, 0x75, 0x4a, 0x36, 0x6e, 0x6e, 0x6c, 0x74, 0x72, 0x4d, 0x37, 0x50, + 0x37, 0x70, 0x4d, 0x4b, 0x45, 0x46, 0x2f, 0x42, 0x71, 0x78, 0x71, 0x6a, + 0x73, 0x48, 0x51, 0x39, 0x67, 0x55, 0x64, 0x66, 0x65, 0x5a, 0x43, 0x0a, + 0x68, 0x75, 0x4f, 0x6c, 0x31, 0x55, 0x63, 0x43, 0x41, 0x77, 0x45, 0x41, + 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, + 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, + 0x41, 0x51, 0x59, 0x77, 0x0a, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4d, 0x52, 0x35, 0x79, 0x6f, 0x36, + 0x68, 0x54, 0x67, 0x4d, 0x64, 0x48, 0x4e, 0x78, 0x72, 0x32, 0x7a, 0x46, + 0x62, 0x6c, 0x44, 0x34, 0x2f, 0x4d, 0x48, 0x38, 0x74, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x0a, 0x41, 0x51, + 0x41, 0x74, 0x78, 0x52, 0x50, 0x50, 0x56, 0x6f, 0x42, 0x37, 0x65, 0x6e, + 0x69, 0x39, 0x6e, 0x36, 0x34, 0x73, 0x6d, 0x65, 0x66, 0x76, 0x32, 0x74, + 0x2b, 0x55, 0x58, 0x67, 0x6c, 0x70, 0x70, 0x2b, 0x64, 0x75, 0x61, 0x49, + 0x79, 0x39, 0x63, 0x72, 0x35, 0x48, 0x71, 0x51, 0x36, 0x58, 0x45, 0x72, + 0x68, 0x4b, 0x38, 0x57, 0x54, 0x54, 0x4f, 0x64, 0x38, 0x6c, 0x4e, 0x4e, + 0x54, 0x42, 0x0a, 0x7a, 0x55, 0x36, 0x42, 0x38, 0x41, 0x38, 0x45, 0x78, + 0x43, 0x53, 0x7a, 0x4e, 0x4a, 0x62, 0x47, 0x70, 0x71, 0x6f, 0x77, 0x33, + 0x32, 0x68, 0x68, 0x63, 0x39, 0x66, 0x35, 0x6a, 0x6f, 0x57, 0x4a, 0x37, + 0x77, 0x35, 0x65, 0x6c, 0x53, 0x68, 0x4b, 0x4b, 0x69, 0x65, 0x50, 0x45, + 0x49, 0x34, 0x75, 0x66, 0x49, 0x62, 0x45, 0x41, 0x70, 0x37, 0x61, 0x44, + 0x48, 0x64, 0x6c, 0x44, 0x6b, 0x51, 0x4e, 0x0a, 0x6b, 0x76, 0x33, 0x39, + 0x73, 0x78, 0x59, 0x32, 0x2b, 0x68, 0x45, 0x4e, 0x48, 0x59, 0x77, 0x4f, + 0x42, 0x34, 0x6c, 0x71, 0x4b, 0x56, 0x62, 0x33, 0x63, 0x76, 0x54, 0x64, + 0x46, 0x5a, 0x78, 0x33, 0x4e, 0x57, 0x5a, 0x58, 0x71, 0x78, 0x4e, 0x54, + 0x32, 0x49, 0x37, 0x42, 0x51, 0x4d, 0x58, 0x58, 0x45, 0x78, 0x5a, 0x61, + 0x63, 0x73, 0x65, 0x33, 0x61, 0x51, 0x48, 0x45, 0x65, 0x72, 0x47, 0x44, + 0x0a, 0x41, 0x57, 0x68, 0x39, 0x6a, 0x55, 0x47, 0x68, 0x6c, 0x42, 0x6a, + 0x42, 0x4a, 0x56, 0x7a, 0x38, 0x38, 0x50, 0x36, 0x44, 0x41, 0x6f, 0x64, + 0x38, 0x44, 0x51, 0x33, 0x50, 0x4c, 0x67, 0x68, 0x63, 0x53, 0x6b, 0x41, + 0x4e, 0x50, 0x75, 0x79, 0x42, 0x59, 0x65, 0x59, 0x6b, 0x32, 0x38, 0x72, + 0x67, 0x44, 0x69, 0x30, 0x48, 0x73, 0x6a, 0x35, 0x57, 0x33, 0x49, 0x33, + 0x31, 0x51, 0x59, 0x55, 0x48, 0x0a, 0x53, 0x4a, 0x73, 0x4d, 0x43, 0x38, + 0x74, 0x4a, 0x50, 0x33, 0x33, 0x73, 0x74, 0x2f, 0x33, 0x4c, 0x6a, 0x57, + 0x65, 0x4a, 0x47, 0x71, 0x76, 0x74, 0x75, 0x78, 0x36, 0x6a, 0x41, 0x41, + 0x67, 0x49, 0x46, 0x79, 0x71, 0x43, 0x58, 0x44, 0x46, 0x64, 0x52, 0x6f, + 0x6f, 0x74, 0x44, 0x34, 0x61, 0x62, 0x64, 0x4e, 0x6c, 0x46, 0x2b, 0x39, + 0x52, 0x41, 0x73, 0x58, 0x71, 0x71, 0x61, 0x43, 0x32, 0x47, 0x0a, 0x73, + 0x70, 0x6b, 0x69, 0x34, 0x63, 0x45, 0x72, 0x78, 0x35, 0x7a, 0x34, 0x38, + 0x31, 0x2b, 0x6f, 0x67, 0x68, 0x4c, 0x72, 0x47, 0x52, 0x45, 0x74, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, + 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x74, 0x68, + 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, + 0x55, 0x3d, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x37, 0x20, 0x74, + 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, + 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, + 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x74, 0x68, + 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, + 0x55, 0x3d, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x37, 0x20, 0x74, + 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, + 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, + 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x37, 0x31, 0x37, 0x35, 0x38, 0x33, 0x32, 0x30, 0x36, + 0x37, 0x32, 0x38, 0x32, 0x35, 0x34, 0x31, 0x30, 0x30, 0x32, 0x30, 0x36, + 0x36, 0x31, 0x36, 0x32, 0x31, 0x30, 0x38, 0x35, 0x32, 0x35, 0x36, 0x34, + 0x37, 0x32, 0x34, 0x30, 0x36, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x37, 0x34, 0x3a, 0x39, 0x64, 0x3a, 0x65, 0x61, 0x3a, 0x36, 0x30, + 0x3a, 0x32, 0x34, 0x3a, 0x63, 0x34, 0x3a, 0x66, 0x64, 0x3a, 0x32, 0x32, + 0x3a, 0x35, 0x33, 0x3a, 0x33, 0x65, 0x3a, 0x63, 0x63, 0x3a, 0x33, 0x61, + 0x3a, 0x37, 0x32, 0x3a, 0x64, 0x39, 0x3a, 0x32, 0x39, 0x3a, 0x34, 0x66, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x61, 0x3a, + 0x64, 0x62, 0x3a, 0x62, 0x63, 0x3a, 0x32, 0x32, 0x3a, 0x32, 0x33, 0x3a, + 0x38, 0x66, 0x3a, 0x63, 0x34, 0x3a, 0x30, 0x31, 0x3a, 0x61, 0x31, 0x3a, + 0x32, 0x37, 0x3a, 0x62, 0x62, 0x3a, 0x33, 0x38, 0x3a, 0x64, 0x64, 0x3a, + 0x66, 0x34, 0x3a, 0x31, 0x64, 0x3a, 0x64, 0x62, 0x3a, 0x30, 0x38, 0x3a, + 0x39, 0x65, 0x3a, 0x66, 0x30, 0x3a, 0x31, 0x32, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x34, 0x3a, 0x33, 0x31, + 0x3a, 0x30, 0x64, 0x3a, 0x35, 0x30, 0x3a, 0x61, 0x66, 0x3a, 0x31, 0x38, + 0x3a, 0x61, 0x36, 0x3a, 0x34, 0x34, 0x3a, 0x37, 0x31, 0x3a, 0x39, 0x30, + 0x3a, 0x33, 0x37, 0x3a, 0x32, 0x61, 0x3a, 0x38, 0x36, 0x3a, 0x61, 0x66, + 0x3a, 0x61, 0x66, 0x3a, 0x38, 0x62, 0x3a, 0x39, 0x35, 0x3a, 0x31, 0x66, + 0x3a, 0x66, 0x62, 0x3a, 0x34, 0x33, 0x3a, 0x31, 0x64, 0x3a, 0x38, 0x33, + 0x3a, 0x37, 0x66, 0x3a, 0x31, 0x65, 0x3a, 0x35, 0x36, 0x3a, 0x38, 0x38, + 0x3a, 0x62, 0x34, 0x3a, 0x35, 0x39, 0x3a, 0x37, 0x31, 0x3a, 0x65, 0x64, + 0x3a, 0x31, 0x35, 0x3a, 0x35, 0x37, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x43, 0x69, 0x44, 0x43, 0x43, 0x41, 0x67, 0x32, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x4e, 0x66, 0x77, 0x6d, 0x58, + 0x4e, 0x6d, 0x45, 0x54, 0x38, 0x6b, 0x39, 0x4a, 0x6a, 0x31, 0x58, 0x6d, + 0x36, 0x37, 0x58, 0x56, 0x6a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, + 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x43, 0x42, 0x68, + 0x44, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x54, 0x41, 0x54, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x48, 0x52, 0x6f, + 0x59, 0x58, 0x64, 0x30, 0x5a, 0x53, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, + 0x4c, 0x6a, 0x45, 0x34, 0x4d, 0x44, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x78, 0x4d, 0x76, 0x4b, 0x47, 0x4d, 0x70, 0x0a, 0x49, 0x44, 0x49, + 0x77, 0x4d, 0x44, 0x63, 0x67, 0x64, 0x47, 0x68, 0x68, 0x64, 0x33, 0x52, + 0x6c, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, + 0x67, 0x52, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, + 0x76, 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, + 0x6c, 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x4a, 0x44, 0x41, + 0x69, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x47, 0x33, + 0x52, 0x6f, 0x59, 0x58, 0x64, 0x30, 0x5a, 0x53, 0x42, 0x51, 0x63, 0x6d, + 0x6c, 0x74, 0x59, 0x58, 0x4a, 0x35, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, + 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, 0x53, 0x42, 0x48, 0x4d, 0x6a, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4e, 0x7a, 0x45, 0x78, 0x4d, 0x44, + 0x55, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x44, 0x42, 0x61, 0x46, + 0x77, 0x30, 0x7a, 0x4f, 0x44, 0x41, 0x78, 0x4d, 0x54, 0x67, 0x79, 0x4d, + 0x7a, 0x55, 0x35, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x49, 0x47, 0x45, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x64, 0x47, 0x68, 0x68, 0x0a, + 0x64, 0x33, 0x52, 0x6c, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, + 0x4d, 0x54, 0x67, 0x77, 0x4e, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, + 0x45, 0x79, 0x38, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x77, + 0x4e, 0x79, 0x42, 0x30, 0x61, 0x47, 0x46, 0x33, 0x64, 0x47, 0x55, 0x73, + 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x67, 0x4c, 0x53, 0x42, 0x47, + 0x62, 0x33, 0x49, 0x67, 0x0a, 0x59, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, + 0x79, 0x61, 0x58, 0x70, 0x6c, 0x5a, 0x43, 0x42, 0x31, 0x63, 0x32, 0x55, + 0x67, 0x62, 0x32, 0x35, 0x73, 0x65, 0x54, 0x45, 0x6b, 0x4d, 0x43, 0x49, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x62, 0x64, 0x47, 0x68, + 0x68, 0x64, 0x33, 0x52, 0x6c, 0x49, 0x46, 0x42, 0x79, 0x61, 0x57, 0x31, + 0x68, 0x63, 0x6e, 0x6b, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x0a, 0x64, 0x43, + 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, 0x4d, 0x48, + 0x59, 0x77, 0x45, 0x41, 0x59, 0x48, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, + 0x30, 0x43, 0x41, 0x51, 0x59, 0x46, 0x4b, 0x34, 0x45, 0x45, 0x41, 0x43, + 0x49, 0x44, 0x59, 0x67, 0x41, 0x45, 0x6f, 0x74, 0x57, 0x63, 0x67, 0x6e, + 0x75, 0x56, 0x6e, 0x66, 0x46, 0x53, 0x65, 0x49, 0x66, 0x2b, 0x69, 0x68, + 0x61, 0x2f, 0x0a, 0x42, 0x65, 0x62, 0x66, 0x6f, 0x77, 0x4a, 0x50, 0x44, + 0x51, 0x66, 0x47, 0x41, 0x46, 0x47, 0x36, 0x44, 0x41, 0x4a, 0x53, 0x4c, + 0x53, 0x4b, 0x6b, 0x51, 0x6a, 0x6e, 0x45, 0x2f, 0x6f, 0x2f, 0x71, 0x79, + 0x63, 0x47, 0x2b, 0x31, 0x45, 0x33, 0x2f, 0x6e, 0x33, 0x71, 0x65, 0x34, + 0x72, 0x46, 0x38, 0x6d, 0x71, 0x32, 0x6e, 0x68, 0x67, 0x6c, 0x7a, 0x68, + 0x39, 0x48, 0x6e, 0x6d, 0x75, 0x4e, 0x36, 0x0a, 0x70, 0x61, 0x70, 0x75, + 0x2b, 0x37, 0x71, 0x7a, 0x63, 0x4d, 0x42, 0x6e, 0x69, 0x4b, 0x49, 0x31, + 0x31, 0x4b, 0x4f, 0x61, 0x73, 0x66, 0x32, 0x74, 0x77, 0x75, 0x38, 0x78, + 0x2b, 0x71, 0x69, 0x35, 0x38, 0x2f, 0x73, 0x49, 0x78, 0x70, 0x48, 0x52, + 0x2b, 0x79, 0x6d, 0x56, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, + 0x0a, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x6d, 0x74, 0x67, + 0x41, 0x4d, 0x41, 0x44, 0x6e, 0x61, 0x33, 0x2b, 0x46, 0x47, 0x4f, 0x36, + 0x4c, 0x74, 0x73, 0x36, 0x4b, 0x0a, 0x44, 0x50, 0x67, 0x52, 0x34, 0x62, + 0x73, 0x77, 0x43, 0x67, 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, + 0x30, 0x45, 0x41, 0x77, 0x4d, 0x44, 0x61, 0x51, 0x41, 0x77, 0x5a, 0x67, + 0x49, 0x78, 0x41, 0x4e, 0x33, 0x34, 0x34, 0x46, 0x64, 0x48, 0x57, 0x36, + 0x66, 0x6d, 0x43, 0x73, 0x4f, 0x39, 0x39, 0x59, 0x43, 0x4b, 0x6c, 0x7a, + 0x55, 0x4e, 0x47, 0x34, 0x6b, 0x38, 0x56, 0x49, 0x5a, 0x33, 0x0a, 0x4b, + 0x4d, 0x71, 0x68, 0x39, 0x48, 0x6e, 0x65, 0x74, 0x65, 0x59, 0x34, 0x73, + 0x50, 0x42, 0x6c, 0x63, 0x49, 0x78, 0x2f, 0x41, 0x6c, 0x54, 0x43, 0x76, + 0x2f, 0x2f, 0x59, 0x6f, 0x54, 0x37, 0x5a, 0x7a, 0x77, 0x49, 0x78, 0x41, + 0x4d, 0x53, 0x4e, 0x6c, 0x50, 0x7a, 0x63, 0x55, 0x39, 0x4c, 0x63, 0x6e, + 0x58, 0x67, 0x57, 0x48, 0x78, 0x55, 0x7a, 0x49, 0x31, 0x4e, 0x53, 0x34, + 0x31, 0x6f, 0x78, 0x0a, 0x58, 0x5a, 0x33, 0x4b, 0x72, 0x72, 0x30, 0x54, + 0x4b, 0x55, 0x51, 0x4e, 0x4a, 0x31, 0x75, 0x6f, 0x35, 0x32, 0x69, 0x63, + 0x45, 0x76, 0x64, 0x59, 0x50, 0x79, 0x35, 0x79, 0x41, 0x6c, 0x65, 0x6a, + 0x6a, 0x36, 0x45, 0x55, 0x4c, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, + 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x2d, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, + 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x44, 0x69, + 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, + 0x30, 0x30, 0x38, 0x20, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, + 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x74, 0x68, 0x61, + 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x33, + 0x20, 0x4f, 0x3d, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x44, 0x69, 0x76, 0x69, 0x73, 0x69, + 0x6f, 0x6e, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, + 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, + 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x74, 0x68, 0x61, 0x77, 0x74, 0x65, 0x20, 0x50, 0x72, 0x69, 0x6d, + 0x61, 0x72, 0x79, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x2d, 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x32, 0x37, 0x36, 0x31, 0x34, 0x31, 0x35, + 0x37, 0x30, 0x35, 0x36, 0x36, 0x38, 0x31, 0x32, 0x39, 0x39, 0x38, 0x30, + 0x35, 0x35, 0x35, 0x36, 0x34, 0x37, 0x36, 0x32, 0x37, 0x35, 0x39, 0x39, + 0x35, 0x34, 0x31, 0x34, 0x37, 0x37, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x66, 0x62, 0x3a, 0x31, 0x62, 0x3a, 0x35, 0x64, 0x3a, + 0x34, 0x33, 0x3a, 0x38, 0x61, 0x3a, 0x39, 0x34, 0x3a, 0x63, 0x64, 0x3a, + 0x34, 0x34, 0x3a, 0x63, 0x36, 0x3a, 0x37, 0x36, 0x3a, 0x66, 0x32, 0x3a, + 0x34, 0x33, 0x3a, 0x34, 0x62, 0x3a, 0x34, 0x37, 0x3a, 0x65, 0x37, 0x3a, + 0x33, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, + 0x31, 0x3a, 0x38, 0x62, 0x3a, 0x35, 0x33, 0x3a, 0x38, 0x64, 0x3a, 0x31, + 0x62, 0x3a, 0x65, 0x39, 0x3a, 0x30, 0x33, 0x3a, 0x62, 0x36, 0x3a, 0x61, + 0x36, 0x3a, 0x66, 0x30, 0x3a, 0x35, 0x36, 0x3a, 0x34, 0x33, 0x3a, 0x35, + 0x62, 0x3a, 0x31, 0x37, 0x3a, 0x31, 0x35, 0x3a, 0x38, 0x39, 0x3a, 0x63, + 0x61, 0x3a, 0x66, 0x33, 0x3a, 0x36, 0x62, 0x3a, 0x66, 0x32, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x62, 0x3a, + 0x30, 0x33, 0x3a, 0x66, 0x34, 0x3a, 0x35, 0x38, 0x3a, 0x30, 0x37, 0x3a, + 0x61, 0x64, 0x3a, 0x37, 0x30, 0x3a, 0x66, 0x32, 0x3a, 0x31, 0x62, 0x3a, + 0x66, 0x63, 0x3a, 0x32, 0x63, 0x3a, 0x61, 0x65, 0x3a, 0x37, 0x31, 0x3a, + 0x63, 0x39, 0x3a, 0x66, 0x64, 0x3a, 0x65, 0x34, 0x3a, 0x36, 0x30, 0x3a, + 0x34, 0x63, 0x3a, 0x30, 0x36, 0x3a, 0x34, 0x63, 0x3a, 0x66, 0x35, 0x3a, + 0x66, 0x66, 0x3a, 0x62, 0x36, 0x3a, 0x38, 0x36, 0x3a, 0x62, 0x61, 0x3a, + 0x65, 0x35, 0x3a, 0x64, 0x62, 0x3a, 0x61, 0x61, 0x3a, 0x64, 0x37, 0x3a, + 0x66, 0x64, 0x3a, 0x64, 0x33, 0x3a, 0x34, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x4b, 0x6a, 0x43, 0x43, 0x41, 0x78, 0x4b, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x59, 0x41, 0x47, + 0x58, 0x74, 0x30, 0x61, 0x6e, 0x36, 0x72, 0x53, 0x30, 0x6d, 0x74, 0x5a, + 0x4c, 0x4c, 0x2f, 0x65, 0x51, 0x2b, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, + 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x72, 0x6a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x54, 0x44, 0x48, 0x52, 0x6f, 0x59, 0x58, 0x64, 0x30, 0x5a, 0x53, + 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x6f, 0x4d, 0x43, + 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x66, 0x0a, 0x51, + 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, + 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x54, 0x5a, 0x58, 0x4a, 0x32, 0x61, + 0x57, 0x4e, 0x6c, 0x63, 0x79, 0x42, 0x45, 0x61, 0x58, 0x5a, 0x70, 0x63, + 0x32, 0x6c, 0x76, 0x62, 0x6a, 0x45, 0x34, 0x4d, 0x44, 0x59, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x76, 0x4b, 0x47, 0x4d, 0x70, 0x49, + 0x44, 0x49, 0x77, 0x0a, 0x4d, 0x44, 0x67, 0x67, 0x64, 0x47, 0x68, 0x68, + 0x64, 0x33, 0x52, 0x6c, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, + 0x49, 0x43, 0x30, 0x67, 0x52, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, + 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, + 0x64, 0x58, 0x4e, 0x6c, 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, + 0x4a, 0x44, 0x41, 0x69, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, + 0x54, 0x47, 0x33, 0x52, 0x6f, 0x59, 0x58, 0x64, 0x30, 0x5a, 0x53, 0x42, + 0x51, 0x63, 0x6d, 0x6c, 0x74, 0x59, 0x58, 0x4a, 0x35, 0x49, 0x46, 0x4a, + 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, 0x53, 0x42, + 0x48, 0x4d, 0x7a, 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x44, 0x41, + 0x30, 0x4d, 0x44, 0x49, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x42, + 0x61, 0x0a, 0x46, 0x77, 0x30, 0x7a, 0x4e, 0x7a, 0x45, 0x79, 0x4d, 0x44, + 0x45, 0x79, 0x4d, 0x7a, 0x55, 0x35, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x49, + 0x47, 0x75, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, + 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x64, 0x47, + 0x68, 0x68, 0x64, 0x33, 0x52, 0x6c, 0x0a, 0x4c, 0x43, 0x42, 0x4a, 0x62, + 0x6d, 0x4d, 0x75, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4c, 0x45, 0x78, 0x39, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, + 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, + 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x49, + 0x45, 0x52, 0x70, 0x64, 0x6d, 0x6c, 0x7a, 0x61, 0x57, 0x39, 0x75, 0x0a, + 0x4d, 0x54, 0x67, 0x77, 0x4e, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, + 0x45, 0x79, 0x38, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x77, + 0x4f, 0x43, 0x42, 0x30, 0x61, 0x47, 0x46, 0x33, 0x64, 0x47, 0x55, 0x73, + 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x67, 0x4c, 0x53, 0x42, 0x47, + 0x62, 0x33, 0x49, 0x67, 0x59, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, + 0x61, 0x58, 0x70, 0x6c, 0x0a, 0x5a, 0x43, 0x42, 0x31, 0x63, 0x32, 0x55, + 0x67, 0x62, 0x32, 0x35, 0x73, 0x65, 0x54, 0x45, 0x6b, 0x4d, 0x43, 0x49, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x62, 0x64, 0x47, 0x68, + 0x68, 0x64, 0x33, 0x52, 0x6c, 0x49, 0x46, 0x42, 0x79, 0x61, 0x57, 0x31, + 0x68, 0x63, 0x6e, 0x6b, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, + 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x7a, 0x0a, 0x4d, 0x49, + 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, + 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, + 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x73, 0x72, 0x38, 0x6e, 0x4c, 0x50, + 0x76, 0x62, 0x32, 0x46, 0x76, 0x64, 0x65, 0x48, 0x73, 0x62, 0x6e, 0x6e, + 0x64, 0x6d, 0x0a, 0x67, 0x63, 0x73, 0x2b, 0x76, 0x48, 0x79, 0x75, 0x38, + 0x36, 0x59, 0x6e, 0x6d, 0x6a, 0x53, 0x6a, 0x61, 0x44, 0x46, 0x78, 0x4f, + 0x44, 0x4e, 0x69, 0x35, 0x50, 0x4e, 0x78, 0x5a, 0x6e, 0x6d, 0x78, 0x71, + 0x57, 0x57, 0x6a, 0x70, 0x59, 0x76, 0x56, 0x6a, 0x32, 0x41, 0x74, 0x50, + 0x30, 0x4c, 0x4d, 0x71, 0x6d, 0x73, 0x79, 0x77, 0x43, 0x50, 0x4c, 0x4c, + 0x45, 0x48, 0x64, 0x35, 0x4e, 0x2f, 0x38, 0x0a, 0x59, 0x5a, 0x7a, 0x69, + 0x63, 0x37, 0x49, 0x69, 0x6c, 0x52, 0x46, 0x44, 0x47, 0x46, 0x2f, 0x45, + 0x74, 0x68, 0x39, 0x58, 0x62, 0x41, 0x6f, 0x46, 0x57, 0x43, 0x4c, 0x49, + 0x4e, 0x6b, 0x77, 0x36, 0x66, 0x4b, 0x58, 0x52, 0x7a, 0x34, 0x61, 0x76, + 0x69, 0x4b, 0x64, 0x45, 0x41, 0x68, 0x4e, 0x30, 0x63, 0x58, 0x4d, 0x4b, + 0x51, 0x6c, 0x6b, 0x43, 0x2b, 0x42, 0x73, 0x55, 0x61, 0x30, 0x4c, 0x66, + 0x0a, 0x62, 0x31, 0x2b, 0x36, 0x61, 0x34, 0x4b, 0x69, 0x6e, 0x56, 0x76, + 0x6e, 0x53, 0x72, 0x30, 0x65, 0x41, 0x58, 0x4c, 0x62, 0x53, 0x33, 0x54, + 0x6f, 0x4f, 0x33, 0x39, 0x2f, 0x66, 0x52, 0x38, 0x45, 0x74, 0x43, 0x61, + 0x62, 0x34, 0x4c, 0x52, 0x61, 0x72, 0x45, 0x63, 0x39, 0x56, 0x62, 0x6a, + 0x58, 0x73, 0x43, 0x5a, 0x53, 0x4b, 0x41, 0x45, 0x78, 0x51, 0x47, 0x62, + 0x59, 0x32, 0x53, 0x53, 0x39, 0x0a, 0x39, 0x69, 0x72, 0x59, 0x37, 0x43, + 0x46, 0x4a, 0x58, 0x4a, 0x76, 0x32, 0x65, 0x75, 0x6c, 0x2f, 0x56, 0x54, + 0x56, 0x2b, 0x6c, 0x6d, 0x75, 0x4e, 0x6b, 0x35, 0x4d, 0x6e, 0x79, 0x35, + 0x4b, 0x37, 0x36, 0x71, 0x78, 0x41, 0x77, 0x4a, 0x2f, 0x43, 0x2b, 0x49, + 0x44, 0x50, 0x58, 0x66, 0x52, 0x61, 0x33, 0x4d, 0x35, 0x30, 0x68, 0x71, + 0x59, 0x2b, 0x62, 0x41, 0x74, 0x54, 0x79, 0x72, 0x32, 0x53, 0x0a, 0x7a, + 0x68, 0x6b, 0x47, 0x63, 0x75, 0x59, 0x4d, 0x58, 0x44, 0x68, 0x70, 0x78, + 0x77, 0x54, 0x57, 0x76, 0x47, 0x7a, 0x4f, 0x57, 0x2f, 0x62, 0x33, 0x61, + 0x4a, 0x7a, 0x63, 0x4a, 0x52, 0x56, 0x49, 0x69, 0x4b, 0x48, 0x70, 0x71, + 0x66, 0x69, 0x59, 0x6e, 0x4f, 0x44, 0x7a, 0x31, 0x54, 0x45, 0x6f, 0x59, + 0x52, 0x46, 0x73, 0x5a, 0x35, 0x61, 0x4e, 0x4f, 0x5a, 0x6e, 0x4c, 0x77, + 0x6b, 0x55, 0x6b, 0x0a, 0x4f, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, + 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, + 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, + 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x51, 0x34, + 0x45, 0x46, 0x67, 0x51, 0x55, 0x72, 0x57, 0x79, 0x71, 0x6c, 0x47, 0x43, + 0x63, 0x37, 0x65, 0x54, 0x2f, 0x2b, 0x6a, 0x34, 0x4b, 0x64, 0x43, 0x74, + 0x6a, 0x41, 0x2f, 0x65, 0x32, 0x57, 0x62, 0x38, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x42, 0x70, + 0x41, 0x0a, 0x32, 0x4a, 0x56, 0x6c, 0x72, 0x41, 0x6d, 0x53, 0x69, 0x63, + 0x59, 0x35, 0x39, 0x42, 0x44, 0x6c, 0x71, 0x51, 0x35, 0x6d, 0x55, 0x31, + 0x31, 0x34, 0x33, 0x76, 0x6f, 0x6b, 0x6b, 0x62, 0x76, 0x6e, 0x52, 0x46, + 0x48, 0x66, 0x78, 0x68, 0x59, 0x30, 0x43, 0x75, 0x39, 0x71, 0x52, 0x46, + 0x48, 0x71, 0x4b, 0x77, 0x65, 0x4b, 0x41, 0x33, 0x72, 0x44, 0x36, 0x7a, + 0x38, 0x4b, 0x4c, 0x46, 0x49, 0x57, 0x0a, 0x6f, 0x43, 0x74, 0x44, 0x75, + 0x53, 0x57, 0x51, 0x50, 0x33, 0x43, 0x70, 0x4d, 0x79, 0x56, 0x74, 0x52, + 0x52, 0x6f, 0x6f, 0x4f, 0x79, 0x66, 0x50, 0x71, 0x73, 0x4d, 0x70, 0x51, + 0x68, 0x76, 0x66, 0x4f, 0x30, 0x7a, 0x41, 0x4d, 0x7a, 0x52, 0x62, 0x51, + 0x59, 0x69, 0x2f, 0x61, 0x79, 0x74, 0x6c, 0x72, 0x79, 0x6a, 0x76, 0x73, + 0x76, 0x58, 0x44, 0x71, 0x6d, 0x62, 0x4f, 0x65, 0x31, 0x62, 0x75, 0x0a, + 0x74, 0x38, 0x6a, 0x4c, 0x5a, 0x38, 0x48, 0x4a, 0x6e, 0x42, 0x6f, 0x59, + 0x75, 0x4d, 0x54, 0x44, 0x53, 0x51, 0x50, 0x78, 0x59, 0x41, 0x35, 0x51, + 0x7a, 0x55, 0x62, 0x46, 0x38, 0x33, 0x64, 0x35, 0x39, 0x37, 0x59, 0x56, + 0x34, 0x44, 0x6a, 0x62, 0x78, 0x79, 0x38, 0x6f, 0x6f, 0x41, 0x77, 0x2f, + 0x64, 0x79, 0x5a, 0x30, 0x32, 0x53, 0x55, 0x53, 0x32, 0x6a, 0x48, 0x61, + 0x47, 0x68, 0x37, 0x63, 0x0a, 0x4b, 0x55, 0x47, 0x52, 0x49, 0x6a, 0x78, + 0x70, 0x70, 0x37, 0x73, 0x43, 0x38, 0x72, 0x5a, 0x63, 0x4a, 0x77, 0x4f, + 0x4a, 0x39, 0x41, 0x62, 0x71, 0x6d, 0x2b, 0x52, 0x79, 0x67, 0x75, 0x4f, + 0x68, 0x43, 0x63, 0x48, 0x70, 0x41, 0x42, 0x6e, 0x54, 0x50, 0x74, 0x52, + 0x77, 0x61, 0x37, 0x70, 0x78, 0x70, 0x71, 0x70, 0x59, 0x72, 0x76, 0x53, + 0x37, 0x36, 0x57, 0x79, 0x32, 0x37, 0x34, 0x66, 0x4d, 0x0a, 0x6d, 0x37, + 0x76, 0x2f, 0x4f, 0x65, 0x5a, 0x57, 0x59, 0x64, 0x4d, 0x4b, 0x70, 0x38, + 0x52, 0x63, 0x54, 0x47, 0x42, 0x37, 0x42, 0x58, 0x63, 0x6d, 0x65, 0x72, + 0x2f, 0x59, 0x42, 0x31, 0x49, 0x73, 0x59, 0x76, 0x64, 0x77, 0x59, 0x39, + 0x6b, 0x35, 0x76, 0x47, 0x38, 0x63, 0x77, 0x6e, 0x6e, 0x63, 0x64, 0x69, + 0x6d, 0x76, 0x7a, 0x73, 0x55, 0x73, 0x5a, 0x41, 0x52, 0x65, 0x69, 0x44, + 0x5a, 0x75, 0x0a, 0x4d, 0x64, 0x52, 0x41, 0x47, 0x6d, 0x49, 0x30, 0x4e, + 0x6a, 0x38, 0x31, 0x41, 0x61, 0x36, 0x73, 0x59, 0x36, 0x41, 0x3d, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, + 0x32, 0x20, 0x4f, 0x3d, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x28, 0x63, 0x29, + 0x20, 0x32, 0x30, 0x30, 0x37, 0x20, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, + 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, + 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x69, + 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, + 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, 0x6e, 0x63, + 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, + 0x37, 0x20, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, + 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x65, 0x6f, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, + 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x38, 0x30, 0x36, 0x38, 0x32, 0x38, 0x36, 0x33, 0x32, 0x30, 0x33, + 0x33, 0x38, 0x31, 0x30, 0x36, 0x35, 0x37, 0x38, 0x32, 0x31, 0x37, 0x37, + 0x39, 0x30, 0x38, 0x37, 0x35, 0x31, 0x37, 0x39, 0x34, 0x36, 0x31, 0x39, + 0x32, 0x34, 0x33, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, + 0x31, 0x3a, 0x35, 0x65, 0x3a, 0x64, 0x38, 0x3a, 0x36, 0x62, 0x3a, 0x62, + 0x64, 0x3a, 0x36, 0x66, 0x3a, 0x33, 0x64, 0x3a, 0x38, 0x65, 0x3a, 0x61, + 0x31, 0x3a, 0x33, 0x31, 0x3a, 0x66, 0x38, 0x3a, 0x31, 0x32, 0x3a, 0x65, + 0x30, 0x3a, 0x39, 0x38, 0x3a, 0x37, 0x33, 0x3a, 0x36, 0x61, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x64, 0x3a, 0x31, 0x37, + 0x3a, 0x38, 0x34, 0x3a, 0x64, 0x35, 0x3a, 0x33, 0x37, 0x3a, 0x66, 0x33, + 0x3a, 0x30, 0x33, 0x3a, 0x37, 0x64, 0x3a, 0x65, 0x63, 0x3a, 0x37, 0x30, + 0x3a, 0x66, 0x65, 0x3a, 0x35, 0x37, 0x3a, 0x38, 0x62, 0x3a, 0x35, 0x31, + 0x3a, 0x39, 0x61, 0x3a, 0x39, 0x39, 0x3a, 0x65, 0x36, 0x3a, 0x31, 0x30, + 0x3a, 0x64, 0x37, 0x3a, 0x62, 0x30, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x65, 0x3a, 0x64, 0x62, 0x3a, 0x37, + 0x61, 0x3a, 0x63, 0x34, 0x3a, 0x33, 0x62, 0x3a, 0x38, 0x32, 0x3a, 0x61, + 0x30, 0x3a, 0x36, 0x61, 0x3a, 0x38, 0x37, 0x3a, 0x36, 0x31, 0x3a, 0x65, + 0x38, 0x3a, 0x64, 0x37, 0x3a, 0x62, 0x65, 0x3a, 0x34, 0x39, 0x3a, 0x37, + 0x39, 0x3a, 0x65, 0x62, 0x3a, 0x66, 0x32, 0x3a, 0x36, 0x31, 0x3a, 0x31, + 0x66, 0x3a, 0x37, 0x64, 0x3a, 0x64, 0x37, 0x3a, 0x39, 0x62, 0x3a, 0x66, + 0x39, 0x3a, 0x31, 0x63, 0x3a, 0x31, 0x63, 0x3a, 0x36, 0x62, 0x3a, 0x35, + 0x36, 0x3a, 0x36, 0x61, 0x3a, 0x32, 0x31, 0x3a, 0x39, 0x65, 0x3a, 0x64, + 0x37, 0x3a, 0x36, 0x36, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x43, 0x72, 0x6a, 0x43, 0x43, 0x41, 0x6a, 0x57, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x51, 0x50, 0x4c, 0x4c, 0x30, 0x53, 0x41, 0x6f, + 0x41, 0x34, 0x76, 0x37, 0x72, 0x4a, 0x44, 0x74, 0x65, 0x59, 0x44, 0x37, + 0x44, 0x61, 0x7a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, + 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x43, 0x42, 0x6d, 0x44, 0x45, + 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, + 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x55, 0x64, 0x6c, 0x62, 0x31, + 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, + 0x34, 0x78, 0x4f, 0x54, 0x41, 0x33, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x73, 0x54, 0x4d, 0x43, 0x68, 0x6a, 0x0a, 0x4b, 0x53, 0x41, 0x79, 0x4d, + 0x44, 0x41, 0x33, 0x49, 0x45, 0x64, 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, + 0x58, 0x4e, 0x30, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x67, 0x4c, + 0x53, 0x42, 0x47, 0x62, 0x33, 0x49, 0x67, 0x59, 0x58, 0x56, 0x30, 0x61, + 0x47, 0x39, 0x79, 0x61, 0x58, 0x70, 0x6c, 0x5a, 0x43, 0x42, 0x31, 0x63, + 0x32, 0x55, 0x67, 0x62, 0x32, 0x35, 0x73, 0x65, 0x54, 0x45, 0x32, 0x0a, + 0x4d, 0x44, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x74, + 0x52, 0x32, 0x56, 0x76, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, + 0x55, 0x48, 0x4a, 0x70, 0x62, 0x57, 0x46, 0x79, 0x65, 0x53, 0x42, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, + 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, + 0x63, 0x6d, 0x6c, 0x30, 0x0a, 0x65, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, + 0x79, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x33, 0x4d, 0x54, 0x45, + 0x77, 0x4e, 0x54, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, + 0x58, 0x44, 0x54, 0x4d, 0x34, 0x4d, 0x44, 0x45, 0x78, 0x4f, 0x44, 0x49, + 0x7a, 0x4e, 0x54, 0x6b, 0x31, 0x4f, 0x56, 0x6f, 0x77, 0x67, 0x5a, 0x67, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, + 0x59, 0x54, 0x41, 0x6c, 0x56, 0x54, 0x4d, 0x52, 0x59, 0x77, 0x46, 0x41, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, 0x48, 0x5a, 0x57, + 0x39, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, + 0x4d, 0x75, 0x4d, 0x54, 0x6b, 0x77, 0x4e, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x7a, 0x41, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, + 0x41, 0x77, 0x0a, 0x4e, 0x79, 0x42, 0x48, 0x5a, 0x57, 0x39, 0x55, 0x63, + 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, + 0x43, 0x30, 0x67, 0x52, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, + 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, + 0x58, 0x4e, 0x6c, 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x4e, + 0x6a, 0x41, 0x30, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x54, + 0x4c, 0x55, 0x64, 0x6c, 0x62, 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x49, 0x46, 0x42, 0x79, 0x61, 0x57, 0x31, 0x68, 0x63, 0x6e, 0x6b, 0x67, + 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, + 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, + 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x67, 0x4c, 0x53, 0x42, 0x48, + 0x0a, 0x4d, 0x6a, 0x42, 0x32, 0x4d, 0x42, 0x41, 0x47, 0x42, 0x79, 0x71, + 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x67, 0x45, 0x47, 0x42, 0x53, 0x75, + 0x42, 0x42, 0x41, 0x41, 0x69, 0x41, 0x32, 0x49, 0x41, 0x42, 0x42, 0x57, + 0x78, 0x36, 0x50, 0x30, 0x44, 0x46, 0x55, 0x50, 0x6c, 0x72, 0x4f, 0x75, + 0x48, 0x4e, 0x78, 0x46, 0x69, 0x37, 0x39, 0x4b, 0x44, 0x4e, 0x6c, 0x4a, + 0x39, 0x52, 0x56, 0x63, 0x4c, 0x0a, 0x53, 0x6f, 0x31, 0x37, 0x56, 0x44, + 0x73, 0x36, 0x62, 0x6c, 0x38, 0x56, 0x41, 0x73, 0x42, 0x51, 0x70, 0x73, + 0x38, 0x6c, 0x4c, 0x33, 0x33, 0x4b, 0x53, 0x4c, 0x6a, 0x48, 0x55, 0x47, + 0x4d, 0x63, 0x4b, 0x69, 0x45, 0x49, 0x66, 0x4a, 0x6f, 0x32, 0x32, 0x41, + 0x76, 0x2b, 0x30, 0x53, 0x62, 0x46, 0x57, 0x44, 0x45, 0x77, 0x4b, 0x43, + 0x58, 0x7a, 0x58, 0x56, 0x32, 0x6a, 0x75, 0x4c, 0x61, 0x6c, 0x0a, 0x74, + 0x4a, 0x4c, 0x74, 0x62, 0x43, 0x79, 0x66, 0x36, 0x39, 0x31, 0x44, 0x69, + 0x61, 0x49, 0x38, 0x53, 0x30, 0x69, 0x52, 0x48, 0x56, 0x44, 0x73, 0x4a, + 0x74, 0x2f, 0x57, 0x59, 0x43, 0x36, 0x39, 0x49, 0x61, 0x4e, 0x43, 0x4d, + 0x45, 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, + 0x7a, 0x41, 0x4f, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, + 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x42, 0x56, 0x66, 0x4e, 0x56, 0x64, 0x52, 0x56, 0x66, 0x73, 0x6c, + 0x73, 0x71, 0x30, 0x44, 0x61, 0x66, 0x77, 0x42, 0x6f, 0x2f, 0x71, 0x2b, + 0x45, 0x56, 0x58, 0x56, 0x4d, 0x41, 0x6f, 0x47, 0x0a, 0x43, 0x43, 0x71, + 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, 0x44, 0x41, 0x32, 0x63, + 0x41, 0x4d, 0x47, 0x51, 0x43, 0x4d, 0x47, 0x53, 0x57, 0x57, 0x61, 0x62, + 0x6f, 0x43, 0x64, 0x36, 0x4c, 0x75, 0x76, 0x70, 0x61, 0x69, 0x49, 0x6a, + 0x77, 0x48, 0x35, 0x48, 0x54, 0x52, 0x71, 0x6a, 0x79, 0x53, 0x6b, 0x77, + 0x43, 0x59, 0x2f, 0x74, 0x73, 0x58, 0x7a, 0x6a, 0x62, 0x4c, 0x6b, 0x47, + 0x54, 0x0a, 0x71, 0x51, 0x37, 0x6d, 0x6e, 0x64, 0x77, 0x78, 0x48, 0x4c, + 0x4b, 0x67, 0x70, 0x78, 0x67, 0x63, 0x65, 0x65, 0x48, 0x48, 0x4e, 0x67, + 0x49, 0x77, 0x4f, 0x6c, 0x61, 0x76, 0x6d, 0x6e, 0x52, 0x73, 0x39, 0x76, + 0x75, 0x44, 0x34, 0x44, 0x50, 0x54, 0x43, 0x46, 0x2b, 0x68, 0x6e, 0x4d, + 0x4a, 0x62, 0x6e, 0x30, 0x62, 0x57, 0x74, 0x73, 0x75, 0x52, 0x42, 0x6d, + 0x4f, 0x69, 0x42, 0x75, 0x63, 0x7a, 0x0a, 0x72, 0x44, 0x36, 0x6f, 0x67, + 0x52, 0x4c, 0x51, 0x79, 0x37, 0x72, 0x51, 0x6b, 0x67, 0x75, 0x32, 0x6e, + 0x70, 0x61, 0x71, 0x42, 0x41, 0x2b, 0x4b, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x55, 0x6e, 0x69, + 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x4f, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, + 0x30, 0x30, 0x38, 0x20, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, + 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, + 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, + 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, + 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x55, 0x6e, 0x69, 0x76, + 0x65, 0x72, 0x73, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, + 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, + 0x30, 0x38, 0x20, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, + 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, + 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x55, 0x6e, 0x69, 0x76, 0x65, 0x72, 0x73, 0x61, 0x6c, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x35, 0x32, 0x30, 0x39, 0x35, 0x37, + 0x34, 0x37, 0x33, 0x34, 0x30, 0x38, 0x34, 0x35, 0x38, 0x31, 0x39, 0x31, + 0x37, 0x37, 0x36, 0x33, 0x37, 0x35, 0x32, 0x36, 0x34, 0x34, 0x30, 0x33, + 0x31, 0x37, 0x32, 0x36, 0x38, 0x37, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x38, 0x65, 0x3a, 0x61, 0x64, 0x3a, 0x62, 0x35, 0x3a, + 0x30, 0x31, 0x3a, 0x61, 0x61, 0x3a, 0x34, 0x64, 0x3a, 0x38, 0x31, 0x3a, + 0x65, 0x34, 0x3a, 0x38, 0x63, 0x3a, 0x31, 0x64, 0x3a, 0x64, 0x31, 0x3a, + 0x65, 0x31, 0x3a, 0x31, 0x34, 0x3a, 0x30, 0x30, 0x3a, 0x39, 0x35, 0x3a, + 0x31, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, + 0x36, 0x3a, 0x37, 0x39, 0x3a, 0x63, 0x61, 0x3a, 0x33, 0x35, 0x3a, 0x36, + 0x36, 0x3a, 0x38, 0x37, 0x3a, 0x37, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x34, + 0x64, 0x3a, 0x33, 0x30, 0x3a, 0x61, 0x35, 0x3a, 0x66, 0x62, 0x3a, 0x38, + 0x37, 0x3a, 0x33, 0x62, 0x3a, 0x30, 0x66, 0x3a, 0x61, 0x37, 0x3a, 0x37, + 0x62, 0x3a, 0x62, 0x37, 0x3a, 0x30, 0x64, 0x3a, 0x35, 0x34, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x33, 0x3a, + 0x39, 0x39, 0x3a, 0x35, 0x36, 0x3a, 0x31, 0x31, 0x3a, 0x32, 0x37, 0x3a, + 0x61, 0x35, 0x3a, 0x37, 0x31, 0x3a, 0x32, 0x35, 0x3a, 0x64, 0x65, 0x3a, + 0x38, 0x63, 0x3a, 0x65, 0x66, 0x3a, 0x65, 0x61, 0x3a, 0x36, 0x31, 0x3a, + 0x30, 0x64, 0x3a, 0x64, 0x66, 0x3a, 0x32, 0x66, 0x3a, 0x61, 0x30, 0x3a, + 0x37, 0x38, 0x3a, 0x62, 0x35, 0x3a, 0x63, 0x38, 0x3a, 0x30, 0x36, 0x3a, + 0x37, 0x66, 0x3a, 0x34, 0x65, 0x3a, 0x38, 0x32, 0x3a, 0x38, 0x32, 0x3a, + 0x39, 0x30, 0x3a, 0x62, 0x66, 0x3a, 0x62, 0x38, 0x3a, 0x36, 0x30, 0x3a, + 0x65, 0x38, 0x3a, 0x34, 0x62, 0x3a, 0x33, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x75, 0x54, 0x43, 0x43, 0x41, 0x36, 0x47, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x51, 0x42, 0x72, + 0x45, 0x5a, 0x43, 0x47, 0x7a, 0x45, 0x79, 0x45, 0x44, 0x44, 0x72, 0x76, + 0x6b, 0x45, 0x68, 0x72, 0x46, 0x48, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, + 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x76, 0x54, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x46, 0x7a, 0x41, 0x56, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x54, 0x44, 0x6c, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, + 0x64, 0x75, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x52, + 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x0a, 0x45, + 0x78, 0x5a, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, + 0x69, 0x42, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x4f, 0x5a, + 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, 0x4d, 0x54, 0x6f, 0x77, 0x4f, + 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x7a, 0x45, 0x6f, 0x59, + 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4f, 0x43, 0x42, 0x57, 0x5a, + 0x58, 0x4a, 0x70, 0x0a, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x77, 0x67, + 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x69, 0x41, 0x74, 0x49, 0x45, 0x5a, 0x76, + 0x63, 0x69, 0x42, 0x68, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x65, 0x6d, 0x56, 0x6b, 0x49, 0x48, 0x56, 0x7a, 0x5a, 0x53, 0x42, 0x76, + 0x62, 0x6d, 0x78, 0x35, 0x4d, 0x54, 0x67, 0x77, 0x4e, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x39, 0x57, 0x0a, 0x5a, 0x58, 0x4a, + 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x56, 0x62, 0x6d, 0x6c, + 0x32, 0x5a, 0x58, 0x4a, 0x7a, 0x59, 0x57, 0x77, 0x67, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, + 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x41, + 0x65, 0x0a, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x44, 0x41, 0x30, 0x4d, 0x44, + 0x49, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, + 0x30, 0x7a, 0x4e, 0x7a, 0x45, 0x79, 0x4d, 0x44, 0x45, 0x79, 0x4d, 0x7a, + 0x55, 0x35, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x49, 0x47, 0x39, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x58, 0x0a, 0x4d, 0x42, 0x55, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4f, 0x56, 0x6d, 0x56, 0x79, 0x61, + 0x56, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, + 0x79, 0x34, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x73, 0x54, 0x46, 0x6c, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, + 0x57, 0x64, 0x75, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x0a, + 0x49, 0x45, 0x35, 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, 0x78, + 0x4f, 0x6a, 0x41, 0x34, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, + 0x4d, 0x53, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x79, 0x4d, 0x44, 0x41, 0x34, + 0x49, 0x46, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, + 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, + 0x52, 0x6d, 0x39, 0x79, 0x0a, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, + 0x76, 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, + 0x6c, 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x4f, 0x44, 0x41, + 0x32, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4c, 0x31, 0x5a, + 0x6c, 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x56, + 0x75, 0x61, 0x58, 0x5a, 0x6c, 0x63, 0x6e, 0x4e, 0x68, 0x0a, 0x62, 0x43, + 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, + 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, + 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, + 0x52, 0x35, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x45, 0x46, 0x0a, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, + 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x78, + 0x32, 0x45, 0x33, 0x58, 0x72, 0x45, 0x42, 0x4e, 0x4e, 0x74, 0x69, 0x31, + 0x78, 0x57, 0x62, 0x2f, 0x31, 0x68, 0x61, 0x6a, 0x43, 0x4d, 0x6a, 0x31, + 0x6d, 0x43, 0x4f, 0x6b, 0x64, 0x65, 0x51, 0x6d, 0x49, 0x4e, 0x36, 0x35, + 0x6c, 0x67, 0x5a, 0x4f, 0x49, 0x7a, 0x46, 0x0a, 0x39, 0x75, 0x56, 0x6b, + 0x68, 0x62, 0x53, 0x69, 0x63, 0x66, 0x76, 0x74, 0x76, 0x62, 0x6e, 0x61, + 0x7a, 0x55, 0x30, 0x41, 0x74, 0x4d, 0x67, 0x74, 0x63, 0x36, 0x58, 0x48, + 0x61, 0x58, 0x47, 0x56, 0x48, 0x7a, 0x6b, 0x38, 0x73, 0x6b, 0x51, 0x48, + 0x6e, 0x4f, 0x67, 0x4f, 0x2b, 0x6b, 0x31, 0x4b, 0x78, 0x43, 0x48, 0x66, + 0x4b, 0x57, 0x47, 0x50, 0x4d, 0x69, 0x4a, 0x68, 0x67, 0x73, 0x57, 0x48, + 0x0a, 0x48, 0x32, 0x36, 0x4d, 0x66, 0x46, 0x38, 0x57, 0x49, 0x46, 0x46, + 0x45, 0x30, 0x58, 0x42, 0x50, 0x56, 0x2b, 0x72, 0x6a, 0x48, 0x4f, 0x50, + 0x4d, 0x65, 0x65, 0x35, 0x59, 0x32, 0x41, 0x37, 0x43, 0x73, 0x30, 0x57, + 0x54, 0x77, 0x43, 0x7a, 0x6e, 0x6d, 0x68, 0x63, 0x72, 0x65, 0x77, 0x41, + 0x33, 0x65, 0x6b, 0x45, 0x7a, 0x65, 0x4f, 0x45, 0x7a, 0x34, 0x76, 0x4d, + 0x51, 0x47, 0x6e, 0x2b, 0x48, 0x0a, 0x4c, 0x4c, 0x37, 0x32, 0x39, 0x66, + 0x64, 0x43, 0x34, 0x75, 0x57, 0x2f, 0x68, 0x32, 0x4b, 0x4a, 0x58, 0x77, + 0x42, 0x4c, 0x33, 0x38, 0x58, 0x64, 0x35, 0x48, 0x56, 0x45, 0x4d, 0x6b, + 0x45, 0x36, 0x48, 0x6e, 0x46, 0x75, 0x61, 0x63, 0x73, 0x4c, 0x64, 0x55, + 0x59, 0x49, 0x30, 0x63, 0x72, 0x53, 0x4b, 0x35, 0x58, 0x51, 0x7a, 0x2f, + 0x75, 0x35, 0x51, 0x47, 0x74, 0x6b, 0x6a, 0x46, 0x64, 0x4e, 0x0a, 0x2f, + 0x42, 0x4d, 0x52, 0x65, 0x59, 0x54, 0x74, 0x58, 0x6c, 0x54, 0x32, 0x4e, + 0x4a, 0x38, 0x49, 0x41, 0x66, 0x4d, 0x51, 0x4a, 0x51, 0x59, 0x58, 0x53, + 0x74, 0x72, 0x78, 0x48, 0x58, 0x70, 0x6d, 0x61, 0x35, 0x68, 0x67, 0x5a, + 0x71, 0x54, 0x5a, 0x37, 0x39, 0x49, 0x75, 0x67, 0x76, 0x48, 0x77, 0x37, + 0x77, 0x6e, 0x71, 0x52, 0x4d, 0x6b, 0x56, 0x61, 0x75, 0x49, 0x44, 0x62, + 0x6a, 0x50, 0x54, 0x0a, 0x72, 0x4a, 0x39, 0x56, 0x41, 0x4d, 0x66, 0x32, + 0x43, 0x47, 0x71, 0x55, 0x75, 0x56, 0x2f, 0x63, 0x34, 0x44, 0x50, 0x78, + 0x68, 0x47, 0x44, 0x35, 0x57, 0x79, 0x63, 0x52, 0x74, 0x50, 0x77, 0x57, + 0x38, 0x72, 0x74, 0x57, 0x61, 0x6f, 0x41, 0x6c, 0x6a, 0x51, 0x49, 0x44, + 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x47, 0x79, 0x4d, 0x49, 0x47, 0x76, + 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x0a, 0x45, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x47, 0x30, + 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x45, + 0x4d, 0x42, 0x47, 0x45, 0x77, 0x58, 0x36, 0x46, 0x64, 0x6f, 0x46, 0x73, + 0x77, 0x0a, 0x57, 0x54, 0x42, 0x58, 0x4d, 0x46, 0x55, 0x57, 0x43, 0x57, + 0x6c, 0x74, 0x59, 0x57, 0x64, 0x6c, 0x4c, 0x32, 0x64, 0x70, 0x5a, 0x6a, + 0x41, 0x68, 0x4d, 0x42, 0x38, 0x77, 0x42, 0x77, 0x59, 0x46, 0x4b, 0x77, + 0x34, 0x44, 0x41, 0x68, 0x6f, 0x45, 0x46, 0x49, 0x2f, 0x6c, 0x30, 0x78, + 0x71, 0x47, 0x72, 0x49, 0x32, 0x4f, 0x61, 0x38, 0x50, 0x50, 0x67, 0x47, + 0x72, 0x55, 0x53, 0x42, 0x67, 0x73, 0x0a, 0x65, 0x78, 0x6b, 0x75, 0x4d, + 0x43, 0x55, 0x57, 0x49, 0x32, 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, 0x4c, + 0x79, 0x39, 0x73, 0x62, 0x32, 0x64, 0x76, 0x4c, 0x6e, 0x5a, 0x6c, 0x63, + 0x6d, 0x6c, 0x7a, 0x61, 0x57, 0x64, 0x75, 0x4c, 0x6d, 0x4e, 0x76, 0x62, + 0x53, 0x39, 0x32, 0x63, 0x32, 0x78, 0x76, 0x5a, 0x32, 0x38, 0x75, 0x5a, + 0x32, 0x6c, 0x6d, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x0a, + 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, 0x32, 0x64, 0x2f, 0x70, 0x70, + 0x53, 0x45, 0x65, 0x66, 0x55, 0x78, 0x4c, 0x56, 0x77, 0x75, 0x6f, 0x48, + 0x4d, 0x6e, 0x59, 0x48, 0x30, 0x5a, 0x63, 0x48, 0x47, 0x54, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, + 0x53, 0x76, 0x6a, 0x34, 0x0a, 0x73, 0x41, 0x50, 0x6d, 0x4c, 0x47, 0x64, + 0x37, 0x35, 0x4a, 0x52, 0x33, 0x59, 0x38, 0x78, 0x75, 0x54, 0x50, 0x6c, + 0x39, 0x44, 0x67, 0x33, 0x63, 0x79, 0x4c, 0x6b, 0x31, 0x75, 0x58, 0x42, + 0x50, 0x59, 0x2f, 0x6f, 0x6b, 0x2b, 0x6d, 0x79, 0x44, 0x6a, 0x45, 0x65, + 0x64, 0x4f, 0x32, 0x50, 0x7a, 0x6d, 0x76, 0x6c, 0x32, 0x4d, 0x70, 0x57, + 0x52, 0x73, 0x58, 0x65, 0x38, 0x72, 0x4a, 0x71, 0x2b, 0x0a, 0x73, 0x65, + 0x51, 0x78, 0x49, 0x63, 0x61, 0x42, 0x6c, 0x56, 0x5a, 0x61, 0x44, 0x72, + 0x48, 0x43, 0x31, 0x4c, 0x47, 0x6d, 0x57, 0x61, 0x7a, 0x78, 0x59, 0x38, + 0x75, 0x34, 0x54, 0x42, 0x31, 0x5a, 0x6b, 0x45, 0x72, 0x76, 0x6b, 0x42, + 0x59, 0x6f, 0x48, 0x31, 0x71, 0x75, 0x45, 0x50, 0x75, 0x42, 0x55, 0x44, + 0x67, 0x4d, 0x62, 0x4d, 0x7a, 0x78, 0x50, 0x63, 0x50, 0x31, 0x59, 0x2b, + 0x4f, 0x7a, 0x0a, 0x34, 0x79, 0x48, 0x4a, 0x4a, 0x44, 0x6e, 0x70, 0x2f, + 0x52, 0x56, 0x6d, 0x52, 0x76, 0x51, 0x62, 0x45, 0x64, 0x42, 0x4e, 0x63, + 0x36, 0x4e, 0x39, 0x52, 0x76, 0x6b, 0x39, 0x37, 0x61, 0x68, 0x66, 0x59, + 0x74, 0x54, 0x78, 0x50, 0x2f, 0x6a, 0x67, 0x64, 0x46, 0x63, 0x72, 0x47, + 0x4a, 0x32, 0x42, 0x74, 0x4d, 0x51, 0x6f, 0x32, 0x70, 0x53, 0x58, 0x70, + 0x58, 0x44, 0x72, 0x72, 0x42, 0x32, 0x2b, 0x0a, 0x42, 0x78, 0x48, 0x77, + 0x31, 0x64, 0x76, 0x64, 0x35, 0x59, 0x7a, 0x77, 0x31, 0x54, 0x4b, 0x77, + 0x67, 0x2b, 0x5a, 0x58, 0x34, 0x6f, 0x2b, 0x2f, 0x76, 0x71, 0x47, 0x71, + 0x76, 0x7a, 0x30, 0x64, 0x74, 0x64, 0x51, 0x34, 0x36, 0x74, 0x65, 0x77, + 0x58, 0x44, 0x70, 0x50, 0x61, 0x6a, 0x2b, 0x50, 0x77, 0x47, 0x5a, 0x73, + 0x59, 0x36, 0x72, 0x70, 0x32, 0x61, 0x51, 0x57, 0x39, 0x49, 0x48, 0x52, + 0x0a, 0x6c, 0x52, 0x51, 0x4f, 0x66, 0x63, 0x32, 0x56, 0x4e, 0x4e, 0x6e, + 0x53, 0x6a, 0x33, 0x42, 0x7a, 0x67, 0x58, 0x75, 0x63, 0x66, 0x72, 0x32, + 0x59, 0x59, 0x64, 0x68, 0x46, 0x68, 0x35, 0x69, 0x51, 0x78, 0x65, 0x75, + 0x47, 0x4d, 0x4d, 0x59, 0x31, 0x76, 0x2f, 0x44, 0x2f, 0x77, 0x31, 0x57, + 0x49, 0x67, 0x30, 0x76, 0x76, 0x42, 0x5a, 0x49, 0x47, 0x63, 0x66, 0x4b, + 0x34, 0x6d, 0x4a, 0x4f, 0x33, 0x0a, 0x37, 0x4d, 0x32, 0x43, 0x59, 0x66, + 0x45, 0x34, 0x35, 0x6b, 0x2b, 0x58, 0x6d, 0x43, 0x70, 0x61, 0x6a, 0x51, + 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x34, 0x20, 0x4f, 0x3d, 0x56, 0x65, + 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x37, 0x20, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, + 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, + 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, + 0x72, 0x79, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x34, 0x20, 0x4f, 0x3d, 0x56, 0x65, + 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x37, 0x20, + 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x46, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, + 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x56, 0x65, 0x72, 0x69, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x50, 0x75, 0x62, 0x6c, + 0x69, 0x63, 0x20, 0x50, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, + 0x20, 0x47, 0x34, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x36, 0x33, 0x31, 0x34, 0x33, 0x34, 0x38, 0x34, 0x33, + 0x34, 0x38, 0x31, 0x35, 0x33, 0x35, 0x30, 0x36, 0x36, 0x36, 0x35, 0x33, + 0x31, 0x31, 0x39, 0x38, 0x35, 0x35, 0x30, 0x31, 0x34, 0x35, 0x38, 0x36, + 0x34, 0x30, 0x30, 0x35, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x33, 0x61, 0x3a, 0x35, 0x32, 0x3a, 0x65, 0x31, 0x3a, 0x65, 0x37, + 0x3a, 0x66, 0x64, 0x3a, 0x36, 0x66, 0x3a, 0x33, 0x61, 0x3a, 0x65, 0x33, + 0x3a, 0x36, 0x66, 0x3a, 0x66, 0x33, 0x3a, 0x36, 0x66, 0x3a, 0x39, 0x39, + 0x3a, 0x31, 0x62, 0x3a, 0x66, 0x39, 0x3a, 0x32, 0x32, 0x3a, 0x34, 0x31, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x32, 0x3a, + 0x64, 0x35, 0x3a, 0x64, 0x38, 0x3a, 0x64, 0x66, 0x3a, 0x38, 0x66, 0x3a, + 0x30, 0x32, 0x3a, 0x33, 0x31, 0x3a, 0x64, 0x31, 0x3a, 0x38, 0x64, 0x3a, + 0x66, 0x37, 0x3a, 0x39, 0x64, 0x3a, 0x62, 0x37, 0x3a, 0x63, 0x66, 0x3a, + 0x38, 0x61, 0x3a, 0x32, 0x64, 0x3a, 0x36, 0x34, 0x3a, 0x63, 0x39, 0x3a, + 0x33, 0x66, 0x3a, 0x36, 0x63, 0x3a, 0x33, 0x61, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x39, 0x3a, 0x64, 0x64, + 0x3a, 0x64, 0x37, 0x3a, 0x65, 0x61, 0x3a, 0x39, 0x30, 0x3a, 0x62, 0x62, + 0x3a, 0x35, 0x37, 0x3a, 0x63, 0x39, 0x3a, 0x33, 0x65, 0x3a, 0x31, 0x33, + 0x3a, 0x35, 0x64, 0x3a, 0x63, 0x38, 0x3a, 0x35, 0x65, 0x3a, 0x61, 0x36, + 0x3a, 0x66, 0x63, 0x3a, 0x64, 0x35, 0x3a, 0x34, 0x38, 0x3a, 0x30, 0x62, + 0x3a, 0x36, 0x30, 0x3a, 0x33, 0x32, 0x3a, 0x33, 0x39, 0x3a, 0x62, 0x64, + 0x3a, 0x63, 0x34, 0x3a, 0x35, 0x34, 0x3a, 0x66, 0x63, 0x3a, 0x37, 0x35, + 0x3a, 0x38, 0x62, 0x3a, 0x32, 0x61, 0x3a, 0x32, 0x36, 0x3a, 0x63, 0x66, + 0x3a, 0x37, 0x66, 0x3a, 0x37, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x44, 0x68, 0x44, 0x43, 0x43, 0x41, 0x77, 0x71, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x4c, 0x34, 0x44, 0x2b, 0x49, + 0x34, 0x77, 0x4f, 0x49, 0x67, 0x39, 0x49, 0x5a, 0x78, 0x49, 0x6f, 0x6b, + 0x59, 0x65, 0x73, 0x73, 0x7a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, + 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x43, 0x42, 0x79, + 0x6a, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x7a, 0x41, 0x56, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x6c, 0x5a, 0x6c, + 0x63, 0x6d, 0x6c, 0x54, 0x61, 0x57, 0x64, 0x75, 0x4c, 0x43, 0x42, 0x4a, + 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x5a, 0x57, 0x0a, 0x5a, 0x58, 0x4a, + 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x55, 0x63, 0x6e, 0x56, + 0x7a, 0x64, 0x43, 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, + 0x72, 0x4d, 0x54, 0x6f, 0x77, 0x4f, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x7a, 0x45, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, + 0x77, 0x4e, 0x79, 0x42, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x55, 0x32, 0x6c, + 0x6e, 0x0a, 0x62, 0x69, 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x69, + 0x41, 0x74, 0x49, 0x45, 0x5a, 0x76, 0x63, 0x69, 0x42, 0x68, 0x64, 0x58, + 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x65, 0x6d, 0x56, 0x6b, 0x49, 0x48, + 0x56, 0x7a, 0x5a, 0x53, 0x42, 0x76, 0x62, 0x6d, 0x78, 0x35, 0x4d, 0x55, + 0x55, 0x77, 0x51, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x7a, + 0x78, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x0a, 0x55, 0x32, 0x6c, 0x6e, 0x62, + 0x69, 0x42, 0x44, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x41, 0x7a, 0x49, + 0x46, 0x42, 0x31, 0x59, 0x6d, 0x78, 0x70, 0x59, 0x79, 0x42, 0x51, 0x63, + 0x6d, 0x6c, 0x74, 0x59, 0x58, 0x4a, 0x35, 0x49, 0x45, 0x4e, 0x6c, 0x63, + 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, + 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x0a, + 0x61, 0x58, 0x52, 0x35, 0x49, 0x43, 0x30, 0x67, 0x52, 0x7a, 0x51, 0x77, + 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x63, 0x78, 0x4d, 0x54, 0x41, 0x31, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, + 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x54, 0x45, 0x34, 0x4d, 0x6a, 0x4d, 0x31, + 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x79, 0x6a, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x7a, 0x41, 0x56, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x6c, 0x5a, 0x6c, 0x63, 0x6d, 0x6c, + 0x54, 0x61, 0x57, 0x64, 0x75, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, + 0x75, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x78, 0x5a, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x0a, 0x55, 0x32, + 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, + 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, 0x4d, 0x54, + 0x6f, 0x77, 0x4f, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x7a, + 0x45, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4e, 0x79, + 0x42, 0x57, 0x5a, 0x58, 0x4a, 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, + 0x77, 0x67, 0x0a, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x69, 0x41, 0x74, 0x49, + 0x45, 0x5a, 0x76, 0x63, 0x69, 0x42, 0x68, 0x64, 0x58, 0x52, 0x6f, 0x62, + 0x33, 0x4a, 0x70, 0x65, 0x6d, 0x56, 0x6b, 0x49, 0x48, 0x56, 0x7a, 0x5a, + 0x53, 0x42, 0x76, 0x62, 0x6d, 0x78, 0x35, 0x4d, 0x55, 0x55, 0x77, 0x51, + 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x7a, 0x78, 0x57, 0x5a, + 0x58, 0x4a, 0x70, 0x55, 0x32, 0x6c, 0x6e, 0x0a, 0x62, 0x69, 0x42, 0x44, + 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x41, 0x7a, 0x49, 0x46, 0x42, 0x31, + 0x59, 0x6d, 0x78, 0x70, 0x59, 0x79, 0x42, 0x51, 0x63, 0x6d, 0x6c, 0x74, + 0x59, 0x58, 0x4a, 0x35, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, + 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, + 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, + 0x0a, 0x49, 0x43, 0x30, 0x67, 0x52, 0x7a, 0x51, 0x77, 0x64, 0x6a, 0x41, + 0x51, 0x42, 0x67, 0x63, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x49, + 0x42, 0x42, 0x67, 0x55, 0x72, 0x67, 0x51, 0x51, 0x41, 0x49, 0x67, 0x4e, + 0x69, 0x41, 0x41, 0x53, 0x6e, 0x56, 0x6e, 0x70, 0x38, 0x55, 0x74, 0x70, + 0x6b, 0x6d, 0x77, 0x34, 0x74, 0x58, 0x4e, 0x68, 0x65, 0x72, 0x4a, 0x49, + 0x39, 0x2f, 0x67, 0x48, 0x6d, 0x0a, 0x47, 0x55, 0x6f, 0x39, 0x46, 0x41, + 0x4e, 0x4c, 0x2b, 0x6d, 0x41, 0x6e, 0x49, 0x4e, 0x6d, 0x44, 0x69, 0x57, + 0x6e, 0x36, 0x56, 0x4d, 0x61, 0x61, 0x47, 0x46, 0x35, 0x56, 0x4b, 0x6d, + 0x54, 0x65, 0x42, 0x76, 0x61, 0x4e, 0x53, 0x6a, 0x75, 0x74, 0x45, 0x44, + 0x78, 0x6c, 0x50, 0x5a, 0x43, 0x49, 0x42, 0x49, 0x6e, 0x67, 0x4d, 0x47, + 0x47, 0x7a, 0x72, 0x6c, 0x30, 0x42, 0x70, 0x33, 0x76, 0x65, 0x0a, 0x66, + 0x4c, 0x4b, 0x2b, 0x79, 0x6d, 0x56, 0x68, 0x41, 0x49, 0x61, 0x75, 0x32, + 0x6f, 0x39, 0x37, 0x30, 0x49, 0x6d, 0x74, 0x54, 0x52, 0x31, 0x5a, 0x6d, + 0x6b, 0x47, 0x78, 0x76, 0x45, 0x65, 0x41, 0x33, 0x4a, 0x35, 0x69, 0x77, + 0x2f, 0x6d, 0x6a, 0x67, 0x62, 0x49, 0x77, 0x67, 0x61, 0x38, 0x77, 0x44, + 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, + 0x41, 0x55, 0x77, 0x0a, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, + 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x62, 0x51, 0x59, 0x49, + 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, 0x51, 0x77, 0x45, + 0x59, 0x54, 0x42, 0x66, 0x6f, 0x56, 0x32, 0x67, 0x57, 0x7a, 0x42, 0x5a, + 0x4d, 0x46, 0x63, 0x77, 0x56, 0x52, 0x59, 0x4a, 0x0a, 0x61, 0x57, 0x31, + 0x68, 0x5a, 0x32, 0x55, 0x76, 0x5a, 0x32, 0x6c, 0x6d, 0x4d, 0x43, 0x45, + 0x77, 0x48, 0x7a, 0x41, 0x48, 0x42, 0x67, 0x55, 0x72, 0x44, 0x67, 0x4d, + 0x43, 0x47, 0x67, 0x51, 0x55, 0x6a, 0x2b, 0x58, 0x54, 0x47, 0x6f, 0x61, + 0x73, 0x6a, 0x59, 0x35, 0x72, 0x77, 0x38, 0x2b, 0x41, 0x61, 0x74, 0x52, + 0x49, 0x47, 0x43, 0x78, 0x37, 0x47, 0x53, 0x34, 0x77, 0x4a, 0x52, 0x59, + 0x6a, 0x0a, 0x61, 0x48, 0x52, 0x30, 0x63, 0x44, 0x6f, 0x76, 0x4c, 0x32, + 0x78, 0x76, 0x5a, 0x32, 0x38, 0x75, 0x64, 0x6d, 0x56, 0x79, 0x61, 0x58, + 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4c, 0x33, + 0x5a, 0x7a, 0x62, 0x47, 0x39, 0x6e, 0x62, 0x79, 0x35, 0x6e, 0x61, 0x57, + 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, + 0x59, 0x45, 0x46, 0x4c, 0x4d, 0x57, 0x0a, 0x6b, 0x66, 0x33, 0x75, 0x70, + 0x6d, 0x37, 0x6b, 0x74, 0x53, 0x35, 0x4a, 0x6a, 0x34, 0x64, 0x34, 0x67, + 0x59, 0x44, 0x73, 0x35, 0x62, 0x47, 0x31, 0x4d, 0x41, 0x6f, 0x47, 0x43, + 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, 0x44, 0x41, + 0x32, 0x67, 0x41, 0x4d, 0x47, 0x55, 0x43, 0x4d, 0x47, 0x59, 0x68, 0x44, + 0x42, 0x67, 0x6d, 0x59, 0x46, 0x6f, 0x34, 0x65, 0x31, 0x5a, 0x43, 0x0a, + 0x34, 0x4b, 0x66, 0x38, 0x4e, 0x6f, 0x52, 0x52, 0x6b, 0x53, 0x41, 0x73, + 0x64, 0x6b, 0x31, 0x44, 0x50, 0x63, 0x51, 0x64, 0x68, 0x43, 0x50, 0x51, + 0x72, 0x4e, 0x5a, 0x38, 0x4e, 0x51, 0x62, 0x4f, 0x7a, 0x57, 0x6d, 0x39, + 0x6b, 0x41, 0x33, 0x62, 0x62, 0x45, 0x68, 0x43, 0x48, 0x51, 0x36, 0x71, + 0x51, 0x67, 0x49, 0x78, 0x41, 0x4a, 0x77, 0x39, 0x53, 0x44, 0x6b, 0x6a, + 0x4f, 0x56, 0x67, 0x61, 0x0a, 0x46, 0x52, 0x4a, 0x5a, 0x61, 0x70, 0x37, + 0x76, 0x31, 0x56, 0x6d, 0x79, 0x48, 0x56, 0x49, 0x73, 0x6d, 0x58, 0x48, + 0x4e, 0x78, 0x79, 0x6e, 0x66, 0x47, 0x79, 0x70, 0x68, 0x65, 0x33, 0x48, + 0x52, 0x33, 0x76, 0x50, 0x41, 0x35, 0x51, 0x30, 0x36, 0x53, 0x71, 0x6f, + 0x74, 0x70, 0x39, 0x69, 0x47, 0x4b, 0x74, 0x30, 0x75, 0x45, 0x41, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4e, 0x65, 0x74, 0x4c, 0x6f, 0x63, + 0x6b, 0x20, 0x41, 0x72, 0x61, 0x6e, 0x79, 0x20, 0x28, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x20, 0x47, 0x6f, 0x6c, 0x64, 0x29, 0x20, 0x46, 0xc5, 0x91, + 0x74, 0x61, 0x6e, 0xc3, 0xba, 0x73, 0xc3, 0xad, 0x74, 0x76, 0xc3, 0xa1, + 0x6e, 0x79, 0x20, 0x4f, 0x3d, 0x4e, 0x65, 0x74, 0x4c, 0x6f, 0x63, 0x6b, + 0x20, 0x4b, 0x66, 0x74, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x61, 0x6e, + 0xc3, 0xba, 0x73, 0xc3, 0xad, 0x74, 0x76, 0xc3, 0xa1, 0x6e, 0x79, 0x6b, + 0x69, 0x61, 0x64, 0xc3, 0xb3, 0x6b, 0x20, 0x28, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x29, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4e, 0x65, + 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x41, 0x72, 0x61, 0x6e, 0x79, 0x20, + 0x28, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x47, 0x6f, 0x6c, 0x64, 0x29, + 0x20, 0x46, 0xc5, 0x91, 0x74, 0x61, 0x6e, 0xc3, 0xba, 0x73, 0xc3, 0xad, + 0x74, 0x76, 0xc3, 0xa1, 0x6e, 0x79, 0x20, 0x4f, 0x3d, 0x4e, 0x65, 0x74, + 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x4b, 0x66, 0x74, 0x2e, 0x20, 0x4f, 0x55, + 0x3d, 0x54, 0x61, 0x6e, 0xc3, 0xba, 0x73, 0xc3, 0xad, 0x74, 0x76, 0xc3, + 0xa1, 0x6e, 0x79, 0x6b, 0x69, 0x61, 0x64, 0xc3, 0xb3, 0x6b, 0x20, 0x28, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x29, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x4e, 0x65, + 0x74, 0x4c, 0x6f, 0x63, 0x6b, 0x20, 0x41, 0x72, 0x61, 0x6e, 0x79, 0x20, + 0x28, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x47, 0x6f, 0x6c, 0x64, 0x29, + 0x20, 0x46, 0xc5, 0x91, 0x74, 0x61, 0x6e, 0xc3, 0xba, 0x73, 0xc3, 0xad, + 0x74, 0x76, 0xc3, 0xa1, 0x6e, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x30, 0x35, 0x34, 0x34, 0x32, + 0x37, 0x34, 0x38, 0x34, 0x31, 0x36, 0x31, 0x36, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x35, 0x3a, 0x61, 0x31, 0x3a, 0x62, 0x37, + 0x3a, 0x66, 0x66, 0x3a, 0x37, 0x33, 0x3a, 0x64, 0x64, 0x3a, 0x64, 0x36, + 0x3a, 0x64, 0x37, 0x3a, 0x33, 0x34, 0x3a, 0x33, 0x32, 0x3a, 0x31, 0x38, + 0x3a, 0x64, 0x66, 0x3a, 0x66, 0x63, 0x3a, 0x33, 0x63, 0x3a, 0x61, 0x64, + 0x3a, 0x38, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x30, 0x36, 0x3a, 0x30, 0x38, 0x3a, 0x33, 0x66, 0x3a, 0x35, 0x39, 0x3a, + 0x33, 0x66, 0x3a, 0x31, 0x35, 0x3a, 0x61, 0x31, 0x3a, 0x30, 0x34, 0x3a, + 0x61, 0x30, 0x3a, 0x36, 0x39, 0x3a, 0x61, 0x34, 0x3a, 0x36, 0x62, 0x3a, + 0x61, 0x39, 0x3a, 0x30, 0x33, 0x3a, 0x64, 0x30, 0x3a, 0x30, 0x36, 0x3a, + 0x62, 0x37, 0x3a, 0x39, 0x37, 0x3a, 0x30, 0x39, 0x3a, 0x39, 0x31, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x63, + 0x3a, 0x36, 0x31, 0x3a, 0x64, 0x61, 0x3a, 0x63, 0x33, 0x3a, 0x61, 0x32, + 0x3a, 0x64, 0x65, 0x3a, 0x66, 0x30, 0x3a, 0x33, 0x31, 0x3a, 0x35, 0x30, + 0x3a, 0x36, 0x62, 0x3a, 0x65, 0x30, 0x3a, 0x33, 0x36, 0x3a, 0x64, 0x32, + 0x3a, 0x61, 0x36, 0x3a, 0x66, 0x65, 0x3a, 0x34, 0x30, 0x3a, 0x31, 0x39, + 0x3a, 0x39, 0x34, 0x3a, 0x66, 0x62, 0x3a, 0x64, 0x31, 0x3a, 0x33, 0x64, + 0x3a, 0x66, 0x39, 0x3a, 0x63, 0x38, 0x3a, 0x64, 0x34, 0x3a, 0x36, 0x36, + 0x3a, 0x35, 0x39, 0x3a, 0x39, 0x32, 0x3a, 0x37, 0x34, 0x3a, 0x63, 0x34, + 0x3a, 0x34, 0x36, 0x3a, 0x65, 0x63, 0x3a, 0x39, 0x38, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x46, 0x54, 0x43, 0x43, 0x41, 0x76, + 0x32, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x47, 0x53, 0x55, + 0x45, 0x73, 0x35, 0x41, 0x41, 0x51, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, + 0x55, 0x41, 0x4d, 0x49, 0x47, 0x6e, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x49, 0x56, + 0x54, 0x45, 0x52, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x77, 0x77, 0x49, 0x51, 0x6e, 0x56, 0x6b, 0x59, 0x58, 0x42, 0x6c, 0x63, + 0x33, 0x51, 0x78, 0x46, 0x54, 0x41, 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x4d, 0x44, 0x45, 0x35, 0x6c, 0x64, 0x45, 0x78, 0x76, 0x59, + 0x32, 0x73, 0x67, 0x53, 0x32, 0x5a, 0x30, 0x4c, 0x6a, 0x45, 0x33, 0x0a, + 0x4d, 0x44, 0x55, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x77, 0x77, 0x75, + 0x56, 0x47, 0x46, 0x75, 0x77, 0x37, 0x70, 0x7a, 0x77, 0x36, 0x31, 0x30, + 0x64, 0x73, 0x4f, 0x68, 0x62, 0x6e, 0x6c, 0x72, 0x61, 0x57, 0x46, 0x6b, + 0x77, 0x37, 0x4e, 0x72, 0x49, 0x43, 0x68, 0x44, 0x5a, 0x58, 0x4a, 0x30, + 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, + 0x49, 0x46, 0x4e, 0x6c, 0x0a, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, + 0x7a, 0x4b, 0x54, 0x45, 0x31, 0x4d, 0x44, 0x4d, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x41, 0x77, 0x77, 0x73, 0x54, 0x6d, 0x56, 0x30, 0x54, 0x47, 0x39, + 0x6a, 0x61, 0x79, 0x42, 0x42, 0x63, 0x6d, 0x46, 0x75, 0x65, 0x53, 0x41, + 0x6f, 0x51, 0x32, 0x78, 0x68, 0x63, 0x33, 0x4d, 0x67, 0x52, 0x32, 0x39, + 0x73, 0x5a, 0x43, 0x6b, 0x67, 0x52, 0x73, 0x57, 0x52, 0x0a, 0x64, 0x47, + 0x46, 0x75, 0x77, 0x37, 0x70, 0x7a, 0x77, 0x36, 0x31, 0x30, 0x64, 0x73, + 0x4f, 0x68, 0x62, 0x6e, 0x6b, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, + 0x67, 0x78, 0x4d, 0x6a, 0x45, 0x78, 0x4d, 0x54, 0x55, 0x77, 0x4f, 0x44, + 0x49, 0x78, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x67, 0x78, 0x4d, 0x6a, + 0x41, 0x32, 0x4d, 0x54, 0x55, 0x77, 0x4f, 0x44, 0x49, 0x78, 0x57, 0x6a, + 0x43, 0x42, 0x0a, 0x70, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x46, 0x55, 0x78, 0x45, + 0x54, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x43, + 0x45, 0x4a, 0x31, 0x5a, 0x47, 0x46, 0x77, 0x5a, 0x58, 0x4e, 0x30, 0x4d, + 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, + 0x41, 0x78, 0x4f, 0x5a, 0x58, 0x52, 0x4d, 0x0a, 0x62, 0x32, 0x4e, 0x72, + 0x49, 0x45, 0x74, 0x6d, 0x64, 0x43, 0x34, 0x78, 0x4e, 0x7a, 0x41, 0x31, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x4d, 0x4c, 0x6c, 0x52, 0x68, + 0x62, 0x73, 0x4f, 0x36, 0x63, 0x38, 0x4f, 0x74, 0x64, 0x48, 0x62, 0x44, + 0x6f, 0x57, 0x35, 0x35, 0x61, 0x32, 0x6c, 0x68, 0x5a, 0x4d, 0x4f, 0x7a, + 0x61, 0x79, 0x41, 0x6f, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, + 0x0a, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, + 0x54, 0x5a, 0x58, 0x4a, 0x32, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x79, 0x6b, + 0x78, 0x4e, 0x54, 0x41, 0x7a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x4d, 0x4c, 0x45, 0x35, 0x6c, 0x64, 0x45, 0x78, 0x76, 0x59, 0x32, 0x73, + 0x67, 0x51, 0x58, 0x4a, 0x68, 0x62, 0x6e, 0x6b, 0x67, 0x4b, 0x45, 0x4e, + 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x0a, 0x49, 0x45, 0x64, 0x76, 0x62, 0x47, + 0x51, 0x70, 0x49, 0x45, 0x62, 0x46, 0x6b, 0x58, 0x52, 0x68, 0x62, 0x73, + 0x4f, 0x36, 0x63, 0x38, 0x4f, 0x74, 0x64, 0x48, 0x62, 0x44, 0x6f, 0x57, + 0x35, 0x35, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x0a, 0x4d, + 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x78, + 0x43, 0x52, 0x65, 0x63, 0x37, 0x35, 0x4c, 0x62, 0x52, 0x54, 0x44, 0x6f, + 0x66, 0x54, 0x6a, 0x6c, 0x35, 0x42, 0x75, 0x30, 0x6a, 0x42, 0x46, 0x48, + 0x6a, 0x7a, 0x75, 0x5a, 0x39, 0x6c, 0x6b, 0x34, 0x42, 0x71, 0x4b, 0x66, + 0x38, 0x6f, 0x77, 0x79, 0x6f, 0x50, 0x6a, 0x49, 0x4d, 0x48, 0x6a, 0x39, + 0x44, 0x72, 0x54, 0x0a, 0x6c, 0x46, 0x38, 0x61, 0x66, 0x46, 0x74, 0x74, + 0x76, 0x7a, 0x42, 0x50, 0x68, 0x43, 0x66, 0x32, 0x6e, 0x78, 0x39, 0x4a, + 0x76, 0x4d, 0x61, 0x5a, 0x43, 0x70, 0x44, 0x79, 0x44, 0x2f, 0x56, 0x2f, + 0x51, 0x34, 0x51, 0x33, 0x59, 0x31, 0x47, 0x4c, 0x65, 0x71, 0x56, 0x77, + 0x2f, 0x48, 0x70, 0x59, 0x7a, 0x59, 0x36, 0x62, 0x37, 0x63, 0x4e, 0x47, + 0x62, 0x49, 0x52, 0x77, 0x58, 0x64, 0x72, 0x7a, 0x0a, 0x41, 0x5a, 0x41, + 0x6a, 0x2f, 0x45, 0x34, 0x77, 0x71, 0x58, 0x37, 0x68, 0x4a, 0x32, 0x50, + 0x6e, 0x37, 0x57, 0x51, 0x38, 0x6f, 0x4c, 0x6a, 0x4a, 0x4d, 0x32, 0x50, + 0x2b, 0x46, 0x70, 0x44, 0x2f, 0x73, 0x4c, 0x6a, 0x39, 0x31, 0x36, 0x6a, + 0x41, 0x77, 0x4a, 0x52, 0x44, 0x43, 0x37, 0x62, 0x56, 0x57, 0x61, 0x61, + 0x65, 0x56, 0x74, 0x41, 0x6b, 0x48, 0x33, 0x42, 0x35, 0x72, 0x39, 0x73, + 0x35, 0x0a, 0x56, 0x41, 0x31, 0x6c, 0x64, 0x64, 0x6b, 0x56, 0x51, 0x5a, + 0x51, 0x42, 0x72, 0x31, 0x37, 0x73, 0x39, 0x6f, 0x33, 0x78, 0x2f, 0x36, + 0x31, 0x6b, 0x2f, 0x69, 0x43, 0x61, 0x31, 0x31, 0x7a, 0x72, 0x2f, 0x71, + 0x59, 0x66, 0x43, 0x47, 0x53, 0x6a, 0x69, 0x33, 0x5a, 0x56, 0x72, 0x52, + 0x34, 0x37, 0x4b, 0x47, 0x41, 0x75, 0x68, 0x79, 0x58, 0x6f, 0x71, 0x71, + 0x38, 0x66, 0x78, 0x6d, 0x52, 0x47, 0x0a, 0x49, 0x4c, 0x64, 0x77, 0x66, + 0x7a, 0x7a, 0x65, 0x53, 0x4e, 0x75, 0x57, 0x55, 0x37, 0x63, 0x35, 0x64, + 0x2b, 0x51, 0x61, 0x34, 0x73, 0x63, 0x57, 0x68, 0x48, 0x61, 0x58, 0x57, + 0x79, 0x2b, 0x37, 0x47, 0x52, 0x57, 0x46, 0x2b, 0x47, 0x6d, 0x46, 0x39, + 0x5a, 0x6d, 0x6e, 0x71, 0x66, 0x49, 0x30, 0x70, 0x36, 0x6d, 0x32, 0x70, + 0x67, 0x50, 0x38, 0x62, 0x34, 0x59, 0x39, 0x56, 0x48, 0x78, 0x32, 0x0a, + 0x42, 0x4a, 0x74, 0x72, 0x2b, 0x55, 0x42, 0x64, 0x41, 0x44, 0x54, 0x48, + 0x4c, 0x70, 0x6c, 0x31, 0x6e, 0x65, 0x57, 0x49, 0x41, 0x36, 0x70, 0x4e, + 0x2b, 0x41, 0x50, 0x53, 0x51, 0x6e, 0x62, 0x41, 0x47, 0x77, 0x49, 0x44, + 0x41, 0x4b, 0x69, 0x4c, 0x6f, 0x30, 0x55, 0x77, 0x51, 0x7a, 0x41, 0x53, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, + 0x43, 0x44, 0x41, 0x47, 0x0a, 0x41, 0x51, 0x48, 0x2f, 0x41, 0x67, 0x45, + 0x45, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, + 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, + 0x55, 0x7a, 0x50, 0x70, 0x6e, 0x6b, 0x2f, 0x43, 0x32, 0x75, 0x4e, 0x43, + 0x6c, 0x77, 0x42, 0x37, 0x7a, 0x55, 0x2f, 0x32, 0x4d, 0x0a, 0x55, 0x39, + 0x2b, 0x44, 0x31, 0x35, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, + 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4b, 0x74, 0x2f, 0x37, 0x68, + 0x77, 0x57, 0x71, 0x5a, 0x77, 0x38, 0x55, 0x51, 0x43, 0x67, 0x77, 0x42, + 0x45, 0x49, 0x42, 0x61, 0x65, 0x5a, 0x35, 0x6d, 0x38, 0x42, 0x69, 0x46, + 0x52, 0x68, 0x0a, 0x62, 0x76, 0x47, 0x35, 0x47, 0x4b, 0x31, 0x4b, 0x72, + 0x66, 0x36, 0x42, 0x51, 0x43, 0x4f, 0x55, 0x4c, 0x2f, 0x74, 0x31, 0x66, + 0x43, 0x38, 0x6f, 0x53, 0x32, 0x49, 0x6b, 0x67, 0x59, 0x49, 0x4c, 0x39, + 0x57, 0x48, 0x78, 0x48, 0x47, 0x36, 0x34, 0x59, 0x54, 0x6a, 0x72, 0x67, + 0x66, 0x70, 0x69, 0x6f, 0x54, 0x74, 0x61, 0x59, 0x74, 0x4f, 0x55, 0x5a, + 0x63, 0x54, 0x68, 0x35, 0x6d, 0x32, 0x43, 0x0a, 0x2b, 0x43, 0x38, 0x6c, + 0x63, 0x4c, 0x49, 0x68, 0x4a, 0x73, 0x46, 0x79, 0x55, 0x52, 0x2b, 0x4d, + 0x4c, 0x4d, 0x4f, 0x45, 0x6b, 0x4d, 0x4e, 0x61, 0x6a, 0x37, 0x72, 0x50, + 0x39, 0x4b, 0x64, 0x6c, 0x70, 0x65, 0x75, 0x59, 0x30, 0x66, 0x73, 0x46, + 0x73, 0x6b, 0x5a, 0x31, 0x46, 0x53, 0x4e, 0x71, 0x62, 0x34, 0x56, 0x6a, + 0x4d, 0x49, 0x44, 0x77, 0x31, 0x5a, 0x34, 0x66, 0x4b, 0x52, 0x7a, 0x43, + 0x0a, 0x62, 0x4c, 0x42, 0x51, 0x57, 0x56, 0x32, 0x51, 0x57, 0x7a, 0x75, + 0x6f, 0x44, 0x54, 0x44, 0x50, 0x76, 0x33, 0x31, 0x2f, 0x7a, 0x76, 0x47, + 0x64, 0x67, 0x37, 0x33, 0x4a, 0x52, 0x6d, 0x34, 0x67, 0x70, 0x76, 0x6c, + 0x68, 0x55, 0x62, 0x6f, 0x68, 0x4c, 0x33, 0x75, 0x2b, 0x70, 0x52, 0x56, + 0x6a, 0x6f, 0x64, 0x53, 0x56, 0x68, 0x2f, 0x47, 0x65, 0x75, 0x66, 0x4f, + 0x4a, 0x38, 0x7a, 0x32, 0x46, 0x0a, 0x75, 0x4c, 0x6a, 0x62, 0x76, 0x72, + 0x57, 0x35, 0x4b, 0x66, 0x6e, 0x61, 0x4e, 0x77, 0x55, 0x41, 0x53, 0x5a, + 0x51, 0x44, 0x68, 0x45, 0x54, 0x6e, 0x76, 0x30, 0x4d, 0x78, 0x7a, 0x33, + 0x57, 0x4c, 0x4a, 0x64, 0x48, 0x30, 0x70, 0x6d, 0x54, 0x31, 0x6b, 0x76, + 0x61, 0x72, 0x42, 0x65, 0x73, 0x39, 0x36, 0x61, 0x55, 0x4c, 0x4e, 0x6d, + 0x4c, 0x61, 0x7a, 0x41, 0x5a, 0x66, 0x4e, 0x6f, 0x75, 0x32, 0x0a, 0x58, + 0x6a, 0x47, 0x34, 0x4b, 0x76, 0x74, 0x65, 0x39, 0x6e, 0x48, 0x66, 0x52, + 0x43, 0x61, 0x65, 0x78, 0x4f, 0x59, 0x4e, 0x6b, 0x62, 0x51, 0x75, 0x64, + 0x5a, 0x57, 0x41, 0x55, 0x57, 0x70, 0x4c, 0x4d, 0x4b, 0x61, 0x77, 0x59, + 0x71, 0x47, 0x54, 0x38, 0x5a, 0x76, 0x59, 0x7a, 0x73, 0x52, 0x6a, 0x64, + 0x54, 0x39, 0x5a, 0x52, 0x37, 0x45, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, + 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, + 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, + 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, + 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, + 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, + 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x74, + 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, + 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x30, + 0x30, 0x30, 0x31, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x37, 0x63, 0x3a, 0x61, 0x35, 0x3a, 0x30, 0x66, 0x3a, 0x66, 0x38, 0x3a, + 0x35, 0x62, 0x3a, 0x39, 0x61, 0x3a, 0x37, 0x64, 0x3a, 0x36, 0x64, 0x3a, + 0x33, 0x30, 0x3a, 0x61, 0x65, 0x3a, 0x35, 0x34, 0x3a, 0x35, 0x61, 0x3a, + 0x65, 0x33, 0x3a, 0x34, 0x32, 0x3a, 0x61, 0x32, 0x3a, 0x38, 0x61, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x39, 0x3a, 0x61, + 0x66, 0x3a, 0x38, 0x32, 0x3a, 0x37, 0x39, 0x3a, 0x39, 0x31, 0x3a, 0x38, + 0x36, 0x3a, 0x63, 0x37, 0x3a, 0x62, 0x34, 0x3a, 0x37, 0x35, 0x3a, 0x30, + 0x37, 0x3a, 0x63, 0x62, 0x3a, 0x63, 0x66, 0x3a, 0x30, 0x33, 0x3a, 0x35, + 0x37, 0x3a, 0x34, 0x36, 0x3a, 0x65, 0x62, 0x3a, 0x30, 0x34, 0x3a, 0x64, + 0x64, 0x3a, 0x62, 0x37, 0x3a, 0x31, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x36, 0x3a, 0x38, 0x63, 0x3a, + 0x38, 0x33, 0x3a, 0x39, 0x34, 0x3a, 0x37, 0x64, 0x3a, 0x61, 0x36, 0x3a, + 0x33, 0x62, 0x3a, 0x37, 0x32, 0x3a, 0x34, 0x62, 0x3a, 0x65, 0x63, 0x3a, + 0x65, 0x31, 0x3a, 0x37, 0x34, 0x3a, 0x33, 0x63, 0x3a, 0x33, 0x31, 0x3a, + 0x61, 0x30, 0x3a, 0x65, 0x36, 0x3a, 0x61, 0x65, 0x3a, 0x64, 0x30, 0x3a, + 0x64, 0x62, 0x3a, 0x38, 0x65, 0x3a, 0x63, 0x35, 0x3a, 0x62, 0x33, 0x3a, + 0x31, 0x62, 0x3a, 0x65, 0x33, 0x3a, 0x37, 0x37, 0x3a, 0x62, 0x62, 0x3a, + 0x37, 0x38, 0x3a, 0x34, 0x66, 0x3a, 0x39, 0x31, 0x3a, 0x62, 0x36, 0x3a, + 0x37, 0x31, 0x3a, 0x36, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x46, 0x79, 0x6a, 0x43, 0x43, 0x41, 0x37, 0x4b, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, 0x41, 0x4a, 0x69, 0x57, 0x6a, 0x44, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x61, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x4f, 0x0a, 0x54, 0x44, 0x45, 0x65, 0x4d, 0x42, 0x77, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x56, 0x55, 0x33, 0x52, 0x68, 0x59, + 0x58, 0x51, 0x67, 0x5a, 0x47, 0x56, 0x79, 0x49, 0x45, 0x35, 0x6c, 0x5a, + 0x47, 0x56, 0x79, 0x62, 0x47, 0x46, 0x75, 0x5a, 0x47, 0x56, 0x75, 0x4d, + 0x53, 0x73, 0x77, 0x4b, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, + 0x43, 0x4a, 0x54, 0x64, 0x47, 0x46, 0x68, 0x0a, 0x64, 0x43, 0x42, 0x6b, + 0x5a, 0x58, 0x49, 0x67, 0x54, 0x6d, 0x56, 0x6b, 0x5a, 0x58, 0x4a, 0x73, + 0x59, 0x57, 0x35, 0x6b, 0x5a, 0x57, 0x34, 0x67, 0x55, 0x6d, 0x39, 0x76, + 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, + 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x34, 0x4d, 0x44, 0x4d, 0x79, + 0x4e, 0x6a, 0x45, 0x78, 0x4d, 0x54, 0x67, 0x78, 0x4e, 0x31, 0x6f, 0x58, + 0x0a, 0x44, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x4d, 0x79, 0x4e, 0x54, 0x45, + 0x78, 0x4d, 0x44, 0x4d, 0x78, 0x4d, 0x46, 0x6f, 0x77, 0x57, 0x6a, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x54, 0x6b, 0x77, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x46, 0x56, 0x4e, 0x30, 0x59, 0x57, 0x46, + 0x30, 0x49, 0x47, 0x52, 0x6c, 0x0a, 0x63, 0x69, 0x42, 0x4f, 0x5a, 0x57, + 0x52, 0x6c, 0x63, 0x6d, 0x78, 0x68, 0x62, 0x6d, 0x52, 0x6c, 0x62, 0x6a, + 0x45, 0x72, 0x4d, 0x43, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, + 0x77, 0x69, 0x55, 0x33, 0x52, 0x68, 0x59, 0x58, 0x51, 0x67, 0x5a, 0x47, + 0x56, 0x79, 0x49, 0x45, 0x35, 0x6c, 0x5a, 0x47, 0x56, 0x79, 0x62, 0x47, + 0x46, 0x75, 0x5a, 0x47, 0x56, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x0a, 0x62, + 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, 0x53, 0x42, 0x48, 0x4d, + 0x6a, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, + 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4d, 0x56, 0x5a, 0x35, + 0x32, 0x39, 0x31, 0x0a, 0x71, 0x6a, 0x35, 0x4c, 0x6e, 0x4c, 0x57, 0x34, + 0x72, 0x4a, 0x34, 0x4c, 0x35, 0x50, 0x6e, 0x5a, 0x79, 0x71, 0x74, 0x64, + 0x6a, 0x37, 0x55, 0x35, 0x45, 0x49, 0x4c, 0x58, 0x72, 0x31, 0x48, 0x67, + 0x4f, 0x2b, 0x45, 0x41, 0x53, 0x47, 0x72, 0x50, 0x32, 0x75, 0x45, 0x47, + 0x51, 0x78, 0x47, 0x5a, 0x71, 0x68, 0x51, 0x6c, 0x45, 0x71, 0x30, 0x69, + 0x36, 0x41, 0x42, 0x74, 0x51, 0x38, 0x53, 0x70, 0x0a, 0x75, 0x4f, 0x55, + 0x66, 0x69, 0x55, 0x74, 0x6e, 0x76, 0x57, 0x46, 0x49, 0x37, 0x2f, 0x33, + 0x53, 0x34, 0x47, 0x43, 0x49, 0x35, 0x62, 0x6b, 0x59, 0x59, 0x43, 0x6a, + 0x44, 0x64, 0x79, 0x75, 0x74, 0x73, 0x44, 0x65, 0x71, 0x4e, 0x39, 0x35, + 0x6b, 0x57, 0x53, 0x70, 0x47, 0x56, 0x2b, 0x52, 0x4c, 0x75, 0x66, 0x67, + 0x33, 0x66, 0x4e, 0x55, 0x32, 0x35, 0x34, 0x44, 0x42, 0x74, 0x76, 0x50, + 0x55, 0x0a, 0x5a, 0x35, 0x75, 0x57, 0x36, 0x4d, 0x37, 0x58, 0x78, 0x67, + 0x70, 0x54, 0x30, 0x47, 0x74, 0x4a, 0x6c, 0x76, 0x4f, 0x6a, 0x43, 0x77, + 0x56, 0x33, 0x53, 0x50, 0x63, 0x6c, 0x35, 0x58, 0x43, 0x73, 0x4d, 0x42, + 0x51, 0x67, 0x4a, 0x65, 0x4e, 0x2f, 0x64, 0x56, 0x72, 0x6c, 0x53, 0x50, + 0x68, 0x4f, 0x65, 0x77, 0x4d, 0x48, 0x42, 0x50, 0x71, 0x43, 0x59, 0x59, + 0x64, 0x75, 0x38, 0x44, 0x76, 0x45, 0x0a, 0x70, 0x4d, 0x66, 0x51, 0x39, + 0x58, 0x51, 0x2b, 0x70, 0x56, 0x30, 0x61, 0x43, 0x50, 0x4b, 0x62, 0x4a, + 0x64, 0x4c, 0x32, 0x72, 0x41, 0x51, 0x6d, 0x50, 0x6c, 0x55, 0x36, 0x59, + 0x69, 0x69, 0x6c, 0x65, 0x37, 0x49, 0x77, 0x72, 0x2f, 0x67, 0x33, 0x77, + 0x74, 0x47, 0x36, 0x31, 0x6a, 0x6a, 0x39, 0x39, 0x4f, 0x39, 0x4a, 0x4d, + 0x44, 0x65, 0x5a, 0x4a, 0x69, 0x46, 0x49, 0x68, 0x51, 0x47, 0x70, 0x0a, + 0x35, 0x52, 0x62, 0x6e, 0x33, 0x4a, 0x42, 0x56, 0x33, 0x77, 0x2f, 0x6f, + 0x4f, 0x4d, 0x32, 0x5a, 0x4e, 0x79, 0x46, 0x50, 0x58, 0x66, 0x55, 0x69, + 0x62, 0x32, 0x72, 0x46, 0x45, 0x68, 0x5a, 0x67, 0x46, 0x31, 0x58, 0x79, + 0x5a, 0x57, 0x61, 0x6d, 0x70, 0x7a, 0x43, 0x52, 0x4f, 0x4d, 0x45, 0x34, + 0x48, 0x59, 0x59, 0x45, 0x68, 0x4c, 0x6f, 0x61, 0x4a, 0x58, 0x68, 0x65, + 0x6e, 0x61, 0x2f, 0x4d, 0x0a, 0x55, 0x47, 0x44, 0x57, 0x45, 0x34, 0x64, + 0x53, 0x37, 0x57, 0x4d, 0x66, 0x62, 0x57, 0x56, 0x39, 0x77, 0x68, 0x55, + 0x59, 0x64, 0x4d, 0x72, 0x68, 0x66, 0x6d, 0x51, 0x70, 0x6a, 0x48, 0x4c, + 0x59, 0x46, 0x68, 0x4e, 0x39, 0x43, 0x30, 0x6c, 0x4b, 0x38, 0x53, 0x67, + 0x62, 0x49, 0x48, 0x52, 0x72, 0x78, 0x54, 0x33, 0x64, 0x73, 0x4b, 0x70, + 0x49, 0x43, 0x54, 0x30, 0x75, 0x67, 0x70, 0x54, 0x4e, 0x0a, 0x47, 0x6d, + 0x58, 0x5a, 0x4b, 0x34, 0x69, 0x61, 0x6d, 0x62, 0x77, 0x59, 0x66, 0x70, + 0x2f, 0x75, 0x66, 0x57, 0x5a, 0x38, 0x50, 0x72, 0x32, 0x55, 0x75, 0x49, + 0x48, 0x4f, 0x7a, 0x5a, 0x67, 0x77, 0x65, 0x4d, 0x46, 0x76, 0x5a, 0x39, + 0x43, 0x2b, 0x58, 0x2b, 0x42, 0x6f, 0x37, 0x64, 0x37, 0x69, 0x73, 0x63, + 0x6b, 0x73, 0x57, 0x58, 0x69, 0x53, 0x71, 0x74, 0x38, 0x72, 0x59, 0x47, + 0x50, 0x79, 0x0a, 0x35, 0x56, 0x36, 0x35, 0x34, 0x38, 0x72, 0x36, 0x66, + 0x31, 0x43, 0x47, 0x50, 0x71, 0x49, 0x30, 0x47, 0x41, 0x77, 0x4a, 0x61, + 0x43, 0x67, 0x52, 0x48, 0x4f, 0x54, 0x68, 0x75, 0x56, 0x77, 0x2b, 0x52, + 0x37, 0x6f, 0x79, 0x50, 0x78, 0x6a, 0x4d, 0x57, 0x34, 0x54, 0x31, 0x38, + 0x32, 0x74, 0x30, 0x78, 0x48, 0x4a, 0x30, 0x34, 0x65, 0x4f, 0x4c, 0x6f, + 0x45, 0x71, 0x39, 0x6a, 0x57, 0x59, 0x76, 0x0a, 0x36, 0x71, 0x30, 0x31, + 0x32, 0x69, 0x44, 0x54, 0x69, 0x49, 0x4a, 0x68, 0x38, 0x42, 0x49, 0x69, + 0x74, 0x72, 0x7a, 0x51, 0x31, 0x61, 0x54, 0x73, 0x72, 0x31, 0x53, 0x49, + 0x4a, 0x53, 0x51, 0x38, 0x70, 0x32, 0x32, 0x78, 0x63, 0x69, 0x6b, 0x2f, + 0x50, 0x6c, 0x65, 0x6d, 0x66, 0x31, 0x57, 0x76, 0x62, 0x69, 0x62, 0x47, + 0x2f, 0x75, 0x66, 0x4d, 0x51, 0x46, 0x78, 0x52, 0x52, 0x49, 0x45, 0x4b, + 0x0a, 0x65, 0x4e, 0x35, 0x4b, 0x7a, 0x6c, 0x57, 0x2f, 0x48, 0x64, 0x58, + 0x5a, 0x74, 0x31, 0x62, 0x76, 0x38, 0x48, 0x62, 0x2f, 0x43, 0x33, 0x6d, + 0x31, 0x72, 0x37, 0x33, 0x37, 0x71, 0x57, 0x6d, 0x52, 0x52, 0x70, 0x64, + 0x6f, 0x67, 0x42, 0x51, 0x32, 0x48, 0x62, 0x4e, 0x2f, 0x75, 0x79, 0x6d, + 0x59, 0x4e, 0x71, 0x55, 0x67, 0x2b, 0x6f, 0x4a, 0x67, 0x59, 0x6a, 0x4f, + 0x6b, 0x37, 0x4e, 0x61, 0x36, 0x0a, 0x42, 0x36, 0x64, 0x75, 0x78, 0x63, + 0x38, 0x55, 0x70, 0x75, 0x66, 0x57, 0x6b, 0x6a, 0x54, 0x59, 0x67, 0x66, + 0x58, 0x38, 0x48, 0x56, 0x32, 0x71, 0x58, 0x42, 0x37, 0x32, 0x6f, 0x30, + 0x30, 0x37, 0x75, 0x50, 0x63, 0x35, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, + 0x47, 0x6a, 0x67, 0x5a, 0x63, 0x77, 0x67, 0x5a, 0x51, 0x77, 0x44, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x0a, 0x42, + 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x42, 0x53, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x53, 0x41, 0x45, 0x53, 0x7a, 0x42, 0x4a, 0x4d, + 0x45, 0x63, 0x47, 0x42, 0x46, 0x55, 0x64, 0x49, 0x41, 0x41, 0x77, 0x50, + 0x7a, 0x41, 0x39, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, + 0x51, 0x63, 0x43, 0x41, 0x52, 0x59, 0x78, 0x61, 0x48, 0x52, 0x30, 0x63, + 0x44, 0x6f, 0x76, 0x0a, 0x4c, 0x33, 0x64, 0x33, 0x64, 0x79, 0x35, 0x77, + 0x61, 0x32, 0x6c, 0x76, 0x64, 0x6d, 0x56, 0x79, 0x61, 0x47, 0x56, 0x70, + 0x5a, 0x43, 0x35, 0x75, 0x62, 0x43, 0x39, 0x77, 0x62, 0x32, 0x78, 0x70, + 0x59, 0x32, 0x6c, 0x6c, 0x63, 0x79, 0x39, 0x79, 0x62, 0x32, 0x39, 0x30, + 0x4c, 0x58, 0x42, 0x76, 0x62, 0x47, 0x6c, 0x6a, 0x65, 0x53, 0x31, 0x48, + 0x4d, 0x6a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x51, 0x38, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, + 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, + 0x45, 0x46, 0x4a, 0x46, 0x6f, 0x4d, 0x6f, 0x63, 0x56, 0x48, 0x59, 0x6e, + 0x69, 0x74, 0x66, 0x47, 0x73, 0x4e, 0x69, 0x67, 0x30, 0x6a, 0x51, 0x74, + 0x38, 0x59, 0x6f, 0x6a, 0x72, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, 0x51, 0x43, 0x6f, 0x51, 0x55, + 0x70, 0x6e, 0x4b, 0x70, 0x4b, 0x42, 0x67, 0x6c, 0x42, 0x75, 0x34, 0x64, + 0x66, 0x59, 0x73, 0x7a, 0x6b, 0x37, 0x38, 0x77, 0x49, 0x56, 0x43, 0x56, + 0x42, 0x52, 0x37, 0x79, 0x32, 0x39, 0x4a, 0x48, 0x75, 0x49, 0x68, 0x6a, + 0x76, 0x35, 0x74, 0x4c, 0x79, 0x53, 0x0a, 0x43, 0x5a, 0x61, 0x35, 0x39, + 0x73, 0x43, 0x72, 0x49, 0x32, 0x41, 0x47, 0x65, 0x59, 0x77, 0x52, 0x54, + 0x6c, 0x48, 0x53, 0x65, 0x59, 0x41, 0x7a, 0x2b, 0x35, 0x31, 0x49, 0x76, + 0x75, 0x78, 0x42, 0x51, 0x34, 0x45, 0x66, 0x66, 0x6b, 0x64, 0x41, 0x48, + 0x4f, 0x56, 0x36, 0x43, 0x4d, 0x71, 0x71, 0x69, 0x33, 0x57, 0x74, 0x46, + 0x4d, 0x54, 0x43, 0x36, 0x47, 0x59, 0x38, 0x67, 0x67, 0x65, 0x6e, 0x0a, + 0x35, 0x69, 0x65, 0x43, 0x57, 0x78, 0x6a, 0x6d, 0x44, 0x32, 0x37, 0x5a, + 0x55, 0x44, 0x36, 0x4b, 0x51, 0x68, 0x67, 0x70, 0x78, 0x72, 0x52, 0x57, + 0x2f, 0x46, 0x59, 0x51, 0x6f, 0x41, 0x55, 0x58, 0x76, 0x51, 0x77, 0x6a, + 0x66, 0x2f, 0x53, 0x54, 0x37, 0x5a, 0x77, 0x61, 0x55, 0x62, 0x37, 0x64, + 0x52, 0x55, 0x47, 0x2f, 0x6b, 0x53, 0x53, 0x30, 0x48, 0x34, 0x7a, 0x70, + 0x58, 0x38, 0x39, 0x37, 0x0a, 0x49, 0x5a, 0x6d, 0x66, 0x6c, 0x5a, 0x38, + 0x35, 0x4f, 0x6b, 0x59, 0x63, 0x62, 0x50, 0x6e, 0x4e, 0x65, 0x35, 0x79, + 0x51, 0x7a, 0x53, 0x69, 0x70, 0x78, 0x36, 0x6c, 0x56, 0x75, 0x36, 0x78, + 0x69, 0x4e, 0x47, 0x49, 0x31, 0x45, 0x30, 0x73, 0x55, 0x4f, 0x6c, 0x57, + 0x44, 0x75, 0x59, 0x61, 0x4e, 0x6b, 0x71, 0x62, 0x47, 0x39, 0x41, 0x63, + 0x6c, 0x56, 0x4d, 0x77, 0x57, 0x56, 0x78, 0x4a, 0x4b, 0x0a, 0x67, 0x6e, + 0x6a, 0x49, 0x46, 0x4e, 0x6b, 0x58, 0x67, 0x69, 0x59, 0x74, 0x58, 0x53, + 0x41, 0x66, 0x65, 0x61, 0x37, 0x2b, 0x31, 0x48, 0x41, 0x57, 0x46, 0x70, + 0x57, 0x44, 0x32, 0x44, 0x55, 0x35, 0x2f, 0x31, 0x4a, 0x64, 0x64, 0x52, + 0x77, 0x57, 0x78, 0x52, 0x4e, 0x56, 0x7a, 0x30, 0x66, 0x4d, 0x64, 0x57, + 0x56, 0x53, 0x53, 0x74, 0x37, 0x77, 0x73, 0x4b, 0x66, 0x6b, 0x43, 0x70, + 0x59, 0x4c, 0x0a, 0x2b, 0x36, 0x33, 0x43, 0x34, 0x69, 0x57, 0x45, 0x73, + 0x74, 0x33, 0x6b, 0x76, 0x58, 0x35, 0x5a, 0x62, 0x4a, 0x76, 0x77, 0x38, + 0x4e, 0x6a, 0x6e, 0x79, 0x76, 0x4c, 0x70, 0x6c, 0x7a, 0x68, 0x2b, 0x69, + 0x62, 0x37, 0x4d, 0x2b, 0x7a, 0x6b, 0x58, 0x59, 0x54, 0x39, 0x79, 0x32, + 0x7a, 0x71, 0x52, 0x32, 0x47, 0x55, 0x42, 0x47, 0x52, 0x32, 0x74, 0x55, + 0x4b, 0x52, 0x58, 0x43, 0x6e, 0x78, 0x4c, 0x0a, 0x76, 0x4a, 0x78, 0x78, + 0x63, 0x79, 0x70, 0x46, 0x55, 0x52, 0x6d, 0x46, 0x7a, 0x49, 0x37, 0x39, + 0x52, 0x36, 0x64, 0x30, 0x6c, 0x52, 0x32, 0x6f, 0x30, 0x61, 0x39, 0x4f, + 0x46, 0x37, 0x46, 0x70, 0x4a, 0x73, 0x4b, 0x71, 0x65, 0x46, 0x64, 0x62, + 0x78, 0x55, 0x32, 0x6e, 0x35, 0x5a, 0x34, 0x46, 0x46, 0x35, 0x54, 0x4b, + 0x73, 0x6c, 0x2b, 0x67, 0x53, 0x52, 0x69, 0x4e, 0x4e, 0x4f, 0x6b, 0x6d, + 0x0a, 0x62, 0x45, 0x67, 0x65, 0x71, 0x6d, 0x69, 0x53, 0x42, 0x65, 0x47, + 0x43, 0x63, 0x31, 0x71, 0x62, 0x33, 0x41, 0x64, 0x62, 0x43, 0x47, 0x31, + 0x39, 0x6e, 0x64, 0x65, 0x4e, 0x49, 0x64, 0x6e, 0x38, 0x46, 0x43, 0x43, + 0x71, 0x77, 0x6b, 0x58, 0x66, 0x50, 0x2b, 0x63, 0x41, 0x73, 0x6c, 0x48, + 0x6b, 0x77, 0x76, 0x67, 0x46, 0x75, 0x58, 0x6b, 0x61, 0x6a, 0x44, 0x54, + 0x7a, 0x6e, 0x6c, 0x76, 0x6b, 0x0a, 0x4e, 0x31, 0x74, 0x72, 0x53, 0x74, + 0x38, 0x73, 0x56, 0x34, 0x70, 0x41, 0x57, 0x6a, 0x61, 0x36, 0x33, 0x58, + 0x56, 0x45, 0x43, 0x44, 0x64, 0x43, 0x63, 0x41, 0x7a, 0x2b, 0x33, 0x46, + 0x34, 0x68, 0x6f, 0x4b, 0x4f, 0x4b, 0x77, 0x4a, 0x43, 0x63, 0x61, 0x4e, + 0x70, 0x51, 0x35, 0x6b, 0x55, 0x51, 0x52, 0x33, 0x69, 0x32, 0x54, 0x74, + 0x4a, 0x6c, 0x79, 0x63, 0x4d, 0x33, 0x33, 0x2b, 0x46, 0x43, 0x0a, 0x59, + 0x37, 0x42, 0x58, 0x4e, 0x30, 0x55, 0x74, 0x65, 0x34, 0x71, 0x63, 0x76, + 0x77, 0x58, 0x71, 0x5a, 0x56, 0x55, 0x7a, 0x39, 0x7a, 0x6b, 0x51, 0x78, + 0x53, 0x67, 0x71, 0x49, 0x58, 0x6f, 0x62, 0x69, 0x73, 0x51, 0x6b, 0x2b, + 0x54, 0x38, 0x56, 0x79, 0x4a, 0x6f, 0x56, 0x49, 0x50, 0x56, 0x56, 0x59, + 0x70, 0x62, 0x74, 0x62, 0x5a, 0x4e, 0x51, 0x76, 0x4f, 0x53, 0x71, 0x65, + 0x4b, 0x33, 0x5a, 0x0a, 0x79, 0x77, 0x70, 0x6c, 0x68, 0x36, 0x5a, 0x6d, + 0x77, 0x63, 0x53, 0x42, 0x6f, 0x33, 0x63, 0x36, 0x57, 0x42, 0x34, 0x4c, + 0x37, 0x6f, 0x4f, 0x4c, 0x6e, 0x52, 0x37, 0x53, 0x55, 0x71, 0x54, 0x4d, + 0x48, 0x57, 0x2b, 0x77, 0x6d, 0x47, 0x32, 0x55, 0x4d, 0x62, 0x58, 0x34, + 0x63, 0x51, 0x72, 0x63, 0x75, 0x66, 0x78, 0x39, 0x4d, 0x6d, 0x44, 0x6d, + 0x36, 0x36, 0x2b, 0x4b, 0x41, 0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, 0x6f, + 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, + 0x20, 0x4f, 0x3d, 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, + 0x50, 0x6f, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, 0x6f, 0x6e, 0x67, 0x6b, + 0x6f, 0x6e, 0x67, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x48, 0x6f, 0x6e, + 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x48, 0x6f, 0x6e, + 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, 0x30, 0x30, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x38, 0x3a, 0x30, + 0x64, 0x3a, 0x36, 0x66, 0x3a, 0x33, 0x39, 0x3a, 0x37, 0x38, 0x3a, 0x62, + 0x39, 0x3a, 0x34, 0x33, 0x3a, 0x36, 0x64, 0x3a, 0x37, 0x37, 0x3a, 0x34, + 0x32, 0x3a, 0x36, 0x64, 0x3a, 0x39, 0x38, 0x3a, 0x35, 0x61, 0x3a, 0x63, + 0x63, 0x3a, 0x32, 0x33, 0x3a, 0x63, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x36, 0x3a, 0x64, 0x61, 0x3a, 0x61, 0x38, + 0x3a, 0x32, 0x30, 0x3a, 0x38, 0x64, 0x3a, 0x30, 0x39, 0x3a, 0x64, 0x32, + 0x3a, 0x31, 0x35, 0x3a, 0x34, 0x64, 0x3a, 0x32, 0x34, 0x3a, 0x62, 0x35, + 0x3a, 0x32, 0x66, 0x3a, 0x63, 0x62, 0x3a, 0x33, 0x34, 0x3a, 0x36, 0x65, + 0x3a, 0x62, 0x32, 0x3a, 0x35, 0x38, 0x3a, 0x62, 0x32, 0x3a, 0x38, 0x61, + 0x3a, 0x35, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x66, 0x39, 0x3a, 0x65, 0x36, 0x3a, 0x37, 0x64, 0x3a, 0x33, + 0x33, 0x3a, 0x36, 0x63, 0x3a, 0x35, 0x31, 0x3a, 0x30, 0x30, 0x3a, 0x32, + 0x61, 0x3a, 0x63, 0x30, 0x3a, 0x35, 0x34, 0x3a, 0x63, 0x36, 0x3a, 0x33, + 0x32, 0x3a, 0x30, 0x32, 0x3a, 0x32, 0x64, 0x3a, 0x36, 0x36, 0x3a, 0x64, + 0x64, 0x3a, 0x61, 0x32, 0x3a, 0x65, 0x37, 0x3a, 0x65, 0x33, 0x3a, 0x66, + 0x66, 0x3a, 0x66, 0x31, 0x3a, 0x30, 0x61, 0x3a, 0x64, 0x30, 0x3a, 0x36, + 0x31, 0x3a, 0x65, 0x64, 0x3a, 0x33, 0x31, 0x3a, 0x64, 0x38, 0x3a, 0x62, + 0x62, 0x3a, 0x62, 0x34, 0x3a, 0x31, 0x30, 0x3a, 0x63, 0x66, 0x3a, 0x62, + 0x32, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x4d, 0x44, + 0x43, 0x43, 0x41, 0x68, 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x43, 0x41, 0x2b, 0x67, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, + 0x41, 0x77, 0x52, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x45, 0x73, 0x78, 0x0a, 0x46, + 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, + 0x55, 0x68, 0x76, 0x62, 0x6d, 0x64, 0x72, 0x62, 0x32, 0x35, 0x6e, 0x49, + 0x46, 0x42, 0x76, 0x63, 0x33, 0x51, 0x78, 0x49, 0x44, 0x41, 0x65, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x30, 0x68, 0x76, 0x62, + 0x6d, 0x64, 0x72, 0x62, 0x32, 0x35, 0x6e, 0x49, 0x46, 0x42, 0x76, 0x63, + 0x33, 0x51, 0x67, 0x0a, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x51, 0x53, 0x41, 0x78, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x7a, + 0x4d, 0x44, 0x55, 0x78, 0x4e, 0x54, 0x41, 0x31, 0x4d, 0x54, 0x4d, 0x78, + 0x4e, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x7a, 0x4d, 0x44, 0x55, 0x78, + 0x4e, 0x54, 0x41, 0x30, 0x4e, 0x54, 0x49, 0x79, 0x4f, 0x56, 0x6f, 0x77, + 0x52, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x45, 0x73, 0x78, 0x46, 0x6a, 0x41, + 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x55, 0x68, + 0x76, 0x62, 0x6d, 0x64, 0x72, 0x62, 0x32, 0x35, 0x6e, 0x49, 0x46, 0x42, + 0x76, 0x63, 0x33, 0x51, 0x78, 0x49, 0x44, 0x41, 0x65, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x30, 0x68, 0x76, 0x62, 0x6d, 0x64, + 0x72, 0x0a, 0x62, 0x32, 0x35, 0x6e, 0x49, 0x46, 0x42, 0x76, 0x63, 0x33, + 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, + 0x41, 0x78, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, + 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x0a, 0x41, 0x51, 0x45, 0x41, 0x72, + 0x50, 0x38, 0x34, 0x74, 0x75, 0x6c, 0x6d, 0x41, 0x6b, 0x6e, 0x6a, 0x6f, + 0x72, 0x54, 0x68, 0x6b, 0x50, 0x6c, 0x41, 0x6a, 0x33, 0x6e, 0x35, 0x34, + 0x72, 0x31, 0x35, 0x2f, 0x67, 0x4b, 0x39, 0x37, 0x69, 0x53, 0x53, 0x48, + 0x53, 0x4c, 0x32, 0x32, 0x6f, 0x56, 0x79, 0x61, 0x66, 0x37, 0x58, 0x50, + 0x77, 0x6e, 0x55, 0x33, 0x5a, 0x47, 0x31, 0x41, 0x70, 0x7a, 0x51, 0x0a, + 0x6a, 0x56, 0x72, 0x68, 0x56, 0x63, 0x4e, 0x51, 0x68, 0x72, 0x6b, 0x70, + 0x4a, 0x73, 0x4c, 0x6a, 0x32, 0x61, 0x44, 0x78, 0x61, 0x51, 0x4d, 0x6f, + 0x49, 0x49, 0x42, 0x46, 0x49, 0x69, 0x31, 0x57, 0x70, 0x7a, 0x74, 0x55, + 0x6c, 0x56, 0x59, 0x69, 0x57, 0x52, 0x38, 0x6f, 0x33, 0x78, 0x38, 0x67, + 0x50, 0x57, 0x32, 0x69, 0x4e, 0x72, 0x34, 0x6a, 0x6f, 0x4c, 0x46, 0x75, + 0x74, 0x62, 0x45, 0x6e, 0x0a, 0x50, 0x7a, 0x6c, 0x54, 0x43, 0x65, 0x71, + 0x72, 0x61, 0x75, 0x68, 0x30, 0x73, 0x73, 0x4a, 0x6c, 0x58, 0x49, 0x36, + 0x2f, 0x66, 0x4d, 0x4e, 0x34, 0x68, 0x4d, 0x32, 0x65, 0x46, 0x76, 0x7a, + 0x31, 0x4c, 0x6b, 0x38, 0x67, 0x4b, 0x67, 0x69, 0x66, 0x64, 0x2f, 0x50, + 0x46, 0x48, 0x73, 0x53, 0x61, 0x55, 0x6d, 0x59, 0x65, 0x53, 0x46, 0x37, + 0x6a, 0x45, 0x41, 0x61, 0x50, 0x49, 0x70, 0x6a, 0x68, 0x0a, 0x5a, 0x59, + 0x34, 0x62, 0x58, 0x53, 0x4e, 0x6d, 0x4f, 0x37, 0x69, 0x6c, 0x4d, 0x6c, + 0x48, 0x49, 0x68, 0x71, 0x71, 0x68, 0x71, 0x5a, 0x35, 0x2f, 0x64, 0x70, + 0x54, 0x43, 0x70, 0x6d, 0x79, 0x33, 0x51, 0x66, 0x44, 0x56, 0x79, 0x41, + 0x59, 0x34, 0x35, 0x74, 0x51, 0x4d, 0x34, 0x76, 0x4d, 0x37, 0x54, 0x47, + 0x31, 0x51, 0x6a, 0x4d, 0x53, 0x44, 0x4a, 0x38, 0x45, 0x54, 0x68, 0x46, + 0x6b, 0x39, 0x0a, 0x6e, 0x6e, 0x56, 0x30, 0x74, 0x74, 0x67, 0x43, 0x58, + 0x6a, 0x71, 0x51, 0x65, 0x73, 0x42, 0x43, 0x4e, 0x6e, 0x4c, 0x73, 0x61, + 0x6b, 0x33, 0x63, 0x37, 0x38, 0x51, 0x41, 0x33, 0x78, 0x4d, 0x59, 0x56, + 0x31, 0x38, 0x6d, 0x65, 0x4d, 0x6a, 0x57, 0x43, 0x6e, 0x6c, 0x33, 0x76, + 0x2f, 0x65, 0x76, 0x74, 0x33, 0x61, 0x35, 0x70, 0x51, 0x75, 0x45, 0x46, + 0x31, 0x30, 0x51, 0x36, 0x6d, 0x2f, 0x68, 0x0a, 0x71, 0x35, 0x55, 0x52, + 0x58, 0x32, 0x30, 0x38, 0x6f, 0x31, 0x78, 0x4e, 0x67, 0x31, 0x76, 0x79, + 0x73, 0x78, 0x6d, 0x4b, 0x67, 0x49, 0x73, 0x4c, 0x68, 0x77, 0x49, 0x44, + 0x41, 0x51, 0x41, 0x42, 0x6f, 0x79, 0x59, 0x77, 0x4a, 0x44, 0x41, 0x53, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, + 0x43, 0x44, 0x41, 0x47, 0x41, 0x51, 0x48, 0x2f, 0x41, 0x67, 0x45, 0x44, + 0x0a, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x78, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, + 0x41, 0x44, 0x6b, 0x62, 0x56, 0x50, 0x4b, 0x37, 0x69, 0x68, 0x39, 0x6c, + 0x65, 0x67, 0x59, 0x73, 0x43, 0x0a, 0x6d, 0x45, 0x45, 0x49, 0x6a, 0x45, + 0x79, 0x38, 0x32, 0x74, 0x76, 0x75, 0x4a, 0x78, 0x75, 0x43, 0x35, 0x32, + 0x70, 0x46, 0x37, 0x42, 0x61, 0x4c, 0x54, 0x34, 0x57, 0x67, 0x38, 0x37, + 0x4a, 0x77, 0x76, 0x56, 0x71, 0x57, 0x75, 0x73, 0x70, 0x75, 0x62, 0x65, + 0x35, 0x47, 0x69, 0x32, 0x37, 0x6e, 0x4b, 0x69, 0x36, 0x57, 0x73, 0x78, + 0x6b, 0x7a, 0x36, 0x37, 0x53, 0x66, 0x71, 0x4c, 0x49, 0x33, 0x0a, 0x37, + 0x70, 0x69, 0x6f, 0x6c, 0x37, 0x59, 0x75, 0x74, 0x6d, 0x63, 0x6e, 0x31, + 0x4b, 0x5a, 0x4a, 0x2f, 0x52, 0x79, 0x54, 0x5a, 0x58, 0x61, 0x65, 0x51, + 0x69, 0x2f, 0x63, 0x49, 0x6d, 0x79, 0x61, 0x54, 0x2f, 0x4a, 0x61, 0x46, + 0x54, 0x6d, 0x78, 0x63, 0x64, 0x63, 0x72, 0x55, 0x65, 0x68, 0x74, 0x48, + 0x4a, 0x6a, 0x41, 0x32, 0x53, 0x72, 0x30, 0x6f, 0x59, 0x4a, 0x37, 0x31, + 0x63, 0x6c, 0x42, 0x0a, 0x6f, 0x69, 0x4d, 0x42, 0x64, 0x44, 0x68, 0x56, + 0x69, 0x77, 0x2b, 0x35, 0x4c, 0x6d, 0x65, 0x69, 0x49, 0x41, 0x51, 0x33, + 0x32, 0x70, 0x77, 0x4c, 0x30, 0x78, 0x63, 0x68, 0x34, 0x49, 0x2b, 0x58, + 0x65, 0x54, 0x52, 0x76, 0x68, 0x45, 0x67, 0x43, 0x49, 0x44, 0x4d, 0x62, + 0x35, 0x6a, 0x52, 0x45, 0x6e, 0x35, 0x46, 0x77, 0x39, 0x49, 0x42, 0x65, + 0x68, 0x45, 0x50, 0x43, 0x4b, 0x64, 0x4a, 0x73, 0x0a, 0x45, 0x68, 0x54, + 0x6b, 0x59, 0x59, 0x32, 0x73, 0x45, 0x4a, 0x43, 0x65, 0x68, 0x46, 0x43, + 0x37, 0x38, 0x4a, 0x5a, 0x76, 0x52, 0x5a, 0x2b, 0x4b, 0x38, 0x38, 0x70, + 0x73, 0x54, 0x2f, 0x6f, 0x52, 0x4f, 0x68, 0x55, 0x56, 0x52, 0x73, 0x50, + 0x4e, 0x48, 0x34, 0x4e, 0x62, 0x4c, 0x55, 0x45, 0x53, 0x37, 0x56, 0x42, + 0x6e, 0x51, 0x52, 0x4d, 0x39, 0x49, 0x61, 0x75, 0x55, 0x69, 0x71, 0x70, + 0x4f, 0x0a, 0x66, 0x4d, 0x47, 0x78, 0x2b, 0x36, 0x66, 0x57, 0x74, 0x53, + 0x63, 0x76, 0x6c, 0x36, 0x74, 0x75, 0x34, 0x42, 0x33, 0x69, 0x30, 0x52, + 0x77, 0x73, 0x48, 0x30, 0x54, 0x69, 0x2f, 0x4c, 0x36, 0x52, 0x6f, 0x5a, + 0x7a, 0x37, 0x31, 0x69, 0x6c, 0x54, 0x63, 0x34, 0x61, 0x66, 0x55, 0x39, + 0x68, 0x44, 0x44, 0x6c, 0x33, 0x57, 0x59, 0x34, 0x4a, 0x78, 0x48, 0x59, + 0x42, 0x30, 0x79, 0x76, 0x62, 0x69, 0x0a, 0x41, 0x6d, 0x76, 0x5a, 0x57, + 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, + 0x41, 0x31, 0x31, 0x20, 0x4f, 0x3d, 0x4a, 0x61, 0x70, 0x61, 0x6e, 0x20, + 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2c, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, + 0x65, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, + 0x31, 0x31, 0x20, 0x4f, 0x3d, 0x4a, 0x61, 0x70, 0x61, 0x6e, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x2c, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x31, 0x31, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x37, 0x3a, 0x35, 0x32, 0x3a, + 0x37, 0x34, 0x3a, 0x65, 0x32, 0x3a, 0x39, 0x32, 0x3a, 0x62, 0x34, 0x3a, + 0x38, 0x30, 0x3a, 0x39, 0x33, 0x3a, 0x66, 0x32, 0x3a, 0x37, 0x35, 0x3a, + 0x65, 0x34, 0x3a, 0x63, 0x63, 0x3a, 0x64, 0x37, 0x3a, 0x66, 0x32, 0x3a, + 0x65, 0x61, 0x3a, 0x32, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x33, 0x62, 0x3a, 0x63, 0x34, 0x3a, 0x39, 0x66, 0x3a, 0x34, + 0x38, 0x3a, 0x66, 0x38, 0x3a, 0x66, 0x33, 0x3a, 0x37, 0x33, 0x3a, 0x61, + 0x30, 0x3a, 0x39, 0x63, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x64, 0x3a, 0x66, + 0x38, 0x3a, 0x35, 0x62, 0x3a, 0x62, 0x31, 0x3a, 0x63, 0x33, 0x3a, 0x36, + 0x35, 0x3a, 0x63, 0x37, 0x3a, 0x64, 0x38, 0x3a, 0x31, 0x31, 0x3a, 0x62, + 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x62, 0x66, 0x3a, 0x30, 0x66, 0x3a, 0x65, 0x65, 0x3a, 0x66, 0x62, 0x3a, + 0x39, 0x65, 0x3a, 0x33, 0x61, 0x3a, 0x35, 0x38, 0x3a, 0x31, 0x61, 0x3a, + 0x64, 0x35, 0x3a, 0x66, 0x39, 0x3a, 0x65, 0x39, 0x3a, 0x64, 0x62, 0x3a, + 0x37, 0x35, 0x3a, 0x38, 0x39, 0x3a, 0x39, 0x38, 0x3a, 0x35, 0x37, 0x3a, + 0x34, 0x33, 0x3a, 0x64, 0x32, 0x3a, 0x36, 0x31, 0x3a, 0x30, 0x38, 0x3a, + 0x35, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x33, 0x31, 0x3a, 0x34, 0x66, 0x3a, + 0x36, 0x66, 0x3a, 0x35, 0x64, 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x39, 0x3a, + 0x61, 0x61, 0x3a, 0x34, 0x32, 0x3a, 0x31, 0x36, 0x3a, 0x31, 0x32, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x62, 0x54, 0x43, 0x43, + 0x41, 0x6c, 0x57, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, + 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x59, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x4b, 0x55, 0x44, 0x45, 0x72, 0x0a, 0x4d, 0x43, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x69, 0x53, 0x6d, 0x46, + 0x77, 0x59, 0x57, 0x34, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, + 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, + 0x54, 0x5a, 0x58, 0x4a, 0x32, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x79, 0x77, + 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x63, 0x4d, 0x42, 0x6f, + 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x54, 0x55, 0x32, + 0x56, 0x6a, 0x64, 0x58, 0x4a, 0x6c, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, + 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x51, 0x30, 0x45, 0x78, 0x4d, 0x54, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x54, 0x41, 0x30, 0x4d, 0x44, + 0x67, 0x77, 0x4e, 0x44, 0x55, 0x32, 0x4e, 0x44, 0x64, 0x61, 0x46, 0x77, + 0x30, 0x79, 0x4f, 0x54, 0x41, 0x30, 0x0a, 0x4d, 0x44, 0x67, 0x77, 0x4e, + 0x44, 0x55, 0x32, 0x4e, 0x44, 0x64, 0x61, 0x4d, 0x46, 0x67, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x70, 0x51, 0x4d, 0x53, 0x73, 0x77, 0x4b, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x45, 0x79, 0x4a, 0x4b, 0x59, 0x58, 0x42, 0x68, 0x62, + 0x69, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x0a, + 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x46, 0x4e, 0x6c, + 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x4c, 0x43, 0x42, 0x4a, + 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x52, 0x77, 0x77, 0x47, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x4e, 0x54, 0x5a, 0x57, 0x4e, 0x31, + 0x63, 0x6d, 0x56, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x52, 0x44, 0x0a, 0x51, 0x54, 0x45, 0x78, 0x4d, 0x49, 0x49, + 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, + 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, + 0x43, 0x41, 0x51, 0x45, 0x41, 0x2f, 0x58, 0x65, 0x71, 0x70, 0x52, 0x79, + 0x51, 0x42, 0x54, 0x76, 0x4c, 0x54, 0x4a, 0x73, 0x7a, 0x0a, 0x69, 0x31, + 0x6f, 0x55, 0x52, 0x61, 0x54, 0x6e, 0x6b, 0x42, 0x62, 0x52, 0x33, 0x31, + 0x66, 0x53, 0x49, 0x52, 0x43, 0x6b, 0x46, 0x2f, 0x33, 0x66, 0x72, 0x4e, + 0x59, 0x66, 0x70, 0x2b, 0x54, 0x62, 0x66, 0x50, 0x66, 0x73, 0x33, 0x37, + 0x67, 0x44, 0x32, 0x70, 0x52, 0x59, 0x2f, 0x56, 0x31, 0x79, 0x66, 0x49, + 0x77, 0x2f, 0x58, 0x77, 0x46, 0x6e, 0x64, 0x42, 0x57, 0x57, 0x34, 0x77, + 0x49, 0x38, 0x0a, 0x68, 0x39, 0x75, 0x75, 0x79, 0x77, 0x47, 0x4f, 0x77, + 0x76, 0x4e, 0x6d, 0x78, 0x6f, 0x56, 0x46, 0x39, 0x41, 0x4c, 0x47, 0x4f, + 0x72, 0x56, 0x69, 0x73, 0x71, 0x2f, 0x36, 0x6e, 0x4c, 0x2b, 0x6b, 0x35, + 0x74, 0x53, 0x41, 0x4d, 0x4a, 0x6a, 0x7a, 0x44, 0x62, 0x61, 0x54, 0x6a, + 0x36, 0x6e, 0x55, 0x32, 0x44, 0x62, 0x79, 0x73, 0x50, 0x79, 0x4b, 0x79, + 0x69, 0x79, 0x68, 0x46, 0x54, 0x4f, 0x56, 0x0a, 0x4d, 0x64, 0x72, 0x41, + 0x47, 0x2f, 0x4c, 0x75, 0x59, 0x70, 0x6d, 0x47, 0x59, 0x7a, 0x2b, 0x2f, + 0x33, 0x5a, 0x4d, 0x71, 0x67, 0x36, 0x68, 0x32, 0x75, 0x52, 0x4d, 0x66, + 0x74, 0x38, 0x35, 0x4f, 0x51, 0x6f, 0x57, 0x50, 0x49, 0x75, 0x63, 0x75, + 0x47, 0x76, 0x4b, 0x56, 0x43, 0x62, 0x49, 0x46, 0x74, 0x55, 0x52, 0x4f, + 0x64, 0x36, 0x45, 0x67, 0x76, 0x61, 0x6e, 0x79, 0x54, 0x67, 0x70, 0x39, + 0x0a, 0x55, 0x4b, 0x33, 0x31, 0x42, 0x51, 0x31, 0x46, 0x54, 0x30, 0x5a, + 0x78, 0x2f, 0x53, 0x67, 0x2b, 0x55, 0x2f, 0x73, 0x45, 0x32, 0x43, 0x33, + 0x58, 0x5a, 0x52, 0x31, 0x4b, 0x47, 0x2f, 0x72, 0x50, 0x4f, 0x37, 0x41, + 0x78, 0x6d, 0x6a, 0x56, 0x75, 0x79, 0x49, 0x73, 0x47, 0x30, 0x77, 0x43, + 0x52, 0x38, 0x70, 0x51, 0x49, 0x5a, 0x55, 0x79, 0x78, 0x4e, 0x41, 0x59, + 0x41, 0x65, 0x6f, 0x6e, 0x69, 0x0a, 0x38, 0x4d, 0x63, 0x44, 0x57, 0x63, + 0x2f, 0x56, 0x31, 0x75, 0x69, 0x6e, 0x4d, 0x72, 0x50, 0x6d, 0x6d, 0x45, + 0x43, 0x47, 0x78, 0x63, 0x30, 0x6e, 0x45, 0x6f, 0x76, 0x4d, 0x65, 0x38, + 0x36, 0x33, 0x45, 0x54, 0x78, 0x69, 0x59, 0x41, 0x63, 0x6a, 0x50, 0x69, + 0x74, 0x41, 0x62, 0x70, 0x53, 0x41, 0x43, 0x57, 0x32, 0x32, 0x73, 0x32, + 0x39, 0x33, 0x62, 0x7a, 0x55, 0x49, 0x55, 0x50, 0x73, 0x43, 0x0a, 0x68, + 0x38, 0x55, 0x2b, 0x69, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, + 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x57, 0x2f, 0x68, 0x4e, 0x54, + 0x37, 0x4b, 0x6c, 0x68, 0x74, 0x51, 0x36, 0x30, 0x76, 0x46, 0x6a, 0x6d, + 0x71, 0x43, 0x2b, 0x43, 0x66, 0x5a, 0x58, 0x74, 0x39, 0x34, 0x77, 0x44, + 0x67, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, + 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, + 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, + 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x0a, 0x41, 0x4b, 0x43, + 0x68, 0x4f, 0x42, 0x5a, 0x6d, 0x4c, 0x71, 0x64, 0x57, 0x48, 0x79, 0x47, + 0x63, 0x42, 0x76, 0x6f, 0x64, 0x37, 0x62, 0x6b, 0x69, 0x78, 0x54, 0x67, + 0x6d, 0x32, 0x45, 0x35, 0x50, 0x37, 0x4b, 0x4e, 0x2f, 0x65, 0x64, 0x35, + 0x47, 0x49, 0x61, 0x47, 0x48, 0x64, 0x34, 0x38, 0x48, 0x43, 0x4a, 0x71, + 0x79, 0x70, 0x4d, 0x57, 0x76, 0x44, 0x7a, 0x4b, 0x59, 0x43, 0x33, 0x78, + 0x6d, 0x0a, 0x4b, 0x62, 0x61, 0x62, 0x66, 0x53, 0x56, 0x53, 0x53, 0x55, + 0x4f, 0x72, 0x54, 0x43, 0x34, 0x72, 0x62, 0x6e, 0x70, 0x77, 0x72, 0x78, + 0x59, 0x4f, 0x34, 0x77, 0x4a, 0x73, 0x2b, 0x30, 0x4c, 0x6d, 0x47, 0x4a, + 0x31, 0x46, 0x32, 0x46, 0x58, 0x49, 0x36, 0x44, 0x76, 0x64, 0x35, 0x2b, + 0x48, 0x30, 0x4c, 0x67, 0x73, 0x63, 0x4e, 0x46, 0x78, 0x73, 0x57, 0x45, + 0x72, 0x37, 0x6a, 0x49, 0x68, 0x51, 0x0a, 0x58, 0x35, 0x55, 0x63, 0x76, + 0x2b, 0x32, 0x72, 0x49, 0x72, 0x56, 0x6c, 0x73, 0x34, 0x57, 0x36, 0x6e, + 0x67, 0x2b, 0x34, 0x72, 0x65, 0x56, 0x36, 0x47, 0x34, 0x70, 0x51, 0x4f, + 0x68, 0x32, 0x39, 0x44, 0x62, 0x78, 0x37, 0x56, 0x46, 0x41, 0x4c, 0x75, + 0x55, 0x4b, 0x76, 0x56, 0x61, 0x41, 0x59, 0x67, 0x61, 0x31, 0x6c, 0x6d, + 0x65, 0x2b, 0x2b, 0x35, 0x4a, 0x79, 0x2f, 0x78, 0x49, 0x57, 0x72, 0x0a, + 0x51, 0x62, 0x4a, 0x55, 0x62, 0x39, 0x77, 0x6c, 0x7a, 0x65, 0x31, 0x34, + 0x34, 0x6f, 0x34, 0x4d, 0x6a, 0x51, 0x6c, 0x4a, 0x33, 0x57, 0x4e, 0x37, + 0x57, 0x6d, 0x6d, 0x57, 0x41, 0x69, 0x47, 0x6f, 0x76, 0x56, 0x4a, 0x5a, + 0x36, 0x58, 0x30, 0x31, 0x79, 0x38, 0x68, 0x53, 0x79, 0x6e, 0x2b, 0x42, + 0x2f, 0x74, 0x6c, 0x72, 0x30, 0x2f, 0x63, 0x52, 0x37, 0x53, 0x58, 0x66, + 0x2b, 0x4f, 0x66, 0x35, 0x0a, 0x70, 0x50, 0x70, 0x79, 0x6c, 0x34, 0x52, + 0x54, 0x44, 0x61, 0x58, 0x51, 0x4d, 0x68, 0x68, 0x52, 0x64, 0x6c, 0x6b, + 0x55, 0x62, 0x41, 0x2f, 0x72, 0x37, 0x46, 0x2b, 0x41, 0x6a, 0x48, 0x56, + 0x44, 0x67, 0x38, 0x4f, 0x46, 0x6d, 0x50, 0x39, 0x4d, 0x6e, 0x69, 0x30, + 0x4e, 0x35, 0x48, 0x65, 0x44, 0x6b, 0x30, 0x36, 0x31, 0x6c, 0x67, 0x65, + 0x4c, 0x4b, 0x42, 0x4f, 0x62, 0x6a, 0x42, 0x6d, 0x4e, 0x0a, 0x51, 0x53, + 0x64, 0x4a, 0x51, 0x4f, 0x37, 0x65, 0x35, 0x69, 0x4e, 0x45, 0x4f, 0x64, + 0x79, 0x68, 0x49, 0x74, 0x61, 0x36, 0x41, 0x2f, 0x49, 0x3d, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, 0x20, + 0x65, 0x2d, 0x53, 0x7a, 0x69, 0x67, 0x6e, 0x6f, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x4f, 0x3d, + 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, 0x20, 0x4c, 0x74, 0x64, + 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, + 0x20, 0x65, 0x2d, 0x53, 0x7a, 0x69, 0x67, 0x6e, 0x6f, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x4f, + 0x3d, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, 0x20, 0x4c, 0x74, + 0x64, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x65, 0x63, 0x20, 0x65, 0x2d, + 0x53, 0x7a, 0x69, 0x67, 0x6e, 0x6f, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x32, 0x30, 0x30, 0x39, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x30, 0x31, 0x34, + 0x37, 0x31, 0x32, 0x37, 0x37, 0x36, 0x31, 0x39, 0x35, 0x37, 0x38, 0x34, + 0x34, 0x37, 0x33, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, + 0x38, 0x3a, 0x34, 0x39, 0x3a, 0x66, 0x34, 0x3a, 0x30, 0x33, 0x3a, 0x62, + 0x63, 0x3a, 0x34, 0x34, 0x3a, 0x32, 0x64, 0x3a, 0x38, 0x33, 0x3a, 0x62, + 0x65, 0x3a, 0x34, 0x38, 0x3a, 0x36, 0x39, 0x3a, 0x37, 0x64, 0x3a, 0x32, + 0x39, 0x3a, 0x36, 0x34, 0x3a, 0x66, 0x63, 0x3a, 0x62, 0x31, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x39, 0x3a, 0x64, 0x66, + 0x3a, 0x37, 0x34, 0x3a, 0x66, 0x65, 0x3a, 0x35, 0x63, 0x3a, 0x66, 0x34, + 0x3a, 0x30, 0x66, 0x3a, 0x34, 0x61, 0x3a, 0x38, 0x30, 0x3a, 0x66, 0x39, + 0x3a, 0x65, 0x33, 0x3a, 0x33, 0x37, 0x3a, 0x37, 0x64, 0x3a, 0x35, 0x34, + 0x3a, 0x64, 0x61, 0x3a, 0x39, 0x31, 0x3a, 0x65, 0x31, 0x3a, 0x30, 0x31, + 0x3a, 0x33, 0x31, 0x3a, 0x38, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x63, 0x3a, 0x35, 0x66, 0x3a, 0x38, + 0x31, 0x3a, 0x66, 0x65, 0x3a, 0x61, 0x35, 0x3a, 0x66, 0x61, 0x3a, 0x62, + 0x38, 0x3a, 0x32, 0x63, 0x3a, 0x36, 0x34, 0x3a, 0x62, 0x66, 0x3a, 0x61, + 0x32, 0x3a, 0x65, 0x61, 0x3a, 0x65, 0x63, 0x3a, 0x61, 0x66, 0x3a, 0x63, + 0x64, 0x3a, 0x65, 0x38, 0x3a, 0x65, 0x30, 0x3a, 0x37, 0x37, 0x3a, 0x66, + 0x63, 0x3a, 0x38, 0x36, 0x3a, 0x32, 0x30, 0x3a, 0x61, 0x37, 0x3a, 0x63, + 0x61, 0x3a, 0x65, 0x35, 0x3a, 0x33, 0x37, 0x3a, 0x31, 0x36, 0x3a, 0x33, + 0x64, 0x3a, 0x66, 0x33, 0x3a, 0x36, 0x65, 0x3a, 0x64, 0x62, 0x3a, 0x66, + 0x33, 0x3a, 0x37, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x45, 0x43, 0x6a, 0x43, 0x43, 0x41, 0x76, 0x4b, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x4a, 0x41, 0x4d, 0x4a, 0x2b, 0x51, 0x77, 0x52, + 0x4f, 0x52, 0x7a, 0x38, 0x5a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, + 0x41, 0x4d, 0x49, 0x47, 0x43, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x49, 0x56, 0x54, + 0x45, 0x52, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x77, + 0x77, 0x49, 0x51, 0x6e, 0x56, 0x6b, 0x59, 0x58, 0x42, 0x6c, 0x63, 0x33, + 0x51, 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x4d, 0x44, 0x55, 0x31, 0x70, 0x59, 0x33, 0x4a, 0x76, 0x63, 0x32, + 0x56, 0x6a, 0x49, 0x45, 0x78, 0x30, 0x0a, 0x5a, 0x43, 0x34, 0x78, 0x4a, + 0x7a, 0x41, 0x6c, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x48, + 0x6b, 0x31, 0x70, 0x59, 0x33, 0x4a, 0x76, 0x63, 0x32, 0x56, 0x6a, 0x49, + 0x47, 0x55, 0x74, 0x55, 0x33, 0x70, 0x70, 0x5a, 0x32, 0x35, 0x76, 0x49, + 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, + 0x6a, 0x41, 0x77, 0x4f, 0x54, 0x45, 0x66, 0x4d, 0x42, 0x30, 0x47, 0x0a, + 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x4a, + 0x41, 0x52, 0x59, 0x51, 0x61, 0x57, 0x35, 0x6d, 0x62, 0x30, 0x42, 0x6c, + 0x4c, 0x58, 0x4e, 0x36, 0x61, 0x57, 0x64, 0x75, 0x62, 0x79, 0x35, 0x6f, + 0x64, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x54, 0x41, 0x32, + 0x4d, 0x54, 0x59, 0x78, 0x4d, 0x54, 0x4d, 0x77, 0x4d, 0x54, 0x68, 0x61, + 0x46, 0x77, 0x30, 0x79, 0x0a, 0x4f, 0x54, 0x45, 0x79, 0x4d, 0x7a, 0x41, + 0x78, 0x4d, 0x54, 0x4d, 0x77, 0x4d, 0x54, 0x68, 0x61, 0x4d, 0x49, 0x47, + 0x43, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x49, 0x56, 0x54, 0x45, 0x52, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x77, 0x77, 0x49, 0x51, 0x6e, 0x56, + 0x6b, 0x59, 0x58, 0x42, 0x6c, 0x63, 0x33, 0x51, 0x78, 0x0a, 0x46, 0x6a, + 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x55, + 0x31, 0x70, 0x59, 0x33, 0x4a, 0x76, 0x63, 0x32, 0x56, 0x6a, 0x49, 0x45, + 0x78, 0x30, 0x5a, 0x43, 0x34, 0x78, 0x4a, 0x7a, 0x41, 0x6c, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x48, 0x6b, 0x31, 0x70, 0x59, 0x33, + 0x4a, 0x76, 0x63, 0x32, 0x56, 0x6a, 0x49, 0x47, 0x55, 0x74, 0x55, 0x33, + 0x70, 0x70, 0x0a, 0x5a, 0x32, 0x35, 0x76, 0x49, 0x46, 0x4a, 0x76, 0x62, + 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4f, + 0x54, 0x45, 0x66, 0x4d, 0x42, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x4a, 0x41, 0x52, 0x59, 0x51, 0x61, + 0x57, 0x35, 0x6d, 0x62, 0x30, 0x42, 0x6c, 0x4c, 0x58, 0x4e, 0x36, 0x61, + 0x57, 0x64, 0x75, 0x62, 0x79, 0x35, 0x6f, 0x0a, 0x64, 0x54, 0x43, 0x43, + 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x4f, 0x6e, 0x34, 0x6a, 0x2f, 0x4e, 0x6a, + 0x72, 0x64, 0x71, 0x47, 0x32, 0x4b, 0x66, 0x67, 0x51, 0x76, 0x76, 0x50, + 0x0a, 0x6b, 0x64, 0x36, 0x6d, 0x4a, 0x76, 0x69, 0x5a, 0x70, 0x57, 0x4e, + 0x77, 0x72, 0x5a, 0x75, 0x75, 0x79, 0x6a, 0x4e, 0x41, 0x66, 0x57, 0x32, + 0x57, 0x62, 0x71, 0x45, 0x4f, 0x52, 0x4f, 0x37, 0x68, 0x45, 0x35, 0x32, + 0x55, 0x51, 0x6c, 0x4b, 0x61, 0x76, 0x58, 0x57, 0x46, 0x64, 0x43, 0x79, + 0x6f, 0x44, 0x68, 0x32, 0x54, 0x74, 0x68, 0x69, 0x33, 0x6a, 0x43, 0x79, + 0x6f, 0x7a, 0x2f, 0x74, 0x63, 0x0a, 0x63, 0x62, 0x6e, 0x61, 0x37, 0x50, + 0x37, 0x6f, 0x66, 0x6f, 0x2f, 0x6b, 0x4c, 0x78, 0x32, 0x79, 0x71, 0x48, + 0x57, 0x48, 0x32, 0x4c, 0x65, 0x68, 0x35, 0x54, 0x76, 0x50, 0x6d, 0x55, + 0x70, 0x47, 0x30, 0x49, 0x4d, 0x5a, 0x66, 0x63, 0x43, 0x68, 0x45, 0x68, + 0x79, 0x56, 0x62, 0x55, 0x72, 0x30, 0x32, 0x4d, 0x65, 0x6c, 0x54, 0x54, + 0x4d, 0x75, 0x68, 0x54, 0x6c, 0x41, 0x64, 0x58, 0x34, 0x55, 0x0a, 0x66, + 0x49, 0x41, 0x53, 0x6d, 0x46, 0x44, 0x48, 0x51, 0x57, 0x65, 0x34, 0x6f, + 0x49, 0x42, 0x68, 0x56, 0x4b, 0x5a, 0x73, 0x54, 0x68, 0x2f, 0x67, 0x6e, + 0x51, 0x34, 0x48, 0x36, 0x63, 0x6d, 0x36, 0x4d, 0x2b, 0x66, 0x2b, 0x77, + 0x46, 0x55, 0x6f, 0x4c, 0x41, 0x4b, 0x41, 0x70, 0x78, 0x6e, 0x31, 0x6e, + 0x74, 0x78, 0x56, 0x55, 0x77, 0x4f, 0x58, 0x65, 0x77, 0x64, 0x49, 0x2f, + 0x35, 0x6e, 0x37, 0x0a, 0x4e, 0x34, 0x6f, 0x6b, 0x78, 0x46, 0x6e, 0x4d, + 0x55, 0x42, 0x42, 0x6a, 0x6a, 0x71, 0x71, 0x70, 0x47, 0x72, 0x43, 0x45, + 0x47, 0x6f, 0x62, 0x35, 0x58, 0x37, 0x75, 0x78, 0x55, 0x47, 0x36, 0x6b, + 0x30, 0x51, 0x72, 0x4d, 0x31, 0x58, 0x46, 0x2b, 0x48, 0x36, 0x63, 0x62, + 0x66, 0x50, 0x56, 0x54, 0x62, 0x69, 0x4a, 0x66, 0x79, 0x79, 0x76, 0x6d, + 0x31, 0x48, 0x78, 0x64, 0x72, 0x74, 0x62, 0x43, 0x0a, 0x78, 0x6b, 0x7a, + 0x6c, 0x42, 0x51, 0x48, 0x5a, 0x37, 0x56, 0x66, 0x38, 0x77, 0x53, 0x4e, + 0x35, 0x2f, 0x50, 0x72, 0x49, 0x4a, 0x49, 0x4f, 0x56, 0x38, 0x37, 0x56, + 0x71, 0x55, 0x51, 0x48, 0x51, 0x64, 0x39, 0x62, 0x70, 0x45, 0x71, 0x48, + 0x35, 0x47, 0x6f, 0x50, 0x37, 0x67, 0x68, 0x75, 0x35, 0x73, 0x4a, 0x66, + 0x30, 0x64, 0x67, 0x59, 0x7a, 0x51, 0x30, 0x6d, 0x67, 0x2f, 0x77, 0x75, + 0x31, 0x0a, 0x2b, 0x72, 0x55, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, + 0x4f, 0x42, 0x67, 0x44, 0x42, 0x2b, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, + 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x64, 0x44, + 0x67, 0x51, 0x57, 0x42, 0x42, 0x54, 0x4c, 0x44, 0x38, 0x62, 0x66, 0x51, + 0x6b, 0x50, 0x4d, 0x50, 0x63, 0x75, 0x31, 0x53, 0x43, 0x4f, 0x68, 0x47, + 0x6e, 0x71, 0x6d, 0x4b, 0x72, 0x73, 0x30, 0x61, 0x44, 0x41, 0x66, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, + 0x42, 0x54, 0x4c, 0x44, 0x38, 0x62, 0x66, 0x51, 0x6b, 0x50, 0x4d, 0x0a, + 0x50, 0x63, 0x75, 0x31, 0x53, 0x43, 0x4f, 0x68, 0x47, 0x6e, 0x71, 0x6d, + 0x4b, 0x72, 0x73, 0x30, 0x61, 0x44, 0x41, 0x62, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x52, 0x45, 0x45, 0x46, 0x44, 0x41, 0x53, 0x67, 0x52, 0x42, 0x70, + 0x62, 0x6d, 0x5a, 0x76, 0x51, 0x47, 0x55, 0x74, 0x63, 0x33, 0x70, 0x70, + 0x5a, 0x32, 0x35, 0x76, 0x4c, 0x6d, 0x68, 0x31, 0x4d, 0x41, 0x30, 0x47, + 0x43, 0x53, 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x44, + 0x4a, 0x30, 0x51, 0x35, 0x65, 0x4c, 0x74, 0x58, 0x4d, 0x73, 0x33, 0x77, + 0x2b, 0x79, 0x2f, 0x77, 0x39, 0x2f, 0x77, 0x30, 0x6f, 0x6c, 0x5a, 0x4d, + 0x45, 0x79, 0x4c, 0x2f, 0x61, 0x7a, 0x58, 0x6d, 0x34, 0x51, 0x35, 0x44, + 0x77, 0x70, 0x4c, 0x37, 0x76, 0x38, 0x75, 0x38, 0x68, 0x0a, 0x6d, 0x4c, + 0x7a, 0x55, 0x31, 0x46, 0x30, 0x47, 0x39, 0x75, 0x35, 0x43, 0x37, 0x44, + 0x42, 0x73, 0x6f, 0x4b, 0x71, 0x70, 0x79, 0x76, 0x47, 0x76, 0x69, 0x76, + 0x6f, 0x2f, 0x43, 0x33, 0x4e, 0x71, 0x50, 0x75, 0x6f, 0x75, 0x51, 0x48, + 0x34, 0x66, 0x72, 0x6c, 0x52, 0x68, 0x65, 0x65, 0x73, 0x75, 0x43, 0x44, + 0x66, 0x58, 0x49, 0x2f, 0x4f, 0x4d, 0x6e, 0x37, 0x34, 0x64, 0x73, 0x65, + 0x47, 0x6b, 0x0a, 0x64, 0x64, 0x75, 0x67, 0x34, 0x6c, 0x51, 0x55, 0x73, + 0x62, 0x6f, 0x63, 0x4b, 0x61, 0x51, 0x59, 0x39, 0x68, 0x4b, 0x36, 0x6f, + 0x68, 0x51, 0x55, 0x34, 0x7a, 0x45, 0x31, 0x79, 0x45, 0x44, 0x2f, 0x74, + 0x2b, 0x41, 0x46, 0x64, 0x6c, 0x66, 0x42, 0x48, 0x46, 0x6e, 0x79, 0x2b, + 0x4c, 0x2f, 0x6b, 0x37, 0x53, 0x56, 0x69, 0x58, 0x49, 0x54, 0x77, 0x66, + 0x6e, 0x34, 0x66, 0x73, 0x37, 0x37, 0x35, 0x0a, 0x74, 0x79, 0x45, 0x52, + 0x7a, 0x41, 0x4d, 0x42, 0x56, 0x6e, 0x43, 0x6e, 0x45, 0x4a, 0x49, 0x65, + 0x47, 0x7a, 0x53, 0x42, 0x48, 0x71, 0x32, 0x63, 0x47, 0x73, 0x4d, 0x45, + 0x50, 0x4f, 0x30, 0x43, 0x59, 0x64, 0x59, 0x65, 0x42, 0x76, 0x4e, 0x66, + 0x4f, 0x6f, 0x66, 0x79, 0x4b, 0x2f, 0x46, 0x46, 0x68, 0x2b, 0x55, 0x39, + 0x72, 0x4e, 0x48, 0x48, 0x56, 0x34, 0x53, 0x39, 0x61, 0x36, 0x37, 0x63, + 0x0a, 0x32, 0x50, 0x6d, 0x32, 0x47, 0x32, 0x4a, 0x77, 0x43, 0x7a, 0x30, + 0x32, 0x79, 0x55, 0x4c, 0x79, 0x4d, 0x74, 0x64, 0x36, 0x59, 0x65, 0x62, + 0x53, 0x32, 0x7a, 0x33, 0x50, 0x79, 0x4b, 0x6e, 0x4a, 0x6d, 0x39, 0x7a, + 0x62, 0x57, 0x45, 0x54, 0x58, 0x62, 0x7a, 0x69, 0x76, 0x66, 0x33, 0x6a, + 0x54, 0x6f, 0x36, 0x30, 0x61, 0x64, 0x62, 0x6f, 0x63, 0x77, 0x54, 0x5a, + 0x38, 0x6a, 0x78, 0x35, 0x74, 0x0a, 0x48, 0x4d, 0x4e, 0x31, 0x52, 0x71, + 0x34, 0x31, 0x42, 0x61, 0x62, 0x32, 0x58, 0x44, 0x30, 0x68, 0x37, 0x6c, + 0x62, 0x77, 0x79, 0x59, 0x49, 0x69, 0x4c, 0x58, 0x70, 0x55, 0x71, 0x33, + 0x44, 0x44, 0x66, 0x53, 0x4a, 0x6c, 0x67, 0x6e, 0x43, 0x57, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x2d, 0x20, 0x52, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x55, 0x3d, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x33, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x33, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x38, 0x33, 0x35, + 0x37, 0x30, 0x33, 0x32, 0x37, 0x38, 0x34, 0x35, 0x39, 0x37, 0x35, 0x39, + 0x34, 0x32, 0x36, 0x32, 0x30, 0x39, 0x39, 0x35, 0x34, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x35, 0x3a, 0x64, 0x66, 0x3a, 0x62, + 0x38, 0x3a, 0x34, 0x39, 0x3a, 0x63, 0x61, 0x3a, 0x30, 0x35, 0x3a, 0x31, + 0x33, 0x3a, 0x35, 0x35, 0x3a, 0x65, 0x65, 0x3a, 0x32, 0x64, 0x3a, 0x62, + 0x61, 0x3a, 0x31, 0x61, 0x3a, 0x63, 0x33, 0x3a, 0x33, 0x65, 0x3a, 0x62, + 0x30, 0x3a, 0x32, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x64, 0x36, 0x3a, 0x39, 0x62, 0x3a, 0x35, 0x36, 0x3a, 0x31, 0x31, + 0x3a, 0x34, 0x38, 0x3a, 0x66, 0x30, 0x3a, 0x31, 0x63, 0x3a, 0x37, 0x37, + 0x3a, 0x63, 0x35, 0x3a, 0x34, 0x35, 0x3a, 0x37, 0x38, 0x3a, 0x63, 0x31, + 0x3a, 0x30, 0x39, 0x3a, 0x32, 0x36, 0x3a, 0x64, 0x66, 0x3a, 0x35, 0x62, + 0x3a, 0x38, 0x35, 0x3a, 0x36, 0x39, 0x3a, 0x37, 0x36, 0x3a, 0x61, 0x64, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, + 0x62, 0x3a, 0x62, 0x35, 0x3a, 0x32, 0x32, 0x3a, 0x64, 0x37, 0x3a, 0x62, + 0x37, 0x3a, 0x66, 0x31, 0x3a, 0x32, 0x37, 0x3a, 0x61, 0x64, 0x3a, 0x36, + 0x61, 0x3a, 0x30, 0x31, 0x3a, 0x31, 0x33, 0x3a, 0x38, 0x36, 0x3a, 0x35, + 0x62, 0x3a, 0x64, 0x66, 0x3a, 0x31, 0x63, 0x3a, 0x64, 0x34, 0x3a, 0x31, + 0x30, 0x3a, 0x32, 0x65, 0x3a, 0x37, 0x64, 0x3a, 0x30, 0x37, 0x3a, 0x35, + 0x39, 0x3a, 0x61, 0x66, 0x3a, 0x36, 0x33, 0x3a, 0x35, 0x61, 0x3a, 0x37, + 0x63, 0x3a, 0x66, 0x34, 0x3a, 0x37, 0x32, 0x3a, 0x30, 0x64, 0x3a, 0x63, + 0x39, 0x3a, 0x36, 0x33, 0x3a, 0x63, 0x35, 0x3a, 0x33, 0x62, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x58, 0x7a, 0x43, 0x43, 0x41, + 0x6b, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4c, 0x42, + 0x41, 0x41, 0x41, 0x41, 0x41, 0x41, 0x42, 0x49, 0x56, 0x68, 0x54, 0x43, + 0x4b, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x54, + 0x44, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x78, 0x4d, 0x58, 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, + 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, + 0x49, 0x45, 0x4e, 0x42, 0x49, 0x43, 0x30, 0x67, 0x55, 0x6a, 0x4d, 0x78, + 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, + 0x43, 0x6b, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x46, 0x4e, 0x70, + 0x0a, 0x5a, 0x32, 0x34, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x4d, 0x54, 0x43, 0x6b, 0x64, 0x73, 0x62, 0x32, 0x4a, + 0x68, 0x62, 0x46, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x77, 0x48, 0x68, 0x63, + 0x4e, 0x4d, 0x44, 0x6b, 0x77, 0x4d, 0x7a, 0x45, 0x34, 0x4d, 0x54, 0x41, + 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x6b, + 0x77, 0x4d, 0x7a, 0x45, 0x34, 0x0a, 0x4d, 0x54, 0x41, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x57, 0x6a, 0x42, 0x4d, 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x64, 0x48, 0x62, 0x47, + 0x39, 0x69, 0x59, 0x57, 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, + 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, 0x53, + 0x42, 0x53, 0x4d, 0x7a, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, 0x0a, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4b, 0x52, 0x32, 0x78, 0x76, 0x59, + 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x6a, 0x45, 0x54, 0x4d, + 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4b, 0x52, + 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, + 0x6a, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, + 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, + 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4d, 0x77, 0x6c, + 0x64, 0x70, 0x42, 0x35, 0x42, 0x6e, 0x67, 0x69, 0x46, 0x76, 0x58, 0x41, + 0x67, 0x37, 0x61, 0x45, 0x79, 0x69, 0x69, 0x65, 0x2f, 0x51, 0x56, 0x32, + 0x45, 0x63, 0x57, 0x74, 0x69, 0x48, 0x4c, 0x38, 0x0a, 0x52, 0x67, 0x4a, + 0x44, 0x78, 0x37, 0x4b, 0x4b, 0x6e, 0x51, 0x52, 0x66, 0x4a, 0x4d, 0x73, + 0x75, 0x53, 0x2b, 0x46, 0x67, 0x67, 0x6b, 0x62, 0x68, 0x55, 0x71, 0x73, + 0x4d, 0x67, 0x55, 0x64, 0x77, 0x62, 0x4e, 0x31, 0x6b, 0x30, 0x65, 0x76, + 0x31, 0x4c, 0x4b, 0x4d, 0x50, 0x67, 0x6a, 0x30, 0x4d, 0x4b, 0x36, 0x36, + 0x58, 0x31, 0x37, 0x59, 0x55, 0x68, 0x68, 0x42, 0x35, 0x75, 0x7a, 0x73, + 0x54, 0x0a, 0x67, 0x48, 0x65, 0x4d, 0x43, 0x4f, 0x46, 0x4a, 0x30, 0x6d, + 0x70, 0x69, 0x4c, 0x78, 0x39, 0x65, 0x2b, 0x70, 0x5a, 0x6f, 0x33, 0x34, + 0x6b, 0x6e, 0x6c, 0x54, 0x69, 0x66, 0x42, 0x74, 0x63, 0x2b, 0x79, 0x63, + 0x73, 0x6d, 0x57, 0x51, 0x31, 0x7a, 0x33, 0x72, 0x44, 0x49, 0x36, 0x53, + 0x59, 0x4f, 0x67, 0x78, 0x58, 0x47, 0x37, 0x31, 0x75, 0x4c, 0x30, 0x67, + 0x52, 0x67, 0x79, 0x6b, 0x6d, 0x6d, 0x0a, 0x4b, 0x50, 0x5a, 0x70, 0x4f, + 0x2f, 0x62, 0x4c, 0x79, 0x43, 0x69, 0x52, 0x35, 0x5a, 0x32, 0x4b, 0x59, + 0x56, 0x63, 0x33, 0x72, 0x48, 0x51, 0x55, 0x33, 0x48, 0x54, 0x67, 0x4f, + 0x75, 0x35, 0x79, 0x4c, 0x79, 0x36, 0x63, 0x2b, 0x39, 0x43, 0x37, 0x76, + 0x2f, 0x55, 0x39, 0x41, 0x4f, 0x45, 0x47, 0x4d, 0x2b, 0x69, 0x43, 0x4b, + 0x36, 0x35, 0x54, 0x70, 0x6a, 0x6f, 0x57, 0x63, 0x34, 0x7a, 0x64, 0x0a, + 0x51, 0x51, 0x34, 0x67, 0x4f, 0x73, 0x43, 0x30, 0x70, 0x36, 0x48, 0x70, + 0x73, 0x6b, 0x2b, 0x51, 0x4c, 0x6a, 0x4a, 0x67, 0x36, 0x56, 0x66, 0x4c, + 0x75, 0x51, 0x53, 0x53, 0x61, 0x47, 0x6a, 0x6c, 0x4f, 0x43, 0x5a, 0x67, + 0x64, 0x62, 0x4b, 0x66, 0x64, 0x2f, 0x2b, 0x52, 0x46, 0x4f, 0x2b, 0x75, + 0x49, 0x45, 0x6e, 0x38, 0x72, 0x55, 0x41, 0x56, 0x53, 0x4e, 0x45, 0x43, + 0x4d, 0x57, 0x45, 0x5a, 0x0a, 0x58, 0x72, 0x69, 0x58, 0x37, 0x36, 0x31, + 0x33, 0x74, 0x32, 0x53, 0x61, 0x65, 0x72, 0x39, 0x66, 0x77, 0x52, 0x50, + 0x76, 0x6d, 0x32, 0x4c, 0x37, 0x44, 0x57, 0x7a, 0x67, 0x56, 0x47, 0x6b, + 0x57, 0x71, 0x51, 0x50, 0x61, 0x62, 0x75, 0x6d, 0x44, 0x6b, 0x33, 0x46, + 0x32, 0x78, 0x6d, 0x6d, 0x46, 0x67, 0x68, 0x63, 0x43, 0x41, 0x77, 0x45, + 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x0a, 0x44, 0x67, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x49, 0x2f, 0x77, 0x53, 0x33, + 0x2b, 0x6f, 0x0a, 0x4c, 0x6b, 0x55, 0x6b, 0x72, 0x6b, 0x31, 0x51, 0x2b, + 0x6d, 0x4f, 0x61, 0x69, 0x39, 0x37, 0x69, 0x33, 0x52, 0x75, 0x38, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, + 0x51, 0x42, 0x4c, 0x51, 0x4e, 0x76, 0x41, 0x55, 0x4b, 0x72, 0x2b, 0x79, + 0x41, 0x7a, 0x76, 0x39, 0x35, 0x5a, 0x55, 0x0a, 0x52, 0x55, 0x6d, 0x37, + 0x6c, 0x67, 0x41, 0x4a, 0x51, 0x61, 0x79, 0x7a, 0x45, 0x34, 0x61, 0x47, + 0x4b, 0x41, 0x63, 0x7a, 0x79, 0x6d, 0x76, 0x6d, 0x64, 0x4c, 0x6d, 0x36, + 0x41, 0x43, 0x32, 0x75, 0x70, 0x41, 0x72, 0x54, 0x39, 0x66, 0x48, 0x78, + 0x44, 0x34, 0x71, 0x2f, 0x63, 0x32, 0x64, 0x4b, 0x67, 0x38, 0x64, 0x45, + 0x65, 0x33, 0x6a, 0x67, 0x72, 0x32, 0x35, 0x73, 0x62, 0x77, 0x4d, 0x70, + 0x0a, 0x6a, 0x6a, 0x4d, 0x35, 0x52, 0x63, 0x4f, 0x4f, 0x35, 0x4c, 0x6c, + 0x58, 0x62, 0x4b, 0x72, 0x38, 0x45, 0x70, 0x62, 0x73, 0x55, 0x38, 0x59, + 0x74, 0x35, 0x43, 0x52, 0x73, 0x75, 0x5a, 0x52, 0x6a, 0x2b, 0x39, 0x78, + 0x54, 0x61, 0x47, 0x64, 0x57, 0x50, 0x6f, 0x4f, 0x34, 0x7a, 0x7a, 0x55, + 0x68, 0x77, 0x38, 0x6c, 0x6f, 0x2f, 0x73, 0x37, 0x61, 0x77, 0x6c, 0x4f, + 0x71, 0x7a, 0x4a, 0x43, 0x4b, 0x0a, 0x36, 0x66, 0x42, 0x64, 0x52, 0x6f, + 0x79, 0x56, 0x33, 0x58, 0x70, 0x59, 0x4b, 0x42, 0x6f, 0x76, 0x48, 0x64, + 0x37, 0x4e, 0x41, 0x44, 0x64, 0x42, 0x6a, 0x2b, 0x31, 0x45, 0x62, 0x64, + 0x64, 0x54, 0x4b, 0x4a, 0x64, 0x2b, 0x38, 0x32, 0x63, 0x45, 0x48, 0x68, + 0x58, 0x58, 0x69, 0x70, 0x61, 0x30, 0x30, 0x39, 0x35, 0x4d, 0x4a, 0x36, + 0x52, 0x4d, 0x47, 0x33, 0x4e, 0x7a, 0x64, 0x76, 0x51, 0x58, 0x0a, 0x6d, + 0x63, 0x49, 0x66, 0x65, 0x67, 0x37, 0x6a, 0x4c, 0x51, 0x69, 0x74, 0x43, + 0x68, 0x77, 0x73, 0x2f, 0x7a, 0x79, 0x72, 0x56, 0x51, 0x34, 0x50, 0x6b, + 0x58, 0x34, 0x32, 0x36, 0x38, 0x4e, 0x58, 0x53, 0x62, 0x37, 0x68, 0x4c, + 0x69, 0x31, 0x38, 0x59, 0x49, 0x76, 0x44, 0x51, 0x56, 0x45, 0x54, 0x49, + 0x35, 0x33, 0x4f, 0x39, 0x7a, 0x4a, 0x72, 0x6c, 0x41, 0x47, 0x6f, 0x6d, + 0x65, 0x63, 0x73, 0x0a, 0x4d, 0x78, 0x38, 0x36, 0x4f, 0x79, 0x58, 0x53, + 0x68, 0x6b, 0x44, 0x4f, 0x4f, 0x79, 0x79, 0x47, 0x65, 0x4d, 0x6c, 0x68, + 0x4c, 0x78, 0x53, 0x36, 0x37, 0x74, 0x74, 0x56, 0x62, 0x39, 0x2b, 0x45, + 0x37, 0x67, 0x55, 0x4a, 0x54, 0x62, 0x30, 0x6f, 0x32, 0x48, 0x4c, 0x4f, + 0x30, 0x32, 0x4a, 0x51, 0x5a, 0x52, 0x37, 0x72, 0x6b, 0x70, 0x65, 0x44, + 0x4d, 0x64, 0x6d, 0x7a, 0x74, 0x63, 0x70, 0x48, 0x0a, 0x57, 0x44, 0x39, + 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x75, 0x74, 0x6f, 0x72, 0x69, + 0x64, 0x61, 0x64, 0x20, 0x64, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x63, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x69, 0x72, + 0x6d, 0x61, 0x70, 0x72, 0x6f, 0x66, 0x65, 0x73, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x20, 0x43, 0x49, 0x46, 0x20, 0x41, 0x36, 0x32, 0x36, 0x33, 0x34, + 0x30, 0x36, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x75, 0x74, 0x6f, 0x72, 0x69, + 0x64, 0x61, 0x64, 0x20, 0x64, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x63, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x69, 0x72, + 0x6d, 0x61, 0x70, 0x72, 0x6f, 0x66, 0x65, 0x73, 0x69, 0x6f, 0x6e, 0x61, + 0x6c, 0x20, 0x43, 0x49, 0x46, 0x20, 0x41, 0x36, 0x32, 0x36, 0x33, 0x34, + 0x30, 0x36, 0x38, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x41, 0x75, 0x74, 0x6f, 0x72, 0x69, 0x64, 0x61, 0x64, 0x20, + 0x64, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x63, 0x69, 0x6f, 0x6e, 0x20, 0x46, 0x69, 0x72, 0x6d, 0x61, 0x70, 0x72, + 0x6f, 0x66, 0x65, 0x73, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x20, 0x43, 0x49, + 0x46, 0x20, 0x41, 0x36, 0x32, 0x36, 0x33, 0x34, 0x30, 0x36, 0x38, 0x22, + 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, + 0x30, 0x34, 0x37, 0x32, 0x37, 0x34, 0x32, 0x39, 0x37, 0x32, 0x36, 0x32, + 0x37, 0x35, 0x33, 0x38, 0x38, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x37, 0x33, 0x3a, 0x33, 0x61, 0x3a, 0x37, 0x34, 0x3a, 0x37, + 0x61, 0x3a, 0x65, 0x63, 0x3a, 0x62, 0x62, 0x3a, 0x61, 0x33, 0x3a, 0x39, + 0x36, 0x3a, 0x61, 0x36, 0x3a, 0x63, 0x32, 0x3a, 0x65, 0x34, 0x3a, 0x65, + 0x32, 0x3a, 0x63, 0x38, 0x3a, 0x39, 0x62, 0x3a, 0x63, 0x30, 0x3a, 0x63, + 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x65, + 0x3a, 0x63, 0x35, 0x3a, 0x66, 0x62, 0x3a, 0x33, 0x66, 0x3a, 0x63, 0x38, + 0x3a, 0x65, 0x31, 0x3a, 0x62, 0x66, 0x3a, 0x63, 0x34, 0x3a, 0x65, 0x35, + 0x3a, 0x34, 0x66, 0x3a, 0x30, 0x33, 0x3a, 0x30, 0x37, 0x3a, 0x35, 0x61, + 0x3a, 0x39, 0x61, 0x3a, 0x65, 0x38, 0x3a, 0x30, 0x30, 0x3a, 0x62, 0x37, + 0x3a, 0x66, 0x37, 0x3a, 0x62, 0x36, 0x3a, 0x66, 0x61, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x34, 0x3a, 0x30, + 0x34, 0x3a, 0x38, 0x30, 0x3a, 0x32, 0x38, 0x3a, 0x62, 0x66, 0x3a, 0x31, + 0x66, 0x3a, 0x32, 0x38, 0x3a, 0x36, 0x34, 0x3a, 0x64, 0x34, 0x3a, 0x38, + 0x66, 0x3a, 0x39, 0x61, 0x3a, 0x64, 0x34, 0x3a, 0x64, 0x38, 0x3a, 0x33, + 0x32, 0x3a, 0x39, 0x34, 0x3a, 0x33, 0x36, 0x3a, 0x36, 0x61, 0x3a, 0x38, + 0x32, 0x3a, 0x38, 0x38, 0x3a, 0x35, 0x36, 0x3a, 0x35, 0x35, 0x3a, 0x33, + 0x66, 0x3a, 0x33, 0x62, 0x3a, 0x31, 0x34, 0x3a, 0x33, 0x30, 0x3a, 0x33, + 0x66, 0x3a, 0x39, 0x30, 0x3a, 0x31, 0x34, 0x3a, 0x37, 0x66, 0x3a, 0x35, + 0x64, 0x3a, 0x34, 0x30, 0x3a, 0x65, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x47, 0x46, 0x44, 0x43, 0x43, 0x41, 0x2f, 0x79, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x55, 0x2b, 0x77, 0x37, + 0x37, 0x76, 0x75, 0x79, 0x53, 0x46, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, + 0x42, 0x51, 0x41, 0x77, 0x55, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x56, 0x4d, + 0x78, 0x51, 0x6a, 0x42, 0x41, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x4d, 0x4f, 0x55, 0x46, 0x31, 0x64, 0x47, 0x39, 0x79, 0x61, 0x57, 0x52, + 0x68, 0x5a, 0x43, 0x42, 0x6b, 0x5a, 0x53, 0x42, 0x44, 0x5a, 0x58, 0x4a, + 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x6a, 0x61, 0x57, 0x39, + 0x75, 0x49, 0x45, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x68, 0x0a, 0x63, 0x48, + 0x4a, 0x76, 0x5a, 0x6d, 0x56, 0x7a, 0x61, 0x57, 0x39, 0x75, 0x59, 0x57, + 0x77, 0x67, 0x51, 0x30, 0x6c, 0x47, 0x49, 0x45, 0x45, 0x32, 0x4d, 0x6a, + 0x59, 0x7a, 0x4e, 0x44, 0x41, 0x32, 0x4f, 0x44, 0x41, 0x65, 0x46, 0x77, + 0x30, 0x77, 0x4f, 0x54, 0x41, 0x31, 0x4d, 0x6a, 0x41, 0x77, 0x4f, 0x44, + 0x4d, 0x34, 0x4d, 0x54, 0x56, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4d, 0x44, + 0x45, 0x79, 0x0a, 0x4d, 0x7a, 0x45, 0x77, 0x4f, 0x44, 0x4d, 0x34, 0x4d, + 0x54, 0x56, 0x61, 0x4d, 0x46, 0x45, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x56, 0x54, 0x4d, + 0x55, 0x49, 0x77, 0x51, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, + 0x44, 0x6c, 0x42, 0x64, 0x58, 0x52, 0x76, 0x63, 0x6d, 0x6c, 0x6b, 0x59, + 0x57, 0x51, 0x67, 0x5a, 0x47, 0x55, 0x67, 0x0a, 0x51, 0x32, 0x56, 0x79, + 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x59, 0x32, 0x6c, 0x76, + 0x62, 0x69, 0x42, 0x47, 0x61, 0x58, 0x4a, 0x74, 0x59, 0x58, 0x42, 0x79, + 0x62, 0x32, 0x5a, 0x6c, 0x63, 0x32, 0x6c, 0x76, 0x62, 0x6d, 0x46, 0x73, + 0x49, 0x45, 0x4e, 0x4a, 0x52, 0x69, 0x42, 0x42, 0x4e, 0x6a, 0x49, 0x32, + 0x4d, 0x7a, 0x51, 0x77, 0x4e, 0x6a, 0x67, 0x77, 0x67, 0x67, 0x49, 0x69, + 0x0a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, + 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, + 0x43, 0x41, 0x51, 0x44, 0x4b, 0x6c, 0x6d, 0x75, 0x4f, 0x36, 0x76, 0x6a, + 0x37, 0x38, 0x61, 0x49, 0x31, 0x34, 0x48, 0x39, 0x4d, 0x32, 0x75, 0x44, + 0x44, 0x55, 0x74, 0x64, 0x39, 0x0a, 0x74, 0x68, 0x44, 0x49, 0x41, 0x6c, + 0x36, 0x7a, 0x51, 0x79, 0x72, 0x45, 0x54, 0x32, 0x71, 0x79, 0x79, 0x68, + 0x78, 0x64, 0x4b, 0x4a, 0x70, 0x34, 0x45, 0x52, 0x70, 0x70, 0x57, 0x56, + 0x65, 0x76, 0x74, 0x53, 0x42, 0x43, 0x35, 0x49, 0x73, 0x50, 0x35, 0x74, + 0x39, 0x62, 0x70, 0x67, 0x4f, 0x53, 0x4c, 0x2f, 0x55, 0x52, 0x35, 0x47, + 0x4c, 0x58, 0x4d, 0x6e, 0x45, 0x34, 0x32, 0x51, 0x51, 0x4d, 0x0a, 0x63, + 0x61, 0x73, 0x39, 0x55, 0x58, 0x34, 0x50, 0x42, 0x39, 0x39, 0x6a, 0x42, + 0x56, 0x7a, 0x70, 0x76, 0x35, 0x52, 0x76, 0x77, 0x53, 0x6d, 0x43, 0x77, + 0x4c, 0x54, 0x61, 0x55, 0x62, 0x44, 0x42, 0x50, 0x4c, 0x75, 0x74, 0x4e, + 0x30, 0x70, 0x63, 0x79, 0x76, 0x46, 0x4c, 0x4e, 0x67, 0x34, 0x6b, 0x71, + 0x37, 0x2f, 0x44, 0x68, 0x48, 0x66, 0x39, 0x71, 0x46, 0x44, 0x30, 0x73, + 0x65, 0x66, 0x47, 0x0a, 0x4c, 0x39, 0x49, 0x74, 0x57, 0x59, 0x31, 0x36, + 0x43, 0x6b, 0x36, 0x57, 0x61, 0x56, 0x49, 0x43, 0x71, 0x6a, 0x61, 0x59, + 0x37, 0x50, 0x7a, 0x36, 0x46, 0x49, 0x4d, 0x4d, 0x4e, 0x78, 0x2f, 0x4a, + 0x6b, 0x6a, 0x64, 0x2f, 0x31, 0x34, 0x45, 0x74, 0x35, 0x63, 0x53, 0x35, + 0x34, 0x44, 0x34, 0x30, 0x2f, 0x6d, 0x66, 0x30, 0x50, 0x6d, 0x62, 0x52, + 0x30, 0x2f, 0x52, 0x41, 0x7a, 0x31, 0x35, 0x69, 0x0a, 0x4e, 0x41, 0x39, + 0x77, 0x42, 0x6a, 0x34, 0x67, 0x47, 0x46, 0x72, 0x4f, 0x39, 0x33, 0x49, + 0x62, 0x4a, 0x57, 0x79, 0x54, 0x64, 0x42, 0x53, 0x54, 0x6f, 0x33, 0x4f, + 0x78, 0x44, 0x71, 0x71, 0x48, 0x45, 0x43, 0x4e, 0x5a, 0x58, 0x79, 0x41, + 0x46, 0x47, 0x55, 0x66, 0x74, 0x61, 0x49, 0x36, 0x53, 0x45, 0x73, 0x70, + 0x64, 0x2f, 0x4e, 0x59, 0x72, 0x73, 0x70, 0x49, 0x38, 0x49, 0x4d, 0x2f, + 0x68, 0x0a, 0x58, 0x36, 0x38, 0x67, 0x76, 0x71, 0x42, 0x32, 0x66, 0x33, + 0x62, 0x6c, 0x37, 0x42, 0x71, 0x47, 0x59, 0x54, 0x4d, 0x2b, 0x35, 0x33, + 0x75, 0x30, 0x50, 0x36, 0x41, 0x50, 0x6a, 0x71, 0x4b, 0x35, 0x61, 0x6d, + 0x2b, 0x35, 0x68, 0x79, 0x5a, 0x76, 0x51, 0x57, 0x79, 0x49, 0x70, 0x6c, + 0x44, 0x39, 0x61, 0x6d, 0x4d, 0x4c, 0x39, 0x5a, 0x4d, 0x57, 0x47, 0x78, + 0x6d, 0x50, 0x73, 0x75, 0x32, 0x62, 0x0a, 0x6d, 0x38, 0x6d, 0x51, 0x39, + 0x51, 0x45, 0x4d, 0x33, 0x78, 0x6b, 0x39, 0x44, 0x7a, 0x34, 0x34, 0x49, + 0x38, 0x6b, 0x76, 0x6a, 0x77, 0x7a, 0x52, 0x41, 0x76, 0x34, 0x62, 0x56, + 0x64, 0x5a, 0x4f, 0x30, 0x49, 0x30, 0x38, 0x72, 0x30, 0x2b, 0x6b, 0x38, + 0x2f, 0x36, 0x76, 0x4b, 0x74, 0x4d, 0x46, 0x6e, 0x58, 0x6b, 0x49, 0x6f, + 0x63, 0x74, 0x58, 0x4d, 0x62, 0x53, 0x63, 0x79, 0x4a, 0x43, 0x79, 0x0a, + 0x5a, 0x2f, 0x51, 0x59, 0x46, 0x70, 0x4d, 0x36, 0x2f, 0x45, 0x66, 0x59, + 0x30, 0x58, 0x69, 0x57, 0x4d, 0x52, 0x2b, 0x36, 0x4b, 0x77, 0x78, 0x66, + 0x58, 0x5a, 0x6d, 0x74, 0x59, 0x34, 0x6c, 0x61, 0x4a, 0x43, 0x42, 0x32, + 0x32, 0x4e, 0x2f, 0x39, 0x71, 0x30, 0x36, 0x6d, 0x49, 0x71, 0x71, 0x64, + 0x58, 0x75, 0x59, 0x6e, 0x69, 0x6e, 0x31, 0x6f, 0x4b, 0x61, 0x50, 0x6e, + 0x69, 0x72, 0x6a, 0x61, 0x0a, 0x45, 0x62, 0x73, 0x58, 0x4c, 0x5a, 0x6d, + 0x64, 0x45, 0x79, 0x52, 0x47, 0x39, 0x38, 0x58, 0x69, 0x32, 0x4a, 0x2b, + 0x4f, 0x66, 0x38, 0x65, 0x50, 0x64, 0x47, 0x31, 0x61, 0x73, 0x75, 0x68, + 0x79, 0x39, 0x61, 0x7a, 0x75, 0x4a, 0x42, 0x43, 0x74, 0x4c, 0x78, 0x54, + 0x61, 0x2f, 0x79, 0x32, 0x61, 0x52, 0x6e, 0x46, 0x48, 0x76, 0x6b, 0x4c, + 0x66, 0x75, 0x77, 0x48, 0x62, 0x39, 0x48, 0x2f, 0x54, 0x0a, 0x4b, 0x49, + 0x38, 0x78, 0x57, 0x56, 0x76, 0x54, 0x79, 0x51, 0x4b, 0x6d, 0x74, 0x46, + 0x4c, 0x4b, 0x62, 0x70, 0x66, 0x37, 0x51, 0x38, 0x55, 0x49, 0x4a, 0x6d, + 0x2b, 0x4b, 0x39, 0x4c, 0x76, 0x39, 0x6e, 0x79, 0x69, 0x71, 0x44, 0x64, + 0x56, 0x46, 0x38, 0x78, 0x4d, 0x36, 0x48, 0x64, 0x6a, 0x41, 0x65, 0x49, + 0x39, 0x42, 0x5a, 0x7a, 0x77, 0x65, 0x6c, 0x47, 0x53, 0x75, 0x65, 0x77, + 0x76, 0x46, 0x0a, 0x36, 0x4e, 0x6b, 0x42, 0x69, 0x44, 0x6b, 0x61, 0x6c, + 0x34, 0x5a, 0x6b, 0x51, 0x64, 0x55, 0x37, 0x68, 0x77, 0x78, 0x75, 0x2b, + 0x67, 0x2f, 0x47, 0x76, 0x55, 0x67, 0x55, 0x76, 0x7a, 0x6c, 0x4e, 0x31, + 0x4a, 0x35, 0x42, 0x74, 0x6f, 0x2b, 0x57, 0x48, 0x57, 0x4f, 0x57, 0x6b, + 0x39, 0x6d, 0x56, 0x42, 0x6e, 0x67, 0x78, 0x61, 0x4a, 0x34, 0x33, 0x42, + 0x6a, 0x75, 0x41, 0x69, 0x55, 0x56, 0x68, 0x0a, 0x4f, 0x53, 0x50, 0x48, + 0x47, 0x30, 0x53, 0x6a, 0x46, 0x65, 0x55, 0x63, 0x2b, 0x4a, 0x49, 0x77, + 0x75, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x48, 0x76, + 0x4d, 0x49, 0x48, 0x73, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x49, 0x4d, 0x41, 0x59, 0x42, + 0x41, 0x66, 0x38, 0x43, 0x41, 0x51, 0x45, 0x77, 0x44, 0x67, 0x59, 0x44, + 0x0a, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, + 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x6c, 0x7a, 0x65, 0x75, + 0x72, 0x4e, 0x52, 0x34, 0x41, 0x50, 0x6e, 0x37, 0x56, 0x64, 0x4d, 0x41, + 0x63, 0x74, 0x48, 0x4e, 0x48, 0x44, 0x68, 0x70, 0x6b, 0x4c, 0x7a, 0x43, + 0x42, 0x70, 0x67, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, 0x67, 0x42, 0x49, + 0x47, 0x65, 0x4d, 0x49, 0x47, 0x62, 0x4d, 0x49, 0x47, 0x59, 0x42, 0x67, + 0x52, 0x56, 0x48, 0x53, 0x41, 0x41, 0x4d, 0x49, 0x47, 0x50, 0x4d, 0x43, + 0x38, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, + 0x49, 0x42, 0x46, 0x69, 0x4e, 0x6f, 0x64, 0x48, 0x52, 0x77, 0x4f, 0x69, + 0x38, 0x76, 0x64, 0x33, 0x64, 0x33, 0x4c, 0x6d, 0x5a, 0x70, 0x0a, 0x63, + 0x6d, 0x31, 0x68, 0x63, 0x48, 0x4a, 0x76, 0x5a, 0x6d, 0x56, 0x7a, 0x61, + 0x57, 0x39, 0x75, 0x59, 0x57, 0x77, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4c, + 0x32, 0x4e, 0x77, 0x63, 0x7a, 0x42, 0x63, 0x42, 0x67, 0x67, 0x72, 0x42, + 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x43, 0x41, 0x6a, 0x42, 0x51, 0x48, + 0x6b, 0x34, 0x41, 0x55, 0x41, 0x42, 0x68, 0x41, 0x48, 0x4d, 0x41, 0x5a, + 0x51, 0x42, 0x76, 0x0a, 0x41, 0x43, 0x41, 0x41, 0x5a, 0x41, 0x42, 0x6c, + 0x41, 0x43, 0x41, 0x41, 0x62, 0x41, 0x42, 0x68, 0x41, 0x43, 0x41, 0x41, + 0x51, 0x67, 0x42, 0x76, 0x41, 0x47, 0x34, 0x41, 0x59, 0x51, 0x42, 0x75, + 0x41, 0x47, 0x38, 0x41, 0x64, 0x67, 0x42, 0x68, 0x41, 0x43, 0x41, 0x41, + 0x4e, 0x41, 0x41, 0x33, 0x41, 0x43, 0x41, 0x41, 0x51, 0x67, 0x42, 0x68, + 0x41, 0x48, 0x49, 0x41, 0x59, 0x77, 0x42, 0x6c, 0x0a, 0x41, 0x47, 0x77, + 0x41, 0x62, 0x77, 0x42, 0x75, 0x41, 0x47, 0x45, 0x41, 0x49, 0x41, 0x41, + 0x77, 0x41, 0x44, 0x67, 0x41, 0x4d, 0x41, 0x41, 0x78, 0x41, 0x44, 0x63, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, + 0x42, 0x41, 0x42, 0x64, 0x39, 0x6f, 0x50, 0x6d, 0x30, 0x33, 0x63, 0x58, + 0x46, 0x0a, 0x36, 0x36, 0x31, 0x4c, 0x4a, 0x4c, 0x57, 0x68, 0x41, 0x71, + 0x76, 0x64, 0x70, 0x59, 0x68, 0x4b, 0x73, 0x67, 0x39, 0x56, 0x53, 0x79, + 0x74, 0x58, 0x6a, 0x44, 0x76, 0x6c, 0x4d, 0x64, 0x33, 0x2b, 0x78, 0x44, + 0x4c, 0x78, 0x35, 0x31, 0x74, 0x6b, 0x6c, 0x6a, 0x59, 0x79, 0x47, 0x4f, + 0x79, 0x6c, 0x4d, 0x6e, 0x66, 0x58, 0x34, 0x30, 0x53, 0x32, 0x77, 0x42, + 0x45, 0x71, 0x67, 0x4c, 0x6b, 0x39, 0x0a, 0x61, 0x6d, 0x35, 0x38, 0x6d, + 0x39, 0x4f, 0x74, 0x2f, 0x4d, 0x50, 0x57, 0x6f, 0x2b, 0x5a, 0x6b, 0x4b, + 0x58, 0x7a, 0x52, 0x34, 0x54, 0x67, 0x65, 0x67, 0x69, 0x76, 0x2f, 0x4a, + 0x32, 0x57, 0x76, 0x2b, 0x78, 0x59, 0x56, 0x78, 0x43, 0x35, 0x78, 0x68, + 0x4f, 0x57, 0x31, 0x2f, 0x2f, 0x71, 0x6b, 0x52, 0x37, 0x31, 0x6b, 0x4d, + 0x72, 0x76, 0x32, 0x4a, 0x59, 0x53, 0x69, 0x4a, 0x30, 0x4c, 0x31, 0x0a, + 0x49, 0x4c, 0x44, 0x43, 0x45, 0x78, 0x41, 0x52, 0x7a, 0x52, 0x41, 0x56, + 0x75, 0x6b, 0x4b, 0x51, 0x4b, 0x74, 0x4a, 0x45, 0x34, 0x5a, 0x59, 0x6d, + 0x36, 0x7a, 0x46, 0x49, 0x45, 0x76, 0x30, 0x71, 0x32, 0x73, 0x6b, 0x47, + 0x7a, 0x33, 0x51, 0x65, 0x71, 0x55, 0x76, 0x56, 0x68, 0x79, 0x6a, 0x35, + 0x65, 0x54, 0x53, 0x53, 0x50, 0x69, 0x35, 0x45, 0x36, 0x50, 0x61, 0x50, + 0x54, 0x34, 0x38, 0x31, 0x0a, 0x50, 0x79, 0x57, 0x7a, 0x4f, 0x64, 0x78, + 0x6a, 0x4b, 0x70, 0x42, 0x72, 0x49, 0x46, 0x2f, 0x45, 0x55, 0x68, 0x4a, + 0x4f, 0x6c, 0x79, 0x77, 0x71, 0x72, 0x4a, 0x32, 0x58, 0x33, 0x6b, 0x6a, + 0x79, 0x6f, 0x32, 0x62, 0x62, 0x77, 0x74, 0x4b, 0x44, 0x6c, 0x61, 0x5a, + 0x6d, 0x70, 0x35, 0x34, 0x6c, 0x44, 0x2b, 0x6b, 0x4c, 0x4d, 0x35, 0x46, + 0x6c, 0x43, 0x6c, 0x72, 0x44, 0x32, 0x56, 0x51, 0x53, 0x0a, 0x33, 0x61, + 0x2f, 0x44, 0x54, 0x67, 0x34, 0x66, 0x4a, 0x6c, 0x34, 0x4e, 0x33, 0x4c, + 0x4f, 0x4e, 0x37, 0x4e, 0x57, 0x42, 0x63, 0x4e, 0x37, 0x53, 0x54, 0x79, + 0x51, 0x46, 0x38, 0x32, 0x78, 0x4f, 0x39, 0x55, 0x78, 0x4a, 0x5a, 0x6f, + 0x33, 0x52, 0x2f, 0x39, 0x49, 0x4c, 0x4a, 0x55, 0x46, 0x49, 0x2f, 0x6c, + 0x47, 0x45, 0x78, 0x6b, 0x4b, 0x76, 0x67, 0x41, 0x54, 0x50, 0x30, 0x48, + 0x35, 0x6b, 0x0a, 0x53, 0x65, 0x54, 0x79, 0x33, 0x36, 0x4c, 0x73, 0x73, + 0x55, 0x7a, 0x41, 0x4b, 0x68, 0x33, 0x6e, 0x74, 0x4c, 0x46, 0x6c, 0x6f, + 0x73, 0x53, 0x38, 0x38, 0x5a, 0x6a, 0x30, 0x71, 0x6e, 0x41, 0x48, 0x59, + 0x37, 0x53, 0x34, 0x32, 0x6a, 0x74, 0x4d, 0x2b, 0x6b, 0x41, 0x69, 0x4d, + 0x46, 0x73, 0x52, 0x70, 0x76, 0x41, 0x46, 0x44, 0x73, 0x59, 0x43, 0x41, + 0x30, 0x69, 0x72, 0x68, 0x70, 0x75, 0x46, 0x0a, 0x33, 0x64, 0x76, 0x64, + 0x36, 0x71, 0x4a, 0x32, 0x67, 0x48, 0x4e, 0x39, 0x39, 0x5a, 0x77, 0x45, + 0x78, 0x45, 0x57, 0x4e, 0x35, 0x37, 0x6b, 0x63, 0x69, 0x35, 0x37, 0x71, + 0x31, 0x33, 0x58, 0x52, 0x63, 0x72, 0x48, 0x65, 0x64, 0x55, 0x54, 0x6e, + 0x51, 0x6e, 0x33, 0x69, 0x56, 0x32, 0x74, 0x39, 0x33, 0x4a, 0x6d, 0x38, + 0x50, 0x59, 0x4d, 0x6f, 0x36, 0x6f, 0x43, 0x54, 0x6a, 0x63, 0x56, 0x4d, + 0x0a, 0x5a, 0x63, 0x46, 0x77, 0x67, 0x62, 0x67, 0x34, 0x2f, 0x45, 0x4d, + 0x78, 0x73, 0x76, 0x59, 0x44, 0x4e, 0x45, 0x65, 0x79, 0x72, 0x50, 0x73, + 0x69, 0x42, 0x73, 0x73, 0x65, 0x33, 0x52, 0x64, 0x48, 0x48, 0x46, 0x39, + 0x6d, 0x75, 0x64, 0x4d, 0x61, 0x6f, 0x74, 0x6f, 0x52, 0x73, 0x61, 0x53, + 0x38, 0x49, 0x38, 0x6e, 0x6b, 0x76, 0x6f, 0x66, 0x2f, 0x75, 0x5a, 0x53, + 0x32, 0x2b, 0x46, 0x30, 0x67, 0x0a, 0x53, 0x74, 0x52, 0x66, 0x35, 0x37, + 0x31, 0x6f, 0x65, 0x32, 0x58, 0x79, 0x46, 0x52, 0x37, 0x53, 0x4f, 0x71, + 0x6b, 0x74, 0x36, 0x64, 0x68, 0x72, 0x4a, 0x4b, 0x79, 0x58, 0x57, 0x45, + 0x52, 0x48, 0x72, 0x56, 0x6b, 0x59, 0x38, 0x53, 0x46, 0x6c, 0x63, 0x4e, + 0x37, 0x4f, 0x4e, 0x47, 0x43, 0x6f, 0x51, 0x50, 0x48, 0x7a, 0x50, 0x4b, + 0x54, 0x44, 0x4b, 0x43, 0x4f, 0x4d, 0x2f, 0x69, 0x63, 0x7a, 0x0a, 0x51, + 0x30, 0x43, 0x67, 0x46, 0x7a, 0x7a, 0x72, 0x36, 0x6a, 0x75, 0x77, 0x63, + 0x71, 0x61, 0x6a, 0x75, 0x55, 0x70, 0x4c, 0x58, 0x68, 0x5a, 0x49, 0x39, + 0x4c, 0x4b, 0x38, 0x79, 0x49, 0x79, 0x53, 0x78, 0x5a, 0x32, 0x66, 0x72, + 0x48, 0x49, 0x32, 0x76, 0x44, 0x53, 0x41, 0x4e, 0x47, 0x75, 0x70, 0x69, + 0x35, 0x4c, 0x41, 0x75, 0x42, 0x66, 0x74, 0x37, 0x48, 0x5a, 0x54, 0x39, + 0x53, 0x51, 0x42, 0x0a, 0x6a, 0x4c, 0x4d, 0x69, 0x36, 0x45, 0x74, 0x38, + 0x56, 0x63, 0x61, 0x64, 0x2b, 0x71, 0x4d, 0x55, 0x75, 0x32, 0x57, 0x46, + 0x62, 0x6d, 0x35, 0x50, 0x45, 0x6e, 0x34, 0x4b, 0x50, 0x4a, 0x32, 0x56, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x49, 0x7a, 0x65, 0x6e, 0x70, 0x65, 0x2e, + 0x63, 0x6f, 0x6d, 0x20, 0x4f, 0x3d, 0x49, 0x5a, 0x45, 0x4e, 0x50, 0x45, + 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x49, 0x7a, 0x65, 0x6e, + 0x70, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x4f, 0x3d, 0x49, 0x5a, 0x45, + 0x4e, 0x50, 0x45, 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x49, 0x7a, 0x65, 0x6e, 0x70, + 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x39, 0x31, 0x37, 0x35, 0x36, 0x33, 0x30, + 0x36, 0x35, 0x34, 0x39, 0x30, 0x33, 0x38, 0x39, 0x32, 0x34, 0x31, 0x35, + 0x39, 0x35, 0x35, 0x33, 0x36, 0x36, 0x38, 0x36, 0x39, 0x39, 0x31, 0x34, + 0x30, 0x32, 0x36, 0x32, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x61, 0x36, 0x3a, 0x62, 0x30, 0x3a, 0x63, 0x64, 0x3a, 0x38, 0x35, + 0x3a, 0x38, 0x30, 0x3a, 0x64, 0x61, 0x3a, 0x35, 0x63, 0x3a, 0x35, 0x30, + 0x3a, 0x33, 0x34, 0x3a, 0x61, 0x33, 0x3a, 0x33, 0x39, 0x3a, 0x39, 0x30, + 0x3a, 0x32, 0x66, 0x3a, 0x35, 0x35, 0x3a, 0x36, 0x37, 0x3a, 0x37, 0x33, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x66, 0x3a, + 0x37, 0x38, 0x3a, 0x33, 0x64, 0x3a, 0x32, 0x35, 0x3a, 0x35, 0x32, 0x3a, + 0x31, 0x38, 0x3a, 0x61, 0x37, 0x3a, 0x34, 0x61, 0x3a, 0x36, 0x35, 0x3a, + 0x33, 0x39, 0x3a, 0x37, 0x31, 0x3a, 0x62, 0x35, 0x3a, 0x32, 0x63, 0x3a, + 0x61, 0x32, 0x3a, 0x39, 0x63, 0x3a, 0x34, 0x35, 0x3a, 0x31, 0x35, 0x3a, + 0x36, 0x66, 0x3a, 0x65, 0x39, 0x3a, 0x31, 0x39, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x35, 0x3a, 0x33, 0x30, + 0x3a, 0x63, 0x63, 0x3a, 0x38, 0x65, 0x3a, 0x39, 0x38, 0x3a, 0x33, 0x32, + 0x3a, 0x31, 0x35, 0x3a, 0x30, 0x32, 0x3a, 0x62, 0x61, 0x3a, 0x64, 0x39, + 0x3a, 0x36, 0x66, 0x3a, 0x39, 0x62, 0x3a, 0x31, 0x66, 0x3a, 0x62, 0x61, + 0x3a, 0x31, 0x62, 0x3a, 0x30, 0x39, 0x3a, 0x39, 0x65, 0x3a, 0x32, 0x64, + 0x3a, 0x32, 0x39, 0x3a, 0x39, 0x65, 0x3a, 0x30, 0x66, 0x3a, 0x34, 0x35, + 0x3a, 0x34, 0x38, 0x3a, 0x62, 0x62, 0x3a, 0x39, 0x31, 0x3a, 0x34, 0x66, + 0x3a, 0x33, 0x36, 0x3a, 0x33, 0x62, 0x3a, 0x63, 0x30, 0x3a, 0x64, 0x34, + 0x3a, 0x35, 0x33, 0x3a, 0x31, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x46, 0x38, 0x54, 0x43, 0x43, 0x41, 0x39, 0x6d, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x41, 0x4c, 0x43, 0x33, 0x57, + 0x68, 0x5a, 0x49, 0x58, 0x37, 0x2f, 0x68, 0x79, 0x2f, 0x57, 0x4c, 0x31, + 0x78, 0x6e, 0x6d, 0x66, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, + 0x44, 0x41, 0x34, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x46, 0x55, 0x7a, 0x45, 0x55, + 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x4c, + 0x53, 0x56, 0x70, 0x46, 0x54, 0x6c, 0x42, 0x46, 0x49, 0x46, 0x4d, 0x75, + 0x51, 0x53, 0x34, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x4d, 0x43, 0x6b, 0x6c, 0x36, 0x0a, 0x5a, 0x57, 0x35, + 0x77, 0x5a, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x77, 0x48, 0x68, 0x63, + 0x4e, 0x4d, 0x44, 0x63, 0x78, 0x4d, 0x6a, 0x45, 0x7a, 0x4d, 0x54, 0x4d, + 0x77, 0x4f, 0x44, 0x49, 0x34, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x63, + 0x78, 0x4d, 0x6a, 0x45, 0x7a, 0x4d, 0x44, 0x67, 0x79, 0x4e, 0x7a, 0x49, + 0x31, 0x57, 0x6a, 0x41, 0x34, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x46, 0x55, 0x7a, + 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, + 0x77, 0x4c, 0x53, 0x56, 0x70, 0x46, 0x54, 0x6c, 0x42, 0x46, 0x49, 0x46, + 0x4d, 0x75, 0x51, 0x53, 0x34, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x43, 0x6b, 0x6c, 0x36, 0x5a, 0x57, + 0x35, 0x77, 0x5a, 0x53, 0x35, 0x6a, 0x0a, 0x62, 0x32, 0x30, 0x77, 0x67, + 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, + 0x6f, 0x49, 0x43, 0x41, 0x51, 0x44, 0x4a, 0x30, 0x33, 0x72, 0x4b, 0x44, + 0x78, 0x36, 0x73, 0x70, 0x34, 0x62, 0x6f, 0x46, 0x6d, 0x56, 0x71, 0x0a, + 0x73, 0x63, 0x49, 0x62, 0x52, 0x54, 0x4a, 0x78, 0x6c, 0x64, 0x6e, 0x2b, + 0x45, 0x46, 0x76, 0x4d, 0x72, 0x2b, 0x65, 0x6c, 0x65, 0x51, 0x47, 0x50, + 0x69, 0x63, 0x50, 0x4b, 0x38, 0x6c, 0x56, 0x78, 0x39, 0x33, 0x65, 0x2b, + 0x64, 0x35, 0x54, 0x7a, 0x63, 0x71, 0x51, 0x73, 0x52, 0x4e, 0x69, 0x65, + 0x6b, 0x70, 0x73, 0x55, 0x4f, 0x71, 0x48, 0x6e, 0x4a, 0x4a, 0x41, 0x4b, + 0x43, 0x6c, 0x61, 0x4f, 0x0a, 0x78, 0x64, 0x67, 0x6d, 0x6c, 0x4f, 0x48, + 0x5a, 0x53, 0x4f, 0x45, 0x74, 0x50, 0x74, 0x6f, 0x4b, 0x63, 0x74, 0x32, + 0x6a, 0x6d, 0x52, 0x58, 0x61, 0x67, 0x61, 0x4b, 0x48, 0x39, 0x48, 0x74, + 0x75, 0x4a, 0x6e, 0x65, 0x4a, 0x57, 0x4b, 0x33, 0x57, 0x36, 0x77, 0x79, + 0x79, 0x51, 0x58, 0x70, 0x7a, 0x62, 0x6d, 0x33, 0x62, 0x65, 0x6e, 0x68, + 0x42, 0x36, 0x51, 0x69, 0x49, 0x45, 0x6e, 0x36, 0x48, 0x0a, 0x4c, 0x6d, + 0x59, 0x52, 0x59, 0x32, 0x78, 0x55, 0x2b, 0x7a, 0x79, 0x64, 0x63, 0x73, + 0x43, 0x38, 0x4c, 0x76, 0x2f, 0x43, 0x74, 0x39, 0x30, 0x4e, 0x64, 0x75, + 0x4d, 0x36, 0x31, 0x2f, 0x65, 0x30, 0x61, 0x4c, 0x36, 0x69, 0x39, 0x65, + 0x4f, 0x42, 0x62, 0x73, 0x46, 0x47, 0x62, 0x31, 0x32, 0x4e, 0x34, 0x45, + 0x33, 0x47, 0x56, 0x46, 0x57, 0x4a, 0x47, 0x6a, 0x4d, 0x78, 0x43, 0x72, + 0x46, 0x58, 0x0a, 0x75, 0x61, 0x4f, 0x4b, 0x6d, 0x4d, 0x50, 0x73, 0x4f, + 0x7a, 0x54, 0x46, 0x6c, 0x55, 0x46, 0x70, 0x66, 0x6e, 0x58, 0x43, 0x50, + 0x43, 0x44, 0x46, 0x59, 0x62, 0x70, 0x52, 0x52, 0x36, 0x41, 0x67, 0x6b, + 0x4a, 0x4f, 0x68, 0x6b, 0x45, 0x76, 0x7a, 0x54, 0x6e, 0x79, 0x46, 0x52, + 0x56, 0x53, 0x61, 0x30, 0x51, 0x55, 0x6d, 0x51, 0x62, 0x43, 0x31, 0x54, + 0x52, 0x30, 0x7a, 0x76, 0x73, 0x51, 0x44, 0x0a, 0x79, 0x43, 0x56, 0x38, + 0x77, 0x58, 0x44, 0x62, 0x4f, 0x2f, 0x51, 0x4a, 0x4c, 0x56, 0x51, 0x6e, + 0x53, 0x4b, 0x77, 0x76, 0x34, 0x63, 0x53, 0x73, 0x50, 0x73, 0x6a, 0x4c, + 0x6b, 0x6b, 0x78, 0x54, 0x4f, 0x54, 0x63, 0x6a, 0x37, 0x4e, 0x4d, 0x42, + 0x2b, 0x65, 0x41, 0x4a, 0x52, 0x45, 0x31, 0x4e, 0x5a, 0x4d, 0x44, 0x68, + 0x44, 0x56, 0x71, 0x48, 0x49, 0x72, 0x79, 0x74, 0x47, 0x36, 0x50, 0x2b, + 0x0a, 0x4a, 0x72, 0x55, 0x56, 0x38, 0x36, 0x66, 0x38, 0x68, 0x42, 0x6e, + 0x70, 0x37, 0x4b, 0x47, 0x49, 0x74, 0x45, 0x52, 0x70, 0x68, 0x49, 0x50, + 0x7a, 0x69, 0x64, 0x46, 0x30, 0x42, 0x71, 0x6e, 0x4d, 0x43, 0x39, 0x62, + 0x43, 0x33, 0x69, 0x65, 0x46, 0x55, 0x43, 0x62, 0x4b, 0x46, 0x37, 0x6a, + 0x4a, 0x65, 0x6f, 0x64, 0x57, 0x4c, 0x42, 0x6f, 0x42, 0x48, 0x6d, 0x79, + 0x2b, 0x45, 0x36, 0x30, 0x51, 0x0a, 0x72, 0x4c, 0x55, 0x6b, 0x39, 0x54, + 0x69, 0x52, 0x6f, 0x64, 0x5a, 0x4c, 0x32, 0x76, 0x47, 0x37, 0x30, 0x74, + 0x35, 0x48, 0x74, 0x66, 0x47, 0x38, 0x67, 0x66, 0x5a, 0x5a, 0x61, 0x38, + 0x38, 0x5a, 0x55, 0x2b, 0x6d, 0x4e, 0x46, 0x63, 0x74, 0x4b, 0x79, 0x36, + 0x6c, 0x76, 0x52, 0x4f, 0x55, 0x62, 0x51, 0x63, 0x2f, 0x68, 0x68, 0x71, + 0x66, 0x4b, 0x30, 0x47, 0x71, 0x66, 0x76, 0x45, 0x79, 0x4e, 0x0a, 0x42, + 0x6a, 0x4e, 0x61, 0x6f, 0x6f, 0x58, 0x6c, 0x6b, 0x44, 0x57, 0x67, 0x59, + 0x6c, 0x77, 0x57, 0x54, 0x76, 0x44, 0x6a, 0x6f, 0x76, 0x6f, 0x44, 0x47, + 0x72, 0x51, 0x73, 0x63, 0x62, 0x4e, 0x59, 0x4c, 0x4e, 0x35, 0x37, 0x43, + 0x39, 0x73, 0x61, 0x44, 0x2b, 0x76, 0x65, 0x49, 0x52, 0x38, 0x47, 0x64, + 0x77, 0x59, 0x44, 0x73, 0x4d, 0x6e, 0x76, 0x6d, 0x66, 0x7a, 0x41, 0x75, + 0x55, 0x38, 0x4c, 0x0a, 0x68, 0x69, 0x6a, 0x2b, 0x30, 0x72, 0x6e, 0x71, + 0x34, 0x39, 0x71, 0x6c, 0x77, 0x30, 0x64, 0x70, 0x45, 0x75, 0x44, 0x62, + 0x38, 0x50, 0x59, 0x5a, 0x69, 0x2b, 0x31, 0x37, 0x63, 0x4e, 0x63, 0x43, + 0x31, 0x75, 0x32, 0x48, 0x47, 0x43, 0x67, 0x73, 0x42, 0x43, 0x52, 0x4d, + 0x64, 0x2b, 0x52, 0x49, 0x69, 0x68, 0x72, 0x47, 0x4f, 0x35, 0x72, 0x55, + 0x44, 0x38, 0x72, 0x36, 0x64, 0x64, 0x49, 0x42, 0x0a, 0x51, 0x46, 0x71, + 0x4e, 0x65, 0x62, 0x2b, 0x4c, 0x7a, 0x30, 0x76, 0x50, 0x71, 0x68, 0x62, + 0x42, 0x6c, 0x65, 0x53, 0x74, 0x54, 0x49, 0x6f, 0x2b, 0x46, 0x35, 0x48, + 0x55, 0x73, 0x57, 0x4c, 0x6c, 0x67, 0x75, 0x57, 0x41, 0x42, 0x4b, 0x51, + 0x44, 0x66, 0x6f, 0x32, 0x2f, 0x32, 0x6e, 0x2b, 0x69, 0x44, 0x35, 0x64, + 0x50, 0x44, 0x4e, 0x4d, 0x4e, 0x2b, 0x39, 0x66, 0x52, 0x35, 0x58, 0x4a, + 0x2b, 0x0a, 0x48, 0x4d, 0x68, 0x33, 0x2f, 0x31, 0x75, 0x61, 0x44, 0x37, + 0x65, 0x75, 0x42, 0x55, 0x62, 0x6c, 0x38, 0x61, 0x67, 0x57, 0x37, 0x45, + 0x65, 0x6b, 0x46, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, + 0x48, 0x32, 0x4d, 0x49, 0x48, 0x7a, 0x4d, 0x49, 0x47, 0x77, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x45, 0x45, 0x67, 0x61, 0x67, 0x77, 0x67, 0x61, + 0x57, 0x42, 0x44, 0x32, 0x6c, 0x75, 0x0a, 0x5a, 0x6d, 0x39, 0x41, 0x61, + 0x58, 0x70, 0x6c, 0x62, 0x6e, 0x42, 0x6c, 0x4c, 0x6d, 0x4e, 0x76, 0x62, + 0x61, 0x53, 0x42, 0x6b, 0x54, 0x43, 0x42, 0x6a, 0x6a, 0x46, 0x48, 0x4d, + 0x45, 0x55, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x2b, 0x53, + 0x56, 0x70, 0x46, 0x54, 0x6c, 0x42, 0x46, 0x49, 0x46, 0x4d, 0x75, 0x51, + 0x53, 0x34, 0x67, 0x4c, 0x53, 0x42, 0x44, 0x53, 0x55, 0x59, 0x67, 0x0a, + 0x51, 0x54, 0x41, 0x78, 0x4d, 0x7a, 0x4d, 0x33, 0x4d, 0x6a, 0x59, 0x77, + 0x4c, 0x56, 0x4a, 0x4e, 0x5a, 0x58, 0x4a, 0x6a, 0x4c, 0x6c, 0x5a, 0x70, + 0x64, 0x47, 0x39, 0x79, 0x61, 0x57, 0x45, 0x74, 0x52, 0x32, 0x46, 0x7a, + 0x64, 0x47, 0x56, 0x70, 0x65, 0x69, 0x42, 0x55, 0x4d, 0x54, 0x41, 0x31, + 0x4e, 0x53, 0x42, 0x47, 0x4e, 0x6a, 0x49, 0x67, 0x55, 0x7a, 0x67, 0x78, + 0x51, 0x7a, 0x42, 0x42, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6b, + 0x4d, 0x4f, 0x6b, 0x46, 0x32, 0x5a, 0x47, 0x45, 0x67, 0x5a, 0x47, 0x56, + 0x73, 0x49, 0x45, 0x31, 0x6c, 0x5a, 0x47, 0x6c, 0x30, 0x5a, 0x58, 0x4a, + 0x79, 0x59, 0x57, 0x35, 0x6c, 0x62, 0x79, 0x42, 0x46, 0x64, 0x47, 0x39, + 0x79, 0x59, 0x6d, 0x6c, 0x6b, 0x5a, 0x57, 0x45, 0x67, 0x4d, 0x54, 0x51, + 0x67, 0x4c, 0x53, 0x41, 0x77, 0x4d, 0x54, 0x41, 0x78, 0x0a, 0x4d, 0x43, + 0x42, 0x57, 0x61, 0x58, 0x52, 0x76, 0x63, 0x6d, 0x6c, 0x68, 0x4c, 0x55, + 0x64, 0x68, 0x63, 0x33, 0x52, 0x6c, 0x61, 0x58, 0x6f, 0x77, 0x44, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, + 0x4d, 0x43, 0x0a, 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x42, 0x30, 0x63, 0x5a, + 0x51, 0x36, 0x6f, 0x38, 0x69, 0x56, 0x37, 0x74, 0x4a, 0x48, 0x50, 0x35, + 0x4c, 0x47, 0x78, 0x35, 0x72, 0x31, 0x56, 0x64, 0x47, 0x77, 0x46, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x0a, 0x41, 0x34, 0x49, 0x43, + 0x41, 0x51, 0x42, 0x34, 0x70, 0x67, 0x77, 0x57, 0x53, 0x70, 0x39, 0x4d, + 0x69, 0x44, 0x72, 0x41, 0x79, 0x77, 0x36, 0x6c, 0x46, 0x6e, 0x32, 0x66, + 0x75, 0x55, 0x68, 0x66, 0x47, 0x49, 0x38, 0x4e, 0x59, 0x6a, 0x62, 0x32, + 0x7a, 0x52, 0x6c, 0x72, 0x72, 0x4b, 0x76, 0x56, 0x39, 0x70, 0x46, 0x39, + 0x72, 0x6e, 0x48, 0x7a, 0x50, 0x37, 0x4d, 0x4f, 0x65, 0x49, 0x57, 0x62, + 0x0a, 0x6c, 0x61, 0x51, 0x6e, 0x49, 0x55, 0x64, 0x43, 0x53, 0x6e, 0x78, + 0x49, 0x4f, 0x76, 0x56, 0x46, 0x66, 0x4c, 0x4d, 0x4d, 0x6a, 0x6c, 0x46, + 0x34, 0x72, 0x4a, 0x55, 0x54, 0x33, 0x73, 0x62, 0x39, 0x66, 0x62, 0x67, + 0x61, 0x6b, 0x45, 0x79, 0x72, 0x6b, 0x67, 0x50, 0x48, 0x37, 0x55, 0x49, + 0x42, 0x7a, 0x67, 0x2f, 0x59, 0x73, 0x66, 0x71, 0x69, 0x6b, 0x75, 0x46, + 0x67, 0x62, 0x61, 0x35, 0x36, 0x0a, 0x61, 0x77, 0x6d, 0x71, 0x78, 0x69, + 0x6e, 0x75, 0x61, 0x45, 0x6c, 0x6e, 0x4d, 0x49, 0x41, 0x6b, 0x65, 0x6a, + 0x45, 0x57, 0x4f, 0x56, 0x74, 0x2b, 0x38, 0x52, 0x77, 0x75, 0x33, 0x57, + 0x77, 0x4a, 0x72, 0x66, 0x49, 0x78, 0x77, 0x59, 0x4a, 0x4f, 0x75, 0x62, + 0x76, 0x35, 0x76, 0x72, 0x38, 0x71, 0x68, 0x54, 0x2f, 0x41, 0x51, 0x4b, + 0x4d, 0x36, 0x57, 0x66, 0x78, 0x5a, 0x53, 0x7a, 0x77, 0x6f, 0x0a, 0x4a, + 0x4e, 0x75, 0x30, 0x46, 0x58, 0x57, 0x75, 0x44, 0x59, 0x69, 0x36, 0x4c, + 0x6e, 0x50, 0x41, 0x76, 0x56, 0x69, 0x48, 0x35, 0x55, 0x4c, 0x79, 0x36, + 0x31, 0x37, 0x75, 0x48, 0x6a, 0x41, 0x69, 0x6d, 0x63, 0x73, 0x33, 0x30, + 0x63, 0x51, 0x68, 0x62, 0x49, 0x48, 0x73, 0x76, 0x6d, 0x30, 0x6d, 0x35, + 0x68, 0x7a, 0x6b, 0x51, 0x69, 0x43, 0x65, 0x52, 0x37, 0x43, 0x73, 0x67, + 0x31, 0x6c, 0x77, 0x0a, 0x4c, 0x44, 0x58, 0x57, 0x72, 0x7a, 0x59, 0x30, + 0x74, 0x4d, 0x30, 0x37, 0x2b, 0x44, 0x4b, 0x6f, 0x37, 0x2b, 0x4e, 0x34, + 0x69, 0x66, 0x75, 0x4e, 0x52, 0x53, 0x7a, 0x61, 0x6e, 0x4c, 0x68, 0x2b, + 0x51, 0x42, 0x78, 0x68, 0x35, 0x7a, 0x36, 0x69, 0x6b, 0x69, 0x78, 0x4c, + 0x38, 0x73, 0x33, 0x36, 0x6d, 0x4c, 0x59, 0x70, 0x2f, 0x2f, 0x50, 0x79, + 0x65, 0x36, 0x6b, 0x66, 0x4c, 0x71, 0x43, 0x54, 0x0a, 0x56, 0x79, 0x76, + 0x65, 0x68, 0x51, 0x50, 0x35, 0x61, 0x54, 0x66, 0x4c, 0x6e, 0x6e, 0x68, + 0x71, 0x42, 0x62, 0x54, 0x46, 0x4d, 0x58, 0x69, 0x4a, 0x37, 0x48, 0x71, + 0x6e, 0x68, 0x65, 0x47, 0x35, 0x65, 0x7a, 0x7a, 0x65, 0x76, 0x68, 0x35, + 0x35, 0x68, 0x4d, 0x36, 0x66, 0x63, 0x41, 0x35, 0x5a, 0x77, 0x6a, 0x55, + 0x75, 0x6b, 0x43, 0x6f, 0x78, 0x32, 0x65, 0x52, 0x46, 0x65, 0x6b, 0x47, + 0x6b, 0x0a, 0x4c, 0x68, 0x4f, 0x62, 0x4e, 0x41, 0x35, 0x6d, 0x65, 0x30, + 0x6d, 0x72, 0x5a, 0x4a, 0x66, 0x51, 0x52, 0x73, 0x4e, 0x35, 0x6e, 0x58, + 0x4a, 0x51, 0x59, 0x36, 0x61, 0x59, 0x57, 0x77, 0x61, 0x39, 0x53, 0x47, + 0x33, 0x59, 0x4f, 0x59, 0x4e, 0x77, 0x36, 0x44, 0x58, 0x77, 0x42, 0x64, + 0x47, 0x71, 0x76, 0x4f, 0x50, 0x62, 0x79, 0x41, 0x4c, 0x71, 0x66, 0x50, + 0x32, 0x43, 0x32, 0x73, 0x4a, 0x62, 0x0a, 0x55, 0x6a, 0x57, 0x75, 0x6d, + 0x44, 0x71, 0x74, 0x75, 0x6a, 0x57, 0x54, 0x49, 0x36, 0x63, 0x66, 0x53, + 0x4e, 0x30, 0x31, 0x52, 0x70, 0x69, 0x79, 0x45, 0x47, 0x6a, 0x6b, 0x70, + 0x54, 0x48, 0x43, 0x43, 0x6c, 0x67, 0x75, 0x47, 0x59, 0x45, 0x51, 0x79, + 0x56, 0x42, 0x31, 0x2f, 0x4f, 0x70, 0x61, 0x46, 0x73, 0x34, 0x52, 0x31, + 0x2b, 0x37, 0x76, 0x55, 0x49, 0x67, 0x74, 0x59, 0x66, 0x38, 0x2f, 0x0a, + 0x51, 0x6e, 0x4d, 0x46, 0x6c, 0x45, 0x50, 0x56, 0x6a, 0x6a, 0x78, 0x4f, + 0x41, 0x54, 0x6f, 0x5a, 0x70, 0x52, 0x39, 0x47, 0x54, 0x6e, 0x66, 0x51, + 0x58, 0x65, 0x57, 0x42, 0x49, 0x69, 0x47, 0x48, 0x2f, 0x70, 0x52, 0x39, + 0x68, 0x4e, 0x69, 0x54, 0x72, 0x64, 0x5a, 0x6f, 0x51, 0x30, 0x69, 0x79, + 0x32, 0x2b, 0x74, 0x7a, 0x4a, 0x4f, 0x65, 0x52, 0x66, 0x31, 0x53, 0x6b, + 0x74, 0x6f, 0x41, 0x2b, 0x0a, 0x6e, 0x61, 0x4d, 0x38, 0x54, 0x48, 0x4c, + 0x43, 0x56, 0x38, 0x53, 0x67, 0x31, 0x4d, 0x77, 0x34, 0x4a, 0x38, 0x37, + 0x56, 0x42, 0x70, 0x36, 0x69, 0x53, 0x4e, 0x6e, 0x70, 0x6e, 0x38, 0x36, + 0x43, 0x63, 0x44, 0x61, 0x54, 0x6d, 0x6a, 0x76, 0x66, 0x6c, 0x69, 0x48, + 0x6a, 0x57, 0x62, 0x63, 0x4d, 0x32, 0x70, 0x45, 0x33, 0x38, 0x50, 0x31, + 0x5a, 0x57, 0x72, 0x4f, 0x5a, 0x79, 0x47, 0x6c, 0x73, 0x0a, 0x51, 0x79, + 0x59, 0x42, 0x4e, 0x57, 0x4e, 0x67, 0x56, 0x59, 0x6b, 0x44, 0x4f, 0x6e, + 0x58, 0x59, 0x75, 0x6b, 0x72, 0x5a, 0x56, 0x50, 0x2f, 0x75, 0x33, 0x6f, + 0x44, 0x59, 0x4c, 0x64, 0x45, 0x34, 0x31, 0x56, 0x34, 0x74, 0x43, 0x35, + 0x68, 0x39, 0x50, 0x6d, 0x7a, 0x62, 0x2f, 0x43, 0x61, 0x49, 0x78, 0x77, + 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x68, 0x61, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x72, 0x63, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x2d, 0x20, 0x32, + 0x30, 0x30, 0x38, 0x20, 0x4f, 0x3d, 0x41, 0x43, 0x20, 0x43, 0x61, 0x6d, + 0x65, 0x72, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x20, 0x53, 0x2e, 0x41, 0x2e, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x43, 0x68, 0x61, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x20, + 0x6f, 0x66, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x63, 0x65, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x2d, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, + 0x4f, 0x3d, 0x41, 0x43, 0x20, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x68, 0x61, 0x6d, 0x62, + 0x65, 0x72, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x72, 0x63, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x2d, 0x20, 0x32, + 0x30, 0x30, 0x38, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x31, 0x31, 0x38, 0x30, 0x36, 0x38, 0x32, 0x32, 0x34, + 0x38, 0x34, 0x38, 0x30, 0x31, 0x35, 0x39, 0x37, 0x31, 0x34, 0x36, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x65, 0x3a, 0x38, 0x30, + 0x3a, 0x39, 0x65, 0x3a, 0x38, 0x34, 0x3a, 0x35, 0x61, 0x3a, 0x30, 0x65, + 0x3a, 0x36, 0x35, 0x3a, 0x30, 0x62, 0x3a, 0x31, 0x37, 0x3a, 0x30, 0x32, + 0x3a, 0x66, 0x33, 0x3a, 0x35, 0x35, 0x3a, 0x31, 0x38, 0x3a, 0x32, 0x61, + 0x3a, 0x33, 0x65, 0x3a, 0x64, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x37, 0x38, 0x3a, 0x36, 0x61, 0x3a, 0x37, 0x34, 0x3a, + 0x61, 0x63, 0x3a, 0x37, 0x36, 0x3a, 0x61, 0x62, 0x3a, 0x31, 0x34, 0x3a, + 0x37, 0x66, 0x3a, 0x39, 0x63, 0x3a, 0x36, 0x61, 0x3a, 0x33, 0x30, 0x3a, + 0x35, 0x30, 0x3a, 0x62, 0x61, 0x3a, 0x39, 0x65, 0x3a, 0x61, 0x38, 0x3a, + 0x37, 0x65, 0x3a, 0x66, 0x65, 0x3a, 0x39, 0x61, 0x3a, 0x63, 0x65, 0x3a, + 0x33, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x30, 0x36, 0x3a, 0x33, 0x65, 0x3a, 0x34, 0x61, 0x3a, 0x66, 0x61, + 0x3a, 0x63, 0x34, 0x3a, 0x39, 0x31, 0x3a, 0x64, 0x66, 0x3a, 0x64, 0x33, + 0x3a, 0x33, 0x32, 0x3a, 0x66, 0x33, 0x3a, 0x30, 0x38, 0x3a, 0x39, 0x62, + 0x3a, 0x38, 0x35, 0x3a, 0x34, 0x32, 0x3a, 0x65, 0x39, 0x3a, 0x34, 0x36, + 0x3a, 0x31, 0x37, 0x3a, 0x64, 0x38, 0x3a, 0x39, 0x33, 0x3a, 0x64, 0x37, + 0x3a, 0x66, 0x65, 0x3a, 0x39, 0x34, 0x3a, 0x34, 0x65, 0x3a, 0x31, 0x30, + 0x3a, 0x61, 0x37, 0x3a, 0x39, 0x33, 0x3a, 0x37, 0x65, 0x3a, 0x65, 0x32, + 0x3a, 0x39, 0x64, 0x3a, 0x39, 0x36, 0x3a, 0x39, 0x33, 0x3a, 0x63, 0x30, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x48, 0x54, 0x7a, 0x43, + 0x43, 0x42, 0x54, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x4a, 0x41, 0x4b, 0x50, 0x61, 0x51, 0x6e, 0x36, 0x6b, 0x73, 0x61, 0x37, + 0x61, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, 0x49, 0x47, + 0x75, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x46, 0x56, 0x54, 0x46, 0x44, 0x4d, 0x45, + 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x36, 0x54, 0x57, + 0x46, 0x6b, 0x63, 0x6d, 0x6c, 0x6b, 0x49, 0x43, 0x68, 0x7a, 0x5a, 0x57, + 0x55, 0x67, 0x59, 0x33, 0x56, 0x79, 0x63, 0x6d, 0x56, 0x75, 0x64, 0x43, + 0x42, 0x68, 0x5a, 0x47, 0x52, 0x79, 0x5a, 0x58, 0x4e, 0x7a, 0x49, 0x47, + 0x46, 0x30, 0x0a, 0x49, 0x48, 0x64, 0x33, 0x64, 0x79, 0x35, 0x6a, 0x59, + 0x57, 0x31, 0x6c, 0x63, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x68, 0x4c, + 0x6d, 0x4e, 0x76, 0x62, 0x53, 0x39, 0x68, 0x5a, 0x47, 0x52, 0x79, 0x5a, + 0x58, 0x4e, 0x7a, 0x4b, 0x54, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x52, 0x4d, 0x4a, 0x51, 0x54, 0x67, 0x79, 0x4e, + 0x7a, 0x51, 0x7a, 0x4d, 0x6a, 0x67, 0x33, 0x0a, 0x4d, 0x52, 0x73, 0x77, + 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x4a, 0x42, + 0x51, 0x79, 0x42, 0x44, 0x59, 0x57, 0x31, 0x6c, 0x63, 0x6d, 0x5a, 0x70, + 0x63, 0x6d, 0x31, 0x68, 0x49, 0x46, 0x4d, 0x75, 0x51, 0x53, 0x34, 0x78, + 0x4b, 0x54, 0x41, 0x6e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, + 0x49, 0x45, 0x4e, 0x6f, 0x59, 0x57, 0x31, 0x69, 0x5a, 0x58, 0x4a, 0x7a, + 0x0a, 0x49, 0x47, 0x39, 0x6d, 0x49, 0x45, 0x4e, 0x76, 0x62, 0x57, 0x31, + 0x6c, 0x63, 0x6d, 0x4e, 0x6c, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, + 0x67, 0x4c, 0x53, 0x41, 0x79, 0x4d, 0x44, 0x41, 0x34, 0x4d, 0x42, 0x34, + 0x58, 0x44, 0x54, 0x41, 0x34, 0x4d, 0x44, 0x67, 0x77, 0x4d, 0x54, 0x45, + 0x79, 0x4d, 0x6a, 0x6b, 0x31, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x4d, + 0x34, 0x4d, 0x44, 0x63, 0x7a, 0x0a, 0x4d, 0x54, 0x45, 0x79, 0x4d, 0x6a, + 0x6b, 0x31, 0x4d, 0x46, 0x6f, 0x77, 0x67, 0x61, 0x34, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, + 0x56, 0x56, 0x4d, 0x55, 0x4d, 0x77, 0x51, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x48, 0x45, 0x7a, 0x70, 0x4e, 0x59, 0x57, 0x52, 0x79, 0x61, 0x57, + 0x51, 0x67, 0x4b, 0x48, 0x4e, 0x6c, 0x5a, 0x53, 0x42, 0x6a, 0x0a, 0x64, + 0x58, 0x4a, 0x79, 0x5a, 0x57, 0x35, 0x30, 0x49, 0x47, 0x46, 0x6b, 0x5a, + 0x48, 0x4a, 0x6c, 0x63, 0x33, 0x4d, 0x67, 0x59, 0x58, 0x51, 0x67, 0x64, + 0x33, 0x64, 0x33, 0x4c, 0x6d, 0x4e, 0x68, 0x62, 0x57, 0x56, 0x79, 0x5a, + 0x6d, 0x6c, 0x79, 0x62, 0x57, 0x45, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4c, + 0x32, 0x46, 0x6b, 0x5a, 0x48, 0x4a, 0x6c, 0x63, 0x33, 0x4d, 0x70, 0x4d, + 0x52, 0x49, 0x77, 0x0a, 0x45, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x46, + 0x45, 0x77, 0x6c, 0x42, 0x4f, 0x44, 0x49, 0x33, 0x4e, 0x44, 0x4d, 0x79, + 0x4f, 0x44, 0x63, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x6f, 0x54, 0x45, 0x6b, 0x46, 0x44, 0x49, 0x45, 0x4e, 0x68, + 0x62, 0x57, 0x56, 0x79, 0x5a, 0x6d, 0x6c, 0x79, 0x62, 0x57, 0x45, 0x67, + 0x55, 0x79, 0x35, 0x42, 0x4c, 0x6a, 0x45, 0x70, 0x0a, 0x4d, 0x43, 0x63, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x67, 0x51, 0x32, 0x68, + 0x68, 0x62, 0x57, 0x4a, 0x6c, 0x63, 0x6e, 0x4d, 0x67, 0x62, 0x32, 0x59, + 0x67, 0x51, 0x32, 0x39, 0x74, 0x62, 0x57, 0x56, 0x79, 0x59, 0x32, 0x55, + 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x41, 0x74, 0x49, 0x44, 0x49, + 0x77, 0x4d, 0x44, 0x67, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, + 0x47, 0x0a, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, + 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, + 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, + 0x43, 0x76, 0x41, 0x4d, 0x74, 0x77, 0x4e, 0x79, 0x75, 0x41, 0x57, 0x6b, + 0x6f, 0x36, 0x62, 0x48, 0x69, 0x55, 0x66, 0x61, 0x4e, 0x2f, 0x47, 0x68, + 0x2f, 0x32, 0x4e, 0x64, 0x57, 0x39, 0x0a, 0x32, 0x38, 0x73, 0x4e, 0x52, + 0x48, 0x49, 0x2b, 0x4a, 0x72, 0x4b, 0x51, 0x55, 0x72, 0x70, 0x6a, 0x4f, + 0x79, 0x68, 0x59, 0x62, 0x36, 0x57, 0x7a, 0x62, 0x5a, 0x53, 0x6d, 0x38, + 0x39, 0x31, 0x6b, 0x44, 0x46, 0x58, 0x32, 0x39, 0x75, 0x66, 0x79, 0x49, + 0x69, 0x4b, 0x41, 0x58, 0x75, 0x46, 0x69, 0x78, 0x72, 0x59, 0x70, 0x34, + 0x59, 0x46, 0x73, 0x38, 0x72, 0x2f, 0x6c, 0x66, 0x54, 0x4a, 0x71, 0x0a, + 0x56, 0x4b, 0x41, 0x79, 0x47, 0x56, 0x6e, 0x2b, 0x48, 0x34, 0x76, 0x58, + 0x50, 0x57, 0x43, 0x47, 0x68, 0x53, 0x52, 0x76, 0x34, 0x78, 0x47, 0x7a, + 0x64, 0x7a, 0x34, 0x67, 0x6c, 0x6a, 0x55, 0x68, 0x61, 0x37, 0x4d, 0x49, + 0x32, 0x58, 0x41, 0x75, 0x5a, 0x50, 0x65, 0x45, 0x6b, 0x6c, 0x50, 0x57, + 0x44, 0x72, 0x43, 0x51, 0x69, 0x6f, 0x72, 0x6a, 0x68, 0x34, 0x30, 0x47, + 0x30, 0x37, 0x32, 0x51, 0x0a, 0x44, 0x75, 0x4b, 0x5a, 0x6f, 0x52, 0x75, + 0x47, 0x44, 0x74, 0x71, 0x61, 0x43, 0x72, 0x73, 0x4c, 0x59, 0x56, 0x41, + 0x47, 0x55, 0x76, 0x47, 0x65, 0x66, 0x33, 0x62, 0x73, 0x79, 0x77, 0x2f, + 0x51, 0x48, 0x67, 0x33, 0x50, 0x6d, 0x54, 0x41, 0x39, 0x48, 0x4d, 0x52, + 0x46, 0x45, 0x46, 0x69, 0x73, 0x31, 0x74, 0x50, 0x6f, 0x31, 0x2b, 0x58, + 0x71, 0x78, 0x51, 0x45, 0x48, 0x64, 0x39, 0x5a, 0x52, 0x0a, 0x35, 0x67, + 0x4e, 0x2f, 0x69, 0x6b, 0x69, 0x6c, 0x54, 0x57, 0x68, 0x31, 0x75, 0x65, + 0x6d, 0x38, 0x6e, 0x6b, 0x34, 0x5a, 0x63, 0x66, 0x55, 0x79, 0x53, 0x35, + 0x78, 0x74, 0x59, 0x42, 0x6b, 0x4c, 0x2b, 0x38, 0x79, 0x64, 0x64, 0x64, + 0x79, 0x2f, 0x4a, 0x73, 0x32, 0x50, 0x6b, 0x33, 0x67, 0x35, 0x65, 0x58, + 0x4e, 0x65, 0x4a, 0x51, 0x37, 0x4b, 0x58, 0x4f, 0x74, 0x33, 0x45, 0x67, + 0x66, 0x4c, 0x0a, 0x5a, 0x45, 0x46, 0x48, 0x63, 0x70, 0x4f, 0x72, 0x55, + 0x4d, 0x50, 0x72, 0x43, 0x58, 0x5a, 0x6b, 0x4e, 0x4e, 0x49, 0x35, 0x74, + 0x33, 0x59, 0x52, 0x43, 0x51, 0x31, 0x32, 0x52, 0x63, 0x53, 0x70, 0x72, + 0x6a, 0x31, 0x71, 0x72, 0x37, 0x56, 0x39, 0x5a, 0x53, 0x2b, 0x55, 0x57, + 0x42, 0x44, 0x73, 0x58, 0x48, 0x79, 0x76, 0x66, 0x75, 0x4b, 0x32, 0x47, + 0x4e, 0x6e, 0x51, 0x6d, 0x30, 0x35, 0x61, 0x0a, 0x53, 0x64, 0x2b, 0x70, + 0x5a, 0x67, 0x76, 0x4d, 0x50, 0x4d, 0x5a, 0x34, 0x66, 0x4b, 0x65, 0x63, + 0x48, 0x65, 0x50, 0x4f, 0x6a, 0x6c, 0x4f, 0x2b, 0x42, 0x64, 0x35, 0x67, + 0x44, 0x32, 0x76, 0x6c, 0x47, 0x74, 0x73, 0x2f, 0x34, 0x2b, 0x45, 0x68, + 0x79, 0x53, 0x6e, 0x42, 0x38, 0x65, 0x73, 0x48, 0x6e, 0x46, 0x49, 0x62, + 0x41, 0x55, 0x52, 0x52, 0x50, 0x48, 0x73, 0x6c, 0x31, 0x38, 0x54, 0x6c, + 0x0a, 0x55, 0x6c, 0x52, 0x64, 0x4a, 0x51, 0x66, 0x4b, 0x46, 0x69, 0x43, + 0x34, 0x72, 0x65, 0x52, 0x42, 0x37, 0x6e, 0x6f, 0x49, 0x2f, 0x70, 0x6c, + 0x76, 0x67, 0x36, 0x61, 0x52, 0x41, 0x72, 0x42, 0x73, 0x4e, 0x6c, 0x56, + 0x71, 0x35, 0x33, 0x33, 0x31, 0x6c, 0x75, 0x62, 0x4b, 0x67, 0x64, 0x61, + 0x58, 0x38, 0x5a, 0x53, 0x44, 0x36, 0x65, 0x32, 0x77, 0x73, 0x57, 0x73, + 0x53, 0x61, 0x52, 0x36, 0x73, 0x0a, 0x2b, 0x31, 0x32, 0x70, 0x78, 0x5a, + 0x6a, 0x70, 0x74, 0x46, 0x74, 0x59, 0x65, 0x72, 0x34, 0x39, 0x6f, 0x6b, + 0x51, 0x36, 0x59, 0x31, 0x6e, 0x55, 0x43, 0x79, 0x58, 0x65, 0x47, 0x30, + 0x2b, 0x39, 0x35, 0x51, 0x47, 0x65, 0x7a, 0x64, 0x49, 0x70, 0x31, 0x5a, + 0x38, 0x58, 0x47, 0x51, 0x70, 0x76, 0x76, 0x77, 0x79, 0x51, 0x30, 0x77, + 0x6c, 0x66, 0x32, 0x65, 0x4f, 0x4b, 0x4e, 0x63, 0x78, 0x35, 0x0a, 0x57, + 0x6b, 0x30, 0x5a, 0x4e, 0x35, 0x4b, 0x33, 0x78, 0x4d, 0x47, 0x74, 0x72, + 0x2f, 0x52, 0x35, 0x4a, 0x4a, 0x71, 0x79, 0x41, 0x51, 0x75, 0x78, 0x72, + 0x31, 0x79, 0x57, 0x38, 0x34, 0x41, 0x79, 0x2b, 0x31, 0x77, 0x39, 0x6d, + 0x50, 0x47, 0x67, 0x50, 0x30, 0x72, 0x65, 0x76, 0x71, 0x2b, 0x55, 0x4c, + 0x74, 0x6c, 0x56, 0x6d, 0x68, 0x64, 0x75, 0x59, 0x4a, 0x31, 0x6a, 0x62, + 0x4c, 0x68, 0x6a, 0x0a, 0x79, 0x61, 0x36, 0x42, 0x58, 0x42, 0x67, 0x31, + 0x34, 0x4a, 0x43, 0x37, 0x76, 0x6a, 0x78, 0x50, 0x4e, 0x79, 0x4b, 0x35, + 0x66, 0x75, 0x76, 0x50, 0x6e, 0x6e, 0x63, 0x68, 0x70, 0x6a, 0x30, 0x34, + 0x67, 0x66, 0x74, 0x49, 0x32, 0x6a, 0x45, 0x39, 0x4b, 0x2b, 0x4f, 0x4a, + 0x39, 0x64, 0x43, 0x31, 0x76, 0x58, 0x37, 0x67, 0x55, 0x4d, 0x51, 0x53, + 0x69, 0x62, 0x4d, 0x6a, 0x6d, 0x68, 0x41, 0x78, 0x0a, 0x68, 0x64, 0x75, + 0x75, 0x62, 0x2b, 0x38, 0x34, 0x4d, 0x78, 0x68, 0x32, 0x45, 0x51, 0x49, + 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x49, 0x42, 0x62, 0x44, 0x43, + 0x43, 0x41, 0x57, 0x67, 0x77, 0x45, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x67, 0x77, 0x42, 0x67, 0x45, + 0x42, 0x2f, 0x77, 0x49, 0x42, 0x44, 0x44, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x0a, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x2b, 0x53, + 0x53, 0x73, 0x44, 0x37, 0x4b, 0x31, 0x2b, 0x48, 0x6e, 0x41, 0x2b, 0x6d, + 0x43, 0x49, 0x47, 0x38, 0x54, 0x5a, 0x54, 0x51, 0x4b, 0x65, 0x46, 0x78, + 0x6b, 0x77, 0x67, 0x65, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, + 0x53, 0x42, 0x32, 0x7a, 0x43, 0x42, 0x32, 0x49, 0x41, 0x55, 0x2b, 0x53, + 0x53, 0x73, 0x44, 0x37, 0x4b, 0x31, 0x0a, 0x2b, 0x48, 0x6e, 0x41, 0x2b, + 0x6d, 0x43, 0x49, 0x47, 0x38, 0x54, 0x5a, 0x54, 0x51, 0x4b, 0x65, 0x46, + 0x78, 0x6d, 0x68, 0x67, 0x62, 0x53, 0x6b, 0x67, 0x62, 0x45, 0x77, 0x67, + 0x61, 0x34, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x59, 0x54, 0x41, 0x6b, 0x56, 0x56, 0x4d, 0x55, 0x4d, 0x77, 0x51, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, 0x45, 0x7a, 0x70, 0x4e, 0x0a, + 0x59, 0x57, 0x52, 0x79, 0x61, 0x57, 0x51, 0x67, 0x4b, 0x48, 0x4e, 0x6c, + 0x5a, 0x53, 0x42, 0x6a, 0x64, 0x58, 0x4a, 0x79, 0x5a, 0x57, 0x35, 0x30, + 0x49, 0x47, 0x46, 0x6b, 0x5a, 0x48, 0x4a, 0x6c, 0x63, 0x33, 0x4d, 0x67, + 0x59, 0x58, 0x51, 0x67, 0x64, 0x33, 0x64, 0x33, 0x4c, 0x6d, 0x4e, 0x68, + 0x62, 0x57, 0x56, 0x79, 0x5a, 0x6d, 0x6c, 0x79, 0x62, 0x57, 0x45, 0x75, + 0x59, 0x32, 0x39, 0x74, 0x0a, 0x4c, 0x32, 0x46, 0x6b, 0x5a, 0x48, 0x4a, + 0x6c, 0x63, 0x33, 0x4d, 0x70, 0x4d, 0x52, 0x49, 0x77, 0x45, 0x41, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x46, 0x45, 0x77, 0x6c, 0x42, 0x4f, 0x44, 0x49, + 0x33, 0x4e, 0x44, 0x4d, 0x79, 0x4f, 0x44, 0x63, 0x78, 0x47, 0x7a, 0x41, + 0x5a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x45, 0x6b, 0x46, + 0x44, 0x49, 0x45, 0x4e, 0x68, 0x62, 0x57, 0x56, 0x79, 0x0a, 0x5a, 0x6d, + 0x6c, 0x79, 0x62, 0x57, 0x45, 0x67, 0x55, 0x79, 0x35, 0x42, 0x4c, 0x6a, + 0x45, 0x70, 0x4d, 0x43, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, + 0x4d, 0x67, 0x51, 0x32, 0x68, 0x68, 0x62, 0x57, 0x4a, 0x6c, 0x63, 0x6e, + 0x4d, 0x67, 0x62, 0x32, 0x59, 0x67, 0x51, 0x32, 0x39, 0x74, 0x62, 0x57, + 0x56, 0x79, 0x59, 0x32, 0x55, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, + 0x41, 0x74, 0x0a, 0x49, 0x44, 0x49, 0x77, 0x4d, 0x44, 0x69, 0x43, 0x43, + 0x51, 0x43, 0x6a, 0x32, 0x6b, 0x4a, 0x2b, 0x70, 0x4c, 0x47, 0x75, 0x32, + 0x6a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x50, + 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x67, 0x42, 0x44, 0x59, 0x77, 0x4e, + 0x44, 0x41, 0x79, 0x42, 0x67, 0x52, 0x56, 0x0a, 0x48, 0x53, 0x41, 0x41, + 0x4d, 0x43, 0x6f, 0x77, 0x4b, 0x41, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, + 0x42, 0x51, 0x55, 0x48, 0x41, 0x67, 0x45, 0x57, 0x48, 0x47, 0x68, 0x30, + 0x64, 0x48, 0x41, 0x36, 0x4c, 0x79, 0x39, 0x77, 0x62, 0x32, 0x78, 0x70, + 0x59, 0x33, 0x6b, 0x75, 0x59, 0x32, 0x46, 0x74, 0x5a, 0x58, 0x4a, 0x6d, + 0x61, 0x58, 0x4a, 0x74, 0x59, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x77, + 0x0a, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, + 0x42, 0x41, 0x4a, 0x41, 0x53, 0x72, 0x79, 0x49, 0x31, 0x77, 0x71, 0x4d, + 0x35, 0x38, 0x43, 0x37, 0x65, 0x36, 0x62, 0x58, 0x70, 0x65, 0x48, 0x78, + 0x49, 0x76, 0x6a, 0x39, 0x39, 0x52, 0x5a, 0x4a, 0x65, 0x36, 0x64, 0x71, + 0x78, 0x47, 0x66, 0x77, 0x57, 0x0a, 0x50, 0x4a, 0x2b, 0x30, 0x57, 0x32, + 0x61, 0x65, 0x61, 0x75, 0x66, 0x44, 0x75, 0x56, 0x32, 0x49, 0x36, 0x41, + 0x2b, 0x74, 0x7a, 0x79, 0x4d, 0x50, 0x33, 0x69, 0x55, 0x36, 0x58, 0x73, + 0x78, 0x50, 0x70, 0x63, 0x47, 0x31, 0x4c, 0x61, 0x77, 0x6b, 0x30, 0x6c, + 0x67, 0x48, 0x33, 0x71, 0x4c, 0x50, 0x61, 0x59, 0x52, 0x67, 0x4d, 0x2b, + 0x67, 0x51, 0x44, 0x52, 0x4f, 0x70, 0x49, 0x39, 0x43, 0x46, 0x0a, 0x35, + 0x59, 0x35, 0x37, 0x70, 0x70, 0x34, 0x39, 0x63, 0x68, 0x4e, 0x79, 0x4d, + 0x2f, 0x57, 0x71, 0x66, 0x63, 0x5a, 0x6a, 0x48, 0x77, 0x6a, 0x30, 0x2f, + 0x67, 0x46, 0x2f, 0x4a, 0x4d, 0x38, 0x72, 0x4c, 0x46, 0x51, 0x4a, 0x33, + 0x75, 0x49, 0x72, 0x62, 0x5a, 0x4c, 0x47, 0x4f, 0x55, 0x38, 0x57, 0x36, + 0x6a, 0x78, 0x2b, 0x65, 0x6b, 0x62, 0x55, 0x52, 0x57, 0x70, 0x47, 0x71, + 0x4f, 0x74, 0x31, 0x0a, 0x67, 0x6c, 0x61, 0x6e, 0x71, 0x36, 0x42, 0x38, + 0x61, 0x42, 0x4d, 0x7a, 0x39, 0x70, 0x30, 0x77, 0x38, 0x47, 0x38, 0x6e, + 0x4f, 0x53, 0x51, 0x6a, 0x4b, 0x70, 0x44, 0x39, 0x6b, 0x43, 0x6b, 0x31, + 0x38, 0x70, 0x50, 0x66, 0x4e, 0x4b, 0x58, 0x47, 0x39, 0x2f, 0x6a, 0x76, + 0x6a, 0x41, 0x39, 0x69, 0x53, 0x6e, 0x79, 0x75, 0x30, 0x2f, 0x56, 0x55, + 0x2b, 0x49, 0x32, 0x32, 0x6d, 0x6c, 0x61, 0x48, 0x0a, 0x46, 0x6f, 0x49, + 0x36, 0x4d, 0x36, 0x74, 0x61, 0x49, 0x67, 0x6a, 0x33, 0x67, 0x72, 0x72, + 0x71, 0x4c, 0x75, 0x42, 0x48, 0x6d, 0x72, 0x53, 0x31, 0x52, 0x61, 0x4d, + 0x46, 0x4f, 0x39, 0x6e, 0x63, 0x4c, 0x6b, 0x56, 0x41, 0x4f, 0x2b, 0x72, + 0x63, 0x66, 0x2b, 0x67, 0x37, 0x36, 0x39, 0x48, 0x73, 0x4a, 0x74, 0x67, + 0x31, 0x70, 0x44, 0x44, 0x46, 0x4f, 0x71, 0x78, 0x58, 0x6e, 0x72, 0x4e, + 0x32, 0x0a, 0x70, 0x53, 0x42, 0x37, 0x2b, 0x52, 0x35, 0x4b, 0x42, 0x57, + 0x49, 0x42, 0x70, 0x69, 0x68, 0x31, 0x59, 0x4a, 0x65, 0x53, 0x44, 0x57, + 0x34, 0x2b, 0x54, 0x54, 0x64, 0x44, 0x44, 0x5a, 0x49, 0x56, 0x6e, 0x42, + 0x67, 0x69, 0x7a, 0x56, 0x47, 0x5a, 0x6f, 0x43, 0x6b, 0x61, 0x50, 0x46, + 0x2b, 0x4b, 0x4d, 0x6a, 0x4e, 0x62, 0x4d, 0x4d, 0x65, 0x4a, 0x4c, 0x30, + 0x65, 0x59, 0x44, 0x36, 0x4d, 0x44, 0x0a, 0x78, 0x76, 0x62, 0x78, 0x72, + 0x4e, 0x38, 0x79, 0x38, 0x4e, 0x6d, 0x42, 0x47, 0x75, 0x53, 0x63, 0x76, + 0x66, 0x61, 0x41, 0x46, 0x50, 0x44, 0x52, 0x4c, 0x4c, 0x6d, 0x46, 0x39, + 0x64, 0x69, 0x6a, 0x73, 0x63, 0x69, 0x6c, 0x49, 0x65, 0x55, 0x63, 0x45, + 0x35, 0x66, 0x75, 0x44, 0x72, 0x33, 0x66, 0x4b, 0x61, 0x6e, 0x76, 0x4e, + 0x46, 0x4e, 0x62, 0x30, 0x2b, 0x52, 0x71, 0x45, 0x34, 0x51, 0x47, 0x0a, + 0x74, 0x6a, 0x49, 0x43, 0x78, 0x46, 0x4b, 0x75, 0x49, 0x74, 0x4c, 0x63, + 0x73, 0x69, 0x46, 0x43, 0x47, 0x74, 0x70, 0x41, 0x38, 0x43, 0x6e, 0x4a, + 0x37, 0x41, 0x6f, 0x4d, 0x58, 0x4f, 0x4c, 0x51, 0x75, 0x73, 0x78, 0x49, + 0x30, 0x7a, 0x63, 0x4b, 0x7a, 0x42, 0x49, 0x4b, 0x69, 0x6e, 0x6d, 0x77, + 0x50, 0x51, 0x4e, 0x2f, 0x61, 0x55, 0x76, 0x30, 0x4e, 0x43, 0x42, 0x39, + 0x73, 0x7a, 0x54, 0x71, 0x0a, 0x6a, 0x6b, 0x74, 0x6b, 0x39, 0x54, 0x37, + 0x39, 0x73, 0x79, 0x4e, 0x6e, 0x46, 0x51, 0x30, 0x45, 0x75, 0x50, 0x41, + 0x74, 0x77, 0x51, 0x6c, 0x52, 0x50, 0x4c, 0x4a, 0x73, 0x46, 0x66, 0x43, + 0x6c, 0x49, 0x39, 0x65, 0x44, 0x64, 0x4f, 0x54, 0x6c, 0x4c, 0x73, 0x6e, + 0x2b, 0x6d, 0x43, 0x64, 0x43, 0x78, 0x71, 0x76, 0x47, 0x6e, 0x72, 0x44, + 0x51, 0x57, 0x7a, 0x69, 0x6c, 0x6d, 0x31, 0x44, 0x65, 0x0a, 0x66, 0x68, + 0x69, 0x59, 0x74, 0x55, 0x55, 0x37, 0x39, 0x6e, 0x6d, 0x30, 0x36, 0x50, + 0x63, 0x61, 0x65, 0x77, 0x61, 0x44, 0x2b, 0x39, 0x43, 0x4c, 0x32, 0x72, + 0x76, 0x48, 0x76, 0x52, 0x69, 0x72, 0x43, 0x47, 0x38, 0x38, 0x67, 0x47, + 0x74, 0x41, 0x50, 0x78, 0x6b, 0x5a, 0x75, 0x6d, 0x57, 0x4b, 0x35, 0x72, + 0x37, 0x56, 0x58, 0x4e, 0x4d, 0x32, 0x31, 0x2b, 0x39, 0x41, 0x55, 0x69, + 0x52, 0x67, 0x0a, 0x4f, 0x47, 0x63, 0x45, 0x4d, 0x65, 0x79, 0x50, 0x38, + 0x34, 0x4c, 0x47, 0x33, 0x72, 0x6c, 0x56, 0x38, 0x7a, 0x73, 0x78, 0x6b, + 0x56, 0x72, 0x63, 0x74, 0x51, 0x67, 0x56, 0x72, 0x58, 0x59, 0x6c, 0x43, + 0x67, 0x31, 0x37, 0x4c, 0x6f, 0x66, 0x69, 0x44, 0x4b, 0x59, 0x47, 0x76, + 0x43, 0x59, 0x51, 0x62, 0x54, 0x65, 0x64, 0x37, 0x4e, 0x31, 0x34, 0x6a, + 0x48, 0x79, 0x41, 0x78, 0x66, 0x44, 0x5a, 0x0a, 0x64, 0x30, 0x6a, 0x51, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, + 0x43, 0x68, 0x61, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x69, 0x67, 0x6e, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x2d, 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, + 0x4f, 0x3d, 0x41, 0x43, 0x20, 0x43, 0x61, 0x6d, 0x65, 0x72, 0x66, 0x69, + 0x72, 0x6d, 0x61, 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x68, 0x61, 0x6d, 0x62, 0x65, + 0x72, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x2d, + 0x20, 0x32, 0x30, 0x30, 0x38, 0x20, 0x4f, 0x3d, 0x41, 0x43, 0x20, 0x43, + 0x61, 0x6d, 0x65, 0x72, 0x66, 0x69, 0x72, 0x6d, 0x61, 0x20, 0x53, 0x2e, + 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x43, 0x68, 0x61, 0x6d, + 0x62, 0x65, 0x72, 0x73, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x2d, 0x20, 0x32, 0x30, 0x30, 0x38, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x35, 0x34, 0x31, + 0x35, 0x31, 0x31, 0x37, 0x37, 0x33, 0x31, 0x31, 0x31, 0x37, 0x38, 0x38, + 0x34, 0x39, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, + 0x65, 0x3a, 0x38, 0x30, 0x3a, 0x66, 0x66, 0x3a, 0x37, 0x38, 0x3a, 0x30, + 0x31, 0x3a, 0x30, 0x63, 0x3a, 0x32, 0x65, 0x3a, 0x63, 0x31, 0x3a, 0x33, + 0x36, 0x3a, 0x62, 0x64, 0x3a, 0x66, 0x65, 0x3a, 0x39, 0x36, 0x3a, 0x39, + 0x30, 0x3a, 0x36, 0x65, 0x3a, 0x30, 0x38, 0x3a, 0x66, 0x33, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x61, 0x3a, 0x62, 0x64, + 0x3a, 0x65, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x39, 0x35, 0x3a, 0x30, 0x64, + 0x3a, 0x33, 0x35, 0x3a, 0x39, 0x63, 0x3a, 0x38, 0x39, 0x3a, 0x61, 0x65, + 0x3a, 0x63, 0x37, 0x3a, 0x35, 0x32, 0x3a, 0x61, 0x31, 0x3a, 0x32, 0x63, + 0x3a, 0x35, 0x62, 0x3a, 0x32, 0x39, 0x3a, 0x66, 0x36, 0x3a, 0x64, 0x36, + 0x3a, 0x61, 0x61, 0x3a, 0x30, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x33, 0x3a, 0x36, 0x33, 0x3a, 0x33, + 0x35, 0x3a, 0x34, 0x33, 0x3a, 0x39, 0x33, 0x3a, 0x33, 0x34, 0x3a, 0x61, + 0x37, 0x3a, 0x36, 0x39, 0x3a, 0x38, 0x30, 0x3a, 0x31, 0x36, 0x3a, 0x61, + 0x30, 0x3a, 0x64, 0x33, 0x3a, 0x32, 0x34, 0x3a, 0x64, 0x65, 0x3a, 0x37, + 0x32, 0x3a, 0x32, 0x38, 0x3a, 0x34, 0x65, 0x3a, 0x30, 0x37, 0x3a, 0x39, + 0x64, 0x3a, 0x37, 0x62, 0x3a, 0x35, 0x32, 0x3a, 0x32, 0x30, 0x3a, 0x62, + 0x62, 0x3a, 0x38, 0x66, 0x3a, 0x62, 0x64, 0x3a, 0x37, 0x34, 0x3a, 0x37, + 0x38, 0x3a, 0x31, 0x36, 0x3a, 0x65, 0x65, 0x3a, 0x62, 0x65, 0x3a, 0x62, + 0x61, 0x3a, 0x63, 0x61, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x48, 0x53, 0x54, 0x43, 0x43, 0x42, 0x54, 0x47, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x4a, 0x41, 0x4d, 0x6e, 0x4e, 0x30, 0x2b, 0x6e, + 0x56, 0x66, 0x53, 0x50, 0x4f, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, + 0x41, 0x4d, 0x49, 0x47, 0x73, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x46, 0x56, 0x54, + 0x46, 0x44, 0x4d, 0x45, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, + 0x4d, 0x36, 0x54, 0x57, 0x46, 0x6b, 0x63, 0x6d, 0x6c, 0x6b, 0x49, 0x43, + 0x68, 0x7a, 0x5a, 0x57, 0x55, 0x67, 0x59, 0x33, 0x56, 0x79, 0x63, 0x6d, + 0x56, 0x75, 0x64, 0x43, 0x42, 0x68, 0x5a, 0x47, 0x52, 0x79, 0x5a, 0x58, + 0x4e, 0x7a, 0x49, 0x47, 0x46, 0x30, 0x0a, 0x49, 0x48, 0x64, 0x33, 0x64, + 0x79, 0x35, 0x6a, 0x59, 0x57, 0x31, 0x6c, 0x63, 0x6d, 0x5a, 0x70, 0x63, + 0x6d, 0x31, 0x68, 0x4c, 0x6d, 0x4e, 0x76, 0x62, 0x53, 0x39, 0x68, 0x5a, + 0x47, 0x52, 0x79, 0x5a, 0x58, 0x4e, 0x7a, 0x4b, 0x54, 0x45, 0x53, 0x4d, + 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x52, 0x4d, 0x4a, 0x51, + 0x54, 0x67, 0x79, 0x4e, 0x7a, 0x51, 0x7a, 0x4d, 0x6a, 0x67, 0x33, 0x0a, + 0x4d, 0x52, 0x73, 0x77, 0x47, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, + 0x45, 0x78, 0x4a, 0x42, 0x51, 0x79, 0x42, 0x44, 0x59, 0x57, 0x31, 0x6c, + 0x63, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x68, 0x49, 0x46, 0x4d, 0x75, + 0x51, 0x53, 0x34, 0x78, 0x4a, 0x7a, 0x41, 0x6c, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x54, 0x48, 0x6b, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, + 0x62, 0x43, 0x42, 0x44, 0x0a, 0x61, 0x47, 0x46, 0x74, 0x59, 0x6d, 0x56, + 0x79, 0x63, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, + 0x30, 0x49, 0x43, 0x30, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4f, 0x44, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x44, 0x41, 0x34, 0x4d, 0x44, 0x45, + 0x78, 0x4d, 0x6a, 0x4d, 0x78, 0x4e, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, + 0x7a, 0x4f, 0x44, 0x41, 0x33, 0x4d, 0x7a, 0x45, 0x78, 0x0a, 0x4d, 0x6a, + 0x4d, 0x78, 0x4e, 0x44, 0x42, 0x61, 0x4d, 0x49, 0x47, 0x73, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x46, 0x56, 0x54, 0x46, 0x44, 0x4d, 0x45, 0x45, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x78, 0x4d, 0x36, 0x54, 0x57, 0x46, 0x6b, 0x63, 0x6d, + 0x6c, 0x6b, 0x49, 0x43, 0x68, 0x7a, 0x5a, 0x57, 0x55, 0x67, 0x59, 0x33, + 0x56, 0x79, 0x0a, 0x63, 0x6d, 0x56, 0x75, 0x64, 0x43, 0x42, 0x68, 0x5a, + 0x47, 0x52, 0x79, 0x5a, 0x58, 0x4e, 0x7a, 0x49, 0x47, 0x46, 0x30, 0x49, + 0x48, 0x64, 0x33, 0x64, 0x79, 0x35, 0x6a, 0x59, 0x57, 0x31, 0x6c, 0x63, + 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x68, 0x4c, 0x6d, 0x4e, 0x76, 0x62, + 0x53, 0x39, 0x68, 0x5a, 0x47, 0x52, 0x79, 0x5a, 0x58, 0x4e, 0x7a, 0x4b, + 0x54, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x52, 0x4d, 0x4a, 0x51, 0x54, 0x67, 0x79, 0x4e, 0x7a, 0x51, 0x7a, + 0x4d, 0x6a, 0x67, 0x33, 0x4d, 0x52, 0x73, 0x77, 0x47, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x4a, 0x42, 0x51, 0x79, 0x42, 0x44, + 0x59, 0x57, 0x31, 0x6c, 0x63, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x68, + 0x49, 0x46, 0x4d, 0x75, 0x51, 0x53, 0x34, 0x78, 0x4a, 0x7a, 0x41, 0x6c, + 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x48, 0x6b, 0x64, + 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, 0x44, 0x61, 0x47, 0x46, + 0x74, 0x59, 0x6d, 0x56, 0x79, 0x63, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, + 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x43, 0x30, 0x67, 0x4d, 0x6a, 0x41, + 0x77, 0x4f, 0x44, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4d, + 0x44, 0x66, 0x56, 0x74, 0x50, 0x6b, 0x4f, 0x70, 0x74, 0x32, 0x52, 0x62, + 0x51, 0x54, 0x32, 0x2f, 0x2f, 0x42, 0x74, 0x68, 0x6d, 0x4c, 0x4e, 0x30, + 0x45, 0x59, 0x6c, 0x56, 0x4a, 0x48, 0x36, 0x78, 0x65, 0x64, 0x0a, 0x4b, + 0x59, 0x69, 0x4f, 0x4e, 0x57, 0x77, 0x47, 0x4d, 0x69, 0x35, 0x48, 0x59, + 0x76, 0x4e, 0x4a, 0x42, 0x4c, 0x39, 0x39, 0x52, 0x44, 0x61, 0x78, 0x63, + 0x63, 0x79, 0x39, 0x57, 0x67, 0x6c, 0x7a, 0x31, 0x64, 0x6d, 0x46, 0x52, + 0x50, 0x2b, 0x52, 0x56, 0x79, 0x58, 0x66, 0x58, 0x6a, 0x61, 0x4f, 0x63, + 0x4e, 0x46, 0x63, 0x63, 0x55, 0x4d, 0x64, 0x32, 0x64, 0x72, 0x76, 0x58, + 0x4e, 0x4c, 0x37, 0x0a, 0x47, 0x37, 0x30, 0x36, 0x74, 0x63, 0x75, 0x74, + 0x6f, 0x38, 0x78, 0x45, 0x70, 0x77, 0x32, 0x75, 0x49, 0x52, 0x55, 0x2f, + 0x75, 0x58, 0x70, 0x62, 0x6b, 0x6e, 0x58, 0x59, 0x70, 0x42, 0x49, 0x34, + 0x69, 0x52, 0x6d, 0x4b, 0x74, 0x34, 0x44, 0x53, 0x34, 0x6a, 0x4a, 0x76, + 0x56, 0x70, 0x79, 0x52, 0x31, 0x6f, 0x67, 0x51, 0x43, 0x37, 0x4e, 0x30, + 0x5a, 0x4a, 0x4a, 0x30, 0x59, 0x50, 0x50, 0x32, 0x0a, 0x7a, 0x78, 0x68, + 0x50, 0x59, 0x4c, 0x49, 0x6a, 0x30, 0x4d, 0x63, 0x37, 0x7a, 0x6d, 0x46, + 0x4c, 0x6d, 0x59, 0x2f, 0x43, 0x44, 0x4e, 0x42, 0x41, 0x73, 0x70, 0x6a, + 0x63, 0x44, 0x61, 0x68, 0x4f, 0x6f, 0x37, 0x6b, 0x4b, 0x72, 0x6d, 0x43, + 0x67, 0x72, 0x55, 0x56, 0x53, 0x59, 0x37, 0x70, 0x6d, 0x76, 0x57, 0x6a, + 0x67, 0x2b, 0x62, 0x34, 0x61, 0x71, 0x49, 0x47, 0x37, 0x48, 0x6b, 0x46, + 0x34, 0x0a, 0x64, 0x64, 0x50, 0x42, 0x2f, 0x67, 0x42, 0x56, 0x73, 0x49, + 0x64, 0x55, 0x36, 0x43, 0x65, 0x51, 0x4e, 0x52, 0x31, 0x4d, 0x4d, 0x36, + 0x32, 0x58, 0x2f, 0x4a, 0x63, 0x75, 0x6d, 0x49, 0x53, 0x2f, 0x4c, 0x4d, + 0x6d, 0x6a, 0x76, 0x39, 0x47, 0x59, 0x45, 0x52, 0x54, 0x74, 0x59, 0x2f, + 0x6a, 0x4b, 0x6d, 0x49, 0x68, 0x59, 0x46, 0x35, 0x6e, 0x74, 0x52, 0x51, + 0x4f, 0x58, 0x66, 0x6a, 0x79, 0x47, 0x0a, 0x48, 0x6f, 0x69, 0x4d, 0x76, + 0x76, 0x4b, 0x52, 0x68, 0x49, 0x39, 0x6c, 0x4e, 0x4e, 0x67, 0x41, 0x54, + 0x48, 0x32, 0x33, 0x4d, 0x52, 0x64, 0x61, 0x4b, 0x58, 0x6f, 0x4b, 0x47, + 0x43, 0x51, 0x77, 0x6f, 0x7a, 0x65, 0x31, 0x65, 0x71, 0x6b, 0x42, 0x66, + 0x53, 0x62, 0x57, 0x2b, 0x51, 0x36, 0x4f, 0x57, 0x66, 0x48, 0x39, 0x47, + 0x7a, 0x4f, 0x31, 0x4b, 0x54, 0x73, 0x58, 0x4f, 0x30, 0x47, 0x32, 0x0a, + 0x49, 0x64, 0x33, 0x55, 0x77, 0x44, 0x32, 0x6c, 0x6e, 0x35, 0x38, 0x66, + 0x51, 0x31, 0x44, 0x4a, 0x75, 0x37, 0x78, 0x73, 0x65, 0x70, 0x65, 0x59, + 0x37, 0x73, 0x32, 0x4d, 0x48, 0x2f, 0x75, 0x63, 0x55, 0x61, 0x36, 0x4c, + 0x63, 0x4c, 0x30, 0x6e, 0x6e, 0x33, 0x48, 0x41, 0x61, 0x36, 0x78, 0x39, + 0x6b, 0x47, 0x62, 0x6f, 0x31, 0x31, 0x30, 0x36, 0x44, 0x62, 0x44, 0x56, + 0x77, 0x6f, 0x33, 0x56, 0x0a, 0x79, 0x4a, 0x32, 0x64, 0x77, 0x57, 0x33, + 0x51, 0x30, 0x4c, 0x39, 0x52, 0x35, 0x4f, 0x50, 0x34, 0x77, 0x7a, 0x67, + 0x32, 0x72, 0x74, 0x61, 0x6e, 0x64, 0x65, 0x61, 0x76, 0x68, 0x45, 0x4e, + 0x64, 0x6b, 0x35, 0x49, 0x4d, 0x61, 0x67, 0x66, 0x65, 0x4f, 0x78, 0x32, + 0x59, 0x49, 0x74, 0x61, 0x73, 0x77, 0x54, 0x58, 0x62, 0x6f, 0x36, 0x41, + 0x6c, 0x2f, 0x33, 0x4b, 0x31, 0x64, 0x68, 0x33, 0x65, 0x0a, 0x62, 0x65, + 0x6b, 0x73, 0x5a, 0x69, 0x78, 0x53, 0x68, 0x4e, 0x42, 0x46, 0x6b, 0x73, + 0x34, 0x63, 0x35, 0x65, 0x55, 0x7a, 0x48, 0x64, 0x77, 0x48, 0x55, 0x31, + 0x53, 0x6a, 0x71, 0x6f, 0x49, 0x37, 0x6d, 0x6a, 0x63, 0x76, 0x33, 0x4e, + 0x32, 0x67, 0x5a, 0x4f, 0x6e, 0x6d, 0x33, 0x62, 0x32, 0x75, 0x2f, 0x47, + 0x53, 0x46, 0x48, 0x54, 0x79, 0x6e, 0x79, 0x51, 0x62, 0x65, 0x68, 0x50, + 0x39, 0x72, 0x0a, 0x36, 0x47, 0x73, 0x61, 0x50, 0x4d, 0x57, 0x69, 0x73, + 0x30, 0x4c, 0x37, 0x69, 0x77, 0x6b, 0x2b, 0x58, 0x77, 0x68, 0x53, 0x78, + 0x32, 0x4c, 0x45, 0x31, 0x41, 0x56, 0x78, 0x76, 0x38, 0x52, 0x6b, 0x35, + 0x50, 0x69, 0x68, 0x67, 0x2b, 0x67, 0x2b, 0x45, 0x70, 0x75, 0x6f, 0x48, + 0x74, 0x51, 0x32, 0x54, 0x53, 0x39, 0x78, 0x39, 0x6f, 0x30, 0x6f, 0x39, + 0x6f, 0x4f, 0x70, 0x45, 0x39, 0x4a, 0x68, 0x0a, 0x77, 0x5a, 0x47, 0x37, + 0x53, 0x4d, 0x41, 0x30, 0x6a, 0x30, 0x47, 0x4d, 0x53, 0x30, 0x7a, 0x62, + 0x61, 0x52, 0x4c, 0x2f, 0x55, 0x4a, 0x53, 0x63, 0x49, 0x49, 0x4e, 0x5a, + 0x63, 0x2b, 0x31, 0x38, 0x6f, 0x66, 0x4c, 0x78, 0x2f, 0x64, 0x33, 0x33, + 0x53, 0x64, 0x4e, 0x44, 0x57, 0x4b, 0x42, 0x57, 0x59, 0x38, 0x6f, 0x39, + 0x50, 0x65, 0x55, 0x31, 0x56, 0x6c, 0x6e, 0x70, 0x44, 0x73, 0x6f, 0x67, + 0x0a, 0x7a, 0x43, 0x74, 0x4c, 0x6b, 0x79, 0x6b, 0x50, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x67, 0x46, 0x71, 0x4d, 0x49, 0x49, + 0x42, 0x5a, 0x6a, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x43, 0x44, 0x41, 0x47, 0x41, 0x51, 0x48, + 0x2f, 0x41, 0x67, 0x45, 0x4d, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x67, 0x51, 0x57, 0x0a, 0x42, 0x42, 0x53, 0x35, 0x43, 0x63, + 0x71, 0x63, 0x48, 0x74, 0x76, 0x54, 0x62, 0x44, 0x70, 0x72, 0x72, 0x75, + 0x31, 0x55, 0x38, 0x56, 0x75, 0x54, 0x42, 0x6a, 0x55, 0x75, 0x58, 0x6a, + 0x43, 0x42, 0x34, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x49, + 0x48, 0x5a, 0x4d, 0x49, 0x48, 0x57, 0x67, 0x42, 0x53, 0x35, 0x43, 0x63, + 0x71, 0x63, 0x48, 0x74, 0x76, 0x54, 0x62, 0x44, 0x70, 0x72, 0x0a, 0x72, + 0x75, 0x31, 0x55, 0x38, 0x56, 0x75, 0x54, 0x42, 0x6a, 0x55, 0x75, 0x58, + 0x71, 0x47, 0x42, 0x73, 0x71, 0x53, 0x42, 0x72, 0x7a, 0x43, 0x42, 0x72, + 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x52, 0x56, 0x55, 0x78, 0x51, 0x7a, 0x42, 0x42, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x4f, 0x6b, 0x31, 0x68, 0x5a, + 0x48, 0x4a, 0x70, 0x0a, 0x5a, 0x43, 0x41, 0x6f, 0x63, 0x32, 0x56, 0x6c, + 0x49, 0x47, 0x4e, 0x31, 0x63, 0x6e, 0x4a, 0x6c, 0x62, 0x6e, 0x51, 0x67, + 0x59, 0x57, 0x52, 0x6b, 0x63, 0x6d, 0x56, 0x7a, 0x63, 0x79, 0x42, 0x68, + 0x64, 0x43, 0x42, 0x33, 0x64, 0x33, 0x63, 0x75, 0x59, 0x32, 0x46, 0x74, + 0x5a, 0x58, 0x4a, 0x6d, 0x61, 0x58, 0x4a, 0x74, 0x59, 0x53, 0x35, 0x6a, + 0x62, 0x32, 0x30, 0x76, 0x59, 0x57, 0x52, 0x6b, 0x0a, 0x63, 0x6d, 0x56, + 0x7a, 0x63, 0x79, 0x6b, 0x78, 0x45, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x55, 0x54, 0x43, 0x55, 0x45, 0x34, 0x4d, 0x6a, 0x63, + 0x30, 0x4d, 0x7a, 0x49, 0x34, 0x4e, 0x7a, 0x45, 0x62, 0x4d, 0x42, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x53, 0x51, 0x55, 0x4d, + 0x67, 0x51, 0x32, 0x46, 0x74, 0x5a, 0x58, 0x4a, 0x6d, 0x61, 0x58, 0x4a, + 0x74, 0x0a, 0x59, 0x53, 0x42, 0x54, 0x4c, 0x6b, 0x45, 0x75, 0x4d, 0x53, + 0x63, 0x77, 0x4a, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, + 0x35, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x67, 0x51, 0x32, + 0x68, 0x68, 0x62, 0x57, 0x4a, 0x6c, 0x63, 0x6e, 0x4e, 0x70, 0x5a, 0x32, + 0x34, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x41, 0x74, 0x49, 0x44, + 0x49, 0x77, 0x4d, 0x44, 0x69, 0x43, 0x0a, 0x43, 0x51, 0x44, 0x4a, 0x7a, + 0x64, 0x50, 0x70, 0x31, 0x58, 0x30, 0x6a, 0x7a, 0x6a, 0x41, 0x4f, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, + 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x50, 0x51, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x67, 0x42, 0x44, 0x59, 0x77, 0x4e, 0x44, 0x41, 0x79, 0x42, + 0x67, 0x52, 0x56, 0x48, 0x53, 0x41, 0x41, 0x4d, 0x43, 0x6f, 0x77, 0x0a, + 0x4b, 0x41, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, + 0x41, 0x67, 0x45, 0x57, 0x48, 0x47, 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, + 0x4c, 0x79, 0x39, 0x77, 0x62, 0x32, 0x78, 0x70, 0x59, 0x33, 0x6b, 0x75, + 0x59, 0x32, 0x46, 0x74, 0x5a, 0x58, 0x4a, 0x6d, 0x61, 0x58, 0x4a, 0x74, + 0x59, 0x53, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x49, 0x43, + 0x49, 0x66, 0x33, 0x44, 0x65, 0x6b, 0x69, 0x6a, 0x5a, 0x42, 0x5a, 0x52, + 0x47, 0x2f, 0x35, 0x42, 0x58, 0x71, 0x66, 0x45, 0x76, 0x33, 0x78, 0x6f, + 0x4e, 0x61, 0x2f, 0x70, 0x38, 0x44, 0x68, 0x78, 0x4a, 0x4a, 0x48, 0x6b, + 0x6e, 0x32, 0x45, 0x61, 0x71, 0x62, 0x79, 0x6c, 0x5a, 0x0a, 0x55, 0x6f, + 0x68, 0x77, 0x45, 0x75, 0x72, 0x64, 0x50, 0x66, 0x57, 0x62, 0x55, 0x31, + 0x52, 0x76, 0x34, 0x57, 0x43, 0x69, 0x71, 0x41, 0x6d, 0x35, 0x37, 0x4f, + 0x74, 0x5a, 0x66, 0x4d, 0x59, 0x31, 0x38, 0x64, 0x77, 0x59, 0x36, 0x66, + 0x46, 0x6e, 0x35, 0x61, 0x2b, 0x36, 0x52, 0x65, 0x41, 0x4a, 0x33, 0x73, + 0x70, 0x45, 0x44, 0x38, 0x49, 0x58, 0x44, 0x6e, 0x65, 0x52, 0x52, 0x58, + 0x6f, 0x7a, 0x0a, 0x58, 0x31, 0x2b, 0x57, 0x4c, 0x47, 0x69, 0x4c, 0x77, + 0x55, 0x65, 0x50, 0x6d, 0x4a, 0x73, 0x39, 0x77, 0x4f, 0x7a, 0x4c, 0x39, + 0x64, 0x57, 0x43, 0x6b, 0x6f, 0x51, 0x31, 0x30, 0x62, 0x34, 0x32, 0x4f, + 0x46, 0x5a, 0x79, 0x4d, 0x56, 0x74, 0x48, 0x4c, 0x61, 0x6f, 0x58, 0x70, + 0x47, 0x4e, 0x52, 0x36, 0x77, 0x6f, 0x42, 0x72, 0x58, 0x2f, 0x73, 0x64, + 0x5a, 0x37, 0x4c, 0x6f, 0x52, 0x2f, 0x78, 0x0a, 0x66, 0x78, 0x4b, 0x78, + 0x75, 0x65, 0x52, 0x6b, 0x66, 0x32, 0x66, 0x57, 0x49, 0x79, 0x72, 0x30, + 0x75, 0x44, 0x6c, 0x64, 0x6d, 0x4f, 0x67, 0x68, 0x70, 0x2b, 0x47, 0x39, + 0x50, 0x55, 0x49, 0x61, 0x64, 0x4a, 0x70, 0x77, 0x72, 0x32, 0x68, 0x73, + 0x55, 0x46, 0x31, 0x4a, 0x7a, 0x2f, 0x2f, 0x37, 0x44, 0x6c, 0x33, 0x6d, + 0x4c, 0x45, 0x66, 0x58, 0x67, 0x54, 0x70, 0x5a, 0x41, 0x4c, 0x56, 0x7a, + 0x0a, 0x61, 0x32, 0x4d, 0x67, 0x39, 0x6a, 0x46, 0x46, 0x43, 0x44, 0x6b, + 0x4f, 0x39, 0x48, 0x42, 0x2b, 0x51, 0x48, 0x42, 0x61, 0x50, 0x39, 0x42, + 0x72, 0x51, 0x71, 0x6c, 0x30, 0x50, 0x53, 0x67, 0x76, 0x41, 0x6d, 0x31, + 0x31, 0x63, 0x70, 0x55, 0x4a, 0x6a, 0x55, 0x68, 0x6a, 0x78, 0x73, 0x59, + 0x6a, 0x56, 0x35, 0x4b, 0x54, 0x58, 0x6a, 0x58, 0x42, 0x6a, 0x66, 0x6b, + 0x4b, 0x39, 0x79, 0x79, 0x64, 0x0a, 0x59, 0x68, 0x7a, 0x32, 0x72, 0x58, + 0x7a, 0x64, 0x70, 0x6a, 0x45, 0x65, 0x74, 0x72, 0x48, 0x48, 0x66, 0x6f, + 0x55, 0x6d, 0x2b, 0x71, 0x52, 0x71, 0x74, 0x64, 0x70, 0x6a, 0x4d, 0x4e, + 0x48, 0x76, 0x6b, 0x7a, 0x65, 0x79, 0x5a, 0x69, 0x39, 0x39, 0x42, 0x66, + 0x66, 0x6e, 0x74, 0x30, 0x75, 0x59, 0x6c, 0x44, 0x58, 0x41, 0x32, 0x54, + 0x6f, 0x70, 0x77, 0x5a, 0x32, 0x79, 0x55, 0x44, 0x4d, 0x64, 0x0a, 0x53, + 0x71, 0x6c, 0x61, 0x70, 0x73, 0x6b, 0x44, 0x37, 0x2b, 0x33, 0x30, 0x35, + 0x36, 0x68, 0x75, 0x69, 0x72, 0x52, 0x58, 0x68, 0x4f, 0x75, 0x6b, 0x50, + 0x39, 0x44, 0x75, 0x71, 0x71, 0x71, 0x48, 0x57, 0x32, 0x50, 0x6f, 0x6b, + 0x2b, 0x4a, 0x72, 0x71, 0x4e, 0x53, 0x34, 0x63, 0x6e, 0x68, 0x72, 0x47, + 0x2b, 0x30, 0x35, 0x35, 0x46, 0x33, 0x4c, 0x6d, 0x36, 0x71, 0x48, 0x31, + 0x55, 0x39, 0x4f, 0x0a, 0x41, 0x50, 0x37, 0x5a, 0x61, 0x70, 0x38, 0x38, + 0x4d, 0x51, 0x38, 0x6f, 0x41, 0x67, 0x46, 0x39, 0x6d, 0x4f, 0x69, 0x6e, + 0x73, 0x4b, 0x4a, 0x6b, 0x6e, 0x6e, 0x6e, 0x34, 0x53, 0x50, 0x49, 0x56, + 0x71, 0x63, 0x7a, 0x6d, 0x79, 0x45, 0x54, 0x72, 0x50, 0x33, 0x69, 0x5a, + 0x38, 0x6e, 0x74, 0x78, 0x50, 0x6a, 0x7a, 0x78, 0x6d, 0x4b, 0x66, 0x46, + 0x47, 0x42, 0x49, 0x2f, 0x35, 0x72, 0x73, 0x6f, 0x0a, 0x4d, 0x30, 0x4c, + 0x70, 0x52, 0x51, 0x70, 0x38, 0x62, 0x66, 0x4b, 0x47, 0x65, 0x53, 0x2f, + 0x46, 0x67, 0x68, 0x6c, 0x39, 0x43, 0x59, 0x6c, 0x38, 0x73, 0x6c, 0x52, + 0x32, 0x69, 0x4b, 0x37, 0x65, 0x77, 0x66, 0x50, 0x4d, 0x34, 0x57, 0x37, + 0x62, 0x4d, 0x64, 0x61, 0x54, 0x72, 0x70, 0x6d, 0x67, 0x37, 0x79, 0x56, + 0x71, 0x63, 0x35, 0x69, 0x4a, 0x57, 0x7a, 0x6f, 0x75, 0x45, 0x34, 0x67, + 0x65, 0x0a, 0x76, 0x38, 0x43, 0x53, 0x6c, 0x44, 0x51, 0x62, 0x34, 0x79, + 0x65, 0x33, 0x69, 0x78, 0x35, 0x76, 0x51, 0x76, 0x2f, 0x6e, 0x36, 0x54, + 0x65, 0x62, 0x55, 0x42, 0x30, 0x74, 0x6f, 0x76, 0x6b, 0x43, 0x37, 0x73, + 0x74, 0x59, 0x57, 0x44, 0x70, 0x78, 0x76, 0x47, 0x6a, 0x6a, 0x71, 0x73, + 0x47, 0x76, 0x48, 0x43, 0x67, 0x66, 0x6f, 0x74, 0x77, 0x6a, 0x5a, 0x54, + 0x2b, 0x42, 0x36, 0x71, 0x36, 0x5a, 0x0a, 0x30, 0x39, 0x67, 0x77, 0x7a, + 0x78, 0x4d, 0x4e, 0x54, 0x78, 0x58, 0x4a, 0x68, 0x4c, 0x79, 0x6e, 0x53, + 0x43, 0x33, 0x34, 0x4d, 0x43, 0x4e, 0x33, 0x32, 0x45, 0x5a, 0x4c, 0x65, + 0x57, 0x33, 0x32, 0x6a, 0x4f, 0x30, 0x36, 0x66, 0x32, 0x41, 0x52, 0x65, + 0x50, 0x54, 0x70, 0x6d, 0x36, 0x37, 0x56, 0x56, 0x4d, 0x42, 0x30, 0x67, + 0x4e, 0x45, 0x4c, 0x51, 0x70, 0x2f, 0x42, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x47, 0x6f, 0x20, 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x47, 0x6f, 0x44, 0x61, 0x64, + 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x47, 0x6f, 0x20, 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x47, 0x6f, + 0x44, 0x61, 0x64, 0x64, 0x79, 0x2e, 0x63, 0x6f, 0x6d, 0x2c, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x47, 0x6f, 0x20, 0x44, 0x61, 0x64, 0x64, 0x79, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x38, 0x30, 0x3a, 0x33, 0x61, 0x3a, 0x62, 0x63, 0x3a, + 0x32, 0x32, 0x3a, 0x63, 0x31, 0x3a, 0x65, 0x36, 0x3a, 0x66, 0x62, 0x3a, + 0x38, 0x64, 0x3a, 0x39, 0x62, 0x3a, 0x33, 0x62, 0x3a, 0x32, 0x37, 0x3a, + 0x34, 0x61, 0x3a, 0x33, 0x32, 0x3a, 0x31, 0x62, 0x3a, 0x39, 0x61, 0x3a, + 0x30, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, + 0x37, 0x3a, 0x62, 0x65, 0x3a, 0x61, 0x62, 0x3a, 0x63, 0x39, 0x3a, 0x32, + 0x32, 0x3a, 0x65, 0x61, 0x3a, 0x65, 0x38, 0x3a, 0x30, 0x65, 0x3a, 0x37, + 0x38, 0x3a, 0x37, 0x38, 0x3a, 0x33, 0x34, 0x3a, 0x36, 0x32, 0x3a, 0x61, + 0x37, 0x3a, 0x39, 0x66, 0x3a, 0x34, 0x35, 0x3a, 0x63, 0x32, 0x3a, 0x35, + 0x34, 0x3a, 0x66, 0x64, 0x3a, 0x65, 0x36, 0x3a, 0x38, 0x62, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x35, 0x3a, + 0x31, 0x34, 0x3a, 0x30, 0x62, 0x3a, 0x33, 0x32, 0x3a, 0x34, 0x37, 0x3a, + 0x65, 0x62, 0x3a, 0x39, 0x63, 0x3a, 0x63, 0x38, 0x3a, 0x63, 0x35, 0x3a, + 0x62, 0x34, 0x3a, 0x66, 0x30, 0x3a, 0x64, 0x37, 0x3a, 0x62, 0x35, 0x3a, + 0x33, 0x30, 0x3a, 0x39, 0x31, 0x3a, 0x66, 0x37, 0x3a, 0x33, 0x32, 0x3a, + 0x39, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x39, 0x65, 0x3a, 0x36, 0x65, 0x3a, + 0x35, 0x61, 0x3a, 0x36, 0x33, 0x3a, 0x65, 0x32, 0x3a, 0x37, 0x34, 0x3a, + 0x39, 0x64, 0x3a, 0x64, 0x33, 0x3a, 0x61, 0x63, 0x3a, 0x61, 0x39, 0x3a, + 0x31, 0x39, 0x3a, 0x38, 0x65, 0x3a, 0x64, 0x61, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x78, 0x54, 0x43, 0x43, 0x41, 0x71, 0x32, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x67, 0x7a, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x56, 0x56, 0x4d, 0x78, 0x0a, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x42, 0x30, 0x46, 0x79, 0x61, 0x58, + 0x70, 0x76, 0x62, 0x6d, 0x45, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x43, 0x6c, 0x4e, 0x6a, 0x62, 0x33, + 0x52, 0x30, 0x63, 0x32, 0x52, 0x68, 0x62, 0x47, 0x55, 0x78, 0x47, 0x6a, + 0x41, 0x59, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x0a, 0x45, + 0x55, 0x64, 0x76, 0x52, 0x47, 0x46, 0x6b, 0x5a, 0x48, 0x6b, 0x75, 0x59, + 0x32, 0x39, 0x74, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, + 0x54, 0x45, 0x77, 0x4c, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, + 0x79, 0x68, 0x48, 0x62, 0x79, 0x42, 0x45, 0x59, 0x57, 0x52, 0x6b, 0x65, + 0x53, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, + 0x6e, 0x52, 0x70, 0x0a, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, + 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, + 0x65, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, 0x4d, 0x42, 0x34, 0x58, + 0x44, 0x54, 0x41, 0x35, 0x4d, 0x44, 0x6b, 0x77, 0x4d, 0x54, 0x41, 0x77, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x33, + 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x54, 0x49, 0x7a, 0x0a, 0x4e, 0x54, 0x6b, + 0x31, 0x4f, 0x56, 0x6f, 0x77, 0x67, 0x59, 0x4d, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, + 0x54, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x49, 0x45, 0x77, 0x64, 0x42, 0x63, 0x6d, 0x6c, 0x36, 0x62, 0x32, 0x35, + 0x68, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x48, 0x0a, 0x45, 0x77, 0x70, 0x54, 0x59, 0x32, 0x39, 0x30, 0x64, 0x48, + 0x4e, 0x6b, 0x59, 0x57, 0x78, 0x6c, 0x4d, 0x52, 0x6f, 0x77, 0x47, 0x41, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x46, 0x48, 0x62, 0x30, + 0x52, 0x68, 0x5a, 0x47, 0x52, 0x35, 0x4c, 0x6d, 0x4e, 0x76, 0x62, 0x53, + 0x77, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4c, 0x6a, 0x45, 0x78, 0x4d, 0x43, + 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x41, 0x78, 0x4d, 0x6f, 0x52, + 0x32, 0x38, 0x67, 0x52, 0x47, 0x46, 0x6b, 0x5a, 0x48, 0x6b, 0x67, 0x55, + 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, + 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x5a, 0x53, 0x42, 0x42, 0x64, + 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x67, 0x4c, + 0x53, 0x42, 0x48, 0x4d, 0x6a, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x0a, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, + 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x4c, 0x39, 0x78, 0x59, 0x67, 0x6a, 0x78, 0x2b, 0x6c, 0x6b, 0x30, + 0x39, 0x78, 0x76, 0x4a, 0x47, 0x4b, 0x50, 0x33, 0x67, 0x45, 0x6c, 0x59, + 0x36, 0x53, 0x4b, 0x44, 0x0a, 0x45, 0x36, 0x62, 0x46, 0x49, 0x45, 0x4d, + 0x42, 0x4f, 0x34, 0x54, 0x78, 0x35, 0x6f, 0x56, 0x4a, 0x6e, 0x79, 0x66, + 0x71, 0x39, 0x6f, 0x51, 0x62, 0x54, 0x71, 0x43, 0x30, 0x32, 0x33, 0x43, + 0x59, 0x78, 0x7a, 0x49, 0x42, 0x73, 0x51, 0x55, 0x2b, 0x42, 0x30, 0x37, + 0x75, 0x39, 0x50, 0x70, 0x50, 0x4c, 0x31, 0x6b, 0x77, 0x49, 0x75, 0x65, + 0x72, 0x47, 0x56, 0x5a, 0x72, 0x34, 0x6f, 0x41, 0x48, 0x0a, 0x2f, 0x50, + 0x4d, 0x57, 0x64, 0x59, 0x41, 0x35, 0x55, 0x58, 0x76, 0x6c, 0x2b, 0x54, + 0x57, 0x32, 0x64, 0x45, 0x36, 0x70, 0x6a, 0x59, 0x49, 0x54, 0x35, 0x4c, + 0x59, 0x2f, 0x71, 0x51, 0x4f, 0x44, 0x2b, 0x71, 0x4b, 0x2b, 0x69, 0x68, + 0x56, 0x71, 0x66, 0x39, 0x34, 0x4c, 0x77, 0x37, 0x59, 0x5a, 0x46, 0x41, + 0x58, 0x4b, 0x36, 0x73, 0x4f, 0x6f, 0x42, 0x4a, 0x51, 0x37, 0x52, 0x6e, + 0x77, 0x79, 0x0a, 0x44, 0x66, 0x4d, 0x41, 0x5a, 0x69, 0x4c, 0x49, 0x6a, + 0x57, 0x6c, 0x74, 0x4e, 0x6f, 0x77, 0x52, 0x47, 0x4c, 0x66, 0x54, 0x73, + 0x68, 0x78, 0x67, 0x74, 0x44, 0x6a, 0x36, 0x41, 0x6f, 0x7a, 0x4f, 0x30, + 0x39, 0x31, 0x47, 0x42, 0x39, 0x34, 0x4b, 0x50, 0x75, 0x74, 0x64, 0x66, + 0x4d, 0x68, 0x38, 0x2b, 0x37, 0x41, 0x72, 0x55, 0x36, 0x53, 0x53, 0x59, + 0x6d, 0x6c, 0x52, 0x4a, 0x51, 0x56, 0x68, 0x0a, 0x47, 0x6b, 0x53, 0x42, + 0x6a, 0x43, 0x79, 0x70, 0x51, 0x35, 0x59, 0x6a, 0x33, 0x36, 0x77, 0x36, + 0x67, 0x5a, 0x6f, 0x4f, 0x4b, 0x63, 0x55, 0x63, 0x71, 0x65, 0x6c, 0x64, + 0x48, 0x72, 0x61, 0x65, 0x6e, 0x6a, 0x41, 0x4b, 0x4f, 0x63, 0x37, 0x78, + 0x69, 0x49, 0x44, 0x37, 0x53, 0x31, 0x33, 0x4d, 0x4d, 0x75, 0x79, 0x46, + 0x59, 0x6b, 0x4d, 0x6c, 0x4e, 0x41, 0x4a, 0x57, 0x4a, 0x77, 0x47, 0x52, + 0x0a, 0x74, 0x44, 0x74, 0x77, 0x4b, 0x6a, 0x39, 0x75, 0x73, 0x65, 0x69, + 0x63, 0x69, 0x41, 0x46, 0x39, 0x6e, 0x39, 0x54, 0x35, 0x32, 0x31, 0x4e, + 0x74, 0x59, 0x4a, 0x32, 0x2f, 0x4c, 0x4f, 0x64, 0x59, 0x71, 0x37, 0x68, + 0x66, 0x52, 0x76, 0x7a, 0x4f, 0x78, 0x42, 0x73, 0x44, 0x50, 0x41, 0x6e, + 0x72, 0x53, 0x54, 0x46, 0x63, 0x61, 0x55, 0x61, 0x7a, 0x34, 0x45, 0x63, + 0x43, 0x41, 0x77, 0x45, 0x41, 0x0a, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, + 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x0a, 0x46, + 0x44, 0x71, 0x61, 0x68, 0x51, 0x63, 0x51, 0x5a, 0x79, 0x69, 0x32, 0x37, + 0x2f, 0x61, 0x39, 0x42, 0x55, 0x46, 0x75, 0x49, 0x4d, 0x47, 0x55, 0x32, + 0x67, 0x2f, 0x65, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, 0x5a, 0x32, 0x31, 0x31, 0x35, 0x31, + 0x66, 0x6d, 0x58, 0x0a, 0x57, 0x57, 0x63, 0x44, 0x59, 0x66, 0x46, 0x2b, + 0x4f, 0x77, 0x59, 0x78, 0x64, 0x53, 0x32, 0x68, 0x49, 0x49, 0x35, 0x50, + 0x5a, 0x59, 0x65, 0x30, 0x39, 0x36, 0x61, 0x63, 0x76, 0x4e, 0x6a, 0x70, + 0x4c, 0x39, 0x44, 0x62, 0x57, 0x75, 0x37, 0x50, 0x64, 0x49, 0x78, 0x7a, + 0x74, 0x44, 0x68, 0x43, 0x32, 0x67, 0x56, 0x37, 0x2b, 0x41, 0x4a, 0x31, + 0x75, 0x50, 0x32, 0x6c, 0x73, 0x64, 0x65, 0x75, 0x0a, 0x39, 0x74, 0x66, + 0x65, 0x45, 0x38, 0x74, 0x54, 0x45, 0x48, 0x36, 0x4b, 0x52, 0x74, 0x47, + 0x58, 0x2b, 0x72, 0x63, 0x75, 0x4b, 0x78, 0x47, 0x72, 0x6b, 0x4c, 0x41, + 0x6e, 0x67, 0x50, 0x6e, 0x6f, 0x6e, 0x31, 0x72, 0x70, 0x4e, 0x35, 0x2b, + 0x72, 0x35, 0x4e, 0x39, 0x73, 0x73, 0x34, 0x55, 0x58, 0x6e, 0x54, 0x33, + 0x5a, 0x4a, 0x45, 0x39, 0x35, 0x6b, 0x54, 0x58, 0x57, 0x58, 0x77, 0x54, + 0x72, 0x0a, 0x67, 0x49, 0x4f, 0x72, 0x6d, 0x67, 0x49, 0x74, 0x74, 0x52, + 0x44, 0x30, 0x32, 0x4a, 0x44, 0x48, 0x42, 0x48, 0x4e, 0x41, 0x37, 0x58, + 0x49, 0x6c, 0x6f, 0x4b, 0x6d, 0x66, 0x37, 0x4a, 0x36, 0x72, 0x61, 0x42, + 0x4b, 0x5a, 0x56, 0x38, 0x61, 0x50, 0x45, 0x6a, 0x6f, 0x4a, 0x70, 0x4c, + 0x31, 0x45, 0x2f, 0x51, 0x59, 0x56, 0x4e, 0x38, 0x47, 0x62, 0x35, 0x44, + 0x4b, 0x6a, 0x37, 0x54, 0x6a, 0x6f, 0x0a, 0x32, 0x47, 0x54, 0x7a, 0x4c, + 0x48, 0x34, 0x55, 0x2f, 0x41, 0x4c, 0x71, 0x6e, 0x38, 0x33, 0x2f, 0x42, + 0x32, 0x67, 0x58, 0x32, 0x79, 0x4b, 0x51, 0x4f, 0x43, 0x31, 0x36, 0x6a, + 0x64, 0x46, 0x55, 0x38, 0x57, 0x6e, 0x6a, 0x58, 0x7a, 0x50, 0x4b, 0x65, + 0x6a, 0x31, 0x37, 0x43, 0x75, 0x50, 0x4b, 0x66, 0x31, 0x38, 0x35, 0x35, + 0x65, 0x4a, 0x31, 0x75, 0x73, 0x56, 0x32, 0x47, 0x44, 0x50, 0x4f, 0x0a, + 0x4c, 0x50, 0x41, 0x76, 0x54, 0x4b, 0x33, 0x33, 0x73, 0x65, 0x66, 0x4f, + 0x54, 0x36, 0x6a, 0x45, 0x6d, 0x30, 0x70, 0x55, 0x42, 0x73, 0x56, 0x2f, + 0x66, 0x64, 0x55, 0x49, 0x44, 0x2b, 0x49, 0x63, 0x2f, 0x6e, 0x34, 0x58, + 0x75, 0x4b, 0x78, 0x65, 0x39, 0x74, 0x51, 0x57, 0x73, 0x6b, 0x4d, 0x4a, + 0x44, 0x45, 0x33, 0x32, 0x70, 0x32, 0x75, 0x30, 0x6d, 0x59, 0x52, 0x6c, + 0x79, 0x6e, 0x71, 0x49, 0x0a, 0x34, 0x75, 0x4a, 0x45, 0x76, 0x6c, 0x7a, + 0x33, 0x36, 0x68, 0x7a, 0x31, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, + 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, + 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, 0x6c, 0x6f, + 0x67, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, + 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, + 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, + 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x2d, 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x64, 0x36, 0x3a, 0x33, 0x39, 0x3a, 0x38, 0x31, 0x3a, 0x63, + 0x36, 0x3a, 0x35, 0x32, 0x3a, 0x37, 0x65, 0x3a, 0x39, 0x36, 0x3a, 0x36, + 0x39, 0x3a, 0x66, 0x63, 0x3a, 0x66, 0x63, 0x3a, 0x63, 0x61, 0x3a, 0x36, + 0x36, 0x3a, 0x65, 0x64, 0x3a, 0x30, 0x35, 0x3a, 0x66, 0x32, 0x3a, 0x39, + 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x35, + 0x3a, 0x31, 0x63, 0x3a, 0x30, 0x36, 0x3a, 0x37, 0x63, 0x3a, 0x65, 0x65, + 0x3a, 0x32, 0x62, 0x3a, 0x30, 0x63, 0x3a, 0x33, 0x64, 0x3a, 0x66, 0x38, + 0x3a, 0x35, 0x35, 0x3a, 0x61, 0x62, 0x3a, 0x32, 0x64, 0x3a, 0x39, 0x32, + 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x65, 0x3a, 0x33, 0x39, 0x3a, 0x64, 0x34, + 0x3a, 0x65, 0x37, 0x3a, 0x30, 0x66, 0x3a, 0x30, 0x65, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x63, 0x3a, 0x65, + 0x31, 0x3a, 0x63, 0x62, 0x3a, 0x30, 0x62, 0x3a, 0x66, 0x39, 0x3a, 0x64, + 0x32, 0x3a, 0x66, 0x39, 0x3a, 0x65, 0x31, 0x3a, 0x30, 0x32, 0x3a, 0x39, + 0x39, 0x3a, 0x33, 0x66, 0x3a, 0x62, 0x65, 0x3a, 0x32, 0x31, 0x3a, 0x35, + 0x31, 0x3a, 0x35, 0x32, 0x3a, 0x63, 0x33, 0x3a, 0x62, 0x32, 0x3a, 0x64, + 0x64, 0x3a, 0x30, 0x63, 0x3a, 0x61, 0x62, 0x3a, 0x64, 0x65, 0x3a, 0x31, + 0x63, 0x3a, 0x36, 0x38, 0x3a, 0x65, 0x35, 0x3a, 0x33, 0x31, 0x3a, 0x39, + 0x62, 0x3a, 0x38, 0x33, 0x3a, 0x39, 0x31, 0x3a, 0x35, 0x34, 0x3a, 0x64, + 0x62, 0x3a, 0x62, 0x37, 0x3a, 0x66, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x44, 0x33, 0x54, 0x43, 0x43, 0x41, 0x73, 0x57, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x6a, 0x7a, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x56, 0x56, 0x4d, 0x78, 0x0a, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x67, 0x54, 0x42, 0x30, 0x46, 0x79, 0x61, 0x58, 0x70, + 0x76, 0x62, 0x6d, 0x45, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x63, 0x54, 0x43, 0x6c, 0x4e, 0x6a, 0x62, 0x33, 0x52, + 0x30, 0x63, 0x32, 0x52, 0x68, 0x62, 0x47, 0x55, 0x78, 0x4a, 0x54, 0x41, + 0x6a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x0a, 0x48, 0x46, + 0x4e, 0x30, 0x59, 0x58, 0x4a, 0x6d, 0x61, 0x57, 0x56, 0x73, 0x5a, 0x43, + 0x42, 0x55, 0x5a, 0x57, 0x4e, 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x62, 0x32, + 0x64, 0x70, 0x5a, 0x58, 0x4d, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, + 0x34, 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x4d, 0x54, 0x4b, 0x56, 0x4e, 0x30, 0x59, 0x58, 0x4a, 0x6d, 0x61, 0x57, + 0x56, 0x73, 0x0a, 0x5a, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, + 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, + 0x58, 0x52, 0x6c, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, + 0x6d, 0x6c, 0x30, 0x65, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, 0x4d, + 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x35, 0x4d, 0x44, 0x6b, 0x77, 0x4d, + 0x54, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x46, 0x6f, 0x58, + 0x44, 0x54, 0x4d, 0x33, 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x54, 0x49, 0x7a, + 0x4e, 0x54, 0x6b, 0x31, 0x4f, 0x56, 0x6f, 0x77, 0x67, 0x59, 0x38, 0x78, + 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, + 0x41, 0x6c, 0x56, 0x54, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x49, 0x45, 0x77, 0x64, 0x42, 0x63, 0x6d, 0x6c, 0x36, + 0x0a, 0x62, 0x32, 0x35, 0x68, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x48, 0x45, 0x77, 0x70, 0x54, 0x59, 0x32, 0x39, + 0x30, 0x64, 0x48, 0x4e, 0x6b, 0x59, 0x57, 0x78, 0x6c, 0x4d, 0x53, 0x55, + 0x77, 0x49, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x78, + 0x54, 0x64, 0x47, 0x46, 0x79, 0x5a, 0x6d, 0x6c, 0x6c, 0x62, 0x47, 0x51, + 0x67, 0x56, 0x47, 0x56, 0x6a, 0x0a, 0x61, 0x47, 0x35, 0x76, 0x62, 0x47, + 0x39, 0x6e, 0x61, 0x57, 0x56, 0x7a, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, + 0x4d, 0x75, 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x79, 0x6c, 0x54, 0x64, 0x47, 0x46, 0x79, 0x5a, 0x6d, + 0x6c, 0x6c, 0x62, 0x47, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, + 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x0a, 0x59, + 0x32, 0x46, 0x30, 0x5a, 0x53, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, + 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x67, 0x4c, 0x53, 0x42, 0x48, 0x4d, + 0x6a, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, + 0x51, 0x6f, 0x43, 0x0a, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4c, 0x33, 0x74, + 0x77, 0x51, 0x50, 0x38, 0x39, 0x6f, 0x2f, 0x38, 0x41, 0x72, 0x46, 0x76, + 0x57, 0x35, 0x39, 0x49, 0x32, 0x5a, 0x31, 0x35, 0x34, 0x71, 0x4b, 0x33, + 0x41, 0x32, 0x46, 0x57, 0x47, 0x4d, 0x4e, 0x48, 0x74, 0x74, 0x66, 0x4b, + 0x50, 0x54, 0x55, 0x75, 0x69, 0x55, 0x50, 0x33, 0x6f, 0x57, 0x6d, 0x62, + 0x33, 0x6f, 0x6f, 0x61, 0x2f, 0x52, 0x4d, 0x67, 0x0a, 0x6e, 0x4c, 0x52, + 0x4a, 0x64, 0x7a, 0x49, 0x70, 0x56, 0x76, 0x32, 0x35, 0x37, 0x49, 0x7a, + 0x64, 0x49, 0x76, 0x70, 0x79, 0x33, 0x43, 0x64, 0x68, 0x6c, 0x2b, 0x37, + 0x32, 0x57, 0x6f, 0x54, 0x73, 0x62, 0x68, 0x6d, 0x35, 0x69, 0x53, 0x7a, + 0x63, 0x68, 0x46, 0x76, 0x56, 0x64, 0x50, 0x74, 0x72, 0x58, 0x38, 0x57, + 0x4a, 0x70, 0x52, 0x42, 0x53, 0x69, 0x55, 0x5a, 0x56, 0x39, 0x4c, 0x68, + 0x31, 0x0a, 0x48, 0x4f, 0x5a, 0x2f, 0x35, 0x46, 0x53, 0x75, 0x53, 0x2f, + 0x68, 0x56, 0x63, 0x6c, 0x63, 0x43, 0x47, 0x66, 0x67, 0x58, 0x63, 0x56, + 0x6e, 0x72, 0x48, 0x69, 0x67, 0x48, 0x64, 0x4d, 0x57, 0x64, 0x53, 0x4c, + 0x35, 0x73, 0x74, 0x50, 0x53, 0x6b, 0x73, 0x50, 0x4e, 0x6b, 0x4e, 0x33, + 0x6d, 0x53, 0x77, 0x4f, 0x78, 0x47, 0x58, 0x6e, 0x2f, 0x68, 0x62, 0x56, + 0x4e, 0x4d, 0x59, 0x71, 0x2f, 0x4e, 0x0a, 0x48, 0x77, 0x74, 0x6a, 0x75, + 0x7a, 0x71, 0x64, 0x2b, 0x2f, 0x78, 0x35, 0x41, 0x4a, 0x68, 0x68, 0x64, + 0x4d, 0x38, 0x6d, 0x67, 0x6b, 0x42, 0x6a, 0x38, 0x37, 0x4a, 0x79, 0x61, + 0x68, 0x6b, 0x4e, 0x6d, 0x63, 0x72, 0x55, 0x44, 0x6e, 0x58, 0x4d, 0x4e, + 0x2f, 0x75, 0x4c, 0x69, 0x63, 0x46, 0x5a, 0x38, 0x57, 0x4a, 0x2f, 0x58, + 0x37, 0x4e, 0x66, 0x5a, 0x54, 0x44, 0x34, 0x70, 0x37, 0x64, 0x4e, 0x0a, + 0x64, 0x6c, 0x6f, 0x65, 0x64, 0x6c, 0x34, 0x30, 0x77, 0x4f, 0x69, 0x57, + 0x56, 0x70, 0x6d, 0x4b, 0x73, 0x2f, 0x42, 0x2f, 0x70, 0x4d, 0x32, 0x39, + 0x33, 0x44, 0x49, 0x78, 0x66, 0x4a, 0x48, 0x50, 0x34, 0x46, 0x38, 0x52, + 0x2b, 0x47, 0x75, 0x71, 0x53, 0x56, 0x7a, 0x52, 0x6d, 0x5a, 0x54, 0x52, + 0x6f, 0x75, 0x4e, 0x6a, 0x57, 0x77, 0x6c, 0x32, 0x74, 0x56, 0x5a, 0x69, + 0x34, 0x55, 0x74, 0x30, 0x0a, 0x48, 0x5a, 0x62, 0x55, 0x4a, 0x74, 0x51, + 0x49, 0x42, 0x46, 0x6e, 0x51, 0x6d, 0x41, 0x34, 0x4f, 0x35, 0x74, 0x37, + 0x38, 0x77, 0x2b, 0x77, 0x66, 0x6b, 0x50, 0x45, 0x43, 0x41, 0x77, 0x45, + 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x44, 0x77, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, + 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x0a, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, + 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x48, 0x77, 0x4d, 0x4d, 0x68, + 0x2b, 0x6e, 0x32, 0x54, 0x42, 0x2f, 0x78, 0x48, 0x31, 0x6f, 0x6f, 0x32, + 0x4b, 0x6f, 0x6f, 0x63, 0x36, 0x72, 0x42, 0x31, 0x73, 0x6e, 0x4d, 0x41, + 0x30, 0x47, 0x0a, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, + 0x51, 0x41, 0x52, 0x57, 0x66, 0x6f, 0x6c, 0x54, 0x77, 0x4e, 0x76, 0x6c, + 0x4a, 0x6b, 0x37, 0x6d, 0x68, 0x2b, 0x43, 0x68, 0x54, 0x6e, 0x55, 0x64, + 0x67, 0x57, 0x55, 0x58, 0x75, 0x45, 0x6f, 0x6b, 0x32, 0x31, 0x69, 0x58, + 0x51, 0x6e, 0x43, 0x6f, 0x4b, 0x6a, 0x55, 0x0a, 0x73, 0x48, 0x55, 0x34, + 0x38, 0x54, 0x52, 0x71, 0x6e, 0x65, 0x53, 0x66, 0x69, 0x6f, 0x59, 0x6d, + 0x55, 0x65, 0x59, 0x73, 0x30, 0x63, 0x59, 0x74, 0x62, 0x70, 0x55, 0x67, + 0x53, 0x70, 0x49, 0x42, 0x37, 0x4c, 0x69, 0x4b, 0x5a, 0x33, 0x73, 0x78, + 0x34, 0x6d, 0x63, 0x75, 0x6a, 0x4a, 0x55, 0x44, 0x4a, 0x69, 0x35, 0x44, + 0x6e, 0x55, 0x6f, 0x78, 0x39, 0x67, 0x36, 0x31, 0x44, 0x4c, 0x75, 0x33, + 0x0a, 0x34, 0x6a, 0x64, 0x2f, 0x49, 0x72, 0x6f, 0x41, 0x6f, 0x77, 0x35, + 0x37, 0x55, 0x76, 0x74, 0x72, 0x75, 0x7a, 0x76, 0x45, 0x30, 0x33, 0x6c, + 0x52, 0x54, 0x73, 0x32, 0x51, 0x39, 0x47, 0x63, 0x48, 0x47, 0x63, 0x67, + 0x38, 0x52, 0x6e, 0x6f, 0x4e, 0x41, 0x58, 0x33, 0x46, 0x57, 0x4f, 0x64, + 0x74, 0x35, 0x6f, 0x55, 0x77, 0x46, 0x35, 0x6f, 0x6b, 0x78, 0x42, 0x44, + 0x67, 0x42, 0x50, 0x66, 0x67, 0x0a, 0x38, 0x6e, 0x2f, 0x55, 0x71, 0x67, + 0x72, 0x2f, 0x51, 0x68, 0x30, 0x33, 0x37, 0x5a, 0x54, 0x6c, 0x5a, 0x46, + 0x6b, 0x53, 0x49, 0x48, 0x63, 0x34, 0x30, 0x7a, 0x49, 0x2b, 0x4f, 0x49, + 0x46, 0x31, 0x6c, 0x6e, 0x50, 0x36, 0x61, 0x49, 0x2b, 0x78, 0x79, 0x38, + 0x34, 0x66, 0x78, 0x65, 0x7a, 0x36, 0x6e, 0x48, 0x37, 0x50, 0x66, 0x72, + 0x48, 0x78, 0x42, 0x79, 0x32, 0x32, 0x2f, 0x4c, 0x2f, 0x4b, 0x0a, 0x70, + 0x4c, 0x2f, 0x51, 0x6c, 0x77, 0x56, 0x4b, 0x76, 0x4f, 0x6f, 0x59, 0x4b, + 0x41, 0x4b, 0x51, 0x76, 0x56, 0x52, 0x34, 0x43, 0x53, 0x46, 0x78, 0x30, + 0x39, 0x46, 0x39, 0x48, 0x64, 0x6b, 0x57, 0x73, 0x4b, 0x6c, 0x68, 0x50, + 0x64, 0x41, 0x4b, 0x41, 0x43, 0x4c, 0x38, 0x78, 0x33, 0x76, 0x4c, 0x43, + 0x57, 0x52, 0x46, 0x43, 0x7a, 0x74, 0x41, 0x67, 0x66, 0x64, 0x39, 0x66, + 0x44, 0x4c, 0x31, 0x0a, 0x6d, 0x4d, 0x70, 0x59, 0x6a, 0x6e, 0x30, 0x71, + 0x37, 0x70, 0x42, 0x5a, 0x63, 0x32, 0x54, 0x35, 0x4e, 0x6e, 0x52, 0x65, + 0x4a, 0x61, 0x48, 0x31, 0x5a, 0x67, 0x55, 0x75, 0x66, 0x7a, 0x6b, 0x56, + 0x71, 0x53, 0x72, 0x37, 0x55, 0x49, 0x75, 0x4f, 0x68, 0x57, 0x6e, 0x30, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x74, + 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x54, 0x65, 0x63, 0x68, + 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x74, + 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x54, 0x65, 0x63, 0x68, + 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x53, 0x74, 0x61, 0x72, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, + 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x31, 0x37, 0x3a, 0x33, 0x35, 0x3a, 0x37, 0x34, 0x3a, 0x61, 0x66, 0x3a, + 0x37, 0x62, 0x3a, 0x36, 0x31, 0x3a, 0x31, 0x63, 0x3a, 0x65, 0x62, 0x3a, + 0x66, 0x34, 0x3a, 0x66, 0x39, 0x3a, 0x33, 0x63, 0x3a, 0x65, 0x32, 0x3a, + 0x65, 0x65, 0x3a, 0x34, 0x30, 0x3a, 0x66, 0x39, 0x3a, 0x61, 0x32, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x32, 0x3a, 0x35, + 0x61, 0x3a, 0x38, 0x66, 0x3a, 0x38, 0x64, 0x3a, 0x32, 0x63, 0x3a, 0x36, + 0x64, 0x3a, 0x30, 0x34, 0x3a, 0x65, 0x30, 0x3a, 0x36, 0x36, 0x3a, 0x35, + 0x66, 0x3a, 0x35, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x66, 0x66, 0x3a, 0x32, + 0x32, 0x3a, 0x64, 0x38, 0x3a, 0x36, 0x33, 0x3a, 0x65, 0x38, 0x3a, 0x32, + 0x35, 0x3a, 0x36, 0x66, 0x3a, 0x33, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x36, 0x3a, 0x38, 0x64, 0x3a, + 0x36, 0x39, 0x3a, 0x30, 0x35, 0x3a, 0x61, 0x32, 0x3a, 0x63, 0x38, 0x3a, + 0x38, 0x37, 0x3a, 0x30, 0x38, 0x3a, 0x61, 0x34, 0x3a, 0x62, 0x33, 0x3a, + 0x30, 0x32, 0x3a, 0x35, 0x31, 0x3a, 0x39, 0x30, 0x3a, 0x65, 0x64, 0x3a, + 0x63, 0x66, 0x3a, 0x65, 0x64, 0x3a, 0x62, 0x31, 0x3a, 0x39, 0x37, 0x3a, + 0x34, 0x61, 0x3a, 0x36, 0x30, 0x3a, 0x36, 0x61, 0x3a, 0x31, 0x33, 0x3a, + 0x63, 0x36, 0x3a, 0x65, 0x35, 0x3a, 0x32, 0x39, 0x3a, 0x30, 0x66, 0x3a, + 0x63, 0x62, 0x3a, 0x32, 0x61, 0x3a, 0x65, 0x36, 0x3a, 0x33, 0x65, 0x3a, + 0x64, 0x61, 0x3a, 0x62, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x44, 0x37, 0x7a, 0x43, 0x43, 0x41, 0x74, 0x65, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x6d, 0x44, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x0a, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x67, 0x54, 0x42, 0x30, 0x46, 0x79, 0x61, 0x58, 0x70, 0x76, 0x62, + 0x6d, 0x45, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x63, 0x54, 0x43, 0x6c, 0x4e, 0x6a, 0x62, 0x33, 0x52, 0x30, 0x63, + 0x32, 0x52, 0x68, 0x62, 0x47, 0x55, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x0a, 0x48, 0x46, 0x4e, 0x30, + 0x59, 0x58, 0x4a, 0x6d, 0x61, 0x57, 0x56, 0x73, 0x5a, 0x43, 0x42, 0x55, + 0x5a, 0x57, 0x4e, 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x62, 0x32, 0x64, 0x70, + 0x5a, 0x58, 0x4d, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, + 0x4f, 0x7a, 0x41, 0x35, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, + 0x4d, 0x6c, 0x4e, 0x30, 0x59, 0x58, 0x4a, 0x6d, 0x61, 0x57, 0x56, 0x73, + 0x0a, 0x5a, 0x43, 0x42, 0x54, 0x5a, 0x58, 0x4a, 0x32, 0x61, 0x57, 0x4e, + 0x6c, 0x63, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, + 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, + 0x6c, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, + 0x30, 0x65, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x79, 0x4d, 0x42, 0x34, + 0x58, 0x44, 0x54, 0x41, 0x35, 0x0a, 0x4d, 0x44, 0x6b, 0x77, 0x4d, 0x54, + 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, + 0x4d, 0x33, 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x54, 0x49, 0x7a, 0x4e, 0x54, + 0x6b, 0x31, 0x4f, 0x56, 0x6f, 0x77, 0x67, 0x5a, 0x67, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, + 0x56, 0x54, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x0a, 0x56, + 0x51, 0x51, 0x49, 0x45, 0x77, 0x64, 0x42, 0x63, 0x6d, 0x6c, 0x36, 0x62, + 0x32, 0x35, 0x68, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x48, 0x45, 0x77, 0x70, 0x54, 0x59, 0x32, 0x39, 0x30, 0x64, + 0x48, 0x4e, 0x6b, 0x59, 0x57, 0x78, 0x6c, 0x4d, 0x53, 0x55, 0x77, 0x49, + 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x78, 0x54, 0x64, + 0x47, 0x46, 0x79, 0x0a, 0x5a, 0x6d, 0x6c, 0x6c, 0x62, 0x47, 0x51, 0x67, + 0x56, 0x47, 0x56, 0x6a, 0x61, 0x47, 0x35, 0x76, 0x62, 0x47, 0x39, 0x6e, + 0x61, 0x57, 0x56, 0x7a, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, + 0x4d, 0x54, 0x73, 0x77, 0x4f, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x45, 0x7a, 0x4a, 0x54, 0x64, 0x47, 0x46, 0x79, 0x5a, 0x6d, 0x6c, 0x6c, + 0x62, 0x47, 0x51, 0x67, 0x55, 0x32, 0x56, 0x79, 0x0a, 0x64, 0x6d, 0x6c, + 0x6a, 0x5a, 0x58, 0x4d, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, + 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, + 0x30, 0x5a, 0x53, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, + 0x70, 0x64, 0x48, 0x6b, 0x67, 0x4c, 0x53, 0x42, 0x48, 0x4d, 0x6a, 0x43, + 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, + 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, + 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, + 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4e, 0x55, 0x4d, 0x4f, 0x73, + 0x51, 0x71, 0x2b, 0x55, 0x37, 0x69, 0x39, 0x62, 0x34, 0x5a, 0x6c, 0x31, + 0x2b, 0x4f, 0x69, 0x46, 0x4f, 0x78, 0x48, 0x7a, 0x2f, 0x4c, 0x7a, 0x35, + 0x38, 0x67, 0x45, 0x32, 0x30, 0x70, 0x0a, 0x4f, 0x73, 0x67, 0x50, 0x66, + 0x54, 0x7a, 0x33, 0x61, 0x33, 0x59, 0x34, 0x59, 0x39, 0x6b, 0x32, 0x59, + 0x4b, 0x69, 0x62, 0x58, 0x6c, 0x77, 0x41, 0x67, 0x4c, 0x49, 0x76, 0x57, + 0x58, 0x2f, 0x32, 0x68, 0x2f, 0x6b, 0x6c, 0x51, 0x34, 0x62, 0x6e, 0x61, + 0x52, 0x74, 0x53, 0x6d, 0x70, 0x44, 0x68, 0x63, 0x65, 0x50, 0x59, 0x4c, + 0x51, 0x31, 0x4f, 0x62, 0x2f, 0x62, 0x49, 0x53, 0x64, 0x6d, 0x32, 0x0a, + 0x38, 0x78, 0x70, 0x57, 0x72, 0x69, 0x75, 0x32, 0x64, 0x42, 0x54, 0x72, + 0x7a, 0x2f, 0x73, 0x6d, 0x34, 0x78, 0x71, 0x36, 0x48, 0x5a, 0x59, 0x75, + 0x61, 0x6a, 0x74, 0x59, 0x6c, 0x49, 0x6c, 0x48, 0x56, 0x76, 0x38, 0x6c, + 0x6f, 0x4a, 0x4e, 0x77, 0x55, 0x34, 0x50, 0x61, 0x68, 0x48, 0x51, 0x55, + 0x77, 0x32, 0x65, 0x65, 0x42, 0x47, 0x67, 0x36, 0x33, 0x34, 0x35, 0x41, + 0x57, 0x68, 0x31, 0x4b, 0x0a, 0x54, 0x73, 0x39, 0x44, 0x6b, 0x54, 0x76, + 0x6e, 0x56, 0x74, 0x59, 0x41, 0x63, 0x4d, 0x74, 0x53, 0x37, 0x6e, 0x74, + 0x39, 0x72, 0x6a, 0x72, 0x6e, 0x76, 0x44, 0x48, 0x35, 0x52, 0x66, 0x62, + 0x43, 0x59, 0x4d, 0x38, 0x54, 0x57, 0x51, 0x49, 0x72, 0x67, 0x4d, 0x77, + 0x30, 0x52, 0x39, 0x2b, 0x35, 0x33, 0x70, 0x42, 0x6c, 0x62, 0x51, 0x4c, + 0x50, 0x4c, 0x4a, 0x47, 0x6d, 0x70, 0x75, 0x66, 0x65, 0x0a, 0x68, 0x52, + 0x68, 0x4a, 0x66, 0x47, 0x5a, 0x4f, 0x6f, 0x7a, 0x70, 0x74, 0x71, 0x62, + 0x58, 0x75, 0x4e, 0x43, 0x36, 0x36, 0x44, 0x51, 0x4f, 0x34, 0x4d, 0x39, + 0x39, 0x48, 0x36, 0x37, 0x46, 0x72, 0x6a, 0x53, 0x58, 0x5a, 0x6d, 0x38, + 0x36, 0x42, 0x30, 0x55, 0x56, 0x47, 0x4d, 0x70, 0x5a, 0x77, 0x68, 0x39, + 0x34, 0x43, 0x44, 0x6b, 0x6c, 0x44, 0x68, 0x62, 0x5a, 0x73, 0x63, 0x37, + 0x74, 0x6b, 0x0a, 0x36, 0x6d, 0x46, 0x42, 0x72, 0x4d, 0x6e, 0x55, 0x56, + 0x4e, 0x2b, 0x48, 0x4c, 0x38, 0x63, 0x69, 0x73, 0x69, 0x62, 0x4d, 0x6e, + 0x31, 0x6c, 0x55, 0x61, 0x4a, 0x2f, 0x38, 0x76, 0x69, 0x6f, 0x76, 0x78, + 0x46, 0x55, 0x63, 0x64, 0x55, 0x42, 0x67, 0x46, 0x34, 0x55, 0x43, 0x56, + 0x54, 0x6d, 0x4c, 0x66, 0x77, 0x55, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, + 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x0a, 0x44, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, + 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, + 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x42, 0x42, 0x59, 0x45, 0x46, 0x4a, 0x78, 0x66, 0x41, 0x4e, 0x2b, 0x71, + 0x0a, 0x41, 0x64, 0x63, 0x77, 0x4b, 0x7a, 0x69, 0x49, 0x6f, 0x72, 0x68, + 0x74, 0x53, 0x70, 0x7a, 0x79, 0x45, 0x5a, 0x47, 0x44, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x42, + 0x4c, 0x4e, 0x71, 0x61, 0x45, 0x64, 0x32, 0x6e, 0x64, 0x4f, 0x78, 0x6d, + 0x66, 0x5a, 0x79, 0x4d, 0x49, 0x0a, 0x62, 0x77, 0x35, 0x68, 0x79, 0x66, + 0x32, 0x45, 0x33, 0x46, 0x2f, 0x59, 0x4e, 0x6f, 0x48, 0x4e, 0x32, 0x42, + 0x74, 0x42, 0x4c, 0x5a, 0x39, 0x67, 0x33, 0x63, 0x63, 0x61, 0x61, 0x4e, + 0x6e, 0x52, 0x62, 0x6f, 0x62, 0x68, 0x69, 0x43, 0x50, 0x50, 0x45, 0x39, + 0x35, 0x44, 0x7a, 0x2b, 0x49, 0x30, 0x73, 0x77, 0x53, 0x64, 0x48, 0x79, + 0x6e, 0x56, 0x76, 0x2f, 0x68, 0x65, 0x79, 0x4e, 0x58, 0x42, 0x0a, 0x76, + 0x65, 0x36, 0x53, 0x62, 0x7a, 0x4a, 0x30, 0x38, 0x70, 0x47, 0x43, 0x4c, + 0x37, 0x32, 0x43, 0x51, 0x6e, 0x71, 0x74, 0x4b, 0x72, 0x63, 0x67, 0x66, + 0x55, 0x32, 0x38, 0x65, 0x6c, 0x55, 0x53, 0x77, 0x68, 0x58, 0x71, 0x76, + 0x66, 0x64, 0x71, 0x6c, 0x53, 0x35, 0x73, 0x64, 0x4a, 0x2f, 0x50, 0x48, + 0x4c, 0x54, 0x79, 0x78, 0x51, 0x47, 0x6a, 0x68, 0x64, 0x42, 0x79, 0x50, + 0x71, 0x31, 0x7a, 0x0a, 0x71, 0x77, 0x75, 0x62, 0x64, 0x51, 0x78, 0x74, + 0x52, 0x62, 0x65, 0x4f, 0x6c, 0x4b, 0x79, 0x57, 0x4e, 0x37, 0x57, 0x67, + 0x30, 0x49, 0x38, 0x56, 0x52, 0x77, 0x37, 0x6a, 0x36, 0x49, 0x50, 0x64, + 0x6a, 0x2f, 0x33, 0x76, 0x51, 0x51, 0x46, 0x33, 0x7a, 0x43, 0x65, 0x70, + 0x59, 0x6f, 0x55, 0x7a, 0x38, 0x6a, 0x63, 0x49, 0x37, 0x33, 0x48, 0x50, + 0x64, 0x77, 0x62, 0x65, 0x79, 0x42, 0x6b, 0x64, 0x0a, 0x69, 0x45, 0x44, + 0x50, 0x66, 0x55, 0x59, 0x64, 0x2f, 0x78, 0x37, 0x48, 0x34, 0x63, 0x37, + 0x2f, 0x49, 0x39, 0x76, 0x47, 0x2b, 0x6f, 0x31, 0x56, 0x54, 0x71, 0x6b, + 0x43, 0x35, 0x30, 0x63, 0x52, 0x52, 0x6a, 0x37, 0x30, 0x2f, 0x62, 0x31, + 0x37, 0x4b, 0x53, 0x61, 0x37, 0x71, 0x57, 0x46, 0x69, 0x4e, 0x79, 0x69, + 0x32, 0x4c, 0x53, 0x72, 0x32, 0x45, 0x49, 0x5a, 0x6b, 0x79, 0x58, 0x43, + 0x6e, 0x0a, 0x30, 0x71, 0x32, 0x33, 0x4b, 0x58, 0x42, 0x35, 0x36, 0x6a, + 0x7a, 0x61, 0x59, 0x79, 0x57, 0x66, 0x2f, 0x57, 0x69, 0x33, 0x4d, 0x4f, + 0x78, 0x77, 0x2b, 0x33, 0x57, 0x4b, 0x74, 0x32, 0x31, 0x67, 0x5a, 0x37, + 0x49, 0x65, 0x79, 0x4c, 0x6e, 0x70, 0x32, 0x4b, 0x68, 0x76, 0x41, 0x6f, + 0x74, 0x6e, 0x44, 0x55, 0x30, 0x6d, 0x56, 0x33, 0x48, 0x61, 0x49, 0x50, + 0x7a, 0x42, 0x53, 0x6c, 0x43, 0x4e, 0x0a, 0x73, 0x53, 0x69, 0x36, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x63, 0x69, + 0x61, 0x6c, 0x20, 0x4f, 0x3d, 0x41, 0x66, 0x66, 0x69, 0x72, 0x6d, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, 0x66, 0x69, 0x72, + 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, + 0x72, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x4f, 0x3d, 0x41, 0x66, 0x66, 0x69, + 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x66, 0x66, 0x69, 0x72, 0x6d, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x72, + 0x63, 0x69, 0x61, 0x6c, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x36, 0x30, 0x38, 0x33, 0x35, 0x35, 0x39, + 0x37, 0x37, 0x39, 0x36, 0x34, 0x31, 0x33, 0x38, 0x38, 0x37, 0x36, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x32, 0x3a, 0x39, 0x32, + 0x3a, 0x62, 0x61, 0x3a, 0x35, 0x62, 0x3a, 0x65, 0x66, 0x3a, 0x63, 0x64, + 0x3a, 0x38, 0x61, 0x3a, 0x36, 0x66, 0x3a, 0x61, 0x36, 0x3a, 0x33, 0x64, + 0x3a, 0x35, 0x35, 0x3a, 0x66, 0x39, 0x3a, 0x38, 0x34, 0x3a, 0x66, 0x36, + 0x3a, 0x64, 0x36, 0x3a, 0x62, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x66, 0x39, 0x3a, 0x62, 0x35, 0x3a, 0x62, 0x36, 0x3a, + 0x33, 0x32, 0x3a, 0x34, 0x35, 0x3a, 0x35, 0x66, 0x3a, 0x39, 0x63, 0x3a, + 0x62, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x35, 0x37, 0x3a, 0x35, 0x66, 0x3a, + 0x38, 0x30, 0x3a, 0x64, 0x63, 0x3a, 0x65, 0x39, 0x3a, 0x36, 0x65, 0x3a, + 0x32, 0x63, 0x3a, 0x63, 0x37, 0x3a, 0x62, 0x32, 0x3a, 0x37, 0x38, 0x3a, + 0x62, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x30, 0x33, 0x3a, 0x37, 0x36, 0x3a, 0x61, 0x62, 0x3a, 0x31, 0x64, + 0x3a, 0x35, 0x34, 0x3a, 0x63, 0x35, 0x3a, 0x66, 0x39, 0x3a, 0x38, 0x30, + 0x3a, 0x33, 0x63, 0x3a, 0x65, 0x34, 0x3a, 0x62, 0x32, 0x3a, 0x65, 0x32, + 0x3a, 0x30, 0x31, 0x3a, 0x61, 0x30, 0x3a, 0x65, 0x65, 0x3a, 0x37, 0x65, + 0x3a, 0x65, 0x66, 0x3a, 0x37, 0x62, 0x3a, 0x35, 0x37, 0x3a, 0x62, 0x36, + 0x3a, 0x33, 0x36, 0x3a, 0x65, 0x38, 0x3a, 0x61, 0x39, 0x3a, 0x33, 0x63, + 0x3a, 0x39, 0x62, 0x3a, 0x38, 0x64, 0x3a, 0x34, 0x38, 0x3a, 0x36, 0x30, + 0x3a, 0x63, 0x39, 0x3a, 0x36, 0x66, 0x3a, 0x35, 0x66, 0x3a, 0x61, 0x37, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x54, 0x44, 0x43, + 0x43, 0x41, 0x6a, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x49, 0x64, 0x33, 0x63, 0x47, 0x4a, 0x79, 0x61, 0x70, 0x73, 0x58, 0x77, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x52, 0x44, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x68, + 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x43, 0x30, 0x46, 0x6d, 0x5a, 0x6d, + 0x6c, 0x79, 0x62, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x52, + 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, + 0x5a, 0x42, 0x5a, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x55, 0x63, 0x6e, + 0x56, 0x7a, 0x0a, 0x64, 0x43, 0x42, 0x44, 0x62, 0x32, 0x31, 0x74, 0x5a, + 0x58, 0x4a, 0x6a, 0x61, 0x57, 0x46, 0x73, 0x4d, 0x42, 0x34, 0x58, 0x44, + 0x54, 0x45, 0x77, 0x4d, 0x44, 0x45, 0x79, 0x4f, 0x54, 0x45, 0x30, 0x4d, + 0x44, 0x59, 0x77, 0x4e, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x77, 0x4d, + 0x54, 0x49, 0x7a, 0x4d, 0x54, 0x45, 0x30, 0x4d, 0x44, 0x59, 0x77, 0x4e, + 0x6c, 0x6f, 0x77, 0x52, 0x44, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, + 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, + 0x43, 0x30, 0x46, 0x6d, 0x5a, 0x6d, 0x6c, 0x79, 0x62, 0x56, 0x52, 0x79, + 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x5a, 0x42, 0x5a, 0x6d, 0x5a, 0x70, + 0x0a, 0x63, 0x6d, 0x31, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, + 0x44, 0x62, 0x32, 0x31, 0x74, 0x5a, 0x58, 0x4a, 0x6a, 0x61, 0x57, 0x46, + 0x73, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, + 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, + 0x42, 0x43, 0x67, 0x4b, 0x43, 0x0a, 0x41, 0x51, 0x45, 0x41, 0x39, 0x68, + 0x74, 0x50, 0x5a, 0x77, 0x63, 0x72, 0x6f, 0x52, 0x58, 0x31, 0x42, 0x69, + 0x4c, 0x4c, 0x48, 0x77, 0x47, 0x79, 0x34, 0x33, 0x4e, 0x46, 0x42, 0x6b, + 0x52, 0x4a, 0x4c, 0x4c, 0x74, 0x4a, 0x4a, 0x52, 0x54, 0x57, 0x7a, 0x73, + 0x4f, 0x33, 0x71, 0x79, 0x78, 0x50, 0x78, 0x6b, 0x45, 0x79, 0x6c, 0x46, + 0x66, 0x36, 0x45, 0x71, 0x64, 0x62, 0x44, 0x75, 0x4b, 0x50, 0x0a, 0x48, + 0x78, 0x36, 0x47, 0x47, 0x61, 0x65, 0x71, 0x74, 0x53, 0x32, 0x35, 0x58, + 0x77, 0x32, 0x4b, 0x77, 0x71, 0x2b, 0x46, 0x4e, 0x58, 0x6b, 0x79, 0x4c, + 0x62, 0x73, 0x63, 0x59, 0x6a, 0x66, 0x79, 0x73, 0x56, 0x74, 0x4b, 0x50, + 0x63, 0x72, 0x4e, 0x63, 0x56, 0x2f, 0x70, 0x51, 0x72, 0x36, 0x55, 0x36, + 0x4d, 0x6a, 0x65, 0x2b, 0x53, 0x4a, 0x49, 0x5a, 0x4d, 0x62, 0x6c, 0x71, + 0x38, 0x59, 0x72, 0x0a, 0x62, 0x61, 0x30, 0x46, 0x38, 0x50, 0x72, 0x56, + 0x43, 0x38, 0x2b, 0x61, 0x35, 0x66, 0x42, 0x51, 0x70, 0x49, 0x73, 0x37, + 0x52, 0x36, 0x55, 0x6a, 0x57, 0x33, 0x70, 0x36, 0x2b, 0x44, 0x4d, 0x2f, + 0x75, 0x4f, 0x2b, 0x5a, 0x6c, 0x2b, 0x4d, 0x67, 0x77, 0x64, 0x59, 0x6f, + 0x69, 0x63, 0x2b, 0x55, 0x2b, 0x37, 0x6c, 0x46, 0x37, 0x65, 0x4e, 0x41, + 0x46, 0x78, 0x48, 0x55, 0x64, 0x50, 0x41, 0x4c, 0x0a, 0x4d, 0x65, 0x49, + 0x72, 0x4a, 0x6d, 0x71, 0x62, 0x54, 0x46, 0x65, 0x75, 0x72, 0x43, 0x41, + 0x2b, 0x75, 0x6b, 0x56, 0x36, 0x42, 0x66, 0x4f, 0x39, 0x6d, 0x32, 0x6b, + 0x56, 0x72, 0x6e, 0x31, 0x4f, 0x49, 0x47, 0x50, 0x45, 0x4e, 0x58, 0x59, + 0x36, 0x42, 0x77, 0x4c, 0x4a, 0x4e, 0x2f, 0x33, 0x48, 0x52, 0x2b, 0x37, + 0x6f, 0x38, 0x58, 0x59, 0x64, 0x63, 0x78, 0x58, 0x79, 0x6c, 0x36, 0x53, + 0x31, 0x0a, 0x79, 0x48, 0x70, 0x35, 0x32, 0x55, 0x4b, 0x71, 0x4b, 0x33, + 0x39, 0x63, 0x2f, 0x73, 0x34, 0x6d, 0x54, 0x36, 0x4e, 0x6d, 0x67, 0x54, + 0x57, 0x76, 0x52, 0x4c, 0x70, 0x55, 0x48, 0x68, 0x77, 0x77, 0x4d, 0x6d, + 0x57, 0x64, 0x35, 0x6a, 0x79, 0x54, 0x58, 0x6c, 0x42, 0x4f, 0x65, 0x75, + 0x4d, 0x36, 0x31, 0x47, 0x37, 0x4d, 0x47, 0x76, 0x76, 0x35, 0x30, 0x6a, + 0x65, 0x75, 0x4a, 0x43, 0x71, 0x72, 0x0a, 0x56, 0x77, 0x4d, 0x69, 0x4b, + 0x41, 0x31, 0x4a, 0x64, 0x58, 0x2b, 0x33, 0x4b, 0x4e, 0x70, 0x31, 0x76, + 0x34, 0x37, 0x6a, 0x33, 0x41, 0x35, 0x35, 0x4d, 0x51, 0x49, 0x44, 0x41, + 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x64, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x6e, + 0x5a, 0x50, 0x47, 0x55, 0x34, 0x74, 0x65, 0x79, 0x71, 0x38, 0x2f, 0x0a, + 0x6e, 0x78, 0x34, 0x50, 0x35, 0x5a, 0x6d, 0x56, 0x76, 0x43, 0x54, 0x32, + 0x6c, 0x49, 0x38, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, + 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, + 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x0a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, + 0x42, 0x41, 0x46, 0x69, 0x73, 0x39, 0x41, 0x51, 0x4f, 0x7a, 0x63, 0x41, + 0x4e, 0x2f, 0x77, 0x72, 0x39, 0x31, 0x4c, 0x6f, 0x57, 0x58, 0x79, 0x6d, + 0x39, 0x65, 0x32, 0x69, 0x5a, 0x57, 0x45, 0x6e, 0x53, 0x74, 0x42, 0x30, + 0x33, 0x54, 0x58, 0x38, 0x6e, 0x66, 0x55, 0x59, 0x47, 0x0a, 0x58, 0x55, + 0x50, 0x47, 0x68, 0x69, 0x34, 0x2b, 0x63, 0x37, 0x49, 0x6d, 0x66, 0x55, + 0x2b, 0x54, 0x71, 0x62, 0x62, 0x45, 0x4b, 0x70, 0x71, 0x72, 0x49, 0x5a, + 0x63, 0x55, 0x73, 0x64, 0x36, 0x4d, 0x30, 0x36, 0x75, 0x4a, 0x46, 0x64, + 0x68, 0x72, 0x4a, 0x4e, 0x54, 0x78, 0x46, 0x71, 0x37, 0x59, 0x70, 0x46, + 0x7a, 0x55, 0x66, 0x31, 0x47, 0x4f, 0x37, 0x52, 0x67, 0x42, 0x73, 0x5a, + 0x4e, 0x6a, 0x0a, 0x76, 0x62, 0x7a, 0x34, 0x59, 0x59, 0x43, 0x61, 0x6e, + 0x72, 0x48, 0x4f, 0x51, 0x6e, 0x44, 0x69, 0x71, 0x58, 0x30, 0x47, 0x4a, + 0x58, 0x30, 0x6e, 0x6f, 0x66, 0x35, 0x76, 0x37, 0x4c, 0x4d, 0x65, 0x4a, + 0x4e, 0x72, 0x6a, 0x53, 0x31, 0x55, 0x61, 0x41, 0x44, 0x73, 0x31, 0x74, + 0x44, 0x76, 0x5a, 0x31, 0x31, 0x30, 0x77, 0x2f, 0x59, 0x45, 0x54, 0x69, + 0x66, 0x4c, 0x43, 0x42, 0x69, 0x76, 0x74, 0x0a, 0x5a, 0x38, 0x53, 0x4f, + 0x79, 0x55, 0x4f, 0x79, 0x58, 0x47, 0x73, 0x56, 0x69, 0x51, 0x4b, 0x38, + 0x59, 0x76, 0x78, 0x4f, 0x38, 0x72, 0x55, 0x7a, 0x71, 0x72, 0x4a, 0x76, + 0x30, 0x77, 0x71, 0x69, 0x55, 0x4f, 0x50, 0x32, 0x4f, 0x2b, 0x67, 0x75, + 0x52, 0x4d, 0x4c, 0x62, 0x5a, 0x6a, 0x69, 0x70, 0x4d, 0x31, 0x5a, 0x49, + 0x38, 0x57, 0x30, 0x62, 0x4d, 0x34, 0x30, 0x4e, 0x6a, 0x44, 0x39, 0x67, + 0x0a, 0x4e, 0x35, 0x33, 0x54, 0x79, 0x6d, 0x31, 0x2b, 0x4e, 0x48, 0x34, + 0x4e, 0x6e, 0x33, 0x4a, 0x32, 0x69, 0x78, 0x75, 0x66, 0x63, 0x76, 0x31, + 0x53, 0x4e, 0x55, 0x46, 0x46, 0x41, 0x70, 0x59, 0x76, 0x48, 0x4c, 0x4b, + 0x61, 0x63, 0x30, 0x6b, 0x68, 0x73, 0x55, 0x6c, 0x48, 0x52, 0x55, 0x65, + 0x30, 0x37, 0x32, 0x6f, 0x30, 0x45, 0x63, 0x6c, 0x4e, 0x6d, 0x73, 0x78, + 0x5a, 0x74, 0x39, 0x59, 0x43, 0x0a, 0x6e, 0x6c, 0x70, 0x4f, 0x5a, 0x62, + 0x57, 0x55, 0x72, 0x68, 0x76, 0x66, 0x4b, 0x62, 0x41, 0x57, 0x38, 0x62, + 0x38, 0x41, 0x6e, 0x67, 0x63, 0x36, 0x46, 0x32, 0x53, 0x31, 0x42, 0x4c, + 0x55, 0x6a, 0x49, 0x5a, 0x6b, 0x4b, 0x6c, 0x54, 0x75, 0x58, 0x66, 0x4f, + 0x38, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, 0x66, 0x69, 0x72, + 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x4f, 0x3d, 0x41, 0x66, 0x66, 0x69, + 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, + 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, + 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x4f, 0x3d, 0x41, + 0x66, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x66, 0x66, + 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x39, 0x35, 0x37, 0x33, + 0x38, 0x32, 0x38, 0x32, 0x37, 0x32, 0x30, 0x36, 0x35, 0x34, 0x37, 0x37, + 0x35, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x32, + 0x3a, 0x36, 0x35, 0x3a, 0x63, 0x61, 0x3a, 0x62, 0x65, 0x3a, 0x30, 0x31, + 0x3a, 0x39, 0x61, 0x3a, 0x39, 0x61, 0x3a, 0x34, 0x63, 0x3a, 0x61, 0x39, + 0x3a, 0x38, 0x63, 0x3a, 0x34, 0x31, 0x3a, 0x34, 0x39, 0x3a, 0x63, 0x64, + 0x3a, 0x63, 0x30, 0x3a, 0x64, 0x35, 0x3a, 0x37, 0x66, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x39, 0x3a, 0x33, 0x36, 0x3a, + 0x32, 0x31, 0x3a, 0x30, 0x32, 0x3a, 0x38, 0x62, 0x3a, 0x32, 0x30, 0x3a, + 0x65, 0x64, 0x3a, 0x30, 0x32, 0x3a, 0x66, 0x35, 0x3a, 0x36, 0x36, 0x3a, + 0x63, 0x35, 0x3a, 0x33, 0x32, 0x3a, 0x64, 0x31, 0x3a, 0x64, 0x36, 0x3a, + 0x65, 0x64, 0x3a, 0x39, 0x30, 0x3a, 0x39, 0x66, 0x3a, 0x34, 0x35, 0x3a, + 0x30, 0x30, 0x3a, 0x32, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x61, 0x3a, 0x38, 0x31, 0x3a, 0x65, 0x63, + 0x3a, 0x35, 0x61, 0x3a, 0x39, 0x32, 0x3a, 0x39, 0x37, 0x3a, 0x37, 0x37, + 0x3a, 0x66, 0x31, 0x3a, 0x34, 0x35, 0x3a, 0x39, 0x30, 0x3a, 0x34, 0x61, + 0x3a, 0x66, 0x33, 0x3a, 0x38, 0x64, 0x3a, 0x35, 0x64, 0x3a, 0x35, 0x30, + 0x3a, 0x39, 0x66, 0x3a, 0x36, 0x36, 0x3a, 0x62, 0x35, 0x3a, 0x65, 0x32, + 0x3a, 0x63, 0x35, 0x3a, 0x38, 0x66, 0x3a, 0x63, 0x64, 0x3a, 0x62, 0x35, + 0x3a, 0x33, 0x31, 0x3a, 0x30, 0x35, 0x3a, 0x38, 0x62, 0x3a, 0x30, 0x65, + 0x3a, 0x31, 0x37, 0x3a, 0x66, 0x33, 0x3a, 0x66, 0x30, 0x3a, 0x62, 0x34, + 0x3a, 0x31, 0x62, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, + 0x54, 0x44, 0x43, 0x43, 0x41, 0x6a, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x49, 0x66, 0x45, 0x38, 0x45, 0x4f, 0x52, 0x7a, 0x55, + 0x6d, 0x53, 0x30, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, + 0x52, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x44, 0x41, + 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x43, 0x30, 0x46, + 0x6d, 0x5a, 0x6d, 0x6c, 0x79, 0x62, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, + 0x30, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x44, 0x44, 0x42, 0x5a, 0x42, 0x5a, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, + 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x0a, 0x64, 0x43, 0x42, 0x4f, 0x5a, 0x58, + 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, 0x61, 0x57, 0x35, 0x6e, 0x4d, 0x42, + 0x34, 0x58, 0x44, 0x54, 0x45, 0x77, 0x4d, 0x44, 0x45, 0x79, 0x4f, 0x54, + 0x45, 0x30, 0x4d, 0x44, 0x67, 0x79, 0x4e, 0x46, 0x6f, 0x58, 0x44, 0x54, + 0x4d, 0x77, 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x54, 0x45, 0x30, 0x4d, 0x44, + 0x67, 0x79, 0x4e, 0x46, 0x6f, 0x77, 0x52, 0x44, 0x45, 0x4c, 0x0a, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, + 0x56, 0x4d, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x4d, 0x43, 0x30, 0x46, 0x6d, 0x5a, 0x6d, 0x6c, 0x79, 0x62, + 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x52, 0x38, 0x77, 0x48, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x5a, 0x42, 0x5a, + 0x6d, 0x5a, 0x70, 0x0a, 0x63, 0x6d, 0x31, 0x55, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, 0x72, + 0x61, 0x57, 0x35, 0x6e, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, + 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x0a, 0x41, 0x51, 0x45, + 0x41, 0x74, 0x49, 0x54, 0x4d, 0x4d, 0x78, 0x63, 0x75, 0x61, 0x35, 0x52, + 0x73, 0x61, 0x32, 0x46, 0x53, 0x6f, 0x4f, 0x75, 0x6a, 0x7a, 0x33, 0x6d, + 0x55, 0x54, 0x4f, 0x57, 0x55, 0x67, 0x4a, 0x6e, 0x4c, 0x56, 0x57, 0x52, + 0x45, 0x5a, 0x59, 0x39, 0x6e, 0x5a, 0x4f, 0x49, 0x47, 0x34, 0x31, 0x77, + 0x33, 0x53, 0x66, 0x59, 0x76, 0x6d, 0x34, 0x53, 0x45, 0x48, 0x69, 0x33, + 0x79, 0x0a, 0x59, 0x4a, 0x30, 0x77, 0x54, 0x73, 0x79, 0x45, 0x68, 0x65, + 0x49, 0x73, 0x7a, 0x78, 0x36, 0x65, 0x2f, 0x6a, 0x61, 0x72, 0x4d, 0x33, + 0x63, 0x31, 0x52, 0x4e, 0x67, 0x31, 0x6c, 0x68, 0x6f, 0x39, 0x4e, 0x75, + 0x68, 0x36, 0x44, 0x74, 0x6a, 0x56, 0x52, 0x36, 0x46, 0x71, 0x61, 0x59, + 0x76, 0x5a, 0x2f, 0x4c, 0x73, 0x36, 0x72, 0x6e, 0x6c, 0x61, 0x31, 0x66, + 0x54, 0x57, 0x63, 0x62, 0x75, 0x61, 0x0a, 0x6b, 0x43, 0x4e, 0x72, 0x6d, + 0x72, 0x65, 0x49, 0x64, 0x49, 0x63, 0x4d, 0x48, 0x6c, 0x2b, 0x35, 0x6e, + 0x69, 0x33, 0x36, 0x71, 0x31, 0x4d, 0x72, 0x33, 0x4c, 0x74, 0x32, 0x50, + 0x70, 0x4e, 0x4d, 0x43, 0x41, 0x69, 0x4d, 0x48, 0x71, 0x49, 0x6a, 0x48, + 0x4e, 0x52, 0x71, 0x72, 0x53, 0x4b, 0x36, 0x6d, 0x51, 0x45, 0x75, 0x62, + 0x57, 0x58, 0x4c, 0x76, 0x69, 0x52, 0x6d, 0x56, 0x53, 0x52, 0x4c, 0x0a, + 0x51, 0x45, 0x53, 0x78, 0x47, 0x39, 0x66, 0x68, 0x77, 0x6f, 0x58, 0x41, + 0x33, 0x68, 0x41, 0x2f, 0x50, 0x65, 0x32, 0x34, 0x2f, 0x50, 0x48, 0x78, + 0x49, 0x31, 0x50, 0x63, 0x76, 0x32, 0x57, 0x58, 0x62, 0x39, 0x6e, 0x35, + 0x51, 0x48, 0x47, 0x4e, 0x66, 0x62, 0x32, 0x56, 0x31, 0x4d, 0x36, 0x2b, + 0x6f, 0x46, 0x34, 0x6e, 0x49, 0x39, 0x37, 0x39, 0x70, 0x74, 0x41, 0x6d, + 0x44, 0x67, 0x41, 0x70, 0x0a, 0x36, 0x7a, 0x78, 0x47, 0x38, 0x44, 0x31, + 0x67, 0x76, 0x7a, 0x39, 0x51, 0x30, 0x74, 0x77, 0x6d, 0x51, 0x56, 0x47, + 0x65, 0x46, 0x44, 0x64, 0x43, 0x42, 0x4b, 0x4e, 0x77, 0x56, 0x36, 0x67, + 0x62, 0x68, 0x2b, 0x30, 0x74, 0x2b, 0x6e, 0x76, 0x75, 0x6a, 0x41, 0x72, + 0x6a, 0x71, 0x57, 0x61, 0x4a, 0x47, 0x63, 0x74, 0x42, 0x2b, 0x64, 0x31, + 0x45, 0x4e, 0x6d, 0x48, 0x50, 0x34, 0x6e, 0x64, 0x47, 0x0a, 0x79, 0x48, + 0x33, 0x32, 0x39, 0x4a, 0x4b, 0x42, 0x4e, 0x76, 0x33, 0x62, 0x4e, 0x50, + 0x46, 0x79, 0x66, 0x76, 0x4d, 0x4d, 0x46, 0x72, 0x32, 0x30, 0x46, 0x51, + 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, + 0x51, 0x55, 0x42, 0x78, 0x2f, 0x53, 0x35, 0x35, 0x7a, 0x61, 0x77, 0x6d, + 0x36, 0x69, 0x0a, 0x51, 0x4c, 0x53, 0x77, 0x65, 0x6c, 0x41, 0x51, 0x55, + 0x48, 0x54, 0x45, 0x79, 0x4c, 0x30, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, + 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, + 0x51, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x0a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x49, 0x6c, 0x58, 0x73, 0x68, 0x5a, 0x36, + 0x71, 0x4d, 0x4c, 0x39, 0x31, 0x74, 0x6d, 0x62, 0x6d, 0x7a, 0x54, 0x43, + 0x6e, 0x4c, 0x51, 0x79, 0x46, 0x45, 0x32, 0x6e, 0x70, 0x4e, 0x2f, 0x73, + 0x76, 0x71, 0x65, 0x2b, 0x2b, 0x45, 0x50, 0x62, 0x6b, 0x54, 0x66, 0x4f, + 0x0a, 0x74, 0x44, 0x49, 0x75, 0x55, 0x46, 0x55, 0x61, 0x4e, 0x55, 0x35, + 0x32, 0x51, 0x33, 0x45, 0x67, 0x37, 0x35, 0x4e, 0x33, 0x54, 0x68, 0x56, + 0x77, 0x4c, 0x6f, 0x66, 0x44, 0x77, 0x52, 0x31, 0x74, 0x33, 0x4d, 0x75, + 0x31, 0x4a, 0x39, 0x51, 0x73, 0x56, 0x74, 0x46, 0x53, 0x55, 0x7a, 0x70, + 0x45, 0x30, 0x6e, 0x50, 0x49, 0x78, 0x42, 0x73, 0x46, 0x5a, 0x56, 0x70, + 0x69, 0x6b, 0x70, 0x7a, 0x75, 0x0a, 0x51, 0x59, 0x30, 0x78, 0x32, 0x2b, + 0x63, 0x30, 0x36, 0x6c, 0x6b, 0x68, 0x31, 0x51, 0x46, 0x36, 0x31, 0x32, + 0x53, 0x34, 0x5a, 0x44, 0x6e, 0x4e, 0x79, 0x65, 0x32, 0x76, 0x37, 0x55, + 0x73, 0x44, 0x53, 0x4b, 0x65, 0x67, 0x6d, 0x51, 0x47, 0x41, 0x33, 0x47, + 0x57, 0x6a, 0x4e, 0x71, 0x35, 0x6c, 0x57, 0x55, 0x68, 0x50, 0x67, 0x6b, + 0x76, 0x49, 0x5a, 0x66, 0x46, 0x58, 0x48, 0x65, 0x56, 0x5a, 0x0a, 0x4c, + 0x67, 0x6f, 0x2f, 0x62, 0x4e, 0x6a, 0x52, 0x39, 0x65, 0x55, 0x4a, 0x74, + 0x47, 0x78, 0x55, 0x41, 0x41, 0x72, 0x67, 0x46, 0x55, 0x32, 0x48, 0x64, + 0x57, 0x32, 0x33, 0x57, 0x4a, 0x5a, 0x61, 0x33, 0x57, 0x33, 0x53, 0x41, + 0x4b, 0x44, 0x30, 0x6d, 0x30, 0x69, 0x2b, 0x77, 0x7a, 0x65, 0x6b, 0x75, + 0x6a, 0x62, 0x67, 0x66, 0x49, 0x65, 0x46, 0x6c, 0x78, 0x6f, 0x56, 0x6f, + 0x74, 0x34, 0x75, 0x0a, 0x6f, 0x6c, 0x75, 0x39, 0x72, 0x78, 0x6a, 0x35, + 0x6b, 0x46, 0x44, 0x4e, 0x63, 0x46, 0x6e, 0x34, 0x4a, 0x32, 0x64, 0x48, + 0x79, 0x38, 0x65, 0x67, 0x42, 0x7a, 0x70, 0x39, 0x30, 0x53, 0x78, 0x64, + 0x62, 0x42, 0x6b, 0x36, 0x5a, 0x72, 0x56, 0x39, 0x2f, 0x5a, 0x46, 0x76, + 0x67, 0x72, 0x47, 0x2b, 0x43, 0x4a, 0x50, 0x62, 0x46, 0x45, 0x66, 0x78, + 0x6f, 0x6a, 0x66, 0x48, 0x52, 0x5a, 0x34, 0x38, 0x0a, 0x78, 0x33, 0x65, + 0x76, 0x5a, 0x4b, 0x69, 0x54, 0x33, 0x2f, 0x5a, 0x70, 0x67, 0x34, 0x4a, + 0x67, 0x38, 0x6b, 0x6c, 0x43, 0x4e, 0x4f, 0x31, 0x61, 0x41, 0x46, 0x53, + 0x46, 0x48, 0x42, 0x59, 0x32, 0x6b, 0x67, 0x78, 0x63, 0x2b, 0x71, 0x61, + 0x74, 0x76, 0x39, 0x73, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, + 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, + 0x65, 0x6d, 0x69, 0x75, 0x6d, 0x20, 0x4f, 0x3d, 0x41, 0x66, 0x66, 0x69, + 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, + 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, + 0x65, 0x6d, 0x69, 0x75, 0x6d, 0x20, 0x4f, 0x3d, 0x41, 0x66, 0x66, 0x69, + 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x66, 0x66, 0x69, 0x72, 0x6d, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x65, 0x6d, 0x69, 0x75, + 0x6d, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x37, 0x38, 0x39, 0x33, 0x37, 0x30, 0x36, 0x35, 0x34, 0x30, 0x37, + 0x33, 0x34, 0x33, 0x35, 0x32, 0x31, 0x31, 0x30, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x34, 0x3a, 0x35, 0x64, 0x3a, 0x30, 0x65, + 0x3a, 0x34, 0x38, 0x3a, 0x62, 0x36, 0x3a, 0x61, 0x63, 0x3a, 0x32, 0x38, + 0x3a, 0x33, 0x30, 0x3a, 0x34, 0x65, 0x3a, 0x30, 0x61, 0x3a, 0x62, 0x63, + 0x3a, 0x66, 0x39, 0x3a, 0x33, 0x38, 0x3a, 0x31, 0x36, 0x3a, 0x38, 0x37, + 0x3a, 0x35, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x64, 0x38, 0x3a, 0x61, 0x36, 0x3a, 0x33, 0x33, 0x3a, 0x32, 0x63, 0x3a, + 0x65, 0x30, 0x3a, 0x30, 0x33, 0x3a, 0x36, 0x66, 0x3a, 0x62, 0x31, 0x3a, + 0x38, 0x35, 0x3a, 0x66, 0x36, 0x3a, 0x36, 0x33, 0x3a, 0x34, 0x66, 0x3a, + 0x37, 0x64, 0x3a, 0x36, 0x61, 0x3a, 0x30, 0x36, 0x3a, 0x36, 0x35, 0x3a, + 0x32, 0x36, 0x3a, 0x33, 0x32, 0x3a, 0x32, 0x38, 0x3a, 0x32, 0x37, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x30, + 0x3a, 0x61, 0x37, 0x3a, 0x33, 0x66, 0x3a, 0x37, 0x66, 0x3a, 0x33, 0x37, + 0x3a, 0x36, 0x62, 0x3a, 0x36, 0x30, 0x3a, 0x30, 0x37, 0x3a, 0x34, 0x32, + 0x3a, 0x34, 0x38, 0x3a, 0x39, 0x30, 0x3a, 0x34, 0x35, 0x3a, 0x33, 0x34, + 0x3a, 0x62, 0x31, 0x3a, 0x31, 0x34, 0x3a, 0x38, 0x32, 0x3a, 0x64, 0x35, + 0x3a, 0x62, 0x66, 0x3a, 0x30, 0x65, 0x3a, 0x36, 0x39, 0x3a, 0x38, 0x65, + 0x3a, 0x63, 0x63, 0x3a, 0x34, 0x39, 0x3a, 0x38, 0x64, 0x3a, 0x66, 0x35, + 0x3a, 0x32, 0x35, 0x3a, 0x37, 0x37, 0x3a, 0x65, 0x62, 0x3a, 0x66, 0x32, + 0x3a, 0x65, 0x39, 0x3a, 0x33, 0x62, 0x3a, 0x39, 0x61, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x52, 0x6a, 0x43, 0x43, 0x41, 0x79, + 0x36, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x62, 0x59, + 0x77, 0x55, 0x52, 0x72, 0x47, 0x6d, 0x43, 0x75, 0x34, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4d, 0x42, 0x51, 0x41, 0x77, 0x51, 0x54, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x56, + 0x56, 0x4d, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x4d, 0x43, 0x30, 0x46, 0x6d, 0x5a, 0x6d, 0x6c, 0x79, 0x62, + 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x52, 0x77, 0x77, 0x47, + 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x4e, 0x42, 0x5a, + 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x0a, + 0x64, 0x43, 0x42, 0x51, 0x63, 0x6d, 0x56, 0x74, 0x61, 0x58, 0x56, 0x74, + 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x77, 0x4d, 0x44, 0x45, 0x79, + 0x4f, 0x54, 0x45, 0x30, 0x4d, 0x54, 0x41, 0x7a, 0x4e, 0x6c, 0x6f, 0x58, + 0x44, 0x54, 0x51, 0x77, 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x54, 0x45, 0x30, + 0x4d, 0x54, 0x41, 0x7a, 0x4e, 0x6c, 0x6f, 0x77, 0x51, 0x54, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x43, 0x30, 0x46, 0x6d, 0x5a, 0x6d, 0x6c, + 0x79, 0x62, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x52, 0x77, + 0x77, 0x47, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x4e, + 0x42, 0x5a, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x55, 0x0a, 0x63, 0x6e, + 0x56, 0x7a, 0x64, 0x43, 0x42, 0x51, 0x63, 0x6d, 0x56, 0x74, 0x61, 0x58, + 0x56, 0x74, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, + 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, 0x45, 0x41, 0x78, 0x42, + 0x4c, 0x66, 0x0a, 0x71, 0x56, 0x2f, 0x2b, 0x51, 0x64, 0x33, 0x64, 0x39, + 0x5a, 0x2b, 0x4b, 0x34, 0x2f, 0x61, 0x73, 0x34, 0x54, 0x78, 0x34, 0x6d, + 0x72, 0x7a, 0x59, 0x38, 0x48, 0x39, 0x36, 0x6f, 0x44, 0x4d, 0x71, 0x33, + 0x49, 0x30, 0x67, 0x57, 0x36, 0x34, 0x74, 0x62, 0x2b, 0x65, 0x54, 0x32, + 0x54, 0x5a, 0x77, 0x61, 0x6d, 0x6a, 0x50, 0x6a, 0x6c, 0x47, 0x6a, 0x68, + 0x56, 0x74, 0x6e, 0x42, 0x4b, 0x41, 0x51, 0x0a, 0x4a, 0x47, 0x39, 0x64, + 0x4b, 0x49, 0x4c, 0x42, 0x6c, 0x31, 0x66, 0x59, 0x53, 0x43, 0x6b, 0x54, + 0x74, 0x75, 0x47, 0x2b, 0x6b, 0x55, 0x33, 0x66, 0x68, 0x51, 0x78, 0x54, + 0x47, 0x4a, 0x6f, 0x65, 0x4a, 0x4b, 0x4a, 0x50, 0x6a, 0x2f, 0x43, 0x69, + 0x68, 0x51, 0x76, 0x4c, 0x39, 0x43, 0x6c, 0x2f, 0x30, 0x71, 0x52, 0x59, + 0x37, 0x69, 0x5a, 0x4e, 0x79, 0x61, 0x71, 0x6f, 0x65, 0x35, 0x72, 0x5a, + 0x0a, 0x2b, 0x6a, 0x6a, 0x65, 0x52, 0x46, 0x63, 0x56, 0x35, 0x66, 0x69, + 0x4d, 0x79, 0x4e, 0x6c, 0x49, 0x34, 0x67, 0x30, 0x57, 0x4a, 0x78, 0x30, + 0x65, 0x79, 0x49, 0x4f, 0x46, 0x4a, 0x62, 0x65, 0x36, 0x71, 0x6c, 0x56, + 0x42, 0x7a, 0x41, 0x4d, 0x69, 0x53, 0x79, 0x32, 0x52, 0x6a, 0x59, 0x76, + 0x6d, 0x69, 0x61, 0x39, 0x6d, 0x78, 0x2b, 0x6e, 0x2f, 0x4b, 0x2b, 0x6b, + 0x38, 0x72, 0x4e, 0x72, 0x53, 0x0a, 0x73, 0x38, 0x50, 0x68, 0x61, 0x4a, + 0x79, 0x4a, 0x2b, 0x48, 0x6f, 0x41, 0x56, 0x74, 0x37, 0x30, 0x56, 0x5a, + 0x56, 0x73, 0x2b, 0x37, 0x70, 0x6b, 0x33, 0x57, 0x4b, 0x4c, 0x33, 0x77, + 0x74, 0x33, 0x4d, 0x75, 0x74, 0x69, 0x7a, 0x43, 0x61, 0x61, 0x6d, 0x37, + 0x75, 0x71, 0x59, 0x6f, 0x4e, 0x4d, 0x74, 0x41, 0x5a, 0x36, 0x4d, 0x4d, + 0x67, 0x70, 0x76, 0x2b, 0x30, 0x47, 0x54, 0x5a, 0x65, 0x35, 0x0a, 0x48, + 0x4d, 0x51, 0x78, 0x4b, 0x39, 0x56, 0x66, 0x76, 0x46, 0x4d, 0x53, 0x46, + 0x35, 0x79, 0x5a, 0x56, 0x79, 0x6c, 0x6d, 0x64, 0x32, 0x45, 0x68, 0x4d, + 0x51, 0x63, 0x75, 0x4a, 0x55, 0x6d, 0x64, 0x47, 0x50, 0x4c, 0x75, 0x38, + 0x79, 0x74, 0x78, 0x6a, 0x4c, 0x57, 0x36, 0x4f, 0x51, 0x64, 0x4a, 0x64, + 0x2f, 0x7a, 0x76, 0x4c, 0x70, 0x4b, 0x51, 0x42, 0x59, 0x30, 0x74, 0x4c, + 0x33, 0x64, 0x37, 0x0a, 0x37, 0x30, 0x4f, 0x2f, 0x4e, 0x62, 0x75, 0x61, + 0x32, 0x50, 0x6c, 0x7a, 0x70, 0x79, 0x7a, 0x79, 0x30, 0x46, 0x66, 0x75, + 0x4b, 0x45, 0x34, 0x6d, 0x58, 0x34, 0x2b, 0x51, 0x61, 0x41, 0x6b, 0x76, + 0x75, 0x50, 0x6a, 0x63, 0x42, 0x75, 0x6b, 0x75, 0x6d, 0x6a, 0x35, 0x52, + 0x70, 0x39, 0x45, 0x69, 0x78, 0x41, 0x71, 0x6e, 0x4f, 0x45, 0x68, 0x73, + 0x73, 0x2f, 0x6e, 0x2f, 0x66, 0x61, 0x75, 0x47, 0x0a, 0x56, 0x2b, 0x4f, + 0x36, 0x31, 0x6f, 0x56, 0x34, 0x64, 0x37, 0x70, 0x44, 0x36, 0x6b, 0x68, + 0x2f, 0x39, 0x74, 0x69, 0x2b, 0x49, 0x32, 0x30, 0x65, 0x76, 0x39, 0x45, + 0x32, 0x62, 0x46, 0x68, 0x63, 0x38, 0x65, 0x36, 0x6b, 0x47, 0x56, 0x51, + 0x61, 0x39, 0x51, 0x50, 0x53, 0x64, 0x75, 0x62, 0x68, 0x6a, 0x4c, 0x30, + 0x38, 0x73, 0x39, 0x4e, 0x49, 0x53, 0x2b, 0x4c, 0x49, 0x2b, 0x48, 0x2b, + 0x53, 0x0a, 0x71, 0x48, 0x5a, 0x47, 0x6e, 0x45, 0x4a, 0x6c, 0x50, 0x71, + 0x51, 0x65, 0x77, 0x51, 0x63, 0x44, 0x57, 0x6b, 0x59, 0x74, 0x75, 0x4a, + 0x66, 0x7a, 0x74, 0x39, 0x57, 0x79, 0x56, 0x53, 0x48, 0x76, 0x75, 0x74, + 0x78, 0x4d, 0x41, 0x4a, 0x66, 0x37, 0x46, 0x4a, 0x55, 0x6e, 0x4d, 0x37, + 0x2f, 0x6f, 0x51, 0x30, 0x64, 0x47, 0x30, 0x67, 0x69, 0x5a, 0x46, 0x6d, + 0x41, 0x37, 0x6d, 0x6e, 0x37, 0x53, 0x0a, 0x35, 0x75, 0x30, 0x34, 0x36, + 0x75, 0x77, 0x42, 0x48, 0x6a, 0x78, 0x49, 0x56, 0x6b, 0x6b, 0x4a, 0x78, + 0x30, 0x77, 0x33, 0x41, 0x4a, 0x36, 0x49, 0x44, 0x73, 0x42, 0x7a, 0x34, + 0x57, 0x39, 0x6d, 0x36, 0x58, 0x4a, 0x48, 0x4d, 0x44, 0x34, 0x51, 0x35, + 0x51, 0x73, 0x44, 0x79, 0x5a, 0x70, 0x43, 0x41, 0x47, 0x7a, 0x46, 0x6c, + 0x48, 0x35, 0x68, 0x78, 0x49, 0x72, 0x66, 0x66, 0x34, 0x49, 0x61, 0x0a, + 0x43, 0x31, 0x6e, 0x45, 0x57, 0x54, 0x4a, 0x33, 0x73, 0x37, 0x78, 0x67, + 0x61, 0x56, 0x59, 0x35, 0x2f, 0x62, 0x51, 0x47, 0x65, 0x79, 0x7a, 0x57, + 0x5a, 0x44, 0x62, 0x5a, 0x76, 0x55, 0x6a, 0x74, 0x68, 0x42, 0x39, 0x2b, + 0x70, 0x53, 0x4b, 0x50, 0x4b, 0x72, 0x68, 0x43, 0x39, 0x49, 0x4b, 0x33, + 0x31, 0x46, 0x4f, 0x51, 0x65, 0x45, 0x34, 0x74, 0x47, 0x76, 0x32, 0x42, + 0x62, 0x30, 0x54, 0x58, 0x0a, 0x4f, 0x77, 0x46, 0x30, 0x6c, 0x6b, 0x4c, + 0x67, 0x41, 0x4f, 0x49, 0x75, 0x61, 0x2b, 0x72, 0x46, 0x37, 0x6e, 0x4b, + 0x73, 0x75, 0x37, 0x2f, 0x2b, 0x36, 0x71, 0x71, 0x6f, 0x2b, 0x4e, 0x7a, + 0x32, 0x73, 0x6e, 0x6d, 0x4b, 0x74, 0x6d, 0x63, 0x43, 0x41, 0x77, 0x45, + 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x48, 0x51, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x0a, 0x46, 0x4a, + 0x33, 0x41, 0x5a, 0x36, 0x59, 0x4d, 0x49, 0x74, 0x6b, 0x6d, 0x39, 0x55, + 0x57, 0x72, 0x70, 0x6d, 0x56, 0x53, 0x45, 0x53, 0x66, 0x59, 0x52, 0x61, + 0x78, 0x6a, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, + 0x48, 0x2f, 0x0a, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x44, 0x41, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, + 0x51, 0x43, 0x7a, 0x56, 0x30, 0x30, 0x51, 0x59, 0x6b, 0x34, 0x36, 0x35, + 0x4b, 0x7a, 0x71, 0x75, 0x42, 0x79, 0x76, 0x4d, 0x69, 0x50, 0x49, 0x73, + 0x30, 0x6c, 0x61, 0x55, 0x5a, 0x78, 0x32, 0x0a, 0x4b, 0x49, 0x31, 0x35, + 0x71, 0x6c, 0x64, 0x47, 0x46, 0x39, 0x58, 0x31, 0x55, 0x76, 0x61, 0x33, + 0x52, 0x4f, 0x67, 0x49, 0x52, 0x4c, 0x38, 0x59, 0x68, 0x4e, 0x49, 0x4c, + 0x67, 0x4d, 0x33, 0x46, 0x45, 0x76, 0x30, 0x41, 0x56, 0x51, 0x56, 0x68, + 0x68, 0x30, 0x48, 0x63, 0x74, 0x53, 0x53, 0x65, 0x50, 0x4d, 0x54, 0x59, + 0x79, 0x50, 0x74, 0x77, 0x6e, 0x69, 0x39, 0x34, 0x6c, 0x6f, 0x4d, 0x67, + 0x0a, 0x4e, 0x74, 0x35, 0x38, 0x44, 0x32, 0x6b, 0x54, 0x69, 0x4b, 0x56, + 0x31, 0x4e, 0x70, 0x67, 0x49, 0x70, 0x73, 0x62, 0x66, 0x72, 0x4d, 0x37, + 0x6a, 0x57, 0x4e, 0x61, 0x33, 0x50, 0x74, 0x36, 0x36, 0x38, 0x2b, 0x73, + 0x30, 0x51, 0x4e, 0x69, 0x69, 0x67, 0x66, 0x56, 0x34, 0x50, 0x79, 0x2f, + 0x56, 0x70, 0x66, 0x7a, 0x5a, 0x6f, 0x74, 0x52, 0x65, 0x42, 0x41, 0x34, + 0x58, 0x72, 0x66, 0x35, 0x42, 0x0a, 0x38, 0x4f, 0x57, 0x79, 0x63, 0x76, + 0x70, 0x45, 0x67, 0x6a, 0x4e, 0x43, 0x36, 0x43, 0x31, 0x59, 0x39, 0x31, + 0x61, 0x4d, 0x59, 0x6a, 0x2b, 0x36, 0x51, 0x72, 0x43, 0x63, 0x44, 0x46, + 0x78, 0x2b, 0x4c, 0x6d, 0x55, 0x6d, 0x58, 0x46, 0x4e, 0x50, 0x41, 0x4c, + 0x4a, 0x34, 0x66, 0x71, 0x45, 0x4e, 0x6d, 0x53, 0x32, 0x4e, 0x75, 0x42, + 0x32, 0x4f, 0x6f, 0x73, 0x53, 0x77, 0x2f, 0x57, 0x44, 0x51, 0x0a, 0x4d, + 0x4b, 0x53, 0x4f, 0x79, 0x41, 0x52, 0x69, 0x71, 0x63, 0x54, 0x74, 0x4e, + 0x64, 0x35, 0x36, 0x6c, 0x2b, 0x30, 0x4f, 0x4f, 0x46, 0x36, 0x53, 0x4c, + 0x35, 0x4e, 0x77, 0x70, 0x61, 0x6d, 0x63, 0x62, 0x36, 0x64, 0x39, 0x45, + 0x78, 0x31, 0x2b, 0x78, 0x67, 0x68, 0x49, 0x73, 0x56, 0x35, 0x6e, 0x36, + 0x31, 0x45, 0x49, 0x4a, 0x65, 0x6e, 0x6d, 0x4a, 0x57, 0x74, 0x53, 0x4b, + 0x5a, 0x47, 0x63, 0x0a, 0x30, 0x6a, 0x6c, 0x7a, 0x43, 0x46, 0x66, 0x65, + 0x6d, 0x51, 0x61, 0x30, 0x57, 0x35, 0x30, 0x51, 0x42, 0x75, 0x48, 0x43, + 0x41, 0x4b, 0x69, 0x34, 0x48, 0x45, 0x6f, 0x43, 0x43, 0x68, 0x54, 0x51, + 0x77, 0x55, 0x48, 0x4b, 0x2b, 0x34, 0x77, 0x31, 0x49, 0x58, 0x32, 0x43, + 0x4f, 0x50, 0x4b, 0x70, 0x56, 0x4a, 0x45, 0x5a, 0x4e, 0x5a, 0x4f, 0x55, + 0x62, 0x57, 0x6f, 0x36, 0x78, 0x62, 0x4c, 0x51, 0x0a, 0x75, 0x34, 0x6d, + 0x47, 0x6b, 0x2b, 0x69, 0x62, 0x79, 0x51, 0x38, 0x36, 0x70, 0x33, 0x71, + 0x34, 0x6f, 0x66, 0x42, 0x34, 0x52, 0x76, 0x72, 0x38, 0x4e, 0x79, 0x2f, + 0x6c, 0x69, 0x6f, 0x54, 0x7a, 0x33, 0x2f, 0x34, 0x45, 0x32, 0x61, 0x46, + 0x6f, 0x6f, 0x43, 0x38, 0x6b, 0x34, 0x67, 0x6d, 0x56, 0x42, 0x74, 0x57, + 0x56, 0x79, 0x75, 0x45, 0x6b, 0x6c, 0x75, 0x74, 0x38, 0x39, 0x70, 0x4d, + 0x46, 0x0a, 0x75, 0x2b, 0x31, 0x7a, 0x36, 0x53, 0x33, 0x52, 0x64, 0x54, + 0x6e, 0x58, 0x35, 0x79, 0x54, 0x62, 0x32, 0x45, 0x35, 0x66, 0x51, 0x34, + 0x2b, 0x65, 0x30, 0x42, 0x51, 0x35, 0x76, 0x31, 0x56, 0x77, 0x53, 0x4a, + 0x6c, 0x58, 0x4d, 0x62, 0x53, 0x63, 0x37, 0x6b, 0x71, 0x59, 0x41, 0x35, + 0x59, 0x77, 0x48, 0x32, 0x41, 0x47, 0x37, 0x68, 0x73, 0x6a, 0x2f, 0x6f, + 0x46, 0x67, 0x49, 0x78, 0x70, 0x48, 0x0a, 0x59, 0x6f, 0x57, 0x6c, 0x7a, + 0x42, 0x6b, 0x30, 0x67, 0x47, 0x2b, 0x7a, 0x72, 0x42, 0x72, 0x6a, 0x6e, + 0x2f, 0x42, 0x37, 0x53, 0x4b, 0x33, 0x56, 0x41, 0x64, 0x6c, 0x6e, 0x74, + 0x71, 0x6c, 0x79, 0x6b, 0x2b, 0x6f, 0x74, 0x5a, 0x72, 0x57, 0x79, 0x75, + 0x4f, 0x51, 0x39, 0x50, 0x4c, 0x4c, 0x76, 0x54, 0x49, 0x7a, 0x71, 0x36, + 0x77, 0x65, 0x2f, 0x71, 0x7a, 0x57, 0x61, 0x56, 0x59, 0x61, 0x38, 0x0a, + 0x47, 0x4b, 0x61, 0x31, 0x71, 0x46, 0x36, 0x30, 0x67, 0x32, 0x78, 0x72, + 0x61, 0x55, 0x44, 0x54, 0x6e, 0x39, 0x7a, 0x78, 0x77, 0x32, 0x6c, 0x72, + 0x75, 0x65, 0x46, 0x74, 0x43, 0x66, 0x54, 0x78, 0x71, 0x6c, 0x42, 0x32, + 0x43, 0x6e, 0x70, 0x39, 0x65, 0x68, 0x65, 0x68, 0x56, 0x5a, 0x5a, 0x43, + 0x6d, 0x54, 0x45, 0x4a, 0x33, 0x57, 0x41, 0x52, 0x6a, 0x51, 0x55, 0x77, + 0x66, 0x75, 0x61, 0x4f, 0x0a, 0x52, 0x74, 0x47, 0x64, 0x46, 0x4e, 0x72, + 0x48, 0x46, 0x2b, 0x51, 0x46, 0x6c, 0x6f, 0x7a, 0x45, 0x4a, 0x4c, 0x55, + 0x62, 0x7a, 0x78, 0x51, 0x48, 0x73, 0x6b, 0x44, 0x34, 0x6f, 0x35, 0x35, + 0x42, 0x68, 0x72, 0x77, 0x45, 0x30, 0x47, 0x75, 0x57, 0x79, 0x43, 0x71, + 0x41, 0x4e, 0x50, 0x32, 0x2f, 0x37, 0x77, 0x61, 0x6a, 0x33, 0x56, 0x6a, + 0x46, 0x68, 0x54, 0x30, 0x2b, 0x6a, 0x2f, 0x36, 0x65, 0x0a, 0x4b, 0x65, + 0x43, 0x32, 0x75, 0x41, 0x6c, 0x6f, 0x47, 0x52, 0x77, 0x59, 0x51, 0x77, + 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x66, 0x66, 0x69, 0x72, + 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x72, 0x65, 0x6d, 0x69, + 0x75, 0x6d, 0x20, 0x45, 0x43, 0x43, 0x20, 0x4f, 0x3d, 0x41, 0x66, 0x66, + 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, + 0x66, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, + 0x72, 0x65, 0x6d, 0x69, 0x75, 0x6d, 0x20, 0x45, 0x43, 0x43, 0x20, 0x4f, + 0x3d, 0x41, 0x66, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, + 0x66, 0x66, 0x69, 0x72, 0x6d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, + 0x72, 0x65, 0x6d, 0x69, 0x75, 0x6d, 0x20, 0x45, 0x43, 0x43, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x34, + 0x30, 0x31, 0x32, 0x32, 0x34, 0x39, 0x30, 0x37, 0x38, 0x36, 0x31, 0x34, + 0x39, 0x30, 0x32, 0x36, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x36, 0x34, 0x3a, 0x62, 0x30, 0x3a, 0x30, 0x39, 0x3a, 0x35, 0x35, + 0x3a, 0x63, 0x66, 0x3a, 0x62, 0x31, 0x3a, 0x64, 0x35, 0x3a, 0x39, 0x39, + 0x3a, 0x65, 0x32, 0x3a, 0x62, 0x65, 0x3a, 0x31, 0x33, 0x3a, 0x61, 0x62, + 0x3a, 0x61, 0x36, 0x3a, 0x35, 0x64, 0x3a, 0x65, 0x61, 0x3a, 0x34, 0x64, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x38, 0x3a, + 0x32, 0x33, 0x3a, 0x36, 0x62, 0x3a, 0x30, 0x30, 0x3a, 0x32, 0x66, 0x3a, + 0x31, 0x64, 0x3a, 0x31, 0x36, 0x3a, 0x38, 0x36, 0x3a, 0x35, 0x33, 0x3a, + 0x30, 0x31, 0x3a, 0x35, 0x35, 0x3a, 0x36, 0x63, 0x3a, 0x31, 0x31, 0x3a, + 0x61, 0x34, 0x3a, 0x33, 0x37, 0x3a, 0x63, 0x61, 0x3a, 0x65, 0x62, 0x3a, + 0x66, 0x66, 0x3a, 0x63, 0x33, 0x3a, 0x62, 0x62, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x64, 0x3a, 0x37, 0x31, + 0x3a, 0x66, 0x64, 0x3a, 0x66, 0x36, 0x3a, 0x64, 0x61, 0x3a, 0x39, 0x37, + 0x3a, 0x65, 0x34, 0x3a, 0x63, 0x66, 0x3a, 0x36, 0x32, 0x3a, 0x64, 0x31, + 0x3a, 0x36, 0x34, 0x3a, 0x37, 0x61, 0x3a, 0x64, 0x64, 0x3a, 0x32, 0x35, + 0x3a, 0x38, 0x31, 0x3a, 0x62, 0x30, 0x3a, 0x37, 0x64, 0x3a, 0x37, 0x39, + 0x3a, 0x61, 0x64, 0x3a, 0x66, 0x38, 0x3a, 0x33, 0x39, 0x3a, 0x37, 0x65, + 0x3a, 0x62, 0x34, 0x3a, 0x65, 0x63, 0x3a, 0x62, 0x61, 0x3a, 0x39, 0x63, + 0x3a, 0x35, 0x65, 0x3a, 0x38, 0x34, 0x3a, 0x38, 0x38, 0x3a, 0x38, 0x32, + 0x3a, 0x31, 0x34, 0x3a, 0x32, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x42, 0x2f, 0x6a, 0x43, 0x43, 0x41, 0x59, 0x57, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x64, 0x4a, 0x63, 0x6c, 0x69, + 0x73, 0x63, 0x2f, 0x65, 0x6c, 0x51, 0x77, 0x43, 0x67, 0x59, 0x49, 0x4b, + 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x45, 0x41, 0x77, 0x4d, 0x77, 0x52, + 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x0a, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x44, 0x41, 0x53, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x43, 0x30, 0x46, 0x6d, + 0x5a, 0x6d, 0x6c, 0x79, 0x62, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x44, 0x42, 0x64, 0x42, 0x5a, 0x6d, 0x5a, 0x70, 0x63, 0x6d, 0x31, 0x55, + 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x51, 0x0a, 0x63, 0x6d, 0x56, + 0x74, 0x61, 0x58, 0x56, 0x74, 0x49, 0x45, 0x56, 0x44, 0x51, 0x7a, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x44, 0x41, 0x78, 0x4d, 0x6a, 0x6b, + 0x78, 0x4e, 0x44, 0x49, 0x77, 0x4d, 0x6a, 0x52, 0x61, 0x46, 0x77, 0x30, + 0x30, 0x4d, 0x44, 0x45, 0x79, 0x4d, 0x7a, 0x45, 0x78, 0x4e, 0x44, 0x49, + 0x77, 0x4d, 0x6a, 0x52, 0x61, 0x4d, 0x45, 0x55, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, + 0x56, 0x54, 0x4d, 0x52, 0x51, 0x77, 0x45, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x44, 0x41, 0x74, 0x42, 0x5a, 0x6d, 0x5a, 0x70, 0x63, 0x6d, + 0x31, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x44, 0x45, 0x67, 0x4d, 0x42, + 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x58, 0x51, 0x57, + 0x5a, 0x6d, 0x61, 0x58, 0x4a, 0x74, 0x0a, 0x56, 0x48, 0x4a, 0x31, 0x63, + 0x33, 0x51, 0x67, 0x55, 0x48, 0x4a, 0x6c, 0x62, 0x57, 0x6c, 0x31, 0x62, + 0x53, 0x42, 0x46, 0x51, 0x30, 0x4d, 0x77, 0x64, 0x6a, 0x41, 0x51, 0x42, + 0x67, 0x63, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, + 0x67, 0x55, 0x72, 0x67, 0x51, 0x51, 0x41, 0x49, 0x67, 0x4e, 0x69, 0x41, + 0x41, 0x51, 0x4e, 0x4d, 0x46, 0x34, 0x62, 0x46, 0x5a, 0x30, 0x44, 0x0a, + 0x30, 0x4b, 0x46, 0x35, 0x4e, 0x62, 0x63, 0x36, 0x50, 0x4a, 0x4a, 0x36, + 0x79, 0x68, 0x55, 0x63, 0x7a, 0x57, 0x4c, 0x7a, 0x6e, 0x43, 0x5a, 0x63, + 0x42, 0x7a, 0x33, 0x6c, 0x56, 0x50, 0x71, 0x6a, 0x31, 0x73, 0x77, 0x53, + 0x36, 0x76, 0x51, 0x55, 0x58, 0x2b, 0x69, 0x4f, 0x47, 0x61, 0x73, 0x76, + 0x4c, 0x6b, 0x6a, 0x6d, 0x72, 0x42, 0x68, 0x44, 0x65, 0x4b, 0x7a, 0x51, + 0x4e, 0x38, 0x4f, 0x39, 0x0a, 0x73, 0x73, 0x30, 0x73, 0x35, 0x6b, 0x66, + 0x69, 0x47, 0x75, 0x5a, 0x6a, 0x75, 0x44, 0x30, 0x75, 0x4c, 0x33, 0x6a, + 0x45, 0x54, 0x39, 0x76, 0x30, 0x44, 0x36, 0x52, 0x6f, 0x54, 0x46, 0x56, + 0x79, 0x61, 0x35, 0x55, 0x64, 0x54, 0x68, 0x68, 0x43, 0x6c, 0x58, 0x6a, + 0x4d, 0x4e, 0x7a, 0x79, 0x52, 0x34, 0x70, 0x74, 0x6c, 0x4b, 0x79, 0x6d, + 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x42, 0x30, 0x47, 0x0a, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, 0x61, 0x72, 0x79, + 0x6c, 0x36, 0x77, 0x42, 0x45, 0x31, 0x4e, 0x53, 0x5a, 0x52, 0x4d, 0x41, + 0x44, 0x44, 0x61, 0x76, 0x35, 0x41, 0x31, 0x61, 0x37, 0x57, 0x50, 0x44, + 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, + 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x4b, 0x42, + 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, + 0x77, 0x4e, 0x6e, 0x41, 0x44, 0x42, 0x6b, 0x41, 0x6a, 0x41, 0x58, 0x43, + 0x66, 0x4f, 0x48, 0x69, 0x46, 0x42, 0x61, 0x72, 0x38, 0x6a, 0x41, 0x51, + 0x72, 0x39, 0x48, 0x58, 0x2f, 0x56, 0x73, 0x0a, 0x61, 0x6f, 0x62, 0x67, + 0x78, 0x43, 0x64, 0x30, 0x35, 0x44, 0x68, 0x54, 0x31, 0x77, 0x56, 0x2f, + 0x47, 0x7a, 0x54, 0x6a, 0x78, 0x69, 0x2b, 0x7a, 0x79, 0x67, 0x6b, 0x38, + 0x4e, 0x35, 0x33, 0x58, 0x35, 0x37, 0x68, 0x47, 0x38, 0x66, 0x32, 0x68, + 0x34, 0x6e, 0x45, 0x43, 0x4d, 0x45, 0x4a, 0x5a, 0x68, 0x30, 0x50, 0x55, + 0x55, 0x64, 0x2b, 0x36, 0x30, 0x77, 0x6b, 0x79, 0x57, 0x73, 0x36, 0x49, + 0x0a, 0x66, 0x6c, 0x63, 0x39, 0x6e, 0x46, 0x39, 0x43, 0x61, 0x2f, 0x55, + 0x48, 0x4c, 0x62, 0x58, 0x77, 0x67, 0x70, 0x50, 0x35, 0x57, 0x57, 0x2b, + 0x75, 0x5a, 0x50, 0x70, 0x59, 0x35, 0x59, 0x73, 0x65, 0x34, 0x32, 0x4f, + 0x2b, 0x74, 0x59, 0x48, 0x4e, 0x62, 0x77, 0x4b, 0x4d, 0x65, 0x51, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x75, 0x6d, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x4e, 0x65, 0x74, + 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x55, 0x6e, + 0x69, 0x7a, 0x65, 0x74, 0x6f, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, + 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x20, + 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x75, 0x6d, 0x20, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x43, 0x65, 0x72, 0x74, 0x75, 0x6d, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x65, 0x64, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x43, + 0x41, 0x20, 0x4f, 0x3d, 0x55, 0x6e, 0x69, 0x7a, 0x65, 0x74, 0x6f, 0x20, + 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, + 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, + 0x74, 0x75, 0x6d, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x43, 0x65, 0x72, 0x74, 0x75, 0x6d, 0x20, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x65, 0x64, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, + 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x32, 0x37, 0x39, 0x37, 0x34, 0x34, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x35, 0x3a, 0x65, 0x39, 0x3a, 0x38, + 0x31, 0x3a, 0x34, 0x30, 0x3a, 0x63, 0x35, 0x3a, 0x31, 0x38, 0x3a, 0x36, + 0x39, 0x3a, 0x66, 0x63, 0x3a, 0x34, 0x36, 0x3a, 0x32, 0x63, 0x3a, 0x38, + 0x39, 0x3a, 0x37, 0x35, 0x3a, 0x36, 0x32, 0x3a, 0x30, 0x66, 0x3a, 0x61, + 0x61, 0x3a, 0x37, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x30, 0x37, 0x3a, 0x65, 0x30, 0x3a, 0x33, 0x32, 0x3a, 0x65, 0x30, + 0x3a, 0x32, 0x30, 0x3a, 0x62, 0x37, 0x3a, 0x32, 0x63, 0x3a, 0x33, 0x66, + 0x3a, 0x31, 0x39, 0x3a, 0x32, 0x66, 0x3a, 0x30, 0x36, 0x3a, 0x32, 0x38, + 0x3a, 0x61, 0x32, 0x3a, 0x35, 0x39, 0x3a, 0x33, 0x61, 0x3a, 0x31, 0x39, + 0x3a, 0x61, 0x37, 0x3a, 0x30, 0x66, 0x3a, 0x30, 0x36, 0x3a, 0x39, 0x65, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, + 0x63, 0x3a, 0x35, 0x38, 0x3a, 0x34, 0x36, 0x3a, 0x38, 0x64, 0x3a, 0x35, + 0x35, 0x3a, 0x66, 0x35, 0x3a, 0x38, 0x65, 0x3a, 0x34, 0x39, 0x3a, 0x37, + 0x65, 0x3a, 0x37, 0x34, 0x3a, 0x33, 0x39, 0x3a, 0x38, 0x32, 0x3a, 0x64, + 0x32, 0x3a, 0x62, 0x35, 0x3a, 0x30, 0x30, 0x3a, 0x31, 0x30, 0x3a, 0x62, + 0x36, 0x3a, 0x64, 0x31, 0x3a, 0x36, 0x35, 0x3a, 0x33, 0x37, 0x3a, 0x34, + 0x61, 0x3a, 0x63, 0x66, 0x3a, 0x38, 0x33, 0x3a, 0x61, 0x37, 0x3a, 0x64, + 0x34, 0x3a, 0x61, 0x33, 0x3a, 0x32, 0x64, 0x3a, 0x62, 0x37, 0x3a, 0x36, + 0x38, 0x3a, 0x63, 0x34, 0x3a, 0x34, 0x30, 0x3a, 0x38, 0x65, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x75, 0x7a, 0x43, 0x43, 0x41, + 0x71, 0x4f, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x44, 0x42, + 0x45, 0x54, 0x41, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x4d, + 0x48, 0x34, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x59, 0x54, 0x41, 0x6c, 0x42, 0x4d, 0x0a, 0x4d, 0x53, 0x49, 0x77, + 0x49, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x6c, 0x56, + 0x62, 0x6d, 0x6c, 0x36, 0x5a, 0x58, 0x52, 0x76, 0x49, 0x46, 0x52, 0x6c, + 0x59, 0x32, 0x68, 0x75, 0x62, 0x32, 0x78, 0x76, 0x5a, 0x32, 0x6c, 0x6c, + 0x63, 0x79, 0x42, 0x54, 0x4c, 0x6b, 0x45, 0x75, 0x4d, 0x53, 0x63, 0x77, + 0x4a, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x35, 0x44, + 0x0a, 0x5a, 0x58, 0x4a, 0x30, 0x64, 0x57, 0x30, 0x67, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, + 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, + 0x70, 0x64, 0x48, 0x6b, 0x78, 0x49, 0x6a, 0x41, 0x67, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x4d, 0x54, 0x47, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x52, + 0x31, 0x62, 0x53, 0x42, 0x55, 0x0a, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x47, + 0x56, 0x6b, 0x49, 0x45, 0x35, 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, + 0x73, 0x67, 0x51, 0x30, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, + 0x67, 0x78, 0x4d, 0x44, 0x49, 0x79, 0x4d, 0x54, 0x49, 0x77, 0x4e, 0x7a, + 0x4d, 0x33, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x6b, 0x78, 0x4d, 0x6a, + 0x4d, 0x78, 0x4d, 0x54, 0x49, 0x77, 0x4e, 0x7a, 0x4d, 0x33, 0x0a, 0x57, + 0x6a, 0x42, 0x2b, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x51, 0x54, 0x44, 0x45, 0x69, 0x4d, + 0x43, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x56, + 0x57, 0x35, 0x70, 0x65, 0x6d, 0x56, 0x30, 0x62, 0x79, 0x42, 0x55, 0x5a, + 0x57, 0x4e, 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x62, 0x32, 0x64, 0x70, 0x5a, + 0x58, 0x4d, 0x67, 0x0a, 0x55, 0x79, 0x35, 0x42, 0x4c, 0x6a, 0x45, 0x6e, + 0x4d, 0x43, 0x55, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x65, + 0x51, 0x32, 0x56, 0x79, 0x64, 0x48, 0x56, 0x74, 0x49, 0x45, 0x4e, 0x6c, + 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, + 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, + 0x61, 0x58, 0x52, 0x35, 0x4d, 0x53, 0x49, 0x77, 0x0a, 0x49, 0x41, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x6c, 0x44, 0x5a, 0x58, 0x4a, + 0x30, 0x64, 0x57, 0x30, 0x67, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, + 0x6c, 0x5a, 0x43, 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x62, 0x33, 0x4a, + 0x72, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x0a, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, + 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, + 0x45, 0x41, 0x34, 0x2f, 0x74, 0x39, 0x6f, 0x33, 0x4b, 0x36, 0x77, 0x76, + 0x44, 0x4a, 0x46, 0x49, 0x66, 0x31, 0x61, 0x77, 0x46, 0x4f, 0x34, 0x57, + 0x35, 0x41, 0x42, 0x37, 0x70, 0x74, 0x4a, 0x31, 0x31, 0x2f, 0x39, 0x31, + 0x73, 0x74, 0x73, 0x31, 0x72, 0x48, 0x0a, 0x55, 0x56, 0x2b, 0x72, 0x70, + 0x44, 0x4b, 0x6d, 0x59, 0x59, 0x65, 0x32, 0x62, 0x67, 0x2b, 0x47, 0x30, + 0x6a, 0x41, 0x43, 0x6c, 0x2f, 0x6a, 0x58, 0x61, 0x56, 0x65, 0x68, 0x47, + 0x44, 0x6c, 0x64, 0x61, 0x6d, 0x52, 0x35, 0x78, 0x67, 0x46, 0x5a, 0x72, + 0x44, 0x77, 0x78, 0x53, 0x6a, 0x68, 0x38, 0x30, 0x67, 0x54, 0x53, 0x53, + 0x79, 0x6a, 0x6f, 0x49, 0x46, 0x38, 0x37, 0x42, 0x36, 0x4c, 0x4d, 0x0a, + 0x54, 0x58, 0x50, 0x62, 0x38, 0x36, 0x35, 0x50, 0x78, 0x31, 0x62, 0x56, + 0x57, 0x71, 0x65, 0x57, 0x69, 0x66, 0x72, 0x7a, 0x71, 0x32, 0x6a, 0x55, + 0x49, 0x34, 0x5a, 0x5a, 0x4a, 0x38, 0x38, 0x4a, 0x4a, 0x37, 0x79, 0x73, + 0x62, 0x6e, 0x4b, 0x44, 0x48, 0x44, 0x42, 0x79, 0x33, 0x2b, 0x43, 0x69, + 0x36, 0x64, 0x4c, 0x68, 0x64, 0x48, 0x55, 0x5a, 0x76, 0x53, 0x71, 0x65, + 0x65, 0x78, 0x56, 0x55, 0x0a, 0x42, 0x42, 0x76, 0x58, 0x51, 0x7a, 0x6d, + 0x74, 0x56, 0x53, 0x6a, 0x46, 0x34, 0x68, 0x71, 0x37, 0x39, 0x4d, 0x44, + 0x6b, 0x72, 0x6a, 0x68, 0x4a, 0x4d, 0x38, 0x78, 0x32, 0x68, 0x5a, 0x38, + 0x35, 0x52, 0x64, 0x4b, 0x6b, 0x6e, 0x76, 0x49, 0x53, 0x6a, 0x46, 0x48, + 0x34, 0x66, 0x4f, 0x51, 0x74, 0x66, 0x2f, 0x57, 0x73, 0x58, 0x2b, 0x73, + 0x57, 0x6e, 0x37, 0x45, 0x74, 0x30, 0x62, 0x72, 0x4d, 0x0a, 0x6b, 0x55, + 0x4a, 0x33, 0x54, 0x43, 0x58, 0x4a, 0x6b, 0x44, 0x68, 0x76, 0x32, 0x2f, + 0x44, 0x4d, 0x2b, 0x34, 0x34, 0x65, 0x6c, 0x31, 0x6b, 0x2b, 0x31, 0x57, + 0x42, 0x4f, 0x35, 0x67, 0x55, 0x6f, 0x37, 0x55, 0x6c, 0x35, 0x45, 0x30, + 0x75, 0x36, 0x53, 0x4e, 0x73, 0x76, 0x2b, 0x58, 0x4c, 0x54, 0x4f, 0x63, + 0x72, 0x2b, 0x48, 0x39, 0x67, 0x30, 0x63, 0x76, 0x57, 0x30, 0x51, 0x4d, + 0x38, 0x78, 0x0a, 0x41, 0x63, 0x50, 0x73, 0x33, 0x68, 0x45, 0x74, 0x46, + 0x31, 0x30, 0x66, 0x75, 0x46, 0x44, 0x52, 0x58, 0x68, 0x6d, 0x6e, 0x61, + 0x64, 0x34, 0x48, 0x4d, 0x79, 0x6a, 0x4b, 0x55, 0x4a, 0x58, 0x35, 0x70, + 0x31, 0x54, 0x4c, 0x56, 0x49, 0x5a, 0x51, 0x52, 0x61, 0x6e, 0x35, 0x53, + 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, + 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x52, 0x4d, 0x42, + 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, + 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, + 0x42, 0x42, 0x51, 0x49, 0x64, 0x73, 0x33, 0x4c, 0x42, 0x2f, 0x38, 0x6b, + 0x39, 0x73, 0x58, 0x4e, 0x37, 0x62, 0x75, 0x51, 0x76, 0x4f, 0x4b, 0x45, + 0x4e, 0x30, 0x5a, 0x31, 0x39, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x0a, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, + 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, + 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4b, 0x61, 0x6f, 0x72, 0x53, 0x4c, + 0x4f, 0x41, 0x54, 0x32, 0x6d, 0x6f, 0x2f, 0x39, 0x69, 0x30, 0x45, 0x69, + 0x64, 0x69, 0x31, 0x35, 0x79, 0x0a, 0x73, 0x48, 0x68, 0x45, 0x34, 0x39, + 0x77, 0x63, 0x72, 0x77, 0x6e, 0x39, 0x49, 0x30, 0x6a, 0x36, 0x76, 0x53, + 0x72, 0x45, 0x75, 0x56, 0x55, 0x45, 0x74, 0x52, 0x43, 0x6a, 0x6a, 0x53, + 0x66, 0x65, 0x43, 0x34, 0x4a, 0x6a, 0x30, 0x4f, 0x37, 0x65, 0x44, 0x44, + 0x64, 0x35, 0x51, 0x56, 0x73, 0x69, 0x73, 0x72, 0x43, 0x61, 0x51, 0x56, + 0x79, 0x6d, 0x63, 0x4f, 0x44, 0x55, 0x30, 0x48, 0x66, 0x4c, 0x0a, 0x49, + 0x39, 0x4d, 0x41, 0x34, 0x47, 0x78, 0x57, 0x4c, 0x2b, 0x46, 0x70, 0x44, + 0x51, 0x33, 0x5a, 0x71, 0x72, 0x38, 0x68, 0x67, 0x56, 0x44, 0x5a, 0x42, + 0x71, 0x57, 0x6f, 0x2f, 0x35, 0x55, 0x33, 0x30, 0x4b, 0x72, 0x2b, 0x34, + 0x72, 0x50, 0x31, 0x6d, 0x53, 0x31, 0x46, 0x68, 0x49, 0x72, 0x6c, 0x51, + 0x67, 0x6e, 0x58, 0x64, 0x41, 0x49, 0x76, 0x39, 0x34, 0x6e, 0x59, 0x6d, + 0x65, 0x6d, 0x38, 0x0a, 0x4a, 0x39, 0x52, 0x48, 0x6a, 0x62, 0x6f, 0x4e, + 0x52, 0x68, 0x78, 0x33, 0x7a, 0x78, 0x53, 0x6b, 0x48, 0x4c, 0x6d, 0x6b, + 0x4d, 0x63, 0x53, 0x63, 0x4b, 0x48, 0x51, 0x44, 0x4e, 0x50, 0x38, 0x7a, + 0x47, 0x53, 0x61, 0x6c, 0x36, 0x51, 0x31, 0x30, 0x74, 0x7a, 0x36, 0x58, + 0x78, 0x6e, 0x62, 0x6f, 0x4a, 0x35, 0x61, 0x6a, 0x5a, 0x74, 0x33, 0x68, + 0x72, 0x76, 0x4a, 0x42, 0x57, 0x38, 0x71, 0x59, 0x0a, 0x56, 0x6f, 0x4e, + 0x7a, 0x63, 0x4f, 0x53, 0x47, 0x47, 0x74, 0x49, 0x78, 0x51, 0x62, 0x6f, + 0x76, 0x76, 0x69, 0x30, 0x54, 0x57, 0x6e, 0x5a, 0x76, 0x54, 0x75, 0x68, + 0x4f, 0x67, 0x51, 0x34, 0x2f, 0x57, 0x77, 0x4d, 0x69, 0x6f, 0x42, 0x4b, + 0x2b, 0x5a, 0x6c, 0x67, 0x52, 0x53, 0x73, 0x73, 0x44, 0x78, 0x4c, 0x51, + 0x71, 0x4b, 0x69, 0x32, 0x57, 0x46, 0x2b, 0x41, 0x35, 0x56, 0x4c, 0x78, + 0x49, 0x0a, 0x30, 0x33, 0x59, 0x6e, 0x6e, 0x5a, 0x6f, 0x74, 0x42, 0x71, + 0x62, 0x4a, 0x37, 0x44, 0x6e, 0x53, 0x71, 0x39, 0x75, 0x66, 0x6d, 0x67, + 0x73, 0x6e, 0x41, 0x6a, 0x55, 0x70, 0x73, 0x55, 0x43, 0x56, 0x35, 0x2f, + 0x6e, 0x6f, 0x6e, 0x46, 0x57, 0x49, 0x47, 0x55, 0x62, 0x57, 0x74, 0x7a, + 0x54, 0x31, 0x66, 0x73, 0x34, 0x35, 0x6d, 0x74, 0x6b, 0x34, 0x38, 0x56, + 0x48, 0x33, 0x54, 0x79, 0x77, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, + 0x57, 0x43, 0x41, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x54, + 0x41, 0x49, 0x57, 0x41, 0x4e, 0x2d, 0x43, 0x41, 0x20, 0x4f, 0x55, 0x3d, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x57, + 0x43, 0x41, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x54, 0x41, + 0x49, 0x57, 0x41, 0x4e, 0x2d, 0x43, 0x41, 0x20, 0x4f, 0x55, 0x3d, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x57, 0x43, 0x41, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, + 0x61, 0x3a, 0x30, 0x38, 0x3a, 0x38, 0x66, 0x3a, 0x66, 0x36, 0x3a, 0x66, + 0x39, 0x3a, 0x37, 0x62, 0x3a, 0x62, 0x37, 0x3a, 0x66, 0x32, 0x3a, 0x62, + 0x31, 0x3a, 0x61, 0x37, 0x3a, 0x31, 0x65, 0x3a, 0x39, 0x62, 0x3a, 0x65, + 0x61, 0x3a, 0x65, 0x61, 0x3a, 0x62, 0x64, 0x3a, 0x37, 0x39, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x66, 0x3a, 0x39, 0x65, + 0x3a, 0x38, 0x37, 0x3a, 0x36, 0x64, 0x3a, 0x64, 0x33, 0x3a, 0x65, 0x62, + 0x3a, 0x66, 0x63, 0x3a, 0x34, 0x32, 0x3a, 0x32, 0x36, 0x3a, 0x39, 0x37, + 0x3a, 0x61, 0x33, 0x3a, 0x62, 0x35, 0x3a, 0x61, 0x33, 0x3a, 0x37, 0x61, + 0x3a, 0x61, 0x30, 0x3a, 0x37, 0x36, 0x3a, 0x61, 0x39, 0x3a, 0x30, 0x36, + 0x3a, 0x32, 0x33, 0x3a, 0x34, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x66, 0x3a, 0x64, 0x38, 0x3a, 0x38, + 0x66, 0x3a, 0x65, 0x31, 0x3a, 0x31, 0x30, 0x3a, 0x31, 0x63, 0x3a, 0x34, + 0x31, 0x3a, 0x61, 0x65, 0x3a, 0x33, 0x65, 0x3a, 0x38, 0x30, 0x3a, 0x31, + 0x62, 0x3a, 0x66, 0x38, 0x3a, 0x62, 0x65, 0x3a, 0x35, 0x36, 0x3a, 0x33, + 0x35, 0x3a, 0x30, 0x65, 0x3a, 0x65, 0x39, 0x3a, 0x62, 0x61, 0x3a, 0x64, + 0x31, 0x3a, 0x61, 0x36, 0x3a, 0x62, 0x39, 0x3a, 0x62, 0x64, 0x3a, 0x35, + 0x31, 0x3a, 0x35, 0x65, 0x3a, 0x64, 0x63, 0x3a, 0x35, 0x63, 0x3a, 0x36, + 0x64, 0x3a, 0x35, 0x62, 0x3a, 0x38, 0x37, 0x3a, 0x31, 0x31, 0x3a, 0x61, + 0x63, 0x3a, 0x34, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x44, 0x65, 0x7a, 0x43, 0x43, 0x41, 0x6d, 0x4f, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, + 0x46, 0x41, 0x44, 0x42, 0x66, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x55, 0x56, 0x7a, 0x45, + 0x53, 0x0a, 0x4d, 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, + 0x77, 0x4a, 0x56, 0x45, 0x46, 0x4a, 0x56, 0x30, 0x46, 0x4f, 0x4c, 0x55, + 0x4e, 0x42, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x44, 0x41, 0x64, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x42, 0x4d, 0x53, 0x6f, 0x77, 0x4b, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x44, 0x43, 0x46, 0x55, 0x0a, 0x56, 0x30, 0x4e, 0x42, 0x49, + 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, + 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, + 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, + 0x48, 0x6b, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x67, 0x77, 0x4f, + 0x44, 0x49, 0x34, 0x4d, 0x44, 0x63, 0x79, 0x4e, 0x44, 0x4d, 0x7a, 0x0a, + 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x41, 0x78, 0x4d, 0x6a, 0x4d, 0x78, + 0x4d, 0x54, 0x55, 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x42, 0x66, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x55, 0x56, 0x7a, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x4a, 0x56, 0x45, 0x46, 0x4a, + 0x56, 0x30, 0x46, 0x4f, 0x0a, 0x4c, 0x55, 0x4e, 0x42, 0x4d, 0x52, 0x41, + 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x44, 0x41, 0x64, + 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x53, 0x6f, + 0x77, 0x4b, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x43, 0x46, + 0x55, 0x56, 0x30, 0x4e, 0x42, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, + 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x0a, 0x61, 0x57, + 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, + 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, 0x67, 0x67, + 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, + 0x49, 0x42, 0x0a, 0x41, 0x51, 0x43, 0x77, 0x66, 0x6e, 0x4b, 0x34, 0x70, + 0x41, 0x4f, 0x55, 0x35, 0x71, 0x66, 0x65, 0x43, 0x54, 0x69, 0x52, 0x53, + 0x68, 0x46, 0x41, 0x68, 0x36, 0x64, 0x38, 0x57, 0x57, 0x51, 0x55, 0x65, + 0x37, 0x55, 0x52, 0x45, 0x4e, 0x33, 0x2b, 0x76, 0x39, 0x58, 0x41, 0x75, + 0x31, 0x62, 0x69, 0x68, 0x53, 0x58, 0x30, 0x4e, 0x58, 0x49, 0x50, 0x2b, + 0x46, 0x50, 0x51, 0x51, 0x65, 0x46, 0x45, 0x0a, 0x41, 0x63, 0x4b, 0x30, + 0x48, 0x4d, 0x4d, 0x78, 0x51, 0x68, 0x5a, 0x48, 0x68, 0x54, 0x4d, 0x69, + 0x64, 0x72, 0x49, 0x4b, 0x62, 0x77, 0x2f, 0x6c, 0x4a, 0x56, 0x42, 0x50, + 0x68, 0x59, 0x61, 0x2b, 0x76, 0x35, 0x67, 0x75, 0x45, 0x47, 0x63, 0x65, + 0x76, 0x68, 0x45, 0x46, 0x68, 0x67, 0x57, 0x51, 0x78, 0x46, 0x6e, 0x51, + 0x66, 0x48, 0x67, 0x51, 0x73, 0x49, 0x42, 0x63, 0x74, 0x2b, 0x48, 0x48, + 0x0a, 0x4b, 0x33, 0x58, 0x4c, 0x66, 0x4a, 0x2b, 0x75, 0x74, 0x64, 0x47, + 0x64, 0x49, 0x7a, 0x64, 0x6a, 0x70, 0x39, 0x78, 0x43, 0x6f, 0x69, 0x32, + 0x53, 0x42, 0x42, 0x74, 0x51, 0x77, 0x58, 0x75, 0x34, 0x50, 0x68, 0x76, + 0x4a, 0x56, 0x67, 0x53, 0x4c, 0x4c, 0x31, 0x4b, 0x62, 0x72, 0x61, 0x6c, + 0x57, 0x36, 0x63, 0x48, 0x2f, 0x72, 0x61, 0x6c, 0x59, 0x68, 0x7a, 0x43, + 0x32, 0x67, 0x66, 0x65, 0x58, 0x0a, 0x52, 0x66, 0x77, 0x5a, 0x56, 0x7a, + 0x73, 0x72, 0x62, 0x2b, 0x52, 0x48, 0x39, 0x4a, 0x6c, 0x46, 0x2f, 0x68, + 0x33, 0x78, 0x2b, 0x4a, 0x65, 0x6a, 0x69, 0x42, 0x30, 0x33, 0x48, 0x46, + 0x79, 0x50, 0x34, 0x48, 0x59, 0x6c, 0x6d, 0x6c, 0x44, 0x34, 0x6f, 0x46, + 0x54, 0x2f, 0x52, 0x4a, 0x42, 0x32, 0x49, 0x39, 0x49, 0x79, 0x78, 0x73, + 0x4f, 0x72, 0x42, 0x72, 0x2f, 0x38, 0x2b, 0x37, 0x2f, 0x7a, 0x0a, 0x72, + 0x58, 0x32, 0x53, 0x59, 0x67, 0x4a, 0x62, 0x4b, 0x64, 0x4d, 0x31, 0x6f, + 0x35, 0x4f, 0x61, 0x51, 0x32, 0x52, 0x67, 0x58, 0x62, 0x4c, 0x36, 0x4d, + 0x76, 0x38, 0x37, 0x42, 0x4b, 0x39, 0x4e, 0x51, 0x47, 0x72, 0x35, 0x78, + 0x2b, 0x50, 0x76, 0x49, 0x2f, 0x31, 0x72, 0x79, 0x2b, 0x55, 0x50, 0x69, + 0x7a, 0x67, 0x4e, 0x37, 0x67, 0x72, 0x38, 0x2f, 0x67, 0x2b, 0x59, 0x6e, + 0x7a, 0x41, 0x78, 0x0a, 0x33, 0x57, 0x78, 0x53, 0x5a, 0x66, 0x6d, 0x4c, + 0x67, 0x62, 0x34, 0x69, 0x34, 0x52, 0x78, 0x59, 0x41, 0x37, 0x71, 0x52, + 0x47, 0x34, 0x6b, 0x48, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, + 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, + 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x52, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, + 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, + 0x57, 0x42, 0x42, 0x52, 0x71, 0x4f, 0x46, 0x73, 0x6d, 0x6a, 0x64, 0x36, + 0x4c, 0x57, 0x76, 0x4a, 0x50, 0x65, 0x6c, 0x53, 0x44, 0x47, 0x52, 0x6a, + 0x6a, 0x43, 0x44, 0x57, 0x6d, 0x75, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x0a, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x50, 0x4e, + 0x56, 0x33, 0x50, 0x64, 0x72, 0x66, 0x69, 0x62, 0x71, 0x48, 0x44, 0x41, + 0x68, 0x55, 0x61, 0x69, 0x42, 0x51, 0x6b, 0x72, 0x36, 0x77, 0x51, 0x54, + 0x32, 0x35, 0x4a, 0x6d, 0x53, 0x44, 0x43, 0x69, 0x2f, 0x6f, 0x51, 0x4d, + 0x43, 0x58, 0x4b, 0x43, 0x65, 0x43, 0x0a, 0x4d, 0x45, 0x72, 0x4a, 0x6b, + 0x2f, 0x39, 0x71, 0x35, 0x36, 0x59, 0x41, 0x66, 0x34, 0x6c, 0x43, 0x6d, + 0x74, 0x59, 0x52, 0x35, 0x56, 0x50, 0x4f, 0x4c, 0x38, 0x7a, 0x79, 0x32, + 0x67, 0x58, 0x45, 0x2f, 0x75, 0x4a, 0x51, 0x78, 0x44, 0x71, 0x47, 0x66, + 0x63, 0x7a, 0x61, 0x66, 0x68, 0x41, 0x4a, 0x4f, 0x35, 0x49, 0x31, 0x4b, + 0x6c, 0x4f, 0x79, 0x2f, 0x75, 0x73, 0x72, 0x42, 0x64, 0x6c, 0x73, 0x0a, + 0x58, 0x65, 0x62, 0x51, 0x37, 0x39, 0x4e, 0x71, 0x5a, 0x70, 0x34, 0x56, + 0x4b, 0x49, 0x56, 0x36, 0x36, 0x49, 0x49, 0x41, 0x72, 0x42, 0x36, 0x6e, + 0x43, 0x57, 0x6c, 0x57, 0x51, 0x74, 0x4e, 0x6f, 0x55, 0x52, 0x69, 0x2b, + 0x56, 0x4a, 0x71, 0x2f, 0x52, 0x45, 0x47, 0x36, 0x53, 0x62, 0x34, 0x67, + 0x75, 0x6d, 0x6c, 0x63, 0x37, 0x72, 0x68, 0x33, 0x7a, 0x63, 0x35, 0x73, + 0x48, 0x36, 0x32, 0x44, 0x0a, 0x6c, 0x68, 0x68, 0x39, 0x44, 0x72, 0x55, + 0x55, 0x4f, 0x59, 0x54, 0x78, 0x4b, 0x4f, 0x6b, 0x74, 0x6f, 0x35, 0x35, + 0x37, 0x48, 0x6e, 0x70, 0x79, 0x57, 0x6f, 0x4f, 0x7a, 0x65, 0x57, 0x2f, + 0x76, 0x74, 0x50, 0x7a, 0x51, 0x43, 0x71, 0x56, 0x59, 0x54, 0x30, 0x62, + 0x66, 0x2b, 0x32, 0x31, 0x35, 0x57, 0x66, 0x4b, 0x45, 0x49, 0x6c, 0x4b, + 0x75, 0x44, 0x38, 0x7a, 0x37, 0x66, 0x44, 0x76, 0x6e, 0x0a, 0x61, 0x73, + 0x70, 0x48, 0x59, 0x63, 0x4e, 0x36, 0x2b, 0x4e, 0x4f, 0x53, 0x42, 0x42, + 0x2b, 0x34, 0x49, 0x49, 0x54, 0x68, 0x4e, 0x6c, 0x51, 0x57, 0x78, 0x30, + 0x44, 0x65, 0x4f, 0x34, 0x70, 0x7a, 0x33, 0x4e, 0x2f, 0x47, 0x43, 0x55, + 0x7a, 0x66, 0x37, 0x4e, 0x72, 0x2f, 0x31, 0x46, 0x4e, 0x43, 0x6f, 0x63, + 0x6e, 0x79, 0x59, 0x68, 0x30, 0x69, 0x67, 0x7a, 0x79, 0x58, 0x78, 0x66, + 0x6b, 0x5a, 0x0a, 0x59, 0x69, 0x65, 0x73, 0x5a, 0x53, 0x4c, 0x58, 0x30, + 0x7a, 0x7a, 0x47, 0x35, 0x59, 0x36, 0x79, 0x55, 0x38, 0x78, 0x4a, 0x7a, + 0x72, 0x77, 0x77, 0x2f, 0x6e, 0x73, 0x4f, 0x4d, 0x35, 0x44, 0x37, 0x37, + 0x64, 0x49, 0x55, 0x6b, 0x52, 0x38, 0x48, 0x72, 0x77, 0x3d, 0x3d, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x4f, 0x3d, 0x53, 0x45, 0x43, 0x4f, 0x4d, 0x20, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x43, + 0x4f, 0x2e, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x53, + 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x6f, 0x6d, 0x6d, + 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x43, 0x41, 0x32, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x4f, 0x3d, 0x53, 0x45, 0x43, 0x4f, 0x4d, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, + 0x6d, 0x73, 0x20, 0x43, 0x4f, 0x2e, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x20, + 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, 0x20, + 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x32, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x65, 0x63, 0x75, + 0x72, 0x69, 0x74, 0x79, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, + 0x41, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, + 0x63, 0x3a, 0x33, 0x39, 0x3a, 0x37, 0x64, 0x3a, 0x61, 0x34, 0x3a, 0x30, + 0x65, 0x3a, 0x35, 0x35, 0x3a, 0x35, 0x39, 0x3a, 0x62, 0x32, 0x3a, 0x33, + 0x66, 0x3a, 0x64, 0x36, 0x3a, 0x34, 0x31, 0x3a, 0x62, 0x31, 0x3a, 0x31, + 0x32, 0x3a, 0x35, 0x30, 0x3a, 0x64, 0x65, 0x3a, 0x34, 0x33, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x66, 0x3a, 0x33, 0x62, + 0x3a, 0x38, 0x63, 0x3a, 0x66, 0x32, 0x3a, 0x66, 0x38, 0x3a, 0x31, 0x30, + 0x3a, 0x62, 0x33, 0x3a, 0x37, 0x64, 0x3a, 0x37, 0x38, 0x3a, 0x62, 0x34, + 0x3a, 0x63, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x31, 0x39, 0x3a, 0x31, 0x39, + 0x3a, 0x63, 0x33, 0x3a, 0x37, 0x33, 0x3a, 0x33, 0x34, 0x3a, 0x62, 0x39, + 0x3a, 0x63, 0x37, 0x3a, 0x37, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x31, 0x3a, 0x33, 0x62, 0x3a, 0x32, + 0x63, 0x3a, 0x65, 0x63, 0x3a, 0x62, 0x38, 0x3a, 0x31, 0x30, 0x3a, 0x64, + 0x34, 0x3a, 0x63, 0x64, 0x3a, 0x65, 0x35, 0x3a, 0x64, 0x64, 0x3a, 0x38, + 0x35, 0x3a, 0x33, 0x39, 0x3a, 0x31, 0x61, 0x3a, 0x64, 0x66, 0x3a, 0x63, + 0x36, 0x3a, 0x63, 0x32, 0x3a, 0x64, 0x64, 0x3a, 0x36, 0x30, 0x3a, 0x64, + 0x38, 0x3a, 0x37, 0x62, 0x3a, 0x62, 0x37, 0x3a, 0x33, 0x36, 0x3a, 0x64, + 0x32, 0x3a, 0x62, 0x35, 0x3a, 0x32, 0x31, 0x3a, 0x34, 0x38, 0x3a, 0x34, + 0x61, 0x3a, 0x61, 0x34, 0x3a, 0x37, 0x61, 0x3a, 0x30, 0x65, 0x3a, 0x62, + 0x65, 0x3a, 0x66, 0x36, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x44, 0x64, 0x7a, 0x43, 0x43, 0x41, 0x6c, 0x2b, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, + 0x46, 0x41, 0x44, 0x42, 0x64, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4b, 0x55, 0x44, 0x45, + 0x6c, 0x0a, 0x4d, 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, + 0x4d, 0x63, 0x55, 0x30, 0x56, 0x44, 0x54, 0x30, 0x30, 0x67, 0x56, 0x48, + 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, + 0x56, 0x74, 0x63, 0x79, 0x42, 0x44, 0x54, 0x79, 0x34, 0x73, 0x54, 0x46, + 0x52, 0x45, 0x4c, 0x6a, 0x45, 0x6e, 0x4d, 0x43, 0x55, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x78, 0x4d, 0x65, 0x0a, 0x55, 0x32, 0x56, 0x6a, 0x64, + 0x58, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x67, 0x51, 0x32, 0x39, 0x74, 0x62, + 0x58, 0x56, 0x75, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, + 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x51, 0x30, 0x45, 0x79, 0x4d, + 0x42, 0x34, 0x58, 0x44, 0x54, 0x41, 0x35, 0x4d, 0x44, 0x55, 0x79, 0x4f, + 0x54, 0x41, 0x31, 0x4d, 0x44, 0x41, 0x7a, 0x4f, 0x56, 0x6f, 0x58, 0x0a, + 0x44, 0x54, 0x49, 0x35, 0x4d, 0x44, 0x55, 0x79, 0x4f, 0x54, 0x41, 0x31, + 0x4d, 0x44, 0x41, 0x7a, 0x4f, 0x56, 0x6f, 0x77, 0x58, 0x54, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x53, 0x6c, 0x41, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x6f, 0x54, 0x48, 0x46, 0x4e, 0x46, 0x51, 0x30, 0x39, 0x4e, + 0x49, 0x46, 0x52, 0x79, 0x0a, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x4e, + 0x35, 0x63, 0x33, 0x52, 0x6c, 0x62, 0x58, 0x4d, 0x67, 0x51, 0x30, 0x38, + 0x75, 0x4c, 0x45, 0x78, 0x55, 0x52, 0x43, 0x34, 0x78, 0x4a, 0x7a, 0x41, + 0x6c, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x48, 0x6c, 0x4e, + 0x6c, 0x59, 0x33, 0x56, 0x79, 0x61, 0x58, 0x52, 0x35, 0x49, 0x45, 0x4e, + 0x76, 0x62, 0x57, 0x31, 0x31, 0x62, 0x6d, 0x6c, 0x6a, 0x0a, 0x59, 0x58, + 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x45, + 0x4e, 0x42, 0x4d, 0x6a, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4e, + 0x41, 0x56, 0x0a, 0x4f, 0x56, 0x4b, 0x78, 0x55, 0x72, 0x4f, 0x36, 0x78, + 0x56, 0x6d, 0x43, 0x78, 0x46, 0x31, 0x53, 0x72, 0x6a, 0x70, 0x44, 0x5a, + 0x59, 0x42, 0x4c, 0x78, 0x2f, 0x4b, 0x57, 0x76, 0x4e, 0x73, 0x32, 0x6c, + 0x39, 0x61, 0x6d, 0x5a, 0x49, 0x79, 0x6f, 0x58, 0x76, 0x44, 0x6a, 0x43, + 0x68, 0x7a, 0x33, 0x33, 0x35, 0x63, 0x39, 0x53, 0x36, 0x37, 0x32, 0x58, + 0x65, 0x77, 0x68, 0x74, 0x55, 0x47, 0x72, 0x0a, 0x7a, 0x62, 0x6c, 0x2b, + 0x64, 0x70, 0x2b, 0x2b, 0x2b, 0x54, 0x34, 0x32, 0x4e, 0x4b, 0x41, 0x37, + 0x77, 0x66, 0x59, 0x78, 0x45, 0x55, 0x56, 0x30, 0x6b, 0x7a, 0x31, 0x58, + 0x67, 0x4d, 0x58, 0x35, 0x69, 0x5a, 0x6e, 0x4b, 0x35, 0x61, 0x74, 0x71, + 0x31, 0x4c, 0x58, 0x61, 0x51, 0x5a, 0x41, 0x51, 0x77, 0x64, 0x62, 0x57, + 0x51, 0x6f, 0x6e, 0x43, 0x76, 0x2f, 0x51, 0x34, 0x45, 0x70, 0x56, 0x4d, + 0x0a, 0x56, 0x41, 0x58, 0x33, 0x4e, 0x75, 0x52, 0x46, 0x67, 0x33, 0x73, + 0x55, 0x5a, 0x64, 0x62, 0x63, 0x44, 0x45, 0x33, 0x52, 0x33, 0x6e, 0x34, + 0x4d, 0x71, 0x7a, 0x76, 0x45, 0x46, 0x62, 0x34, 0x36, 0x56, 0x71, 0x5a, + 0x61, 0x62, 0x33, 0x5a, 0x70, 0x55, 0x71, 0x6c, 0x36, 0x75, 0x63, 0x6a, + 0x72, 0x61, 0x70, 0x70, 0x64, 0x55, 0x74, 0x41, 0x74, 0x43, 0x6d, 0x73, + 0x31, 0x46, 0x67, 0x6b, 0x51, 0x0a, 0x68, 0x4e, 0x42, 0x71, 0x79, 0x6a, + 0x6f, 0x47, 0x41, 0x44, 0x64, 0x48, 0x35, 0x48, 0x35, 0x58, 0x54, 0x7a, + 0x2b, 0x4c, 0x36, 0x32, 0x65, 0x34, 0x69, 0x4b, 0x72, 0x46, 0x76, 0x6c, + 0x4e, 0x56, 0x73, 0x70, 0x48, 0x45, 0x66, 0x62, 0x6d, 0x77, 0x68, 0x52, + 0x6b, 0x47, 0x65, 0x43, 0x37, 0x62, 0x59, 0x52, 0x72, 0x36, 0x68, 0x66, + 0x56, 0x4b, 0x6b, 0x61, 0x48, 0x6e, 0x46, 0x74, 0x57, 0x4f, 0x0a, 0x6f, + 0x6a, 0x6e, 0x66, 0x6c, 0x4c, 0x68, 0x77, 0x48, 0x79, 0x67, 0x2f, 0x69, + 0x2f, 0x78, 0x41, 0x58, 0x6d, 0x4f, 0x44, 0x50, 0x49, 0x4d, 0x71, 0x47, + 0x70, 0x6c, 0x72, 0x7a, 0x39, 0x35, 0x5a, 0x61, 0x6a, 0x76, 0x38, 0x62, + 0x78, 0x62, 0x58, 0x48, 0x2f, 0x31, 0x4b, 0x45, 0x4f, 0x74, 0x4f, 0x67, + 0x68, 0x59, 0x36, 0x72, 0x43, 0x63, 0x4d, 0x55, 0x2f, 0x47, 0x74, 0x31, + 0x53, 0x53, 0x77, 0x0a, 0x61, 0x77, 0x4e, 0x51, 0x77, 0x53, 0x30, 0x38, + 0x46, 0x74, 0x31, 0x45, 0x4e, 0x43, 0x63, 0x61, 0x64, 0x66, 0x73, 0x43, + 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x41, 0x71, 0x46, 0x71, 0x58, 0x64, 0x6c, 0x42, 0x5a, 0x68, 0x38, + 0x51, 0x49, 0x48, 0x34, 0x44, 0x35, 0x63, 0x73, 0x0a, 0x4f, 0x50, 0x45, + 0x4b, 0x37, 0x44, 0x7a, 0x50, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, + 0x2f, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x0a, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x41, 0x51, 0x42, 0x4d, 0x4f, 0x71, 0x4e, 0x45, 0x72, 0x4c, + 0x6c, 0x46, 0x73, 0x63, 0x65, 0x54, 0x66, 0x73, 0x67, 0x4c, 0x43, 0x6b, + 0x4c, 0x66, 0x5a, 0x4f, 0x6f, 0x63, 0x37, 0x6c, 0x6c, 0x73, 0x43, 0x4c, + 0x71, 0x4a, 0x58, 0x32, 0x72, 0x4b, 0x53, 0x70, 0x57, 0x65, 0x65, 0x6f, + 0x38, 0x48, 0x78, 0x64, 0x70, 0x46, 0x0a, 0x63, 0x6f, 0x4a, 0x78, 0x44, + 0x6a, 0x72, 0x53, 0x7a, 0x47, 0x2b, 0x6e, 0x74, 0x4b, 0x45, 0x6a, 0x75, + 0x2f, 0x59, 0x6b, 0x6e, 0x38, 0x73, 0x58, 0x2f, 0x6f, 0x79, 0x6d, 0x7a, + 0x73, 0x4c, 0x53, 0x32, 0x38, 0x79, 0x4e, 0x2f, 0x48, 0x48, 0x38, 0x41, + 0x79, 0x6e, 0x42, 0x62, 0x46, 0x30, 0x7a, 0x58, 0x32, 0x53, 0x32, 0x5a, + 0x54, 0x75, 0x4a, 0x62, 0x78, 0x68, 0x32, 0x65, 0x50, 0x58, 0x63, 0x0a, + 0x6f, 0x6b, 0x67, 0x66, 0x47, 0x54, 0x2b, 0x4f, 0x6b, 0x2b, 0x76, 0x78, + 0x2b, 0x68, 0x66, 0x75, 0x7a, 0x55, 0x37, 0x6a, 0x42, 0x42, 0x4a, 0x56, + 0x31, 0x75, 0x58, 0x6b, 0x33, 0x66, 0x73, 0x2b, 0x42, 0x58, 0x7a, 0x69, + 0x48, 0x56, 0x37, 0x47, 0x70, 0x37, 0x79, 0x58, 0x54, 0x32, 0x67, 0x36, + 0x39, 0x65, 0x6b, 0x75, 0x43, 0x6b, 0x4f, 0x32, 0x72, 0x31, 0x64, 0x63, + 0x59, 0x6d, 0x68, 0x38, 0x0a, 0x74, 0x2f, 0x32, 0x6a, 0x69, 0x6f, 0x53, + 0x67, 0x72, 0x47, 0x4b, 0x2b, 0x4b, 0x77, 0x6d, 0x48, 0x4e, 0x50, 0x42, + 0x71, 0x41, 0x62, 0x75, 0x62, 0x4b, 0x56, 0x59, 0x38, 0x2f, 0x67, 0x41, + 0x33, 0x7a, 0x79, 0x4e, 0x73, 0x38, 0x55, 0x36, 0x71, 0x74, 0x6e, 0x52, + 0x47, 0x45, 0x6d, 0x79, 0x52, 0x37, 0x6a, 0x54, 0x56, 0x37, 0x4a, 0x71, + 0x52, 0x35, 0x30, 0x53, 0x2b, 0x6b, 0x44, 0x46, 0x79, 0x0a, 0x31, 0x55, + 0x6b, 0x43, 0x39, 0x67, 0x4c, 0x6c, 0x39, 0x42, 0x2f, 0x72, 0x66, 0x4e, + 0x6d, 0x57, 0x56, 0x61, 0x6e, 0x2f, 0x37, 0x49, 0x72, 0x35, 0x6d, 0x55, + 0x66, 0x2f, 0x4e, 0x56, 0x6f, 0x43, 0x71, 0x67, 0x54, 0x4c, 0x69, 0x6c, + 0x75, 0x48, 0x63, 0x53, 0x6d, 0x52, 0x76, 0x61, 0x53, 0x30, 0x65, 0x67, + 0x32, 0x39, 0x6d, 0x76, 0x56, 0x58, 0x49, 0x77, 0x41, 0x48, 0x49, 0x52, + 0x63, 0x2f, 0x0a, 0x53, 0x6a, 0x6e, 0x52, 0x42, 0x55, 0x6b, 0x4c, 0x70, + 0x37, 0x59, 0x33, 0x67, 0x61, 0x56, 0x64, 0x6a, 0x4b, 0x6f, 0x7a, 0x58, + 0x6f, 0x45, 0x6f, 0x66, 0x4b, 0x64, 0x39, 0x4a, 0x2b, 0x73, 0x41, 0x72, + 0x6f, 0x30, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x43, 0x2d, 0x41, + 0x43, 0x43, 0x20, 0x4f, 0x3d, 0x41, 0x67, 0x65, 0x6e, 0x63, 0x69, 0x61, + 0x20, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x61, 0x6e, 0x61, 0x20, 0x64, 0x65, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x63, 0x69, + 0x6f, 0x20, 0x28, 0x4e, 0x49, 0x46, 0x20, 0x51, 0x2d, 0x30, 0x38, 0x30, + 0x31, 0x31, 0x37, 0x36, 0x2d, 0x49, 0x29, 0x20, 0x4f, 0x55, 0x3d, 0x53, + 0x65, 0x72, 0x76, 0x65, 0x69, 0x73, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, + 0x63, 0x73, 0x20, 0x64, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x63, 0x69, 0x6f, 0x2f, 0x56, 0x65, 0x67, 0x65, 0x75, + 0x20, 0x68, 0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, + 0x2e, 0x63, 0x61, 0x74, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x6e, 0x65, 0x74, + 0x2f, 0x76, 0x65, 0x72, 0x61, 0x72, 0x72, 0x65, 0x6c, 0x20, 0x28, 0x63, + 0x29, 0x30, 0x33, 0x2f, 0x4a, 0x65, 0x72, 0x61, 0x72, 0x71, 0x75, 0x69, + 0x61, 0x20, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x61, 0x74, 0x73, 0x20, 0x64, + 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x63, + 0x69, 0x6f, 0x20, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x61, 0x6e, 0x65, 0x73, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x45, 0x43, 0x2d, 0x41, 0x43, 0x43, 0x20, 0x4f, 0x3d, + 0x41, 0x67, 0x65, 0x6e, 0x63, 0x69, 0x61, 0x20, 0x43, 0x61, 0x74, 0x61, + 0x6c, 0x61, 0x6e, 0x61, 0x20, 0x64, 0x65, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x63, 0x69, 0x6f, 0x20, 0x28, 0x4e, 0x49, + 0x46, 0x20, 0x51, 0x2d, 0x30, 0x38, 0x30, 0x31, 0x31, 0x37, 0x36, 0x2d, + 0x49, 0x29, 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x72, 0x76, 0x65, 0x69, + 0x73, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x73, 0x20, 0x64, 0x65, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x63, 0x69, + 0x6f, 0x2f, 0x56, 0x65, 0x67, 0x65, 0x75, 0x20, 0x68, 0x74, 0x74, 0x70, + 0x73, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x61, 0x74, 0x63, + 0x65, 0x72, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x76, 0x65, 0x72, 0x61, + 0x72, 0x72, 0x65, 0x6c, 0x20, 0x28, 0x63, 0x29, 0x30, 0x33, 0x2f, 0x4a, + 0x65, 0x72, 0x61, 0x72, 0x71, 0x75, 0x69, 0x61, 0x20, 0x45, 0x6e, 0x74, + 0x69, 0x74, 0x61, 0x74, 0x73, 0x20, 0x64, 0x65, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x63, 0x69, 0x6f, 0x20, 0x43, 0x61, + 0x74, 0x61, 0x6c, 0x61, 0x6e, 0x65, 0x73, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x45, 0x43, 0x2d, 0x41, 0x43, 0x43, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x2d, 0x32, 0x33, 0x37, 0x30, 0x31, 0x35, 0x37, 0x39, 0x32, 0x34, 0x37, + 0x39, 0x35, 0x35, 0x37, 0x30, 0x39, 0x31, 0x33, 0x39, 0x36, 0x32, 0x36, + 0x35, 0x35, 0x35, 0x31, 0x32, 0x36, 0x35, 0x32, 0x34, 0x38, 0x32, 0x30, + 0x34, 0x37, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, + 0x62, 0x3a, 0x66, 0x35, 0x3a, 0x39, 0x64, 0x3a, 0x32, 0x39, 0x3a, 0x30, + 0x64, 0x3a, 0x36, 0x31, 0x3a, 0x66, 0x39, 0x3a, 0x34, 0x32, 0x3a, 0x31, + 0x66, 0x3a, 0x37, 0x63, 0x3a, 0x63, 0x32, 0x3a, 0x62, 0x61, 0x3a, 0x36, + 0x64, 0x3a, 0x65, 0x33, 0x3a, 0x31, 0x35, 0x3a, 0x30, 0x39, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x38, 0x3a, 0x39, 0x30, + 0x3a, 0x33, 0x61, 0x3a, 0x36, 0x33, 0x3a, 0x35, 0x62, 0x3a, 0x35, 0x32, + 0x3a, 0x38, 0x30, 0x3a, 0x66, 0x61, 0x3a, 0x65, 0x36, 0x3a, 0x37, 0x37, + 0x3a, 0x34, 0x63, 0x3a, 0x30, 0x62, 0x3a, 0x36, 0x64, 0x3a, 0x61, 0x37, + 0x3a, 0x64, 0x36, 0x3a, 0x62, 0x61, 0x3a, 0x61, 0x36, 0x3a, 0x34, 0x61, + 0x3a, 0x66, 0x32, 0x3a, 0x65, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x38, 0x3a, 0x34, 0x39, 0x3a, 0x37, + 0x66, 0x3a, 0x30, 0x31, 0x3a, 0x36, 0x30, 0x3a, 0x32, 0x66, 0x3a, 0x33, + 0x31, 0x3a, 0x35, 0x34, 0x3a, 0x32, 0x34, 0x3a, 0x36, 0x61, 0x3a, 0x65, + 0x32, 0x3a, 0x38, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x35, 0x61, 0x3a, 0x65, + 0x66, 0x3a, 0x31, 0x30, 0x3a, 0x66, 0x31, 0x3a, 0x64, 0x38, 0x3a, 0x37, + 0x65, 0x3a, 0x62, 0x62, 0x3a, 0x37, 0x36, 0x3a, 0x36, 0x32, 0x3a, 0x36, + 0x66, 0x3a, 0x34, 0x61, 0x3a, 0x65, 0x30, 0x3a, 0x62, 0x37, 0x3a, 0x66, + 0x39, 0x3a, 0x35, 0x62, 0x3a, 0x61, 0x37, 0x3a, 0x39, 0x36, 0x3a, 0x38, + 0x37, 0x3a, 0x39, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x46, 0x56, 0x6a, 0x43, 0x43, 0x42, 0x44, 0x36, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x51, 0x37, 0x69, 0x73, 0x39, 0x36, 0x39, 0x51, + 0x68, 0x33, 0x68, 0x53, 0x6f, 0x59, 0x71, 0x77, 0x45, 0x38, 0x39, 0x33, + 0x45, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x43, + 0x42, 0x0a, 0x38, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x56, 0x4d, 0x78, 0x4f, 0x7a, + 0x41, 0x35, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x4d, 0x6b, + 0x46, 0x6e, 0x5a, 0x57, 0x35, 0x6a, 0x61, 0x57, 0x45, 0x67, 0x51, 0x32, + 0x46, 0x30, 0x59, 0x57, 0x78, 0x68, 0x62, 0x6d, 0x45, 0x67, 0x5a, 0x47, + 0x55, 0x67, 0x51, 0x32, 0x56, 0x79, 0x0a, 0x64, 0x47, 0x6c, 0x6d, 0x61, + 0x57, 0x4e, 0x68, 0x59, 0x32, 0x6c, 0x76, 0x49, 0x43, 0x68, 0x4f, 0x53, + 0x55, 0x59, 0x67, 0x55, 0x53, 0x30, 0x77, 0x4f, 0x44, 0x41, 0x78, 0x4d, + 0x54, 0x63, 0x32, 0x4c, 0x55, 0x6b, 0x70, 0x4d, 0x53, 0x67, 0x77, 0x4a, + 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x39, 0x54, 0x5a, + 0x58, 0x4a, 0x32, 0x5a, 0x57, 0x6c, 0x7a, 0x49, 0x46, 0x42, 0x31, 0x0a, + 0x59, 0x6d, 0x78, 0x70, 0x59, 0x33, 0x4d, 0x67, 0x5a, 0x47, 0x55, 0x67, + 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, + 0x59, 0x32, 0x6c, 0x76, 0x4d, 0x54, 0x55, 0x77, 0x4d, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x79, 0x78, 0x57, 0x5a, 0x57, 0x64, 0x6c, + 0x64, 0x53, 0x42, 0x6f, 0x64, 0x48, 0x52, 0x77, 0x63, 0x7a, 0x6f, 0x76, + 0x4c, 0x33, 0x64, 0x33, 0x0a, 0x64, 0x79, 0x35, 0x6a, 0x59, 0x58, 0x52, + 0x6a, 0x5a, 0x58, 0x4a, 0x30, 0x4c, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x39, + 0x32, 0x5a, 0x58, 0x4a, 0x68, 0x63, 0x6e, 0x4a, 0x6c, 0x62, 0x43, 0x41, + 0x6f, 0x59, 0x79, 0x6b, 0x77, 0x4d, 0x7a, 0x45, 0x31, 0x4d, 0x44, 0x4d, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x73, 0x53, 0x6d, 0x56, + 0x79, 0x59, 0x58, 0x4a, 0x78, 0x64, 0x57, 0x6c, 0x68, 0x0a, 0x49, 0x45, + 0x56, 0x75, 0x64, 0x47, 0x6c, 0x30, 0x59, 0x58, 0x52, 0x7a, 0x49, 0x47, + 0x52, 0x6c, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x57, 0x4e, 0x70, 0x62, 0x79, 0x42, 0x44, 0x59, 0x58, + 0x52, 0x68, 0x62, 0x47, 0x46, 0x75, 0x5a, 0x58, 0x4d, 0x78, 0x44, 0x7a, + 0x41, 0x4e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x42, 0x6b, + 0x56, 0x44, 0x0a, 0x4c, 0x55, 0x46, 0x44, 0x51, 0x7a, 0x41, 0x65, 0x46, + 0x77, 0x30, 0x77, 0x4d, 0x7a, 0x41, 0x78, 0x4d, 0x44, 0x63, 0x79, 0x4d, + 0x7a, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4d, + 0x54, 0x41, 0x78, 0x4d, 0x44, 0x63, 0x79, 0x4d, 0x6a, 0x55, 0x35, 0x4e, + 0x54, 0x6c, 0x61, 0x4d, 0x49, 0x48, 0x7a, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x46, + 0x55, 0x7a, 0x45, 0x37, 0x4d, 0x44, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x68, 0x4d, 0x79, 0x51, 0x57, 0x64, 0x6c, 0x62, 0x6d, 0x4e, 0x70, + 0x59, 0x53, 0x42, 0x44, 0x59, 0x58, 0x52, 0x68, 0x62, 0x47, 0x46, 0x75, + 0x59, 0x53, 0x42, 0x6b, 0x5a, 0x53, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, + 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x6a, 0x61, 0x57, 0x38, 0x67, + 0x0a, 0x4b, 0x45, 0x35, 0x4a, 0x52, 0x69, 0x42, 0x52, 0x4c, 0x54, 0x41, + 0x34, 0x4d, 0x44, 0x45, 0x78, 0x4e, 0x7a, 0x59, 0x74, 0x53, 0x53, 0x6b, + 0x78, 0x4b, 0x44, 0x41, 0x6d, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, + 0x54, 0x48, 0x31, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x6c, 0x61, 0x58, 0x4d, + 0x67, 0x55, 0x48, 0x56, 0x69, 0x62, 0x47, 0x6c, 0x6a, 0x63, 0x79, 0x42, + 0x6b, 0x5a, 0x53, 0x42, 0x44, 0x0a, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, + 0x5a, 0x70, 0x59, 0x32, 0x46, 0x6a, 0x61, 0x57, 0x38, 0x78, 0x4e, 0x54, + 0x41, 0x7a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x4c, 0x46, + 0x5a, 0x6c, 0x5a, 0x32, 0x56, 0x31, 0x49, 0x47, 0x68, 0x30, 0x64, 0x48, + 0x42, 0x7a, 0x4f, 0x69, 0x38, 0x76, 0x64, 0x33, 0x64, 0x33, 0x4c, 0x6d, + 0x4e, 0x68, 0x64, 0x47, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x0a, 0x62, + 0x6d, 0x56, 0x30, 0x4c, 0x33, 0x5a, 0x6c, 0x63, 0x6d, 0x46, 0x79, 0x63, + 0x6d, 0x56, 0x73, 0x49, 0x43, 0x68, 0x6a, 0x4b, 0x54, 0x41, 0x7a, 0x4d, + 0x54, 0x55, 0x77, 0x4d, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, + 0x79, 0x78, 0x4b, 0x5a, 0x58, 0x4a, 0x68, 0x63, 0x6e, 0x46, 0x31, 0x61, + 0x57, 0x45, 0x67, 0x52, 0x57, 0x35, 0x30, 0x61, 0x58, 0x52, 0x68, 0x64, + 0x48, 0x4d, 0x67, 0x0a, 0x5a, 0x47, 0x55, 0x67, 0x51, 0x32, 0x56, 0x79, + 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x59, 0x32, 0x6c, 0x76, + 0x49, 0x45, 0x4e, 0x68, 0x64, 0x47, 0x46, 0x73, 0x59, 0x57, 0x35, 0x6c, + 0x63, 0x7a, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x41, 0x78, 0x4d, 0x47, 0x52, 0x55, 0x4d, 0x74, 0x51, 0x55, 0x4e, 0x44, + 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x0a, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, + 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, + 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x73, 0x79, 0x4c, + 0x48, 0x54, 0x2b, 0x4b, 0x58, 0x51, 0x70, 0x57, 0x49, 0x52, 0x34, 0x4e, + 0x41, 0x39, 0x68, 0x30, 0x58, 0x38, 0x34, 0x4e, 0x7a, 0x4a, 0x42, 0x35, + 0x52, 0x0a, 0x38, 0x35, 0x69, 0x4b, 0x77, 0x35, 0x4b, 0x34, 0x2f, 0x30, + 0x43, 0x51, 0x42, 0x58, 0x43, 0x48, 0x59, 0x4d, 0x6b, 0x41, 0x71, 0x62, + 0x57, 0x55, 0x5a, 0x52, 0x6b, 0x69, 0x46, 0x52, 0x66, 0x43, 0x51, 0x32, + 0x78, 0x6d, 0x52, 0x4a, 0x6f, 0x4e, 0x42, 0x44, 0x34, 0x35, 0x62, 0x36, + 0x56, 0x4c, 0x65, 0x71, 0x70, 0x6a, 0x74, 0x34, 0x70, 0x45, 0x6e, 0x64, + 0x6c, 0x6a, 0x6b, 0x59, 0x52, 0x6d, 0x0a, 0x34, 0x43, 0x67, 0x50, 0x75, + 0x6b, 0x4c, 0x6a, 0x62, 0x6f, 0x37, 0x33, 0x46, 0x43, 0x65, 0x54, 0x61, + 0x65, 0x36, 0x52, 0x44, 0x71, 0x4e, 0x66, 0x44, 0x72, 0x48, 0x72, 0x5a, + 0x71, 0x4a, 0x79, 0x54, 0x78, 0x49, 0x54, 0x68, 0x6d, 0x56, 0x36, 0x50, + 0x74, 0x74, 0x50, 0x42, 0x2f, 0x53, 0x6e, 0x43, 0x57, 0x44, 0x61, 0x4f, + 0x6b, 0x4b, 0x5a, 0x78, 0x37, 0x4a, 0x2f, 0x73, 0x78, 0x61, 0x56, 0x0a, + 0x48, 0x4d, 0x66, 0x35, 0x4e, 0x4c, 0x57, 0x55, 0x68, 0x64, 0x57, 0x5a, + 0x58, 0x71, 0x42, 0x49, 0x6f, 0x48, 0x37, 0x6e, 0x46, 0x32, 0x57, 0x34, + 0x6f, 0x6e, 0x57, 0x34, 0x48, 0x76, 0x50, 0x6c, 0x51, 0x6e, 0x32, 0x76, + 0x37, 0x66, 0x4f, 0x4b, 0x53, 0x47, 0x52, 0x64, 0x67, 0x68, 0x53, 0x54, + 0x32, 0x4d, 0x44, 0x6b, 0x2f, 0x37, 0x4e, 0x51, 0x63, 0x76, 0x4a, 0x32, + 0x39, 0x72, 0x4e, 0x64, 0x0a, 0x51, 0x6c, 0x42, 0x35, 0x30, 0x4a, 0x51, + 0x2b, 0x61, 0x77, 0x77, 0x41, 0x76, 0x74, 0x68, 0x72, 0x44, 0x6b, 0x34, + 0x71, 0x37, 0x44, 0x37, 0x53, 0x7a, 0x49, 0x4b, 0x69, 0x47, 0x47, 0x55, + 0x7a, 0x45, 0x33, 0x65, 0x65, 0x6d, 0x6c, 0x30, 0x61, 0x45, 0x39, 0x6a, + 0x44, 0x32, 0x7a, 0x33, 0x49, 0x6c, 0x33, 0x72, 0x75, 0x63, 0x4f, 0x32, + 0x6e, 0x35, 0x6e, 0x7a, 0x62, 0x63, 0x63, 0x38, 0x74, 0x0a, 0x6c, 0x47, + 0x4c, 0x66, 0x62, 0x64, 0x62, 0x31, 0x4f, 0x4c, 0x34, 0x2f, 0x70, 0x59, + 0x55, 0x4b, 0x47, 0x62, 0x69, 0x6f, 0x32, 0x41, 0x6c, 0x31, 0x51, 0x6e, + 0x44, 0x45, 0x36, 0x75, 0x2f, 0x4c, 0x44, 0x73, 0x67, 0x30, 0x71, 0x42, + 0x49, 0x69, 0x6d, 0x41, 0x79, 0x34, 0x45, 0x35, 0x53, 0x32, 0x53, 0x2b, + 0x7a, 0x77, 0x30, 0x4a, 0x44, 0x6e, 0x4a, 0x77, 0x49, 0x44, 0x41, 0x51, + 0x41, 0x42, 0x0a, 0x6f, 0x34, 0x48, 0x6a, 0x4d, 0x49, 0x48, 0x67, 0x4d, + 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x51, 0x51, 0x57, 0x4d, + 0x42, 0x53, 0x42, 0x45, 0x6d, 0x56, 0x6a, 0x58, 0x32, 0x46, 0x6a, 0x59, + 0x30, 0x42, 0x6a, 0x59, 0x58, 0x52, 0x6a, 0x5a, 0x58, 0x4a, 0x30, 0x4c, + 0x6d, 0x35, 0x6c, 0x64, 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x0a, 0x42, 0x54, 0x41, 0x44, + 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, + 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, + 0x46, 0x67, 0x51, 0x55, 0x6f, 0x4d, 0x4f, 0x4c, 0x52, 0x4b, 0x6f, 0x33, + 0x70, 0x55, 0x57, 0x2f, 0x6c, 0x34, 0x42, 0x61, 0x30, 0x66, 0x46, 0x34, + 0x0a, 0x6f, 0x70, 0x76, 0x70, 0x58, 0x59, 0x30, 0x77, 0x66, 0x77, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x67, 0x42, 0x48, 0x67, 0x77, 0x64, 0x6a, 0x42, + 0x30, 0x42, 0x67, 0x73, 0x72, 0x42, 0x67, 0x45, 0x45, 0x41, 0x66, 0x56, + 0x34, 0x41, 0x51, 0x4d, 0x42, 0x43, 0x6a, 0x42, 0x6c, 0x4d, 0x43, 0x77, + 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x49, + 0x42, 0x46, 0x69, 0x42, 0x6f, 0x0a, 0x64, 0x48, 0x52, 0x77, 0x63, 0x7a, + 0x6f, 0x76, 0x4c, 0x33, 0x64, 0x33, 0x64, 0x79, 0x35, 0x6a, 0x59, 0x58, + 0x52, 0x6a, 0x5a, 0x58, 0x4a, 0x30, 0x4c, 0x6d, 0x35, 0x6c, 0x64, 0x43, + 0x39, 0x32, 0x5a, 0x58, 0x4a, 0x68, 0x63, 0x6e, 0x4a, 0x6c, 0x62, 0x44, + 0x41, 0x31, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, + 0x63, 0x43, 0x41, 0x6a, 0x41, 0x70, 0x47, 0x69, 0x64, 0x57, 0x0a, 0x5a, + 0x57, 0x64, 0x6c, 0x64, 0x53, 0x42, 0x6f, 0x64, 0x48, 0x52, 0x77, 0x63, + 0x7a, 0x6f, 0x76, 0x4c, 0x33, 0x64, 0x33, 0x64, 0x79, 0x35, 0x6a, 0x59, + 0x58, 0x52, 0x6a, 0x5a, 0x58, 0x4a, 0x30, 0x4c, 0x6d, 0x35, 0x6c, 0x64, + 0x43, 0x39, 0x32, 0x5a, 0x58, 0x4a, 0x68, 0x63, 0x6e, 0x4a, 0x6c, 0x62, + 0x43, 0x41, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x0a, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x4b, 0x42, 0x49, 0x57, 0x34, 0x49, 0x42, + 0x39, 0x6b, 0x31, 0x49, 0x75, 0x44, 0x6c, 0x56, 0x4e, 0x5a, 0x79, 0x41, + 0x65, 0x6c, 0x4f, 0x5a, 0x31, 0x56, 0x72, 0x2f, 0x73, 0x58, 0x45, 0x37, + 0x7a, 0x44, 0x6b, 0x4a, 0x6c, 0x46, 0x37, 0x57, 0x32, 0x75, 0x2b, 0x2b, + 0x41, 0x56, 0x74, 0x64, 0x30, 0x78, 0x37, 0x59, 0x0a, 0x2f, 0x58, 0x31, + 0x50, 0x7a, 0x61, 0x42, 0x42, 0x34, 0x44, 0x53, 0x54, 0x76, 0x38, 0x76, + 0x69, 0x68, 0x70, 0x77, 0x33, 0x6b, 0x70, 0x42, 0x57, 0x48, 0x4e, 0x7a, + 0x72, 0x4b, 0x51, 0x58, 0x6c, 0x78, 0x4a, 0x37, 0x48, 0x4e, 0x64, 0x2b, + 0x4b, 0x44, 0x4d, 0x33, 0x46, 0x49, 0x55, 0x50, 0x70, 0x71, 0x6f, 0x6a, + 0x6c, 0x4e, 0x63, 0x41, 0x5a, 0x51, 0x6d, 0x4e, 0x61, 0x41, 0x6c, 0x36, + 0x6b, 0x0a, 0x53, 0x42, 0x67, 0x36, 0x68, 0x57, 0x2f, 0x63, 0x6e, 0x62, + 0x77, 0x2f, 0x6e, 0x5a, 0x7a, 0x42, 0x68, 0x37, 0x68, 0x36, 0x59, 0x51, + 0x6a, 0x70, 0x64, 0x77, 0x74, 0x2f, 0x63, 0x4b, 0x74, 0x36, 0x33, 0x64, + 0x6d, 0x58, 0x4c, 0x47, 0x51, 0x65, 0x68, 0x62, 0x2b, 0x38, 0x64, 0x4a, + 0x61, 0x68, 0x77, 0x33, 0x6f, 0x53, 0x37, 0x41, 0x77, 0x61, 0x62, 0x6f, + 0x4d, 0x4d, 0x50, 0x4f, 0x68, 0x79, 0x0a, 0x52, 0x70, 0x2f, 0x37, 0x53, + 0x4e, 0x56, 0x65, 0x6c, 0x2b, 0x61, 0x78, 0x6f, 0x66, 0x6a, 0x6b, 0x37, + 0x30, 0x59, 0x6c, 0x6c, 0x4a, 0x79, 0x4a, 0x32, 0x32, 0x6b, 0x34, 0x76, + 0x75, 0x78, 0x63, 0x44, 0x6c, 0x62, 0x48, 0x5a, 0x56, 0x48, 0x6c, 0x55, + 0x49, 0x69, 0x49, 0x76, 0x30, 0x4c, 0x56, 0x4b, 0x7a, 0x33, 0x6c, 0x2b, + 0x62, 0x71, 0x65, 0x4c, 0x72, 0x50, 0x4b, 0x39, 0x48, 0x4f, 0x53, 0x0a, + 0x41, 0x67, 0x75, 0x2b, 0x54, 0x47, 0x62, 0x72, 0x49, 0x50, 0x36, 0x35, + 0x79, 0x37, 0x57, 0x5a, 0x66, 0x2b, 0x61, 0x32, 0x45, 0x2f, 0x72, 0x4b, + 0x53, 0x30, 0x33, 0x5a, 0x37, 0x6c, 0x4e, 0x47, 0x42, 0x6a, 0x76, 0x47, + 0x54, 0x71, 0x32, 0x54, 0x57, 0x6f, 0x46, 0x2b, 0x62, 0x43, 0x70, 0x4c, + 0x61, 0x67, 0x56, 0x46, 0x6a, 0x50, 0x49, 0x68, 0x70, 0x44, 0x47, 0x51, + 0x68, 0x32, 0x78, 0x6c, 0x0a, 0x6e, 0x4a, 0x32, 0x6c, 0x59, 0x4a, 0x55, + 0x36, 0x55, 0x6e, 0x2f, 0x31, 0x30, 0x61, 0x73, 0x49, 0x62, 0x76, 0x50, + 0x75, 0x57, 0x2f, 0x6d, 0x49, 0x50, 0x58, 0x36, 0x34, 0x62, 0x32, 0x34, + 0x44, 0x35, 0x45, 0x49, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, 0x65, + 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, + 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, + 0x20, 0x32, 0x30, 0x31, 0x31, 0x20, 0x4f, 0x3d, 0x48, 0x65, 0x6c, 0x6c, + 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, + 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x2e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, 0x65, + 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, + 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, + 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, + 0x20, 0x32, 0x30, 0x31, 0x31, 0x20, 0x4f, 0x3d, 0x48, 0x65, 0x6c, 0x6c, + 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, + 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x2e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, + 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, + 0x31, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x33, + 0x3a, 0x39, 0x66, 0x3a, 0x34, 0x63, 0x3a, 0x34, 0x62, 0x3a, 0x37, 0x33, + 0x3a, 0x35, 0x62, 0x3a, 0x37, 0x39, 0x3a, 0x65, 0x39, 0x3a, 0x66, 0x61, + 0x3a, 0x62, 0x61, 0x3a, 0x31, 0x63, 0x3a, 0x65, 0x66, 0x3a, 0x36, 0x65, + 0x3a, 0x63, 0x62, 0x3a, 0x64, 0x35, 0x3a, 0x63, 0x39, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x65, 0x3a, 0x34, 0x35, 0x3a, + 0x36, 0x35, 0x3a, 0x39, 0x62, 0x3a, 0x37, 0x39, 0x3a, 0x30, 0x33, 0x3a, + 0x35, 0x62, 0x3a, 0x39, 0x38, 0x3a, 0x61, 0x31, 0x3a, 0x36, 0x31, 0x3a, + 0x62, 0x35, 0x3a, 0x35, 0x31, 0x3a, 0x32, 0x65, 0x3a, 0x61, 0x63, 0x3a, + 0x64, 0x61, 0x3a, 0x35, 0x38, 0x3a, 0x30, 0x39, 0x3a, 0x34, 0x38, 0x3a, + 0x32, 0x32, 0x3a, 0x34, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x63, 0x3a, 0x31, 0x30, 0x3a, 0x34, 0x66, + 0x3a, 0x31, 0x35, 0x3a, 0x61, 0x34, 0x3a, 0x38, 0x62, 0x3a, 0x65, 0x37, + 0x3a, 0x30, 0x39, 0x3a, 0x64, 0x63, 0x3a, 0x61, 0x35, 0x3a, 0x34, 0x32, + 0x3a, 0x61, 0x37, 0x3a, 0x65, 0x31, 0x3a, 0x64, 0x34, 0x3a, 0x62, 0x39, + 0x3a, 0x64, 0x66, 0x3a, 0x36, 0x66, 0x3a, 0x30, 0x35, 0x3a, 0x34, 0x35, + 0x3a, 0x32, 0x37, 0x3a, 0x65, 0x38, 0x3a, 0x30, 0x32, 0x3a, 0x65, 0x61, + 0x3a, 0x61, 0x39, 0x3a, 0x32, 0x64, 0x3a, 0x35, 0x39, 0x3a, 0x35, 0x34, + 0x3a, 0x34, 0x34, 0x3a, 0x32, 0x35, 0x3a, 0x38, 0x61, 0x3a, 0x66, 0x65, + 0x3a, 0x37, 0x31, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, + 0x4d, 0x54, 0x43, 0x43, 0x41, 0x78, 0x6d, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x55, 0x46, + 0x41, 0x44, 0x43, 0x42, 0x6c, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x31, 0x49, 0x78, + 0x0a, 0x52, 0x44, 0x42, 0x43, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x54, 0x4f, 0x30, 0x68, 0x6c, 0x62, 0x47, 0x78, 0x6c, 0x62, 0x6d, 0x6c, + 0x6a, 0x49, 0x45, 0x46, 0x6a, 0x59, 0x57, 0x52, 0x6c, 0x62, 0x57, 0x6c, + 0x6a, 0x49, 0x47, 0x46, 0x75, 0x5a, 0x43, 0x42, 0x53, 0x5a, 0x58, 0x4e, + 0x6c, 0x59, 0x58, 0x4a, 0x6a, 0x61, 0x43, 0x42, 0x4a, 0x62, 0x6e, 0x4e, + 0x30, 0x61, 0x58, 0x52, 0x31, 0x0a, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6e, + 0x4d, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x34, 0x67, 0x51, 0x58, + 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x55, + 0x41, 0x77, 0x50, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x7a, + 0x64, 0x49, 0x5a, 0x57, 0x78, 0x73, 0x5a, 0x57, 0x35, 0x70, 0x59, 0x79, + 0x42, 0x42, 0x59, 0x32, 0x46, 0x6b, 0x5a, 0x57, 0x31, 0x70, 0x0a, 0x59, + 0x79, 0x42, 0x68, 0x62, 0x6d, 0x51, 0x67, 0x55, 0x6d, 0x56, 0x7a, 0x5a, + 0x57, 0x46, 0x79, 0x59, 0x32, 0x67, 0x67, 0x53, 0x57, 0x35, 0x7a, 0x64, + 0x47, 0x6c, 0x30, 0x64, 0x58, 0x52, 0x70, 0x62, 0x32, 0x35, 0x7a, 0x49, + 0x46, 0x4a, 0x76, 0x62, 0x33, 0x52, 0x44, 0x51, 0x53, 0x41, 0x79, 0x4d, + 0x44, 0x45, 0x78, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x78, 0x4d, + 0x54, 0x49, 0x77, 0x0a, 0x4e, 0x6a, 0x45, 0x7a, 0x4e, 0x44, 0x6b, 0x31, + 0x4d, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x78, 0x4d, 0x54, 0x49, 0x77, + 0x4d, 0x54, 0x45, 0x7a, 0x4e, 0x44, 0x6b, 0x31, 0x4d, 0x6c, 0x6f, 0x77, + 0x67, 0x5a, 0x55, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x64, 0x53, 0x4d, 0x55, 0x51, 0x77, + 0x51, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x0a, 0x45, 0x7a, 0x74, + 0x49, 0x5a, 0x57, 0x78, 0x73, 0x5a, 0x57, 0x35, 0x70, 0x59, 0x79, 0x42, + 0x42, 0x59, 0x32, 0x46, 0x6b, 0x5a, 0x57, 0x31, 0x70, 0x59, 0x79, 0x42, + 0x68, 0x62, 0x6d, 0x51, 0x67, 0x55, 0x6d, 0x56, 0x7a, 0x5a, 0x57, 0x46, + 0x79, 0x59, 0x32, 0x67, 0x67, 0x53, 0x57, 0x35, 0x7a, 0x64, 0x47, 0x6c, + 0x30, 0x64, 0x58, 0x52, 0x70, 0x62, 0x32, 0x35, 0x7a, 0x49, 0x45, 0x4e, + 0x6c, 0x0a, 0x63, 0x6e, 0x51, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, + 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x46, 0x41, 0x4d, 0x44, + 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x33, 0x53, 0x47, + 0x56, 0x73, 0x62, 0x47, 0x56, 0x75, 0x61, 0x57, 0x4d, 0x67, 0x51, 0x57, + 0x4e, 0x68, 0x5a, 0x47, 0x56, 0x74, 0x61, 0x57, 0x4d, 0x67, 0x59, 0x57, + 0x35, 0x6b, 0x49, 0x46, 0x4a, 0x6c, 0x0a, 0x63, 0x32, 0x56, 0x68, 0x63, + 0x6d, 0x4e, 0x6f, 0x49, 0x45, 0x6c, 0x75, 0x63, 0x33, 0x52, 0x70, 0x64, + 0x48, 0x56, 0x30, 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x53, 0x62, + 0x32, 0x39, 0x30, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x6a, 0x41, 0x78, 0x4d, + 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x0a, + 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, + 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4b, 0x6c, 0x54, + 0x41, 0x4f, 0x4d, 0x75, 0x70, 0x76, 0x61, 0x4f, 0x2b, 0x6d, 0x44, 0x59, + 0x4c, 0x5a, 0x55, 0x2b, 0x2b, 0x43, 0x77, 0x71, 0x56, 0x45, 0x37, 0x4e, + 0x75, 0x59, 0x52, 0x68, 0x6c, 0x46, 0x68, 0x50, 0x6a, 0x7a, 0x32, 0x4c, + 0x35, 0x45, 0x50, 0x7a, 0x0a, 0x64, 0x59, 0x6d, 0x4e, 0x55, 0x65, 0x54, + 0x44, 0x4e, 0x39, 0x4b, 0x4b, 0x69, 0x45, 0x31, 0x35, 0x48, 0x72, 0x63, + 0x53, 0x33, 0x55, 0x4e, 0x34, 0x53, 0x6f, 0x71, 0x53, 0x35, 0x74, 0x64, + 0x49, 0x31, 0x51, 0x2b, 0x6b, 0x4f, 0x69, 0x6c, 0x45, 0x4e, 0x62, 0x67, + 0x48, 0x39, 0x6d, 0x67, 0x64, 0x56, 0x63, 0x30, 0x34, 0x55, 0x66, 0x43, + 0x4d, 0x4a, 0x44, 0x47, 0x46, 0x72, 0x34, 0x50, 0x4a, 0x0a, 0x66, 0x65, + 0x6c, 0x33, 0x72, 0x2b, 0x30, 0x61, 0x65, 0x35, 0x30, 0x58, 0x2b, 0x62, + 0x4f, 0x64, 0x4f, 0x46, 0x41, 0x50, 0x70, 0x6c, 0x70, 0x35, 0x6b, 0x59, + 0x43, 0x76, 0x4e, 0x36, 0x36, 0x6d, 0x30, 0x7a, 0x48, 0x37, 0x74, 0x53, + 0x59, 0x4a, 0x6e, 0x54, 0x78, 0x61, 0x37, 0x31, 0x48, 0x46, 0x4b, 0x39, + 0x2b, 0x57, 0x58, 0x65, 0x73, 0x79, 0x48, 0x67, 0x4c, 0x61, 0x63, 0x45, + 0x6e, 0x73, 0x0a, 0x62, 0x67, 0x7a, 0x49, 0x6d, 0x6a, 0x65, 0x4e, 0x39, + 0x2f, 0x45, 0x32, 0x59, 0x45, 0x73, 0x6d, 0x4c, 0x49, 0x4b, 0x65, 0x30, + 0x48, 0x6a, 0x7a, 0x44, 0x51, 0x39, 0x6a, 0x70, 0x46, 0x45, 0x77, 0x34, + 0x66, 0x6b, 0x72, 0x4a, 0x78, 0x49, 0x48, 0x32, 0x4f, 0x71, 0x39, 0x47, + 0x47, 0x4b, 0x59, 0x73, 0x46, 0x6b, 0x33, 0x66, 0x62, 0x37, 0x75, 0x38, + 0x79, 0x42, 0x52, 0x51, 0x6c, 0x71, 0x44, 0x0a, 0x37, 0x35, 0x4f, 0x36, + 0x61, 0x52, 0x58, 0x78, 0x59, 0x70, 0x32, 0x66, 0x6d, 0x54, 0x6d, 0x43, + 0x6f, 0x62, 0x64, 0x30, 0x4c, 0x6f, 0x76, 0x55, 0x78, 0x51, 0x74, 0x37, + 0x4c, 0x2f, 0x44, 0x49, 0x43, 0x74, 0x6f, 0x39, 0x65, 0x51, 0x71, 0x61, + 0x6b, 0x78, 0x79, 0x6c, 0x4b, 0x48, 0x4a, 0x7a, 0x6b, 0x55, 0x4f, 0x61, + 0x70, 0x39, 0x46, 0x4e, 0x68, 0x59, 0x53, 0x35, 0x71, 0x58, 0x53, 0x50, + 0x0a, 0x46, 0x45, 0x44, 0x48, 0x33, 0x4e, 0x36, 0x73, 0x51, 0x57, 0x52, + 0x73, 0x74, 0x42, 0x6d, 0x62, 0x41, 0x6d, 0x4e, 0x74, 0x4a, 0x47, 0x53, + 0x50, 0x52, 0x4c, 0x49, 0x6c, 0x36, 0x73, 0x35, 0x64, 0x64, 0x41, 0x78, + 0x6a, 0x4d, 0x6c, 0x79, 0x4e, 0x68, 0x2b, 0x55, 0x43, 0x41, 0x77, 0x45, + 0x41, 0x41, 0x61, 0x4f, 0x42, 0x69, 0x54, 0x43, 0x42, 0x68, 0x6a, 0x41, + 0x50, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, + 0x73, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x51, 0x45, 0x41, 0x77, + 0x49, 0x42, 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x70, 0x70, 0x46, 0x43, 0x2f, 0x52, + 0x4e, 0x68, 0x53, 0x69, 0x4f, 0x65, 0x43, 0x4b, 0x51, 0x70, 0x0a, 0x35, + 0x64, 0x67, 0x54, 0x42, 0x43, 0x50, 0x75, 0x51, 0x53, 0x55, 0x77, 0x52, + 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x65, 0x42, 0x45, 0x41, 0x77, 0x50, + 0x71, 0x41, 0x38, 0x4d, 0x41, 0x57, 0x43, 0x41, 0x79, 0x35, 0x6e, 0x63, + 0x6a, 0x41, 0x46, 0x67, 0x67, 0x4d, 0x75, 0x5a, 0x58, 0x55, 0x77, 0x42, + 0x6f, 0x49, 0x45, 0x4c, 0x6d, 0x56, 0x6b, 0x64, 0x54, 0x41, 0x47, 0x67, + 0x67, 0x51, 0x75, 0x0a, 0x62, 0x33, 0x4a, 0x6e, 0x4d, 0x41, 0x57, 0x42, + 0x41, 0x79, 0x35, 0x6e, 0x63, 0x6a, 0x41, 0x46, 0x67, 0x51, 0x4d, 0x75, + 0x5a, 0x58, 0x55, 0x77, 0x42, 0x6f, 0x45, 0x45, 0x4c, 0x6d, 0x56, 0x6b, + 0x64, 0x54, 0x41, 0x47, 0x67, 0x51, 0x51, 0x75, 0x62, 0x33, 0x4a, 0x6e, + 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, + 0x44, 0x51, 0x45, 0x42, 0x42, 0x51, 0x55, 0x41, 0x0a, 0x41, 0x34, 0x49, + 0x42, 0x41, 0x51, 0x41, 0x66, 0x37, 0x33, 0x6c, 0x42, 0x34, 0x58, 0x74, + 0x75, 0x50, 0x37, 0x4b, 0x4d, 0x68, 0x6a, 0x64, 0x43, 0x53, 0x6b, 0x34, + 0x63, 0x4e, 0x78, 0x36, 0x4e, 0x5a, 0x72, 0x6f, 0x6b, 0x67, 0x63, 0x6c, + 0x50, 0x45, 0x67, 0x38, 0x68, 0x77, 0x41, 0x4f, 0x58, 0x68, 0x69, 0x56, + 0x74, 0x58, 0x64, 0x4d, 0x69, 0x4b, 0x61, 0x68, 0x73, 0x6f, 0x67, 0x32, + 0x70, 0x0a, 0x36, 0x7a, 0x30, 0x47, 0x57, 0x35, 0x6b, 0x36, 0x78, 0x38, + 0x7a, 0x44, 0x6d, 0x6a, 0x52, 0x2f, 0x71, 0x77, 0x37, 0x49, 0x54, 0x68, + 0x7a, 0x68, 0x2b, 0x75, 0x54, 0x63, 0x7a, 0x51, 0x32, 0x2b, 0x76, 0x79, + 0x54, 0x2b, 0x62, 0x4f, 0x64, 0x72, 0x77, 0x67, 0x33, 0x49, 0x42, 0x70, + 0x35, 0x4f, 0x6a, 0x57, 0x45, 0x6f, 0x70, 0x6d, 0x72, 0x39, 0x35, 0x66, + 0x5a, 0x69, 0x36, 0x68, 0x67, 0x38, 0x0a, 0x54, 0x71, 0x42, 0x54, 0x6e, + 0x62, 0x49, 0x36, 0x6e, 0x4f, 0x75, 0x6c, 0x6e, 0x4a, 0x45, 0x57, 0x74, + 0x6b, 0x32, 0x43, 0x34, 0x41, 0x77, 0x46, 0x53, 0x4b, 0x6c, 0x73, 0x39, + 0x63, 0x7a, 0x34, 0x79, 0x35, 0x31, 0x4a, 0x74, 0x50, 0x41, 0x43, 0x70, + 0x66, 0x31, 0x77, 0x41, 0x2b, 0x32, 0x4b, 0x49, 0x61, 0x57, 0x75, 0x45, + 0x34, 0x5a, 0x4a, 0x77, 0x7a, 0x4e, 0x7a, 0x76, 0x6f, 0x63, 0x37, 0x0a, + 0x64, 0x49, 0x73, 0x58, 0x52, 0x53, 0x5a, 0x4d, 0x46, 0x70, 0x47, 0x44, + 0x2f, 0x6d, 0x64, 0x39, 0x7a, 0x55, 0x31, 0x6a, 0x5a, 0x2f, 0x72, 0x7a, + 0x41, 0x78, 0x4b, 0x57, 0x65, 0x41, 0x61, 0x4e, 0x73, 0x57, 0x66, 0x74, + 0x6a, 0x6a, 0x2b, 0x2b, 0x6e, 0x30, 0x38, 0x43, 0x39, 0x62, 0x4d, 0x4a, + 0x4c, 0x2f, 0x4e, 0x4d, 0x68, 0x39, 0x38, 0x71, 0x79, 0x35, 0x56, 0x38, + 0x41, 0x63, 0x79, 0x73, 0x0a, 0x4e, 0x6e, 0x71, 0x2f, 0x6f, 0x6e, 0x4e, + 0x36, 0x39, 0x34, 0x2f, 0x42, 0x74, 0x5a, 0x71, 0x68, 0x46, 0x4c, 0x4b, + 0x50, 0x4d, 0x35, 0x38, 0x4e, 0x37, 0x79, 0x4c, 0x63, 0x5a, 0x6e, 0x75, + 0x45, 0x76, 0x55, 0x55, 0x58, 0x42, 0x6a, 0x30, 0x38, 0x79, 0x72, 0x6c, + 0x33, 0x4e, 0x49, 0x2f, 0x4b, 0x36, 0x73, 0x38, 0x2f, 0x4d, 0x54, 0x37, + 0x6a, 0x69, 0x4f, 0x4f, 0x41, 0x53, 0x53, 0x58, 0x49, 0x0a, 0x6c, 0x37, + 0x57, 0x64, 0x6d, 0x70, 0x6c, 0x4e, 0x73, 0x44, 0x7a, 0x34, 0x53, 0x67, + 0x43, 0x62, 0x5a, 0x4e, 0x32, 0x66, 0x4f, 0x55, 0x76, 0x52, 0x4a, 0x39, + 0x65, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x63, 0x74, 0x61, 0x6c, + 0x69, 0x73, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x4f, 0x3d, 0x41, 0x63, 0x74, 0x61, 0x6c, 0x69, 0x73, 0x20, + 0x53, 0x2e, 0x70, 0x2e, 0x41, 0x2e, 0x2f, 0x30, 0x33, 0x33, 0x35, 0x38, + 0x35, 0x32, 0x30, 0x39, 0x36, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x63, 0x74, + 0x61, 0x6c, 0x69, 0x73, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x41, 0x63, 0x74, 0x61, 0x6c, 0x69, + 0x73, 0x20, 0x53, 0x2e, 0x70, 0x2e, 0x41, 0x2e, 0x2f, 0x30, 0x33, 0x33, + 0x35, 0x38, 0x35, 0x32, 0x30, 0x39, 0x36, 0x37, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x63, 0x74, 0x61, 0x6c, + 0x69, 0x73, 0x20, 0x41, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x36, 0x32, 0x37, 0x31, 0x38, 0x34, 0x34, 0x37, 0x37, 0x32, 0x34, + 0x32, 0x34, 0x37, 0x37, 0x30, 0x35, 0x30, 0x38, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x39, 0x3a, 0x63, 0x31, 0x3a, 0x30, 0x64, + 0x3a, 0x34, 0x66, 0x3a, 0x30, 0x37, 0x3a, 0x61, 0x33, 0x3a, 0x31, 0x62, + 0x3a, 0x63, 0x33, 0x3a, 0x66, 0x65, 0x3a, 0x35, 0x36, 0x3a, 0x33, 0x64, + 0x3a, 0x30, 0x34, 0x3a, 0x62, 0x63, 0x3a, 0x31, 0x31, 0x3a, 0x66, 0x36, + 0x3a, 0x61, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x66, 0x33, 0x3a, 0x37, 0x33, 0x3a, 0x62, 0x33, 0x3a, 0x38, 0x37, 0x3a, + 0x30, 0x36, 0x3a, 0x35, 0x61, 0x3a, 0x32, 0x38, 0x3a, 0x38, 0x34, 0x3a, + 0x38, 0x61, 0x3a, 0x66, 0x32, 0x3a, 0x66, 0x33, 0x3a, 0x34, 0x61, 0x3a, + 0x63, 0x65, 0x3a, 0x31, 0x39, 0x3a, 0x32, 0x62, 0x3a, 0x64, 0x64, 0x3a, + 0x63, 0x37, 0x3a, 0x38, 0x65, 0x3a, 0x39, 0x63, 0x3a, 0x61, 0x63, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x35, + 0x3a, 0x39, 0x32, 0x3a, 0x36, 0x30, 0x3a, 0x38, 0x34, 0x3a, 0x65, 0x63, + 0x3a, 0x39, 0x36, 0x3a, 0x33, 0x61, 0x3a, 0x36, 0x34, 0x3a, 0x62, 0x39, + 0x3a, 0x36, 0x65, 0x3a, 0x32, 0x61, 0x3a, 0x62, 0x65, 0x3a, 0x30, 0x31, + 0x3a, 0x63, 0x65, 0x3a, 0x30, 0x62, 0x3a, 0x61, 0x38, 0x3a, 0x36, 0x61, + 0x3a, 0x36, 0x34, 0x3a, 0x66, 0x62, 0x3a, 0x66, 0x65, 0x3a, 0x62, 0x63, + 0x3a, 0x63, 0x37, 0x3a, 0x61, 0x61, 0x3a, 0x62, 0x35, 0x3a, 0x61, 0x66, + 0x3a, 0x63, 0x31, 0x3a, 0x35, 0x35, 0x3a, 0x62, 0x33, 0x3a, 0x37, 0x66, + 0x3a, 0x64, 0x37, 0x3a, 0x36, 0x30, 0x3a, 0x36, 0x36, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x75, 0x7a, 0x43, 0x43, 0x41, 0x36, + 0x4f, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x56, 0x77, + 0x6f, 0x52, 0x6c, 0x30, 0x4c, 0x45, 0x34, 0x38, 0x77, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x61, 0x7a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x53, + 0x56, 0x51, 0x78, 0x44, 0x6a, 0x41, 0x4d, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x63, 0x4d, 0x42, 0x55, 0x31, 0x70, 0x62, 0x47, 0x46, 0x75, 0x4d, + 0x53, 0x4d, 0x77, 0x49, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, + 0x42, 0x70, 0x42, 0x59, 0x33, 0x52, 0x68, 0x62, 0x47, 0x6c, 0x7a, 0x49, + 0x46, 0x4d, 0x75, 0x63, 0x43, 0x35, 0x42, 0x4c, 0x69, 0x38, 0x77, 0x0a, + 0x4d, 0x7a, 0x4d, 0x31, 0x4f, 0x44, 0x55, 0x79, 0x4d, 0x44, 0x6b, 0x32, + 0x4e, 0x7a, 0x45, 0x6e, 0x4d, 0x43, 0x55, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x41, 0x77, 0x77, 0x65, 0x51, 0x57, 0x4e, 0x30, 0x59, 0x57, 0x78, 0x70, + 0x63, 0x79, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x5a, 0x57, 0x35, 0x30, + 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x53, + 0x62, 0x32, 0x39, 0x30, 0x0a, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, 0x34, + 0x58, 0x44, 0x54, 0x45, 0x78, 0x4d, 0x44, 0x6b, 0x79, 0x4d, 0x6a, 0x45, + 0x78, 0x4d, 0x6a, 0x49, 0x77, 0x4d, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x4d, + 0x77, 0x4d, 0x44, 0x6b, 0x79, 0x4d, 0x6a, 0x45, 0x78, 0x4d, 0x6a, 0x49, + 0x77, 0x4d, 0x6c, 0x6f, 0x77, 0x61, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x0a, 0x53, 0x56, + 0x51, 0x78, 0x44, 0x6a, 0x41, 0x4d, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x63, 0x4d, 0x42, 0x55, 0x31, 0x70, 0x62, 0x47, 0x46, 0x75, 0x4d, 0x53, + 0x4d, 0x77, 0x49, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, + 0x70, 0x42, 0x59, 0x33, 0x52, 0x68, 0x62, 0x47, 0x6c, 0x7a, 0x49, 0x46, + 0x4d, 0x75, 0x63, 0x43, 0x35, 0x42, 0x4c, 0x69, 0x38, 0x77, 0x4d, 0x7a, + 0x4d, 0x31, 0x0a, 0x4f, 0x44, 0x55, 0x79, 0x4d, 0x44, 0x6b, 0x32, 0x4e, + 0x7a, 0x45, 0x6e, 0x4d, 0x43, 0x55, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, + 0x77, 0x77, 0x65, 0x51, 0x57, 0x4e, 0x30, 0x59, 0x57, 0x78, 0x70, 0x63, + 0x79, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x5a, 0x57, 0x35, 0x30, 0x61, + 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x53, 0x62, + 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x0a, 0x4d, 0x49, 0x49, 0x43, + 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, + 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, + 0x41, 0x67, 0x45, 0x41, 0x70, 0x38, 0x62, 0x45, 0x70, 0x53, 0x6d, 0x6b, + 0x4c, 0x4f, 0x2f, 0x6c, 0x47, 0x4d, 0x57, 0x77, 0x55, 0x4b, 0x4e, 0x76, + 0x0a, 0x55, 0x54, 0x75, 0x66, 0x43, 0x6c, 0x72, 0x4a, 0x77, 0x6b, 0x67, + 0x34, 0x43, 0x73, 0x49, 0x63, 0x6f, 0x42, 0x68, 0x2f, 0x6b, 0x62, 0x57, + 0x48, 0x75, 0x55, 0x41, 0x2f, 0x33, 0x52, 0x31, 0x6f, 0x48, 0x77, 0x69, + 0x44, 0x31, 0x53, 0x30, 0x65, 0x69, 0x4b, 0x44, 0x34, 0x6a, 0x31, 0x61, + 0x50, 0x62, 0x5a, 0x6b, 0x43, 0x6b, 0x70, 0x41, 0x57, 0x31, 0x56, 0x38, + 0x49, 0x62, 0x49, 0x6e, 0x58, 0x0a, 0x34, 0x61, 0x79, 0x38, 0x49, 0x4d, + 0x4b, 0x78, 0x34, 0x49, 0x4e, 0x52, 0x69, 0x6d, 0x6c, 0x4e, 0x41, 0x4a, + 0x5a, 0x61, 0x62, 0x79, 0x2f, 0x41, 0x52, 0x48, 0x36, 0x6a, 0x44, 0x75, + 0x53, 0x52, 0x7a, 0x56, 0x6a, 0x75, 0x33, 0x50, 0x76, 0x48, 0x48, 0x6b, + 0x56, 0x48, 0x33, 0x53, 0x65, 0x35, 0x43, 0x41, 0x47, 0x66, 0x70, 0x69, + 0x45, 0x64, 0x39, 0x55, 0x45, 0x74, 0x4c, 0x30, 0x7a, 0x39, 0x0a, 0x4b, + 0x4b, 0x33, 0x67, 0x69, 0x71, 0x30, 0x69, 0x74, 0x46, 0x5a, 0x6c, 0x6a, + 0x6f, 0x5a, 0x55, 0x6a, 0x35, 0x4e, 0x44, 0x4b, 0x64, 0x34, 0x35, 0x52, + 0x6e, 0x69, 0x6a, 0x4d, 0x43, 0x4f, 0x36, 0x7a, 0x66, 0x42, 0x39, 0x45, + 0x31, 0x66, 0x41, 0x58, 0x64, 0x4b, 0x44, 0x61, 0x30, 0x68, 0x4d, 0x78, + 0x4b, 0x75, 0x66, 0x67, 0x46, 0x70, 0x62, 0x4f, 0x72, 0x33, 0x4a, 0x70, + 0x79, 0x49, 0x2f, 0x0a, 0x67, 0x43, 0x63, 0x7a, 0x57, 0x77, 0x36, 0x33, + 0x69, 0x67, 0x78, 0x64, 0x42, 0x7a, 0x63, 0x49, 0x79, 0x32, 0x7a, 0x53, + 0x65, 0x6b, 0x63, 0x69, 0x52, 0x44, 0x58, 0x46, 0x7a, 0x4d, 0x77, 0x75, + 0x6a, 0x74, 0x30, 0x71, 0x37, 0x62, 0x64, 0x39, 0x5a, 0x67, 0x31, 0x66, + 0x59, 0x56, 0x45, 0x69, 0x56, 0x52, 0x76, 0x6a, 0x52, 0x75, 0x50, 0x6a, + 0x50, 0x64, 0x41, 0x31, 0x59, 0x70, 0x72, 0x62, 0x0a, 0x72, 0x78, 0x54, + 0x49, 0x57, 0x36, 0x48, 0x4d, 0x69, 0x52, 0x76, 0x68, 0x4d, 0x43, 0x62, + 0x38, 0x6f, 0x4a, 0x73, 0x66, 0x67, 0x61, 0x64, 0x48, 0x48, 0x77, 0x54, + 0x72, 0x6f, 0x7a, 0x6d, 0x53, 0x42, 0x70, 0x2b, 0x5a, 0x30, 0x37, 0x2f, + 0x54, 0x36, 0x6b, 0x39, 0x51, 0x6e, 0x42, 0x6e, 0x2b, 0x6c, 0x6f, 0x63, + 0x65, 0x50, 0x47, 0x58, 0x32, 0x6f, 0x78, 0x67, 0x6b, 0x67, 0x34, 0x59, + 0x51, 0x0a, 0x35, 0x31, 0x51, 0x2b, 0x71, 0x44, 0x70, 0x32, 0x4a, 0x45, + 0x2b, 0x42, 0x49, 0x63, 0x58, 0x6a, 0x44, 0x77, 0x4c, 0x34, 0x6b, 0x35, + 0x52, 0x48, 0x49, 0x4c, 0x76, 0x2b, 0x31, 0x41, 0x37, 0x54, 0x61, 0x4c, + 0x6e, 0x64, 0x78, 0x48, 0x71, 0x45, 0x67, 0x75, 0x4e, 0x54, 0x56, 0x48, + 0x6e, 0x64, 0x32, 0x35, 0x7a, 0x53, 0x38, 0x67, 0x65, 0x62, 0x4c, 0x72, + 0x61, 0x38, 0x50, 0x75, 0x32, 0x46, 0x0a, 0x62, 0x65, 0x38, 0x6c, 0x45, + 0x66, 0x4b, 0x58, 0x47, 0x6b, 0x4a, 0x68, 0x39, 0x30, 0x71, 0x58, 0x36, + 0x49, 0x75, 0x78, 0x45, 0x41, 0x66, 0x36, 0x5a, 0x59, 0x47, 0x79, 0x6f, + 0x6a, 0x6e, 0x50, 0x39, 0x7a, 0x7a, 0x2f, 0x47, 0x50, 0x76, 0x47, 0x38, + 0x56, 0x71, 0x4c, 0x57, 0x65, 0x49, 0x43, 0x72, 0x48, 0x75, 0x53, 0x30, + 0x45, 0x34, 0x55, 0x54, 0x31, 0x6c, 0x46, 0x39, 0x67, 0x78, 0x65, 0x0a, + 0x4b, 0x46, 0x2b, 0x77, 0x36, 0x44, 0x39, 0x46, 0x7a, 0x38, 0x2b, 0x76, + 0x6d, 0x32, 0x2f, 0x37, 0x68, 0x4e, 0x4e, 0x33, 0x57, 0x70, 0x56, 0x76, + 0x72, 0x4a, 0x53, 0x45, 0x6e, 0x75, 0x36, 0x38, 0x77, 0x45, 0x71, 0x50, + 0x53, 0x70, 0x50, 0x34, 0x52, 0x43, 0x48, 0x69, 0x4d, 0x55, 0x56, 0x68, + 0x55, 0x45, 0x34, 0x51, 0x32, 0x4f, 0x4d, 0x31, 0x66, 0x45, 0x77, 0x5a, + 0x74, 0x4e, 0x34, 0x46, 0x0a, 0x76, 0x36, 0x4d, 0x47, 0x6e, 0x38, 0x69, + 0x31, 0x7a, 0x65, 0x51, 0x66, 0x31, 0x78, 0x63, 0x47, 0x44, 0x58, 0x71, + 0x56, 0x64, 0x46, 0x55, 0x4e, 0x61, 0x42, 0x72, 0x38, 0x45, 0x42, 0x74, + 0x69, 0x5a, 0x4a, 0x31, 0x74, 0x34, 0x4a, 0x57, 0x67, 0x77, 0x35, 0x51, + 0x48, 0x56, 0x77, 0x30, 0x55, 0x35, 0x72, 0x30, 0x46, 0x2b, 0x37, 0x69, + 0x66, 0x35, 0x74, 0x2b, 0x4c, 0x34, 0x73, 0x62, 0x6e, 0x0a, 0x66, 0x70, + 0x62, 0x32, 0x55, 0x38, 0x57, 0x41, 0x4e, 0x46, 0x41, 0x6f, 0x57, 0x50, + 0x41, 0x53, 0x55, 0x48, 0x45, 0x58, 0x4d, 0x4c, 0x72, 0x6d, 0x65, 0x47, + 0x4f, 0x38, 0x39, 0x4c, 0x4b, 0x74, 0x6d, 0x79, 0x75, 0x79, 0x2f, 0x75, + 0x45, 0x35, 0x6a, 0x46, 0x36, 0x36, 0x43, 0x79, 0x43, 0x55, 0x33, 0x6e, + 0x75, 0x44, 0x75, 0x50, 0x2f, 0x6a, 0x56, 0x6f, 0x32, 0x33, 0x45, 0x65, + 0x6b, 0x37, 0x0a, 0x6a, 0x50, 0x4b, 0x78, 0x77, 0x56, 0x32, 0x64, 0x70, + 0x41, 0x74, 0x4d, 0x4b, 0x39, 0x6d, 0x79, 0x47, 0x50, 0x57, 0x31, 0x6e, + 0x30, 0x73, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x6a, 0x4d, + 0x47, 0x45, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, + 0x42, 0x59, 0x45, 0x46, 0x46, 0x4c, 0x59, 0x69, 0x44, 0x72, 0x49, 0x6e, + 0x33, 0x68, 0x6d, 0x37, 0x59, 0x6e, 0x7a, 0x0a, 0x65, 0x7a, 0x68, 0x77, + 0x6c, 0x4d, 0x6b, 0x43, 0x41, 0x6a, 0x62, 0x51, 0x4d, 0x41, 0x38, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, + 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f, 0x41, 0x55, + 0x55, 0x74, 0x69, 0x49, 0x4f, 0x73, 0x69, 0x66, 0x65, 0x47, 0x62, 0x74, + 0x0a, 0x69, 0x66, 0x4e, 0x37, 0x4f, 0x48, 0x43, 0x55, 0x79, 0x51, 0x49, + 0x43, 0x4e, 0x74, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, + 0x47, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, + 0x43, 0x41, 0x51, 0x41, 0x4c, 0x0a, 0x65, 0x33, 0x4b, 0x48, 0x77, 0x47, + 0x43, 0x6d, 0x53, 0x55, 0x79, 0x49, 0x57, 0x4f, 0x59, 0x64, 0x69, 0x50, + 0x63, 0x55, 0x5a, 0x45, 0x69, 0x6d, 0x32, 0x46, 0x67, 0x4b, 0x44, 0x6b, + 0x38, 0x54, 0x4e, 0x64, 0x38, 0x31, 0x48, 0x64, 0x54, 0x74, 0x42, 0x6a, + 0x48, 0x49, 0x67, 0x54, 0x35, 0x71, 0x31, 0x64, 0x30, 0x37, 0x47, 0x6a, + 0x4c, 0x75, 0x6b, 0x44, 0x30, 0x52, 0x30, 0x69, 0x37, 0x30, 0x0a, 0x6a, + 0x73, 0x4e, 0x6a, 0x4c, 0x69, 0x4e, 0x6d, 0x73, 0x47, 0x65, 0x2b, 0x62, + 0x37, 0x62, 0x41, 0x45, 0x7a, 0x6c, 0x67, 0x71, 0x71, 0x49, 0x30, 0x4a, + 0x5a, 0x4e, 0x31, 0x55, 0x74, 0x36, 0x6e, 0x6e, 0x61, 0x30, 0x4f, 0x68, + 0x34, 0x6c, 0x53, 0x63, 0x57, 0x6f, 0x57, 0x50, 0x42, 0x6b, 0x64, 0x67, + 0x2f, 0x69, 0x61, 0x4b, 0x57, 0x57, 0x2b, 0x39, 0x44, 0x2b, 0x61, 0x32, + 0x66, 0x44, 0x7a, 0x0a, 0x57, 0x6f, 0x63, 0x68, 0x63, 0x59, 0x42, 0x4e, + 0x79, 0x2b, 0x41, 0x34, 0x6d, 0x7a, 0x2b, 0x37, 0x2b, 0x75, 0x41, 0x77, + 0x54, 0x63, 0x2b, 0x47, 0x30, 0x32, 0x55, 0x51, 0x47, 0x52, 0x6a, 0x52, + 0x6c, 0x77, 0x4b, 0x78, 0x4b, 0x33, 0x4a, 0x43, 0x61, 0x4b, 0x79, 0x67, + 0x76, 0x55, 0x35, 0x61, 0x32, 0x68, 0x69, 0x2f, 0x61, 0x35, 0x69, 0x42, + 0x30, 0x50, 0x32, 0x61, 0x76, 0x6c, 0x34, 0x56, 0x0a, 0x53, 0x4d, 0x30, + 0x52, 0x46, 0x62, 0x6e, 0x41, 0x4b, 0x56, 0x79, 0x30, 0x36, 0x49, 0x6a, + 0x33, 0x50, 0x6a, 0x61, 0x75, 0x74, 0x32, 0x4c, 0x39, 0x48, 0x6d, 0x4c, + 0x65, 0x63, 0x48, 0x67, 0x51, 0x48, 0x45, 0x68, 0x62, 0x32, 0x72, 0x79, + 0x6b, 0x4f, 0x4c, 0x70, 0x6e, 0x37, 0x56, 0x55, 0x2b, 0x58, 0x6c, 0x66, + 0x66, 0x31, 0x41, 0x4e, 0x41, 0x54, 0x49, 0x47, 0x6b, 0x30, 0x6b, 0x39, + 0x6a, 0x0a, 0x70, 0x77, 0x6c, 0x43, 0x43, 0x52, 0x54, 0x38, 0x41, 0x4b, + 0x6e, 0x43, 0x67, 0x48, 0x4e, 0x50, 0x4c, 0x73, 0x42, 0x41, 0x32, 0x52, + 0x46, 0x37, 0x53, 0x4f, 0x70, 0x36, 0x41, 0x73, 0x44, 0x54, 0x36, 0x79, + 0x67, 0x42, 0x4a, 0x6c, 0x68, 0x30, 0x77, 0x63, 0x42, 0x7a, 0x49, 0x6d, + 0x32, 0x54, 0x6c, 0x66, 0x30, 0x35, 0x66, 0x62, 0x73, 0x71, 0x34, 0x2f, + 0x61, 0x43, 0x34, 0x79, 0x79, 0x58, 0x0a, 0x58, 0x30, 0x34, 0x66, 0x6b, + 0x5a, 0x54, 0x36, 0x2f, 0x69, 0x79, 0x6a, 0x32, 0x48, 0x59, 0x61, 0x75, + 0x45, 0x32, 0x79, 0x4f, 0x45, 0x2b, 0x62, 0x2b, 0x68, 0x31, 0x49, 0x59, + 0x48, 0x6b, 0x6d, 0x34, 0x76, 0x50, 0x39, 0x71, 0x64, 0x43, 0x61, 0x36, + 0x48, 0x43, 0x50, 0x53, 0x58, 0x72, 0x57, 0x35, 0x62, 0x30, 0x4b, 0x44, + 0x74, 0x73, 0x74, 0x38, 0x34, 0x32, 0x2f, 0x36, 0x2b, 0x4f, 0x6b, 0x0a, + 0x66, 0x63, 0x76, 0x48, 0x6c, 0x58, 0x48, 0x6f, 0x32, 0x71, 0x4e, 0x38, + 0x78, 0x63, 0x4c, 0x34, 0x64, 0x4a, 0x49, 0x45, 0x47, 0x34, 0x61, 0x73, + 0x70, 0x43, 0x4a, 0x54, 0x51, 0x4c, 0x61, 0x73, 0x2f, 0x6b, 0x78, 0x32, + 0x7a, 0x2f, 0x75, 0x55, 0x4d, 0x73, 0x41, 0x31, 0x6e, 0x33, 0x59, 0x2f, + 0x62, 0x75, 0x57, 0x51, 0x62, 0x71, 0x43, 0x6d, 0x4a, 0x71, 0x4b, 0x34, + 0x4c, 0x4c, 0x37, 0x52, 0x0a, 0x4b, 0x34, 0x58, 0x39, 0x70, 0x32, 0x6a, + 0x49, 0x75, 0x67, 0x45, 0x72, 0x73, 0x57, 0x78, 0x30, 0x48, 0x62, 0x68, + 0x7a, 0x6c, 0x65, 0x66, 0x75, 0x74, 0x38, 0x63, 0x6c, 0x38, 0x41, 0x42, + 0x4d, 0x41, 0x4c, 0x4a, 0x2b, 0x74, 0x67, 0x75, 0x4c, 0x48, 0x50, 0x50, + 0x41, 0x55, 0x4a, 0x34, 0x6c, 0x75, 0x65, 0x41, 0x49, 0x33, 0x6a, 0x5a, + 0x6d, 0x2f, 0x7a, 0x65, 0x6c, 0x30, 0x62, 0x74, 0x55, 0x0a, 0x5a, 0x43, + 0x7a, 0x4a, 0x4a, 0x37, 0x56, 0x4c, 0x6b, 0x6e, 0x35, 0x6c, 0x2f, 0x39, + 0x4d, 0x74, 0x34, 0x62, 0x6c, 0x4f, 0x76, 0x48, 0x2b, 0x6b, 0x51, 0x53, + 0x47, 0x51, 0x51, 0x58, 0x65, 0x6d, 0x4f, 0x52, 0x2f, 0x71, 0x6e, 0x75, + 0x4f, 0x66, 0x30, 0x47, 0x5a, 0x76, 0x42, 0x65, 0x79, 0x71, 0x64, 0x6e, + 0x36, 0x2f, 0x61, 0x78, 0x61, 0x67, 0x36, 0x37, 0x58, 0x48, 0x2f, 0x4a, + 0x4a, 0x55, 0x0a, 0x4c, 0x79, 0x73, 0x52, 0x4a, 0x79, 0x55, 0x33, 0x65, + 0x45, 0x78, 0x52, 0x61, 0x72, 0x44, 0x7a, 0x7a, 0x46, 0x68, 0x64, 0x46, + 0x50, 0x46, 0x71, 0x53, 0x42, 0x58, 0x2f, 0x77, 0x67, 0x65, 0x32, 0x73, + 0x59, 0x30, 0x50, 0x6a, 0x6c, 0x78, 0x51, 0x52, 0x72, 0x4d, 0x39, 0x76, + 0x77, 0x47, 0x59, 0x54, 0x37, 0x4a, 0x5a, 0x56, 0x45, 0x63, 0x2b, 0x4e, + 0x48, 0x74, 0x34, 0x62, 0x56, 0x61, 0x54, 0x0a, 0x4c, 0x6e, 0x50, 0x71, + 0x5a, 0x69, 0x68, 0x34, 0x7a, 0x52, 0x30, 0x55, 0x76, 0x36, 0x43, 0x50, + 0x4c, 0x79, 0x36, 0x34, 0x4c, 0x6f, 0x37, 0x79, 0x46, 0x49, 0x72, 0x4d, + 0x36, 0x62, 0x56, 0x38, 0x2b, 0x32, 0x79, 0x64, 0x44, 0x4b, 0x58, 0x68, + 0x6c, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x4f, 0x3d, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, + 0x4f, 0x55, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x69, 0x73, 0x20, 0x46, + 0x50, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x4f, 0x3d, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x64, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x69, 0x73, 0x20, 0x46, 0x50, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x54, 0x72, 0x75, 0x73, 0x74, 0x69, 0x73, 0x20, 0x46, 0x50, 0x53, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x36, 0x30, 0x35, + 0x33, 0x36, 0x34, 0x30, 0x33, 0x37, 0x35, 0x33, 0x39, 0x39, 0x30, 0x33, + 0x34, 0x33, 0x30, 0x34, 0x37, 0x32, 0x34, 0x39, 0x38, 0x38, 0x39, 0x37, + 0x35, 0x35, 0x36, 0x33, 0x37, 0x31, 0x30, 0x35, 0x35, 0x33, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x30, 0x3a, 0x63, 0x39, 0x3a, + 0x65, 0x37, 0x3a, 0x31, 0x65, 0x3a, 0x36, 0x62, 0x3a, 0x65, 0x36, 0x3a, + 0x31, 0x34, 0x3a, 0x65, 0x62, 0x3a, 0x36, 0x35, 0x3a, 0x62, 0x32, 0x3a, + 0x31, 0x36, 0x3a, 0x36, 0x39, 0x3a, 0x32, 0x30, 0x3a, 0x33, 0x31, 0x3a, + 0x36, 0x37, 0x3a, 0x34, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x33, 0x62, 0x3a, 0x63, 0x30, 0x3a, 0x33, 0x38, 0x3a, 0x30, + 0x62, 0x3a, 0x33, 0x33, 0x3a, 0x63, 0x33, 0x3a, 0x66, 0x36, 0x3a, 0x61, + 0x36, 0x3a, 0x30, 0x63, 0x3a, 0x38, 0x36, 0x3a, 0x31, 0x35, 0x3a, 0x32, + 0x32, 0x3a, 0x39, 0x33, 0x3a, 0x64, 0x39, 0x3a, 0x64, 0x66, 0x3a, 0x66, + 0x35, 0x3a, 0x34, 0x62, 0x3a, 0x38, 0x31, 0x3a, 0x63, 0x30, 0x3a, 0x30, + 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x63, 0x31, 0x3a, 0x62, 0x34, 0x3a, 0x38, 0x32, 0x3a, 0x39, 0x39, 0x3a, + 0x61, 0x62, 0x3a, 0x61, 0x35, 0x3a, 0x32, 0x30, 0x3a, 0x38, 0x66, 0x3a, + 0x65, 0x39, 0x3a, 0x36, 0x33, 0x3a, 0x30, 0x61, 0x3a, 0x63, 0x65, 0x3a, + 0x35, 0x35, 0x3a, 0x63, 0x61, 0x3a, 0x36, 0x38, 0x3a, 0x61, 0x30, 0x3a, + 0x33, 0x65, 0x3a, 0x64, 0x61, 0x3a, 0x35, 0x61, 0x3a, 0x35, 0x31, 0x3a, + 0x39, 0x63, 0x3a, 0x38, 0x38, 0x3a, 0x30, 0x32, 0x3a, 0x61, 0x30, 0x3a, + 0x64, 0x33, 0x3a, 0x61, 0x36, 0x3a, 0x37, 0x33, 0x3a, 0x62, 0x65, 0x3a, + 0x38, 0x66, 0x3a, 0x38, 0x65, 0x3a, 0x35, 0x35, 0x3a, 0x37, 0x64, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x5a, 0x7a, 0x43, 0x43, + 0x41, 0x6b, 0x2b, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, + 0x47, 0x78, 0x2b, 0x74, 0x74, 0x69, 0x44, 0x35, 0x4a, 0x4e, 0x4d, 0x32, + 0x61, 0x2f, 0x66, 0x48, 0x38, 0x59, 0x79, 0x67, 0x57, 0x54, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x46, 0x0a, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x48, 0x51, 0x6a, 0x45, 0x59, 0x4d, 0x42, 0x59, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x50, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, + 0x70, 0x63, 0x79, 0x42, 0x4d, 0x61, 0x57, 0x31, 0x70, 0x64, 0x47, 0x56, + 0x6b, 0x4d, 0x52, 0x77, 0x77, 0x47, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x0a, 0x45, 0x78, 0x4e, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x47, + 0x6c, 0x7a, 0x49, 0x45, 0x5a, 0x51, 0x55, 0x79, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, + 0x41, 0x7a, 0x4d, 0x54, 0x49, 0x79, 0x4d, 0x7a, 0x45, 0x79, 0x4d, 0x54, + 0x51, 0x77, 0x4e, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x30, 0x4d, 0x44, + 0x45, 0x79, 0x4d, 0x54, 0x45, 0x78, 0x0a, 0x4d, 0x7a, 0x59, 0x31, 0x4e, + 0x46, 0x6f, 0x77, 0x52, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, + 0x44, 0x41, 0x57, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, + 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x61, 0x58, 0x4d, 0x67, 0x54, + 0x47, 0x6c, 0x74, 0x61, 0x58, 0x52, 0x6c, 0x5a, 0x44, 0x45, 0x63, 0x0a, + 0x4d, 0x42, 0x6f, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x54, + 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, 0x70, 0x63, 0x79, 0x42, 0x47, + 0x55, 0x46, 0x4d, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x51, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, + 0x42, 0x51, 0x41, 0x44, 0x0a, 0x67, 0x67, 0x45, 0x50, 0x41, 0x44, 0x43, + 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, 0x41, 0x4d, 0x56, + 0x51, 0x65, 0x35, 0x34, 0x37, 0x4e, 0x64, 0x44, 0x66, 0x78, 0x49, 0x7a, + 0x4e, 0x6a, 0x70, 0x76, 0x74, 0x6f, 0x38, 0x41, 0x32, 0x6d, 0x66, 0x52, + 0x43, 0x36, 0x71, 0x63, 0x2b, 0x67, 0x49, 0x4d, 0x50, 0x70, 0x71, 0x64, + 0x5a, 0x68, 0x38, 0x6d, 0x51, 0x52, 0x55, 0x4e, 0x2b, 0x0a, 0x41, 0x4f, + 0x71, 0x47, 0x65, 0x53, 0x6f, 0x44, 0x76, 0x54, 0x30, 0x33, 0x6d, 0x59, + 0x6c, 0x6d, 0x74, 0x2b, 0x57, 0x4b, 0x56, 0x6f, 0x61, 0x54, 0x6e, 0x47, + 0x68, 0x4c, 0x61, 0x41, 0x53, 0x4d, 0x6b, 0x35, 0x4d, 0x43, 0x50, 0x6a, + 0x44, 0x53, 0x4e, 0x7a, 0x6f, 0x69, 0x59, 0x59, 0x6b, 0x63, 0x68, 0x55, + 0x35, 0x39, 0x6a, 0x39, 0x57, 0x76, 0x65, 0x7a, 0x58, 0x32, 0x66, 0x69, + 0x68, 0x48, 0x0a, 0x69, 0x54, 0x48, 0x63, 0x44, 0x6e, 0x6c, 0x6b, 0x48, + 0x35, 0x6e, 0x53, 0x57, 0x37, 0x72, 0x2b, 0x66, 0x32, 0x43, 0x2f, 0x72, + 0x65, 0x76, 0x6e, 0x50, 0x44, 0x67, 0x70, 0x61, 0x69, 0x2f, 0x6c, 0x6b, + 0x51, 0x74, 0x56, 0x2f, 0x2b, 0x78, 0x76, 0x57, 0x4e, 0x55, 0x74, 0x79, + 0x64, 0x35, 0x4d, 0x5a, 0x6e, 0x47, 0x50, 0x44, 0x4e, 0x63, 0x45, 0x32, + 0x67, 0x66, 0x6d, 0x48, 0x68, 0x6a, 0x6a, 0x0a, 0x76, 0x53, 0x6b, 0x43, + 0x71, 0x50, 0x6f, 0x63, 0x34, 0x56, 0x75, 0x35, 0x67, 0x36, 0x68, 0x42, + 0x53, 0x4c, 0x77, 0x61, 0x63, 0x59, 0x33, 0x6e, 0x59, 0x75, 0x55, 0x74, + 0x73, 0x75, 0x76, 0x66, 0x66, 0x4d, 0x2f, 0x62, 0x71, 0x31, 0x72, 0x4b, + 0x4d, 0x66, 0x46, 0x4d, 0x49, 0x76, 0x4d, 0x46, 0x45, 0x2f, 0x65, 0x43, + 0x2b, 0x58, 0x4e, 0x35, 0x44, 0x4c, 0x37, 0x58, 0x53, 0x78, 0x7a, 0x41, + 0x0a, 0x30, 0x52, 0x55, 0x38, 0x6b, 0x30, 0x46, 0x6b, 0x30, 0x65, 0x61, + 0x2b, 0x49, 0x78, 0x63, 0x69, 0x41, 0x49, 0x6c, 0x65, 0x48, 0x32, 0x75, + 0x6c, 0x72, 0x47, 0x36, 0x6e, 0x53, 0x34, 0x7a, 0x74, 0x6f, 0x33, 0x4c, + 0x6d, 0x72, 0x32, 0x4e, 0x4e, 0x4c, 0x34, 0x58, 0x53, 0x46, 0x44, 0x57, + 0x61, 0x4c, 0x6b, 0x36, 0x4d, 0x36, 0x6a, 0x4b, 0x59, 0x4b, 0x49, 0x61, + 0x68, 0x6b, 0x51, 0x6c, 0x42, 0x0a, 0x4f, 0x72, 0x54, 0x68, 0x34, 0x2f, + 0x4c, 0x36, 0x38, 0x4d, 0x6b, 0x4b, 0x6f, 0x6b, 0x48, 0x64, 0x71, 0x65, + 0x4d, 0x44, 0x78, 0x34, 0x67, 0x56, 0x4f, 0x78, 0x7a, 0x55, 0x47, 0x70, + 0x54, 0x58, 0x6e, 0x32, 0x52, 0x5a, 0x45, 0x6d, 0x30, 0x43, 0x41, 0x77, + 0x45, 0x41, 0x41, 0x61, 0x4e, 0x54, 0x4d, 0x46, 0x45, 0x77, 0x44, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x0a, 0x42, + 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x66, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, + 0x42, 0x53, 0x36, 0x2b, 0x6e, 0x45, 0x6c, 0x65, 0x59, 0x74, 0x58, 0x51, + 0x53, 0x55, 0x68, 0x68, 0x67, 0x74, 0x78, 0x36, 0x37, 0x4a, 0x6b, 0x44, + 0x6f, 0x73, 0x68, 0x5a, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x34, 0x45, 0x0a, 0x46, 0x67, 0x51, 0x55, 0x75, 0x76, 0x70, 0x78, + 0x4a, 0x58, 0x6d, 0x4c, 0x56, 0x30, 0x45, 0x6c, 0x49, 0x59, 0x59, 0x4c, + 0x63, 0x65, 0x75, 0x79, 0x5a, 0x41, 0x36, 0x4c, 0x49, 0x57, 0x63, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x48, 0x35, 0x59, 0x2f, 0x2f, 0x30, 0x31, 0x0a, 0x47, 0x58, 0x32, + 0x63, 0x47, 0x45, 0x2b, 0x65, 0x73, 0x43, 0x75, 0x38, 0x6a, 0x6f, 0x77, + 0x55, 0x2f, 0x79, 0x79, 0x67, 0x32, 0x6b, 0x64, 0x62, 0x77, 0x2b, 0x2b, + 0x42, 0x4c, 0x61, 0x38, 0x46, 0x36, 0x6e, 0x52, 0x49, 0x57, 0x2f, 0x4d, + 0x2b, 0x54, 0x67, 0x66, 0x48, 0x62, 0x63, 0x57, 0x7a, 0x6b, 0x38, 0x38, + 0x69, 0x4e, 0x56, 0x79, 0x32, 0x50, 0x33, 0x55, 0x6e, 0x58, 0x77, 0x6d, + 0x57, 0x0a, 0x7a, 0x61, 0x44, 0x2b, 0x76, 0x6b, 0x41, 0x4d, 0x58, 0x42, + 0x4a, 0x56, 0x2b, 0x4a, 0x4f, 0x43, 0x79, 0x69, 0x6e, 0x70, 0x58, 0x6a, + 0x39, 0x57, 0x56, 0x34, 0x73, 0x34, 0x4e, 0x76, 0x64, 0x46, 0x47, 0x6b, + 0x77, 0x6f, 0x7a, 0x5a, 0x35, 0x42, 0x75, 0x4f, 0x31, 0x57, 0x54, 0x49, + 0x53, 0x6b, 0x51, 0x4d, 0x69, 0x34, 0x73, 0x4b, 0x55, 0x72, 0x61, 0x58, + 0x41, 0x45, 0x61, 0x73, 0x50, 0x34, 0x0a, 0x31, 0x42, 0x49, 0x79, 0x2b, + 0x51, 0x37, 0x44, 0x73, 0x64, 0x77, 0x79, 0x68, 0x45, 0x51, 0x73, 0x62, + 0x38, 0x74, 0x47, 0x44, 0x2b, 0x70, 0x6d, 0x51, 0x51, 0x39, 0x50, 0x38, + 0x56, 0x69, 0x6c, 0x70, 0x67, 0x30, 0x4e, 0x44, 0x32, 0x48, 0x65, 0x70, + 0x5a, 0x35, 0x64, 0x66, 0x57, 0x57, 0x68, 0x50, 0x42, 0x66, 0x6e, 0x71, + 0x46, 0x56, 0x4f, 0x37, 0x36, 0x44, 0x48, 0x37, 0x63, 0x5a, 0x45, 0x0a, + 0x66, 0x31, 0x54, 0x31, 0x6f, 0x2b, 0x43, 0x50, 0x38, 0x48, 0x78, 0x56, + 0x49, 0x6f, 0x38, 0x70, 0x74, 0x6f, 0x47, 0x6a, 0x34, 0x57, 0x31, 0x4f, + 0x4c, 0x42, 0x75, 0x41, 0x5a, 0x2b, 0x79, 0x74, 0x49, 0x4a, 0x38, 0x4d, + 0x59, 0x6d, 0x48, 0x56, 0x6c, 0x2f, 0x39, 0x44, 0x37, 0x53, 0x33, 0x42, + 0x32, 0x6c, 0x30, 0x70, 0x4b, 0x6f, 0x55, 0x2f, 0x72, 0x47, 0x58, 0x75, + 0x68, 0x67, 0x38, 0x46, 0x0a, 0x6a, 0x5a, 0x42, 0x66, 0x33, 0x2b, 0x36, + 0x66, 0x39, 0x4c, 0x2f, 0x75, 0x48, 0x66, 0x75, 0x59, 0x35, 0x48, 0x2b, + 0x51, 0x4b, 0x34, 0x52, 0x34, 0x45, 0x41, 0x35, 0x73, 0x53, 0x56, 0x50, + 0x76, 0x46, 0x56, 0x74, 0x6c, 0x52, 0x6b, 0x70, 0x64, 0x72, 0x37, 0x72, + 0x37, 0x4f, 0x6e, 0x49, 0x64, 0x7a, 0x66, 0x59, 0x6c, 0x69, 0x42, 0x36, + 0x58, 0x7a, 0x43, 0x47, 0x63, 0x4b, 0x51, 0x45, 0x4e, 0x0a, 0x5a, 0x65, + 0x74, 0x58, 0x32, 0x66, 0x4e, 0x58, 0x6c, 0x72, 0x74, 0x49, 0x7a, 0x59, + 0x45, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x42, 0x75, 0x79, 0x70, 0x61, + 0x73, 0x73, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x42, 0x75, 0x79, + 0x70, 0x61, 0x73, 0x73, 0x20, 0x41, 0x53, 0x2d, 0x39, 0x38, 0x33, 0x31, + 0x36, 0x33, 0x33, 0x32, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x42, 0x75, 0x79, 0x70, + 0x61, 0x73, 0x73, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x42, 0x75, + 0x79, 0x70, 0x61, 0x73, 0x73, 0x20, 0x41, 0x53, 0x2d, 0x39, 0x38, 0x33, + 0x31, 0x36, 0x33, 0x33, 0x32, 0x37, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x42, 0x75, 0x79, 0x70, 0x61, 0x73, 0x73, + 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x34, 0x36, 0x3a, 0x61, 0x37, 0x3a, 0x64, 0x32, 0x3a, 0x66, 0x65, + 0x3a, 0x34, 0x35, 0x3a, 0x66, 0x62, 0x3a, 0x36, 0x34, 0x3a, 0x35, 0x61, + 0x3a, 0x61, 0x38, 0x3a, 0x35, 0x39, 0x3a, 0x39, 0x30, 0x3a, 0x39, 0x62, + 0x3a, 0x37, 0x38, 0x3a, 0x34, 0x34, 0x3a, 0x39, 0x62, 0x3a, 0x32, 0x39, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x39, 0x3a, + 0x30, 0x61, 0x3a, 0x37, 0x35, 0x3a, 0x37, 0x34, 0x3a, 0x64, 0x65, 0x3a, + 0x38, 0x37, 0x3a, 0x30, 0x61, 0x3a, 0x34, 0x37, 0x3a, 0x66, 0x65, 0x3a, + 0x35, 0x38, 0x3a, 0x65, 0x65, 0x3a, 0x66, 0x36, 0x3a, 0x63, 0x37, 0x3a, + 0x36, 0x62, 0x3a, 0x65, 0x62, 0x3a, 0x63, 0x36, 0x3a, 0x30, 0x62, 0x3a, + 0x31, 0x32, 0x3a, 0x34, 0x30, 0x3a, 0x39, 0x39, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x61, 0x3a, 0x31, 0x31, + 0x3a, 0x34, 0x30, 0x3a, 0x32, 0x35, 0x3a, 0x31, 0x39, 0x3a, 0x37, 0x63, + 0x3a, 0x35, 0x62, 0x3a, 0x62, 0x39, 0x3a, 0x35, 0x64, 0x3a, 0x39, 0x34, + 0x3a, 0x65, 0x36, 0x3a, 0x33, 0x64, 0x3a, 0x35, 0x35, 0x3a, 0x63, 0x64, + 0x3a, 0x34, 0x33, 0x3a, 0x37, 0x39, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x37, + 0x3a, 0x62, 0x36, 0x3a, 0x34, 0x36, 0x3a, 0x62, 0x32, 0x3a, 0x33, 0x63, + 0x3a, 0x64, 0x66, 0x3a, 0x31, 0x31, 0x3a, 0x61, 0x64, 0x3a, 0x61, 0x34, + 0x3a, 0x61, 0x30, 0x3a, 0x30, 0x65, 0x3a, 0x66, 0x66, 0x3a, 0x31, 0x35, + 0x3a, 0x66, 0x62, 0x3a, 0x34, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x46, 0x57, 0x54, 0x43, 0x43, 0x41, 0x30, 0x47, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x6a, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x4f, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4f, 0x54, + 0x7a, 0x45, 0x64, 0x0a, 0x4d, 0x42, 0x73, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x67, 0x77, 0x55, 0x51, 0x6e, 0x56, 0x35, 0x63, 0x47, 0x46, 0x7a, + 0x63, 0x79, 0x42, 0x42, 0x55, 0x79, 0x30, 0x35, 0x4f, 0x44, 0x4d, 0x78, + 0x4e, 0x6a, 0x4d, 0x7a, 0x4d, 0x6a, 0x63, 0x78, 0x49, 0x44, 0x41, 0x65, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x46, 0x30, 0x4a, 0x31, + 0x65, 0x58, 0x42, 0x68, 0x63, 0x33, 0x4d, 0x67, 0x0a, 0x51, 0x32, 0x78, + 0x68, 0x63, 0x33, 0x4d, 0x67, 0x4d, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, + 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, + 0x77, 0x4d, 0x54, 0x41, 0x79, 0x4e, 0x6a, 0x41, 0x34, 0x4d, 0x7a, 0x67, + 0x77, 0x4d, 0x31, 0x6f, 0x58, 0x44, 0x54, 0x51, 0x77, 0x4d, 0x54, 0x41, + 0x79, 0x4e, 0x6a, 0x41, 0x34, 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x31, 0x6f, + 0x77, 0x0a, 0x54, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x54, 0x6b, 0x38, 0x78, 0x48, 0x54, + 0x41, 0x62, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x46, 0x45, + 0x4a, 0x31, 0x65, 0x58, 0x42, 0x68, 0x63, 0x33, 0x4d, 0x67, 0x51, 0x56, + 0x4d, 0x74, 0x4f, 0x54, 0x67, 0x7a, 0x4d, 0x54, 0x59, 0x7a, 0x4d, 0x7a, + 0x49, 0x33, 0x4d, 0x53, 0x41, 0x77, 0x0a, 0x48, 0x67, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x44, 0x44, 0x42, 0x64, 0x43, 0x64, 0x58, 0x6c, 0x77, 0x59, + 0x58, 0x4e, 0x7a, 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, + 0x44, 0x49, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, + 0x54, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x0a, + 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, 0x43, 0x43, + 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4e, 0x66, 0x48, + 0x58, 0x76, 0x66, 0x42, 0x42, 0x39, 0x52, 0x33, 0x2b, 0x30, 0x4d, 0x68, + 0x39, 0x50, 0x54, 0x31, 0x61, 0x65, 0x54, 0x75, 0x4d, 0x67, 0x48, 0x62, + 0x6f, 0x34, 0x59, 0x66, 0x35, 0x46, 0x6b, 0x4e, 0x75, 0x75, 0x64, 0x31, + 0x67, 0x31, 0x4c, 0x72, 0x0a, 0x36, 0x68, 0x78, 0x68, 0x46, 0x55, 0x69, + 0x37, 0x48, 0x51, 0x66, 0x4b, 0x6a, 0x4b, 0x36, 0x77, 0x33, 0x4a, 0x61, + 0x64, 0x36, 0x73, 0x4e, 0x67, 0x6b, 0x6f, 0x61, 0x43, 0x4b, 0x48, 0x4f, + 0x63, 0x56, 0x67, 0x62, 0x2f, 0x53, 0x32, 0x54, 0x77, 0x44, 0x43, 0x6f, + 0x33, 0x53, 0x62, 0x58, 0x6c, 0x7a, 0x77, 0x78, 0x38, 0x37, 0x76, 0x46, + 0x4b, 0x75, 0x33, 0x4d, 0x77, 0x5a, 0x66, 0x50, 0x56, 0x0a, 0x4c, 0x34, + 0x4f, 0x32, 0x66, 0x75, 0x50, 0x6e, 0x39, 0x5a, 0x36, 0x72, 0x59, 0x50, + 0x6e, 0x54, 0x38, 0x5a, 0x32, 0x53, 0x64, 0x49, 0x72, 0x6b, 0x48, 0x4a, + 0x61, 0x73, 0x57, 0x34, 0x44, 0x70, 0x74, 0x66, 0x51, 0x78, 0x68, 0x36, + 0x4e, 0x52, 0x2f, 0x4d, 0x64, 0x2b, 0x6f, 0x57, 0x2b, 0x4f, 0x55, 0x33, + 0x66, 0x55, 0x6c, 0x38, 0x46, 0x56, 0x4d, 0x35, 0x49, 0x2b, 0x47, 0x43, + 0x39, 0x31, 0x0a, 0x31, 0x4b, 0x32, 0x47, 0x53, 0x63, 0x75, 0x56, 0x72, + 0x31, 0x51, 0x47, 0x62, 0x4e, 0x67, 0x47, 0x45, 0x34, 0x31, 0x62, 0x2f, + 0x2b, 0x45, 0x6d, 0x47, 0x56, 0x6e, 0x41, 0x4a, 0x4c, 0x71, 0x42, 0x63, + 0x58, 0x6d, 0x51, 0x52, 0x46, 0x42, 0x6f, 0x4a, 0x4a, 0x52, 0x66, 0x75, + 0x4c, 0x4d, 0x52, 0x38, 0x53, 0x6c, 0x42, 0x59, 0x61, 0x4e, 0x42, 0x79, + 0x79, 0x4d, 0x32, 0x31, 0x63, 0x48, 0x78, 0x0a, 0x4d, 0x6c, 0x41, 0x51, + 0x54, 0x6e, 0x2f, 0x30, 0x68, 0x70, 0x50, 0x73, 0x68, 0x4e, 0x4f, 0x4f, + 0x76, 0x45, 0x75, 0x2f, 0x58, 0x41, 0x46, 0x4f, 0x42, 0x7a, 0x33, 0x63, + 0x46, 0x49, 0x71, 0x55, 0x43, 0x71, 0x54, 0x71, 0x63, 0x2f, 0x73, 0x4c, + 0x55, 0x65, 0x67, 0x54, 0x42, 0x78, 0x6a, 0x36, 0x44, 0x76, 0x45, 0x72, + 0x30, 0x56, 0x51, 0x56, 0x66, 0x54, 0x7a, 0x68, 0x39, 0x37, 0x51, 0x5a, + 0x0a, 0x51, 0x6d, 0x64, 0x69, 0x58, 0x6e, 0x66, 0x67, 0x6f, 0x6c, 0x58, + 0x73, 0x74, 0x74, 0x6c, 0x70, 0x46, 0x39, 0x55, 0x36, 0x72, 0x30, 0x54, + 0x74, 0x53, 0x73, 0x57, 0x65, 0x35, 0x48, 0x6f, 0x6e, 0x66, 0x4f, 0x56, + 0x31, 0x31, 0x36, 0x72, 0x4c, 0x4a, 0x65, 0x66, 0x66, 0x61, 0x77, 0x72, + 0x62, 0x44, 0x30, 0x32, 0x54, 0x54, 0x71, 0x69, 0x67, 0x7a, 0x58, 0x73, + 0x75, 0x38, 0x6c, 0x6b, 0x42, 0x0a, 0x61, 0x72, 0x63, 0x4e, 0x75, 0x41, + 0x65, 0x42, 0x66, 0x6f, 0x73, 0x34, 0x47, 0x7a, 0x6a, 0x6d, 0x43, 0x6c, + 0x65, 0x5a, 0x50, 0x65, 0x34, 0x68, 0x36, 0x4b, 0x50, 0x31, 0x44, 0x42, + 0x62, 0x64, 0x69, 0x2b, 0x77, 0x30, 0x6a, 0x70, 0x77, 0x71, 0x48, 0x41, + 0x41, 0x56, 0x46, 0x34, 0x31, 0x6f, 0x67, 0x39, 0x4a, 0x77, 0x6e, 0x78, + 0x67, 0x49, 0x7a, 0x52, 0x46, 0x6f, 0x31, 0x63, 0x6c, 0x72, 0x0a, 0x55, + 0x73, 0x33, 0x45, 0x52, 0x6f, 0x2f, 0x63, 0x74, 0x66, 0x50, 0x59, 0x56, + 0x33, 0x4d, 0x65, 0x36, 0x5a, 0x51, 0x35, 0x42, 0x4c, 0x2f, 0x54, 0x33, + 0x6a, 0x6a, 0x65, 0x74, 0x46, 0x50, 0x73, 0x61, 0x52, 0x79, 0x69, 0x66, + 0x73, 0x53, 0x50, 0x35, 0x42, 0x74, 0x77, 0x72, 0x66, 0x4b, 0x69, 0x2b, + 0x66, 0x76, 0x33, 0x46, 0x6d, 0x52, 0x6d, 0x61, 0x5a, 0x39, 0x4a, 0x55, + 0x61, 0x4c, 0x69, 0x0a, 0x46, 0x52, 0x68, 0x6e, 0x42, 0x6b, 0x70, 0x2f, + 0x31, 0x57, 0x79, 0x31, 0x54, 0x62, 0x4d, 0x7a, 0x34, 0x47, 0x48, 0x72, + 0x58, 0x62, 0x37, 0x70, 0x6d, 0x41, 0x38, 0x79, 0x31, 0x78, 0x31, 0x4c, + 0x50, 0x43, 0x35, 0x61, 0x41, 0x56, 0x4b, 0x52, 0x43, 0x66, 0x4c, 0x66, + 0x36, 0x6f, 0x33, 0x59, 0x42, 0x6b, 0x42, 0x6a, 0x71, 0x68, 0x48, 0x6b, + 0x2f, 0x73, 0x4d, 0x33, 0x6e, 0x68, 0x52, 0x53, 0x0a, 0x50, 0x2f, 0x54, + 0x69, 0x7a, 0x50, 0x4a, 0x68, 0x6b, 0x39, 0x48, 0x39, 0x5a, 0x32, 0x76, + 0x58, 0x55, 0x71, 0x36, 0x2f, 0x61, 0x4b, 0x74, 0x41, 0x51, 0x36, 0x42, + 0x58, 0x4e, 0x56, 0x4e, 0x34, 0x38, 0x46, 0x50, 0x34, 0x59, 0x55, 0x49, + 0x48, 0x5a, 0x4d, 0x62, 0x58, 0x62, 0x35, 0x74, 0x4d, 0x4f, 0x41, 0x31, + 0x6a, 0x72, 0x47, 0x4b, 0x76, 0x4e, 0x6f, 0x75, 0x69, 0x63, 0x77, 0x6f, + 0x4e, 0x0a, 0x39, 0x53, 0x47, 0x39, 0x64, 0x4b, 0x70, 0x4e, 0x36, 0x6e, + 0x49, 0x44, 0x53, 0x64, 0x76, 0x48, 0x58, 0x78, 0x31, 0x69, 0x59, 0x38, + 0x66, 0x39, 0x33, 0x5a, 0x48, 0x73, 0x4d, 0x2b, 0x37, 0x31, 0x62, 0x62, + 0x52, 0x75, 0x4d, 0x47, 0x6a, 0x65, 0x79, 0x4e, 0x59, 0x6d, 0x73, 0x48, + 0x56, 0x65, 0x65, 0x37, 0x51, 0x48, 0x49, 0x4a, 0x69, 0x68, 0x64, 0x6a, + 0x4b, 0x34, 0x54, 0x57, 0x78, 0x50, 0x0a, 0x41, 0x67, 0x4d, 0x42, 0x41, + 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, + 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, + 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4d, 0x6d, 0x41, 0x64, + 0x2b, 0x42, 0x69, 0x6b, 0x6f, 0x4c, 0x31, 0x52, 0x70, 0x7a, 0x7a, 0x0a, + 0x75, 0x76, 0x64, 0x4d, 0x77, 0x39, 0x36, 0x34, 0x6f, 0x36, 0x30, 0x35, + 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, + 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x4e, + 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, + 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, + 0x55, 0x31, 0x38, 0x68, 0x0a, 0x39, 0x62, 0x71, 0x77, 0x4f, 0x6c, 0x49, + 0x35, 0x4c, 0x4a, 0x4b, 0x77, 0x62, 0x41, 0x44, 0x4a, 0x37, 0x38, 0x34, + 0x67, 0x37, 0x77, 0x62, 0x79, 0x6c, 0x70, 0x37, 0x70, 0x70, 0x48, 0x52, + 0x2f, 0x65, 0x68, 0x62, 0x38, 0x74, 0x2f, 0x57, 0x32, 0x2b, 0x78, 0x55, + 0x62, 0x50, 0x36, 0x75, 0x6d, 0x77, 0x48, 0x4a, 0x64, 0x45, 0x4c, 0x46, + 0x78, 0x37, 0x72, 0x78, 0x50, 0x34, 0x36, 0x32, 0x73, 0x0a, 0x41, 0x32, + 0x30, 0x75, 0x63, 0x53, 0x36, 0x76, 0x78, 0x4f, 0x4f, 0x74, 0x6f, 0x37, + 0x30, 0x4d, 0x45, 0x61, 0x65, 0x30, 0x2f, 0x30, 0x71, 0x79, 0x65, 0x78, + 0x41, 0x51, 0x48, 0x36, 0x64, 0x58, 0x51, 0x62, 0x4c, 0x41, 0x72, 0x76, + 0x51, 0x73, 0x57, 0x64, 0x5a, 0x48, 0x45, 0x49, 0x6a, 0x7a, 0x49, 0x56, + 0x45, 0x70, 0x4d, 0x4d, 0x70, 0x67, 0x68, 0x71, 0x39, 0x47, 0x71, 0x78, + 0x33, 0x74, 0x0a, 0x4f, 0x6c, 0x75, 0x77, 0x6c, 0x4e, 0x35, 0x45, 0x34, + 0x30, 0x45, 0x49, 0x6f, 0x73, 0x48, 0x73, 0x48, 0x64, 0x62, 0x39, 0x54, + 0x37, 0x62, 0x57, 0x52, 0x39, 0x41, 0x55, 0x43, 0x38, 0x72, 0x6d, 0x79, + 0x72, 0x56, 0x37, 0x64, 0x33, 0x35, 0x42, 0x48, 0x31, 0x36, 0x44, 0x78, + 0x37, 0x61, 0x4d, 0x4f, 0x5a, 0x61, 0x77, 0x50, 0x35, 0x61, 0x42, 0x51, + 0x57, 0x39, 0x67, 0x6b, 0x4f, 0x4c, 0x6f, 0x0a, 0x2b, 0x66, 0x73, 0x69, + 0x63, 0x64, 0x6c, 0x39, 0x73, 0x7a, 0x31, 0x47, 0x76, 0x37, 0x53, 0x45, + 0x72, 0x35, 0x41, 0x63, 0x44, 0x34, 0x38, 0x53, 0x61, 0x71, 0x2f, 0x76, + 0x37, 0x68, 0x35, 0x36, 0x72, 0x67, 0x4a, 0x4b, 0x69, 0x68, 0x63, 0x72, + 0x64, 0x76, 0x36, 0x73, 0x56, 0x49, 0x6b, 0x6b, 0x4c, 0x45, 0x38, 0x2f, + 0x74, 0x72, 0x4b, 0x6e, 0x54, 0x6f, 0x79, 0x6f, 0x6b, 0x5a, 0x66, 0x37, + 0x0a, 0x4b, 0x63, 0x5a, 0x37, 0x58, 0x43, 0x32, 0x35, 0x79, 0x32, 0x61, + 0x32, 0x74, 0x36, 0x68, 0x62, 0x45, 0x6c, 0x47, 0x46, 0x74, 0x51, 0x6c, + 0x2b, 0x59, 0x6e, 0x68, 0x77, 0x2f, 0x71, 0x6c, 0x71, 0x59, 0x4c, 0x59, + 0x64, 0x44, 0x6e, 0x6b, 0x4d, 0x2f, 0x63, 0x72, 0x71, 0x4a, 0x49, 0x42, + 0x79, 0x77, 0x35, 0x63, 0x2f, 0x38, 0x6e, 0x65, 0x72, 0x51, 0x79, 0x49, + 0x4b, 0x78, 0x2b, 0x75, 0x32, 0x0a, 0x44, 0x49, 0x53, 0x43, 0x4c, 0x49, + 0x42, 0x72, 0x51, 0x59, 0x6f, 0x49, 0x77, 0x4f, 0x75, 0x6c, 0x61, 0x39, + 0x2b, 0x5a, 0x45, 0x73, 0x75, 0x4b, 0x31, 0x56, 0x36, 0x41, 0x44, 0x4a, + 0x48, 0x67, 0x4a, 0x67, 0x67, 0x32, 0x53, 0x4d, 0x58, 0x36, 0x4f, 0x42, + 0x45, 0x31, 0x2f, 0x79, 0x57, 0x44, 0x4c, 0x66, 0x4a, 0x36, 0x76, 0x39, + 0x72, 0x39, 0x6a, 0x76, 0x36, 0x6c, 0x79, 0x30, 0x55, 0x73, 0x0a, 0x48, + 0x38, 0x53, 0x49, 0x55, 0x36, 0x35, 0x33, 0x44, 0x74, 0x6d, 0x61, 0x64, + 0x73, 0x57, 0x4f, 0x4c, 0x42, 0x32, 0x6a, 0x75, 0x74, 0x58, 0x73, 0x4d, + 0x71, 0x37, 0x41, 0x71, 0x71, 0x7a, 0x33, 0x30, 0x58, 0x70, 0x4e, 0x36, + 0x39, 0x51, 0x48, 0x34, 0x6b, 0x6a, 0x33, 0x49, 0x6f, 0x36, 0x77, 0x70, + 0x4a, 0x39, 0x71, 0x7a, 0x6f, 0x36, 0x79, 0x73, 0x6d, 0x44, 0x30, 0x6f, + 0x79, 0x4c, 0x51, 0x0a, 0x49, 0x2b, 0x75, 0x55, 0x57, 0x6e, 0x70, 0x70, + 0x33, 0x51, 0x2b, 0x2f, 0x51, 0x46, 0x65, 0x73, 0x61, 0x31, 0x6c, 0x51, + 0x32, 0x61, 0x4f, 0x5a, 0x34, 0x57, 0x37, 0x2b, 0x6a, 0x51, 0x46, 0x35, + 0x4a, 0x79, 0x4d, 0x56, 0x33, 0x70, 0x4b, 0x64, 0x65, 0x77, 0x6c, 0x4e, + 0x57, 0x75, 0x64, 0x4c, 0x53, 0x44, 0x42, 0x61, 0x47, 0x4f, 0x59, 0x4b, + 0x62, 0x65, 0x61, 0x50, 0x34, 0x4e, 0x4b, 0x37, 0x0a, 0x35, 0x74, 0x39, + 0x38, 0x62, 0x69, 0x47, 0x43, 0x77, 0x57, 0x67, 0x35, 0x54, 0x62, 0x53, + 0x59, 0x57, 0x47, 0x5a, 0x69, 0x7a, 0x45, 0x71, 0x51, 0x58, 0x73, 0x50, + 0x36, 0x4a, 0x77, 0x53, 0x78, 0x65, 0x52, 0x56, 0x30, 0x6d, 0x63, 0x79, + 0x2b, 0x72, 0x53, 0x44, 0x65, 0x4a, 0x6d, 0x41, 0x63, 0x36, 0x31, 0x5a, + 0x52, 0x70, 0x71, 0x50, 0x71, 0x35, 0x4b, 0x4d, 0x2f, 0x70, 0x2f, 0x39, + 0x68, 0x0a, 0x33, 0x50, 0x46, 0x61, 0x54, 0x57, 0x77, 0x79, 0x49, 0x30, + 0x50, 0x75, 0x72, 0x4b, 0x6a, 0x75, 0x37, 0x6b, 0x6f, 0x53, 0x43, 0x54, + 0x78, 0x64, 0x63, 0x63, 0x4b, 0x2b, 0x65, 0x66, 0x72, 0x43, 0x68, 0x32, + 0x67, 0x64, 0x43, 0x2f, 0x31, 0x63, 0x61, 0x63, 0x77, 0x47, 0x30, 0x4a, + 0x70, 0x39, 0x56, 0x4a, 0x6b, 0x71, 0x79, 0x54, 0x6b, 0x61, 0x47, 0x61, + 0x39, 0x4c, 0x4b, 0x6b, 0x50, 0x7a, 0x0a, 0x59, 0x31, 0x31, 0x61, 0x57, + 0x4f, 0x49, 0x76, 0x34, 0x78, 0x33, 0x6b, 0x71, 0x64, 0x62, 0x51, 0x43, + 0x74, 0x43, 0x65, 0x76, 0x39, 0x65, 0x42, 0x43, 0x66, 0x48, 0x4a, 0x78, + 0x79, 0x59, 0x4e, 0x72, 0x4a, 0x67, 0x57, 0x56, 0x71, 0x41, 0x3d, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x42, 0x75, 0x79, 0x70, 0x61, 0x73, 0x73, 0x20, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x42, 0x75, 0x79, 0x70, 0x61, 0x73, + 0x73, 0x20, 0x41, 0x53, 0x2d, 0x39, 0x38, 0x33, 0x31, 0x36, 0x33, 0x33, + 0x32, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x42, 0x75, 0x79, 0x70, 0x61, 0x73, 0x73, + 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x42, 0x75, 0x79, 0x70, 0x61, + 0x73, 0x73, 0x20, 0x41, 0x53, 0x2d, 0x39, 0x38, 0x33, 0x31, 0x36, 0x33, + 0x33, 0x32, 0x37, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x42, 0x75, 0x79, 0x70, 0x61, 0x73, 0x73, 0x20, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x64, + 0x3a, 0x33, 0x62, 0x3a, 0x31, 0x38, 0x3a, 0x39, 0x65, 0x3a, 0x32, 0x63, + 0x3a, 0x36, 0x34, 0x3a, 0x35, 0x61, 0x3a, 0x65, 0x38, 0x3a, 0x64, 0x35, + 0x3a, 0x38, 0x38, 0x3a, 0x63, 0x65, 0x3a, 0x30, 0x65, 0x3a, 0x66, 0x39, + 0x3a, 0x33, 0x37, 0x3a, 0x63, 0x32, 0x3a, 0x65, 0x63, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x61, 0x3a, 0x66, 0x61, 0x3a, + 0x66, 0x37, 0x3a, 0x66, 0x61, 0x3a, 0x36, 0x36, 0x3a, 0x38, 0x34, 0x3a, + 0x65, 0x63, 0x3a, 0x30, 0x36, 0x3a, 0x38, 0x66, 0x3a, 0x31, 0x34, 0x3a, + 0x35, 0x30, 0x3a, 0x62, 0x64, 0x3a, 0x63, 0x37, 0x3a, 0x63, 0x32, 0x3a, + 0x38, 0x31, 0x3a, 0x61, 0x35, 0x3a, 0x62, 0x63, 0x3a, 0x61, 0x39, 0x3a, + 0x36, 0x34, 0x3a, 0x35, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x64, 0x3a, 0x66, 0x37, 0x3a, 0x65, 0x62, + 0x3a, 0x62, 0x63, 0x3a, 0x61, 0x32, 0x3a, 0x37, 0x61, 0x3a, 0x32, 0x61, + 0x3a, 0x33, 0x38, 0x3a, 0x34, 0x64, 0x3a, 0x33, 0x38, 0x3a, 0x37, 0x62, + 0x3a, 0x37, 0x64, 0x3a, 0x34, 0x30, 0x3a, 0x31, 0x30, 0x3a, 0x63, 0x36, + 0x3a, 0x36, 0x36, 0x3a, 0x65, 0x32, 0x3a, 0x65, 0x64, 0x3a, 0x62, 0x34, + 0x3a, 0x38, 0x34, 0x3a, 0x33, 0x65, 0x3a, 0x34, 0x63, 0x3a, 0x32, 0x39, + 0x3a, 0x62, 0x34, 0x3a, 0x61, 0x65, 0x3a, 0x31, 0x64, 0x3a, 0x35, 0x62, + 0x3a, 0x39, 0x33, 0x3a, 0x33, 0x32, 0x3a, 0x65, 0x36, 0x3a, 0x62, 0x32, + 0x3a, 0x34, 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, + 0x57, 0x54, 0x43, 0x43, 0x41, 0x30, 0x47, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x42, 0x41, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, + 0x41, 0x44, 0x42, 0x4f, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4f, 0x54, 0x7a, 0x45, 0x64, + 0x0a, 0x4d, 0x42, 0x73, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, + 0x55, 0x51, 0x6e, 0x56, 0x35, 0x63, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x42, + 0x42, 0x55, 0x79, 0x30, 0x35, 0x4f, 0x44, 0x4d, 0x78, 0x4e, 0x6a, 0x4d, + 0x7a, 0x4d, 0x6a, 0x63, 0x78, 0x49, 0x44, 0x41, 0x65, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x46, 0x30, 0x4a, 0x31, 0x65, 0x58, 0x42, + 0x68, 0x63, 0x33, 0x4d, 0x67, 0x0a, 0x51, 0x32, 0x78, 0x68, 0x63, 0x33, + 0x4d, 0x67, 0x4d, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x42, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x77, 0x4d, 0x54, + 0x41, 0x79, 0x4e, 0x6a, 0x41, 0x34, 0x4d, 0x6a, 0x67, 0x31, 0x4f, 0x46, + 0x6f, 0x58, 0x44, 0x54, 0x51, 0x77, 0x4d, 0x54, 0x41, 0x79, 0x4e, 0x6a, + 0x41, 0x34, 0x4d, 0x6a, 0x67, 0x31, 0x4f, 0x46, 0x6f, 0x77, 0x0a, 0x54, + 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x54, 0x6b, 0x38, 0x78, 0x48, 0x54, 0x41, 0x62, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x46, 0x45, 0x4a, 0x31, 0x65, + 0x58, 0x42, 0x68, 0x63, 0x33, 0x4d, 0x67, 0x51, 0x56, 0x4d, 0x74, 0x4f, + 0x54, 0x67, 0x7a, 0x4d, 0x54, 0x59, 0x7a, 0x4d, 0x7a, 0x49, 0x33, 0x4d, + 0x53, 0x41, 0x77, 0x0a, 0x48, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x44, 0x42, 0x64, 0x43, 0x64, 0x58, 0x6c, 0x77, 0x59, 0x58, 0x4e, 0x7a, + 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x4d, 0x67, + 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, 0x43, 0x43, + 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x0a, 0x42, 0x51, 0x41, + 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x67, 0x6f, + 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4b, 0x58, 0x61, 0x43, 0x70, 0x55, + 0x57, 0x55, 0x4f, 0x4f, 0x56, 0x38, 0x6c, 0x36, 0x64, 0x64, 0x6a, 0x45, + 0x47, 0x4d, 0x6e, 0x71, 0x62, 0x38, 0x52, 0x42, 0x32, 0x75, 0x41, 0x43, + 0x61, 0x74, 0x56, 0x49, 0x32, 0x7a, 0x53, 0x52, 0x48, 0x73, 0x4a, 0x38, + 0x59, 0x0a, 0x5a, 0x4c, 0x79, 0x61, 0x39, 0x76, 0x72, 0x56, 0x65, 0x64, + 0x69, 0x51, 0x59, 0x6b, 0x77, 0x69, 0x4c, 0x39, 0x34, 0x34, 0x50, 0x64, + 0x62, 0x67, 0x71, 0x4f, 0x6b, 0x63, 0x4c, 0x4e, 0x74, 0x34, 0x45, 0x65, + 0x6d, 0x4f, 0x61, 0x46, 0x45, 0x56, 0x63, 0x73, 0x66, 0x7a, 0x4d, 0x34, + 0x66, 0x6b, 0x6f, 0x46, 0x30, 0x4c, 0x58, 0x4f, 0x42, 0x58, 0x42, 0x79, + 0x6f, 0x77, 0x39, 0x63, 0x33, 0x45, 0x0a, 0x4e, 0x33, 0x63, 0x6f, 0x54, + 0x52, 0x69, 0x52, 0x35, 0x72, 0x2f, 0x56, 0x55, 0x76, 0x31, 0x78, 0x4c, + 0x58, 0x41, 0x2b, 0x35, 0x38, 0x62, 0x45, 0x69, 0x75, 0x50, 0x77, 0x4b, + 0x41, 0x76, 0x30, 0x64, 0x70, 0x69, 0x68, 0x69, 0x34, 0x64, 0x56, 0x73, + 0x6a, 0x6f, 0x54, 0x2f, 0x4c, 0x63, 0x2b, 0x4a, 0x7a, 0x65, 0x4f, 0x49, + 0x75, 0x4f, 0x6f, 0x54, 0x79, 0x72, 0x76, 0x59, 0x4c, 0x73, 0x39, 0x0a, + 0x74, 0x7a, 0x6e, 0x44, 0x44, 0x67, 0x46, 0x48, 0x6d, 0x56, 0x30, 0x53, + 0x54, 0x39, 0x74, 0x44, 0x2b, 0x6c, 0x65, 0x68, 0x37, 0x66, 0x6d, 0x64, + 0x76, 0x68, 0x46, 0x48, 0x4a, 0x6c, 0x73, 0x54, 0x6d, 0x4b, 0x74, 0x64, + 0x46, 0x6f, 0x71, 0x77, 0x4e, 0x78, 0x78, 0x58, 0x6e, 0x55, 0x58, 0x2f, + 0x69, 0x4a, 0x59, 0x32, 0x76, 0x37, 0x76, 0x4b, 0x42, 0x33, 0x74, 0x76, + 0x68, 0x32, 0x50, 0x58, 0x0a, 0x30, 0x44, 0x4a, 0x71, 0x31, 0x6c, 0x31, + 0x73, 0x44, 0x50, 0x47, 0x7a, 0x62, 0x6a, 0x6e, 0x69, 0x61, 0x7a, 0x45, + 0x75, 0x4f, 0x51, 0x41, 0x6e, 0x46, 0x4e, 0x34, 0x34, 0x77, 0x4f, 0x77, + 0x5a, 0x5a, 0x6f, 0x59, 0x53, 0x36, 0x4a, 0x31, 0x79, 0x46, 0x68, 0x4e, + 0x6b, 0x55, 0x73, 0x65, 0x70, 0x4e, 0x78, 0x7a, 0x39, 0x67, 0x6a, 0x44, + 0x74, 0x68, 0x42, 0x67, 0x64, 0x39, 0x4b, 0x35, 0x63, 0x0a, 0x2f, 0x33, + 0x41, 0x54, 0x41, 0x4f, 0x75, 0x78, 0x39, 0x54, 0x4e, 0x36, 0x53, 0x39, + 0x5a, 0x56, 0x2b, 0x41, 0x57, 0x4e, 0x53, 0x32, 0x6d, 0x77, 0x39, 0x62, + 0x4d, 0x6f, 0x4e, 0x6c, 0x77, 0x55, 0x78, 0x46, 0x46, 0x7a, 0x54, 0x57, + 0x73, 0x4c, 0x38, 0x54, 0x51, 0x48, 0x32, 0x78, 0x63, 0x35, 0x31, 0x39, + 0x77, 0x6f, 0x65, 0x32, 0x76, 0x31, 0x6e, 0x2f, 0x4d, 0x75, 0x77, 0x55, + 0x38, 0x58, 0x0a, 0x4b, 0x68, 0x44, 0x7a, 0x7a, 0x4d, 0x72, 0x6f, 0x36, + 0x2f, 0x31, 0x72, 0x71, 0x79, 0x36, 0x61, 0x6e, 0x79, 0x32, 0x43, 0x62, + 0x67, 0x54, 0x55, 0x55, 0x67, 0x47, 0x54, 0x4c, 0x54, 0x32, 0x47, 0x2f, + 0x48, 0x37, 0x38, 0x33, 0x2b, 0x39, 0x43, 0x48, 0x61, 0x5a, 0x72, 0x37, + 0x37, 0x6b, 0x67, 0x78, 0x76, 0x65, 0x39, 0x6f, 0x4b, 0x65, 0x56, 0x2f, + 0x61, 0x66, 0x6d, 0x69, 0x53, 0x54, 0x59, 0x0a, 0x7a, 0x49, 0x77, 0x30, + 0x62, 0x4f, 0x49, 0x6a, 0x4c, 0x39, 0x6b, 0x53, 0x47, 0x69, 0x47, 0x35, + 0x56, 0x5a, 0x46, 0x76, 0x43, 0x35, 0x46, 0x35, 0x47, 0x51, 0x79, 0x74, + 0x51, 0x49, 0x67, 0x4c, 0x63, 0x4f, 0x4a, 0x36, 0x30, 0x67, 0x37, 0x59, + 0x61, 0x45, 0x69, 0x37, 0x67, 0x68, 0x4d, 0x35, 0x45, 0x46, 0x6a, 0x70, + 0x32, 0x43, 0x6f, 0x48, 0x78, 0x68, 0x4c, 0x62, 0x57, 0x4e, 0x76, 0x53, + 0x0a, 0x4f, 0x31, 0x55, 0x51, 0x52, 0x77, 0x55, 0x56, 0x5a, 0x32, 0x4a, + 0x2b, 0x47, 0x47, 0x4f, 0x6d, 0x52, 0x6a, 0x38, 0x4a, 0x44, 0x6c, 0x51, + 0x79, 0x58, 0x72, 0x38, 0x4e, 0x59, 0x6e, 0x6f, 0x6e, 0x37, 0x34, 0x44, + 0x6f, 0x32, 0x39, 0x6c, 0x4c, 0x42, 0x6c, 0x6f, 0x33, 0x57, 0x69, 0x58, + 0x51, 0x43, 0x42, 0x4a, 0x33, 0x31, 0x47, 0x38, 0x4a, 0x55, 0x4a, 0x63, + 0x39, 0x79, 0x42, 0x33, 0x44, 0x0a, 0x33, 0x34, 0x78, 0x46, 0x4d, 0x46, + 0x62, 0x47, 0x30, 0x32, 0x53, 0x72, 0x5a, 0x76, 0x50, 0x41, 0x58, 0x70, + 0x61, 0x63, 0x77, 0x38, 0x54, 0x76, 0x77, 0x33, 0x78, 0x72, 0x69, 0x7a, + 0x70, 0x35, 0x66, 0x37, 0x4e, 0x4a, 0x7a, 0x7a, 0x33, 0x69, 0x69, 0x5a, + 0x2b, 0x67, 0x4d, 0x45, 0x75, 0x46, 0x75, 0x5a, 0x79, 0x55, 0x4a, 0x48, + 0x6d, 0x50, 0x66, 0x57, 0x75, 0x70, 0x52, 0x57, 0x67, 0x50, 0x0a, 0x4b, + 0x39, 0x44, 0x78, 0x32, 0x68, 0x7a, 0x4c, 0x61, 0x62, 0x6a, 0x4b, 0x53, + 0x57, 0x4a, 0x74, 0x79, 0x4e, 0x42, 0x6a, 0x59, 0x74, 0x31, 0x67, 0x44, + 0x31, 0x69, 0x71, 0x6a, 0x36, 0x47, 0x38, 0x42, 0x61, 0x56, 0x6d, 0x6f, + 0x73, 0x38, 0x62, 0x64, 0x72, 0x4b, 0x45, 0x5a, 0x4c, 0x46, 0x4d, 0x4f, + 0x56, 0x4c, 0x41, 0x4d, 0x4c, 0x72, 0x77, 0x6a, 0x45, 0x73, 0x43, 0x73, + 0x4c, 0x61, 0x33, 0x0a, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, + 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, + 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x42, 0x42, 0x59, 0x45, 0x46, 0x45, 0x65, 0x34, 0x7a, 0x66, 0x2f, 0x6c, + 0x62, 0x2b, 0x37, 0x34, 0x73, 0x75, 0x77, 0x76, 0x0a, 0x54, 0x67, 0x37, + 0x35, 0x4a, 0x62, 0x43, 0x4f, 0x50, 0x47, 0x76, 0x44, 0x4d, 0x41, 0x34, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, + 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x41, 0x43, 0x41, + 0x6a, 0x0a, 0x51, 0x54, 0x55, 0x45, 0x6b, 0x4d, 0x4a, 0x41, 0x59, 0x6d, + 0x44, 0x76, 0x34, 0x6a, 0x56, 0x4d, 0x31, 0x7a, 0x2b, 0x73, 0x34, 0x6a, + 0x53, 0x51, 0x75, 0x4b, 0x46, 0x76, 0x64, 0x76, 0x6f, 0x57, 0x46, 0x71, + 0x52, 0x49, 0x4e, 0x79, 0x7a, 0x70, 0x6b, 0x4d, 0x4c, 0x79, 0x50, 0x50, + 0x67, 0x4b, 0x6e, 0x39, 0x69, 0x42, 0x35, 0x62, 0x74, 0x62, 0x32, 0x69, + 0x55, 0x73, 0x70, 0x4b, 0x64, 0x56, 0x0a, 0x63, 0x53, 0x51, 0x79, 0x39, + 0x73, 0x67, 0x4c, 0x38, 0x72, 0x78, 0x71, 0x2b, 0x4a, 0x4f, 0x73, 0x73, + 0x67, 0x66, 0x43, 0x58, 0x35, 0x2f, 0x62, 0x7a, 0x4d, 0x69, 0x4b, 0x71, + 0x72, 0x35, 0x71, 0x62, 0x2b, 0x46, 0x4a, 0x45, 0x4d, 0x77, 0x78, 0x31, + 0x34, 0x43, 0x37, 0x75, 0x38, 0x6a, 0x59, 0x6f, 0x67, 0x35, 0x6b, 0x56, + 0x2b, 0x71, 0x69, 0x39, 0x63, 0x4b, 0x70, 0x4d, 0x52, 0x58, 0x53, 0x0a, + 0x49, 0x47, 0x72, 0x73, 0x2f, 0x43, 0x49, 0x42, 0x4b, 0x4d, 0x2b, 0x47, + 0x75, 0x49, 0x41, 0x65, 0x71, 0x63, 0x77, 0x52, 0x70, 0x54, 0x7a, 0x79, + 0x46, 0x72, 0x4e, 0x48, 0x6e, 0x66, 0x7a, 0x53, 0x67, 0x43, 0x48, 0x45, + 0x79, 0x39, 0x42, 0x48, 0x63, 0x45, 0x47, 0x68, 0x79, 0x6f, 0x4d, 0x5a, + 0x43, 0x43, 0x78, 0x74, 0x38, 0x6c, 0x31, 0x33, 0x6e, 0x49, 0x6f, 0x55, + 0x45, 0x39, 0x51, 0x32, 0x0a, 0x48, 0x4a, 0x4c, 0x77, 0x35, 0x51, 0x59, + 0x33, 0x33, 0x4b, 0x62, 0x6d, 0x6b, 0x4a, 0x73, 0x34, 0x6a, 0x31, 0x78, + 0x72, 0x47, 0x30, 0x61, 0x47, 0x51, 0x30, 0x4a, 0x66, 0x50, 0x67, 0x45, + 0x48, 0x55, 0x31, 0x52, 0x64, 0x5a, 0x58, 0x33, 0x33, 0x69, 0x6e, 0x4f, + 0x68, 0x6d, 0x6c, 0x52, 0x61, 0x48, 0x79, 0x6c, 0x44, 0x46, 0x43, 0x66, + 0x43, 0x68, 0x51, 0x2b, 0x31, 0x69, 0x48, 0x73, 0x61, 0x0a, 0x4f, 0x35, + 0x53, 0x33, 0x48, 0x57, 0x43, 0x6e, 0x74, 0x5a, 0x7a, 0x6e, 0x4b, 0x57, + 0x6c, 0x58, 0x57, 0x70, 0x75, 0x54, 0x65, 0x6b, 0x4d, 0x77, 0x47, 0x77, + 0x50, 0x58, 0x59, 0x73, 0x68, 0x41, 0x70, 0x71, 0x72, 0x38, 0x5a, 0x4f, + 0x52, 0x4b, 0x31, 0x35, 0x46, 0x54, 0x41, 0x61, 0x67, 0x67, 0x69, 0x47, + 0x36, 0x63, 0x58, 0x30, 0x53, 0x35, 0x79, 0x32, 0x43, 0x42, 0x4e, 0x4f, + 0x78, 0x76, 0x0a, 0x30, 0x33, 0x33, 0x61, 0x53, 0x46, 0x2f, 0x72, 0x74, + 0x4a, 0x43, 0x38, 0x4c, 0x61, 0x6b, 0x63, 0x43, 0x36, 0x77, 0x63, 0x31, + 0x61, 0x4a, 0x6f, 0x49, 0x49, 0x41, 0x45, 0x31, 0x76, 0x79, 0x78, 0x6a, + 0x79, 0x2b, 0x37, 0x53, 0x6a, 0x45, 0x4e, 0x53, 0x6f, 0x59, 0x63, 0x36, + 0x2b, 0x49, 0x32, 0x4b, 0x53, 0x62, 0x31, 0x32, 0x74, 0x6a, 0x45, 0x38, + 0x6e, 0x56, 0x68, 0x7a, 0x33, 0x36, 0x75, 0x0a, 0x64, 0x6d, 0x4e, 0x4b, + 0x65, 0x6b, 0x42, 0x6c, 0x6b, 0x34, 0x66, 0x34, 0x48, 0x6f, 0x43, 0x4d, + 0x68, 0x75, 0x57, 0x47, 0x31, 0x6f, 0x38, 0x4f, 0x2f, 0x46, 0x4d, 0x73, + 0x59, 0x4f, 0x67, 0x57, 0x59, 0x52, 0x71, 0x69, 0x50, 0x6b, 0x4e, 0x37, + 0x7a, 0x54, 0x6c, 0x67, 0x56, 0x47, 0x72, 0x31, 0x38, 0x6f, 0x6b, 0x6d, + 0x41, 0x57, 0x69, 0x44, 0x53, 0x4b, 0x49, 0x7a, 0x36, 0x4d, 0x6b, 0x45, + 0x0a, 0x6b, 0x62, 0x49, 0x52, 0x4e, 0x42, 0x45, 0x2b, 0x36, 0x74, 0x42, + 0x44, 0x47, 0x52, 0x38, 0x44, 0x6b, 0x35, 0x41, 0x4d, 0x2f, 0x31, 0x45, + 0x39, 0x56, 0x2f, 0x52, 0x42, 0x62, 0x75, 0x48, 0x4c, 0x6f, 0x4c, 0x37, + 0x72, 0x79, 0x57, 0x50, 0x4e, 0x62, 0x63, 0x7a, 0x6b, 0x2b, 0x44, 0x61, + 0x71, 0x61, 0x4a, 0x33, 0x74, 0x76, 0x56, 0x32, 0x58, 0x63, 0x45, 0x51, + 0x4e, 0x74, 0x67, 0x34, 0x31, 0x0a, 0x33, 0x4f, 0x45, 0x4d, 0x58, 0x62, + 0x75, 0x67, 0x55, 0x5a, 0x54, 0x4c, 0x66, 0x68, 0x62, 0x72, 0x45, 0x53, + 0x2b, 0x6a, 0x6b, 0x6b, 0x58, 0x49, 0x54, 0x48, 0x48, 0x5a, 0x76, 0x4d, + 0x6d, 0x5a, 0x55, 0x6c, 0x64, 0x47, 0x4c, 0x31, 0x44, 0x50, 0x76, 0x54, + 0x56, 0x70, 0x39, 0x44, 0x30, 0x56, 0x7a, 0x67, 0x61, 0x6c, 0x4c, 0x41, + 0x38, 0x2b, 0x39, 0x6f, 0x47, 0x36, 0x6c, 0x4c, 0x76, 0x44, 0x0a, 0x75, + 0x37, 0x39, 0x6c, 0x65, 0x4e, 0x4b, 0x47, 0x65, 0x66, 0x39, 0x4a, 0x4f, + 0x78, 0x71, 0x44, 0x44, 0x50, 0x44, 0x65, 0x65, 0x4f, 0x7a, 0x49, 0x38, + 0x6b, 0x31, 0x4d, 0x47, 0x74, 0x36, 0x43, 0x4b, 0x66, 0x6a, 0x42, 0x57, + 0x74, 0x72, 0x74, 0x37, 0x75, 0x59, 0x6e, 0x58, 0x75, 0x68, 0x46, 0x30, + 0x4a, 0x30, 0x63, 0x55, 0x61, 0x68, 0x6f, 0x71, 0x30, 0x54, 0x6a, 0x30, + 0x49, 0x74, 0x71, 0x0a, 0x34, 0x2f, 0x67, 0x37, 0x75, 0x39, 0x78, 0x4e, + 0x31, 0x32, 0x54, 0x79, 0x55, 0x62, 0x37, 0x6d, 0x71, 0x71, 0x74, 0x61, + 0x36, 0x54, 0x48, 0x75, 0x42, 0x72, 0x78, 0x7a, 0x76, 0x78, 0x4e, 0x69, + 0x43, 0x70, 0x2f, 0x48, 0x75, 0x5a, 0x63, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x54, 0x2d, 0x54, 0x65, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x6c, + 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x4f, 0x3d, 0x54, 0x2d, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x73, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x2d, + 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, + 0x2d, 0x54, 0x65, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x20, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, + 0x73, 0x20, 0x33, 0x20, 0x4f, 0x3d, 0x54, 0x2d, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x73, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x73, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, + 0x47, 0x6d, 0x62, 0x48, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x2d, 0x53, 0x79, + 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x2d, 0x54, 0x65, 0x6c, 0x65, 0x53, + 0x65, 0x63, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x61, 0x3a, 0x66, 0x62, 0x3a, + 0x34, 0x30, 0x3a, 0x61, 0x38, 0x3a, 0x34, 0x65, 0x3a, 0x33, 0x39, 0x3a, + 0x39, 0x32, 0x3a, 0x38, 0x61, 0x3a, 0x31, 0x64, 0x3a, 0x66, 0x65, 0x3a, + 0x38, 0x65, 0x3a, 0x32, 0x66, 0x3a, 0x63, 0x34, 0x3a, 0x32, 0x37, 0x3a, + 0x65, 0x61, 0x3a, 0x65, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x35, 0x35, 0x3a, 0x61, 0x36, 0x3a, 0x37, 0x32, 0x3a, 0x33, + 0x65, 0x3a, 0x63, 0x62, 0x3a, 0x66, 0x32, 0x3a, 0x65, 0x63, 0x3a, 0x63, + 0x64, 0x3a, 0x63, 0x33, 0x3a, 0x32, 0x33, 0x3a, 0x37, 0x34, 0x3a, 0x37, + 0x30, 0x3a, 0x31, 0x39, 0x3a, 0x39, 0x64, 0x3a, 0x32, 0x61, 0x3a, 0x62, + 0x65, 0x3a, 0x31, 0x31, 0x3a, 0x65, 0x33, 0x3a, 0x38, 0x31, 0x3a, 0x64, + 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x66, 0x64, 0x3a, 0x37, 0x33, 0x3a, 0x64, 0x61, 0x3a, 0x64, 0x33, 0x3a, + 0x31, 0x63, 0x3a, 0x36, 0x34, 0x3a, 0x34, 0x66, 0x3a, 0x66, 0x31, 0x3a, + 0x62, 0x34, 0x3a, 0x33, 0x62, 0x3a, 0x65, 0x66, 0x3a, 0x30, 0x63, 0x3a, + 0x63, 0x64, 0x3a, 0x64, 0x61, 0x3a, 0x39, 0x36, 0x3a, 0x37, 0x31, 0x3a, + 0x30, 0x62, 0x3a, 0x39, 0x63, 0x3a, 0x64, 0x39, 0x3a, 0x38, 0x37, 0x3a, + 0x35, 0x65, 0x3a, 0x63, 0x61, 0x3a, 0x37, 0x65, 0x3a, 0x33, 0x31, 0x3a, + 0x37, 0x30, 0x3a, 0x37, 0x61, 0x3a, 0x66, 0x33, 0x3a, 0x65, 0x39, 0x3a, + 0x36, 0x64, 0x3a, 0x35, 0x32, 0x3a, 0x32, 0x62, 0x3a, 0x62, 0x64, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x77, 0x7a, 0x43, 0x43, + 0x41, 0x71, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, + 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, + 0x67, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x52, 0x45, 0x55, 0x78, 0x0a, 0x4b, 0x7a, 0x41, + 0x70, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x49, 0x6c, 0x51, + 0x74, 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, + 0x46, 0x62, 0x6e, 0x52, 0x6c, 0x63, 0x6e, 0x42, 0x79, 0x61, 0x58, 0x4e, + 0x6c, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, + 0x7a, 0x49, 0x45, 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, 0x48, 0x7a, 0x41, + 0x64, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x4d, 0x46, 0x6c, + 0x51, 0x74, 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, + 0x42, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x57, + 0x35, 0x30, 0x5a, 0x58, 0x49, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x48, 0x46, 0x51, 0x74, 0x56, 0x47, + 0x56, 0x73, 0x5a, 0x56, 0x4e, 0x6c, 0x0a, 0x59, 0x79, 0x42, 0x48, 0x62, + 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, + 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x4d, 0x77, 0x48, + 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x67, 0x78, 0x4d, 0x44, 0x41, 0x78, 0x4d, + 0x54, 0x41, 0x79, 0x4f, 0x54, 0x55, 0x32, 0x57, 0x68, 0x63, 0x4e, 0x4d, + 0x7a, 0x4d, 0x78, 0x4d, 0x44, 0x41, 0x78, 0x4d, 0x6a, 0x4d, 0x31, 0x0a, + 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x67, 0x6a, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x52, 0x45, 0x55, 0x78, 0x4b, 0x7a, 0x41, 0x70, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x6f, 0x4d, 0x49, 0x6c, 0x51, 0x74, 0x55, 0x33, 0x6c, 0x7a, + 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, 0x46, 0x62, 0x6e, 0x52, 0x6c, + 0x63, 0x6e, 0x42, 0x79, 0x0a, 0x61, 0x58, 0x4e, 0x6c, 0x49, 0x46, 0x4e, + 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x49, 0x45, 0x64, + 0x74, 0x59, 0x6b, 0x67, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x73, 0x4d, 0x46, 0x6c, 0x51, 0x74, 0x55, 0x33, 0x6c, + 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, 0x55, 0x63, 0x6e, 0x56, + 0x7a, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x57, 0x35, 0x30, 0x0a, 0x5a, 0x58, + 0x49, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x4d, 0x4d, 0x48, 0x46, 0x51, 0x74, 0x56, 0x47, 0x56, 0x73, 0x5a, 0x56, + 0x4e, 0x6c, 0x59, 0x79, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x78, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, + 0x4e, 0x7a, 0x49, 0x44, 0x4d, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, + 0x30, 0x47, 0x0a, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, + 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, + 0x51, 0x43, 0x39, 0x64, 0x5a, 0x50, 0x77, 0x59, 0x69, 0x4a, 0x76, 0x4a, + 0x4b, 0x37, 0x67, 0x65, 0x6e, 0x61, 0x73, 0x66, 0x62, 0x33, 0x5a, 0x4a, + 0x4e, 0x57, 0x34, 0x74, 0x2f, 0x7a, 0x4e, 0x0a, 0x38, 0x45, 0x4c, 0x67, + 0x36, 0x33, 0x69, 0x49, 0x56, 0x6c, 0x36, 0x62, 0x6d, 0x6c, 0x51, 0x64, + 0x54, 0x51, 0x79, 0x4b, 0x39, 0x74, 0x50, 0x50, 0x63, 0x50, 0x52, 0x53, + 0x74, 0x64, 0x69, 0x54, 0x42, 0x4f, 0x4e, 0x47, 0x68, 0x6e, 0x46, 0x42, + 0x53, 0x69, 0x76, 0x77, 0x4b, 0x69, 0x78, 0x56, 0x41, 0x39, 0x5a, 0x49, + 0x77, 0x2b, 0x41, 0x35, 0x4f, 0x4f, 0x33, 0x79, 0x58, 0x44, 0x77, 0x2f, + 0x0a, 0x52, 0x4c, 0x79, 0x54, 0x50, 0x57, 0x47, 0x72, 0x54, 0x73, 0x30, + 0x4e, 0x76, 0x76, 0x41, 0x67, 0x4a, 0x31, 0x67, 0x4f, 0x52, 0x48, 0x38, + 0x45, 0x47, 0x6f, 0x65, 0x6c, 0x31, 0x35, 0x59, 0x55, 0x4e, 0x70, 0x44, + 0x51, 0x53, 0x58, 0x75, 0x68, 0x64, 0x66, 0x73, 0x61, 0x61, 0x33, 0x4f, + 0x78, 0x2b, 0x4d, 0x36, 0x70, 0x43, 0x53, 0x7a, 0x79, 0x55, 0x39, 0x58, + 0x44, 0x46, 0x45, 0x53, 0x34, 0x0a, 0x68, 0x71, 0x58, 0x32, 0x69, 0x79, + 0x73, 0x35, 0x32, 0x71, 0x4d, 0x7a, 0x56, 0x4e, 0x6e, 0x36, 0x63, 0x68, + 0x72, 0x33, 0x49, 0x68, 0x55, 0x63, 0x69, 0x4a, 0x46, 0x72, 0x66, 0x32, + 0x62, 0x6c, 0x77, 0x32, 0x71, 0x41, 0x73, 0x43, 0x54, 0x7a, 0x33, 0x34, + 0x5a, 0x46, 0x69, 0x50, 0x30, 0x5a, 0x66, 0x33, 0x57, 0x48, 0x48, 0x78, + 0x2b, 0x78, 0x47, 0x77, 0x70, 0x7a, 0x4a, 0x46, 0x75, 0x35, 0x0a, 0x5a, + 0x65, 0x41, 0x73, 0x56, 0x4d, 0x68, 0x67, 0x30, 0x32, 0x59, 0x58, 0x50, + 0x2b, 0x48, 0x4d, 0x56, 0x44, 0x4e, 0x7a, 0x6b, 0x51, 0x49, 0x36, 0x70, + 0x6e, 0x39, 0x37, 0x64, 0x6a, 0x6d, 0x69, 0x48, 0x35, 0x61, 0x32, 0x4f, + 0x4b, 0x36, 0x31, 0x79, 0x4a, 0x4e, 0x30, 0x48, 0x5a, 0x36, 0x35, 0x74, + 0x4f, 0x56, 0x67, 0x6e, 0x53, 0x39, 0x57, 0x30, 0x65, 0x44, 0x72, 0x58, + 0x6c, 0x74, 0x4d, 0x0a, 0x45, 0x6e, 0x41, 0x4d, 0x62, 0x45, 0x51, 0x67, + 0x71, 0x78, 0x48, 0x59, 0x39, 0x42, 0x6e, 0x32, 0x30, 0x70, 0x78, 0x53, + 0x4e, 0x2b, 0x66, 0x36, 0x74, 0x73, 0x49, 0x78, 0x4f, 0x30, 0x72, 0x55, + 0x46, 0x4a, 0x6d, 0x74, 0x78, 0x78, 0x72, 0x31, 0x58, 0x56, 0x2f, 0x36, + 0x42, 0x37, 0x68, 0x38, 0x44, 0x52, 0x2f, 0x57, 0x67, 0x78, 0x36, 0x7a, + 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x0a, 0x51, 0x6a, 0x42, + 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, 0x30, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, + 0x31, 0x0a, 0x41, 0x2f, 0x64, 0x32, 0x4f, 0x32, 0x47, 0x43, 0x61, 0x68, + 0x4b, 0x71, 0x47, 0x46, 0x50, 0x72, 0x41, 0x79, 0x47, 0x55, 0x76, 0x2f, + 0x37, 0x4f, 0x79, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, + 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x56, 0x6a, 0x33, 0x76, 0x6c, 0x4e, + 0x57, 0x39, 0x32, 0x6e, 0x4f, 0x79, 0x0a, 0x57, 0x4c, 0x36, 0x75, 0x6b, + 0x4b, 0x32, 0x59, 0x4a, 0x35, 0x66, 0x2b, 0x41, 0x62, 0x47, 0x77, 0x55, + 0x67, 0x43, 0x34, 0x54, 0x65, 0x51, 0x62, 0x49, 0x58, 0x51, 0x62, 0x66, + 0x73, 0x44, 0x75, 0x58, 0x6d, 0x6b, 0x71, 0x4a, 0x61, 0x39, 0x63, 0x31, + 0x68, 0x33, 0x61, 0x30, 0x6e, 0x6e, 0x4a, 0x38, 0x35, 0x63, 0x70, 0x34, + 0x49, 0x61, 0x48, 0x33, 0x67, 0x52, 0x5a, 0x44, 0x2f, 0x46, 0x5a, 0x0a, + 0x31, 0x47, 0x53, 0x46, 0x53, 0x35, 0x6d, 0x76, 0x4a, 0x51, 0x51, 0x65, + 0x79, 0x55, 0x61, 0x70, 0x6c, 0x39, 0x36, 0x43, 0x73, 0x68, 0x74, 0x77, + 0x6e, 0x35, 0x7a, 0x32, 0x72, 0x33, 0x45, 0x78, 0x33, 0x58, 0x73, 0x46, + 0x70, 0x53, 0x7a, 0x54, 0x75, 0x63, 0x70, 0x48, 0x39, 0x73, 0x72, 0x79, + 0x39, 0x75, 0x65, 0x74, 0x75, 0x55, 0x67, 0x2f, 0x76, 0x42, 0x61, 0x33, + 0x77, 0x57, 0x33, 0x30, 0x0a, 0x36, 0x67, 0x6d, 0x76, 0x37, 0x50, 0x4f, + 0x31, 0x35, 0x77, 0x57, 0x65, 0x70, 0x68, 0x36, 0x4b, 0x55, 0x31, 0x48, + 0x57, 0x6b, 0x34, 0x48, 0x4d, 0x64, 0x4a, 0x50, 0x32, 0x75, 0x64, 0x71, + 0x6d, 0x4a, 0x51, 0x56, 0x30, 0x65, 0x56, 0x70, 0x2b, 0x51, 0x44, 0x36, + 0x43, 0x53, 0x79, 0x59, 0x52, 0x4d, 0x47, 0x37, 0x68, 0x50, 0x30, 0x48, + 0x48, 0x52, 0x77, 0x41, 0x31, 0x31, 0x66, 0x58, 0x54, 0x0a, 0x39, 0x31, + 0x51, 0x2b, 0x67, 0x54, 0x33, 0x61, 0x53, 0x57, 0x71, 0x61, 0x73, 0x2b, + 0x38, 0x51, 0x50, 0x65, 0x62, 0x72, 0x62, 0x39, 0x48, 0x49, 0x49, 0x6b, + 0x66, 0x4c, 0x7a, 0x4d, 0x38, 0x42, 0x4d, 0x5a, 0x4c, 0x5a, 0x47, 0x4f, + 0x4d, 0x69, 0x76, 0x67, 0x6b, 0x65, 0x47, 0x6a, 0x35, 0x61, 0x73, 0x75, + 0x52, 0x72, 0x44, 0x46, 0x52, 0x36, 0x66, 0x55, 0x4e, 0x4f, 0x75, 0x49, + 0x6d, 0x6c, 0x0a, 0x65, 0x39, 0x65, 0x69, 0x50, 0x5a, 0x61, 0x47, 0x7a, + 0x50, 0x49, 0x6d, 0x4e, 0x43, 0x31, 0x71, 0x6b, 0x70, 0x32, 0x61, 0x47, + 0x74, 0x41, 0x77, 0x34, 0x6c, 0x31, 0x4f, 0x42, 0x4c, 0x42, 0x66, 0x69, + 0x79, 0x42, 0x2b, 0x64, 0x38, 0x45, 0x39, 0x6c, 0x59, 0x4c, 0x52, 0x52, + 0x70, 0x6f, 0x37, 0x50, 0x48, 0x69, 0x34, 0x62, 0x36, 0x48, 0x51, 0x44, + 0x57, 0x53, 0x69, 0x65, 0x42, 0x34, 0x70, 0x0a, 0x54, 0x70, 0x50, 0x44, + 0x70, 0x46, 0x51, 0x55, 0x57, 0x77, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x45, 0x45, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x65, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x41, + 0x53, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x74, 0x73, 0x65, + 0x65, 0x72, 0x69, 0x6d, 0x69, 0x73, 0x6b, 0x65, 0x73, 0x6b, 0x75, 0x73, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x45, 0x45, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x74, + 0x72, 0x65, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, + 0x3d, 0x41, 0x53, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x74, + 0x73, 0x65, 0x65, 0x72, 0x69, 0x6d, 0x69, 0x73, 0x6b, 0x65, 0x73, 0x6b, + 0x75, 0x73, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x45, 0x45, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x72, 0x65, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x31, 0x32, 0x33, + 0x32, 0x34, 0x38, 0x32, 0x38, 0x36, 0x37, 0x36, 0x32, 0x30, 0x30, 0x32, + 0x39, 0x31, 0x38, 0x37, 0x31, 0x39, 0x32, 0x36, 0x34, 0x33, 0x31, 0x38, + 0x38, 0x38, 0x34, 0x39, 0x34, 0x39, 0x34, 0x35, 0x38, 0x36, 0x36, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x33, 0x3a, 0x35, 0x65, + 0x3a, 0x38, 0x38, 0x3a, 0x64, 0x34, 0x3a, 0x37, 0x64, 0x3a, 0x31, 0x61, + 0x3a, 0x34, 0x61, 0x3a, 0x37, 0x65, 0x3a, 0x66, 0x64, 0x3a, 0x38, 0x34, + 0x3a, 0x32, 0x65, 0x3a, 0x35, 0x32, 0x3a, 0x65, 0x62, 0x3a, 0x30, 0x31, + 0x3a, 0x64, 0x34, 0x3a, 0x36, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x63, 0x39, 0x3a, 0x61, 0x38, 0x3a, 0x62, 0x39, 0x3a, + 0x65, 0x37, 0x3a, 0x35, 0x35, 0x3a, 0x38, 0x30, 0x3a, 0x35, 0x65, 0x3a, + 0x35, 0x38, 0x3a, 0x65, 0x33, 0x3a, 0x35, 0x33, 0x3a, 0x37, 0x37, 0x3a, + 0x61, 0x37, 0x3a, 0x32, 0x35, 0x3a, 0x65, 0x62, 0x3a, 0x61, 0x66, 0x3a, + 0x63, 0x33, 0x3a, 0x37, 0x62, 0x3a, 0x32, 0x37, 0x3a, 0x63, 0x63, 0x3a, + 0x64, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x33, 0x65, 0x3a, 0x38, 0x34, 0x3a, 0x62, 0x61, 0x3a, 0x34, 0x33, + 0x3a, 0x34, 0x32, 0x3a, 0x39, 0x30, 0x3a, 0x38, 0x35, 0x3a, 0x31, 0x36, + 0x3a, 0x65, 0x37, 0x3a, 0x37, 0x35, 0x3a, 0x37, 0x33, 0x3a, 0x63, 0x30, + 0x3a, 0x39, 0x39, 0x3a, 0x32, 0x66, 0x3a, 0x30, 0x39, 0x3a, 0x37, 0x39, + 0x3a, 0x63, 0x61, 0x3a, 0x30, 0x38, 0x3a, 0x34, 0x65, 0x3a, 0x34, 0x36, + 0x3a, 0x38, 0x35, 0x3a, 0x36, 0x38, 0x3a, 0x31, 0x66, 0x3a, 0x66, 0x31, + 0x3a, 0x39, 0x35, 0x3a, 0x63, 0x63, 0x3a, 0x62, 0x61, 0x3a, 0x38, 0x61, + 0x3a, 0x32, 0x32, 0x3a, 0x39, 0x62, 0x3a, 0x38, 0x61, 0x3a, 0x37, 0x36, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x41, 0x7a, 0x43, + 0x43, 0x41, 0x75, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x51, 0x56, 0x49, 0x44, 0x35, 0x6f, 0x48, 0x50, 0x74, 0x50, 0x77, 0x42, + 0x4d, 0x79, 0x6f, 0x6e, 0x59, 0x34, 0x33, 0x48, 0x6d, 0x53, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x55, 0x46, 0x41, 0x44, 0x42, 0x31, 0x0a, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x46, 0x52, 0x54, 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x67, 0x77, 0x5a, 0x51, 0x56, 0x4d, 0x67, 0x55, 0x32, + 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x58, 0x52, 0x7a, 0x5a, 0x57, + 0x56, 0x79, 0x61, 0x57, 0x31, 0x70, 0x63, 0x32, 0x74, 0x6c, 0x63, 0x32, + 0x74, 0x31, 0x0a, 0x63, 0x7a, 0x45, 0x6f, 0x4d, 0x43, 0x59, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x66, 0x52, 0x55, 0x55, 0x67, 0x51, + 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, + 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x44, 0x5a, 0x57, 0x35, 0x30, 0x63, + 0x6d, 0x55, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, + 0x54, 0x45, 0x59, 0x4d, 0x42, 0x59, 0x47, 0x0a, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x4a, 0x41, 0x52, 0x59, 0x4a, + 0x63, 0x47, 0x74, 0x70, 0x51, 0x48, 0x4e, 0x72, 0x4c, 0x6d, 0x56, 0x6c, + 0x4d, 0x43, 0x49, 0x59, 0x44, 0x7a, 0x49, 0x77, 0x4d, 0x54, 0x41, 0x78, + 0x4d, 0x44, 0x4d, 0x77, 0x4d, 0x54, 0x41, 0x78, 0x4d, 0x44, 0x4d, 0x77, + 0x57, 0x68, 0x67, 0x50, 0x4d, 0x6a, 0x41, 0x7a, 0x4d, 0x44, 0x45, 0x79, + 0x0a, 0x4d, 0x54, 0x63, 0x79, 0x4d, 0x7a, 0x55, 0x35, 0x4e, 0x54, 0x6c, + 0x61, 0x4d, 0x48, 0x55, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x56, 0x46, 0x4d, 0x53, 0x49, + 0x77, 0x49, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x6c, + 0x42, 0x55, 0x79, 0x42, 0x54, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x64, 0x48, 0x4e, 0x6c, 0x0a, 0x5a, 0x58, 0x4a, 0x70, 0x62, 0x57, + 0x6c, 0x7a, 0x61, 0x32, 0x56, 0x7a, 0x61, 0x33, 0x56, 0x7a, 0x4d, 0x53, + 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, + 0x39, 0x46, 0x52, 0x53, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, + 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, + 0x4e, 0x6c, 0x62, 0x6e, 0x52, 0x79, 0x5a, 0x53, 0x42, 0x53, 0x0a, 0x62, + 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x52, 0x67, 0x77, 0x46, + 0x67, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x6b, 0x42, 0x46, 0x67, 0x6c, 0x77, 0x61, 0x32, 0x6c, 0x41, 0x63, + 0x32, 0x73, 0x75, 0x5a, 0x57, 0x55, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x0a, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, + 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, + 0x41, 0x51, 0x44, 0x49, 0x49, 0x4d, 0x44, 0x73, 0x34, 0x4d, 0x56, 0x4c, + 0x71, 0x77, 0x64, 0x34, 0x6c, 0x66, 0x4e, 0x45, 0x37, 0x76, 0x73, 0x4c, + 0x44, 0x50, 0x39, 0x30, 0x6a, 0x6d, 0x47, 0x37, 0x73, 0x57, 0x4c, 0x71, + 0x49, 0x39, 0x69, 0x72, 0x6f, 0x57, 0x55, 0x79, 0x0a, 0x65, 0x75, 0x75, + 0x4f, 0x46, 0x30, 0x2b, 0x57, 0x32, 0x41, 0x70, 0x37, 0x6b, 0x61, 0x4a, + 0x6a, 0x62, 0x4d, 0x65, 0x4d, 0x54, 0x43, 0x35, 0x35, 0x76, 0x36, 0x6b, + 0x46, 0x2f, 0x47, 0x6c, 0x63, 0x6c, 0x59, 0x31, 0x69, 0x2b, 0x62, 0x6c, + 0x77, 0x37, 0x63, 0x4e, 0x52, 0x66, 0x64, 0x43, 0x54, 0x35, 0x6d, 0x7a, + 0x72, 0x4d, 0x45, 0x76, 0x68, 0x76, 0x48, 0x32, 0x2f, 0x55, 0x70, 0x76, + 0x4f, 0x0a, 0x62, 0x6e, 0x74, 0x6c, 0x38, 0x6a, 0x69, 0x78, 0x77, 0x4b, + 0x49, 0x79, 0x37, 0x32, 0x4b, 0x79, 0x61, 0x4f, 0x42, 0x68, 0x55, 0x38, + 0x45, 0x32, 0x6c, 0x66, 0x2f, 0x73, 0x6c, 0x4c, 0x6f, 0x32, 0x72, 0x70, + 0x77, 0x63, 0x70, 0x7a, 0x49, 0x50, 0x35, 0x58, 0x79, 0x30, 0x78, 0x6d, + 0x39, 0x30, 0x2f, 0x58, 0x73, 0x59, 0x36, 0x4b, 0x78, 0x58, 0x37, 0x51, + 0x59, 0x67, 0x53, 0x7a, 0x49, 0x77, 0x0a, 0x57, 0x46, 0x76, 0x39, 0x7a, + 0x61, 0x6a, 0x6d, 0x6f, 0x66, 0x78, 0x77, 0x76, 0x49, 0x36, 0x53, 0x63, + 0x39, 0x75, 0x58, 0x70, 0x33, 0x77, 0x68, 0x72, 0x6a, 0x33, 0x42, 0x39, + 0x55, 0x69, 0x48, 0x62, 0x43, 0x65, 0x39, 0x6e, 0x79, 0x56, 0x30, 0x67, + 0x56, 0x57, 0x77, 0x39, 0x33, 0x58, 0x32, 0x50, 0x61, 0x52, 0x6b, 0x61, + 0x39, 0x5a, 0x50, 0x35, 0x38, 0x35, 0x41, 0x72, 0x51, 0x2f, 0x64, 0x0a, + 0x4d, 0x74, 0x4f, 0x38, 0x69, 0x68, 0x4a, 0x54, 0x6d, 0x4d, 0x6d, 0x4a, + 0x2b, 0x78, 0x41, 0x64, 0x54, 0x58, 0x37, 0x4e, 0x66, 0x68, 0x39, 0x57, + 0x44, 0x53, 0x46, 0x77, 0x68, 0x66, 0x59, 0x67, 0x67, 0x78, 0x2f, 0x32, + 0x75, 0x68, 0x38, 0x45, 0x6a, 0x2b, 0x70, 0x33, 0x69, 0x44, 0x58, 0x45, + 0x2f, 0x2b, 0x70, 0x4f, 0x6f, 0x59, 0x74, 0x4e, 0x50, 0x32, 0x4d, 0x62, + 0x52, 0x4d, 0x4e, 0x45, 0x0a, 0x31, 0x43, 0x56, 0x32, 0x79, 0x72, 0x65, + 0x4e, 0x31, 0x78, 0x35, 0x4b, 0x5a, 0x6d, 0x54, 0x4e, 0x58, 0x4d, 0x57, + 0x63, 0x67, 0x2b, 0x48, 0x43, 0x43, 0x49, 0x69, 0x61, 0x37, 0x45, 0x36, + 0x6a, 0x38, 0x54, 0x34, 0x63, 0x4c, 0x4e, 0x6c, 0x73, 0x48, 0x61, 0x46, + 0x4c, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x59, 0x6f, + 0x77, 0x67, 0x59, 0x63, 0x77, 0x44, 0x77, 0x59, 0x44, 0x0a, 0x56, 0x52, + 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, + 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, + 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, + 0x59, 0x45, 0x46, 0x42, 0x4c, 0x79, 0x57, 0x6a, 0x37, 0x71, 0x56, 0x68, + 0x79, 0x2f, 0x0a, 0x7a, 0x51, 0x61, 0x73, 0x38, 0x66, 0x45, 0x6c, 0x79, + 0x61, 0x6c, 0x4c, 0x31, 0x42, 0x53, 0x5a, 0x4d, 0x45, 0x55, 0x47, 0x41, + 0x31, 0x55, 0x64, 0x4a, 0x51, 0x51, 0x2b, 0x4d, 0x44, 0x77, 0x47, 0x43, + 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x4d, 0x43, 0x42, + 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44, 0x41, + 0x51, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, 0x0a, 0x42, 0x51, 0x55, 0x48, + 0x41, 0x77, 0x4d, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, + 0x42, 0x77, 0x4d, 0x45, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, + 0x42, 0x51, 0x63, 0x44, 0x43, 0x41, 0x59, 0x49, 0x4b, 0x77, 0x59, 0x42, + 0x42, 0x51, 0x55, 0x48, 0x41, 0x77, 0x6b, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, + 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x48, 0x76, + 0x32, 0x35, 0x4d, 0x41, 0x4e, 0x71, 0x68, 0x6c, 0x48, 0x74, 0x30, 0x31, + 0x58, 0x6f, 0x2f, 0x36, 0x74, 0x75, 0x37, 0x46, 0x71, 0x31, 0x51, 0x2b, + 0x65, 0x32, 0x2b, 0x52, 0x6a, 0x78, 0x59, 0x36, 0x68, 0x55, 0x46, 0x61, + 0x54, 0x6c, 0x72, 0x67, 0x34, 0x77, 0x43, 0x51, 0x69, 0x5a, 0x72, 0x78, + 0x54, 0x46, 0x47, 0x47, 0x56, 0x0a, 0x76, 0x39, 0x44, 0x48, 0x4b, 0x70, + 0x59, 0x35, 0x50, 0x33, 0x30, 0x6f, 0x73, 0x78, 0x42, 0x41, 0x49, 0x57, + 0x72, 0x45, 0x72, 0x37, 0x42, 0x53, 0x64, 0x78, 0x6a, 0x68, 0x6c, 0x74, + 0x68, 0x57, 0x58, 0x65, 0x50, 0x64, 0x4e, 0x6c, 0x34, 0x64, 0x70, 0x31, + 0x42, 0x55, 0x6f, 0x4d, 0x55, 0x71, 0x35, 0x4b, 0x71, 0x4d, 0x6c, 0x49, + 0x70, 0x50, 0x6e, 0x54, 0x58, 0x2f, 0x64, 0x71, 0x51, 0x47, 0x0a, 0x45, + 0x35, 0x47, 0x69, 0x6f, 0x6e, 0x30, 0x41, 0x52, 0x44, 0x39, 0x56, 0x30, + 0x34, 0x49, 0x38, 0x47, 0x74, 0x56, 0x62, 0x76, 0x46, 0x5a, 0x4d, 0x49, + 0x69, 0x35, 0x47, 0x51, 0x34, 0x6f, 0x6b, 0x51, 0x43, 0x33, 0x7a, 0x45, + 0x72, 0x67, 0x37, 0x63, 0x42, 0x71, 0x6b, 0x6c, 0x72, 0x6b, 0x61, 0x72, + 0x34, 0x64, 0x42, 0x47, 0x6d, 0x6f, 0x59, 0x44, 0x51, 0x5a, 0x50, 0x78, + 0x7a, 0x35, 0x75, 0x0a, 0x75, 0x53, 0x6c, 0x4e, 0x44, 0x55, 0x6d, 0x4a, + 0x45, 0x59, 0x63, 0x79, 0x57, 0x2b, 0x5a, 0x4c, 0x42, 0x4d, 0x6a, 0x6b, + 0x58, 0x4f, 0x5a, 0x30, 0x63, 0x35, 0x52, 0x64, 0x46, 0x70, 0x67, 0x54, + 0x6c, 0x66, 0x37, 0x37, 0x32, 0x37, 0x46, 0x45, 0x35, 0x54, 0x70, 0x77, + 0x72, 0x44, 0x64, 0x72, 0x35, 0x72, 0x4d, 0x7a, 0x63, 0x69, 0x6a, 0x4a, + 0x73, 0x31, 0x65, 0x67, 0x39, 0x67, 0x49, 0x57, 0x0a, 0x69, 0x41, 0x59, + 0x4c, 0x74, 0x71, 0x5a, 0x4c, 0x49, 0x43, 0x6a, 0x55, 0x33, 0x6a, 0x32, + 0x4c, 0x72, 0x54, 0x63, 0x46, 0x55, 0x33, 0x54, 0x2b, 0x62, 0x73, 0x79, + 0x38, 0x51, 0x78, 0x64, 0x78, 0x58, 0x76, 0x6e, 0x46, 0x7a, 0x42, 0x71, + 0x70, 0x59, 0x65, 0x37, 0x33, 0x64, 0x67, 0x7a, 0x7a, 0x63, 0x76, 0x52, + 0x79, 0x72, 0x63, 0x39, 0x79, 0x41, 0x6a, 0x59, 0x48, 0x52, 0x38, 0x2f, + 0x76, 0x0a, 0x47, 0x56, 0x43, 0x4a, 0x59, 0x4d, 0x7a, 0x70, 0x4a, 0x4a, + 0x55, 0x50, 0x77, 0x73, 0x73, 0x64, 0x38, 0x6d, 0x39, 0x32, 0x6b, 0x4d, + 0x66, 0x4d, 0x64, 0x63, 0x47, 0x57, 0x78, 0x5a, 0x30, 0x3d, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x44, 0x2d, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, + 0x43, 0x41, 0x20, 0x32, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x4f, 0x3d, + 0x44, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6d, 0x62, 0x48, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x44, 0x2d, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, + 0x43, 0x41, 0x20, 0x32, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x4f, 0x3d, + 0x44, 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6d, 0x62, 0x48, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, + 0x2d, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x43, 0x41, 0x20, 0x32, + 0x20, 0x32, 0x30, 0x30, 0x39, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x32, 0x33, 0x36, 0x30, 0x33, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x64, 0x3a, 0x65, 0x30, + 0x3a, 0x32, 0x35, 0x3a, 0x36, 0x39, 0x3a, 0x38, 0x64, 0x3a, 0x34, 0x37, + 0x3a, 0x61, 0x63, 0x3a, 0x39, 0x63, 0x3a, 0x38, 0x39, 0x3a, 0x33, 0x35, + 0x3a, 0x39, 0x30, 0x3a, 0x66, 0x37, 0x3a, 0x66, 0x64, 0x3a, 0x35, 0x31, + 0x3a, 0x33, 0x64, 0x3a, 0x32, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x35, 0x38, 0x3a, 0x65, 0x38, 0x3a, 0x61, 0x62, 0x3a, + 0x62, 0x30, 0x3a, 0x33, 0x36, 0x3a, 0x31, 0x35, 0x3a, 0x33, 0x33, 0x3a, + 0x66, 0x62, 0x3a, 0x38, 0x30, 0x3a, 0x66, 0x37, 0x3a, 0x39, 0x62, 0x3a, + 0x31, 0x62, 0x3a, 0x36, 0x64, 0x3a, 0x32, 0x39, 0x3a, 0x64, 0x33, 0x3a, + 0x66, 0x66, 0x3a, 0x38, 0x64, 0x3a, 0x35, 0x66, 0x3a, 0x30, 0x30, 0x3a, + 0x66, 0x30, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x34, 0x39, 0x3a, 0x65, 0x37, 0x3a, 0x61, 0x34, 0x3a, 0x34, 0x32, + 0x3a, 0x61, 0x63, 0x3a, 0x66, 0x30, 0x3a, 0x65, 0x61, 0x3a, 0x36, 0x32, + 0x3a, 0x38, 0x37, 0x3a, 0x30, 0x35, 0x3a, 0x30, 0x30, 0x3a, 0x35, 0x34, + 0x3a, 0x62, 0x35, 0x3a, 0x32, 0x35, 0x3a, 0x36, 0x34, 0x3a, 0x62, 0x36, + 0x3a, 0x35, 0x30, 0x3a, 0x65, 0x34, 0x3a, 0x66, 0x34, 0x3a, 0x39, 0x65, + 0x3a, 0x34, 0x32, 0x3a, 0x65, 0x33, 0x3a, 0x34, 0x38, 0x3a, 0x64, 0x36, + 0x3a, 0x61, 0x61, 0x3a, 0x33, 0x38, 0x3a, 0x65, 0x30, 0x3a, 0x33, 0x39, + 0x3a, 0x65, 0x39, 0x3a, 0x35, 0x37, 0x3a, 0x62, 0x31, 0x3a, 0x63, 0x31, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x4d, 0x7a, 0x43, + 0x43, 0x41, 0x78, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x44, 0x43, 0x59, 0x50, 0x7a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, + 0x41, 0x4d, 0x45, 0x30, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x52, 0x46, 0x0a, 0x4d, 0x52, + 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, + 0x78, 0x45, 0x4c, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, + 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, 0x4a, 0x7a, 0x41, 0x6c, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x48, 0x6b, 0x51, 0x74, 0x56, 0x46, + 0x4a, 0x56, 0x55, 0x31, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, + 0x42, 0x44, 0x0a, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x41, 0x7a, 0x49, + 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4f, + 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x54, 0x45, 0x78, 0x4d, + 0x44, 0x55, 0x77, 0x4f, 0x44, 0x4d, 0x31, 0x4e, 0x54, 0x68, 0x61, 0x46, + 0x77, 0x30, 0x79, 0x4f, 0x54, 0x45, 0x78, 0x4d, 0x44, 0x55, 0x77, 0x4f, + 0x44, 0x4d, 0x31, 0x4e, 0x54, 0x68, 0x61, 0x0a, 0x4d, 0x45, 0x30, 0x78, + 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, + 0x41, 0x6b, 0x52, 0x46, 0x4d, 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, 0x78, 0x45, 0x4c, 0x56, 0x52, 0x79, + 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, + 0x4a, 0x7a, 0x41, 0x6c, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, + 0x0a, 0x48, 0x6b, 0x51, 0x74, 0x56, 0x46, 0x4a, 0x56, 0x55, 0x31, 0x51, + 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x62, 0x47, 0x46, + 0x7a, 0x63, 0x79, 0x41, 0x7a, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, + 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4f, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x42, 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x45, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, + 0x45, 0x42, 0x41, 0x4e, 0x4f, 0x79, 0x53, 0x73, 0x39, 0x36, 0x52, 0x2b, + 0x39, 0x31, 0x6d, 0x79, 0x50, 0x36, 0x4f, 0x69, 0x2f, 0x57, 0x55, 0x45, + 0x57, 0x4a, 0x4e, 0x54, 0x72, 0x47, 0x61, 0x39, 0x76, 0x2b, 0x32, 0x77, + 0x42, 0x6f, 0x71, 0x4f, 0x41, 0x44, 0x45, 0x52, 0x30, 0x33, 0x0a, 0x55, + 0x41, 0x69, 0x66, 0x54, 0x55, 0x70, 0x6f, 0x6c, 0x44, 0x57, 0x7a, 0x55, + 0x39, 0x47, 0x55, 0x59, 0x36, 0x63, 0x67, 0x56, 0x71, 0x2f, 0x65, 0x55, + 0x58, 0x6a, 0x73, 0x4b, 0x6a, 0x33, 0x7a, 0x53, 0x45, 0x68, 0x51, 0x50, + 0x67, 0x72, 0x66, 0x52, 0x6c, 0x57, 0x4c, 0x4a, 0x32, 0x33, 0x44, 0x45, + 0x45, 0x30, 0x4e, 0x6b, 0x56, 0x4a, 0x44, 0x32, 0x49, 0x66, 0x67, 0x58, + 0x55, 0x34, 0x32, 0x0a, 0x74, 0x53, 0x48, 0x4b, 0x58, 0x7a, 0x6c, 0x41, + 0x42, 0x46, 0x39, 0x62, 0x66, 0x73, 0x79, 0x6a, 0x78, 0x69, 0x75, 0x70, + 0x51, 0x42, 0x37, 0x5a, 0x4e, 0x6f, 0x54, 0x57, 0x53, 0x50, 0x4f, 0x53, + 0x48, 0x6a, 0x52, 0x47, 0x49, 0x43, 0x54, 0x42, 0x70, 0x46, 0x47, 0x4f, + 0x53, 0x68, 0x72, 0x76, 0x55, 0x44, 0x39, 0x70, 0x58, 0x52, 0x6c, 0x2f, + 0x52, 0x63, 0x50, 0x48, 0x41, 0x59, 0x39, 0x52, 0x0a, 0x79, 0x53, 0x50, + 0x6f, 0x63, 0x71, 0x36, 0x30, 0x76, 0x46, 0x59, 0x4a, 0x66, 0x78, 0x4c, + 0x4c, 0x48, 0x4c, 0x47, 0x76, 0x4b, 0x5a, 0x41, 0x4b, 0x79, 0x56, 0x58, + 0x4d, 0x44, 0x39, 0x4f, 0x30, 0x47, 0x75, 0x31, 0x48, 0x4e, 0x56, 0x70, + 0x4b, 0x37, 0x5a, 0x78, 0x7a, 0x42, 0x43, 0x48, 0x51, 0x71, 0x72, 0x30, + 0x4d, 0x45, 0x37, 0x55, 0x41, 0x79, 0x69, 0x5a, 0x73, 0x78, 0x47, 0x73, + 0x4d, 0x0a, 0x6c, 0x46, 0x71, 0x56, 0x6c, 0x4e, 0x70, 0x51, 0x6d, 0x76, + 0x48, 0x2f, 0x70, 0x53, 0x74, 0x6d, 0x4d, 0x61, 0x54, 0x4a, 0x4f, 0x4b, + 0x44, 0x66, 0x48, 0x52, 0x2b, 0x34, 0x43, 0x53, 0x37, 0x7a, 0x70, 0x2b, + 0x68, 0x6e, 0x55, 0x71, 0x75, 0x56, 0x48, 0x2b, 0x42, 0x47, 0x50, 0x74, + 0x69, 0x6b, 0x77, 0x38, 0x70, 0x61, 0x78, 0x54, 0x47, 0x41, 0x36, 0x45, + 0x69, 0x61, 0x6e, 0x35, 0x52, 0x70, 0x0a, 0x2f, 0x68, 0x6e, 0x64, 0x32, + 0x48, 0x4e, 0x38, 0x67, 0x63, 0x71, 0x57, 0x33, 0x6f, 0x37, 0x74, 0x73, + 0x7a, 0x49, 0x46, 0x5a, 0x59, 0x51, 0x30, 0x35, 0x75, 0x62, 0x39, 0x56, + 0x78, 0x43, 0x31, 0x58, 0x33, 0x61, 0x2f, 0x4c, 0x37, 0x41, 0x51, 0x44, + 0x63, 0x55, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, 0x43, 0x41, + 0x52, 0x6f, 0x77, 0x67, 0x67, 0x45, 0x57, 0x4d, 0x41, 0x38, 0x47, 0x0a, + 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, + 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x50, 0x33, 0x61, + 0x46, 0x4d, 0x53, 0x66, 0x4d, 0x4e, 0x34, 0x68, 0x76, 0x52, 0x35, 0x43, + 0x4f, 0x66, 0x79, 0x72, 0x59, 0x79, 0x4e, 0x4a, 0x34, 0x50, 0x47, 0x45, + 0x4d, 0x41, 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x43, + 0x42, 0x30, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x66, 0x42, 0x49, 0x48, + 0x4c, 0x4d, 0x49, 0x48, 0x49, 0x4d, 0x49, 0x47, 0x41, 0x6f, 0x48, 0x36, + 0x67, 0x66, 0x49, 0x5a, 0x36, 0x62, 0x47, 0x52, 0x68, 0x63, 0x44, 0x6f, + 0x76, 0x4c, 0x32, 0x52, 0x70, 0x63, 0x6d, 0x56, 0x6a, 0x0a, 0x64, 0x47, + 0x39, 0x79, 0x65, 0x53, 0x35, 0x6b, 0x4c, 0x58, 0x52, 0x79, 0x64, 0x58, + 0x4e, 0x30, 0x4c, 0x6d, 0x35, 0x6c, 0x64, 0x43, 0x39, 0x44, 0x54, 0x6a, + 0x31, 0x45, 0x4c, 0x56, 0x52, 0x53, 0x56, 0x56, 0x4e, 0x55, 0x4a, 0x54, + 0x49, 0x77, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x55, 0x79, 0x4d, 0x45, + 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x4a, 0x54, 0x49, 0x77, 0x4d, 0x79, + 0x55, 0x79, 0x0a, 0x4d, 0x45, 0x4e, 0x42, 0x4a, 0x54, 0x49, 0x77, 0x4d, + 0x69, 0x55, 0x79, 0x4d, 0x44, 0x49, 0x77, 0x4d, 0x44, 0x6b, 0x73, 0x54, + 0x7a, 0x31, 0x45, 0x4c, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4a, + 0x54, 0x49, 0x77, 0x52, 0x32, 0x31, 0x69, 0x53, 0x43, 0x78, 0x44, 0x50, + 0x55, 0x52, 0x46, 0x50, 0x32, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, + 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, 0x0a, 0x63, 0x6d, 0x56, 0x32, + 0x62, 0x32, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6d, 0x78, 0x70, + 0x63, 0x33, 0x51, 0x77, 0x51, 0x36, 0x42, 0x42, 0x6f, 0x44, 0x2b, 0x47, + 0x50, 0x57, 0x68, 0x30, 0x64, 0x48, 0x41, 0x36, 0x4c, 0x79, 0x39, 0x33, + 0x64, 0x33, 0x63, 0x75, 0x5a, 0x43, 0x31, 0x30, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x35, 0x75, 0x5a, 0x58, 0x51, 0x76, 0x59, 0x33, 0x4a, 0x73, + 0x0a, 0x4c, 0x32, 0x51, 0x74, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, + 0x66, 0x63, 0x6d, 0x39, 0x76, 0x64, 0x46, 0x39, 0x6a, 0x62, 0x47, 0x46, + 0x7a, 0x63, 0x31, 0x38, 0x7a, 0x58, 0x32, 0x4e, 0x68, 0x58, 0x7a, 0x4a, + 0x66, 0x4d, 0x6a, 0x41, 0x77, 0x4f, 0x53, 0x35, 0x6a, 0x63, 0x6d, 0x77, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x45, 0x42, 0x41, 0x48, 0x2b, 0x58, 0x32, 0x7a, 0x44, 0x49, 0x33, 0x36, + 0x53, 0x63, 0x66, 0x53, 0x46, 0x36, 0x67, 0x48, 0x44, 0x4f, 0x46, 0x42, + 0x4a, 0x70, 0x69, 0x42, 0x53, 0x56, 0x59, 0x45, 0x51, 0x42, 0x72, 0x4c, + 0x4c, 0x70, 0x4d, 0x45, 0x2b, 0x62, 0x55, 0x4d, 0x4a, 0x6d, 0x32, 0x48, + 0x36, 0x4e, 0x4d, 0x4c, 0x56, 0x77, 0x4d, 0x65, 0x6e, 0x69, 0x0a, 0x61, + 0x63, 0x66, 0x7a, 0x63, 0x4e, 0x73, 0x67, 0x46, 0x59, 0x62, 0x51, 0x44, + 0x66, 0x43, 0x2b, 0x72, 0x41, 0x46, 0x31, 0x68, 0x4d, 0x35, 0x2b, 0x6e, + 0x30, 0x32, 0x2f, 0x74, 0x32, 0x41, 0x37, 0x6e, 0x50, 0x50, 0x4b, 0x48, + 0x65, 0x4a, 0x65, 0x61, 0x4e, 0x69, 0x6a, 0x6e, 0x5a, 0x66, 0x6c, 0x51, + 0x47, 0x44, 0x53, 0x4e, 0x69, 0x48, 0x2b, 0x30, 0x4c, 0x53, 0x34, 0x46, + 0x39, 0x70, 0x30, 0x0a, 0x6f, 0x33, 0x2f, 0x55, 0x33, 0x37, 0x43, 0x59, + 0x41, 0x71, 0x78, 0x76, 0x61, 0x32, 0x73, 0x73, 0x4a, 0x53, 0x52, 0x79, + 0x6f, 0x57, 0x58, 0x75, 0x4a, 0x56, 0x72, 0x6c, 0x35, 0x6a, 0x4c, 0x6e, + 0x38, 0x74, 0x2b, 0x72, 0x53, 0x66, 0x72, 0x7a, 0x6b, 0x47, 0x6b, 0x6a, + 0x32, 0x77, 0x54, 0x5a, 0x35, 0x31, 0x78, 0x59, 0x2f, 0x47, 0x58, 0x55, + 0x6c, 0x37, 0x37, 0x4d, 0x2f, 0x43, 0x34, 0x4b, 0x0a, 0x7a, 0x43, 0x55, + 0x71, 0x4e, 0x51, 0x54, 0x34, 0x59, 0x4a, 0x45, 0x56, 0x64, 0x54, 0x31, + 0x42, 0x2f, 0x79, 0x4d, 0x66, 0x47, 0x63, 0x68, 0x73, 0x36, 0x34, 0x4a, + 0x54, 0x42, 0x4b, 0x62, 0x6b, 0x54, 0x43, 0x4a, 0x4e, 0x6a, 0x59, 0x79, + 0x36, 0x7a, 0x6c, 0x74, 0x7a, 0x37, 0x47, 0x52, 0x55, 0x55, 0x47, 0x33, + 0x52, 0x6e, 0x46, 0x58, 0x37, 0x61, 0x63, 0x4d, 0x32, 0x77, 0x34, 0x79, + 0x38, 0x0a, 0x50, 0x49, 0x57, 0x6d, 0x61, 0x77, 0x6f, 0x6d, 0x44, 0x65, + 0x43, 0x54, 0x6d, 0x47, 0x43, 0x75, 0x66, 0x73, 0x59, 0x6b, 0x6c, 0x34, + 0x70, 0x68, 0x58, 0x35, 0x47, 0x4f, 0x5a, 0x70, 0x49, 0x4a, 0x68, 0x7a, + 0x62, 0x4e, 0x69, 0x35, 0x73, 0x74, 0x50, 0x76, 0x5a, 0x52, 0x31, 0x46, + 0x44, 0x55, 0x57, 0x53, 0x69, 0x39, 0x67, 0x2f, 0x4c, 0x4d, 0x4b, 0x48, + 0x74, 0x54, 0x68, 0x6d, 0x33, 0x59, 0x0a, 0x4a, 0x6f, 0x68, 0x77, 0x31, + 0x2b, 0x71, 0x52, 0x7a, 0x54, 0x36, 0x35, 0x79, 0x73, 0x43, 0x51, 0x62, + 0x6c, 0x72, 0x47, 0x58, 0x6e, 0x52, 0x6c, 0x31, 0x31, 0x7a, 0x2b, 0x6f, + 0x2b, 0x49, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x2d, 0x54, 0x52, + 0x55, 0x53, 0x54, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x20, 0x33, 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, 0x45, 0x56, + 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x4f, 0x3d, 0x44, 0x2d, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, + 0x2d, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x43, 0x41, 0x20, 0x32, + 0x20, 0x45, 0x56, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x4f, 0x3d, 0x44, + 0x2d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x2d, + 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x20, 0x33, 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, + 0x45, 0x56, 0x20, 0x32, 0x30, 0x30, 0x39, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x32, 0x33, 0x36, 0x30, + 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x61, 0x3a, + 0x63, 0x36, 0x3a, 0x34, 0x33, 0x3a, 0x32, 0x63, 0x3a, 0x35, 0x65, 0x3a, + 0x32, 0x64, 0x3a, 0x63, 0x64, 0x3a, 0x63, 0x34, 0x3a, 0x33, 0x34, 0x3a, + 0x63, 0x30, 0x3a, 0x35, 0x30, 0x3a, 0x34, 0x66, 0x3a, 0x31, 0x31, 0x3a, + 0x30, 0x32, 0x3a, 0x34, 0x66, 0x3a, 0x62, 0x36, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x36, 0x3a, 0x63, 0x39, 0x3a, 0x31, + 0x62, 0x3a, 0x30, 0x62, 0x3a, 0x39, 0x35, 0x3a, 0x62, 0x34, 0x3a, 0x31, + 0x30, 0x3a, 0x39, 0x38, 0x3a, 0x34, 0x32, 0x3a, 0x66, 0x61, 0x3a, 0x64, + 0x30, 0x3a, 0x64, 0x38, 0x3a, 0x32, 0x32, 0x3a, 0x37, 0x39, 0x3a, 0x66, + 0x65, 0x3a, 0x36, 0x30, 0x3a, 0x66, 0x61, 0x3a, 0x62, 0x39, 0x3a, 0x31, + 0x36, 0x3a, 0x38, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x65, 0x65, 0x3a, 0x63, 0x35, 0x3a, 0x34, 0x39, 0x3a, + 0x36, 0x62, 0x3a, 0x39, 0x38, 0x3a, 0x38, 0x63, 0x3a, 0x65, 0x39, 0x3a, + 0x38, 0x36, 0x3a, 0x32, 0x35, 0x3a, 0x62, 0x39, 0x3a, 0x33, 0x34, 0x3a, + 0x30, 0x39, 0x3a, 0x32, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x32, 0x39, 0x3a, + 0x30, 0x38, 0x3a, 0x62, 0x65, 0x3a, 0x64, 0x30, 0x3a, 0x62, 0x30, 0x3a, + 0x66, 0x33, 0x3a, 0x31, 0x36, 0x3a, 0x63, 0x32, 0x3a, 0x64, 0x34, 0x3a, + 0x37, 0x33, 0x3a, 0x30, 0x63, 0x3a, 0x38, 0x34, 0x3a, 0x65, 0x61, 0x3a, + 0x66, 0x31, 0x3a, 0x66, 0x33, 0x3a, 0x64, 0x33, 0x3a, 0x34, 0x38, 0x3a, + 0x38, 0x31, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, + 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x51, + 0x7a, 0x43, 0x43, 0x41, 0x79, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, + 0x67, 0x49, 0x44, 0x43, 0x59, 0x50, 0x30, 0x4d, 0x41, 0x30, 0x47, 0x43, + 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, + 0x77, 0x55, 0x41, 0x4d, 0x46, 0x41, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x52, 0x46, 0x0a, + 0x4d, 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, + 0x44, 0x41, 0x78, 0x45, 0x4c, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x49, 0x45, 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, 0x4b, 0x6a, 0x41, 0x6f, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x49, 0x55, 0x51, 0x74, + 0x56, 0x46, 0x4a, 0x56, 0x55, 0x31, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, + 0x64, 0x43, 0x42, 0x44, 0x0a, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x41, + 0x7a, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x67, 0x52, 0x56, 0x59, + 0x67, 0x4d, 0x6a, 0x41, 0x77, 0x4f, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, + 0x77, 0x4f, 0x54, 0x45, 0x78, 0x4d, 0x44, 0x55, 0x77, 0x4f, 0x44, 0x55, + 0x77, 0x4e, 0x44, 0x5a, 0x61, 0x46, 0x77, 0x30, 0x79, 0x4f, 0x54, 0x45, + 0x78, 0x4d, 0x44, 0x55, 0x77, 0x4f, 0x44, 0x55, 0x77, 0x0a, 0x4e, 0x44, + 0x5a, 0x61, 0x4d, 0x46, 0x41, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x52, 0x46, 0x4d, 0x52, + 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, + 0x78, 0x45, 0x4c, 0x56, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x45, + 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, 0x4b, 0x6a, 0x41, 0x6f, 0x42, 0x67, + 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x4d, 0x49, 0x55, 0x51, 0x74, 0x56, + 0x46, 0x4a, 0x56, 0x55, 0x31, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, + 0x43, 0x42, 0x44, 0x62, 0x47, 0x46, 0x7a, 0x63, 0x79, 0x41, 0x7a, 0x49, + 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x67, 0x52, 0x56, 0x59, 0x67, 0x4d, + 0x6a, 0x41, 0x77, 0x4f, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x50, + 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x4a, 0x6e, 0x78, 0x68, 0x44, 0x52, 0x77, 0x75, 0x69, 0x2b, 0x33, + 0x4d, 0x4b, 0x43, 0x4f, 0x76, 0x58, 0x77, 0x45, 0x7a, 0x37, 0x35, 0x69, + 0x76, 0x4a, 0x6e, 0x39, 0x67, 0x70, 0x66, 0x53, 0x65, 0x67, 0x70, 0x6e, + 0x0a, 0x6c, 0x6a, 0x67, 0x4a, 0x39, 0x68, 0x42, 0x4f, 0x6c, 0x53, 0x4a, + 0x7a, 0x6d, 0x59, 0x33, 0x61, 0x46, 0x53, 0x33, 0x6e, 0x42, 0x66, 0x77, + 0x5a, 0x63, 0x79, 0x4b, 0x33, 0x6a, 0x70, 0x67, 0x41, 0x76, 0x44, 0x77, + 0x39, 0x72, 0x4b, 0x46, 0x73, 0x2b, 0x39, 0x5a, 0x35, 0x4a, 0x55, 0x75, + 0x74, 0x38, 0x4d, 0x78, 0x6b, 0x32, 0x6f, 0x67, 0x2b, 0x4b, 0x62, 0x67, + 0x50, 0x43, 0x64, 0x4d, 0x30, 0x0a, 0x33, 0x54, 0x50, 0x31, 0x59, 0x74, + 0x48, 0x68, 0x7a, 0x52, 0x6e, 0x70, 0x37, 0x68, 0x68, 0x50, 0x54, 0x46, + 0x69, 0x75, 0x34, 0x68, 0x37, 0x57, 0x44, 0x46, 0x73, 0x56, 0x57, 0x74, + 0x67, 0x36, 0x75, 0x4d, 0x51, 0x59, 0x5a, 0x42, 0x37, 0x6a, 0x4d, 0x37, + 0x4b, 0x31, 0x69, 0x58, 0x64, 0x4f, 0x44, 0x4c, 0x2f, 0x5a, 0x6c, 0x47, + 0x73, 0x54, 0x6c, 0x32, 0x38, 0x53, 0x6f, 0x2f, 0x36, 0x5a, 0x0a, 0x71, + 0x51, 0x54, 0x4d, 0x46, 0x65, 0x78, 0x67, 0x61, 0x44, 0x62, 0x74, 0x43, + 0x48, 0x75, 0x33, 0x39, 0x62, 0x2b, 0x54, 0x37, 0x57, 0x59, 0x78, 0x67, + 0x34, 0x7a, 0x47, 0x63, 0x54, 0x53, 0x48, 0x54, 0x68, 0x66, 0x71, 0x72, + 0x34, 0x75, 0x52, 0x6a, 0x52, 0x78, 0x57, 0x51, 0x61, 0x34, 0x69, 0x4e, + 0x31, 0x34, 0x33, 0x38, 0x68, 0x33, 0x5a, 0x30, 0x53, 0x30, 0x4e, 0x4c, + 0x32, 0x6c, 0x52, 0x0a, 0x70, 0x37, 0x35, 0x6d, 0x70, 0x6f, 0x6f, 0x36, + 0x4b, 0x72, 0x33, 0x48, 0x47, 0x72, 0x48, 0x68, 0x46, 0x50, 0x43, 0x2b, + 0x4f, 0x68, 0x32, 0x35, 0x7a, 0x31, 0x75, 0x78, 0x61, 0x76, 0x36, 0x30, + 0x73, 0x55, 0x59, 0x67, 0x6f, 0x76, 0x73, 0x65, 0x4f, 0x33, 0x44, 0x76, + 0x6b, 0x35, 0x68, 0x39, 0x6a, 0x48, 0x4f, 0x57, 0x38, 0x73, 0x58, 0x76, + 0x68, 0x58, 0x43, 0x74, 0x4b, 0x53, 0x62, 0x38, 0x0a, 0x48, 0x67, 0x51, + 0x2b, 0x48, 0x4b, 0x44, 0x59, 0x44, 0x38, 0x74, 0x53, 0x67, 0x32, 0x4a, + 0x38, 0x37, 0x6f, 0x74, 0x54, 0x6c, 0x5a, 0x43, 0x70, 0x56, 0x36, 0x4c, + 0x71, 0x59, 0x51, 0x58, 0x59, 0x2b, 0x55, 0x33, 0x45, 0x4a, 0x2f, 0x70, + 0x75, 0x72, 0x65, 0x33, 0x35, 0x31, 0x31, 0x48, 0x33, 0x61, 0x36, 0x55, + 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4f, 0x43, 0x41, 0x53, 0x51, + 0x77, 0x0a, 0x67, 0x67, 0x45, 0x67, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4e, 0x4f, 0x55, 0x69, 0x6b, + 0x78, 0x69, 0x45, 0x79, 0x6f, 0x5a, 0x4c, 0x73, 0x79, 0x76, 0x63, 0x6f, + 0x70, 0x39, 0x4e, 0x74, 0x65, 0x61, 0x0a, 0x48, 0x4e, 0x78, 0x6e, 0x4d, + 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x43, 0x42, 0x33, + 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x66, 0x42, 0x49, 0x48, 0x56, 0x4d, + 0x49, 0x48, 0x53, 0x4d, 0x49, 0x47, 0x48, 0x6f, 0x49, 0x47, 0x45, 0x6f, + 0x49, 0x47, 0x42, 0x68, 0x6e, 0x39, 0x73, 0x5a, 0x47, 0x46, 0x77, 0x0a, + 0x4f, 0x69, 0x38, 0x76, 0x5a, 0x47, 0x6c, 0x79, 0x5a, 0x57, 0x4e, 0x30, + 0x62, 0x33, 0x4a, 0x35, 0x4c, 0x6d, 0x51, 0x74, 0x64, 0x48, 0x4a, 0x31, + 0x63, 0x33, 0x51, 0x75, 0x62, 0x6d, 0x56, 0x30, 0x4c, 0x30, 0x4e, 0x4f, + 0x50, 0x55, 0x51, 0x74, 0x56, 0x46, 0x4a, 0x56, 0x55, 0x31, 0x51, 0x6c, + 0x4d, 0x6a, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x4a, 0x54, 0x49, 0x77, + 0x51, 0x32, 0x78, 0x68, 0x0a, 0x63, 0x33, 0x4d, 0x6c, 0x4d, 0x6a, 0x41, + 0x7a, 0x4a, 0x54, 0x49, 0x77, 0x51, 0x30, 0x45, 0x6c, 0x4d, 0x6a, 0x41, + 0x79, 0x4a, 0x54, 0x49, 0x77, 0x52, 0x56, 0x59, 0x6c, 0x4d, 0x6a, 0x41, + 0x79, 0x4d, 0x44, 0x41, 0x35, 0x4c, 0x45, 0x38, 0x39, 0x52, 0x43, 0x31, + 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x55, 0x79, 0x4d, 0x45, 0x64, + 0x74, 0x59, 0x6b, 0x67, 0x73, 0x51, 0x7a, 0x31, 0x45, 0x0a, 0x52, 0x54, + 0x39, 0x6a, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, + 0x46, 0x30, 0x5a, 0x58, 0x4a, 0x6c, 0x64, 0x6d, 0x39, 0x6a, 0x59, 0x58, + 0x52, 0x70, 0x62, 0x32, 0x35, 0x73, 0x61, 0x58, 0x4e, 0x30, 0x4d, 0x45, + 0x61, 0x67, 0x52, 0x4b, 0x42, 0x43, 0x68, 0x6b, 0x42, 0x6f, 0x64, 0x48, + 0x52, 0x77, 0x4f, 0x69, 0x38, 0x76, 0x64, 0x33, 0x64, 0x33, 0x4c, 0x6d, + 0x51, 0x74, 0x0a, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, + 0x6d, 0x56, 0x30, 0x4c, 0x32, 0x4e, 0x79, 0x62, 0x43, 0x39, 0x6b, 0x4c, + 0x58, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x58, 0x33, 0x4a, 0x76, 0x62, + 0x33, 0x52, 0x66, 0x59, 0x32, 0x78, 0x68, 0x63, 0x33, 0x4e, 0x66, 0x4d, + 0x31, 0x39, 0x6a, 0x59, 0x56, 0x38, 0x79, 0x58, 0x32, 0x56, 0x32, 0x58, + 0x7a, 0x49, 0x77, 0x4d, 0x44, 0x6b, 0x75, 0x0a, 0x59, 0x33, 0x4a, 0x73, + 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, + 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, + 0x41, 0x51, 0x41, 0x30, 0x37, 0x58, 0x74, 0x61, 0x50, 0x4b, 0x53, 0x55, + 0x69, 0x4f, 0x38, 0x61, 0x45, 0x58, 0x55, 0x48, 0x4c, 0x37, 0x50, 0x2b, + 0x50, 0x50, 0x6f, 0x65, 0x55, 0x53, 0x62, 0x72, 0x68, 0x2f, 0x59, 0x70, + 0x0a, 0x33, 0x75, 0x44, 0x78, 0x31, 0x4d, 0x59, 0x6b, 0x43, 0x65, 0x6e, + 0x42, 0x7a, 0x31, 0x55, 0x62, 0x74, 0x44, 0x44, 0x5a, 0x7a, 0x68, 0x72, + 0x2b, 0x42, 0x6c, 0x47, 0x6d, 0x46, 0x61, 0x51, 0x74, 0x37, 0x37, 0x4a, + 0x4c, 0x76, 0x79, 0x41, 0x6f, 0x4a, 0x55, 0x6e, 0x52, 0x70, 0x6a, 0x5a, + 0x33, 0x4e, 0x4f, 0x68, 0x6b, 0x33, 0x31, 0x4b, 0x78, 0x45, 0x63, 0x64, + 0x7a, 0x65, 0x73, 0x30, 0x35, 0x0a, 0x6e, 0x73, 0x4b, 0x74, 0x6a, 0x48, + 0x45, 0x68, 0x38, 0x6c, 0x70, 0x72, 0x72, 0x39, 0x38, 0x38, 0x54, 0x6c, + 0x57, 0x76, 0x73, 0x6f, 0x52, 0x6c, 0x46, 0x49, 0x6d, 0x35, 0x64, 0x38, + 0x73, 0x71, 0x4d, 0x62, 0x37, 0x50, 0x6f, 0x32, 0x33, 0x50, 0x62, 0x30, + 0x69, 0x55, 0x4d, 0x6b, 0x5a, 0x76, 0x35, 0x33, 0x47, 0x4d, 0x6f, 0x4b, + 0x61, 0x45, 0x47, 0x54, 0x63, 0x48, 0x38, 0x67, 0x4e, 0x46, 0x0a, 0x43, + 0x53, 0x75, 0x47, 0x64, 0x58, 0x7a, 0x66, 0x58, 0x32, 0x6c, 0x58, 0x41, + 0x4e, 0x74, 0x75, 0x32, 0x4b, 0x5a, 0x79, 0x49, 0x6b, 0x74, 0x51, 0x31, + 0x48, 0x57, 0x59, 0x56, 0x74, 0x2b, 0x33, 0x47, 0x50, 0x39, 0x44, 0x51, + 0x31, 0x43, 0x75, 0x65, 0x6b, 0x52, 0x37, 0x38, 0x48, 0x6c, 0x52, 0x31, + 0x30, 0x4d, 0x39, 0x70, 0x39, 0x4f, 0x42, 0x30, 0x2f, 0x44, 0x4a, 0x54, + 0x37, 0x6e, 0x61, 0x0a, 0x78, 0x70, 0x65, 0x47, 0x30, 0x49, 0x4c, 0x44, + 0x35, 0x45, 0x4a, 0x74, 0x2f, 0x72, 0x44, 0x69, 0x5a, 0x45, 0x34, 0x4f, + 0x4a, 0x75, 0x64, 0x41, 0x4e, 0x43, 0x61, 0x31, 0x43, 0x49, 0x6e, 0x58, + 0x43, 0x47, 0x4e, 0x6a, 0x4f, 0x43, 0x64, 0x31, 0x48, 0x6a, 0x50, 0x71, + 0x62, 0x71, 0x6a, 0x64, 0x6e, 0x35, 0x6c, 0x50, 0x64, 0x45, 0x32, 0x42, + 0x69, 0x59, 0x42, 0x4c, 0x33, 0x5a, 0x71, 0x58, 0x0a, 0x4b, 0x56, 0x77, + 0x76, 0x76, 0x6f, 0x46, 0x42, 0x75, 0x59, 0x7a, 0x2f, 0x36, 0x6e, 0x31, + 0x67, 0x42, 0x70, 0x37, 0x4e, 0x31, 0x7a, 0x33, 0x54, 0x4c, 0x71, 0x4d, + 0x56, 0x76, 0x4b, 0x6a, 0x6d, 0x4a, 0x75, 0x56, 0x76, 0x77, 0x39, 0x79, + 0x34, 0x41, 0x79, 0x48, 0x71, 0x6e, 0x78, 0x62, 0x78, 0x4c, 0x46, 0x53, + 0x31, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x41, 0x20, 0x44, 0x69, 0x73, + 0x69, 0x67, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x32, 0x20, 0x4f, + 0x3d, 0x44, 0x69, 0x73, 0x69, 0x67, 0x20, 0x61, 0x2e, 0x73, 0x2e, 0x0a, + 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x43, 0x41, 0x20, 0x44, 0x69, 0x73, 0x69, 0x67, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x32, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x73, + 0x69, 0x67, 0x20, 0x61, 0x2e, 0x73, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x41, 0x20, 0x44, 0x69, 0x73, + 0x69, 0x67, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x32, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, + 0x35, 0x37, 0x32, 0x33, 0x35, 0x30, 0x36, 0x30, 0x32, 0x33, 0x39, 0x33, + 0x33, 0x33, 0x38, 0x32, 0x31, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x32, 0x36, 0x3a, 0x30, 0x31, 0x3a, 0x66, 0x62, 0x3a, 0x64, + 0x38, 0x3a, 0x32, 0x37, 0x3a, 0x61, 0x37, 0x3a, 0x31, 0x37, 0x3a, 0x39, + 0x61, 0x3a, 0x34, 0x35, 0x3a, 0x35, 0x34, 0x3a, 0x33, 0x38, 0x3a, 0x31, + 0x61, 0x3a, 0x34, 0x33, 0x3a, 0x30, 0x31, 0x3a, 0x33, 0x62, 0x3a, 0x30, + 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x35, + 0x3a, 0x36, 0x31, 0x3a, 0x65, 0x62, 0x3a, 0x65, 0x61, 0x3a, 0x61, 0x34, + 0x3a, 0x64, 0x65, 0x3a, 0x65, 0x34, 0x3a, 0x32, 0x35, 0x3a, 0x34, 0x62, + 0x3a, 0x36, 0x39, 0x3a, 0x31, 0x61, 0x3a, 0x39, 0x38, 0x3a, 0x61, 0x35, + 0x3a, 0x35, 0x37, 0x3a, 0x34, 0x37, 0x3a, 0x63, 0x32, 0x3a, 0x33, 0x34, + 0x3a, 0x63, 0x37, 0x3a, 0x64, 0x39, 0x3a, 0x37, 0x31, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x32, 0x3a, 0x33, + 0x64, 0x3a, 0x34, 0x61, 0x3a, 0x30, 0x33, 0x3a, 0x36, 0x64, 0x3a, 0x37, + 0x62, 0x3a, 0x37, 0x30, 0x3a, 0x65, 0x39, 0x3a, 0x66, 0x35, 0x3a, 0x39, + 0x35, 0x3a, 0x62, 0x31, 0x3a, 0x34, 0x32, 0x3a, 0x32, 0x30, 0x3a, 0x37, + 0x39, 0x3a, 0x64, 0x32, 0x3a, 0x62, 0x39, 0x3a, 0x31, 0x65, 0x3a, 0x64, + 0x66, 0x3a, 0x62, 0x62, 0x3a, 0x31, 0x66, 0x3a, 0x62, 0x36, 0x3a, 0x35, + 0x31, 0x3a, 0x61, 0x30, 0x3a, 0x36, 0x33, 0x3a, 0x33, 0x65, 0x3a, 0x61, + 0x61, 0x3a, 0x38, 0x61, 0x3a, 0x39, 0x64, 0x3a, 0x63, 0x35, 0x3a, 0x66, + 0x38, 0x3a, 0x30, 0x37, 0x3a, 0x30, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x46, 0x61, 0x54, 0x43, 0x43, 0x41, 0x31, 0x47, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a, 0x41, 0x4a, 0x4b, 0x34, + 0x69, 0x4e, 0x75, 0x77, 0x69, 0x73, 0x46, 0x6a, 0x4d, 0x41, 0x30, 0x47, + 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, + 0x43, 0x77, 0x55, 0x41, 0x4d, 0x46, 0x49, 0x78, 0x43, 0x7a, 0x41, 0x4a, + 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x4e, + 0x4c, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x48, 0x45, 0x77, 0x70, 0x43, 0x63, 0x6d, 0x46, 0x30, 0x61, 0x58, 0x4e, + 0x73, 0x59, 0x58, 0x5a, 0x68, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x70, 0x45, 0x61, 0x58, 0x4e, + 0x70, 0x5a, 0x79, 0x42, 0x68, 0x4c, 0x6e, 0x4d, 0x75, 0x0a, 0x4d, 0x52, + 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, + 0x42, 0x44, 0x51, 0x53, 0x42, 0x45, 0x61, 0x58, 0x4e, 0x70, 0x5a, 0x79, + 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x46, 0x49, 0x79, 0x4d, 0x42, + 0x34, 0x58, 0x44, 0x54, 0x45, 0x79, 0x4d, 0x44, 0x63, 0x78, 0x4f, 0x54, + 0x41, 0x35, 0x4d, 0x54, 0x55, 0x7a, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, + 0x51, 0x79, 0x0a, 0x4d, 0x44, 0x63, 0x78, 0x4f, 0x54, 0x41, 0x35, 0x4d, + 0x54, 0x55, 0x7a, 0x4d, 0x46, 0x6f, 0x77, 0x55, 0x6a, 0x45, 0x4c, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x55, + 0x30, 0x73, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x63, 0x54, 0x43, 0x6b, 0x4a, 0x79, 0x59, 0x58, 0x52, 0x70, 0x63, + 0x32, 0x78, 0x68, 0x64, 0x6d, 0x45, 0x78, 0x0a, 0x45, 0x7a, 0x41, 0x52, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, 0x6b, 0x52, 0x70, + 0x63, 0x32, 0x6c, 0x6e, 0x49, 0x47, 0x45, 0x75, 0x63, 0x79, 0x34, 0x78, + 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, + 0x45, 0x45, 0x4e, 0x42, 0x49, 0x45, 0x52, 0x70, 0x63, 0x32, 0x6c, 0x6e, + 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x55, 0x6a, 0x49, 0x77, + 0x0a, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, + 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, + 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x69, 0x6f, 0x38, 0x51, + 0x41, 0x43, 0x64, 0x61, 0x46, 0x58, 0x53, 0x31, 0x74, 0x46, 0x50, 0x62, + 0x43, 0x77, 0x33, 0x4f, 0x65, 0x0a, 0x4e, 0x63, 0x4a, 0x78, 0x56, 0x58, + 0x36, 0x42, 0x2b, 0x36, 0x74, 0x47, 0x55, 0x4f, 0x44, 0x42, 0x66, 0x45, + 0x6c, 0x34, 0x35, 0x71, 0x74, 0x35, 0x57, 0x44, 0x7a, 0x61, 0x2f, 0x33, + 0x77, 0x63, 0x6e, 0x39, 0x69, 0x58, 0x41, 0x6e, 0x67, 0x2b, 0x61, 0x30, + 0x45, 0x45, 0x36, 0x55, 0x47, 0x39, 0x76, 0x67, 0x4d, 0x73, 0x52, 0x66, + 0x59, 0x76, 0x5a, 0x4e, 0x53, 0x72, 0x58, 0x61, 0x4e, 0x48, 0x0a, 0x50, + 0x57, 0x53, 0x62, 0x36, 0x57, 0x69, 0x61, 0x78, 0x73, 0x77, 0x62, 0x50, + 0x37, 0x71, 0x2b, 0x73, 0x6f, 0x73, 0x30, 0x41, 0x69, 0x36, 0x59, 0x56, + 0x52, 0x6e, 0x38, 0x6a, 0x47, 0x2b, 0x71, 0x58, 0x39, 0x70, 0x4d, 0x7a, + 0x6b, 0x30, 0x44, 0x49, 0x61, 0x50, 0x59, 0x30, 0x6a, 0x53, 0x54, 0x56, + 0x70, 0x62, 0x4c, 0x54, 0x41, 0x77, 0x41, 0x46, 0x6a, 0x78, 0x66, 0x47, + 0x73, 0x33, 0x49, 0x0a, 0x78, 0x32, 0x79, 0x6d, 0x72, 0x64, 0x4d, 0x78, + 0x70, 0x37, 0x7a, 0x6f, 0x35, 0x65, 0x46, 0x6d, 0x31, 0x74, 0x4c, 0x37, + 0x41, 0x37, 0x52, 0x42, 0x5a, 0x63, 0x6b, 0x51, 0x72, 0x67, 0x34, 0x46, + 0x59, 0x38, 0x61, 0x41, 0x61, 0x6d, 0x6b, 0x77, 0x2f, 0x64, 0x4c, 0x75, + 0x6b, 0x4f, 0x38, 0x4e, 0x4a, 0x39, 0x2b, 0x66, 0x6c, 0x58, 0x50, 0x30, + 0x34, 0x53, 0x58, 0x61, 0x62, 0x42, 0x62, 0x65, 0x0a, 0x51, 0x54, 0x67, + 0x30, 0x36, 0x6f, 0x76, 0x38, 0x30, 0x65, 0x67, 0x45, 0x46, 0x47, 0x45, + 0x74, 0x51, 0x58, 0x36, 0x73, 0x78, 0x33, 0x64, 0x4f, 0x79, 0x31, 0x46, + 0x55, 0x2b, 0x31, 0x36, 0x53, 0x47, 0x42, 0x73, 0x45, 0x57, 0x6d, 0x6a, + 0x47, 0x79, 0x63, 0x54, 0x36, 0x74, 0x78, 0x4f, 0x67, 0x6d, 0x4c, 0x63, + 0x52, 0x4b, 0x37, 0x66, 0x57, 0x56, 0x38, 0x78, 0x38, 0x6e, 0x68, 0x66, + 0x52, 0x0a, 0x79, 0x79, 0x58, 0x2b, 0x68, 0x6b, 0x34, 0x6b, 0x4c, 0x6c, + 0x59, 0x4d, 0x65, 0x45, 0x32, 0x65, 0x41, 0x52, 0x4b, 0x6d, 0x4b, 0x36, + 0x63, 0x42, 0x5a, 0x57, 0x35, 0x38, 0x59, 0x68, 0x32, 0x45, 0x68, 0x4e, + 0x2f, 0x71, 0x77, 0x47, 0x75, 0x31, 0x70, 0x53, 0x71, 0x56, 0x67, 0x38, + 0x4e, 0x54, 0x45, 0x51, 0x78, 0x7a, 0x48, 0x51, 0x75, 0x79, 0x52, 0x70, + 0x44, 0x52, 0x51, 0x6a, 0x72, 0x4f, 0x0a, 0x51, 0x47, 0x36, 0x56, 0x72, + 0x66, 0x2f, 0x47, 0x6c, 0x4b, 0x31, 0x75, 0x6c, 0x34, 0x53, 0x4f, 0x66, + 0x57, 0x2b, 0x65, 0x69, 0x6f, 0x41, 0x4e, 0x53, 0x57, 0x31, 0x7a, 0x34, + 0x6e, 0x75, 0x53, 0x48, 0x73, 0x50, 0x7a, 0x77, 0x66, 0x50, 0x72, 0x4c, + 0x67, 0x56, 0x76, 0x32, 0x52, 0x76, 0x50, 0x4e, 0x33, 0x59, 0x45, 0x79, + 0x4c, 0x52, 0x61, 0x35, 0x42, 0x65, 0x6e, 0x79, 0x39, 0x31, 0x32, 0x0a, + 0x48, 0x39, 0x41, 0x5a, 0x64, 0x75, 0x67, 0x73, 0x42, 0x62, 0x50, 0x57, + 0x6e, 0x44, 0x54, 0x59, 0x6c, 0x74, 0x78, 0x68, 0x68, 0x35, 0x45, 0x46, + 0x35, 0x45, 0x51, 0x49, 0x4d, 0x38, 0x48, 0x61, 0x75, 0x51, 0x68, 0x6c, + 0x31, 0x4b, 0x36, 0x79, 0x4e, 0x67, 0x33, 0x72, 0x75, 0x6a, 0x69, 0x36, + 0x44, 0x4f, 0x57, 0x62, 0x6e, 0x75, 0x75, 0x4e, 0x5a, 0x74, 0x32, 0x5a, + 0x7a, 0x39, 0x61, 0x4a, 0x0a, 0x51, 0x66, 0x59, 0x45, 0x6b, 0x6f, 0x6f, + 0x70, 0x4b, 0x57, 0x31, 0x72, 0x4f, 0x68, 0x7a, 0x6e, 0x64, 0x58, 0x30, + 0x43, 0x63, 0x51, 0x37, 0x7a, 0x77, 0x4f, 0x65, 0x39, 0x79, 0x78, 0x6e, + 0x64, 0x6e, 0x57, 0x43, 0x79, 0x77, 0x6d, 0x5a, 0x67, 0x74, 0x72, 0x45, + 0x45, 0x37, 0x73, 0x6e, 0x6d, 0x68, 0x72, 0x6d, 0x61, 0x5a, 0x6b, 0x43, + 0x6f, 0x35, 0x78, 0x48, 0x74, 0x67, 0x55, 0x55, 0x44, 0x0a, 0x69, 0x2f, + 0x5a, 0x6e, 0x57, 0x65, 0x6a, 0x42, 0x42, 0x68, 0x47, 0x39, 0x33, 0x63, + 0x2b, 0x41, 0x41, 0x6b, 0x39, 0x6c, 0x51, 0x48, 0x68, 0x63, 0x52, 0x31, + 0x44, 0x49, 0x6d, 0x2b, 0x59, 0x66, 0x67, 0x58, 0x76, 0x6b, 0x52, 0x4b, + 0x68, 0x62, 0x68, 0x5a, 0x72, 0x69, 0x33, 0x6c, 0x72, 0x56, 0x78, 0x2f, + 0x6b, 0x36, 0x52, 0x47, 0x5a, 0x4c, 0x35, 0x44, 0x4a, 0x55, 0x66, 0x4f, + 0x52, 0x73, 0x0a, 0x6e, 0x4c, 0x4d, 0x4f, 0x50, 0x52, 0x65, 0x69, 0x73, + 0x6a, 0x51, 0x53, 0x31, 0x6e, 0x36, 0x79, 0x71, 0x45, 0x6d, 0x37, 0x30, + 0x58, 0x6f, 0x6f, 0x51, 0x4c, 0x36, 0x69, 0x46, 0x68, 0x2f, 0x66, 0x35, + 0x44, 0x63, 0x66, 0x45, 0x58, 0x50, 0x37, 0x6b, 0x41, 0x70, 0x6c, 0x51, + 0x36, 0x49, 0x4e, 0x66, 0x50, 0x67, 0x47, 0x41, 0x56, 0x55, 0x7a, 0x66, + 0x62, 0x41, 0x4e, 0x75, 0x50, 0x54, 0x31, 0x0a, 0x72, 0x71, 0x56, 0x43, + 0x56, 0x33, 0x77, 0x32, 0x45, 0x59, 0x78, 0x37, 0x58, 0x73, 0x51, 0x44, + 0x6e, 0x59, 0x78, 0x35, 0x6e, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, + 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, + 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x0a, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, + 0x45, 0x46, 0x67, 0x51, 0x55, 0x74, 0x5a, 0x6e, 0x34, 0x72, 0x37, 0x43, + 0x55, 0x39, 0x65, 0x4d, 0x67, 0x31, 0x67, 0x71, 0x74, 0x7a, 0x6b, 0x35, + 0x57, 0x70, 0x43, 0x35, 0x75, 0x51, 0x75, 0x30, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x0a, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x43, + 0x59, 0x47, 0x58, 0x6e, 0x44, 0x6e, 0x5a, 0x54, 0x50, 0x49, 0x67, 0x6d, + 0x37, 0x5a, 0x6e, 0x42, 0x63, 0x36, 0x47, 0x33, 0x70, 0x6d, 0x73, 0x67, + 0x48, 0x32, 0x65, 0x44, 0x74, 0x70, 0x58, 0x69, 0x2f, 0x71, 0x2f, 0x30, + 0x37, 0x35, 0x4b, 0x4d, 0x4f, 0x59, 0x4b, 0x6d, 0x46, 0x4d, 0x0a, 0x74, + 0x43, 0x51, 0x53, 0x69, 0x6e, 0x31, 0x74, 0x45, 0x52, 0x54, 0x33, 0x6e, + 0x4c, 0x58, 0x4b, 0x35, 0x72, 0x79, 0x65, 0x4a, 0x34, 0x35, 0x4d, 0x47, + 0x63, 0x69, 0x70, 0x76, 0x58, 0x72, 0x41, 0x31, 0x7a, 0x59, 0x4f, 0x62, + 0x59, 0x56, 0x79, 0x62, 0x71, 0x6a, 0x47, 0x6f, 0x6d, 0x33, 0x32, 0x2b, + 0x6e, 0x4e, 0x6a, 0x66, 0x37, 0x78, 0x75, 0x65, 0x51, 0x67, 0x63, 0x6e, + 0x59, 0x71, 0x66, 0x0a, 0x47, 0x6f, 0x70, 0x54, 0x70, 0x74, 0x69, 0x37, + 0x32, 0x54, 0x56, 0x56, 0x73, 0x52, 0x48, 0x46, 0x71, 0x51, 0x4f, 0x7a, + 0x56, 0x6a, 0x75, 0x35, 0x68, 0x4a, 0x4d, 0x69, 0x58, 0x6e, 0x37, 0x42, + 0x39, 0x68, 0x4a, 0x53, 0x69, 0x2b, 0x6f, 0x73, 0x5a, 0x37, 0x7a, 0x2b, + 0x4e, 0x6b, 0x7a, 0x31, 0x75, 0x4d, 0x2f, 0x52, 0x73, 0x30, 0x6d, 0x53, + 0x4f, 0x39, 0x4d, 0x70, 0x44, 0x70, 0x6b, 0x62, 0x0a, 0x6c, 0x76, 0x64, + 0x68, 0x75, 0x44, 0x76, 0x45, 0x4b, 0x37, 0x5a, 0x34, 0x62, 0x4c, 0x51, + 0x6a, 0x62, 0x2f, 0x44, 0x39, 0x30, 0x37, 0x4a, 0x65, 0x64, 0x52, 0x2b, + 0x5a, 0x6c, 0x61, 0x69, 0x73, 0x39, 0x74, 0x72, 0x68, 0x78, 0x54, 0x46, + 0x37, 0x2b, 0x39, 0x46, 0x47, 0x73, 0x39, 0x4b, 0x38, 0x5a, 0x37, 0x52, + 0x69, 0x56, 0x4c, 0x6f, 0x4a, 0x39, 0x32, 0x4f, 0x77, 0x6b, 0x36, 0x4b, + 0x61, 0x0a, 0x2b, 0x65, 0x6c, 0x53, 0x4c, 0x6f, 0x74, 0x67, 0x45, 0x71, + 0x76, 0x38, 0x39, 0x57, 0x42, 0x57, 0x37, 0x78, 0x42, 0x63, 0x69, 0x38, + 0x51, 0x61, 0x51, 0x74, 0x79, 0x44, 0x57, 0x32, 0x51, 0x4f, 0x79, 0x37, + 0x57, 0x38, 0x31, 0x6b, 0x2f, 0x42, 0x66, 0x44, 0x78, 0x75, 0x6a, 0x52, + 0x4e, 0x74, 0x2b, 0x33, 0x76, 0x72, 0x4d, 0x4e, 0x44, 0x63, 0x54, 0x61, + 0x2f, 0x46, 0x31, 0x62, 0x61, 0x6c, 0x0a, 0x54, 0x46, 0x74, 0x78, 0x79, + 0x65, 0x67, 0x78, 0x76, 0x75, 0x67, 0x34, 0x42, 0x6b, 0x69, 0x68, 0x47, + 0x75, 0x4c, 0x71, 0x30, 0x74, 0x34, 0x53, 0x4f, 0x56, 0x67, 0x61, 0x2f, + 0x34, 0x41, 0x4f, 0x67, 0x6e, 0x58, 0x6d, 0x74, 0x38, 0x6b, 0x48, 0x62, + 0x41, 0x37, 0x76, 0x2f, 0x7a, 0x6a, 0x78, 0x6d, 0x48, 0x48, 0x45, 0x74, + 0x33, 0x38, 0x4f, 0x46, 0x64, 0x41, 0x6c, 0x61, 0x62, 0x30, 0x69, 0x0a, + 0x6e, 0x53, 0x76, 0x74, 0x42, 0x66, 0x5a, 0x47, 0x52, 0x36, 0x7a, 0x74, + 0x77, 0x50, 0x44, 0x55, 0x4f, 0x2b, 0x4c, 0x73, 0x37, 0x70, 0x5a, 0x62, + 0x6b, 0x42, 0x4e, 0x4f, 0x48, 0x6c, 0x59, 0x36, 0x36, 0x37, 0x44, 0x76, + 0x6c, 0x72, 0x75, 0x57, 0x49, 0x78, 0x47, 0x36, 0x38, 0x6b, 0x4f, 0x47, + 0x64, 0x47, 0x53, 0x56, 0x79, 0x43, 0x68, 0x31, 0x33, 0x78, 0x30, 0x31, + 0x75, 0x74, 0x49, 0x33, 0x0a, 0x67, 0x7a, 0x68, 0x54, 0x4f, 0x44, 0x59, + 0x37, 0x7a, 0x32, 0x7a, 0x70, 0x2b, 0x57, 0x73, 0x4f, 0x30, 0x50, 0x73, + 0x45, 0x36, 0x45, 0x39, 0x33, 0x31, 0x32, 0x55, 0x42, 0x65, 0x49, 0x59, + 0x4d, 0x65, 0x6a, 0x34, 0x68, 0x59, 0x76, 0x46, 0x2f, 0x59, 0x33, 0x45, + 0x4d, 0x79, 0x5a, 0x39, 0x45, 0x32, 0x36, 0x67, 0x6e, 0x6f, 0x6e, 0x57, + 0x2b, 0x62, 0x6f, 0x45, 0x2b, 0x31, 0x38, 0x44, 0x72, 0x0a, 0x47, 0x35, + 0x67, 0x50, 0x63, 0x46, 0x77, 0x30, 0x73, 0x6f, 0x72, 0x4d, 0x77, 0x49, + 0x55, 0x59, 0x36, 0x32, 0x35, 0x36, 0x73, 0x2f, 0x64, 0x61, 0x6f, 0x51, + 0x65, 0x2f, 0x71, 0x55, 0x4b, 0x53, 0x38, 0x32, 0x41, 0x69, 0x6c, 0x2b, + 0x51, 0x55, 0x6f, 0x51, 0x65, 0x62, 0x54, 0x6e, 0x62, 0x41, 0x6a, 0x6e, + 0x33, 0x39, 0x70, 0x43, 0x58, 0x48, 0x52, 0x2b, 0x33, 0x2f, 0x48, 0x33, + 0x4f, 0x73, 0x0a, 0x7a, 0x4d, 0x4f, 0x6c, 0x36, 0x57, 0x38, 0x4b, 0x6a, + 0x70, 0x74, 0x6c, 0x77, 0x6c, 0x43, 0x46, 0x74, 0x61, 0x4f, 0x67, 0x55, + 0x78, 0x4c, 0x4d, 0x56, 0x59, 0x64, 0x68, 0x38, 0x34, 0x47, 0x75, 0x45, + 0x45, 0x5a, 0x68, 0x76, 0x55, 0x51, 0x68, 0x75, 0x4d, 0x49, 0x39, 0x64, + 0x4d, 0x39, 0x2b, 0x4a, 0x44, 0x58, 0x36, 0x48, 0x41, 0x63, 0x4f, 0x6d, + 0x7a, 0x30, 0x69, 0x79, 0x75, 0x38, 0x78, 0x0a, 0x4c, 0x34, 0x79, 0x73, + 0x45, 0x72, 0x33, 0x76, 0x51, 0x43, 0x6a, 0x38, 0x4b, 0x57, 0x65, 0x66, + 0x73, 0x68, 0x4e, 0x50, 0x5a, 0x69, 0x54, 0x45, 0x55, 0x78, 0x6e, 0x70, + 0x48, 0x69, 0x6b, 0x56, 0x37, 0x2b, 0x5a, 0x74, 0x73, 0x48, 0x38, 0x74, + 0x5a, 0x2f, 0x33, 0x7a, 0x62, 0x42, 0x74, 0x31, 0x52, 0x71, 0x50, 0x6c, + 0x53, 0x68, 0x66, 0x70, 0x70, 0x4e, 0x63, 0x4c, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x41, 0x43, 0x43, 0x56, 0x52, 0x41, 0x49, 0x5a, 0x31, 0x20, 0x4f, + 0x3d, 0x41, 0x43, 0x43, 0x56, 0x20, 0x4f, 0x55, 0x3d, 0x50, 0x4b, 0x49, + 0x41, 0x43, 0x43, 0x56, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x43, 0x43, 0x56, 0x52, + 0x41, 0x49, 0x5a, 0x31, 0x20, 0x4f, 0x3d, 0x41, 0x43, 0x43, 0x56, 0x20, + 0x4f, 0x55, 0x3d, 0x50, 0x4b, 0x49, 0x41, 0x43, 0x43, 0x56, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x43, 0x43, + 0x56, 0x52, 0x41, 0x49, 0x5a, 0x31, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x38, 0x32, 0x38, 0x35, 0x30, + 0x33, 0x33, 0x38, 0x34, 0x37, 0x34, 0x38, 0x36, 0x39, 0x36, 0x38, 0x30, + 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x30, 0x3a, + 0x61, 0x30, 0x3a, 0x35, 0x61, 0x3a, 0x65, 0x65, 0x3a, 0x30, 0x35, 0x3a, + 0x62, 0x36, 0x3a, 0x30, 0x39, 0x3a, 0x39, 0x34, 0x3a, 0x32, 0x31, 0x3a, + 0x61, 0x31, 0x3a, 0x37, 0x64, 0x3a, 0x66, 0x31, 0x3a, 0x62, 0x32, 0x3a, + 0x32, 0x39, 0x3a, 0x38, 0x32, 0x3a, 0x30, 0x32, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x37, + 0x61, 0x3a, 0x38, 0x38, 0x3a, 0x31, 0x35, 0x3a, 0x63, 0x36, 0x3a, 0x34, + 0x66, 0x3a, 0x63, 0x65, 0x3a, 0x38, 0x38, 0x3a, 0x32, 0x66, 0x3a, 0x66, + 0x61, 0x3a, 0x39, 0x31, 0x3a, 0x31, 0x36, 0x3a, 0x35, 0x32, 0x3a, 0x32, + 0x38, 0x3a, 0x37, 0x38, 0x3a, 0x62, 0x63, 0x3a, 0x35, 0x33, 0x3a, 0x36, + 0x34, 0x3a, 0x31, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x39, 0x61, 0x3a, 0x36, 0x65, 0x3a, 0x63, 0x30, 0x3a, + 0x31, 0x32, 0x3a, 0x65, 0x31, 0x3a, 0x61, 0x37, 0x3a, 0x64, 0x61, 0x3a, + 0x39, 0x64, 0x3a, 0x62, 0x65, 0x3a, 0x33, 0x34, 0x3a, 0x31, 0x39, 0x3a, + 0x34, 0x64, 0x3a, 0x34, 0x37, 0x3a, 0x38, 0x61, 0x3a, 0x64, 0x37, 0x3a, + 0x63, 0x30, 0x3a, 0x64, 0x62, 0x3a, 0x31, 0x38, 0x3a, 0x32, 0x32, 0x3a, + 0x66, 0x62, 0x3a, 0x30, 0x37, 0x3a, 0x31, 0x64, 0x3a, 0x66, 0x31, 0x3a, + 0x32, 0x39, 0x3a, 0x38, 0x31, 0x3a, 0x34, 0x39, 0x3a, 0x36, 0x65, 0x3a, + 0x64, 0x31, 0x3a, 0x30, 0x34, 0x3a, 0x33, 0x38, 0x3a, 0x34, 0x31, 0x3a, + 0x31, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, + 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x48, 0x30, + 0x7a, 0x43, 0x43, 0x42, 0x62, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, + 0x67, 0x49, 0x49, 0x58, 0x73, 0x4f, 0x33, 0x70, 0x6b, 0x4e, 0x2f, 0x70, + 0x4f, 0x41, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x51, + 0x6a, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, + 0x41, 0x77, 0x77, 0x4a, 0x51, 0x55, 0x4e, 0x44, 0x56, 0x6c, 0x4a, 0x42, + 0x53, 0x56, 0x6f, 0x78, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x44, 0x41, 0x64, 0x51, 0x53, 0x30, 0x6c, 0x42, + 0x51, 0x30, 0x4e, 0x57, 0x4d, 0x51, 0x30, 0x77, 0x43, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, 0x52, 0x42, 0x51, 0x30, 0x4e, 0x57, + 0x4d, 0x51, 0x73, 0x77, 0x0a, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x46, 0x55, 0x7a, 0x41, 0x65, 0x46, 0x77, 0x30, + 0x78, 0x4d, 0x54, 0x41, 0x31, 0x4d, 0x44, 0x55, 0x77, 0x4f, 0x54, 0x4d, + 0x33, 0x4d, 0x7a, 0x64, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4d, 0x44, 0x45, + 0x79, 0x4d, 0x7a, 0x45, 0x77, 0x4f, 0x54, 0x4d, 0x33, 0x4d, 0x7a, 0x64, + 0x61, 0x4d, 0x45, 0x49, 0x78, 0x45, 0x6a, 0x41, 0x51, 0x0a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x43, 0x55, 0x46, 0x44, 0x51, 0x31, + 0x5a, 0x53, 0x51, 0x55, 0x6c, 0x61, 0x4d, 0x54, 0x45, 0x51, 0x4d, 0x41, + 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x77, 0x77, 0x48, 0x55, 0x45, + 0x74, 0x4a, 0x51, 0x55, 0x4e, 0x44, 0x56, 0x6a, 0x45, 0x4e, 0x4d, 0x41, + 0x73, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x45, 0x51, 0x55, + 0x4e, 0x44, 0x0a, 0x56, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x56, 0x4d, 0x77, 0x67, + 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, + 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x62, 0x0a, 0x71, 0x61, 0x75, 0x2f, + 0x59, 0x55, 0x71, 0x58, 0x72, 0x79, 0x2b, 0x58, 0x5a, 0x70, 0x70, 0x30, + 0x58, 0x39, 0x44, 0x5a, 0x6c, 0x76, 0x33, 0x50, 0x34, 0x75, 0x52, 0x6d, + 0x37, 0x78, 0x38, 0x66, 0x52, 0x7a, 0x50, 0x43, 0x52, 0x4b, 0x50, 0x66, + 0x6d, 0x74, 0x34, 0x66, 0x74, 0x56, 0x54, 0x64, 0x46, 0x58, 0x78, 0x70, + 0x4e, 0x52, 0x46, 0x76, 0x75, 0x38, 0x67, 0x4d, 0x6a, 0x6d, 0x6f, 0x59, + 0x0a, 0x48, 0x74, 0x69, 0x50, 0x32, 0x52, 0x61, 0x38, 0x45, 0x45, 0x67, + 0x32, 0x58, 0x50, 0x42, 0x6a, 0x73, 0x35, 0x42, 0x61, 0x58, 0x43, 0x51, + 0x33, 0x31, 0x36, 0x50, 0x57, 0x79, 0x77, 0x6c, 0x78, 0x75, 0x66, 0x45, + 0x42, 0x63, 0x6f, 0x53, 0x77, 0x66, 0x64, 0x74, 0x4e, 0x67, 0x4d, 0x33, + 0x38, 0x30, 0x32, 0x2f, 0x4a, 0x2b, 0x4e, 0x71, 0x32, 0x44, 0x6f, 0x4c, + 0x53, 0x52, 0x59, 0x57, 0x6f, 0x0a, 0x47, 0x32, 0x69, 0x6f, 0x50, 0x65, + 0x6a, 0x30, 0x52, 0x47, 0x79, 0x39, 0x6f, 0x63, 0x4c, 0x4c, 0x41, 0x37, + 0x36, 0x4d, 0x50, 0x68, 0x4d, 0x41, 0x68, 0x4e, 0x39, 0x4b, 0x53, 0x4d, + 0x44, 0x6a, 0x49, 0x67, 0x72, 0x6f, 0x36, 0x54, 0x65, 0x6e, 0x47, 0x45, + 0x79, 0x78, 0x43, 0x51, 0x30, 0x6a, 0x56, 0x6e, 0x38, 0x45, 0x54, 0x64, + 0x6b, 0x58, 0x68, 0x42, 0x69, 0x6c, 0x79, 0x4e, 0x70, 0x41, 0x0a, 0x6c, + 0x48, 0x50, 0x72, 0x7a, 0x67, 0x35, 0x58, 0x50, 0x41, 0x4f, 0x42, 0x4f, + 0x70, 0x30, 0x4b, 0x6f, 0x56, 0x64, 0x44, 0x61, 0x61, 0x78, 0x58, 0x62, + 0x58, 0x6d, 0x51, 0x65, 0x4f, 0x57, 0x31, 0x74, 0x44, 0x76, 0x59, 0x76, + 0x45, 0x79, 0x4e, 0x4b, 0x4b, 0x47, 0x6e, 0x6f, 0x36, 0x65, 0x36, 0x41, + 0x6b, 0x34, 0x6c, 0x30, 0x53, 0x71, 0x75, 0x37, 0x61, 0x34, 0x44, 0x49, + 0x72, 0x68, 0x72, 0x0a, 0x49, 0x41, 0x38, 0x77, 0x4b, 0x46, 0x53, 0x56, + 0x66, 0x2b, 0x44, 0x75, 0x7a, 0x67, 0x70, 0x6d, 0x6e, 0x64, 0x46, 0x41, + 0x4c, 0x57, 0x34, 0x69, 0x72, 0x35, 0x30, 0x61, 0x77, 0x51, 0x55, 0x5a, + 0x30, 0x6d, 0x2f, 0x41, 0x38, 0x70, 0x2f, 0x34, 0x65, 0x37, 0x4d, 0x43, + 0x51, 0x76, 0x74, 0x51, 0x71, 0x52, 0x30, 0x74, 0x6b, 0x77, 0x38, 0x6a, + 0x71, 0x38, 0x62, 0x42, 0x44, 0x35, 0x4c, 0x2f, 0x0a, 0x30, 0x4b, 0x49, + 0x56, 0x39, 0x56, 0x4d, 0x4a, 0x63, 0x52, 0x7a, 0x2f, 0x52, 0x52, 0x4f, + 0x45, 0x35, 0x69, 0x5a, 0x65, 0x2b, 0x4f, 0x43, 0x49, 0x48, 0x41, 0x72, + 0x38, 0x46, 0x72, 0x61, 0x6f, 0x63, 0x77, 0x61, 0x34, 0x38, 0x47, 0x4f, + 0x45, 0x41, 0x71, 0x44, 0x47, 0x57, 0x75, 0x7a, 0x6e, 0x64, 0x4e, 0x39, + 0x77, 0x72, 0x71, 0x4f, 0x44, 0x4a, 0x65, 0x72, 0x57, 0x78, 0x35, 0x65, + 0x48, 0x0a, 0x6b, 0x36, 0x66, 0x47, 0x69, 0x6f, 0x6f, 0x7a, 0x6c, 0x32, + 0x41, 0x33, 0x45, 0x44, 0x36, 0x58, 0x50, 0x6d, 0x34, 0x70, 0x46, 0x64, + 0x61, 0x68, 0x44, 0x39, 0x47, 0x49, 0x4c, 0x42, 0x4b, 0x66, 0x62, 0x36, + 0x71, 0x6b, 0x78, 0x6b, 0x4c, 0x72, 0x51, 0x61, 0x4c, 0x6a, 0x6c, 0x55, + 0x50, 0x54, 0x41, 0x59, 0x56, 0x74, 0x6a, 0x72, 0x73, 0x37, 0x38, 0x79, + 0x4d, 0x32, 0x78, 0x2f, 0x34, 0x37, 0x0a, 0x34, 0x4b, 0x45, 0x6c, 0x42, + 0x30, 0x69, 0x72, 0x79, 0x59, 0x6c, 0x30, 0x2f, 0x77, 0x69, 0x50, 0x67, + 0x4c, 0x2f, 0x41, 0x6c, 0x6d, 0x58, 0x7a, 0x37, 0x75, 0x78, 0x4c, 0x61, + 0x4c, 0x32, 0x64, 0x69, 0x4d, 0x4d, 0x78, 0x73, 0x30, 0x44, 0x78, 0x36, + 0x4d, 0x2f, 0x32, 0x4f, 0x4c, 0x75, 0x63, 0x35, 0x4e, 0x46, 0x2f, 0x31, + 0x4f, 0x56, 0x59, 0x6d, 0x33, 0x7a, 0x36, 0x31, 0x50, 0x4d, 0x4f, 0x0a, + 0x6d, 0x33, 0x57, 0x52, 0x35, 0x4c, 0x70, 0x53, 0x4c, 0x68, 0x6c, 0x2b, + 0x30, 0x66, 0x58, 0x4e, 0x57, 0x68, 0x6e, 0x38, 0x75, 0x67, 0x62, 0x32, + 0x2b, 0x31, 0x4b, 0x6f, 0x53, 0x35, 0x6b, 0x45, 0x33, 0x66, 0x6a, 0x35, + 0x74, 0x49, 0x74, 0x51, 0x6f, 0x30, 0x35, 0x69, 0x69, 0x66, 0x43, 0x48, + 0x4a, 0x50, 0x71, 0x44, 0x51, 0x73, 0x47, 0x48, 0x2b, 0x74, 0x55, 0x74, + 0x4b, 0x53, 0x70, 0x61, 0x0a, 0x63, 0x58, 0x70, 0x6b, 0x61, 0x74, 0x63, + 0x6e, 0x59, 0x47, 0x4d, 0x4e, 0x32, 0x38, 0x35, 0x4a, 0x39, 0x59, 0x30, + 0x66, 0x6b, 0x49, 0x6b, 0x79, 0x46, 0x2f, 0x68, 0x7a, 0x51, 0x37, 0x6a, + 0x53, 0x57, 0x70, 0x4f, 0x47, 0x59, 0x64, 0x62, 0x68, 0x64, 0x51, 0x72, + 0x71, 0x65, 0x57, 0x5a, 0x32, 0x69, 0x45, 0x39, 0x78, 0x36, 0x77, 0x51, + 0x6c, 0x31, 0x67, 0x70, 0x61, 0x65, 0x70, 0x50, 0x6c, 0x0a, 0x75, 0x55, + 0x73, 0x58, 0x51, 0x41, 0x2b, 0x78, 0x74, 0x72, 0x6e, 0x31, 0x33, 0x6b, + 0x2f, 0x63, 0x34, 0x4c, 0x4f, 0x73, 0x4f, 0x78, 0x46, 0x77, 0x59, 0x49, + 0x52, 0x4b, 0x51, 0x32, 0x36, 0x5a, 0x49, 0x4d, 0x41, 0x70, 0x63, 0x51, + 0x72, 0x41, 0x5a, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, + 0x49, 0x43, 0x79, 0x7a, 0x43, 0x43, 0x41, 0x73, 0x63, 0x77, 0x66, 0x51, + 0x59, 0x49, 0x0a, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55, 0x48, 0x41, + 0x51, 0x45, 0x45, 0x63, 0x54, 0x42, 0x76, 0x4d, 0x45, 0x77, 0x47, 0x43, + 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x7a, 0x41, 0x43, 0x68, + 0x6b, 0x42, 0x6f, 0x64, 0x48, 0x52, 0x77, 0x4f, 0x69, 0x38, 0x76, 0x64, + 0x33, 0x64, 0x33, 0x4c, 0x6d, 0x46, 0x6a, 0x59, 0x33, 0x59, 0x75, 0x5a, + 0x58, 0x4d, 0x76, 0x5a, 0x6d, 0x6c, 0x73, 0x0a, 0x5a, 0x57, 0x46, 0x6b, + 0x62, 0x57, 0x6c, 0x75, 0x4c, 0x30, 0x46, 0x79, 0x59, 0x32, 0x68, 0x70, + 0x64, 0x6d, 0x39, 0x7a, 0x4c, 0x32, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, + 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x57, 0x52, 0x76, 0x63, 0x79, 0x39, 0x79, + 0x59, 0x57, 0x6c, 0x36, 0x59, 0x57, 0x4e, 0x6a, 0x64, 0x6a, 0x45, 0x75, + 0x59, 0x33, 0x4a, 0x30, 0x4d, 0x42, 0x38, 0x47, 0x43, 0x43, 0x73, 0x47, + 0x0a, 0x41, 0x51, 0x55, 0x46, 0x42, 0x7a, 0x41, 0x42, 0x68, 0x68, 0x4e, + 0x6f, 0x64, 0x48, 0x52, 0x77, 0x4f, 0x69, 0x38, 0x76, 0x62, 0x32, 0x4e, + 0x7a, 0x63, 0x43, 0x35, 0x68, 0x59, 0x32, 0x4e, 0x32, 0x4c, 0x6d, 0x56, + 0x7a, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, + 0x57, 0x42, 0x42, 0x54, 0x53, 0x68, 0x37, 0x54, 0x6a, 0x33, 0x7a, 0x63, + 0x6e, 0x6b, 0x31, 0x58, 0x32, 0x0a, 0x56, 0x75, 0x71, 0x42, 0x35, 0x54, + 0x62, 0x4d, 0x6a, 0x42, 0x34, 0x2f, 0x76, 0x54, 0x41, 0x50, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, + 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, 0x38, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x49, 0x77, 0x51, 0x59, 0x4d, 0x42, 0x61, 0x41, 0x46, 0x4e, + 0x4b, 0x48, 0x74, 0x4f, 0x50, 0x66, 0x4e, 0x79, 0x65, 0x54, 0x0a, 0x56, + 0x66, 0x5a, 0x57, 0x36, 0x6f, 0x48, 0x6c, 0x4e, 0x73, 0x79, 0x4d, 0x48, + 0x6a, 0x2b, 0x39, 0x4d, 0x49, 0x49, 0x42, 0x63, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x67, 0x42, 0x49, 0x49, 0x42, 0x61, 0x6a, 0x43, 0x43, 0x41, + 0x57, 0x59, 0x77, 0x67, 0x67, 0x46, 0x69, 0x42, 0x67, 0x52, 0x56, 0x48, + 0x53, 0x41, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x57, 0x44, 0x43, 0x43, 0x41, + 0x53, 0x49, 0x47, 0x0a, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, + 0x42, 0x77, 0x49, 0x43, 0x4d, 0x49, 0x49, 0x42, 0x46, 0x42, 0x36, 0x43, + 0x41, 0x52, 0x41, 0x41, 0x51, 0x51, 0x42, 0x31, 0x41, 0x48, 0x51, 0x41, + 0x62, 0x77, 0x42, 0x79, 0x41, 0x47, 0x6b, 0x41, 0x5a, 0x41, 0x42, 0x68, + 0x41, 0x47, 0x51, 0x41, 0x49, 0x41, 0x42, 0x6b, 0x41, 0x47, 0x55, 0x41, + 0x49, 0x41, 0x42, 0x44, 0x41, 0x47, 0x55, 0x41, 0x0a, 0x63, 0x67, 0x42, + 0x30, 0x41, 0x47, 0x6b, 0x41, 0x5a, 0x67, 0x42, 0x70, 0x41, 0x47, 0x4d, + 0x41, 0x59, 0x51, 0x42, 0x6a, 0x41, 0x47, 0x6b, 0x41, 0x38, 0x77, 0x42, + 0x75, 0x41, 0x43, 0x41, 0x41, 0x55, 0x67, 0x42, 0x68, 0x41, 0x4f, 0x30, + 0x41, 0x65, 0x67, 0x41, 0x67, 0x41, 0x47, 0x51, 0x41, 0x5a, 0x51, 0x41, + 0x67, 0x41, 0x47, 0x77, 0x41, 0x59, 0x51, 0x41, 0x67, 0x41, 0x45, 0x45, + 0x41, 0x0a, 0x51, 0x77, 0x42, 0x44, 0x41, 0x46, 0x59, 0x41, 0x49, 0x41, + 0x41, 0x6f, 0x41, 0x45, 0x45, 0x41, 0x5a, 0x77, 0x42, 0x6c, 0x41, 0x47, + 0x34, 0x41, 0x59, 0x77, 0x42, 0x70, 0x41, 0x47, 0x45, 0x41, 0x49, 0x41, + 0x42, 0x6b, 0x41, 0x47, 0x55, 0x41, 0x49, 0x41, 0x42, 0x55, 0x41, 0x47, + 0x55, 0x41, 0x59, 0x77, 0x42, 0x75, 0x41, 0x47, 0x38, 0x41, 0x62, 0x41, + 0x42, 0x76, 0x41, 0x47, 0x63, 0x41, 0x0a, 0x37, 0x51, 0x42, 0x68, 0x41, + 0x43, 0x41, 0x41, 0x65, 0x51, 0x41, 0x67, 0x41, 0x45, 0x4d, 0x41, 0x5a, + 0x51, 0x42, 0x79, 0x41, 0x48, 0x51, 0x41, 0x61, 0x51, 0x42, 0x6d, 0x41, + 0x47, 0x6b, 0x41, 0x59, 0x77, 0x42, 0x68, 0x41, 0x47, 0x4d, 0x41, 0x61, + 0x51, 0x44, 0x7a, 0x41, 0x47, 0x34, 0x41, 0x49, 0x41, 0x42, 0x46, 0x41, + 0x47, 0x77, 0x41, 0x5a, 0x51, 0x42, 0x6a, 0x41, 0x48, 0x51, 0x41, 0x0a, + 0x63, 0x67, 0x44, 0x7a, 0x41, 0x47, 0x34, 0x41, 0x61, 0x51, 0x42, 0x6a, + 0x41, 0x47, 0x45, 0x41, 0x4c, 0x41, 0x41, 0x67, 0x41, 0x45, 0x4d, 0x41, + 0x53, 0x51, 0x42, 0x47, 0x41, 0x43, 0x41, 0x41, 0x55, 0x51, 0x41, 0x30, + 0x41, 0x44, 0x59, 0x41, 0x4d, 0x41, 0x41, 0x78, 0x41, 0x44, 0x45, 0x41, + 0x4e, 0x51, 0x41, 0x32, 0x41, 0x45, 0x55, 0x41, 0x4b, 0x51, 0x41, 0x75, + 0x41, 0x43, 0x41, 0x41, 0x0a, 0x51, 0x77, 0x42, 0x51, 0x41, 0x46, 0x4d, + 0x41, 0x49, 0x41, 0x42, 0x6c, 0x41, 0x47, 0x34, 0x41, 0x49, 0x41, 0x42, + 0x6f, 0x41, 0x48, 0x51, 0x41, 0x64, 0x41, 0x42, 0x77, 0x41, 0x44, 0x6f, + 0x41, 0x4c, 0x77, 0x41, 0x76, 0x41, 0x48, 0x63, 0x41, 0x64, 0x77, 0x42, + 0x33, 0x41, 0x43, 0x34, 0x41, 0x59, 0x51, 0x42, 0x6a, 0x41, 0x47, 0x4d, + 0x41, 0x64, 0x67, 0x41, 0x75, 0x41, 0x47, 0x55, 0x41, 0x0a, 0x63, 0x7a, + 0x41, 0x77, 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, + 0x63, 0x43, 0x41, 0x52, 0x59, 0x6b, 0x61, 0x48, 0x52, 0x30, 0x63, 0x44, + 0x6f, 0x76, 0x4c, 0x33, 0x64, 0x33, 0x64, 0x79, 0x35, 0x68, 0x59, 0x32, + 0x4e, 0x32, 0x4c, 0x6d, 0x56, 0x7a, 0x4c, 0x32, 0x78, 0x6c, 0x5a, 0x32, + 0x6c, 0x7a, 0x62, 0x47, 0x46, 0x6a, 0x61, 0x57, 0x39, 0x75, 0x58, 0x32, + 0x4d, 0x75, 0x0a, 0x61, 0x48, 0x52, 0x74, 0x4d, 0x46, 0x55, 0x47, 0x41, + 0x31, 0x55, 0x64, 0x48, 0x77, 0x52, 0x4f, 0x4d, 0x45, 0x77, 0x77, 0x53, + 0x71, 0x42, 0x49, 0x6f, 0x45, 0x61, 0x47, 0x52, 0x47, 0x68, 0x30, 0x64, + 0x48, 0x41, 0x36, 0x4c, 0x79, 0x39, 0x33, 0x64, 0x33, 0x63, 0x75, 0x59, + 0x57, 0x4e, 0x6a, 0x64, 0x69, 0x35, 0x6c, 0x63, 0x79, 0x39, 0x6d, 0x61, + 0x57, 0x78, 0x6c, 0x59, 0x57, 0x52, 0x74, 0x0a, 0x61, 0x57, 0x34, 0x76, + 0x51, 0x58, 0x4a, 0x6a, 0x61, 0x47, 0x6c, 0x32, 0x62, 0x33, 0x4d, 0x76, + 0x59, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, + 0x5a, 0x47, 0x39, 0x7a, 0x4c, 0x33, 0x4a, 0x68, 0x61, 0x58, 0x70, 0x68, + 0x59, 0x32, 0x4e, 0x32, 0x4d, 0x56, 0x39, 0x6b, 0x5a, 0x58, 0x49, 0x75, + 0x59, 0x33, 0x4a, 0x73, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x0a, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x42, 0x6a, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x45, + 0x45, 0x45, 0x44, 0x41, 0x4f, 0x67, 0x51, 0x78, 0x68, 0x59, 0x32, 0x4e, + 0x32, 0x51, 0x47, 0x46, 0x6a, 0x59, 0x33, 0x59, 0x75, 0x5a, 0x58, 0x4d, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x46, 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x49, 0x42, 0x41, 0x4a, 0x63, 0x78, 0x41, 0x70, 0x2f, 0x6e, 0x2f, 0x55, + 0x4e, 0x6e, 0x53, 0x45, 0x51, 0x55, 0x35, 0x43, 0x6d, 0x48, 0x37, 0x55, + 0x77, 0x6f, 0x5a, 0x74, 0x43, 0x50, 0x4e, 0x64, 0x70, 0x4e, 0x59, 0x62, + 0x64, 0x4b, 0x6c, 0x30, 0x32, 0x31, 0x32, 0x35, 0x44, 0x67, 0x42, 0x53, + 0x34, 0x4f, 0x78, 0x6e, 0x6e, 0x51, 0x38, 0x70, 0x64, 0x70, 0x0a, 0x44, + 0x37, 0x30, 0x45, 0x52, 0x39, 0x6d, 0x2b, 0x32, 0x37, 0x55, 0x70, 0x32, + 0x70, 0x76, 0x5a, 0x72, 0x71, 0x6d, 0x5a, 0x31, 0x64, 0x4d, 0x38, 0x4d, + 0x4a, 0x50, 0x31, 0x6a, 0x61, 0x47, 0x6f, 0x2f, 0x41, 0x61, 0x4e, 0x52, + 0x50, 0x54, 0x4b, 0x46, 0x70, 0x56, 0x38, 0x4d, 0x39, 0x78, 0x69, 0x69, + 0x36, 0x67, 0x33, 0x2b, 0x43, 0x66, 0x59, 0x43, 0x53, 0x30, 0x62, 0x37, + 0x38, 0x67, 0x55, 0x0a, 0x4a, 0x79, 0x43, 0x70, 0x5a, 0x45, 0x54, 0x2f, + 0x4c, 0x74, 0x5a, 0x31, 0x71, 0x6d, 0x78, 0x4e, 0x59, 0x45, 0x41, 0x5a, + 0x53, 0x55, 0x4e, 0x55, 0x59, 0x39, 0x72, 0x69, 0x7a, 0x4c, 0x70, 0x6d, + 0x35, 0x55, 0x39, 0x45, 0x65, 0x6c, 0x76, 0x5a, 0x61, 0x6f, 0x45, 0x72, + 0x51, 0x4e, 0x56, 0x2f, 0x2b, 0x51, 0x45, 0x6e, 0x57, 0x43, 0x7a, 0x49, + 0x37, 0x55, 0x69, 0x52, 0x66, 0x44, 0x2b, 0x6d, 0x0a, 0x41, 0x4d, 0x2f, + 0x45, 0x4b, 0x58, 0x4d, 0x52, 0x4e, 0x74, 0x36, 0x47, 0x47, 0x54, 0x36, + 0x64, 0x37, 0x68, 0x6d, 0x4b, 0x47, 0x39, 0x57, 0x77, 0x37, 0x59, 0x34, + 0x39, 0x6e, 0x43, 0x72, 0x41, 0x44, 0x64, 0x67, 0x39, 0x5a, 0x75, 0x4d, + 0x38, 0x44, 0x62, 0x33, 0x56, 0x6c, 0x46, 0x7a, 0x69, 0x34, 0x71, 0x63, + 0x31, 0x47, 0x77, 0x51, 0x41, 0x39, 0x6a, 0x39, 0x61, 0x6a, 0x65, 0x70, + 0x44, 0x0a, 0x76, 0x56, 0x2b, 0x4a, 0x48, 0x61, 0x6e, 0x42, 0x73, 0x4d, + 0x79, 0x5a, 0x34, 0x6b, 0x30, 0x41, 0x43, 0x74, 0x72, 0x4a, 0x4a, 0x31, + 0x76, 0x6e, 0x45, 0x35, 0x42, 0x63, 0x35, 0x50, 0x55, 0x7a, 0x6f, 0x6c, + 0x56, 0x74, 0x33, 0x4f, 0x41, 0x4a, 0x54, 0x53, 0x2b, 0x78, 0x4a, 0x6c, + 0x73, 0x6e, 0x64, 0x51, 0x41, 0x4a, 0x78, 0x47, 0x4a, 0x33, 0x4b, 0x51, + 0x68, 0x66, 0x6e, 0x6c, 0x6d, 0x73, 0x0a, 0x74, 0x6e, 0x36, 0x74, 0x6e, + 0x31, 0x51, 0x77, 0x49, 0x67, 0x50, 0x42, 0x48, 0x6e, 0x46, 0x6b, 0x2f, + 0x76, 0x6b, 0x34, 0x43, 0x70, 0x59, 0x59, 0x33, 0x51, 0x49, 0x55, 0x72, + 0x43, 0x50, 0x4c, 0x42, 0x68, 0x77, 0x65, 0x70, 0x48, 0x32, 0x4e, 0x44, + 0x64, 0x34, 0x6e, 0x51, 0x65, 0x69, 0x74, 0x32, 0x68, 0x57, 0x33, 0x73, + 0x43, 0x50, 0x64, 0x4b, 0x36, 0x6a, 0x54, 0x32, 0x69, 0x57, 0x48, 0x0a, + 0x37, 0x65, 0x68, 0x56, 0x52, 0x45, 0x32, 0x49, 0x39, 0x44, 0x5a, 0x2b, + 0x68, 0x4a, 0x70, 0x34, 0x72, 0x50, 0x63, 0x4f, 0x56, 0x6b, 0x6b, 0x4f, + 0x31, 0x6a, 0x4d, 0x6c, 0x31, 0x6f, 0x52, 0x51, 0x51, 0x6d, 0x77, 0x67, + 0x45, 0x68, 0x30, 0x71, 0x31, 0x62, 0x36, 0x38, 0x38, 0x6e, 0x43, 0x42, + 0x70, 0x48, 0x42, 0x67, 0x76, 0x67, 0x57, 0x31, 0x6d, 0x35, 0x34, 0x45, + 0x52, 0x4c, 0x35, 0x68, 0x0a, 0x49, 0x36, 0x7a, 0x70, 0x70, 0x53, 0x53, + 0x4d, 0x45, 0x59, 0x43, 0x55, 0x57, 0x71, 0x4b, 0x69, 0x75, 0x55, 0x6e, + 0x53, 0x77, 0x64, 0x7a, 0x52, 0x70, 0x2b, 0x30, 0x78, 0x45, 0x53, 0x79, + 0x65, 0x47, 0x61, 0x62, 0x75, 0x34, 0x56, 0x58, 0x68, 0x77, 0x4f, 0x72, + 0x50, 0x44, 0x59, 0x54, 0x6b, 0x46, 0x37, 0x65, 0x69, 0x66, 0x4b, 0x58, + 0x65, 0x56, 0x53, 0x55, 0x47, 0x37, 0x73, 0x7a, 0x41, 0x0a, 0x68, 0x31, + 0x78, 0x41, 0x32, 0x73, 0x79, 0x56, 0x50, 0x31, 0x58, 0x67, 0x4e, 0x63, + 0x65, 0x34, 0x68, 0x4c, 0x36, 0x30, 0x58, 0x63, 0x31, 0x36, 0x67, 0x77, + 0x46, 0x79, 0x37, 0x6f, 0x66, 0x6d, 0x58, 0x78, 0x32, 0x75, 0x74, 0x59, + 0x58, 0x47, 0x4a, 0x74, 0x2f, 0x6d, 0x77, 0x5a, 0x72, 0x70, 0x48, 0x67, + 0x4a, 0x48, 0x6e, 0x79, 0x71, 0x6f, 0x62, 0x61, 0x6c, 0x62, 0x7a, 0x2b, + 0x78, 0x46, 0x0a, 0x64, 0x33, 0x2b, 0x59, 0x4a, 0x35, 0x6f, 0x79, 0x58, + 0x53, 0x72, 0x6a, 0x68, 0x4f, 0x37, 0x46, 0x6d, 0x47, 0x59, 0x76, 0x6c, + 0x69, 0x41, 0x64, 0x33, 0x64, 0x6a, 0x44, 0x4a, 0x39, 0x65, 0x77, 0x2b, + 0x66, 0x37, 0x5a, 0x66, 0x63, 0x33, 0x51, 0x6e, 0x34, 0x38, 0x4c, 0x46, + 0x46, 0x68, 0x52, 0x6e, 0x79, 0x2b, 0x4c, 0x77, 0x7a, 0x67, 0x74, 0x33, + 0x75, 0x69, 0x50, 0x31, 0x6f, 0x32, 0x48, 0x0a, 0x70, 0x50, 0x56, 0x57, + 0x51, 0x78, 0x61, 0x5a, 0x4c, 0x50, 0x53, 0x6b, 0x56, 0x72, 0x51, 0x30, + 0x75, 0x47, 0x45, 0x33, 0x79, 0x63, 0x4a, 0x59, 0x67, 0x42, 0x75, 0x67, + 0x6c, 0x36, 0x48, 0x38, 0x57, 0x59, 0x33, 0x70, 0x45, 0x66, 0x62, 0x52, + 0x44, 0x30, 0x74, 0x56, 0x4e, 0x45, 0x59, 0x71, 0x69, 0x34, 0x59, 0x37, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x57, 0x43, 0x41, 0x20, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x4f, 0x3d, 0x54, 0x41, 0x49, 0x57, 0x41, 0x4e, 0x2d, 0x43, 0x41, + 0x20, 0x4f, 0x55, 0x3d, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x0a, + 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x54, 0x57, 0x43, 0x41, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, + 0x54, 0x41, 0x49, 0x57, 0x41, 0x4e, 0x2d, 0x43, 0x41, 0x20, 0x4f, 0x55, + 0x3d, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x57, 0x43, 0x41, 0x20, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x33, 0x32, 0x36, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x66, 0x39, 0x3a, 0x30, 0x33, 0x3a, 0x37, 0x65, 0x3a, 0x63, + 0x66, 0x3a, 0x65, 0x36, 0x3a, 0x39, 0x65, 0x3a, 0x33, 0x63, 0x3a, 0x37, + 0x33, 0x3a, 0x37, 0x61, 0x3a, 0x32, 0x61, 0x3a, 0x39, 0x30, 0x3a, 0x30, + 0x37, 0x3a, 0x36, 0x39, 0x3a, 0x66, 0x66, 0x3a, 0x32, 0x62, 0x3a, 0x39, + 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x63, + 0x3a, 0x62, 0x62, 0x3a, 0x34, 0x38, 0x3a, 0x35, 0x33, 0x3a, 0x66, 0x36, + 0x3a, 0x61, 0x34, 0x3a, 0x66, 0x36, 0x3a, 0x64, 0x33, 0x3a, 0x35, 0x32, + 0x3a, 0x61, 0x34, 0x3a, 0x65, 0x38, 0x3a, 0x33, 0x32, 0x3a, 0x35, 0x32, + 0x3a, 0x35, 0x35, 0x3a, 0x36, 0x30, 0x3a, 0x31, 0x33, 0x3a, 0x66, 0x35, + 0x3a, 0x61, 0x64, 0x3a, 0x61, 0x66, 0x3a, 0x36, 0x35, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x39, 0x3a, 0x37, + 0x36, 0x3a, 0x39, 0x30, 0x3a, 0x30, 0x37, 0x3a, 0x66, 0x37, 0x3a, 0x36, + 0x38, 0x3a, 0x35, 0x64, 0x3a, 0x30, 0x66, 0x3a, 0x63, 0x64, 0x3a, 0x35, + 0x30, 0x3a, 0x38, 0x37, 0x3a, 0x32, 0x66, 0x3a, 0x39, 0x66, 0x3a, 0x39, + 0x35, 0x3a, 0x64, 0x35, 0x3a, 0x37, 0x35, 0x3a, 0x35, 0x61, 0x3a, 0x35, + 0x62, 0x3a, 0x32, 0x62, 0x3a, 0x34, 0x35, 0x3a, 0x37, 0x64, 0x3a, 0x38, + 0x31, 0x3a, 0x66, 0x33, 0x3a, 0x36, 0x39, 0x3a, 0x32, 0x62, 0x3a, 0x36, + 0x31, 0x3a, 0x30, 0x61, 0x3a, 0x39, 0x38, 0x3a, 0x36, 0x37, 0x3a, 0x32, + 0x66, 0x3a, 0x30, 0x65, 0x3a, 0x31, 0x62, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x46, 0x51, 0x54, 0x43, 0x43, 0x41, 0x79, 0x6d, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x43, 0x44, 0x4c, 0x34, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x55, 0x54, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x56, 0x46, 0x63, 0x78, 0x0a, 0x45, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, 0x56, 0x52, 0x42, 0x53, 0x56, 0x64, + 0x42, 0x54, 0x69, 0x31, 0x44, 0x51, 0x54, 0x45, 0x51, 0x4d, 0x41, 0x34, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x48, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, 0x45, 0x63, 0x4d, 0x42, 0x6f, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x54, 0x0a, 0x56, 0x46, + 0x64, 0x44, 0x51, 0x53, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x77, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x6a, 0x41, 0x32, 0x4d, 0x6a, + 0x63, 0x77, 0x4e, 0x6a, 0x49, 0x34, 0x4d, 0x7a, 0x4e, 0x61, 0x46, 0x77, + 0x30, 0x7a, 0x4d, 0x44, 0x45, 0x79, 0x4d, 0x7a, 0x45, 0x78, 0x4e, 0x54, + 0x55, 0x35, 0x0a, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x46, 0x45, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6c, 0x52, 0x58, 0x4d, 0x52, 0x49, 0x77, 0x45, 0x41, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x45, 0x77, 0x6c, 0x55, 0x51, 0x55, 0x6c, 0x58, 0x51, + 0x55, 0x34, 0x74, 0x51, 0x30, 0x45, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x0a, 0x42, 0x31, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x78, 0x48, 0x44, 0x41, 0x61, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x45, 0x31, 0x52, 0x58, + 0x51, 0x30, 0x45, 0x67, 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, + 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x77, + 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, + 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, + 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x77, 0x42, 0x64, 0x76, + 0x49, 0x36, 0x34, 0x7a, 0x45, 0x62, 0x6f, 0x6f, 0x68, 0x37, 0x34, 0x35, + 0x4e, 0x6e, 0x48, 0x45, 0x4b, 0x48, 0x31, 0x4a, 0x77, 0x37, 0x57, 0x32, + 0x43, 0x6e, 0x4a, 0x66, 0x46, 0x0a, 0x31, 0x30, 0x78, 0x4f, 0x52, 0x55, + 0x6e, 0x4c, 0x51, 0x45, 0x4b, 0x31, 0x45, 0x6a, 0x52, 0x73, 0x47, 0x63, + 0x4a, 0x30, 0x70, 0x44, 0x46, 0x66, 0x68, 0x51, 0x4b, 0x58, 0x37, 0x45, + 0x4d, 0x7a, 0x43, 0x6c, 0x50, 0x53, 0x6e, 0x49, 0x79, 0x4f, 0x74, 0x37, + 0x68, 0x35, 0x32, 0x79, 0x76, 0x56, 0x61, 0x76, 0x4b, 0x4f, 0x5a, 0x73, + 0x54, 0x75, 0x4b, 0x77, 0x45, 0x48, 0x6b, 0x74, 0x53, 0x7a, 0x0a, 0x30, + 0x41, 0x4c, 0x66, 0x55, 0x50, 0x5a, 0x56, 0x72, 0x32, 0x59, 0x4f, 0x79, + 0x2b, 0x42, 0x48, 0x59, 0x43, 0x38, 0x72, 0x4d, 0x6a, 0x6b, 0x31, 0x55, + 0x6a, 0x6f, 0x6f, 0x67, 0x2f, 0x68, 0x37, 0x46, 0x73, 0x59, 0x59, 0x75, + 0x47, 0x4c, 0x57, 0x52, 0x79, 0x57, 0x52, 0x7a, 0x76, 0x41, 0x5a, 0x45, + 0x6b, 0x32, 0x74, 0x59, 0x2f, 0x58, 0x54, 0x50, 0x33, 0x56, 0x66, 0x4b, + 0x66, 0x43, 0x68, 0x0a, 0x4d, 0x42, 0x77, 0x71, 0x6f, 0x4a, 0x69, 0x6d, + 0x46, 0x62, 0x33, 0x75, 0x2f, 0x52, 0x6b, 0x32, 0x38, 0x4f, 0x4b, 0x52, + 0x51, 0x34, 0x2f, 0x36, 0x79, 0x74, 0x59, 0x51, 0x4a, 0x30, 0x6c, 0x4d, + 0x37, 0x39, 0x33, 0x42, 0x38, 0x59, 0x56, 0x77, 0x6d, 0x38, 0x72, 0x71, + 0x71, 0x46, 0x70, 0x44, 0x2f, 0x47, 0x32, 0x47, 0x62, 0x33, 0x50, 0x70, + 0x4e, 0x30, 0x57, 0x70, 0x38, 0x44, 0x62, 0x48, 0x0a, 0x7a, 0x49, 0x68, + 0x31, 0x48, 0x72, 0x74, 0x73, 0x42, 0x76, 0x2b, 0x62, 0x61, 0x7a, 0x34, + 0x58, 0x37, 0x47, 0x47, 0x71, 0x63, 0x58, 0x7a, 0x47, 0x48, 0x61, 0x4c, + 0x33, 0x53, 0x65, 0x6b, 0x56, 0x74, 0x54, 0x7a, 0x57, 0x6f, 0x57, 0x48, + 0x31, 0x45, 0x66, 0x63, 0x46, 0x62, 0x78, 0x33, 0x39, 0x45, 0x62, 0x37, + 0x51, 0x4d, 0x41, 0x66, 0x43, 0x4b, 0x62, 0x41, 0x4a, 0x54, 0x69, 0x62, + 0x63, 0x0a, 0x34, 0x36, 0x4b, 0x6f, 0x6b, 0x57, 0x6f, 0x66, 0x77, 0x70, + 0x46, 0x46, 0x69, 0x46, 0x7a, 0x6c, 0x6d, 0x4c, 0x68, 0x78, 0x70, 0x52, + 0x55, 0x5a, 0x79, 0x58, 0x78, 0x31, 0x45, 0x63, 0x78, 0x77, 0x64, 0x45, + 0x38, 0x74, 0x6d, 0x78, 0x32, 0x52, 0x52, 0x50, 0x31, 0x57, 0x4b, 0x4b, + 0x44, 0x2b, 0x75, 0x34, 0x5a, 0x71, 0x79, 0x50, 0x70, 0x63, 0x43, 0x31, + 0x6a, 0x63, 0x78, 0x6b, 0x74, 0x32, 0x0a, 0x79, 0x4b, 0x73, 0x69, 0x32, + 0x58, 0x4d, 0x50, 0x70, 0x66, 0x52, 0x61, 0x41, 0x6f, 0x6b, 0x2f, 0x54, + 0x35, 0x34, 0x69, 0x67, 0x75, 0x36, 0x69, 0x64, 0x46, 0x4d, 0x71, 0x50, + 0x56, 0x4d, 0x6e, 0x61, 0x52, 0x31, 0x73, 0x6a, 0x6a, 0x49, 0x73, 0x5a, + 0x41, 0x41, 0x6d, 0x59, 0x32, 0x45, 0x32, 0x54, 0x71, 0x4e, 0x47, 0x74, + 0x7a, 0x39, 0x39, 0x73, 0x79, 0x32, 0x73, 0x62, 0x5a, 0x43, 0x69, 0x0a, + 0x6c, 0x61, 0x4c, 0x4f, 0x7a, 0x39, 0x71, 0x43, 0x35, 0x77, 0x63, 0x30, + 0x47, 0x5a, 0x62, 0x70, 0x75, 0x43, 0x47, 0x71, 0x4b, 0x58, 0x36, 0x6d, + 0x4f, 0x4c, 0x36, 0x4f, 0x4b, 0x55, 0x6f, 0x68, 0x5a, 0x6e, 0x6b, 0x66, + 0x73, 0x38, 0x4f, 0x31, 0x43, 0x57, 0x66, 0x65, 0x31, 0x74, 0x51, 0x48, + 0x52, 0x76, 0x4d, 0x71, 0x32, 0x75, 0x59, 0x69, 0x4e, 0x32, 0x44, 0x4c, + 0x67, 0x62, 0x59, 0x50, 0x0a, 0x6f, 0x41, 0x2f, 0x70, 0x79, 0x4a, 0x56, + 0x2f, 0x76, 0x31, 0x57, 0x52, 0x42, 0x58, 0x72, 0x50, 0x50, 0x52, 0x58, + 0x41, 0x62, 0x39, 0x34, 0x4a, 0x6c, 0x41, 0x47, 0x44, 0x31, 0x7a, 0x51, + 0x62, 0x7a, 0x45, 0x43, 0x6c, 0x38, 0x4c, 0x69, 0x62, 0x5a, 0x39, 0x57, + 0x59, 0x6b, 0x54, 0x75, 0x6e, 0x68, 0x48, 0x69, 0x56, 0x4a, 0x71, 0x52, + 0x61, 0x43, 0x50, 0x67, 0x72, 0x64, 0x4c, 0x51, 0x41, 0x0a, 0x42, 0x44, + 0x7a, 0x66, 0x75, 0x42, 0x53, 0x4f, 0x36, 0x4e, 0x2b, 0x70, 0x6a, 0x57, + 0x78, 0x6e, 0x6b, 0x6a, 0x4d, 0x64, 0x77, 0x4c, 0x66, 0x53, 0x37, 0x4a, + 0x4c, 0x49, 0x76, 0x67, 0x6d, 0x2f, 0x4c, 0x43, 0x6b, 0x46, 0x62, 0x77, + 0x4a, 0x72, 0x6e, 0x75, 0x2b, 0x38, 0x76, 0x79, 0x71, 0x38, 0x57, 0x38, + 0x42, 0x51, 0x6a, 0x30, 0x46, 0x77, 0x63, 0x59, 0x65, 0x79, 0x54, 0x62, + 0x63, 0x45, 0x0a, 0x71, 0x59, 0x53, 0x6a, 0x4d, 0x71, 0x2b, 0x75, 0x37, + 0x6d, 0x73, 0x58, 0x69, 0x37, 0x4b, 0x78, 0x2f, 0x6d, 0x7a, 0x68, 0x6b, + 0x49, 0x79, 0x49, 0x71, 0x4a, 0x64, 0x49, 0x7a, 0x73, 0x68, 0x4e, 0x79, + 0x2f, 0x4d, 0x47, 0x7a, 0x31, 0x39, 0x71, 0x43, 0x6b, 0x4b, 0x78, 0x48, + 0x68, 0x35, 0x33, 0x4c, 0x34, 0x36, 0x67, 0x35, 0x70, 0x49, 0x4f, 0x42, + 0x76, 0x77, 0x46, 0x49, 0x74, 0x49, 0x6d, 0x0a, 0x34, 0x54, 0x46, 0x52, + 0x66, 0x54, 0x4c, 0x63, 0x44, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, + 0x6f, 0x79, 0x4d, 0x77, 0x49, 0x54, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, + 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, + 0x0a, 0x2f, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, + 0x43, 0x41, 0x67, 0x45, 0x41, 0x58, 0x7a, 0x53, 0x42, 0x64, 0x75, 0x2b, + 0x57, 0x48, 0x64, 0x58, 0x6c, 0x74, 0x64, 0x6b, 0x43, 0x59, 0x34, 0x51, + 0x57, 0x77, 0x61, 0x36, 0x67, 0x63, 0x46, 0x47, 0x6e, 0x39, 0x30, 0x78, + 0x48, 0x4e, 0x63, 0x67, 0x4c, 0x0a, 0x31, 0x79, 0x67, 0x39, 0x69, 0x58, + 0x48, 0x5a, 0x71, 0x6a, 0x4e, 0x42, 0x36, 0x68, 0x51, 0x62, 0x62, 0x43, + 0x45, 0x41, 0x77, 0x47, 0x78, 0x43, 0x47, 0x58, 0x36, 0x66, 0x61, 0x56, + 0x73, 0x67, 0x51, 0x74, 0x2b, 0x69, 0x30, 0x74, 0x72, 0x45, 0x66, 0x4a, + 0x64, 0x4c, 0x6a, 0x62, 0x44, 0x6f, 0x72, 0x4d, 0x6a, 0x75, 0x70, 0x57, + 0x6b, 0x45, 0x6d, 0x51, 0x71, 0x53, 0x70, 0x71, 0x73, 0x6e, 0x0a, 0x4c, + 0x68, 0x70, 0x4e, 0x67, 0x62, 0x2b, 0x45, 0x31, 0x48, 0x41, 0x65, 0x72, + 0x55, 0x66, 0x2b, 0x2f, 0x55, 0x71, 0x64, 0x4d, 0x2b, 0x44, 0x79, 0x75, + 0x63, 0x52, 0x46, 0x43, 0x43, 0x45, 0x4b, 0x32, 0x6d, 0x6c, 0x70, 0x63, + 0x33, 0x49, 0x4e, 0x76, 0x6a, 0x54, 0x2b, 0x6c, 0x49, 0x75, 0x74, 0x77, + 0x78, 0x34, 0x31, 0x31, 0x36, 0x4b, 0x44, 0x37, 0x2b, 0x55, 0x34, 0x78, + 0x36, 0x57, 0x46, 0x0a, 0x48, 0x36, 0x76, 0x50, 0x4e, 0x4f, 0x77, 0x2f, + 0x4b, 0x50, 0x34, 0x4d, 0x38, 0x56, 0x65, 0x47, 0x54, 0x73, 0x6c, 0x56, + 0x39, 0x78, 0x7a, 0x55, 0x32, 0x4b, 0x56, 0x39, 0x42, 0x6e, 0x70, 0x76, + 0x31, 0x64, 0x38, 0x51, 0x33, 0x34, 0x46, 0x4f, 0x49, 0x57, 0x57, 0x78, + 0x74, 0x75, 0x45, 0x58, 0x65, 0x5a, 0x56, 0x46, 0x42, 0x73, 0x35, 0x66, + 0x7a, 0x4e, 0x78, 0x47, 0x69, 0x57, 0x4e, 0x6f, 0x0a, 0x52, 0x49, 0x32, + 0x54, 0x39, 0x47, 0x52, 0x77, 0x6f, 0x44, 0x32, 0x64, 0x4b, 0x41, 0x58, + 0x44, 0x4f, 0x58, 0x43, 0x34, 0x59, 0x6e, 0x73, 0x67, 0x2f, 0x65, 0x54, + 0x62, 0x36, 0x51, 0x69, 0x68, 0x75, 0x4a, 0x34, 0x39, 0x43, 0x63, 0x64, + 0x50, 0x2b, 0x79, 0x7a, 0x34, 0x6b, 0x33, 0x5a, 0x42, 0x33, 0x6c, 0x4c, + 0x67, 0x34, 0x56, 0x66, 0x53, 0x6e, 0x51, 0x4f, 0x38, 0x64, 0x35, 0x37, + 0x2b, 0x0a, 0x6e, 0x69, 0x6c, 0x65, 0x39, 0x38, 0x46, 0x52, 0x59, 0x42, + 0x2f, 0x65, 0x32, 0x67, 0x75, 0x79, 0x4c, 0x58, 0x57, 0x33, 0x51, 0x30, + 0x69, 0x54, 0x35, 0x2f, 0x5a, 0x35, 0x78, 0x6f, 0x52, 0x64, 0x67, 0x46, + 0x6c, 0x67, 0x6c, 0x50, 0x78, 0x34, 0x6d, 0x49, 0x38, 0x38, 0x6b, 0x31, + 0x48, 0x74, 0x51, 0x4a, 0x41, 0x48, 0x33, 0x32, 0x52, 0x6a, 0x4a, 0x4d, + 0x74, 0x4f, 0x63, 0x51, 0x57, 0x68, 0x0a, 0x31, 0x35, 0x51, 0x61, 0x69, + 0x44, 0x4c, 0x78, 0x49, 0x6e, 0x51, 0x69, 0x72, 0x71, 0x57, 0x6d, 0x32, + 0x42, 0x4a, 0x70, 0x54, 0x47, 0x43, 0x6a, 0x41, 0x75, 0x34, 0x72, 0x37, + 0x4e, 0x52, 0x6a, 0x6b, 0x67, 0x74, 0x65, 0x76, 0x69, 0x39, 0x32, 0x61, + 0x36, 0x4f, 0x32, 0x4a, 0x72, 0x79, 0x50, 0x41, 0x39, 0x67, 0x4b, 0x38, + 0x6b, 0x78, 0x6b, 0x52, 0x72, 0x30, 0x35, 0x59, 0x75, 0x57, 0x57, 0x0a, + 0x36, 0x7a, 0x52, 0x6a, 0x45, 0x53, 0x6a, 0x4d, 0x6c, 0x66, 0x47, 0x74, + 0x37, 0x2b, 0x2f, 0x63, 0x67, 0x46, 0x68, 0x49, 0x36, 0x55, 0x75, 0x34, + 0x36, 0x6d, 0x57, 0x73, 0x36, 0x66, 0x79, 0x41, 0x74, 0x62, 0x58, 0x49, + 0x52, 0x66, 0x6d, 0x73, 0x77, 0x5a, 0x2f, 0x5a, 0x75, 0x65, 0x70, 0x69, + 0x69, 0x49, 0x37, 0x45, 0x38, 0x55, 0x75, 0x44, 0x45, 0x71, 0x33, 0x6d, + 0x69, 0x34, 0x54, 0x57, 0x0a, 0x6e, 0x73, 0x4c, 0x72, 0x67, 0x78, 0x69, + 0x66, 0x61, 0x72, 0x73, 0x62, 0x4a, 0x47, 0x41, 0x7a, 0x63, 0x4d, 0x7a, + 0x73, 0x39, 0x7a, 0x4c, 0x7a, 0x58, 0x4e, 0x6c, 0x35, 0x66, 0x65, 0x2b, + 0x65, 0x70, 0x50, 0x37, 0x4a, 0x49, 0x38, 0x4d, 0x6b, 0x37, 0x68, 0x57, + 0x53, 0x73, 0x54, 0x32, 0x52, 0x54, 0x79, 0x61, 0x47, 0x76, 0x57, 0x5a, + 0x7a, 0x4a, 0x42, 0x50, 0x71, 0x70, 0x4b, 0x35, 0x6a, 0x0a, 0x77, 0x61, + 0x31, 0x39, 0x68, 0x41, 0x4d, 0x38, 0x45, 0x48, 0x69, 0x47, 0x47, 0x33, + 0x6e, 0x6a, 0x78, 0x50, 0x50, 0x79, 0x42, 0x4a, 0x55, 0x67, 0x72, 0x69, + 0x4f, 0x43, 0x78, 0x4c, 0x4d, 0x36, 0x41, 0x47, 0x4b, 0x2f, 0x35, 0x6a, + 0x59, 0x6b, 0x34, 0x56, 0x65, 0x36, 0x78, 0x78, 0x36, 0x51, 0x64, 0x64, + 0x56, 0x66, 0x50, 0x35, 0x56, 0x68, 0x4b, 0x38, 0x45, 0x37, 0x7a, 0x65, + 0x57, 0x7a, 0x0a, 0x61, 0x47, 0x48, 0x51, 0x52, 0x69, 0x61, 0x70, 0x49, + 0x56, 0x4a, 0x70, 0x4c, 0x65, 0x73, 0x75, 0x78, 0x2b, 0x74, 0x33, 0x7a, + 0x71, 0x59, 0x36, 0x74, 0x51, 0x4d, 0x7a, 0x54, 0x33, 0x62, 0x52, 0x35, + 0x31, 0x78, 0x55, 0x41, 0x56, 0x33, 0x4c, 0x65, 0x50, 0x54, 0x4a, 0x44, + 0x4c, 0x2f, 0x50, 0x45, 0x6f, 0x34, 0x58, 0x4c, 0x53, 0x4e, 0x6f, 0x6c, + 0x4f, 0x65, 0x72, 0x2f, 0x71, 0x6d, 0x79, 0x0a, 0x4b, 0x77, 0x62, 0x51, + 0x42, 0x4d, 0x30, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x65, 0x6c, + 0x69, 0x61, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x76, 0x31, 0x20, 0x4f, 0x3d, 0x54, 0x65, + 0x6c, 0x69, 0x61, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x54, 0x65, 0x6c, 0x69, 0x61, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x76, 0x31, 0x20, 0x4f, + 0x3d, 0x54, 0x65, 0x6c, 0x69, 0x61, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, + 0x65, 0x6c, 0x69, 0x61, 0x53, 0x6f, 0x6e, 0x65, 0x72, 0x61, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x76, 0x31, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x39, 0x39, + 0x30, 0x34, 0x31, 0x39, 0x36, 0x36, 0x37, 0x34, 0x31, 0x30, 0x39, 0x30, + 0x31, 0x30, 0x37, 0x39, 0x36, 0x34, 0x39, 0x30, 0x34, 0x32, 0x38, 0x37, + 0x32, 0x31, 0x37, 0x37, 0x38, 0x36, 0x38, 0x30, 0x31, 0x35, 0x35, 0x38, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x37, 0x3a, 0x34, + 0x31, 0x3a, 0x34, 0x39, 0x3a, 0x31, 0x62, 0x3a, 0x31, 0x38, 0x3a, 0x35, + 0x36, 0x3a, 0x39, 0x61, 0x3a, 0x32, 0x36, 0x3a, 0x66, 0x35, 0x3a, 0x61, + 0x64, 0x3a, 0x63, 0x32, 0x3a, 0x36, 0x36, 0x3a, 0x66, 0x62, 0x3a, 0x34, + 0x30, 0x3a, 0x61, 0x35, 0x3a, 0x34, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x33, 0x3a, 0x31, 0x33, 0x3a, 0x62, 0x62, + 0x3a, 0x39, 0x36, 0x3a, 0x66, 0x31, 0x3a, 0x64, 0x35, 0x3a, 0x38, 0x36, + 0x3a, 0x39, 0x62, 0x3a, 0x63, 0x31, 0x3a, 0x34, 0x65, 0x3a, 0x36, 0x61, + 0x3a, 0x39, 0x32, 0x3a, 0x66, 0x36, 0x3a, 0x63, 0x66, 0x3a, 0x66, 0x36, + 0x3a, 0x33, 0x34, 0x3a, 0x36, 0x39, 0x3a, 0x38, 0x37, 0x3a, 0x38, 0x32, + 0x3a, 0x33, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x64, 0x64, 0x3a, 0x36, 0x39, 0x3a, 0x33, 0x36, 0x3a, 0x66, + 0x65, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x38, 0x3a, 0x66, 0x30, 0x3a, 0x37, + 0x37, 0x3a, 0x63, 0x31, 0x3a, 0x32, 0x33, 0x3a, 0x61, 0x31, 0x3a, 0x61, + 0x35, 0x3a, 0x32, 0x31, 0x3a, 0x63, 0x31, 0x3a, 0x32, 0x32, 0x3a, 0x32, + 0x34, 0x3a, 0x66, 0x37, 0x3a, 0x32, 0x32, 0x3a, 0x35, 0x35, 0x3a, 0x62, + 0x37, 0x3a, 0x33, 0x65, 0x3a, 0x30, 0x33, 0x3a, 0x61, 0x37, 0x3a, 0x32, + 0x36, 0x3a, 0x30, 0x36, 0x3a, 0x39, 0x33, 0x3a, 0x65, 0x38, 0x3a, 0x61, + 0x32, 0x3a, 0x34, 0x62, 0x3a, 0x30, 0x66, 0x3a, 0x61, 0x33, 0x3a, 0x38, + 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x4f, 0x44, + 0x43, 0x43, 0x41, 0x79, 0x43, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x52, 0x41, 0x4a, 0x57, 0x2b, 0x46, 0x71, 0x44, 0x33, 0x4c, 0x6b, + 0x62, 0x78, 0x65, 0x7a, 0x6d, 0x43, 0x63, 0x76, 0x71, 0x4c, 0x7a, 0x5a, + 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x46, 0x42, 0x51, 0x41, 0x77, 0x0a, 0x4e, + 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x67, 0x77, 0x4c, 0x56, 0x47, 0x56, 0x73, 0x61, 0x57, 0x46, 0x54, 0x62, + 0x32, 0x35, 0x6c, 0x63, 0x6d, 0x45, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x46, 0x6c, 0x52, 0x6c, 0x62, + 0x47, 0x6c, 0x68, 0x55, 0x32, 0x39, 0x75, 0x5a, 0x58, 0x4a, 0x68, 0x49, + 0x46, 0x4a, 0x76, 0x0a, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, + 0x64, 0x6a, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x63, 0x78, + 0x4d, 0x44, 0x45, 0x34, 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x55, 0x77, + 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x49, 0x78, 0x4d, 0x44, 0x45, 0x34, + 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x55, 0x77, 0x57, 0x6a, 0x41, 0x33, + 0x4d, 0x52, 0x51, 0x77, 0x45, 0x67, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, + 0x4b, 0x44, 0x41, 0x74, 0x55, 0x5a, 0x57, 0x78, 0x70, 0x59, 0x56, 0x4e, + 0x76, 0x62, 0x6d, 0x56, 0x79, 0x59, 0x54, 0x45, 0x66, 0x4d, 0x42, 0x30, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x57, 0x56, 0x47, 0x56, + 0x73, 0x61, 0x57, 0x46, 0x54, 0x62, 0x32, 0x35, 0x6c, 0x63, 0x6d, 0x45, + 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x42, + 0x32, 0x0a, 0x4d, 0x54, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4d, + 0x4b, 0x2b, 0x36, 0x79, 0x66, 0x77, 0x49, 0x61, 0x50, 0x7a, 0x61, 0x53, + 0x5a, 0x56, 0x66, 0x70, 0x33, 0x46, 0x0a, 0x56, 0x52, 0x61, 0x52, 0x58, + 0x50, 0x33, 0x76, 0x49, 0x62, 0x39, 0x54, 0x67, 0x48, 0x6f, 0x74, 0x30, + 0x70, 0x47, 0x4d, 0x59, 0x7a, 0x48, 0x77, 0x37, 0x43, 0x54, 0x77, 0x77, + 0x36, 0x58, 0x53, 0x63, 0x6e, 0x77, 0x51, 0x62, 0x66, 0x51, 0x33, 0x74, + 0x2b, 0x58, 0x6d, 0x66, 0x48, 0x6e, 0x71, 0x6a, 0x4c, 0x57, 0x43, 0x69, + 0x36, 0x35, 0x49, 0x74, 0x71, 0x77, 0x41, 0x33, 0x47, 0x56, 0x31, 0x0a, + 0x37, 0x43, 0x70, 0x4e, 0x58, 0x38, 0x47, 0x48, 0x39, 0x53, 0x42, 0x6c, + 0x4b, 0x34, 0x47, 0x6f, 0x52, 0x7a, 0x36, 0x4a, 0x49, 0x35, 0x55, 0x77, + 0x46, 0x70, 0x42, 0x2f, 0x36, 0x46, 0x63, 0x48, 0x53, 0x4f, 0x63, 0x5a, + 0x72, 0x72, 0x39, 0x46, 0x5a, 0x37, 0x45, 0x33, 0x47, 0x77, 0x59, 0x71, + 0x2f, 0x74, 0x37, 0x35, 0x72, 0x48, 0x32, 0x44, 0x2b, 0x31, 0x36, 0x36, + 0x35, 0x49, 0x2b, 0x58, 0x0a, 0x5a, 0x37, 0x35, 0x4c, 0x6a, 0x6f, 0x31, + 0x6b, 0x42, 0x31, 0x63, 0x34, 0x56, 0x57, 0x6b, 0x30, 0x4e, 0x6a, 0x30, + 0x54, 0x53, 0x4f, 0x39, 0x50, 0x34, 0x74, 0x4e, 0x6d, 0x48, 0x71, 0x54, + 0x50, 0x47, 0x72, 0x64, 0x65, 0x4e, 0x6a, 0x50, 0x55, 0x74, 0x41, 0x61, + 0x39, 0x47, 0x41, 0x48, 0x39, 0x64, 0x34, 0x52, 0x51, 0x41, 0x45, 0x58, + 0x31, 0x6a, 0x46, 0x33, 0x6f, 0x49, 0x37, 0x78, 0x2b, 0x0a, 0x2f, 0x6a, + 0x58, 0x68, 0x37, 0x56, 0x42, 0x37, 0x71, 0x54, 0x43, 0x4e, 0x47, 0x64, + 0x4d, 0x4a, 0x6a, 0x6d, 0x68, 0x6e, 0x58, 0x62, 0x38, 0x38, 0x6c, 0x78, + 0x68, 0x54, 0x75, 0x79, 0x6c, 0x69, 0x78, 0x63, 0x70, 0x65, 0x63, 0x73, + 0x48, 0x48, 0x6c, 0x74, 0x54, 0x62, 0x4c, 0x61, 0x43, 0x30, 0x48, 0x32, + 0x6b, 0x44, 0x37, 0x4f, 0x72, 0x69, 0x55, 0x50, 0x45, 0x4d, 0x50, 0x50, + 0x43, 0x73, 0x0a, 0x38, 0x31, 0x4d, 0x74, 0x38, 0x42, 0x7a, 0x31, 0x37, + 0x57, 0x77, 0x35, 0x4f, 0x58, 0x4f, 0x41, 0x46, 0x73, 0x68, 0x53, 0x73, + 0x43, 0x50, 0x4e, 0x34, 0x44, 0x37, 0x63, 0x33, 0x54, 0x78, 0x48, 0x6f, + 0x4c, 0x73, 0x31, 0x69, 0x75, 0x4b, 0x59, 0x61, 0x49, 0x75, 0x2b, 0x35, + 0x62, 0x39, 0x79, 0x37, 0x74, 0x4c, 0x36, 0x70, 0x65, 0x30, 0x53, 0x37, + 0x66, 0x79, 0x59, 0x47, 0x4b, 0x6b, 0x6d, 0x0a, 0x64, 0x74, 0x77, 0x6f, + 0x53, 0x78, 0x41, 0x67, 0x48, 0x4e, 0x4e, 0x2f, 0x46, 0x6e, 0x63, 0x74, + 0x37, 0x57, 0x2b, 0x41, 0x39, 0x30, 0x6d, 0x37, 0x55, 0x77, 0x57, 0x37, + 0x58, 0x57, 0x6a, 0x48, 0x31, 0x4d, 0x68, 0x31, 0x46, 0x6a, 0x2b, 0x4a, + 0x57, 0x6f, 0x76, 0x33, 0x46, 0x30, 0x66, 0x55, 0x54, 0x50, 0x48, 0x53, + 0x69, 0x58, 0x6b, 0x2b, 0x54, 0x54, 0x32, 0x59, 0x71, 0x47, 0x48, 0x65, + 0x0a, 0x4f, 0x68, 0x37, 0x53, 0x2b, 0x46, 0x34, 0x44, 0x34, 0x4d, 0x48, + 0x4a, 0x48, 0x49, 0x7a, 0x54, 0x6a, 0x55, 0x33, 0x54, 0x6c, 0x54, 0x61, + 0x7a, 0x4e, 0x31, 0x39, 0x6a, 0x59, 0x35, 0x73, 0x7a, 0x46, 0x50, 0x41, + 0x74, 0x4a, 0x6d, 0x74, 0x54, 0x66, 0x49, 0x6d, 0x4d, 0x4d, 0x73, 0x4a, + 0x75, 0x37, 0x44, 0x30, 0x68, 0x41, 0x44, 0x6e, 0x4a, 0x6f, 0x57, 0x6a, + 0x69, 0x55, 0x49, 0x4d, 0x75, 0x0a, 0x73, 0x44, 0x6f, 0x72, 0x38, 0x7a, + 0x61, 0x67, 0x72, 0x43, 0x2f, 0x6b, 0x62, 0x32, 0x48, 0x43, 0x55, 0x51, + 0x6b, 0x35, 0x50, 0x6f, 0x74, 0x54, 0x75, 0x62, 0x74, 0x6e, 0x32, 0x74, + 0x78, 0x54, 0x75, 0x58, 0x5a, 0x5a, 0x4e, 0x70, 0x31, 0x44, 0x35, 0x53, + 0x44, 0x67, 0x50, 0x54, 0x4a, 0x67, 0x68, 0x53, 0x4a, 0x52, 0x74, 0x38, + 0x63, 0x7a, 0x75, 0x39, 0x30, 0x56, 0x4c, 0x36, 0x52, 0x34, 0x0a, 0x70, + 0x67, 0x64, 0x37, 0x67, 0x55, 0x59, 0x32, 0x42, 0x49, 0x62, 0x64, 0x65, + 0x54, 0x58, 0x48, 0x6c, 0x53, 0x77, 0x37, 0x73, 0x4b, 0x4d, 0x58, 0x4e, + 0x65, 0x56, 0x7a, 0x48, 0x37, 0x52, 0x63, 0x57, 0x65, 0x2f, 0x61, 0x36, + 0x68, 0x42, 0x6c, 0x65, 0x33, 0x72, 0x51, 0x66, 0x35, 0x2b, 0x7a, 0x74, + 0x43, 0x6f, 0x33, 0x4f, 0x33, 0x43, 0x4c, 0x6d, 0x31, 0x75, 0x35, 0x4b, + 0x37, 0x66, 0x73, 0x0a, 0x73, 0x6c, 0x45, 0x53, 0x6c, 0x31, 0x4d, 0x70, + 0x57, 0x74, 0x54, 0x77, 0x45, 0x68, 0x44, 0x63, 0x54, 0x77, 0x4b, 0x37, + 0x45, 0x70, 0x49, 0x76, 0x59, 0x74, 0x51, 0x2f, 0x61, 0x55, 0x4e, 0x38, + 0x44, 0x64, 0x62, 0x38, 0x57, 0x48, 0x55, 0x42, 0x69, 0x4a, 0x31, 0x59, + 0x46, 0x6b, 0x76, 0x65, 0x75, 0x70, 0x44, 0x2f, 0x52, 0x77, 0x47, 0x4a, + 0x42, 0x6d, 0x72, 0x32, 0x58, 0x37, 0x4b, 0x51, 0x0a, 0x61, 0x72, 0x4d, + 0x43, 0x70, 0x67, 0x4b, 0x49, 0x76, 0x37, 0x4e, 0x48, 0x66, 0x69, 0x72, + 0x5a, 0x31, 0x66, 0x70, 0x6f, 0x65, 0x44, 0x56, 0x4e, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x50, 0x7a, 0x41, 0x39, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x43, 0x77, 0x59, + 0x44, 0x0a, 0x56, 0x52, 0x30, 0x50, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, + 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x54, 0x77, 0x6a, 0x31, 0x6b, 0x34, 0x41, 0x4c, + 0x50, 0x31, 0x6a, 0x35, 0x71, 0x57, 0x44, 0x4e, 0x58, 0x72, 0x2b, 0x6e, + 0x75, 0x71, 0x46, 0x2b, 0x67, 0x54, 0x45, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x0a, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x55, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x76, + 0x75, 0x52, 0x63, 0x59, 0x6b, 0x34, 0x6b, 0x39, 0x41, 0x77, 0x49, 0x2f, + 0x2f, 0x44, 0x54, 0x44, 0x47, 0x6a, 0x6b, 0x6b, 0x30, 0x6b, 0x69, 0x50, + 0x30, 0x51, 0x6e, 0x62, 0x37, 0x74, 0x74, 0x33, 0x6f, 0x4e, 0x6d, 0x7a, + 0x71, 0x6a, 0x4d, 0x44, 0x66, 0x7a, 0x31, 0x6d, 0x67, 0x62, 0x6c, 0x0a, + 0x64, 0x78, 0x53, 0x52, 0x36, 0x35, 0x31, 0x42, 0x65, 0x35, 0x6b, 0x71, + 0x68, 0x4f, 0x58, 0x2f, 0x2f, 0x43, 0x48, 0x42, 0x58, 0x66, 0x44, 0x6b, + 0x48, 0x31, 0x65, 0x33, 0x64, 0x61, 0x6d, 0x68, 0x58, 0x77, 0x49, 0x6d, + 0x2f, 0x39, 0x66, 0x48, 0x39, 0x30, 0x37, 0x65, 0x54, 0x2f, 0x6a, 0x33, + 0x48, 0x45, 0x62, 0x41, 0x65, 0x6b, 0x39, 0x41, 0x4c, 0x43, 0x49, 0x31, + 0x38, 0x42, 0x6d, 0x78, 0x0a, 0x30, 0x47, 0x74, 0x6e, 0x4c, 0x4c, 0x43, + 0x6f, 0x34, 0x4d, 0x42, 0x41, 0x4e, 0x7a, 0x58, 0x32, 0x68, 0x46, 0x78, + 0x63, 0x34, 0x36, 0x39, 0x43, 0x65, 0x50, 0x36, 0x6e, 0x79, 0x51, 0x31, + 0x51, 0x36, 0x67, 0x32, 0x45, 0x64, 0x76, 0x5a, 0x52, 0x37, 0x34, 0x4e, + 0x54, 0x78, 0x6e, 0x72, 0x2f, 0x44, 0x6c, 0x5a, 0x4a, 0x4c, 0x6f, 0x39, + 0x36, 0x31, 0x67, 0x7a, 0x6d, 0x4a, 0x31, 0x54, 0x6a, 0x0a, 0x54, 0x51, + 0x70, 0x67, 0x63, 0x6d, 0x4c, 0x4e, 0x6b, 0x51, 0x66, 0x57, 0x70, 0x62, + 0x2f, 0x49, 0x6d, 0x57, 0x76, 0x74, 0x78, 0x42, 0x6e, 0x6d, 0x71, 0x30, + 0x77, 0x52, 0x4f, 0x4d, 0x56, 0x76, 0x4d, 0x65, 0x4a, 0x75, 0x53, 0x63, + 0x67, 0x2f, 0x64, 0x6f, 0x41, 0x6d, 0x41, 0x79, 0x59, 0x70, 0x34, 0x44, + 0x62, 0x32, 0x39, 0x69, 0x42, 0x54, 0x34, 0x78, 0x64, 0x77, 0x4e, 0x42, + 0x65, 0x64, 0x0a, 0x59, 0x32, 0x67, 0x65, 0x61, 0x2b, 0x7a, 0x44, 0x54, + 0x59, 0x61, 0x34, 0x45, 0x7a, 0x41, 0x76, 0x58, 0x55, 0x59, 0x4e, 0x52, + 0x30, 0x50, 0x56, 0x47, 0x36, 0x70, 0x5a, 0x44, 0x72, 0x6c, 0x63, 0x6a, + 0x51, 0x5a, 0x49, 0x72, 0x58, 0x53, 0x48, 0x58, 0x38, 0x66, 0x38, 0x4d, + 0x56, 0x52, 0x42, 0x45, 0x2b, 0x4c, 0x48, 0x49, 0x51, 0x36, 0x65, 0x34, + 0x42, 0x34, 0x4e, 0x34, 0x63, 0x42, 0x37, 0x0a, 0x51, 0x34, 0x57, 0x51, + 0x78, 0x59, 0x70, 0x59, 0x78, 0x6d, 0x55, 0x4b, 0x65, 0x46, 0x66, 0x79, + 0x78, 0x69, 0x4d, 0x50, 0x41, 0x64, 0x6b, 0x67, 0x53, 0x39, 0x34, 0x50, + 0x2b, 0x35, 0x4b, 0x46, 0x64, 0x53, 0x70, 0x63, 0x63, 0x34, 0x31, 0x74, + 0x65, 0x79, 0x57, 0x52, 0x79, 0x75, 0x35, 0x46, 0x72, 0x67, 0x5a, 0x4c, + 0x41, 0x4d, 0x7a, 0x54, 0x73, 0x56, 0x6c, 0x51, 0x32, 0x6a, 0x71, 0x49, + 0x0a, 0x4f, 0x79, 0x6c, 0x44, 0x52, 0x6c, 0x36, 0x58, 0x4b, 0x31, 0x54, + 0x4f, 0x55, 0x32, 0x2b, 0x4e, 0x53, 0x75, 0x65, 0x57, 0x2b, 0x72, 0x39, + 0x78, 0x44, 0x6b, 0x4b, 0x4c, 0x66, 0x50, 0x30, 0x6f, 0x6f, 0x4e, 0x42, + 0x49, 0x79, 0x74, 0x72, 0x45, 0x67, 0x55, 0x79, 0x37, 0x6f, 0x6e, 0x4f, + 0x54, 0x4a, 0x73, 0x6a, 0x72, 0x44, 0x4e, 0x59, 0x6d, 0x69, 0x4c, 0x62, + 0x41, 0x4a, 0x4d, 0x2b, 0x37, 0x0a, 0x76, 0x56, 0x76, 0x72, 0x64, 0x58, + 0x33, 0x70, 0x43, 0x49, 0x36, 0x47, 0x4d, 0x79, 0x78, 0x35, 0x64, 0x77, + 0x6c, 0x70, 0x70, 0x59, 0x6e, 0x38, 0x73, 0x33, 0x43, 0x51, 0x68, 0x33, + 0x61, 0x50, 0x30, 0x79, 0x4b, 0x37, 0x51, 0x73, 0x36, 0x39, 0x63, 0x77, + 0x73, 0x67, 0x4a, 0x69, 0x72, 0x51, 0x6d, 0x7a, 0x31, 0x77, 0x48, 0x69, + 0x52, 0x73, 0x7a, 0x59, 0x64, 0x32, 0x71, 0x52, 0x65, 0x57, 0x0a, 0x74, + 0x38, 0x38, 0x4e, 0x6b, 0x76, 0x75, 0x4f, 0x47, 0x4b, 0x6d, 0x59, 0x53, + 0x64, 0x47, 0x65, 0x2f, 0x6d, 0x42, 0x45, 0x63, 0x69, 0x47, 0x35, 0x47, + 0x65, 0x33, 0x43, 0x39, 0x54, 0x48, 0x78, 0x4f, 0x55, 0x69, 0x49, 0x6b, + 0x43, 0x52, 0x31, 0x56, 0x42, 0x61, 0x74, 0x7a, 0x76, 0x54, 0x34, 0x61, + 0x52, 0x52, 0x6b, 0x4f, 0x66, 0x75, 0x6a, 0x75, 0x4c, 0x70, 0x77, 0x51, + 0x4d, 0x63, 0x6e, 0x0a, 0x48, 0x4c, 0x2f, 0x45, 0x56, 0x6c, 0x50, 0x36, + 0x59, 0x32, 0x58, 0x51, 0x38, 0x78, 0x77, 0x4f, 0x46, 0x76, 0x56, 0x72, + 0x68, 0x6c, 0x68, 0x4e, 0x47, 0x4e, 0x54, 0x6b, 0x44, 0x59, 0x36, 0x6c, + 0x6e, 0x56, 0x75, 0x52, 0x33, 0x48, 0x59, 0x6b, 0x55, 0x44, 0x2f, 0x47, + 0x4b, 0x76, 0x76, 0x5a, 0x74, 0x35, 0x79, 0x31, 0x31, 0x75, 0x62, 0x51, + 0x32, 0x65, 0x67, 0x5a, 0x69, 0x78, 0x56, 0x78, 0x0a, 0x53, 0x4b, 0x32, + 0x33, 0x36, 0x74, 0x68, 0x5a, 0x69, 0x4e, 0x53, 0x51, 0x76, 0x78, 0x61, + 0x7a, 0x32, 0x65, 0x6d, 0x73, 0x57, 0x57, 0x46, 0x55, 0x79, 0x42, 0x79, + 0x36, 0x79, 0x73, 0x48, 0x4b, 0x34, 0x62, 0x6b, 0x67, 0x54, 0x49, 0x38, + 0x36, 0x6b, 0x34, 0x6d, 0x6c, 0x6f, 0x4d, 0x79, 0x2f, 0x30, 0x2f, 0x5a, + 0x31, 0x70, 0x48, 0x57, 0x57, 0x62, 0x56, 0x59, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x45, 0x2d, 0x54, 0x75, 0x67, 0x72, 0x61, 0x20, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, + 0x45, 0x2d, 0x54, 0x75, 0xc4, 0x9f, 0x72, 0x61, 0x20, 0x45, 0x42, 0x47, + 0x20, 0x42, 0x69, 0x6c, 0x69, 0xc5, 0x9f, 0x69, 0x6d, 0x20, 0x54, 0x65, + 0x6b, 0x6e, 0x6f, 0x6c, 0x6f, 0x6a, 0x69, 0x6c, 0x65, 0x72, 0x69, 0x20, + 0x76, 0x65, 0x20, 0x48, 0x69, 0x7a, 0x6d, 0x65, 0x74, 0x6c, 0x65, 0x72, + 0x69, 0x20, 0x41, 0x2e, 0xc5, 0x9e, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x45, + 0x2d, 0x54, 0x75, 0x67, 0x72, 0x61, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x6b, 0x61, 0x73, 0x79, 0x6f, 0x6e, 0x20, 0x4d, 0x65, 0x72, + 0x6b, 0x65, 0x7a, 0x69, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x2d, 0x54, 0x75, 0x67, + 0x72, 0x61, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x45, 0x2d, 0x54, 0x75, 0xc4, 0x9f, 0x72, + 0x61, 0x20, 0x45, 0x42, 0x47, 0x20, 0x42, 0x69, 0x6c, 0x69, 0xc5, 0x9f, + 0x69, 0x6d, 0x20, 0x54, 0x65, 0x6b, 0x6e, 0x6f, 0x6c, 0x6f, 0x6a, 0x69, + 0x6c, 0x65, 0x72, 0x69, 0x20, 0x76, 0x65, 0x20, 0x48, 0x69, 0x7a, 0x6d, + 0x65, 0x74, 0x6c, 0x65, 0x72, 0x69, 0x20, 0x41, 0x2e, 0xc5, 0x9e, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x45, 0x2d, 0x54, 0x75, 0x67, 0x72, 0x61, 0x20, + 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0x61, 0x73, 0x79, 0x6f, + 0x6e, 0x20, 0x4d, 0x65, 0x72, 0x6b, 0x65, 0x7a, 0x69, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x45, 0x2d, 0x54, 0x75, + 0x67, 0x72, 0x61, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x37, 0x36, 0x36, 0x37, 0x34, 0x34, 0x37, 0x32, 0x30, + 0x36, 0x37, 0x30, 0x33, 0x32, 0x35, 0x34, 0x33, 0x35, 0x35, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x38, 0x3a, 0x61, 0x31, 0x3a, + 0x30, 0x33, 0x3a, 0x36, 0x33, 0x3a, 0x62, 0x30, 0x3a, 0x62, 0x64, 0x3a, + 0x32, 0x31, 0x3a, 0x37, 0x31, 0x3a, 0x37, 0x30, 0x3a, 0x38, 0x61, 0x3a, + 0x36, 0x66, 0x3a, 0x31, 0x33, 0x3a, 0x33, 0x61, 0x3a, 0x62, 0x62, 0x3a, + 0x37, 0x39, 0x3a, 0x34, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x35, 0x31, 0x3a, 0x63, 0x36, 0x3a, 0x65, 0x37, 0x3a, 0x30, + 0x38, 0x3a, 0x34, 0x39, 0x3a, 0x30, 0x36, 0x3a, 0x36, 0x65, 0x3a, 0x66, + 0x33, 0x3a, 0x39, 0x32, 0x3a, 0x64, 0x34, 0x3a, 0x35, 0x63, 0x3a, 0x61, + 0x30, 0x3a, 0x30, 0x64, 0x3a, 0x36, 0x64, 0x3a, 0x61, 0x33, 0x3a, 0x36, + 0x32, 0x3a, 0x38, 0x66, 0x3a, 0x63, 0x33, 0x3a, 0x35, 0x32, 0x3a, 0x33, + 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x62, 0x30, 0x3a, 0x62, 0x66, 0x3a, 0x64, 0x35, 0x3a, 0x32, 0x62, 0x3a, + 0x62, 0x30, 0x3a, 0x64, 0x37, 0x3a, 0x64, 0x39, 0x3a, 0x62, 0x64, 0x3a, + 0x39, 0x32, 0x3a, 0x62, 0x66, 0x3a, 0x35, 0x64, 0x3a, 0x34, 0x64, 0x3a, + 0x63, 0x31, 0x3a, 0x33, 0x64, 0x3a, 0x61, 0x32, 0x3a, 0x35, 0x35, 0x3a, + 0x63, 0x30, 0x3a, 0x32, 0x63, 0x3a, 0x35, 0x34, 0x3a, 0x32, 0x66, 0x3a, + 0x33, 0x37, 0x3a, 0x38, 0x33, 0x3a, 0x36, 0x35, 0x3a, 0x65, 0x61, 0x3a, + 0x38, 0x39, 0x3a, 0x33, 0x39, 0x3a, 0x31, 0x31, 0x3a, 0x66, 0x35, 0x3a, + 0x35, 0x65, 0x3a, 0x35, 0x35, 0x3a, 0x66, 0x32, 0x3a, 0x33, 0x63, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x47, 0x53, 0x7a, 0x43, 0x43, + 0x42, 0x44, 0x4f, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, + 0x61, 0x6d, 0x67, 0x2b, 0x6e, 0x46, 0x47, 0x62, 0x79, 0x31, 0x4d, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x67, 0x62, 0x49, 0x78, + 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6c, 0x52, 0x53, 0x4d, 0x51, 0x38, 0x77, 0x44, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x48, 0x44, 0x41, 0x5a, 0x42, 0x62, 0x6d, 0x74, + 0x68, 0x63, 0x6d, 0x45, 0x78, 0x51, 0x44, 0x41, 0x2b, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x4e, 0x30, 0x55, 0x74, 0x56, 0x48, 0x58, + 0x45, 0x6e, 0x33, 0x4a, 0x68, 0x49, 0x45, 0x56, 0x43, 0x52, 0x79, 0x42, + 0x43, 0x0a, 0x61, 0x57, 0x78, 0x70, 0x78, 0x5a, 0x39, 0x70, 0x62, 0x53, + 0x42, 0x55, 0x5a, 0x57, 0x74, 0x75, 0x62, 0x32, 0x78, 0x76, 0x61, 0x6d, + 0x6c, 0x73, 0x5a, 0x58, 0x4a, 0x70, 0x49, 0x48, 0x5a, 0x6c, 0x49, 0x45, + 0x68, 0x70, 0x65, 0x6d, 0x31, 0x6c, 0x64, 0x47, 0x78, 0x6c, 0x63, 0x6d, + 0x6b, 0x67, 0x51, 0x53, 0x37, 0x46, 0x6e, 0x69, 0x34, 0x78, 0x4a, 0x6a, + 0x41, 0x6b, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x73, 0x4d, 0x48, + 0x55, 0x55, 0x74, 0x56, 0x48, 0x56, 0x6e, 0x63, 0x6d, 0x45, 0x67, 0x55, + 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x74, 0x68, 0x63, + 0x33, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x4e, 0x5a, 0x58, 0x4a, 0x72, 0x5a, + 0x58, 0x70, 0x70, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x44, 0x44, 0x42, 0x39, 0x46, 0x4c, 0x56, 0x52, 0x31, 0x0a, + 0x5a, 0x33, 0x4a, 0x68, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, + 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, + 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, + 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x7a, 0x4d, 0x44, 0x4d, 0x77, + 0x4e, 0x54, 0x45, 0x79, 0x4d, 0x44, 0x6b, 0x30, 0x4f, 0x46, 0x6f, 0x58, + 0x44, 0x54, 0x49, 0x7a, 0x0a, 0x4d, 0x44, 0x4d, 0x77, 0x4d, 0x7a, 0x45, + 0x79, 0x4d, 0x44, 0x6b, 0x30, 0x4f, 0x46, 0x6f, 0x77, 0x67, 0x62, 0x49, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6c, 0x52, 0x53, 0x4d, 0x51, 0x38, 0x77, 0x44, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x48, 0x44, 0x41, 0x5a, 0x42, 0x62, 0x6d, 0x74, + 0x68, 0x63, 0x6d, 0x45, 0x78, 0x51, 0x44, 0x41, 0x2b, 0x0a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x4e, 0x30, 0x55, 0x74, 0x56, 0x48, + 0x58, 0x45, 0x6e, 0x33, 0x4a, 0x68, 0x49, 0x45, 0x56, 0x43, 0x52, 0x79, + 0x42, 0x43, 0x61, 0x57, 0x78, 0x70, 0x78, 0x5a, 0x39, 0x70, 0x62, 0x53, + 0x42, 0x55, 0x5a, 0x57, 0x74, 0x75, 0x62, 0x32, 0x78, 0x76, 0x61, 0x6d, + 0x6c, 0x73, 0x5a, 0x58, 0x4a, 0x70, 0x49, 0x48, 0x5a, 0x6c, 0x49, 0x45, + 0x68, 0x70, 0x0a, 0x65, 0x6d, 0x31, 0x6c, 0x64, 0x47, 0x78, 0x6c, 0x63, + 0x6d, 0x6b, 0x67, 0x51, 0x53, 0x37, 0x46, 0x6e, 0x69, 0x34, 0x78, 0x4a, + 0x6a, 0x41, 0x6b, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x4d, 0x48, + 0x55, 0x55, 0x74, 0x56, 0x48, 0x56, 0x6e, 0x63, 0x6d, 0x45, 0x67, 0x55, + 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x74, 0x68, 0x63, + 0x33, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x4e, 0x0a, 0x5a, 0x58, 0x4a, 0x72, + 0x5a, 0x58, 0x70, 0x70, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x39, 0x46, 0x4c, 0x56, 0x52, 0x31, + 0x5a, 0x33, 0x4a, 0x68, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, + 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, + 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, + 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, + 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, 0x49, + 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, 0x45, 0x41, 0x34, 0x76, 0x55, + 0x2f, 0x6b, 0x77, 0x56, 0x52, 0x48, 0x6f, 0x56, 0x69, 0x56, 0x46, 0x35, + 0x36, 0x43, 0x2f, 0x55, 0x59, 0x0a, 0x42, 0x34, 0x4f, 0x75, 0x66, 0x71, + 0x39, 0x38, 0x39, 0x39, 0x53, 0x4b, 0x61, 0x36, 0x56, 0x6a, 0x51, 0x7a, + 0x6d, 0x35, 0x53, 0x2f, 0x66, 0x44, 0x78, 0x6d, 0x53, 0x4a, 0x50, 0x5a, + 0x51, 0x75, 0x56, 0x49, 0x42, 0x53, 0x4f, 0x54, 0x6b, 0x48, 0x53, 0x30, + 0x76, 0x64, 0x68, 0x51, 0x64, 0x32, 0x68, 0x38, 0x79, 0x2f, 0x4c, 0x35, + 0x56, 0x4d, 0x7a, 0x48, 0x32, 0x6e, 0x50, 0x62, 0x78, 0x48, 0x0a, 0x44, + 0x35, 0x68, 0x77, 0x2b, 0x49, 0x79, 0x46, 0x48, 0x6e, 0x53, 0x4f, 0x6b, + 0x6d, 0x30, 0x62, 0x51, 0x4e, 0x47, 0x5a, 0x44, 0x62, 0x74, 0x31, 0x62, + 0x73, 0x69, 0x70, 0x61, 0x35, 0x72, 0x41, 0x68, 0x44, 0x47, 0x76, 0x79, + 0x6b, 0x50, 0x4c, 0x36, 0x79, 0x73, 0x30, 0x36, 0x49, 0x2b, 0x58, 0x61, + 0x77, 0x47, 0x62, 0x31, 0x51, 0x35, 0x4b, 0x43, 0x4b, 0x70, 0x62, 0x6b, + 0x6e, 0x53, 0x46, 0x0a, 0x51, 0x39, 0x4f, 0x41, 0x72, 0x71, 0x47, 0x49, + 0x57, 0x36, 0x36, 0x7a, 0x36, 0x6c, 0x37, 0x4c, 0x46, 0x70, 0x70, 0x33, + 0x52, 0x4d, 0x69, 0x68, 0x39, 0x6c, 0x52, 0x6f, 0x7a, 0x74, 0x36, 0x50, + 0x6c, 0x79, 0x75, 0x36, 0x57, 0x30, 0x41, 0x43, 0x44, 0x47, 0x51, 0x58, + 0x77, 0x4c, 0x57, 0x54, 0x7a, 0x65, 0x48, 0x78, 0x45, 0x32, 0x62, 0x4f, + 0x44, 0x48, 0x6e, 0x76, 0x30, 0x5a, 0x45, 0x6f, 0x0a, 0x71, 0x31, 0x2b, + 0x67, 0x45, 0x6c, 0x49, 0x77, 0x63, 0x78, 0x6d, 0x4f, 0x6a, 0x2b, 0x47, + 0x4d, 0x42, 0x36, 0x4c, 0x44, 0x75, 0x30, 0x72, 0x77, 0x36, 0x68, 0x38, + 0x56, 0x71, 0x4f, 0x34, 0x6c, 0x7a, 0x4b, 0x52, 0x47, 0x2b, 0x42, 0x73, + 0x69, 0x37, 0x37, 0x4d, 0x4f, 0x51, 0x37, 0x6f, 0x73, 0x4a, 0x4c, 0x6a, + 0x46, 0x4c, 0x46, 0x7a, 0x55, 0x48, 0x50, 0x68, 0x64, 0x5a, 0x4c, 0x33, + 0x44, 0x0a, 0x6b, 0x31, 0x34, 0x6f, 0x70, 0x7a, 0x38, 0x6e, 0x38, 0x59, + 0x34, 0x65, 0x30, 0x79, 0x70, 0x51, 0x42, 0x61, 0x4e, 0x56, 0x32, 0x63, + 0x76, 0x6e, 0x4f, 0x56, 0x50, 0x41, 0x6d, 0x4a, 0x36, 0x4d, 0x56, 0x47, + 0x4b, 0x4c, 0x4a, 0x72, 0x44, 0x33, 0x66, 0x59, 0x31, 0x38, 0x35, 0x4d, + 0x61, 0x65, 0x5a, 0x6b, 0x4a, 0x56, 0x67, 0x6b, 0x66, 0x6e, 0x73, 0x6c, + 0x69, 0x4e, 0x5a, 0x76, 0x63, 0x48, 0x0a, 0x66, 0x43, 0x34, 0x32, 0x35, + 0x6c, 0x41, 0x63, 0x50, 0x39, 0x74, 0x44, 0x4a, 0x4d, 0x57, 0x2f, 0x68, + 0x6b, 0x64, 0x35, 0x73, 0x33, 0x6b, 0x63, 0x39, 0x31, 0x72, 0x30, 0x45, + 0x2b, 0x78, 0x73, 0x2b, 0x44, 0x2f, 0x69, 0x57, 0x52, 0x2b, 0x56, 0x37, + 0x6b, 0x49, 0x2b, 0x75, 0x61, 0x32, 0x6f, 0x4d, 0x6f, 0x56, 0x4a, 0x6c, + 0x30, 0x62, 0x2b, 0x53, 0x7a, 0x47, 0x50, 0x57, 0x73, 0x75, 0x74, 0x0a, + 0x64, 0x45, 0x63, 0x66, 0x36, 0x5a, 0x47, 0x33, 0x33, 0x79, 0x67, 0x45, + 0x49, 0x71, 0x44, 0x55, 0x44, 0x31, 0x33, 0x69, 0x65, 0x55, 0x2f, 0x71, + 0x62, 0x49, 0x57, 0x47, 0x76, 0x61, 0x69, 0x6d, 0x7a, 0x75, 0x54, 0x36, + 0x77, 0x2b, 0x47, 0x7a, 0x72, 0x74, 0x34, 0x38, 0x55, 0x65, 0x37, 0x4c, + 0x45, 0x33, 0x77, 0x42, 0x66, 0x34, 0x51, 0x4f, 0x58, 0x56, 0x47, 0x55, + 0x6e, 0x68, 0x4d, 0x4d, 0x0a, 0x74, 0x69, 0x36, 0x6c, 0x54, 0x50, 0x6b, + 0x35, 0x63, 0x44, 0x5a, 0x76, 0x6c, 0x73, 0x6f, 0x75, 0x44, 0x45, 0x52, + 0x56, 0x78, 0x63, 0x72, 0x36, 0x58, 0x51, 0x4b, 0x6a, 0x33, 0x39, 0x5a, + 0x6b, 0x6a, 0x46, 0x71, 0x7a, 0x41, 0x51, 0x71, 0x70, 0x74, 0x51, 0x70, + 0x48, 0x46, 0x2f, 0x2f, 0x76, 0x6b, 0x55, 0x41, 0x71, 0x6a, 0x71, 0x46, + 0x47, 0x4f, 0x6a, 0x47, 0x59, 0x35, 0x52, 0x48, 0x38, 0x0a, 0x7a, 0x4c, + 0x74, 0x4a, 0x56, 0x6f, 0x72, 0x38, 0x75, 0x64, 0x42, 0x68, 0x6d, 0x6d, + 0x39, 0x6c, 0x62, 0x4f, 0x62, 0x44, 0x79, 0x7a, 0x35, 0x31, 0x53, 0x66, + 0x36, 0x50, 0x70, 0x2b, 0x4b, 0x4a, 0x78, 0x57, 0x66, 0x58, 0x6e, 0x55, + 0x59, 0x54, 0x54, 0x6a, 0x46, 0x32, 0x4f, 0x79, 0x53, 0x7a, 0x6e, 0x68, + 0x46, 0x6c, 0x68, 0x71, 0x74, 0x2f, 0x37, 0x78, 0x33, 0x55, 0x2b, 0x4c, + 0x7a, 0x6e, 0x0a, 0x72, 0x46, 0x70, 0x63, 0x74, 0x31, 0x70, 0x48, 0x58, + 0x46, 0x58, 0x4f, 0x56, 0x62, 0x51, 0x69, 0x63, 0x56, 0x74, 0x62, 0x43, + 0x2f, 0x44, 0x50, 0x33, 0x4b, 0x42, 0x68, 0x5a, 0x4f, 0x71, 0x70, 0x31, + 0x32, 0x67, 0x4b, 0x59, 0x36, 0x66, 0x67, 0x44, 0x54, 0x2b, 0x67, 0x72, + 0x39, 0x4f, 0x71, 0x30, 0x6e, 0x37, 0x76, 0x55, 0x61, 0x44, 0x6d, 0x55, + 0x53, 0x74, 0x56, 0x6b, 0x68, 0x55, 0x58, 0x0a, 0x55, 0x38, 0x75, 0x33, + 0x5a, 0x67, 0x35, 0x6d, 0x54, 0x50, 0x6a, 0x35, 0x64, 0x55, 0x79, 0x51, + 0x35, 0x78, 0x4a, 0x77, 0x78, 0x30, 0x55, 0x43, 0x41, 0x77, 0x45, 0x41, + 0x41, 0x61, 0x4e, 0x6a, 0x4d, 0x47, 0x45, 0x77, 0x48, 0x51, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x43, 0x37, 0x6a, + 0x32, 0x37, 0x4a, 0x4a, 0x30, 0x4a, 0x78, 0x55, 0x65, 0x56, 0x7a, 0x36, + 0x0a, 0x4a, 0x79, 0x72, 0x2b, 0x7a, 0x45, 0x37, 0x53, 0x36, 0x45, 0x35, + 0x55, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x77, 0x48, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, + 0x77, 0x46, 0x6f, 0x41, 0x55, 0x4c, 0x75, 0x50, 0x62, 0x73, 0x6b, 0x6e, + 0x51, 0x6e, 0x46, 0x52, 0x35, 0x0a, 0x58, 0x50, 0x6f, 0x6e, 0x4b, 0x76, + 0x37, 0x4d, 0x54, 0x74, 0x4c, 0x6f, 0x54, 0x6c, 0x51, 0x77, 0x44, 0x67, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, 0x51, 0x41, 0x46, 0x0a, 0x4e, + 0x7a, 0x72, 0x30, 0x54, 0x62, 0x64, 0x46, 0x34, 0x6b, 0x56, 0x31, 0x4a, + 0x49, 0x2b, 0x32, 0x64, 0x31, 0x4c, 0x6f, 0x48, 0x4e, 0x67, 0x51, 0x6b, + 0x32, 0x58, 0x7a, 0x38, 0x6c, 0x6b, 0x47, 0x70, 0x44, 0x34, 0x65, 0x4b, + 0x65, 0x78, 0x64, 0x30, 0x64, 0x43, 0x72, 0x66, 0x4f, 0x41, 0x4b, 0x6b, + 0x45, 0x68, 0x34, 0x37, 0x55, 0x36, 0x59, 0x41, 0x35, 0x6e, 0x2b, 0x4b, + 0x47, 0x43, 0x52, 0x0a, 0x48, 0x54, 0x41, 0x64, 0x75, 0x47, 0x4e, 0x38, + 0x71, 0x4f, 0x59, 0x31, 0x74, 0x66, 0x72, 0x54, 0x59, 0x58, 0x62, 0x6d, + 0x31, 0x67, 0x64, 0x4c, 0x79, 0x6d, 0x6d, 0x61, 0x73, 0x6f, 0x52, 0x36, + 0x64, 0x35, 0x4e, 0x46, 0x46, 0x78, 0x57, 0x66, 0x4a, 0x4e, 0x43, 0x59, + 0x45, 0x78, 0x4c, 0x2f, 0x75, 0x36, 0x41, 0x75, 0x2f, 0x55, 0x35, 0x4d, + 0x68, 0x2f, 0x6a, 0x4f, 0x58, 0x4b, 0x71, 0x59, 0x0a, 0x47, 0x77, 0x58, + 0x67, 0x41, 0x45, 0x5a, 0x4b, 0x67, 0x6f, 0x43, 0x6c, 0x4d, 0x34, 0x73, + 0x6f, 0x33, 0x4f, 0x30, 0x34, 0x30, 0x39, 0x2f, 0x6c, 0x50, 0x75, 0x6e, + 0x2b, 0x2b, 0x31, 0x6e, 0x64, 0x59, 0x59, 0x52, 0x50, 0x30, 0x6c, 0x53, + 0x57, 0x45, 0x32, 0x45, 0x54, 0x50, 0x6f, 0x2b, 0x41, 0x61, 0x62, 0x36, + 0x54, 0x52, 0x37, 0x55, 0x31, 0x51, 0x39, 0x4a, 0x61, 0x75, 0x7a, 0x31, + 0x63, 0x0a, 0x37, 0x37, 0x4e, 0x43, 0x52, 0x38, 0x30, 0x37, 0x56, 0x52, + 0x4d, 0x47, 0x73, 0x41, 0x6e, 0x62, 0x2f, 0x57, 0x50, 0x32, 0x4f, 0x6f, + 0x67, 0x4b, 0x6d, 0x57, 0x39, 0x2b, 0x34, 0x63, 0x34, 0x62, 0x55, 0x32, + 0x70, 0x45, 0x5a, 0x69, 0x4e, 0x52, 0x43, 0x48, 0x75, 0x38, 0x57, 0x31, + 0x4b, 0x69, 0x2f, 0x51, 0x59, 0x33, 0x4f, 0x45, 0x42, 0x68, 0x6a, 0x30, + 0x71, 0x57, 0x75, 0x4a, 0x41, 0x33, 0x0a, 0x2b, 0x47, 0x62, 0x48, 0x65, + 0x4a, 0x41, 0x41, 0x46, 0x53, 0x36, 0x4c, 0x72, 0x56, 0x45, 0x31, 0x55, + 0x77, 0x65, 0x6f, 0x61, 0x32, 0x69, 0x75, 0x2b, 0x55, 0x34, 0x38, 0x42, + 0x79, 0x62, 0x4e, 0x43, 0x41, 0x56, 0x77, 0x7a, 0x44, 0x6b, 0x2f, 0x64, + 0x72, 0x32, 0x6c, 0x30, 0x32, 0x63, 0x6d, 0x41, 0x59, 0x61, 0x6d, 0x55, + 0x39, 0x4a, 0x67, 0x4f, 0x33, 0x78, 0x44, 0x66, 0x31, 0x57, 0x4b, 0x0a, + 0x76, 0x4a, 0x55, 0x61, 0x77, 0x53, 0x67, 0x35, 0x54, 0x42, 0x39, 0x44, + 0x30, 0x70, 0x48, 0x30, 0x63, 0x6c, 0x6d, 0x4b, 0x75, 0x56, 0x62, 0x38, + 0x50, 0x37, 0x53, 0x64, 0x32, 0x6e, 0x43, 0x63, 0x64, 0x6c, 0x71, 0x4d, + 0x51, 0x31, 0x44, 0x75, 0x6a, 0x6a, 0x42, 0x79, 0x54, 0x64, 0x2f, 0x2f, + 0x53, 0x66, 0x66, 0x47, 0x71, 0x57, 0x66, 0x5a, 0x62, 0x61, 0x77, 0x43, + 0x45, 0x65, 0x49, 0x36, 0x0a, 0x46, 0x69, 0x57, 0x6e, 0x57, 0x41, 0x6a, + 0x4c, 0x62, 0x31, 0x4e, 0x42, 0x6e, 0x45, 0x67, 0x34, 0x52, 0x32, 0x67, + 0x7a, 0x30, 0x64, 0x66, 0x48, 0x6a, 0x39, 0x52, 0x30, 0x49, 0x64, 0x54, + 0x44, 0x42, 0x5a, 0x42, 0x36, 0x2f, 0x38, 0x36, 0x57, 0x69, 0x4c, 0x45, + 0x56, 0x4b, 0x56, 0x30, 0x6a, 0x71, 0x39, 0x42, 0x67, 0x6f, 0x52, 0x4a, + 0x50, 0x33, 0x76, 0x51, 0x58, 0x7a, 0x54, 0x4c, 0x6c, 0x0a, 0x79, 0x62, + 0x2f, 0x49, 0x51, 0x36, 0x33, 0x39, 0x4c, 0x6f, 0x37, 0x78, 0x72, 0x2b, + 0x4c, 0x30, 0x6d, 0x50, 0x6f, 0x53, 0x48, 0x79, 0x44, 0x59, 0x77, 0x4b, + 0x63, 0x4d, 0x68, 0x63, 0x57, 0x51, 0x39, 0x44, 0x73, 0x74, 0x6c, 0x69, + 0x61, 0x78, 0x4c, 0x4c, 0x35, 0x4d, 0x71, 0x2b, 0x75, 0x78, 0x30, 0x6f, + 0x72, 0x4a, 0x32, 0x33, 0x67, 0x54, 0x44, 0x78, 0x34, 0x4a, 0x6e, 0x57, + 0x32, 0x50, 0x0a, 0x41, 0x4a, 0x38, 0x43, 0x32, 0x73, 0x48, 0x36, 0x48, + 0x33, 0x70, 0x36, 0x43, 0x63, 0x52, 0x4b, 0x35, 0x6f, 0x67, 0x71, 0x6c, + 0x35, 0x2b, 0x4a, 0x69, 0x2f, 0x30, 0x33, 0x58, 0x31, 0x38, 0x36, 0x7a, + 0x6a, 0x68, 0x5a, 0x68, 0x6b, 0x75, 0x76, 0x63, 0x51, 0x75, 0x30, 0x32, + 0x50, 0x4a, 0x77, 0x54, 0x35, 0x38, 0x79, 0x45, 0x2b, 0x4f, 0x77, 0x70, + 0x31, 0x66, 0x6c, 0x32, 0x74, 0x70, 0x44, 0x0a, 0x79, 0x34, 0x51, 0x30, + 0x38, 0x69, 0x6a, 0x45, 0x36, 0x6d, 0x33, 0x30, 0x4b, 0x75, 0x2f, 0x42, + 0x61, 0x33, 0x62, 0x61, 0x2b, 0x33, 0x36, 0x37, 0x68, 0x54, 0x7a, 0x53, + 0x55, 0x38, 0x4a, 0x4e, 0x76, 0x6e, 0x48, 0x68, 0x52, 0x64, 0x48, 0x39, + 0x49, 0x32, 0x63, 0x4e, 0x45, 0x33, 0x58, 0x37, 0x7a, 0x32, 0x56, 0x6e, + 0x49, 0x70, 0x32, 0x75, 0x73, 0x41, 0x6e, 0x52, 0x43, 0x66, 0x38, 0x64, + 0x0a, 0x4e, 0x4c, 0x2f, 0x2b, 0x49, 0x35, 0x63, 0x33, 0x30, 0x6a, 0x6e, + 0x36, 0x50, 0x51, 0x30, 0x47, 0x43, 0x37, 0x54, 0x62, 0x4f, 0x36, 0x4f, + 0x72, 0x62, 0x31, 0x77, 0x64, 0x74, 0x6e, 0x37, 0x6f, 0x73, 0x34, 0x49, + 0x30, 0x37, 0x51, 0x5a, 0x63, 0x4a, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x54, 0x2d, 0x54, 0x65, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x20, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x54, 0x2d, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x73, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x20, 0x47, 0x6d, 0x62, 0x48, 0x20, 0x4f, 0x55, 0x3d, 0x54, + 0x2d, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x54, 0x2d, 0x54, 0x65, 0x6c, 0x65, 0x53, 0x65, 0x63, 0x20, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x6c, 0x61, + 0x73, 0x73, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x54, 0x2d, 0x53, 0x79, 0x73, + 0x74, 0x65, 0x6d, 0x73, 0x20, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x73, 0x65, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x20, 0x47, 0x6d, 0x62, 0x48, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x2d, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x2d, 0x54, 0x65, 0x6c, 0x65, + 0x53, 0x65, 0x63, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x20, 0x32, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x62, 0x3a, 0x39, 0x62, + 0x3a, 0x39, 0x65, 0x3a, 0x65, 0x34, 0x3a, 0x37, 0x62, 0x3a, 0x36, 0x63, + 0x3a, 0x31, 0x66, 0x3a, 0x30, 0x30, 0x3a, 0x37, 0x32, 0x3a, 0x31, 0x61, + 0x3a, 0x63, 0x63, 0x3a, 0x63, 0x31, 0x3a, 0x37, 0x37, 0x3a, 0x37, 0x39, + 0x3a, 0x64, 0x66, 0x3a, 0x36, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x35, 0x39, 0x3a, 0x30, 0x64, 0x3a, 0x32, 0x64, 0x3a, + 0x37, 0x64, 0x3a, 0x38, 0x38, 0x3a, 0x34, 0x66, 0x3a, 0x34, 0x30, 0x3a, + 0x32, 0x65, 0x3a, 0x36, 0x31, 0x3a, 0x37, 0x65, 0x3a, 0x61, 0x35, 0x3a, + 0x36, 0x32, 0x3a, 0x33, 0x32, 0x3a, 0x31, 0x37, 0x3a, 0x36, 0x35, 0x3a, + 0x63, 0x66, 0x3a, 0x31, 0x37, 0x3a, 0x64, 0x38, 0x3a, 0x39, 0x34, 0x3a, + 0x65, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x39, 0x31, 0x3a, 0x65, 0x32, 0x3a, 0x66, 0x35, 0x3a, 0x37, 0x38, + 0x3a, 0x38, 0x64, 0x3a, 0x35, 0x38, 0x3a, 0x31, 0x30, 0x3a, 0x65, 0x62, + 0x3a, 0x61, 0x37, 0x3a, 0x62, 0x61, 0x3a, 0x35, 0x38, 0x3a, 0x37, 0x33, + 0x3a, 0x37, 0x64, 0x3a, 0x65, 0x31, 0x3a, 0x35, 0x34, 0x3a, 0x38, 0x61, + 0x3a, 0x38, 0x65, 0x3a, 0x63, 0x61, 0x3a, 0x63, 0x64, 0x3a, 0x30, 0x31, + 0x3a, 0x34, 0x35, 0x3a, 0x39, 0x38, 0x3a, 0x62, 0x63, 0x3a, 0x30, 0x62, + 0x3a, 0x31, 0x34, 0x3a, 0x33, 0x65, 0x3a, 0x30, 0x34, 0x3a, 0x31, 0x62, + 0x3a, 0x31, 0x37, 0x3a, 0x30, 0x35, 0x3a, 0x32, 0x35, 0x3a, 0x35, 0x32, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x77, 0x7a, 0x43, + 0x43, 0x41, 0x71, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x42, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x43, + 0x42, 0x67, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x45, 0x55, 0x78, 0x0a, 0x4b, 0x7a, + 0x41, 0x70, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x49, 0x6c, + 0x51, 0x74, 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, + 0x42, 0x46, 0x62, 0x6e, 0x52, 0x6c, 0x63, 0x6e, 0x42, 0x79, 0x61, 0x58, + 0x4e, 0x6c, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, + 0x56, 0x7a, 0x49, 0x45, 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, 0x48, 0x7a, + 0x41, 0x64, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x4d, 0x46, + 0x6c, 0x51, 0x74, 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, + 0x79, 0x42, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x44, 0x5a, + 0x57, 0x35, 0x30, 0x5a, 0x58, 0x49, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x48, 0x46, 0x51, 0x74, 0x56, + 0x47, 0x56, 0x73, 0x5a, 0x56, 0x4e, 0x6c, 0x0a, 0x59, 0x79, 0x42, 0x48, + 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x53, 0x62, 0x32, 0x39, 0x30, + 0x49, 0x45, 0x4e, 0x73, 0x59, 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x49, 0x77, + 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, 0x67, 0x78, 0x4d, 0x44, 0x41, 0x78, + 0x4d, 0x54, 0x41, 0x30, 0x4d, 0x44, 0x45, 0x30, 0x57, 0x68, 0x63, 0x4e, + 0x4d, 0x7a, 0x4d, 0x78, 0x4d, 0x44, 0x41, 0x78, 0x4d, 0x6a, 0x4d, 0x31, + 0x0a, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x67, 0x6a, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x52, 0x45, 0x55, 0x78, 0x4b, 0x7a, 0x41, 0x70, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x49, 0x6c, 0x51, 0x74, 0x55, 0x33, 0x6c, + 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, 0x46, 0x62, 0x6e, 0x52, + 0x6c, 0x63, 0x6e, 0x42, 0x79, 0x0a, 0x61, 0x58, 0x4e, 0x6c, 0x49, 0x46, + 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x49, 0x45, + 0x64, 0x74, 0x59, 0x6b, 0x67, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x73, 0x4d, 0x46, 0x6c, 0x51, 0x74, 0x55, 0x33, + 0x6c, 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, 0x55, 0x63, 0x6e, + 0x56, 0x7a, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x57, 0x35, 0x30, 0x0a, 0x5a, + 0x58, 0x49, 0x78, 0x4a, 0x54, 0x41, 0x6a, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x4d, 0x4d, 0x48, 0x46, 0x51, 0x74, 0x56, 0x47, 0x56, 0x73, 0x5a, + 0x56, 0x4e, 0x6c, 0x59, 0x79, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, + 0x57, 0x78, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x73, 0x59, + 0x58, 0x4e, 0x7a, 0x49, 0x44, 0x49, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, + 0x41, 0x30, 0x47, 0x0a, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, + 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, + 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, + 0x41, 0x51, 0x43, 0x71, 0x58, 0x39, 0x6f, 0x62, 0x58, 0x2b, 0x68, 0x7a, + 0x6b, 0x65, 0x58, 0x61, 0x58, 0x50, 0x53, 0x69, 0x35, 0x6b, 0x66, 0x6c, + 0x38, 0x32, 0x68, 0x56, 0x59, 0x41, 0x55, 0x64, 0x0a, 0x41, 0x71, 0x53, + 0x7a, 0x6d, 0x31, 0x6e, 0x7a, 0x48, 0x6f, 0x71, 0x76, 0x4e, 0x4b, 0x33, + 0x38, 0x44, 0x63, 0x4c, 0x5a, 0x53, 0x42, 0x6e, 0x75, 0x61, 0x59, 0x2f, + 0x4a, 0x49, 0x50, 0x77, 0x68, 0x71, 0x67, 0x63, 0x5a, 0x37, 0x62, 0x42, + 0x63, 0x72, 0x47, 0x58, 0x48, 0x58, 0x2b, 0x30, 0x43, 0x66, 0x48, 0x74, + 0x38, 0x4c, 0x52, 0x76, 0x57, 0x75, 0x72, 0x6d, 0x41, 0x77, 0x68, 0x69, + 0x43, 0x0a, 0x46, 0x6f, 0x54, 0x36, 0x5a, 0x72, 0x41, 0x49, 0x78, 0x6c, + 0x51, 0x6a, 0x67, 0x65, 0x54, 0x4e, 0x75, 0x55, 0x6b, 0x2f, 0x39, 0x6b, + 0x39, 0x75, 0x4e, 0x30, 0x67, 0x6f, 0x4f, 0x41, 0x2f, 0x46, 0x76, 0x75, + 0x64, 0x6f, 0x63, 0x50, 0x30, 0x35, 0x6c, 0x30, 0x33, 0x53, 0x78, 0x35, + 0x69, 0x52, 0x55, 0x4b, 0x72, 0x45, 0x52, 0x4c, 0x4d, 0x6a, 0x66, 0x54, + 0x6c, 0x48, 0x36, 0x56, 0x4a, 0x69, 0x0a, 0x31, 0x68, 0x4b, 0x54, 0x58, + 0x72, 0x63, 0x78, 0x6c, 0x6b, 0x49, 0x46, 0x2b, 0x33, 0x61, 0x6e, 0x48, + 0x71, 0x50, 0x31, 0x77, 0x76, 0x7a, 0x70, 0x65, 0x73, 0x56, 0x73, 0x71, + 0x58, 0x46, 0x50, 0x36, 0x73, 0x74, 0x34, 0x76, 0x47, 0x43, 0x76, 0x78, + 0x39, 0x37, 0x30, 0x32, 0x63, 0x75, 0x2b, 0x66, 0x6a, 0x4f, 0x6c, 0x62, + 0x70, 0x53, 0x44, 0x38, 0x44, 0x54, 0x36, 0x49, 0x61, 0x76, 0x71, 0x0a, + 0x6a, 0x6e, 0x4b, 0x67, 0x50, 0x36, 0x54, 0x65, 0x4d, 0x46, 0x76, 0x76, + 0x68, 0x6b, 0x31, 0x71, 0x6c, 0x56, 0x74, 0x44, 0x52, 0x4b, 0x67, 0x51, + 0x46, 0x52, 0x7a, 0x6c, 0x41, 0x56, 0x66, 0x46, 0x6d, 0x50, 0x48, 0x6d, + 0x42, 0x69, 0x69, 0x52, 0x71, 0x69, 0x44, 0x46, 0x74, 0x31, 0x4d, 0x6d, + 0x55, 0x55, 0x4f, 0x79, 0x43, 0x78, 0x47, 0x56, 0x57, 0x4f, 0x48, 0x41, + 0x44, 0x33, 0x62, 0x5a, 0x0a, 0x77, 0x49, 0x31, 0x38, 0x67, 0x66, 0x4e, + 0x79, 0x63, 0x4a, 0x35, 0x76, 0x2f, 0x68, 0x71, 0x4f, 0x32, 0x56, 0x38, + 0x31, 0x78, 0x72, 0x4a, 0x76, 0x4e, 0x48, 0x79, 0x2b, 0x53, 0x45, 0x2f, + 0x69, 0x57, 0x6a, 0x6e, 0x58, 0x32, 0x4a, 0x31, 0x34, 0x6e, 0x70, 0x2b, + 0x47, 0x50, 0x67, 0x4e, 0x65, 0x47, 0x59, 0x74, 0x45, 0x6f, 0x74, 0x58, + 0x48, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x0a, 0x51, 0x6a, + 0x42, 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, + 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, + 0x53, 0x2f, 0x0a, 0x57, 0x53, 0x41, 0x32, 0x41, 0x48, 0x6d, 0x67, 0x6f, + 0x43, 0x4a, 0x72, 0x6a, 0x4e, 0x58, 0x79, 0x59, 0x64, 0x4b, 0x34, 0x4c, + 0x4d, 0x75, 0x43, 0x53, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, + 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x4d, 0x51, 0x4f, 0x69, 0x59, + 0x51, 0x73, 0x66, 0x64, 0x4f, 0x68, 0x79, 0x0a, 0x4e, 0x73, 0x5a, 0x74, + 0x2b, 0x55, 0x32, 0x65, 0x2b, 0x69, 0x4b, 0x6f, 0x34, 0x59, 0x46, 0x57, + 0x7a, 0x38, 0x32, 0x37, 0x6e, 0x2b, 0x71, 0x72, 0x6b, 0x52, 0x6b, 0x34, + 0x72, 0x36, 0x70, 0x38, 0x46, 0x55, 0x33, 0x7a, 0x74, 0x71, 0x4f, 0x4e, + 0x70, 0x66, 0x53, 0x4f, 0x39, 0x6b, 0x53, 0x70, 0x70, 0x2b, 0x67, 0x68, + 0x6c, 0x61, 0x30, 0x2b, 0x41, 0x47, 0x49, 0x57, 0x69, 0x50, 0x41, 0x43, + 0x0a, 0x75, 0x76, 0x78, 0x68, 0x49, 0x2b, 0x59, 0x7a, 0x6d, 0x7a, 0x42, + 0x36, 0x61, 0x7a, 0x5a, 0x69, 0x65, 0x36, 0x30, 0x45, 0x49, 0x34, 0x52, + 0x59, 0x5a, 0x65, 0x4c, 0x62, 0x4b, 0x34, 0x72, 0x6e, 0x4a, 0x56, 0x4d, + 0x33, 0x59, 0x6c, 0x4e, 0x66, 0x76, 0x4e, 0x6f, 0x42, 0x59, 0x69, 0x6d, + 0x69, 0x70, 0x69, 0x64, 0x78, 0x35, 0x6a, 0x6f, 0x69, 0x66, 0x73, 0x46, + 0x76, 0x48, 0x5a, 0x56, 0x77, 0x0a, 0x49, 0x45, 0x6f, 0x48, 0x4e, 0x4e, + 0x2f, 0x71, 0x2f, 0x78, 0x57, 0x41, 0x35, 0x62, 0x72, 0x58, 0x65, 0x74, + 0x68, 0x62, 0x64, 0x58, 0x77, 0x46, 0x65, 0x69, 0x6c, 0x48, 0x66, 0x6b, + 0x43, 0x6f, 0x4d, 0x52, 0x4e, 0x33, 0x7a, 0x55, 0x41, 0x37, 0x74, 0x46, + 0x46, 0x48, 0x65, 0x69, 0x34, 0x52, 0x34, 0x30, 0x63, 0x52, 0x33, 0x70, + 0x31, 0x6d, 0x30, 0x49, 0x76, 0x56, 0x56, 0x47, 0x62, 0x36, 0x0a, 0x67, + 0x31, 0x58, 0x71, 0x66, 0x4d, 0x49, 0x70, 0x69, 0x52, 0x76, 0x70, 0x62, + 0x37, 0x50, 0x4f, 0x34, 0x67, 0x57, 0x45, 0x79, 0x53, 0x38, 0x2b, 0x65, + 0x49, 0x56, 0x69, 0x62, 0x73, 0x6c, 0x66, 0x77, 0x58, 0x68, 0x6a, 0x64, + 0x46, 0x6a, 0x41, 0x53, 0x42, 0x67, 0x4d, 0x6d, 0x54, 0x6e, 0x72, 0x70, + 0x4d, 0x77, 0x61, 0x74, 0x58, 0x6c, 0x61, 0x6a, 0x52, 0x57, 0x63, 0x32, + 0x42, 0x51, 0x4e, 0x0a, 0x39, 0x6e, 0x6f, 0x48, 0x56, 0x38, 0x63, 0x69, + 0x67, 0x77, 0x55, 0x74, 0x50, 0x4a, 0x73, 0x6c, 0x4a, 0x6a, 0x30, 0x59, + 0x73, 0x36, 0x6c, 0x44, 0x66, 0x4d, 0x6a, 0x49, 0x71, 0x32, 0x53, 0x50, + 0x44, 0x71, 0x4f, 0x2f, 0x6e, 0x42, 0x75, 0x64, 0x4d, 0x4e, 0x76, 0x61, + 0x30, 0x42, 0x6b, 0x75, 0x71, 0x6a, 0x7a, 0x78, 0x2b, 0x7a, 0x4f, 0x41, + 0x64, 0x75, 0x54, 0x4e, 0x72, 0x52, 0x6c, 0x50, 0x0a, 0x42, 0x53, 0x65, + 0x4f, 0x45, 0x36, 0x46, 0x75, 0x77, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x41, 0x74, 0x6f, 0x73, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x65, 0x64, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20, + 0x4f, 0x3d, 0x41, 0x74, 0x6f, 0x73, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x74, 0x6f, + 0x73, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x32, 0x30, 0x31, 0x31, 0x20, 0x4f, 0x3d, 0x41, 0x74, 0x6f, + 0x73, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, + 0x41, 0x74, 0x6f, 0x73, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x32, 0x30, 0x31, 0x31, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x36, 0x34, + 0x33, 0x38, 0x37, 0x37, 0x34, 0x39, 0x37, 0x38, 0x31, 0x33, 0x33, 0x31, + 0x36, 0x34, 0x30, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x61, 0x65, 0x3a, 0x62, 0x39, 0x3a, 0x63, 0x34, 0x3a, 0x33, 0x32, 0x3a, + 0x34, 0x62, 0x3a, 0x61, 0x63, 0x3a, 0x37, 0x66, 0x3a, 0x35, 0x64, 0x3a, + 0x36, 0x36, 0x3a, 0x63, 0x63, 0x3a, 0x37, 0x37, 0x3a, 0x39, 0x34, 0x3a, + 0x62, 0x62, 0x3a, 0x32, 0x61, 0x3a, 0x37, 0x37, 0x3a, 0x35, 0x36, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x62, 0x3a, 0x62, + 0x31, 0x3a, 0x66, 0x35, 0x3a, 0x33, 0x65, 0x3a, 0x35, 0x35, 0x3a, 0x30, + 0x63, 0x3a, 0x31, 0x64, 0x3a, 0x63, 0x35, 0x3a, 0x66, 0x31, 0x3a, 0x64, + 0x34, 0x3a, 0x65, 0x36, 0x3a, 0x62, 0x37, 0x3a, 0x36, 0x61, 0x3a, 0x34, + 0x36, 0x3a, 0x34, 0x62, 0x3a, 0x35, 0x35, 0x3a, 0x30, 0x36, 0x3a, 0x30, + 0x32, 0x3a, 0x61, 0x63, 0x3a, 0x32, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x33, 0x3a, 0x35, 0x36, 0x3a, + 0x62, 0x65, 0x3a, 0x61, 0x32, 0x3a, 0x34, 0x34, 0x3a, 0x62, 0x37, 0x3a, + 0x61, 0x39, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x33, 0x3a, 0x35, 0x64, 0x3a, + 0x35, 0x33, 0x3a, 0x63, 0x61, 0x3a, 0x39, 0x61, 0x3a, 0x64, 0x37, 0x3a, + 0x38, 0x36, 0x3a, 0x34, 0x61, 0x3a, 0x63, 0x65, 0x3a, 0x30, 0x31, 0x3a, + 0x38, 0x65, 0x3a, 0x32, 0x64, 0x3a, 0x33, 0x35, 0x3a, 0x64, 0x35, 0x3a, + 0x66, 0x38, 0x3a, 0x66, 0x39, 0x3a, 0x36, 0x64, 0x3a, 0x64, 0x66, 0x3a, + 0x36, 0x38, 0x3a, 0x61, 0x36, 0x3a, 0x66, 0x34, 0x3a, 0x31, 0x61, 0x3a, + 0x61, 0x34, 0x3a, 0x37, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x44, 0x64, 0x7a, 0x43, 0x43, 0x41, 0x6c, 0x2b, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x58, 0x44, 0x50, 0x4c, 0x59, 0x69, + 0x78, 0x66, 0x73, 0x7a, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, + 0x41, 0x77, 0x50, 0x44, 0x45, 0x65, 0x4d, 0x42, 0x77, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x0a, 0x41, 0x77, 0x77, 0x56, 0x51, 0x58, 0x52, 0x76, 0x63, + 0x79, 0x42, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x47, 0x56, 0x6b, 0x55, + 0x6d, 0x39, 0x76, 0x64, 0x43, 0x41, 0x79, 0x4d, 0x44, 0x45, 0x78, 0x4d, + 0x51, 0x30, 0x77, 0x43, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, + 0x41, 0x52, 0x42, 0x64, 0x47, 0x39, 0x7a, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x45, + 0x52, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x54, 0x41, 0x33, + 0x4d, 0x44, 0x63, 0x78, 0x4e, 0x44, 0x55, 0x34, 0x4d, 0x7a, 0x42, 0x61, + 0x46, 0x77, 0x30, 0x7a, 0x4d, 0x44, 0x45, 0x79, 0x4d, 0x7a, 0x45, 0x79, + 0x4d, 0x7a, 0x55, 0x35, 0x4e, 0x54, 0x6c, 0x61, 0x4d, 0x44, 0x77, 0x78, + 0x48, 0x6a, 0x41, 0x63, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, + 0x0a, 0x46, 0x55, 0x46, 0x30, 0x62, 0x33, 0x4d, 0x67, 0x56, 0x48, 0x4a, + 0x31, 0x63, 0x33, 0x52, 0x6c, 0x5a, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, + 0x67, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x54, 0x45, 0x4e, 0x4d, 0x41, 0x73, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x45, 0x51, 0x58, 0x52, + 0x76, 0x63, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x0a, 0x52, 0x45, 0x55, 0x77, 0x67, 0x67, + 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, + 0x49, 0x42, 0x41, 0x51, 0x43, 0x56, 0x68, 0x54, 0x75, 0x58, 0x62, 0x79, + 0x6f, 0x37, 0x4c, 0x6a, 0x76, 0x50, 0x70, 0x76, 0x4d, 0x70, 0x0a, 0x4e, + 0x62, 0x37, 0x50, 0x47, 0x4b, 0x77, 0x2b, 0x71, 0x74, 0x6e, 0x34, 0x54, + 0x61, 0x41, 0x2b, 0x47, 0x6b, 0x65, 0x35, 0x76, 0x4a, 0x72, 0x66, 0x38, + 0x76, 0x37, 0x4d, 0x50, 0x6b, 0x66, 0x6f, 0x65, 0x70, 0x62, 0x43, 0x4a, + 0x49, 0x34, 0x31, 0x39, 0x4b, 0x6b, 0x4d, 0x2f, 0x49, 0x4c, 0x39, 0x62, + 0x63, 0x46, 0x79, 0x59, 0x69, 0x65, 0x39, 0x36, 0x6d, 0x76, 0x72, 0x35, + 0x34, 0x72, 0x4d, 0x0a, 0x56, 0x44, 0x36, 0x51, 0x55, 0x4d, 0x2b, 0x41, + 0x31, 0x4a, 0x58, 0x37, 0x36, 0x4c, 0x57, 0x43, 0x31, 0x42, 0x54, 0x46, + 0x74, 0x71, 0x6c, 0x56, 0x4a, 0x56, 0x66, 0x62, 0x73, 0x56, 0x44, 0x32, + 0x73, 0x47, 0x42, 0x6b, 0x57, 0x58, 0x70, 0x70, 0x7a, 0x77, 0x4f, 0x33, + 0x62, 0x77, 0x32, 0x2b, 0x79, 0x6a, 0x35, 0x76, 0x64, 0x48, 0x4c, 0x71, + 0x71, 0x6a, 0x41, 0x71, 0x63, 0x32, 0x4b, 0x2b, 0x0a, 0x53, 0x5a, 0x46, + 0x68, 0x79, 0x42, 0x48, 0x2b, 0x44, 0x67, 0x4d, 0x71, 0x39, 0x32, 0x6f, + 0x67, 0x33, 0x41, 0x49, 0x56, 0x44, 0x56, 0x34, 0x56, 0x61, 0x76, 0x7a, + 0x6a, 0x67, 0x73, 0x47, 0x31, 0x78, 0x5a, 0x31, 0x6b, 0x43, 0x57, 0x79, + 0x6a, 0x57, 0x5a, 0x67, 0x48, 0x4a, 0x38, 0x63, 0x62, 0x6c, 0x69, 0x74, + 0x68, 0x64, 0x48, 0x46, 0x73, 0x51, 0x2f, 0x48, 0x33, 0x4e, 0x59, 0x6b, + 0x51, 0x0a, 0x34, 0x4a, 0x37, 0x73, 0x56, 0x61, 0x45, 0x33, 0x49, 0x71, + 0x4b, 0x48, 0x42, 0x41, 0x55, 0x73, 0x52, 0x33, 0x32, 0x30, 0x48, 0x4c, + 0x6c, 0x69, 0x4b, 0x57, 0x59, 0x6f, 0x79, 0x72, 0x66, 0x68, 0x6b, 0x2f, + 0x57, 0x6b, 0x6c, 0x41, 0x4f, 0x5a, 0x75, 0x58, 0x43, 0x46, 0x74, 0x65, + 0x5a, 0x49, 0x36, 0x6f, 0x31, 0x51, 0x2f, 0x4e, 0x6e, 0x65, 0x7a, 0x47, + 0x38, 0x48, 0x44, 0x74, 0x30, 0x4c, 0x0a, 0x63, 0x70, 0x32, 0x41, 0x4d, + 0x42, 0x59, 0x48, 0x6c, 0x54, 0x38, 0x6f, 0x44, 0x76, 0x33, 0x46, 0x64, + 0x55, 0x39, 0x54, 0x31, 0x6e, 0x53, 0x61, 0x74, 0x43, 0x51, 0x75, 0x6a, + 0x67, 0x4b, 0x52, 0x7a, 0x33, 0x62, 0x46, 0x6d, 0x78, 0x35, 0x56, 0x64, + 0x4a, 0x78, 0x34, 0x49, 0x62, 0x48, 0x77, 0x4c, 0x66, 0x45, 0x4c, 0x6e, + 0x38, 0x4c, 0x56, 0x6c, 0x68, 0x67, 0x66, 0x38, 0x46, 0x51, 0x69, 0x0a, + 0x65, 0x6f, 0x77, 0x48, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, + 0x66, 0x54, 0x42, 0x37, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, 0x6e, 0x70, 0x51, 0x61, 0x78, + 0x4c, 0x4b, 0x59, 0x4a, 0x59, 0x4f, 0x37, 0x52, 0x6c, 0x2b, 0x6c, 0x77, + 0x72, 0x72, 0x77, 0x37, 0x47, 0x57, 0x7a, 0x62, 0x49, 0x54, 0x41, 0x50, + 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, 0x51, 0x59, 0x4d, 0x42, 0x61, + 0x41, 0x46, 0x4b, 0x65, 0x6c, 0x42, 0x72, 0x45, 0x73, 0x70, 0x67, 0x6c, + 0x67, 0x37, 0x74, 0x47, 0x58, 0x36, 0x58, 0x43, 0x75, 0x76, 0x44, 0x73, + 0x5a, 0x62, 0x4e, 0x73, 0x68, 0x4d, 0x42, 0x67, 0x47, 0x0a, 0x41, 0x31, + 0x55, 0x64, 0x49, 0x41, 0x51, 0x52, 0x4d, 0x41, 0x38, 0x77, 0x44, 0x51, + 0x59, 0x4c, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x41, 0x47, 0x77, 0x4c, 0x51, + 0x4d, 0x45, 0x41, 0x51, 0x45, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, + 0x47, 0x47, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x0a, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x42, 0x41, 0x51, 0x41, 0x6d, 0x64, 0x7a, 0x54, 0x62, 0x6c, + 0x45, 0x69, 0x47, 0x4b, 0x6b, 0x47, 0x64, 0x4c, 0x44, 0x34, 0x47, 0x6b, + 0x47, 0x44, 0x45, 0x6a, 0x4b, 0x77, 0x4c, 0x56, 0x4c, 0x67, 0x66, 0x75, + 0x58, 0x76, 0x54, 0x42, 0x7a, 0x6e, 0x6b, 0x2b, 0x6a, 0x35, 0x37, 0x73, + 0x6a, 0x31, 0x4f, 0x37, 0x5a, 0x38, 0x6a, 0x0a, 0x76, 0x5a, 0x66, 0x7a, + 0x61, 0x31, 0x7a, 0x76, 0x37, 0x76, 0x31, 0x41, 0x70, 0x74, 0x2b, 0x68, + 0x6b, 0x36, 0x45, 0x4b, 0x68, 0x71, 0x7a, 0x76, 0x49, 0x4e, 0x42, 0x35, + 0x41, 0x62, 0x31, 0x34, 0x39, 0x78, 0x6e, 0x59, 0x4a, 0x44, 0x45, 0x30, + 0x42, 0x41, 0x47, 0x6d, 0x75, 0x68, 0x57, 0x61, 0x77, 0x79, 0x66, 0x63, + 0x32, 0x45, 0x38, 0x50, 0x7a, 0x42, 0x68, 0x6a, 0x2f, 0x35, 0x6b, 0x50, + 0x0a, 0x44, 0x70, 0x46, 0x72, 0x64, 0x52, 0x62, 0x68, 0x49, 0x66, 0x7a, + 0x59, 0x4a, 0x73, 0x64, 0x48, 0x74, 0x36, 0x62, 0x50, 0x57, 0x48, 0x4a, + 0x78, 0x66, 0x72, 0x72, 0x68, 0x54, 0x5a, 0x56, 0x48, 0x4f, 0x38, 0x6d, + 0x76, 0x62, 0x61, 0x47, 0x30, 0x77, 0x65, 0x79, 0x4a, 0x39, 0x72, 0x51, + 0x50, 0x4f, 0x4c, 0x58, 0x69, 0x5a, 0x4e, 0x77, 0x6c, 0x7a, 0x36, 0x62, + 0x62, 0x36, 0x35, 0x70, 0x63, 0x0a, 0x6d, 0x61, 0x48, 0x46, 0x43, 0x4e, + 0x37, 0x39, 0x35, 0x74, 0x72, 0x56, 0x31, 0x6c, 0x70, 0x46, 0x44, 0x4d, + 0x53, 0x33, 0x77, 0x72, 0x55, 0x55, 0x37, 0x37, 0x51, 0x52, 0x2f, 0x77, + 0x34, 0x56, 0x74, 0x66, 0x58, 0x31, 0x32, 0x38, 0x61, 0x39, 0x36, 0x31, + 0x71, 0x6e, 0x38, 0x46, 0x59, 0x69, 0x71, 0x54, 0x78, 0x6c, 0x56, 0x4d, + 0x59, 0x56, 0x71, 0x4c, 0x32, 0x47, 0x6e, 0x73, 0x32, 0x44, 0x0a, 0x6c, + 0x6d, 0x68, 0x36, 0x63, 0x59, 0x47, 0x4a, 0x34, 0x51, 0x76, 0x68, 0x36, + 0x68, 0x45, 0x62, 0x61, 0x41, 0x6a, 0x4d, 0x61, 0x5a, 0x37, 0x73, 0x6e, + 0x6b, 0x47, 0x65, 0x52, 0x44, 0x49, 0x6d, 0x65, 0x75, 0x4b, 0x48, 0x43, + 0x6e, 0x45, 0x39, 0x36, 0x2b, 0x52, 0x61, 0x70, 0x4e, 0x4c, 0x62, 0x78, + 0x63, 0x33, 0x47, 0x33, 0x6d, 0x42, 0x2f, 0x75, 0x66, 0x4e, 0x50, 0x52, + 0x4a, 0x4c, 0x76, 0x0a, 0x4b, 0x72, 0x63, 0x59, 0x50, 0x71, 0x63, 0x5a, + 0x32, 0x51, 0x74, 0x39, 0x73, 0x54, 0x64, 0x42, 0x51, 0x72, 0x43, 0x36, + 0x59, 0x42, 0x33, 0x79, 0x2f, 0x67, 0x6b, 0x52, 0x73, 0x50, 0x43, 0x48, + 0x65, 0x36, 0x65, 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, + 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x31, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, + 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, + 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x20, 0x47, + 0x33, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, + 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x51, 0x75, 0x6f, 0x56, 0x61, + 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x31, 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x38, 0x37, 0x30, 0x34, 0x39, 0x36, 0x34, + 0x39, 0x36, 0x32, 0x36, 0x36, 0x36, 0x39, 0x32, 0x35, 0x30, 0x37, 0x33, + 0x36, 0x32, 0x37, 0x31, 0x30, 0x33, 0x37, 0x36, 0x30, 0x36, 0x35, 0x35, + 0x34, 0x36, 0x32, 0x34, 0x30, 0x37, 0x38, 0x37, 0x32, 0x30, 0x30, 0x33, + 0x34, 0x31, 0x39, 0x35, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x61, 0x34, 0x3a, 0x62, 0x63, 0x3a, 0x35, 0x62, 0x3a, 0x33, 0x66, 0x3a, + 0x66, 0x65, 0x3a, 0x33, 0x37, 0x3a, 0x39, 0x61, 0x3a, 0x66, 0x61, 0x3a, + 0x36, 0x34, 0x3a, 0x66, 0x30, 0x3a, 0x65, 0x32, 0x3a, 0x66, 0x61, 0x3a, + 0x30, 0x35, 0x3a, 0x33, 0x64, 0x3a, 0x30, 0x62, 0x3a, 0x61, 0x62, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x62, 0x3a, 0x38, + 0x65, 0x3a, 0x65, 0x61, 0x3a, 0x35, 0x37, 0x3a, 0x39, 0x36, 0x3a, 0x32, + 0x39, 0x3a, 0x31, 0x61, 0x3a, 0x63, 0x39, 0x3a, 0x33, 0x39, 0x3a, 0x65, + 0x61, 0x3a, 0x62, 0x38, 0x3a, 0x30, 0x61, 0x3a, 0x38, 0x31, 0x3a, 0x31, + 0x61, 0x3a, 0x37, 0x33, 0x3a, 0x37, 0x33, 0x3a, 0x63, 0x30, 0x3a, 0x39, + 0x33, 0x3a, 0x37, 0x39, 0x3a, 0x36, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x61, 0x3a, 0x38, 0x36, 0x3a, + 0x36, 0x66, 0x3a, 0x64, 0x31, 0x3a, 0x62, 0x32, 0x3a, 0x37, 0x36, 0x3a, + 0x62, 0x35, 0x3a, 0x37, 0x65, 0x3a, 0x35, 0x37, 0x3a, 0x38, 0x65, 0x3a, + 0x39, 0x32, 0x3a, 0x31, 0x63, 0x3a, 0x36, 0x35, 0x3a, 0x38, 0x32, 0x3a, + 0x38, 0x61, 0x3a, 0x32, 0x62, 0x3a, 0x65, 0x64, 0x3a, 0x35, 0x38, 0x3a, + 0x65, 0x39, 0x3a, 0x66, 0x32, 0x3a, 0x66, 0x32, 0x3a, 0x38, 0x38, 0x3a, + 0x30, 0x35, 0x3a, 0x34, 0x31, 0x3a, 0x33, 0x34, 0x3a, 0x62, 0x37, 0x3a, + 0x66, 0x31, 0x3a, 0x66, 0x34, 0x3a, 0x62, 0x66, 0x3a, 0x63, 0x39, 0x3a, + 0x63, 0x63, 0x3a, 0x37, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x46, 0x59, 0x44, 0x43, 0x43, 0x41, 0x30, 0x69, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x55, 0x65, 0x46, 0x68, 0x66, 0x4c, 0x71, + 0x30, 0x73, 0x47, 0x55, 0x76, 0x6a, 0x4e, 0x77, 0x63, 0x31, 0x4e, 0x42, + 0x4d, 0x6f, 0x74, 0x5a, 0x62, 0x55, 0x5a, 0x5a, 0x4d, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x77, 0x53, 0x44, 0x45, 0x4c, 0x4d, + 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x51, + 0x6b, 0x30, 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x54, 0x45, 0x46, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, 0x5a, + 0x47, 0x6c, 0x7a, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, + 0x57, 0x51, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x0a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x54, 0x46, 0x56, 0x46, 0x31, 0x62, 0x31, 0x5a, 0x68, + 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, + 0x51, 0x30, 0x45, 0x67, 0x4d, 0x53, 0x42, 0x48, 0x4d, 0x7a, 0x41, 0x65, + 0x46, 0x77, 0x30, 0x78, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x54, 0x49, 0x78, + 0x4e, 0x7a, 0x49, 0x33, 0x4e, 0x44, 0x52, 0x61, 0x46, 0x77, 0x30, 0x30, + 0x0a, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x54, 0x49, 0x78, 0x4e, 0x7a, 0x49, + 0x33, 0x4e, 0x44, 0x52, 0x61, 0x4d, 0x45, 0x67, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x4a, + 0x4e, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4b, 0x45, 0x78, 0x42, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, 0x52, + 0x70, 0x63, 0x79, 0x42, 0x4d, 0x0a, 0x61, 0x57, 0x31, 0x70, 0x64, 0x47, + 0x56, 0x6b, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x56, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, 0x57, + 0x52, 0x70, 0x63, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x42, 0x49, 0x44, 0x45, 0x67, 0x52, 0x7a, 0x4d, 0x77, 0x67, 0x67, + 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x0a, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, + 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x67, 0x76, 0x6c, 0x41, 0x51, 0x6a, + 0x75, 0x6e, 0x79, 0x62, 0x45, 0x43, 0x30, 0x42, 0x4a, 0x79, 0x46, 0x75, + 0x54, 0x48, 0x4b, 0x33, 0x43, 0x33, 0x6b, 0x45, 0x61, 0x6b, 0x45, 0x50, + 0x42, 0x74, 0x56, 0x0a, 0x77, 0x65, 0x64, 0x59, 0x4d, 0x42, 0x30, 0x6b, + 0x74, 0x4d, 0x50, 0x76, 0x68, 0x64, 0x36, 0x4d, 0x4c, 0x4f, 0x48, 0x42, + 0x50, 0x64, 0x2b, 0x43, 0x35, 0x6b, 0x2b, 0x74, 0x52, 0x34, 0x64, 0x73, + 0x37, 0x46, 0x74, 0x4a, 0x77, 0x55, 0x72, 0x56, 0x75, 0x34, 0x2f, 0x73, + 0x68, 0x36, 0x78, 0x2f, 0x67, 0x70, 0x71, 0x47, 0x37, 0x44, 0x30, 0x44, + 0x6d, 0x56, 0x49, 0x42, 0x30, 0x6a, 0x57, 0x65, 0x0a, 0x72, 0x4e, 0x72, + 0x77, 0x55, 0x38, 0x6c, 0x6d, 0x50, 0x4e, 0x53, 0x73, 0x41, 0x67, 0x48, + 0x61, 0x4a, 0x4e, 0x4d, 0x37, 0x71, 0x41, 0x4a, 0x47, 0x72, 0x36, 0x51, + 0x63, 0x34, 0x2f, 0x68, 0x7a, 0x57, 0x48, 0x61, 0x33, 0x39, 0x67, 0x36, + 0x51, 0x44, 0x62, 0x58, 0x77, 0x7a, 0x38, 0x7a, 0x36, 0x2b, 0x63, 0x5a, + 0x4d, 0x35, 0x63, 0x4f, 0x47, 0x4d, 0x41, 0x71, 0x4e, 0x46, 0x33, 0x34, + 0x31, 0x0a, 0x36, 0x38, 0x58, 0x66, 0x75, 0x77, 0x36, 0x63, 0x77, 0x49, + 0x32, 0x48, 0x34, 0x34, 0x67, 0x34, 0x68, 0x57, 0x66, 0x36, 0x50, 0x73, + 0x65, 0x72, 0x34, 0x42, 0x4f, 0x63, 0x42, 0x52, 0x69, 0x59, 0x7a, 0x35, + 0x50, 0x31, 0x73, 0x5a, 0x4b, 0x30, 0x2f, 0x43, 0x50, 0x54, 0x7a, 0x39, + 0x58, 0x45, 0x4a, 0x30, 0x6e, 0x67, 0x6e, 0x6a, 0x79, 0x62, 0x43, 0x4b, + 0x4f, 0x4c, 0x58, 0x53, 0x6f, 0x68, 0x0a, 0x34, 0x50, 0x77, 0x35, 0x71, + 0x6c, 0x50, 0x61, 0x66, 0x58, 0x37, 0x50, 0x47, 0x67, 0x6c, 0x54, 0x76, + 0x46, 0x30, 0x46, 0x42, 0x4d, 0x2b, 0x68, 0x53, 0x6f, 0x2b, 0x4c, 0x64, + 0x6f, 0x49, 0x4e, 0x6f, 0x66, 0x6a, 0x53, 0x78, 0x78, 0x52, 0x33, 0x57, + 0x35, 0x41, 0x32, 0x42, 0x34, 0x47, 0x62, 0x50, 0x67, 0x62, 0x36, 0x55, + 0x6c, 0x35, 0x6a, 0x78, 0x61, 0x59, 0x41, 0x2f, 0x71, 0x58, 0x70, 0x0a, + 0x55, 0x68, 0x74, 0x53, 0x74, 0x5a, 0x49, 0x35, 0x63, 0x67, 0x4d, 0x4a, + 0x59, 0x72, 0x32, 0x77, 0x59, 0x42, 0x5a, 0x75, 0x70, 0x74, 0x30, 0x6c, + 0x77, 0x67, 0x4e, 0x6d, 0x33, 0x66, 0x4d, 0x45, 0x30, 0x55, 0x44, 0x69, + 0x54, 0x6f, 0x75, 0x47, 0x39, 0x47, 0x2f, 0x6c, 0x67, 0x36, 0x41, 0x6e, + 0x68, 0x46, 0x34, 0x45, 0x77, 0x66, 0x57, 0x51, 0x76, 0x54, 0x41, 0x39, + 0x78, 0x4f, 0x2b, 0x6f, 0x0a, 0x61, 0x62, 0x77, 0x34, 0x6d, 0x36, 0x53, + 0x6b, 0x6c, 0x74, 0x46, 0x69, 0x32, 0x6d, 0x6e, 0x41, 0x41, 0x5a, 0x61, + 0x75, 0x79, 0x38, 0x52, 0x52, 0x4e, 0x4f, 0x6f, 0x4d, 0x71, 0x76, 0x38, + 0x68, 0x6a, 0x6c, 0x6d, 0x50, 0x53, 0x6c, 0x7a, 0x6b, 0x59, 0x5a, 0x71, + 0x6e, 0x30, 0x75, 0x6b, 0x71, 0x65, 0x49, 0x31, 0x52, 0x50, 0x54, 0x6f, + 0x56, 0x37, 0x71, 0x4a, 0x5a, 0x6a, 0x71, 0x6c, 0x63, 0x0a, 0x33, 0x73, + 0x58, 0x35, 0x6b, 0x43, 0x4c, 0x6c, 0x69, 0x45, 0x56, 0x78, 0x33, 0x5a, + 0x47, 0x5a, 0x62, 0x48, 0x71, 0x66, 0x50, 0x54, 0x32, 0x59, 0x66, 0x46, + 0x37, 0x32, 0x76, 0x68, 0x5a, 0x6f, 0x6f, 0x46, 0x36, 0x75, 0x43, 0x79, + 0x50, 0x38, 0x57, 0x67, 0x2b, 0x71, 0x49, 0x6e, 0x59, 0x74, 0x79, 0x61, + 0x45, 0x51, 0x48, 0x65, 0x54, 0x54, 0x52, 0x43, 0x4f, 0x51, 0x69, 0x4a, + 0x2f, 0x47, 0x0a, 0x4b, 0x75, 0x62, 0x58, 0x39, 0x5a, 0x71, 0x7a, 0x57, + 0x42, 0x34, 0x76, 0x4d, 0x49, 0x6b, 0x49, 0x47, 0x31, 0x53, 0x69, 0x74, + 0x5a, 0x67, 0x6a, 0x37, 0x41, 0x68, 0x33, 0x48, 0x4a, 0x56, 0x64, 0x59, + 0x64, 0x48, 0x4c, 0x69, 0x5a, 0x78, 0x66, 0x6f, 0x6b, 0x71, 0x52, 0x6d, + 0x75, 0x38, 0x68, 0x71, 0x6b, 0x6b, 0x57, 0x43, 0x4b, 0x69, 0x39, 0x59, + 0x53, 0x67, 0x78, 0x79, 0x58, 0x53, 0x74, 0x0a, 0x68, 0x66, 0x62, 0x5a, + 0x78, 0x62, 0x47, 0x4c, 0x30, 0x65, 0x55, 0x51, 0x4d, 0x6b, 0x31, 0x66, + 0x69, 0x79, 0x41, 0x36, 0x50, 0x45, 0x6b, 0x66, 0x4d, 0x34, 0x56, 0x5a, + 0x44, 0x64, 0x76, 0x4c, 0x43, 0x58, 0x56, 0x44, 0x61, 0x58, 0x50, 0x37, + 0x61, 0x33, 0x46, 0x39, 0x38, 0x4e, 0x2f, 0x45, 0x54, 0x48, 0x33, 0x47, + 0x6f, 0x79, 0x37, 0x49, 0x6c, 0x58, 0x6e, 0x4c, 0x63, 0x36, 0x4b, 0x4f, + 0x0a, 0x54, 0x6b, 0x30, 0x6b, 0x2b, 0x31, 0x37, 0x6b, 0x42, 0x4c, 0x35, + 0x79, 0x47, 0x36, 0x59, 0x6e, 0x4c, 0x55, 0x6c, 0x61, 0x6d, 0x58, 0x72, + 0x58, 0x58, 0x41, 0x6b, 0x67, 0x74, 0x33, 0x2b, 0x55, 0x75, 0x55, 0x2f, + 0x78, 0x44, 0x52, 0x78, 0x65, 0x69, 0x45, 0x49, 0x62, 0x45, 0x62, 0x66, + 0x6e, 0x6b, 0x64, 0x75, 0x65, 0x62, 0x50, 0x52, 0x71, 0x33, 0x34, 0x77, + 0x47, 0x6d, 0x41, 0x4f, 0x74, 0x0a, 0x7a, 0x43, 0x6a, 0x76, 0x70, 0x55, + 0x66, 0x7a, 0x55, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, + 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, + 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x0a, 0x42, + 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, + 0x67, 0x51, 0x55, 0x6f, 0x35, 0x66, 0x57, 0x38, 0x31, 0x36, 0x69, 0x45, + 0x4f, 0x47, 0x72, 0x52, 0x5a, 0x38, 0x38, 0x46, 0x32, 0x51, 0x38, 0x37, + 0x67, 0x46, 0x77, 0x6e, 0x4d, 0x77, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, + 0x51, 0x41, 0x44, 0x0a, 0x67, 0x67, 0x49, 0x42, 0x41, 0x42, 0x6a, 0x36, + 0x57, 0x33, 0x58, 0x38, 0x50, 0x6e, 0x72, 0x48, 0x58, 0x33, 0x66, 0x48, + 0x79, 0x74, 0x2f, 0x50, 0x58, 0x38, 0x4d, 0x53, 0x78, 0x45, 0x42, 0x64, + 0x31, 0x44, 0x4b, 0x71, 0x75, 0x47, 0x72, 0x58, 0x31, 0x52, 0x55, 0x56, + 0x52, 0x70, 0x67, 0x6a, 0x70, 0x65, 0x61, 0x51, 0x57, 0x78, 0x69, 0x5a, + 0x54, 0x4f, 0x4f, 0x74, 0x51, 0x71, 0x4f, 0x43, 0x0a, 0x4d, 0x54, 0x61, + 0x49, 0x7a, 0x65, 0x6e, 0x37, 0x78, 0x41, 0x53, 0x57, 0x53, 0x49, 0x73, + 0x42, 0x78, 0x34, 0x30, 0x42, 0x7a, 0x31, 0x73, 0x7a, 0x42, 0x70, 0x5a, + 0x47, 0x5a, 0x6e, 0x51, 0x64, 0x54, 0x2b, 0x33, 0x42, 0x74, 0x72, 0x6d, + 0x30, 0x44, 0x57, 0x48, 0x4d, 0x59, 0x33, 0x37, 0x58, 0x4c, 0x6e, 0x65, + 0x4d, 0x6c, 0x68, 0x77, 0x71, 0x49, 0x32, 0x68, 0x72, 0x68, 0x56, 0x64, + 0x32, 0x0a, 0x63, 0x44, 0x4d, 0x54, 0x2f, 0x75, 0x46, 0x50, 0x70, 0x69, + 0x4e, 0x33, 0x47, 0x50, 0x6f, 0x61, 0x6a, 0x4f, 0x69, 0x39, 0x5a, 0x63, + 0x6e, 0x50, 0x50, 0x2f, 0x54, 0x4a, 0x46, 0x39, 0x7a, 0x72, 0x78, 0x37, + 0x7a, 0x41, 0x42, 0x43, 0x34, 0x74, 0x52, 0x69, 0x39, 0x70, 0x5a, 0x73, + 0x4d, 0x62, 0x6a, 0x2f, 0x37, 0x73, 0x50, 0x74, 0x50, 0x4b, 0x6c, 0x4c, + 0x39, 0x32, 0x43, 0x69, 0x55, 0x4e, 0x0a, 0x71, 0x58, 0x73, 0x43, 0x48, + 0x4b, 0x6e, 0x51, 0x4f, 0x31, 0x38, 0x4c, 0x77, 0x49, 0x45, 0x36, 0x50, + 0x57, 0x54, 0x68, 0x76, 0x36, 0x63, 0x74, 0x54, 0x72, 0x31, 0x4e, 0x78, + 0x4e, 0x67, 0x70, 0x78, 0x69, 0x49, 0x59, 0x30, 0x4d, 0x57, 0x73, 0x63, + 0x67, 0x4b, 0x43, 0x50, 0x36, 0x6f, 0x36, 0x6f, 0x6a, 0x6f, 0x69, 0x6c, + 0x7a, 0x48, 0x64, 0x43, 0x47, 0x50, 0x44, 0x64, 0x52, 0x53, 0x35, 0x0a, + 0x59, 0x43, 0x67, 0x74, 0x57, 0x32, 0x6a, 0x67, 0x46, 0x71, 0x6c, 0x6d, + 0x67, 0x69, 0x4e, 0x52, 0x39, 0x65, 0x74, 0x54, 0x32, 0x44, 0x47, 0x62, + 0x65, 0x2b, 0x6d, 0x33, 0x6e, 0x55, 0x76, 0x72, 0x69, 0x42, 0x62, 0x50, + 0x2b, 0x56, 0x30, 0x34, 0x69, 0x6b, 0x6b, 0x77, 0x6a, 0x2b, 0x33, 0x78, + 0x36, 0x78, 0x6e, 0x30, 0x64, 0x78, 0x6f, 0x78, 0x47, 0x45, 0x31, 0x6e, + 0x56, 0x47, 0x77, 0x76, 0x0a, 0x62, 0x32, 0x58, 0x35, 0x32, 0x7a, 0x33, + 0x73, 0x49, 0x65, 0x78, 0x65, 0x39, 0x50, 0x53, 0x4c, 0x79, 0x6d, 0x42, + 0x6c, 0x56, 0x4e, 0x46, 0x78, 0x5a, 0x50, 0x54, 0x35, 0x70, 0x71, 0x4f, + 0x42, 0x4d, 0x7a, 0x59, 0x7a, 0x63, 0x66, 0x43, 0x6b, 0x65, 0x46, 0x39, + 0x4f, 0x72, 0x59, 0x4d, 0x68, 0x33, 0x6a, 0x52, 0x4a, 0x6a, 0x65, 0x68, + 0x5a, 0x72, 0x4a, 0x33, 0x79, 0x64, 0x6c, 0x6f, 0x32, 0x0a, 0x38, 0x68, + 0x50, 0x30, 0x72, 0x2b, 0x41, 0x4a, 0x78, 0x32, 0x45, 0x71, 0x62, 0x50, + 0x66, 0x67, 0x6e, 0x61, 0x36, 0x37, 0x68, 0x6b, 0x6f, 0x6f, 0x62, 0x79, + 0x37, 0x75, 0x74, 0x48, 0x6e, 0x4e, 0x6b, 0x44, 0x50, 0x44, 0x73, 0x33, + 0x62, 0x36, 0x39, 0x66, 0x42, 0x73, 0x6e, 0x51, 0x47, 0x51, 0x2b, 0x70, + 0x36, 0x51, 0x39, 0x70, 0x78, 0x79, 0x7a, 0x30, 0x66, 0x61, 0x77, 0x78, + 0x2f, 0x6b, 0x0a, 0x4e, 0x53, 0x42, 0x54, 0x38, 0x6c, 0x54, 0x52, 0x33, + 0x32, 0x47, 0x44, 0x70, 0x67, 0x4c, 0x69, 0x4a, 0x54, 0x6a, 0x65, 0x68, + 0x54, 0x49, 0x74, 0x58, 0x6e, 0x4f, 0x51, 0x55, 0x6c, 0x31, 0x43, 0x78, + 0x4d, 0x34, 0x39, 0x53, 0x2b, 0x48, 0x35, 0x47, 0x59, 0x51, 0x64, 0x31, + 0x61, 0x4a, 0x51, 0x7a, 0x45, 0x48, 0x37, 0x51, 0x52, 0x54, 0x44, 0x76, + 0x64, 0x62, 0x4a, 0x57, 0x71, 0x4e, 0x6a, 0x0a, 0x5a, 0x67, 0x4b, 0x41, + 0x76, 0x51, 0x55, 0x36, 0x4f, 0x30, 0x65, 0x63, 0x37, 0x41, 0x41, 0x6d, + 0x54, 0x50, 0x57, 0x49, 0x55, 0x62, 0x2b, 0x6f, 0x49, 0x33, 0x38, 0x59, + 0x42, 0x37, 0x41, 0x4c, 0x37, 0x59, 0x73, 0x6d, 0x6f, 0x57, 0x54, 0x54, + 0x59, 0x55, 0x72, 0x72, 0x58, 0x4a, 0x2f, 0x65, 0x73, 0x36, 0x39, 0x6e, + 0x41, 0x37, 0x4d, 0x66, 0x33, 0x57, 0x31, 0x64, 0x61, 0x57, 0x68, 0x70, + 0x0a, 0x71, 0x31, 0x34, 0x36, 0x37, 0x48, 0x78, 0x70, 0x76, 0x4d, 0x63, + 0x37, 0x68, 0x55, 0x36, 0x65, 0x46, 0x62, 0x6d, 0x30, 0x46, 0x55, 0x2f, + 0x44, 0x6c, 0x58, 0x70, 0x59, 0x31, 0x38, 0x6c, 0x73, 0x36, 0x57, 0x79, + 0x35, 0x38, 0x79, 0x6c, 0x6a, 0x58, 0x72, 0x51, 0x73, 0x38, 0x43, 0x30, + 0x39, 0x37, 0x56, 0x70, 0x6c, 0x34, 0x4b, 0x6c, 0x62, 0x51, 0x4d, 0x4a, + 0x49, 0x6d, 0x59, 0x46, 0x74, 0x0a, 0x6e, 0x68, 0x38, 0x47, 0x4b, 0x6a, + 0x77, 0x53, 0x74, 0x49, 0x73, 0x50, 0x6d, 0x36, 0x49, 0x6b, 0x38, 0x4b, + 0x61, 0x4e, 0x31, 0x6e, 0x72, 0x67, 0x53, 0x37, 0x5a, 0x6b, 0x6c, 0x6d, + 0x4f, 0x56, 0x68, 0x4d, 0x4a, 0x4b, 0x7a, 0x52, 0x77, 0x75, 0x4a, 0x49, + 0x63, 0x7a, 0x59, 0x4f, 0x58, 0x44, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, + 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x51, + 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, + 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x32, + 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, + 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x51, 0x75, 0x6f, + 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x32, 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x39, 0x30, 0x31, 0x35, 0x36, + 0x30, 0x37, 0x39, 0x34, 0x35, 0x38, 0x39, 0x35, 0x39, 0x32, 0x35, 0x37, + 0x34, 0x34, 0x36, 0x31, 0x33, 0x33, 0x31, 0x36, 0x39, 0x32, 0x36, 0x36, + 0x30, 0x37, 0x39, 0x39, 0x36, 0x32, 0x30, 0x32, 0x36, 0x38, 0x32, 0x34, + 0x37, 0x32, 0x35, 0x38, 0x30, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x61, 0x66, 0x3a, 0x30, 0x63, 0x3a, 0x38, 0x36, 0x3a, 0x36, + 0x65, 0x3a, 0x62, 0x66, 0x3a, 0x34, 0x30, 0x3a, 0x32, 0x64, 0x3a, 0x37, + 0x66, 0x3a, 0x30, 0x62, 0x3a, 0x33, 0x65, 0x3a, 0x31, 0x32, 0x3a, 0x35, + 0x30, 0x3a, 0x62, 0x61, 0x3a, 0x31, 0x32, 0x3a, 0x33, 0x64, 0x3a, 0x30, + 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x39, + 0x3a, 0x33, 0x63, 0x3a, 0x36, 0x31, 0x3a, 0x66, 0x33, 0x3a, 0x38, 0x62, + 0x3a, 0x38, 0x62, 0x3a, 0x64, 0x63, 0x3a, 0x37, 0x64, 0x3a, 0x35, 0x35, + 0x3a, 0x64, 0x66, 0x3a, 0x37, 0x35, 0x3a, 0x33, 0x38, 0x3a, 0x30, 0x32, + 0x3a, 0x30, 0x35, 0x3a, 0x30, 0x30, 0x3a, 0x65, 0x31, 0x3a, 0x32, 0x35, + 0x3a, 0x66, 0x35, 0x3a, 0x63, 0x38, 0x3a, 0x33, 0x36, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x66, 0x3a, 0x65, + 0x34, 0x3a, 0x66, 0x62, 0x3a, 0x30, 0x61, 0x3a, 0x66, 0x39, 0x3a, 0x33, + 0x61, 0x3a, 0x34, 0x64, 0x3a, 0x30, 0x64, 0x3a, 0x36, 0x37, 0x3a, 0x64, + 0x62, 0x3a, 0x30, 0x62, 0x3a, 0x65, 0x62, 0x3a, 0x62, 0x32, 0x3a, 0x33, + 0x65, 0x3a, 0x33, 0x37, 0x3a, 0x63, 0x37, 0x3a, 0x31, 0x62, 0x3a, 0x66, + 0x33, 0x3a, 0x32, 0x35, 0x3a, 0x64, 0x63, 0x3a, 0x62, 0x63, 0x3a, 0x64, + 0x64, 0x3a, 0x32, 0x34, 0x3a, 0x30, 0x65, 0x3a, 0x61, 0x30, 0x3a, 0x34, + 0x64, 0x3a, 0x61, 0x66, 0x3a, 0x35, 0x38, 0x3a, 0x62, 0x34, 0x3a, 0x37, + 0x65, 0x3a, 0x31, 0x38, 0x3a, 0x34, 0x30, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x46, 0x59, 0x44, 0x43, 0x43, 0x41, 0x30, 0x69, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x55, 0x52, 0x46, 0x63, 0x30, + 0x4a, 0x46, 0x75, 0x42, 0x69, 0x5a, 0x73, 0x31, 0x38, 0x73, 0x36, 0x34, + 0x4b, 0x7a, 0x74, 0x62, 0x70, 0x79, 0x62, 0x77, 0x64, 0x53, 0x67, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x77, 0x53, 0x44, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x51, 0x6b, 0x30, 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x54, 0x45, 0x46, 0x46, 0x31, 0x62, 0x31, 0x5a, + 0x68, 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, + 0x30, 0x5a, 0x57, 0x51, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x0a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x56, 0x46, 0x31, 0x62, 0x31, + 0x5a, 0x68, 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, + 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x69, 0x42, 0x48, 0x4d, 0x7a, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x54, + 0x49, 0x78, 0x4f, 0x44, 0x55, 0x35, 0x4d, 0x7a, 0x4a, 0x61, 0x46, 0x77, + 0x30, 0x30, 0x0a, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x54, 0x49, 0x78, 0x4f, + 0x44, 0x55, 0x35, 0x4d, 0x7a, 0x4a, 0x61, 0x4d, 0x45, 0x67, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x4a, 0x4e, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x45, 0x78, 0x42, 0x52, 0x64, 0x57, 0x39, 0x57, 0x59, + 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x4d, 0x0a, 0x61, 0x57, 0x31, 0x70, + 0x64, 0x47, 0x56, 0x6b, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x56, 0x52, 0x64, 0x57, 0x39, 0x57, + 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, + 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x67, 0x52, 0x7a, 0x4d, 0x77, + 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, + 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, + 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x68, 0x72, 0x69, 0x57, + 0x79, 0x41, 0x52, 0x6a, 0x63, 0x56, 0x34, 0x67, 0x2f, 0x52, 0x75, 0x76, + 0x35, 0x72, 0x2b, 0x4c, 0x72, 0x49, 0x33, 0x48, 0x69, 0x6d, 0x74, 0x46, + 0x68, 0x5a, 0x69, 0x46, 0x66, 0x0a, 0x71, 0x71, 0x38, 0x6e, 0x55, 0x65, + 0x56, 0x75, 0x47, 0x78, 0x62, 0x55, 0x4c, 0x58, 0x31, 0x51, 0x73, 0x46, + 0x4e, 0x33, 0x76, 0x58, 0x67, 0x36, 0x59, 0x4f, 0x4a, 0x6b, 0x41, 0x70, + 0x74, 0x38, 0x68, 0x70, 0x76, 0x57, 0x47, 0x6f, 0x36, 0x74, 0x2f, 0x78, + 0x38, 0x56, 0x66, 0x39, 0x57, 0x56, 0x48, 0x68, 0x4c, 0x4c, 0x35, 0x68, + 0x53, 0x45, 0x42, 0x4d, 0x48, 0x66, 0x4e, 0x72, 0x4d, 0x57, 0x0a, 0x6e, + 0x34, 0x72, 0x6a, 0x79, 0x64, 0x75, 0x59, 0x4e, 0x4d, 0x37, 0x59, 0x4d, + 0x78, 0x63, 0x6f, 0x52, 0x76, 0x79, 0x6e, 0x79, 0x66, 0x44, 0x53, 0x74, + 0x4e, 0x56, 0x4e, 0x43, 0x58, 0x4a, 0x4a, 0x2b, 0x66, 0x4b, 0x48, 0x34, + 0x36, 0x6e, 0x61, 0x66, 0x61, 0x46, 0x39, 0x61, 0x37, 0x49, 0x36, 0x4a, + 0x61, 0x6c, 0x74, 0x55, 0x6b, 0x53, 0x73, 0x2b, 0x4c, 0x35, 0x75, 0x2b, + 0x39, 0x79, 0x6d, 0x0a, 0x63, 0x35, 0x47, 0x51, 0x59, 0x61, 0x59, 0x44, + 0x46, 0x43, 0x44, 0x79, 0x35, 0x34, 0x65, 0x6a, 0x69, 0x4b, 0x32, 0x74, + 0x6f, 0x49, 0x7a, 0x2f, 0x70, 0x67, 0x73, 0x6c, 0x55, 0x69, 0x58, 0x6e, + 0x46, 0x67, 0x48, 0x56, 0x79, 0x37, 0x67, 0x31, 0x67, 0x51, 0x79, 0x6a, + 0x4f, 0x2f, 0x44, 0x68, 0x34, 0x66, 0x78, 0x61, 0x58, 0x63, 0x36, 0x41, + 0x63, 0x57, 0x33, 0x34, 0x53, 0x61, 0x73, 0x2b, 0x0a, 0x4f, 0x37, 0x71, + 0x34, 0x31, 0x34, 0x41, 0x42, 0x2b, 0x36, 0x58, 0x72, 0x57, 0x37, 0x50, + 0x46, 0x58, 0x6d, 0x41, 0x71, 0x4d, 0x61, 0x43, 0x76, 0x4e, 0x2b, 0x67, + 0x67, 0x4f, 0x70, 0x2b, 0x6f, 0x4d, 0x69, 0x77, 0x4d, 0x7a, 0x41, 0x6b, + 0x64, 0x30, 0x35, 0x36, 0x4f, 0x58, 0x62, 0x78, 0x4d, 0x6d, 0x4f, 0x37, + 0x46, 0x47, 0x6d, 0x68, 0x37, 0x37, 0x46, 0x4f, 0x6d, 0x36, 0x52, 0x51, + 0x31, 0x0a, 0x6f, 0x39, 0x2f, 0x4e, 0x67, 0x4a, 0x38, 0x4d, 0x53, 0x50, + 0x73, 0x63, 0x39, 0x50, 0x47, 0x2f, 0x53, 0x72, 0x6a, 0x36, 0x31, 0x59, + 0x78, 0x78, 0x53, 0x73, 0x63, 0x66, 0x72, 0x66, 0x35, 0x42, 0x6d, 0x72, + 0x4f, 0x44, 0x58, 0x66, 0x4b, 0x45, 0x56, 0x75, 0x2b, 0x6c, 0x56, 0x30, + 0x50, 0x4f, 0x4b, 0x61, 0x32, 0x4d, 0x71, 0x31, 0x57, 0x2f, 0x78, 0x50, + 0x74, 0x62, 0x41, 0x64, 0x30, 0x6a, 0x0a, 0x49, 0x61, 0x46, 0x59, 0x41, + 0x49, 0x37, 0x44, 0x30, 0x47, 0x6f, 0x54, 0x37, 0x52, 0x50, 0x6a, 0x45, + 0x69, 0x75, 0x41, 0x33, 0x47, 0x66, 0x6d, 0x6c, 0x62, 0x4c, 0x4e, 0x48, + 0x69, 0x4a, 0x75, 0x4b, 0x76, 0x68, 0x42, 0x31, 0x50, 0x4c, 0x4b, 0x46, + 0x41, 0x65, 0x4e, 0x69, 0x6c, 0x55, 0x53, 0x78, 0x6d, 0x6e, 0x31, 0x75, + 0x49, 0x5a, 0x6f, 0x4c, 0x31, 0x4e, 0x65, 0x73, 0x4e, 0x4b, 0x71, 0x0a, + 0x49, 0x63, 0x47, 0x59, 0x35, 0x6a, 0x44, 0x6a, 0x5a, 0x31, 0x58, 0x48, + 0x6d, 0x32, 0x36, 0x73, 0x47, 0x61, 0x68, 0x56, 0x70, 0x6b, 0x55, 0x47, + 0x30, 0x43, 0x4d, 0x36, 0x32, 0x2b, 0x74, 0x6c, 0x58, 0x53, 0x6f, 0x52, + 0x45, 0x66, 0x41, 0x37, 0x54, 0x38, 0x70, 0x74, 0x39, 0x44, 0x54, 0x45, + 0x63, 0x65, 0x54, 0x2f, 0x41, 0x46, 0x72, 0x32, 0x58, 0x4b, 0x34, 0x6a, + 0x59, 0x49, 0x56, 0x7a, 0x0a, 0x38, 0x65, 0x51, 0x51, 0x73, 0x53, 0x57, + 0x75, 0x31, 0x5a, 0x4b, 0x37, 0x45, 0x38, 0x45, 0x4d, 0x34, 0x44, 0x6e, + 0x61, 0x74, 0x44, 0x6c, 0x58, 0x74, 0x61, 0x73, 0x31, 0x71, 0x6e, 0x49, + 0x68, 0x4f, 0x34, 0x4d, 0x31, 0x35, 0x7a, 0x48, 0x66, 0x65, 0x69, 0x46, + 0x75, 0x75, 0x44, 0x49, 0x49, 0x66, 0x52, 0x30, 0x79, 0x6b, 0x52, 0x56, + 0x4b, 0x59, 0x6e, 0x4c, 0x50, 0x34, 0x33, 0x65, 0x68, 0x0a, 0x76, 0x4e, + 0x55, 0x52, 0x47, 0x33, 0x59, 0x42, 0x5a, 0x77, 0x6a, 0x67, 0x51, 0x51, + 0x76, 0x44, 0x36, 0x78, 0x56, 0x75, 0x2b, 0x4b, 0x51, 0x5a, 0x32, 0x61, + 0x4b, 0x72, 0x72, 0x2b, 0x49, 0x6e, 0x55, 0x6c, 0x59, 0x72, 0x41, 0x6f, + 0x6f, 0x73, 0x46, 0x43, 0x54, 0x35, 0x76, 0x30, 0x49, 0x43, 0x76, 0x79, + 0x62, 0x49, 0x78, 0x6f, 0x2f, 0x67, 0x62, 0x6a, 0x68, 0x39, 0x55, 0x79, + 0x33, 0x6c, 0x0a, 0x37, 0x5a, 0x69, 0x7a, 0x6c, 0x57, 0x4e, 0x6f, 0x66, + 0x2f, 0x6b, 0x31, 0x39, 0x4e, 0x2b, 0x49, 0x78, 0x57, 0x41, 0x31, 0x6b, + 0x73, 0x42, 0x38, 0x61, 0x52, 0x78, 0x68, 0x6c, 0x52, 0x62, 0x51, 0x36, + 0x39, 0x34, 0x4c, 0x72, 0x7a, 0x34, 0x45, 0x45, 0x45, 0x56, 0x6c, 0x57, + 0x46, 0x41, 0x34, 0x72, 0x30, 0x6a, 0x79, 0x57, 0x62, 0x59, 0x57, 0x38, + 0x6a, 0x77, 0x4e, 0x6b, 0x41, 0x4c, 0x47, 0x0a, 0x63, 0x43, 0x34, 0x42, + 0x72, 0x54, 0x77, 0x56, 0x31, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, + 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, + 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, + 0x0a, 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, + 0x45, 0x46, 0x67, 0x51, 0x55, 0x37, 0x65, 0x64, 0x76, 0x64, 0x6c, 0x71, + 0x2f, 0x59, 0x4f, 0x78, 0x4a, 0x57, 0x38, 0x61, 0x6c, 0x64, 0x37, 0x74, + 0x79, 0x46, 0x6e, 0x47, 0x62, 0x78, 0x44, 0x30, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x4c, 0x42, 0x51, 0x41, 0x44, 0x0a, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4a, + 0x48, 0x66, 0x67, 0x44, 0x39, 0x44, 0x43, 0x58, 0x35, 0x78, 0x77, 0x76, + 0x66, 0x72, 0x73, 0x34, 0x69, 0x50, 0x34, 0x56, 0x47, 0x79, 0x76, 0x44, + 0x31, 0x31, 0x2b, 0x53, 0x68, 0x64, 0x79, 0x4c, 0x79, 0x5a, 0x6d, 0x33, + 0x74, 0x64, 0x71, 0x75, 0x58, 0x4b, 0x34, 0x51, 0x72, 0x33, 0x36, 0x4c, + 0x4c, 0x54, 0x6e, 0x39, 0x31, 0x6e, 0x4d, 0x58, 0x36, 0x36, 0x0a, 0x41, + 0x61, 0x72, 0x48, 0x61, 0x6b, 0x45, 0x37, 0x6b, 0x4e, 0x51, 0x49, 0x58, + 0x4c, 0x4a, 0x67, 0x61, 0x70, 0x44, 0x77, 0x79, 0x4d, 0x34, 0x44, 0x59, + 0x76, 0x6d, 0x4c, 0x37, 0x66, 0x74, 0x75, 0x4b, 0x74, 0x77, 0x47, 0x54, + 0x54, 0x77, 0x70, 0x44, 0x34, 0x6b, 0x57, 0x69, 0x6c, 0x68, 0x4d, 0x53, + 0x41, 0x2f, 0x6f, 0x68, 0x47, 0x48, 0x71, 0x50, 0x48, 0x4b, 0x6d, 0x64, + 0x2b, 0x52, 0x43, 0x0a, 0x72, 0x6f, 0x69, 0x6a, 0x51, 0x31, 0x68, 0x35, + 0x66, 0x71, 0x37, 0x4b, 0x70, 0x56, 0x4d, 0x4e, 0x71, 0x54, 0x31, 0x77, + 0x76, 0x53, 0x41, 0x5a, 0x59, 0x61, 0x52, 0x73, 0x4f, 0x50, 0x78, 0x44, + 0x4d, 0x75, 0x48, 0x42, 0x52, 0x2f, 0x2f, 0x34, 0x37, 0x50, 0x45, 0x52, + 0x49, 0x6a, 0x4b, 0x57, 0x6e, 0x4d, 0x4c, 0x32, 0x57, 0x32, 0x6d, 0x57, + 0x65, 0x79, 0x41, 0x4d, 0x51, 0x30, 0x47, 0x61, 0x0a, 0x57, 0x2f, 0x5a, + 0x5a, 0x47, 0x59, 0x6a, 0x65, 0x56, 0x59, 0x67, 0x33, 0x55, 0x51, 0x74, + 0x34, 0x58, 0x41, 0x6f, 0x65, 0x6f, 0x30, 0x4c, 0x39, 0x78, 0x35, 0x32, + 0x49, 0x44, 0x38, 0x44, 0x79, 0x65, 0x41, 0x49, 0x6b, 0x56, 0x4a, 0x4f, + 0x76, 0x69, 0x59, 0x65, 0x49, 0x79, 0x55, 0x71, 0x41, 0x48, 0x65, 0x72, + 0x51, 0x62, 0x6a, 0x35, 0x68, 0x4c, 0x6a, 0x61, 0x37, 0x4e, 0x51, 0x34, + 0x6e, 0x0a, 0x6c, 0x76, 0x31, 0x6d, 0x4e, 0x44, 0x74, 0x68, 0x63, 0x6e, + 0x50, 0x78, 0x46, 0x6c, 0x78, 0x48, 0x42, 0x6c, 0x52, 0x4a, 0x41, 0x48, + 0x70, 0x59, 0x45, 0x72, 0x41, 0x4b, 0x37, 0x34, 0x58, 0x39, 0x73, 0x62, + 0x67, 0x7a, 0x64, 0x57, 0x71, 0x54, 0x48, 0x42, 0x4c, 0x6d, 0x59, 0x46, + 0x35, 0x76, 0x48, 0x58, 0x2f, 0x4a, 0x48, 0x79, 0x50, 0x4c, 0x68, 0x47, + 0x47, 0x66, 0x48, 0x6f, 0x4a, 0x45, 0x0a, 0x2b, 0x56, 0x2b, 0x74, 0x59, + 0x6c, 0x55, 0x6b, 0x6d, 0x6c, 0x4b, 0x59, 0x37, 0x56, 0x48, 0x6e, 0x6f, + 0x58, 0x36, 0x58, 0x4f, 0x75, 0x59, 0x76, 0x48, 0x78, 0x48, 0x61, 0x55, + 0x34, 0x41, 0x73, 0x68, 0x5a, 0x36, 0x72, 0x4e, 0x52, 0x44, 0x62, 0x49, + 0x6c, 0x39, 0x71, 0x78, 0x56, 0x36, 0x58, 0x55, 0x2f, 0x49, 0x79, 0x41, + 0x67, 0x6b, 0x77, 0x6f, 0x31, 0x6a, 0x77, 0x44, 0x51, 0x48, 0x56, 0x0a, + 0x63, 0x73, 0x61, 0x78, 0x66, 0x47, 0x6c, 0x37, 0x77, 0x2f, 0x55, 0x32, + 0x52, 0x63, 0x78, 0x68, 0x62, 0x6c, 0x35, 0x4d, 0x6c, 0x4d, 0x56, 0x65, + 0x72, 0x75, 0x67, 0x4f, 0x58, 0x6f, 0x75, 0x2f, 0x39, 0x38, 0x33, 0x67, + 0x37, 0x61, 0x45, 0x4f, 0x47, 0x7a, 0x50, 0x75, 0x56, 0x42, 0x6a, 0x2b, + 0x44, 0x37, 0x37, 0x76, 0x66, 0x6f, 0x52, 0x72, 0x51, 0x2b, 0x4e, 0x77, + 0x6d, 0x4e, 0x74, 0x64, 0x0a, 0x64, 0x62, 0x49, 0x4e, 0x57, 0x51, 0x65, + 0x46, 0x46, 0x53, 0x4d, 0x35, 0x31, 0x76, 0x48, 0x66, 0x71, 0x53, 0x59, + 0x50, 0x31, 0x6b, 0x6a, 0x48, 0x73, 0x36, 0x59, 0x69, 0x39, 0x54, 0x4d, + 0x33, 0x57, 0x70, 0x56, 0x48, 0x6e, 0x33, 0x75, 0x36, 0x47, 0x42, 0x56, + 0x76, 0x2f, 0x39, 0x59, 0x55, 0x5a, 0x49, 0x4e, 0x4a, 0x30, 0x67, 0x70, + 0x6e, 0x49, 0x64, 0x73, 0x50, 0x4e, 0x57, 0x4e, 0x67, 0x0a, 0x4b, 0x43, + 0x4c, 0x6a, 0x73, 0x5a, 0x57, 0x44, 0x7a, 0x59, 0x57, 0x6d, 0x33, 0x53, + 0x38, 0x50, 0x35, 0x32, 0x64, 0x53, 0x62, 0x72, 0x73, 0x76, 0x68, 0x58, + 0x7a, 0x31, 0x53, 0x6e, 0x50, 0x6e, 0x78, 0x54, 0x37, 0x41, 0x76, 0x53, + 0x45, 0x53, 0x42, 0x54, 0x2f, 0x38, 0x74, 0x77, 0x4e, 0x4a, 0x41, 0x6c, + 0x76, 0x49, 0x4a, 0x65, 0x62, 0x69, 0x56, 0x44, 0x6a, 0x31, 0x65, 0x59, + 0x65, 0x4d, 0x0a, 0x48, 0x56, 0x4f, 0x79, 0x54, 0x6f, 0x56, 0x37, 0x42, + 0x6a, 0x6a, 0x48, 0x4c, 0x50, 0x6a, 0x34, 0x73, 0x48, 0x4b, 0x4e, 0x4a, + 0x65, 0x56, 0x33, 0x55, 0x76, 0x51, 0x44, 0x48, 0x45, 0x69, 0x6d, 0x55, + 0x46, 0x2b, 0x49, 0x49, 0x44, 0x42, 0x75, 0x38, 0x6f, 0x4a, 0x44, 0x71, + 0x7a, 0x32, 0x58, 0x68, 0x4f, 0x64, 0x54, 0x2b, 0x79, 0x48, 0x42, 0x54, + 0x77, 0x38, 0x69, 0x6d, 0x6f, 0x61, 0x34, 0x0a, 0x57, 0x53, 0x72, 0x32, + 0x52, 0x7a, 0x30, 0x5a, 0x69, 0x43, 0x33, 0x6f, 0x68, 0x65, 0x47, 0x65, + 0x37, 0x49, 0x55, 0x49, 0x61, 0x72, 0x46, 0x73, 0x4e, 0x4d, 0x6b, 0x64, + 0x37, 0x45, 0x67, 0x72, 0x4f, 0x33, 0x6a, 0x74, 0x5a, 0x73, 0x53, 0x4f, + 0x65, 0x57, 0x6d, 0x44, 0x33, 0x6e, 0x2b, 0x4d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33, 0x20, 0x47, 0x33, 0x20, 0x4f, + 0x3d, 0x51, 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x51, 0x75, 0x6f, 0x56, + 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x33, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x51, 0x75, 0x6f, 0x56, + 0x61, 0x64, 0x69, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x51, + 0x75, 0x6f, 0x56, 0x61, 0x64, 0x69, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x33, 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x32, 0x36, 0x38, 0x30, + 0x39, 0x30, 0x37, 0x36, 0x31, 0x31, 0x37, 0x30, 0x34, 0x36, 0x31, 0x34, + 0x36, 0x32, 0x34, 0x36, 0x33, 0x39, 0x39, 0x35, 0x39, 0x35, 0x32, 0x31, + 0x35, 0x37, 0x33, 0x32, 0x37, 0x32, 0x34, 0x32, 0x31, 0x33, 0x37, 0x30, + 0x38, 0x39, 0x32, 0x33, 0x39, 0x35, 0x38, 0x31, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x66, 0x3a, 0x37, 0x64, 0x3a, 0x62, 0x39, + 0x3a, 0x61, 0x64, 0x3a, 0x35, 0x34, 0x3a, 0x36, 0x66, 0x3a, 0x36, 0x38, + 0x3a, 0x61, 0x31, 0x3a, 0x64, 0x66, 0x3a, 0x38, 0x39, 0x3a, 0x35, 0x37, + 0x3a, 0x30, 0x33, 0x3a, 0x39, 0x37, 0x3a, 0x34, 0x33, 0x3a, 0x62, 0x30, + 0x3a, 0x64, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x34, 0x38, 0x3a, 0x31, 0x32, 0x3a, 0x62, 0x64, 0x3a, 0x39, 0x32, 0x3a, + 0x33, 0x63, 0x3a, 0x61, 0x38, 0x3a, 0x63, 0x34, 0x3a, 0x33, 0x39, 0x3a, + 0x30, 0x36, 0x3a, 0x65, 0x37, 0x3a, 0x33, 0x30, 0x3a, 0x36, 0x64, 0x3a, + 0x32, 0x37, 0x3a, 0x39, 0x36, 0x3a, 0x65, 0x36, 0x3a, 0x61, 0x34, 0x3a, + 0x63, 0x66, 0x3a, 0x32, 0x32, 0x3a, 0x32, 0x65, 0x3a, 0x37, 0x64, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x38, + 0x3a, 0x65, 0x66, 0x3a, 0x38, 0x31, 0x3a, 0x64, 0x65, 0x3a, 0x32, 0x30, + 0x3a, 0x32, 0x65, 0x3a, 0x62, 0x30, 0x3a, 0x31, 0x38, 0x3a, 0x34, 0x35, + 0x3a, 0x32, 0x65, 0x3a, 0x34, 0x33, 0x3a, 0x66, 0x38, 0x3a, 0x36, 0x34, + 0x3a, 0x37, 0x32, 0x3a, 0x35, 0x63, 0x3a, 0x65, 0x61, 0x3a, 0x35, 0x66, + 0x3a, 0x62, 0x64, 0x3a, 0x31, 0x66, 0x3a, 0x63, 0x32, 0x3a, 0x64, 0x39, + 0x3a, 0x64, 0x32, 0x3a, 0x30, 0x35, 0x3a, 0x37, 0x33, 0x3a, 0x30, 0x37, + 0x3a, 0x30, 0x39, 0x3a, 0x63, 0x35, 0x3a, 0x64, 0x38, 0x3a, 0x62, 0x38, + 0x3a, 0x36, 0x39, 0x3a, 0x30, 0x66, 0x3a, 0x34, 0x36, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x59, 0x44, 0x43, 0x43, 0x41, 0x30, + 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x55, 0x4c, 0x76, + 0x57, 0x62, 0x41, 0x69, 0x69, 0x6e, 0x32, 0x33, 0x72, 0x2f, 0x31, 0x61, + 0x4f, 0x70, 0x37, 0x72, 0x30, 0x44, 0x6f, 0x4d, 0x38, 0x53, 0x61, 0x68, + 0x30, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x77, 0x53, + 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x51, 0x6b, 0x30, 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x45, 0x46, 0x46, 0x31, 0x62, + 0x31, 0x5a, 0x68, 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x45, 0x78, 0x70, 0x62, + 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, 0x78, 0x48, 0x6a, 0x41, 0x63, 0x0a, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x56, 0x46, 0x31, + 0x62, 0x31, 0x5a, 0x68, 0x5a, 0x47, 0x6c, 0x7a, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x79, 0x42, 0x48, + 0x4d, 0x7a, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x6a, 0x41, 0x78, + 0x4d, 0x54, 0x49, 0x79, 0x4d, 0x44, 0x49, 0x32, 0x4d, 0x7a, 0x4a, 0x61, + 0x46, 0x77, 0x30, 0x30, 0x0a, 0x4d, 0x6a, 0x41, 0x78, 0x4d, 0x54, 0x49, + 0x79, 0x4d, 0x44, 0x49, 0x32, 0x4d, 0x7a, 0x4a, 0x61, 0x4d, 0x45, 0x67, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6b, 0x4a, 0x4e, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x42, 0x52, 0x64, 0x57, 0x39, + 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x4d, 0x0a, 0x61, 0x57, + 0x31, 0x70, 0x64, 0x47, 0x56, 0x6b, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x56, 0x52, 0x64, 0x57, + 0x39, 0x57, 0x59, 0x57, 0x52, 0x70, 0x63, 0x79, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x4d, 0x67, 0x52, 0x7a, + 0x4d, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, + 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, + 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x7a, 0x79, + 0x77, 0x34, 0x51, 0x5a, 0x34, 0x37, 0x71, 0x46, 0x4a, 0x65, 0x6e, 0x4d, + 0x69, 0x6f, 0x4b, 0x56, 0x6a, 0x5a, 0x2f, 0x61, 0x45, 0x7a, 0x48, 0x73, + 0x32, 0x38, 0x36, 0x49, 0x78, 0x53, 0x52, 0x0a, 0x2f, 0x78, 0x6c, 0x2f, + 0x70, 0x63, 0x71, 0x73, 0x37, 0x72, 0x4e, 0x32, 0x6e, 0x58, 0x72, 0x70, + 0x69, 0x78, 0x75, 0x72, 0x61, 0x7a, 0x48, 0x62, 0x2b, 0x67, 0x74, 0x54, + 0x54, 0x4b, 0x2f, 0x46, 0x70, 0x52, 0x70, 0x35, 0x50, 0x49, 0x70, 0x4d, + 0x2f, 0x36, 0x7a, 0x66, 0x4a, 0x64, 0x35, 0x4f, 0x32, 0x59, 0x49, 0x79, + 0x43, 0x30, 0x54, 0x65, 0x79, 0x74, 0x75, 0x4d, 0x72, 0x4b, 0x4e, 0x75, + 0x0a, 0x46, 0x6f, 0x4d, 0x37, 0x70, 0x6d, 0x52, 0x4c, 0x4d, 0x6f, 0x6e, + 0x37, 0x46, 0x68, 0x59, 0x34, 0x66, 0x75, 0x74, 0x44, 0x34, 0x74, 0x4e, + 0x30, 0x53, 0x73, 0x4a, 0x69, 0x43, 0x6e, 0x4d, 0x4b, 0x33, 0x55, 0x6d, + 0x7a, 0x56, 0x39, 0x4b, 0x77, 0x43, 0x6f, 0x57, 0x64, 0x63, 0x54, 0x7a, + 0x65, 0x6f, 0x38, 0x76, 0x41, 0x4d, 0x76, 0x4d, 0x42, 0x4f, 0x53, 0x42, + 0x44, 0x47, 0x7a, 0x58, 0x52, 0x0a, 0x55, 0x37, 0x4f, 0x78, 0x37, 0x73, + 0x57, 0x54, 0x61, 0x59, 0x49, 0x2b, 0x46, 0x72, 0x55, 0x6f, 0x52, 0x71, + 0x48, 0x65, 0x36, 0x6f, 0x6b, 0x4a, 0x37, 0x55, 0x4f, 0x34, 0x42, 0x55, + 0x61, 0x4b, 0x68, 0x76, 0x56, 0x5a, 0x52, 0x37, 0x34, 0x62, 0x62, 0x77, + 0x45, 0x68, 0x45, 0x4c, 0x6e, 0x39, 0x71, 0x64, 0x49, 0x6f, 0x79, 0x68, + 0x41, 0x35, 0x43, 0x63, 0x6f, 0x54, 0x4e, 0x73, 0x2b, 0x63, 0x0a, 0x72, + 0x61, 0x31, 0x41, 0x64, 0x48, 0x6b, 0x72, 0x41, 0x6a, 0x38, 0x30, 0x2f, + 0x2f, 0x6f, 0x67, 0x61, 0x58, 0x33, 0x54, 0x37, 0x6d, 0x48, 0x31, 0x75, + 0x72, 0x50, 0x6e, 0x4d, 0x4e, 0x41, 0x33, 0x49, 0x34, 0x5a, 0x79, 0x59, + 0x55, 0x55, 0x70, 0x53, 0x46, 0x6c, 0x6f, 0x62, 0x33, 0x65, 0x6d, 0x4c, + 0x6f, 0x47, 0x2b, 0x42, 0x30, 0x31, 0x76, 0x72, 0x38, 0x37, 0x45, 0x52, + 0x52, 0x4f, 0x52, 0x0a, 0x46, 0x48, 0x41, 0x47, 0x6a, 0x78, 0x2b, 0x66, + 0x2b, 0x49, 0x64, 0x70, 0x73, 0x51, 0x37, 0x76, 0x77, 0x34, 0x6b, 0x5a, + 0x36, 0x2b, 0x6f, 0x63, 0x59, 0x66, 0x78, 0x36, 0x62, 0x49, 0x72, 0x63, + 0x31, 0x67, 0x4d, 0x4c, 0x6e, 0x69, 0x61, 0x36, 0x45, 0x74, 0x33, 0x55, + 0x56, 0x44, 0x6d, 0x72, 0x4a, 0x71, 0x4d, 0x7a, 0x36, 0x6e, 0x57, 0x42, + 0x32, 0x69, 0x33, 0x4e, 0x44, 0x30, 0x2f, 0x6b, 0x0a, 0x41, 0x39, 0x48, + 0x76, 0x46, 0x5a, 0x63, 0x62, 0x61, 0x35, 0x44, 0x46, 0x41, 0x70, 0x43, + 0x54, 0x5a, 0x67, 0x49, 0x68, 0x73, 0x55, 0x66, 0x65, 0x69, 0x35, 0x70, + 0x4b, 0x67, 0x4c, 0x6c, 0x56, 0x6a, 0x37, 0x57, 0x69, 0x4c, 0x38, 0x44, + 0x57, 0x4d, 0x32, 0x66, 0x61, 0x66, 0x73, 0x53, 0x6e, 0x74, 0x41, 0x52, + 0x45, 0x36, 0x30, 0x66, 0x37, 0x35, 0x6c, 0x69, 0x35, 0x39, 0x77, 0x7a, + 0x77, 0x0a, 0x65, 0x79, 0x75, 0x78, 0x77, 0x48, 0x41, 0x70, 0x77, 0x30, + 0x42, 0x69, 0x4c, 0x54, 0x74, 0x49, 0x61, 0x64, 0x77, 0x6a, 0x50, 0x45, + 0x6a, 0x72, 0x65, 0x77, 0x6c, 0x35, 0x71, 0x57, 0x33, 0x61, 0x71, 0x44, + 0x43, 0x59, 0x7a, 0x34, 0x42, 0x79, 0x41, 0x34, 0x69, 0x6d, 0x57, 0x30, + 0x61, 0x75, 0x63, 0x6e, 0x6c, 0x38, 0x43, 0x41, 0x4d, 0x68, 0x5a, 0x61, + 0x36, 0x33, 0x34, 0x52, 0x79, 0x6c, 0x0a, 0x73, 0x53, 0x71, 0x69, 0x4d, + 0x64, 0x35, 0x6d, 0x42, 0x50, 0x66, 0x41, 0x64, 0x4f, 0x68, 0x78, 0x33, + 0x76, 0x38, 0x39, 0x57, 0x63, 0x79, 0x57, 0x4a, 0x68, 0x4b, 0x4c, 0x68, + 0x5a, 0x56, 0x58, 0x47, 0x71, 0x74, 0x72, 0x64, 0x51, 0x74, 0x45, 0x50, + 0x52, 0x45, 0x6f, 0x50, 0x48, 0x74, 0x68, 0x74, 0x2b, 0x4b, 0x50, 0x5a, + 0x30, 0x2f, 0x6c, 0x37, 0x44, 0x78, 0x4d, 0x59, 0x49, 0x42, 0x70, 0x0a, + 0x56, 0x7a, 0x67, 0x65, 0x41, 0x56, 0x75, 0x4e, 0x56, 0x65, 0x6a, 0x48, + 0x33, 0x38, 0x44, 0x4d, 0x64, 0x79, 0x4d, 0x30, 0x53, 0x58, 0x56, 0x38, + 0x39, 0x70, 0x67, 0x52, 0x36, 0x79, 0x33, 0x65, 0x37, 0x55, 0x45, 0x75, + 0x46, 0x41, 0x55, 0x43, 0x66, 0x2b, 0x44, 0x2b, 0x49, 0x4f, 0x73, 0x31, + 0x35, 0x78, 0x47, 0x73, 0x49, 0x73, 0x35, 0x58, 0x50, 0x64, 0x37, 0x4a, + 0x4d, 0x47, 0x30, 0x51, 0x0a, 0x41, 0x34, 0x58, 0x4e, 0x38, 0x66, 0x2b, + 0x4d, 0x46, 0x72, 0x58, 0x42, 0x73, 0x6a, 0x36, 0x49, 0x62, 0x47, 0x42, + 0x2f, 0x6b, 0x45, 0x2b, 0x56, 0x39, 0x2f, 0x59, 0x74, 0x72, 0x51, 0x45, + 0x35, 0x42, 0x77, 0x54, 0x36, 0x64, 0x59, 0x42, 0x39, 0x76, 0x30, 0x6c, + 0x51, 0x37, 0x65, 0x2f, 0x4a, 0x78, 0x48, 0x77, 0x63, 0x36, 0x34, 0x42, + 0x2b, 0x32, 0x37, 0x62, 0x51, 0x33, 0x52, 0x50, 0x2b, 0x0a, 0x79, 0x64, + 0x4f, 0x63, 0x31, 0x37, 0x4b, 0x58, 0x71, 0x51, 0x49, 0x44, 0x41, 0x51, + 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, + 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, + 0x49, 0x42, 0x0a, 0x42, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x78, 0x68, 0x66, 0x51, 0x76, + 0x4b, 0x6a, 0x71, 0x41, 0x6b, 0x50, 0x79, 0x47, 0x77, 0x61, 0x5a, 0x58, + 0x53, 0x75, 0x51, 0x49, 0x4c, 0x6e, 0x58, 0x6e, 0x4f, 0x51, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x0a, 0x67, 0x67, 0x49, 0x42, + 0x41, 0x44, 0x52, 0x68, 0x32, 0x56, 0x61, 0x31, 0x45, 0x6f, 0x64, 0x56, + 0x54, 0x64, 0x32, 0x6a, 0x4e, 0x54, 0x46, 0x47, 0x75, 0x36, 0x51, 0x48, + 0x63, 0x72, 0x78, 0x66, 0x59, 0x57, 0x4c, 0x6f, 0x70, 0x66, 0x73, 0x4c, + 0x4e, 0x37, 0x45, 0x38, 0x74, 0x72, 0x50, 0x36, 0x4b, 0x5a, 0x31, 0x2f, + 0x41, 0x76, 0x57, 0x6b, 0x79, 0x61, 0x69, 0x54, 0x74, 0x33, 0x70, 0x78, + 0x0a, 0x4b, 0x47, 0x6d, 0x50, 0x63, 0x2b, 0x46, 0x53, 0x6b, 0x4e, 0x72, + 0x56, 0x76, 0x6a, 0x72, 0x6c, 0x74, 0x33, 0x5a, 0x71, 0x56, 0x6f, 0x41, + 0x68, 0x33, 0x31, 0x33, 0x6d, 0x36, 0x54, 0x71, 0x65, 0x35, 0x54, 0x37, + 0x32, 0x6f, 0x6d, 0x6e, 0x48, 0x4b, 0x67, 0x71, 0x77, 0x47, 0x45, 0x66, + 0x63, 0x49, 0x48, 0x42, 0x39, 0x55, 0x71, 0x4d, 0x2b, 0x57, 0x58, 0x7a, + 0x42, 0x75, 0x73, 0x6e, 0x49, 0x0a, 0x46, 0x55, 0x42, 0x68, 0x79, 0x6e, + 0x4c, 0x57, 0x63, 0x4b, 0x7a, 0x53, 0x74, 0x2f, 0x41, 0x63, 0x35, 0x49, + 0x59, 0x70, 0x38, 0x4d, 0x37, 0x76, 0x61, 0x47, 0x50, 0x51, 0x74, 0x53, + 0x43, 0x4b, 0x46, 0x57, 0x47, 0x61, 0x66, 0x6f, 0x61, 0x59, 0x74, 0x4d, + 0x6e, 0x43, 0x64, 0x76, 0x76, 0x4d, 0x75, 0x6a, 0x41, 0x57, 0x7a, 0x4b, + 0x4e, 0x68, 0x78, 0x6e, 0x51, 0x54, 0x35, 0x57, 0x76, 0x76, 0x0a, 0x6f, + 0x78, 0x58, 0x71, 0x41, 0x2f, 0x34, 0x54, 0x69, 0x32, 0x54, 0x6b, 0x30, + 0x38, 0x48, 0x53, 0x36, 0x49, 0x54, 0x37, 0x53, 0x64, 0x45, 0x51, 0x54, + 0x58, 0x6c, 0x6d, 0x36, 0x36, 0x72, 0x39, 0x39, 0x49, 0x30, 0x78, 0x48, + 0x6e, 0x41, 0x55, 0x72, 0x64, 0x7a, 0x65, 0x5a, 0x78, 0x4e, 0x4d, 0x67, + 0x52, 0x56, 0x68, 0x76, 0x4c, 0x66, 0x5a, 0x6b, 0x58, 0x64, 0x78, 0x47, + 0x59, 0x46, 0x67, 0x0a, 0x75, 0x2f, 0x42, 0x59, 0x70, 0x62, 0x57, 0x63, + 0x43, 0x2f, 0x65, 0x50, 0x49, 0x6c, 0x55, 0x6e, 0x77, 0x45, 0x73, 0x42, + 0x62, 0x54, 0x75, 0x5a, 0x44, 0x64, 0x51, 0x64, 0x6d, 0x32, 0x4e, 0x6e, + 0x4c, 0x39, 0x44, 0x75, 0x44, 0x63, 0x70, 0x6d, 0x76, 0x4a, 0x52, 0x50, + 0x70, 0x71, 0x33, 0x74, 0x2f, 0x4f, 0x35, 0x6a, 0x72, 0x46, 0x63, 0x2f, + 0x5a, 0x53, 0x58, 0x50, 0x73, 0x6f, 0x61, 0x50, 0x0a, 0x30, 0x41, 0x6a, + 0x2f, 0x75, 0x48, 0x59, 0x55, 0x62, 0x74, 0x37, 0x6c, 0x4a, 0x2b, 0x79, + 0x72, 0x65, 0x4c, 0x56, 0x54, 0x75, 0x62, 0x59, 0x2f, 0x36, 0x43, 0x44, + 0x35, 0x30, 0x71, 0x69, 0x2b, 0x59, 0x55, 0x62, 0x4b, 0x68, 0x34, 0x79, + 0x45, 0x38, 0x2f, 0x6e, 0x78, 0x6f, 0x47, 0x69, 0x62, 0x49, 0x68, 0x36, + 0x42, 0x4a, 0x70, 0x73, 0x51, 0x42, 0x4a, 0x46, 0x78, 0x77, 0x41, 0x59, + 0x66, 0x0a, 0x33, 0x4b, 0x44, 0x54, 0x75, 0x56, 0x61, 0x6e, 0x34, 0x35, + 0x67, 0x74, 0x66, 0x34, 0x4f, 0x64, 0x33, 0x34, 0x77, 0x72, 0x6e, 0x44, + 0x4b, 0x4f, 0x4d, 0x70, 0x54, 0x77, 0x41, 0x54, 0x77, 0x69, 0x4b, 0x70, + 0x39, 0x44, 0x77, 0x69, 0x37, 0x44, 0x6d, 0x44, 0x6b, 0x48, 0x4f, 0x48, + 0x76, 0x38, 0x58, 0x67, 0x42, 0x43, 0x48, 0x2f, 0x4d, 0x79, 0x4a, 0x6e, + 0x6d, 0x44, 0x68, 0x50, 0x62, 0x6c, 0x0a, 0x38, 0x4d, 0x46, 0x52, 0x45, + 0x73, 0x41, 0x4c, 0x48, 0x67, 0x51, 0x6a, 0x44, 0x46, 0x53, 0x6c, 0x54, + 0x43, 0x39, 0x4a, 0x78, 0x55, 0x72, 0x52, 0x74, 0x6d, 0x35, 0x67, 0x44, + 0x57, 0x76, 0x38, 0x61, 0x34, 0x75, 0x46, 0x4a, 0x47, 0x53, 0x33, 0x69, + 0x51, 0x36, 0x72, 0x4a, 0x55, 0x64, 0x62, 0x50, 0x4d, 0x39, 0x2b, 0x53, + 0x62, 0x33, 0x48, 0x36, 0x51, 0x72, 0x47, 0x32, 0x76, 0x64, 0x2b, 0x0a, + 0x44, 0x68, 0x63, 0x49, 0x30, 0x30, 0x69, 0x58, 0x30, 0x48, 0x47, 0x53, + 0x38, 0x41, 0x38, 0x35, 0x50, 0x6a, 0x52, 0x71, 0x48, 0x48, 0x33, 0x59, + 0x38, 0x69, 0x4b, 0x75, 0x75, 0x32, 0x6e, 0x30, 0x4d, 0x37, 0x53, 0x6d, + 0x53, 0x46, 0x58, 0x52, 0x44, 0x77, 0x34, 0x6d, 0x36, 0x4f, 0x79, 0x32, + 0x43, 0x79, 0x32, 0x6e, 0x68, 0x54, 0x58, 0x4e, 0x2f, 0x56, 0x6e, 0x49, + 0x6e, 0x39, 0x48, 0x4e, 0x0a, 0x50, 0x6c, 0x6f, 0x70, 0x4e, 0x4c, 0x6b, + 0x39, 0x68, 0x4d, 0x36, 0x78, 0x5a, 0x64, 0x52, 0x5a, 0x6b, 0x5a, 0x46, + 0x57, 0x64, 0x53, 0x48, 0x42, 0x64, 0x35, 0x37, 0x35, 0x65, 0x75, 0x46, + 0x67, 0x6e, 0x64, 0x4f, 0x74, 0x42, 0x42, 0x6a, 0x30, 0x66, 0x4f, 0x74, + 0x65, 0x6b, 0x34, 0x39, 0x54, 0x53, 0x69, 0x49, 0x70, 0x2b, 0x45, 0x67, + 0x72, 0x50, 0x6b, 0x32, 0x47, 0x72, 0x46, 0x74, 0x2f, 0x0a, 0x79, 0x77, + 0x61, 0x5a, 0x57, 0x57, 0x44, 0x59, 0x57, 0x47, 0x57, 0x56, 0x6a, 0x55, + 0x54, 0x52, 0x39, 0x33, 0x39, 0x2b, 0x4a, 0x33, 0x39, 0x39, 0x72, 0x6f, + 0x44, 0x31, 0x42, 0x30, 0x79, 0x32, 0x50, 0x70, 0x78, 0x78, 0x56, 0x4a, + 0x6b, 0x45, 0x53, 0x2f, 0x31, 0x59, 0x2b, 0x5a, 0x6a, 0x30, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, + 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, 0x64, 0x20, 0x49, 0x44, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, + 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, + 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, + 0x43, 0x65, 0x72, 0x74, 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, 0x64, + 0x20, 0x49, 0x44, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x32, 0x20, + 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, + 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, + 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, + 0x64, 0x20, 0x49, 0x44, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x32, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x35, 0x33, 0x38, 0x35, 0x33, 0x34, 0x38, 0x31, 0x36, 0x30, 0x38, + 0x34, 0x30, 0x32, 0x31, 0x33, 0x39, 0x33, 0x38, 0x36, 0x34, 0x33, 0x30, + 0x33, 0x33, 0x36, 0x32, 0x30, 0x38, 0x39, 0x34, 0x39, 0x30, 0x35, 0x34, + 0x31, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x32, + 0x3a, 0x33, 0x38, 0x3a, 0x62, 0x39, 0x3a, 0x66, 0x38, 0x3a, 0x36, 0x33, + 0x3a, 0x32, 0x34, 0x3a, 0x38, 0x32, 0x3a, 0x36, 0x35, 0x3a, 0x32, 0x63, + 0x3a, 0x35, 0x37, 0x3a, 0x33, 0x33, 0x3a, 0x65, 0x36, 0x3a, 0x66, 0x65, + 0x3a, 0x38, 0x31, 0x3a, 0x38, 0x66, 0x3a, 0x39, 0x64, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x31, 0x3a, 0x34, 0x62, 0x3a, + 0x34, 0x38, 0x3a, 0x64, 0x39, 0x3a, 0x34, 0x33, 0x3a, 0x65, 0x65, 0x3a, + 0x30, 0x61, 0x3a, 0x30, 0x65, 0x3a, 0x34, 0x30, 0x3a, 0x39, 0x30, 0x3a, + 0x34, 0x66, 0x3a, 0x33, 0x63, 0x3a, 0x65, 0x30, 0x3a, 0x61, 0x34, 0x3a, + 0x63, 0x30, 0x3a, 0x39, 0x31, 0x3a, 0x39, 0x33, 0x3a, 0x35, 0x31, 0x3a, + 0x35, 0x64, 0x3a, 0x33, 0x66, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x64, 0x3a, 0x30, 0x35, 0x3a, 0x65, 0x62, + 0x3a, 0x62, 0x36, 0x3a, 0x38, 0x32, 0x3a, 0x33, 0x33, 0x3a, 0x39, 0x66, + 0x3a, 0x38, 0x63, 0x3a, 0x39, 0x34, 0x3a, 0x35, 0x31, 0x3a, 0x65, 0x65, + 0x3a, 0x30, 0x39, 0x3a, 0x34, 0x65, 0x3a, 0x65, 0x62, 0x3a, 0x66, 0x65, + 0x3a, 0x66, 0x61, 0x3a, 0x37, 0x39, 0x3a, 0x35, 0x33, 0x3a, 0x61, 0x31, + 0x3a, 0x31, 0x34, 0x3a, 0x65, 0x64, 0x3a, 0x62, 0x32, 0x3a, 0x66, 0x34, + 0x3a, 0x34, 0x39, 0x3a, 0x34, 0x39, 0x3a, 0x34, 0x35, 0x3a, 0x32, 0x66, + 0x3a, 0x61, 0x62, 0x3a, 0x37, 0x64, 0x3a, 0x32, 0x66, 0x3a, 0x63, 0x31, + 0x3a, 0x38, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, + 0x6c, 0x6a, 0x43, 0x43, 0x41, 0x6e, 0x36, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x51, 0x43, 0x35, 0x4d, 0x63, 0x4f, 0x74, 0x59, 0x35, + 0x5a, 0x2b, 0x70, 0x6e, 0x49, 0x37, 0x2f, 0x44, 0x72, 0x35, 0x72, 0x30, + 0x53, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x6c, + 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, 0x47, 0x6c, + 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x57, 0x35, + 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x78, 0x42, 0x33, 0x0a, 0x64, 0x33, 0x63, 0x75, 0x5a, 0x47, + 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x59, 0x32, + 0x39, 0x74, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x74, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, + 0x56, 0x79, 0x64, 0x43, 0x42, 0x42, 0x63, 0x33, 0x4e, 0x31, 0x63, 0x6d, + 0x56, 0x6b, 0x49, 0x45, 0x6c, 0x45, 0x49, 0x46, 0x4a, 0x76, 0x0a, 0x62, + 0x33, 0x51, 0x67, 0x52, 0x7a, 0x49, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, + 0x54, 0x4d, 0x77, 0x4f, 0x44, 0x41, 0x78, 0x4d, 0x54, 0x49, 0x77, 0x4d, + 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x67, 0x77, 0x4d, + 0x54, 0x45, 0x31, 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, + 0x6a, 0x42, 0x6c, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, + 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, + 0x52, 0x47, 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, + 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x64, 0x33, 0x63, 0x75, + 0x5a, 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x0a, 0x63, 0x6e, 0x51, + 0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x74, 0x45, 0x61, 0x57, 0x64, + 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x42, 0x63, 0x33, 0x4e, + 0x31, 0x63, 0x6d, 0x56, 0x6b, 0x49, 0x45, 0x6c, 0x45, 0x49, 0x46, 0x4a, + 0x76, 0x62, 0x33, 0x51, 0x67, 0x52, 0x7a, 0x49, 0x77, 0x67, 0x67, 0x45, + 0x69, 0x0a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x41, 0x6f, + 0x49, 0x42, 0x41, 0x51, 0x44, 0x5a, 0x35, 0x79, 0x67, 0x76, 0x55, 0x6a, + 0x38, 0x32, 0x63, 0x6b, 0x6d, 0x49, 0x6b, 0x7a, 0x54, 0x7a, 0x2b, 0x47, + 0x6f, 0x65, 0x4d, 0x56, 0x53, 0x41, 0x0a, 0x6e, 0x36, 0x31, 0x55, 0x51, + 0x62, 0x56, 0x48, 0x33, 0x35, 0x61, 0x6f, 0x31, 0x4b, 0x2b, 0x41, 0x4c, + 0x62, 0x6b, 0x4b, 0x7a, 0x33, 0x58, 0x39, 0x69, 0x61, 0x56, 0x39, 0x4a, + 0x50, 0x72, 0x6a, 0x49, 0x67, 0x77, 0x72, 0x76, 0x4a, 0x55, 0x58, 0x43, + 0x7a, 0x4f, 0x2f, 0x47, 0x55, 0x31, 0x42, 0x42, 0x70, 0x41, 0x41, 0x76, + 0x51, 0x78, 0x4e, 0x45, 0x50, 0x34, 0x48, 0x74, 0x65, 0x63, 0x63, 0x0a, + 0x62, 0x69, 0x4a, 0x56, 0x4d, 0x57, 0x57, 0x58, 0x76, 0x64, 0x4d, 0x58, + 0x30, 0x68, 0x35, 0x69, 0x38, 0x39, 0x76, 0x71, 0x62, 0x46, 0x43, 0x4d, + 0x50, 0x34, 0x51, 0x4d, 0x6c, 0x73, 0x2b, 0x33, 0x79, 0x77, 0x50, 0x67, + 0x79, 0x6d, 0x32, 0x68, 0x46, 0x45, 0x77, 0x62, 0x69, 0x64, 0x33, 0x74, + 0x41, 0x4c, 0x42, 0x53, 0x66, 0x4b, 0x2b, 0x52, 0x62, 0x4c, 0x45, 0x34, + 0x45, 0x39, 0x48, 0x70, 0x0a, 0x45, 0x67, 0x6a, 0x41, 0x41, 0x4c, 0x41, + 0x63, 0x4b, 0x78, 0x48, 0x61, 0x64, 0x33, 0x41, 0x32, 0x6d, 0x36, 0x37, + 0x4f, 0x65, 0x59, 0x66, 0x63, 0x67, 0x6e, 0x44, 0x6d, 0x43, 0x58, 0x52, + 0x77, 0x56, 0x57, 0x6d, 0x76, 0x6f, 0x32, 0x69, 0x66, 0x76, 0x39, 0x32, + 0x32, 0x65, 0x62, 0x50, 0x79, 0x6e, 0x58, 0x41, 0x70, 0x56, 0x66, 0x53, + 0x72, 0x2f, 0x35, 0x56, 0x68, 0x38, 0x38, 0x6c, 0x41, 0x0a, 0x62, 0x78, + 0x33, 0x52, 0x76, 0x70, 0x4f, 0x37, 0x30, 0x34, 0x67, 0x71, 0x75, 0x35, + 0x32, 0x2f, 0x63, 0x6c, 0x70, 0x57, 0x63, 0x54, 0x73, 0x2f, 0x31, 0x50, + 0x50, 0x52, 0x43, 0x76, 0x34, 0x6f, 0x37, 0x36, 0x50, 0x75, 0x32, 0x5a, + 0x6d, 0x76, 0x41, 0x39, 0x4f, 0x50, 0x59, 0x4c, 0x66, 0x79, 0x6b, 0x71, + 0x47, 0x78, 0x76, 0x59, 0x6d, 0x4a, 0x48, 0x7a, 0x44, 0x4e, 0x77, 0x36, + 0x59, 0x75, 0x0a, 0x59, 0x6a, 0x4f, 0x75, 0x46, 0x67, 0x4a, 0x33, 0x52, + 0x46, 0x72, 0x6e, 0x67, 0x51, 0x6f, 0x38, 0x70, 0x30, 0x51, 0x75, 0x65, + 0x62, 0x67, 0x2f, 0x42, 0x4c, 0x78, 0x63, 0x6f, 0x49, 0x66, 0x68, 0x47, + 0x36, 0x39, 0x52, 0x6a, 0x73, 0x33, 0x73, 0x4c, 0x50, 0x72, 0x34, 0x2f, + 0x6d, 0x33, 0x77, 0x4f, 0x6e, 0x79, 0x71, 0x69, 0x2b, 0x52, 0x6e, 0x6c, + 0x54, 0x47, 0x4e, 0x41, 0x67, 0x4d, 0x42, 0x0a, 0x41, 0x41, 0x47, 0x6a, + 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, + 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, + 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, + 0x0a, 0x42, 0x42, 0x54, 0x4f, 0x77, 0x30, 0x71, 0x35, 0x6d, 0x56, 0x58, + 0x79, 0x75, 0x4e, 0x74, 0x67, 0x76, 0x36, 0x6c, 0x2b, 0x76, 0x56, 0x61, + 0x31, 0x6c, 0x7a, 0x61, 0x6e, 0x31, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, + 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x79, 0x71, 0x56, + 0x56, 0x6a, 0x4f, 0x50, 0x49, 0x0a, 0x51, 0x57, 0x35, 0x70, 0x4a, 0x36, + 0x64, 0x31, 0x45, 0x65, 0x38, 0x38, 0x68, 0x6a, 0x5a, 0x76, 0x30, 0x70, + 0x33, 0x47, 0x65, 0x44, 0x67, 0x64, 0x61, 0x5a, 0x61, 0x69, 0x6b, 0x6d, + 0x6b, 0x75, 0x4f, 0x47, 0x79, 0x62, 0x66, 0x51, 0x54, 0x55, 0x69, 0x61, + 0x57, 0x78, 0x4d, 0x54, 0x65, 0x4b, 0x79, 0x53, 0x48, 0x4d, 0x71, 0x32, + 0x7a, 0x4e, 0x69, 0x78, 0x79, 0x61, 0x31, 0x72, 0x39, 0x49, 0x0a, 0x30, + 0x6a, 0x4a, 0x6d, 0x77, 0x59, 0x72, 0x41, 0x38, 0x79, 0x38, 0x36, 0x37, + 0x38, 0x44, 0x6a, 0x31, 0x4a, 0x47, 0x47, 0x30, 0x56, 0x44, 0x6a, 0x41, + 0x39, 0x74, 0x7a, 0x64, 0x32, 0x39, 0x4b, 0x4f, 0x56, 0x50, 0x74, 0x33, + 0x69, 0x62, 0x48, 0x74, 0x58, 0x32, 0x76, 0x4b, 0x30, 0x4c, 0x52, 0x64, + 0x57, 0x4c, 0x6a, 0x53, 0x69, 0x73, 0x43, 0x78, 0x31, 0x42, 0x4c, 0x34, + 0x47, 0x6e, 0x69, 0x0a, 0x6c, 0x6d, 0x77, 0x4f, 0x52, 0x47, 0x59, 0x51, + 0x52, 0x49, 0x2b, 0x74, 0x42, 0x65, 0x76, 0x34, 0x65, 0x61, 0x79, 0x6d, + 0x47, 0x2b, 0x67, 0x33, 0x4e, 0x4a, 0x31, 0x54, 0x79, 0x57, 0x47, 0x71, + 0x6f, 0x6c, 0x4b, 0x76, 0x53, 0x6e, 0x41, 0x57, 0x68, 0x73, 0x49, 0x36, + 0x79, 0x4c, 0x45, 0x54, 0x63, 0x44, 0x62, 0x59, 0x7a, 0x2b, 0x37, 0x30, + 0x43, 0x6a, 0x54, 0x56, 0x57, 0x30, 0x7a, 0x39, 0x0a, 0x42, 0x35, 0x79, + 0x69, 0x75, 0x74, 0x6b, 0x42, 0x63, 0x6c, 0x7a, 0x7a, 0x54, 0x63, 0x48, + 0x64, 0x44, 0x72, 0x45, 0x63, 0x44, 0x63, 0x52, 0x6a, 0x76, 0x71, 0x33, + 0x30, 0x46, 0x50, 0x75, 0x4a, 0x37, 0x4b, 0x4a, 0x42, 0x44, 0x6b, 0x7a, + 0x4d, 0x79, 0x46, 0x64, 0x41, 0x30, 0x47, 0x34, 0x44, 0x71, 0x73, 0x30, + 0x4d, 0x6a, 0x6f, 0x6d, 0x5a, 0x6d, 0x57, 0x7a, 0x77, 0x50, 0x44, 0x43, + 0x76, 0x0a, 0x4f, 0x4e, 0x39, 0x76, 0x76, 0x4b, 0x4f, 0x2b, 0x4b, 0x53, + 0x41, 0x6e, 0x71, 0x33, 0x54, 0x2f, 0x45, 0x79, 0x4a, 0x34, 0x33, 0x70, + 0x64, 0x53, 0x56, 0x52, 0x36, 0x44, 0x74, 0x56, 0x51, 0x67, 0x41, 0x2b, + 0x36, 0x75, 0x77, 0x45, 0x39, 0x57, 0x33, 0x6a, 0x66, 0x4d, 0x77, 0x33, + 0x2b, 0x71, 0x42, 0x43, 0x65, 0x37, 0x30, 0x33, 0x65, 0x34, 0x59, 0x74, + 0x73, 0x58, 0x66, 0x4a, 0x77, 0x6f, 0x0a, 0x49, 0x68, 0x4e, 0x7a, 0x62, + 0x4d, 0x38, 0x6d, 0x39, 0x59, 0x6f, 0x70, 0x35, 0x77, 0x3d, 0x3d, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, + 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, 0x64, 0x20, 0x49, 0x44, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, + 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, + 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, 0x65, + 0x64, 0x20, 0x49, 0x44, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x33, + 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, + 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, + 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x41, 0x73, 0x73, 0x75, 0x72, + 0x65, 0x64, 0x20, 0x49, 0x44, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, + 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x31, 0x35, 0x34, 0x35, 0x39, 0x33, 0x31, 0x32, 0x39, 0x38, 0x31, + 0x30, 0x30, 0x38, 0x35, 0x35, 0x33, 0x37, 0x33, 0x31, 0x39, 0x32, 0x38, + 0x33, 0x38, 0x34, 0x39, 0x35, 0x33, 0x31, 0x33, 0x35, 0x34, 0x32, 0x36, + 0x37, 0x39, 0x36, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, + 0x63, 0x3a, 0x37, 0x66, 0x3a, 0x36, 0x35, 0x3a, 0x33, 0x31, 0x3a, 0x30, + 0x63, 0x3a, 0x38, 0x31, 0x3a, 0x64, 0x66, 0x3a, 0x38, 0x64, 0x3a, 0x62, + 0x61, 0x3a, 0x33, 0x65, 0x3a, 0x39, 0x39, 0x3a, 0x65, 0x32, 0x3a, 0x35, + 0x63, 0x3a, 0x61, 0x64, 0x3a, 0x36, 0x65, 0x3a, 0x66, 0x62, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x35, 0x3a, 0x31, 0x37, + 0x3a, 0x61, 0x32, 0x3a, 0x34, 0x66, 0x3a, 0x39, 0x61, 0x3a, 0x34, 0x38, + 0x3a, 0x63, 0x36, 0x3a, 0x63, 0x39, 0x3a, 0x66, 0x38, 0x3a, 0x61, 0x32, + 0x3a, 0x30, 0x30, 0x3a, 0x32, 0x36, 0x3a, 0x39, 0x66, 0x3a, 0x64, 0x63, + 0x3a, 0x30, 0x66, 0x3a, 0x34, 0x38, 0x3a, 0x32, 0x63, 0x3a, 0x61, 0x62, + 0x3a, 0x33, 0x30, 0x3a, 0x38, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x65, 0x3a, 0x33, 0x37, 0x3a, 0x63, + 0x62, 0x3a, 0x38, 0x62, 0x3a, 0x34, 0x63, 0x3a, 0x34, 0x37, 0x3a, 0x30, + 0x39, 0x3a, 0x30, 0x63, 0x3a, 0x61, 0x62, 0x3a, 0x33, 0x36, 0x3a, 0x35, + 0x35, 0x3a, 0x31, 0x62, 0x3a, 0x61, 0x36, 0x3a, 0x66, 0x34, 0x3a, 0x35, + 0x64, 0x3a, 0x62, 0x38, 0x3a, 0x34, 0x30, 0x3a, 0x36, 0x38, 0x3a, 0x30, + 0x66, 0x3a, 0x62, 0x61, 0x3a, 0x31, 0x36, 0x3a, 0x36, 0x61, 0x3a, 0x39, + 0x35, 0x3a, 0x32, 0x64, 0x3a, 0x62, 0x31, 0x3a, 0x30, 0x30, 0x3a, 0x37, + 0x31, 0x3a, 0x37, 0x66, 0x3a, 0x34, 0x33, 0x3a, 0x30, 0x35, 0x3a, 0x33, + 0x66, 0x3a, 0x63, 0x32, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x43, 0x52, 0x6a, 0x43, 0x43, 0x41, 0x63, 0x32, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x51, 0x43, 0x36, 0x46, 0x61, 0x2b, 0x68, 0x33, + 0x66, 0x6f, 0x4c, 0x56, 0x4a, 0x52, 0x4b, 0x2f, 0x4e, 0x4a, 0x4b, 0x42, + 0x73, 0x37, 0x44, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, + 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x42, 0x6c, 0x4d, 0x51, 0x73, + 0x77, 0x0a, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, 0x47, 0x6c, 0x6e, 0x61, 0x55, + 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, + 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, + 0x42, 0x33, 0x64, 0x33, 0x63, 0x75, 0x0a, 0x5a, 0x47, 0x6c, 0x6e, 0x61, + 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, + 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, + 0x78, 0x74, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, + 0x43, 0x42, 0x42, 0x63, 0x33, 0x4e, 0x31, 0x63, 0x6d, 0x56, 0x6b, 0x49, + 0x45, 0x6c, 0x45, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x0a, + 0x52, 0x7a, 0x4d, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x4d, 0x77, + 0x4f, 0x44, 0x41, 0x78, 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x41, 0x77, + 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x54, 0x45, 0x31, + 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, 0x42, 0x6c, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x56, 0x0a, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, 0x47, 0x6c, + 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x57, 0x35, + 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x78, 0x42, 0x33, 0x64, 0x33, 0x63, 0x75, 0x5a, 0x47, 0x6c, + 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x0a, 0x59, 0x32, + 0x39, 0x74, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x74, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, + 0x56, 0x79, 0x64, 0x43, 0x42, 0x42, 0x63, 0x33, 0x4e, 0x31, 0x63, 0x6d, + 0x56, 0x6b, 0x49, 0x45, 0x6c, 0x45, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, + 0x51, 0x67, 0x52, 0x7a, 0x4d, 0x77, 0x64, 0x6a, 0x41, 0x51, 0x42, 0x67, + 0x63, 0x71, 0x0a, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, + 0x67, 0x55, 0x72, 0x67, 0x51, 0x51, 0x41, 0x49, 0x67, 0x4e, 0x69, 0x41, + 0x41, 0x51, 0x5a, 0x35, 0x37, 0x79, 0x73, 0x52, 0x47, 0x58, 0x74, 0x7a, + 0x62, 0x67, 0x2f, 0x57, 0x50, 0x75, 0x4e, 0x73, 0x56, 0x65, 0x70, 0x52, + 0x43, 0x30, 0x46, 0x46, 0x66, 0x4c, 0x76, 0x43, 0x2f, 0x38, 0x51, 0x64, + 0x4a, 0x2b, 0x31, 0x59, 0x6c, 0x4a, 0x66, 0x0a, 0x5a, 0x6e, 0x34, 0x66, + 0x35, 0x64, 0x77, 0x62, 0x52, 0x58, 0x6b, 0x4c, 0x7a, 0x4d, 0x5a, 0x54, + 0x43, 0x70, 0x32, 0x4e, 0x58, 0x51, 0x4c, 0x5a, 0x71, 0x56, 0x6e, 0x65, + 0x41, 0x6c, 0x72, 0x32, 0x6c, 0x53, 0x6f, 0x4f, 0x6a, 0x54, 0x68, 0x4b, + 0x69, 0x6b, 0x6e, 0x47, 0x76, 0x4d, 0x59, 0x44, 0x4f, 0x41, 0x64, 0x66, + 0x56, 0x64, 0x70, 0x2b, 0x43, 0x57, 0x37, 0x69, 0x66, 0x31, 0x37, 0x51, + 0x0a, 0x52, 0x53, 0x41, 0x50, 0x57, 0x58, 0x59, 0x51, 0x31, 0x71, 0x41, + 0x6b, 0x38, 0x43, 0x33, 0x65, 0x4e, 0x76, 0x4a, 0x73, 0x4b, 0x54, 0x6d, + 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x50, 0x41, 0x51, 0x48, 0x2f, 0x0a, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, + 0x47, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x54, 0x4c, 0x30, 0x4c, 0x32, 0x70, 0x34, 0x5a, + 0x67, 0x46, 0x55, 0x61, 0x46, 0x4e, 0x4e, 0x36, 0x4b, 0x44, 0x65, 0x63, + 0x36, 0x4e, 0x48, 0x53, 0x72, 0x6b, 0x68, 0x44, 0x41, 0x4b, 0x42, 0x67, + 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x0a, 0x41, + 0x77, 0x4e, 0x6e, 0x41, 0x44, 0x42, 0x6b, 0x41, 0x6a, 0x41, 0x6c, 0x70, + 0x49, 0x46, 0x46, 0x41, 0x6d, 0x73, 0x53, 0x53, 0x33, 0x56, 0x30, 0x54, + 0x38, 0x67, 0x6a, 0x34, 0x33, 0x44, 0x79, 0x64, 0x58, 0x4c, 0x65, 0x66, + 0x49, 0x6e, 0x77, 0x7a, 0x35, 0x46, 0x79, 0x59, 0x5a, 0x35, 0x65, 0x45, + 0x4a, 0x4a, 0x5a, 0x56, 0x72, 0x6d, 0x44, 0x78, 0x78, 0x44, 0x6e, 0x4f, + 0x4f, 0x6c, 0x59, 0x0a, 0x4a, 0x6a, 0x5a, 0x39, 0x31, 0x65, 0x51, 0x30, + 0x68, 0x6a, 0x6b, 0x43, 0x4d, 0x48, 0x77, 0x32, 0x55, 0x2f, 0x41, 0x77, + 0x35, 0x57, 0x4a, 0x6a, 0x4f, 0x70, 0x6e, 0x69, 0x74, 0x71, 0x4d, 0x37, + 0x6d, 0x7a, 0x54, 0x36, 0x48, 0x74, 0x6f, 0x51, 0x6b, 0x6e, 0x46, 0x65, + 0x6b, 0x52, 0x4f, 0x6e, 0x33, 0x61, 0x52, 0x75, 0x6b, 0x73, 0x77, 0x79, + 0x31, 0x76, 0x55, 0x68, 0x5a, 0x73, 0x63, 0x76, 0x0a, 0x36, 0x70, 0x5a, + 0x6a, 0x61, 0x6d, 0x56, 0x46, 0x6b, 0x70, 0x55, 0x42, 0x74, 0x41, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, + 0x72, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, + 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, + 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, + 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, + 0x65, 0x72, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x32, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, + 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, + 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, + 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x34, 0x32, 0x39, 0x33, 0x37, 0x34, 0x33, 0x35, 0x34, + 0x30, 0x30, 0x34, 0x36, 0x39, 0x37, 0x35, 0x33, 0x37, 0x38, 0x35, 0x33, + 0x34, 0x38, 0x37, 0x39, 0x35, 0x30, 0x33, 0x32, 0x30, 0x32, 0x32, 0x35, + 0x33, 0x35, 0x34, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x65, 0x34, 0x3a, 0x61, 0x36, 0x3a, 0x38, 0x61, 0x3a, 0x63, 0x38, 0x3a, + 0x35, 0x34, 0x3a, 0x61, 0x63, 0x3a, 0x35, 0x32, 0x3a, 0x34, 0x32, 0x3a, + 0x34, 0x36, 0x3a, 0x30, 0x61, 0x3a, 0x66, 0x64, 0x3a, 0x37, 0x32, 0x3a, + 0x34, 0x38, 0x3a, 0x31, 0x62, 0x3a, 0x32, 0x61, 0x3a, 0x34, 0x34, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x66, 0x3a, 0x33, + 0x63, 0x3a, 0x32, 0x34, 0x3a, 0x66, 0x39, 0x3a, 0x62, 0x66, 0x3a, 0x64, + 0x36, 0x3a, 0x36, 0x36, 0x3a, 0x37, 0x36, 0x3a, 0x31, 0x62, 0x3a, 0x32, + 0x36, 0x3a, 0x38, 0x30, 0x3a, 0x37, 0x33, 0x3a, 0x66, 0x65, 0x3a, 0x30, + 0x36, 0x3a, 0x64, 0x31, 0x3a, 0x63, 0x63, 0x3a, 0x38, 0x64, 0x3a, 0x34, + 0x66, 0x3a, 0x38, 0x32, 0x3a, 0x61, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x62, 0x3a, 0x33, 0x63, 0x3a, + 0x63, 0x62, 0x3a, 0x62, 0x37, 0x3a, 0x36, 0x30, 0x3a, 0x33, 0x31, 0x3a, + 0x65, 0x35, 0x3a, 0x65, 0x30, 0x3a, 0x31, 0x33, 0x3a, 0x38, 0x66, 0x3a, + 0x38, 0x64, 0x3a, 0x64, 0x33, 0x3a, 0x39, 0x61, 0x3a, 0x32, 0x33, 0x3a, + 0x66, 0x39, 0x3a, 0x64, 0x65, 0x3a, 0x34, 0x37, 0x3a, 0x66, 0x66, 0x3a, + 0x63, 0x33, 0x3a, 0x35, 0x65, 0x3a, 0x34, 0x33, 0x3a, 0x63, 0x31, 0x3a, + 0x31, 0x34, 0x3a, 0x34, 0x63, 0x3a, 0x65, 0x61, 0x3a, 0x32, 0x37, 0x3a, + 0x64, 0x34, 0x3a, 0x36, 0x61, 0x3a, 0x35, 0x61, 0x3a, 0x62, 0x31, 0x3a, + 0x63, 0x62, 0x3a, 0x35, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x44, 0x6a, 0x6a, 0x43, 0x43, 0x41, 0x6e, 0x61, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x41, 0x7a, 0x72, 0x78, 0x35, 0x71, + 0x63, 0x52, 0x71, 0x61, 0x43, 0x37, 0x4b, 0x47, 0x53, 0x78, 0x48, 0x51, + 0x6e, 0x36, 0x35, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, + 0x42, 0x68, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, + 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, + 0x47, 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, + 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x0a, 0x64, 0x33, 0x63, 0x75, + 0x5a, 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, + 0x59, 0x32, 0x39, 0x74, 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x64, 0x45, 0x61, 0x57, 0x64, 0x70, + 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, + 0x59, 0x57, 0x77, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x48, + 0x0a, 0x4d, 0x6a, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x7a, 0x41, + 0x34, 0x4d, 0x44, 0x45, 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x42, + 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4f, 0x44, 0x41, 0x78, 0x4d, 0x54, 0x55, + 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x4d, 0x47, 0x45, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6c, 0x56, 0x54, 0x0a, 0x4d, 0x52, 0x55, 0x77, 0x45, 0x77, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x78, 0x45, 0x61, 0x57, + 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, + 0x4d, 0x78, 0x47, 0x54, 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x73, 0x54, 0x45, 0x48, 0x64, 0x33, 0x64, 0x79, 0x35, 0x6b, 0x61, 0x57, + 0x64, 0x70, 0x59, 0x32, 0x56, 0x79, 0x64, 0x43, 0x35, 0x6a, 0x0a, 0x62, + 0x32, 0x30, 0x78, 0x49, 0x44, 0x41, 0x65, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x4d, 0x54, 0x46, 0x30, 0x52, 0x70, 0x5a, 0x32, 0x6c, 0x44, 0x5a, + 0x58, 0x4a, 0x30, 0x49, 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, + 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x63, 0x79, 0x4d, + 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x0a, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, + 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, + 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x75, 0x7a, 0x66, 0x4e, + 0x4e, 0x4e, 0x78, 0x37, 0x61, 0x38, 0x6d, 0x79, 0x61, 0x4a, 0x43, 0x74, + 0x53, 0x6e, 0x58, 0x2f, 0x52, 0x72, 0x6f, 0x68, 0x43, 0x67, 0x69, 0x4e, + 0x39, 0x52, 0x6c, 0x55, 0x79, 0x66, 0x75, 0x49, 0x0a, 0x32, 0x2f, 0x4f, + 0x75, 0x38, 0x6a, 0x71, 0x4a, 0x6b, 0x54, 0x78, 0x36, 0x35, 0x71, 0x73, + 0x47, 0x47, 0x6d, 0x76, 0x50, 0x72, 0x43, 0x33, 0x6f, 0x58, 0x67, 0x6b, + 0x6b, 0x52, 0x4c, 0x70, 0x69, 0x6d, 0x6e, 0x37, 0x57, 0x6f, 0x36, 0x68, + 0x2b, 0x34, 0x46, 0x52, 0x31, 0x49, 0x41, 0x57, 0x73, 0x55, 0x4c, 0x65, + 0x63, 0x59, 0x78, 0x70, 0x73, 0x4d, 0x4e, 0x7a, 0x61, 0x48, 0x78, 0x6d, + 0x78, 0x0a, 0x31, 0x78, 0x37, 0x65, 0x2f, 0x64, 0x66, 0x67, 0x79, 0x35, + 0x53, 0x44, 0x4e, 0x36, 0x37, 0x73, 0x48, 0x30, 0x4e, 0x4f, 0x33, 0x58, + 0x73, 0x73, 0x30, 0x72, 0x30, 0x75, 0x70, 0x53, 0x2f, 0x6b, 0x71, 0x62, + 0x69, 0x74, 0x4f, 0x74, 0x53, 0x5a, 0x70, 0x4c, 0x59, 0x6c, 0x36, 0x5a, + 0x74, 0x72, 0x41, 0x47, 0x43, 0x53, 0x59, 0x50, 0x39, 0x50, 0x49, 0x55, + 0x6b, 0x59, 0x39, 0x32, 0x65, 0x51, 0x0a, 0x71, 0x32, 0x45, 0x47, 0x6e, + 0x49, 0x2f, 0x79, 0x75, 0x75, 0x6d, 0x30, 0x36, 0x5a, 0x49, 0x79, 0x61, + 0x37, 0x58, 0x7a, 0x56, 0x2b, 0x68, 0x64, 0x47, 0x38, 0x32, 0x4d, 0x48, + 0x61, 0x75, 0x56, 0x42, 0x4a, 0x56, 0x4a, 0x38, 0x7a, 0x55, 0x74, 0x6c, + 0x75, 0x4e, 0x4a, 0x62, 0x64, 0x31, 0x33, 0x34, 0x2f, 0x74, 0x4a, 0x53, + 0x37, 0x53, 0x73, 0x56, 0x51, 0x65, 0x70, 0x6a, 0x35, 0x57, 0x7a, 0x0a, + 0x74, 0x43, 0x4f, 0x37, 0x54, 0x47, 0x31, 0x46, 0x38, 0x50, 0x61, 0x70, + 0x73, 0x70, 0x55, 0x77, 0x74, 0x50, 0x31, 0x4d, 0x56, 0x59, 0x77, 0x6e, + 0x53, 0x6c, 0x63, 0x55, 0x66, 0x49, 0x4b, 0x64, 0x7a, 0x58, 0x4f, 0x53, + 0x30, 0x78, 0x5a, 0x4b, 0x42, 0x67, 0x79, 0x4d, 0x55, 0x4e, 0x47, 0x50, + 0x48, 0x67, 0x6d, 0x2b, 0x46, 0x36, 0x48, 0x6d, 0x49, 0x63, 0x72, 0x39, + 0x67, 0x2b, 0x55, 0x51, 0x0a, 0x76, 0x49, 0x4f, 0x6c, 0x43, 0x73, 0x52, + 0x6e, 0x4b, 0x50, 0x5a, 0x7a, 0x46, 0x42, 0x51, 0x39, 0x52, 0x6e, 0x62, + 0x44, 0x68, 0x78, 0x53, 0x4a, 0x49, 0x54, 0x52, 0x4e, 0x72, 0x77, 0x39, + 0x46, 0x44, 0x4b, 0x5a, 0x4a, 0x6f, 0x62, 0x71, 0x37, 0x6e, 0x4d, 0x57, + 0x78, 0x4d, 0x34, 0x4d, 0x70, 0x68, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, + 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x0a, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, + 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, + 0x49, 0x42, 0x68, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x54, 0x69, 0x4a, 0x55, 0x49, 0x42, + 0x69, 0x56, 0x0a, 0x35, 0x75, 0x4e, 0x75, 0x35, 0x67, 0x2f, 0x36, 0x2b, + 0x72, 0x6b, 0x53, 0x37, 0x51, 0x59, 0x58, 0x6a, 0x7a, 0x6b, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, + 0x47, 0x42, 0x6e, 0x4b, 0x4a, 0x52, 0x76, 0x44, 0x6b, 0x68, 0x6a, 0x36, + 0x7a, 0x48, 0x64, 0x36, 0x6d, 0x63, 0x59, 0x0a, 0x31, 0x59, 0x6c, 0x39, + 0x50, 0x4d, 0x57, 0x4c, 0x53, 0x6e, 0x2f, 0x70, 0x76, 0x74, 0x73, 0x72, + 0x46, 0x39, 0x2b, 0x77, 0x58, 0x33, 0x4e, 0x33, 0x4b, 0x6a, 0x49, 0x54, + 0x4f, 0x59, 0x46, 0x6e, 0x51, 0x6f, 0x51, 0x6a, 0x38, 0x6b, 0x56, 0x6e, + 0x4e, 0x65, 0x79, 0x49, 0x76, 0x2f, 0x69, 0x50, 0x73, 0x47, 0x45, 0x4d, + 0x4e, 0x4b, 0x53, 0x75, 0x49, 0x45, 0x79, 0x45, 0x78, 0x74, 0x76, 0x34, + 0x0a, 0x4e, 0x65, 0x46, 0x32, 0x32, 0x64, 0x2b, 0x6d, 0x51, 0x72, 0x76, + 0x48, 0x52, 0x41, 0x69, 0x47, 0x66, 0x7a, 0x5a, 0x30, 0x4a, 0x46, 0x72, + 0x61, 0x62, 0x41, 0x30, 0x55, 0x57, 0x54, 0x57, 0x39, 0x38, 0x6b, 0x6e, + 0x64, 0x74, 0x68, 0x2f, 0x4a, 0x73, 0x77, 0x31, 0x48, 0x4b, 0x6a, 0x32, + 0x5a, 0x4c, 0x37, 0x74, 0x63, 0x75, 0x37, 0x58, 0x55, 0x49, 0x4f, 0x47, + 0x5a, 0x58, 0x31, 0x4e, 0x47, 0x0a, 0x46, 0x64, 0x74, 0x6f, 0x6d, 0x2f, + 0x44, 0x7a, 0x4d, 0x4e, 0x55, 0x2b, 0x4d, 0x65, 0x4b, 0x4e, 0x68, 0x4a, + 0x37, 0x6a, 0x69, 0x74, 0x72, 0x61, 0x6c, 0x6a, 0x34, 0x31, 0x45, 0x36, + 0x56, 0x66, 0x38, 0x50, 0x6c, 0x77, 0x55, 0x48, 0x42, 0x48, 0x51, 0x52, + 0x46, 0x58, 0x47, 0x55, 0x37, 0x41, 0x6a, 0x36, 0x34, 0x47, 0x78, 0x4a, + 0x55, 0x54, 0x46, 0x79, 0x38, 0x62, 0x4a, 0x5a, 0x39, 0x31, 0x0a, 0x38, + 0x72, 0x47, 0x4f, 0x6d, 0x61, 0x46, 0x76, 0x45, 0x37, 0x46, 0x42, 0x63, + 0x66, 0x36, 0x49, 0x4b, 0x73, 0x68, 0x50, 0x45, 0x43, 0x42, 0x56, 0x31, + 0x2f, 0x4d, 0x55, 0x52, 0x65, 0x58, 0x67, 0x52, 0x50, 0x54, 0x71, 0x68, + 0x35, 0x55, 0x79, 0x6b, 0x77, 0x37, 0x2b, 0x55, 0x30, 0x62, 0x36, 0x4c, + 0x4a, 0x33, 0x2f, 0x69, 0x79, 0x4b, 0x35, 0x53, 0x39, 0x6b, 0x4a, 0x52, + 0x61, 0x54, 0x65, 0x0a, 0x70, 0x4c, 0x69, 0x61, 0x57, 0x4e, 0x30, 0x62, + 0x66, 0x56, 0x4b, 0x66, 0x6a, 0x6c, 0x6c, 0x44, 0x69, 0x49, 0x47, 0x6b, + 0x6e, 0x69, 0x62, 0x56, 0x62, 0x36, 0x33, 0x64, 0x44, 0x63, 0x59, 0x33, + 0x66, 0x65, 0x30, 0x44, 0x6b, 0x68, 0x76, 0x6c, 0x64, 0x31, 0x39, 0x32, + 0x37, 0x6a, 0x79, 0x4e, 0x78, 0x46, 0x31, 0x57, 0x57, 0x36, 0x4c, 0x5a, + 0x5a, 0x6d, 0x36, 0x7a, 0x4e, 0x54, 0x66, 0x6c, 0x0a, 0x4d, 0x72, 0x59, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, + 0x72, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, 0x69, + 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, + 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, 0x74, + 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, + 0x65, 0x72, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, + 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, 0x72, + 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, + 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x37, 0x30, 0x38, 0x39, 0x32, 0x34, 0x34, 0x34, 0x36, + 0x39, 0x30, 0x33, 0x30, 0x32, 0x39, 0x33, 0x32, 0x39, 0x31, 0x37, 0x36, + 0x30, 0x30, 0x38, 0x33, 0x33, 0x33, 0x33, 0x38, 0x38, 0x34, 0x33, 0x36, + 0x34, 0x31, 0x34, 0x36, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x66, 0x35, 0x3a, 0x35, 0x64, 0x3a, 0x61, 0x34, 0x3a, 0x35, 0x30, 0x3a, + 0x61, 0x35, 0x3a, 0x66, 0x62, 0x3a, 0x32, 0x38, 0x3a, 0x37, 0x65, 0x3a, + 0x31, 0x65, 0x3a, 0x30, 0x66, 0x3a, 0x30, 0x64, 0x3a, 0x63, 0x63, 0x3a, + 0x39, 0x36, 0x3a, 0x35, 0x37, 0x3a, 0x35, 0x36, 0x3a, 0x63, 0x61, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x65, 0x3a, 0x30, + 0x34, 0x3a, 0x64, 0x65, 0x3a, 0x38, 0x39, 0x3a, 0x36, 0x61, 0x3a, 0x33, + 0x65, 0x3a, 0x36, 0x36, 0x3a, 0x36, 0x64, 0x3a, 0x30, 0x30, 0x3a, 0x65, + 0x36, 0x3a, 0x38, 0x37, 0x3a, 0x64, 0x33, 0x3a, 0x33, 0x66, 0x3a, 0x66, + 0x61, 0x3a, 0x64, 0x39, 0x3a, 0x33, 0x62, 0x3a, 0x65, 0x38, 0x3a, 0x33, + 0x64, 0x3a, 0x33, 0x34, 0x3a, 0x39, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x31, 0x3a, 0x61, 0x64, 0x3a, + 0x36, 0x36, 0x3a, 0x34, 0x38, 0x3a, 0x66, 0x38, 0x3a, 0x31, 0x30, 0x3a, + 0x34, 0x31, 0x3a, 0x33, 0x38, 0x3a, 0x63, 0x37, 0x3a, 0x33, 0x38, 0x3a, + 0x66, 0x33, 0x3a, 0x39, 0x65, 0x3a, 0x61, 0x34, 0x3a, 0x33, 0x32, 0x3a, + 0x30, 0x31, 0x3a, 0x33, 0x33, 0x3a, 0x33, 0x39, 0x3a, 0x33, 0x65, 0x3a, + 0x33, 0x61, 0x3a, 0x31, 0x38, 0x3a, 0x63, 0x63, 0x3a, 0x30, 0x32, 0x3a, + 0x32, 0x39, 0x3a, 0x36, 0x65, 0x3a, 0x66, 0x39, 0x3a, 0x37, 0x63, 0x3a, + 0x32, 0x61, 0x3a, 0x63, 0x39, 0x3a, 0x65, 0x66, 0x3a, 0x36, 0x37, 0x3a, + 0x33, 0x31, 0x3a, 0x64, 0x30, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x43, 0x50, 0x7a, 0x43, 0x43, 0x41, 0x63, 0x57, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x42, 0x56, 0x56, 0x57, 0x76, 0x50, + 0x4a, 0x65, 0x70, 0x44, 0x55, 0x31, 0x77, 0x36, 0x51, 0x50, 0x31, 0x61, + 0x74, 0x46, 0x63, 0x6a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, + 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x42, 0x68, 0x4d, 0x51, + 0x73, 0x77, 0x0a, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4d, 0x52, 0x47, 0x6c, 0x6e, 0x61, + 0x55, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, + 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, + 0x78, 0x42, 0x33, 0x64, 0x33, 0x63, 0x75, 0x0a, 0x5a, 0x47, 0x6c, 0x6e, + 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x75, 0x59, 0x32, 0x39, 0x74, + 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x45, 0x78, 0x64, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, + 0x64, 0x43, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x77, 0x67, + 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x48, 0x4d, 0x7a, 0x41, 0x65, + 0x0a, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x7a, 0x41, 0x34, 0x4d, 0x44, 0x45, + 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, + 0x7a, 0x4f, 0x44, 0x41, 0x78, 0x4d, 0x54, 0x55, 0x78, 0x4d, 0x6a, 0x41, + 0x77, 0x4d, 0x44, 0x42, 0x61, 0x4d, 0x47, 0x45, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, + 0x54, 0x4d, 0x52, 0x55, 0x77, 0x0a, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x45, 0x77, 0x78, 0x45, 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, + 0x56, 0x79, 0x64, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x78, 0x47, 0x54, + 0x41, 0x58, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x45, 0x48, + 0x64, 0x33, 0x64, 0x79, 0x35, 0x6b, 0x61, 0x57, 0x64, 0x70, 0x59, 0x32, + 0x56, 0x79, 0x64, 0x43, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x78, 0x0a, 0x49, + 0x44, 0x41, 0x65, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, + 0x30, 0x52, 0x70, 0x5a, 0x32, 0x6c, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x49, + 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, 0x53, 0x62, + 0x32, 0x39, 0x30, 0x49, 0x45, 0x63, 0x7a, 0x4d, 0x48, 0x59, 0x77, 0x45, + 0x41, 0x59, 0x48, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x43, 0x41, + 0x51, 0x59, 0x46, 0x0a, 0x4b, 0x34, 0x45, 0x45, 0x41, 0x43, 0x49, 0x44, + 0x59, 0x67, 0x41, 0x45, 0x33, 0x61, 0x66, 0x5a, 0x75, 0x34, 0x71, 0x34, + 0x43, 0x2f, 0x73, 0x4c, 0x66, 0x79, 0x48, 0x53, 0x38, 0x4c, 0x36, 0x2b, + 0x63, 0x2f, 0x4d, 0x7a, 0x58, 0x52, 0x71, 0x38, 0x4e, 0x4f, 0x72, 0x65, + 0x78, 0x70, 0x75, 0x38, 0x30, 0x4a, 0x58, 0x32, 0x38, 0x4d, 0x7a, 0x51, + 0x43, 0x37, 0x70, 0x68, 0x57, 0x31, 0x46, 0x47, 0x0a, 0x66, 0x70, 0x34, + 0x74, 0x6e, 0x2b, 0x36, 0x4f, 0x59, 0x77, 0x77, 0x58, 0x37, 0x41, 0x64, + 0x77, 0x39, 0x63, 0x2b, 0x45, 0x4c, 0x6b, 0x43, 0x44, 0x6e, 0x4f, 0x67, + 0x2f, 0x51, 0x57, 0x30, 0x37, 0x72, 0x64, 0x4f, 0x6b, 0x46, 0x46, 0x6b, + 0x32, 0x65, 0x4a, 0x30, 0x44, 0x51, 0x2b, 0x34, 0x51, 0x45, 0x32, 0x78, + 0x79, 0x33, 0x71, 0x36, 0x49, 0x70, 0x36, 0x46, 0x72, 0x74, 0x55, 0x50, + 0x4f, 0x0a, 0x5a, 0x39, 0x77, 0x6a, 0x2f, 0x77, 0x4d, 0x63, 0x6f, 0x2b, + 0x49, 0x2b, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, + 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, + 0x49, 0x42, 0x68, 0x6a, 0x41, 0x64, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x73, 0x39, 0x74, 0x49, 0x70, + 0x50, 0x6d, 0x68, 0x78, 0x64, 0x69, 0x75, 0x4e, 0x6b, 0x48, 0x4d, 0x45, + 0x57, 0x4e, 0x70, 0x59, 0x69, 0x6d, 0x38, 0x53, 0x38, 0x59, 0x77, 0x43, + 0x67, 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x45, 0x41, + 0x77, 0x4d, 0x44, 0x61, 0x41, 0x41, 0x77, 0x5a, 0x51, 0x49, 0x78, 0x0a, + 0x41, 0x4b, 0x32, 0x38, 0x38, 0x6d, 0x77, 0x2f, 0x45, 0x6b, 0x72, 0x52, + 0x4c, 0x54, 0x6e, 0x44, 0x43, 0x67, 0x6d, 0x58, 0x63, 0x2f, 0x53, 0x49, + 0x4e, 0x6f, 0x79, 0x49, 0x4a, 0x37, 0x76, 0x6d, 0x69, 0x49, 0x31, 0x51, + 0x68, 0x61, 0x64, 0x6a, 0x2b, 0x5a, 0x34, 0x79, 0x33, 0x6d, 0x61, 0x54, + 0x44, 0x2f, 0x48, 0x4d, 0x73, 0x51, 0x6d, 0x50, 0x33, 0x57, 0x79, 0x72, + 0x2b, 0x6d, 0x74, 0x2f, 0x0a, 0x6f, 0x41, 0x49, 0x77, 0x4f, 0x57, 0x5a, + 0x62, 0x77, 0x6d, 0x53, 0x4e, 0x75, 0x4a, 0x35, 0x51, 0x33, 0x4b, 0x6a, + 0x56, 0x53, 0x61, 0x4c, 0x74, 0x78, 0x39, 0x7a, 0x52, 0x53, 0x58, 0x38, + 0x58, 0x41, 0x62, 0x6a, 0x49, 0x68, 0x6f, 0x39, 0x4f, 0x6a, 0x49, 0x67, + 0x72, 0x71, 0x4a, 0x71, 0x70, 0x69, 0x73, 0x58, 0x52, 0x41, 0x4c, 0x33, + 0x34, 0x56, 0x4f, 0x4b, 0x61, 0x35, 0x56, 0x74, 0x38, 0x0a, 0x73, 0x79, + 0x63, 0x58, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, 0x69, 0x43, + 0x65, 0x72, 0x74, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x34, 0x20, 0x4f, 0x3d, 0x44, 0x69, + 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, + 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, 0x63, 0x65, + 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x44, 0x69, 0x67, + 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, + 0x64, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x34, 0x20, 0x4f, 0x3d, + 0x44, 0x69, 0x67, 0x69, 0x43, 0x65, 0x72, 0x74, 0x20, 0x49, 0x6e, 0x63, + 0x20, 0x4f, 0x55, 0x3d, 0x77, 0x77, 0x77, 0x2e, 0x64, 0x69, 0x67, 0x69, + 0x63, 0x65, 0x72, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x44, 0x69, 0x67, 0x69, 0x43, + 0x65, 0x72, 0x74, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, 0x34, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x37, 0x34, 0x35, 0x31, 0x35, + 0x30, 0x30, 0x35, 0x35, 0x38, 0x39, 0x37, 0x37, 0x33, 0x37, 0x30, 0x37, + 0x37, 0x37, 0x39, 0x33, 0x30, 0x30, 0x38, 0x34, 0x38, 0x36, 0x39, 0x30, + 0x31, 0x36, 0x36, 0x31, 0x34, 0x32, 0x33, 0x36, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x38, 0x3a, 0x66, 0x32, 0x3a, 0x66, 0x63, + 0x3a, 0x61, 0x61, 0x3a, 0x36, 0x30, 0x3a, 0x31, 0x66, 0x3a, 0x32, 0x66, + 0x3a, 0x62, 0x34, 0x3a, 0x65, 0x62, 0x3a, 0x63, 0x39, 0x3a, 0x33, 0x37, + 0x3a, 0x62, 0x61, 0x3a, 0x35, 0x33, 0x3a, 0x32, 0x65, 0x3a, 0x37, 0x35, + 0x3a, 0x34, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x64, 0x64, 0x3a, 0x66, 0x62, 0x3a, 0x31, 0x36, 0x3a, 0x63, 0x64, 0x3a, + 0x34, 0x39, 0x3a, 0x33, 0x31, 0x3a, 0x63, 0x39, 0x3a, 0x37, 0x33, 0x3a, + 0x61, 0x32, 0x3a, 0x30, 0x33, 0x3a, 0x37, 0x64, 0x3a, 0x33, 0x66, 0x3a, + 0x63, 0x38, 0x3a, 0x33, 0x61, 0x3a, 0x34, 0x64, 0x3a, 0x37, 0x64, 0x3a, + 0x37, 0x37, 0x3a, 0x35, 0x64, 0x3a, 0x30, 0x35, 0x3a, 0x65, 0x34, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x35, + 0x3a, 0x32, 0x66, 0x3a, 0x37, 0x62, 0x3a, 0x64, 0x63, 0x3a, 0x66, 0x31, + 0x3a, 0x61, 0x37, 0x3a, 0x61, 0x66, 0x3a, 0x39, 0x65, 0x3a, 0x36, 0x63, + 0x3a, 0x65, 0x36, 0x3a, 0x37, 0x32, 0x3a, 0x30, 0x31, 0x3a, 0x37, 0x66, + 0x3a, 0x34, 0x66, 0x3a, 0x31, 0x32, 0x3a, 0x61, 0x62, 0x3a, 0x66, 0x37, + 0x3a, 0x37, 0x32, 0x3a, 0x34, 0x30, 0x3a, 0x63, 0x37, 0x3a, 0x38, 0x65, + 0x3a, 0x37, 0x36, 0x3a, 0x31, 0x61, 0x3a, 0x63, 0x32, 0x3a, 0x30, 0x33, + 0x3a, 0x64, 0x31, 0x3a, 0x64, 0x39, 0x3a, 0x64, 0x32, 0x3a, 0x30, 0x61, + 0x3a, 0x63, 0x38, 0x3a, 0x39, 0x39, 0x3a, 0x38, 0x38, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x6b, 0x44, 0x43, 0x43, 0x41, 0x33, + 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x42, 0x5a, + 0x73, 0x62, 0x56, 0x35, 0x36, 0x4f, 0x49, 0x54, 0x4c, 0x69, 0x4f, 0x51, + 0x65, 0x39, 0x70, 0x33, 0x64, 0x31, 0x58, 0x44, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x77, 0x46, 0x41, 0x44, 0x42, 0x69, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, + 0x7a, 0x45, 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x4d, 0x52, 0x47, 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, + 0x6e, 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, + 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x0a, + 0x64, 0x33, 0x63, 0x75, 0x5a, 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, + 0x63, 0x6e, 0x51, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x53, 0x45, 0x77, + 0x48, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x68, 0x45, + 0x61, 0x57, 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x55, + 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x47, 0x56, 0x6b, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x67, 0x0a, 0x52, 0x7a, 0x51, 0x77, 0x48, 0x68, 0x63, + 0x4e, 0x4d, 0x54, 0x4d, 0x77, 0x4f, 0x44, 0x41, 0x78, 0x4d, 0x54, 0x49, + 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x67, + 0x77, 0x4d, 0x54, 0x45, 0x31, 0x4d, 0x54, 0x49, 0x77, 0x4d, 0x44, 0x41, + 0x77, 0x57, 0x6a, 0x42, 0x69, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x0a, 0x55, 0x7a, + 0x45, 0x56, 0x4d, 0x42, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, + 0x4d, 0x4d, 0x52, 0x47, 0x6c, 0x6e, 0x61, 0x55, 0x4e, 0x6c, 0x63, 0x6e, + 0x51, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x42, 0x33, 0x64, 0x33, + 0x63, 0x75, 0x5a, 0x47, 0x6c, 0x6e, 0x61, 0x57, 0x4e, 0x6c, 0x63, 0x6e, + 0x51, 0x75, 0x0a, 0x59, 0x32, 0x39, 0x74, 0x4d, 0x53, 0x45, 0x77, 0x48, + 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x68, 0x45, 0x61, + 0x57, 0x64, 0x70, 0x51, 0x32, 0x56, 0x79, 0x64, 0x43, 0x42, 0x55, 0x63, + 0x6e, 0x56, 0x7a, 0x64, 0x47, 0x56, 0x6b, 0x49, 0x46, 0x4a, 0x76, 0x62, + 0x33, 0x51, 0x67, 0x52, 0x7a, 0x51, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, + 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, + 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, + 0x41, 0x51, 0x43, 0x2f, 0x35, 0x70, 0x42, 0x7a, 0x61, 0x4e, 0x36, 0x37, + 0x35, 0x46, 0x31, 0x4b, 0x50, 0x44, 0x41, 0x69, 0x4d, 0x47, 0x6b, 0x7a, + 0x37, 0x4d, 0x4b, 0x6e, 0x4a, 0x53, 0x37, 0x4a, 0x49, 0x54, 0x33, 0x79, + 0x0a, 0x69, 0x74, 0x68, 0x5a, 0x77, 0x75, 0x45, 0x70, 0x70, 0x7a, 0x31, + 0x59, 0x71, 0x33, 0x61, 0x61, 0x7a, 0x61, 0x35, 0x37, 0x47, 0x34, 0x51, + 0x4e, 0x78, 0x44, 0x41, 0x66, 0x38, 0x78, 0x75, 0x6b, 0x4f, 0x42, 0x62, + 0x72, 0x56, 0x73, 0x61, 0x58, 0x62, 0x52, 0x32, 0x72, 0x73, 0x6e, 0x6e, + 0x79, 0x79, 0x68, 0x48, 0x53, 0x35, 0x46, 0x2f, 0x57, 0x42, 0x54, 0x78, + 0x53, 0x44, 0x31, 0x49, 0x66, 0x0a, 0x78, 0x70, 0x34, 0x56, 0x70, 0x58, + 0x36, 0x2b, 0x6e, 0x36, 0x6c, 0x58, 0x46, 0x6c, 0x6c, 0x56, 0x63, 0x71, + 0x39, 0x6f, 0x6b, 0x33, 0x44, 0x43, 0x73, 0x72, 0x70, 0x31, 0x6d, 0x57, + 0x70, 0x7a, 0x4d, 0x70, 0x54, 0x52, 0x45, 0x45, 0x51, 0x51, 0x4c, 0x74, + 0x2b, 0x43, 0x38, 0x77, 0x65, 0x45, 0x35, 0x6e, 0x51, 0x37, 0x62, 0x58, + 0x48, 0x69, 0x4c, 0x51, 0x77, 0x62, 0x37, 0x69, 0x44, 0x56, 0x0a, 0x79, + 0x53, 0x41, 0x64, 0x59, 0x79, 0x6b, 0x74, 0x7a, 0x75, 0x78, 0x65, 0x54, + 0x73, 0x69, 0x54, 0x2b, 0x43, 0x46, 0x68, 0x6d, 0x7a, 0x54, 0x72, 0x42, + 0x63, 0x5a, 0x65, 0x37, 0x46, 0x73, 0x61, 0x76, 0x4f, 0x76, 0x4a, 0x7a, + 0x38, 0x32, 0x73, 0x4e, 0x45, 0x42, 0x66, 0x73, 0x58, 0x70, 0x6d, 0x37, + 0x6e, 0x66, 0x49, 0x53, 0x4b, 0x68, 0x6d, 0x56, 0x31, 0x65, 0x66, 0x56, + 0x46, 0x69, 0x4f, 0x0a, 0x44, 0x43, 0x75, 0x33, 0x54, 0x36, 0x63, 0x77, + 0x32, 0x56, 0x62, 0x75, 0x79, 0x6e, 0x74, 0x64, 0x34, 0x36, 0x33, 0x4a, + 0x54, 0x31, 0x37, 0x6c, 0x4e, 0x65, 0x63, 0x78, 0x79, 0x39, 0x71, 0x54, + 0x58, 0x74, 0x79, 0x4f, 0x6a, 0x34, 0x44, 0x61, 0x74, 0x70, 0x47, 0x59, + 0x51, 0x4a, 0x42, 0x35, 0x77, 0x33, 0x6a, 0x48, 0x74, 0x72, 0x48, 0x45, + 0x74, 0x57, 0x6f, 0x59, 0x4f, 0x41, 0x4d, 0x51, 0x0a, 0x6a, 0x64, 0x6a, + 0x55, 0x4e, 0x36, 0x51, 0x75, 0x42, 0x58, 0x32, 0x49, 0x39, 0x59, 0x49, + 0x2b, 0x45, 0x4a, 0x46, 0x77, 0x71, 0x31, 0x57, 0x43, 0x51, 0x54, 0x4c, + 0x58, 0x32, 0x77, 0x52, 0x7a, 0x4b, 0x6d, 0x36, 0x52, 0x41, 0x58, 0x77, + 0x68, 0x54, 0x4e, 0x53, 0x38, 0x72, 0x68, 0x73, 0x44, 0x64, 0x56, 0x31, + 0x34, 0x5a, 0x74, 0x6b, 0x36, 0x4d, 0x55, 0x53, 0x61, 0x4d, 0x30, 0x43, + 0x2f, 0x0a, 0x43, 0x4e, 0x64, 0x61, 0x53, 0x61, 0x54, 0x43, 0x35, 0x71, + 0x6d, 0x67, 0x5a, 0x39, 0x32, 0x6b, 0x4a, 0x37, 0x79, 0x68, 0x54, 0x7a, + 0x6d, 0x31, 0x45, 0x56, 0x67, 0x58, 0x39, 0x79, 0x52, 0x63, 0x52, 0x6f, + 0x39, 0x6b, 0x39, 0x38, 0x46, 0x70, 0x69, 0x48, 0x61, 0x59, 0x64, 0x6a, + 0x31, 0x5a, 0x58, 0x55, 0x4a, 0x32, 0x68, 0x34, 0x6d, 0x58, 0x61, 0x58, + 0x70, 0x49, 0x38, 0x4f, 0x43, 0x69, 0x0a, 0x45, 0x68, 0x74, 0x6d, 0x6d, + 0x6e, 0x54, 0x4b, 0x33, 0x6b, 0x73, 0x65, 0x35, 0x77, 0x35, 0x6a, 0x72, + 0x75, 0x62, 0x55, 0x37, 0x35, 0x4b, 0x53, 0x4f, 0x70, 0x34, 0x39, 0x33, + 0x41, 0x44, 0x6b, 0x52, 0x53, 0x57, 0x4a, 0x74, 0x70, 0x70, 0x45, 0x47, + 0x53, 0x74, 0x2b, 0x77, 0x4a, 0x53, 0x30, 0x30, 0x6d, 0x46, 0x74, 0x36, + 0x7a, 0x50, 0x5a, 0x78, 0x64, 0x39, 0x4c, 0x42, 0x41, 0x44, 0x4d, 0x0a, + 0x66, 0x52, 0x79, 0x56, 0x77, 0x34, 0x2f, 0x33, 0x49, 0x62, 0x4b, 0x79, + 0x45, 0x62, 0x65, 0x37, 0x66, 0x2f, 0x4c, 0x56, 0x6a, 0x48, 0x41, 0x73, + 0x51, 0x57, 0x43, 0x71, 0x73, 0x57, 0x4d, 0x59, 0x52, 0x4a, 0x55, 0x61, + 0x64, 0x6d, 0x4a, 0x2b, 0x39, 0x6f, 0x43, 0x77, 0x2b, 0x2b, 0x68, 0x6b, + 0x70, 0x6a, 0x50, 0x52, 0x69, 0x51, 0x66, 0x68, 0x76, 0x62, 0x66, 0x6d, + 0x51, 0x36, 0x51, 0x59, 0x0a, 0x75, 0x4b, 0x5a, 0x33, 0x41, 0x65, 0x45, + 0x50, 0x6c, 0x41, 0x77, 0x68, 0x48, 0x62, 0x4a, 0x55, 0x4b, 0x53, 0x57, + 0x4a, 0x62, 0x4f, 0x55, 0x4f, 0x55, 0x6c, 0x46, 0x48, 0x64, 0x4c, 0x34, + 0x6d, 0x72, 0x4c, 0x5a, 0x42, 0x64, 0x64, 0x35, 0x36, 0x72, 0x46, 0x2b, + 0x4e, 0x50, 0x38, 0x6d, 0x38, 0x30, 0x30, 0x45, 0x52, 0x45, 0x6c, 0x76, + 0x6c, 0x45, 0x46, 0x44, 0x72, 0x4d, 0x63, 0x58, 0x4b, 0x0a, 0x63, 0x68, + 0x59, 0x69, 0x43, 0x64, 0x39, 0x38, 0x54, 0x48, 0x55, 0x2f, 0x59, 0x2b, + 0x77, 0x68, 0x58, 0x38, 0x51, 0x67, 0x55, 0x57, 0x74, 0x76, 0x73, 0x61, + 0x75, 0x47, 0x69, 0x30, 0x2f, 0x43, 0x31, 0x6b, 0x56, 0x66, 0x6e, 0x53, + 0x44, 0x38, 0x6f, 0x52, 0x37, 0x46, 0x77, 0x49, 0x2b, 0x69, 0x73, 0x58, + 0x34, 0x4b, 0x4a, 0x70, 0x6e, 0x31, 0x35, 0x47, 0x6b, 0x76, 0x6d, 0x42, + 0x30, 0x74, 0x0a, 0x39, 0x64, 0x6d, 0x70, 0x73, 0x68, 0x33, 0x6c, 0x47, + 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, + 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, + 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x0a, 0x68, 0x6a, 0x41, 0x64, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, + 0x37, 0x4e, 0x66, 0x6a, 0x67, 0x74, 0x4a, 0x78, 0x58, 0x57, 0x52, 0x4d, + 0x33, 0x79, 0x35, 0x6e, 0x50, 0x2b, 0x65, 0x36, 0x6d, 0x4b, 0x34, 0x63, + 0x44, 0x30, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4d, 0x42, 0x51, 0x41, 0x44, + 0x0a, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4c, 0x74, 0x68, 0x32, 0x58, 0x32, + 0x70, 0x62, 0x4c, 0x34, 0x58, 0x78, 0x4a, 0x45, 0x62, 0x77, 0x36, 0x47, + 0x69, 0x41, 0x49, 0x33, 0x6a, 0x5a, 0x47, 0x67, 0x50, 0x56, 0x73, 0x39, + 0x33, 0x72, 0x6e, 0x44, 0x35, 0x2f, 0x5a, 0x70, 0x4b, 0x6d, 0x62, 0x6e, + 0x4a, 0x65, 0x46, 0x77, 0x4d, 0x44, 0x46, 0x2f, 0x6b, 0x35, 0x68, 0x51, + 0x70, 0x56, 0x67, 0x73, 0x32, 0x0a, 0x53, 0x56, 0x31, 0x45, 0x59, 0x2b, + 0x43, 0x74, 0x6e, 0x4a, 0x59, 0x59, 0x5a, 0x68, 0x73, 0x6a, 0x44, 0x54, + 0x31, 0x35, 0x36, 0x57, 0x31, 0x72, 0x31, 0x6c, 0x54, 0x34, 0x30, 0x6a, + 0x7a, 0x42, 0x51, 0x30, 0x43, 0x75, 0x48, 0x56, 0x44, 0x31, 0x55, 0x76, + 0x79, 0x51, 0x4f, 0x37, 0x75, 0x59, 0x6d, 0x57, 0x6c, 0x72, 0x78, 0x38, + 0x47, 0x6e, 0x71, 0x47, 0x69, 0x6b, 0x4a, 0x39, 0x79, 0x64, 0x0a, 0x2b, + 0x53, 0x65, 0x75, 0x4d, 0x49, 0x57, 0x35, 0x39, 0x6d, 0x64, 0x4e, 0x4f, + 0x6a, 0x36, 0x50, 0x57, 0x54, 0x6b, 0x69, 0x55, 0x30, 0x54, 0x72, 0x79, + 0x46, 0x30, 0x44, 0x79, 0x75, 0x31, 0x51, 0x65, 0x6e, 0x31, 0x69, 0x49, + 0x51, 0x71, 0x41, 0x79, 0x48, 0x4e, 0x6d, 0x30, 0x61, 0x41, 0x46, 0x59, + 0x46, 0x2f, 0x6f, 0x70, 0x62, 0x53, 0x6e, 0x72, 0x36, 0x6a, 0x33, 0x62, + 0x54, 0x57, 0x63, 0x0a, 0x66, 0x46, 0x71, 0x4b, 0x31, 0x71, 0x49, 0x34, + 0x6d, 0x66, 0x4e, 0x34, 0x69, 0x2f, 0x52, 0x4e, 0x30, 0x69, 0x41, 0x4c, + 0x33, 0x67, 0x54, 0x75, 0x6a, 0x4a, 0x74, 0x48, 0x67, 0x58, 0x49, 0x4e, + 0x77, 0x42, 0x51, 0x79, 0x37, 0x7a, 0x42, 0x5a, 0x4c, 0x71, 0x37, 0x67, + 0x63, 0x66, 0x4a, 0x57, 0x35, 0x47, 0x71, 0x58, 0x62, 0x35, 0x4a, 0x51, + 0x62, 0x5a, 0x61, 0x4e, 0x61, 0x48, 0x71, 0x61, 0x0a, 0x73, 0x6a, 0x59, + 0x55, 0x65, 0x67, 0x62, 0x79, 0x4a, 0x4c, 0x6b, 0x4a, 0x45, 0x56, 0x44, + 0x58, 0x43, 0x4c, 0x47, 0x34, 0x69, 0x58, 0x71, 0x45, 0x49, 0x32, 0x46, + 0x43, 0x4b, 0x65, 0x57, 0x6a, 0x7a, 0x61, 0x49, 0x67, 0x51, 0x64, 0x66, + 0x52, 0x6e, 0x47, 0x54, 0x5a, 0x36, 0x69, 0x61, 0x68, 0x69, 0x78, 0x54, + 0x58, 0x54, 0x42, 0x6d, 0x79, 0x55, 0x45, 0x46, 0x78, 0x50, 0x54, 0x39, + 0x4e, 0x0a, 0x63, 0x43, 0x4f, 0x47, 0x44, 0x45, 0x72, 0x63, 0x67, 0x64, + 0x4c, 0x4d, 0x4d, 0x70, 0x53, 0x45, 0x44, 0x51, 0x67, 0x4a, 0x6c, 0x78, + 0x78, 0x50, 0x77, 0x4f, 0x35, 0x72, 0x49, 0x48, 0x51, 0x77, 0x30, 0x75, + 0x41, 0x35, 0x4e, 0x42, 0x43, 0x46, 0x49, 0x52, 0x55, 0x42, 0x43, 0x4f, + 0x68, 0x56, 0x4d, 0x74, 0x35, 0x78, 0x53, 0x64, 0x6b, 0x6f, 0x46, 0x31, + 0x42, 0x4e, 0x35, 0x72, 0x35, 0x4e, 0x0a, 0x30, 0x58, 0x57, 0x73, 0x30, + 0x4d, 0x72, 0x37, 0x51, 0x62, 0x68, 0x44, 0x70, 0x61, 0x72, 0x54, 0x77, + 0x77, 0x56, 0x45, 0x54, 0x79, 0x77, 0x32, 0x6d, 0x2b, 0x4c, 0x36, 0x34, + 0x6b, 0x57, 0x34, 0x49, 0x31, 0x4e, 0x73, 0x42, 0x6d, 0x39, 0x6e, 0x56, + 0x58, 0x39, 0x47, 0x74, 0x55, 0x77, 0x2f, 0x62, 0x69, 0x68, 0x61, 0x65, + 0x53, 0x62, 0x53, 0x70, 0x4b, 0x68, 0x69, 0x6c, 0x39, 0x49, 0x65, 0x0a, + 0x34, 0x75, 0x31, 0x4b, 0x69, 0x37, 0x77, 0x62, 0x2f, 0x55, 0x64, 0x4b, + 0x44, 0x64, 0x39, 0x6e, 0x5a, 0x6e, 0x36, 0x79, 0x57, 0x30, 0x48, 0x51, + 0x4f, 0x2b, 0x54, 0x30, 0x4f, 0x2f, 0x51, 0x45, 0x59, 0x2b, 0x6e, 0x76, + 0x77, 0x6c, 0x51, 0x41, 0x55, 0x61, 0x43, 0x4b, 0x4b, 0x73, 0x6e, 0x4f, + 0x65, 0x4d, 0x7a, 0x56, 0x36, 0x6f, 0x63, 0x45, 0x47, 0x4c, 0x50, 0x4f, + 0x72, 0x30, 0x6d, 0x49, 0x0a, 0x72, 0x2f, 0x4f, 0x53, 0x6d, 0x62, 0x61, + 0x7a, 0x35, 0x6d, 0x45, 0x50, 0x30, 0x6f, 0x55, 0x41, 0x35, 0x31, 0x41, + 0x61, 0x35, 0x42, 0x75, 0x56, 0x6e, 0x52, 0x6d, 0x68, 0x75, 0x5a, 0x79, + 0x78, 0x6d, 0x37, 0x45, 0x41, 0x48, 0x75, 0x2f, 0x51, 0x44, 0x30, 0x39, + 0x43, 0x62, 0x4d, 0x6b, 0x4b, 0x76, 0x4f, 0x35, 0x44, 0x2b, 0x6a, 0x70, + 0x78, 0x70, 0x63, 0x68, 0x4e, 0x4a, 0x71, 0x55, 0x31, 0x0a, 0x2f, 0x59, + 0x6c, 0x64, 0x76, 0x49, 0x56, 0x69, 0x48, 0x54, 0x4c, 0x53, 0x6f, 0x43, + 0x74, 0x55, 0x37, 0x5a, 0x70, 0x58, 0x77, 0x64, 0x76, 0x36, 0x45, 0x4d, + 0x38, 0x5a, 0x74, 0x34, 0x74, 0x4b, 0x47, 0x34, 0x38, 0x42, 0x74, 0x69, + 0x65, 0x56, 0x55, 0x2b, 0x69, 0x32, 0x69, 0x57, 0x31, 0x62, 0x76, 0x47, + 0x6a, 0x55, 0x49, 0x2b, 0x69, 0x4c, 0x55, 0x61, 0x4a, 0x57, 0x2b, 0x66, + 0x43, 0x6d, 0x0a, 0x67, 0x4b, 0x44, 0x57, 0x48, 0x72, 0x4f, 0x38, 0x44, + 0x77, 0x39, 0x54, 0x64, 0x53, 0x6d, 0x71, 0x36, 0x68, 0x4e, 0x33, 0x35, + 0x4e, 0x36, 0x4d, 0x67, 0x53, 0x47, 0x74, 0x42, 0x78, 0x42, 0x48, 0x45, + 0x61, 0x32, 0x48, 0x50, 0x51, 0x66, 0x52, 0x64, 0x62, 0x7a, 0x50, 0x38, + 0x32, 0x5a, 0x2b, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, + 0x44, 0x4f, 0x20, 0x52, 0x53, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x43, 0x4f, 0x4d, + 0x4f, 0x44, 0x4f, 0x20, 0x43, 0x41, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x65, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, 0x20, + 0x52, 0x53, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x43, 0x4f, 0x4d, 0x4f, 0x44, 0x4f, + 0x20, 0x43, 0x41, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x4f, + 0x4d, 0x4f, 0x44, 0x4f, 0x20, 0x52, 0x53, 0x41, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, 0x31, 0x39, + 0x30, 0x39, 0x30, 0x38, 0x34, 0x35, 0x33, 0x37, 0x35, 0x38, 0x32, 0x30, + 0x39, 0x33, 0x33, 0x30, 0x38, 0x39, 0x34, 0x31, 0x33, 0x36, 0x33, 0x35, + 0x32, 0x34, 0x38, 0x37, 0x33, 0x31, 0x39, 0x33, 0x31, 0x31, 0x37, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x62, 0x3a, 0x33, 0x31, + 0x3a, 0x62, 0x30, 0x3a, 0x37, 0x31, 0x3a, 0x34, 0x30, 0x3a, 0x33, 0x36, + 0x3a, 0x63, 0x63, 0x3a, 0x31, 0x34, 0x3a, 0x33, 0x36, 0x3a, 0x39, 0x31, + 0x3a, 0x61, 0x64, 0x3a, 0x63, 0x34, 0x3a, 0x33, 0x65, 0x3a, 0x66, 0x64, + 0x3a, 0x65, 0x63, 0x3a, 0x31, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x61, 0x66, 0x3a, 0x65, 0x35, 0x3a, 0x64, 0x32, 0x3a, + 0x34, 0x34, 0x3a, 0x61, 0x38, 0x3a, 0x64, 0x31, 0x3a, 0x31, 0x39, 0x3a, + 0x34, 0x32, 0x3a, 0x33, 0x30, 0x3a, 0x66, 0x66, 0x3a, 0x34, 0x37, 0x3a, + 0x39, 0x66, 0x3a, 0x65, 0x32, 0x3a, 0x66, 0x38, 0x3a, 0x39, 0x37, 0x3a, + 0x62, 0x62, 0x3a, 0x63, 0x64, 0x3a, 0x37, 0x61, 0x3a, 0x38, 0x63, 0x3a, + 0x62, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x35, 0x32, 0x3a, 0x66, 0x30, 0x3a, 0x65, 0x31, 0x3a, 0x63, 0x34, + 0x3a, 0x65, 0x35, 0x3a, 0x38, 0x65, 0x3a, 0x63, 0x36, 0x3a, 0x32, 0x39, + 0x3a, 0x32, 0x39, 0x3a, 0x31, 0x62, 0x3a, 0x36, 0x30, 0x3a, 0x33, 0x31, + 0x3a, 0x37, 0x66, 0x3a, 0x30, 0x37, 0x3a, 0x34, 0x36, 0x3a, 0x37, 0x31, + 0x3a, 0x62, 0x38, 0x3a, 0x35, 0x64, 0x3a, 0x37, 0x65, 0x3a, 0x61, 0x38, + 0x3a, 0x30, 0x64, 0x3a, 0x35, 0x62, 0x3a, 0x30, 0x37, 0x3a, 0x32, 0x37, + 0x3a, 0x33, 0x34, 0x3a, 0x36, 0x33, 0x3a, 0x35, 0x33, 0x3a, 0x34, 0x62, + 0x3a, 0x33, 0x32, 0x3a, 0x62, 0x34, 0x3a, 0x30, 0x32, 0x3a, 0x33, 0x34, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x32, 0x44, 0x43, + 0x43, 0x41, 0x38, 0x43, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x51, 0x54, 0x4b, 0x72, 0x35, 0x79, 0x74, 0x74, 0x6a, 0x62, 0x2b, 0x41, + 0x66, 0x39, 0x30, 0x37, 0x59, 0x57, 0x77, 0x4f, 0x47, 0x6e, 0x54, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x77, 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x68, 0x54, + 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, + 0x4d, 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x45, 0x6b, 0x64, 0x79, 0x5a, 0x57, + 0x46, 0x30, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x57, 0x46, 0x75, 0x59, 0x32, + 0x68, 0x6c, 0x63, 0x33, 0x52, 0x6c, 0x63, 0x6a, 0x45, 0x51, 0x4d, 0x41, + 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x48, 0x55, + 0x32, 0x46, 0x73, 0x5a, 0x6d, 0x39, 0x79, 0x5a, 0x44, 0x45, 0x61, 0x4d, + 0x42, 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x52, 0x51, + 0x30, 0x39, 0x4e, 0x54, 0x30, 0x52, 0x50, 0x49, 0x45, 0x4e, 0x42, 0x49, + 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, 0x78, 0x4b, + 0x7a, 0x41, 0x70, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x54, + 0x49, 0x6b, 0x4e, 0x50, 0x54, 0x55, 0x39, 0x45, 0x54, 0x79, 0x42, 0x53, + 0x55, 0x30, 0x45, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, + 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, + 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, + 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x41, 0x77, 0x4d, 0x54, 0x45, 0x35, + 0x0a, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, + 0x4e, 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x54, 0x45, 0x34, 0x4d, 0x6a, 0x4d, + 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x68, 0x54, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x52, 0x30, 0x49, 0x78, 0x47, 0x7a, 0x41, 0x5a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x67, 0x54, 0x0a, 0x45, 0x6b, 0x64, 0x79, 0x5a, 0x57, + 0x46, 0x30, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x57, 0x46, 0x75, 0x59, 0x32, + 0x68, 0x6c, 0x63, 0x33, 0x52, 0x6c, 0x63, 0x6a, 0x45, 0x51, 0x4d, 0x41, + 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x48, 0x55, 0x32, + 0x46, 0x73, 0x5a, 0x6d, 0x39, 0x79, 0x5a, 0x44, 0x45, 0x61, 0x4d, 0x42, + 0x67, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x52, 0x0a, 0x51, + 0x30, 0x39, 0x4e, 0x54, 0x30, 0x52, 0x50, 0x49, 0x45, 0x4e, 0x42, 0x49, + 0x45, 0x78, 0x70, 0x62, 0x57, 0x6c, 0x30, 0x5a, 0x57, 0x51, 0x78, 0x4b, + 0x7a, 0x41, 0x70, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x49, + 0x6b, 0x4e, 0x50, 0x54, 0x55, 0x39, 0x45, 0x54, 0x79, 0x42, 0x53, 0x55, + 0x30, 0x45, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, + 0x57, 0x4e, 0x68, 0x0a, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, + 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, + 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, + 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, + 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x52, 0x0a, 0x36, 0x46, 0x53, + 0x53, 0x30, 0x67, 0x70, 0x57, 0x73, 0x61, 0x77, 0x4e, 0x4a, 0x4e, 0x33, + 0x46, 0x7a, 0x30, 0x52, 0x6e, 0x64, 0x4a, 0x6b, 0x72, 0x4e, 0x36, 0x4e, + 0x39, 0x49, 0x33, 0x41, 0x41, 0x63, 0x62, 0x78, 0x54, 0x33, 0x38, 0x54, + 0x36, 0x4b, 0x68, 0x4b, 0x50, 0x53, 0x33, 0x38, 0x51, 0x56, 0x72, 0x32, + 0x66, 0x63, 0x48, 0x4b, 0x33, 0x59, 0x58, 0x2f, 0x4a, 0x53, 0x77, 0x38, + 0x58, 0x0a, 0x70, 0x7a, 0x33, 0x6a, 0x73, 0x41, 0x52, 0x68, 0x37, 0x76, + 0x38, 0x52, 0x6c, 0x38, 0x66, 0x30, 0x68, 0x6a, 0x34, 0x4b, 0x2b, 0x6a, + 0x35, 0x63, 0x2b, 0x5a, 0x50, 0x6d, 0x4e, 0x48, 0x72, 0x5a, 0x46, 0x47, + 0x76, 0x6e, 0x6e, 0x4c, 0x4f, 0x46, 0x6f, 0x49, 0x4a, 0x36, 0x64, 0x71, + 0x39, 0x78, 0x6b, 0x4e, 0x66, 0x73, 0x2f, 0x51, 0x33, 0x36, 0x6e, 0x47, + 0x7a, 0x36, 0x33, 0x37, 0x43, 0x43, 0x0a, 0x39, 0x42, 0x52, 0x2b, 0x2b, + 0x62, 0x37, 0x45, 0x70, 0x69, 0x39, 0x50, 0x66, 0x35, 0x6c, 0x2f, 0x74, + 0x66, 0x78, 0x6e, 0x51, 0x33, 0x4b, 0x39, 0x44, 0x41, 0x44, 0x57, 0x69, + 0x65, 0x74, 0x72, 0x4c, 0x4e, 0x50, 0x74, 0x6a, 0x35, 0x67, 0x63, 0x46, + 0x4b, 0x74, 0x2b, 0x35, 0x65, 0x4e, 0x75, 0x2f, 0x4e, 0x69, 0x6f, 0x35, + 0x4a, 0x49, 0x6b, 0x32, 0x6b, 0x4e, 0x72, 0x59, 0x72, 0x68, 0x56, 0x0a, + 0x2f, 0x65, 0x72, 0x42, 0x76, 0x47, 0x79, 0x32, 0x69, 0x2f, 0x4d, 0x4f, + 0x6a, 0x5a, 0x72, 0x6b, 0x6d, 0x32, 0x78, 0x70, 0x6d, 0x66, 0x68, 0x34, + 0x53, 0x44, 0x42, 0x46, 0x31, 0x61, 0x33, 0x68, 0x44, 0x54, 0x78, 0x46, + 0x59, 0x50, 0x77, 0x79, 0x6c, 0x6c, 0x45, 0x6e, 0x76, 0x47, 0x66, 0x44, + 0x79, 0x69, 0x36, 0x32, 0x61, 0x2b, 0x70, 0x47, 0x78, 0x38, 0x63, 0x67, + 0x6f, 0x4c, 0x45, 0x66, 0x0a, 0x5a, 0x64, 0x35, 0x49, 0x43, 0x4c, 0x71, + 0x6b, 0x54, 0x71, 0x6e, 0x79, 0x67, 0x30, 0x59, 0x33, 0x68, 0x4f, 0x76, + 0x6f, 0x7a, 0x49, 0x46, 0x49, 0x51, 0x32, 0x64, 0x4f, 0x63, 0x69, 0x71, + 0x62, 0x58, 0x4c, 0x31, 0x4d, 0x47, 0x79, 0x69, 0x4b, 0x58, 0x43, 0x4a, + 0x37, 0x74, 0x4b, 0x75, 0x59, 0x32, 0x65, 0x37, 0x67, 0x55, 0x59, 0x50, + 0x44, 0x43, 0x55, 0x5a, 0x4f, 0x62, 0x54, 0x36, 0x5a, 0x0a, 0x2b, 0x70, + 0x55, 0x58, 0x32, 0x6e, 0x77, 0x7a, 0x56, 0x30, 0x45, 0x38, 0x6a, 0x56, + 0x48, 0x74, 0x43, 0x37, 0x5a, 0x63, 0x72, 0x79, 0x78, 0x6a, 0x47, 0x74, + 0x39, 0x58, 0x79, 0x44, 0x2b, 0x38, 0x36, 0x56, 0x33, 0x45, 0x6d, 0x36, + 0x39, 0x46, 0x6d, 0x65, 0x4b, 0x6a, 0x57, 0x69, 0x53, 0x30, 0x75, 0x71, + 0x6c, 0x57, 0x50, 0x63, 0x39, 0x76, 0x71, 0x76, 0x39, 0x4a, 0x57, 0x4c, + 0x37, 0x77, 0x0a, 0x71, 0x50, 0x2f, 0x30, 0x75, 0x4b, 0x33, 0x70, 0x4e, + 0x2f, 0x75, 0x36, 0x75, 0x50, 0x51, 0x4c, 0x4f, 0x76, 0x6e, 0x6f, 0x51, + 0x30, 0x49, 0x65, 0x69, 0x64, 0x69, 0x45, 0x79, 0x78, 0x50, 0x78, 0x32, + 0x62, 0x76, 0x68, 0x69, 0x57, 0x43, 0x34, 0x6a, 0x43, 0x68, 0x57, 0x72, + 0x42, 0x51, 0x64, 0x6e, 0x41, 0x72, 0x6e, 0x63, 0x65, 0x76, 0x50, 0x44, + 0x74, 0x30, 0x39, 0x71, 0x5a, 0x61, 0x68, 0x0a, 0x53, 0x4c, 0x30, 0x38, + 0x39, 0x36, 0x2b, 0x31, 0x44, 0x53, 0x4a, 0x4d, 0x77, 0x42, 0x47, 0x42, + 0x37, 0x46, 0x59, 0x37, 0x39, 0x74, 0x4f, 0x69, 0x34, 0x6c, 0x75, 0x33, + 0x73, 0x67, 0x51, 0x69, 0x55, 0x70, 0x57, 0x41, 0x6b, 0x32, 0x6e, 0x6f, + 0x6a, 0x6b, 0x78, 0x6c, 0x38, 0x5a, 0x45, 0x44, 0x4c, 0x58, 0x42, 0x30, + 0x41, 0x75, 0x71, 0x4c, 0x5a, 0x78, 0x55, 0x70, 0x61, 0x56, 0x49, 0x43, + 0x0a, 0x75, 0x39, 0x66, 0x66, 0x55, 0x47, 0x70, 0x56, 0x52, 0x72, 0x2b, + 0x67, 0x6f, 0x79, 0x68, 0x68, 0x66, 0x33, 0x44, 0x51, 0x77, 0x36, 0x4b, + 0x71, 0x4c, 0x43, 0x47, 0x71, 0x52, 0x38, 0x34, 0x6f, 0x6e, 0x41, 0x5a, + 0x46, 0x64, 0x72, 0x2b, 0x43, 0x47, 0x43, 0x65, 0x30, 0x31, 0x61, 0x36, + 0x30, 0x79, 0x31, 0x44, 0x6d, 0x61, 0x2f, 0x52, 0x4d, 0x68, 0x6e, 0x45, + 0x77, 0x36, 0x61, 0x62, 0x66, 0x0a, 0x46, 0x6f, 0x62, 0x67, 0x32, 0x50, + 0x39, 0x41, 0x33, 0x66, 0x76, 0x51, 0x51, 0x6f, 0x68, 0x2f, 0x6f, 0x7a, + 0x4d, 0x36, 0x4c, 0x6c, 0x77, 0x65, 0x51, 0x52, 0x47, 0x42, 0x59, 0x38, + 0x34, 0x59, 0x63, 0x57, 0x73, 0x72, 0x37, 0x4b, 0x61, 0x4b, 0x74, 0x7a, + 0x46, 0x63, 0x4f, 0x6d, 0x70, 0x48, 0x34, 0x4d, 0x4e, 0x35, 0x57, 0x64, + 0x59, 0x67, 0x47, 0x71, 0x2f, 0x79, 0x61, 0x70, 0x69, 0x71, 0x0a, 0x63, + 0x72, 0x78, 0x58, 0x53, 0x74, 0x4a, 0x4c, 0x6e, 0x62, 0x73, 0x51, 0x2f, + 0x4c, 0x42, 0x4d, 0x51, 0x65, 0x58, 0x74, 0x48, 0x54, 0x31, 0x65, 0x4b, + 0x4a, 0x32, 0x63, 0x7a, 0x4c, 0x2b, 0x7a, 0x55, 0x64, 0x71, 0x6e, 0x52, + 0x2b, 0x57, 0x45, 0x55, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, + 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x34, 0x45, 0x0a, 0x46, 0x67, 0x51, 0x55, 0x75, 0x36, 0x39, 0x2b, + 0x41, 0x6a, 0x33, 0x36, 0x70, 0x76, 0x45, 0x38, 0x68, 0x49, 0x36, 0x74, + 0x37, 0x6a, 0x69, 0x59, 0x37, 0x4e, 0x6b, 0x79, 0x4d, 0x74, 0x51, 0x77, + 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, + 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x0a, 0x2f, 0x77, 0x51, + 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x4d, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x41, 0x72, + 0x78, 0x31, 0x55, 0x61, 0x45, 0x74, 0x36, 0x35, 0x52, 0x75, 0x32, 0x79, + 0x79, 0x54, 0x55, 0x45, 0x55, 0x41, 0x4a, 0x4e, 0x4d, 0x6e, 0x4d, 0x76, + 0x6c, 0x0a, 0x77, 0x46, 0x54, 0x50, 0x6f, 0x43, 0x57, 0x4f, 0x41, 0x76, + 0x6e, 0x39, 0x73, 0x4b, 0x49, 0x4e, 0x39, 0x53, 0x43, 0x59, 0x50, 0x42, + 0x4d, 0x74, 0x72, 0x46, 0x61, 0x69, 0x73, 0x4e, 0x5a, 0x2b, 0x45, 0x5a, + 0x4c, 0x70, 0x4c, 0x72, 0x71, 0x65, 0x4c, 0x70, 0x70, 0x79, 0x73, 0x62, + 0x30, 0x5a, 0x52, 0x47, 0x78, 0x68, 0x4e, 0x61, 0x4b, 0x61, 0x74, 0x42, + 0x59, 0x53, 0x61, 0x56, 0x71, 0x4d, 0x0a, 0x34, 0x64, 0x63, 0x2b, 0x70, + 0x42, 0x72, 0x6f, 0x4c, 0x77, 0x50, 0x30, 0x72, 0x6d, 0x45, 0x64, 0x45, + 0x42, 0x73, 0x71, 0x70, 0x49, 0x74, 0x36, 0x78, 0x66, 0x34, 0x46, 0x70, + 0x75, 0x48, 0x41, 0x31, 0x73, 0x6a, 0x2b, 0x6e, 0x71, 0x36, 0x50, 0x4b, + 0x37, 0x6f, 0x39, 0x6d, 0x66, 0x6a, 0x59, 0x63, 0x77, 0x6c, 0x59, 0x52, + 0x6d, 0x36, 0x6d, 0x6e, 0x50, 0x54, 0x58, 0x4a, 0x39, 0x4f, 0x56, 0x0a, + 0x32, 0x6a, 0x65, 0x44, 0x63, 0x68, 0x7a, 0x54, 0x63, 0x2b, 0x43, 0x69, + 0x52, 0x35, 0x6b, 0x44, 0x4f, 0x46, 0x33, 0x56, 0x53, 0x58, 0x6b, 0x41, + 0x4b, 0x52, 0x7a, 0x48, 0x37, 0x4a, 0x73, 0x67, 0x48, 0x41, 0x63, 0x6b, + 0x61, 0x56, 0x64, 0x34, 0x73, 0x6a, 0x6e, 0x38, 0x4f, 0x6f, 0x53, 0x67, + 0x74, 0x5a, 0x78, 0x38, 0x6a, 0x62, 0x38, 0x75, 0x6b, 0x32, 0x49, 0x6e, + 0x74, 0x7a, 0x6e, 0x61, 0x0a, 0x46, 0x78, 0x69, 0x75, 0x76, 0x54, 0x77, + 0x4a, 0x61, 0x50, 0x2b, 0x45, 0x6d, 0x7a, 0x7a, 0x56, 0x31, 0x67, 0x73, + 0x44, 0x34, 0x31, 0x65, 0x65, 0x46, 0x50, 0x66, 0x52, 0x36, 0x30, 0x2f, + 0x49, 0x76, 0x59, 0x63, 0x6a, 0x74, 0x37, 0x5a, 0x4a, 0x51, 0x33, 0x6d, + 0x46, 0x58, 0x4c, 0x72, 0x72, 0x6b, 0x67, 0x75, 0x68, 0x78, 0x75, 0x68, + 0x6f, 0x71, 0x45, 0x77, 0x57, 0x73, 0x52, 0x71, 0x5a, 0x0a, 0x43, 0x75, + 0x68, 0x54, 0x4c, 0x4a, 0x4b, 0x37, 0x6f, 0x51, 0x6b, 0x59, 0x64, 0x51, + 0x78, 0x6c, 0x71, 0x48, 0x76, 0x4c, 0x49, 0x37, 0x63, 0x61, 0x77, 0x69, + 0x69, 0x46, 0x77, 0x78, 0x76, 0x2f, 0x30, 0x43, 0x74, 0x69, 0x37, 0x36, + 0x52, 0x37, 0x43, 0x5a, 0x47, 0x59, 0x5a, 0x34, 0x77, 0x55, 0x41, 0x63, + 0x31, 0x6f, 0x42, 0x6d, 0x70, 0x6a, 0x49, 0x58, 0x55, 0x44, 0x67, 0x49, + 0x69, 0x4b, 0x0a, 0x62, 0x6f, 0x48, 0x47, 0x68, 0x66, 0x4b, 0x70, 0x70, + 0x43, 0x33, 0x6e, 0x39, 0x4b, 0x55, 0x6b, 0x45, 0x45, 0x65, 0x44, 0x79, + 0x73, 0x33, 0x30, 0x6a, 0x58, 0x6c, 0x59, 0x73, 0x51, 0x61, 0x62, 0x35, + 0x78, 0x6f, 0x71, 0x32, 0x5a, 0x30, 0x42, 0x31, 0x35, 0x52, 0x39, 0x37, + 0x51, 0x4e, 0x4b, 0x79, 0x76, 0x44, 0x62, 0x36, 0x4b, 0x6b, 0x42, 0x50, + 0x76, 0x56, 0x57, 0x6d, 0x63, 0x6b, 0x65, 0x0a, 0x6a, 0x6b, 0x6b, 0x39, + 0x75, 0x2b, 0x55, 0x4a, 0x75, 0x65, 0x42, 0x50, 0x53, 0x5a, 0x49, 0x39, + 0x46, 0x6f, 0x4a, 0x41, 0x7a, 0x4d, 0x78, 0x5a, 0x78, 0x75, 0x59, 0x36, + 0x37, 0x52, 0x49, 0x75, 0x61, 0x54, 0x78, 0x73, 0x6c, 0x62, 0x48, 0x39, + 0x71, 0x68, 0x31, 0x37, 0x66, 0x34, 0x61, 0x2b, 0x48, 0x67, 0x34, 0x79, + 0x52, 0x76, 0x76, 0x37, 0x45, 0x34, 0x39, 0x31, 0x66, 0x30, 0x79, 0x4c, + 0x0a, 0x53, 0x30, 0x5a, 0x6a, 0x2f, 0x67, 0x41, 0x30, 0x51, 0x48, 0x44, + 0x42, 0x77, 0x37, 0x6d, 0x68, 0x33, 0x61, 0x5a, 0x77, 0x34, 0x67, 0x53, + 0x7a, 0x51, 0x62, 0x7a, 0x70, 0x67, 0x4a, 0x48, 0x71, 0x5a, 0x4a, 0x78, + 0x36, 0x34, 0x53, 0x49, 0x44, 0x71, 0x5a, 0x78, 0x75, 0x62, 0x77, 0x35, + 0x6c, 0x54, 0x32, 0x79, 0x48, 0x68, 0x31, 0x37, 0x7a, 0x62, 0x71, 0x44, + 0x35, 0x64, 0x61, 0x57, 0x62, 0x0a, 0x51, 0x4f, 0x68, 0x54, 0x73, 0x69, + 0x65, 0x64, 0x53, 0x72, 0x6e, 0x41, 0x64, 0x79, 0x47, 0x4e, 0x2f, 0x34, + 0x66, 0x79, 0x33, 0x72, 0x79, 0x4d, 0x37, 0x78, 0x66, 0x66, 0x74, 0x30, + 0x6b, 0x4c, 0x30, 0x66, 0x4a, 0x75, 0x4d, 0x41, 0x73, 0x61, 0x44, 0x6b, + 0x35, 0x32, 0x37, 0x52, 0x48, 0x38, 0x39, 0x65, 0x6c, 0x57, 0x73, 0x6e, + 0x32, 0x2f, 0x78, 0x32, 0x30, 0x4b, 0x6b, 0x34, 0x79, 0x6c, 0x0a, 0x30, + 0x4d, 0x43, 0x32, 0x48, 0x62, 0x34, 0x36, 0x54, 0x70, 0x53, 0x69, 0x31, + 0x32, 0x35, 0x73, 0x43, 0x38, 0x4b, 0x4b, 0x66, 0x50, 0x6f, 0x67, 0x38, + 0x38, 0x54, 0x6b, 0x35, 0x63, 0x30, 0x4e, 0x71, 0x4d, 0x75, 0x52, 0x6b, + 0x72, 0x46, 0x38, 0x68, 0x65, 0x79, 0x31, 0x46, 0x47, 0x6c, 0x6d, 0x44, + 0x6f, 0x4c, 0x6e, 0x7a, 0x63, 0x37, 0x49, 0x4c, 0x61, 0x5a, 0x52, 0x66, + 0x79, 0x48, 0x42, 0x0a, 0x4e, 0x56, 0x4f, 0x46, 0x42, 0x6b, 0x70, 0x64, + 0x6e, 0x36, 0x32, 0x37, 0x47, 0x31, 0x39, 0x30, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x55, 0x53, 0x45, 0x52, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, + 0x53, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x45, + 0x52, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x55, 0x53, 0x45, 0x52, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x52, 0x53, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x54, 0x68, 0x65, + 0x20, 0x55, 0x53, 0x45, 0x52, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x55, 0x53, 0x45, 0x52, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x52, 0x53, 0x41, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x32, 0x36, 0x34, 0x35, 0x30, 0x39, + 0x33, 0x37, 0x36, 0x34, 0x37, 0x38, 0x31, 0x30, 0x35, 0x38, 0x37, 0x38, + 0x37, 0x35, 0x39, 0x31, 0x38, 0x37, 0x31, 0x36, 0x34, 0x35, 0x36, 0x36, + 0x35, 0x37, 0x38, 0x38, 0x37, 0x31, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x31, 0x62, 0x3a, 0x66, 0x65, 0x3a, 0x36, 0x39, 0x3a, + 0x64, 0x31, 0x3a, 0x39, 0x31, 0x3a, 0x62, 0x37, 0x3a, 0x31, 0x39, 0x3a, + 0x33, 0x33, 0x3a, 0x61, 0x33, 0x3a, 0x37, 0x32, 0x3a, 0x61, 0x38, 0x3a, + 0x30, 0x66, 0x3a, 0x65, 0x31, 0x3a, 0x35, 0x35, 0x3a, 0x65, 0x35, 0x3a, + 0x62, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, + 0x62, 0x3a, 0x38, 0x66, 0x3a, 0x31, 0x62, 0x3a, 0x35, 0x37, 0x3a, 0x33, + 0x33, 0x3a, 0x30, 0x64, 0x3a, 0x62, 0x62, 0x3a, 0x61, 0x32, 0x3a, 0x64, + 0x30, 0x3a, 0x37, 0x61, 0x3a, 0x36, 0x63, 0x3a, 0x35, 0x31, 0x3a, 0x66, + 0x37, 0x3a, 0x30, 0x65, 0x3a, 0x65, 0x39, 0x3a, 0x30, 0x64, 0x3a, 0x64, + 0x61, 0x3a, 0x62, 0x39, 0x3a, 0x61, 0x64, 0x3a, 0x38, 0x65, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x37, 0x3a, + 0x39, 0x33, 0x3a, 0x63, 0x39, 0x3a, 0x62, 0x30, 0x3a, 0x32, 0x66, 0x3a, + 0x64, 0x38, 0x3a, 0x61, 0x61, 0x3a, 0x31, 0x33, 0x3a, 0x65, 0x32, 0x3a, + 0x31, 0x63, 0x3a, 0x33, 0x31, 0x3a, 0x32, 0x32, 0x3a, 0x38, 0x61, 0x3a, + 0x63, 0x63, 0x3a, 0x62, 0x30, 0x3a, 0x38, 0x31, 0x3a, 0x31, 0x39, 0x3a, + 0x36, 0x34, 0x3a, 0x33, 0x62, 0x3a, 0x37, 0x34, 0x3a, 0x39, 0x63, 0x3a, + 0x38, 0x39, 0x3a, 0x38, 0x39, 0x3a, 0x36, 0x34, 0x3a, 0x62, 0x31, 0x3a, + 0x37, 0x34, 0x3a, 0x36, 0x64, 0x3a, 0x34, 0x36, 0x3a, 0x63, 0x33, 0x3a, + 0x64, 0x34, 0x3a, 0x63, 0x62, 0x3a, 0x64, 0x32, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x33, 0x6a, 0x43, 0x43, 0x41, 0x38, 0x61, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x41, 0x66, 0x31, + 0x74, 0x4d, 0x50, 0x79, 0x6a, 0x79, 0x6c, 0x47, 0x6f, 0x47, 0x37, 0x78, + 0x6b, 0x44, 0x6a, 0x55, 0x44, 0x4c, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x77, + 0x46, 0x41, 0x44, 0x43, 0x42, 0x0a, 0x69, 0x44, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x67, 0x54, 0x43, 0x6b, 0x35, 0x6c, 0x64, 0x79, 0x42, 0x4b, 0x5a, 0x58, + 0x4a, 0x7a, 0x5a, 0x58, 0x6b, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x43, 0x30, 0x70, 0x6c, 0x0a, 0x63, + 0x6e, 0x4e, 0x6c, 0x65, 0x53, 0x42, 0x44, 0x61, 0x58, 0x52, 0x35, 0x4d, + 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, + 0x78, 0x56, 0x55, 0x61, 0x47, 0x55, 0x67, 0x56, 0x56, 0x4e, 0x46, 0x55, + 0x6c, 0x52, 0x53, 0x56, 0x56, 0x4e, 0x55, 0x49, 0x45, 0x35, 0x6c, 0x64, + 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, 0x78, 0x4c, 0x6a, 0x41, 0x73, 0x42, + 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x54, 0x4a, 0x56, 0x56, 0x54, + 0x52, 0x56, 0x4a, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x42, 0x53, + 0x55, 0x30, 0x45, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, + 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, + 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, + 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x41, 0x77, 0x0a, 0x4d, 0x6a, 0x41, + 0x78, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, + 0x4e, 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x54, 0x45, 0x34, 0x4d, 0x6a, 0x4d, + 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x69, 0x44, 0x45, + 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x56, 0x56, 0x4d, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, + 0x56, 0x0a, 0x42, 0x41, 0x67, 0x54, 0x43, 0x6b, 0x35, 0x6c, 0x64, 0x79, + 0x42, 0x4b, 0x5a, 0x58, 0x4a, 0x7a, 0x5a, 0x58, 0x6b, 0x78, 0x46, 0x44, + 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x43, 0x30, + 0x70, 0x6c, 0x63, 0x6e, 0x4e, 0x6c, 0x65, 0x53, 0x42, 0x44, 0x61, 0x58, + 0x52, 0x35, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x45, 0x78, 0x56, 0x55, 0x0a, 0x61, 0x47, 0x55, 0x67, 0x56, + 0x56, 0x4e, 0x46, 0x55, 0x6c, 0x52, 0x53, 0x56, 0x56, 0x4e, 0x55, 0x49, + 0x45, 0x35, 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, 0x78, 0x4c, + 0x6a, 0x41, 0x73, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4a, + 0x56, 0x56, 0x54, 0x52, 0x56, 0x4a, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, + 0x43, 0x42, 0x53, 0x55, 0x30, 0x45, 0x67, 0x51, 0x32, 0x56, 0x79, 0x0a, + 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, + 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x64, 0x48, 0x6b, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, + 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, + 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, + 0x67, 0x67, 0x49, 0x4b, 0x0a, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, + 0x41, 0x45, 0x6d, 0x55, 0x58, 0x4e, 0x67, 0x37, 0x44, 0x32, 0x77, 0x69, + 0x7a, 0x30, 0x4b, 0x78, 0x58, 0x44, 0x58, 0x62, 0x74, 0x7a, 0x53, 0x66, + 0x54, 0x54, 0x4b, 0x31, 0x51, 0x67, 0x32, 0x48, 0x69, 0x71, 0x69, 0x42, + 0x4e, 0x43, 0x53, 0x31, 0x6b, 0x43, 0x64, 0x7a, 0x4f, 0x69, 0x5a, 0x2f, + 0x4d, 0x50, 0x61, 0x6e, 0x73, 0x39, 0x73, 0x2f, 0x42, 0x0a, 0x33, 0x50, + 0x48, 0x54, 0x73, 0x64, 0x5a, 0x37, 0x4e, 0x79, 0x67, 0x52, 0x4b, 0x30, + 0x66, 0x61, 0x4f, 0x63, 0x61, 0x38, 0x4f, 0x68, 0x6d, 0x30, 0x58, 0x36, + 0x61, 0x39, 0x66, 0x5a, 0x32, 0x6a, 0x59, 0x30, 0x4b, 0x32, 0x64, 0x76, + 0x4b, 0x70, 0x4f, 0x79, 0x75, 0x52, 0x2b, 0x4f, 0x4a, 0x76, 0x30, 0x4f, + 0x77, 0x57, 0x49, 0x4a, 0x41, 0x4a, 0x50, 0x75, 0x4c, 0x6f, 0x64, 0x4d, + 0x6b, 0x59, 0x0a, 0x74, 0x4a, 0x48, 0x55, 0x59, 0x6d, 0x54, 0x62, 0x66, + 0x36, 0x4d, 0x47, 0x38, 0x59, 0x67, 0x59, 0x61, 0x70, 0x41, 0x69, 0x50, + 0x4c, 0x7a, 0x2b, 0x45, 0x2f, 0x43, 0x48, 0x46, 0x48, 0x76, 0x32, 0x35, + 0x42, 0x2b, 0x4f, 0x31, 0x4f, 0x52, 0x52, 0x78, 0x68, 0x46, 0x6e, 0x52, + 0x67, 0x68, 0x52, 0x79, 0x34, 0x59, 0x55, 0x56, 0x44, 0x2b, 0x38, 0x4d, + 0x2f, 0x35, 0x2b, 0x62, 0x4a, 0x7a, 0x2f, 0x0a, 0x46, 0x70, 0x30, 0x59, + 0x76, 0x56, 0x47, 0x4f, 0x4e, 0x61, 0x61, 0x6e, 0x5a, 0x73, 0x68, 0x79, + 0x5a, 0x39, 0x73, 0x68, 0x5a, 0x72, 0x48, 0x55, 0x6d, 0x33, 0x67, 0x44, + 0x77, 0x46, 0x41, 0x36, 0x36, 0x4d, 0x7a, 0x77, 0x33, 0x4c, 0x79, 0x65, + 0x54, 0x50, 0x36, 0x76, 0x42, 0x5a, 0x59, 0x31, 0x48, 0x31, 0x64, 0x61, + 0x74, 0x2f, 0x2f, 0x4f, 0x2b, 0x54, 0x32, 0x33, 0x4c, 0x4c, 0x62, 0x32, + 0x0a, 0x56, 0x4e, 0x33, 0x49, 0x35, 0x78, 0x49, 0x36, 0x54, 0x61, 0x35, + 0x4d, 0x69, 0x72, 0x64, 0x63, 0x6d, 0x72, 0x53, 0x33, 0x49, 0x44, 0x33, + 0x4b, 0x66, 0x79, 0x49, 0x30, 0x72, 0x6e, 0x34, 0x37, 0x61, 0x47, 0x59, + 0x42, 0x52, 0x4f, 0x63, 0x42, 0x54, 0x6b, 0x5a, 0x54, 0x6d, 0x7a, 0x4e, + 0x67, 0x39, 0x35, 0x53, 0x2b, 0x55, 0x7a, 0x65, 0x51, 0x63, 0x30, 0x50, + 0x7a, 0x4d, 0x73, 0x4e, 0x54, 0x0a, 0x37, 0x39, 0x75, 0x71, 0x2f, 0x6e, + 0x52, 0x4f, 0x61, 0x63, 0x64, 0x72, 0x6a, 0x47, 0x43, 0x54, 0x33, 0x73, + 0x54, 0x48, 0x44, 0x4e, 0x2f, 0x68, 0x4d, 0x71, 0x37, 0x4d, 0x6b, 0x7a, + 0x74, 0x52, 0x65, 0x4a, 0x56, 0x6e, 0x69, 0x2b, 0x34, 0x39, 0x56, 0x76, + 0x34, 0x4d, 0x30, 0x47, 0x6b, 0x50, 0x47, 0x77, 0x2f, 0x7a, 0x4a, 0x53, + 0x5a, 0x72, 0x4d, 0x32, 0x33, 0x33, 0x62, 0x6b, 0x66, 0x36, 0x0a, 0x63, + 0x30, 0x50, 0x6c, 0x66, 0x67, 0x36, 0x6c, 0x5a, 0x72, 0x45, 0x70, 0x66, + 0x44, 0x4b, 0x45, 0x59, 0x31, 0x57, 0x4a, 0x78, 0x41, 0x33, 0x42, 0x6b, + 0x31, 0x51, 0x77, 0x47, 0x52, 0x4f, 0x73, 0x30, 0x33, 0x30, 0x33, 0x70, + 0x2b, 0x74, 0x64, 0x4f, 0x6d, 0x77, 0x31, 0x58, 0x4e, 0x74, 0x42, 0x31, + 0x78, 0x4c, 0x61, 0x71, 0x55, 0x6b, 0x4c, 0x33, 0x39, 0x69, 0x41, 0x69, + 0x67, 0x6d, 0x54, 0x0a, 0x59, 0x6f, 0x36, 0x31, 0x5a, 0x73, 0x38, 0x6c, + 0x69, 0x4d, 0x32, 0x45, 0x75, 0x4c, 0x45, 0x2f, 0x70, 0x44, 0x6b, 0x50, + 0x32, 0x51, 0x4b, 0x65, 0x36, 0x78, 0x4a, 0x4d, 0x6c, 0x58, 0x7a, 0x7a, + 0x61, 0x77, 0x57, 0x70, 0x58, 0x68, 0x61, 0x44, 0x7a, 0x4c, 0x68, 0x6e, + 0x34, 0x75, 0x67, 0x54, 0x6e, 0x63, 0x78, 0x62, 0x67, 0x74, 0x4e, 0x4d, + 0x73, 0x2b, 0x31, 0x62, 0x2f, 0x39, 0x37, 0x6c, 0x0a, 0x63, 0x36, 0x77, + 0x6a, 0x4f, 0x79, 0x30, 0x41, 0x76, 0x7a, 0x56, 0x56, 0x64, 0x41, 0x6c, + 0x4a, 0x32, 0x45, 0x6c, 0x59, 0x47, 0x6e, 0x2b, 0x53, 0x4e, 0x75, 0x5a, + 0x52, 0x6b, 0x67, 0x37, 0x7a, 0x4a, 0x6e, 0x30, 0x63, 0x54, 0x52, 0x65, + 0x38, 0x79, 0x65, 0x78, 0x44, 0x4a, 0x74, 0x43, 0x2f, 0x51, 0x56, 0x39, + 0x41, 0x71, 0x55, 0x52, 0x45, 0x39, 0x4a, 0x6e, 0x6e, 0x56, 0x34, 0x65, + 0x65, 0x0a, 0x55, 0x42, 0x39, 0x58, 0x56, 0x4b, 0x67, 0x2b, 0x2f, 0x58, + 0x52, 0x6a, 0x4c, 0x37, 0x46, 0x51, 0x5a, 0x51, 0x6e, 0x6d, 0x57, 0x45, + 0x49, 0x75, 0x51, 0x78, 0x70, 0x4d, 0x74, 0x50, 0x41, 0x6c, 0x52, 0x31, + 0x6e, 0x36, 0x42, 0x42, 0x36, 0x54, 0x31, 0x43, 0x5a, 0x47, 0x53, 0x6c, + 0x43, 0x42, 0x73, 0x74, 0x36, 0x2b, 0x65, 0x4c, 0x66, 0x38, 0x5a, 0x78, + 0x58, 0x68, 0x79, 0x56, 0x65, 0x45, 0x0a, 0x48, 0x67, 0x39, 0x6a, 0x31, + 0x75, 0x6c, 0x69, 0x75, 0x74, 0x5a, 0x66, 0x56, 0x53, 0x37, 0x71, 0x58, + 0x4d, 0x59, 0x6f, 0x43, 0x41, 0x51, 0x6c, 0x4f, 0x62, 0x67, 0x4f, 0x4b, + 0x36, 0x6e, 0x79, 0x54, 0x4a, 0x63, 0x63, 0x42, 0x7a, 0x38, 0x4e, 0x55, + 0x76, 0x58, 0x74, 0x37, 0x79, 0x2b, 0x43, 0x44, 0x77, 0x49, 0x44, 0x41, + 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x64, 0x0a, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, + 0x55, 0x33, 0x6d, 0x2f, 0x57, 0x71, 0x6f, 0x72, 0x53, 0x73, 0x39, 0x55, + 0x67, 0x4f, 0x48, 0x59, 0x6d, 0x38, 0x43, 0x64, 0x38, 0x72, 0x49, 0x44, + 0x5a, 0x73, 0x73, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, + 0x4d, 0x41, 0x38, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, + 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x4d, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, + 0x42, 0x41, 0x46, 0x7a, 0x55, 0x66, 0x41, 0x33, 0x50, 0x39, 0x77, 0x46, + 0x39, 0x51, 0x5a, 0x6c, 0x6c, 0x44, 0x48, 0x50, 0x46, 0x0a, 0x55, 0x70, + 0x2f, 0x4c, 0x2b, 0x4d, 0x2b, 0x5a, 0x42, 0x6e, 0x38, 0x62, 0x32, 0x6b, + 0x4d, 0x56, 0x6e, 0x35, 0x34, 0x43, 0x56, 0x56, 0x65, 0x57, 0x46, 0x50, + 0x46, 0x53, 0x50, 0x43, 0x65, 0x48, 0x6c, 0x43, 0x6a, 0x74, 0x48, 0x7a, + 0x6f, 0x42, 0x4e, 0x36, 0x4a, 0x32, 0x2f, 0x46, 0x4e, 0x51, 0x77, 0x49, + 0x53, 0x62, 0x78, 0x6d, 0x74, 0x4f, 0x75, 0x6f, 0x77, 0x68, 0x54, 0x36, + 0x4b, 0x4f, 0x0a, 0x56, 0x57, 0x4b, 0x52, 0x38, 0x32, 0x6b, 0x56, 0x32, + 0x4c, 0x79, 0x49, 0x34, 0x38, 0x53, 0x71, 0x43, 0x2f, 0x33, 0x76, 0x71, + 0x4f, 0x6c, 0x4c, 0x56, 0x53, 0x6f, 0x47, 0x49, 0x47, 0x31, 0x56, 0x65, + 0x43, 0x6b, 0x5a, 0x37, 0x6c, 0x38, 0x77, 0x58, 0x45, 0x73, 0x6b, 0x45, + 0x56, 0x58, 0x2f, 0x4a, 0x4a, 0x70, 0x75, 0x58, 0x69, 0x6f, 0x72, 0x37, + 0x67, 0x74, 0x4e, 0x6e, 0x33, 0x2f, 0x33, 0x0a, 0x41, 0x54, 0x69, 0x55, + 0x46, 0x4a, 0x56, 0x44, 0x42, 0x77, 0x6e, 0x37, 0x59, 0x4b, 0x6e, 0x75, + 0x48, 0x4b, 0x73, 0x53, 0x6a, 0x4b, 0x43, 0x61, 0x58, 0x71, 0x65, 0x59, + 0x61, 0x6c, 0x6c, 0x74, 0x69, 0x7a, 0x38, 0x49, 0x2b, 0x38, 0x6a, 0x52, + 0x52, 0x61, 0x38, 0x59, 0x46, 0x57, 0x53, 0x51, 0x45, 0x67, 0x39, 0x7a, + 0x4b, 0x43, 0x37, 0x46, 0x34, 0x69, 0x52, 0x4f, 0x2f, 0x46, 0x6a, 0x73, + 0x0a, 0x38, 0x50, 0x52, 0x46, 0x2f, 0x69, 0x4b, 0x7a, 0x36, 0x79, 0x2b, + 0x4f, 0x30, 0x74, 0x6c, 0x46, 0x59, 0x51, 0x58, 0x42, 0x6c, 0x32, 0x2b, + 0x6f, 0x64, 0x6e, 0x4b, 0x50, 0x69, 0x34, 0x77, 0x32, 0x72, 0x37, 0x38, + 0x4e, 0x42, 0x63, 0x35, 0x78, 0x6a, 0x65, 0x61, 0x6d, 0x62, 0x78, 0x39, + 0x73, 0x70, 0x6e, 0x46, 0x69, 0x78, 0x64, 0x6a, 0x51, 0x67, 0x33, 0x49, + 0x4d, 0x38, 0x57, 0x63, 0x52, 0x0a, 0x69, 0x51, 0x79, 0x63, 0x45, 0x30, + 0x78, 0x79, 0x4e, 0x4e, 0x2b, 0x38, 0x31, 0x58, 0x48, 0x66, 0x71, 0x6e, + 0x48, 0x64, 0x34, 0x62, 0x6c, 0x73, 0x6a, 0x44, 0x77, 0x53, 0x58, 0x57, + 0x58, 0x61, 0x76, 0x56, 0x63, 0x53, 0x74, 0x6b, 0x4e, 0x72, 0x2f, 0x2b, + 0x58, 0x65, 0x54, 0x57, 0x59, 0x52, 0x55, 0x63, 0x2b, 0x5a, 0x72, 0x75, + 0x77, 0x58, 0x74, 0x75, 0x68, 0x78, 0x6b, 0x59, 0x7a, 0x65, 0x0a, 0x53, + 0x66, 0x37, 0x64, 0x4e, 0x58, 0x47, 0x69, 0x46, 0x53, 0x65, 0x55, 0x48, + 0x4d, 0x39, 0x68, 0x34, 0x79, 0x61, 0x37, 0x62, 0x36, 0x4e, 0x6e, 0x4a, + 0x53, 0x46, 0x64, 0x35, 0x74, 0x30, 0x64, 0x43, 0x79, 0x35, 0x6f, 0x47, + 0x7a, 0x75, 0x43, 0x72, 0x2b, 0x79, 0x44, 0x5a, 0x34, 0x58, 0x55, 0x6d, + 0x46, 0x46, 0x30, 0x73, 0x62, 0x6d, 0x5a, 0x67, 0x49, 0x6e, 0x2f, 0x66, + 0x33, 0x67, 0x5a, 0x0a, 0x58, 0x48, 0x6c, 0x4b, 0x59, 0x43, 0x36, 0x53, + 0x51, 0x4b, 0x35, 0x4d, 0x4e, 0x79, 0x6f, 0x73, 0x79, 0x63, 0x64, 0x69, + 0x79, 0x41, 0x35, 0x64, 0x39, 0x7a, 0x5a, 0x62, 0x79, 0x75, 0x41, 0x6c, + 0x4a, 0x51, 0x47, 0x30, 0x33, 0x52, 0x6f, 0x48, 0x6e, 0x48, 0x63, 0x41, + 0x50, 0x39, 0x44, 0x63, 0x31, 0x65, 0x77, 0x39, 0x31, 0x50, 0x71, 0x37, + 0x50, 0x38, 0x79, 0x46, 0x31, 0x6d, 0x39, 0x2f, 0x0a, 0x71, 0x53, 0x33, + 0x66, 0x75, 0x51, 0x4c, 0x33, 0x39, 0x5a, 0x65, 0x61, 0x74, 0x54, 0x58, + 0x61, 0x77, 0x32, 0x65, 0x77, 0x68, 0x30, 0x71, 0x70, 0x4b, 0x4a, 0x34, + 0x6a, 0x6a, 0x76, 0x39, 0x63, 0x4a, 0x32, 0x76, 0x68, 0x73, 0x45, 0x2f, + 0x7a, 0x42, 0x2b, 0x34, 0x41, 0x4c, 0x74, 0x52, 0x5a, 0x68, 0x38, 0x74, + 0x53, 0x51, 0x5a, 0x58, 0x71, 0x39, 0x45, 0x66, 0x58, 0x37, 0x6d, 0x52, + 0x42, 0x0a, 0x56, 0x58, 0x79, 0x4e, 0x57, 0x51, 0x4b, 0x56, 0x33, 0x57, + 0x4b, 0x64, 0x77, 0x72, 0x6e, 0x75, 0x57, 0x69, 0x68, 0x30, 0x68, 0x4b, + 0x57, 0x62, 0x74, 0x35, 0x44, 0x48, 0x44, 0x41, 0x66, 0x66, 0x39, 0x59, + 0x6b, 0x32, 0x64, 0x44, 0x4c, 0x57, 0x4b, 0x4d, 0x47, 0x77, 0x73, 0x41, + 0x76, 0x67, 0x6e, 0x45, 0x7a, 0x44, 0x48, 0x4e, 0x62, 0x38, 0x34, 0x32, + 0x6d, 0x31, 0x52, 0x30, 0x61, 0x42, 0x0a, 0x4c, 0x36, 0x4b, 0x43, 0x71, + 0x39, 0x4e, 0x6a, 0x52, 0x48, 0x44, 0x45, 0x6a, 0x66, 0x38, 0x74, 0x4d, + 0x37, 0x71, 0x74, 0x6a, 0x33, 0x75, 0x31, 0x63, 0x49, 0x69, 0x75, 0x50, + 0x68, 0x6e, 0x50, 0x51, 0x43, 0x6a, 0x59, 0x2f, 0x4d, 0x69, 0x51, 0x75, + 0x31, 0x32, 0x5a, 0x49, 0x76, 0x56, 0x53, 0x35, 0x6c, 0x6a, 0x46, 0x48, + 0x34, 0x67, 0x78, 0x51, 0x2b, 0x36, 0x49, 0x48, 0x64, 0x66, 0x47, 0x0a, + 0x6a, 0x6a, 0x78, 0x44, 0x61, 0x68, 0x32, 0x6e, 0x47, 0x4e, 0x35, 0x39, + 0x50, 0x52, 0x62, 0x78, 0x59, 0x76, 0x6e, 0x4b, 0x6b, 0x4b, 0x6a, 0x39, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x55, 0x53, 0x45, 0x52, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x20, 0x45, 0x43, 0x43, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, 0x3d, 0x54, 0x68, 0x65, + 0x20, 0x55, 0x53, 0x45, 0x52, 0x54, 0x52, 0x55, 0x53, 0x54, 0x20, 0x4e, + 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x55, 0x53, 0x45, + 0x52, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x45, 0x43, 0x43, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x4f, + 0x3d, 0x54, 0x68, 0x65, 0x20, 0x55, 0x53, 0x45, 0x52, 0x54, 0x52, 0x55, + 0x53, 0x54, 0x20, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x55, 0x53, 0x45, + 0x52, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x45, 0x43, 0x43, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x32, + 0x33, 0x30, 0x31, 0x33, 0x38, 0x32, 0x33, 0x37, 0x32, 0x30, 0x31, 0x39, + 0x39, 0x34, 0x38, 0x31, 0x34, 0x35, 0x36, 0x35, 0x36, 0x39, 0x37, 0x32, + 0x30, 0x34, 0x34, 0x33, 0x39, 0x39, 0x37, 0x35, 0x37, 0x32, 0x31, 0x33, + 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x61, 0x3a, + 0x36, 0x38, 0x3a, 0x62, 0x63, 0x3a, 0x64, 0x39, 0x3a, 0x62, 0x35, 0x3a, + 0x37, 0x66, 0x3a, 0x61, 0x64, 0x3a, 0x66, 0x64, 0x3a, 0x63, 0x39, 0x3a, + 0x31, 0x64, 0x3a, 0x30, 0x36, 0x3a, 0x38, 0x33, 0x3a, 0x32, 0x38, 0x3a, + 0x63, 0x63, 0x3a, 0x32, 0x34, 0x3a, 0x63, 0x31, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x31, 0x3a, 0x63, 0x62, 0x3a, 0x63, + 0x61, 0x3a, 0x35, 0x64, 0x3a, 0x62, 0x32, 0x3a, 0x64, 0x35, 0x3a, 0x32, + 0x61, 0x3a, 0x37, 0x66, 0x3a, 0x36, 0x39, 0x3a, 0x33, 0x62, 0x3a, 0x36, + 0x37, 0x3a, 0x34, 0x64, 0x3a, 0x65, 0x35, 0x3a, 0x66, 0x30, 0x3a, 0x35, + 0x61, 0x3a, 0x31, 0x64, 0x3a, 0x30, 0x63, 0x3a, 0x39, 0x35, 0x3a, 0x37, + 0x64, 0x3a, 0x66, 0x30, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x34, 0x66, 0x3a, 0x66, 0x34, 0x3a, 0x36, 0x30, 0x3a, + 0x64, 0x35, 0x3a, 0x34, 0x62, 0x3a, 0x39, 0x63, 0x3a, 0x38, 0x36, 0x3a, + 0x64, 0x61, 0x3a, 0x62, 0x66, 0x3a, 0x62, 0x63, 0x3a, 0x66, 0x63, 0x3a, + 0x35, 0x37, 0x3a, 0x31, 0x32, 0x3a, 0x65, 0x30, 0x3a, 0x34, 0x30, 0x3a, + 0x30, 0x64, 0x3a, 0x32, 0x62, 0x3a, 0x65, 0x64, 0x3a, 0x33, 0x66, 0x3a, + 0x62, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x34, 0x66, 0x3a, 0x62, 0x64, 0x3a, + 0x61, 0x61, 0x3a, 0x38, 0x36, 0x3a, 0x65, 0x30, 0x3a, 0x36, 0x61, 0x3a, + 0x64, 0x63, 0x3a, 0x64, 0x32, 0x3a, 0x61, 0x39, 0x3a, 0x61, 0x64, 0x3a, + 0x37, 0x61, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, + 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6a, + 0x7a, 0x43, 0x43, 0x41, 0x68, 0x57, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, + 0x67, 0x49, 0x51, 0x58, 0x49, 0x75, 0x5a, 0x78, 0x56, 0x71, 0x55, 0x78, + 0x64, 0x4a, 0x78, 0x56, 0x74, 0x37, 0x4e, 0x69, 0x59, 0x44, 0x4d, 0x4a, + 0x6a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, + 0x51, 0x51, 0x44, 0x41, 0x7a, 0x43, 0x42, 0x69, 0x44, 0x45, 0x4c, 0x0a, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x56, 0x56, 0x4d, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x67, 0x54, 0x43, 0x6b, 0x35, 0x6c, 0x64, 0x79, 0x42, 0x4b, + 0x5a, 0x58, 0x4a, 0x7a, 0x5a, 0x58, 0x6b, 0x78, 0x46, 0x44, 0x41, 0x53, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x43, 0x30, 0x70, 0x6c, + 0x63, 0x6e, 0x4e, 0x6c, 0x0a, 0x65, 0x53, 0x42, 0x44, 0x61, 0x58, 0x52, + 0x35, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4b, 0x45, 0x78, 0x56, 0x55, 0x61, 0x47, 0x55, 0x67, 0x56, 0x56, 0x4e, + 0x46, 0x55, 0x6c, 0x52, 0x53, 0x56, 0x56, 0x4e, 0x55, 0x49, 0x45, 0x35, + 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, 0x78, 0x4c, 0x6a, 0x41, + 0x73, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x0a, 0x4a, 0x56, + 0x56, 0x54, 0x52, 0x56, 0x4a, 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, + 0x42, 0x46, 0x51, 0x30, 0x4d, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, + 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, + 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, + 0x6b, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x41, 0x77, 0x4d, 0x6a, + 0x41, 0x78, 0x0a, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, + 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x67, 0x77, 0x4d, 0x54, 0x45, 0x34, 0x4d, + 0x6a, 0x4d, 0x31, 0x4f, 0x54, 0x55, 0x35, 0x57, 0x6a, 0x43, 0x42, 0x69, + 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x0a, 0x43, 0x6b, 0x35, 0x6c, + 0x64, 0x79, 0x42, 0x4b, 0x5a, 0x58, 0x4a, 0x7a, 0x5a, 0x58, 0x6b, 0x78, + 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, + 0x43, 0x30, 0x70, 0x6c, 0x63, 0x6e, 0x4e, 0x6c, 0x65, 0x53, 0x42, 0x44, + 0x61, 0x58, 0x52, 0x35, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x56, 0x55, 0x61, 0x47, 0x55, 0x67, + 0x0a, 0x56, 0x56, 0x4e, 0x46, 0x55, 0x6c, 0x52, 0x53, 0x56, 0x56, 0x4e, + 0x55, 0x49, 0x45, 0x35, 0x6c, 0x64, 0x48, 0x64, 0x76, 0x63, 0x6d, 0x73, + 0x78, 0x4c, 0x6a, 0x41, 0x73, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, + 0x54, 0x4a, 0x56, 0x56, 0x54, 0x52, 0x56, 0x4a, 0x55, 0x63, 0x6e, 0x56, + 0x7a, 0x64, 0x43, 0x42, 0x46, 0x51, 0x30, 0x4d, 0x67, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x0a, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, + 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, + 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x77, 0x64, 0x6a, 0x41, 0x51, 0x42, 0x67, + 0x63, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, 0x67, + 0x55, 0x72, 0x67, 0x51, 0x51, 0x41, 0x49, 0x67, 0x4e, 0x69, 0x41, 0x41, + 0x51, 0x61, 0x72, 0x46, 0x52, 0x61, 0x71, 0x66, 0x6c, 0x6f, 0x0a, 0x49, + 0x2b, 0x64, 0x36, 0x31, 0x53, 0x52, 0x76, 0x55, 0x38, 0x5a, 0x61, 0x32, + 0x45, 0x75, 0x72, 0x78, 0x74, 0x57, 0x32, 0x30, 0x65, 0x5a, 0x7a, 0x63, + 0x61, 0x37, 0x64, 0x6e, 0x4e, 0x59, 0x4d, 0x59, 0x66, 0x33, 0x62, 0x6f, + 0x49, 0x6b, 0x44, 0x75, 0x41, 0x55, 0x55, 0x37, 0x46, 0x66, 0x4f, 0x37, + 0x6c, 0x30, 0x2f, 0x34, 0x69, 0x47, 0x7a, 0x7a, 0x76, 0x66, 0x55, 0x69, + 0x6e, 0x6e, 0x67, 0x0a, 0x6f, 0x34, 0x4e, 0x2b, 0x4c, 0x5a, 0x66, 0x51, + 0x59, 0x63, 0x54, 0x78, 0x6d, 0x64, 0x77, 0x6c, 0x6b, 0x57, 0x4f, 0x72, + 0x66, 0x7a, 0x43, 0x6a, 0x74, 0x48, 0x44, 0x69, 0x78, 0x36, 0x45, 0x7a, + 0x6e, 0x50, 0x4f, 0x2f, 0x4c, 0x6c, 0x78, 0x54, 0x73, 0x56, 0x2b, 0x7a, + 0x66, 0x54, 0x4a, 0x2f, 0x69, 0x6a, 0x54, 0x6a, 0x65, 0x58, 0x6d, 0x6a, + 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x42, 0x30, 0x47, 0x0a, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x51, 0x36, 0x34, 0x51, 0x6d, + 0x47, 0x31, 0x4d, 0x38, 0x5a, 0x77, 0x70, 0x5a, 0x32, 0x64, 0x45, 0x6c, + 0x32, 0x33, 0x4f, 0x41, 0x31, 0x78, 0x6d, 0x4e, 0x6a, 0x6d, 0x6a, 0x41, + 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, + 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, + 0x44, 0x0a, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4b, 0x42, 0x67, + 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x77, + 0x4e, 0x6f, 0x41, 0x44, 0x42, 0x6c, 0x41, 0x6a, 0x41, 0x32, 0x5a, 0x36, + 0x45, 0x57, 0x43, 0x4e, 0x7a, 0x6b, 0x6c, 0x77, 0x42, 0x42, 0x48, 0x55, + 0x36, 0x2b, 0x34, 0x57, 0x4d, 0x42, 0x0a, 0x7a, 0x7a, 0x75, 0x71, 0x51, + 0x68, 0x46, 0x6b, 0x6f, 0x4a, 0x32, 0x55, 0x4f, 0x51, 0x49, 0x52, 0x65, + 0x56, 0x78, 0x37, 0x48, 0x66, 0x70, 0x6b, 0x75, 0x65, 0x34, 0x57, 0x51, + 0x72, 0x4f, 0x2f, 0x69, 0x73, 0x49, 0x4a, 0x78, 0x4f, 0x7a, 0x6b, 0x73, + 0x55, 0x30, 0x43, 0x4d, 0x51, 0x44, 0x70, 0x4b, 0x6d, 0x46, 0x48, 0x6a, + 0x46, 0x4a, 0x4b, 0x53, 0x30, 0x34, 0x59, 0x63, 0x50, 0x62, 0x57, 0x0a, + 0x52, 0x4e, 0x5a, 0x75, 0x39, 0x59, 0x4f, 0x36, 0x62, 0x56, 0x69, 0x39, + 0x4a, 0x4e, 0x6c, 0x57, 0x53, 0x4f, 0x72, 0x76, 0x78, 0x4b, 0x4a, 0x47, + 0x67, 0x59, 0x68, 0x71, 0x4f, 0x6b, 0x62, 0x52, 0x71, 0x5a, 0x74, 0x4e, + 0x79, 0x57, 0x48, 0x61, 0x30, 0x56, 0x31, 0x58, 0x61, 0x68, 0x67, 0x3d, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x34, 0x0a, + 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x34, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x6c, 0x6f, 0x62, 0x61, + 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x34, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, + 0x33, 0x36, 0x37, 0x31, 0x34, 0x38, 0x32, 0x39, 0x34, 0x39, 0x32, 0x32, + 0x39, 0x36, 0x34, 0x34, 0x38, 0x30, 0x38, 0x35, 0x39, 0x30, 0x32, 0x32, + 0x31, 0x32, 0x35, 0x38, 0x30, 0x30, 0x39, 0x37, 0x37, 0x38, 0x39, 0x37, + 0x34, 0x37, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, + 0x30, 0x3a, 0x66, 0x30, 0x3a, 0x32, 0x37, 0x3a, 0x36, 0x38, 0x3a, 0x64, + 0x31, 0x3a, 0x37, 0x65, 0x3a, 0x61, 0x30, 0x3a, 0x39, 0x64, 0x3a, 0x30, + 0x65, 0x3a, 0x65, 0x36, 0x3a, 0x32, 0x61, 0x3a, 0x63, 0x61, 0x3a, 0x64, + 0x66, 0x3a, 0x35, 0x63, 0x3a, 0x38, 0x39, 0x3a, 0x38, 0x65, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x39, 0x3a, 0x36, 0x39, + 0x3a, 0x35, 0x36, 0x3a, 0x32, 0x65, 0x3a, 0x34, 0x30, 0x3a, 0x38, 0x30, + 0x3a, 0x66, 0x34, 0x3a, 0x32, 0x34, 0x3a, 0x61, 0x31, 0x3a, 0x65, 0x37, + 0x3a, 0x31, 0x39, 0x3a, 0x39, 0x66, 0x3a, 0x31, 0x34, 0x3a, 0x62, 0x61, + 0x3a, 0x66, 0x33, 0x3a, 0x65, 0x65, 0x3a, 0x35, 0x38, 0x3a, 0x61, 0x62, + 0x3a, 0x36, 0x61, 0x3a, 0x62, 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x65, 0x3a, 0x63, 0x39, 0x3a, 0x34, + 0x39, 0x3a, 0x31, 0x31, 0x3a, 0x63, 0x32, 0x3a, 0x39, 0x35, 0x3a, 0x35, + 0x36, 0x3a, 0x37, 0x36, 0x3a, 0x64, 0x62, 0x3a, 0x36, 0x63, 0x3a, 0x30, + 0x61, 0x3a, 0x35, 0x35, 0x3a, 0x30, 0x39, 0x3a, 0x38, 0x36, 0x3a, 0x64, + 0x37, 0x3a, 0x36, 0x65, 0x3a, 0x33, 0x62, 0x3a, 0x61, 0x30, 0x3a, 0x30, + 0x35, 0x3a, 0x36, 0x36, 0x3a, 0x37, 0x63, 0x3a, 0x34, 0x34, 0x3a, 0x32, + 0x63, 0x3a, 0x39, 0x37, 0x3a, 0x36, 0x32, 0x3a, 0x62, 0x34, 0x3a, 0x66, + 0x62, 0x3a, 0x62, 0x37, 0x3a, 0x37, 0x33, 0x3a, 0x64, 0x65, 0x3a, 0x32, + 0x32, 0x3a, 0x38, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x42, 0x34, 0x54, 0x43, 0x43, 0x41, 0x59, 0x65, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x52, 0x4b, 0x6a, 0x69, 0x6b, 0x48, 0x4a, 0x59, + 0x4b, 0x42, 0x4e, 0x35, 0x43, 0x73, 0x69, 0x69, 0x6c, 0x43, 0x2b, 0x67, + 0x30, 0x6d, 0x41, 0x49, 0x77, 0x43, 0x67, 0x59, 0x49, 0x4b, 0x6f, 0x5a, + 0x49, 0x7a, 0x6a, 0x30, 0x45, 0x41, 0x77, 0x49, 0x77, 0x55, 0x44, 0x45, + 0x6b, 0x0a, 0x4d, 0x43, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, + 0x4d, 0x62, 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, + 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x46, 0x51, 0x30, 0x4d, 0x67, 0x55, 0x6d, + 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x46, + 0x49, 0x30, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4b, 0x45, 0x77, 0x70, 0x48, 0x0a, 0x62, 0x47, 0x39, 0x69, 0x59, + 0x57, 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x4d, 0x52, 0x4d, 0x77, 0x45, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x77, 0x70, 0x48, 0x62, + 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x4d, + 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x79, 0x4d, 0x54, 0x45, 0x78, 0x4d, + 0x7a, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x0a, + 0x44, 0x54, 0x4d, 0x34, 0x4d, 0x44, 0x45, 0x78, 0x4f, 0x54, 0x41, 0x7a, + 0x4d, 0x54, 0x51, 0x77, 0x4e, 0x31, 0x6f, 0x77, 0x55, 0x44, 0x45, 0x6b, + 0x4d, 0x43, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x62, + 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, + 0x62, 0x69, 0x42, 0x46, 0x51, 0x30, 0x4d, 0x67, 0x55, 0x6d, 0x39, 0x76, + 0x64, 0x43, 0x42, 0x44, 0x0a, 0x51, 0x53, 0x41, 0x74, 0x49, 0x46, 0x49, + 0x30, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4b, 0x45, 0x77, 0x70, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, + 0x54, 0x61, 0x57, 0x64, 0x75, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x77, 0x70, 0x48, 0x62, 0x47, 0x39, + 0x69, 0x59, 0x57, 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x0a, 0x4d, 0x46, + 0x6b, 0x77, 0x45, 0x77, 0x59, 0x48, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, + 0x30, 0x43, 0x41, 0x51, 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, + 0x30, 0x44, 0x41, 0x51, 0x63, 0x44, 0x51, 0x67, 0x41, 0x45, 0x75, 0x4d, + 0x5a, 0x35, 0x30, 0x34, 0x39, 0x73, 0x4a, 0x51, 0x36, 0x66, 0x4c, 0x6a, + 0x6b, 0x5a, 0x48, 0x41, 0x4f, 0x6b, 0x72, 0x70, 0x72, 0x6c, 0x4f, 0x51, + 0x63, 0x4a, 0x0a, 0x46, 0x73, 0x70, 0x6a, 0x73, 0x62, 0x6d, 0x47, 0x2b, + 0x49, 0x70, 0x58, 0x77, 0x56, 0x66, 0x4f, 0x51, 0x76, 0x70, 0x7a, 0x6f, + 0x66, 0x64, 0x6c, 0x51, 0x76, 0x38, 0x65, 0x77, 0x51, 0x43, 0x79, 0x62, + 0x6e, 0x4d, 0x4f, 0x2f, 0x38, 0x63, 0x68, 0x35, 0x52, 0x69, 0x6b, 0x71, + 0x74, 0x6c, 0x78, 0x50, 0x36, 0x6a, 0x55, 0x75, 0x63, 0x36, 0x4d, 0x48, + 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x0a, 0x44, 0x67, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, + 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, + 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x42, 0x42, 0x59, 0x45, 0x46, 0x46, 0x53, 0x77, 0x65, 0x36, 0x31, 0x46, + 0x0a, 0x75, 0x4f, 0x4a, 0x41, 0x66, 0x2f, 0x73, 0x4b, 0x62, 0x76, 0x75, + 0x2b, 0x4d, 0x38, 0x6b, 0x38, 0x6f, 0x34, 0x54, 0x56, 0x4d, 0x41, 0x6f, + 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x30, 0x67, 0x41, 0x4d, 0x45, 0x55, 0x43, 0x49, 0x51, 0x44, + 0x63, 0x6b, 0x71, 0x47, 0x67, 0x45, 0x36, 0x62, 0x50, 0x41, 0x37, 0x44, + 0x6d, 0x78, 0x43, 0x47, 0x58, 0x0a, 0x6b, 0x50, 0x6f, 0x55, 0x56, 0x79, + 0x30, 0x44, 0x37, 0x4f, 0x34, 0x38, 0x30, 0x32, 0x37, 0x4b, 0x71, 0x47, + 0x78, 0x32, 0x76, 0x4b, 0x4c, 0x65, 0x75, 0x77, 0x49, 0x67, 0x4a, 0x36, + 0x69, 0x46, 0x4a, 0x7a, 0x57, 0x62, 0x56, 0x73, 0x61, 0x6a, 0x38, 0x6b, + 0x66, 0x53, 0x74, 0x32, 0x34, 0x62, 0x41, 0x67, 0x41, 0x58, 0x71, 0x6d, + 0x65, 0x6d, 0x46, 0x5a, 0x48, 0x65, 0x2b, 0x70, 0x54, 0x73, 0x0a, 0x65, + 0x77, 0x76, 0x34, 0x6e, 0x34, 0x51, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, + 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x2d, 0x20, 0x52, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x3d, 0x47, 0x6c, + 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x55, 0x3d, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x45, + 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, + 0x20, 0x52, 0x35, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x2d, 0x20, 0x52, 0x35, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x32, 0x37, 0x38, 0x35, 0x37, 0x39, + 0x32, 0x30, 0x39, 0x39, 0x39, 0x39, 0x30, 0x35, 0x30, 0x37, 0x32, 0x32, + 0x36, 0x36, 0x38, 0x30, 0x36, 0x39, 0x38, 0x30, 0x31, 0x31, 0x35, 0x36, + 0x30, 0x39, 0x34, 0x37, 0x39, 0x33, 0x31, 0x32, 0x34, 0x34, 0x0a, 0x23, + 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x66, 0x3a, 0x61, 0x64, 0x3a, + 0x33, 0x62, 0x3a, 0x31, 0x63, 0x3a, 0x30, 0x32, 0x3a, 0x31, 0x65, 0x3a, + 0x38, 0x61, 0x3a, 0x62, 0x61, 0x3a, 0x31, 0x37, 0x3a, 0x37, 0x34, 0x3a, + 0x33, 0x38, 0x3a, 0x38, 0x31, 0x3a, 0x30, 0x63, 0x3a, 0x61, 0x32, 0x3a, + 0x62, 0x63, 0x3a, 0x30, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x31, 0x66, 0x3a, 0x32, 0x34, 0x3a, 0x63, 0x36, 0x3a, 0x33, + 0x30, 0x3a, 0x63, 0x64, 0x3a, 0x61, 0x34, 0x3a, 0x31, 0x38, 0x3a, 0x65, + 0x66, 0x3a, 0x32, 0x30, 0x3a, 0x36, 0x39, 0x3a, 0x66, 0x66, 0x3a, 0x61, + 0x64, 0x3a, 0x34, 0x66, 0x3a, 0x64, 0x64, 0x3a, 0x35, 0x66, 0x3a, 0x34, + 0x36, 0x3a, 0x33, 0x61, 0x3a, 0x31, 0x62, 0x3a, 0x36, 0x39, 0x3a, 0x61, + 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x31, 0x37, 0x3a, 0x39, 0x66, 0x3a, 0x62, 0x63, 0x3a, 0x31, 0x34, 0x3a, + 0x38, 0x61, 0x3a, 0x33, 0x64, 0x3a, 0x64, 0x30, 0x3a, 0x30, 0x66, 0x3a, + 0x64, 0x32, 0x3a, 0x34, 0x65, 0x3a, 0x61, 0x31, 0x3a, 0x33, 0x34, 0x3a, + 0x35, 0x38, 0x3a, 0x63, 0x63, 0x3a, 0x34, 0x33, 0x3a, 0x62, 0x66, 0x3a, + 0x61, 0x37, 0x3a, 0x66, 0x35, 0x3a, 0x39, 0x63, 0x3a, 0x38, 0x31, 0x3a, + 0x38, 0x32, 0x3a, 0x64, 0x37, 0x3a, 0x38, 0x33, 0x3a, 0x61, 0x35, 0x3a, + 0x31, 0x33, 0x3a, 0x66, 0x36, 0x3a, 0x65, 0x62, 0x3a, 0x65, 0x63, 0x3a, + 0x31, 0x30, 0x3a, 0x30, 0x63, 0x3a, 0x38, 0x39, 0x3a, 0x32, 0x34, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x48, 0x6a, 0x43, 0x43, + 0x41, 0x61, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x52, + 0x59, 0x46, 0x6c, 0x4a, 0x34, 0x43, 0x59, 0x75, 0x75, 0x31, 0x58, 0x35, + 0x43, 0x6e, 0x65, 0x4b, 0x63, 0x66, 0x6c, 0x4b, 0x32, 0x47, 0x77, 0x77, + 0x43, 0x67, 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x45, + 0x41, 0x77, 0x4d, 0x77, 0x55, 0x44, 0x45, 0x6b, 0x0a, 0x4d, 0x43, 0x49, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x62, 0x52, 0x32, 0x78, + 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, + 0x46, 0x51, 0x30, 0x4d, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, + 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x46, 0x49, 0x31, 0x4d, 0x52, 0x4d, + 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x70, + 0x48, 0x0a, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x54, 0x61, 0x57, + 0x64, 0x75, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x77, 0x70, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, + 0x45, 0x79, 0x4d, 0x54, 0x45, 0x78, 0x4d, 0x7a, 0x41, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x0a, 0x44, 0x54, 0x4d, 0x34, 0x4d, + 0x44, 0x45, 0x78, 0x4f, 0x54, 0x41, 0x7a, 0x4d, 0x54, 0x51, 0x77, 0x4e, + 0x31, 0x6f, 0x77, 0x55, 0x44, 0x45, 0x6b, 0x4d, 0x43, 0x49, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x62, 0x52, 0x32, 0x78, 0x76, 0x59, + 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x46, 0x51, + 0x30, 0x4d, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x0a, + 0x51, 0x53, 0x41, 0x74, 0x49, 0x46, 0x49, 0x31, 0x4d, 0x52, 0x4d, 0x77, + 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x70, 0x48, + 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, + 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x45, 0x77, 0x70, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, 0x78, 0x54, + 0x61, 0x57, 0x64, 0x75, 0x0a, 0x4d, 0x48, 0x59, 0x77, 0x45, 0x41, 0x59, + 0x48, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x43, 0x41, 0x51, 0x59, + 0x46, 0x4b, 0x34, 0x45, 0x45, 0x41, 0x43, 0x49, 0x44, 0x59, 0x67, 0x41, + 0x45, 0x52, 0x30, 0x55, 0x4f, 0x6c, 0x76, 0x74, 0x39, 0x58, 0x62, 0x2f, + 0x70, 0x4f, 0x64, 0x45, 0x68, 0x2b, 0x4a, 0x38, 0x4c, 0x74, 0x74, 0x56, + 0x37, 0x48, 0x70, 0x49, 0x36, 0x53, 0x46, 0x6b, 0x63, 0x0a, 0x38, 0x47, + 0x49, 0x78, 0x4c, 0x63, 0x42, 0x36, 0x4b, 0x50, 0x34, 0x61, 0x70, 0x31, + 0x79, 0x7a, 0x74, 0x73, 0x79, 0x58, 0x35, 0x30, 0x58, 0x55, 0x57, 0x50, + 0x72, 0x52, 0x64, 0x32, 0x31, 0x44, 0x6f, 0x73, 0x43, 0x48, 0x5a, 0x54, + 0x51, 0x4b, 0x48, 0x33, 0x72, 0x64, 0x36, 0x7a, 0x77, 0x7a, 0x6f, 0x63, + 0x57, 0x64, 0x54, 0x61, 0x52, 0x76, 0x51, 0x5a, 0x55, 0x34, 0x66, 0x38, + 0x6b, 0x65, 0x0a, 0x68, 0x4f, 0x76, 0x52, 0x6e, 0x6b, 0x6d, 0x53, 0x68, + 0x35, 0x53, 0x48, 0x44, 0x44, 0x71, 0x46, 0x53, 0x6d, 0x61, 0x66, 0x6e, + 0x56, 0x6d, 0x54, 0x54, 0x5a, 0x64, 0x68, 0x42, 0x6f, 0x5a, 0x4b, 0x6f, + 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, + 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x0a, 0x56, 0x52, 0x30, 0x54, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, + 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, + 0x46, 0x67, 0x51, 0x55, 0x50, 0x65, 0x59, 0x70, 0x53, 0x4a, 0x76, 0x71, + 0x42, 0x38, 0x6f, 0x68, 0x52, 0x45, 0x6f, 0x6d, 0x33, 0x6d, 0x37, 0x65, + 0x30, 0x6f, 0x50, 0x51, 0x6e, 0x31, 0x6b, 0x77, 0x43, 0x67, 0x59, 0x49, + 0x0a, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x45, 0x41, 0x77, 0x4d, + 0x44, 0x61, 0x41, 0x41, 0x77, 0x5a, 0x51, 0x49, 0x78, 0x41, 0x4f, 0x56, + 0x70, 0x45, 0x73, 0x6c, 0x75, 0x32, 0x38, 0x59, 0x78, 0x75, 0x67, 0x6c, + 0x42, 0x34, 0x5a, 0x66, 0x34, 0x2b, 0x2f, 0x32, 0x61, 0x34, 0x6e, 0x30, + 0x53, 0x79, 0x65, 0x31, 0x38, 0x5a, 0x4e, 0x50, 0x4c, 0x42, 0x53, 0x57, + 0x4c, 0x56, 0x74, 0x6d, 0x67, 0x0a, 0x35, 0x31, 0x35, 0x64, 0x54, 0x67, + 0x75, 0x44, 0x6e, 0x46, 0x74, 0x32, 0x4b, 0x61, 0x41, 0x4a, 0x4a, 0x69, + 0x46, 0x71, 0x59, 0x67, 0x49, 0x77, 0x63, 0x64, 0x4b, 0x31, 0x6a, 0x31, + 0x7a, 0x71, 0x4f, 0x2b, 0x46, 0x34, 0x43, 0x59, 0x57, 0x6f, 0x64, 0x5a, + 0x49, 0x37, 0x79, 0x46, 0x7a, 0x39, 0x53, 0x4f, 0x38, 0x4e, 0x64, 0x43, + 0x4b, 0x6f, 0x43, 0x4f, 0x4a, 0x75, 0x78, 0x55, 0x6e, 0x4f, 0x0a, 0x78, + 0x77, 0x79, 0x38, 0x70, 0x32, 0x46, 0x70, 0x38, 0x66, 0x63, 0x37, 0x34, + 0x53, 0x72, 0x4c, 0x2b, 0x53, 0x76, 0x7a, 0x5a, 0x70, 0x41, 0x33, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, + 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, + 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, + 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, + 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, + 0x65, 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, + 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, + 0x65, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, + 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, + 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, + 0x64, 0x65, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, + 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x33, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x30, 0x30, 0x30, 0x33, 0x30, 0x30, 0x31, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x62, 0x3a, 0x34, 0x36, 0x3a, 0x36, 0x37, + 0x3a, 0x30, 0x37, 0x3a, 0x64, 0x62, 0x3a, 0x31, 0x30, 0x3a, 0x32, 0x66, + 0x3a, 0x31, 0x39, 0x3a, 0x38, 0x63, 0x3a, 0x33, 0x35, 0x3a, 0x35, 0x30, + 0x3a, 0x36, 0x30, 0x3a, 0x64, 0x31, 0x3a, 0x30, 0x62, 0x3a, 0x66, 0x34, + 0x3a, 0x33, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x64, 0x38, 0x3a, 0x65, 0x62, 0x3a, 0x36, 0x62, 0x3a, 0x34, 0x31, 0x3a, + 0x35, 0x31, 0x3a, 0x39, 0x32, 0x3a, 0x35, 0x39, 0x3a, 0x65, 0x30, 0x3a, + 0x66, 0x33, 0x3a, 0x65, 0x37, 0x3a, 0x38, 0x35, 0x3a, 0x30, 0x30, 0x3a, + 0x63, 0x30, 0x3a, 0x33, 0x64, 0x3a, 0x62, 0x36, 0x3a, 0x38, 0x38, 0x3a, + 0x39, 0x37, 0x3a, 0x63, 0x39, 0x3a, 0x65, 0x65, 0x3a, 0x66, 0x63, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x63, + 0x3a, 0x34, 0x66, 0x3a, 0x62, 0x30, 0x3a, 0x62, 0x39, 0x3a, 0x35, 0x61, + 0x3a, 0x62, 0x38, 0x3a, 0x62, 0x33, 0x3a, 0x30, 0x30, 0x3a, 0x33, 0x32, + 0x3a, 0x66, 0x34, 0x3a, 0x33, 0x32, 0x3a, 0x62, 0x38, 0x3a, 0x36, 0x66, + 0x3a, 0x35, 0x33, 0x3a, 0x35, 0x66, 0x3a, 0x65, 0x31, 0x3a, 0x37, 0x32, + 0x3a, 0x63, 0x31, 0x3a, 0x38, 0x35, 0x3a, 0x64, 0x30, 0x3a, 0x66, 0x64, + 0x3a, 0x33, 0x39, 0x3a, 0x38, 0x36, 0x3a, 0x35, 0x38, 0x3a, 0x33, 0x37, + 0x3a, 0x63, 0x66, 0x3a, 0x33, 0x36, 0x3a, 0x31, 0x38, 0x3a, 0x37, 0x66, + 0x3a, 0x61, 0x36, 0x3a, 0x66, 0x34, 0x3a, 0x32, 0x38, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x64, 0x44, 0x43, 0x43, 0x41, 0x31, + 0x79, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, 0x41, 0x4a, + 0x69, 0x69, 0x4f, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, + 0x42, 0x61, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4f, 0x0a, 0x54, 0x44, 0x45, 0x65, 0x4d, + 0x42, 0x77, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x56, 0x55, + 0x33, 0x52, 0x68, 0x59, 0x58, 0x51, 0x67, 0x5a, 0x47, 0x56, 0x79, 0x49, + 0x45, 0x35, 0x6c, 0x5a, 0x47, 0x56, 0x79, 0x62, 0x47, 0x46, 0x75, 0x5a, + 0x47, 0x56, 0x75, 0x4d, 0x53, 0x73, 0x77, 0x4b, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x44, 0x44, 0x43, 0x4a, 0x54, 0x64, 0x47, 0x46, 0x68, 0x0a, + 0x64, 0x43, 0x42, 0x6b, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x6d, 0x56, 0x6b, + 0x5a, 0x58, 0x4a, 0x73, 0x59, 0x57, 0x35, 0x6b, 0x5a, 0x57, 0x34, 0x67, + 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, + 0x49, 0x45, 0x63, 0x7a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x7a, + 0x4d, 0x54, 0x45, 0x78, 0x4e, 0x44, 0x45, 0x78, 0x4d, 0x6a, 0x67, 0x30, + 0x4d, 0x6c, 0x6f, 0x58, 0x0a, 0x44, 0x54, 0x49, 0x34, 0x4d, 0x54, 0x45, + 0x78, 0x4d, 0x7a, 0x49, 0x7a, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, + 0x77, 0x57, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x54, 0x6b, 0x77, 0x78, 0x48, 0x6a, 0x41, + 0x63, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x46, 0x56, 0x4e, + 0x30, 0x59, 0x57, 0x46, 0x30, 0x49, 0x47, 0x52, 0x6c, 0x0a, 0x63, 0x69, + 0x42, 0x4f, 0x5a, 0x57, 0x52, 0x6c, 0x63, 0x6d, 0x78, 0x68, 0x62, 0x6d, + 0x52, 0x6c, 0x62, 0x6a, 0x45, 0x72, 0x4d, 0x43, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x41, 0x77, 0x77, 0x69, 0x55, 0x33, 0x52, 0x68, 0x59, 0x58, + 0x51, 0x67, 0x5a, 0x47, 0x56, 0x79, 0x49, 0x45, 0x35, 0x6c, 0x5a, 0x47, + 0x56, 0x79, 0x62, 0x47, 0x46, 0x75, 0x5a, 0x47, 0x56, 0x75, 0x49, 0x46, + 0x4a, 0x76, 0x0a, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, + 0x53, 0x42, 0x48, 0x4d, 0x7a, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, + 0x44, 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, + 0x4c, 0x34, 0x79, 0x6f, 0x6c, 0x51, 0x50, 0x0a, 0x63, 0x50, 0x73, 0x73, + 0x58, 0x46, 0x6e, 0x72, 0x62, 0x4d, 0x53, 0x6b, 0x55, 0x65, 0x69, 0x46, + 0x4b, 0x72, 0x50, 0x4d, 0x53, 0x6a, 0x54, 0x79, 0x73, 0x46, 0x2f, 0x7a, + 0x44, 0x73, 0x63, 0x63, 0x50, 0x56, 0x4d, 0x65, 0x69, 0x41, 0x68, 0x6f, + 0x32, 0x47, 0x38, 0x39, 0x72, 0x63, 0x4b, 0x65, 0x7a, 0x49, 0x4a, 0x6e, + 0x42, 0x79, 0x65, 0x48, 0x61, 0x48, 0x45, 0x36, 0x6e, 0x33, 0x57, 0x57, + 0x0a, 0x49, 0x6b, 0x59, 0x46, 0x73, 0x4f, 0x32, 0x74, 0x78, 0x31, 0x75, + 0x65, 0x4b, 0x74, 0x36, 0x63, 0x2f, 0x44, 0x72, 0x47, 0x6c, 0x61, 0x66, + 0x31, 0x46, 0x32, 0x63, 0x59, 0x35, 0x79, 0x39, 0x4a, 0x43, 0x41, 0x78, + 0x63, 0x7a, 0x2b, 0x62, 0x4d, 0x4e, 0x4f, 0x31, 0x34, 0x2b, 0x31, 0x43, + 0x78, 0x33, 0x47, 0x73, 0x79, 0x38, 0x4b, 0x4c, 0x2b, 0x74, 0x6a, 0x7a, + 0x6b, 0x37, 0x46, 0x71, 0x58, 0x0a, 0x78, 0x7a, 0x38, 0x65, 0x63, 0x41, + 0x67, 0x77, 0x6f, 0x4e, 0x7a, 0x46, 0x73, 0x32, 0x31, 0x76, 0x30, 0x49, + 0x4a, 0x79, 0x45, 0x61, 0x76, 0x53, 0x67, 0x57, 0x68, 0x5a, 0x67, 0x68, + 0x65, 0x33, 0x65, 0x4a, 0x4a, 0x67, 0x2b, 0x73, 0x7a, 0x65, 0x50, 0x34, + 0x54, 0x72, 0x6a, 0x54, 0x67, 0x7a, 0x6b, 0x41, 0x70, 0x79, 0x49, 0x2f, + 0x6f, 0x31, 0x7a, 0x43, 0x5a, 0x78, 0x4d, 0x64, 0x46, 0x79, 0x0a, 0x4b, + 0x4a, 0x4c, 0x5a, 0x57, 0x79, 0x4e, 0x74, 0x5a, 0x72, 0x56, 0x74, 0x42, + 0x30, 0x4c, 0x72, 0x70, 0x6a, 0x50, 0x4f, 0x6b, 0x74, 0x76, 0x41, 0x39, + 0x6d, 0x78, 0x6a, 0x65, 0x4d, 0x33, 0x4b, 0x54, 0x6a, 0x32, 0x31, 0x35, + 0x56, 0x4b, 0x62, 0x38, 0x62, 0x34, 0x37, 0x35, 0x6c, 0x52, 0x67, 0x73, + 0x47, 0x59, 0x65, 0x43, 0x61, 0x73, 0x48, 0x2f, 0x6c, 0x53, 0x4a, 0x45, + 0x55, 0x4c, 0x52, 0x0a, 0x39, 0x79, 0x53, 0x36, 0x59, 0x48, 0x67, 0x61, + 0x6d, 0x50, 0x66, 0x4a, 0x45, 0x66, 0x30, 0x57, 0x77, 0x54, 0x55, 0x61, + 0x56, 0x48, 0x58, 0x76, 0x51, 0x39, 0x50, 0x6c, 0x72, 0x6b, 0x37, 0x4f, + 0x35, 0x33, 0x76, 0x44, 0x78, 0x6b, 0x35, 0x68, 0x55, 0x55, 0x75, 0x72, + 0x6d, 0x6b, 0x56, 0x4c, 0x6f, 0x52, 0x39, 0x42, 0x76, 0x55, 0x68, 0x54, + 0x46, 0x58, 0x46, 0x6b, 0x43, 0x34, 0x61, 0x7a, 0x0a, 0x35, 0x53, 0x36, + 0x2b, 0x7a, 0x71, 0x51, 0x62, 0x77, 0x53, 0x6d, 0x45, 0x6f, 0x72, 0x58, + 0x4c, 0x43, 0x43, 0x4e, 0x32, 0x51, 0x79, 0x49, 0x6b, 0x48, 0x78, 0x63, + 0x45, 0x31, 0x47, 0x36, 0x63, 0x78, 0x76, 0x78, 0x2f, 0x4b, 0x32, 0x59, + 0x61, 0x37, 0x49, 0x72, 0x6c, 0x31, 0x73, 0x39, 0x4e, 0x39, 0x57, 0x4d, + 0x4a, 0x74, 0x78, 0x55, 0x35, 0x31, 0x6e, 0x75, 0x73, 0x36, 0x2b, 0x4e, + 0x38, 0x0a, 0x36, 0x55, 0x37, 0x38, 0x64, 0x55, 0x4c, 0x49, 0x37, 0x56, + 0x69, 0x56, 0x44, 0x41, 0x5a, 0x43, 0x6f, 0x70, 0x7a, 0x33, 0x35, 0x48, + 0x43, 0x7a, 0x33, 0x33, 0x4a, 0x76, 0x57, 0x6a, 0x64, 0x41, 0x69, 0x64, + 0x69, 0x46, 0x70, 0x4e, 0x66, 0x78, 0x43, 0x39, 0x35, 0x44, 0x47, 0x64, + 0x52, 0x4b, 0x57, 0x43, 0x79, 0x4d, 0x69, 0x6a, 0x6d, 0x65, 0x76, 0x34, + 0x53, 0x48, 0x38, 0x52, 0x59, 0x37, 0x0a, 0x4e, 0x67, 0x7a, 0x70, 0x30, + 0x37, 0x54, 0x4b, 0x62, 0x42, 0x6c, 0x42, 0x55, 0x67, 0x6d, 0x68, 0x48, + 0x62, 0x42, 0x71, 0x76, 0x34, 0x4c, 0x76, 0x63, 0x46, 0x45, 0x68, 0x4d, + 0x74, 0x77, 0x46, 0x64, 0x6f, 0x7a, 0x4c, 0x39, 0x32, 0x54, 0x6b, 0x41, + 0x31, 0x43, 0x76, 0x6a, 0x4a, 0x46, 0x6e, 0x71, 0x38, 0x58, 0x79, 0x37, + 0x6c, 0x6a, 0x59, 0x33, 0x72, 0x37, 0x33, 0x35, 0x7a, 0x48, 0x50, 0x0a, + 0x62, 0x4d, 0x6b, 0x37, 0x63, 0x63, 0x48, 0x56, 0x69, 0x4c, 0x56, 0x6c, + 0x76, 0x4d, 0x44, 0x6f, 0x46, 0x78, 0x63, 0x48, 0x45, 0x72, 0x56, 0x63, + 0x30, 0x71, 0x73, 0x67, 0x6b, 0x37, 0x54, 0x6d, 0x67, 0x6f, 0x4e, 0x77, + 0x4e, 0x73, 0x58, 0x4e, 0x6f, 0x34, 0x32, 0x74, 0x69, 0x2b, 0x79, 0x6a, + 0x77, 0x55, 0x4f, 0x48, 0x35, 0x6b, 0x50, 0x69, 0x4e, 0x4c, 0x36, 0x56, + 0x69, 0x7a, 0x58, 0x74, 0x0a, 0x42, 0x7a, 0x6e, 0x61, 0x71, 0x42, 0x31, + 0x36, 0x6e, 0x7a, 0x61, 0x65, 0x45, 0x72, 0x41, 0x4d, 0x5a, 0x52, 0x4b, + 0x51, 0x46, 0x57, 0x44, 0x5a, 0x4a, 0x6b, 0x42, 0x45, 0x34, 0x31, 0x5a, + 0x67, 0x70, 0x52, 0x44, 0x55, 0x61, 0x6a, 0x7a, 0x39, 0x51, 0x64, 0x77, + 0x4f, 0x57, 0x6b, 0x65, 0x32, 0x37, 0x35, 0x64, 0x68, 0x64, 0x55, 0x2f, + 0x5a, 0x2f, 0x73, 0x65, 0x79, 0x48, 0x64, 0x54, 0x74, 0x0a, 0x58, 0x55, + 0x6d, 0x7a, 0x71, 0x57, 0x72, 0x4c, 0x5a, 0x6f, 0x51, 0x54, 0x31, 0x56, + 0x79, 0x67, 0x33, 0x4e, 0x39, 0x75, 0x64, 0x77, 0x62, 0x52, 0x63, 0x58, + 0x58, 0x49, 0x56, 0x32, 0x2b, 0x76, 0x44, 0x33, 0x64, 0x62, 0x41, 0x67, + 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, + 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, + 0x51, 0x46, 0x0a, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, + 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, + 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, + 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x55, 0x72, + 0x66, 0x72, 0x48, 0x6b, 0x6c, 0x65, 0x75, 0x79, 0x6a, 0x57, 0x63, 0x4c, + 0x68, 0x4c, 0x37, 0x35, 0x4c, 0x70, 0x64, 0x0a, 0x49, 0x4e, 0x79, 0x55, + 0x56, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, + 0x41, 0x67, 0x45, 0x41, 0x4d, 0x4a, 0x6d, 0x64, 0x42, 0x54, 0x4c, 0x49, + 0x58, 0x67, 0x34, 0x37, 0x6d, 0x41, 0x45, 0x36, 0x69, 0x71, 0x54, 0x6e, + 0x42, 0x2f, 0x64, 0x36, 0x2b, 0x4f, 0x65, 0x61, 0x33, 0x31, 0x42, 0x44, + 0x0a, 0x55, 0x35, 0x63, 0x71, 0x50, 0x63, 0x6f, 0x38, 0x52, 0x35, 0x67, + 0x75, 0x34, 0x52, 0x56, 0x37, 0x38, 0x5a, 0x4c, 0x7a, 0x59, 0x64, 0x71, + 0x51, 0x4a, 0x52, 0x5a, 0x6c, 0x77, 0x4a, 0x39, 0x55, 0x58, 0x51, 0x34, + 0x44, 0x4f, 0x31, 0x74, 0x33, 0x41, 0x70, 0x79, 0x45, 0x74, 0x67, 0x32, + 0x59, 0x58, 0x7a, 0x54, 0x64, 0x4f, 0x32, 0x50, 0x43, 0x77, 0x79, 0x69, + 0x42, 0x77, 0x70, 0x77, 0x70, 0x0a, 0x4c, 0x69, 0x6e, 0x69, 0x79, 0x4d, + 0x4d, 0x42, 0x38, 0x6a, 0x50, 0x71, 0x4b, 0x71, 0x72, 0x4d, 0x43, 0x51, + 0x6a, 0x33, 0x5a, 0x57, 0x66, 0x47, 0x7a, 0x64, 0x2f, 0x54, 0x74, 0x69, + 0x75, 0x6e, 0x76, 0x63, 0x7a, 0x52, 0x44, 0x6e, 0x42, 0x66, 0x75, 0x43, + 0x50, 0x52, 0x79, 0x35, 0x46, 0x4f, 0x43, 0x76, 0x54, 0x49, 0x65, 0x75, + 0x58, 0x5a, 0x59, 0x7a, 0x62, 0x42, 0x31, 0x4e, 0x2f, 0x38, 0x0a, 0x49, + 0x70, 0x66, 0x33, 0x59, 0x46, 0x33, 0x71, 0x4b, 0x53, 0x39, 0x59, 0x73, + 0x72, 0x31, 0x59, 0x76, 0x59, 0x32, 0x57, 0x54, 0x78, 0x42, 0x31, 0x76, + 0x30, 0x68, 0x37, 0x50, 0x56, 0x47, 0x48, 0x6f, 0x54, 0x78, 0x30, 0x49, + 0x73, 0x4c, 0x38, 0x42, 0x33, 0x2b, 0x41, 0x33, 0x4d, 0x53, 0x73, 0x2f, + 0x6d, 0x72, 0x42, 0x63, 0x44, 0x43, 0x77, 0x36, 0x59, 0x35, 0x70, 0x34, + 0x69, 0x78, 0x70, 0x0a, 0x67, 0x5a, 0x51, 0x4a, 0x75, 0x74, 0x33, 0x2b, + 0x54, 0x63, 0x43, 0x44, 0x6a, 0x4a, 0x52, 0x59, 0x77, 0x45, 0x59, 0x67, + 0x72, 0x35, 0x77, 0x66, 0x41, 0x76, 0x67, 0x31, 0x56, 0x55, 0x6b, 0x76, + 0x52, 0x74, 0x54, 0x41, 0x38, 0x4b, 0x43, 0x57, 0x41, 0x67, 0x38, 0x7a, + 0x78, 0x58, 0x48, 0x7a, 0x6e, 0x69, 0x4e, 0x39, 0x6c, 0x4c, 0x66, 0x39, + 0x4f, 0x74, 0x4d, 0x4a, 0x67, 0x77, 0x59, 0x68, 0x0a, 0x2f, 0x57, 0x41, + 0x39, 0x72, 0x6a, 0x4c, 0x41, 0x30, 0x75, 0x36, 0x4e, 0x70, 0x76, 0x44, + 0x6e, 0x74, 0x49, 0x4a, 0x38, 0x43, 0x73, 0x78, 0x77, 0x79, 0x58, 0x6d, + 0x41, 0x2b, 0x50, 0x35, 0x4d, 0x39, 0x7a, 0x57, 0x45, 0x47, 0x59, 0x6f, + 0x78, 0x2b, 0x77, 0x72, 0x5a, 0x31, 0x33, 0x2b, 0x62, 0x38, 0x4b, 0x4b, + 0x61, 0x61, 0x38, 0x4d, 0x46, 0x53, 0x75, 0x31, 0x42, 0x59, 0x42, 0x51, + 0x77, 0x0a, 0x30, 0x61, 0x6f, 0x52, 0x51, 0x6d, 0x37, 0x54, 0x49, 0x77, + 0x49, 0x45, 0x43, 0x38, 0x5a, 0x6c, 0x33, 0x64, 0x31, 0x53, 0x64, 0x39, + 0x71, 0x42, 0x61, 0x37, 0x4b, 0x6f, 0x2b, 0x67, 0x45, 0x34, 0x75, 0x5a, + 0x62, 0x71, 0x4b, 0x6d, 0x78, 0x6e, 0x6c, 0x34, 0x6d, 0x55, 0x6e, 0x72, + 0x7a, 0x68, 0x56, 0x4e, 0x58, 0x6b, 0x61, 0x6e, 0x6a, 0x76, 0x53, 0x72, + 0x30, 0x72, 0x6d, 0x6a, 0x31, 0x41, 0x0a, 0x66, 0x73, 0x62, 0x41, 0x64, + 0x64, 0x4a, 0x75, 0x2b, 0x32, 0x67, 0x77, 0x37, 0x4f, 0x79, 0x4c, 0x6e, + 0x66, 0x6c, 0x4a, 0x4e, 0x5a, 0x6f, 0x61, 0x4c, 0x4e, 0x6d, 0x7a, 0x6c, + 0x54, 0x6e, 0x56, 0x48, 0x70, 0x4c, 0x33, 0x70, 0x72, 0x6c, 0x6c, 0x4c, + 0x2b, 0x55, 0x39, 0x62, 0x54, 0x70, 0x49, 0x54, 0x41, 0x6a, 0x63, 0x35, + 0x43, 0x67, 0x53, 0x4b, 0x4c, 0x35, 0x39, 0x4e, 0x56, 0x7a, 0x71, 0x0a, + 0x34, 0x42, 0x5a, 0x2b, 0x45, 0x78, 0x74, 0x71, 0x31, 0x7a, 0x37, 0x58, + 0x6e, 0x76, 0x77, 0x74, 0x64, 0x62, 0x4c, 0x42, 0x46, 0x4e, 0x55, 0x6a, + 0x41, 0x39, 0x74, 0x62, 0x62, 0x77, 0x73, 0x2b, 0x65, 0x43, 0x38, 0x4e, + 0x33, 0x6a, 0x4f, 0x4e, 0x46, 0x72, 0x64, 0x49, 0x35, 0x34, 0x4f, 0x61, + 0x67, 0x51, 0x39, 0x37, 0x77, 0x55, 0x4e, 0x4e, 0x56, 0x51, 0x51, 0x58, + 0x4f, 0x45, 0x70, 0x52, 0x0a, 0x31, 0x56, 0x6d, 0x69, 0x69, 0x58, 0x54, + 0x54, 0x6e, 0x37, 0x34, 0x65, 0x53, 0x39, 0x66, 0x47, 0x62, 0x62, 0x65, + 0x49, 0x4a, 0x47, 0x39, 0x67, 0x6b, 0x61, 0x53, 0x43, 0x68, 0x56, 0x74, + 0x57, 0x51, 0x62, 0x7a, 0x51, 0x52, 0x4b, 0x74, 0x71, 0x45, 0x37, 0x37, + 0x52, 0x4c, 0x46, 0x69, 0x33, 0x45, 0x6a, 0x4e, 0x59, 0x73, 0x6a, 0x64, + 0x6a, 0x33, 0x42, 0x50, 0x31, 0x6c, 0x42, 0x30, 0x2f, 0x0a, 0x51, 0x46, + 0x48, 0x31, 0x54, 0x2f, 0x55, 0x36, 0x37, 0x63, 0x6a, 0x46, 0x36, 0x38, + 0x49, 0x65, 0x48, 0x52, 0x61, 0x56, 0x65, 0x73, 0x64, 0x2b, 0x51, 0x6e, + 0x47, 0x54, 0x62, 0x6b, 0x73, 0x56, 0x74, 0x7a, 0x44, 0x66, 0x71, 0x75, + 0x31, 0x58, 0x68, 0x55, 0x69, 0x73, 0x48, 0x57, 0x72, 0x64, 0x4f, 0x57, + 0x6e, 0x6b, 0x34, 0x58, 0x6c, 0x34, 0x76, 0x73, 0x34, 0x46, 0x76, 0x36, + 0x45, 0x4d, 0x0a, 0x39, 0x34, 0x42, 0x37, 0x49, 0x57, 0x63, 0x6e, 0x4d, + 0x46, 0x6b, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, 0x61, 0x61, + 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, + 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, + 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, + 0x6e, 0x64, 0x65, 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, + 0x20, 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, + 0x6e, 0x64, 0x65, 0x6e, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, + 0x64, 0x65, 0x72, 0x20, 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, + 0x64, 0x65, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x53, 0x74, 0x61, 0x61, 0x74, 0x20, 0x64, 0x65, 0x72, 0x20, + 0x4e, 0x65, 0x64, 0x65, 0x72, 0x6c, 0x61, 0x6e, 0x64, 0x65, 0x6e, 0x20, + 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x30, + 0x30, 0x30, 0x30, 0x30, 0x31, 0x33, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x66, 0x63, 0x3a, 0x30, 0x36, 0x3a, 0x61, 0x66, 0x3a, 0x37, + 0x62, 0x3a, 0x65, 0x38, 0x3a, 0x31, 0x61, 0x3a, 0x66, 0x31, 0x3a, 0x39, + 0x61, 0x3a, 0x62, 0x34, 0x3a, 0x65, 0x38, 0x3a, 0x64, 0x32, 0x3a, 0x37, + 0x30, 0x3a, 0x31, 0x66, 0x3a, 0x63, 0x30, 0x3a, 0x66, 0x35, 0x3a, 0x62, + 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x36, + 0x3a, 0x65, 0x32, 0x3a, 0x37, 0x65, 0x3a, 0x63, 0x31, 0x3a, 0x34, 0x66, + 0x3a, 0x64, 0x62, 0x3a, 0x38, 0x32, 0x3a, 0x63, 0x31, 0x3a, 0x63, 0x30, + 0x3a, 0x61, 0x36, 0x3a, 0x37, 0x35, 0x3a, 0x62, 0x35, 0x3a, 0x30, 0x35, + 0x3a, 0x62, 0x65, 0x3a, 0x33, 0x64, 0x3a, 0x32, 0x39, 0x3a, 0x62, 0x34, + 0x3a, 0x65, 0x64, 0x3a, 0x64, 0x62, 0x3a, 0x62, 0x62, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x64, 0x3a, 0x32, + 0x34, 0x3a, 0x39, 0x31, 0x3a, 0x34, 0x31, 0x3a, 0x34, 0x63, 0x3a, 0x66, + 0x65, 0x3a, 0x39, 0x35, 0x3a, 0x36, 0x37, 0x3a, 0x34, 0x36, 0x3a, 0x65, + 0x63, 0x3a, 0x34, 0x63, 0x3a, 0x65, 0x66, 0x3a, 0x61, 0x36, 0x3a, 0x63, + 0x66, 0x3a, 0x36, 0x66, 0x3a, 0x37, 0x32, 0x3a, 0x65, 0x32, 0x3a, 0x38, + 0x61, 0x3a, 0x31, 0x33, 0x3a, 0x32, 0x39, 0x3a, 0x34, 0x33, 0x3a, 0x32, + 0x66, 0x3a, 0x39, 0x64, 0x3a, 0x38, 0x61, 0x3a, 0x39, 0x30, 0x3a, 0x37, + 0x61, 0x3a, 0x63, 0x34, 0x3a, 0x63, 0x62, 0x3a, 0x35, 0x64, 0x3a, 0x61, + 0x64, 0x3a, 0x63, 0x31, 0x3a, 0x35, 0x61, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x46, 0x63, 0x44, 0x43, 0x43, 0x41, 0x31, 0x69, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, 0x41, 0x4a, 0x69, 0x57, + 0x6a, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x59, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x4f, 0x0a, 0x54, 0x44, 0x45, 0x65, 0x4d, 0x42, 0x77, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x56, 0x55, 0x33, 0x52, + 0x68, 0x59, 0x58, 0x51, 0x67, 0x5a, 0x47, 0x56, 0x79, 0x49, 0x45, 0x35, + 0x6c, 0x5a, 0x47, 0x56, 0x79, 0x62, 0x47, 0x46, 0x75, 0x5a, 0x47, 0x56, + 0x75, 0x4d, 0x53, 0x6b, 0x77, 0x4a, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x44, 0x44, 0x43, 0x42, 0x54, 0x64, 0x47, 0x46, 0x68, 0x0a, 0x64, 0x43, + 0x42, 0x6b, 0x5a, 0x58, 0x49, 0x67, 0x54, 0x6d, 0x56, 0x6b, 0x5a, 0x58, + 0x4a, 0x73, 0x59, 0x57, 0x35, 0x6b, 0x5a, 0x57, 0x34, 0x67, 0x52, 0x56, + 0x59, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, 0x44, 0x45, 0x79, 0x4d, 0x44, + 0x67, 0x78, 0x4d, 0x54, 0x45, 0x35, 0x4d, 0x6a, 0x6c, 0x61, 0x46, 0x77, + 0x30, 0x79, 0x0a, 0x4d, 0x6a, 0x45, 0x79, 0x4d, 0x44, 0x67, 0x78, 0x4d, + 0x54, 0x45, 0x77, 0x4d, 0x6a, 0x68, 0x61, 0x4d, 0x46, 0x67, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x35, 0x4d, 0x4d, 0x52, 0x34, 0x77, 0x48, 0x41, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x44, 0x42, 0x56, 0x54, 0x64, 0x47, 0x46, 0x68, 0x64, + 0x43, 0x42, 0x6b, 0x5a, 0x58, 0x49, 0x67, 0x0a, 0x54, 0x6d, 0x56, 0x6b, + 0x5a, 0x58, 0x4a, 0x73, 0x59, 0x57, 0x35, 0x6b, 0x5a, 0x57, 0x34, 0x78, + 0x4b, 0x54, 0x41, 0x6e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, + 0x49, 0x46, 0x4e, 0x30, 0x59, 0x57, 0x46, 0x30, 0x49, 0x47, 0x52, 0x6c, + 0x63, 0x69, 0x42, 0x4f, 0x5a, 0x57, 0x52, 0x6c, 0x63, 0x6d, 0x78, 0x68, + 0x62, 0x6d, 0x52, 0x6c, 0x62, 0x69, 0x42, 0x46, 0x56, 0x69, 0x42, 0x53, + 0x0a, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x49, 0x49, + 0x43, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, + 0x43, 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, + 0x43, 0x41, 0x67, 0x45, 0x41, 0x34, 0x38, 0x64, 0x2b, 0x69, 0x66, 0x6b, + 0x6b, 0x53, 0x7a, 0x72, 0x53, 0x0a, 0x4d, 0x34, 0x4d, 0x31, 0x4c, 0x47, + 0x6e, 0x73, 0x33, 0x41, 0x6d, 0x6b, 0x34, 0x31, 0x47, 0x6f, 0x4a, 0x53, + 0x74, 0x35, 0x75, 0x41, 0x67, 0x39, 0x34, 0x4a, 0x47, 0x36, 0x68, 0x49, + 0x58, 0x47, 0x68, 0x61, 0x54, 0x4b, 0x35, 0x73, 0x6b, 0x75, 0x55, 0x36, + 0x54, 0x4a, 0x4a, 0x42, 0x37, 0x39, 0x56, 0x57, 0x5a, 0x78, 0x58, 0x53, + 0x7a, 0x46, 0x59, 0x47, 0x67, 0x45, 0x74, 0x39, 0x6e, 0x43, 0x0a, 0x55, + 0x69, 0x59, 0x34, 0x69, 0x4b, 0x54, 0x57, 0x4f, 0x30, 0x43, 0x6d, 0x77, + 0x73, 0x30, 0x2f, 0x7a, 0x5a, 0x69, 0x54, 0x73, 0x31, 0x51, 0x55, 0x57, + 0x4a, 0x5a, 0x56, 0x31, 0x56, 0x44, 0x2b, 0x68, 0x71, 0x32, 0x6b, 0x59, + 0x33, 0x39, 0x63, 0x68, 0x2f, 0x61, 0x4f, 0x35, 0x69, 0x65, 0x53, 0x5a, + 0x78, 0x65, 0x53, 0x41, 0x67, 0x4d, 0x73, 0x33, 0x4e, 0x5a, 0x6d, 0x64, + 0x4f, 0x33, 0x64, 0x0a, 0x5a, 0x2f, 0x2f, 0x42, 0x59, 0x59, 0x31, 0x6a, + 0x54, 0x77, 0x2b, 0x62, 0x62, 0x52, 0x63, 0x77, 0x4a, 0x75, 0x2b, 0x72, + 0x30, 0x68, 0x38, 0x51, 0x6f, 0x50, 0x6e, 0x46, 0x66, 0x78, 0x5a, 0x70, + 0x67, 0x51, 0x4e, 0x48, 0x37, 0x52, 0x35, 0x6f, 0x6a, 0x58, 0x4b, 0x68, + 0x54, 0x62, 0x49, 0x6d, 0x78, 0x72, 0x70, 0x73, 0x58, 0x32, 0x33, 0x57, + 0x72, 0x39, 0x47, 0x78, 0x45, 0x34, 0x36, 0x70, 0x0a, 0x72, 0x66, 0x4e, + 0x65, 0x61, 0x58, 0x55, 0x6d, 0x47, 0x44, 0x35, 0x42, 0x4b, 0x79, 0x46, + 0x2f, 0x37, 0x6f, 0x74, 0x64, 0x42, 0x77, 0x61, 0x64, 0x51, 0x38, 0x51, + 0x70, 0x43, 0x69, 0x76, 0x38, 0x4b, 0x6a, 0x36, 0x47, 0x79, 0x7a, 0x79, + 0x44, 0x4f, 0x76, 0x6e, 0x4a, 0x44, 0x64, 0x72, 0x46, 0x6d, 0x65, 0x4b, + 0x38, 0x65, 0x45, 0x45, 0x7a, 0x64, 0x75, 0x47, 0x2f, 0x4c, 0x31, 0x33, + 0x6c, 0x0a, 0x70, 0x4a, 0x68, 0x51, 0x44, 0x42, 0x58, 0x64, 0x34, 0x50, + 0x71, 0x63, 0x66, 0x7a, 0x68, 0x6f, 0x30, 0x4c, 0x4b, 0x6d, 0x65, 0x71, + 0x66, 0x52, 0x4d, 0x62, 0x31, 0x2b, 0x69, 0x6c, 0x67, 0x6e, 0x51, 0x37, + 0x4f, 0x36, 0x4d, 0x35, 0x48, 0x54, 0x70, 0x35, 0x67, 0x56, 0x58, 0x4a, + 0x72, 0x6d, 0x30, 0x77, 0x39, 0x31, 0x32, 0x66, 0x78, 0x42, 0x6d, 0x4a, + 0x63, 0x2b, 0x71, 0x69, 0x58, 0x62, 0x0a, 0x6a, 0x35, 0x49, 0x75, 0x73, + 0x48, 0x73, 0x4d, 0x58, 0x2f, 0x46, 0x6a, 0x71, 0x54, 0x66, 0x35, 0x6d, + 0x33, 0x56, 0x70, 0x54, 0x43, 0x67, 0x6d, 0x4a, 0x64, 0x72, 0x56, 0x38, + 0x68, 0x4a, 0x77, 0x52, 0x56, 0x58, 0x6a, 0x33, 0x33, 0x4e, 0x65, 0x4e, + 0x2f, 0x55, 0x68, 0x62, 0x4a, 0x43, 0x4f, 0x4e, 0x56, 0x72, 0x4a, 0x30, + 0x79, 0x50, 0x72, 0x30, 0x38, 0x43, 0x2b, 0x65, 0x4b, 0x78, 0x43, 0x0a, + 0x4b, 0x46, 0x68, 0x6d, 0x70, 0x55, 0x5a, 0x74, 0x63, 0x41, 0x4c, 0x58, + 0x45, 0x50, 0x6c, 0x4c, 0x56, 0x50, 0x78, 0x64, 0x68, 0x6b, 0x71, 0x48, + 0x7a, 0x33, 0x2f, 0x4b, 0x52, 0x61, 0x77, 0x52, 0x57, 0x72, 0x55, 0x67, + 0x55, 0x59, 0x30, 0x76, 0x69, 0x45, 0x65, 0x58, 0x4f, 0x63, 0x44, 0x50, + 0x75, 0x73, 0x42, 0x43, 0x41, 0x55, 0x43, 0x5a, 0x53, 0x43, 0x45, 0x4c, + 0x61, 0x36, 0x66, 0x53, 0x0a, 0x2f, 0x5a, 0x62, 0x56, 0x30, 0x62, 0x35, + 0x47, 0x6e, 0x55, 0x6e, 0x67, 0x43, 0x36, 0x61, 0x67, 0x49, 0x6b, 0x34, + 0x34, 0x30, 0x4d, 0x45, 0x38, 0x4d, 0x4c, 0x78, 0x77, 0x6a, 0x79, 0x78, + 0x31, 0x7a, 0x4e, 0x44, 0x46, 0x6a, 0x46, 0x45, 0x37, 0x50, 0x5a, 0x51, + 0x49, 0x5a, 0x43, 0x5a, 0x68, 0x66, 0x62, 0x6e, 0x44, 0x5a, 0x59, 0x38, + 0x55, 0x6e, 0x43, 0x48, 0x51, 0x71, 0x76, 0x30, 0x58, 0x0a, 0x63, 0x67, + 0x4f, 0x50, 0x76, 0x5a, 0x75, 0x4d, 0x35, 0x6c, 0x35, 0x54, 0x6e, 0x72, + 0x6d, 0x64, 0x37, 0x34, 0x4b, 0x37, 0x34, 0x62, 0x7a, 0x69, 0x63, 0x6b, + 0x46, 0x62, 0x49, 0x5a, 0x54, 0x54, 0x52, 0x54, 0x65, 0x55, 0x30, 0x64, + 0x38, 0x4a, 0x4f, 0x56, 0x33, 0x6e, 0x49, 0x36, 0x71, 0x61, 0x48, 0x63, + 0x70, 0x74, 0x71, 0x41, 0x71, 0x47, 0x68, 0x59, 0x71, 0x43, 0x76, 0x6b, + 0x49, 0x48, 0x0a, 0x31, 0x76, 0x49, 0x34, 0x67, 0x6e, 0x50, 0x61, 0x68, + 0x31, 0x76, 0x6c, 0x50, 0x4e, 0x4f, 0x65, 0x50, 0x71, 0x63, 0x37, 0x6e, + 0x76, 0x51, 0x44, 0x73, 0x2f, 0x6e, 0x78, 0x66, 0x52, 0x4e, 0x30, 0x41, + 0x76, 0x2b, 0x37, 0x6f, 0x65, 0x58, 0x36, 0x41, 0x48, 0x6b, 0x63, 0x70, + 0x6d, 0x5a, 0x42, 0x69, 0x46, 0x78, 0x67, 0x56, 0x36, 0x59, 0x75, 0x43, + 0x63, 0x53, 0x36, 0x2f, 0x5a, 0x72, 0x50, 0x0a, 0x70, 0x78, 0x39, 0x41, + 0x77, 0x37, 0x76, 0x4d, 0x57, 0x67, 0x70, 0x56, 0x53, 0x7a, 0x73, 0x34, + 0x64, 0x6c, 0x47, 0x34, 0x59, 0x34, 0x75, 0x45, 0x6c, 0x42, 0x62, 0x6d, + 0x56, 0x76, 0x4d, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, + 0x4d, 0x45, 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, + 0x0a, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, + 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, + 0x45, 0x46, 0x50, 0x36, 0x72, 0x41, 0x4a, 0x43, 0x59, 0x6e, 0x69, 0x54, + 0x38, 0x71, 0x63, 0x77, 0x61, 0x69, 0x76, 0x73, 0x6e, 0x75, 0x4c, 0x38, + 0x77, 0x62, 0x71, 0x67, 0x37, 0x0a, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, 0x51, 0x44, 0x50, 0x64, 0x79, + 0x78, 0x75, 0x56, 0x72, 0x35, 0x4f, 0x73, 0x37, 0x61, 0x45, 0x41, 0x4a, + 0x53, 0x72, 0x52, 0x38, 0x6b, 0x4e, 0x30, 0x6e, 0x62, 0x48, 0x68, 0x70, + 0x38, 0x64, 0x42, 0x39, 0x4f, 0x32, 0x74, 0x4c, 0x73, 0x49, 0x0a, 0x65, + 0x4b, 0x39, 0x70, 0x30, 0x67, 0x74, 0x4a, 0x33, 0x6a, 0x50, 0x46, 0x72, + 0x4b, 0x33, 0x43, 0x69, 0x41, 0x4a, 0x39, 0x42, 0x72, 0x63, 0x31, 0x41, + 0x73, 0x46, 0x67, 0x79, 0x62, 0x2f, 0x45, 0x36, 0x4a, 0x54, 0x65, 0x31, + 0x4e, 0x4f, 0x70, 0x45, 0x79, 0x56, 0x61, 0x2f, 0x6d, 0x36, 0x69, 0x72, + 0x6e, 0x30, 0x46, 0x33, 0x48, 0x33, 0x7a, 0x62, 0x50, 0x42, 0x2b, 0x70, + 0x6f, 0x33, 0x75, 0x0a, 0x32, 0x64, 0x66, 0x4f, 0x57, 0x42, 0x66, 0x6f, + 0x71, 0x53, 0x6d, 0x75, 0x63, 0x30, 0x69, 0x48, 0x35, 0x35, 0x76, 0x4b, + 0x62, 0x69, 0x6d, 0x68, 0x5a, 0x46, 0x38, 0x5a, 0x45, 0x2f, 0x65, 0x75, + 0x42, 0x68, 0x44, 0x2f, 0x55, 0x63, 0x61, 0x62, 0x54, 0x56, 0x55, 0x6c, + 0x54, 0x35, 0x4f, 0x5a, 0x45, 0x41, 0x46, 0x54, 0x64, 0x66, 0x45, 0x54, + 0x7a, 0x73, 0x65, 0x6d, 0x51, 0x55, 0x48, 0x53, 0x0a, 0x76, 0x34, 0x69, + 0x6c, 0x66, 0x30, 0x58, 0x38, 0x72, 0x4c, 0x69, 0x6c, 0x74, 0x54, 0x4d, + 0x4d, 0x67, 0x73, 0x54, 0x37, 0x42, 0x2f, 0x5a, 0x71, 0x35, 0x53, 0x57, + 0x45, 0x58, 0x77, 0x62, 0x4b, 0x77, 0x59, 0x59, 0x35, 0x45, 0x64, 0x74, + 0x59, 0x7a, 0x58, 0x63, 0x37, 0x4c, 0x4d, 0x4a, 0x4d, 0x44, 0x31, 0x36, + 0x61, 0x34, 0x2f, 0x43, 0x72, 0x50, 0x6d, 0x45, 0x62, 0x55, 0x43, 0x54, + 0x43, 0x0a, 0x77, 0x50, 0x54, 0x78, 0x47, 0x66, 0x41, 0x52, 0x4b, 0x62, + 0x61, 0x6c, 0x47, 0x41, 0x4b, 0x62, 0x31, 0x32, 0x4e, 0x4d, 0x63, 0x49, + 0x78, 0x48, 0x6f, 0x77, 0x4e, 0x44, 0x58, 0x4c, 0x6c, 0x64, 0x52, 0x71, + 0x41, 0x4e, 0x62, 0x2f, 0x39, 0x5a, 0x6a, 0x72, 0x37, 0x64, 0x6e, 0x33, + 0x4c, 0x44, 0x57, 0x79, 0x76, 0x66, 0x6a, 0x46, 0x76, 0x4f, 0x35, 0x51, + 0x78, 0x47, 0x62, 0x4a, 0x4b, 0x79, 0x0a, 0x43, 0x71, 0x4e, 0x4d, 0x56, + 0x45, 0x49, 0x59, 0x46, 0x52, 0x49, 0x59, 0x76, 0x64, 0x72, 0x38, 0x75, + 0x6e, 0x52, 0x75, 0x2f, 0x38, 0x47, 0x32, 0x6f, 0x47, 0x54, 0x59, 0x71, + 0x56, 0x39, 0x56, 0x72, 0x70, 0x39, 0x63, 0x61, 0x6e, 0x61, 0x57, 0x32, + 0x48, 0x4e, 0x6e, 0x68, 0x2f, 0x74, 0x4e, 0x66, 0x31, 0x7a, 0x75, 0x61, + 0x63, 0x70, 0x7a, 0x45, 0x50, 0x75, 0x4b, 0x71, 0x66, 0x32, 0x65, 0x0a, + 0x76, 0x54, 0x59, 0x34, 0x53, 0x55, 0x6d, 0x48, 0x39, 0x41, 0x34, 0x55, + 0x38, 0x4f, 0x6d, 0x48, 0x75, 0x44, 0x2b, 0x6e, 0x54, 0x33, 0x70, 0x61, + 0x6a, 0x6e, 0x6e, 0x55, 0x6b, 0x2b, 0x53, 0x37, 0x61, 0x46, 0x4b, 0x45, + 0x72, 0x47, 0x7a, 0x70, 0x38, 0x35, 0x68, 0x77, 0x56, 0x58, 0x49, 0x79, + 0x2b, 0x54, 0x53, 0x72, 0x4b, 0x30, 0x6d, 0x31, 0x7a, 0x53, 0x42, 0x69, + 0x35, 0x44, 0x70, 0x36, 0x0a, 0x5a, 0x32, 0x4f, 0x72, 0x6c, 0x74, 0x78, + 0x74, 0x72, 0x70, 0x66, 0x73, 0x2f, 0x4a, 0x39, 0x32, 0x56, 0x6f, 0x67, + 0x75, 0x5a, 0x73, 0x39, 0x62, 0x74, 0x73, 0x6d, 0x6b, 0x73, 0x4e, 0x63, + 0x46, 0x75, 0x75, 0x45, 0x6e, 0x4c, 0x35, 0x4f, 0x37, 0x4a, 0x69, 0x71, + 0x69, 0x6b, 0x37, 0x41, 0x62, 0x38, 0x34, 0x36, 0x2b, 0x48, 0x55, 0x43, + 0x6a, 0x75, 0x54, 0x61, 0x50, 0x50, 0x6f, 0x49, 0x61, 0x0a, 0x47, 0x6c, + 0x36, 0x49, 0x36, 0x6c, 0x44, 0x34, 0x57, 0x65, 0x4b, 0x44, 0x52, 0x69, + 0x6b, 0x4c, 0x34, 0x30, 0x52, 0x63, 0x34, 0x5a, 0x57, 0x32, 0x61, 0x5a, + 0x43, 0x61, 0x46, 0x47, 0x2b, 0x58, 0x72, 0x6f, 0x48, 0x50, 0x61, 0x4f, + 0x2b, 0x5a, 0x6d, 0x72, 0x36, 0x31, 0x35, 0x2b, 0x46, 0x2f, 0x2b, 0x50, + 0x6f, 0x54, 0x52, 0x78, 0x5a, 0x4d, 0x7a, 0x47, 0x30, 0x49, 0x51, 0x4f, + 0x65, 0x4c, 0x0a, 0x65, 0x47, 0x39, 0x51, 0x67, 0x6b, 0x52, 0x51, 0x50, + 0x32, 0x59, 0x47, 0x69, 0x71, 0x74, 0x44, 0x68, 0x46, 0x5a, 0x4b, 0x44, + 0x79, 0x41, 0x74, 0x68, 0x67, 0x37, 0x31, 0x30, 0x74, 0x76, 0x53, 0x65, + 0x6f, 0x70, 0x4c, 0x7a, 0x61, 0x58, 0x6f, 0x54, 0x76, 0x46, 0x65, 0x4a, + 0x69, 0x55, 0x42, 0x57, 0x53, 0x4f, 0x67, 0x66, 0x74, 0x4c, 0x32, 0x66, + 0x69, 0x46, 0x58, 0x31, 0x79, 0x65, 0x38, 0x0a, 0x46, 0x56, 0x64, 0x4d, + 0x70, 0x45, 0x62, 0x42, 0x34, 0x49, 0x4d, 0x65, 0x44, 0x45, 0x78, 0x4e, + 0x48, 0x30, 0x38, 0x47, 0x47, 0x65, 0x4c, 0x35, 0x71, 0x50, 0x51, 0x36, + 0x67, 0x71, 0x47, 0x79, 0x65, 0x55, 0x4e, 0x35, 0x31, 0x71, 0x31, 0x76, + 0x65, 0x69, 0x65, 0x51, 0x41, 0x36, 0x54, 0x71, 0x4a, 0x49, 0x63, 0x2f, + 0x32, 0x62, 0x33, 0x5a, 0x36, 0x66, 0x4a, 0x66, 0x55, 0x45, 0x6b, 0x63, + 0x0a, 0x37, 0x75, 0x7a, 0x58, 0x4c, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x49, 0x64, 0x65, 0x6e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x49, + 0x64, 0x65, 0x6e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x49, + 0x64, 0x65, 0x6e, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x43, 0x6f, 0x6d, + 0x6d, 0x65, 0x72, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x49, 0x64, 0x65, 0x6e, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x49, 0x64, 0x65, 0x6e, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x63, 0x69, 0x61, 0x6c, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x33, + 0x32, 0x39, 0x38, 0x38, 0x32, 0x31, 0x30, 0x33, 0x34, 0x39, 0x34, 0x36, + 0x33, 0x34, 0x32, 0x33, 0x39, 0x30, 0x35, 0x32, 0x30, 0x30, 0x30, 0x33, + 0x38, 0x37, 0x37, 0x37, 0x39, 0x36, 0x38, 0x33, 0x39, 0x34, 0x32, 0x36, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x33, 0x3a, 0x33, + 0x65, 0x3a, 0x37, 0x37, 0x3a, 0x37, 0x33, 0x3a, 0x37, 0x35, 0x3a, 0x65, + 0x65, 0x3a, 0x61, 0x30, 0x3a, 0x64, 0x33, 0x3a, 0x65, 0x33, 0x3a, 0x37, + 0x65, 0x3a, 0x34, 0x39, 0x3a, 0x36, 0x33, 0x3a, 0x34, 0x39, 0x3a, 0x35, + 0x39, 0x3a, 0x62, 0x62, 0x3a, 0x63, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x66, 0x3a, 0x37, 0x31, 0x3a, 0x37, 0x65, + 0x3a, 0x61, 0x61, 0x3a, 0x34, 0x61, 0x3a, 0x64, 0x39, 0x3a, 0x34, 0x65, + 0x3a, 0x63, 0x39, 0x3a, 0x35, 0x35, 0x3a, 0x38, 0x34, 0x3a, 0x39, 0x39, + 0x3a, 0x36, 0x30, 0x3a, 0x32, 0x64, 0x3a, 0x34, 0x38, 0x3a, 0x64, 0x65, + 0x3a, 0x35, 0x66, 0x3a, 0x62, 0x63, 0x3a, 0x66, 0x30, 0x3a, 0x33, 0x61, + 0x3a, 0x32, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x35, 0x64, 0x3a, 0x35, 0x36, 0x3a, 0x34, 0x39, 0x3a, 0x39, + 0x62, 0x3a, 0x65, 0x34, 0x3a, 0x64, 0x32, 0x3a, 0x65, 0x30, 0x3a, 0x38, + 0x62, 0x3a, 0x63, 0x66, 0x3a, 0x63, 0x61, 0x3a, 0x64, 0x30, 0x3a, 0x38, + 0x61, 0x3a, 0x33, 0x65, 0x3a, 0x33, 0x38, 0x3a, 0x37, 0x32, 0x3a, 0x33, + 0x64, 0x3a, 0x35, 0x30, 0x3a, 0x35, 0x30, 0x3a, 0x33, 0x62, 0x3a, 0x64, + 0x65, 0x3a, 0x37, 0x30, 0x3a, 0x36, 0x39, 0x3a, 0x34, 0x38, 0x3a, 0x65, + 0x34, 0x3a, 0x32, 0x66, 0x3a, 0x35, 0x35, 0x3a, 0x36, 0x30, 0x3a, 0x33, + 0x30, 0x3a, 0x31, 0x39, 0x3a, 0x65, 0x35, 0x3a, 0x32, 0x38, 0x3a, 0x61, + 0x65, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x59, 0x44, + 0x43, 0x43, 0x41, 0x30, 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x51, 0x43, 0x67, 0x46, 0x43, 0x67, 0x41, 0x41, 0x41, 0x41, 0x55, + 0x55, 0x6a, 0x79, 0x45, 0x53, 0x31, 0x41, 0x41, 0x41, 0x41, 0x41, 0x6a, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x4b, 0x0a, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4a, 0x53, 0x57, 0x52, 0x6c, 0x62, + 0x6c, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x53, 0x63, 0x77, 0x4a, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x35, 0x4a, 0x5a, + 0x47, 0x56, 0x75, 0x0a, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, + 0x51, 0x32, 0x39, 0x74, 0x62, 0x57, 0x56, 0x79, 0x59, 0x32, 0x6c, 0x68, + 0x62, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, + 0x49, 0x44, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x51, 0x77, + 0x4d, 0x54, 0x45, 0x32, 0x4d, 0x54, 0x67, 0x78, 0x4d, 0x6a, 0x49, 0x7a, + 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x51, 0x77, 0x0a, 0x4d, 0x54, 0x45, + 0x32, 0x4d, 0x54, 0x67, 0x78, 0x4d, 0x6a, 0x49, 0x7a, 0x57, 0x6a, 0x42, + 0x4b, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x53, 0x4d, 0x42, 0x41, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4a, 0x53, 0x57, 0x52, + 0x6c, 0x62, 0x6c, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x53, 0x63, + 0x77, 0x0a, 0x4a, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, + 0x35, 0x4a, 0x5a, 0x47, 0x56, 0x75, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, + 0x51, 0x67, 0x51, 0x32, 0x39, 0x74, 0x62, 0x57, 0x56, 0x79, 0x59, 0x32, + 0x6c, 0x68, 0x62, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x42, 0x49, 0x44, 0x45, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, + 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x0a, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, + 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, + 0x51, 0x43, 0x6e, 0x55, 0x42, 0x6e, 0x65, 0x50, 0x35, 0x6b, 0x39, 0x31, + 0x44, 0x4e, 0x47, 0x38, 0x57, 0x39, 0x52, 0x59, 0x59, 0x4b, 0x79, 0x71, + 0x55, 0x2b, 0x50, 0x5a, 0x34, 0x6c, 0x64, 0x68, 0x4e, 0x6c, 0x54, 0x0a, + 0x33, 0x51, 0x77, 0x6f, 0x32, 0x64, 0x66, 0x77, 0x2f, 0x36, 0x36, 0x56, + 0x51, 0x33, 0x4b, 0x5a, 0x2b, 0x62, 0x56, 0x64, 0x66, 0x49, 0x72, 0x42, + 0x51, 0x75, 0x45, 0x78, 0x55, 0x48, 0x54, 0x52, 0x67, 0x51, 0x31, 0x38, + 0x7a, 0x5a, 0x73, 0x68, 0x71, 0x30, 0x50, 0x69, 0x72, 0x4b, 0x31, 0x65, + 0x68, 0x6d, 0x37, 0x7a, 0x43, 0x59, 0x6f, 0x66, 0x57, 0x6a, 0x4b, 0x39, + 0x6f, 0x75, 0x75, 0x55, 0x0a, 0x2b, 0x65, 0x68, 0x63, 0x43, 0x75, 0x7a, + 0x2f, 0x6d, 0x4e, 0x4b, 0x76, 0x63, 0x62, 0x4f, 0x30, 0x55, 0x35, 0x39, + 0x4f, 0x68, 0x2b, 0x2b, 0x53, 0x76, 0x4c, 0x33, 0x73, 0x54, 0x7a, 0x49, + 0x77, 0x69, 0x45, 0x73, 0x58, 0x58, 0x6c, 0x66, 0x45, 0x55, 0x38, 0x4c, + 0x32, 0x41, 0x70, 0x65, 0x4e, 0x32, 0x57, 0x49, 0x72, 0x76, 0x79, 0x51, + 0x66, 0x59, 0x6f, 0x33, 0x66, 0x77, 0x37, 0x67, 0x70, 0x0a, 0x53, 0x30, + 0x6c, 0x34, 0x50, 0x4a, 0x4e, 0x67, 0x69, 0x43, 0x4c, 0x38, 0x6d, 0x64, + 0x6f, 0x32, 0x79, 0x4d, 0x4b, 0x69, 0x31, 0x43, 0x78, 0x55, 0x41, 0x47, + 0x63, 0x31, 0x62, 0x6e, 0x4f, 0x2f, 0x41, 0x6c, 0x6a, 0x77, 0x70, 0x4e, + 0x33, 0x6c, 0x73, 0x4b, 0x49, 0x6d, 0x65, 0x73, 0x72, 0x67, 0x4e, 0x71, + 0x55, 0x5a, 0x46, 0x76, 0x58, 0x39, 0x74, 0x2b, 0x2b, 0x75, 0x50, 0x30, + 0x44, 0x31, 0x0a, 0x62, 0x56, 0x6f, 0x45, 0x2f, 0x63, 0x34, 0x30, 0x79, + 0x69, 0x54, 0x63, 0x64, 0x43, 0x4d, 0x62, 0x58, 0x54, 0x4d, 0x54, 0x45, + 0x6c, 0x33, 0x45, 0x41, 0x53, 0x58, 0x32, 0x4d, 0x4e, 0x30, 0x43, 0x58, + 0x5a, 0x2f, 0x67, 0x31, 0x55, 0x65, 0x39, 0x74, 0x4f, 0x73, 0x62, 0x6f, + 0x62, 0x74, 0x4a, 0x53, 0x64, 0x69, 0x66, 0x57, 0x77, 0x4c, 0x7a, 0x69, + 0x75, 0x51, 0x6b, 0x6b, 0x4f, 0x52, 0x69, 0x0a, 0x54, 0x30, 0x2f, 0x42, + 0x72, 0x34, 0x73, 0x4f, 0x64, 0x42, 0x65, 0x6f, 0x30, 0x58, 0x4b, 0x49, + 0x61, 0x6e, 0x6f, 0x42, 0x53, 0x63, 0x79, 0x30, 0x52, 0x6e, 0x6e, 0x47, + 0x46, 0x37, 0x48, 0x61, 0x6d, 0x42, 0x34, 0x48, 0x57, 0x66, 0x70, 0x31, + 0x49, 0x59, 0x56, 0x6c, 0x33, 0x5a, 0x42, 0x57, 0x7a, 0x76, 0x75, 0x72, + 0x70, 0x57, 0x43, 0x64, 0x78, 0x4a, 0x33, 0x35, 0x55, 0x72, 0x43, 0x4c, + 0x0a, 0x76, 0x59, 0x66, 0x35, 0x6a, 0x79, 0x73, 0x6a, 0x43, 0x69, 0x4e, + 0x32, 0x4f, 0x2f, 0x63, 0x7a, 0x34, 0x63, 0x6b, 0x41, 0x38, 0x32, 0x6e, + 0x35, 0x53, 0x36, 0x4c, 0x67, 0x54, 0x72, 0x78, 0x2b, 0x6b, 0x7a, 0x6d, + 0x45, 0x42, 0x2f, 0x64, 0x45, 0x63, 0x48, 0x37, 0x2b, 0x42, 0x31, 0x72, + 0x6c, 0x73, 0x61, 0x7a, 0x52, 0x47, 0x4d, 0x7a, 0x79, 0x4e, 0x65, 0x56, + 0x4a, 0x53, 0x51, 0x6a, 0x4b, 0x0a, 0x56, 0x73, 0x6b, 0x39, 0x2b, 0x77, + 0x38, 0x59, 0x66, 0x59, 0x73, 0x37, 0x77, 0x52, 0x50, 0x43, 0x54, 0x59, + 0x2f, 0x4a, 0x54, 0x77, 0x34, 0x33, 0x36, 0x52, 0x2b, 0x68, 0x44, 0x6d, + 0x72, 0x66, 0x59, 0x69, 0x37, 0x4c, 0x4e, 0x51, 0x5a, 0x52, 0x65, 0x53, + 0x7a, 0x49, 0x4a, 0x54, 0x6a, 0x30, 0x2b, 0x6b, 0x75, 0x6e, 0x69, 0x56, + 0x79, 0x63, 0x30, 0x75, 0x4d, 0x4e, 0x4f, 0x59, 0x5a, 0x4b, 0x0a, 0x64, + 0x48, 0x7a, 0x56, 0x57, 0x59, 0x66, 0x43, 0x50, 0x30, 0x34, 0x4d, 0x58, + 0x46, 0x4c, 0x30, 0x50, 0x66, 0x64, 0x53, 0x67, 0x76, 0x48, 0x71, 0x6f, + 0x36, 0x7a, 0x39, 0x53, 0x54, 0x51, 0x61, 0x4b, 0x50, 0x4e, 0x42, 0x69, + 0x44, 0x6f, 0x54, 0x37, 0x75, 0x6a, 0x65, 0x2f, 0x35, 0x6b, 0x64, 0x58, + 0x37, 0x72, 0x4c, 0x36, 0x42, 0x37, 0x79, 0x75, 0x56, 0x42, 0x67, 0x77, + 0x44, 0x48, 0x54, 0x0a, 0x63, 0x2b, 0x58, 0x76, 0x76, 0x71, 0x44, 0x74, + 0x4d, 0x77, 0x74, 0x30, 0x76, 0x69, 0x41, 0x67, 0x78, 0x47, 0x64, 0x73, + 0x38, 0x41, 0x67, 0x44, 0x65, 0x6c, 0x57, 0x41, 0x66, 0x30, 0x5a, 0x4f, + 0x6c, 0x71, 0x66, 0x30, 0x48, 0x6a, 0x37, 0x68, 0x39, 0x74, 0x67, 0x4a, + 0x34, 0x54, 0x4e, 0x6b, 0x4b, 0x32, 0x50, 0x58, 0x4d, 0x6c, 0x36, 0x66, + 0x2b, 0x63, 0x42, 0x37, 0x44, 0x33, 0x68, 0x76, 0x0a, 0x6c, 0x37, 0x79, + 0x54, 0x6d, 0x76, 0x6d, 0x63, 0x45, 0x70, 0x42, 0x34, 0x65, 0x6f, 0x43, + 0x48, 0x46, 0x64, 0x64, 0x79, 0x64, 0x4a, 0x78, 0x56, 0x64, 0x48, 0x69, + 0x78, 0x75, 0x75, 0x46, 0x75, 0x63, 0x41, 0x53, 0x36, 0x54, 0x36, 0x43, + 0x36, 0x61, 0x4d, 0x4e, 0x37, 0x2f, 0x7a, 0x48, 0x77, 0x63, 0x7a, 0x30, + 0x39, 0x6c, 0x43, 0x71, 0x78, 0x43, 0x30, 0x45, 0x4f, 0x6f, 0x50, 0x35, + 0x4e, 0x0a, 0x69, 0x47, 0x56, 0x72, 0x65, 0x54, 0x4f, 0x30, 0x31, 0x77, + 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, + 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x0a, 0x2f, 0x7a, 0x41, 0x64, 0x42, + 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x37, + 0x55, 0x51, 0x5a, 0x77, 0x4e, 0x50, 0x77, 0x42, 0x6f, 0x76, 0x75, 0x70, + 0x48, 0x75, 0x2b, 0x51, 0x75, 0x63, 0x6d, 0x56, 0x4d, 0x69, 0x4f, 0x4e, + 0x6e, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x0a, + 0x67, 0x67, 0x49, 0x42, 0x41, 0x41, 0x32, 0x75, 0x6b, 0x44, 0x4c, 0x32, + 0x70, 0x6b, 0x74, 0x38, 0x52, 0x48, 0x59, 0x5a, 0x59, 0x52, 0x34, 0x6e, + 0x4b, 0x4d, 0x31, 0x65, 0x56, 0x4f, 0x38, 0x6c, 0x76, 0x4f, 0x4d, 0x49, + 0x6b, 0x50, 0x6b, 0x70, 0x31, 0x36, 0x35, 0x6f, 0x43, 0x4f, 0x47, 0x55, + 0x41, 0x46, 0x6a, 0x76, 0x4c, 0x69, 0x35, 0x2b, 0x55, 0x31, 0x4b, 0x4d, + 0x74, 0x6c, 0x77, 0x48, 0x0a, 0x36, 0x6f, 0x69, 0x36, 0x6d, 0x59, 0x74, + 0x51, 0x6c, 0x4e, 0x65, 0x43, 0x67, 0x4e, 0x39, 0x68, 0x43, 0x51, 0x43, + 0x54, 0x72, 0x51, 0x30, 0x55, 0x35, 0x73, 0x37, 0x42, 0x38, 0x6a, 0x65, + 0x55, 0x65, 0x4c, 0x42, 0x66, 0x6e, 0x4c, 0x4f, 0x69, 0x63, 0x37, 0x69, + 0x50, 0x42, 0x5a, 0x4d, 0x34, 0x7a, 0x59, 0x30, 0x2b, 0x73, 0x4c, 0x6a, + 0x37, 0x77, 0x4d, 0x2b, 0x78, 0x38, 0x75, 0x77, 0x74, 0x0a, 0x4c, 0x52, + 0x76, 0x4d, 0x37, 0x4b, 0x71, 0x61, 0x73, 0x36, 0x70, 0x67, 0x67, 0x68, + 0x73, 0x74, 0x4f, 0x38, 0x4f, 0x45, 0x50, 0x56, 0x65, 0x4b, 0x6c, 0x68, + 0x36, 0x63, 0x64, 0x62, 0x6a, 0x54, 0x4d, 0x4d, 0x31, 0x67, 0x43, 0x49, + 0x4f, 0x51, 0x30, 0x34, 0x35, 0x55, 0x38, 0x55, 0x31, 0x6d, 0x77, 0x46, + 0x31, 0x30, 0x41, 0x30, 0x43, 0x6a, 0x37, 0x6f, 0x56, 0x2b, 0x77, 0x68, + 0x39, 0x33, 0x0a, 0x6e, 0x41, 0x62, 0x6f, 0x77, 0x61, 0x63, 0x59, 0x58, + 0x56, 0x4b, 0x56, 0x37, 0x63, 0x6e, 0x64, 0x4a, 0x5a, 0x35, 0x74, 0x2b, + 0x71, 0x6e, 0x74, 0x6f, 0x7a, 0x6f, 0x30, 0x30, 0x46, 0x6c, 0x37, 0x32, + 0x75, 0x31, 0x51, 0x38, 0x7a, 0x57, 0x2f, 0x37, 0x65, 0x73, 0x55, 0x54, + 0x54, 0x48, 0x48, 0x59, 0x50, 0x54, 0x61, 0x38, 0x59, 0x65, 0x63, 0x34, + 0x6b, 0x6a, 0x69, 0x78, 0x73, 0x55, 0x33, 0x0a, 0x2b, 0x77, 0x59, 0x51, + 0x2b, 0x6e, 0x56, 0x5a, 0x5a, 0x6a, 0x46, 0x48, 0x4b, 0x64, 0x70, 0x32, + 0x6d, 0x68, 0x7a, 0x70, 0x67, 0x71, 0x37, 0x76, 0x6d, 0x72, 0x6c, 0x52, + 0x39, 0x34, 0x67, 0x6a, 0x6d, 0x6d, 0x6d, 0x56, 0x59, 0x6a, 0x7a, 0x6c, + 0x56, 0x59, 0x41, 0x32, 0x31, 0x31, 0x51, 0x43, 0x2f, 0x2f, 0x47, 0x35, + 0x58, 0x63, 0x37, 0x55, 0x49, 0x32, 0x2f, 0x59, 0x52, 0x59, 0x52, 0x4b, + 0x0a, 0x57, 0x32, 0x58, 0x76, 0x69, 0x51, 0x7a, 0x64, 0x46, 0x4b, 0x63, + 0x67, 0x79, 0x78, 0x69, 0x6c, 0x4a, 0x62, 0x51, 0x4e, 0x2b, 0x51, 0x48, + 0x77, 0x6f, 0x74, 0x4c, 0x30, 0x41, 0x4d, 0x68, 0x30, 0x6a, 0x71, 0x45, + 0x71, 0x53, 0x49, 0x35, 0x6c, 0x32, 0x78, 0x50, 0x45, 0x34, 0x69, 0x55, + 0x58, 0x66, 0x65, 0x75, 0x2b, 0x68, 0x31, 0x73, 0x58, 0x49, 0x46, 0x52, + 0x52, 0x6b, 0x30, 0x70, 0x54, 0x0a, 0x41, 0x77, 0x76, 0x73, 0x58, 0x63, + 0x6f, 0x7a, 0x37, 0x57, 0x4c, 0x39, 0x52, 0x63, 0x63, 0x76, 0x57, 0x39, + 0x78, 0x59, 0x6f, 0x49, 0x41, 0x35, 0x35, 0x76, 0x72, 0x58, 0x2f, 0x68, + 0x4d, 0x55, 0x70, 0x75, 0x30, 0x39, 0x6c, 0x45, 0x70, 0x43, 0x64, 0x4e, + 0x54, 0x44, 0x64, 0x31, 0x6c, 0x7a, 0x7a, 0x59, 0x39, 0x47, 0x76, 0x6c, + 0x55, 0x34, 0x37, 0x2f, 0x72, 0x6f, 0x6b, 0x54, 0x4c, 0x71, 0x0a, 0x6c, + 0x31, 0x67, 0x45, 0x49, 0x74, 0x34, 0x34, 0x77, 0x38, 0x79, 0x38, 0x62, + 0x63, 0x6b, 0x7a, 0x4f, 0x6d, 0x6f, 0x4b, 0x61, 0x54, 0x2b, 0x67, 0x79, + 0x4f, 0x70, 0x79, 0x6a, 0x34, 0x78, 0x6a, 0x68, 0x69, 0x4f, 0x39, 0x62, + 0x54, 0x79, 0x57, 0x6e, 0x70, 0x58, 0x67, 0x53, 0x55, 0x79, 0x71, 0x6f, + 0x72, 0x6b, 0x71, 0x47, 0x35, 0x77, 0x32, 0x67, 0x58, 0x6a, 0x74, 0x77, + 0x2b, 0x68, 0x47, 0x0a, 0x34, 0x69, 0x5a, 0x5a, 0x52, 0x48, 0x55, 0x65, + 0x32, 0x58, 0x57, 0x4a, 0x55, 0x63, 0x30, 0x51, 0x68, 0x4a, 0x31, 0x68, + 0x59, 0x4d, 0x74, 0x64, 0x2b, 0x5a, 0x63, 0x69, 0x54, 0x59, 0x36, 0x59, + 0x35, 0x75, 0x4e, 0x2f, 0x39, 0x6c, 0x75, 0x37, 0x72, 0x73, 0x33, 0x4b, + 0x53, 0x6f, 0x46, 0x72, 0x58, 0x67, 0x76, 0x7a, 0x55, 0x65, 0x46, 0x30, + 0x4b, 0x2b, 0x6c, 0x2b, 0x4a, 0x36, 0x66, 0x5a, 0x0a, 0x6d, 0x55, 0x6c, + 0x4f, 0x2b, 0x4b, 0x57, 0x41, 0x32, 0x79, 0x55, 0x50, 0x48, 0x47, 0x4e, + 0x69, 0x69, 0x73, 0x6b, 0x7a, 0x5a, 0x32, 0x73, 0x38, 0x45, 0x49, 0x50, + 0x47, 0x72, 0x64, 0x36, 0x6f, 0x7a, 0x52, 0x61, 0x4f, 0x6a, 0x66, 0x41, + 0x48, 0x4e, 0x33, 0x47, 0x66, 0x38, 0x71, 0x76, 0x38, 0x51, 0x66, 0x58, + 0x42, 0x69, 0x2b, 0x77, 0x41, 0x4e, 0x31, 0x30, 0x4a, 0x35, 0x55, 0x36, + 0x41, 0x0a, 0x37, 0x2f, 0x71, 0x78, 0x58, 0x44, 0x67, 0x47, 0x70, 0x52, + 0x74, 0x4b, 0x34, 0x64, 0x77, 0x34, 0x4c, 0x54, 0x7a, 0x63, 0x71, 0x78, + 0x2b, 0x51, 0x47, 0x74, 0x56, 0x4b, 0x6e, 0x4f, 0x37, 0x52, 0x63, 0x47, + 0x7a, 0x4d, 0x37, 0x76, 0x52, 0x58, 0x2b, 0x42, 0x69, 0x36, 0x68, 0x47, + 0x36, 0x48, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x49, 0x64, 0x65, 0x6e, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, + 0x53, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x49, 0x64, 0x65, 0x6e, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x49, 0x64, 0x65, 0x6e, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, + 0x53, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x49, 0x64, 0x65, 0x6e, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x49, 0x64, 0x65, 0x6e, 0x54, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x53, 0x65, 0x63, 0x74, + 0x6f, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x33, 0x32, 0x39, 0x38, 0x38, 0x32, 0x31, 0x30, 0x33, 0x34, 0x39, + 0x34, 0x36, 0x33, 0x34, 0x32, 0x33, 0x39, 0x30, 0x35, 0x32, 0x31, 0x39, + 0x37, 0x36, 0x31, 0x35, 0x36, 0x38, 0x34, 0x33, 0x39, 0x33, 0x33, 0x36, + 0x39, 0x38, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x37, + 0x3a, 0x30, 0x36, 0x3a, 0x61, 0x35, 0x3a, 0x62, 0x30, 0x3a, 0x66, 0x63, + 0x3a, 0x38, 0x39, 0x3a, 0x39, 0x64, 0x3a, 0x62, 0x61, 0x3a, 0x66, 0x34, + 0x3a, 0x36, 0x62, 0x3a, 0x38, 0x63, 0x3a, 0x31, 0x61, 0x3a, 0x36, 0x34, + 0x3a, 0x63, 0x64, 0x3a, 0x64, 0x35, 0x3a, 0x62, 0x61, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x61, 0x3a, 0x32, 0x39, 0x3a, + 0x34, 0x31, 0x3a, 0x36, 0x30, 0x3a, 0x37, 0x37, 0x3a, 0x39, 0x38, 0x3a, + 0x33, 0x66, 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x33, 0x3a, 0x65, 0x66, 0x3a, + 0x66, 0x32, 0x3a, 0x33, 0x31, 0x3a, 0x30, 0x35, 0x3a, 0x33, 0x62, 0x3a, + 0x32, 0x65, 0x3a, 0x65, 0x61, 0x3a, 0x36, 0x64, 0x3a, 0x34, 0x64, 0x3a, + 0x34, 0x35, 0x3a, 0x66, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x30, 0x3a, 0x64, 0x30, 0x3a, 0x38, 0x39, + 0x3a, 0x35, 0x61, 0x3a, 0x39, 0x61, 0x3a, 0x34, 0x34, 0x3a, 0x38, 0x61, + 0x3a, 0x32, 0x36, 0x3a, 0x32, 0x30, 0x3a, 0x39, 0x31, 0x3a, 0x36, 0x33, + 0x3a, 0x35, 0x35, 0x3a, 0x32, 0x32, 0x3a, 0x64, 0x31, 0x3a, 0x66, 0x35, + 0x3a, 0x32, 0x30, 0x3a, 0x31, 0x30, 0x3a, 0x62, 0x35, 0x3a, 0x38, 0x36, + 0x3a, 0x37, 0x61, 0x3a, 0x63, 0x61, 0x3a, 0x65, 0x31, 0x3a, 0x32, 0x63, + 0x3a, 0x37, 0x38, 0x3a, 0x65, 0x66, 0x3a, 0x39, 0x35, 0x3a, 0x38, 0x66, + 0x3a, 0x64, 0x34, 0x3a, 0x66, 0x34, 0x3a, 0x33, 0x38, 0x3a, 0x39, 0x66, + 0x3a, 0x32, 0x66, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, + 0x5a, 0x6a, 0x43, 0x43, 0x41, 0x30, 0x36, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x51, 0x43, 0x67, 0x46, 0x43, 0x67, 0x41, 0x41, 0x41, + 0x41, 0x55, 0x55, 0x6a, 0x7a, 0x30, 0x5a, 0x38, 0x41, 0x41, 0x41, 0x41, + 0x41, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x4e, + 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x53, 0x4d, 0x42, 0x41, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4a, 0x53, 0x57, 0x52, + 0x6c, 0x62, 0x6c, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4d, 0x53, 0x6f, + 0x77, 0x4b, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x46, + 0x4a, 0x5a, 0x47, 0x56, 0x75, 0x0a, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, + 0x51, 0x67, 0x55, 0x48, 0x56, 0x69, 0x62, 0x47, 0x6c, 0x6a, 0x49, 0x46, + 0x4e, 0x6c, 0x59, 0x33, 0x52, 0x76, 0x63, 0x69, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x45, 0x77, 0x48, 0x68, + 0x63, 0x4e, 0x4d, 0x54, 0x51, 0x77, 0x4d, 0x54, 0x45, 0x32, 0x4d, 0x54, + 0x63, 0x31, 0x4d, 0x7a, 0x4d, 0x79, 0x57, 0x68, 0x63, 0x4e, 0x0a, 0x4d, + 0x7a, 0x51, 0x77, 0x4d, 0x54, 0x45, 0x32, 0x4d, 0x54, 0x63, 0x31, 0x4d, + 0x7a, 0x4d, 0x79, 0x57, 0x6a, 0x42, 0x4e, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, + 0x7a, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x4a, 0x53, 0x57, 0x52, 0x6c, 0x62, 0x6c, 0x52, 0x79, 0x64, + 0x58, 0x4e, 0x30, 0x0a, 0x4d, 0x53, 0x6f, 0x77, 0x4b, 0x41, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x79, 0x46, 0x4a, 0x5a, 0x47, 0x56, 0x75, + 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x55, 0x48, 0x56, 0x69, + 0x62, 0x47, 0x6c, 0x6a, 0x49, 0x46, 0x4e, 0x6c, 0x59, 0x33, 0x52, 0x76, + 0x63, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, + 0x49, 0x44, 0x45, 0x77, 0x67, 0x67, 0x49, 0x69, 0x0a, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, + 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, + 0x32, 0x49, 0x70, 0x54, 0x38, 0x70, 0x45, 0x69, 0x76, 0x36, 0x45, 0x64, + 0x72, 0x43, 0x76, 0x73, 0x6e, 0x64, 0x75, 0x54, 0x79, 0x50, 0x34, 0x6f, + 0x37, 0x0a, 0x65, 0x6b, 0x6f, 0x73, 0x4d, 0x53, 0x71, 0x4d, 0x6a, 0x62, + 0x43, 0x70, 0x77, 0x7a, 0x46, 0x72, 0x71, 0x48, 0x64, 0x32, 0x68, 0x43, + 0x61, 0x32, 0x72, 0x49, 0x46, 0x43, 0x44, 0x51, 0x6a, 0x72, 0x56, 0x56, + 0x69, 0x37, 0x65, 0x76, 0x69, 0x38, 0x5a, 0x58, 0x33, 0x79, 0x6f, 0x47, + 0x32, 0x4c, 0x71, 0x45, 0x66, 0x70, 0x59, 0x6e, 0x59, 0x65, 0x45, 0x65, + 0x34, 0x49, 0x46, 0x4e, 0x47, 0x79, 0x0a, 0x52, 0x42, 0x62, 0x30, 0x36, + 0x74, 0x44, 0x36, 0x48, 0x69, 0x39, 0x65, 0x32, 0x38, 0x74, 0x7a, 0x51, + 0x61, 0x36, 0x38, 0x41, 0x4c, 0x42, 0x4b, 0x4b, 0x30, 0x43, 0x79, 0x72, + 0x4f, 0x45, 0x37, 0x53, 0x38, 0x49, 0x74, 0x6e, 0x65, 0x53, 0x68, 0x6d, + 0x2b, 0x77, 0x61, 0x4f, 0x68, 0x37, 0x77, 0x43, 0x4c, 0x50, 0x51, 0x35, + 0x43, 0x51, 0x31, 0x42, 0x35, 0x2b, 0x63, 0x74, 0x4d, 0x6c, 0x53, 0x0a, + 0x62, 0x64, 0x73, 0x48, 0x79, 0x6f, 0x2b, 0x31, 0x57, 0x2f, 0x43, 0x44, + 0x38, 0x30, 0x2f, 0x48, 0x4c, 0x61, 0x58, 0x49, 0x72, 0x63, 0x75, 0x56, + 0x49, 0x4b, 0x51, 0x78, 0x4b, 0x46, 0x64, 0x59, 0x57, 0x75, 0x53, 0x4e, + 0x47, 0x35, 0x71, 0x72, 0x6e, 0x67, 0x30, 0x4d, 0x38, 0x67, 0x6f, 0x7a, + 0x4f, 0x53, 0x49, 0x35, 0x43, 0x70, 0x63, 0x75, 0x38, 0x31, 0x4e, 0x33, + 0x75, 0x55, 0x52, 0x46, 0x0a, 0x2f, 0x59, 0x54, 0x4c, 0x4e, 0x69, 0x43, + 0x42, 0x57, 0x53, 0x32, 0x61, 0x62, 0x32, 0x31, 0x49, 0x53, 0x47, 0x48, + 0x4b, 0x54, 0x4e, 0x39, 0x54, 0x30, 0x61, 0x39, 0x53, 0x76, 0x45, 0x53, + 0x66, 0x71, 0x79, 0x39, 0x72, 0x67, 0x33, 0x4c, 0x76, 0x64, 0x59, 0x44, + 0x61, 0x42, 0x6a, 0x4d, 0x62, 0x58, 0x63, 0x6a, 0x61, 0x59, 0x38, 0x5a, + 0x4e, 0x7a, 0x61, 0x78, 0x6d, 0x4d, 0x63, 0x33, 0x52, 0x0a, 0x33, 0x6a, + 0x36, 0x48, 0x45, 0x44, 0x62, 0x68, 0x75, 0x61, 0x52, 0x36, 0x37, 0x32, + 0x42, 0x51, 0x73, 0x73, 0x76, 0x4b, 0x70, 0x6c, 0x62, 0x67, 0x4e, 0x36, + 0x2b, 0x72, 0x4e, 0x42, 0x4d, 0x35, 0x4a, 0x65, 0x67, 0x35, 0x5a, 0x75, + 0x53, 0x59, 0x65, 0x71, 0x6f, 0x53, 0x6d, 0x4a, 0x78, 0x5a, 0x5a, 0x6f, + 0x59, 0x2b, 0x72, 0x66, 0x47, 0x77, 0x79, 0x6a, 0x34, 0x47, 0x44, 0x33, + 0x76, 0x77, 0x0a, 0x45, 0x55, 0x73, 0x33, 0x6f, 0x45, 0x52, 0x74, 0x65, + 0x38, 0x75, 0x6f, 0x6a, 0x48, 0x48, 0x30, 0x31, 0x62, 0x57, 0x52, 0x4e, + 0x73, 0x7a, 0x77, 0x46, 0x63, 0x59, 0x72, 0x33, 0x6c, 0x45, 0x58, 0x73, + 0x5a, 0x64, 0x4d, 0x55, 0x44, 0x32, 0x78, 0x6c, 0x56, 0x6c, 0x38, 0x42, + 0x58, 0x30, 0x74, 0x49, 0x64, 0x55, 0x41, 0x76, 0x77, 0x46, 0x6e, 0x6f, + 0x6c, 0x35, 0x37, 0x70, 0x6c, 0x7a, 0x79, 0x0a, 0x39, 0x79, 0x4c, 0x78, + 0x6b, 0x41, 0x32, 0x54, 0x32, 0x36, 0x70, 0x45, 0x55, 0x57, 0x62, 0x4d, + 0x66, 0x58, 0x59, 0x44, 0x36, 0x32, 0x71, 0x6f, 0x4b, 0x6a, 0x67, 0x5a, + 0x6c, 0x33, 0x59, 0x4e, 0x61, 0x34, 0x70, 0x68, 0x2b, 0x62, 0x7a, 0x32, + 0x37, 0x6e, 0x62, 0x39, 0x63, 0x43, 0x76, 0x64, 0x4b, 0x54, 0x7a, 0x34, + 0x43, 0x68, 0x35, 0x62, 0x51, 0x68, 0x79, 0x4c, 0x56, 0x69, 0x39, 0x56, + 0x0a, 0x47, 0x78, 0x79, 0x68, 0x4c, 0x72, 0x58, 0x48, 0x46, 0x75, 0x62, + 0x34, 0x71, 0x6a, 0x79, 0x53, 0x6a, 0x6d, 0x6d, 0x32, 0x41, 0x63, 0x47, + 0x31, 0x68, 0x70, 0x32, 0x4a, 0x44, 0x77, 0x73, 0x34, 0x6c, 0x46, 0x54, + 0x6f, 0x36, 0x74, 0x79, 0x65, 0x50, 0x53, 0x57, 0x38, 0x55, 0x79, 0x62, + 0x74, 0x31, 0x61, 0x73, 0x35, 0x71, 0x73, 0x56, 0x41, 0x54, 0x46, 0x53, + 0x72, 0x73, 0x72, 0x54, 0x5a, 0x0a, 0x32, 0x66, 0x6a, 0x58, 0x63, 0x74, + 0x73, 0x63, 0x76, 0x47, 0x32, 0x39, 0x5a, 0x56, 0x2f, 0x76, 0x69, 0x44, + 0x55, 0x71, 0x5a, 0x69, 0x2f, 0x75, 0x39, 0x72, 0x4e, 0x6c, 0x38, 0x44, + 0x4f, 0x4e, 0x66, 0x4a, 0x68, 0x42, 0x61, 0x55, 0x59, 0x50, 0x51, 0x78, + 0x78, 0x70, 0x2b, 0x70, 0x75, 0x31, 0x30, 0x47, 0x46, 0x71, 0x7a, 0x63, + 0x70, 0x4c, 0x32, 0x55, 0x79, 0x51, 0x52, 0x71, 0x73, 0x56, 0x0a, 0x57, + 0x61, 0x46, 0x48, 0x56, 0x43, 0x6b, 0x75, 0x67, 0x79, 0x68, 0x66, 0x48, + 0x4d, 0x4b, 0x69, 0x71, 0x33, 0x49, 0x58, 0x41, 0x41, 0x61, 0x4f, 0x52, + 0x65, 0x79, 0x4c, 0x34, 0x6a, 0x4d, 0x39, 0x66, 0x39, 0x6f, 0x5a, 0x52, + 0x4f, 0x52, 0x69, 0x63, 0x73, 0x50, 0x66, 0x49, 0x73, 0x62, 0x79, 0x56, + 0x74, 0x54, 0x64, 0x58, 0x35, 0x56, 0x79, 0x37, 0x57, 0x31, 0x66, 0x39, + 0x30, 0x67, 0x44, 0x0a, 0x57, 0x2f, 0x33, 0x46, 0x4b, 0x71, 0x44, 0x32, + 0x63, 0x79, 0x4f, 0x45, 0x45, 0x42, 0x73, 0x42, 0x35, 0x77, 0x49, 0x44, + 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x4f, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, + 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x0a, 0x42, 0x41, 0x55, + 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x34, 0x33, 0x48, + 0x67, 0x6e, 0x74, 0x69, 0x6e, 0x51, 0x74, 0x6e, 0x62, 0x63, 0x5a, 0x46, + 0x72, 0x6c, 0x4a, 0x50, 0x72, 0x77, 0x36, 0x50, 0x52, 0x46, 0x4b, 0x4d, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x0a, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x49, 0x42, 0x41, 0x45, 0x66, 0x36, 0x33, 0x51, 0x71, 0x77, 0x45, 0x5a, + 0x45, 0x34, 0x72, 0x55, 0x31, 0x64, 0x39, 0x2b, 0x55, 0x4f, 0x6c, 0x31, + 0x51, 0x5a, 0x67, 0x6b, 0x69, 0x48, 0x56, 0x49, 0x79, 0x71, 0x5a, 0x4a, + 0x6e, 0x59, 0x57, 0x76, 0x36, 0x49, 0x41, 0x63, 0x56, 0x59, 0x70, 0x5a, + 0x6d, 0x78, 0x49, 0x31, 0x51, 0x6a, 0x0a, 0x74, 0x32, 0x6f, 0x64, 0x49, + 0x46, 0x66, 0x6c, 0x41, 0x57, 0x4a, 0x42, 0x46, 0x39, 0x4d, 0x4a, 0x32, + 0x33, 0x58, 0x4c, 0x62, 0x6c, 0x53, 0x51, 0x64, 0x66, 0x34, 0x61, 0x6e, + 0x34, 0x45, 0x4b, 0x77, 0x74, 0x33, 0x58, 0x39, 0x77, 0x6e, 0x51, 0x57, + 0x33, 0x49, 0x56, 0x35, 0x42, 0x34, 0x4a, 0x61, 0x6a, 0x30, 0x7a, 0x38, + 0x79, 0x47, 0x61, 0x35, 0x68, 0x56, 0x2b, 0x72, 0x56, 0x48, 0x56, 0x0a, + 0x44, 0x52, 0x44, 0x74, 0x66, 0x55, 0x4c, 0x41, 0x6a, 0x2b, 0x37, 0x41, + 0x6d, 0x67, 0x6a, 0x56, 0x51, 0x64, 0x5a, 0x63, 0x44, 0x69, 0x46, 0x70, + 0x62, 0x6f, 0x42, 0x68, 0x44, 0x68, 0x58, 0x41, 0x75, 0x4d, 0x2f, 0x46, + 0x53, 0x52, 0x4a, 0x53, 0x7a, 0x4c, 0x34, 0x36, 0x7a, 0x4e, 0x51, 0x75, + 0x4f, 0x41, 0x58, 0x65, 0x4e, 0x66, 0x30, 0x66, 0x62, 0x37, 0x69, 0x41, + 0x61, 0x4a, 0x67, 0x39, 0x0a, 0x54, 0x61, 0x44, 0x4b, 0x51, 0x47, 0x58, + 0x53, 0x63, 0x33, 0x7a, 0x31, 0x69, 0x39, 0x6b, 0x4b, 0x6c, 0x54, 0x2f, + 0x59, 0x50, 0x79, 0x4e, 0x74, 0x47, 0x74, 0x45, 0x71, 0x4a, 0x42, 0x6e, + 0x5a, 0x68, 0x62, 0x4d, 0x58, 0x37, 0x33, 0x68, 0x75, 0x71, 0x56, 0x6a, + 0x52, 0x49, 0x39, 0x50, 0x48, 0x45, 0x2b, 0x31, 0x79, 0x4a, 0x58, 0x39, + 0x64, 0x73, 0x58, 0x4e, 0x77, 0x30, 0x48, 0x38, 0x47, 0x0a, 0x6c, 0x77, + 0x6d, 0x45, 0x4b, 0x59, 0x42, 0x68, 0x48, 0x66, 0x70, 0x65, 0x2f, 0x33, + 0x4f, 0x73, 0x6f, 0x4f, 0x4f, 0x4a, 0x75, 0x42, 0x78, 0x78, 0x46, 0x63, + 0x62, 0x65, 0x4d, 0x58, 0x38, 0x53, 0x33, 0x4f, 0x46, 0x74, 0x6d, 0x36, + 0x2f, 0x6e, 0x36, 0x4a, 0x39, 0x31, 0x65, 0x45, 0x79, 0x72, 0x52, 0x6a, + 0x75, 0x61, 0x7a, 0x72, 0x38, 0x46, 0x47, 0x46, 0x31, 0x4e, 0x46, 0x54, + 0x77, 0x57, 0x0a, 0x6d, 0x68, 0x6c, 0x51, 0x42, 0x4a, 0x71, 0x79, 0x6d, + 0x6d, 0x39, 0x6c, 0x69, 0x31, 0x4a, 0x66, 0x50, 0x46, 0x67, 0x45, 0x4b, + 0x43, 0x58, 0x41, 0x5a, 0x6d, 0x45, 0x78, 0x66, 0x72, 0x6e, 0x67, 0x64, + 0x62, 0x6b, 0x61, 0x71, 0x49, 0x48, 0x57, 0x63, 0x68, 0x65, 0x7a, 0x78, + 0x51, 0x4d, 0x78, 0x4e, 0x52, 0x46, 0x34, 0x65, 0x4b, 0x4c, 0x67, 0x36, + 0x54, 0x43, 0x4d, 0x66, 0x34, 0x44, 0x66, 0x0a, 0x57, 0x4e, 0x38, 0x38, + 0x75, 0x69, 0x65, 0x57, 0x34, 0x6f, 0x41, 0x30, 0x62, 0x65, 0x4f, 0x59, + 0x30, 0x32, 0x51, 0x6e, 0x72, 0x45, 0x68, 0x2b, 0x4b, 0x48, 0x64, 0x63, + 0x78, 0x69, 0x56, 0x68, 0x4a, 0x66, 0x69, 0x46, 0x44, 0x47, 0x58, 0x36, + 0x78, 0x44, 0x49, 0x76, 0x70, 0x5a, 0x67, 0x46, 0x35, 0x50, 0x67, 0x4c, + 0x5a, 0x78, 0x59, 0x57, 0x78, 0x6f, 0x4b, 0x34, 0x4d, 0x68, 0x6e, 0x35, + 0x0a, 0x2b, 0x62, 0x6c, 0x35, 0x33, 0x42, 0x2f, 0x4e, 0x36, 0x36, 0x2b, + 0x72, 0x44, 0x74, 0x30, 0x62, 0x32, 0x30, 0x58, 0x6b, 0x65, 0x75, 0x63, + 0x43, 0x34, 0x70, 0x56, 0x64, 0x2f, 0x47, 0x6e, 0x77, 0x55, 0x32, 0x6c, + 0x68, 0x6c, 0x58, 0x56, 0x35, 0x43, 0x31, 0x35, 0x56, 0x35, 0x6a, 0x67, + 0x63, 0x6c, 0x4b, 0x6c, 0x5a, 0x4d, 0x35, 0x37, 0x49, 0x63, 0x58, 0x52, + 0x35, 0x66, 0x31, 0x47, 0x4a, 0x0a, 0x74, 0x73, 0x68, 0x71, 0x75, 0x44, + 0x44, 0x49, 0x61, 0x6a, 0x6a, 0x44, 0x62, 0x70, 0x37, 0x68, 0x4e, 0x78, + 0x62, 0x71, 0x42, 0x57, 0x4a, 0x4d, 0x57, 0x78, 0x4a, 0x48, 0x37, 0x61, + 0x65, 0x30, 0x73, 0x31, 0x68, 0x57, 0x78, 0x30, 0x6e, 0x7a, 0x66, 0x78, + 0x4a, 0x6f, 0x43, 0x54, 0x46, 0x78, 0x38, 0x47, 0x33, 0x34, 0x54, 0x6b, + 0x66, 0x37, 0x31, 0x6f, 0x58, 0x75, 0x78, 0x56, 0x68, 0x41, 0x0a, 0x47, + 0x61, 0x51, 0x64, 0x70, 0x2f, 0x6c, 0x4c, 0x51, 0x7a, 0x66, 0x63, 0x61, + 0x46, 0x70, 0x50, 0x7a, 0x2b, 0x76, 0x43, 0x5a, 0x48, 0x54, 0x65, 0x74, + 0x42, 0x58, 0x5a, 0x39, 0x46, 0x52, 0x55, 0x47, 0x69, 0x38, 0x63, 0x31, + 0x35, 0x64, 0x78, 0x56, 0x4a, 0x43, 0x4f, 0x32, 0x53, 0x43, 0x64, 0x55, + 0x79, 0x74, 0x2f, 0x71, 0x34, 0x2f, 0x69, 0x36, 0x6a, 0x43, 0x38, 0x55, + 0x44, 0x66, 0x76, 0x0a, 0x38, 0x55, 0x65, 0x31, 0x66, 0x58, 0x77, 0x73, + 0x42, 0x4f, 0x78, 0x6f, 0x6e, 0x62, 0x52, 0x4a, 0x52, 0x42, 0x44, 0x30, + 0x63, 0x6b, 0x73, 0x63, 0x5a, 0x4f, 0x66, 0x38, 0x35, 0x6d, 0x75, 0x51, + 0x33, 0x57, 0x6c, 0x39, 0x61, 0x66, 0x30, 0x41, 0x56, 0x71, 0x57, 0x33, + 0x72, 0x4c, 0x61, 0x74, 0x74, 0x38, 0x6f, 0x2b, 0x41, 0x65, 0x2b, 0x63, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, + 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x65, 0x20, 0x77, 0x77, + 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, + 0x74, 0x2f, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x74, 0x65, 0x72, 0x6d, + 0x73, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x45, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x2d, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, + 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x20, 0x4f, + 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x65, 0x20, 0x77, 0x77, + 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, + 0x74, 0x2f, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x74, 0x65, 0x72, 0x6d, + 0x73, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x39, 0x20, 0x45, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, + 0x20, 0x2d, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, + 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x2d, 0x20, 0x47, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x32, 0x34, 0x36, 0x39, 0x38, + 0x39, 0x33, 0x35, 0x32, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x34, 0x62, 0x3a, 0x65, 0x32, 0x3a, 0x63, 0x39, 0x3a, 0x39, 0x31, 0x3a, + 0x39, 0x36, 0x3a, 0x36, 0x35, 0x3a, 0x30, 0x63, 0x3a, 0x66, 0x34, 0x3a, + 0x30, 0x65, 0x3a, 0x35, 0x61, 0x3a, 0x39, 0x33, 0x3a, 0x39, 0x32, 0x3a, + 0x61, 0x30, 0x3a, 0x30, 0x61, 0x3a, 0x66, 0x65, 0x3a, 0x62, 0x32, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x63, 0x3a, 0x66, + 0x34, 0x3a, 0x32, 0x37, 0x3a, 0x66, 0x64, 0x3a, 0x37, 0x39, 0x3a, 0x30, + 0x63, 0x3a, 0x33, 0x61, 0x3a, 0x64, 0x31, 0x3a, 0x36, 0x36, 0x3a, 0x30, + 0x36, 0x3a, 0x38, 0x64, 0x3a, 0x65, 0x38, 0x3a, 0x31, 0x65, 0x3a, 0x35, + 0x37, 0x3a, 0x65, 0x66, 0x3a, 0x62, 0x62, 0x3a, 0x39, 0x33, 0x3a, 0x32, + 0x32, 0x3a, 0x37, 0x32, 0x3a, 0x64, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x33, 0x3a, 0x64, 0x66, 0x3a, + 0x35, 0x37, 0x3a, 0x37, 0x34, 0x3a, 0x62, 0x30, 0x3a, 0x33, 0x65, 0x3a, + 0x37, 0x66, 0x3a, 0x65, 0x66, 0x3a, 0x35, 0x66, 0x3a, 0x65, 0x34, 0x3a, + 0x30, 0x64, 0x3a, 0x39, 0x33, 0x3a, 0x31, 0x61, 0x3a, 0x37, 0x62, 0x3a, + 0x65, 0x64, 0x3a, 0x66, 0x31, 0x3a, 0x62, 0x62, 0x3a, 0x32, 0x65, 0x3a, + 0x36, 0x62, 0x3a, 0x34, 0x32, 0x3a, 0x37, 0x33, 0x3a, 0x38, 0x63, 0x3a, + 0x34, 0x65, 0x3a, 0x36, 0x64, 0x3a, 0x33, 0x38, 0x3a, 0x34, 0x31, 0x3a, + 0x31, 0x30, 0x3a, 0x33, 0x64, 0x3a, 0x33, 0x61, 0x3a, 0x61, 0x37, 0x3a, + 0x66, 0x33, 0x3a, 0x33, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x45, 0x50, 0x6a, 0x43, 0x43, 0x41, 0x79, 0x61, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x45, 0x53, 0x6c, 0x4f, 0x4d, 0x4b, 0x44, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x76, 0x6a, + 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, + 0x4d, 0x43, 0x0a, 0x56, 0x56, 0x4d, 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, 0x55, 0x56, 0x75, 0x64, + 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, + 0x79, 0x34, 0x78, 0x4b, 0x44, 0x41, 0x6d, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x73, 0x54, 0x48, 0x31, 0x4e, 0x6c, 0x5a, 0x53, 0x42, 0x33, 0x64, + 0x33, 0x63, 0x75, 0x5a, 0x57, 0x35, 0x30, 0x0a, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x35, 0x75, 0x5a, 0x58, 0x51, 0x76, 0x62, 0x47, 0x56, 0x6e, + 0x59, 0x57, 0x77, 0x74, 0x64, 0x47, 0x56, 0x79, 0x62, 0x58, 0x4d, 0x78, + 0x4f, 0x54, 0x41, 0x33, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, + 0x4d, 0x43, 0x68, 0x6a, 0x4b, 0x53, 0x41, 0x79, 0x4d, 0x44, 0x41, 0x35, + 0x49, 0x45, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x73, + 0x0a, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x67, 0x4c, 0x53, 0x42, + 0x6d, 0x62, 0x33, 0x49, 0x67, 0x59, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, + 0x79, 0x61, 0x58, 0x70, 0x6c, 0x5a, 0x43, 0x42, 0x31, 0x63, 0x32, 0x55, + 0x67, 0x62, 0x32, 0x35, 0x73, 0x65, 0x54, 0x45, 0x79, 0x4d, 0x44, 0x41, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x70, 0x52, 0x57, 0x35, + 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x0a, 0x64, 0x43, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, + 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x49, 0x43, + 0x30, 0x67, 0x52, 0x7a, 0x49, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x44, + 0x6b, 0x77, 0x4e, 0x7a, 0x41, 0x33, 0x4d, 0x54, 0x63, 0x79, 0x0a, 0x4e, + 0x54, 0x55, 0x30, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x41, 0x78, 0x4d, + 0x6a, 0x41, 0x33, 0x4d, 0x54, 0x63, 0x31, 0x4e, 0x54, 0x55, 0x30, 0x57, + 0x6a, 0x43, 0x42, 0x76, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x46, + 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x44, + 0x55, 0x56, 0x75, 0x0a, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x73, + 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x4b, 0x44, 0x41, 0x6d, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x48, 0x31, 0x4e, 0x6c, + 0x5a, 0x53, 0x42, 0x33, 0x64, 0x33, 0x63, 0x75, 0x5a, 0x57, 0x35, 0x30, + 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x35, 0x75, 0x5a, 0x58, 0x51, 0x76, + 0x62, 0x47, 0x56, 0x6e, 0x59, 0x57, 0x77, 0x74, 0x0a, 0x64, 0x47, 0x56, + 0x79, 0x62, 0x58, 0x4d, 0x78, 0x4f, 0x54, 0x41, 0x33, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x73, 0x54, 0x4d, 0x43, 0x68, 0x6a, 0x4b, 0x53, 0x41, + 0x79, 0x4d, 0x44, 0x41, 0x35, 0x49, 0x45, 0x56, 0x75, 0x64, 0x48, 0x4a, + 0x31, 0x63, 0x33, 0x51, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, + 0x67, 0x4c, 0x53, 0x42, 0x6d, 0x62, 0x33, 0x49, 0x67, 0x59, 0x58, 0x56, + 0x30, 0x0a, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x70, 0x6c, 0x5a, 0x43, + 0x42, 0x31, 0x63, 0x32, 0x55, 0x67, 0x62, 0x32, 0x35, 0x73, 0x65, 0x54, + 0x45, 0x79, 0x4d, 0x44, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, + 0x4d, 0x70, 0x52, 0x57, 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, + 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, + 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x0a, 0x59, 0x58, 0x52, 0x70, 0x62, + 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, + 0x58, 0x52, 0x35, 0x49, 0x43, 0x30, 0x67, 0x52, 0x7a, 0x49, 0x77, 0x67, + 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x45, 0x4b, 0x0a, + 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, 0x36, 0x68, 0x4c, 0x5a, 0x79, + 0x32, 0x35, 0x34, 0x4d, 0x61, 0x2b, 0x4b, 0x5a, 0x36, 0x54, 0x41, 0x42, + 0x70, 0x33, 0x62, 0x71, 0x4d, 0x72, 0x69, 0x56, 0x51, 0x52, 0x72, 0x4a, + 0x32, 0x6d, 0x46, 0x4f, 0x57, 0x48, 0x4c, 0x50, 0x2f, 0x76, 0x61, 0x43, + 0x65, 0x62, 0x39, 0x7a, 0x59, 0x51, 0x59, 0x4b, 0x70, 0x53, 0x66, 0x59, + 0x73, 0x31, 0x2f, 0x54, 0x0a, 0x52, 0x55, 0x34, 0x63, 0x63, 0x74, 0x5a, + 0x4f, 0x4d, 0x76, 0x4a, 0x79, 0x69, 0x67, 0x2f, 0x33, 0x67, 0x78, 0x6e, + 0x51, 0x61, 0x6f, 0x43, 0x41, 0x41, 0x45, 0x55, 0x65, 0x73, 0x4d, 0x66, + 0x6e, 0x6d, 0x72, 0x38, 0x53, 0x56, 0x79, 0x63, 0x63, 0x6f, 0x32, 0x67, + 0x76, 0x43, 0x6f, 0x65, 0x39, 0x61, 0x6d, 0x73, 0x4f, 0x58, 0x6d, 0x58, + 0x7a, 0x48, 0x48, 0x66, 0x56, 0x31, 0x49, 0x57, 0x4e, 0x0a, 0x63, 0x43, + 0x47, 0x30, 0x73, 0x7a, 0x4c, 0x6e, 0x69, 0x36, 0x4c, 0x56, 0x68, 0x6a, + 0x6b, 0x43, 0x73, 0x62, 0x6a, 0x53, 0x52, 0x38, 0x37, 0x6b, 0x79, 0x55, + 0x6e, 0x45, 0x4f, 0x36, 0x66, 0x65, 0x2b, 0x31, 0x52, 0x39, 0x56, 0x37, + 0x37, 0x77, 0x36, 0x47, 0x37, 0x43, 0x65, 0x62, 0x49, 0x36, 0x43, 0x31, + 0x58, 0x69, 0x55, 0x4a, 0x67, 0x57, 0x4d, 0x68, 0x4e, 0x63, 0x4c, 0x33, + 0x68, 0x57, 0x0a, 0x77, 0x63, 0x4b, 0x55, 0x73, 0x2f, 0x4a, 0x61, 0x35, + 0x43, 0x65, 0x61, 0x6e, 0x79, 0x54, 0x58, 0x78, 0x75, 0x7a, 0x51, 0x6d, + 0x79, 0x57, 0x43, 0x34, 0x38, 0x7a, 0x43, 0x78, 0x45, 0x58, 0x46, 0x6a, + 0x4a, 0x64, 0x36, 0x42, 0x6d, 0x73, 0x71, 0x45, 0x5a, 0x2b, 0x70, 0x43, + 0x6d, 0x35, 0x49, 0x4f, 0x32, 0x2f, 0x62, 0x31, 0x42, 0x45, 0x5a, 0x51, + 0x76, 0x65, 0x50, 0x42, 0x37, 0x2f, 0x31, 0x0a, 0x55, 0x31, 0x2b, 0x63, + 0x50, 0x76, 0x51, 0x58, 0x4c, 0x4f, 0x5a, 0x70, 0x72, 0x45, 0x34, 0x79, + 0x54, 0x47, 0x4a, 0x33, 0x36, 0x72, 0x66, 0x6f, 0x35, 0x62, 0x73, 0x30, + 0x76, 0x42, 0x6d, 0x4c, 0x72, 0x70, 0x78, 0x52, 0x35, 0x37, 0x64, 0x2b, + 0x74, 0x56, 0x4f, 0x78, 0x4d, 0x79, 0x4c, 0x6c, 0x62, 0x63, 0x39, 0x77, + 0x50, 0x42, 0x72, 0x36, 0x34, 0x70, 0x74, 0x6e, 0x74, 0x6f, 0x50, 0x30, + 0x0a, 0x6a, 0x61, 0x57, 0x76, 0x59, 0x6b, 0x78, 0x4e, 0x34, 0x46, 0x69, + 0x73, 0x5a, 0x44, 0x51, 0x53, 0x41, 0x2f, 0x69, 0x32, 0x6a, 0x5a, 0x52, + 0x6a, 0x4a, 0x4b, 0x52, 0x78, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, + 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x42, 0x6a, 0x41, 0x50, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, + 0x48, 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x52, 0x71, 0x63, 0x69, 0x5a, 0x36, 0x30, 0x42, + 0x37, 0x76, 0x66, 0x65, 0x63, 0x37, 0x61, 0x56, 0x48, 0x55, 0x62, 0x49, + 0x32, 0x66, 0x6b, 0x42, 0x4a, 0x6d, 0x71, 0x7a, 0x41, 0x4e, 0x0a, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x65, + 0x5a, 0x38, 0x64, 0x6c, 0x73, 0x61, 0x32, 0x65, 0x54, 0x38, 0x69, 0x6a, + 0x59, 0x66, 0x54, 0x68, 0x77, 0x4d, 0x45, 0x59, 0x47, 0x70, 0x72, 0x6d, + 0x69, 0x35, 0x5a, 0x69, 0x58, 0x4d, 0x52, 0x72, 0x45, 0x50, 0x52, 0x39, + 0x52, 0x50, 0x2f, 0x0a, 0x6a, 0x54, 0x6b, 0x72, 0x77, 0x50, 0x4b, 0x39, + 0x54, 0x33, 0x43, 0x4d, 0x71, 0x53, 0x2f, 0x71, 0x46, 0x38, 0x51, 0x4c, + 0x56, 0x4a, 0x37, 0x55, 0x47, 0x35, 0x61, 0x59, 0x4d, 0x7a, 0x79, 0x6f, + 0x72, 0x57, 0x4b, 0x69, 0x41, 0x48, 0x61, 0x72, 0x57, 0x57, 0x6c, 0x75, + 0x42, 0x68, 0x31, 0x2b, 0x78, 0x4c, 0x6c, 0x45, 0x6a, 0x5a, 0x69, 0x76, + 0x45, 0x74, 0x52, 0x68, 0x32, 0x77, 0x6f, 0x5a, 0x0a, 0x52, 0x6b, 0x66, + 0x7a, 0x36, 0x2f, 0x64, 0x6a, 0x77, 0x55, 0x41, 0x46, 0x51, 0x4b, 0x58, + 0x53, 0x74, 0x2f, 0x53, 0x31, 0x6d, 0x6a, 0x61, 0x2f, 0x71, 0x59, 0x68, + 0x32, 0x69, 0x41, 0x52, 0x56, 0x42, 0x43, 0x75, 0x63, 0x68, 0x33, 0x38, + 0x61, 0x4e, 0x7a, 0x78, 0x2b, 0x4c, 0x61, 0x55, 0x61, 0x32, 0x4e, 0x53, + 0x4a, 0x58, 0x73, 0x71, 0x39, 0x72, 0x44, 0x31, 0x73, 0x32, 0x47, 0x32, + 0x76, 0x0a, 0x31, 0x66, 0x4e, 0x32, 0x44, 0x38, 0x30, 0x37, 0x69, 0x44, + 0x67, 0x69, 0x6e, 0x57, 0x79, 0x54, 0x6d, 0x73, 0x51, 0x39, 0x76, 0x34, + 0x49, 0x62, 0x5a, 0x54, 0x2b, 0x6d, 0x44, 0x31, 0x32, 0x71, 0x2f, 0x4f, + 0x57, 0x79, 0x46, 0x63, 0x71, 0x31, 0x72, 0x63, 0x61, 0x38, 0x50, 0x64, + 0x43, 0x45, 0x36, 0x4f, 0x6f, 0x47, 0x63, 0x72, 0x42, 0x4e, 0x4f, 0x54, + 0x4a, 0x34, 0x76, 0x7a, 0x34, 0x52, 0x0a, 0x6e, 0x41, 0x75, 0x6b, 0x6e, + 0x5a, 0x6f, 0x68, 0x38, 0x2f, 0x43, 0x62, 0x43, 0x7a, 0x42, 0x34, 0x32, + 0x38, 0x48, 0x63, 0x68, 0x30, 0x50, 0x2b, 0x76, 0x47, 0x4f, 0x61, 0x79, + 0x73, 0x58, 0x43, 0x48, 0x4d, 0x6e, 0x48, 0x6a, 0x66, 0x38, 0x37, 0x45, + 0x6c, 0x67, 0x49, 0x35, 0x72, 0x59, 0x39, 0x37, 0x48, 0x6f, 0x73, 0x54, + 0x76, 0x75, 0x44, 0x6c, 0x73, 0x34, 0x4d, 0x50, 0x47, 0x6d, 0x48, 0x0a, + 0x56, 0x48, 0x4f, 0x6b, 0x63, 0x38, 0x4b, 0x54, 0x2f, 0x31, 0x45, 0x51, + 0x72, 0x42, 0x56, 0x55, 0x41, 0x64, 0x6a, 0x38, 0x42, 0x62, 0x47, 0x4a, + 0x6f, 0x58, 0x39, 0x30, 0x67, 0x35, 0x70, 0x4a, 0x31, 0x39, 0x78, 0x4f, + 0x65, 0x34, 0x70, 0x49, 0x62, 0x34, 0x74, 0x46, 0x39, 0x67, 0x3d, 0x3d, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x45, 0x43, 0x31, 0x20, + 0x4f, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, + 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x65, 0x20, 0x77, + 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, + 0x65, 0x74, 0x2f, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x74, 0x65, 0x72, + 0x6d, 0x73, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x31, 0x32, 0x20, + 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, + 0x2e, 0x20, 0x2d, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, + 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x45, 0x43, 0x31, + 0x20, 0x4f, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, + 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x65, 0x20, + 0x77, 0x77, 0x77, 0x2e, 0x65, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, + 0x6e, 0x65, 0x74, 0x2f, 0x6c, 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x74, 0x65, + 0x72, 0x6d, 0x73, 0x2f, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x31, 0x32, + 0x20, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, + 0x63, 0x2e, 0x20, 0x2d, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, + 0x6f, 0x6e, 0x6c, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x20, 0x2d, 0x20, 0x45, 0x43, 0x31, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x35, 0x31, 0x35, + 0x34, 0x33, 0x31, 0x32, 0x34, 0x34, 0x38, 0x31, 0x39, 0x33, 0x30, 0x36, + 0x34, 0x39, 0x31, 0x31, 0x34, 0x31, 0x31, 0x36, 0x31, 0x33, 0x33, 0x33, + 0x36, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x36, + 0x3a, 0x37, 0x65, 0x3a, 0x31, 0x64, 0x3a, 0x66, 0x30, 0x3a, 0x35, 0x38, + 0x3a, 0x63, 0x35, 0x3a, 0x34, 0x39, 0x3a, 0x36, 0x63, 0x3a, 0x32, 0x34, + 0x3a, 0x33, 0x62, 0x3a, 0x33, 0x64, 0x3a, 0x65, 0x64, 0x3a, 0x39, 0x38, + 0x3a, 0x31, 0x38, 0x3a, 0x65, 0x64, 0x3a, 0x62, 0x63, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x30, 0x3a, 0x64, 0x38, 0x3a, + 0x30, 0x36, 0x3a, 0x34, 0x30, 0x3a, 0x64, 0x66, 0x3a, 0x39, 0x62, 0x3a, + 0x32, 0x35, 0x3a, 0x66, 0x35, 0x3a, 0x31, 0x32, 0x3a, 0x32, 0x35, 0x3a, + 0x33, 0x61, 0x3a, 0x31, 0x31, 0x3a, 0x65, 0x61, 0x3a, 0x66, 0x37, 0x3a, + 0x35, 0x39, 0x3a, 0x38, 0x61, 0x3a, 0x65, 0x62, 0x3a, 0x31, 0x34, 0x3a, + 0x62, 0x35, 0x3a, 0x34, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x32, 0x3a, 0x65, 0x64, 0x3a, 0x30, 0x65, + 0x3a, 0x62, 0x32, 0x3a, 0x38, 0x63, 0x3a, 0x31, 0x34, 0x3a, 0x64, 0x61, + 0x3a, 0x34, 0x35, 0x3a, 0x31, 0x36, 0x3a, 0x35, 0x63, 0x3a, 0x35, 0x36, + 0x3a, 0x36, 0x37, 0x3a, 0x39, 0x31, 0x3a, 0x37, 0x30, 0x3a, 0x30, 0x64, + 0x3a, 0x36, 0x34, 0x3a, 0x35, 0x31, 0x3a, 0x64, 0x37, 0x3a, 0x66, 0x62, + 0x3a, 0x35, 0x36, 0x3a, 0x66, 0x30, 0x3a, 0x62, 0x32, 0x3a, 0x61, 0x62, + 0x3a, 0x31, 0x64, 0x3a, 0x33, 0x62, 0x3a, 0x38, 0x65, 0x3a, 0x62, 0x30, + 0x3a, 0x37, 0x30, 0x3a, 0x65, 0x35, 0x3a, 0x36, 0x65, 0x3a, 0x64, 0x66, + 0x3a, 0x66, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, + 0x2b, 0x54, 0x43, 0x43, 0x41, 0x6f, 0x43, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x4e, 0x41, 0x4b, 0x61, 0x4c, 0x65, 0x53, 0x6b, 0x41, + 0x41, 0x41, 0x41, 0x41, 0x55, 0x4e, 0x43, 0x52, 0x2b, 0x54, 0x41, 0x4b, + 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, + 0x41, 0x7a, 0x43, 0x42, 0x76, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, + 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, + 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x54, 0x44, 0x55, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, + 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, 0x79, 0x34, 0x78, 0x4b, 0x44, 0x41, + 0x6d, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x48, 0x31, 0x4e, + 0x6c, 0x5a, 0x53, 0x42, 0x33, 0x0a, 0x64, 0x33, 0x63, 0x75, 0x5a, 0x57, + 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x43, 0x35, 0x75, 0x5a, 0x58, + 0x51, 0x76, 0x62, 0x47, 0x56, 0x6e, 0x59, 0x57, 0x77, 0x74, 0x64, 0x47, + 0x56, 0x79, 0x62, 0x58, 0x4d, 0x78, 0x4f, 0x54, 0x41, 0x33, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x4d, 0x43, 0x68, 0x6a, 0x4b, 0x53, + 0x41, 0x79, 0x4d, 0x44, 0x45, 0x79, 0x49, 0x45, 0x56, 0x75, 0x0a, 0x64, + 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x73, 0x49, 0x45, 0x6c, 0x75, 0x59, + 0x79, 0x34, 0x67, 0x4c, 0x53, 0x42, 0x6d, 0x62, 0x33, 0x49, 0x67, 0x59, + 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x70, 0x6c, 0x5a, + 0x43, 0x42, 0x31, 0x63, 0x32, 0x55, 0x67, 0x62, 0x32, 0x35, 0x73, 0x65, + 0x54, 0x45, 0x7a, 0x4d, 0x44, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, + 0x78, 0x4d, 0x71, 0x0a, 0x52, 0x57, 0x35, 0x30, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x6c, + 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, + 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, + 0x61, 0x58, 0x52, 0x35, 0x49, 0x43, 0x30, 0x67, 0x52, 0x55, 0x4d, 0x78, + 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x79, 0x0a, 0x4d, 0x54, 0x49, + 0x78, 0x4f, 0x44, 0x45, 0x31, 0x4d, 0x6a, 0x55, 0x7a, 0x4e, 0x6c, 0x6f, + 0x58, 0x44, 0x54, 0x4d, 0x33, 0x4d, 0x54, 0x49, 0x78, 0x4f, 0x44, 0x45, + 0x31, 0x4e, 0x54, 0x55, 0x7a, 0x4e, 0x6c, 0x6f, 0x77, 0x67, 0x62, 0x38, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6c, 0x56, 0x54, 0x4d, 0x52, 0x59, 0x77, 0x46, 0x41, 0x59, + 0x44, 0x0a, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, 0x46, 0x62, 0x6e, + 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, + 0x4d, 0x75, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x78, 0x39, 0x54, 0x5a, 0x57, 0x55, 0x67, 0x64, 0x33, + 0x64, 0x33, 0x4c, 0x6d, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, + 0x51, 0x75, 0x62, 0x6d, 0x56, 0x30, 0x0a, 0x4c, 0x32, 0x78, 0x6c, 0x5a, + 0x32, 0x46, 0x73, 0x4c, 0x58, 0x52, 0x6c, 0x63, 0x6d, 0x31, 0x7a, 0x4d, + 0x54, 0x6b, 0x77, 0x4e, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, + 0x7a, 0x41, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x78, 0x4d, + 0x69, 0x42, 0x46, 0x62, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, + 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, 0x0a, + 0x5a, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, + 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, + 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x4d, 0x7a, 0x41, 0x78, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4b, 0x6b, 0x56, 0x75, + 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, + 0x64, 0x43, 0x42, 0x44, 0x0a, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, + 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x53, 0x41, + 0x74, 0x49, 0x45, 0x56, 0x44, 0x4d, 0x54, 0x42, 0x32, 0x4d, 0x42, 0x41, + 0x47, 0x42, 0x79, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x67, 0x45, + 0x47, 0x42, 0x53, 0x75, 0x42, 0x42, 0x41, 0x41, 0x69, 0x0a, 0x41, 0x32, + 0x49, 0x41, 0x42, 0x49, 0x51, 0x54, 0x79, 0x64, 0x43, 0x36, 0x62, 0x55, + 0x46, 0x37, 0x34, 0x6d, 0x7a, 0x51, 0x36, 0x31, 0x56, 0x66, 0x5a, 0x67, + 0x49, 0x61, 0x4a, 0x50, 0x52, 0x62, 0x69, 0x57, 0x6c, 0x48, 0x34, 0x37, + 0x6a, 0x43, 0x66, 0x66, 0x48, 0x79, 0x41, 0x73, 0x57, 0x66, 0x6f, 0x50, + 0x5a, 0x62, 0x31, 0x59, 0x73, 0x47, 0x47, 0x59, 0x5a, 0x50, 0x55, 0x78, + 0x42, 0x74, 0x0a, 0x42, 0x79, 0x51, 0x6e, 0x6f, 0x61, 0x44, 0x34, 0x31, + 0x55, 0x63, 0x5a, 0x59, 0x55, 0x78, 0x39, 0x79, 0x70, 0x4d, 0x6e, 0x36, + 0x6e, 0x51, 0x4d, 0x37, 0x32, 0x2b, 0x57, 0x43, 0x66, 0x35, 0x6a, 0x37, + 0x48, 0x42, 0x64, 0x4e, 0x71, 0x31, 0x6e, 0x64, 0x36, 0x37, 0x4a, 0x6e, + 0x58, 0x78, 0x56, 0x52, 0x44, 0x71, 0x69, 0x59, 0x31, 0x45, 0x66, 0x39, + 0x65, 0x4e, 0x69, 0x31, 0x4b, 0x6c, 0x48, 0x0a, 0x42, 0x7a, 0x37, 0x4d, + 0x49, 0x4b, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, + 0x41, 0x67, 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, + 0x41, 0x66, 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x0a, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4c, 0x64, 0x6a, 0x35, 0x78, 0x72, + 0x64, 0x6a, 0x65, 0x6b, 0x49, 0x70, 0x6c, 0x57, 0x44, 0x70, 0x4f, 0x42, + 0x71, 0x55, 0x45, 0x46, 0x6c, 0x45, 0x55, 0x4a, 0x4a, 0x4d, 0x41, 0x6f, + 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, + 0x44, 0x41, 0x32, 0x63, 0x41, 0x4d, 0x47, 0x51, 0x43, 0x4d, 0x47, 0x46, + 0x35, 0x32, 0x4f, 0x56, 0x43, 0x0a, 0x52, 0x39, 0x38, 0x63, 0x72, 0x6c, + 0x4f, 0x5a, 0x46, 0x37, 0x5a, 0x76, 0x48, 0x48, 0x33, 0x68, 0x76, 0x78, + 0x47, 0x55, 0x30, 0x51, 0x4f, 0x49, 0x64, 0x65, 0x53, 0x4e, 0x69, 0x61, + 0x53, 0x4b, 0x64, 0x30, 0x62, 0x65, 0x62, 0x57, 0x48, 0x76, 0x41, 0x76, + 0x58, 0x37, 0x74, 0x64, 0x2f, 0x4d, 0x2f, 0x6b, 0x37, 0x2f, 0x2f, 0x71, + 0x6e, 0x6d, 0x70, 0x77, 0x49, 0x77, 0x57, 0x35, 0x6e, 0x58, 0x0a, 0x68, + 0x54, 0x63, 0x47, 0x74, 0x58, 0x73, 0x49, 0x2f, 0x65, 0x73, 0x6e, 0x69, + 0x30, 0x71, 0x55, 0x2b, 0x65, 0x48, 0x36, 0x70, 0x34, 0x34, 0x6d, 0x43, + 0x4f, 0x68, 0x38, 0x6b, 0x6d, 0x68, 0x74, 0x63, 0x39, 0x68, 0x76, 0x4a, + 0x71, 0x77, 0x68, 0x41, 0x72, 0x69, 0x5a, 0x74, 0x79, 0x5a, 0x42, 0x57, + 0x79, 0x56, 0x67, 0x72, 0x74, 0x42, 0x49, 0x47, 0x75, 0x34, 0x47, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x46, 0x43, 0x41, 0x20, 0x45, 0x56, 0x20, + 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x4f, 0x3d, 0x43, 0x68, 0x69, 0x6e, 0x61, + 0x20, 0x46, 0x69, 0x6e, 0x61, 0x6e, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x43, 0x46, 0x43, 0x41, 0x20, 0x45, 0x56, 0x20, 0x52, 0x4f, 0x4f, + 0x54, 0x20, 0x4f, 0x3d, 0x43, 0x68, 0x69, 0x6e, 0x61, 0x20, 0x46, 0x69, + 0x6e, 0x61, 0x6e, 0x63, 0x69, 0x61, 0x6c, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x46, 0x43, 0x41, 0x20, 0x45, + 0x56, 0x20, 0x52, 0x4f, 0x4f, 0x54, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x30, 0x37, 0x35, 0x35, 0x35, + 0x32, 0x38, 0x36, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x37, + 0x34, 0x3a, 0x65, 0x31, 0x3a, 0x62, 0x36, 0x3a, 0x65, 0x64, 0x3a, 0x32, + 0x36, 0x3a, 0x37, 0x61, 0x3a, 0x37, 0x61, 0x3a, 0x34, 0x34, 0x3a, 0x33, + 0x30, 0x3a, 0x33, 0x33, 0x3a, 0x39, 0x34, 0x3a, 0x61, 0x62, 0x3a, 0x37, + 0x62, 0x3a, 0x32, 0x37, 0x3a, 0x38, 0x31, 0x3a, 0x33, 0x30, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x32, 0x3a, 0x62, 0x38, + 0x3a, 0x32, 0x39, 0x3a, 0x34, 0x62, 0x3a, 0x35, 0x35, 0x3a, 0x38, 0x34, + 0x3a, 0x61, 0x62, 0x3a, 0x36, 0x62, 0x3a, 0x35, 0x38, 0x3a, 0x63, 0x32, + 0x3a, 0x39, 0x30, 0x3a, 0x34, 0x36, 0x3a, 0x36, 0x63, 0x3a, 0x61, 0x63, + 0x3a, 0x33, 0x66, 0x3a, 0x62, 0x38, 0x3a, 0x33, 0x39, 0x3a, 0x38, 0x66, + 0x3a, 0x38, 0x34, 0x3a, 0x38, 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x63, 0x3a, 0x63, 0x33, 0x3a, 0x64, + 0x37, 0x3a, 0x38, 0x65, 0x3a, 0x34, 0x65, 0x3a, 0x31, 0x64, 0x3a, 0x35, + 0x65, 0x3a, 0x34, 0x35, 0x3a, 0x35, 0x34, 0x3a, 0x37, 0x61, 0x3a, 0x30, + 0x34, 0x3a, 0x65, 0x36, 0x3a, 0x38, 0x37, 0x3a, 0x33, 0x65, 0x3a, 0x36, + 0x34, 0x3a, 0x66, 0x39, 0x3a, 0x30, 0x63, 0x3a, 0x66, 0x39, 0x3a, 0x35, + 0x33, 0x3a, 0x36, 0x64, 0x3a, 0x31, 0x63, 0x3a, 0x63, 0x63, 0x3a, 0x32, + 0x65, 0x3a, 0x66, 0x38, 0x3a, 0x30, 0x30, 0x3a, 0x66, 0x33, 0x3a, 0x35, + 0x35, 0x3a, 0x63, 0x34, 0x3a, 0x63, 0x35, 0x3a, 0x66, 0x64, 0x3a, 0x37, + 0x30, 0x3a, 0x66, 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x46, 0x6a, 0x54, 0x43, 0x43, 0x41, 0x33, 0x57, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x45, 0x47, 0x45, 0x72, 0x4d, 0x31, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, 0x57, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x44, 0x0a, 0x54, 0x6a, 0x45, 0x77, 0x4d, 0x43, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x67, 0x77, 0x6e, 0x51, 0x32, 0x68, 0x70, 0x62, 0x6d, + 0x45, 0x67, 0x52, 0x6d, 0x6c, 0x75, 0x59, 0x57, 0x35, 0x6a, 0x61, 0x57, + 0x46, 0x73, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, + 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x0a, 0x61, 0x58, 0x52, 0x35, 0x4d, + 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, + 0x41, 0x78, 0x44, 0x52, 0x6b, 0x4e, 0x42, 0x49, 0x45, 0x56, 0x57, 0x49, + 0x46, 0x4a, 0x50, 0x54, 0x31, 0x51, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, + 0x54, 0x49, 0x77, 0x4f, 0x44, 0x41, 0x34, 0x4d, 0x44, 0x4d, 0x77, 0x4e, + 0x7a, 0x41, 0x78, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x6b, 0x78, 0x0a, + 0x4d, 0x6a, 0x4d, 0x78, 0x4d, 0x44, 0x4d, 0x77, 0x4e, 0x7a, 0x41, 0x78, + 0x57, 0x6a, 0x42, 0x57, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x44, 0x54, 0x6a, 0x45, 0x77, + 0x4d, 0x43, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x6e, + 0x51, 0x32, 0x68, 0x70, 0x62, 0x6d, 0x45, 0x67, 0x52, 0x6d, 0x6c, 0x75, + 0x59, 0x57, 0x35, 0x6a, 0x0a, 0x61, 0x57, 0x46, 0x73, 0x49, 0x45, 0x4e, + 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, + 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, + 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x41, 0x78, 0x44, 0x52, 0x6b, 0x4e, + 0x42, 0x49, 0x45, 0x56, 0x57, 0x49, 0x46, 0x4a, 0x50, 0x0a, 0x54, 0x31, + 0x51, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, + 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x44, 0x58, 0x58, 0x57, + 0x76, 0x4e, 0x45, 0x44, 0x38, 0x66, 0x42, 0x56, 0x6e, 0x56, 0x42, 0x55, + 0x30, 0x33, 0x0a, 0x73, 0x51, 0x37, 0x73, 0x6d, 0x43, 0x75, 0x4f, 0x46, + 0x52, 0x33, 0x36, 0x6b, 0x30, 0x73, 0x58, 0x67, 0x69, 0x46, 0x78, 0x45, + 0x46, 0x4c, 0x58, 0x55, 0x57, 0x52, 0x77, 0x46, 0x73, 0x4a, 0x56, 0x61, + 0x55, 0x32, 0x4f, 0x46, 0x57, 0x32, 0x66, 0x76, 0x77, 0x77, 0x62, 0x77, + 0x75, 0x43, 0x6a, 0x5a, 0x39, 0x59, 0x4d, 0x72, 0x4d, 0x38, 0x69, 0x72, + 0x71, 0x39, 0x33, 0x56, 0x43, 0x70, 0x4c, 0x0a, 0x54, 0x49, 0x70, 0x54, + 0x55, 0x6e, 0x72, 0x44, 0x37, 0x69, 0x37, 0x65, 0x73, 0x33, 0x45, 0x6c, + 0x77, 0x65, 0x6c, 0x64, 0x50, 0x65, 0x36, 0x68, 0x4c, 0x36, 0x50, 0x33, + 0x4b, 0x6a, 0x7a, 0x4a, 0x49, 0x78, 0x31, 0x71, 0x71, 0x78, 0x32, 0x68, + 0x70, 0x2f, 0x48, 0x7a, 0x37, 0x4b, 0x44, 0x56, 0x52, 0x4d, 0x38, 0x56, + 0x7a, 0x33, 0x49, 0x76, 0x48, 0x57, 0x4f, 0x58, 0x36, 0x4a, 0x6e, 0x35, + 0x0a, 0x2f, 0x5a, 0x4f, 0x6b, 0x56, 0x49, 0x42, 0x4d, 0x55, 0x74, 0x52, + 0x53, 0x71, 0x79, 0x35, 0x4a, 0x33, 0x35, 0x44, 0x4e, 0x75, 0x46, 0x2b, + 0x2b, 0x50, 0x39, 0x36, 0x68, 0x79, 0x6b, 0x30, 0x67, 0x31, 0x43, 0x58, + 0x6f, 0x68, 0x43, 0x6c, 0x54, 0x74, 0x37, 0x47, 0x49, 0x48, 0x2f, 0x2f, + 0x36, 0x32, 0x70, 0x43, 0x66, 0x43, 0x71, 0x6b, 0x74, 0x51, 0x54, 0x2b, + 0x78, 0x38, 0x52, 0x67, 0x70, 0x0a, 0x37, 0x68, 0x5a, 0x5a, 0x4c, 0x44, + 0x52, 0x4a, 0x47, 0x71, 0x67, 0x47, 0x31, 0x36, 0x69, 0x49, 0x30, 0x67, + 0x4e, 0x79, 0x65, 0x6a, 0x4c, 0x69, 0x36, 0x6d, 0x68, 0x4e, 0x62, 0x69, + 0x79, 0x57, 0x5a, 0x58, 0x76, 0x4b, 0x57, 0x66, 0x72, 0x79, 0x34, 0x74, + 0x33, 0x75, 0x4d, 0x43, 0x7a, 0x37, 0x7a, 0x45, 0x61, 0x73, 0x78, 0x47, + 0x50, 0x72, 0x62, 0x33, 0x38, 0x32, 0x4b, 0x7a, 0x52, 0x7a, 0x0a, 0x45, + 0x70, 0x52, 0x2f, 0x33, 0x38, 0x77, 0x6d, 0x6e, 0x76, 0x46, 0x79, 0x58, + 0x56, 0x42, 0x6c, 0x57, 0x59, 0x39, 0x70, 0x73, 0x34, 0x64, 0x65, 0x4d, + 0x6d, 0x2f, 0x44, 0x47, 0x49, 0x71, 0x31, 0x6c, 0x59, 0x2b, 0x77, 0x65, + 0x6a, 0x66, 0x65, 0x57, 0x6b, 0x55, 0x37, 0x78, 0x7a, 0x62, 0x68, 0x37, + 0x32, 0x66, 0x52, 0x4f, 0x64, 0x4f, 0x58, 0x57, 0x33, 0x4e, 0x69, 0x47, + 0x55, 0x67, 0x74, 0x0a, 0x68, 0x78, 0x77, 0x47, 0x2b, 0x33, 0x53, 0x59, + 0x49, 0x45, 0x6c, 0x7a, 0x38, 0x41, 0x58, 0x53, 0x47, 0x37, 0x47, 0x67, + 0x6f, 0x37, 0x63, 0x62, 0x63, 0x4e, 0x4f, 0x49, 0x61, 0x62, 0x6c, 0x61, + 0x31, 0x6a, 0x6a, 0x30, 0x59, 0x74, 0x77, 0x6c, 0x69, 0x33, 0x69, 0x2f, + 0x2b, 0x4f, 0x68, 0x2b, 0x75, 0x46, 0x7a, 0x4a, 0x6c, 0x55, 0x39, 0x66, + 0x70, 0x79, 0x32, 0x35, 0x49, 0x47, 0x76, 0x50, 0x0a, 0x61, 0x39, 0x33, + 0x31, 0x44, 0x66, 0x53, 0x43, 0x74, 0x2f, 0x53, 0x79, 0x5a, 0x69, 0x34, + 0x51, 0x4b, 0x50, 0x61, 0x58, 0x57, 0x6e, 0x75, 0x57, 0x46, 0x6f, 0x38, + 0x42, 0x47, 0x53, 0x31, 0x73, 0x62, 0x6e, 0x38, 0x35, 0x57, 0x41, 0x5a, + 0x6b, 0x67, 0x77, 0x47, 0x44, 0x67, 0x38, 0x4e, 0x4e, 0x6b, 0x74, 0x30, + 0x79, 0x78, 0x6f, 0x65, 0x6b, 0x4e, 0x2b, 0x6b, 0x57, 0x7a, 0x71, 0x6f, + 0x74, 0x0a, 0x61, 0x4b, 0x38, 0x4b, 0x67, 0x57, 0x55, 0x36, 0x63, 0x4d, + 0x47, 0x62, 0x72, 0x55, 0x31, 0x74, 0x56, 0x4d, 0x6f, 0x71, 0x4c, 0x55, + 0x75, 0x46, 0x47, 0x37, 0x4f, 0x41, 0x35, 0x6e, 0x42, 0x46, 0x44, 0x57, + 0x74, 0x65, 0x4e, 0x66, 0x42, 0x2f, 0x4f, 0x37, 0x69, 0x63, 0x35, 0x41, + 0x52, 0x77, 0x69, 0x52, 0x49, 0x6c, 0x6b, 0x39, 0x6f, 0x4b, 0x6d, 0x53, + 0x4a, 0x67, 0x61, 0x6d, 0x4e, 0x67, 0x0a, 0x54, 0x6e, 0x59, 0x47, 0x6d, + 0x45, 0x36, 0x39, 0x67, 0x36, 0x30, 0x64, 0x57, 0x49, 0x6f, 0x6c, 0x68, + 0x64, 0x4c, 0x48, 0x5a, 0x52, 0x34, 0x74, 0x6a, 0x73, 0x62, 0x66, 0x74, + 0x73, 0x62, 0x68, 0x66, 0x34, 0x6f, 0x45, 0x49, 0x52, 0x55, 0x70, 0x64, + 0x50, 0x41, 0x2b, 0x6e, 0x4a, 0x43, 0x64, 0x44, 0x43, 0x37, 0x78, 0x69, + 0x6a, 0x35, 0x61, 0x71, 0x67, 0x77, 0x4a, 0x48, 0x73, 0x66, 0x56, 0x0a, + 0x50, 0x4b, 0x50, 0x74, 0x6c, 0x38, 0x4d, 0x65, 0x4e, 0x50, 0x6f, 0x34, + 0x2b, 0x51, 0x67, 0x4f, 0x34, 0x38, 0x42, 0x64, 0x4b, 0x34, 0x50, 0x52, + 0x56, 0x6d, 0x72, 0x4a, 0x74, 0x71, 0x68, 0x55, 0x55, 0x79, 0x35, 0x34, + 0x4d, 0x6d, 0x63, 0x39, 0x67, 0x6e, 0x39, 0x30, 0x30, 0x50, 0x76, 0x68, + 0x74, 0x67, 0x56, 0x67, 0x75, 0x58, 0x44, 0x62, 0x6a, 0x67, 0x76, 0x35, + 0x45, 0x31, 0x68, 0x76, 0x0a, 0x63, 0x57, 0x41, 0x51, 0x55, 0x68, 0x43, + 0x35, 0x77, 0x55, 0x45, 0x4a, 0x37, 0x33, 0x49, 0x66, 0x5a, 0x7a, 0x46, + 0x34, 0x2f, 0x35, 0x59, 0x46, 0x6a, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, + 0x42, 0x6f, 0x32, 0x4d, 0x77, 0x59, 0x54, 0x41, 0x66, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, 0x54, + 0x6a, 0x2f, 0x69, 0x33, 0x39, 0x4b, 0x4e, 0x41, 0x4c, 0x0a, 0x74, 0x62, + 0x71, 0x32, 0x6f, 0x73, 0x53, 0x2f, 0x42, 0x71, 0x6f, 0x46, 0x6a, 0x4a, + 0x50, 0x37, 0x4c, 0x7a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, + 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, + 0x41, 0x64, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, + 0x67, 0x51, 0x55, 0x34, 0x2f, 0x34, 0x74, 0x2f, 0x53, 0x6a, 0x51, 0x43, + 0x37, 0x57, 0x36, 0x74, 0x71, 0x4c, 0x45, 0x76, 0x77, 0x61, 0x71, 0x42, + 0x59, 0x79, 0x54, 0x2b, 0x79, 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x0a, 0x41, 0x43, 0x58, 0x47, + 0x75, 0x6d, 0x76, 0x72, 0x68, 0x38, 0x76, 0x65, 0x67, 0x6a, 0x6d, 0x57, + 0x50, 0x66, 0x42, 0x45, 0x70, 0x32, 0x75, 0x45, 0x63, 0x77, 0x50, 0x65, + 0x6e, 0x53, 0x74, 0x50, 0x75, 0x69, 0x42, 0x2f, 0x76, 0x48, 0x69, 0x79, + 0x7a, 0x35, 0x65, 0x77, 0x47, 0x35, 0x7a, 0x7a, 0x31, 0x33, 0x6b, 0x75, + 0x39, 0x55, 0x69, 0x32, 0x30, 0x76, 0x73, 0x58, 0x69, 0x4f, 0x62, 0x54, + 0x0a, 0x65, 0x6a, 0x2f, 0x74, 0x55, 0x78, 0x50, 0x51, 0x34, 0x69, 0x39, + 0x71, 0x65, 0x63, 0x73, 0x41, 0x49, 0x79, 0x6a, 0x6d, 0x48, 0x6a, 0x64, + 0x58, 0x4e, 0x59, 0x6d, 0x45, 0x77, 0x6e, 0x5a, 0x50, 0x4e, 0x44, 0x61, + 0x74, 0x5a, 0x38, 0x50, 0x4f, 0x51, 0x51, 0x61, 0x49, 0x78, 0x66, 0x66, + 0x75, 0x32, 0x42, 0x71, 0x34, 0x31, 0x67, 0x74, 0x2f, 0x55, 0x50, 0x2b, + 0x54, 0x71, 0x68, 0x64, 0x4c, 0x0a, 0x6a, 0x4f, 0x7a, 0x74, 0x55, 0x6d, + 0x43, 0x79, 0x70, 0x41, 0x62, 0x71, 0x54, 0x75, 0x76, 0x30, 0x61, 0x78, + 0x6e, 0x39, 0x36, 0x2f, 0x55, 0x61, 0x34, 0x43, 0x55, 0x71, 0x6d, 0x74, + 0x7a, 0x48, 0x51, 0x54, 0x62, 0x33, 0x79, 0x48, 0x51, 0x46, 0x68, 0x44, + 0x6d, 0x56, 0x4f, 0x64, 0x59, 0x4c, 0x4f, 0x36, 0x51, 0x6e, 0x2b, 0x67, + 0x6a, 0x59, 0x58, 0x42, 0x37, 0x34, 0x42, 0x47, 0x42, 0x53, 0x0a, 0x45, + 0x53, 0x67, 0x6f, 0x41, 0x2f, 0x2f, 0x76, 0x55, 0x32, 0x59, 0x41, 0x70, + 0x55, 0x6f, 0x30, 0x46, 0x6d, 0x5a, 0x38, 0x2f, 0x51, 0x6d, 0x6b, 0x72, + 0x70, 0x35, 0x6e, 0x47, 0x6d, 0x39, 0x42, 0x43, 0x32, 0x73, 0x47, 0x45, + 0x35, 0x75, 0x50, 0x68, 0x6e, 0x45, 0x46, 0x74, 0x43, 0x2b, 0x4e, 0x69, + 0x57, 0x59, 0x7a, 0x4b, 0x58, 0x5a, 0x55, 0x6d, 0x68, 0x48, 0x34, 0x4a, + 0x2f, 0x71, 0x79, 0x0a, 0x50, 0x35, 0x48, 0x67, 0x7a, 0x67, 0x30, 0x62, + 0x38, 0x7a, 0x41, 0x61, 0x72, 0x62, 0x38, 0x69, 0x58, 0x52, 0x76, 0x54, + 0x76, 0x79, 0x55, 0x46, 0x54, 0x65, 0x47, 0x53, 0x47, 0x6e, 0x2b, 0x5a, + 0x6e, 0x7a, 0x78, 0x45, 0x6b, 0x38, 0x72, 0x55, 0x51, 0x45, 0x6c, 0x73, + 0x67, 0x49, 0x66, 0x58, 0x42, 0x44, 0x72, 0x44, 0x4d, 0x6c, 0x49, 0x31, + 0x44, 0x6c, 0x62, 0x34, 0x70, 0x64, 0x31, 0x39, 0x0a, 0x78, 0x49, 0x73, + 0x4e, 0x45, 0x52, 0x39, 0x54, 0x79, 0x78, 0x36, 0x79, 0x46, 0x37, 0x5a, + 0x6f, 0x64, 0x31, 0x72, 0x67, 0x31, 0x4d, 0x76, 0x49, 0x42, 0x36, 0x37, + 0x31, 0x4f, 0x69, 0x36, 0x4f, 0x4e, 0x37, 0x66, 0x51, 0x41, 0x55, 0x74, + 0x44, 0x4b, 0x58, 0x65, 0x4d, 0x4f, 0x5a, 0x65, 0x50, 0x67, 0x6c, 0x72, + 0x34, 0x55, 0x65, 0x57, 0x4a, 0x6f, 0x42, 0x6a, 0x6e, 0x61, 0x48, 0x39, + 0x64, 0x0a, 0x43, 0x69, 0x37, 0x37, 0x6f, 0x30, 0x63, 0x4f, 0x50, 0x61, + 0x59, 0x6a, 0x65, 0x73, 0x59, 0x42, 0x78, 0x34, 0x2f, 0x49, 0x58, 0x72, + 0x39, 0x74, 0x67, 0x46, 0x61, 0x2b, 0x69, 0x69, 0x53, 0x36, 0x4d, 0x2b, + 0x71, 0x66, 0x34, 0x54, 0x49, 0x52, 0x6e, 0x76, 0x48, 0x53, 0x54, 0x34, + 0x44, 0x32, 0x47, 0x30, 0x43, 0x76, 0x4f, 0x4a, 0x34, 0x52, 0x55, 0x48, + 0x6c, 0x7a, 0x45, 0x68, 0x4c, 0x4e, 0x0a, 0x35, 0x6d, 0x79, 0x64, 0x4c, + 0x49, 0x68, 0x79, 0x50, 0x44, 0x43, 0x42, 0x42, 0x70, 0x45, 0x69, 0x36, + 0x6c, 0x6d, 0x74, 0x32, 0x68, 0x6b, 0x75, 0x49, 0x73, 0x4b, 0x4e, 0x75, + 0x59, 0x79, 0x48, 0x34, 0x47, 0x61, 0x38, 0x63, 0x79, 0x4e, 0x66, 0x49, + 0x57, 0x52, 0x6a, 0x67, 0x45, 0x6a, 0x31, 0x6f, 0x44, 0x77, 0x59, 0x50, + 0x5a, 0x54, 0x49, 0x53, 0x45, 0x45, 0x64, 0x51, 0x4c, 0x70, 0x65, 0x0a, + 0x2f, 0x76, 0x35, 0x57, 0x4f, 0x61, 0x48, 0x49, 0x7a, 0x31, 0x36, 0x65, + 0x47, 0x57, 0x52, 0x47, 0x45, 0x4e, 0x6f, 0x58, 0x6b, 0x62, 0x63, 0x46, + 0x67, 0x4b, 0x79, 0x4c, 0x6d, 0x5a, 0x4a, 0x39, 0x35, 0x36, 0x4c, 0x59, + 0x42, 0x77, 0x73, 0x32, 0x4a, 0x2b, 0x64, 0x49, 0x65, 0x57, 0x43, 0x4b, + 0x77, 0x39, 0x63, 0x54, 0x58, 0x50, 0x68, 0x79, 0x51, 0x4e, 0x39, 0x4b, + 0x79, 0x38, 0x2b, 0x5a, 0x0a, 0x41, 0x41, 0x6f, 0x41, 0x43, 0x78, 0x47, + 0x56, 0x32, 0x6c, 0x5a, 0x46, 0x41, 0x34, 0x67, 0x4b, 0x6e, 0x32, 0x66, + 0x51, 0x31, 0x58, 0x6d, 0x78, 0x71, 0x49, 0x31, 0x41, 0x62, 0x51, 0x33, + 0x43, 0x65, 0x6b, 0x44, 0x36, 0x38, 0x31, 0x39, 0x6b, 0x52, 0x35, 0x4c, + 0x4c, 0x55, 0x37, 0x6d, 0x37, 0x57, 0x63, 0x35, 0x50, 0x2f, 0x64, 0x41, + 0x56, 0x55, 0x77, 0x48, 0x59, 0x33, 0x2b, 0x76, 0x5a, 0x0a, 0x35, 0x6e, + 0x62, 0x76, 0x30, 0x43, 0x4f, 0x37, 0x4f, 0x36, 0x6c, 0x35, 0x73, 0x39, + 0x55, 0x43, 0x4b, 0x63, 0x32, 0x4a, 0x6f, 0x35, 0x59, 0x50, 0x53, 0x6a, + 0x58, 0x6e, 0x54, 0x6b, 0x4c, 0x41, 0x64, 0x63, 0x30, 0x48, 0x7a, 0x2b, + 0x59, 0x73, 0x36, 0x33, 0x73, 0x75, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4f, + 0x49, 0x53, 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, 0x79, + 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x47, 0x42, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x57, 0x49, 0x53, + 0x65, 0x4b, 0x65, 0x79, 0x20, 0x4f, 0x55, 0x3d, 0x4f, 0x49, 0x53, 0x54, + 0x45, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x4f, 0x49, 0x53, 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, + 0x79, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x47, 0x42, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x57, 0x49, + 0x53, 0x65, 0x4b, 0x65, 0x79, 0x20, 0x4f, 0x55, 0x3d, 0x4f, 0x49, 0x53, + 0x54, 0x45, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x4f, 0x49, 0x53, + 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, 0x79, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, + 0x42, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x35, 0x37, 0x37, 0x36, 0x38, 0x35, 0x39, + 0x35, 0x36, 0x31, 0x36, 0x35, 0x38, 0x38, 0x34, 0x31, 0x34, 0x34, 0x32, + 0x32, 0x31, 0x35, 0x39, 0x32, 0x37, 0x38, 0x39, 0x36, 0x36, 0x37, 0x35, + 0x30, 0x37, 0x35, 0x37, 0x35, 0x36, 0x38, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x61, 0x34, 0x3a, 0x65, 0x62, 0x3a, 0x62, 0x39, 0x3a, + 0x36, 0x31, 0x3a, 0x32, 0x38, 0x3a, 0x32, 0x65, 0x3a, 0x62, 0x37, 0x3a, + 0x32, 0x66, 0x3a, 0x39, 0x38, 0x3a, 0x62, 0x30, 0x3a, 0x33, 0x35, 0x3a, + 0x32, 0x36, 0x3a, 0x39, 0x30, 0x3a, 0x39, 0x39, 0x3a, 0x35, 0x31, 0x3a, + 0x31, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, + 0x66, 0x3a, 0x66, 0x39, 0x3a, 0x34, 0x30, 0x3a, 0x37, 0x36, 0x3a, 0x31, + 0x38, 0x3a, 0x64, 0x33, 0x3a, 0x64, 0x37, 0x3a, 0x36, 0x61, 0x3a, 0x34, + 0x62, 0x3a, 0x39, 0x38, 0x3a, 0x66, 0x30, 0x3a, 0x61, 0x38, 0x3a, 0x33, + 0x35, 0x3a, 0x39, 0x65, 0x3a, 0x30, 0x63, 0x3a, 0x66, 0x64, 0x3a, 0x32, + 0x37, 0x3a, 0x61, 0x63, 0x3a, 0x63, 0x63, 0x3a, 0x65, 0x64, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x62, 0x3a, + 0x39, 0x63, 0x3a, 0x30, 0x38, 0x3a, 0x65, 0x38, 0x3a, 0x36, 0x65, 0x3a, + 0x62, 0x30, 0x3a, 0x66, 0x37, 0x3a, 0x36, 0x37, 0x3a, 0x63, 0x66, 0x3a, + 0x61, 0x64, 0x3a, 0x36, 0x35, 0x3a, 0x63, 0x64, 0x3a, 0x39, 0x38, 0x3a, + 0x62, 0x36, 0x3a, 0x32, 0x31, 0x3a, 0x34, 0x39, 0x3a, 0x65, 0x35, 0x3a, + 0x34, 0x39, 0x3a, 0x34, 0x61, 0x3a, 0x36, 0x37, 0x3a, 0x66, 0x35, 0x3a, + 0x38, 0x34, 0x3a, 0x35, 0x65, 0x3a, 0x37, 0x62, 0x3a, 0x64, 0x31, 0x3a, + 0x65, 0x64, 0x3a, 0x30, 0x31, 0x3a, 0x39, 0x66, 0x3a, 0x32, 0x37, 0x3a, + 0x62, 0x38, 0x3a, 0x36, 0x62, 0x3a, 0x64, 0x36, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x74, 0x54, 0x43, 0x43, 0x41, 0x70, 0x32, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x64, 0x72, 0x45, + 0x67, 0x55, 0x6e, 0x54, 0x77, 0x68, 0x59, 0x64, 0x47, 0x73, 0x2f, 0x67, + 0x6a, 0x47, 0x76, 0x62, 0x43, 0x77, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, + 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, + 0x46, 0x41, 0x44, 0x42, 0x74, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x44, 0x53, 0x44, + 0x45, 0x51, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, + 0x4d, 0x48, 0x56, 0x30, 0x6c, 0x54, 0x5a, 0x55, 0x74, 0x6c, 0x65, 0x54, + 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, + 0x4d, 0x5a, 0x54, 0x30, 0x6c, 0x54, 0x56, 0x45, 0x55, 0x67, 0x0a, 0x52, + 0x6d, 0x39, 0x31, 0x62, 0x6d, 0x52, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, + 0x69, 0x42, 0x46, 0x62, 0x6d, 0x52, 0x76, 0x63, 0x6e, 0x4e, 0x6c, 0x5a, + 0x44, 0x45, 0x6f, 0x4d, 0x43, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, + 0x78, 0x4d, 0x66, 0x54, 0x30, 0x6c, 0x54, 0x56, 0x45, 0x55, 0x67, 0x56, + 0x30, 0x6c, 0x54, 0x5a, 0x55, 0x74, 0x6c, 0x65, 0x53, 0x42, 0x48, 0x62, + 0x47, 0x39, 0x69, 0x0a, 0x59, 0x57, 0x77, 0x67, 0x55, 0x6d, 0x39, 0x76, + 0x64, 0x43, 0x42, 0x48, 0x51, 0x69, 0x42, 0x44, 0x51, 0x54, 0x41, 0x65, + 0x46, 0x77, 0x30, 0x78, 0x4e, 0x44, 0x45, 0x79, 0x4d, 0x44, 0x45, 0x78, + 0x4e, 0x54, 0x41, 0x77, 0x4d, 0x7a, 0x4a, 0x61, 0x46, 0x77, 0x30, 0x7a, + 0x4f, 0x54, 0x45, 0x79, 0x4d, 0x44, 0x45, 0x78, 0x4e, 0x54, 0x45, 0x77, + 0x4d, 0x7a, 0x46, 0x61, 0x4d, 0x47, 0x30, 0x78, 0x0a, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x4e, + 0x49, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4b, 0x45, 0x77, 0x64, 0x58, 0x53, 0x56, 0x4e, 0x6c, 0x53, 0x32, 0x56, + 0x35, 0x4d, 0x53, 0x49, 0x77, 0x49, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x78, 0x6c, 0x50, 0x53, 0x56, 0x4e, 0x55, 0x52, 0x53, 0x42, + 0x47, 0x0a, 0x62, 0x33, 0x56, 0x75, 0x5a, 0x47, 0x46, 0x30, 0x61, 0x57, + 0x39, 0x75, 0x49, 0x45, 0x56, 0x75, 0x5a, 0x47, 0x39, 0x79, 0x63, 0x32, + 0x56, 0x6b, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x39, 0x50, 0x53, 0x56, 0x4e, 0x55, 0x52, 0x53, + 0x42, 0x58, 0x53, 0x56, 0x4e, 0x6c, 0x53, 0x32, 0x56, 0x35, 0x49, 0x45, + 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x0a, 0x62, 0x43, 0x42, 0x53, 0x62, + 0x32, 0x39, 0x30, 0x49, 0x45, 0x64, 0x43, 0x49, 0x45, 0x4e, 0x42, 0x4d, + 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, + 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x43, + 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x32, 0x42, 0x65, 0x33, 0x0a, + 0x48, 0x45, 0x6f, 0x6b, 0x4b, 0x74, 0x61, 0x58, 0x73, 0x63, 0x72, 0x69, + 0x48, 0x76, 0x74, 0x39, 0x4f, 0x4f, 0x2b, 0x59, 0x39, 0x62, 0x49, 0x35, + 0x6d, 0x45, 0x34, 0x6e, 0x75, 0x42, 0x46, 0x64, 0x65, 0x39, 0x49, 0x6c, + 0x6c, 0x49, 0x69, 0x43, 0x46, 0x53, 0x5a, 0x71, 0x47, 0x7a, 0x47, 0x37, + 0x71, 0x46, 0x73, 0x68, 0x49, 0x53, 0x76, 0x59, 0x44, 0x30, 0x36, 0x66, + 0x57, 0x76, 0x47, 0x78, 0x0a, 0x57, 0x75, 0x52, 0x35, 0x31, 0x6a, 0x49, + 0x6a, 0x4b, 0x2b, 0x46, 0x54, 0x7a, 0x4a, 0x6c, 0x46, 0x58, 0x48, 0x74, + 0x50, 0x72, 0x62, 0x79, 0x2f, 0x68, 0x30, 0x6f, 0x4c, 0x53, 0x35, 0x64, + 0x61, 0x71, 0x50, 0x5a, 0x49, 0x37, 0x48, 0x31, 0x37, 0x44, 0x63, 0x30, + 0x68, 0x42, 0x74, 0x2b, 0x65, 0x46, 0x66, 0x31, 0x42, 0x69, 0x6b, 0x69, + 0x33, 0x49, 0x50, 0x53, 0x68, 0x65, 0x68, 0x74, 0x58, 0x0a, 0x31, 0x46, + 0x31, 0x51, 0x2f, 0x37, 0x70, 0x6e, 0x32, 0x43, 0x4f, 0x5a, 0x48, 0x38, + 0x67, 0x2f, 0x34, 0x39, 0x37, 0x2f, 0x62, 0x31, 0x74, 0x33, 0x73, 0x57, + 0x74, 0x75, 0x75, 0x4d, 0x6c, 0x6b, 0x39, 0x2b, 0x48, 0x4b, 0x51, 0x55, + 0x59, 0x4f, 0x4b, 0x58, 0x48, 0x51, 0x75, 0x53, 0x50, 0x38, 0x79, 0x59, + 0x46, 0x66, 0x54, 0x76, 0x64, 0x76, 0x33, 0x37, 0x2b, 0x45, 0x72, 0x58, + 0x4e, 0x6b, 0x0a, 0x75, 0x37, 0x64, 0x43, 0x6a, 0x6d, 0x6e, 0x32, 0x31, + 0x48, 0x59, 0x64, 0x66, 0x70, 0x32, 0x6e, 0x75, 0x46, 0x65, 0x4b, 0x55, + 0x57, 0x64, 0x79, 0x31, 0x39, 0x53, 0x6f, 0x75, 0x4a, 0x56, 0x55, 0x51, + 0x48, 0x4d, 0x44, 0x39, 0x75, 0x72, 0x30, 0x36, 0x2f, 0x34, 0x6f, 0x51, + 0x6e, 0x63, 0x2f, 0x6e, 0x53, 0x4d, 0x62, 0x73, 0x72, 0x59, 0x39, 0x67, + 0x42, 0x51, 0x48, 0x54, 0x43, 0x35, 0x50, 0x0a, 0x39, 0x39, 0x55, 0x4b, + 0x46, 0x67, 0x32, 0x39, 0x5a, 0x6b, 0x4d, 0x33, 0x66, 0x69, 0x4e, 0x44, + 0x65, 0x63, 0x4e, 0x41, 0x68, 0x76, 0x56, 0x4d, 0x4b, 0x64, 0x71, 0x4f, + 0x6d, 0x71, 0x30, 0x4e, 0x70, 0x51, 0x53, 0x48, 0x69, 0x42, 0x36, 0x46, + 0x34, 0x2b, 0x6c, 0x54, 0x31, 0x5a, 0x76, 0x49, 0x69, 0x77, 0x4e, 0x6a, + 0x65, 0x4f, 0x76, 0x67, 0x47, 0x55, 0x70, 0x75, 0x75, 0x79, 0x39, 0x72, + 0x0a, 0x4d, 0x32, 0x52, 0x59, 0x6b, 0x36, 0x31, 0x70, 0x76, 0x34, 0x38, + 0x62, 0x37, 0x34, 0x4a, 0x49, 0x78, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, + 0x42, 0x6f, 0x31, 0x45, 0x77, 0x54, 0x7a, 0x41, 0x4c, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x59, 0x59, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x55, 0x77, 0x0a, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, + 0x51, 0x55, 0x4e, 0x51, 0x2f, 0x49, 0x4e, 0x6d, 0x4e, 0x65, 0x34, 0x71, + 0x50, 0x73, 0x2b, 0x54, 0x74, 0x6d, 0x46, 0x63, 0x35, 0x52, 0x55, 0x75, + 0x4f, 0x52, 0x6d, 0x6a, 0x30, 0x77, 0x45, 0x41, 0x59, 0x4a, 0x4b, 0x77, + 0x59, 0x42, 0x42, 0x41, 0x47, 0x43, 0x4e, 0x78, 0x55, 0x42, 0x0a, 0x42, + 0x41, 0x4d, 0x43, 0x41, 0x51, 0x41, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, 0x41, 0x45, 0x42, 0x4d, 0x2b, + 0x34, 0x65, 0x79, 0x6d, 0x59, 0x47, 0x51, 0x66, 0x70, 0x33, 0x46, 0x73, + 0x4c, 0x41, 0x6d, 0x7a, 0x59, 0x68, 0x37, 0x4b, 0x7a, 0x4b, 0x4e, 0x62, + 0x72, 0x67, 0x68, 0x0a, 0x63, 0x56, 0x69, 0x58, 0x66, 0x61, 0x34, 0x33, + 0x46, 0x4b, 0x38, 0x2b, 0x35, 0x2f, 0x65, 0x61, 0x34, 0x6e, 0x33, 0x32, + 0x63, 0x5a, 0x69, 0x5a, 0x42, 0x4b, 0x70, 0x44, 0x64, 0x48, 0x69, 0x6a, + 0x34, 0x30, 0x6c, 0x68, 0x50, 0x6e, 0x4f, 0x4d, 0x54, 0x5a, 0x54, 0x67, + 0x2b, 0x58, 0x48, 0x45, 0x74, 0x68, 0x59, 0x4f, 0x55, 0x33, 0x67, 0x66, + 0x31, 0x71, 0x4b, 0x48, 0x4c, 0x77, 0x49, 0x35, 0x0a, 0x67, 0x53, 0x6b, + 0x38, 0x72, 0x78, 0x57, 0x59, 0x49, 0x54, 0x44, 0x2b, 0x4b, 0x4a, 0x41, + 0x41, 0x6a, 0x4e, 0x48, 0x68, 0x79, 0x2f, 0x70, 0x65, 0x79, 0x50, 0x33, + 0x34, 0x45, 0x45, 0x59, 0x37, 0x6f, 0x6e, 0x68, 0x43, 0x6b, 0x52, 0x64, + 0x30, 0x56, 0x51, 0x72, 0x65, 0x55, 0x47, 0x64, 0x4e, 0x5a, 0x74, 0x47, + 0x6e, 0x2f, 0x2f, 0x33, 0x5a, 0x77, 0x4c, 0x57, 0x6f, 0x6f, 0x34, 0x72, + 0x4f, 0x0a, 0x5a, 0x76, 0x55, 0x50, 0x51, 0x38, 0x32, 0x6e, 0x4b, 0x31, + 0x64, 0x37, 0x59, 0x30, 0x5a, 0x71, 0x71, 0x69, 0x35, 0x53, 0x32, 0x50, + 0x54, 0x74, 0x34, 0x57, 0x32, 0x74, 0x4b, 0x5a, 0x42, 0x34, 0x53, 0x4c, + 0x72, 0x68, 0x49, 0x36, 0x71, 0x6a, 0x69, 0x65, 0x79, 0x31, 0x71, 0x35, + 0x62, 0x41, 0x74, 0x45, 0x75, 0x69, 0x48, 0x5a, 0x65, 0x65, 0x65, 0x76, + 0x4a, 0x75, 0x51, 0x48, 0x48, 0x66, 0x0a, 0x61, 0x50, 0x46, 0x6c, 0x54, + 0x63, 0x35, 0x38, 0x42, 0x64, 0x39, 0x54, 0x5a, 0x61, 0x6d, 0x6c, 0x38, + 0x4c, 0x47, 0x58, 0x42, 0x48, 0x41, 0x56, 0x52, 0x67, 0x4f, 0x59, 0x31, + 0x4e, 0x4b, 0x2f, 0x56, 0x4c, 0x53, 0x67, 0x57, 0x48, 0x31, 0x53, 0x62, + 0x39, 0x70, 0x57, 0x4a, 0x6d, 0x4c, 0x55, 0x32, 0x4e, 0x75, 0x4a, 0x4d, + 0x57, 0x38, 0x63, 0x38, 0x43, 0x4c, 0x43, 0x30, 0x32, 0x49, 0x63, 0x0a, + 0x4e, 0x63, 0x31, 0x4d, 0x61, 0x52, 0x56, 0x55, 0x47, 0x70, 0x43, 0x59, + 0x33, 0x75, 0x73, 0x65, 0x58, 0x38, 0x70, 0x33, 0x78, 0x38, 0x75, 0x4f, + 0x50, 0x55, 0x4e, 0x70, 0x6e, 0x4a, 0x70, 0x59, 0x30, 0x43, 0x51, 0x37, + 0x33, 0x78, 0x74, 0x41, 0x6c, 0x6e, 0x34, 0x31, 0x72, 0x59, 0x48, 0x48, + 0x54, 0x6e, 0x47, 0x36, 0x69, 0x42, 0x4d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x53, 0x5a, 0x41, 0x46, 0x49, 0x52, 0x20, 0x52, 0x4f, 0x4f, 0x54, + 0x20, 0x43, 0x41, 0x32, 0x20, 0x4f, 0x3d, 0x4b, 0x72, 0x61, 0x6a, 0x6f, + 0x77, 0x61, 0x20, 0x49, 0x7a, 0x62, 0x61, 0x20, 0x52, 0x6f, 0x7a, 0x6c, + 0x69, 0x63, 0x7a, 0x65, 0x6e, 0x69, 0x6f, 0x77, 0x61, 0x20, 0x53, 0x2e, + 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x5a, 0x41, 0x46, 0x49, 0x52, 0x20, + 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, 0x32, 0x20, 0x4f, 0x3d, 0x4b, + 0x72, 0x61, 0x6a, 0x6f, 0x77, 0x61, 0x20, 0x49, 0x7a, 0x62, 0x61, 0x20, + 0x52, 0x6f, 0x7a, 0x6c, 0x69, 0x63, 0x7a, 0x65, 0x6e, 0x69, 0x6f, 0x77, + 0x61, 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x5a, 0x41, 0x46, 0x49, 0x52, 0x20, + 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, 0x32, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x35, 0x37, 0x30, + 0x34, 0x33, 0x30, 0x33, 0x34, 0x37, 0x36, 0x37, 0x31, 0x38, 0x36, 0x39, + 0x31, 0x34, 0x32, 0x31, 0x37, 0x32, 0x37, 0x37, 0x33, 0x34, 0x34, 0x35, + 0x38, 0x37, 0x33, 0x38, 0x36, 0x37, 0x34, 0x33, 0x33, 0x37, 0x37, 0x35, + 0x35, 0x38, 0x32, 0x39, 0x36, 0x32, 0x39, 0x32, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x31, 0x3a, 0x36, 0x34, 0x3a, 0x63, 0x31, + 0x3a, 0x38, 0x39, 0x3a, 0x62, 0x30, 0x3a, 0x32, 0x34, 0x3a, 0x62, 0x31, + 0x3a, 0x38, 0x63, 0x3a, 0x62, 0x31, 0x3a, 0x30, 0x37, 0x3a, 0x37, 0x65, + 0x3a, 0x38, 0x39, 0x3a, 0x39, 0x65, 0x3a, 0x35, 0x31, 0x3a, 0x39, 0x65, + 0x3a, 0x39, 0x39, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x65, 0x32, 0x3a, 0x35, 0x32, 0x3a, 0x66, 0x61, 0x3a, 0x39, 0x35, 0x3a, + 0x33, 0x66, 0x3a, 0x65, 0x64, 0x3a, 0x64, 0x62, 0x3a, 0x32, 0x34, 0x3a, + 0x36, 0x30, 0x3a, 0x62, 0x64, 0x3a, 0x36, 0x65, 0x3a, 0x32, 0x38, 0x3a, + 0x66, 0x33, 0x3a, 0x39, 0x63, 0x3a, 0x63, 0x63, 0x3a, 0x63, 0x66, 0x3a, + 0x35, 0x65, 0x3a, 0x62, 0x33, 0x3a, 0x33, 0x66, 0x3a, 0x64, 0x65, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x31, + 0x3a, 0x33, 0x33, 0x3a, 0x39, 0x64, 0x3a, 0x33, 0x33, 0x3a, 0x32, 0x38, + 0x3a, 0x31, 0x61, 0x3a, 0x30, 0x62, 0x3a, 0x35, 0x36, 0x3a, 0x65, 0x35, + 0x3a, 0x35, 0x37, 0x3a, 0x64, 0x33, 0x3a, 0x64, 0x33, 0x3a, 0x32, 0x62, + 0x3a, 0x31, 0x63, 0x3a, 0x65, 0x37, 0x3a, 0x66, 0x39, 0x3a, 0x33, 0x36, + 0x3a, 0x37, 0x65, 0x3a, 0x62, 0x30, 0x3a, 0x39, 0x34, 0x3a, 0x62, 0x64, + 0x3a, 0x35, 0x66, 0x3a, 0x61, 0x37, 0x3a, 0x32, 0x61, 0x3a, 0x37, 0x65, + 0x3a, 0x35, 0x30, 0x3a, 0x30, 0x34, 0x3a, 0x63, 0x38, 0x3a, 0x64, 0x65, + 0x3a, 0x64, 0x37, 0x3a, 0x63, 0x61, 0x3a, 0x66, 0x65, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x63, 0x6a, 0x43, 0x43, 0x41, 0x6c, + 0x71, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x55, 0x50, 0x6f, + 0x70, 0x64, 0x42, 0x2b, 0x78, 0x56, 0x30, 0x6a, 0x4c, 0x56, 0x74, 0x2b, + 0x4f, 0x32, 0x58, 0x77, 0x48, 0x72, 0x4c, 0x64, 0x7a, 0x6b, 0x31, 0x75, + 0x51, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x77, 0x55, + 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x55, 0x45, 0x77, 0x78, 0x4b, 0x44, 0x41, 0x6d, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x48, 0x30, 0x74, 0x79, 0x59, + 0x57, 0x70, 0x76, 0x64, 0x32, 0x45, 0x67, 0x53, 0x58, 0x70, 0x69, 0x59, + 0x53, 0x42, 0x53, 0x62, 0x33, 0x70, 0x73, 0x61, 0x57, 0x4e, 0x36, 0x0a, + 0x5a, 0x57, 0x35, 0x70, 0x62, 0x33, 0x64, 0x68, 0x49, 0x46, 0x4d, 0x75, + 0x51, 0x53, 0x34, 0x78, 0x47, 0x44, 0x41, 0x57, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x4d, 0x44, 0x31, 0x4e, 0x61, 0x51, 0x55, 0x5a, 0x4a, + 0x55, 0x69, 0x42, 0x53, 0x54, 0x30, 0x39, 0x55, 0x49, 0x45, 0x4e, 0x42, + 0x4d, 0x6a, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4e, 0x54, 0x45, 0x77, + 0x4d, 0x54, 0x6b, 0x77, 0x0a, 0x4e, 0x7a, 0x51, 0x7a, 0x4d, 0x7a, 0x42, + 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4e, 0x54, 0x45, 0x77, 0x4d, 0x54, 0x6b, + 0x77, 0x4e, 0x7a, 0x51, 0x7a, 0x4d, 0x7a, 0x42, 0x61, 0x4d, 0x46, 0x45, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6c, 0x42, 0x4d, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x39, 0x4c, 0x0a, 0x63, 0x6d, + 0x46, 0x71, 0x62, 0x33, 0x64, 0x68, 0x49, 0x45, 0x6c, 0x36, 0x59, 0x6d, + 0x45, 0x67, 0x55, 0x6d, 0x39, 0x36, 0x62, 0x47, 0x6c, 0x6a, 0x65, 0x6d, + 0x56, 0x75, 0x61, 0x57, 0x39, 0x33, 0x59, 0x53, 0x42, 0x54, 0x4c, 0x6b, + 0x45, 0x75, 0x4d, 0x52, 0x67, 0x77, 0x46, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x44, 0x41, 0x39, 0x54, 0x57, 0x6b, 0x46, 0x47, 0x53, 0x56, + 0x49, 0x67, 0x0a, 0x55, 0x6b, 0x39, 0x50, 0x56, 0x43, 0x42, 0x44, 0x51, + 0x54, 0x49, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, + 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, + 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, + 0x67, 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x43, 0x33, 0x76, + 0x44, 0x35, 0x51, 0x71, 0x45, 0x76, 0x4e, 0x0a, 0x51, 0x4c, 0x58, 0x4f, + 0x59, 0x65, 0x65, 0x57, 0x79, 0x72, 0x53, 0x68, 0x32, 0x67, 0x77, 0x69, + 0x73, 0x50, 0x71, 0x31, 0x65, 0x33, 0x59, 0x41, 0x64, 0x34, 0x77, 0x4c, + 0x7a, 0x33, 0x32, 0x6f, 0x68, 0x73, 0x77, 0x6d, 0x55, 0x65, 0x51, 0x67, + 0x50, 0x59, 0x55, 0x4d, 0x31, 0x6c, 0x6a, 0x6a, 0x35, 0x2f, 0x51, 0x71, + 0x47, 0x4a, 0x33, 0x61, 0x30, 0x61, 0x34, 0x6d, 0x37, 0x75, 0x74, 0x54, + 0x0a, 0x33, 0x50, 0x53, 0x51, 0x31, 0x68, 0x4e, 0x4b, 0x44, 0x4a, 0x41, + 0x38, 0x77, 0x2f, 0x54, 0x61, 0x30, 0x6f, 0x34, 0x4e, 0x6b, 0x6a, 0x72, + 0x63, 0x73, 0x62, 0x48, 0x2f, 0x4f, 0x4e, 0x37, 0x44, 0x75, 0x69, 0x31, + 0x66, 0x67, 0x4c, 0x6b, 0x43, 0x76, 0x55, 0x71, 0x64, 0x47, 0x77, 0x2b, + 0x30, 0x77, 0x38, 0x4c, 0x42, 0x5a, 0x77, 0x50, 0x64, 0x33, 0x42, 0x75, + 0x63, 0x50, 0x62, 0x4f, 0x77, 0x0a, 0x33, 0x67, 0x41, 0x65, 0x71, 0x44, + 0x52, 0x48, 0x75, 0x35, 0x72, 0x72, 0x2f, 0x67, 0x73, 0x55, 0x76, 0x54, + 0x61, 0x45, 0x32, 0x67, 0x30, 0x67, 0x76, 0x2f, 0x70, 0x62, 0x79, 0x36, + 0x6b, 0x57, 0x49, 0x4b, 0x30, 0x35, 0x59, 0x4f, 0x34, 0x76, 0x64, 0x62, + 0x62, 0x6e, 0x6c, 0x35, 0x7a, 0x35, 0x50, 0x76, 0x31, 0x2b, 0x54, 0x57, + 0x39, 0x4e, 0x4c, 0x2b, 0x2b, 0x49, 0x44, 0x57, 0x72, 0x36, 0x0a, 0x33, + 0x66, 0x45, 0x39, 0x62, 0x69, 0x43, 0x6c, 0x6f, 0x42, 0x4b, 0x30, 0x54, + 0x58, 0x43, 0x35, 0x7a, 0x74, 0x64, 0x79, 0x4f, 0x34, 0x6d, 0x54, 0x70, + 0x34, 0x43, 0x45, 0x48, 0x43, 0x64, 0x4a, 0x63, 0x6b, 0x6d, 0x31, 0x2f, + 0x7a, 0x75, 0x56, 0x6e, 0x73, 0x48, 0x4d, 0x79, 0x41, 0x48, 0x73, 0x36, + 0x41, 0x36, 0x4b, 0x43, 0x70, 0x62, 0x6e, 0x73, 0x36, 0x61, 0x48, 0x35, + 0x64, 0x62, 0x35, 0x0a, 0x42, 0x53, 0x73, 0x4e, 0x6c, 0x30, 0x42, 0x77, + 0x50, 0x4c, 0x71, 0x73, 0x64, 0x56, 0x71, 0x63, 0x31, 0x55, 0x32, 0x64, + 0x41, 0x67, 0x72, 0x53, 0x53, 0x35, 0x74, 0x6d, 0x53, 0x30, 0x59, 0x48, + 0x46, 0x32, 0x57, 0x74, 0x6e, 0x32, 0x79, 0x49, 0x41, 0x4e, 0x77, 0x69, + 0x69, 0x65, 0x44, 0x68, 0x5a, 0x4e, 0x52, 0x6e, 0x76, 0x44, 0x46, 0x35, + 0x59, 0x54, 0x79, 0x37, 0x79, 0x6b, 0x48, 0x4e, 0x0a, 0x58, 0x47, 0x6f, + 0x41, 0x79, 0x44, 0x77, 0x34, 0x6a, 0x6c, 0x69, 0x76, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, + 0x44, 0x0a, 0x41, 0x67, 0x45, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x51, 0x75, 0x46, 0x71, + 0x6c, 0x4b, 0x47, 0x4c, 0x58, 0x4c, 0x7a, 0x50, 0x56, 0x76, 0x55, 0x50, + 0x4d, 0x6a, 0x58, 0x2f, 0x68, 0x64, 0x35, 0x36, 0x7a, 0x77, 0x79, 0x44, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x0a, 0x41, 0x41, 0x4f, 0x43, 0x41, + 0x51, 0x45, 0x41, 0x74, 0x58, 0x50, 0x34, 0x41, 0x39, 0x78, 0x5a, 0x57, + 0x78, 0x31, 0x32, 0x36, 0x61, 0x4d, 0x71, 0x65, 0x35, 0x41, 0x6f, 0x73, + 0x6b, 0x33, 0x41, 0x4d, 0x30, 0x2b, 0x71, 0x6d, 0x72, 0x48, 0x55, 0x75, + 0x4f, 0x51, 0x6e, 0x2f, 0x36, 0x6d, 0x57, 0x6d, 0x63, 0x35, 0x47, 0x34, + 0x47, 0x31, 0x38, 0x54, 0x4b, 0x49, 0x34, 0x70, 0x41, 0x5a, 0x77, 0x0a, + 0x38, 0x50, 0x52, 0x42, 0x45, 0x65, 0x77, 0x2f, 0x52, 0x34, 0x30, 0x2f, + 0x63, 0x6f, 0x66, 0x35, 0x4f, 0x2f, 0x32, 0x6b, 0x62, 0x79, 0x74, 0x54, + 0x41, 0x4f, 0x44, 0x2f, 0x4f, 0x62, 0x6c, 0x71, 0x42, 0x77, 0x37, 0x72, + 0x48, 0x52, 0x7a, 0x32, 0x6f, 0x6e, 0x4b, 0x51, 0x79, 0x34, 0x49, 0x39, + 0x45, 0x59, 0x4b, 0x4c, 0x30, 0x72, 0x75, 0x66, 0x4b, 0x71, 0x38, 0x68, + 0x35, 0x6d, 0x4f, 0x47, 0x0a, 0x6e, 0x58, 0x6b, 0x5a, 0x37, 0x2f, 0x65, + 0x37, 0x44, 0x44, 0x57, 0x51, 0x77, 0x34, 0x72, 0x74, 0x54, 0x77, 0x2f, + 0x31, 0x7a, 0x42, 0x4c, 0x5a, 0x70, 0x44, 0x36, 0x37, 0x6f, 0x50, 0x77, + 0x67, 0x6c, 0x56, 0x39, 0x50, 0x4a, 0x69, 0x38, 0x52, 0x49, 0x34, 0x4e, + 0x4f, 0x64, 0x51, 0x63, 0x50, 0x76, 0x35, 0x76, 0x52, 0x74, 0x42, 0x33, + 0x70, 0x45, 0x41, 0x54, 0x2b, 0x79, 0x6d, 0x43, 0x50, 0x0a, 0x6f, 0x6b, + 0x79, 0x34, 0x72, 0x63, 0x2f, 0x68, 0x6b, 0x41, 0x2f, 0x4e, 0x72, 0x67, + 0x72, 0x48, 0x58, 0x58, 0x75, 0x33, 0x55, 0x4e, 0x4c, 0x55, 0x59, 0x66, + 0x72, 0x56, 0x46, 0x64, 0x76, 0x58, 0x6e, 0x34, 0x64, 0x52, 0x56, 0x4f, + 0x75, 0x6c, 0x34, 0x2b, 0x76, 0x4a, 0x68, 0x61, 0x41, 0x6c, 0x49, 0x44, + 0x66, 0x37, 0x6a, 0x73, 0x34, 0x4d, 0x4e, 0x49, 0x54, 0x68, 0x50, 0x49, + 0x47, 0x79, 0x0a, 0x64, 0x30, 0x35, 0x44, 0x70, 0x59, 0x68, 0x66, 0x68, + 0x6d, 0x65, 0x68, 0x50, 0x65, 0x61, 0x30, 0x58, 0x47, 0x47, 0x32, 0x50, + 0x74, 0x76, 0x2b, 0x74, 0x79, 0x6a, 0x46, 0x6f, 0x67, 0x65, 0x75, 0x74, + 0x63, 0x72, 0x4b, 0x6a, 0x53, 0x6f, 0x53, 0x37, 0x35, 0x66, 0x74, 0x77, + 0x6a, 0x43, 0x6b, 0x79, 0x53, 0x70, 0x36, 0x2b, 0x2f, 0x4e, 0x4e, 0x49, + 0x78, 0x75, 0x5a, 0x4d, 0x7a, 0x53, 0x67, 0x0a, 0x4c, 0x76, 0x57, 0x70, + 0x43, 0x7a, 0x2f, 0x55, 0x58, 0x65, 0x48, 0x50, 0x68, 0x4a, 0x2f, 0x69, + 0x47, 0x63, 0x4a, 0x66, 0x69, 0x74, 0x59, 0x67, 0x48, 0x75, 0x4e, 0x7a, + 0x74, 0x77, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x65, 0x72, + 0x74, 0x75, 0x6d, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x43, 0x41, 0x20, 0x32, + 0x20, 0x4f, 0x3d, 0x55, 0x6e, 0x69, 0x7a, 0x65, 0x74, 0x6f, 0x20, 0x54, + 0x65, 0x63, 0x68, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x20, + 0x53, 0x2e, 0x41, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, 0x74, + 0x75, 0x6d, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x75, 0x6d, 0x20, + 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, 0x4e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x55, + 0x6e, 0x69, 0x7a, 0x65, 0x74, 0x6f, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, + 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x20, 0x53, 0x2e, 0x41, 0x2e, + 0x20, 0x4f, 0x55, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x75, 0x6d, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, 0x65, 0x72, + 0x74, 0x75, 0x6d, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x65, 0x64, 0x20, + 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x20, 0x43, 0x41, 0x20, 0x32, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x34, 0x34, 0x39, 0x37, 0x39, 0x39, 0x30, 0x30, 0x30, 0x31, 0x37, 0x32, + 0x30, 0x34, 0x33, 0x38, 0x33, 0x30, 0x39, 0x39, 0x34, 0x36, 0x33, 0x37, + 0x36, 0x34, 0x33, 0x35, 0x37, 0x35, 0x31, 0x32, 0x35, 0x39, 0x36, 0x39, + 0x36, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x64, + 0x3a, 0x34, 0x36, 0x3a, 0x39, 0x65, 0x3a, 0x64, 0x39, 0x3a, 0x32, 0x35, + 0x3a, 0x36, 0x64, 0x3a, 0x30, 0x38, 0x3a, 0x32, 0x33, 0x3a, 0x35, 0x62, + 0x3a, 0x35, 0x65, 0x3a, 0x37, 0x34, 0x3a, 0x37, 0x64, 0x3a, 0x31, 0x65, + 0x3a, 0x32, 0x37, 0x3a, 0x64, 0x62, 0x3a, 0x66, 0x32, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x33, 0x3a, 0x64, 0x64, 0x3a, + 0x34, 0x38, 0x3a, 0x33, 0x65, 0x3a, 0x32, 0x62, 0x3a, 0x62, 0x66, 0x3a, + 0x34, 0x63, 0x3a, 0x30, 0x35, 0x3a, 0x65, 0x38, 0x3a, 0x61, 0x66, 0x3a, + 0x31, 0x30, 0x3a, 0x66, 0x35, 0x3a, 0x66, 0x61, 0x3a, 0x37, 0x36, 0x3a, + 0x32, 0x36, 0x3a, 0x63, 0x66, 0x3a, 0x64, 0x33, 0x3a, 0x64, 0x63, 0x3a, + 0x33, 0x30, 0x3a, 0x39, 0x32, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x36, 0x3a, 0x37, 0x36, 0x3a, 0x66, 0x32, + 0x3a, 0x65, 0x64, 0x3a, 0x64, 0x61, 0x3a, 0x65, 0x38, 0x3a, 0x37, 0x37, + 0x3a, 0x35, 0x63, 0x3a, 0x64, 0x33, 0x3a, 0x36, 0x63, 0x3a, 0x62, 0x30, + 0x3a, 0x66, 0x36, 0x3a, 0x33, 0x63, 0x3a, 0x64, 0x31, 0x3a, 0x64, 0x34, + 0x3a, 0x36, 0x30, 0x3a, 0x33, 0x39, 0x3a, 0x36, 0x31, 0x3a, 0x66, 0x34, + 0x3a, 0x39, 0x65, 0x3a, 0x36, 0x32, 0x3a, 0x36, 0x35, 0x3a, 0x62, 0x61, + 0x3a, 0x30, 0x31, 0x3a, 0x33, 0x61, 0x3a, 0x32, 0x66, 0x3a, 0x30, 0x33, + 0x3a, 0x30, 0x37, 0x3a, 0x62, 0x36, 0x3a, 0x64, 0x30, 0x3a, 0x62, 0x38, + 0x3a, 0x30, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, + 0x30, 0x6a, 0x43, 0x43, 0x41, 0x37, 0x71, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x51, 0x49, 0x64, 0x62, 0x51, 0x53, 0x6b, 0x38, 0x6c, + 0x44, 0x38, 0x6b, 0x79, 0x4e, 0x2f, 0x79, 0x71, 0x58, 0x68, 0x4b, 0x4e, + 0x36, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x30, 0x46, 0x41, 0x44, 0x43, 0x42, + 0x0a, 0x67, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x55, 0x45, 0x77, 0x78, 0x49, 0x6a, 0x41, + 0x67, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x47, 0x56, 0x56, + 0x75, 0x61, 0x58, 0x70, 0x6c, 0x64, 0x47, 0x38, 0x67, 0x56, 0x47, 0x56, + 0x6a, 0x61, 0x47, 0x35, 0x76, 0x62, 0x47, 0x39, 0x6e, 0x61, 0x57, 0x56, + 0x7a, 0x49, 0x46, 0x4d, 0x75, 0x0a, 0x51, 0x53, 0x34, 0x78, 0x4a, 0x7a, + 0x41, 0x6c, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x48, 0x6b, + 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x31, 0x62, 0x53, 0x42, 0x44, 0x5a, 0x58, + 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, + 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, + 0x6c, 0x30, 0x65, 0x54, 0x45, 0x6b, 0x4d, 0x43, 0x49, 0x47, 0x0a, 0x41, + 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x62, 0x51, 0x32, 0x56, 0x79, 0x64, + 0x48, 0x56, 0x74, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x5a, + 0x57, 0x51, 0x67, 0x54, 0x6d, 0x56, 0x30, 0x64, 0x32, 0x39, 0x79, 0x61, + 0x79, 0x42, 0x44, 0x51, 0x53, 0x41, 0x79, 0x4d, 0x43, 0x49, 0x59, 0x44, + 0x7a, 0x49, 0x77, 0x4d, 0x54, 0x45, 0x78, 0x4d, 0x44, 0x41, 0x32, 0x4d, + 0x44, 0x67, 0x7a, 0x0a, 0x4f, 0x54, 0x55, 0x32, 0x57, 0x68, 0x67, 0x50, + 0x4d, 0x6a, 0x41, 0x30, 0x4e, 0x6a, 0x45, 0x77, 0x4d, 0x44, 0x59, 0x77, + 0x4f, 0x44, 0x4d, 0x35, 0x4e, 0x54, 0x5a, 0x61, 0x4d, 0x49, 0x47, 0x41, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x51, 0x54, 0x44, 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x0a, 0x56, 0x57, 0x35, + 0x70, 0x65, 0x6d, 0x56, 0x30, 0x62, 0x79, 0x42, 0x55, 0x5a, 0x57, 0x4e, + 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x62, 0x32, 0x64, 0x70, 0x5a, 0x58, 0x4d, + 0x67, 0x55, 0x79, 0x35, 0x42, 0x4c, 0x6a, 0x45, 0x6e, 0x4d, 0x43, 0x55, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x65, 0x51, 0x32, 0x56, + 0x79, 0x64, 0x48, 0x56, 0x74, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, + 0x70, 0x0a, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, + 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, + 0x52, 0x35, 0x4d, 0x53, 0x51, 0x77, 0x49, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x74, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x64, 0x57, + 0x30, 0x67, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, 0x6c, 0x5a, 0x43, + 0x42, 0x4f, 0x5a, 0x58, 0x52, 0x33, 0x0a, 0x62, 0x33, 0x4a, 0x72, 0x49, + 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, + 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, + 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, + 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, + 0x51, 0x43, 0x39, 0x2b, 0x58, 0x6a, 0x34, 0x35, 0x74, 0x57, 0x41, 0x0a, + 0x44, 0x47, 0x53, 0x64, 0x68, 0x68, 0x75, 0x57, 0x5a, 0x47, 0x63, 0x2f, + 0x49, 0x6a, 0x6f, 0x65, 0x64, 0x51, 0x46, 0x39, 0x37, 0x2f, 0x74, 0x63, + 0x5a, 0x34, 0x7a, 0x4a, 0x7a, 0x46, 0x78, 0x72, 0x71, 0x5a, 0x48, 0x6d, + 0x75, 0x55, 0x4c, 0x6c, 0x49, 0x45, 0x75, 0x62, 0x32, 0x70, 0x74, 0x37, + 0x75, 0x5a, 0x6c, 0x64, 0x32, 0x5a, 0x75, 0x41, 0x53, 0x39, 0x65, 0x45, + 0x51, 0x43, 0x73, 0x6e, 0x0a, 0x30, 0x2b, 0x69, 0x36, 0x4d, 0x4c, 0x73, + 0x2b, 0x43, 0x52, 0x71, 0x6e, 0x53, 0x5a, 0x58, 0x76, 0x4b, 0x30, 0x41, + 0x6b, 0x77, 0x70, 0x66, 0x48, 0x70, 0x2b, 0x36, 0x62, 0x4a, 0x65, 0x2b, + 0x6f, 0x43, 0x67, 0x43, 0x58, 0x68, 0x56, 0x71, 0x71, 0x6e, 0x64, 0x77, + 0x70, 0x79, 0x65, 0x49, 0x31, 0x42, 0x2b, 0x74, 0x77, 0x54, 0x55, 0x72, + 0x57, 0x77, 0x62, 0x4e, 0x57, 0x75, 0x4b, 0x46, 0x42, 0x0a, 0x4f, 0x4a, + 0x76, 0x52, 0x2b, 0x7a, 0x46, 0x2f, 0x6a, 0x2b, 0x42, 0x66, 0x34, 0x62, + 0x45, 0x2f, 0x44, 0x34, 0x34, 0x57, 0x53, 0x57, 0x44, 0x58, 0x42, 0x6f, + 0x30, 0x59, 0x2b, 0x61, 0x6f, 0x6d, 0x45, 0x4b, 0x73, 0x71, 0x30, 0x39, + 0x44, 0x52, 0x5a, 0x34, 0x30, 0x62, 0x52, 0x72, 0x35, 0x48, 0x4d, 0x4e, + 0x55, 0x75, 0x63, 0x74, 0x48, 0x46, 0x59, 0x39, 0x72, 0x6e, 0x59, 0x33, + 0x6c, 0x45, 0x0a, 0x66, 0x6b, 0x74, 0x6a, 0x4a, 0x49, 0x6d, 0x47, 0x4c, + 0x6a, 0x51, 0x2f, 0x4b, 0x55, 0x78, 0x53, 0x69, 0x79, 0x71, 0x6e, 0x77, + 0x4f, 0x4b, 0x52, 0x4b, 0x49, 0x6d, 0x35, 0x77, 0x46, 0x76, 0x35, 0x48, + 0x64, 0x6e, 0x6e, 0x4a, 0x36, 0x33, 0x2f, 0x6d, 0x67, 0x4b, 0x58, 0x77, + 0x63, 0x5a, 0x51, 0x6b, 0x70, 0x73, 0x43, 0x4c, 0x4c, 0x32, 0x70, 0x75, + 0x54, 0x52, 0x5a, 0x43, 0x72, 0x2b, 0x45, 0x0a, 0x53, 0x76, 0x2f, 0x66, + 0x2f, 0x72, 0x4f, 0x66, 0x36, 0x39, 0x6d, 0x65, 0x34, 0x4a, 0x67, 0x6a, + 0x37, 0x4b, 0x5a, 0x72, 0x64, 0x78, 0x59, 0x71, 0x32, 0x38, 0x79, 0x74, + 0x4f, 0x78, 0x79, 0x6b, 0x68, 0x39, 0x78, 0x47, 0x63, 0x31, 0x34, 0x5a, + 0x59, 0x6d, 0x68, 0x46, 0x56, 0x2b, 0x53, 0x51, 0x67, 0x6b, 0x4b, 0x37, + 0x51, 0x74, 0x62, 0x77, 0x59, 0x65, 0x44, 0x42, 0x6f, 0x7a, 0x31, 0x6d, + 0x0a, 0x6f, 0x31, 0x33, 0x30, 0x47, 0x4f, 0x36, 0x49, 0x79, 0x59, 0x30, + 0x58, 0x52, 0x53, 0x6d, 0x5a, 0x4d, 0x6e, 0x55, 0x43, 0x4d, 0x65, 0x34, + 0x70, 0x4a, 0x73, 0x68, 0x72, 0x41, 0x75, 0x61, 0x31, 0x59, 0x6b, 0x56, + 0x2f, 0x4e, 0x78, 0x56, 0x61, 0x49, 0x32, 0x69, 0x4a, 0x31, 0x44, 0x37, + 0x65, 0x54, 0x69, 0x65, 0x77, 0x38, 0x45, 0x41, 0x4d, 0x76, 0x45, 0x30, + 0x58, 0x79, 0x30, 0x32, 0x69, 0x0a, 0x73, 0x78, 0x37, 0x51, 0x42, 0x6c, + 0x72, 0x64, 0x39, 0x70, 0x50, 0x50, 0x56, 0x33, 0x57, 0x5a, 0x39, 0x66, + 0x71, 0x47, 0x47, 0x6d, 0x64, 0x34, 0x73, 0x37, 0x2b, 0x57, 0x2f, 0x6a, + 0x54, 0x63, 0x76, 0x65, 0x64, 0x53, 0x56, 0x75, 0x57, 0x7a, 0x35, 0x58, + 0x56, 0x37, 0x31, 0x30, 0x47, 0x52, 0x42, 0x64, 0x78, 0x64, 0x61, 0x65, + 0x4f, 0x56, 0x44, 0x55, 0x4f, 0x35, 0x2f, 0x49, 0x4f, 0x57, 0x0a, 0x4f, + 0x5a, 0x56, 0x37, 0x62, 0x49, 0x42, 0x61, 0x54, 0x78, 0x4e, 0x79, 0x78, + 0x74, 0x64, 0x39, 0x4b, 0x58, 0x70, 0x45, 0x75, 0x6c, 0x4b, 0x6b, 0x4b, + 0x74, 0x56, 0x42, 0x52, 0x67, 0x6b, 0x67, 0x2f, 0x69, 0x4b, 0x67, 0x74, + 0x6c, 0x73, 0x77, 0x6a, 0x62, 0x79, 0x4a, 0x44, 0x4e, 0x58, 0x58, 0x63, + 0x50, 0x69, 0x48, 0x55, 0x76, 0x33, 0x61, 0x37, 0x36, 0x78, 0x52, 0x4c, + 0x67, 0x65, 0x7a, 0x0a, 0x54, 0x76, 0x37, 0x51, 0x43, 0x64, 0x70, 0x77, + 0x37, 0x35, 0x6a, 0x36, 0x56, 0x75, 0x5a, 0x74, 0x32, 0x37, 0x56, 0x58, + 0x53, 0x39, 0x7a, 0x6c, 0x4c, 0x43, 0x55, 0x56, 0x79, 0x4a, 0x34, 0x75, + 0x65, 0x45, 0x37, 0x34, 0x32, 0x70, 0x79, 0x65, 0x68, 0x69, 0x7a, 0x4b, + 0x56, 0x2f, 0x4d, 0x61, 0x35, 0x63, 0x69, 0x53, 0x69, 0x78, 0x71, 0x43, + 0x6c, 0x6e, 0x72, 0x44, 0x76, 0x46, 0x41, 0x53, 0x0a, 0x61, 0x64, 0x67, + 0x4f, 0x57, 0x6b, 0x61, 0x4c, 0x4f, 0x75, 0x73, 0x6d, 0x2b, 0x69, 0x50, + 0x4a, 0x74, 0x72, 0x43, 0x42, 0x76, 0x6b, 0x49, 0x41, 0x70, 0x50, 0x6a, + 0x57, 0x2f, 0x6a, 0x41, 0x75, 0x78, 0x39, 0x4a, 0x47, 0x39, 0x75, 0x57, + 0x4f, 0x64, 0x66, 0x33, 0x79, 0x7a, 0x4c, 0x6e, 0x51, 0x68, 0x31, 0x76, + 0x4d, 0x42, 0x68, 0x42, 0x67, 0x75, 0x34, 0x4d, 0x31, 0x74, 0x31, 0x35, + 0x6e, 0x0a, 0x33, 0x6b, 0x66, 0x73, 0x6d, 0x55, 0x6a, 0x78, 0x70, 0x4b, + 0x45, 0x56, 0x2f, 0x71, 0x32, 0x4d, 0x59, 0x6f, 0x34, 0x35, 0x56, 0x55, + 0x38, 0x35, 0x46, 0x72, 0x6d, 0x78, 0x59, 0x35, 0x33, 0x2f, 0x74, 0x77, + 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, + 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x0a, 0x41, 0x51, 0x48, 0x2f, 0x4d, + 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, + 0x42, 0x53, 0x32, 0x6f, 0x56, 0x51, 0x35, 0x41, 0x73, 0x4f, 0x67, 0x50, + 0x34, 0x36, 0x4b, 0x76, 0x50, 0x72, 0x55, 0x2b, 0x42, 0x79, 0x6d, 0x30, + 0x54, 0x6f, 0x4f, 0x2f, 0x54, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x0a, + 0x41, 0x51, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4e, 0x42, 0x51, 0x41, 0x44, + 0x67, 0x67, 0x49, 0x42, 0x41, 0x48, 0x47, 0x6c, 0x44, 0x73, 0x37, 0x6b, + 0x36, 0x62, 0x38, 0x2f, 0x4f, 0x4e, 0x57, 0x4a, 0x57, 0x73, 0x51, 0x43, + 0x59, 0x66, 0x74, 0x4d, 0x78, 0x52, 0x51, 0x58, 0x4c, 0x59, 0x74, 0x50, + 0x55, 0x32, 0x73, 0x51, 0x0a, 0x46, 0x2f, 0x78, 0x6c, 0x68, 0x4d, 0x63, + 0x51, 0x53, 0x5a, 0x44, 0x65, 0x32, 0x38, 0x63, 0x6d, 0x6b, 0x34, 0x67, + 0x6d, 0x62, 0x33, 0x44, 0x57, 0x41, 0x6c, 0x34, 0x35, 0x6f, 0x50, 0x65, + 0x50, 0x71, 0x35, 0x61, 0x31, 0x70, 0x52, 0x4e, 0x63, 0x67, 0x52, 0x52, + 0x74, 0x44, 0x6f, 0x47, 0x43, 0x45, 0x52, 0x75, 0x4b, 0x54, 0x73, 0x5a, + 0x50, 0x70, 0x64, 0x31, 0x69, 0x48, 0x6b, 0x54, 0x66, 0x0a, 0x43, 0x56, + 0x6e, 0x30, 0x57, 0x33, 0x63, 0x4c, 0x4e, 0x2b, 0x6d, 0x4c, 0x49, 0x4d, + 0x62, 0x34, 0x43, 0x6b, 0x34, 0x75, 0x57, 0x42, 0x7a, 0x72, 0x4d, 0x39, + 0x44, 0x50, 0x68, 0x6d, 0x44, 0x4a, 0x32, 0x76, 0x75, 0x41, 0x4c, 0x35, + 0x35, 0x4d, 0x59, 0x49, 0x52, 0x34, 0x50, 0x53, 0x46, 0x6b, 0x31, 0x76, + 0x74, 0x42, 0x48, 0x78, 0x67, 0x50, 0x35, 0x38, 0x6c, 0x31, 0x63, 0x62, + 0x32, 0x39, 0x0a, 0x58, 0x4e, 0x34, 0x30, 0x68, 0x7a, 0x35, 0x42, 0x73, + 0x41, 0x37, 0x32, 0x75, 0x64, 0x59, 0x2f, 0x43, 0x52, 0x4f, 0x57, 0x46, + 0x43, 0x2f, 0x65, 0x6d, 0x68, 0x31, 0x61, 0x75, 0x56, 0x62, 0x4f, 0x4e, + 0x54, 0x71, 0x77, 0x58, 0x33, 0x42, 0x4e, 0x58, 0x75, 0x4d, 0x70, 0x38, + 0x53, 0x4d, 0x6f, 0x63, 0x6c, 0x6d, 0x32, 0x71, 0x38, 0x4b, 0x4d, 0x5a, + 0x69, 0x59, 0x63, 0x64, 0x79, 0x77, 0x6d, 0x0a, 0x64, 0x6a, 0x57, 0x4c, + 0x4b, 0x4b, 0x64, 0x70, 0x6f, 0x50, 0x6b, 0x37, 0x39, 0x53, 0x50, 0x64, + 0x68, 0x52, 0x42, 0x30, 0x79, 0x5a, 0x41, 0x44, 0x56, 0x70, 0x48, 0x6e, + 0x72, 0x37, 0x70, 0x48, 0x31, 0x42, 0x4b, 0x58, 0x45, 0x53, 0x4c, 0x6a, + 0x6f, 0x6b, 0x6d, 0x55, 0x62, 0x4f, 0x65, 0x33, 0x6c, 0x45, 0x75, 0x36, + 0x4c, 0x61, 0x54, 0x61, 0x4d, 0x34, 0x74, 0x4d, 0x70, 0x6b, 0x54, 0x2f, + 0x0a, 0x57, 0x6a, 0x7a, 0x47, 0x48, 0x57, 0x54, 0x59, 0x74, 0x54, 0x48, + 0x6b, 0x70, 0x6a, 0x78, 0x36, 0x71, 0x46, 0x63, 0x4c, 0x32, 0x2b, 0x31, + 0x68, 0x47, 0x73, 0x76, 0x78, 0x7a, 0x6e, 0x4e, 0x33, 0x59, 0x36, 0x53, + 0x48, 0x62, 0x30, 0x78, 0x52, 0x4f, 0x4e, 0x62, 0x6b, 0x58, 0x38, 0x65, + 0x66, 0x74, 0x6f, 0x45, 0x71, 0x35, 0x49, 0x56, 0x49, 0x65, 0x56, 0x68, + 0x65, 0x4f, 0x2f, 0x6a, 0x62, 0x0a, 0x41, 0x6f, 0x4a, 0x6e, 0x77, 0x54, + 0x6e, 0x62, 0x77, 0x33, 0x52, 0x4c, 0x50, 0x54, 0x59, 0x65, 0x2b, 0x53, + 0x6d, 0x54, 0x69, 0x47, 0x68, 0x62, 0x71, 0x45, 0x51, 0x5a, 0x49, 0x66, + 0x43, 0x6e, 0x36, 0x49, 0x45, 0x4e, 0x4c, 0x4f, 0x69, 0x54, 0x4e, 0x72, + 0x51, 0x33, 0x73, 0x73, 0x71, 0x77, 0x47, 0x79, 0x5a, 0x36, 0x6d, 0x69, + 0x55, 0x66, 0x6d, 0x70, 0x71, 0x41, 0x6e, 0x6b, 0x73, 0x71, 0x0a, 0x50, + 0x2f, 0x75, 0x6a, 0x6d, 0x76, 0x35, 0x7a, 0x4d, 0x6e, 0x48, 0x43, 0x6e, + 0x73, 0x5a, 0x79, 0x34, 0x59, 0x70, 0x6f, 0x4a, 0x2f, 0x48, 0x6b, 0x44, + 0x37, 0x54, 0x45, 0x54, 0x4b, 0x56, 0x68, 0x6b, 0x2f, 0x69, 0x58, 0x45, + 0x41, 0x63, 0x71, 0x4d, 0x43, 0x57, 0x70, 0x75, 0x63, 0x68, 0x78, 0x75, + 0x4f, 0x39, 0x6f, 0x7a, 0x43, 0x31, 0x2b, 0x39, 0x65, 0x42, 0x2b, 0x44, + 0x34, 0x4b, 0x6f, 0x0a, 0x62, 0x37, 0x61, 0x36, 0x62, 0x49, 0x4e, 0x44, + 0x64, 0x38, 0x32, 0x4b, 0x6b, 0x68, 0x65, 0x68, 0x6e, 0x6c, 0x74, 0x34, + 0x46, 0x6a, 0x31, 0x46, 0x34, 0x6a, 0x4e, 0x79, 0x33, 0x65, 0x46, 0x6d, + 0x79, 0x70, 0x6e, 0x54, 0x79, 0x63, 0x55, 0x6d, 0x2f, 0x51, 0x31, 0x6f, + 0x42, 0x45, 0x61, 0x75, 0x74, 0x74, 0x6d, 0x62, 0x6a, 0x4c, 0x34, 0x5a, + 0x76, 0x72, 0x48, 0x47, 0x38, 0x68, 0x6e, 0x6a, 0x0a, 0x58, 0x41, 0x4c, + 0x4b, 0x4c, 0x4e, 0x68, 0x76, 0x53, 0x67, 0x66, 0x5a, 0x79, 0x54, 0x58, + 0x61, 0x51, 0x48, 0x58, 0x79, 0x78, 0x4b, 0x63, 0x5a, 0x62, 0x35, 0x35, + 0x43, 0x45, 0x4a, 0x68, 0x31, 0x35, 0x70, 0x57, 0x4c, 0x59, 0x4c, 0x7a, + 0x74, 0x78, 0x52, 0x4c, 0x58, 0x69, 0x73, 0x37, 0x56, 0x6d, 0x46, 0x78, + 0x57, 0x6c, 0x67, 0x50, 0x46, 0x37, 0x6e, 0x63, 0x47, 0x4e, 0x66, 0x2f, + 0x50, 0x0a, 0x35, 0x4f, 0x34, 0x2f, 0x45, 0x32, 0x48, 0x75, 0x32, 0x39, + 0x6f, 0x74, 0x68, 0x66, 0x44, 0x4e, 0x72, 0x70, 0x32, 0x79, 0x47, 0x41, + 0x6c, 0x46, 0x77, 0x35, 0x4b, 0x68, 0x63, 0x68, 0x66, 0x38, 0x52, 0x37, + 0x61, 0x67, 0x43, 0x79, 0x7a, 0x78, 0x78, 0x4e, 0x35, 0x44, 0x61, 0x41, + 0x68, 0x71, 0x58, 0x7a, 0x76, 0x77, 0x64, 0x6d, 0x50, 0x37, 0x7a, 0x41, + 0x59, 0x73, 0x70, 0x73, 0x62, 0x69, 0x0a, 0x44, 0x72, 0x57, 0x35, 0x76, + 0x69, 0x53, 0x50, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, + 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, 0x65, 0x6c, 0x6c, + 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, + 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, + 0x30, 0x31, 0x35, 0x20, 0x4f, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, + 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x2e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, 0x65, 0x6c, 0x6c, + 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, + 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, + 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, + 0x30, 0x31, 0x35, 0x20, 0x4f, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, + 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, + 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, + 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x20, 0x43, 0x65, 0x72, 0x74, 0x2e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, + 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, + 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x35, 0x22, + 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x30, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x61, 0x3a, 0x66, + 0x66, 0x3a, 0x65, 0x32, 0x3a, 0x64, 0x62, 0x3a, 0x30, 0x33, 0x3a, 0x64, + 0x39, 0x3a, 0x63, 0x62, 0x3a, 0x34, 0x62, 0x3a, 0x65, 0x39, 0x3a, 0x30, + 0x66, 0x3a, 0x61, 0x64, 0x3a, 0x38, 0x34, 0x3a, 0x66, 0x64, 0x3a, 0x37, + 0x62, 0x3a, 0x31, 0x38, 0x3a, 0x63, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x31, 0x3a, 0x30, 0x63, 0x3a, 0x30, 0x36, + 0x3a, 0x39, 0x35, 0x3a, 0x61, 0x36, 0x3a, 0x39, 0x38, 0x3a, 0x31, 0x39, + 0x3a, 0x31, 0x34, 0x3a, 0x66, 0x66, 0x3a, 0x62, 0x66, 0x3a, 0x35, 0x66, + 0x3a, 0x63, 0x36, 0x3a, 0x62, 0x30, 0x3a, 0x62, 0x36, 0x3a, 0x39, 0x35, + 0x3a, 0x65, 0x61, 0x3a, 0x32, 0x39, 0x3a, 0x65, 0x39, 0x3a, 0x31, 0x32, + 0x3a, 0x61, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x61, 0x30, 0x3a, 0x34, 0x30, 0x3a, 0x39, 0x32, 0x3a, 0x39, + 0x61, 0x3a, 0x30, 0x32, 0x3a, 0x63, 0x65, 0x3a, 0x35, 0x33, 0x3a, 0x62, + 0x34, 0x3a, 0x61, 0x63, 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x32, 0x3a, 0x66, + 0x66, 0x3a, 0x63, 0x36, 0x3a, 0x39, 0x38, 0x3a, 0x31, 0x63, 0x3a, 0x65, + 0x34, 0x3a, 0x34, 0x39, 0x3a, 0x36, 0x66, 0x3a, 0x37, 0x35, 0x3a, 0x35, + 0x65, 0x3a, 0x36, 0x64, 0x3a, 0x34, 0x35, 0x3a, 0x66, 0x65, 0x3a, 0x30, + 0x62, 0x3a, 0x32, 0x61, 0x3a, 0x36, 0x39, 0x3a, 0x32, 0x62, 0x3a, 0x63, + 0x64, 0x3a, 0x35, 0x32, 0x3a, 0x35, 0x32, 0x3a, 0x33, 0x66, 0x3a, 0x33, + 0x36, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x47, 0x43, 0x7a, + 0x43, 0x43, 0x41, 0x2f, 0x4f, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x42, 0x41, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, + 0x43, 0x42, 0x70, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x31, 0x49, 0x78, 0x0a, 0x44, + 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x42, + 0x6b, 0x46, 0x30, 0x61, 0x47, 0x56, 0x75, 0x63, 0x7a, 0x46, 0x45, 0x4d, + 0x45, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x37, 0x53, + 0x47, 0x56, 0x73, 0x62, 0x47, 0x56, 0x75, 0x61, 0x57, 0x4d, 0x67, 0x51, + 0x57, 0x4e, 0x68, 0x5a, 0x47, 0x56, 0x74, 0x61, 0x57, 0x4d, 0x67, 0x59, + 0x57, 0x35, 0x6b, 0x0a, 0x49, 0x46, 0x4a, 0x6c, 0x63, 0x32, 0x56, 0x68, + 0x63, 0x6d, 0x4e, 0x6f, 0x49, 0x45, 0x6c, 0x75, 0x63, 0x33, 0x52, 0x70, + 0x64, 0x48, 0x56, 0x30, 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x4c, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, + 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x78, 0x51, 0x44, 0x41, 0x2b, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x0a, 0x4e, 0x30, 0x68, + 0x6c, 0x62, 0x47, 0x78, 0x6c, 0x62, 0x6d, 0x6c, 0x6a, 0x49, 0x45, 0x46, + 0x6a, 0x59, 0x57, 0x52, 0x6c, 0x62, 0x57, 0x6c, 0x6a, 0x49, 0x47, 0x46, + 0x75, 0x5a, 0x43, 0x42, 0x53, 0x5a, 0x58, 0x4e, 0x6c, 0x59, 0x58, 0x4a, + 0x6a, 0x61, 0x43, 0x42, 0x4a, 0x62, 0x6e, 0x4e, 0x30, 0x61, 0x58, 0x52, + 0x31, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6e, 0x4d, 0x67, 0x55, 0x6d, 0x39, + 0x76, 0x0a, 0x64, 0x45, 0x4e, 0x42, 0x49, 0x44, 0x49, 0x77, 0x4d, 0x54, + 0x55, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x55, 0x77, 0x4e, 0x7a, + 0x41, 0x33, 0x4d, 0x54, 0x41, 0x78, 0x4d, 0x54, 0x49, 0x78, 0x57, 0x68, + 0x63, 0x4e, 0x4e, 0x44, 0x41, 0x77, 0x4e, 0x6a, 0x4d, 0x77, 0x4d, 0x54, + 0x41, 0x78, 0x4d, 0x54, 0x49, 0x78, 0x57, 0x6a, 0x43, 0x42, 0x70, 0x6a, + 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x52, 0x31, 0x49, 0x78, 0x44, 0x7a, 0x41, 0x4e, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x42, 0x6b, 0x46, 0x30, 0x61, + 0x47, 0x56, 0x75, 0x63, 0x7a, 0x46, 0x45, 0x4d, 0x45, 0x49, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x37, 0x53, 0x47, 0x56, 0x73, 0x62, + 0x47, 0x56, 0x75, 0x61, 0x57, 0x4d, 0x67, 0x51, 0x57, 0x4e, 0x68, 0x0a, + 0x5a, 0x47, 0x56, 0x74, 0x61, 0x57, 0x4d, 0x67, 0x59, 0x57, 0x35, 0x6b, + 0x49, 0x46, 0x4a, 0x6c, 0x63, 0x32, 0x56, 0x68, 0x63, 0x6d, 0x4e, 0x6f, + 0x49, 0x45, 0x6c, 0x75, 0x63, 0x33, 0x52, 0x70, 0x64, 0x48, 0x56, 0x30, + 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, + 0x4c, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, + 0x64, 0x48, 0x6b, 0x78, 0x0a, 0x51, 0x44, 0x41, 0x2b, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4e, 0x30, 0x68, 0x6c, 0x62, 0x47, 0x78, + 0x6c, 0x62, 0x6d, 0x6c, 0x6a, 0x49, 0x45, 0x46, 0x6a, 0x59, 0x57, 0x52, + 0x6c, 0x62, 0x57, 0x6c, 0x6a, 0x49, 0x47, 0x46, 0x75, 0x5a, 0x43, 0x42, + 0x53, 0x5a, 0x58, 0x4e, 0x6c, 0x59, 0x58, 0x4a, 0x6a, 0x61, 0x43, 0x42, + 0x4a, 0x62, 0x6e, 0x4e, 0x30, 0x61, 0x58, 0x52, 0x31, 0x0a, 0x64, 0x47, + 0x6c, 0x76, 0x62, 0x6e, 0x4d, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x45, + 0x4e, 0x42, 0x49, 0x44, 0x49, 0x77, 0x4d, 0x54, 0x55, 0x77, 0x67, 0x67, + 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, + 0x49, 0x43, 0x0a, 0x41, 0x51, 0x44, 0x43, 0x2b, 0x4b, 0x6b, 0x2f, 0x47, + 0x34, 0x6e, 0x38, 0x50, 0x44, 0x77, 0x45, 0x58, 0x54, 0x32, 0x51, 0x4e, + 0x72, 0x43, 0x52, 0x4f, 0x6e, 0x6b, 0x38, 0x5a, 0x6c, 0x72, 0x76, 0x62, + 0x54, 0x6b, 0x42, 0x53, 0x52, 0x71, 0x30, 0x74, 0x38, 0x39, 0x2f, 0x54, + 0x53, 0x4e, 0x54, 0x74, 0x35, 0x41, 0x41, 0x34, 0x78, 0x4d, 0x71, 0x4b, + 0x4b, 0x59, 0x78, 0x38, 0x5a, 0x45, 0x41, 0x0a, 0x34, 0x79, 0x6a, 0x73, + 0x72, 0x69, 0x46, 0x42, 0x7a, 0x68, 0x2f, 0x61, 0x2f, 0x58, 0x30, 0x53, + 0x57, 0x77, 0x47, 0x44, 0x44, 0x37, 0x6d, 0x77, 0x58, 0x35, 0x6e, 0x68, + 0x38, 0x68, 0x4b, 0x44, 0x67, 0x45, 0x30, 0x47, 0x50, 0x74, 0x2b, 0x73, + 0x72, 0x2b, 0x65, 0x68, 0x69, 0x47, 0x73, 0x78, 0x72, 0x2f, 0x43, 0x4c, + 0x30, 0x42, 0x67, 0x7a, 0x75, 0x4e, 0x74, 0x46, 0x61, 0x6a, 0x54, 0x30, + 0x0a, 0x41, 0x6f, 0x41, 0x6b, 0x4b, 0x41, 0x6f, 0x43, 0x46, 0x5a, 0x56, + 0x65, 0x64, 0x69, 0x6f, 0x4e, 0x6d, 0x54, 0x6f, 0x55, 0x57, 0x2f, 0x62, + 0x4c, 0x79, 0x31, 0x4f, 0x38, 0x45, 0x30, 0x30, 0x42, 0x69, 0x44, 0x65, + 0x55, 0x4a, 0x52, 0x74, 0x43, 0x76, 0x43, 0x4c, 0x59, 0x6a, 0x71, 0x4f, + 0x57, 0x58, 0x6a, 0x72, 0x5a, 0x4d, 0x74, 0x73, 0x2b, 0x36, 0x50, 0x41, + 0x51, 0x5a, 0x65, 0x31, 0x30, 0x0a, 0x34, 0x53, 0x2b, 0x6e, 0x66, 0x4b, + 0x38, 0x6e, 0x4e, 0x4c, 0x73, 0x70, 0x66, 0x5a, 0x75, 0x32, 0x7a, 0x77, + 0x6e, 0x49, 0x35, 0x64, 0x4d, 0x4b, 0x2f, 0x49, 0x68, 0x6c, 0x5a, 0x58, + 0x51, 0x4b, 0x33, 0x48, 0x4d, 0x63, 0x58, 0x4d, 0x31, 0x41, 0x73, 0x52, + 0x7a, 0x55, 0x74, 0x6f, 0x53, 0x4d, 0x54, 0x46, 0x44, 0x50, 0x61, 0x49, + 0x36, 0x6f, 0x57, 0x61, 0x37, 0x43, 0x4a, 0x30, 0x36, 0x43, 0x0a, 0x6f, + 0x6a, 0x58, 0x64, 0x46, 0x50, 0x51, 0x66, 0x2f, 0x37, 0x4a, 0x33, 0x31, + 0x59, 0x63, 0x76, 0x71, 0x6d, 0x35, 0x39, 0x4a, 0x43, 0x66, 0x6e, 0x78, + 0x73, 0x73, 0x6d, 0x35, 0x75, 0x58, 0x2b, 0x5a, 0x77, 0x64, 0x6a, 0x32, + 0x45, 0x55, 0x4e, 0x33, 0x54, 0x70, 0x5a, 0x5a, 0x54, 0x6c, 0x59, 0x65, + 0x70, 0x4b, 0x5a, 0x63, 0x6a, 0x32, 0x63, 0x68, 0x46, 0x36, 0x49, 0x49, + 0x62, 0x6a, 0x56, 0x0a, 0x39, 0x43, 0x7a, 0x38, 0x32, 0x58, 0x42, 0x53, + 0x54, 0x33, 0x69, 0x34, 0x76, 0x54, 0x77, 0x72, 0x69, 0x35, 0x57, 0x59, + 0x39, 0x62, 0x50, 0x52, 0x61, 0x4d, 0x38, 0x67, 0x46, 0x48, 0x35, 0x4d, + 0x58, 0x46, 0x2f, 0x6e, 0x69, 0x2b, 0x58, 0x31, 0x4e, 0x59, 0x45, 0x5a, + 0x4e, 0x39, 0x63, 0x52, 0x43, 0x4c, 0x64, 0x6d, 0x76, 0x74, 0x4e, 0x4b, + 0x7a, 0x6f, 0x4e, 0x58, 0x41, 0x44, 0x72, 0x44, 0x0a, 0x67, 0x66, 0x67, + 0x58, 0x79, 0x35, 0x49, 0x32, 0x58, 0x64, 0x47, 0x6a, 0x32, 0x48, 0x55, + 0x62, 0x34, 0x59, 0x73, 0x6e, 0x36, 0x6e, 0x70, 0x49, 0x51, 0x66, 0x31, + 0x46, 0x47, 0x51, 0x61, 0x74, 0x4a, 0x35, 0x6c, 0x4f, 0x77, 0x58, 0x42, + 0x48, 0x33, 0x62, 0x57, 0x66, 0x67, 0x56, 0x4d, 0x53, 0x35, 0x62, 0x47, + 0x4d, 0x53, 0x46, 0x30, 0x78, 0x51, 0x78, 0x66, 0x6a, 0x6a, 0x4d, 0x5a, + 0x36, 0x0a, 0x59, 0x35, 0x5a, 0x4c, 0x4b, 0x54, 0x42, 0x4f, 0x68, 0x45, + 0x35, 0x69, 0x47, 0x56, 0x34, 0x38, 0x7a, 0x70, 0x65, 0x51, 0x70, 0x58, + 0x38, 0x42, 0x36, 0x35, 0x33, 0x67, 0x2b, 0x49, 0x75, 0x4a, 0x33, 0x53, + 0x57, 0x59, 0x50, 0x5a, 0x4b, 0x32, 0x66, 0x75, 0x2f, 0x5a, 0x38, 0x56, + 0x46, 0x52, 0x66, 0x53, 0x30, 0x6d, 0x79, 0x47, 0x6c, 0x5a, 0x59, 0x65, + 0x43, 0x73, 0x61, 0x72, 0x67, 0x71, 0x0a, 0x4e, 0x68, 0x45, 0x45, 0x65, + 0x6c, 0x43, 0x39, 0x4d, 0x6f, 0x53, 0x2b, 0x4c, 0x39, 0x78, 0x79, 0x31, + 0x64, 0x63, 0x64, 0x46, 0x6b, 0x66, 0x6b, 0x52, 0x32, 0x59, 0x67, 0x50, + 0x2f, 0x53, 0x57, 0x78, 0x61, 0x2b, 0x4f, 0x41, 0x58, 0x71, 0x6c, 0x44, + 0x33, 0x70, 0x6b, 0x39, 0x51, 0x30, 0x59, 0x68, 0x39, 0x6d, 0x75, 0x69, + 0x4e, 0x58, 0x36, 0x68, 0x4d, 0x45, 0x36, 0x77, 0x47, 0x6b, 0x6f, 0x0a, + 0x4c, 0x66, 0x49, 0x4e, 0x61, 0x46, 0x47, 0x71, 0x34, 0x36, 0x56, 0x33, + 0x78, 0x71, 0x53, 0x51, 0x44, 0x71, 0x45, 0x33, 0x69, 0x7a, 0x45, 0x6a, + 0x52, 0x38, 0x45, 0x4a, 0x43, 0x4f, 0x74, 0x75, 0x39, 0x33, 0x69, 0x62, + 0x31, 0x34, 0x4c, 0x38, 0x68, 0x43, 0x43, 0x5a, 0x53, 0x52, 0x6d, 0x32, + 0x45, 0x6b, 0x61, 0x78, 0x2b, 0x30, 0x56, 0x56, 0x46, 0x71, 0x6d, 0x6a, + 0x5a, 0x61, 0x79, 0x63, 0x0a, 0x42, 0x77, 0x2f, 0x71, 0x61, 0x39, 0x77, + 0x66, 0x4c, 0x67, 0x5a, 0x79, 0x37, 0x49, 0x61, 0x49, 0x45, 0x75, 0x51, + 0x74, 0x32, 0x31, 0x38, 0x46, 0x4c, 0x2b, 0x54, 0x77, 0x41, 0x39, 0x4d, + 0x6d, 0x4d, 0x2b, 0x65, 0x41, 0x77, 0x73, 0x31, 0x43, 0x6f, 0x52, 0x63, + 0x30, 0x43, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, + 0x77, 0x51, 0x44, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x52, + 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, + 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, + 0x51, 0x55, 0x63, 0x52, 0x56, 0x6e, 0x79, 0x4d, 0x6a, 0x4a, 0x76, 0x58, + 0x56, 0x64, 0x0a, 0x63, 0x74, 0x41, 0x34, 0x47, 0x47, 0x71, 0x64, 0x38, + 0x33, 0x45, 0x6b, 0x56, 0x41, 0x73, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x48, 0x57, 0x37, 0x62, + 0x56, 0x52, 0x4c, 0x71, 0x68, 0x42, 0x59, 0x52, 0x6a, 0x54, 0x79, 0x59, + 0x74, 0x63, 0x57, 0x4e, 0x6c, 0x30, 0x49, 0x0a, 0x58, 0x74, 0x56, 0x73, + 0x79, 0x49, 0x65, 0x39, 0x74, 0x43, 0x35, 0x47, 0x38, 0x6a, 0x48, 0x34, + 0x66, 0x4f, 0x70, 0x43, 0x74, 0x5a, 0x4d, 0x57, 0x56, 0x64, 0x79, 0x68, + 0x44, 0x42, 0x4b, 0x67, 0x32, 0x6d, 0x46, 0x2b, 0x44, 0x31, 0x68, 0x59, + 0x63, 0x32, 0x52, 0x79, 0x78, 0x2b, 0x68, 0x46, 0x6a, 0x74, 0x79, 0x70, + 0x38, 0x69, 0x59, 0x2f, 0x78, 0x6e, 0x6d, 0x4d, 0x73, 0x56, 0x4d, 0x49, + 0x0a, 0x4d, 0x34, 0x47, 0x77, 0x56, 0x68, 0x4f, 0x2b, 0x35, 0x6c, 0x46, + 0x63, 0x32, 0x4a, 0x73, 0x4b, 0x54, 0x30, 0x75, 0x63, 0x56, 0x6c, 0x4d, + 0x43, 0x36, 0x55, 0x2f, 0x32, 0x44, 0x57, 0x44, 0x71, 0x54, 0x55, 0x4a, + 0x56, 0x36, 0x48, 0x77, 0x62, 0x49, 0x53, 0x48, 0x54, 0x47, 0x7a, 0x72, + 0x4d, 0x64, 0x2f, 0x4b, 0x34, 0x6b, 0x50, 0x46, 0x6f, 0x78, 0x2f, 0x6c, + 0x61, 0x2f, 0x76, 0x6f, 0x74, 0x0a, 0x39, 0x4c, 0x2f, 0x4a, 0x39, 0x55, + 0x55, 0x62, 0x7a, 0x6a, 0x67, 0x51, 0x4b, 0x6a, 0x65, 0x4b, 0x65, 0x61, + 0x4f, 0x30, 0x34, 0x77, 0x6c, 0x73, 0x68, 0x59, 0x61, 0x54, 0x2f, 0x34, + 0x6d, 0x57, 0x4a, 0x33, 0x69, 0x42, 0x6a, 0x32, 0x66, 0x6a, 0x52, 0x6e, + 0x52, 0x55, 0x6a, 0x74, 0x6b, 0x4e, 0x61, 0x65, 0x4a, 0x4b, 0x39, 0x45, + 0x31, 0x30, 0x41, 0x2f, 0x2b, 0x79, 0x64, 0x2b, 0x32, 0x56, 0x0a, 0x5a, + 0x35, 0x66, 0x6b, 0x73, 0x63, 0x57, 0x72, 0x76, 0x32, 0x6f, 0x6a, 0x36, + 0x4e, 0x53, 0x55, 0x34, 0x6b, 0x51, 0x6f, 0x59, 0x73, 0x52, 0x4c, 0x34, + 0x76, 0x44, 0x59, 0x34, 0x69, 0x6c, 0x72, 0x47, 0x6e, 0x42, 0x2b, 0x4a, + 0x47, 0x47, 0x54, 0x65, 0x30, 0x38, 0x44, 0x4d, 0x69, 0x55, 0x4e, 0x52, + 0x53, 0x51, 0x72, 0x6c, 0x72, 0x52, 0x47, 0x61, 0x72, 0x39, 0x4b, 0x43, + 0x2f, 0x65, 0x61, 0x0a, 0x6a, 0x38, 0x47, 0x73, 0x47, 0x73, 0x56, 0x6e, + 0x38, 0x32, 0x38, 0x30, 0x30, 0x76, 0x70, 0x7a, 0x59, 0x34, 0x7a, 0x76, + 0x46, 0x72, 0x43, 0x6f, 0x70, 0x45, 0x59, 0x71, 0x2b, 0x4f, 0x73, 0x53, + 0x37, 0x48, 0x4b, 0x30, 0x37, 0x2f, 0x67, 0x72, 0x66, 0x6f, 0x78, 0x53, + 0x77, 0x49, 0x75, 0x45, 0x56, 0x50, 0x6b, 0x76, 0x50, 0x75, 0x4e, 0x56, + 0x71, 0x4e, 0x78, 0x6d, 0x73, 0x64, 0x6e, 0x68, 0x0a, 0x58, 0x39, 0x69, + 0x7a, 0x6a, 0x46, 0x6b, 0x30, 0x57, 0x61, 0x53, 0x72, 0x54, 0x32, 0x79, + 0x37, 0x48, 0x78, 0x6a, 0x62, 0x64, 0x61, 0x76, 0x59, 0x79, 0x35, 0x4c, + 0x4e, 0x6c, 0x44, 0x68, 0x68, 0x44, 0x67, 0x63, 0x47, 0x48, 0x30, 0x74, + 0x47, 0x45, 0x50, 0x45, 0x56, 0x76, 0x6f, 0x32, 0x46, 0x58, 0x44, 0x74, + 0x4b, 0x4b, 0x34, 0x46, 0x35, 0x44, 0x37, 0x52, 0x70, 0x6e, 0x30, 0x6c, + 0x51, 0x0a, 0x6c, 0x30, 0x33, 0x33, 0x44, 0x6c, 0x5a, 0x64, 0x77, 0x4a, + 0x56, 0x71, 0x77, 0x6a, 0x62, 0x44, 0x47, 0x32, 0x6a, 0x4a, 0x39, 0x53, + 0x72, 0x63, 0x52, 0x35, 0x71, 0x2b, 0x73, 0x73, 0x37, 0x46, 0x4a, 0x65, + 0x6a, 0x36, 0x41, 0x37, 0x6e, 0x61, 0x2b, 0x52, 0x5a, 0x75, 0x6b, 0x59, + 0x54, 0x31, 0x48, 0x43, 0x6a, 0x49, 0x2f, 0x43, 0x62, 0x4d, 0x31, 0x78, + 0x79, 0x51, 0x56, 0x71, 0x64, 0x66, 0x0a, 0x62, 0x7a, 0x6f, 0x45, 0x76, + 0x4d, 0x31, 0x34, 0x69, 0x51, 0x75, 0x4f, 0x44, 0x79, 0x2b, 0x6a, 0x71, + 0x6b, 0x2b, 0x69, 0x47, 0x78, 0x49, 0x39, 0x46, 0x67, 0x68, 0x41, 0x44, + 0x2f, 0x46, 0x47, 0x54, 0x4e, 0x65, 0x71, 0x65, 0x77, 0x6a, 0x42, 0x43, + 0x76, 0x56, 0x74, 0x4a, 0x39, 0x34, 0x43, 0x6a, 0x38, 0x72, 0x44, 0x74, + 0x53, 0x76, 0x4b, 0x36, 0x65, 0x76, 0x49, 0x49, 0x56, 0x4d, 0x34, 0x0a, + 0x70, 0x63, 0x77, 0x37, 0x32, 0x48, 0x63, 0x33, 0x4d, 0x4b, 0x4a, 0x50, + 0x32, 0x57, 0x2f, 0x52, 0x38, 0x6b, 0x43, 0x74, 0x51, 0x58, 0x6f, 0x58, + 0x78, 0x64, 0x5a, 0x4b, 0x4e, 0x59, 0x6d, 0x33, 0x51, 0x64, 0x56, 0x38, + 0x68, 0x6e, 0x39, 0x56, 0x54, 0x59, 0x4e, 0x4b, 0x70, 0x58, 0x4d, 0x67, + 0x77, 0x44, 0x71, 0x76, 0x6b, 0x50, 0x47, 0x61, 0x4a, 0x49, 0x37, 0x5a, + 0x6a, 0x6e, 0x48, 0x4b, 0x0a, 0x65, 0x37, 0x69, 0x47, 0x32, 0x72, 0x4b, + 0x50, 0x6d, 0x54, 0x34, 0x64, 0x45, 0x77, 0x30, 0x53, 0x45, 0x65, 0x37, + 0x55, 0x71, 0x2f, 0x44, 0x70, 0x46, 0x58, 0x59, 0x43, 0x35, 0x4f, 0x44, + 0x66, 0x71, 0x69, 0x41, 0x65, 0x57, 0x32, 0x47, 0x46, 0x5a, 0x45, 0x43, + 0x70, 0x6b, 0x4a, 0x63, 0x4e, 0x72, 0x56, 0x50, 0x53, 0x57, 0x68, 0x32, + 0x48, 0x61, 0x67, 0x43, 0x58, 0x5a, 0x57, 0x4b, 0x30, 0x0a, 0x76, 0x6d, + 0x39, 0x71, 0x70, 0x2f, 0x55, 0x73, 0x51, 0x75, 0x30, 0x79, 0x72, 0x62, + 0x59, 0x68, 0x6e, 0x72, 0x36, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, + 0x65, 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, + 0x65, 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, + 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x4f, + 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, 0x20, 0x41, 0x63, + 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x52, + 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, 0x6e, 0x73, 0x74, + 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x43, 0x65, 0x72, + 0x74, 0x2e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, 0x20, + 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, + 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, 0x6e, + 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x45, + 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, 0x30, + 0x31, 0x35, 0x20, 0x4f, 0x3d, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, 0x69, + 0x63, 0x20, 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, 0x61, + 0x6e, 0x64, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, + 0x49, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x2e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x48, 0x65, 0x6c, 0x6c, 0x65, 0x6e, 0x69, 0x63, 0x20, + 0x41, 0x63, 0x61, 0x64, 0x65, 0x6d, 0x69, 0x63, 0x20, 0x61, 0x6e, 0x64, + 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x49, 0x6e, + 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x45, + 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x20, 0x32, 0x30, + 0x31, 0x35, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, + 0x31, 0x3a, 0x65, 0x35, 0x3a, 0x62, 0x34, 0x3a, 0x31, 0x37, 0x3a, 0x65, + 0x62, 0x3a, 0x63, 0x32, 0x3a, 0x66, 0x35, 0x3a, 0x65, 0x31, 0x3a, 0x34, + 0x62, 0x3a, 0x30, 0x64, 0x3a, 0x34, 0x31, 0x3a, 0x37, 0x62, 0x3a, 0x34, + 0x39, 0x3a, 0x39, 0x32, 0x3a, 0x66, 0x65, 0x3a, 0x65, 0x66, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x66, 0x3a, 0x66, 0x31, + 0x3a, 0x37, 0x31, 0x3a, 0x38, 0x64, 0x3a, 0x39, 0x32, 0x3a, 0x64, 0x35, + 0x3a, 0x39, 0x61, 0x3a, 0x66, 0x33, 0x3a, 0x37, 0x64, 0x3a, 0x37, 0x34, + 0x3a, 0x39, 0x37, 0x3a, 0x62, 0x34, 0x3a, 0x62, 0x63, 0x3a, 0x36, 0x66, + 0x3a, 0x38, 0x34, 0x3a, 0x36, 0x38, 0x3a, 0x30, 0x62, 0x3a, 0x62, 0x61, + 0x3a, 0x62, 0x36, 0x3a, 0x36, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x34, 0x3a, 0x62, 0x35, 0x3a, 0x34, + 0x35, 0x3a, 0x61, 0x61, 0x3a, 0x38, 0x61, 0x3a, 0x32, 0x35, 0x3a, 0x65, + 0x36, 0x3a, 0x35, 0x61, 0x3a, 0x37, 0x33, 0x3a, 0x63, 0x61, 0x3a, 0x31, + 0x35, 0x3a, 0x64, 0x63, 0x3a, 0x32, 0x37, 0x3a, 0x66, 0x63, 0x3a, 0x33, + 0x36, 0x3a, 0x64, 0x32, 0x3a, 0x34, 0x63, 0x3a, 0x31, 0x63, 0x3a, 0x62, + 0x39, 0x3a, 0x39, 0x35, 0x3a, 0x33, 0x61, 0x3a, 0x30, 0x36, 0x3a, 0x36, + 0x35, 0x3a, 0x33, 0x39, 0x3a, 0x62, 0x31, 0x3a, 0x31, 0x35, 0x3a, 0x38, + 0x32, 0x3a, 0x64, 0x63, 0x3a, 0x34, 0x38, 0x3a, 0x37, 0x62, 0x3a, 0x34, + 0x38, 0x3a, 0x33, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x43, 0x77, 0x7a, 0x43, 0x43, 0x41, 0x6b, 0x71, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x44, 0x41, 0x4b, 0x42, 0x67, 0x67, + 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x6a, 0x43, + 0x42, 0x71, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x31, 0x49, 0x78, 0x44, 0x7a, 0x41, + 0x4e, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x42, 0x6b, + 0x46, 0x30, 0x61, 0x47, 0x56, 0x75, 0x63, 0x7a, 0x46, 0x45, 0x4d, 0x45, + 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x37, 0x53, 0x47, + 0x56, 0x73, 0x62, 0x47, 0x56, 0x75, 0x61, 0x57, 0x4d, 0x67, 0x51, 0x57, + 0x4e, 0x68, 0x5a, 0x47, 0x56, 0x74, 0x61, 0x57, 0x4d, 0x67, 0x59, 0x57, + 0x35, 0x6b, 0x49, 0x46, 0x4a, 0x6c, 0x0a, 0x63, 0x32, 0x56, 0x68, 0x63, + 0x6d, 0x4e, 0x6f, 0x49, 0x45, 0x6c, 0x75, 0x63, 0x33, 0x52, 0x70, 0x64, + 0x48, 0x56, 0x30, 0x61, 0x57, 0x39, 0x75, 0x63, 0x79, 0x42, 0x44, 0x5a, + 0x58, 0x4a, 0x30, 0x4c, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, + 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x78, 0x52, 0x44, 0x42, 0x43, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4f, 0x30, 0x68, 0x6c, 0x0a, + 0x62, 0x47, 0x78, 0x6c, 0x62, 0x6d, 0x6c, 0x6a, 0x49, 0x45, 0x46, 0x6a, + 0x59, 0x57, 0x52, 0x6c, 0x62, 0x57, 0x6c, 0x6a, 0x49, 0x47, 0x46, 0x75, + 0x5a, 0x43, 0x42, 0x53, 0x5a, 0x58, 0x4e, 0x6c, 0x59, 0x58, 0x4a, 0x6a, + 0x61, 0x43, 0x42, 0x4a, 0x62, 0x6e, 0x4e, 0x30, 0x61, 0x58, 0x52, 0x31, + 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6e, 0x4d, 0x67, 0x52, 0x55, 0x4e, 0x44, + 0x49, 0x46, 0x4a, 0x76, 0x0a, 0x62, 0x33, 0x52, 0x44, 0x51, 0x53, 0x41, + 0x79, 0x4d, 0x44, 0x45, 0x31, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, + 0x31, 0x4d, 0x44, 0x63, 0x77, 0x4e, 0x7a, 0x45, 0x77, 0x4d, 0x7a, 0x63, + 0x78, 0x4d, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x51, 0x77, 0x4d, 0x44, 0x59, + 0x7a, 0x4d, 0x44, 0x45, 0x77, 0x4d, 0x7a, 0x63, 0x78, 0x4d, 0x6c, 0x6f, + 0x77, 0x67, 0x61, 0x6f, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x0a, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x64, 0x53, 0x4d, 0x51, + 0x38, 0x77, 0x44, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, 0x45, 0x77, + 0x5a, 0x42, 0x64, 0x47, 0x68, 0x6c, 0x62, 0x6e, 0x4d, 0x78, 0x52, 0x44, + 0x42, 0x43, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x4f, 0x30, + 0x68, 0x6c, 0x62, 0x47, 0x78, 0x6c, 0x62, 0x6d, 0x6c, 0x6a, 0x49, 0x45, + 0x46, 0x6a, 0x0a, 0x59, 0x57, 0x52, 0x6c, 0x62, 0x57, 0x6c, 0x6a, 0x49, + 0x47, 0x46, 0x75, 0x5a, 0x43, 0x42, 0x53, 0x5a, 0x58, 0x4e, 0x6c, 0x59, + 0x58, 0x4a, 0x6a, 0x61, 0x43, 0x42, 0x4a, 0x62, 0x6e, 0x4e, 0x30, 0x61, + 0x58, 0x52, 0x31, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6e, 0x4d, 0x67, 0x51, + 0x32, 0x56, 0x79, 0x64, 0x43, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, + 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x0a, 0x4d, 0x55, 0x51, 0x77, + 0x51, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x7a, 0x74, 0x49, + 0x5a, 0x57, 0x78, 0x73, 0x5a, 0x57, 0x35, 0x70, 0x59, 0x79, 0x42, 0x42, + 0x59, 0x32, 0x46, 0x6b, 0x5a, 0x57, 0x31, 0x70, 0x59, 0x79, 0x42, 0x68, + 0x62, 0x6d, 0x51, 0x67, 0x55, 0x6d, 0x56, 0x7a, 0x5a, 0x57, 0x46, 0x79, + 0x59, 0x32, 0x67, 0x67, 0x53, 0x57, 0x35, 0x7a, 0x64, 0x47, 0x6c, 0x30, + 0x0a, 0x64, 0x58, 0x52, 0x70, 0x62, 0x32, 0x35, 0x7a, 0x49, 0x45, 0x56, + 0x44, 0x51, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x51, 0x30, 0x45, + 0x67, 0x4d, 0x6a, 0x41, 0x78, 0x4e, 0x54, 0x42, 0x32, 0x4d, 0x42, 0x41, + 0x47, 0x42, 0x79, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x67, 0x45, + 0x47, 0x42, 0x53, 0x75, 0x42, 0x42, 0x41, 0x41, 0x69, 0x41, 0x32, 0x49, + 0x41, 0x42, 0x4a, 0x4b, 0x67, 0x0a, 0x51, 0x65, 0x68, 0x4c, 0x67, 0x6f, + 0x52, 0x63, 0x34, 0x76, 0x67, 0x78, 0x45, 0x5a, 0x6d, 0x47, 0x5a, 0x45, + 0x34, 0x4a, 0x4a, 0x53, 0x2b, 0x64, 0x51, 0x53, 0x38, 0x4b, 0x72, 0x6a, + 0x56, 0x50, 0x64, 0x4a, 0x57, 0x79, 0x55, 0x57, 0x52, 0x72, 0x6a, 0x57, + 0x76, 0x6d, 0x50, 0x33, 0x43, 0x56, 0x38, 0x41, 0x56, 0x45, 0x52, 0x36, + 0x5a, 0x79, 0x4f, 0x46, 0x42, 0x32, 0x6c, 0x51, 0x4a, 0x61, 0x0a, 0x6a, + 0x71, 0x34, 0x6f, 0x6e, 0x76, 0x6b, 0x74, 0x54, 0x70, 0x6e, 0x76, 0x4c, + 0x45, 0x68, 0x76, 0x54, 0x43, 0x55, 0x70, 0x36, 0x4e, 0x46, 0x78, 0x57, + 0x39, 0x38, 0x64, 0x77, 0x58, 0x55, 0x33, 0x74, 0x4e, 0x66, 0x36, 0x65, + 0x33, 0x70, 0x43, 0x6e, 0x47, 0x6f, 0x4b, 0x56, 0x6c, 0x70, 0x38, 0x61, + 0x51, 0x75, 0x71, 0x67, 0x41, 0x6b, 0x6b, 0x62, 0x48, 0x37, 0x42, 0x52, + 0x71, 0x4e, 0x43, 0x0a, 0x4d, 0x45, 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, + 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, + 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x42, 0x42, 0x59, 0x45, 0x46, 0x4c, 0x51, 0x69, 0x0a, 0x43, 0x34, 0x4b, + 0x5a, 0x4a, 0x41, 0x45, 0x4f, 0x6e, 0x4c, 0x76, 0x6b, 0x44, 0x76, 0x32, + 0x2f, 0x2b, 0x35, 0x63, 0x67, 0x6b, 0x35, 0x6b, 0x71, 0x4d, 0x41, 0x6f, + 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x32, 0x63, 0x41, 0x4d, 0x47, 0x51, 0x43, 0x4d, 0x47, 0x66, + 0x4f, 0x46, 0x6d, 0x49, 0x34, 0x6f, 0x71, 0x78, 0x69, 0x52, 0x61, 0x65, + 0x70, 0x0a, 0x6c, 0x53, 0x54, 0x41, 0x47, 0x69, 0x65, 0x63, 0x4d, 0x6a, + 0x76, 0x41, 0x77, 0x4e, 0x57, 0x36, 0x71, 0x65, 0x66, 0x34, 0x42, 0x45, + 0x4e, 0x54, 0x68, 0x65, 0x35, 0x53, 0x49, 0x64, 0x36, 0x64, 0x39, 0x53, + 0x57, 0x44, 0x50, 0x70, 0x35, 0x59, 0x53, 0x79, 0x2f, 0x58, 0x5a, 0x78, + 0x4d, 0x4f, 0x49, 0x51, 0x49, 0x77, 0x42, 0x65, 0x46, 0x31, 0x41, 0x64, + 0x35, 0x6f, 0x37, 0x53, 0x6f, 0x66, 0x0a, 0x54, 0x55, 0x77, 0x4a, 0x43, + 0x41, 0x33, 0x73, 0x53, 0x36, 0x31, 0x6b, 0x46, 0x79, 0x6a, 0x6e, 0x64, + 0x63, 0x35, 0x46, 0x5a, 0x58, 0x49, 0x68, 0x46, 0x38, 0x73, 0x69, 0x51, + 0x51, 0x36, 0x4d, 0x45, 0x35, 0x67, 0x34, 0x6d, 0x6c, 0x52, 0x74, 0x6d, + 0x38, 0x72, 0x69, 0x66, 0x4f, 0x6f, 0x43, 0x57, 0x43, 0x4b, 0x52, 0x0a, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x49, 0x53, 0x52, 0x47, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x58, 0x31, 0x20, 0x4f, 0x3d, 0x49, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x65, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, 0x47, 0x72, + 0x6f, 0x75, 0x70, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x49, 0x53, 0x52, 0x47, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x58, 0x31, 0x20, 0x4f, 0x3d, 0x49, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x65, 0x74, 0x20, 0x53, 0x65, 0x63, 0x75, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x52, 0x65, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x20, + 0x47, 0x72, 0x6f, 0x75, 0x70, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x49, 0x53, 0x52, 0x47, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x58, 0x31, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x37, 0x32, 0x38, 0x38, 0x36, 0x39, 0x32, + 0x38, 0x36, 0x36, 0x39, 0x37, 0x39, 0x30, 0x34, 0x37, 0x36, 0x30, 0x36, + 0x34, 0x36, 0x37, 0x30, 0x32, 0x34, 0x33, 0x35, 0x30, 0x34, 0x31, 0x36, + 0x39, 0x30, 0x36, 0x31, 0x31, 0x32, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x30, 0x63, 0x3a, 0x64, 0x32, 0x3a, 0x66, 0x39, 0x3a, + 0x65, 0x30, 0x3a, 0x64, 0x61, 0x3a, 0x31, 0x37, 0x3a, 0x37, 0x33, 0x3a, + 0x65, 0x39, 0x3a, 0x65, 0x64, 0x3a, 0x38, 0x36, 0x3a, 0x34, 0x64, 0x3a, + 0x61, 0x35, 0x3a, 0x65, 0x33, 0x3a, 0x37, 0x30, 0x3a, 0x65, 0x37, 0x3a, + 0x34, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, + 0x61, 0x3a, 0x62, 0x64, 0x3a, 0x32, 0x61, 0x3a, 0x37, 0x39, 0x3a, 0x61, + 0x31, 0x3a, 0x30, 0x37, 0x3a, 0x36, 0x61, 0x3a, 0x33, 0x31, 0x3a, 0x66, + 0x32, 0x3a, 0x31, 0x64, 0x3a, 0x32, 0x35, 0x3a, 0x33, 0x36, 0x3a, 0x33, + 0x35, 0x3a, 0x63, 0x62, 0x3a, 0x30, 0x33, 0x3a, 0x39, 0x64, 0x3a, 0x34, + 0x33, 0x3a, 0x32, 0x39, 0x3a, 0x61, 0x35, 0x3a, 0x65, 0x38, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x36, 0x3a, + 0x62, 0x63, 0x3a, 0x65, 0x63, 0x3a, 0x30, 0x36, 0x3a, 0x32, 0x36, 0x3a, + 0x34, 0x39, 0x3a, 0x37, 0x36, 0x3a, 0x66, 0x33, 0x3a, 0x37, 0x34, 0x3a, + 0x36, 0x30, 0x3a, 0x37, 0x37, 0x3a, 0x39, 0x61, 0x3a, 0x63, 0x66, 0x3a, + 0x32, 0x38, 0x3a, 0x63, 0x35, 0x3a, 0x61, 0x37, 0x3a, 0x63, 0x66, 0x3a, + 0x65, 0x38, 0x3a, 0x61, 0x33, 0x3a, 0x63, 0x30, 0x3a, 0x61, 0x61, 0x3a, + 0x65, 0x31, 0x3a, 0x31, 0x61, 0x3a, 0x38, 0x66, 0x3a, 0x66, 0x63, 0x3a, + 0x65, 0x65, 0x3a, 0x30, 0x35, 0x3a, 0x63, 0x30, 0x3a, 0x62, 0x64, 0x3a, + 0x64, 0x66, 0x3a, 0x30, 0x38, 0x3a, 0x63, 0x36, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x61, 0x7a, 0x43, 0x43, 0x41, 0x31, 0x4f, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x52, 0x41, 0x49, 0x49, + 0x51, 0x7a, 0x37, 0x44, 0x53, 0x51, 0x4f, 0x4e, 0x5a, 0x52, 0x47, 0x50, + 0x67, 0x75, 0x32, 0x4f, 0x43, 0x69, 0x77, 0x41, 0x77, 0x44, 0x51, 0x59, + 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, + 0x4c, 0x42, 0x51, 0x41, 0x77, 0x0a, 0x54, 0x7a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x4b, 0x54, 0x41, 0x6e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x54, 0x49, 0x45, 0x6c, 0x75, 0x64, 0x47, 0x56, 0x79, 0x62, 0x6d, + 0x56, 0x30, 0x49, 0x46, 0x4e, 0x6c, 0x59, 0x33, 0x56, 0x79, 0x61, 0x58, + 0x52, 0x35, 0x49, 0x46, 0x4a, 0x6c, 0x63, 0x32, 0x56, 0x68, 0x0a, 0x63, + 0x6d, 0x4e, 0x6f, 0x49, 0x45, 0x64, 0x79, 0x62, 0x33, 0x56, 0x77, 0x4d, + 0x52, 0x55, 0x77, 0x45, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, + 0x77, 0x78, 0x4a, 0x55, 0x31, 0x4a, 0x48, 0x49, 0x46, 0x4a, 0x76, 0x62, + 0x33, 0x51, 0x67, 0x57, 0x44, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, + 0x54, 0x55, 0x77, 0x4e, 0x6a, 0x41, 0x30, 0x4d, 0x54, 0x45, 0x77, 0x4e, + 0x44, 0x4d, 0x34, 0x0a, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x55, 0x77, + 0x4e, 0x6a, 0x41, 0x30, 0x4d, 0x54, 0x45, 0x77, 0x4e, 0x44, 0x4d, 0x34, + 0x57, 0x6a, 0x42, 0x50, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x70, + 0x4d, 0x43, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x67, + 0x53, 0x57, 0x35, 0x30, 0x5a, 0x58, 0x4a, 0x75, 0x0a, 0x5a, 0x58, 0x51, + 0x67, 0x55, 0x32, 0x56, 0x6a, 0x64, 0x58, 0x4a, 0x70, 0x64, 0x48, 0x6b, + 0x67, 0x55, 0x6d, 0x56, 0x7a, 0x5a, 0x57, 0x46, 0x79, 0x59, 0x32, 0x67, + 0x67, 0x52, 0x33, 0x4a, 0x76, 0x64, 0x58, 0x41, 0x78, 0x46, 0x54, 0x41, + 0x54, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x44, 0x45, 0x6c, + 0x54, 0x55, 0x6b, 0x63, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, + 0x59, 0x0a, 0x4d, 0x54, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4b, + 0x33, 0x6f, 0x4a, 0x48, 0x50, 0x30, 0x46, 0x44, 0x66, 0x7a, 0x6d, 0x35, + 0x34, 0x72, 0x56, 0x79, 0x67, 0x63, 0x0a, 0x68, 0x37, 0x37, 0x63, 0x74, + 0x39, 0x38, 0x34, 0x6b, 0x49, 0x78, 0x75, 0x50, 0x4f, 0x5a, 0x58, 0x6f, + 0x48, 0x6a, 0x33, 0x64, 0x63, 0x4b, 0x69, 0x2f, 0x76, 0x56, 0x71, 0x62, + 0x76, 0x59, 0x41, 0x54, 0x79, 0x6a, 0x62, 0x33, 0x6d, 0x69, 0x47, 0x62, + 0x45, 0x53, 0x54, 0x74, 0x72, 0x46, 0x6a, 0x2f, 0x52, 0x51, 0x53, 0x61, + 0x37, 0x38, 0x66, 0x30, 0x75, 0x6f, 0x78, 0x6d, 0x79, 0x46, 0x2b, 0x0a, + 0x30, 0x54, 0x4d, 0x38, 0x75, 0x6b, 0x6a, 0x31, 0x33, 0x58, 0x6e, 0x66, + 0x73, 0x37, 0x6a, 0x2f, 0x45, 0x76, 0x45, 0x68, 0x6d, 0x6b, 0x76, 0x42, + 0x69, 0x6f, 0x5a, 0x78, 0x61, 0x55, 0x70, 0x6d, 0x5a, 0x6d, 0x79, 0x50, + 0x66, 0x6a, 0x78, 0x77, 0x76, 0x36, 0x30, 0x70, 0x49, 0x67, 0x62, 0x7a, + 0x35, 0x4d, 0x44, 0x6d, 0x67, 0x4b, 0x37, 0x69, 0x53, 0x34, 0x2b, 0x33, + 0x6d, 0x58, 0x36, 0x55, 0x0a, 0x41, 0x35, 0x2f, 0x54, 0x52, 0x35, 0x64, + 0x38, 0x6d, 0x55, 0x67, 0x6a, 0x55, 0x2b, 0x67, 0x34, 0x72, 0x6b, 0x38, + 0x4b, 0x62, 0x34, 0x4d, 0x75, 0x30, 0x55, 0x6c, 0x58, 0x6a, 0x49, 0x42, + 0x30, 0x74, 0x74, 0x6f, 0x76, 0x30, 0x44, 0x69, 0x4e, 0x65, 0x77, 0x4e, + 0x77, 0x49, 0x52, 0x74, 0x31, 0x38, 0x6a, 0x41, 0x38, 0x2b, 0x6f, 0x2b, + 0x75, 0x33, 0x64, 0x70, 0x6a, 0x71, 0x2b, 0x73, 0x57, 0x0a, 0x54, 0x38, + 0x4b, 0x4f, 0x45, 0x55, 0x74, 0x2b, 0x7a, 0x77, 0x76, 0x6f, 0x2f, 0x37, + 0x56, 0x33, 0x4c, 0x76, 0x53, 0x79, 0x65, 0x30, 0x72, 0x67, 0x54, 0x42, + 0x49, 0x6c, 0x44, 0x48, 0x43, 0x4e, 0x41, 0x79, 0x6d, 0x67, 0x34, 0x56, + 0x4d, 0x6b, 0x37, 0x42, 0x50, 0x5a, 0x37, 0x68, 0x6d, 0x2f, 0x45, 0x4c, + 0x4e, 0x4b, 0x6a, 0x44, 0x2b, 0x4a, 0x6f, 0x32, 0x46, 0x52, 0x33, 0x71, + 0x79, 0x48, 0x0a, 0x42, 0x35, 0x54, 0x30, 0x59, 0x33, 0x48, 0x73, 0x4c, + 0x75, 0x4a, 0x76, 0x57, 0x35, 0x69, 0x42, 0x34, 0x59, 0x6c, 0x63, 0x4e, + 0x48, 0x6c, 0x73, 0x64, 0x75, 0x38, 0x37, 0x6b, 0x47, 0x4a, 0x35, 0x35, + 0x74, 0x75, 0x6b, 0x6d, 0x69, 0x38, 0x6d, 0x78, 0x64, 0x41, 0x51, 0x34, + 0x51, 0x37, 0x65, 0x32, 0x52, 0x43, 0x4f, 0x46, 0x76, 0x75, 0x33, 0x39, + 0x36, 0x6a, 0x33, 0x78, 0x2b, 0x55, 0x43, 0x0a, 0x42, 0x35, 0x69, 0x50, + 0x4e, 0x67, 0x69, 0x56, 0x35, 0x2b, 0x49, 0x33, 0x6c, 0x67, 0x30, 0x32, + 0x64, 0x5a, 0x37, 0x37, 0x44, 0x6e, 0x4b, 0x78, 0x48, 0x5a, 0x75, 0x38, + 0x41, 0x2f, 0x6c, 0x4a, 0x42, 0x64, 0x69, 0x42, 0x33, 0x51, 0x57, 0x30, + 0x4b, 0x74, 0x5a, 0x42, 0x36, 0x61, 0x77, 0x42, 0x64, 0x70, 0x55, 0x4b, + 0x44, 0x39, 0x6a, 0x66, 0x31, 0x62, 0x30, 0x53, 0x48, 0x7a, 0x55, 0x76, + 0x0a, 0x4b, 0x42, 0x64, 0x73, 0x30, 0x70, 0x6a, 0x42, 0x71, 0x41, 0x6c, + 0x6b, 0x64, 0x32, 0x35, 0x48, 0x4e, 0x37, 0x72, 0x4f, 0x72, 0x46, 0x6c, + 0x65, 0x61, 0x4a, 0x31, 0x2f, 0x63, 0x74, 0x61, 0x4a, 0x78, 0x51, 0x5a, + 0x42, 0x4b, 0x54, 0x35, 0x5a, 0x50, 0x74, 0x30, 0x6d, 0x39, 0x53, 0x54, + 0x4a, 0x45, 0x61, 0x64, 0x61, 0x6f, 0x30, 0x78, 0x41, 0x48, 0x30, 0x61, + 0x68, 0x6d, 0x62, 0x57, 0x6e, 0x0a, 0x4f, 0x6c, 0x46, 0x75, 0x68, 0x6a, + 0x75, 0x65, 0x66, 0x58, 0x4b, 0x6e, 0x45, 0x67, 0x56, 0x34, 0x57, 0x65, + 0x30, 0x2b, 0x55, 0x58, 0x67, 0x56, 0x43, 0x77, 0x4f, 0x50, 0x6a, 0x64, + 0x41, 0x76, 0x42, 0x62, 0x49, 0x2b, 0x65, 0x30, 0x6f, 0x63, 0x53, 0x33, + 0x4d, 0x46, 0x45, 0x76, 0x7a, 0x47, 0x36, 0x75, 0x42, 0x51, 0x45, 0x33, + 0x78, 0x44, 0x6b, 0x33, 0x53, 0x7a, 0x79, 0x6e, 0x54, 0x6e, 0x0a, 0x6a, + 0x68, 0x38, 0x42, 0x43, 0x4e, 0x41, 0x77, 0x31, 0x46, 0x74, 0x78, 0x4e, + 0x72, 0x51, 0x48, 0x75, 0x73, 0x45, 0x77, 0x4d, 0x46, 0x78, 0x49, 0x74, + 0x34, 0x49, 0x37, 0x6d, 0x4b, 0x5a, 0x39, 0x59, 0x49, 0x71, 0x69, 0x6f, + 0x79, 0x6d, 0x43, 0x7a, 0x4c, 0x71, 0x39, 0x67, 0x77, 0x51, 0x62, 0x6f, + 0x6f, 0x4d, 0x44, 0x51, 0x61, 0x48, 0x57, 0x42, 0x66, 0x45, 0x62, 0x77, + 0x72, 0x62, 0x77, 0x0a, 0x71, 0x48, 0x79, 0x47, 0x4f, 0x30, 0x61, 0x6f, + 0x53, 0x43, 0x71, 0x49, 0x33, 0x48, 0x61, 0x61, 0x64, 0x72, 0x38, 0x66, + 0x61, 0x71, 0x55, 0x39, 0x47, 0x59, 0x2f, 0x72, 0x4f, 0x50, 0x4e, 0x6b, + 0x33, 0x73, 0x67, 0x72, 0x44, 0x51, 0x6f, 0x6f, 0x2f, 0x2f, 0x66, 0x62, + 0x34, 0x68, 0x56, 0x43, 0x31, 0x43, 0x4c, 0x51, 0x4a, 0x31, 0x33, 0x68, + 0x65, 0x66, 0x34, 0x59, 0x35, 0x33, 0x43, 0x49, 0x0a, 0x72, 0x55, 0x37, + 0x6d, 0x32, 0x59, 0x73, 0x36, 0x78, 0x74, 0x30, 0x6e, 0x55, 0x57, 0x37, + 0x2f, 0x76, 0x47, 0x54, 0x31, 0x4d, 0x30, 0x4e, 0x50, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x34, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, + 0x56, 0x0a, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, + 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x35, 0x74, 0x46, + 0x6e, 0x6d, 0x65, 0x37, 0x62, 0x6c, 0x35, 0x41, 0x46, 0x7a, 0x67, 0x41, + 0x69, 0x49, 0x79, 0x42, 0x70, 0x59, 0x39, 0x75, 0x6d, 0x62, 0x62, 0x6a, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x0a, 0x68, 0x6b, 0x69, 0x47, 0x39, + 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, + 0x67, 0x45, 0x41, 0x56, 0x52, 0x39, 0x59, 0x71, 0x62, 0x79, 0x79, 0x71, + 0x46, 0x44, 0x51, 0x44, 0x4c, 0x48, 0x59, 0x47, 0x6d, 0x6b, 0x67, 0x4a, + 0x79, 0x6b, 0x49, 0x72, 0x47, 0x46, 0x31, 0x58, 0x49, 0x70, 0x75, 0x2b, + 0x49, 0x4c, 0x6c, 0x61, 0x53, 0x2f, 0x56, 0x39, 0x6c, 0x5a, 0x4c, 0x0a, + 0x75, 0x62, 0x68, 0x7a, 0x45, 0x46, 0x6e, 0x54, 0x49, 0x5a, 0x64, 0x2b, + 0x35, 0x30, 0x78, 0x78, 0x2b, 0x37, 0x4c, 0x53, 0x59, 0x4b, 0x30, 0x35, + 0x71, 0x41, 0x76, 0x71, 0x46, 0x79, 0x46, 0x57, 0x68, 0x66, 0x46, 0x51, + 0x44, 0x6c, 0x6e, 0x72, 0x7a, 0x75, 0x42, 0x5a, 0x36, 0x62, 0x72, 0x4a, + 0x46, 0x65, 0x2b, 0x47, 0x6e, 0x59, 0x2b, 0x45, 0x67, 0x50, 0x62, 0x6b, + 0x36, 0x5a, 0x47, 0x51, 0x0a, 0x33, 0x42, 0x65, 0x62, 0x59, 0x68, 0x74, + 0x46, 0x38, 0x47, 0x61, 0x56, 0x30, 0x6e, 0x78, 0x76, 0x77, 0x75, 0x6f, + 0x37, 0x37, 0x78, 0x2f, 0x50, 0x79, 0x39, 0x61, 0x75, 0x4a, 0x2f, 0x47, + 0x70, 0x73, 0x4d, 0x69, 0x75, 0x2f, 0x58, 0x31, 0x2b, 0x6d, 0x76, 0x6f, + 0x69, 0x42, 0x4f, 0x76, 0x2f, 0x32, 0x58, 0x2f, 0x71, 0x6b, 0x53, 0x73, + 0x69, 0x73, 0x52, 0x63, 0x4f, 0x6a, 0x2f, 0x4b, 0x4b, 0x0a, 0x4e, 0x46, + 0x74, 0x59, 0x32, 0x50, 0x77, 0x42, 0x79, 0x56, 0x53, 0x35, 0x75, 0x43, + 0x62, 0x4d, 0x69, 0x6f, 0x67, 0x7a, 0x69, 0x55, 0x77, 0x74, 0x68, 0x44, + 0x79, 0x43, 0x33, 0x2b, 0x36, 0x57, 0x56, 0x77, 0x57, 0x36, 0x4c, 0x4c, + 0x76, 0x33, 0x78, 0x4c, 0x66, 0x48, 0x54, 0x6a, 0x75, 0x43, 0x76, 0x6a, + 0x48, 0x49, 0x49, 0x6e, 0x4e, 0x7a, 0x6b, 0x74, 0x48, 0x43, 0x67, 0x4b, + 0x51, 0x35, 0x0a, 0x4f, 0x52, 0x41, 0x7a, 0x49, 0x34, 0x4a, 0x4d, 0x50, + 0x4a, 0x2b, 0x47, 0x73, 0x6c, 0x57, 0x59, 0x48, 0x62, 0x34, 0x70, 0x68, + 0x6f, 0x77, 0x69, 0x6d, 0x35, 0x37, 0x69, 0x61, 0x7a, 0x74, 0x58, 0x4f, + 0x6f, 0x4a, 0x77, 0x54, 0x64, 0x77, 0x4a, 0x78, 0x34, 0x6e, 0x4c, 0x43, + 0x67, 0x64, 0x4e, 0x62, 0x4f, 0x68, 0x64, 0x6a, 0x73, 0x6e, 0x76, 0x7a, + 0x71, 0x76, 0x48, 0x75, 0x37, 0x55, 0x72, 0x0a, 0x54, 0x6b, 0x58, 0x57, + 0x53, 0x74, 0x41, 0x6d, 0x7a, 0x4f, 0x56, 0x79, 0x79, 0x67, 0x68, 0x71, + 0x70, 0x5a, 0x58, 0x6a, 0x46, 0x61, 0x48, 0x33, 0x70, 0x4f, 0x33, 0x4a, + 0x4c, 0x46, 0x2b, 0x6c, 0x2b, 0x2f, 0x2b, 0x73, 0x4b, 0x41, 0x49, 0x75, + 0x76, 0x74, 0x64, 0x37, 0x75, 0x2b, 0x4e, 0x78, 0x65, 0x35, 0x41, 0x57, + 0x30, 0x77, 0x64, 0x65, 0x52, 0x6c, 0x4e, 0x38, 0x4e, 0x77, 0x64, 0x43, + 0x0a, 0x6a, 0x4e, 0x50, 0x45, 0x6c, 0x70, 0x7a, 0x56, 0x6d, 0x62, 0x55, + 0x71, 0x34, 0x4a, 0x55, 0x61, 0x67, 0x45, 0x69, 0x75, 0x54, 0x44, 0x6b, + 0x48, 0x7a, 0x73, 0x78, 0x48, 0x70, 0x46, 0x4b, 0x56, 0x4b, 0x37, 0x71, + 0x34, 0x2b, 0x36, 0x33, 0x53, 0x4d, 0x31, 0x4e, 0x39, 0x35, 0x52, 0x31, + 0x4e, 0x62, 0x64, 0x57, 0x68, 0x73, 0x63, 0x64, 0x43, 0x62, 0x2b, 0x5a, + 0x41, 0x4a, 0x7a, 0x56, 0x63, 0x0a, 0x6f, 0x79, 0x69, 0x33, 0x42, 0x34, + 0x33, 0x6e, 0x6a, 0x54, 0x4f, 0x51, 0x35, 0x79, 0x4f, 0x66, 0x2b, 0x31, + 0x43, 0x63, 0x65, 0x57, 0x78, 0x47, 0x31, 0x62, 0x51, 0x56, 0x73, 0x35, + 0x5a, 0x75, 0x66, 0x70, 0x73, 0x4d, 0x6c, 0x6a, 0x71, 0x34, 0x55, 0x69, + 0x30, 0x2f, 0x31, 0x6c, 0x76, 0x68, 0x2b, 0x77, 0x6a, 0x43, 0x68, 0x50, + 0x34, 0x6b, 0x71, 0x4b, 0x4f, 0x4a, 0x32, 0x71, 0x78, 0x71, 0x0a, 0x34, + 0x52, 0x67, 0x71, 0x73, 0x61, 0x68, 0x44, 0x59, 0x56, 0x76, 0x54, 0x48, + 0x39, 0x77, 0x37, 0x6a, 0x58, 0x62, 0x79, 0x4c, 0x65, 0x69, 0x4e, 0x64, + 0x64, 0x38, 0x58, 0x4d, 0x32, 0x77, 0x39, 0x55, 0x2f, 0x74, 0x37, 0x79, + 0x30, 0x46, 0x66, 0x2f, 0x39, 0x79, 0x69, 0x30, 0x47, 0x45, 0x34, 0x34, + 0x5a, 0x61, 0x34, 0x72, 0x46, 0x32, 0x4c, 0x4e, 0x39, 0x64, 0x31, 0x31, + 0x54, 0x50, 0x41, 0x0a, 0x6d, 0x52, 0x47, 0x75, 0x6e, 0x55, 0x48, 0x42, + 0x63, 0x6e, 0x57, 0x45, 0x76, 0x67, 0x4a, 0x42, 0x51, 0x6c, 0x39, 0x6e, + 0x4a, 0x45, 0x69, 0x55, 0x30, 0x5a, 0x73, 0x6e, 0x76, 0x67, 0x63, 0x2f, + 0x75, 0x62, 0x68, 0x50, 0x67, 0x58, 0x52, 0x52, 0x34, 0x58, 0x71, 0x33, + 0x37, 0x5a, 0x30, 0x6a, 0x34, 0x72, 0x37, 0x67, 0x31, 0x53, 0x67, 0x45, + 0x45, 0x7a, 0x77, 0x78, 0x41, 0x35, 0x37, 0x64, 0x0a, 0x65, 0x6d, 0x79, + 0x50, 0x78, 0x67, 0x63, 0x59, 0x78, 0x6e, 0x2f, 0x65, 0x52, 0x34, 0x34, + 0x2f, 0x4b, 0x4a, 0x34, 0x45, 0x42, 0x73, 0x2b, 0x6c, 0x56, 0x44, 0x52, + 0x33, 0x76, 0x65, 0x79, 0x4a, 0x6d, 0x2b, 0x6b, 0x58, 0x51, 0x39, 0x39, + 0x62, 0x32, 0x31, 0x2f, 0x2b, 0x6a, 0x68, 0x35, 0x58, 0x6f, 0x73, 0x31, + 0x41, 0x6e, 0x58, 0x35, 0x69, 0x49, 0x74, 0x72, 0x65, 0x47, 0x43, 0x63, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x4f, 0x3d, 0x46, 0x4e, 0x4d, 0x54, 0x2d, 0x52, 0x43, + 0x4d, 0x20, 0x4f, 0x55, 0x3d, 0x41, 0x43, 0x20, 0x52, 0x41, 0x49, 0x5a, + 0x20, 0x46, 0x4e, 0x4d, 0x54, 0x2d, 0x52, 0x43, 0x4d, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x4f, 0x3d, 0x46, + 0x4e, 0x4d, 0x54, 0x2d, 0x52, 0x43, 0x4d, 0x20, 0x4f, 0x55, 0x3d, 0x41, + 0x43, 0x20, 0x52, 0x41, 0x49, 0x5a, 0x20, 0x46, 0x4e, 0x4d, 0x54, 0x2d, + 0x52, 0x43, 0x4d, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x41, 0x43, 0x20, 0x52, 0x41, 0x49, 0x5a, 0x20, 0x46, 0x4e, + 0x4d, 0x54, 0x2d, 0x52, 0x43, 0x4d, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x38, 0x35, 0x38, 0x37, 0x36, + 0x33, 0x30, 0x38, 0x32, 0x30, 0x36, 0x34, 0x34, 0x38, 0x38, 0x30, 0x34, + 0x37, 0x30, 0x31, 0x35, 0x35, 0x34, 0x36, 0x38, 0x32, 0x37, 0x36, 0x30, + 0x35, 0x35, 0x34, 0x37, 0x35, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x65, 0x32, 0x3a, 0x30, 0x39, 0x3a, 0x30, 0x34, 0x3a, 0x62, + 0x34, 0x3a, 0x64, 0x33, 0x3a, 0x62, 0x64, 0x3a, 0x64, 0x31, 0x3a, 0x61, + 0x30, 0x3a, 0x31, 0x34, 0x3a, 0x66, 0x64, 0x3a, 0x31, 0x61, 0x3a, 0x64, + 0x32, 0x3a, 0x34, 0x37, 0x3a, 0x63, 0x34, 0x3a, 0x35, 0x37, 0x3a, 0x31, + 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x63, + 0x3a, 0x35, 0x30, 0x3a, 0x33, 0x35, 0x3a, 0x30, 0x37, 0x3a, 0x62, 0x32, + 0x3a, 0x31, 0x35, 0x3a, 0x63, 0x34, 0x3a, 0x39, 0x35, 0x3a, 0x36, 0x32, + 0x3a, 0x31, 0x39, 0x3a, 0x65, 0x32, 0x3a, 0x61, 0x38, 0x3a, 0x39, 0x61, + 0x3a, 0x35, 0x62, 0x3a, 0x34, 0x32, 0x3a, 0x39, 0x39, 0x3a, 0x32, 0x63, + 0x3a, 0x34, 0x63, 0x3a, 0x32, 0x63, 0x3a, 0x32, 0x30, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x62, 0x3a, 0x63, + 0x35, 0x3a, 0x35, 0x37, 0x3a, 0x30, 0x63, 0x3a, 0x32, 0x39, 0x3a, 0x30, + 0x31, 0x3a, 0x38, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x36, 0x37, 0x3a, 0x62, + 0x31, 0x3a, 0x61, 0x61, 0x3a, 0x31, 0x32, 0x3a, 0x37, 0x62, 0x3a, 0x61, + 0x66, 0x3a, 0x31, 0x32, 0x3a, 0x66, 0x37, 0x3a, 0x30, 0x33, 0x3a, 0x62, + 0x34, 0x3a, 0x36, 0x31, 0x3a, 0x31, 0x65, 0x3a, 0x62, 0x63, 0x3a, 0x31, + 0x37, 0x3a, 0x62, 0x37, 0x3a, 0x64, 0x61, 0x3a, 0x62, 0x35, 0x3a, 0x35, + 0x37, 0x3a, 0x33, 0x38, 0x3a, 0x39, 0x34, 0x3a, 0x31, 0x37, 0x3a, 0x39, + 0x62, 0x3a, 0x39, 0x33, 0x3a, 0x66, 0x61, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x46, 0x67, 0x7a, 0x43, 0x43, 0x41, 0x32, 0x75, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x50, 0x58, 0x5a, 0x4f, 0x4e, + 0x4d, 0x47, 0x63, 0x32, 0x79, 0x41, 0x59, 0x64, 0x47, 0x73, 0x64, 0x55, + 0x68, 0x47, 0x6b, 0x48, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, + 0x4d, 0x44, 0x73, 0x78, 0x0a, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x56, 0x54, 0x4d, 0x52, 0x45, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, 0x68, + 0x47, 0x54, 0x6b, 0x31, 0x55, 0x4c, 0x56, 0x4a, 0x44, 0x54, 0x54, 0x45, + 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x77, 0x77, + 0x51, 0x51, 0x55, 0x4d, 0x67, 0x55, 0x6b, 0x46, 0x4a, 0x0a, 0x57, 0x69, + 0x42, 0x47, 0x54, 0x6b, 0x31, 0x55, 0x4c, 0x56, 0x4a, 0x44, 0x54, 0x54, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x77, 0x4f, 0x44, 0x45, 0x77, 0x4d, 0x6a, + 0x6b, 0x78, 0x4e, 0x54, 0x55, 0x35, 0x4e, 0x54, 0x5a, 0x61, 0x46, 0x77, + 0x30, 0x7a, 0x4d, 0x44, 0x41, 0x78, 0x4d, 0x44, 0x45, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x4d, 0x44, 0x73, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x56, 0x54, 0x4d, 0x52, 0x45, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x44, 0x41, 0x68, 0x47, 0x54, 0x6b, 0x31, 0x55, 0x4c, + 0x56, 0x4a, 0x44, 0x54, 0x54, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x77, 0x77, 0x51, 0x51, 0x55, 0x4d, 0x67, 0x55, + 0x6b, 0x46, 0x4a, 0x57, 0x69, 0x42, 0x47, 0x0a, 0x54, 0x6b, 0x31, 0x55, + 0x4c, 0x56, 0x4a, 0x44, 0x54, 0x54, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, + 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, + 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, + 0x41, 0x44, 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, + 0x41, 0x4c, 0x70, 0x78, 0x67, 0x48, 0x70, 0x4d, 0x68, 0x6d, 0x35, 0x2f, + 0x0a, 0x79, 0x42, 0x4e, 0x74, 0x77, 0x4d, 0x5a, 0x39, 0x48, 0x41, 0x43, + 0x58, 0x6a, 0x79, 0x77, 0x4d, 0x49, 0x37, 0x73, 0x51, 0x6d, 0x6b, 0x43, + 0x70, 0x47, 0x72, 0x65, 0x48, 0x69, 0x50, 0x69, 0x62, 0x56, 0x6d, 0x72, + 0x37, 0x35, 0x6e, 0x75, 0x4f, 0x69, 0x35, 0x4b, 0x4f, 0x70, 0x79, 0x56, + 0x64, 0x57, 0x52, 0x48, 0x62, 0x4e, 0x69, 0x36, 0x33, 0x55, 0x52, 0x63, + 0x66, 0x71, 0x51, 0x67, 0x66, 0x0a, 0x42, 0x42, 0x63, 0x6b, 0x57, 0x4b, + 0x6f, 0x33, 0x53, 0x68, 0x6a, 0x66, 0x35, 0x54, 0x6e, 0x55, 0x56, 0x2f, + 0x33, 0x58, 0x77, 0x53, 0x79, 0x52, 0x41, 0x5a, 0x48, 0x69, 0x49, 0x74, + 0x51, 0x44, 0x77, 0x46, 0x6a, 0x38, 0x64, 0x30, 0x66, 0x73, 0x6a, 0x7a, + 0x35, 0x30, 0x51, 0x37, 0x71, 0x73, 0x4e, 0x49, 0x31, 0x4e, 0x4f, 0x48, + 0x5a, 0x6e, 0x6a, 0x72, 0x44, 0x49, 0x62, 0x7a, 0x41, 0x7a, 0x0a, 0x57, + 0x48, 0x46, 0x63, 0x74, 0x50, 0x56, 0x72, 0x62, 0x74, 0x51, 0x42, 0x55, + 0x4c, 0x67, 0x54, 0x66, 0x6d, 0x78, 0x4b, 0x6f, 0x30, 0x6e, 0x52, 0x49, + 0x42, 0x6e, 0x75, 0x76, 0x4d, 0x41, 0x70, 0x47, 0x47, 0x57, 0x6e, 0x33, + 0x76, 0x37, 0x76, 0x33, 0x51, 0x71, 0x51, 0x49, 0x65, 0x63, 0x61, 0x5a, + 0x35, 0x4a, 0x43, 0x45, 0x4a, 0x68, 0x66, 0x54, 0x7a, 0x43, 0x38, 0x50, + 0x68, 0x78, 0x46, 0x0a, 0x74, 0x42, 0x44, 0x58, 0x61, 0x45, 0x41, 0x55, + 0x77, 0x45, 0x44, 0x36, 0x35, 0x33, 0x63, 0x58, 0x65, 0x75, 0x59, 0x4c, + 0x6a, 0x32, 0x56, 0x62, 0x50, 0x4e, 0x6d, 0x61, 0x55, 0x74, 0x75, 0x31, + 0x76, 0x5a, 0x35, 0x47, 0x7a, 0x7a, 0x33, 0x72, 0x6b, 0x51, 0x55, 0x43, + 0x77, 0x4a, 0x61, 0x79, 0x64, 0x6b, 0x78, 0x4e, 0x45, 0x4a, 0x59, 0x37, + 0x6b, 0x76, 0x71, 0x63, 0x66, 0x77, 0x2b, 0x5a, 0x0a, 0x33, 0x37, 0x34, + 0x6a, 0x4e, 0x55, 0x55, 0x65, 0x41, 0x6c, 0x7a, 0x2b, 0x74, 0x61, 0x69, + 0x62, 0x6d, 0x53, 0x58, 0x61, 0x58, 0x76, 0x4d, 0x69, 0x77, 0x7a, 0x6e, + 0x31, 0x35, 0x43, 0x6f, 0x75, 0x30, 0x38, 0x59, 0x66, 0x78, 0x47, 0x79, + 0x71, 0x78, 0x52, 0x78, 0x71, 0x41, 0x51, 0x56, 0x4b, 0x4c, 0x39, 0x4c, + 0x46, 0x77, 0x61, 0x67, 0x30, 0x4a, 0x6c, 0x31, 0x6d, 0x70, 0x64, 0x49, + 0x43, 0x0a, 0x49, 0x66, 0x6b, 0x59, 0x74, 0x77, 0x62, 0x31, 0x54, 0x70, + 0x6c, 0x76, 0x71, 0x4b, 0x74, 0x4d, 0x55, 0x65, 0x6a, 0x50, 0x55, 0x42, + 0x6a, 0x46, 0x64, 0x38, 0x67, 0x35, 0x43, 0x53, 0x78, 0x4a, 0x6b, 0x6a, + 0x4b, 0x5a, 0x71, 0x4c, 0x73, 0x58, 0x46, 0x33, 0x6d, 0x77, 0x57, 0x73, + 0x58, 0x6d, 0x6f, 0x38, 0x52, 0x5a, 0x5a, 0x55, 0x63, 0x31, 0x67, 0x31, + 0x36, 0x70, 0x36, 0x44, 0x55, 0x4c, 0x0a, 0x6d, 0x62, 0x76, 0x6b, 0x7a, + 0x53, 0x44, 0x47, 0x6d, 0x30, 0x6f, 0x47, 0x4f, 0x62, 0x56, 0x6f, 0x2f, + 0x43, 0x4b, 0x36, 0x37, 0x6c, 0x57, 0x4d, 0x4b, 0x30, 0x37, 0x71, 0x38, + 0x37, 0x48, 0x6a, 0x2f, 0x4c, 0x61, 0x5a, 0x6d, 0x74, 0x56, 0x43, 0x2b, + 0x6e, 0x46, 0x4e, 0x43, 0x4d, 0x2b, 0x48, 0x48, 0x6d, 0x70, 0x78, 0x66, + 0x66, 0x6e, 0x54, 0x74, 0x4f, 0x6d, 0x6c, 0x63, 0x59, 0x46, 0x37, 0x0a, + 0x77, 0x6b, 0x35, 0x48, 0x6c, 0x71, 0x58, 0x32, 0x64, 0x6f, 0x57, 0x6a, + 0x4b, 0x49, 0x2f, 0x70, 0x67, 0x47, 0x36, 0x42, 0x55, 0x36, 0x56, 0x74, + 0x58, 0x37, 0x68, 0x49, 0x2b, 0x63, 0x4c, 0x35, 0x4e, 0x71, 0x59, 0x75, + 0x53, 0x66, 0x2b, 0x34, 0x6c, 0x73, 0x4b, 0x4d, 0x42, 0x37, 0x4f, 0x62, + 0x69, 0x46, 0x6a, 0x38, 0x36, 0x78, 0x73, 0x63, 0x33, 0x69, 0x31, 0x77, + 0x34, 0x70, 0x65, 0x53, 0x0a, 0x4d, 0x4b, 0x47, 0x4a, 0x34, 0x37, 0x78, + 0x56, 0x71, 0x43, 0x66, 0x57, 0x53, 0x2b, 0x32, 0x51, 0x72, 0x59, 0x76, + 0x36, 0x59, 0x79, 0x56, 0x5a, 0x4c, 0x61, 0x67, 0x31, 0x33, 0x63, 0x71, + 0x58, 0x4d, 0x37, 0x7a, 0x6c, 0x7a, 0x63, 0x65, 0x64, 0x30, 0x65, 0x7a, + 0x76, 0x58, 0x67, 0x35, 0x4b, 0x6b, 0x41, 0x59, 0x6d, 0x59, 0x36, 0x32, + 0x35, 0x32, 0x54, 0x55, 0x74, 0x42, 0x37, 0x70, 0x32, 0x0a, 0x5a, 0x53, + 0x79, 0x73, 0x56, 0x34, 0x39, 0x39, 0x39, 0x41, 0x65, 0x55, 0x31, 0x34, + 0x45, 0x43, 0x6c, 0x6c, 0x32, 0x6a, 0x42, 0x30, 0x6e, 0x56, 0x65, 0x74, + 0x42, 0x58, 0x2b, 0x52, 0x76, 0x6e, 0x55, 0x30, 0x5a, 0x31, 0x71, 0x72, + 0x42, 0x35, 0x51, 0x73, 0x74, 0x6f, 0x63, 0x51, 0x6a, 0x70, 0x59, 0x4c, + 0x30, 0x35, 0x61, 0x63, 0x37, 0x30, 0x72, 0x38, 0x4e, 0x57, 0x51, 0x4d, + 0x65, 0x74, 0x0a, 0x55, 0x71, 0x49, 0x4a, 0x35, 0x47, 0x2b, 0x47, 0x52, + 0x34, 0x6f, 0x66, 0x36, 0x79, 0x67, 0x6e, 0x58, 0x59, 0x4d, 0x67, 0x72, + 0x77, 0x54, 0x4a, 0x62, 0x46, 0x61, 0x61, 0x69, 0x30, 0x62, 0x31, 0x41, + 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x59, 0x4d, 0x77, 0x67, + 0x59, 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x0a, 0x41, 0x77, 0x45, 0x42, + 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, + 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x50, 0x64, 0x39, 0x78, 0x66, 0x33, 0x45, 0x36, 0x4a, 0x6f, 0x62, + 0x64, 0x32, 0x53, 0x6e, 0x39, 0x52, 0x32, 0x67, 0x7a, 0x4c, 0x2b, 0x48, + 0x0a, 0x59, 0x4a, 0x70, 0x74, 0x4d, 0x44, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x49, 0x41, 0x51, 0x33, 0x4d, 0x44, 0x55, 0x77, 0x4d, 0x77, 0x59, + 0x45, 0x56, 0x52, 0x30, 0x67, 0x41, 0x44, 0x41, 0x72, 0x4d, 0x43, 0x6b, + 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, 0x77, 0x49, + 0x42, 0x46, 0x68, 0x31, 0x6f, 0x64, 0x48, 0x52, 0x77, 0x4f, 0x69, 0x38, + 0x76, 0x64, 0x33, 0x64, 0x33, 0x0a, 0x4c, 0x6d, 0x4e, 0x6c, 0x63, 0x6e, + 0x51, 0x75, 0x5a, 0x6d, 0x35, 0x74, 0x64, 0x43, 0x35, 0x6c, 0x63, 0x79, + 0x39, 0x6b, 0x63, 0x47, 0x4e, 0x7a, 0x4c, 0x7a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x42, 0x35, + 0x42, 0x4b, 0x33, 0x2f, 0x4d, 0x6a, 0x54, 0x76, 0x44, 0x44, 0x0a, 0x6e, + 0x46, 0x46, 0x6c, 0x6d, 0x35, 0x77, 0x69, 0x6f, 0x6f, 0x6f, 0x4d, 0x68, + 0x66, 0x4e, 0x7a, 0x4b, 0x57, 0x74, 0x4e, 0x2f, 0x67, 0x48, 0x69, 0x71, + 0x51, 0x78, 0x6a, 0x41, 0x62, 0x38, 0x45, 0x5a, 0x36, 0x57, 0x64, 0x6d, + 0x46, 0x2f, 0x39, 0x41, 0x52, 0x50, 0x36, 0x37, 0x4a, 0x70, 0x69, 0x36, + 0x59, 0x62, 0x2b, 0x74, 0x6d, 0x4c, 0x53, 0x62, 0x6b, 0x79, 0x55, 0x2b, + 0x38, 0x42, 0x31, 0x0a, 0x52, 0x58, 0x78, 0x6c, 0x44, 0x50, 0x69, 0x79, + 0x4e, 0x38, 0x2b, 0x73, 0x44, 0x38, 0x2b, 0x4e, 0x62, 0x2f, 0x6b, 0x5a, + 0x39, 0x34, 0x2f, 0x73, 0x48, 0x76, 0x4a, 0x77, 0x6e, 0x76, 0x44, 0x4b, + 0x75, 0x4f, 0x2b, 0x33, 0x2f, 0x33, 0x59, 0x33, 0x64, 0x6c, 0x76, 0x32, + 0x62, 0x6f, 0x6a, 0x7a, 0x72, 0x32, 0x49, 0x79, 0x49, 0x70, 0x4d, 0x4e, + 0x4f, 0x6d, 0x71, 0x4f, 0x46, 0x47, 0x59, 0x4d, 0x0a, 0x4c, 0x56, 0x4e, + 0x30, 0x56, 0x32, 0x55, 0x65, 0x31, 0x62, 0x4c, 0x64, 0x49, 0x34, 0x45, + 0x37, 0x70, 0x57, 0x59, 0x6a, 0x4a, 0x32, 0x63, 0x4a, 0x6a, 0x2b, 0x46, + 0x33, 0x71, 0x6b, 0x50, 0x4e, 0x5a, 0x56, 0x45, 0x49, 0x37, 0x56, 0x46, + 0x59, 0x2f, 0x75, 0x59, 0x35, 0x2b, 0x63, 0x74, 0x48, 0x68, 0x4b, 0x51, + 0x56, 0x38, 0x58, 0x61, 0x37, 0x70, 0x4f, 0x36, 0x6b, 0x4f, 0x38, 0x52, + 0x66, 0x0a, 0x37, 0x37, 0x49, 0x7a, 0x6c, 0x68, 0x45, 0x59, 0x74, 0x38, + 0x6c, 0x6c, 0x76, 0x68, 0x6a, 0x68, 0x6f, 0x36, 0x54, 0x63, 0x2b, 0x68, + 0x6a, 0x35, 0x30, 0x37, 0x77, 0x54, 0x6d, 0x7a, 0x6c, 0x36, 0x4e, 0x4c, + 0x72, 0x54, 0x51, 0x66, 0x76, 0x36, 0x4d, 0x6f, 0x6f, 0x71, 0x74, 0x79, + 0x75, 0x47, 0x43, 0x32, 0x6d, 0x44, 0x4f, 0x4c, 0x37, 0x4e, 0x69, 0x69, + 0x34, 0x4c, 0x63, 0x4b, 0x32, 0x4e, 0x0a, 0x4a, 0x70, 0x4c, 0x75, 0x48, + 0x76, 0x55, 0x42, 0x4b, 0x77, 0x72, 0x5a, 0x31, 0x70, 0x65, 0x62, 0x62, + 0x75, 0x43, 0x6f, 0x47, 0x52, 0x77, 0x36, 0x49, 0x59, 0x73, 0x4d, 0x48, + 0x6b, 0x43, 0x74, 0x41, 0x2b, 0x66, 0x64, 0x5a, 0x6e, 0x37, 0x31, 0x75, + 0x53, 0x41, 0x4e, 0x41, 0x2b, 0x69, 0x57, 0x2b, 0x59, 0x4a, 0x46, 0x31, + 0x44, 0x6e, 0x67, 0x6f, 0x41, 0x42, 0x64, 0x31, 0x35, 0x6a, 0x6d, 0x0a, + 0x66, 0x5a, 0x35, 0x6e, 0x63, 0x38, 0x4f, 0x61, 0x4b, 0x76, 0x65, 0x72, + 0x69, 0x36, 0x45, 0x36, 0x46, 0x4f, 0x38, 0x30, 0x76, 0x46, 0x49, 0x4f, + 0x69, 0x5a, 0x69, 0x61, 0x42, 0x45, 0x43, 0x45, 0x48, 0x58, 0x35, 0x46, + 0x61, 0x5a, 0x4e, 0x58, 0x7a, 0x75, 0x76, 0x4f, 0x2b, 0x46, 0x42, 0x38, + 0x54, 0x78, 0x78, 0x75, 0x42, 0x45, 0x4f, 0x62, 0x2b, 0x64, 0x59, 0x37, + 0x49, 0x78, 0x6a, 0x70, 0x0a, 0x36, 0x6f, 0x37, 0x52, 0x54, 0x55, 0x61, + 0x4e, 0x38, 0x54, 0x76, 0x6b, 0x61, 0x73, 0x71, 0x36, 0x2b, 0x79, 0x4f, + 0x33, 0x6d, 0x2f, 0x71, 0x5a, 0x41, 0x53, 0x6c, 0x61, 0x57, 0x46, 0x6f, + 0x74, 0x34, 0x2f, 0x6e, 0x55, 0x62, 0x51, 0x34, 0x6d, 0x72, 0x63, 0x46, + 0x75, 0x4e, 0x4c, 0x77, 0x79, 0x2b, 0x41, 0x77, 0x46, 0x2b, 0x6d, 0x57, + 0x6a, 0x32, 0x7a, 0x73, 0x33, 0x67, 0x79, 0x4c, 0x70, 0x0a, 0x31, 0x74, + 0x78, 0x79, 0x4d, 0x2f, 0x31, 0x64, 0x38, 0x69, 0x43, 0x39, 0x64, 0x6a, + 0x77, 0x6a, 0x32, 0x69, 0x6a, 0x33, 0x2b, 0x52, 0x76, 0x72, 0x57, 0x57, + 0x54, 0x56, 0x33, 0x46, 0x39, 0x79, 0x66, 0x69, 0x44, 0x38, 0x7a, 0x59, + 0x6d, 0x31, 0x6b, 0x47, 0x64, 0x4e, 0x59, 0x6e, 0x6f, 0x2f, 0x54, 0x71, + 0x30, 0x64, 0x77, 0x7a, 0x6e, 0x2b, 0x65, 0x76, 0x51, 0x6f, 0x46, 0x74, + 0x39, 0x42, 0x0a, 0x39, 0x6b, 0x69, 0x41, 0x42, 0x64, 0x63, 0x50, 0x55, + 0x58, 0x6d, 0x73, 0x45, 0x4b, 0x76, 0x55, 0x37, 0x41, 0x4e, 0x6d, 0x35, + 0x6d, 0x71, 0x77, 0x75, 0x6a, 0x47, 0x53, 0x51, 0x6b, 0x42, 0x71, 0x76, + 0x6a, 0x72, 0x54, 0x63, 0x75, 0x46, 0x71, 0x4e, 0x31, 0x57, 0x38, 0x72, + 0x42, 0x32, 0x56, 0x74, 0x32, 0x6c, 0x68, 0x38, 0x6b, 0x4f, 0x52, 0x64, + 0x4f, 0x61, 0x67, 0x30, 0x77, 0x6f, 0x6b, 0x0a, 0x52, 0x71, 0x45, 0x49, + 0x72, 0x39, 0x62, 0x61, 0x52, 0x52, 0x6d, 0x57, 0x31, 0x46, 0x4d, 0x64, + 0x57, 0x34, 0x52, 0x35, 0x38, 0x4d, 0x44, 0x33, 0x52, 0x2b, 0x2b, 0x4c, + 0x6a, 0x38, 0x55, 0x47, 0x72, 0x70, 0x31, 0x4d, 0x59, 0x70, 0x33, 0x2f, + 0x52, 0x67, 0x54, 0x34, 0x30, 0x38, 0x6d, 0x32, 0x45, 0x43, 0x56, 0x41, + 0x64, 0x66, 0x34, 0x57, 0x71, 0x73, 0x6c, 0x4b, 0x59, 0x49, 0x59, 0x76, + 0x0a, 0x75, 0x75, 0x38, 0x77, 0x64, 0x2b, 0x52, 0x55, 0x34, 0x72, 0x69, + 0x45, 0x6d, 0x56, 0x69, 0x41, 0x71, 0x68, 0x4f, 0x4c, 0x55, 0x54, 0x70, + 0x50, 0x53, 0x50, 0x61, 0x4c, 0x74, 0x72, 0x4d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x41, 0x6d, 0x61, + 0x7a, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x20, 0x4f, + 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x31, 0x22, 0x0a, + 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, + 0x33, 0x32, 0x36, 0x36, 0x39, 0x37, 0x38, 0x39, 0x31, 0x36, 0x36, 0x35, + 0x35, 0x38, 0x35, 0x36, 0x38, 0x37, 0x38, 0x30, 0x33, 0x34, 0x37, 0x31, + 0x32, 0x33, 0x31, 0x37, 0x32, 0x33, 0x30, 0x30, 0x35, 0x34, 0x35, 0x33, + 0x38, 0x33, 0x36, 0x39, 0x39, 0x39, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, + 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x34, 0x33, 0x3a, 0x63, 0x36, 0x3a, 0x62, 0x66, 0x3a, + 0x61, 0x65, 0x3a, 0x65, 0x63, 0x3a, 0x66, 0x65, 0x3a, 0x61, 0x64, 0x3a, + 0x32, 0x66, 0x3a, 0x31, 0x38, 0x3a, 0x63, 0x36, 0x3a, 0x38, 0x38, 0x3a, + 0x36, 0x38, 0x3a, 0x33, 0x30, 0x3a, 0x66, 0x63, 0x3a, 0x63, 0x38, 0x3a, + 0x65, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, + 0x64, 0x3a, 0x61, 0x37, 0x3a, 0x66, 0x39, 0x3a, 0x36, 0x35, 0x3a, 0x65, + 0x63, 0x3a, 0x35, 0x65, 0x3a, 0x66, 0x63, 0x3a, 0x33, 0x37, 0x3a, 0x39, + 0x31, 0x3a, 0x30, 0x66, 0x3a, 0x31, 0x63, 0x3a, 0x36, 0x65, 0x3a, 0x35, + 0x39, 0x3a, 0x66, 0x64, 0x3a, 0x63, 0x31, 0x3a, 0x63, 0x63, 0x3a, 0x36, + 0x61, 0x3a, 0x36, 0x65, 0x3a, 0x64, 0x65, 0x3a, 0x31, 0x36, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x65, 0x3a, + 0x63, 0x64, 0x3a, 0x65, 0x36, 0x3a, 0x38, 0x38, 0x3a, 0x34, 0x66, 0x3a, + 0x33, 0x64, 0x3a, 0x38, 0x37, 0x3a, 0x62, 0x31, 0x3a, 0x31, 0x32, 0x3a, + 0x35, 0x62, 0x3a, 0x61, 0x33, 0x3a, 0x31, 0x61, 0x3a, 0x63, 0x33, 0x3a, + 0x66, 0x63, 0x3a, 0x62, 0x31, 0x3a, 0x33, 0x64, 0x3a, 0x37, 0x30, 0x3a, + 0x31, 0x36, 0x3a, 0x64, 0x65, 0x3a, 0x37, 0x66, 0x3a, 0x35, 0x37, 0x3a, + 0x63, 0x63, 0x3a, 0x39, 0x30, 0x3a, 0x34, 0x66, 0x3a, 0x65, 0x31, 0x3a, + 0x63, 0x62, 0x3a, 0x39, 0x37, 0x3a, 0x63, 0x36, 0x3a, 0x61, 0x65, 0x3a, + 0x39, 0x38, 0x3a, 0x31, 0x39, 0x3a, 0x36, 0x65, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x51, 0x54, 0x43, 0x43, 0x41, 0x69, 0x6d, + 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x54, 0x42, 0x6d, 0x79, + 0x66, 0x7a, 0x35, 0x6d, 0x2f, 0x6a, 0x41, 0x6f, 0x35, 0x34, 0x76, 0x42, + 0x34, 0x69, 0x6b, 0x50, 0x6d, 0x6c, 0x6a, 0x5a, 0x62, 0x79, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x73, 0x46, 0x0a, 0x41, 0x44, 0x41, 0x35, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x68, 0x4d, 0x47, 0x51, 0x57, 0x31, 0x68, 0x65, 0x6d, + 0x39, 0x75, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x44, 0x45, 0x78, 0x42, 0x42, 0x62, 0x57, 0x46, 0x36, 0x0a, 0x62, + 0x32, 0x34, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, + 0x53, 0x41, 0x78, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x31, 0x4d, + 0x44, 0x55, 0x79, 0x4e, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, + 0x46, 0x6f, 0x58, 0x44, 0x54, 0x4d, 0x34, 0x4d, 0x44, 0x45, 0x78, 0x4e, + 0x7a, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x77, 0x4f, + 0x54, 0x45, 0x4c, 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x44, 0x7a, 0x41, 0x4e, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x42, 0x6b, 0x46, 0x74, + 0x59, 0x58, 0x70, 0x76, 0x62, 0x6a, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x51, 0x51, 0x57, 0x31, 0x68, + 0x65, 0x6d, 0x39, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x0a, 0x62, 0x33, 0x51, + 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x54, 0x43, 0x43, 0x41, 0x53, 0x49, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, + 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x51, 0x6f, 0x43, 0x67, 0x67, 0x45, + 0x42, 0x41, 0x4c, 0x4a, 0x34, 0x67, 0x48, 0x48, 0x4b, 0x65, 0x4e, 0x58, + 0x6a, 0x0a, 0x63, 0x61, 0x39, 0x48, 0x67, 0x46, 0x42, 0x30, 0x66, 0x57, + 0x37, 0x59, 0x31, 0x34, 0x68, 0x32, 0x39, 0x4a, 0x6c, 0x6f, 0x39, 0x31, + 0x67, 0x68, 0x59, 0x50, 0x6c, 0x30, 0x68, 0x41, 0x45, 0x76, 0x72, 0x41, + 0x49, 0x74, 0x68, 0x74, 0x4f, 0x67, 0x51, 0x33, 0x70, 0x4f, 0x73, 0x71, + 0x54, 0x51, 0x4e, 0x72, 0x6f, 0x42, 0x76, 0x6f, 0x33, 0x62, 0x53, 0x4d, + 0x67, 0x48, 0x46, 0x7a, 0x5a, 0x4d, 0x0a, 0x39, 0x4f, 0x36, 0x49, 0x49, + 0x38, 0x63, 0x2b, 0x36, 0x7a, 0x66, 0x31, 0x74, 0x52, 0x6e, 0x34, 0x53, + 0x57, 0x69, 0x77, 0x33, 0x74, 0x65, 0x35, 0x64, 0x6a, 0x67, 0x64, 0x59, + 0x5a, 0x36, 0x6b, 0x2f, 0x6f, 0x49, 0x32, 0x70, 0x65, 0x56, 0x4b, 0x56, + 0x75, 0x52, 0x46, 0x34, 0x66, 0x6e, 0x39, 0x74, 0x42, 0x62, 0x36, 0x64, + 0x4e, 0x71, 0x63, 0x6d, 0x7a, 0x55, 0x35, 0x4c, 0x2f, 0x71, 0x77, 0x0a, + 0x49, 0x46, 0x41, 0x47, 0x62, 0x48, 0x72, 0x51, 0x67, 0x4c, 0x4b, 0x6d, + 0x2b, 0x61, 0x2f, 0x73, 0x52, 0x78, 0x6d, 0x50, 0x55, 0x44, 0x67, 0x48, + 0x33, 0x4b, 0x4b, 0x48, 0x4f, 0x56, 0x6a, 0x34, 0x75, 0x74, 0x57, 0x70, + 0x2b, 0x55, 0x68, 0x6e, 0x4d, 0x4a, 0x62, 0x75, 0x6c, 0x48, 0x68, 0x65, + 0x62, 0x34, 0x6d, 0x6a, 0x55, 0x63, 0x41, 0x77, 0x68, 0x6d, 0x61, 0x68, + 0x52, 0x57, 0x61, 0x36, 0x0a, 0x56, 0x4f, 0x75, 0x6a, 0x77, 0x35, 0x48, + 0x35, 0x53, 0x4e, 0x7a, 0x2f, 0x30, 0x65, 0x67, 0x77, 0x4c, 0x58, 0x30, + 0x74, 0x64, 0x48, 0x41, 0x31, 0x31, 0x34, 0x67, 0x6b, 0x39, 0x35, 0x37, + 0x45, 0x57, 0x57, 0x36, 0x37, 0x63, 0x34, 0x63, 0x58, 0x38, 0x6a, 0x4a, + 0x47, 0x4b, 0x4c, 0x68, 0x44, 0x2b, 0x72, 0x63, 0x64, 0x71, 0x73, 0x71, + 0x30, 0x38, 0x70, 0x38, 0x6b, 0x44, 0x69, 0x31, 0x4c, 0x0a, 0x39, 0x33, + 0x46, 0x63, 0x58, 0x6d, 0x6e, 0x2f, 0x36, 0x70, 0x55, 0x43, 0x79, 0x7a, + 0x69, 0x4b, 0x72, 0x6c, 0x41, 0x34, 0x62, 0x39, 0x76, 0x37, 0x4c, 0x57, + 0x49, 0x62, 0x78, 0x63, 0x63, 0x65, 0x56, 0x4f, 0x46, 0x33, 0x34, 0x47, + 0x66, 0x49, 0x44, 0x35, 0x79, 0x48, 0x49, 0x39, 0x59, 0x2f, 0x51, 0x43, + 0x42, 0x2f, 0x49, 0x49, 0x44, 0x45, 0x67, 0x45, 0x77, 0x2b, 0x4f, 0x79, + 0x51, 0x6d, 0x0a, 0x6a, 0x67, 0x53, 0x75, 0x62, 0x4a, 0x72, 0x49, 0x71, + 0x67, 0x30, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, + 0x45, 0x41, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, + 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x0a, 0x41, 0x59, 0x59, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x49, 0x51, 0x59, 0x7a, 0x49, 0x55, 0x30, 0x37, 0x4c, 0x77, 0x4d, + 0x6c, 0x4a, 0x51, 0x75, 0x43, 0x46, 0x6d, 0x63, 0x78, 0x37, 0x49, 0x51, + 0x54, 0x67, 0x6f, 0x49, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, + 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, + 0x0a, 0x41, 0x34, 0x49, 0x42, 0x41, 0x51, 0x43, 0x59, 0x38, 0x6a, 0x64, + 0x61, 0x51, 0x5a, 0x43, 0x68, 0x47, 0x73, 0x56, 0x32, 0x55, 0x53, 0x67, + 0x67, 0x4e, 0x69, 0x4d, 0x4f, 0x72, 0x75, 0x59, 0x6f, 0x75, 0x36, 0x72, + 0x34, 0x6c, 0x4b, 0x35, 0x49, 0x70, 0x44, 0x42, 0x2f, 0x47, 0x2f, 0x77, + 0x6b, 0x6a, 0x55, 0x75, 0x30, 0x79, 0x4b, 0x47, 0x58, 0x39, 0x72, 0x62, + 0x78, 0x65, 0x6e, 0x44, 0x49, 0x0a, 0x55, 0x35, 0x50, 0x4d, 0x43, 0x43, + 0x6a, 0x6a, 0x6d, 0x43, 0x58, 0x50, 0x49, 0x36, 0x54, 0x35, 0x33, 0x69, + 0x48, 0x54, 0x66, 0x49, 0x55, 0x4a, 0x72, 0x55, 0x36, 0x61, 0x64, 0x54, + 0x72, 0x43, 0x43, 0x32, 0x71, 0x4a, 0x65, 0x48, 0x5a, 0x45, 0x52, 0x78, + 0x68, 0x6c, 0x62, 0x49, 0x31, 0x42, 0x6a, 0x6a, 0x74, 0x2f, 0x6d, 0x73, + 0x76, 0x30, 0x74, 0x61, 0x64, 0x51, 0x31, 0x77, 0x55, 0x73, 0x0a, 0x4e, + 0x2b, 0x67, 0x44, 0x53, 0x36, 0x33, 0x70, 0x59, 0x61, 0x41, 0x43, 0x62, + 0x76, 0x58, 0x79, 0x38, 0x4d, 0x57, 0x79, 0x37, 0x56, 0x75, 0x33, 0x33, + 0x50, 0x71, 0x55, 0x58, 0x48, 0x65, 0x65, 0x45, 0x36, 0x56, 0x2f, 0x55, + 0x71, 0x32, 0x56, 0x38, 0x76, 0x69, 0x54, 0x4f, 0x39, 0x36, 0x4c, 0x58, + 0x46, 0x76, 0x4b, 0x57, 0x6c, 0x4a, 0x62, 0x59, 0x4b, 0x38, 0x55, 0x39, + 0x30, 0x76, 0x76, 0x0a, 0x6f, 0x2f, 0x75, 0x66, 0x51, 0x4a, 0x56, 0x74, + 0x4d, 0x56, 0x54, 0x38, 0x51, 0x74, 0x50, 0x48, 0x52, 0x68, 0x38, 0x6a, + 0x72, 0x64, 0x6b, 0x50, 0x53, 0x48, 0x43, 0x61, 0x32, 0x58, 0x56, 0x34, + 0x63, 0x64, 0x46, 0x79, 0x51, 0x7a, 0x52, 0x31, 0x62, 0x6c, 0x64, 0x5a, + 0x77, 0x67, 0x4a, 0x63, 0x4a, 0x6d, 0x41, 0x70, 0x7a, 0x79, 0x4d, 0x5a, + 0x46, 0x6f, 0x36, 0x49, 0x51, 0x36, 0x58, 0x55, 0x0a, 0x35, 0x4d, 0x73, + 0x49, 0x2b, 0x79, 0x4d, 0x52, 0x51, 0x2b, 0x68, 0x44, 0x4b, 0x58, 0x4a, + 0x69, 0x6f, 0x61, 0x6c, 0x64, 0x58, 0x67, 0x6a, 0x55, 0x6b, 0x4b, 0x36, + 0x34, 0x32, 0x4d, 0x34, 0x55, 0x77, 0x74, 0x42, 0x56, 0x38, 0x6f, 0x62, + 0x32, 0x78, 0x4a, 0x4e, 0x44, 0x64, 0x32, 0x5a, 0x68, 0x77, 0x4c, 0x6e, + 0x6f, 0x51, 0x64, 0x65, 0x58, 0x65, 0x47, 0x41, 0x44, 0x62, 0x6b, 0x70, + 0x79, 0x0a, 0x72, 0x71, 0x58, 0x52, 0x66, 0x62, 0x6f, 0x51, 0x6e, 0x6f, + 0x5a, 0x73, 0x47, 0x34, 0x71, 0x35, 0x57, 0x54, 0x50, 0x34, 0x36, 0x38, + 0x53, 0x51, 0x76, 0x76, 0x47, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, + 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x41, 0x6d, + 0x61, 0x7a, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x33, 0x32, 0x36, + 0x36, 0x39, 0x38, 0x32, 0x38, 0x38, 0x35, 0x39, 0x36, 0x33, 0x35, 0x35, + 0x31, 0x38, 0x31, 0x38, 0x33, 0x34, 0x39, 0x31, 0x36, 0x30, 0x36, 0x35, + 0x38, 0x39, 0x32, 0x35, 0x30, 0x30, 0x36, 0x39, 0x37, 0x30, 0x36, 0x35, + 0x33, 0x32, 0x33, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x63, 0x38, 0x3a, 0x65, 0x35, 0x3a, 0x38, 0x64, 0x3a, 0x63, 0x65, 0x3a, + 0x61, 0x38, 0x3a, 0x34, 0x32, 0x3a, 0x65, 0x32, 0x3a, 0x37, 0x61, 0x3a, + 0x63, 0x30, 0x3a, 0x32, 0x61, 0x3a, 0x35, 0x63, 0x3a, 0x37, 0x63, 0x3a, + 0x39, 0x65, 0x3a, 0x32, 0x36, 0x3a, 0x62, 0x66, 0x3a, 0x36, 0x36, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x61, 0x3a, 0x38, + 0x63, 0x3a, 0x65, 0x66, 0x3a, 0x34, 0x35, 0x3a, 0x64, 0x37, 0x3a, 0x61, + 0x36, 0x3a, 0x39, 0x38, 0x3a, 0x35, 0x39, 0x3a, 0x37, 0x36, 0x3a, 0x37, + 0x61, 0x3a, 0x38, 0x63, 0x3a, 0x38, 0x62, 0x3a, 0x34, 0x34, 0x3a, 0x39, + 0x36, 0x3a, 0x62, 0x35, 0x3a, 0x37, 0x38, 0x3a, 0x63, 0x66, 0x3a, 0x34, + 0x37, 0x3a, 0x34, 0x62, 0x3a, 0x31, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x62, 0x3a, 0x61, 0x35, 0x3a, + 0x62, 0x32, 0x3a, 0x61, 0x61, 0x3a, 0x38, 0x63, 0x3a, 0x36, 0x35, 0x3a, + 0x34, 0x30, 0x3a, 0x31, 0x61, 0x3a, 0x38, 0x32, 0x3a, 0x39, 0x36, 0x3a, + 0x30, 0x31, 0x3a, 0x31, 0x38, 0x3a, 0x66, 0x38, 0x3a, 0x30, 0x62, 0x3a, + 0x65, 0x63, 0x3a, 0x34, 0x66, 0x3a, 0x36, 0x32, 0x3a, 0x33, 0x30, 0x3a, + 0x34, 0x64, 0x3a, 0x38, 0x33, 0x3a, 0x63, 0x65, 0x3a, 0x63, 0x34, 0x3a, + 0x37, 0x31, 0x3a, 0x33, 0x61, 0x3a, 0x31, 0x39, 0x3a, 0x63, 0x33, 0x3a, + 0x39, 0x63, 0x3a, 0x30, 0x31, 0x3a, 0x31, 0x65, 0x3a, 0x61, 0x34, 0x3a, + 0x36, 0x64, 0x3a, 0x62, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x46, 0x51, 0x54, 0x43, 0x43, 0x41, 0x79, 0x6d, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x54, 0x42, 0x6d, 0x79, 0x66, 0x30, 0x70, + 0x59, 0x31, 0x68, 0x70, 0x38, 0x4b, 0x44, 0x2b, 0x57, 0x47, 0x65, 0x50, + 0x68, 0x62, 0x4a, 0x72, 0x75, 0x4b, 0x4e, 0x7a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x77, 0x46, 0x0a, 0x41, 0x44, 0x41, 0x35, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, + 0x7a, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x47, 0x51, 0x57, 0x31, 0x68, 0x65, 0x6d, 0x39, 0x75, 0x4d, + 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, + 0x78, 0x42, 0x42, 0x62, 0x57, 0x46, 0x36, 0x0a, 0x62, 0x32, 0x34, 0x67, + 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x79, + 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x31, 0x4d, 0x44, 0x55, 0x79, + 0x4e, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, + 0x44, 0x54, 0x51, 0x77, 0x4d, 0x44, 0x55, 0x79, 0x4e, 0x6a, 0x41, 0x77, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x77, 0x4f, 0x54, 0x45, 0x4c, + 0x0a, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, + 0x43, 0x56, 0x56, 0x4d, 0x78, 0x44, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x54, 0x42, 0x6b, 0x46, 0x74, 0x59, 0x58, 0x70, + 0x76, 0x62, 0x6a, 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x41, 0x78, 0x4d, 0x51, 0x51, 0x57, 0x31, 0x68, 0x65, 0x6d, 0x39, + 0x75, 0x49, 0x46, 0x4a, 0x76, 0x0a, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, + 0x45, 0x67, 0x4d, 0x6a, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, + 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4b, + 0x32, 0x57, 0x6e, 0x79, 0x32, 0x63, 0x53, 0x6b, 0x78, 0x4b, 0x0a, 0x67, + 0x58, 0x6c, 0x52, 0x6d, 0x65, 0x79, 0x4b, 0x79, 0x32, 0x74, 0x67, 0x55, + 0x52, 0x4f, 0x38, 0x54, 0x57, 0x30, 0x47, 0x2f, 0x4c, 0x41, 0x49, 0x6a, + 0x64, 0x30, 0x5a, 0x45, 0x47, 0x72, 0x48, 0x4a, 0x67, 0x77, 0x31, 0x32, + 0x4d, 0x42, 0x76, 0x49, 0x49, 0x54, 0x70, 0x6c, 0x4c, 0x47, 0x62, 0x68, + 0x51, 0x50, 0x44, 0x57, 0x39, 0x74, 0x4b, 0x36, 0x4d, 0x6a, 0x34, 0x6b, + 0x48, 0x62, 0x5a, 0x0a, 0x57, 0x30, 0x2f, 0x6a, 0x54, 0x4f, 0x67, 0x47, + 0x4e, 0x6b, 0x33, 0x4d, 0x6d, 0x71, 0x77, 0x39, 0x44, 0x4a, 0x41, 0x72, + 0x6b, 0x74, 0x51, 0x47, 0x47, 0x57, 0x43, 0x73, 0x4e, 0x30, 0x52, 0x35, + 0x68, 0x59, 0x47, 0x43, 0x72, 0x56, 0x6f, 0x33, 0x34, 0x41, 0x33, 0x4d, + 0x6e, 0x61, 0x5a, 0x4d, 0x55, 0x6e, 0x62, 0x71, 0x51, 0x35, 0x32, 0x33, + 0x42, 0x4e, 0x46, 0x51, 0x39, 0x6c, 0x58, 0x67, 0x0a, 0x31, 0x64, 0x4b, + 0x6d, 0x53, 0x59, 0x58, 0x70, 0x4e, 0x2b, 0x6e, 0x4b, 0x66, 0x71, 0x35, + 0x63, 0x6c, 0x55, 0x31, 0x49, 0x6d, 0x6a, 0x2b, 0x75, 0x49, 0x46, 0x70, + 0x74, 0x69, 0x4a, 0x58, 0x5a, 0x4e, 0x4c, 0x68, 0x53, 0x47, 0x6b, 0x4f, + 0x51, 0x73, 0x4c, 0x39, 0x73, 0x42, 0x62, 0x6d, 0x32, 0x65, 0x4c, 0x66, + 0x71, 0x30, 0x4f, 0x51, 0x36, 0x50, 0x42, 0x4a, 0x54, 0x59, 0x76, 0x39, + 0x4b, 0x0a, 0x38, 0x6e, 0x75, 0x2b, 0x4e, 0x51, 0x57, 0x70, 0x45, 0x6a, + 0x54, 0x6a, 0x38, 0x32, 0x52, 0x30, 0x59, 0x69, 0x77, 0x39, 0x41, 0x45, + 0x6c, 0x61, 0x4b, 0x50, 0x34, 0x79, 0x52, 0x4c, 0x75, 0x48, 0x33, 0x57, + 0x55, 0x6e, 0x41, 0x6e, 0x45, 0x37, 0x32, 0x6b, 0x72, 0x33, 0x48, 0x39, + 0x72, 0x4e, 0x39, 0x79, 0x46, 0x56, 0x6b, 0x45, 0x38, 0x50, 0x37, 0x4b, + 0x36, 0x43, 0x34, 0x5a, 0x39, 0x72, 0x0a, 0x32, 0x55, 0x58, 0x54, 0x75, + 0x2f, 0x42, 0x66, 0x68, 0x2b, 0x30, 0x38, 0x4c, 0x44, 0x6d, 0x47, 0x32, + 0x6a, 0x2f, 0x65, 0x37, 0x48, 0x4a, 0x56, 0x36, 0x33, 0x6d, 0x6a, 0x72, + 0x64, 0x76, 0x64, 0x66, 0x4c, 0x43, 0x36, 0x48, 0x4d, 0x37, 0x38, 0x33, + 0x6b, 0x38, 0x31, 0x64, 0x73, 0x38, 0x50, 0x2b, 0x48, 0x67, 0x66, 0x61, + 0x6a, 0x5a, 0x52, 0x52, 0x69, 0x64, 0x68, 0x57, 0x2b, 0x6d, 0x65, 0x0a, + 0x7a, 0x2f, 0x43, 0x69, 0x56, 0x58, 0x31, 0x38, 0x4a, 0x59, 0x70, 0x76, + 0x4c, 0x37, 0x54, 0x46, 0x7a, 0x34, 0x51, 0x75, 0x4b, 0x2f, 0x30, 0x4e, + 0x55, 0x52, 0x42, 0x73, 0x2b, 0x31, 0x38, 0x62, 0x76, 0x42, 0x74, 0x2b, + 0x78, 0x61, 0x34, 0x37, 0x6d, 0x41, 0x45, 0x78, 0x6b, 0x76, 0x38, 0x4c, + 0x56, 0x2f, 0x53, 0x61, 0x73, 0x72, 0x6c, 0x58, 0x36, 0x61, 0x76, 0x76, + 0x44, 0x58, 0x62, 0x52, 0x0a, 0x38, 0x4f, 0x37, 0x30, 0x7a, 0x6f, 0x61, + 0x6e, 0x34, 0x47, 0x37, 0x70, 0x74, 0x47, 0x6d, 0x68, 0x33, 0x32, 0x6e, + 0x32, 0x4d, 0x38, 0x5a, 0x70, 0x4c, 0x70, 0x63, 0x54, 0x6e, 0x71, 0x57, + 0x48, 0x73, 0x46, 0x63, 0x51, 0x67, 0x54, 0x66, 0x4a, 0x55, 0x37, 0x4f, + 0x37, 0x66, 0x2f, 0x61, 0x53, 0x30, 0x5a, 0x7a, 0x51, 0x47, 0x50, 0x53, + 0x53, 0x62, 0x74, 0x71, 0x44, 0x54, 0x36, 0x5a, 0x6a, 0x0a, 0x6d, 0x55, + 0x79, 0x6c, 0x2b, 0x31, 0x37, 0x76, 0x49, 0x57, 0x52, 0x36, 0x49, 0x46, + 0x39, 0x73, 0x5a, 0x49, 0x55, 0x56, 0x79, 0x7a, 0x66, 0x70, 0x59, 0x67, + 0x77, 0x4c, 0x4b, 0x68, 0x62, 0x63, 0x41, 0x53, 0x34, 0x79, 0x32, 0x6a, + 0x35, 0x4c, 0x39, 0x5a, 0x34, 0x36, 0x39, 0x68, 0x64, 0x41, 0x6c, 0x4f, + 0x2b, 0x65, 0x6b, 0x51, 0x69, 0x47, 0x2b, 0x72, 0x35, 0x6a, 0x71, 0x46, + 0x6f, 0x7a, 0x0a, 0x37, 0x4d, 0x74, 0x30, 0x51, 0x35, 0x58, 0x35, 0x62, + 0x47, 0x6c, 0x53, 0x4e, 0x73, 0x63, 0x70, 0x62, 0x2f, 0x78, 0x56, 0x41, + 0x31, 0x77, 0x66, 0x2b, 0x35, 0x2b, 0x39, 0x52, 0x2b, 0x76, 0x6e, 0x53, + 0x55, 0x65, 0x56, 0x43, 0x30, 0x36, 0x4a, 0x49, 0x67, 0x6c, 0x4a, 0x34, + 0x50, 0x56, 0x68, 0x48, 0x76, 0x47, 0x2f, 0x4c, 0x6f, 0x70, 0x79, 0x62, + 0x6f, 0x42, 0x5a, 0x2f, 0x31, 0x63, 0x36, 0x0a, 0x2b, 0x58, 0x55, 0x79, + 0x6f, 0x30, 0x35, 0x66, 0x37, 0x4f, 0x30, 0x6f, 0x59, 0x74, 0x6c, 0x4e, + 0x63, 0x2f, 0x4c, 0x4d, 0x67, 0x52, 0x64, 0x67, 0x37, 0x63, 0x33, 0x72, + 0x33, 0x4e, 0x75, 0x6e, 0x79, 0x73, 0x56, 0x2b, 0x41, 0x72, 0x33, 0x79, + 0x56, 0x41, 0x68, 0x55, 0x2f, 0x62, 0x51, 0x74, 0x43, 0x53, 0x77, 0x58, + 0x56, 0x45, 0x71, 0x59, 0x30, 0x56, 0x54, 0x68, 0x55, 0x57, 0x63, 0x49, + 0x0a, 0x30, 0x75, 0x31, 0x75, 0x66, 0x6d, 0x38, 0x2f, 0x30, 0x69, 0x32, + 0x42, 0x57, 0x53, 0x6c, 0x6d, 0x79, 0x35, 0x41, 0x35, 0x6c, 0x52, 0x45, + 0x65, 0x64, 0x43, 0x66, 0x2b, 0x33, 0x65, 0x75, 0x76, 0x41, 0x67, 0x4d, + 0x42, 0x41, 0x41, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x0a, 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, + 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x53, 0x77, 0x44, 0x50, + 0x42, 0x4d, 0x4d, 0x50, 0x51, 0x46, 0x57, 0x41, 0x4a, 0x49, 0x2f, 0x54, + 0x50, 0x6c, 0x55, 0x71, 0x39, 0x4c, 0x68, 0x4f, 0x4e, 0x6d, 0x0a, 0x55, + 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, + 0x77, 0x30, 0x42, 0x41, 0x51, 0x77, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, + 0x67, 0x45, 0x41, 0x71, 0x71, 0x69, 0x41, 0x6a, 0x77, 0x35, 0x34, 0x6f, + 0x2b, 0x43, 0x69, 0x31, 0x4d, 0x33, 0x6d, 0x39, 0x5a, 0x68, 0x36, 0x4f, + 0x2b, 0x6f, 0x41, 0x41, 0x37, 0x43, 0x58, 0x44, 0x70, 0x4f, 0x38, 0x57, + 0x71, 0x6a, 0x32, 0x0a, 0x4c, 0x49, 0x78, 0x79, 0x68, 0x36, 0x6d, 0x78, + 0x2f, 0x48, 0x39, 0x7a, 0x2f, 0x57, 0x4e, 0x78, 0x65, 0x4b, 0x57, 0x48, + 0x57, 0x63, 0x38, 0x77, 0x34, 0x51, 0x30, 0x51, 0x73, 0x68, 0x4e, 0x61, + 0x62, 0x59, 0x4c, 0x31, 0x61, 0x75, 0x61, 0x41, 0x6e, 0x36, 0x41, 0x46, + 0x43, 0x32, 0x6a, 0x6b, 0x52, 0x32, 0x76, 0x48, 0x61, 0x74, 0x2b, 0x32, + 0x2f, 0x58, 0x63, 0x79, 0x63, 0x75, 0x55, 0x59, 0x0a, 0x2b, 0x67, 0x6e, + 0x30, 0x6f, 0x4a, 0x4d, 0x73, 0x58, 0x64, 0x4b, 0x4d, 0x64, 0x59, 0x56, + 0x32, 0x5a, 0x5a, 0x41, 0x4d, 0x41, 0x33, 0x6d, 0x33, 0x4d, 0x53, 0x4e, + 0x6a, 0x72, 0x58, 0x69, 0x44, 0x43, 0x59, 0x5a, 0x6f, 0x68, 0x4d, 0x72, + 0x2f, 0x2b, 0x63, 0x38, 0x6d, 0x6d, 0x70, 0x4a, 0x35, 0x35, 0x38, 0x31, + 0x4c, 0x78, 0x65, 0x64, 0x68, 0x70, 0x78, 0x66, 0x4c, 0x38, 0x36, 0x6b, + 0x53, 0x0a, 0x6b, 0x35, 0x4e, 0x72, 0x70, 0x2b, 0x67, 0x76, 0x55, 0x35, + 0x4c, 0x45, 0x59, 0x46, 0x69, 0x77, 0x7a, 0x41, 0x4a, 0x52, 0x47, 0x46, + 0x75, 0x46, 0x6a, 0x57, 0x4a, 0x5a, 0x59, 0x37, 0x61, 0x74, 0x74, 0x4e, + 0x36, 0x61, 0x2b, 0x79, 0x62, 0x33, 0x41, 0x43, 0x66, 0x41, 0x58, 0x56, + 0x55, 0x33, 0x64, 0x4a, 0x6e, 0x4a, 0x55, 0x48, 0x2f, 0x6a, 0x57, 0x53, + 0x35, 0x45, 0x34, 0x79, 0x77, 0x6c, 0x0a, 0x37, 0x75, 0x78, 0x4d, 0x4d, + 0x6e, 0x65, 0x30, 0x6e, 0x78, 0x72, 0x70, 0x53, 0x31, 0x30, 0x67, 0x78, + 0x64, 0x72, 0x39, 0x48, 0x49, 0x63, 0x57, 0x78, 0x6b, 0x50, 0x6f, 0x31, + 0x4c, 0x73, 0x6d, 0x6d, 0x6b, 0x56, 0x77, 0x58, 0x71, 0x6b, 0x4c, 0x4e, + 0x31, 0x50, 0x69, 0x52, 0x6e, 0x73, 0x6e, 0x2f, 0x65, 0x42, 0x47, 0x38, + 0x6f, 0x6d, 0x33, 0x7a, 0x45, 0x4b, 0x32, 0x79, 0x79, 0x67, 0x6d, 0x0a, + 0x62, 0x74, 0x6d, 0x6c, 0x79, 0x54, 0x72, 0x49, 0x51, 0x52, 0x4e, 0x67, + 0x39, 0x31, 0x43, 0x4d, 0x46, 0x61, 0x36, 0x79, 0x62, 0x52, 0x6f, 0x56, + 0x47, 0x6c, 0x64, 0x34, 0x35, 0x70, 0x49, 0x71, 0x32, 0x57, 0x57, 0x51, + 0x67, 0x6a, 0x39, 0x73, 0x41, 0x71, 0x2b, 0x75, 0x45, 0x6a, 0x6f, 0x6e, + 0x6c, 0x6a, 0x59, 0x45, 0x31, 0x78, 0x32, 0x69, 0x67, 0x47, 0x4f, 0x70, + 0x6d, 0x2f, 0x48, 0x6c, 0x0a, 0x75, 0x72, 0x52, 0x38, 0x46, 0x4c, 0x42, + 0x4f, 0x79, 0x62, 0x45, 0x66, 0x64, 0x46, 0x38, 0x34, 0x39, 0x6c, 0x48, + 0x71, 0x6d, 0x2f, 0x6f, 0x73, 0x6f, 0x68, 0x48, 0x55, 0x71, 0x53, 0x30, + 0x6e, 0x47, 0x6b, 0x57, 0x78, 0x72, 0x37, 0x4a, 0x4f, 0x63, 0x51, 0x33, + 0x41, 0x57, 0x45, 0x62, 0x57, 0x61, 0x51, 0x62, 0x4c, 0x55, 0x38, 0x75, + 0x7a, 0x2f, 0x6d, 0x74, 0x42, 0x7a, 0x55, 0x46, 0x2b, 0x0a, 0x66, 0x55, + 0x77, 0x50, 0x66, 0x48, 0x4a, 0x35, 0x65, 0x6c, 0x6e, 0x4e, 0x58, 0x6b, + 0x6f, 0x4f, 0x72, 0x4a, 0x75, 0x70, 0x6d, 0x48, 0x4e, 0x35, 0x66, 0x4c, + 0x54, 0x30, 0x7a, 0x4c, 0x6d, 0x34, 0x42, 0x77, 0x79, 0x79, 0x64, 0x46, + 0x79, 0x34, 0x78, 0x32, 0x2b, 0x49, 0x6f, 0x5a, 0x43, 0x6e, 0x39, 0x4b, + 0x72, 0x35, 0x76, 0x32, 0x63, 0x36, 0x39, 0x42, 0x6f, 0x56, 0x59, 0x68, + 0x36, 0x33, 0x0a, 0x6e, 0x37, 0x34, 0x39, 0x73, 0x53, 0x6d, 0x76, 0x5a, + 0x36, 0x45, 0x53, 0x38, 0x6c, 0x67, 0x51, 0x47, 0x56, 0x4d, 0x44, 0x4d, + 0x42, 0x75, 0x34, 0x47, 0x6f, 0x6e, 0x32, 0x6e, 0x4c, 0x32, 0x58, 0x41, + 0x34, 0x36, 0x6a, 0x43, 0x66, 0x4d, 0x64, 0x69, 0x79, 0x48, 0x78, 0x74, + 0x4e, 0x2f, 0x6b, 0x48, 0x4e, 0x47, 0x66, 0x5a, 0x51, 0x49, 0x47, 0x36, + 0x6c, 0x7a, 0x57, 0x45, 0x37, 0x4f, 0x45, 0x0a, 0x37, 0x36, 0x4b, 0x6c, + 0x58, 0x49, 0x78, 0x33, 0x4b, 0x61, 0x64, 0x6f, 0x77, 0x47, 0x75, 0x75, + 0x51, 0x4e, 0x4b, 0x6f, 0x74, 0x4f, 0x72, 0x4e, 0x38, 0x49, 0x31, 0x4c, + 0x4f, 0x4a, 0x77, 0x5a, 0x6d, 0x68, 0x73, 0x6f, 0x56, 0x4c, 0x69, 0x4a, + 0x6b, 0x4f, 0x2f, 0x4b, 0x64, 0x59, 0x45, 0x2b, 0x48, 0x76, 0x4a, 0x6b, + 0x4a, 0x4d, 0x63, 0x59, 0x72, 0x30, 0x37, 0x2f, 0x52, 0x35, 0x34, 0x48, + 0x0a, 0x39, 0x6a, 0x56, 0x6c, 0x70, 0x4e, 0x4d, 0x4b, 0x56, 0x76, 0x2f, + 0x31, 0x46, 0x32, 0x52, 0x73, 0x37, 0x36, 0x67, 0x69, 0x4a, 0x55, 0x6d, + 0x54, 0x74, 0x74, 0x38, 0x41, 0x46, 0x39, 0x70, 0x59, 0x66, 0x6c, 0x33, + 0x75, 0x78, 0x52, 0x75, 0x77, 0x30, 0x64, 0x46, 0x66, 0x49, 0x52, 0x44, + 0x48, 0x2b, 0x66, 0x4f, 0x36, 0x41, 0x67, 0x6f, 0x6e, 0x42, 0x38, 0x58, + 0x78, 0x31, 0x73, 0x66, 0x54, 0x0a, 0x34, 0x50, 0x73, 0x4a, 0x59, 0x47, + 0x77, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, + 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, + 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33, 0x20, + 0x4f, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x41, + 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x33, 0x20, 0x4f, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x41, + 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x33, 0x32, 0x36, 0x36, 0x39, 0x38, 0x36, + 0x36, 0x39, 0x39, 0x30, 0x39, 0x30, 0x37, 0x36, 0x36, 0x32, 0x39, 0x34, + 0x37, 0x30, 0x30, 0x36, 0x33, 0x35, 0x33, 0x38, 0x31, 0x32, 0x33, 0x30, + 0x39, 0x33, 0x34, 0x37, 0x38, 0x38, 0x36, 0x36, 0x35, 0x39, 0x33, 0x30, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x30, 0x3a, 0x64, + 0x34, 0x3a, 0x65, 0x66, 0x3a, 0x30, 0x62, 0x3a, 0x66, 0x37, 0x3a, 0x62, + 0x35, 0x3a, 0x64, 0x38, 0x3a, 0x34, 0x39, 0x3a, 0x39, 0x35, 0x3a, 0x32, + 0x61, 0x3a, 0x65, 0x63, 0x3a, 0x66, 0x35, 0x3a, 0x63, 0x34, 0x3a, 0x66, + 0x63, 0x3a, 0x38, 0x31, 0x3a, 0x38, 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x64, 0x3a, 0x34, 0x34, 0x3a, 0x64, 0x64, + 0x3a, 0x38, 0x63, 0x3a, 0x33, 0x63, 0x3a, 0x38, 0x63, 0x3a, 0x31, 0x61, + 0x3a, 0x31, 0x61, 0x3a, 0x35, 0x38, 0x3a, 0x37, 0x35, 0x3a, 0x36, 0x34, + 0x3a, 0x38, 0x31, 0x3a, 0x65, 0x39, 0x3a, 0x30, 0x66, 0x3a, 0x32, 0x65, + 0x3a, 0x32, 0x61, 0x3a, 0x66, 0x66, 0x3a, 0x62, 0x33, 0x3a, 0x64, 0x32, + 0x3a, 0x36, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x31, 0x38, 0x3a, 0x63, 0x65, 0x3a, 0x36, 0x63, 0x3a, 0x66, + 0x65, 0x3a, 0x37, 0x62, 0x3a, 0x66, 0x31, 0x3a, 0x34, 0x65, 0x3a, 0x36, + 0x30, 0x3a, 0x62, 0x32, 0x3a, 0x65, 0x33, 0x3a, 0x34, 0x37, 0x3a, 0x62, + 0x38, 0x3a, 0x64, 0x66, 0x3a, 0x65, 0x38, 0x3a, 0x36, 0x38, 0x3a, 0x63, + 0x62, 0x3a, 0x33, 0x31, 0x3a, 0x64, 0x30, 0x3a, 0x32, 0x65, 0x3a, 0x62, + 0x62, 0x3a, 0x33, 0x61, 0x3a, 0x64, 0x61, 0x3a, 0x32, 0x37, 0x3a, 0x31, + 0x35, 0x3a, 0x36, 0x39, 0x3a, 0x66, 0x35, 0x3a, 0x30, 0x33, 0x3a, 0x34, + 0x33, 0x3a, 0x62, 0x34, 0x3a, 0x36, 0x64, 0x3a, 0x62, 0x33, 0x3a, 0x61, + 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x42, 0x74, 0x6a, + 0x43, 0x43, 0x41, 0x56, 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x54, 0x42, 0x6d, 0x79, 0x66, 0x31, 0x58, 0x53, 0x58, 0x4e, 0x6d, + 0x59, 0x2f, 0x4f, 0x77, 0x75, 0x61, 0x32, 0x65, 0x69, 0x65, 0x64, 0x67, + 0x50, 0x79, 0x53, 0x6a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, + 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x6a, 0x41, 0x35, 0x0a, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x47, 0x51, 0x57, 0x31, 0x68, 0x65, + 0x6d, 0x39, 0x75, 0x4d, 0x52, 0x6b, 0x77, 0x46, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x44, 0x45, 0x78, 0x42, 0x42, 0x62, 0x57, 0x46, 0x36, 0x62, + 0x32, 0x34, 0x67, 0x0a, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x51, 0x53, 0x41, 0x7a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x31, + 0x4d, 0x44, 0x55, 0x79, 0x4e, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, + 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x51, 0x77, 0x4d, 0x44, 0x55, 0x79, + 0x4e, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x77, + 0x4f, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x44, 0x7a, 0x41, + 0x4e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x42, 0x6b, 0x46, + 0x74, 0x59, 0x58, 0x70, 0x76, 0x62, 0x6a, 0x45, 0x5a, 0x4d, 0x42, 0x63, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x51, 0x51, 0x57, 0x31, + 0x68, 0x65, 0x6d, 0x39, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, + 0x67, 0x0a, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x7a, 0x42, 0x5a, 0x4d, 0x42, + 0x4d, 0x47, 0x42, 0x79, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x67, + 0x45, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x77, + 0x45, 0x48, 0x41, 0x30, 0x49, 0x41, 0x42, 0x43, 0x6d, 0x58, 0x70, 0x38, + 0x5a, 0x42, 0x66, 0x38, 0x41, 0x4e, 0x6d, 0x2b, 0x67, 0x42, 0x47, 0x31, + 0x62, 0x47, 0x38, 0x6c, 0x4b, 0x6c, 0x0a, 0x75, 0x69, 0x32, 0x79, 0x45, + 0x75, 0x6a, 0x53, 0x4c, 0x74, 0x66, 0x36, 0x79, 0x63, 0x58, 0x59, 0x71, + 0x6d, 0x30, 0x66, 0x63, 0x34, 0x45, 0x37, 0x4f, 0x35, 0x68, 0x72, 0x4f, + 0x58, 0x77, 0x7a, 0x70, 0x63, 0x56, 0x4f, 0x68, 0x6f, 0x36, 0x41, 0x46, + 0x32, 0x68, 0x69, 0x52, 0x56, 0x64, 0x39, 0x52, 0x46, 0x67, 0x64, 0x73, + 0x7a, 0x66, 0x6c, 0x5a, 0x77, 0x6a, 0x72, 0x5a, 0x74, 0x36, 0x6a, 0x0a, + 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, + 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, + 0x41, 0x66, 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, + 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, + 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, + 0x42, 0x42, 0x53, 0x72, 0x0a, 0x74, 0x74, 0x76, 0x58, 0x42, 0x70, 0x34, + 0x33, 0x72, 0x44, 0x43, 0x47, 0x42, 0x35, 0x46, 0x77, 0x78, 0x35, 0x7a, + 0x45, 0x47, 0x62, 0x46, 0x34, 0x77, 0x44, 0x41, 0x4b, 0x42, 0x67, 0x67, + 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x67, 0x4e, + 0x4a, 0x41, 0x44, 0x42, 0x47, 0x41, 0x69, 0x45, 0x41, 0x34, 0x49, 0x57, + 0x53, 0x6f, 0x78, 0x65, 0x33, 0x6a, 0x66, 0x6b, 0x72, 0x0a, 0x42, 0x71, + 0x57, 0x54, 0x72, 0x42, 0x71, 0x59, 0x61, 0x47, 0x46, 0x79, 0x2b, 0x75, + 0x47, 0x68, 0x30, 0x50, 0x73, 0x63, 0x65, 0x47, 0x43, 0x6d, 0x51, 0x35, + 0x6e, 0x46, 0x75, 0x4d, 0x51, 0x43, 0x49, 0x51, 0x43, 0x63, 0x41, 0x75, + 0x2f, 0x78, 0x6c, 0x4a, 0x79, 0x7a, 0x6c, 0x76, 0x6e, 0x72, 0x78, 0x69, + 0x72, 0x34, 0x74, 0x69, 0x7a, 0x2b, 0x4f, 0x70, 0x41, 0x55, 0x46, 0x74, + 0x65, 0x4d, 0x0a, 0x59, 0x79, 0x52, 0x49, 0x48, 0x4e, 0x38, 0x77, 0x66, + 0x64, 0x56, 0x6f, 0x4f, 0x77, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x34, 0x20, 0x4f, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, + 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x34, 0x20, 0x4f, 0x3d, 0x41, + 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x41, 0x6d, 0x61, 0x7a, 0x6f, 0x6e, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x34, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x33, 0x32, + 0x36, 0x36, 0x39, 0x38, 0x39, 0x37, 0x35, 0x38, 0x30, 0x38, 0x30, 0x37, + 0x36, 0x33, 0x39, 0x37, 0x34, 0x31, 0x30, 0x35, 0x32, 0x30, 0x30, 0x36, + 0x33, 0x30, 0x37, 0x36, 0x33, 0x38, 0x37, 0x37, 0x38, 0x34, 0x39, 0x32, + 0x38, 0x34, 0x38, 0x37, 0x38, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x38, 0x39, 0x3a, 0x62, 0x63, 0x3a, 0x32, 0x37, 0x3a, 0x64, 0x35, + 0x3a, 0x65, 0x62, 0x3a, 0x31, 0x37, 0x3a, 0x38, 0x64, 0x3a, 0x30, 0x36, + 0x3a, 0x36, 0x61, 0x3a, 0x36, 0x39, 0x3a, 0x64, 0x35, 0x3a, 0x66, 0x64, + 0x3a, 0x38, 0x39, 0x3a, 0x34, 0x37, 0x3a, 0x62, 0x34, 0x3a, 0x63, 0x64, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x36, 0x3a, + 0x31, 0x30, 0x3a, 0x38, 0x34, 0x3a, 0x30, 0x37, 0x3a, 0x64, 0x36, 0x3a, + 0x66, 0x38, 0x3a, 0x62, 0x62, 0x3a, 0x36, 0x37, 0x3a, 0x39, 0x38, 0x3a, + 0x30, 0x63, 0x3a, 0x63, 0x32, 0x3a, 0x65, 0x32, 0x3a, 0x34, 0x34, 0x3a, + 0x63, 0x32, 0x3a, 0x65, 0x62, 0x3a, 0x61, 0x65, 0x3a, 0x31, 0x63, 0x3a, + 0x65, 0x66, 0x3a, 0x36, 0x33, 0x3a, 0x62, 0x65, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x33, 0x3a, 0x35, 0x64, + 0x3a, 0x32, 0x38, 0x3a, 0x34, 0x31, 0x3a, 0x39, 0x65, 0x3a, 0x64, 0x30, + 0x3a, 0x32, 0x30, 0x3a, 0x32, 0x35, 0x3a, 0x63, 0x66, 0x3a, 0x61, 0x36, + 0x3a, 0x39, 0x30, 0x3a, 0x33, 0x38, 0x3a, 0x63, 0x64, 0x3a, 0x36, 0x32, + 0x3a, 0x33, 0x39, 0x3a, 0x36, 0x32, 0x3a, 0x34, 0x35, 0x3a, 0x38, 0x64, + 0x3a, 0x61, 0x35, 0x3a, 0x63, 0x36, 0x3a, 0x39, 0x35, 0x3a, 0x66, 0x62, + 0x3a, 0x64, 0x65, 0x3a, 0x61, 0x33, 0x3a, 0x63, 0x32, 0x3a, 0x32, 0x62, + 0x3a, 0x30, 0x62, 0x3a, 0x66, 0x62, 0x3a, 0x32, 0x35, 0x3a, 0x38, 0x39, + 0x3a, 0x37, 0x30, 0x3a, 0x39, 0x32, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x42, 0x38, 0x6a, 0x43, 0x43, 0x41, 0x58, 0x69, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x54, 0x42, 0x6d, 0x79, 0x66, 0x31, + 0x38, 0x47, 0x37, 0x45, 0x45, 0x77, 0x70, 0x51, 0x2b, 0x56, 0x78, 0x65, + 0x33, 0x73, 0x73, 0x79, 0x42, 0x72, 0x42, 0x44, 0x6a, 0x41, 0x4b, 0x42, + 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, + 0x7a, 0x41, 0x35, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x50, + 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x47, + 0x51, 0x57, 0x31, 0x68, 0x65, 0x6d, 0x39, 0x75, 0x4d, 0x52, 0x6b, 0x77, + 0x46, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x42, 0x42, + 0x62, 0x57, 0x46, 0x36, 0x62, 0x32, 0x34, 0x67, 0x0a, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x30, 0x4d, 0x42, 0x34, + 0x58, 0x44, 0x54, 0x45, 0x31, 0x4d, 0x44, 0x55, 0x79, 0x4e, 0x6a, 0x41, + 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x51, + 0x77, 0x4d, 0x44, 0x55, 0x79, 0x4e, 0x6a, 0x41, 0x77, 0x4d, 0x44, 0x41, + 0x77, 0x4d, 0x46, 0x6f, 0x77, 0x4f, 0x54, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, + 0x4d, 0x78, 0x44, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x54, 0x42, 0x6b, 0x46, 0x74, 0x59, 0x58, 0x70, 0x76, 0x62, 0x6a, + 0x45, 0x5a, 0x4d, 0x42, 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, + 0x4d, 0x51, 0x51, 0x57, 0x31, 0x68, 0x65, 0x6d, 0x39, 0x75, 0x49, 0x46, + 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x0a, 0x51, 0x30, 0x45, 0x67, 0x4e, + 0x44, 0x42, 0x32, 0x4d, 0x42, 0x41, 0x47, 0x42, 0x79, 0x71, 0x47, 0x53, + 0x4d, 0x34, 0x39, 0x41, 0x67, 0x45, 0x47, 0x42, 0x53, 0x75, 0x42, 0x42, + 0x41, 0x41, 0x69, 0x41, 0x32, 0x49, 0x41, 0x42, 0x4e, 0x4b, 0x72, 0x69, + 0x6a, 0x64, 0x50, 0x6f, 0x31, 0x4d, 0x4e, 0x2f, 0x73, 0x47, 0x4b, 0x65, + 0x30, 0x75, 0x6f, 0x65, 0x30, 0x5a, 0x4c, 0x59, 0x37, 0x42, 0x69, 0x0a, + 0x39, 0x69, 0x30, 0x62, 0x32, 0x77, 0x68, 0x78, 0x49, 0x64, 0x49, 0x41, + 0x36, 0x47, 0x4f, 0x39, 0x6d, 0x69, 0x66, 0x37, 0x38, 0x44, 0x6c, 0x75, + 0x58, 0x65, 0x6f, 0x39, 0x70, 0x63, 0x6d, 0x42, 0x71, 0x71, 0x4e, 0x62, + 0x49, 0x4a, 0x68, 0x46, 0x58, 0x52, 0x62, 0x62, 0x2f, 0x65, 0x67, 0x51, + 0x62, 0x65, 0x4f, 0x63, 0x34, 0x4f, 0x4f, 0x39, 0x58, 0x34, 0x52, 0x69, + 0x38, 0x33, 0x42, 0x6b, 0x0a, 0x4d, 0x36, 0x44, 0x4c, 0x4a, 0x43, 0x39, + 0x77, 0x75, 0x6f, 0x69, 0x68, 0x4b, 0x71, 0x42, 0x31, 0x2b, 0x49, 0x47, + 0x75, 0x59, 0x67, 0x62, 0x45, 0x67, 0x64, 0x73, 0x35, 0x62, 0x69, 0x6d, + 0x77, 0x48, 0x76, 0x6f, 0x75, 0x58, 0x4b, 0x4e, 0x43, 0x4d, 0x45, 0x41, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x0a, 0x2f, 0x7a, + 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x59, 0x59, 0x77, 0x48, 0x51, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4e, + 0x50, 0x73, 0x78, 0x7a, 0x70, 0x6c, 0x62, 0x73, 0x7a, 0x68, 0x32, 0x6e, + 0x61, 0x61, 0x56, 0x76, 0x75, 0x63, 0x38, 0x34, 0x5a, 0x74, 0x56, 0x2b, + 0x57, 0x42, 0x0a, 0x4d, 0x41, 0x6f, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, + 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, 0x44, 0x41, 0x32, 0x67, 0x41, 0x4d, + 0x47, 0x55, 0x43, 0x4d, 0x44, 0x71, 0x4c, 0x49, 0x66, 0x47, 0x39, 0x66, + 0x68, 0x47, 0x74, 0x30, 0x4f, 0x39, 0x59, 0x6c, 0x69, 0x2f, 0x57, 0x36, + 0x35, 0x31, 0x2b, 0x6b, 0x49, 0x30, 0x72, 0x7a, 0x32, 0x5a, 0x56, 0x77, + 0x79, 0x7a, 0x6a, 0x4b, 0x4b, 0x6c, 0x77, 0x0a, 0x43, 0x6b, 0x63, 0x4f, + 0x38, 0x44, 0x64, 0x5a, 0x45, 0x76, 0x38, 0x74, 0x6d, 0x5a, 0x51, 0x6f, + 0x54, 0x69, 0x70, 0x50, 0x4e, 0x55, 0x30, 0x7a, 0x57, 0x67, 0x49, 0x78, + 0x41, 0x4f, 0x70, 0x31, 0x41, 0x45, 0x34, 0x37, 0x78, 0x44, 0x71, 0x55, + 0x45, 0x70, 0x48, 0x4a, 0x57, 0x45, 0x61, 0x64, 0x49, 0x52, 0x4e, 0x79, + 0x70, 0x34, 0x69, 0x63, 0x69, 0x75, 0x52, 0x4d, 0x53, 0x74, 0x75, 0x57, + 0x0a, 0x31, 0x4b, 0x79, 0x4c, 0x61, 0x32, 0x74, 0x4a, 0x45, 0x6c, 0x4d, + 0x7a, 0x72, 0x64, 0x66, 0x6b, 0x76, 0x69, 0x54, 0x38, 0x74, 0x51, 0x70, + 0x32, 0x31, 0x4b, 0x57, 0x38, 0x45, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x4c, 0x75, 0x78, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x32, + 0x20, 0x4f, 0x3d, 0x4c, 0x75, 0x78, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, + 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4c, 0x75, 0x78, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x32, 0x20, 0x4f, 0x3d, 0x4c, 0x75, 0x78, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, 0x2e, 0x41, 0x2e, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x4c, 0x75, 0x78, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x35, 0x39, 0x39, 0x31, 0x34, 0x33, + 0x33, 0x38, 0x32, 0x32, 0x35, 0x37, 0x33, 0x34, 0x31, 0x34, 0x37, 0x31, + 0x32, 0x33, 0x39, 0x34, 0x31, 0x30, 0x35, 0x38, 0x33, 0x37, 0x36, 0x37, + 0x38, 0x38, 0x31, 0x31, 0x30, 0x33, 0x30, 0x35, 0x38, 0x32, 0x32, 0x34, + 0x38, 0x39, 0x35, 0x32, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x62, 0x32, 0x3a, 0x65, 0x31, 0x3a, 0x30, 0x39, 0x3a, 0x30, 0x30, + 0x3a, 0x36, 0x31, 0x3a, 0x61, 0x66, 0x3a, 0x66, 0x37, 0x3a, 0x66, 0x31, + 0x3a, 0x39, 0x31, 0x3a, 0x36, 0x66, 0x3a, 0x63, 0x34, 0x3a, 0x61, 0x64, + 0x3a, 0x38, 0x64, 0x3a, 0x35, 0x65, 0x3a, 0x33, 0x62, 0x3a, 0x37, 0x63, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x65, 0x3a, + 0x30, 0x65, 0x3a, 0x35, 0x36, 0x3a, 0x31, 0x39, 0x3a, 0x30, 0x61, 0x3a, + 0x64, 0x31, 0x3a, 0x38, 0x62, 0x3a, 0x32, 0x35, 0x3a, 0x39, 0x38, 0x3a, + 0x62, 0x32, 0x3a, 0x30, 0x34, 0x3a, 0x34, 0x34, 0x3a, 0x66, 0x66, 0x3a, + 0x36, 0x36, 0x3a, 0x38, 0x61, 0x3a, 0x30, 0x34, 0x3a, 0x31, 0x37, 0x3a, + 0x39, 0x39, 0x3a, 0x35, 0x66, 0x3a, 0x33, 0x66, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x34, 0x3a, 0x34, 0x35, + 0x3a, 0x35, 0x66, 0x3a, 0x37, 0x31, 0x3a, 0x32, 0x39, 0x3a, 0x63, 0x32, + 0x3a, 0x30, 0x62, 0x3a, 0x31, 0x34, 0x3a, 0x34, 0x37, 0x3a, 0x63, 0x34, + 0x3a, 0x31, 0x38, 0x3a, 0x66, 0x39, 0x3a, 0x39, 0x37, 0x3a, 0x31, 0x36, + 0x3a, 0x38, 0x66, 0x3a, 0x32, 0x34, 0x3a, 0x63, 0x35, 0x3a, 0x38, 0x66, + 0x3a, 0x63, 0x35, 0x3a, 0x30, 0x32, 0x3a, 0x33, 0x62, 0x3a, 0x66, 0x35, + 0x3a, 0x64, 0x61, 0x3a, 0x35, 0x62, 0x3a, 0x65, 0x32, 0x3a, 0x65, 0x62, + 0x3a, 0x36, 0x65, 0x3a, 0x31, 0x64, 0x3a, 0x64, 0x38, 0x3a, 0x39, 0x30, + 0x3a, 0x32, 0x65, 0x3a, 0x64, 0x35, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x46, 0x77, 0x7a, 0x43, 0x43, 0x41, 0x36, 0x75, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x55, 0x43, 0x6e, 0x36, 0x6d, 0x33, + 0x30, 0x74, 0x45, 0x6e, 0x74, 0x70, 0x71, 0x4a, 0x49, 0x57, 0x65, 0x35, + 0x72, 0x67, 0x56, 0x30, 0x78, 0x5a, 0x2f, 0x75, 0x37, 0x45, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x77, 0x52, 0x6a, 0x45, 0x4c, + 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, + 0x54, 0x46, 0x55, 0x78, 0x46, 0x6a, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x55, 0x78, 0x31, 0x65, 0x46, 0x52, 0x79, + 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x4d, 0x75, 0x51, 0x53, 0x34, 0x78, + 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, + 0x4d, 0x46, 0x6b, 0x78, 0x31, 0x65, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, + 0x30, 0x49, 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, + 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x44, 0x49, 0x77, 0x48, 0x68, 0x63, + 0x4e, 0x4d, 0x54, 0x55, 0x77, 0x4d, 0x7a, 0x41, 0x31, 0x4d, 0x54, 0x4d, + 0x79, 0x4d, 0x54, 0x55, 0x33, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x55, + 0x77, 0x0a, 0x4d, 0x7a, 0x41, 0x31, 0x4d, 0x54, 0x4d, 0x79, 0x4d, 0x54, + 0x55, 0x33, 0x57, 0x6a, 0x42, 0x47, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4d, 0x56, 0x54, + 0x45, 0x57, 0x4d, 0x42, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, + 0x77, 0x4e, 0x54, 0x48, 0x56, 0x34, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, + 0x51, 0x67, 0x55, 0x79, 0x35, 0x42, 0x0a, 0x4c, 0x6a, 0x45, 0x66, 0x4d, + 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x57, 0x54, + 0x48, 0x56, 0x34, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x52, + 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x49, 0x46, 0x4a, 0x76, 0x62, + 0x33, 0x51, 0x67, 0x4d, 0x6a, 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x0a, + 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, + 0x41, 0x44, 0x43, 0x43, 0x41, 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, + 0x41, 0x4e, 0x65, 0x46, 0x6c, 0x37, 0x38, 0x52, 0x6d, 0x4f, 0x6e, 0x77, + 0x59, 0x6f, 0x4e, 0x4d, 0x50, 0x49, 0x66, 0x35, 0x55, 0x32, 0x6f, 0x33, + 0x43, 0x2f, 0x49, 0x50, 0x50, 0x49, 0x66, 0x4f, 0x62, 0x39, 0x77, 0x6d, + 0x4b, 0x62, 0x33, 0x46, 0x0a, 0x69, 0x62, 0x72, 0x4a, 0x67, 0x7a, 0x33, + 0x33, 0x37, 0x73, 0x70, 0x62, 0x78, 0x6d, 0x31, 0x4a, 0x63, 0x37, 0x54, + 0x4a, 0x52, 0x71, 0x4d, 0x62, 0x4e, 0x42, 0x4d, 0x2f, 0x77, 0x59, 0x6c, + 0x46, 0x56, 0x2f, 0x54, 0x5a, 0x73, 0x66, 0x73, 0x32, 0x5a, 0x55, 0x76, + 0x37, 0x43, 0x4f, 0x4a, 0x49, 0x63, 0x52, 0x48, 0x49, 0x62, 0x6a, 0x75, + 0x65, 0x6e, 0x64, 0x2b, 0x4a, 0x5a, 0x54, 0x65, 0x6d, 0x0a, 0x68, 0x66, + 0x59, 0x37, 0x52, 0x42, 0x69, 0x32, 0x78, 0x6a, 0x63, 0x77, 0x59, 0x6b, + 0x53, 0x53, 0x6c, 0x32, 0x6c, 0x39, 0x51, 0x6a, 0x41, 0x6b, 0x35, 0x41, + 0x30, 0x4d, 0x69, 0x57, 0x74, 0x6a, 0x33, 0x73, 0x58, 0x68, 0x33, 0x30, + 0x36, 0x70, 0x46, 0x47, 0x78, 0x54, 0x34, 0x47, 0x48, 0x4f, 0x39, 0x68, + 0x63, 0x76, 0x48, 0x54, 0x79, 0x39, 0x35, 0x69, 0x4a, 0x4d, 0x48, 0x5a, + 0x50, 0x31, 0x0a, 0x45, 0x4d, 0x53, 0x68, 0x64, 0x75, 0x78, 0x71, 0x33, + 0x73, 0x56, 0x73, 0x33, 0x35, 0x61, 0x30, 0x56, 0x6b, 0x42, 0x43, 0x77, + 0x47, 0x4b, 0x53, 0x4d, 0x4b, 0x45, 0x74, 0x46, 0x5a, 0x53, 0x67, 0x30, + 0x69, 0x41, 0x47, 0x43, 0x57, 0x35, 0x71, 0x62, 0x65, 0x58, 0x72, 0x74, + 0x37, 0x37, 0x55, 0x38, 0x50, 0x45, 0x56, 0x66, 0x49, 0x76, 0x6d, 0x54, + 0x72, 0x6f, 0x54, 0x7a, 0x45, 0x73, 0x6e, 0x0a, 0x58, 0x70, 0x6b, 0x38, + 0x46, 0x31, 0x32, 0x50, 0x67, 0x58, 0x38, 0x7a, 0x50, 0x55, 0x2f, 0x54, + 0x50, 0x78, 0x76, 0x73, 0x58, 0x44, 0x2f, 0x77, 0x50, 0x45, 0x78, 0x31, + 0x62, 0x76, 0x4b, 0x6d, 0x31, 0x5a, 0x33, 0x61, 0x4c, 0x51, 0x64, 0x6a, + 0x41, 0x73, 0x5a, 0x79, 0x36, 0x5a, 0x53, 0x38, 0x54, 0x45, 0x6d, 0x56, + 0x54, 0x34, 0x68, 0x53, 0x79, 0x4e, 0x76, 0x6f, 0x61, 0x59, 0x4c, 0x34, + 0x0a, 0x7a, 0x44, 0x52, 0x62, 0x49, 0x76, 0x43, 0x47, 0x70, 0x34, 0x6d, + 0x39, 0x53, 0x41, 0x70, 0x74, 0x5a, 0x6f, 0x46, 0x74, 0x79, 0x4d, 0x68, + 0x6b, 0x2b, 0x77, 0x48, 0x68, 0x39, 0x4f, 0x48, 0x65, 0x32, 0x5a, 0x37, + 0x64, 0x32, 0x31, 0x76, 0x55, 0x4b, 0x70, 0x6b, 0x6d, 0x46, 0x52, 0x73, + 0x65, 0x54, 0x4a, 0x49, 0x70, 0x67, 0x70, 0x37, 0x56, 0x6b, 0x6f, 0x47, + 0x53, 0x51, 0x58, 0x41, 0x5a, 0x0a, 0x39, 0x36, 0x54, 0x6c, 0x6b, 0x30, + 0x75, 0x38, 0x64, 0x32, 0x63, 0x78, 0x33, 0x52, 0x7a, 0x39, 0x4d, 0x58, + 0x41, 0x4e, 0x46, 0x35, 0x6b, 0x4d, 0x2b, 0x51, 0x77, 0x35, 0x47, 0x53, + 0x6f, 0x58, 0x74, 0x54, 0x42, 0x78, 0x56, 0x64, 0x55, 0x50, 0x72, 0x6c, + 0x6a, 0x68, 0x50, 0x53, 0x38, 0x30, 0x6d, 0x38, 0x2b, 0x66, 0x39, 0x6e, + 0x69, 0x46, 0x77, 0x70, 0x4e, 0x36, 0x63, 0x6a, 0x35, 0x6d, 0x0a, 0x6a, + 0x35, 0x77, 0x57, 0x45, 0x57, 0x43, 0x50, 0x6e, 0x6f, 0x6c, 0x76, 0x5a, + 0x37, 0x37, 0x67, 0x52, 0x31, 0x6f, 0x37, 0x44, 0x4a, 0x70, 0x6e, 0x69, + 0x38, 0x39, 0x47, 0x78, 0x71, 0x34, 0x34, 0x6f, 0x2f, 0x4b, 0x6e, 0x76, + 0x4f, 0x62, 0x57, 0x68, 0x57, 0x73, 0x7a, 0x4a, 0x48, 0x41, 0x69, 0x53, + 0x38, 0x73, 0x49, 0x6d, 0x37, 0x76, 0x49, 0x2b, 0x41, 0x49, 0x70, 0x48, + 0x62, 0x34, 0x67, 0x0a, 0x44, 0x45, 0x61, 0x2f, 0x61, 0x34, 0x65, 0x62, + 0x73, 0x79, 0x70, 0x6d, 0x51, 0x6a, 0x56, 0x47, 0x62, 0x4b, 0x71, 0x36, + 0x72, 0x66, 0x6d, 0x59, 0x65, 0x2b, 0x6c, 0x51, 0x56, 0x52, 0x51, 0x78, + 0x76, 0x37, 0x48, 0x61, 0x4c, 0x65, 0x32, 0x41, 0x72, 0x57, 0x67, 0x6b, + 0x2b, 0x32, 0x6d, 0x72, 0x32, 0x48, 0x45, 0x54, 0x4d, 0x4f, 0x5a, 0x6e, + 0x73, 0x34, 0x64, 0x41, 0x2f, 0x59, 0x6c, 0x2b, 0x0a, 0x38, 0x6b, 0x50, + 0x52, 0x45, 0x64, 0x38, 0x76, 0x5a, 0x53, 0x39, 0x6b, 0x7a, 0x6c, 0x38, + 0x55, 0x75, 0x62, 0x47, 0x2f, 0x4d, 0x62, 0x32, 0x48, 0x65, 0x46, 0x70, + 0x5a, 0x5a, 0x59, 0x69, 0x71, 0x2f, 0x46, 0x6b, 0x79, 0x53, 0x49, 0x62, + 0x57, 0x54, 0x4c, 0x6b, 0x70, 0x53, 0x35, 0x58, 0x54, 0x64, 0x76, 0x4e, + 0x33, 0x4a, 0x57, 0x31, 0x43, 0x48, 0x44, 0x69, 0x44, 0x54, 0x66, 0x32, + 0x6a, 0x0a, 0x58, 0x35, 0x74, 0x2f, 0x4c, 0x61, 0x78, 0x35, 0x47, 0x77, + 0x35, 0x43, 0x4d, 0x5a, 0x64, 0x6a, 0x70, 0x50, 0x75, 0x4b, 0x61, 0x64, + 0x55, 0x69, 0x44, 0x54, 0x53, 0x51, 0x4d, 0x43, 0x36, 0x6f, 0x74, 0x4f, + 0x42, 0x74, 0x74, 0x70, 0x53, 0x73, 0x76, 0x49, 0x74, 0x4f, 0x31, 0x33, + 0x44, 0x38, 0x78, 0x54, 0x69, 0x4f, 0x5a, 0x43, 0x58, 0x68, 0x54, 0x54, + 0x6d, 0x51, 0x7a, 0x73, 0x6d, 0x48, 0x0a, 0x68, 0x46, 0x68, 0x78, 0x41, + 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, 0x6a, 0x67, 0x61, 0x67, 0x77, 0x67, + 0x61, 0x55, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, + 0x7a, 0x42, 0x43, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x41, 0x45, 0x4f, + 0x7a, 0x41, 0x35, 0x4d, 0x44, 0x63, 0x47, 0x42, 0x79, 0x75, 0x42, 0x0a, + 0x4b, 0x77, 0x45, 0x42, 0x41, 0x51, 0x6f, 0x77, 0x4c, 0x44, 0x41, 0x71, + 0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x43, + 0x41, 0x52, 0x59, 0x65, 0x61, 0x48, 0x52, 0x30, 0x63, 0x48, 0x4d, 0x36, + 0x4c, 0x79, 0x39, 0x79, 0x5a, 0x58, 0x42, 0x76, 0x63, 0x32, 0x6c, 0x30, + 0x62, 0x33, 0x4a, 0x35, 0x4c, 0x6d, 0x78, 0x31, 0x65, 0x48, 0x52, 0x79, + 0x64, 0x58, 0x4e, 0x30, 0x0a, 0x4c, 0x6d, 0x78, 0x31, 0x4d, 0x41, 0x34, + 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x66, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, 0x54, + 0x2f, 0x47, 0x43, 0x68, 0x32, 0x2b, 0x55, 0x67, 0x46, 0x4c, 0x4b, 0x47, + 0x75, 0x38, 0x53, 0x73, 0x62, 0x4b, 0x37, 0x4a, 0x54, 0x0a, 0x2b, 0x45, + 0x74, 0x38, 0x73, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x2f, 0x78, 0x67, 0x6f, 0x64, 0x76, + 0x6c, 0x49, 0x42, 0x53, 0x79, 0x68, 0x72, 0x76, 0x45, 0x72, 0x47, 0x79, + 0x75, 0x79, 0x55, 0x2f, 0x68, 0x4c, 0x66, 0x4c, 0x4d, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, + 0x47, 0x6f, 0x5a, 0x46, 0x4f, 0x31, 0x75, 0x65, 0x63, 0x45, 0x73, 0x68, + 0x39, 0x51, 0x4e, 0x63, 0x48, 0x37, 0x58, 0x39, 0x6e, 0x6a, 0x4a, 0x43, + 0x77, 0x52, 0x4f, 0x78, 0x4c, 0x48, 0x4f, 0x6b, 0x33, 0x44, 0x2b, 0x73, + 0x46, 0x54, 0x41, 0x4d, 0x73, 0x32, 0x5a, 0x4d, 0x47, 0x51, 0x58, 0x76, + 0x77, 0x2f, 0x6c, 0x34, 0x6a, 0x50, 0x39, 0x0a, 0x42, 0x7a, 0x5a, 0x41, + 0x63, 0x67, 0x34, 0x61, 0x74, 0x6d, 0x70, 0x5a, 0x31, 0x67, 0x44, 0x6c, + 0x61, 0x43, 0x44, 0x64, 0x4c, 0x6e, 0x49, 0x4e, 0x48, 0x32, 0x70, 0x6b, + 0x4d, 0x53, 0x43, 0x45, 0x66, 0x55, 0x6d, 0x6d, 0x57, 0x6a, 0x66, 0x72, + 0x52, 0x63, 0x6d, 0x46, 0x39, 0x64, 0x54, 0x48, 0x46, 0x35, 0x6b, 0x48, + 0x35, 0x70, 0x74, 0x56, 0x35, 0x41, 0x7a, 0x6f, 0x71, 0x62, 0x54, 0x4f, + 0x0a, 0x6a, 0x46, 0x75, 0x31, 0x45, 0x56, 0x7a, 0x50, 0x69, 0x67, 0x34, + 0x4e, 0x31, 0x71, 0x78, 0x33, 0x67, 0x66, 0x34, 0x79, 0x6e, 0x43, 0x53, + 0x65, 0x63, 0x73, 0x35, 0x55, 0x38, 0x39, 0x42, 0x76, 0x6f, 0x6c, 0x62, + 0x57, 0x37, 0x4d, 0x4d, 0x33, 0x4c, 0x47, 0x56, 0x59, 0x76, 0x6c, 0x63, + 0x41, 0x47, 0x76, 0x49, 0x31, 0x2b, 0x75, 0x74, 0x37, 0x4d, 0x56, 0x33, + 0x43, 0x77, 0x52, 0x49, 0x39, 0x0a, 0x6c, 0x6f, 0x47, 0x49, 0x6c, 0x6f, + 0x6e, 0x42, 0x57, 0x56, 0x78, 0x36, 0x35, 0x6e, 0x39, 0x77, 0x4e, 0x4f, + 0x65, 0x44, 0x34, 0x72, 0x48, 0x68, 0x34, 0x62, 0x68, 0x59, 0x37, 0x39, + 0x53, 0x56, 0x35, 0x47, 0x43, 0x63, 0x38, 0x4a, 0x61, 0x58, 0x63, 0x6f, + 0x7a, 0x72, 0x68, 0x41, 0x49, 0x75, 0x5a, 0x59, 0x2b, 0x6b, 0x74, 0x39, + 0x4a, 0x2f, 0x5a, 0x39, 0x33, 0x49, 0x30, 0x35, 0x35, 0x63, 0x0a, 0x71, + 0x71, 0x6d, 0x6b, 0x6f, 0x43, 0x55, 0x55, 0x42, 0x70, 0x76, 0x73, 0x54, + 0x33, 0x34, 0x74, 0x43, 0x33, 0x38, 0x64, 0x64, 0x66, 0x45, 0x7a, 0x32, + 0x4f, 0x33, 0x4f, 0x75, 0x48, 0x56, 0x74, 0x50, 0x6c, 0x75, 0x35, 0x6d, + 0x42, 0x30, 0x78, 0x44, 0x56, 0x62, 0x59, 0x51, 0x77, 0x38, 0x77, 0x6b, + 0x62, 0x49, 0x45, 0x61, 0x39, 0x31, 0x57, 0x76, 0x70, 0x57, 0x41, 0x56, + 0x57, 0x65, 0x2b, 0x0a, 0x32, 0x4d, 0x32, 0x44, 0x32, 0x52, 0x6a, 0x75, + 0x4c, 0x67, 0x2b, 0x47, 0x4c, 0x5a, 0x4b, 0x65, 0x63, 0x42, 0x50, 0x73, + 0x33, 0x6c, 0x48, 0x4a, 0x51, 0x33, 0x67, 0x43, 0x70, 0x55, 0x33, 0x49, + 0x2b, 0x56, 0x2f, 0x45, 0x6b, 0x56, 0x68, 0x47, 0x46, 0x6e, 0x64, 0x61, + 0x64, 0x4b, 0x70, 0x41, 0x76, 0x41, 0x65, 0x66, 0x4d, 0x4c, 0x6d, 0x78, + 0x39, 0x78, 0x49, 0x58, 0x33, 0x65, 0x50, 0x2f, 0x0a, 0x4a, 0x45, 0x41, + 0x64, 0x65, 0x6d, 0x72, 0x52, 0x54, 0x78, 0x67, 0x4b, 0x71, 0x70, 0x41, + 0x64, 0x36, 0x30, 0x41, 0x65, 0x33, 0x36, 0x45, 0x65, 0x52, 0x4a, 0x49, + 0x51, 0x6d, 0x76, 0x4b, 0x4e, 0x34, 0x64, 0x46, 0x4c, 0x52, 0x70, 0x37, + 0x6f, 0x52, 0x55, 0x4b, 0x58, 0x36, 0x6b, 0x57, 0x5a, 0x38, 0x2b, 0x78, + 0x6d, 0x31, 0x51, 0x4c, 0x36, 0x38, 0x71, 0x5a, 0x4b, 0x4a, 0x4b, 0x72, + 0x65, 0x0a, 0x7a, 0x72, 0x6e, 0x4b, 0x2b, 0x54, 0x2b, 0x54, 0x62, 0x2f, + 0x6d, 0x6a, 0x75, 0x75, 0x71, 0x6c, 0x50, 0x70, 0x6d, 0x74, 0x2f, 0x66, + 0x39, 0x37, 0x6d, 0x66, 0x56, 0x6c, 0x37, 0x76, 0x42, 0x5a, 0x4b, 0x47, + 0x66, 0x58, 0x6b, 0x4a, 0x57, 0x6b, 0x45, 0x34, 0x53, 0x70, 0x68, 0x4d, + 0x48, 0x6f, 0x7a, 0x73, 0x35, 0x31, 0x6b, 0x32, 0x4d, 0x61, 0x76, 0x44, + 0x7a, 0x71, 0x31, 0x57, 0x51, 0x66, 0x0a, 0x4c, 0x53, 0x6f, 0x53, 0x4f, + 0x63, 0x62, 0x44, 0x57, 0x6a, 0x4c, 0x74, 0x52, 0x35, 0x45, 0x57, 0x44, + 0x72, 0x77, 0x34, 0x77, 0x56, 0x44, 0x65, 0x6a, 0x38, 0x6f, 0x71, 0x6b, + 0x44, 0x51, 0x63, 0x37, 0x6b, 0x47, 0x55, 0x6e, 0x46, 0x34, 0x5a, 0x4c, + 0x76, 0x68, 0x46, 0x53, 0x5a, 0x6c, 0x30, 0x6b, 0x62, 0x41, 0x45, 0x62, + 0x2b, 0x4d, 0x45, 0x57, 0x72, 0x47, 0x72, 0x4b, 0x71, 0x76, 0x2b, 0x0a, + 0x78, 0x39, 0x43, 0x57, 0x74, 0x74, 0x72, 0x68, 0x53, 0x6d, 0x51, 0x47, + 0x62, 0x6d, 0x42, 0x4e, 0x76, 0x55, 0x4a, 0x4f, 0x2f, 0x33, 0x6a, 0x61, + 0x4a, 0x4d, 0x6f, 0x62, 0x74, 0x4e, 0x65, 0x57, 0x4f, 0x57, 0x79, 0x75, + 0x38, 0x51, 0x36, 0x71, 0x70, 0x33, 0x31, 0x49, 0x69, 0x79, 0x42, 0x4d, + 0x7a, 0x32, 0x54, 0x57, 0x75, 0x4a, 0x64, 0x47, 0x73, 0x45, 0x37, 0x52, + 0x4b, 0x6c, 0x59, 0x36, 0x0a, 0x6f, 0x4a, 0x4f, 0x39, 0x72, 0x34, 0x41, + 0x6b, 0x34, 0x41, 0x70, 0x2b, 0x35, 0x38, 0x72, 0x56, 0x79, 0x75, 0x69, + 0x46, 0x56, 0x64, 0x77, 0x32, 0x4b, 0x75, 0x47, 0x55, 0x61, 0x4a, 0x50, + 0x48, 0x5a, 0x6e, 0x4a, 0x45, 0x44, 0x34, 0x41, 0x68, 0x4d, 0x6d, 0x77, + 0x6c, 0x78, 0x79, 0x4f, 0x41, 0x67, 0x77, 0x72, 0x72, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x54, 0x55, 0x42, 0x49, 0x54, 0x41, 0x4b, 0x20, 0x4b, 0x61, + 0x6d, 0x75, 0x20, 0x53, 0x4d, 0x20, 0x53, 0x53, 0x4c, 0x20, 0x4b, 0x6f, + 0x6b, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0x61, 0x73, + 0x69, 0x20, 0x2d, 0x20, 0x53, 0x75, 0x72, 0x75, 0x6d, 0x20, 0x31, 0x20, + 0x4f, 0x3d, 0x54, 0x75, 0x72, 0x6b, 0x69, 0x79, 0x65, 0x20, 0x42, 0x69, + 0x6c, 0x69, 0x6d, 0x73, 0x65, 0x6c, 0x20, 0x76, 0x65, 0x20, 0x54, 0x65, + 0x6b, 0x6e, 0x6f, 0x6c, 0x6f, 0x6a, 0x69, 0x6b, 0x20, 0x41, 0x72, 0x61, + 0x73, 0x74, 0x69, 0x72, 0x6d, 0x61, 0x20, 0x4b, 0x75, 0x72, 0x75, 0x6d, + 0x75, 0x20, 0x2d, 0x20, 0x54, 0x55, 0x42, 0x49, 0x54, 0x41, 0x4b, 0x20, + 0x4f, 0x55, 0x3d, 0x4b, 0x61, 0x6d, 0x75, 0x20, 0x53, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x6b, 0x61, 0x73, 0x79, 0x6f, 0x6e, 0x20, 0x4d, 0x65, + 0x72, 0x6b, 0x65, 0x7a, 0x69, 0x20, 0x2d, 0x20, 0x4b, 0x61, 0x6d, 0x75, + 0x20, 0x53, 0x4d, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x55, 0x42, 0x49, 0x54, 0x41, + 0x4b, 0x20, 0x4b, 0x61, 0x6d, 0x75, 0x20, 0x53, 0x4d, 0x20, 0x53, 0x53, + 0x4c, 0x20, 0x4b, 0x6f, 0x6b, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x6b, 0x61, 0x73, 0x69, 0x20, 0x2d, 0x20, 0x53, 0x75, 0x72, 0x75, + 0x6d, 0x20, 0x31, 0x20, 0x4f, 0x3d, 0x54, 0x75, 0x72, 0x6b, 0x69, 0x79, + 0x65, 0x20, 0x42, 0x69, 0x6c, 0x69, 0x6d, 0x73, 0x65, 0x6c, 0x20, 0x76, + 0x65, 0x20, 0x54, 0x65, 0x6b, 0x6e, 0x6f, 0x6c, 0x6f, 0x6a, 0x69, 0x6b, + 0x20, 0x41, 0x72, 0x61, 0x73, 0x74, 0x69, 0x72, 0x6d, 0x61, 0x20, 0x4b, + 0x75, 0x72, 0x75, 0x6d, 0x75, 0x20, 0x2d, 0x20, 0x54, 0x55, 0x42, 0x49, + 0x54, 0x41, 0x4b, 0x20, 0x4f, 0x55, 0x3d, 0x4b, 0x61, 0x6d, 0x75, 0x20, + 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x6b, 0x61, 0x73, 0x79, 0x6f, + 0x6e, 0x20, 0x4d, 0x65, 0x72, 0x6b, 0x65, 0x7a, 0x69, 0x20, 0x2d, 0x20, + 0x4b, 0x61, 0x6d, 0x75, 0x20, 0x53, 0x4d, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x55, 0x42, 0x49, 0x54, 0x41, + 0x4b, 0x20, 0x4b, 0x61, 0x6d, 0x75, 0x20, 0x53, 0x4d, 0x20, 0x53, 0x53, + 0x4c, 0x20, 0x4b, 0x6f, 0x6b, 0x20, 0x53, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x6b, 0x61, 0x73, 0x69, 0x20, 0x2d, 0x20, 0x53, 0x75, 0x72, 0x75, + 0x6d, 0x20, 0x31, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x64, 0x63, 0x3a, 0x30, 0x30, 0x3a, 0x38, 0x31, 0x3a, 0x64, 0x63, 0x3a, + 0x36, 0x39, 0x3a, 0x32, 0x66, 0x3a, 0x33, 0x65, 0x3a, 0x32, 0x66, 0x3a, + 0x62, 0x30, 0x3a, 0x33, 0x62, 0x3a, 0x66, 0x36, 0x3a, 0x33, 0x64, 0x3a, + 0x35, 0x61, 0x3a, 0x39, 0x31, 0x3a, 0x38, 0x65, 0x3a, 0x34, 0x39, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x31, 0x3a, 0x34, + 0x33, 0x3a, 0x36, 0x34, 0x3a, 0x39, 0x62, 0x3a, 0x65, 0x63, 0x3a, 0x63, + 0x65, 0x3a, 0x32, 0x37, 0x3a, 0x65, 0x63, 0x3a, 0x65, 0x64, 0x3a, 0x33, + 0x61, 0x3a, 0x33, 0x66, 0x3a, 0x30, 0x62, 0x3a, 0x38, 0x66, 0x3a, 0x30, + 0x64, 0x3a, 0x65, 0x34, 0x3a, 0x65, 0x38, 0x3a, 0x39, 0x31, 0x3a, 0x64, + 0x64, 0x3a, 0x65, 0x65, 0x3a, 0x63, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x36, 0x3a, 0x65, 0x64, 0x3a, + 0x63, 0x33, 0x3a, 0x36, 0x38, 0x3a, 0x39, 0x30, 0x3a, 0x34, 0x36, 0x3a, + 0x64, 0x35, 0x3a, 0x33, 0x61, 0x3a, 0x34, 0x35, 0x3a, 0x33, 0x66, 0x3a, + 0x62, 0x33, 0x3a, 0x31, 0x30, 0x3a, 0x34, 0x61, 0x3a, 0x62, 0x38, 0x3a, + 0x30, 0x64, 0x3a, 0x63, 0x61, 0x3a, 0x65, 0x63, 0x3a, 0x36, 0x35, 0x3a, + 0x38, 0x62, 0x3a, 0x32, 0x36, 0x3a, 0x36, 0x30, 0x3a, 0x65, 0x61, 0x3a, + 0x31, 0x36, 0x3a, 0x32, 0x39, 0x3a, 0x64, 0x64, 0x3a, 0x37, 0x65, 0x3a, + 0x38, 0x36, 0x3a, 0x37, 0x39, 0x3a, 0x39, 0x30, 0x3a, 0x36, 0x34, 0x3a, + 0x38, 0x37, 0x3a, 0x31, 0x36, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x45, 0x59, 0x7a, 0x43, 0x43, 0x41, 0x30, 0x75, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x42, 0x41, 0x54, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x73, 0x46, 0x41, 0x44, 0x43, 0x42, 0x30, 0x6a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x46, + 0x49, 0x78, 0x0a, 0x47, 0x44, 0x41, 0x57, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x63, 0x54, 0x44, 0x30, 0x64, 0x6c, 0x59, 0x6e, 0x70, 0x6c, 0x49, + 0x43, 0x30, 0x67, 0x53, 0x32, 0x39, 0x6a, 0x59, 0x57, 0x56, 0x73, 0x61, + 0x54, 0x46, 0x43, 0x4d, 0x45, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x35, 0x56, 0x48, 0x56, 0x79, 0x61, 0x32, 0x6c, 0x35, 0x5a, + 0x53, 0x42, 0x43, 0x61, 0x57, 0x78, 0x70, 0x0a, 0x62, 0x58, 0x4e, 0x6c, + 0x62, 0x43, 0x42, 0x32, 0x5a, 0x53, 0x42, 0x55, 0x5a, 0x57, 0x74, 0x75, + 0x62, 0x32, 0x78, 0x76, 0x61, 0x6d, 0x6c, 0x72, 0x49, 0x45, 0x46, 0x79, + 0x59, 0x58, 0x4e, 0x30, 0x61, 0x58, 0x4a, 0x74, 0x59, 0x53, 0x42, 0x4c, + 0x64, 0x58, 0x4a, 0x31, 0x62, 0x58, 0x55, 0x67, 0x4c, 0x53, 0x42, 0x55, + 0x56, 0x55, 0x4a, 0x4a, 0x56, 0x45, 0x46, 0x4c, 0x4d, 0x53, 0x30, 0x77, + 0x0a, 0x4b, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x79, 0x52, + 0x4c, 0x59, 0x57, 0x31, 0x31, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x52, + 0x70, 0x5a, 0x6d, 0x6c, 0x72, 0x59, 0x58, 0x4e, 0x35, 0x62, 0x32, 0x34, + 0x67, 0x54, 0x57, 0x56, 0x79, 0x61, 0x32, 0x56, 0x36, 0x61, 0x53, 0x41, + 0x74, 0x49, 0x45, 0x74, 0x68, 0x62, 0x58, 0x55, 0x67, 0x55, 0x30, 0x30, + 0x78, 0x4e, 0x6a, 0x41, 0x30, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x4d, 0x54, 0x4c, 0x56, 0x52, 0x56, 0x51, 0x6b, 0x6c, 0x55, 0x51, 0x55, + 0x73, 0x67, 0x53, 0x32, 0x46, 0x74, 0x64, 0x53, 0x42, 0x54, 0x54, 0x53, + 0x42, 0x54, 0x55, 0x30, 0x77, 0x67, 0x53, 0x32, 0x39, 0x72, 0x49, 0x46, + 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x72, 0x59, 0x58, + 0x4e, 0x70, 0x49, 0x43, 0x30, 0x67, 0x55, 0x33, 0x56, 0x79, 0x0a, 0x64, + 0x57, 0x30, 0x67, 0x4d, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4d, + 0x7a, 0x45, 0x78, 0x4d, 0x6a, 0x55, 0x77, 0x4f, 0x44, 0x49, 0x31, 0x4e, + 0x54, 0x56, 0x61, 0x46, 0x77, 0x30, 0x30, 0x4d, 0x7a, 0x45, 0x77, 0x4d, + 0x6a, 0x55, 0x77, 0x4f, 0x44, 0x49, 0x31, 0x4e, 0x54, 0x56, 0x61, 0x4d, + 0x49, 0x48, 0x53, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x55, 0x55, 0x6a, 0x45, 0x59, + 0x4d, 0x42, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x78, 0x4d, 0x50, + 0x52, 0x32, 0x56, 0x69, 0x65, 0x6d, 0x55, 0x67, 0x4c, 0x53, 0x42, 0x4c, + 0x62, 0x32, 0x4e, 0x68, 0x5a, 0x57, 0x78, 0x70, 0x4d, 0x55, 0x49, 0x77, + 0x51, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x7a, 0x6c, 0x55, + 0x64, 0x58, 0x4a, 0x72, 0x61, 0x58, 0x6c, 0x6c, 0x0a, 0x49, 0x45, 0x4a, + 0x70, 0x62, 0x47, 0x6c, 0x74, 0x63, 0x32, 0x56, 0x73, 0x49, 0x48, 0x5a, + 0x6c, 0x49, 0x46, 0x52, 0x6c, 0x61, 0x32, 0x35, 0x76, 0x62, 0x47, 0x39, + 0x71, 0x61, 0x57, 0x73, 0x67, 0x51, 0x58, 0x4a, 0x68, 0x63, 0x33, 0x52, + 0x70, 0x63, 0x6d, 0x31, 0x68, 0x49, 0x45, 0x74, 0x31, 0x63, 0x6e, 0x56, + 0x74, 0x64, 0x53, 0x41, 0x74, 0x49, 0x46, 0x52, 0x56, 0x51, 0x6b, 0x6c, + 0x55, 0x0a, 0x51, 0x55, 0x73, 0x78, 0x4c, 0x54, 0x41, 0x72, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x4a, 0x45, 0x74, 0x68, 0x62, 0x58, + 0x55, 0x67, 0x55, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, + 0x74, 0x68, 0x63, 0x33, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x4e, 0x5a, 0x58, + 0x4a, 0x72, 0x5a, 0x58, 0x70, 0x70, 0x49, 0x43, 0x30, 0x67, 0x53, 0x32, + 0x46, 0x74, 0x64, 0x53, 0x42, 0x54, 0x0a, 0x54, 0x54, 0x45, 0x32, 0x4d, + 0x44, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x74, 0x56, + 0x46, 0x56, 0x43, 0x53, 0x56, 0x52, 0x42, 0x53, 0x79, 0x42, 0x4c, 0x59, + 0x57, 0x31, 0x31, 0x49, 0x46, 0x4e, 0x4e, 0x49, 0x46, 0x4e, 0x54, 0x54, + 0x43, 0x42, 0x4c, 0x62, 0x32, 0x73, 0x67, 0x55, 0x32, 0x56, 0x79, 0x64, + 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x74, 0x68, 0x63, 0x32, 0x6b, 0x67, 0x0a, + 0x4c, 0x53, 0x42, 0x54, 0x64, 0x58, 0x4a, 0x31, 0x62, 0x53, 0x41, 0x78, + 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, + 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, + 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x72, 0x33, 0x55, 0x77, + 0x4d, 0x36, 0x71, 0x37, 0x0a, 0x61, 0x39, 0x4f, 0x5a, 0x4c, 0x42, 0x49, + 0x33, 0x68, 0x4e, 0x6d, 0x4e, 0x65, 0x35, 0x65, 0x41, 0x30, 0x32, 0x37, + 0x6e, 0x2f, 0x35, 0x74, 0x51, 0x6c, 0x54, 0x36, 0x51, 0x6c, 0x56, 0x5a, + 0x43, 0x31, 0x78, 0x6c, 0x38, 0x4a, 0x6f, 0x53, 0x4e, 0x6b, 0x76, 0x6f, + 0x42, 0x48, 0x54, 0x6f, 0x50, 0x34, 0x6d, 0x51, 0x34, 0x74, 0x34, 0x79, + 0x38, 0x36, 0x49, 0x6a, 0x35, 0x69, 0x79, 0x53, 0x72, 0x0a, 0x4c, 0x71, + 0x50, 0x31, 0x4e, 0x2b, 0x52, 0x41, 0x6a, 0x68, 0x67, 0x6c, 0x65, 0x59, + 0x4e, 0x31, 0x48, 0x7a, 0x76, 0x2f, 0x62, 0x4b, 0x6a, 0x46, 0x78, 0x6c, + 0x62, 0x34, 0x74, 0x4f, 0x32, 0x4b, 0x52, 0x4b, 0x4f, 0x72, 0x62, 0x45, + 0x7a, 0x38, 0x48, 0x64, 0x44, 0x63, 0x37, 0x32, 0x69, 0x39, 0x7a, 0x2b, + 0x53, 0x71, 0x7a, 0x76, 0x42, 0x56, 0x39, 0x36, 0x49, 0x30, 0x31, 0x49, + 0x4e, 0x72, 0x0a, 0x4e, 0x33, 0x77, 0x63, 0x77, 0x76, 0x36, 0x31, 0x41, + 0x2b, 0x78, 0x58, 0x7a, 0x72, 0x79, 0x30, 0x74, 0x63, 0x58, 0x74, 0x41, + 0x41, 0x39, 0x54, 0x4e, 0x79, 0x70, 0x4e, 0x39, 0x45, 0x38, 0x4d, 0x67, + 0x2f, 0x75, 0x47, 0x7a, 0x38, 0x76, 0x2b, 0x6a, 0x45, 0x36, 0x39, 0x68, + 0x2f, 0x6d, 0x6e, 0x69, 0x79, 0x46, 0x58, 0x6e, 0x48, 0x72, 0x66, 0x41, + 0x32, 0x65, 0x4a, 0x4c, 0x4a, 0x32, 0x58, 0x0a, 0x59, 0x61, 0x63, 0x51, + 0x75, 0x46, 0x57, 0x51, 0x66, 0x77, 0x34, 0x74, 0x4a, 0x7a, 0x68, 0x30, + 0x33, 0x2b, 0x66, 0x39, 0x32, 0x6b, 0x34, 0x53, 0x34, 0x30, 0x30, 0x56, + 0x49, 0x67, 0x4c, 0x49, 0x34, 0x4f, 0x44, 0x38, 0x44, 0x36, 0x32, 0x4b, + 0x31, 0x38, 0x6c, 0x55, 0x55, 0x4d, 0x77, 0x37, 0x44, 0x38, 0x6f, 0x57, + 0x67, 0x49, 0x54, 0x51, 0x55, 0x56, 0x62, 0x44, 0x6a, 0x6c, 0x5a, 0x2f, + 0x0a, 0x69, 0x53, 0x49, 0x7a, 0x4c, 0x2b, 0x61, 0x46, 0x43, 0x72, 0x32, + 0x6c, 0x71, 0x42, 0x73, 0x32, 0x33, 0x74, 0x50, 0x63, 0x4c, 0x47, 0x30, + 0x37, 0x78, 0x78, 0x4f, 0x39, 0x57, 0x53, 0x4d, 0x73, 0x35, 0x75, 0x57, + 0x6b, 0x39, 0x39, 0x67, 0x4c, 0x37, 0x65, 0x71, 0x51, 0x51, 0x45, 0x53, + 0x6f, 0x6c, 0x62, 0x75, 0x54, 0x31, 0x64, 0x43, 0x41, 0x4e, 0x4c, 0x5a, + 0x47, 0x65, 0x41, 0x34, 0x66, 0x0a, 0x41, 0x4a, 0x4e, 0x47, 0x34, 0x65, + 0x37, 0x70, 0x2b, 0x65, 0x78, 0x50, 0x46, 0x77, 0x49, 0x44, 0x41, 0x51, + 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x64, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x5a, 0x54, + 0x2f, 0x48, 0x69, 0x6f, 0x62, 0x47, 0x50, 0x4e, 0x30, 0x38, 0x56, 0x46, + 0x77, 0x31, 0x2b, 0x44, 0x72, 0x74, 0x55, 0x67, 0x78, 0x48, 0x0a, 0x56, + 0x38, 0x67, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, 0x4d, + 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, + 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x45, 0x42, + 0x41, 0x43, 0x6f, 0x2f, 0x34, 0x66, 0x45, 0x79, 0x6a, 0x71, 0x37, 0x68, + 0x6d, 0x46, 0x78, 0x4c, 0x58, 0x73, 0x39, 0x72, 0x48, 0x6d, 0x6f, 0x4a, + 0x30, 0x69, 0x4b, 0x70, 0x45, 0x73, 0x64, 0x65, 0x56, 0x33, 0x31, 0x7a, + 0x56, 0x6d, 0x53, 0x41, 0x68, 0x48, 0x71, 0x54, 0x35, 0x41, 0x6d, 0x35, + 0x45, 0x4d, 0x32, 0x66, 0x4b, 0x69, 0x66, 0x68, 0x0a, 0x41, 0x48, 0x65, + 0x2b, 0x53, 0x4d, 0x67, 0x31, 0x71, 0x49, 0x47, 0x66, 0x35, 0x4c, 0x67, + 0x73, 0x79, 0x58, 0x38, 0x4f, 0x73, 0x4e, 0x4a, 0x4c, 0x4e, 0x31, 0x33, + 0x71, 0x75, 0x64, 0x55, 0x4c, 0x58, 0x6a, 0x53, 0x39, 0x39, 0x48, 0x4d, + 0x70, 0x77, 0x2b, 0x30, 0x6d, 0x46, 0x5a, 0x78, 0x2b, 0x43, 0x46, 0x4f, + 0x4b, 0x57, 0x49, 0x33, 0x51, 0x53, 0x79, 0x6a, 0x66, 0x77, 0x62, 0x50, + 0x66, 0x0a, 0x49, 0x50, 0x50, 0x35, 0x34, 0x2b, 0x4d, 0x36, 0x33, 0x38, + 0x79, 0x63, 0x6c, 0x4e, 0x68, 0x4f, 0x54, 0x38, 0x4e, 0x72, 0x46, 0x37, + 0x66, 0x33, 0x63, 0x75, 0x69, 0x74, 0x5a, 0x6a, 0x4f, 0x31, 0x4a, 0x56, + 0x4f, 0x72, 0x34, 0x50, 0x68, 0x4d, 0x71, 0x5a, 0x33, 0x39, 0x38, 0x67, + 0x32, 0x36, 0x72, 0x72, 0x6e, 0x5a, 0x71, 0x73, 0x5a, 0x72, 0x2b, 0x5a, + 0x4f, 0x37, 0x72, 0x71, 0x75, 0x34, 0x0a, 0x6c, 0x7a, 0x77, 0x44, 0x47, + 0x72, 0x70, 0x44, 0x78, 0x70, 0x61, 0x35, 0x52, 0x58, 0x49, 0x34, 0x73, + 0x36, 0x65, 0x68, 0x6c, 0x6a, 0x32, 0x52, 0x65, 0x33, 0x37, 0x41, 0x49, + 0x56, 0x4e, 0x4d, 0x68, 0x2b, 0x33, 0x79, 0x43, 0x31, 0x53, 0x56, 0x55, + 0x5a, 0x50, 0x56, 0x49, 0x71, 0x55, 0x4e, 0x69, 0x76, 0x47, 0x54, 0x44, + 0x6a, 0x35, 0x55, 0x44, 0x72, 0x44, 0x59, 0x79, 0x55, 0x37, 0x63, 0x0a, + 0x38, 0x6a, 0x45, 0x79, 0x56, 0x75, 0x70, 0x6b, 0x2b, 0x65, 0x71, 0x31, + 0x6e, 0x52, 0x5a, 0x6d, 0x51, 0x6e, 0x4c, 0x7a, 0x66, 0x39, 0x4f, 0x78, + 0x4d, 0x55, 0x50, 0x38, 0x70, 0x49, 0x34, 0x58, 0x38, 0x57, 0x30, 0x6a, + 0x71, 0x35, 0x52, 0x6d, 0x2b, 0x4b, 0x33, 0x37, 0x44, 0x77, 0x68, 0x75, + 0x4a, 0x69, 0x31, 0x2f, 0x46, 0x77, 0x63, 0x4a, 0x73, 0x6f, 0x7a, 0x37, + 0x55, 0x4d, 0x43, 0x66, 0x0a, 0x6c, 0x6f, 0x33, 0x50, 0x74, 0x76, 0x30, + 0x41, 0x6e, 0x56, 0x6f, 0x55, 0x6d, 0x72, 0x38, 0x43, 0x52, 0x50, 0x58, + 0x42, 0x77, 0x70, 0x38, 0x69, 0x58, 0x71, 0x49, 0x50, 0x6f, 0x65, 0x4d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x44, 0x43, 0x41, 0x20, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x41, 0x55, 0x54, 0x48, 0x20, 0x52, 0x35, 0x20, + 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x4f, 0x3d, 0x47, 0x55, 0x41, 0x4e, 0x47, + 0x20, 0x44, 0x4f, 0x4e, 0x47, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x20, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, + 0x49, 0x54, 0x59, 0x20, 0x43, 0x4f, 0x2e, 0x2c, 0x4c, 0x54, 0x44, 0x2e, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x47, 0x44, 0x43, 0x41, 0x20, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x41, 0x55, 0x54, 0x48, 0x20, 0x52, 0x35, 0x20, 0x52, 0x4f, 0x4f, + 0x54, 0x20, 0x4f, 0x3d, 0x47, 0x55, 0x41, 0x4e, 0x47, 0x20, 0x44, 0x4f, + 0x4e, 0x47, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x20, 0x41, 0x55, 0x54, 0x48, 0x4f, 0x52, 0x49, 0x54, 0x59, + 0x20, 0x43, 0x4f, 0x2e, 0x2c, 0x4c, 0x54, 0x44, 0x2e, 0x0a, 0x23, 0x20, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x44, 0x43, 0x41, + 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x41, 0x55, 0x54, 0x48, 0x20, 0x52, + 0x35, 0x20, 0x52, 0x4f, 0x4f, 0x54, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x39, 0x30, 0x30, 0x39, 0x38, 0x39, + 0x39, 0x36, 0x35, 0x30, 0x37, 0x34, 0x30, 0x31, 0x32, 0x30, 0x31, 0x38, + 0x36, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x36, 0x33, 0x3a, + 0x63, 0x63, 0x3a, 0x64, 0x39, 0x3a, 0x33, 0x64, 0x3a, 0x33, 0x34, 0x3a, + 0x33, 0x35, 0x3a, 0x35, 0x63, 0x3a, 0x36, 0x66, 0x3a, 0x35, 0x33, 0x3a, + 0x61, 0x33, 0x3a, 0x65, 0x32, 0x3a, 0x30, 0x38, 0x3a, 0x37, 0x30, 0x3a, + 0x34, 0x38, 0x3a, 0x31, 0x66, 0x3a, 0x62, 0x34, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, 0x66, 0x3a, 0x33, 0x36, 0x3a, 0x33, + 0x38, 0x3a, 0x35, 0x62, 0x3a, 0x38, 0x31, 0x3a, 0x31, 0x61, 0x3a, 0x32, + 0x35, 0x3a, 0x63, 0x33, 0x3a, 0x39, 0x62, 0x3a, 0x33, 0x31, 0x3a, 0x34, + 0x65, 0x3a, 0x38, 0x33, 0x3a, 0x63, 0x61, 0x3a, 0x65, 0x39, 0x3a, 0x33, + 0x34, 0x3a, 0x36, 0x36, 0x3a, 0x37, 0x30, 0x3a, 0x63, 0x63, 0x3a, 0x37, + 0x34, 0x3a, 0x62, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, + 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x62, 0x66, 0x3a, 0x66, 0x66, 0x3a, 0x38, 0x66, 0x3a, + 0x64, 0x30, 0x3a, 0x34, 0x34, 0x3a, 0x33, 0x33, 0x3a, 0x34, 0x38, 0x3a, + 0x37, 0x64, 0x3a, 0x36, 0x61, 0x3a, 0x38, 0x61, 0x3a, 0x61, 0x36, 0x3a, + 0x30, 0x63, 0x3a, 0x31, 0x61, 0x3a, 0x32, 0x39, 0x3a, 0x37, 0x36, 0x3a, + 0x37, 0x61, 0x3a, 0x39, 0x66, 0x3a, 0x63, 0x32, 0x3a, 0x62, 0x62, 0x3a, + 0x62, 0x30, 0x3a, 0x35, 0x65, 0x3a, 0x34, 0x32, 0x3a, 0x30, 0x66, 0x3a, + 0x37, 0x31, 0x3a, 0x33, 0x61, 0x3a, 0x31, 0x33, 0x3a, 0x62, 0x39, 0x3a, + 0x39, 0x32, 0x3a, 0x38, 0x39, 0x3a, 0x31, 0x64, 0x3a, 0x33, 0x38, 0x3a, + 0x39, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, + 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x69, + 0x44, 0x43, 0x43, 0x41, 0x33, 0x43, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, + 0x67, 0x49, 0x49, 0x66, 0x51, 0x6d, 0x58, 0x2f, 0x76, 0x42, 0x48, 0x36, + 0x6e, 0x6f, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x59, + 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x0a, + 0x42, 0x68, 0x4d, 0x43, 0x51, 0x30, 0x34, 0x78, 0x4d, 0x6a, 0x41, 0x77, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x4b, 0x55, 0x64, 0x56, + 0x51, 0x55, 0x35, 0x48, 0x49, 0x45, 0x52, 0x50, 0x54, 0x6b, 0x63, 0x67, + 0x51, 0x30, 0x56, 0x53, 0x56, 0x45, 0x6c, 0x47, 0x53, 0x55, 0x4e, 0x42, + 0x56, 0x45, 0x55, 0x67, 0x51, 0x56, 0x56, 0x55, 0x53, 0x45, 0x39, 0x53, + 0x53, 0x56, 0x52, 0x5a, 0x0a, 0x49, 0x45, 0x4e, 0x50, 0x4c, 0x69, 0x78, + 0x4d, 0x56, 0x45, 0x51, 0x75, 0x4d, 0x52, 0x38, 0x77, 0x48, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x5a, 0x48, 0x52, 0x45, 0x4e, + 0x42, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x51, 0x56, 0x56, + 0x55, 0x53, 0x43, 0x42, 0x53, 0x4e, 0x53, 0x42, 0x53, 0x54, 0x30, 0x39, + 0x55, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x30, 0x0a, 0x4d, 0x54, + 0x45, 0x79, 0x4e, 0x6a, 0x41, 0x31, 0x4d, 0x54, 0x4d, 0x78, 0x4e, 0x56, + 0x6f, 0x58, 0x44, 0x54, 0x51, 0x77, 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x54, + 0x45, 0x31, 0x4e, 0x54, 0x6b, 0x31, 0x4f, 0x56, 0x6f, 0x77, 0x59, 0x6a, + 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, + 0x4d, 0x43, 0x51, 0x30, 0x34, 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x42, 0x67, + 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x6f, 0x4d, 0x4b, 0x55, 0x64, 0x56, 0x51, + 0x55, 0x35, 0x48, 0x49, 0x45, 0x52, 0x50, 0x54, 0x6b, 0x63, 0x67, 0x51, + 0x30, 0x56, 0x53, 0x56, 0x45, 0x6c, 0x47, 0x53, 0x55, 0x4e, 0x42, 0x56, + 0x45, 0x55, 0x67, 0x51, 0x56, 0x56, 0x55, 0x53, 0x45, 0x39, 0x53, 0x53, + 0x56, 0x52, 0x5a, 0x49, 0x45, 0x4e, 0x50, 0x4c, 0x69, 0x78, 0x4d, 0x56, + 0x45, 0x51, 0x75, 0x4d, 0x52, 0x38, 0x77, 0x0a, 0x48, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, 0x5a, 0x48, 0x52, 0x45, 0x4e, 0x42, + 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x51, 0x56, 0x56, 0x55, + 0x53, 0x43, 0x42, 0x53, 0x4e, 0x53, 0x42, 0x53, 0x54, 0x30, 0x39, 0x55, + 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, + 0x0a, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, 0x49, + 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, 0x45, 0x41, 0x32, 0x61, 0x4d, + 0x57, 0x38, 0x4d, 0x68, 0x30, 0x64, 0x48, 0x65, 0x62, 0x37, 0x7a, 0x4d, + 0x4e, 0x4f, 0x77, 0x5a, 0x2b, 0x56, 0x66, 0x79, 0x31, 0x59, 0x49, 0x39, + 0x32, 0x68, 0x68, 0x4a, 0x43, 0x66, 0x56, 0x5a, 0x6d, 0x50, 0x6f, 0x69, + 0x43, 0x37, 0x58, 0x4a, 0x6a, 0x0a, 0x44, 0x70, 0x36, 0x4c, 0x33, 0x54, + 0x51, 0x73, 0x41, 0x6c, 0x46, 0x52, 0x77, 0x78, 0x6e, 0x39, 0x57, 0x56, + 0x53, 0x45, 0x79, 0x66, 0x46, 0x72, 0x73, 0x30, 0x79, 0x77, 0x36, 0x65, + 0x68, 0x47, 0x58, 0x54, 0x6a, 0x47, 0x6f, 0x71, 0x63, 0x75, 0x45, 0x56, + 0x65, 0x36, 0x67, 0x68, 0x57, 0x69, 0x6e, 0x49, 0x39, 0x74, 0x73, 0x4a, + 0x6c, 0x4b, 0x43, 0x76, 0x4c, 0x72, 0x69, 0x58, 0x42, 0x6a, 0x0a, 0x54, + 0x6e, 0x6e, 0x45, 0x74, 0x31, 0x75, 0x39, 0x6f, 0x6c, 0x32, 0x78, 0x38, + 0x6b, 0x45, 0x43, 0x4b, 0x36, 0x32, 0x70, 0x4f, 0x71, 0x50, 0x73, 0x65, + 0x51, 0x72, 0x73, 0x58, 0x7a, 0x72, 0x6a, 0x2f, 0x65, 0x2b, 0x41, 0x50, + 0x4b, 0x30, 0x30, 0x6d, 0x78, 0x71, 0x72, 0x69, 0x43, 0x5a, 0x37, 0x56, + 0x71, 0x4b, 0x43, 0x68, 0x68, 0x2f, 0x72, 0x4e, 0x59, 0x6d, 0x44, 0x66, + 0x31, 0x2b, 0x75, 0x0a, 0x4b, 0x55, 0x34, 0x39, 0x74, 0x6d, 0x37, 0x73, + 0x72, 0x73, 0x48, 0x77, 0x4a, 0x35, 0x75, 0x75, 0x34, 0x2f, 0x54, 0x73, + 0x37, 0x36, 0x35, 0x2f, 0x39, 0x34, 0x59, 0x39, 0x63, 0x6e, 0x72, 0x72, + 0x70, 0x66, 0x74, 0x5a, 0x54, 0x71, 0x66, 0x72, 0x6c, 0x59, 0x77, 0x69, + 0x4f, 0x58, 0x6e, 0x68, 0x4c, 0x51, 0x69, 0x50, 0x7a, 0x4c, 0x79, 0x52, + 0x75, 0x45, 0x48, 0x33, 0x46, 0x4d, 0x45, 0x6a, 0x0a, 0x71, 0x63, 0x4f, + 0x74, 0x6d, 0x6b, 0x56, 0x45, 0x73, 0x37, 0x4c, 0x58, 0x4c, 0x4d, 0x33, + 0x47, 0x4b, 0x65, 0x4a, 0x51, 0x45, 0x4b, 0x35, 0x63, 0x79, 0x34, 0x4b, + 0x4f, 0x46, 0x78, 0x67, 0x32, 0x66, 0x5a, 0x66, 0x6d, 0x69, 0x4a, 0x71, + 0x77, 0x54, 0x54, 0x51, 0x4a, 0x39, 0x43, 0x79, 0x35, 0x57, 0x6d, 0x59, + 0x71, 0x73, 0x42, 0x65, 0x62, 0x6e, 0x68, 0x35, 0x32, 0x6e, 0x55, 0x70, + 0x6d, 0x0a, 0x4d, 0x55, 0x48, 0x66, 0x50, 0x2f, 0x76, 0x46, 0x42, 0x75, + 0x38, 0x62, 0x74, 0x6e, 0x34, 0x61, 0x52, 0x6a, 0x62, 0x33, 0x5a, 0x47, + 0x4d, 0x37, 0x34, 0x7a, 0x6b, 0x59, 0x49, 0x2b, 0x64, 0x6e, 0x64, 0x52, + 0x54, 0x56, 0x64, 0x56, 0x65, 0x53, 0x4e, 0x37, 0x32, 0x2b, 0x61, 0x68, + 0x73, 0x6d, 0x55, 0x50, 0x49, 0x32, 0x4a, 0x67, 0x61, 0x51, 0x78, 0x58, + 0x41, 0x42, 0x5a, 0x47, 0x31, 0x32, 0x0a, 0x5a, 0x75, 0x47, 0x52, 0x32, + 0x32, 0x34, 0x48, 0x77, 0x47, 0x47, 0x41, 0x4c, 0x72, 0x49, 0x75, 0x4c, + 0x34, 0x78, 0x77, 0x70, 0x39, 0x45, 0x37, 0x50, 0x4c, 0x4f, 0x52, 0x35, + 0x47, 0x36, 0x32, 0x78, 0x44, 0x74, 0x77, 0x38, 0x6d, 0x79, 0x53, 0x6c, + 0x77, 0x6e, 0x4e, 0x52, 0x33, 0x30, 0x59, 0x77, 0x50, 0x4f, 0x37, 0x6e, + 0x67, 0x2f, 0x57, 0x69, 0x36, 0x34, 0x48, 0x74, 0x6c, 0x6f, 0x50, 0x0a, + 0x7a, 0x67, 0x73, 0x4d, 0x52, 0x36, 0x66, 0x6c, 0x50, 0x72, 0x69, 0x39, + 0x66, 0x63, 0x65, 0x62, 0x4e, 0x61, 0x42, 0x68, 0x6c, 0x7a, 0x70, 0x42, + 0x64, 0x52, 0x66, 0x4d, 0x4b, 0x35, 0x5a, 0x33, 0x4b, 0x70, 0x49, 0x68, + 0x48, 0x74, 0x6d, 0x56, 0x64, 0x69, 0x42, 0x6e, 0x61, 0x4d, 0x38, 0x4e, + 0x76, 0x64, 0x2f, 0x57, 0x48, 0x77, 0x6c, 0x71, 0x6d, 0x75, 0x4c, 0x4d, + 0x63, 0x33, 0x47, 0x6b, 0x0a, 0x4c, 0x33, 0x30, 0x53, 0x67, 0x4c, 0x64, + 0x54, 0x4d, 0x45, 0x5a, 0x65, 0x53, 0x31, 0x53, 0x5a, 0x44, 0x32, 0x66, + 0x4a, 0x70, 0x63, 0x6a, 0x79, 0x49, 0x4d, 0x47, 0x43, 0x37, 0x4a, 0x30, + 0x52, 0x33, 0x38, 0x49, 0x43, 0x2b, 0x78, 0x6f, 0x37, 0x30, 0x65, 0x30, + 0x67, 0x6d, 0x75, 0x39, 0x6c, 0x5a, 0x4a, 0x49, 0x51, 0x44, 0x53, 0x72, + 0x69, 0x33, 0x6e, 0x44, 0x78, 0x47, 0x47, 0x65, 0x43, 0x0a, 0x6a, 0x47, + 0x48, 0x65, 0x75, 0x4c, 0x7a, 0x52, 0x4c, 0x35, 0x7a, 0x37, 0x44, 0x39, + 0x41, 0x72, 0x37, 0x52, 0x74, 0x32, 0x75, 0x65, 0x51, 0x35, 0x56, 0x66, + 0x6a, 0x34, 0x6f, 0x52, 0x32, 0x34, 0x71, 0x6f, 0x41, 0x41, 0x54, 0x49, + 0x4c, 0x6e, 0x73, 0x6e, 0x38, 0x4a, 0x75, 0x4c, 0x77, 0x77, 0x6f, 0x43, + 0x38, 0x4e, 0x39, 0x56, 0x4b, 0x65, 0x6a, 0x76, 0x65, 0x53, 0x73, 0x77, + 0x6f, 0x41, 0x0a, 0x48, 0x51, 0x42, 0x55, 0x6c, 0x77, 0x62, 0x67, 0x73, + 0x51, 0x66, 0x5a, 0x78, 0x77, 0x39, 0x63, 0x5a, 0x58, 0x30, 0x38, 0x62, + 0x56, 0x6c, 0x58, 0x35, 0x4f, 0x32, 0x6c, 0x6a, 0x65, 0x6c, 0x41, 0x55, + 0x35, 0x38, 0x56, 0x53, 0x36, 0x42, 0x78, 0x39, 0x68, 0x6f, 0x68, 0x34, + 0x39, 0x70, 0x77, 0x42, 0x69, 0x46, 0x59, 0x46, 0x49, 0x65, 0x46, 0x64, + 0x33, 0x6d, 0x71, 0x67, 0x6e, 0x6b, 0x43, 0x0a, 0x41, 0x77, 0x45, 0x41, + 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, 0x77, 0x48, 0x51, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4f, 0x4c, 0x4a, + 0x51, 0x4a, 0x39, 0x4e, 0x7a, 0x75, 0x69, 0x61, 0x6f, 0x58, 0x7a, 0x50, + 0x44, 0x6a, 0x39, 0x6c, 0x78, 0x53, 0x6d, 0x49, 0x61, 0x68, 0x6c, 0x52, + 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, + 0x0a, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, 0x4d, 0x41, 0x30, + 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, + 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, 0x51, 0x44, + 0x52, 0x53, 0x56, 0x66, 0x67, 0x0a, 0x70, 0x38, 0x78, 0x6f, 0x57, 0x4c, + 0x6f, 0x42, 0x44, 0x79, 0x73, 0x5a, 0x7a, 0x59, 0x32, 0x77, 0x59, 0x55, + 0x57, 0x73, 0x45, 0x65, 0x31, 0x6a, 0x55, 0x47, 0x6e, 0x34, 0x48, 0x33, + 0x2b, 0x2b, 0x46, 0x6f, 0x2f, 0x39, 0x6e, 0x65, 0x73, 0x4c, 0x71, 0x6a, + 0x4a, 0x48, 0x64, 0x74, 0x4a, 0x6e, 0x4a, 0x4f, 0x32, 0x39, 0x66, 0x44, + 0x4d, 0x79, 0x6c, 0x79, 0x72, 0x48, 0x42, 0x59, 0x5a, 0x6d, 0x0a, 0x44, + 0x52, 0x64, 0x39, 0x46, 0x42, 0x55, 0x62, 0x31, 0x4f, 0x76, 0x39, 0x48, + 0x35, 0x72, 0x32, 0x58, 0x70, 0x64, 0x70, 0x74, 0x78, 0x6f, 0x6c, 0x70, + 0x41, 0x71, 0x7a, 0x6b, 0x54, 0x39, 0x66, 0x4e, 0x71, 0x79, 0x4c, 0x37, + 0x46, 0x65, 0x6f, 0x50, 0x75, 0x65, 0x42, 0x69, 0x68, 0x68, 0x58, 0x4f, + 0x59, 0x56, 0x30, 0x47, 0x6b, 0x4c, 0x48, 0x36, 0x56, 0x73, 0x54, 0x58, + 0x34, 0x2f, 0x35, 0x0a, 0x43, 0x4f, 0x6d, 0x53, 0x64, 0x49, 0x33, 0x31, + 0x52, 0x39, 0x4b, 0x72, 0x4f, 0x39, 0x62, 0x37, 0x65, 0x47, 0x5a, 0x4f, + 0x4e, 0x6e, 0x33, 0x35, 0x36, 0x5a, 0x4c, 0x70, 0x42, 0x4e, 0x37, 0x39, + 0x53, 0x57, 0x50, 0x38, 0x62, 0x66, 0x73, 0x55, 0x63, 0x5a, 0x4e, 0x6e, + 0x4c, 0x30, 0x64, 0x4b, 0x74, 0x37, 0x6e, 0x2f, 0x48, 0x69, 0x70, 0x7a, + 0x63, 0x45, 0x59, 0x77, 0x76, 0x31, 0x72, 0x79, 0x0a, 0x4c, 0x33, 0x6d, + 0x6c, 0x34, 0x59, 0x30, 0x4d, 0x32, 0x66, 0x6d, 0x79, 0x59, 0x7a, 0x65, + 0x4d, 0x4e, 0x32, 0x57, 0x46, 0x63, 0x47, 0x70, 0x63, 0x57, 0x77, 0x6c, + 0x79, 0x75, 0x61, 0x31, 0x6a, 0x50, 0x4c, 0x48, 0x64, 0x2b, 0x50, 0x77, + 0x79, 0x76, 0x7a, 0x65, 0x47, 0x35, 0x4c, 0x75, 0x4f, 0x6d, 0x43, 0x64, + 0x2b, 0x75, 0x68, 0x38, 0x57, 0x34, 0x58, 0x41, 0x52, 0x38, 0x67, 0x50, + 0x66, 0x0a, 0x4a, 0x57, 0x49, 0x79, 0x4a, 0x79, 0x59, 0x59, 0x4d, 0x6f, + 0x53, 0x66, 0x2f, 0x77, 0x41, 0x36, 0x45, 0x37, 0x71, 0x61, 0x54, 0x66, + 0x52, 0x50, 0x75, 0x42, 0x52, 0x77, 0x49, 0x72, 0x48, 0x4b, 0x4b, 0x35, + 0x44, 0x4f, 0x4b, 0x63, 0x46, 0x77, 0x39, 0x43, 0x2b, 0x64, 0x66, 0x2f, + 0x4b, 0x51, 0x48, 0x74, 0x5a, 0x61, 0x33, 0x37, 0x64, 0x47, 0x2f, 0x4f, + 0x61, 0x47, 0x2b, 0x73, 0x76, 0x67, 0x0a, 0x49, 0x48, 0x5a, 0x36, 0x75, + 0x71, 0x62, 0x4c, 0x39, 0x58, 0x7a, 0x65, 0x59, 0x71, 0x57, 0x78, 0x69, + 0x2b, 0x37, 0x65, 0x67, 0x6d, 0x61, 0x4b, 0x54, 0x6a, 0x6f, 0x77, 0x48, + 0x7a, 0x2b, 0x41, 0x79, 0x36, 0x30, 0x6e, 0x75, 0x67, 0x78, 0x65, 0x31, + 0x39, 0x43, 0x78, 0x56, 0x73, 0x70, 0x33, 0x63, 0x62, 0x4b, 0x31, 0x64, + 0x61, 0x46, 0x51, 0x71, 0x55, 0x42, 0x44, 0x46, 0x38, 0x49, 0x6f, 0x0a, + 0x32, 0x63, 0x39, 0x53, 0x69, 0x31, 0x76, 0x49, 0x59, 0x39, 0x52, 0x43, + 0x50, 0x71, 0x41, 0x7a, 0x65, 0x6b, 0x59, 0x75, 0x39, 0x77, 0x6f, 0x67, + 0x52, 0x6c, 0x52, 0x2b, 0x61, 0x6b, 0x38, 0x78, 0x38, 0x59, 0x46, 0x2b, + 0x51, 0x6e, 0x51, 0x34, 0x5a, 0x58, 0x4d, 0x6e, 0x37, 0x73, 0x5a, 0x38, + 0x75, 0x49, 0x37, 0x58, 0x70, 0x54, 0x72, 0x58, 0x6d, 0x4b, 0x47, 0x63, + 0x6a, 0x42, 0x42, 0x56, 0x0a, 0x30, 0x39, 0x74, 0x4c, 0x37, 0x45, 0x43, + 0x51, 0x38, 0x73, 0x31, 0x75, 0x56, 0x39, 0x4a, 0x69, 0x44, 0x6e, 0x78, + 0x58, 0x6b, 0x37, 0x47, 0x6e, 0x62, 0x63, 0x32, 0x64, 0x67, 0x37, 0x73, + 0x71, 0x35, 0x2b, 0x57, 0x32, 0x4f, 0x33, 0x46, 0x59, 0x72, 0x66, 0x33, + 0x52, 0x52, 0x62, 0x78, 0x61, 0x6b, 0x65, 0x35, 0x54, 0x46, 0x57, 0x2f, + 0x54, 0x52, 0x51, 0x6c, 0x31, 0x62, 0x72, 0x71, 0x51, 0x0a, 0x58, 0x52, + 0x34, 0x45, 0x7a, 0x7a, 0x66, 0x66, 0x48, 0x71, 0x68, 0x6d, 0x73, 0x59, + 0x7a, 0x6d, 0x49, 0x47, 0x72, 0x76, 0x2f, 0x45, 0x68, 0x4f, 0x64, 0x4a, + 0x68, 0x43, 0x72, 0x79, 0x6c, 0x76, 0x4c, 0x6d, 0x72, 0x48, 0x2b, 0x33, + 0x33, 0x52, 0x5a, 0x6a, 0x45, 0x69, 0x7a, 0x49, 0x59, 0x41, 0x66, 0x6d, + 0x61, 0x44, 0x44, 0x45, 0x4c, 0x30, 0x76, 0x54, 0x53, 0x53, 0x77, 0x78, + 0x72, 0x71, 0x0a, 0x54, 0x38, 0x70, 0x2b, 0x63, 0x6b, 0x30, 0x4c, 0x63, + 0x49, 0x79, 0x6d, 0x53, 0x4c, 0x75, 0x6d, 0x6f, 0x52, 0x54, 0x32, 0x2b, + 0x31, 0x68, 0x45, 0x6d, 0x52, 0x53, 0x75, 0x71, 0x67, 0x75, 0x54, 0x61, + 0x61, 0x41, 0x70, 0x4a, 0x55, 0x71, 0x6c, 0x79, 0x79, 0x76, 0x64, 0x69, + 0x6d, 0x59, 0x48, 0x46, 0x6e, 0x67, 0x56, 0x56, 0x33, 0x45, 0x62, 0x37, + 0x50, 0x56, 0x48, 0x68, 0x50, 0x4f, 0x65, 0x0a, 0x4d, 0x54, 0x64, 0x36, + 0x31, 0x58, 0x38, 0x6b, 0x72, 0x65, 0x53, 0x38, 0x2f, 0x66, 0x33, 0x4d, + 0x62, 0x6f, 0x50, 0x6f, 0x44, 0x4b, 0x69, 0x33, 0x51, 0x57, 0x77, 0x48, + 0x33, 0x62, 0x30, 0x38, 0x68, 0x70, 0x63, 0x76, 0x30, 0x67, 0x3d, 0x3d, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, + 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x65, 0x72, 0x74, 0x20, 0x43, + 0x41, 0x2d, 0x31, 0x20, 0x4f, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, + 0x6f, 0x72, 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x53, + 0x2e, 0x20, 0x64, 0x65, 0x20, 0x52, 0x2e, 0x4c, 0x2e, 0x20, 0x4f, 0x55, + 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, + 0x65, 0x72, 0x74, 0x20, 0x43, 0x41, 0x2d, 0x31, 0x20, 0x4f, 0x3d, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x73, 0x20, 0x53, 0x2e, 0x20, 0x64, 0x65, 0x20, 0x52, 0x2e, + 0x4c, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, + 0x6f, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x43, 0x65, 0x72, 0x74, 0x20, 0x43, 0x41, 0x2d, 0x31, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x35, 0x37, + 0x35, 0x32, 0x34, 0x34, 0x34, 0x30, 0x39, 0x35, 0x38, 0x31, 0x31, 0x30, + 0x30, 0x36, 0x34, 0x38, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x36, 0x65, 0x3a, 0x38, 0x35, 0x3a, 0x66, 0x31, 0x3a, 0x64, 0x63, + 0x3a, 0x31, 0x61, 0x3a, 0x30, 0x30, 0x3a, 0x64, 0x33, 0x3a, 0x32, 0x32, + 0x3a, 0x64, 0x35, 0x3a, 0x62, 0x32, 0x3a, 0x62, 0x32, 0x3a, 0x61, 0x63, + 0x3a, 0x36, 0x62, 0x3a, 0x33, 0x37, 0x3a, 0x30, 0x35, 0x3a, 0x34, 0x35, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x66, 0x66, 0x3a, + 0x62, 0x64, 0x3a, 0x63, 0x64, 0x3a, 0x65, 0x37, 0x3a, 0x38, 0x32, 0x3a, + 0x63, 0x38, 0x3a, 0x34, 0x33, 0x3a, 0x35, 0x65, 0x3a, 0x33, 0x63, 0x3a, + 0x36, 0x66, 0x3a, 0x32, 0x36, 0x3a, 0x38, 0x36, 0x3a, 0x35, 0x63, 0x3a, + 0x63, 0x61, 0x3a, 0x61, 0x38, 0x3a, 0x33, 0x61, 0x3a, 0x34, 0x35, 0x3a, + 0x35, 0x62, 0x3a, 0x63, 0x33, 0x3a, 0x30, 0x61, 0x0a, 0x23, 0x20, 0x53, + 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x34, 0x3a, 0x30, 0x65, + 0x3a, 0x39, 0x63, 0x3a, 0x38, 0x36, 0x3a, 0x63, 0x64, 0x3a, 0x38, 0x66, + 0x3a, 0x65, 0x34, 0x3a, 0x36, 0x38, 0x3a, 0x63, 0x31, 0x3a, 0x37, 0x37, + 0x3a, 0x36, 0x39, 0x3a, 0x35, 0x39, 0x3a, 0x66, 0x34, 0x3a, 0x39, 0x65, + 0x3a, 0x61, 0x37, 0x3a, 0x37, 0x34, 0x3a, 0x66, 0x61, 0x3a, 0x35, 0x34, + 0x3a, 0x38, 0x36, 0x3a, 0x38, 0x34, 0x3a, 0x62, 0x36, 0x3a, 0x63, 0x34, + 0x3a, 0x30, 0x36, 0x3a, 0x66, 0x33, 0x3a, 0x39, 0x30, 0x3a, 0x39, 0x32, + 0x3a, 0x36, 0x31, 0x3a, 0x66, 0x34, 0x3a, 0x64, 0x63, 0x3a, 0x65, 0x32, + 0x3a, 0x35, 0x37, 0x3a, 0x35, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, + 0x49, 0x49, 0x45, 0x4d, 0x44, 0x43, 0x43, 0x41, 0x78, 0x69, 0x67, 0x41, + 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a, 0x41, 0x4e, 0x71, 0x62, 0x37, + 0x48, 0x48, 0x7a, 0x41, 0x37, 0x41, 0x5a, 0x4d, 0x41, 0x30, 0x47, 0x43, + 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, + 0x77, 0x55, 0x41, 0x4d, 0x49, 0x47, 0x6b, 0x4d, 0x51, 0x73, 0x77, 0x43, + 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x51, + 0x51, 0x54, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x43, 0x41, 0x77, 0x47, 0x55, 0x47, 0x46, 0x75, 0x59, 0x57, 0x31, 0x68, + 0x4d, 0x52, 0x51, 0x77, 0x45, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, + 0x44, 0x41, 0x74, 0x51, 0x59, 0x57, 0x35, 0x68, 0x62, 0x57, 0x45, 0x67, + 0x51, 0x32, 0x6c, 0x30, 0x65, 0x54, 0x45, 0x6b, 0x0a, 0x4d, 0x43, 0x49, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x62, 0x56, 0x48, 0x4a, + 0x31, 0x63, 0x33, 0x52, 0x44, 0x62, 0x33, 0x49, 0x67, 0x55, 0x33, 0x6c, + 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, 0x54, 0x4c, 0x69, 0x42, + 0x6b, 0x5a, 0x53, 0x42, 0x53, 0x4c, 0x6b, 0x77, 0x75, 0x4d, 0x53, 0x63, + 0x77, 0x4a, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x44, 0x42, 0x35, + 0x55, 0x0a, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x45, 0x4e, 0x76, 0x63, 0x69, + 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, + 0x46, 0x30, 0x5a, 0x53, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, + 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x46, 0x6c, 0x52, 0x79, 0x64, 0x58, + 0x4e, 0x30, 0x51, 0x32, 0x39, 0x79, 0x0a, 0x49, 0x46, 0x4a, 0x76, 0x62, + 0x33, 0x52, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4c, + 0x54, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x59, 0x77, 0x4d, + 0x6a, 0x41, 0x30, 0x4d, 0x54, 0x49, 0x7a, 0x4d, 0x6a, 0x45, 0x32, 0x57, + 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x6b, 0x78, 0x4d, 0x6a, 0x4d, 0x78, 0x4d, + 0x54, 0x63, 0x79, 0x4d, 0x7a, 0x45, 0x32, 0x57, 0x6a, 0x43, 0x42, 0x0a, + 0x70, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x42, 0x68, 0x4d, 0x43, 0x55, 0x45, 0x45, 0x78, 0x44, 0x7a, 0x41, 0x4e, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x6c, 0x42, 0x68, + 0x62, 0x6d, 0x46, 0x74, 0x59, 0x54, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x42, 0x77, 0x77, 0x4c, 0x55, 0x47, 0x46, 0x75, + 0x59, 0x57, 0x31, 0x68, 0x0a, 0x49, 0x45, 0x4e, 0x70, 0x64, 0x48, 0x6b, + 0x78, 0x4a, 0x44, 0x41, 0x69, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x4d, 0x47, 0x31, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x51, 0x32, 0x39, + 0x79, 0x49, 0x46, 0x4e, 0x35, 0x63, 0x33, 0x52, 0x6c, 0x62, 0x58, 0x4d, + 0x67, 0x55, 0x79, 0x34, 0x67, 0x5a, 0x47, 0x55, 0x67, 0x55, 0x69, 0x35, + 0x4d, 0x4c, 0x6a, 0x45, 0x6e, 0x4d, 0x43, 0x55, 0x47, 0x0a, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x77, 0x77, 0x65, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, + 0x52, 0x44, 0x62, 0x33, 0x49, 0x67, 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, + 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x55, 0x67, 0x51, 0x58, + 0x56, 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x52, + 0x38, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x44, 0x42, + 0x5a, 0x55, 0x0a, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x45, 0x4e, 0x76, 0x63, + 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x51, 0x32, 0x56, 0x79, 0x64, + 0x43, 0x42, 0x44, 0x51, 0x53, 0x30, 0x78, 0x4d, 0x49, 0x49, 0x42, 0x49, + 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, + 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, + 0x51, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x42, 0x0a, 0x43, 0x67, 0x4b, 0x43, + 0x41, 0x51, 0x45, 0x41, 0x76, 0x34, 0x36, 0x33, 0x6c, 0x65, 0x4c, 0x43, + 0x4a, 0x68, 0x4a, 0x72, 0x4d, 0x78, 0x6e, 0x48, 0x51, 0x46, 0x67, 0x4b, + 0x71, 0x31, 0x6d, 0x71, 0x6a, 0x51, 0x43, 0x6a, 0x2f, 0x49, 0x44, 0x48, + 0x55, 0x48, 0x75, 0x4f, 0x31, 0x43, 0x41, 0x6d, 0x75, 0x6a, 0x49, 0x53, + 0x32, 0x43, 0x4e, 0x55, 0x53, 0x53, 0x55, 0x51, 0x49, 0x70, 0x69, 0x64, + 0x0a, 0x52, 0x74, 0x4c, 0x42, 0x79, 0x5a, 0x35, 0x4f, 0x47, 0x79, 0x34, + 0x73, 0x44, 0x6a, 0x6a, 0x7a, 0x47, 0x69, 0x56, 0x6f, 0x48, 0x4b, 0x5a, + 0x61, 0x42, 0x65, 0x59, 0x65, 0x69, 0x30, 0x69, 0x2f, 0x6d, 0x4a, 0x5a, + 0x30, 0x50, 0x6d, 0x6e, 0x4b, 0x36, 0x62, 0x56, 0x34, 0x70, 0x51, 0x61, + 0x38, 0x31, 0x51, 0x42, 0x65, 0x43, 0x51, 0x72, 0x79, 0x4a, 0x33, 0x70, + 0x53, 0x2f, 0x43, 0x33, 0x56, 0x0a, 0x73, 0x65, 0x71, 0x30, 0x69, 0x57, + 0x45, 0x6b, 0x38, 0x78, 0x6f, 0x54, 0x32, 0x36, 0x6e, 0x50, 0x55, 0x75, + 0x30, 0x4d, 0x4a, 0x4c, 0x71, 0x35, 0x6e, 0x75, 0x78, 0x2b, 0x41, 0x48, + 0x54, 0x36, 0x6b, 0x36, 0x31, 0x73, 0x4b, 0x5a, 0x4b, 0x75, 0x55, 0x62, + 0x53, 0x37, 0x30, 0x31, 0x65, 0x2f, 0x73, 0x2f, 0x4f, 0x6f, 0x6a, 0x5a, + 0x7a, 0x30, 0x4a, 0x45, 0x73, 0x71, 0x31, 0x70, 0x6d, 0x65, 0x0a, 0x39, + 0x4a, 0x37, 0x2b, 0x77, 0x48, 0x35, 0x43, 0x4f, 0x75, 0x63, 0x4c, 0x6c, + 0x56, 0x50, 0x61, 0x74, 0x32, 0x67, 0x4f, 0x6b, 0x45, 0x7a, 0x37, 0x63, + 0x44, 0x2b, 0x50, 0x53, 0x69, 0x79, 0x55, 0x38, 0x79, 0x62, 0x64, 0x59, + 0x32, 0x6d, 0x70, 0x6c, 0x4e, 0x67, 0x51, 0x54, 0x73, 0x56, 0x48, 0x43, + 0x4a, 0x43, 0x5a, 0x47, 0x78, 0x64, 0x4e, 0x75, 0x57, 0x78, 0x75, 0x37, + 0x32, 0x43, 0x56, 0x0a, 0x45, 0x59, 0x34, 0x68, 0x67, 0x4c, 0x57, 0x39, + 0x6f, 0x48, 0x50, 0x59, 0x30, 0x4c, 0x4a, 0x33, 0x78, 0x45, 0x58, 0x71, + 0x57, 0x69, 0x62, 0x37, 0x5a, 0x6e, 0x5a, 0x32, 0x2b, 0x41, 0x59, 0x66, + 0x59, 0x57, 0x30, 0x50, 0x56, 0x63, 0x57, 0x44, 0x74, 0x78, 0x42, 0x57, + 0x63, 0x67, 0x59, 0x48, 0x70, 0x66, 0x4f, 0x78, 0x47, 0x67, 0x4d, 0x46, + 0x5a, 0x41, 0x36, 0x64, 0x57, 0x6f, 0x72, 0x57, 0x0a, 0x68, 0x6e, 0x41, + 0x62, 0x4a, 0x4e, 0x37, 0x2b, 0x4b, 0x49, 0x6f, 0x72, 0x30, 0x47, 0x71, + 0x77, 0x2f, 0x48, 0x71, 0x69, 0x33, 0x4c, 0x4a, 0x35, 0x44, 0x6f, 0x74, + 0x6c, 0x44, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x32, 0x4d, + 0x77, 0x59, 0x54, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, + 0x45, 0x46, 0x67, 0x51, 0x55, 0x37, 0x6d, 0x74, 0x4a, 0x50, 0x48, 0x6f, + 0x2f, 0x0a, 0x44, 0x65, 0x4f, 0x78, 0x43, 0x62, 0x65, 0x4b, 0x79, 0x4b, + 0x73, 0x5a, 0x6e, 0x33, 0x4d, 0x7a, 0x55, 0x4f, 0x63, 0x77, 0x48, 0x77, + 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f, + 0x41, 0x55, 0x37, 0x6d, 0x74, 0x4a, 0x50, 0x48, 0x6f, 0x2f, 0x44, 0x65, + 0x4f, 0x78, 0x43, 0x62, 0x65, 0x4b, 0x79, 0x4b, 0x73, 0x5a, 0x6e, 0x33, + 0x4d, 0x7a, 0x55, 0x4f, 0x63, 0x77, 0x0a, 0x44, 0x77, 0x59, 0x44, 0x56, + 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, + 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, + 0x59, 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, + 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x0a, + 0x67, 0x67, 0x45, 0x42, 0x41, 0x43, 0x55, 0x59, 0x31, 0x4a, 0x47, 0x50, + 0x45, 0x2b, 0x36, 0x50, 0x48, 0x68, 0x30, 0x52, 0x55, 0x39, 0x6f, 0x74, + 0x52, 0x43, 0x6b, 0x5a, 0x6f, 0x42, 0x35, 0x72, 0x4d, 0x5a, 0x35, 0x4e, + 0x44, 0x70, 0x36, 0x74, 0x50, 0x56, 0x78, 0x42, 0x62, 0x35, 0x55, 0x72, + 0x4a, 0x4b, 0x46, 0x35, 0x6d, 0x44, 0x6f, 0x34, 0x4e, 0x76, 0x75, 0x37, + 0x5a, 0x70, 0x35, 0x49, 0x0a, 0x2f, 0x35, 0x43, 0x51, 0x37, 0x7a, 0x33, + 0x55, 0x75, 0x4a, 0x75, 0x30, 0x68, 0x33, 0x55, 0x2f, 0x49, 0x4a, 0x76, + 0x4f, 0x63, 0x73, 0x2b, 0x68, 0x56, 0x63, 0x46, 0x4e, 0x5a, 0x4b, 0x49, + 0x5a, 0x42, 0x71, 0x45, 0x48, 0x4d, 0x77, 0x77, 0x4c, 0x4b, 0x65, 0x58, + 0x78, 0x36, 0x71, 0x75, 0x6a, 0x37, 0x4c, 0x55, 0x4b, 0x64, 0x4a, 0x44, + 0x48, 0x66, 0x58, 0x4c, 0x79, 0x31, 0x31, 0x79, 0x66, 0x0a, 0x6b, 0x65, + 0x2b, 0x52, 0x69, 0x37, 0x66, 0x63, 0x37, 0x57, 0x61, 0x69, 0x7a, 0x34, + 0x35, 0x6d, 0x4f, 0x37, 0x79, 0x66, 0x4f, 0x67, 0x4c, 0x67, 0x4a, 0x39, + 0x30, 0x57, 0x6d, 0x4d, 0x43, 0x56, 0x31, 0x41, 0x71, 0x6b, 0x35, 0x49, + 0x47, 0x61, 0x64, 0x5a, 0x51, 0x31, 0x6e, 0x4a, 0x42, 0x66, 0x69, 0x44, + 0x63, 0x47, 0x72, 0x56, 0x6d, 0x56, 0x43, 0x72, 0x44, 0x52, 0x5a, 0x39, + 0x4d, 0x5a, 0x0a, 0x79, 0x6f, 0x6e, 0x6e, 0x4d, 0x6c, 0x6f, 0x32, 0x48, + 0x44, 0x36, 0x43, 0x71, 0x46, 0x71, 0x54, 0x76, 0x73, 0x62, 0x51, 0x5a, + 0x4a, 0x47, 0x32, 0x7a, 0x39, 0x6d, 0x32, 0x47, 0x4d, 0x2f, 0x62, 0x66, + 0x74, 0x4a, 0x6c, 0x6f, 0x36, 0x62, 0x45, 0x6a, 0x68, 0x63, 0x78, 0x77, + 0x66, 0x74, 0x2b, 0x64, 0x74, 0x76, 0x54, 0x68, 0x65, 0x4e, 0x59, 0x73, + 0x6e, 0x64, 0x36, 0x64, 0x6a, 0x74, 0x73, 0x0a, 0x4c, 0x31, 0x41, 0x63, + 0x35, 0x39, 0x76, 0x32, 0x5a, 0x33, 0x6b, 0x66, 0x39, 0x59, 0x4b, 0x56, + 0x6d, 0x67, 0x65, 0x6e, 0x46, 0x4b, 0x2b, 0x50, 0x33, 0x43, 0x67, 0x68, + 0x5a, 0x77, 0x6e, 0x53, 0x31, 0x6b, 0x31, 0x61, 0x48, 0x42, 0x6b, 0x63, + 0x6a, 0x6e, 0x64, 0x63, 0x77, 0x35, 0x51, 0x6b, 0x50, 0x54, 0x4a, 0x72, + 0x53, 0x33, 0x37, 0x55, 0x65, 0x4a, 0x53, 0x44, 0x76, 0x6a, 0x64, 0x4e, + 0x0a, 0x7a, 0x6c, 0x2f, 0x48, 0x48, 0x6b, 0x34, 0x38, 0x34, 0x49, 0x6b, + 0x7a, 0x6c, 0x51, 0x73, 0x50, 0x70, 0x54, 0x4c, 0x57, 0x50, 0x46, 0x70, + 0x35, 0x4c, 0x42, 0x6b, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, + 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x72, + 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, + 0x65, 0x72, 0x74, 0x20, 0x43, 0x41, 0x2d, 0x32, 0x20, 0x4f, 0x3d, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x73, 0x20, 0x53, 0x2e, 0x20, 0x64, 0x65, 0x20, 0x52, 0x2e, + 0x4c, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, + 0x6f, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x65, 0x72, 0x74, 0x20, 0x43, 0x41, 0x2d, + 0x32, 0x20, 0x4f, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, + 0x20, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x53, 0x2e, 0x20, + 0x64, 0x65, 0x20, 0x52, 0x2e, 0x4c, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x65, 0x72, 0x74, 0x20, 0x43, 0x41, + 0x2d, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x32, 0x37, 0x31, 0x31, 0x36, 0x39, 0x34, 0x35, 0x31, 0x30, + 0x31, 0x39, 0x39, 0x31, 0x30, 0x31, 0x36, 0x39, 0x38, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x32, 0x3a, 0x65, 0x31, 0x3a, 0x66, + 0x38, 0x3a, 0x31, 0x38, 0x3a, 0x30, 0x62, 0x3a, 0x62, 0x61, 0x3a, 0x34, + 0x35, 0x3a, 0x64, 0x35, 0x3a, 0x63, 0x37, 0x3a, 0x34, 0x31, 0x3a, 0x32, + 0x61, 0x3a, 0x62, 0x62, 0x3a, 0x33, 0x37, 0x3a, 0x35, 0x32, 0x3a, 0x34, + 0x35, 0x3a, 0x36, 0x34, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x62, 0x38, 0x3a, 0x62, 0x65, 0x3a, 0x36, 0x64, 0x3a, 0x63, 0x62, + 0x3a, 0x35, 0x36, 0x3a, 0x66, 0x31, 0x3a, 0x35, 0x35, 0x3a, 0x62, 0x39, + 0x3a, 0x36, 0x33, 0x3a, 0x64, 0x34, 0x3a, 0x31, 0x32, 0x3a, 0x63, 0x61, + 0x3a, 0x34, 0x65, 0x3a, 0x30, 0x36, 0x3a, 0x33, 0x34, 0x3a, 0x63, 0x37, + 0x3a, 0x39, 0x34, 0x3a, 0x62, 0x32, 0x3a, 0x31, 0x63, 0x3a, 0x63, 0x30, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x30, + 0x37, 0x3a, 0x35, 0x33, 0x3a, 0x65, 0x39, 0x3a, 0x34, 0x30, 0x3a, 0x33, + 0x37, 0x3a, 0x38, 0x63, 0x3a, 0x31, 0x62, 0x3a, 0x64, 0x35, 0x3a, 0x65, + 0x33, 0x3a, 0x38, 0x33, 0x3a, 0x36, 0x65, 0x3a, 0x33, 0x39, 0x3a, 0x35, + 0x64, 0x3a, 0x61, 0x65, 0x3a, 0x61, 0x35, 0x3a, 0x63, 0x62, 0x3a, 0x38, + 0x33, 0x3a, 0x39, 0x65, 0x3a, 0x35, 0x30, 0x3a, 0x34, 0x36, 0x3a, 0x66, + 0x31, 0x3a, 0x62, 0x64, 0x3a, 0x30, 0x65, 0x3a, 0x61, 0x65, 0x3a, 0x31, + 0x39, 0x3a, 0x35, 0x31, 0x3a, 0x63, 0x66, 0x3a, 0x31, 0x30, 0x3a, 0x66, + 0x65, 0x3a, 0x63, 0x37, 0x3a, 0x63, 0x39, 0x3a, 0x36, 0x35, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x47, 0x4c, 0x7a, 0x43, 0x43, 0x42, + 0x42, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x4a, + 0x61, 0x48, 0x66, 0x79, 0x6a, 0x50, 0x4c, 0x57, 0x51, 0x49, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x67, 0x61, 0x51, 0x78, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59, 0x54, + 0x41, 0x6c, 0x42, 0x42, 0x4d, 0x51, 0x38, 0x77, 0x44, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x49, 0x44, 0x41, 0x5a, 0x51, 0x59, 0x57, 0x35, 0x68, + 0x62, 0x57, 0x45, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x63, 0x4d, 0x43, 0x31, 0x42, 0x68, 0x62, 0x6d, 0x46, 0x74, + 0x59, 0x53, 0x42, 0x44, 0x61, 0x58, 0x52, 0x35, 0x4d, 0x53, 0x51, 0x77, + 0x0a, 0x49, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x74, + 0x55, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x45, 0x4e, 0x76, 0x63, 0x69, 0x42, + 0x54, 0x65, 0x58, 0x4e, 0x30, 0x5a, 0x57, 0x31, 0x7a, 0x49, 0x46, 0x4d, + 0x75, 0x49, 0x47, 0x52, 0x6c, 0x49, 0x46, 0x49, 0x75, 0x54, 0x43, 0x34, + 0x78, 0x4a, 0x7a, 0x41, 0x6c, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, + 0x4d, 0x48, 0x6c, 0x52, 0x79, 0x0a, 0x64, 0x58, 0x4e, 0x30, 0x51, 0x32, + 0x39, 0x79, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, + 0x6c, 0x6a, 0x59, 0x58, 0x52, 0x6c, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, + 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x54, 0x45, 0x66, 0x4d, 0x42, + 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x57, 0x56, 0x48, + 0x4a, 0x31, 0x63, 0x33, 0x52, 0x44, 0x62, 0x33, 0x49, 0x67, 0x0a, 0x55, + 0x6d, 0x39, 0x76, 0x64, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x51, 0x67, 0x51, + 0x30, 0x45, 0x74, 0x4d, 0x6a, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4e, + 0x6a, 0x41, 0x79, 0x4d, 0x44, 0x51, 0x78, 0x4d, 0x6a, 0x4d, 0x79, 0x4d, + 0x6a, 0x4e, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4e, 0x44, 0x45, 0x79, 0x4d, + 0x7a, 0x45, 0x78, 0x4e, 0x7a, 0x49, 0x32, 0x4d, 0x7a, 0x6c, 0x61, 0x4d, + 0x49, 0x47, 0x6b, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x51, 0x51, 0x54, 0x45, 0x50, + 0x4d, 0x41, 0x30, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x41, 0x77, 0x47, + 0x55, 0x47, 0x46, 0x75, 0x59, 0x57, 0x31, 0x68, 0x4d, 0x52, 0x51, 0x77, + 0x45, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, 0x44, 0x41, 0x74, 0x51, + 0x59, 0x57, 0x35, 0x68, 0x62, 0x57, 0x45, 0x67, 0x0a, 0x51, 0x32, 0x6c, + 0x30, 0x65, 0x54, 0x45, 0x6b, 0x4d, 0x43, 0x49, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x67, 0x77, 0x62, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, + 0x44, 0x62, 0x33, 0x49, 0x67, 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, 0x56, + 0x74, 0x63, 0x79, 0x42, 0x54, 0x4c, 0x69, 0x42, 0x6b, 0x5a, 0x53, 0x42, + 0x53, 0x4c, 0x6b, 0x77, 0x75, 0x4d, 0x53, 0x63, 0x77, 0x4a, 0x51, 0x59, + 0x44, 0x0a, 0x56, 0x51, 0x51, 0x4c, 0x44, 0x42, 0x35, 0x55, 0x63, 0x6e, + 0x56, 0x7a, 0x64, 0x45, 0x4e, 0x76, 0x63, 0x69, 0x42, 0x44, 0x5a, 0x58, + 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, 0x5a, 0x53, + 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, + 0x6b, 0x78, 0x48, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x4d, 0x4d, 0x46, 0x6c, 0x52, 0x79, 0x0a, 0x64, 0x58, 0x4e, 0x30, 0x51, + 0x32, 0x39, 0x79, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x52, 0x44, 0x5a, + 0x58, 0x4a, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x4c, 0x54, 0x49, 0x77, 0x67, + 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, + 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x0a, + 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x6e, 0x49, 0x47, 0x37, 0x43, + 0x4b, 0x71, 0x4a, 0x69, 0x4a, 0x4a, 0x57, 0x51, 0x64, 0x73, 0x67, 0x34, + 0x66, 0x6f, 0x44, 0x53, 0x71, 0x38, 0x47, 0x62, 0x5a, 0x51, 0x57, 0x55, + 0x39, 0x4d, 0x45, 0x4b, 0x45, 0x4e, 0x55, 0x43, 0x72, 0x4f, 0x32, 0x66, + 0x6b, 0x38, 0x65, 0x48, 0x79, 0x4c, 0x41, 0x6e, 0x4b, 0x30, 0x49, 0x4d, + 0x50, 0x51, 0x6f, 0x2b, 0x0a, 0x51, 0x56, 0x71, 0x65, 0x64, 0x64, 0x32, + 0x4e, 0x79, 0x75, 0x43, 0x62, 0x37, 0x47, 0x67, 0x79, 0x70, 0x47, 0x6d, + 0x53, 0x61, 0x49, 0x77, 0x4c, 0x67, 0x51, 0x35, 0x57, 0x6f, 0x44, 0x34, + 0x61, 0x33, 0x53, 0x77, 0x6c, 0x46, 0x49, 0x49, 0x76, 0x6c, 0x39, 0x4e, + 0x6b, 0x52, 0x76, 0x52, 0x55, 0x71, 0x64, 0x77, 0x36, 0x56, 0x43, 0x30, + 0x78, 0x4b, 0x35, 0x6d, 0x43, 0x38, 0x74, 0x6b, 0x71, 0x0a, 0x31, 0x2b, + 0x39, 0x78, 0x41, 0x4c, 0x67, 0x78, 0x70, 0x4c, 0x35, 0x36, 0x4a, 0x41, + 0x66, 0x44, 0x51, 0x69, 0x44, 0x79, 0x69, 0x74, 0x53, 0x53, 0x42, 0x42, + 0x74, 0x6c, 0x56, 0x6b, 0x78, 0x73, 0x31, 0x50, 0x75, 0x32, 0x59, 0x56, + 0x70, 0x48, 0x49, 0x37, 0x54, 0x59, 0x61, 0x62, 0x53, 0x33, 0x4f, 0x74, + 0x42, 0x30, 0x50, 0x41, 0x78, 0x31, 0x6f, 0x59, 0x78, 0x4f, 0x64, 0x71, + 0x48, 0x70, 0x0a, 0x32, 0x79, 0x71, 0x6c, 0x4f, 0x2f, 0x72, 0x4f, 0x73, + 0x50, 0x39, 0x2b, 0x61, 0x69, 0x6a, 0x39, 0x4a, 0x78, 0x7a, 0x49, 0x73, + 0x65, 0x6b, 0x70, 0x38, 0x56, 0x64, 0x75, 0x5a, 0x4c, 0x54, 0x51, 0x77, + 0x52, 0x56, 0x74, 0x44, 0x72, 0x34, 0x75, 0x44, 0x6b, 0x62, 0x49, 0x58, + 0x76, 0x52, 0x52, 0x2f, 0x75, 0x38, 0x4f, 0x59, 0x7a, 0x6f, 0x37, 0x63, + 0x62, 0x72, 0x50, 0x62, 0x31, 0x6e, 0x4b, 0x0a, 0x44, 0x4f, 0x4f, 0x62, + 0x58, 0x55, 0x6d, 0x34, 0x54, 0x4f, 0x4a, 0x58, 0x73, 0x5a, 0x69, 0x4b, + 0x51, 0x6c, 0x65, 0x63, 0x64, 0x75, 0x2f, 0x76, 0x76, 0x64, 0x46, 0x6f, + 0x71, 0x4e, 0x4c, 0x30, 0x43, 0x62, 0x74, 0x33, 0x4e, 0x62, 0x34, 0x6c, + 0x67, 0x67, 0x6a, 0x45, 0x46, 0x69, 0x78, 0x45, 0x49, 0x46, 0x61, 0x70, + 0x52, 0x42, 0x46, 0x33, 0x37, 0x31, 0x32, 0x30, 0x48, 0x61, 0x70, 0x65, + 0x0a, 0x61, 0x7a, 0x36, 0x4c, 0x4d, 0x76, 0x59, 0x48, 0x4c, 0x31, 0x63, + 0x45, 0x6b, 0x73, 0x72, 0x31, 0x2f, 0x70, 0x33, 0x43, 0x36, 0x65, 0x69, + 0x7a, 0x6a, 0x6b, 0x78, 0x4c, 0x41, 0x6a, 0x48, 0x5a, 0x35, 0x44, 0x78, + 0x49, 0x67, 0x69, 0x66, 0x33, 0x47, 0x49, 0x4a, 0x32, 0x53, 0x44, 0x70, + 0x78, 0x73, 0x52, 0x4f, 0x68, 0x4f, 0x64, 0x55, 0x75, 0x78, 0x54, 0x54, + 0x43, 0x48, 0x57, 0x4b, 0x46, 0x0a, 0x33, 0x77, 0x50, 0x2b, 0x54, 0x66, + 0x53, 0x76, 0x50, 0x64, 0x39, 0x63, 0x57, 0x34, 0x33, 0x36, 0x63, 0x4f, + 0x47, 0x6c, 0x66, 0x69, 0x66, 0x48, 0x68, 0x69, 0x35, 0x71, 0x6a, 0x78, + 0x4c, 0x47, 0x68, 0x46, 0x35, 0x44, 0x55, 0x56, 0x43, 0x63, 0x47, 0x5a, + 0x74, 0x34, 0x35, 0x76, 0x7a, 0x32, 0x37, 0x55, 0x64, 0x2b, 0x65, 0x7a, + 0x31, 0x6d, 0x37, 0x78, 0x4d, 0x54, 0x69, 0x46, 0x38, 0x38, 0x0a, 0x6f, + 0x57, 0x50, 0x37, 0x2b, 0x61, 0x79, 0x48, 0x4e, 0x5a, 0x2f, 0x7a, 0x67, + 0x70, 0x36, 0x6b, 0x50, 0x77, 0x71, 0x63, 0x4d, 0x57, 0x6d, 0x4c, 0x6d, + 0x61, 0x53, 0x49, 0x53, 0x6f, 0x35, 0x75, 0x5a, 0x6b, 0x33, 0x76, 0x46, + 0x73, 0x51, 0x50, 0x65, 0x53, 0x67, 0x68, 0x59, 0x41, 0x32, 0x46, 0x46, + 0x6e, 0x33, 0x58, 0x56, 0x44, 0x6a, 0x78, 0x6b, 0x6c, 0x62, 0x39, 0x74, + 0x54, 0x4e, 0x4d, 0x0a, 0x67, 0x39, 0x7a, 0x58, 0x45, 0x4a, 0x39, 0x4c, + 0x2f, 0x63, 0x62, 0x34, 0x51, 0x72, 0x32, 0x36, 0x66, 0x48, 0x4d, 0x43, + 0x34, 0x50, 0x39, 0x39, 0x7a, 0x56, 0x76, 0x68, 0x31, 0x4b, 0x78, 0x68, + 0x65, 0x31, 0x66, 0x56, 0x53, 0x6e, 0x74, 0x62, 0x31, 0x49, 0x56, 0x59, + 0x4a, 0x31, 0x32, 0x2f, 0x2b, 0x43, 0x74, 0x67, 0x72, 0x4b, 0x41, 0x6d, + 0x72, 0x68, 0x51, 0x68, 0x4a, 0x38, 0x5a, 0x33, 0x0a, 0x6d, 0x6a, 0x4f, + 0x41, 0x50, 0x46, 0x35, 0x47, 0x50, 0x2f, 0x66, 0x44, 0x73, 0x61, 0x4f, + 0x47, 0x4d, 0x38, 0x62, 0x6f, 0x58, 0x67, 0x32, 0x35, 0x4e, 0x53, 0x79, + 0x71, 0x52, 0x73, 0x47, 0x46, 0x41, 0x6e, 0x57, 0x41, 0x6f, 0x4f, 0x73, + 0x6b, 0x2b, 0x78, 0x57, 0x71, 0x35, 0x47, 0x64, 0x2f, 0x62, 0x6e, 0x63, + 0x2f, 0x39, 0x41, 0x53, 0x4b, 0x4c, 0x33, 0x78, 0x37, 0x34, 0x78, 0x64, + 0x68, 0x0a, 0x38, 0x4e, 0x30, 0x4a, 0x71, 0x53, 0x44, 0x49, 0x76, 0x67, + 0x6d, 0x6b, 0x30, 0x48, 0x35, 0x45, 0x77, 0x37, 0x49, 0x77, 0x53, 0x6a, + 0x69, 0x71, 0x71, 0x65, 0x77, 0x59, 0x6d, 0x67, 0x65, 0x43, 0x4b, 0x39, + 0x75, 0x34, 0x6e, 0x42, 0x69, 0x74, 0x32, 0x75, 0x42, 0x47, 0x46, 0x36, + 0x7a, 0x50, 0x58, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x32, + 0x4d, 0x77, 0x59, 0x54, 0x41, 0x64, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, + 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x32, 0x66, 0x34, 0x68, 0x51, + 0x47, 0x36, 0x55, 0x6e, 0x72, 0x79, 0x62, 0x50, 0x5a, 0x78, 0x39, 0x6d, + 0x43, 0x41, 0x5a, 0x35, 0x59, 0x77, 0x77, 0x59, 0x72, 0x49, 0x77, 0x48, + 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, + 0x6f, 0x41, 0x55, 0x32, 0x66, 0x34, 0x68, 0x51, 0x47, 0x36, 0x55, 0x0a, + 0x6e, 0x72, 0x79, 0x62, 0x50, 0x5a, 0x78, 0x39, 0x6d, 0x43, 0x41, 0x5a, + 0x35, 0x59, 0x77, 0x77, 0x59, 0x72, 0x49, 0x77, 0x44, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, + 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, + 0x41, 0x59, 0x59, 0x77, 0x0a, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, + 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, + 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4a, 0x35, 0x46, 0x6e, 0x67, 0x77, + 0x37, 0x74, 0x75, 0x2f, 0x68, 0x4f, 0x73, 0x68, 0x38, 0x30, 0x51, 0x41, + 0x39, 0x7a, 0x2b, 0x4c, 0x71, 0x42, 0x72, 0x57, 0x79, 0x4f, 0x72, 0x73, + 0x47, 0x53, 0x32, 0x68, 0x36, 0x30, 0x43, 0x4f, 0x58, 0x0a, 0x64, 0x4b, + 0x63, 0x73, 0x38, 0x41, 0x6a, 0x59, 0x65, 0x56, 0x72, 0x58, 0x57, 0x6f, + 0x53, 0x4b, 0x32, 0x42, 0x4b, 0x61, 0x47, 0x39, 0x6c, 0x39, 0x58, 0x45, + 0x31, 0x77, 0x78, 0x61, 0x58, 0x35, 0x71, 0x2b, 0x57, 0x6a, 0x69, 0x59, + 0x6e, 0x64, 0x41, 0x66, 0x72, 0x73, 0x33, 0x66, 0x6e, 0x70, 0x6b, 0x70, + 0x66, 0x62, 0x73, 0x45, 0x5a, 0x43, 0x38, 0x39, 0x4e, 0x69, 0x71, 0x70, + 0x58, 0x2b, 0x0a, 0x4d, 0x57, 0x63, 0x55, 0x61, 0x56, 0x69, 0x51, 0x43, + 0x71, 0x6f, 0x4c, 0x37, 0x6a, 0x63, 0x6a, 0x78, 0x31, 0x42, 0x52, 0x74, + 0x50, 0x56, 0x2b, 0x6e, 0x75, 0x4e, 0x37, 0x39, 0x2b, 0x54, 0x4d, 0x51, + 0x6a, 0x49, 0x74, 0x53, 0x51, 0x7a, 0x4c, 0x2f, 0x30, 0x6b, 0x4d, 0x6d, + 0x78, 0x34, 0x30, 0x2f, 0x57, 0x35, 0x75, 0x6c, 0x6f, 0x70, 0x35, 0x41, + 0x37, 0x5a, 0x76, 0x32, 0x77, 0x6e, 0x4c, 0x0a, 0x2f, 0x56, 0x39, 0x6c, + 0x46, 0x44, 0x66, 0x68, 0x4f, 0x50, 0x58, 0x7a, 0x59, 0x52, 0x5a, 0x59, + 0x35, 0x4c, 0x56, 0x74, 0x44, 0x51, 0x73, 0x45, 0x47, 0x7a, 0x39, 0x51, + 0x4c, 0x58, 0x2b, 0x7a, 0x78, 0x33, 0x6f, 0x61, 0x46, 0x6f, 0x42, 0x67, + 0x2b, 0x49, 0x6f, 0x66, 0x36, 0x52, 0x73, 0x71, 0x78, 0x76, 0x6d, 0x36, + 0x41, 0x52, 0x70, 0x70, 0x76, 0x39, 0x4a, 0x59, 0x78, 0x31, 0x52, 0x58, + 0x0a, 0x43, 0x49, 0x2f, 0x68, 0x4f, 0x57, 0x42, 0x33, 0x53, 0x36, 0x78, + 0x5a, 0x68, 0x42, 0x71, 0x49, 0x38, 0x64, 0x33, 0x4c, 0x54, 0x33, 0x6a, + 0x58, 0x35, 0x2b, 0x45, 0x7a, 0x4c, 0x66, 0x7a, 0x75, 0x51, 0x66, 0x6f, + 0x67, 0x73, 0x4c, 0x37, 0x4c, 0x39, 0x7a, 0x69, 0x55, 0x77, 0x4f, 0x48, + 0x51, 0x68, 0x51, 0x2b, 0x37, 0x37, 0x53, 0x78, 0x7a, 0x71, 0x2b, 0x33, + 0x2b, 0x6b, 0x6e, 0x59, 0x61, 0x0a, 0x5a, 0x48, 0x39, 0x62, 0x44, 0x54, + 0x4d, 0x4a, 0x42, 0x7a, 0x4e, 0x37, 0x42, 0x6a, 0x38, 0x52, 0x70, 0x46, + 0x78, 0x77, 0x50, 0x49, 0x58, 0x41, 0x7a, 0x2b, 0x4f, 0x51, 0x71, 0x49, + 0x4e, 0x33, 0x2b, 0x74, 0x76, 0x6d, 0x78, 0x59, 0x78, 0x6f, 0x5a, 0x78, + 0x42, 0x6e, 0x70, 0x56, 0x49, 0x74, 0x38, 0x4d, 0x53, 0x5a, 0x6a, 0x33, + 0x2b, 0x2f, 0x30, 0x57, 0x76, 0x69, 0x74, 0x55, 0x66, 0x57, 0x0a, 0x32, + 0x64, 0x43, 0x46, 0x6d, 0x55, 0x32, 0x55, 0x6d, 0x77, 0x39, 0x4c, 0x6a, + 0x65, 0x34, 0x41, 0x57, 0x6b, 0x63, 0x64, 0x45, 0x51, 0x4f, 0x73, 0x51, + 0x52, 0x69, 0x76, 0x68, 0x37, 0x64, 0x76, 0x44, 0x44, 0x71, 0x50, 0x79, + 0x73, 0x2f, 0x63, 0x41, 0x38, 0x47, 0x69, 0x43, 0x63, 0x6a, 0x6c, 0x2f, + 0x59, 0x42, 0x65, 0x79, 0x47, 0x42, 0x43, 0x41, 0x52, 0x73, 0x61, 0x55, + 0x31, 0x71, 0x37, 0x0a, 0x4e, 0x36, 0x61, 0x33, 0x76, 0x4c, 0x71, 0x45, + 0x36, 0x52, 0x35, 0x73, 0x47, 0x74, 0x52, 0x6b, 0x32, 0x74, 0x52, 0x44, + 0x2f, 0x70, 0x4f, 0x4c, 0x53, 0x2f, 0x49, 0x73, 0x65, 0x52, 0x59, 0x51, + 0x31, 0x4a, 0x4d, 0x4c, 0x69, 0x49, 0x2b, 0x68, 0x32, 0x49, 0x59, 0x55, + 0x52, 0x70, 0x46, 0x48, 0x6d, 0x79, 0x67, 0x6b, 0x37, 0x31, 0x64, 0x53, + 0x54, 0x6c, 0x78, 0x43, 0x6e, 0x4b, 0x72, 0x33, 0x0a, 0x53, 0x65, 0x77, + 0x6e, 0x36, 0x45, 0x41, 0x65, 0x73, 0x36, 0x61, 0x4a, 0x49, 0x6e, 0x4b, + 0x63, 0x39, 0x51, 0x30, 0x7a, 0x74, 0x46, 0x69, 0x6a, 0x4d, 0x44, 0x76, + 0x64, 0x31, 0x47, 0x70, 0x55, 0x6b, 0x37, 0x34, 0x61, 0x54, 0x66, 0x4f, + 0x54, 0x6c, 0x50, 0x66, 0x38, 0x68, 0x41, 0x73, 0x2f, 0x68, 0x43, 0x42, + 0x63, 0x4e, 0x41, 0x4e, 0x45, 0x78, 0x64, 0x71, 0x74, 0x76, 0x41, 0x72, + 0x42, 0x0a, 0x41, 0x73, 0x38, 0x65, 0x35, 0x5a, 0x54, 0x5a, 0x38, 0x34, + 0x35, 0x62, 0x32, 0x45, 0x7a, 0x77, 0x6e, 0x65, 0x78, 0x68, 0x46, 0x37, + 0x73, 0x55, 0x4d, 0x6c, 0x51, 0x4d, 0x41, 0x69, 0x6d, 0x54, 0x48, 0x70, + 0x4b, 0x47, 0x39, 0x6e, 0x2f, 0x76, 0x35, 0x35, 0x49, 0x46, 0x44, 0x6c, + 0x6e, 0x64, 0x6d, 0x51, 0x67, 0x75, 0x4c, 0x76, 0x71, 0x63, 0x41, 0x46, + 0x4c, 0x54, 0x78, 0x57, 0x59, 0x70, 0x0a, 0x35, 0x4b, 0x65, 0x58, 0x52, + 0x4b, 0x51, 0x4f, 0x4b, 0x49, 0x45, 0x54, 0x4e, 0x63, 0x58, 0x32, 0x62, + 0x32, 0x54, 0x6d, 0x51, 0x63, 0x54, 0x56, 0x4c, 0x38, 0x77, 0x30, 0x52, + 0x53, 0x58, 0x50, 0x51, 0x51, 0x43, 0x57, 0x50, 0x55, 0x6f, 0x75, 0x77, + 0x70, 0x61, 0x59, 0x54, 0x30, 0x35, 0x4b, 0x6e, 0x4a, 0x65, 0x33, 0x32, + 0x78, 0x2b, 0x53, 0x4d, 0x73, 0x6a, 0x2f, 0x44, 0x31, 0x46, 0x75, 0x0a, + 0x31, 0x75, 0x77, 0x4a, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x45, 0x43, 0x41, 0x2d, 0x31, 0x20, + 0x4f, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x53, + 0x79, 0x73, 0x74, 0x65, 0x6d, 0x73, 0x20, 0x53, 0x2e, 0x20, 0x64, 0x65, + 0x20, 0x52, 0x2e, 0x4c, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x72, 0x75, + 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, + 0x6f, 0x72, 0x20, 0x45, 0x43, 0x41, 0x2d, 0x31, 0x20, 0x4f, 0x3d, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x53, 0x79, 0x73, 0x74, + 0x65, 0x6d, 0x73, 0x20, 0x53, 0x2e, 0x20, 0x64, 0x65, 0x20, 0x52, 0x2e, + 0x4c, 0x2e, 0x20, 0x4f, 0x55, 0x3d, 0x54, 0x72, 0x75, 0x73, 0x74, 0x43, + 0x6f, 0x72, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x65, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x43, 0x6f, 0x72, 0x20, 0x45, 0x43, 0x41, 0x2d, + 0x31, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x39, 0x35, 0x34, 0x38, 0x32, 0x34, 0x32, 0x39, 0x34, 0x36, 0x39, + 0x38, 0x38, 0x36, 0x32, 0x35, 0x39, 0x38, 0x34, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x37, 0x3a, 0x39, 0x32, 0x3a, 0x32, 0x33, + 0x3a, 0x31, 0x64, 0x3a, 0x30, 0x61, 0x3a, 0x66, 0x35, 0x3a, 0x34, 0x30, + 0x3a, 0x37, 0x63, 0x3a, 0x65, 0x39, 0x3a, 0x65, 0x36, 0x3a, 0x36, 0x62, + 0x3a, 0x39, 0x64, 0x3a, 0x64, 0x38, 0x3a, 0x66, 0x35, 0x3a, 0x65, 0x37, + 0x3a, 0x36, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x35, 0x38, 0x3a, 0x64, 0x31, 0x3a, 0x64, 0x66, 0x3a, 0x39, 0x35, 0x3a, + 0x39, 0x35, 0x3a, 0x36, 0x37, 0x3a, 0x36, 0x62, 0x3a, 0x36, 0x33, 0x3a, + 0x63, 0x30, 0x3a, 0x66, 0x30, 0x3a, 0x35, 0x62, 0x3a, 0x31, 0x63, 0x3a, + 0x31, 0x37, 0x3a, 0x34, 0x64, 0x3a, 0x38, 0x62, 0x3a, 0x38, 0x34, 0x3a, + 0x30, 0x62, 0x3a, 0x63, 0x38, 0x3a, 0x37, 0x38, 0x3a, 0x62, 0x64, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x61, + 0x3a, 0x38, 0x38, 0x3a, 0x35, 0x64, 0x3a, 0x62, 0x31, 0x3a, 0x39, 0x63, + 0x3a, 0x30, 0x31, 0x3a, 0x64, 0x39, 0x3a, 0x31, 0x32, 0x3a, 0x63, 0x35, + 0x3a, 0x37, 0x35, 0x3a, 0x39, 0x33, 0x3a, 0x38, 0x38, 0x3a, 0x39, 0x33, + 0x3a, 0x38, 0x63, 0x3a, 0x61, 0x66, 0x3a, 0x62, 0x62, 0x3a, 0x64, 0x66, + 0x3a, 0x30, 0x33, 0x3a, 0x31, 0x61, 0x3a, 0x62, 0x32, 0x3a, 0x64, 0x34, + 0x3a, 0x38, 0x65, 0x3a, 0x39, 0x31, 0x3a, 0x65, 0x65, 0x3a, 0x31, 0x35, + 0x3a, 0x35, 0x38, 0x3a, 0x39, 0x62, 0x3a, 0x34, 0x32, 0x3a, 0x39, 0x37, + 0x3a, 0x31, 0x64, 0x3a, 0x30, 0x33, 0x3a, 0x39, 0x63, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x45, 0x49, 0x44, 0x43, 0x43, 0x41, 0x77, + 0x69, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a, 0x41, 0x49, + 0x53, 0x43, 0x4c, 0x46, 0x38, 0x63, 0x59, 0x74, 0x42, 0x41, 0x4d, 0x41, + 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, + 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x4d, 0x49, 0x47, 0x63, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x51, 0x51, 0x54, 0x45, 0x50, 0x4d, 0x41, 0x30, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x41, 0x77, 0x47, 0x55, 0x47, 0x46, 0x75, 0x59, + 0x57, 0x31, 0x68, 0x4d, 0x52, 0x51, 0x77, 0x45, 0x67, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x48, 0x44, 0x41, 0x74, 0x51, 0x59, 0x57, 0x35, 0x68, 0x62, + 0x57, 0x45, 0x67, 0x51, 0x32, 0x6c, 0x30, 0x65, 0x54, 0x45, 0x6b, 0x0a, + 0x4d, 0x43, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x62, + 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, 0x44, 0x62, 0x33, 0x49, 0x67, + 0x55, 0x33, 0x6c, 0x7a, 0x64, 0x47, 0x56, 0x74, 0x63, 0x79, 0x42, 0x54, + 0x4c, 0x69, 0x42, 0x6b, 0x5a, 0x53, 0x42, 0x53, 0x4c, 0x6b, 0x77, 0x75, + 0x4d, 0x53, 0x63, 0x77, 0x4a, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, + 0x44, 0x42, 0x35, 0x55, 0x0a, 0x63, 0x6e, 0x56, 0x7a, 0x64, 0x45, 0x4e, + 0x76, 0x63, 0x69, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x5a, 0x53, 0x42, 0x42, 0x64, 0x58, 0x52, + 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x78, 0x46, 0x7a, 0x41, + 0x56, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x44, 0x6c, 0x52, + 0x79, 0x64, 0x58, 0x4e, 0x30, 0x51, 0x32, 0x39, 0x79, 0x0a, 0x49, 0x45, + 0x56, 0x44, 0x51, 0x53, 0x30, 0x78, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, + 0x45, 0x32, 0x4d, 0x44, 0x49, 0x77, 0x4e, 0x44, 0x45, 0x79, 0x4d, 0x7a, + 0x49, 0x7a, 0x4d, 0x31, 0x6f, 0x58, 0x44, 0x54, 0x49, 0x35, 0x4d, 0x54, + 0x49, 0x7a, 0x4d, 0x54, 0x45, 0x33, 0x4d, 0x6a, 0x67, 0x77, 0x4e, 0x31, + 0x6f, 0x77, 0x67, 0x5a, 0x77, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, + 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x42, 0x42, 0x4d, + 0x51, 0x38, 0x77, 0x44, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x49, 0x44, + 0x41, 0x5a, 0x51, 0x59, 0x57, 0x35, 0x68, 0x62, 0x57, 0x45, 0x78, 0x46, + 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x43, + 0x31, 0x42, 0x68, 0x62, 0x6d, 0x46, 0x74, 0x59, 0x53, 0x42, 0x44, 0x61, + 0x58, 0x52, 0x35, 0x4d, 0x53, 0x51, 0x77, 0x0a, 0x49, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x44, 0x42, 0x74, 0x55, 0x63, 0x6e, 0x56, 0x7a, + 0x64, 0x45, 0x4e, 0x76, 0x63, 0x69, 0x42, 0x54, 0x65, 0x58, 0x4e, 0x30, + 0x5a, 0x57, 0x31, 0x7a, 0x49, 0x46, 0x4d, 0x75, 0x49, 0x47, 0x52, 0x6c, + 0x49, 0x46, 0x49, 0x75, 0x54, 0x43, 0x34, 0x78, 0x4a, 0x7a, 0x41, 0x6c, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x4d, 0x48, 0x6c, 0x52, 0x79, + 0x0a, 0x64, 0x58, 0x4e, 0x30, 0x51, 0x32, 0x39, 0x79, 0x49, 0x45, 0x4e, + 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, 0x52, + 0x6c, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, + 0x30, 0x65, 0x54, 0x45, 0x58, 0x4d, 0x42, 0x55, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x41, 0x77, 0x77, 0x4f, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x52, + 0x44, 0x62, 0x33, 0x49, 0x67, 0x0a, 0x52, 0x55, 0x4e, 0x42, 0x4c, 0x54, + 0x45, 0x77, 0x67, 0x67, 0x45, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x42, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, + 0x45, 0x4b, 0x41, 0x6f, 0x49, 0x42, 0x41, 0x51, 0x44, 0x50, 0x6a, 0x2b, + 0x41, 0x52, 0x74, 0x5a, 0x2b, 0x6f, 0x64, 0x6e, 0x62, 0x62, 0x0a, 0x33, + 0x77, 0x39, 0x55, 0x37, 0x33, 0x4e, 0x6a, 0x4b, 0x59, 0x4b, 0x74, 0x52, + 0x38, 0x61, 0x6a, 0x61, 0x2b, 0x33, 0x2b, 0x58, 0x7a, 0x50, 0x34, 0x51, + 0x31, 0x48, 0x70, 0x47, 0x6a, 0x4f, 0x52, 0x4d, 0x52, 0x65, 0x67, 0x64, + 0x4d, 0x54, 0x55, 0x70, 0x77, 0x48, 0x6d, 0x73, 0x70, 0x49, 0x2b, 0x61, + 0x70, 0x33, 0x74, 0x44, 0x76, 0x6c, 0x30, 0x6d, 0x45, 0x44, 0x54, 0x50, + 0x77, 0x4f, 0x41, 0x0a, 0x42, 0x6f, 0x4a, 0x41, 0x36, 0x4c, 0x48, 0x69, + 0x70, 0x31, 0x47, 0x6e, 0x48, 0x59, 0x4d, 0x6d, 0x61, 0x36, 0x76, 0x65, + 0x2b, 0x68, 0x65, 0x52, 0x4b, 0x39, 0x6a, 0x47, 0x72, 0x42, 0x36, 0x78, + 0x6e, 0x68, 0x6b, 0x42, 0x31, 0x5a, 0x65, 0x6d, 0x36, 0x67, 0x32, 0x33, + 0x78, 0x46, 0x55, 0x66, 0x4a, 0x33, 0x7a, 0x53, 0x43, 0x4e, 0x56, 0x32, + 0x48, 0x79, 0x6b, 0x56, 0x68, 0x30, 0x41, 0x35, 0x0a, 0x33, 0x54, 0x68, + 0x46, 0x45, 0x58, 0x58, 0x51, 0x6d, 0x71, 0x63, 0x30, 0x34, 0x4c, 0x2f, + 0x4e, 0x79, 0x46, 0x49, 0x64, 0x75, 0x55, 0x64, 0x2b, 0x44, 0x62, 0x69, + 0x37, 0x78, 0x67, 0x7a, 0x32, 0x63, 0x31, 0x63, 0x57, 0x57, 0x6e, 0x35, + 0x44, 0x6b, 0x52, 0x39, 0x56, 0x4f, 0x73, 0x5a, 0x74, 0x52, 0x41, 0x53, + 0x71, 0x6e, 0x4b, 0x6d, 0x63, 0x70, 0x30, 0x79, 0x4a, 0x46, 0x34, 0x4f, + 0x75, 0x0a, 0x6f, 0x77, 0x52, 0x65, 0x55, 0x6f, 0x43, 0x4c, 0x48, 0x68, + 0x49, 0x6c, 0x45, 0x52, 0x6e, 0x58, 0x44, 0x48, 0x31, 0x39, 0x4d, 0x55, + 0x52, 0x42, 0x36, 0x74, 0x75, 0x76, 0x73, 0x42, 0x7a, 0x76, 0x67, 0x64, + 0x41, 0x73, 0x78, 0x5a, 0x6f, 0x68, 0x6d, 0x7a, 0x33, 0x74, 0x51, 0x6a, + 0x74, 0x51, 0x4a, 0x76, 0x4c, 0x73, 0x7a, 0x6e, 0x46, 0x68, 0x42, 0x6d, + 0x49, 0x68, 0x56, 0x45, 0x35, 0x2f, 0x0a, 0x77, 0x5a, 0x30, 0x2b, 0x66, + 0x79, 0x43, 0x4d, 0x67, 0x4d, 0x73, 0x71, 0x32, 0x4a, 0x64, 0x69, 0x79, + 0x49, 0x4d, 0x7a, 0x6b, 0x58, 0x32, 0x77, 0x6f, 0x6c, 0x6f, 0x50, 0x56, + 0x2b, 0x67, 0x37, 0x7a, 0x50, 0x49, 0x6c, 0x73, 0x74, 0x52, 0x38, 0x4c, + 0x2b, 0x78, 0x4e, 0x78, 0x71, 0x45, 0x36, 0x46, 0x58, 0x72, 0x6e, 0x74, + 0x6c, 0x30, 0x31, 0x39, 0x66, 0x5a, 0x49, 0x53, 0x6a, 0x5a, 0x46, 0x0a, + 0x5a, 0x74, 0x53, 0x36, 0x6d, 0x46, 0x6a, 0x42, 0x41, 0x67, 0x4d, 0x42, + 0x41, 0x41, 0x47, 0x6a, 0x59, 0x7a, 0x42, 0x68, 0x4d, 0x42, 0x30, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x52, 0x45, + 0x6e, 0x6b, 0x6a, 0x31, 0x7a, 0x47, 0x31, 0x49, 0x31, 0x4b, 0x42, 0x4c, + 0x66, 0x2f, 0x35, 0x5a, 0x4a, 0x43, 0x2b, 0x44, 0x6c, 0x35, 0x6d, 0x61, + 0x68, 0x6a, 0x41, 0x66, 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x4d, + 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, 0x52, 0x45, 0x6e, 0x6b, 0x6a, + 0x31, 0x7a, 0x47, 0x31, 0x49, 0x31, 0x4b, 0x42, 0x4c, 0x66, 0x2f, 0x35, + 0x5a, 0x4a, 0x43, 0x2b, 0x44, 0x6c, 0x35, 0x6d, 0x61, 0x68, 0x6a, 0x41, + 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, + 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x0a, 0x4d, 0x41, + 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, + 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x68, 0x6a, 0x41, 0x4e, 0x42, 0x67, + 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, + 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x45, 0x41, 0x42, 0x54, + 0x34, 0x31, 0x58, 0x42, 0x56, 0x77, 0x6d, 0x38, 0x6e, 0x48, 0x63, 0x32, + 0x46, 0x76, 0x0a, 0x63, 0x69, 0x76, 0x55, 0x77, 0x6f, 0x2f, 0x79, 0x51, + 0x31, 0x30, 0x43, 0x7a, 0x73, 0x53, 0x55, 0x75, 0x5a, 0x51, 0x52, 0x67, + 0x32, 0x64, 0x64, 0x34, 0x6d, 0x64, 0x73, 0x64, 0x58, 0x61, 0x2f, 0x75, + 0x77, 0x79, 0x71, 0x4e, 0x73, 0x61, 0x74, 0x52, 0x35, 0x4e, 0x6a, 0x33, + 0x42, 0x35, 0x2b, 0x31, 0x74, 0x34, 0x75, 0x2f, 0x75, 0x6b, 0x5a, 0x4d, + 0x6a, 0x67, 0x44, 0x66, 0x78, 0x54, 0x32, 0x0a, 0x41, 0x48, 0x4d, 0x73, + 0x57, 0x62, 0x45, 0x68, 0x42, 0x75, 0x48, 0x37, 0x72, 0x42, 0x69, 0x56, + 0x44, 0x4b, 0x50, 0x2f, 0x6d, 0x5a, 0x62, 0x33, 0x4b, 0x79, 0x65, 0x62, + 0x31, 0x53, 0x54, 0x4d, 0x48, 0x64, 0x33, 0x42, 0x4f, 0x75, 0x43, 0x59, + 0x52, 0x4c, 0x44, 0x45, 0x35, 0x44, 0x35, 0x33, 0x73, 0x58, 0x4f, 0x70, + 0x5a, 0x43, 0x7a, 0x32, 0x48, 0x41, 0x46, 0x38, 0x50, 0x31, 0x31, 0x46, + 0x0a, 0x68, 0x63, 0x43, 0x46, 0x35, 0x79, 0x57, 0x50, 0x6c, 0x64, 0x77, + 0x58, 0x38, 0x7a, 0x79, 0x66, 0x47, 0x6d, 0x36, 0x77, 0x79, 0x75, 0x4d, + 0x64, 0x4b, 0x75, 0x6c, 0x4d, 0x59, 0x2f, 0x6f, 0x6b, 0x59, 0x57, 0x4c, + 0x57, 0x32, 0x6e, 0x36, 0x32, 0x48, 0x47, 0x7a, 0x31, 0x41, 0x68, 0x33, + 0x55, 0x4b, 0x74, 0x31, 0x56, 0x6b, 0x4f, 0x73, 0x71, 0x45, 0x55, 0x63, + 0x38, 0x4c, 0x6c, 0x35, 0x30, 0x0a, 0x73, 0x6f, 0x49, 0x69, 0x70, 0x58, + 0x31, 0x54, 0x48, 0x30, 0x58, 0x73, 0x4a, 0x35, 0x46, 0x39, 0x35, 0x79, + 0x49, 0x57, 0x36, 0x4d, 0x42, 0x6f, 0x4e, 0x74, 0x6a, 0x47, 0x38, 0x55, + 0x2b, 0x41, 0x52, 0x44, 0x4c, 0x35, 0x34, 0x64, 0x48, 0x52, 0x48, 0x61, + 0x72, 0x65, 0x71, 0x4b, 0x75, 0x63, 0x42, 0x4b, 0x2b, 0x74, 0x49, 0x41, + 0x35, 0x6b, 0x6d, 0x45, 0x32, 0x6c, 0x61, 0x38, 0x42, 0x49, 0x0a, 0x57, + 0x4a, 0x5a, 0x70, 0x54, 0x64, 0x77, 0x48, 0x6a, 0x46, 0x47, 0x54, 0x6f, + 0x74, 0x2b, 0x66, 0x44, 0x7a, 0x32, 0x4c, 0x59, 0x4c, 0x53, 0x43, 0x6a, + 0x61, 0x6f, 0x49, 0x54, 0x6d, 0x4a, 0x46, 0x34, 0x50, 0x6b, 0x4c, 0x30, + 0x75, 0x44, 0x67, 0x50, 0x46, 0x76, 0x65, 0x58, 0x48, 0x45, 0x6e, 0x4a, + 0x63, 0x4c, 0x6d, 0x41, 0x34, 0x47, 0x4c, 0x45, 0x46, 0x50, 0x6a, 0x78, + 0x31, 0x57, 0x69, 0x0a, 0x74, 0x4a, 0x2f, 0x58, 0x35, 0x67, 0x3d, 0x3d, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, 0x6d, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x52, 0x53, 0x41, 0x20, 0x4f, 0x3d, + 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, + 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, + 0x6d, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, + 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x52, 0x53, 0x41, 0x20, 0x4f, + 0x3d, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, + 0x69, 0x74, 0x79, 0x20, 0x52, 0x53, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x38, 0x37, 0x35, 0x36, + 0x34, 0x30, 0x32, 0x39, 0x36, 0x35, 0x35, 0x38, 0x33, 0x31, 0x30, 0x30, + 0x34, 0x31, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x36, + 0x3a, 0x36, 0x39, 0x3a, 0x31, 0x32, 0x3a, 0x63, 0x30, 0x3a, 0x37, 0x30, + 0x3a, 0x66, 0x31, 0x3a, 0x65, 0x63, 0x3a, 0x61, 0x63, 0x3a, 0x61, 0x63, + 0x3a, 0x63, 0x32, 0x3a, 0x64, 0x35, 0x3a, 0x62, 0x63, 0x3a, 0x61, 0x35, + 0x3a, 0x35, 0x62, 0x3a, 0x61, 0x31, 0x3a, 0x32, 0x39, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x37, 0x3a, 0x61, 0x62, 0x3a, + 0x33, 0x33, 0x3a, 0x30, 0x38, 0x3a, 0x64, 0x31, 0x3a, 0x65, 0x61, 0x3a, + 0x34, 0x34, 0x3a, 0x37, 0x37, 0x3a, 0x62, 0x61, 0x3a, 0x31, 0x34, 0x3a, + 0x38, 0x30, 0x3a, 0x31, 0x32, 0x3a, 0x35, 0x61, 0x3a, 0x36, 0x66, 0x3a, + 0x62, 0x64, 0x3a, 0x61, 0x39, 0x3a, 0x33, 0x36, 0x3a, 0x34, 0x39, 0x3a, + 0x30, 0x63, 0x3a, 0x62, 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x35, 0x3a, 0x36, 0x36, 0x3a, 0x36, 0x61, + 0x3a, 0x35, 0x36, 0x3a, 0x32, 0x65, 0x3a, 0x65, 0x30, 0x3a, 0x62, 0x65, + 0x3a, 0x35, 0x63, 0x3a, 0x65, 0x39, 0x3a, 0x32, 0x35, 0x3a, 0x63, 0x31, + 0x3a, 0x64, 0x38, 0x3a, 0x38, 0x39, 0x3a, 0x30, 0x61, 0x3a, 0x36, 0x66, + 0x3a, 0x37, 0x36, 0x3a, 0x61, 0x38, 0x3a, 0x37, 0x65, 0x3a, 0x63, 0x31, + 0x3a, 0x36, 0x64, 0x3a, 0x34, 0x64, 0x3a, 0x37, 0x64, 0x3a, 0x35, 0x66, + 0x3a, 0x32, 0x39, 0x3a, 0x65, 0x61, 0x3a, 0x37, 0x34, 0x3a, 0x31, 0x39, + 0x3a, 0x63, 0x66, 0x3a, 0x32, 0x30, 0x3a, 0x31, 0x32, 0x3a, 0x33, 0x62, + 0x3a, 0x36, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, + 0x33, 0x54, 0x43, 0x43, 0x41, 0x38, 0x57, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x49, 0x65, 0x79, 0x79, 0x62, 0x30, 0x78, 0x61, 0x41, + 0x4d, 0x70, 0x6b, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, + 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, + 0x66, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x0a, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x44, 0x6a, 0x41, + 0x4d, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, 0x42, 0x56, 0x52, + 0x6c, 0x65, 0x47, 0x46, 0x7a, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x48, 0x44, 0x41, 0x64, 0x49, 0x62, 0x33, 0x56, + 0x7a, 0x64, 0x47, 0x39, 0x75, 0x4d, 0x52, 0x67, 0x77, 0x46, 0x67, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x0a, 0x44, 0x41, 0x39, 0x54, 0x55, 0x30, + 0x77, 0x67, 0x51, 0x32, 0x39, 0x79, 0x63, 0x47, 0x39, 0x79, 0x59, 0x58, + 0x52, 0x70, 0x62, 0x32, 0x34, 0x78, 0x4d, 0x54, 0x41, 0x76, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x4b, 0x46, 0x4e, 0x54, 0x54, 0x43, + 0x35, 0x6a, 0x62, 0x32, 0x30, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, + 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x0a, 0x59, + 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, + 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x53, 0x42, 0x53, 0x55, + 0x30, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x59, 0x77, 0x4d, + 0x6a, 0x45, 0x79, 0x4d, 0x54, 0x63, 0x7a, 0x4f, 0x54, 0x4d, 0x35, 0x57, + 0x68, 0x63, 0x4e, 0x4e, 0x44, 0x45, 0x77, 0x4d, 0x6a, 0x45, 0x79, 0x4d, + 0x54, 0x63, 0x7a, 0x0a, 0x4f, 0x54, 0x4d, 0x35, 0x57, 0x6a, 0x42, 0x38, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x4f, 0x4d, 0x41, 0x77, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x41, 0x77, 0x46, 0x56, 0x47, 0x56, 0x34, + 0x59, 0x58, 0x4d, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x63, 0x4d, 0x42, 0x30, 0x68, 0x76, 0x0a, 0x64, 0x58, 0x4e, + 0x30, 0x62, 0x32, 0x34, 0x78, 0x47, 0x44, 0x41, 0x57, 0x42, 0x67, 0x4e, + 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x31, 0x4e, 0x54, 0x54, 0x43, 0x42, + 0x44, 0x62, 0x33, 0x4a, 0x77, 0x62, 0x33, 0x4a, 0x68, 0x64, 0x47, 0x6c, + 0x76, 0x62, 0x6a, 0x45, 0x78, 0x4d, 0x43, 0x38, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x41, 0x77, 0x77, 0x6f, 0x55, 0x31, 0x4e, 0x4d, 0x4c, 0x6d, 0x4e, + 0x76, 0x0a, 0x62, 0x53, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, 0x59, 0x58, + 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, 0x61, 0x47, + 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x49, 0x46, 0x4a, 0x54, 0x51, 0x54, + 0x43, 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x0a, 0x41, 0x51, 0x45, 0x42, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, + 0x67, 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x50, 0x6b, 0x50, 0x33, + 0x61, 0x4d, 0x72, 0x66, 0x63, 0x76, 0x51, 0x4b, 0x76, 0x37, 0x73, 0x5a, + 0x34, 0x57, 0x6d, 0x35, 0x79, 0x34, 0x62, 0x75, 0x6e, 0x66, 0x68, 0x34, + 0x2f, 0x57, 0x76, 0x70, 0x4f, 0x7a, 0x36, 0x53, 0x6c, 0x32, 0x52, 0x0a, + 0x78, 0x46, 0x64, 0x48, 0x61, 0x78, 0x68, 0x33, 0x61, 0x33, 0x62, 0x79, + 0x2f, 0x5a, 0x50, 0x6b, 0x50, 0x51, 0x2f, 0x43, 0x46, 0x70, 0x34, 0x4c, + 0x5a, 0x73, 0x4e, 0x57, 0x6c, 0x4a, 0x34, 0x58, 0x67, 0x34, 0x58, 0x4f, + 0x56, 0x75, 0x2f, 0x79, 0x46, 0x76, 0x30, 0x41, 0x59, 0x76, 0x55, 0x69, + 0x43, 0x56, 0x54, 0x6f, 0x5a, 0x52, 0x64, 0x4f, 0x51, 0x62, 0x6e, 0x67, + 0x54, 0x30, 0x61, 0x58, 0x0a, 0x71, 0x68, 0x76, 0x49, 0x75, 0x47, 0x35, + 0x69, 0x58, 0x6d, 0x6d, 0x78, 0x58, 0x39, 0x73, 0x71, 0x41, 0x6e, 0x37, + 0x38, 0x62, 0x4d, 0x72, 0x7a, 0x51, 0x64, 0x6a, 0x74, 0x30, 0x4f, 0x6a, + 0x38, 0x50, 0x32, 0x46, 0x49, 0x37, 0x62, 0x41, 0x44, 0x46, 0x42, 0x30, + 0x51, 0x44, 0x6b, 0x73, 0x5a, 0x34, 0x4c, 0x74, 0x4f, 0x37, 0x49, 0x5a, + 0x6c, 0x2f, 0x7a, 0x62, 0x7a, 0x58, 0x6d, 0x63, 0x43, 0x0a, 0x43, 0x35, + 0x32, 0x47, 0x56, 0x57, 0x48, 0x39, 0x65, 0x6a, 0x6a, 0x74, 0x2f, 0x75, + 0x49, 0x5a, 0x41, 0x4c, 0x64, 0x76, 0x6f, 0x56, 0x42, 0x69, 0x64, 0x58, + 0x51, 0x38, 0x6f, 0x50, 0x72, 0x49, 0x4a, 0x5a, 0x4b, 0x30, 0x62, 0x6e, + 0x6f, 0x69, 0x78, 0x2f, 0x67, 0x65, 0x6f, 0x65, 0x4f, 0x79, 0x33, 0x5a, + 0x45, 0x78, 0x71, 0x79, 0x73, 0x64, 0x42, 0x50, 0x2b, 0x6c, 0x53, 0x67, + 0x51, 0x33, 0x0a, 0x36, 0x59, 0x57, 0x6b, 0x4d, 0x79, 0x76, 0x39, 0x34, + 0x74, 0x5a, 0x56, 0x4e, 0x48, 0x77, 0x5a, 0x70, 0x45, 0x70, 0x6f, 0x78, + 0x37, 0x4b, 0x6f, 0x30, 0x37, 0x66, 0x4b, 0x6f, 0x5a, 0x4f, 0x49, 0x36, + 0x38, 0x47, 0x58, 0x76, 0x49, 0x7a, 0x35, 0x48, 0x64, 0x6b, 0x69, 0x68, + 0x43, 0x52, 0x30, 0x78, 0x77, 0x51, 0x39, 0x61, 0x71, 0x6b, 0x70, 0x6b, + 0x38, 0x7a, 0x72, 0x75, 0x46, 0x76, 0x68, 0x0a, 0x2f, 0x6c, 0x38, 0x6c, + 0x71, 0x6a, 0x52, 0x59, 0x79, 0x4d, 0x45, 0x6a, 0x56, 0x4a, 0x30, 0x62, + 0x6d, 0x42, 0x48, 0x44, 0x4f, 0x4a, 0x78, 0x2b, 0x50, 0x59, 0x5a, 0x73, + 0x70, 0x51, 0x39, 0x41, 0x68, 0x6e, 0x77, 0x43, 0x39, 0x46, 0x77, 0x43, + 0x54, 0x79, 0x6a, 0x4c, 0x72, 0x6e, 0x47, 0x66, 0x44, 0x7a, 0x72, 0x49, + 0x4d, 0x2f, 0x34, 0x52, 0x4a, 0x54, 0x58, 0x71, 0x2f, 0x4c, 0x72, 0x46, + 0x0a, 0x59, 0x44, 0x33, 0x5a, 0x66, 0x42, 0x6a, 0x56, 0x73, 0x71, 0x6e, + 0x54, 0x64, 0x58, 0x67, 0x44, 0x63, 0x69, 0x4c, 0x4b, 0x4f, 0x73, 0x4d, + 0x66, 0x37, 0x79, 0x7a, 0x6c, 0x4c, 0x71, 0x6e, 0x36, 0x6e, 0x69, 0x79, + 0x32, 0x55, 0x55, 0x62, 0x39, 0x72, 0x77, 0x50, 0x57, 0x36, 0x6d, 0x42, + 0x6f, 0x36, 0x6f, 0x55, 0x57, 0x4e, 0x6d, 0x75, 0x46, 0x36, 0x52, 0x37, + 0x41, 0x73, 0x39, 0x33, 0x45, 0x0a, 0x4a, 0x4e, 0x79, 0x41, 0x4b, 0x6f, + 0x46, 0x42, 0x62, 0x5a, 0x51, 0x2b, 0x79, 0x4f, 0x44, 0x4a, 0x67, 0x55, + 0x45, 0x41, 0x6e, 0x6c, 0x36, 0x2f, 0x66, 0x38, 0x55, 0x49, 0x6d, 0x4b, + 0x49, 0x59, 0x4c, 0x45, 0x4a, 0x41, 0x73, 0x2f, 0x6c, 0x76, 0x4f, 0x43, + 0x64, 0x4c, 0x54, 0x6f, 0x44, 0x30, 0x50, 0x59, 0x46, 0x48, 0x34, 0x49, + 0x68, 0x38, 0x36, 0x68, 0x7a, 0x4f, 0x74, 0x58, 0x56, 0x63, 0x0a, 0x55, + 0x53, 0x34, 0x63, 0x4b, 0x33, 0x38, 0x61, 0x63, 0x69, 0x6a, 0x6e, 0x41, + 0x4c, 0x58, 0x52, 0x64, 0x4d, 0x62, 0x58, 0x35, 0x4a, 0x2b, 0x74, 0x42, + 0x35, 0x4f, 0x32, 0x55, 0x7a, 0x55, 0x31, 0x2f, 0x44, 0x66, 0x6b, 0x77, + 0x2f, 0x5a, 0x64, 0x46, 0x72, 0x34, 0x68, 0x63, 0x39, 0x36, 0x53, 0x43, + 0x76, 0x69, 0x67, 0x59, 0x32, 0x71, 0x38, 0x6c, 0x70, 0x4a, 0x71, 0x50, + 0x76, 0x69, 0x38, 0x0a, 0x5a, 0x56, 0x57, 0x62, 0x33, 0x76, 0x55, 0x4e, + 0x69, 0x53, 0x59, 0x45, 0x2f, 0x43, 0x55, 0x61, 0x70, 0x69, 0x56, 0x70, + 0x79, 0x38, 0x4a, 0x74, 0x79, 0x6e, 0x7a, 0x69, 0x57, 0x56, 0x2b, 0x58, + 0x72, 0x4f, 0x76, 0x76, 0x4c, 0x73, 0x69, 0x38, 0x31, 0x78, 0x74, 0x5a, + 0x50, 0x43, 0x76, 0x4d, 0x38, 0x68, 0x6e, 0x49, 0x6b, 0x32, 0x73, 0x6e, + 0x59, 0x78, 0x6e, 0x50, 0x2f, 0x4f, 0x6b, 0x6d, 0x0a, 0x2b, 0x4d, 0x70, + 0x78, 0x6d, 0x33, 0x2b, 0x54, 0x2f, 0x6a, 0x52, 0x6e, 0x68, 0x45, 0x36, + 0x5a, 0x36, 0x2f, 0x79, 0x7a, 0x65, 0x41, 0x6b, 0x7a, 0x63, 0x4c, 0x70, + 0x6d, 0x70, 0x6e, 0x62, 0x74, 0x47, 0x33, 0x50, 0x72, 0x47, 0x71, 0x55, + 0x4e, 0x78, 0x43, 0x49, 0x54, 0x49, 0x4a, 0x52, 0x57, 0x43, 0x6b, 0x34, + 0x73, 0x62, 0x45, 0x36, 0x78, 0x2f, 0x63, 0x2b, 0x63, 0x43, 0x62, 0x71, + 0x69, 0x0a, 0x4d, 0x2b, 0x32, 0x48, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, + 0x47, 0x6a, 0x59, 0x7a, 0x42, 0x68, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, + 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, 0x42, 0x42, 0x54, 0x64, 0x42, 0x41, + 0x6b, 0x48, 0x6f, 0x76, 0x56, 0x36, 0x66, 0x56, 0x4a, 0x54, 0x45, 0x70, + 0x4b, 0x56, 0x37, 0x6a, 0x69, 0x41, 0x4a, 0x51, 0x32, 0x6d, 0x57, 0x54, + 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x52, 0x4d, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, + 0x42, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, 0x51, 0x59, 0x4d, + 0x42, 0x61, 0x41, 0x46, 0x4e, 0x30, 0x45, 0x43, 0x51, 0x65, 0x69, 0x39, + 0x58, 0x70, 0x39, 0x55, 0x6c, 0x4d, 0x53, 0x6b, 0x70, 0x58, 0x75, 0x4f, + 0x49, 0x41, 0x6c, 0x44, 0x61, 0x5a, 0x5a, 0x4d, 0x41, 0x34, 0x47, 0x0a, + 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, + 0x41, 0x77, 0x49, 0x42, 0x68, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, + 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, + 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x49, 0x42, 0x67, 0x52, + 0x6c, 0x43, 0x6e, 0x37, 0x4a, 0x70, 0x30, 0x63, 0x48, 0x68, 0x35, 0x77, + 0x59, 0x66, 0x47, 0x56, 0x0a, 0x63, 0x70, 0x4e, 0x78, 0x4a, 0x4b, 0x31, + 0x6f, 0x6b, 0x31, 0x69, 0x4f, 0x4d, 0x71, 0x38, 0x62, 0x73, 0x33, 0x41, + 0x44, 0x2f, 0x43, 0x55, 0x72, 0x64, 0x49, 0x57, 0x51, 0x50, 0x58, 0x68, + 0x71, 0x39, 0x4c, 0x6d, 0x4c, 0x70, 0x5a, 0x63, 0x37, 0x74, 0x52, 0x69, + 0x52, 0x75, 0x78, 0x36, 0x6e, 0x2b, 0x55, 0x42, 0x62, 0x6b, 0x66, 0x6c, + 0x56, 0x6d, 0x61, 0x38, 0x65, 0x45, 0x64, 0x42, 0x63, 0x0a, 0x48, 0x61, + 0x64, 0x6d, 0x34, 0x37, 0x47, 0x55, 0x42, 0x77, 0x77, 0x79, 0x4f, 0x61, + 0x62, 0x71, 0x47, 0x37, 0x42, 0x35, 0x32, 0x42, 0x32, 0x63, 0x63, 0x45, + 0x54, 0x6a, 0x69, 0x74, 0x33, 0x45, 0x2b, 0x5a, 0x55, 0x66, 0x69, 0x6a, + 0x68, 0x44, 0x50, 0x77, 0x47, 0x46, 0x70, 0x55, 0x65, 0x6e, 0x50, 0x55, + 0x61, 0x79, 0x76, 0x4f, 0x55, 0x69, 0x61, 0x50, 0x64, 0x37, 0x6e, 0x4e, + 0x67, 0x73, 0x0a, 0x50, 0x67, 0x6f, 0x68, 0x79, 0x43, 0x30, 0x7a, 0x72, + 0x4c, 0x2f, 0x46, 0x67, 0x5a, 0x6b, 0x78, 0x64, 0x4d, 0x46, 0x31, 0x63, + 0x63, 0x57, 0x2b, 0x73, 0x66, 0x41, 0x6a, 0x52, 0x66, 0x53, 0x64, 0x61, + 0x2f, 0x77, 0x5a, 0x59, 0x35, 0x32, 0x6a, 0x76, 0x41, 0x54, 0x47, 0x47, + 0x41, 0x73, 0x6c, 0x75, 0x31, 0x4f, 0x4a, 0x44, 0x37, 0x4f, 0x41, 0x55, + 0x4e, 0x35, 0x46, 0x37, 0x6b, 0x52, 0x2f, 0x0a, 0x71, 0x35, 0x52, 0x34, + 0x5a, 0x4a, 0x6a, 0x54, 0x39, 0x69, 0x6a, 0x64, 0x68, 0x39, 0x68, 0x77, + 0x5a, 0x58, 0x54, 0x37, 0x44, 0x72, 0x6b, 0x54, 0x36, 0x36, 0x63, 0x50, + 0x59, 0x61, 0x6b, 0x79, 0x6c, 0x73, 0x7a, 0x65, 0x75, 0x2b, 0x31, 0x6a, + 0x54, 0x42, 0x69, 0x37, 0x71, 0x55, 0x44, 0x33, 0x6f, 0x46, 0x52, 0x75, + 0x49, 0x49, 0x68, 0x78, 0x64, 0x52, 0x6a, 0x71, 0x65, 0x72, 0x51, 0x30, + 0x0a, 0x63, 0x75, 0x41, 0x6a, 0x4a, 0x33, 0x64, 0x63, 0x74, 0x70, 0x44, + 0x71, 0x68, 0x69, 0x56, 0x41, 0x71, 0x2b, 0x38, 0x7a, 0x44, 0x38, 0x75, + 0x66, 0x67, 0x72, 0x36, 0x69, 0x49, 0x50, 0x76, 0x32, 0x74, 0x53, 0x30, + 0x61, 0x35, 0x73, 0x4b, 0x46, 0x73, 0x58, 0x51, 0x50, 0x2b, 0x38, 0x68, + 0x6c, 0x41, 0x71, 0x52, 0x53, 0x41, 0x55, 0x66, 0x64, 0x53, 0x53, 0x4c, + 0x42, 0x76, 0x39, 0x6a, 0x72, 0x0a, 0x61, 0x36, 0x78, 0x2b, 0x33, 0x75, + 0x78, 0x6a, 0x4d, 0x78, 0x57, 0x33, 0x49, 0x77, 0x69, 0x50, 0x78, 0x67, + 0x2b, 0x4e, 0x51, 0x56, 0x72, 0x64, 0x6a, 0x73, 0x57, 0x35, 0x6a, 0x2b, + 0x56, 0x46, 0x50, 0x33, 0x6a, 0x62, 0x75, 0x74, 0x49, 0x62, 0x51, 0x4c, + 0x48, 0x2b, 0x63, 0x55, 0x30, 0x2f, 0x34, 0x49, 0x47, 0x69, 0x75, 0x6c, + 0x36, 0x30, 0x37, 0x42, 0x58, 0x67, 0x6b, 0x39, 0x30, 0x49, 0x0a, 0x48, + 0x33, 0x37, 0x68, 0x56, 0x5a, 0x6b, 0x4c, 0x49, 0x64, 0x36, 0x54, 0x6e, + 0x67, 0x72, 0x37, 0x35, 0x71, 0x4e, 0x4a, 0x76, 0x54, 0x59, 0x77, 0x2f, + 0x75, 0x64, 0x33, 0x73, 0x71, 0x42, 0x31, 0x6c, 0x37, 0x55, 0x74, 0x67, + 0x59, 0x67, 0x58, 0x5a, 0x53, 0x44, 0x33, 0x32, 0x70, 0x41, 0x41, 0x6e, + 0x38, 0x6c, 0x53, 0x7a, 0x44, 0x4c, 0x4b, 0x4e, 0x58, 0x7a, 0x31, 0x50, + 0x51, 0x2f, 0x59, 0x0a, 0x4b, 0x39, 0x66, 0x31, 0x4a, 0x6d, 0x7a, 0x4a, + 0x42, 0x6a, 0x53, 0x57, 0x46, 0x75, 0x70, 0x77, 0x57, 0x52, 0x6f, 0x79, + 0x65, 0x58, 0x6b, 0x4c, 0x74, 0x6f, 0x68, 0x2f, 0x44, 0x31, 0x4a, 0x49, + 0x50, 0x62, 0x39, 0x73, 0x32, 0x4b, 0x4a, 0x45, 0x4c, 0x74, 0x46, 0x4f, + 0x74, 0x33, 0x4a, 0x59, 0x30, 0x34, 0x6b, 0x54, 0x6c, 0x66, 0x35, 0x45, + 0x71, 0x2f, 0x6a, 0x58, 0x69, 0x78, 0x74, 0x75, 0x0a, 0x6e, 0x4c, 0x77, + 0x73, 0x6f, 0x46, 0x76, 0x56, 0x61, 0x67, 0x43, 0x76, 0x58, 0x7a, 0x66, + 0x68, 0x31, 0x66, 0x6f, 0x51, 0x43, 0x35, 0x69, 0x63, 0x68, 0x75, 0x63, + 0x6d, 0x6a, 0x38, 0x37, 0x77, 0x37, 0x47, 0x36, 0x4b, 0x56, 0x77, 0x75, + 0x41, 0x34, 0x30, 0x36, 0x79, 0x77, 0x4b, 0x42, 0x6a, 0x59, 0x5a, 0x43, + 0x36, 0x56, 0x57, 0x67, 0x33, 0x64, 0x47, 0x71, 0x32, 0x6b, 0x74, 0x75, + 0x66, 0x0a, 0x6f, 0x59, 0x59, 0x69, 0x74, 0x6d, 0x55, 0x6e, 0x44, 0x75, + 0x79, 0x32, 0x6e, 0x30, 0x4a, 0x67, 0x35, 0x47, 0x66, 0x43, 0x74, 0x64, + 0x70, 0x42, 0x43, 0x38, 0x54, 0x54, 0x69, 0x32, 0x45, 0x62, 0x76, 0x50, + 0x6f, 0x66, 0x6b, 0x53, 0x76, 0x58, 0x52, 0x41, 0x64, 0x65, 0x75, 0x69, + 0x6d, 0x73, 0x32, 0x63, 0x58, 0x70, 0x37, 0x31, 0x4e, 0x49, 0x57, 0x75, + 0x75, 0x41, 0x38, 0x53, 0x68, 0x59, 0x0a, 0x49, 0x63, 0x32, 0x77, 0x42, + 0x6c, 0x58, 0x37, 0x4a, 0x7a, 0x39, 0x54, 0x6b, 0x48, 0x43, 0x70, 0x42, + 0x42, 0x35, 0x58, 0x4a, 0x37, 0x6b, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x45, 0x43, 0x43, 0x20, 0x4f, 0x3d, 0x53, 0x53, 0x4c, 0x20, 0x43, + 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x45, 0x43, 0x43, 0x20, 0x4f, 0x3d, 0x53, 0x53, 0x4c, 0x20, + 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x53, + 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x45, + 0x43, 0x43, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x38, 0x34, 0x39, 0x35, 0x37, 0x32, 0x33, 0x38, 0x31, 0x33, + 0x32, 0x39, 0x37, 0x32, 0x31, 0x36, 0x34, 0x32, 0x34, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x65, 0x3a, 0x64, 0x61, 0x3a, 0x65, + 0x34, 0x3a, 0x33, 0x39, 0x3a, 0x37, 0x66, 0x3a, 0x39, 0x63, 0x3a, 0x38, + 0x66, 0x3a, 0x33, 0x37, 0x3a, 0x64, 0x31, 0x3a, 0x37, 0x30, 0x3a, 0x39, + 0x66, 0x3a, 0x32, 0x36, 0x3a, 0x31, 0x37, 0x3a, 0x35, 0x31, 0x3a, 0x33, + 0x61, 0x3a, 0x38, 0x65, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x63, 0x33, 0x3a, 0x31, 0x39, 0x3a, 0x37, 0x63, 0x3a, 0x33, 0x39, + 0x3a, 0x32, 0x34, 0x3a, 0x65, 0x36, 0x3a, 0x35, 0x34, 0x3a, 0x61, 0x66, + 0x3a, 0x31, 0x62, 0x3a, 0x63, 0x34, 0x3a, 0x61, 0x62, 0x3a, 0x32, 0x30, + 0x3a, 0x39, 0x35, 0x3a, 0x37, 0x61, 0x3a, 0x65, 0x32, 0x3a, 0x63, 0x33, + 0x3a, 0x30, 0x65, 0x3a, 0x31, 0x33, 0x3a, 0x30, 0x32, 0x3a, 0x36, 0x61, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, + 0x34, 0x3a, 0x31, 0x37, 0x3a, 0x62, 0x62, 0x3a, 0x30, 0x36, 0x3a, 0x63, + 0x63, 0x3a, 0x36, 0x30, 0x3a, 0x30, 0x37, 0x3a, 0x64, 0x61, 0x3a, 0x31, + 0x62, 0x3a, 0x39, 0x36, 0x3a, 0x31, 0x63, 0x3a, 0x39, 0x32, 0x3a, 0x30, + 0x62, 0x3a, 0x38, 0x61, 0x3a, 0x62, 0x34, 0x3a, 0x63, 0x65, 0x3a, 0x33, + 0x66, 0x3a, 0x61, 0x64, 0x3a, 0x38, 0x32, 0x3a, 0x30, 0x65, 0x3a, 0x34, + 0x61, 0x3a, 0x61, 0x33, 0x3a, 0x30, 0x62, 0x3a, 0x39, 0x61, 0x3a, 0x63, + 0x62, 0x3a, 0x63, 0x34, 0x3a, 0x61, 0x37, 0x3a, 0x34, 0x65, 0x3a, 0x62, + 0x64, 0x3a, 0x63, 0x65, 0x3a, 0x62, 0x63, 0x3a, 0x36, 0x35, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6a, 0x54, 0x43, 0x43, 0x41, + 0x68, 0x53, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x49, 0x64, + 0x65, 0x62, 0x66, 0x79, 0x38, 0x46, 0x6f, 0x57, 0x36, 0x67, 0x77, 0x43, + 0x67, 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x45, 0x41, + 0x77, 0x49, 0x77, 0x66, 0x44, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x0a, 0x56, 0x56, 0x4d, 0x78, + 0x44, 0x6a, 0x41, 0x4d, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x4d, + 0x42, 0x56, 0x52, 0x6c, 0x65, 0x47, 0x46, 0x7a, 0x4d, 0x52, 0x41, 0x77, + 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, 0x44, 0x41, 0x64, 0x49, + 0x62, 0x33, 0x56, 0x7a, 0x64, 0x47, 0x39, 0x75, 0x4d, 0x52, 0x67, 0x77, + 0x46, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, 0x39, 0x54, + 0x0a, 0x55, 0x30, 0x77, 0x67, 0x51, 0x32, 0x39, 0x79, 0x63, 0x47, 0x39, + 0x79, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x78, 0x4d, 0x54, 0x41, + 0x76, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x4b, 0x46, 0x4e, + 0x54, 0x54, 0x43, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x67, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x0a, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, + 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x53, + 0x42, 0x46, 0x51, 0x30, 0x4d, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, + 0x59, 0x77, 0x4d, 0x6a, 0x45, 0x79, 0x4d, 0x54, 0x67, 0x78, 0x4e, 0x44, + 0x41, 0x7a, 0x57, 0x68, 0x63, 0x4e, 0x4e, 0x44, 0x45, 0x77, 0x4d, 0x6a, + 0x45, 0x79, 0x4d, 0x54, 0x67, 0x78, 0x4e, 0x44, 0x41, 0x7a, 0x0a, 0x57, + 0x6a, 0x42, 0x38, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x4f, 0x4d, + 0x41, 0x77, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x41, 0x77, 0x46, 0x56, + 0x47, 0x56, 0x34, 0x59, 0x58, 0x4d, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x63, 0x4d, 0x42, 0x30, 0x68, 0x76, 0x64, + 0x58, 0x4e, 0x30, 0x0a, 0x62, 0x32, 0x34, 0x78, 0x47, 0x44, 0x41, 0x57, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x44, 0x31, 0x4e, 0x54, + 0x54, 0x43, 0x42, 0x44, 0x62, 0x33, 0x4a, 0x77, 0x62, 0x33, 0x4a, 0x68, + 0x64, 0x47, 0x6c, 0x76, 0x62, 0x6a, 0x45, 0x78, 0x4d, 0x43, 0x38, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x6f, 0x55, 0x31, 0x4e, 0x4d, + 0x4c, 0x6d, 0x4e, 0x76, 0x62, 0x53, 0x42, 0x53, 0x0a, 0x62, 0x32, 0x39, + 0x30, 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, + 0x6a, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, + 0x30, 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x49, 0x45, 0x56, + 0x44, 0x51, 0x7a, 0x42, 0x32, 0x4d, 0x42, 0x41, 0x47, 0x42, 0x79, 0x71, + 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x67, 0x45, 0x47, 0x42, 0x53, 0x75, + 0x42, 0x0a, 0x42, 0x41, 0x41, 0x69, 0x41, 0x32, 0x49, 0x41, 0x42, 0x45, + 0x56, 0x75, 0x71, 0x56, 0x44, 0x45, 0x70, 0x69, 0x4d, 0x32, 0x6e, 0x6c, + 0x38, 0x6f, 0x6a, 0x52, 0x66, 0x4c, 0x6c, 0x69, 0x4a, 0x6b, 0x50, 0x39, + 0x78, 0x36, 0x6a, 0x68, 0x33, 0x4d, 0x43, 0x4c, 0x4f, 0x69, 0x63, 0x53, + 0x53, 0x36, 0x6a, 0x6b, 0x6d, 0x35, 0x42, 0x42, 0x74, 0x48, 0x6c, 0x6c, + 0x69, 0x72, 0x4c, 0x5a, 0x58, 0x49, 0x0a, 0x37, 0x5a, 0x34, 0x49, 0x4e, + 0x63, 0x67, 0x6e, 0x36, 0x34, 0x6d, 0x4d, 0x55, 0x31, 0x6a, 0x72, 0x59, + 0x6f, 0x72, 0x2b, 0x38, 0x46, 0x73, 0x50, 0x61, 0x7a, 0x46, 0x53, 0x59, + 0x30, 0x45, 0x37, 0x69, 0x63, 0x33, 0x73, 0x37, 0x4c, 0x61, 0x4e, 0x47, + 0x64, 0x4d, 0x30, 0x42, 0x39, 0x79, 0x37, 0x78, 0x67, 0x5a, 0x2f, 0x77, + 0x6b, 0x57, 0x56, 0x37, 0x4d, 0x74, 0x2f, 0x71, 0x43, 0x50, 0x67, 0x0a, + 0x43, 0x65, 0x6d, 0x42, 0x2b, 0x76, 0x4e, 0x48, 0x30, 0x36, 0x4e, 0x6a, + 0x4d, 0x47, 0x45, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, + 0x42, 0x42, 0x59, 0x45, 0x46, 0x49, 0x4c, 0x52, 0x68, 0x58, 0x4d, 0x77, + 0x35, 0x7a, 0x55, 0x45, 0x30, 0x34, 0x34, 0x43, 0x6b, 0x76, 0x76, 0x6c, + 0x70, 0x4e, 0x48, 0x45, 0x49, 0x65, 0x6a, 0x4e, 0x4d, 0x41, 0x38, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x0a, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, + 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x77, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f, 0x41, + 0x55, 0x67, 0x74, 0x47, 0x46, 0x63, 0x7a, 0x44, 0x6e, 0x4e, 0x51, 0x54, + 0x54, 0x6a, 0x67, 0x4b, 0x53, 0x2b, 0x2b, 0x57, 0x6b, 0x30, 0x63, 0x51, + 0x68, 0x36, 0x4d, 0x30, 0x77, 0x44, 0x67, 0x59, 0x44, 0x0a, 0x56, 0x52, + 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, + 0x47, 0x47, 0x4d, 0x41, 0x6f, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, + 0x34, 0x39, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x32, 0x63, 0x41, 0x4d, 0x47, + 0x51, 0x43, 0x4d, 0x47, 0x2f, 0x6e, 0x36, 0x31, 0x6b, 0x52, 0x70, 0x47, + 0x44, 0x50, 0x59, 0x62, 0x43, 0x57, 0x65, 0x2b, 0x30, 0x46, 0x2b, 0x53, + 0x38, 0x54, 0x0a, 0x6b, 0x64, 0x7a, 0x74, 0x35, 0x66, 0x78, 0x51, 0x61, + 0x78, 0x46, 0x47, 0x52, 0x72, 0x4d, 0x63, 0x49, 0x51, 0x42, 0x69, 0x75, + 0x37, 0x37, 0x44, 0x35, 0x2b, 0x6a, 0x4e, 0x42, 0x35, 0x6e, 0x35, 0x44, + 0x51, 0x74, 0x64, 0x63, 0x6a, 0x37, 0x45, 0x71, 0x67, 0x49, 0x77, 0x48, + 0x37, 0x79, 0x36, 0x43, 0x2b, 0x49, 0x77, 0x4a, 0x50, 0x74, 0x38, 0x62, + 0x59, 0x42, 0x56, 0x43, 0x70, 0x6b, 0x2b, 0x0a, 0x67, 0x41, 0x30, 0x7a, + 0x35, 0x57, 0x61, 0x6a, 0x73, 0x36, 0x4f, 0x37, 0x70, 0x64, 0x57, 0x4c, + 0x6a, 0x77, 0x6b, 0x73, 0x70, 0x6c, 0x31, 0x2b, 0x34, 0x76, 0x41, 0x48, + 0x43, 0x47, 0x68, 0x74, 0x30, 0x6e, 0x78, 0x70, 0x62, 0x6c, 0x2f, 0x66, + 0x35, 0x57, 0x70, 0x6c, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x53, 0x4c, + 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x20, 0x52, 0x53, 0x41, 0x20, 0x52, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x53, + 0x4c, 0x20, 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, + 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, + 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x52, 0x53, 0x41, 0x20, + 0x52, 0x32, 0x20, 0x4f, 0x3d, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6f, 0x72, + 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x53, 0x4c, 0x2e, 0x63, + 0x6f, 0x6d, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x52, + 0x53, 0x41, 0x20, 0x52, 0x32, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x36, 0x32, 0x34, 0x38, 0x32, 0x32, 0x37, + 0x34, 0x39, 0x34, 0x33, 0x35, 0x32, 0x39, 0x34, 0x33, 0x33, 0x35, 0x30, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x31, 0x3a, 0x31, + 0x65, 0x3a, 0x33, 0x31, 0x3a, 0x35, 0x38, 0x3a, 0x31, 0x61, 0x3a, 0x61, + 0x65, 0x3a, 0x35, 0x34, 0x3a, 0x35, 0x33, 0x3a, 0x30, 0x32, 0x3a, 0x66, + 0x36, 0x3a, 0x31, 0x37, 0x3a, 0x36, 0x61, 0x3a, 0x31, 0x31, 0x3a, 0x37, + 0x62, 0x3a, 0x34, 0x64, 0x3a, 0x39, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x37, 0x34, 0x3a, 0x33, 0x61, 0x3a, 0x66, 0x30, + 0x3a, 0x35, 0x32, 0x3a, 0x39, 0x62, 0x3a, 0x64, 0x30, 0x3a, 0x33, 0x32, + 0x3a, 0x61, 0x30, 0x3a, 0x66, 0x34, 0x3a, 0x34, 0x61, 0x3a, 0x38, 0x33, + 0x3a, 0x63, 0x64, 0x3a, 0x64, 0x34, 0x3a, 0x62, 0x61, 0x3a, 0x61, 0x39, + 0x3a, 0x37, 0x62, 0x3a, 0x37, 0x63, 0x3a, 0x32, 0x65, 0x3a, 0x63, 0x34, + 0x3a, 0x39, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x32, 0x65, 0x3a, 0x37, 0x62, 0x3a, 0x66, 0x31, 0x3a, 0x36, + 0x63, 0x3a, 0x63, 0x32, 0x3a, 0x32, 0x34, 0x3a, 0x38, 0x35, 0x3a, 0x61, + 0x37, 0x3a, 0x62, 0x62, 0x3a, 0x65, 0x32, 0x3a, 0x61, 0x61, 0x3a, 0x38, + 0x36, 0x3a, 0x39, 0x36, 0x3a, 0x37, 0x35, 0x3a, 0x30, 0x37, 0x3a, 0x36, + 0x31, 0x3a, 0x62, 0x30, 0x3a, 0x61, 0x65, 0x3a, 0x33, 0x39, 0x3a, 0x62, + 0x65, 0x3a, 0x33, 0x62, 0x3a, 0x32, 0x66, 0x3a, 0x65, 0x39, 0x3a, 0x64, + 0x30, 0x3a, 0x63, 0x63, 0x3a, 0x36, 0x64, 0x3a, 0x34, 0x65, 0x3a, 0x66, + 0x37, 0x3a, 0x33, 0x34, 0x3a, 0x39, 0x31, 0x3a, 0x34, 0x32, 0x3a, 0x35, + 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x36, 0x7a, + 0x43, 0x43, 0x41, 0x39, 0x4f, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x49, 0x56, 0x72, 0x59, 0x70, 0x7a, 0x54, 0x53, 0x38, 0x65, 0x50, + 0x59, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x67, 0x59, + 0x49, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, + 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, 0x54, 0x4d, 0x51, 0x34, 0x77, 0x44, + 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x49, 0x44, 0x41, 0x56, 0x55, 0x5a, + 0x58, 0x68, 0x68, 0x63, 0x7a, 0x45, 0x51, 0x4d, 0x41, 0x34, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x77, 0x77, 0x48, 0x53, 0x47, 0x39, 0x31, 0x63, + 0x33, 0x52, 0x76, 0x62, 0x6a, 0x45, 0x59, 0x4d, 0x42, 0x59, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x0a, 0x43, 0x67, 0x77, 0x50, 0x55, 0x31, 0x4e, 0x4d, + 0x49, 0x45, 0x4e, 0x76, 0x63, 0x6e, 0x42, 0x76, 0x63, 0x6d, 0x46, 0x30, + 0x61, 0x57, 0x39, 0x75, 0x4d, 0x54, 0x63, 0x77, 0x4e, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x44, 0x43, 0x35, 0x54, 0x55, 0x30, 0x77, 0x75, + 0x59, 0x32, 0x39, 0x74, 0x49, 0x45, 0x56, 0x57, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x67, 0x51, 0x32, 0x56, 0x79, 0x0a, 0x64, 0x47, 0x6c, + 0x6d, 0x61, 0x57, 0x4e, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, + 0x42, 0x64, 0x58, 0x52, 0x6f, 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, + 0x67, 0x55, 0x6c, 0x4e, 0x42, 0x49, 0x46, 0x49, 0x79, 0x4d, 0x42, 0x34, + 0x58, 0x44, 0x54, 0x45, 0x33, 0x4d, 0x44, 0x55, 0x7a, 0x4d, 0x54, 0x45, + 0x34, 0x4d, 0x54, 0x51, 0x7a, 0x4e, 0x31, 0x6f, 0x58, 0x44, 0x54, 0x51, + 0x79, 0x0a, 0x4d, 0x44, 0x55, 0x7a, 0x4d, 0x44, 0x45, 0x34, 0x4d, 0x54, + 0x51, 0x7a, 0x4e, 0x31, 0x6f, 0x77, 0x67, 0x59, 0x49, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, + 0x56, 0x54, 0x4d, 0x51, 0x34, 0x77, 0x44, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x49, 0x44, 0x41, 0x56, 0x55, 0x5a, 0x58, 0x68, 0x68, 0x63, 0x7a, + 0x45, 0x51, 0x4d, 0x41, 0x34, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x77, 0x77, 0x48, 0x53, 0x47, 0x39, 0x31, 0x63, 0x33, 0x52, 0x76, 0x62, + 0x6a, 0x45, 0x59, 0x4d, 0x42, 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x67, 0x77, 0x50, 0x55, 0x31, 0x4e, 0x4d, 0x49, 0x45, 0x4e, 0x76, 0x63, + 0x6e, 0x42, 0x76, 0x63, 0x6d, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x4d, + 0x54, 0x63, 0x77, 0x4e, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x0a, + 0x44, 0x43, 0x35, 0x54, 0x55, 0x30, 0x77, 0x75, 0x59, 0x32, 0x39, 0x74, + 0x49, 0x45, 0x56, 0x57, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, + 0x51, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6d, 0x61, 0x57, 0x4e, 0x68, + 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x42, 0x64, 0x58, 0x52, 0x6f, + 0x62, 0x33, 0x4a, 0x70, 0x64, 0x48, 0x6b, 0x67, 0x55, 0x6c, 0x4e, 0x42, + 0x49, 0x46, 0x49, 0x79, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, 0x38, + 0x41, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, 0x45, + 0x41, 0x6a, 0x7a, 0x5a, 0x6c, 0x51, 0x4f, 0x48, 0x57, 0x54, 0x63, 0x44, + 0x58, 0x74, 0x4f, 0x6c, 0x47, 0x32, 0x6d, 0x76, 0x71, 0x0a, 0x4d, 0x30, + 0x66, 0x4e, 0x54, 0x50, 0x6c, 0x39, 0x66, 0x62, 0x36, 0x39, 0x4c, 0x54, + 0x33, 0x77, 0x32, 0x33, 0x6a, 0x68, 0x68, 0x71, 0x58, 0x5a, 0x75, 0x67, + 0x6c, 0x58, 0x61, 0x4f, 0x31, 0x58, 0x50, 0x71, 0x44, 0x51, 0x43, 0x45, + 0x47, 0x44, 0x35, 0x79, 0x68, 0x42, 0x4a, 0x42, 0x2f, 0x6a, 0x63, 0x68, + 0x58, 0x51, 0x41, 0x52, 0x72, 0x37, 0x58, 0x6e, 0x41, 0x6a, 0x73, 0x73, + 0x75, 0x66, 0x0a, 0x4f, 0x65, 0x50, 0x50, 0x78, 0x55, 0x37, 0x47, 0x6b, + 0x6d, 0x30, 0x6d, 0x78, 0x6e, 0x75, 0x37, 0x73, 0x39, 0x6f, 0x6e, 0x6e, + 0x51, 0x71, 0x47, 0x36, 0x59, 0x45, 0x33, 0x42, 0x66, 0x37, 0x77, 0x63, + 0x58, 0x48, 0x73, 0x77, 0x78, 0x7a, 0x70, 0x59, 0x36, 0x49, 0x58, 0x46, + 0x4a, 0x33, 0x76, 0x47, 0x32, 0x66, 0x54, 0x68, 0x56, 0x55, 0x43, 0x41, + 0x74, 0x5a, 0x4a, 0x79, 0x63, 0x78, 0x61, 0x0a, 0x34, 0x62, 0x48, 0x33, + 0x62, 0x7a, 0x4b, 0x66, 0x79, 0x64, 0x51, 0x37, 0x69, 0x45, 0x47, 0x6f, + 0x6e, 0x4c, 0x33, 0x4c, 0x71, 0x39, 0x74, 0x74, 0x65, 0x77, 0x6b, 0x66, + 0x6f, 0x6b, 0x78, 0x79, 0x6b, 0x4e, 0x6f, 0x72, 0x43, 0x50, 0x7a, 0x50, + 0x50, 0x46, 0x54, 0x4f, 0x5a, 0x77, 0x2b, 0x6f, 0x7a, 0x31, 0x32, 0x57, + 0x47, 0x51, 0x76, 0x45, 0x34, 0x33, 0x4c, 0x72, 0x72, 0x64, 0x46, 0x39, + 0x0a, 0x48, 0x53, 0x66, 0x76, 0x6b, 0x75, 0x73, 0x51, 0x76, 0x31, 0x76, + 0x72, 0x4f, 0x36, 0x2f, 0x50, 0x67, 0x4e, 0x33, 0x42, 0x30, 0x70, 0x59, + 0x45, 0x57, 0x33, 0x70, 0x2b, 0x70, 0x4b, 0x6b, 0x38, 0x4f, 0x48, 0x61, + 0x6b, 0x59, 0x6f, 0x36, 0x67, 0x4f, 0x56, 0x37, 0x71, 0x64, 0x38, 0x39, + 0x64, 0x41, 0x46, 0x6d, 0x50, 0x5a, 0x69, 0x77, 0x2b, 0x42, 0x36, 0x4b, + 0x6a, 0x42, 0x53, 0x59, 0x52, 0x0a, 0x61, 0x5a, 0x66, 0x71, 0x68, 0x62, + 0x63, 0x50, 0x6c, 0x67, 0x74, 0x4c, 0x79, 0x45, 0x44, 0x68, 0x55, 0x4c, + 0x6f, 0x75, 0x69, 0x73, 0x76, 0x33, 0x44, 0x35, 0x6f, 0x69, 0x35, 0x33, + 0x2b, 0x61, 0x4e, 0x78, 0x50, 0x4e, 0x38, 0x6b, 0x30, 0x54, 0x61, 0x79, + 0x48, 0x52, 0x77, 0x4d, 0x77, 0x69, 0x38, 0x71, 0x46, 0x47, 0x39, 0x6b, + 0x52, 0x70, 0x6e, 0x4d, 0x70, 0x68, 0x4e, 0x51, 0x63, 0x41, 0x0a, 0x62, + 0x39, 0x5a, 0x68, 0x43, 0x42, 0x48, 0x71, 0x75, 0x72, 0x6a, 0x32, 0x36, + 0x62, 0x4e, 0x67, 0x35, 0x55, 0x32, 0x35, 0x37, 0x4a, 0x38, 0x55, 0x5a, + 0x73, 0x6c, 0x58, 0x57, 0x4e, 0x76, 0x4e, 0x68, 0x32, 0x6e, 0x34, 0x69, + 0x6f, 0x59, 0x53, 0x41, 0x30, 0x65, 0x2f, 0x5a, 0x68, 0x4e, 0x32, 0x72, + 0x48, 0x64, 0x39, 0x4e, 0x43, 0x53, 0x46, 0x67, 0x38, 0x33, 0x58, 0x71, + 0x70, 0x79, 0x51, 0x0a, 0x47, 0x70, 0x38, 0x68, 0x4c, 0x48, 0x39, 0x34, + 0x74, 0x32, 0x53, 0x34, 0x32, 0x4f, 0x69, 0x6d, 0x39, 0x48, 0x69, 0x7a, + 0x56, 0x63, 0x75, 0x45, 0x30, 0x6a, 0x4c, 0x45, 0x65, 0x4b, 0x36, 0x6a, + 0x6a, 0x32, 0x48, 0x64, 0x7a, 0x67, 0x68, 0x54, 0x72, 0x65, 0x79, 0x49, + 0x2f, 0x42, 0x58, 0x6b, 0x6d, 0x67, 0x33, 0x6d, 0x6e, 0x78, 0x70, 0x33, + 0x7a, 0x6b, 0x79, 0x50, 0x75, 0x42, 0x51, 0x56, 0x0a, 0x50, 0x57, 0x4b, + 0x63, 0x68, 0x6a, 0x67, 0x47, 0x41, 0x47, 0x59, 0x53, 0x35, 0x46, 0x6c, + 0x32, 0x57, 0x6c, 0x50, 0x41, 0x41, 0x70, 0x69, 0x69, 0x45, 0x43, 0x74, + 0x6f, 0x52, 0x48, 0x75, 0x4f, 0x65, 0x63, 0x34, 0x7a, 0x53, 0x6e, 0x61, + 0x71, 0x57, 0x34, 0x45, 0x57, 0x47, 0x37, 0x57, 0x4b, 0x32, 0x4e, 0x41, + 0x41, 0x65, 0x31, 0x35, 0x69, 0x74, 0x41, 0x6e, 0x57, 0x68, 0x6d, 0x4d, + 0x4f, 0x0a, 0x70, 0x67, 0x57, 0x56, 0x53, 0x62, 0x6f, 0x6f, 0x69, 0x34, + 0x69, 0x54, 0x73, 0x6a, 0x51, 0x63, 0x32, 0x4b, 0x52, 0x56, 0x62, 0x72, + 0x63, 0x63, 0x30, 0x4e, 0x36, 0x5a, 0x56, 0x54, 0x73, 0x6a, 0x39, 0x43, + 0x4c, 0x67, 0x2b, 0x53, 0x6c, 0x6d, 0x4a, 0x75, 0x77, 0x67, 0x55, 0x48, + 0x66, 0x62, 0x53, 0x67, 0x75, 0x50, 0x76, 0x75, 0x55, 0x43, 0x59, 0x48, + 0x42, 0x42, 0x58, 0x74, 0x53, 0x75, 0x0a, 0x55, 0x44, 0x6b, 0x69, 0x46, + 0x43, 0x62, 0x4c, 0x73, 0x6a, 0x74, 0x7a, 0x64, 0x46, 0x56, 0x48, 0x42, + 0x33, 0x6d, 0x42, 0x4f, 0x61, 0x67, 0x77, 0x45, 0x30, 0x54, 0x6c, 0x42, + 0x49, 0x71, 0x75, 0x6c, 0x68, 0x4d, 0x6c, 0x51, 0x67, 0x2b, 0x35, 0x55, + 0x38, 0x53, 0x62, 0x2f, 0x4d, 0x33, 0x6b, 0x48, 0x4e, 0x34, 0x38, 0x2b, + 0x71, 0x76, 0x57, 0x42, 0x6b, 0x6f, 0x66, 0x5a, 0x36, 0x61, 0x59, 0x0a, + 0x4d, 0x42, 0x7a, 0x64, 0x4c, 0x4e, 0x76, 0x63, 0x47, 0x4a, 0x56, 0x58, + 0x5a, 0x73, 0x62, 0x2f, 0x58, 0x49, 0x74, 0x57, 0x39, 0x58, 0x63, 0x43, + 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x6a, 0x4d, 0x47, 0x45, 0x77, + 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, + 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x66, + 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, + 0x57, 0x67, 0x42, 0x54, 0x35, 0x59, 0x4c, 0x76, 0x55, 0x34, 0x39, 0x55, + 0x30, 0x39, 0x72, 0x6a, 0x31, 0x42, 0x6f, 0x41, 0x6c, 0x70, 0x33, 0x50, + 0x62, 0x52, 0x6d, 0x6d, 0x6f, 0x6e, 0x6a, 0x41, 0x64, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x2b, 0x57, 0x43, + 0x37, 0x31, 0x4f, 0x50, 0x56, 0x4e, 0x50, 0x61, 0x34, 0x0a, 0x39, 0x51, + 0x61, 0x41, 0x4a, 0x61, 0x64, 0x7a, 0x32, 0x30, 0x5a, 0x70, 0x71, 0x4a, + 0x34, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, 0x47, 0x4d, 0x41, + 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, + 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, 0x51, + 0x42, 0x57, 0x0a, 0x73, 0x34, 0x37, 0x4c, 0x43, 0x70, 0x31, 0x4a, 0x6a, + 0x72, 0x2b, 0x6b, 0x78, 0x4a, 0x47, 0x37, 0x5a, 0x68, 0x63, 0x46, 0x55, + 0x5a, 0x68, 0x31, 0x2b, 0x2b, 0x56, 0x51, 0x4c, 0x48, 0x71, 0x65, 0x38, + 0x52, 0x54, 0x36, 0x71, 0x39, 0x4f, 0x4b, 0x50, 0x76, 0x2b, 0x52, 0x4b, + 0x59, 0x39, 0x6a, 0x69, 0x39, 0x69, 0x30, 0x71, 0x56, 0x51, 0x42, 0x44, + 0x62, 0x36, 0x54, 0x68, 0x69, 0x2f, 0x35, 0x0a, 0x53, 0x6d, 0x33, 0x48, + 0x58, 0x76, 0x56, 0x58, 0x2b, 0x63, 0x70, 0x56, 0x48, 0x42, 0x4b, 0x2b, + 0x52, 0x77, 0x38, 0x32, 0x78, 0x64, 0x39, 0x71, 0x74, 0x39, 0x74, 0x31, + 0x77, 0x6b, 0x63, 0x6c, 0x66, 0x37, 0x6e, 0x78, 0x59, 0x2f, 0x68, 0x6f, + 0x4c, 0x56, 0x55, 0x45, 0x30, 0x66, 0x4b, 0x4e, 0x73, 0x4b, 0x54, 0x50, + 0x76, 0x44, 0x78, 0x65, 0x48, 0x33, 0x6a, 0x6e, 0x70, 0x61, 0x41, 0x67, + 0x0a, 0x63, 0x4c, 0x41, 0x45, 0x78, 0x62, 0x66, 0x33, 0x63, 0x71, 0x66, + 0x65, 0x49, 0x67, 0x32, 0x39, 0x4d, 0x79, 0x56, 0x47, 0x6a, 0x47, 0x53, + 0x53, 0x4a, 0x75, 0x4d, 0x2b, 0x4c, 0x6d, 0x4f, 0x57, 0x32, 0x70, 0x75, + 0x4d, 0x50, 0x66, 0x67, 0x59, 0x43, 0x64, 0x63, 0x44, 0x7a, 0x48, 0x32, + 0x47, 0x67, 0x75, 0x44, 0x4b, 0x42, 0x41, 0x64, 0x52, 0x55, 0x4e, 0x66, + 0x2f, 0x6b, 0x74, 0x55, 0x4d, 0x0a, 0x37, 0x39, 0x71, 0x47, 0x6e, 0x35, + 0x6e, 0x58, 0x36, 0x37, 0x65, 0x76, 0x61, 0x4f, 0x49, 0x35, 0x4a, 0x70, + 0x53, 0x36, 0x61, 0x4c, 0x65, 0x2f, 0x67, 0x39, 0x50, 0x71, 0x65, 0x6d, + 0x63, 0x39, 0x59, 0x6d, 0x65, 0x75, 0x4a, 0x65, 0x56, 0x79, 0x36, 0x4f, + 0x4c, 0x6b, 0x37, 0x4b, 0x34, 0x53, 0x39, 0x6b, 0x73, 0x72, 0x50, 0x4a, + 0x2f, 0x70, 0x73, 0x45, 0x44, 0x7a, 0x4f, 0x46, 0x53, 0x7a, 0x0a, 0x2f, + 0x62, 0x64, 0x6f, 0x79, 0x4e, 0x72, 0x47, 0x6a, 0x31, 0x45, 0x38, 0x73, + 0x76, 0x75, 0x52, 0x33, 0x42, 0x7a, 0x6e, 0x6d, 0x35, 0x33, 0x68, 0x74, + 0x77, 0x31, 0x79, 0x6a, 0x2b, 0x4b, 0x6b, 0x78, 0x4b, 0x6c, 0x34, 0x2b, + 0x65, 0x73, 0x55, 0x72, 0x4d, 0x5a, 0x44, 0x42, 0x63, 0x4a, 0x6c, 0x4f, + 0x53, 0x67, 0x59, 0x41, 0x73, 0x4f, 0x43, 0x73, 0x70, 0x30, 0x46, 0x76, + 0x6d, 0x58, 0x74, 0x0a, 0x6c, 0x6c, 0x39, 0x6c, 0x64, 0x44, 0x7a, 0x37, + 0x43, 0x54, 0x55, 0x75, 0x65, 0x35, 0x77, 0x54, 0x2f, 0x52, 0x73, 0x50, + 0x58, 0x63, 0x64, 0x74, 0x67, 0x54, 0x70, 0x57, 0x44, 0x38, 0x77, 0x37, + 0x34, 0x61, 0x38, 0x43, 0x4c, 0x79, 0x4b, 0x73, 0x52, 0x73, 0x70, 0x47, + 0x50, 0x4b, 0x41, 0x63, 0x54, 0x4e, 0x5a, 0x45, 0x74, 0x46, 0x34, 0x75, + 0x58, 0x42, 0x56, 0x6d, 0x43, 0x65, 0x45, 0x6d, 0x0a, 0x4b, 0x66, 0x37, + 0x47, 0x55, 0x6d, 0x47, 0x36, 0x73, 0x58, 0x50, 0x2f, 0x77, 0x77, 0x79, + 0x63, 0x35, 0x57, 0x78, 0x71, 0x6c, 0x44, 0x38, 0x55, 0x79, 0x6b, 0x41, + 0x57, 0x6c, 0x59, 0x54, 0x7a, 0x57, 0x61, 0x6d, 0x73, 0x58, 0x30, 0x78, + 0x68, 0x6b, 0x32, 0x33, 0x52, 0x4f, 0x38, 0x79, 0x69, 0x6c, 0x51, 0x77, + 0x69, 0x70, 0x6d, 0x64, 0x6e, 0x52, 0x43, 0x36, 0x35, 0x32, 0x64, 0x4b, + 0x4b, 0x0a, 0x51, 0x62, 0x4e, 0x6d, 0x43, 0x31, 0x72, 0x37, 0x66, 0x53, + 0x4f, 0x6c, 0x38, 0x68, 0x71, 0x77, 0x2f, 0x39, 0x36, 0x62, 0x67, 0x35, + 0x51, 0x75, 0x30, 0x54, 0x2f, 0x66, 0x6b, 0x72, 0x65, 0x52, 0x72, 0x77, + 0x55, 0x37, 0x5a, 0x63, 0x65, 0x67, 0x62, 0x4c, 0x48, 0x4e, 0x59, 0x68, + 0x4c, 0x44, 0x6b, 0x42, 0x76, 0x6a, 0x4a, 0x63, 0x34, 0x30, 0x76, 0x47, + 0x39, 0x33, 0x64, 0x72, 0x45, 0x51, 0x0a, 0x77, 0x2f, 0x63, 0x46, 0x47, + 0x73, 0x44, 0x57, 0x72, 0x33, 0x52, 0x69, 0x53, 0x42, 0x64, 0x33, 0x6b, + 0x6d, 0x6d, 0x51, 0x59, 0x52, 0x7a, 0x65, 0x6c, 0x59, 0x42, 0x30, 0x56, + 0x49, 0x38, 0x59, 0x48, 0x4d, 0x50, 0x7a, 0x41, 0x39, 0x43, 0x2f, 0x70, + 0x45, 0x4e, 0x31, 0x68, 0x6c, 0x4d, 0x59, 0x65, 0x67, 0x6f, 0x75, 0x43, + 0x52, 0x77, 0x32, 0x6e, 0x35, 0x48, 0x39, 0x67, 0x6f, 0x6f, 0x69, 0x0a, + 0x53, 0x39, 0x45, 0x4f, 0x55, 0x43, 0x58, 0x64, 0x79, 0x77, 0x4d, 0x4d, + 0x46, 0x38, 0x6d, 0x44, 0x41, 0x41, 0x68, 0x4f, 0x4e, 0x55, 0x32, 0x4b, + 0x69, 0x2b, 0x33, 0x77, 0x41, 0x70, 0x52, 0x6d, 0x4c, 0x45, 0x52, 0x2f, + 0x79, 0x35, 0x55, 0x6e, 0x6c, 0x68, 0x65, 0x74, 0x43, 0x54, 0x43, 0x73, + 0x74, 0x6e, 0x45, 0x58, 0x62, 0x6f, 0x73, 0x58, 0x39, 0x68, 0x77, 0x4a, + 0x31, 0x43, 0x30, 0x37, 0x0a, 0x6d, 0x4b, 0x56, 0x78, 0x30, 0x31, 0x51, + 0x54, 0x32, 0x57, 0x44, 0x7a, 0x39, 0x55, 0x74, 0x6d, 0x54, 0x2f, 0x72, + 0x78, 0x37, 0x69, 0x41, 0x53, 0x6a, 0x62, 0x53, 0x73, 0x56, 0x37, 0x46, + 0x46, 0x59, 0x36, 0x47, 0x73, 0x64, 0x71, 0x6e, 0x43, 0x2b, 0x77, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x53, 0x4c, 0x2e, 0x63, 0x6f, + 0x6d, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x65, + 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, + 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x45, 0x43, + 0x43, 0x20, 0x4f, 0x3d, 0x53, 0x53, 0x4c, 0x20, 0x43, 0x6f, 0x72, 0x70, + 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x23, 0x20, 0x53, 0x75, + 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x53, 0x53, + 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x45, 0x43, 0x43, 0x20, 0x4f, 0x3d, 0x53, 0x53, 0x4c, 0x20, + 0x43, 0x6f, 0x72, 0x70, 0x6f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x53, 0x53, + 0x4c, 0x2e, 0x63, 0x6f, 0x6d, 0x20, 0x45, 0x56, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, + 0x79, 0x20, 0x45, 0x43, 0x43, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x33, 0x31, 0x38, 0x32, 0x32, 0x34, 0x36, + 0x35, 0x32, 0x36, 0x37, 0x35, 0x34, 0x35, 0x35, 0x35, 0x32, 0x38, 0x35, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x39, 0x3a, 0x35, + 0x33, 0x3a, 0x32, 0x32, 0x3a, 0x36, 0x35, 0x3a, 0x38, 0x33, 0x3a, 0x34, + 0x32, 0x3a, 0x30, 0x31, 0x3a, 0x35, 0x34, 0x3a, 0x63, 0x30, 0x3a, 0x63, + 0x65, 0x3a, 0x34, 0x32, 0x3a, 0x62, 0x39, 0x3a, 0x35, 0x61, 0x3a, 0x37, + 0x63, 0x3a, 0x66, 0x32, 0x3a, 0x39, 0x30, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x63, 0x3a, 0x64, 0x64, 0x3a, 0x35, 0x31, + 0x3a, 0x61, 0x33, 0x3a, 0x64, 0x31, 0x3a, 0x66, 0x35, 0x3a, 0x32, 0x30, + 0x3a, 0x33, 0x32, 0x3a, 0x31, 0x34, 0x3a, 0x62, 0x30, 0x3a, 0x63, 0x36, + 0x3a, 0x63, 0x35, 0x3a, 0x33, 0x32, 0x3a, 0x32, 0x33, 0x3a, 0x30, 0x33, + 0x3a, 0x39, 0x31, 0x3a, 0x63, 0x37, 0x3a, 0x34, 0x36, 0x3a, 0x34, 0x32, + 0x3a, 0x36, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x32, 0x32, 0x3a, 0x61, 0x32, 0x3a, 0x63, 0x31, 0x3a, 0x66, + 0x37, 0x3a, 0x62, 0x64, 0x3a, 0x65, 0x64, 0x3a, 0x37, 0x30, 0x3a, 0x34, + 0x63, 0x3a, 0x63, 0x31, 0x3a, 0x65, 0x37, 0x3a, 0x30, 0x31, 0x3a, 0x62, + 0x35, 0x3a, 0x66, 0x34, 0x3a, 0x30, 0x38, 0x3a, 0x63, 0x33, 0x3a, 0x31, + 0x30, 0x3a, 0x38, 0x38, 0x3a, 0x30, 0x66, 0x3a, 0x65, 0x39, 0x3a, 0x35, + 0x36, 0x3a, 0x62, 0x35, 0x3a, 0x64, 0x65, 0x3a, 0x32, 0x61, 0x3a, 0x34, + 0x61, 0x3a, 0x34, 0x34, 0x3a, 0x66, 0x39, 0x3a, 0x39, 0x63, 0x3a, 0x38, + 0x37, 0x3a, 0x33, 0x61, 0x3a, 0x32, 0x35, 0x3a, 0x61, 0x37, 0x3a, 0x63, + 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x6c, 0x44, + 0x43, 0x43, 0x41, 0x68, 0x71, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x49, 0x4c, 0x43, 0x6d, 0x63, 0x57, 0x78, 0x62, 0x74, 0x42, 0x5a, + 0x55, 0x77, 0x43, 0x67, 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, + 0x30, 0x45, 0x41, 0x77, 0x49, 0x77, 0x66, 0x7a, 0x45, 0x4c, 0x4d, 0x41, + 0x6b, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x0a, 0x56, + 0x56, 0x4d, 0x78, 0x44, 0x6a, 0x41, 0x4d, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x67, 0x4d, 0x42, 0x56, 0x52, 0x6c, 0x65, 0x47, 0x46, 0x7a, 0x4d, + 0x52, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x48, 0x44, + 0x41, 0x64, 0x49, 0x62, 0x33, 0x56, 0x7a, 0x64, 0x47, 0x39, 0x75, 0x4d, + 0x52, 0x67, 0x77, 0x46, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x44, + 0x41, 0x39, 0x54, 0x0a, 0x55, 0x30, 0x77, 0x67, 0x51, 0x32, 0x39, 0x79, + 0x63, 0x47, 0x39, 0x79, 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x78, + 0x4e, 0x44, 0x41, 0x79, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, + 0x4b, 0x31, 0x4e, 0x54, 0x54, 0x43, 0x35, 0x6a, 0x62, 0x32, 0x30, 0x67, + 0x52, 0x56, 0x59, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x0a, 0x59, 0x32, 0x46, + 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, + 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x53, 0x42, 0x46, 0x51, 0x30, 0x4d, + 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x59, 0x77, 0x4d, 0x6a, 0x45, + 0x79, 0x4d, 0x54, 0x67, 0x78, 0x4e, 0x54, 0x49, 0x7a, 0x57, 0x68, 0x63, + 0x4e, 0x4e, 0x44, 0x45, 0x77, 0x4d, 0x6a, 0x45, 0x79, 0x4d, 0x54, 0x67, + 0x78, 0x0a, 0x4e, 0x54, 0x49, 0x7a, 0x57, 0x6a, 0x42, 0x2f, 0x4d, 0x51, + 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, + 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x4f, 0x4d, 0x41, 0x77, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x43, 0x41, 0x77, 0x46, 0x56, 0x47, 0x56, 0x34, 0x59, 0x58, + 0x4d, 0x78, 0x45, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x63, 0x4d, 0x42, 0x30, 0x68, 0x76, 0x0a, 0x64, 0x58, 0x4e, 0x30, 0x62, + 0x32, 0x34, 0x78, 0x47, 0x44, 0x41, 0x57, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x6f, 0x4d, 0x44, 0x31, 0x4e, 0x54, 0x54, 0x43, 0x42, 0x44, 0x62, + 0x33, 0x4a, 0x77, 0x62, 0x33, 0x4a, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, + 0x6a, 0x45, 0x30, 0x4d, 0x44, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, + 0x77, 0x77, 0x72, 0x55, 0x31, 0x4e, 0x4d, 0x4c, 0x6d, 0x4e, 0x76, 0x0a, + 0x62, 0x53, 0x42, 0x46, 0x56, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, + 0x49, 0x45, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x6d, 0x6c, 0x6a, + 0x59, 0x58, 0x52, 0x70, 0x62, 0x32, 0x34, 0x67, 0x51, 0x58, 0x56, 0x30, + 0x61, 0x47, 0x39, 0x79, 0x61, 0x58, 0x52, 0x35, 0x49, 0x45, 0x56, 0x44, + 0x51, 0x7a, 0x42, 0x32, 0x4d, 0x42, 0x41, 0x47, 0x42, 0x79, 0x71, 0x47, + 0x53, 0x4d, 0x34, 0x39, 0x0a, 0x41, 0x67, 0x45, 0x47, 0x42, 0x53, 0x75, + 0x42, 0x42, 0x41, 0x41, 0x69, 0x41, 0x32, 0x49, 0x41, 0x42, 0x4b, 0x6f, + 0x53, 0x52, 0x35, 0x43, 0x59, 0x47, 0x2f, 0x76, 0x76, 0x77, 0x30, 0x41, + 0x48, 0x67, 0x79, 0x42, 0x4f, 0x38, 0x54, 0x43, 0x43, 0x6f, 0x67, 0x62, + 0x52, 0x38, 0x70, 0x4b, 0x47, 0x59, 0x66, 0x4c, 0x32, 0x49, 0x57, 0x6a, + 0x4b, 0x41, 0x4d, 0x54, 0x48, 0x36, 0x6b, 0x4d, 0x41, 0x0a, 0x56, 0x49, + 0x62, 0x63, 0x2f, 0x52, 0x2f, 0x66, 0x41, 0x4c, 0x68, 0x42, 0x59, 0x6c, + 0x7a, 0x63, 0x63, 0x42, 0x59, 0x79, 0x33, 0x68, 0x2b, 0x5a, 0x31, 0x4d, + 0x7a, 0x46, 0x42, 0x38, 0x67, 0x49, 0x48, 0x32, 0x45, 0x57, 0x42, 0x31, + 0x45, 0x39, 0x66, 0x56, 0x77, 0x48, 0x55, 0x2b, 0x4d, 0x31, 0x4f, 0x49, + 0x7a, 0x66, 0x7a, 0x5a, 0x2f, 0x5a, 0x4c, 0x67, 0x31, 0x4b, 0x74, 0x68, + 0x6b, 0x75, 0x0a, 0x57, 0x6e, 0x42, 0x61, 0x42, 0x75, 0x32, 0x2b, 0x38, + 0x4b, 0x47, 0x77, 0x79, 0x74, 0x41, 0x4a, 0x4b, 0x61, 0x4e, 0x6a, 0x4d, + 0x47, 0x45, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, + 0x42, 0x59, 0x45, 0x46, 0x46, 0x76, 0x4b, 0x58, 0x75, 0x58, 0x65, 0x30, + 0x6f, 0x47, 0x71, 0x7a, 0x61, 0x67, 0x74, 0x5a, 0x46, 0x47, 0x32, 0x32, + 0x58, 0x4b, 0x62, 0x6c, 0x2b, 0x5a, 0x50, 0x0a, 0x4d, 0x41, 0x38, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, + 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, 0x48, 0x77, 0x59, 0x44, + 0x56, 0x52, 0x30, 0x6a, 0x42, 0x42, 0x67, 0x77, 0x46, 0x6f, 0x41, 0x55, + 0x57, 0x38, 0x70, 0x65, 0x35, 0x64, 0x37, 0x53, 0x67, 0x61, 0x72, 0x4e, + 0x71, 0x43, 0x31, 0x6b, 0x55, 0x62, 0x62, 0x5a, 0x63, 0x70, 0x75, 0x58, + 0x0a, 0x35, 0x6b, 0x38, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x47, + 0x47, 0x4d, 0x41, 0x6f, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, + 0x39, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x32, 0x67, 0x41, 0x4d, 0x47, 0x55, + 0x43, 0x4d, 0x51, 0x43, 0x4b, 0x35, 0x6b, 0x43, 0x4a, 0x4e, 0x2b, 0x76, + 0x70, 0x31, 0x52, 0x50, 0x5a, 0x0a, 0x79, 0x74, 0x52, 0x72, 0x4a, 0x50, + 0x4f, 0x77, 0x50, 0x59, 0x64, 0x47, 0x57, 0x42, 0x72, 0x73, 0x73, 0x64, + 0x39, 0x76, 0x2b, 0x31, 0x61, 0x36, 0x63, 0x47, 0x76, 0x48, 0x4f, 0x4d, + 0x7a, 0x6f, 0x73, 0x59, 0x78, 0x50, 0x44, 0x2f, 0x66, 0x78, 0x5a, 0x33, + 0x59, 0x4f, 0x67, 0x39, 0x41, 0x65, 0x55, 0x59, 0x38, 0x43, 0x4d, 0x44, + 0x33, 0x32, 0x49, 0x79, 0x67, 0x6d, 0x54, 0x4d, 0x5a, 0x67, 0x0a, 0x68, + 0x35, 0x4d, 0x6d, 0x6d, 0x37, 0x49, 0x31, 0x48, 0x72, 0x72, 0x57, 0x39, + 0x7a, 0x7a, 0x52, 0x48, 0x4d, 0x37, 0x36, 0x4a, 0x54, 0x79, 0x6d, 0x47, + 0x6f, 0x45, 0x56, 0x57, 0x2f, 0x4d, 0x53, 0x44, 0x32, 0x7a, 0x75, 0x5a, + 0x59, 0x72, 0x4a, 0x68, 0x36, 0x6a, 0x35, 0x42, 0x2b, 0x42, 0x69, 0x6d, + 0x6f, 0x78, 0x63, 0x53, 0x67, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, + 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, + 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, + 0x52, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x3d, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x4f, 0x55, 0x3d, 0x47, 0x6c, 0x6f, 0x62, + 0x61, 0x6c, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x2d, 0x20, 0x52, 0x36, 0x0a, 0x23, 0x20, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, + 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, + 0x20, 0x2d, 0x20, 0x52, 0x36, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x31, 0x37, 0x37, 0x36, 0x36, + 0x36, 0x31, 0x37, 0x39, 0x37, 0x33, 0x34, 0x34, 0x34, 0x39, 0x38, 0x39, + 0x32, 0x35, 0x32, 0x36, 0x37, 0x30, 0x33, 0x30, 0x31, 0x36, 0x31, 0x39, + 0x35, 0x33, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, + 0x66, 0x3a, 0x64, 0x64, 0x3a, 0x30, 0x37, 0x3a, 0x65, 0x34, 0x3a, 0x64, + 0x34, 0x3a, 0x32, 0x32, 0x3a, 0x36, 0x34, 0x3a, 0x33, 0x39, 0x3a, 0x31, + 0x65, 0x3a, 0x30, 0x63, 0x3a, 0x33, 0x37, 0x3a, 0x34, 0x32, 0x3a, 0x65, + 0x61, 0x3a, 0x64, 0x31, 0x3a, 0x63, 0x36, 0x3a, 0x61, 0x65, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x30, 0x3a, 0x39, 0x34, + 0x3a, 0x36, 0x34, 0x3a, 0x30, 0x65, 0x3a, 0x62, 0x35, 0x3a, 0x61, 0x37, + 0x3a, 0x61, 0x31, 0x3a, 0x63, 0x61, 0x3a, 0x31, 0x31, 0x3a, 0x39, 0x63, + 0x3a, 0x31, 0x66, 0x3a, 0x64, 0x64, 0x3a, 0x64, 0x35, 0x3a, 0x39, 0x66, + 0x3a, 0x38, 0x31, 0x3a, 0x30, 0x32, 0x3a, 0x36, 0x33, 0x3a, 0x61, 0x37, + 0x3a, 0x66, 0x62, 0x3a, 0x64, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x63, 0x3a, 0x61, 0x62, 0x3a, 0x65, + 0x61, 0x3a, 0x66, 0x65, 0x3a, 0x33, 0x37, 0x3a, 0x64, 0x30, 0x3a, 0x36, + 0x63, 0x3a, 0x61, 0x32, 0x3a, 0x32, 0x61, 0x3a, 0x62, 0x61, 0x3a, 0x37, + 0x33, 0x3a, 0x39, 0x31, 0x3a, 0x63, 0x30, 0x3a, 0x30, 0x33, 0x3a, 0x33, + 0x64, 0x3a, 0x32, 0x35, 0x3a, 0x39, 0x38, 0x3a, 0x32, 0x39, 0x3a, 0x35, + 0x32, 0x3a, 0x63, 0x34, 0x3a, 0x35, 0x33, 0x3a, 0x36, 0x34, 0x3a, 0x37, + 0x33, 0x3a, 0x34, 0x39, 0x3a, 0x37, 0x36, 0x3a, 0x33, 0x61, 0x3a, 0x33, + 0x61, 0x3a, 0x62, 0x35, 0x3a, 0x61, 0x64, 0x3a, 0x36, 0x63, 0x3a, 0x63, + 0x66, 0x3a, 0x36, 0x39, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x46, 0x67, 0x7a, 0x43, 0x43, 0x41, 0x32, 0x75, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x4f, 0x52, 0x65, 0x61, 0x37, 0x41, 0x34, 0x4d, + 0x7a, 0x77, 0x34, 0x56, 0x6c, 0x53, 0x4f, 0x62, 0x2f, 0x52, 0x56, 0x45, + 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, + 0x4e, 0x41, 0x51, 0x45, 0x4d, 0x42, 0x51, 0x41, 0x77, 0x54, 0x44, 0x45, + 0x67, 0x0a, 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, + 0x4d, 0x58, 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, + 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x4e, 0x42, 0x49, 0x43, 0x30, 0x67, 0x55, 0x6a, 0x59, 0x78, 0x45, 0x7a, + 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, 0x6b, + 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x0a, 0x62, 0x46, 0x4e, 0x70, 0x5a, + 0x32, 0x34, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, + 0x41, 0x4d, 0x54, 0x43, 0x6b, 0x64, 0x73, 0x62, 0x32, 0x4a, 0x68, 0x62, + 0x46, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, + 0x54, 0x51, 0x78, 0x4d, 0x6a, 0x45, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, + 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x51, 0x78, 0x0a, + 0x4d, 0x6a, 0x45, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, + 0x57, 0x6a, 0x42, 0x4d, 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x64, 0x48, 0x62, 0x47, 0x39, 0x69, + 0x59, 0x57, 0x78, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, 0x53, 0x42, 0x53, + 0x4e, 0x6a, 0x45, 0x54, 0x0a, 0x4d, 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x4b, 0x52, 0x32, 0x78, 0x76, 0x59, 0x6d, 0x46, + 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x6a, 0x45, 0x54, 0x4d, 0x42, 0x45, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4b, 0x52, 0x32, 0x78, + 0x76, 0x59, 0x6d, 0x46, 0x73, 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x6a, 0x43, + 0x43, 0x41, 0x69, 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x0a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x42, 0x42, 0x51, + 0x41, 0x44, 0x67, 0x67, 0x49, 0x50, 0x41, 0x44, 0x43, 0x43, 0x41, 0x67, + 0x6f, 0x43, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4a, 0x55, 0x48, 0x36, 0x48, + 0x50, 0x4b, 0x5a, 0x76, 0x6e, 0x73, 0x46, 0x4d, 0x70, 0x37, 0x50, 0x50, + 0x63, 0x4e, 0x43, 0x50, 0x47, 0x30, 0x52, 0x51, 0x73, 0x73, 0x67, 0x72, + 0x52, 0x49, 0x0a, 0x78, 0x75, 0x74, 0x62, 0x50, 0x4b, 0x36, 0x44, 0x75, + 0x45, 0x47, 0x53, 0x4d, 0x78, 0x53, 0x6b, 0x62, 0x33, 0x2f, 0x70, 0x4b, + 0x73, 0x7a, 0x47, 0x73, 0x49, 0x68, 0x72, 0x78, 0x62, 0x61, 0x4a, 0x30, + 0x63, 0x61, 0x79, 0x2f, 0x78, 0x54, 0x4f, 0x55, 0x52, 0x51, 0x68, 0x37, + 0x45, 0x72, 0x64, 0x47, 0x31, 0x72, 0x47, 0x31, 0x6f, 0x66, 0x75, 0x54, + 0x54, 0x6f, 0x56, 0x42, 0x75, 0x31, 0x6b, 0x0a, 0x5a, 0x67, 0x75, 0x53, + 0x67, 0x4d, 0x70, 0x45, 0x33, 0x6e, 0x4f, 0x55, 0x54, 0x76, 0x4f, 0x6e, + 0x69, 0x58, 0x39, 0x50, 0x65, 0x47, 0x4d, 0x49, 0x79, 0x42, 0x4a, 0x51, + 0x62, 0x55, 0x4a, 0x6d, 0x4c, 0x30, 0x32, 0x35, 0x65, 0x53, 0x68, 0x4e, + 0x55, 0x68, 0x71, 0x4b, 0x47, 0x6f, 0x43, 0x33, 0x47, 0x59, 0x45, 0x4f, + 0x66, 0x73, 0x53, 0x4b, 0x76, 0x47, 0x52, 0x4d, 0x49, 0x52, 0x78, 0x44, + 0x0a, 0x61, 0x4e, 0x63, 0x39, 0x50, 0x49, 0x72, 0x46, 0x73, 0x6d, 0x62, + 0x56, 0x6b, 0x4a, 0x71, 0x33, 0x4d, 0x51, 0x62, 0x46, 0x76, 0x75, 0x4a, + 0x74, 0x4d, 0x67, 0x61, 0x6d, 0x48, 0x76, 0x6d, 0x35, 0x36, 0x36, 0x71, + 0x6a, 0x75, 0x4c, 0x2b, 0x2b, 0x67, 0x6d, 0x4e, 0x51, 0x30, 0x50, 0x41, + 0x59, 0x69, 0x64, 0x2f, 0x6b, 0x44, 0x33, 0x6e, 0x31, 0x36, 0x71, 0x49, + 0x66, 0x4b, 0x74, 0x4a, 0x77, 0x0a, 0x4c, 0x6e, 0x76, 0x6e, 0x76, 0x4a, + 0x4f, 0x37, 0x62, 0x56, 0x50, 0x69, 0x53, 0x48, 0x79, 0x4d, 0x45, 0x41, + 0x63, 0x34, 0x2f, 0x32, 0x61, 0x79, 0x64, 0x32, 0x46, 0x2b, 0x34, 0x4f, + 0x71, 0x4d, 0x50, 0x4b, 0x71, 0x30, 0x70, 0x50, 0x62, 0x7a, 0x6c, 0x55, + 0x6f, 0x53, 0x42, 0x32, 0x33, 0x39, 0x6a, 0x4c, 0x4b, 0x4a, 0x7a, 0x39, + 0x43, 0x67, 0x59, 0x58, 0x66, 0x49, 0x57, 0x48, 0x53, 0x77, 0x0a, 0x31, + 0x43, 0x4d, 0x36, 0x39, 0x31, 0x30, 0x36, 0x79, 0x71, 0x4c, 0x62, 0x6e, + 0x51, 0x6e, 0x65, 0x58, 0x55, 0x51, 0x74, 0x6b, 0x50, 0x47, 0x42, 0x7a, + 0x56, 0x65, 0x53, 0x2b, 0x6e, 0x36, 0x38, 0x55, 0x41, 0x52, 0x6a, 0x4e, + 0x4e, 0x39, 0x72, 0x6b, 0x78, 0x69, 0x2b, 0x61, 0x7a, 0x61, 0x79, 0x4f, + 0x65, 0x53, 0x73, 0x4a, 0x44, 0x61, 0x33, 0x38, 0x4f, 0x2b, 0x32, 0x48, + 0x42, 0x4e, 0x58, 0x0a, 0x6b, 0x37, 0x62, 0x65, 0x73, 0x76, 0x6a, 0x69, + 0x68, 0x62, 0x64, 0x7a, 0x6f, 0x72, 0x67, 0x31, 0x71, 0x6b, 0x58, 0x79, + 0x34, 0x4a, 0x30, 0x32, 0x6f, 0x57, 0x39, 0x55, 0x69, 0x76, 0x46, 0x79, + 0x56, 0x6d, 0x34, 0x75, 0x69, 0x4d, 0x56, 0x52, 0x51, 0x6b, 0x51, 0x56, + 0x6c, 0x4f, 0x36, 0x6a, 0x78, 0x54, 0x69, 0x57, 0x6d, 0x30, 0x35, 0x4f, + 0x57, 0x67, 0x74, 0x48, 0x38, 0x77, 0x59, 0x32, 0x0a, 0x53, 0x58, 0x63, + 0x77, 0x76, 0x48, 0x45, 0x33, 0x35, 0x61, 0x62, 0x73, 0x49, 0x51, 0x68, + 0x31, 0x2f, 0x4f, 0x5a, 0x68, 0x46, 0x6a, 0x39, 0x33, 0x31, 0x64, 0x6d, + 0x52, 0x6c, 0x34, 0x51, 0x4b, 0x62, 0x4e, 0x51, 0x43, 0x54, 0x58, 0x54, + 0x41, 0x46, 0x4f, 0x33, 0x39, 0x4f, 0x66, 0x75, 0x44, 0x38, 0x6c, 0x34, + 0x55, 0x6f, 0x51, 0x53, 0x77, 0x43, 0x2b, 0x6e, 0x2b, 0x37, 0x6f, 0x2f, + 0x68, 0x0a, 0x62, 0x67, 0x75, 0x79, 0x43, 0x4c, 0x4e, 0x68, 0x5a, 0x67, + 0x6c, 0x71, 0x73, 0x51, 0x59, 0x36, 0x5a, 0x5a, 0x5a, 0x5a, 0x77, 0x50, + 0x41, 0x31, 0x2f, 0x63, 0x6e, 0x61, 0x4b, 0x49, 0x30, 0x61, 0x45, 0x59, + 0x64, 0x77, 0x67, 0x51, 0x71, 0x6f, 0x6d, 0x6e, 0x55, 0x64, 0x6e, 0x6a, + 0x71, 0x47, 0x42, 0x51, 0x43, 0x65, 0x32, 0x34, 0x44, 0x57, 0x4a, 0x66, + 0x6e, 0x63, 0x42, 0x5a, 0x34, 0x6e, 0x0a, 0x57, 0x55, 0x78, 0x32, 0x4f, + 0x56, 0x76, 0x71, 0x2b, 0x61, 0x57, 0x68, 0x32, 0x49, 0x4d, 0x50, 0x30, + 0x66, 0x2f, 0x66, 0x4d, 0x42, 0x48, 0x35, 0x68, 0x63, 0x38, 0x7a, 0x53, + 0x50, 0x58, 0x4b, 0x62, 0x57, 0x51, 0x55, 0x4c, 0x48, 0x70, 0x59, 0x54, + 0x39, 0x4e, 0x4c, 0x43, 0x45, 0x6e, 0x46, 0x6c, 0x57, 0x51, 0x61, 0x59, + 0x77, 0x35, 0x35, 0x50, 0x66, 0x57, 0x7a, 0x6a, 0x4d, 0x70, 0x59, 0x0a, + 0x72, 0x5a, 0x78, 0x43, 0x52, 0x58, 0x6c, 0x75, 0x44, 0x6f, 0x63, 0x5a, + 0x58, 0x46, 0x53, 0x78, 0x5a, 0x62, 0x61, 0x2f, 0x6a, 0x4a, 0x76, 0x63, + 0x45, 0x2b, 0x6b, 0x4e, 0x62, 0x37, 0x67, 0x75, 0x33, 0x47, 0x64, 0x75, + 0x79, 0x59, 0x73, 0x52, 0x74, 0x59, 0x51, 0x55, 0x69, 0x67, 0x41, 0x5a, + 0x63, 0x49, 0x4e, 0x35, 0x6b, 0x5a, 0x65, 0x52, 0x31, 0x42, 0x6f, 0x6e, + 0x76, 0x7a, 0x63, 0x65, 0x0a, 0x4d, 0x67, 0x66, 0x59, 0x46, 0x47, 0x4d, + 0x38, 0x4b, 0x45, 0x79, 0x76, 0x41, 0x67, 0x4d, 0x42, 0x41, 0x41, 0x47, + 0x6a, 0x59, 0x7a, 0x42, 0x68, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x0a, 0x41, 0x51, + 0x48, 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x53, 0x75, 0x62, 0x41, 0x57, 0x6a, 0x6b, 0x78, + 0x50, 0x69, 0x6f, 0x75, 0x66, 0x69, 0x31, 0x78, 0x7a, 0x57, 0x78, 0x2f, + 0x42, 0x2f, 0x79, 0x47, 0x64, 0x54, 0x6f, 0x44, 0x41, 0x66, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, + 0x53, 0x75, 0x0a, 0x62, 0x41, 0x57, 0x6a, 0x6b, 0x78, 0x50, 0x69, 0x6f, + 0x75, 0x66, 0x69, 0x31, 0x78, 0x7a, 0x57, 0x78, 0x2f, 0x42, 0x2f, 0x79, + 0x47, 0x64, 0x54, 0x6f, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, + 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x77, 0x46, 0x41, + 0x41, 0x4f, 0x43, 0x41, 0x67, 0x45, 0x41, 0x67, 0x79, 0x58, 0x74, 0x36, + 0x4e, 0x48, 0x39, 0x6c, 0x56, 0x4c, 0x4e, 0x0a, 0x6e, 0x73, 0x41, 0x45, + 0x6f, 0x4a, 0x46, 0x70, 0x35, 0x6c, 0x7a, 0x51, 0x68, 0x4e, 0x37, 0x63, + 0x72, 0x61, 0x4a, 0x50, 0x36, 0x45, 0x64, 0x34, 0x31, 0x6d, 0x57, 0x59, + 0x71, 0x56, 0x75, 0x6f, 0x50, 0x49, 0x64, 0x38, 0x41, 0x6f, 0x72, 0x52, + 0x62, 0x72, 0x63, 0x57, 0x63, 0x2b, 0x5a, 0x66, 0x77, 0x46, 0x53, 0x59, + 0x31, 0x58, 0x53, 0x2b, 0x77, 0x63, 0x33, 0x69, 0x45, 0x5a, 0x47, 0x74, + 0x0a, 0x49, 0x78, 0x67, 0x39, 0x33, 0x65, 0x46, 0x79, 0x52, 0x4a, 0x61, + 0x30, 0x6c, 0x56, 0x37, 0x41, 0x65, 0x34, 0x36, 0x5a, 0x65, 0x42, 0x5a, + 0x44, 0x45, 0x31, 0x5a, 0x58, 0x73, 0x36, 0x4b, 0x7a, 0x4f, 0x37, 0x56, + 0x33, 0x33, 0x45, 0x42, 0x79, 0x72, 0x4b, 0x50, 0x72, 0x6d, 0x7a, 0x55, + 0x2b, 0x73, 0x51, 0x67, 0x68, 0x6f, 0x65, 0x66, 0x45, 0x51, 0x7a, 0x64, + 0x35, 0x4d, 0x72, 0x36, 0x31, 0x0a, 0x35, 0x35, 0x77, 0x73, 0x54, 0x4c, + 0x78, 0x44, 0x4b, 0x5a, 0x6d, 0x4f, 0x4d, 0x4e, 0x4f, 0x73, 0x49, 0x65, + 0x44, 0x6a, 0x48, 0x66, 0x72, 0x59, 0x42, 0x7a, 0x4e, 0x32, 0x56, 0x41, + 0x41, 0x69, 0x4b, 0x72, 0x6c, 0x4e, 0x49, 0x43, 0x35, 0x77, 0x61, 0x4e, + 0x72, 0x6c, 0x55, 0x2f, 0x79, 0x44, 0x58, 0x4e, 0x4f, 0x64, 0x38, 0x76, + 0x39, 0x45, 0x44, 0x45, 0x52, 0x6d, 0x38, 0x74, 0x4c, 0x6a, 0x0a, 0x76, + 0x55, 0x59, 0x41, 0x47, 0x6d, 0x30, 0x43, 0x75, 0x69, 0x56, 0x64, 0x6a, + 0x61, 0x45, 0x78, 0x55, 0x64, 0x31, 0x55, 0x52, 0x68, 0x78, 0x4e, 0x32, + 0x35, 0x6d, 0x57, 0x37, 0x78, 0x6f, 0x63, 0x42, 0x46, 0x79, 0x6d, 0x46, + 0x65, 0x39, 0x34, 0x34, 0x48, 0x6e, 0x2b, 0x58, 0x64, 0x73, 0x2b, 0x71, + 0x6b, 0x78, 0x56, 0x2f, 0x5a, 0x6f, 0x56, 0x71, 0x57, 0x2f, 0x68, 0x70, + 0x76, 0x76, 0x66, 0x0a, 0x63, 0x44, 0x44, 0x70, 0x77, 0x2b, 0x35, 0x43, + 0x52, 0x75, 0x33, 0x43, 0x6b, 0x77, 0x57, 0x4a, 0x2b, 0x6e, 0x31, 0x6a, + 0x65, 0x7a, 0x2f, 0x51, 0x63, 0x59, 0x46, 0x38, 0x41, 0x4f, 0x69, 0x59, + 0x72, 0x67, 0x35, 0x34, 0x4e, 0x4d, 0x4d, 0x6c, 0x2b, 0x36, 0x38, 0x4b, + 0x6e, 0x79, 0x42, 0x72, 0x33, 0x54, 0x73, 0x54, 0x6a, 0x78, 0x4b, 0x4d, + 0x34, 0x6b, 0x45, 0x61, 0x53, 0x48, 0x70, 0x7a, 0x0a, 0x6f, 0x48, 0x64, + 0x70, 0x78, 0x37, 0x5a, 0x63, 0x66, 0x34, 0x4c, 0x49, 0x48, 0x76, 0x35, + 0x59, 0x47, 0x79, 0x67, 0x72, 0x71, 0x47, 0x79, 0x74, 0x58, 0x6d, 0x33, + 0x41, 0x42, 0x64, 0x4a, 0x37, 0x74, 0x2b, 0x75, 0x41, 0x2f, 0x69, 0x55, + 0x33, 0x2f, 0x67, 0x4b, 0x62, 0x61, 0x4b, 0x78, 0x43, 0x58, 0x63, 0x50, + 0x75, 0x39, 0x63, 0x7a, 0x63, 0x38, 0x46, 0x42, 0x31, 0x30, 0x6a, 0x5a, + 0x70, 0x0a, 0x6e, 0x4f, 0x5a, 0x37, 0x42, 0x4e, 0x39, 0x75, 0x42, 0x6d, + 0x6d, 0x32, 0x33, 0x67, 0x6f, 0x4a, 0x53, 0x46, 0x6d, 0x48, 0x36, 0x33, + 0x73, 0x55, 0x59, 0x48, 0x70, 0x6b, 0x71, 0x6d, 0x6c, 0x44, 0x37, 0x35, + 0x48, 0x48, 0x54, 0x4f, 0x77, 0x59, 0x33, 0x57, 0x7a, 0x76, 0x55, 0x79, + 0x32, 0x4d, 0x6d, 0x65, 0x46, 0x65, 0x38, 0x6e, 0x49, 0x2b, 0x7a, 0x31, + 0x54, 0x49, 0x76, 0x57, 0x66, 0x73, 0x0a, 0x70, 0x41, 0x39, 0x4d, 0x52, + 0x66, 0x2f, 0x54, 0x75, 0x54, 0x41, 0x6a, 0x42, 0x30, 0x79, 0x50, 0x45, + 0x4c, 0x2b, 0x47, 0x6c, 0x74, 0x6d, 0x5a, 0x57, 0x72, 0x53, 0x5a, 0x56, + 0x78, 0x79, 0x6b, 0x7a, 0x4c, 0x73, 0x56, 0x69, 0x56, 0x4f, 0x36, 0x4c, + 0x41, 0x55, 0x50, 0x35, 0x4d, 0x53, 0x65, 0x47, 0x62, 0x45, 0x59, 0x4e, + 0x4e, 0x56, 0x4d, 0x6e, 0x62, 0x72, 0x74, 0x39, 0x78, 0x2b, 0x76, 0x0a, + 0x4a, 0x4a, 0x55, 0x45, 0x65, 0x4b, 0x67, 0x44, 0x75, 0x2b, 0x36, 0x42, + 0x35, 0x64, 0x70, 0x66, 0x66, 0x49, 0x74, 0x4b, 0x6f, 0x5a, 0x42, 0x30, + 0x4a, 0x61, 0x65, 0x7a, 0x50, 0x6b, 0x76, 0x49, 0x4c, 0x46, 0x61, 0x39, + 0x78, 0x38, 0x6a, 0x76, 0x4f, 0x4f, 0x4a, 0x63, 0x6b, 0x76, 0x42, 0x35, + 0x39, 0x35, 0x79, 0x45, 0x75, 0x6e, 0x51, 0x74, 0x59, 0x51, 0x45, 0x67, + 0x66, 0x6e, 0x37, 0x52, 0x0a, 0x38, 0x6b, 0x38, 0x48, 0x57, 0x56, 0x2b, + 0x4c, 0x4c, 0x55, 0x4e, 0x53, 0x36, 0x30, 0x59, 0x4d, 0x6c, 0x4f, 0x48, + 0x31, 0x5a, 0x6b, 0x64, 0x35, 0x64, 0x39, 0x56, 0x55, 0x57, 0x78, 0x2b, + 0x74, 0x4a, 0x44, 0x66, 0x4c, 0x52, 0x56, 0x70, 0x4f, 0x6f, 0x45, 0x52, + 0x49, 0x79, 0x4e, 0x69, 0x77, 0x6d, 0x63, 0x55, 0x56, 0x68, 0x41, 0x6e, + 0x32, 0x31, 0x6b, 0x6c, 0x4a, 0x77, 0x47, 0x57, 0x34, 0x0a, 0x35, 0x68, + 0x70, 0x78, 0x62, 0x71, 0x43, 0x6f, 0x38, 0x59, 0x4c, 0x6f, 0x52, 0x54, + 0x35, 0x73, 0x31, 0x67, 0x4c, 0x58, 0x43, 0x6d, 0x65, 0x44, 0x42, 0x56, + 0x72, 0x4a, 0x70, 0x42, 0x41, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x4f, + 0x49, 0x53, 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, 0x79, + 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x47, 0x43, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x57, 0x49, 0x53, + 0x65, 0x4b, 0x65, 0x79, 0x20, 0x4f, 0x55, 0x3d, 0x4f, 0x49, 0x53, 0x54, + 0x45, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x4f, 0x49, 0x53, 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, + 0x79, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x47, 0x43, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x57, 0x49, + 0x53, 0x65, 0x4b, 0x65, 0x79, 0x20, 0x4f, 0x55, 0x3d, 0x4f, 0x49, 0x53, + 0x54, 0x45, 0x20, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x20, 0x45, 0x6e, 0x64, 0x6f, 0x72, 0x73, 0x65, 0x64, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x4f, 0x49, 0x53, + 0x54, 0x45, 0x20, 0x57, 0x49, 0x53, 0x65, 0x4b, 0x65, 0x79, 0x20, 0x47, + 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x47, + 0x43, 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x34, 0x34, 0x30, 0x38, 0x34, 0x33, 0x34, 0x35, + 0x36, 0x32, 0x31, 0x30, 0x33, 0x38, 0x35, 0x34, 0x38, 0x31, 0x34, 0x36, + 0x30, 0x36, 0x34, 0x38, 0x30, 0x34, 0x35, 0x36, 0x35, 0x34, 0x33, 0x36, + 0x31, 0x35, 0x32, 0x35, 0x35, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x61, 0x39, 0x3a, 0x64, 0x36, 0x3a, 0x62, 0x39, 0x3a, 0x32, + 0x64, 0x3a, 0x32, 0x66, 0x3a, 0x39, 0x33, 0x3a, 0x36, 0x34, 0x3a, 0x66, + 0x38, 0x3a, 0x61, 0x35, 0x3a, 0x36, 0x39, 0x3a, 0x63, 0x61, 0x3a, 0x39, + 0x31, 0x3a, 0x65, 0x39, 0x3a, 0x36, 0x38, 0x3a, 0x30, 0x37, 0x3a, 0x32, + 0x33, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x30, + 0x3a, 0x31, 0x31, 0x3a, 0x38, 0x34, 0x3a, 0x35, 0x65, 0x3a, 0x33, 0x34, + 0x3a, 0x64, 0x65, 0x3a, 0x62, 0x65, 0x3a, 0x38, 0x38, 0x3a, 0x38, 0x31, + 0x3a, 0x62, 0x39, 0x3a, 0x39, 0x63, 0x3a, 0x66, 0x36, 0x3a, 0x31, 0x36, + 0x3a, 0x32, 0x36, 0x3a, 0x64, 0x31, 0x3a, 0x39, 0x36, 0x3a, 0x31, 0x66, + 0x3a, 0x63, 0x33, 0x3a, 0x62, 0x39, 0x3a, 0x33, 0x31, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x35, 0x3a, 0x36, + 0x30, 0x3a, 0x66, 0x39, 0x3a, 0x31, 0x63, 0x3a, 0x33, 0x36, 0x3a, 0x32, + 0x34, 0x3a, 0x64, 0x61, 0x3a, 0x62, 0x61, 0x3a, 0x39, 0x35, 0x3a, 0x37, + 0x30, 0x3a, 0x62, 0x35, 0x3a, 0x66, 0x65, 0x3a, 0x61, 0x30, 0x3a, 0x64, + 0x62, 0x3a, 0x65, 0x33, 0x3a, 0x36, 0x66, 0x3a, 0x66, 0x31, 0x3a, 0x31, + 0x61, 0x3a, 0x38, 0x33, 0x3a, 0x32, 0x33, 0x3a, 0x62, 0x65, 0x3a, 0x39, + 0x34, 0x3a, 0x38, 0x36, 0x3a, 0x38, 0x35, 0x3a, 0x34, 0x66, 0x3a, 0x62, + 0x33, 0x3a, 0x66, 0x33, 0x3a, 0x34, 0x61, 0x3a, 0x35, 0x35, 0x3a, 0x37, + 0x31, 0x3a, 0x31, 0x39, 0x3a, 0x38, 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x43, 0x61, 0x54, 0x43, 0x43, 0x41, 0x65, 0x2b, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x49, 0x53, 0x70, 0x57, + 0x44, 0x4b, 0x37, 0x61, 0x44, 0x4b, 0x74, 0x41, 0x52, 0x62, 0x38, 0x72, + 0x6f, 0x69, 0x30, 0x36, 0x36, 0x6a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, + 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x42, 0x74, + 0x4d, 0x51, 0x73, 0x77, 0x0a, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x44, 0x53, 0x44, 0x45, 0x51, 0x4d, 0x41, 0x34, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x48, 0x56, 0x30, 0x6c, + 0x54, 0x5a, 0x55, 0x74, 0x6c, 0x65, 0x54, 0x45, 0x69, 0x4d, 0x43, 0x41, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x5a, 0x54, 0x30, 0x6c, + 0x54, 0x56, 0x45, 0x55, 0x67, 0x52, 0x6d, 0x39, 0x31, 0x0a, 0x62, 0x6d, + 0x52, 0x68, 0x64, 0x47, 0x6c, 0x76, 0x62, 0x69, 0x42, 0x46, 0x62, 0x6d, + 0x52, 0x76, 0x63, 0x6e, 0x4e, 0x6c, 0x5a, 0x44, 0x45, 0x6f, 0x4d, 0x43, + 0x59, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x66, 0x54, 0x30, + 0x6c, 0x54, 0x56, 0x45, 0x55, 0x67, 0x56, 0x30, 0x6c, 0x54, 0x5a, 0x55, + 0x74, 0x6c, 0x65, 0x53, 0x42, 0x48, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x77, 0x67, 0x0a, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x48, 0x51, + 0x79, 0x42, 0x44, 0x51, 0x54, 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4e, + 0x7a, 0x41, 0x31, 0x4d, 0x44, 0x6b, 0x77, 0x4f, 0x54, 0x51, 0x34, 0x4d, + 0x7a, 0x52, 0x61, 0x46, 0x77, 0x30, 0x30, 0x4d, 0x6a, 0x41, 0x31, 0x4d, + 0x44, 0x6b, 0x77, 0x4f, 0x54, 0x55, 0x34, 0x4d, 0x7a, 0x4e, 0x61, 0x4d, + 0x47, 0x30, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x0a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x4e, 0x49, 0x4d, 0x52, 0x41, 0x77, + 0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x64, 0x58, + 0x53, 0x56, 0x4e, 0x6c, 0x53, 0x32, 0x56, 0x35, 0x4d, 0x53, 0x49, 0x77, + 0x49, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x78, 0x6c, 0x50, + 0x53, 0x56, 0x4e, 0x55, 0x52, 0x53, 0x42, 0x47, 0x62, 0x33, 0x56, 0x75, + 0x0a, 0x5a, 0x47, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x56, + 0x75, 0x5a, 0x47, 0x39, 0x79, 0x63, 0x32, 0x56, 0x6b, 0x4d, 0x53, 0x67, + 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x39, + 0x50, 0x53, 0x56, 0x4e, 0x55, 0x52, 0x53, 0x42, 0x58, 0x53, 0x56, 0x4e, + 0x6c, 0x53, 0x32, 0x56, 0x35, 0x49, 0x45, 0x64, 0x73, 0x62, 0x32, 0x4a, + 0x68, 0x62, 0x43, 0x42, 0x53, 0x0a, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, + 0x64, 0x44, 0x49, 0x45, 0x4e, 0x42, 0x4d, 0x48, 0x59, 0x77, 0x45, 0x41, + 0x59, 0x48, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x43, 0x41, 0x51, + 0x59, 0x46, 0x4b, 0x34, 0x45, 0x45, 0x41, 0x43, 0x49, 0x44, 0x59, 0x67, + 0x41, 0x45, 0x54, 0x4f, 0x6c, 0x51, 0x77, 0x4d, 0x59, 0x50, 0x63, 0x68, + 0x69, 0x38, 0x32, 0x50, 0x47, 0x36, 0x73, 0x34, 0x6e, 0x69, 0x0a, 0x65, + 0x55, 0x71, 0x6a, 0x46, 0x71, 0x64, 0x72, 0x56, 0x43, 0x54, 0x62, 0x55, + 0x66, 0x2f, 0x71, 0x39, 0x41, 0x6b, 0x6b, 0x77, 0x77, 0x73, 0x69, 0x6e, + 0x38, 0x74, 0x71, 0x4a, 0x34, 0x4b, 0x42, 0x44, 0x64, 0x4c, 0x41, 0x72, + 0x7a, 0x48, 0x6b, 0x64, 0x49, 0x4a, 0x75, 0x79, 0x69, 0x58, 0x5a, 0x6a, + 0x48, 0x57, 0x64, 0x38, 0x64, 0x76, 0x51, 0x6d, 0x71, 0x4a, 0x4c, 0x49, + 0x58, 0x34, 0x57, 0x0a, 0x70, 0x32, 0x4f, 0x51, 0x30, 0x6a, 0x6e, 0x55, + 0x73, 0x59, 0x64, 0x34, 0x58, 0x78, 0x69, 0x57, 0x44, 0x31, 0x41, 0x62, + 0x4e, 0x54, 0x63, 0x50, 0x61, 0x73, 0x62, 0x63, 0x32, 0x52, 0x4e, 0x4e, + 0x70, 0x49, 0x36, 0x51, 0x4e, 0x2b, 0x61, 0x39, 0x57, 0x7a, 0x47, 0x52, + 0x6f, 0x31, 0x51, 0x77, 0x55, 0x6a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x0a, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, + 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, + 0x45, 0x46, 0x67, 0x51, 0x55, 0x53, 0x49, 0x63, 0x55, 0x72, 0x4f, 0x50, + 0x44, 0x6e, 0x70, 0x42, 0x67, 0x4f, 0x74, 0x66, 0x4b, 0x69, 0x65, 0x37, + 0x54, 0x0a, 0x72, 0x59, 0x79, 0x30, 0x55, 0x47, 0x59, 0x77, 0x45, 0x41, + 0x59, 0x4a, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x41, 0x47, 0x43, 0x4e, 0x78, + 0x55, 0x42, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x41, 0x77, 0x43, 0x67, + 0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x45, 0x41, 0x77, + 0x4d, 0x44, 0x61, 0x41, 0x41, 0x77, 0x5a, 0x51, 0x49, 0x77, 0x4a, 0x73, + 0x64, 0x70, 0x57, 0x39, 0x7a, 0x56, 0x0a, 0x35, 0x37, 0x4c, 0x6e, 0x79, + 0x41, 0x79, 0x4d, 0x6a, 0x4d, 0x50, 0x64, 0x65, 0x59, 0x77, 0x62, 0x59, + 0x39, 0x58, 0x4a, 0x55, 0x70, 0x52, 0x4f, 0x54, 0x59, 0x4a, 0x4b, 0x63, + 0x78, 0x36, 0x79, 0x67, 0x49, 0x53, 0x70, 0x4a, 0x63, 0x42, 0x4d, 0x57, + 0x6d, 0x31, 0x4a, 0x4b, 0x57, 0x42, 0x34, 0x45, 0x2b, 0x4a, 0x2b, 0x53, + 0x4f, 0x74, 0x6b, 0x41, 0x6a, 0x45, 0x41, 0x32, 0x7a, 0x51, 0x67, 0x0a, + 0x4d, 0x67, 0x6a, 0x2f, 0x6d, 0x6b, 0x6b, 0x43, 0x74, 0x6f, 0x6a, 0x65, + 0x46, 0x4b, 0x39, 0x64, 0x62, 0x4a, 0x6c, 0x78, 0x6a, 0x52, 0x6f, 0x2f, + 0x69, 0x39, 0x66, 0x67, 0x6f, 0x6a, 0x61, 0x47, 0x48, 0x41, 0x65, 0x43, + 0x4f, 0x6e, 0x5a, 0x54, 0x2f, 0x63, 0x4b, 0x69, 0x37, 0x65, 0x39, 0x37, + 0x73, 0x49, 0x42, 0x50, 0x57, 0x41, 0x39, 0x4c, 0x55, 0x7a, 0x6d, 0x39, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x52, 0x31, 0x20, 0x4f, 0x3d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x20, 0x4c, 0x4c, 0x43, 0x0a, 0x23, 0x20, 0x53, + 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, + 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x31, 0x20, 0x4f, + 0x3d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x4c, + 0x4c, 0x43, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x47, 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x31, + 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, + 0x31, 0x34, 0x36, 0x35, 0x38, 0x37, 0x31, 0x37, 0x35, 0x39, 0x37, 0x31, + 0x37, 0x36, 0x35, 0x30, 0x31, 0x37, 0x36, 0x31, 0x38, 0x34, 0x33, 0x39, + 0x37, 0x35, 0x37, 0x38, 0x31, 0x30, 0x32, 0x36, 0x35, 0x35, 0x35, 0x32, + 0x30, 0x39, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, + 0x32, 0x3a, 0x31, 0x61, 0x3a, 0x65, 0x66, 0x3a, 0x64, 0x34, 0x3a, 0x64, + 0x32, 0x3a, 0x34, 0x61, 0x3a, 0x66, 0x32, 0x3a, 0x39, 0x66, 0x3a, 0x65, + 0x32, 0x3a, 0x33, 0x64, 0x3a, 0x39, 0x37, 0x3a, 0x30, 0x36, 0x3a, 0x31, + 0x34, 0x3a, 0x37, 0x30, 0x3a, 0x37, 0x32, 0x3a, 0x38, 0x35, 0x0a, 0x23, + 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x65, 0x31, 0x3a, 0x63, 0x39, + 0x3a, 0x35, 0x30, 0x3a, 0x65, 0x36, 0x3a, 0x65, 0x66, 0x3a, 0x32, 0x32, + 0x3a, 0x66, 0x38, 0x3a, 0x34, 0x63, 0x3a, 0x35, 0x36, 0x3a, 0x34, 0x35, + 0x3a, 0x37, 0x32, 0x3a, 0x38, 0x62, 0x3a, 0x39, 0x32, 0x3a, 0x32, 0x30, + 0x3a, 0x36, 0x30, 0x3a, 0x64, 0x37, 0x3a, 0x64, 0x35, 0x3a, 0x61, 0x37, + 0x3a, 0x61, 0x33, 0x3a, 0x65, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x61, 0x3a, 0x35, 0x37, 0x3a, 0x35, + 0x34, 0x3a, 0x37, 0x31, 0x3a, 0x65, 0x33, 0x3a, 0x31, 0x33, 0x3a, 0x34, + 0x30, 0x3a, 0x62, 0x63, 0x3a, 0x32, 0x31, 0x3a, 0x35, 0x38, 0x3a, 0x31, + 0x63, 0x3a, 0x62, 0x64, 0x3a, 0x32, 0x63, 0x3a, 0x66, 0x31, 0x3a, 0x33, + 0x65, 0x3a, 0x31, 0x35, 0x3a, 0x38, 0x34, 0x3a, 0x36, 0x33, 0x3a, 0x32, + 0x30, 0x3a, 0x33, 0x65, 0x3a, 0x63, 0x65, 0x3a, 0x39, 0x34, 0x3a, 0x62, + 0x63, 0x3a, 0x66, 0x39, 0x3a, 0x64, 0x33, 0x3a, 0x63, 0x63, 0x3a, 0x31, + 0x39, 0x3a, 0x36, 0x62, 0x3a, 0x66, 0x30, 0x3a, 0x39, 0x61, 0x3a, 0x35, + 0x34, 0x3a, 0x37, 0x32, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, + 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, + 0x46, 0x57, 0x6a, 0x43, 0x43, 0x41, 0x30, 0x4b, 0x67, 0x41, 0x77, 0x49, + 0x42, 0x41, 0x67, 0x49, 0x51, 0x62, 0x6b, 0x65, 0x70, 0x78, 0x55, 0x74, + 0x48, 0x44, 0x41, 0x33, 0x73, 0x4d, 0x39, 0x43, 0x4a, 0x75, 0x52, 0x7a, + 0x30, 0x34, 0x54, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x77, 0x46, 0x41, 0x44, 0x42, + 0x48, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x69, 0x4d, 0x43, + 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x52, 0x32, + 0x39, 0x76, 0x5a, 0x32, 0x78, 0x6c, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, + 0x4e, 0x30, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, + 0x56, 0x7a, 0x49, 0x45, 0x78, 0x4d, 0x0a, 0x51, 0x7a, 0x45, 0x55, 0x4d, + 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4c, 0x52, + 0x31, 0x52, 0x54, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x55, + 0x6a, 0x45, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x59, 0x77, 0x4e, + 0x6a, 0x49, 0x79, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, + 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x59, 0x77, 0x4e, 0x6a, 0x49, 0x79, 0x0a, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, 0x42, 0x48, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x52, 0x32, 0x39, 0x76, + 0x5a, 0x32, 0x78, 0x6c, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, + 0x49, 0x46, 0x4e, 0x6c, 0x0a, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, + 0x7a, 0x49, 0x45, 0x78, 0x4d, 0x51, 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4c, 0x52, 0x31, 0x52, + 0x54, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x55, 0x6a, 0x45, + 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x0a, 0x41, 0x51, + 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, + 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x32, 0x45, 0x51, + 0x4b, 0x4c, 0x48, 0x75, 0x4f, 0x68, 0x64, 0x35, 0x73, 0x37, 0x33, 0x4c, + 0x2b, 0x55, 0x50, 0x72, 0x65, 0x56, 0x70, 0x30, 0x41, 0x38, 0x6f, 0x66, + 0x32, 0x43, 0x2b, 0x58, 0x30, 0x79, 0x42, 0x6f, 0x4a, 0x78, 0x39, 0x76, + 0x61, 0x4d, 0x0a, 0x66, 0x2f, 0x76, 0x6f, 0x32, 0x37, 0x78, 0x71, 0x4c, + 0x70, 0x65, 0x58, 0x6f, 0x34, 0x78, 0x4c, 0x2b, 0x53, 0x76, 0x32, 0x73, + 0x66, 0x6e, 0x4f, 0x68, 0x42, 0x32, 0x78, 0x2b, 0x63, 0x57, 0x58, 0x33, + 0x75, 0x2b, 0x35, 0x38, 0x71, 0x50, 0x70, 0x76, 0x42, 0x4b, 0x4a, 0x58, + 0x71, 0x65, 0x71, 0x55, 0x71, 0x76, 0x34, 0x49, 0x79, 0x66, 0x4c, 0x70, + 0x4c, 0x47, 0x63, 0x59, 0x39, 0x76, 0x58, 0x0a, 0x6d, 0x58, 0x37, 0x77, + 0x43, 0x6c, 0x37, 0x72, 0x61, 0x4b, 0x62, 0x30, 0x78, 0x6c, 0x70, 0x48, + 0x44, 0x55, 0x30, 0x51, 0x4d, 0x2b, 0x4e, 0x4f, 0x73, 0x52, 0x4f, 0x6a, + 0x79, 0x42, 0x68, 0x73, 0x53, 0x2b, 0x7a, 0x38, 0x43, 0x5a, 0x44, 0x66, + 0x6e, 0x57, 0x51, 0x70, 0x4a, 0x53, 0x4d, 0x48, 0x6f, 0x62, 0x54, 0x53, + 0x50, 0x53, 0x35, 0x67, 0x34, 0x4d, 0x2f, 0x53, 0x43, 0x59, 0x65, 0x37, + 0x0a, 0x7a, 0x55, 0x6a, 0x77, 0x54, 0x63, 0x4c, 0x43, 0x65, 0x6f, 0x69, + 0x4b, 0x75, 0x37, 0x72, 0x50, 0x57, 0x52, 0x6e, 0x57, 0x72, 0x34, 0x2b, + 0x77, 0x42, 0x37, 0x43, 0x65, 0x4d, 0x66, 0x47, 0x43, 0x77, 0x63, 0x44, + 0x66, 0x4c, 0x71, 0x5a, 0x74, 0x62, 0x42, 0x6b, 0x4f, 0x74, 0x64, 0x68, + 0x2b, 0x4a, 0x68, 0x70, 0x46, 0x41, 0x7a, 0x32, 0x77, 0x65, 0x61, 0x53, + 0x55, 0x4b, 0x4b, 0x30, 0x50, 0x0a, 0x66, 0x79, 0x62, 0x6c, 0x71, 0x41, + 0x6a, 0x2b, 0x6c, 0x75, 0x67, 0x38, 0x61, 0x4a, 0x52, 0x54, 0x37, 0x6f, + 0x4d, 0x36, 0x69, 0x43, 0x73, 0x56, 0x6c, 0x67, 0x6d, 0x79, 0x34, 0x48, + 0x71, 0x4d, 0x4c, 0x6e, 0x58, 0x57, 0x6e, 0x4f, 0x75, 0x6e, 0x56, 0x6d, + 0x53, 0x50, 0x6c, 0x6b, 0x39, 0x6f, 0x72, 0x6a, 0x32, 0x58, 0x77, 0x6f, + 0x53, 0x50, 0x77, 0x4c, 0x78, 0x41, 0x77, 0x41, 0x74, 0x63, 0x0a, 0x76, + 0x66, 0x61, 0x48, 0x73, 0x7a, 0x56, 0x73, 0x72, 0x42, 0x68, 0x51, 0x66, + 0x34, 0x54, 0x67, 0x54, 0x4d, 0x32, 0x53, 0x30, 0x79, 0x44, 0x70, 0x4d, + 0x37, 0x78, 0x53, 0x6d, 0x61, 0x38, 0x79, 0x74, 0x53, 0x6d, 0x7a, 0x4a, + 0x53, 0x71, 0x30, 0x53, 0x50, 0x6c, 0x79, 0x34, 0x63, 0x70, 0x6b, 0x39, + 0x2b, 0x61, 0x43, 0x45, 0x49, 0x33, 0x6f, 0x6e, 0x63, 0x4b, 0x4b, 0x69, + 0x50, 0x6f, 0x34, 0x0a, 0x5a, 0x6f, 0x72, 0x38, 0x59, 0x2f, 0x6b, 0x42, + 0x2b, 0x58, 0x6a, 0x39, 0x65, 0x31, 0x78, 0x33, 0x2b, 0x6e, 0x61, 0x48, + 0x2b, 0x75, 0x7a, 0x66, 0x73, 0x51, 0x35, 0x35, 0x6c, 0x56, 0x65, 0x30, + 0x76, 0x53, 0x62, 0x76, 0x31, 0x67, 0x48, 0x52, 0x36, 0x78, 0x59, 0x4b, + 0x75, 0x34, 0x34, 0x4c, 0x74, 0x63, 0x58, 0x46, 0x69, 0x6c, 0x57, 0x72, + 0x30, 0x36, 0x7a, 0x71, 0x6b, 0x55, 0x73, 0x70, 0x0a, 0x7a, 0x42, 0x6d, + 0x6b, 0x4d, 0x69, 0x56, 0x4f, 0x4b, 0x76, 0x46, 0x6c, 0x52, 0x4e, 0x41, + 0x43, 0x7a, 0x71, 0x72, 0x4f, 0x53, 0x62, 0x54, 0x71, 0x6e, 0x33, 0x79, + 0x44, 0x73, 0x45, 0x42, 0x37, 0x35, 0x30, 0x4f, 0x72, 0x70, 0x32, 0x79, + 0x6a, 0x6a, 0x33, 0x32, 0x4a, 0x67, 0x66, 0x70, 0x4d, 0x70, 0x66, 0x2f, + 0x56, 0x6a, 0x73, 0x50, 0x4f, 0x53, 0x2b, 0x43, 0x31, 0x32, 0x4c, 0x4f, + 0x4f, 0x0a, 0x52, 0x63, 0x39, 0x32, 0x77, 0x4f, 0x31, 0x41, 0x4b, 0x2f, + 0x31, 0x54, 0x44, 0x37, 0x43, 0x6e, 0x31, 0x54, 0x73, 0x4e, 0x73, 0x59, + 0x71, 0x69, 0x41, 0x39, 0x34, 0x78, 0x72, 0x63, 0x78, 0x33, 0x36, 0x6d, + 0x39, 0x37, 0x50, 0x74, 0x62, 0x66, 0x6b, 0x53, 0x49, 0x53, 0x35, 0x72, + 0x37, 0x36, 0x32, 0x44, 0x4c, 0x38, 0x45, 0x47, 0x4d, 0x55, 0x55, 0x58, + 0x4c, 0x65, 0x58, 0x64, 0x59, 0x57, 0x0a, 0x6b, 0x37, 0x30, 0x70, 0x61, + 0x44, 0x50, 0x76, 0x4f, 0x6d, 0x62, 0x73, 0x42, 0x34, 0x6f, 0x6d, 0x33, + 0x78, 0x50, 0x58, 0x56, 0x32, 0x56, 0x34, 0x4a, 0x39, 0x35, 0x65, 0x53, + 0x52, 0x51, 0x41, 0x6f, 0x67, 0x42, 0x2f, 0x6d, 0x71, 0x67, 0x68, 0x74, + 0x71, 0x6d, 0x78, 0x6c, 0x62, 0x43, 0x6c, 0x75, 0x51, 0x30, 0x57, 0x45, + 0x64, 0x72, 0x48, 0x62, 0x45, 0x67, 0x38, 0x51, 0x4f, 0x42, 0x2b, 0x0a, + 0x44, 0x56, 0x72, 0x4e, 0x56, 0x6a, 0x7a, 0x52, 0x6c, 0x77, 0x57, 0x35, + 0x79, 0x30, 0x76, 0x74, 0x4f, 0x55, 0x75, 0x63, 0x78, 0x44, 0x2f, 0x53, + 0x56, 0x52, 0x4e, 0x75, 0x4a, 0x4c, 0x44, 0x57, 0x63, 0x66, 0x72, 0x30, + 0x77, 0x62, 0x72, 0x4d, 0x37, 0x52, 0x76, 0x31, 0x2f, 0x6f, 0x46, 0x42, + 0x32, 0x41, 0x43, 0x59, 0x50, 0x54, 0x72, 0x49, 0x72, 0x6e, 0x71, 0x59, + 0x4e, 0x78, 0x67, 0x46, 0x0a, 0x6c, 0x51, 0x49, 0x44, 0x41, 0x51, 0x41, + 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, + 0x42, 0x2f, 0x7a, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x51, + 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x35, 0x4b, 0x38, 0x72, 0x4a, 0x6e, + 0x45, 0x61, 0x4b, 0x30, 0x67, 0x6e, 0x68, 0x53, 0x39, 0x53, 0x5a, 0x69, + 0x7a, 0x76, 0x38, 0x49, 0x6b, 0x54, 0x63, 0x54, 0x34, 0x77, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4d, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x44, + 0x69, 0x57, 0x0a, 0x43, 0x75, 0x34, 0x39, 0x74, 0x4a, 0x59, 0x65, 0x58, + 0x2b, 0x2b, 0x64, 0x6e, 0x41, 0x73, 0x7a, 0x6e, 0x79, 0x76, 0x67, 0x79, + 0x76, 0x33, 0x53, 0x6a, 0x67, 0x6f, 0x66, 0x51, 0x58, 0x53, 0x6c, 0x66, + 0x4b, 0x71, 0x45, 0x31, 0x4f, 0x58, 0x79, 0x48, 0x75, 0x59, 0x33, 0x55, + 0x6a, 0x4b, 0x63, 0x43, 0x39, 0x46, 0x68, 0x48, 0x62, 0x38, 0x6f, 0x77, + 0x62, 0x5a, 0x45, 0x4b, 0x54, 0x56, 0x31, 0x0a, 0x64, 0x35, 0x69, 0x79, + 0x66, 0x4e, 0x6d, 0x39, 0x64, 0x4b, 0x79, 0x4b, 0x61, 0x4f, 0x4f, 0x70, + 0x4d, 0x51, 0x6b, 0x70, 0x41, 0x57, 0x42, 0x7a, 0x34, 0x30, 0x64, 0x38, + 0x55, 0x36, 0x69, 0x51, 0x53, 0x69, 0x66, 0x76, 0x53, 0x39, 0x65, 0x66, + 0x6b, 0x2b, 0x65, 0x43, 0x4e, 0x73, 0x36, 0x61, 0x61, 0x41, 0x79, 0x43, + 0x35, 0x38, 0x2f, 0x55, 0x45, 0x42, 0x5a, 0x76, 0x58, 0x77, 0x36, 0x5a, + 0x0a, 0x58, 0x50, 0x59, 0x66, 0x63, 0x58, 0x33, 0x76, 0x37, 0x33, 0x73, + 0x76, 0x66, 0x75, 0x6f, 0x32, 0x31, 0x70, 0x64, 0x77, 0x43, 0x78, 0x58, + 0x75, 0x31, 0x31, 0x78, 0x57, 0x61, 0x6a, 0x4f, 0x6c, 0x34, 0x30, 0x6b, + 0x34, 0x44, 0x4c, 0x68, 0x39, 0x2b, 0x34, 0x32, 0x46, 0x70, 0x4c, 0x46, + 0x5a, 0x58, 0x76, 0x52, 0x71, 0x34, 0x64, 0x32, 0x68, 0x39, 0x6d, 0x52, + 0x45, 0x72, 0x75, 0x5a, 0x52, 0x0a, 0x67, 0x79, 0x46, 0x6d, 0x78, 0x68, + 0x45, 0x2b, 0x38, 0x38, 0x35, 0x48, 0x37, 0x70, 0x77, 0x6f, 0x48, 0x79, + 0x58, 0x61, 0x2f, 0x36, 0x78, 0x6d, 0x6c, 0x64, 0x30, 0x31, 0x44, 0x31, + 0x7a, 0x76, 0x49, 0x43, 0x78, 0x69, 0x2f, 0x5a, 0x47, 0x36, 0x71, 0x63, + 0x7a, 0x38, 0x57, 0x70, 0x79, 0x54, 0x67, 0x59, 0x4d, 0x70, 0x6c, 0x30, + 0x70, 0x38, 0x57, 0x6e, 0x4b, 0x30, 0x4f, 0x64, 0x43, 0x33, 0x0a, 0x64, + 0x38, 0x74, 0x35, 0x2f, 0x57, 0x6b, 0x36, 0x6b, 0x6a, 0x66, 0x74, 0x62, + 0x6a, 0x68, 0x6c, 0x52, 0x6e, 0x37, 0x70, 0x59, 0x4c, 0x31, 0x35, 0x69, + 0x4a, 0x64, 0x66, 0x4f, 0x42, 0x4c, 0x30, 0x37, 0x71, 0x39, 0x62, 0x67, + 0x73, 0x69, 0x47, 0x31, 0x65, 0x47, 0x5a, 0x62, 0x59, 0x77, 0x45, 0x38, + 0x6e, 0x61, 0x36, 0x53, 0x66, 0x5a, 0x75, 0x36, 0x57, 0x30, 0x65, 0x58, + 0x36, 0x44, 0x76, 0x0a, 0x4a, 0x34, 0x4a, 0x32, 0x51, 0x50, 0x69, 0x6d, + 0x30, 0x31, 0x68, 0x63, 0x44, 0x79, 0x78, 0x43, 0x32, 0x6b, 0x4c, 0x47, + 0x65, 0x34, 0x67, 0x30, 0x78, 0x38, 0x48, 0x59, 0x52, 0x5a, 0x76, 0x42, + 0x50, 0x73, 0x56, 0x68, 0x48, 0x64, 0x6c, 0x6a, 0x55, 0x45, 0x6e, 0x32, + 0x4e, 0x49, 0x56, 0x71, 0x34, 0x42, 0x6a, 0x46, 0x62, 0x6b, 0x65, 0x72, + 0x51, 0x55, 0x49, 0x70, 0x6d, 0x2f, 0x5a, 0x67, 0x0a, 0x44, 0x64, 0x49, + 0x78, 0x30, 0x32, 0x4f, 0x59, 0x49, 0x35, 0x4e, 0x61, 0x41, 0x49, 0x46, + 0x49, 0x74, 0x4f, 0x2f, 0x4e, 0x69, 0x73, 0x33, 0x4a, 0x7a, 0x35, 0x6e, + 0x75, 0x32, 0x5a, 0x36, 0x71, 0x4e, 0x75, 0x46, 0x6f, 0x53, 0x33, 0x46, + 0x4a, 0x46, 0x44, 0x59, 0x6f, 0x4f, 0x6a, 0x30, 0x64, 0x7a, 0x70, 0x71, + 0x50, 0x4a, 0x65, 0x61, 0x41, 0x63, 0x57, 0x45, 0x72, 0x74, 0x58, 0x76, + 0x4d, 0x0a, 0x2b, 0x53, 0x55, 0x57, 0x67, 0x65, 0x45, 0x78, 0x58, 0x36, + 0x47, 0x6a, 0x66, 0x68, 0x61, 0x6b, 0x6e, 0x42, 0x5a, 0x71, 0x6c, 0x78, + 0x69, 0x39, 0x64, 0x6e, 0x4b, 0x6c, 0x43, 0x35, 0x34, 0x64, 0x4e, 0x75, + 0x59, 0x76, 0x6f, 0x53, 0x2b, 0x2b, 0x63, 0x4a, 0x45, 0x50, 0x71, 0x4f, + 0x62, 0x61, 0x2b, 0x4d, 0x53, 0x53, 0x51, 0x47, 0x77, 0x6c, 0x66, 0x6e, + 0x75, 0x7a, 0x43, 0x64, 0x79, 0x79, 0x0a, 0x46, 0x36, 0x32, 0x41, 0x52, + 0x50, 0x42, 0x6f, 0x70, 0x59, 0x2b, 0x55, 0x64, 0x66, 0x39, 0x30, 0x57, + 0x75, 0x69, 0x6f, 0x41, 0x6e, 0x77, 0x4d, 0x43, 0x65, 0x4b, 0x70, 0x53, + 0x77, 0x75, 0x67, 0x68, 0x51, 0x74, 0x69, 0x75, 0x65, 0x2b, 0x68, 0x4d, + 0x5a, 0x4c, 0x37, 0x37, 0x2f, 0x5a, 0x52, 0x42, 0x49, 0x6c, 0x73, 0x36, + 0x4b, 0x6c, 0x30, 0x6f, 0x62, 0x73, 0x58, 0x73, 0x37, 0x58, 0x39, 0x0a, + 0x53, 0x51, 0x39, 0x38, 0x50, 0x4f, 0x79, 0x44, 0x47, 0x43, 0x42, 0x44, + 0x54, 0x74, 0x57, 0x54, 0x75, 0x72, 0x51, 0x30, 0x73, 0x52, 0x38, 0x57, + 0x4e, 0x68, 0x38, 0x4d, 0x35, 0x6d, 0x51, 0x35, 0x46, 0x6b, 0x7a, 0x63, + 0x34, 0x50, 0x34, 0x64, 0x79, 0x4b, 0x6c, 0x69, 0x50, 0x55, 0x44, 0x71, + 0x79, 0x73, 0x55, 0x30, 0x41, 0x72, 0x53, 0x75, 0x69, 0x59, 0x67, 0x7a, + 0x4e, 0x64, 0x77, 0x73, 0x0a, 0x45, 0x33, 0x50, 0x59, 0x4a, 0x2f, 0x48, + 0x51, 0x63, 0x75, 0x35, 0x31, 0x4f, 0x79, 0x4c, 0x65, 0x6d, 0x47, 0x68, + 0x6d, 0x57, 0x2f, 0x48, 0x47, 0x59, 0x30, 0x64, 0x56, 0x48, 0x4c, 0x71, + 0x6c, 0x43, 0x46, 0x46, 0x31, 0x70, 0x6b, 0x67, 0x6c, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x47, 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, + 0x32, 0x20, 0x4f, 0x3d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x20, 0x4c, 0x4c, 0x43, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x54, 0x53, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x32, 0x20, 0x4f, 0x3d, 0x47, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x4c, 0x4c, 0x43, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x54, + 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x32, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x36, + 0x35, 0x38, 0x37, 0x31, 0x37, 0x36, 0x30, 0x35, 0x35, 0x37, 0x36, 0x37, + 0x30, 0x35, 0x33, 0x38, 0x31, 0x34, 0x34, 0x37, 0x39, 0x33, 0x38, 0x36, + 0x39, 0x35, 0x33, 0x31, 0x31, 0x32, 0x35, 0x34, 0x37, 0x39, 0x35, 0x31, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x34, 0x34, 0x3a, 0x65, + 0x64, 0x3a, 0x39, 0x61, 0x3a, 0x30, 0x65, 0x3a, 0x61, 0x34, 0x3a, 0x30, + 0x39, 0x3a, 0x33, 0x62, 0x3a, 0x30, 0x30, 0x3a, 0x66, 0x32, 0x3a, 0x61, + 0x65, 0x3a, 0x34, 0x63, 0x3a, 0x61, 0x33, 0x3a, 0x63, 0x36, 0x3a, 0x36, + 0x31, 0x3a, 0x62, 0x30, 0x3a, 0x38, 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x32, 0x3a, 0x37, 0x33, 0x3a, 0x39, 0x36, + 0x3a, 0x32, 0x61, 0x3a, 0x32, 0x61, 0x3a, 0x35, 0x65, 0x3a, 0x33, 0x39, + 0x3a, 0x39, 0x66, 0x3a, 0x37, 0x33, 0x3a, 0x33, 0x66, 0x3a, 0x65, 0x31, + 0x3a, 0x63, 0x37, 0x3a, 0x31, 0x65, 0x3a, 0x36, 0x34, 0x3a, 0x33, 0x66, + 0x3a, 0x30, 0x33, 0x3a, 0x33, 0x38, 0x3a, 0x33, 0x34, 0x3a, 0x66, 0x63, + 0x3a, 0x34, 0x64, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x63, 0x34, 0x3a, 0x35, 0x64, 0x3a, 0x37, 0x62, 0x3a, 0x62, + 0x30, 0x3a, 0x38, 0x65, 0x3a, 0x36, 0x64, 0x3a, 0x36, 0x37, 0x3a, 0x65, + 0x36, 0x3a, 0x32, 0x65, 0x3a, 0x34, 0x32, 0x3a, 0x33, 0x35, 0x3a, 0x31, + 0x31, 0x3a, 0x30, 0x62, 0x3a, 0x35, 0x36, 0x3a, 0x34, 0x65, 0x3a, 0x35, + 0x66, 0x3a, 0x37, 0x38, 0x3a, 0x66, 0x64, 0x3a, 0x39, 0x32, 0x3a, 0x65, + 0x66, 0x3a, 0x30, 0x35, 0x3a, 0x38, 0x63, 0x3a, 0x38, 0x34, 0x3a, 0x30, + 0x61, 0x3a, 0x65, 0x61, 0x3a, 0x34, 0x65, 0x3a, 0x36, 0x34, 0x3a, 0x35, + 0x35, 0x3a, 0x64, 0x37, 0x3a, 0x35, 0x38, 0x3a, 0x35, 0x63, 0x3a, 0x36, + 0x30, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x57, 0x6a, + 0x43, 0x43, 0x41, 0x30, 0x4b, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x51, 0x62, 0x6b, 0x65, 0x70, 0x78, 0x6c, 0x71, 0x7a, 0x35, 0x79, + 0x44, 0x46, 0x4d, 0x4a, 0x6f, 0x2f, 0x61, 0x46, 0x4c, 0x79, 0x62, 0x7a, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, + 0x30, 0x42, 0x41, 0x51, 0x77, 0x46, 0x41, 0x44, 0x42, 0x48, 0x0a, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x52, 0x32, 0x39, 0x76, 0x5a, + 0x32, 0x78, 0x6c, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, + 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x49, + 0x45, 0x78, 0x4d, 0x0a, 0x51, 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4c, 0x52, 0x31, 0x52, 0x54, + 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x55, 0x6a, 0x49, 0x77, + 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x59, 0x77, 0x4e, 0x6a, 0x49, 0x79, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, + 0x4d, 0x7a, 0x59, 0x77, 0x4e, 0x6a, 0x49, 0x79, 0x0a, 0x4d, 0x44, 0x41, + 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, 0x42, 0x48, 0x4d, 0x51, 0x73, + 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, + 0x56, 0x55, 0x7a, 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x52, 0x32, 0x39, 0x76, 0x5a, 0x32, 0x78, + 0x6c, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x4e, + 0x6c, 0x0a, 0x63, 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x49, 0x45, + 0x78, 0x4d, 0x51, 0x7a, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4c, 0x52, 0x31, 0x52, 0x54, 0x49, 0x46, + 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x55, 0x6a, 0x49, 0x77, 0x67, 0x67, + 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x0a, 0x41, 0x51, 0x55, 0x41, 0x41, + 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, 0x67, 0x49, 0x4b, 0x41, + 0x6f, 0x49, 0x43, 0x41, 0x51, 0x44, 0x4f, 0x33, 0x76, 0x32, 0x6d, 0x2b, + 0x2b, 0x7a, 0x73, 0x46, 0x44, 0x51, 0x38, 0x42, 0x77, 0x5a, 0x61, 0x62, + 0x46, 0x6e, 0x33, 0x47, 0x54, 0x58, 0x64, 0x39, 0x38, 0x47, 0x64, 0x56, + 0x61, 0x72, 0x54, 0x7a, 0x54, 0x75, 0x6b, 0x6b, 0x33, 0x4c, 0x76, 0x0a, + 0x43, 0x76, 0x70, 0x74, 0x6e, 0x66, 0x62, 0x77, 0x68, 0x59, 0x42, 0x62, + 0x6f, 0x55, 0x68, 0x53, 0x6e, 0x7a, 0x6e, 0x46, 0x74, 0x2b, 0x34, 0x6f, + 0x72, 0x4f, 0x2f, 0x4c, 0x64, 0x6d, 0x67, 0x55, 0x75, 0x64, 0x2b, 0x74, + 0x41, 0x57, 0x79, 0x5a, 0x48, 0x38, 0x51, 0x69, 0x48, 0x5a, 0x2f, 0x2b, + 0x63, 0x6e, 0x66, 0x67, 0x4c, 0x46, 0x75, 0x76, 0x35, 0x41, 0x53, 0x2f, + 0x54, 0x33, 0x4b, 0x67, 0x0a, 0x47, 0x6a, 0x53, 0x59, 0x36, 0x44, 0x6c, + 0x6f, 0x37, 0x4a, 0x55, 0x6c, 0x65, 0x33, 0x61, 0x68, 0x35, 0x6d, 0x6d, + 0x35, 0x68, 0x52, 0x6d, 0x39, 0x69, 0x59, 0x7a, 0x2b, 0x72, 0x65, 0x30, + 0x32, 0x36, 0x6e, 0x4f, 0x38, 0x2f, 0x34, 0x50, 0x69, 0x79, 0x33, 0x33, + 0x42, 0x30, 0x73, 0x35, 0x4b, 0x73, 0x34, 0x30, 0x46, 0x6e, 0x6f, 0x74, + 0x4a, 0x6b, 0x39, 0x2f, 0x42, 0x57, 0x39, 0x42, 0x75, 0x0a, 0x58, 0x76, + 0x41, 0x75, 0x4d, 0x43, 0x36, 0x43, 0x2f, 0x50, 0x71, 0x38, 0x74, 0x42, + 0x63, 0x4b, 0x53, 0x4f, 0x57, 0x49, 0x6d, 0x38, 0x57, 0x62, 0x61, 0x39, + 0x36, 0x77, 0x79, 0x72, 0x51, 0x44, 0x38, 0x4e, 0x72, 0x30, 0x6b, 0x4c, + 0x68, 0x6c, 0x5a, 0x50, 0x64, 0x63, 0x54, 0x4b, 0x33, 0x6f, 0x66, 0x6d, + 0x5a, 0x65, 0x6d, 0x64, 0x65, 0x34, 0x77, 0x6a, 0x37, 0x49, 0x30, 0x42, + 0x4f, 0x64, 0x0a, 0x72, 0x65, 0x37, 0x6b, 0x52, 0x58, 0x75, 0x4a, 0x56, + 0x66, 0x65, 0x4b, 0x48, 0x32, 0x4a, 0x53, 0x68, 0x42, 0x4b, 0x7a, 0x77, + 0x6b, 0x43, 0x58, 0x34, 0x34, 0x6f, 0x66, 0x52, 0x35, 0x47, 0x6d, 0x64, + 0x46, 0x72, 0x53, 0x2b, 0x4c, 0x46, 0x6a, 0x4b, 0x42, 0x43, 0x34, 0x73, + 0x77, 0x6d, 0x34, 0x56, 0x6e, 0x64, 0x41, 0x6f, 0x69, 0x61, 0x59, 0x65, + 0x63, 0x62, 0x2b, 0x33, 0x79, 0x58, 0x75, 0x0a, 0x50, 0x75, 0x57, 0x67, + 0x66, 0x39, 0x52, 0x68, 0x44, 0x31, 0x46, 0x4c, 0x50, 0x44, 0x2b, 0x4d, + 0x32, 0x75, 0x46, 0x77, 0x64, 0x4e, 0x6a, 0x43, 0x61, 0x4b, 0x48, 0x35, + 0x77, 0x51, 0x7a, 0x70, 0x6f, 0x65, 0x4a, 0x2f, 0x75, 0x31, 0x55, 0x38, + 0x64, 0x67, 0x62, 0x75, 0x61, 0x6b, 0x37, 0x4d, 0x6b, 0x6f, 0x67, 0x77, + 0x54, 0x5a, 0x71, 0x39, 0x54, 0x77, 0x74, 0x49, 0x6d, 0x6f, 0x53, 0x31, + 0x0a, 0x6d, 0x4b, 0x50, 0x56, 0x2b, 0x33, 0x50, 0x42, 0x56, 0x32, 0x48, + 0x64, 0x4b, 0x46, 0x5a, 0x31, 0x45, 0x36, 0x36, 0x48, 0x6a, 0x75, 0x63, + 0x4d, 0x55, 0x51, 0x6b, 0x51, 0x64, 0x59, 0x68, 0x4d, 0x76, 0x49, 0x33, + 0x35, 0x65, 0x7a, 0x7a, 0x55, 0x49, 0x6b, 0x67, 0x66, 0x4b, 0x74, 0x7a, + 0x72, 0x61, 0x37, 0x74, 0x45, 0x73, 0x63, 0x73, 0x7a, 0x63, 0x54, 0x4a, + 0x47, 0x72, 0x36, 0x31, 0x4b, 0x0a, 0x38, 0x59, 0x7a, 0x6f, 0x64, 0x44, + 0x71, 0x73, 0x35, 0x78, 0x6f, 0x69, 0x63, 0x34, 0x44, 0x53, 0x4d, 0x50, + 0x63, 0x6c, 0x51, 0x73, 0x63, 0x69, 0x4f, 0x7a, 0x73, 0x53, 0x72, 0x5a, + 0x59, 0x75, 0x78, 0x73, 0x4e, 0x32, 0x42, 0x36, 0x6f, 0x67, 0x74, 0x7a, + 0x56, 0x4a, 0x56, 0x2b, 0x6d, 0x53, 0x53, 0x65, 0x68, 0x32, 0x46, 0x6e, + 0x49, 0x78, 0x5a, 0x79, 0x75, 0x57, 0x66, 0x6f, 0x71, 0x6a, 0x0a, 0x78, + 0x35, 0x52, 0x57, 0x49, 0x72, 0x39, 0x71, 0x53, 0x33, 0x34, 0x42, 0x49, + 0x62, 0x49, 0x6a, 0x4d, 0x74, 0x2f, 0x6b, 0x6d, 0x6b, 0x52, 0x74, 0x57, + 0x56, 0x74, 0x64, 0x39, 0x51, 0x43, 0x67, 0x48, 0x4a, 0x76, 0x47, 0x65, + 0x4a, 0x65, 0x4e, 0x6b, 0x50, 0x2b, 0x62, 0x79, 0x4b, 0x71, 0x30, 0x72, + 0x78, 0x46, 0x52, 0x4f, 0x56, 0x37, 0x5a, 0x2b, 0x32, 0x65, 0x74, 0x31, + 0x56, 0x73, 0x52, 0x0a, 0x6e, 0x54, 0x4b, 0x61, 0x47, 0x37, 0x33, 0x56, + 0x75, 0x6c, 0x75, 0x6c, 0x79, 0x63, 0x73, 0x6c, 0x61, 0x56, 0x4e, 0x56, + 0x4a, 0x31, 0x7a, 0x67, 0x79, 0x6a, 0x62, 0x4c, 0x69, 0x47, 0x48, 0x37, + 0x48, 0x72, 0x66, 0x51, 0x79, 0x2b, 0x34, 0x57, 0x2b, 0x39, 0x4f, 0x6d, + 0x54, 0x4e, 0x36, 0x53, 0x70, 0x64, 0x54, 0x69, 0x33, 0x2f, 0x55, 0x47, + 0x56, 0x4e, 0x34, 0x75, 0x6e, 0x55, 0x75, 0x30, 0x0a, 0x6b, 0x7a, 0x43, + 0x71, 0x67, 0x63, 0x37, 0x64, 0x47, 0x74, 0x78, 0x52, 0x63, 0x77, 0x31, + 0x50, 0x63, 0x4f, 0x6e, 0x6c, 0x74, 0x68, 0x59, 0x68, 0x47, 0x58, 0x6d, + 0x79, 0x35, 0x6f, 0x6b, 0x4c, 0x64, 0x57, 0x54, 0x4b, 0x31, 0x61, 0x75, + 0x38, 0x43, 0x63, 0x45, 0x59, 0x6f, 0x66, 0x2f, 0x55, 0x56, 0x4b, 0x47, + 0x46, 0x50, 0x50, 0x30, 0x55, 0x4a, 0x41, 0x4f, 0x79, 0x68, 0x39, 0x4f, + 0x6b, 0x0a, 0x74, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, + 0x49, 0x77, 0x51, 0x44, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, + 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, + 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, + 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, + 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x48, 0x51, 0x34, 0x45, 0x46, + 0x67, 0x51, 0x55, 0x75, 0x2f, 0x2f, 0x4b, 0x6a, 0x69, 0x4f, 0x66, 0x54, + 0x35, 0x6e, 0x4b, 0x32, 0x2b, 0x4a, 0x6f, 0x70, 0x71, 0x55, 0x56, 0x4a, + 0x78, 0x63, 0x65, 0x32, 0x51, 0x34, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, + 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4d, 0x42, + 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x4c, 0x5a, 0x70, 0x0a, + 0x38, 0x4b, 0x5a, 0x33, 0x2f, 0x70, 0x37, 0x75, 0x43, 0x34, 0x47, 0x74, + 0x34, 0x63, 0x43, 0x70, 0x78, 0x2f, 0x6b, 0x31, 0x48, 0x55, 0x43, 0x43, + 0x71, 0x2b, 0x59, 0x45, 0x74, 0x4e, 0x2f, 0x4c, 0x39, 0x78, 0x30, 0x50, + 0x67, 0x2f, 0x42, 0x2b, 0x45, 0x30, 0x32, 0x4e, 0x6a, 0x4f, 0x37, 0x6a, + 0x4d, 0x79, 0x4c, 0x44, 0x4f, 0x66, 0x78, 0x41, 0x33, 0x32, 0x35, 0x42, + 0x53, 0x30, 0x4a, 0x54, 0x0a, 0x76, 0x68, 0x61, 0x49, 0x38, 0x64, 0x49, + 0x34, 0x58, 0x73, 0x52, 0x6f, 0x6d, 0x52, 0x79, 0x59, 0x55, 0x70, 0x4f, + 0x4d, 0x35, 0x32, 0x6a, 0x74, 0x47, 0x32, 0x70, 0x7a, 0x65, 0x67, 0x56, + 0x41, 0x54, 0x58, 0x39, 0x6c, 0x4f, 0x39, 0x5a, 0x59, 0x38, 0x63, 0x36, + 0x44, 0x52, 0x32, 0x44, 0x6a, 0x2f, 0x35, 0x65, 0x70, 0x6e, 0x47, 0x42, + 0x33, 0x47, 0x46, 0x57, 0x31, 0x66, 0x67, 0x69, 0x54, 0x0a, 0x7a, 0x39, + 0x44, 0x32, 0x50, 0x47, 0x63, 0x44, 0x46, 0x57, 0x45, 0x4a, 0x2b, 0x59, + 0x46, 0x35, 0x39, 0x65, 0x78, 0x54, 0x70, 0x4a, 0x2f, 0x4a, 0x6a, 0x77, + 0x47, 0x4c, 0x63, 0x38, 0x52, 0x33, 0x64, 0x74, 0x79, 0x44, 0x6f, 0x76, + 0x55, 0x4d, 0x53, 0x52, 0x71, 0x6f, 0x64, 0x74, 0x36, 0x53, 0x6d, 0x32, + 0x54, 0x34, 0x73, 0x79, 0x7a, 0x46, 0x4a, 0x39, 0x4d, 0x48, 0x77, 0x41, + 0x69, 0x41, 0x0a, 0x70, 0x4a, 0x69, 0x53, 0x34, 0x77, 0x47, 0x57, 0x41, + 0x71, 0x6f, 0x43, 0x37, 0x6f, 0x38, 0x37, 0x78, 0x64, 0x46, 0x74, 0x43, + 0x6a, 0x4d, 0x77, 0x63, 0x33, 0x69, 0x35, 0x54, 0x31, 0x51, 0x57, 0x76, + 0x77, 0x73, 0x48, 0x6f, 0x61, 0x52, 0x63, 0x35, 0x73, 0x76, 0x4a, 0x58, + 0x49, 0x53, 0x50, 0x44, 0x2b, 0x41, 0x56, 0x64, 0x79, 0x78, 0x2b, 0x4a, + 0x6e, 0x37, 0x61, 0x78, 0x45, 0x76, 0x62, 0x0a, 0x70, 0x78, 0x5a, 0x33, + 0x42, 0x37, 0x44, 0x4e, 0x64, 0x65, 0x68, 0x79, 0x51, 0x74, 0x61, 0x56, + 0x68, 0x4a, 0x32, 0x47, 0x67, 0x2f, 0x4c, 0x6b, 0x6b, 0x4d, 0x30, 0x4a, + 0x52, 0x39, 0x53, 0x4c, 0x41, 0x33, 0x44, 0x61, 0x57, 0x73, 0x59, 0x44, + 0x51, 0x76, 0x54, 0x74, 0x4e, 0x36, 0x4c, 0x77, 0x47, 0x31, 0x42, 0x55, + 0x53, 0x77, 0x37, 0x59, 0x68, 0x4e, 0x34, 0x5a, 0x4b, 0x4a, 0x6d, 0x42, + 0x0a, 0x52, 0x36, 0x34, 0x4a, 0x47, 0x7a, 0x39, 0x49, 0x30, 0x63, 0x4e, + 0x76, 0x34, 0x72, 0x42, 0x67, 0x46, 0x2f, 0x58, 0x75, 0x49, 0x77, 0x4b, + 0x6c, 0x32, 0x67, 0x42, 0x62, 0x62, 0x5a, 0x43, 0x72, 0x37, 0x71, 0x4c, + 0x70, 0x47, 0x7a, 0x76, 0x70, 0x78, 0x30, 0x51, 0x6e, 0x52, 0x59, 0x35, + 0x72, 0x6e, 0x2f, 0x57, 0x6b, 0x68, 0x4c, 0x78, 0x33, 0x2b, 0x57, 0x75, + 0x58, 0x72, 0x44, 0x35, 0x52, 0x0a, 0x52, 0x61, 0x49, 0x52, 0x70, 0x73, + 0x79, 0x46, 0x37, 0x67, 0x70, 0x6f, 0x38, 0x6a, 0x35, 0x51, 0x4f, 0x48, + 0x6f, 0x6b, 0x59, 0x68, 0x34, 0x58, 0x49, 0x44, 0x64, 0x74, 0x61, 0x6b, + 0x32, 0x33, 0x43, 0x5a, 0x76, 0x4a, 0x2f, 0x4b, 0x52, 0x59, 0x39, 0x62, + 0x62, 0x37, 0x6e, 0x45, 0x34, 0x59, 0x75, 0x35, 0x55, 0x43, 0x35, 0x36, + 0x47, 0x74, 0x6d, 0x77, 0x66, 0x75, 0x4e, 0x6d, 0x73, 0x6b, 0x0a, 0x30, + 0x6a, 0x6d, 0x47, 0x77, 0x5a, 0x4f, 0x44, 0x55, 0x4e, 0x4b, 0x42, 0x52, + 0x71, 0x68, 0x66, 0x59, 0x6c, 0x63, 0x73, 0x75, 0x32, 0x78, 0x6b, 0x69, + 0x41, 0x68, 0x75, 0x37, 0x78, 0x4e, 0x55, 0x58, 0x39, 0x30, 0x74, 0x78, + 0x47, 0x64, 0x6a, 0x30, 0x38, 0x2b, 0x4a, 0x4e, 0x37, 0x2b, 0x64, 0x49, + 0x50, 0x54, 0x37, 0x65, 0x6f, 0x4f, 0x62, 0x6f, 0x42, 0x36, 0x42, 0x41, + 0x46, 0x44, 0x43, 0x0a, 0x35, 0x41, 0x77, 0x69, 0x57, 0x56, 0x49, 0x51, + 0x37, 0x55, 0x4e, 0x57, 0x68, 0x77, 0x44, 0x34, 0x46, 0x46, 0x4b, 0x6e, + 0x48, 0x59, 0x75, 0x54, 0x6a, 0x4b, 0x4a, 0x4e, 0x52, 0x6e, 0x38, 0x6e, + 0x78, 0x6e, 0x47, 0x62, 0x4a, 0x4e, 0x37, 0x6b, 0x32, 0x6f, 0x61, 0x4c, + 0x44, 0x58, 0x35, 0x72, 0x49, 0x4d, 0x48, 0x41, 0x6e, 0x75, 0x46, 0x6c, + 0x32, 0x47, 0x71, 0x6a, 0x70, 0x75, 0x69, 0x46, 0x0a, 0x69, 0x7a, 0x6f, + 0x48, 0x43, 0x42, 0x79, 0x36, 0x39, 0x59, 0x39, 0x56, 0x6d, 0x68, 0x68, + 0x31, 0x66, 0x75, 0x58, 0x73, 0x67, 0x57, 0x62, 0x52, 0x49, 0x58, 0x4f, + 0x68, 0x4e, 0x55, 0x51, 0x4c, 0x67, 0x44, 0x31, 0x62, 0x6e, 0x46, 0x35, + 0x76, 0x4b, 0x68, 0x65, 0x57, 0x30, 0x59, 0x4d, 0x6a, 0x69, 0x47, 0x5a, + 0x74, 0x35, 0x6f, 0x62, 0x69, 0x63, 0x44, 0x49, 0x76, 0x55, 0x69, 0x4c, + 0x6e, 0x0a, 0x79, 0x4f, 0x64, 0x2f, 0x78, 0x43, 0x78, 0x67, 0x58, 0x53, + 0x2f, 0x44, 0x72, 0x35, 0x35, 0x46, 0x42, 0x63, 0x4f, 0x45, 0x41, 0x72, + 0x66, 0x39, 0x4c, 0x41, 0x68, 0x53, 0x54, 0x34, 0x4c, 0x64, 0x6f, 0x2f, + 0x44, 0x55, 0x68, 0x67, 0x6b, 0x43, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, + 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, + 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, + 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x33, 0x20, 0x4f, + 0x3d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, + 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x4c, + 0x4c, 0x43, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x20, 0x52, 0x33, 0x20, 0x4f, 0x3d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x73, 0x20, 0x4c, 0x4c, 0x43, 0x0a, 0x23, 0x20, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x54, 0x53, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x36, 0x35, 0x38, 0x37, + 0x31, 0x37, 0x36, 0x31, 0x34, 0x30, 0x35, 0x35, 0x33, 0x33, 0x30, 0x39, + 0x35, 0x31, 0x37, 0x30, 0x34, 0x37, 0x39, 0x39, 0x31, 0x30, 0x38, 0x33, + 0x37, 0x30, 0x37, 0x37, 0x36, 0x33, 0x39, 0x39, 0x37, 0x0a, 0x23, 0x20, + 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x61, 0x3a, 0x37, 0x39, 0x3a, 0x35, + 0x62, 0x3a, 0x36, 0x62, 0x3a, 0x30, 0x34, 0x3a, 0x35, 0x32, 0x3a, 0x39, + 0x63, 0x3a, 0x35, 0x64, 0x3a, 0x63, 0x37, 0x3a, 0x37, 0x34, 0x3a, 0x33, + 0x33, 0x3a, 0x31, 0x62, 0x3a, 0x32, 0x35, 0x3a, 0x39, 0x61, 0x3a, 0x66, + 0x39, 0x3a, 0x32, 0x35, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x33, 0x30, 0x3a, 0x64, 0x34, 0x3a, 0x32, 0x34, 0x3a, 0x36, 0x66, + 0x3a, 0x30, 0x37, 0x3a, 0x66, 0x66, 0x3a, 0x64, 0x62, 0x3a, 0x39, 0x31, + 0x3a, 0x38, 0x39, 0x3a, 0x38, 0x61, 0x3a, 0x30, 0x62, 0x3a, 0x65, 0x39, + 0x3a, 0x34, 0x39, 0x3a, 0x36, 0x36, 0x3a, 0x31, 0x31, 0x3a, 0x65, 0x62, + 0x3a, 0x38, 0x63, 0x3a, 0x35, 0x65, 0x3a, 0x34, 0x36, 0x3a, 0x65, 0x35, + 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, + 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, + 0x35, 0x3a, 0x64, 0x35, 0x3a, 0x62, 0x38, 0x3a, 0x37, 0x37, 0x3a, 0x34, + 0x36, 0x3a, 0x31, 0x39, 0x3a, 0x65, 0x61, 0x3a, 0x37, 0x64, 0x3a, 0x35, + 0x34, 0x3a, 0x63, 0x65, 0x3a, 0x31, 0x63, 0x3a, 0x61, 0x36, 0x3a, 0x64, + 0x30, 0x3a, 0x62, 0x30, 0x3a, 0x63, 0x34, 0x3a, 0x30, 0x33, 0x3a, 0x65, + 0x30, 0x3a, 0x33, 0x37, 0x3a, 0x61, 0x39, 0x3a, 0x31, 0x37, 0x3a, 0x66, + 0x31, 0x3a, 0x33, 0x31, 0x3a, 0x65, 0x38, 0x3a, 0x61, 0x30, 0x3a, 0x34, + 0x65, 0x3a, 0x31, 0x65, 0x3a, 0x36, 0x62, 0x3a, 0x37, 0x61, 0x3a, 0x37, + 0x31, 0x3a, 0x62, 0x61, 0x3a, 0x62, 0x63, 0x3a, 0x65, 0x35, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x44, 0x44, 0x43, 0x43, 0x41, + 0x5a, 0x47, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x62, + 0x6b, 0x65, 0x70, 0x78, 0x32, 0x79, 0x70, 0x63, 0x79, 0x52, 0x41, 0x69, + 0x51, 0x38, 0x44, 0x56, 0x64, 0x32, 0x4e, 0x48, 0x54, 0x41, 0x4b, 0x42, + 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, + 0x7a, 0x42, 0x48, 0x4d, 0x51, 0x73, 0x77, 0x0a, 0x43, 0x51, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x69, + 0x4d, 0x43, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, + 0x52, 0x32, 0x39, 0x76, 0x5a, 0x32, 0x78, 0x6c, 0x49, 0x46, 0x52, 0x79, + 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, + 0x59, 0x32, 0x56, 0x7a, 0x49, 0x45, 0x78, 0x4d, 0x51, 0x7a, 0x45, 0x55, + 0x0a, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, + 0x4c, 0x52, 0x31, 0x52, 0x54, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, + 0x67, 0x55, 0x6a, 0x4d, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x59, + 0x77, 0x4e, 0x6a, 0x49, 0x79, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, + 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x59, 0x77, 0x4e, 0x6a, 0x49, + 0x79, 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, + 0x42, 0x48, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x69, 0x4d, 0x43, + 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x5a, 0x52, 0x32, + 0x39, 0x76, 0x5a, 0x32, 0x78, 0x6c, 0x49, 0x46, 0x52, 0x79, 0x64, 0x58, + 0x4e, 0x30, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, 0x70, 0x0a, 0x59, + 0x32, 0x56, 0x7a, 0x49, 0x45, 0x78, 0x4d, 0x51, 0x7a, 0x45, 0x55, 0x4d, + 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x4c, 0x52, + 0x31, 0x52, 0x54, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x55, + 0x6a, 0x4d, 0x77, 0x64, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x63, 0x71, 0x68, + 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, 0x67, 0x55, 0x72, 0x67, + 0x51, 0x51, 0x41, 0x0a, 0x49, 0x67, 0x4e, 0x69, 0x41, 0x41, 0x51, 0x66, + 0x54, 0x7a, 0x4f, 0x48, 0x4d, 0x79, 0x6d, 0x4b, 0x6f, 0x59, 0x54, 0x65, + 0x79, 0x38, 0x63, 0x68, 0x57, 0x45, 0x47, 0x4a, 0x36, 0x6c, 0x61, 0x64, + 0x4b, 0x30, 0x75, 0x46, 0x78, 0x68, 0x31, 0x4d, 0x4a, 0x37, 0x78, 0x2f, + 0x4a, 0x6c, 0x46, 0x79, 0x62, 0x2b, 0x4b, 0x66, 0x31, 0x71, 0x50, 0x4b, + 0x7a, 0x45, 0x55, 0x55, 0x52, 0x6f, 0x75, 0x74, 0x0a, 0x37, 0x33, 0x36, + 0x47, 0x6a, 0x4f, 0x79, 0x78, 0x66, 0x69, 0x2f, 0x2f, 0x71, 0x58, 0x47, + 0x64, 0x47, 0x49, 0x52, 0x46, 0x42, 0x45, 0x46, 0x56, 0x62, 0x69, 0x76, + 0x71, 0x4a, 0x6e, 0x2b, 0x37, 0x6b, 0x41, 0x48, 0x6a, 0x53, 0x78, 0x6d, + 0x36, 0x35, 0x46, 0x53, 0x57, 0x52, 0x51, 0x6d, 0x78, 0x31, 0x57, 0x79, + 0x52, 0x52, 0x4b, 0x32, 0x45, 0x45, 0x34, 0x36, 0x61, 0x6a, 0x41, 0x32, + 0x41, 0x0a, 0x44, 0x44, 0x4c, 0x32, 0x34, 0x43, 0x65, 0x6a, 0x51, 0x6a, + 0x42, 0x41, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, + 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x42, + 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x0a, 0x44, 0x67, 0x51, 0x57, 0x42, + 0x42, 0x54, 0x42, 0x38, 0x53, 0x61, 0x36, 0x6f, 0x43, 0x32, 0x75, 0x68, + 0x59, 0x48, 0x50, 0x30, 0x2f, 0x45, 0x71, 0x45, 0x72, 0x32, 0x34, 0x43, + 0x6d, 0x66, 0x39, 0x76, 0x44, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, + 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x77, 0x4e, 0x70, 0x41, + 0x44, 0x42, 0x6d, 0x41, 0x6a, 0x45, 0x41, 0x67, 0x46, 0x75, 0x6b, 0x0a, + 0x66, 0x43, 0x50, 0x41, 0x6c, 0x61, 0x55, 0x73, 0x33, 0x4c, 0x36, 0x4a, + 0x62, 0x79, 0x4f, 0x35, 0x6f, 0x39, 0x31, 0x6c, 0x41, 0x46, 0x4a, 0x65, + 0x6b, 0x61, 0x7a, 0x49, 0x6e, 0x58, 0x4a, 0x30, 0x67, 0x6c, 0x4d, 0x4c, + 0x66, 0x61, 0x6c, 0x41, 0x76, 0x57, 0x68, 0x67, 0x78, 0x65, 0x47, 0x34, + 0x56, 0x44, 0x76, 0x42, 0x4e, 0x68, 0x63, 0x6c, 0x32, 0x4d, 0x47, 0x39, + 0x41, 0x6a, 0x45, 0x41, 0x0a, 0x6e, 0x6a, 0x57, 0x53, 0x64, 0x49, 0x55, + 0x6c, 0x55, 0x66, 0x55, 0x6b, 0x37, 0x47, 0x52, 0x53, 0x4a, 0x46, 0x43, + 0x6c, 0x48, 0x39, 0x76, 0x6f, 0x79, 0x38, 0x6c, 0x32, 0x37, 0x4f, 0x79, + 0x43, 0x62, 0x76, 0x57, 0x46, 0x47, 0x46, 0x50, 0x6f, 0x75, 0x4f, 0x4f, + 0x61, 0x4b, 0x61, 0x71, 0x57, 0x30, 0x34, 0x4d, 0x6a, 0x79, 0x61, 0x52, + 0x37, 0x59, 0x62, 0x50, 0x4d, 0x41, 0x75, 0x68, 0x64, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x47, 0x54, 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, + 0x34, 0x20, 0x4f, 0x3d, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x20, 0x4c, 0x4c, 0x43, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x47, 0x54, 0x53, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x34, 0x20, 0x4f, 0x3d, 0x47, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x20, 0x4c, 0x4c, 0x43, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x47, 0x54, + 0x53, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x52, 0x34, 0x22, 0x0a, 0x23, + 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, 0x34, 0x36, + 0x35, 0x38, 0x37, 0x31, 0x37, 0x36, 0x32, 0x32, 0x39, 0x33, 0x35, 0x30, + 0x34, 0x33, 0x39, 0x39, 0x31, 0x36, 0x35, 0x31, 0x39, 0x34, 0x36, 0x38, + 0x39, 0x32, 0x39, 0x37, 0x36, 0x35, 0x32, 0x36, 0x31, 0x37, 0x32, 0x31, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x64, 0x3a, 0x62, + 0x36, 0x3a, 0x36, 0x61, 0x3a, 0x63, 0x34, 0x3a, 0x36, 0x30, 0x3a, 0x31, + 0x37, 0x3a, 0x32, 0x34, 0x3a, 0x36, 0x61, 0x3a, 0x31, 0x61, 0x3a, 0x39, + 0x39, 0x3a, 0x61, 0x38, 0x3a, 0x34, 0x62, 0x3a, 0x65, 0x65, 0x3a, 0x35, + 0x65, 0x3a, 0x62, 0x34, 0x3a, 0x32, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x61, 0x3a, 0x31, 0x64, 0x3a, 0x36, 0x30, + 0x3a, 0x32, 0x37, 0x3a, 0x64, 0x39, 0x3a, 0x34, 0x61, 0x3a, 0x62, 0x31, + 0x3a, 0x30, 0x61, 0x3a, 0x31, 0x63, 0x3a, 0x34, 0x64, 0x3a, 0x39, 0x31, + 0x3a, 0x35, 0x63, 0x3a, 0x63, 0x64, 0x3a, 0x33, 0x33, 0x3a, 0x61, 0x30, + 0x3a, 0x63, 0x62, 0x3a, 0x33, 0x65, 0x3a, 0x32, 0x64, 0x3a, 0x35, 0x34, + 0x3a, 0x63, 0x62, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x37, 0x31, 0x3a, 0x63, 0x63, 0x3a, 0x61, 0x35, 0x3a, 0x33, + 0x39, 0x3a, 0x31, 0x66, 0x3a, 0x39, 0x65, 0x3a, 0x37, 0x39, 0x3a, 0x34, + 0x62, 0x3a, 0x30, 0x34, 0x3a, 0x38, 0x30, 0x3a, 0x32, 0x35, 0x3a, 0x33, + 0x30, 0x3a, 0x62, 0x33, 0x3a, 0x36, 0x33, 0x3a, 0x65, 0x31, 0x3a, 0x32, + 0x31, 0x3a, 0x64, 0x61, 0x3a, 0x38, 0x61, 0x3a, 0x33, 0x30, 0x3a, 0x34, + 0x33, 0x3a, 0x62, 0x62, 0x3a, 0x32, 0x36, 0x3a, 0x36, 0x36, 0x3a, 0x32, + 0x66, 0x3a, 0x65, 0x61, 0x3a, 0x34, 0x64, 0x3a, 0x63, 0x61, 0x3a, 0x37, + 0x66, 0x3a, 0x63, 0x39, 0x3a, 0x35, 0x31, 0x3a, 0x61, 0x34, 0x3a, 0x62, + 0x64, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x6a, + 0x43, 0x43, 0x41, 0x5a, 0x47, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x51, 0x62, 0x6b, 0x65, 0x70, 0x79, 0x49, 0x75, 0x55, 0x74, 0x75, + 0x69, 0x37, 0x4f, 0x79, 0x72, 0x59, 0x6f, 0x72, 0x4c, 0x42, 0x6d, 0x54, + 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, + 0x51, 0x44, 0x41, 0x7a, 0x42, 0x48, 0x4d, 0x51, 0x73, 0x77, 0x0a, 0x43, + 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, + 0x7a, 0x45, 0x69, 0x4d, 0x43, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x5a, 0x52, 0x32, 0x39, 0x76, 0x5a, 0x32, 0x78, 0x6c, 0x49, + 0x46, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x4e, 0x6c, 0x63, + 0x6e, 0x5a, 0x70, 0x59, 0x32, 0x56, 0x7a, 0x49, 0x45, 0x78, 0x4d, 0x51, + 0x7a, 0x45, 0x55, 0x0a, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, + 0x41, 0x78, 0x4d, 0x4c, 0x52, 0x31, 0x52, 0x54, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x67, 0x55, 0x6a, 0x51, 0x77, 0x48, 0x68, 0x63, 0x4e, + 0x4d, 0x54, 0x59, 0x77, 0x4e, 0x6a, 0x49, 0x79, 0x4d, 0x44, 0x41, 0x77, + 0x4d, 0x44, 0x41, 0x77, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x59, 0x77, + 0x4e, 0x6a, 0x49, 0x79, 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x44, 0x41, + 0x77, 0x57, 0x6a, 0x42, 0x48, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, + 0x69, 0x4d, 0x43, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, + 0x5a, 0x52, 0x32, 0x39, 0x76, 0x5a, 0x32, 0x78, 0x6c, 0x49, 0x46, 0x52, + 0x79, 0x64, 0x58, 0x4e, 0x30, 0x49, 0x46, 0x4e, 0x6c, 0x63, 0x6e, 0x5a, + 0x70, 0x0a, 0x59, 0x32, 0x56, 0x7a, 0x49, 0x45, 0x78, 0x4d, 0x51, 0x7a, + 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x78, + 0x4d, 0x4c, 0x52, 0x31, 0x52, 0x54, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, + 0x51, 0x67, 0x55, 0x6a, 0x51, 0x77, 0x64, 0x6a, 0x41, 0x51, 0x42, 0x67, + 0x63, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, 0x67, + 0x55, 0x72, 0x67, 0x51, 0x51, 0x41, 0x0a, 0x49, 0x67, 0x4e, 0x69, 0x41, + 0x41, 0x54, 0x7a, 0x64, 0x48, 0x4f, 0x6e, 0x61, 0x49, 0x74, 0x67, 0x72, + 0x6b, 0x4f, 0x34, 0x4e, 0x63, 0x57, 0x42, 0x4d, 0x48, 0x74, 0x4c, 0x53, + 0x5a, 0x33, 0x37, 0x77, 0x57, 0x48, 0x4f, 0x35, 0x74, 0x35, 0x47, 0x76, + 0x57, 0x76, 0x56, 0x59, 0x52, 0x67, 0x31, 0x72, 0x6b, 0x44, 0x64, 0x63, + 0x2f, 0x65, 0x4a, 0x6b, 0x54, 0x42, 0x61, 0x36, 0x7a, 0x7a, 0x75, 0x0a, + 0x68, 0x58, 0x79, 0x69, 0x51, 0x48, 0x59, 0x37, 0x71, 0x63, 0x61, 0x34, + 0x52, 0x39, 0x67, 0x71, 0x35, 0x35, 0x4b, 0x52, 0x61, 0x6e, 0x50, 0x70, + 0x73, 0x58, 0x49, 0x35, 0x6e, 0x79, 0x6d, 0x66, 0x6f, 0x70, 0x6a, 0x54, + 0x58, 0x31, 0x35, 0x59, 0x68, 0x6d, 0x55, 0x50, 0x6f, 0x59, 0x52, 0x6c, + 0x42, 0x74, 0x48, 0x63, 0x69, 0x38, 0x6e, 0x48, 0x63, 0x38, 0x69, 0x4d, + 0x61, 0x69, 0x2f, 0x6c, 0x0a, 0x78, 0x4b, 0x76, 0x52, 0x48, 0x59, 0x71, + 0x6a, 0x51, 0x6a, 0x42, 0x41, 0x4d, 0x41, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, 0x41, 0x77, 0x49, + 0x42, 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, + 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, + 0x2f, 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x0a, 0x44, 0x67, + 0x51, 0x57, 0x42, 0x42, 0x53, 0x41, 0x54, 0x4e, 0x62, 0x72, 0x64, 0x50, + 0x39, 0x4a, 0x4e, 0x71, 0x50, 0x56, 0x32, 0x50, 0x79, 0x31, 0x50, 0x73, + 0x56, 0x71, 0x38, 0x4a, 0x51, 0x64, 0x6a, 0x44, 0x41, 0x4b, 0x42, 0x67, + 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x77, + 0x4e, 0x6e, 0x41, 0x44, 0x42, 0x6b, 0x41, 0x6a, 0x42, 0x71, 0x55, 0x46, + 0x4a, 0x30, 0x0a, 0x43, 0x4d, 0x52, 0x77, 0x33, 0x4a, 0x35, 0x51, 0x64, + 0x43, 0x48, 0x6f, 0x6a, 0x58, 0x6f, 0x68, 0x77, 0x30, 0x2b, 0x57, 0x62, + 0x68, 0x58, 0x52, 0x49, 0x6a, 0x56, 0x68, 0x4c, 0x66, 0x6f, 0x49, 0x4e, + 0x2b, 0x34, 0x5a, 0x62, 0x61, 0x33, 0x62, 0x73, 0x73, 0x78, 0x39, 0x42, + 0x7a, 0x54, 0x31, 0x59, 0x42, 0x6b, 0x73, 0x74, 0x54, 0x54, 0x5a, 0x62, + 0x79, 0x41, 0x43, 0x4d, 0x41, 0x4e, 0x78, 0x0a, 0x73, 0x62, 0x71, 0x6a, + 0x59, 0x41, 0x75, 0x47, 0x37, 0x5a, 0x6f, 0x49, 0x61, 0x70, 0x56, 0x6f, + 0x6e, 0x2b, 0x4b, 0x7a, 0x34, 0x5a, 0x4e, 0x6b, 0x66, 0x46, 0x36, 0x54, + 0x70, 0x74, 0x39, 0x35, 0x4c, 0x59, 0x32, 0x46, 0x34, 0x35, 0x54, 0x50, + 0x49, 0x31, 0x31, 0x78, 0x7a, 0x50, 0x4b, 0x77, 0x54, 0x64, 0x62, 0x2b, + 0x6d, 0x63, 0x69, 0x55, 0x71, 0x58, 0x57, 0x69, 0x34, 0x77, 0x3d, 0x3d, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, + 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, + 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x55, 0x43, 0x41, 0x20, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x20, 0x47, 0x32, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x4f, 0x3d, 0x55, 0x6e, 0x69, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x55, 0x43, 0x41, 0x20, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x20, + 0x47, 0x32, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x4f, 0x3d, 0x55, 0x6e, + 0x69, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x55, 0x43, 0x41, 0x20, 0x47, 0x6c, 0x6f, + 0x62, 0x61, 0x6c, 0x20, 0x47, 0x32, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x22, + 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x31, + 0x32, 0x34, 0x37, 0x37, 0x39, 0x36, 0x39, 0x33, 0x30, 0x39, 0x33, 0x37, + 0x34, 0x31, 0x35, 0x34, 0x33, 0x39, 0x31, 0x39, 0x31, 0x34, 0x35, 0x32, + 0x35, 0x37, 0x38, 0x35, 0x30, 0x30, 0x37, 0x36, 0x36, 0x33, 0x31, 0x32, + 0x37, 0x39, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x30, + 0x3a, 0x66, 0x65, 0x3a, 0x66, 0x30, 0x3a, 0x63, 0x34, 0x3a, 0x34, 0x61, + 0x3a, 0x66, 0x30, 0x3a, 0x35, 0x63, 0x3a, 0x36, 0x32, 0x3a, 0x33, 0x32, + 0x3a, 0x39, 0x66, 0x3a, 0x31, 0x63, 0x3a, 0x62, 0x61, 0x3a, 0x37, 0x38, + 0x3a, 0x61, 0x39, 0x3a, 0x35, 0x30, 0x3a, 0x66, 0x38, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x38, 0x3a, 0x66, 0x39, 0x3a, + 0x37, 0x38, 0x3a, 0x31, 0x36, 0x3a, 0x31, 0x39, 0x3a, 0x37, 0x61, 0x3a, + 0x66, 0x66, 0x3a, 0x31, 0x38, 0x3a, 0x32, 0x35, 0x3a, 0x31, 0x38, 0x3a, + 0x61, 0x61, 0x3a, 0x34, 0x34, 0x3a, 0x66, 0x65, 0x3a, 0x63, 0x31, 0x3a, + 0x61, 0x30, 0x3a, 0x63, 0x65, 0x3a, 0x35, 0x63, 0x3a, 0x62, 0x36, 0x3a, + 0x34, 0x63, 0x3a, 0x38, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x62, 0x3a, 0x65, 0x61, 0x3a, 0x31, 0x31, + 0x3a, 0x63, 0x39, 0x3a, 0x37, 0x36, 0x3a, 0x66, 0x65, 0x3a, 0x30, 0x31, + 0x3a, 0x34, 0x37, 0x3a, 0x36, 0x34, 0x3a, 0x63, 0x31, 0x3a, 0x62, 0x65, + 0x3a, 0x35, 0x36, 0x3a, 0x61, 0x36, 0x3a, 0x66, 0x39, 0x3a, 0x31, 0x34, + 0x3a, 0x62, 0x35, 0x3a, 0x61, 0x35, 0x3a, 0x36, 0x30, 0x3a, 0x33, 0x31, + 0x3a, 0x37, 0x61, 0x3a, 0x62, 0x64, 0x3a, 0x39, 0x39, 0x3a, 0x38, 0x38, + 0x3a, 0x33, 0x39, 0x3a, 0x33, 0x33, 0x3a, 0x38, 0x32, 0x3a, 0x65, 0x35, + 0x3a, 0x31, 0x36, 0x3a, 0x31, 0x61, 0x3a, 0x61, 0x30, 0x3a, 0x34, 0x39, + 0x3a, 0x33, 0x63, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, + 0x52, 0x6a, 0x43, 0x43, 0x41, 0x79, 0x36, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x51, 0x58, 0x64, 0x2b, 0x78, 0x32, 0x6c, 0x71, 0x6a, + 0x37, 0x56, 0x32, 0x2b, 0x57, 0x6d, 0x55, 0x67, 0x5a, 0x51, 0x4f, 0x51, + 0x37, 0x7a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x41, 0x39, + 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x44, 0x54, 0x6a, 0x45, 0x52, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x49, 0x56, 0x57, 0x35, + 0x70, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x78, 0x47, 0x7a, 0x41, + 0x5a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x45, 0x6c, 0x56, + 0x44, 0x51, 0x53, 0x42, 0x48, 0x0a, 0x62, 0x47, 0x39, 0x69, 0x59, 0x57, + 0x77, 0x67, 0x52, 0x7a, 0x49, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x44, + 0x41, 0x65, 0x46, 0x77, 0x30, 0x78, 0x4e, 0x6a, 0x41, 0x7a, 0x4d, 0x54, + 0x45, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, + 0x30, 0x30, 0x4d, 0x44, 0x45, 0x79, 0x4d, 0x7a, 0x45, 0x77, 0x4d, 0x44, + 0x41, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x4d, 0x44, 0x30, 0x78, 0x0a, 0x43, + 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, + 0x6b, 0x4e, 0x4f, 0x4d, 0x52, 0x45, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x4b, 0x44, 0x41, 0x68, 0x56, 0x62, 0x6d, 0x6c, 0x55, 0x63, + 0x6e, 0x56, 0x7a, 0x64, 0x44, 0x45, 0x62, 0x4d, 0x42, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x53, 0x56, 0x55, 0x4e, 0x42, 0x49, + 0x45, 0x64, 0x73, 0x0a, 0x62, 0x32, 0x4a, 0x68, 0x62, 0x43, 0x42, 0x48, + 0x4d, 0x69, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x4d, 0x49, 0x49, 0x43, + 0x49, 0x6a, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, + 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, + 0x41, 0x67, 0x38, 0x41, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, + 0x41, 0x67, 0x45, 0x41, 0x78, 0x65, 0x59, 0x72, 0x0a, 0x62, 0x33, 0x7a, + 0x76, 0x4a, 0x67, 0x55, 0x6e, 0x6f, 0x34, 0x45, 0x6b, 0x32, 0x6d, 0x2f, + 0x4c, 0x41, 0x66, 0x6d, 0x5a, 0x6d, 0x71, 0x6b, 0x79, 0x77, 0x69, 0x4b, + 0x48, 0x59, 0x55, 0x47, 0x52, 0x4f, 0x38, 0x76, 0x44, 0x61, 0x42, 0x73, + 0x47, 0x78, 0x55, 0x79, 0x70, 0x4b, 0x38, 0x46, 0x6e, 0x46, 0x79, 0x49, + 0x64, 0x4b, 0x2b, 0x33, 0x35, 0x4b, 0x59, 0x6d, 0x54, 0x6f, 0x6e, 0x69, + 0x39, 0x0a, 0x6b, 0x6d, 0x75, 0x67, 0x6f, 0x77, 0x32, 0x69, 0x66, 0x73, + 0x71, 0x54, 0x73, 0x36, 0x62, 0x52, 0x6a, 0x44, 0x58, 0x56, 0x64, 0x66, + 0x6b, 0x58, 0x39, 0x73, 0x39, 0x46, 0x78, 0x65, 0x56, 0x36, 0x37, 0x48, + 0x65, 0x54, 0x6f, 0x49, 0x38, 0x6a, 0x72, 0x67, 0x34, 0x61, 0x41, 0x33, + 0x2b, 0x2b, 0x31, 0x4e, 0x44, 0x74, 0x4c, 0x6e, 0x75, 0x72, 0x52, 0x69, + 0x4e, 0x62, 0x2f, 0x79, 0x7a, 0x6d, 0x0a, 0x56, 0x48, 0x71, 0x55, 0x77, + 0x43, 0x6f, 0x56, 0x38, 0x4d, 0x6d, 0x4e, 0x73, 0x48, 0x6f, 0x37, 0x4a, + 0x4f, 0x48, 0x58, 0x61, 0x4f, 0x49, 0x78, 0x50, 0x41, 0x59, 0x7a, 0x52, + 0x72, 0x5a, 0x55, 0x45, 0x61, 0x61, 0x6c, 0x4c, 0x79, 0x4a, 0x55, 0x4b, + 0x6c, 0x67, 0x4e, 0x41, 0x51, 0x4c, 0x78, 0x2b, 0x68, 0x56, 0x52, 0x5a, + 0x32, 0x7a, 0x41, 0x2b, 0x74, 0x65, 0x32, 0x47, 0x33, 0x2f, 0x52, 0x0a, + 0x56, 0x6f, 0x67, 0x76, 0x47, 0x6a, 0x71, 0x4e, 0x4f, 0x37, 0x75, 0x43, + 0x45, 0x65, 0x42, 0x48, 0x41, 0x4e, 0x42, 0x53, 0x68, 0x36, 0x76, 0x37, + 0x68, 0x6e, 0x34, 0x50, 0x4a, 0x47, 0x74, 0x41, 0x6e, 0x54, 0x52, 0x6e, + 0x76, 0x49, 0x33, 0x48, 0x4c, 0x59, 0x5a, 0x76, 0x65, 0x54, 0x36, 0x4f, + 0x71, 0x54, 0x77, 0x58, 0x53, 0x33, 0x2b, 0x77, 0x6d, 0x65, 0x4f, 0x77, + 0x63, 0x57, 0x44, 0x63, 0x0a, 0x43, 0x2f, 0x56, 0x6b, 0x77, 0x38, 0x35, + 0x44, 0x76, 0x47, 0x31, 0x78, 0x75, 0x64, 0x4c, 0x65, 0x4a, 0x31, 0x75, + 0x4b, 0x36, 0x4e, 0x6a, 0x47, 0x72, 0x75, 0x46, 0x5a, 0x66, 0x63, 0x38, + 0x6f, 0x4c, 0x54, 0x57, 0x34, 0x6c, 0x56, 0x59, 0x61, 0x38, 0x62, 0x4a, + 0x59, 0x53, 0x37, 0x63, 0x53, 0x4e, 0x38, 0x68, 0x38, 0x73, 0x2b, 0x31, + 0x4c, 0x67, 0x4f, 0x47, 0x4e, 0x2b, 0x6a, 0x49, 0x6a, 0x0a, 0x74, 0x6d, + 0x2b, 0x33, 0x53, 0x4a, 0x55, 0x49, 0x73, 0x55, 0x52, 0x4f, 0x68, 0x59, + 0x77, 0x36, 0x41, 0x6c, 0x51, 0x67, 0x4c, 0x39, 0x2b, 0x2f, 0x56, 0x30, + 0x38, 0x37, 0x4f, 0x70, 0x41, 0x68, 0x31, 0x38, 0x45, 0x6d, 0x4e, 0x56, + 0x51, 0x67, 0x37, 0x4d, 0x63, 0x2f, 0x52, 0x2b, 0x7a, 0x76, 0x57, 0x72, + 0x39, 0x4c, 0x65, 0x73, 0x47, 0x74, 0x4f, 0x78, 0x64, 0x51, 0x58, 0x47, + 0x4c, 0x59, 0x0a, 0x44, 0x30, 0x74, 0x4b, 0x33, 0x43, 0x76, 0x36, 0x62, + 0x72, 0x78, 0x7a, 0x6b, 0x73, 0x33, 0x73, 0x78, 0x31, 0x44, 0x6f, 0x51, + 0x5a, 0x62, 0x58, 0x71, 0x58, 0x35, 0x74, 0x32, 0x4f, 0x6b, 0x64, 0x6a, + 0x34, 0x71, 0x31, 0x75, 0x56, 0x69, 0x53, 0x75, 0x6b, 0x71, 0x53, 0x4b, + 0x77, 0x78, 0x57, 0x2f, 0x59, 0x44, 0x72, 0x43, 0x50, 0x42, 0x65, 0x4b, + 0x57, 0x34, 0x62, 0x48, 0x41, 0x79, 0x76, 0x0a, 0x6a, 0x35, 0x4f, 0x4a, + 0x72, 0x64, 0x75, 0x39, 0x6f, 0x35, 0x34, 0x68, 0x79, 0x6f, 0x6b, 0x5a, + 0x37, 0x4e, 0x2b, 0x31, 0x77, 0x78, 0x72, 0x72, 0x46, 0x76, 0x35, 0x34, + 0x4e, 0x6b, 0x7a, 0x57, 0x62, 0x74, 0x41, 0x2b, 0x46, 0x78, 0x79, 0x51, + 0x46, 0x32, 0x73, 0x6d, 0x75, 0x76, 0x74, 0x36, 0x4c, 0x37, 0x38, 0x52, + 0x48, 0x42, 0x67, 0x4f, 0x4c, 0x58, 0x4d, 0x44, 0x6a, 0x36, 0x44, 0x6c, + 0x0a, 0x4e, 0x61, 0x42, 0x61, 0x34, 0x6b, 0x78, 0x31, 0x48, 0x58, 0x48, + 0x68, 0x4f, 0x54, 0x68, 0x54, 0x65, 0x45, 0x44, 0x4d, 0x67, 0x35, 0x50, + 0x58, 0x43, 0x70, 0x36, 0x64, 0x57, 0x34, 0x2b, 0x4b, 0x35, 0x4f, 0x58, + 0x67, 0x53, 0x4f, 0x52, 0x49, 0x73, 0x6b, 0x66, 0x4e, 0x54, 0x69, 0x70, + 0x31, 0x4b, 0x6e, 0x76, 0x79, 0x49, 0x76, 0x62, 0x4a, 0x76, 0x67, 0x6d, + 0x52, 0x6c, 0x6c, 0x64, 0x36, 0x0a, 0x69, 0x49, 0x69, 0x73, 0x37, 0x6e, + 0x43, 0x73, 0x2b, 0x64, 0x77, 0x70, 0x34, 0x77, 0x77, 0x63, 0x4f, 0x78, + 0x4a, 0x4f, 0x52, 0x4e, 0x61, 0x6e, 0x54, 0x72, 0x41, 0x6d, 0x79, 0x50, + 0x50, 0x5a, 0x47, 0x70, 0x65, 0x52, 0x61, 0x4f, 0x72, 0x76, 0x6a, 0x55, + 0x59, 0x47, 0x30, 0x6c, 0x5a, 0x46, 0x57, 0x4a, 0x6f, 0x38, 0x44, 0x41, + 0x2b, 0x44, 0x75, 0x41, 0x55, 0x6c, 0x77, 0x7a, 0x6e, 0x50, 0x0a, 0x4f, + 0x36, 0x51, 0x30, 0x69, 0x62, 0x64, 0x35, 0x45, 0x69, 0x39, 0x48, 0x78, + 0x65, 0x65, 0x70, 0x6c, 0x32, 0x6e, 0x38, 0x70, 0x6e, 0x64, 0x6e, 0x74, + 0x64, 0x39, 0x37, 0x38, 0x58, 0x70, 0x6c, 0x46, 0x65, 0x52, 0x68, 0x56, + 0x6d, 0x55, 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, + 0x45, 0x41, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, 0x50, 0x41, + 0x51, 0x48, 0x2f, 0x0a, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, 0x45, 0x47, + 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, 0x45, 0x42, + 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x77, + 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, + 0x46, 0x49, 0x48, 0x45, 0x6a, 0x4d, 0x7a, 0x31, 0x35, 0x44, 0x44, 0x2f, + 0x70, 0x51, 0x77, 0x49, 0x58, 0x34, 0x77, 0x56, 0x0a, 0x5a, 0x79, 0x46, + 0x30, 0x41, 0x64, 0x2f, 0x66, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, + 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, + 0x41, 0x41, 0x34, 0x49, 0x43, 0x41, 0x51, 0x41, 0x54, 0x5a, 0x53, 0x4c, + 0x31, 0x6a, 0x69, 0x75, 0x74, 0x52, 0x4f, 0x54, 0x4c, 0x2f, 0x37, 0x6c, + 0x6f, 0x35, 0x73, 0x4f, 0x41, 0x53, 0x44, 0x30, 0x45, 0x65, 0x2f, 0x6f, + 0x6a, 0x0a, 0x4c, 0x33, 0x72, 0x74, 0x4e, 0x74, 0x71, 0x79, 0x7a, 0x6d, + 0x33, 0x32, 0x35, 0x70, 0x37, 0x6c, 0x58, 0x31, 0x69, 0x50, 0x79, 0x7a, + 0x63, 0x79, 0x6f, 0x63, 0x68, 0x6c, 0x74, 0x71, 0x34, 0x34, 0x50, 0x54, + 0x55, 0x62, 0x50, 0x72, 0x77, 0x37, 0x74, 0x67, 0x54, 0x51, 0x76, 0x50, + 0x6c, 0x4a, 0x39, 0x5a, 0x76, 0x33, 0x68, 0x63, 0x55, 0x32, 0x74, 0x73, + 0x75, 0x38, 0x2b, 0x4d, 0x67, 0x35, 0x0a, 0x31, 0x65, 0x52, 0x66, 0x42, + 0x37, 0x30, 0x56, 0x56, 0x4a, 0x64, 0x30, 0x79, 0x73, 0x72, 0x74, 0x54, + 0x37, 0x71, 0x36, 0x5a, 0x48, 0x61, 0x66, 0x67, 0x62, 0x69, 0x45, 0x52, + 0x55, 0x6c, 0x4d, 0x6a, 0x57, 0x2b, 0x69, 0x36, 0x37, 0x48, 0x4d, 0x30, + 0x63, 0x4f, 0x55, 0x32, 0x6b, 0x54, 0x43, 0x35, 0x75, 0x4c, 0x71, 0x47, + 0x4f, 0x69, 0x69, 0x48, 0x79, 0x63, 0x46, 0x75, 0x74, 0x66, 0x6c, 0x0a, + 0x31, 0x71, 0x6e, 0x4e, 0x33, 0x65, 0x39, 0x32, 0x6d, 0x49, 0x30, 0x41, + 0x44, 0x73, 0x30, 0x62, 0x2b, 0x67, 0x4f, 0x33, 0x6a, 0x6f, 0x42, 0x59, + 0x44, 0x69, 0x63, 0x2f, 0x55, 0x76, 0x75, 0x55, 0x6f, 0x73, 0x70, 0x65, + 0x5a, 0x63, 0x6e, 0x57, 0x68, 0x4e, 0x71, 0x35, 0x4e, 0x58, 0x48, 0x7a, + 0x4a, 0x73, 0x42, 0x50, 0x64, 0x2b, 0x61, 0x42, 0x4a, 0x39, 0x4a, 0x33, + 0x4f, 0x35, 0x6f, 0x55, 0x0a, 0x62, 0x33, 0x6e, 0x30, 0x39, 0x74, 0x44, + 0x68, 0x30, 0x35, 0x53, 0x36, 0x30, 0x46, 0x64, 0x52, 0x76, 0x53, 0x63, + 0x46, 0x44, 0x63, 0x48, 0x39, 0x79, 0x42, 0x49, 0x77, 0x37, 0x6d, 0x2b, + 0x4e, 0x45, 0x53, 0x73, 0x49, 0x6e, 0x64, 0x54, 0x55, 0x76, 0x34, 0x42, + 0x46, 0x46, 0x4a, 0x71, 0x49, 0x52, 0x4e, 0x6f, 0x77, 0x36, 0x72, 0x53, + 0x6e, 0x34, 0x2b, 0x37, 0x76, 0x57, 0x34, 0x4c, 0x56, 0x0a, 0x50, 0x74, + 0x61, 0x74, 0x65, 0x4a, 0x4c, 0x62, 0x58, 0x44, 0x7a, 0x7a, 0x32, 0x4b, + 0x33, 0x36, 0x75, 0x47, 0x74, 0x2f, 0x78, 0x44, 0x59, 0x6f, 0x74, 0x67, + 0x49, 0x56, 0x69, 0x6c, 0x51, 0x73, 0x6e, 0x4c, 0x41, 0x58, 0x63, 0x34, + 0x37, 0x51, 0x4e, 0x36, 0x4d, 0x55, 0x50, 0x4a, 0x69, 0x56, 0x41, 0x41, + 0x77, 0x70, 0x42, 0x56, 0x75, 0x65, 0x53, 0x55, 0x6d, 0x78, 0x58, 0x38, + 0x66, 0x6a, 0x0a, 0x79, 0x38, 0x38, 0x6e, 0x5a, 0x59, 0x34, 0x31, 0x46, + 0x37, 0x64, 0x58, 0x79, 0x44, 0x44, 0x5a, 0x51, 0x56, 0x75, 0x35, 0x46, + 0x4c, 0x62, 0x6f, 0x77, 0x67, 0x2b, 0x55, 0x4d, 0x61, 0x65, 0x55, 0x6d, + 0x4d, 0x78, 0x71, 0x36, 0x37, 0x58, 0x68, 0x4a, 0x2f, 0x55, 0x51, 0x71, + 0x41, 0x48, 0x6f, 0x6a, 0x68, 0x4a, 0x69, 0x36, 0x49, 0x6a, 0x4d, 0x74, + 0x58, 0x39, 0x47, 0x6c, 0x38, 0x43, 0x62, 0x0a, 0x45, 0x47, 0x59, 0x34, + 0x47, 0x6a, 0x5a, 0x47, 0x58, 0x79, 0x4a, 0x6f, 0x50, 0x64, 0x2f, 0x4a, + 0x78, 0x68, 0x4d, 0x6e, 0x71, 0x31, 0x4d, 0x47, 0x72, 0x4b, 0x49, 0x38, + 0x68, 0x67, 0x5a, 0x6c, 0x62, 0x37, 0x46, 0x2b, 0x73, 0x53, 0x6c, 0x45, + 0x6d, 0x71, 0x4f, 0x36, 0x53, 0x57, 0x6b, 0x6f, 0x61, 0x59, 0x2f, 0x58, + 0x35, 0x56, 0x2b, 0x74, 0x42, 0x49, 0x5a, 0x6b, 0x62, 0x78, 0x71, 0x67, + 0x0a, 0x44, 0x4d, 0x55, 0x49, 0x59, 0x73, 0x36, 0x41, 0x6f, 0x39, 0x44, + 0x7a, 0x37, 0x47, 0x6a, 0x65, 0x76, 0x6a, 0x50, 0x48, 0x46, 0x31, 0x74, + 0x2f, 0x67, 0x4d, 0x52, 0x4d, 0x54, 0x4c, 0x47, 0x6d, 0x68, 0x49, 0x72, + 0x44, 0x4f, 0x37, 0x67, 0x4a, 0x7a, 0x52, 0x53, 0x42, 0x75, 0x68, 0x6a, + 0x6a, 0x56, 0x46, 0x63, 0x32, 0x2f, 0x74, 0x73, 0x76, 0x66, 0x45, 0x65, + 0x68, 0x4f, 0x6a, 0x50, 0x49, 0x0a, 0x2b, 0x56, 0x67, 0x37, 0x52, 0x45, + 0x2b, 0x78, 0x79, 0x67, 0x4b, 0x4a, 0x42, 0x4a, 0x59, 0x6f, 0x61, 0x4d, + 0x56, 0x4c, 0x75, 0x43, 0x61, 0x4a, 0x75, 0x39, 0x59, 0x7a, 0x4c, 0x31, + 0x44, 0x56, 0x2f, 0x70, 0x71, 0x4a, 0x75, 0x68, 0x67, 0x79, 0x6b, 0x6c, + 0x54, 0x47, 0x57, 0x2b, 0x43, 0x64, 0x2b, 0x56, 0x37, 0x6c, 0x44, 0x53, + 0x4b, 0x62, 0x39, 0x74, 0x72, 0x69, 0x79, 0x43, 0x47, 0x79, 0x0a, 0x59, + 0x69, 0x47, 0x71, 0x68, 0x6b, 0x43, 0x79, 0x4c, 0x6d, 0x54, 0x54, 0x58, + 0x38, 0x6a, 0x6a, 0x66, 0x68, 0x46, 0x6e, 0x52, 0x52, 0x38, 0x46, 0x2f, + 0x75, 0x4f, 0x69, 0x37, 0x37, 0x4f, 0x6f, 0x73, 0x2f, 0x4e, 0x39, 0x6a, + 0x2f, 0x67, 0x4d, 0x48, 0x79, 0x49, 0x66, 0x4c, 0x58, 0x43, 0x30, 0x75, + 0x41, 0x45, 0x30, 0x64, 0x6a, 0x41, 0x41, 0x35, 0x53, 0x4e, 0x34, 0x70, + 0x31, 0x62, 0x58, 0x0a, 0x55, 0x42, 0x2b, 0x4b, 0x2b, 0x77, 0x62, 0x31, + 0x77, 0x68, 0x6e, 0x77, 0x30, 0x41, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x55, 0x43, 0x41, 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, + 0x64, 0x20, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x4f, 0x3d, 0x55, 0x6e, 0x69, 0x54, + 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, + 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x55, 0x43, 0x41, 0x20, 0x45, + 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x4f, 0x3d, 0x55, 0x6e, 0x69, 0x54, 0x72, 0x75, 0x73, 0x74, 0x0a, 0x23, + 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x55, 0x43, 0x41, + 0x20, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x64, 0x20, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x52, 0x6f, 0x6f, + 0x74, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x31, 0x30, 0x36, 0x31, 0x30, 0x30, 0x32, 0x37, 0x37, 0x35, 0x35, + 0x36, 0x34, 0x38, 0x36, 0x35, 0x32, 0x39, 0x37, 0x33, 0x36, 0x36, 0x39, + 0x39, 0x35, 0x38, 0x37, 0x39, 0x37, 0x38, 0x35, 0x37, 0x33, 0x36, 0x30, + 0x37, 0x30, 0x30, 0x38, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x61, 0x31, 0x3a, 0x66, 0x33, 0x3a, 0x35, 0x66, 0x3a, 0x34, 0x33, 0x3a, + 0x63, 0x36, 0x3a, 0x33, 0x34, 0x3a, 0x39, 0x62, 0x3a, 0x64, 0x61, 0x3a, + 0x62, 0x66, 0x3a, 0x38, 0x63, 0x3a, 0x37, 0x65, 0x3a, 0x30, 0x35, 0x3a, + 0x35, 0x33, 0x3a, 0x61, 0x64, 0x3a, 0x39, 0x36, 0x3a, 0x65, 0x32, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x61, 0x33, 0x3a, 0x61, + 0x31, 0x3a, 0x62, 0x30, 0x3a, 0x36, 0x66, 0x3a, 0x32, 0x34, 0x3a, 0x36, + 0x31, 0x3a, 0x32, 0x33, 0x3a, 0x34, 0x61, 0x3a, 0x65, 0x33, 0x3a, 0x33, + 0x36, 0x3a, 0x61, 0x35, 0x3a, 0x63, 0x32, 0x3a, 0x33, 0x37, 0x3a, 0x66, + 0x63, 0x3a, 0x61, 0x36, 0x3a, 0x66, 0x66, 0x3a, 0x64, 0x64, 0x3a, 0x66, + 0x30, 0x3a, 0x64, 0x37, 0x3a, 0x33, 0x61, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x34, 0x3a, 0x33, 0x61, 0x3a, + 0x66, 0x39, 0x3a, 0x62, 0x33, 0x3a, 0x35, 0x34, 0x3a, 0x37, 0x33, 0x3a, + 0x37, 0x35, 0x3a, 0x35, 0x63, 0x3a, 0x39, 0x36, 0x3a, 0x38, 0x34, 0x3a, + 0x66, 0x63, 0x3a, 0x30, 0x36, 0x3a, 0x64, 0x37, 0x3a, 0x64, 0x38, 0x3a, + 0x63, 0x62, 0x3a, 0x37, 0x30, 0x3a, 0x65, 0x65, 0x3a, 0x35, 0x63, 0x3a, + 0x32, 0x38, 0x3a, 0x65, 0x37, 0x3a, 0x37, 0x33, 0x3a, 0x66, 0x62, 0x3a, + 0x32, 0x39, 0x3a, 0x34, 0x65, 0x3a, 0x62, 0x34, 0x3a, 0x31, 0x65, 0x3a, + 0x65, 0x37, 0x3a, 0x31, 0x37, 0x3a, 0x32, 0x32, 0x3a, 0x39, 0x32, 0x3a, + 0x34, 0x64, 0x3a, 0x32, 0x34, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x46, 0x57, 0x6a, 0x43, 0x43, 0x41, 0x30, 0x4b, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x51, 0x54, 0x39, 0x49, 0x72, 0x6a, 0x2f, + 0x56, 0x6b, 0x79, 0x44, 0x4f, 0x65, 0x54, 0x7a, 0x52, 0x59, 0x5a, 0x69, + 0x4e, 0x77, 0x59, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, + 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, + 0x42, 0x48, 0x0a, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, + 0x51, 0x51, 0x47, 0x45, 0x77, 0x4a, 0x44, 0x54, 0x6a, 0x45, 0x52, 0x4d, + 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x49, 0x56, + 0x57, 0x35, 0x70, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x78, 0x4a, + 0x54, 0x41, 0x6a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x48, + 0x46, 0x56, 0x44, 0x51, 0x53, 0x42, 0x46, 0x0a, 0x65, 0x48, 0x52, 0x6c, + 0x62, 0x6d, 0x52, 0x6c, 0x5a, 0x43, 0x42, 0x57, 0x59, 0x57, 0x78, 0x70, + 0x5a, 0x47, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x46, 0x4a, 0x76, + 0x62, 0x33, 0x51, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x55, 0x77, + 0x4d, 0x7a, 0x45, 0x7a, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, + 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x7a, 0x67, 0x78, 0x4d, 0x6a, 0x4d, 0x78, + 0x0a, 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, 0x42, + 0x48, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x47, 0x45, 0x77, 0x4a, 0x44, 0x54, 0x6a, 0x45, 0x52, 0x4d, 0x41, 0x38, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x49, 0x56, 0x57, 0x35, + 0x70, 0x56, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x78, 0x4a, 0x54, 0x41, + 0x6a, 0x42, 0x67, 0x4e, 0x56, 0x0a, 0x42, 0x41, 0x4d, 0x4d, 0x48, 0x46, + 0x56, 0x44, 0x51, 0x53, 0x42, 0x46, 0x65, 0x48, 0x52, 0x6c, 0x62, 0x6d, + 0x52, 0x6c, 0x5a, 0x43, 0x42, 0x57, 0x59, 0x57, 0x78, 0x70, 0x5a, 0x47, + 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, + 0x51, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, + 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x0a, 0x41, + 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, 0x67, + 0x67, 0x49, 0x4b, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, 0x70, 0x43, + 0x51, 0x63, 0x6f, 0x45, 0x77, 0x4b, 0x77, 0x6d, 0x65, 0x42, 0x6b, 0x71, + 0x68, 0x35, 0x44, 0x46, 0x6e, 0x70, 0x7a, 0x73, 0x5a, 0x47, 0x67, 0x64, + 0x54, 0x36, 0x6f, 0x2b, 0x75, 0x4d, 0x34, 0x41, 0x48, 0x72, 0x73, 0x69, + 0x57, 0x6f, 0x67, 0x0a, 0x44, 0x34, 0x76, 0x46, 0x73, 0x4a, 0x73, 0x7a, + 0x41, 0x31, 0x71, 0x47, 0x78, 0x6c, 0x69, 0x47, 0x31, 0x63, 0x47, 0x46, + 0x75, 0x30, 0x2f, 0x47, 0x6e, 0x45, 0x42, 0x4e, 0x79, 0x72, 0x37, 0x75, + 0x61, 0x5a, 0x61, 0x34, 0x72, 0x59, 0x45, 0x77, 0x6d, 0x6e, 0x79, 0x53, + 0x42, 0x65, 0x73, 0x46, 0x4b, 0x35, 0x70, 0x49, 0x30, 0x4c, 0x68, 0x32, + 0x50, 0x70, 0x62, 0x49, 0x49, 0x4c, 0x76, 0x53, 0x0a, 0x73, 0x50, 0x47, + 0x50, 0x32, 0x4b, 0x78, 0x46, 0x52, 0x76, 0x2b, 0x71, 0x5a, 0x32, 0x43, + 0x30, 0x64, 0x33, 0x35, 0x71, 0x48, 0x7a, 0x77, 0x61, 0x55, 0x6e, 0x6f, + 0x45, 0x50, 0x51, 0x63, 0x38, 0x68, 0x51, 0x32, 0x45, 0x30, 0x42, 0x39, + 0x32, 0x43, 0x76, 0x64, 0x71, 0x46, 0x4e, 0x39, 0x79, 0x34, 0x7a, 0x52, + 0x38, 0x56, 0x30, 0x35, 0x57, 0x41, 0x54, 0x35, 0x35, 0x38, 0x61, 0x6f, + 0x70, 0x0a, 0x4f, 0x32, 0x7a, 0x36, 0x2b, 0x49, 0x39, 0x74, 0x54, 0x63, + 0x67, 0x31, 0x33, 0x36, 0x37, 0x72, 0x33, 0x43, 0x54, 0x75, 0x65, 0x55, + 0x57, 0x6e, 0x68, 0x62, 0x59, 0x46, 0x69, 0x4e, 0x36, 0x49, 0x58, 0x53, + 0x56, 0x38, 0x6c, 0x32, 0x52, 0x6e, 0x43, 0x64, 0x6d, 0x2f, 0x57, 0x68, + 0x55, 0x46, 0x68, 0x76, 0x4d, 0x4a, 0x48, 0x75, 0x78, 0x59, 0x4d, 0x6a, + 0x4d, 0x52, 0x38, 0x33, 0x64, 0x6b, 0x0a, 0x73, 0x48, 0x59, 0x66, 0x35, + 0x42, 0x41, 0x31, 0x46, 0x78, 0x76, 0x79, 0x44, 0x72, 0x46, 0x73, 0x70, + 0x43, 0x71, 0x6a, 0x63, 0x2f, 0x77, 0x4a, 0x48, 0x78, 0x34, 0x79, 0x47, + 0x56, 0x4d, 0x52, 0x35, 0x39, 0x6d, 0x7a, 0x4c, 0x43, 0x35, 0x32, 0x4c, + 0x71, 0x47, 0x6a, 0x33, 0x6e, 0x35, 0x71, 0x69, 0x41, 0x6e, 0x6f, 0x38, + 0x67, 0x65, 0x4b, 0x2b, 0x4c, 0x4c, 0x4e, 0x45, 0x4f, 0x66, 0x69, 0x0a, + 0x63, 0x30, 0x43, 0x54, 0x75, 0x77, 0x6a, 0x52, 0x50, 0x2b, 0x48, 0x38, + 0x43, 0x35, 0x53, 0x7a, 0x4a, 0x65, 0x39, 0x38, 0x70, 0x74, 0x66, 0x52, + 0x72, 0x35, 0x2f, 0x2f, 0x6c, 0x70, 0x72, 0x31, 0x6b, 0x58, 0x75, 0x59, + 0x43, 0x33, 0x66, 0x55, 0x66, 0x75, 0x67, 0x48, 0x30, 0x6d, 0x4b, 0x31, + 0x6c, 0x54, 0x6e, 0x6a, 0x38, 0x2f, 0x46, 0x74, 0x44, 0x77, 0x35, 0x6c, + 0x68, 0x49, 0x70, 0x6a, 0x0a, 0x56, 0x4d, 0x57, 0x41, 0x74, 0x75, 0x43, + 0x65, 0x53, 0x33, 0x31, 0x48, 0x4a, 0x71, 0x63, 0x42, 0x43, 0x46, 0x33, + 0x52, 0x69, 0x4a, 0x37, 0x58, 0x77, 0x7a, 0x4a, 0x45, 0x2b, 0x6f, 0x4a, + 0x4b, 0x43, 0x6d, 0x68, 0x55, 0x66, 0x7a, 0x68, 0x54, 0x41, 0x38, 0x79, + 0x6b, 0x41, 0x44, 0x4e, 0x6b, 0x55, 0x56, 0x6b, 0x4c, 0x6f, 0x34, 0x4b, + 0x52, 0x65, 0x6c, 0x37, 0x73, 0x46, 0x73, 0x4c, 0x7a, 0x0a, 0x4b, 0x75, + 0x5a, 0x69, 0x32, 0x69, 0x72, 0x62, 0x57, 0x57, 0x49, 0x51, 0x4a, 0x55, + 0x6f, 0x71, 0x67, 0x51, 0x74, 0x48, 0x42, 0x30, 0x4d, 0x47, 0x63, 0x49, + 0x66, 0x53, 0x2b, 0x70, 0x4d, 0x52, 0x4b, 0x58, 0x70, 0x49, 0x54, 0x65, + 0x75, 0x55, 0x78, 0x33, 0x42, 0x4e, 0x72, 0x32, 0x66, 0x56, 0x55, 0x62, + 0x47, 0x41, 0x49, 0x41, 0x45, 0x42, 0x74, 0x48, 0x6f, 0x49, 0x70, 0x70, + 0x42, 0x2f, 0x0a, 0x54, 0x75, 0x44, 0x76, 0x42, 0x30, 0x47, 0x48, 0x72, + 0x32, 0x71, 0x6c, 0x58, 0x6f, 0x76, 0x37, 0x7a, 0x31, 0x43, 0x79, 0x6d, + 0x6c, 0x53, 0x76, 0x77, 0x34, 0x6d, 0x36, 0x57, 0x43, 0x33, 0x31, 0x4d, + 0x4a, 0x69, 0x78, 0x4e, 0x6e, 0x49, 0x35, 0x66, 0x6b, 0x6b, 0x45, 0x2f, + 0x53, 0x6d, 0x6e, 0x54, 0x48, 0x6e, 0x6b, 0x42, 0x56, 0x66, 0x62, 0x6c, + 0x4c, 0x6b, 0x57, 0x55, 0x34, 0x31, 0x47, 0x0a, 0x73, 0x78, 0x32, 0x56, + 0x59, 0x56, 0x64, 0x57, 0x66, 0x36, 0x2f, 0x77, 0x46, 0x6c, 0x74, 0x68, + 0x57, 0x47, 0x38, 0x32, 0x55, 0x42, 0x45, 0x4c, 0x32, 0x4b, 0x77, 0x72, + 0x6c, 0x52, 0x59, 0x61, 0x44, 0x68, 0x38, 0x49, 0x7a, 0x54, 0x59, 0x30, + 0x5a, 0x52, 0x42, 0x69, 0x5a, 0x74, 0x57, 0x41, 0x58, 0x78, 0x51, 0x67, + 0x58, 0x79, 0x30, 0x4d, 0x6f, 0x48, 0x67, 0x4b, 0x61, 0x4e, 0x59, 0x73, + 0x0a, 0x31, 0x2b, 0x6c, 0x76, 0x4b, 0x39, 0x4a, 0x4b, 0x42, 0x5a, 0x50, + 0x38, 0x6e, 0x6d, 0x39, 0x72, 0x5a, 0x2f, 0x2b, 0x49, 0x38, 0x55, 0x36, + 0x6c, 0x61, 0x55, 0x70, 0x53, 0x4e, 0x77, 0x58, 0x71, 0x78, 0x68, 0x61, + 0x4e, 0x30, 0x73, 0x53, 0x5a, 0x30, 0x59, 0x49, 0x72, 0x4f, 0x37, 0x6f, + 0x31, 0x64, 0x66, 0x64, 0x52, 0x55, 0x56, 0x6a, 0x7a, 0x79, 0x41, 0x66, + 0x64, 0x35, 0x4c, 0x51, 0x44, 0x0a, 0x66, 0x77, 0x49, 0x44, 0x41, 0x51, + 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, 0x64, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, 0x55, 0x32, 0x58, + 0x51, 0x36, 0x35, 0x44, 0x41, 0x39, 0x44, 0x66, 0x63, 0x53, 0x33, 0x48, + 0x35, 0x61, 0x42, 0x5a, 0x38, 0x65, 0x4e, 0x4a, 0x72, 0x33, 0x34, 0x52, + 0x51, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x0a, 0x41, + 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, + 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, + 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x59, 0x59, 0x77, 0x44, + 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, + 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, + 0x44, 0x61, 0x4e, 0x0a, 0x6c, 0x38, 0x78, 0x43, 0x46, 0x57, 0x51, 0x70, + 0x4e, 0x35, 0x73, 0x6d, 0x4c, 0x4e, 0x62, 0x37, 0x72, 0x68, 0x56, 0x70, + 0x4c, 0x47, 0x73, 0x61, 0x47, 0x76, 0x64, 0x66, 0x74, 0x76, 0x6b, 0x48, + 0x54, 0x46, 0x6e, 0x71, 0x38, 0x38, 0x6e, 0x49, 0x75, 0x61, 0x37, 0x4d, + 0x75, 0x69, 0x35, 0x36, 0x33, 0x4d, 0x44, 0x31, 0x73, 0x43, 0x33, 0x41, + 0x4f, 0x36, 0x2b, 0x66, 0x63, 0x41, 0x55, 0x52, 0x0a, 0x61, 0x70, 0x38, + 0x6c, 0x54, 0x77, 0x45, 0x70, 0x63, 0x4f, 0x50, 0x6c, 0x44, 0x4f, 0x48, + 0x71, 0x57, 0x6e, 0x7a, 0x63, 0x53, 0x62, 0x76, 0x42, 0x48, 0x69, 0x71, + 0x42, 0x39, 0x52, 0x5a, 0x4c, 0x63, 0x70, 0x48, 0x49, 0x6f, 0x6a, 0x47, + 0x35, 0x71, 0x74, 0x72, 0x38, 0x6e, 0x52, 0x2f, 0x7a, 0x58, 0x55, 0x41, + 0x43, 0x45, 0x2f, 0x78, 0x4f, 0x48, 0x41, 0x62, 0x4b, 0x73, 0x78, 0x53, + 0x51, 0x0a, 0x56, 0x42, 0x63, 0x5a, 0x45, 0x68, 0x72, 0x78, 0x48, 0x39, + 0x63, 0x4d, 0x61, 0x56, 0x72, 0x32, 0x63, 0x58, 0x6a, 0x30, 0x6c, 0x48, + 0x32, 0x52, 0x43, 0x34, 0x37, 0x73, 0x6b, 0x46, 0x53, 0x4f, 0x76, 0x47, + 0x2b, 0x68, 0x54, 0x4b, 0x76, 0x38, 0x64, 0x47, 0x54, 0x39, 0x63, 0x5a, + 0x72, 0x34, 0x51, 0x51, 0x65, 0x68, 0x7a, 0x5a, 0x48, 0x6b, 0x50, 0x4a, + 0x72, 0x67, 0x6d, 0x7a, 0x49, 0x35, 0x0a, 0x63, 0x36, 0x73, 0x71, 0x31, + 0x57, 0x6e, 0x49, 0x65, 0x4a, 0x45, 0x6d, 0x4d, 0x58, 0x33, 0x69, 0x78, + 0x7a, 0x44, 0x78, 0x2f, 0x42, 0x52, 0x34, 0x64, 0x78, 0x49, 0x4f, 0x45, + 0x2f, 0x54, 0x64, 0x46, 0x70, 0x53, 0x2f, 0x53, 0x32, 0x64, 0x37, 0x63, + 0x46, 0x4f, 0x46, 0x79, 0x72, 0x43, 0x37, 0x38, 0x7a, 0x68, 0x4e, 0x4c, + 0x4a, 0x41, 0x35, 0x77, 0x41, 0x33, 0x43, 0x58, 0x57, 0x76, 0x70, 0x0a, + 0x34, 0x75, 0x58, 0x56, 0x69, 0x49, 0x33, 0x57, 0x4c, 0x4c, 0x2b, 0x72, + 0x47, 0x37, 0x36, 0x31, 0x4b, 0x49, 0x63, 0x53, 0x46, 0x33, 0x52, 0x75, + 0x2f, 0x48, 0x33, 0x38, 0x6a, 0x39, 0x43, 0x48, 0x4a, 0x72, 0x41, 0x62, + 0x2b, 0x37, 0x6c, 0x73, 0x71, 0x2b, 0x4b, 0x65, 0x50, 0x52, 0x58, 0x42, + 0x4f, 0x79, 0x35, 0x6e, 0x41, 0x6c, 0x69, 0x52, 0x6e, 0x2b, 0x2f, 0x34, + 0x51, 0x68, 0x38, 0x73, 0x0a, 0x74, 0x32, 0x6a, 0x31, 0x64, 0x61, 0x33, + 0x50, 0x74, 0x66, 0x62, 0x2f, 0x45, 0x58, 0x33, 0x43, 0x38, 0x43, 0x53, + 0x6c, 0x72, 0x64, 0x50, 0x36, 0x6f, 0x44, 0x79, 0x70, 0x2b, 0x6c, 0x33, + 0x63, 0x70, 0x61, 0x44, 0x76, 0x52, 0x4b, 0x53, 0x2b, 0x31, 0x75, 0x6a, + 0x6c, 0x35, 0x42, 0x4f, 0x57, 0x46, 0x33, 0x73, 0x47, 0x50, 0x6a, 0x4c, + 0x74, 0x78, 0x37, 0x64, 0x43, 0x76, 0x48, 0x61, 0x6a, 0x0a, 0x32, 0x47, + 0x55, 0x34, 0x4b, 0x7a, 0x67, 0x31, 0x55, 0x53, 0x45, 0x4f, 0x44, 0x6d, + 0x38, 0x75, 0x4e, 0x42, 0x4e, 0x41, 0x34, 0x53, 0x74, 0x6e, 0x44, 0x47, + 0x31, 0x4b, 0x51, 0x54, 0x41, 0x59, 0x49, 0x31, 0x6f, 0x79, 0x56, 0x5a, + 0x6e, 0x4a, 0x46, 0x2b, 0x41, 0x38, 0x33, 0x76, 0x62, 0x73, 0x65, 0x61, + 0x30, 0x72, 0x57, 0x42, 0x6d, 0x69, 0x72, 0x53, 0x77, 0x69, 0x47, 0x70, + 0x57, 0x4f, 0x0a, 0x76, 0x70, 0x61, 0x51, 0x58, 0x55, 0x4a, 0x58, 0x78, + 0x50, 0x6b, 0x55, 0x41, 0x7a, 0x55, 0x72, 0x48, 0x43, 0x31, 0x52, 0x56, + 0x77, 0x69, 0x6e, 0x4f, 0x74, 0x34, 0x2f, 0x35, 0x4d, 0x69, 0x30, 0x41, + 0x33, 0x50, 0x43, 0x77, 0x53, 0x61, 0x41, 0x75, 0x77, 0x74, 0x43, 0x48, + 0x36, 0x30, 0x4e, 0x72, 0x79, 0x5a, 0x79, 0x32, 0x73, 0x79, 0x2b, 0x73, + 0x36, 0x4f, 0x44, 0x57, 0x41, 0x32, 0x43, 0x0a, 0x78, 0x52, 0x39, 0x47, + 0x55, 0x65, 0x4f, 0x63, 0x47, 0x4d, 0x79, 0x4e, 0x6d, 0x34, 0x33, 0x73, + 0x53, 0x65, 0x74, 0x31, 0x55, 0x4e, 0x57, 0x4d, 0x4b, 0x46, 0x6e, 0x4b, + 0x64, 0x44, 0x54, 0x61, 0x6a, 0x41, 0x73, 0x68, 0x71, 0x78, 0x37, 0x71, + 0x47, 0x2b, 0x58, 0x48, 0x2f, 0x52, 0x55, 0x2b, 0x77, 0x42, 0x65, 0x71, + 0x2b, 0x79, 0x4e, 0x75, 0x4a, 0x6b, 0x62, 0x4c, 0x2b, 0x76, 0x6d, 0x78, + 0x0a, 0x63, 0x6d, 0x74, 0x70, 0x7a, 0x79, 0x4b, 0x45, 0x43, 0x32, 0x49, + 0x50, 0x72, 0x4e, 0x6b, 0x5a, 0x41, 0x4a, 0x53, 0x69, 0x64, 0x6a, 0x7a, + 0x55, 0x4c, 0x5a, 0x72, 0x74, 0x42, 0x4a, 0x34, 0x74, 0x42, 0x6d, 0x49, + 0x51, 0x4e, 0x31, 0x49, 0x63, 0x68, 0x58, 0x49, 0x62, 0x4a, 0x2b, 0x58, + 0x4d, 0x78, 0x6a, 0x48, 0x73, 0x4e, 0x2b, 0x78, 0x6a, 0x57, 0x5a, 0x73, + 0x4c, 0x48, 0x58, 0x62, 0x4d, 0x0a, 0x66, 0x6a, 0x4b, 0x61, 0x69, 0x4a, + 0x55, 0x49, 0x4e, 0x6c, 0x4b, 0x37, 0x33, 0x6e, 0x5a, 0x66, 0x64, 0x6b, + 0x6c, 0x4a, 0x72, 0x58, 0x2b, 0x39, 0x5a, 0x53, 0x43, 0x79, 0x79, 0x63, + 0x45, 0x72, 0x64, 0x68, 0x68, 0x32, 0x6e, 0x31, 0x61, 0x78, 0x0a, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, + 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, + 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x43, 0x65, 0x72, 0x74, 0x69, 0x67, 0x6e, 0x61, 0x20, + 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x4f, 0x3d, 0x44, 0x68, + 0x69, 0x6d, 0x79, 0x6f, 0x74, 0x69, 0x73, 0x20, 0x4f, 0x55, 0x3d, 0x30, + 0x30, 0x30, 0x32, 0x20, 0x34, 0x38, 0x31, 0x34, 0x36, 0x33, 0x30, 0x38, + 0x31, 0x30, 0x30, 0x30, 0x33, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, + 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x43, 0x65, 0x72, + 0x74, 0x69, 0x67, 0x6e, 0x61, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x41, 0x20, 0x4f, 0x3d, 0x44, 0x68, 0x69, 0x6d, 0x79, 0x6f, 0x74, 0x69, + 0x73, 0x20, 0x4f, 0x55, 0x3d, 0x30, 0x30, 0x30, 0x32, 0x20, 0x34, 0x38, + 0x31, 0x34, 0x36, 0x33, 0x30, 0x38, 0x31, 0x30, 0x30, 0x30, 0x33, 0x36, + 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x67, 0x6e, 0x61, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x32, 0x36, 0x39, 0x37, 0x31, 0x34, 0x34, 0x31, 0x38, + 0x38, 0x37, 0x30, 0x35, 0x39, 0x37, 0x38, 0x34, 0x34, 0x36, 0x39, 0x33, + 0x36, 0x36, 0x31, 0x30, 0x35, 0x34, 0x33, 0x33, 0x34, 0x38, 0x36, 0x32, + 0x30, 0x37, 0x35, 0x36, 0x31, 0x37, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x30, 0x65, 0x3a, 0x35, 0x63, 0x3a, 0x33, 0x30, 0x3a, 0x36, + 0x32, 0x3a, 0x32, 0x37, 0x3a, 0x65, 0x62, 0x3a, 0x35, 0x62, 0x3a, 0x62, + 0x63, 0x3a, 0x64, 0x37, 0x3a, 0x61, 0x65, 0x3a, 0x36, 0x32, 0x3a, 0x62, + 0x61, 0x3a, 0x65, 0x39, 0x3a, 0x64, 0x35, 0x3a, 0x64, 0x66, 0x3a, 0x37, + 0x37, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x32, 0x64, + 0x3a, 0x30, 0x64, 0x3a, 0x35, 0x32, 0x3a, 0x31, 0x34, 0x3a, 0x66, 0x66, + 0x3a, 0x39, 0x65, 0x3a, 0x61, 0x64, 0x3a, 0x39, 0x39, 0x3a, 0x32, 0x34, + 0x3a, 0x30, 0x31, 0x3a, 0x37, 0x34, 0x3a, 0x32, 0x30, 0x3a, 0x34, 0x37, + 0x3a, 0x36, 0x65, 0x3a, 0x36, 0x63, 0x3a, 0x38, 0x35, 0x3a, 0x32, 0x37, + 0x3a, 0x32, 0x37, 0x3a, 0x66, 0x35, 0x3a, 0x34, 0x33, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x34, 0x3a, 0x38, + 0x64, 0x3a, 0x33, 0x64, 0x3a, 0x32, 0x33, 0x3a, 0x65, 0x65, 0x3a, 0x64, + 0x62, 0x3a, 0x35, 0x30, 0x3a, 0x61, 0x34, 0x3a, 0x35, 0x39, 0x3a, 0x65, + 0x35, 0x3a, 0x35, 0x31, 0x3a, 0x39, 0x37, 0x3a, 0x36, 0x30, 0x3a, 0x31, + 0x63, 0x3a, 0x32, 0x37, 0x3a, 0x37, 0x37, 0x3a, 0x34, 0x62, 0x3a, 0x39, + 0x64, 0x3a, 0x37, 0x62, 0x3a, 0x31, 0x38, 0x3a, 0x63, 0x39, 0x3a, 0x34, + 0x64, 0x3a, 0x35, 0x61, 0x3a, 0x30, 0x35, 0x3a, 0x39, 0x35, 0x3a, 0x31, + 0x31, 0x3a, 0x61, 0x31, 0x3a, 0x30, 0x32, 0x3a, 0x35, 0x30, 0x3a, 0x62, + 0x39, 0x3a, 0x33, 0x31, 0x3a, 0x36, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x47, 0x57, 0x7a, 0x43, 0x43, 0x42, 0x45, 0x4f, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x52, 0x41, 0x4d, 0x72, 0x70, + 0x47, 0x34, 0x6e, 0x78, 0x56, 0x51, 0x4d, 0x4e, 0x6f, 0x2b, 0x5a, 0x42, + 0x62, 0x63, 0x54, 0x6a, 0x70, 0x75, 0x45, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, + 0x42, 0x51, 0x41, 0x77, 0x0a, 0x57, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x52, 0x6c, 0x49, + 0x78, 0x45, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, + 0x4d, 0x43, 0x55, 0x52, 0x6f, 0x61, 0x57, 0x31, 0x35, 0x62, 0x33, 0x52, + 0x70, 0x63, 0x7a, 0x45, 0x63, 0x4d, 0x42, 0x6f, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x43, 0x77, 0x77, 0x54, 0x4d, 0x44, 0x41, 0x77, 0x0a, 0x4d, 0x69, + 0x41, 0x30, 0x4f, 0x44, 0x45, 0x30, 0x4e, 0x6a, 0x4d, 0x77, 0x4f, 0x44, + 0x45, 0x77, 0x4d, 0x44, 0x41, 0x7a, 0x4e, 0x6a, 0x45, 0x5a, 0x4d, 0x42, + 0x63, 0x47, 0x41, 0x31, 0x55, 0x45, 0x41, 0x77, 0x77, 0x51, 0x51, 0x32, + 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6e, 0x62, 0x6d, 0x45, 0x67, 0x55, 0x6d, + 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x54, 0x41, 0x65, 0x46, 0x77, + 0x30, 0x78, 0x0a, 0x4d, 0x7a, 0x45, 0x77, 0x4d, 0x44, 0x45, 0x77, 0x4f, + 0x44, 0x4d, 0x79, 0x4d, 0x6a, 0x64, 0x61, 0x46, 0x77, 0x30, 0x7a, 0x4d, + 0x7a, 0x45, 0x77, 0x4d, 0x44, 0x45, 0x77, 0x4f, 0x44, 0x4d, 0x79, 0x4d, + 0x6a, 0x64, 0x61, 0x4d, 0x46, 0x6f, 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x5a, 0x53, 0x4d, + 0x52, 0x49, 0x77, 0x45, 0x41, 0x59, 0x44, 0x0a, 0x56, 0x51, 0x51, 0x4b, + 0x44, 0x41, 0x6c, 0x45, 0x61, 0x47, 0x6c, 0x74, 0x65, 0x57, 0x39, 0x30, + 0x61, 0x58, 0x4d, 0x78, 0x48, 0x44, 0x41, 0x61, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x73, 0x4d, 0x45, 0x7a, 0x41, 0x77, 0x4d, 0x44, 0x49, 0x67, + 0x4e, 0x44, 0x67, 0x78, 0x4e, 0x44, 0x59, 0x7a, 0x4d, 0x44, 0x67, 0x78, + 0x4d, 0x44, 0x41, 0x77, 0x4d, 0x7a, 0x59, 0x78, 0x47, 0x54, 0x41, 0x58, + 0x0a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x4d, 0x45, 0x45, 0x4e, + 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x32, 0x35, 0x68, 0x49, 0x46, 0x4a, + 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x77, 0x67, 0x67, 0x49, + 0x69, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, + 0x33, 0x44, 0x51, 0x45, 0x42, 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, + 0x43, 0x44, 0x77, 0x41, 0x77, 0x0a, 0x67, 0x67, 0x49, 0x4b, 0x41, 0x6f, + 0x49, 0x43, 0x41, 0x51, 0x44, 0x4e, 0x47, 0x44, 0x6c, 0x6c, 0x47, 0x6c, + 0x6d, 0x78, 0x36, 0x6d, 0x51, 0x57, 0x44, 0x6f, 0x79, 0x55, 0x4a, 0x4a, + 0x56, 0x38, 0x67, 0x39, 0x50, 0x46, 0x4f, 0x53, 0x62, 0x63, 0x44, 0x4f, + 0x38, 0x57, 0x56, 0x34, 0x33, 0x58, 0x32, 0x4b, 0x79, 0x6a, 0x51, 0x6e, + 0x2b, 0x43, 0x79, 0x75, 0x33, 0x4e, 0x57, 0x39, 0x73, 0x4f, 0x0a, 0x74, + 0x79, 0x33, 0x74, 0x52, 0x51, 0x67, 0x58, 0x73, 0x74, 0x6d, 0x7a, 0x79, + 0x39, 0x59, 0x58, 0x55, 0x6e, 0x49, 0x6f, 0x32, 0x34, 0x35, 0x4f, 0x6e, + 0x6f, 0x71, 0x32, 0x43, 0x2f, 0x6d, 0x65, 0x68, 0x4a, 0x70, 0x4e, 0x64, + 0x74, 0x34, 0x69, 0x4b, 0x56, 0x7a, 0x53, 0x73, 0x39, 0x49, 0x47, 0x50, + 0x6a, 0x41, 0x35, 0x71, 0x58, 0x53, 0x6a, 0x6b, 0x6c, 0x59, 0x63, 0x6f, + 0x57, 0x39, 0x4d, 0x0a, 0x43, 0x69, 0x42, 0x74, 0x6e, 0x79, 0x4e, 0x36, + 0x74, 0x4d, 0x62, 0x61, 0x4c, 0x4f, 0x51, 0x64, 0x4c, 0x4e, 0x79, 0x7a, + 0x4b, 0x4e, 0x41, 0x54, 0x38, 0x6b, 0x78, 0x4f, 0x41, 0x6b, 0x6d, 0x68, + 0x56, 0x45, 0x43, 0x65, 0x35, 0x75, 0x55, 0x46, 0x6f, 0x43, 0x32, 0x45, + 0x79, 0x50, 0x2b, 0x59, 0x62, 0x4e, 0x44, 0x72, 0x69, 0x68, 0x71, 0x45, + 0x43, 0x42, 0x36, 0x33, 0x61, 0x43, 0x50, 0x75, 0x0a, 0x49, 0x39, 0x56, + 0x77, 0x7a, 0x6d, 0x31, 0x52, 0x61, 0x52, 0x44, 0x75, 0x6f, 0x58, 0x72, + 0x43, 0x30, 0x53, 0x49, 0x78, 0x77, 0x6f, 0x4b, 0x46, 0x30, 0x76, 0x4a, + 0x56, 0x64, 0x6c, 0x42, 0x38, 0x4a, 0x58, 0x72, 0x4a, 0x68, 0x46, 0x77, + 0x4c, 0x72, 0x4e, 0x31, 0x43, 0x54, 0x69, 0x76, 0x6e, 0x67, 0x71, 0x49, + 0x6b, 0x69, 0x63, 0x75, 0x51, 0x73, 0x74, 0x44, 0x75, 0x49, 0x37, 0x70, + 0x6d, 0x0a, 0x54, 0x4c, 0x74, 0x69, 0x70, 0x50, 0x6c, 0x54, 0x57, 0x6d, + 0x52, 0x37, 0x66, 0x4a, 0x6a, 0x36, 0x6f, 0x30, 0x69, 0x65, 0x44, 0x35, + 0x57, 0x75, 0x70, 0x78, 0x6a, 0x30, 0x61, 0x75, 0x77, 0x75, 0x41, 0x30, + 0x57, 0x76, 0x38, 0x48, 0x54, 0x34, 0x4b, 0x73, 0x31, 0x36, 0x58, 0x64, + 0x47, 0x2b, 0x52, 0x43, 0x59, 0x79, 0x4b, 0x66, 0x48, 0x78, 0x39, 0x57, + 0x7a, 0x4d, 0x66, 0x67, 0x49, 0x68, 0x0a, 0x43, 0x35, 0x39, 0x76, 0x70, + 0x44, 0x2b, 0x2b, 0x6e, 0x56, 0x50, 0x69, 0x7a, 0x33, 0x32, 0x70, 0x4c, + 0x48, 0x78, 0x59, 0x47, 0x70, 0x66, 0x68, 0x50, 0x54, 0x63, 0x33, 0x47, + 0x47, 0x59, 0x6f, 0x30, 0x6b, 0x44, 0x46, 0x55, 0x59, 0x71, 0x4d, 0x77, + 0x79, 0x33, 0x4f, 0x55, 0x34, 0x67, 0x6b, 0x57, 0x47, 0x51, 0x77, 0x46, + 0x73, 0x57, 0x71, 0x34, 0x4e, 0x59, 0x4b, 0x70, 0x6b, 0x44, 0x66, 0x0a, + 0x65, 0x50, 0x62, 0x31, 0x42, 0x48, 0x78, 0x70, 0x45, 0x34, 0x53, 0x38, + 0x30, 0x64, 0x47, 0x6e, 0x42, 0x73, 0x38, 0x42, 0x39, 0x32, 0x6a, 0x41, + 0x71, 0x46, 0x65, 0x37, 0x4f, 0x6d, 0x47, 0x74, 0x42, 0x49, 0x79, 0x54, + 0x34, 0x36, 0x33, 0x38, 0x38, 0x4e, 0x74, 0x45, 0x62, 0x56, 0x6e, 0x63, + 0x53, 0x56, 0x6d, 0x75, 0x72, 0x4a, 0x71, 0x5a, 0x4e, 0x6a, 0x42, 0x42, + 0x65, 0x33, 0x59, 0x7a, 0x0a, 0x49, 0x6f, 0x65, 0x6a, 0x77, 0x70, 0x4b, + 0x47, 0x62, 0x76, 0x6c, 0x77, 0x37, 0x71, 0x36, 0x48, 0x68, 0x35, 0x55, + 0x62, 0x78, 0x48, 0x71, 0x39, 0x4d, 0x66, 0x50, 0x55, 0x30, 0x75, 0x57, + 0x5a, 0x2f, 0x37, 0x35, 0x49, 0x37, 0x48, 0x58, 0x31, 0x65, 0x42, 0x59, + 0x64, 0x70, 0x6e, 0x44, 0x42, 0x66, 0x7a, 0x77, 0x62, 0x6f, 0x5a, 0x4c, + 0x37, 0x7a, 0x38, 0x67, 0x38, 0x31, 0x73, 0x57, 0x54, 0x0a, 0x43, 0x6f, + 0x2f, 0x31, 0x56, 0x54, 0x70, 0x32, 0x6c, 0x63, 0x35, 0x5a, 0x6d, 0x49, + 0x6f, 0x4a, 0x6c, 0x58, 0x63, 0x79, 0x6d, 0x6f, 0x4f, 0x36, 0x4c, 0x41, + 0x51, 0x36, 0x6c, 0x37, 0x33, 0x55, 0x4c, 0x37, 0x37, 0x58, 0x62, 0x4a, + 0x75, 0x69, 0x79, 0x6e, 0x31, 0x74, 0x4a, 0x73, 0x6c, 0x56, 0x31, 0x63, + 0x2f, 0x44, 0x65, 0x56, 0x49, 0x49, 0x43, 0x5a, 0x6b, 0x48, 0x4a, 0x43, + 0x31, 0x6b, 0x0a, 0x4a, 0x57, 0x75, 0x6d, 0x49, 0x57, 0x6d, 0x62, 0x61, + 0x74, 0x31, 0x30, 0x54, 0x57, 0x75, 0x58, 0x65, 0x6b, 0x47, 0x39, 0x71, + 0x78, 0x66, 0x35, 0x6b, 0x42, 0x64, 0x49, 0x6a, 0x7a, 0x62, 0x35, 0x4c, + 0x64, 0x58, 0x46, 0x32, 0x2b, 0x36, 0x71, 0x68, 0x55, 0x56, 0x42, 0x2b, + 0x73, 0x30, 0x36, 0x52, 0x62, 0x46, 0x6f, 0x35, 0x6a, 0x5a, 0x4d, 0x6d, + 0x35, 0x42, 0x58, 0x37, 0x43, 0x4f, 0x35, 0x0a, 0x68, 0x77, 0x6a, 0x43, + 0x78, 0x41, 0x6e, 0x78, 0x6c, 0x34, 0x59, 0x71, 0x4b, 0x45, 0x33, 0x69, + 0x64, 0x4d, 0x44, 0x61, 0x78, 0x49, 0x7a, 0x62, 0x33, 0x2b, 0x4b, 0x68, + 0x46, 0x31, 0x6e, 0x4f, 0x4a, 0x46, 0x6c, 0x30, 0x4d, 0x64, 0x70, 0x2f, + 0x2f, 0x54, 0x42, 0x74, 0x32, 0x64, 0x7a, 0x68, 0x61, 0x75, 0x48, 0x38, + 0x58, 0x77, 0x49, 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x34, 0x49, 0x42, + 0x0a, 0x47, 0x6a, 0x43, 0x43, 0x41, 0x52, 0x59, 0x77, 0x44, 0x77, 0x59, + 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, + 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x4f, 0x42, 0x42, 0x59, 0x45, 0x0a, 0x46, 0x42, 0x69, 0x48, 0x56, 0x75, + 0x42, 0x75, 0x64, 0x2b, 0x34, 0x6b, 0x4e, 0x54, 0x78, 0x4f, 0x63, 0x35, + 0x6f, 0x66, 0x31, 0x75, 0x48, 0x69, 0x65, 0x58, 0x34, 0x72, 0x4d, 0x42, + 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x49, 0x77, 0x51, 0x59, 0x4d, 0x42, + 0x61, 0x41, 0x46, 0x42, 0x69, 0x48, 0x56, 0x75, 0x42, 0x75, 0x64, 0x2b, + 0x34, 0x6b, 0x4e, 0x54, 0x78, 0x4f, 0x63, 0x35, 0x6f, 0x66, 0x0a, 0x31, + 0x75, 0x48, 0x69, 0x65, 0x58, 0x34, 0x72, 0x4d, 0x45, 0x51, 0x47, 0x41, + 0x31, 0x55, 0x64, 0x49, 0x41, 0x51, 0x39, 0x4d, 0x44, 0x73, 0x77, 0x4f, + 0x51, 0x59, 0x45, 0x56, 0x52, 0x30, 0x67, 0x41, 0x44, 0x41, 0x78, 0x4d, + 0x43, 0x38, 0x47, 0x43, 0x43, 0x73, 0x47, 0x41, 0x51, 0x55, 0x46, 0x42, + 0x77, 0x49, 0x42, 0x46, 0x69, 0x4e, 0x6f, 0x64, 0x48, 0x52, 0x77, 0x63, + 0x7a, 0x6f, 0x76, 0x0a, 0x4c, 0x33, 0x64, 0x33, 0x64, 0x33, 0x63, 0x75, + 0x59, 0x32, 0x56, 0x79, 0x64, 0x47, 0x6c, 0x6e, 0x62, 0x6d, 0x45, 0x75, + 0x5a, 0x6e, 0x49, 0x76, 0x59, 0x58, 0x56, 0x30, 0x62, 0x33, 0x4a, 0x70, + 0x64, 0x47, 0x56, 0x7a, 0x4c, 0x7a, 0x42, 0x74, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x52, 0x38, 0x45, 0x5a, 0x6a, 0x42, 0x6b, 0x4d, 0x43, 0x2b, 0x67, + 0x4c, 0x61, 0x41, 0x72, 0x68, 0x69, 0x6c, 0x6f, 0x0a, 0x64, 0x48, 0x52, + 0x77, 0x4f, 0x69, 0x38, 0x76, 0x59, 0x33, 0x4a, 0x73, 0x4c, 0x6d, 0x4e, + 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x32, 0x35, 0x68, 0x4c, 0x6d, 0x5a, + 0x79, 0x4c, 0x32, 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x32, 0x35, + 0x68, 0x63, 0x6d, 0x39, 0x76, 0x64, 0x47, 0x4e, 0x68, 0x4c, 0x6d, 0x4e, + 0x79, 0x62, 0x44, 0x41, 0x78, 0x6f, 0x43, 0x2b, 0x67, 0x4c, 0x59, 0x59, + 0x72, 0x0a, 0x61, 0x48, 0x52, 0x30, 0x63, 0x44, 0x6f, 0x76, 0x4c, 0x32, + 0x4e, 0x79, 0x62, 0x43, 0x35, 0x6b, 0x61, 0x47, 0x6c, 0x74, 0x65, 0x57, + 0x39, 0x30, 0x61, 0x58, 0x4d, 0x75, 0x59, 0x32, 0x39, 0x74, 0x4c, 0x32, + 0x4e, 0x6c, 0x63, 0x6e, 0x52, 0x70, 0x5a, 0x32, 0x35, 0x68, 0x63, 0x6d, + 0x39, 0x76, 0x64, 0x47, 0x4e, 0x68, 0x4c, 0x6d, 0x4e, 0x79, 0x62, 0x44, + 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x0a, 0x68, 0x6b, 0x69, 0x47, 0x39, + 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, + 0x67, 0x45, 0x41, 0x6c, 0x4c, 0x69, 0x65, 0x54, 0x2f, 0x44, 0x6a, 0x6c, + 0x51, 0x67, 0x69, 0x35, 0x38, 0x31, 0x6f, 0x51, 0x66, 0x63, 0x63, 0x56, + 0x64, 0x56, 0x38, 0x41, 0x4f, 0x49, 0x74, 0x4f, 0x6f, 0x6c, 0x64, 0x61, + 0x44, 0x67, 0x76, 0x55, 0x53, 0x49, 0x4c, 0x53, 0x6f, 0x33, 0x4c, 0x0a, + 0x36, 0x62, 0x74, 0x64, 0x50, 0x72, 0x74, 0x63, 0x50, 0x62, 0x45, 0x6f, + 0x2f, 0x75, 0x52, 0x54, 0x56, 0x52, 0x50, 0x50, 0x6f, 0x5a, 0x41, 0x62, + 0x41, 0x68, 0x31, 0x66, 0x5a, 0x6b, 0x59, 0x4a, 0x4d, 0x79, 0x6a, 0x68, + 0x44, 0x53, 0x53, 0x58, 0x63, 0x4e, 0x4d, 0x51, 0x48, 0x2b, 0x70, 0x6b, + 0x56, 0x35, 0x61, 0x37, 0x58, 0x64, 0x72, 0x6e, 0x78, 0x49, 0x78, 0x50, + 0x54, 0x47, 0x52, 0x47, 0x0a, 0x48, 0x56, 0x79, 0x48, 0x34, 0x31, 0x6e, + 0x65, 0x51, 0x74, 0x47, 0x62, 0x71, 0x48, 0x36, 0x6d, 0x69, 0x64, 0x32, + 0x50, 0x48, 0x4d, 0x6b, 0x77, 0x67, 0x75, 0x30, 0x37, 0x6e, 0x4d, 0x33, + 0x41, 0x36, 0x52, 0x6e, 0x67, 0x61, 0x74, 0x67, 0x43, 0x64, 0x54, 0x65, + 0x72, 0x39, 0x7a, 0x51, 0x6f, 0x4b, 0x4a, 0x48, 0x79, 0x42, 0x41, 0x70, + 0x50, 0x4e, 0x65, 0x4e, 0x67, 0x4a, 0x67, 0x48, 0x36, 0x0a, 0x30, 0x42, + 0x47, 0x4d, 0x2b, 0x52, 0x46, 0x71, 0x37, 0x71, 0x38, 0x39, 0x77, 0x31, + 0x44, 0x54, 0x6a, 0x31, 0x38, 0x7a, 0x65, 0x54, 0x79, 0x47, 0x71, 0x48, + 0x4e, 0x46, 0x6b, 0x49, 0x77, 0x67, 0x74, 0x6e, 0x4a, 0x7a, 0x46, 0x79, + 0x4f, 0x2b, 0x42, 0x32, 0x58, 0x6c, 0x65, 0x4a, 0x49, 0x4e, 0x75, 0x67, + 0x48, 0x41, 0x36, 0x34, 0x77, 0x63, 0x5a, 0x72, 0x2b, 0x73, 0x68, 0x6e, + 0x63, 0x42, 0x0a, 0x6c, 0x41, 0x32, 0x63, 0x35, 0x75, 0x6b, 0x35, 0x6a, + 0x52, 0x2b, 0x6d, 0x55, 0x59, 0x79, 0x5a, 0x44, 0x44, 0x6c, 0x33, 0x34, + 0x62, 0x53, 0x62, 0x2b, 0x68, 0x78, 0x6e, 0x56, 0x32, 0x39, 0x71, 0x61, + 0x6f, 0x36, 0x70, 0x4b, 0x30, 0x78, 0x58, 0x65, 0x58, 0x70, 0x58, 0x49, + 0x73, 0x2f, 0x4e, 0x58, 0x32, 0x4e, 0x47, 0x6a, 0x56, 0x78, 0x5a, 0x4f, + 0x6f, 0x62, 0x34, 0x4d, 0x6b, 0x64, 0x69, 0x0a, 0x6f, 0x32, 0x63, 0x4e, + 0x47, 0x4a, 0x48, 0x63, 0x2b, 0x36, 0x5a, 0x72, 0x39, 0x55, 0x68, 0x68, + 0x63, 0x79, 0x4e, 0x5a, 0x6a, 0x67, 0x4b, 0x6e, 0x76, 0x45, 0x54, 0x71, + 0x39, 0x45, 0x6d, 0x64, 0x38, 0x56, 0x52, 0x59, 0x2b, 0x57, 0x43, 0x76, + 0x32, 0x68, 0x69, 0x6b, 0x4c, 0x79, 0x68, 0x46, 0x33, 0x48, 0x71, 0x67, + 0x69, 0x49, 0x5a, 0x64, 0x38, 0x7a, 0x76, 0x6e, 0x2f, 0x79, 0x6b, 0x31, + 0x0a, 0x67, 0x50, 0x78, 0x6b, 0x51, 0x35, 0x54, 0x6d, 0x34, 0x78, 0x78, + 0x76, 0x76, 0x71, 0x30, 0x4f, 0x4b, 0x6d, 0x4f, 0x5a, 0x4b, 0x38, 0x6c, + 0x2b, 0x68, 0x66, 0x5a, 0x78, 0x36, 0x41, 0x59, 0x44, 0x6c, 0x66, 0x37, + 0x65, 0x6a, 0x30, 0x67, 0x63, 0x57, 0x74, 0x53, 0x53, 0x36, 0x43, 0x76, + 0x75, 0x35, 0x7a, 0x48, 0x62, 0x75, 0x67, 0x52, 0x71, 0x68, 0x35, 0x6a, + 0x6e, 0x78, 0x56, 0x2f, 0x76, 0x0a, 0x66, 0x61, 0x63, 0x69, 0x39, 0x77, + 0x48, 0x59, 0x54, 0x66, 0x6d, 0x4a, 0x30, 0x41, 0x36, 0x61, 0x42, 0x56, + 0x6d, 0x6b, 0x6e, 0x70, 0x6a, 0x5a, 0x62, 0x79, 0x76, 0x4b, 0x63, 0x4c, + 0x35, 0x6b, 0x77, 0x6c, 0x57, 0x6a, 0x39, 0x4f, 0x6d, 0x76, 0x77, 0x35, + 0x49, 0x70, 0x33, 0x49, 0x67, 0x57, 0x4a, 0x4a, 0x6b, 0x38, 0x6a, 0x53, + 0x61, 0x59, 0x74, 0x6c, 0x75, 0x33, 0x7a, 0x4d, 0x36, 0x33, 0x0a, 0x4e, + 0x77, 0x66, 0x39, 0x4a, 0x74, 0x6d, 0x59, 0x68, 0x53, 0x54, 0x2f, 0x57, + 0x53, 0x4d, 0x44, 0x6d, 0x75, 0x32, 0x64, 0x6e, 0x61, 0x6a, 0x6b, 0x58, + 0x6a, 0x6a, 0x4f, 0x31, 0x31, 0x49, 0x4e, 0x62, 0x39, 0x49, 0x2f, 0x62, + 0x62, 0x45, 0x46, 0x61, 0x30, 0x6e, 0x4f, 0x69, 0x70, 0x46, 0x47, 0x63, + 0x2f, 0x54, 0x32, 0x4c, 0x2f, 0x43, 0x6f, 0x63, 0x33, 0x63, 0x4f, 0x5a, + 0x61, 0x79, 0x68, 0x0a, 0x6a, 0x57, 0x5a, 0x53, 0x61, 0x58, 0x35, 0x4c, + 0x61, 0x41, 0x7a, 0x48, 0x48, 0x6a, 0x63, 0x6e, 0x67, 0x36, 0x57, 0x4d, + 0x78, 0x77, 0x4c, 0x6b, 0x46, 0x4d, 0x31, 0x4a, 0x41, 0x62, 0x42, 0x7a, + 0x73, 0x2f, 0x33, 0x47, 0x6b, 0x44, 0x70, 0x76, 0x30, 0x6d, 0x7a, 0x74, + 0x4f, 0x2b, 0x37, 0x73, 0x6b, 0x62, 0x36, 0x69, 0x51, 0x31, 0x32, 0x4c, + 0x41, 0x45, 0x70, 0x6d, 0x4a, 0x55, 0x52, 0x77, 0x0a, 0x33, 0x6b, 0x41, + 0x50, 0x2b, 0x48, 0x77, 0x56, 0x39, 0x36, 0x4c, 0x4f, 0x50, 0x4e, 0x64, + 0x65, 0x45, 0x34, 0x79, 0x42, 0x46, 0x78, 0x67, 0x58, 0x30, 0x62, 0x33, + 0x78, 0x64, 0x78, 0x41, 0x36, 0x31, 0x47, 0x55, 0x35, 0x77, 0x53, 0x65, + 0x73, 0x56, 0x79, 0x77, 0x6c, 0x56, 0x50, 0x2b, 0x69, 0x32, 0x6b, 0x2b, + 0x4b, 0x59, 0x54, 0x6c, 0x65, 0x72, 0x6a, 0x31, 0x4b, 0x6a, 0x4c, 0x30, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, + 0x31, 0x20, 0x4f, 0x3d, 0x65, 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, + 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, + 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x65, 0x64, 0x20, 0x4f, 0x55, 0x3d, + 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x50, 0x4b, 0x49, 0x0a, 0x23, + 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x31, 0x20, 0x4f, 0x3d, 0x65, + 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, + 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x64, 0x20, 0x4f, 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x50, 0x4b, 0x49, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, + 0x6c, 0x3a, 0x20, 0x22, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, + 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x31, 0x22, + 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x32, + 0x33, 0x35, 0x39, 0x33, 0x31, 0x38, 0x36, 0x36, 0x36, 0x38, 0x38, 0x33, + 0x31, 0x39, 0x33, 0x30, 0x38, 0x38, 0x31, 0x34, 0x30, 0x34, 0x30, 0x0a, + 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, + 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x39, 0x63, 0x3a, 0x34, 0x32, + 0x3a, 0x38, 0x34, 0x3a, 0x35, 0x37, 0x3a, 0x64, 0x64, 0x3a, 0x63, 0x62, + 0x3a, 0x30, 0x62, 0x3a, 0x61, 0x37, 0x3a, 0x32, 0x65, 0x3a, 0x39, 0x35, + 0x3a, 0x61, 0x64, 0x3a, 0x62, 0x36, 0x3a, 0x66, 0x33, 0x3a, 0x64, 0x61, + 0x3a, 0x62, 0x63, 0x3a, 0x61, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, + 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x3a, 0x20, 0x38, 0x61, 0x3a, 0x63, 0x37, 0x3a, 0x61, 0x64, 0x3a, + 0x38, 0x66, 0x3a, 0x37, 0x33, 0x3a, 0x61, 0x63, 0x3a, 0x34, 0x65, 0x3a, + 0x63, 0x31, 0x3a, 0x62, 0x35, 0x3a, 0x37, 0x35, 0x3a, 0x34, 0x64, 0x3a, + 0x61, 0x35, 0x3a, 0x34, 0x30, 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x63, 0x3a, + 0x63, 0x66, 0x3a, 0x37, 0x63, 0x3a, 0x62, 0x35, 0x3a, 0x38, 0x65, 0x3a, + 0x38, 0x63, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, + 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, + 0x20, 0x34, 0x30, 0x3a, 0x66, 0x36, 0x3a, 0x61, 0x66, 0x3a, 0x30, 0x33, + 0x3a, 0x34, 0x36, 0x3a, 0x61, 0x39, 0x3a, 0x39, 0x61, 0x3a, 0x61, 0x31, + 0x3a, 0x63, 0x64, 0x3a, 0x31, 0x64, 0x3a, 0x35, 0x35, 0x3a, 0x35, 0x61, + 0x3a, 0x34, 0x65, 0x3a, 0x39, 0x63, 0x3a, 0x63, 0x65, 0x3a, 0x36, 0x32, + 0x3a, 0x63, 0x37, 0x3a, 0x66, 0x39, 0x3a, 0x36, 0x33, 0x3a, 0x34, 0x36, + 0x3a, 0x30, 0x33, 0x3a, 0x65, 0x65, 0x3a, 0x34, 0x30, 0x3a, 0x36, 0x36, + 0x3a, 0x31, 0x35, 0x3a, 0x38, 0x33, 0x3a, 0x33, 0x64, 0x3a, 0x63, 0x38, + 0x3a, 0x63, 0x38, 0x3a, 0x64, 0x30, 0x3a, 0x30, 0x33, 0x3a, 0x36, 0x37, + 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, + 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x6c, 0x44, 0x43, + 0x43, 0x41, 0x6e, 0x79, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, + 0x4b, 0x4d, 0x66, 0x58, 0x6b, 0x59, 0x67, 0x78, 0x73, 0x57, 0x4f, 0x33, + 0x57, 0x32, 0x44, 0x41, 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, + 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, 0x51, 0x73, 0x46, 0x41, 0x44, 0x42, + 0x6e, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x0a, 0x56, 0x51, + 0x51, 0x47, 0x45, 0x77, 0x4a, 0x4a, 0x54, 0x6a, 0x45, 0x54, 0x4d, 0x42, + 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x4b, 0x5a, 0x57, + 0x31, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x42, 0x4c, 0x53, 0x54, + 0x45, 0x6c, 0x4d, 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, + 0x4d, 0x63, 0x5a, 0x55, 0x31, 0x31, 0x5a, 0x47, 0x68, 0x79, 0x59, 0x53, + 0x42, 0x55, 0x0a, 0x5a, 0x57, 0x4e, 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x62, + 0x32, 0x64, 0x70, 0x5a, 0x58, 0x4d, 0x67, 0x54, 0x47, 0x6c, 0x74, 0x61, + 0x58, 0x52, 0x6c, 0x5a, 0x44, 0x45, 0x63, 0x4d, 0x42, 0x6f, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x54, 0x5a, 0x57, 0x31, 0x54, 0x61, + 0x57, 0x64, 0x75, 0x49, 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, + 0x30, 0x45, 0x67, 0x4c, 0x53, 0x42, 0x48, 0x0a, 0x4d, 0x54, 0x41, 0x65, + 0x46, 0x77, 0x30, 0x78, 0x4f, 0x44, 0x41, 0x79, 0x4d, 0x54, 0x67, 0x78, + 0x4f, 0x44, 0x4d, 0x77, 0x4d, 0x44, 0x42, 0x61, 0x46, 0x77, 0x30, 0x30, + 0x4d, 0x7a, 0x41, 0x79, 0x4d, 0x54, 0x67, 0x78, 0x4f, 0x44, 0x4d, 0x77, + 0x4d, 0x44, 0x42, 0x61, 0x4d, 0x47, 0x63, 0x78, 0x43, 0x7a, 0x41, 0x4a, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, 0x6c, 0x4f, + 0x0a, 0x4d, 0x52, 0x4d, 0x77, 0x45, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4c, 0x45, 0x77, 0x70, 0x6c, 0x62, 0x56, 0x4e, 0x70, 0x5a, 0x32, 0x34, + 0x67, 0x55, 0x45, 0x74, 0x4a, 0x4d, 0x53, 0x55, 0x77, 0x49, 0x77, 0x59, + 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x78, 0x78, 0x6c, 0x54, 0x58, 0x56, + 0x6b, 0x61, 0x48, 0x4a, 0x68, 0x49, 0x46, 0x52, 0x6c, 0x59, 0x32, 0x68, + 0x75, 0x62, 0x32, 0x78, 0x76, 0x0a, 0x5a, 0x32, 0x6c, 0x6c, 0x63, 0x79, + 0x42, 0x4d, 0x61, 0x57, 0x31, 0x70, 0x64, 0x47, 0x56, 0x6b, 0x4d, 0x52, + 0x77, 0x77, 0x47, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, + 0x4e, 0x6c, 0x62, 0x56, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x55, 0x6d, + 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, + 0x63, 0x78, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x0a, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, + 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x6b, + 0x30, 0x75, 0x37, 0x36, 0x57, 0x61, 0x4b, 0x37, 0x70, 0x31, 0x62, 0x31, + 0x54, 0x53, 0x54, 0x30, 0x42, 0x73, 0x65, 0x77, 0x2b, 0x65, 0x65, 0x75, + 0x47, 0x51, 0x7a, 0x0a, 0x66, 0x32, 0x4e, 0x34, 0x61, 0x4c, 0x54, 0x4e, + 0x4c, 0x6e, 0x46, 0x31, 0x31, 0x35, 0x73, 0x67, 0x78, 0x6b, 0x30, 0x70, + 0x76, 0x4c, 0x5a, 0x6f, 0x59, 0x49, 0x72, 0x33, 0x49, 0x5a, 0x70, 0x57, + 0x4e, 0x56, 0x72, 0x7a, 0x64, 0x72, 0x33, 0x59, 0x7a, 0x5a, 0x72, 0x2f, + 0x6b, 0x31, 0x5a, 0x4c, 0x70, 0x56, 0x6b, 0x47, 0x6f, 0x5a, 0x4d, 0x30, + 0x4b, 0x64, 0x30, 0x57, 0x4e, 0x48, 0x56, 0x4f, 0x0a, 0x38, 0x6f, 0x47, + 0x30, 0x78, 0x35, 0x5a, 0x4f, 0x72, 0x52, 0x6b, 0x56, 0x55, 0x6b, 0x72, + 0x2b, 0x50, 0x48, 0x42, 0x31, 0x63, 0x4d, 0x32, 0x76, 0x4b, 0x36, 0x73, + 0x56, 0x6d, 0x6a, 0x4d, 0x38, 0x71, 0x72, 0x4f, 0x4c, 0x71, 0x73, 0x31, + 0x44, 0x2f, 0x66, 0x58, 0x71, 0x63, 0x50, 0x2f, 0x74, 0x7a, 0x78, 0x45, + 0x37, 0x6c, 0x4d, 0x35, 0x4f, 0x4d, 0x68, 0x62, 0x54, 0x49, 0x30, 0x41, + 0x71, 0x0a, 0x64, 0x37, 0x4f, 0x76, 0x50, 0x41, 0x45, 0x73, 0x62, 0x4f, + 0x32, 0x5a, 0x4c, 0x49, 0x76, 0x5a, 0x54, 0x6d, 0x6d, 0x59, 0x73, 0x76, + 0x65, 0x50, 0x51, 0x62, 0x41, 0x79, 0x65, 0x47, 0x48, 0x57, 0x44, 0x56, + 0x2f, 0x44, 0x2b, 0x71, 0x4a, 0x41, 0x6b, 0x68, 0x31, 0x63, 0x46, 0x2b, + 0x5a, 0x77, 0x50, 0x6a, 0x58, 0x6e, 0x6f, 0x72, 0x66, 0x43, 0x59, 0x75, + 0x4b, 0x72, 0x70, 0x44, 0x68, 0x4d, 0x0a, 0x74, 0x54, 0x6b, 0x31, 0x62, + 0x2b, 0x6f, 0x44, 0x61, 0x66, 0x6f, 0x36, 0x56, 0x47, 0x69, 0x46, 0x62, + 0x64, 0x62, 0x79, 0x4c, 0x30, 0x4e, 0x56, 0x48, 0x70, 0x45, 0x4e, 0x44, + 0x74, 0x6a, 0x56, 0x61, 0x71, 0x53, 0x57, 0x30, 0x52, 0x4d, 0x38, 0x4c, + 0x48, 0x68, 0x51, 0x36, 0x44, 0x71, 0x53, 0x30, 0x68, 0x64, 0x57, 0x35, + 0x54, 0x55, 0x61, 0x51, 0x42, 0x77, 0x2b, 0x6a, 0x53, 0x7a, 0x74, 0x0a, + 0x4f, 0x64, 0x39, 0x43, 0x34, 0x49, 0x4e, 0x42, 0x64, 0x4e, 0x2b, 0x6a, + 0x7a, 0x63, 0x4b, 0x47, 0x59, 0x45, 0x68, 0x6f, 0x34, 0x32, 0x6b, 0x4c, + 0x56, 0x41, 0x43, 0x4c, 0x35, 0x48, 0x5a, 0x70, 0x49, 0x51, 0x31, 0x35, + 0x54, 0x6a, 0x51, 0x49, 0x58, 0x68, 0x54, 0x43, 0x7a, 0x4c, 0x47, 0x33, + 0x72, 0x64, 0x64, 0x38, 0x63, 0x49, 0x72, 0x48, 0x68, 0x51, 0x49, 0x44, + 0x41, 0x51, 0x41, 0x42, 0x0a, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, + 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, + 0x55, 0x2b, 0x2b, 0x38, 0x4e, 0x68, 0x70, 0x36, 0x77, 0x34, 0x39, 0x32, + 0x70, 0x75, 0x66, 0x45, 0x68, 0x46, 0x33, 0x38, 0x2b, 0x2f, 0x50, 0x42, + 0x33, 0x4b, 0x78, 0x6f, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x0a, 0x41, 0x67, + 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, + 0x45, 0x42, 0x41, 0x46, 0x6e, 0x2f, 0x38, 0x6f, 0x7a, 0x31, 0x68, 0x33, + 0x31, 0x78, 0x0a, 0x50, 0x61, 0x4f, 0x66, 0x47, 0x31, 0x76, 0x52, 0x32, + 0x76, 0x6a, 0x54, 0x6e, 0x47, 0x73, 0x32, 0x76, 0x5a, 0x75, 0x70, 0x59, + 0x65, 0x76, 0x65, 0x46, 0x69, 0x78, 0x30, 0x50, 0x5a, 0x37, 0x6d, 0x64, + 0x64, 0x72, 0x58, 0x75, 0x71, 0x65, 0x38, 0x51, 0x68, 0x66, 0x6e, 0x50, + 0x5a, 0x48, 0x72, 0x35, 0x58, 0x33, 0x64, 0x50, 0x70, 0x7a, 0x78, 0x7a, + 0x35, 0x4b, 0x73, 0x62, 0x45, 0x6a, 0x4d, 0x0a, 0x77, 0x69, 0x49, 0x2f, + 0x61, 0x54, 0x76, 0x46, 0x74, 0x68, 0x55, 0x76, 0x6f, 0x7a, 0x58, 0x47, + 0x61, 0x43, 0x6f, 0x63, 0x56, 0x36, 0x38, 0x35, 0x37, 0x34, 0x33, 0x51, + 0x4e, 0x63, 0x4d, 0x59, 0x44, 0x48, 0x73, 0x41, 0x56, 0x68, 0x7a, 0x4e, + 0x69, 0x78, 0x6c, 0x30, 0x33, 0x72, 0x34, 0x50, 0x45, 0x75, 0x44, 0x51, + 0x71, 0x71, 0x45, 0x2f, 0x41, 0x6a, 0x53, 0x78, 0x63, 0x4d, 0x36, 0x64, + 0x0a, 0x47, 0x4e, 0x59, 0x49, 0x41, 0x77, 0x6c, 0x47, 0x37, 0x6d, 0x44, + 0x67, 0x66, 0x72, 0x62, 0x45, 0x53, 0x51, 0x52, 0x52, 0x66, 0x58, 0x42, + 0x67, 0x76, 0x4b, 0x71, 0x79, 0x2f, 0x33, 0x6c, 0x79, 0x65, 0x71, 0x59, + 0x64, 0x50, 0x56, 0x38, 0x71, 0x2b, 0x4d, 0x72, 0x69, 0x2f, 0x54, 0x6d, + 0x33, 0x52, 0x37, 0x6e, 0x72, 0x66, 0x74, 0x38, 0x45, 0x49, 0x36, 0x2f, + 0x36, 0x6e, 0x41, 0x59, 0x48, 0x0a, 0x36, 0x66, 0x74, 0x6a, 0x6b, 0x34, + 0x42, 0x41, 0x74, 0x63, 0x5a, 0x73, 0x43, 0x6a, 0x45, 0x6f, 0x7a, 0x67, + 0x79, 0x66, 0x7a, 0x37, 0x4d, 0x6a, 0x4e, 0x59, 0x42, 0x42, 0x6a, 0x57, + 0x7a, 0x45, 0x4e, 0x33, 0x75, 0x42, 0x4c, 0x34, 0x43, 0x68, 0x51, 0x45, + 0x4b, 0x46, 0x36, 0x64, 0x6b, 0x34, 0x6a, 0x65, 0x69, 0x68, 0x55, 0x38, + 0x30, 0x42, 0x76, 0x32, 0x6e, 0x6f, 0x57, 0x67, 0x62, 0x79, 0x0a, 0x52, + 0x51, 0x75, 0x51, 0x2b, 0x71, 0x37, 0x68, 0x76, 0x35, 0x33, 0x79, 0x72, + 0x6c, 0x63, 0x38, 0x70, 0x61, 0x36, 0x79, 0x56, 0x76, 0x53, 0x4c, 0x5a, + 0x55, 0x44, 0x70, 0x2f, 0x54, 0x47, 0x42, 0x4c, 0x50, 0x51, 0x35, 0x43, + 0x64, 0x6a, 0x75, 0x61, 0x36, 0x65, 0x30, 0x70, 0x68, 0x30, 0x56, 0x70, + 0x5a, 0x6a, 0x33, 0x41, 0x59, 0x48, 0x59, 0x68, 0x58, 0x33, 0x7a, 0x55, + 0x56, 0x78, 0x78, 0x0a, 0x69, 0x4e, 0x36, 0x36, 0x7a, 0x42, 0x2b, 0x41, + 0x66, 0x6b, 0x6f, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x65, 0x6d, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x65, + 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, + 0x6f, 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x65, 0x64, 0x20, 0x4f, 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, + 0x6e, 0x20, 0x50, 0x4b, 0x49, 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x65, 0x6d, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, + 0x43, 0x41, 0x20, 0x2d, 0x20, 0x47, 0x33, 0x20, 0x4f, 0x3d, 0x65, 0x4d, + 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, 0x54, 0x65, 0x63, 0x68, 0x6e, 0x6f, + 0x6c, 0x6f, 0x67, 0x69, 0x65, 0x73, 0x20, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x65, 0x64, 0x20, 0x4f, 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, + 0x20, 0x50, 0x4b, 0x49, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x3a, 0x20, 0x22, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, + 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, + 0x47, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x3a, 0x20, 0x32, 0x38, 0x37, 0x38, 0x38, 0x30, 0x34, 0x34, 0x30, 0x31, + 0x30, 0x31, 0x35, 0x37, 0x31, 0x30, 0x38, 0x36, 0x39, 0x34, 0x35, 0x31, + 0x35, 0x36, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x63, 0x65, + 0x3a, 0x30, 0x62, 0x3a, 0x37, 0x32, 0x3a, 0x64, 0x31, 0x3a, 0x39, 0x66, + 0x3a, 0x38, 0x38, 0x3a, 0x38, 0x65, 0x3a, 0x64, 0x30, 0x3a, 0x35, 0x30, + 0x3a, 0x30, 0x33, 0x3a, 0x65, 0x38, 0x3a, 0x65, 0x33, 0x3a, 0x62, 0x38, + 0x3a, 0x38, 0x62, 0x3a, 0x36, 0x37, 0x3a, 0x34, 0x30, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x33, 0x30, 0x3a, 0x34, 0x33, 0x3a, + 0x66, 0x61, 0x3a, 0x34, 0x66, 0x3a, 0x66, 0x32, 0x3a, 0x35, 0x37, 0x3a, + 0x64, 0x63, 0x3a, 0x61, 0x30, 0x3a, 0x63, 0x33, 0x3a, 0x38, 0x30, 0x3a, + 0x65, 0x65, 0x3a, 0x32, 0x65, 0x3a, 0x35, 0x38, 0x3a, 0x65, 0x61, 0x3a, + 0x37, 0x38, 0x3a, 0x62, 0x32, 0x3a, 0x33, 0x66, 0x3a, 0x65, 0x36, 0x3a, + 0x62, 0x62, 0x3a, 0x63, 0x31, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, + 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x38, 0x36, 0x3a, 0x61, 0x31, 0x3a, 0x65, 0x63, + 0x3a, 0x62, 0x61, 0x3a, 0x30, 0x38, 0x3a, 0x39, 0x63, 0x3a, 0x34, 0x61, + 0x3a, 0x38, 0x64, 0x3a, 0x33, 0x62, 0x3a, 0x62, 0x65, 0x3a, 0x32, 0x37, + 0x3a, 0x33, 0x34, 0x3a, 0x63, 0x36, 0x3a, 0x31, 0x32, 0x3a, 0x62, 0x61, + 0x3a, 0x33, 0x34, 0x3a, 0x31, 0x64, 0x3a, 0x38, 0x31, 0x3a, 0x33, 0x65, + 0x3a, 0x30, 0x34, 0x3a, 0x33, 0x63, 0x3a, 0x66, 0x39, 0x3a, 0x65, 0x38, + 0x3a, 0x61, 0x38, 0x3a, 0x36, 0x32, 0x3a, 0x63, 0x64, 0x3a, 0x35, 0x63, + 0x3a, 0x35, 0x37, 0x3a, 0x61, 0x33, 0x3a, 0x36, 0x62, 0x3a, 0x62, 0x65, + 0x3a, 0x36, 0x62, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, + 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, + 0x54, 0x6a, 0x43, 0x43, 0x41, 0x64, 0x4f, 0x67, 0x41, 0x77, 0x49, 0x42, + 0x41, 0x67, 0x49, 0x4b, 0x50, 0x50, 0x59, 0x48, 0x71, 0x57, 0x68, 0x77, + 0x44, 0x74, 0x71, 0x4c, 0x68, 0x44, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, + 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, 0x42, 0x72, + 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, + 0x0a, 0x45, 0x77, 0x4a, 0x4a, 0x54, 0x6a, 0x45, 0x54, 0x4d, 0x42, 0x45, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x4b, 0x5a, 0x57, 0x31, + 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x42, 0x4c, 0x53, 0x54, 0x45, + 0x6c, 0x4d, 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, + 0x63, 0x5a, 0x55, 0x31, 0x31, 0x5a, 0x47, 0x68, 0x79, 0x59, 0x53, 0x42, + 0x55, 0x5a, 0x57, 0x4e, 0x6f, 0x0a, 0x62, 0x6d, 0x39, 0x73, 0x62, 0x32, + 0x64, 0x70, 0x5a, 0x58, 0x4d, 0x67, 0x54, 0x47, 0x6c, 0x74, 0x61, 0x58, + 0x52, 0x6c, 0x5a, 0x44, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, + 0x55, 0x45, 0x41, 0x78, 0x4d, 0x58, 0x5a, 0x57, 0x31, 0x54, 0x61, 0x57, + 0x64, 0x75, 0x49, 0x45, 0x56, 0x44, 0x51, 0x79, 0x42, 0x53, 0x62, 0x32, + 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x43, 0x30, 0x67, 0x0a, 0x52, + 0x7a, 0x4d, 0x77, 0x48, 0x68, 0x63, 0x4e, 0x4d, 0x54, 0x67, 0x77, 0x4d, + 0x6a, 0x45, 0x34, 0x4d, 0x54, 0x67, 0x7a, 0x4d, 0x44, 0x41, 0x77, 0x57, + 0x68, 0x63, 0x4e, 0x4e, 0x44, 0x4d, 0x77, 0x4d, 0x6a, 0x45, 0x34, 0x4d, + 0x54, 0x67, 0x7a, 0x4d, 0x44, 0x41, 0x77, 0x57, 0x6a, 0x42, 0x72, 0x4d, + 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, 0x51, 0x47, 0x45, + 0x77, 0x4a, 0x4a, 0x0a, 0x54, 0x6a, 0x45, 0x54, 0x4d, 0x42, 0x45, 0x47, + 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x4b, 0x5a, 0x57, 0x31, 0x54, + 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x42, 0x4c, 0x53, 0x54, 0x45, 0x6c, + 0x4d, 0x43, 0x4d, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x63, + 0x5a, 0x55, 0x31, 0x31, 0x5a, 0x47, 0x68, 0x79, 0x59, 0x53, 0x42, 0x55, + 0x5a, 0x57, 0x4e, 0x6f, 0x62, 0x6d, 0x39, 0x73, 0x0a, 0x62, 0x32, 0x64, + 0x70, 0x5a, 0x58, 0x4d, 0x67, 0x54, 0x47, 0x6c, 0x74, 0x61, 0x58, 0x52, + 0x6c, 0x5a, 0x44, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x41, 0x78, 0x4d, 0x58, 0x5a, 0x57, 0x31, 0x54, 0x61, 0x57, 0x64, + 0x75, 0x49, 0x45, 0x56, 0x44, 0x51, 0x79, 0x42, 0x53, 0x62, 0x32, 0x39, + 0x30, 0x49, 0x45, 0x4e, 0x42, 0x49, 0x43, 0x30, 0x67, 0x52, 0x7a, 0x4d, + 0x77, 0x0a, 0x64, 0x6a, 0x41, 0x51, 0x42, 0x67, 0x63, 0x71, 0x68, 0x6b, + 0x6a, 0x4f, 0x50, 0x51, 0x49, 0x42, 0x42, 0x67, 0x55, 0x72, 0x67, 0x51, + 0x51, 0x41, 0x49, 0x67, 0x4e, 0x69, 0x41, 0x41, 0x51, 0x6a, 0x70, 0x51, + 0x79, 0x34, 0x4c, 0x52, 0x4c, 0x31, 0x4b, 0x50, 0x4f, 0x78, 0x73, 0x74, + 0x33, 0x69, 0x41, 0x68, 0x4b, 0x41, 0x6e, 0x6a, 0x6c, 0x66, 0x53, 0x55, + 0x32, 0x66, 0x79, 0x53, 0x55, 0x30, 0x0a, 0x57, 0x58, 0x54, 0x73, 0x75, + 0x77, 0x59, 0x63, 0x35, 0x38, 0x42, 0x79, 0x72, 0x2b, 0x69, 0x75, 0x4c, + 0x2b, 0x46, 0x42, 0x56, 0x49, 0x63, 0x55, 0x71, 0x45, 0x71, 0x79, 0x36, + 0x48, 0x79, 0x43, 0x35, 0x6c, 0x74, 0x71, 0x74, 0x64, 0x79, 0x7a, 0x64, + 0x63, 0x36, 0x4c, 0x42, 0x74, 0x43, 0x47, 0x49, 0x37, 0x39, 0x47, 0x31, + 0x59, 0x34, 0x50, 0x50, 0x77, 0x54, 0x30, 0x31, 0x78, 0x79, 0x53, 0x0a, + 0x66, 0x76, 0x61, 0x6c, 0x59, 0x38, 0x4c, 0x31, 0x58, 0x34, 0x34, 0x75, + 0x54, 0x36, 0x45, 0x59, 0x47, 0x51, 0x49, 0x72, 0x4d, 0x67, 0x71, 0x43, + 0x5a, 0x48, 0x30, 0x57, 0x6b, 0x39, 0x47, 0x6a, 0x51, 0x6a, 0x42, 0x41, + 0x4d, 0x42, 0x30, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x67, 0x51, 0x57, + 0x42, 0x42, 0x52, 0x38, 0x58, 0x51, 0x4b, 0x45, 0x45, 0x39, 0x54, 0x4d, + 0x69, 0x70, 0x75, 0x42, 0x0a, 0x7a, 0x68, 0x63, 0x63, 0x4c, 0x69, 0x6b, + 0x65, 0x6e, 0x45, 0x68, 0x6a, 0x51, 0x6a, 0x41, 0x4f, 0x42, 0x67, 0x4e, + 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, 0x45, 0x42, 0x41, 0x4d, + 0x43, 0x41, 0x51, 0x59, 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x54, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, + 0x42, 0x2f, 0x7a, 0x41, 0x4b, 0x42, 0x67, 0x67, 0x71, 0x0a, 0x68, 0x6b, + 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x77, 0x4e, 0x70, 0x41, 0x44, + 0x42, 0x6d, 0x41, 0x6a, 0x45, 0x41, 0x76, 0x76, 0x4e, 0x68, 0x7a, 0x77, + 0x49, 0x51, 0x48, 0x57, 0x53, 0x56, 0x42, 0x37, 0x67, 0x59, 0x62, 0x6f, + 0x69, 0x46, 0x42, 0x53, 0x2b, 0x44, 0x43, 0x42, 0x65, 0x51, 0x79, 0x68, + 0x2b, 0x4b, 0x54, 0x4f, 0x67, 0x4e, 0x47, 0x33, 0x71, 0x78, 0x72, 0x64, + 0x57, 0x42, 0x0a, 0x43, 0x55, 0x66, 0x76, 0x4f, 0x36, 0x77, 0x49, 0x42, + 0x48, 0x78, 0x63, 0x6d, 0x62, 0x48, 0x74, 0x52, 0x77, 0x66, 0x53, 0x41, + 0x6a, 0x45, 0x41, 0x6e, 0x62, 0x70, 0x56, 0x2f, 0x4b, 0x6c, 0x4b, 0x36, + 0x4f, 0x33, 0x74, 0x35, 0x6e, 0x59, 0x42, 0x51, 0x6e, 0x76, 0x49, 0x2b, + 0x47, 0x44, 0x5a, 0x6a, 0x56, 0x47, 0x4c, 0x56, 0x54, 0x76, 0x37, 0x6a, + 0x48, 0x76, 0x72, 0x5a, 0x51, 0x6e, 0x44, 0x0a, 0x2b, 0x4a, 0x62, 0x4e, + 0x52, 0x36, 0x69, 0x43, 0x38, 0x68, 0x5a, 0x56, 0x64, 0x79, 0x52, 0x2b, + 0x45, 0x68, 0x43, 0x56, 0x42, 0x43, 0x79, 0x6a, 0x0a, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, + 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, + 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, + 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x43, 0x31, 0x20, 0x4f, 0x3d, 0x65, + 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, + 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x50, 0x4b, 0x49, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x43, 0x31, 0x20, 0x4f, + 0x3d, 0x65, 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, 0x49, 0x6e, 0x63, + 0x20, 0x4f, 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x50, + 0x4b, 0x49, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, + 0x22, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x43, 0x31, 0x22, 0x0a, 0x23, 0x20, + 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, 0x20, 0x38, 0x32, 0x35, 0x35, + 0x31, 0x30, 0x32, 0x39, 0x36, 0x36, 0x31, 0x33, 0x33, 0x31, 0x36, 0x30, + 0x30, 0x34, 0x39, 0x35, 0x35, 0x30, 0x35, 0x38, 0x0a, 0x23, 0x20, 0x4d, + 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x38, 0x3a, 0x65, 0x33, 0x3a, 0x35, 0x64, + 0x3a, 0x30, 0x31, 0x3a, 0x32, 0x31, 0x3a, 0x66, 0x61, 0x3a, 0x37, 0x38, + 0x3a, 0x35, 0x61, 0x3a, 0x62, 0x30, 0x3a, 0x64, 0x66, 0x3a, 0x62, 0x61, + 0x3a, 0x64, 0x32, 0x3a, 0x65, 0x65, 0x3a, 0x32, 0x61, 0x3a, 0x35, 0x66, + 0x3a, 0x36, 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x65, 0x37, 0x3a, 0x32, 0x65, 0x3a, 0x66, 0x31, 0x3a, 0x64, 0x66, 0x3a, + 0x66, 0x63, 0x3a, 0x62, 0x32, 0x3a, 0x30, 0x39, 0x3a, 0x32, 0x38, 0x3a, + 0x63, 0x66, 0x3a, 0x35, 0x64, 0x3a, 0x64, 0x34, 0x3a, 0x64, 0x35, 0x3a, + 0x36, 0x37, 0x3a, 0x33, 0x37, 0x3a, 0x62, 0x31, 0x3a, 0x35, 0x31, 0x3a, + 0x63, 0x62, 0x3a, 0x38, 0x36, 0x3a, 0x34, 0x66, 0x3a, 0x30, 0x31, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x32, + 0x3a, 0x35, 0x36, 0x3a, 0x30, 0x39, 0x3a, 0x61, 0x61, 0x3a, 0x33, 0x30, + 0x3a, 0x31, 0x64, 0x3a, 0x61, 0x30, 0x3a, 0x61, 0x32, 0x3a, 0x34, 0x39, + 0x3a, 0x62, 0x39, 0x3a, 0x37, 0x61, 0x3a, 0x38, 0x32, 0x3a, 0x33, 0x39, + 0x3a, 0x63, 0x62, 0x3a, 0x36, 0x61, 0x3a, 0x33, 0x34, 0x3a, 0x32, 0x31, + 0x3a, 0x36, 0x66, 0x3a, 0x34, 0x34, 0x3a, 0x64, 0x63, 0x3a, 0x61, 0x63, + 0x3a, 0x39, 0x66, 0x3a, 0x33, 0x39, 0x3a, 0x35, 0x34, 0x3a, 0x62, 0x31, + 0x3a, 0x34, 0x32, 0x3a, 0x39, 0x32, 0x3a, 0x66, 0x32, 0x3a, 0x65, 0x38, + 0x3a, 0x63, 0x38, 0x3a, 0x36, 0x30, 0x3a, 0x38, 0x66, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, + 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x44, 0x63, 0x7a, 0x43, 0x43, 0x41, 0x6c, + 0x75, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4c, 0x41, 0x4b, + 0x37, 0x50, 0x41, 0x4c, 0x72, 0x45, 0x7a, 0x7a, 0x4c, 0x34, 0x51, 0x37, + 0x49, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x42, 0x51, 0x41, 0x77, 0x56, 0x6a, + 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, + 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x43, 0x6d, 0x56, 0x74, 0x55, + 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x51, 0x53, 0x30, 0x6b, 0x78, 0x46, + 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, + 0x32, 0x56, 0x4e, 0x64, 0x57, 0x52, 0x6f, 0x63, 0x6d, 0x45, 0x67, 0x0a, + 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, 0x77, 0x77, 0x47, 0x67, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x4e, 0x6c, 0x62, 0x56, 0x4e, 0x70, + 0x5a, 0x32, 0x34, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x51, 0x53, 0x41, 0x74, 0x49, 0x45, 0x4d, 0x78, 0x4d, 0x42, 0x34, 0x58, + 0x44, 0x54, 0x45, 0x34, 0x4d, 0x44, 0x49, 0x78, 0x4f, 0x44, 0x45, 0x34, + 0x4d, 0x7a, 0x41, 0x77, 0x0a, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x51, + 0x7a, 0x4d, 0x44, 0x49, 0x78, 0x4f, 0x44, 0x45, 0x34, 0x4d, 0x7a, 0x41, + 0x77, 0x4d, 0x46, 0x6f, 0x77, 0x56, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, + 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, + 0x78, 0x45, 0x7a, 0x41, 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, + 0x54, 0x43, 0x6d, 0x56, 0x74, 0x55, 0x32, 0x6c, 0x6e, 0x0a, 0x62, 0x69, + 0x42, 0x51, 0x53, 0x30, 0x6b, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x54, 0x43, 0x32, 0x56, 0x4e, 0x64, 0x57, + 0x52, 0x6f, 0x63, 0x6d, 0x45, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x52, + 0x77, 0x77, 0x47, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, + 0x4e, 0x6c, 0x62, 0x56, 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x55, 0x6d, + 0x39, 0x76, 0x0a, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, 0x49, + 0x45, 0x4d, 0x78, 0x4d, 0x49, 0x49, 0x42, 0x49, 0x6a, 0x41, 0x4e, 0x42, + 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, 0x42, 0x41, + 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x51, 0x38, 0x41, 0x4d, + 0x49, 0x49, 0x42, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x51, 0x45, 0x41, 0x7a, + 0x2b, 0x75, 0x70, 0x75, 0x66, 0x47, 0x5a, 0x0a, 0x42, 0x63, 0x7a, 0x59, + 0x4b, 0x43, 0x46, 0x4b, 0x38, 0x33, 0x4d, 0x30, 0x55, 0x59, 0x52, 0x57, + 0x45, 0x50, 0x57, 0x67, 0x54, 0x79, 0x77, 0x53, 0x34, 0x2f, 0x6f, 0x54, + 0x6d, 0x69, 0x66, 0x51, 0x7a, 0x2f, 0x6c, 0x35, 0x47, 0x6e, 0x52, 0x66, + 0x48, 0x58, 0x6b, 0x35, 0x2f, 0x46, 0x76, 0x34, 0x63, 0x49, 0x37, 0x67, + 0x6b, 0x6c, 0x4c, 0x33, 0x35, 0x43, 0x58, 0x35, 0x56, 0x49, 0x50, 0x5a, + 0x0a, 0x48, 0x64, 0x50, 0x49, 0x57, 0x6f, 0x55, 0x2f, 0x58, 0x73, 0x65, + 0x32, 0x42, 0x2b, 0x34, 0x2b, 0x77, 0x4d, 0x36, 0x61, 0x72, 0x36, 0x78, + 0x57, 0x51, 0x69, 0x6f, 0x35, 0x4a, 0x58, 0x44, 0x57, 0x76, 0x37, 0x56, + 0x37, 0x4e, 0x71, 0x32, 0x73, 0x39, 0x6e, 0x50, 0x63, 0x7a, 0x64, 0x63, + 0x64, 0x69, 0x6f, 0x4f, 0x6c, 0x2b, 0x79, 0x75, 0x51, 0x46, 0x54, 0x64, + 0x72, 0x48, 0x43, 0x5a, 0x48, 0x0a, 0x33, 0x44, 0x73, 0x70, 0x56, 0x70, + 0x4e, 0x71, 0x73, 0x38, 0x46, 0x71, 0x4f, 0x70, 0x30, 0x39, 0x39, 0x63, + 0x47, 0x58, 0x4f, 0x46, 0x67, 0x46, 0x69, 0x78, 0x77, 0x52, 0x34, 0x2b, + 0x53, 0x30, 0x75, 0x46, 0x32, 0x46, 0x48, 0x59, 0x50, 0x2b, 0x65, 0x46, + 0x38, 0x4c, 0x52, 0x57, 0x67, 0x59, 0x53, 0x4b, 0x56, 0x47, 0x63, 0x7a, + 0x51, 0x37, 0x2f, 0x67, 0x2f, 0x49, 0x64, 0x72, 0x76, 0x48, 0x0a, 0x47, + 0x50, 0x4d, 0x46, 0x30, 0x59, 0x62, 0x7a, 0x68, 0x65, 0x33, 0x6e, 0x75, + 0x64, 0x6b, 0x79, 0x72, 0x56, 0x57, 0x49, 0x7a, 0x71, 0x61, 0x32, 0x6b, + 0x62, 0x42, 0x50, 0x72, 0x48, 0x34, 0x56, 0x49, 0x35, 0x62, 0x32, 0x50, + 0x2f, 0x41, 0x67, 0x4e, 0x42, 0x62, 0x65, 0x43, 0x73, 0x62, 0x45, 0x42, + 0x45, 0x56, 0x35, 0x66, 0x36, 0x66, 0x39, 0x76, 0x74, 0x4b, 0x70, 0x70, + 0x61, 0x2b, 0x63, 0x0a, 0x78, 0x53, 0x4d, 0x71, 0x39, 0x7a, 0x77, 0x68, + 0x62, 0x4c, 0x32, 0x76, 0x6a, 0x30, 0x37, 0x46, 0x4f, 0x72, 0x4c, 0x7a, + 0x4e, 0x42, 0x4c, 0x38, 0x33, 0x34, 0x41, 0x61, 0x53, 0x61, 0x54, 0x55, + 0x71, 0x5a, 0x58, 0x33, 0x6e, 0x6f, 0x6c, 0x65, 0x6f, 0x6f, 0x6d, 0x73, + 0x6c, 0x4d, 0x75, 0x6f, 0x61, 0x4a, 0x75, 0x76, 0x69, 0x6d, 0x55, 0x6e, + 0x7a, 0x59, 0x6e, 0x75, 0x33, 0x59, 0x79, 0x31, 0x0a, 0x61, 0x79, 0x6c, + 0x77, 0x51, 0x36, 0x42, 0x70, 0x43, 0x2b, 0x53, 0x35, 0x44, 0x77, 0x49, + 0x44, 0x41, 0x51, 0x41, 0x42, 0x6f, 0x30, 0x49, 0x77, 0x51, 0x44, 0x41, + 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, 0x45, 0x46, 0x67, 0x51, + 0x55, 0x2f, 0x71, 0x48, 0x67, 0x63, 0x42, 0x34, 0x71, 0x41, 0x7a, 0x6c, + 0x53, 0x57, 0x6b, 0x4b, 0x2b, 0x58, 0x4a, 0x47, 0x46, 0x65, 0x68, 0x69, + 0x71, 0x0a, 0x54, 0x62, 0x55, 0x77, 0x44, 0x67, 0x59, 0x44, 0x56, 0x52, + 0x30, 0x50, 0x41, 0x51, 0x48, 0x2f, 0x42, 0x41, 0x51, 0x44, 0x41, 0x67, + 0x45, 0x47, 0x4d, 0x41, 0x38, 0x47, 0x41, 0x31, 0x55, 0x64, 0x45, 0x77, + 0x45, 0x42, 0x2f, 0x77, 0x51, 0x46, 0x4d, 0x41, 0x4d, 0x42, 0x41, 0x66, + 0x38, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, + 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x0a, 0x42, 0x51, 0x41, 0x44, 0x67, + 0x67, 0x45, 0x42, 0x41, 0x4d, 0x4a, 0x4b, 0x56, 0x76, 0x6f, 0x56, 0x49, + 0x58, 0x73, 0x6f, 0x6f, 0x75, 0x6e, 0x6c, 0x48, 0x66, 0x76, 0x34, 0x4c, + 0x63, 0x51, 0x35, 0x6c, 0x6b, 0x46, 0x4d, 0x4f, 0x79, 0x63, 0x73, 0x78, + 0x47, 0x77, 0x59, 0x46, 0x59, 0x44, 0x47, 0x72, 0x4b, 0x39, 0x48, 0x57, + 0x53, 0x38, 0x6d, 0x43, 0x2b, 0x4d, 0x32, 0x73, 0x4f, 0x38, 0x37, 0x0a, + 0x2f, 0x6b, 0x4f, 0x58, 0x53, 0x54, 0x4b, 0x5a, 0x45, 0x68, 0x56, 0x62, + 0x33, 0x78, 0x45, 0x70, 0x2f, 0x36, 0x74, 0x54, 0x2b, 0x4c, 0x76, 0x42, + 0x65, 0x41, 0x2b, 0x73, 0x6e, 0x46, 0x4f, 0x76, 0x56, 0x37, 0x31, 0x6f, + 0x6a, 0x44, 0x31, 0x70, 0x4d, 0x2f, 0x43, 0x6a, 0x6f, 0x43, 0x4e, 0x6a, + 0x4f, 0x32, 0x52, 0x6e, 0x49, 0x6b, 0x53, 0x74, 0x31, 0x58, 0x48, 0x4c, + 0x56, 0x69, 0x70, 0x34, 0x0a, 0x6b, 0x71, 0x4e, 0x50, 0x45, 0x6a, 0x45, + 0x32, 0x4e, 0x75, 0x4c, 0x65, 0x2f, 0x67, 0x44, 0x45, 0x6f, 0x32, 0x41, + 0x50, 0x4a, 0x36, 0x32, 0x67, 0x73, 0x49, 0x71, 0x31, 0x4e, 0x6e, 0x70, + 0x53, 0x6f, 0x62, 0x30, 0x6e, 0x39, 0x43, 0x41, 0x6e, 0x59, 0x75, 0x68, + 0x4e, 0x6c, 0x43, 0x51, 0x54, 0x35, 0x41, 0x6f, 0x45, 0x36, 0x54, 0x79, + 0x72, 0x4c, 0x73, 0x68, 0x44, 0x43, 0x55, 0x72, 0x47, 0x0a, 0x59, 0x51, + 0x54, 0x6c, 0x53, 0x54, 0x52, 0x2b, 0x30, 0x38, 0x54, 0x49, 0x39, 0x51, + 0x2f, 0x41, 0x71, 0x75, 0x6d, 0x36, 0x56, 0x46, 0x37, 0x7a, 0x59, 0x79, + 0x74, 0x50, 0x54, 0x31, 0x44, 0x55, 0x2f, 0x72, 0x6c, 0x37, 0x6d, 0x59, + 0x77, 0x39, 0x77, 0x43, 0x36, 0x38, 0x41, 0x69, 0x76, 0x54, 0x78, 0x45, + 0x44, 0x6b, 0x69, 0x67, 0x63, 0x78, 0x48, 0x70, 0x76, 0x4f, 0x4a, 0x70, + 0x6b, 0x54, 0x0a, 0x2b, 0x78, 0x48, 0x71, 0x6d, 0x69, 0x49, 0x4d, 0x45, + 0x52, 0x6e, 0x48, 0x58, 0x68, 0x75, 0x42, 0x55, 0x44, 0x44, 0x49, 0x6c, + 0x68, 0x4a, 0x75, 0x35, 0x38, 0x74, 0x42, 0x66, 0x35, 0x45, 0x37, 0x6f, + 0x6b, 0x65, 0x33, 0x56, 0x49, 0x41, 0x62, 0x33, 0x41, 0x44, 0x4d, 0x6d, + 0x70, 0x44, 0x71, 0x77, 0x38, 0x4e, 0x51, 0x42, 0x6d, 0x49, 0x4d, 0x4d, + 0x4d, 0x41, 0x56, 0x53, 0x4b, 0x65, 0x6f, 0x0a, 0x57, 0x58, 0x7a, 0x68, + 0x72, 0x69, 0x4b, 0x69, 0x34, 0x67, 0x70, 0x36, 0x44, 0x2f, 0x70, 0x69, + 0x71, 0x31, 0x4a, 0x4d, 0x34, 0x66, 0x48, 0x66, 0x79, 0x72, 0x36, 0x44, + 0x44, 0x55, 0x49, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, + 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, + 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, + 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x65, 0x6d, 0x53, + 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, 0x43, 0x33, 0x20, 0x4f, 0x3d, 0x65, + 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, + 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x50, 0x4b, 0x49, + 0x0a, 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, + 0x43, 0x4e, 0x3d, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, 0x45, 0x43, + 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x2d, 0x20, + 0x43, 0x33, 0x20, 0x4f, 0x3d, 0x65, 0x4d, 0x75, 0x64, 0x68, 0x72, 0x61, + 0x20, 0x49, 0x6e, 0x63, 0x20, 0x4f, 0x55, 0x3d, 0x65, 0x6d, 0x53, 0x69, + 0x67, 0x6e, 0x20, 0x50, 0x4b, 0x49, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x65, 0x6d, 0x53, 0x69, 0x67, 0x6e, 0x20, + 0x45, 0x43, 0x43, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x2d, 0x20, 0x43, 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x3a, 0x20, 0x35, 0x38, 0x32, 0x39, 0x34, 0x38, 0x37, 0x31, + 0x30, 0x36, 0x34, 0x32, 0x35, 0x30, 0x36, 0x30, 0x30, 0x30, 0x30, 0x31, + 0x34, 0x35, 0x30, 0x34, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, + 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, + 0x33, 0x65, 0x3a, 0x35, 0x33, 0x3a, 0x62, 0x33, 0x3a, 0x61, 0x33, 0x3a, + 0x38, 0x31, 0x3a, 0x65, 0x65, 0x3a, 0x64, 0x37, 0x3a, 0x31, 0x30, 0x3a, + 0x66, 0x38, 0x3a, 0x64, 0x33, 0x3a, 0x62, 0x30, 0x3a, 0x31, 0x64, 0x3a, + 0x31, 0x37, 0x3a, 0x39, 0x32, 0x3a, 0x66, 0x35, 0x3a, 0x64, 0x35, 0x0a, + 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x36, 0x3a, 0x61, + 0x66, 0x3a, 0x34, 0x33, 0x3a, 0x63, 0x32, 0x3a, 0x39, 0x62, 0x3a, 0x38, + 0x31, 0x3a, 0x35, 0x33, 0x3a, 0x37, 0x64, 0x3a, 0x66, 0x36, 0x3a, 0x65, + 0x66, 0x3a, 0x36, 0x62, 0x3a, 0x63, 0x33, 0x3a, 0x31, 0x66, 0x3a, 0x31, + 0x66, 0x3a, 0x36, 0x30, 0x3a, 0x31, 0x35, 0x3a, 0x30, 0x63, 0x3a, 0x65, + 0x65, 0x3a, 0x34, 0x38, 0x3a, 0x36, 0x36, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x62, 0x63, 0x3a, 0x34, 0x64, 0x3a, + 0x38, 0x30, 0x3a, 0x39, 0x62, 0x3a, 0x31, 0x35, 0x3a, 0x31, 0x38, 0x3a, + 0x39, 0x64, 0x3a, 0x37, 0x38, 0x3a, 0x64, 0x62, 0x3a, 0x33, 0x65, 0x3a, + 0x31, 0x64, 0x3a, 0x38, 0x63, 0x3a, 0x66, 0x34, 0x3a, 0x66, 0x39, 0x3a, + 0x37, 0x32, 0x3a, 0x36, 0x61, 0x3a, 0x37, 0x39, 0x3a, 0x35, 0x64, 0x3a, + 0x61, 0x31, 0x3a, 0x36, 0x34, 0x3a, 0x33, 0x63, 0x3a, 0x61, 0x35, 0x3a, + 0x66, 0x31, 0x3a, 0x33, 0x35, 0x3a, 0x38, 0x65, 0x3a, 0x31, 0x64, 0x3a, + 0x64, 0x62, 0x3a, 0x30, 0x65, 0x3a, 0x64, 0x63, 0x3a, 0x30, 0x64, 0x3a, + 0x37, 0x65, 0x3a, 0x62, 0x33, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, + 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, + 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, + 0x49, 0x43, 0x4b, 0x7a, 0x43, 0x43, 0x41, 0x62, 0x47, 0x67, 0x41, 0x77, + 0x49, 0x42, 0x41, 0x67, 0x49, 0x4b, 0x65, 0x33, 0x47, 0x32, 0x67, 0x6c, + 0x61, 0x34, 0x45, 0x6e, 0x79, 0x63, 0x71, 0x44, 0x41, 0x4b, 0x42, 0x67, + 0x67, 0x71, 0x68, 0x6b, 0x6a, 0x4f, 0x50, 0x51, 0x51, 0x44, 0x41, 0x7a, + 0x42, 0x61, 0x4d, 0x51, 0x73, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x47, 0x0a, 0x45, 0x77, 0x4a, 0x56, 0x55, 0x7a, 0x45, 0x54, 0x4d, + 0x42, 0x45, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x78, 0x4d, 0x4b, 0x5a, + 0x57, 0x31, 0x54, 0x61, 0x57, 0x64, 0x75, 0x49, 0x46, 0x42, 0x4c, 0x53, + 0x54, 0x45, 0x55, 0x4d, 0x42, 0x49, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, + 0x68, 0x4d, 0x4c, 0x5a, 0x55, 0x31, 0x31, 0x5a, 0x47, 0x68, 0x79, 0x59, + 0x53, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x78, 0x0a, 0x49, 0x44, 0x41, 0x65, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x46, 0x32, 0x56, 0x74, + 0x55, 0x32, 0x6c, 0x6e, 0x62, 0x69, 0x42, 0x46, 0x51, 0x30, 0x4d, 0x67, + 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, 0x51, 0x53, 0x41, 0x74, + 0x49, 0x45, 0x4d, 0x7a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x34, + 0x4d, 0x44, 0x49, 0x78, 0x4f, 0x44, 0x45, 0x34, 0x4d, 0x7a, 0x41, 0x77, + 0x0a, 0x4d, 0x46, 0x6f, 0x58, 0x44, 0x54, 0x51, 0x7a, 0x4d, 0x44, 0x49, + 0x78, 0x4f, 0x44, 0x45, 0x34, 0x4d, 0x7a, 0x41, 0x77, 0x4d, 0x46, 0x6f, + 0x77, 0x57, 0x6a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, 0x31, 0x55, + 0x45, 0x42, 0x68, 0x4d, 0x43, 0x56, 0x56, 0x4d, 0x78, 0x45, 0x7a, 0x41, + 0x52, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x73, 0x54, 0x43, 0x6d, 0x56, + 0x74, 0x55, 0x32, 0x6c, 0x6e, 0x0a, 0x62, 0x69, 0x42, 0x51, 0x53, 0x30, + 0x6b, 0x78, 0x46, 0x44, 0x41, 0x53, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, + 0x6f, 0x54, 0x43, 0x32, 0x56, 0x4e, 0x64, 0x57, 0x52, 0x6f, 0x63, 0x6d, + 0x45, 0x67, 0x53, 0x57, 0x35, 0x6a, 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, 0x45, 0x78, 0x64, 0x6c, 0x62, 0x56, + 0x4e, 0x70, 0x5a, 0x32, 0x34, 0x67, 0x52, 0x55, 0x4e, 0x44, 0x0a, 0x49, + 0x46, 0x4a, 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4c, + 0x53, 0x42, 0x44, 0x4d, 0x7a, 0x42, 0x32, 0x4d, 0x42, 0x41, 0x47, 0x42, + 0x79, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x41, 0x67, 0x45, 0x47, 0x42, + 0x53, 0x75, 0x42, 0x42, 0x41, 0x41, 0x69, 0x41, 0x32, 0x49, 0x41, 0x42, + 0x50, 0x32, 0x6c, 0x59, 0x61, 0x35, 0x37, 0x4a, 0x68, 0x41, 0x64, 0x36, + 0x62, 0x63, 0x69, 0x0a, 0x4d, 0x4b, 0x34, 0x47, 0x39, 0x49, 0x47, 0x7a, + 0x73, 0x55, 0x4a, 0x78, 0x6c, 0x54, 0x6d, 0x38, 0x30, 0x31, 0x4c, 0x6a, + 0x72, 0x36, 0x2f, 0x35, 0x38, 0x70, 0x63, 0x31, 0x6b, 0x6a, 0x5a, 0x47, + 0x44, 0x6f, 0x65, 0x56, 0x6a, 0x62, 0x6b, 0x35, 0x57, 0x75, 0x6d, 0x37, + 0x33, 0x39, 0x44, 0x2b, 0x79, 0x41, 0x64, 0x42, 0x50, 0x4c, 0x74, 0x56, + 0x62, 0x34, 0x4f, 0x6a, 0x61, 0x76, 0x74, 0x69, 0x0a, 0x73, 0x49, 0x47, + 0x4a, 0x41, 0x6e, 0x42, 0x39, 0x53, 0x4d, 0x56, 0x4b, 0x34, 0x2b, 0x6b, + 0x69, 0x56, 0x43, 0x4a, 0x4e, 0x6b, 0x37, 0x74, 0x43, 0x44, 0x4b, 0x39, + 0x33, 0x6e, 0x43, 0x4f, 0x6d, 0x66, 0x64, 0x64, 0x68, 0x45, 0x63, 0x35, + 0x6c, 0x78, 0x2f, 0x68, 0x2f, 0x2f, 0x76, 0x58, 0x79, 0x71, 0x61, 0x4e, + 0x43, 0x4d, 0x45, 0x41, 0x77, 0x48, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, + 0x4f, 0x0a, 0x42, 0x42, 0x59, 0x45, 0x46, 0x50, 0x74, 0x61, 0x53, 0x4e, + 0x43, 0x41, 0x49, 0x45, 0x44, 0x79, 0x71, 0x4f, 0x6b, 0x41, 0x42, 0x32, + 0x6b, 0x5a, 0x64, 0x36, 0x66, 0x6d, 0x77, 0x2f, 0x54, 0x50, 0x4d, 0x41, + 0x34, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, + 0x51, 0x45, 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x50, 0x42, 0x67, + 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x0a, 0x41, 0x66, 0x38, 0x45, 0x42, + 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x6f, 0x47, 0x43, + 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d, 0x44, 0x41, + 0x32, 0x67, 0x41, 0x4d, 0x47, 0x55, 0x43, 0x4d, 0x51, 0x43, 0x30, 0x32, + 0x43, 0x38, 0x43, 0x69, 0x66, 0x32, 0x32, 0x54, 0x47, 0x4b, 0x36, 0x51, + 0x30, 0x34, 0x54, 0x68, 0x48, 0x4b, 0x31, 0x72, 0x74, 0x30, 0x63, 0x0a, + 0x33, 0x74, 0x61, 0x31, 0x33, 0x46, 0x61, 0x50, 0x57, 0x45, 0x42, 0x61, + 0x4c, 0x64, 0x34, 0x67, 0x54, 0x43, 0x4b, 0x44, 0x79, 0x70, 0x4f, 0x6f, + 0x66, 0x75, 0x34, 0x53, 0x51, 0x4d, 0x66, 0x57, 0x68, 0x30, 0x2f, 0x34, + 0x33, 0x34, 0x55, 0x43, 0x4d, 0x42, 0x77, 0x55, 0x5a, 0x4f, 0x52, 0x38, + 0x6c, 0x6f, 0x4d, 0x52, 0x6e, 0x4c, 0x44, 0x52, 0x57, 0x6d, 0x46, 0x4c, + 0x70, 0x67, 0x39, 0x4a, 0x0a, 0x30, 0x77, 0x44, 0x38, 0x6f, 0x66, 0x7a, + 0x6b, 0x70, 0x66, 0x39, 0x2f, 0x72, 0x64, 0x63, 0x77, 0x30, 0x4d, 0x64, + 0x33, 0x66, 0x37, 0x36, 0x42, 0x42, 0x31, 0x55, 0x77, 0x55, 0x43, 0x41, + 0x55, 0x39, 0x56, 0x63, 0x34, 0x43, 0x71, 0x67, 0x78, 0x55, 0x51, 0x3d, + 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, + 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x0a, 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, + 0x72, 0x3a, 0x20, 0x43, 0x4e, 0x3d, 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, + 0x6e, 0x67, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, + 0x20, 0x43, 0x41, 0x20, 0x33, 0x20, 0x4f, 0x3d, 0x48, 0x6f, 0x6e, 0x67, + 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, 0x6f, 0x73, 0x74, 0x0a, 0x23, 0x20, + 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, 0x4e, 0x3d, + 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, 0x6f, 0x73, + 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, 0x33, 0x20, + 0x4f, 0x3d, 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, + 0x6f, 0x73, 0x74, 0x0a, 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, + 0x20, 0x22, 0x48, 0x6f, 0x6e, 0x67, 0x6b, 0x6f, 0x6e, 0x67, 0x20, 0x50, + 0x6f, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, 0x41, 0x20, + 0x33, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x3a, + 0x20, 0x34, 0x36, 0x31, 0x37, 0x30, 0x38, 0x36, 0x35, 0x32, 0x38, 0x38, + 0x39, 0x37, 0x31, 0x33, 0x38, 0x35, 0x35, 0x38, 0x38, 0x32, 0x38, 0x31, + 0x31, 0x34, 0x34, 0x31, 0x36, 0x32, 0x39, 0x37, 0x39, 0x33, 0x34, 0x37, + 0x38, 0x37, 0x33, 0x33, 0x37, 0x31, 0x32, 0x38, 0x32, 0x30, 0x38, 0x34, + 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x31, 0x3a, 0x66, + 0x63, 0x3a, 0x39, 0x66, 0x3a, 0x62, 0x64, 0x3a, 0x37, 0x33, 0x3a, 0x33, + 0x30, 0x3a, 0x30, 0x32, 0x3a, 0x38, 0x61, 0x3a, 0x66, 0x64, 0x3a, 0x33, + 0x66, 0x3a, 0x66, 0x33, 0x3a, 0x35, 0x38, 0x3a, 0x62, 0x39, 0x3a, 0x63, + 0x62, 0x3a, 0x32, 0x30, 0x3a, 0x66, 0x30, 0x0a, 0x23, 0x20, 0x53, 0x48, + 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, + 0x6e, 0x74, 0x3a, 0x20, 0x35, 0x38, 0x3a, 0x61, 0x32, 0x3a, 0x64, 0x30, + 0x3a, 0x65, 0x63, 0x3a, 0x32, 0x30, 0x3a, 0x35, 0x32, 0x3a, 0x38, 0x31, + 0x3a, 0x35, 0x62, 0x3a, 0x63, 0x31, 0x3a, 0x66, 0x33, 0x3a, 0x66, 0x38, + 0x3a, 0x36, 0x34, 0x3a, 0x30, 0x32, 0x3a, 0x32, 0x34, 0x3a, 0x34, 0x65, + 0x3a, 0x63, 0x32, 0x3a, 0x38, 0x65, 0x3a, 0x30, 0x32, 0x3a, 0x34, 0x62, + 0x3a, 0x30, 0x32, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x35, 0x61, 0x3a, 0x32, 0x66, 0x3a, 0x63, 0x30, 0x3a, 0x33, + 0x66, 0x3a, 0x30, 0x63, 0x3a, 0x38, 0x33, 0x3a, 0x62, 0x30, 0x3a, 0x39, + 0x30, 0x3a, 0x62, 0x62, 0x3a, 0x66, 0x61, 0x3a, 0x34, 0x30, 0x3a, 0x36, + 0x30, 0x3a, 0x34, 0x62, 0x3a, 0x30, 0x39, 0x3a, 0x38, 0x38, 0x3a, 0x34, + 0x34, 0x3a, 0x36, 0x63, 0x3a, 0x37, 0x36, 0x3a, 0x33, 0x36, 0x3a, 0x31, + 0x38, 0x3a, 0x33, 0x64, 0x3a, 0x66, 0x39, 0x3a, 0x38, 0x34, 0x3a, 0x36, + 0x65, 0x3a, 0x31, 0x37, 0x3a, 0x31, 0x30, 0x3a, 0x31, 0x61, 0x3a, 0x34, + 0x34, 0x3a, 0x37, 0x66, 0x3a, 0x62, 0x38, 0x3a, 0x65, 0x66, 0x3a, 0x64, + 0x36, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, + 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x46, 0x7a, 0x7a, + 0x43, 0x43, 0x41, 0x37, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, + 0x49, 0x55, 0x43, 0x42, 0x5a, 0x66, 0x69, 0x6b, 0x79, 0x6c, 0x37, 0x41, + 0x44, 0x4a, 0x6b, 0x30, 0x44, 0x66, 0x78, 0x4d, 0x61, 0x75, 0x49, 0x37, + 0x67, 0x63, 0x57, 0x71, 0x51, 0x77, 0x44, 0x51, 0x59, 0x4a, 0x4b, 0x6f, + 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, 0x0a, 0x42, + 0x51, 0x41, 0x77, 0x62, 0x7a, 0x45, 0x4c, 0x4d, 0x41, 0x6b, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x42, 0x68, 0x4d, 0x43, 0x53, 0x45, 0x73, 0x78, 0x45, + 0x6a, 0x41, 0x51, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x67, 0x54, 0x43, + 0x55, 0x68, 0x76, 0x62, 0x6d, 0x63, 0x67, 0x53, 0x32, 0x39, 0x75, 0x5a, + 0x7a, 0x45, 0x53, 0x4d, 0x42, 0x41, 0x47, 0x41, 0x31, 0x55, 0x45, 0x42, + 0x78, 0x4d, 0x4a, 0x0a, 0x53, 0x47, 0x39, 0x75, 0x5a, 0x79, 0x42, 0x4c, + 0x62, 0x32, 0x35, 0x6e, 0x4d, 0x52, 0x59, 0x77, 0x46, 0x41, 0x59, 0x44, + 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, 0x49, 0x62, 0x32, 0x35, 0x6e, + 0x61, 0x32, 0x39, 0x75, 0x5a, 0x79, 0x42, 0x51, 0x62, 0x33, 0x4e, 0x30, + 0x4d, 0x53, 0x41, 0x77, 0x48, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x44, + 0x45, 0x78, 0x64, 0x49, 0x62, 0x32, 0x35, 0x6e, 0x0a, 0x61, 0x32, 0x39, + 0x75, 0x5a, 0x79, 0x42, 0x51, 0x62, 0x33, 0x4e, 0x30, 0x49, 0x46, 0x4a, + 0x76, 0x62, 0x33, 0x51, 0x67, 0x51, 0x30, 0x45, 0x67, 0x4d, 0x7a, 0x41, + 0x65, 0x46, 0x77, 0x30, 0x78, 0x4e, 0x7a, 0x41, 0x32, 0x4d, 0x44, 0x4d, + 0x77, 0x4d, 0x6a, 0x49, 0x35, 0x4e, 0x44, 0x5a, 0x61, 0x46, 0x77, 0x30, + 0x30, 0x4d, 0x6a, 0x41, 0x32, 0x4d, 0x44, 0x4d, 0x77, 0x4d, 0x6a, 0x49, + 0x35, 0x0a, 0x4e, 0x44, 0x5a, 0x61, 0x4d, 0x47, 0x38, 0x78, 0x43, 0x7a, + 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6b, + 0x68, 0x4c, 0x4d, 0x52, 0x49, 0x77, 0x45, 0x41, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x49, 0x45, 0x77, 0x6c, 0x49, 0x62, 0x32, 0x35, 0x6e, 0x49, 0x45, + 0x74, 0x76, 0x62, 0x6d, 0x63, 0x78, 0x45, 0x6a, 0x41, 0x51, 0x42, 0x67, + 0x4e, 0x56, 0x42, 0x41, 0x63, 0x54, 0x0a, 0x43, 0x55, 0x68, 0x76, 0x62, + 0x6d, 0x63, 0x67, 0x53, 0x32, 0x39, 0x75, 0x5a, 0x7a, 0x45, 0x57, 0x4d, + 0x42, 0x51, 0x47, 0x41, 0x31, 0x55, 0x45, 0x43, 0x68, 0x4d, 0x4e, 0x53, + 0x47, 0x39, 0x75, 0x5a, 0x32, 0x74, 0x76, 0x62, 0x6d, 0x63, 0x67, 0x55, + 0x47, 0x39, 0x7a, 0x64, 0x44, 0x45, 0x67, 0x4d, 0x42, 0x34, 0x47, 0x41, + 0x31, 0x55, 0x45, 0x41, 0x78, 0x4d, 0x58, 0x53, 0x47, 0x39, 0x75, 0x0a, + 0x5a, 0x32, 0x74, 0x76, 0x62, 0x6d, 0x63, 0x67, 0x55, 0x47, 0x39, 0x7a, + 0x64, 0x43, 0x42, 0x53, 0x62, 0x32, 0x39, 0x30, 0x49, 0x45, 0x4e, 0x42, + 0x49, 0x44, 0x4d, 0x77, 0x67, 0x67, 0x49, 0x69, 0x4d, 0x41, 0x30, 0x47, + 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, + 0x41, 0x51, 0x55, 0x41, 0x41, 0x34, 0x49, 0x43, 0x44, 0x77, 0x41, 0x77, + 0x67, 0x67, 0x49, 0x4b, 0x0a, 0x41, 0x6f, 0x49, 0x43, 0x41, 0x51, 0x43, + 0x7a, 0x69, 0x4e, 0x66, 0x71, 0x7a, 0x67, 0x38, 0x67, 0x54, 0x72, 0x37, + 0x6d, 0x31, 0x67, 0x4e, 0x74, 0x37, 0x6c, 0x6e, 0x38, 0x77, 0x6c, 0x66, + 0x66, 0x4b, 0x57, 0x69, 0x68, 0x67, 0x77, 0x34, 0x2b, 0x61, 0x4d, 0x64, + 0x6f, 0x57, 0x4a, 0x77, 0x63, 0x59, 0x45, 0x75, 0x4a, 0x51, 0x77, 0x79, + 0x35, 0x31, 0x42, 0x57, 0x79, 0x37, 0x73, 0x46, 0x4f, 0x0a, 0x64, 0x65, + 0x6d, 0x31, 0x70, 0x2b, 0x2f, 0x6c, 0x36, 0x54, 0x57, 0x5a, 0x35, 0x4d, + 0x77, 0x63, 0x35, 0x30, 0x74, 0x66, 0x6a, 0x54, 0x4d, 0x77, 0x49, 0x44, + 0x4e, 0x54, 0x32, 0x61, 0x61, 0x37, 0x31, 0x54, 0x34, 0x54, 0x6a, 0x75, + 0x6b, 0x66, 0x68, 0x30, 0x6d, 0x74, 0x55, 0x43, 0x31, 0x51, 0x79, 0x68, + 0x69, 0x2b, 0x41, 0x56, 0x69, 0x69, 0x45, 0x33, 0x43, 0x57, 0x75, 0x34, + 0x6d, 0x49, 0x0a, 0x56, 0x6f, 0x42, 0x63, 0x2b, 0x4c, 0x30, 0x73, 0x50, + 0x4f, 0x46, 0x4d, 0x56, 0x34, 0x69, 0x37, 0x30, 0x37, 0x6d, 0x56, 0x37, + 0x38, 0x76, 0x48, 0x39, 0x74, 0x6f, 0x78, 0x64, 0x43, 0x69, 0x6d, 0x35, + 0x6c, 0x53, 0x4a, 0x39, 0x55, 0x45, 0x78, 0x79, 0x75, 0x55, 0x6d, 0x47, + 0x73, 0x32, 0x43, 0x34, 0x48, 0x44, 0x61, 0x4f, 0x79, 0x6d, 0x37, 0x31, + 0x51, 0x50, 0x31, 0x6d, 0x62, 0x70, 0x56, 0x0a, 0x39, 0x57, 0x54, 0x52, + 0x59, 0x41, 0x36, 0x7a, 0x69, 0x55, 0x6d, 0x34, 0x69, 0x69, 0x38, 0x46, + 0x30, 0x6f, 0x52, 0x46, 0x4b, 0x48, 0x79, 0x50, 0x61, 0x46, 0x41, 0x53, + 0x65, 0x50, 0x77, 0x4c, 0x74, 0x56, 0x50, 0x4c, 0x77, 0x70, 0x67, 0x63, + 0x68, 0x4b, 0x4f, 0x65, 0x73, 0x4c, 0x34, 0x6a, 0x70, 0x4e, 0x72, 0x63, + 0x79, 0x43, 0x73, 0x65, 0x32, 0x6d, 0x35, 0x46, 0x48, 0x6f, 0x6d, 0x59, + 0x0a, 0x32, 0x76, 0x6b, 0x41, 0x4c, 0x67, 0x62, 0x70, 0x44, 0x44, 0x74, + 0x77, 0x31, 0x56, 0x41, 0x6c, 0x69, 0x4a, 0x6e, 0x4c, 0x7a, 0x58, 0x4e, + 0x67, 0x39, 0x39, 0x58, 0x2f, 0x4e, 0x57, 0x66, 0x46, 0x6f, 0x62, 0x78, + 0x65, 0x71, 0x38, 0x31, 0x4b, 0x75, 0x45, 0x58, 0x72, 0x79, 0x47, 0x67, + 0x65, 0x44, 0x51, 0x30, 0x55, 0x52, 0x68, 0x4c, 0x6a, 0x30, 0x6d, 0x52, + 0x69, 0x69, 0x6b, 0x4b, 0x59, 0x0a, 0x76, 0x4c, 0x54, 0x47, 0x43, 0x41, + 0x6a, 0x34, 0x2f, 0x61, 0x68, 0x4d, 0x5a, 0x4a, 0x78, 0x32, 0x41, 0x62, + 0x30, 0x76, 0x71, 0x57, 0x77, 0x7a, 0x44, 0x39, 0x67, 0x2f, 0x4b, 0x4c, + 0x67, 0x38, 0x61, 0x51, 0x46, 0x43, 0x68, 0x6e, 0x35, 0x70, 0x77, 0x63, + 0x6b, 0x47, 0x79, 0x75, 0x56, 0x36, 0x52, 0x6d, 0x58, 0x70, 0x77, 0x74, + 0x5a, 0x51, 0x51, 0x53, 0x34, 0x2f, 0x74, 0x2b, 0x54, 0x74, 0x0a, 0x62, + 0x4e, 0x65, 0x2f, 0x4a, 0x67, 0x45, 0x52, 0x6f, 0x68, 0x59, 0x70, 0x53, + 0x6d, 0x73, 0x30, 0x42, 0x70, 0x44, 0x73, 0x45, 0x39, 0x4b, 0x32, 0x2b, + 0x32, 0x70, 0x32, 0x30, 0x6a, 0x7a, 0x74, 0x38, 0x4e, 0x59, 0x74, 0x33, + 0x65, 0x45, 0x56, 0x37, 0x4b, 0x4f, 0x62, 0x4c, 0x79, 0x7a, 0x4a, 0x50, + 0x69, 0x76, 0x6b, 0x61, 0x54, 0x76, 0x2f, 0x63, 0x69, 0x57, 0x78, 0x4e, + 0x6f, 0x5a, 0x62, 0x0a, 0x78, 0x33, 0x39, 0x72, 0x69, 0x31, 0x55, 0x62, + 0x53, 0x73, 0x55, 0x67, 0x59, 0x54, 0x32, 0x75, 0x79, 0x31, 0x44, 0x68, + 0x43, 0x44, 0x71, 0x2b, 0x73, 0x49, 0x39, 0x6a, 0x51, 0x56, 0x4d, 0x77, + 0x43, 0x46, 0x6b, 0x38, 0x6d, 0x42, 0x31, 0x33, 0x75, 0x6d, 0x4f, 0x52, + 0x65, 0x73, 0x6f, 0x51, 0x55, 0x47, 0x43, 0x2f, 0x38, 0x4e, 0x65, 0x38, + 0x6c, 0x59, 0x65, 0x50, 0x6c, 0x38, 0x58, 0x2b, 0x0a, 0x6c, 0x32, 0x6f, + 0x42, 0x6c, 0x4b, 0x4e, 0x38, 0x57, 0x34, 0x55, 0x64, 0x4b, 0x6a, 0x6b, + 0x36, 0x30, 0x46, 0x53, 0x68, 0x30, 0x54, 0x6c, 0x78, 0x6e, 0x66, 0x30, + 0x68, 0x2b, 0x62, 0x56, 0x37, 0x38, 0x4f, 0x4c, 0x67, 0x41, 0x6f, 0x39, + 0x75, 0x6c, 0x69, 0x51, 0x6c, 0x4c, 0x4b, 0x41, 0x65, 0x4c, 0x4b, 0x6a, + 0x45, 0x69, 0x61, 0x66, 0x76, 0x37, 0x5a, 0x6b, 0x47, 0x4c, 0x37, 0x59, + 0x4b, 0x0a, 0x54, 0x45, 0x2f, 0x62, 0x6f, 0x73, 0x77, 0x33, 0x47, 0x71, + 0x39, 0x48, 0x68, 0x53, 0x32, 0x4b, 0x58, 0x38, 0x51, 0x30, 0x4e, 0x45, + 0x77, 0x41, 0x2f, 0x52, 0x69, 0x54, 0x5a, 0x78, 0x50, 0x52, 0x4e, 0x2b, + 0x5a, 0x49, 0x74, 0x49, 0x73, 0x47, 0x78, 0x56, 0x64, 0x37, 0x47, 0x59, + 0x59, 0x4b, 0x65, 0x63, 0x73, 0x41, 0x79, 0x56, 0x4b, 0x76, 0x51, 0x76, + 0x38, 0x33, 0x6a, 0x2b, 0x47, 0x6a, 0x0a, 0x48, 0x6e, 0x6f, 0x39, 0x55, + 0x4b, 0x74, 0x6a, 0x42, 0x75, 0x63, 0x56, 0x74, 0x54, 0x2b, 0x32, 0x52, + 0x54, 0x65, 0x55, 0x4e, 0x37, 0x46, 0x2b, 0x38, 0x6b, 0x6a, 0x44, 0x66, + 0x38, 0x56, 0x31, 0x2f, 0x70, 0x65, 0x4e, 0x52, 0x59, 0x38, 0x61, 0x70, + 0x78, 0x70, 0x79, 0x4b, 0x42, 0x70, 0x41, 0x44, 0x77, 0x49, 0x44, 0x41, + 0x51, 0x41, 0x42, 0x6f, 0x32, 0x4d, 0x77, 0x59, 0x54, 0x41, 0x50, 0x0a, + 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x42, 0x41, 0x66, 0x38, 0x45, + 0x42, 0x54, 0x41, 0x44, 0x41, 0x51, 0x48, 0x2f, 0x4d, 0x41, 0x34, 0x47, + 0x41, 0x31, 0x55, 0x64, 0x44, 0x77, 0x45, 0x42, 0x2f, 0x77, 0x51, 0x45, + 0x41, 0x77, 0x49, 0x42, 0x42, 0x6a, 0x41, 0x66, 0x42, 0x67, 0x4e, 0x56, + 0x48, 0x53, 0x4d, 0x45, 0x47, 0x44, 0x41, 0x57, 0x67, 0x42, 0x51, 0x58, + 0x6e, 0x63, 0x30, 0x65, 0x0a, 0x69, 0x39, 0x59, 0x35, 0x4b, 0x33, 0x44, + 0x54, 0x58, 0x4e, 0x53, 0x67, 0x75, 0x42, 0x2b, 0x77, 0x41, 0x50, 0x7a, + 0x46, 0x59, 0x54, 0x41, 0x64, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x34, + 0x45, 0x46, 0x67, 0x51, 0x55, 0x46, 0x35, 0x33, 0x4e, 0x48, 0x6f, 0x76, + 0x57, 0x4f, 0x53, 0x74, 0x77, 0x30, 0x31, 0x7a, 0x55, 0x6f, 0x4c, 0x67, + 0x66, 0x73, 0x41, 0x44, 0x38, 0x78, 0x57, 0x45, 0x77, 0x0a, 0x44, 0x51, + 0x59, 0x4a, 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, + 0x45, 0x4c, 0x42, 0x51, 0x41, 0x44, 0x67, 0x67, 0x49, 0x42, 0x41, 0x46, + 0x62, 0x56, 0x65, 0x32, 0x37, 0x6d, 0x49, 0x67, 0x48, 0x53, 0x51, 0x70, + 0x73, 0x59, 0x31, 0x51, 0x37, 0x58, 0x5a, 0x69, 0x4e, 0x63, 0x34, 0x2f, + 0x36, 0x67, 0x78, 0x35, 0x4c, 0x53, 0x36, 0x5a, 0x53, 0x74, 0x53, 0x36, + 0x4c, 0x47, 0x0a, 0x37, 0x42, 0x4a, 0x38, 0x64, 0x4e, 0x56, 0x49, 0x30, + 0x6c, 0x6b, 0x55, 0x6d, 0x63, 0x44, 0x72, 0x75, 0x64, 0x48, 0x72, 0x39, + 0x45, 0x67, 0x77, 0x57, 0x36, 0x32, 0x6e, 0x56, 0x33, 0x4f, 0x5a, 0x71, + 0x64, 0x50, 0x6c, 0x74, 0x39, 0x45, 0x75, 0x57, 0x53, 0x52, 0x59, 0x33, + 0x47, 0x67, 0x75, 0x4c, 0x6d, 0x4c, 0x59, 0x61, 0x75, 0x52, 0x77, 0x43, + 0x79, 0x30, 0x67, 0x55, 0x43, 0x43, 0x6b, 0x0a, 0x4d, 0x70, 0x58, 0x52, + 0x41, 0x4a, 0x69, 0x37, 0x30, 0x2f, 0x33, 0x33, 0x4d, 0x76, 0x4a, 0x4a, + 0x72, 0x73, 0x5a, 0x36, 0x34, 0x45, 0x65, 0x2b, 0x62, 0x73, 0x37, 0x4c, + 0x6f, 0x33, 0x49, 0x36, 0x4c, 0x57, 0x6c, 0x64, 0x79, 0x38, 0x6a, 0x6f, + 0x52, 0x54, 0x6e, 0x55, 0x2b, 0x6b, 0x4c, 0x42, 0x45, 0x55, 0x78, 0x33, + 0x58, 0x5a, 0x4c, 0x37, 0x61, 0x76, 0x39, 0x59, 0x52, 0x4f, 0x58, 0x72, + 0x0a, 0x67, 0x5a, 0x36, 0x76, 0x6f, 0x4a, 0x6d, 0x74, 0x76, 0x71, 0x6b, + 0x42, 0x5a, 0x73, 0x73, 0x34, 0x48, 0x54, 0x7a, 0x66, 0x51, 0x78, 0x2f, + 0x30, 0x54, 0x57, 0x36, 0x30, 0x75, 0x68, 0x64, 0x47, 0x2f, 0x48, 0x33, + 0x39, 0x68, 0x34, 0x46, 0x35, 0x61, 0x67, 0x30, 0x7a, 0x44, 0x2f, 0x6f, + 0x76, 0x2b, 0x42, 0x53, 0x35, 0x67, 0x4c, 0x4e, 0x64, 0x54, 0x61, 0x71, + 0x58, 0x34, 0x66, 0x6e, 0x6b, 0x0a, 0x47, 0x4d, 0x58, 0x34, 0x31, 0x54, + 0x69, 0x4d, 0x4a, 0x6a, 0x7a, 0x39, 0x38, 0x69, 0x6a, 0x69, 0x37, 0x6c, + 0x70, 0x4a, 0x69, 0x43, 0x7a, 0x66, 0x65, 0x54, 0x32, 0x4f, 0x6e, 0x70, + 0x41, 0x38, 0x76, 0x55, 0x46, 0x4b, 0x4f, 0x74, 0x31, 0x62, 0x39, 0x70, + 0x71, 0x30, 0x7a, 0x6a, 0x38, 0x6c, 0x4d, 0x48, 0x38, 0x79, 0x66, 0x61, + 0x49, 0x44, 0x6c, 0x4e, 0x44, 0x63, 0x65, 0x71, 0x46, 0x53, 0x0a, 0x33, + 0x6d, 0x36, 0x54, 0x6a, 0x52, 0x67, 0x6d, 0x2f, 0x56, 0x57, 0x73, 0x76, + 0x59, 0x2b, 0x62, 0x30, 0x73, 0x2b, 0x76, 0x35, 0x34, 0x59, 0x73, 0x79, + 0x78, 0x38, 0x4a, 0x62, 0x36, 0x4e, 0x76, 0x71, 0x59, 0x54, 0x55, 0x63, + 0x37, 0x39, 0x4e, 0x6f, 0x58, 0x51, 0x62, 0x54, 0x69, 0x4e, 0x67, 0x38, + 0x73, 0x77, 0x4f, 0x71, 0x6e, 0x2b, 0x6b, 0x6e, 0x45, 0x77, 0x6c, 0x71, + 0x4c, 0x4a, 0x6d, 0x0a, 0x4f, 0x7a, 0x6a, 0x2f, 0x32, 0x5a, 0x51, 0x77, + 0x39, 0x6e, 0x4b, 0x45, 0x76, 0x6d, 0x68, 0x56, 0x45, 0x41, 0x2f, 0x47, + 0x63, 0x79, 0x77, 0x57, 0x61, 0x5a, 0x4d, 0x48, 0x2f, 0x72, 0x46, 0x46, + 0x37, 0x62, 0x75, 0x69, 0x56, 0x57, 0x71, 0x77, 0x32, 0x72, 0x56, 0x4b, + 0x41, 0x69, 0x55, 0x6e, 0x68, 0x64, 0x65, 0x33, 0x74, 0x34, 0x5a, 0x45, + 0x46, 0x6f, 0x6c, 0x73, 0x67, 0x43, 0x73, 0x2b, 0x0a, 0x6c, 0x36, 0x6d, + 0x63, 0x31, 0x58, 0x35, 0x56, 0x54, 0x4d, 0x62, 0x65, 0x52, 0x52, 0x41, + 0x63, 0x36, 0x75, 0x6b, 0x37, 0x6e, 0x77, 0x4e, 0x54, 0x37, 0x75, 0x35, + 0x36, 0x41, 0x51, 0x49, 0x57, 0x65, 0x4e, 0x54, 0x6f, 0x77, 0x72, 0x35, + 0x47, 0x64, 0x6f, 0x67, 0x54, 0x50, 0x79, 0x4b, 0x37, 0x53, 0x42, 0x49, + 0x64, 0x55, 0x67, 0x43, 0x30, 0x41, 0x6e, 0x34, 0x68, 0x47, 0x68, 0x36, + 0x63, 0x0a, 0x4a, 0x66, 0x54, 0x7a, 0x50, 0x56, 0x34, 0x65, 0x30, 0x68, + 0x7a, 0x35, 0x73, 0x79, 0x32, 0x32, 0x39, 0x7a, 0x64, 0x63, 0x78, 0x73, + 0x73, 0x68, 0x54, 0x72, 0x44, 0x33, 0x6d, 0x55, 0x63, 0x59, 0x68, 0x63, + 0x45, 0x72, 0x75, 0x6c, 0x57, 0x75, 0x42, 0x75, 0x72, 0x51, 0x42, 0x37, + 0x4c, 0x63, 0x71, 0x39, 0x43, 0x43, 0x6c, 0x6e, 0x58, 0x4f, 0x30, 0x6c, + 0x44, 0x2b, 0x6d, 0x65, 0x66, 0x50, 0x0a, 0x4c, 0x35, 0x2f, 0x6e, 0x64, + 0x74, 0x46, 0x68, 0x4b, 0x76, 0x73, 0x68, 0x75, 0x7a, 0x48, 0x51, 0x71, + 0x70, 0x39, 0x48, 0x70, 0x4c, 0x49, 0x69, 0x79, 0x68, 0x59, 0x36, 0x55, + 0x46, 0x66, 0x45, 0x57, 0x30, 0x4e, 0x6e, 0x78, 0x57, 0x56, 0x69, 0x41, + 0x30, 0x6b, 0x42, 0x36, 0x30, 0x50, 0x5a, 0x32, 0x50, 0x69, 0x65, 0x72, + 0x63, 0x2b, 0x78, 0x59, 0x77, 0x35, 0x46, 0x39, 0x4b, 0x42, 0x61, 0x0a, + 0x4c, 0x4a, 0x73, 0x74, 0x78, 0x61, 0x62, 0x41, 0x72, 0x61, 0x68, 0x48, + 0x39, 0x43, 0x64, 0x4d, 0x4f, 0x41, 0x30, 0x75, 0x47, 0x30, 0x6b, 0x37, + 0x55, 0x76, 0x54, 0x6f, 0x69, 0x49, 0x4d, 0x72, 0x56, 0x43, 0x6a, 0x55, + 0x38, 0x6a, 0x56, 0x53, 0x74, 0x44, 0x4b, 0x44, 0x59, 0x6d, 0x6c, 0x6b, + 0x44, 0x4a, 0x47, 0x63, 0x6e, 0x35, 0x66, 0x71, 0x64, 0x42, 0x62, 0x39, + 0x48, 0x78, 0x45, 0x47, 0x0a, 0x6d, 0x70, 0x76, 0x30, 0x0a, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x0a, 0x23, 0x20, 0x49, 0x73, 0x73, 0x75, 0x65, 0x72, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x34, 0x20, 0x4f, 0x3d, 0x45, 0x6e, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x65, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x65, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x6c, + 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x2f, 0x28, + 0x63, 0x29, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x45, 0x6e, 0x74, 0x72, + 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, + 0x23, 0x20, 0x53, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x3a, 0x20, 0x43, + 0x4e, 0x3d, 0x45, 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, + 0x6f, 0x74, 0x20, 0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x20, 0x2d, 0x20, 0x47, 0x34, 0x20, 0x4f, 0x3d, 0x45, 0x6e, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, + 0x4f, 0x55, 0x3d, 0x53, 0x65, 0x65, 0x20, 0x77, 0x77, 0x77, 0x2e, 0x65, + 0x6e, 0x74, 0x72, 0x75, 0x73, 0x74, 0x2e, 0x6e, 0x65, 0x74, 0x2f, 0x6c, + 0x65, 0x67, 0x61, 0x6c, 0x2d, 0x74, 0x65, 0x72, 0x6d, 0x73, 0x2f, 0x28, + 0x63, 0x29, 0x20, 0x32, 0x30, 0x31, 0x35, 0x20, 0x45, 0x6e, 0x74, 0x72, + 0x75, 0x73, 0x74, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x2d, 0x20, + 0x66, 0x6f, 0x72, 0x20, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, + 0x65, 0x64, 0x20, 0x75, 0x73, 0x65, 0x20, 0x6f, 0x6e, 0x6c, 0x79, 0x0a, + 0x23, 0x20, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x3a, 0x20, 0x22, 0x45, 0x6e, + 0x74, 0x72, 0x75, 0x73, 0x74, 0x20, 0x52, 0x6f, 0x6f, 0x74, 0x20, 0x43, + 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x20, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x20, 0x2d, + 0x20, 0x47, 0x34, 0x22, 0x0a, 0x23, 0x20, 0x53, 0x65, 0x72, 0x69, 0x61, + 0x6c, 0x3a, 0x20, 0x32, 0x38, 0x39, 0x33, 0x38, 0x33, 0x36, 0x34, 0x39, + 0x38, 0x35, 0x34, 0x35, 0x30, 0x36, 0x30, 0x38, 0x36, 0x38, 0x32, 0x38, + 0x32, 0x32, 0x30, 0x33, 0x37, 0x34, 0x37, 0x39, 0x36, 0x35, 0x35, 0x36, + 0x36, 0x37, 0x36, 0x34, 0x34, 0x30, 0x0a, 0x23, 0x20, 0x4d, 0x44, 0x35, + 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, + 0x3a, 0x20, 0x38, 0x39, 0x3a, 0x35, 0x33, 0x3a, 0x66, 0x31, 0x3a, 0x38, + 0x33, 0x3a, 0x32, 0x33, 0x3a, 0x62, 0x37, 0x3a, 0x37, 0x63, 0x3a, 0x38, + 0x65, 0x3a, 0x30, 0x35, 0x3a, 0x66, 0x31, 0x3a, 0x38, 0x63, 0x3a, 0x37, + 0x31, 0x3a, 0x33, 0x38, 0x3a, 0x34, 0x65, 0x3a, 0x31, 0x66, 0x3a, 0x38, + 0x38, 0x0a, 0x23, 0x20, 0x53, 0x48, 0x41, 0x31, 0x20, 0x46, 0x69, 0x6e, + 0x67, 0x65, 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x31, 0x34, + 0x3a, 0x38, 0x38, 0x3a, 0x34, 0x65, 0x3a, 0x38, 0x36, 0x3a, 0x32, 0x36, + 0x3a, 0x33, 0x37, 0x3a, 0x62, 0x30, 0x3a, 0x32, 0x36, 0x3a, 0x61, 0x66, + 0x3a, 0x35, 0x39, 0x3a, 0x36, 0x32, 0x3a, 0x35, 0x63, 0x3a, 0x34, 0x30, + 0x3a, 0x37, 0x37, 0x3a, 0x65, 0x63, 0x3a, 0x33, 0x35, 0x3a, 0x32, 0x39, + 0x3a, 0x62, 0x61, 0x3a, 0x39, 0x36, 0x3a, 0x30, 0x31, 0x0a, 0x23, 0x20, + 0x53, 0x48, 0x41, 0x32, 0x35, 0x36, 0x20, 0x46, 0x69, 0x6e, 0x67, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x3a, 0x20, 0x64, 0x62, 0x3a, 0x33, + 0x35, 0x3a, 0x31, 0x37, 0x3a, 0x64, 0x31, 0x3a, 0x66, 0x36, 0x3a, 0x37, + 0x33, 0x3a, 0x32, 0x61, 0x3a, 0x32, 0x64, 0x3a, 0x35, 0x61, 0x3a, 0x62, + 0x39, 0x3a, 0x37, 0x63, 0x3a, 0x35, 0x33, 0x3a, 0x33, 0x65, 0x3a, 0x63, + 0x37, 0x3a, 0x30, 0x37, 0x3a, 0x37, 0x39, 0x3a, 0x65, 0x65, 0x3a, 0x33, + 0x32, 0x3a, 0x37, 0x30, 0x3a, 0x61, 0x36, 0x3a, 0x32, 0x66, 0x3a, 0x62, + 0x34, 0x3a, 0x61, 0x63, 0x3a, 0x34, 0x32, 0x3a, 0x33, 0x38, 0x3a, 0x33, + 0x37, 0x3a, 0x32, 0x34, 0x3a, 0x36, 0x30, 0x3a, 0x65, 0x36, 0x3a, 0x66, + 0x30, 0x3a, 0x31, 0x65, 0x3a, 0x38, 0x38, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, + 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x4d, 0x49, 0x49, 0x47, 0x53, 0x7a, 0x43, 0x43, 0x42, 0x44, 0x4f, 0x67, + 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x52, 0x41, 0x4e, 0x6d, 0x31, + 0x51, 0x33, 0x2b, 0x76, 0x71, 0x54, 0x6b, 0x50, 0x41, 0x41, 0x41, 0x41, + 0x41, 0x46, 0x56, 0x6c, 0x72, 0x56, 0x67, 0x77, 0x44, 0x51, 0x59, 0x4a, + 0x4b, 0x6f, 0x5a, 0x49, 0x68, 0x76, 0x63, 0x4e, 0x41, 0x51, 0x45, 0x4c, + 0x42, 0x51, 0x41, 0x77, 0x0a, 0x67, 0x62, 0x34, 0x78, 0x43, 0x7a, 0x41, + 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, 0x54, 0x41, 0x6c, 0x56, + 0x54, 0x4d, 0x52, 0x59, 0x77, 0x46, 0x41, 0x59, 0x44, 0x56, 0x51, 0x51, + 0x4b, 0x45, 0x77, 0x31, 0x46, 0x62, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, + 0x30, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, 0x4d, 0x75, 0x4d, 0x53, 0x67, + 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x0a, 0x45, 0x78, + 0x39, 0x54, 0x5a, 0x57, 0x55, 0x67, 0x64, 0x33, 0x64, 0x33, 0x4c, 0x6d, + 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x75, 0x62, 0x6d, + 0x56, 0x30, 0x4c, 0x32, 0x78, 0x6c, 0x5a, 0x32, 0x46, 0x73, 0x4c, 0x58, + 0x52, 0x6c, 0x63, 0x6d, 0x31, 0x7a, 0x4d, 0x54, 0x6b, 0x77, 0x4e, 0x77, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, 0x7a, 0x41, 0x6f, 0x59, 0x79, + 0x6b, 0x67, 0x0a, 0x4d, 0x6a, 0x41, 0x78, 0x4e, 0x53, 0x42, 0x46, 0x62, + 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, 0x43, 0x42, 0x4a, 0x62, + 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, 0x5a, 0x6d, 0x39, 0x79, 0x49, + 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x36, 0x5a, + 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, 0x49, 0x47, 0x39, 0x75, 0x62, + 0x48, 0x6b, 0x78, 0x4d, 0x6a, 0x41, 0x77, 0x0a, 0x42, 0x67, 0x4e, 0x56, + 0x42, 0x41, 0x4d, 0x54, 0x4b, 0x55, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, + 0x63, 0x33, 0x51, 0x67, 0x55, 0x6d, 0x39, 0x76, 0x64, 0x43, 0x42, 0x44, + 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, 0x70, 0x59, 0x32, 0x46, 0x30, + 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, + 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x53, 0x41, 0x74, 0x49, 0x45, 0x63, 0x30, + 0x0a, 0x4d, 0x42, 0x34, 0x58, 0x44, 0x54, 0x45, 0x31, 0x4d, 0x44, 0x55, + 0x79, 0x4e, 0x7a, 0x45, 0x78, 0x4d, 0x54, 0x45, 0x78, 0x4e, 0x6c, 0x6f, + 0x58, 0x44, 0x54, 0x4d, 0x33, 0x4d, 0x54, 0x49, 0x79, 0x4e, 0x7a, 0x45, + 0x78, 0x4e, 0x44, 0x45, 0x78, 0x4e, 0x6c, 0x6f, 0x77, 0x67, 0x62, 0x34, + 0x78, 0x43, 0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x59, + 0x54, 0x41, 0x6c, 0x56, 0x54, 0x0a, 0x4d, 0x52, 0x59, 0x77, 0x46, 0x41, + 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x45, 0x77, 0x31, 0x46, 0x62, 0x6e, + 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, 0x43, 0x42, 0x4a, 0x62, 0x6d, + 0x4d, 0x75, 0x4d, 0x53, 0x67, 0x77, 0x4a, 0x67, 0x59, 0x44, 0x56, 0x51, + 0x51, 0x4c, 0x45, 0x78, 0x39, 0x54, 0x5a, 0x57, 0x55, 0x67, 0x64, 0x33, + 0x64, 0x33, 0x4c, 0x6d, 0x56, 0x75, 0x64, 0x48, 0x4a, 0x31, 0x0a, 0x63, + 0x33, 0x51, 0x75, 0x62, 0x6d, 0x56, 0x30, 0x4c, 0x32, 0x78, 0x6c, 0x5a, + 0x32, 0x46, 0x73, 0x4c, 0x58, 0x52, 0x6c, 0x63, 0x6d, 0x31, 0x7a, 0x4d, + 0x54, 0x6b, 0x77, 0x4e, 0x77, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4c, 0x45, + 0x7a, 0x41, 0x6f, 0x59, 0x79, 0x6b, 0x67, 0x4d, 0x6a, 0x41, 0x78, 0x4e, + 0x53, 0x42, 0x46, 0x62, 0x6e, 0x52, 0x79, 0x64, 0x58, 0x4e, 0x30, 0x4c, + 0x43, 0x42, 0x4a, 0x0a, 0x62, 0x6d, 0x4d, 0x75, 0x49, 0x43, 0x30, 0x67, + 0x5a, 0x6d, 0x39, 0x79, 0x49, 0x47, 0x46, 0x31, 0x64, 0x47, 0x68, 0x76, + 0x63, 0x6d, 0x6c, 0x36, 0x5a, 0x57, 0x51, 0x67, 0x64, 0x58, 0x4e, 0x6c, + 0x49, 0x47, 0x39, 0x75, 0x62, 0x48, 0x6b, 0x78, 0x4d, 0x6a, 0x41, 0x77, + 0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x4d, 0x54, 0x4b, 0x55, 0x56, 0x75, + 0x64, 0x48, 0x4a, 0x31, 0x63, 0x33, 0x51, 0x67, 0x0a, 0x55, 0x6d, 0x39, + 0x76, 0x64, 0x43, 0x42, 0x44, 0x5a, 0x58, 0x4a, 0x30, 0x61, 0x57, 0x5a, + 0x70, 0x59, 0x32, 0x46, 0x30, 0x61, 0x57, 0x39, 0x75, 0x49, 0x45, 0x46, + 0x31, 0x64, 0x47, 0x68, 0x76, 0x63, 0x6d, 0x6c, 0x30, 0x65, 0x53, 0x41, + 0x74, 0x49, 0x45, 0x63, 0x30, 0x4d, 0x49, 0x49, 0x43, 0x49, 0x6a, 0x41, + 0x4e, 0x42, 0x67, 0x6b, 0x71, 0x68, 0x6b, 0x69, 0x47, 0x39, 0x77, 0x30, + 0x42, 0x0a, 0x41, 0x51, 0x45, 0x46, 0x41, 0x41, 0x4f, 0x43, 0x41, 0x67, + 0x38, 0x41, 0x4d, 0x49, 0x49, 0x43, 0x43, 0x67, 0x4b, 0x43, 0x41, 0x67, + 0x45, 0x41, 0x73, 0x65, 0x77, 0x73, 0x51, 0x75, 0x37, 0x69, 0x30, 0x54, + 0x44, 0x2f, 0x70, 0x5a, 0x4a, 0x48, 0x34, 0x69, 0x33, 0x44, 0x75, 0x6d, + 0x53, 0x58, 0x62, 0x63, 0x72, 0x33, 0x44, 0x62, 0x56, 0x5a, 0x77, 0x62, + 0x50, 0x4c, 0x71, 0x47, 0x67, 0x5a, 0x0a, 0x32, 0x4b, 0x2b, 0x45, 0x62, + 0x54, 0x42, 0x77, 0x58, 0x58, 0x37, 0x7a, 0x4c, 0x74, 0x4a, 0x54, 0x6d, + 0x65, 0x48, 0x2b, 0x48, 0x31, 0x37, 0x5a, 0x53, 0x4b, 0x39, 0x64, 0x45, + 0x34, 0x33, 0x62, 0x2f, 0x32, 0x4d, 0x7a, 0x54, 0x64, 0x4d, 0x41, 0x41, + 0x72, 0x7a, 0x45, 0x2b, 0x4e, 0x45, 0x47, 0x43, 0x4a, 0x52, 0x35, 0x57, + 0x49, 0x6f, 0x56, 0x33, 0x69, 0x6d, 0x7a, 0x2f, 0x66, 0x33, 0x45, 0x0a, + 0x54, 0x2b, 0x69, 0x71, 0x34, 0x71, 0x41, 0x37, 0x65, 0x63, 0x32, 0x2f, + 0x61, 0x30, 0x4d, 0x79, 0x33, 0x64, 0x6c, 0x30, 0x45, 0x4c, 0x6e, 0x33, + 0x39, 0x47, 0x6a, 0x55, 0x75, 0x39, 0x43, 0x48, 0x31, 0x61, 0x70, 0x4c, + 0x69, 0x69, 0x70, 0x76, 0x4b, 0x67, 0x53, 0x31, 0x73, 0x71, 0x62, 0x48, + 0x6f, 0x48, 0x72, 0x6d, 0x53, 0x4b, 0x76, 0x53, 0x30, 0x56, 0x6e, 0x4d, + 0x31, 0x6e, 0x34, 0x6a, 0x0a, 0x35, 0x70, 0x64, 0x73, 0x38, 0x45, 0x4c, + 0x6c, 0x33, 0x46, 0x46, 0x4c, 0x46, 0x55, 0x48, 0x74, 0x53, 0x55, 0x72, + 0x4a, 0x33, 0x68, 0x43, 0x58, 0x31, 0x6e, 0x62, 0x42, 0x37, 0x36, 0x57, + 0x31, 0x4e, 0x68, 0x53, 0x58, 0x4e, 0x64, 0x68, 0x34, 0x49, 0x6a, 0x56, + 0x53, 0x37, 0x30, 0x4f, 0x39, 0x32, 0x79, 0x66, 0x62, 0x59, 0x56, 0x61, + 0x43, 0x4e, 0x4e, 0x7a, 0x4c, 0x69, 0x47, 0x41, 0x4d, 0x0a, 0x43, 0x31, + 0x72, 0x6c, 0x4c, 0x41, 0x48, 0x47, 0x56, 0x4b, 0x2f, 0x58, 0x71, 0x73, + 0x45, 0x51, 0x65, 0x39, 0x49, 0x46, 0x57, 0x72, 0x68, 0x41, 0x6e, 0x6f, + 0x61, 0x6e, 0x77, 0x35, 0x43, 0x47, 0x41, 0x6c, 0x5a, 0x53, 0x43, 0x58, + 0x71, 0x63, 0x30, 0x69, 0x65, 0x43, 0x55, 0x30, 0x70, 0x6c, 0x55, 0x6d, + 0x72, 0x31, 0x50, 0x4f, 0x65, 0x6f, 0x38, 0x70, 0x79, 0x76, 0x69, 0x37, + 0x33, 0x54, 0x0a, 0x44, 0x74, 0x54, 0x55, 0x58, 0x6d, 0x36, 0x48, 0x6e, + 0x6d, 0x6f, 0x39, 0x52, 0x52, 0x33, 0x52, 0x58, 0x52, 0x76, 0x30, 0x36, + 0x51, 0x71, 0x73, 0x59, 0x4a, 0x6e, 0x37, 0x69, 0x62, 0x54, 0x2f, 0x6d, + 0x43, 0x7a, 0x50, 0x66, 0x42, 0x33, 0x70, 0x41, 0x71, 0x6f, 0x45, 0x6d, + 0x68, 0x36, 0x34, 0x33, 0x49, 0x68, 0x75, 0x4a, 0x62, 0x4e, 0x73, 0x5a, + 0x76, 0x63, 0x38, 0x6b, 0x50, 0x4e, 0x58, 0x0a, 0x77, 0x62, 0x4d, 0x76, + 0x39, 0x57, 0x33, 0x79, 0x2b, 0x38, 0x71, 0x68, 0x2b, 0x43, 0x6d, 0x64, + 0x52, 0x6f, 0x75, 0x7a, 0x61, 0x76, 0x62, 0x6d, 0x5a, 0x77, 0x65, 0x2b, + 0x4c, 0x47, 0x63, 0x4b, 0x4b, 0x68, 0x39, 0x61, 0x73, 0x6a, 0x35, 0x58, + 0x78, 0x4e, 0x4d, 0x68, 0x49, 0x57, 0x4e, 0x6c, 0x55, 0x70, 0x45, 0x62, + 0x73, 0x5a, 0x6d, 0x4f, 0x65, 0x58, 0x37, 0x6d, 0x36, 0x34, 0x30, 0x41, + 0x0a, 0x32, 0x56, 0x71, 0x71, 0x36, 0x6e, 0x50, 0x6f, 0x70, 0x49, 0x49, + 0x43, 0x52, 0x35, 0x62, 0x2b, 0x57, 0x34, 0x35, 0x55, 0x59, 0x61, 0x50, + 0x72, 0x4c, 0x30, 0x73, 0x77, 0x73, 0x49, 0x73, 0x6a, 0x64, 0x58, 0x4a, + 0x38, 0x49, 0x54, 0x7a, 0x49, 0x39, 0x76, 0x46, 0x30, 0x31, 0x42, 0x78, + 0x37, 0x6f, 0x77, 0x56, 0x56, 0x37, 0x72, 0x74, 0x4e, 0x4f, 0x7a, 0x4b, + 0x2b, 0x6d, 0x6e, 0x64, 0x6d, 0x0a, 0x6e, 0x71, 0x78, 0x70, 0x6b, 0x43, + 0x49, 0x48, 0x48, 0x32, 0x45, 0x36, 0x6c, 0x72, 0x37, 0x6c, 0x6d, 0x6b, + 0x2f, 0x4d, 0x42, 0x54, 0x77, 0x6f, 0x57, 0x64, 0x50, 0x42, 0x44, 0x46, + 0x53, 0x6f, 0x57, 0x57, 0x47, 0x39, 0x79, 0x48, 0x4a, 0x4d, 0x36, 0x4e, + 0x79, 0x66, 0x68, 0x33, 0x2b, 0x39, 0x6e, 0x45, 0x67, 0x32, 0x58, 0x70, + 0x57, 0x6a, 0x44, 0x72, 0x6b, 0x34, 0x4a, 0x46, 0x58, 0x38, 0x0a, 0x64, + 0x57, 0x62, 0x72, 0x41, 0x75, 0x4d, 0x49, 0x4e, 0x43, 0x6c, 0x4b, 0x78, + 0x75, 0x4d, 0x72, 0x4c, 0x7a, 0x4f, 0x67, 0x32, 0x71, 0x4f, 0x47, 0x70, + 0x52, 0x4b, 0x58, 0x2f, 0x59, 0x41, 0x72, 0x32, 0x68, 0x52, 0x43, 0x34, + 0x35, 0x4b, 0x39, 0x50, 0x76, 0x4a, 0x64, 0x58, 0x6d, 0x64, 0x30, 0x4c, + 0x68, 0x79, 0x49, 0x52, 0x79, 0x6b, 0x30, 0x58, 0x2b, 0x49, 0x79, 0x71, + 0x4a, 0x77, 0x6c, 0x0a, 0x4e, 0x34, 0x79, 0x36, 0x6d, 0x41, 0x43, 0x58, + 0x69, 0x30, 0x6d, 0x57, 0x48, 0x76, 0x30, 0x6c, 0x69, 0x71, 0x7a, 0x63, + 0x32, 0x74, 0x68, 0x64, 0x64, 0x47, 0x35, 0x6d, 0x73, 0x50, 0x39, 0x45, + 0x33, 0x36, 0x45, 0x59, 0x78, 0x72, 0x35, 0x49, 0x4c, 0x7a, 0x65, 0x55, + 0x65, 0x50, 0x69, 0x56, 0x53, 0x6a, 0x39, 0x2f, 0x45, 0x31, 0x35, 0x64, + 0x57, 0x66, 0x31, 0x30, 0x68, 0x6b, 0x4e, 0x6a, 0x0a, 0x63, 0x30, 0x6b, + 0x43, 0x41, 0x77, 0x45, 0x41, 0x41, 0x61, 0x4e, 0x43, 0x4d, 0x45, 0x41, + 0x77, 0x44, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54, 0x41, 0x51, 0x48, + 0x2f, 0x42, 0x41, 0x55, 0x77, 0x41, 0x77, 0x45, 0x42, 0x2f, 0x7a, 0x41, + 0x4f, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x51, 0x38, 0x42, 0x41, 0x66, 0x38, + 0x45, 0x42, 0x41, 0x4d, 0x43, 0x41, 0x51, 0x59, 0x77, 0x48, 0x51, 0x59, + 0x44, 0x0a, 0x56, 0x52, 0x30, 0x4f, 0x42, 0x42, 0x59, 0x45, 0x46, 0x4a, + 0x38, 0x34, 0x78, 0x46, 0x59, 0x6a, 0x77, 0x7a, 0x6e, 0x6f, 0x6f, 0x48, + 0x46, 0x73, 0x36, 0x46, 0x52, 0x4d, 0x35, 0x4f, 0x67, 0x36, 0x73, 0x62, + 0x39, 0x6e, 0x4d, 0x41, 0x30, 0x47, 0x43, 0x53, 0x71, 0x47, 0x53, 0x49, + 0x62, 0x33, 0x44, 0x51, 0x45, 0x42, 0x43, 0x77, 0x55, 0x41, 0x41, 0x34, + 0x49, 0x43, 0x41, 0x51, 0x41, 0x53, 0x0a, 0x35, 0x55, 0x4b, 0x6d, 0x65, + 0x34, 0x73, 0x50, 0x44, 0x4f, 0x52, 0x47, 0x70, 0x62, 0x5a, 0x67, 0x51, + 0x49, 0x65, 0x4d, 0x4a, 0x58, 0x36, 0x74, 0x75, 0x47, 0x67, 0x75, 0x57, + 0x38, 0x5a, 0x41, 0x64, 0x6a, 0x77, 0x44, 0x2b, 0x4d, 0x6c, 0x5a, 0x39, + 0x50, 0x4f, 0x72, 0x59, 0x73, 0x34, 0x51, 0x6a, 0x62, 0x52, 0x61, 0x5a, + 0x49, 0x78, 0x6f, 0x77, 0x4c, 0x42, 0x79, 0x51, 0x7a, 0x54, 0x53, 0x0a, + 0x47, 0x77, 0x76, 0x32, 0x4c, 0x46, 0x50, 0x53, 0x79, 0x70, 0x42, 0x4c, + 0x68, 0x6d, 0x62, 0x38, 0x71, 0x6f, 0x4d, 0x69, 0x39, 0x49, 0x73, 0x61, + 0x62, 0x79, 0x5a, 0x49, 0x72, 0x48, 0x5a, 0x33, 0x43, 0x4c, 0x2f, 0x46, + 0x6d, 0x46, 0x7a, 0x30, 0x4a, 0x6f, 0x6d, 0x65, 0x65, 0x38, 0x4f, 0x35, + 0x5a, 0x44, 0x49, 0x42, 0x66, 0x39, 0x50, 0x44, 0x33, 0x56, 0x68, 0x74, + 0x37, 0x4c, 0x47, 0x72, 0x0a, 0x68, 0x46, 0x56, 0x30, 0x64, 0x34, 0x51, + 0x45, 0x4a, 0x31, 0x4a, 0x72, 0x68, 0x6b, 0x7a, 0x4f, 0x33, 0x62, 0x6c, + 0x6c, 0x2f, 0x39, 0x62, 0x47, 0x58, 0x70, 0x2b, 0x61, 0x45, 0x4a, 0x6c, + 0x4c, 0x64, 0x57, 0x72, 0x2b, 0x61, 0x75, 0x6d, 0x58, 0x49, 0x4f, 0x54, + 0x6b, 0x64, 0x6e, 0x72, 0x47, 0x30, 0x43, 0x53, 0x71, 0x6b, 0x4d, 0x30, + 0x67, 0x6b, 0x4c, 0x70, 0x48, 0x5a, 0x50, 0x74, 0x2f, 0x0a, 0x42, 0x37, + 0x4e, 0x54, 0x65, 0x4c, 0x55, 0x4b, 0x59, 0x76, 0x4a, 0x7a, 0x51, 0x38, + 0x35, 0x42, 0x4b, 0x34, 0x46, 0x71, 0x4c, 0x6f, 0x55, 0x57, 0x6c, 0x46, + 0x50, 0x55, 0x61, 0x31, 0x39, 0x79, 0x49, 0x71, 0x74, 0x52, 0x4c, 0x55, + 0x4c, 0x56, 0x41, 0x4a, 0x79, 0x5a, 0x76, 0x39, 0x36, 0x37, 0x6c, 0x44, + 0x74, 0x58, 0x2f, 0x5a, 0x72, 0x31, 0x68, 0x73, 0x74, 0x57, 0x4f, 0x31, + 0x75, 0x49, 0x0a, 0x41, 0x65, 0x56, 0x38, 0x4b, 0x45, 0x73, 0x44, 0x2b, + 0x55, 0x6d, 0x44, 0x66, 0x4c, 0x4a, 0x2f, 0x66, 0x4f, 0x50, 0x74, 0x6a, + 0x71, 0x46, 0x2f, 0x59, 0x46, 0x4f, 0x4f, 0x56, 0x5a, 0x31, 0x51, 0x4e, + 0x42, 0x49, 0x50, 0x74, 0x35, 0x64, 0x37, 0x62, 0x49, 0x64, 0x4b, 0x52, + 0x4f, 0x66, 0x31, 0x62, 0x65, 0x79, 0x41, 0x4e, 0x2f, 0x42, 0x59, 0x47, + 0x57, 0x35, 0x4b, 0x61, 0x48, 0x62, 0x77, 0x0a, 0x48, 0x35, 0x4c, 0x6b, + 0x36, 0x72, 0x57, 0x53, 0x30, 0x32, 0x46, 0x52, 0x45, 0x41, 0x75, 0x74, + 0x70, 0x39, 0x6c, 0x66, 0x78, 0x31, 0x2f, 0x63, 0x48, 0x36, 0x4e, 0x63, + 0x6a, 0x4b, 0x46, 0x2b, 0x6d, 0x37, 0x65, 0x65, 0x30, 0x31, 0x5a, 0x76, + 0x5a, 0x6c, 0x34, 0x48, 0x6c, 0x69, 0x44, 0x74, 0x43, 0x33, 0x54, 0x37, + 0x5a, 0x6b, 0x36, 0x4c, 0x45, 0x52, 0x58, 0x70, 0x67, 0x55, 0x6c, 0x2b, + 0x0a, 0x62, 0x37, 0x44, 0x55, 0x55, 0x48, 0x38, 0x69, 0x31, 0x31, 0x39, + 0x6c, 0x41, 0x67, 0x32, 0x6d, 0x39, 0x49, 0x55, 0x65, 0x32, 0x4b, 0x34, + 0x47, 0x53, 0x30, 0x71, 0x6e, 0x30, 0x6a, 0x46, 0x6d, 0x77, 0x76, 0x6a, + 0x4f, 0x35, 0x51, 0x69, 0x6d, 0x70, 0x41, 0x4b, 0x57, 0x52, 0x47, 0x68, + 0x58, 0x78, 0x4e, 0x55, 0x7a, 0x7a, 0x78, 0x6b, 0x76, 0x46, 0x4d, 0x53, + 0x55, 0x48, 0x48, 0x75, 0x6b, 0x0a, 0x32, 0x66, 0x43, 0x66, 0x44, 0x72, + 0x47, 0x41, 0x34, 0x74, 0x47, 0x65, 0x45, 0x57, 0x53, 0x70, 0x69, 0x42, + 0x45, 0x36, 0x64, 0x6f, 0x4c, 0x6c, 0x59, 0x73, 0x4b, 0x41, 0x32, 0x4b, + 0x53, 0x44, 0x37, 0x5a, 0x50, 0x76, 0x66, 0x43, 0x2b, 0x51, 0x73, 0x44, + 0x4a, 0x4d, 0x6c, 0x68, 0x56, 0x6f, 0x53, 0x46, 0x4c, 0x55, 0x6d, 0x51, + 0x6a, 0x41, 0x4a, 0x4f, 0x67, 0x63, 0x34, 0x37, 0x4f, 0x6c, 0x0a, 0x49, + 0x51, 0x36, 0x53, 0x77, 0x4a, 0x41, 0x66, 0x7a, 0x79, 0x42, 0x66, 0x79, + 0x6a, 0x73, 0x34, 0x78, 0x37, 0x64, 0x74, 0x4f, 0x76, 0x50, 0x6d, 0x52, + 0x4c, 0x67, 0x4f, 0x4d, 0x57, 0x75, 0x49, 0x6a, 0x6e, 0x44, 0x72, 0x6e, + 0x42, 0x64, 0x53, 0x71, 0x45, 0x47, 0x55, 0x4c, 0x6f, 0x65, 0x32, 0x35, + 0x36, 0x59, 0x53, 0x78, 0x58, 0x58, 0x66, 0x57, 0x38, 0x41, 0x4b, 0x62, + 0x6e, 0x75, 0x6b, 0x0a, 0x35, 0x46, 0x36, 0x47, 0x2b, 0x54, 0x61, 0x55, + 0x33, 0x33, 0x66, 0x44, 0x36, 0x51, 0x33, 0x41, 0x4f, 0x66, 0x46, 0x35, + 0x75, 0x30, 0x61, 0x4f, 0x71, 0x30, 0x4e, 0x5a, 0x4a, 0x37, 0x63, 0x67, + 0x75, 0x79, 0x50, 0x70, 0x56, 0x6b, 0x41, 0x68, 0x37, 0x44, 0x45, 0x39, + 0x5a, 0x61, 0x70, 0x44, 0x38, 0x6a, 0x33, 0x66, 0x63, 0x45, 0x54, 0x68, + 0x75, 0x6b, 0x30, 0x6d, 0x45, 0x44, 0x75, 0x59, 0x0a, 0x6e, 0x2f, 0x50, + 0x49, 0x6a, 0x68, 0x73, 0x34, 0x56, 0x69, 0x46, 0x71, 0x55, 0x5a, 0x50, + 0x54, 0x6b, 0x63, 0x70, 0x47, 0x32, 0x6f, 0x6d, 0x33, 0x50, 0x56, 0x4f, + 0x44, 0x4c, 0x41, 0x67, 0x66, 0x69, 0x34, 0x39, 0x54, 0x33, 0x66, 0x2b, + 0x73, 0x48, 0x77, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, + 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, + 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, + 0x00 // Extra \0 to make it a C string +}; + +const size_t grpc_root_certificates_generated_size = + sizeof(grpc_root_certificates_generated_data) - 1; + +const char roots_filename[] = "roots.pem"; + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.h new file mode 100644 index 000000000..11fbe7ead --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_root_certificates_generated.h @@ -0,0 +1,20 @@ +// Copyright 2019 Google Inc. All Rights Reserved. + +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATES_GENERATED_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATES_GENERATED_H_ + +#include + +namespace firebase { +namespace firestore { +namespace remote { + +extern const size_t grpc_root_certificates_generated_size; +extern const unsigned char grpc_root_certificates_generated_data[]; +extern const char roots_filename[]; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_ROOT_CERTIFICATES_GENERATED_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.cc index 85c4ebec5..e87f28110 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.cc @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,16 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream.h" +#include "Firestore/core/src/remote/grpc_stream.h" #include // NOLINT(build/c++11) #include // NOLINT(build/c++11) -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_util.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/grpc_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" namespace firebase { namespace firestore { @@ -70,7 +71,7 @@ absl::optional BufferedWriter::TryStartWrite() { has_active_write_ = true; BufferedWrite message = std::move(queue_.front()); queue_.pop(); - return std::move(message); + return {std::move(message)}; } absl::optional BufferedWriter::DequeueNextWrite() { @@ -128,11 +129,11 @@ void GrpcStream::Read() { return; } - GrpcCompletion* completion = - NewCompletion(Type::Read, [this](const GrpcCompletion* completion) { + auto completion = NewCompletion( + Type::Read, [this](const std::shared_ptr& completion) { OnRead(*completion->message()); }); - call_->Read(completion->message(), completion); + call_->Read(completion->message(), completion.get()); } void GrpcStream::Write(grpc::ByteBuffer&& message) { @@ -151,11 +152,12 @@ void GrpcStream::MaybeWrite(absl::optional maybe_write) { } BufferedWrite write = std::move(maybe_write).value(); - GrpcCompletion* completion = - NewCompletion(Type::Write, [this](const GrpcCompletion*) { OnWrite(); }); + auto completion = NewCompletion( + Type::Write, + [this](const std::shared_ptr&) { OnWrite(); }); *completion->message() = write.message; - call_->Write(*completion->message(), write.options, completion); + call_->Write(*completion->message(), write.options, completion.get()); } void GrpcStream::FinishImmediately() { @@ -191,7 +193,7 @@ void GrpcStream::Shutdown() { if (!completions_.empty() && !is_grpc_call_finished_) { // Important: during normal operation, the stream always has a pending read // operation, so `Shutdown` would hang indefinitely if we didn't cancel the - // `context_`. However, if the stream has already failed, avoid canceling + // `context_`. However, if the stream has already failed, avoid cancelling // the context to avoid overwriting the status captured during the // `OnOperationFailed`. @@ -223,8 +225,8 @@ void GrpcStream::FinishGrpcCall(const OnSuccess& callback) { // All completions issued by this call must be taken off the queue before // finish operation can be enqueued. FastFinishCompletionsBlocking(); - GrpcCompletion* completion = NewCompletion(Type::Finish, callback); - call_->Finish(completion->status(), completion); + auto completion = NewCompletion(Type::Finish, callback); + call_->Finish(completion->status(), completion.get()); } void GrpcStream::FastFinishCompletionsBlocking() { @@ -234,16 +236,19 @@ void GrpcStream::FastFinishCompletionsBlocking() { // TODO(varconst): reset buffered_writer_? Should not be necessary, because it // should never be called again after a call to Finish. - for (auto completion : completions_) { + for (const auto& completion : completions_) { // `GrpcStream` cannot actually remove any of the completions that already // have been enqueued on the worker queue, so instead turn them into no-ops. completion->Cancel(); } - for (auto completion : completions_) { + for (const auto& completion : completions_) { // This is blocking. completion->WaitUntilOffQueue(); } + + // This will release all the shared pointers to GrpcCompletion, leaving it + // up to gRPC to actually call Complete and trigger deletion. completions_.clear(); } @@ -265,15 +270,16 @@ bool GrpcStream::TryLastWrite(grpc::ByteBuffer&& message) { } BufferedWrite last_write = std::move(maybe_write).value(); - GrpcCompletion* completion = NewCompletion(Type::Write, {}); + auto completion = NewCompletion(Type::Write, {}); *completion->message() = last_write.message; - call_->WriteLast(*completion->message(), grpc::WriteOptions{}, completion); + call_->WriteLast(*completion->message(), grpc::WriteOptions{}, + completion.get()); // Empirically, the write normally takes less than a millisecond to finish // (both with and without network connection), and never more than several // dozen milliseconds. Nevertheless, ensure `WriteAndFinish` doesn't hang if // there happen to be circumstances under which the write may block - // indefinitely (in that case, rely on the fact that canceling a gRPC call + // indefinitely (in that case, rely on the fact that cancelling a gRPC call // makes all pending operations come back from the queue quickly). auto status = completion->WaitUntilOffQueue(std::chrono::milliseconds(500)); @@ -311,23 +317,25 @@ void GrpcStream::OnOperationFailed() { return; } - FinishGrpcCall([this](const GrpcCompletion* completion) { + FinishGrpcCall([this](const std::shared_ptr& completion) { Status status = ConvertStatus(*completion->status()); FinishAndNotify(status); }); } -void GrpcStream::RemoveCompletion(const GrpcCompletion* to_remove) { +void GrpcStream::RemoveCompletion( + const std::shared_ptr& to_remove) { auto found = std::find(completions_.begin(), completions_.end(), to_remove); HARD_ASSERT(found != completions_.end(), "Missing GrpcCompletion"); completions_.erase(found); } -GrpcCompletion* GrpcStream::NewCompletion(Type tag, - const OnSuccess& on_success) { +std::shared_ptr GrpcStream::NewCompletion( + Type tag, const OnSuccess& on_success) { // Can't move into lambda until C++14. GrpcCompletion::Callback decorated = - [this, on_success](bool ok, const GrpcCompletion* completion) { + [this, on_success](bool ok, + const std::shared_ptr& completion) { RemoveCompletion(completion); if (ok) { @@ -344,8 +352,8 @@ GrpcCompletion* GrpcStream::NewCompletion(Type tag, }; // For lifetime details, see `GrpcCompletion` class comment. - auto* completion = - new GrpcCompletion{tag, worker_queue_, std::move(decorated)}; + auto completion = + GrpcCompletion::Create(tag, worker_queue_, std::move(decorated)); completions_.push_back(completion); return completion; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.h similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.h index 9f7d251ce..b4f04c6e1 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAM_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_H_ #include #include @@ -25,19 +25,19 @@ #include #include -#include "Firestore/core/src/firebase/firestore/util/warnings.h" - -#include "Firestore/core/src/firebase/firestore/remote/grpc_call.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_completion.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream_observer.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/remote/grpc_call.h" +#include "Firestore/core/src/remote/grpc_completion.h" +#include "Firestore/core/src/remote/grpc_stream_observer.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "Firestore/core/src/util/warnings.h" #include "absl/types/optional.h" #include "grpcpp/client_context.h" +#include "grpcpp/support/byte_buffer.h" + SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() #include "grpcpp/generic/generic_stub.h" SUPPRESS_END() -#include "grpcpp/support/byte_buffer.h" namespace firebase { namespace firestore { @@ -127,7 +127,7 @@ class GrpcStream : public GrpcCall { const std::shared_ptr& worker_queue, GrpcConnection* grpc_connection, GrpcStreamObserver* observer); - ~GrpcStream(); + ~GrpcStream() override; void Start(); @@ -196,11 +196,11 @@ class GrpcStream : public GrpcCall { void OnRead(const grpc::ByteBuffer& message); void OnWrite(); void OnOperationFailed(); - void RemoveCompletion(const GrpcCompletion* to_remove); + void RemoveCompletion(const std::shared_ptr& to_remove); - using OnSuccess = std::function; - GrpcCompletion* NewCompletion(GrpcCompletion::Type type, - const OnSuccess& callback); + using OnSuccess = std::function&)>; + std::shared_ptr NewCompletion(GrpcCompletion::Type type, + const OnSuccess& callback); // Finishes the underlying gRPC call. Must always be invoked on any call that // was started. Presumes that any pending completions will quickly come off // the queue and will block until they do, so this must only be invoked when @@ -235,7 +235,7 @@ class GrpcStream : public GrpcCall { GrpcStreamObserver* observer_ = nullptr; internal::BufferedWriter buffered_writer_; - std::vector completions_; + std::vector> completions_; // gRPC asserts that a call is finished exactly once. bool is_grpc_call_finished_ = false; @@ -245,4 +245,4 @@ class GrpcStream : public GrpcCall { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAM_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream_observer.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream_observer.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream_observer.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream_observer.h index 52981206c..b9283e14e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_stream_observer.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_stream_observer.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAM_OBSERVER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAM_OBSERVER_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_OBSERVER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_OBSERVER_H_ -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/util/status_fwd.h" #include "grpcpp/support/byte_buffer.h" namespace firebase { @@ -27,8 +27,7 @@ namespace remote { /** Observer that gets notified of events on a gRPC stream. */ class GrpcStreamObserver { public: - virtual ~GrpcStreamObserver() { - } + virtual ~GrpcStreamObserver() = default; // Stream has been successfully established. virtual void OnStreamStart() = 0; @@ -42,4 +41,4 @@ class GrpcStreamObserver { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAM_OBSERVER_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAM_OBSERVER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.cc similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.cc index 5551143ff..c6e042a31 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.cc @@ -14,14 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.h" +#include "Firestore/core/src/remote/grpc_streaming_reader.h" #include -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/memory/memory.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.h index ca662576d..f6774fdbc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_streaming_reader.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_streaming_reader.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,24 +14,24 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAMING_READER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAMING_READER_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAMING_READER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAMING_READER_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/util/warnings.h" - -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream_observer.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/remote/grpc_stream.h" +#include "Firestore/core/src/remote/grpc_stream_observer.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "Firestore/core/src/util/warnings.h" #include "grpcpp/client_context.h" +#include "grpcpp/support/byte_buffer.h" + SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() #include "grpcpp/generic/generic_stub.h" SUPPRESS_END() -#include "grpcpp/support/byte_buffer.h" namespace firebase { namespace firestore { @@ -107,4 +107,4 @@ class GrpcStreamingReader : public GrpcCall, public GrpcStreamObserver { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_STREAMING_READER_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_STREAMING_READER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_unary_call.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.cc similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_unary_call.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.cc index 15d5c73fd..007211e78 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_unary_call.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.cc @@ -14,13 +14,14 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/grpc_unary_call.h" +#include "Firestore/core/src/remote/grpc_unary_call.h" #include -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_util.h" -#include "Firestore/core/src/firebase/firestore/util/statusor.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/grpc_util.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/statusor.h" namespace firebase { namespace firestore { @@ -55,11 +56,12 @@ void GrpcUnaryCall::Start(Callback&& callback) { call_->StartCall(); // For lifetime details, see `GrpcCompletion` class comment. - finish_completion_ = new GrpcCompletion( + finish_completion_ = GrpcCompletion::Create( Type::Finish, worker_queue_, - [this](bool /*ignored_ok*/, const GrpcCompletion* completion) { + [this](bool /*ignored_ok*/, + const std::shared_ptr& completion) { // Ignoring ok, status should contain all the relevant information. - finish_completion_ = nullptr; + finish_completion_.reset(); Shutdown(); auto callback = std::move(callback_); @@ -73,7 +75,7 @@ void GrpcUnaryCall::Start(Callback&& callback) { }); call_->Finish(finish_completion_->message(), finish_completion_->status(), - finish_completion_); + finish_completion_.get()); } void GrpcUnaryCall::FinishImmediately() { @@ -99,7 +101,7 @@ void GrpcUnaryCall::Shutdown() { finish_completion_->Cancel(); // This function blocks. finish_completion_->WaitUntilOffQueue(); - finish_completion_ = nullptr; + finish_completion_.reset(); } void GrpcUnaryCall::MaybeUnregister() { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_unary_call.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.h similarity index 83% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_unary_call.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.h index 751d66f3f..b36693582 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_unary_call.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_unary_call.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,24 +14,24 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_UNARY_CALL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_UNARY_CALL_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_UNARY_CALL_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_UNARY_CALL_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/util/warnings.h" - -#include "Firestore/core/src/firebase/firestore/remote/grpc_call.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_completion.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/remote/grpc_call.h" +#include "Firestore/core/src/remote/grpc_completion.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "Firestore/core/src/util/warnings.h" #include "grpcpp/client_context.h" +#include "grpcpp/support/byte_buffer.h" + SUPPRESS_DOCUMENTATION_WARNINGS_BEGIN() #include "grpcpp/generic/generic_stub.h" SUPPRESS_END() -#include "grpcpp/support/byte_buffer.h" namespace firebase { namespace firestore { @@ -102,7 +102,7 @@ class GrpcUnaryCall : public GrpcCall { std::shared_ptr worker_queue_; GrpcConnection* grpc_connection_ = nullptr; - GrpcCompletion* finish_completion_ = nullptr; + std::shared_ptr finish_completion_; Callback callback_; }; @@ -110,4 +110,4 @@ class GrpcUnaryCall : public GrpcCall { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_UNARY_CALL_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_UNARY_CALL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_util.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.cc similarity index 78% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_util.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.cc index a5f88f1e7..61ce12330 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_util.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/grpc_util.h" +#include "Firestore/core/src/remote/grpc_util.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" namespace firebase { namespace firestore { @@ -36,9 +36,9 @@ Status ConvertStatus(const grpc::Status& from) { // conversion should be safe. // See // https://github.com/googleapis/googleapis/blob/master/google/rpc/code.proto - HARD_ASSERT( - error_code >= grpc::CANCELLED && error_code <= grpc::UNAUTHENTICATED, - "Unknown gRPC error code: %s", error_code); + HARD_ASSERT(error_code >= grpc::StatusCode::CANCELLED && + error_code <= grpc::StatusCode::UNAUTHENTICATED, + "Unknown gRPC error code: %s", error_code); return {static_cast(error_code), from.error_message()}; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_util.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.h similarity index 75% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_util.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.h index 2cba6e395..080436120 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/grpc_util.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/grpc_util.h @@ -14,10 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_UTIL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_UTIL_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_ +#define FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_ -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/util/status_fwd.h" #include "grpcpp/support/status.h" namespace firebase { @@ -30,4 +30,4 @@ util::Status ConvertStatus(const grpc::Status& from); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_GRPC_UTIL_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_GRPC_UTIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/online_state_tracker.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/online_state_tracker.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.cc index 36e083b68..a4ad2bf8f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/online_state_tracker.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.cc @@ -14,15 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/online_state_tracker.h" +#include "Firestore/core/src/remote/online_state_tracker.h" #include // NOLINT(build/c++11) -#include "Firestore/core/src/firebase/firestore/util/executor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/log.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" +#include "Firestore/core/src/util/executor.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/string_format.h" namespace chr = std::chrono; using firebase::firestore::model::OnlineState; diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/online_state_tracker.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/online_state_tracker.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.h index 601a08266..297f0ea11 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/online_state_tracker.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/online_state_tracker.h @@ -14,17 +14,17 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_ONLINE_STATE_TRACKER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_ONLINE_STATE_TRACKER_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_ONLINE_STATE_TRACKER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_ONLINE_STATE_TRACKER_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" namespace firebase { namespace firestore { @@ -39,7 +39,7 @@ namespace remote { * up to `kMaxWatchStreamFailures` within `kOnlineStateTimeout` for a connection * to succeed. If we have too many failures or the timeout elapses, then we set * the `OnlineState` to `Offline`, and the client will behave as if it is - * offline (`getDocument()` calls will return cached data, etc.). + * offline (`GetDocument()` calls will return cached data, etc.). */ class OnlineStateTracker { public: @@ -57,7 +57,7 @@ class OnlineStateTracker { * each backoff attempt). * * If this is the first attempt, it sets the `OnlineState` to `Unknown` and - * starts the `onlineStateTimer`. + * starts the `online_state_timer_`. */ void HandleWatchStreamStart(); @@ -123,4 +123,4 @@ class OnlineStateTracker { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_ONLINE_STATE_TRACKER_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_ONLINE_STATE_TRACKER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_event.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.cc similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_event.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.cc index 93fb78763..6d730d4ef 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_event.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.cc @@ -14,21 +14,21 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/remote_event.h" +#include "Firestore/core/src/remote/remote_event.h" #include -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/no_document.h" namespace firebase { namespace firestore { namespace remote { using core::DocumentViewChange; -using core::Query; -using local::QueryData; +using core::Target; using local::QueryPurpose; +using local::TargetData; using model::DocumentKey; using model::DocumentKeySet; using model::MaybeDocument; @@ -163,10 +163,9 @@ void WatchChangeAggregator::HandleTargetChange( target_state.UpdateResumeToken(target_change.resume_token()); continue; case WatchTargetChangeState::Removed: - // We need to keep track of removed targets to we can post-filter and - // remove any target changes. - // We need to decrement the number of pending acks needed from watch for - // this targetId. + // We need to keep track of removed targets so we can post-filter and + // remove any target changes. We need to decrement the number of pending + // acks needed from watch for this target_id. target_state.RecordTargetResponse(); if (!target_state.IsPending()) { RemoveTarget(target_id); @@ -201,9 +200,10 @@ std::vector WatchChangeAggregator::GetTargetIds( } std::vector result; - result.reserve(target_states_.size()); for (const auto& entry : target_states_) { - result.push_back(entry.first); + if (IsActiveTarget(entry.first)) { + result.push_back(entry.first); + } } return result; @@ -214,10 +214,10 @@ void WatchChangeAggregator::HandleExistenceFilter( TargetId target_id = existence_filter.target_id(); int expected_count = existence_filter.filter().count(); - absl::optional query_data = QueryDataForActiveTarget(target_id); - if (query_data) { - const Query& query = query_data->query(); - if (query.IsDocumentQuery()) { + absl::optional target_data = TargetDataForActiveTarget(target_id); + if (target_data) { + const Target& target = target_data->target(); + if (target.IsDocumentQuery()) { if (expected_count == 0) { // The existence filter told us the document does not exist. We deduce // that this document does not exist and apply a deleted document to our @@ -225,7 +225,7 @@ void WatchChangeAggregator::HandleExistenceFilter( // another query that will raise this document as part of a snapshot // until it is resolved, essentially exposing inconsistency between // queries. - DocumentKey key{query.path()}; + DocumentKey key{target.path()}; RemoveDocumentFromTarget( target_id, key, NoDocument(key, SnapshotVersion::None(), @@ -255,14 +255,16 @@ RemoteEvent WatchChangeAggregator::CreateRemoteEvent( TargetId target_id = entry.first; TargetState& target_state = entry.second; - absl::optional query_data = QueryDataForActiveTarget(target_id); - if (query_data) { - if (target_state.current() && query_data->query().IsDocumentQuery()) { + absl::optional target_data = + TargetDataForActiveTarget(target_id); + if (target_data) { + if (target_state.current() && target_data->target().IsDocumentQuery()) { // Document queries for document that don't exist can produce an empty // result set. To update our local cache, we synthesize a document // delete if we have not previously received the document. This resolves - // the limbo state of the document, removing it from limboDocumentRefs. - DocumentKey key{query_data->query().path()}; + // the limbo state of the document, removing it from + // SyncEngine::limbo_document_refs_. + DocumentKey key{target_data->target().path()}; if (pending_document_updates_.find(key) == pending_document_updates_.end() && !TargetContainsDocument(target_id, key)) { @@ -283,17 +285,17 @@ RemoteEvent WatchChangeAggregator::CreateRemoteEvent( DocumentKeySet resolved_limbo_documents; // We extract the set of limbo-only document updates as the GC logic - // special-cases documents that do not appear in the query cache. + // special-cases documents that do not appear in the target cache. // // TODO(gsoltis): Expand on this comment. for (const auto& entry : pending_document_target_mappings_) { bool is_only_limbo_target = true; for (TargetId target_id : entry.second) { - absl::optional query_data = - QueryDataForActiveTarget(target_id); - if (query_data && - query_data->purpose() != QueryPurpose::LimboResolution) { + absl::optional target_data = + TargetDataForActiveTarget(target_id); + if (target_data && + target_data->purpose() != QueryPurpose::LimboResolution) { is_only_limbo_target = false; break; } @@ -383,16 +385,16 @@ TargetState& WatchChangeAggregator::EnsureTargetState(TargetId target_id) { } bool WatchChangeAggregator::IsActiveTarget(TargetId target_id) const { - return QueryDataForActiveTarget(target_id) != absl::nullopt; + return TargetDataForActiveTarget(target_id) != absl::nullopt; } -absl::optional WatchChangeAggregator::QueryDataForActiveTarget( +absl::optional WatchChangeAggregator::TargetDataForActiveTarget( TargetId target_id) const { auto target_state = target_states_.find(target_id); return target_state != target_states_.end() && target_state->second.IsPending() - ? absl::optional{} - : target_metadata_provider_->GetQueryDataForTarget(target_id); + ? absl::optional{} + : target_metadata_provider_->GetTargetDataForTarget(target_id); } void WatchChangeAggregator::ResetTarget(TargetId target_id) { @@ -406,10 +408,10 @@ void WatchChangeAggregator::ResetTarget(TargetId target_id) { // Trigger removal for any documents currently mapped to this target. These // removals will be part of the initial snapshot if Watch does not resend // these documents. - DocumentKeySet existingKeys = + DocumentKeySet existing_keys = target_metadata_provider_->GetRemoteKeysForTarget(target_id); - for (const DocumentKey& key : existingKeys) { + for (const DocumentKey& key : existing_keys) { RemoveDocumentFromTarget(target_id, key, absl::nullopt); } } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_event.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_event.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.h index ed519de6f..7ddf1dfa7 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_event.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_event.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_EVENT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_EVENT_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_REMOTE_EVENT_H_ +#define FIRESTORE_CORE_SRC_REMOTE_REMOTE_EVENT_H_ #include #include @@ -23,18 +23,22 @@ #include #include -#include "Firestore/core/src/firebase/firestore/core/view_snapshot.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" +#include "Firestore/core/src/core/view_snapshot.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/document_key_set.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/remote/watch_change.h" namespace firebase { namespace firestore { + +namespace local { +class TargetData; +} // namespace local + namespace remote { /** @@ -43,8 +47,7 @@ namespace remote { */ class TargetMetadataProvider { public: - virtual ~TargetMetadataProvider() { - } + virtual ~TargetMetadataProvider() = default; /** * Returns the set of remote document keys for the given target ID as of the @@ -54,10 +57,10 @@ class TargetMetadataProvider { model::TargetId target_id) const = 0; /** - * Returns the QueryData for an active target ID or `nullopt` if this query + * Returns the TargetData for an active target ID or `nullopt` if this query * has become inactive. */ - virtual absl::optional GetQueryDataForTarget( + virtual absl::optional GetTargetDataForTarget( model::TargetId target_id) const = 0; }; @@ -72,6 +75,10 @@ class TargetMetadataProvider { */ class TargetChange { public: + static TargetChange CreateSynthesizedTargetChange(bool current) { + return TargetChange(current); + } + TargetChange() = default; TargetChange(nanopb::ByteString resume_token, @@ -79,7 +86,7 @@ class TargetChange { model::DocumentKeySet added_documents, model::DocumentKeySet modified_documents, model::DocumentKeySet removed_documents) - : resume_token_{resume_token}, + : resume_token_{std::move(resume_token)}, current_{current}, added_documents_{std::move(added_documents)}, modified_documents_{std::move(modified_documents)}, @@ -87,10 +94,10 @@ class TargetChange { } /** - * An opaque, server-assigned token that allows watching a query to be resumed - * after disconnecting without retransmitting all the data that matches the - * query. The resume token essentially identifies a point in time from which - * the server should resume sending results. + * An opaque, server-assigned token that allows watching a target to be + * resumed after disconnecting without retransmitting all the data that + * matches the target. The resume token essentially identifies a point in time + * from which the server should resume sending results. */ const nanopb::ByteString& resume_token() const { return resume_token_; @@ -130,6 +137,9 @@ class TargetChange { } private: + explicit TargetChange(bool current) : current_{current} { + } + nanopb::ByteString resume_token_; bool current_ = false; model::DocumentKeySet added_documents_; @@ -230,12 +240,16 @@ class TargetState { */ class RemoteEvent { public: + using TargetChangeMap = std::unordered_map; + using TargetSet = std::unordered_set; + using DocumentUpdateMap = std::unordered_map; + RemoteEvent(model::SnapshotVersion snapshot_version, - std::unordered_map target_changes, - std::unordered_set target_mismatches, - std::unordered_map document_updates, + TargetChangeMap target_changes, + TargetSet target_mismatches, + DocumentUpdateMap document_updates, model::DocumentKeySet limbo_document_changes) : snapshot_version_{snapshot_version}, target_changes_{std::move(target_changes)}, @@ -250,8 +264,7 @@ class RemoteEvent { } /** A map from target to changes to the target. See `TargetChange`. */ - const std::unordered_map& target_changes() - const { + const TargetChangeMap& target_changes() const { return target_changes_; } @@ -259,7 +272,7 @@ class RemoteEvent { * A set of targets that is known to be inconsistent. Listens for these * targets should be re-established without resume tokens. */ - const std::unordered_set& target_mismatches() const { + const TargetSet& target_mismatches() const { return target_mismatches_; } @@ -267,10 +280,7 @@ class RemoteEvent { * A set of which documents have changed or been deleted, along with the doc's * new values (if not deleted). */ - const std::unordered_map& - document_updates() const { + const DocumentUpdateMap& document_updates() const { return document_updates_; } @@ -283,12 +293,9 @@ class RemoteEvent { private: model::SnapshotVersion snapshot_version_; - std::unordered_map target_changes_; - std::unordered_set target_mismatches_; - std::unordered_map - document_updates_; + TargetChangeMap target_changes_; + TargetSet target_mismatches_; + DocumentUpdateMap document_updates_; model::DocumentKeySet limbo_document_changes_; }; @@ -337,8 +344,8 @@ class WatchChangeAggregator { private: /** - * Returns all `targetId`s that the watch change applies to: either the - * `targetId`s explicitly listed in the change or the `targetId`s of all + * Returns all `TargetId`s that the watch change applies to: either the + * `TargetId`s explicitly listed in the change or the `TargetId`s of all * currently active targets. */ std::vector GetTargetIds( @@ -386,10 +393,10 @@ class WatchChangeAggregator { bool IsActiveTarget(model::TargetId target_id) const; /** - * Returns the `QueryData` for an active target (i.e., a target that the user + * Returns the `TargetData` for an active target (i.e., a target that the user * is still interested in that has no outstanding target change requests). */ - absl::optional QueryDataForActiveTarget( + absl::optional TargetDataForActiveTarget( model::TargetId target_id) const; /** @@ -408,10 +415,7 @@ class WatchChangeAggregator { std::unordered_map target_states_; /** Keeps track of the documents to update since the last raised snapshot. */ - std::unordered_map - pending_document_updates_; + RemoteEvent::DocumentUpdateMap pending_document_updates_; /** A mapping of document keys to their set of target IDs. */ std::unordered_map pending_target_resets_; + RemoteEvent::TargetSet pending_target_resets_; TargetMetadataProvider* target_metadata_provider_ = nullptr; }; @@ -433,4 +437,4 @@ class WatchChangeAggregator { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_EVENT_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_REMOTE_EVENT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.cc new file mode 100644 index 000000000..835bd93da --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.cc @@ -0,0 +1,273 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/remote_objc_bridge.h" + +#include + +#include "Firestore/core/src/core/database_info.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/model/snapshot_version.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "Firestore/core/src/remote/grpc_nanopb.h" +#include "Firestore/core/src/remote/grpc_util.h" +#include "Firestore/core/src/remote/watch_change.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor.h" +#include "grpcpp/support/status.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using core::DatabaseInfo; +using local::TargetData; +using model::DocumentKey; +using model::MaybeDocument; +using model::Mutation; +using model::MutationResult; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; +using nanopb::ByteStringWriter; +using nanopb::MakeArray; +using nanopb::MakeByteString; +using nanopb::Message; +using nanopb::Reader; +using remote::ByteBufferReader; +using remote::Serializer; +using util::Status; +using util::StatusOr; +using util::StringFormat; + +// WatchStreamSerializer + +WatchStreamSerializer::WatchStreamSerializer(Serializer serializer) + : serializer_{std::move(serializer)} { +} + +Message +WatchStreamSerializer::EncodeWatchRequest(const TargetData& query) const { + Message result; + + result->database = serializer_.EncodeDatabaseName(); + result->which_target_change = + google_firestore_v1_ListenRequest_add_target_tag; + result->add_target = serializer_.EncodeTarget(query); + + auto labels = serializer_.EncodeListenRequestLabels(query); + if (!labels.empty()) { + result->labels_count = nanopb::CheckedSize(labels.size()); + result->labels = MakeArray( + result->labels_count); + + pb_size_t i = 0; + for (const auto& label : labels) { + result->labels[i] = label; + ++i; + } + } + + return result; +} + +Message +WatchStreamSerializer::EncodeUnwatchRequest(TargetId target_id) const { + Message result; + + result->database = serializer_.EncodeDatabaseName(); + result->which_target_change = + google_firestore_v1_ListenRequest_remove_target_tag; + result->remove_target = target_id; + + return result; +} + +Message +WatchStreamSerializer::ParseResponse(Reader* reader) const { + return Message::TryParse(reader); +} + +std::unique_ptr WatchStreamSerializer::DecodeWatchChange( + nanopb::Reader* reader, + const google_firestore_v1_ListenResponse& response) const { + return serializer_.DecodeWatchChange(reader, response); +} + +SnapshotVersion WatchStreamSerializer::DecodeSnapshotVersion( + nanopb::Reader* reader, + const google_firestore_v1_ListenResponse& response) const { + return serializer_.DecodeVersionFromListenResponse(reader, response); +} + +// WriteStreamSerializer + +WriteStreamSerializer::WriteStreamSerializer(Serializer serializer) + : serializer_{std::move(serializer)} { +} + +Message +WriteStreamSerializer::EncodeHandshake() const { + Message result; + + // The initial request cannot contain mutations, but must contain a project + // ID. + result->database = serializer_.EncodeDatabaseName(); + + return result; +} + +Message +WriteStreamSerializer::EncodeWriteMutationsRequest( + const std::vector& mutations, + const ByteString& last_stream_token) const { + Message result; + + if (!mutations.empty()) { + result->writes_count = nanopb::CheckedSize(mutations.size()); + result->writes = MakeArray(result->writes_count); + + for (pb_size_t i = 0; i != result->writes_count; ++i) { + result->writes[i] = serializer_.EncodeMutation(mutations[i]); + } + } + + result->stream_token = nanopb::CopyBytesArray(last_stream_token.get()); + + return result; +} + +Message +WriteStreamSerializer::EncodeEmptyMutationsList( + const ByteString& last_stream_token) const { + return EncodeWriteMutationsRequest({}, last_stream_token); +} + +Message WriteStreamSerializer::ParseResponse( + Reader* reader) const { + return Message::TryParse(reader); +} + +SnapshotVersion WriteStreamSerializer::DecodeCommitVersion( + nanopb::Reader* reader, + const google_firestore_v1_WriteResponse& proto) const { + return serializer_.DecodeVersion(reader, proto.commit_time); +} + +std::vector WriteStreamSerializer::DecodeMutationResults( + nanopb::Reader* reader, + const google_firestore_v1_WriteResponse& proto) const { + SnapshotVersion commit_version = DecodeCommitVersion(reader, proto); + if (!reader->ok()) { + return {}; + } + + const google_firestore_v1_WriteResult* writes = proto.write_results; + pb_size_t count = proto.write_results_count; + std::vector results; + results.reserve(count); + + for (pb_size_t i = 0; i != count; ++i) { + results.push_back( + serializer_.DecodeMutationResult(reader, writes[i], commit_version)); + } + + return results; +} + +// DatastoreSerializer + +DatastoreSerializer::DatastoreSerializer(const DatabaseInfo& database_info) + : serializer_{database_info.database_id()} { +} + +Message +DatastoreSerializer::EncodeCommitRequest( + const std::vector& mutations) const { + Message result; + + result->database = serializer_.EncodeDatabaseName(); + + if (!mutations.empty()) { + result->writes_count = nanopb::CheckedSize(mutations.size()); + result->writes = MakeArray(result->writes_count); + pb_size_t i = 0; + for (const Mutation& mutation : mutations) { + result->writes[i] = serializer_.EncodeMutation(mutation); + ++i; + } + } + + return result; +} + +Message +DatastoreSerializer::EncodeLookupRequest( + const std::vector& keys) const { + Message result; + + result->database = serializer_.EncodeDatabaseName(); + if (!keys.empty()) { + result->documents_count = nanopb::CheckedSize(keys.size()); + result->documents = MakeArray(result->documents_count); + pb_size_t i = 0; + for (const DocumentKey& key : keys) { + result->documents[i] = serializer_.EncodeKey(key); + ++i; + } + } + + return result; +} + +StatusOr> +DatastoreSerializer::MergeLookupResponses( + const std::vector& responses) const { + // Sort by key. + std::map results; + + for (const auto& response : responses) { + ByteBufferReader reader{response}; + auto message = + Message::TryParse( + &reader); + + MaybeDocument doc = serializer_.DecodeMaybeDocument(&reader, *message); + if (!reader.ok()) { + return reader.status(); + } + + results[doc.key()] = std::move(doc); + } + + std::vector docs; + docs.reserve(results.size()); + for (const auto& kv : results) { + docs.push_back(kv.second); + } + + StatusOr> result{std::move(docs)}; + return result; +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.h new file mode 100644 index 000000000..d7941fced --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_objc_bridge.h @@ -0,0 +1,142 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_REMOTE_REMOTE_OBJC_BRIDGE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_REMOTE_OBJC_BRIDGE_H_ + +#include +#include +#include +#include + +#include "Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/remote/serializer.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { + +namespace local { +class TargetData; +} // namespace local + +namespace model { +class DocumentKey; +class MaybeDocument; +class SnapshotVersion; +} // namespace model + +namespace remote { + +class WatchChange; + +// TODO(varconst): remove this file? +// +// The original purpose of this file was to cleanly encapsulate the remaining +// Objective-C dependencies of `remote/` folder. These dependencies no longer +// exist, and this file makes C++ diverge from other platforms. +// +// On the other hand, stream classes are large, and having one easily +// separatable aspect of their implementation (serialization) refactored out is +// arguably a good thing. If this file were to stay (in some form, certainly +// under a different name), other platforms would have to follow suit. +// +// Note: return value optimization should make returning Nanopb messages from +// functions cheap (even though they may be large types that are relatively +// expensive to copy). + +class WatchStreamSerializer { + public: + explicit WatchStreamSerializer(Serializer serializer); + + nanopb::Message EncodeWatchRequest( + const local::TargetData& query) const; + nanopb::Message EncodeUnwatchRequest( + model::TargetId target_id) const; + + nanopb::Message ParseResponse( + nanopb::Reader* reader) const; + std::unique_ptr DecodeWatchChange( + nanopb::Reader* reader, + const google_firestore_v1_ListenResponse& response) const; + model::SnapshotVersion DecodeSnapshotVersion( + nanopb::Reader* reader, + const google_firestore_v1_ListenResponse& response) const; + + private: + Serializer serializer_; +}; + +class WriteStreamSerializer { + public: + explicit WriteStreamSerializer(Serializer serializer); + + nanopb::Message EncodeHandshake() const; + nanopb::Message EncodeWriteMutationsRequest( + const std::vector& mutations, + const nanopb::ByteString& last_stream_token) const; + nanopb::Message EncodeEmptyMutationsList( + const nanopb::ByteString& last_stream_token) const; + + nanopb::Message ParseResponse( + nanopb::Reader* reader) const; + model::SnapshotVersion DecodeCommitVersion( + nanopb::Reader* reader, + const google_firestore_v1_WriteResponse& proto) const; + std::vector DecodeMutationResults( + nanopb::Reader* reader, + const google_firestore_v1_WriteResponse& proto) const; + + private: + Serializer serializer_; +}; + +class DatastoreSerializer { + public: + explicit DatastoreSerializer(const core::DatabaseInfo& database_info); + + nanopb::Message EncodeCommitRequest( + const std::vector& mutations) const; + + nanopb::Message + EncodeLookupRequest(const std::vector& keys) const; + + /** + * Merges results of the streaming read together. The array is sorted by the + * document key. + */ + util::StatusOr> MergeLookupResponses( + const std::vector& responses) const; + + const Serializer& serializer() const { + return serializer_; + } + + private: + Serializer serializer_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_REMOTE_OBJC_BRIDGE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.cc new file mode 100644 index 000000000..8caaa2d75 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.cc @@ -0,0 +1,571 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/remote_store.h" + +#include +#include + +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/local/local_store.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/mutation_batch_result.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/to_string.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using core::Transaction; +using local::LocalStore; +using local::QueryPurpose; +using local::TargetData; +using model::BatchId; +using model::DocumentKeySet; +using model::kBatchIdUnknown; +using model::MutationBatch; +using model::MutationBatchResult; +using model::MutationResult; +using model::OnlineState; +using model::SnapshotVersion; +using model::TargetId; +using nanopb::ByteString; +using util::AsyncQueue; +using util::Status; + +/** + * The maximum number of pending writes to allow. + * TODO(b/35853402): Negotiate this value with the backend. + */ +constexpr int kMaxPendingWrites = 10; + +RemoteStore::RemoteStore( + LocalStore* local_store, + std::shared_ptr datastore, + const std::shared_ptr& worker_queue, + ConnectivityMonitor* connectivity_monitor, + std::function online_state_handler) + : local_store_{local_store}, + datastore_{std::move(datastore)}, + online_state_tracker_{worker_queue, std::move(online_state_handler)}, + connectivity_monitor_{NOT_NULL(connectivity_monitor)} { + datastore_->Start(); + + // Create streams (but note they're not started yet) + watch_stream_ = datastore_->CreateWatchStream(this); + write_stream_ = datastore_->CreateWriteStream(this); +} + +void RemoteStore::Start() { + // For now, all setup is handled by `EnableNetwork`. We might expand on this + // in the future. + EnableNetwork(); + + connectivity_monitor_->AddCallback( + [this](ConnectivityMonitor::NetworkStatus network_status) { + if (network_status == ConnectivityMonitor::NetworkStatus::Unavailable) { + LOG_DEBUG( + "RemoteStore %s ignoring connectivity callback for unavailable " + "network", + this); + return; + } + + if (CanUseNetwork()) { + LOG_DEBUG("RemoteStore %s restarting streams as connectivity changed", + this); + RestartNetwork(); + } + }); +} + +void RemoteStore::EnableNetwork() { + is_network_enabled_ = true; + + if (CanUseNetwork()) { + // Load any saved stream token from persistent storage + write_stream_->set_last_stream_token(local_store_->GetLastStreamToken()); + + if (ShouldStartWatchStream()) { + StartWatchStream(); + } else { + online_state_tracker_.UpdateState(OnlineState::Unknown); + } + + // This will start the write stream if necessary. + FillWritePipeline(); + } +} + +void RemoteStore::DisableNetwork() { + is_network_enabled_ = false; + DisableNetworkInternal(); + + // Set the OnlineState to Offline so get()s return from cache, etc. + online_state_tracker_.UpdateState(OnlineState::Offline); +} + +void RemoteStore::DisableNetworkInternal() { + watch_stream_->Stop(); + write_stream_->Stop(); + + if (!write_pipeline_.empty()) { + LOG_DEBUG("Stopping write stream with %s pending writes", + write_pipeline_.size()); + write_pipeline_.clear(); + } + + CleanUpWatchStreamState(); +} + +void RemoteStore::Shutdown() { + LOG_DEBUG("RemoteStore %s shutting down", this); + is_network_enabled_ = false; + DisableNetworkInternal(); + + // Set the `OnlineState` to `Unknown` (rather than `Offline`) to avoid + // potentially triggering spurious listener events with cached data, etc. + online_state_tracker_.UpdateState(OnlineState::Unknown); + + datastore_->Shutdown(); +} + +// Watch Stream + +void RemoteStore::Listen(const TargetData& target_data) { + TargetId target_key = target_data.target_id(); + if (listen_targets_.find(target_key) != listen_targets_.end()) { + return; + } + + // Mark this as something the client is currently listening for. + listen_targets_[target_key] = target_data; + + if (ShouldStartWatchStream()) { + // The listen will be sent in `OnWatchStreamOpen` + StartWatchStream(); + } else if (watch_stream_->IsOpen()) { + SendWatchRequest(target_data); + } +} + +void RemoteStore::StopListening(TargetId target_id) { + size_t num_erased = listen_targets_.erase(target_id); + HARD_ASSERT(num_erased == 1, + "StopListening: target not currently watched: %s", target_id); + + // The watch stream might not be started if we're in a disconnected state + if (watch_stream_->IsOpen()) { + SendUnwatchRequest(target_id); + } + if (listen_targets_.empty()) { + if (watch_stream_->IsOpen()) { + watch_stream_->MarkIdle(); + } else if (CanUseNetwork()) { + // Revert to `OnlineState::Unknown` if the watch stream is not open and we + // have no listeners, since without any listens to send we cannot confirm + // if the stream is healthy and upgrade to `OnlineState::Online`. + online_state_tracker_.UpdateState(OnlineState::Unknown); + } + } +} + +void RemoteStore::SendWatchRequest(const TargetData& target_data) { + // We need to increment the the expected number of pending responses we're due + // from watch so we wait for the ack to process any messages from this target. + watch_change_aggregator_->RecordPendingTargetRequest(target_data.target_id()); + watch_stream_->WatchQuery(target_data); +} + +void RemoteStore::SendUnwatchRequest(TargetId target_id) { + // We need to increment the expected number of pending responses we're due + // from watch so we wait for the removal on the server before we process any + // messages from this target. + watch_change_aggregator_->RecordPendingTargetRequest(target_id); + watch_stream_->UnwatchTargetId(target_id); +} + +bool RemoteStore::ShouldStartWatchStream() const { + return CanUseNetwork() && !watch_stream_->IsStarted() && + !listen_targets_.empty(); +} + +void RemoteStore::StartWatchStream() { + HARD_ASSERT(ShouldStartWatchStream(), + "StartWatchStream called when ShouldStartWatchStream is false."); + watch_change_aggregator_ = absl::make_unique(this); + watch_stream_->Start(); + + online_state_tracker_.HandleWatchStreamStart(); +} + +void RemoteStore::CleanUpWatchStreamState() { + watch_change_aggregator_.reset(); +} + +void RemoteStore::OnWatchStreamOpen() { + // Restore any existing watches. + for (const auto& kv : listen_targets_) { + SendWatchRequest(kv.second); + } +} + +void RemoteStore::OnWatchStreamClose(const Status& status) { + if (status.ok()) { + // Graceful stop (due to Stop() or idle timeout). Make sure that's + // desirable. + HARD_ASSERT(!ShouldStartWatchStream(), + "Watch stream was stopped gracefully while still needed."); + } + + CleanUpWatchStreamState(); + + // If we still need the watch stream, retry the connection. + if (ShouldStartWatchStream()) { + online_state_tracker_.HandleWatchStreamFailure(status); + + StartWatchStream(); + } else { + // We don't need to restart the watch stream because there are no active + // targets. The online state is set to unknown because there is no active + // attempt at establishing a connection. + online_state_tracker_.UpdateState(OnlineState::Unknown); + } +} + +void RemoteStore::OnWatchStreamChange(const WatchChange& change, + const SnapshotVersion& snapshot_version) { + // Mark the connection as Online because we got a message from the server. + online_state_tracker_.UpdateState(OnlineState::Online); + + if (change.type() == WatchChange::Type::TargetChange) { + const WatchTargetChange& watch_target_change = + static_cast(change); + if (watch_target_change.state() == WatchTargetChangeState::Removed && + !watch_target_change.cause().ok()) { + // There was an error on a target, don't wait for a consistent snapshot to + // raise events + return ProcessTargetError(watch_target_change); + } else { + watch_change_aggregator_->HandleTargetChange(watch_target_change); + } + } else if (change.type() == WatchChange::Type::Document) { + watch_change_aggregator_->HandleDocumentChange( + static_cast(change)); + } else { + HARD_ASSERT( + change.type() == WatchChange::Type::ExistenceFilter, + "Expected WatchChange to be an instance of ExistenceFilterWatchChange"); + watch_change_aggregator_->HandleExistenceFilter( + static_cast(change)); + } + + if (snapshot_version != SnapshotVersion::None() && + snapshot_version >= local_store_->GetLastRemoteSnapshotVersion()) { + // We have received a target change with a global snapshot if the snapshot + // version is not equal to `SnapshotVersion::None()`. + RaiseWatchSnapshot(snapshot_version); + } +} + +void RemoteStore::RaiseWatchSnapshot(const SnapshotVersion& snapshot_version) { + HARD_ASSERT(snapshot_version != SnapshotVersion::None(), + "Can't raise event for unknown SnapshotVersion"); + + RemoteEvent remote_event = + watch_change_aggregator_->CreateRemoteEvent(snapshot_version); + + // Update in-memory resume tokens. `LocalStore` will update the persistent + // view of these when applying the completed `RemoteEvent`. + for (const auto& entry : remote_event.target_changes()) { + const TargetChange& target_change = entry.second; + const ByteString& resume_token = target_change.resume_token(); + + if (!resume_token.empty()) { + TargetId target_id = entry.first; + auto found = listen_targets_.find(target_id); + absl::optional target_data; + if (found != listen_targets_.end()) { + target_data = found->second; + } + + // A watched target might have been removed already. + if (target_data) { + listen_targets_[target_id] = + target_data->WithResumeToken(resume_token, snapshot_version); + } + } + } + + // Re-establish listens for the targets that have been invalidated by + // existence filter mismatches. + for (TargetId target_id : remote_event.target_mismatches()) { + auto found = listen_targets_.find(target_id); + if (found == listen_targets_.end()) { + // A watched target might have been removed already. + continue; + } + TargetData target_data = found->second; + + // Clear the resume token for the query, since we're in a known mismatch + // state. + target_data = + TargetData(target_data.target(), target_id, + target_data.sequence_number(), target_data.purpose()); + listen_targets_[target_id] = target_data; + + // Cause a hard reset by unwatching and rewatching immediately, but + // deliberately don't send a resume token so that we get a full update. + SendUnwatchRequest(target_id); + + // Mark the query we send as being on behalf of an existence filter + // mismatch, but don't actually retain that in listen_targets_. This ensures + // that we flag the first re-listen this way without impacting future + // listens of this target (that might happen e.g. on reconnect). + TargetData request_target_data(target_data.target(), target_id, + target_data.sequence_number(), + QueryPurpose::ExistenceFilterMismatch); + SendWatchRequest(request_target_data); + } + + // Finally handle remote event + sync_engine_->ApplyRemoteEvent(remote_event); +} + +void RemoteStore::ProcessTargetError(const WatchTargetChange& change) { + HARD_ASSERT(!change.cause().ok(), "Handling target error without a cause"); + + // Ignore targets that have been removed already. + for (TargetId target_id : change.target_ids()) { + auto found = listen_targets_.find(target_id); + if (found != listen_targets_.end()) { + listen_targets_.erase(found); + watch_change_aggregator_->RemoveTarget(target_id); + sync_engine_->HandleRejectedListen(target_id, change.cause()); + } + } +} + +// Write Stream + +void RemoteStore::FillWritePipeline() { + BatchId last_batch_id_retrieved = write_pipeline_.empty() + ? kBatchIdUnknown + : write_pipeline_.back().batch_id(); + while (CanAddToWritePipeline()) { + absl::optional batch = + local_store_->GetNextMutationBatch(last_batch_id_retrieved); + if (!batch) { + if (write_pipeline_.empty()) { + write_stream_->MarkIdle(); + } + break; + } + AddToWritePipeline(*batch); + last_batch_id_retrieved = batch->batch_id(); + } + + if (ShouldStartWriteStream()) { + StartWriteStream(); + } +} + +bool RemoteStore::CanAddToWritePipeline() const { + return CanUseNetwork() && write_pipeline_.size() < kMaxPendingWrites; +} + +void RemoteStore::AddToWritePipeline(const MutationBatch& batch) { + HARD_ASSERT(CanAddToWritePipeline(), + "AddToWritePipeline called when pipeline is full"); + + write_pipeline_.push_back(batch); + + if (write_stream_->IsOpen() && write_stream_->handshake_complete()) { + write_stream_->WriteMutations(batch.mutations()); + } +} + +bool RemoteStore::ShouldStartWriteStream() const { + return CanUseNetwork() && !write_stream_->IsStarted() && + !write_pipeline_.empty(); +} + +void RemoteStore::StartWriteStream() { + HARD_ASSERT(ShouldStartWriteStream(), + "StartWriteStream called when ShouldStartWriteStream is false."); + write_stream_->Start(); +} + +void RemoteStore::OnWriteStreamOpen() { + write_stream_->WriteHandshake(); +} + +void RemoteStore::OnWriteStreamHandshakeComplete() { + // Record the stream token. + local_store_->SetLastStreamToken(write_stream_->last_stream_token()); + + // Send the write pipeline now that the stream is established. + for (const MutationBatch& write : write_pipeline_) { + write_stream_->WriteMutations(write.mutations()); + } +} + +void RemoteStore::OnWriteStreamMutationResult( + SnapshotVersion commit_version, + std::vector mutation_results) { + // This is a response to a write containing mutations and should be correlated + // to the first write in our write pipeline. + HARD_ASSERT(!write_pipeline_.empty(), "Got result for empty write pipeline"); + + MutationBatch batch = write_pipeline_.front(); + write_pipeline_.erase(write_pipeline_.begin()); + + MutationBatchResult batch_result(std::move(batch), commit_version, + std::move(mutation_results), + write_stream_->last_stream_token()); + sync_engine_->HandleSuccessfulWrite(batch_result); + + // It's possible that with the completion of this mutation another slot has + // freed up. + FillWritePipeline(); +} + +void RemoteStore::OnWriteStreamClose(const Status& status) { + if (status.ok()) { + // Graceful stop (due to Stop() or idle timeout). Make sure that's + // desirable. + HARD_ASSERT(!ShouldStartWriteStream(), + "Write stream was stopped gracefully while still needed."); + } + + // If the write stream closed due to an error, invoke the error callbacks if + // there are pending writes. + if (!status.ok() && !write_pipeline_.empty()) { + // TODO(varconst): handle UNAUTHENTICATED status, see + // go/firestore-client-errors + if (write_stream_->handshake_complete()) { + // This error affects the actual writes. + HandleWriteError(status); + } else { + // If there was an error before the handshake finished, it's possible that + // the server is unable to process the stream token we're sending. + // (Perhaps it's too old?) + HandleHandshakeError(status); + } + } + + // The write stream might have been started by refilling the write pipeline + // for failed writes + if (ShouldStartWriteStream()) { + StartWriteStream(); + } +} + +void RemoteStore::HandleHandshakeError(const Status& status) { + HARD_ASSERT(!status.ok(), "Handling write error with status OK."); + + // Reset the token if it's a permanent error, signaling the write stream is + // no longer valid. Note that the handshake does not count as a write: see + // comments on `Datastore::IsPermanentWriteError` for details. + if (Datastore::IsPermanentError(status)) { + std::string token = util::ToString(write_stream_->last_stream_token()); + LOG_DEBUG( + "RemoteStore %s error before completed handshake; resetting " + "stream token %s: " + "error code: '%s', details: '%s'", + this, token, status.code(), status.error_message()); + write_stream_->set_last_stream_token({}); + local_store_->SetLastStreamToken({}); + } else { + // Some other error, don't reset stream token. Our stream logic will just + // retry with exponential backoff. + } +} + +void RemoteStore::HandleWriteError(const Status& status) { + HARD_ASSERT(!status.ok(), "Handling write error with status OK."); + + // Only handle permanent errors here. If it's transient, just let the retry + // logic kick in. + if (!Datastore::IsPermanentWriteError(status)) { + return; + } + + // If this was a permanent error, the request itself was the problem so it's + // not going to succeed if we resend it. + MutationBatch batch = write_pipeline_.front(); + write_pipeline_.erase(write_pipeline_.begin()); + + // In this case it's also unlikely that the server itself is melting + // down--this was just a bad request so inhibit backoff on the next restart. + write_stream_->InhibitBackoff(); + + sync_engine_->HandleRejectedWrite(batch.batch_id(), status); + + // It's possible that with the completion of this mutation another slot has + // freed up. + FillWritePipeline(); +} + +bool RemoteStore::CanUseNetwork() const { + // PORTING NOTE: This method exists mostly because web also has to take into + // account primary vs. secondary state. + return is_network_enabled_; +} + +std::shared_ptr RemoteStore::CreateTransaction() { + return std::make_shared(datastore_.get()); +} + +DocumentKeySet RemoteStore::GetRemoteKeysForTarget(TargetId target_id) const { + return sync_engine_->GetRemoteKeys(target_id); +} + +absl::optional RemoteStore::GetTargetDataForTarget( + TargetId target_id) const { + auto found = listen_targets_.find(target_id); + return found != listen_targets_.end() ? found->second + : absl::optional{}; +} + +void RemoteStore::RestartNetwork() { + is_network_enabled_ = false; + DisableNetworkInternal(); + online_state_tracker_.UpdateState(OnlineState::Unknown); + write_stream_->InhibitBackoff(); + watch_stream_->InhibitBackoff(); + EnableNetwork(); +} + +void RemoteStore::HandleCredentialChange() { + if (CanUseNetwork()) { + // Tear down and re-create our network streams. This will ensure we get a + // fresh auth token for the new user and re-fill the write pipeline with new + // mutations from the `LocalStore` (since mutations are per-user). + LOG_DEBUG("RemoteStore %s restarting streams for new credential", this); + RestartNetwork(); + } +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_store.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_store.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.h index 03fc7f179..cc16c92f9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/remote_store.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/remote_store.h @@ -1,5 +1,5 @@ /* - * Copyright 2019 Google + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,38 +14,45 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_STORE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_STORE_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_REMOTE_STORE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_REMOTE_STORE_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/core/transaction.h" -#include "Firestore/core/src/firebase/firestore/local/local_store.h" -#include "Firestore/core/src/firebase/firestore/model/document_key_set.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch.h" -#include "Firestore/core/src/firebase/firestore/model/mutation_batch_result.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/remote/datastore.h" -#include "Firestore/core/src/firebase/firestore/remote/online_state_tracker.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_event.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_stream.h" -#include "Firestore/core/src/firebase/firestore/remote/write_stream.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/core/transaction.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/model/mutation_batch.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/remote/datastore.h" +#include "Firestore/core/src/remote/online_state_tracker.h" +#include "Firestore/core/src/remote/remote_event.h" +#include "Firestore/core/src/remote/watch_change.h" +#include "Firestore/core/src/remote/watch_stream.h" +#include "Firestore/core/src/remote/write_stream.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" namespace firebase { namespace firestore { + +namespace local { +class LocalStore; +} // namespace local + namespace remote { +class ConnectivityMonitor; + /** * A callback interface for events from remote store. */ class RemoteStoreCallback { public: + virtual ~RemoteStoreCallback() = default; + /** * Applies a remote event to the sync engine, notifying any views of the * changes, and releasing any pending mutation batches that would become @@ -104,6 +111,7 @@ class RemoteStore : public TargetMetadataProvider, RemoteStore(local::LocalStore* local_store, std::shared_ptr datastore, const std::shared_ptr& worker_queue, + ConnectivityMonitor* connectivity_monitor, std::function online_state_handler); void set_sync_engine(RemoteStoreCallback* sync_engine) { @@ -145,10 +153,19 @@ class RemoteStore : public TargetMetadataProvider, */ void HandleCredentialChange(); - /** Listens to the target identified by the given `QueryData`. */ - void Listen(const local::QueryData& query_data); + /** + * Listens to the target identified by the given `TargetData`. + * + * It is a no-op if the target of the given target data is already being + * listened to. + */ + void Listen(const local::TargetData& target_data); - /** Stops listening to the target with the given target ID. */ + /** + * Stops listening to the target with the given target ID. + * + * It is an error if the given target id is not being listened to. + */ void StopListening(model::TargetId target_id); /** @@ -174,7 +191,7 @@ class RemoteStore : public TargetMetadataProvider, model::DocumentKeySet GetRemoteKeysForTarget( model::TargetId target_id) const override; - absl::optional GetQueryDataForTarget( + absl::optional GetTargetDataForTarget( model::TargetId target_id) const override; void OnWatchStreamOpen() override; @@ -191,9 +208,10 @@ class RemoteStore : public TargetMetadataProvider, std::vector mutation_results) override; private: + void RestartNetwork(); void DisableNetworkInternal(); - void SendWatchRequest(const local::QueryData& query_data); + void SendWatchRequest(const local::TargetData& target_data); void SendUnwatchRequest(model::TargetId target_id); /** @@ -252,10 +270,12 @@ class RemoteStore : public TargetMetadataProvider, * to the server. The targets removed with unlistens are removed eagerly * without waiting for confirmation from the listen stream. */ - std::unordered_map listen_targets_; + std::unordered_map listen_targets_; OnlineStateTracker online_state_tracker_; + ConnectivityMonitor* connectivity_monitor_ = nullptr; + /** * Set to true by `EnableNetwork` and false by `DisableNetwork` and indicates * the user-preferred network state. @@ -290,4 +310,4 @@ class RemoteStore : public TargetMetadataProvider, } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_REMOTE_STORE_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_REMOTE_STORE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.cc rename to Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.cc index 18e21d92d..ff3030bf0 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/remote/serializer.h" +#include "Firestore/core/src/remote/serializer.h" #include #include @@ -31,26 +31,28 @@ #include "Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h" #include "Firestore/core/include/firebase/firestore/firestore_errors.h" #include "Firestore/core/include/firebase/firestore/timestamp.h" -#include "Firestore/core/src/firebase/firestore/model/delete_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/field_path.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/patch_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/resource_path.h" -#include "Firestore/core/src/firebase/firestore/model/set_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/transform_mutation.h" -#include "Firestore/core/src/firebase/firestore/model/transform_operation.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/nanopb/nanopb_util.h" -#include "Firestore/core/src/firebase/firestore/nanopb/reader.h" -#include "Firestore/core/src/firebase/firestore/nanopb/writer.h" -#include "Firestore/core/src/firebase/firestore/timestamp_internal.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" +#include "Firestore/core/src/core/bound.h" +#include "Firestore/core/src/core/field_filter.h" +#include "Firestore/core/src/core/query.h" +#include "Firestore/core/src/local/target_data.h" +#include "Firestore/core/src/model/delete_mutation.h" +#include "Firestore/core/src/model/document.h" +#include "Firestore/core/src/model/field_path.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/no_document.h" +#include "Firestore/core/src/model/patch_mutation.h" +#include "Firestore/core/src/model/resource_path.h" +#include "Firestore/core/src/model/set_mutation.h" +#include "Firestore/core/src/model/transform_mutation.h" +#include "Firestore/core/src/model/verify_mutation.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/nanopb_util.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "Firestore/core/src/timestamp_internal.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_format.h" #include "absl/algorithm/container.h" -#include "absl/base/casts.h" -#include "absl/memory/memory.h" namespace firebase { namespace firestore { @@ -62,11 +64,13 @@ using core::Direction; using core::FieldFilter; using core::Filter; using core::FilterList; +using core::LimitType; using core::OrderBy; using core::OrderByList; using core::Query; -using local::QueryData; +using core::Target; using local::QueryPurpose; +using local::TargetData; using model::ArrayTransform; using model::DatabaseId; using model::DeleteMutation; @@ -92,10 +96,13 @@ using model::SnapshotVersion; using model::TargetId; using model::TransformMutation; using model::TransformOperation; +using model::VerifyMutation; using nanopb::ByteString; using nanopb::CheckedSize; +using nanopb::MakeArray; using nanopb::MakeStringView; using nanopb::Reader; +using nanopb::SafeReadBoolean; using nanopb::Writer; using remote::WatchChange; using util::Status; @@ -120,21 +127,9 @@ ResourcePath DatabaseName(const DatabaseId& database_id) { database_id.database_id()}; } -/** - * Encodes a databaseId and resource path into the following form: - * /projects/$projectId/database/$databaseId/documents/$path - */ -pb_bytes_array_t* EncodeResourceName(const DatabaseId& database_id, - const ResourcePath& path) { - return Serializer::EncodeString(DatabaseName(database_id) - .Append("documents") - .Append(path) - .CanonicalString()); -} - /** * Validates that a path has a prefix that looks like a valid encoded - * databaseId. + * database ID. */ bool IsValidResourceName(const ResourcePath& path) { // Resource names have at least 4 components (project ID, database ID) @@ -142,20 +137,6 @@ bool IsValidResourceName(const ResourcePath& path) { return path.size() >= 4 && path[0] == "projects" && path[2] == "databases"; } -/** - * Decodes a fully qualified resource name into a resource path and validates - * that there is a project and database encoded in the path. There are no - * guarantees that a local path is also encoded in this resource name. - */ -ResourcePath DecodeResourceName(Reader* reader, absl::string_view encoded) { - ResourcePath resource = ResourcePath::FromString(encoded); - if (!IsValidResourceName(resource)) { - reader->Fail(StringFormat("Tried to deserialize an invalid key %s", - resource.CanonicalString())); - } - return resource; -} - /** * Decodes a fully qualified resource name into a resource path and validates * that there is a project and database encoded in the path along with a local @@ -171,19 +152,6 @@ ResourcePath ExtractLocalPathFromResourceName( return resource_name.PopFirst(5); } -ResourcePath DecodeQueryPath(Reader* reader, absl::string_view name) { - ResourcePath resource = DecodeResourceName(reader, name); - if (resource.size() == 4) { - // In v1beta1 queries for collections at the root did not have a trailing - // "/documents". In v1 all resource paths contain "/documents". Preserve the - // ability to read the v1beta1 form for compatibility with queries persisted - // in the local query cache. - return ResourcePath::Empty(); - } else { - return ExtractLocalPathFromResourceName(reader, resource); - } -} - Filter InvalidFilter() { // The exact value doesn't matter. Note that there's no way to create the base // class `Filter`, so it has to be one of the derived classes. @@ -192,19 +160,10 @@ Filter InvalidFilter() { } // namespace -Query InvalidQuery() { - return Query(); -} - Serializer::Serializer(DatabaseId database_id) : database_id_(std::move(database_id)) { } -void Serializer::FreeNanopbMessage(const pb_field_t fields[], - void* dest_struct) { - pb_release(fields, dest_struct); -} - pb_bytes_array_t* Serializer::EncodeDatabaseName() const { return EncodeString(DatabaseName(database_id_).CanonicalString()); } @@ -355,7 +314,7 @@ FieldValue::Map::value_type Serializer::DecodeFieldsEntry( return FieldValue::Map::value_type{std::move(key), std::move(value)}; } -FieldValue::Map Serializer::DecodeFields( +ObjectValue Serializer::DecodeFields( Reader* reader, size_t count, const google_firestore_v1_Document_FieldsEntry* fields) const { @@ -365,7 +324,7 @@ FieldValue::Map Serializer::DecodeFields( result = result.insert(std::move(kv.first), std::move(kv.second)); } - return result; + return ObjectValue::FromMap(result); } FieldValue::Map Serializer::DecodeMapValue( @@ -392,13 +351,7 @@ FieldValue Serializer::DecodeFieldValue( return FieldValue::Null(); case google_firestore_v1_Value_boolean_value_tag: { - // Due to the nanopb implementation, msg.boolean_value could be an integer - // other than 0 or 1, (such as 2). This leads to undefined behaviour when - // it's read as a boolean. eg. on at least gcc, the value is treated as - // both true *and* false. So we'll instead memcpy to an integer (via - // absl::bit_cast) and compare with 0. - int bool_as_int = absl::bit_cast(msg.boolean_value); - return FieldValue::FromBoolean(bool_as_int != 0); + return FieldValue::FromBoolean(SafeReadBoolean(msg.boolean_value)); } case google_firestore_v1_Value_integer_value_tag: @@ -490,6 +443,42 @@ DocumentKey Serializer::DecodeKey(Reader* reader, return DocumentKey{std::move(local_path)}; } +pb_bytes_array_t* Serializer::EncodeQueryPath(const ResourcePath& path) const { + return EncodeResourceName(database_id_, path); +} + +ResourcePath Serializer::DecodeQueryPath(Reader* reader, + absl::string_view name) const { + ResourcePath resource = DecodeResourceName(reader, name); + if (resource.size() == 4) { + // In v1beta1 queries for collections at the root did not have a trailing + // "/documents". In v1 all resource paths contain "/documents". Preserve the + // ability to read the v1beta1 form for compatibility with queries persisted + // in the local target cache. + return ResourcePath::Empty(); + } else { + return ExtractLocalPathFromResourceName(reader, resource); + } +} + +pb_bytes_array_t* Serializer::EncodeResourceName( + const DatabaseId& database_id, const ResourcePath& path) const { + return Serializer::EncodeString(DatabaseName(database_id) + .Append("documents") + .Append(path) + .CanonicalString()); +} + +ResourcePath Serializer::DecodeResourceName(Reader* reader, + absl::string_view encoded) const { + ResourcePath resource = ResourcePath::FromStringView(encoded); + if (!IsValidResourceName(resource)) { + reader->Fail(StringFormat("Tried to deserialize an invalid key %s", + resource.CanonicalString())); + } + return resource; +} + DatabaseId Serializer::DecodeDatabaseId( Reader* reader, const ResourcePath& resource_name) const { if (resource_name.size() < 4) { @@ -551,7 +540,7 @@ Document Serializer::DecodeFoundDocument( "Tried to deserialize a found document from a missing document."); DocumentKey key = DecodeKey(reader, response.found.name); - FieldValue::Map value = + ObjectValue value = DecodeFields(reader, response.found.fields_count, response.found.fields); SnapshotVersion version = DecodeVersion(reader, response.found.update_time); @@ -559,8 +548,8 @@ Document Serializer::DecodeFoundDocument( reader->Fail("Got a document response with no snapshot version"); } - return Document(ObjectValue::FromMap(std::move(value)), std::move(key), - version, DocumentState::kSynced); + return Document(std::move(value), std::move(key), version, + DocumentState::kSynced); } NoDocument Serializer::DecodeMissingDocument( @@ -582,17 +571,6 @@ NoDocument Serializer::DecodeMissingDocument( /*has_committed_mutations=*/false); } -Document Serializer::DecodeDocument( - Reader* reader, const google_firestore_v1_Document& proto) const { - FieldValue::Map fields_internal = - DecodeFields(reader, proto.fields_count, proto.fields); - SnapshotVersion version = DecodeVersion(reader, proto.update_time); - - return Document(ObjectValue::FromMap(std::move(fields_internal)), - DecodeKey(reader, proto.name), version, - DocumentState::kSynced); -} - google_firestore_v1_Write Serializer::EncodeMutation( const Mutation& mutation) const { HARD_ASSERT(mutation.is_valid(), "Invalid mutation encountered."); @@ -657,6 +635,12 @@ google_firestore_v1_Write Serializer::EncodeMutation( result.delete_ = EncodeKey(mutation.key()); return result; } + + case Mutation::Type::Verify: { + result.which_operation = google_firestore_v1_Write_verify_tag; + result.verify = EncodeKey(mutation.key()); + return result; + } } UNREACHABLE(); @@ -672,10 +656,10 @@ Mutation Serializer::DecodeMutation( switch (mutation.which_operation) { case google_firestore_v1_Write_update_tag: { DocumentKey key = DecodeKey(reader, mutation.update.name); - ObjectValue value = ObjectValue::FromMap(DecodeFields( - reader, mutation.update.fields_count, mutation.update.fields)); - FieldMask mask = DecodeFieldMask(mutation.update_mask); - if (mask.size() > 0) { + ObjectValue value = DecodeFields(reader, mutation.update.fields_count, + mutation.update.fields); + if (mutation.has_update_mask) { + FieldMask mask = DecodeFieldMask(mutation.update_mask); return PatchMutation(std::move(key), std::move(value), std::move(mask), std::move(precondition)); } else { @@ -703,6 +687,11 @@ Mutation Serializer::DecodeMutation( field_transforms); } + case google_firestore_v1_Write_verify_tag: { + return VerifyMutation(DecodeKey(reader, mutation.verify), + std::move(precondition)); + } + default: reader->Fail(StringFormat("Unknown mutation operation: %s", mutation.which_operation)); @@ -878,55 +867,55 @@ FieldTransform Serializer::DecodeFieldTransform( } google_firestore_v1_Target Serializer::EncodeTarget( - const QueryData& query_data) const { + const TargetData& target_data) const { google_firestore_v1_Target result{}; - const Query& query = query_data.query(); + const Target& target = target_data.target(); - if (query.IsDocumentQuery()) { + if (target.IsDocumentQuery()) { result.which_target_type = google_firestore_v1_Target_documents_tag; - result.target_type.documents = EncodeDocumentsTarget(query); + result.target_type.documents = EncodeDocumentsTarget(target); } else { result.which_target_type = google_firestore_v1_Target_query_tag; - result.target_type.query = EncodeQueryTarget(query); + result.target_type.query = EncodeQueryTarget(target); } - result.target_id = query_data.target_id(); - if (!query_data.resume_token().empty()) { + result.target_id = target_data.target_id(); + if (!target_data.resume_token().empty()) { result.which_resume_type = google_firestore_v1_Target_resume_token_tag; result.resume_type.resume_token = - nanopb::CopyBytesArray(query_data.resume_token().get()); + nanopb::CopyBytesArray(target_data.resume_token().get()); } return result; } google_firestore_v1_Target_DocumentsTarget Serializer::EncodeDocumentsTarget( - const core::Query& query) const { + const core::Target& target) const { google_firestore_v1_Target_DocumentsTarget result{}; result.documents_count = 1; result.documents = MakeArray(result.documents_count); - result.documents[0] = EncodeQueryPath(query.path()); + result.documents[0] = EncodeQueryPath(target.path()); return result; } -Query Serializer::DecodeDocumentsTarget( +Target Serializer::DecodeDocumentsTarget( nanopb::Reader* reader, const google_firestore_v1_Target_DocumentsTarget& proto) const { if (proto.documents_count != 1) { reader->Fail( StringFormat("DocumentsTarget contained other than 1 document %s", proto.documents_count)); - return InvalidQuery(); + return {}; } ResourcePath path = DecodeQueryPath(reader, DecodeString(proto.documents[0])); - return Query(std::move(path)); + return Query(std::move(path)).ToTarget(); } google_firestore_v1_Target_QueryTarget Serializer::EncodeQueryTarget( - const core::Query& query) const { + const core::Target& target) const { google_firestore_v1_Target_QueryTarget result{}; result.which_query_type = google_firestore_v1_Target_QueryTarget_structured_query_tag; @@ -940,14 +929,14 @@ google_firestore_v1_Target_QueryTarget Serializer::EncodeQueryTarget( result.structured_query.from[0]; // Dissect the path into parent, collection_id and optional key filter. - const ResourcePath& path = query.path(); - if (query.collection_group()) { + const ResourcePath& path = target.path(); + if (target.collection_group()) { HARD_ASSERT( path.size() % 2 == 0, "Collection group queries should be within a document path or root."); result.parent = EncodeQueryPath(path); - from.collection_id = EncodeString(*query.collection_group()); + from.collection_id = EncodeString(*target.collection_group()); from.all_descendants = true; } else { @@ -958,34 +947,34 @@ google_firestore_v1_Target_QueryTarget Serializer::EncodeQueryTarget( } // Encode the filters. - const auto& filters = query.filters(); + const auto& filters = target.filters(); if (!filters.empty()) { result.structured_query.where = EncodeFilters(filters); } - const auto& orders = query.order_bys(); + const auto& orders = target.order_bys(); if (!orders.empty()) { result.structured_query.order_by_count = CheckedSize(orders.size()); result.structured_query.order_by = EncodeOrderBys(orders); } - if (query.limit() != Query::kNoLimit) { + if (target.limit() != Target::kNoLimit) { result.structured_query.has_limit = true; - result.structured_query.limit.value = query.limit(); + result.structured_query.limit.value = target.limit(); } - if (query.start_at()) { - result.structured_query.start_at = EncodeBound(*query.start_at()); + if (target.start_at()) { + result.structured_query.start_at = EncodeBound(*target.start_at()); } - if (query.end_at()) { - result.structured_query.end_at = EncodeBound(*query.end_at()); + if (target.end_at()) { + result.structured_query.end_at = EncodeBound(*target.end_at()); } return result; } -Query Serializer::DecodeQueryTarget( +Target Serializer::DecodeQueryTarget( nanopb::Reader* reader, const google_firestore_v1_Target_QueryTarget& proto) const { // The QueryTarget oneof only has a single valid value. @@ -993,7 +982,7 @@ Query Serializer::DecodeQueryTarget( google_firestore_v1_Target_QueryTarget_structured_query_tag) { reader->Fail( StringFormat("Unknown query_type: %s", proto.which_query_type)); - return InvalidQuery(); + return {}; } ResourcePath path = DecodeQueryPath(reader, DecodeString(proto.parent)); @@ -1006,7 +995,7 @@ Query Serializer::DecodeQueryTarget( reader->Fail( "StructuredQuery.from with more than one collection is not " "supported."); - return InvalidQuery(); + return {}; } google_firestore_v1_StructuredQuery_CollectionSelector& from = @@ -1029,7 +1018,7 @@ Query Serializer::DecodeQueryTarget( order_by = DecodeOrderBys(reader, query.order_by, query.order_by_count); } - int32_t limit = Query::kNoLimit; + int32_t limit = Target::kNoLimit; if (query.has_limit) { limit = query.limit.value; } @@ -1046,7 +1035,8 @@ Query Serializer::DecodeQueryTarget( return Query(std::move(path), std::move(collection_group), std::move(filter_by), std::move(order_by), limit, - std::move(start_at), std::move(end_at)); + LimitType::First, std::move(start_at), std::move(end_at)) + .ToTarget(); } google_firestore_v1_StructuredQuery_Filter Serializer::EncodeFilters( @@ -1112,20 +1102,28 @@ google_firestore_v1_StructuredQuery_Filter Serializer::EncodeSingularFilter( const FieldFilter& filter) const { google_firestore_v1_StructuredQuery_Filter result{}; - if (filter.op() == Filter::Operator::Equal) { - if (filter.value().is_null() || filter.value().is_nan()) { - result.which_filter_type = - google_firestore_v1_StructuredQuery_Filter_unary_filter_tag; - result.unary_filter.which_operand_type = - google_firestore_v1_StructuredQuery_UnaryFilter_field_tag; - result.unary_filter.field.field_path = EncodeFieldPath(filter.field()); + if (filter.op() == Filter::Operator::Equal || + filter.op() == Filter::Operator::NotEqual) { + result.which_filter_type = + google_firestore_v1_StructuredQuery_Filter_unary_filter_tag; + result.unary_filter.which_operand_type = + google_firestore_v1_StructuredQuery_UnaryFilter_field_tag; + result.unary_filter.field.field_path = EncodeFieldPath(filter.field()); + if (filter.value().is_nan()) { auto op = - filter.value().is_null() - ? google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL - : google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN; + filter.op() == Filter::Operator::Equal + ? google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NAN + : google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN; // NOLINT result.unary_filter.op = op; + return result; + } else if (filter.value().is_null()) { + auto op = + filter.op() == Filter::Operator::Equal + ? google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NULL + : google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL; // NOLINT + result.unary_filter.op = op; return result; } } @@ -1171,6 +1169,14 @@ Filter Serializer::DecodeUnaryFilter( return FieldFilter::Create(std::move(field), Filter::Operator::Equal, FieldValue::Nan()); + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NULL: + return FieldFilter::Create(std::move(field), Filter::Operator::NotEqual, + FieldValue::Null()); + + case google_firestore_v1_StructuredQuery_UnaryFilter_Operator_IS_NOT_NAN: + return FieldFilter::Create(std::move(field), Filter::Operator::NotEqual, + FieldValue::Nan()); + default: reader->Fail(StringFormat("Unrecognized UnaryFilter.op %s", unary.op)); return InvalidFilter(); @@ -1236,6 +1242,9 @@ Serializer::EncodeFieldFilterOperator(Filter::Operator op) const { case Filter::Operator::Equal: return google_firestore_v1_StructuredQuery_FieldFilter_Operator_EQUAL; + case Filter::Operator::NotEqual: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_EQUAL; + case Filter::Operator::ArrayContains: return google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS; // NOLINT @@ -1245,6 +1254,9 @@ Serializer::EncodeFieldFilterOperator(Filter::Operator op) const { case Filter::Operator::ArrayContainsAny: return google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY; // NOLINT + case Filter::Operator::NotIn: + return google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN; // NOLINT + default: HARD_FAIL("Unhandled Filter::Operator: %s", op); } @@ -1269,6 +1281,9 @@ Filter::Operator Serializer::DecodeFieldFilterOperator( case google_firestore_v1_StructuredQuery_FieldFilter_Operator_EQUAL: return Filter::Operator::Equal; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_EQUAL: + return Filter::Operator::NotEqual; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS: // NOLINT return Filter::Operator::ArrayContains; @@ -1278,6 +1293,9 @@ Filter::Operator Serializer::DecodeFieldFilterOperator( case google_firestore_v1_StructuredQuery_FieldFilter_Operator_ARRAY_CONTAINS_ANY: // NOLINT return Filter::Operator::ArrayContainsAny; + case google_firestore_v1_StructuredQuery_FieldFilter_Operator_NOT_IN: // NOLINT + return Filter::Operator::NotIn; + default: reader->Fail(StringFormat("Unhandled FieldFilter.op: %s", op)); return Filter::Operator{}; @@ -1383,11 +1401,7 @@ pb_bytes_array_t* Serializer::EncodeFieldPath(const FieldPath& field_path) { /* static */ FieldPath Serializer::DecodeFieldPath(const pb_bytes_array_t* field_path) { absl::string_view str = MakeStringView(field_path); - return FieldPath::FromServerFormat(str); -} - -pb_bytes_array_t* Serializer::EncodeQueryPath(const ResourcePath& path) const { - return EncodeResourceName(database_id_, path); + return FieldPath::FromServerFormatView(str); } google_protobuf_Timestamp Serializer::EncodeVersion( @@ -1530,9 +1544,9 @@ MutationResult Serializer::DecodeMutationResult( } std::vector -Serializer::EncodeListenRequestLabels(const QueryData& query_data) const { +Serializer::EncodeListenRequestLabels(const TargetData& target_data) const { std::vector result; - auto value = EncodeLabel(query_data.purpose()); + auto value = EncodeLabel(target_data.purpose()); if (value.empty()) { return result; } @@ -1574,7 +1588,14 @@ std::unique_ptr Serializer::DecodeWatchChange( case google_firestore_v1_ListenResponse_filter_tag: return DecodeExistenceFilterWatchChange(reader, watch_change.filter); } - UNREACHABLE(); + + // Occasionally Watch will send response_type == 0 (which isn't a valid tag in + // the enumeration). This has only been observed in tests running against the + // emulator on Forge. Failing here causes the stream to restart with no ill + // effects. + reader->Fail(StringFormat("Unknown WatchChange.response_type: %s", + watch_change.which_response_type)); + return {}; } SnapshotVersion Serializer::DecodeVersionFromListenResponse( @@ -1614,7 +1635,7 @@ std::unique_ptr Serializer::DecodeTargetChange( } WatchTargetChangeState Serializer::DecodeTargetChangeState( - nanopb::Reader* reader, + nanopb::Reader*, const google_firestore_v1_TargetChange_TargetChangeType state) { switch (state) { case google_firestore_v1_TargetChange_TargetChangeType_NO_CHANGE: @@ -1634,18 +1655,20 @@ WatchTargetChangeState Serializer::DecodeTargetChangeState( std::unique_ptr Serializer::DecodeDocumentChange( nanopb::Reader* reader, const google_firestore_v1_DocumentChange& change) const { - ObjectValue value = ObjectValue::FromMap(DecodeFields( - reader, change.document.fields_count, change.document.fields)); + ObjectValue value = DecodeFields(reader, change.document.fields_count, + change.document.fields); DocumentKey key = DecodeKey(reader, change.document.name); HARD_ASSERT(change.document.has_update_time, "Got a document change with no snapshot version"); SnapshotVersion version = DecodeVersion(reader, change.document.update_time); - // TODO(wuandy): Originally `document` is constructed with `change.document` - // as last argument, such that it does not have to encode the proto again - // when saving it. It's dangerous because last argument is an `any` type. - // Revisit this when porting local serializer to see if we can do it safely. + // TODO(b/142956770): other platforms memoize `change.document` inside the + // `Document`. This currently cannot be implemented efficiently because it + // would require a reference-counted ownership model for the proto (copying it + // would defeat the purpose). Note, however, that even without this + // optimization C++ implementation is on par with the preceding Objective-C + // implementation. Document document(std::move(value), key, version, DocumentState::kSynced); std::vector updated_target_ids( @@ -1693,8 +1716,7 @@ std::unique_ptr Serializer::DecodeDocumentRemove( } std::unique_ptr Serializer::DecodeExistenceFilterWatchChange( - nanopb::Reader* reader, - const google_firestore_v1_ExistenceFilter& filter) const { + nanopb::Reader*, const google_firestore_v1_ExistenceFilter& filter) const { ExistenceFilter existence_filter{filter.count}; return absl::make_unique(existence_filter, filter.target_id); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.h index eae0f02e8..7c17dbe35 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/serializer.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/serializer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_SERIALIZER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_SERIALIZER_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_SERIALIZER_H_ +#define FIRESTORE_CORE_SRC_REMOTE_SERIALIZER_H_ #include #include @@ -27,28 +27,16 @@ #include "Firestore/Protos/nanopb/google/firestore/v1/document.nanopb.h" #include "Firestore/Protos/nanopb/google/firestore/v1/firestore.nanopb.h" #include "Firestore/Protos/nanopb/google/type/latlng.nanopb.h" -#include "Firestore/core/src/firebase/firestore/core/bound.h" -#include "Firestore/core/src/firebase/firestore/core/field_filter.h" -#include "Firestore/core/src/firebase/firestore/core/filter.h" -#include "Firestore/core/src/firebase/firestore/core/order_by.h" -#include "Firestore/core/src/firebase/firestore/core/query.h" -#include "Firestore/core/src/firebase/firestore/local/query_data.h" -#include "Firestore/core/src/firebase/firestore/model/database_id.h" -#include "Firestore/core/src/firebase/firestore/model/document.h" -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/field_mask.h" -#include "Firestore/core/src/firebase/firestore/model/field_transform.h" -#include "Firestore/core/src/firebase/firestore/model/field_value.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/mutation.h" -#include "Firestore/core/src/firebase/firestore/model/no_document.h" -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/nanopb/reader.h" -#include "Firestore/core/src/firebase/firestore/nanopb/writer.h" -#include "Firestore/core/src/firebase/firestore/remote/watch_change.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/core/core_fwd.h" +#include "Firestore/core/src/core/filter.h" +#include "Firestore/core/src/model/database_id.h" +#include "Firestore/core/src/model/field_value.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/nanopb/writer.h" +#include "Firestore/core/src/remote/watch_change.h" +#include "Firestore/core/src/util/status_fwd.h" #include "absl/base/attributes.h" #include "absl/strings/string_view.h" @@ -57,16 +45,14 @@ namespace firestore { namespace local { class LocalSerializer; -} +class TargetData; -namespace remote { +enum class QueryPurpose; +} // namespace local -template -T* MakeArray(pb_size_t count) { - return static_cast(calloc(count, sizeof(T))); -} +namespace remote { -core::Query InvalidQuery(); +core::Target InvalidTarget(); /** * @brief Converts internal model objects to their equivalent protocol buffer @@ -76,8 +62,8 @@ core::Query InvalidQuery(); * protocol buffer, and methods starting with "Decode" convert from a nanopb * protocol buffer to a model object. * - * For encoded messages, FreeNanopbMessage() must be called on the returned - * nanopb proto buffer or a memory leak will occur. + * For encoded messages, `nanopb::FreeNanopbMessage()` must be called on the + * returned nanopb proto buffer or a memory leak will occur. * * All errors that occur during serialization are fatal. * @@ -130,13 +116,6 @@ class Serializer { */ pb_bytes_array_t* EncodeDatabaseName() const; - /** - * Release memory allocated by the Encode* methods that return protos. - * - * This essentially wraps calls to nanopb's pb_release() method. - */ - static void FreeNanopbMessage(const pb_field_t fields[], void* dest_struct); - /** * @brief Converts the FieldValue model passed into bytes. */ @@ -155,7 +134,7 @@ class Serializer { /** * Encodes the given document key as a fully qualified name. This includes the - * databaseId associated with this Serializer and the key path. + * DatabaseId associated with this Serializer and the key path. */ pb_bytes_array_t* EncodeKey( const firebase::firestore::model::DocumentKey& key) const; @@ -207,14 +186,11 @@ class Serializer { const model::SnapshotVersion& commit_version) const; std::vector - EncodeListenRequestLabels(const local::QueryData& query_data) const; + EncodeListenRequestLabels(const local::TargetData& target_data) const; static pb_bytes_array_t* EncodeFieldPath(const model::FieldPath& field_path); static model::FieldPath DecodeFieldPath(const pb_bytes_array_t* field_path); - model::Document DecodeDocument( - nanopb::Reader* reader, const google_firestore_v1_Document& proto) const; - static google_protobuf_Timestamp EncodeVersion( const model::SnapshotVersion& version); @@ -240,15 +216,15 @@ class Serializer { const model::ObjectValue& object_value) const; google_firestore_v1_Target EncodeTarget( - const local::QueryData& query_data) const; + const local::TargetData& target_data) const; google_firestore_v1_Target_DocumentsTarget EncodeDocumentsTarget( - const core::Query& query) const; - core::Query DecodeDocumentsTarget( + const core::Target& target) const; + core::Target DecodeDocumentsTarget( nanopb::Reader* reader, const google_firestore_v1_Target_DocumentsTarget& proto) const; google_firestore_v1_Target_QueryTarget EncodeQueryTarget( - const core::Query& query) const; - core::Query DecodeQueryTarget( + const core::Target& target) const; + core::Target DecodeQueryTarget( nanopb::Reader* reader, const google_firestore_v1_Target_QueryTarget& proto) const; @@ -260,6 +236,11 @@ class Serializer { nanopb::Reader* reader, const google_firestore_v1_ListenResponse& listen_response) const; + model::ObjectValue DecodeFields( + nanopb::Reader* reader, + size_t count, + const google_firestore_v1_Document_FieldsEntry* fields) const; + // Public for the sake of tests. google_firestore_v1_StructuredQuery_Filter EncodeFilters( const core::FilterList& filters) const; @@ -287,6 +268,23 @@ class Serializer { const google_firestore_v1_BatchGetDocumentsResponse& response) const; pb_bytes_array_t* EncodeQueryPath(const model::ResourcePath& path) const; + model::ResourcePath DecodeQueryPath(nanopb::Reader* reader, + absl::string_view name) const; + + /** + * Encodes a database ID and resource path into the following form: + * /projects/$project_id/database/$database_id/documents/$path + */ + pb_bytes_array_t* EncodeResourceName(const model::DatabaseId& database_id, + const model::ResourcePath& path) const; + + /** + * Decodes a fully qualified resource name into a resource path and validates + * that there is a project and database encoded in the path. There are no + * guarantees that a local path is also encoded in this resource name. + */ + model::ResourcePath DecodeResourceName(nanopb::Reader* reader, + absl::string_view encoded) const; void ValidateDocumentKeyPath(nanopb::Reader* reader, const model::ResourcePath& resource_name) const; @@ -296,10 +294,6 @@ class Serializer { model::FieldValue::Map::value_type DecodeFieldsEntry( nanopb::Reader* reader, const google_firestore_v1_Document_FieldsEntry& fields) const; - model::FieldValue::Map DecodeFields( - nanopb::Reader* reader, - size_t count, - const google_firestore_v1_Document_FieldsEntry* fields) const; model::FieldValue::Map DecodeMapValue( nanopb::Reader* reader, @@ -375,4 +369,4 @@ class Serializer { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_SERIALIZER_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_SERIALIZER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc new file mode 100644 index 000000000..1b624b27b --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.cc @@ -0,0 +1,330 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/stream.h" + +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/remote/datastore.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/string_format.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using auth::CredentialsProvider; +using auth::Token; +using util::AsyncQueue; +using util::LogIsDebugEnabled; +using util::Status; +using util::StatusOr; +using util::StringFormat; +using util::TimerId; + +namespace { + +/** + * Initial backoff time after an error. + * Set to 1s according to https://cloud.google.com/apis/design/errors. + */ +const double kBackoffFactor = 1.5; +const AsyncQueue::Milliseconds kBackoffInitialDelay{std::chrono::seconds(1)}; +const AsyncQueue::Milliseconds kBackoffMaxDelay{std::chrono::seconds(60)}; +/** The time a stream stays open after it is marked idle. */ +const AsyncQueue::Milliseconds kIdleTimeout{std::chrono::seconds(60)}; + +} // namespace + +Stream::Stream(const std::shared_ptr& worker_queue, + std::shared_ptr credentials_provider, + GrpcConnection* grpc_connection, + TimerId backoff_timer_id, + TimerId idle_timer_id) + : backoff_{worker_queue, backoff_timer_id, kBackoffFactor, + kBackoffInitialDelay, kBackoffMaxDelay}, + credentials_provider_{std::move(credentials_provider)}, + worker_queue_{worker_queue}, + grpc_connection_{grpc_connection}, + idle_timer_id_{idle_timer_id} { +} + +// Check state + +bool Stream::IsOpen() const { + EnsureOnQueue(); + return state_ == State::Open; +} + +bool Stream::IsStarted() const { + EnsureOnQueue(); + return state_ == State::Starting || state_ == State::Backoff || IsOpen(); +} + +// Starting + +void Stream::Start() { + EnsureOnQueue(); + + if (state_ == State::Error) { + BackoffAndTryRestarting(); + return; + } + + LOG_DEBUG("%s start", GetDebugDescription()); + + HARD_ASSERT(state_ == State::Initial, "Already started"); + state_ = State::Starting; + + RequestCredentials(); +} + +void Stream::RequestCredentials() { + EnsureOnQueue(); + + // Auth may outlive the stream, so make sure it doesn't try to access a + // deleted object. + std::weak_ptr weak_this{shared_from_this()}; + int initial_close_count = close_count_; + credentials_provider_->GetToken([weak_this, initial_close_count]( + const StatusOr& maybe_token) { + auto strong_this = weak_this.lock(); + if (!strong_this) { + return; + } + + strong_this->worker_queue_->EnqueueRelaxed([maybe_token, weak_this, + initial_close_count] { + auto strong_this = weak_this.lock(); + // Streams can be stopped while waiting for authorization, so need + // to check the close count. + if (!strong_this || strong_this->close_count_ != initial_close_count) { + return; + } + strong_this->ResumeStartWithCredentials(maybe_token); + }); + }); +} + +void Stream::ResumeStartWithCredentials(const StatusOr& maybe_token) { + EnsureOnQueue(); + + HARD_ASSERT(state_ == State::Starting, + "State should still be 'Starting' (was %s)", state_); + + if (!maybe_token.ok()) { + OnStreamFinish(maybe_token.status()); + return; + } + + grpc_stream_ = CreateGrpcStream(grpc_connection_, maybe_token.ValueOrDie()); + grpc_stream_->Start(); +} + +void Stream::OnStreamStart() { + EnsureOnQueue(); + + state_ = State::Open; + NotifyStreamOpen(); +} + +// Backoff + +void Stream::BackoffAndTryRestarting() { + EnsureOnQueue(); + + LOG_DEBUG("%s backoff", GetDebugDescription()); + + HARD_ASSERT(state_ == State::Error, + "Should only perform backoff in an error case"); + + state_ = State::Backoff; + backoff_.BackoffAndRun([this] { + HARD_ASSERT(state_ == State::Backoff, + "Backoff elapsed but state is now: %s", state_); + + state_ = State::Initial; + Start(); + HARD_ASSERT(IsStarted(), "Stream should have started."); + }); +} + +void Stream::InhibitBackoff() { + EnsureOnQueue(); + + HARD_ASSERT(!IsStarted(), + "Can only cancel backoff in a stopped state (was %s)", state_); + + // Clear the error condition. + state_ = State::Initial; + backoff_.Reset(); +} + +// Idleness + +void Stream::MarkIdle() { + EnsureOnQueue(); + + if (IsOpen() && !idleness_timer_) { + idleness_timer_ = worker_queue_->EnqueueAfterDelay( + kIdleTimeout, idle_timer_id_, [this] { Stop(); }); + } +} + +void Stream::CancelIdleCheck() { + EnsureOnQueue(); + idleness_timer_.Cancel(); +} + +// Read/write + +void Stream::OnStreamRead(const grpc::ByteBuffer& message) { + EnsureOnQueue(); + + HARD_ASSERT(IsStarted(), "OnStreamRead called for a stopped stream."); + + if (LogIsDebugEnabled()) { + LOG_DEBUG("%s headers (whitelisted): %s", GetDebugDescription(), + Datastore::GetWhitelistedHeadersAsString( + grpc_stream_->GetResponseHeaders())); + } + + Status read_status = NotifyStreamResponse(message); + if (!read_status.ok()) { + grpc_stream_->FinishImmediately(); + // Don't expect gRPC to produce status -- since the error happened on the + // client, we have all the information we need. + OnStreamFinish(read_status); + return; + } +} + +// Stopping + +void Stream::Stop() { + EnsureOnQueue(); + LOG_DEBUG("%s stop", GetDebugDescription()); + + Close(Status::OK()); +} + +void Stream::Close(const Status& status) { + // This function ensures that both graceful stop and stop due to error go + // through the same sequence of steps. While it leads to more conditional + // logic, the benefit is reducing the chance of divergence across the two + // cases. + + EnsureOnQueue(); + bool graceful_stop = status.ok(); + + // Step 1 (both): check current state. + if (graceful_stop && !IsStarted()) { + // Graceful stop is idempotent. + return; + } + HARD_ASSERT(IsStarted(), "Trying to close a non-started stream"); + + // Step 2 (both): cancel any outstanding timers (they're guaranteed not to + // execute). + CancelIdleCheck(); + backoff_.Cancel(); + + // Step 3 (both): increment close count, which invalidates long-lived + // callbacks, guaranteeing they won't execute against a new instance of the + // stream or when the stream has been destroyed. + ++close_count_; + + // Step 4 (both): make small adjustments (to backoff/etc.) based on the + // status. + if (graceful_stop) { + // If this is an intentional close, ensure we don't delay our next + // connection attempt. + backoff_.Reset(); + } else { + HandleErrorStatus(status); + } + + // Step 5 (graceful stop only): give subclasses a chance to send final + // messages. + if (graceful_stop && grpc_stream_) { + // If the stream is in the auth stage, gRPC stream might not have been + // created yet. + LOG_DEBUG("%s Finishing gRPC stream", GetDebugDescription()); + TearDown(grpc_stream_.get()); + } + // Step 6 (both): destroy the underlying stream. + grpc_stream_.reset(); + + // Step 7 (both): update the state machine and notify the listener. + // State must be updated before calling the delegate. + state_ = graceful_stop ? State::Initial : State::Error; + NotifyStreamClose(status); +} + +void Stream::HandleErrorStatus(const Status& status) { + if (status.code() == Error::kErrorResourceExhausted) { + LOG_DEBUG( + "%s Using maximum backoff delay to prevent overloading the backend.", + GetDebugDescription()); + backoff_.ResetToMax(); + } else if (status.code() == Error::kErrorUnauthenticated) { + // "unauthenticated" error means the token was rejected. Try force + // refreshing it in case it just expired. + credentials_provider_->InvalidateToken(); + } +} + +void Stream::OnStreamFinish(const Status& status) { + EnsureOnQueue(); + + if (!status.ok()) { + LOG_WARN("%s Stream error: '%s'", GetDebugDescription(), status.ToString()); + } else { + LOG_DEBUG("%s Stream closing: '%s'", GetDebugDescription(), + status.ToString()); + } + + Close(status); +} + +// Protected helpers + +void Stream::EnsureOnQueue() const { + worker_queue_->VerifyIsCurrentQueue(); +} + +void Stream::Write(grpc::ByteBuffer&& message) { + EnsureOnQueue(); + + HARD_ASSERT(IsOpen(), "Cannot write when the stream is not open."); + + CancelIdleCheck(); + grpc_stream_->Write(std::move(message)); +} + +std::string Stream::GetDebugDescription() const { + EnsureOnQueue(); + return StringFormat("%s (%s)", GetDebugName(), this); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.h similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/stream.h index 60ae4704a..0d1edbbcf 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/stream.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/stream.h @@ -14,21 +14,21 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_STREAM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_STREAM_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_STREAM_H_ #include #include -#include "Firestore/core/src/firebase/firestore/auth/credentials_provider.h" -#include "Firestore/core/src/firebase/firestore/auth/token.h" -#include "Firestore/core/src/firebase/firestore/remote/exponential_backoff.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_completion.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_stream.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/auth/credentials_provider.h" +#include "Firestore/core/src/auth/token.h" +#include "Firestore/core/src/remote/exponential_backoff.h" +#include "Firestore/core/src/remote/grpc_completion.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/grpc_stream.h" +#include "Firestore/core/src/remote/remote_objc_bridge.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" #include "absl/strings/string_view.h" #include "grpcpp/support/byte_buffer.h" @@ -242,4 +242,4 @@ class Stream : public GrpcStreamObserver, } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_STREAM_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_STREAM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.cc new file mode 100644 index 000000000..7cdd9b896 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.cc @@ -0,0 +1,71 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/watch_change.h" + +#include "Firestore/core/src/util/hard_assert.h" + +namespace firebase { +namespace firestore { +namespace remote { + +namespace { + +template +bool Equals(const WatchChange& lhs, const WatchChange& rhs) { + return static_cast(lhs) == static_cast(rhs); +} + +} // namespace + +// Compares two `WatchChange`s taking into account their actual derived type. +bool operator==(const WatchChange& lhs, const WatchChange& rhs) { + if (lhs.type() != rhs.type()) { + return false; + } + + switch (lhs.type()) { + case WatchChange::Type::Document: + return Equals(lhs, rhs); + case WatchChange::Type::ExistenceFilter: + return Equals(lhs, rhs); + case WatchChange::Type::TargetChange: + return Equals(lhs, rhs); + } + UNREACHABLE(); +} + +bool operator==(const DocumentWatchChange& lhs, + const DocumentWatchChange& rhs) { + return lhs.updated_target_ids() == rhs.updated_target_ids() && + lhs.removed_target_ids() == rhs.removed_target_ids() && + lhs.document_key() == rhs.document_key() && + lhs.new_document() == rhs.new_document(); +} + +bool operator==(const ExistenceFilterWatchChange& lhs, + const ExistenceFilterWatchChange& rhs) { + return lhs.filter() == rhs.filter() && lhs.target_id() == rhs.target_id(); +} + +bool operator==(const WatchTargetChange& lhs, const WatchTargetChange& rhs) { + return lhs.state() == rhs.state() && lhs.target_ids() == rhs.target_ids() && + lhs.resume_token() == rhs.resume_token() && lhs.cause() == rhs.cause(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_change.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.h similarity index 90% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_change.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.h index 78cce7751..9061c20bf 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/watch_change.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_change.h @@ -14,18 +14,19 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WATCH_CHANGE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WATCH_CHANGE_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_WATCH_CHANGE_H_ +#define FIRESTORE_CORE_SRC_REMOTE_WATCH_CHANGE_H_ #include #include -#include "Firestore/core/src/firebase/firestore/model/document_key.h" -#include "Firestore/core/src/firebase/firestore/model/maybe_document.h" -#include "Firestore/core/src/firebase/firestore/model/types.h" -#include "Firestore/core/src/firebase/firestore/nanopb/byte_string.h" -#include "Firestore/core/src/firebase/firestore/remote/existence_filter.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/model/document_key.h" +#include "Firestore/core/src/model/maybe_document.h" +#include "Firestore/core/src/model/types.h" +#include "Firestore/core/src/nanopb/byte_string.h" +#include "Firestore/core/src/remote/existence_filter.h" +#include "Firestore/core/src/util/status.h" +#include "absl/types/optional.h" namespace firebase { namespace firestore { @@ -46,8 +47,7 @@ class WatchChange { TargetChange, }; - virtual ~WatchChange() { - } + virtual ~WatchChange() = default; virtual Type type() const = 0; }; @@ -216,4 +216,4 @@ bool operator==(const WatchTargetChange& lhs, const WatchTargetChange& rhs); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WATCH_CHANGE_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_WATCH_CHANGE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.cc new file mode 100644 index 000000000..3560abe73 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.cc @@ -0,0 +1,115 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/watch_stream.h" + +#include + +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/remote/grpc_nanopb.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using auth::CredentialsProvider; +using auth::Token; +using local::TargetData; +using model::TargetId; +using nanopb::Message; +using remote::ByteBufferReader; +using util::AsyncQueue; +using util::Status; +using util::TimerId; + +WatchStream::WatchStream( + const std::shared_ptr& async_queue, + std::shared_ptr credentials_provider, + Serializer serializer, + GrpcConnection* grpc_connection, + WatchStreamCallback* callback) + : Stream{async_queue, std::move(credentials_provider), grpc_connection, + TimerId::ListenStreamConnectionBackoff, TimerId::ListenStreamIdle}, + watch_serializer_{std::move(serializer)}, + callback_{NOT_NULL(callback)} { +} + +void WatchStream::WatchQuery(const TargetData& query) { + EnsureOnQueue(); + + auto request = watch_serializer_.EncodeWatchRequest(query); + LOG_DEBUG("%s watch: %s", GetDebugDescription(), request.ToString()); + Write(MakeByteBuffer(request)); +} + +void WatchStream::UnwatchTargetId(TargetId target_id) { + EnsureOnQueue(); + + auto request = watch_serializer_.EncodeUnwatchRequest(target_id); + + LOG_DEBUG("%s unwatch: %s", GetDebugDescription(), request.ToString()); + Write(MakeByteBuffer(request)); +} + +std::unique_ptr WatchStream::CreateGrpcStream( + GrpcConnection* grpc_connection, const Token& token) { + return grpc_connection->CreateStream("/google.firestore.v1.Firestore/Listen", + token, this); +} + +void WatchStream::TearDown(GrpcStream* grpc_stream) { + grpc_stream->FinishImmediately(); +} + +void WatchStream::NotifyStreamOpen() { + callback_->OnWatchStreamOpen(); +} + +Status WatchStream::NotifyStreamResponse(const grpc::ByteBuffer& message) { + ByteBufferReader reader{message}; + auto response = watch_serializer_.ParseResponse(&reader); + if (!reader.ok()) { + return reader.status(); + } + + LOG_DEBUG("%s response: %s", GetDebugDescription(), response.ToString()); + + // A successful response means the stream is healthy. + backoff_.Reset(); + + auto watch_change = watch_serializer_.DecodeWatchChange(&reader, *response); + auto version = watch_serializer_.DecodeSnapshotVersion(&reader, *response); + if (!reader.ok()) { + return reader.status(); + } + + callback_->OnWatchStreamChange(*watch_change, version); + + return Status::OK(); +} + +void WatchStream::NotifyStreamClose(const Status& status) { + callback_->OnWatchStreamClose(status); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.h new file mode 100644 index 000000000..c43fd06a5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/watch_stream.h @@ -0,0 +1,129 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_REMOTE_WATCH_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_WATCH_STREAM_H_ + +#include +#include + +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/remote_objc_bridge.h" +#include "Firestore/core/src/remote/stream.h" +#include "Firestore/core/src/remote/watch_change.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/strings/string_view.h" +#include "grpcpp/support/byte_buffer.h" + +namespace firebase { +namespace firestore { + +namespace local { +class TargetData; +} // namespace local + +namespace remote { + +class Serializer; + +/** + * An interface defining the events that can be emitted by the `WatchStream`. + */ +class WatchStreamCallback { + public: + virtual ~WatchStreamCallback() = default; + + /** + * Called by the `WatchStream` when it is ready to accept outbound request + * messages. + */ + virtual void OnWatchStreamOpen() = 0; + + /** + * Called by the `WatchStream` with changes and the snapshot versions + * included in in the `WatchChange` responses sent back by the server. + */ + virtual void OnWatchStreamChange( + const WatchChange& change, + const model::SnapshotVersion& snapshot_version) = 0; + + /** + * Called by the `WatchStream` when the underlying streaming RPC is + * interrupted for whatever reason, usually because of an error, but possibly + * due to an idle timeout. The status passed to this method may be ok, in + * which case the stream was closed without attributable fault. + * + * NOTE: This will not be called after `Stop` is called on the stream. See + * "Starting and Stopping" on `Stream` for details. + */ + virtual void OnWatchStreamClose(const util::Status& status) = 0; +}; + +/** + * A `Stream` that implements the StreamingWatch RPC. + * + * Once the `WatchStream` has called the `OnWatchStreamOpen` method on the + * callback, any number of `WatchQuery` and `UnwatchTargetId` calls can be sent + * to control what changes will be sent from the server for WatchChanges. + */ +class WatchStream : public Stream { + public: + WatchStream(const std::shared_ptr& async_queue, + std::shared_ptr credentials_provider, + Serializer serializer, + GrpcConnection* grpc_connection, + WatchStreamCallback* callback); + + /** + * Registers interest in the results of the given query. If the query includes + * a resume token, it will be included in the request. Results that affect the + * query will be streamed back as WatchChange messages that reference the + * target ID included in `query`. + */ + virtual /*virtual for tests only*/ void WatchQuery( + const local::TargetData& query); + + /** + * Unregisters interest in the results of the query associated with the given + * `target_id`. + */ + virtual /*virtual for tests only*/ void UnwatchTargetId( + model::TargetId target_id); + + private: + std::unique_ptr CreateGrpcStream( + GrpcConnection* grpc_connection, const auth::Token& token) override; + void TearDown(GrpcStream* grpc_stream) override; + + void NotifyStreamOpen() override; + util::Status NotifyStreamResponse(const grpc::ByteBuffer& message) override; + void NotifyStreamClose(const util::Status& status) override; + + std::string GetDebugName() const override { + return "WatchStream"; + } + + WatchStreamSerializer watch_serializer_; + WatchStreamCallback* callback_; +}; + +} // namespace remote +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_REMOTE_WATCH_STREAM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc b/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc new file mode 100644 index 000000000..1a1839005 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.cc @@ -0,0 +1,157 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/remote/write_stream.h" + +#include + +#include "Firestore/core/src/model/mutation.h" +#include "Firestore/core/src/nanopb/message.h" +#include "Firestore/core/src/nanopb/reader.h" +#include "Firestore/core/src/remote/grpc_nanopb.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/status.h" + +namespace firebase { +namespace firestore { +namespace remote { + +using auth::CredentialsProvider; +using auth::Token; +using model::Mutation; +using nanopb::ByteString; +using nanopb::Message; +using remote::ByteBufferReader; +using util::AsyncQueue; +using util::Status; +using util::TimerId; + +WriteStream::WriteStream( + const std::shared_ptr& async_queue, + std::shared_ptr credentials_provider, + Serializer serializer, + GrpcConnection* grpc_connection, + WriteStreamCallback* callback) + : Stream{async_queue, std::move(credentials_provider), grpc_connection, + TimerId::WriteStreamConnectionBackoff, TimerId::WriteStreamIdle}, + write_serializer_{std::move(serializer)}, + callback_{NOT_NULL(callback)} { +} + +void WriteStream::set_last_stream_token(ByteString token) { + last_stream_token_ = std::move(token); +} + +const ByteString& WriteStream::last_stream_token() const { + return last_stream_token_; +} + +void WriteStream::WriteHandshake() { + EnsureOnQueue(); + HARD_ASSERT(IsOpen(), "Writing handshake requires an opened stream"); + HARD_ASSERT(!handshake_complete(), "Handshake already completed"); + + auto request = write_serializer_.EncodeHandshake(); + LOG_DEBUG("%s initial request: %s", GetDebugDescription(), + request.ToString()); + Write(MakeByteBuffer(request)); + + // TODO(dimond): Support stream resumption. We intentionally do not set the + // stream token on the handshake, ignoring any stream token we might have. +} + +void WriteStream::WriteMutations(const std::vector& mutations) { + EnsureOnQueue(); + HARD_ASSERT(IsOpen(), "Writing mutations requires an opened stream"); + HARD_ASSERT(handshake_complete(), + "Handshake must be complete before writing mutations"); + + auto request = write_serializer_.EncodeWriteMutationsRequest( + mutations, last_stream_token()); + LOG_DEBUG("%s write request: %s", GetDebugDescription(), request.ToString()); + Write(MakeByteBuffer(request)); +} + +std::unique_ptr WriteStream::CreateGrpcStream( + GrpcConnection* grpc_connection, const Token& token) { + return grpc_connection->CreateStream("/google.firestore.v1.Firestore/Write", + token, this); +} + +void WriteStream::TearDown(GrpcStream* grpc_stream) { + if (handshake_complete()) { + // Send an empty write request to the backend to indicate imminent stream + // closure. This isn't mandatory, but it allows the backend to clean up + // resources. + auto request = + write_serializer_.EncodeEmptyMutationsList(last_stream_token()); + grpc_stream->WriteAndFinish(MakeByteBuffer(request)); + } else { + grpc_stream->FinishImmediately(); + } +} + +void WriteStream::NotifyStreamOpen() { + callback_->OnWriteStreamOpen(); +} + +void WriteStream::NotifyStreamClose(const Status& status) { + callback_->OnWriteStreamClose(status); + // Delegate's logic might depend on whether handshake was completed, so only + // reset it after notifying. + handshake_complete_ = false; +} + +Status WriteStream::NotifyStreamResponse(const grpc::ByteBuffer& message) { + ByteBufferReader reader{message}; + Message response = + write_serializer_.ParseResponse(&reader); + if (!reader.ok()) { + return reader.status(); + } + + LOG_DEBUG("%s response: %s", GetDebugDescription(), response.ToString()); + + // Always capture the last stream token. + set_last_stream_token(ByteString::Take(response->stream_token)); + response->stream_token = nullptr; + + if (!handshake_complete()) { + // The first response is the handshake response + handshake_complete_ = true; + callback_->OnWriteStreamHandshakeComplete(); + } else { + // A successful first write response means the stream is healthy. + // Note that we could consider a successful handshake healthy, however, the + // write itself might be causing an error we want to back off from. + backoff_.Reset(); + + auto version = write_serializer_.DecodeCommitVersion(&reader, *response); + auto results = write_serializer_.DecodeMutationResults(&reader, *response); + if (!reader.ok()) { + return reader.status(); + } + + callback_->OnWriteStreamMutationResult(version, results); + } + + return Status::OK(); +} + +} // namespace remote +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/write_stream.h b/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/write_stream.h rename to Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.h index 4f8be832a..53a19b41e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/remote/write_stream.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/remote/write_stream.h @@ -14,35 +14,32 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WRITE_STREAM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WRITE_STREAM_H_ +#ifndef FIRESTORE_CORE_SRC_REMOTE_WRITE_STREAM_H_ +#define FIRESTORE_CORE_SRC_REMOTE_WRITE_STREAM_H_ -#if !defined(__OBJC__) -#error "This header only supports Objective-C++" -#endif // !defined(__OBJC__) - -#import #include #include #include -#include "Firestore/core/src/firebase/firestore/model/snapshot_version.h" -#include "Firestore/core/src/firebase/firestore/remote/grpc_connection.h" -#include "Firestore/core/src/firebase/firestore/remote/remote_objc_bridge.h" -#include "Firestore/core/src/firebase/firestore/remote/stream.h" -#include "Firestore/core/src/firebase/firestore/util/async_queue.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/model/model_fwd.h" +#include "Firestore/core/src/remote/grpc_connection.h" +#include "Firestore/core/src/remote/remote_objc_bridge.h" +#include "Firestore/core/src/remote/stream.h" +#include "Firestore/core/src/util/async_queue.h" +#include "Firestore/core/src/util/status_fwd.h" #include "absl/strings/string_view.h" #include "grpcpp/support/byte_buffer.h" -#import "Firestore/Source/Remote/FSTSerializerBeta.h" - namespace firebase { namespace firestore { namespace remote { +class Serializer; + class WriteStreamCallback { public: + virtual ~WriteStreamCallback() = default; + /** * Called by the `WriteStream` when it is ready to accept outbound request * messages. @@ -97,11 +94,11 @@ class WriteStream : public Stream { public: WriteStream(const std::shared_ptr& async_queue, std::shared_ptr credentials_provider, - FSTSerializerBeta* serializer, + Serializer serializer, GrpcConnection* grpc_connection, WriteStreamCallback* callback); - void SetLastStreamToken(const nanopb::ByteString& token); + void set_last_stream_token(nanopb::ByteString token); /** * The last received stream token from the server, used to acknowledge which * responses the client has processed. Stream tokens are opaque checkpoint @@ -110,7 +107,7 @@ class WriteStream : public Stream { * `WriteStream` manages propagating this value from responses to the * next request. */ - nanopb::ByteString GetLastStreamToken() const; + const nanopb::ByteString& last_stream_token() const; /** * Tracks whether or not a handshake has been successfully exchanged and @@ -148,13 +145,14 @@ class WriteStream : public Stream { return "WriteStream"; } - bridge::WriteStreamSerializer serializer_bridge_; + WriteStreamSerializer write_serializer_; WriteStreamCallback* callback_ = nullptr; bool handshake_complete_ = false; + nanopb::ByteString last_stream_token_; }; } // namespace remote } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_REMOTE_WRITE_STREAM_H_ +#endif // FIRESTORE_CORE_SRC_REMOTE_WRITE_STREAM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp.cc b/Pods/FirebaseFirestore/Firestore/core/src/timestamp.cc similarity index 98% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp.cc rename to Pods/FirebaseFirestore/Firestore/core/src/timestamp.cc index 2ba3d88e9..7fed1e1cc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/timestamp.cc @@ -24,7 +24,7 @@ #include #endif -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/strings/str_cat.h" namespace firebase { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp_internal.cc b/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp_internal.cc rename to Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.cc index 478498b6e..bc2c31939 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp_internal.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/timestamp_internal.h" +#include "Firestore/core/src/timestamp_internal.h" -#include "Firestore/core/src/firebase/firestore/util/hashing.h" +#include "Firestore/core/src/util/hashing.h" namespace util = firebase::firestore::util; diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp_internal.h b/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.h similarity index 87% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp_internal.h rename to Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.h index 3130ccd41..d006049cc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/timestamp_internal.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/timestamp_internal.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_TIMESTAMP_INTERNAL_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_TIMESTAMP_INTERNAL_H_ +#ifndef FIRESTORE_CORE_SRC_TIMESTAMP_INTERNAL_H_ +#define FIRESTORE_CORE_SRC_TIMESTAMP_INTERNAL_H_ #include "Firestore/core/include/firebase/firestore/timestamp.h" @@ -54,4 +54,4 @@ class TimestampInternal { } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_TIMESTAMP_INTERNAL_H_ +#endif // FIRESTORE_CORE_SRC_TIMESTAMP_INTERNAL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc new file mode 100644 index 000000000..03a34ba5c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.cc @@ -0,0 +1,201 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/async_queue.h" + +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/task.h" +#include "absl/algorithm/container.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace util { + +std::shared_ptr AsyncQueue::Create( + std::unique_ptr executor) { + // Use new because make_shared cannot access a private constructor. + auto queue = new AsyncQueue(std::move(executor)); + return std::shared_ptr(queue); +} + +AsyncQueue::AsyncQueue(std::unique_ptr executor) + : executor_{std::move(executor)} { + is_operation_in_progress_ = false; +} + +AsyncQueue::~AsyncQueue() { + Dispose(); +} + +void AsyncQueue::EnterRestrictedMode() { + std::lock_guard lock(mutex_); + VerifySequentialOrder(); + if (mode_ == Mode::kDisposed) return; + + mode_ = Mode::kRestricted; +} + +void AsyncQueue::Dispose() { + { + std::lock_guard lock(mutex_); + mode_ = Mode::kDisposed; + } + + executor_->Dispose(); +} + +void AsyncQueue::VerifyIsCurrentExecutor() const { + HARD_ASSERT( + executor_->IsCurrentExecutor(), + "Expected to be called by the executor associated with this queue " + "(expected executor: '%s', actual executor: '%s')", + executor_->Name(), executor_->CurrentExecutorName()); +} + +void AsyncQueue::VerifyIsCurrentQueue() const { + VerifyIsCurrentExecutor(); + HARD_ASSERT(is_operation_in_progress_, + "VerifyIsCurrentQueue called when no operation is executing " + "(expected executor: '%s', actual executor: '%s')", + executor_->Name(), executor_->CurrentExecutorName()); +} + +void AsyncQueue::ExecuteBlocking(const Operation& operation) { + // This is not guarded by `is_shutting_down_` because it is the execution + // of the operation, not scheduling. Checking `is_shutting_down_` here + // would mean *all* operations will not run after shutdown, which is not + // intended. + VerifyIsCurrentExecutor(); + HARD_ASSERT(!is_operation_in_progress_, + "ExecuteBlocking may not be called " + "before the previous operation finishes executing"); + + is_operation_in_progress_ = true; + operation(); + is_operation_in_progress_ = false; +} + +bool AsyncQueue::Enqueue(const Operation& operation) { + VerifySequentialOrder(); + return EnqueueRelaxed(operation); +} + +bool AsyncQueue::EnqueueEvenWhileRestricted(const Operation& operation) { + // Still guarding the lock to ensure sequential scheduling. + std::lock_guard lock(mutex_); + VerifySequentialOrder(); + if (mode_ == Mode::kDisposed) return false; + + executor_->Execute(Wrap(operation)); + return true; +} + +bool AsyncQueue::is_running() const { + std::lock_guard lock(mutex_); + return mode_ == Mode::kRunning; +} + +bool AsyncQueue::EnqueueRelaxed(const Operation& operation) { + std::lock_guard lock(mutex_); + if (mode_ != Mode::kRunning) return false; + + executor_->Execute(Wrap(operation)); + return true; +} + +DelayedOperation AsyncQueue::EnqueueAfterDelay(Milliseconds delay, + const TimerId timer_id, + const Operation& operation) { + std::lock_guard lock(mutex_); + VerifyIsCurrentExecutor(); + + if (mode_ != Mode::kRunning) { + return DelayedOperation(); + } + + // Skip delays for timer_ids that have been overridden + if (absl::c_linear_search(timer_ids_to_skip_, timer_id)) { + delay = Milliseconds(0); + } + + auto tag = static_cast(timer_id); + return executor_->Schedule(delay, tag, Wrap(operation)); +} + +AsyncQueue::Operation AsyncQueue::Wrap(const Operation& operation) { + // Decorator pattern: wrap `operation` into a call to `ExecuteBlocking` to + // ensure that it doesn't spawn any nested operations. + + // The Executor guarantees that this operation will either execute before + // `Dispose` completes or not at all. + return [this, operation] { this->ExecuteBlocking(operation); }; +} + +void AsyncQueue::VerifySequentialOrder() const { + // This is the inverse of `VerifyIsCurrentQueue`. + HARD_ASSERT(!is_operation_in_progress_ || !executor_->IsCurrentExecutor(), + "Enqueue methods cannot be called when we are already running on " + "target executor " + "(this queue's executor: '%s', current executor: '%s')", + executor_->Name(), executor_->CurrentExecutorName()); +} + +// Test-only functions + +void AsyncQueue::EnqueueBlocking(const Operation& operation) { + VerifySequentialOrder(); + executor_->ExecuteBlocking(Wrap(operation)); +} + +bool AsyncQueue::IsScheduled(const TimerId timer_id) const { + return executor_->IsTagScheduled(static_cast(timer_id)); +} + +void AsyncQueue::RunScheduledOperationsUntil(const TimerId last_timer_id) { + HARD_ASSERT(!executor_->IsCurrentExecutor(), + "RunScheduledOperationsUntil must not be called on the queue"); + + executor_->ExecuteBlocking([this, last_timer_id] { + HARD_ASSERT( + last_timer_id == TimerId::All || IsScheduled(last_timer_id), + "Attempted to run scheduled operations until missing timer id: %s", + last_timer_id); + + for (auto* next = executor_->PopFromSchedule(); next != nullptr; + next = executor_->PopFromSchedule()) { + // `ExecuteAndRelease` can delete the `Task` so read the tag first. + bool found_tag = next->tag() == static_cast(last_timer_id); + + next->ExecuteAndRelease(); + if (found_tag) { + break; + } + } + }); +} + +void AsyncQueue::SkipDelaysForTimerId(TimerId timer_id) { + std::lock_guard lock(mutex_); + + timer_ids_to_skip_.push_back(timer_id); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.h new file mode 100644 index 000000000..fd4dfa0a3 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/async_queue.h @@ -0,0 +1,246 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_ASYNC_QUEUE_H_ +#define FIRESTORE_CORE_SRC_UTIL_ASYNC_QUEUE_H_ + +#include +#include // NOLINT(build/c++11) +#include +#include +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/util/executor.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Well-known "timer" ids used when scheduling delayed operations on the + * AsyncQueue. These ids can then be used from tests to check for the + * presence of delayed operations or to run them early. + */ +enum class TimerId { + /** All can be used with `RunScheduledOperationsUntil` to run all timers. */ + All, + + /** + * The following 4 timers are used in `Stream` for the listen and write + * streams. The "Idle" timer is used to close the stream due to inactivity. + * The "ConnectionBackoff" timer is used to restart a stream once the + * appropriate backoff delay has elapsed. + */ + ListenStreamIdle, + ListenStreamConnectionBackoff, + WriteStreamIdle, + WriteStreamConnectionBackoff, + + /** + * A timer used in `OnlineStateTracker` to transition from + * `OnlineStateUnknown` to `Offline` after a set timeout, rather than waiting + * indefinitely for success or failure. + */ + OnlineStateTimeout, + + /** + * A timer used to periodically attempt LRU Garbage collection + */ + GarbageCollectionDelay, + + /** + * A timer used to retry transactions. Since there can be multiple concurrent + * transactions, multiple of these may be in the queue at a given time. + */ + RetryTransaction +}; + +// A serial queue that executes given operations asynchronously, one at a time. +// Operations may be scheduled to be executed as soon as possible or in the +// future. Operations scheduled for the same time are FIFO-ordered. +// +// `AsyncQueue` wraps a platform-specific executor, adding checks that enforce +// sequential ordering of operations: an enqueued operation, while being run, +// normally cannot enqueue other operations for immediate execution (but see +// `EnqueueRelaxed`). +// +// `AsyncQueue` methods have particular expectations about whether they must be +// invoked on the queue or not; check "preconditions" section in comments on +// each method. +// +// A significant portion of `AsyncQueue` interface only exists for test purposes +// and must *not* be used in regular code. +class AsyncQueue : public std::enable_shared_from_this { + public: + using Operation = Executor::Operation; + using Milliseconds = Executor::Milliseconds; + + enum class Mode { + /** + * The default mode of an `AsyncQueue` after creation. All tasks are + * allowed. + */ + kRunning, + + /** + * The `AsyncQueue` enters `Mode::kRestricted` after the a user terminates + * an instance of Firestore. In this mode, most tasks are not allowed: only + * a limited set of special operations are still allowed to run. + */ + kRestricted, + + /** + * Finally, once the Firestore instance is in the process of being + * destroyed, the `AsyncQueue` stops accepting all tasks. + */ + kDisposed, + }; + + static std::shared_ptr Create(std::unique_ptr executor); + + ~AsyncQueue(); + + // Puts the `AsyncQueue` into restricted mode, where calling most Enqueue* + // methods becomes a no-op. The exception is `EnqueueEvenWhileRestricted`, + // which still enqueues operations even while in restricted mode. + void EnterRestrictedMode(); + + // Disposes of the `AsyncQueue` and synchronously waits for any currently + // executing tasks to complete. Queued operations that have not started + // executing and all scheduled operations are discarded. As soon as Dispose + // begins, all Enqueue* operations become no-ops without exception. + void Dispose(); + + // Asserts for the caller that it is being invoked as part of an operation on + // the `AsyncQueue`. + void VerifyIsCurrentQueue() const; + + // Enqueue methods + + // Puts the `operation` on the queue to be executed as soon as possible, while + // maintaining FIFO order. + // + // Precondition: `Enqueue` calls cannot be nested; that is, `Enqueue` may not + // be called by a previously enqueued operation when it is run (as a special + // case, destructors invoked when an enqueued operation has run and is being + // destroyed may invoke `Enqueue`). + // + // After the shutdown process has initiated (`is_running()` is false), calling + // `Enqueue` is a no-op. + // + // @return true if the operation was successfully enqueued or false if the + // operation was not enqueued because the `AsyncQueue` has already entered + // restricted mode or been disposed. + bool Enqueue(const Operation& operation); + + // Like `Enqueue`, but it will proceed scheduling the requested operation + // regardless of whether the queue is in restricted mode or not. + // + // @return true if the operation was successfully enqueued or false if the + // operation was not enqueued because the `AsyncQueue` has already been + // disposed. + bool EnqueueEvenWhileRestricted(const Operation& operation); + + // Like `Enqueue`, but without applying any prerequisite checks. + bool EnqueueRelaxed(const Operation& operation); + + // Returns true if the queue is still in the main kRunning mode (i.e. not + // restricted or disposed). + bool is_running() const; + + // Puts the `operation` on the queue to be executed `delay` milliseconds from + // now, and returns a handle that allows to cancel the operation (provided it + // hasn't run already). + // + // `operation` is tagged by a `timer_id` which allows to identify the caller. + // Only one operation tagged with any given `timer_id` may be on the queue at + // any time; an attempt to put another such operation will result in an + // assertion failure. In tests, these tags also allow to check for presence of + // certain operations and to run certain operations in advance. + // + // Precondition: `EnqueueAfterDelay` is being invoked asynchronously on the + // queue. + DelayedOperation EnqueueAfterDelay(Milliseconds delay, + TimerId timer_id, + const Operation& operation); + + // Direct execution + + // Immediately executes the `operation` on the queue. + // + // This is largely a workaround to allow other classes (GRPC) to directly + // access the underlying dispatch queue without getting `AsyncQueue` into an + // inconsistent state. + // + // Precondition: no other operation is being executed on the queue at the + // moment of the call (i.e., `ExecuteBlocking` cannot call `ExecuteBlocking`). + // + // Precondition: `ExecuteBlocking` is being invoked asynchronously on the + // queue. + void ExecuteBlocking(const Operation& operation); + + // Returns the underlying platform-dependent executor. + Executor* executor() { + return executor_.get(); + } + + // Test-only interface follows + // TODO(varconst): move the test-only interface into a helper object that is + // a friend of AsyncQueue and delegates its public methods to private methods + // on AsyncQueue. + + // Like `Enqueue`, but blocks until the `operation` is complete. + void EnqueueBlocking(const Operation& operation); + + // Checks whether an operation tagged with `timer_id` is currently scheduled + // for execution in the future. + bool IsScheduled(TimerId timer_id) const; + + // Force runs operations scheduled for future execution, in scheduled order, + // up to *and including* the operation tagged with `last_timer_id`. + // + // Precondition: `RunScheduledOperationsUntil` is *not* being invoked on the + // queue. + void RunScheduledOperationsUntil(TimerId last_timer_id); + + // For tests: Skip all subsequent delays for a specific TimerId. + // NOTE: This does not work with TimerId::All. + void SkipDelaysForTimerId(TimerId timer_id); + + private: + explicit AsyncQueue(std::unique_ptr executor); + + Operation Wrap(const Operation& operation); + + // Asserts that the current invocation happens asynchronously on the queue. + void VerifyIsCurrentExecutor() const; + void VerifySequentialOrder() const; + + std::atomic is_operation_in_progress_; + std::unique_ptr executor_; + + mutable std::mutex mutex_; + Mode mode_ = Mode::kRunning; + + std::vector timer_ids_to_skip_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_ASYNC_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/autoid.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.cc similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/autoid.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/autoid.cc index 10a2cde13..54326db1a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/autoid.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/autoid.h" +#include "Firestore/core/src/util/autoid.h" #include #include -#include "Firestore/core/src/firebase/firestore/util/secure_random.h" +#include "Firestore/core/src/util/secure_random.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/autoid.h b/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.h similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/autoid.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/autoid.h index 22d7d7d40..d7b63d2c5 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/autoid.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/autoid.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_AUTOID_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_AUTOID_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_AUTOID_H_ +#define FIRESTORE_CORE_SRC_UTIL_AUTOID_H_ #include @@ -30,4 +30,4 @@ std::string CreateAutoId(); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_AUTOID_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_AUTOID_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.cc new file mode 100644 index 000000000..d2b2becb5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.cc @@ -0,0 +1,52 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/background_queue.h" + +#include "Firestore/core/src/util/executor.h" + +namespace firebase { +namespace firestore { +namespace util { + +BackgroundQueue::BackgroundQueue(Executor* executor) : executor_(executor) { +} + +void BackgroundQueue::Execute(std::function&& operation) { + { + std::lock_guard lock(mutex_); + pending_tasks_ += 1; + } + + executor_->Execute([this, operation]() { + operation(); + + std::lock_guard lock(mutex_); + pending_tasks_ -= 1; + if (pending_tasks_ == 0) { + done_.notify_all(); + } + }); +} + +void BackgroundQueue::AwaitAll() { + std::unique_lock lock(mutex_); + done_.wait(lock, [this] { return pending_tasks_ == 0; }); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.h b/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.h new file mode 100644 index 000000000..1f2607723 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/background_queue.h @@ -0,0 +1,57 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_BACKGROUND_QUEUE_H_ +#define FIRESTORE_CORE_SRC_UTIL_BACKGROUND_QUEUE_H_ + +#include // NOLINT(build/c++11) +#include +#include // NOLINT(build/c++11) + +namespace firebase { +namespace firestore { +namespace util { + +class Executor; + +/** + * A simple queue that executes tasks in parallel on an Executor and supports + * blocking on their completion. + * + * This class is thread-safe. + */ +class BackgroundQueue { + public: + explicit BackgroundQueue(Executor* executor); + + /** Enqueue a task on the Executor. */ + void Execute(std::function&& operation); + + /** Wait for all currently scheduled tasks to complete. */ + void AwaitAll(); + + private: + Executor* executor_ = nullptr; + int pending_tasks_ = 0; + std::mutex mutex_; + std::condition_variable done_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_BACKGROUND_QUEUE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/bits.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/bits.cc similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/bits.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/bits.cc index 03d9b77d7..5c5e9889c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/bits.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/bits.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/bits.h" +#include "Firestore/core/src/util/bits.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/bits.h b/Pods/FirebaseFirestore/Firestore/core/src/util/bits.h new file mode 100644 index 000000000..3346f62b5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/bits.h @@ -0,0 +1,184 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_BITS_H_ +#define FIRESTORE_CORE_SRC_UTIL_BITS_H_ + +// Various bit-twiddling functions, all of which are static members of the Bits +// class (making it effectively a namespace). Operands are unsigned integers. +// Munging bits in _signed_ integers is fraught with peril! For example, +// -5 << n has undefined behavior (for some values of n). + +#include + +#if _MSC_VER +// The Microsoft implementation of iso646.h defines alternative operator names +// as macros and this interferes with the inline assembly, below, which uses the +// `and` and `xor` instructions. Defining these as macros is conforming behavior +// for C but not C++, where these are keywords. +// +// Unfortunately, fixing this by undefining the macros can't be enabled +// everywhere because other compilers (e.g. Clang) specifically prevent the use +// of these keywords as macro names. +#ifdef and +#undef and +#endif + +#ifdef xor +#undef xor +#endif +#endif // _MSC_VER + +namespace firebase { +namespace firestore { +namespace util { + +class Bits_Port32_Test; +class Bits_Port64_Test; + +class Bits { + public: + /** Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0. */ + static int Log2Floor(uint32_t n); + static int Log2Floor64(uint64_t n); + + /** + * Potentially faster version of Log2Floor() that returns an + * undefined value if n == 0. + */ + static int Log2FloorNonZero(uint32_t n); + static int Log2FloorNonZero64(uint64_t n); + + private: + // Portable implementations. + static int Log2Floor_Portable(uint32_t n); + static int Log2Floor64_Portable(uint64_t n); + static int Log2FloorNonZero_Portable(uint32_t n); + static int Log2FloorNonZero64_Portable(uint64_t n); + + Bits(Bits const&) = delete; + void operator=(Bits const&) = delete; + + // Allow tests to call _Portable variants directly. + friend class Bits_Port32_Test; + friend class Bits_Port64_Test; +}; + +// ------------------------------------------------------------------------ +// Implementation details follow +// ------------------------------------------------------------------------ + +#if defined(__GNUC__) + +inline int Bits::Log2Floor(uint32_t n) { + return n == 0 ? -1 : 31 ^ __builtin_clz(n); +} + +inline int Bits::Log2FloorNonZero(uint32_t n) { + return 31 ^ __builtin_clz(n); +} + +inline int Bits::Log2Floor64(uint64_t n) { + return n == 0 ? -1 : 63 ^ __builtin_clzll(n); +} + +inline int Bits::Log2FloorNonZero64(uint64_t n) { + return 63 ^ __builtin_clzll(n); +} + +#elif defined(_MSC_VER) + +inline int Bits::Log2FloorNonZero(uint32_t n) { +#ifdef _M_IX86 + _asm { + bsr ebx, n + mov n, ebx + } + return n; +#else + return Bits::Log2FloorNonZero_Portable(n); +#endif +} + +inline int Bits::Log2Floor(uint32_t n) { +#ifdef _M_IX86 + _asm { + xor ebx, ebx + mov eax, n + and eax, eax + jz return_ebx + bsr ebx, eax + return_ebx: + mov n, ebx + } + return n; +#else + return Bits::Log2Floor_Portable(n); +#endif +} + +inline int Bits::Log2Floor64(uint64_t n) { + return Bits::Log2Floor64_Portable(n); +} + +inline int Bits::Log2FloorNonZero64(uint64_t n) { + return Bits::Log2FloorNonZero64_Portable(n); +} + +#else // !__GNUC__ && !_MSC_VER + +inline int Bits::Log2Floor64(uint64_t n) { + return Bits::Log2Floor64_Portable(n); +} + +inline int Bits::Log2FloorNonZero64(uint64_t n) { + return Bits::Log2FloorNonZero64_Portable(n); +} + +#endif + +inline int Bits::Log2FloorNonZero_Portable(uint32_t n) { + // Just use the common routine + return Log2Floor(n); +} + +// Log2Floor64() is defined in terms of Log2Floor32(), Log2FloorNonZero32() +inline int Bits::Log2Floor64_Portable(uint64_t n) { + const auto top_bits = static_cast(n >> 32); + if (top_bits == 0) { + // Top bits are zero, so scan in bottom bits + return Log2Floor(static_cast(n)); + } else { + return 32 + Log2FloorNonZero(top_bits); + } +} + +// Log2FloorNonZero64() is defined in terms of Log2FloorNonZero32() +inline int Bits::Log2FloorNonZero64_Portable(uint64_t n) { + const auto top_bits = static_cast(n >> 32); + if (top_bits == 0) { + // Top bits are zero, so scan in bottom bits + return Log2FloorNonZero(static_cast(n)); + } else { + return 32 + Log2FloorNonZero(top_bits); + } +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_BITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/comparison.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.cc similarity index 98% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/comparison.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/comparison.cc index e0bba2c01..799bcb81f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/comparison.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/comparison.h" +#include "Firestore/core/src/util/comparison.h" #include #include diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/comparison.h b/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/comparison.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/comparison.h index 67b81a907..c256f94cc 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/comparison.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/comparison.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_COMPARISON_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_COMPARISON_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_COMPARISON_H_ +#define FIRESTORE_CORE_SRC_UTIL_COMPARISON_H_ #if __OBJC__ #import @@ -29,8 +29,6 @@ #include #include -#include "Firestore/core/src/firebase/firestore/objc/objc_type_traits.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" #include "absl/meta/type_traits.h" #include "absl/strings/string_view.h" @@ -149,21 +147,19 @@ struct Comparator { template <> struct Comparator { + Comparator() = default; + // GCC 4.8.5 has trouble implicitly generating copy operations (`=default` + // doesn't work as well). + Comparator(const Comparator&) { + } + Comparator& operator=(const Comparator&) { + return *this; + } + ComparisonResult Compare(const std::string& left, const std::string& right) const; }; -#if __OBJC__ -template <> -struct Comparator { - ComparisonResult Compare(NSString* left, NSString* right) const { - // Delegate to the string_view implementation so these are consistent. - Comparator delegate; - return delegate.Compare(MakeString(left), MakeString(right)); - } -}; -#endif // __OBJC__ - /** Compares two bools: false < true. */ template <> struct Comparator : public DefaultComparator {}; @@ -233,15 +229,6 @@ struct CompareChoice : CompareChoice {}; template <> struct CompareChoice<2> {}; -#if __OBJC__ -// For Objective-C pointer types, use the Objective-C -compare: method. -template ::value>> -ComparisonResult CompareImpl(T* lhs, T* rhs, CompareChoice<0>) { - return MakeComparisonResult([lhs compare:rhs]); -} -#endif // __OBJC__ - // Use a `CompareTo` member, if available template ::value>> ComparisonResult CompareImpl(const T& lhs, const T& rhs, CompareChoice<1>) { @@ -353,8 +340,35 @@ class Comparable { } }; +/** + * Same as `Comparable`, but deliberately not defining `operator==`, which + * instead is left for the class inheriting from this mixin to implement. This + * is an optimization that avoids doing an extra comparison when comparing for + * equality (`Comparable` would have to check for both "less-than" and + * "greater-than" to determine whether two values are equal). + */ +template +class InequalityComparable { + public: + friend bool operator!=(const T& lhs, const T& rhs) { + return !(lhs == rhs); + } + friend bool operator<(const T& lhs, const T& rhs) { + return Ascending(lhs.CompareTo(rhs)); + } + friend bool operator>(const T& lhs, const T& rhs) { + return Descending(lhs.CompareTo(rhs)); + } + friend bool operator<=(const T& lhs, const T& rhs) { + return !(rhs < lhs); + } + friend bool operator>=(const T& lhs, const T& rhs) { + return !(lhs < rhs); + } +}; + } // namespace util } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_COMPARISON_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_COMPARISON_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/compressed_member.h b/Pods/FirebaseFirestore/Firestore/core/src/util/compressed_member.h similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/compressed_member.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/compressed_member.h index 916b6b347..20bdad34a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/compressed_member.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/compressed_member.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_COMPRESSED_MEMBER_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_COMPRESSED_MEMBER_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_COMPRESSED_MEMBER_H_ +#define FIRESTORE_CORE_SRC_UTIL_COMPRESSED_MEMBER_H_ #include #include @@ -76,4 +76,4 @@ class CompressedMember { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_COMPRESSED_MEMBER_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_COMPRESSED_MEMBER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/config.h b/Pods/FirebaseFirestore/Firestore/core/src/util/config.h new file mode 100644 index 000000000..a03227b70 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/config.h @@ -0,0 +1,57 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_CONFIG_H_ +#define FIRESTORE_CORE_SRC_UTIL_CONFIG_H_ + +// This header provides static definitions of platform configuration values for +// build systems that cannot auto-detect their current configuration. This +// includes both CocoaPods and Swift Package Manager. +// +// CMake builds are not handled here. See `config_detected.h.in` for the +// template used by CMake when detecting the availability of platform features. + +#if defined(__has_include) +#if __has_include("Firestore/core/src/util/config_detected.h") +#define FIRESTORE_HAVE_CONFIG_DETECTED_H 1 +#endif +#endif // defined(__has_include) + +#if defined(FIRESTORE_HAVE_CONFIG_DETECTED_H) +// If FIRESTORE_HAVE_CONFIG_DETECTED_H is defined, assume the configuration is +// correct. You can define FIRESTORE_HAVE_CONFIG_DETECTED_H=0 to configure the +// correct HAVE_ values via the compiler command-line. +#if FIRESTORE_HAVE_CONFIG_DETECTED_H +#include "Firestore/core/src/util/config_detected.h" +#endif + +#elif __APPLE__ && (SWIFT_PACKAGE || COCOAPODS) +// Swift Package Manager does not support configure-time feature testing and +// does not support source transformations of any kind so we can't cheat by +// running a sed command to generate config.h before building. +// +// Handle CocoaPods the same way since the settings are the same. +#define HAVE_ARC4RANDOM 1 +#define HAVE_LIBDISPATCH 1 + +#elif __linux__ && SWIFT_PACKAGE +#define HAVE_OPENSSL_RAND_H 1 + +#else +#error "Unknown build configuration" +#endif // FIRESTORE_HAVE_CONFIG_DETECTED_H + +#endif // FIRESTORE_CORE_SRC_UTIL_CONFIG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/defer.h b/Pods/FirebaseFirestore/Firestore/core/src/util/defer.h new file mode 100644 index 000000000..878254820 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/defer.h @@ -0,0 +1,75 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_DEFER_H_ +#define FIRESTORE_CORE_SRC_UTIL_DEFER_H_ + +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Creates a deferred action object that will execute the given `action` when + * the `Defer` object is destroyed at the close of the lexical scope containing + * it. You must declare a local variable of type `Defer` for it to have any + * useful effect; otherwise the `Defer` is destroyed at the end of the + * statement, which is equivalent to just directly running the `action`. + * + * `Defer` is useful for performing ad-hoc RAII-style actions, without having + * to create the wrapper class. For example: + * + * FILE* file = fopen(filename, "rb"); + * Defer cleanup([&] { + * if (file) { + * fclose(file); + * } + * }); + */ +class Defer { + // TODO(C++17): Make Action a template argument and use CTAD in the callers. + public: + using Action = std::function; + + /** + * Constructs a `Defer` object. + * + * @param action a callable object; usually a lambda. Even if exceptions are + * enabled, when `action` is invoked it must not throw. This is similar + * to the restriction that exists on destructors generally. + */ + explicit Defer(Action&& action) : action_(std::move(action)) { + } + + ~Defer() { + action_(); + } + + // Defer can be neither copied nor moved. + Defer(const Defer&) = delete; + Defer& operator=(const Defer&) = delete; + + private: + Action action_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_DEFER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/delayed_constructor.h b/Pods/FirebaseFirestore/Firestore/core/src/util/delayed_constructor.h similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/delayed_constructor.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/delayed_constructor.h index c45b18684..1a6240c50 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/delayed_constructor.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/delayed_constructor.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_DELAYED_CONSTRUCTOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_DELAYED_CONSTRUCTOR_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_DELAYED_CONSTRUCTOR_H_ +#define FIRESTORE_CORE_SRC_UTIL_DELAYED_CONSTRUCTOR_H_ #include #include @@ -129,4 +129,4 @@ class DelayedConstructor { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_DELAYED_CONSTRUCTOR_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_DELAYED_CONSTRUCTOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/empty.h b/Pods/FirebaseFirestore/Firestore/core/src/util/empty.h similarity index 82% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/empty.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/empty.h index 8e1abfdb2..825768cfd 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/empty.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/empty.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EMPTY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EMPTY_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_EMPTY_H_ +#define FIRESTORE_CORE_SRC_UTIL_EMPTY_H_ namespace firebase { namespace firestore { @@ -34,4 +34,4 @@ struct Empty { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EMPTY_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_EMPTY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/equality.h b/Pods/FirebaseFirestore/Firestore/core/src/util/equality.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/equality.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/equality.h index 386b61691..a06895819 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/equality.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/equality.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EQUALITY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EQUALITY_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_EQUALITY_H_ +#define FIRESTORE_CORE_SRC_UTIL_EQUALITY_H_ #include #include @@ -37,4 +37,4 @@ bool Equals(const T& lhs, const T& rhs) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_EQUALITY_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_EQUALITY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/error_apple.h b/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/error_apple.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.h index ee900ad2b..4aa59398d 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/error_apple.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ERROR_APPLE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ERROR_APPLE_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_ERROR_APPLE_H_ +#define FIRESTORE_CORE_SRC_UTIL_ERROR_APPLE_H_ // Everything in this header exists for compatibility with Objective-C. #if __OBJC__ @@ -26,7 +26,7 @@ #include #include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/util/status_fwd.h" +#include "Firestore/core/src/util/status_fwd.h" #include "absl/strings/string_view.h" NS_ASSUME_NONNULL_BEGIN @@ -42,7 +42,7 @@ namespace firestore { namespace util { // Translates a set of error_code and error_msg to an NSError. -NSError* MakeNSError(int64_t error_code, +NSError* MakeNSError(Error error_code, const absl::string_view error_msg, NSError* cause = nil); @@ -81,4 +81,4 @@ NS_ASSUME_NONNULL_END #endif // __OBJC__ -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ERROR_APPLE_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_ERROR_APPLE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/error_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.mm similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/error_apple.mm rename to Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.mm index 0d80a0307..22aca38f9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/error_apple.mm +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/error_apple.mm @@ -14,14 +14,15 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" +#include "Firestore/core/src/util/error_apple.h" #include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/string_apple.h" -// NB: This is also declared in Firestore/Source/Public/FIRFirestoreErrors.h +// NB: This is also declared in +// FirebaseFirestore/Firestore/Source/Public/FIRFirestoreErrors.h // NOLINTNEXTLINE: public constant FOUNDATION_EXPORT NSString* const FIRFirestoreErrorDomain = @"FIRFirestoreErrorDomain"; @@ -31,10 +32,10 @@ namespace util { // Translates a set of error_code and error_msg to an NSError. -NSError* MakeNSError(int64_t error_code, +NSError* MakeNSError(Error error_code, absl::string_view error_msg, NSError* cause) { - if (error_code == Error::Ok) { + if (error_code == Error::kErrorOk) { return nil; } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/exception.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/exception.cc new file mode 100644 index 000000000..55c8b77ca --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/exception.cc @@ -0,0 +1,95 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/exception.h" + +#include +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace { + +const char* ExceptionName(ExceptionType exception) { + switch (exception) { + case ExceptionType::AssertionFailure: + return "FIRESTORE INTERNAL ASSERTION FAILED"; + case ExceptionType::IllegalState: + return "Illegal state"; + case ExceptionType::InvalidArgument: + return "Invalid argument"; + } + UNREACHABLE(); +} + +ABSL_ATTRIBUTE_NORETURN void DefaultThrowHandler(ExceptionType type, + const char* file, + const char* func, + int line, + const std::string& message) { + std::string what = absl::StrCat(ExceptionName(type), ": "); + if (file && func) { + absl::StrAppend(&what, file, "(", line, ") ", func, ": "); + } + absl::StrAppend(&what, message); + +#if ABSL_HAVE_EXCEPTIONS + switch (type) { + case ExceptionType::AssertionFailure: + throw FirestoreInternalError(what); + case ExceptionType::IllegalState: + throw std::logic_error(what); + case ExceptionType::InvalidArgument: + throw std::invalid_argument(what); + } +#else + LOG_ERROR("%s", what); + std::terminate(); +#endif + + UNREACHABLE(); +} + +ThrowHandler throw_handler = DefaultThrowHandler; + +} // namespace + +ThrowHandler SetThrowHandler(ThrowHandler handler) { + ThrowHandler previous = throw_handler; + throw_handler = handler; + return previous; +} + +ABSL_ATTRIBUTE_NORETURN void Throw(ExceptionType exception, + const char* file, + const char* func, + int line, + const std::string& message) { + throw_handler(exception, file, func, line, message); + + // It's expected that the throw handler above does not return. If it does, + // just terminate. + std::terminate(); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/exception.h b/Pods/FirebaseFirestore/Firestore/core/src/util/exception.h new file mode 100644 index 000000000..07f99ccc3 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/exception.h @@ -0,0 +1,128 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_EXCEPTION_H_ +#define FIRESTORE_CORE_SRC_UTIL_EXCEPTION_H_ + +// Routines in this file are used to throw an exception (or crash, depending on +// platform) in response to API usage errors. Exceptions should only be used +// for programmer errors made by consumers of the SDK, e.g. invalid method +// arguments. +// +// These routines avoid conditional compilation in the caller and avoids lint +// warnings around actually throwing exceptions in source. The implementation +// chooses the best way to surface a logic error to the developer. +// +// For recoverable runtime errors, use util::Status, or in pure Objective-C +// code use an NSError** out-parameter. +// +// For internal programming errors, including internal argument checking, use +// HARD_ASSERT or HARD_FAIL(). + +#include +#include + +#include "Firestore/core/src/util/string_format.h" +#include "absl/base/attributes.h" +#include "absl/base/config.h" + +namespace firebase { +namespace firestore { +namespace util { + +#if ABSL_HAVE_EXCEPTIONS +/** + * An exception thrown if Firestore encounters an internal error. + */ +class FirestoreInternalError : public std::logic_error { + public: + using std::logic_error::logic_error; +}; +#endif // ABSL_HAVE_EXCEPTIONS + +/** + * An enumeration of logical exception types mapping to common user visible + * exceptions we might throw in response do some invalid action in an + * interaction with the Firestore API. + */ +enum class ExceptionType { + AssertionFailure, + IllegalState, + InvalidArgument, +}; + +using ThrowHandler = void (*)(ExceptionType type, + const char* file, + const char* func, + int line, + const std::string& message); + +/** + * Overrides the default exception throw handler. + * + * The default essentially just calls std::terminate. While reasonable for C++ + * with exceptions disabled, this isn't optimal for platforms that merely use + * the C++ core as their implementation and would otherwise be expected to throw + * a platform specific exception. + * + * @param callback A function that will handle the exception. This function is + * expected not to return. (If it does, std::terminate() will be called + * immediately after it does so.) + * @return A pointer to the previous failure handler. + */ +ThrowHandler SetThrowHandler(ThrowHandler callback); + +ABSL_ATTRIBUTE_NORETURN void Throw(ExceptionType type, + const char* file, + const char* func, + int line, + const std::string& message); + +/** + * Throws an exception indicating that the user passed an invalid argument. + * + * Invalid argument is interpreted pretty broadly and can mean that the user + * made an incompatible chained method call while building up a larger + * structure, like a query. + */ +template +ABSL_ATTRIBUTE_NORETURN void ThrowInvalidArgument(const char* format, + const FA&... args) { + Throw(ExceptionType::InvalidArgument, nullptr, nullptr, 0, + StringFormat(format, args...)); +} + +/** + * Throws an exception that indicates the user has attempted to use an API + * that's in an illegal state, usually by violating a precondition of the API + * call. + * + * Good uses of these are things like using a write batch after committing or + * trying to use Firestore without initializing FIRApp. Builder-style APIs that + * haven't done anything yet should likely just stick to ThrowInvalidArgument. + */ +template +ABSL_ATTRIBUTE_NORETURN void ThrowIllegalState(const char* format, + const FA&... args) { + Throw(ExceptionType::IllegalState, nullptr, nullptr, 0, + StringFormat(format, args...)); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EXCEPTION_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.h b/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.h new file mode 100644 index 000000000..1967e0c28 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.h @@ -0,0 +1,42 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_EXCEPTION_APPLE_H_ +#define FIRESTORE_CORE_SRC_UTIL_EXCEPTION_APPLE_H_ + +#include + +#include "Firestore/core/src/util/exception.h" +#include "absl/base/attributes.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Default throw handler for ObjC/Swift. Typically shouldn't be used directly. + */ +ABSL_ATTRIBUTE_NORETURN void ObjcThrowHandler(ExceptionType type, + const char* file, + const char* func, + int line, + const std::string& message); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EXCEPTION_APPLE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.mm new file mode 100644 index 000000000..212cbfd60 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/exception_apple.mm @@ -0,0 +1,75 @@ +/* + * Copyright 2019 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/exception_apple.h" + +#import + +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_apple.h" + +NS_ASSUME_NONNULL_BEGIN + +namespace firebase { +namespace firestore { +namespace util { +namespace { + +NSString* ExceptionName(ExceptionType exception) { + switch (exception) { + case ExceptionType::AssertionFailure: + return @"FIRESTORE INTERNAL ASSERTION FAILED"; + case ExceptionType::IllegalState: + return @"FIRIllegalStateException"; + case ExceptionType::InvalidArgument: + return @"FIRInvalidArgumentException"; + } + UNREACHABLE(); +} + +NSException* MakeException(ExceptionType type, const std::string& message) { + return [[NSException alloc] initWithName:ExceptionName(type) + reason:MakeNSString(message) + userInfo:nil]; +} + +} // namespace + +ABSL_ATTRIBUTE_NORETURN void ObjcThrowHandler(ExceptionType type, + const char* file, + const char* func, + int line, + const std::string& message) { + if (type == ExceptionType::AssertionFailure) { + [[NSAssertionHandler currentHandler] + handleFailureInFunction:MakeNSString(func) + file:MakeNSString(file) + lineNumber:line + description:@"%@: %s", ExceptionName(type), + message.c_str()]; + std::terminate(); + } else { + @throw MakeException(type, message); // NOLINT + } +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +NS_ASSUME_NONNULL_END diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/executor.h b/Pods/FirebaseFirestore/Firestore/core/src/util/executor.h new file mode 100644 index 000000000..9f58f6321 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/executor.h @@ -0,0 +1,195 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_EXECUTOR_H_ +#define FIRESTORE_CORE_SRC_UTIL_EXECUTOR_H_ + +#include // NOLINT(build/c++11) +#include +#include +#include + +namespace firebase { +namespace firestore { +namespace util { + +class DelayedOperation; +class Task; + +// An interface to a platform-specific executor of asynchronous operations +// (called tasks on other platforms). +// +// Operations may be scheduled for immediate or delayed execution. Operations +// delayed until the exact same time are scheduled in FIFO order. +// +// The operations are executed sequentially; only a single operation is executed +// at any given time. +// +// Delayed operations may be cancelled if they have not already been run. +class Executor { + public: + // An opaque name for a kind of operation. All operations of the same type + // should share a tag. + using Tag = int; + static constexpr Tag kNoTag = -1; + + // An opaque, monotonically increasing identifier for each operation that does + // not depend on its address. Whereas the `Tag` identifies the kind of + // operation, the `Id` identifies the specific instance. + using Id = uint32_t; + using Operation = std::function; + + using Milliseconds = std::chrono::milliseconds; + using Clock = std::chrono::steady_clock; + using TimePoint = std::chrono::time_point; + + // Creates a new serial Executor of the platform-appropriate type, and gives + // it the given label, if the implementation supports it. + // + // Note that this method has multiple definitions, depending on the platform. + static std::unique_ptr CreateSerial(const char* label); + + // Creates a new concurrent Executor of the platform-appropriate type, with + // at least the given number of threads, and gives it the given label, if the + // implementation supports it. + // + // Note that this method has multiple definitions, depending on the platform. + static std::unique_ptr CreateConcurrent(const char* label, + int threads); + + virtual ~Executor() = default; + + // Explicitly destroy this Executor, canceling pending tasks, and waiting for + // any tasks that are currently running. + // + // Dispose exists as a separate step to facilitate a leaf-first destruction + // order. Normally the root-most object in a hierarchy runs its destructor and + // then the objects that make it up are destroyed. If tasks referring to the + // root were running while the Executor's destructor is running, there would + // be no way for it to prevent those tasks from referring to a partially + // destroyed root. By calling `Dispose` in its destructor, the root-most + // object prevents any tasks from running that could observe a partially + // destroyed object graph. + // + // Requirements for implementors: + // * Dispose implementations must be idempotent. + // * Dispose implementations must exclude concurrent execution of other + // methods. + // * Once Dispose has started, other Executor methods that accept new work + // must silently reject that work. + // * Destructors should call Dispose. + virtual void Dispose() = 0; + + // Schedules the `operation` to be asynchronously executed as soon as + // possible, in FIFO order. + virtual void Execute(Operation&& operation) = 0; + // Like `Execute`, but blocks until the `operation` finishes, consequently + // draining immediate operations from the executor. + virtual void ExecuteBlocking(Operation&& operation) = 0; + + // Scheduled the given `operation` to be executed after `delay` milliseconds + // from now, and returns a handle that allows to cancel the operation + // (provided it hasn't been run already). + // + // Operations scheduled for future execution have an opaque tag. The value of + // the tag is ignored by the executor but can be used to find operations with + // a given tag after they are scheduled. + // + // `delay` must be non-negative; use `Execute` to schedule operations for + // immediate execution. + virtual DelayedOperation Schedule(Milliseconds delay, + Tag tag, + Operation&& operation) = 0; + + // Checks for the caller whether it is being invoked by this executor. + virtual bool IsCurrentExecutor() const = 0; + // Returns some sort of an identifier for the current execution context. The + // only guarantee is that it will return different values depending on whether + // this function is invoked by this executor or not. + virtual std::string CurrentExecutorName() const = 0; + // Like `CurrentExecutorName`, but returns an identifier for this executor, + // whether the caller code currently runs on this executor or not. + virtual std::string Name() const = 0; + + // Checks whether an operation tagged with the given `tag` is currently + // scheduled for future execution. + virtual bool IsTagScheduled(Tag tag) const = 0; + virtual bool IsIdScheduled(Id id) const = 0; + + // Removes the nearest due scheduled operation from the schedule and returns + // it to the caller. + // + // Only operations scheduled for delayed execution can be removed with this + // method; immediate operations don't count. If no such operations are + // currently scheduled, `nullptr` is returned. + // + // The caller is responsible for either executing or cancelling (and + // releasing) the returned Task. + virtual Task* PopFromSchedule() = 0; + + private: + // Mark a task completed, removing it from any internal schedule or tracking. + // Called by Task once it has completed execution. + virtual void OnCompletion(Task* task) = 0; + friend class Task; + + // If the operation hasn't yet been run, it will be removed from the queue. + // Otherwise, this function is a no-op. + // + // Called by `DelayedOperation` when its user calls `Cancel`. Implementations + // of `Cancel` should also `Dispose` the underlying `Task` to actually prevent + // execution. + virtual void Cancel(Id operation_id) = 0; + friend class DelayedOperation; +}; + +// A handle to an operation scheduled for future execution. The handle may +// outlive the operation, but it *cannot* outlive the executor that created it. +class DelayedOperation { + public: + // Creates an empty `DelayedOperation` not associated with any actual + // operation. Calling `Cancel` on it is a no-op. + DelayedOperation() = default; + + // Returns whether this `DelayedOperation` is associated with an actual + // operation. + explicit operator bool() const { + return executor_ && executor_->IsIdScheduled(id_); + } + + // If the operation has not been run yet, cancels the operation. Otherwise, + // this function is a no-op. + void Cancel() { + if (executor_) { + executor_->Cancel(id_); + } + } + + // Internal use only. + explicit DelayedOperation(Executor* executor, Executor::Id id) + : executor_(executor), id_(id) { + } + + private: + Executor* executor_ = nullptr; + Executor::Id id_ = 0; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EXECUTOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.h b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.h new file mode 100644 index 000000000..1fe1dc92f --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.h @@ -0,0 +1,130 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_EXECUTOR_LIBDISPATCH_H_ +#define FIRESTORE_CORE_SRC_UTIL_EXECUTOR_LIBDISPATCH_H_ + +#include + +#include // NOLINT(build/c++11) +#include // NOLINT(build/c++11) +#include +#include +#include // NOLINT(build/c++11) +#include +#include +#include +#include + +#include "Firestore/core/src/util/executor.h" +#include "absl/strings/string_view.h" + +#if !defined(__OBJC__) +// `dispatch_queue_t` gets defined to different types when compiled in C++ or +// Objective-C mode. Source files including this header should all be compiled +// in the same mode to avoid linker errors. +#error "This header only supports Objective-C++ (see comment for more info)." +#endif // !defined(__OBJC__) + +namespace firebase { +namespace firestore { +namespace util { + +// A serial queue built on top of libdispatch. The operations are run on +// a dedicated serial dispatch queue. +class ExecutorLibdispatch : public Executor { + public: + explicit ExecutorLibdispatch(dispatch_queue_t dispatch_queue); + ~ExecutorLibdispatch() override; + + void Dispose() override; + + bool IsCurrentExecutor() const override; + std::string CurrentExecutorName() const override; + std::string Name() const override; + + void Execute(Operation&& operation) override; + void ExecuteBlocking(Operation&& operation) override; + DelayedOperation Schedule(Milliseconds delay, + Tag tag, + Operation&& operation) override; + + bool IsTagScheduled(Tag tag) const override; + bool IsIdScheduled(Id id) const override; + Task* PopFromSchedule() override; + + dispatch_queue_t dispatch_queue() const { + return dispatch_queue_; + } + + private: + using ScheduleMap = std::unordered_map; + using ScheduleEntry = ScheduleMap::value_type; + + void OnCompletion(Task* task) override; + void Cancel(Id operation_id) override; + + static void InvokeAsync(void* raw_task); + static void InvokeSync(void* raw_task); + + Id NextIdLocked(); + + // A mutex controlling the executor's internal state. Avoid holding this + // while making calls into tasks, which could trigger callbacks into this + // executor, causing a deadlock. + mutable std::mutex mutex_; + + dispatch_queue_t dispatch_queue_; + + // A map of `Schedule`d tasks by their Id, allowing `Cancel` to be able to + // find tasks quickly. + ScheduleMap schedule_; + + // The set of all tasks managed by this executor, including those from + // `Execute`, `ExecuteBlocking`, and `Schedule`. + // + // libdispatch doesn't provide a way to cancel a scheduled operation, so once + // a `Task` is created, it will always stay in the schedule until the time is + // past. `Task`s internally track their own state and the executor may cancel + // them instead. This means that by the time libdispatch attempts to execute a + // a particular operation, the `Task` may already have been executed or + // canceled (imagine getting to a meeting and finding out it's been + // cancelled). + // + // `Task`s are jointly owned by libdispatch and the executor. + // + // Invariant: if the `tasks_` set contains a pointer to a `Task`, it is a + // valid object. This is achieved because when libdispatch executes a task, + // the task will remove itself from the executor (via a call to + // `OnCompletion`) before deleting itself. The reverse is not true: a + // cancelled task is removed from the executor, but won't be destroyed until + // its original due time is past. + std::unordered_set tasks_; + + Id current_id_ = 0; + + // Whether or not the executor has been disposed. Only operations that add + // new work need to observe this. Other operations that operate on `tasks_` or + // `schedule_` implicitly do so because those structures are cleared during + // `Dispose`. + bool disposed_ = false; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EXECUTOR_LIBDISPATCH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm new file mode 100644 index 000000000..390cdba81 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_libdispatch.mm @@ -0,0 +1,379 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/executor_libdispatch.h" + +#include +#include +#include + +#include "Firestore/core/src/util/defer.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" +#include "Firestore/core/src/util/task.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace { + +absl::string_view StringViewFromDispatchLabel(const char* const label) { + // Make sure string_view's data is not null, because it's used for logging. + return label ? absl::string_view{label} : absl::string_view{""}; +} + +// GetLabel functions are guaranteed to never return a "null" string_view +// (i.e. data() != nullptr). +absl::string_view GetQueueLabel(const dispatch_queue_t queue) { + return StringViewFromDispatchLabel(dispatch_queue_get_label(queue)); +} +absl::string_view GetCurrentQueueLabel() { + // Note: dispatch_queue_get_label may return nullptr if the queue wasn't + // initialized with a label. + return StringViewFromDispatchLabel( + dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL)); +} + +} // namespace + +// MARK: - ExecutorLibdispatch + +ExecutorLibdispatch::ExecutorLibdispatch(const dispatch_queue_t dispatch_queue) + : dispatch_queue_{dispatch_queue} { +} + +ExecutorLibdispatch::~ExecutorLibdispatch() { + Dispose(); +} + +void ExecutorLibdispatch::Dispose() { + TASK_TRACE("Executor::~Executor %s", this); + + decltype(tasks_) local_tasks; + { + std::unique_lock lock(mutex_); + + disposed_ = true; + + // Transfer ownership of tasks out of the executor members and into + // `local_tasks`. This prevents any concurrent execution of calls to + // `OnCompletion` or `Cancel` from finding tasks (and also from releasing + // them). + local_tasks.swap(tasks_); + + // All scheduled operations are also registered in `tasks_` so they can be + // handled in a single loop below. + schedule_.clear(); + } + + for (Task* task : local_tasks) { + TASK_TRACE("Executor::~Executor %s cancelling %s", this, task); + task->Cancel(); + + // Release this method's ownership (obtained when `local_tasks` swapped with + // `tasks_`). + task->Release(); + } +} + +bool ExecutorLibdispatch::IsCurrentExecutor() const { + return GetCurrentQueueLabel() == GetQueueLabel(dispatch_queue()); +} +std::string ExecutorLibdispatch::CurrentExecutorName() const { + return GetCurrentQueueLabel().data(); +} +std::string ExecutorLibdispatch::Name() const { + return GetQueueLabel(dispatch_queue()).data(); +} + +void ExecutorLibdispatch::Execute(Operation&& operation) { + auto* task = Task::Create(this, std::move(operation)); + { + std::lock_guard lock(mutex_); + if (disposed_) { + task->Release(); + return; + } + tasks_.insert(task); + } + + task->Retain(); // For libdispatch's ownership + dispatch_async_f(dispatch_queue_, task, InvokeAsync); +} + +void ExecutorLibdispatch::ExecuteBlocking(Operation&& operation) { + HARD_ASSERT( + GetCurrentQueueLabel() != GetQueueLabel(dispatch_queue_), + "Calling ExecuteBlocking on the current queue will lead to a deadlock."); + + auto* task = Task::Create(this, std::move(operation)); + { + std::lock_guard lock(mutex_); + if (disposed_) { + task->Release(); + return; + } + tasks_.insert(task); + } + + task->Retain(); // For libdispatch's ownership + dispatch_sync_f(dispatch_queue_, task, InvokeSync); +} + +DelayedOperation ExecutorLibdispatch::Schedule(Milliseconds delay, + Tag tag, + Operation&& operation) { + namespace chr = std::chrono; + const dispatch_time_t delay_ns = dispatch_time( + DISPATCH_TIME_NOW, chr::duration_cast(delay).count()); + + // Ownership is shared with libdispatch because it's impossible to actually + // cancel work after it's been dispatched and libdispatch is guaranteed to + // outlive the executor, so it's possible for tasks to be executed by + // libdispatch after the executor is destroyed. While the Executor has a + // pointer to the Task it also has ownership. + Task* task = nullptr; + TimePoint target_time = MakeTargetTime(delay); + Id id = 0; + { + std::lock_guard lock(mutex_); + if (disposed_) { + return {}; + } + + id = NextIdLocked(); + task = Task::Create(this, target_time, tag, id, std::move(operation)); + + tasks_.insert(task); + schedule_[id] = task; + } + + task->Retain(); // For libdispatch's ownership + dispatch_after_f(delay_ns, dispatch_queue_, task, InvokeAsync); + + return DelayedOperation(this, id); +} + +void ExecutorLibdispatch::OnCompletion(Task* task) { + bool should_release = false; + { + TASK_TRACE("Executor::OnCompletion %s task %s", this, task); + std::lock_guard lock(mutex_); + // No need to check `disposed_`: in that case `tasks_` would have been + // cleared. + + auto found = tasks_.find(task); + if (found != tasks_.end()) { + should_release = true; + tasks_.erase(found); + + // Only try to remove scheduled tasks here because non-scheduled tasks + // all have id 0, which overlaps with the first scheduled task. + if (!task->is_immediate()) { + schedule_.erase(task->id()); + } + } + } + + // Avoid calling potentially locking methods on the task while holding the + // executor's lock. + if (should_release) { + task->Release(); + } +} + +void ExecutorLibdispatch::Cancel(Id operation_id) { + Task* found_task = nullptr; + { + TASK_TRACE("Executor::Cancel %s task %s", this, task); + std::lock_guard lock(mutex_); + + // The `Task` referenced by the given `operation_id` might have been + // destroyed by the time cancellation function runs, in which case it's + // guaranteed to have been removed from the `schedule_`. If the + // `operation_id` refers to a task that has been removed, the call to + // `Cancel` will be a no-op. + const auto found = schedule_.find(operation_id); + + // It's possible for the operation to be missing if libdispatch gets to run + // it after it was force-run, for example. + if (found != schedule_.end()) { + found_task = found->second; + + // Removing the Task from `tasks_` prevents `OnCompletion` from releasing + // the task. This effectively transfers ownership to this method--no + // additional retain is required. + tasks_.erase(found_task); + schedule_.erase(found); + } + } + + // Avoid calling potentially locking methods on the task while holding the + // executor's lock. + if (found_task) { + found_task->Cancel(); + + // Release this method's ownership. + found_task->Release(); + } +} + +void ExecutorLibdispatch::InvokeAsync(void* raw_task) { + auto* task = static_cast(raw_task); + task->ExecuteAndRelease(); +} + +void ExecutorLibdispatch::InvokeSync(void* raw_task) { + // Note: keep this implementation separate from `InvokeAsync` to make it + // clearer in stack traces exactly what's going on. + auto* task = static_cast(raw_task); + task->ExecuteAndRelease(); +} + +// Test-only methods + +bool ExecutorLibdispatch::IsTagScheduled(Tag tag) const { + std::vector matches; + + { + std::unique_lock lock(mutex_); + + // There's a race inherent in making `IsTagScheduled` checks after a task + // has executed. The problem is that the task has to lock the Executor to + // report its completion, but `IsTagScheduled` needs that lock too. Absent + // any intervention, if `IsTagScheduled` won the race it could indicate + // that tasks that appear completed are still scheduled. + // + // Work around this by waiting for tasks that are currently executing to + // complete. That is, only tasks that are in the schedule and in the + // `kInitial` state are considered scheduled. + // + // Unfortunately, this has to be done with the Executor unlocked so that + // the task can report its completion without deadlocking. The executor + // can't be unlocked while iterating the `schedule_` though, so collect up + // potential matches in a separate collection. + for (const ScheduleEntry& entry : schedule_) { + Task* task = entry.second; + if (task->tag() == tag) { + matches.push_back(task); + + // Retain local references to prevent the task from deleting itself + // before it can be examined outside the executor mutex. + task->Retain(); + } + } + } + + // Avoid calling potentially locking methods on the task while holding the + // executor's lock. + bool tag_scheduled = false; + for (Task* task : matches) { + // Do not break out of the loop early: every task must be released. Once + // we find a tag that's still scheduled we no longer need to wait for tasks. + if (!tag_scheduled) { + bool task_completed = task->AwaitIfRunning(); + tag_scheduled = !task_completed; + } + + // Release this method's ownership. + task->Release(); + } + + return tag_scheduled; +} + +bool ExecutorLibdispatch::IsIdScheduled(Id id) const { + Task* found_task = nullptr; + { + std::lock_guard lock(mutex_); + + auto iter = schedule_.find(id); + if (iter != schedule_.end()) { + found_task = iter->second; + + // Retain local references to prevent the task from deleting itself before + // it can be examined outside the executor mutex. + found_task->Retain(); + } + } + + // Avoid calling potentially locking methods on the task while holding the + // executor's lock. + bool id_scheduled = false; + if (found_task) { + bool task_completed = found_task->AwaitIfRunning(); + id_scheduled = !task_completed; + + // Release this method's ownership + found_task->Release(); + } + + return id_scheduled; +} + +Task* ExecutorLibdispatch::PopFromSchedule() { + std::lock_guard lock(mutex_); + + if (schedule_.empty()) { + return nullptr; + } + + const auto nearest = + std::min_element(schedule_.begin(), schedule_.end(), + [](const ScheduleEntry& lhs, const ScheduleEntry& rhs) { + return *lhs.second < *rhs.second; + }); + + Task* task = nearest->second; + + // Removing the task from `tasks_` will prevent `OnCompletion` from finding + // it (or releasing it). This means the executor's ownership is transferred to + // the caller--no additional `Retain` is required here. + tasks_.erase(task); + schedule_.erase(nearest); + return task; +} + +ExecutorLibdispatch::Id ExecutorLibdispatch::NextIdLocked() { + // The wrap around after ~4 billion operations is explicitly ignored. Even if + // an instance of `ExecutorLibdispatch` runs long enough to get `current_id_` + // to overflow, it's extremely unlikely that any object still holds a + // reference that is old enough to cause a conflict. + return current_id_++; +} + +// MARK: - Executor + +std::unique_ptr Executor::CreateSerial(const char* label) { + dispatch_queue_t queue = dispatch_queue_create(label, DISPATCH_QUEUE_SERIAL); + return absl::make_unique(queue); +} + +std::unique_ptr Executor::CreateConcurrent(const char* label, + int threads) { + HARD_ASSERT(threads > 1); + + // Concurrent queues auto-create enough threads to avoid deadlock so there's + // no need to honor the threads argument. + dispatch_queue_t queue = + dispatch_queue_create(label, DISPATCH_QUEUE_CONCURRENT); + return absl::make_unique(queue); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.cc new file mode 100644 index 000000000..615c3fb75 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.cc @@ -0,0 +1,260 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/executor_std.h" + +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/src/util/config.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/schedule.h" +#include "Firestore/core/src/util/task.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace util { + +namespace { + +// As a convention, assign the epoch time to all operations scheduled for +// immediate execution. Note that it means that an immediate operation is +// always scheduled before any delayed operation, even in the corner case when +// the immediate operation was scheduled after a delayed operation was due +// (but hasn't yet run). +Executor::TimePoint Immediate() { + return Executor::TimePoint{}; +} + +// The only guarantee is that different `thread_id`s will produce different +// values. +std::string ThreadIdToString(const std::thread::id thread_id) { + std::ostringstream stream; + stream << thread_id; + return stream.str(); +} + +} // namespace + +class ExecutorStd::SharedState { + public: + // Operations scheduled for immediate execution are also put on the schedule + // (with due time set to `Immediate`). + class Schedule schedule_; +}; + +// MARK: - ExecutorStd + +ExecutorStd::ExecutorStd(int threads) + : state_(std::make_shared()) { + HARD_ASSERT(threads > 0); + + for (int i = 0; i < threads; ++i) { + worker_thread_pool_.emplace_back(&ExecutorStd::PollingThread, state_); + } +} + +ExecutorStd::~ExecutorStd() { + Dispose(); +} + +void ExecutorStd::Dispose() { + { + std::lock_guard lock(mutex_); + + // Do nothing if already disposed. + if (state_ == nullptr) { + return; + } + + state_->schedule_.Clear(); + + // Enqueue one Task with the kShutdownTag for each worker. Workers will + // finish whatever task they're currently working on, execute this task, + // and then quit. + // + // Note that this destructor may be running on a thread managed by this + // Executor. This means that these tasks cannot be Awaited, though we do so + // indirectly by joining threads if possible. On the thread currently + // running this destructor, the kShutdownTag Task will execute after the + // destructor completes. + for (size_t i = 0; i < worker_thread_pool_.size(); ++i) { + PushOnScheduleLocked(Immediate(), kShutdownTag, [] {}); + } + + state_ = nullptr; + } + + // Now that `state_` has been released, join any threads while not holding + // the lock to avoid deadlocks where the thread tries to access the executor. + for (std::thread& thread : worker_thread_pool_) { + // If the current thread is running this destructor, we can't join the + // thread. Instead detach it and rely on PollingThread to exit cleanly. + if (std::this_thread::get_id() == thread.get_id()) { + thread.detach(); + } else { + thread.join(); + } + } +} + +void ExecutorStd::Execute(Operation&& operation) { + std::lock_guard lock(mutex_); + if (!state_) return; + + PushOnScheduleLocked(Immediate(), kNoTag, std::move(operation)); +} + +DelayedOperation ExecutorStd::Schedule(const Milliseconds delay, + Tag tag, + Operation&& operation) { + std::lock_guard lock(mutex_); + if (!state_) return {}; + + // While negative delay can be interpreted as a request for immediate + // execution, supporting it would provide a hacky way to modify FIFO ordering + // of immediate operations. + HARD_ASSERT(delay.count() >= 0, "Schedule: delay cannot be negative"); + + const auto target_time = MakeTargetTime(delay); + const auto id = PushOnScheduleLocked(target_time, tag, std::move(operation)); + return DelayedOperation(this, id); +} + +void ExecutorStd::OnCompletion(Task*) { + // No-op in this implementation +} + +void ExecutorStd::Cancel(const Id operation_id) { + Task* removed = nullptr; + { + std::lock_guard lock(mutex_); + if (!state_) return; + + removed = state_->schedule_.RemoveIf( + [operation_id](const Task& t) { return t.id() == operation_id; }); + } + + if (removed) { + // If we've managed to remove a task, it's guaranteed not to have started + // yet (currently executing tasks have been popped from the schedule and + // are held by a worker thread). Therefore all that's required is to + // release it since the task will never be executed. + // + // `Task::Cancel` is not required because once the task is removed from + // the schedule it can't be acquired by a worker thread. + removed->Release(); + } +} + +ExecutorStd::Id ExecutorStd::PushOnScheduleLocked(const TimePoint when, + const Tag tag, + Operation&& operation) { + // Note: operations scheduled for immediate execution don't actually need an + // id. This could be tweaked to reuse the same id for all such operations. + const auto id = NextIdLocked(); + state_->schedule_.Push( + Task::Create(nullptr, when, tag, id, std::move(operation))); + return id; +} + +void ExecutorStd::PollingThread(std::shared_ptr state) { + for (;;) { + Task* task = state->schedule_.PopBlocking(); + bool shutdown_requested = task->tag() == kShutdownTag; + + task->ExecuteAndRelease(); + if (shutdown_requested) { + break; + } + } +} + +ExecutorStd::Id ExecutorStd::NextIdLocked() { + // The wrap around after ~4 billion operations is explicitly ignored. Even if + // an instance of `ExecutorStd` runs long enough to get `current_id_` to + // overflow, it's extremely unlikely that any object still holds a reference + // that is old enough to cause a conflict. + return current_id_++; +} + +bool ExecutorStd::IsCurrentExecutor() const { + auto current_id = std::this_thread::get_id(); + for (const std::thread& thread : worker_thread_pool_) { + if (thread.get_id() == current_id) { + return true; + } + } + return false; +} + +std::string ExecutorStd::CurrentExecutorName() const { + if (IsCurrentExecutor()) { + return Name(); + } else { + return ThreadIdToString(std::this_thread::get_id()); + } +} + +std::string ExecutorStd::Name() const { + return ThreadIdToString(worker_thread_pool_.front().get_id()); +} + +void ExecutorStd::ExecuteBlocking(Operation&& operation) { + std::promise signal_finished; + Execute([&] { + operation(); + signal_finished.set_value(); + }); + signal_finished.get_future().wait(); +} + +bool ExecutorStd::IsTagScheduled(const Tag tag) const { + return state_->schedule_.Contains( + [&tag](const Task& t) { return t.tag() == tag; }); +} + +bool ExecutorStd::IsIdScheduled(const Id id) const { + return state_->schedule_.Contains( + [&id](const Task& t) { return t.id() == id; }); +} + +Task* ExecutorStd::PopFromSchedule() { + return state_->schedule_.RemoveIf( + [](const Task& t) { return !t.is_immediate(); }); +} + +// MARK: - Executor + +// Only defined on non-Apple platforms. On Apple platforms, see the alternative +// definition in executor_libdispatch.mm. +#if !HAVE_LIBDISPATCH + +std::unique_ptr Executor::CreateSerial(const char*) { + return absl::make_unique(/*threads=*/1); +} + +std::unique_ptr Executor::CreateConcurrent(const char*, int threads) { + return absl::make_unique(threads); +} + +#endif // !HAVE_LIBDISPATCH + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.h b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.h new file mode 100644 index 000000000..bd411c329 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/executor_std.h @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_EXECUTOR_STD_H_ +#define FIRESTORE_CORE_SRC_UTIL_EXECUTOR_STD_H_ + +#include +#include +#include // NOLINT(build/c++11) +#include +#include +#include // NOLINT(build/c++11) +#include +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/src/util/executor.h" + +namespace firebase { +namespace firestore { +namespace util { + +class Schedule; +class Task; + +// A serial queue that executes provided operations on a dedicated background +// thread, using C++11 standard library functionality. +class ExecutorStd : public Executor { + public: + static constexpr Tag kShutdownTag = -2; + + explicit ExecutorStd(int threads); + ~ExecutorStd(); + + void Dispose() override; + + void Execute(Operation&& operation) override; + void ExecuteBlocking(Operation&& operation) override; + + DelayedOperation Schedule(Milliseconds delay, + Tag tag, + Operation&& operation) override; + + bool IsCurrentExecutor() const override; + std::string CurrentExecutorName() const override; + std::string Name() const override; + + bool IsTagScheduled(Tag tag) const override; + bool IsIdScheduled(Id id) const override; + Task* PopFromSchedule() override; + + private: + class SharedState; + + Id PushOnScheduleLocked(TimePoint when, Tag tag, Operation&& operation); + + void OnCompletion(Task* task) override; + void Cancel(Id operation_id) override; + + static void PollingThread(std::shared_ptr state); + Id NextIdLocked(); + + // A mutex that provides mutual exclusion to users of the Executor interface. + // Worker threads do not acquire this mutex--they only operate on the + // SharedState. + std::mutex mutex_; + + std::vector worker_thread_pool_; + + Id current_id_ = 0; + + // State shared with workers. Note that if the Executor's destructor is called + // from a worker thread, this state will outlive the nominally owning + // Executor. `mutex_` does not protect this state. + std::shared_ptr state_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_EXECUTOR_STD_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem.h b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem.h new file mode 100644 index 000000000..1a1e25f6f --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem.h @@ -0,0 +1,264 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_FILESYSTEM_H_ +#define FIRESTORE_CORE_SRC_UTIL_FILESYSTEM_H_ + +#include +#include + +#include "Firestore/core/src/util/status.h" +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +class Path; + +template +class StatusOr; + +/** + * A high-level interface describing filesystem operations. + */ +class Filesystem { + public: + virtual ~Filesystem() = default; + + Filesystem(const Filesystem&) = delete; + Filesystem& operator=(const Filesystem&) = delete; + + /** + * Returns a singleton default filesystem implementation for the current + * operating system. + */ + static Filesystem* Default(); + + /** + * Returns a system-defined best directory in which to create application + * data. Values vary wildly across platforms. They include: + * + * * iOS: $container/Library/Application Support/$app_name + * * Linux: $HOME/.local/share/$app_name + * * macOS: $container/Library/Application Support/$app_name + * * Other UNIX: $HOME/.$app_name + * * tvOS: $container/Library/Caches/$app_name + * * Windows: %USERPROFILE%/AppData/Local + * + * On iOS, tvOS, and macOS (when running sandboxed), these locations are + * relative to the data container for the current application. On macOS when + * the application is not sandboxed, the returned value will be relative to + * $HOME instead. See "About the iOS File System" in the Apple "File System + * Programming Guide" at https://apple.co/2Nn7Bsb. + * + * Note: the returned path is just where the system thinks the application + * data should be stored, but AppDataDir does not actually guarantee that this + * path exists. + * + * @param app_name The name of the application. + */ + virtual StatusOr AppDataDir(absl::string_view app_name); + + /** + * Returns the Documents directory in which Firestore used to store + * application data. Values vary wildly across platforms. They include: + * + * * iOS: $container/Documents/$app_name + * * macOS: $HOME/.$app_name + * + * On iOS, the Documents folder is relative to the data container for the + * current application. See "About the iOS File System" in the Apple "File + * System Programming Guide" at https://apple.co/2Nn7Bsb. + * + * Note: the returned path is just where the system thinks the documents + * directory should be stored, but LegacyDocumentsDir does not actually + * guarantee that this path exists. + * + * @param app_name The name of the application. + * + * @returns The documents directory path or a status with + * Error::kErrorUnimplemented if the current platform does not have a legacy + * documents directory. + */ + virtual StatusOr LegacyDocumentsDir(absl::string_view app_name); + + /** + * Returns system-defined best directory in which to create temporary files. + * Typical return values are like `/tmp` on UNIX systems. Clients should + * create randomly named directories or files within this location to avoid + * collisions. Absent any changes that might affect the underlying calls, the + * value returned from TempDir will be stable over time. + * + * Note: the returned path is just where the system thinks temporary files + * should be stored, but TempDir does not actually guarantee that this path + * exists. + */ + virtual Path TempDir(); + + /** + * Answers the question "is this path a directory? The path is not required to + * have a trailing slash. + * + * Typical return codes include: + * * Ok - The path exists and is a directory. + * * FailedPrecondition - Some component of the path is not a directory. + * This does not necessarily imply that the path exists and is a file. + * * NotFound - The path does not exist + * * PermissionDenied - Insufficient permissions to access the path. + */ + virtual Status IsDirectory(const Path& path); + + /** + * On success, returns the size in bytes of the file specified by + * `path`. + */ + virtual StatusOr FileSize(const Path& path); + + /** + * Recursively creates all the directories in the path name if they don't + * exist. + * + * @return Ok if the directory was created or already existed. + */ + virtual Status RecursivelyCreateDir(const Path& path); + + /** + * Recursively deletes the contents of the given pathname. If the pathname is + * a file, deletes just that file. The the pathname is a directory, deletes + * everything within the directory. + * + * @return Ok if the directory was deleted or did not exist. + */ + virtual Status RecursivelyRemove(const Path& path); + + /** + * Creates the given directory. The immediate parent directory must already + * exist and not already be a file. + * + * @return Ok if the directory was created or already existed. On some systems + * this may also return Ok if a regular file exists at the given path. + */ + virtual Status CreateDir(const Path& path); + + /** + * Deletes the given directory if it exists. + * + * @return Ok if the directory was deleted or did not exist. Returns a + * system-defined error if the path is not a directory or the directory is + * non-empty. + */ + virtual Status RemoveDir(const Path& path); + + /** + * Deletes the given file if it exists. + * + * @return Ok if the file was deleted or did not exist. Returns a + * system-defined error if the path exists but is not a regular file. + */ + virtual Status RemoveFile(const Path& path); + + /** + * Recursively deletes the contents of the given pathname that is known to be + * a directory. + * + * @return Ok if the directory was deleted or did not exist. Returns a + * system-defined error if the path exists but is not a directory. + * + */ + virtual Status RecursivelyRemoveDir(const Path& path); + + virtual Status Rename(const Path& from_path, const Path& to_path); + + /** + * Marks the given directory as excluded from platform-specific backup schemes + * like iCloud backup. + */ + virtual Status ExcludeFromBackups(const Path& dir); + + /** + * On success, opens the file at the given `path` and returns its contents as + * a string. + */ + virtual StatusOr ReadFile(const Path& path); + + protected: + Filesystem() = default; +}; + +/** + * Returns true if the path is an accessible directory and is empty. + */ +bool IsEmptyDir(const Path& path); + +/** + * Implements an iterator over the contents of a directory. Initializes to the + * first entry in the directory. + */ +class DirectoryIterator { + public: + /** + * Creates a new platform-specific directory iterator. + * + * @param path The path over which to iterate (must outlive the + * DirectoryIterator). + */ + static std::unique_ptr Create(const Path& path); + + virtual ~DirectoryIterator() = default; + + /** + * Advances the iterator. + */ + virtual void Next() = 0; + + /** + * Returns true if `Next()` and `file()` can be called on the iterator. + * If `Valid() == false && status().ok()`, then iteration has finished. + */ + virtual bool Valid() const = 0; + + /** + * Return the full path of the current entry pointed to by the iterator. + */ + virtual Path file() const = 0; + + /** + * Returns the last error encountered by the iterator, or OK. + */ + Status status() const { + return status_; + } + + protected: + /** + * `path` should outlive the iterator. + */ + explicit DirectoryIterator(const Path& path) : parent_{path} { + } + + DirectoryIterator(const DirectoryIterator& other) = delete; + DirectoryIterator& operator=(const DirectoryIterator& other) = delete; + + Status status_; + const Path& parent_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_FILESYSTEM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_apple.mm new file mode 100644 index 000000000..5a6fdea9c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_apple.mm @@ -0,0 +1,96 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/filesystem.h" + +#if __APPLE__ + +#import + +#include "Firestore/core/src/util/path.h" +#include "Firestore/core/src/util/statusor.h" +#include "absl/strings/str_cat.h" + +namespace firebase { +namespace firestore { +namespace util { + +Status Filesystem::ExcludeFromBackups(const Path& dir) { + NSURL* dir_url = [NSURL fileURLWithPath:dir.ToNSString()]; + NSError* error = nil; + if (![dir_url setResourceValue:@YES + forKey:NSURLIsExcludedFromBackupKey + error:&error]) { + return Status{ + Error::kErrorInternal, + "Failed to mark persistence directory as excluded from backups"} + .CausedBy(Status::FromNSError(error)); + } + + return Status::OK(); +} + +StatusOr Filesystem::AppDataDir(absl::string_view app_name) { +#if TARGET_OS_IOS || TARGET_OS_OSX + NSArray* directories = NSSearchPathForDirectoriesInDomains( + NSApplicationSupportDirectory, NSUserDomainMask, YES); + return Path::FromNSString(directories[0]).AppendUtf8(app_name); + +#elif TARGET_OS_TV + NSArray* directories = NSSearchPathForDirectoriesInDomains( + NSCachesDirectory, NSUserDomainMask, YES); + return Path::FromNSString(directories[0]).AppendUtf8(app_name); + +#else +#error "Don't know where to store documents on this platform." +#endif +} + +StatusOr Filesystem::LegacyDocumentsDir(absl::string_view app_name) { +#if TARGET_OS_IOS + NSArray* directories = NSSearchPathForDirectoriesInDomains( + NSDocumentDirectory, NSUserDomainMask, YES); + return Path::FromNSString(directories[0]).AppendUtf8(app_name); + +#elif TARGET_OS_OSX + std::string dot_prefixed = absl::StrCat(".", app_name); + return Path::FromNSString(NSHomeDirectory()).AppendUtf8(dot_prefixed); + +#else + return Status(Error::kErrorUnimplemented, + "No legacy storage on this platform."); +#endif +} + +Path Filesystem::TempDir() { + const char* env_tmpdir = getenv("TMPDIR"); + if (env_tmpdir) { + return Path::FromUtf8(env_tmpdir); + } + + NSString* ns_tmpdir = NSTemporaryDirectory(); + if (ns_tmpdir) { + return Path::FromNSString(ns_tmpdir); + } + + return Path::FromUtf8("/tmp"); +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // __APPLE__ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_common.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_common.cc new file mode 100644 index 000000000..faf6adf96 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_common.cc @@ -0,0 +1,120 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include + +#include "Firestore/core/src/util/filesystem.h" +#include "Firestore/core/src/util/path.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" + +namespace firebase { +namespace firestore { +namespace util { + +Filesystem* Filesystem::Default() { + static Filesystem filesystem; + return &filesystem; +} + +Status Filesystem::RecursivelyCreateDir(const Path& path) { + Status result = CreateDir(path); + if (result.ok() || result.code() != Error::kErrorNotFound) { + // Successfully created the directory, it already existed, or some other + // unrecoverable error. + return result; + } + + // Missing parent + Path parent = path.Dirname(); + result = RecursivelyCreateDir(parent); + if (!result.ok()) { + return result; + } + + // Successfully created the parent so try again. + return CreateDir(path); +} + +Status Filesystem::RecursivelyRemove(const Path& path) { + Status status = IsDirectory(path); + switch (status.code()) { + case Error::kErrorOk: + return RecursivelyRemoveDir(path); + + case Error::kErrorFailedPrecondition: + // Could be a file or something else. Attempt to delete it as a file + // but otherwise allow that to fail if it's not a file. + return RemoveFile(path); + + case Error::kErrorNotFound: + return Status::OK(); + + default: + return status; + } +} + +Status Filesystem::RecursivelyRemoveDir(const Path& parent) { + std::unique_ptr iter = DirectoryIterator::Create(parent); + for (; iter->Valid(); iter->Next()) { + Status status = RecursivelyRemove(iter->file()); + if (!status.ok()) { + return status; + } + } + + if (!iter->status().ok()) { + if (iter->status().code() == Error::kErrorNotFound) { + return Status::OK(); + } + return iter->status(); + } + return RemoveDir(parent); +} + +#if !__APPLE__ +Status Filesystem::ExcludeFromBackups(const Path&) { + // Non-Apple platforms don't yet implement exclusion from backups. + return Status::OK(); +} +#endif // !__APPLE__ + +StatusOr Filesystem::ReadFile(const Path& path) { + std::ifstream file{path.native_value()}; + if (!file) { + // TODO(varconst): more error details. This will require platform-specific + // code, because `` may not update `errno`. + return Status{Error::kErrorUnknown, + StringFormat("File at path '%s' cannot be opened", + path.ToUtf8String())}; + } + + std::stringstream buffer; + buffer << file.rdbuf(); + return buffer.str(); +} + +bool IsEmptyDir(const Path& path) { + // If the DirectoryIterator is valid there's at least one entry. + auto iter = DirectoryIterator::Create(path); + return iter->status().ok() && !iter->Valid(); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_posix.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_posix.cc new file mode 100644 index 000000000..cb6ed42b5 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/filesystem_posix.cc @@ -0,0 +1,300 @@ +/* + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/filesystem.h" + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/path.h" +#include "Firestore/core/src/util/statusor.h" +#include "Firestore/core/src/util/string_format.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace util { + +#if !__APPLE__ && !_WIN32 +// See filesystem_apple.mm and filesystem_win.cc for other implementations. + +namespace { + +StatusOr HomeDir() { + const char* home_dir = getenv("HOME"); + if (home_dir) return Path::FromUtf8(home_dir); + + passwd pwd; + passwd* result; + auto buffer_size = static_cast(sysconf(_SC_GETPW_R_SIZE_MAX)); + std::string buffer(buffer_size, '\0'); + uid_t uid = getuid(); + int rc; + do { + rc = getpwuid_r(uid, &pwd, &buffer[0], buffer_size, &result); + } while (rc == EINTR); + + if (rc != 0) { + return Status::FromErrno( + rc, "Failed to find the home directory for the current user"); + } + + return Path::FromUtf8(pwd.pw_dir); +} + +#if __linux__ && !__ANDROID__ +StatusOr XdgDataHomeDir() { + const char* data_home = getenv("XDG_DATA_HOME"); + if (data_home) return Path::FromUtf8(data_home); + + StatusOr maybe_home_dir = HomeDir(); + if (!maybe_home_dir.ok()) return maybe_home_dir; + + const Path& home_dir = maybe_home_dir.ValueOrDie(); + return home_dir.AppendUtf8(".local/share"); +} +#endif // __linux__ && !__ANDROID__ + +} // namespace + +StatusOr Filesystem::AppDataDir(absl::string_view app_name) { +#if __linux__ && !__ANDROID__ + // On Linux, use XDG data home, usually $HOME/.local/share/$app_name + StatusOr maybe_data_home = XdgDataHomeDir(); + if (!maybe_data_home.ok()) return maybe_data_home; + + return maybe_data_home.ValueOrDie().AppendUtf8(app_name); + +#elif !__ANDROID__ + // On any other UNIX, use an old school dotted directory in $HOME. + StatusOr maybe_home = HomeDir(); + if (!maybe_home.ok()) return maybe_home; + + std::string dot_prefixed = absl::StrCat(".", app_name); + return maybe_home.ValueOrDie().AppendUtf8(dot_prefixed); + +#else + // TODO(wilhuff): On Android, use internal storage +#error "Don't know where to store documents on this platform." + +#endif // __linux__ && !__ANDROID__ +} + +StatusOr Filesystem::LegacyDocumentsDir(absl::string_view) { + return Status(Error::kErrorUnimplemented, + "No legacy storage on this platform."); +} + +Path Filesystem::TempDir() { + const char* env_tmpdir = getenv("TMPDIR"); + if (env_tmpdir) { + return Path::FromUtf8(env_tmpdir); + } + +#if __ANDROID__ + // The /tmp directory doesn't exist as a fallback; each application is + // supposed to keep its own temporary files. Previously /data/local/tmp may + // have been reasonable, but current lore points to this being unreliable for + // writing at higher API levels or certain phone models because default + // permissions on this directory no longer permit writing. + // + // TODO(wilhuff): Validate on recent Android. +#error "Not yet sure about temporary file locations on Android." + return Path::FromUtf8("/data/local/tmp"); + +#else + return Path::FromUtf8("/tmp"); +#endif // __ANDROID__ +} +#endif // !__APPLE__ && !_WIN32 + +Status Filesystem::IsDirectory(const Path& path) { + struct stat buffer {}; + if (::stat(path.c_str(), &buffer)) { + if (errno == ENOENT) { + // Expected common error case. + return Status{Error::kErrorNotFound, path.ToUtf8String()}; + + } else if (errno == ENOTDIR) { + // This is a case where POSIX and Windows differ in behavior in a way + // that's hard to reconcile from Windows. Under POSIX, ENOTDIR indicates + // that not only does the path not exist, but that some parent of the + // path also isn't a directory. + // + // Windows, OTOH, returns ERROR_FILE_NOT_FOUND if the file doesn't exist, + // its immediate parent exists, and the parent is a directory. Otherwise + // Windows returns ERROR_PATH_NOT_FOUND. To emulate POSIX behavior you + // have to find the leaf-most existing parent and figure out if it's not a + // directory. + // + // Since we really don't care about this distinction it's easier to + // resolve this by returning NotFound here. + return Status{Error::kErrorNotFound, path.ToUtf8String()}; + } else { + return Status::FromErrno(errno, path.ToUtf8String()); + } + } + + if (!S_ISDIR(buffer.st_mode)) { + return Status{Error::kErrorFailedPrecondition, + StringFormat("Path %s exists but is not a directory", + path.ToUtf8String())}; + } + + return Status::OK(); +} + +StatusOr Filesystem::FileSize(const Path& path) { + struct stat st {}; + if (::stat(path.c_str(), &st) == 0) { + return st.st_size; + } else { + return Status::FromErrno( + errno, StringFormat("Failed to stat file: %s", path.ToUtf8String())); + } +} + +Status Filesystem::CreateDir(const Path& path) { + if (::mkdir(path.c_str(), 0777)) { + if (errno != EEXIST) { + return Status::FromErrno( + errno, + StringFormat("Could not create directory %s", path.ToUtf8String())); + } + } + + return Status::OK(); +} + +Status Filesystem::RemoveDir(const Path& path) { + if (::rmdir(path.c_str())) { + if (errno != ENOENT) { + return Status::FromErrno( + errno, + StringFormat("Could not delete directory %s", path.ToUtf8String())); + } + } + return Status::OK(); +} + +Status Filesystem::RemoveFile(const Path& path) { + if (::unlink(path.c_str())) { + if (errno != ENOENT) { + return Status::FromErrno( + errno, StringFormat("Could not delete file %s", path.ToUtf8String())); + } + } + return Status::OK(); +} + +Status Filesystem::Rename(const Path& from_path, const Path& to_path) { + if (::rename(from_path.ToUtf8String().c_str(), + to_path.ToUtf8String().c_str())) { + return Status::FromErrno(errno, from_path.ToUtf8String()); + } + + return Status::OK(); +} + +namespace { + +class PosixDirectoryIterator : public DirectoryIterator { + public: + explicit PosixDirectoryIterator(const util::Path& path); + virtual ~PosixDirectoryIterator(); + + void Next() override; + bool Valid() const override; + Path file() const override; + + private: + void Advance(); + + DIR* dir_ = nullptr; + struct dirent* entry_ = nullptr; +}; + +PosixDirectoryIterator::PosixDirectoryIterator(const util::Path& path) + : DirectoryIterator{path} { + dir_ = ::opendir(parent_.c_str()); + if (!dir_) { + status_ = Status::FromErrno( + errno, + StringFormat("Could not open directory %s", parent_.ToUtf8String())); + return; + } + Advance(); +} + +PosixDirectoryIterator::~PosixDirectoryIterator() { + if (dir_) { + if (::closedir(dir_) != 0) { + HARD_FAIL("Could not close directory %s", parent_.ToUtf8String()); + } + } +} + +void PosixDirectoryIterator::Advance() { + HARD_ASSERT(status_.ok(), "Advancing an errored iterator"); + errno = 0; + entry_ = ::readdir(dir_); + if (!entry_) { + if (errno != 0) { + status_ = Status::FromErrno( + errno, StringFormat("Could not read %s", parent_.ToUtf8String())); + } + } else if (status_.ok()) { + // Skip self- and parent-pointer + if (::strcmp(".", entry_->d_name) == 0 || + ::strcmp("..", entry_->d_name) == 0) { + Advance(); + } + } +} + +void PosixDirectoryIterator::Next() { + HARD_ASSERT(Valid(), "Next() called on invalid iterator"); + Advance(); +} + +bool PosixDirectoryIterator::Valid() const { + return status_.ok() && entry_ != nullptr; +} + +Path PosixDirectoryIterator::file() const { + HARD_ASSERT(Valid(), "file() called on invalid iterator"); + return parent_.AppendUtf8(entry_->d_name, strlen(entry_->d_name)); +} + +} // namespace + +std::unique_ptr DirectoryIterator::Create( + const util::Path& path) { + return absl::make_unique(path); +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.cc new file mode 100644 index 000000000..4e28a557a --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.cc @@ -0,0 +1,55 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/hard_assert.h" + +#include +#include +#include + +#include "Firestore/core/src/util/string_format.h" +#include "absl/base/config.h" + +namespace firebase { +namespace firestore { +namespace util { +namespace internal { + +void FailAssertion(const char* file, + const char* func, + const int line, + const std::string& message) { + Throw(ExceptionType::AssertionFailure, file, func, line, message); +} + +void FailAssertion(const char* file, + const char* func, + const int line, + const std::string& message, + const char* condition) { + std::string failure; + if (message.empty()) { + failure = condition; + } else { + failure = StringFormat("%s (expected %s)", message, condition); + } + FailAssertion(file, func, line, failure); +} + +} // namespace internal +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.h b/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.h new file mode 100644 index 000000000..26941cd20 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/hard_assert.h @@ -0,0 +1,124 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_HARD_ASSERT_H_ +#define FIRESTORE_CORE_SRC_UTIL_HARD_ASSERT_H_ + +#include +#include + +#include "Firestore/core/src/util/exception.h" +#include "Firestore/core/src/util/string_format.h" +#include "absl/base/optimization.h" + +#if defined(_MSC_VER) +#define FIRESTORE_FUNCTION_NAME __FUNCSIG__ +#else +#define FIRESTORE_FUNCTION_NAME __PRETTY_FUNCTION__ +#endif + +/** + * Invokes the internal Fail function below with all the required contextual + * information and passes additional arguments. + * + * @param message The failure message. + * @param condition The string form of the expression that failed (optional) + */ +#define INVOKE_INTERNAL_FAIL(...) \ + firebase::firestore::util::internal::FailAssertion( \ + __FILE__, FIRESTORE_FUNCTION_NAME, __LINE__, __VA_ARGS__) + +/** + * Fails the current function if the given condition is false. + * + * Unlike assert(3) or NSAssert, this macro is never compiled out. + * + * @param condition The condition to test. + * @param format (optional) A format string suitable for util::StringFormat. + * @param ... format arguments to pass to util::StringFormat. + */ +#define HARD_ASSERT(condition, ...) \ + do { \ + if (!ABSL_PREDICT_TRUE(condition)) { \ + std::string _message = \ + firebase::firestore::util::StringFormat(__VA_ARGS__); \ + INVOKE_INTERNAL_FAIL(_message, #condition); \ + } \ + } while (0) + +/** + * Unconditionally fails the current function. + * + * Unlike assert(3) or NSAssert, this macro is never compiled out. + * + * @param format A format string suitable for util::StringFormat. + * @param ... format arguments to pass to util::StringFormat. + */ +#define HARD_FAIL(...) \ + do { \ + std::string _failure = \ + firebase::firestore::util::StringFormat(__VA_ARGS__); \ + INVOKE_INTERNAL_FAIL(_failure); \ + } while (0) + +/** + * Indicates an area of the code that cannot be reached (except possibly due to + * undefined behaviour or other similar badness). The only reasonable thing to + * do in these cases is to immediately abort. + */ +#define UNREACHABLE() abort() + +/** + * Returns the given `ptr` if it is non-null; otherwise, results in a failed + * assertion, similar to `HARD_ASSERT`. This macro deliberately expands to an + * expression, so that it can be used in initialization and assignment: + * + * my_ptr_ = NOT_NULL(suspicious_ptr); + * my_smart_ptr_ = std::move(NOT_NULL(suspicious_smart_ptr)); + * + * MyClass() : my_ptr_{NOT_NULL(suspicious_ptr)} {} + * + * @param ptr The pointer to check and return. Can be a smart pointer. + */ +#define NOT_NULL(ptr) \ + (static_cast(ABSL_PREDICT_FALSE((ptr) == nullptr) \ + ? INVOKE_INTERNAL_FAIL("Expected non-null " #ptr) \ + : static_cast(0)), \ + (ptr)) // NOLINT(whitespace/indent) + +namespace firebase { +namespace firestore { +namespace util { +namespace internal { + +// A no-return helper function. To raise an assertion, use Macro instead. +ABSL_ATTRIBUTE_NORETURN void FailAssertion(const char* file, + const char* func, + int line, + const std::string& message); + +ABSL_ATTRIBUTE_NORETURN void FailAssertion(const char* file, + const char* func, + int line, + const std::string& message, + const char* condition); + +} // namespace internal +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_HARD_ASSERT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hashing.h b/Pods/FirebaseFirestore/Firestore/core/src/util/hashing.h similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hashing.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/hashing.h index c709609ba..36bd69f73 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/hashing.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/hashing.h @@ -14,16 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HASHING_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HASHING_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_HASHING_H_ +#define FIRESTORE_CORE_SRC_UTIL_HASHING_H_ #include #include #include #include -#include "Firestore/core/src/firebase/firestore/objc/objc_type_traits.h" -#include "Firestore/core/src/firebase/firestore/util/type_traits.h" +#include "Firestore/core/src/objc/objc_type_traits.h" +#include "Firestore/core/src/util/type_traits.h" #include "absl/meta/type_traits.h" #include "absl/types/optional.h" @@ -225,4 +225,4 @@ size_t Hash(const Ts&... values) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_HASHING_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_HASHING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/iterator_adaptors.h b/Pods/FirebaseFirestore/Firestore/core/src/util/iterator_adaptors.h similarity index 99% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/iterator_adaptors.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/iterator_adaptors.h index 042fd720f..16a022454 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/iterator_adaptors.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/iterator_adaptors.h @@ -16,8 +16,8 @@ // Provides some iterator adaptors and views. -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ITERATOR_ADAPTORS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ITERATOR_ADAPTORS_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_ITERATOR_ADAPTORS_H_ +#define FIRESTORE_CORE_SRC_UTIL_ITERATOR_ADAPTORS_H_ #include #include @@ -809,4 +809,4 @@ typename reversed_view_type::type reversed_view(const C& c) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ITERATOR_ADAPTORS_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_ITERATOR_ADAPTORS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/log.h b/Pods/FirebaseFirestore/Firestore/core/src/util/log.h new file mode 100644 index 000000000..0681eaf98 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/log.h @@ -0,0 +1,103 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_LOG_H_ +#define FIRESTORE_CORE_SRC_UTIL_LOG_H_ + +#include + +#include "Firestore/core/src/util/string_format.h" + +namespace firebase { +namespace firestore { +namespace util { + +// Levels used when logging messages. +enum LogLevel { + // Debug Log Level + kLogLevelDebug, + // Notice Log Level + kLogLevelNotice, + // Warning Log Level + kLogLevelWarning, + // Error Log Level + kLogLevelError, +}; + +// Log a message if kLogLevelDebug is enabled. Arguments are not evaluated if +// logging is disabled. +// +// @param format A format string suitable for use with `util::StringFormat` +// @param ... C++ variadic arguments that match the format string. Not C +// varargs. +#define LOG_DEBUG(...) \ + do { \ + namespace _util = firebase::firestore::util; \ + if (_util::LogIsLoggable(_util::kLogLevelDebug)) { \ + std::string _message = _util::StringFormat(__VA_ARGS__); \ + _util::LogMessage(_util::kLogLevelDebug, _message); \ + } \ + } while (0) + +// Log a message if kLogLevelWarn is enabled (it is by default). Arguments are +// not evaluated if logging is disabled. +// +// @param format A format string suitable for use with `util::StringFormat` +// @param ... C++ variadic arguments that match the format string. Not C +// varargs. +#define LOG_WARN(...) \ + do { \ + namespace _util = firebase::firestore::util; \ + if (_util::LogIsLoggable(_util::kLogLevelWarning)) { \ + std::string _message = _util::StringFormat(__VA_ARGS__); \ + _util::LogMessage(_util::kLogLevelWarning, _message); \ + } \ + } while (0) + +// Log a message if kLogLevelError is enabled (it is by default). Arguments are +// not evaluated if logging is disabled. +// +// @param format A format string suitable for use with `util::StringFormat` +// @param ... C++ variadic arguments that match the format string. Not C +// varargs. +#define LOG_ERROR(...) \ + do { \ + namespace _util = firebase::firestore::util; \ + if (_util::LogIsLoggable(_util::kLogLevelError)) { \ + std::string _message = _util::StringFormat(__VA_ARGS__); \ + _util::LogMessage(_util::kLogLevelError, _message); \ + } \ + } while (0) + +// Tests to see if the given log level is loggable. +bool LogIsLoggable(LogLevel level); + +// Is debug logging enabled? +inline bool LogIsDebugEnabled() { + return LogIsLoggable(kLogLevelDebug); +} + +// All messages at or above the specified log level value are displayed. +void LogSetLevel(LogLevel level); + +// Log a message at the given level. +void LogMessage(LogLevel log_level, const std::string& message); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_LOG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/log_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/util/log_apple.mm similarity index 81% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/log_apple.mm rename to Pods/FirebaseFirestore/Firestore/core/src/util/log_apple.mm index 09d185184..23f53a73a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/log_apple.mm +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/log_apple.mm @@ -1,5 +1,5 @@ /* - * Copyright 2017 Google + * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,17 +14,18 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/log.h" +#include "Firestore/core/src/util/log.h" #if defined(__APPLE__) -#import #import #include #include -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#import "FirebaseCore/Sources/Private/FirebaseCoreInternal.h" + +#include "Firestore/core/src/util/string_apple.h" namespace firebase { namespace firestore { @@ -69,6 +70,16 @@ void LogSetLevel(LogLevel level) { FIRSetLoggerLevel(ToFIRLoggerLevel(level)); } +// Note that FIRLogger's default level can be changed by persisting a +// debug_mode setting in user defaults. Check for defaults getting in your way +// with: +// +// defaults read firestore_util_test +// +// You can change it with: +// +// defaults write firestore_util_test /google/firebase/debug_mode NO + bool LogIsLoggable(LogLevel level) { return FIRIsLoggableLevel(ToFIRLoggerLevel(level), false); } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/nullability.h b/Pods/FirebaseFirestore/Firestore/core/src/util/nullability.h similarity index 85% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/nullability.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/nullability.h index 4313f26cd..20ea9d84c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/nullability.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/nullability.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_NULLABILITY_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_NULLABILITY_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_NULLABILITY_H_ +#define FIRESTORE_CORE_SRC_UTIL_NULLABILITY_H_ namespace firebase { namespace firestore { @@ -41,4 +41,4 @@ namespace util { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_NULLABILITY_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_NULLABILITY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/ordered_code.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.cc similarity index 99% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/ordered_code.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.cc index 76c8f1ec4..81a3f503c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/ordered_code.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.cc @@ -14,10 +14,10 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/ordered_code.h" +#include "Firestore/core/src/util/ordered_code.h" -#include "Firestore/core/src/firebase/firestore/util/bits.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/bits.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/base/internal/endian.h" #include "absl/base/internal/unaligned_access.h" #include "absl/base/port.h" diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/ordered_code.h b/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.h similarity index 96% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/ordered_code.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.h index 57b84bd09..186f82791 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/ordered_code.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/ordered_code.h @@ -36,8 +36,8 @@ // This module is often useful when generating multi-part sstable // keys that have to be ordered in a particular fashion. -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ORDERED_CODE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ORDERED_CODE_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_ +#define FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_ #include @@ -126,4 +126,4 @@ class OrderedCode { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_ORDERED_CODE_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_ORDERED_CODE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/path.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/path.cc similarity index 94% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/path.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/path.cc index 0d2d33dd2..648ee8159 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/path.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/path.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/path.h" +#include "Firestore/core/src/util/path.h" #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" -#include "Firestore/core/src/firebase/firestore/util/string_win.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_win.h" #include "absl/strings/ascii.h" #include "absl/strings/string_view.h" @@ -203,6 +203,12 @@ bool Path::IsAbsolute() const { return util::IsAbsolute(c_str(), size()); } +bool Path::HasExtension(const Path& ext) const { + return pathname_.size() >= ext.size() && + pathname_.compare(pathname_.size() - ext.size(), ext.size(), + ext.native_value()) == 0; +} + Path Path::AppendUtf8(absl::string_view path) const { Path result{*this}; result.MutableAppendUtf8(path); diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/path.h b/Pods/FirebaseFirestore/Firestore/core/src/util/path.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/path.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/path.h index ce68c3504..27fe69070 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/path.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/path.h @@ -14,13 +14,13 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_PATH_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_PATH_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_PATH_H_ +#define FIRESTORE_CORE_SRC_UTIL_PATH_H_ #include #include -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/util/string_apple.h" #include "absl/strings/string_view.h" namespace firebase { @@ -72,8 +72,7 @@ class Path { } #endif - Path() { - } + Path() = default; const string_type& native_value() const { return pathname_; @@ -83,6 +82,10 @@ class Path { return pathname_.c_str(); } + bool empty() const { + return pathname_.empty(); + } + size_t size() const { return pathname_.size(); } @@ -123,6 +126,14 @@ class Path { */ bool IsAbsolute() const; + /** + * Returns true if this pathname's last component has the given file + * extension. + * + * @param ext The file extension (including leading dot). + */ + bool HasExtension(const Path& ext) const; + /** * Returns a new Path with the given UTF-8 encoded path segment appended, * as if by calling `Append(Path::FromUtf8(path))`. @@ -213,4 +224,4 @@ class Path { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_PATH_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_PATH_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/range.h b/Pods/FirebaseFirestore/Firestore/core/src/util/range.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/range.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/range.h index 9e96c67f2..87db48a7e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/range.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/range.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_RANGE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_RANGE_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_RANGE_H_ +#define FIRESTORE_CORE_SRC_UTIL_RANGE_H_ #include #include @@ -75,4 +75,4 @@ range make_range(Iterator begin, Iterator end) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_RANGE_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_RANGE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/sanitizers.h b/Pods/FirebaseFirestore/Firestore/core/src/util/sanitizers.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/sanitizers.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/sanitizers.h index 3847d3960..215fafcd9 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/sanitizers.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/sanitizers.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_SANITIZERS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_SANITIZERS_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_SANITIZERS_H_ +#define FIRESTORE_CORE_SRC_UTIL_SANITIZERS_H_ // Clang feature detection compiler extension #if defined(__has_feature) @@ -52,4 +52,4 @@ // There doesn't appear to be a __has_feature check for ubsan. -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_SANITIZERS_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_SANITIZERS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.cc new file mode 100644 index 000000000..2a7a9bb33 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.cc @@ -0,0 +1,133 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/schedule.h" + +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/task.h" +#include "absl/memory/memory.h" + +namespace firebase { +namespace firestore { +namespace util { + +Schedule::~Schedule() { + Clear(); +} + +void Schedule::Clear() { + std::unique_lock lock{mutex_}; + + for (Task* task : scheduled_) { + task->Release(); + } + + scheduled_.clear(); +} + +void Schedule::Push(Task* task) { + InsertPreservingOrder(task); +} + +Task* Schedule::PopIfDue() { + std::lock_guard lock{mutex_}; + + if (HasDueLocked()) { + return ExtractLocked(scheduled_.begin()); + } + return nullptr; +} + +Task* Schedule::PopBlocking() { + std::unique_lock lock{mutex_}; + + while (true) { + cv_.wait(lock, [this] { return !scheduled_.empty(); }); + + // To minimize busy waiting, sleep until either the nearest entry in the + // future either changes, or else becomes due. + + // Workaround for Visual Studio 2015: cast to a time point with resolution + // that's at least as fine-grained as the clock on which `wait_until` is + // parametrized. + const auto until = std::chrono::time_point_cast( + scheduled_.front()->target_time()); + cv_.wait_until(lock, until, [this, until] { + return scheduled_.empty() || scheduled_.front()->target_time() != until; + }); + + // There are 3 possibilities why `wait_until` has returned: + // - `wait_until` has timed out, in which case the current time is at + // least `until`, so there must be an overdue entry; + // - a new entry has been added which comes before `until`. It must be + // either overdue (in which case `HasDueLocked` will break the cycle), + // or else `until` must be reevaluated (on the next iteration of the + // loop); + // - `until` entry has been removed (including the case where the queue + // has become empty). This means `until` has to be reevaluated, similar + // to #2. + + if (HasDueLocked()) { + return ExtractLocked(scheduled_.begin()); + } + } +} + +bool Schedule::empty() const { + std::lock_guard lock{mutex_}; + return scheduled_.empty(); +} + +size_t Schedule::size() const { + std::lock_guard lock{mutex_}; + return scheduled_.size(); +} + +void Schedule::InsertPreservingOrder(Task* new_entry) { + std::lock_guard lock{mutex_}; + + const auto insertion_point = + std::upper_bound(scheduled_.begin(), scheduled_.end(), new_entry, + [](Task* lhs, Task* rhs) { + return lhs->target_time() < rhs->target_time(); + }); + scheduled_.insert(insertion_point, new_entry); + + cv_.notify_one(); +} + +// This function expects the mutex to be already locked. +bool Schedule::HasDueLocked() const { + namespace chr = std::chrono; + const auto now = chr::time_point_cast(Clock::now()); + return !scheduled_.empty() && now >= scheduled_.front()->target_time(); +} + +// This function expects the mutex to be already locked. +Task* Schedule::ExtractLocked(const Iterator where) { + HARD_ASSERT(!scheduled_.empty(), + "Trying to pop an entry from an empty queue."); + + Task* result = *where; + scheduled_.erase(where); + cv_.notify_one(); + + return result; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.h b/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.h new file mode 100644 index 000000000..2d9700bc2 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/schedule.h @@ -0,0 +1,130 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_SCHEDULE_H_ +#define FIRESTORE_CORE_SRC_UTIL_SCHEDULE_H_ + +#include +#include // NOLINT(build/c++11) +#include +#include // NOLINT(build/c++11) +#include + +#include "Firestore/core/src/util/executor.h" + +namespace firebase { +namespace firestore { +namespace util { + +class Task; + +// A thread-safe class similar to a priority queue where the entries are +// prioritized by the time for which they're scheduled. Entries scheduled for +// the exact same time are prioritized in FIFO order. +// +// The main function of `Schedule` is `PopBlocking`, which sleeps until an entry +// becomes available. It correctly handles entries being asynchronously added or +// removed from the schedule. +// +// The details of time management are completely concealed within the class. +// Once an entry is scheduled, there is no way to reschedule or even retrieve +// the time. +class Schedule { + // Internal invariants: + // - entries are always in sorted order, leftmost entry is always the most + // due; + // - each operation modifying the queue notifies the condition variable `cv_`. + public: + using Duration = Executor::Milliseconds; + using Clock = Executor::Clock; + // Entries are scheduled using absolute time. + using TimePoint = Executor::TimePoint; + + ~Schedule(); + + void Clear(); + + // Schedules a task for it's specified target time. + void Push(Task* task); + + // If the queue contains at least one entry for which the scheduled time is + // due now (according to the system clock), removes the entry which is the + // most overdue from the queue and returns it. If no entry is due, returns + // `nullptr`. + Task* PopIfDue(); + + // Blocks until at least one entry is available for which the scheduled time + // is due now (according to the system clock), removes the entry which is the + // most overdue from the queue and returns it. The function will attempt to + // minimize both the waiting time and busy waiting. + Task* PopBlocking(); + + bool empty() const; + + size_t size() const; + + // Removes the first entry satisfying predicate from the queue and returns it. + // If no such entry exists, returns `nullptr`. The predicate is applied to + // entries in order according to their scheduled time. + // + // Note that this function doesn't take into account whether the removed entry + // is past its due time. + template + Task* RemoveIf(const Pred pred) { + std::lock_guard lock{mutex_}; + + for (auto iter = scheduled_.begin(), end = scheduled_.end(); iter != end; + ++iter) { + Task* task = *iter; + if (pred(*task)) { + return ExtractLocked(iter); + } + } + return nullptr; + } + + // Checks whether the queue contains an entry satisfying the given predicate. + template + bool Contains(const Pred pred) const { + std::lock_guard lock{mutex_}; + return std::any_of(scheduled_.begin(), scheduled_.end(), + [&pred](Task* t) { return pred(*t); }); + } + + private: + // All removals are on the front, but most insertions are expected to be on + // the back. + using Container = std::deque; + using Iterator = typename Container::iterator; + + void InsertPreservingOrder(Task* new_entry); + + // This function expects the mutex to be already locked. + bool HasDueLocked() const; + + // This function expects the mutex to be already locked. + Task* ExtractLocked(const Iterator where); + + mutable std::mutex mutex_; + std::condition_variable cv_; + Container scheduled_; +}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_SCHEDULE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/secure_random.h b/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/secure_random.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/secure_random.h index f030b5e2d..9bb4d00ea 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/secure_random.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random.h @@ -14,11 +14,10 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_SECURE_RANDOM_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_SECURE_RANDOM_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_SECURE_RANDOM_H_ +#define FIRESTORE_CORE_SRC_UTIL_SECURE_RANDOM_H_ #include - #include namespace firebase { @@ -72,4 +71,4 @@ class SecureRandom { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_SECURE_RANDOM_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_SECURE_RANDOM_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/secure_random_arc4random.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random_arc4random.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/secure_random_arc4random.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/secure_random_arc4random.cc index d7e9be354..76c34255b 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/secure_random_arc4random.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/secure_random_arc4random.cc @@ -14,9 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/secure_random.h" +#include "Firestore/core/src/util/secure_random.h" -#include "Firestore/core/src/firebase/firestore/util/config.h" +#include "Firestore/core/src/util/config.h" #if HAVE_ARC4RANDOM diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/status.cc similarity index 78% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/status.cc index b5860b18b..6048706f8 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/status.cc @@ -14,21 +14,30 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/util/status.h" #include #include -#include "Firestore/core/src/firebase/firestore/util/string_format.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_format.h" #include "absl/memory/memory.h" namespace firebase { namespace firestore { namespace util { -Status::Status(Error code, absl::string_view msg) { - HARD_ASSERT(code != Error::Ok); - state_ = State::MakePtr(code, static_cast(msg)); +Status::Status(Error code, std::string msg) { + HARD_ASSERT(code != Error::kErrorOk); + state_ = State::MakePtr(code, std::move(msg)); +} + +Status Status::FromCause(std::string message, const Status& cause) { + if (cause.ok()) { + return cause; + } + + return Status(cause.code(), std::move(message)).CausedBy(cause); } void Status::Update(const Status& new_status) { @@ -66,7 +75,7 @@ Status& Status::WithPlatformError(std::unique_ptr error) { HARD_ASSERT(!ok(), "Platform errors should not be applied to Status::OK()"); if (IsMovedFrom()) { std::string message = moved_from_message(); - state_ = State::MakePtr(Error::Internal, std::move(message)); + state_ = State::MakePtr(Error::kErrorInternal, std::move(message)); } state_->platform_error = std::move(error); return *this; @@ -107,52 +116,52 @@ std::string Status::ToString() const { } else { std::string result; switch (code()) { - case Error::Cancelled: + case Error::kErrorCancelled: result = "Cancelled"; break; - case Error::Unknown: + case Error::kErrorUnknown: result = "Unknown"; break; - case Error::InvalidArgument: + case Error::kErrorInvalidArgument: result = "Invalid argument"; break; - case Error::DeadlineExceeded: + case Error::kErrorDeadlineExceeded: result = "Deadline exceeded"; break; - case Error::NotFound: + case Error::kErrorNotFound: result = "Not found"; break; - case Error::AlreadyExists: + case Error::kErrorAlreadyExists: result = "Already exists"; break; - case Error::PermissionDenied: + case Error::kErrorPermissionDenied: result = "Permission denied"; break; - case Error::Unauthenticated: + case Error::kErrorUnauthenticated: result = "Unauthenticated"; break; - case Error::ResourceExhausted: + case Error::kErrorResourceExhausted: result = "Resource exhausted"; break; - case Error::FailedPrecondition: + case Error::kErrorFailedPrecondition: result = "Failed precondition"; break; - case Error::Aborted: + case Error::kErrorAborted: result = "Aborted"; break; - case Error::OutOfRange: + case Error::kErrorOutOfRange: result = "Out of range"; break; - case Error::Unimplemented: + case Error::kErrorUnimplemented: result = "Unimplemented"; break; - case Error::Internal: + case Error::kErrorInternal: result = "Internal"; break; - case Error::Unavailable: + case Error::kErrorUnavailable: result = "Unavailable"; break; - case Error::DataLoss: + case Error::kErrorDataLoss: result = "Data loss"; break; default: diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/status.h b/Pods/FirebaseFirestore/Firestore/core/src/util/status.h new file mode 100644 index 000000000..84a77164c --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/status.h @@ -0,0 +1,247 @@ +/* + * Copyright 2015, 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_STATUS_H_ +#define FIRESTORE_CORE_SRC_UTIL_STATUS_H_ + +#if _WIN32 +#include +#endif + +#include +#include +#include +#include +#include + +#include "Firestore/core/include/firebase/firestore/firestore_errors.h" +#include "Firestore/core/src/util/status_fwd.h" +#include "absl/base/attributes.h" +#include "absl/strings/string_view.h" + +#if __OBJC__ +@class NSError; +#endif + +namespace firebase { +namespace firestore { +namespace util { + +class PlatformError; + +/// Denotes success or failure of a call. +class ABSL_MUST_USE_RESULT Status { + public: + /// Create a success status. + Status() = default; + + /// \brief Create a status with the specified error code and msg as a + /// human-readable string containing more detailed information. + Status(Error code, std::string msg); + + /// Copy the specified status. + Status(const Status& s); + void operator=(const Status& s); + + /// Move the specified status. + Status(Status&& s) noexcept; + void operator=(Status&& s) noexcept; + + static Status OK() { + return Status(); + } + + /// Creates a status object from the given errno error code and message. + static Status FromErrno(int errno_code, absl::string_view message); + +#if defined(_WIN32) + static Status FromLastError(DWORD error, absl::string_view message); +#endif // defined(_WIN32) + +#if defined(__OBJC__) + static Status FromNSError(NSError* error); + + NSError* ToNSError() const; +#endif // defined(__OBJC__) + + /// Creates a status object with the given cause's code, and a message + /// combining the given error message with the cause's error message. + static Status FromCause(std::string message, const Status& cause); + + /// Returns true iff the status indicates success. + bool ok() const { + return state_ == nullptr; + } + + Error code() const { + return ok() ? Error::kErrorOk + : (IsMovedFrom() ? Error::kErrorInternal : state_->code); + } + + const std::string& error_message() const { + return ok() ? empty_string() + : (IsMovedFrom() ? moved_from_message() : state_->msg); + } + + bool operator==(const Status& x) const; + bool operator!=(const Status& x) const; + + /// \brief If `ok()`, stores `new_status` into `*this`. If `!ok()`, + /// preserves the current status, but may augment with additional + /// information about `new_status`. + /// + /// Convenient way of keeping track of the first error encountered. + /// Instead of: + /// `if (overall_status.ok()) overall_status = new_status` + /// Use: + /// `overall_status.Update(new_status);` + void Update(const Status& new_status); + + /// \brief Adds the message in the given cause to this Status. + /// + /// \return *this + Status& CausedBy(const Status& cause); + + Status& WithPlatformError(std::unique_ptr error); + + /// \brief Return a string representation of this status suitable for + /// printing. Returns the string `"OK"` for success. + std::string ToString() const; + friend std::ostream& operator<<(std::ostream& out, const Status& status); + + // Ignores any errors. This method does nothing except potentially suppress + // complaints from any tools that are checking that errors are not dropped on + // the floor. + void IgnoreError() const; + + private: + static const std::string& empty_string(); + static const std::string& moved_from_message(); + + struct State { + State() = default; + State(const State& other); + State(Error code, std::string&& msg); + + struct Deleter { + void operator()(const State* ptr) const; + }; + // A `unique_ptr` with a custom deleter. If the pointer's value has been set + // to a special value (0x01) to indicate it is moved, invoking the custom + // deleter will be a no-op. + using StatePtr = std::unique_ptr; + + static State* MovedFromIndicator() { + return reinterpret_cast(0x01); + } + + template + static StatePtr MakePtr(Args&&... args) { + return StatePtr(new State(std::forward(args)...)); + } + + Error code; + std::string msg; + + // An additional platform-specific error representation that was used to + // generate this Status. The PlatformError does not meaningfully contribute + // to the identity of this Status: it exists to allow tunneling e.g. + // NSError* to Status and back to NSError* losslessly. + std::unique_ptr platform_error; + }; + + // Asserts if `state_` is a valid pointer, should be used at all places where + // it is used as a pointer, instead of using `state_`. + bool IsMovedFrom() const { + return state_.get() == State::MovedFromIndicator(); + } + + // OK status has a `nullptr` `state_`. If this instance is moved, state_ has + // the value of `State::MovedFromIndicator()`. Otherwise `state_` points to + // a `State` structure containing the error code and message(s). + State::StatePtr state_; + + // Tags this instance as `moved-from`. + void SetMovedFrom(); + + void SlowCopyFrom(const State* src); +}; + +class PlatformError { + public: + virtual ~PlatformError() = default; + + virtual std::unique_ptr Copy() = 0; + + /** + * Creates a new PlatformError with the given code and message, whose cause is + * this PlatformError. + */ + virtual std::unique_ptr WrapWith(Error code, + std::string message) = 0; +}; + +inline Status::Status(const Status& s) + : state_{s.state_ == nullptr ? State::StatePtr{} + : State::MakePtr(*s.state_)} { +} + +inline Status::State::State(const State& s) + : code(s.code), + msg(s.msg), + platform_error((s.platform_error == nullptr) ? nullptr + : s.platform_error->Copy()) { +} + +inline Status::State::State(Error code, std::string&& msg) + : code(code), msg(std::move(msg)) { +} + +inline void Status::operator=(const Status& s) { + // The following condition catches both aliasing (when this == &s), + // and the common case where both s and *this are ok. + if (state_ != s.state_) { + SlowCopyFrom(s.state_.get()); + } +} + +inline Status::Status(Status&& s) noexcept : state_(std::move(s.state_)) { + s.SetMovedFrom(); +} + +inline void Status::operator=(Status&& s) noexcept { + // Moving into self is a no-op. + if (this != &s) { + state_ = std::move(s.state_); + s.SetMovedFrom(); + } +} + +inline bool Status::operator==(const Status& x) const { + return (this->state_ == x.state_) || (ToString() == x.ToString()); +} + +inline bool Status::operator!=(const Status& x) const { + return !(*this == x); +} + +typedef std::function StatusCallback; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STATUS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_apple.mm b/Pods/FirebaseFirestore/Firestore/core/src/util/status_apple.mm similarity index 89% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_apple.mm rename to Pods/FirebaseFirestore/Firestore/core/src/util/status_apple.mm index 87f21cfb9..f8654b73a 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_apple.mm +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/status_apple.mm @@ -14,12 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/util/status.h" #if defined(__APPLE__) -#include "Firestore/core/src/firebase/firestore/util/error_apple.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" +#include "Firestore/core/src/util/error_apple.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/string_format.h" #include "absl/memory/memory.h" namespace firebase { @@ -69,9 +70,9 @@ explicit UnderlyingNSError(NSError* error) : error_(error) { */ Status FromFirestoreNSError(NSError* error) { auto error_code = static_cast(error.code); - HARD_ASSERT( - error_code >= Error::Cancelled && error_code <= Error::Unauthenticated, - "Unknown error code"); + HARD_ASSERT(error_code >= Error::kErrorCancelled && + error_code <= Error::kErrorUnauthenticated, + "Unknown error code"); auto original = UnderlyingNSError::Create(error); @@ -103,7 +104,7 @@ Status FromFirestoreNSError(NSError* error) { error = error.userInfo[NSUnderlyingErrorKey]; } - return Status{Error::Unknown, + return Status{Error::kErrorUnknown, StringFormat("Unknown error: %s", original->error())} .WithPlatformError(std::move(original)); } diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/status_errno.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/status_errno.cc new file mode 100644 index 000000000..21f15aaf2 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/status_errno.cc @@ -0,0 +1,199 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/status.h" + +#include + +#include "Firestore/core/src/util/strerror.h" +#include "Firestore/core/src/util/string_format.h" + +namespace firebase { +namespace firestore { +namespace util { + +/// Returns the Canonical error code for the given errno value. +static Error CodeForErrno(int errno_code) { + switch (errno_code) { + case 0: + return Error::kErrorOk; + + // Internal canonical mappings call these failed preconditions, but for + // our purposes these must indicate an internal error in file handling. + case EBADF: // Invalid file descriptor +#if defined(EBADFD) + case EBADFD: // File descriptor in bad state +#endif + return Error::kErrorInternal; + + case EINVAL: // Invalid argument + case ENAMETOOLONG: // Filename too long + case E2BIG: // Argument list too long + case EDESTADDRREQ: // Destination address required + case EDOM: // Mathematics argument out of domain of function + case EFAULT: // Bad address + case EILSEQ: // Illegal byte sequence + case ENOPROTOOPT: // Protocol not available + case ENOSTR: // Not a STREAM + case ENOTSOCK: // Not a socket + case ENOTTY: // Inappropriate I/O control operation + case EPROTOTYPE: // Protocol wrong type for socket + case ESPIPE: // Invalid seek + return Error::kErrorInvalidArgument; + + case ETIMEDOUT: // Connection timed out + case ETIME: // Timer expired + return Error::kErrorDeadlineExceeded; + + case ENODEV: // No such device + case ENOENT: // No such file or directory +#if defined(ENOMEDIUM) + case ENOMEDIUM: // No medium found +#endif + case ENXIO: // No such device or address + case ESRCH: // No such process + return Error::kErrorNotFound; + + case EEXIST: // File exists + case EADDRNOTAVAIL: // Address not available + case EALREADY: // Connection already in progress +#if defined(ENOTUNIQ) + case ENOTUNIQ: // Name not unique on network +#endif + return Error::kErrorAlreadyExists; + + case EPERM: // Operation not permitted + case EACCES: // Permission denied +#if defined(ENOKEY) + case ENOKEY: // Required key not available +#endif + case EROFS: // Read only file system + return Error::kErrorPermissionDenied; + + case ENOTEMPTY: // Directory not empty + case EISDIR: // Is a directory + case ENOTDIR: // Not a directory + case EADDRINUSE: // Address already in use + case EBUSY: // Device or resource busy + case ECHILD: // No child processes + case EISCONN: // Socket is connected +#if defined(EISNAM) + case EISNAM: // Is a named type file +#endif +#if defined(ENOTBLK) + case ENOTBLK: // Block device required +#endif + case ENOTCONN: // The socket is not connected + case EPIPE: // Broken pipe +#if defined(ESHUTDOWN) + case ESHUTDOWN: // Cannot send after transport endpoint shutdown +#endif + case ETXTBSY: // Text file busy +#if defined(EUNATCH) + case EUNATCH: // Protocol driver not attached +#endif + return Error::kErrorFailedPrecondition; + + case ENOSPC: // No space left on device +#if defined(EDQUOT) + case EDQUOT: // Disk quota exceeded +#endif + case EMFILE: // Too many open files + case EMLINK: // Too many links + case ENFILE: // Too many open files in system + case ENOBUFS: // No buffer space available + case ENODATA: // No message is available on the STREAM read queue + case ENOMEM: // Not enough space + case ENOSR: // No STREAM resources +#if defined(EUSERS) + case EUSERS: // Too many users +#endif + return Error::kErrorResourceExhausted; + +#if defined(ECHRNG) + case ECHRNG: // Channel number out of range +#endif + case EFBIG: // File too large + case EOVERFLOW: // Value too large to be stored in data type + case ERANGE: // Result too large + return Error::kErrorOutOfRange; + +#if defined(ENOPKG) + case ENOPKG: // Package not installed +#endif + case ENOSYS: // Function not implemented + case ENOTSUP: // Operation not supported + case EAFNOSUPPORT: // Address family not supported +#if defined(EPFNOSUPPORT) + case EPFNOSUPPORT: // Protocol family not supported +#endif + case EPROTONOSUPPORT: // Protocol not supported +#if defined(ESOCKTNOSUPPORT) + case ESOCKTNOSUPPORT: // Socket type not supported +#endif + case EXDEV: // Improper link + return Error::kErrorUnimplemented; + + case EAGAIN: // Resource temporarily unavailable +#if defined(ECOMM) + case ECOMM: // Communication error on send +#endif + case ECONNREFUSED: // Connection refused + case ECONNABORTED: // Connection aborted + case ECONNRESET: // Connection reset + case EINTR: // Interrupted function call +#if defined(EHOSTDOWN) + case EHOSTDOWN: // Host is down +#endif + case EHOSTUNREACH: // Host is unreachable + case ENETDOWN: // Network is down + case ENETRESET: // Connection aborted by network + case ENETUNREACH: // Network unreachable + case ENOLCK: // No locks available + case ENOLINK: // Link has been severed +#if defined(ENONET) + case ENONET: // Machine is not on the network +#endif + return Error::kErrorUnavailable; + + case EDEADLK: // Resource deadlock avoided +#if defined(ESTALE) + case ESTALE: // Stale file handle +#endif + return Error::kErrorAborted; + + case ECANCELED: // Operation cancelled + return Error::kErrorCancelled; + + default: + return Error::kErrorUnknown; + } +} + +Status Status::FromErrno(int errno_code, absl::string_view msg) { + if (errno_code == 0) { + return Status::OK(); + } + + Error canonical_code = CodeForErrno(errno_code); + return Status{canonical_code, + util::StringFormat("%s (errno %s: %s)", msg, errno_code, + StrError(errno_code))}; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_fwd.h b/Pods/FirebaseFirestore/Firestore/core/src/util/status_fwd.h similarity index 83% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_fwd.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/status_fwd.h index 65ee204ed..3c9b38c1f 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/status_fwd.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/status_fwd.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUS_FWD_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUS_FWD_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STATUS_FWD_H_ +#define FIRESTORE_CORE_SRC_UTIL_STATUS_FWD_H_ #include @@ -39,4 +39,4 @@ using StatusOrCallback = std::function)>; } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUS_FWD_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STATUS_FWD_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/status_win.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/status_win.cc new file mode 100644 index 000000000..175bbcf4d --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/status_win.cc @@ -0,0 +1,106 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/status.h" + +#if defined(_WIN32) + +#include "Firestore/core/src/util/string_format.h" +#include "Firestore/core/src/util/string_win.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Returns the Canonical error code for the given Windows API error code as + * obtained from GetLastError(). + */ +static Error CodeForLastError(DWORD error) { + switch (error) { + case ERROR_SUCCESS: + return Error::kErrorOk; + + // return Error::kErrorInternal; + + case ERROR_INVALID_FUNCTION: + case ERROR_INVALID_HANDLE: + case ERROR_INVALID_NAME: + return Error::kErrorInvalidArgument; + + // return Error::kErrorDeadlineExceeded; + + case ERROR_FILE_NOT_FOUND: + case ERROR_PATH_NOT_FOUND: + case ERROR_INVALID_DRIVE: + case ERROR_BAD_NETPATH: + case ERROR_DEV_NOT_EXIST: + return Error::kErrorNotFound; + + case ERROR_FILE_EXISTS: + case ERROR_ALREADY_EXISTS: + return Error::kErrorAlreadyExists; + + case ERROR_ACCESS_DENIED: + case ERROR_INVALID_ACCESS: + case ERROR_SHARING_VIOLATION: + case ERROR_WRITE_PROTECT: + case ERROR_LOCK_VIOLATION: + return Error::kErrorPermissionDenied; + + // return Error::kErrorFailedPrecondition; + + case ERROR_TOO_MANY_OPEN_FILES: + case ERROR_NOT_ENOUGH_MEMORY: + case ERROR_OUTOFMEMORY: + case ERROR_NO_MORE_FILES: + case ERROR_DISK_FULL: + case ERROR_HANDLE_DISK_FULL: + return Error::kErrorResourceExhausted; + + // return Error::kErrorOutOfRange; + + case ERROR_CALL_NOT_IMPLEMENTED: + return Error::kErrorUnimplemented; + + case ERROR_NOT_READY: + return Error::kErrorUnavailable; + + // return Error::kErrorAborted; + + // return Error::kErrorCancelled; + + default: + return Error::kErrorUnknown; + } +} + +Status Status::FromLastError(DWORD error, absl::string_view msg) { + if (error == ERROR_SUCCESS) { + return Status::OK(); + } + + Error canonical_code = CodeForLastError(error); + std::string error_text = LastErrorMessage(error); + return Status{canonical_code, util::StringFormat("%s (error %s: %s)", msg, + error, error_text)}; +} + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // defined(_WIN32) diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.cc similarity index 86% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/statusor.cc index 56ac5909d..6b4f2da86 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.cc @@ -14,8 +14,9 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/statusor.h" -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/statusor.h" + +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { @@ -27,7 +28,7 @@ void Helper::HandleInvalidStatusCtorArg(Status* status) { "An OK status is not a valid constructor argument to StatusOr"; HARD_FAIL("%s", kMessage); // Fall back to Internal for non-debug builds - *status = Status(Error::Internal, kMessage); + *status = Status(Error::kErrorInternal, kMessage); } void Helper::Crash(const Status& status) { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor.h b/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h index 587fc457f..daf0627e8 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/statusor.h @@ -59,7 +59,7 @@ // // StatusOr FooFactory::MakeNewFoo(int arg) { // if (arg <= 0) { -// return Status(Error::InvalidArgument, +// return Status(Error::kErrorInvalidArgument, // "Arg must be positive"); // } else { // return new Foo(arg); @@ -71,14 +71,14 @@ // cannot be an alias for the current value, or anything owned by the current // value. -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUSOR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUSOR_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STATUSOR_H_ +#define FIRESTORE_CORE_SRC_UTIL_STATUSOR_H_ #include #include "Firestore/core/include/firebase/firestore/firestore_errors.h" -#include "Firestore/core/src/firebase/firestore/util/status.h" -#include "Firestore/core/src/firebase/firestore/util/statusor_internals.h" +#include "Firestore/core/src/util/status.h" +#include "Firestore/core/src/util/statusor_internals.h" #include "absl/base/attributes.h" #include "absl/strings/string_view.h" @@ -150,7 +150,7 @@ class ABSL_MUST_USE_RESULT StatusOr // // REQUIRES: !status.ok(). This requirement is DCHECKed. // In optimized builds, passing Status::OK() here will have the effect - // of passing Error::Internal as a fallback. + // of passing Error::kErrorInternal as a fallback. StatusOr(const Status& status); // NOLINT: allow non-explicit 1-param ctor StatusOr& operator=(const Status& status); @@ -214,7 +214,7 @@ class ABSL_MUST_USE_RESULT StatusOr // Implementation details for StatusOr template -StatusOr::StatusOr() : Base(Status(Error::Unknown, "")) { +StatusOr::StatusOr() : Base(Status(Error::kErrorUnknown, "")) { } template @@ -320,4 +320,4 @@ void StatusOr::IgnoreError() const { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUSOR_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STATUSOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor_internals.h b/Pods/FirebaseFirestore/Firestore/core/src/util/statusor_internals.h similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor_internals.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/statusor_internals.h index e662307c5..e7c6fe679 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/statusor_internals.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/statusor_internals.h @@ -14,12 +14,12 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUSOR_INTERNALS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUSOR_INTERNALS_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STATUSOR_INTERNALS_H_ +#define FIRESTORE_CORE_SRC_UTIL_STATUSOR_INTERNALS_H_ #include -#include "Firestore/core/src/firebase/firestore/util/status.h" +#include "Firestore/core/src/util/status.h" #include "absl/base/attributes.h" namespace firebase { @@ -255,4 +255,4 @@ struct TraitsBase { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STATUSOR_INTERNALS_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STATUSOR_INTERNALS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/strerror.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.cc similarity index 97% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/strerror.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/strerror.cc index ab1bbbb20..e03a41976 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/strerror.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.cc @@ -23,7 +23,7 @@ // * Added __attribute__((unused)) to compile with -Wno-unused-functions. // * Conformed to style/lint rules. -#include "Firestore/core/src/firebase/firestore/util/strerror.h" +#include "Firestore/core/src/util/strerror.h" #include #include diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/strerror.h b/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.h similarity index 84% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/strerror.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/strerror.h index 72c0300ba..2e832e1c2 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/strerror.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/strerror.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRERROR_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRERROR_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STRERROR_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRERROR_H_ #include @@ -33,4 +33,4 @@ std::string StrError(int errnum); } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRERROR_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STRERROR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_apple.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.cc similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_apple.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.cc index c896a5b45..b55d9c416 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_apple.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.cc @@ -14,13 +14,13 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" +#include "Firestore/core/src/util/string_apple.h" #if defined(__APPLE__) #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_apple.h b/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.h similarity index 77% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_apple.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.h index 04fd30bf8..11b8a9e04 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_apple.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_apple.h @@ -1,5 +1,5 @@ /* - * Copyright 2018 Google + * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_APPLE_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_APPLE_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STRING_APPLE_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_APPLE_H_ #if defined(__APPLE__) #import @@ -46,21 +46,16 @@ inline CFStringRef MakeCFString(absl::string_view contents) { kCFStringEncodingUTF8, false); } -#if defined(__OBJC__) - -// Translates a C string to the equivalent NSString without making a copy. -inline NSString* MakeNSStringNoCopy(const char* c_str, size_t size) { - return [[NSString alloc] - initWithBytesNoCopy:const_cast(static_cast(c_str)) - length:size - encoding:NSUTF8StringEncoding - freeWhenDone:false]; +/** + * CFRelease that safely ignores null values. + */ +inline void SafeCFRelease(CFTypeRef cf) { + if (cf) { + CFRelease(cf); + } } -// Translates a string_view to the equivalent NSString without making a copy. -inline NSString* MakeNSStringNoCopy(absl::string_view str) { - return MakeNSStringNoCopy(str.data(), str.size()); -} +#if defined(__OBJC__) // Translates a string_view string to the equivalent NSString by making a copy. inline NSString* MakeNSString(absl::string_view str) { @@ -107,4 +102,4 @@ inline std::shared_ptr MakeStringPtr( CF_ASSUME_NONNULL_END #endif // defined(__APPLE__) -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_APPLE_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_APPLE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_format.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.cc similarity index 97% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_format.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_format.cc index bafdac283..8eced030e 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_format.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/string_format.h" +#include "Firestore/core/src/util/string_format.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_format.h b/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.h similarity index 91% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_format.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_format.h index d59a43bed..e00857cd5 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_format.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_format.h @@ -14,16 +14,16 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_FORMAT_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_FORMAT_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STRING_FORMAT_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_FORMAT_H_ #include #include #include -#include "Firestore/core/src/firebase/firestore/objc/objc_type_traits.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "Firestore/core/src/firebase/firestore/util/type_traits.h" +#include "Firestore/core/src/objc/objc_type_traits.h" +#include "Firestore/core/src/util/string_apple.h" +#include "Firestore/core/src/util/type_traits.h" #include "absl/base/attributes.h" #include "absl/strings/str_cat.h" #include "absl/strings/string_view.h" @@ -58,7 +58,7 @@ struct FormatChoice<5> {}; * * If the value is of type `const char*`, the text will be the value * interpreted as a C string. To show the address of a single char or to * show the `const char*` as an address, cast to `void*`. - * * If the value is any other pointer type, the text will be the hexidecimal + * * If the value is any other pointer type, the text will be the hexadecimal * formatting of the value as an unsigned integer. * * Otherwise the value is interpreted as anything absl::AlphaNum accepts. */ @@ -122,7 +122,7 @@ class FormatArg : public absl::AlphaNum { /** * Creates a FormatArg from an arbitrary pointer, represented as a - * hexidecimal integer literal. + * hexadecimal integer literal. */ template FormatArg(T* pointer_value, internal::FormatChoice<4>) @@ -169,4 +169,4 @@ inline std::string StringFormat() { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_FORMAT_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_FORMAT_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_util.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.cc similarity index 95% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_util.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_util.cc index b7f1ed951..de2398478 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_util.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/string_util.h" +#include "Firestore/core/src/util/string_util.h" namespace firebase { namespace firestore { diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.h b/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.h new file mode 100644 index 000000000..3f64fd869 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_util.h @@ -0,0 +1,72 @@ +/* + * Copyright 2017 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// Useful string functions and so forth. This is a grab-bag file. +// +// These functions work fine for UTF-8 strings as long as you can +// consider them to be just byte strings. For example, due to the +// design of UTF-8 you do not need to worry about accidental matches, +// as long as all your inputs are valid UTF-8 (use \uHHHH, not \xHH or \oOOO). + +#ifndef FIRESTORE_CORE_SRC_UTIL_STRING_UTIL_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_UTIL_H_ + +#include + +#include "absl/strings/string_view.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * Returns the smallest lexicographically larger string of equal or smaller + * length. Returns an empty string if there is no such successor (if the input + * is empty or consists entirely of 0xff bytes). + * Useful for calculating the smallest lexicographically larger string + * that will not be prefixed by the input string. + * + * Examples: + * "a" -> "b", "aaa" -> "aab", "aa\xff" -> "ab", "\xff" -> "", "" -> "" + */ +std::string PrefixSuccessor(absl::string_view prefix); + +/** + * Returns the immediate lexicographically-following string. This is useful to + * turn an inclusive range into something that can be used with Bigtable's + * SetLimitRow(): + * + * // Inclusive range [min_element, max_element]. + * string min_element = ...; + * string max_element = ...; + * + * // Equivalent range [range_start, range_end). + * string range_start = min_element; + * string range_end = ImmediateSuccessor(max_element); + * + * WARNING: Returns the input string with a '\0' appended; if you call c_str() + * on the result, it will compare equal to s. + * + * WARNING: Transforms "" -> "\0"; this doesn't account for Bigtable's special + * treatment of "" as infinity. + */ +std::string ImmediateSuccessor(absl::string_view s); + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_UTIL_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_win.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.cc similarity index 96% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_win.cc rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_win.cc index 091c5a40a..d5d9b03ea 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_win.cc +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.cc @@ -14,12 +14,12 @@ * limitations under the License. */ -#include "Firestore/core/src/firebase/firestore/util/string_win.h" +#include "Firestore/core/src/util/string_win.h" #if defined(_WIN32) #include -#include "Firestore/core/src/firebase/firestore/util/hard_assert.h" +#include "Firestore/core/src/util/hard_assert.h" #include "absl/memory/memory.h" #include "absl/strings/match.h" diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_win.h b/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.h similarity index 88% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_win.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/string_win.h index 0ba2784c1..fa697ab06 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/string_win.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/string_win.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_WIN_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_WIN_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_STRING_WIN_H_ +#define FIRESTORE_CORE_SRC_UTIL_STRING_WIN_H_ #if defined(_WIN32) #include @@ -52,4 +52,4 @@ std::string LastErrorMessage(DWORD last_error); } // namespace firebase #endif // defined(_WIN32) -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_STRING_WIN_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_STRING_WIN_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/task.cc b/Pods/FirebaseFirestore/Firestore/core/src/util/task.cc new file mode 100644 index 000000000..66232d911 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/task.cc @@ -0,0 +1,222 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "Firestore/core/src/util/task.h" + +#include // NOLINT(build/c++11) +#include +#include + +#include "Firestore/core/src/util/defer.h" +#include "Firestore/core/src/util/hard_assert.h" +#include "Firestore/core/src/util/log.h" + +namespace firebase { +namespace firestore { +namespace util { + +Task* Task::Create(Executor* executor, Executor::Operation&& operation) { + return new Task(executor, Executor::TimePoint(), Executor::kNoTag, 0u, + std::move(operation)); +} + +Task* Task::Create(Executor* executor, + Executor::TimePoint target_time, + Executor::Tag tag, + Executor::Id id, + Executor::Operation&& operation) { + return new Task(executor, target_time, tag, id, std::move(operation)); +} + +Task::Task(Executor* executor, + Executor::TimePoint target_time, + Executor::Tag tag, + Executor::Id id, + Executor::Operation&& operation) + : executor_(executor), + target_time_(target_time), + tag_(tag), + id_(id), + operation_(std::move(operation)) { + // Initialization is not atomic; assignment is. + ref_count_ = 1; + + TASK_TRACE("Task::Task %s (%s)", this, + (tag_ == Executor::kNoTag ? "immediate" : "scheduled")); +} + +Task::~Task() { + TASK_TRACE("Task::~Task %s", this); +} + +void Task::Retain() { + TASK_TRACE("Task::Retain %s (ref_count=%s)", this, + ref_count_.load(std::memory_order_relaxed)); + ref_count_.fetch_add(1, std::memory_order_relaxed); +} + +void Task::Release() { + // TODO(wilhuff): assert the old ref count is >= 1 + // This isn't safe in the current implementation because HARD_ASSERT can throw + // and `Release` is likely to be called in a destructor. + int old_count = ref_count_.fetch_sub(1, std::memory_order_acq_rel); + if (old_count == 1) { + TASK_TRACE("Task::Release %s (deleting)", this); + delete this; + } else { + HARD_ASSERT( + old_count > 1, + "Test::Release called on an already deleted task %s (old_count=%s)", + this, old_count); + TASK_TRACE("Task::Release %s (ref_count=%s)", this, old_count); + } +} + +void Task::ExecuteAndRelease() { + { + std::unique_lock lock(mutex_); + TASK_TRACE("Task::Execute %s", this); + + if (state_ == State::kInitial) { + state_ = State::kRunning; + executing_thread_ = std::this_thread::get_id(); + + { + // Invoke the operation without holding mutex_ to avoid deadlocks where + // the current task can trigger its own cancellation. + lock.unlock(); + Defer relock([&] { lock.lock(); }); + operation_(); + + // Clear the operation while not holding the lock to avoid the + // possibility that the destructor of something in the closure might + // try to reference this task. + operation_ = {}; + + TASK_TRACE("Task::Execute %s (completing)", this); + } + + state_ = State::kDone; + + // The callback to the executor must be performed after the operation + // completes, otherwise the executor's destructor cannot reliably block + // until all currently running tasks have completed. + // + // Also, the callback should only be performed if the executor has not + // canceled the task. If `operation_` destroys the executor, notifying + // the executor after `operation_` returns would result in a use after + // free. + // + // Whether or not the task has been canceled has to be evaluated within + // the lock to avoid a data race with `Cancel`. + if (executor_) { + executor_->OnCompletion(this); + } + } + + is_complete_.notify_all(); + } + + Release(); +} + +void Task::Await() { + std::unique_lock lock(mutex_); + AwaitLocked(lock); +} + +bool Task::AwaitIfRunning() { + std::unique_lock lock(mutex_); + if (state_ == State::kInitial) { + return false; + } + + if (state_ == State::kRunning) { + auto this_thread = std::this_thread::get_id(); + // The return value indicates whether or not the task has completed, but + // if the task itself attempts to await its completion it would deadlock. + // Instead define a task running on the current thread as no longer being + // scheduled. + if (this_thread != executing_thread_) { + AwaitLocked(lock); + } + } + return true; +} + +void Task::AwaitLocked(std::unique_lock& lock) { + TASK_TRACE("Task::Await %s", this); + is_complete_.wait(lock, [this] { + return state_ == State::kCancelled || state_ == State::kDone; + }); +} + +void Task::Cancel() { + std::unique_lock lock(mutex_); + TASK_TRACE("Task::Cancel %s", this); + + if (state_ == State::kInitial) { + // Do not clear the `operation_` here because that might indirectly trigger + // an interaction with this task through its destructor. + state_ = State::kCancelled; + executor_ = nullptr; + + // Clear the operation while not holding the lock to avoid the + // possibility that the destructor of something in the closure might + // try to reference this task. + lock.unlock(); + operation_ = {}; + + is_complete_.notify_all(); + + } else if (state_ == State::kRunning) { + // Cancelled tasks cannot notify the executor because the Executor's + // destructor may be running as a task. Once that task completes, a + // notification would be a use-after-free. + executor_ = nullptr; + + // Avoid deadlocking if the current Task is triggering its own cancellation. + auto this_thread = std::this_thread::get_id(); + if (this_thread != executing_thread_) { + AwaitLocked(lock); + } + + } else { + // no-op; already kCancelled or kDone. + } +} + +bool Task::operator<(const Task& rhs) const { + // target_time_ and id_ are immutable after assignment; no lock required. + if (target_time_ < rhs.target_time_) { + return true; + } + if (target_time_ > rhs.target_time_) { + return false; + } + + return id_ < rhs.id_; +} + +Executor::TimePoint MakeTargetTime(Executor::Milliseconds delay) { + return std::chrono::time_point_cast( + Executor::Clock::now()) + + delay; +} + +} // namespace util +} // namespace firestore +} // namespace firebase diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/task.h b/Pods/FirebaseFirestore/Firestore/core/src/util/task.h new file mode 100644 index 000000000..ef86f2978 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/task.h @@ -0,0 +1,229 @@ +/* + * Copyright 2020 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_TASK_H_ +#define FIRESTORE_CORE_SRC_UTIL_TASK_H_ + +#include +#include // NOLINT(build/c++11) +#include +#include // NOLINT(build/c++11) +#include // NOLINT(build/c++11) + +#include "Firestore/core/src/util/executor.h" + +namespace firebase { +namespace firestore { +namespace util { + +/** + * A task for an Executor to execute, either synchronously or asynchronously, + * either immediately or after some delay. + * + * Tasks are referenced counted, always live on the heap, must be allocated with + * `Task::Create`, and `delete` themselves when their reference count goes to + * zero. Use `Retain` and `Release` to manipulate the internal reference count. + * + * Nominally Tasks are owned by an Executor, but Tasks are intended to be able + * to outlive their owner in some special cases: + * + * * If the Executor implementation delegates to a system scheduling facility + * that does not support cancellation, the Executor can `Cancel` the task + * and release its ownership. When the system gets around to executing the + * Task, it will be a no-op. + * * If the Executor is being destroyed from a Task owned by the Executor, the + * Task naturally has to outlive the Executor. + */ +class Task { + public: + /** + * Constructs a new Task for immediate execution. + */ + static Task* Create(Executor* executor, Executor::Operation&& operation); + + /** + * Constructs a new Task for delayed execution. + */ + static Task* Create(Executor* executor, + Executor::TimePoint target_time, + Executor::Tag tag, + Executor::Id id, + Executor::Operation&& operation); + + // Tasks cannot be copied or moved. + Task(const Task& other) = delete; + Task& operator=(const Task& other) = delete; + + /** + * Executes the operation if the Task has not already been executed or + * cancelled. Regardless of whether or not the operation runs, releases the + * task's ownership of itself. + */ + void ExecuteAndRelease(); + + /** + * Increases the task's reference count. + */ + void Retain(); + + /** + * Decreases the task's reference count, and when that reaches zero, `Release` + * will delete the task. + */ + void Release(); + + /** + * Waits until the task has completed execution or cancellation. + */ + void Await(); + + /** + * Waits until the task has completed execution or cancellation, but only if + * the task is currently running. + * + * @return true if the task is completed, false if it is still unscheduled. + */ + bool AwaitIfRunning(); + + /** + * Cancels the task. Tasks that have not yet started running will be prevented + * from running. + * + * If the task is currently executing while it is invoked, `Cancel` will await + * the completion of the Task. This makes `Cancel` safe to call in the + * destructor of an Executor: any currently executing tasks will effectively + * extend the lifetime of the Executor. + * + * However, if the current task is triggering its own cancellation, `Cancel` + * will *not* wait because this would cause a deadlock. This makes it possible + * for a Task to destroy the Executor that owns it and is compatible with + * expectations that Task might have: after destroying the Executor it + * obviously cannot be referenced again. + * + * Task guarantees that by the time `Cancel` has returned, the task will make + * no callbacks to the owning executor. This ensures that Tasks that survive + * past the end of the executor's life do not use after free. + * + * Taken together, these properties make it such that the Executor can + * `Cancel` all pending tasks in its destructor and the right thing will + * happen: + * + * * Tasks that haven't started yet won't run. + * * Tasks that are currently running will extend the lifetime of the + * Executor. + * * Tasks that are destroying the Executor won't deadlock. + */ + void Cancel(); + + /** + * Returns true if the Task is suitable for immediate execution (that is, it + * was created without a target time). + */ + bool is_immediate() const { + // tag_ is immutable; no locking required + return tag_ == Executor::kNoTag; + } + + /** + * Returns the target time for execution of the Task. If the task is immediate + * this will be a zero value in the past. + */ + Executor::TimePoint target_time() const { + // target_time_ is immutable; no locking required. + return target_time_; + } + + /** + * Returns the tag supplied in the constructor or `Executor::kNoTag`. + */ + Executor::Tag tag() const { + // tag_ is immutable; no locking required. + return tag_; + } + + Executor::Id id() const { + // id_ is immutable; no locking required. + return id_; + } + + /** + * Orders tasks by target time, then by the order in which entries were + * created. + */ + bool operator<(const Task& rhs) const; + + private: + enum class State { + kInitial, // Waiting to run (or be cancelled) + kCancelled, // Has not run and has been cancelled + kRunning, // Now running and can no longer be cancelled + kDone, // Has run and has finished running; cannot be cancelled + }; + + Task(Executor* executor, + Executor::TimePoint target_time, + Executor::Tag tag, + Executor::Id id, + Executor::Operation&& operation); + + // Tasks must always be allocated on the heap and they delete themselves when + // their reference count goes to zero. + // + // Virtual for testing. + virtual ~Task(); + + // Subclasses allowed for testing. + friend class TrackingTask; + + void AwaitLocked(std::unique_lock& lock); + + std::mutex mutex_; + std::condition_variable is_complete_; + State state_ = State::kInitial; + + std::atomic ref_count_; + + Executor* executor_ = nullptr; + Executor::TimePoint target_time_; + Executor::Tag tag_ = 0; + Executor::Id id_ = 0; + + std::thread::id executing_thread_; + + // The operation to run, supplied by the caller. Make this the last member + // just in case it refers to this task during its own destruction. + Executor::Operation operation_; +}; + +/** + * Converts a delay into an absolute `TimePoint` representing the current time + * plus the delay. + */ +Executor::TimePoint MakeTargetTime(Executor::Milliseconds delay); + +// Trace details of task execution. Unfortunately, this is all too useful when +// diagnosing crashes in tests. Callers must include util/log.h for themselves. +#if FIRESTORE_TRACE_TASKS +#define TASK_TRACE(...) LOG_WARN(__VA_ARGS__) +#else +#define TASK_TRACE(...) +#endif + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_TASK_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/to_string.h b/Pods/FirebaseFirestore/Firestore/core/src/util/to_string.h similarity index 92% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/to_string.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/to_string.h index 5e1f5eeac..9ec456d83 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/to_string.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/to_string.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_TO_STRING_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_TO_STRING_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_TO_STRING_H_ +#define FIRESTORE_CORE_SRC_UTIL_TO_STRING_H_ #include #include @@ -23,10 +23,10 @@ #include #include -#include "Firestore/core/src/firebase/firestore/objc/objc_type_traits.h" -#include "Firestore/core/src/firebase/firestore/util/string_apple.h" -#include "Firestore/core/src/firebase/firestore/util/string_format.h" -#include "Firestore/core/src/firebase/firestore/util/type_traits.h" +#include "Firestore/core/src/objc/objc_type_traits.h" +#include "Firestore/core/src/util/string_apple.h" +#include "Firestore/core/src/util/string_format.h" +#include "Firestore/core/src/util/type_traits.h" #include "absl/meta/type_traits.h" #include "absl/strings/str_join.h" #include "absl/types/optional.h" @@ -191,4 +191,4 @@ std::string ToString(const T& value) { } // namespace firestore } // namespace firebase -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_TO_STRING_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_TO_STRING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/util/type_traits.h b/Pods/FirebaseFirestore/Firestore/core/src/util/type_traits.h new file mode 100644 index 000000000..131256c18 --- /dev/null +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/type_traits.h @@ -0,0 +1,55 @@ +/* + * Copyright 2018 Google + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FIRESTORE_CORE_SRC_UTIL_TYPE_TRAITS_H_ +#define FIRESTORE_CORE_SRC_UTIL_TYPE_TRAITS_H_ + +#include +#include + +#include "absl/meta/type_traits.h" + +namespace firebase { +namespace firestore { +namespace util { + +// is_iterable + +template > +struct is_iterable : std::false_type {}; + +template +struct is_iterable< + T, + absl::void_t().begin(), std::declval().end())>> + : std::true_type {}; + +// is_associative_container + +template > +struct is_associative_container : std::false_type {}; + +template +struct is_associative_container< + T, + absl::void_t())>> + : std::true_type {}; + +} // namespace util +} // namespace firestore +} // namespace firebase + +#endif // FIRESTORE_CORE_SRC_UTIL_TYPE_TRAITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/warnings.h b/Pods/FirebaseFirestore/Firestore/core/src/util/warnings.h similarity index 93% rename from Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/warnings.h rename to Pods/FirebaseFirestore/Firestore/core/src/util/warnings.h index 7d82de3a5..beb1def7c 100644 --- a/Pods/FirebaseFirestore/Firestore/core/src/firebase/firestore/util/warnings.h +++ b/Pods/FirebaseFirestore/Firestore/core/src/util/warnings.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_WARNINGS_H_ -#define FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_WARNINGS_H_ +#ifndef FIRESTORE_CORE_SRC_UTIL_WARNINGS_H_ +#define FIRESTORE_CORE_SRC_UTIL_WARNINGS_H_ /** * Macros for suppressing various warnings. Use like this: @@ -88,4 +88,4 @@ #define SUPPRESS_DEPRECATED_DECLARATIONS_BEGIN() SUPPRESS_BEGIN_UNIMPLEMENTED_() #endif -#endif // FIRESTORE_CORE_SRC_FIREBASE_FIRESTORE_UTIL_WARNINGS_H_ +#endif // FIRESTORE_CORE_SRC_UTIL_WARNINGS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/BUILD.bazel b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/BUILD.bazel deleted file mode 100644 index 853330d44..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/BUILD.bazel +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -load(":compiler_config_setting.bzl", "create_llvm_config") - -create_llvm_config( - name = "llvm_compiler", - visibility = [":__subpackages__"], -) - -config_setting( - name = "osx", - constraint_values = [ - "@bazel_tools//platforms:osx", - ], -) - -config_setting( - name = "ios", - constraint_values = [ - "@bazel_tools//platforms:ios", - ], -) - -config_setting( - name = "windows", - values = { - "cpu": "x64_windows", - }, - visibility = [":__subpackages__"], -) - -config_setting( - name = "ppc", - values = { - "cpu": "ppc", - }, - visibility = [":__subpackages__"], -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt deleted file mode 100644 index bba0f3e7f..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/CMakeLists.txt +++ /dev/null @@ -1,31 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - - - -add_subdirectory(base) -add_subdirectory(algorithm) -add_subdirectory(container) -add_subdirectory(debugging) -add_subdirectory(hash) -add_subdirectory(memory) -add_subdirectory(meta) -add_subdirectory(numeric) -add_subdirectory(strings) -add_subdirectory(synchronization) -add_subdirectory(time) -add_subdirectory(types) -add_subdirectory(utility) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/BUILD.bazel b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/BUILD.bazel deleted file mode 100644 index c506f3b9f..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/BUILD.bazel +++ /dev/null @@ -1,87 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -load( - "//absl:copts/configure_copts.bzl", - "ABSL_DEFAULT_COPTS", - "ABSL_DEFAULT_LINKOPTS", - "ABSL_TEST_COPTS", -) - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -cc_library( - name = "algorithm", - hdrs = ["algorithm.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, -) - -cc_test( - name = "algorithm_test", - size = "small", - srcs = ["algorithm_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":algorithm", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "algorithm_benchmark", - srcs = ["equal_benchmark.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = ["benchmark"], - deps = [ - ":algorithm", - "//absl/base:core_headers", - "@com_github_google_benchmark//:benchmark_main", - ], -) - -cc_library( - name = "container", - hdrs = [ - "container.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":algorithm", - "//absl/base:core_headers", - "//absl/meta:type_traits", - ], -) - -cc_test( - name = "container_test", - srcs = ["container_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":container", - "//absl/base", - "//absl/base:core_headers", - "//absl/memory", - "//absl/types:span", - "@com_google_googletest//:gtest_main", - ], -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt deleted file mode 100644 index 9fbe36f69..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/CMakeLists.txt +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -absl_cc_library( - NAME - algorithm - HDRS - "algorithm.h" - COPTS - ${ABSL_DEFAULT_COPTS} - PUBLIC -) - -absl_cc_test( - NAME - algorithm_test - SRCS - "algorithm_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::algorithm - gmock_main -) - -absl_cc_library( - NAME - algorithm_container - HDRS - "container.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::algorithm - absl::core_headers - absl::meta - PUBLIC -) - -absl_cc_test( - NAME - container_test - SRCS - "container_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::algorithm_container - absl::base - absl::core_headers - absl::memory - absl::span - gmock_main -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/algorithm_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/algorithm_test.cc deleted file mode 100644 index 81fccb613..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/algorithm_test.cc +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/algorithm/algorithm.h" - -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -namespace { - -TEST(EqualTest, DefaultComparisonRandomAccess) { - std::vector v1{1, 2, 3}; - std::vector v2 = v1; - std::vector v3 = {1, 2}; - std::vector v4 = {1, 2, 4}; - - EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end())); -} - -TEST(EqualTest, DefaultComparison) { - std::list lst1{1, 2, 3}; - std::list lst2 = lst1; - std::list lst3{1, 2}; - std::list lst4{1, 2, 4}; - - EXPECT_TRUE(absl::equal(lst1.begin(), lst1.end(), lst2.begin(), lst2.end())); - EXPECT_FALSE(absl::equal(lst1.begin(), lst1.end(), lst3.begin(), lst3.end())); - EXPECT_FALSE(absl::equal(lst1.begin(), lst1.end(), lst4.begin(), lst4.end())); -} - -TEST(EqualTest, EmptyRange) { - std::vector v1{1, 2, 3}; - std::vector empty1; - std::vector empty2; - - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), empty1.begin(), empty1.end())); - EXPECT_FALSE(absl::equal(empty1.begin(), empty1.end(), v1.begin(), v1.end())); - EXPECT_TRUE( - absl::equal(empty1.begin(), empty1.end(), empty2.begin(), empty2.end())); -} - -TEST(EqualTest, MixedIterTypes) { - std::vector v1{1, 2, 3}; - std::list lst1{v1.begin(), v1.end()}; - std::list lst2{1, 2, 4}; - std::list lst3{1, 2}; - - EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), lst1.begin(), lst1.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), lst2.begin(), lst2.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), lst3.begin(), lst3.end())); -} - -TEST(EqualTest, MixedValueTypes) { - std::vector v1{1, 2, 3}; - std::vector v2{1, 2, 3}; - std::vector v3{1, 2}; - std::vector v4{1, 2, 4}; - - EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end())); -} - -TEST(EqualTest, WeirdIterators) { - std::vector v1{true, false}; - std::vector v2 = v1; - std::vector v3{true}; - std::vector v4{true, true, true}; - - EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end())); -} - -TEST(EqualTest, CustomComparison) { - int n[] = {1, 2, 3, 4}; - std::vector v1{&n[0], &n[1], &n[2]}; - std::vector v2 = v1; - std::vector v3{&n[0], &n[1], &n[3]}; - std::vector v4{&n[0], &n[1]}; - - auto eq = [](int* a, int* b) { return *a == *b; }; - - EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end(), eq)); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end(), eq)); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v4.begin(), v4.end(), eq)); -} - -TEST(EqualTest, MoveOnlyPredicate) { - std::vector v1{1, 2, 3}; - std::vector v2{4, 5, 6}; - - // move-only equality predicate - struct Eq { - Eq() = default; - Eq(Eq &&) = default; - Eq(const Eq &) = delete; - Eq &operator=(const Eq &) = delete; - bool operator()(const int a, const int b) const { return a == b; } - }; - - EXPECT_TRUE(absl::equal(v1.begin(), v1.end(), v1.begin(), v1.end(), Eq())); - EXPECT_FALSE(absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end(), Eq())); -} - -struct CountingTrivialPred { - int* count; - bool operator()(int, int) const { - ++*count; - return true; - } -}; - -TEST(EqualTest, RandomAccessComplexity) { - std::vector v1{1, 1, 3}; - std::vector v2 = v1; - std::vector v3{1, 2}; - - do { - int count = 0; - absl::equal(v1.begin(), v1.end(), v2.begin(), v2.end(), - CountingTrivialPred{&count}); - EXPECT_LE(count, 3); - } while (std::next_permutation(v2.begin(), v2.end())); - - int count = 0; - absl::equal(v1.begin(), v1.end(), v3.begin(), v3.end(), - CountingTrivialPred{&count}); - EXPECT_EQ(count, 0); -} - -class LinearSearchTest : public testing::Test { - protected: - LinearSearchTest() : container_{1, 2, 3} {} - - static bool Is3(int n) { return n == 3; } - static bool Is4(int n) { return n == 4; } - - std::vector container_; -}; - -TEST_F(LinearSearchTest, linear_search) { - EXPECT_TRUE(absl::linear_search(container_.begin(), container_.end(), 3)); - EXPECT_FALSE(absl::linear_search(container_.begin(), container_.end(), 4)); -} - -TEST_F(LinearSearchTest, linear_searchConst) { - const std::vector *const const_container = &container_; - EXPECT_TRUE( - absl::linear_search(const_container->begin(), const_container->end(), 3)); - EXPECT_FALSE( - absl::linear_search(const_container->begin(), const_container->end(), 4)); -} - -TEST(RotateTest, Rotate) { - std::vector v{0, 1, 2, 3, 4}; - EXPECT_EQ(*absl::rotate(v.begin(), v.begin() + 2, v.end()), 0); - EXPECT_THAT(v, testing::ElementsAreArray({2, 3, 4, 0, 1})); - - std::list l{0, 1, 2, 3, 4}; - EXPECT_EQ(*absl::rotate(l.begin(), std::next(l.begin(), 3), l.end()), 0); - EXPECT_THAT(l, testing::ElementsAreArray({3, 4, 0, 1, 2})); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/container_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/container_test.cc deleted file mode 100644 index 04282b894..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/container_test.cc +++ /dev/null @@ -1,1012 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/algorithm/container.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/base/casts.h" -#include "absl/base/macros.h" -#include "absl/memory/memory.h" -#include "absl/types/span.h" - -namespace { - -using ::testing::Each; -using ::testing::ElementsAre; -using ::testing::Gt; -using ::testing::IsNull; -using ::testing::Lt; -using ::testing::Pointee; -using ::testing::Truly; -using ::testing::UnorderedElementsAre; - -// Most of these tests just check that the code compiles, not that it -// does the right thing. That's fine since the functions just forward -// to the STL implementation. -class NonMutatingTest : public testing::Test { - protected: - std::unordered_set container_ = {1, 2, 3}; - std::list sequence_ = {1, 2, 3}; - std::vector vector_ = {1, 2, 3}; - int array_[3] = {1, 2, 3}; -}; - -struct AccumulateCalls { - void operator()(int value) { - calls.push_back(value); - } - std::vector calls; -}; - -bool Predicate(int value) { return value < 3; } -bool BinPredicate(int v1, int v2) { return v1 < v2; } -bool Equals(int v1, int v2) { return v1 == v2; } -bool IsOdd(int x) { return x % 2 != 0; } - - -TEST_F(NonMutatingTest, Distance) { - EXPECT_EQ(container_.size(), absl::c_distance(container_)); - EXPECT_EQ(sequence_.size(), absl::c_distance(sequence_)); - EXPECT_EQ(vector_.size(), absl::c_distance(vector_)); - EXPECT_EQ(ABSL_ARRAYSIZE(array_), absl::c_distance(array_)); - - // Works with a temporary argument. - EXPECT_EQ(vector_.size(), absl::c_distance(std::vector(vector_))); -} - -TEST_F(NonMutatingTest, Distance_OverloadedBeginEnd) { - // Works with classes which have custom ADL-selected overloads of std::begin - // and std::end. - std::initializer_list a = {1, 2, 3}; - std::valarray b = {1, 2, 3}; - EXPECT_EQ(3, absl::c_distance(a)); - EXPECT_EQ(3, absl::c_distance(b)); - - // It is assumed that other c_* functions use the same mechanism for - // ADL-selecting begin/end overloads. -} - -TEST_F(NonMutatingTest, ForEach) { - AccumulateCalls c = absl::c_for_each(container_, AccumulateCalls()); - // Don't rely on the unordered_set's order. - std::sort(c.calls.begin(), c.calls.end()); - EXPECT_EQ(vector_, c.calls); - - // Works with temporary container, too. - AccumulateCalls c2 = - absl::c_for_each(std::unordered_set(container_), AccumulateCalls()); - std::sort(c2.calls.begin(), c2.calls.end()); - EXPECT_EQ(vector_, c2.calls); -} - -TEST_F(NonMutatingTest, FindReturnsCorrectType) { - auto it = absl::c_find(container_, 3); - EXPECT_EQ(3, *it); - absl::c_find(absl::implicit_cast&>(sequence_), 3); -} - -TEST_F(NonMutatingTest, FindIf) { absl::c_find_if(container_, Predicate); } - -TEST_F(NonMutatingTest, FindIfNot) { - absl::c_find_if_not(container_, Predicate); -} - -TEST_F(NonMutatingTest, FindEnd) { - absl::c_find_end(sequence_, vector_); - absl::c_find_end(vector_, sequence_); -} - -TEST_F(NonMutatingTest, FindEndWithPredicate) { - absl::c_find_end(sequence_, vector_, BinPredicate); - absl::c_find_end(vector_, sequence_, BinPredicate); -} - -TEST_F(NonMutatingTest, FindFirstOf) { - absl::c_find_first_of(container_, sequence_); - absl::c_find_first_of(sequence_, container_); -} - -TEST_F(NonMutatingTest, FindFirstOfWithPredicate) { - absl::c_find_first_of(container_, sequence_, BinPredicate); - absl::c_find_first_of(sequence_, container_, BinPredicate); -} - -TEST_F(NonMutatingTest, AdjacentFind) { absl::c_adjacent_find(sequence_); } - -TEST_F(NonMutatingTest, AdjacentFindWithPredicate) { - absl::c_adjacent_find(sequence_, BinPredicate); -} - -TEST_F(NonMutatingTest, Count) { EXPECT_EQ(1, absl::c_count(container_, 3)); } - -TEST_F(NonMutatingTest, CountIf) { - EXPECT_EQ(2, absl::c_count_if(container_, Predicate)); - const std::unordered_set& const_container = container_; - EXPECT_EQ(2, absl::c_count_if(const_container, Predicate)); -} - -TEST_F(NonMutatingTest, Mismatch) { - absl::c_mismatch(container_, sequence_); - absl::c_mismatch(sequence_, container_); -} - -TEST_F(NonMutatingTest, MismatchWithPredicate) { - absl::c_mismatch(container_, sequence_, BinPredicate); - absl::c_mismatch(sequence_, container_, BinPredicate); -} - -TEST_F(NonMutatingTest, Equal) { - EXPECT_TRUE(absl::c_equal(vector_, sequence_)); - EXPECT_TRUE(absl::c_equal(sequence_, vector_)); - - // Test that behavior appropriately differs from that of equal(). - std::vector vector_plus = {1, 2, 3}; - vector_plus.push_back(4); - EXPECT_FALSE(absl::c_equal(vector_plus, sequence_)); - EXPECT_FALSE(absl::c_equal(sequence_, vector_plus)); -} - -TEST_F(NonMutatingTest, EqualWithPredicate) { - EXPECT_TRUE(absl::c_equal(vector_, sequence_, Equals)); - EXPECT_TRUE(absl::c_equal(sequence_, vector_, Equals)); - - // Test that behavior appropriately differs from that of equal(). - std::vector vector_plus = {1, 2, 3}; - vector_plus.push_back(4); - EXPECT_FALSE(absl::c_equal(vector_plus, sequence_, Equals)); - EXPECT_FALSE(absl::c_equal(sequence_, vector_plus, Equals)); -} - -TEST_F(NonMutatingTest, IsPermutation) { - auto vector_permut_ = vector_; - std::next_permutation(vector_permut_.begin(), vector_permut_.end()); - EXPECT_TRUE(absl::c_is_permutation(vector_permut_, sequence_)); - EXPECT_TRUE(absl::c_is_permutation(sequence_, vector_permut_)); - - // Test that behavior appropriately differs from that of is_permutation(). - std::vector vector_plus = {1, 2, 3}; - vector_plus.push_back(4); - EXPECT_FALSE(absl::c_is_permutation(vector_plus, sequence_)); - EXPECT_FALSE(absl::c_is_permutation(sequence_, vector_plus)); -} - -TEST_F(NonMutatingTest, IsPermutationWithPredicate) { - auto vector_permut_ = vector_; - std::next_permutation(vector_permut_.begin(), vector_permut_.end()); - EXPECT_TRUE(absl::c_is_permutation(vector_permut_, sequence_, Equals)); - EXPECT_TRUE(absl::c_is_permutation(sequence_, vector_permut_, Equals)); - - // Test that behavior appropriately differs from that of is_permutation(). - std::vector vector_plus = {1, 2, 3}; - vector_plus.push_back(4); - EXPECT_FALSE(absl::c_is_permutation(vector_plus, sequence_, Equals)); - EXPECT_FALSE(absl::c_is_permutation(sequence_, vector_plus, Equals)); -} - -TEST_F(NonMutatingTest, Search) { - absl::c_search(sequence_, vector_); - absl::c_search(vector_, sequence_); - absl::c_search(array_, sequence_); -} - -TEST_F(NonMutatingTest, SearchWithPredicate) { - absl::c_search(sequence_, vector_, BinPredicate); - absl::c_search(vector_, sequence_, BinPredicate); -} - -TEST_F(NonMutatingTest, SearchN) { absl::c_search_n(sequence_, 3, 1); } - -TEST_F(NonMutatingTest, SearchNWithPredicate) { - absl::c_search_n(sequence_, 3, 1, BinPredicate); -} - -TEST_F(NonMutatingTest, LowerBound) { - std::list::iterator i = absl::c_lower_bound(sequence_, 3); - ASSERT_TRUE(i != sequence_.end()); - EXPECT_EQ(2, std::distance(sequence_.begin(), i)); - EXPECT_EQ(3, *i); -} - -TEST_F(NonMutatingTest, LowerBoundWithPredicate) { - std::vector v(vector_); - std::sort(v.begin(), v.end(), std::greater()); - std::vector::iterator i = absl::c_lower_bound(v, 3, std::greater()); - EXPECT_TRUE(i == v.begin()); - EXPECT_EQ(3, *i); -} - -TEST_F(NonMutatingTest, UpperBound) { - std::list::iterator i = absl::c_upper_bound(sequence_, 1); - ASSERT_TRUE(i != sequence_.end()); - EXPECT_EQ(1, std::distance(sequence_.begin(), i)); - EXPECT_EQ(2, *i); -} - -TEST_F(NonMutatingTest, UpperBoundWithPredicate) { - std::vector v(vector_); - std::sort(v.begin(), v.end(), std::greater()); - std::vector::iterator i = absl::c_upper_bound(v, 1, std::greater()); - EXPECT_EQ(3, i - v.begin()); - EXPECT_TRUE(i == v.end()); -} - -TEST_F(NonMutatingTest, EqualRange) { - std::pair::iterator, std::list::iterator> p = - absl::c_equal_range(sequence_, 2); - EXPECT_EQ(1, std::distance(sequence_.begin(), p.first)); - EXPECT_EQ(2, std::distance(sequence_.begin(), p.second)); -} - -TEST_F(NonMutatingTest, EqualRangeArray) { - auto p = absl::c_equal_range(array_, 2); - EXPECT_EQ(1, std::distance(std::begin(array_), p.first)); - EXPECT_EQ(2, std::distance(std::begin(array_), p.second)); -} - -TEST_F(NonMutatingTest, EqualRangeWithPredicate) { - std::vector v(vector_); - std::sort(v.begin(), v.end(), std::greater()); - std::pair::iterator, std::vector::iterator> p = - absl::c_equal_range(v, 2, std::greater()); - EXPECT_EQ(1, std::distance(v.begin(), p.first)); - EXPECT_EQ(2, std::distance(v.begin(), p.second)); -} - -TEST_F(NonMutatingTest, BinarySearch) { - EXPECT_TRUE(absl::c_binary_search(vector_, 2)); - EXPECT_TRUE(absl::c_binary_search(std::vector(vector_), 2)); -} - -TEST_F(NonMutatingTest, BinarySearchWithPredicate) { - std::vector v(vector_); - std::sort(v.begin(), v.end(), std::greater()); - EXPECT_TRUE(absl::c_binary_search(v, 2, std::greater())); - EXPECT_TRUE( - absl::c_binary_search(std::vector(v), 2, std::greater())); -} - -TEST_F(NonMutatingTest, MinElement) { - std::list::iterator i = absl::c_min_element(sequence_); - ASSERT_TRUE(i != sequence_.end()); - EXPECT_EQ(*i, 1); -} - -TEST_F(NonMutatingTest, MinElementWithPredicate) { - std::list::iterator i = - absl::c_min_element(sequence_, std::greater()); - ASSERT_TRUE(i != sequence_.end()); - EXPECT_EQ(*i, 3); -} - -TEST_F(NonMutatingTest, MaxElement) { - std::list::iterator i = absl::c_max_element(sequence_); - ASSERT_TRUE(i != sequence_.end()); - EXPECT_EQ(*i, 3); -} - -TEST_F(NonMutatingTest, MaxElementWithPredicate) { - std::list::iterator i = - absl::c_max_element(sequence_, std::greater()); - ASSERT_TRUE(i != sequence_.end()); - EXPECT_EQ(*i, 1); -} - -TEST_F(NonMutatingTest, LexicographicalCompare) { - EXPECT_FALSE(absl::c_lexicographical_compare(sequence_, sequence_)); - - std::vector v; - v.push_back(1); - v.push_back(2); - v.push_back(4); - - EXPECT_TRUE(absl::c_lexicographical_compare(sequence_, v)); - EXPECT_TRUE(absl::c_lexicographical_compare(std::list(sequence_), v)); -} - -TEST_F(NonMutatingTest, LexicographicalCopmareWithPredicate) { - EXPECT_FALSE(absl::c_lexicographical_compare(sequence_, sequence_, - std::greater())); - - std::vector v; - v.push_back(1); - v.push_back(2); - v.push_back(4); - - EXPECT_TRUE( - absl::c_lexicographical_compare(v, sequence_, std::greater())); - EXPECT_TRUE(absl::c_lexicographical_compare( - std::vector(v), std::list(sequence_), std::greater())); -} - -TEST_F(NonMutatingTest, Includes) { - std::set s(vector_.begin(), vector_.end()); - s.insert(4); - EXPECT_TRUE(absl::c_includes(s, vector_)); -} - -TEST_F(NonMutatingTest, IncludesWithPredicate) { - std::vector v = {3, 2, 1}; - std::set> s(v.begin(), v.end()); - s.insert(4); - EXPECT_TRUE(absl::c_includes(s, v, std::greater())); -} - -class NumericMutatingTest : public testing::Test { - protected: - std::list list_ = {1, 2, 3}; - std::vector output_; -}; - -TEST_F(NumericMutatingTest, Iota) { - absl::c_iota(list_, 5); - std::list expected{5, 6, 7}; - EXPECT_EQ(list_, expected); -} - -TEST_F(NonMutatingTest, Accumulate) { - EXPECT_EQ(absl::c_accumulate(sequence_, 4), 1 + 2 + 3 + 4); -} - -TEST_F(NonMutatingTest, AccumulateWithBinaryOp) { - EXPECT_EQ(absl::c_accumulate(sequence_, 4, std::multiplies()), - 1 * 2 * 3 * 4); -} - -TEST_F(NonMutatingTest, AccumulateLvalueInit) { - int lvalue = 4; - EXPECT_EQ(absl::c_accumulate(sequence_, lvalue), 1 + 2 + 3 + 4); -} - -TEST_F(NonMutatingTest, AccumulateWithBinaryOpLvalueInit) { - int lvalue = 4; - EXPECT_EQ(absl::c_accumulate(sequence_, lvalue, std::multiplies()), - 1 * 2 * 3 * 4); -} - -TEST_F(NonMutatingTest, InnerProduct) { - EXPECT_EQ(absl::c_inner_product(sequence_, vector_, 1000), - 1000 + 1 * 1 + 2 * 2 + 3 * 3); -} - -TEST_F(NonMutatingTest, InnerProductWithBinaryOps) { - EXPECT_EQ(absl::c_inner_product(sequence_, vector_, 10, - std::multiplies(), std::plus()), - 10 * (1 + 1) * (2 + 2) * (3 + 3)); -} - -TEST_F(NonMutatingTest, InnerProductLvalueInit) { - int lvalue = 1000; - EXPECT_EQ(absl::c_inner_product(sequence_, vector_, lvalue), - 1000 + 1 * 1 + 2 * 2 + 3 * 3); -} - -TEST_F(NonMutatingTest, InnerProductWithBinaryOpsLvalueInit) { - int lvalue = 10; - EXPECT_EQ(absl::c_inner_product(sequence_, vector_, lvalue, - std::multiplies(), std::plus()), - 10 * (1 + 1) * (2 + 2) * (3 + 3)); -} - -TEST_F(NumericMutatingTest, AdjacentDifference) { - auto last = absl::c_adjacent_difference(list_, std::back_inserter(output_)); - *last = 1000; - std::vector expected{1, 2 - 1, 3 - 2, 1000}; - EXPECT_EQ(output_, expected); -} - -TEST_F(NumericMutatingTest, AdjacentDifferenceWithBinaryOp) { - auto last = absl::c_adjacent_difference(list_, std::back_inserter(output_), - std::multiplies()); - *last = 1000; - std::vector expected{1, 2 * 1, 3 * 2, 1000}; - EXPECT_EQ(output_, expected); -} - -TEST_F(NumericMutatingTest, PartialSum) { - auto last = absl::c_partial_sum(list_, std::back_inserter(output_)); - *last = 1000; - std::vector expected{1, 1 + 2, 1 + 2 + 3, 1000}; - EXPECT_EQ(output_, expected); -} - -TEST_F(NumericMutatingTest, PartialSumWithBinaryOp) { - auto last = absl::c_partial_sum(list_, std::back_inserter(output_), - std::multiplies()); - *last = 1000; - std::vector expected{1, 1 * 2, 1 * 2 * 3, 1000}; - EXPECT_EQ(output_, expected); -} - -TEST_F(NonMutatingTest, LinearSearch) { - EXPECT_TRUE(absl::c_linear_search(container_, 3)); - EXPECT_FALSE(absl::c_linear_search(container_, 4)); -} - -TEST_F(NonMutatingTest, AllOf) { - const std::vector& v = vector_; - EXPECT_FALSE(absl::c_all_of(v, [](int x) { return x > 1; })); - EXPECT_TRUE(absl::c_all_of(v, [](int x) { return x > 0; })); -} - -TEST_F(NonMutatingTest, AnyOf) { - const std::vector& v = vector_; - EXPECT_TRUE(absl::c_any_of(v, [](int x) { return x > 2; })); - EXPECT_FALSE(absl::c_any_of(v, [](int x) { return x > 5; })); -} - -TEST_F(NonMutatingTest, NoneOf) { - const std::vector& v = vector_; - EXPECT_FALSE(absl::c_none_of(v, [](int x) { return x > 2; })); - EXPECT_TRUE(absl::c_none_of(v, [](int x) { return x > 5; })); -} - -TEST_F(NonMutatingTest, MinMaxElementLess) { - std::pair::const_iterator, std::vector::const_iterator> - p = absl::c_minmax_element(vector_, std::less()); - EXPECT_TRUE(p.first == vector_.begin()); - EXPECT_TRUE(p.second == vector_.begin() + 2); -} - -TEST_F(NonMutatingTest, MinMaxElementGreater) { - std::pair::const_iterator, std::vector::const_iterator> - p = absl::c_minmax_element(vector_, std::greater()); - EXPECT_TRUE(p.first == vector_.begin() + 2); - EXPECT_TRUE(p.second == vector_.begin()); -} - -TEST_F(NonMutatingTest, MinMaxElementNoPredicate) { - std::pair::const_iterator, std::vector::const_iterator> - p = absl::c_minmax_element(vector_); - EXPECT_TRUE(p.first == vector_.begin()); - EXPECT_TRUE(p.second == vector_.begin() + 2); -} - -class SortingTest : public testing::Test { - protected: - std::list sorted_ = {1, 2, 3, 4}; - std::list unsorted_ = {2, 4, 1, 3}; - std::list reversed_ = {4, 3, 2, 1}; -}; - -TEST_F(SortingTest, IsSorted) { - EXPECT_TRUE(absl::c_is_sorted(sorted_)); - EXPECT_FALSE(absl::c_is_sorted(unsorted_)); - EXPECT_FALSE(absl::c_is_sorted(reversed_)); -} - -TEST_F(SortingTest, IsSortedWithPredicate) { - EXPECT_FALSE(absl::c_is_sorted(sorted_, std::greater())); - EXPECT_FALSE(absl::c_is_sorted(unsorted_, std::greater())); - EXPECT_TRUE(absl::c_is_sorted(reversed_, std::greater())); -} - -TEST_F(SortingTest, IsSortedUntil) { - EXPECT_EQ(1, *absl::c_is_sorted_until(unsorted_)); - EXPECT_EQ(4, *absl::c_is_sorted_until(unsorted_, std::greater())); -} - -TEST_F(SortingTest, NthElement) { - std::vector unsorted = {2, 4, 1, 3}; - absl::c_nth_element(unsorted, unsorted.begin() + 2); - EXPECT_THAT(unsorted, - ElementsAre(Lt(3), Lt(3), 3, Gt(3))); - absl::c_nth_element(unsorted, unsorted.begin() + 2, std::greater()); - EXPECT_THAT(unsorted, - ElementsAre(Gt(2), Gt(2), 2, Lt(2))); -} - -TEST(MutatingTest, IsPartitioned) { - EXPECT_TRUE( - absl::c_is_partitioned(std::vector{1, 3, 5, 2, 4, 6}, IsOdd)); - EXPECT_FALSE( - absl::c_is_partitioned(std::vector{1, 2, 3, 4, 5, 6}, IsOdd)); - EXPECT_FALSE( - absl::c_is_partitioned(std::vector{2, 4, 6, 1, 3, 5}, IsOdd)); -} - -TEST(MutatingTest, Partition) { - std::vector actual = {1, 2, 3, 4, 5}; - absl::c_partition(actual, IsOdd); - EXPECT_THAT(actual, Truly([](const std::vector& c) { - return absl::c_is_partitioned(c, IsOdd); - })); -} - -TEST(MutatingTest, StablePartition) { - std::vector actual = {1, 2, 3, 4, 5}; - absl::c_stable_partition(actual, IsOdd); - EXPECT_THAT(actual, ElementsAre(1, 3, 5, 2, 4)); -} - -TEST(MutatingTest, PartitionCopy) { - const std::vector initial = {1, 2, 3, 4, 5}; - std::vector odds, evens; - auto ends = absl::c_partition_copy(initial, back_inserter(odds), - back_inserter(evens), IsOdd); - *ends.first = 7; - *ends.second = 6; - EXPECT_THAT(odds, ElementsAre(1, 3, 5, 7)); - EXPECT_THAT(evens, ElementsAre(2, 4, 6)); -} - -TEST(MutatingTest, PartitionPoint) { - const std::vector initial = {1, 3, 5, 2, 4}; - auto middle = absl::c_partition_point(initial, IsOdd); - EXPECT_EQ(2, *middle); -} - -TEST(MutatingTest, CopyMiddle) { - const std::vector initial = {4, -1, -2, -3, 5}; - const std::list input = {1, 2, 3}; - const std::vector expected = {4, 1, 2, 3, 5}; - - std::list test_list(initial.begin(), initial.end()); - absl::c_copy(input, ++test_list.begin()); - EXPECT_EQ(std::list(expected.begin(), expected.end()), test_list); - - std::vector test_vector = initial; - absl::c_copy(input, test_vector.begin() + 1); - EXPECT_EQ(expected, test_vector); -} - -TEST(MutatingTest, CopyFrontInserter) { - const std::list initial = {4, 5}; - const std::list input = {1, 2, 3}; - const std::list expected = {3, 2, 1, 4, 5}; - - std::list test_list = initial; - absl::c_copy(input, std::front_inserter(test_list)); - EXPECT_EQ(expected, test_list); -} - -TEST(MutatingTest, CopyBackInserter) { - const std::vector initial = {4, 5}; - const std::list input = {1, 2, 3}; - const std::vector expected = {4, 5, 1, 2, 3}; - - std::list test_list(initial.begin(), initial.end()); - absl::c_copy(input, std::back_inserter(test_list)); - EXPECT_EQ(std::list(expected.begin(), expected.end()), test_list); - - std::vector test_vector = initial; - absl::c_copy(input, std::back_inserter(test_vector)); - EXPECT_EQ(expected, test_vector); -} - -TEST(MutatingTest, CopyN) { - const std::vector initial = {1, 2, 3, 4, 5}; - const std::vector expected = {1, 2}; - std::vector actual; - absl::c_copy_n(initial, 2, back_inserter(actual)); - EXPECT_EQ(expected, actual); -} - -TEST(MutatingTest, CopyIf) { - const std::list input = {1, 2, 3}; - std::vector output; - absl::c_copy_if(input, std::back_inserter(output), - [](int i) { return i != 2; }); - EXPECT_THAT(output, ElementsAre(1, 3)); -} - -TEST(MutatingTest, CopyBackward) { - std::vector actual = {1, 2, 3, 4, 5}; - std::vector expected = {1, 2, 1, 2, 3}; - absl::c_copy_backward(absl::MakeSpan(actual.data(), 3), actual.end()); - EXPECT_EQ(expected, actual); -} - -TEST(MutatingTest, Move) { - std::vector> src; - src.emplace_back(absl::make_unique(1)); - src.emplace_back(absl::make_unique(2)); - src.emplace_back(absl::make_unique(3)); - src.emplace_back(absl::make_unique(4)); - src.emplace_back(absl::make_unique(5)); - - std::vector> dest = {}; - absl::c_move(src, std::back_inserter(dest)); - EXPECT_THAT(src, Each(IsNull())); - EXPECT_THAT(dest, ElementsAre(Pointee(1), Pointee(2), Pointee(3), Pointee(4), - Pointee(5))); -} - -TEST(MutatingTest, MoveWithRvalue) { - auto MakeRValueSrc = [] { - std::vector> src; - src.emplace_back(absl::make_unique(1)); - src.emplace_back(absl::make_unique(2)); - src.emplace_back(absl::make_unique(3)); - return src; - }; - - std::vector> dest = MakeRValueSrc(); - absl::c_move(MakeRValueSrc(), std::back_inserter(dest)); - EXPECT_THAT(dest, ElementsAre(Pointee(1), Pointee(2), Pointee(3), Pointee(1), - Pointee(2), Pointee(3))); -} - -TEST(MutatingTest, SwapRanges) { - std::vector odds = {2, 4, 6}; - std::vector evens = {1, 3, 5}; - absl::c_swap_ranges(odds, evens); - EXPECT_THAT(odds, ElementsAre(1, 3, 5)); - EXPECT_THAT(evens, ElementsAre(2, 4, 6)); -} - -TEST_F(NonMutatingTest, Transform) { - std::vector x{0, 2, 4}, y, z; - auto end = absl::c_transform(x, back_inserter(y), std::negate()); - EXPECT_EQ(std::vector({0, -2, -4}), y); - *end = 7; - EXPECT_EQ(std::vector({0, -2, -4, 7}), y); - - y = {1, 3, 0}; - end = absl::c_transform(x, y, back_inserter(z), std::plus()); - EXPECT_EQ(std::vector({1, 5, 4}), z); - *end = 7; - EXPECT_EQ(std::vector({1, 5, 4, 7}), z); -} - -TEST(MutatingTest, Replace) { - const std::vector initial = {1, 2, 3, 1, 4, 5}; - const std::vector expected = {4, 2, 3, 4, 4, 5}; - - std::vector test_vector = initial; - absl::c_replace(test_vector, 1, 4); - EXPECT_EQ(expected, test_vector); - - std::list test_list(initial.begin(), initial.end()); - absl::c_replace(test_list, 1, 4); - EXPECT_EQ(std::list(expected.begin(), expected.end()), test_list); -} - -TEST(MutatingTest, ReplaceIf) { - std::vector actual = {1, 2, 3, 4, 5}; - const std::vector expected = {0, 2, 0, 4, 0}; - - absl::c_replace_if(actual, IsOdd, 0); - EXPECT_EQ(expected, actual); -} - -TEST(MutatingTest, ReplaceCopy) { - const std::vector initial = {1, 2, 3, 1, 4, 5}; - const std::vector expected = {4, 2, 3, 4, 4, 5}; - - std::vector actual; - absl::c_replace_copy(initial, back_inserter(actual), 1, 4); - EXPECT_EQ(expected, actual); -} - -TEST(MutatingTest, Sort) { - std::vector test_vector = {2, 3, 1, 4}; - absl::c_sort(test_vector); - EXPECT_THAT(test_vector, ElementsAre(1, 2, 3, 4)); -} - -TEST(MutatingTest, SortWithPredicate) { - std::vector test_vector = {2, 3, 1, 4}; - absl::c_sort(test_vector, std::greater()); - EXPECT_THAT(test_vector, ElementsAre(4, 3, 2, 1)); -} - -// For absl::c_stable_sort tests. Needs an operator< that does not cover all -// fields so that the test can check the sort preserves order of equal elements. -struct Element { - int key; - int value; - friend bool operator<(const Element& e1, const Element& e2) { - return e1.key < e2.key; - } - // Make gmock print useful diagnostics. - friend std::ostream& operator<<(std::ostream& o, const Element& e) { - return o << "{" << e.key << ", " << e.value << "}"; - } -}; - -MATCHER_P2(IsElement, key, value, "") { - return arg.key == key && arg.value == value; -} - -TEST(MutatingTest, StableSort) { - std::vector test_vector = {{1, 1}, {2, 1}, {2, 0}, {1, 0}, {2, 2}}; - absl::c_stable_sort(test_vector); - EXPECT_THAT( - test_vector, - ElementsAre(IsElement(1, 1), IsElement(1, 0), IsElement(2, 1), - IsElement(2, 0), IsElement(2, 2))); -} - -TEST(MutatingTest, StableSortWithPredicate) { - std::vector test_vector = {{1, 1}, {2, 1}, {2, 0}, {1, 0}, {2, 2}}; - absl::c_stable_sort(test_vector, [](const Element& e1, const Element& e2) { - return e2 < e1; - }); - EXPECT_THAT( - test_vector, - ElementsAre(IsElement(2, 1), IsElement(2, 0), IsElement(2, 2), - IsElement(1, 1), IsElement(1, 0))); -} - -TEST(MutatingTest, ReplaceCopyIf) { - const std::vector initial = {1, 2, 3, 4, 5}; - const std::vector expected = {0, 2, 0, 4, 0}; - - std::vector actual; - absl::c_replace_copy_if(initial, back_inserter(actual), IsOdd, 0); - EXPECT_EQ(expected, actual); -} - -TEST(MutatingTest, Fill) { - std::vector actual(5); - absl::c_fill(actual, 1); - EXPECT_THAT(actual, ElementsAre(1, 1, 1, 1, 1)); -} - -TEST(MutatingTest, FillN) { - std::vector actual(5, 0); - absl::c_fill_n(actual, 2, 1); - EXPECT_THAT(actual, ElementsAre(1, 1, 0, 0, 0)); -} - -TEST(MutatingTest, Generate) { - std::vector actual(5); - int x = 0; - absl::c_generate(actual, [&x]() { return ++x; }); - EXPECT_THAT(actual, ElementsAre(1, 2, 3, 4, 5)); -} - -TEST(MutatingTest, GenerateN) { - std::vector actual(5, 0); - int x = 0; - absl::c_generate_n(actual, 3, [&x]() { return ++x; }); - EXPECT_THAT(actual, ElementsAre(1, 2, 3, 0, 0)); -} - -TEST(MutatingTest, RemoveCopy) { - std::vector actual; - absl::c_remove_copy(std::vector{1, 2, 3}, back_inserter(actual), 2); - EXPECT_THAT(actual, ElementsAre(1, 3)); -} - -TEST(MutatingTest, RemoveCopyIf) { - std::vector actual; - absl::c_remove_copy_if(std::vector{1, 2, 3}, back_inserter(actual), - IsOdd); - EXPECT_THAT(actual, ElementsAre(2)); -} - -TEST(MutatingTest, UniqueCopy) { - std::vector actual; - absl::c_unique_copy(std::vector{1, 2, 2, 2, 3, 3, 2}, - back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(1, 2, 3, 2)); -} - -TEST(MutatingTest, UniqueCopyWithPredicate) { - std::vector actual; - absl::c_unique_copy(std::vector{1, 2, 3, -1, -2, -3, 1}, - back_inserter(actual), - [](int x, int y) { return (x < 0) == (y < 0); }); - EXPECT_THAT(actual, ElementsAre(1, -1, 1)); -} - -TEST(MutatingTest, Reverse) { - std::vector test_vector = {1, 2, 3, 4}; - absl::c_reverse(test_vector); - EXPECT_THAT(test_vector, ElementsAre(4, 3, 2, 1)); - - std::list test_list = {1, 2, 3, 4}; - absl::c_reverse(test_list); - EXPECT_THAT(test_list, ElementsAre(4, 3, 2, 1)); -} - -TEST(MutatingTest, ReverseCopy) { - std::vector actual; - absl::c_reverse_copy(std::vector{1, 2, 3, 4}, back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(4, 3, 2, 1)); -} - -TEST(MutatingTest, Rotate) { - std::vector actual = {1, 2, 3, 4}; - auto it = absl::c_rotate(actual, actual.begin() + 2); - EXPECT_THAT(actual, testing::ElementsAreArray({3, 4, 1, 2})); - EXPECT_EQ(*it, 1); -} - -TEST(MutatingTest, RotateCopy) { - std::vector initial = {1, 2, 3, 4}; - std::vector actual; - auto end = - absl::c_rotate_copy(initial, initial.begin() + 2, back_inserter(actual)); - *end = 5; - EXPECT_THAT(actual, ElementsAre(3, 4, 1, 2, 5)); -} - -TEST(MutatingTest, Shuffle) { - std::vector actual = {1, 2, 3, 4, 5}; - absl::c_shuffle(actual, std::random_device()); - EXPECT_THAT(actual, UnorderedElementsAre(1, 2, 3, 4, 5)); -} - -TEST(MutatingTest, PartialSort) { - std::vector sequence{5, 3, 42, 0}; - absl::c_partial_sort(sequence, sequence.begin() + 2); - EXPECT_THAT(absl::MakeSpan(sequence.data(), 2), ElementsAre(0, 3)); - absl::c_partial_sort(sequence, sequence.begin() + 2, std::greater()); - EXPECT_THAT(absl::MakeSpan(sequence.data(), 2), ElementsAre(42, 5)); -} - -TEST(MutatingTest, PartialSortCopy) { - const std::vector initial = {5, 3, 42, 0}; - std::vector actual(2); - absl::c_partial_sort_copy(initial, actual); - EXPECT_THAT(actual, ElementsAre(0, 3)); - absl::c_partial_sort_copy(initial, actual, std::greater()); - EXPECT_THAT(actual, ElementsAre(42, 5)); -} - -TEST(MutatingTest, Merge) { - std::vector actual; - absl::c_merge(std::vector{1, 3, 5}, std::vector{2, 4}, - back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(1, 2, 3, 4, 5)); -} - -TEST(MutatingTest, MergeWithComparator) { - std::vector actual; - absl::c_merge(std::vector{5, 3, 1}, std::vector{4, 2}, - back_inserter(actual), std::greater()); - EXPECT_THAT(actual, ElementsAre(5, 4, 3, 2, 1)); -} - -TEST(MutatingTest, InplaceMerge) { - std::vector actual = {1, 3, 5, 2, 4}; - absl::c_inplace_merge(actual, actual.begin() + 3); - EXPECT_THAT(actual, ElementsAre(1, 2, 3, 4, 5)); -} - -TEST(MutatingTest, InplaceMergeWithComparator) { - std::vector actual = {5, 3, 1, 4, 2}; - absl::c_inplace_merge(actual, actual.begin() + 3, std::greater()); - EXPECT_THAT(actual, ElementsAre(5, 4, 3, 2, 1)); -} - -class SetOperationsTest : public testing::Test { - protected: - std::vector a_ = {1, 2, 3}; - std::vector b_ = {1, 3, 5}; - - std::vector a_reversed_ = {3, 2, 1}; - std::vector b_reversed_ = {5, 3, 1}; -}; - -TEST_F(SetOperationsTest, SetUnion) { - std::vector actual; - absl::c_set_union(a_, b_, back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(1, 2, 3, 5)); -} - -TEST_F(SetOperationsTest, SetUnionWithComparator) { - std::vector actual; - absl::c_set_union(a_reversed_, b_reversed_, back_inserter(actual), - std::greater()); - EXPECT_THAT(actual, ElementsAre(5, 3, 2, 1)); -} - -TEST_F(SetOperationsTest, SetIntersection) { - std::vector actual; - absl::c_set_intersection(a_, b_, back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(1, 3)); -} - -TEST_F(SetOperationsTest, SetIntersectionWithComparator) { - std::vector actual; - absl::c_set_intersection(a_reversed_, b_reversed_, back_inserter(actual), - std::greater()); - EXPECT_THAT(actual, ElementsAre(3, 1)); -} - -TEST_F(SetOperationsTest, SetDifference) { - std::vector actual; - absl::c_set_difference(a_, b_, back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(2)); -} - -TEST_F(SetOperationsTest, SetDifferenceWithComparator) { - std::vector actual; - absl::c_set_difference(a_reversed_, b_reversed_, back_inserter(actual), - std::greater()); - EXPECT_THAT(actual, ElementsAre(2)); -} - -TEST_F(SetOperationsTest, SetSymmetricDifference) { - std::vector actual; - absl::c_set_symmetric_difference(a_, b_, back_inserter(actual)); - EXPECT_THAT(actual, ElementsAre(2, 5)); -} - -TEST_F(SetOperationsTest, SetSymmetricDifferenceWithComparator) { - std::vector actual; - absl::c_set_symmetric_difference(a_reversed_, b_reversed_, - back_inserter(actual), std::greater()); - EXPECT_THAT(actual, ElementsAre(5, 2)); -} - -TEST(HeapOperationsTest, WithoutComparator) { - std::vector heap = {1, 2, 3}; - EXPECT_FALSE(absl::c_is_heap(heap)); - absl::c_make_heap(heap); - EXPECT_TRUE(absl::c_is_heap(heap)); - heap.push_back(4); - EXPECT_EQ(3, absl::c_is_heap_until(heap) - heap.begin()); - absl::c_push_heap(heap); - EXPECT_EQ(4, heap[0]); - absl::c_pop_heap(heap); - EXPECT_EQ(4, heap[3]); - absl::c_make_heap(heap); - absl::c_sort_heap(heap); - EXPECT_THAT(heap, ElementsAre(1, 2, 3, 4)); - EXPECT_FALSE(absl::c_is_heap(heap)); -} - -TEST(HeapOperationsTest, WithComparator) { - using greater = std::greater; - std::vector heap = {3, 2, 1}; - EXPECT_FALSE(absl::c_is_heap(heap, greater())); - absl::c_make_heap(heap, greater()); - EXPECT_TRUE(absl::c_is_heap(heap, greater())); - heap.push_back(0); - EXPECT_EQ(3, absl::c_is_heap_until(heap, greater()) - heap.begin()); - absl::c_push_heap(heap, greater()); - EXPECT_EQ(0, heap[0]); - absl::c_pop_heap(heap, greater()); - EXPECT_EQ(0, heap[3]); - absl::c_make_heap(heap, greater()); - absl::c_sort_heap(heap, greater()); - EXPECT_THAT(heap, ElementsAre(3, 2, 1, 0)); - EXPECT_FALSE(absl::c_is_heap(heap, greater())); -} - -TEST(MutatingTest, PermutationOperations) { - std::vector initial = {1, 2, 3, 4}; - std::vector permuted = initial; - - absl::c_next_permutation(permuted); - EXPECT_TRUE(absl::c_is_permutation(initial, permuted)); - EXPECT_TRUE(absl::c_is_permutation(initial, permuted, std::equal_to())); - - std::vector permuted2 = initial; - absl::c_prev_permutation(permuted2, std::greater()); - EXPECT_EQ(permuted, permuted2); - - absl::c_prev_permutation(permuted); - EXPECT_EQ(initial, permuted); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/equal_benchmark.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/equal_benchmark.cc deleted file mode 100644 index 7bf62c9a7..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/algorithm/equal_benchmark.cc +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include - -#include "benchmark/benchmark.h" -#include "absl/algorithm/algorithm.h" - -namespace { - -// The range of sequence sizes to benchmark. -constexpr int kMinBenchmarkSize = 1024; -constexpr int kMaxBenchmarkSize = 8 * 1024 * 1024; - -// A user-defined type for use in equality benchmarks. Note that we expect -// std::memcmp to win for this type: libstdc++'s std::equal only defers to -// memcmp for integral types. This is because it is not straightforward to -// guarantee that std::memcmp would produce a result "as-if" compared by -// operator== for other types (example gotchas: NaN floats, structs with -// padding). -struct EightBits { - explicit EightBits(int /* unused */) : data(0) {} - bool operator==(const EightBits& rhs) const { return data == rhs.data; } - uint8_t data; -}; - -template -void BM_absl_equal_benchmark(benchmark::State& state) { - std::vector xs(state.range(0), T(0)); - std::vector ys = xs; - while (state.KeepRunning()) { - const bool same = absl::equal(xs.begin(), xs.end(), ys.begin(), ys.end()); - benchmark::DoNotOptimize(same); - } -} - -template -void BM_std_equal_benchmark(benchmark::State& state) { - std::vector xs(state.range(0), T(0)); - std::vector ys = xs; - while (state.KeepRunning()) { - const bool same = std::equal(xs.begin(), xs.end(), ys.begin()); - benchmark::DoNotOptimize(same); - } -} - -template -void BM_memcmp_benchmark(benchmark::State& state) { - std::vector xs(state.range(0), T(0)); - std::vector ys = xs; - while (state.KeepRunning()) { - const bool same = - std::memcmp(xs.data(), ys.data(), xs.size() * sizeof(T)) == 0; - benchmark::DoNotOptimize(same); - } -} - -// The expectation is that the compiler should be able to elide the equality -// comparison altogether for sufficiently simple types. -template -void BM_absl_equal_self_benchmark(benchmark::State& state) { - std::vector xs(state.range(0), T(0)); - while (state.KeepRunning()) { - const bool same = absl::equal(xs.begin(), xs.end(), xs.begin(), xs.end()); - benchmark::DoNotOptimize(same); - } -} - -BENCHMARK_TEMPLATE(BM_absl_equal_benchmark, uint8_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_std_equal_benchmark, uint8_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_memcmp_benchmark, uint8_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_absl_equal_self_benchmark, uint8_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); - -BENCHMARK_TEMPLATE(BM_absl_equal_benchmark, uint16_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_std_equal_benchmark, uint16_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_memcmp_benchmark, uint16_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_absl_equal_self_benchmark, uint16_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); - -BENCHMARK_TEMPLATE(BM_absl_equal_benchmark, uint32_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_std_equal_benchmark, uint32_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_memcmp_benchmark, uint32_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_absl_equal_self_benchmark, uint32_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); - -BENCHMARK_TEMPLATE(BM_absl_equal_benchmark, uint64_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_std_equal_benchmark, uint64_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_memcmp_benchmark, uint64_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_absl_equal_self_benchmark, uint64_t) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); - -BENCHMARK_TEMPLATE(BM_absl_equal_benchmark, EightBits) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_std_equal_benchmark, EightBits) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_memcmp_benchmark, EightBits) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); -BENCHMARK_TEMPLATE(BM_absl_equal_self_benchmark, EightBits) - ->Range(kMinBenchmarkSize, kMaxBenchmarkSize); - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/BUILD.bazel b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/BUILD.bazel deleted file mode 100644 index 9fb1d8cdd..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/BUILD.bazel +++ /dev/null @@ -1,539 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -load( - "//absl:copts/configure_copts.bzl", - "ABSL_DEFAULT_COPTS", - "ABSL_DEFAULT_LINKOPTS", - "ABSL_TEST_COPTS", - "ABSL_EXCEPTIONS_FLAG", - "ABSL_EXCEPTIONS_FLAG_LINKOPTS", -) - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -cc_library( - name = "spinlock_wait", - srcs = [ - "internal/spinlock_akaros.inc", - "internal/spinlock_linux.inc", - "internal/spinlock_posix.inc", - "internal/spinlock_wait.cc", - "internal/spinlock_win32.inc", - ], - hdrs = [ - "internal/scheduling_mode.h", - "internal/spinlock_wait.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl/base:__pkg__", - ], - deps = [":core_headers"], -) - -cc_library( - name = "config", - hdrs = [ - "config.h", - "policy_checks.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, -) - -cc_library( - name = "dynamic_annotations", - srcs = ["dynamic_annotations.cc"], - hdrs = ["dynamic_annotations.h"], - copts = ABSL_DEFAULT_COPTS, - defines = ["__CLANG_SUPPORT_DYN_ANNOTATION__"], - linkopts = ABSL_DEFAULT_LINKOPTS, -) - -cc_library( - name = "core_headers", - hdrs = [ - "attributes.h", - "const_init.h", - "macros.h", - "optimization.h", - "port.h", - "thread_annotations.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":config", - ], -) - -cc_library( - name = "malloc_internal", - srcs = [ - "internal/low_level_alloc.cc", - ], - hdrs = [ - "internal/direct_mmap.h", - "internal/low_level_alloc.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = select({ - "//absl:windows": [], - "//conditions:default": ["-pthread"], - }) + ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], - deps = [ - ":base", - ":config", - ":core_headers", - ":dynamic_annotations", - ":spinlock_wait", - ], -) - -cc_library( - name = "base_internal", - hdrs = [ - "internal/hide_ptr.h", - "internal/identity.h", - "internal/inline_variable.h", - "internal/invoke.h", - "internal/scheduling_mode.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], -) - -cc_library( - name = "base", - srcs = [ - "internal/cycleclock.cc", - "internal/raw_logging.cc", - "internal/spinlock.cc", - "internal/sysinfo.cc", - "internal/thread_identity.cc", - "internal/unscaledcycleclock.cc", - "log_severity.cc", - ], - hdrs = [ - "call_once.h", - "casts.h", - "internal/atomic_hook.h", - "internal/cycleclock.h", - "internal/low_level_scheduling.h", - "internal/per_thread_tls.h", - "internal/raw_logging.h", - "internal/spinlock.h", - "internal/sysinfo.h", - "internal/thread_identity.h", - "internal/tsan_mutex_interface.h", - "internal/unscaledcycleclock.h", - "log_severity.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = select({ - "//absl:windows": [], - "//conditions:default": ["-pthread"], - }) + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base_internal", - ":config", - ":core_headers", - ":dynamic_annotations", - ":spinlock_wait", - "//absl/meta:type_traits", - ], -) - -cc_test( - name = "atomic_hook_test", - size = "small", - srcs = ["internal/atomic_hook_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - ":core_headers", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "bit_cast_test", - size = "small", - srcs = [ - "bit_cast_test.cc", - ], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - ":core_headers", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "throw_delegate", - srcs = ["internal/throw_delegate.cc"], - hdrs = ["internal/throw_delegate.h"], - copts = ABSL_DEFAULT_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], - deps = [ - ":base", - ":config", - ], -) - -cc_test( - name = "throw_delegate_test", - srcs = ["throw_delegate_test.cc"], - copts = ABSL_TEST_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":throw_delegate", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "exception_testing", - testonly = 1, - hdrs = ["internal/exception_testing.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], - deps = [ - ":config", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "pretty_function", - hdrs = ["internal/pretty_function.h"], - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = ["//absl:__subpackages__"], -) - -cc_library( - name = "exception_safety_testing", - testonly = 1, - srcs = ["internal/exception_safety_testing.cc"], - hdrs = ["internal/exception_safety_testing.h"], - copts = ABSL_TEST_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":config", - ":pretty_function", - "//absl/memory", - "//absl/meta:type_traits", - "//absl/strings", - "//absl/utility", - "@com_google_googletest//:gtest", - ], -) - -cc_test( - name = "exception_safety_testing_test", - srcs = ["exception_safety_testing_test.cc"], - copts = ABSL_TEST_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":exception_safety_testing", - "//absl/memory", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "inline_variable_test", - size = "small", - srcs = [ - "inline_variable_test.cc", - "inline_variable_test_a.cc", - "inline_variable_test_b.cc", - "internal/inline_variable_testing.h", - ], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base_internal", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "invoke_test", - size = "small", - srcs = ["invoke_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base_internal", - "//absl/memory", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -# Common test library made available for use in non-absl code that overrides -# AbslInternalSpinLockDelay and AbslInternalSpinLockWake. -cc_library( - name = "spinlock_test_common", - testonly = 1, - srcs = ["spinlock_test_common.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - ":core_headers", - ":spinlock_wait", - "//absl/synchronization", - "@com_google_googletest//:gtest", - ], - alwayslink = 1, -) - -cc_test( - name = "spinlock_test", - size = "medium", - srcs = ["spinlock_test_common.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - ":core_headers", - ":spinlock_wait", - "//absl/synchronization", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "spinlock_benchmark_common", - testonly = 1, - srcs = ["internal/spinlock_benchmark.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl/base:__pkg__", - ], - deps = [ - ":base", - ":base_internal", - "//absl/synchronization", - "@com_github_google_benchmark//:benchmark_main", - ], - alwayslink = 1, -) - -cc_binary( - name = "spinlock_benchmark", - testonly = 1, - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = ["//visibility:private"], - deps = [ - ":spinlock_benchmark_common", - ], -) - -cc_library( - name = "endian", - hdrs = [ - "internal/endian.h", - "internal/unaligned_access.h", - ], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":config", - ":core_headers", - ], -) - -cc_test( - name = "endian_test", - srcs = ["internal/endian_test.cc"], - copts = ABSL_TEST_COPTS, - deps = [ - ":base", - ":config", - ":endian", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "config_test", - srcs = ["config_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":config", - "//absl/synchronization:thread_pool", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "call_once_test", - srcs = ["call_once_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - ":core_headers", - "//absl/synchronization", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "raw_logging_test", - srcs = ["raw_logging_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "sysinfo_test", - size = "small", - srcs = ["internal/sysinfo_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - "//absl/synchronization", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "low_level_alloc_test", - size = "small", - srcs = ["internal/low_level_alloc_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = ["no_test_ios_x86_64"], - deps = [":malloc_internal"], -) - -cc_test( - name = "thread_identity_test", - size = "small", - srcs = ["internal/thread_identity_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - ":core_headers", - "//absl/synchronization", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "thread_identity_benchmark", - srcs = ["internal/thread_identity_benchmark.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = ["benchmark"], - visibility = ["//visibility:private"], - deps = [ - ":base", - "//absl/synchronization", - "@com_github_google_benchmark//:benchmark_main", - ], -) - -cc_library( - name = "bits", - hdrs = ["internal/bits.h"], - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], - deps = [":core_headers"], -) - -cc_test( - name = "bits_test", - size = "small", - srcs = ["internal/bits_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":bits", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "scoped_set_env", - testonly = 1, - srcs = ["internal/scoped_set_env.cc"], - hdrs = ["internal/scoped_set_env.h"], - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], - deps = [":base"], -) - -cc_test( - name = "scoped_set_env_test", - size = "small", - srcs = ["internal/scoped_set_env_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":scoped_set_env", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "log_severity_test", - size = "small", - srcs = ["log_severity_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":base", - "@com_google_googletest//:gtest_main", - ], -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt deleted file mode 100644 index b9f35bc0b..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/CMakeLists.txt +++ /dev/null @@ -1,498 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -absl_cc_library( - NAME - spinlock_wait - HDRS - "internal/scheduling_mode.h" - "internal/spinlock_wait.h" - SRCS - "internal/spinlock_akaros.inc" - "internal/spinlock_linux.inc" - "internal/spinlock_posix.inc" - "internal/spinlock_wait.cc" - "internal/spinlock_win32.inc" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::core_headers -) - -absl_cc_library( - NAME - config - HDRS - "config.h" - "policy_checks.h" - COPTS - ${ABSL_DEFAULT_COPTS} - PUBLIC -) - -absl_cc_library( - NAME - dynamic_annotations - HDRS - "dynamic_annotations.h" - SRCS - "dynamic_annotations.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - DEFINES - "__CLANG_SUPPORT_DYN_ANNOTATION__" - PUBLIC -) - -absl_cc_library( - NAME - core_headers - HDRS - "attributes.h" - "const_init.h" - "macros.h" - "optimization.h" - "port.h" - "thread_annotations.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::config - PUBLIC -) - -absl_cc_library( - NAME - malloc_internal - HDRS - "internal/direct_mmap.h" - "internal/low_level_alloc.h" - SRCS - "internal/low_level_alloc.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::base - absl::config - absl::core_headers - absl::dynamic_annotations - absl::spinlock_wait - Threads::Threads -) - -absl_cc_library( - NAME - base_internal - HDRS - "internal/hide_ptr.h" - "internal/identity.h" - "internal/inline_variable.h" - "internal/invoke.h" - COPTS - ${ABSL_DEFAULT_COPTS} -) - -absl_cc_library( - NAME - base - HDRS - "call_once.h" - "casts.h" - "internal/atomic_hook.h" - "internal/cycleclock.h" - "internal/low_level_scheduling.h" - "internal/per_thread_tls.h" - "internal/raw_logging.h" - "internal/spinlock.h" - "internal/sysinfo.h" - "internal/thread_identity.h" - "internal/tsan_mutex_interface.h" - "internal/unscaledcycleclock.h" - "log_severity.h" - SRCS - "internal/cycleclock.cc" - "internal/raw_logging.cc" - "internal/spinlock.cc" - "internal/sysinfo.cc" - "internal/thread_identity.cc" - "internal/unscaledcycleclock.cc" - "log_severity.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::base_internal - absl::config - absl::core_headers - absl::dynamic_annotations - absl::spinlock_wait - absl::type_traits - Threads::Threads - PUBLIC -) - -absl_cc_library( - NAME - throw_delegate - HDRS - "internal/throw_delegate.h" - SRCS - "internal/throw_delegate.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - ${ABSL_EXCEPTIONS_FLAG} - DEPS - absl::base -) - -absl_cc_library( - NAME - exception_testing - HDRS - "internal/exception_testing.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::config - gtest - TESTONLY -) - -absl_cc_library( - NAME - pretty_function - HDRS - "internal/pretty_function.h" - COPTS - ${ABSL_DEFAULT_COPTS} -) - -absl_cc_library( - NAME - exception_safety_testing - HDRS - "internal/exception_safety_testing.h" - SRCS - "internal/exception_safety_testing.cc" - COPTS - ${ABSL_TEST_COPTS} - ${ABSL_EXCEPTIONS_FLAG} - LINKOPTS - ${ABSL_EXCEPTIONS_FLAG_LINKOPTS} - DEPS - absl::config - absl::pretty_function - absl::memory - absl::meta - absl::strings - absl::utility - gtest - TESTONLY -) - -absl_cc_test( - NAME - absl_exception_safety_testing_test - SRCS - "exception_safety_testing_test.cc" - COPTS - ${ABSL_TEST_COPTS} - ${ABSL_EXCEPTIONS_FLAG} - LINKOPTS - ${ABSL_EXCEPTIONS_FLAG_LINKOPTS} - DEPS - absl::exception_safety_testing - absl::memory - gtest_main -) - -absl_cc_test( - NAME - atomic_hook_test - SRCS - "internal/atomic_hook_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::core_headers - gtest_main -) - -absl_cc_test( - NAME - bit_cast_test - SRCS - "bit_cast_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::core_headers - gtest_main -) - -absl_cc_test( - NAME - throw_delegate_test - SRCS - "throw_delegate_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::throw_delegate - gtest_main -) - -absl_cc_test( - NAME - inline_variable_test - SRCS - "internal/inline_variable_testing.h" - "inline_variable_test.cc" - "inline_variable_test_a.cc" - "inline_variable_test_b.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base_internal - gtest_main -) - -absl_cc_test( - NAME - invoke_test - SRCS - "invoke_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base_internal - absl::memory - absl::strings - gmock - gtest_main -) - -absl_cc_library( - NAME - spinlock_test_common - SRCS - "spinlock_test_common.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::core_headers - absl::spinlock_wait - absl::synchronization - gtest - TESTONLY -) - -# On bazel BUILD this target use "alwayslink = 1" which is not implemented here -absl_cc_test( - NAME - spinlock_test - SRCS - "spinlock_test_common.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::core_headers - absl::spinlock_wait - absl::synchronization - gtest_main -) - -absl_cc_library( - NAME - endian - HDRS - "internal/endian.h" - "internal/unaligned_access.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::config - absl::core_headers - PUBLIC -) - -absl_cc_test( - NAME - endian_test - SRCS - "internal/endian_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::config - absl::endian - gtest_main -) - -absl_cc_test( - NAME - config_test - SRCS - "config_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::config - absl::synchronization - gtest_main -) - -absl_cc_test( - NAME - call_once_test - SRCS - "call_once_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::core_headers - absl::synchronization - gtest_main -) - -absl_cc_test( - NAME - raw_logging_test - SRCS - "raw_logging_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::strings - gtest_main -) - -absl_cc_test( - NAME - sysinfo_test - SRCS - "internal/sysinfo_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::synchronization - gtest_main -) - -absl_cc_test( - NAME - low_level_alloc_test - SRCS - "internal/low_level_alloc_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::malloc_internal - Threads::Threads -) - -absl_cc_test( - NAME - thread_identity_test - SRCS - "internal/thread_identity_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base - absl::core_headers - absl::synchronization - Threads::Threads - gtest_main -) - -absl_cc_library( - NAME - bits - HDRS - "internal/bits.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::core_headers -) - -absl_cc_test( - NAME - bits_test - SRCS - "internal/bits_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::bits - gtest_main -) - -absl_cc_library( - NAME - scoped_set_env - SRCS - "internal/scoped_set_env.cc" - HDRS - "internal/scoped_set_env.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::base -) - -absl_cc_test( - NAME - scoped_set_env_test - SRCS - "internal/scoped_set_env_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::scoped_set_env - gtest_main -) - -absl_cc_test( - NAME - cmake_thread_test - SRCS - "internal/cmake_thread_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::base -) - -absl_cc_test( - NAME - log_severity_test - SRCS - "log_severity_test.cc" - DEPS - absl::base - gmock - gtest_main -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/bit_cast_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/bit_cast_test.cc deleted file mode 100644 index 4846add43..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/bit_cast_test.cc +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Unit test for bit_cast template. - -#include -#include - -#include "gtest/gtest.h" -#include "absl/base/casts.h" -#include "absl/base/macros.h" - -namespace absl { -namespace { - -template -struct marshall { char buf[N]; }; - -template -void TestMarshall(const T values[], int num_values) { - for (int i = 0; i < num_values; ++i) { - T t0 = values[i]; - marshall m0 = absl::bit_cast >(t0); - T t1 = absl::bit_cast(m0); - marshall m1 = absl::bit_cast >(t1); - ASSERT_EQ(0, memcmp(&t0, &t1, sizeof(T))); - ASSERT_EQ(0, memcmp(&m0, &m1, sizeof(T))); - } -} - -// Convert back and forth to an integral type. The C++ standard does -// not guarantee this will work, but we test that this works on all the -// platforms we support. -// -// Likewise, we below make assumptions about sizeof(float) and -// sizeof(double) which the standard does not guarantee, but which hold on the -// platforms we support. - -template -void TestIntegral(const T values[], int num_values) { - for (int i = 0; i < num_values; ++i) { - T t0 = values[i]; - I i0 = absl::bit_cast(t0); - T t1 = absl::bit_cast(i0); - I i1 = absl::bit_cast(t1); - ASSERT_EQ(0, memcmp(&t0, &t1, sizeof(T))); - ASSERT_EQ(i0, i1); - } -} - -TEST(BitCast, Bool) { - static const bool bool_list[] = { false, true }; - TestMarshall(bool_list, ABSL_ARRAYSIZE(bool_list)); -} - -TEST(BitCast, Int32) { - static const int32_t int_list[] = - { 0, 1, 100, 2147483647, -1, -100, -2147483647, -2147483647-1 }; - TestMarshall(int_list, ABSL_ARRAYSIZE(int_list)); -} - -TEST(BitCast, Int64) { - static const int64_t int64_list[] = - { 0, 1, 1LL << 40, -1, -(1LL<<40) }; - TestMarshall(int64_list, ABSL_ARRAYSIZE(int64_list)); -} - -TEST(BitCast, Uint64) { - static const uint64_t uint64_list[] = - { 0, 1, 1LLU << 40, 1LLU << 63 }; - TestMarshall(uint64_list, ABSL_ARRAYSIZE(uint64_list)); -} - -TEST(BitCast, Float) { - static const float float_list[] = - { 0.0f, 1.0f, -1.0f, 10.0f, -10.0f, - 1e10f, 1e20f, 1e-10f, 1e-20f, - 2.71828f, 3.14159f }; - TestMarshall(float_list, ABSL_ARRAYSIZE(float_list)); - TestIntegral(float_list, ABSL_ARRAYSIZE(float_list)); - TestIntegral(float_list, ABSL_ARRAYSIZE(float_list)); -} - -TEST(BitCast, Double) { - static const double double_list[] = - { 0.0, 1.0, -1.0, 10.0, -10.0, - 1e10, 1e100, 1e-10, 1e-100, - 2.718281828459045, - 3.141592653589793238462643383279502884197169399375105820974944 }; - TestMarshall(double_list, ABSL_ARRAYSIZE(double_list)); - TestIntegral(double_list, ABSL_ARRAYSIZE(double_list)); - TestIntegral(double_list, ABSL_ARRAYSIZE(double_list)); -} - -} // namespace -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/call_once_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/call_once_test.cc deleted file mode 100644 index 9c2a0c447..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/call_once_test.cc +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/call_once.h" - -#include -#include - -#include "gtest/gtest.h" -#include "absl/base/attributes.h" -#include "absl/base/const_init.h" -#include "absl/base/thread_annotations.h" -#include "absl/synchronization/mutex.h" - -namespace absl { -namespace { - -absl::once_flag once; - -ABSL_CONST_INIT Mutex counters_mu(absl::kConstInit); - -int running_thread_count GUARDED_BY(counters_mu) = 0; -int call_once_invoke_count GUARDED_BY(counters_mu) = 0; -int call_once_finished_count GUARDED_BY(counters_mu) = 0; -int call_once_return_count GUARDED_BY(counters_mu) = 0; -bool done_blocking GUARDED_BY(counters_mu) = false; - -// Function to be called from absl::call_once. Waits for a notification. -void WaitAndIncrement() { - counters_mu.Lock(); - ++call_once_invoke_count; - counters_mu.Unlock(); - - counters_mu.LockWhen(Condition(&done_blocking)); - ++call_once_finished_count; - counters_mu.Unlock(); -} - -void ThreadBody() { - counters_mu.Lock(); - ++running_thread_count; - counters_mu.Unlock(); - - absl::call_once(once, WaitAndIncrement); - - counters_mu.Lock(); - ++call_once_return_count; - counters_mu.Unlock(); -} - -// Returns true if all threads are set up for the test. -bool ThreadsAreSetup(void*) EXCLUSIVE_LOCKS_REQUIRED(counters_mu) { - // All ten threads must be running, and WaitAndIncrement should be blocked. - return running_thread_count == 10 && call_once_invoke_count == 1; -} - -TEST(CallOnceTest, ExecutionCount) { - std::vector threads; - - // Start 10 threads all calling call_once on the same once_flag. - for (int i = 0; i < 10; ++i) { - threads.emplace_back(ThreadBody); - } - - - // Wait until all ten threads have started, and WaitAndIncrement has been - // invoked. - counters_mu.LockWhen(Condition(ThreadsAreSetup, nullptr)); - - // WaitAndIncrement should have been invoked by exactly one call_once() - // instance. That thread should be blocking on a notification, and all other - // call_once instances should be blocking as well. - EXPECT_EQ(call_once_invoke_count, 1); - EXPECT_EQ(call_once_finished_count, 0); - EXPECT_EQ(call_once_return_count, 0); - - // Allow WaitAndIncrement to finish executing. Once it does, the other - // call_once waiters will be unblocked. - done_blocking = true; - counters_mu.Unlock(); - - for (std::thread& thread : threads) { - thread.join(); - } - - counters_mu.Lock(); - EXPECT_EQ(call_once_invoke_count, 1); - EXPECT_EQ(call_once_finished_count, 1); - EXPECT_EQ(call_once_return_count, 10); - counters_mu.Unlock(); -} - -} // namespace -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/config.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/config.h deleted file mode 100644 index 3b81e269d..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/config.h +++ /dev/null @@ -1,458 +0,0 @@ -// -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: config.h -// ----------------------------------------------------------------------------- -// -// This header file defines a set of macros for checking the presence of -// important compiler and platform features. Such macros can be used to -// produce portable code by parameterizing compilation based on the presence or -// lack of a given feature. -// -// We define a "feature" as some interface we wish to program to: for example, -// a library function or system call. A value of `1` indicates support for -// that feature; any other value indicates the feature support is undefined. -// -// Example: -// -// Suppose a programmer wants to write a program that uses the 'mmap()' system -// call. The Abseil macro for that feature (`ABSL_HAVE_MMAP`) allows you to -// selectively include the `mmap.h` header and bracket code using that feature -// in the macro: -// -// #include "absl/base/config.h" -// -// #ifdef ABSL_HAVE_MMAP -// #include "sys/mman.h" -// #endif //ABSL_HAVE_MMAP -// -// ... -// #ifdef ABSL_HAVE_MMAP -// void *ptr = mmap(...); -// ... -// #endif // ABSL_HAVE_MMAP - -#ifndef ABSL_BASE_CONFIG_H_ -#define ABSL_BASE_CONFIG_H_ - -// Included for the __GLIBC__ macro (or similar macros on other systems). -#include - -#ifdef __cplusplus -// Included for __GLIBCXX__, _LIBCPP_VERSION -#include -#endif // __cplusplus - -#if defined(__APPLE__) -// Included for TARGET_OS_IPHONE, __IPHONE_OS_VERSION_MIN_REQUIRED, -// __IPHONE_8_0. -#include -#include -#endif - -#include "absl/base/policy_checks.h" - -// ----------------------------------------------------------------------------- -// Compiler Feature Checks -// ----------------------------------------------------------------------------- - -// ABSL_HAVE_BUILTIN() -// -// Checks whether the compiler supports a Clang Feature Checking Macro, and if -// so, checks whether it supports the provided builtin function "x" where x -// is one of the functions noted in -// https://clang.llvm.org/docs/LanguageExtensions.html -// -// Note: Use this macro to avoid an extra level of #ifdef __has_builtin check. -// http://releases.llvm.org/3.3/tools/clang/docs/LanguageExtensions.html -#ifdef __has_builtin -#define ABSL_HAVE_BUILTIN(x) __has_builtin(x) -#else -#define ABSL_HAVE_BUILTIN(x) 0 -#endif - -// ABSL_HAVE_TLS is defined to 1 when __thread should be supported. -// We assume __thread is supported on Linux when compiled with Clang or compiled -// against libstdc++ with _GLIBCXX_HAVE_TLS defined. -#ifdef ABSL_HAVE_TLS -#error ABSL_HAVE_TLS cannot be directly set -#elif defined(__linux__) && (defined(__clang__) || defined(_GLIBCXX_HAVE_TLS)) -#define ABSL_HAVE_TLS 1 -#endif - -// ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE -// -// Checks whether `std::is_trivially_destructible` is supported. -// -// Notes: All supported compilers using libc++ support this feature, as does -// gcc >= 4.8.1 using libstdc++, and Visual Studio. -#ifdef ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE -#error ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE cannot be directly set -#elif defined(_LIBCPP_VERSION) || \ - (!defined(__clang__) && defined(__GNUC__) && defined(__GLIBCXX__) && \ - (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8))) || \ - defined(_MSC_VER) -#define ABSL_HAVE_STD_IS_TRIVIALLY_DESTRUCTIBLE 1 -#endif - -// ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE -// -// Checks whether `std::is_trivially_default_constructible` and -// `std::is_trivially_copy_constructible` are supported. - -// ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE -// -// Checks whether `std::is_trivially_copy_assignable` is supported. - -// Notes: Clang with libc++ supports these features, as does gcc >= 5.1 with -// either libc++ or libstdc++, and Visual Studio (but not NVCC). -#if defined(ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE) -#error ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE cannot be directly set -#elif defined(ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE) -#error ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE cannot directly set -#elif (defined(__clang__) && defined(_LIBCPP_VERSION)) || \ - (!defined(__clang__) && defined(__GNUC__) && \ - (__GNUC__ > 5 || (__GNUC__ == 5 && __GNUC_MINOR__ >= 1)) && \ - (defined(_LIBCPP_VERSION) || defined(__GLIBCXX__))) || \ - (defined(_MSC_VER) && !defined(__NVCC__)) -#define ABSL_HAVE_STD_IS_TRIVIALLY_CONSTRUCTIBLE 1 -#define ABSL_HAVE_STD_IS_TRIVIALLY_ASSIGNABLE 1 -#endif - -// ABSL_HAVE_THREAD_LOCAL -// -// Checks whether C++11's `thread_local` storage duration specifier is -// supported. -#ifdef ABSL_HAVE_THREAD_LOCAL -#error ABSL_HAVE_THREAD_LOCAL cannot be directly set -#elif defined(__APPLE__) -// Notes: -// * Xcode's clang did not support `thread_local` until version 8, and -// even then not for all iOS < 9.0. -// * Xcode 9.3 started disallowing `thread_local` for 32-bit iOS simulator -// targeting iOS 9.x. -// * Xcode 10 moves the deployment target check for iOS < 9.0 to link time -// making __has_feature unreliable there. -// -// Otherwise, `__has_feature` is only supported by Clang so it has be inside -// `defined(__APPLE__)` check. -#if __has_feature(cxx_thread_local) && \ - !(TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_9_0) -#define ABSL_HAVE_THREAD_LOCAL 1 -#endif -#else // !defined(__APPLE__) -#define ABSL_HAVE_THREAD_LOCAL 1 -#endif - -// There are platforms for which TLS should not be used even though the compiler -// makes it seem like it's supported (Android NDK < r12b for example). -// This is primarily because of linker problems and toolchain misconfiguration: -// Abseil does not intend to support this indefinitely. Currently, the newest -// toolchain that we intend to support that requires this behavior is the -// r11 NDK - allowing for a 5 year support window on that means this option -// is likely to be removed around June of 2021. -// TLS isn't supported until NDK r12b per -// https://developer.android.com/ndk/downloads/revision_history.html -// Since NDK r16, `__NDK_MAJOR__` and `__NDK_MINOR__` are defined in -// . For NDK < r16, users should define these macros, -// e.g. `-D__NDK_MAJOR__=11 -D__NKD_MINOR__=0` for NDK r11. -#if defined(__ANDROID__) && defined(__clang__) -#if __has_include() -#include -#endif // __has_include() -#if defined(__ANDROID__) && defined(__clang__) && defined(__NDK_MAJOR__) && \ - defined(__NDK_MINOR__) && \ - ((__NDK_MAJOR__ < 12) || ((__NDK_MAJOR__ == 12) && (__NDK_MINOR__ < 1))) -#undef ABSL_HAVE_TLS -#undef ABSL_HAVE_THREAD_LOCAL -#endif -#endif // defined(__ANDROID__) && defined(__clang__) - -// ABSL_HAVE_INTRINSIC_INT128 -// -// Checks whether the __int128 compiler extension for a 128-bit integral type is -// supported. -// -// Note: __SIZEOF_INT128__ is defined by Clang and GCC when __int128 is -// supported, but we avoid using it in certain cases: -// * On Clang: -// * Building using Clang for Windows, where the Clang runtime library has -// 128-bit support only on LP64 architectures, but Windows is LLP64. -// * Building for aarch64, where __int128 exists but has exhibits a sporadic -// compiler crashing bug. -// * On Nvidia's nvcc: -// * nvcc also defines __GNUC__ and __SIZEOF_INT128__, but not all versions -// actually support __int128. -#ifdef ABSL_HAVE_INTRINSIC_INT128 -#error ABSL_HAVE_INTRINSIC_INT128 cannot be directly set -#elif defined(__SIZEOF_INT128__) -#if (defined(__clang__) && !defined(_WIN32) && !defined(__aarch64__)) || \ - (defined(__CUDACC__) && __CUDACC_VER_MAJOR__ >= 9) || \ - (defined(__GNUC__) && !defined(__clang__) && !defined(__CUDACC__)) -#define ABSL_HAVE_INTRINSIC_INT128 1 -#elif defined(__CUDACC__) -// __CUDACC_VER__ is a full version number before CUDA 9, and is defined to a -// string explaining that it has been removed starting with CUDA 9. We use -// nested #ifs because there is no short-circuiting in the preprocessor. -// NOTE: `__CUDACC__` could be undefined while `__CUDACC_VER__` is defined. -#if __CUDACC_VER__ >= 70000 -#define ABSL_HAVE_INTRINSIC_INT128 1 -#endif // __CUDACC_VER__ >= 70000 -#endif // defined(__CUDACC__) -#endif // ABSL_HAVE_INTRINSIC_INT128 - -// ABSL_HAVE_EXCEPTIONS -// -// Checks whether the compiler both supports and enables exceptions. Many -// compilers support a "no exceptions" mode that disables exceptions. -// -// Generally, when ABSL_HAVE_EXCEPTIONS is not defined: -// -// * Code using `throw` and `try` may not compile. -// * The `noexcept` specifier will still compile and behave as normal. -// * The `noexcept` operator may still return `false`. -// -// For further details, consult the compiler's documentation. -#ifdef ABSL_HAVE_EXCEPTIONS -#error ABSL_HAVE_EXCEPTIONS cannot be directly set. - -#elif defined(__clang__) -// TODO(calabrese) -// Switch to using __cpp_exceptions when we no longer support versions < 3.6. -// For details on this check, see: -// http://releases.llvm.org/3.6.0/tools/clang/docs/ReleaseNotes.html#the-exceptions-macro -#if defined(__EXCEPTIONS) && __has_feature(cxx_exceptions) -#define ABSL_HAVE_EXCEPTIONS 1 -#endif // defined(__EXCEPTIONS) && __has_feature(cxx_exceptions) - -// Handle remaining special cases and default to exceptions being supported. -#elif !(defined(__GNUC__) && (__GNUC__ < 5) && !defined(__EXCEPTIONS)) && \ - !(defined(__GNUC__) && (__GNUC__ >= 5) && !defined(__cpp_exceptions)) && \ - !(defined(_MSC_VER) && !defined(_CPPUNWIND)) -#define ABSL_HAVE_EXCEPTIONS 1 -#endif - -// ----------------------------------------------------------------------------- -// Platform Feature Checks -// ----------------------------------------------------------------------------- - -// Currently supported operating systems and associated preprocessor -// symbols: -// -// Linux and Linux-derived __linux__ -// Android __ANDROID__ (implies __linux__) -// Linux (non-Android) __linux__ && !__ANDROID__ -// Darwin (Mac OS X and iOS) __APPLE__ -// Akaros (http://akaros.org) __ros__ -// Windows _WIN32 -// NaCL __native_client__ -// AsmJS __asmjs__ -// WebAssembly __wasm__ -// Fuchsia __Fuchsia__ -// -// Note that since Android defines both __ANDROID__ and __linux__, one -// may probe for either Linux or Android by simply testing for __linux__. - -// ABSL_HAVE_MMAP -// -// Checks whether the platform has an mmap(2) implementation as defined in -// POSIX.1-2001. -#ifdef ABSL_HAVE_MMAP -#error ABSL_HAVE_MMAP cannot be directly set -#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ - defined(__ros__) || defined(__native_client__) || defined(__asmjs__) || \ - defined(__wasm__) || defined(__Fuchsia__) || defined(__sun) || \ - defined(__ASYLO__) -#define ABSL_HAVE_MMAP 1 -#endif - -// ABSL_HAVE_PTHREAD_GETSCHEDPARAM -// -// Checks whether the platform implements the pthread_(get|set)schedparam(3) -// functions as defined in POSIX.1-2001. -#ifdef ABSL_HAVE_PTHREAD_GETSCHEDPARAM -#error ABSL_HAVE_PTHREAD_GETSCHEDPARAM cannot be directly set -#elif defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || \ - defined(__ros__) -#define ABSL_HAVE_PTHREAD_GETSCHEDPARAM 1 -#endif - -// ABSL_HAVE_SCHED_YIELD -// -// Checks whether the platform implements sched_yield(2) as defined in -// POSIX.1-2001. -#ifdef ABSL_HAVE_SCHED_YIELD -#error ABSL_HAVE_SCHED_YIELD cannot be directly set -#elif defined(__linux__) || defined(__ros__) || defined(__native_client__) -#define ABSL_HAVE_SCHED_YIELD 1 -#endif - -// ABSL_HAVE_SEMAPHORE_H -// -// Checks whether the platform supports the header and sem_open(3) -// family of functions as standardized in POSIX.1-2001. -// -// Note: While Apple provides for both iOS and macOS, it is -// explicitly deprecated and will cause build failures if enabled for those -// platforms. We side-step the issue by not defining it here for Apple -// platforms. -#ifdef ABSL_HAVE_SEMAPHORE_H -#error ABSL_HAVE_SEMAPHORE_H cannot be directly set -#elif defined(__linux__) || defined(__ros__) -#define ABSL_HAVE_SEMAPHORE_H 1 -#endif - -// ABSL_HAVE_ALARM -// -// Checks whether the platform supports the header and alarm(2) -// function as standardized in POSIX.1-2001. -#ifdef ABSL_HAVE_ALARM -#error ABSL_HAVE_ALARM cannot be directly set -#elif defined(__GOOGLE_GRTE_VERSION__) -// feature tests for Google's GRTE -#define ABSL_HAVE_ALARM 1 -#elif defined(__GLIBC__) -// feature test for glibc -#define ABSL_HAVE_ALARM 1 -#elif defined(_MSC_VER) -// feature tests for Microsoft's library -#elif defined(__EMSCRIPTEN__) -// emscripten doesn't support signals -#elif defined(__native_client__) -#else -// other standard libraries -#define ABSL_HAVE_ALARM 1 -#endif - -// ABSL_IS_LITTLE_ENDIAN -// ABSL_IS_BIG_ENDIAN -// -// Checks the endianness of the platform. -// -// Notes: uses the built in endian macros provided by GCC (since 4.6) and -// Clang (since 3.2); see -// https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html. -// Otherwise, if _WIN32, assume little endian. Otherwise, bail with an error. -#if defined(ABSL_IS_BIG_ENDIAN) -#error "ABSL_IS_BIG_ENDIAN cannot be directly set." -#endif -#if defined(ABSL_IS_LITTLE_ENDIAN) -#error "ABSL_IS_LITTLE_ENDIAN cannot be directly set." -#endif - -#if (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) -#define ABSL_IS_LITTLE_ENDIAN 1 -#elif defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \ - __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ -#define ABSL_IS_BIG_ENDIAN 1 -#elif defined(_WIN32) -#define ABSL_IS_LITTLE_ENDIAN 1 -#else -#error "absl endian detection needs to be set up for your compiler" -#endif - -// MacOS 10.13 doesn't let you use , , or even though -// the headers exist and are publicly noted to work. See -// https://github.com/abseil/abseil-cpp/issues/207 and -// https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes -#if defined(__APPLE__) && defined(_LIBCPP_VERSION) && \ - defined(__MAC_OS_X_VERSION_MIN_REQUIRED__) && \ - __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101400 -#define ABSL_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE 1 -#else -#define ABSL_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE 0 -#endif - -// ABSL_HAVE_STD_ANY -// -// Checks whether C++17 std::any is available by checking whether exists. -#ifdef ABSL_HAVE_STD_ANY -#error "ABSL_HAVE_STD_ANY cannot be directly set." -#endif - -#ifdef __has_include -#if __has_include() && __cplusplus >= 201703L && \ - !ABSL_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE -#define ABSL_HAVE_STD_ANY 1 -#endif -#endif - -// ABSL_HAVE_STD_OPTIONAL -// -// Checks whether C++17 std::optional is available. -#ifdef ABSL_HAVE_STD_OPTIONAL -#error "ABSL_HAVE_STD_OPTIONAL cannot be directly set." -#endif - -#ifdef __has_include -#if __has_include() && __cplusplus >= 201703L && \ - !ABSL_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE -#define ABSL_HAVE_STD_OPTIONAL 1 -#endif -#endif - -// ABSL_HAVE_STD_VARIANT -// -// Checks whether C++17 std::variant is available. -#ifdef ABSL_HAVE_STD_VARIANT -#error "ABSL_HAVE_STD_VARIANT cannot be directly set." -#endif - -#ifdef __has_include -#if __has_include() && __cplusplus >= 201703L && \ - !ABSL_INTERNAL_MACOS_CXX17_TYPES_UNAVAILABLE -#define ABSL_HAVE_STD_VARIANT 1 -#endif -#endif - -// ABSL_HAVE_STD_STRING_VIEW -// -// Checks whether C++17 std::string_view is available. -#ifdef ABSL_HAVE_STD_STRING_VIEW -#error "ABSL_HAVE_STD_STRING_VIEW cannot be directly set." -#endif - -#ifdef __has_include -#if __has_include() && __cplusplus >= 201703L -#define ABSL_HAVE_STD_STRING_VIEW 1 -#endif -#endif - -// For MSVC, `__has_include` is supported in VS 2017 15.3, which is later than -// the support for , , , . So we use -// _MSC_VER to check whether we have VS 2017 RTM (when , , -// , is implemented) or higher. Also, `__cplusplus` is -// not correctly set by MSVC, so we use `_MSVC_LANG` to check the language -// version. -// TODO(zhangxy): fix tests before enabling aliasing for `std::any`. -#if defined(_MSC_VER) && _MSC_VER >= 1910 && \ - ((defined(_MSVC_LANG) && _MSVC_LANG > 201402) || __cplusplus > 201402) -// #define ABSL_HAVE_STD_ANY 1 -#define ABSL_HAVE_STD_OPTIONAL 1 -#define ABSL_HAVE_STD_VARIANT 1 -#define ABSL_HAVE_STD_STRING_VIEW 1 -#endif - -// In debug mode, MSVC 2017's std::variant throws a EXCEPTION_ACCESS_VIOLATION -// SEH exception from emplace for variant when constructing the -// struct can throw. This defeats some of variant_test and -// variant_exception_safety_test. -#if defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_DEBUG) -#define ABSL_INTERNAL_MSVC_2017_DBG_MODE -#endif - -#endif // ABSL_BASE_CONFIG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/config_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/config_test.cc deleted file mode 100644 index 7e0c033de..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/config_test.cc +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/config.h" - -#include - -#include "gtest/gtest.h" -#include "absl/synchronization/internal/thread_pool.h" - -namespace { - -TEST(ConfigTest, Endianness) { - union { - uint32_t value; - uint8_t data[sizeof(uint32_t)]; - } number; - number.data[0] = 0x00; - number.data[1] = 0x01; - number.data[2] = 0x02; - number.data[3] = 0x03; -#if defined(ABSL_IS_LITTLE_ENDIAN) && defined(ABSL_IS_BIG_ENDIAN) -#error Both ABSL_IS_LITTLE_ENDIAN and ABSL_IS_BIG_ENDIAN are defined -#elif defined(ABSL_IS_LITTLE_ENDIAN) - EXPECT_EQ(UINT32_C(0x03020100), number.value); -#elif defined(ABSL_IS_BIG_ENDIAN) - EXPECT_EQ(UINT32_C(0x00010203), number.value); -#else -#error Unknown endianness -#endif -} - -#if defined(ABSL_HAVE_THREAD_LOCAL) -TEST(ConfigTest, ThreadLocal) { - static thread_local int mine_mine_mine = 16; - EXPECT_EQ(16, mine_mine_mine); - { - absl::synchronization_internal::ThreadPool pool(1); - pool.Schedule([&] { - EXPECT_EQ(16, mine_mine_mine); - mine_mine_mine = 32; - EXPECT_EQ(32, mine_mine_mine); - }); - } - EXPECT_EQ(16, mine_mine_mine); -} -#endif - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/exception_safety_testing_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/exception_safety_testing_test.cc deleted file mode 100644 index 2ed386065..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/exception_safety_testing_test.cc +++ /dev/null @@ -1,954 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/exception_safety_testing.h" - -#include -#include -#include -#include -#include -#include - -#include "gtest/gtest-spi.h" -#include "gtest/gtest.h" -#include "absl/memory/memory.h" - -namespace testing { - -namespace { - -using ::testing::exceptions_internal::SetCountdown; -using ::testing::exceptions_internal::TestException; -using ::testing::exceptions_internal::UnsetCountdown; - -// EXPECT_NO_THROW can't inspect the thrown inspection in general. -template -void ExpectNoThrow(const F& f) { - try { - f(); - } catch (const TestException& e) { - ADD_FAILURE() << "Unexpected exception thrown from " << e.what(); - } -} - -TEST(ThrowingValueTest, Throws) { - SetCountdown(); - EXPECT_THROW(ThrowingValue<> bomb, TestException); - - // It's not guaranteed that every operator only throws *once*. The default - // ctor only throws once, though, so use it to make sure we only throw when - // the countdown hits 0 - SetCountdown(2); - ExpectNoThrow([]() { ThrowingValue<> bomb; }); - ExpectNoThrow([]() { ThrowingValue<> bomb; }); - EXPECT_THROW(ThrowingValue<> bomb, TestException); - - UnsetCountdown(); -} - -// Tests that an operation throws when the countdown is at 0, doesn't throw when -// the countdown doesn't hit 0, and doesn't modify the state of the -// ThrowingValue if it throws -template -void TestOp(const F& f) { - ExpectNoThrow(f); - - SetCountdown(); - EXPECT_THROW(f(), TestException); - UnsetCountdown(); -} - -TEST(ThrowingValueTest, ThrowingCtors) { - ThrowingValue<> bomb; - - TestOp([]() { ThrowingValue<> bomb(1); }); - TestOp([&]() { ThrowingValue<> bomb1 = bomb; }); - TestOp([&]() { ThrowingValue<> bomb1 = std::move(bomb); }); -} - -TEST(ThrowingValueTest, ThrowingAssignment) { - ThrowingValue<> bomb, bomb1; - - TestOp([&]() { bomb = bomb1; }); - TestOp([&]() { bomb = std::move(bomb1); }); - - // Test that when assignment throws, the assignment should fail (lhs != rhs) - // and strong guarantee fails (lhs != lhs_copy). - { - ThrowingValue<> lhs(39), rhs(42); - ThrowingValue<> lhs_copy(lhs); - SetCountdown(); - EXPECT_THROW(lhs = rhs, TestException); - UnsetCountdown(); - EXPECT_NE(lhs, rhs); - EXPECT_NE(lhs_copy, lhs); - } - { - ThrowingValue<> lhs(39), rhs(42); - ThrowingValue<> lhs_copy(lhs), rhs_copy(rhs); - SetCountdown(); - EXPECT_THROW(lhs = std::move(rhs), TestException); - UnsetCountdown(); - EXPECT_NE(lhs, rhs_copy); - EXPECT_NE(lhs_copy, lhs); - } -} - -TEST(ThrowingValueTest, ThrowingComparisons) { - ThrowingValue<> bomb1, bomb2; - TestOp([&]() { return bomb1 == bomb2; }); - TestOp([&]() { return bomb1 != bomb2; }); - TestOp([&]() { return bomb1 < bomb2; }); - TestOp([&]() { return bomb1 <= bomb2; }); - TestOp([&]() { return bomb1 > bomb2; }); - TestOp([&]() { return bomb1 >= bomb2; }); -} - -TEST(ThrowingValueTest, ThrowingArithmeticOps) { - ThrowingValue<> bomb1(1), bomb2(2); - - TestOp([&bomb1]() { +bomb1; }); - TestOp([&bomb1]() { -bomb1; }); - TestOp([&bomb1]() { ++bomb1; }); - TestOp([&bomb1]() { bomb1++; }); - TestOp([&bomb1]() { --bomb1; }); - TestOp([&bomb1]() { bomb1--; }); - - TestOp([&]() { bomb1 + bomb2; }); - TestOp([&]() { bomb1 - bomb2; }); - TestOp([&]() { bomb1* bomb2; }); - TestOp([&]() { bomb1 / bomb2; }); - TestOp([&]() { bomb1 << 1; }); - TestOp([&]() { bomb1 >> 1; }); -} - -TEST(ThrowingValueTest, ThrowingLogicalOps) { - ThrowingValue<> bomb1, bomb2; - - TestOp([&bomb1]() { !bomb1; }); - TestOp([&]() { bomb1&& bomb2; }); - TestOp([&]() { bomb1 || bomb2; }); -} - -TEST(ThrowingValueTest, ThrowingBitwiseOps) { - ThrowingValue<> bomb1, bomb2; - - TestOp([&bomb1]() { ~bomb1; }); - TestOp([&]() { bomb1& bomb2; }); - TestOp([&]() { bomb1 | bomb2; }); - TestOp([&]() { bomb1 ^ bomb2; }); -} - -TEST(ThrowingValueTest, ThrowingCompoundAssignmentOps) { - ThrowingValue<> bomb1(1), bomb2(2); - - TestOp([&]() { bomb1 += bomb2; }); - TestOp([&]() { bomb1 -= bomb2; }); - TestOp([&]() { bomb1 *= bomb2; }); - TestOp([&]() { bomb1 /= bomb2; }); - TestOp([&]() { bomb1 %= bomb2; }); - TestOp([&]() { bomb1 &= bomb2; }); - TestOp([&]() { bomb1 |= bomb2; }); - TestOp([&]() { bomb1 ^= bomb2; }); - TestOp([&]() { bomb1 *= bomb2; }); -} - -TEST(ThrowingValueTest, ThrowingStreamOps) { - ThrowingValue<> bomb; - - TestOp([&]() { - std::istringstream stream; - stream >> bomb; - }); - TestOp([&]() { - std::stringstream stream; - stream << bomb; - }); -} - -// Tests the operator<< of ThrowingValue by forcing ConstructorTracker to emit -// a nonfatal failure that contains the string representation of the Thrower -TEST(ThrowingValueTest, StreamOpsOutput) { - using ::testing::TypeSpec; - exceptions_internal::ConstructorTracker ct(exceptions_internal::countdown); - - // Test default spec list (kEverythingThrows) - EXPECT_NONFATAL_FAILURE( - { - using Thrower = ThrowingValue; - auto thrower = Thrower(123); - thrower.~Thrower(); - }, - "ThrowingValue<>(123)"); - - // Test with one item in spec list (kNoThrowCopy) - EXPECT_NONFATAL_FAILURE( - { - using Thrower = ThrowingValue; - auto thrower = Thrower(234); - thrower.~Thrower(); - }, - "ThrowingValue(234)"); - - // Test with multiple items in spec list (kNoThrowMove, kNoThrowNew) - EXPECT_NONFATAL_FAILURE( - { - using Thrower = - ThrowingValue; - auto thrower = Thrower(345); - thrower.~Thrower(); - }, - "ThrowingValue(345)"); - - // Test with all items in spec list (kNoThrowCopy, kNoThrowMove, kNoThrowNew) - EXPECT_NONFATAL_FAILURE( - { - using Thrower = ThrowingValue(-1)>; - auto thrower = Thrower(456); - thrower.~Thrower(); - }, - "ThrowingValue(456)"); -} - -template -void TestAllocatingOp(const F& f) { - ExpectNoThrow(f); - - SetCountdown(); - EXPECT_THROW(f(), exceptions_internal::TestBadAllocException); - UnsetCountdown(); -} - -TEST(ThrowingValueTest, ThrowingAllocatingOps) { - // make_unique calls unqualified operator new, so these exercise the - // ThrowingValue overloads. - TestAllocatingOp([]() { return absl::make_unique>(1); }); - TestAllocatingOp([]() { return absl::make_unique[]>(2); }); -} - -TEST(ThrowingValueTest, NonThrowingMoveCtor) { - ThrowingValue nothrow_ctor; - - SetCountdown(); - ExpectNoThrow([¬hrow_ctor]() { - ThrowingValue nothrow1 = std::move(nothrow_ctor); - }); - UnsetCountdown(); -} - -TEST(ThrowingValueTest, NonThrowingMoveAssign) { - ThrowingValue nothrow_assign1, nothrow_assign2; - - SetCountdown(); - ExpectNoThrow([¬hrow_assign1, ¬hrow_assign2]() { - nothrow_assign1 = std::move(nothrow_assign2); - }); - UnsetCountdown(); -} - -TEST(ThrowingValueTest, ThrowingCopyCtor) { - ThrowingValue<> tv; - - TestOp([&]() { ThrowingValue<> tv_copy(tv); }); -} - -TEST(ThrowingValueTest, ThrowingCopyAssign) { - ThrowingValue<> tv1, tv2; - - TestOp([&]() { tv1 = tv2; }); -} - -TEST(ThrowingValueTest, NonThrowingCopyCtor) { - ThrowingValue nothrow_ctor; - - SetCountdown(); - ExpectNoThrow([¬hrow_ctor]() { - ThrowingValue nothrow1(nothrow_ctor); - }); - UnsetCountdown(); -} - -TEST(ThrowingValueTest, NonThrowingCopyAssign) { - ThrowingValue nothrow_assign1, nothrow_assign2; - - SetCountdown(); - ExpectNoThrow([¬hrow_assign1, ¬hrow_assign2]() { - nothrow_assign1 = nothrow_assign2; - }); - UnsetCountdown(); -} - -TEST(ThrowingValueTest, ThrowingSwap) { - ThrowingValue<> bomb1, bomb2; - TestOp([&]() { std::swap(bomb1, bomb2); }); -} - -TEST(ThrowingValueTest, NonThrowingSwap) { - ThrowingValue bomb1, bomb2; - ExpectNoThrow([&]() { std::swap(bomb1, bomb2); }); -} - -TEST(ThrowingValueTest, NonThrowingAllocation) { - ThrowingValue* allocated; - ThrowingValue* array; - - ExpectNoThrow([&allocated]() { - allocated = new ThrowingValue(1); - delete allocated; - }); - ExpectNoThrow([&array]() { - array = new ThrowingValue[2]; - delete[] array; - }); -} - -TEST(ThrowingValueTest, NonThrowingDelete) { - auto* allocated = new ThrowingValue<>(1); - auto* array = new ThrowingValue<>[2]; - - SetCountdown(); - ExpectNoThrow([allocated]() { delete allocated; }); - SetCountdown(); - ExpectNoThrow([array]() { delete[] array; }); - - UnsetCountdown(); -} - -using Storage = - absl::aligned_storage_t), alignof(ThrowingValue<>)>; - -TEST(ThrowingValueTest, NonThrowingPlacementDelete) { - constexpr int kArrayLen = 2; - // We intentionally create extra space to store the tag allocated by placement - // new[]. - constexpr int kStorageLen = 4; - - Storage buf; - Storage array_buf[kStorageLen]; - auto* placed = new (&buf) ThrowingValue<>(1); - auto placed_array = new (&array_buf) ThrowingValue<>[kArrayLen]; - - SetCountdown(); - ExpectNoThrow([placed, &buf]() { - placed->~ThrowingValue<>(); - ThrowingValue<>::operator delete(placed, &buf); - }); - - SetCountdown(); - ExpectNoThrow([&, placed_array]() { - for (int i = 0; i < kArrayLen; ++i) placed_array[i].~ThrowingValue<>(); - ThrowingValue<>::operator delete[](placed_array, &array_buf); - }); - - UnsetCountdown(); -} - -TEST(ThrowingValueTest, NonThrowingDestructor) { - auto* allocated = new ThrowingValue<>(); - - SetCountdown(); - ExpectNoThrow([allocated]() { delete allocated; }); - UnsetCountdown(); -} - -TEST(ThrowingBoolTest, ThrowingBool) { - ThrowingBool t = true; - - // Test that it's contextually convertible to bool - if (t) { // NOLINT(whitespace/empty_if_body) - } - EXPECT_TRUE(t); - - TestOp([&]() { (void)!t; }); -} - -TEST(ThrowingAllocatorTest, MemoryManagement) { - // Just exercise the memory management capabilities under LSan to make sure we - // don't leak. - ThrowingAllocator int_alloc; - int* ip = int_alloc.allocate(1); - int_alloc.deallocate(ip, 1); - int* i_array = int_alloc.allocate(2); - int_alloc.deallocate(i_array, 2); - - ThrowingAllocator> tv_alloc; - ThrowingValue<>* ptr = tv_alloc.allocate(1); - tv_alloc.deallocate(ptr, 1); - ThrowingValue<>* tv_array = tv_alloc.allocate(2); - tv_alloc.deallocate(tv_array, 2); -} - -TEST(ThrowingAllocatorTest, CallsGlobalNew) { - ThrowingAllocator, AllocSpec::kNoThrowAllocate> nothrow_alloc; - ThrowingValue<>* ptr; - - SetCountdown(); - // This will only throw if ThrowingValue::new is called. - ExpectNoThrow([&]() { ptr = nothrow_alloc.allocate(1); }); - nothrow_alloc.deallocate(ptr, 1); - - UnsetCountdown(); -} - -TEST(ThrowingAllocatorTest, ThrowingConstructors) { - ThrowingAllocator int_alloc; - int* ip = nullptr; - - SetCountdown(); - EXPECT_THROW(ip = int_alloc.allocate(1), TestException); - ExpectNoThrow([&]() { ip = int_alloc.allocate(1); }); - - *ip = 1; - SetCountdown(); - EXPECT_THROW(int_alloc.construct(ip, 2), TestException); - EXPECT_EQ(*ip, 1); - int_alloc.deallocate(ip, 1); - - UnsetCountdown(); -} - -TEST(ThrowingAllocatorTest, NonThrowingConstruction) { - { - ThrowingAllocator int_alloc; - int* ip = nullptr; - - SetCountdown(); - ExpectNoThrow([&]() { ip = int_alloc.allocate(1); }); - - SetCountdown(); - ExpectNoThrow([&]() { int_alloc.construct(ip, 2); }); - - EXPECT_EQ(*ip, 2); - int_alloc.deallocate(ip, 1); - - UnsetCountdown(); - } - - { - ThrowingAllocator int_alloc; - int* ip = nullptr; - ExpectNoThrow([&]() { ip = int_alloc.allocate(1); }); - ExpectNoThrow([&]() { int_alloc.construct(ip, 2); }); - EXPECT_EQ(*ip, 2); - int_alloc.deallocate(ip, 1); - } - - { - ThrowingAllocator, AllocSpec::kNoThrowAllocate> - nothrow_alloc; - ThrowingValue<>* ptr; - - SetCountdown(); - ExpectNoThrow([&]() { ptr = nothrow_alloc.allocate(1); }); - - SetCountdown(); - ExpectNoThrow( - [&]() { nothrow_alloc.construct(ptr, 2, testing::nothrow_ctor); }); - - EXPECT_EQ(ptr->Get(), 2); - nothrow_alloc.destroy(ptr); - nothrow_alloc.deallocate(ptr, 1); - - UnsetCountdown(); - } - - { - ThrowingAllocator a; - - SetCountdown(); - ExpectNoThrow([&]() { ThrowingAllocator a1 = a; }); - - SetCountdown(); - ExpectNoThrow([&]() { ThrowingAllocator a1 = std::move(a); }); - - UnsetCountdown(); - } -} - -TEST(ThrowingAllocatorTest, ThrowingAllocatorConstruction) { - ThrowingAllocator a; - TestOp([]() { ThrowingAllocator a; }); - TestOp([&]() { a.select_on_container_copy_construction(); }); -} - -TEST(ThrowingAllocatorTest, State) { - ThrowingAllocator a1, a2; - EXPECT_NE(a1, a2); - - auto a3 = a1; - EXPECT_EQ(a3, a1); - int* ip = a1.allocate(1); - EXPECT_EQ(a3, a1); - a3.deallocate(ip, 1); - EXPECT_EQ(a3, a1); -} - -TEST(ThrowingAllocatorTest, InVector) { - std::vector, ThrowingAllocator>> v; - for (int i = 0; i < 20; ++i) v.push_back({}); - for (int i = 0; i < 20; ++i) v.pop_back(); -} - -TEST(ThrowingAllocatorTest, InList) { - std::list, ThrowingAllocator>> l; - for (int i = 0; i < 20; ++i) l.push_back({}); - for (int i = 0; i < 20; ++i) l.pop_back(); - for (int i = 0; i < 20; ++i) l.push_front({}); - for (int i = 0; i < 20; ++i) l.pop_front(); -} - -template -struct NullaryTestValidator : public std::false_type {}; - -template -struct NullaryTestValidator< - TesterInstance, - absl::void_t().Test())>> - : public std::true_type {}; - -template -bool HasNullaryTest(const TesterInstance&) { - return NullaryTestValidator::value; -} - -void DummyOp(void*) {} - -template -struct UnaryTestValidator : public std::false_type {}; - -template -struct UnaryTestValidator< - TesterInstance, - absl::void_t().Test(DummyOp))>> - : public std::true_type {}; - -template -bool HasUnaryTest(const TesterInstance&) { - return UnaryTestValidator::value; -} - -TEST(ExceptionSafetyTesterTest, IncompleteTypesAreNotTestable) { - using T = exceptions_internal::UninitializedT; - auto op = [](T* t) {}; - auto inv = [](T*) { return testing::AssertionSuccess(); }; - auto fac = []() { return absl::make_unique(); }; - - // Test that providing operation and inveriants still does not allow for the - // the invocation of .Test() and .Test(op) because it lacks a factory - auto without_fac = - testing::MakeExceptionSafetyTester().WithOperation(op).WithContracts( - inv, testing::strong_guarantee); - EXPECT_FALSE(HasNullaryTest(without_fac)); - EXPECT_FALSE(HasUnaryTest(without_fac)); - - // Test that providing contracts and factory allows the invocation of - // .Test(op) but does not allow for .Test() because it lacks an operation - auto without_op = testing::MakeExceptionSafetyTester() - .WithContracts(inv, testing::strong_guarantee) - .WithFactory(fac); - EXPECT_FALSE(HasNullaryTest(without_op)); - EXPECT_TRUE(HasUnaryTest(without_op)); - - // Test that providing operation and factory still does not allow for the - // the invocation of .Test() and .Test(op) because it lacks contracts - auto without_inv = - testing::MakeExceptionSafetyTester().WithOperation(op).WithFactory(fac); - EXPECT_FALSE(HasNullaryTest(without_inv)); - EXPECT_FALSE(HasUnaryTest(without_inv)); -} - -struct ExampleStruct {}; - -std::unique_ptr ExampleFunctionFactory() { - return absl::make_unique(); -} - -void ExampleFunctionOperation(ExampleStruct*) {} - -testing::AssertionResult ExampleFunctionContract(ExampleStruct*) { - return testing::AssertionSuccess(); -} - -struct { - std::unique_ptr operator()() const { - return ExampleFunctionFactory(); - } -} example_struct_factory; - -struct { - void operator()(ExampleStruct*) const {} -} example_struct_operation; - -struct { - testing::AssertionResult operator()(ExampleStruct* example_struct) const { - return ExampleFunctionContract(example_struct); - } -} example_struct_contract; - -auto example_lambda_factory = []() { return ExampleFunctionFactory(); }; - -auto example_lambda_operation = [](ExampleStruct*) {}; - -auto example_lambda_contract = [](ExampleStruct* example_struct) { - return ExampleFunctionContract(example_struct); -}; - -// Testing that function references, pointers, structs with operator() and -// lambdas can all be used with ExceptionSafetyTester -TEST(ExceptionSafetyTesterTest, MixedFunctionTypes) { - // function reference - EXPECT_TRUE(testing::MakeExceptionSafetyTester() - .WithFactory(ExampleFunctionFactory) - .WithOperation(ExampleFunctionOperation) - .WithContracts(ExampleFunctionContract) - .Test()); - - // function pointer - EXPECT_TRUE(testing::MakeExceptionSafetyTester() - .WithFactory(&ExampleFunctionFactory) - .WithOperation(&ExampleFunctionOperation) - .WithContracts(&ExampleFunctionContract) - .Test()); - - // struct - EXPECT_TRUE(testing::MakeExceptionSafetyTester() - .WithFactory(example_struct_factory) - .WithOperation(example_struct_operation) - .WithContracts(example_struct_contract) - .Test()); - - // lambda - EXPECT_TRUE(testing::MakeExceptionSafetyTester() - .WithFactory(example_lambda_factory) - .WithOperation(example_lambda_operation) - .WithContracts(example_lambda_contract) - .Test()); -} - -struct NonNegative { - bool operator==(const NonNegative& other) const { return i == other.i; } - int i; -}; - -testing::AssertionResult CheckNonNegativeInvariants(NonNegative* g) { - if (g->i >= 0) { - return testing::AssertionSuccess(); - } - return testing::AssertionFailure() - << "i should be non-negative but is " << g->i; -} - -struct { - template - void operator()(T* t) const { - (*t)(); - } -} invoker; - -auto tester = - testing::MakeExceptionSafetyTester().WithOperation(invoker).WithContracts( - CheckNonNegativeInvariants); -auto strong_tester = tester.WithContracts(testing::strong_guarantee); - -struct FailsBasicGuarantee : public NonNegative { - void operator()() { - --i; - ThrowingValue<> bomb; - ++i; - } -}; - -TEST(ExceptionCheckTest, BasicGuaranteeFailure) { - EXPECT_FALSE(tester.WithInitialValue(FailsBasicGuarantee{}).Test()); -} - -struct FollowsBasicGuarantee : public NonNegative { - void operator()() { - ++i; - ThrowingValue<> bomb; - } -}; - -TEST(ExceptionCheckTest, BasicGuarantee) { - EXPECT_TRUE(tester.WithInitialValue(FollowsBasicGuarantee{}).Test()); -} - -TEST(ExceptionCheckTest, StrongGuaranteeFailure) { - EXPECT_FALSE(strong_tester.WithInitialValue(FailsBasicGuarantee{}).Test()); - EXPECT_FALSE(strong_tester.WithInitialValue(FollowsBasicGuarantee{}).Test()); -} - -struct BasicGuaranteeWithExtraContracts : public NonNegative { - // After operator(), i is incremented. If operator() throws, i is set to 9999 - void operator()() { - int old_i = i; - i = kExceptionSentinel; - ThrowingValue<> bomb; - i = ++old_i; - } - - static constexpr int kExceptionSentinel = 9999; -}; -constexpr int BasicGuaranteeWithExtraContracts::kExceptionSentinel; - -TEST(ExceptionCheckTest, BasicGuaranteeWithExtraContracts) { - auto tester_with_val = - tester.WithInitialValue(BasicGuaranteeWithExtraContracts{}); - EXPECT_TRUE(tester_with_val.Test()); - EXPECT_TRUE( - tester_with_val - .WithContracts([](BasicGuaranteeWithExtraContracts* o) { - if (o->i == BasicGuaranteeWithExtraContracts::kExceptionSentinel) { - return testing::AssertionSuccess(); - } - return testing::AssertionFailure() - << "i should be " - << BasicGuaranteeWithExtraContracts::kExceptionSentinel - << ", but is " << o->i; - }) - .Test()); -} - -struct FollowsStrongGuarantee : public NonNegative { - void operator()() { ThrowingValue<> bomb; } -}; - -TEST(ExceptionCheckTest, StrongGuarantee) { - EXPECT_TRUE(tester.WithInitialValue(FollowsStrongGuarantee{}).Test()); - EXPECT_TRUE(strong_tester.WithInitialValue(FollowsStrongGuarantee{}).Test()); -} - -struct HasReset : public NonNegative { - void operator()() { - i = -1; - ThrowingValue<> bomb; - i = 1; - } - - void reset() { i = 0; } -}; - -testing::AssertionResult CheckHasResetContracts(HasReset* h) { - h->reset(); - return testing::AssertionResult(h->i == 0); -} - -TEST(ExceptionCheckTest, ModifyingChecker) { - auto set_to_1000 = [](FollowsBasicGuarantee* g) { - g->i = 1000; - return testing::AssertionSuccess(); - }; - auto is_1000 = [](FollowsBasicGuarantee* g) { - return testing::AssertionResult(g->i == 1000); - }; - auto increment = [](FollowsStrongGuarantee* g) { - ++g->i; - return testing::AssertionSuccess(); - }; - - EXPECT_FALSE(tester.WithInitialValue(FollowsBasicGuarantee{}) - .WithContracts(set_to_1000, is_1000) - .Test()); - EXPECT_TRUE(strong_tester.WithInitialValue(FollowsStrongGuarantee{}) - .WithContracts(increment) - .Test()); - EXPECT_TRUE(testing::MakeExceptionSafetyTester() - .WithInitialValue(HasReset{}) - .WithContracts(CheckHasResetContracts) - .Test(invoker)); -} - -TEST(ExceptionSafetyTesterTest, ResetsCountdown) { - auto test = - testing::MakeExceptionSafetyTester() - .WithInitialValue(ThrowingValue<>()) - .WithContracts([](ThrowingValue<>*) { return AssertionSuccess(); }) - .WithOperation([](ThrowingValue<>*) {}); - ASSERT_TRUE(test.Test()); - // If the countdown isn't reset because there were no exceptions thrown, then - // this will fail with a termination from an unhandled exception - EXPECT_TRUE(test.Test()); -} - -struct NonCopyable : public NonNegative { - NonCopyable(const NonCopyable&) = delete; - NonCopyable() : NonNegative{0} {} - - void operator()() { ThrowingValue<> bomb; } -}; - -TEST(ExceptionCheckTest, NonCopyable) { - auto factory = []() { return absl::make_unique(); }; - EXPECT_TRUE(tester.WithFactory(factory).Test()); - EXPECT_TRUE(strong_tester.WithFactory(factory).Test()); -} - -struct NonEqualityComparable : public NonNegative { - void operator()() { ThrowingValue<> bomb; } - - void ModifyOnThrow() { - ++i; - ThrowingValue<> bomb; - static_cast(bomb); - --i; - } -}; - -TEST(ExceptionCheckTest, NonEqualityComparable) { - auto nec_is_strong = [](NonEqualityComparable* nec) { - return testing::AssertionResult(nec->i == NonEqualityComparable().i); - }; - auto strong_nec_tester = tester.WithInitialValue(NonEqualityComparable{}) - .WithContracts(nec_is_strong); - - EXPECT_TRUE(strong_nec_tester.Test()); - EXPECT_FALSE(strong_nec_tester.Test( - [](NonEqualityComparable* n) { n->ModifyOnThrow(); })); -} - -template -struct ExhaustivenessTester { - void operator()() { - successes |= 1; - T b1; - static_cast(b1); - successes |= (1 << 1); - T b2; - static_cast(b2); - successes |= (1 << 2); - T b3; - static_cast(b3); - successes |= (1 << 3); - } - - bool operator==(const ExhaustivenessTester>&) const { - return true; - } - - static unsigned char successes; -}; - -struct { - template - testing::AssertionResult operator()(ExhaustivenessTester*) const { - return testing::AssertionSuccess(); - } -} CheckExhaustivenessTesterContracts; - -template -unsigned char ExhaustivenessTester::successes = 0; - -TEST(ExceptionCheckTest, Exhaustiveness) { - auto exhaust_tester = testing::MakeExceptionSafetyTester() - .WithContracts(CheckExhaustivenessTesterContracts) - .WithOperation(invoker); - - EXPECT_TRUE( - exhaust_tester.WithInitialValue(ExhaustivenessTester{}).Test()); - EXPECT_EQ(ExhaustivenessTester::successes, 0xF); - - EXPECT_TRUE( - exhaust_tester.WithInitialValue(ExhaustivenessTester>{}) - .WithContracts(testing::strong_guarantee) - .Test()); - EXPECT_EQ(ExhaustivenessTester>::successes, 0xF); -} - -struct LeaksIfCtorThrows : private exceptions_internal::TrackedObject { - LeaksIfCtorThrows() : TrackedObject(ABSL_PRETTY_FUNCTION) { - ++counter; - ThrowingValue<> v; - static_cast(v); - --counter; - } - LeaksIfCtorThrows(const LeaksIfCtorThrows&) noexcept - : TrackedObject(ABSL_PRETTY_FUNCTION) {} - static int counter; -}; -int LeaksIfCtorThrows::counter = 0; - -TEST(ExceptionCheckTest, TestLeakyCtor) { - testing::TestThrowingCtor(); - EXPECT_EQ(LeaksIfCtorThrows::counter, 1); - LeaksIfCtorThrows::counter = 0; -} - -struct Tracked : private exceptions_internal::TrackedObject { - Tracked() : TrackedObject(ABSL_PRETTY_FUNCTION) {} -}; - -TEST(ConstructorTrackerTest, CreatedBefore) { - Tracked a, b, c; - exceptions_internal::ConstructorTracker ct(exceptions_internal::countdown); -} - -TEST(ConstructorTrackerTest, CreatedAfter) { - exceptions_internal::ConstructorTracker ct(exceptions_internal::countdown); - Tracked a, b, c; -} - -TEST(ConstructorTrackerTest, NotDestroyedAfter) { - absl::aligned_storage_t storage; - EXPECT_NONFATAL_FAILURE( - { - exceptions_internal::ConstructorTracker ct( - exceptions_internal::countdown); - new (&storage) Tracked; - }, - "not destroyed"); -} - -TEST(ConstructorTrackerTest, DestroyedTwice) { - exceptions_internal::ConstructorTracker ct(exceptions_internal::countdown); - EXPECT_NONFATAL_FAILURE( - { - Tracked t; - t.~Tracked(); - }, - "re-destroyed"); -} - -TEST(ConstructorTrackerTest, ConstructedTwice) { - exceptions_internal::ConstructorTracker ct(exceptions_internal::countdown); - absl::aligned_storage_t storage; - EXPECT_NONFATAL_FAILURE( - { - new (&storage) Tracked; - new (&storage) Tracked; - reinterpret_cast(&storage)->~Tracked(); - }, - "re-constructed"); -} - -TEST(ThrowingValueTraitsTest, RelationalOperators) { - ThrowingValue<> a, b; - EXPECT_TRUE((std::is_convertible::value)); - EXPECT_TRUE((std::is_convertible::value)); - EXPECT_TRUE((std::is_convertible::value)); - EXPECT_TRUE((std::is_convertible::value)); - EXPECT_TRUE((std::is_convertible b), bool>::value)); - EXPECT_TRUE((std::is_convertible= b), bool>::value)); -} - -TEST(ThrowingAllocatorTraitsTest, Assignablility) { - EXPECT_TRUE(absl::is_move_assignable>::value); - EXPECT_TRUE(absl::is_copy_assignable>::value); - EXPECT_TRUE(std::is_nothrow_move_assignable>::value); - EXPECT_TRUE(std::is_nothrow_copy_assignable>::value); -} - -} // namespace - -} // namespace testing diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test.cc deleted file mode 100644 index 471f70633..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test.cc +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "absl/base/internal/inline_variable.h" -#include "absl/base/internal/inline_variable_testing.h" - -#include "gtest/gtest.h" - -namespace absl { -namespace inline_variable_testing_internal { -namespace { - -TEST(InlineVariableTest, Constexpr) { - static_assert(inline_variable_foo.value == 5, ""); - static_assert(other_inline_variable_foo.value == 5, ""); - static_assert(inline_variable_int == 5, ""); - static_assert(other_inline_variable_int == 5, ""); -} - -TEST(InlineVariableTest, DefaultConstructedIdentityEquality) { - EXPECT_EQ(get_foo_a().value, 5); - EXPECT_EQ(get_foo_b().value, 5); - EXPECT_EQ(&get_foo_a(), &get_foo_b()); -} - -TEST(InlineVariableTest, DefaultConstructedIdentityInequality) { - EXPECT_NE(&inline_variable_foo, &other_inline_variable_foo); -} - -TEST(InlineVariableTest, InitializedIdentityEquality) { - EXPECT_EQ(get_int_a(), 5); - EXPECT_EQ(get_int_b(), 5); - EXPECT_EQ(&get_int_a(), &get_int_b()); -} - -TEST(InlineVariableTest, InitializedIdentityInequality) { - EXPECT_NE(&inline_variable_int, &other_inline_variable_int); -} - -TEST(InlineVariableTest, FunPtrType) { - static_assert( - std::is_same::type>::value, - ""); -} - -} // namespace -} // namespace inline_variable_testing_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test_a.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test_a.cc deleted file mode 100644 index d0b8e7d39..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test_a.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/inline_variable_testing.h" - -namespace absl { -namespace inline_variable_testing_internal { - -const Foo& get_foo_a() { return inline_variable_foo; } - -const int& get_int_a() { return inline_variable_int; } - -} // namespace inline_variable_testing_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test_b.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test_b.cc deleted file mode 100644 index 931d56d05..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/inline_variable_test_b.cc +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/inline_variable_testing.h" - -namespace absl { -namespace inline_variable_testing_internal { - -const Foo& get_foo_b() { return inline_variable_foo; } - -const int& get_int_b() { return inline_variable_int; } - -} // namespace inline_variable_testing_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/atomic_hook.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/atomic_hook.h deleted file mode 100644 index 803e90597..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/atomic_hook.h +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#ifndef ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ -#define ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ - -#include -#include -#include -#include - -#ifdef _MSC_FULL_VER -#define ABSL_HAVE_WORKING_ATOMIC_POINTER 0 -#else -#define ABSL_HAVE_WORKING_ATOMIC_POINTER 1 -#endif - -namespace absl { -namespace base_internal { - -template -class AtomicHook; - -// AtomicHook is a helper class, templatized on a raw function pointer type, for -// implementing Abseil customization hooks. It is a callable object that -// dispatches to the registered hook. -// -// A default constructed object performs a no-op (and returns a default -// constructed object) if no hook has been registered. -// -// Hooks can be pre-registered via constant initialization, for example, -// ABSL_CONST_INIT static AtomicHook my_hook(DefaultAction); -// and then changed at runtime via a call to Store(). -// -// Reads and writes guarantee memory_order_acquire/memory_order_release -// semantics. -template -class AtomicHook { - public: - using FnPtr = ReturnType (*)(Args...); - - // Constructs an object that by default performs a no-op (and - // returns a default constructed object) when no hook as been registered. - constexpr AtomicHook() : AtomicHook(DummyFunction) {} - - // Constructs an object that by default dispatches to/returns the - // pre-registered default_fn when no hook has been registered at runtime. -#if ABSL_HAVE_WORKING_ATOMIC_POINTER - explicit constexpr AtomicHook(FnPtr default_fn) - : hook_(default_fn), default_fn_(default_fn) {} -#else - explicit constexpr AtomicHook(FnPtr default_fn) - : hook_(kUninitialized), default_fn_(default_fn) {} -#endif - - // Stores the provided function pointer as the value for this hook. - // - // This is intended to be called once. Multiple calls are legal only if the - // same function pointer is provided for each call. The store is implemented - // as a memory_order_release operation, and read accesses are implemented as - // memory_order_acquire. - void Store(FnPtr fn) { - bool success = DoStore(fn); - static_cast(success); - assert(success); - } - - // Invokes the registered callback. If no callback has yet been registered, a - // default-constructed object of the appropriate type is returned instead. - template - ReturnType operator()(CallArgs&&... args) const { - return DoLoad()(std::forward(args)...); - } - - // Returns the registered callback, or nullptr if none has been registered. - // Useful if client code needs to conditionalize behavior based on whether a - // callback was registered. - // - // Note that atomic_hook.Load()() and atomic_hook() have different semantics: - // operator()() will perform a no-op if no callback was registered, while - // Load()() will dereference a null function pointer. Prefer operator()() to - // Load()() unless you must conditionalize behavior on whether a hook was - // registered. - FnPtr Load() const { - FnPtr ptr = DoLoad(); - return (ptr == DummyFunction) ? nullptr : ptr; - } - - private: - static ReturnType DummyFunction(Args...) { - return ReturnType(); - } - - // Current versions of MSVC (as of September 2017) have a broken - // implementation of std::atomic: Its constructor attempts to do the - // equivalent of a reinterpret_cast in a constexpr context, which is not - // allowed. - // - // This causes an issue when building with LLVM under Windows. To avoid this, - // we use a less-efficient, intptr_t-based implementation on Windows. -#if ABSL_HAVE_WORKING_ATOMIC_POINTER - // Return the stored value, or DummyFunction if no value has been stored. - FnPtr DoLoad() const { return hook_.load(std::memory_order_acquire); } - - // Store the given value. Returns false if a different value was already - // stored to this object. - bool DoStore(FnPtr fn) { - assert(fn); - FnPtr expected = default_fn_; - const bool store_succeeded = hook_.compare_exchange_strong( - expected, fn, std::memory_order_acq_rel, std::memory_order_acquire); - const bool same_value_already_stored = (expected == fn); - return store_succeeded || same_value_already_stored; - } - - std::atomic hook_; -#else // !ABSL_HAVE_WORKING_ATOMIC_POINTER - // Use a sentinel value unlikely to be the address of an actual function. - static constexpr intptr_t kUninitialized = 0; - - static_assert(sizeof(intptr_t) >= sizeof(FnPtr), - "intptr_t can't contain a function pointer"); - - FnPtr DoLoad() const { - const intptr_t value = hook_.load(std::memory_order_acquire); - if (value == kUninitialized) { - return default_fn_; - } - return reinterpret_cast(value); - } - - bool DoStore(FnPtr fn) { - assert(fn); - const auto value = reinterpret_cast(fn); - intptr_t expected = kUninitialized; - const bool store_succeeded = hook_.compare_exchange_strong( - expected, value, std::memory_order_acq_rel, std::memory_order_acquire); - const bool same_value_already_stored = (expected == value); - return store_succeeded || same_value_already_stored; - } - - std::atomic hook_; -#endif - - const FnPtr default_fn_; -}; - -#undef ABSL_HAVE_WORKING_ATOMIC_POINTER - -} // namespace base_internal -} // namespace absl - -#endif // ABSL_BASE_INTERNAL_ATOMIC_HOOK_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/atomic_hook_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/atomic_hook_test.cc deleted file mode 100644 index ecc80406b..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/atomic_hook_test.cc +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/atomic_hook.h" - -#include "gtest/gtest.h" -#include "absl/base/attributes.h" - -namespace { - -int value = 0; -void TestHook(int x) { value = x; } - -TEST(AtomicHookTest, NoDefaultFunction) { - ABSL_CONST_INIT static absl::base_internal::AtomicHook hook; - value = 0; - - // Test the default DummyFunction. - EXPECT_TRUE(hook.Load() == nullptr); - EXPECT_EQ(value, 0); - hook(1); - EXPECT_EQ(value, 0); - - // Test a stored hook. - hook.Store(TestHook); - EXPECT_TRUE(hook.Load() == TestHook); - EXPECT_EQ(value, 0); - hook(1); - EXPECT_EQ(value, 1); - - // Calling Store() with the same hook should not crash. - hook.Store(TestHook); - EXPECT_TRUE(hook.Load() == TestHook); - EXPECT_EQ(value, 1); - hook(2); - EXPECT_EQ(value, 2); -} - -TEST(AtomicHookTest, WithDefaultFunction) { - // Set the default value to TestHook at compile-time. - ABSL_CONST_INIT static absl::base_internal::AtomicHook hook( - TestHook); - value = 0; - - // Test the default value is TestHook. - EXPECT_TRUE(hook.Load() == TestHook); - EXPECT_EQ(value, 0); - hook(1); - EXPECT_EQ(value, 1); - - // Calling Store() with the same hook should not crash. - hook.Store(TestHook); - EXPECT_TRUE(hook.Load() == TestHook); - EXPECT_EQ(value, 1); - hook(2); - EXPECT_EQ(value, 2); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/bits.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/bits.h deleted file mode 100644 index b0780f2d1..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/bits.h +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_BASE_INTERNAL_BITS_H_ -#define ABSL_BASE_INTERNAL_BITS_H_ - -// This file contains bitwise ops which are implementation details of various -// absl libraries. - -#include - -// Clang on Windows has __builtin_clzll; otherwise we need to use the -// windows intrinsic functions. -#if defined(_MSC_VER) -#include -#if defined(_M_X64) -#pragma intrinsic(_BitScanReverse64) -#pragma intrinsic(_BitScanForward64) -#endif -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward) -#endif - -#include "absl/base/attributes.h" - -#if defined(_MSC_VER) -// We can achieve something similar to attribute((always_inline)) with MSVC by -// using the __forceinline keyword, however this is not perfect. MSVC is -// much less aggressive about inlining, and even with the __forceinline keyword. -#define ABSL_BASE_INTERNAL_FORCEINLINE __forceinline -#else -// Use default attribute inline. -#define ABSL_BASE_INTERNAL_FORCEINLINE inline ABSL_ATTRIBUTE_ALWAYS_INLINE -#endif - - -namespace absl { -namespace base_internal { - -ABSL_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64Slow(uint64_t n) { - int zeroes = 60; - if (n >> 32) zeroes -= 32, n >>= 32; - if (n >> 16) zeroes -= 16, n >>= 16; - if (n >> 8) zeroes -= 8, n >>= 8; - if (n >> 4) zeroes -= 4, n >>= 4; - return "\4\3\2\2\1\1\1\1\0\0\0\0\0\0\0"[n] + zeroes; -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros64(uint64_t n) { -#if defined(_MSC_VER) && defined(_M_X64) - // MSVC does not have __buitin_clzll. Use _BitScanReverse64. - unsigned long result = 0; // NOLINT(runtime/int) - if (_BitScanReverse64(&result, n)) { - return 63 - result; - } - return 64; -#elif defined(_MSC_VER) - // MSVC does not have __buitin_clzll. Compose two calls to _BitScanReverse - unsigned long result = 0; // NOLINT(runtime/int) - if ((n >> 32) && _BitScanReverse(&result, n >> 32)) { - return 31 - result; - } - if (_BitScanReverse(&result, n)) { - return 63 - result; - } - return 64; -#elif defined(__GNUC__) - // Use __builtin_clzll, which uses the following instructions: - // x86: bsr - // ARM64: clz - // PPC: cntlzd - static_assert(sizeof(unsigned long long) == sizeof(n), // NOLINT(runtime/int) - "__builtin_clzll does not take 64-bit arg"); - - // Handle 0 as a special case because __builtin_clzll(0) is undefined. - if (n == 0) { - return 64; - } - return __builtin_clzll(n); -#else - return CountLeadingZeros64Slow(n); -#endif -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros32Slow(uint64_t n) { - int zeroes = 28; - if (n >> 16) zeroes -= 16, n >>= 16; - if (n >> 8) zeroes -= 8, n >>= 8; - if (n >> 4) zeroes -= 4, n >>= 4; - return "\4\3\2\2\1\1\1\1\0\0\0\0\0\0\0"[n] + zeroes; -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountLeadingZeros32(uint32_t n) { -#if defined(_MSC_VER) - unsigned long result = 0; // NOLINT(runtime/int) - if (_BitScanReverse(&result, n)) { - return 31 - result; - } - return 32; -#elif defined(__GNUC__) - // Use __builtin_clz, which uses the following instructions: - // x86: bsr - // ARM64: clz - // PPC: cntlzd - static_assert(sizeof(int) == sizeof(n), - "__builtin_clz does not take 32-bit arg"); - - // Handle 0 as a special case because __builtin_clz(0) is undefined. - if (n == 0) { - return 32; - } - return __builtin_clz(n); -#else - return CountLeadingZeros32Slow(n); -#endif -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountTrailingZerosNonZero64Slow(uint64_t n) { - int c = 63; - n &= ~n + 1; - if (n & 0x00000000FFFFFFFF) c -= 32; - if (n & 0x0000FFFF0000FFFF) c -= 16; - if (n & 0x00FF00FF00FF00FF) c -= 8; - if (n & 0x0F0F0F0F0F0F0F0F) c -= 4; - if (n & 0x3333333333333333) c -= 2; - if (n & 0x5555555555555555) c -= 1; - return c; -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountTrailingZerosNonZero64(uint64_t n) { -#if defined(_MSC_VER) && defined(_M_X64) - unsigned long result = 0; // NOLINT(runtime/int) - _BitScanForward64(&result, n); - return result; -#elif defined(_MSC_VER) - unsigned long result = 0; // NOLINT(runtime/int) - if (static_cast(n) == 0) { - _BitScanForward(&result, n >> 32); - return result + 32; - } - _BitScanForward(&result, n); - return result; -#elif defined(__GNUC__) - static_assert(sizeof(unsigned long long) == sizeof(n), // NOLINT(runtime/int) - "__builtin_ctzll does not take 64-bit arg"); - return __builtin_ctzll(n); -#else - return CountTrailingZerosNonZero64Slow(n); -#endif -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountTrailingZerosNonZero32Slow(uint32_t n) { - int c = 31; - n &= ~n + 1; - if (n & 0x0000FFFF) c -= 16; - if (n & 0x00FF00FF) c -= 8; - if (n & 0x0F0F0F0F) c -= 4; - if (n & 0x33333333) c -= 2; - if (n & 0x55555555) c -= 1; - return c; -} - -ABSL_BASE_INTERNAL_FORCEINLINE int CountTrailingZerosNonZero32(uint32_t n) { -#if defined(_MSC_VER) - unsigned long result = 0; // NOLINT(runtime/int) - _BitScanForward(&result, n); - return result; -#elif defined(__GNUC__) - static_assert(sizeof(int) == sizeof(n), - "__builtin_ctz does not take 32-bit arg"); - return __builtin_ctz(n); -#else - return CountTrailingZerosNonZero32Slow(n); -#endif -} - -#undef ABSL_BASE_INTERNAL_FORCEINLINE - -} // namespace base_internal -} // namespace absl - -#endif // ABSL_BASE_INTERNAL_BITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/bits_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/bits_test.cc deleted file mode 100644 index 7855fa629..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/bits_test.cc +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/bits.h" - -#include "gtest/gtest.h" - -namespace { - -int CLZ64(uint64_t n) { - int fast = absl::base_internal::CountLeadingZeros64(n); - int slow = absl::base_internal::CountLeadingZeros64Slow(n); - EXPECT_EQ(fast, slow) << n; - return fast; -} - -TEST(BitsTest, CountLeadingZeros64) { - EXPECT_EQ(64, CLZ64(uint64_t{})); - EXPECT_EQ(0, CLZ64(~uint64_t{})); - - for (int index = 0; index < 64; index++) { - uint64_t x = static_cast(1) << index; - const auto cnt = 63 - index; - ASSERT_EQ(cnt, CLZ64(x)) << index; - ASSERT_EQ(cnt, CLZ64(x + x - 1)) << index; - } -} - -int CLZ32(uint32_t n) { - int fast = absl::base_internal::CountLeadingZeros32(n); - int slow = absl::base_internal::CountLeadingZeros32Slow(n); - EXPECT_EQ(fast, slow) << n; - return fast; -} - -TEST(BitsTest, CountLeadingZeros32) { - EXPECT_EQ(32, CLZ32(uint32_t{})); - EXPECT_EQ(0, CLZ32(~uint32_t{})); - - for (int index = 0; index < 32; index++) { - uint32_t x = static_cast(1) << index; - const auto cnt = 31 - index; - ASSERT_EQ(cnt, CLZ32(x)) << index; - ASSERT_EQ(cnt, CLZ32(x + x - 1)) << index; - ASSERT_EQ(CLZ64(x), CLZ32(x) + 32); - } -} - -int CTZ64(uint64_t n) { - int fast = absl::base_internal::CountTrailingZerosNonZero64(n); - int slow = absl::base_internal::CountTrailingZerosNonZero64Slow(n); - EXPECT_EQ(fast, slow) << n; - return fast; -} - -TEST(BitsTest, CountTrailingZerosNonZero64) { - EXPECT_EQ(0, CTZ64(~uint64_t{})); - - for (int index = 0; index < 64; index++) { - uint64_t x = static_cast(1) << index; - const auto cnt = index; - ASSERT_EQ(cnt, CTZ64(x)) << index; - ASSERT_EQ(cnt, CTZ64(~(x - 1))) << index; - } -} - -int CTZ32(uint32_t n) { - int fast = absl::base_internal::CountTrailingZerosNonZero32(n); - int slow = absl::base_internal::CountTrailingZerosNonZero32Slow(n); - EXPECT_EQ(fast, slow) << n; - return fast; -} - -TEST(BitsTest, CountTrailingZerosNonZero32) { - EXPECT_EQ(0, CTZ32(~uint32_t{})); - - for (int index = 0; index < 32; index++) { - uint32_t x = static_cast(1) << index; - const auto cnt = index; - ASSERT_EQ(cnt, CTZ32(x)) << index; - ASSERT_EQ(cnt, CTZ32(~(x - 1))) << index; - } -} - - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/cmake_thread_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/cmake_thread_test.cc deleted file mode 100644 index f70bb24eb..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/cmake_thread_test.cc +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include -#include "absl/base/internal/thread_identity.h" - -int main() { - auto* tid = absl::base_internal::CurrentThreadIdentityIfPresent(); - // Make sure the above call can't be optimized out - std::cout << (void*)tid << std::endl; -} diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/endian_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/endian_test.cc deleted file mode 100644 index 98a099e43..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/endian_test.cc +++ /dev/null @@ -1,263 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/endian.h" - -#include -#include -#include -#include -#include - -#include "gtest/gtest.h" -#include "absl/base/config.h" - -namespace absl { -namespace { - -const uint64_t kInitialNumber{0x0123456789abcdef}; -const uint64_t k64Value{kInitialNumber}; -const uint32_t k32Value{0x01234567}; -const uint16_t k16Value{0x0123}; -const int kNumValuesToTest = 1000000; -const int kRandomSeed = 12345; - -#if defined(ABSL_IS_BIG_ENDIAN) -const uint64_t kInitialInNetworkOrder{kInitialNumber}; -const uint64_t k64ValueLE{0xefcdab8967452301}; -const uint32_t k32ValueLE{0x67452301}; -const uint16_t k16ValueLE{0x2301}; - -const uint64_t k64ValueBE{kInitialNumber}; -const uint32_t k32ValueBE{k32Value}; -const uint16_t k16ValueBE{k16Value}; -#elif defined(ABSL_IS_LITTLE_ENDIAN) -const uint64_t kInitialInNetworkOrder{0xefcdab8967452301}; -const uint64_t k64ValueLE{kInitialNumber}; -const uint32_t k32ValueLE{k32Value}; -const uint16_t k16ValueLE{k16Value}; - -const uint64_t k64ValueBE{0xefcdab8967452301}; -const uint32_t k32ValueBE{0x67452301}; -const uint16_t k16ValueBE{0x2301}; -#endif - -template -std::vector GenerateAllValuesForType() { - std::vector result; - T next = std::numeric_limits::min(); - while (true) { - result.push_back(next); - if (next == std::numeric_limits::max()) { - return result; - } - ++next; - } -} - -template -std::vector GenerateRandomIntegers(size_t numValuesToTest) { - std::vector result; - std::mt19937_64 rng(kRandomSeed); - for (size_t i = 0; i < numValuesToTest; ++i) { - result.push_back(rng()); - } - return result; -} - -void ManualByteSwap(char* bytes, int length) { - if (length == 1) - return; - - EXPECT_EQ(0, length % 2); - for (int i = 0; i < length / 2; ++i) { - int j = (length - 1) - i; - using std::swap; - swap(bytes[i], bytes[j]); - } -} - -template -inline T UnalignedLoad(const char* p) { - static_assert( - sizeof(T) == 1 || sizeof(T) == 2 || sizeof(T) == 4 || sizeof(T) == 8, - "Unexpected type size"); - - switch (sizeof(T)) { - case 1: return *reinterpret_cast(p); - case 2: - return ABSL_INTERNAL_UNALIGNED_LOAD16(p); - case 4: - return ABSL_INTERNAL_UNALIGNED_LOAD32(p); - case 8: - return ABSL_INTERNAL_UNALIGNED_LOAD64(p); - default: - // Suppresses invalid "not all control paths return a value" on MSVC - return {}; - } -} - -template -static void GBSwapHelper(const std::vector& host_values_to_test, - const ByteSwapper& byte_swapper) { - // Test byte_swapper against a manual byte swap. - for (typename std::vector::const_iterator it = host_values_to_test.begin(); - it != host_values_to_test.end(); ++it) { - T host_value = *it; - - char actual_value[sizeof(host_value)]; - memcpy(actual_value, &host_value, sizeof(host_value)); - byte_swapper(actual_value); - - char expected_value[sizeof(host_value)]; - memcpy(expected_value, &host_value, sizeof(host_value)); - ManualByteSwap(expected_value, sizeof(host_value)); - - ASSERT_EQ(0, memcmp(actual_value, expected_value, sizeof(host_value))) - << "Swap output for 0x" << std::hex << host_value << " does not match. " - << "Expected: 0x" << UnalignedLoad(expected_value) << "; " - << "actual: 0x" << UnalignedLoad(actual_value); - } -} - -void Swap16(char* bytes) { - ABSL_INTERNAL_UNALIGNED_STORE16( - bytes, gbswap_16(ABSL_INTERNAL_UNALIGNED_LOAD16(bytes))); -} - -void Swap32(char* bytes) { - ABSL_INTERNAL_UNALIGNED_STORE32( - bytes, gbswap_32(ABSL_INTERNAL_UNALIGNED_LOAD32(bytes))); -} - -void Swap64(char* bytes) { - ABSL_INTERNAL_UNALIGNED_STORE64( - bytes, gbswap_64(ABSL_INTERNAL_UNALIGNED_LOAD64(bytes))); -} - -TEST(EndianessTest, Uint16) { - GBSwapHelper(GenerateAllValuesForType(), &Swap16); -} - -TEST(EndianessTest, Uint32) { - GBSwapHelper(GenerateRandomIntegers(kNumValuesToTest), &Swap32); -} - -TEST(EndianessTest, Uint64) { - GBSwapHelper(GenerateRandomIntegers(kNumValuesToTest), &Swap64); -} - -TEST(EndianessTest, ghtonll_gntohll) { - // Test that absl::ghtonl compiles correctly - uint32_t test = 0x01234567; - EXPECT_EQ(absl::gntohl(absl::ghtonl(test)), test); - - uint64_t comp = absl::ghtonll(kInitialNumber); - EXPECT_EQ(comp, kInitialInNetworkOrder); - comp = absl::gntohll(kInitialInNetworkOrder); - EXPECT_EQ(comp, kInitialNumber); - - // Test that htonll and ntohll are each others' inverse functions on a - // somewhat assorted batch of numbers. 37 is chosen to not be anything - // particularly nice base 2. - uint64_t value = 1; - for (int i = 0; i < 100; ++i) { - comp = absl::ghtonll(absl::gntohll(value)); - EXPECT_EQ(value, comp); - comp = absl::gntohll(absl::ghtonll(value)); - EXPECT_EQ(value, comp); - value *= 37; - } -} - -TEST(EndianessTest, little_endian) { - // Check little_endian uint16_t. - uint64_t comp = little_endian::FromHost16(k16Value); - EXPECT_EQ(comp, k16ValueLE); - comp = little_endian::ToHost16(k16ValueLE); - EXPECT_EQ(comp, k16Value); - - // Check little_endian uint32_t. - comp = little_endian::FromHost32(k32Value); - EXPECT_EQ(comp, k32ValueLE); - comp = little_endian::ToHost32(k32ValueLE); - EXPECT_EQ(comp, k32Value); - - // Check little_endian uint64_t. - comp = little_endian::FromHost64(k64Value); - EXPECT_EQ(comp, k64ValueLE); - comp = little_endian::ToHost64(k64ValueLE); - EXPECT_EQ(comp, k64Value); - - // Check little-endian Load and store functions. - uint16_t u16Buf; - uint32_t u32Buf; - uint64_t u64Buf; - - little_endian::Store16(&u16Buf, k16Value); - EXPECT_EQ(u16Buf, k16ValueLE); - comp = little_endian::Load16(&u16Buf); - EXPECT_EQ(comp, k16Value); - - little_endian::Store32(&u32Buf, k32Value); - EXPECT_EQ(u32Buf, k32ValueLE); - comp = little_endian::Load32(&u32Buf); - EXPECT_EQ(comp, k32Value); - - little_endian::Store64(&u64Buf, k64Value); - EXPECT_EQ(u64Buf, k64ValueLE); - comp = little_endian::Load64(&u64Buf); - EXPECT_EQ(comp, k64Value); -} - -TEST(EndianessTest, big_endian) { - // Check big-endian Load and store functions. - uint16_t u16Buf; - uint32_t u32Buf; - uint64_t u64Buf; - - unsigned char buffer[10]; - big_endian::Store16(&u16Buf, k16Value); - EXPECT_EQ(u16Buf, k16ValueBE); - uint64_t comp = big_endian::Load16(&u16Buf); - EXPECT_EQ(comp, k16Value); - - big_endian::Store32(&u32Buf, k32Value); - EXPECT_EQ(u32Buf, k32ValueBE); - comp = big_endian::Load32(&u32Buf); - EXPECT_EQ(comp, k32Value); - - big_endian::Store64(&u64Buf, k64Value); - EXPECT_EQ(u64Buf, k64ValueBE); - comp = big_endian::Load64(&u64Buf); - EXPECT_EQ(comp, k64Value); - - big_endian::Store16(buffer + 1, k16Value); - EXPECT_EQ(u16Buf, k16ValueBE); - comp = big_endian::Load16(buffer + 1); - EXPECT_EQ(comp, k16Value); - - big_endian::Store32(buffer + 1, k32Value); - EXPECT_EQ(u32Buf, k32ValueBE); - comp = big_endian::Load32(buffer + 1); - EXPECT_EQ(comp, k32Value); - - big_endian::Store64(buffer + 1, k64Value); - EXPECT_EQ(u64Buf, k64ValueBE); - comp = big_endian::Load64(buffer + 1); - EXPECT_EQ(comp, k64Value); -} - -} // namespace -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.cc deleted file mode 100644 index 6ef4325c8..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.cc +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/exception_safety_testing.h" - -#include "gtest/gtest.h" -#include "absl/meta/type_traits.h" - -namespace testing { - -exceptions_internal::NoThrowTag nothrow_ctor; - -exceptions_internal::StrongGuaranteeTagType strong_guarantee; - -exceptions_internal::ExceptionSafetyTestBuilder<> MakeExceptionSafetyTester() { - return {}; -} - -namespace exceptions_internal { - -int countdown = -1; - -ConstructorTracker* ConstructorTracker::current_tracker_instance_ = nullptr; - -void MaybeThrow(absl::string_view msg, bool throw_bad_alloc) { - if (countdown-- == 0) { - if (throw_bad_alloc) throw TestBadAllocException(msg); - throw TestException(msg); - } -} - -testing::AssertionResult FailureMessage(const TestException& e, - int countdown) noexcept { - return testing::AssertionFailure() << "Exception thrown from " << e.what(); -} - -std::string GetSpecString(TypeSpec spec) { - std::string out; - absl::string_view sep; - const auto append = [&](absl::string_view s) { - absl::StrAppend(&out, sep, s); - sep = " | "; - }; - if (static_cast(TypeSpec::kNoThrowCopy & spec)) { - append("kNoThrowCopy"); - } - if (static_cast(TypeSpec::kNoThrowMove & spec)) { - append("kNoThrowMove"); - } - if (static_cast(TypeSpec::kNoThrowNew & spec)) { - append("kNoThrowNew"); - } - return out; -} - -std::string GetSpecString(AllocSpec spec) { - return static_cast(AllocSpec::kNoThrowAllocate & spec) - ? "kNoThrowAllocate" - : ""; -} - -} // namespace exceptions_internal - -} // namespace testing diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h deleted file mode 100644 index be38ba549..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_safety_testing.h +++ /dev/null @@ -1,1096 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Utilities for testing exception-safety - -#ifndef ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ -#define ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gtest/gtest.h" -#include "absl/base/config.h" -#include "absl/base/internal/pretty_function.h" -#include "absl/memory/memory.h" -#include "absl/meta/type_traits.h" -#include "absl/strings/string_view.h" -#include "absl/strings/substitute.h" -#include "absl/utility/utility.h" - -namespace testing { - -enum class TypeSpec; -enum class AllocSpec; - -constexpr TypeSpec operator|(TypeSpec a, TypeSpec b) { - using T = absl::underlying_type_t; - return static_cast(static_cast(a) | static_cast(b)); -} - -constexpr TypeSpec operator&(TypeSpec a, TypeSpec b) { - using T = absl::underlying_type_t; - return static_cast(static_cast(a) & static_cast(b)); -} - -constexpr AllocSpec operator|(AllocSpec a, AllocSpec b) { - using T = absl::underlying_type_t; - return static_cast(static_cast(a) | static_cast(b)); -} - -constexpr AllocSpec operator&(AllocSpec a, AllocSpec b) { - using T = absl::underlying_type_t; - return static_cast(static_cast(a) & static_cast(b)); -} - -namespace exceptions_internal { - -std::string GetSpecString(TypeSpec); -std::string GetSpecString(AllocSpec); - -struct NoThrowTag {}; -struct StrongGuaranteeTagType {}; - -// A simple exception class. We throw this so that test code can catch -// exceptions specifically thrown by ThrowingValue. -class TestException { - public: - explicit TestException(absl::string_view msg) : msg_(msg) {} - virtual ~TestException() {} - virtual const char* what() const noexcept { return msg_.c_str(); } - - private: - std::string msg_; -}; - -// TestBadAllocException exists because allocation functions must throw an -// exception which can be caught by a handler of std::bad_alloc. We use a child -// class of std::bad_alloc so we can customise the error message, and also -// derive from TestException so we don't accidentally end up catching an actual -// bad_alloc exception in TestExceptionSafety. -class TestBadAllocException : public std::bad_alloc, public TestException { - public: - explicit TestBadAllocException(absl::string_view msg) : TestException(msg) {} - using TestException::what; -}; - -extern int countdown; - -// Allows the countdown variable to be set manually (defaulting to the initial -// value of 0) -inline void SetCountdown(int i = 0) { countdown = i; } -// Sets the countdown to the terminal value -1 -inline void UnsetCountdown() { SetCountdown(-1); } - -void MaybeThrow(absl::string_view msg, bool throw_bad_alloc = false); - -testing::AssertionResult FailureMessage(const TestException& e, - int countdown) noexcept; - -struct TrackedAddress { - bool is_alive; - std::string description; -}; - -// Inspects the constructions and destructions of anything inheriting from -// TrackedObject. This allows us to safely "leak" TrackedObjects, as -// ConstructorTracker will destroy everything left over in its destructor. -class ConstructorTracker { - public: - explicit ConstructorTracker(int count) : countdown_(count) { - assert(current_tracker_instance_ == nullptr); - current_tracker_instance_ = this; - } - - ~ConstructorTracker() { - assert(current_tracker_instance_ == this); - current_tracker_instance_ = nullptr; - - for (auto& it : address_map_) { - void* address = it.first; - TrackedAddress& tracked_address = it.second; - if (tracked_address.is_alive) { - ADD_FAILURE() << ErrorMessage(address, tracked_address.description, - countdown_, "Object was not destroyed."); - } - } - } - - static void ObjectConstructed(void* address, std::string description) { - if (!CurrentlyTracking()) return; - - TrackedAddress& tracked_address = - current_tracker_instance_->address_map_[address]; - if (tracked_address.is_alive) { - ADD_FAILURE() << ErrorMessage( - address, tracked_address.description, - current_tracker_instance_->countdown_, - "Object was re-constructed. Current object was constructed by " + - description); - } - tracked_address = {true, std::move(description)}; - } - - static void ObjectDestructed(void* address) { - if (!CurrentlyTracking()) return; - - auto it = current_tracker_instance_->address_map_.find(address); - // Not tracked. Ignore. - if (it == current_tracker_instance_->address_map_.end()) return; - - TrackedAddress& tracked_address = it->second; - if (!tracked_address.is_alive) { - ADD_FAILURE() << ErrorMessage(address, tracked_address.description, - current_tracker_instance_->countdown_, - "Object was re-destroyed."); - } - tracked_address.is_alive = false; - } - - private: - static bool CurrentlyTracking() { - return current_tracker_instance_ != nullptr; - } - - static std::string ErrorMessage(void* address, - const std::string& address_description, - int countdown, - const std::string& error_description) { - return absl::Substitute( - "With coundtown at $0:\n" - " $1\n" - " Object originally constructed by $2\n" - " Object address: $3\n", - countdown, error_description, address_description, address); - } - - std::unordered_map address_map_; - int countdown_; - - static ConstructorTracker* current_tracker_instance_; -}; - -class TrackedObject { - public: - TrackedObject(const TrackedObject&) = delete; - TrackedObject(TrackedObject&&) = delete; - - protected: - explicit TrackedObject(std::string description) { - ConstructorTracker::ObjectConstructed(this, std::move(description)); - } - - ~TrackedObject() noexcept { ConstructorTracker::ObjectDestructed(this); } -}; -} // namespace exceptions_internal - -extern exceptions_internal::NoThrowTag nothrow_ctor; - -extern exceptions_internal::StrongGuaranteeTagType strong_guarantee; - -// A test class which is convertible to bool. The conversion can be -// instrumented to throw at a controlled time. -class ThrowingBool { - public: - ThrowingBool(bool b) noexcept : b_(b) {} // NOLINT(runtime/explicit) - operator bool() const { // NOLINT - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return b_; - } - - private: - bool b_; -}; - -/* - * Configuration enum for the ThrowingValue type that defines behavior for the - * lifetime of the instance. Use testing::nothrow_ctor to prevent the integer - * constructor from throwing. - * - * kEverythingThrows: Every operation can throw an exception - * kNoThrowCopy: Copy construction and copy assignment will not throw - * kNoThrowMove: Move construction and move assignment will not throw - * kNoThrowNew: Overloaded operators new and new[] will not throw - */ -enum class TypeSpec { - kEverythingThrows = 0, - kNoThrowCopy = 1, - kNoThrowMove = 1 << 1, - kNoThrowNew = 1 << 2, -}; - -/* - * A testing class instrumented to throw an exception at a controlled time. - * - * ThrowingValue implements a slightly relaxed version of the Regular concept -- - * that is it's a value type with the expected semantics. It also implements - * arithmetic operations. It doesn't implement member and pointer operators - * like operator-> or operator[]. - * - * ThrowingValue can be instrumented to have certain operations be noexcept by - * using compile-time bitfield template arguments. That is, to make an - * ThrowingValue which has noexcept move construction/assignment and noexcept - * copy construction/assignment, use the following: - * ThrowingValue my_thrwr{val}; - */ -template -class ThrowingValue : private exceptions_internal::TrackedObject { - static constexpr bool IsSpecified(TypeSpec spec) { - return static_cast(Spec & spec); - } - - static constexpr int kDefaultValue = 0; - static constexpr int kBadValue = 938550620; - - public: - ThrowingValue() : TrackedObject(GetInstanceString(kDefaultValue)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ = kDefaultValue; - } - - ThrowingValue(const ThrowingValue& other) noexcept( - IsSpecified(TypeSpec::kNoThrowCopy)) - : TrackedObject(GetInstanceString(other.dummy_)) { - if (!IsSpecified(TypeSpec::kNoThrowCopy)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - } - dummy_ = other.dummy_; - } - - ThrowingValue(ThrowingValue&& other) noexcept( - IsSpecified(TypeSpec::kNoThrowMove)) - : TrackedObject(GetInstanceString(other.dummy_)) { - if (!IsSpecified(TypeSpec::kNoThrowMove)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - } - dummy_ = other.dummy_; - } - - explicit ThrowingValue(int i) : TrackedObject(GetInstanceString(i)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ = i; - } - - ThrowingValue(int i, exceptions_internal::NoThrowTag) noexcept - : TrackedObject(GetInstanceString(i)), dummy_(i) {} - - // absl expects nothrow destructors - ~ThrowingValue() noexcept = default; - - ThrowingValue& operator=(const ThrowingValue& other) noexcept( - IsSpecified(TypeSpec::kNoThrowCopy)) { - dummy_ = kBadValue; - if (!IsSpecified(TypeSpec::kNoThrowCopy)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - } - dummy_ = other.dummy_; - return *this; - } - - ThrowingValue& operator=(ThrowingValue&& other) noexcept( - IsSpecified(TypeSpec::kNoThrowMove)) { - dummy_ = kBadValue; - if (!IsSpecified(TypeSpec::kNoThrowMove)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - } - dummy_ = other.dummy_; - return *this; - } - - // Arithmetic Operators - ThrowingValue operator+(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ + other.dummy_, nothrow_ctor); - } - - ThrowingValue operator+() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_, nothrow_ctor); - } - - ThrowingValue operator-(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ - other.dummy_, nothrow_ctor); - } - - ThrowingValue operator-() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(-dummy_, nothrow_ctor); - } - - ThrowingValue& operator++() { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - ++dummy_; - return *this; - } - - ThrowingValue operator++(int) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - auto out = ThrowingValue(dummy_, nothrow_ctor); - ++dummy_; - return out; - } - - ThrowingValue& operator--() { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - --dummy_; - return *this; - } - - ThrowingValue operator--(int) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - auto out = ThrowingValue(dummy_, nothrow_ctor); - --dummy_; - return out; - } - - ThrowingValue operator*(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ * other.dummy_, nothrow_ctor); - } - - ThrowingValue operator/(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ / other.dummy_, nothrow_ctor); - } - - ThrowingValue operator%(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ % other.dummy_, nothrow_ctor); - } - - ThrowingValue operator<<(int shift) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ << shift, nothrow_ctor); - } - - ThrowingValue operator>>(int shift) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ >> shift, nothrow_ctor); - } - - // Comparison Operators - // NOTE: We use `ThrowingBool` instead of `bool` because most STL - // types/containers requires T to be convertible to bool. - friend ThrowingBool operator==(const ThrowingValue& a, - const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return a.dummy_ == b.dummy_; - } - friend ThrowingBool operator!=(const ThrowingValue& a, - const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return a.dummy_ != b.dummy_; - } - friend ThrowingBool operator<(const ThrowingValue& a, - const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return a.dummy_ < b.dummy_; - } - friend ThrowingBool operator<=(const ThrowingValue& a, - const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return a.dummy_ <= b.dummy_; - } - friend ThrowingBool operator>(const ThrowingValue& a, - const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return a.dummy_ > b.dummy_; - } - friend ThrowingBool operator>=(const ThrowingValue& a, - const ThrowingValue& b) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return a.dummy_ >= b.dummy_; - } - - // Logical Operators - ThrowingBool operator!() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return !dummy_; - } - - ThrowingBool operator&&(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return dummy_ && other.dummy_; - } - - ThrowingBool operator||(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return dummy_ || other.dummy_; - } - - // Bitwise Logical Operators - ThrowingValue operator~() const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(~dummy_, nothrow_ctor); - } - - ThrowingValue operator&(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ & other.dummy_, nothrow_ctor); - } - - ThrowingValue operator|(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ | other.dummy_, nothrow_ctor); - } - - ThrowingValue operator^(const ThrowingValue& other) const { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return ThrowingValue(dummy_ ^ other.dummy_, nothrow_ctor); - } - - // Compound Assignment operators - ThrowingValue& operator+=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ += other.dummy_; - return *this; - } - - ThrowingValue& operator-=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ -= other.dummy_; - return *this; - } - - ThrowingValue& operator*=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ *= other.dummy_; - return *this; - } - - ThrowingValue& operator/=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ /= other.dummy_; - return *this; - } - - ThrowingValue& operator%=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ %= other.dummy_; - return *this; - } - - ThrowingValue& operator&=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ &= other.dummy_; - return *this; - } - - ThrowingValue& operator|=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ |= other.dummy_; - return *this; - } - - ThrowingValue& operator^=(const ThrowingValue& other) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ ^= other.dummy_; - return *this; - } - - ThrowingValue& operator<<=(int shift) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ <<= shift; - return *this; - } - - ThrowingValue& operator>>=(int shift) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ >>= shift; - return *this; - } - - // Pointer operators - void operator&() const = delete; // NOLINT(runtime/operator) - - // Stream operators - friend std::ostream& operator<<(std::ostream& os, const ThrowingValue& tv) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return os << GetInstanceString(tv.dummy_); - } - - friend std::istream& operator>>(std::istream& is, const ThrowingValue&) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - return is; - } - - // Memory management operators - // Args.. allows us to overload regular and placement new in one shot - template - static void* operator new(size_t s, Args&&... args) noexcept( - IsSpecified(TypeSpec::kNoThrowNew)) { - if (!IsSpecified(TypeSpec::kNoThrowNew)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true); - } - return ::operator new(s, std::forward(args)...); - } - - template - static void* operator new[](size_t s, Args&&... args) noexcept( - IsSpecified(TypeSpec::kNoThrowNew)) { - if (!IsSpecified(TypeSpec::kNoThrowNew)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION, true); - } - return ::operator new[](s, std::forward(args)...); - } - - // Abseil doesn't support throwing overloaded operator delete. These are - // provided so a throwing operator-new can clean up after itself. - // - // We provide both regular and templated operator delete because if only the - // templated version is provided as we did with operator new, the compiler has - // no way of knowing which overload of operator delete to call. See - // https://en.cppreference.com/w/cpp/memory/new/operator_delete and - // https://en.cppreference.com/w/cpp/language/delete for the gory details. - void operator delete(void* p) noexcept { ::operator delete(p); } - - template - void operator delete(void* p, Args&&... args) noexcept { - ::operator delete(p, std::forward(args)...); - } - - void operator delete[](void* p) noexcept { return ::operator delete[](p); } - - template - void operator delete[](void* p, Args&&... args) noexcept { - return ::operator delete[](p, std::forward(args)...); - } - - // Non-standard access to the actual contained value. No need for this to - // throw. - int& Get() noexcept { return dummy_; } - const int& Get() const noexcept { return dummy_; } - - private: - static std::string GetInstanceString(int dummy) { - return absl::StrCat("ThrowingValue<", - exceptions_internal::GetSpecString(Spec), ">(", dummy, - ")"); - } - - int dummy_; -}; -// While not having to do with exceptions, explicitly delete comma operator, to -// make sure we don't use it on user-supplied types. -template -void operator,(const ThrowingValue&, T&&) = delete; -template -void operator,(T&&, const ThrowingValue&) = delete; - -/* - * Configuration enum for the ThrowingAllocator type that defines behavior for - * the lifetime of the instance. - * - * kEverythingThrows: Calls to the member functions may throw - * kNoThrowAllocate: Calls to the member functions will not throw - */ -enum class AllocSpec { - kEverythingThrows = 0, - kNoThrowAllocate = 1, -}; - -/* - * An allocator type which is instrumented to throw at a controlled time, or not - * to throw, using AllocSpec. The supported settings are the default of every - * function which is allowed to throw in a conforming allocator possibly - * throwing, or nothing throws, in line with the ABSL_ALLOCATOR_THROWS - * configuration macro. - */ -template -class ThrowingAllocator : private exceptions_internal::TrackedObject { - static constexpr bool IsSpecified(AllocSpec spec) { - return static_cast(Spec & spec); - } - - public: - using pointer = T*; - using const_pointer = const T*; - using reference = T&; - using const_reference = const T&; - using void_pointer = void*; - using const_void_pointer = const void*; - using value_type = T; - using size_type = size_t; - using difference_type = ptrdiff_t; - - using is_nothrow = - std::integral_constant; - using propagate_on_container_copy_assignment = std::true_type; - using propagate_on_container_move_assignment = std::true_type; - using propagate_on_container_swap = std::true_type; - using is_always_equal = std::false_type; - - ThrowingAllocator() : TrackedObject(GetInstanceString(next_id_)) { - exceptions_internal::MaybeThrow(ABSL_PRETTY_FUNCTION); - dummy_ = std::make_shared(next_id_++); - } - - template - ThrowingAllocator(const ThrowingAllocator& other) noexcept // NOLINT - : TrackedObject(GetInstanceString(*other.State())), - dummy_(other.State()) {} - - // According to C++11 standard [17.6.3.5], Table 28, the move/copy ctors of - // allocator shall not exit via an exception, thus they are marked noexcept. - ThrowingAllocator(const ThrowingAllocator& other) noexcept - : TrackedObject(GetInstanceString(*other.State())), - dummy_(other.State()) {} - - template - ThrowingAllocator(ThrowingAllocator&& other) noexcept // NOLINT - : TrackedObject(GetInstanceString(*other.State())), - dummy_(std::move(other.State())) {} - - ThrowingAllocator(ThrowingAllocator&& other) noexcept - : TrackedObject(GetInstanceString(*other.State())), - dummy_(std::move(other.State())) {} - - ~ThrowingAllocator() noexcept = default; - - ThrowingAllocator& operator=(const ThrowingAllocator& other) noexcept { - dummy_ = other.State(); - return *this; - } - - template - ThrowingAllocator& operator=( - const ThrowingAllocator& other) noexcept { - dummy_ = other.State(); - return *this; - } - - template - ThrowingAllocator& operator=(ThrowingAllocator&& other) noexcept { - dummy_ = std::move(other.State()); - return *this; - } - - template - struct rebind { - using other = ThrowingAllocator; - }; - - pointer allocate(size_type n) noexcept( - IsSpecified(AllocSpec::kNoThrowAllocate)) { - ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION); - return static_cast(::operator new(n * sizeof(T))); - } - - pointer allocate(size_type n, const_void_pointer) noexcept( - IsSpecified(AllocSpec::kNoThrowAllocate)) { - return allocate(n); - } - - void deallocate(pointer ptr, size_type) noexcept { - ReadState(); - ::operator delete(static_cast(ptr)); - } - - template - void construct(U* ptr, Args&&... args) noexcept( - IsSpecified(AllocSpec::kNoThrowAllocate)) { - ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION); - ::new (static_cast(ptr)) U(std::forward(args)...); - } - - template - void destroy(U* p) noexcept { - ReadState(); - p->~U(); - } - - size_type max_size() const noexcept { - return (std::numeric_limits::max)() / sizeof(value_type); - } - - ThrowingAllocator select_on_container_copy_construction() noexcept( - IsSpecified(AllocSpec::kNoThrowAllocate)) { - auto& out = *this; - ReadStateAndMaybeThrow(ABSL_PRETTY_FUNCTION); - return out; - } - - template - bool operator==(const ThrowingAllocator& other) const noexcept { - return dummy_ == other.dummy_; - } - - template - bool operator!=(const ThrowingAllocator& other) const noexcept { - return dummy_ != other.dummy_; - } - - template - friend class ThrowingAllocator; - - private: - static std::string GetInstanceString(int dummy) { - return absl::StrCat("ThrowingAllocator<", - exceptions_internal::GetSpecString(Spec), ">(", dummy, - ")"); - } - - const std::shared_ptr& State() const { return dummy_; } - std::shared_ptr& State() { return dummy_; } - - void ReadState() { - // we know that this will never be true, but the compiler doesn't, so this - // should safely force a read of the value. - if (*dummy_ < 0) std::abort(); - } - - void ReadStateAndMaybeThrow(absl::string_view msg) const { - if (!IsSpecified(AllocSpec::kNoThrowAllocate)) { - exceptions_internal::MaybeThrow( - absl::Substitute("Allocator id $0 threw from $1", *dummy_, msg)); - } - } - - static int next_id_; - std::shared_ptr dummy_; -}; - -template -int ThrowingAllocator::next_id_ = 0; - -// Tests for resource leaks by attempting to construct a T using args repeatedly -// until successful, using the countdown method. Side effects can then be -// tested for resource leaks. -template -void TestThrowingCtor(Args&&... args) { - struct Cleanup { - ~Cleanup() { exceptions_internal::UnsetCountdown(); } - } c; - for (int count = 0;; ++count) { - exceptions_internal::ConstructorTracker ct(count); - exceptions_internal::SetCountdown(count); - try { - T temp(std::forward(args)...); - static_cast(temp); - break; - } catch (const exceptions_internal::TestException&) { - } - } -} - -// Tests the nothrow guarantee of the provided nullary operation. If the an -// exception is thrown, the result will be AssertionFailure(). Otherwise, it -// will be AssertionSuccess(). -template -testing::AssertionResult TestNothrowOp(const Operation& operation) { - struct Cleanup { - Cleanup() { exceptions_internal::SetCountdown(); } - ~Cleanup() { exceptions_internal::UnsetCountdown(); } - } c; - try { - operation(); - return testing::AssertionSuccess(); - } catch (const exceptions_internal::TestException&) { - return testing::AssertionFailure() - << "TestException thrown during call to operation() when nothrow " - "guarantee was expected."; - } catch (...) { - return testing::AssertionFailure() - << "Unknown exception thrown during call to operation() when " - "nothrow guarantee was expected."; - } -} - -namespace exceptions_internal { - -// Dummy struct for ExceptionSafetyTestBuilder<> partial state. -struct UninitializedT {}; - -template -class DefaultFactory { - public: - explicit DefaultFactory(const T& t) : t_(t) {} - std::unique_ptr operator()() const { return absl::make_unique(t_); } - - private: - T t_; -}; - -template -using EnableIfTestable = typename absl::enable_if_t< - LazyContractsCount != 0 && - !std::is_same::value && - !std::is_same::value>; - -template -class ExceptionSafetyTestBuilder; - -} // namespace exceptions_internal - -/* - * Constructs an empty ExceptionSafetyTestBuilder. All - * ExceptionSafetyTestBuilder objects are immutable and all With[thing] mutation - * methods return new instances of ExceptionSafetyTestBuilder. - * - * In order to test a T for exception safety, a factory for that T, a testable - * operation, and at least one contract callback returning an assertion - * result must be applied using the respective methods. - */ -exceptions_internal::ExceptionSafetyTestBuilder<> MakeExceptionSafetyTester(); - -namespace exceptions_internal { -template -struct IsUniquePtr : std::false_type {}; - -template -struct IsUniquePtr> : std::true_type {}; - -template -struct FactoryPtrTypeHelper { - using type = decltype(std::declval()()); - - static_assert(IsUniquePtr::value, "Factories must return a unique_ptr"); -}; - -template -using FactoryPtrType = typename FactoryPtrTypeHelper::type; - -template -using FactoryElementType = typename FactoryPtrType::element_type; - -template -class ExceptionSafetyTest { - using Factory = std::function()>; - using Operation = std::function; - using Contract = std::function; - - public: - template - explicit ExceptionSafetyTest(const Factory& f, const Operation& op, - const Contracts&... contracts) - : factory_(f), operation_(op), contracts_{WrapContract(contracts)...} {} - - AssertionResult Test() const { - for (int count = 0;; ++count) { - exceptions_internal::ConstructorTracker ct(count); - - for (const auto& contract : contracts_) { - auto t_ptr = factory_(); - try { - SetCountdown(count); - operation_(t_ptr.get()); - // Unset for the case that the operation throws no exceptions, which - // would leave the countdown set and break the *next* exception safety - // test after this one. - UnsetCountdown(); - return AssertionSuccess(); - } catch (const exceptions_internal::TestException& e) { - if (!contract(t_ptr.get())) { - return AssertionFailure() << e.what() << " failed contract check"; - } - } - } - } - } - - private: - template - Contract WrapContract(const ContractFn& contract) { - return [contract](T* t_ptr) { return AssertionResult(contract(t_ptr)); }; - } - - Contract WrapContract(StrongGuaranteeTagType) { - return [this](T* t_ptr) { return AssertionResult(*factory_() == *t_ptr); }; - } - - Factory factory_; - Operation operation_; - std::vector contracts_; -}; - -/* - * Builds a tester object that tests if performing a operation on a T follows - * exception safety guarantees. Verification is done via contract assertion - * callbacks applied to T instances post-throw. - * - * Template parameters for ExceptionSafetyTestBuilder: - * - * - Factory: The factory object (passed in via tester.WithFactory(...) or - * tester.WithInitialValue(...)) must be invocable with the signature - * `std::unique_ptr operator()() const` where T is the type being tested. - * It is used for reliably creating identical T instances to test on. - * - * - Operation: The operation object (passsed in via tester.WithOperation(...) - * or tester.Test(...)) must be invocable with the signature - * `void operator()(T*) const` where T is the type being tested. It is used - * for performing steps on a T instance that may throw and that need to be - * checked for exception safety. Each call to the operation will receive a - * fresh T instance so it's free to modify and destroy the T instances as it - * pleases. - * - * - Contracts...: The contract assertion callback objects (passed in via - * tester.WithContracts(...)) must be invocable with the signature - * `testing::AssertionResult operator()(T*) const` where T is the type being - * tested. Contract assertion callbacks are provided T instances post-throw. - * They must return testing::AssertionSuccess when the type contracts of the - * provided T instance hold. If the type contracts of the T instance do not - * hold, they must return testing::AssertionFailure. Execution order of - * Contracts... is unspecified. They will each individually get a fresh T - * instance so they are free to modify and destroy the T instances as they - * please. - */ -template -class ExceptionSafetyTestBuilder { - public: - /* - * Returns a new ExceptionSafetyTestBuilder with an included T factory based - * on the provided T instance. The existing factory will not be included in - * the newly created tester instance. The created factory returns a new T - * instance by copy-constructing the provided const T& t. - * - * Preconditions for tester.WithInitialValue(const T& t): - * - * - The const T& t object must be copy-constructible where T is the type - * being tested. For non-copy-constructible objects, use the method - * tester.WithFactory(...). - */ - template - ExceptionSafetyTestBuilder, Operation, Contracts...> - WithInitialValue(const T& t) const { - return WithFactory(DefaultFactory(t)); - } - - /* - * Returns a new ExceptionSafetyTestBuilder with the provided T factory - * included. The existing factory will not be included in the newly-created - * tester instance. This method is intended for use with types lacking a copy - * constructor. Types that can be copy-constructed should instead use the - * method tester.WithInitialValue(...). - */ - template - ExceptionSafetyTestBuilder, Operation, Contracts...> - WithFactory(const NewFactory& new_factory) const { - return {new_factory, operation_, contracts_}; - } - - /* - * Returns a new ExceptionSafetyTestBuilder with the provided testable - * operation included. The existing operation will not be included in the - * newly created tester. - */ - template - ExceptionSafetyTestBuilder, Contracts...> - WithOperation(const NewOperation& new_operation) const { - return {factory_, new_operation, contracts_}; - } - - /* - * Returns a new ExceptionSafetyTestBuilder with the provided MoreContracts... - * combined with the Contracts... that were already included in the instance - * on which the method was called. Contracts... cannot be removed or replaced - * once added to an ExceptionSafetyTestBuilder instance. A fresh object must - * be created in order to get an empty Contracts... list. - * - * In addition to passing in custom contract assertion callbacks, this method - * accepts `testing::strong_guarantee` as an argument which checks T instances - * post-throw against freshly created T instances via operator== to verify - * that any state changes made during the execution of the operation were - * properly rolled back. - */ - template - ExceptionSafetyTestBuilder...> - WithContracts(const MoreContracts&... more_contracts) const { - return { - factory_, operation_, - std::tuple_cat(contracts_, std::tuple...>( - more_contracts...))}; - } - - /* - * Returns a testing::AssertionResult that is the reduced result of the - * exception safety algorithm. The algorithm short circuits and returns - * AssertionFailure after the first contract callback returns an - * AssertionFailure. Otherwise, if all contract callbacks return an - * AssertionSuccess, the reduced result is AssertionSuccess. - * - * The passed-in testable operation will not be saved in a new tester instance - * nor will it modify/replace the existing tester instance. This is useful - * when each operation being tested is unique and does not need to be reused. - * - * Preconditions for tester.Test(const NewOperation& new_operation): - * - * - May only be called after at least one contract assertion callback and a - * factory or initial value have been provided. - */ - template < - typename NewOperation, - typename = EnableIfTestable> - testing::AssertionResult Test(const NewOperation& new_operation) const { - return TestImpl(new_operation, absl::index_sequence_for()); - } - - /* - * Returns a testing::AssertionResult that is the reduced result of the - * exception safety algorithm. The algorithm short circuits and returns - * AssertionFailure after the first contract callback returns an - * AssertionFailure. Otherwise, if all contract callbacks return an - * AssertionSuccess, the reduced result is AssertionSuccess. - * - * Preconditions for tester.Test(): - * - * - May only be called after at least one contract assertion callback, a - * factory or initial value and a testable operation have been provided. - */ - template < - typename LazyOperation = Operation, - typename = EnableIfTestable> - testing::AssertionResult Test() const { - return Test(operation_); - } - - private: - template - friend class ExceptionSafetyTestBuilder; - - friend ExceptionSafetyTestBuilder<> testing::MakeExceptionSafetyTester(); - - ExceptionSafetyTestBuilder() {} - - ExceptionSafetyTestBuilder(const Factory& f, const Operation& o, - const std::tuple& i) - : factory_(f), operation_(o), contracts_(i) {} - - template - testing::AssertionResult TestImpl(SelectedOperation selected_operation, - absl::index_sequence) const { - return ExceptionSafetyTest>( - factory_, selected_operation, std::get(contracts_)...) - .Test(); - } - - Factory factory_; - Operation operation_; - std::tuple contracts_; -}; - -} // namespace exceptions_internal - -} // namespace testing - -#endif // ABSL_BASE_INTERNAL_EXCEPTION_SAFETY_TESTING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_testing.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_testing.h deleted file mode 100644 index 01b546557..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/exception_testing.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Testing utilities for ABSL types which throw exceptions. - -#ifndef ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ -#define ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ - -#include "gtest/gtest.h" -#include "absl/base/config.h" - -// ABSL_BASE_INTERNAL_EXPECT_FAIL tests either for a specified thrown exception -// if exceptions are enabled, or for death with a specified text in the error -// message -#ifdef ABSL_HAVE_EXCEPTIONS - -#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ - EXPECT_THROW(expr, exception_t) - -#elif defined(__ANDROID__) -// Android asserts do not log anywhere that gtest can currently inspect. -// So we expect exit, but cannot match the message. -#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ - EXPECT_DEATH(expr, ".*") -#else -#define ABSL_BASE_INTERNAL_EXPECT_FAIL(expr, exception_t, text) \ - EXPECT_DEATH_IF_SUPPORTED(expr, text) - -#endif - -#endif // ABSL_BASE_INTERNAL_EXCEPTION_TESTING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/inline_variable_testing.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/inline_variable_testing.h deleted file mode 100644 index 15dc481e1..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/inline_variable_testing.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_BASE_INLINE_VARIABLE_TESTING_H_ -#define ABSL_BASE_INLINE_VARIABLE_TESTING_H_ - -#include "absl/base/internal/inline_variable.h" - -namespace absl { -namespace inline_variable_testing_internal { - -struct Foo { - int value = 5; -}; - -ABSL_INTERNAL_INLINE_CONSTEXPR(Foo, inline_variable_foo, {}); -ABSL_INTERNAL_INLINE_CONSTEXPR(Foo, other_inline_variable_foo, {}); - -ABSL_INTERNAL_INLINE_CONSTEXPR(int, inline_variable_int, 5); -ABSL_INTERNAL_INLINE_CONSTEXPR(int, other_inline_variable_int, 5); - -ABSL_INTERNAL_INLINE_CONSTEXPR(void(*)(), inline_variable_fun_ptr, nullptr); - -const Foo& get_foo_a(); -const Foo& get_foo_b(); - -const int& get_int_a(); -const int& get_int_b(); - -} // namespace inline_variable_testing_internal -} // namespace absl - -#endif // ABSL_BASE_INLINE_VARIABLE_TESTING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc deleted file mode 100644 index 34a080cb1..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/low_level_alloc_test.cc +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/low_level_alloc.h" - -#include -#include -#include -#include // NOLINT(build/c++11) -#include -#include - -namespace absl { -namespace base_internal { -namespace { - -// This test doesn't use gtest since it needs to test that everything -// works before main(). -#define TEST_ASSERT(x) \ - if (!(x)) { \ - printf("TEST_ASSERT(%s) FAILED ON LINE %d\n", #x, __LINE__); \ - abort(); \ - } - -// a block of memory obtained from the allocator -struct BlockDesc { - char *ptr; // pointer to memory - int len; // number of bytes - int fill; // filled with data starting with this -}; - -// Check that the pattern placed in the block d -// by RandomizeBlockDesc is still there. -static void CheckBlockDesc(const BlockDesc &d) { - for (int i = 0; i != d.len; i++) { - TEST_ASSERT((d.ptr[i] & 0xff) == ((d.fill + i) & 0xff)); - } -} - -// Fill the block "*d" with a pattern -// starting with a random byte. -static void RandomizeBlockDesc(BlockDesc *d) { - d->fill = rand() & 0xff; - for (int i = 0; i != d->len; i++) { - d->ptr[i] = (d->fill + i) & 0xff; - } -} - -// Use to indicate to the malloc hooks that -// this calls is from LowLevelAlloc. -static bool using_low_level_alloc = false; - -// n times, toss a coin, and based on the outcome -// either allocate a new block or deallocate an old block. -// New blocks are placed in a std::unordered_map with a random key -// and initialized with RandomizeBlockDesc(). -// If keys conflict, the older block is freed. -// Old blocks are always checked with CheckBlockDesc() -// before being freed. At the end of the run, -// all remaining allocated blocks are freed. -// If use_new_arena is true, use a fresh arena, and then delete it. -// If call_malloc_hook is true and user_arena is true, -// allocations and deallocations are reported via the MallocHook -// interface. -static void Test(bool use_new_arena, bool call_malloc_hook, int n) { - typedef std::unordered_map AllocMap; - AllocMap allocated; - AllocMap::iterator it; - BlockDesc block_desc; - int rnd; - LowLevelAlloc::Arena *arena = 0; - if (use_new_arena) { - int32_t flags = call_malloc_hook ? LowLevelAlloc::kCallMallocHook : 0; - arena = LowLevelAlloc::NewArena(flags); - } - for (int i = 0; i != n; i++) { - if (i != 0 && i % 10000 == 0) { - printf("."); - fflush(stdout); - } - - switch (rand() & 1) { // toss a coin - case 0: // coin came up heads: add a block - using_low_level_alloc = true; - block_desc.len = rand() & 0x3fff; - block_desc.ptr = - reinterpret_cast( - arena == 0 - ? LowLevelAlloc::Alloc(block_desc.len) - : LowLevelAlloc::AllocWithArena(block_desc.len, arena)); - using_low_level_alloc = false; - RandomizeBlockDesc(&block_desc); - rnd = rand(); - it = allocated.find(rnd); - if (it != allocated.end()) { - CheckBlockDesc(it->second); - using_low_level_alloc = true; - LowLevelAlloc::Free(it->second.ptr); - using_low_level_alloc = false; - it->second = block_desc; - } else { - allocated[rnd] = block_desc; - } - break; - case 1: // coin came up tails: remove a block - it = allocated.begin(); - if (it != allocated.end()) { - CheckBlockDesc(it->second); - using_low_level_alloc = true; - LowLevelAlloc::Free(it->second.ptr); - using_low_level_alloc = false; - allocated.erase(it); - } - break; - } - } - // remove all remaining blocks - while ((it = allocated.begin()) != allocated.end()) { - CheckBlockDesc(it->second); - using_low_level_alloc = true; - LowLevelAlloc::Free(it->second.ptr); - using_low_level_alloc = false; - allocated.erase(it); - } - if (use_new_arena) { - TEST_ASSERT(LowLevelAlloc::DeleteArena(arena)); - } -} - -// LowLevelAlloc is designed to be safe to call before main(). -static struct BeforeMain { - BeforeMain() { - Test(false, false, 50000); - Test(true, false, 50000); - Test(true, true, 50000); - } -} before_main; - -} // namespace -} // namespace base_internal -} // namespace absl - -int main(int argc, char *argv[]) { - // The actual test runs in the global constructor of `before_main`. - printf("PASS\n"); - return 0; -} diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env.cc deleted file mode 100644 index 3ac3f68dd..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env.cc +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2019 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/scoped_set_env.h" - -#ifdef _WIN32 -#include -#endif - -#include - -#include "absl/base/internal/raw_logging.h" - -namespace absl { -namespace base_internal { - -namespace { - -#ifdef _WIN32 -const int kMaxEnvVarValueSize = 1024; -#endif - -void SetEnvVar(const char* name, const char* value) { -#ifdef _WIN32 - SetEnvironmentVariableA(name, value); -#else - if (value == nullptr) { - ::unsetenv(name); - } else { - ::setenv(name, value, 1); - } -#endif -} - -} // namespace - -ScopedSetEnv::ScopedSetEnv(const char* var_name, const char* new_value) - : var_name_(var_name), was_unset_(false) { -#ifdef _WIN32 - char buf[kMaxEnvVarValueSize]; - auto get_res = GetEnvironmentVariableA(var_name_.c_str(), buf, sizeof(buf)); - ABSL_INTERNAL_CHECK(get_res < sizeof(buf), "value exceeds buffer size"); - - if (get_res == 0) { - was_unset_ = (GetLastError() == ERROR_ENVVAR_NOT_FOUND); - } else { - old_value_.assign(buf, get_res); - } - - SetEnvironmentVariableA(var_name_.c_str(), new_value); -#else - const char* val = ::getenv(var_name_.c_str()); - if (val == nullptr) { - was_unset_ = true; - } else { - old_value_ = val; - } -#endif - - SetEnvVar(var_name_.c_str(), new_value); -} - -ScopedSetEnv::~ScopedSetEnv() { - SetEnvVar(var_name_.c_str(), was_unset_ ? nullptr : old_value_.c_str()); -} - -} // namespace base_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env.h deleted file mode 100644 index 855b22fd4..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env.h +++ /dev/null @@ -1,41 +0,0 @@ -// -// Copyright 2019 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -#ifndef ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ -#define ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ - -#include - -namespace absl { -namespace base_internal { - -class ScopedSetEnv { - public: - ScopedSetEnv(const char* var_name, const char* new_value); - ~ScopedSetEnv(); - - private: - std::string var_name_; - std::string old_value_; - - // True if the environment variable was initially not set. - bool was_unset_; -}; - -} // namespace base_internal -} // namespace absl - -#endif // ABSL_BASE_INTERNAL_SCOPED_SET_ENV_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env_test.cc deleted file mode 100644 index 5cbad246c..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/scoped_set_env_test.cc +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2019 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifdef _WIN32 -#include -#endif - -#include "gtest/gtest.h" -#include "absl/base/internal/scoped_set_env.h" - -namespace { - -using absl::base_internal::ScopedSetEnv; - -std::string GetEnvVar(const char* name) { -#ifdef _WIN32 - char buf[1024]; - auto get_res = GetEnvironmentVariableA(name, buf, sizeof(buf)); - if (get_res >= sizeof(buf)) { - return "TOO_BIG"; - } - - if (get_res == 0) { - return "UNSET"; - } - - return std::string(buf, get_res); -#else - const char* val = ::getenv(name); - if (val == nullptr) { - return "UNSET"; - } - - return val; -#endif -} - -TEST(ScopedSetEnvTest, SetNonExistingVarToString) { - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "UNSET"); - - { - ScopedSetEnv scoped_set("SCOPED_SET_ENV_TEST_VAR", "value"); - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "value"); - } - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "UNSET"); -} - -TEST(ScopedSetEnvTest, SetNonExistingVarToNull) { - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "UNSET"); - - { - ScopedSetEnv scoped_set("SCOPED_SET_ENV_TEST_VAR", nullptr); - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "UNSET"); - } - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "UNSET"); -} - -TEST(ScopedSetEnvTest, SetExistingVarToString) { - ScopedSetEnv scoped_set("SCOPED_SET_ENV_TEST_VAR", "value"); - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "value"); - - { - ScopedSetEnv scoped_set("SCOPED_SET_ENV_TEST_VAR", "new_value"); - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "new_value"); - } - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "value"); -} - -TEST(ScopedSetEnvTest, SetExistingVarToNull) { - ScopedSetEnv scoped_set("SCOPED_SET_ENV_TEST_VAR", "value"); - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "value"); - - { - ScopedSetEnv scoped_set("SCOPED_SET_ENV_TEST_VAR", nullptr); - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "UNSET"); - } - - EXPECT_EQ(GetEnvVar("SCOPED_SET_ENV_TEST_VAR"), "value"); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/spinlock_benchmark.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/spinlock_benchmark.cc deleted file mode 100644 index 0451c65f9..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/spinlock_benchmark.cc +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// See also //absl/synchronization:mutex_benchmark for a comparison of SpinLock -// and Mutex performance under varying levels of contention. - -#include "absl/base/internal/raw_logging.h" -#include "absl/base/internal/scheduling_mode.h" -#include "absl/base/internal/spinlock.h" -#include "absl/synchronization/internal/create_thread_identity.h" -#include "benchmark/benchmark.h" - -namespace { - -template -static void BM_SpinLock(benchmark::State& state) { - // Ensure a ThreadIdentity is installed. - ABSL_INTERNAL_CHECK( - absl::synchronization_internal::GetOrCreateCurrentThreadIdentity() != - nullptr, - "GetOrCreateCurrentThreadIdentity() failed"); - - static auto* spinlock = new absl::base_internal::SpinLock(scheduling_mode); - for (auto _ : state) { - absl::base_internal::SpinLockHolder holder(spinlock); - } -} - -BENCHMARK_TEMPLATE(BM_SpinLock, - absl::base_internal::SCHEDULE_KERNEL_ONLY) - ->UseRealTime() - ->Threads(1) - ->ThreadPerCpu(); - -BENCHMARK_TEMPLATE(BM_SpinLock, - absl::base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL) - ->UseRealTime() - ->Threads(1) - ->ThreadPerCpu(); - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc deleted file mode 100644 index 82bbcc2b3..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/sysinfo_test.cc +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/sysinfo.h" - -#ifndef _WIN32 -#include -#include -#endif - -#include // NOLINT(build/c++11) -#include -#include - -#include "gtest/gtest.h" -#include "absl/synchronization/barrier.h" -#include "absl/synchronization/mutex.h" - -namespace absl { -namespace base_internal { -namespace { - -TEST(SysinfoTest, NumCPUs) { - EXPECT_NE(NumCPUs(), 0) - << "NumCPUs() should not have the default value of 0"; -} - -TEST(SysinfoTest, NominalCPUFrequency) { -#if !(defined(__aarch64__) && defined(__linux__)) && !defined(__EMSCRIPTEN__) - EXPECT_GE(NominalCPUFrequency(), 1000.0) - << "NominalCPUFrequency() did not return a reasonable value"; -#else - // Aarch64 cannot read the CPU frequency from sysfs, so we get back 1.0. - // Emscripten does not have a sysfs to read from at all. - EXPECT_EQ(NominalCPUFrequency(), 1.0) - << "CPU frequency detection was fixed! Please update unittest."; -#endif -} - -TEST(SysinfoTest, GetTID) { - EXPECT_EQ(GetTID(), GetTID()); // Basic compile and equality test. -#ifdef __native_client__ - // Native Client has a race condition bug that leads to memory - // exaustion when repeatedly creating and joining threads. - // https://bugs.chromium.org/p/nativeclient/issues/detail?id=1027 - return; -#endif - // Test that TIDs are unique to each thread. - // Uses a few loops to exercise implementations that reallocate IDs. - for (int i = 0; i < 32; ++i) { - constexpr int kNumThreads = 64; - Barrier all_threads_done(kNumThreads); - std::vector threads; - - Mutex mutex; - std::unordered_set tids; - - for (int j = 0; j < kNumThreads; ++j) { - threads.push_back(std::thread([&]() { - pid_t id = GetTID(); - { - MutexLock lock(&mutex); - ASSERT_TRUE(tids.find(id) == tids.end()); - tids.insert(id); - } - // We can't simply join the threads here. The threads need to - // be alive otherwise the TID might have been reallocated to - // another live thread. - all_threads_done.Block(); - })); - } - for (auto& thread : threads) { - thread.join(); - } - } -} - -#ifdef __linux__ -TEST(SysinfoTest, LinuxGetTID) { - // On Linux, for the main thread, GetTID()==getpid() is guaranteed by the API. - EXPECT_EQ(GetTID(), getpid()); -} -#endif - -} // namespace -} // namespace base_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/thread_identity_benchmark.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/thread_identity_benchmark.cc deleted file mode 100644 index 0ae10f2b1..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/thread_identity_benchmark.cc +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "benchmark/benchmark.h" -#include "absl/base/internal/thread_identity.h" -#include "absl/synchronization/internal/create_thread_identity.h" -#include "absl/synchronization/internal/per_thread_sem.h" - -namespace { - -void BM_SafeCurrentThreadIdentity(benchmark::State& state) { - for (auto _ : state) { - benchmark::DoNotOptimize( - absl::synchronization_internal::GetOrCreateCurrentThreadIdentity()); - } -} -BENCHMARK(BM_SafeCurrentThreadIdentity); - -void BM_UnsafeCurrentThreadIdentity(benchmark::State& state) { - for (auto _ : state) { - benchmark::DoNotOptimize( - absl::base_internal::CurrentThreadIdentityIfPresent()); - } -} -BENCHMARK(BM_UnsafeCurrentThreadIdentity); - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/thread_identity_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/thread_identity_test.cc deleted file mode 100644 index 13bfbe3bd..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/thread_identity_test.cc +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/thread_identity.h" - -#include // NOLINT(build/c++11) -#include - -#include "gtest/gtest.h" -#include "absl/base/attributes.h" -#include "absl/base/internal/spinlock.h" -#include "absl/base/macros.h" -#include "absl/synchronization/internal/per_thread_sem.h" -#include "absl/synchronization/mutex.h" - -namespace absl { -namespace base_internal { -namespace { - -// protects num_identities_reused -static absl::base_internal::SpinLock map_lock( - absl::base_internal::kLinkerInitialized); -static int num_identities_reused; - -static const void* const kCheckNoIdentity = reinterpret_cast(1); - -static void TestThreadIdentityCurrent(const void* assert_no_identity) { - ThreadIdentity* identity; - - // We have to test this conditionally, because if the test framework relies - // on Abseil, then some previous action may have already allocated an - // identity. - if (assert_no_identity == kCheckNoIdentity) { - identity = CurrentThreadIdentityIfPresent(); - EXPECT_TRUE(identity == nullptr); - } - - identity = synchronization_internal::GetOrCreateCurrentThreadIdentity(); - EXPECT_TRUE(identity != nullptr); - ThreadIdentity* identity_no_init; - identity_no_init = CurrentThreadIdentityIfPresent(); - EXPECT_TRUE(identity == identity_no_init); - - // Check that per_thread_synch is correctly aligned. - EXPECT_EQ(0, reinterpret_cast(&identity->per_thread_synch) % - PerThreadSynch::kAlignment); - EXPECT_EQ(identity, identity->per_thread_synch.thread_identity()); - - absl::base_internal::SpinLockHolder l(&map_lock); - num_identities_reused++; -} - -TEST(ThreadIdentityTest, BasicIdentityWorks) { - // This tests for the main() thread. - TestThreadIdentityCurrent(nullptr); -} - -TEST(ThreadIdentityTest, BasicIdentityWorksThreaded) { - // Now try the same basic test with multiple threads being created and - // destroyed. This makes sure that: - // - New threads are created without a ThreadIdentity. - // - We re-allocate ThreadIdentity objects from the free-list. - // - If a thread implementation chooses to recycle threads, that - // correct re-initialization occurs. - static const int kNumLoops = 3; - static const int kNumThreads = 400; - for (int iter = 0; iter < kNumLoops; iter++) { - std::vector threads; - for (int i = 0; i < kNumThreads; ++i) { - threads.push_back( - std::thread(TestThreadIdentityCurrent, kCheckNoIdentity)); - } - for (auto& thread : threads) { - thread.join(); - } - } - - // We should have recycled ThreadIdentity objects above; while (external) - // library threads allocating their own identities may preclude some - // reuse, we should have sufficient repetitions to exclude this. - EXPECT_LT(kNumThreads, num_identities_reused); -} - -TEST(ThreadIdentityTest, ReusedThreadIdentityMutexTest) { - // This test repeatly creates and joins a series of threads, each of - // which acquires and releases shared Mutex locks. This verifies - // Mutex operations work correctly under a reused - // ThreadIdentity. Note that the most likely failure mode of this - // test is a crash or deadlock. - static const int kNumLoops = 10; - static const int kNumThreads = 12; - static const int kNumMutexes = 3; - static const int kNumLockLoops = 5; - - Mutex mutexes[kNumMutexes]; - for (int iter = 0; iter < kNumLoops; ++iter) { - std::vector threads; - for (int thread = 0; thread < kNumThreads; ++thread) { - threads.push_back(std::thread([&]() { - for (int l = 0; l < kNumLockLoops; ++l) { - for (int m = 0; m < kNumMutexes; ++m) { - MutexLock lock(&mutexes[m]); - } - } - })); - } - for (auto& thread : threads) { - thread.join(); - } - } -} - -} // namespace -} // namespace base_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc deleted file mode 100644 index 593762bc8..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/internal/unscaledcycleclock.cc +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/unscaledcycleclock.h" - -#if ABSL_USE_UNSCALED_CYCLECLOCK - -#if defined(_WIN32) -#include -#endif - -#if defined(__powerpc__) || defined(__ppc__) -#include -#endif - -#include "absl/base/internal/sysinfo.h" - -namespace absl { -namespace base_internal { - -#if defined(__i386__) - -int64_t UnscaledCycleClock::Now() { - int64_t ret; - __asm__ volatile("rdtsc" : "=A"(ret)); - return ret; -} - -double UnscaledCycleClock::Frequency() { - return base_internal::NominalCPUFrequency(); -} - -#elif defined(__x86_64__) - -int64_t UnscaledCycleClock::Now() { - uint64_t low, high; - __asm__ volatile("rdtsc" : "=a"(low), "=d"(high)); - return (high << 32) | low; -} - -double UnscaledCycleClock::Frequency() { - return base_internal::NominalCPUFrequency(); -} - -#elif defined(__powerpc__) || defined(__ppc__) - -int64_t UnscaledCycleClock::Now() { - return __ppc_get_timebase(); -} - -double UnscaledCycleClock::Frequency() { - return __ppc_get_timebase_freq(); -} - -#elif defined(__aarch64__) - -// System timer of ARMv8 runs at a different frequency than the CPU's. -// The frequency is fixed, typically in the range 1-50MHz. It can be -// read at CNTFRQ special register. We assume the OS has set up -// the virtual timer properly. -int64_t UnscaledCycleClock::Now() { - int64_t virtual_timer_value; - asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value)); - return virtual_timer_value; -} - -double UnscaledCycleClock::Frequency() { - uint64_t aarch64_timer_frequency; - asm volatile("mrs %0, cntfrq_el0" : "=r"(aarch64_timer_frequency)); - return aarch64_timer_frequency; -} - -#elif defined(_M_IX86) || defined(_M_X64) - -#pragma intrinsic(__rdtsc) - -int64_t UnscaledCycleClock::Now() { - return __rdtsc(); -} - -double UnscaledCycleClock::Frequency() { - return base_internal::NominalCPUFrequency(); -} - -#endif - -} // namespace base_internal -} // namespace absl - -#endif // ABSL_USE_UNSCALED_CYCLECLOCK diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/invoke_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/invoke_test.cc deleted file mode 100644 index 691f55379..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/invoke_test.cc +++ /dev/null @@ -1,200 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/invoke.h" - -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/memory/memory.h" -#include "absl/strings/str_cat.h" - -namespace absl { -namespace base_internal { -namespace { - -int Function(int a, int b) { return a - b; } - -int Sink(std::unique_ptr p) { - return *p; -} - -std::unique_ptr Factory(int n) { - return make_unique(n); -} - -void NoOp() {} - -struct ConstFunctor { - int operator()(int a, int b) const { return a - b; } -}; - -struct MutableFunctor { - int operator()(int a, int b) { return a - b; } -}; - -struct EphemeralFunctor { - int operator()(int a, int b) && { return a - b; } -}; - -struct OverloadedFunctor { - template - std::string operator()(const Args&... args) & { - return StrCat("&", args...); - } - template - std::string operator()(const Args&... args) const& { - return StrCat("const&", args...); - } - template - std::string operator()(const Args&... args) && { - return StrCat("&&", args...); - } -}; - -struct Class { - int Method(int a, int b) { return a - b; } - int ConstMethod(int a, int b) const { return a - b; } - - int member; -}; - -struct FlipFlop { - int ConstMethod() const { return member; } - FlipFlop operator*() const { return {-member}; } - - int member; -}; - -// CallMaybeWithArg(f) resolves either to Invoke(f) or Invoke(f, 42), depending -// on which one is valid. -template -decltype(Invoke(std::declval())) CallMaybeWithArg(const F& f) { - return Invoke(f); -} - -template -decltype(Invoke(std::declval(), 42)) CallMaybeWithArg(const F& f) { - return Invoke(f, 42); -} - -TEST(InvokeTest, Function) { - EXPECT_EQ(1, Invoke(Function, 3, 2)); - EXPECT_EQ(1, Invoke(&Function, 3, 2)); -} - -TEST(InvokeTest, NonCopyableArgument) { - EXPECT_EQ(42, Invoke(Sink, make_unique(42))); -} - -TEST(InvokeTest, NonCopyableResult) { - EXPECT_THAT(Invoke(Factory, 42), ::testing::Pointee(42)); -} - -TEST(InvokeTest, VoidResult) { - Invoke(NoOp); -} - -TEST(InvokeTest, ConstFunctor) { - EXPECT_EQ(1, Invoke(ConstFunctor(), 3, 2)); -} - -TEST(InvokeTest, MutableFunctor) { - MutableFunctor f; - EXPECT_EQ(1, Invoke(f, 3, 2)); - EXPECT_EQ(1, Invoke(MutableFunctor(), 3, 2)); -} - -TEST(InvokeTest, EphemeralFunctor) { - EphemeralFunctor f; - EXPECT_EQ(1, Invoke(std::move(f), 3, 2)); - EXPECT_EQ(1, Invoke(EphemeralFunctor(), 3, 2)); -} - -TEST(InvokeTest, OverloadedFunctor) { - OverloadedFunctor f; - const OverloadedFunctor& cf = f; - - EXPECT_EQ("&", Invoke(f)); - EXPECT_EQ("& 42", Invoke(f, " 42")); - - EXPECT_EQ("const&", Invoke(cf)); - EXPECT_EQ("const& 42", Invoke(cf, " 42")); - - EXPECT_EQ("&&", Invoke(std::move(f))); - EXPECT_EQ("&& 42", Invoke(std::move(f), " 42")); -} - -TEST(InvokeTest, ReferenceWrapper) { - ConstFunctor cf; - MutableFunctor mf; - EXPECT_EQ(1, Invoke(std::cref(cf), 3, 2)); - EXPECT_EQ(1, Invoke(std::ref(cf), 3, 2)); - EXPECT_EQ(1, Invoke(std::ref(mf), 3, 2)); -} - -TEST(InvokeTest, MemberFunction) { - std::unique_ptr p(new Class); - std::unique_ptr cp(new Class); - EXPECT_EQ(1, Invoke(&Class::Method, p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::Method, p.get(), 3, 2)); - - EXPECT_EQ(1, Invoke(&Class::ConstMethod, p, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, p.get(), 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, *p, 3, 2)); - - EXPECT_EQ(1, Invoke(&Class::ConstMethod, cp, 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, cp.get(), 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, *cp, 3, 2)); - - EXPECT_EQ(1, Invoke(&Class::Method, make_unique(), 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, make_unique(), 3, 2)); - EXPECT_EQ(1, Invoke(&Class::ConstMethod, make_unique(), 3, 2)); -} - -TEST(InvokeTest, DataMember) { - std::unique_ptr p(new Class{42}); - std::unique_ptr cp(new Class{42}); - EXPECT_EQ(42, Invoke(&Class::member, p)); - EXPECT_EQ(42, Invoke(&Class::member, *p)); - EXPECT_EQ(42, Invoke(&Class::member, p.get())); - - Invoke(&Class::member, p) = 42; - Invoke(&Class::member, p.get()) = 42; - - EXPECT_EQ(42, Invoke(&Class::member, cp)); - EXPECT_EQ(42, Invoke(&Class::member, *cp)); - EXPECT_EQ(42, Invoke(&Class::member, cp.get())); -} - -TEST(InvokeTest, FlipFlop) { - FlipFlop obj = {42}; - // This call could resolve to (obj.*&FlipFlop::ConstMethod)() or - // ((*obj).*&FlipFlop::ConstMethod)(). We verify that it's the former. - EXPECT_EQ(42, Invoke(&FlipFlop::ConstMethod, obj)); - EXPECT_EQ(42, Invoke(&FlipFlop::member, obj)); -} - -TEST(InvokeTest, SfinaeFriendly) { - CallMaybeWithArg(NoOp); - EXPECT_THAT(CallMaybeWithArg(Factory), ::testing::Pointee(42)); -} - -} // namespace -} // namespace base_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/log_severity.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/log_severity.h deleted file mode 100644 index 5a1d5576c..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/log_severity.h +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_BASE_INTERNAL_LOG_SEVERITY_H_ -#define ABSL_BASE_INTERNAL_LOG_SEVERITY_H_ - -#include -#include - -#include "absl/base/attributes.h" - -namespace absl { - -// Four severity levels are defined. Logging APIs should terminate the program -// when a message is logged at severity `kFatal`; the other levels have no -// special semantics. -enum class LogSeverity : int { - kInfo = 0, - kWarning = 1, - kError = 2, - kFatal = 3, -}; - -// Returns an iterable of all standard `absl::LogSeverity` values, ordered from -// least to most severe. -constexpr std::array LogSeverities() { - return {{absl::LogSeverity::kInfo, absl::LogSeverity::kWarning, - absl::LogSeverity::kError, absl::LogSeverity::kFatal}}; -} - -// Returns the all-caps string representation (e.g. "INFO") of the specified -// severity level if it is one of the normal levels and "UNKNOWN" otherwise. -constexpr const char* LogSeverityName(absl::LogSeverity s) { - return s == absl::LogSeverity::kInfo - ? "INFO" - : s == absl::LogSeverity::kWarning - ? "WARNING" - : s == absl::LogSeverity::kError - ? "ERROR" - : s == absl::LogSeverity::kFatal ? "FATAL" : "UNKNOWN"; -} - -// Values less than `kInfo` normalize to `kInfo`; values greater than `kFatal` -// normalize to `kError` (**NOT** `kFatal`). -constexpr absl::LogSeverity NormalizeLogSeverity(absl::LogSeverity s) { - return s < absl::LogSeverity::kInfo - ? absl::LogSeverity::kInfo - : s > absl::LogSeverity::kFatal ? absl::LogSeverity::kError : s; -} -constexpr absl::LogSeverity NormalizeLogSeverity(int s) { - return NormalizeLogSeverity(static_cast(s)); -} - -// The exact representation of a streamed `absl::LogSeverity` is deliberately -// unspecified; do not rely on it. -std::ostream& operator<<(std::ostream& os, absl::LogSeverity s); - -} // namespace absl - -#endif // ABSL_BASE_INTERNAL_LOG_SEVERITY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/log_severity_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/log_severity_test.cc deleted file mode 100644 index 1de2d101b..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/log_severity_test.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/log_severity.h" - -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -namespace { -using testing::Eq; - -std::string StreamHelper(absl::LogSeverity value) { - std::ostringstream stream; - stream << value; - return stream.str(); -} - -TEST(StreamTest, Works) { - EXPECT_THAT(StreamHelper(static_cast(-100)), - Eq("absl::LogSeverity(-100)")); - EXPECT_THAT(StreamHelper(absl::LogSeverity::kInfo), Eq("INFO")); - EXPECT_THAT(StreamHelper(absl::LogSeverity::kWarning), Eq("WARNING")); - EXPECT_THAT(StreamHelper(absl::LogSeverity::kError), Eq("ERROR")); - EXPECT_THAT(StreamHelper(absl::LogSeverity::kFatal), Eq("FATAL")); - EXPECT_THAT(StreamHelper(static_cast(4)), - Eq("absl::LogSeverity(4)")); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/raw_logging_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/raw_logging_test.cc deleted file mode 100644 index 3d30bd386..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/raw_logging_test.cc +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This test serves primarily as a compilation test for base/raw_logging.h. -// Raw logging testing is covered by logging_unittest.cc, which is not as -// portable as this test. - -#include "absl/base/internal/raw_logging.h" - -#include - -#include "gtest/gtest.h" -#include "absl/strings/str_cat.h" - -namespace { - -TEST(RawLoggingCompilationTest, Log) { - ABSL_RAW_LOG(INFO, "RAW INFO: %d", 1); - ABSL_RAW_LOG(INFO, "RAW INFO: %d %d", 1, 2); - ABSL_RAW_LOG(INFO, "RAW INFO: %d %d %d", 1, 2, 3); - ABSL_RAW_LOG(INFO, "RAW INFO: %d %d %d %d", 1, 2, 3, 4); - ABSL_RAW_LOG(INFO, "RAW INFO: %d %d %d %d %d", 1, 2, 3, 4, 5); - ABSL_RAW_LOG(WARNING, "RAW WARNING: %d", 1); - ABSL_RAW_LOG(ERROR, "RAW ERROR: %d", 1); -} - -TEST(RawLoggingCompilationTest, PassingCheck) { - ABSL_RAW_CHECK(true, "RAW CHECK"); -} - -// Not all platforms support output from raw log, so we don't verify any -// particular output for RAW check failures (expecting the empty string -// accomplishes this). This test is primarily a compilation test, but we -// are verifying process death when EXPECT_DEATH works for a platform. -const char kExpectedDeathOutput[] = ""; - -TEST(RawLoggingDeathTest, FailingCheck) { - EXPECT_DEATH_IF_SUPPORTED(ABSL_RAW_CHECK(1 == 0, "explanation"), - kExpectedDeathOutput); -} - -TEST(RawLoggingDeathTest, LogFatal) { - EXPECT_DEATH_IF_SUPPORTED(ABSL_RAW_LOG(FATAL, "my dog has fleas"), - kExpectedDeathOutput); -} - -TEST(InternalLog, CompilationTest) { - ABSL_INTERNAL_LOG(INFO, "Internal Log"); - std::string log_msg = "Internal Log"; - ABSL_INTERNAL_LOG(INFO, log_msg); - - ABSL_INTERNAL_LOG(INFO, log_msg + " 2"); - - float d = 1.1f; - ABSL_INTERNAL_LOG(INFO, absl::StrCat("Internal log ", 3, " + ", d)); -} - -TEST(InternalLogDeathTest, FailingCheck) { - EXPECT_DEATH_IF_SUPPORTED(ABSL_INTERNAL_CHECK(1 == 0, "explanation"), - kExpectedDeathOutput); -} - -TEST(InternalLogDeathTest, LogFatal) { - EXPECT_DEATH_IF_SUPPORTED(ABSL_INTERNAL_LOG(FATAL, "my dog has fleas"), - kExpectedDeathOutput); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/spinlock_test_common.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/spinlock_test_common.cc deleted file mode 100644 index e62b2eaeb..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/spinlock_test_common.cc +++ /dev/null @@ -1,269 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// A bunch of threads repeatedly hash an array of ints protected by a -// spinlock. If the spinlock is working properly, all elements of the -// array should be equal at the end of the test. - -#include -#include -#include -#include // NOLINT(build/c++11) -#include - -#include "gtest/gtest.h" -#include "absl/base/attributes.h" -#include "absl/base/internal/low_level_scheduling.h" -#include "absl/base/internal/scheduling_mode.h" -#include "absl/base/internal/spinlock.h" -#include "absl/base/internal/sysinfo.h" -#include "absl/base/macros.h" -#include "absl/synchronization/blocking_counter.h" -#include "absl/synchronization/notification.h" - -constexpr int32_t kNumThreads = 10; -constexpr int32_t kIters = 1000; - -namespace absl { -namespace base_internal { - -// This is defined outside of anonymous namespace so that it can be -// a friend of SpinLock to access protected methods for testing. -struct SpinLockTest { - static uint32_t EncodeWaitCycles(int64_t wait_start_time, - int64_t wait_end_time) { - return SpinLock::EncodeWaitCycles(wait_start_time, wait_end_time); - } - static uint64_t DecodeWaitCycles(uint32_t lock_value) { - return SpinLock::DecodeWaitCycles(lock_value); - } -}; - -namespace { - -static constexpr int kArrayLength = 10; -static uint32_t values[kArrayLength]; - -static SpinLock static_spinlock(base_internal::kLinkerInitialized); -static SpinLock static_cooperative_spinlock( - base_internal::kLinkerInitialized, - base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL); -static SpinLock static_noncooperative_spinlock( - base_internal::kLinkerInitialized, base_internal::SCHEDULE_KERNEL_ONLY); - - -// Simple integer hash function based on the public domain lookup2 hash. -// http://burtleburtle.net/bob/c/lookup2.c -static uint32_t Hash32(uint32_t a, uint32_t c) { - uint32_t b = 0x9e3779b9UL; // The golden ratio; an arbitrary value. - a -= b; a -= c; a ^= (c >> 13); - b -= c; b -= a; b ^= (a << 8); - c -= a; c -= b; c ^= (b >> 13); - a -= b; a -= c; a ^= (c >> 12); - b -= c; b -= a; b ^= (a << 16); - c -= a; c -= b; c ^= (b >> 5); - a -= b; a -= c; a ^= (c >> 3); - b -= c; b -= a; b ^= (a << 10); - c -= a; c -= b; c ^= (b >> 15); - return c; -} - -static void TestFunction(int thread_salt, SpinLock* spinlock) { - for (int i = 0; i < kIters; i++) { - SpinLockHolder h(spinlock); - for (int j = 0; j < kArrayLength; j++) { - const int index = (j + thread_salt) % kArrayLength; - values[index] = Hash32(values[index], thread_salt); - std::this_thread::yield(); - } - } -} - -static void ThreadedTest(SpinLock* spinlock) { - std::vector threads; - for (int i = 0; i < kNumThreads; ++i) { - threads.push_back(std::thread(TestFunction, i, spinlock)); - } - for (auto& thread : threads) { - thread.join(); - } - - SpinLockHolder h(spinlock); - for (int i = 1; i < kArrayLength; i++) { - EXPECT_EQ(values[0], values[i]); - } -} - -TEST(SpinLock, StackNonCooperativeDisablesScheduling) { - SpinLock spinlock(base_internal::SCHEDULE_KERNEL_ONLY); - spinlock.Lock(); - EXPECT_FALSE(base_internal::SchedulingGuard::ReschedulingIsAllowed()); - spinlock.Unlock(); -} - -TEST(SpinLock, StaticNonCooperativeDisablesScheduling) { - static_noncooperative_spinlock.Lock(); - EXPECT_FALSE(base_internal::SchedulingGuard::ReschedulingIsAllowed()); - static_noncooperative_spinlock.Unlock(); -} - -TEST(SpinLock, WaitCyclesEncoding) { - // These are implementation details not exported by SpinLock. - const int kProfileTimestampShift = 7; - const int kLockwordReservedShift = 3; - const uint32_t kSpinLockSleeper = 8; - - // We should be able to encode up to (1^kMaxCycleBits - 1) without clamping - // but the lower kProfileTimestampShift will be dropped. - const int kMaxCyclesShift = - 32 - kLockwordReservedShift + kProfileTimestampShift; - const uint64_t kMaxCycles = (int64_t{1} << kMaxCyclesShift) - 1; - - // These bits should be zero after encoding. - const uint32_t kLockwordReservedMask = (1 << kLockwordReservedShift) - 1; - - // These bits are dropped when wait cycles are encoded. - const uint64_t kProfileTimestampMask = (1 << kProfileTimestampShift) - 1; - - // Test a bunch of random values - std::default_random_engine generator; - // Shift to avoid overflow below. - std::uniform_int_distribution time_distribution( - 0, std::numeric_limits::max() >> 4); - std::uniform_int_distribution cycle_distribution(0, kMaxCycles); - - for (int i = 0; i < 100; i++) { - int64_t start_time = time_distribution(generator); - int64_t cycles = cycle_distribution(generator); - int64_t end_time = start_time + cycles; - uint32_t lock_value = SpinLockTest::EncodeWaitCycles(start_time, end_time); - EXPECT_EQ(0, lock_value & kLockwordReservedMask); - uint64_t decoded = SpinLockTest::DecodeWaitCycles(lock_value); - EXPECT_EQ(0, decoded & kProfileTimestampMask); - EXPECT_EQ(cycles & ~kProfileTimestampMask, decoded); - } - - // Test corner cases - int64_t start_time = time_distribution(generator); - EXPECT_EQ(kSpinLockSleeper, - SpinLockTest::EncodeWaitCycles(start_time, start_time)); - EXPECT_EQ(0, SpinLockTest::DecodeWaitCycles(0)); - EXPECT_EQ(0, SpinLockTest::DecodeWaitCycles(kLockwordReservedMask)); - EXPECT_EQ(kMaxCycles & ~kProfileTimestampMask, - SpinLockTest::DecodeWaitCycles(~kLockwordReservedMask)); - - // Check that we cannot produce kSpinLockSleeper during encoding. - int64_t sleeper_cycles = - kSpinLockSleeper << (kProfileTimestampShift - kLockwordReservedShift); - uint32_t sleeper_value = - SpinLockTest::EncodeWaitCycles(start_time, start_time + sleeper_cycles); - EXPECT_NE(sleeper_value, kSpinLockSleeper); - - // Test clamping - uint32_t max_value = - SpinLockTest::EncodeWaitCycles(start_time, start_time + kMaxCycles); - uint64_t max_value_decoded = SpinLockTest::DecodeWaitCycles(max_value); - uint64_t expected_max_value_decoded = kMaxCycles & ~kProfileTimestampMask; - EXPECT_EQ(expected_max_value_decoded, max_value_decoded); - - const int64_t step = (1 << kProfileTimestampShift); - uint32_t after_max_value = - SpinLockTest::EncodeWaitCycles(start_time, start_time + kMaxCycles + step); - uint64_t after_max_value_decoded = - SpinLockTest::DecodeWaitCycles(after_max_value); - EXPECT_EQ(expected_max_value_decoded, after_max_value_decoded); - - uint32_t before_max_value = SpinLockTest::EncodeWaitCycles( - start_time, start_time + kMaxCycles - step); - uint64_t before_max_value_decoded = - SpinLockTest::DecodeWaitCycles(before_max_value); - EXPECT_GT(expected_max_value_decoded, before_max_value_decoded); -} - -TEST(SpinLockWithThreads, StaticSpinLock) { - ThreadedTest(&static_spinlock); -} -TEST(SpinLockWithThreads, StackSpinLock) { - SpinLock spinlock; - ThreadedTest(&spinlock); -} - -TEST(SpinLockWithThreads, StackCooperativeSpinLock) { - SpinLock spinlock(base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL); - ThreadedTest(&spinlock); -} - -TEST(SpinLockWithThreads, StackNonCooperativeSpinLock) { - SpinLock spinlock(base_internal::SCHEDULE_KERNEL_ONLY); - ThreadedTest(&spinlock); -} - -TEST(SpinLockWithThreads, StaticCooperativeSpinLock) { - ThreadedTest(&static_cooperative_spinlock); -} - -TEST(SpinLockWithThreads, StaticNonCooperativeSpinLock) { - ThreadedTest(&static_noncooperative_spinlock); -} - -TEST(SpinLockWithThreads, DoesNotDeadlock) { - struct Helper { - static void NotifyThenLock(Notification* locked, SpinLock* spinlock, - BlockingCounter* b) { - locked->WaitForNotification(); // Wait for LockThenWait() to hold "s". - b->DecrementCount(); - SpinLockHolder l(spinlock); - } - - static void LockThenWait(Notification* locked, SpinLock* spinlock, - BlockingCounter* b) { - SpinLockHolder l(spinlock); - locked->Notify(); - b->Wait(); - } - - static void DeadlockTest(SpinLock* spinlock, int num_spinners) { - Notification locked; - BlockingCounter counter(num_spinners); - std::vector threads; - - threads.push_back( - std::thread(Helper::LockThenWait, &locked, spinlock, &counter)); - for (int i = 0; i < num_spinners; ++i) { - threads.push_back( - std::thread(Helper::NotifyThenLock, &locked, spinlock, &counter)); - } - - for (auto& thread : threads) { - thread.join(); - } - } - }; - - SpinLock stack_cooperative_spinlock( - base_internal::SCHEDULE_COOPERATIVE_AND_KERNEL); - SpinLock stack_noncooperative_spinlock(base_internal::SCHEDULE_KERNEL_ONLY); - Helper::DeadlockTest(&stack_cooperative_spinlock, - base_internal::NumCPUs() * 2); - Helper::DeadlockTest(&stack_noncooperative_spinlock, - base_internal::NumCPUs() * 2); - Helper::DeadlockTest(&static_cooperative_spinlock, - base_internal::NumCPUs() * 2); - Helper::DeadlockTest(&static_noncooperative_spinlock, - base_internal::NumCPUs() * 2); -} - -} // namespace -} // namespace base_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/thread_annotations.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/thread_annotations.h deleted file mode 100644 index 0b2c306cc..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/thread_annotations.h +++ /dev/null @@ -1,267 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: thread_annotations.h -// ----------------------------------------------------------------------------- -// -// This header file contains macro definitions for thread safety annotations -// that allow developers to document the locking policies of multi-threaded -// code. The annotations can also help program analysis tools to identify -// potential thread safety issues. -// -// These annotations are implemented using compiler attributes. Using the macros -// defined here instead of raw attributes allow for portability and future -// compatibility. -// -// When referring to mutexes in the arguments of the attributes, you should -// use variable names or more complex expressions (e.g. my_object->mutex_) -// that evaluate to a concrete mutex object whenever possible. If the mutex -// you want to refer to is not in scope, you may use a member pointer -// (e.g. &MyClass::mutex_) to refer to a mutex in some (unknown) object. - -#ifndef ABSL_BASE_THREAD_ANNOTATIONS_H_ -#define ABSL_BASE_THREAD_ANNOTATIONS_H_ - -#if defined(__clang__) -#define THREAD_ANNOTATION_ATTRIBUTE__(x) __attribute__((x)) -#else -#define THREAD_ANNOTATION_ATTRIBUTE__(x) // no-op -#endif - -// GUARDED_BY() -// -// Documents if a shared field or global variable needs to be protected by a -// mutex. GUARDED_BY() allows the user to specify a particular mutex that -// should be held when accessing the annotated variable. -// -// Although this annotation (and PT_GUARDED_BY, below) cannot be applied to -// local variables, a local variable and its associated mutex can often be -// combined into a small class or struct, thereby allowing the annotation. -// -// Example: -// -// class Foo { -// Mutex mu_; -// int p1_ GUARDED_BY(mu_); -// ... -// }; -#define GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(guarded_by(x)) - -// PT_GUARDED_BY() -// -// Documents if the memory location pointed to by a pointer should be guarded -// by a mutex when dereferencing the pointer. -// -// Example: -// class Foo { -// Mutex mu_; -// int *p1_ PT_GUARDED_BY(mu_); -// ... -// }; -// -// Note that a pointer variable to a shared memory location could itself be a -// shared variable. -// -// Example: -// -// // `q_`, guarded by `mu1_`, points to a shared memory location that is -// // guarded by `mu2_`: -// int *q_ GUARDED_BY(mu1_) PT_GUARDED_BY(mu2_); -#define PT_GUARDED_BY(x) THREAD_ANNOTATION_ATTRIBUTE__(pt_guarded_by(x)) - -// ACQUIRED_AFTER() / ACQUIRED_BEFORE() -// -// Documents the acquisition order between locks that can be held -// simultaneously by a thread. For any two locks that need to be annotated -// to establish an acquisition order, only one of them needs the annotation. -// (i.e. You don't have to annotate both locks with both ACQUIRED_AFTER -// and ACQUIRED_BEFORE.) -// -// As with GUARDED_BY, this is only applicable to mutexes that are shared -// fields or global variables. -// -// Example: -// -// Mutex m1_; -// Mutex m2_ ACQUIRED_AFTER(m1_); -#define ACQUIRED_AFTER(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(acquired_after(__VA_ARGS__)) - -#define ACQUIRED_BEFORE(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(acquired_before(__VA_ARGS__)) - -// EXCLUSIVE_LOCKS_REQUIRED() / SHARED_LOCKS_REQUIRED() -// -// Documents a function that expects a mutex to be held prior to entry. -// The mutex is expected to be held both on entry to, and exit from, the -// function. -// -// An exclusive lock allows read-write access to the guarded data member(s), and -// only one thread can acquire a lock exclusively at any one time. A shared lock -// allows read-only access, and any number of threads can acquire a shared lock -// concurrently. -// -// Generally, non-const methods should be annotated with -// EXCLUSIVE_LOCKS_REQUIRED, while const methods should be annotated with -// SHARED_LOCKS_REQUIRED. -// -// Example: -// -// Mutex mu1, mu2; -// int a GUARDED_BY(mu1); -// int b GUARDED_BY(mu2); -// -// void foo() EXCLUSIVE_LOCKS_REQUIRED(mu1, mu2) { ... } -// void bar() const SHARED_LOCKS_REQUIRED(mu1, mu2) { ... } -#define EXCLUSIVE_LOCKS_REQUIRED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_locks_required(__VA_ARGS__)) - -#define SHARED_LOCKS_REQUIRED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_locks_required(__VA_ARGS__)) - -// LOCKS_EXCLUDED() -// -// Documents the locks acquired in the body of the function. These locks -// cannot be held when calling this function (as Abseil's `Mutex` locks are -// non-reentrant). -#define LOCKS_EXCLUDED(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(locks_excluded(__VA_ARGS__)) - -// LOCK_RETURNED() -// -// Documents a function that returns a mutex without acquiring it. For example, -// a public getter method that returns a pointer to a private mutex should -// be annotated with LOCK_RETURNED. -#define LOCK_RETURNED(x) \ - THREAD_ANNOTATION_ATTRIBUTE__(lock_returned(x)) - -// LOCKABLE -// -// Documents if a class/type is a lockable type (such as the `Mutex` class). -#define LOCKABLE \ - THREAD_ANNOTATION_ATTRIBUTE__(lockable) - -// SCOPED_LOCKABLE -// -// Documents if a class does RAII locking (such as the `MutexLock` class). -// The constructor should use `LOCK_FUNCTION()` to specify the mutex that is -// acquired, and the destructor should use `UNLOCK_FUNCTION()` with no -// arguments; the analysis will assume that the destructor unlocks whatever the -// constructor locked. -#define SCOPED_LOCKABLE \ - THREAD_ANNOTATION_ATTRIBUTE__(scoped_lockable) - -// EXCLUSIVE_LOCK_FUNCTION() -// -// Documents functions that acquire a lock in the body of a function, and do -// not release it. -#define EXCLUSIVE_LOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_lock_function(__VA_ARGS__)) - -// SHARED_LOCK_FUNCTION() -// -// Documents functions that acquire a shared (reader) lock in the body of a -// function, and do not release it. -#define SHARED_LOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_lock_function(__VA_ARGS__)) - -// UNLOCK_FUNCTION() -// -// Documents functions that expect a lock to be held on entry to the function, -// and release it in the body of the function. -#define UNLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(unlock_function(__VA_ARGS__)) - -// EXCLUSIVE_TRYLOCK_FUNCTION() / SHARED_TRYLOCK_FUNCTION() -// -// Documents functions that try to acquire a lock, and return success or failure -// (or a non-boolean value that can be interpreted as a boolean). -// The first argument should be `true` for functions that return `true` on -// success, or `false` for functions that return `false` on success. The second -// argument specifies the mutex that is locked on success. If unspecified, this -// mutex is assumed to be `this`. -#define EXCLUSIVE_TRYLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(exclusive_trylock_function(__VA_ARGS__)) - -#define SHARED_TRYLOCK_FUNCTION(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(shared_trylock_function(__VA_ARGS__)) - -// ASSERT_EXCLUSIVE_LOCK() / ASSERT_SHARED_LOCK() -// -// Documents functions that dynamically check to see if a lock is held, and fail -// if it is not held. -#define ASSERT_EXCLUSIVE_LOCK(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(assert_exclusive_lock(__VA_ARGS__)) - -#define ASSERT_SHARED_LOCK(...) \ - THREAD_ANNOTATION_ATTRIBUTE__(assert_shared_lock(__VA_ARGS__)) - -// NO_THREAD_SAFETY_ANALYSIS -// -// Turns off thread safety checking within the body of a particular function. -// This annotation is used to mark functions that are known to be correct, but -// the locking behavior is more complicated than the analyzer can handle. -#define NO_THREAD_SAFETY_ANALYSIS \ - THREAD_ANNOTATION_ATTRIBUTE__(no_thread_safety_analysis) - -//------------------------------------------------------------------------------ -// Tool-Supplied Annotations -//------------------------------------------------------------------------------ - -// TS_UNCHECKED should be placed around lock expressions that are not valid -// C++ syntax, but which are present for documentation purposes. These -// annotations will be ignored by the analysis. -#define TS_UNCHECKED(x) "" - -// TS_FIXME is used to mark lock expressions that are not valid C++ syntax. -// It is used by automated tools to mark and disable invalid expressions. -// The annotation should either be fixed, or changed to TS_UNCHECKED. -#define TS_FIXME(x) "" - -// Like NO_THREAD_SAFETY_ANALYSIS, this turns off checking within the body of -// a particular function. However, this attribute is used to mark functions -// that are incorrect and need to be fixed. It is used by automated tools to -// avoid breaking the build when the analysis is updated. -// Code owners are expected to eventually fix the routine. -#define NO_THREAD_SAFETY_ANALYSIS_FIXME NO_THREAD_SAFETY_ANALYSIS - -// Similar to NO_THREAD_SAFETY_ANALYSIS_FIXME, this macro marks a GUARDED_BY -// annotation that needs to be fixed, because it is producing thread safety -// warning. It disables the GUARDED_BY. -#define GUARDED_BY_FIXME(x) - -// Disables warnings for a single read operation. This can be used to avoid -// warnings when it is known that the read is not actually involved in a race, -// but the compiler cannot confirm that. -#define TS_UNCHECKED_READ(x) thread_safety_analysis::ts_unchecked_read(x) - - -namespace thread_safety_analysis { - -// Takes a reference to a guarded data member, and returns an unguarded -// reference. -template -inline const T& ts_unchecked_read(const T& v) NO_THREAD_SAFETY_ANALYSIS { - return v; -} - -template -inline T& ts_unchecked_read(T& v) NO_THREAD_SAFETY_ANALYSIS { - return v; -} - -} // namespace thread_safety_analysis - -#endif // ABSL_BASE_THREAD_ANNOTATIONS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/throw_delegate_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/throw_delegate_test.cc deleted file mode 100644 index a74dd3cda..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/base/throw_delegate_test.cc +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/base/internal/throw_delegate.h" - -#include -#include -#include - -#include "gtest/gtest.h" - -namespace { - -using absl::base_internal::ThrowStdLogicError; -using absl::base_internal::ThrowStdInvalidArgument; -using absl::base_internal::ThrowStdDomainError; -using absl::base_internal::ThrowStdLengthError; -using absl::base_internal::ThrowStdOutOfRange; -using absl::base_internal::ThrowStdRuntimeError; -using absl::base_internal::ThrowStdRangeError; -using absl::base_internal::ThrowStdOverflowError; -using absl::base_internal::ThrowStdUnderflowError; -using absl::base_internal::ThrowStdBadFunctionCall; -using absl::base_internal::ThrowStdBadAlloc; - -constexpr const char* what_arg = "The quick brown fox jumps over the lazy dog"; - -template -void ExpectThrowChar(void (*f)(const char*)) { - try { - f(what_arg); - FAIL() << "Didn't throw"; - } catch (const E& e) { - EXPECT_STREQ(e.what(), what_arg); - } -} - -template -void ExpectThrowString(void (*f)(const std::string&)) { - try { - f(what_arg); - FAIL() << "Didn't throw"; - } catch (const E& e) { - EXPECT_STREQ(e.what(), what_arg); - } -} - -template -void ExpectThrowNoWhat(void (*f)()) { - try { - f(); - FAIL() << "Didn't throw"; - } catch (const E& e) { - } -} - -TEST(ThrowHelper, Test) { - // Not using EXPECT_THROW because we want to check the .what() message too. - ExpectThrowChar(ThrowStdLogicError); - ExpectThrowChar(ThrowStdInvalidArgument); - ExpectThrowChar(ThrowStdDomainError); - ExpectThrowChar(ThrowStdLengthError); - ExpectThrowChar(ThrowStdOutOfRange); - ExpectThrowChar(ThrowStdRuntimeError); - ExpectThrowChar(ThrowStdRangeError); - ExpectThrowChar(ThrowStdOverflowError); - ExpectThrowChar(ThrowStdUnderflowError); - - ExpectThrowString(ThrowStdLogicError); - ExpectThrowString(ThrowStdInvalidArgument); - ExpectThrowString(ThrowStdDomainError); - ExpectThrowString(ThrowStdLengthError); - ExpectThrowString(ThrowStdOutOfRange); - ExpectThrowString(ThrowStdRuntimeError); - ExpectThrowString(ThrowStdRangeError); - ExpectThrowString(ThrowStdOverflowError); - ExpectThrowString(ThrowStdUnderflowError); - - ExpectThrowNoWhat(ThrowStdBadFunctionCall); - ExpectThrowNoWhat(ThrowStdBadAlloc); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/compiler_config_setting.bzl b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/compiler_config_setting.bzl deleted file mode 100644 index 66962294d..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/compiler_config_setting.bzl +++ /dev/null @@ -1,38 +0,0 @@ -# -# Copyright 2018 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Creates config_setting that allows selecting based on 'compiler' value.""" - -def create_llvm_config(name, visibility): - # The "do_not_use_tools_cpp_compiler_present" attribute exists to - # distinguish between older versions of Bazel that do not support - # "@bazel_tools//tools/cpp:compiler" flag_value, and newer ones that do. - # In the future, the only way to select on the compiler will be through - # flag_values{"@bazel_tools//tools/cpp:compiler"} and the else branch can - # be removed. - if hasattr(cc_common, "do_not_use_tools_cpp_compiler_present"): - native.config_setting( - name = name, - flag_values = { - "@bazel_tools//tools/cpp:compiler": "llvm", - }, - visibility = visibility, - ) - else: - native.config_setting( - name = name, - values = {"compiler": "llvm"}, - visibility = visibility, - ) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/BUILD.bazel b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/BUILD.bazel deleted file mode 100644 index f25a9ff96..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/BUILD.bazel +++ /dev/null @@ -1,807 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -load( - "//absl:copts/configure_copts.bzl", - "ABSL_DEFAULT_COPTS", - "ABSL_DEFAULT_LINKOPTS", - "ABSL_EXCEPTIONS_FLAG", - "ABSL_EXCEPTIONS_FLAG_LINKOPTS", - "ABSL_TEST_COPTS", -) - -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) # Apache 2.0 - -cc_library( - name = "compressed_tuple", - hdrs = ["internal/compressed_tuple.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/utility", - ], -) - -cc_test( - name = "compressed_tuple_test", - srcs = ["internal/compressed_tuple_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":compressed_tuple", - "//absl/memory", - "//absl/utility", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "fixed_array", - hdrs = ["fixed_array.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":compressed_tuple", - "//absl/algorithm", - "//absl/base:core_headers", - "//absl/base:dynamic_annotations", - "//absl/base:throw_delegate", - "//absl/memory", - ], -) - -cc_test( - name = "fixed_array_test", - srcs = ["fixed_array_test.cc"], - copts = ABSL_TEST_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":fixed_array", - "//absl/base:exception_testing", - "//absl/hash:hash_testing", - "//absl/memory", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "fixed_array_test_noexceptions", - srcs = ["fixed_array_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":fixed_array", - "//absl/base:exception_testing", - "//absl/hash:hash_testing", - "//absl/memory", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "fixed_array_exception_safety_test", - srcs = ["fixed_array_exception_safety_test.cc"], - copts = ABSL_TEST_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":fixed_array", - "//absl/base:exception_safety_testing", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "fixed_array_benchmark", - srcs = ["fixed_array_benchmark.cc"], - copts = ABSL_TEST_COPTS + ["$(STACK_FRAME_UNLIMITED)"], - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = ["benchmark"], - deps = [ - ":fixed_array", - "@com_github_google_benchmark//:benchmark_main", - ], -) - -cc_library( - name = "inlined_vector_internal", - hdrs = ["internal/inlined_vector.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":compressed_tuple", - "//absl/meta:type_traits", - ], -) - -cc_library( - name = "inlined_vector", - hdrs = ["inlined_vector.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":inlined_vector_internal", - "//absl/algorithm", - "//absl/base:core_headers", - "//absl/base:throw_delegate", - "//absl/memory", - ], -) - -cc_library( - name = "counting_allocator", - testonly = 1, - hdrs = ["internal/counting_allocator.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = ["//visibility:private"], -) - -cc_test( - name = "inlined_vector_test", - srcs = ["inlined_vector_test.cc"], - copts = ABSL_TEST_COPTS + ABSL_EXCEPTIONS_FLAG, - linkopts = ABSL_EXCEPTIONS_FLAG_LINKOPTS + ABSL_DEFAULT_LINKOPTS, - deps = [ - ":counting_allocator", - ":inlined_vector", - ":test_instance_tracker", - "//absl/base", - "//absl/base:core_headers", - "//absl/base:exception_testing", - "//absl/hash:hash_testing", - "//absl/memory", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "inlined_vector_test_noexceptions", - srcs = ["inlined_vector_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":counting_allocator", - ":inlined_vector", - ":test_instance_tracker", - "//absl/base", - "//absl/base:core_headers", - "//absl/base:exception_testing", - "//absl/hash:hash_testing", - "//absl/memory", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "inlined_vector_benchmark", - srcs = ["inlined_vector_benchmark.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = ["benchmark"], - deps = [ - ":inlined_vector", - "//absl/base", - "//absl/strings", - "@com_github_google_benchmark//:benchmark_main", - ], -) - -cc_library( - name = "test_instance_tracker", - testonly = 1, - srcs = ["internal/test_instance_tracker.cc"], - hdrs = ["internal/test_instance_tracker.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = [ - "//absl:__subpackages__", - ], -) - -cc_test( - name = "test_instance_tracker_test", - srcs = ["internal/test_instance_tracker_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":test_instance_tracker", - "@com_google_googletest//:gtest_main", - ], -) - -NOTEST_TAGS_NONMOBILE = [ - "no_test_darwin_x86_64", - "no_test_loonix", -] - -NOTEST_TAGS_MOBILE = [ - "no_test_android_arm", - "no_test_android_arm64", - "no_test_android_x86", - "no_test_ios_x86_64", -] - -NOTEST_TAGS = NOTEST_TAGS_MOBILE + NOTEST_TAGS_NONMOBILE - -cc_library( - name = "flat_hash_map", - hdrs = ["flat_hash_map.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":container_memory", - ":hash_function_defaults", - ":raw_hash_map", - "//absl/algorithm:container", - "//absl/memory", - ], -) - -cc_test( - name = "flat_hash_map_test", - srcs = ["flat_hash_map_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":flat_hash_map", - ":hash_generator_testing", - ":unordered_map_constructor_test", - ":unordered_map_lookup_test", - ":unordered_map_members_test", - ":unordered_map_modifiers_test", - "//absl/types:any", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "flat_hash_set", - hdrs = ["flat_hash_set.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":container_memory", - ":hash_function_defaults", - ":raw_hash_set", - "//absl/algorithm:container", - "//absl/base:core_headers", - "//absl/memory", - ], -) - -cc_test( - name = "flat_hash_set_test", - srcs = ["flat_hash_set_test.cc"], - copts = ABSL_TEST_COPTS + ["-DUNORDERED_SET_CXX17"], - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":flat_hash_set", - ":hash_generator_testing", - ":unordered_set_constructor_test", - ":unordered_set_lookup_test", - ":unordered_set_members_test", - ":unordered_set_modifiers_test", - "//absl/memory", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "node_hash_map", - hdrs = ["node_hash_map.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":container_memory", - ":hash_function_defaults", - ":node_hash_policy", - ":raw_hash_map", - "//absl/algorithm:container", - "//absl/memory", - ], -) - -cc_test( - name = "node_hash_map_test", - srcs = ["node_hash_map_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":hash_generator_testing", - ":node_hash_map", - ":tracked", - ":unordered_map_constructor_test", - ":unordered_map_lookup_test", - ":unordered_map_members_test", - ":unordered_map_modifiers_test", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "node_hash_set", - hdrs = ["node_hash_set.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_function_defaults", - ":node_hash_policy", - ":raw_hash_set", - "//absl/algorithm:container", - "//absl/memory", - ], -) - -cc_test( - name = "node_hash_set_test", - srcs = ["node_hash_set_test.cc"], - copts = ABSL_TEST_COPTS + ["-DUNORDERED_SET_CXX17"], - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":node_hash_set", - ":unordered_set_constructor_test", - ":unordered_set_lookup_test", - ":unordered_set_members_test", - ":unordered_set_modifiers_test", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "container_memory", - hdrs = ["internal/container_memory.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/memory", - "//absl/utility", - ], -) - -cc_test( - name = "container_memory_test", - srcs = ["internal/container_memory_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":container_memory", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "hash_function_defaults", - hdrs = ["internal/hash_function_defaults.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/base:config", - "//absl/hash", - "//absl/strings", - ], -) - -cc_test( - name = "hash_function_defaults_test", - srcs = ["internal/hash_function_defaults_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS, - deps = [ - ":hash_function_defaults", - "//absl/hash", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "hash_generator_testing", - testonly = 1, - srcs = ["internal/hash_generator_testing.cc"], - hdrs = ["internal/hash_generator_testing.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_policy_testing", - "//absl/meta:type_traits", - "//absl/strings", - ], -) - -cc_library( - name = "hash_policy_testing", - testonly = 1, - hdrs = ["internal/hash_policy_testing.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/hash", - "//absl/strings", - ], -) - -cc_test( - name = "hash_policy_testing_test", - srcs = ["internal/hash_policy_testing_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_policy_testing", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "hash_policy_traits", - hdrs = ["internal/hash_policy_traits.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = ["//absl/meta:type_traits"], -) - -cc_test( - name = "hash_policy_traits_test", - srcs = ["internal/hash_policy_traits_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_policy_traits", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "hashtable_debug", - hdrs = ["internal/hashtable_debug.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hashtable_debug_hooks", - ], -) - -cc_library( - name = "hashtable_debug_hooks", - hdrs = ["internal/hashtable_debug_hooks.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, -) - -cc_library( - name = "hashtablez_sampler", - srcs = [ - "internal/hashtablez_sampler.cc", - "internal/hashtablez_sampler_force_weak_definition.cc", - ], - hdrs = ["internal/hashtablez_sampler.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":have_sse", - "//absl/base", - "//absl/base:core_headers", - "//absl/debugging:stacktrace", - "//absl/memory", - "//absl/synchronization", - "//absl/utility", - ], -) - -cc_test( - name = "hashtablez_sampler_test", - srcs = ["internal/hashtablez_sampler_test.cc"], - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hashtablez_sampler", - ":have_sse", - "//absl/base:core_headers", - "//absl/synchronization", - "//absl/synchronization:thread_pool", - "//absl/time", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "node_hash_policy", - hdrs = ["internal/node_hash_policy.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, -) - -cc_test( - name = "node_hash_policy_test", - srcs = ["internal/node_hash_policy_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_policy_traits", - ":node_hash_policy", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "raw_hash_map", - hdrs = ["internal/raw_hash_map.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":container_memory", - ":raw_hash_set", - ], -) - -cc_library( - name = "have_sse", - hdrs = ["internal/have_sse.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - visibility = ["//visibility:private"], -) - -cc_library( - name = "common", - hdrs = ["internal/common.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/meta:type_traits", - "//absl/types:optional", - ], -) - -cc_library( - name = "raw_hash_set", - srcs = ["internal/raw_hash_set.cc"], - hdrs = ["internal/raw_hash_set.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":common", - ":compressed_tuple", - ":container_memory", - ":hash_policy_traits", - ":hashtable_debug_hooks", - ":hashtablez_sampler", - ":have_sse", - ":layout", - "//absl/base:bits", - "//absl/base:config", - "//absl/base:core_headers", - "//absl/base:endian", - "//absl/memory", - "//absl/meta:type_traits", - "//absl/utility", - ], -) - -cc_test( - name = "raw_hash_set_test", - srcs = ["internal/raw_hash_set_test.cc"], - copts = ABSL_TEST_COPTS, - linkstatic = 1, - tags = NOTEST_TAGS, - deps = [ - ":container_memory", - ":hash_function_defaults", - ":hash_policy_testing", - ":hashtable_debug", - ":raw_hash_set", - "//absl/base", - "//absl/base:core_headers", - "//absl/strings", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "raw_hash_set_allocator_test", - size = "small", - srcs = ["internal/raw_hash_set_allocator_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":raw_hash_set", - ":tracked", - "//absl/base:core_headers", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "layout", - hdrs = ["internal/layout.h"], - copts = ABSL_DEFAULT_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/base:core_headers", - "//absl/meta:type_traits", - "//absl/strings", - "//absl/types:span", - "//absl/utility", - ], -) - -cc_test( - name = "layout_test", - size = "small", - srcs = ["internal/layout_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS, - visibility = ["//visibility:private"], - deps = [ - ":layout", - "//absl/base", - "//absl/base:core_headers", - "//absl/types:span", - "@com_google_googletest//:gtest_main", - ], -) - -cc_library( - name = "tracked", - testonly = 1, - hdrs = ["internal/tracked.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, -) - -cc_library( - name = "unordered_map_constructor_test", - testonly = 1, - hdrs = ["internal/unordered_map_constructor_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_generator_testing", - ":hash_policy_testing", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_map_lookup_test", - testonly = 1, - hdrs = ["internal/unordered_map_lookup_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_generator_testing", - ":hash_policy_testing", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_map_modifiers_test", - testonly = 1, - hdrs = ["internal/unordered_map_modifiers_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_generator_testing", - ":hash_policy_testing", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_set_constructor_test", - testonly = 1, - hdrs = ["internal/unordered_set_constructor_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_generator_testing", - ":hash_policy_testing", - "//absl/meta:type_traits", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_set_members_test", - testonly = 1, - hdrs = ["internal/unordered_set_members_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/meta:type_traits", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_map_members_test", - testonly = 1, - hdrs = ["internal/unordered_map_members_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - "//absl/meta:type_traits", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_set_lookup_test", - testonly = 1, - hdrs = ["internal/unordered_set_lookup_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_generator_testing", - ":hash_policy_testing", - "@com_google_googletest//:gtest", - ], -) - -cc_library( - name = "unordered_set_modifiers_test", - testonly = 1, - hdrs = ["internal/unordered_set_modifiers_test.h"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - deps = [ - ":hash_generator_testing", - ":hash_policy_testing", - "@com_google_googletest//:gtest", - ], -) - -cc_test( - name = "unordered_set_test", - srcs = ["internal/unordered_set_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":unordered_set_constructor_test", - ":unordered_set_lookup_test", - ":unordered_set_members_test", - ":unordered_set_modifiers_test", - "@com_google_googletest//:gtest_main", - ], -) - -cc_test( - name = "unordered_map_test", - srcs = ["internal/unordered_map_test.cc"], - copts = ABSL_TEST_COPTS, - linkopts = ABSL_DEFAULT_LINKOPTS, - tags = NOTEST_TAGS_NONMOBILE, - deps = [ - ":unordered_map_constructor_test", - ":unordered_map_lookup_test", - ":unordered_map_members_test", - ":unordered_map_modifiers_test", - "@com_google_googletest//:gtest_main", - ], -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/CMakeLists.txt b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/CMakeLists.txt deleted file mode 100644 index 9531d7f92..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/CMakeLists.txt +++ /dev/null @@ -1,828 +0,0 @@ -# -# Copyright 2017 The Abseil Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# This is deprecated and will be removed in the future. It also doesn't do -# anything anyways. Prefer to use the library associated with the API you are -# using. -absl_cc_library( - NAME - container - PUBLIC -) - -absl_cc_library( - NAME - compressed_tuple - HDRS - "internal/compressed_tuple.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::utility - PUBLIC -) - -absl_cc_test( - NAME - compressed_tuple_test - SRCS - "internal/compressed_tuple_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::compressed_tuple - absl::memory - absl::utility - gmock_main -) - -absl_cc_library( - NAME - fixed_array - HDRS - "fixed_array.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::compressed_tuple - absl::algorithm - absl::core_headers - absl::dynamic_annotations - absl::throw_delegate - absl::memory - PUBLIC -) - -absl_cc_test( - NAME - fixed_array_test - SRCS - "fixed_array_test.cc" - COPTS - ${ABSL_TEST_COPTS} - ${ABSL_EXCEPTIONS_FLAG} - LINKOPTS - ${ABSL_EXCEPTIONS_FLAG_LINKOPTS} - DEPS - absl::fixed_array - absl::exception_testing - absl::hash_testing - absl::memory - gmock_main -) - -absl_cc_test( - NAME - fixed_array_test_noexceptions - SRCS - "fixed_array_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::fixed_array - absl::exception_testing - absl::hash_testing - absl::memory - gmock_main -) - -absl_cc_test( - NAME - fixed_array_exception_safety_test - SRCS - "fixed_array_exception_safety_test.cc" - COPTS - ${ABSL_TEST_COPTS} - ${ABSL_EXCEPTIONS_FLAG} - LINKOPTS - ${ABSL_EXCEPTIONS_FLAG_LINKOPTS} - DEPS - absl::fixed_array - absl::exception_safety_testing - gmock_main -) - -absl_cc_library( - NAME - inlined_vector_internal - HDRS - "internal/inlined_vector.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::compressed_tuple - absl::type_traits - PUBLIC -) - -absl_cc_library( - NAME - inlined_vector - HDRS - "inlined_vector.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::algorithm - absl::core_headers - absl::inlined_vector_internal - absl::throw_delegate - absl::memory - PUBLIC -) - -absl_cc_library( - NAME - counting_allocator - HDRS - "internal/counting_allocator.h" - COPTS - ${ABSL_DEFAULT_COPTS} -) - -absl_cc_test( - NAME - inlined_vector_test - SRCS - "inlined_vector_test.cc" - COPTS - ${ABSL_TEST_COPTS} - ${ABSL_EXCEPTIONS_FLAG} - LINKOPTS - ${ABSL_EXCEPTIONS_FLAG_LINKOPTS} - DEPS - absl::counting_allocator - absl::inlined_vector - absl::test_instance_tracker - absl::base - absl::core_headers - absl::exception_testing - absl::hash_testing - absl::memory - absl::strings - gmock_main -) - -absl_cc_test( - NAME - inlined_vector_test_noexceptions - SRCS - "inlined_vector_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::inlined_vector - absl::test_instance_tracker - absl::base - absl::core_headers - absl::exception_testing - absl::hash_testing - absl::memory - absl::strings - gmock_main -) - -absl_cc_library( - NAME - test_instance_tracker - HDRS - "internal/test_instance_tracker.h" - SRCS - "internal/test_instance_tracker.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - TESTONLY -) - -absl_cc_test( - NAME - test_instance_tracker_test - SRCS - "internal/test_instance_tracker_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::test_instance_tracker - gmock_main -) - -absl_cc_library( - NAME - flat_hash_map - HDRS - "flat_hash_map.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::container_memory - absl::hash_function_defaults - absl::raw_hash_map - absl::algorithm_container - absl::memory - PUBLIC -) - -absl_cc_test( - NAME - flat_hash_map_test - SRCS - "flat_hash_map_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::flat_hash_map - absl::hash_generator_testing - absl::unordered_map_constructor_test - absl::unordered_map_lookup_test - absl::unordered_map_members_test - absl::unordered_map_modifiers_test - absl::any - gmock_main -) - -absl_cc_library( - NAME - flat_hash_set - HDRS - "flat_hash_set.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::container_memory - absl::hash_function_defaults - absl::raw_hash_set - absl::algorithm_container - absl::core_headers - absl::memory - PUBLIC -) - -absl_cc_test( - NAME - flat_hash_set_test - SRCS - "flat_hash_set_test.cc" - COPTS - ${ABSL_TEST_COPTS} - "-DUNORDERED_SET_CXX17" - DEPS - absl::flat_hash_set - absl::hash_generator_testing - absl::unordered_set_constructor_test - absl::unordered_set_lookup_test - absl::unordered_set_members_test - absl::unordered_set_modifiers_test - absl::memory - absl::strings - gmock_main -) - -absl_cc_library( - NAME - node_hash_map - HDRS - "node_hash_map.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::container_memory - absl::hash_function_defaults - absl::node_hash_policy - absl::raw_hash_map - absl::algorithm_container - absl::memory - PUBLIC -) - -absl_cc_test( - NAME - node_hash_map_test - SRCS - "node_hash_map_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::node_hash_map - absl::tracked - absl::unordered_map_constructor_test - absl::unordered_map_lookup_test - absl::unordered_map_members_test - absl::unordered_map_modifiers_test - gmock_main -) - -absl_cc_library( - NAME - node_hash_set - HDRS - "node_hash_set.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::hash_function_defaults - absl::node_hash_policy - absl::raw_hash_set - absl::algorithm_container - absl::memory - PUBLIC -) - -absl_cc_test( - NAME - node_hash_set_test - SRCS - "node_hash_set_test.cc" - COPTS - ${ABSL_TEST_COPTS} - "-DUNORDERED_SET_CXX17" - DEPS - absl::hash_generator_testing - absl::node_hash_set - absl::unordered_set_constructor_test - absl::unordered_set_lookup_test - absl::unordered_set_members_test - absl::unordered_set_modifiers_test - gmock_main -) - -absl_cc_library( - NAME - container_memory - HDRS - "internal/container_memory.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::memory - absl::utility - PUBLIC -) - -absl_cc_test( - NAME - container_memory_test - SRCS - "internal/container_memory_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::container_memory - absl::strings - gmock_main -) - -absl_cc_library( - NAME - hash_function_defaults - HDRS - "internal/hash_function_defaults.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::config - absl::hash - absl::strings - PUBLIC -) - -absl_cc_test( - NAME - hash_function_defaults_test - SRCS - "internal/hash_function_defaults_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_function_defaults - absl::hash - absl::strings - gmock_main -) - -absl_cc_library( - NAME - hash_generator_testing - HDRS - "internal/hash_generator_testing.h" - SRCS - "internal/hash_generator_testing.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_policy_testing - absl::meta - absl::strings - TESTONLY -) - -absl_cc_library( - NAME - hash_policy_testing - HDRS - "internal/hash_policy_testing.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash - absl::strings - TESTONLY -) - -absl_cc_test( - NAME - hash_policy_testing_test - SRCS - "internal/hash_policy_testing_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_policy_testing - gmock_main -) - -absl_cc_library( - NAME - hash_policy_traits - HDRS - "internal/hash_policy_traits.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::meta - PUBLIC -) - -absl_cc_test( - NAME - hash_policy_traits_test - SRCS - "internal/hash_policy_traits_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_policy_traits - gmock_main -) - -absl_cc_library( - NAME - hashtablez_sampler - HDRS - "internal/hashtablez_sampler.h" - SRCS - "internal/hashtablez_sampler.cc" - "internal/hashtablez_sampler_force_weak_definition.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::base - absl::have_sse - absl::synchronization -) - -absl_cc_test( - NAME - hashtablez_sampler_test - SRCS - "internal/hashtablez_sampler_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hashtablez_sampler - absl::have_sse - gmock_main -) - -absl_cc_library( - NAME - hashtable_debug - HDRS - "internal/hashtable_debug.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::hashtable_debug_hooks -) - -absl_cc_library( - NAME - hashtable_debug_hooks - HDRS - "internal/hashtable_debug_hooks.h" - COPTS - ${ABSL_DEFAULT_COPTS} - PUBLIC -) - -absl_cc_library( - NAME - have_sse - HDRS - "internal/have_sse.h" - COPTS - ${ABSL_DEFAULT_COPTS} -) - -absl_cc_library( - NAME - node_hash_policy - HDRS - "internal/node_hash_policy.h" - COPTS - ${ABSL_DEFAULT_COPTS} - PUBLIC -) - -absl_cc_test( - NAME - node_hash_policy_test - SRCS - "internal/node_hash_policy_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_policy_traits - absl::node_hash_policy - gmock_main -) - -absl_cc_library( - NAME - raw_hash_map - HDRS - "internal/raw_hash_map.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::container_memory - absl::raw_hash_set - PUBLIC -) - -absl_cc_library( - NAME - container_common - HDRS - "internal/commom.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::type_traits -) - -absl_cc_library( - NAME - raw_hash_set - HDRS - "internal/raw_hash_set.h" - SRCS - "internal/raw_hash_set.cc" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::bits - absl::compressed_tuple - absl::config - absl::container_common - absl::container_memory - absl::core_headers - absl::endian - absl::hash_policy_traits - absl::hashtable_debug_hooks - absl::have_sse - absl::layout - absl::memory - absl::meta - absl::optional - absl::utility - absl::hashtablez_sampler - PUBLIC -) - -absl_cc_test( - NAME - raw_hash_set_test - SRCS - "internal/raw_hash_set_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::container_memory - absl::hash_function_defaults - absl::hash_policy_testing - absl::hashtable_debug - absl::raw_hash_set - absl::base - absl::core_headers - absl::strings - gmock_main -) - -absl_cc_test( - NAME - raw_hash_set_allocator_test - SRCS - "internal/raw_hash_set_allocator_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::raw_hash_set - absl::tracked - absl::core_headers - gmock_main -) - -absl_cc_library( - NAME - layout - HDRS - "internal/layout.h" - COPTS - ${ABSL_DEFAULT_COPTS} - DEPS - absl::core_headers - absl::meta - absl::strings - absl::span - absl::utility - PUBLIC -) - -absl_cc_test( - NAME - layout_test - SRCS - "internal/layout_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::layout - absl::base - absl::core_headers - absl::span - gmock_main -) - -absl_cc_library( - NAME - tracked - HDRS - "internal/tracked.h" - COPTS - ${ABSL_TEST_COPTS} - TESTONLY -) - -absl_cc_library( - NAME - unordered_map_constructor_test - HDRS - "internal/unordered_map_constructor_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::hash_policy_testing - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_map_lookup_test - HDRS - "internal/unordered_map_lookup_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::hash_policy_testing - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_map_members_test - HDRS - "internal/unordered_map_members_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::type_traits - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_map_modifiers_test - HDRS - "internal/unordered_map_modifiers_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::hash_policy_testing - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_set_constructor_test - HDRS - "internal/unordered_set_constructor_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::hash_policy_testing - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_set_lookup_test - HDRS - "internal/unordered_set_lookup_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::hash_policy_testing - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_set_members_test - HDRS - "internal/unordered_set_members_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::type_traits - gmock - TESTONLY -) - -absl_cc_library( - NAME - unordered_set_modifiers_test - HDRS - "internal/unordered_set_modifiers_test.h" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::hash_generator_testing - absl::hash_policy_testing - gmock - TESTONLY -) - -absl_cc_test( - NAME - unordered_set_test - SRCS - "internal/unordered_set_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::unordered_set_constructor_test - absl::unordered_set_lookup_test - absl::unordered_set_members_test - absl::unordered_set_modifiers_test - gmock_main -) - -absl_cc_test( - NAME - unordered_map_test - SRCS - "internal/unordered_map_test.cc" - COPTS - ${ABSL_TEST_COPTS} - DEPS - absl::unordered_map_constructor_test - absl::unordered_map_lookup_test - absl::unordered_map_members_test - absl::unordered_map_modifiers_test - gmock_main -) diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array.h deleted file mode 100644 index 2a8240ae7..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array.h +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: fixed_array.h -// ----------------------------------------------------------------------------- -// -// A `FixedArray` represents a non-resizable array of `T` where the length of -// the array can be determined at run-time. It is a good replacement for -// non-standard and deprecated uses of `alloca()` and variable length arrays -// within the GCC extension. (See -// https://gcc.gnu.org/onlinedocs/gcc/Variable-Length.html). -// -// `FixedArray` allocates small arrays inline, keeping performance fast by -// avoiding heap operations. It also helps reduce the chances of -// accidentally overflowing your stack if large input is passed to -// your function. - -#ifndef ABSL_CONTAINER_FIXED_ARRAY_H_ -#define ABSL_CONTAINER_FIXED_ARRAY_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "absl/algorithm/algorithm.h" -#include "absl/base/dynamic_annotations.h" -#include "absl/base/internal/throw_delegate.h" -#include "absl/base/macros.h" -#include "absl/base/optimization.h" -#include "absl/base/port.h" -#include "absl/container/internal/compressed_tuple.h" -#include "absl/memory/memory.h" - -namespace absl { - -constexpr static auto kFixedArrayUseDefault = static_cast(-1); - -// ----------------------------------------------------------------------------- -// FixedArray -// ----------------------------------------------------------------------------- -// -// A `FixedArray` provides a run-time fixed-size array, allocating a small array -// inline for efficiency. -// -// Most users should not specify an `inline_elements` argument and let -// `FixedArray` automatically determine the number of elements -// to store inline based on `sizeof(T)`. If `inline_elements` is specified, the -// `FixedArray` implementation will use inline storage for arrays with a -// length <= `inline_elements`. -// -// Note that a `FixedArray` constructed with a `size_type` argument will -// default-initialize its values by leaving trivially constructible types -// uninitialized (e.g. int, int[4], double), and others default-constructed. -// This matches the behavior of c-style arrays and `std::array`, but not -// `std::vector`. -// -// Note that `FixedArray` does not provide a public allocator; if it requires a -// heap allocation, it will do so with global `::operator new[]()` and -// `::operator delete[]()`, even if T provides class-scope overrides for these -// operators. -template > -class FixedArray { - static_assert(!std::is_array::value || std::extent::value > 0, - "Arrays with unknown bounds cannot be used with FixedArray."); - - static constexpr size_t kInlineBytesDefault = 256; - - using AllocatorTraits = std::allocator_traits; - // std::iterator_traits isn't guaranteed to be SFINAE-friendly until C++17, - // but this seems to be mostly pedantic. - template - using EnableIfForwardIterator = absl::enable_if_t::iterator_category, - std::forward_iterator_tag>::value>; - static constexpr bool NoexceptCopyable() { - return std::is_nothrow_copy_constructible::value && - absl::allocator_is_nothrow::value; - } - static constexpr bool NoexceptMovable() { - return std::is_nothrow_move_constructible::value && - absl::allocator_is_nothrow::value; - } - static constexpr bool DefaultConstructorIsNonTrivial() { - return !absl::is_trivially_default_constructible::value; - } - - public: - using allocator_type = typename AllocatorTraits::allocator_type; - using value_type = typename allocator_type::value_type; - using pointer = typename allocator_type::pointer; - using const_pointer = typename allocator_type::const_pointer; - using reference = typename allocator_type::reference; - using const_reference = typename allocator_type::const_reference; - using size_type = typename allocator_type::size_type; - using difference_type = typename allocator_type::difference_type; - using iterator = pointer; - using const_iterator = const_pointer; - using reverse_iterator = std::reverse_iterator; - using const_reverse_iterator = std::reverse_iterator; - - static constexpr size_type inline_elements = - (N == kFixedArrayUseDefault ? kInlineBytesDefault / sizeof(value_type) - : static_cast(N)); - - FixedArray( - const FixedArray& other, - const allocator_type& a = allocator_type()) noexcept(NoexceptCopyable()) - : FixedArray(other.begin(), other.end(), a) {} - - FixedArray( - FixedArray&& other, - const allocator_type& a = allocator_type()) noexcept(NoexceptMovable()) - : FixedArray(std::make_move_iterator(other.begin()), - std::make_move_iterator(other.end()), a) {} - - // Creates an array object that can store `n` elements. - // Note that trivially constructible elements will be uninitialized. - explicit FixedArray(size_type n, const allocator_type& a = allocator_type()) - : storage_(n, a) { - if (DefaultConstructorIsNonTrivial()) { - memory_internal::ConstructRange(storage_.alloc(), storage_.begin(), - storage_.end()); - } - } - - // Creates an array initialized with `n` copies of `val`. - FixedArray(size_type n, const value_type& val, - const allocator_type& a = allocator_type()) - : storage_(n, a) { - memory_internal::ConstructRange(storage_.alloc(), storage_.begin(), - storage_.end(), val); - } - - // Creates an array initialized with the size and contents of `init_list`. - FixedArray(std::initializer_list init_list, - const allocator_type& a = allocator_type()) - : FixedArray(init_list.begin(), init_list.end(), a) {} - - // Creates an array initialized with the elements from the input - // range. The array's size will always be `std::distance(first, last)`. - // REQUIRES: Iterator must be a forward_iterator or better. - template * = nullptr> - FixedArray(Iterator first, Iterator last, - const allocator_type& a = allocator_type()) - : storage_(std::distance(first, last), a) { - memory_internal::CopyRange(storage_.alloc(), storage_.begin(), first, last); - } - - ~FixedArray() noexcept { - for (auto* cur = storage_.begin(); cur != storage_.end(); ++cur) { - AllocatorTraits::destroy(storage_.alloc(), cur); - } - } - - // Assignments are deleted because they break the invariant that the size of a - // `FixedArray` never changes. - void operator=(FixedArray&&) = delete; - void operator=(const FixedArray&) = delete; - - // FixedArray::size() - // - // Returns the length of the fixed array. - size_type size() const { return storage_.size(); } - - // FixedArray::max_size() - // - // Returns the largest possible value of `std::distance(begin(), end())` for a - // `FixedArray`. This is equivalent to the most possible addressable bytes - // over the number of bytes taken by T. - constexpr size_type max_size() const { - return (std::numeric_limits::max)() / sizeof(value_type); - } - - // FixedArray::empty() - // - // Returns whether or not the fixed array is empty. - bool empty() const { return size() == 0; } - - // FixedArray::memsize() - // - // Returns the memory size of the fixed array in bytes. - size_t memsize() const { return size() * sizeof(value_type); } - - // FixedArray::data() - // - // Returns a const T* pointer to elements of the `FixedArray`. This pointer - // can be used to access (but not modify) the contained elements. - const_pointer data() const { return AsValueType(storage_.begin()); } - - // Overload of FixedArray::data() to return a T* pointer to elements of the - // fixed array. This pointer can be used to access and modify the contained - // elements. - pointer data() { return AsValueType(storage_.begin()); } - - // FixedArray::operator[] - // - // Returns a reference the ith element of the fixed array. - // REQUIRES: 0 <= i < size() - reference operator[](size_type i) { - assert(i < size()); - return data()[i]; - } - - // Overload of FixedArray::operator()[] to return a const reference to the - // ith element of the fixed array. - // REQUIRES: 0 <= i < size() - const_reference operator[](size_type i) const { - assert(i < size()); - return data()[i]; - } - - // FixedArray::at - // - // Bounds-checked access. Returns a reference to the ith element of the - // fiexed array, or throws std::out_of_range - reference at(size_type i) { - if (ABSL_PREDICT_FALSE(i >= size())) { - base_internal::ThrowStdOutOfRange("FixedArray::at failed bounds check"); - } - return data()[i]; - } - - // Overload of FixedArray::at() to return a const reference to the ith element - // of the fixed array. - const_reference at(size_type i) const { - if (ABSL_PREDICT_FALSE(i >= size())) { - base_internal::ThrowStdOutOfRange("FixedArray::at failed bounds check"); - } - return data()[i]; - } - - // FixedArray::front() - // - // Returns a reference to the first element of the fixed array. - reference front() { return *begin(); } - - // Overload of FixedArray::front() to return a reference to the first element - // of a fixed array of const values. - const_reference front() const { return *begin(); } - - // FixedArray::back() - // - // Returns a reference to the last element of the fixed array. - reference back() { return *(end() - 1); } - - // Overload of FixedArray::back() to return a reference to the last element - // of a fixed array of const values. - const_reference back() const { return *(end() - 1); } - - // FixedArray::begin() - // - // Returns an iterator to the beginning of the fixed array. - iterator begin() { return data(); } - - // Overload of FixedArray::begin() to return a const iterator to the - // beginning of the fixed array. - const_iterator begin() const { return data(); } - - // FixedArray::cbegin() - // - // Returns a const iterator to the beginning of the fixed array. - const_iterator cbegin() const { return begin(); } - - // FixedArray::end() - // - // Returns an iterator to the end of the fixed array. - iterator end() { return data() + size(); } - - // Overload of FixedArray::end() to return a const iterator to the end of the - // fixed array. - const_iterator end() const { return data() + size(); } - - // FixedArray::cend() - // - // Returns a const iterator to the end of the fixed array. - const_iterator cend() const { return end(); } - - // FixedArray::rbegin() - // - // Returns a reverse iterator from the end of the fixed array. - reverse_iterator rbegin() { return reverse_iterator(end()); } - - // Overload of FixedArray::rbegin() to return a const reverse iterator from - // the end of the fixed array. - const_reverse_iterator rbegin() const { - return const_reverse_iterator(end()); - } - - // FixedArray::crbegin() - // - // Returns a const reverse iterator from the end of the fixed array. - const_reverse_iterator crbegin() const { return rbegin(); } - - // FixedArray::rend() - // - // Returns a reverse iterator from the beginning of the fixed array. - reverse_iterator rend() { return reverse_iterator(begin()); } - - // Overload of FixedArray::rend() for returning a const reverse iterator - // from the beginning of the fixed array. - const_reverse_iterator rend() const { - return const_reverse_iterator(begin()); - } - - // FixedArray::crend() - // - // Returns a reverse iterator from the beginning of the fixed array. - const_reverse_iterator crend() const { return rend(); } - - // FixedArray::fill() - // - // Assigns the given `value` to all elements in the fixed array. - void fill(const value_type& val) { std::fill(begin(), end(), val); } - - // Relational operators. Equality operators are elementwise using - // `operator==`, while order operators order FixedArrays lexicographically. - friend bool operator==(const FixedArray& lhs, const FixedArray& rhs) { - return absl::equal(lhs.begin(), lhs.end(), rhs.begin(), rhs.end()); - } - - friend bool operator!=(const FixedArray& lhs, const FixedArray& rhs) { - return !(lhs == rhs); - } - - friend bool operator<(const FixedArray& lhs, const FixedArray& rhs) { - return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), - rhs.end()); - } - - friend bool operator>(const FixedArray& lhs, const FixedArray& rhs) { - return rhs < lhs; - } - - friend bool operator<=(const FixedArray& lhs, const FixedArray& rhs) { - return !(rhs < lhs); - } - - friend bool operator>=(const FixedArray& lhs, const FixedArray& rhs) { - return !(lhs < rhs); - } - - template - friend H AbslHashValue(H h, const FixedArray& v) { - return H::combine(H::combine_contiguous(std::move(h), v.data(), v.size()), - v.size()); - } - - private: - // StorageElement - // - // For FixedArrays with a C-style-array value_type, StorageElement is a POD - // wrapper struct called StorageElementWrapper that holds the value_type - // instance inside. This is needed for construction and destruction of the - // entire array regardless of how many dimensions it has. For all other cases, - // StorageElement is just an alias of value_type. - // - // Maintainer's Note: The simpler solution would be to simply wrap value_type - // in a struct whether it's an array or not. That causes some paranoid - // diagnostics to misfire, believing that 'data()' returns a pointer to a - // single element, rather than the packed array that it really is. - // e.g.: - // - // FixedArray buf(1); - // sprintf(buf.data(), "foo"); - // - // error: call to int __builtin___sprintf_chk(etc...) - // will always overflow destination buffer [-Werror] - // - template , - size_t InnerN = std::extent::value> - struct StorageElementWrapper { - InnerT array[InnerN]; - }; - - using StorageElement = - absl::conditional_t::value, - StorageElementWrapper, value_type>; - using StorageElementBuffer = - absl::aligned_storage_t; - - static pointer AsValueType(pointer ptr) { return ptr; } - static pointer AsValueType(StorageElementWrapper* ptr) { - return std::addressof(ptr->array); - } - - static_assert(sizeof(StorageElement) == sizeof(value_type), ""); - static_assert(alignof(StorageElement) == alignof(value_type), ""); - - struct NonEmptyInlinedStorage { - StorageElement* data() { - return reinterpret_cast(inlined_storage_.data()); - } - -#ifdef ADDRESS_SANITIZER - void* RedzoneBegin() { return &redzone_begin_; } - void* RedzoneEnd() { return &redzone_end_ + 1; } -#endif // ADDRESS_SANITIZER - - void AnnotateConstruct(size_type); - void AnnotateDestruct(size_type); - - ADDRESS_SANITIZER_REDZONE(redzone_begin_); - std::array inlined_storage_; - ADDRESS_SANITIZER_REDZONE(redzone_end_); - }; - - struct EmptyInlinedStorage { - StorageElement* data() { return nullptr; } - void AnnotateConstruct(size_type) {} - void AnnotateDestruct(size_type) {} - }; - - using InlinedStorage = - absl::conditional_t; - - // Storage - // - // An instance of Storage manages the inline and out-of-line memory for - // instances of FixedArray. This guarantees that even when construction of - // individual elements fails in the FixedArray constructor body, the - // destructor for Storage will still be called and out-of-line memory will be - // properly deallocated. - // - class Storage : public InlinedStorage { - public: - Storage(size_type n, const allocator_type& a) - : size_alloc_(n, a), data_(InitializeData()) {} - - ~Storage() noexcept { - if (UsingInlinedStorage(size())) { - InlinedStorage::AnnotateDestruct(size()); - } else { - AllocatorTraits::deallocate(alloc(), AsValueType(begin()), size()); - } - } - - size_type size() const { return size_alloc_.template get<0>(); } - StorageElement* begin() const { return data_; } - StorageElement* end() const { return begin() + size(); } - allocator_type& alloc() { - return size_alloc_.template get<1>(); - } - - private: - static bool UsingInlinedStorage(size_type n) { - return n <= inline_elements; - } - - StorageElement* InitializeData() { - if (UsingInlinedStorage(size())) { - InlinedStorage::AnnotateConstruct(size()); - return InlinedStorage::data(); - } else { - return reinterpret_cast( - AllocatorTraits::allocate(alloc(), size())); - } - } - - // `CompressedTuple` takes advantage of EBCO for stateless `allocator_type`s - container_internal::CompressedTuple size_alloc_; - StorageElement* data_; - }; - - Storage storage_; -}; - -template -constexpr size_t FixedArray::kInlineBytesDefault; - -template -constexpr typename FixedArray::size_type - FixedArray::inline_elements; - -template -void FixedArray::NonEmptyInlinedStorage::AnnotateConstruct( - typename FixedArray::size_type n) { -#ifdef ADDRESS_SANITIZER - if (!n) return; - ANNOTATE_CONTIGUOUS_CONTAINER(data(), RedzoneEnd(), RedzoneEnd(), data() + n); - ANNOTATE_CONTIGUOUS_CONTAINER(RedzoneBegin(), data(), data(), RedzoneBegin()); -#endif // ADDRESS_SANITIZER - static_cast(n); // Mark used when not in asan mode -} - -template -void FixedArray::NonEmptyInlinedStorage::AnnotateDestruct( - typename FixedArray::size_type n) { -#ifdef ADDRESS_SANITIZER - if (!n) return; - ANNOTATE_CONTIGUOUS_CONTAINER(data(), RedzoneEnd(), data() + n, RedzoneEnd()); - ANNOTATE_CONTIGUOUS_CONTAINER(RedzoneBegin(), data(), RedzoneBegin(), data()); -#endif // ADDRESS_SANITIZER - static_cast(n); // Mark used when not in asan mode -} -} // namespace absl - -#endif // ABSL_CONTAINER_FIXED_ARRAY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_benchmark.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_benchmark.cc deleted file mode 100644 index ff56f466c..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_benchmark.cc +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/fixed_array.h" - -#include -#include - -#include "benchmark/benchmark.h" - -namespace { - -// For benchmarking -- simple class with constructor and destructor that -// set an int to a constant.. -class SimpleClass { - public: - SimpleClass() : i(3) { } - ~SimpleClass() { i = 0; } - private: - int i; -}; - -template -void BM_FixedArray(benchmark::State& state) { - const int size = state.range(0); - for (auto _ : state) { - absl::FixedArray fa(size); - benchmark::DoNotOptimize(fa.data()); - } -} -BENCHMARK_TEMPLATE(BM_FixedArray, char, absl::kFixedArrayUseDefault) - ->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, char, 0)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, char, 1)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, char, 16)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, char, 256)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, char, 65536)->Range(0, 1 << 16); - -BENCHMARK_TEMPLATE(BM_FixedArray, SimpleClass, absl::kFixedArrayUseDefault) - ->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, SimpleClass, 0)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, SimpleClass, 1)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, SimpleClass, 16)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, SimpleClass, 256)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, SimpleClass, 65536)->Range(0, 1 << 16); - -BENCHMARK_TEMPLATE(BM_FixedArray, std::string, absl::kFixedArrayUseDefault) - ->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, std::string, 0)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, std::string, 1)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, std::string, 16)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, std::string, 256)->Range(0, 1 << 16); -BENCHMARK_TEMPLATE(BM_FixedArray, std::string, 65536)->Range(0, 1 << 16); - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_exception_safety_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_exception_safety_test.cc deleted file mode 100644 index 826eca612..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_exception_safety_test.cc +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include - -#include "absl/container/fixed_array.h" - -#include "gtest/gtest.h" -#include "absl/base/internal/exception_safety_testing.h" - -namespace absl { - -namespace { - -constexpr size_t kInlined = 25; -constexpr size_t kSmallSize = kInlined / 2; -constexpr size_t kLargeSize = kInlined * 2; - -constexpr int kInitialValue = 5; -constexpr int kUpdatedValue = 10; - -using ::testing::TestThrowingCtor; - -using Thrower = testing::ThrowingValue; -using FixedArr = absl::FixedArray; - -using MoveThrower = testing::ThrowingValue; -using MoveFixedArr = absl::FixedArray; - -TEST(FixedArrayExceptionSafety, CopyConstructor) { - auto small = FixedArr(kSmallSize); - TestThrowingCtor(small); - - auto large = FixedArr(kLargeSize); - TestThrowingCtor(large); -} - -TEST(FixedArrayExceptionSafety, MoveConstructor) { - TestThrowingCtor(FixedArr(kSmallSize)); - TestThrowingCtor(FixedArr(kLargeSize)); - - // TypeSpec::kNoThrowMove - TestThrowingCtor(MoveFixedArr(kSmallSize)); - TestThrowingCtor(MoveFixedArr(kLargeSize)); -} - -TEST(FixedArrayExceptionSafety, SizeConstructor) { - TestThrowingCtor(kSmallSize); - TestThrowingCtor(kLargeSize); -} - -TEST(FixedArrayExceptionSafety, SizeValueConstructor) { - TestThrowingCtor(kSmallSize, Thrower()); - TestThrowingCtor(kLargeSize, Thrower()); -} - -TEST(FixedArrayExceptionSafety, IteratorConstructor) { - auto small = FixedArr(kSmallSize); - TestThrowingCtor(small.begin(), small.end()); - - auto large = FixedArr(kLargeSize); - TestThrowingCtor(large.begin(), large.end()); -} - -TEST(FixedArrayExceptionSafety, InitListConstructor) { - constexpr int small_inlined = 3; - using SmallFixedArr = absl::FixedArray; - - TestThrowingCtor(std::initializer_list{}); - // Test inlined allocation - TestThrowingCtor( - std::initializer_list{Thrower{}, Thrower{}}); - // Test out of line allocation - TestThrowingCtor(std::initializer_list{ - Thrower{}, Thrower{}, Thrower{}, Thrower{}, Thrower{}}); -} - -testing::AssertionResult ReadMemory(FixedArr* fixed_arr) { - // Marked volatile to prevent optimization. Used for running asan tests. - volatile int sum = 0; - for (const auto& thrower : *fixed_arr) { - sum += thrower.Get(); - } - return testing::AssertionSuccess() << "Values sum to [" << sum << "]"; -} - -TEST(FixedArrayExceptionSafety, Fill) { - auto test_fill = testing::MakeExceptionSafetyTester() - .WithContracts(ReadMemory) - .WithOperation([&](FixedArr* fixed_arr_ptr) { - auto thrower = - Thrower(kUpdatedValue, testing::nothrow_ctor); - fixed_arr_ptr->fill(thrower); - }); - - EXPECT_TRUE( - test_fill.WithInitialValue(FixedArr(kSmallSize, Thrower(kInitialValue))) - .Test()); - EXPECT_TRUE( - test_fill.WithInitialValue(FixedArr(kLargeSize, Thrower(kInitialValue))) - .Test()); -} - -} // namespace - -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_test.cc deleted file mode 100644 index a4f2498b7..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/fixed_array_test.cc +++ /dev/null @@ -1,890 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/fixed_array.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/base/internal/exception_testing.h" -#include "absl/hash/hash_testing.h" -#include "absl/memory/memory.h" - -using ::testing::ElementsAreArray; - -namespace { - -// Helper routine to determine if a absl::FixedArray used stack allocation. -template -static bool IsOnStack(const ArrayType& a) { - return a.size() <= ArrayType::inline_elements; -} - -class ConstructionTester { - public: - ConstructionTester() - : self_ptr_(this), - value_(0) { - constructions++; - } - ~ConstructionTester() { - assert(self_ptr_ == this); - self_ptr_ = nullptr; - destructions++; - } - - // These are incremented as elements are constructed and destructed so we can - // be sure all elements are properly cleaned up. - static int constructions; - static int destructions; - - void CheckConstructed() { - assert(self_ptr_ == this); - } - - void set(int value) { value_ = value; } - int get() { return value_; } - - private: - // self_ptr_ should always point to 'this' -- that's how we can be sure the - // constructor has been called. - ConstructionTester* self_ptr_; - int value_; -}; - -int ConstructionTester::constructions = 0; -int ConstructionTester::destructions = 0; - -// ThreeInts will initialize its three ints to the value stored in -// ThreeInts::counter. The constructor increments counter so that each object -// in an array of ThreeInts will have different values. -class ThreeInts { - public: - ThreeInts() { - x_ = counter; - y_ = counter; - z_ = counter; - ++counter; - } - - static int counter; - - int x_, y_, z_; -}; - -int ThreeInts::counter = 0; - -TEST(FixedArrayTest, CopyCtor) { - absl::FixedArray on_stack(5); - std::iota(on_stack.begin(), on_stack.end(), 0); - absl::FixedArray stack_copy = on_stack; - EXPECT_THAT(stack_copy, ElementsAreArray(on_stack)); - EXPECT_TRUE(IsOnStack(stack_copy)); - - absl::FixedArray allocated(15); - std::iota(allocated.begin(), allocated.end(), 0); - absl::FixedArray alloced_copy = allocated; - EXPECT_THAT(alloced_copy, ElementsAreArray(allocated)); - EXPECT_FALSE(IsOnStack(alloced_copy)); -} - -TEST(FixedArrayTest, MoveCtor) { - absl::FixedArray, 10> on_stack(5); - for (int i = 0; i < 5; ++i) { - on_stack[i] = absl::make_unique(i); - } - - absl::FixedArray, 10> stack_copy = std::move(on_stack); - for (int i = 0; i < 5; ++i) EXPECT_EQ(*(stack_copy[i]), i); - EXPECT_EQ(stack_copy.size(), on_stack.size()); - - absl::FixedArray, 10> allocated(15); - for (int i = 0; i < 15; ++i) { - allocated[i] = absl::make_unique(i); - } - - absl::FixedArray, 10> alloced_copy = - std::move(allocated); - for (int i = 0; i < 15; ++i) EXPECT_EQ(*(alloced_copy[i]), i); - EXPECT_EQ(allocated.size(), alloced_copy.size()); -} - -TEST(FixedArrayTest, SmallObjects) { - // Small object arrays - { - // Short arrays should be on the stack - absl::FixedArray array(4); - EXPECT_TRUE(IsOnStack(array)); - } - - { - // Large arrays should be on the heap - absl::FixedArray array(1048576); - EXPECT_FALSE(IsOnStack(array)); - } - - { - // Arrays of <= default size should be on the stack - absl::FixedArray array(100); - EXPECT_TRUE(IsOnStack(array)); - } - - { - // Arrays of > default size should be on the heap - absl::FixedArray array(101); - EXPECT_FALSE(IsOnStack(array)); - } - - { - // Arrays with different size elements should use approximately - // same amount of stack space - absl::FixedArray array1(0); - absl::FixedArray array2(0); - EXPECT_LE(sizeof(array1), sizeof(array2)+100); - EXPECT_LE(sizeof(array2), sizeof(array1)+100); - } - - { - // Ensure that vectors are properly constructed inside a fixed array. - absl::FixedArray > array(2); - EXPECT_EQ(0, array[0].size()); - EXPECT_EQ(0, array[1].size()); - } - - { - // Regardless of absl::FixedArray implementation, check that a type with a - // low alignment requirement and a non power-of-two size is initialized - // correctly. - ThreeInts::counter = 1; - absl::FixedArray array(2); - EXPECT_EQ(1, array[0].x_); - EXPECT_EQ(1, array[0].y_); - EXPECT_EQ(1, array[0].z_); - EXPECT_EQ(2, array[1].x_); - EXPECT_EQ(2, array[1].y_); - EXPECT_EQ(2, array[1].z_); - } -} - -TEST(FixedArrayTest, AtThrows) { - absl::FixedArray a = {1, 2, 3}; - EXPECT_EQ(a.at(2), 3); - ABSL_BASE_INTERNAL_EXPECT_FAIL(a.at(3), std::out_of_range, - "failed bounds check"); -} - -TEST(FixedArrayRelationalsTest, EqualArrays) { - for (int i = 0; i < 10; ++i) { - absl::FixedArray a1(i); - std::iota(a1.begin(), a1.end(), 0); - absl::FixedArray a2(a1.begin(), a1.end()); - - EXPECT_TRUE(a1 == a2); - EXPECT_FALSE(a1 != a2); - EXPECT_TRUE(a2 == a1); - EXPECT_FALSE(a2 != a1); - EXPECT_FALSE(a1 < a2); - EXPECT_FALSE(a1 > a2); - EXPECT_FALSE(a2 < a1); - EXPECT_FALSE(a2 > a1); - EXPECT_TRUE(a1 <= a2); - EXPECT_TRUE(a1 >= a2); - EXPECT_TRUE(a2 <= a1); - EXPECT_TRUE(a2 >= a1); - } -} - -TEST(FixedArrayRelationalsTest, UnequalArrays) { - for (int i = 1; i < 10; ++i) { - absl::FixedArray a1(i); - std::iota(a1.begin(), a1.end(), 0); - absl::FixedArray a2(a1.begin(), a1.end()); - --a2[i / 2]; - - EXPECT_FALSE(a1 == a2); - EXPECT_TRUE(a1 != a2); - EXPECT_FALSE(a2 == a1); - EXPECT_TRUE(a2 != a1); - EXPECT_FALSE(a1 < a2); - EXPECT_TRUE(a1 > a2); - EXPECT_TRUE(a2 < a1); - EXPECT_FALSE(a2 > a1); - EXPECT_FALSE(a1 <= a2); - EXPECT_TRUE(a1 >= a2); - EXPECT_TRUE(a2 <= a1); - EXPECT_FALSE(a2 >= a1); - } -} - -template -static void TestArray(int n) { - SCOPED_TRACE(n); - SCOPED_TRACE(stack_elements); - ConstructionTester::constructions = 0; - ConstructionTester::destructions = 0; - { - absl::FixedArray array(n); - - EXPECT_THAT(array.size(), n); - EXPECT_THAT(array.memsize(), sizeof(ConstructionTester) * n); - EXPECT_THAT(array.begin() + n, array.end()); - - // Check that all elements were constructed - for (int i = 0; i < n; i++) { - array[i].CheckConstructed(); - } - // Check that no other elements were constructed - EXPECT_THAT(ConstructionTester::constructions, n); - - // Test operator[] - for (int i = 0; i < n; i++) { - array[i].set(i); - } - for (int i = 0; i < n; i++) { - EXPECT_THAT(array[i].get(), i); - EXPECT_THAT(array.data()[i].get(), i); - } - - // Test data() - for (int i = 0; i < n; i++) { - array.data()[i].set(i + 1); - } - for (int i = 0; i < n; i++) { - EXPECT_THAT(array[i].get(), i+1); - EXPECT_THAT(array.data()[i].get(), i+1); - } - } // Close scope containing 'array'. - - // Check that all constructed elements were destructed. - EXPECT_EQ(ConstructionTester::constructions, - ConstructionTester::destructions); -} - -template -static void TestArrayOfArrays(int n) { - SCOPED_TRACE(n); - SCOPED_TRACE(inline_elements); - SCOPED_TRACE(elements_per_inner_array); - ConstructionTester::constructions = 0; - ConstructionTester::destructions = 0; - { - using InnerArray = ConstructionTester[elements_per_inner_array]; - // Heap-allocate the FixedArray to avoid blowing the stack frame. - auto array_ptr = - absl::make_unique>(n); - auto& array = *array_ptr; - - ASSERT_EQ(array.size(), n); - ASSERT_EQ(array.memsize(), - sizeof(ConstructionTester) * elements_per_inner_array * n); - ASSERT_EQ(array.begin() + n, array.end()); - - // Check that all elements were constructed - for (int i = 0; i < n; i++) { - for (int j = 0; j < elements_per_inner_array; j++) { - (array[i])[j].CheckConstructed(); - } - } - // Check that no other elements were constructed - ASSERT_EQ(ConstructionTester::constructions, n * elements_per_inner_array); - - // Test operator[] - for (int i = 0; i < n; i++) { - for (int j = 0; j < elements_per_inner_array; j++) { - (array[i])[j].set(i * elements_per_inner_array + j); - } - } - for (int i = 0; i < n; i++) { - for (int j = 0; j < elements_per_inner_array; j++) { - ASSERT_EQ((array[i])[j].get(), i * elements_per_inner_array + j); - ASSERT_EQ((array.data()[i])[j].get(), i * elements_per_inner_array + j); - } - } - - // Test data() - for (int i = 0; i < n; i++) { - for (int j = 0; j < elements_per_inner_array; j++) { - (array.data()[i])[j].set((i + 1) * elements_per_inner_array + j); - } - } - for (int i = 0; i < n; i++) { - for (int j = 0; j < elements_per_inner_array; j++) { - ASSERT_EQ((array[i])[j].get(), - (i + 1) * elements_per_inner_array + j); - ASSERT_EQ((array.data()[i])[j].get(), - (i + 1) * elements_per_inner_array + j); - } - } - } // Close scope containing 'array'. - - // Check that all constructed elements were destructed. - EXPECT_EQ(ConstructionTester::constructions, - ConstructionTester::destructions); -} - -TEST(IteratorConstructorTest, NonInline) { - int const kInput[] = { 2, 3, 5, 7, 11, 13, 17 }; - absl::FixedArray const fixed( - kInput, kInput + ABSL_ARRAYSIZE(kInput)); - ASSERT_EQ(ABSL_ARRAYSIZE(kInput), fixed.size()); - for (size_t i = 0; i < ABSL_ARRAYSIZE(kInput); ++i) { - ASSERT_EQ(kInput[i], fixed[i]); - } -} - -TEST(IteratorConstructorTest, Inline) { - int const kInput[] = { 2, 3, 5, 7, 11, 13, 17 }; - absl::FixedArray const fixed( - kInput, kInput + ABSL_ARRAYSIZE(kInput)); - ASSERT_EQ(ABSL_ARRAYSIZE(kInput), fixed.size()); - for (size_t i = 0; i < ABSL_ARRAYSIZE(kInput); ++i) { - ASSERT_EQ(kInput[i], fixed[i]); - } -} - -TEST(IteratorConstructorTest, NonPod) { - char const* kInput[] = - { "red", "orange", "yellow", "green", "blue", "indigo", "violet" }; - absl::FixedArray const fixed(kInput, - kInput + ABSL_ARRAYSIZE(kInput)); - ASSERT_EQ(ABSL_ARRAYSIZE(kInput), fixed.size()); - for (size_t i = 0; i < ABSL_ARRAYSIZE(kInput); ++i) { - ASSERT_EQ(kInput[i], fixed[i]); - } -} - -TEST(IteratorConstructorTest, FromEmptyVector) { - std::vector const empty; - absl::FixedArray const fixed(empty.begin(), empty.end()); - EXPECT_EQ(0, fixed.size()); - EXPECT_EQ(empty.size(), fixed.size()); -} - -TEST(IteratorConstructorTest, FromNonEmptyVector) { - int const kInput[] = { 2, 3, 5, 7, 11, 13, 17 }; - std::vector const items(kInput, kInput + ABSL_ARRAYSIZE(kInput)); - absl::FixedArray const fixed(items.begin(), items.end()); - ASSERT_EQ(items.size(), fixed.size()); - for (size_t i = 0; i < items.size(); ++i) { - ASSERT_EQ(items[i], fixed[i]); - } -} - -TEST(IteratorConstructorTest, FromBidirectionalIteratorRange) { - int const kInput[] = { 2, 3, 5, 7, 11, 13, 17 }; - std::list const items(kInput, kInput + ABSL_ARRAYSIZE(kInput)); - absl::FixedArray const fixed(items.begin(), items.end()); - EXPECT_THAT(fixed, testing::ElementsAreArray(kInput)); -} - -TEST(InitListConstructorTest, InitListConstruction) { - absl::FixedArray fixed = {1, 2, 3}; - EXPECT_THAT(fixed, testing::ElementsAreArray({1, 2, 3})); -} - -TEST(FillConstructorTest, NonEmptyArrays) { - absl::FixedArray stack_array(4, 1); - EXPECT_THAT(stack_array, testing::ElementsAreArray({1, 1, 1, 1})); - - absl::FixedArray heap_array(4, 1); - EXPECT_THAT(stack_array, testing::ElementsAreArray({1, 1, 1, 1})); -} - -TEST(FillConstructorTest, EmptyArray) { - absl::FixedArray empty_fill(0, 1); - absl::FixedArray empty_size(0); - EXPECT_EQ(empty_fill, empty_size); -} - -TEST(FillConstructorTest, NotTriviallyCopyable) { - std::string str = "abcd"; - absl::FixedArray strings = {str, str, str, str}; - - absl::FixedArray array(4, str); - EXPECT_EQ(array, strings); -} - -TEST(FillConstructorTest, Disambiguation) { - absl::FixedArray a(1, 2); - EXPECT_THAT(a, testing::ElementsAre(2)); -} - -TEST(FixedArrayTest, ManySizedArrays) { - std::vector sizes; - for (int i = 1; i < 100; i++) sizes.push_back(i); - for (int i = 100; i <= 1000; i += 100) sizes.push_back(i); - for (int n : sizes) { - TestArray<0>(n); - TestArray<1>(n); - TestArray<64>(n); - TestArray<1000>(n); - } -} - -TEST(FixedArrayTest, ManySizedArraysOfArraysOf1) { - for (int n = 1; n < 1000; n++) { - ASSERT_NO_FATAL_FAILURE((TestArrayOfArrays<1, 0>(n))); - ASSERT_NO_FATAL_FAILURE((TestArrayOfArrays<1, 1>(n))); - ASSERT_NO_FATAL_FAILURE((TestArrayOfArrays<1, 64>(n))); - ASSERT_NO_FATAL_FAILURE((TestArrayOfArrays<1, 1000>(n))); - } -} - -TEST(FixedArrayTest, ManySizedArraysOfArraysOf2) { - for (int n = 1; n < 1000; n++) { - TestArrayOfArrays<2, 0>(n); - TestArrayOfArrays<2, 1>(n); - TestArrayOfArrays<2, 64>(n); - TestArrayOfArrays<2, 1000>(n); - } -} - -// If value_type is put inside of a struct container, -// we might evoke this error in a hardened build unless data() is carefully -// written, so check on that. -// error: call to int __builtin___sprintf_chk(etc...) -// will always overflow destination buffer [-Werror] -TEST(FixedArrayTest, AvoidParanoidDiagnostics) { - absl::FixedArray buf(32); - sprintf(buf.data(), "foo"); // NOLINT(runtime/printf) -} - -TEST(FixedArrayTest, TooBigInlinedSpace) { - struct TooBig { - char c[1 << 20]; - }; // too big for even one on the stack - - // Simulate the data members of absl::FixedArray, a pointer and a size_t. - struct Data { - TooBig* p; - size_t size; - }; - - // Make sure TooBig objects are not inlined for 0 or default size. - static_assert(sizeof(absl::FixedArray) == sizeof(Data), - "0-sized absl::FixedArray should have same size as Data."); - static_assert(alignof(absl::FixedArray) == alignof(Data), - "0-sized absl::FixedArray should have same alignment as Data."); - static_assert(sizeof(absl::FixedArray) == sizeof(Data), - "default-sized absl::FixedArray should have same size as Data"); - static_assert( - alignof(absl::FixedArray) == alignof(Data), - "default-sized absl::FixedArray should have same alignment as Data."); -} - -// PickyDelete EXPECTs its class-scope deallocation funcs are unused. -struct PickyDelete { - PickyDelete() {} - ~PickyDelete() {} - void operator delete(void* p) { - EXPECT_TRUE(false) << __FUNCTION__; - ::operator delete(p); - } - void operator delete[](void* p) { - EXPECT_TRUE(false) << __FUNCTION__; - ::operator delete[](p); - } -}; - -TEST(FixedArrayTest, UsesGlobalAlloc) { absl::FixedArray a(5); } - - -TEST(FixedArrayTest, Data) { - static const int kInput[] = { 2, 3, 5, 7, 11, 13, 17 }; - absl::FixedArray fa(std::begin(kInput), std::end(kInput)); - EXPECT_EQ(fa.data(), &*fa.begin()); - EXPECT_EQ(fa.data(), &fa[0]); - - const absl::FixedArray& cfa = fa; - EXPECT_EQ(cfa.data(), &*cfa.begin()); - EXPECT_EQ(cfa.data(), &cfa[0]); -} - -TEST(FixedArrayTest, Empty) { - absl::FixedArray empty(0); - absl::FixedArray inline_filled(1); - absl::FixedArray heap_filled(1); - EXPECT_TRUE(empty.empty()); - EXPECT_FALSE(inline_filled.empty()); - EXPECT_FALSE(heap_filled.empty()); -} - -TEST(FixedArrayTest, FrontAndBack) { - absl::FixedArray inlined = {1, 2, 3}; - EXPECT_EQ(inlined.front(), 1); - EXPECT_EQ(inlined.back(), 3); - - absl::FixedArray allocated = {1, 2, 3}; - EXPECT_EQ(allocated.front(), 1); - EXPECT_EQ(allocated.back(), 3); - - absl::FixedArray one_element = {1}; - EXPECT_EQ(one_element.front(), one_element.back()); -} - -TEST(FixedArrayTest, ReverseIteratorInlined) { - absl::FixedArray a = {0, 1, 2, 3, 4}; - - int counter = 5; - for (absl::FixedArray::reverse_iterator iter = a.rbegin(); - iter != a.rend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - - counter = 5; - for (absl::FixedArray::const_reverse_iterator iter = a.rbegin(); - iter != a.rend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - - counter = 5; - for (auto iter = a.crbegin(); iter != a.crend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); -} - -TEST(FixedArrayTest, ReverseIteratorAllocated) { - absl::FixedArray a = {0, 1, 2, 3, 4}; - - int counter = 5; - for (absl::FixedArray::reverse_iterator iter = a.rbegin(); - iter != a.rend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - - counter = 5; - for (absl::FixedArray::const_reverse_iterator iter = a.rbegin(); - iter != a.rend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - - counter = 5; - for (auto iter = a.crbegin(); iter != a.crend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); -} - -TEST(FixedArrayTest, Fill) { - absl::FixedArray inlined(5); - int fill_val = 42; - inlined.fill(fill_val); - for (int i : inlined) EXPECT_EQ(i, fill_val); - - absl::FixedArray allocated(5); - allocated.fill(fill_val); - for (int i : allocated) EXPECT_EQ(i, fill_val); - - // It doesn't do anything, just make sure this compiles. - absl::FixedArray empty(0); - empty.fill(fill_val); -} - -// TODO(johnsoncj): Investigate InlinedStorage default initialization in GCC 4.x -#ifndef __GNUC__ -TEST(FixedArrayTest, DefaultCtorDoesNotValueInit) { - using T = char; - constexpr auto capacity = 10; - using FixedArrType = absl::FixedArray; - using FixedArrBuffType = - absl::aligned_storage_t; - constexpr auto scrubbed_bits = 0x95; - constexpr auto length = capacity / 2; - - FixedArrBuffType buff; - std::memset(std::addressof(buff), scrubbed_bits, sizeof(FixedArrBuffType)); - - FixedArrType* arr = - ::new (static_cast(std::addressof(buff))) FixedArrType(length); - EXPECT_THAT(*arr, testing::Each(scrubbed_bits)); - arr->~FixedArrType(); -} -#endif // __GNUC__ - -// This is a stateful allocator, but the state lives outside of the -// allocator (in whatever test is using the allocator). This is odd -// but helps in tests where the allocator is propagated into nested -// containers - that chain of allocators uses the same state and is -// thus easier to query for aggregate allocation information. -template -class CountingAllocator : public std::allocator { - public: - using Alloc = std::allocator; - using pointer = typename Alloc::pointer; - using size_type = typename Alloc::size_type; - - CountingAllocator() : bytes_used_(nullptr), instance_count_(nullptr) {} - explicit CountingAllocator(int64_t* b) - : bytes_used_(b), instance_count_(nullptr) {} - CountingAllocator(int64_t* b, int64_t* a) - : bytes_used_(b), instance_count_(a) {} - - template - explicit CountingAllocator(const CountingAllocator& x) - : Alloc(x), - bytes_used_(x.bytes_used_), - instance_count_(x.instance_count_) {} - - pointer allocate(size_type n, const void* const hint = nullptr) { - assert(bytes_used_ != nullptr); - *bytes_used_ += n * sizeof(T); - return Alloc::allocate(n, hint); - } - - void deallocate(pointer p, size_type n) { - Alloc::deallocate(p, n); - assert(bytes_used_ != nullptr); - *bytes_used_ -= n * sizeof(T); - } - - template - void construct(pointer p, Args&&... args) { - Alloc::construct(p, absl::forward(args)...); - if (instance_count_) { - *instance_count_ += 1; - } - } - - void destroy(pointer p) { - Alloc::destroy(p); - if (instance_count_) { - *instance_count_ -= 1; - } - } - - template - class rebind { - public: - using other = CountingAllocator; - }; - - int64_t* bytes_used_; - int64_t* instance_count_; -}; - -TEST(AllocatorSupportTest, CountInlineAllocations) { - constexpr size_t inlined_size = 4; - using Alloc = CountingAllocator; - using AllocFxdArr = absl::FixedArray; - - int64_t allocated = 0; - int64_t active_instances = 0; - - { - const int ia[] = {0, 1, 2, 3, 4, 5, 6, 7}; - - Alloc alloc(&allocated, &active_instances); - - AllocFxdArr arr(ia, ia + inlined_size, alloc); - static_cast(arr); - } - - EXPECT_EQ(allocated, 0); - EXPECT_EQ(active_instances, 0); -} - -TEST(AllocatorSupportTest, CountOutoflineAllocations) { - constexpr size_t inlined_size = 4; - using Alloc = CountingAllocator; - using AllocFxdArr = absl::FixedArray; - - int64_t allocated = 0; - int64_t active_instances = 0; - - { - const int ia[] = {0, 1, 2, 3, 4, 5, 6, 7}; - Alloc alloc(&allocated, &active_instances); - - AllocFxdArr arr(ia, ia + ABSL_ARRAYSIZE(ia), alloc); - - EXPECT_EQ(allocated, arr.size() * sizeof(int)); - static_cast(arr); - } - - EXPECT_EQ(active_instances, 0); -} - -TEST(AllocatorSupportTest, CountCopyInlineAllocations) { - constexpr size_t inlined_size = 4; - using Alloc = CountingAllocator; - using AllocFxdArr = absl::FixedArray; - - int64_t allocated1 = 0; - int64_t allocated2 = 0; - int64_t active_instances = 0; - Alloc alloc(&allocated1, &active_instances); - Alloc alloc2(&allocated2, &active_instances); - - { - int initial_value = 1; - - AllocFxdArr arr1(inlined_size / 2, initial_value, alloc); - - EXPECT_EQ(allocated1, 0); - - AllocFxdArr arr2(arr1, alloc2); - - EXPECT_EQ(allocated2, 0); - static_cast(arr1); - static_cast(arr2); - } - - EXPECT_EQ(active_instances, 0); -} - -TEST(AllocatorSupportTest, CountCopyOutoflineAllocations) { - constexpr size_t inlined_size = 4; - using Alloc = CountingAllocator; - using AllocFxdArr = absl::FixedArray; - - int64_t allocated1 = 0; - int64_t allocated2 = 0; - int64_t active_instances = 0; - Alloc alloc(&allocated1, &active_instances); - Alloc alloc2(&allocated2, &active_instances); - - { - int initial_value = 1; - - AllocFxdArr arr1(inlined_size * 2, initial_value, alloc); - - EXPECT_EQ(allocated1, arr1.size() * sizeof(int)); - - AllocFxdArr arr2(arr1, alloc2); - - EXPECT_EQ(allocated2, inlined_size * 2 * sizeof(int)); - static_cast(arr1); - static_cast(arr2); - } - - EXPECT_EQ(active_instances, 0); -} - -TEST(AllocatorSupportTest, SizeValAllocConstructor) { - using testing::AllOf; - using testing::Each; - using testing::SizeIs; - - constexpr size_t inlined_size = 4; - using Alloc = CountingAllocator; - using AllocFxdArr = absl::FixedArray; - - { - auto len = inlined_size / 2; - auto val = 0; - int64_t allocated = 0; - AllocFxdArr arr(len, val, Alloc(&allocated)); - - EXPECT_EQ(allocated, 0); - EXPECT_THAT(arr, AllOf(SizeIs(len), Each(0))); - } - - { - auto len = inlined_size * 2; - auto val = 0; - int64_t allocated = 0; - AllocFxdArr arr(len, val, Alloc(&allocated)); - - EXPECT_EQ(allocated, len * sizeof(int)); - EXPECT_THAT(arr, AllOf(SizeIs(len), Each(0))); - } -} - -#ifdef ADDRESS_SANITIZER -TEST(FixedArrayTest, AddressSanitizerAnnotations1) { - absl::FixedArray a(10); - int *raw = a.data(); - raw[0] = 0; - raw[9] = 0; - EXPECT_DEATH(raw[-2] = 0, "container-overflow"); - EXPECT_DEATH(raw[-1] = 0, "container-overflow"); - EXPECT_DEATH(raw[10] = 0, "container-overflow"); - EXPECT_DEATH(raw[31] = 0, "container-overflow"); -} - -TEST(FixedArrayTest, AddressSanitizerAnnotations2) { - absl::FixedArray a(12); - char *raw = a.data(); - raw[0] = 0; - raw[11] = 0; - EXPECT_DEATH(raw[-7] = 0, "container-overflow"); - EXPECT_DEATH(raw[-1] = 0, "container-overflow"); - EXPECT_DEATH(raw[12] = 0, "container-overflow"); - EXPECT_DEATH(raw[17] = 0, "container-overflow"); -} - -TEST(FixedArrayTest, AddressSanitizerAnnotations3) { - absl::FixedArray a(20); - uint64_t *raw = a.data(); - raw[0] = 0; - raw[19] = 0; - EXPECT_DEATH(raw[-1] = 0, "container-overflow"); - EXPECT_DEATH(raw[20] = 0, "container-overflow"); -} - -TEST(FixedArrayTest, AddressSanitizerAnnotations4) { - absl::FixedArray a(10); - ThreeInts *raw = a.data(); - raw[0] = ThreeInts(); - raw[9] = ThreeInts(); - // Note: raw[-1] is pointing to 12 bytes before the container range. However, - // there is only a 8-byte red zone before the container range, so we only - // access the last 4 bytes of the struct to make sure it stays within the red - // zone. - EXPECT_DEATH(raw[-1].z_ = 0, "container-overflow"); - EXPECT_DEATH(raw[10] = ThreeInts(), "container-overflow"); - // The actual size of storage is kDefaultBytes=256, 21*12 = 252, - // so reading raw[21] should still trigger the correct warning. - EXPECT_DEATH(raw[21] = ThreeInts(), "container-overflow"); -} -#endif // ADDRESS_SANITIZER - -TEST(FixedArrayTest, AbslHashValueWorks) { - using V = absl::FixedArray; - std::vector cases; - - // Generate a variety of vectors some of these are small enough for the inline - // space but are stored out of line. - for (int i = 0; i < 10; ++i) { - V v(i); - for (int j = 0; j < i; ++j) { - v[j] = j; - } - cases.push_back(v); - } - - EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(cases)); -} - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_map.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_map.h deleted file mode 100644 index 00cc4dcff..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_map.h +++ /dev/null @@ -1,585 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: flat_hash_map.h -// ----------------------------------------------------------------------------- -// -// An `absl::flat_hash_map` is an unordered associative container of -// unique keys and associated values designed to be a more efficient replacement -// for `std::unordered_map`. Like `unordered_map`, search, insertion, and -// deletion of map elements can be done as an `O(1)` operation. However, -// `flat_hash_map` (and other unordered associative containers known as the -// collection of Abseil "Swiss tables") contain other optimizations that result -// in both memory and computation advantages. -// -// In most cases, your default choice for a hash map should be a map of type -// `flat_hash_map`. - -#ifndef ABSL_CONTAINER_FLAT_HASH_MAP_H_ -#define ABSL_CONTAINER_FLAT_HASH_MAP_H_ - -#include -#include -#include -#include - -#include "absl/algorithm/container.h" -#include "absl/container/internal/container_memory.h" -#include "absl/container/internal/hash_function_defaults.h" // IWYU pragma: export -#include "absl/container/internal/raw_hash_map.h" // IWYU pragma: export -#include "absl/memory/memory.h" - -namespace absl { -namespace container_internal { -template -struct FlatHashMapPolicy; -} // namespace container_internal - -// ----------------------------------------------------------------------------- -// absl::flat_hash_map -// ----------------------------------------------------------------------------- -// -// An `absl::flat_hash_map` is an unordered associative container which -// has been optimized for both speed and memory footprint in most common use -// cases. Its interface is similar to that of `std::unordered_map` with -// the following notable differences: -// -// * Requires keys that are CopyConstructible -// * Requires values that are MoveConstructible -// * Supports heterogeneous lookup, through `find()`, `operator[]()` and -// `insert()`, provided that the map is provided a compatible heterogeneous -// hashing function and equality operator. -// * Invalidates any references and pointers to elements within the table after -// `rehash()`. -// * Contains a `capacity()` member function indicating the number of element -// slots (open, deleted, and empty) within the hash map. -// * Returns `void` from the `erase(iterator)` overload. -// -// By default, `flat_hash_map` uses the `absl::Hash` hashing framework. -// All fundamental and Abseil types that support the `absl::Hash` framework have -// a compatible equality operator for comparing insertions into `flat_hash_map`. -// If your type is not yet supported by the `absl::Hash` framework, see -// absl/hash/hash.h for information on extending Abseil hashing to user-defined -// types. -// -// NOTE: A `flat_hash_map` stores its value types directly inside its -// implementation array to avoid memory indirection. Because a `flat_hash_map` -// is designed to move data when rehashed, map values will not retain pointer -// stability. If you require pointer stability, or your values are large, -// consider using `absl::flat_hash_map>` instead. -// If your types are not moveable or you require pointer stability for keys, -// consider `absl::node_hash_map`. -// -// Example: -// -// // Create a flat hash map of three strings (that map to strings) -// absl::flat_hash_map ducks = -// {{"a", "huey"}, {"b", "dewey"}, {"c", "louie"}}; -// -// // Insert a new element into the flat hash map -// ducks.insert({"d", "donald"}); -// -// // Force a rehash of the flat hash map -// ducks.rehash(0); -// -// // Find the element with the key "b" -// std::string search_key = "b"; -// auto result = ducks.find(search_key); -// if (result != ducks.end()) { -// std::cout << "Result: " << result->second << std::endl; -// } -template , - class Eq = absl::container_internal::hash_default_eq, - class Allocator = std::allocator>> -class flat_hash_map : public absl::container_internal::raw_hash_map< - absl::container_internal::FlatHashMapPolicy, - Hash, Eq, Allocator> { - using Base = typename flat_hash_map::raw_hash_map; - - public: - // Constructors and Assignment Operators - // - // A flat_hash_map supports the same overload set as `std::unordered_map` - // for construction and assignment: - // - // * Default constructor - // - // // No allocation for the table's elements is made. - // absl::flat_hash_map map1; - // - // * Initializer List constructor - // - // absl::flat_hash_map map2 = - // {{1, "huey"}, {2, "dewey"}, {3, "louie"},}; - // - // * Copy constructor - // - // absl::flat_hash_map map3(map2); - // - // * Copy assignment operator - // - // // Hash functor and Comparator are copied as well - // absl::flat_hash_map map4; - // map4 = map3; - // - // * Move constructor - // - // // Move is guaranteed efficient - // absl::flat_hash_map map5(std::move(map4)); - // - // * Move assignment operator - // - // // May be efficient if allocators are compatible - // absl::flat_hash_map map6; - // map6 = std::move(map5); - // - // * Range constructor - // - // std::vector> v = {{1, "a"}, {2, "b"}}; - // absl::flat_hash_map map7(v.begin(), v.end()); - flat_hash_map() {} - using Base::Base; - - // flat_hash_map::begin() - // - // Returns an iterator to the beginning of the `flat_hash_map`. - using Base::begin; - - // flat_hash_map::cbegin() - // - // Returns a const iterator to the beginning of the `flat_hash_map`. - using Base::cbegin; - - // flat_hash_map::cend() - // - // Returns a const iterator to the end of the `flat_hash_map`. - using Base::cend; - - // flat_hash_map::end() - // - // Returns an iterator to the end of the `flat_hash_map`. - using Base::end; - - // flat_hash_map::capacity() - // - // Returns the number of element slots (assigned, deleted, and empty) - // available within the `flat_hash_map`. - // - // NOTE: this member function is particular to `absl::flat_hash_map` and is - // not provided in the `std::unordered_map` API. - using Base::capacity; - - // flat_hash_map::empty() - // - // Returns whether or not the `flat_hash_map` is empty. - using Base::empty; - - // flat_hash_map::max_size() - // - // Returns the largest theoretical possible number of elements within a - // `flat_hash_map` under current memory constraints. This value can be thought - // of the largest value of `std::distance(begin(), end())` for a - // `flat_hash_map`. - using Base::max_size; - - // flat_hash_map::size() - // - // Returns the number of elements currently within the `flat_hash_map`. - using Base::size; - - // flat_hash_map::clear() - // - // Removes all elements from the `flat_hash_map`. Invalidates any references, - // pointers, or iterators referring to contained elements. - // - // NOTE: this operation may shrink the underlying buffer. To avoid shrinking - // the underlying buffer call `erase(begin(), end())`. - using Base::clear; - - // flat_hash_map::erase() - // - // Erases elements within the `flat_hash_map`. Erasing does not trigger a - // rehash. Overloads are listed below. - // - // void erase(const_iterator pos): - // - // Erases the element at `position` of the `flat_hash_map`, returning - // `void`. - // - // NOTE: returning `void` in this case is different than that of STL - // containers in general and `std::unordered_map` in particular (which - // return an iterator to the element following the erased element). If that - // iterator is needed, simply post increment the iterator: - // - // map.erase(it++); - // - // iterator erase(const_iterator first, const_iterator last): - // - // Erases the elements in the open interval [`first`, `last`), returning an - // iterator pointing to `last`. - // - // size_type erase(const key_type& key): - // - // Erases the element with the matching key, if it exists. - using Base::erase; - - // flat_hash_map::insert() - // - // Inserts an element of the specified value into the `flat_hash_map`, - // returning an iterator pointing to the newly inserted element, provided that - // an element with the given key does not already exist. If rehashing occurs - // due to the insertion, all iterators are invalidated. Overloads are listed - // below. - // - // std::pair insert(const init_type& value): - // - // Inserts a value into the `flat_hash_map`. Returns a pair consisting of an - // iterator to the inserted element (or to the element that prevented the - // insertion) and a bool denoting whether the insertion took place. - // - // std::pair insert(T&& value): - // std::pair insert(init_type&& value): - // - // Inserts a moveable value into the `flat_hash_map`. Returns a pair - // consisting of an iterator to the inserted element (or to the element that - // prevented the insertion) and a bool denoting whether the insertion took - // place. - // - // iterator insert(const_iterator hint, const init_type& value): - // iterator insert(const_iterator hint, T&& value): - // iterator insert(const_iterator hint, init_type&& value); - // - // Inserts a value, using the position of `hint` as a non-binding suggestion - // for where to begin the insertion search. Returns an iterator to the - // inserted element, or to the existing element that prevented the - // insertion. - // - // void insert(InputIterator first, InputIterator last): - // - // Inserts a range of values [`first`, `last`). - // - // NOTE: Although the STL does not specify which element may be inserted if - // multiple keys compare equivalently, for `flat_hash_map` we guarantee the - // first match is inserted. - // - // void insert(std::initializer_list ilist): - // - // Inserts the elements within the initializer list `ilist`. - // - // NOTE: Although the STL does not specify which element may be inserted if - // multiple keys compare equivalently within the initializer list, for - // `flat_hash_map` we guarantee the first match is inserted. - using Base::insert; - - // flat_hash_map::insert_or_assign() - // - // Inserts an element of the specified value into the `flat_hash_map` provided - // that a value with the given key does not already exist, or replaces it with - // the element value if a key for that value already exists, returning an - // iterator pointing to the newly inserted element. If rehashing occurs due - // to the insertion, all existing iterators are invalidated. Overloads are - // listed below. - // - // pair insert_or_assign(const init_type& k, T&& obj): - // pair insert_or_assign(init_type&& k, T&& obj): - // - // Inserts/Assigns (or moves) the element of the specified key into the - // `flat_hash_map`. - // - // iterator insert_or_assign(const_iterator hint, - // const init_type& k, T&& obj): - // iterator insert_or_assign(const_iterator hint, init_type&& k, T&& obj): - // - // Inserts/Assigns (or moves) the element of the specified key into the - // `flat_hash_map` using the position of `hint` as a non-binding suggestion - // for where to begin the insertion search. - using Base::insert_or_assign; - - // flat_hash_map::emplace() - // - // Inserts an element of the specified value by constructing it in-place - // within the `flat_hash_map`, provided that no element with the given key - // already exists. - // - // The element may be constructed even if there already is an element with the - // key in the container, in which case the newly constructed element will be - // destroyed immediately. Prefer `try_emplace()` unless your key is not - // copyable or moveable. - // - // If rehashing occurs due to the insertion, all iterators are invalidated. - using Base::emplace; - - // flat_hash_map::emplace_hint() - // - // Inserts an element of the specified value by constructing it in-place - // within the `flat_hash_map`, using the position of `hint` as a non-binding - // suggestion for where to begin the insertion search, and only inserts - // provided that no element with the given key already exists. - // - // The element may be constructed even if there already is an element with the - // key in the container, in which case the newly constructed element will be - // destroyed immediately. Prefer `try_emplace()` unless your key is not - // copyable or moveable. - // - // If rehashing occurs due to the insertion, all iterators are invalidated. - using Base::emplace_hint; - - // flat_hash_map::try_emplace() - // - // Inserts an element of the specified value by constructing it in-place - // within the `flat_hash_map`, provided that no element with the given key - // already exists. Unlike `emplace()`, if an element with the given key - // already exists, we guarantee that no element is constructed. - // - // If rehashing occurs due to the insertion, all iterators are invalidated. - // Overloads are listed below. - // - // pair try_emplace(const key_type& k, Args&&... args): - // pair try_emplace(key_type&& k, Args&&... args): - // - // Inserts (via copy or move) the element of the specified key into the - // `flat_hash_map`. - // - // iterator try_emplace(const_iterator hint, - // const init_type& k, Args&&... args): - // iterator try_emplace(const_iterator hint, init_type&& k, Args&&... args): - // - // Inserts (via copy or move) the element of the specified key into the - // `flat_hash_map` using the position of `hint` as a non-binding suggestion - // for where to begin the insertion search. - using Base::try_emplace; - - // flat_hash_map::extract() - // - // Extracts the indicated element, erasing it in the process, and returns it - // as a C++17-compatible node handle. Overloads are listed below. - // - // node_type extract(const_iterator position): - // - // Extracts the key,value pair of the element at the indicated position and - // returns a node handle owning that extracted data. - // - // node_type extract(const key_type& x): - // - // Extracts the key,value pair of the element with a key matching the passed - // key value and returns a node handle owning that extracted data. If the - // `flat_hash_map` does not contain an element with a matching key, this - // function returns an empty node handle. - using Base::extract; - - // flat_hash_map::merge() - // - // Extracts elements from a given `source` flat hash map into this - // `flat_hash_map`. If the destination `flat_hash_map` already contains an - // element with an equivalent key, that element is not extracted. - using Base::merge; - - // flat_hash_map::swap(flat_hash_map& other) - // - // Exchanges the contents of this `flat_hash_map` with those of the `other` - // flat hash map, avoiding invocation of any move, copy, or swap operations on - // individual elements. - // - // All iterators and references on the `flat_hash_map` remain valid, excepting - // for the past-the-end iterator, which is invalidated. - // - // `swap()` requires that the flat hash map's hashing and key equivalence - // functions be Swappable, and are exchaged using unqualified calls to - // non-member `swap()`. If the map's allocator has - // `std::allocator_traits::propagate_on_container_swap::value` - // set to `true`, the allocators are also exchanged using an unqualified call - // to non-member `swap()`; otherwise, the allocators are not swapped. - using Base::swap; - - // flat_hash_map::rehash(count) - // - // Rehashes the `flat_hash_map`, setting the number of slots to be at least - // the passed value. If the new number of slots increases the load factor more - // than the current maximum load factor - // (`count` < `size()` / `max_load_factor()`), then the new number of slots - // will be at least `size()` / `max_load_factor()`. - // - // To force a rehash, pass rehash(0). - // - // NOTE: unlike behavior in `std::unordered_map`, references are also - // invalidated upon a `rehash()`. - using Base::rehash; - - // flat_hash_map::reserve(count) - // - // Sets the number of slots in the `flat_hash_map` to the number needed to - // accommodate at least `count` total elements without exceeding the current - // maximum load factor, and may rehash the container if needed. - using Base::reserve; - - // flat_hash_map::at() - // - // Returns a reference to the mapped value of the element with key equivalent - // to the passed key. - using Base::at; - - // flat_hash_map::contains() - // - // Determines whether an element with a key comparing equal to the given `key` - // exists within the `flat_hash_map`, returning `true` if so or `false` - // otherwise. - using Base::contains; - - // flat_hash_map::count(const Key& key) const - // - // Returns the number of elements with a key comparing equal to the given - // `key` within the `flat_hash_map`. note that this function will return - // either `1` or `0` since duplicate keys are not allowed within a - // `flat_hash_map`. - using Base::count; - - // flat_hash_map::equal_range() - // - // Returns a closed range [first, last], defined by a `std::pair` of two - // iterators, containing all elements with the passed key in the - // `flat_hash_map`. - using Base::equal_range; - - // flat_hash_map::find() - // - // Finds an element with the passed `key` within the `flat_hash_map`. - using Base::find; - - // flat_hash_map::operator[]() - // - // Returns a reference to the value mapped to the passed key within the - // `flat_hash_map`, performing an `insert()` if the key does not already - // exist. - // - // If an insertion occurs and results in a rehashing of the container, all - // iterators are invalidated. Otherwise iterators are not affected and - // references are not invalidated. Overloads are listed below. - // - // T& operator[](const Key& key): - // - // Inserts an init_type object constructed in-place if the element with the - // given key does not exist. - // - // T& operator[](Key&& key): - // - // Inserts an init_type object constructed in-place provided that an element - // with the given key does not exist. - using Base::operator[]; - - // flat_hash_map::bucket_count() - // - // Returns the number of "buckets" within the `flat_hash_map`. Note that - // because a flat hash map contains all elements within its internal storage, - // this value simply equals the current capacity of the `flat_hash_map`. - using Base::bucket_count; - - // flat_hash_map::load_factor() - // - // Returns the current load factor of the `flat_hash_map` (the average number - // of slots occupied with a value within the hash map). - using Base::load_factor; - - // flat_hash_map::max_load_factor() - // - // Manages the maximum load factor of the `flat_hash_map`. Overloads are - // listed below. - // - // float flat_hash_map::max_load_factor() - // - // Returns the current maximum load factor of the `flat_hash_map`. - // - // void flat_hash_map::max_load_factor(float ml) - // - // Sets the maximum load factor of the `flat_hash_map` to the passed value. - // - // NOTE: This overload is provided only for API compatibility with the STL; - // `flat_hash_map` will ignore any set load factor and manage its rehashing - // internally as an implementation detail. - using Base::max_load_factor; - - // flat_hash_map::get_allocator() - // - // Returns the allocator function associated with this `flat_hash_map`. - using Base::get_allocator; - - // flat_hash_map::hash_function() - // - // Returns the hashing function used to hash the keys within this - // `flat_hash_map`. - using Base::hash_function; - - // flat_hash_map::key_eq() - // - // Returns the function used for comparing keys equality. - using Base::key_eq; -}; - -namespace container_internal { - -template -struct FlatHashMapPolicy { - using slot_policy = container_internal::map_slot_policy; - using slot_type = typename slot_policy::slot_type; - using key_type = K; - using mapped_type = V; - using init_type = std::pair; - - template - static void construct(Allocator* alloc, slot_type* slot, Args&&... args) { - slot_policy::construct(alloc, slot, std::forward(args)...); - } - - template - static void destroy(Allocator* alloc, slot_type* slot) { - slot_policy::destroy(alloc, slot); - } - - template - static void transfer(Allocator* alloc, slot_type* new_slot, - slot_type* old_slot) { - slot_policy::transfer(alloc, new_slot, old_slot); - } - - template - static decltype(absl::container_internal::DecomposePair( - std::declval(), std::declval()...)) - apply(F&& f, Args&&... args) { - return absl::container_internal::DecomposePair(std::forward(f), - std::forward(args)...); - } - - static size_t space_used(const slot_type*) { return 0; } - - static std::pair& element(slot_type* slot) { return slot->value; } - - static V& value(std::pair* kv) { return kv->second; } - static const V& value(const std::pair* kv) { return kv->second; } -}; - -} // namespace container_internal - -namespace container_algorithm_internal { - -// Specialization of trait in absl/algorithm/container.h -template -struct IsUnorderedContainer< - absl::flat_hash_map> : std::true_type {}; - -} // namespace container_algorithm_internal - -} // namespace absl - -#endif // ABSL_CONTAINER_FLAT_HASH_MAP_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc deleted file mode 100644 index ebcb560fc..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_map_test.cc +++ /dev/null @@ -1,247 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/flat_hash_map.h" - -#include "absl/container/internal/hash_generator_testing.h" -#include "absl/container/internal/unordered_map_constructor_test.h" -#include "absl/container/internal/unordered_map_lookup_test.h" -#include "absl/container/internal/unordered_map_members_test.h" -#include "absl/container/internal/unordered_map_modifiers_test.h" -#include "absl/types/any.h" - -namespace absl { -namespace container_internal { -namespace { -using ::absl::container_internal::hash_internal::Enum; -using ::absl::container_internal::hash_internal::EnumClass; -using ::testing::_; -using ::testing::Pair; -using ::testing::UnorderedElementsAre; - -template -using Map = flat_hash_map>>; - -static_assert(!std::is_standard_layout(), ""); - -using MapTypes = - ::testing::Types, Map, - Map, Map, - Map, Map>; - -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, ConstructorTest, MapTypes); -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, LookupTest, MapTypes); -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, MembersTest, MapTypes); -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashMap, ModifiersTest, MapTypes); - -TEST(FlatHashMap, StandardLayout) { - struct Int { - explicit Int(size_t value) : value(value) {} - Int() : value(0) { ADD_FAILURE(); } - Int(const Int& other) : value(other.value) { ADD_FAILURE(); } - Int(Int&&) = default; - bool operator==(const Int& other) const { return value == other.value; } - size_t value; - }; - static_assert(std::is_standard_layout(), ""); - - struct Hash { - size_t operator()(const Int& obj) const { return obj.value; } - }; - - // Verify that neither the key nor the value get default-constructed or - // copy-constructed. - { - flat_hash_map m; - m.try_emplace(Int(1), Int(2)); - m.try_emplace(Int(3), Int(4)); - m.erase(Int(1)); - m.rehash(2 * m.bucket_count()); - } - { - flat_hash_map m; - m.try_emplace(Int(1), Int(2)); - m.try_emplace(Int(3), Int(4)); - m.erase(Int(1)); - m.clear(); - } -} - -// gcc becomes unhappy if this is inside the method, so pull it out here. -struct balast {}; - -TEST(FlatHashMap, IteratesMsan) { - // Because SwissTable randomizes on pointer addresses, we keep old tables - // around to ensure we don't reuse old memory. - std::vector> garbage; - for (int i = 0; i < 100; ++i) { - absl::flat_hash_map t; - for (int j = 0; j < 100; ++j) { - t[j]; - for (const auto& p : t) EXPECT_THAT(p, Pair(_, _)); - } - garbage.push_back(std::move(t)); - } -} - -// Demonstration of the "Lazy Key" pattern. This uses heterogeneous insert to -// avoid creating expensive key elements when the item is already present in the -// map. -struct LazyInt { - explicit LazyInt(size_t value, int* tracker) - : value(value), tracker(tracker) {} - - explicit operator size_t() const { - ++*tracker; - return value; - } - - size_t value; - int* tracker; -}; - -struct Hash { - using is_transparent = void; - int* tracker; - size_t operator()(size_t obj) const { - ++*tracker; - return obj; - } - size_t operator()(const LazyInt& obj) const { - ++*tracker; - return obj.value; - } -}; - -struct Eq { - using is_transparent = void; - bool operator()(size_t lhs, size_t rhs) const { - return lhs == rhs; - } - bool operator()(size_t lhs, const LazyInt& rhs) const { - return lhs == rhs.value; - } -}; - -TEST(FlatHashMap, LazyKeyPattern) { - // hashes are only guaranteed in opt mode, we use assertions to track internal - // state that can cause extra calls to hash. - int conversions = 0; - int hashes = 0; - flat_hash_map m(0, Hash{&hashes}); - m.reserve(3); - - m[LazyInt(1, &conversions)] = 1; - EXPECT_THAT(m, UnorderedElementsAre(Pair(1, 1))); - EXPECT_EQ(conversions, 1); -#ifdef NDEBUG - EXPECT_EQ(hashes, 1); -#endif - - m[LazyInt(1, &conversions)] = 2; - EXPECT_THAT(m, UnorderedElementsAre(Pair(1, 2))); - EXPECT_EQ(conversions, 1); -#ifdef NDEBUG - EXPECT_EQ(hashes, 2); -#endif - - m.try_emplace(LazyInt(2, &conversions), 3); - EXPECT_THAT(m, UnorderedElementsAre(Pair(1, 2), Pair(2, 3))); - EXPECT_EQ(conversions, 2); -#ifdef NDEBUG - EXPECT_EQ(hashes, 3); -#endif - - m.try_emplace(LazyInt(2, &conversions), 4); - EXPECT_THAT(m, UnorderedElementsAre(Pair(1, 2), Pair(2, 3))); - EXPECT_EQ(conversions, 2); -#ifdef NDEBUG - EXPECT_EQ(hashes, 4); -#endif -} - -TEST(FlatHashMap, BitfieldArgument) { - union { - int n : 1; - }; - n = 0; - flat_hash_map m; - m.erase(n); - m.count(n); - m.prefetch(n); - m.find(n); - m.contains(n); - m.equal_range(n); - m.insert_or_assign(n, n); - m.insert_or_assign(m.end(), n, n); - m.try_emplace(n); - m.try_emplace(m.end(), n); - m.at(n); - m[n]; -} - -TEST(FlatHashMap, MergeExtractInsert) { - // We can't test mutable keys, or non-copyable keys with flat_hash_map. - // Test that the nodes have the proper API. - absl::flat_hash_map m = {{1, 7}, {2, 9}}; - auto node = m.extract(1); - EXPECT_TRUE(node); - EXPECT_EQ(node.key(), 1); - EXPECT_EQ(node.mapped(), 7); - EXPECT_THAT(m, UnorderedElementsAre(Pair(2, 9))); - - node.mapped() = 17; - m.insert(std::move(node)); - EXPECT_THAT(m, UnorderedElementsAre(Pair(1, 17), Pair(2, 9))); -} - -#if (defined(ABSL_HAVE_STD_ANY) || !defined(_LIBCPP_VERSION)) && \ - !defined(__EMSCRIPTEN__) -TEST(FlatHashMap, Any) { - absl::flat_hash_map m; - m.emplace(1, 7); - auto it = m.find(1); - ASSERT_NE(it, m.end()); - EXPECT_EQ(7, absl::any_cast(it->second)); - - m.emplace(std::piecewise_construct, std::make_tuple(2), std::make_tuple(8)); - it = m.find(2); - ASSERT_NE(it, m.end()); - EXPECT_EQ(8, absl::any_cast(it->second)); - - m.emplace(std::piecewise_construct, std::make_tuple(3), - std::make_tuple(absl::any(9))); - it = m.find(3); - ASSERT_NE(it, m.end()); - EXPECT_EQ(9, absl::any_cast(it->second)); - - struct H { - size_t operator()(const absl::any&) const { return 0; } - }; - struct E { - bool operator()(const absl::any&, const absl::any&) const { return true; } - }; - absl::flat_hash_map m2; - m2.emplace(1, 7); - auto it2 = m2.find(1); - ASSERT_NE(it2, m2.end()); - EXPECT_EQ(7, it2->second); -} -#endif // (defined(ABSL_HAVE_STD_ANY) || !defined(_LIBCPP_VERSION)) && - // !defined(__EMSCRIPTEN__) - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_set.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_set.h deleted file mode 100644 index 6bf51833f..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_set.h +++ /dev/null @@ -1,493 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: flat_hash_set.h -// ----------------------------------------------------------------------------- -// -// An `absl::flat_hash_set` is an unordered associative container designed to -// be a more efficient replacement for `std::unordered_set`. Like -// `unordered_set`, search, insertion, and deletion of set elements can be done -// as an `O(1)` operation. However, `flat_hash_set` (and other unordered -// associative containers known as the collection of Abseil "Swiss tables") -// contain other optimizations that result in both memory and computation -// advantages. -// -// In most cases, your default choice for a hash set should be a set of type -// `flat_hash_set`. -#ifndef ABSL_CONTAINER_FLAT_HASH_SET_H_ -#define ABSL_CONTAINER_FLAT_HASH_SET_H_ - -#include -#include - -#include "absl/algorithm/container.h" -#include "absl/base/macros.h" -#include "absl/container/internal/container_memory.h" -#include "absl/container/internal/hash_function_defaults.h" // IWYU pragma: export -#include "absl/container/internal/raw_hash_set.h" // IWYU pragma: export -#include "absl/memory/memory.h" - -namespace absl { -namespace container_internal { -template -struct FlatHashSetPolicy; -} // namespace container_internal - -// ----------------------------------------------------------------------------- -// absl::flat_hash_set -// ----------------------------------------------------------------------------- -// -// An `absl::flat_hash_set` is an unordered associative container which has -// been optimized for both speed and memory footprint in most common use cases. -// Its interface is similar to that of `std::unordered_set` with the -// following notable differences: -// -// * Requires keys that are CopyConstructible -// * Supports heterogeneous lookup, through `find()`, `operator[]()` and -// `insert()`, provided that the set is provided a compatible heterogeneous -// hashing function and equality operator. -// * Invalidates any references and pointers to elements within the table after -// `rehash()`. -// * Contains a `capacity()` member function indicating the number of element -// slots (open, deleted, and empty) within the hash set. -// * Returns `void` from the `erase(iterator)` overload. -// -// By default, `flat_hash_set` uses the `absl::Hash` hashing framework. All -// fundamental and Abseil types that support the `absl::Hash` framework have a -// compatible equality operator for comparing insertions into `flat_hash_map`. -// If your type is not yet supported by the `absl::Hash` framework, see -// absl/hash/hash.h for information on extending Abseil hashing to user-defined -// types. -// -// NOTE: A `flat_hash_set` stores its keys directly inside its implementation -// array to avoid memory indirection. Because a `flat_hash_set` is designed to -// move data when rehashed, set keys will not retain pointer stability. If you -// require pointer stability, consider using -// `absl::flat_hash_set>`. If your type is not moveable and -// you require pointer stability, consider `absl::node_hash_set` instead. -// -// Example: -// -// // Create a flat hash set of three strings -// absl::flat_hash_set ducks = -// {"huey", "dewey", "louie"}; -// -// // Insert a new element into the flat hash set -// ducks.insert("donald"); -// -// // Force a rehash of the flat hash set -// ducks.rehash(0); -// -// // See if "dewey" is present -// if (ducks.contains("dewey")) { -// std::cout << "We found dewey!" << std::endl; -// } -template , - class Eq = absl::container_internal::hash_default_eq, - class Allocator = std::allocator> -class flat_hash_set - : public absl::container_internal::raw_hash_set< - absl::container_internal::FlatHashSetPolicy, Hash, Eq, Allocator> { - using Base = typename flat_hash_set::raw_hash_set; - - public: - // Constructors and Assignment Operators - // - // A flat_hash_set supports the same overload set as `std::unordered_map` - // for construction and assignment: - // - // * Default constructor - // - // // No allocation for the table's elements is made. - // absl::flat_hash_set set1; - // - // * Initializer List constructor - // - // absl::flat_hash_set set2 = - // {{"huey"}, {"dewey"}, {"louie"},}; - // - // * Copy constructor - // - // absl::flat_hash_set set3(set2); - // - // * Copy assignment operator - // - // // Hash functor and Comparator are copied as well - // absl::flat_hash_set set4; - // set4 = set3; - // - // * Move constructor - // - // // Move is guaranteed efficient - // absl::flat_hash_set set5(std::move(set4)); - // - // * Move assignment operator - // - // // May be efficient if allocators are compatible - // absl::flat_hash_set set6; - // set6 = std::move(set5); - // - // * Range constructor - // - // std::vector v = {"a", "b"}; - // absl::flat_hash_set set7(v.begin(), v.end()); - flat_hash_set() {} - using Base::Base; - - // flat_hash_set::begin() - // - // Returns an iterator to the beginning of the `flat_hash_set`. - using Base::begin; - - // flat_hash_set::cbegin() - // - // Returns a const iterator to the beginning of the `flat_hash_set`. - using Base::cbegin; - - // flat_hash_set::cend() - // - // Returns a const iterator to the end of the `flat_hash_set`. - using Base::cend; - - // flat_hash_set::end() - // - // Returns an iterator to the end of the `flat_hash_set`. - using Base::end; - - // flat_hash_set::capacity() - // - // Returns the number of element slots (assigned, deleted, and empty) - // available within the `flat_hash_set`. - // - // NOTE: this member function is particular to `absl::flat_hash_set` and is - // not provided in the `std::unordered_map` API. - using Base::capacity; - - // flat_hash_set::empty() - // - // Returns whether or not the `flat_hash_set` is empty. - using Base::empty; - - // flat_hash_set::max_size() - // - // Returns the largest theoretical possible number of elements within a - // `flat_hash_set` under current memory constraints. This value can be thought - // of the largest value of `std::distance(begin(), end())` for a - // `flat_hash_set`. - using Base::max_size; - - // flat_hash_set::size() - // - // Returns the number of elements currently within the `flat_hash_set`. - using Base::size; - - // flat_hash_set::clear() - // - // Removes all elements from the `flat_hash_set`. Invalidates any references, - // pointers, or iterators referring to contained elements. - // - // NOTE: this operation may shrink the underlying buffer. To avoid shrinking - // the underlying buffer call `erase(begin(), end())`. - using Base::clear; - - // flat_hash_set::erase() - // - // Erases elements within the `flat_hash_set`. Erasing does not trigger a - // rehash. Overloads are listed below. - // - // void erase(const_iterator pos): - // - // Erases the element at `position` of the `flat_hash_set`, returning - // `void`. - // - // NOTE: returning `void` in this case is different than that of STL - // containers in general and `std::unordered_set` in particular (which - // return an iterator to the element following the erased element). If that - // iterator is needed, simply post increment the iterator: - // - // set.erase(it++); - // - // iterator erase(const_iterator first, const_iterator last): - // - // Erases the elements in the open interval [`first`, `last`), returning an - // iterator pointing to `last`. - // - // size_type erase(const key_type& key): - // - // Erases the element with the matching key, if it exists. - using Base::erase; - - // flat_hash_set::insert() - // - // Inserts an element of the specified value into the `flat_hash_set`, - // returning an iterator pointing to the newly inserted element, provided that - // an element with the given key does not already exist. If rehashing occurs - // due to the insertion, all iterators are invalidated. Overloads are listed - // below. - // - // std::pair insert(const T& value): - // - // Inserts a value into the `flat_hash_set`. Returns a pair consisting of an - // iterator to the inserted element (or to the element that prevented the - // insertion) and a bool denoting whether the insertion took place. - // - // std::pair insert(T&& value): - // - // Inserts a moveable value into the `flat_hash_set`. Returns a pair - // consisting of an iterator to the inserted element (or to the element that - // prevented the insertion) and a bool denoting whether the insertion took - // place. - // - // iterator insert(const_iterator hint, const T& value): - // iterator insert(const_iterator hint, T&& value): - // - // Inserts a value, using the position of `hint` as a non-binding suggestion - // for where to begin the insertion search. Returns an iterator to the - // inserted element, or to the existing element that prevented the - // insertion. - // - // void insert(InputIterator first, InputIterator last): - // - // Inserts a range of values [`first`, `last`). - // - // NOTE: Although the STL does not specify which element may be inserted if - // multiple keys compare equivalently, for `flat_hash_set` we guarantee the - // first match is inserted. - // - // void insert(std::initializer_list ilist): - // - // Inserts the elements within the initializer list `ilist`. - // - // NOTE: Although the STL does not specify which element may be inserted if - // multiple keys compare equivalently within the initializer list, for - // `flat_hash_set` we guarantee the first match is inserted. - using Base::insert; - - // flat_hash_set::emplace() - // - // Inserts an element of the specified value by constructing it in-place - // within the `flat_hash_set`, provided that no element with the given key - // already exists. - // - // The element may be constructed even if there already is an element with the - // key in the container, in which case the newly constructed element will be - // destroyed immediately. - // - // If rehashing occurs due to the insertion, all iterators are invalidated. - using Base::emplace; - - // flat_hash_set::emplace_hint() - // - // Inserts an element of the specified value by constructing it in-place - // within the `flat_hash_set`, using the position of `hint` as a non-binding - // suggestion for where to begin the insertion search, and only inserts - // provided that no element with the given key already exists. - // - // The element may be constructed even if there already is an element with the - // key in the container, in which case the newly constructed element will be - // destroyed immediately. - // - // If rehashing occurs due to the insertion, all iterators are invalidated. - using Base::emplace_hint; - - // flat_hash_set::extract() - // - // Extracts the indicated element, erasing it in the process, and returns it - // as a C++17-compatible node handle. Overloads are listed below. - // - // node_type extract(const_iterator position): - // - // Extracts the element at the indicated position and returns a node handle - // owning that extracted data. - // - // node_type extract(const key_type& x): - // - // Extracts the element with the key matching the passed key value and - // returns a node handle owning that extracted data. If the `flat_hash_set` - // does not contain an element with a matching key, this function returns an - // empty node handle. - using Base::extract; - - // flat_hash_set::merge() - // - // Extracts elements from a given `source` flat hash map into this - // `flat_hash_set`. If the destination `flat_hash_set` already contains an - // element with an equivalent key, that element is not extracted. - using Base::merge; - - // flat_hash_set::swap(flat_hash_set& other) - // - // Exchanges the contents of this `flat_hash_set` with those of the `other` - // flat hash map, avoiding invocation of any move, copy, or swap operations on - // individual elements. - // - // All iterators and references on the `flat_hash_set` remain valid, excepting - // for the past-the-end iterator, which is invalidated. - // - // `swap()` requires that the flat hash set's hashing and key equivalence - // functions be Swappable, and are exchaged using unqualified calls to - // non-member `swap()`. If the map's allocator has - // `std::allocator_traits::propagate_on_container_swap::value` - // set to `true`, the allocators are also exchanged using an unqualified call - // to non-member `swap()`; otherwise, the allocators are not swapped. - using Base::swap; - - // flat_hash_set::rehash(count) - // - // Rehashes the `flat_hash_set`, setting the number of slots to be at least - // the passed value. If the new number of slots increases the load factor more - // than the current maximum load factor - // (`count` < `size()` / `max_load_factor()`), then the new number of slots - // will be at least `size()` / `max_load_factor()`. - // - // To force a rehash, pass rehash(0). - // - // NOTE: unlike behavior in `std::unordered_set`, references are also - // invalidated upon a `rehash()`. - using Base::rehash; - - // flat_hash_set::reserve(count) - // - // Sets the number of slots in the `flat_hash_set` to the number needed to - // accommodate at least `count` total elements without exceeding the current - // maximum load factor, and may rehash the container if needed. - using Base::reserve; - - // flat_hash_set::contains() - // - // Determines whether an element comparing equal to the given `key` exists - // within the `flat_hash_set`, returning `true` if so or `false` otherwise. - using Base::contains; - - // flat_hash_set::count(const Key& key) const - // - // Returns the number of elements comparing equal to the given `key` within - // the `flat_hash_set`. note that this function will return either `1` or `0` - // since duplicate elements are not allowed within a `flat_hash_set`. - using Base::count; - - // flat_hash_set::equal_range() - // - // Returns a closed range [first, last], defined by a `std::pair` of two - // iterators, containing all elements with the passed key in the - // `flat_hash_set`. - using Base::equal_range; - - // flat_hash_set::find() - // - // Finds an element with the passed `key` within the `flat_hash_set`. - using Base::find; - - // flat_hash_set::bucket_count() - // - // Returns the number of "buckets" within the `flat_hash_set`. Note that - // because a flat hash map contains all elements within its internal storage, - // this value simply equals the current capacity of the `flat_hash_set`. - using Base::bucket_count; - - // flat_hash_set::load_factor() - // - // Returns the current load factor of the `flat_hash_set` (the average number - // of slots occupied with a value within the hash map). - using Base::load_factor; - - // flat_hash_set::max_load_factor() - // - // Manages the maximum load factor of the `flat_hash_set`. Overloads are - // listed below. - // - // float flat_hash_set::max_load_factor() - // - // Returns the current maximum load factor of the `flat_hash_set`. - // - // void flat_hash_set::max_load_factor(float ml) - // - // Sets the maximum load factor of the `flat_hash_set` to the passed value. - // - // NOTE: This overload is provided only for API compatibility with the STL; - // `flat_hash_set` will ignore any set load factor and manage its rehashing - // internally as an implementation detail. - using Base::max_load_factor; - - // flat_hash_set::get_allocator() - // - // Returns the allocator function associated with this `flat_hash_set`. - using Base::get_allocator; - - // flat_hash_set::hash_function() - // - // Returns the hashing function used to hash the keys within this - // `flat_hash_set`. - using Base::hash_function; - - // flat_hash_set::key_eq() - // - // Returns the function used for comparing keys equality. - using Base::key_eq; -}; - -namespace container_internal { - -template -struct FlatHashSetPolicy { - using slot_type = T; - using key_type = T; - using init_type = T; - using constant_iterators = std::true_type; - - template - static void construct(Allocator* alloc, slot_type* slot, Args&&... args) { - absl::allocator_traits::construct(*alloc, slot, - std::forward(args)...); - } - - template - static void destroy(Allocator* alloc, slot_type* slot) { - absl::allocator_traits::destroy(*alloc, slot); - } - - template - static void transfer(Allocator* alloc, slot_type* new_slot, - slot_type* old_slot) { - construct(alloc, new_slot, std::move(*old_slot)); - destroy(alloc, old_slot); - } - - static T& element(slot_type* slot) { return *slot; } - - template - static decltype(absl::container_internal::DecomposeValue( - std::declval(), std::declval()...)) - apply(F&& f, Args&&... args) { - return absl::container_internal::DecomposeValue( - std::forward(f), std::forward(args)...); - } - - static size_t space_used(const T*) { return 0; } -}; -} // namespace container_internal - -namespace container_algorithm_internal { - -// Specialization of trait in absl/algorithm/container.h -template -struct IsUnorderedContainer> - : std::true_type {}; - -} // namespace container_algorithm_internal - -} // namespace absl - -#endif // ABSL_CONTAINER_FLAT_HASH_SET_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc deleted file mode 100644 index b55be59b0..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/flat_hash_set_test.cc +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/flat_hash_set.h" - -#include - -#include "absl/container/internal/hash_generator_testing.h" -#include "absl/container/internal/unordered_set_constructor_test.h" -#include "absl/container/internal/unordered_set_lookup_test.h" -#include "absl/container/internal/unordered_set_members_test.h" -#include "absl/container/internal/unordered_set_modifiers_test.h" -#include "absl/memory/memory.h" -#include "absl/strings/string_view.h" - -namespace absl { -namespace container_internal { -namespace { - -using ::absl::container_internal::hash_internal::Enum; -using ::absl::container_internal::hash_internal::EnumClass; -using ::testing::Pointee; -using ::testing::UnorderedElementsAre; -using ::testing::UnorderedElementsAreArray; - -template -using Set = - absl::flat_hash_set>; - -using SetTypes = - ::testing::Types, Set, Set, Set>; - -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, ConstructorTest, SetTypes); -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, LookupTest, SetTypes); -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, MembersTest, SetTypes); -INSTANTIATE_TYPED_TEST_SUITE_P(FlatHashSet, ModifiersTest, SetTypes); - -TEST(FlatHashSet, EmplaceString) { - std::vector v = {"a", "b"}; - absl::flat_hash_set hs(v.begin(), v.end()); - EXPECT_THAT(hs, UnorderedElementsAreArray(v)); -} - -TEST(FlatHashSet, BitfieldArgument) { - union { - int n : 1; - }; - n = 0; - absl::flat_hash_set s = {n}; - s.insert(n); - s.insert(s.end(), n); - s.insert({n}); - s.erase(n); - s.count(n); - s.prefetch(n); - s.find(n); - s.contains(n); - s.equal_range(n); -} - -TEST(FlatHashSet, MergeExtractInsert) { - struct Hash { - size_t operator()(const std::unique_ptr& p) const { return *p; } - }; - struct Eq { - bool operator()(const std::unique_ptr& a, - const std::unique_ptr& b) const { - return *a == *b; - } - }; - absl::flat_hash_set, Hash, Eq> set1, set2; - set1.insert(absl::make_unique(7)); - set1.insert(absl::make_unique(17)); - - set2.insert(absl::make_unique(7)); - set2.insert(absl::make_unique(19)); - - EXPECT_THAT(set1, UnorderedElementsAre(Pointee(7), Pointee(17))); - EXPECT_THAT(set2, UnorderedElementsAre(Pointee(7), Pointee(19))); - - set1.merge(set2); - - EXPECT_THAT(set1, UnorderedElementsAre(Pointee(7), Pointee(17), Pointee(19))); - EXPECT_THAT(set2, UnorderedElementsAre(Pointee(7))); - - auto node = set1.extract(absl::make_unique(7)); - EXPECT_TRUE(node); - EXPECT_THAT(node.value(), Pointee(7)); - EXPECT_THAT(set1, UnorderedElementsAre(Pointee(17), Pointee(19))); - - auto insert_result = set2.insert(std::move(node)); - EXPECT_FALSE(node); - EXPECT_FALSE(insert_result.inserted); - EXPECT_TRUE(insert_result.node); - EXPECT_THAT(insert_result.node.value(), Pointee(7)); - EXPECT_EQ(**insert_result.position, 7); - EXPECT_NE(insert_result.position->get(), insert_result.node.value().get()); - EXPECT_THAT(set2, UnorderedElementsAre(Pointee(7))); - - node = set1.extract(absl::make_unique(17)); - EXPECT_TRUE(node); - EXPECT_THAT(node.value(), Pointee(17)); - EXPECT_THAT(set1, UnorderedElementsAre(Pointee(19))); - - node.value() = absl::make_unique(23); - - insert_result = set2.insert(std::move(node)); - EXPECT_FALSE(node); - EXPECT_TRUE(insert_result.inserted); - EXPECT_FALSE(insert_result.node); - EXPECT_EQ(**insert_result.position, 23); - EXPECT_THAT(set2, UnorderedElementsAre(Pointee(7), Pointee(23))); -} - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector.h deleted file mode 100644 index 34e9aa0a1..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector.h +++ /dev/null @@ -1,1320 +0,0 @@ -// Copyright 2019 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: inlined_vector.h -// ----------------------------------------------------------------------------- -// -// This header file contains the declaration and definition of an "inlined -// vector" which behaves in an equivalent fashion to a `std::vector`, except -// that storage for small sequences of the vector are provided inline without -// requiring any heap allocation. -// -// An `absl::InlinedVector` specifies the default capacity `N` as one of -// its template parameters. Instances where `size() <= N` hold contained -// elements in inline space. Typically `N` is very small so that sequences that -// are expected to be short do not require allocations. -// -// An `absl::InlinedVector` does not usually require a specific allocator. If -// the inlined vector grows beyond its initial constraints, it will need to -// allocate (as any normal `std::vector` would). This is usually performed with -// the default allocator (defined as `std::allocator`). Optionally, a custom -// allocator type may be specified as `A` in `absl::InlinedVector`. - -#ifndef ABSL_CONTAINER_INLINED_VECTOR_H_ -#define ABSL_CONTAINER_INLINED_VECTOR_H_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "absl/algorithm/algorithm.h" -#include "absl/base/internal/throw_delegate.h" -#include "absl/base/optimization.h" -#include "absl/base/port.h" -#include "absl/container/internal/inlined_vector.h" -#include "absl/memory/memory.h" - -namespace absl { -// ----------------------------------------------------------------------------- -// InlinedVector -// ----------------------------------------------------------------------------- -// -// An `absl::InlinedVector` is designed to be a drop-in replacement for -// `std::vector` for use cases where the vector's size is sufficiently small -// that it can be inlined. If the inlined vector does grow beyond its estimated -// capacity, it will trigger an initial allocation on the heap, and will behave -// as a `std:vector`. The API of the `absl::InlinedVector` within this file is -// designed to cover the same API footprint as covered by `std::vector`. -template > -class InlinedVector { - static_assert( - N > 0, "InlinedVector cannot be instantiated with `0` inlined elements."); - - using Storage = inlined_vector_internal::Storage; - using AllocatorTraits = typename Storage::AllocatorTraits; - - template - using EnableIfAtLeastForwardIterator = absl::enable_if_t< - inlined_vector_internal::IsAtLeastForwardIterator::value>; - - template - using DisableIfAtLeastForwardIterator = absl::enable_if_t< - !inlined_vector_internal::IsAtLeastForwardIterator::value>; - - using rvalue_reference = typename Storage::rvalue_reference; - - public: - using allocator_type = typename Storage::allocator_type; - using value_type = typename Storage::value_type; - using pointer = typename Storage::pointer; - using const_pointer = typename Storage::const_pointer; - using reference = typename Storage::reference; - using const_reference = typename Storage::const_reference; - using size_type = typename Storage::size_type; - using difference_type = typename Storage::difference_type; - using iterator = typename Storage::iterator; - using const_iterator = typename Storage::const_iterator; - using reverse_iterator = typename Storage::reverse_iterator; - using const_reverse_iterator = typename Storage::const_reverse_iterator; - - // --------------------------------------------------------------------------- - // InlinedVector Constructors and Destructor - // --------------------------------------------------------------------------- - - // Creates an empty inlined vector with a default initialized allocator. - InlinedVector() noexcept(noexcept(allocator_type())) - : storage_(allocator_type()) {} - - // Creates an empty inlined vector with a specified allocator. - explicit InlinedVector(const allocator_type& alloc) noexcept - : storage_(alloc) {} - - // Creates an inlined vector with `n` copies of `value_type()`. - explicit InlinedVector(size_type n, - const allocator_type& alloc = allocator_type()) - : storage_(alloc) { - InitAssign(n); - } - - // Creates an inlined vector with `n` copies of `v`. - InlinedVector(size_type n, const_reference v, - const allocator_type& alloc = allocator_type()) - : storage_(alloc) { - InitAssign(n, v); - } - - // Creates an inlined vector of copies of the values in `list`. - InlinedVector(std::initializer_list list, - const allocator_type& alloc = allocator_type()) - : storage_(alloc) { - AppendForwardRange(list.begin(), list.end()); - } - - // Creates an inlined vector with elements constructed from the provided - // forward iterator range [`first`, `last`). - // - // NOTE: The `enable_if` prevents ambiguous interpretation between a call to - // this constructor with two integral arguments and a call to the above - // `InlinedVector(size_type, const_reference)` constructor. - template * = nullptr> - InlinedVector(ForwardIterator first, ForwardIterator last, - const allocator_type& alloc = allocator_type()) - : storage_(alloc) { - AppendForwardRange(first, last); - } - - // Creates an inlined vector with elements constructed from the provided input - // iterator range [`first`, `last`). - template * = nullptr> - InlinedVector(InputIterator first, InputIterator last, - const allocator_type& alloc = allocator_type()) - : storage_(alloc) { - std::copy(first, last, std::back_inserter(*this)); - } - - // Creates a copy of an `other` inlined vector using `other`'s allocator. - InlinedVector(const InlinedVector& other) - : InlinedVector(other, other.storage_.GetAllocator()) {} - - // Creates a copy of an `other` inlined vector using a specified allocator. - InlinedVector(const InlinedVector& other, const allocator_type& alloc) - : storage_(alloc) { - reserve(other.size()); - if (storage_.GetIsAllocated()) { - UninitializedCopy(other.begin(), other.end(), - storage_.GetAllocatedData()); - storage_.SetAllocatedSize(other.size()); - } else { - UninitializedCopy(other.begin(), other.end(), storage_.GetInlinedData()); - storage_.SetInlinedSize(other.size()); - } - } - - // Creates an inlined vector by moving in the contents of an `other` inlined - // vector without performing any allocations. If `other` contains allocated - // memory, the newly-created instance will take ownership of that memory - // (leaving `other` empty). However, if `other` does not contain allocated - // memory (i.e. is inlined), the new inlined vector will perform element-wise - // move construction of `other`'s elements. - // - // NOTE: since no allocation is performed for the inlined vector in either - // case, the `noexcept(...)` specification depends on whether moving the - // underlying objects can throw. We assume: - // a) Move constructors should only throw due to allocation failure. - // b) If `value_type`'s move constructor allocates, it uses the same - // allocation function as the `InlinedVector`'s allocator. Thus, the move - // constructor is non-throwing if the allocator is non-throwing or - // `value_type`'s move constructor is specified as `noexcept`. - InlinedVector(InlinedVector&& other) noexcept( - absl::allocator_is_nothrow::value || - std::is_nothrow_move_constructible::value) - : storage_(other.storage_.GetAllocator()) { - if (other.storage_.GetIsAllocated()) { - // We can just steal the underlying buffer from the source. - // That leaves the source empty, so we clear its size. - storage_.SetAllocatedData(other.storage_.GetAllocatedData()); - storage_.SetAllocatedCapacity(other.storage_.GetAllocatedCapacity()); - storage_.SetAllocatedSize(other.size()); - other.storage_.SetInlinedSize(0); - } else { - UninitializedCopy( - std::make_move_iterator(other.storage_.GetInlinedData()), - std::make_move_iterator(other.storage_.GetInlinedData() + - other.size()), - storage_.GetInlinedData()); - storage_.SetInlinedSize(other.size()); - } - } - - // Creates an inlined vector by moving in the contents of an `other` inlined - // vector, performing allocations with the specified `alloc` allocator. If - // `other`'s allocator is not equal to `alloc` and `other` contains allocated - // memory, this move constructor will create a new allocation. - // - // NOTE: since allocation is performed in this case, this constructor can - // only be `noexcept` if the specified allocator is also `noexcept`. If this - // is the case, or if `other` contains allocated memory, this constructor - // performs element-wise move construction of its contents. - // - // Only in the case where `other`'s allocator is equal to `alloc` and `other` - // contains allocated memory will the newly created inlined vector take - // ownership of `other`'s allocated memory. - InlinedVector(InlinedVector&& other, const allocator_type& alloc) noexcept( - absl::allocator_is_nothrow::value) - : storage_(alloc) { - if (other.storage_.GetIsAllocated()) { - if (alloc == other.storage_.GetAllocator()) { - // We can just steal the allocation from the source. - storage_.SetAllocatedSize(other.size()); - storage_.SetAllocatedData(other.storage_.GetAllocatedData()); - storage_.SetAllocatedCapacity(other.storage_.GetAllocatedCapacity()); - other.storage_.SetInlinedSize(0); - } else { - // We need to use our own allocator - reserve(other.size()); - UninitializedCopy(std::make_move_iterator(other.begin()), - std::make_move_iterator(other.end()), - storage_.GetAllocatedData()); - storage_.SetAllocatedSize(other.size()); - } - } else { - UninitializedCopy( - std::make_move_iterator(other.storage_.GetInlinedData()), - std::make_move_iterator(other.storage_.GetInlinedData() + - other.size()), - storage_.GetInlinedData()); - storage_.SetInlinedSize(other.size()); - } - } - - ~InlinedVector() { clear(); } - - // --------------------------------------------------------------------------- - // InlinedVector Member Accessors - // --------------------------------------------------------------------------- - - // `InlinedVector::empty()` - // - // Checks if the inlined vector has no elements. - bool empty() const noexcept { return !size(); } - - // `InlinedVector::size()` - // - // Returns the number of elements in the inlined vector. - size_type size() const noexcept { return storage_.GetSize(); } - - // `InlinedVector::max_size()` - // - // Returns the maximum number of elements the vector can hold. - size_type max_size() const noexcept { - // One bit of the size storage is used to indicate whether the inlined - // vector is allocated. As a result, the maximum size of the container that - // we can express is half of the max for `size_type`. - return (std::numeric_limits::max)() / 2; - } - - // `InlinedVector::capacity()` - // - // Returns the number of elements that can be stored in the inlined vector - // without requiring a reallocation of underlying memory. - // - // NOTE: For most inlined vectors, `capacity()` should equal the template - // parameter `N`. For inlined vectors which exceed this capacity, they - // will no longer be inlined and `capacity()` will equal its capacity on the - // allocated heap. - size_type capacity() const noexcept { - return storage_.GetIsAllocated() ? storage_.GetAllocatedCapacity() - : static_cast(N); - } - - // `InlinedVector::data()` - // - // Returns a `pointer` to elements of the inlined vector. This pointer can be - // used to access and modify the contained elements. - // Only results within the range [`0`, `size()`) are defined. - pointer data() noexcept { - return storage_.GetIsAllocated() ? storage_.GetAllocatedData() - : storage_.GetInlinedData(); - } - - // Overload of `InlinedVector::data()` to return a `const_pointer` to elements - // of the inlined vector. This pointer can be used to access (but not modify) - // the contained elements. - const_pointer data() const noexcept { - return storage_.GetIsAllocated() ? storage_.GetAllocatedData() - : storage_.GetInlinedData(); - } - - // `InlinedVector::operator[]()` - // - // Returns a `reference` to the `i`th element of the inlined vector using the - // array operator. - reference operator[](size_type i) { - assert(i < size()); - return data()[i]; - } - - // Overload of `InlinedVector::operator[]()` to return a `const_reference` to - // the `i`th element of the inlined vector. - const_reference operator[](size_type i) const { - assert(i < size()); - return data()[i]; - } - - // `InlinedVector::at()` - // - // Returns a `reference` to the `i`th element of the inlined vector. - reference at(size_type i) { - if (ABSL_PREDICT_FALSE(i >= size())) { - base_internal::ThrowStdOutOfRange( - "`InlinedVector::at(size_type)` failed bounds check"); - } - return data()[i]; - } - - // Overload of `InlinedVector::at()` to return a `const_reference` to the - // `i`th element of the inlined vector. - const_reference at(size_type i) const { - if (ABSL_PREDICT_FALSE(i >= size())) { - base_internal::ThrowStdOutOfRange( - "`InlinedVector::at(size_type) const` failed bounds check"); - } - return data()[i]; - } - - // `InlinedVector::front()` - // - // Returns a `reference` to the first element of the inlined vector. - reference front() { - assert(!empty()); - return at(0); - } - - // Overload of `InlinedVector::front()` returns a `const_reference` to the - // first element of the inlined vector. - const_reference front() const { - assert(!empty()); - return at(0); - } - - // `InlinedVector::back()` - // - // Returns a `reference` to the last element of the inlined vector. - reference back() { - assert(!empty()); - return at(size() - 1); - } - - // Overload of `InlinedVector::back()` to return a `const_reference` to the - // last element of the inlined vector. - const_reference back() const { - assert(!empty()); - return at(size() - 1); - } - - // `InlinedVector::begin()` - // - // Returns an `iterator` to the beginning of the inlined vector. - iterator begin() noexcept { return data(); } - - // Overload of `InlinedVector::begin()` to return a `const_iterator` to - // the beginning of the inlined vector. - const_iterator begin() const noexcept { return data(); } - - // `InlinedVector::end()` - // - // Returns an `iterator` to the end of the inlined vector. - iterator end() noexcept { return data() + size(); } - - // Overload of `InlinedVector::end()` to return a `const_iterator` to the - // end of the inlined vector. - const_iterator end() const noexcept { return data() + size(); } - - // `InlinedVector::cbegin()` - // - // Returns a `const_iterator` to the beginning of the inlined vector. - const_iterator cbegin() const noexcept { return begin(); } - - // `InlinedVector::cend()` - // - // Returns a `const_iterator` to the end of the inlined vector. - const_iterator cend() const noexcept { return end(); } - - // `InlinedVector::rbegin()` - // - // Returns a `reverse_iterator` from the end of the inlined vector. - reverse_iterator rbegin() noexcept { return reverse_iterator(end()); } - - // Overload of `InlinedVector::rbegin()` to return a - // `const_reverse_iterator` from the end of the inlined vector. - const_reverse_iterator rbegin() const noexcept { - return const_reverse_iterator(end()); - } - - // `InlinedVector::rend()` - // - // Returns a `reverse_iterator` from the beginning of the inlined vector. - reverse_iterator rend() noexcept { return reverse_iterator(begin()); } - - // Overload of `InlinedVector::rend()` to return a `const_reverse_iterator` - // from the beginning of the inlined vector. - const_reverse_iterator rend() const noexcept { - return const_reverse_iterator(begin()); - } - - // `InlinedVector::crbegin()` - // - // Returns a `const_reverse_iterator` from the end of the inlined vector. - const_reverse_iterator crbegin() const noexcept { return rbegin(); } - - // `InlinedVector::crend()` - // - // Returns a `const_reverse_iterator` from the beginning of the inlined - // vector. - const_reverse_iterator crend() const noexcept { return rend(); } - - // `InlinedVector::get_allocator()` - // - // Returns a copy of the allocator of the inlined vector. - allocator_type get_allocator() const { return storage_.GetAllocator(); } - - // --------------------------------------------------------------------------- - // InlinedVector Member Mutators - // --------------------------------------------------------------------------- - - // `InlinedVector::operator=()` - // - // Replaces the contents of the inlined vector with copies of the elements in - // the provided `std::initializer_list`. - InlinedVector& operator=(std::initializer_list list) { - AssignForwardRange(list.begin(), list.end()); - return *this; - } - - // Overload of `InlinedVector::operator=()` to replace the contents of the - // inlined vector with the contents of `other`. - InlinedVector& operator=(const InlinedVector& other) { - if (ABSL_PREDICT_FALSE(this == std::addressof(other))) return *this; - - // Optimized to avoid reallocation. - // Prefer reassignment to copy construction for elements. - if (size() < other.size()) { // grow - reserve(other.size()); - std::copy(other.begin(), other.begin() + size(), begin()); - std::copy(other.begin() + size(), other.end(), std::back_inserter(*this)); - } else { // maybe shrink - erase(begin() + other.size(), end()); - std::copy(other.begin(), other.end(), begin()); - } - return *this; - } - - // Overload of `InlinedVector::operator=()` to replace the contents of the - // inlined vector with the contents of `other`. - // - // NOTE: As a result of calling this overload, `other` may be empty or it's - // contents may be left in a moved-from state. - InlinedVector& operator=(InlinedVector&& other) { - if (ABSL_PREDICT_FALSE(this == std::addressof(other))) return *this; - - if (other.storage_.GetIsAllocated()) { - clear(); - storage_.SetAllocatedSize(other.size()); - storage_.SetAllocatedData(other.storage_.GetAllocatedData()); - storage_.SetAllocatedCapacity(other.storage_.GetAllocatedCapacity()); - other.storage_.SetInlinedSize(0); - } else { - if (storage_.GetIsAllocated()) clear(); - // Both are inlined now. - if (size() < other.size()) { - auto mid = std::make_move_iterator(other.begin() + size()); - std::copy(std::make_move_iterator(other.begin()), mid, begin()); - UninitializedCopy(mid, std::make_move_iterator(other.end()), end()); - } else { - auto new_end = std::copy(std::make_move_iterator(other.begin()), - std::make_move_iterator(other.end()), begin()); - Destroy(new_end, end()); - } - storage_.SetInlinedSize(other.size()); - } - return *this; - } - - // `InlinedVector::assign()` - // - // Replaces the contents of the inlined vector with `n` copies of `v`. - void assign(size_type n, const_reference v) { - if (n <= size()) { // Possibly shrink - std::fill_n(begin(), n, v); - erase(begin() + n, end()); - return; - } - // Grow - reserve(n); - std::fill_n(begin(), size(), v); - if (storage_.GetIsAllocated()) { - UninitializedFill(storage_.GetAllocatedData() + size(), - storage_.GetAllocatedData() + n, v); - storage_.SetAllocatedSize(n); - } else { - UninitializedFill(storage_.GetInlinedData() + size(), - storage_.GetInlinedData() + n, v); - storage_.SetInlinedSize(n); - } - } - - // Overload of `InlinedVector::assign()` to replace the contents of the - // inlined vector with copies of the values in the provided - // `std::initializer_list`. - void assign(std::initializer_list list) { - AssignForwardRange(list.begin(), list.end()); - } - - // Overload of `InlinedVector::assign()` to replace the contents of the - // inlined vector with the forward iterator range [`first`, `last`). - template * = nullptr> - void assign(ForwardIterator first, ForwardIterator last) { - AssignForwardRange(first, last); - } - - // Overload of `InlinedVector::assign()` to replace the contents of the - // inlined vector with the input iterator range [`first`, `last`). - template * = nullptr> - void assign(InputIterator first, InputIterator last) { - size_type assign_index = 0; - for (; (assign_index < size()) && (first != last); - static_cast(++assign_index), static_cast(++first)) { - *(data() + assign_index) = *first; - } - erase(data() + assign_index, data() + size()); - std::copy(first, last, std::back_inserter(*this)); - } - - // `InlinedVector::resize()` - // - // Resizes the inlined vector to contain `n` elements. If `n` is smaller than - // the inlined vector's current size, extra elements are destroyed. If `n` is - // larger than the initial size, new elements are value-initialized. - void resize(size_type n) { - size_type s = size(); - if (n < s) { - erase(begin() + n, end()); - return; - } - reserve(n); - assert(capacity() >= n); - - // Fill new space with elements constructed in-place. - if (storage_.GetIsAllocated()) { - UninitializedFill(storage_.GetAllocatedData() + s, - storage_.GetAllocatedData() + n); - storage_.SetAllocatedSize(n); - } else { - UninitializedFill(storage_.GetInlinedData() + s, - storage_.GetInlinedData() + n); - storage_.SetInlinedSize(n); - } - } - - // Overload of `InlinedVector::resize()` to resize the inlined vector to - // contain `n` elements where, if `n` is larger than `size()`, the new values - // will be copy-constructed from `v`. - void resize(size_type n, const_reference v) { - size_type s = size(); - if (n < s) { - erase(begin() + n, end()); - return; - } - reserve(n); - assert(capacity() >= n); - - // Fill new space with copies of `v`. - if (storage_.GetIsAllocated()) { - UninitializedFill(storage_.GetAllocatedData() + s, - storage_.GetAllocatedData() + n, v); - storage_.SetAllocatedSize(n); - } else { - UninitializedFill(storage_.GetInlinedData() + s, - storage_.GetInlinedData() + n, v); - storage_.SetInlinedSize(n); - } - } - - // `InlinedVector::insert()` - // - // Copies `v` into `pos`, returning an `iterator` pointing to the newly - // inserted element. - iterator insert(const_iterator pos, const_reference v) { - return emplace(pos, v); - } - - // Overload of `InlinedVector::insert()` for moving `v` into `pos`, returning - // an iterator pointing to the newly inserted element. - iterator insert(const_iterator pos, rvalue_reference v) { - return emplace(pos, std::move(v)); - } - - // Overload of `InlinedVector::insert()` for inserting `n` contiguous copies - // of `v` starting at `pos`. Returns an `iterator` pointing to the first of - // the newly inserted elements. - iterator insert(const_iterator pos, size_type n, const_reference v) { - return InsertWithCount(pos, n, v); - } - - // Overload of `InlinedVector::insert()` for copying the contents of the - // `std::initializer_list` into the vector starting at `pos`. Returns an - // `iterator` pointing to the first of the newly inserted elements. - iterator insert(const_iterator pos, std::initializer_list list) { - return insert(pos, list.begin(), list.end()); - } - - // Overload of `InlinedVector::insert()` for inserting elements constructed - // from the forward iterator range [`first`, `last`). Returns an `iterator` - // pointing to the first of the newly inserted elements. - // - // NOTE: The `enable_if` is intended to disambiguate the two three-argument - // overloads of `insert()`. - template * = nullptr> - iterator insert(const_iterator pos, ForwardIterator first, - ForwardIterator last) { - return InsertWithForwardRange(pos, first, last); - } - - // Overload of `InlinedVector::insert()` for inserting elements constructed - // from the input iterator range [`first`, `last`). Returns an `iterator` - // pointing to the first of the newly inserted elements. - template * = nullptr> - iterator insert(const_iterator pos, InputIterator first, InputIterator last) { - size_type initial_insert_index = std::distance(cbegin(), pos); - for (size_type insert_index = initial_insert_index; first != last; - static_cast(++insert_index), static_cast(++first)) { - insert(data() + insert_index, *first); - } - return iterator(data() + initial_insert_index); - } - - // `InlinedVector::emplace()` - // - // Constructs and inserts an object in the inlined vector at the given `pos`, - // returning an `iterator` pointing to the newly emplaced element. - template - iterator emplace(const_iterator pos, Args&&... args) { - assert(pos >= begin()); - assert(pos <= end()); - if (ABSL_PREDICT_FALSE(pos == end())) { - emplace_back(std::forward(args)...); - return end() - 1; - } - - T new_t = T(std::forward(args)...); - - auto range = ShiftRight(pos, 1); - if (range.first == range.second) { - // constructing into uninitialized memory - Construct(range.first, std::move(new_t)); - } else { - // assigning into moved-from object - *range.first = T(std::move(new_t)); - } - - return range.first; - } - - // `InlinedVector::emplace_back()` - // - // Constructs and appends a new element to the end of the inlined vector, - // returning a `reference` to the emplaced element. - template - reference emplace_back(Args&&... args) { - size_type s = size(); - if (ABSL_PREDICT_FALSE(s == capacity())) { - return GrowAndEmplaceBack(std::forward(args)...); - } - pointer space; - if (storage_.GetIsAllocated()) { - storage_.SetAllocatedSize(s + 1); - space = storage_.GetAllocatedData(); - } else { - storage_.SetInlinedSize(s + 1); - space = storage_.GetInlinedData(); - } - return Construct(space + s, std::forward(args)...); - } - - // `InlinedVector::push_back()` - // - // Appends a copy of `v` to the end of the inlined vector. - void push_back(const_reference v) { static_cast(emplace_back(v)); } - - // Overload of `InlinedVector::push_back()` for moving `v` into a newly - // appended element. - void push_back(rvalue_reference v) { - static_cast(emplace_back(std::move(v))); - } - - // `InlinedVector::pop_back()` - // - // Destroys the element at the end of the inlined vector and shrinks the size - // by `1` (unless the inlined vector is empty, in which case this is a no-op). - void pop_back() noexcept { - assert(!empty()); - size_type s = size(); - if (storage_.GetIsAllocated()) { - Destroy(storage_.GetAllocatedData() + s - 1, - storage_.GetAllocatedData() + s); - storage_.SetAllocatedSize(s - 1); - } else { - Destroy(storage_.GetInlinedData() + s - 1, storage_.GetInlinedData() + s); - storage_.SetInlinedSize(s - 1); - } - } - - // `InlinedVector::erase()` - // - // Erases the element at `pos` of the inlined vector, returning an `iterator` - // pointing to the first element following the erased element. - // - // NOTE: May return the end iterator, which is not dereferencable. - iterator erase(const_iterator pos) { - assert(pos >= begin()); - assert(pos < end()); - - iterator position = const_cast(pos); - std::move(position + 1, end(), position); - pop_back(); - return position; - } - - // Overload of `InlinedVector::erase()` for erasing all elements in the - // range [`from`, `to`) in the inlined vector. Returns an `iterator` pointing - // to the first element following the range erased or the end iterator if `to` - // was the end iterator. - iterator erase(const_iterator from, const_iterator to) { - assert(begin() <= from); - assert(from <= to); - assert(to <= end()); - - iterator range_start = const_cast(from); - iterator range_end = const_cast(to); - - size_type s = size(); - ptrdiff_t erase_gap = std::distance(range_start, range_end); - if (erase_gap > 0) { - pointer space; - if (storage_.GetIsAllocated()) { - space = storage_.GetAllocatedData(); - storage_.SetAllocatedSize(s - erase_gap); - } else { - space = storage_.GetInlinedData(); - storage_.SetInlinedSize(s - erase_gap); - } - std::move(range_end, space + s, range_start); - Destroy(space + s - erase_gap, space + s); - } - return range_start; - } - - // `InlinedVector::clear()` - // - // Destroys all elements in the inlined vector, sets the size of `0` and - // deallocates the heap allocation if the inlined vector was allocated. - void clear() noexcept { - size_type s = size(); - if (storage_.GetIsAllocated()) { - Destroy(storage_.GetAllocatedData(), storage_.GetAllocatedData() + s); - AllocatorTraits::deallocate(storage_.GetAllocator(), - storage_.GetAllocatedData(), - storage_.GetAllocatedCapacity()); - } else if (s != 0) { // do nothing for empty vectors - Destroy(storage_.GetInlinedData(), storage_.GetInlinedData() + s); - } - storage_.SetInlinedSize(0); - } - - // `InlinedVector::reserve()` - // - // Enlarges the underlying representation of the inlined vector so it can hold - // at least `n` elements. This method does not change `size()` or the actual - // contents of the vector. - // - // NOTE: If `n` does not exceed `capacity()`, `reserve()` will have no - // effects. Otherwise, `reserve()` will reallocate, performing an n-time - // element-wise move of everything contained. - void reserve(size_type n) { - if (n > capacity()) { - // Make room for new elements - EnlargeBy(n - size()); - } - } - - // `InlinedVector::shrink_to_fit()` - // - // Reduces memory usage by freeing unused memory. After this call, calls to - // `capacity()` will be equal to `max(N, size())`. - // - // If `size() <= N` and the elements are currently stored on the heap, they - // will be moved to the inlined storage and the heap memory will be - // deallocated. - // - // If `size() > N` and `size() < capacity()` the elements will be moved to a - // smaller heap allocation. - void shrink_to_fit() { - const auto s = size(); - if (ABSL_PREDICT_FALSE(!storage_.GetIsAllocated() || s == capacity())) - return; - - if (s <= N) { - // Move the elements to the inlined storage. - // We have to do this using a temporary, because `inlined_storage` and - // `allocation_storage` are in a union field. - auto temp = std::move(*this); - assign(std::make_move_iterator(temp.begin()), - std::make_move_iterator(temp.end())); - return; - } - - // Reallocate storage and move elements. - // We can't simply use the same approach as above, because `assign()` would - // call into `reserve()` internally and reserve larger capacity than we need - pointer new_data = AllocatorTraits::allocate(storage_.GetAllocator(), s); - UninitializedCopy(std::make_move_iterator(storage_.GetAllocatedData()), - std::make_move_iterator(storage_.GetAllocatedData() + s), - new_data); - ResetAllocation(new_data, s, s); - } - - // `InlinedVector::swap()` - // - // Swaps the contents of this inlined vector with the contents of `other`. - void swap(InlinedVector& other) { - if (ABSL_PREDICT_FALSE(this == std::addressof(other))) return; - - SwapImpl(other); - } - - private: - template - friend H AbslHashValue(H h, const absl::InlinedVector& a); - - void ResetAllocation(pointer new_data, size_type new_capacity, - size_type new_size) { - if (storage_.GetIsAllocated()) { - Destroy(storage_.GetAllocatedData(), - storage_.GetAllocatedData() + size()); - assert(begin() == storage_.GetAllocatedData()); - AllocatorTraits::deallocate(storage_.GetAllocator(), - storage_.GetAllocatedData(), - storage_.GetAllocatedCapacity()); - } else { - Destroy(storage_.GetInlinedData(), storage_.GetInlinedData() + size()); - } - - storage_.SetAllocatedData(new_data); - storage_.SetAllocatedCapacity(new_capacity); - storage_.SetAllocatedSize(new_size); - } - - template - reference Construct(pointer p, Args&&... args) { - std::allocator_traits::construct( - storage_.GetAllocator(), p, std::forward(args)...); - return *p; - } - - template - void UninitializedCopy(Iterator src, Iterator src_last, pointer dst) { - for (; src != src_last; ++dst, ++src) Construct(dst, *src); - } - - template - void UninitializedFill(pointer dst, pointer dst_last, const Args&... args) { - for (; dst != dst_last; ++dst) Construct(dst, args...); - } - - // Destroy [`from`, `to`) in place. - void Destroy(pointer from, pointer to) { - for (pointer cur = from; cur != to; ++cur) { - std::allocator_traits::destroy(storage_.GetAllocator(), - cur); - } -#if !defined(NDEBUG) - // Overwrite unused memory with `0xab` so we can catch uninitialized usage. - // Cast to `void*` to tell the compiler that we don't care that we might be - // scribbling on a vtable pointer. - if (from != to) { - auto len = sizeof(value_type) * std::distance(from, to); - std::memset(reinterpret_cast(from), 0xab, len); - } -#endif // !defined(NDEBUG) - } - - // Enlarge the underlying representation so we can store `size_ + delta` elems - // in allocated space. The size is not changed, and any newly added memory is - // not initialized. - void EnlargeBy(size_type delta) { - const size_type s = size(); - assert(s <= capacity()); - - size_type target = (std::max)(static_cast(N), s + delta); - - // Compute new capacity by repeatedly doubling current capacity - // TODO(psrc): Check and avoid overflow? - size_type new_capacity = capacity(); - while (new_capacity < target) { - new_capacity <<= 1; - } - - pointer new_data = - AllocatorTraits::allocate(storage_.GetAllocator(), new_capacity); - - UninitializedCopy(std::make_move_iterator(data()), - std::make_move_iterator(data() + s), new_data); - - ResetAllocation(new_data, new_capacity, s); - } - - // Shift all elements from `position` to `end()` by `n` places to the right. - // If the vector needs to be enlarged, memory will be allocated. - // Returns `iterator`s pointing to the start of the previously-initialized - // portion and the start of the uninitialized portion of the created gap. - // The number of initialized spots is `pair.second - pair.first`. The number - // of raw spots is `n - (pair.second - pair.first)`. - // - // Updates the size of the InlinedVector internally. - std::pair ShiftRight(const_iterator position, - size_type n) { - iterator start_used = const_cast(position); - iterator start_raw = const_cast(position); - size_type s = size(); - size_type required_size = s + n; - - if (required_size > capacity()) { - // Compute new capacity by repeatedly doubling current capacity - size_type new_capacity = capacity(); - while (new_capacity < required_size) { - new_capacity <<= 1; - } - // Move everyone into the new allocation, leaving a gap of `n` for the - // requested shift. - pointer new_data = - AllocatorTraits::allocate(storage_.GetAllocator(), new_capacity); - size_type index = position - begin(); - UninitializedCopy(std::make_move_iterator(data()), - std::make_move_iterator(data() + index), new_data); - UninitializedCopy(std::make_move_iterator(data() + index), - std::make_move_iterator(data() + s), - new_data + index + n); - ResetAllocation(new_data, new_capacity, s); - - // New allocation means our iterator is invalid, so we'll recalculate. - // Since the entire gap is in new space, there's no used space to reuse. - start_raw = begin() + index; - start_used = start_raw; - } else { - // If we had enough space, it's a two-part move. Elements going into - // previously-unoccupied space need an `UninitializedCopy()`. Elements - // going into a previously-occupied space are just a `std::move()`. - iterator pos = const_cast(position); - iterator raw_space = end(); - size_type slots_in_used_space = raw_space - pos; - size_type new_elements_in_used_space = (std::min)(n, slots_in_used_space); - size_type new_elements_in_raw_space = n - new_elements_in_used_space; - size_type old_elements_in_used_space = - slots_in_used_space - new_elements_in_used_space; - - UninitializedCopy( - std::make_move_iterator(pos + old_elements_in_used_space), - std::make_move_iterator(raw_space), - raw_space + new_elements_in_raw_space); - std::move_backward(pos, pos + old_elements_in_used_space, raw_space); - - // If the gap is entirely in raw space, the used space starts where the - // raw space starts, leaving no elements in used space. If the gap is - // entirely in used space, the raw space starts at the end of the gap, - // leaving all elements accounted for within the used space. - start_used = pos; - start_raw = pos + new_elements_in_used_space; - } - storage_.AddSize(n); - return std::make_pair(start_used, start_raw); - } - - template - reference GrowAndEmplaceBack(Args&&... args) { - assert(size() == capacity()); - const size_type s = size(); - - size_type new_capacity = 2 * capacity(); - pointer new_data = - AllocatorTraits::allocate(storage_.GetAllocator(), new_capacity); - - reference new_element = - Construct(new_data + s, std::forward(args)...); - UninitializedCopy(std::make_move_iterator(data()), - std::make_move_iterator(data() + s), new_data); - - ResetAllocation(new_data, new_capacity, s + 1); - - return new_element; - } - - void InitAssign(size_type n) { - if (n > static_cast(N)) { - pointer new_data = AllocatorTraits::allocate(storage_.GetAllocator(), n); - storage_.SetAllocatedData(new_data); - storage_.SetAllocatedCapacity(n); - UninitializedFill(storage_.GetAllocatedData(), - storage_.GetAllocatedData() + n); - storage_.SetAllocatedSize(n); - } else { - UninitializedFill(storage_.GetInlinedData(), - storage_.GetInlinedData() + n); - storage_.SetInlinedSize(n); - } - } - - void InitAssign(size_type n, const_reference v) { - if (n > static_cast(N)) { - pointer new_data = AllocatorTraits::allocate(storage_.GetAllocator(), n); - storage_.SetAllocatedData(new_data); - storage_.SetAllocatedCapacity(n); - UninitializedFill(storage_.GetAllocatedData(), - storage_.GetAllocatedData() + n, v); - storage_.SetAllocatedSize(n); - } else { - UninitializedFill(storage_.GetInlinedData(), - storage_.GetInlinedData() + n, v); - storage_.SetInlinedSize(n); - } - } - - template - void AssignForwardRange(ForwardIt first, ForwardIt last) { - static_assert(absl::inlined_vector_internal::IsAtLeastForwardIterator< - ForwardIt>::value, - ""); - - auto length = std::distance(first, last); - - // Prefer reassignment to copy construction for elements. - if (static_cast(length) <= size()) { - erase(std::copy(first, last, begin()), end()); - return; - } - - reserve(length); - iterator out = begin(); - for (; out != end(); ++first, ++out) *out = *first; - if (storage_.GetIsAllocated()) { - UninitializedCopy(first, last, out); - storage_.SetAllocatedSize(length); - } else { - UninitializedCopy(first, last, out); - storage_.SetInlinedSize(length); - } - } - - template - void AppendForwardRange(ForwardIt first, ForwardIt last) { - static_assert(absl::inlined_vector_internal::IsAtLeastForwardIterator< - ForwardIt>::value, - ""); - - auto length = std::distance(first, last); - reserve(size() + length); - if (storage_.GetIsAllocated()) { - UninitializedCopy(first, last, storage_.GetAllocatedData() + size()); - storage_.SetAllocatedSize(size() + length); - } else { - UninitializedCopy(first, last, storage_.GetInlinedData() + size()); - storage_.SetInlinedSize(size() + length); - } - } - - iterator InsertWithCount(const_iterator position, size_type n, - const_reference v) { - assert(position >= begin() && position <= end()); - if (ABSL_PREDICT_FALSE(n == 0)) return const_cast(position); - - value_type copy = v; - std::pair it_pair = ShiftRight(position, n); - std::fill(it_pair.first, it_pair.second, copy); - UninitializedFill(it_pair.second, it_pair.first + n, copy); - - return it_pair.first; - } - - template - iterator InsertWithForwardRange(const_iterator position, ForwardIt first, - ForwardIt last) { - static_assert(absl::inlined_vector_internal::IsAtLeastForwardIterator< - ForwardIt>::value, - ""); - assert(position >= begin() && position <= end()); - - if (ABSL_PREDICT_FALSE(first == last)) - return const_cast(position); - - auto n = std::distance(first, last); - std::pair it_pair = ShiftRight(position, n); - size_type used_spots = it_pair.second - it_pair.first; - auto open_spot = std::next(first, used_spots); - std::copy(first, open_spot, it_pair.first); - UninitializedCopy(open_spot, last, it_pair.second); - return it_pair.first; - } - - void SwapImpl(InlinedVector& other) { - using std::swap; - - bool is_allocated = storage_.GetIsAllocated(); - bool other_is_allocated = other.storage_.GetIsAllocated(); - - if (is_allocated && other_is_allocated) { - // Both out of line, so just swap the tag, allocation, and allocator. - storage_.SwapSizeAndIsAllocated(std::addressof(other.storage_)); - storage_.SwapAllocatedSizeAndCapacity(std::addressof(other.storage_)); - swap(storage_.GetAllocator(), other.storage_.GetAllocator()); - - return; - } - - if (!is_allocated && !other_is_allocated) { - // Both inlined: swap up to smaller size, then move remaining elements. - InlinedVector* a = this; - InlinedVector* b = std::addressof(other); - if (size() < other.size()) { - swap(a, b); - } - - const size_type a_size = a->size(); - const size_type b_size = b->size(); - assert(a_size >= b_size); - // `a` is larger. Swap the elements up to the smaller array size. - std::swap_ranges(a->storage_.GetInlinedData(), - a->storage_.GetInlinedData() + b_size, - b->storage_.GetInlinedData()); - - // Move the remaining elements: - // [`b_size`, `a_size`) from `a` -> [`b_size`, `a_size`) from `b` - b->UninitializedCopy(a->storage_.GetInlinedData() + b_size, - a->storage_.GetInlinedData() + a_size, - b->storage_.GetInlinedData() + b_size); - a->Destroy(a->storage_.GetInlinedData() + b_size, - a->storage_.GetInlinedData() + a_size); - - storage_.SwapSizeAndIsAllocated(std::addressof(other.storage_)); - swap(storage_.GetAllocator(), other.storage_.GetAllocator()); - - assert(b->size() == a_size); - assert(a->size() == b_size); - return; - } - - // One is out of line, one is inline. - // We first move the elements from the inlined vector into the - // inlined space in the other vector. We then put the other vector's - // pointer/capacity into the originally inlined vector and swap - // the tags. - InlinedVector* a = this; - InlinedVector* b = std::addressof(other); - if (a->storage_.GetIsAllocated()) { - swap(a, b); - } - - assert(!a->storage_.GetIsAllocated()); - assert(b->storage_.GetIsAllocated()); - - const size_type a_size = a->size(); - const size_type b_size = b->size(); - // In an optimized build, `b_size` would be unused. - static_cast(b_size); - - // Made Local copies of `size()`, these can now be swapped - a->storage_.SwapSizeAndIsAllocated(std::addressof(b->storage_)); - - // Copy out before `b`'s union gets clobbered by `inline_space` - pointer b_data = b->storage_.GetAllocatedData(); - size_type b_capacity = b->storage_.GetAllocatedCapacity(); - - b->UninitializedCopy(a->storage_.GetInlinedData(), - a->storage_.GetInlinedData() + a_size, - b->storage_.GetInlinedData()); - a->Destroy(a->storage_.GetInlinedData(), - a->storage_.GetInlinedData() + a_size); - - a->storage_.SetAllocatedData(b_data); - a->storage_.SetAllocatedCapacity(b_capacity); - - if (a->storage_.GetAllocator() != b->storage_.GetAllocator()) { - swap(a->storage_.GetAllocator(), b->storage_.GetAllocator()); - } - - assert(b->size() == a_size); - assert(a->size() == b_size); - } - - Storage storage_; -}; - -// ----------------------------------------------------------------------------- -// InlinedVector Non-Member Functions -// ----------------------------------------------------------------------------- - -// `swap()` -// -// Swaps the contents of two inlined vectors. This convenience function -// simply calls `InlinedVector::swap()`. -template -void swap(absl::InlinedVector& a, - absl::InlinedVector& b) noexcept(noexcept(a.swap(b))) { - a.swap(b); -} - -// `operator==()` -// -// Tests the equivalency of the contents of two inlined vectors. -template -bool operator==(const absl::InlinedVector& a, - const absl::InlinedVector& b) { - auto a_data = a.data(); - auto a_size = a.size(); - auto b_data = b.data(); - auto b_size = b.size(); - return absl::equal(a_data, a_data + a_size, b_data, b_data + b_size); -} - -// `operator!=()` -// -// Tests the inequality of the contents of two inlined vectors. -template -bool operator!=(const absl::InlinedVector& a, - const absl::InlinedVector& b) { - return !(a == b); -} - -// `operator<()` -// -// Tests whether the contents of one inlined vector are less than the contents -// of another through a lexicographical comparison operation. -template -bool operator<(const absl::InlinedVector& a, - const absl::InlinedVector& b) { - auto a_data = a.data(); - auto a_size = a.size(); - auto b_data = b.data(); - auto b_size = b.size(); - return std::lexicographical_compare(a_data, a_data + a_size, b_data, - b_data + b_size); -} - -// `operator>()` -// -// Tests whether the contents of one inlined vector are greater than the -// contents of another through a lexicographical comparison operation. -template -bool operator>(const absl::InlinedVector& a, - const absl::InlinedVector& b) { - return b < a; -} - -// `operator<=()` -// -// Tests whether the contents of one inlined vector are less than or equal to -// the contents of another through a lexicographical comparison operation. -template -bool operator<=(const absl::InlinedVector& a, - const absl::InlinedVector& b) { - return !(b < a); -} - -// `operator>=()` -// -// Tests whether the contents of one inlined vector are greater than or equal to -// the contents of another through a lexicographical comparison operation. -template -bool operator>=(const absl::InlinedVector& a, - const absl::InlinedVector& b) { - return !(a < b); -} - -// `AbslHashValue()` -// -// Provides `absl::Hash` support for `absl::InlinedVector`. You do not normally -// call this function directly. -template -H AbslHashValue(H h, const absl::InlinedVector& a) { - auto a_data = a.data(); - auto a_size = a.size(); - return H::combine(H::combine_contiguous(std::move(h), a_data, a_size), - a_size); -} - -} // namespace absl - -#endif // ABSL_CONTAINER_INLINED_VECTOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc deleted file mode 100644 index 867a29ea3..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector_benchmark.cc +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/inlined_vector.h" - -#include -#include - -#include "benchmark/benchmark.h" -#include "absl/base/internal/raw_logging.h" -#include "absl/strings/str_cat.h" - -namespace { - -void BM_InlinedVectorFill(benchmark::State& state) { - absl::InlinedVector v; - int val = 10; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - v.push_back(val); - } -} -BENCHMARK(BM_InlinedVectorFill)->Range(0, 1024); - -void BM_InlinedVectorFillRange(benchmark::State& state) { - const int len = state.range(0); - std::unique_ptr ia(new int[len]); - for (int i = 0; i < len; i++) { - ia[i] = i; - } - auto* from = ia.get(); - auto* to = from + len; - for (auto _ : state) { - benchmark::DoNotOptimize(from); - benchmark::DoNotOptimize(to); - absl::InlinedVector v(from, to); - benchmark::DoNotOptimize(v); - } -} -BENCHMARK(BM_InlinedVectorFillRange)->Range(0, 1024); - -void BM_StdVectorFill(benchmark::State& state) { - std::vector v; - int val = 10; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(val); - v.push_back(val); - } -} -BENCHMARK(BM_StdVectorFill)->Range(0, 1024); - -// The purpose of the next two benchmarks is to verify that -// absl::InlinedVector is efficient when moving is more efficent than -// copying. To do so, we use strings that are larger than the short -// string optimization. -bool StringRepresentedInline(std::string s) { - const char* chars = s.data(); - std::string s1 = std::move(s); - return s1.data() != chars; -} - -int GetNonShortStringOptimizationSize() { - for (int i = 24; i <= 192; i *= 2) { - if (!StringRepresentedInline(std::string(i, 'A'))) { - return i; - } - } - ABSL_RAW_LOG( - FATAL, - "Failed to find a std::string larger than the short std::string optimization"); - return -1; -} - -void BM_InlinedVectorFillString(benchmark::State& state) { - const int len = state.range(0); - const int no_sso = GetNonShortStringOptimizationSize(); - std::string strings[4] = {std::string(no_sso, 'A'), std::string(no_sso, 'B'), - std::string(no_sso, 'C'), std::string(no_sso, 'D')}; - - for (auto _ : state) { - absl::InlinedVector v; - for (int i = 0; i < len; i++) { - v.push_back(strings[i & 3]); - } - } - state.SetItemsProcessed(static_cast(state.iterations()) * len); -} -BENCHMARK(BM_InlinedVectorFillString)->Range(0, 1024); - -void BM_StdVectorFillString(benchmark::State& state) { - const int len = state.range(0); - const int no_sso = GetNonShortStringOptimizationSize(); - std::string strings[4] = {std::string(no_sso, 'A'), std::string(no_sso, 'B'), - std::string(no_sso, 'C'), std::string(no_sso, 'D')}; - - for (auto _ : state) { - std::vector v; - for (int i = 0; i < len; i++) { - v.push_back(strings[i & 3]); - } - } - state.SetItemsProcessed(static_cast(state.iterations()) * len); -} -BENCHMARK(BM_StdVectorFillString)->Range(0, 1024); - -struct Buffer { // some arbitrary structure for benchmarking. - char* base; - int length; - int capacity; - void* user_data; -}; - -void BM_InlinedVectorAssignments(benchmark::State& state) { - const int len = state.range(0); - using BufferVec = absl::InlinedVector; - - BufferVec src; - src.resize(len); - - BufferVec dst; - for (auto _ : state) { - benchmark::DoNotOptimize(dst); - benchmark::DoNotOptimize(src); - dst = src; - } -} -BENCHMARK(BM_InlinedVectorAssignments) - ->Arg(0) - ->Arg(1) - ->Arg(2) - ->Arg(3) - ->Arg(4) - ->Arg(20); - -void BM_CreateFromContainer(benchmark::State& state) { - for (auto _ : state) { - absl::InlinedVector src{1, 2, 3}; - benchmark::DoNotOptimize(src); - absl::InlinedVector dst(std::move(src)); - benchmark::DoNotOptimize(dst); - } -} -BENCHMARK(BM_CreateFromContainer); - -struct LargeCopyableOnly { - LargeCopyableOnly() : d(1024, 17) {} - LargeCopyableOnly(const LargeCopyableOnly& o) = default; - LargeCopyableOnly& operator=(const LargeCopyableOnly& o) = default; - - std::vector d; -}; - -struct LargeCopyableSwappable { - LargeCopyableSwappable() : d(1024, 17) {} - - LargeCopyableSwappable(const LargeCopyableSwappable& o) = default; - - LargeCopyableSwappable& operator=(LargeCopyableSwappable o) { - using std::swap; - swap(*this, o); - return *this; - } - - friend void swap(LargeCopyableSwappable& a, LargeCopyableSwappable& b) { - using std::swap; - swap(a.d, b.d); - } - - std::vector d; -}; - -struct LargeCopyableMovable { - LargeCopyableMovable() : d(1024, 17) {} - // Use implicitly defined copy and move. - - std::vector d; -}; - -struct LargeCopyableMovableSwappable { - LargeCopyableMovableSwappable() : d(1024, 17) {} - LargeCopyableMovableSwappable(const LargeCopyableMovableSwappable& o) = - default; - LargeCopyableMovableSwappable(LargeCopyableMovableSwappable&& o) = default; - - LargeCopyableMovableSwappable& operator=(LargeCopyableMovableSwappable o) { - using std::swap; - swap(*this, o); - return *this; - } - LargeCopyableMovableSwappable& operator=(LargeCopyableMovableSwappable&& o) = - default; - - friend void swap(LargeCopyableMovableSwappable& a, - LargeCopyableMovableSwappable& b) { - using std::swap; - swap(a.d, b.d); - } - - std::vector d; -}; - -template -void BM_SwapElements(benchmark::State& state) { - const int len = state.range(0); - using Vec = absl::InlinedVector; - Vec a(len); - Vec b; - for (auto _ : state) { - using std::swap; - benchmark::DoNotOptimize(a); - benchmark::DoNotOptimize(b); - swap(a, b); - } -} -BENCHMARK_TEMPLATE(BM_SwapElements, LargeCopyableOnly)->Range(0, 1024); -BENCHMARK_TEMPLATE(BM_SwapElements, LargeCopyableSwappable)->Range(0, 1024); -BENCHMARK_TEMPLATE(BM_SwapElements, LargeCopyableMovable)->Range(0, 1024); -BENCHMARK_TEMPLATE(BM_SwapElements, LargeCopyableMovableSwappable) - ->Range(0, 1024); - -// The following benchmark is meant to track the efficiency of the vector size -// as a function of stored type via the benchmark label. It is not meant to -// output useful sizeof operator performance. The loop is a dummy operation -// to fulfill the requirement of running the benchmark. -template -void BM_Sizeof(benchmark::State& state) { - int size = 0; - for (auto _ : state) { - VecType vec; - size = sizeof(vec); - } - state.SetLabel(absl::StrCat("sz=", size)); -} -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); - -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); - -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); - -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); -BENCHMARK_TEMPLATE(BM_Sizeof, absl::InlinedVector); - -void BM_InlinedVectorIndexInlined(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v[4]); - } -} -BENCHMARK(BM_InlinedVectorIndexInlined); - -void BM_InlinedVectorIndexExternal(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v[4]); - } -} -BENCHMARK(BM_InlinedVectorIndexExternal); - -void BM_StdVectorIndex(benchmark::State& state) { - std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v[4]); - } -} -BENCHMARK(BM_StdVectorIndex); - -void BM_InlinedVectorDataInlined(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.data()); - } -} -BENCHMARK(BM_InlinedVectorDataInlined); - -void BM_InlinedVectorDataExternal(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.data()); - } - state.SetItemsProcessed(16 * static_cast(state.iterations())); -} -BENCHMARK(BM_InlinedVectorDataExternal); - -void BM_StdVectorData(benchmark::State& state) { - std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.data()); - } - state.SetItemsProcessed(16 * static_cast(state.iterations())); -} -BENCHMARK(BM_StdVectorData); - -void BM_InlinedVectorSizeInlined(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.size()); - } -} -BENCHMARK(BM_InlinedVectorSizeInlined); - -void BM_InlinedVectorSizeExternal(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.size()); - } -} -BENCHMARK(BM_InlinedVectorSizeExternal); - -void BM_StdVectorSize(benchmark::State& state) { - std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.size()); - } -} -BENCHMARK(BM_StdVectorSize); - -void BM_InlinedVectorEmptyInlined(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.empty()); - } -} -BENCHMARK(BM_InlinedVectorEmptyInlined); - -void BM_InlinedVectorEmptyExternal(benchmark::State& state) { - absl::InlinedVector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.empty()); - } -} -BENCHMARK(BM_InlinedVectorEmptyExternal); - -void BM_StdVectorEmpty(benchmark::State& state) { - std::vector v = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; - for (auto _ : state) { - benchmark::DoNotOptimize(v); - benchmark::DoNotOptimize(v.empty()); - } -} -BENCHMARK(BM_StdVectorEmpty); - -} // namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector_test.cc deleted file mode 100644 index 6037001a0..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/inlined_vector_test.cc +++ /dev/null @@ -1,1784 +0,0 @@ -// Copyright 2017 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/inlined_vector.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/base/attributes.h" -#include "absl/base/internal/exception_testing.h" -#include "absl/base/internal/raw_logging.h" -#include "absl/base/macros.h" -#include "absl/container/internal/counting_allocator.h" -#include "absl/container/internal/test_instance_tracker.h" -#include "absl/hash/hash_testing.h" -#include "absl/memory/memory.h" -#include "absl/strings/str_cat.h" - -namespace { - -using absl::container_internal::CountingAllocator; -using absl::test_internal::CopyableMovableInstance; -using absl::test_internal::CopyableOnlyInstance; -using absl::test_internal::InstanceTracker; -using testing::AllOf; -using testing::Each; -using testing::ElementsAre; -using testing::ElementsAreArray; -using testing::Eq; -using testing::Gt; -using testing::PrintToString; - -using IntVec = absl::InlinedVector; - -MATCHER_P(SizeIs, n, "") { - return testing::ExplainMatchResult(n, arg.size(), result_listener); -} - -MATCHER_P(CapacityIs, n, "") { - return testing::ExplainMatchResult(n, arg.capacity(), result_listener); -} - -MATCHER_P(ValueIs, e, "") { - return testing::ExplainMatchResult(e, arg.value(), result_listener); -} - -// TODO(bsamwel): Add support for movable-only types. - -// Test fixture for typed tests on BaseCountedInstance derived classes, see -// test_instance_tracker.h. -template -class InstanceTest : public ::testing::Test {}; -TYPED_TEST_SUITE_P(InstanceTest); - -// A simple reference counted class to make sure that the proper elements are -// destroyed in the erase(begin, end) test. -class RefCounted { - public: - RefCounted(int value, int* count) : value_(value), count_(count) { - Ref(); - } - - RefCounted(const RefCounted& v) - : value_(v.value_), count_(v.count_) { - Ref(); - } - - ~RefCounted() { - Unref(); - count_ = nullptr; - } - - friend void swap(RefCounted& a, RefCounted& b) { - using std::swap; - swap(a.value_, b.value_); - swap(a.count_, b.count_); - } - - RefCounted& operator=(RefCounted v) { - using std::swap; - swap(*this, v); - return *this; - } - - void Ref() const { - ABSL_RAW_CHECK(count_ != nullptr, ""); - ++(*count_); - } - - void Unref() const { - --(*count_); - ABSL_RAW_CHECK(*count_ >= 0, ""); - } - - int value_; - int* count_; -}; - -using RefCountedVec = absl::InlinedVector; - -// A class with a vtable pointer -class Dynamic { - public: - virtual ~Dynamic() {} -}; - -using DynamicVec = absl::InlinedVector; - -// Append 0..len-1 to *v -template -static void Fill(Container* v, int len, int offset = 0) { - for (int i = 0; i < len; i++) { - v->push_back(i + offset); - } -} - -static IntVec Fill(int len, int offset = 0) { - IntVec v; - Fill(&v, len, offset); - return v; -} - -TEST(IntVec, SimpleOps) { - for (int len = 0; len < 20; len++) { - IntVec v; - const IntVec& cv = v; // const alias - - Fill(&v, len); - EXPECT_EQ(len, v.size()); - EXPECT_LE(len, v.capacity()); - - for (int i = 0; i < len; i++) { - EXPECT_EQ(i, v[i]); - EXPECT_EQ(i, v.at(i)); - } - EXPECT_EQ(v.begin(), v.data()); - EXPECT_EQ(cv.begin(), cv.data()); - - int counter = 0; - for (IntVec::iterator iter = v.begin(); iter != v.end(); ++iter) { - EXPECT_EQ(counter, *iter); - counter++; - } - EXPECT_EQ(counter, len); - - counter = 0; - for (IntVec::const_iterator iter = v.begin(); iter != v.end(); ++iter) { - EXPECT_EQ(counter, *iter); - counter++; - } - EXPECT_EQ(counter, len); - - counter = 0; - for (IntVec::const_iterator iter = v.cbegin(); iter != v.cend(); ++iter) { - EXPECT_EQ(counter, *iter); - counter++; - } - EXPECT_EQ(counter, len); - - if (len > 0) { - EXPECT_EQ(0, v.front()); - EXPECT_EQ(len - 1, v.back()); - v.pop_back(); - EXPECT_EQ(len - 1, v.size()); - for (int i = 0; i < v.size(); ++i) { - EXPECT_EQ(i, v[i]); - EXPECT_EQ(i, v.at(i)); - } - } - } -} - -TEST(IntVec, AtThrows) { - IntVec v = {1, 2, 3}; - EXPECT_EQ(v.at(2), 3); - ABSL_BASE_INTERNAL_EXPECT_FAIL(v.at(3), std::out_of_range, - "failed bounds check"); -} - -TEST(IntVec, ReverseIterator) { - for (int len = 0; len < 20; len++) { - IntVec v; - Fill(&v, len); - - int counter = len; - for (IntVec::reverse_iterator iter = v.rbegin(); iter != v.rend(); ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - - counter = len; - for (IntVec::const_reverse_iterator iter = v.rbegin(); iter != v.rend(); - ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - - counter = len; - for (IntVec::const_reverse_iterator iter = v.crbegin(); iter != v.crend(); - ++iter) { - counter--; - EXPECT_EQ(counter, *iter); - } - EXPECT_EQ(counter, 0); - } -} - -TEST(IntVec, Erase) { - for (int len = 1; len < 20; len++) { - for (int i = 0; i < len; ++i) { - IntVec v; - Fill(&v, len); - v.erase(v.begin() + i); - EXPECT_EQ(len - 1, v.size()); - for (int j = 0; j < i; ++j) { - EXPECT_EQ(j, v[j]); - } - for (int j = i; j < len - 1; ++j) { - EXPECT_EQ(j + 1, v[j]); - } - } - } -} - -// At the end of this test loop, the elements between [erase_begin, erase_end) -// should have reference counts == 0, and all others elements should have -// reference counts == 1. -TEST(RefCountedVec, EraseBeginEnd) { - for (int len = 1; len < 20; ++len) { - for (int erase_begin = 0; erase_begin < len; ++erase_begin) { - for (int erase_end = erase_begin; erase_end <= len; ++erase_end) { - std::vector counts(len, 0); - RefCountedVec v; - for (int i = 0; i < len; ++i) { - v.push_back(RefCounted(i, &counts[i])); - } - - int erase_len = erase_end - erase_begin; - - v.erase(v.begin() + erase_begin, v.begin() + erase_end); - - EXPECT_EQ(len - erase_len, v.size()); - - // Check the elements before the first element erased. - for (int i = 0; i < erase_begin; ++i) { - EXPECT_EQ(i, v[i].value_); - } - - // Check the elements after the first element erased. - for (int i = erase_begin; i < v.size(); ++i) { - EXPECT_EQ(i + erase_len, v[i].value_); - } - - // Check that the elements at the beginning are preserved. - for (int i = 0; i < erase_begin; ++i) { - EXPECT_EQ(1, counts[i]); - } - - // Check that the erased elements are destroyed - for (int i = erase_begin; i < erase_end; ++i) { - EXPECT_EQ(0, counts[i]); - } - - // Check that the elements at the end are preserved. - for (int i = erase_end; i< len; ++i) { - EXPECT_EQ(1, counts[i]); - } - } - } - } -} - -struct NoDefaultCtor { - explicit NoDefaultCtor(int) {} -}; -struct NoCopy { - NoCopy() {} - NoCopy(const NoCopy&) = delete; -}; -struct NoAssign { - NoAssign() {} - NoAssign& operator=(const NoAssign&) = delete; -}; -struct MoveOnly { - MoveOnly() {} - MoveOnly(MoveOnly&&) = default; - MoveOnly& operator=(MoveOnly&&) = default; -}; -TEST(InlinedVectorTest, NoDefaultCtor) { - absl::InlinedVector v(10, NoDefaultCtor(2)); - (void)v; -} -TEST(InlinedVectorTest, NoCopy) { - absl::InlinedVector v(10); - (void)v; -} -TEST(InlinedVectorTest, NoAssign) { - absl::InlinedVector v(10); - (void)v; -} -TEST(InlinedVectorTest, MoveOnly) { - absl::InlinedVector v; - v.push_back(MoveOnly{}); - v.push_back(MoveOnly{}); - v.push_back(MoveOnly{}); - v.erase(v.begin()); - v.push_back(MoveOnly{}); - v.erase(v.begin(), v.begin() + 1); - v.insert(v.begin(), MoveOnly{}); - v.emplace(v.begin()); - v.emplace(v.begin(), MoveOnly{}); -} -TEST(InlinedVectorTest, Noexcept) { - EXPECT_TRUE(std::is_nothrow_move_constructible::value); - EXPECT_TRUE((std::is_nothrow_move_constructible< - absl::InlinedVector>::value)); - - struct MoveCanThrow { - MoveCanThrow(MoveCanThrow&&) {} - }; - EXPECT_EQ(absl::default_allocator_is_nothrow::value, - (std::is_nothrow_move_constructible< - absl::InlinedVector>::value)); -} - -TEST(InlinedVectorTest, EmplaceBack) { - absl::InlinedVector, 1> v; - - auto& inlined_element = v.emplace_back("answer", 42); - EXPECT_EQ(&inlined_element, &v[0]); - EXPECT_EQ(inlined_element.first, "answer"); - EXPECT_EQ(inlined_element.second, 42); - - auto& allocated_element = v.emplace_back("taxicab", 1729); - EXPECT_EQ(&allocated_element, &v[1]); - EXPECT_EQ(allocated_element.first, "taxicab"); - EXPECT_EQ(allocated_element.second, 1729); -} - -TEST(InlinedVectorTest, ShrinkToFitGrowingVector) { - absl::InlinedVector, 1> v; - - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 1); - - v.emplace_back("answer", 42); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 1); - - v.emplace_back("taxicab", 1729); - EXPECT_GE(v.capacity(), 2); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 2); - - v.reserve(100); - EXPECT_GE(v.capacity(), 100); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 2); -} - -TEST(InlinedVectorTest, ShrinkToFitEdgeCases) { - { - absl::InlinedVector, 1> v; - v.emplace_back("answer", 42); - v.emplace_back("taxicab", 1729); - EXPECT_GE(v.capacity(), 2); - v.pop_back(); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 1); - EXPECT_EQ(v[0].first, "answer"); - EXPECT_EQ(v[0].second, 42); - } - - { - absl::InlinedVector v(100); - v.resize(0); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 2); // inlined capacity - } - - { - absl::InlinedVector v(100); - v.resize(1); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 2); // inlined capacity - } - - { - absl::InlinedVector v(100); - v.resize(2); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 2); - } - - { - absl::InlinedVector v(100); - v.resize(3); - v.shrink_to_fit(); - EXPECT_EQ(v.capacity(), 3); - } -} - -TEST(IntVec, Insert) { - for (int len = 0; len < 20; len++) { - for (int pos = 0; pos <= len; pos++) { - { - // Single element - std::vector std_v; - Fill(&std_v, len); - IntVec v; - Fill(&v, len); - - std_v.insert(std_v.begin() + pos, 9999); - IntVec::iterator it = v.insert(v.cbegin() + pos, 9999); - EXPECT_THAT(v, ElementsAreArray(std_v)); - EXPECT_EQ(it, v.cbegin() + pos); - } - { - // n elements - std::vector std_v; - Fill(&std_v, len); - IntVec v; - Fill(&v, len); - - IntVec::size_type n = 5; - std_v.insert(std_v.begin() + pos, n, 9999); - IntVec::iterator it = v.insert(v.cbegin() + pos, n, 9999); - EXPECT_THAT(v, ElementsAreArray(std_v)); - EXPECT_EQ(it, v.cbegin() + pos); - } - { - // Iterator range (random access iterator) - std::vector std_v; - Fill(&std_v, len); - IntVec v; - Fill(&v, len); - - const std::vector input = {9999, 8888, 7777}; - std_v.insert(std_v.begin() + pos, input.cbegin(), input.cend()); - IntVec::iterator it = - v.insert(v.cbegin() + pos, input.cbegin(), input.cend()); - EXPECT_THAT(v, ElementsAreArray(std_v)); - EXPECT_EQ(it, v.cbegin() + pos); - } - { - // Iterator range (forward iterator) - std::vector std_v; - Fill(&std_v, len); - IntVec v; - Fill(&v, len); - - const std::forward_list input = {9999, 8888, 7777}; - std_v.insert(std_v.begin() + pos, input.cbegin(), input.cend()); - IntVec::iterator it = - v.insert(v.cbegin() + pos, input.cbegin(), input.cend()); - EXPECT_THAT(v, ElementsAreArray(std_v)); - EXPECT_EQ(it, v.cbegin() + pos); - } - { - // Iterator range (input iterator) - std::vector std_v; - Fill(&std_v, len); - IntVec v; - Fill(&v, len); - - std_v.insert(std_v.begin() + pos, {9999, 8888, 7777}); - std::istringstream input("9999 8888 7777"); - IntVec::iterator it = - v.insert(v.cbegin() + pos, std::istream_iterator(input), - std::istream_iterator()); - EXPECT_THAT(v, ElementsAreArray(std_v)); - EXPECT_EQ(it, v.cbegin() + pos); - } - { - // Initializer list - std::vector std_v; - Fill(&std_v, len); - IntVec v; - Fill(&v, len); - - std_v.insert(std_v.begin() + pos, {9999, 8888}); - IntVec::iterator it = v.insert(v.cbegin() + pos, {9999, 8888}); - EXPECT_THAT(v, ElementsAreArray(std_v)); - EXPECT_EQ(it, v.cbegin() + pos); - } - } - } -} - -TEST(RefCountedVec, InsertConstructorDestructor) { - // Make sure the proper construction/destruction happen during insert - // operations. - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - for (int pos = 0; pos <= len; pos++) { - SCOPED_TRACE(pos); - std::vector counts(len, 0); - int inserted_count = 0; - RefCountedVec v; - for (int i = 0; i < len; ++i) { - SCOPED_TRACE(i); - v.push_back(RefCounted(i, &counts[i])); - } - - EXPECT_THAT(counts, Each(Eq(1))); - - RefCounted insert_element(9999, &inserted_count); - EXPECT_EQ(1, inserted_count); - v.insert(v.begin() + pos, insert_element); - EXPECT_EQ(2, inserted_count); - // Check that the elements at the end are preserved. - EXPECT_THAT(counts, Each(Eq(1))); - EXPECT_EQ(2, inserted_count); - } - } -} - -TEST(IntVec, Resize) { - for (int len = 0; len < 20; len++) { - IntVec v; - Fill(&v, len); - - // Try resizing up and down by k elements - static const int kResizeElem = 1000000; - for (int k = 0; k < 10; k++) { - // Enlarging resize - v.resize(len+k, kResizeElem); - EXPECT_EQ(len+k, v.size()); - EXPECT_LE(len+k, v.capacity()); - for (int i = 0; i < len+k; i++) { - if (i < len) { - EXPECT_EQ(i, v[i]); - } else { - EXPECT_EQ(kResizeElem, v[i]); - } - } - - // Shrinking resize - v.resize(len, kResizeElem); - EXPECT_EQ(len, v.size()); - EXPECT_LE(len, v.capacity()); - for (int i = 0; i < len; i++) { - EXPECT_EQ(i, v[i]); - } - } - } -} - -TEST(IntVec, InitWithLength) { - for (int len = 0; len < 20; len++) { - IntVec v(len, 7); - EXPECT_EQ(len, v.size()); - EXPECT_LE(len, v.capacity()); - for (int i = 0; i < len; i++) { - EXPECT_EQ(7, v[i]); - } - } -} - -TEST(IntVec, CopyConstructorAndAssignment) { - for (int len = 0; len < 20; len++) { - IntVec v; - Fill(&v, len); - EXPECT_EQ(len, v.size()); - EXPECT_LE(len, v.capacity()); - - IntVec v2(v); - EXPECT_TRUE(v == v2) << PrintToString(v) << PrintToString(v2); - - for (int start_len = 0; start_len < 20; start_len++) { - IntVec v3; - Fill(&v3, start_len, 99); // Add dummy elements that should go away - v3 = v; - EXPECT_TRUE(v == v3) << PrintToString(v) << PrintToString(v3); - } - } -} - -TEST(IntVec, AliasingCopyAssignment) { - for (int len = 0; len < 20; ++len) { - IntVec original; - Fill(&original, len); - IntVec dup = original; - dup = *&dup; - EXPECT_EQ(dup, original); - } -} - -TEST(IntVec, MoveConstructorAndAssignment) { - for (int len = 0; len < 20; len++) { - IntVec v_in; - const int inlined_capacity = v_in.capacity(); - Fill(&v_in, len); - EXPECT_EQ(len, v_in.size()); - EXPECT_LE(len, v_in.capacity()); - - { - IntVec v_temp(v_in); - auto* old_data = v_temp.data(); - IntVec v_out(std::move(v_temp)); - EXPECT_TRUE(v_in == v_out) << PrintToString(v_in) << PrintToString(v_out); - if (v_in.size() > inlined_capacity) { - // Allocation is moved as a whole, data stays in place. - EXPECT_TRUE(v_out.data() == old_data); - } else { - EXPECT_FALSE(v_out.data() == old_data); - } - } - for (int start_len = 0; start_len < 20; start_len++) { - IntVec v_out; - Fill(&v_out, start_len, 99); // Add dummy elements that should go away - IntVec v_temp(v_in); - auto* old_data = v_temp.data(); - v_out = std::move(v_temp); - EXPECT_TRUE(v_in == v_out) << PrintToString(v_in) << PrintToString(v_out); - if (v_in.size() > inlined_capacity) { - // Allocation is moved as a whole, data stays in place. - EXPECT_TRUE(v_out.data() == old_data); - } else { - EXPECT_FALSE(v_out.data() == old_data); - } - } - } -} - -class NotTriviallyDestructible { - public: - NotTriviallyDestructible() : p_(new int(1)) {} - explicit NotTriviallyDestructible(int i) : p_(new int(i)) {} - - NotTriviallyDestructible(const NotTriviallyDestructible& other) - : p_(new int(*other.p_)) {} - - NotTriviallyDestructible& operator=(const NotTriviallyDestructible& other) { - p_ = absl::make_unique(*other.p_); - return *this; - } - - bool operator==(const NotTriviallyDestructible& other) const { - return *p_ == *other.p_; - } - - private: - std::unique_ptr p_; -}; - -TEST(AliasingTest, Emplace) { - for (int i = 2; i < 20; ++i) { - absl::InlinedVector vec; - for (int j = 0; j < i; ++j) { - vec.push_back(NotTriviallyDestructible(j)); - } - vec.emplace(vec.begin(), vec[0]); - EXPECT_EQ(vec[0], vec[1]); - vec.emplace(vec.begin() + i / 2, vec[i / 2]); - EXPECT_EQ(vec[i / 2], vec[i / 2 + 1]); - vec.emplace(vec.end() - 1, vec.back()); - EXPECT_EQ(vec[vec.size() - 2], vec.back()); - } -} - -TEST(AliasingTest, InsertWithCount) { - for (int i = 1; i < 20; ++i) { - absl::InlinedVector vec; - for (int j = 0; j < i; ++j) { - vec.push_back(NotTriviallyDestructible(j)); - } - for (int n = 0; n < 5; ++n) { - // We use back where we can because it's guaranteed to become invalidated - vec.insert(vec.begin(), n, vec.back()); - auto b = vec.begin(); - EXPECT_TRUE( - std::all_of(b, b + n, [&vec](const NotTriviallyDestructible& x) { - return x == vec.back(); - })); - - auto m_idx = vec.size() / 2; - vec.insert(vec.begin() + m_idx, n, vec.back()); - auto m = vec.begin() + m_idx; - EXPECT_TRUE( - std::all_of(m, m + n, [&vec](const NotTriviallyDestructible& x) { - return x == vec.back(); - })); - - // We want distinct values so the equality test is meaningful, - // vec[vec.size() - 1] is also almost always invalidated. - auto old_e = vec.size() - 1; - auto val = vec[old_e]; - vec.insert(vec.end(), n, vec[old_e]); - auto e = vec.begin() + old_e; - EXPECT_TRUE(std::all_of( - e, e + n, - [&val](const NotTriviallyDestructible& x) { return x == val; })); - } - } -} - -TEST(OverheadTest, Storage) { - // Check for size overhead. - // In particular, ensure that std::allocator doesn't cost anything to store. - // The union should be absorbing some of the allocation bookkeeping overhead - // in the larger vectors, leaving only the size_ field as overhead. - EXPECT_EQ(2 * sizeof(int*), - sizeof(absl::InlinedVector) - 1 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 2 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 3 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 4 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 5 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 6 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 7 * sizeof(int*)); - EXPECT_EQ(1 * sizeof(int*), - sizeof(absl::InlinedVector) - 8 * sizeof(int*)); -} - -TEST(IntVec, Clear) { - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - IntVec v; - Fill(&v, len); - v.clear(); - EXPECT_EQ(0, v.size()); - EXPECT_EQ(v.begin(), v.end()); - } -} - -TEST(IntVec, Reserve) { - for (int len = 0; len < 20; len++) { - IntVec v; - Fill(&v, len); - - for (int newlen = 0; newlen < 100; newlen++) { - const int* start_rep = v.data(); - v.reserve(newlen); - const int* final_rep = v.data(); - if (newlen <= len) { - EXPECT_EQ(start_rep, final_rep); - } - EXPECT_LE(newlen, v.capacity()); - - // Filling up to newlen should not change rep - while (v.size() < newlen) { - v.push_back(0); - } - EXPECT_EQ(final_rep, v.data()); - } - } -} - -TEST(StringVec, SelfRefPushBack) { - std::vector std_v; - absl::InlinedVector v; - const std::string s = "A quite long std::string to ensure heap."; - std_v.push_back(s); - v.push_back(s); - for (int i = 0; i < 20; ++i) { - EXPECT_THAT(v, ElementsAreArray(std_v)); - - v.push_back(v.back()); - std_v.push_back(std_v.back()); - } - EXPECT_THAT(v, ElementsAreArray(std_v)); -} - -TEST(StringVec, SelfRefPushBackWithMove) { - std::vector std_v; - absl::InlinedVector v; - const std::string s = "A quite long std::string to ensure heap."; - std_v.push_back(s); - v.push_back(s); - for (int i = 0; i < 20; ++i) { - EXPECT_EQ(v.back(), std_v.back()); - - v.push_back(std::move(v.back())); - std_v.push_back(std::move(std_v.back())); - } - EXPECT_EQ(v.back(), std_v.back()); -} - -TEST(StringVec, SelfMove) { - const std::string s = "A quite long std::string to ensure heap."; - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - absl::InlinedVector v; - for (int i = 0; i < len; ++i) { - SCOPED_TRACE(i); - v.push_back(s); - } - // Indirection necessary to avoid compiler warning. - v = std::move(*(&v)); - // Ensure that the inlined vector is still in a valid state by copying it. - // We don't expect specific contents since a self-move results in an - // unspecified valid state. - std::vector copy(v.begin(), v.end()); - } -} - -TEST(IntVec, Swap) { - for (int l1 = 0; l1 < 20; l1++) { - SCOPED_TRACE(l1); - for (int l2 = 0; l2 < 20; l2++) { - SCOPED_TRACE(l2); - IntVec a = Fill(l1, 0); - IntVec b = Fill(l2, 100); - { - using std::swap; - swap(a, b); - } - EXPECT_EQ(l1, b.size()); - EXPECT_EQ(l2, a.size()); - for (int i = 0; i < l1; i++) { - SCOPED_TRACE(i); - EXPECT_EQ(i, b[i]); - } - for (int i = 0; i < l2; i++) { - SCOPED_TRACE(i); - EXPECT_EQ(100 + i, a[i]); - } - } - } -} - -TYPED_TEST_P(InstanceTest, Swap) { - using Instance = TypeParam; - using InstanceVec = absl::InlinedVector; - for (int l1 = 0; l1 < 20; l1++) { - SCOPED_TRACE(l1); - for (int l2 = 0; l2 < 20; l2++) { - SCOPED_TRACE(l2); - InstanceTracker tracker; - InstanceVec a, b; - const size_t inlined_capacity = a.capacity(); - auto min_len = std::min(l1, l2); - auto max_len = std::max(l1, l2); - for (int i = 0; i < l1; i++) a.push_back(Instance(i)); - for (int i = 0; i < l2; i++) b.push_back(Instance(100+i)); - EXPECT_EQ(tracker.instances(), l1 + l2); - tracker.ResetCopiesMovesSwaps(); - { - using std::swap; - swap(a, b); - } - EXPECT_EQ(tracker.instances(), l1 + l2); - if (a.size() > inlined_capacity && b.size() > inlined_capacity) { - EXPECT_EQ(tracker.swaps(), 0); // Allocations are swapped. - EXPECT_EQ(tracker.moves(), 0); - } else if (a.size() <= inlined_capacity && b.size() <= inlined_capacity) { - EXPECT_EQ(tracker.swaps(), min_len); - EXPECT_EQ((tracker.moves() ? tracker.moves() : tracker.copies()), - max_len - min_len); - } else { - // One is allocated and the other isn't. The allocation is transferred - // without copying elements, and the inlined instances are copied/moved. - EXPECT_EQ(tracker.swaps(), 0); - EXPECT_EQ((tracker.moves() ? tracker.moves() : tracker.copies()), - min_len); - } - - EXPECT_EQ(l1, b.size()); - EXPECT_EQ(l2, a.size()); - for (int i = 0; i < l1; i++) { - EXPECT_EQ(i, b[i].value()); - } - for (int i = 0; i < l2; i++) { - EXPECT_EQ(100 + i, a[i].value()); - } - } - } -} - -TEST(IntVec, EqualAndNotEqual) { - IntVec a, b; - EXPECT_TRUE(a == b); - EXPECT_FALSE(a != b); - - a.push_back(3); - EXPECT_FALSE(a == b); - EXPECT_TRUE(a != b); - - b.push_back(3); - EXPECT_TRUE(a == b); - EXPECT_FALSE(a != b); - - b.push_back(7); - EXPECT_FALSE(a == b); - EXPECT_TRUE(a != b); - - a.push_back(6); - EXPECT_FALSE(a == b); - EXPECT_TRUE(a != b); - - a.clear(); - b.clear(); - for (int i = 0; i < 100; i++) { - a.push_back(i); - b.push_back(i); - EXPECT_TRUE(a == b); - EXPECT_FALSE(a != b); - - b[i] = b[i] + 1; - EXPECT_FALSE(a == b); - EXPECT_TRUE(a != b); - - b[i] = b[i] - 1; // Back to before - EXPECT_TRUE(a == b); - EXPECT_FALSE(a != b); - } -} - -TEST(IntVec, RelationalOps) { - IntVec a, b; - EXPECT_FALSE(a < b); - EXPECT_FALSE(b < a); - EXPECT_FALSE(a > b); - EXPECT_FALSE(b > a); - EXPECT_TRUE(a <= b); - EXPECT_TRUE(b <= a); - EXPECT_TRUE(a >= b); - EXPECT_TRUE(b >= a); - b.push_back(3); - EXPECT_TRUE(a < b); - EXPECT_FALSE(b < a); - EXPECT_FALSE(a > b); - EXPECT_TRUE(b > a); - EXPECT_TRUE(a <= b); - EXPECT_FALSE(b <= a); - EXPECT_FALSE(a >= b); - EXPECT_TRUE(b >= a); -} - -TYPED_TEST_P(InstanceTest, CountConstructorsDestructors) { - using Instance = TypeParam; - using InstanceVec = absl::InlinedVector; - InstanceTracker tracker; - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - tracker.ResetCopiesMovesSwaps(); - - InstanceVec v; - const size_t inlined_capacity = v.capacity(); - for (int i = 0; i < len; i++) { - v.push_back(Instance(i)); - } - EXPECT_EQ(tracker.instances(), len); - EXPECT_GE(tracker.copies() + tracker.moves(), - len); // More due to reallocation. - tracker.ResetCopiesMovesSwaps(); - - // Enlarging resize() must construct some objects - tracker.ResetCopiesMovesSwaps(); - v.resize(len + 10, Instance(100)); - EXPECT_EQ(tracker.instances(), len + 10); - if (len <= inlined_capacity && len + 10 > inlined_capacity) { - EXPECT_EQ(tracker.copies() + tracker.moves(), 10 + len); - } else { - // Only specify a minimum number of copies + moves. We don't want to - // depend on the reallocation policy here. - EXPECT_GE(tracker.copies() + tracker.moves(), - 10); // More due to reallocation. - } - - // Shrinking resize() must destroy some objects - tracker.ResetCopiesMovesSwaps(); - v.resize(len, Instance(100)); - EXPECT_EQ(tracker.instances(), len); - EXPECT_EQ(tracker.copies(), 0); - EXPECT_EQ(tracker.moves(), 0); - - // reserve() must not increase the number of initialized objects - SCOPED_TRACE("reserve"); - v.reserve(len+1000); - EXPECT_EQ(tracker.instances(), len); - EXPECT_EQ(tracker.copies() + tracker.moves(), len); - - // pop_back() and erase() must destroy one object - if (len > 0) { - tracker.ResetCopiesMovesSwaps(); - v.pop_back(); - EXPECT_EQ(tracker.instances(), len - 1); - EXPECT_EQ(tracker.copies(), 0); - EXPECT_EQ(tracker.moves(), 0); - - if (!v.empty()) { - tracker.ResetCopiesMovesSwaps(); - v.erase(v.begin()); - EXPECT_EQ(tracker.instances(), len - 2); - EXPECT_EQ(tracker.copies() + tracker.moves(), len - 2); - } - } - - tracker.ResetCopiesMovesSwaps(); - int instances_before_empty_erase = tracker.instances(); - v.erase(v.begin(), v.begin()); - EXPECT_EQ(tracker.instances(), instances_before_empty_erase); - EXPECT_EQ(tracker.copies() + tracker.moves(), 0); - } -} - -TYPED_TEST_P(InstanceTest, CountConstructorsDestructorsOnCopyConstruction) { - using Instance = TypeParam; - using InstanceVec = absl::InlinedVector; - InstanceTracker tracker; - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - tracker.ResetCopiesMovesSwaps(); - - InstanceVec v; - for (int i = 0; i < len; i++) { - v.push_back(Instance(i)); - } - EXPECT_EQ(tracker.instances(), len); - EXPECT_GE(tracker.copies() + tracker.moves(), - len); // More due to reallocation. - tracker.ResetCopiesMovesSwaps(); - { // Copy constructor should create 'len' more instances. - InstanceVec v_copy(v); - EXPECT_EQ(tracker.instances(), len + len); - EXPECT_EQ(tracker.copies(), len); - EXPECT_EQ(tracker.moves(), 0); - } - EXPECT_EQ(tracker.instances(), len); - } -} - -TYPED_TEST_P(InstanceTest, CountConstructorsDestructorsOnMoveConstruction) { - using Instance = TypeParam; - using InstanceVec = absl::InlinedVector; - InstanceTracker tracker; - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - tracker.ResetCopiesMovesSwaps(); - - InstanceVec v; - const size_t inlined_capacity = v.capacity(); - for (int i = 0; i < len; i++) { - v.push_back(Instance(i)); - } - EXPECT_EQ(tracker.instances(), len); - EXPECT_GE(tracker.copies() + tracker.moves(), - len); // More due to reallocation. - tracker.ResetCopiesMovesSwaps(); - { - InstanceVec v_copy(std::move(v)); - if (len > inlined_capacity) { - // Allocation is moved as a whole. - EXPECT_EQ(tracker.instances(), len); - EXPECT_EQ(tracker.live_instances(), len); - // Tests an implementation detail, don't rely on this in your code. - EXPECT_EQ(v.size(), 0); // NOLINT misc-use-after-move - EXPECT_EQ(tracker.copies(), 0); - EXPECT_EQ(tracker.moves(), 0); - } else { - EXPECT_EQ(tracker.instances(), len + len); - if (Instance::supports_move()) { - EXPECT_EQ(tracker.live_instances(), len); - EXPECT_EQ(tracker.copies(), 0); - EXPECT_EQ(tracker.moves(), len); - } else { - EXPECT_EQ(tracker.live_instances(), len + len); - EXPECT_EQ(tracker.copies(), len); - EXPECT_EQ(tracker.moves(), 0); - } - } - EXPECT_EQ(tracker.swaps(), 0); - } - } -} - -TYPED_TEST_P(InstanceTest, CountConstructorsDestructorsOnAssignment) { - using Instance = TypeParam; - using InstanceVec = absl::InlinedVector; - InstanceTracker tracker; - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - for (int longorshort = 0; longorshort <= 1; ++longorshort) { - SCOPED_TRACE(longorshort); - tracker.ResetCopiesMovesSwaps(); - - InstanceVec longer, shorter; - for (int i = 0; i < len; i++) { - longer.push_back(Instance(i)); - shorter.push_back(Instance(i)); - } - longer.push_back(Instance(len)); - EXPECT_EQ(tracker.instances(), len + len + 1); - EXPECT_GE(tracker.copies() + tracker.moves(), - len + len + 1); // More due to reallocation. - - tracker.ResetCopiesMovesSwaps(); - if (longorshort) { - shorter = longer; - EXPECT_EQ(tracker.instances(), (len + 1) + (len + 1)); - EXPECT_GE(tracker.copies() + tracker.moves(), - len + 1); // More due to reallocation. - } else { - longer = shorter; - EXPECT_EQ(tracker.instances(), len + len); - EXPECT_EQ(tracker.copies() + tracker.moves(), len); - } - } - } -} - -TYPED_TEST_P(InstanceTest, CountConstructorsDestructorsOnMoveAssignment) { - using Instance = TypeParam; - using InstanceVec = absl::InlinedVector; - InstanceTracker tracker; - for (int len = 0; len < 20; len++) { - SCOPED_TRACE(len); - for (int longorshort = 0; longorshort <= 1; ++longorshort) { - SCOPED_TRACE(longorshort); - tracker.ResetCopiesMovesSwaps(); - - InstanceVec longer, shorter; - const int inlined_capacity = longer.capacity(); - for (int i = 0; i < len; i++) { - longer.push_back(Instance(i)); - shorter.push_back(Instance(i)); - } - longer.push_back(Instance(len)); - EXPECT_EQ(tracker.instances(), len + len + 1); - EXPECT_GE(tracker.copies() + tracker.moves(), - len + len + 1); // More due to reallocation. - - tracker.ResetCopiesMovesSwaps(); - int src_len; - if (longorshort) { - src_len = len + 1; - shorter = std::move(longer); - } else { - src_len = len; - longer = std::move(shorter); - } - if (src_len > inlined_capacity) { - // Allocation moved as a whole. - EXPECT_EQ(tracker.instances(), src_len); - EXPECT_EQ(tracker.live_instances(), src_len); - EXPECT_EQ(tracker.copies(), 0); - EXPECT_EQ(tracker.moves(), 0); - } else { - // Elements are all copied. - EXPECT_EQ(tracker.instances(), src_len + src_len); - if (Instance::supports_move()) { - EXPECT_EQ(tracker.copies(), 0); - EXPECT_EQ(tracker.moves(), src_len); - EXPECT_EQ(tracker.live_instances(), src_len); - } else { - EXPECT_EQ(tracker.copies(), src_len); - EXPECT_EQ(tracker.moves(), 0); - EXPECT_EQ(tracker.live_instances(), src_len + src_len); - } - } - EXPECT_EQ(tracker.swaps(), 0); - } - } -} - -TEST(CountElemAssign, SimpleTypeWithInlineBacking) { - for (size_t original_size = 0; original_size <= 5; ++original_size) { - SCOPED_TRACE(original_size); - // Original contents are [12345, 12345, ...] - std::vector original_contents(original_size, 12345); - - absl::InlinedVector v(original_contents.begin(), - original_contents.end()); - v.assign(2, 123); - EXPECT_THAT(v, AllOf(SizeIs(2), ElementsAre(123, 123))); - if (original_size <= 2) { - // If the original had inline backing, it should stay inline. - EXPECT_EQ(2, v.capacity()); - } - } -} - -TEST(CountElemAssign, SimpleTypeWithAllocation) { - for (size_t original_size = 0; original_size <= 5; ++original_size) { - SCOPED_TRACE(original_size); - // Original contents are [12345, 12345, ...] - std::vector original_contents(original_size, 12345); - - absl::InlinedVector v(original_contents.begin(), - original_contents.end()); - v.assign(3, 123); - EXPECT_THAT(v, AllOf(SizeIs(3), ElementsAre(123, 123, 123))); - EXPECT_LE(v.size(), v.capacity()); - } -} - -TYPED_TEST_P(InstanceTest, CountElemAssignInlineBacking) { - using Instance = TypeParam; - for (size_t original_size = 0; original_size <= 5; ++original_size) { - SCOPED_TRACE(original_size); - // Original contents are [12345, 12345, ...] - std::vector original_contents(original_size, Instance(12345)); - - absl::InlinedVector v(original_contents.begin(), - original_contents.end()); - v.assign(2, Instance(123)); - EXPECT_THAT(v, AllOf(SizeIs(2), ElementsAre(ValueIs(123), ValueIs(123)))); - if (original_size <= 2) { - // If the original had inline backing, it should stay inline. - EXPECT_EQ(2, v.capacity()); - } - } -} - -template -void InstanceCountElemAssignWithAllocationTest() { - for (size_t original_size = 0; original_size <= 5; ++original_size) { - SCOPED_TRACE(original_size); - // Original contents are [12345, 12345, ...] - std::vector original_contents(original_size, Instance(12345)); - - absl::InlinedVector v(original_contents.begin(), - original_contents.end()); - v.assign(3, Instance(123)); - EXPECT_THAT(v, - AllOf(SizeIs(3), - ElementsAre(ValueIs(123), ValueIs(123), ValueIs(123)))); - EXPECT_LE(v.size(), v.capacity()); - } -} -TEST(CountElemAssign, WithAllocationCopyableInstance) { - InstanceCountElemAssignWithAllocationTest(); -} -TEST(CountElemAssign, WithAllocationCopyableMovableInstance) { - InstanceCountElemAssignWithAllocationTest(); -} - -TEST(RangedConstructor, SimpleType) { - std::vector source_v = {4, 5, 6}; - // First try to fit in inline backing - absl::InlinedVector v(source_v.begin(), source_v.end()); - EXPECT_EQ(3, v.size()); - EXPECT_EQ(4, v.capacity()); // Indication that we're still on inlined storage - EXPECT_EQ(4, v[0]); - EXPECT_EQ(5, v[1]); - EXPECT_EQ(6, v[2]); - - // Now, force a re-allocate - absl::InlinedVector realloc_v(source_v.begin(), source_v.end()); - EXPECT_EQ(3, realloc_v.size()); - EXPECT_LT(2, realloc_v.capacity()); - EXPECT_EQ(4, realloc_v[0]); - EXPECT_EQ(5, realloc_v[1]); - EXPECT_EQ(6, realloc_v[2]); -} - -// Test for ranged constructors using Instance as the element type and -// SourceContainer as the source container type. -template -void InstanceRangedConstructorTestForContainer() { - InstanceTracker tracker; - SourceContainer source_v = {Instance(0), Instance(1)}; - tracker.ResetCopiesMovesSwaps(); - absl::InlinedVector v(source_v.begin(), - source_v.end()); - EXPECT_EQ(2, v.size()); - EXPECT_LT(1, v.capacity()); - EXPECT_EQ(0, v[0].value()); - EXPECT_EQ(1, v[1].value()); - EXPECT_EQ(tracker.copies(), 2); - EXPECT_EQ(tracker.moves(), 0); -} - -template -void InstanceRangedConstructorTestWithCapacity() { - // Test with const and non-const, random access and non-random-access sources. - // TODO(bsamwel): Test with an input iterator source. - { - SCOPED_TRACE("std::list"); - InstanceRangedConstructorTestForContainer, - inlined_capacity>(); - { - SCOPED_TRACE("const std::list"); - InstanceRangedConstructorTestForContainer< - Instance, const std::list, inlined_capacity>(); - } - { - SCOPED_TRACE("std::vector"); - InstanceRangedConstructorTestForContainer, - inlined_capacity>(); - } - { - SCOPED_TRACE("const std::vector"); - InstanceRangedConstructorTestForContainer< - Instance, const std::vector, inlined_capacity>(); - } - } -} - -TYPED_TEST_P(InstanceTest, RangedConstructor) { - using Instance = TypeParam; - SCOPED_TRACE("capacity=1"); - InstanceRangedConstructorTestWithCapacity(); - SCOPED_TRACE("capacity=2"); - InstanceRangedConstructorTestWithCapacity(); -} - -TEST(RangedConstructor, ElementsAreConstructed) { - std::vector source_v = {"cat", "dog"}; - - // Force expansion and re-allocation of v. Ensures that when the vector is - // expanded that new elements are constructed. - absl::InlinedVector v(source_v.begin(), source_v.end()); - EXPECT_EQ("cat", v[0]); - EXPECT_EQ("dog", v[1]); -} - -TEST(RangedAssign, SimpleType) { - // Test for all combinations of original sizes (empty and non-empty inline, - // and out of line) and target sizes. - for (size_t original_size = 0; original_size <= 5; ++original_size) { - SCOPED_TRACE(original_size); - // Original contents are [12345, 12345, ...] - std::vector original_contents(original_size, 12345); - - for (size_t target_size = 0; target_size <= 5; ++target_size) { - SCOPED_TRACE(target_size); - - // New contents are [3, 4, ...] - std::vector new_contents; - for (size_t i = 0; i < target_size; ++i) { - new_contents.push_back(i + 3); - } - - absl::InlinedVector v(original_contents.begin(), - original_contents.end()); - v.assign(new_contents.begin(), new_contents.end()); - - EXPECT_EQ(new_contents.size(), v.size()); - EXPECT_LE(new_contents.size(), v.capacity()); - if (target_size <= 3 && original_size <= 3) { - // Storage should stay inline when target size is small. - EXPECT_EQ(3, v.capacity()); - } - EXPECT_THAT(v, ElementsAreArray(new_contents)); - } - } -} - -// Returns true if lhs and rhs have the same value. -template -static bool InstanceValuesEqual(const Instance& lhs, const Instance& rhs) { - return lhs.value() == rhs.value(); -} - -// Test for ranged assign() using Instance as the element type and -// SourceContainer as the source container type. -template -void InstanceRangedAssignTestForContainer() { - // Test for all combinations of original sizes (empty and non-empty inline, - // and out of line) and target sizes. - for (size_t original_size = 0; original_size <= 5; ++original_size) { - SCOPED_TRACE(original_size); - // Original contents are [12345, 12345, ...] - std::vector original_contents(original_size, Instance(12345)); - - for (size_t target_size = 0; target_size <= 5; ++target_size) { - SCOPED_TRACE(target_size); - - // New contents are [3, 4, ...] - // Generate data using a non-const container, because SourceContainer - // itself may be const. - // TODO(bsamwel): Test with an input iterator. - std::vector new_contents_in; - for (size_t i = 0; i < target_size; ++i) { - new_contents_in.push_back(Instance(i + 3)); - } - SourceContainer new_contents(new_contents_in.begin(), - new_contents_in.end()); - - absl::InlinedVector v(original_contents.begin(), - original_contents.end()); - v.assign(new_contents.begin(), new_contents.end()); - - EXPECT_EQ(new_contents.size(), v.size()); - EXPECT_LE(new_contents.size(), v.capacity()); - if (target_size <= 3 && original_size <= 3) { - // Storage should stay inline when target size is small. - EXPECT_EQ(3, v.capacity()); - } - EXPECT_TRUE(std::equal(v.begin(), v.end(), new_contents.begin(), - InstanceValuesEqual)); - } - } -} - -TYPED_TEST_P(InstanceTest, RangedAssign) { - using Instance = TypeParam; - // Test with const and non-const, random access and non-random-access sources. - // TODO(bsamwel): Test with an input iterator source. - SCOPED_TRACE("std::list"); - InstanceRangedAssignTestForContainer>(); - SCOPED_TRACE("const std::list"); - InstanceRangedAssignTestForContainer>(); - SCOPED_TRACE("std::vector"); - InstanceRangedAssignTestForContainer>(); - SCOPED_TRACE("const std::vector"); - InstanceRangedAssignTestForContainer>(); -} - -TEST(InitializerListConstructor, SimpleTypeWithInlineBacking) { - EXPECT_THAT((absl::InlinedVector{4, 5, 6}), - AllOf(SizeIs(3), CapacityIs(4), ElementsAre(4, 5, 6))); -} - -TEST(InitializerListConstructor, SimpleTypeWithReallocationRequired) { - EXPECT_THAT((absl::InlinedVector{4, 5, 6}), - AllOf(SizeIs(3), CapacityIs(Gt(2)), ElementsAre(4, 5, 6))); -} - -TEST(InitializerListConstructor, DisparateTypesInList) { - EXPECT_THAT((absl::InlinedVector{-7, 8ULL}), ElementsAre(-7, 8)); - - EXPECT_THAT((absl::InlinedVector{"foo", std::string("bar")}), - ElementsAre("foo", "bar")); -} - -TEST(InitializerListConstructor, ComplexTypeWithInlineBacking) { - EXPECT_THAT((absl::InlinedVector{ - CopyableMovableInstance(0)}), - AllOf(SizeIs(1), CapacityIs(1), ElementsAre(ValueIs(0)))); -} - -TEST(InitializerListConstructor, ComplexTypeWithReallocationRequired) { - EXPECT_THAT( - (absl::InlinedVector{ - CopyableMovableInstance(0), CopyableMovableInstance(1)}), - AllOf(SizeIs(2), CapacityIs(Gt(1)), ElementsAre(ValueIs(0), ValueIs(1)))); -} - -TEST(InitializerListAssign, SimpleTypeFitsInlineBacking) { - for (size_t original_size = 0; original_size <= 4; ++original_size) { - SCOPED_TRACE(original_size); - - absl::InlinedVector v1(original_size, 12345); - const size_t original_capacity_v1 = v1.capacity(); - v1.assign({3}); - EXPECT_THAT( - v1, AllOf(SizeIs(1), CapacityIs(original_capacity_v1), ElementsAre(3))); - - absl::InlinedVector v2(original_size, 12345); - const size_t original_capacity_v2 = v2.capacity(); - v2 = {3}; - EXPECT_THAT( - v2, AllOf(SizeIs(1), CapacityIs(original_capacity_v2), ElementsAre(3))); - } -} - -TEST(InitializerListAssign, SimpleTypeDoesNotFitInlineBacking) { - for (size_t original_size = 0; original_size <= 4; ++original_size) { - SCOPED_TRACE(original_size); - absl::InlinedVector v1(original_size, 12345); - v1.assign({3, 4, 5}); - EXPECT_THAT(v1, AllOf(SizeIs(3), ElementsAre(3, 4, 5))); - EXPECT_LE(3, v1.capacity()); - - absl::InlinedVector v2(original_size, 12345); - v2 = {3, 4, 5}; - EXPECT_THAT(v2, AllOf(SizeIs(3), ElementsAre(3, 4, 5))); - EXPECT_LE(3, v2.capacity()); - } -} - -TEST(InitializerListAssign, DisparateTypesInList) { - absl::InlinedVector v_int1; - v_int1.assign({-7, 8ULL}); - EXPECT_THAT(v_int1, ElementsAre(-7, 8)); - - absl::InlinedVector v_int2; - v_int2 = {-7, 8ULL}; - EXPECT_THAT(v_int2, ElementsAre(-7, 8)); - - absl::InlinedVector v_string1; - v_string1.assign({"foo", std::string("bar")}); - EXPECT_THAT(v_string1, ElementsAre("foo", "bar")); - - absl::InlinedVector v_string2; - v_string2 = {"foo", std::string("bar")}; - EXPECT_THAT(v_string2, ElementsAre("foo", "bar")); -} - -TYPED_TEST_P(InstanceTest, InitializerListAssign) { - using Instance = TypeParam; - for (size_t original_size = 0; original_size <= 4; ++original_size) { - SCOPED_TRACE(original_size); - absl::InlinedVector v(original_size, Instance(12345)); - const size_t original_capacity = v.capacity(); - v.assign({Instance(3)}); - EXPECT_THAT(v, AllOf(SizeIs(1), CapacityIs(original_capacity), - ElementsAre(ValueIs(3)))); - } - for (size_t original_size = 0; original_size <= 4; ++original_size) { - SCOPED_TRACE(original_size); - absl::InlinedVector v(original_size, Instance(12345)); - v.assign({Instance(3), Instance(4), Instance(5)}); - EXPECT_THAT(v, AllOf(SizeIs(3), - ElementsAre(ValueIs(3), ValueIs(4), ValueIs(5)))); - EXPECT_LE(3, v.capacity()); - } -} - -REGISTER_TYPED_TEST_CASE_P(InstanceTest, Swap, CountConstructorsDestructors, - CountConstructorsDestructorsOnCopyConstruction, - CountConstructorsDestructorsOnMoveConstruction, - CountConstructorsDestructorsOnAssignment, - CountConstructorsDestructorsOnMoveAssignment, - CountElemAssignInlineBacking, RangedConstructor, - RangedAssign, InitializerListAssign); - -using InstanceTypes = - ::testing::Types; -INSTANTIATE_TYPED_TEST_CASE_P(InstanceTestOnTypes, InstanceTest, InstanceTypes); - -TEST(DynamicVec, DynamicVecCompiles) { - DynamicVec v; - (void)v; -} - -TEST(AllocatorSupportTest, Constructors) { - using MyAlloc = CountingAllocator; - using AllocVec = absl::InlinedVector; - const int ia[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - int64_t allocated = 0; - MyAlloc alloc(&allocated); - { AllocVec ABSL_ATTRIBUTE_UNUSED v; } - { AllocVec ABSL_ATTRIBUTE_UNUSED v(alloc); } - { AllocVec ABSL_ATTRIBUTE_UNUSED v(ia, ia + ABSL_ARRAYSIZE(ia), alloc); } - { AllocVec ABSL_ATTRIBUTE_UNUSED v({1, 2, 3}, alloc); } - - AllocVec v2; - { AllocVec ABSL_ATTRIBUTE_UNUSED v(v2, alloc); } - { AllocVec ABSL_ATTRIBUTE_UNUSED v(std::move(v2), alloc); } -} - -TEST(AllocatorSupportTest, CountAllocations) { - using MyAlloc = CountingAllocator; - using AllocVec = absl::InlinedVector; - const int ia[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - int64_t allocated = 0; - MyAlloc alloc(&allocated); - { - AllocVec ABSL_ATTRIBUTE_UNUSED v(ia, ia + 4, alloc); - EXPECT_THAT(allocated, 0); - } - EXPECT_THAT(allocated, 0); - { - AllocVec ABSL_ATTRIBUTE_UNUSED v(ia, ia + ABSL_ARRAYSIZE(ia), alloc); - EXPECT_THAT(allocated, v.size() * sizeof(int)); - } - EXPECT_THAT(allocated, 0); - { - AllocVec v(4, 1, alloc); - EXPECT_THAT(allocated, 0); - - int64_t allocated2 = 0; - MyAlloc alloc2(&allocated2); - AllocVec v2(v, alloc2); - EXPECT_THAT(allocated2, 0); - - int64_t allocated3 = 0; - MyAlloc alloc3(&allocated3); - AllocVec v3(std::move(v), alloc3); - EXPECT_THAT(allocated3, 0); - } - EXPECT_THAT(allocated, 0); - { - AllocVec v(8, 2, alloc); - EXPECT_THAT(allocated, v.size() * sizeof(int)); - - int64_t allocated2 = 0; - MyAlloc alloc2(&allocated2); - AllocVec v2(v, alloc2); - EXPECT_THAT(allocated2, v2.size() * sizeof(int)); - - int64_t allocated3 = 0; - MyAlloc alloc3(&allocated3); - AllocVec v3(std::move(v), alloc3); - EXPECT_THAT(allocated3, v3.size() * sizeof(int)); - } - EXPECT_EQ(allocated, 0); - { - // Test shrink_to_fit deallocations. - AllocVec v(8, 2, alloc); - EXPECT_EQ(allocated, 8 * sizeof(int)); - v.resize(5); - EXPECT_EQ(allocated, 8 * sizeof(int)); - v.shrink_to_fit(); - EXPECT_EQ(allocated, 5 * sizeof(int)); - v.resize(4); - EXPECT_EQ(allocated, 5 * sizeof(int)); - v.shrink_to_fit(); - EXPECT_EQ(allocated, 0); - } -} - -TEST(AllocatorSupportTest, SwapBothAllocated) { - using MyAlloc = CountingAllocator; - using AllocVec = absl::InlinedVector; - int64_t allocated1 = 0; - int64_t allocated2 = 0; - { - const int ia1[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - const int ia2[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; - MyAlloc a1(&allocated1); - MyAlloc a2(&allocated2); - AllocVec v1(ia1, ia1 + ABSL_ARRAYSIZE(ia1), a1); - AllocVec v2(ia2, ia2 + ABSL_ARRAYSIZE(ia2), a2); - EXPECT_LT(v1.capacity(), v2.capacity()); - EXPECT_THAT(allocated1, v1.capacity() * sizeof(int)); - EXPECT_THAT(allocated2, v2.capacity() * sizeof(int)); - v1.swap(v2); - EXPECT_THAT(v1, ElementsAreArray(ia2)); - EXPECT_THAT(v2, ElementsAreArray(ia1)); - EXPECT_THAT(allocated1, v2.capacity() * sizeof(int)); - EXPECT_THAT(allocated2, v1.capacity() * sizeof(int)); - } - EXPECT_THAT(allocated1, 0); - EXPECT_THAT(allocated2, 0); -} - -TEST(AllocatorSupportTest, SwapOneAllocated) { - using MyAlloc = CountingAllocator; - using AllocVec = absl::InlinedVector; - int64_t allocated1 = 0; - int64_t allocated2 = 0; - { - const int ia1[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - const int ia2[] = { 0, 1, 2, 3 }; - MyAlloc a1(&allocated1); - MyAlloc a2(&allocated2); - AllocVec v1(ia1, ia1 + ABSL_ARRAYSIZE(ia1), a1); - AllocVec v2(ia2, ia2 + ABSL_ARRAYSIZE(ia2), a2); - EXPECT_THAT(allocated1, v1.capacity() * sizeof(int)); - EXPECT_THAT(allocated2, 0); - v1.swap(v2); - EXPECT_THAT(v1, ElementsAreArray(ia2)); - EXPECT_THAT(v2, ElementsAreArray(ia1)); - EXPECT_THAT(allocated1, v2.capacity() * sizeof(int)); - EXPECT_THAT(allocated2, 0); - EXPECT_TRUE(v2.get_allocator() == a1); - EXPECT_TRUE(v1.get_allocator() == a2); - } - EXPECT_THAT(allocated1, 0); - EXPECT_THAT(allocated2, 0); -} - -TEST(AllocatorSupportTest, ScopedAllocatorWorks) { - using StdVector = std::vector>; - using MyAlloc = - std::scoped_allocator_adaptor>; - using AllocVec = absl::InlinedVector; - - // MSVC 2017's std::vector allocates different amounts of memory in debug - // versus opt mode. - int64_t test_allocated = 0; - StdVector v(CountingAllocator{&test_allocated}); - // The amount of memory allocated by a default constructed vector - auto default_std_vec_allocated = test_allocated; - v.push_back(1); - // The amound of memory allocated by a copy-constructed vector with one - // element. - int64_t one_element_std_vec_copy_allocated = test_allocated; - - int64_t allocated = 0; - AllocVec vec(MyAlloc{CountingAllocator{&allocated}}); - EXPECT_EQ(allocated, 0); - - // This default constructs a vector, but the allocator should pass itself - // into the vector, so check allocation compared to that. - // The absl::InlinedVector does not allocate any memory. - // The vector may allocate any memory. - auto expected = default_std_vec_allocated; - vec.resize(1); - EXPECT_EQ(allocated, expected); - - // We make vector allocate memory. - // It must go through the allocator even though we didn't construct the - // vector directly. This assumes that vec[0] doesn't need to grow its - // allocation. - expected += sizeof(int); - vec[0].push_back(1); - EXPECT_EQ(allocated, expected); - - // Another allocating vector. - expected += one_element_std_vec_copy_allocated; - vec.push_back(vec[0]); - EXPECT_EQ(allocated, expected); - - // Overflow the inlined memory. - // The absl::InlinedVector will now allocate. - expected += sizeof(StdVector) * 8 + default_std_vec_allocated * 3; - vec.resize(5); - EXPECT_EQ(allocated, expected); - - // Adding one more in external mode should also work. - expected += one_element_std_vec_copy_allocated; - vec.push_back(vec[0]); - EXPECT_EQ(allocated, expected); - - // And extending these should still work. This assumes that vec[0] does not - // need to grow its allocation. - expected += sizeof(int); - vec[0].push_back(1); - EXPECT_EQ(allocated, expected); - - vec.clear(); - EXPECT_EQ(allocated, 0); -} - -TEST(AllocatorSupportTest, SizeAllocConstructor) { - constexpr int inlined_size = 4; - using Alloc = CountingAllocator; - using AllocVec = absl::InlinedVector; - - { - auto len = inlined_size / 2; - int64_t allocated = 0; - auto v = AllocVec(len, Alloc(&allocated)); - - // Inline storage used; allocator should not be invoked - EXPECT_THAT(allocated, 0); - EXPECT_THAT(v, AllOf(SizeIs(len), Each(0))); - } - - { - auto len = inlined_size * 2; - int64_t allocated = 0; - auto v = AllocVec(len, Alloc(&allocated)); - - // Out of line storage used; allocation of 8 elements expected - EXPECT_THAT(allocated, len * sizeof(int)); - EXPECT_THAT(v, AllOf(SizeIs(len), Each(0))); - } -} - -TEST(InlinedVectorTest, AbslHashValueWorks) { - using V = absl::InlinedVector; - std::vector cases; - - // Generate a variety of vectors some of these are small enough for the inline - // space but are stored out of line. - for (int i = 0; i < 10; ++i) { - V v; - for (int j = 0; j < i; ++j) { - v.push_back(j); - } - cases.push_back(v); - v.resize(i % 4); - cases.push_back(v); - } - - EXPECT_TRUE(absl::VerifyTypeImplementsAbslHashCorrectly(cases)); -} - -} // anonymous namespace diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/common.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/common.h deleted file mode 100644 index b06e71131..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/common.h +++ /dev/null @@ -1,183 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_CONTAINER_INTERNAL_CONTAINER_H_ -#define ABSL_CONTAINER_INTERNAL_CONTAINER_H_ - -#include -#include - -#include "absl/meta/type_traits.h" -#include "absl/types/optional.h" - -namespace absl { -namespace container_internal { - -template -struct IsTransparent : std::false_type {}; -template -struct IsTransparent> - : std::true_type {}; - -template -struct KeyArg { - // Transparent. Forward `K`. - template - using type = K; -}; - -template <> -struct KeyArg { - // Not transparent. Always use `key_type`. - template - using type = key_type; -}; - -// The node_handle concept from C++17. -// We specialize node_handle for sets and maps. node_handle_base holds the -// common API of both. -template -class node_handle_base { - protected: - using slot_type = typename PolicyTraits::slot_type; - - public: - using allocator_type = Alloc; - - constexpr node_handle_base() {} - node_handle_base(node_handle_base&& other) noexcept { - *this = std::move(other); - } - ~node_handle_base() { destroy(); } - node_handle_base& operator=(node_handle_base&& other) noexcept { - destroy(); - if (!other.empty()) { - alloc_ = other.alloc_; - PolicyTraits::transfer(alloc(), slot(), other.slot()); - other.reset(); - } - return *this; - } - - bool empty() const noexcept { return !alloc_; } - explicit operator bool() const noexcept { return !empty(); } - allocator_type get_allocator() const { return *alloc_; } - - protected: - friend struct CommonAccess; - - node_handle_base(const allocator_type& a, slot_type* s) : alloc_(a) { - PolicyTraits::transfer(alloc(), slot(), s); - } - - void destroy() { - if (!empty()) { - PolicyTraits::destroy(alloc(), slot()); - reset(); - } - } - - void reset() { - assert(alloc_.has_value()); - alloc_ = absl::nullopt; - } - - slot_type* slot() const { - assert(!empty()); - return reinterpret_cast(std::addressof(slot_space_)); - } - allocator_type* alloc() { return std::addressof(*alloc_); } - - private: - absl::optional alloc_; - mutable absl::aligned_storage_t - slot_space_; -}; - -// For sets. -template -class node_handle : public node_handle_base { - using Base = typename node_handle::node_handle_base; - - public: - using value_type = typename PolicyTraits::value_type; - - constexpr node_handle() {} - - value_type& value() const { return PolicyTraits::element(this->slot()); } - - private: - friend struct CommonAccess; - - node_handle(const Alloc& a, typename Base::slot_type* s) : Base(a, s) {} -}; - -// For maps. -template -class node_handle> - : public node_handle_base { - using Base = typename node_handle::node_handle_base; - - public: - using key_type = typename Policy::key_type; - using mapped_type = typename Policy::mapped_type; - - constexpr node_handle() {} - - auto key() const -> decltype(PolicyTraits::key(this->slot())) { - return PolicyTraits::key(this->slot()); - } - - mapped_type& mapped() const { - return PolicyTraits::value(&PolicyTraits::element(this->slot())); - } - - private: - friend struct CommonAccess; - - node_handle(const Alloc& a, typename Base::slot_type* s) : Base(a, s) {} -}; - -// Provide access to non-public node-handle functions. -struct CommonAccess { - template - static auto GetSlot(const Node& node) -> decltype(node.slot()) { - return node.slot(); - } - - template - static void Reset(Node* node) { - node->reset(); - } - - template - static T Make(Args&&... args) { - return T(std::forward(args)...); - } -}; - -// Implement the insert_return_type<> concept of C++17. -template -struct InsertReturnType { - Iterator position; - bool inserted; - NodeType node; -}; - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_CONTAINER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h deleted file mode 100644 index bb3471f5d..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/compressed_tuple.h +++ /dev/null @@ -1,191 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Helper class to perform the Empty Base Optimization. -// Ts can contain classes and non-classes, empty or not. For the ones that -// are empty classes, we perform the optimization. If all types in Ts are empty -// classes, then CompressedTuple is itself an empty class. -// -// To access the members, use member get() function. -// -// Eg: -// absl::container_internal::CompressedTuple value(7, t1, t2, -// t3); -// assert(value.get<0>() == 7); -// T1& t1 = value.get<1>(); -// const T2& t2 = value.get<2>(); -// ... -// -// https://en.cppreference.com/w/cpp/language/ebo - -#ifndef ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_ -#define ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_ - -#include -#include -#include - -#include "absl/utility/utility.h" - -#if defined(_MSC_VER) && !defined(__NVCC__) -// We need to mark these classes with this declspec to ensure that -// CompressedTuple happens. -#define ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC __declspec(empty_bases) -#else -#define ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC -#endif - -namespace absl { -namespace container_internal { - -template -class CompressedTuple; - -namespace internal_compressed_tuple { - -template -struct Elem; -template -struct Elem, I> - : std::tuple_element> {}; -template -using ElemT = typename Elem::type; - -// Use the __is_final intrinsic if available. Where it's not available, classes -// declared with the 'final' specifier cannot be used as CompressedTuple -// elements. -// TODO(sbenza): Replace this with std::is_final in C++14. -template -constexpr bool IsFinal() { -#if defined(__clang__) || defined(__GNUC__) - return __is_final(T); -#else - return false; -#endif -} - -template -constexpr bool ShouldUseBase() { - return std::is_class::value && std::is_empty::value && !IsFinal(); -} - -// The storage class provides two specializations: -// - For empty classes, it stores T as a base class. -// - For everything else, it stores T as a member. -template >()> -struct Storage { - using T = ElemT; - T value; - constexpr Storage() = default; - explicit constexpr Storage(T&& v) : value(absl::forward(v)) {} - constexpr const T& get() const& { return value; } - T& get() & { return value; } - constexpr const T&& get() const&& { return absl::move(*this).value; } - T&& get() && { return std::move(*this).value; } -}; - -template -struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC Storage - : ElemT { - using T = internal_compressed_tuple::ElemT; - constexpr Storage() = default; - explicit constexpr Storage(T&& v) : T(absl::forward(v)) {} - constexpr const T& get() const& { return *this; } - T& get() & { return *this; } - constexpr const T&& get() const&& { return absl::move(*this); } - T&& get() && { return std::move(*this); } -}; - -template -struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTupleImpl; - -template -struct ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC - CompressedTupleImpl, absl::index_sequence> - // We use the dummy identity function through std::integral_constant to - // convince MSVC of accepting and expanding I in that context. Without it - // you would get: - // error C3548: 'I': parameter pack cannot be used in this context - : Storage, - std::integral_constant::value>... { - constexpr CompressedTupleImpl() = default; - explicit constexpr CompressedTupleImpl(Ts&&... args) - : Storage, I>(absl::forward(args))... {} -}; - -} // namespace internal_compressed_tuple - -// Helper class to perform the Empty Base Class Optimization. -// Ts can contain classes and non-classes, empty or not. For the ones that -// are empty classes, we perform the CompressedTuple. If all types in Ts are -// empty classes, then CompressedTuple is itself an empty class. -// -// To access the members, use member .get() function. -// -// Eg: -// absl::container_internal::CompressedTuple value(7, t1, t2, -// t3); -// assert(value.get<0>() == 7); -// T1& t1 = value.get<1>(); -// const T2& t2 = value.get<2>(); -// ... -// -// https://en.cppreference.com/w/cpp/language/ebo -template -class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple - : private internal_compressed_tuple::CompressedTupleImpl< - CompressedTuple, absl::index_sequence_for> { - private: - template - using ElemT = internal_compressed_tuple::ElemT; - - public: - constexpr CompressedTuple() = default; - explicit constexpr CompressedTuple(Ts... base) - : CompressedTuple::CompressedTupleImpl(absl::forward(base)...) {} - - template - ElemT& get() & { - return internal_compressed_tuple::Storage::get(); - } - - template - constexpr const ElemT& get() const& { - return internal_compressed_tuple::Storage::get(); - } - - template - ElemT&& get() && { - return std::move(*this) - .internal_compressed_tuple::template Storage::get(); - } - - template - constexpr const ElemT&& get() const&& { - return absl::move(*this) - .internal_compressed_tuple::template Storage::get(); - } -}; - -// Explicit specialization for a zero-element tuple -// (needed to avoid ambiguous overloads for the default constructor). -template <> -class ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC CompressedTuple<> {}; - -} // namespace container_internal -} // namespace absl - -#undef ABSL_INTERNAL_COMPRESSED_TUPLE_DECLSPEC - -#endif // ABSL_CONTAINER_INTERNAL_COMPRESSED_TUPLE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/compressed_tuple_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/compressed_tuple_test.cc deleted file mode 100644 index 28e7741c9..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/compressed_tuple_test.cc +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/compressed_tuple.h" - -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/memory/memory.h" -#include "absl/utility/utility.h" - -namespace absl { -namespace container_internal { -namespace { - -enum class CallType { kConstRef, kConstMove }; - -template -struct Empty { - constexpr CallType value() const& { return CallType::kConstRef; } - constexpr CallType value() const&& { return CallType::kConstMove; } -}; - -template -struct NotEmpty { - T value; -}; - -template -struct TwoValues { - T value1; - U value2; -}; - -TEST(CompressedTupleTest, Sizeof) { - EXPECT_EQ(sizeof(int), sizeof(CompressedTuple)); - EXPECT_EQ(sizeof(int), sizeof(CompressedTuple>)); - EXPECT_EQ(sizeof(int), sizeof(CompressedTuple, Empty<1>>)); - EXPECT_EQ(sizeof(int), - sizeof(CompressedTuple, Empty<1>, Empty<2>>)); - - EXPECT_EQ(sizeof(TwoValues), - sizeof(CompressedTuple>)); - EXPECT_EQ(sizeof(TwoValues), - sizeof(CompressedTuple, NotEmpty>)); - EXPECT_EQ(sizeof(TwoValues), - sizeof(CompressedTuple, NotEmpty, Empty<1>>)); -} - -TEST(CompressedTupleTest, Access) { - struct S { - std::string x; - }; - CompressedTuple, S> x(7, {}, S{"ABC"}); - EXPECT_EQ(sizeof(x), sizeof(TwoValues)); - EXPECT_EQ(7, x.get<0>()); - EXPECT_EQ("ABC", x.get<2>().x); -} - -TEST(CompressedTupleTest, NonClasses) { - CompressedTuple x(7, "ABC"); - EXPECT_EQ(7, x.get<0>()); - EXPECT_STREQ("ABC", x.get<1>()); -} - -TEST(CompressedTupleTest, MixClassAndNonClass) { - CompressedTuple, NotEmpty> x(7, "ABC", {}, - {1.25}); - struct Mock { - int v; - const char* p; - double d; - }; - EXPECT_EQ(sizeof(x), sizeof(Mock)); - EXPECT_EQ(7, x.get<0>()); - EXPECT_STREQ("ABC", x.get<1>()); - EXPECT_EQ(1.25, x.get<3>().value); -} - -TEST(CompressedTupleTest, Nested) { - CompressedTuple, - CompressedTuple>> - x(1, CompressedTuple(2), - CompressedTuple>(3, CompressedTuple(4))); - EXPECT_EQ(1, x.get<0>()); - EXPECT_EQ(2, x.get<1>().get<0>()); - EXPECT_EQ(3, x.get<2>().get<0>()); - EXPECT_EQ(4, x.get<2>().get<1>().get<0>()); - - CompressedTuple, Empty<0>, - CompressedTuple, CompressedTuple>>> - y; - std::set*> empties{&y.get<0>(), &y.get<1>(), &y.get<2>().get<0>(), - &y.get<2>().get<1>().get<0>()}; -#ifdef _MSC_VER - // MSVC has a bug where many instances of the same base class are layed out in - // the same address when using __declspec(empty_bases). - // This will be fixed in a future version of MSVC. - int expected = 1; -#else - int expected = 4; -#endif - EXPECT_EQ(expected, sizeof(y)); - EXPECT_EQ(expected, empties.size()); - EXPECT_EQ(sizeof(y), sizeof(Empty<0>) * empties.size()); - - EXPECT_EQ(4 * sizeof(char), - sizeof(CompressedTuple, - CompressedTuple>)); - EXPECT_TRUE( - (std::is_empty>, - CompressedTuple>>>::value)); -} - -TEST(CompressedTupleTest, Reference) { - int i = 7; - std::string s = "Very long std::string that goes in the heap"; - CompressedTuple x(i, i, s, s); - - // Sanity check. We should have not moved from `s` - EXPECT_EQ(s, "Very long std::string that goes in the heap"); - - EXPECT_EQ(x.get<0>(), x.get<1>()); - EXPECT_NE(&x.get<0>(), &x.get<1>()); - EXPECT_EQ(&x.get<1>(), &i); - - EXPECT_EQ(x.get<2>(), x.get<3>()); - EXPECT_NE(&x.get<2>(), &x.get<3>()); - EXPECT_EQ(&x.get<3>(), &s); -} - -TEST(CompressedTupleTest, NoElements) { - CompressedTuple<> x; - static_cast(x); // Silence -Wunused-variable. - EXPECT_TRUE(std::is_empty>::value); -} - -TEST(CompressedTupleTest, MoveOnlyElements) { - CompressedTuple> str_tup( - absl::make_unique("str")); - - CompressedTuple>, - std::unique_ptr> - x(std::move(str_tup), absl::make_unique(5)); - - EXPECT_EQ(*x.get<0>().get<0>(), "str"); - EXPECT_EQ(*x.get<1>(), 5); - - std::unique_ptr x0 = std::move(x.get<0>()).get<0>(); - std::unique_ptr x1 = std::move(x).get<1>(); - - EXPECT_EQ(*x0, "str"); - EXPECT_EQ(*x1, 5); -} - -TEST(CompressedTupleTest, Constexpr) { - constexpr CompressedTuple, Empty<0>> x( - 7, 1.25, CompressedTuple(5), {}); - constexpr int x0 = x.get<0>(); - constexpr double x1 = x.get<1>(); - constexpr int x2 = x.get<2>().get<0>(); - constexpr CallType x3 = x.get<3>().value(); - - EXPECT_EQ(x0, 7); - EXPECT_EQ(x1, 1.25); - EXPECT_EQ(x2, 5); - EXPECT_EQ(x3, CallType::kConstRef); - -#if defined(__clang__) - // An apparent bug in earlier versions of gcc claims these are ambiguous. - constexpr int x2m = absl::move(x.get<2>()).get<0>(); - constexpr CallType x3m = absl::move(x).get<3>().value(); - EXPECT_EQ(x2m, 5); - EXPECT_EQ(x3m, CallType::kConstMove); -#endif -} - -#if defined(__clang__) || defined(__GNUC__) -TEST(CompressedTupleTest, EmptyFinalClass) { - struct S final { - int f() const { return 5; } - }; - CompressedTuple x; - EXPECT_EQ(x.get<0>().f(), 5); -} -#endif - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/container_memory.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/container_memory.h deleted file mode 100644 index e5bb97735..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/container_memory.h +++ /dev/null @@ -1,438 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_CONTAINER_INTERNAL_CONTAINER_MEMORY_H_ -#define ABSL_CONTAINER_INTERNAL_CONTAINER_MEMORY_H_ - -#ifdef ADDRESS_SANITIZER -#include -#endif - -#ifdef MEMORY_SANITIZER -#include -#endif - -#include -#include -#include -#include -#include -#include - -#include "absl/memory/memory.h" -#include "absl/utility/utility.h" - -namespace absl { -namespace container_internal { - -// Allocates at least n bytes aligned to the specified alignment. -// Alignment must be a power of 2. It must be positive. -// -// Note that many allocators don't honor alignment requirements above certain -// threshold (usually either alignof(std::max_align_t) or alignof(void*)). -// Allocate() doesn't apply alignment corrections. If the underlying allocator -// returns insufficiently alignment pointer, that's what you are going to get. -template -void* Allocate(Alloc* alloc, size_t n) { - static_assert(Alignment > 0, ""); - assert(n && "n must be positive"); - struct alignas(Alignment) M {}; - using A = typename absl::allocator_traits::template rebind_alloc; - using AT = typename absl::allocator_traits::template rebind_traits; - A mem_alloc(*alloc); - void* p = AT::allocate(mem_alloc, (n + sizeof(M) - 1) / sizeof(M)); - assert(reinterpret_cast(p) % Alignment == 0 && - "allocator does not respect alignment"); - return p; -} - -// The pointer must have been previously obtained by calling -// Allocate(alloc, n). -template -void Deallocate(Alloc* alloc, void* p, size_t n) { - static_assert(Alignment > 0, ""); - assert(n && "n must be positive"); - struct alignas(Alignment) M {}; - using A = typename absl::allocator_traits::template rebind_alloc; - using AT = typename absl::allocator_traits::template rebind_traits; - A mem_alloc(*alloc); - AT::deallocate(mem_alloc, static_cast(p), - (n + sizeof(M) - 1) / sizeof(M)); -} - -namespace memory_internal { - -// Constructs T into uninitialized storage pointed by `ptr` using the args -// specified in the tuple. -template -void ConstructFromTupleImpl(Alloc* alloc, T* ptr, Tuple&& t, - absl::index_sequence) { - absl::allocator_traits::construct( - *alloc, ptr, std::get(std::forward(t))...); -} - -template -struct WithConstructedImplF { - template - decltype(std::declval()(std::declval())) operator()( - Args&&... args) const { - return std::forward(f)(T(std::forward(args)...)); - } - F&& f; -}; - -template -decltype(std::declval()(std::declval())) WithConstructedImpl( - Tuple&& t, absl::index_sequence, F&& f) { - return WithConstructedImplF{std::forward(f)}( - std::get(std::forward(t))...); -} - -template -auto TupleRefImpl(T&& t, absl::index_sequence) - -> decltype(std::forward_as_tuple(std::get(std::forward(t))...)) { - return std::forward_as_tuple(std::get(std::forward(t))...); -} - -// Returns a tuple of references to the elements of the input tuple. T must be a -// tuple. -template -auto TupleRef(T&& t) -> decltype( - TupleRefImpl(std::forward(t), - absl::make_index_sequence< - std::tuple_size::type>::value>())) { - return TupleRefImpl( - std::forward(t), - absl::make_index_sequence< - std::tuple_size::type>::value>()); -} - -template -decltype(std::declval()(std::declval(), std::piecewise_construct, - std::declval>(), std::declval())) -DecomposePairImpl(F&& f, std::pair, V> p) { - const auto& key = std::get<0>(p.first); - return std::forward(f)(key, std::piecewise_construct, std::move(p.first), - std::move(p.second)); -} - -} // namespace memory_internal - -// Constructs T into uninitialized storage pointed by `ptr` using the args -// specified in the tuple. -template -void ConstructFromTuple(Alloc* alloc, T* ptr, Tuple&& t) { - memory_internal::ConstructFromTupleImpl( - alloc, ptr, std::forward(t), - absl::make_index_sequence< - std::tuple_size::type>::value>()); -} - -// Constructs T using the args specified in the tuple and calls F with the -// constructed value. -template -decltype(std::declval()(std::declval())) WithConstructed( - Tuple&& t, F&& f) { - return memory_internal::WithConstructedImpl( - std::forward(t), - absl::make_index_sequence< - std::tuple_size::type>::value>(), - std::forward(f)); -} - -// Given arguments of an std::pair's consructor, PairArgs() returns a pair of -// tuples with references to the passed arguments. The tuples contain -// constructor arguments for the first and the second elements of the pair. -// -// The following two snippets are equivalent. -// -// 1. std::pair p(args...); -// -// 2. auto a = PairArgs(args...); -// std::pair p(std::piecewise_construct, -// std::move(p.first), std::move(p.second)); -inline std::pair, std::tuple<>> PairArgs() { return {}; } -template -std::pair, std::tuple> PairArgs(F&& f, S&& s) { - return {std::piecewise_construct, std::forward_as_tuple(std::forward(f)), - std::forward_as_tuple(std::forward(s))}; -} -template -std::pair, std::tuple> PairArgs( - const std::pair& p) { - return PairArgs(p.first, p.second); -} -template -std::pair, std::tuple> PairArgs(std::pair&& p) { - return PairArgs(std::forward(p.first), std::forward(p.second)); -} -template -auto PairArgs(std::piecewise_construct_t, F&& f, S&& s) - -> decltype(std::make_pair(memory_internal::TupleRef(std::forward(f)), - memory_internal::TupleRef(std::forward(s)))) { - return std::make_pair(memory_internal::TupleRef(std::forward(f)), - memory_internal::TupleRef(std::forward(s))); -} - -// A helper function for implementing apply() in map policies. -template -auto DecomposePair(F&& f, Args&&... args) - -> decltype(memory_internal::DecomposePairImpl( - std::forward(f), PairArgs(std::forward(args)...))) { - return memory_internal::DecomposePairImpl( - std::forward(f), PairArgs(std::forward(args)...)); -} - -// A helper function for implementing apply() in set policies. -template -decltype(std::declval()(std::declval(), std::declval())) -DecomposeValue(F&& f, Arg&& arg) { - const auto& key = arg; - return std::forward(f)(key, std::forward(arg)); -} - -// Helper functions for asan and msan. -inline void SanitizerPoisonMemoryRegion(const void* m, size_t s) { -#ifdef ADDRESS_SANITIZER - ASAN_POISON_MEMORY_REGION(m, s); -#endif -#ifdef MEMORY_SANITIZER - __msan_poison(m, s); -#endif - (void)m; - (void)s; -} - -inline void SanitizerUnpoisonMemoryRegion(const void* m, size_t s) { -#ifdef ADDRESS_SANITIZER - ASAN_UNPOISON_MEMORY_REGION(m, s); -#endif -#ifdef MEMORY_SANITIZER - __msan_unpoison(m, s); -#endif - (void)m; - (void)s; -} - -template -inline void SanitizerPoisonObject(const T* object) { - SanitizerPoisonMemoryRegion(object, sizeof(T)); -} - -template -inline void SanitizerUnpoisonObject(const T* object) { - SanitizerUnpoisonMemoryRegion(object, sizeof(T)); -} - -namespace memory_internal { - -// If Pair is a standard-layout type, OffsetOf::kFirst and -// OffsetOf::kSecond are equivalent to offsetof(Pair, first) and -// offsetof(Pair, second) respectively. Otherwise they are -1. -// -// The purpose of OffsetOf is to avoid calling offsetof() on non-standard-layout -// type, which is non-portable. -template -struct OffsetOf { - static constexpr size_t kFirst = -1; - static constexpr size_t kSecond = -1; -}; - -template -struct OffsetOf::type> { - static constexpr size_t kFirst = offsetof(Pair, first); - static constexpr size_t kSecond = offsetof(Pair, second); -}; - -template -struct IsLayoutCompatible { - private: - struct Pair { - K first; - V second; - }; - - // Is P layout-compatible with Pair? - template - static constexpr bool LayoutCompatible() { - return std::is_standard_layout

    () && sizeof(P) == sizeof(Pair) && - alignof(P) == alignof(Pair) && - memory_internal::OffsetOf

    ::kFirst == - memory_internal::OffsetOf::kFirst && - memory_internal::OffsetOf

    ::kSecond == - memory_internal::OffsetOf::kSecond; - } - - public: - // Whether pair and pair are layout-compatible. If they are, - // then it is safe to store them in a union and read from either. - static constexpr bool value = std::is_standard_layout() && - std::is_standard_layout() && - memory_internal::OffsetOf::kFirst == 0 && - LayoutCompatible>() && - LayoutCompatible>(); -}; - -} // namespace memory_internal - -// The internal storage type for key-value containers like flat_hash_map. -// -// It is convenient for the value_type of a flat_hash_map to be -// pair; the "const K" prevents accidental modification of the key -// when dealing with the reference returned from find() and similar methods. -// However, this creates other problems; we want to be able to emplace(K, V) -// efficiently with move operations, and similarly be able to move a -// pair in insert(). -// -// The solution is this union, which aliases the const and non-const versions -// of the pair. This also allows flat_hash_map to work, even though -// that has the same efficiency issues with move in emplace() and insert() - -// but people do it anyway. -// -// If kMutableKeys is false, only the value member can be accessed. -// -// If kMutableKeys is true, key can be accessed through all slots while value -// and mutable_value must be accessed only via INITIALIZED slots. Slots are -// created and destroyed via mutable_value so that the key can be moved later. -// -// Accessing one of the union fields while the other is active is safe as -// long as they are layout-compatible, which is guaranteed by the definition of -// kMutableKeys. For C++11, the relevant section of the standard is -// https://timsong-cpp.github.io/cppwp/n3337/class.mem#19 (9.2.19) -template -union map_slot_type { - map_slot_type() {} - ~map_slot_type() = delete; - using value_type = std::pair; - using mutable_value_type = std::pair; - - value_type value; - mutable_value_type mutable_value; - K key; -}; - -template -struct map_slot_policy { - using slot_type = map_slot_type; - using value_type = std::pair; - using mutable_value_type = std::pair; - - private: - static void emplace(slot_type* slot) { - // The construction of union doesn't do anything at runtime but it allows us - // to access its members without violating aliasing rules. - new (slot) slot_type; - } - // If pair and pair are layout-compatible, we can accept one - // or the other via slot_type. We are also free to access the key via - // slot_type::key in this case. - using kMutableKeys = memory_internal::IsLayoutCompatible; - - public: - static value_type& element(slot_type* slot) { return slot->value; } - static const value_type& element(const slot_type* slot) { - return slot->value; - } - - static const K& key(const slot_type* slot) { - return kMutableKeys::value ? slot->key : slot->value.first; - } - - template - static void construct(Allocator* alloc, slot_type* slot, Args&&... args) { - emplace(slot); - if (kMutableKeys::value) { - absl::allocator_traits::construct(*alloc, &slot->mutable_value, - std::forward(args)...); - } else { - absl::allocator_traits::construct(*alloc, &slot->value, - std::forward(args)...); - } - } - - // Construct this slot by moving from another slot. - template - static void construct(Allocator* alloc, slot_type* slot, slot_type* other) { - emplace(slot); - if (kMutableKeys::value) { - absl::allocator_traits::construct( - *alloc, &slot->mutable_value, std::move(other->mutable_value)); - } else { - absl::allocator_traits::construct(*alloc, &slot->value, - std::move(other->value)); - } - } - - template - static void destroy(Allocator* alloc, slot_type* slot) { - if (kMutableKeys::value) { - absl::allocator_traits::destroy(*alloc, &slot->mutable_value); - } else { - absl::allocator_traits::destroy(*alloc, &slot->value); - } - } - - template - static void transfer(Allocator* alloc, slot_type* new_slot, - slot_type* old_slot) { - emplace(new_slot); - if (kMutableKeys::value) { - absl::allocator_traits::construct( - *alloc, &new_slot->mutable_value, std::move(old_slot->mutable_value)); - } else { - absl::allocator_traits::construct(*alloc, &new_slot->value, - std::move(old_slot->value)); - } - destroy(alloc, old_slot); - } - - template - static void swap(Allocator* alloc, slot_type* a, slot_type* b) { - if (kMutableKeys::value) { - using std::swap; - swap(a->mutable_value, b->mutable_value); - } else { - value_type tmp = std::move(a->value); - absl::allocator_traits::destroy(*alloc, &a->value); - absl::allocator_traits::construct(*alloc, &a->value, - std::move(b->value)); - absl::allocator_traits::destroy(*alloc, &b->value); - absl::allocator_traits::construct(*alloc, &b->value, - std::move(tmp)); - } - } - - template - static void move(Allocator* alloc, slot_type* src, slot_type* dest) { - if (kMutableKeys::value) { - dest->mutable_value = std::move(src->mutable_value); - } else { - absl::allocator_traits::destroy(*alloc, &dest->value); - absl::allocator_traits::construct(*alloc, &dest->value, - std::move(src->value)); - } - } - - template - static void move(Allocator* alloc, slot_type* first, slot_type* last, - slot_type* result) { - for (slot_type *src = first, *dest = result; src != last; ++src, ++dest) - move(alloc, src, dest); - } -}; - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_CONTAINER_MEMORY_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/container_memory_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/container_memory_test.cc deleted file mode 100644 index d6b0495f1..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/container_memory_test.cc +++ /dev/null @@ -1,188 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/container_memory.h" - -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/strings/string_view.h" - -namespace absl { -namespace container_internal { -namespace { - -using ::testing::Pair; - -TEST(Memory, AlignmentLargerThanBase) { - std::allocator alloc; - void* mem = Allocate<2>(&alloc, 3); - EXPECT_EQ(0, reinterpret_cast(mem) % 2); - memcpy(mem, "abc", 3); - Deallocate<2>(&alloc, mem, 3); -} - -TEST(Memory, AlignmentSmallerThanBase) { - std::allocator alloc; - void* mem = Allocate<2>(&alloc, 3); - EXPECT_EQ(0, reinterpret_cast(mem) % 2); - memcpy(mem, "abc", 3); - Deallocate<2>(&alloc, mem, 3); -} - -class Fixture : public ::testing::Test { - using Alloc = std::allocator; - - public: - Fixture() { ptr_ = std::allocator_traits::allocate(*alloc(), 1); } - ~Fixture() override { - std::allocator_traits::destroy(*alloc(), ptr_); - std::allocator_traits::deallocate(*alloc(), ptr_, 1); - } - std::string* ptr() { return ptr_; } - Alloc* alloc() { return &alloc_; } - - private: - Alloc alloc_; - std::string* ptr_; -}; - -TEST_F(Fixture, ConstructNoArgs) { - ConstructFromTuple(alloc(), ptr(), std::forward_as_tuple()); - EXPECT_EQ(*ptr(), ""); -} - -TEST_F(Fixture, ConstructOneArg) { - ConstructFromTuple(alloc(), ptr(), std::forward_as_tuple("abcde")); - EXPECT_EQ(*ptr(), "abcde"); -} - -TEST_F(Fixture, ConstructTwoArg) { - ConstructFromTuple(alloc(), ptr(), std::forward_as_tuple(5, 'a')); - EXPECT_EQ(*ptr(), "aaaaa"); -} - -TEST(PairArgs, NoArgs) { - EXPECT_THAT(PairArgs(), - Pair(std::forward_as_tuple(), std::forward_as_tuple())); -} - -TEST(PairArgs, TwoArgs) { - EXPECT_EQ( - std::make_pair(std::forward_as_tuple(1), std::forward_as_tuple('A')), - PairArgs(1, 'A')); -} - -TEST(PairArgs, Pair) { - EXPECT_EQ( - std::make_pair(std::forward_as_tuple(1), std::forward_as_tuple('A')), - PairArgs(std::make_pair(1, 'A'))); -} - -TEST(PairArgs, Piecewise) { - EXPECT_EQ( - std::make_pair(std::forward_as_tuple(1), std::forward_as_tuple('A')), - PairArgs(std::piecewise_construct, std::forward_as_tuple(1), - std::forward_as_tuple('A'))); -} - -TEST(WithConstructed, Simple) { - EXPECT_EQ(1, WithConstructed( - std::make_tuple(std::string("a")), - [](absl::string_view str) { return str.size(); })); -} - -template -decltype(DecomposeValue(std::declval(), std::declval())) -DecomposeValueImpl(int, F&& f, Arg&& arg) { - return DecomposeValue(std::forward(f), std::forward(arg)); -} - -template -const char* DecomposeValueImpl(char, F&& f, Arg&& arg) { - return "not decomposable"; -} - -template -decltype(DecomposeValueImpl(0, std::declval(), std::declval())) -TryDecomposeValue(F&& f, Arg&& arg) { - return DecomposeValueImpl(0, std::forward(f), std::forward(arg)); -} - -TEST(DecomposeValue, Decomposable) { - auto f = [](const int& x, int&& y) { - EXPECT_EQ(&x, &y); - EXPECT_EQ(42, x); - return 'A'; - }; - EXPECT_EQ('A', TryDecomposeValue(f, 42)); -} - -TEST(DecomposeValue, NotDecomposable) { - auto f = [](void*) { - ADD_FAILURE() << "Must not be called"; - return 'A'; - }; - EXPECT_STREQ("not decomposable", TryDecomposeValue(f, 42)); -} - -template -decltype(DecomposePair(std::declval(), std::declval()...)) -DecomposePairImpl(int, F&& f, Args&&... args) { - return DecomposePair(std::forward(f), std::forward(args)...); -} - -template -const char* DecomposePairImpl(char, F&& f, Args&&... args) { - return "not decomposable"; -} - -template -decltype(DecomposePairImpl(0, std::declval(), std::declval()...)) -TryDecomposePair(F&& f, Args&&... args) { - return DecomposePairImpl(0, std::forward(f), std::forward(args)...); -} - -TEST(DecomposePair, Decomposable) { - auto f = [](const int& x, std::piecewise_construct_t, std::tuple k, - std::tuple&& v) { - EXPECT_EQ(&x, &std::get<0>(k)); - EXPECT_EQ(42, x); - EXPECT_EQ(0.5, std::get<0>(v)); - return 'A'; - }; - EXPECT_EQ('A', TryDecomposePair(f, 42, 0.5)); - EXPECT_EQ('A', TryDecomposePair(f, std::make_pair(42, 0.5))); - EXPECT_EQ('A', TryDecomposePair(f, std::piecewise_construct, - std::make_tuple(42), std::make_tuple(0.5))); -} - -TEST(DecomposePair, NotDecomposable) { - auto f = [](...) { - ADD_FAILURE() << "Must not be called"; - return 'A'; - }; - EXPECT_STREQ("not decomposable", - TryDecomposePair(f)); - EXPECT_STREQ("not decomposable", - TryDecomposePair(f, std::piecewise_construct, std::make_tuple(), - std::make_tuple(0.5))); -} - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/counting_allocator.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/counting_allocator.h deleted file mode 100644 index 4e717bef6..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/counting_allocator.h +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ -#define ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ - -#include -#include -#include - -namespace absl { -namespace container_internal { - -// This is a stateful allocator, but the state lives outside of the -// allocator (in whatever test is using the allocator). This is odd -// but helps in tests where the allocator is propagated into nested -// containers - that chain of allocators uses the same state and is -// thus easier to query for aggregate allocation information. -template -class CountingAllocator : public std::allocator { - public: - using Alloc = std::allocator; - using pointer = typename Alloc::pointer; - using size_type = typename Alloc::size_type; - - CountingAllocator() : bytes_used_(nullptr) {} - explicit CountingAllocator(int64_t* b) : bytes_used_(b) {} - - template - CountingAllocator(const CountingAllocator& x) - : Alloc(x), bytes_used_(x.bytes_used_) {} - - pointer allocate(size_type n, - std::allocator::const_pointer hint = nullptr) { - assert(bytes_used_ != nullptr); - *bytes_used_ += n * sizeof(T); - return Alloc::allocate(n, hint); - } - - void deallocate(pointer p, size_type n) { - Alloc::deallocate(p, n); - assert(bytes_used_ != nullptr); - *bytes_used_ -= n * sizeof(T); - } - - template - class rebind { - public: - using other = CountingAllocator; - }; - - friend bool operator==(const CountingAllocator& a, - const CountingAllocator& b) { - return a.bytes_used_ == b.bytes_used_; - } - - friend bool operator!=(const CountingAllocator& a, - const CountingAllocator& b) { - return !(a == b); - } - - int64_t* bytes_used_; -}; - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_COUNTING_ALLOCATOR_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h deleted file mode 100644 index cb8f03c87..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_function_defaults.h +++ /dev/null @@ -1,144 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Define the default Hash and Eq functions for SwissTable containers. -// -// std::hash and std::equal_to are not appropriate hash and equal -// functions for SwissTable containers. There are two reasons for this. -// -// SwissTable containers are power of 2 sized containers: -// -// This means they use the lower bits of the hash value to find the slot for -// each entry. The typical hash function for integral types is the identity. -// This is a very weak hash function for SwissTable and any power of 2 sized -// hashtable implementation which will lead to excessive collisions. For -// SwissTable we use murmur3 style mixing to reduce collisions to a minimum. -// -// SwissTable containers support heterogeneous lookup: -// -// In order to make heterogeneous lookup work, hash and equal functions must be -// polymorphic. At the same time they have to satisfy the same requirements the -// C++ standard imposes on hash functions and equality operators. That is: -// -// if hash_default_eq(a, b) returns true for any a and b of type T, then -// hash_default_hash(a) must equal hash_default_hash(b) -// -// For SwissTable containers this requirement is relaxed to allow a and b of -// any and possibly different types. Note that like the standard the hash and -// equal functions are still bound to T. This is important because some type U -// can be hashed by/tested for equality differently depending on T. A notable -// example is `const char*`. `const char*` is treated as a c-style string when -// the hash function is hash but as a pointer when the hash -// function is hash. -// -#ifndef ABSL_CONTAINER_INTERNAL_HASH_FUNCTION_DEFAULTS_H_ -#define ABSL_CONTAINER_INTERNAL_HASH_FUNCTION_DEFAULTS_H_ - -#include -#include -#include -#include -#include - -#include "absl/base/config.h" -#include "absl/hash/hash.h" -#include "absl/strings/string_view.h" - -namespace absl { -namespace container_internal { - -// The hash of an object of type T is computed by using absl::Hash. -template -struct HashEq { - using Hash = absl::Hash; - using Eq = std::equal_to; -}; - -struct StringHash { - using is_transparent = void; - - size_t operator()(absl::string_view v) const { - return absl::Hash{}(v); - } -}; - -// Supports heterogeneous lookup for string-like elements. -struct StringHashEq { - using Hash = StringHash; - struct Eq { - using is_transparent = void; - bool operator()(absl::string_view lhs, absl::string_view rhs) const { - return lhs == rhs; - } - }; -}; - -template <> -struct HashEq : StringHashEq {}; -template <> -struct HashEq : StringHashEq {}; - -// Supports heterogeneous lookup for pointers and smart pointers. -template -struct HashEq { - struct Hash { - using is_transparent = void; - template - size_t operator()(const U& ptr) const { - return absl::Hash{}(HashEq::ToPtr(ptr)); - } - }; - struct Eq { - using is_transparent = void; - template - bool operator()(const A& a, const B& b) const { - return HashEq::ToPtr(a) == HashEq::ToPtr(b); - } - }; - - private: - static const T* ToPtr(const T* ptr) { return ptr; } - template - static const T* ToPtr(const std::unique_ptr& ptr) { - return ptr.get(); - } - template - static const T* ToPtr(const std::shared_ptr& ptr) { - return ptr.get(); - } -}; - -template -struct HashEq> : HashEq {}; -template -struct HashEq> : HashEq {}; - -// This header's visibility is restricted. If you need to access the default -// hasher please use the container's ::hasher alias instead. -// -// Example: typename Hash = typename absl::flat_hash_map::hasher -template -using hash_default_hash = typename container_internal::HashEq::Hash; - -// This header's visibility is restricted. If you need to access the default -// key equal please use the container's ::key_equal alias instead. -// -// Example: typename Eq = typename absl::flat_hash_map::key_equal -template -using hash_default_eq = typename container_internal::HashEq::Eq; - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_HASH_FUNCTION_DEFAULTS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_function_defaults_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_function_defaults_test.cc deleted file mode 100644 index 82708dbe9..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_function_defaults_test.cc +++ /dev/null @@ -1,295 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hash_function_defaults.h" - -#include -#include -#include - -#include "gtest/gtest.h" -#include "absl/strings/string_view.h" - -namespace absl { -namespace container_internal { -namespace { - -using ::testing::Types; - -TEST(Eq, Int32) { - hash_default_eq eq; - EXPECT_TRUE(eq(1, 1u)); - EXPECT_TRUE(eq(1, char{1})); - EXPECT_TRUE(eq(1, true)); - EXPECT_TRUE(eq(1, double{1.1})); - EXPECT_FALSE(eq(1, char{2})); - EXPECT_FALSE(eq(1, 2u)); - EXPECT_FALSE(eq(1, false)); - EXPECT_FALSE(eq(1, 2.)); -} - -TEST(Hash, Int32) { - hash_default_hash hash; - auto h = hash(1); - EXPECT_EQ(h, hash(1u)); - EXPECT_EQ(h, hash(char{1})); - EXPECT_EQ(h, hash(true)); - EXPECT_EQ(h, hash(double{1.1})); - EXPECT_NE(h, hash(2u)); - EXPECT_NE(h, hash(char{2})); - EXPECT_NE(h, hash(false)); - EXPECT_NE(h, hash(2.)); -} - -enum class MyEnum { A, B, C, D }; - -TEST(Eq, Enum) { - hash_default_eq eq; - EXPECT_TRUE(eq(MyEnum::A, MyEnum::A)); - EXPECT_FALSE(eq(MyEnum::A, MyEnum::B)); -} - -TEST(Hash, Enum) { - hash_default_hash hash; - - for (MyEnum e : {MyEnum::A, MyEnum::B, MyEnum::C}) { - auto h = hash(e); - EXPECT_EQ(h, hash_default_hash{}(static_cast(e))); - EXPECT_NE(h, hash(MyEnum::D)); - } -} - -using StringTypes = ::testing::Types; - -template -struct EqString : ::testing::Test { - hash_default_eq key_eq; -}; - -TYPED_TEST_SUITE(EqString, StringTypes); - -template -struct HashString : ::testing::Test { - hash_default_hash hasher; -}; - -TYPED_TEST_SUITE(HashString, StringTypes); - -TYPED_TEST(EqString, Works) { - auto eq = this->key_eq; - EXPECT_TRUE(eq("a", "a")); - EXPECT_TRUE(eq("a", absl::string_view("a"))); - EXPECT_TRUE(eq("a", std::string("a"))); - EXPECT_FALSE(eq("a", "b")); - EXPECT_FALSE(eq("a", absl::string_view("b"))); - EXPECT_FALSE(eq("a", std::string("b"))); -} - -TYPED_TEST(HashString, Works) { - auto hash = this->hasher; - auto h = hash("a"); - EXPECT_EQ(h, hash(absl::string_view("a"))); - EXPECT_EQ(h, hash(std::string("a"))); - EXPECT_NE(h, hash(absl::string_view("b"))); - EXPECT_NE(h, hash(std::string("b"))); -} - -struct NoDeleter { - template - void operator()(const T* ptr) const {} -}; - -using PointerTypes = - ::testing::Types, - std::unique_ptr, - std::unique_ptr, std::unique_ptr, - std::shared_ptr, std::shared_ptr>; - -template -struct EqPointer : ::testing::Test { - hash_default_eq key_eq; -}; - -TYPED_TEST_SUITE(EqPointer, PointerTypes); - -template -struct HashPointer : ::testing::Test { - hash_default_hash hasher; -}; - -TYPED_TEST_SUITE(HashPointer, PointerTypes); - -TYPED_TEST(EqPointer, Works) { - int dummy; - auto eq = this->key_eq; - auto sptr = std::make_shared(); - std::shared_ptr csptr = sptr; - int* ptr = sptr.get(); - const int* cptr = ptr; - std::unique_ptr uptr(ptr); - std::unique_ptr cuptr(ptr); - - EXPECT_TRUE(eq(ptr, cptr)); - EXPECT_TRUE(eq(ptr, sptr)); - EXPECT_TRUE(eq(ptr, uptr)); - EXPECT_TRUE(eq(ptr, csptr)); - EXPECT_TRUE(eq(ptr, cuptr)); - EXPECT_FALSE(eq(&dummy, cptr)); - EXPECT_FALSE(eq(&dummy, sptr)); - EXPECT_FALSE(eq(&dummy, uptr)); - EXPECT_FALSE(eq(&dummy, csptr)); - EXPECT_FALSE(eq(&dummy, cuptr)); -} - -TEST(Hash, DerivedAndBase) { - struct Base {}; - struct Derived : Base {}; - - hash_default_hash hasher; - - Base base; - Derived derived; - EXPECT_NE(hasher(&base), hasher(&derived)); - EXPECT_EQ(hasher(static_cast(&derived)), hasher(&derived)); - - auto dp = std::make_shared(); - EXPECT_EQ(hasher(static_cast(dp.get())), hasher(dp)); -} - -TEST(Hash, FunctionPointer) { - using Func = int (*)(); - hash_default_hash hasher; - hash_default_eq eq; - - Func p1 = [] { return 1; }, p2 = [] { return 2; }; - EXPECT_EQ(hasher(p1), hasher(p1)); - EXPECT_TRUE(eq(p1, p1)); - - EXPECT_NE(hasher(p1), hasher(p2)); - EXPECT_FALSE(eq(p1, p2)); -} - -TYPED_TEST(HashPointer, Works) { - int dummy; - auto hash = this->hasher; - auto sptr = std::make_shared(); - std::shared_ptr csptr = sptr; - int* ptr = sptr.get(); - const int* cptr = ptr; - std::unique_ptr uptr(ptr); - std::unique_ptr cuptr(ptr); - - EXPECT_EQ(hash(ptr), hash(cptr)); - EXPECT_EQ(hash(ptr), hash(sptr)); - EXPECT_EQ(hash(ptr), hash(uptr)); - EXPECT_EQ(hash(ptr), hash(csptr)); - EXPECT_EQ(hash(ptr), hash(cuptr)); - EXPECT_NE(hash(&dummy), hash(cptr)); - EXPECT_NE(hash(&dummy), hash(sptr)); - EXPECT_NE(hash(&dummy), hash(uptr)); - EXPECT_NE(hash(&dummy), hash(csptr)); - EXPECT_NE(hash(&dummy), hash(cuptr)); -} - -// Cartesian product of (std::string, absl::string_view) -// with (std::string, absl::string_view, const char*). -using StringTypesCartesianProduct = Types< - // clang-format off - - std::pair, - std::pair, - std::pair>; -// clang-format on - -constexpr char kFirstString[] = "abc123"; -constexpr char kSecondString[] = "ijk456"; - -template -struct StringLikeTest : public ::testing::Test { - typename T::first_type a1{kFirstString}; - typename T::second_type b1{kFirstString}; - typename T::first_type a2{kSecondString}; - typename T::second_type b2{kSecondString}; - hash_default_eq eq; - hash_default_hash hash; -}; - -TYPED_TEST_CASE_P(StringLikeTest); - -TYPED_TEST_P(StringLikeTest, Eq) { - EXPECT_TRUE(this->eq(this->a1, this->b1)); - EXPECT_TRUE(this->eq(this->b1, this->a1)); -} - -TYPED_TEST_P(StringLikeTest, NotEq) { - EXPECT_FALSE(this->eq(this->a1, this->b2)); - EXPECT_FALSE(this->eq(this->b2, this->a1)); -} - -TYPED_TEST_P(StringLikeTest, HashEq) { - EXPECT_EQ(this->hash(this->a1), this->hash(this->b1)); - EXPECT_EQ(this->hash(this->a2), this->hash(this->b2)); - // It would be a poor hash function which collides on these strings. - EXPECT_NE(this->hash(this->a1), this->hash(this->b2)); -} - -TYPED_TEST_SUITE(StringLikeTest, StringTypesCartesianProduct); - -} // namespace -} // namespace container_internal -} // namespace absl - -enum Hash : size_t { - kStd = 0x2, // std::hash -#ifdef _MSC_VER - kExtension = kStd, // In MSVC, std::hash == ::hash -#else // _MSC_VER - kExtension = 0x4, // ::hash (GCC extension) -#endif // _MSC_VER -}; - -// H is a bitmask of Hash enumerations. -// Hashable is hashable via all means specified in H. -template -struct Hashable { - static constexpr bool HashableBy(Hash h) { return h & H; } -}; - -namespace std { -template -struct hash> { - template , - class = typename std::enable_if::type> - size_t operator()(E) const { - return kStd; - } -}; -} // namespace std - -namespace absl { -namespace container_internal { -namespace { - -template -size_t Hash(const T& v) { - return hash_default_hash()(v); -} - -TEST(Delegate, HashDispatch) { - EXPECT_EQ(Hash(kStd), Hash(Hashable())); -} - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.cc deleted file mode 100644 index 37a23d609..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.cc +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hash_generator_testing.h" - -#include - -namespace absl { -namespace container_internal { -namespace hash_internal { -namespace { - -class RandomDeviceSeedSeq { - public: - using result_type = typename std::random_device::result_type; - - template - void generate(Iterator start, Iterator end) { - while (start != end) { - *start = gen_(); - ++start; - } - } - - private: - std::random_device gen_; -}; - -} // namespace - -std::mt19937_64* GetSharedRng() { - RandomDeviceSeedSeq seed_seq; - static auto* rng = new std::mt19937_64(seed_seq); - return rng; -} - -std::string Generator::operator()() const { - // NOLINTNEXTLINE(runtime/int) - std::uniform_int_distribution chars(0x20, 0x7E); - std::string res; - res.resize(32); - std::generate(res.begin(), res.end(), - [&]() { return chars(*GetSharedRng()); }); - return res; -} - -absl::string_view Generator::operator()() const { - static auto* arena = new std::deque(); - // NOLINTNEXTLINE(runtime/int) - std::uniform_int_distribution chars(0x20, 0x7E); - arena->emplace_back(); - auto& res = arena->back(); - res.resize(32); - std::generate(res.begin(), res.end(), - [&]() { return chars(*GetSharedRng()); }); - return res; -} - -} // namespace hash_internal -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h deleted file mode 100644 index 27fb84f5d..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_generator_testing.h +++ /dev/null @@ -1,150 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Generates random values for testing. Specialized only for the few types we -// care about. - -#ifndef ABSL_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_ -#define ABSL_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_ - -#include -#include -#include -#include -#include -#include -#include - -#include "absl/container/internal/hash_policy_testing.h" -#include "absl/meta/type_traits.h" -#include "absl/strings/string_view.h" - -namespace absl { -namespace container_internal { -namespace hash_internal { -namespace generator_internal { - -template -struct IsMap : std::false_type {}; - -template -struct IsMap> : std::true_type {}; - -} // namespace generator_internal - -std::mt19937_64* GetSharedRng(); - -enum Enum { - kEnumEmpty, - kEnumDeleted, -}; - -enum class EnumClass : uint64_t { - kEmpty, - kDeleted, -}; - -inline std::ostream& operator<<(std::ostream& o, const EnumClass& ec) { - return o << static_cast(ec); -} - -template -struct Generator; - -template -struct Generator::value>::type> { - T operator()() const { - std::uniform_int_distribution dist; - return dist(*GetSharedRng()); - } -}; - -template <> -struct Generator { - Enum operator()() const { - std::uniform_int_distribution::type> - dist; - while (true) { - auto variate = dist(*GetSharedRng()); - if (variate != kEnumEmpty && variate != kEnumDeleted) - return static_cast(variate); - } - } -}; - -template <> -struct Generator { - EnumClass operator()() const { - std::uniform_int_distribution< - typename std::underlying_type::type> - dist; - while (true) { - EnumClass variate = static_cast(dist(*GetSharedRng())); - if (variate != EnumClass::kEmpty && variate != EnumClass::kDeleted) - return static_cast(variate); - } - } -}; - -template <> -struct Generator { - std::string operator()() const; -}; - -template <> -struct Generator { - absl::string_view operator()() const; -}; - -template <> -struct Generator { - NonStandardLayout operator()() const { - return NonStandardLayout(Generator()()); - } -}; - -template -struct Generator> { - std::pair operator()() const { - return std::pair(Generator::type>()(), - Generator::type>()()); - } -}; - -template -struct Generator> { - std::tuple operator()() const { - return std::tuple(Generator::type>()()...); - } -}; - -template -struct Generator().key()), - decltype(std::declval().value())>> - : Generator().key())>::type, - typename std::decay().value())>::type>> {}; - -template -using GeneratedType = decltype( - std::declval::value, - typename Container::value_type, - typename Container::key_type>::type>&>()()); - -} // namespace hash_internal -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_HASH_GENERATOR_TESTING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_testing.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_testing.h deleted file mode 100644 index c57407a02..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_testing.h +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Utilities to help tests verify that hash tables properly handle stateful -// allocators and hash functions. - -#ifndef ABSL_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_ -#define ABSL_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_ - -#include -#include -#include -#include -#include -#include -#include - -#include "absl/hash/hash.h" -#include "absl/strings/string_view.h" - -namespace absl { -namespace container_internal { -namespace hash_testing_internal { - -template -struct WithId { - WithId() : id_(next_id()) {} - WithId(const WithId& that) : id_(that.id_) {} - WithId(WithId&& that) : id_(that.id_) { that.id_ = 0; } - WithId& operator=(const WithId& that) { - id_ = that.id_; - return *this; - } - WithId& operator=(WithId&& that) { - id_ = that.id_; - that.id_ = 0; - return *this; - } - - size_t id() const { return id_; } - - friend bool operator==(const WithId& a, const WithId& b) { - return a.id_ == b.id_; - } - friend bool operator!=(const WithId& a, const WithId& b) { return !(a == b); } - - protected: - explicit WithId(size_t id) : id_(id) {} - - private: - size_t id_; - - template - static size_t next_id() { - // 0 is reserved for moved from state. - static size_t gId = 1; - return gId++; - } -}; - -} // namespace hash_testing_internal - -struct NonStandardLayout { - NonStandardLayout() {} - explicit NonStandardLayout(std::string s) : value(std::move(s)) {} - virtual ~NonStandardLayout() {} - - friend bool operator==(const NonStandardLayout& a, - const NonStandardLayout& b) { - return a.value == b.value; - } - friend bool operator!=(const NonStandardLayout& a, - const NonStandardLayout& b) { - return a.value != b.value; - } - - template - friend H AbslHashValue(H h, const NonStandardLayout& v) { - return H::combine(std::move(h), v.value); - } - - std::string value; -}; - -struct StatefulTestingHash - : absl::container_internal::hash_testing_internal::WithId< - StatefulTestingHash> { - template - size_t operator()(const T& t) const { - return absl::Hash{}(t); - } -}; - -struct StatefulTestingEqual - : absl::container_internal::hash_testing_internal::WithId< - StatefulTestingEqual> { - template - bool operator()(const T& t, const U& u) const { - return t == u; - } -}; - -// It is expected that Alloc() == Alloc() for all allocators so we cannot use -// WithId base. We need to explicitly assign ids. -template -struct Alloc : std::allocator { - using propagate_on_container_swap = std::true_type; - - // Using old paradigm for this to ensure compatibility. - explicit Alloc(size_t id = 0) : id_(id) {} - - Alloc(const Alloc&) = default; - Alloc& operator=(const Alloc&) = default; - - template - Alloc(const Alloc& that) : std::allocator(that), id_(that.id()) {} - - template - struct rebind { - using other = Alloc; - }; - - size_t id() const { return id_; } - - friend bool operator==(const Alloc& a, const Alloc& b) { - return a.id_ == b.id_; - } - friend bool operator!=(const Alloc& a, const Alloc& b) { return !(a == b); } - - private: - size_t id_ = (std::numeric_limits::max)(); -}; - -template -auto items(const Map& m) -> std::vector< - std::pair> { - using std::get; - std::vector> res; - res.reserve(m.size()); - for (const auto& v : m) res.emplace_back(get<0>(v), get<1>(v)); - return res; -} - -template -auto keys(const Set& s) - -> std::vector::type> { - std::vector::type> res; - res.reserve(s.size()); - for (const auto& v : s) res.emplace_back(v); - return res; -} - -} // namespace container_internal -} // namespace absl - -// ABSL_UNORDERED_SUPPORTS_ALLOC_CTORS is false for glibcxx versions -// where the unordered containers are missing certain constructors that -// take allocator arguments. This test is defined ad-hoc for the platforms -// we care about (notably Crosstool 17) because libstdcxx's useless -// versioning scheme precludes a more principled solution. -// From GCC-4.9 Changelog: (src: https://gcc.gnu.org/gcc-4.9/changes.html) -// "the unordered associative containers in and -// meet the allocator-aware container requirements;" -#if (defined(__GLIBCXX__) && __GLIBCXX__ <= 20140425 ) || \ -( __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9 )) -#define ABSL_UNORDERED_SUPPORTS_ALLOC_CTORS 0 -#else -#define ABSL_UNORDERED_SUPPORTS_ALLOC_CTORS 1 -#endif - -#endif // ABSL_CONTAINER_INTERNAL_HASH_POLICY_TESTING_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_testing_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_testing_test.cc deleted file mode 100644 index 0c95eb5ea..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_testing_test.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hash_policy_testing.h" - -#include "gtest/gtest.h" - -namespace absl { -namespace container_internal { -namespace { - -TEST(_, Hash) { - StatefulTestingHash h1; - EXPECT_EQ(1, h1.id()); - StatefulTestingHash h2; - EXPECT_EQ(2, h2.id()); - StatefulTestingHash h1c(h1); - EXPECT_EQ(1, h1c.id()); - StatefulTestingHash h2m(std::move(h2)); - EXPECT_EQ(2, h2m.id()); - EXPECT_EQ(0, h2.id()); - StatefulTestingHash h3; - EXPECT_EQ(3, h3.id()); - h3 = StatefulTestingHash(); - EXPECT_EQ(4, h3.id()); - h3 = std::move(h1); - EXPECT_EQ(1, h3.id()); -} - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h deleted file mode 100644 index fd007de7c..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_traits.h +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ -#define ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ - -#include -#include -#include -#include - -#include "absl/meta/type_traits.h" - -namespace absl { -namespace container_internal { - -// Defines how slots are initialized/destroyed/moved. -template -struct hash_policy_traits { - private: - struct ReturnKey { - // We return `Key` here. - // When Key=T&, we forward the lvalue reference. - // When Key=T, we return by value to avoid a dangling reference. - // eg, for string_hash_map. - template - Key operator()(Key&& k, const Args&...) const { - return std::forward(k); - } - }; - - template - struct ConstantIteratorsImpl : std::false_type {}; - - template - struct ConstantIteratorsImpl> - : P::constant_iterators {}; - - public: - // The actual object stored in the hash table. - using slot_type = typename Policy::slot_type; - - // The type of the keys stored in the hashtable. - using key_type = typename Policy::key_type; - - // The argument type for insertions into the hashtable. This is different - // from value_type for increased performance. See initializer_list constructor - // and insert() member functions for more details. - using init_type = typename Policy::init_type; - - using reference = decltype(Policy::element(std::declval())); - using pointer = typename std::remove_reference::type*; - using value_type = typename std::remove_reference::type; - - // Policies can set this variable to tell raw_hash_set that all iterators - // should be constant, even `iterator`. This is useful for set-like - // containers. - // Defaults to false if not provided by the policy. - using constant_iterators = ConstantIteratorsImpl<>; - - // PRECONDITION: `slot` is UNINITIALIZED - // POSTCONDITION: `slot` is INITIALIZED - template - static void construct(Alloc* alloc, slot_type* slot, Args&&... args) { - Policy::construct(alloc, slot, std::forward(args)...); - } - - // PRECONDITION: `slot` is INITIALIZED - // POSTCONDITION: `slot` is UNINITIALIZED - template - static void destroy(Alloc* alloc, slot_type* slot) { - Policy::destroy(alloc, slot); - } - - // Transfers the `old_slot` to `new_slot`. Any memory allocated by the - // allocator inside `old_slot` to `new_slot` can be transferred. - // - // OPTIONAL: defaults to: - // - // clone(new_slot, std::move(*old_slot)); - // destroy(old_slot); - // - // PRECONDITION: `new_slot` is UNINITIALIZED and `old_slot` is INITIALIZED - // POSTCONDITION: `new_slot` is INITIALIZED and `old_slot` is - // UNINITIALIZED - template - static void transfer(Alloc* alloc, slot_type* new_slot, slot_type* old_slot) { - transfer_impl(alloc, new_slot, old_slot, 0); - } - - // PRECONDITION: `slot` is INITIALIZED - // POSTCONDITION: `slot` is INITIALIZED - template - static auto element(slot_type* slot) -> decltype(P::element(slot)) { - return P::element(slot); - } - - // Returns the amount of memory owned by `slot`, exclusive of `sizeof(*slot)`. - // - // If `slot` is nullptr, returns the constant amount of memory owned by any - // full slot or -1 if slots own variable amounts of memory. - // - // PRECONDITION: `slot` is INITIALIZED or nullptr - template - static size_t space_used(const slot_type* slot) { - return P::space_used(slot); - } - - // Provides generalized access to the key for elements, both for elements in - // the table and for elements that have not yet been inserted (or even - // constructed). We would like an API that allows us to say: `key(args...)` - // but we cannot do that for all cases, so we use this more general API that - // can be used for many things, including the following: - // - // - Given an element in a table, get its key. - // - Given an element initializer, get its key. - // - Given `emplace()` arguments, get the element key. - // - // Implementations of this must adhere to a very strict technical - // specification around aliasing and consuming arguments: - // - // Let `value_type` be the result type of `element()` without ref- and - // cv-qualifiers. The first argument is a functor, the rest are constructor - // arguments for `value_type`. Returns `std::forward(f)(k, xs...)`, where - // `k` is the element key, and `xs...` are the new constructor arguments for - // `value_type`. It's allowed for `k` to alias `xs...`, and for both to alias - // `ts...`. The key won't be touched once `xs...` are used to construct an - // element; `ts...` won't be touched at all, which allows `apply()` to consume - // any rvalues among them. - // - // If `value_type` is constructible from `Ts&&...`, `Policy::apply()` must not - // trigger a hard compile error unless it originates from `f`. In other words, - // `Policy::apply()` must be SFINAE-friendly. If `value_type` is not - // constructible from `Ts&&...`, either SFINAE or a hard compile error is OK. - // - // If `Ts...` is `[cv] value_type[&]` or `[cv] init_type[&]`, - // `Policy::apply()` must work. A compile error is not allowed, SFINAE or not. - template - static auto apply(F&& f, Ts&&... ts) - -> decltype(P::apply(std::forward(f), std::forward(ts)...)) { - return P::apply(std::forward(f), std::forward(ts)...); - } - - // Returns the "key" portion of the slot. - // Used for node handle manipulation. - template - static auto key(slot_type* slot) - -> decltype(P::apply(ReturnKey(), element(slot))) { - return P::apply(ReturnKey(), element(slot)); - } - - // Returns the "value" (as opposed to the "key") portion of the element. Used - // by maps to implement `operator[]`, `at()` and `insert_or_assign()`. - template - static auto value(T* elem) -> decltype(P::value(elem)) { - return P::value(elem); - } - - private: - // Use auto -> decltype as an enabler. - template - static auto transfer_impl(Alloc* alloc, slot_type* new_slot, - slot_type* old_slot, int) - -> decltype((void)P::transfer(alloc, new_slot, old_slot)) { - P::transfer(alloc, new_slot, old_slot); - } - template - static void transfer_impl(Alloc* alloc, slot_type* new_slot, - slot_type* old_slot, char) { - construct(alloc, new_slot, std::move(element(old_slot))); - destroy(alloc, old_slot); - } -}; - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_traits_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_traits_test.cc deleted file mode 100644 index e643d1899..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hash_policy_traits_test.cc +++ /dev/null @@ -1,142 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hash_policy_traits.h" - -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" - -namespace absl { -namespace container_internal { -namespace { - -using ::testing::MockFunction; -using ::testing::Return; -using ::testing::ReturnRef; - -using Alloc = std::allocator; -using Slot = int; - -struct PolicyWithoutOptionalOps { - using slot_type = Slot; - using key_type = Slot; - using init_type = Slot; - - static std::function construct; - static std::function destroy; - - static std::function element; - static int apply(int v) { return apply_impl(v); } - static std::function apply_impl; - static std::function value; -}; - -std::function PolicyWithoutOptionalOps::construct; -std::function PolicyWithoutOptionalOps::destroy; - -std::function PolicyWithoutOptionalOps::element; -std::function PolicyWithoutOptionalOps::apply_impl; -std::function PolicyWithoutOptionalOps::value; - -struct PolicyWithOptionalOps : PolicyWithoutOptionalOps { - static std::function transfer; -}; - -std::function PolicyWithOptionalOps::transfer; - -struct Test : ::testing::Test { - Test() { - PolicyWithoutOptionalOps::construct = [&](void* a1, Slot* a2, Slot a3) { - construct.Call(a1, a2, std::move(a3)); - }; - PolicyWithoutOptionalOps::destroy = [&](void* a1, Slot* a2) { - destroy.Call(a1, a2); - }; - - PolicyWithoutOptionalOps::element = [&](Slot* a1) -> Slot& { - return element.Call(a1); - }; - PolicyWithoutOptionalOps::apply_impl = [&](int a1) -> int { - return apply.Call(a1); - }; - PolicyWithoutOptionalOps::value = [&](Slot* a1) -> Slot& { - return value.Call(a1); - }; - - PolicyWithOptionalOps::transfer = [&](void* a1, Slot* a2, Slot* a3) { - return transfer.Call(a1, a2, a3); - }; - } - - std::allocator alloc; - int a = 53; - - MockFunction construct; - MockFunction destroy; - - MockFunction element; - MockFunction apply; - MockFunction value; - - MockFunction transfer; -}; - -TEST_F(Test, construct) { - EXPECT_CALL(construct, Call(&alloc, &a, 53)); - hash_policy_traits::construct(&alloc, &a, 53); -} - -TEST_F(Test, destroy) { - EXPECT_CALL(destroy, Call(&alloc, &a)); - hash_policy_traits::destroy(&alloc, &a); -} - -TEST_F(Test, element) { - int b = 0; - EXPECT_CALL(element, Call(&a)).WillOnce(ReturnRef(b)); - EXPECT_EQ(&b, &hash_policy_traits::element(&a)); -} - -TEST_F(Test, apply) { - EXPECT_CALL(apply, Call(42)).WillOnce(Return(1337)); - EXPECT_EQ(1337, (hash_policy_traits::apply(42))); -} - -TEST_F(Test, value) { - int b = 0; - EXPECT_CALL(value, Call(&a)).WillOnce(ReturnRef(b)); - EXPECT_EQ(&b, &hash_policy_traits::value(&a)); -} - -TEST_F(Test, without_transfer) { - int b = 42; - EXPECT_CALL(element, Call(&b)).WillOnce(::testing::ReturnRef(b)); - EXPECT_CALL(construct, Call(&alloc, &a, b)); - EXPECT_CALL(destroy, Call(&alloc, &b)); - hash_policy_traits::transfer(&alloc, &a, &b); -} - -TEST_F(Test, with_transfer) { - int b = 42; - EXPECT_CALL(transfer, Call(&alloc, &a, &b)); - hash_policy_traits::transfer(&alloc, &a, &b); -} - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtable_debug.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtable_debug.h deleted file mode 100644 index 719300046..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtable_debug.h +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// This library provides APIs to debug the probing behavior of hash tables. -// -// In general, the probing behavior is a black box for users and only the -// side effects can be measured in the form of performance differences. -// These APIs give a glimpse on the actual behavior of the probing algorithms in -// these hashtables given a specified hash function and a set of elements. -// -// The probe count distribution can be used to assess the quality of the hash -// function for that particular hash table. Note that a hash function that -// performs well in one hash table implementation does not necessarily performs -// well in a different one. -// -// This library supports std::unordered_{set,map}, dense_hash_{set,map} and -// absl::{flat,node,string}_hash_{set,map}. - -#ifndef ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_H_ -#define ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_H_ - -#include -#include -#include -#include - -#include "absl/container/internal/hashtable_debug_hooks.h" - -namespace absl { -namespace container_internal { - -// Returns the number of probes required to lookup `key`. Returns 0 for a -// search with no collisions. Higher values mean more hash collisions occurred; -// however, the exact meaning of this number varies according to the container -// type. -template -size_t GetHashtableDebugNumProbes( - const C& c, const typename C::key_type& key) { - return absl::container_internal::hashtable_debug_internal:: - HashtableDebugAccess::GetNumProbes(c, key); -} - -// Gets a histogram of the number of probes for each elements in the container. -// The sum of all the values in the vector is equal to container.size(). -template -std::vector GetHashtableDebugNumProbesHistogram(const C& container) { - std::vector v; - for (auto it = container.begin(); it != container.end(); ++it) { - size_t num_probes = GetHashtableDebugNumProbes( - container, - absl::container_internal::hashtable_debug_internal::GetKey(*it, 0)); - v.resize((std::max)(v.size(), num_probes + 1)); - v[num_probes]++; - } - return v; -} - -struct HashtableDebugProbeSummary { - size_t total_elements; - size_t total_num_probes; - double mean; -}; - -// Gets a summary of the probe count distribution for the elements in the -// container. -template -HashtableDebugProbeSummary GetHashtableDebugProbeSummary(const C& container) { - auto probes = GetHashtableDebugNumProbesHistogram(container); - HashtableDebugProbeSummary summary = {}; - for (size_t i = 0; i < probes.size(); ++i) { - summary.total_elements += probes[i]; - summary.total_num_probes += probes[i] * i; - } - summary.mean = 1.0 * summary.total_num_probes / summary.total_elements; - return summary; -} - -// Returns the number of bytes requested from the allocator by the container -// and not freed. -template -size_t AllocatedByteSize(const C& c) { - return absl::container_internal::hashtable_debug_internal:: - HashtableDebugAccess::AllocatedByteSize(c); -} - -// Returns a tight lower bound for AllocatedByteSize(c) where `c` is of type `C` -// and `c.size()` is equal to `num_elements`. -template -size_t LowerBoundAllocatedByteSize(size_t num_elements) { - return absl::container_internal::hashtable_debug_internal:: - HashtableDebugAccess::LowerBoundAllocatedByteSize(num_elements); -} - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h deleted file mode 100644 index 371ce81f5..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtable_debug_hooks.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Provides the internal API for hashtable_debug.h. - -#ifndef ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ -#define ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ - -#include - -#include -#include -#include - -namespace absl { -namespace container_internal { -namespace hashtable_debug_internal { - -// If it is a map, call get<0>(). -using std::get; -template -auto GetKey(const typename T::value_type& pair, int) -> decltype(get<0>(pair)) { - return get<0>(pair); -} - -// If it is not a map, return the value directly. -template -const typename T::key_type& GetKey(const typename T::key_type& key, char) { - return key; -} - -// Containers should specialize this to provide debug information for that -// container. -template -struct HashtableDebugAccess { - // Returns the number of probes required to find `key` in `c`. The "number of - // probes" is a concept that can vary by container. Implementations should - // return 0 when `key` was found in the minimum number of operations and - // should increment the result for each non-trivial operation required to find - // `key`. - // - // The default implementation uses the bucket api from the standard and thus - // works for `std::unordered_*` containers. - static size_t GetNumProbes(const Container& c, - const typename Container::key_type& key) { - if (!c.bucket_count()) return {}; - size_t num_probes = 0; - size_t bucket = c.bucket(key); - for (auto it = c.begin(bucket), e = c.end(bucket);; ++it, ++num_probes) { - if (it == e) return num_probes; - if (c.key_eq()(key, GetKey(*it, 0))) return num_probes; - } - } - - // Returns the number of bytes requested from the allocator by the container - // and not freed. - // - // static size_t AllocatedByteSize(const Container& c); - - // Returns a tight lower bound for AllocatedByteSize(c) where `c` is of type - // `Container` and `c.size()` is equal to `num_elements`. - // - // static size_t LowerBoundAllocatedByteSize(size_t num_elements); -}; - -} // namespace hashtable_debug_internal -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_HASHTABLE_DEBUG_HOOKS_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc deleted file mode 100644 index 6667d3ad8..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.cc +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hashtablez_sampler.h" - -#include -#include -#include -#include -#include - -#include "absl/base/attributes.h" -#include "absl/container/internal/have_sse.h" -#include "absl/debugging/stacktrace.h" -#include "absl/memory/memory.h" -#include "absl/synchronization/mutex.h" - -namespace absl { -namespace container_internal { -constexpr int HashtablezInfo::kMaxStackDepth; - -namespace { -ABSL_CONST_INIT std::atomic g_hashtablez_enabled{ - false -}; -ABSL_CONST_INIT std::atomic g_hashtablez_sample_parameter{1 << 10}; -ABSL_CONST_INIT std::atomic g_hashtablez_max_samples{1 << 20}; - -// Returns the next pseudo-random value. -// pRNG is: aX+b mod c with a = 0x5DEECE66D, b = 0xB, c = 1<<48 -// This is the lrand64 generator. -uint64_t NextRandom(uint64_t rnd) { - const uint64_t prng_mult = uint64_t{0x5DEECE66D}; - const uint64_t prng_add = 0xB; - const uint64_t prng_mod_power = 48; - const uint64_t prng_mod_mask = ~(~uint64_t{0} << prng_mod_power); - return (prng_mult * rnd + prng_add) & prng_mod_mask; -} - -// Generates a geometric variable with the specified mean. -// This is done by generating a random number between 0 and 1 and applying -// the inverse cumulative distribution function for an exponential. -// Specifically: Let m be the inverse of the sample period, then -// the probability distribution function is m*exp(-mx) so the CDF is -// p = 1 - exp(-mx), so -// q = 1 - p = exp(-mx) -// log_e(q) = -mx -// -log_e(q)/m = x -// log_2(q) * (-log_e(2) * 1/m) = x -// In the code, q is actually in the range 1 to 2**26, hence the -26 below -// -int64_t GetGeometricVariable(int64_t mean) { -#if ABSL_HAVE_THREAD_LOCAL - thread_local -#else // ABSL_HAVE_THREAD_LOCAL - // SampleSlow and hence GetGeometricVariable is guarded by a single mutex when - // there are not thread locals. Thus, a single global rng is acceptable for - // that case. - static -#endif // ABSL_HAVE_THREAD_LOCAL - uint64_t rng = []() { - // We don't get well distributed numbers from this so we call - // NextRandom() a bunch to mush the bits around. We use a global_rand - // to handle the case where the same thread (by memory address) gets - // created and destroyed repeatedly. - ABSL_CONST_INIT static std::atomic global_rand(0); - uint64_t r = reinterpret_cast(&rng) + - global_rand.fetch_add(1, std::memory_order_relaxed); - for (int i = 0; i < 20; ++i) { - r = NextRandom(r); - } - return r; - }(); - - rng = NextRandom(rng); - - // Take the top 26 bits as the random number - // (This plus the 1<<58 sampling bound give a max possible step of - // 5194297183973780480 bytes.) - const uint64_t prng_mod_power = 48; // Number of bits in prng - // The uint32_t cast is to prevent a (hard-to-reproduce) NAN - // under piii debug for some binaries. - double q = static_cast(rng >> (prng_mod_power - 26)) + 1.0; - // Put the computed p-value through the CDF of a geometric. - double interval = (log2(q) - 26) * (-std::log(2.0) * mean); - - // Very large values of interval overflow int64_t. If we happen to - // hit such improbable condition, we simply cheat and clamp interval - // to largest supported value. - if (interval > static_cast(std::numeric_limits::max() / 2)) { - return std::numeric_limits::max() / 2; - } - - // Small values of interval are equivalent to just sampling next time. - if (interval < 1) { - return 1; - } - return static_cast(interval); -} - -} // namespace - -HashtablezSampler& HashtablezSampler::Global() { - static auto* sampler = new HashtablezSampler(); - return *sampler; -} - -HashtablezSampler::DisposeCallback HashtablezSampler::SetDisposeCallback( - DisposeCallback f) { - return dispose_.exchange(f, std::memory_order_relaxed); -} - -HashtablezInfo::HashtablezInfo() { PrepareForSampling(); } -HashtablezInfo::~HashtablezInfo() = default; - -void HashtablezInfo::PrepareForSampling() { - capacity.store(0, std::memory_order_relaxed); - size.store(0, std::memory_order_relaxed); - num_erases.store(0, std::memory_order_relaxed); - max_probe_length.store(0, std::memory_order_relaxed); - total_probe_length.store(0, std::memory_order_relaxed); - hashes_bitwise_or.store(0, std::memory_order_relaxed); - hashes_bitwise_and.store(~size_t{}, std::memory_order_relaxed); - - create_time = absl::Now(); - // The inliner makes hardcoded skip_count difficult (especially when combined - // with LTO). We use the ability to exclude stacks by regex when encoding - // instead. - depth = absl::GetStackTrace(stack, HashtablezInfo::kMaxStackDepth, - /* skip_count= */ 0); - dead = nullptr; -} - -HashtablezSampler::HashtablezSampler() - : dropped_samples_(0), size_estimate_(0), all_(nullptr), dispose_(nullptr) { - absl::MutexLock l(&graveyard_.init_mu); - graveyard_.dead = &graveyard_; -} - -HashtablezSampler::~HashtablezSampler() { - HashtablezInfo* s = all_.load(std::memory_order_acquire); - while (s != nullptr) { - HashtablezInfo* next = s->next; - delete s; - s = next; - } -} - -void HashtablezSampler::PushNew(HashtablezInfo* sample) { - sample->next = all_.load(std::memory_order_relaxed); - while (!all_.compare_exchange_weak(sample->next, sample, - std::memory_order_release, - std::memory_order_relaxed)) { - } -} - -void HashtablezSampler::PushDead(HashtablezInfo* sample) { - if (auto* dispose = dispose_.load(std::memory_order_relaxed)) { - dispose(*sample); - } - - absl::MutexLock graveyard_lock(&graveyard_.init_mu); - absl::MutexLock sample_lock(&sample->init_mu); - sample->dead = graveyard_.dead; - graveyard_.dead = sample; -} - -HashtablezInfo* HashtablezSampler::PopDead() { - absl::MutexLock graveyard_lock(&graveyard_.init_mu); - - // The list is circular, so eventually it collapses down to - // graveyard_.dead == &graveyard_ - // when it is empty. - HashtablezInfo* sample = graveyard_.dead; - if (sample == &graveyard_) return nullptr; - - absl::MutexLock sample_lock(&sample->init_mu); - graveyard_.dead = sample->dead; - sample->PrepareForSampling(); - return sample; -} - -HashtablezInfo* HashtablezSampler::Register() { - int64_t size = size_estimate_.fetch_add(1, std::memory_order_relaxed); - if (size > g_hashtablez_max_samples.load(std::memory_order_relaxed)) { - size_estimate_.fetch_sub(1, std::memory_order_relaxed); - dropped_samples_.fetch_add(1, std::memory_order_relaxed); - return nullptr; - } - - HashtablezInfo* sample = PopDead(); - if (sample == nullptr) { - // Resurrection failed. Hire a new warlock. - sample = new HashtablezInfo(); - PushNew(sample); - } - - return sample; -} - -void HashtablezSampler::Unregister(HashtablezInfo* sample) { - PushDead(sample); - size_estimate_.fetch_sub(1, std::memory_order_relaxed); -} - -int64_t HashtablezSampler::Iterate( - const std::function& f) { - HashtablezInfo* s = all_.load(std::memory_order_acquire); - while (s != nullptr) { - absl::MutexLock l(&s->init_mu); - if (s->dead == nullptr) { - f(*s); - } - s = s->next; - } - - return dropped_samples_.load(std::memory_order_relaxed); -} - -HashtablezInfo* SampleSlow(int64_t* next_sample) { - if (kAbslContainerInternalSampleEverything) { - *next_sample = 1; - return HashtablezSampler::Global().Register(); - } - - bool first = *next_sample < 0; - *next_sample = GetGeometricVariable( - g_hashtablez_sample_parameter.load(std::memory_order_relaxed)); - - // g_hashtablez_enabled can be dynamically flipped, we need to set a threshold - // low enough that we will start sampling in a reasonable time, so we just use - // the default sampling rate. - if (!g_hashtablez_enabled.load(std::memory_order_relaxed)) return nullptr; - - // We will only be negative on our first count, so we should just retry in - // that case. - if (first) { - if (ABSL_PREDICT_TRUE(--*next_sample > 0)) return nullptr; - return SampleSlow(next_sample); - } - - return HashtablezSampler::Global().Register(); -} - -#if ABSL_PER_THREAD_TLS == 1 -ABSL_PER_THREAD_TLS_KEYWORD int64_t global_next_sample = 0; -#endif // ABSL_PER_THREAD_TLS == 1 - -void UnsampleSlow(HashtablezInfo* info) { - HashtablezSampler::Global().Unregister(info); -} - -void RecordInsertSlow(HashtablezInfo* info, size_t hash, - size_t distance_from_desired) { - // SwissTables probe in groups of 16, so scale this to count items probes and - // not offset from desired. - size_t probe_length = distance_from_desired; -#if SWISSTABLE_HAVE_SSE2 - probe_length /= 16; -#else - probe_length /= 8; -#endif - - info->hashes_bitwise_and.fetch_and(hash, std::memory_order_relaxed); - info->hashes_bitwise_or.fetch_or(hash, std::memory_order_relaxed); - info->max_probe_length.store( - std::max(info->max_probe_length.load(std::memory_order_relaxed), - probe_length), - std::memory_order_relaxed); - info->total_probe_length.fetch_add(probe_length, std::memory_order_relaxed); - info->size.fetch_add(1, std::memory_order_relaxed); -} - -void SetHashtablezEnabled(bool enabled) { - g_hashtablez_enabled.store(enabled, std::memory_order_release); -} - -void SetHashtablezSampleParameter(int32_t rate) { - if (rate > 0) { - g_hashtablez_sample_parameter.store(rate, std::memory_order_release); - } else { - ABSL_RAW_LOG(ERROR, "Invalid hashtablez sample rate: %lld", - static_cast(rate)); // NOLINT(runtime/int) - } -} - -void SetHashtablezMaxSamples(int32_t max) { - if (max > 0) { - g_hashtablez_max_samples.store(max, std::memory_order_release); - } else { - ABSL_RAW_LOG(ERROR, "Invalid hashtablez max samples: %lld", - static_cast(max)); // NOLINT(runtime/int) - } -} - -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h deleted file mode 100644 index a308e7881..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler.h +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ----------------------------------------------------------------------------- -// File: hashtablez_sampler.h -// ----------------------------------------------------------------------------- -// -// This header file defines the API for a low level library to sample hashtables -// and collect runtime statistics about them. -// -// `HashtablezSampler` controls the lifecycle of `HashtablezInfo` objects which -// store information about a single sample. -// -// `Record*` methods store information into samples. -// `Sample()` and `Unsample()` make use of a single global sampler with -// properties controlled by the flags hashtablez_enabled, -// hashtablez_sample_rate, and hashtablez_max_samples. -// -// WARNING -// -// Using this sampling API may cause sampled Swiss tables to use the global -// allocator (operator `new`) in addition to any custom allocator. If you -// are using a table in an unusual circumstance where allocation or calling a -// linux syscall is unacceptable, this could interfere. -// -// This utility is internal-only. Use at your own risk. - -#ifndef ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_ -#define ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_ - -#include -#include -#include -#include - -#include "absl/base/internal/per_thread_tls.h" -#include "absl/base/optimization.h" -#include "absl/container/internal/have_sse.h" -#include "absl/synchronization/mutex.h" -#include "absl/utility/utility.h" - -namespace absl { -namespace container_internal { - -// Stores information about a sampled hashtable. All mutations to this *must* -// be made through `Record*` functions below. All reads from this *must* only -// occur in the callback to `HashtablezSampler::Iterate`. -struct HashtablezInfo { - // Constructs the object but does not fill in any fields. - HashtablezInfo(); - ~HashtablezInfo(); - HashtablezInfo(const HashtablezInfo&) = delete; - HashtablezInfo& operator=(const HashtablezInfo&) = delete; - - // Puts the object into a clean state, fills in the logically `const` members, - // blocking for any readers that are currently sampling the object. - void PrepareForSampling() EXCLUSIVE_LOCKS_REQUIRED(init_mu); - - // These fields are mutated by the various Record* APIs and need to be - // thread-safe. - std::atomic capacity; - std::atomic size; - std::atomic num_erases; - std::atomic max_probe_length; - std::atomic total_probe_length; - std::atomic hashes_bitwise_or; - std::atomic hashes_bitwise_and; - - // `HashtablezSampler` maintains intrusive linked lists for all samples. See - // comments on `HashtablezSampler::all_` for details on these. `init_mu` - // guards the ability to restore the sample to a pristine state. This - // prevents races with sampling and resurrecting an object. - absl::Mutex init_mu; - HashtablezInfo* next; - HashtablezInfo* dead GUARDED_BY(init_mu); - - // All of the fields below are set by `PrepareForSampling`, they must not be - // mutated in `Record*` functions. They are logically `const` in that sense. - // These are guarded by init_mu, but that is not externalized to clients, who - // can only read them during `HashtablezSampler::Iterate` which will hold the - // lock. - static constexpr int kMaxStackDepth = 64; - absl::Time create_time; - int32_t depth; - void* stack[kMaxStackDepth]; -}; - -inline void RecordRehashSlow(HashtablezInfo* info, size_t total_probe_length) { -#if SWISSTABLE_HAVE_SSE2 - total_probe_length /= 16; -#else - total_probe_length /= 8; -#endif - info->total_probe_length.store(total_probe_length, std::memory_order_relaxed); - info->num_erases.store(0, std::memory_order_relaxed); -} - -inline void RecordStorageChangedSlow(HashtablezInfo* info, size_t size, - size_t capacity) { - info->size.store(size, std::memory_order_relaxed); - info->capacity.store(capacity, std::memory_order_relaxed); - if (size == 0) { - // This is a clear, reset the total/num_erases too. - RecordRehashSlow(info, 0); - } -} - -void RecordInsertSlow(HashtablezInfo* info, size_t hash, - size_t distance_from_desired); - -inline void RecordEraseSlow(HashtablezInfo* info) { - info->size.fetch_sub(1, std::memory_order_relaxed); - info->num_erases.fetch_add(1, std::memory_order_relaxed); -} - -HashtablezInfo* SampleSlow(int64_t* next_sample); -void UnsampleSlow(HashtablezInfo* info); - -class HashtablezInfoHandle { - public: - explicit HashtablezInfoHandle() : info_(nullptr) {} - explicit HashtablezInfoHandle(HashtablezInfo* info) : info_(info) {} - ~HashtablezInfoHandle() { - if (ABSL_PREDICT_TRUE(info_ == nullptr)) return; - UnsampleSlow(info_); - } - - HashtablezInfoHandle(const HashtablezInfoHandle&) = delete; - HashtablezInfoHandle& operator=(const HashtablezInfoHandle&) = delete; - - HashtablezInfoHandle(HashtablezInfoHandle&& o) noexcept - : info_(absl::exchange(o.info_, nullptr)) {} - HashtablezInfoHandle& operator=(HashtablezInfoHandle&& o) noexcept { - if (ABSL_PREDICT_FALSE(info_ != nullptr)) { - UnsampleSlow(info_); - } - info_ = absl::exchange(o.info_, nullptr); - return *this; - } - - inline void RecordStorageChanged(size_t size, size_t capacity) { - if (ABSL_PREDICT_TRUE(info_ == nullptr)) return; - RecordStorageChangedSlow(info_, size, capacity); - } - - inline void RecordRehash(size_t total_probe_length) { - if (ABSL_PREDICT_TRUE(info_ == nullptr)) return; - RecordRehashSlow(info_, total_probe_length); - } - - inline void RecordInsert(size_t hash, size_t distance_from_desired) { - if (ABSL_PREDICT_TRUE(info_ == nullptr)) return; - RecordInsertSlow(info_, hash, distance_from_desired); - } - - inline void RecordErase() { - if (ABSL_PREDICT_TRUE(info_ == nullptr)) return; - RecordEraseSlow(info_); - } - - friend inline void swap(HashtablezInfoHandle& lhs, - HashtablezInfoHandle& rhs) { - std::swap(lhs.info_, rhs.info_); - } - - private: - friend class HashtablezInfoHandlePeer; - HashtablezInfo* info_; -}; - -#if ABSL_PER_THREAD_TLS == 1 -extern ABSL_PER_THREAD_TLS_KEYWORD int64_t global_next_sample; -#endif // ABSL_PER_THREAD_TLS - -// Returns an RAII sampling handle that manages registration and unregistation -// with the global sampler. -inline HashtablezInfoHandle Sample() { -#if ABSL_PER_THREAD_TLS == 0 - static auto* mu = new absl::Mutex; - static int64_t global_next_sample = 0; - absl::MutexLock l(mu); -#endif // !ABSL_HAVE_THREAD_LOCAL - - if (ABSL_PREDICT_TRUE(--global_next_sample > 0)) { - return HashtablezInfoHandle(nullptr); - } - return HashtablezInfoHandle(SampleSlow(&global_next_sample)); -} - -// Holds samples and their associated stack traces with a soft limit of -// `SetHashtablezMaxSamples()`. -// -// Thread safe. -class HashtablezSampler { - public: - // Returns a global Sampler. - static HashtablezSampler& Global(); - - HashtablezSampler(); - ~HashtablezSampler(); - - // Registers for sampling. Returns an opaque registration info. - HashtablezInfo* Register(); - - // Unregisters the sample. - void Unregister(HashtablezInfo* sample); - - // The dispose callback will be called on all samples the moment they are - // being unregistered. Only affects samples that are unregistered after the - // callback has been set. - // Returns the previous callback. - using DisposeCallback = void (*)(const HashtablezInfo&); - DisposeCallback SetDisposeCallback(DisposeCallback f); - - // Iterates over all the registered `StackInfo`s. Returning the number of - // samples that have been dropped. - int64_t Iterate(const std::function& f); - - private: - void PushNew(HashtablezInfo* sample); - void PushDead(HashtablezInfo* sample); - HashtablezInfo* PopDead(); - - std::atomic dropped_samples_; - std::atomic size_estimate_; - - // Intrusive lock free linked lists for tracking samples. - // - // `all_` records all samples (they are never removed from this list) and is - // terminated with a `nullptr`. - // - // `graveyard_.dead` is a circular linked list. When it is empty, - // `graveyard_.dead == &graveyard`. The list is circular so that - // every item on it (even the last) has a non-null dead pointer. This allows - // `Iterate` to determine if a given sample is live or dead using only - // information on the sample itself. - // - // For example, nodes [A, B, C, D, E] with [A, C, E] alive and [B, D] dead - // looks like this (G is the Graveyard): - // - // +---+ +---+ +---+ +---+ +---+ - // all -->| A |--->| B |--->| C |--->| D |--->| E | - // | | | | | | | | | | - // +---+ | | +->| |-+ | | +->| |-+ | | - // | G | +---+ | +---+ | +---+ | +---+ | +---+ - // | | | | | | - // | | --------+ +--------+ | - // +---+ | - // ^ | - // +--------------------------------------+ - // - std::atomic all_; - HashtablezInfo graveyard_; - - std::atomic dispose_; -}; - -// Enables or disables sampling for Swiss tables. -void SetHashtablezEnabled(bool enabled); - -// Sets the rate at which Swiss tables will be sampled. -void SetHashtablezSampleParameter(int32_t rate); - -// Sets a soft max for the number of samples that will be kept. -void SetHashtablezMaxSamples(int32_t max); - -// Configuration override. -// This allows process-wide sampling without depending on order of -// initialization of static storage duration objects. -// The definition of this constant is weak, which allows us to inject a -// different value for it at link time. -extern "C" const bool kAbslContainerInternalSampleEverything; - -} // namespace container_internal -} // namespace absl - -#endif // ABSL_CONTAINER_INTERNAL_HASHTABLEZ_SAMPLER_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc deleted file mode 100644 index 4ca6ffdad..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_force_weak_definition.cc +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hashtablez_sampler.h" - -#include "absl/base/attributes.h" - -namespace absl { -namespace container_internal { - -// See hashtablez_sampler.h for details. -extern "C" ABSL_ATTRIBUTE_WEAK const bool - kAbslContainerInternalSampleEverything = false; - -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc deleted file mode 100644 index d2435ed8a..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/hashtablez_sampler_test.cc +++ /dev/null @@ -1,355 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "absl/container/internal/hashtablez_sampler.h" - -#include -#include -#include - -#include "gmock/gmock.h" -#include "gtest/gtest.h" -#include "absl/base/attributes.h" -#include "absl/container/internal/have_sse.h" -#include "absl/synchronization/blocking_counter.h" -#include "absl/synchronization/internal/thread_pool.h" -#include "absl/synchronization/mutex.h" -#include "absl/synchronization/notification.h" -#include "absl/time/clock.h" -#include "absl/time/time.h" - -#if SWISSTABLE_HAVE_SSE2 -constexpr int kProbeLength = 16; -#else -constexpr int kProbeLength = 8; -#endif - -namespace absl { -namespace container_internal { -class HashtablezInfoHandlePeer { - public: - static bool IsSampled(const HashtablezInfoHandle& h) { - return h.info_ != nullptr; - } - - static HashtablezInfo* GetInfo(HashtablezInfoHandle* h) { return h->info_; } -}; - -namespace { -using ::absl::synchronization_internal::ThreadPool; -using ::testing::IsEmpty; -using ::testing::UnorderedElementsAre; - -std::vector GetSizes(HashtablezSampler* s) { - std::vector res; - s->Iterate([&](const HashtablezInfo& info) { - res.push_back(info.size.load(std::memory_order_acquire)); - }); - return res; -} - -HashtablezInfo* Register(HashtablezSampler* s, size_t size) { - auto* info = s->Register(); - assert(info != nullptr); - info->size.store(size); - return info; -} - -TEST(HashtablezInfoTest, PrepareForSampling) { - absl::Time test_start = absl::Now(); - HashtablezInfo info; - absl::MutexLock l(&info.init_mu); - info.PrepareForSampling(); - - EXPECT_EQ(info.capacity.load(), 0); - EXPECT_EQ(info.size.load(), 0); - EXPECT_EQ(info.num_erases.load(), 0); - EXPECT_EQ(info.max_probe_length.load(), 0); - EXPECT_EQ(info.total_probe_length.load(), 0); - EXPECT_EQ(info.hashes_bitwise_or.load(), 0); - EXPECT_EQ(info.hashes_bitwise_and.load(), ~size_t{}); - EXPECT_GE(info.create_time, test_start); - - info.capacity.store(1, std::memory_order_relaxed); - info.size.store(1, std::memory_order_relaxed); - info.num_erases.store(1, std::memory_order_relaxed); - info.max_probe_length.store(1, std::memory_order_relaxed); - info.total_probe_length.store(1, std::memory_order_relaxed); - info.hashes_bitwise_or.store(1, std::memory_order_relaxed); - info.hashes_bitwise_and.store(1, std::memory_order_relaxed); - info.create_time = test_start - absl::Hours(20); - - info.PrepareForSampling(); - EXPECT_EQ(info.capacity.load(), 0); - EXPECT_EQ(info.size.load(), 0); - EXPECT_EQ(info.num_erases.load(), 0); - EXPECT_EQ(info.max_probe_length.load(), 0); - EXPECT_EQ(info.total_probe_length.load(), 0); - EXPECT_EQ(info.hashes_bitwise_or.load(), 0); - EXPECT_EQ(info.hashes_bitwise_and.load(), ~size_t{}); - EXPECT_GE(info.create_time, test_start); -} - -TEST(HashtablezInfoTest, RecordStorageChanged) { - HashtablezInfo info; - absl::MutexLock l(&info.init_mu); - info.PrepareForSampling(); - RecordStorageChangedSlow(&info, 17, 47); - EXPECT_EQ(info.size.load(), 17); - EXPECT_EQ(info.capacity.load(), 47); - RecordStorageChangedSlow(&info, 20, 20); - EXPECT_EQ(info.size.load(), 20); - EXPECT_EQ(info.capacity.load(), 20); -} - -TEST(HashtablezInfoTest, RecordInsert) { - HashtablezInfo info; - absl::MutexLock l(&info.init_mu); - info.PrepareForSampling(); - EXPECT_EQ(info.max_probe_length.load(), 0); - RecordInsertSlow(&info, 0x0000FF00, 6 * kProbeLength); - EXPECT_EQ(info.max_probe_length.load(), 6); - EXPECT_EQ(info.hashes_bitwise_and.load(), 0x0000FF00); - EXPECT_EQ(info.hashes_bitwise_or.load(), 0x0000FF00); - RecordInsertSlow(&info, 0x000FF000, 4 * kProbeLength); - EXPECT_EQ(info.max_probe_length.load(), 6); - EXPECT_EQ(info.hashes_bitwise_and.load(), 0x0000F000); - EXPECT_EQ(info.hashes_bitwise_or.load(), 0x000FFF00); - RecordInsertSlow(&info, 0x00FF0000, 12 * kProbeLength); - EXPECT_EQ(info.max_probe_length.load(), 12); - EXPECT_EQ(info.hashes_bitwise_and.load(), 0x00000000); - EXPECT_EQ(info.hashes_bitwise_or.load(), 0x00FFFF00); -} - -TEST(HashtablezInfoTest, RecordErase) { - HashtablezInfo info; - absl::MutexLock l(&info.init_mu); - info.PrepareForSampling(); - EXPECT_EQ(info.num_erases.load(), 0); - EXPECT_EQ(info.size.load(), 0); - RecordInsertSlow(&info, 0x0000FF00, 6 * kProbeLength); - EXPECT_EQ(info.size.load(), 1); - RecordEraseSlow(&info); - EXPECT_EQ(info.size.load(), 0); - EXPECT_EQ(info.num_erases.load(), 1); -} - -TEST(HashtablezInfoTest, RecordRehash) { - HashtablezInfo info; - absl::MutexLock l(&info.init_mu); - info.PrepareForSampling(); - RecordInsertSlow(&info, 0x1, 0); - RecordInsertSlow(&info, 0x2, kProbeLength); - RecordInsertSlow(&info, 0x4, kProbeLength); - RecordInsertSlow(&info, 0x8, 2 * kProbeLength); - EXPECT_EQ(info.size.load(), 4); - EXPECT_EQ(info.total_probe_length.load(), 4); - - RecordEraseSlow(&info); - RecordEraseSlow(&info); - EXPECT_EQ(info.size.load(), 2); - EXPECT_EQ(info.total_probe_length.load(), 4); - EXPECT_EQ(info.num_erases.load(), 2); - - RecordRehashSlow(&info, 3 * kProbeLength); - EXPECT_EQ(info.size.load(), 2); - EXPECT_EQ(info.total_probe_length.load(), 3); - EXPECT_EQ(info.num_erases.load(), 0); -} - -TEST(HashtablezSamplerTest, SmallSampleParameter) { - SetHashtablezEnabled(true); - SetHashtablezSampleParameter(100); - - for (int i = 0; i < 1000; ++i) { - int64_t next_sample = 0; - HashtablezInfo* sample = SampleSlow(&next_sample); - EXPECT_GT(next_sample, 0); - EXPECT_NE(sample, nullptr); - UnsampleSlow(sample); - } -} - -TEST(HashtablezSamplerTest, LargeSampleParameter) { - SetHashtablezEnabled(true); - SetHashtablezSampleParameter(std::numeric_limits::max()); - - for (int i = 0; i < 1000; ++i) { - int64_t next_sample = 0; - HashtablezInfo* sample = SampleSlow(&next_sample); - EXPECT_GT(next_sample, 0); - EXPECT_NE(sample, nullptr); - UnsampleSlow(sample); - } -} - -TEST(HashtablezSamplerTest, Sample) { - SetHashtablezEnabled(true); - SetHashtablezSampleParameter(100); - int64_t num_sampled = 0; - int64_t total = 0; - double sample_rate; - for (int i = 0; i < 1000000; ++i) { - HashtablezInfoHandle h = Sample(); - ++total; - if (HashtablezInfoHandlePeer::IsSampled(h)) { - ++num_sampled; - } - sample_rate = static_cast(num_sampled) / total; - if (0.005 < sample_rate && sample_rate < 0.015) break; - } - EXPECT_NEAR(sample_rate, 0.01, 0.005); -} - -TEST(HashtablezSamplerTest, Handle) { - auto& sampler = HashtablezSampler::Global(); - HashtablezInfoHandle h(sampler.Register()); - auto* info = HashtablezInfoHandlePeer::GetInfo(&h); - info->hashes_bitwise_and.store(0x12345678, std::memory_order_relaxed); - - bool found = false; - sampler.Iterate([&](const HashtablezInfo& h) { - if (&h == info) { - EXPECT_EQ(h.hashes_bitwise_and.load(), 0x12345678); - found = true; - } - }); - EXPECT_TRUE(found); - - h = HashtablezInfoHandle(); - found = false; - sampler.Iterate([&](const HashtablezInfo& h) { - if (&h == info) { - // this will only happen if some other thread has resurrected the info - // the old handle was using. - if (h.hashes_bitwise_and.load() == 0x12345678) { - found = true; - } - } - }); - EXPECT_FALSE(found); -} - -TEST(HashtablezSamplerTest, Registration) { - HashtablezSampler sampler; - auto* info1 = Register(&sampler, 1); - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(1)); - - auto* info2 = Register(&sampler, 2); - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(1, 2)); - info1->size.store(3); - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(3, 2)); - - sampler.Unregister(info1); - sampler.Unregister(info2); -} - -TEST(HashtablezSamplerTest, Unregistration) { - HashtablezSampler sampler; - std::vector infos; - for (size_t i = 0; i < 3; ++i) { - infos.push_back(Register(&sampler, i)); - } - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 1, 2)); - - sampler.Unregister(infos[1]); - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 2)); - - infos.push_back(Register(&sampler, 3)); - infos.push_back(Register(&sampler, 4)); - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 2, 3, 4)); - sampler.Unregister(infos[3]); - EXPECT_THAT(GetSizes(&sampler), UnorderedElementsAre(0, 2, 4)); - - sampler.Unregister(infos[0]); - sampler.Unregister(infos[2]); - sampler.Unregister(infos[4]); - EXPECT_THAT(GetSizes(&sampler), IsEmpty()); -} - -TEST(HashtablezSamplerTest, MultiThreaded) { - HashtablezSampler sampler; - Notification stop; - ThreadPool pool(10); - - for (int i = 0; i < 10; ++i) { - pool.Schedule([&sampler, &stop]() { - std::random_device rd; - std::mt19937 gen(rd()); - - std::vector infoz; - while (!stop.HasBeenNotified()) { - if (infoz.empty()) { - infoz.push_back(sampler.Register()); - } - switch (std::uniform_int_distribution<>(0, 2)(gen)) { - case 0: { - infoz.push_back(sampler.Register()); - break; - } - case 1: { - size_t p = - std::uniform_int_distribution<>(0, infoz.size() - 1)(gen); - HashtablezInfo* info = infoz[p]; - infoz[p] = infoz.back(); - infoz.pop_back(); - sampler.Unregister(info); - break; - } - case 2: { - absl::Duration oldest = absl::ZeroDuration(); - sampler.Iterate([&](const HashtablezInfo& info) { - oldest = std::max(oldest, absl::Now() - info.create_time); - }); - ASSERT_GE(oldest, absl::ZeroDuration()); - break; - } - } - } - }); - } - // The threads will hammer away. Give it a little bit of time for tsan to - // spot errors. - absl::SleepFor(absl::Seconds(3)); - stop.Notify(); -} - -TEST(HashtablezSamplerTest, Callback) { - HashtablezSampler sampler; - - auto* info1 = Register(&sampler, 1); - auto* info2 = Register(&sampler, 2); - - static const HashtablezInfo* expected; - - auto callback = [](const HashtablezInfo& info) { - // We can't use `info` outside of this callback because the object will be - // disposed as soon as we return from here. - EXPECT_EQ(&info, expected); - }; - - // Set the callback. - EXPECT_EQ(sampler.SetDisposeCallback(callback), nullptr); - expected = info1; - sampler.Unregister(info1); - - // Unset the callback. - EXPECT_EQ(callback, sampler.SetDisposeCallback(nullptr)); - expected = nullptr; // no more calls. - sampler.Unregister(info2); -} - -} // namespace -} // namespace container_internal -} // namespace absl diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/have_sse.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/have_sse.h deleted file mode 100644 index 43414418d..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/have_sse.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2018 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Shared config probing for SSE instructions used in Swiss tables. -#ifndef ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_ -#define ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_ - -#ifndef SWISSTABLE_HAVE_SSE2 -#if defined(__SSE2__) || \ - (defined(_MSC_VER) && \ - (defined(_M_X64) || (defined(_M_IX86) && _M_IX86_FP >= 2))) -#define SWISSTABLE_HAVE_SSE2 1 -#else -#define SWISSTABLE_HAVE_SSE2 0 -#endif -#endif - -#ifndef SWISSTABLE_HAVE_SSSE3 -#ifdef __SSSE3__ -#define SWISSTABLE_HAVE_SSSE3 1 -#else -#define SWISSTABLE_HAVE_SSSE3 0 -#endif -#endif - -#if SWISSTABLE_HAVE_SSSE3 && !SWISSTABLE_HAVE_SSE2 -#error "Bad configuration!" -#endif - -#if SWISSTABLE_HAVE_SSE2 -#include -#endif - -#if SWISSTABLE_HAVE_SSSE3 -#include -#endif - -#endif // ABSL_CONTAINER_INTERNAL_HAVE_SSE_H_ diff --git a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/inlined_vector.h b/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/inlined_vector.h deleted file mode 100644 index b8b4f4ce3..000000000 --- a/Pods/FirebaseFirestore/Firestore/third_party/abseil-cpp/absl/container/internal/inlined_vector.h +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright 2019 The Abseil Authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef ABSL_CONTAINER_INTERNAL_INLINED_VECTOR_INTERNAL_H_ -#define ABSL_CONTAINER_INTERNAL_INLINED_VECTOR_INTERNAL_H_ - -#include -#include -#include -#include - -#include "absl/container/internal/compressed_tuple.h" -#include "absl/meta/type_traits.h" - -namespace absl { -namespace inlined_vector_internal { - -template -using IsAtLeastForwardIterator = std::is_convertible< - typename std::iterator_traits::iterator_category, - std::forward_iterator_tag>; - -template -class Storage; - -template